From: Cris Di Sclafani Date: Fri, 30 Oct 2020 17:21:20 +0000 (+0100) Subject: Built motion from commit (unavailable).|2.5.4 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=8217b24b8e151359299c82a2011783f9bd2adc28;p=motion2.git Built motion from commit (unavailable).|2.5.4 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index bfb1bee..32a6066 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-30T16:58:24.965Z", "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-30T17:12:22.354Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 26e6844..72f5228 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-30T16:58:24.965Z", "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-30T17:12:22.354Z", "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 b45601e..1aaef00 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 _0x0d99=['bot','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]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','jscripty','urlForward','browser'];(function(_0x3cb827,_0x4c7d54){var _0x4802a2=function(_0x3b5faf){while(--_0x3b5faf){_0x3cb827['push'](_0x3cb827['shift']());}};_0x4802a2(++_0x4c7d54);}(_0x0d99,0x74));var _0x90d9=function(_0xea4f3d,_0x1ca466){_0xea4f3d=_0xea4f3d-0x0;var _0x550d16=_0x0d99[_0xea4f3d];return _0x550d16;};'use strict';var Sequelize=require('sequelize');module[_0x90d9('0x0')]={'name':{'type':Sequelize[_0x90d9('0x1')],'get':function(_0x74648a){return this[_0x90d9('0x2')](_0x90d9('0x3'));}},'action':{'type':Sequelize[_0x90d9('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x90d9('0x5'),_0x90d9('0x6'),'motionbar',_0x90d9('0x7'),_0x90d9('0x8'),_0x90d9('0x9'),_0x90d9('0xa'),'script']],'msg':_0x90d9('0xb')}},'comment':_0x90d9('0xb')},'data1':{'type':Sequelize[_0x90d9('0x4')](0x1000),'comment':_0x90d9('0xc')},'data2':{'type':Sequelize[_0x90d9('0x4')](0x1000),'comment':_0x90d9('0xd')},'data3':{'type':Sequelize[_0x90d9('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x90d9('0x4')](0x1000)},'data6':{'type':Sequelize[_0x90d9('0x4')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5d21=['action','STRING','contactManager','motionbar','browser','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)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x5d21,0xe6));var _0x15d2=function(_0x172da8,_0x584ecd){_0x172da8=_0x172da8-0x0;var _0x32ab6c=_0x5d21[_0x172da8];return _0x32ab6c;};'use strict';var Sequelize=require(_0x15d2('0x0'));module[_0x15d2('0x1')]={'name':{'type':Sequelize[_0x15d2('0x2')],'get':function(_0x693c25){return this[_0x15d2('0x3')](_0x15d2('0x4'));}},'action':{'type':Sequelize[_0x15d2('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x15d2('0x6'),'integration',_0x15d2('0x7'),'jscripty','urlForward',_0x15d2('0x8'),'bot','script']],'msg':_0x15d2('0x9')}},'comment':_0x15d2('0x9')},'data1':{'type':Sequelize[_0x15d2('0x5')](0x1000),'comment':_0x15d2('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x15d2('0x5')](0x1000),'comment':_0x15d2('0xb')},'data4':{'type':Sequelize[_0x15d2('0x5')](0x1000)},'data5':{'type':Sequelize[_0x15d2('0x5')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x15d2('0xc')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 7c949c8..a4ed29e 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 _0xabee=['catch','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','update','body','Action','find'];(function(_0x2b0275,_0x3fe1fe){var _0x43708e=function(_0x4f410c){while(--_0x4f410c){_0x2b0275['push'](_0x2b0275['shift']());}};_0x43708e(++_0x3fe1fe);}(_0xabee,0xf7));var _0xeabe=function(_0x5142b8,_0x1def06){_0x5142b8=_0x5142b8-0x0;var _0x4d3dde=_0xabee[_0x5142b8];return _0x4d3dde;};'use strict';var pdf=require(_0xeabe('0x0'));var emlformat=require(_0xeabe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xeabe('0x2'));var jsonpatch=require(_0xeabe('0x3'));var rp=require(_0xeabe('0x4'));var moment=require(_0xeabe('0x5'));var BPromise=require(_0xeabe('0x6'));var Mustache=require(_0xeabe('0x7'));var util=require(_0xeabe('0x8'));var path=require(_0xeabe('0x9'));var sox=require('sox');var csv=require(_0xeabe('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xeabe('0xb'));var crypto=require(_0xeabe('0xc'));var jsforce=require(_0xeabe('0xd'));var deskjs=require(_0xeabe('0xe'));var toCsv=require(_0xeabe('0xa'));var querystring=require(_0xeabe('0xf'));var Papa=require('papaparse');var Redis=require(_0xeabe('0x10'));var authService=require(_0xeabe('0x11'));var qs=require(_0xeabe('0x12'));var as=require(_0xeabe('0x13'));var hardwareService=require(_0xeabe('0x14'));var logger=require(_0xeabe('0x15'))(_0xeabe('0x16'));var utils=require(_0xeabe('0x17'));var config=require(_0xeabe('0x18'));var db=require(_0xeabe('0x19'))['db'];function respondWithStatusCode(_0x319d8c,_0x3827af){_0x3827af=_0x3827af||0xcc;return function(_0x599fd7){if(_0x599fd7){return _0x319d8c[_0xeabe('0x1a')](_0x3827af);}return _0x319d8c[_0xeabe('0x1b')](_0x3827af)['end']();};}function respondWithResult(_0x47336c,_0x5321d8){_0x5321d8=_0x5321d8||0xc8;return function(_0x1078ae){if(_0x1078ae){return _0x47336c[_0xeabe('0x1b')](_0x5321d8)[_0xeabe('0x1c')](_0x1078ae);}};}function respondWithFilteredResult(_0x4edbd3,_0x238da4){return function(_0x5140be){if(_0x5140be){var _0x1d9226=_0x5140be[_0xeabe('0x1d')],_0x567227=_0x238da4[_0xeabe('0x1e')],_0x45727e=_0x238da4[_0xeabe('0x1e')]+_0x238da4[_0xeabe('0x1f')],_0xf64e76;if(_0x45727e>=_0x1d9226){_0x45727e=_0x1d9226;_0xf64e76=0xc8;}else{_0xf64e76=0xce;}_0x4edbd3[_0xeabe('0x1b')](_0xf64e76);return _0x4edbd3[_0xeabe('0x20')](_0xeabe('0x21'),_0x567227+'-'+_0x45727e+'/'+_0x1d9226)[_0xeabe('0x1c')](_0x5140be);}return null;};}function patchUpdates(_0x5a30de){return function(_0x4aab7e){try{jsonpatch[_0xeabe('0x22')](_0x4aab7e,_0x5a30de,!![]);}catch(_0x2c62aa){return BPromise[_0xeabe('0x23')](_0x2c62aa);}return _0x4aab7e[_0xeabe('0x24')]();};}function saveUpdates(_0x778637,_0x3ee427){return function(_0x3a47db){if(_0x3a47db){return _0x3a47db['update'](_0x778637)[_0xeabe('0x25')](function(_0x31d958){return _0x31d958;});}return null;};}function removeEntity(_0x3a239d,_0x2b5515){return function(_0x24ced8){if(_0x24ced8){return _0x24ced8[_0xeabe('0x26')]()[_0xeabe('0x25')](function(){_0x3a239d[_0xeabe('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e92eb,_0x607d58){return function(_0x59beb2){if(!_0x59beb2){_0x3e92eb[_0xeabe('0x1a')](0x194);}return _0x59beb2;};}function handleError(_0x422806,_0x3e9f90){_0x3e9f90=_0x3e9f90||0x1f4;return function(_0x29e81c){logger[_0xeabe('0x27')](_0x29e81c[_0xeabe('0x28')]);if(_0x29e81c[_0xeabe('0x29')]){delete _0x29e81c[_0xeabe('0x29')];}_0x422806[_0xeabe('0x1b')](_0x3e9f90)[_0xeabe('0x2a')](_0x29e81c);};}exports[_0xeabe('0x2b')]=function(_0x1078ff,_0x31828a){if(_0x1078ff[_0xeabe('0x2c')]['id']){delete _0x1078ff[_0xeabe('0x2c')]['id'];}return db[_0xeabe('0x2d')][_0xeabe('0x2e')]({'where':{'id':_0x1078ff['params']['id']}})[_0xeabe('0x25')](handleEntityNotFound(_0x31828a,null))['then'](saveUpdates(_0x1078ff[_0xeabe('0x2c')],null))[_0xeabe('0x25')](respondWithResult(_0x31828a,null))[_0xeabe('0x2f')](handleError(_0x31828a,null));};exports['destroy']=function(_0x5f2f38,_0x11db8c){return db[_0xeabe('0x2d')][_0xeabe('0x2e')]({'where':{'id':_0x5f2f38[_0xeabe('0x30')]['id']}})[_0xeabe('0x25')](handleEntityNotFound(_0x11db8c,null))[_0xeabe('0x25')](removeEntity(_0x11db8c,null))[_0xeabe('0x2f')](handleError(_0x11db8c,null));}; \ No newline at end of file +var _0x2c60=['end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','name','send','body','Action','find','params','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus'];(function(_0x2ef990,_0x53a0ce){var _0x57e70c=function(_0x3b2bee){while(--_0x3b2bee){_0x2ef990['push'](_0x2ef990['shift']());}};_0x57e70c(++_0x53a0ce);}(_0x2c60,0x6c));var _0x02c6=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x2c60[_0x58dc25];return _0x21b0a7;};'use strict';var pdf=require(_0x02c6('0x0'));var emlformat=require(_0x02c6('0x1'));var rimraf=require(_0x02c6('0x2'));var zipdir=require(_0x02c6('0x3'));var jsonpatch=require(_0x02c6('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x02c6('0x5'));var util=require(_0x02c6('0x6'));var path=require(_0x02c6('0x7'));var sox=require(_0x02c6('0x8'));var csv=require(_0x02c6('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x02c6('0xa'));var squel=require(_0x02c6('0xb'));var crypto=require(_0x02c6('0xc'));var jsforce=require(_0x02c6('0xd'));var deskjs=require(_0x02c6('0xe'));var toCsv=require(_0x02c6('0x9'));var querystring=require(_0x02c6('0xf'));var Papa=require(_0x02c6('0x10'));var Redis=require(_0x02c6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x02c6('0x12'));var as=require(_0x02c6('0x13'));var hardwareService=require(_0x02c6('0x14'));var logger=require(_0x02c6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x02c6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a29cd,_0x564815){_0x564815=_0x564815||0xcc;return function(_0x2058d0){if(_0x2058d0){return _0x3a29cd[_0x02c6('0x17')](_0x564815);}return _0x3a29cd['status'](_0x564815)[_0x02c6('0x18')]();};}function respondWithResult(_0x3aa329,_0x3689ca){_0x3689ca=_0x3689ca||0xc8;return function(_0x6ae321){if(_0x6ae321){return _0x3aa329[_0x02c6('0x19')](_0x3689ca)[_0x02c6('0x1a')](_0x6ae321);}};}function respondWithFilteredResult(_0x254dfa,_0x4d7d1c){return function(_0x3dc4ca){if(_0x3dc4ca){var _0x19ee55=_0x3dc4ca[_0x02c6('0x1b')],_0x397320=_0x4d7d1c[_0x02c6('0x1c')],_0x4a3af2=_0x4d7d1c[_0x02c6('0x1c')]+_0x4d7d1c[_0x02c6('0x1d')],_0x31b222;if(_0x4a3af2>=_0x19ee55){_0x4a3af2=_0x19ee55;_0x31b222=0xc8;}else{_0x31b222=0xce;}_0x254dfa[_0x02c6('0x19')](_0x31b222);return _0x254dfa['set'](_0x02c6('0x1e'),_0x397320+'-'+_0x4a3af2+'/'+_0x19ee55)[_0x02c6('0x1a')](_0x3dc4ca);}return null;};}function patchUpdates(_0x48b7ba){return function(_0x22b9dd){try{jsonpatch[_0x02c6('0x1f')](_0x22b9dd,_0x48b7ba,!![]);}catch(_0xeeb0ce){return BPromise[_0x02c6('0x20')](_0xeeb0ce);}return _0x22b9dd[_0x02c6('0x21')]();};}function saveUpdates(_0x4107df,_0x57ddac){return function(_0x4c23b2){if(_0x4c23b2){return _0x4c23b2[_0x02c6('0x22')](_0x4107df)['then'](function(_0x417253){return _0x417253;});}return null;};}function removeEntity(_0x43b8e7,_0x315057){return function(_0x5a1b5d){if(_0x5a1b5d){return _0x5a1b5d[_0x02c6('0x23')]()[_0x02c6('0x24')](function(){_0x43b8e7[_0x02c6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3edcec,_0x1ac44d){return function(_0x4d25e8){if(!_0x4d25e8){_0x3edcec[_0x02c6('0x17')](0x194);}return _0x4d25e8;};}function handleError(_0x427bba,_0xd0a5a9){_0xd0a5a9=_0xd0a5a9||0x1f4;return function(_0x1a46c2){logger['error'](_0x1a46c2['stack']);if(_0x1a46c2[_0x02c6('0x25')]){delete _0x1a46c2[_0x02c6('0x25')];}_0x427bba['status'](_0xd0a5a9)[_0x02c6('0x26')](_0x1a46c2);};}exports[_0x02c6('0x22')]=function(_0xebc7ac,_0x3ffb52){if(_0xebc7ac['body']['id']){delete _0xebc7ac[_0x02c6('0x27')]['id'];}return db[_0x02c6('0x28')][_0x02c6('0x29')]({'where':{'id':_0xebc7ac[_0x02c6('0x2a')]['id']}})['then'](handleEntityNotFound(_0x3ffb52,null))[_0x02c6('0x24')](saveUpdates(_0xebc7ac[_0x02c6('0x27')],null))[_0x02c6('0x24')](respondWithResult(_0x3ffb52,null))['catch'](handleError(_0x3ffb52,null));};exports[_0x02c6('0x23')]=function(_0x313cb5,_0x280baf){return db[_0x02c6('0x28')][_0x02c6('0x29')]({'where':{'id':_0x313cb5[_0x02c6('0x2a')]['id']}})[_0x02c6('0x24')](handleEntityNotFound(_0x280baf,null))[_0x02c6('0x24')](removeEntity(_0x280baf,null))[_0x02c6('0x2b')](handleError(_0x280baf,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 6720873..8100a1b 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 _0xe9ae=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Action','tools_actions'];(function(_0x3c5392,_0x3cbc73){var _0x4c08b8=function(_0x2cd6ba){while(--_0x2cd6ba){_0x3c5392['push'](_0x3c5392['shift']());}};_0x4c08b8(++_0x3cbc73);}(_0xe9ae,0x197));var _0xee9a=function(_0x55086c,_0x522a1e){_0x55086c=_0x55086c-0x0;var _0xd5453b=_0xe9ae[_0x55086c];return _0xd5453b;};'use strict';var _=require(_0xee9a('0x0'));var util=require('util');var logger=require(_0xee9a('0x1'))('api');var moment=require(_0xee9a('0x2'));var BPromise=require(_0xee9a('0x3'));var rp=require(_0xee9a('0x4'));var fs=require('fs');var path=require(_0xee9a('0x5'));var rimraf=require(_0xee9a('0x6'));var config=require(_0xee9a('0x7'));var attributes=require('./action.attributes');module[_0xee9a('0x8')]=function(_0x3958bb,_0x53d4ad){return _0x3958bb['define'](_0xee9a('0x9'),attributes,{'tableName':_0xee9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x259a=['define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x56d39d,_0x426392){var _0x66cd19=function(_0x59d3f7){while(--_0x59d3f7){_0x56d39d['push'](_0x56d39d['shift']());}};_0x66cd19(++_0x426392);}(_0x259a,0xce));var _0xa259=function(_0x296187,_0x66707b){_0x296187=_0x296187-0x0;var _0x4565d2=_0x259a[_0x296187];return _0x4565d2;};'use strict';var _=require(_0xa259('0x0'));var util=require(_0xa259('0x1'));var logger=require(_0xa259('0x2'))(_0xa259('0x3'));var moment=require(_0xa259('0x4'));var BPromise=require(_0xa259('0x5'));var rp=require(_0xa259('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa259('0x7'));var config=require(_0xa259('0x8'));var attributes=require('./action.attributes');module[_0xa259('0x9')]=function(_0x1d26dd,_0x20a566){return _0x1d26dd[_0xa259('0xa')]('Action',attributes,{'tableName':_0xa259('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 da4f38b..7bf9de6 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x56ff87,_0x1698f6){var _0x20661d=function(_0x161db3){while(--_0x161db3){_0x56ff87['push'](_0x56ff87['shift']());}};_0x20661d(++_0x1698f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index d1d6ce8..05ea4d3 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 _0x9025=['../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','multer','util','path','express','Router','../../components/auth/service'];(function(_0x251628,_0x1a75e1){var _0x2ed8a0=function(_0x43247b){while(--_0x43247b){_0x251628['push'](_0x251628['shift']());}};_0x2ed8a0(++_0x1a75e1);}(_0x9025,0x1d3));var _0x5902=function(_0xc18b07,_0x1910f8){_0xc18b07=_0xc18b07-0x0;var _0x39115b=_0x9025[_0xc18b07];return _0x39115b;};'use strict';var multer=require(_0x5902('0x0'));var util=require(_0x5902('0x1'));var path=require(_0x5902('0x2'));var timeout=require('connect-timeout');var express=require(_0x5902('0x3'));var router=express[_0x5902('0x4')]();var auth=require(_0x5902('0x5'));var interaction=require(_0x5902('0x6'));var config=require(_0x5902('0x7'));var controller=require('./action.controller');router[_0x5902('0x8')](_0x5902('0x9'),auth[_0x5902('0xa')](),controller['update']);router['delete'](_0x5902('0x9'),auth[_0x5902('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x24aa=['../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','isAuthenticated','update','delete','destroy','exports','multer','util','path','express'];(function(_0x5e5172,_0x39fe2f){var _0x4c5674=function(_0x4ff386){while(--_0x4ff386){_0x5e5172['push'](_0x5e5172['shift']());}};_0x4c5674(++_0x39fe2f);}(_0x24aa,0xbf));var _0xa24a=function(_0x43a2ef,_0x31b6c3){_0x43a2ef=_0x43a2ef-0x0;var _0x254191=_0x24aa[_0x43a2ef];return _0x254191;};'use strict';var multer=require(_0xa24a('0x0'));var util=require(_0xa24a('0x1'));var path=require(_0xa24a('0x2'));var timeout=require('connect-timeout');var express=require(_0xa24a('0x3'));var router=express['Router']();var auth=require(_0xa24a('0x4'));var interaction=require(_0xa24a('0x5'));var config=require(_0xa24a('0x6'));var controller=require(_0xa24a('0x7'));router['put']('/:id',auth[_0xa24a('0x8')](),controller[_0xa24a('0x9')]);router[_0xa24a('0xa')]('/:id',auth[_0xa24a('0x8')](),controller[_0xa24a('0xb')]);module[_0xa24a('0xc')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 0952115..a0ada5c 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 _0x35b8=['exports','STRING','TEXT'];(function(_0x99f137,_0x27b9b9){var _0x285126=function(_0x4dfc9){while(--_0x4dfc9){_0x99f137['push'](_0x99f137['shift']());}};_0x285126(++_0x27b9b9);}(_0x35b8,0xcc));var _0x835b=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x35b8[_0x4c7b20];return _0x4872bd;};'use strict';var Sequelize=require('sequelize');module[_0x835b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x835b('0x1')]},'parent':{'type':Sequelize[_0x835b('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x835b('0x2')]},'joins':{'type':Sequelize[_0x835b('0x2')]}}; \ No newline at end of file +var _0xa029=['exports','STRING','TEXT','sequelize'];(function(_0x5e14f6,_0x12685b){var _0x24270c=function(_0x53de29){while(--_0x53de29){_0x5e14f6['push'](_0x5e14f6['shift']());}};_0x24270c(++_0x12685b);}(_0xa029,0xa7));var _0x9a02=function(_0x4a8e1d,_0x27bb5e){_0x4a8e1d=_0x4a8e1d-0x0;var _0x482831=_0xa029[_0x4a8e1d];return _0x482831;};'use strict';var Sequelize=require(_0x9a02('0x0'));module[_0x9a02('0x1')]={'name':{'type':Sequelize[_0x9a02('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9a02('0x2')]},'parent':{'type':Sequelize[_0x9a02('0x2')]},'table':{'type':Sequelize[_0x9a02('0x2')]},'conditions':{'type':Sequelize[_0x9a02('0x3')]},'joins':{'type':Sequelize[_0x9a02('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index fa439f0..d9c5b42 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 _0xf120=['%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NOT\x20NULL','value','ValidationErrorItem','toString','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','AnalyticExtractedReport','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','from','run','runReport','COUNT(%s)','MAX(%s)','ROUND(%s)','groupBy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','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','dbH','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','parentKey','foreignKey'];(function(_0xac9b31,_0x525668){var _0x2bff6e=function(_0x38ee41){while(--_0x38ee41){_0xac9b31['push'](_0xac9b31['shift']());}};_0x2bff6e(++_0x525668);}(_0xf120,0x179));var _0x0f12=function(_0x3a008e,_0x1d71b5){_0x3a008e=_0x3a008e-0x0;var _0xcbb17a=_0xf120[_0x3a008e];return _0xcbb17a;};'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 dbH=require('../../mysqldb')[_0x0f12('0x19')];function respondWithStatusCode(_0x11a236,_0xb80905){_0xb80905=_0xb80905||0xcc;return function(_0x17960e){if(_0x17960e){return _0x11a236[_0x0f12('0x1a')](_0xb80905);}return _0x11a236[_0x0f12('0x1b')](_0xb80905)[_0x0f12('0x1c')]();};}function respondWithResult(_0x7f1ae7,_0x215a7a){_0x215a7a=_0x215a7a||0xc8;return function(_0x42b674){if(_0x42b674){return _0x7f1ae7[_0x0f12('0x1b')](_0x215a7a)[_0x0f12('0x1d')](_0x42b674);}};}function respondWithFilteredResult(_0xe61624,_0x27addc){return function(_0xeccb7c){if(_0xeccb7c){var _0x592617=_0xeccb7c[_0x0f12('0x1e')],_0x1db207=_0x27addc[_0x0f12('0x1f')],_0x4d9613=_0x27addc[_0x0f12('0x1f')]+_0x27addc[_0x0f12('0x20')],_0x1c67b6;if(_0x4d9613>=_0x592617){_0x4d9613=_0x592617;_0x1c67b6=0xc8;}else{_0x1c67b6=0xce;}_0xe61624[_0x0f12('0x1b')](_0x1c67b6);return _0xe61624['set'](_0x0f12('0x21'),_0x1db207+'-'+_0x4d9613+'/'+_0x592617)['json'](_0xeccb7c);}return null;};}function patchUpdates(_0x18d689){return function(_0x56c1f1){try{jsonpatch['apply'](_0x56c1f1,_0x18d689,!![]);}catch(_0x516d98){return BPromise[_0x0f12('0x22')](_0x516d98);}return _0x56c1f1[_0x0f12('0x23')]();};}function saveUpdates(_0x5e4af9,_0x10a325){return function(_0x4bfc5d){if(_0x4bfc5d){return _0x4bfc5d[_0x0f12('0x24')](_0x5e4af9)['then'](function(_0x9f283b){return _0x9f283b;});}return null;};}function removeEntity(_0x379851,_0x4f06bd){return function(_0xe19f64){if(_0xe19f64){return _0xe19f64[_0x0f12('0x25')]()[_0x0f12('0x26')](function(){var _0x3821dd=_0xe19f64[_0x0f12('0x27')]({'plain':!![]});var _0x59d65b=_0x0f12('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x59d65b,'resourceId':_0x3821dd['id']}})['then'](function(){return _0xe19f64;});})[_0x0f12('0x26')](function(){_0x379851[_0x0f12('0x1b')](0xcc)[_0x0f12('0x1c')]();});}};}function handleEntityNotFound(_0x13e737,_0x4aff64){return function(_0x310c03){if(!_0x310c03){_0x13e737[_0x0f12('0x1a')](0x194);}return _0x310c03;};}function handleError(_0xde0ddf,_0x5ca297){_0x5ca297=_0x5ca297||0x1f4;return function(_0x13baa0){logger[_0x0f12('0x29')](_0x13baa0[_0x0f12('0x2a')]);if(_0x13baa0['name']){delete _0x13baa0[_0x0f12('0x2b')];}_0xde0ddf[_0x0f12('0x1b')](_0x5ca297)[_0x0f12('0x2c')](_0x13baa0);};}exports[_0x0f12('0x2d')]=function(_0x1c7d2b,_0x5693e4){var _0x5531ed={},_0x343ae0={},_0x48d168={'count':0x0,'rows':[]};var _0x3516f8=_[_0x0f12('0x2e')](db[_0x0f12('0x2f')]['rawAttributes'],function(_0x12a575){return{'name':_0x12a575[_0x0f12('0x30')],'type':_0x12a575[_0x0f12('0x31')][_0x0f12('0x32')]};});_0x343ae0[_0x0f12('0x33')]=_[_0x0f12('0x2e')](_0x3516f8,'name');_0x343ae0[_0x0f12('0x34')]=_[_0x0f12('0x35')](_0x1c7d2b[_0x0f12('0x34')]);_0x343ae0['filters']=_[_0x0f12('0x36')](_0x343ae0[_0x0f12('0x33')],_0x343ae0[_0x0f12('0x34')]);_0x5531ed[_0x0f12('0x37')]=_['intersection'](_0x343ae0[_0x0f12('0x33')],qs[_0x0f12('0x38')](_0x1c7d2b[_0x0f12('0x34')][_0x0f12('0x38')]));_0x5531ed[_0x0f12('0x37')]=_0x5531ed[_0x0f12('0x37')][_0x0f12('0x39')]?_0x5531ed['attributes']:_0x343ae0[_0x0f12('0x33')];if(!_0x1c7d2b[_0x0f12('0x34')]['hasOwnProperty'](_0x0f12('0x3a'))){_0x5531ed[_0x0f12('0x20')]=qs['limit'](_0x1c7d2b[_0x0f12('0x34')][_0x0f12('0x20')]);_0x5531ed['offset']=qs[_0x0f12('0x1f')](_0x1c7d2b['query'][_0x0f12('0x1f')]);}_0x5531ed[_0x0f12('0x3b')]=qs[_0x0f12('0x3c')](_0x1c7d2b[_0x0f12('0x34')][_0x0f12('0x3c')]);_0x5531ed[_0x0f12('0x3d')]=qs[_0x0f12('0x3e')](_[_0x0f12('0x3f')](_0x1c7d2b[_0x0f12('0x34')],_0x343ae0[_0x0f12('0x3e')]),_0x3516f8);if(_0x1c7d2b['query'][_0x0f12('0x40')]){_0x5531ed[_0x0f12('0x3d')]=_[_0x0f12('0x41')](_0x5531ed['where'],{'$or':_['map'](_0x3516f8,function(_0x4ac39b){if(_0x4ac39b[_0x0f12('0x31')]!==_0x0f12('0x42')){var _0x4f2e94={};_0x4f2e94[_0x4ac39b['name']]={'$like':'%'+_0x1c7d2b[_0x0f12('0x34')][_0x0f12('0x40')]+'%'};return _0x4f2e94;}})});}_0x5531ed=_[_0x0f12('0x41')]({},_0x5531ed,_0x1c7d2b['options']);var _0x3ccb6e={'where':_0x5531ed[_0x0f12('0x3d')]};return db['AnalyticCustomReport'][_0x0f12('0x1e')](_0x3ccb6e)[_0x0f12('0x26')](function(_0x226be0){_0x48d168[_0x0f12('0x1e')]=_0x226be0;if(_0x1c7d2b[_0x0f12('0x34')][_0x0f12('0x43')]){_0x5531ed[_0x0f12('0x44')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x0f12('0x45')](_0x5531ed);})['then'](function(_0x3fdcce){_0x48d168[_0x0f12('0x46')]=_0x3fdcce;return _0x48d168;})['then'](respondWithFilteredResult(_0x5693e4,_0x5531ed))[_0x0f12('0x47')](handleError(_0x5693e4,null));};exports[_0x0f12('0x48')]=function(_0x249dd4,_0x496724){var _0x5dfe38={'raw':![],'where':{'id':_0x249dd4[_0x0f12('0x49')]['id']}},_0x2bd31d={};_0x2bd31d[_0x0f12('0x33')]=_[_0x0f12('0x35')](db['AnalyticCustomReport'][_0x0f12('0x4a')]);_0x2bd31d[_0x0f12('0x34')]=_[_0x0f12('0x35')](_0x249dd4[_0x0f12('0x34')]);_0x2bd31d['filters']=_[_0x0f12('0x36')](_0x2bd31d[_0x0f12('0x33')],_0x2bd31d['query']);_0x5dfe38['attributes']=_[_0x0f12('0x36')](_0x2bd31d[_0x0f12('0x33')],qs[_0x0f12('0x38')](_0x249dd4['query']['fields']));_0x5dfe38[_0x0f12('0x37')]=_0x5dfe38[_0x0f12('0x37')]['length']?_0x5dfe38[_0x0f12('0x37')]:_0x2bd31d['model'];if(_0x249dd4[_0x0f12('0x34')][_0x0f12('0x43')]){_0x5dfe38['include']=[{'all':!![]}];}_0x5dfe38=_['merge']({},_0x5dfe38,_0x249dd4[_0x0f12('0x4b')]);return db[_0x0f12('0x2f')][_0x0f12('0x4c')](_0x5dfe38)[_0x0f12('0x26')](handleEntityNotFound(_0x496724,null))[_0x0f12('0x26')](respondWithResult(_0x496724,null))[_0x0f12('0x47')](handleError(_0x496724,null));};exports[_0x0f12('0x4d')]=function(_0x33ce01,_0x5b265d){return db[_0x0f12('0x2f')]['create'](_0x33ce01[_0x0f12('0x4e')],{})['then'](function(_0x4add76){var _0xbbacc1=_0x33ce01['user'][_0x0f12('0x27')]({'plain':!![]});if(!_0xbbacc1)throw new Error(_0x0f12('0x4f'));if(_0xbbacc1[_0x0f12('0x50')]===_0x0f12('0x51')){var _0x4fb2c5=_0x4add76[_0x0f12('0x27')]({'plain':!![]});var _0x90f918=_0x0f12('0x52');return db[_0x0f12('0x53')]['find']({'where':{'name':_0x90f918,'userProfileId':_0xbbacc1['userProfileId']},'raw':!![]})[_0x0f12('0x26')](function(_0x2e3df7){if(_0x2e3df7&&_0x2e3df7[_0x0f12('0x54')]===0x0){return db[_0x0f12('0x55')][_0x0f12('0x4d')]({'name':_0x4fb2c5['name'],'resourceId':_0x4fb2c5['id'],'type':'CustomReports','sectionId':_0x2e3df7['id']},{})['then'](function(){return _0x4add76;});}else{return _0x4add76;}})[_0x0f12('0x47')](function(_0x7719ec){logger[_0x0f12('0x29')](_0x0f12('0x56'),_0x7719ec);throw _0x7719ec;});}return _0x4add76;})[_0x0f12('0x26')](respondWithResult(_0x5b265d,0xc9))[_0x0f12('0x47')](handleError(_0x5b265d,null));};exports[_0x0f12('0x24')]=function(_0x1c6993,_0x31ecc6){if(_0x1c6993[_0x0f12('0x4e')]['id']){delete _0x1c6993[_0x0f12('0x4e')]['id'];}return db['AnalyticCustomReport'][_0x0f12('0x4c')]({'where':{'id':_0x1c6993[_0x0f12('0x49')]['id']}})[_0x0f12('0x26')](handleEntityNotFound(_0x31ecc6,null))[_0x0f12('0x26')](saveUpdates(_0x1c6993['body'],null))['then'](respondWithResult(_0x31ecc6,null))[_0x0f12('0x47')](handleError(_0x31ecc6,null));};exports[_0x0f12('0x25')]=function(_0x48b37,_0x36d0f7){return db[_0x0f12('0x2f')][_0x0f12('0x4c')]({'where':{'id':_0x48b37[_0x0f12('0x49')]['id']}})[_0x0f12('0x26')](handleEntityNotFound(_0x36d0f7,null))['then'](removeEntity(_0x36d0f7,null))[_0x0f12('0x47')](handleError(_0x36d0f7,null));};exports[_0x0f12('0x57')]=function(_0x5a074f,_0x3c2148){var _0x2ea5ea=0xa;var _0x17054a=['join',_0x0f12('0x58'),_0x0f12('0x59'),_0x0f12('0x5a')];var _0x2ca6bb={'SUM':_0x0f12('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0f12('0x5c'),'MAX':'MAX(%s)','MIN':_0x0f12('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x0f12('0x5e'),'GROUP_CONCAT ASC':_0x0f12('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d9828={'SEC_TO_TIME':_0x0f12('0x60'),'DATE':'DATE(%s)','HOUR':_0x0f12('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0f12('0x62')};var _0x59cd88=function(_0x1d6bb6){return!_[_0x0f12('0x63')]([_0x0f12('0x64'),'IS\x20NOT\x20NULL',_0x0f12('0x65'),_0x0f12('0x66')],_0x1d6bb6);};var _0x2cc2d6=function(_0x5cf716){if(!_0x5cf716||!_0x5cf716[_0x0f12('0x67')][_0x0f12('0x39')]){return'';}for(var _0x5bd898='(',_0x155ead=0x0;_0x155ead<_0x5cf716[_0x0f12('0x67')]['length'];_0x155ead+=0x1){_0x155ead>0x0&&(_0x5bd898+='\x20'+_0x5cf716[_0x0f12('0x68')]+'\x20');_0x5bd898+=_0x5cf716[_0x0f12('0x67')][_0x155ead][_0x0f12('0x69')]?_0x2cc2d6(_0x5cf716[_0x0f12('0x67')][_0x155ead][_0x0f12('0x69')]):_0x5cf716[_0x0f12('0x67')][_0x155ead][_0x0f12('0x6a')]+'\x20'+_0x5cf716[_0x0f12('0x67')][_0x155ead][_0x0f12('0x6b')]+(_0x59cd88(_0x5cf716[_0x0f12('0x67')][_0x155ead][_0x0f12('0x6b')])?'\x20'+_0x5cf716[_0x0f12('0x67')][_0x155ead]['value']:'');}return _0x5bd898+')';};var _0x10f7c3={'where':{'id':_0x5a074f[_0x0f12('0x49')]['id']}},_0x361dd5,_0x4661d4,_0x1f6c14,_0x42dfe6,_0x5b11f5;_0x10f7c3=_[_0x0f12('0x41')]({},_0x10f7c3,_0x5a074f[_0x0f12('0x4b')]);return db['AnalyticCustomReport'][_0x0f12('0x4c')](_0x10f7c3)['then'](function(_0x1970b0){if(_0x1970b0){_0x361dd5=_0x1970b0;return _0x1970b0[_0x0f12('0x6c')]();}return null;})[_0x0f12('0x26')](function(_0x517cd5){if(_0x517cd5){if(!_0x517cd5['length']){throw new db[(_0x0f12('0x6d'))]['ValidationErrorItem'](_0x0f12('0x6e'),0x193);}_0x4661d4=_0x517cd5;return db[_0x0f12('0x6f')]['findAll']({'raw':!![]});}return null;})[_0x0f12('0x26')](function(_0x3da48a){if(_0x3da48a){_0x1f6c14=_[_0x0f12('0x70')](_0x3da48a,'id');var _0x516ddb;var _0x9b9c76=squel[_0x0f12('0x71')]();_0x9b9c76['from'](_0x361dd5[_0x0f12('0x72')]);for(var _0x140dd9=0x0;_0x140dd9<_0x4661d4[_0x0f12('0x39')];_0x140dd9+=0x1){_0x516ddb=_0x4661d4[_0x140dd9][_0x0f12('0x73')]?_0x1f6c14[_0x4661d4[_0x140dd9][_0x0f12('0x73')]][_0x0f12('0x74')]:_0x4661d4[_0x140dd9][_0x0f12('0x6a')];_0x516ddb=_0x4661d4[_0x140dd9][_0x0f12('0x75')]?_[_0x0f12('0x76')](_0x2ca6bb[_0x4661d4[_0x140dd9][_0x0f12('0x75')]],'%s',_0x516ddb):_0x516ddb;_0x516ddb=_0x4661d4[_0x140dd9][_0x0f12('0x77')]?_['replace'](_0x3d9828[_0x4661d4[_0x140dd9][_0x0f12('0x77')]],'%s',_0x516ddb):_0x516ddb;if(_0x4661d4[_0x140dd9]['groupBy']){_0x9b9c76[_0x0f12('0x69')](_0x516ddb);}_0x4661d4[_0x140dd9][_0x0f12('0x78')]&&_0x9b9c76[_0x0f12('0x3b')](_0x516ddb,_0x4661d4[_0x140dd9]['orderBy']===_0x0f12('0x79')?![]:!![]);_0x9b9c76[_0x0f12('0x6a')](_0x516ddb,_0x4661d4[_0x140dd9][_0x0f12('0x7a')]||_0x516ddb);}if(_0x361dd5[_0x0f12('0x7b')]){_0x361dd5[_0x0f12('0x7b')]=JSON[_0x0f12('0x7c')](_0x361dd5[_0x0f12('0x7b')]);for(var _0x269746=0x0;_0x269746<_0x361dd5['joins'][_0x0f12('0x39')];_0x269746+=0x1){if(_0x361dd5[_0x0f12('0x7b')][_0x269746][_0x0f12('0x31')]&&_[_0x0f12('0x63')](_0x17054a,_0x361dd5[_0x0f12('0x7b')][_0x269746][_0x0f12('0x31')])&&_0x361dd5[_0x0f12('0x7b')][_0x269746][_0x0f12('0x7d')]&&_0x361dd5[_0x0f12('0x7b')][_0x269746]['foreignTable']&&_0x361dd5['joins'][_0x269746][_0x0f12('0x7e')]){_0x9b9c76[_0x361dd5[_0x0f12('0x7b')][_0x269746][_0x0f12('0x31')]](_0x361dd5[_0x0f12('0x7b')][_0x269746]['foreignTable'],null,util[_0x0f12('0x77')](_0x0f12('0x7f'),_0x361dd5[_0x0f12('0x72')],_0x361dd5['joins'][_0x269746][_0x0f12('0x7d')],_0x361dd5[_0x0f12('0x7b')][_0x269746][_0x0f12('0x80')],_0x361dd5[_0x0f12('0x7b')][_0x269746][_0x0f12('0x7e')]));}}}if(_0x361dd5[_0x0f12('0x81')]){_0x361dd5['conditions']=JSON[_0x0f12('0x7c')](_0x361dd5[_0x0f12('0x81')]);_0x9b9c76[_0x0f12('0x3d')](_0x2cc2d6(_0x361dd5['conditions'][_0x0f12('0x69')]));}_0x5b11f5=_0x9b9c76[_0x0f12('0x82')]();_0x9b9c76[_0x0f12('0x20')](_0x2ea5ea);_0x9b9c76[_0x0f12('0x1f')](0x0);logger[_0x0f12('0x83')](_0x0f12('0x84'),_0x9b9c76['toString']());return db[_0x0f12('0x85')][_0x0f12('0x34')](_0x9b9c76['toString'](),{'type':db[_0x0f12('0x85')][_0x0f12('0x86')][_0x0f12('0x87')]});}})[_0x0f12('0x26')](respondWithResult(_0x3c2148,null))[_0x0f12('0x47')](handleError(_0x3c2148,null));};function runReport(_0x66e786,_0x4295de,_0x147655){var _0x5a4449=_0x4295de['name'];var _0x14beb3=0xa;var _0x1782a9=[_0x0f12('0x88'),_0x0f12('0x58'),'right_join','cross_join'];var _0x45c028={'SUM':_0x0f12('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0f12('0x5c'),'MAX':'MAX(%s)','MIN':_0x0f12('0x5d'),'AVG':_0x0f12('0x89'),'GROUP_CONCAT':_0x0f12('0x5e'),'GROUP_CONCAT ASC':_0x0f12('0x5f'),'GROUP_CONCAT DESC':_0x0f12('0x8a')};var _0x5a3363={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0f12('0x8b'),'HOUR':_0x0f12('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0f12('0x62')};var _0x21764b=function(_0x130b70){return!_[_0x0f12('0x63')](['IS\x20NULL',_0x0f12('0x8c'),_0x0f12('0x65'),_0x0f12('0x66')],_0x130b70);};var _0x5ca7d5=function(_0x437d39){if(!_0x437d39||!_0x437d39[_0x0f12('0x67')]['length']){return'';}for(var _0xb9e69d='(',_0x10741f=0x0;_0x10741f<_0x437d39[_0x0f12('0x67')]['length'];_0x10741f+=0x1){_0x10741f>0x0&&(_0xb9e69d+='\x20'+_0x437d39['operator']+'\x20');_0xb9e69d+=_0x437d39[_0x0f12('0x67')][_0x10741f][_0x0f12('0x69')]?_0x5ca7d5(_0x437d39[_0x0f12('0x67')][_0x10741f][_0x0f12('0x69')]):_0x437d39[_0x0f12('0x67')][_0x10741f][_0x0f12('0x6a')]+'\x20'+_0x437d39[_0x0f12('0x67')][_0x10741f][_0x0f12('0x6b')]+(_0x21764b(_0x437d39[_0x0f12('0x67')][_0x10741f][_0x0f12('0x6b')])?'\x20'+_0x437d39['rules'][_0x10741f][_0x0f12('0x8d')]:'');}return _0xb9e69d+')';};var _0x1c0610={'where':{'id':_0x66e786['id']}},_0x404bc7,_0x3c7ac0,_0x322067,_0x3241c3,_0x6b25ac;_0x1c0610=_[_0x0f12('0x41')]({},_0x1c0610,_0x147655);return db[_0x0f12('0x2f')]['find'](_0x1c0610)['then'](function(_0x69764f){if(_0x69764f){_0x404bc7=_0x69764f;return _0x69764f[_0x0f12('0x6c')]();}return null;})[_0x0f12('0x26')](function(_0x45f94f){if(_0x45f94f){if(!_0x45f94f[_0x0f12('0x39')]){throw new db['Sequelize'][(_0x0f12('0x8e'))](_0x0f12('0x6e'),0x193);}_0x3c7ac0=_0x45f94f;return db['AnalyticMetric'][_0x0f12('0x45')]({'raw':!![]});}return null;})[_0x0f12('0x26')](function(_0x362830){if(_0x362830){_0x322067=_[_0x0f12('0x70')](_0x362830,'id');var _0x1cf783;var _0x2e96ee=squel[_0x0f12('0x71')]();_0x2e96ee['from'](_0x404bc7[_0x0f12('0x72')]);for(var _0x4d34da=0x0;_0x4d34da<_0x3c7ac0['length'];_0x4d34da+=0x1){_0x1cf783=_0x3c7ac0[_0x4d34da][_0x0f12('0x73')]?_0x322067[_0x3c7ac0[_0x4d34da][_0x0f12('0x73')]][_0x0f12('0x74')]:_0x3c7ac0[_0x4d34da][_0x0f12('0x6a')];_0x1cf783=_0x3c7ac0[_0x4d34da][_0x0f12('0x75')]?_['replace'](_0x45c028[_0x3c7ac0[_0x4d34da][_0x0f12('0x75')]],'%s',_0x1cf783):_0x1cf783;_0x1cf783=_0x3c7ac0[_0x4d34da][_0x0f12('0x77')]?_['replace'](_0x5a3363[_0x3c7ac0[_0x4d34da][_0x0f12('0x77')]],'%s',_0x1cf783):_0x1cf783;if(_0x3c7ac0[_0x4d34da]['groupBy']){_0x2e96ee['group'](_0x1cf783);}_0x3c7ac0[_0x4d34da][_0x0f12('0x78')]&&_0x2e96ee[_0x0f12('0x3b')](_0x1cf783,_0x3c7ac0[_0x4d34da][_0x0f12('0x78')]===_0x0f12('0x79')?![]:!![]);_0x2e96ee[_0x0f12('0x6a')](_0x1cf783,_0x3c7ac0[_0x4d34da]['alias']||_0x1cf783);}if(_0x404bc7[_0x0f12('0x7b')]){_0x404bc7[_0x0f12('0x7b')]=JSON[_0x0f12('0x7c')](_0x404bc7[_0x0f12('0x7b')]);for(var _0x5ac359=0x0;_0x5ac359<_0x404bc7['joins'][_0x0f12('0x39')];_0x5ac359+=0x1){if(_0x404bc7['joins'][_0x5ac359][_0x0f12('0x31')]&&_[_0x0f12('0x63')](_0x1782a9,_0x404bc7['joins'][_0x5ac359][_0x0f12('0x31')])&&_0x404bc7[_0x0f12('0x7b')][_0x5ac359][_0x0f12('0x7d')]&&_0x404bc7['joins'][_0x5ac359][_0x0f12('0x80')]&&_0x404bc7[_0x0f12('0x7b')][_0x5ac359][_0x0f12('0x7e')]){_0x2e96ee[_0x404bc7[_0x0f12('0x7b')][_0x5ac359]['type']](_0x404bc7[_0x0f12('0x7b')][_0x5ac359][_0x0f12('0x80')],null,util[_0x0f12('0x77')](_0x0f12('0x7f'),_0x404bc7[_0x0f12('0x72')],_0x404bc7[_0x0f12('0x7b')][_0x5ac359][_0x0f12('0x7d')],_0x404bc7[_0x0f12('0x7b')][_0x5ac359][_0x0f12('0x80')],_0x404bc7[_0x0f12('0x7b')][_0x5ac359][_0x0f12('0x7e')]));}}}if(_0x404bc7[_0x0f12('0x81')]){_0x404bc7['conditions']=JSON[_0x0f12('0x7c')](_0x404bc7[_0x0f12('0x81')]);_0x2e96ee[_0x0f12('0x3d')](_0x5ca7d5(_0x404bc7[_0x0f12('0x81')][_0x0f12('0x69')]));}_0x6b25ac=_0x2e96ee[_0x0f12('0x82')]();_0x2e96ee['limit'](_0x14beb3);_0x2e96ee[_0x0f12('0x1f')](0x0);logger['debug'](_0x0f12('0x84'),_0x2e96ee[_0x0f12('0x8f')]());return db['sequelize'][_0x0f12('0x34')](_0x2e96ee[_0x0f12('0x8f')](),{'type':db[_0x0f12('0x85')]['QueryTypes'][_0x0f12('0x87')]});}})[_0x0f12('0x26')](function(_0xa9d5b6){if(!_0xa9d5b6[_0x0f12('0x39')]){throw new db[(_0x0f12('0x6d'))][(_0x0f12('0x8e'))](_0x0f12('0x90'),0xcc);}if(_0x4295de[_0x0f12('0x91')]===_0x0f12('0x92')){return null;}var _0x373dd2=_[_0x0f12('0x41')](_0x4295de,{'name':_0x4295de[_0x0f12('0x93')]||_0x4295de[_0x0f12('0x2b')]||_0x404bc7[_0x0f12('0x2b')],'basename':_0x5a4449,'savename':util[_0x0f12('0x77')](_0x0f12('0x94'),_0x4295de['name']||_0x404bc7['name'],require(_0x0f12('0x95'))[_0x0f12('0x96')](0x4),_0x4295de[_0x0f12('0x91')]||'csv'),'reportId':_0x404bc7['id'],'reportType':_0x0f12('0x97')});return db[_0x0f12('0x98')][_0x0f12('0x4d')](_0x373dd2,{'raw':!![]});})['then'](function(_0x2735a3){if(_0x404bc7[_0x0f12('0x72')]==='cdr'){_0x6b25ac[_0x0f12('0x3d')](_0x404bc7[_0x0f12('0x72')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x4295de['startDate'],_0x4295de[_0x0f12('0x99')]);}else{_0x6b25ac[_0x0f12('0x3d')](_0x404bc7['table']+_0x0f12('0x9a'),_0x4295de['startDate'],_0x4295de[_0x0f12('0x99')]);}if(_0x2735a3){logger[_0x0f12('0x9b')](_0x0f12('0x9c'),_0x6b25ac[_0x0f12('0x8f')]());require(_0x0f12('0x9d'))[_0x0f12('0x9e')](path[_0x0f12('0x88')](__dirname,'../../components/export/',_0x2735a3[_0x0f12('0x91')]),[_0x2735a3['id'],_0x6b25ac[_0x0f12('0x8f')](),path['join'](__dirname,_0x0f12('0x9f'),_0x2735a3[_0x0f12('0xa0')]),_0x5a4449]);return _0x2735a3;}else{var _0x31b6dc=squel[_0x0f12('0x71')]();_0x31b6dc[_0x0f12('0xa1')]('('+_0x6b25ac[_0x0f12('0x8f')]()+')','countTable');_0x31b6dc[_0x0f12('0x6a')]('COUNT(*)',_0x0f12('0x1e'));_0x6b25ac[_0x0f12('0x20')](_0x4295de['limit']||_0x14beb3);_0x6b25ac[_0x0f12('0x1f')](_0x4295de['offset']||0x0);return dbH[_0x0f12('0x85')][_0x0f12('0x34')](_0x31b6dc[_0x0f12('0x8f')](),{'type':dbH[_0x0f12('0x85')][_0x0f12('0x86')][_0x0f12('0x87')]})[_0x0f12('0x26')](function(_0x2ccec6){if(!_0x2ccec6['length']){_0x3241c3=0x0;}else{_0x3241c3=_0x2ccec6[0x0][_0x0f12('0x1e')]||0x0;}return dbH['sequelize']['query'](_0x6b25ac[_0x0f12('0x8f')](),{'type':dbH[_0x0f12('0x85')][_0x0f12('0x86')]['SELECT']});})[_0x0f12('0x26')](function(_0x299adf){return{'rows':_0x299adf||[],'count':_0x3241c3};});}});}exports[_0x0f12('0xa2')]=function(_0x27293f,_0x2cb537){return runReport(_0x27293f[_0x0f12('0x49')],_0x27293f['query'],_0x27293f[_0x0f12('0x4b')])['then'](respondWithResult(_0x2cb537,null))['catch'](handleError(_0x2cb537,null));};exports[_0x0f12('0xa3')]=runReport;exports[_0x0f12('0x34')]=function(_0x59336f,_0x2a5ba8){var _0x4e38b7=0xa;var _0x3c6ade=['join','left_join',_0x0f12('0x59'),'cross_join'];var _0x3488c0={'SUM':_0x0f12('0x5b'),'COUNT':_0x0f12('0xa4'),'COUNT DISTINCT':_0x0f12('0x5c'),'MAX':_0x0f12('0xa5'),'MIN':_0x0f12('0x5d'),'AVG':_0x0f12('0x89'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0f12('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x155dc2={'SEC_TO_TIME':_0x0f12('0x60'),'DATE':_0x0f12('0x8b'),'HOUR':_0x0f12('0x61'),'ROUND':_0x0f12('0xa6'),'UNIX_TIMESTAMP':_0x0f12('0x62')};var _0x136a05=function(_0x112b4b){return!_[_0x0f12('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x0f12('0x65'),_0x0f12('0x66')],_0x112b4b);};var _0x1cb885=function(_0x47a38c){if(!_0x47a38c||!_0x47a38c[_0x0f12('0x67')]['length']){return'';}for(var _0x5b5664='(',_0x221fd4=0x0;_0x221fd4<_0x47a38c['rules'][_0x0f12('0x39')];_0x221fd4+=0x1){_0x221fd4>0x0&&(_0x5b5664+='\x20'+_0x47a38c[_0x0f12('0x68')]+'\x20');_0x5b5664+=_0x47a38c['rules'][_0x221fd4][_0x0f12('0x69')]?_0x1cb885(_0x47a38c[_0x0f12('0x67')][_0x221fd4]['group']):_0x47a38c['rules'][_0x221fd4]['field']+'\x20'+_0x47a38c[_0x0f12('0x67')][_0x221fd4]['condition']+(_0x136a05(_0x47a38c['rules'][_0x221fd4][_0x0f12('0x6b')])?'\x20'+_0x47a38c[_0x0f12('0x67')][_0x221fd4]['value']:'');}return _0x5b5664+')';};var _0x18d3c0={'where':{'id':_0x59336f['params']['id']}},_0x32e1bb,_0x3fecc7,_0x1aba9f,_0x119be2,_0x1d5df9;_0x18d3c0=_[_0x0f12('0x41')]({},_0x18d3c0,_0x59336f[_0x0f12('0x4b')]);return db[_0x0f12('0x2f')][_0x0f12('0x4c')](_0x18d3c0)[_0x0f12('0x26')](function(_0x2b988f){if(_0x2b988f){_0x32e1bb=_0x2b988f;return _0x2b988f[_0x0f12('0x6c')]();}return null;})['then'](function(_0x2572cd){if(_0x2572cd){if(!_0x2572cd['length']){throw new db[(_0x0f12('0x6d'))][(_0x0f12('0x8e'))](_0x0f12('0x6e'),0x193);}_0x3fecc7=_0x2572cd;return db['AnalyticMetric'][_0x0f12('0x45')]({'raw':!![]});}return null;})[_0x0f12('0x26')](function(_0xa4e9cf){if(_0xa4e9cf){_0x1aba9f=_[_0x0f12('0x70')](_0xa4e9cf,'id');var _0x3a9188;var _0x2178bd=squel['select']();_0x2178bd['from'](_0x32e1bb[_0x0f12('0x72')]);for(var _0x5ba504=0x0;_0x5ba504<_0x3fecc7[_0x0f12('0x39')];_0x5ba504+=0x1){_0x3a9188=_0x3fecc7[_0x5ba504]['MetricId']?_0x1aba9f[_0x3fecc7[_0x5ba504]['MetricId']][_0x0f12('0x74')]:_0x3fecc7[_0x5ba504]['field'];_0x3a9188=_0x3fecc7[_0x5ba504][_0x0f12('0x75')]?_['replace'](_0x3488c0[_0x3fecc7[_0x5ba504][_0x0f12('0x75')]],'%s',_0x3a9188):_0x3a9188;_0x3a9188=_0x3fecc7[_0x5ba504][_0x0f12('0x77')]?_[_0x0f12('0x76')](_0x155dc2[_0x3fecc7[_0x5ba504][_0x0f12('0x77')]],'%s',_0x3a9188):_0x3a9188;if(_0x3fecc7[_0x5ba504][_0x0f12('0xa7')]){_0x2178bd[_0x0f12('0x69')](_0x3a9188);}_0x3fecc7[_0x5ba504][_0x0f12('0x78')]&&_0x2178bd[_0x0f12('0x3b')](_0x3a9188,_0x3fecc7[_0x5ba504][_0x0f12('0x78')]===_0x0f12('0x79')?![]:!![]);_0x2178bd[_0x0f12('0x6a')](_0x3a9188,_0x3fecc7[_0x5ba504][_0x0f12('0x7a')]||_0x3a9188);}if(_0x32e1bb[_0x0f12('0x7b')]){_0x32e1bb[_0x0f12('0x7b')]=JSON[_0x0f12('0x7c')](_0x32e1bb[_0x0f12('0x7b')]);for(var _0xa21284=0x0;_0xa21284<_0x32e1bb[_0x0f12('0x7b')][_0x0f12('0x39')];_0xa21284+=0x1){if(_0x32e1bb[_0x0f12('0x7b')][_0xa21284][_0x0f12('0x31')]&&_[_0x0f12('0x63')](_0x3c6ade,_0x32e1bb[_0x0f12('0x7b')][_0xa21284]['type'])&&_0x32e1bb[_0x0f12('0x7b')][_0xa21284]['parentKey']&&_0x32e1bb[_0x0f12('0x7b')][_0xa21284]['foreignTable']&&_0x32e1bb[_0x0f12('0x7b')][_0xa21284][_0x0f12('0x7e')]){_0x2178bd[_0x32e1bb[_0x0f12('0x7b')][_0xa21284][_0x0f12('0x31')]](_0x32e1bb[_0x0f12('0x7b')][_0xa21284][_0x0f12('0x80')],null,util[_0x0f12('0x77')]('%s.%s\x20=\x20%s.%s',_0x32e1bb[_0x0f12('0x72')],_0x32e1bb['joins'][_0xa21284][_0x0f12('0x7d')],_0x32e1bb[_0x0f12('0x7b')][_0xa21284][_0x0f12('0x80')],_0x32e1bb[_0x0f12('0x7b')][_0xa21284][_0x0f12('0x7e')]));}}}if(_0x32e1bb['conditions']){_0x32e1bb['conditions']=JSON[_0x0f12('0x7c')](_0x32e1bb[_0x0f12('0x81')]);_0x2178bd[_0x0f12('0x3d')](_0x1cb885(_0x32e1bb['conditions']['group']));}_0x1d5df9=_0x2178bd[_0x0f12('0x82')]();_0x2178bd['limit'](_0x4e38b7);_0x2178bd[_0x0f12('0x1f')](0x0);logger[_0x0f12('0x83')](_0x0f12('0x84'),_0x2178bd['toString']());return db['sequelize'][_0x0f12('0x34')](_0x2178bd[_0x0f12('0x8f')](),{'type':db[_0x0f12('0x85')][_0x0f12('0x86')]['SELECT']});}})[_0x0f12('0x26')](function(){return{'sql':_0x1d5df9[_0x0f12('0x8f')]()};})['then'](respondWithResult(_0x2a5ba8,null))['catch'](handleError(_0x2a5ba8,null));}; \ No newline at end of file +var _0x8868=['limit','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','name','send','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','includeAll','include','findAll','rows','params','options','find','catch','create','body','user','get','role','UserProfileSection','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','replace','groupBy','orderBy','DESC','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','toString','sequelize','SELECT','cross_join','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','value','select','clone','web','fullPath','%s-%s.%s','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','runReport','COUNT(DISTINCT\x20%s)','AVG(%s)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','dbH','status','count','offset'];(function(_0x2ea2e9,_0x40605e){var _0x2719a9=function(_0x396a76){while(--_0x396a76){_0x2ea2e9['push'](_0x2ea2e9['shift']());}};_0x2719a9(++_0x40605e);}(_0x8868,0x1ca));var _0x8886=function(_0x41e034,_0x439b2d){_0x41e034=_0x41e034-0x0;var _0x397e66=_0x8868[_0x41e034];return _0x397e66;};'use strict';var pdf=require(_0x8886('0x0'));var emlformat=require(_0x8886('0x1'));var rimraf=require(_0x8886('0x2'));var zipdir=require(_0x8886('0x3'));var jsonpatch=require(_0x8886('0x4'));var rp=require(_0x8886('0x5'));var moment=require(_0x8886('0x6'));var BPromise=require(_0x8886('0x7'));var Mustache=require(_0x8886('0x8'));var util=require(_0x8886('0x9'));var path=require(_0x8886('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8886('0xb'));var fs=require('fs');var _=require(_0x8886('0xc'));var squel=require('squel');var crypto=require(_0x8886('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8886('0xe'));var toCsv=require(_0x8886('0xf'));var querystring=require(_0x8886('0x10'));var Papa=require(_0x8886('0x11'));var Redis=require(_0x8886('0x12'));var authService=require(_0x8886('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8886('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8886('0x15'));var utils=require('../../config/utils');var config=require(_0x8886('0x16'));var db=require(_0x8886('0x17'))['db'];var dbH=require(_0x8886('0x17'))[_0x8886('0x18')];function respondWithStatusCode(_0x54cbc9,_0x29fa59){_0x29fa59=_0x29fa59||0xcc;return function(_0x104cb4){if(_0x104cb4){return _0x54cbc9['sendStatus'](_0x29fa59);}return _0x54cbc9[_0x8886('0x19')](_0x29fa59)['end']();};}function respondWithResult(_0x4a339,_0x1110fd){_0x1110fd=_0x1110fd||0xc8;return function(_0x7a4f08){if(_0x7a4f08){return _0x4a339[_0x8886('0x19')](_0x1110fd)['json'](_0x7a4f08);}};}function respondWithFilteredResult(_0x5b6f4b,_0x31dad3){return function(_0x11905e){if(_0x11905e){var _0x4dca44=_0x11905e[_0x8886('0x1a')],_0x53bbd5=_0x31dad3[_0x8886('0x1b')],_0x563a82=_0x31dad3[_0x8886('0x1b')]+_0x31dad3[_0x8886('0x1c')],_0x54659b;if(_0x563a82>=_0x4dca44){_0x563a82=_0x4dca44;_0x54659b=0xc8;}else{_0x54659b=0xce;}_0x5b6f4b[_0x8886('0x19')](_0x54659b);return _0x5b6f4b[_0x8886('0x1d')](_0x8886('0x1e'),_0x53bbd5+'-'+_0x563a82+'/'+_0x4dca44)[_0x8886('0x1f')](_0x11905e);}return null;};}function patchUpdates(_0xbf4367){return function(_0x85abb6){try{jsonpatch[_0x8886('0x20')](_0x85abb6,_0xbf4367,!![]);}catch(_0x3590e7){return BPromise[_0x8886('0x21')](_0x3590e7);}return _0x85abb6[_0x8886('0x22')]();};}function saveUpdates(_0x5103f9,_0x4241d9){return function(_0x595f45){if(_0x595f45){return _0x595f45[_0x8886('0x23')](_0x5103f9)[_0x8886('0x24')](function(_0x48ec2e){return _0x48ec2e;});}return null;};}function removeEntity(_0x3894a0,_0x17163e){return function(_0x34a741){if(_0x34a741){return _0x34a741[_0x8886('0x25')]()[_0x8886('0x24')](function(){var _0x1c4485=_0x34a741['get']({'plain':!![]});var _0x3df299='CustomReports';return db[_0x8886('0x26')][_0x8886('0x25')]({'where':{'type':_0x3df299,'resourceId':_0x1c4485['id']}})[_0x8886('0x24')](function(){return _0x34a741;});})['then'](function(){_0x3894a0[_0x8886('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0c51,_0x127fc9){return function(_0x27ba7d){if(!_0x27ba7d){_0x1b0c51[_0x8886('0x27')](0x194);}return _0x27ba7d;};}function handleError(_0x102adf,_0x42a568){_0x42a568=_0x42a568||0x1f4;return function(_0x2e5070){logger['error'](_0x2e5070['stack']);if(_0x2e5070[_0x8886('0x28')]){delete _0x2e5070[_0x8886('0x28')];}_0x102adf['status'](_0x42a568)[_0x8886('0x29')](_0x2e5070);};}exports[_0x8886('0x2a')]=function(_0x15cc33,_0x4aa414){var _0x5084a4={},_0x439eee={},_0x2148ca={'count':0x0,'rows':[]};var _0x22f32d=_[_0x8886('0x2b')](db[_0x8886('0x2c')][_0x8886('0x2d')],function(_0x1603fb){return{'name':_0x1603fb['fieldName'],'type':_0x1603fb[_0x8886('0x2e')][_0x8886('0x2f')]};});_0x439eee[_0x8886('0x30')]=_['map'](_0x22f32d,_0x8886('0x28'));_0x439eee['query']=_[_0x8886('0x31')](_0x15cc33[_0x8886('0x32')]);_0x439eee['filters']=_[_0x8886('0x33')](_0x439eee[_0x8886('0x30')],_0x439eee[_0x8886('0x32')]);_0x5084a4[_0x8886('0x34')]=_[_0x8886('0x33')](_0x439eee[_0x8886('0x30')],qs[_0x8886('0x35')](_0x15cc33['query'][_0x8886('0x35')]));_0x5084a4[_0x8886('0x34')]=_0x5084a4[_0x8886('0x34')][_0x8886('0x36')]?_0x5084a4[_0x8886('0x34')]:_0x439eee[_0x8886('0x30')];if(!_0x15cc33['query'][_0x8886('0x37')](_0x8886('0x38'))){_0x5084a4[_0x8886('0x1c')]=qs[_0x8886('0x1c')](_0x15cc33[_0x8886('0x32')]['limit']);_0x5084a4[_0x8886('0x1b')]=qs[_0x8886('0x1b')](_0x15cc33[_0x8886('0x32')][_0x8886('0x1b')]);}_0x5084a4[_0x8886('0x39')]=qs[_0x8886('0x3a')](_0x15cc33[_0x8886('0x32')]['sort']);_0x5084a4[_0x8886('0x3b')]=qs[_0x8886('0x3c')](_['pick'](_0x15cc33['query'],_0x439eee[_0x8886('0x3c')]),_0x22f32d);if(_0x15cc33[_0x8886('0x32')]['filter']){_0x5084a4['where']=_[_0x8886('0x3d')](_0x5084a4[_0x8886('0x3b')],{'$or':_[_0x8886('0x2b')](_0x22f32d,function(_0x2125cd){if(_0x2125cd[_0x8886('0x2e')]!==_0x8886('0x3e')){var _0x3bffd6={};_0x3bffd6[_0x2125cd[_0x8886('0x28')]]={'$like':'%'+_0x15cc33['query'][_0x8886('0x3f')]+'%'};return _0x3bffd6;}})});}_0x5084a4=_[_0x8886('0x3d')]({},_0x5084a4,_0x15cc33['options']);var _0xc716b1={'where':_0x5084a4[_0x8886('0x3b')]};return db['AnalyticCustomReport'][_0x8886('0x1a')](_0xc716b1)[_0x8886('0x24')](function(_0x5f265e){_0x2148ca['count']=_0x5f265e;if(_0x15cc33['query'][_0x8886('0x40')]){_0x5084a4[_0x8886('0x41')]=[{'all':!![]}];}return db[_0x8886('0x2c')][_0x8886('0x42')](_0x5084a4);})[_0x8886('0x24')](function(_0xfe4636){_0x2148ca[_0x8886('0x43')]=_0xfe4636;return _0x2148ca;})['then'](respondWithFilteredResult(_0x4aa414,_0x5084a4))['catch'](handleError(_0x4aa414,null));};exports['show']=function(_0x59e3ba,_0x58bdc1){var _0x4401f2={'raw':![],'where':{'id':_0x59e3ba[_0x8886('0x44')]['id']}},_0x19ee27={};_0x19ee27[_0x8886('0x30')]=_[_0x8886('0x31')](db[_0x8886('0x2c')][_0x8886('0x2d')]);_0x19ee27[_0x8886('0x32')]=_['keys'](_0x59e3ba[_0x8886('0x32')]);_0x19ee27[_0x8886('0x3c')]=_[_0x8886('0x33')](_0x19ee27[_0x8886('0x30')],_0x19ee27[_0x8886('0x32')]);_0x4401f2['attributes']=_[_0x8886('0x33')](_0x19ee27['model'],qs[_0x8886('0x35')](_0x59e3ba[_0x8886('0x32')][_0x8886('0x35')]));_0x4401f2[_0x8886('0x34')]=_0x4401f2[_0x8886('0x34')][_0x8886('0x36')]?_0x4401f2[_0x8886('0x34')]:_0x19ee27['model'];if(_0x59e3ba['query'][_0x8886('0x40')]){_0x4401f2[_0x8886('0x41')]=[{'all':!![]}];}_0x4401f2=_[_0x8886('0x3d')]({},_0x4401f2,_0x59e3ba[_0x8886('0x45')]);return db[_0x8886('0x2c')][_0x8886('0x46')](_0x4401f2)[_0x8886('0x24')](handleEntityNotFound(_0x58bdc1,null))[_0x8886('0x24')](respondWithResult(_0x58bdc1,null))[_0x8886('0x47')](handleError(_0x58bdc1,null));};exports[_0x8886('0x48')]=function(_0x443162,_0x103682){return db['AnalyticCustomReport'][_0x8886('0x48')](_0x443162[_0x8886('0x49')],{})[_0x8886('0x24')](function(_0x5775ff){var _0x214c22=_0x443162[_0x8886('0x4a')][_0x8886('0x4b')]({'plain':!![]});if(!_0x214c22)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x214c22[_0x8886('0x4c')]===_0x8886('0x4a')){var _0x41562d=_0x5775ff['get']({'plain':!![]});var _0x347961='Reports';return db[_0x8886('0x4d')][_0x8886('0x46')]({'where':{'name':_0x347961,'userProfileId':_0x214c22['userProfileId']},'raw':!![]})[_0x8886('0x24')](function(_0x4b5d13){if(_0x4b5d13&&_0x4b5d13['autoAssociation']===0x0){return db[_0x8886('0x26')][_0x8886('0x48')]({'name':_0x41562d[_0x8886('0x28')],'resourceId':_0x41562d['id'],'type':_0x8886('0x4e'),'sectionId':_0x4b5d13['id']},{})[_0x8886('0x24')](function(){return _0x5775ff;});}else{return _0x5775ff;}})[_0x8886('0x47')](function(_0x5344ac){logger[_0x8886('0x4f')](_0x8886('0x50'),_0x5344ac);throw _0x5344ac;});}return _0x5775ff;})[_0x8886('0x24')](respondWithResult(_0x103682,0xc9))['catch'](handleError(_0x103682,null));};exports[_0x8886('0x23')]=function(_0x362592,_0x363573){if(_0x362592[_0x8886('0x49')]['id']){delete _0x362592[_0x8886('0x49')]['id'];}return db[_0x8886('0x2c')][_0x8886('0x46')]({'where':{'id':_0x362592[_0x8886('0x44')]['id']}})[_0x8886('0x24')](handleEntityNotFound(_0x363573,null))[_0x8886('0x24')](saveUpdates(_0x362592[_0x8886('0x49')],null))[_0x8886('0x24')](respondWithResult(_0x363573,null))[_0x8886('0x47')](handleError(_0x363573,null));};exports[_0x8886('0x25')]=function(_0x52fdb3,_0x508bb3){return db['AnalyticCustomReport']['find']({'where':{'id':_0x52fdb3[_0x8886('0x44')]['id']}})['then'](handleEntityNotFound(_0x508bb3,null))[_0x8886('0x24')](removeEntity(_0x508bb3,null))['catch'](handleError(_0x508bb3,null));};exports[_0x8886('0x51')]=function(_0xc526f9,_0x370856){var _0x20fc92=0xa;var _0x553e52=[_0x8886('0x52'),_0x8886('0x53'),_0x8886('0x54'),'cross_join'];var _0x7c47b5={'SUM':_0x8886('0x55'),'COUNT':_0x8886('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8886('0x57'),'MIN':_0x8886('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8886('0x59'),'GROUP_CONCAT ASC':_0x8886('0x5a'),'GROUP_CONCAT DESC':_0x8886('0x5b')};var _0x3e2cc9={'SEC_TO_TIME':_0x8886('0x5c'),'DATE':'DATE(%s)','HOUR':_0x8886('0x5d'),'ROUND':_0x8886('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3a1b8e=function(_0x3bd8e9){return!_[_0x8886('0x5f')]([_0x8886('0x60'),'IS\x20NOT\x20NULL',_0x8886('0x61'),'IS\x20NOT\x20EMPTY'],_0x3bd8e9);};var _0x4785d2=function(_0x144015){if(!_0x144015||!_0x144015['rules'][_0x8886('0x36')]){return'';}for(var _0x25e0c0='(',_0x3002db=0x0;_0x3002db<_0x144015[_0x8886('0x62')][_0x8886('0x36')];_0x3002db+=0x1){_0x3002db>0x0&&(_0x25e0c0+='\x20'+_0x144015[_0x8886('0x63')]+'\x20');_0x25e0c0+=_0x144015[_0x8886('0x62')][_0x3002db][_0x8886('0x64')]?_0x4785d2(_0x144015[_0x8886('0x62')][_0x3002db]['group']):_0x144015[_0x8886('0x62')][_0x3002db][_0x8886('0x65')]+'\x20'+_0x144015[_0x8886('0x62')][_0x3002db][_0x8886('0x66')]+(_0x3a1b8e(_0x144015[_0x8886('0x62')][_0x3002db][_0x8886('0x66')])?'\x20'+_0x144015[_0x8886('0x62')][_0x3002db]['value']:'');}return _0x25e0c0+')';};var _0x5b588e={'where':{'id':_0xc526f9[_0x8886('0x44')]['id']}},_0x3f49b1,_0x118f7e,_0x4beda7,_0x489141,_0x452a2c;_0x5b588e=_[_0x8886('0x3d')]({},_0x5b588e,_0xc526f9[_0x8886('0x45')]);return db['AnalyticCustomReport'][_0x8886('0x46')](_0x5b588e)['then'](function(_0x33409d){if(_0x33409d){_0x3f49b1=_0x33409d;return _0x33409d['getFields']();}return null;})[_0x8886('0x24')](function(_0x403b1d){if(_0x403b1d){if(!_0x403b1d[_0x8886('0x36')]){throw new db[(_0x8886('0x67'))][(_0x8886('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x118f7e=_0x403b1d;return db[_0x8886('0x69')][_0x8886('0x42')]({'raw':!![]});}return null;})[_0x8886('0x24')](function(_0x5a049a){if(_0x5a049a){_0x4beda7=_[_0x8886('0x6a')](_0x5a049a,'id');var _0x409028;var _0x2757d5=squel['select']();_0x2757d5[_0x8886('0x6b')](_0x3f49b1[_0x8886('0x6c')]);for(var _0xef08a=0x0;_0xef08a<_0x118f7e[_0x8886('0x36')];_0xef08a+=0x1){_0x409028=_0x118f7e[_0xef08a][_0x8886('0x6d')]?_0x4beda7[_0x118f7e[_0xef08a][_0x8886('0x6d')]][_0x8886('0x6e')]:_0x118f7e[_0xef08a][_0x8886('0x65')];_0x409028=_0x118f7e[_0xef08a][_0x8886('0x6f')]?_['replace'](_0x7c47b5[_0x118f7e[_0xef08a][_0x8886('0x6f')]],'%s',_0x409028):_0x409028;_0x409028=_0x118f7e[_0xef08a][_0x8886('0x70')]?_[_0x8886('0x71')](_0x3e2cc9[_0x118f7e[_0xef08a]['format']],'%s',_0x409028):_0x409028;if(_0x118f7e[_0xef08a][_0x8886('0x72')]){_0x2757d5[_0x8886('0x64')](_0x409028);}_0x118f7e[_0xef08a][_0x8886('0x73')]&&_0x2757d5[_0x8886('0x39')](_0x409028,_0x118f7e[_0xef08a][_0x8886('0x73')]===_0x8886('0x74')?![]:!![]);_0x2757d5[_0x8886('0x65')](_0x409028,_0x118f7e[_0xef08a]['alias']||_0x409028);}if(_0x3f49b1[_0x8886('0x75')]){_0x3f49b1[_0x8886('0x75')]=JSON[_0x8886('0x76')](_0x3f49b1['joins']);for(var _0x3b94db=0x0;_0x3b94db<_0x3f49b1[_0x8886('0x75')][_0x8886('0x36')];_0x3b94db+=0x1){if(_0x3f49b1[_0x8886('0x75')][_0x3b94db]['type']&&_[_0x8886('0x5f')](_0x553e52,_0x3f49b1[_0x8886('0x75')][_0x3b94db][_0x8886('0x2e')])&&_0x3f49b1[_0x8886('0x75')][_0x3b94db]['parentKey']&&_0x3f49b1['joins'][_0x3b94db][_0x8886('0x77')]&&_0x3f49b1[_0x8886('0x75')][_0x3b94db][_0x8886('0x78')]){_0x2757d5[_0x3f49b1['joins'][_0x3b94db][_0x8886('0x2e')]](_0x3f49b1['joins'][_0x3b94db][_0x8886('0x77')],null,util[_0x8886('0x70')](_0x8886('0x79'),_0x3f49b1['table'],_0x3f49b1[_0x8886('0x75')][_0x3b94db][_0x8886('0x7a')],_0x3f49b1[_0x8886('0x75')][_0x3b94db][_0x8886('0x77')],_0x3f49b1[_0x8886('0x75')][_0x3b94db]['foreignKey']));}}}if(_0x3f49b1[_0x8886('0x7b')]){_0x3f49b1[_0x8886('0x7b')]=JSON[_0x8886('0x76')](_0x3f49b1['conditions']);_0x2757d5[_0x8886('0x3b')](_0x4785d2(_0x3f49b1[_0x8886('0x7b')][_0x8886('0x64')]));}_0x452a2c=_0x2757d5['clone']();_0x2757d5[_0x8886('0x1c')](_0x20fc92);_0x2757d5['offset'](0x0);logger[_0x8886('0x7c')](_0x8886('0x7d'),_0x2757d5[_0x8886('0x7e')]());return db[_0x8886('0x7f')][_0x8886('0x32')](_0x2757d5['toString'](),{'type':db[_0x8886('0x7f')]['QueryTypes'][_0x8886('0x80')]});}})[_0x8886('0x24')](respondWithResult(_0x370856,null))[_0x8886('0x47')](handleError(_0x370856,null));};function runReport(_0x245b36,_0x35c36d,_0x12d00c){var _0x12e27b=_0x35c36d['name'];var _0x5ce50c=0xa;var _0x211333=[_0x8886('0x52'),_0x8886('0x53'),_0x8886('0x54'),_0x8886('0x81')];var _0x133ecb={'SUM':_0x8886('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x8886('0x59'),'GROUP_CONCAT ASC':_0x8886('0x5a'),'GROUP_CONCAT DESC':_0x8886('0x5b')};var _0x3ecbbe={'SEC_TO_TIME':_0x8886('0x5c'),'DATE':_0x8886('0x82'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8886('0x83')};var _0x227d3d=function(_0x5f5cb7){return!_['includes']([_0x8886('0x60'),'IS\x20NOT\x20NULL',_0x8886('0x61'),_0x8886('0x84')],_0x5f5cb7);};var _0x3b6d9b=function(_0x41e8e3){if(!_0x41e8e3||!_0x41e8e3[_0x8886('0x62')][_0x8886('0x36')]){return'';}for(var _0x20703b='(',_0x2644e9=0x0;_0x2644e9<_0x41e8e3[_0x8886('0x62')]['length'];_0x2644e9+=0x1){_0x2644e9>0x0&&(_0x20703b+='\x20'+_0x41e8e3[_0x8886('0x63')]+'\x20');_0x20703b+=_0x41e8e3[_0x8886('0x62')][_0x2644e9][_0x8886('0x64')]?_0x3b6d9b(_0x41e8e3['rules'][_0x2644e9]['group']):_0x41e8e3['rules'][_0x2644e9][_0x8886('0x65')]+'\x20'+_0x41e8e3['rules'][_0x2644e9][_0x8886('0x66')]+(_0x227d3d(_0x41e8e3[_0x8886('0x62')][_0x2644e9]['condition'])?'\x20'+_0x41e8e3[_0x8886('0x62')][_0x2644e9][_0x8886('0x85')]:'');}return _0x20703b+')';};var _0x15cb87={'where':{'id':_0x245b36['id']}},_0x4fc870,_0xc9fb45,_0x2eede3,_0xa1d03c,_0x18011a;_0x15cb87=_[_0x8886('0x3d')]({},_0x15cb87,_0x12d00c);return db['AnalyticCustomReport'][_0x8886('0x46')](_0x15cb87)['then'](function(_0x23b391){if(_0x23b391){_0x4fc870=_0x23b391;return _0x23b391['getFields']();}return null;})[_0x8886('0x24')](function(_0x329274){if(_0x329274){if(!_0x329274[_0x8886('0x36')]){throw new db[(_0x8886('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc9fb45=_0x329274;return db[_0x8886('0x69')][_0x8886('0x42')]({'raw':!![]});}return null;})[_0x8886('0x24')](function(_0x4bc379){if(_0x4bc379){_0x2eede3=_[_0x8886('0x6a')](_0x4bc379,'id');var _0xe863a;var _0xc2b204=squel[_0x8886('0x86')]();_0xc2b204[_0x8886('0x6b')](_0x4fc870[_0x8886('0x6c')]);for(var _0xa31d55=0x0;_0xa31d55<_0xc9fb45['length'];_0xa31d55+=0x1){_0xe863a=_0xc9fb45[_0xa31d55][_0x8886('0x6d')]?_0x2eede3[_0xc9fb45[_0xa31d55][_0x8886('0x6d')]]['metric']:_0xc9fb45[_0xa31d55][_0x8886('0x65')];_0xe863a=_0xc9fb45[_0xa31d55][_0x8886('0x6f')]?_[_0x8886('0x71')](_0x133ecb[_0xc9fb45[_0xa31d55][_0x8886('0x6f')]],'%s',_0xe863a):_0xe863a;_0xe863a=_0xc9fb45[_0xa31d55]['format']?_['replace'](_0x3ecbbe[_0xc9fb45[_0xa31d55]['format']],'%s',_0xe863a):_0xe863a;if(_0xc9fb45[_0xa31d55][_0x8886('0x72')]){_0xc2b204['group'](_0xe863a);}_0xc9fb45[_0xa31d55][_0x8886('0x73')]&&_0xc2b204[_0x8886('0x39')](_0xe863a,_0xc9fb45[_0xa31d55][_0x8886('0x73')]===_0x8886('0x74')?![]:!![]);_0xc2b204[_0x8886('0x65')](_0xe863a,_0xc9fb45[_0xa31d55]['alias']||_0xe863a);}if(_0x4fc870[_0x8886('0x75')]){_0x4fc870[_0x8886('0x75')]=JSON[_0x8886('0x76')](_0x4fc870['joins']);for(var _0x18f3cf=0x0;_0x18f3cf<_0x4fc870[_0x8886('0x75')][_0x8886('0x36')];_0x18f3cf+=0x1){if(_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x2e')]&&_[_0x8886('0x5f')](_0x211333,_0x4fc870['joins'][_0x18f3cf][_0x8886('0x2e')])&&_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x7a')]&&_0x4fc870[_0x8886('0x75')][_0x18f3cf]['foreignTable']&&_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x78')]){_0xc2b204[_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x2e')]](_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x77')],null,util[_0x8886('0x70')](_0x8886('0x79'),_0x4fc870['table'],_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x7a')],_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x77')],_0x4fc870[_0x8886('0x75')][_0x18f3cf][_0x8886('0x78')]));}}}if(_0x4fc870[_0x8886('0x7b')]){_0x4fc870[_0x8886('0x7b')]=JSON['parse'](_0x4fc870['conditions']);_0xc2b204[_0x8886('0x3b')](_0x3b6d9b(_0x4fc870[_0x8886('0x7b')]['group']));}_0x18011a=_0xc2b204[_0x8886('0x87')]();_0xc2b204[_0x8886('0x1c')](_0x5ce50c);_0xc2b204[_0x8886('0x1b')](0x0);logger['debug'](_0x8886('0x7d'),_0xc2b204[_0x8886('0x7e')]());return db['sequelize'][_0x8886('0x32')](_0xc2b204[_0x8886('0x7e')](),{'type':db[_0x8886('0x7f')]['QueryTypes'][_0x8886('0x80')]});}})[_0x8886('0x24')](function(_0x460900){if(!_0x460900[_0x8886('0x36')]){throw new db[(_0x8886('0x67'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x35c36d['output']===_0x8886('0x88')){return null;}var _0x4be084=_[_0x8886('0x3d')](_0x35c36d,{'name':_0x35c36d[_0x8886('0x89')]||_0x35c36d[_0x8886('0x28')]||_0x4fc870[_0x8886('0x28')],'basename':_0x12e27b,'savename':util[_0x8886('0x70')](_0x8886('0x8a'),_0x35c36d[_0x8886('0x28')]||_0x4fc870['name'],require('randomstring')['generate'](0x4),_0x35c36d[_0x8886('0x8b')]||_0x8886('0x8c')),'reportId':_0x4fc870['id'],'reportType':_0x8886('0x8d')});return db[_0x8886('0x8e')][_0x8886('0x48')](_0x4be084,{'raw':!![]});})[_0x8886('0x24')](function(_0x117113){if(_0x4fc870[_0x8886('0x6c')]===_0x8886('0x8f')){_0x18011a[_0x8886('0x3b')](_0x4fc870[_0x8886('0x6c')]+_0x8886('0x90'),_0x35c36d[_0x8886('0x91')],_0x35c36d[_0x8886('0x92')]);}else{_0x18011a[_0x8886('0x3b')](_0x4fc870[_0x8886('0x6c')]+_0x8886('0x93'),_0x35c36d[_0x8886('0x91')],_0x35c36d[_0x8886('0x92')]);}if(_0x117113){logger[_0x8886('0x94')](_0x8886('0x95'),_0x18011a[_0x8886('0x7e')]());require(_0x8886('0x96'))[_0x8886('0x97')](path['join'](__dirname,_0x8886('0x98'),_0x117113[_0x8886('0x8b')]),[_0x117113['id'],_0x18011a[_0x8886('0x7e')](),path['join'](__dirname,'../../files/reports',_0x117113[_0x8886('0x99')]),_0x12e27b]);return _0x117113;}else{var _0x82c59f=squel[_0x8886('0x86')]();_0x82c59f[_0x8886('0x6b')]('('+_0x18011a[_0x8886('0x7e')]()+')',_0x8886('0x9a'));_0x82c59f[_0x8886('0x65')](_0x8886('0x9b'),_0x8886('0x1a'));_0x18011a[_0x8886('0x1c')](_0x35c36d['limit']||_0x5ce50c);_0x18011a['offset'](_0x35c36d[_0x8886('0x1b')]||0x0);return dbH['sequelize'][_0x8886('0x32')](_0x82c59f[_0x8886('0x7e')](),{'type':dbH[_0x8886('0x7f')][_0x8886('0x9c')][_0x8886('0x80')]})[_0x8886('0x24')](function(_0x50068b){if(!_0x50068b[_0x8886('0x36')]){_0xa1d03c=0x0;}else{_0xa1d03c=_0x50068b[0x0][_0x8886('0x1a')]||0x0;}return dbH['sequelize']['query'](_0x18011a[_0x8886('0x7e')](),{'type':dbH[_0x8886('0x7f')][_0x8886('0x9c')][_0x8886('0x80')]});})[_0x8886('0x24')](function(_0x213f4f){return{'rows':_0x213f4f||[],'count':_0xa1d03c};});}});}exports['run']=function(_0x3799d0,_0x49eecc){return runReport(_0x3799d0[_0x8886('0x44')],_0x3799d0[_0x8886('0x32')],_0x3799d0[_0x8886('0x45')])[_0x8886('0x24')](respondWithResult(_0x49eecc,null))['catch'](handleError(_0x49eecc,null));};exports[_0x8886('0x9d')]=runReport;exports['query']=function(_0x17fae1,_0x117977){var _0x4895a9=0xa;var _0x50c7d4=[_0x8886('0x52'),_0x8886('0x53'),'right_join',_0x8886('0x81')];var _0x500198={'SUM':_0x8886('0x55'),'COUNT':_0x8886('0x56'),'COUNT DISTINCT':_0x8886('0x9e'),'MAX':_0x8886('0x57'),'MIN':'MIN(%s)','AVG':_0x8886('0x9f'),'GROUP_CONCAT':_0x8886('0x59'),'GROUP_CONCAT ASC':_0x8886('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d8838={'SEC_TO_TIME':_0x8886('0x5c'),'DATE':_0x8886('0x82'),'HOUR':_0x8886('0x5d'),'ROUND':_0x8886('0x5e'),'UNIX_TIMESTAMP':_0x8886('0x83')};var _0x34ebfe=function(_0x1d2db1){return!_[_0x8886('0x5f')]([_0x8886('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x8886('0x84')],_0x1d2db1);};var _0x1c98c1=function(_0x59c6c8){if(!_0x59c6c8||!_0x59c6c8[_0x8886('0x62')][_0x8886('0x36')]){return'';}for(var _0x6d7d83='(',_0x4254e9=0x0;_0x4254e9<_0x59c6c8['rules'][_0x8886('0x36')];_0x4254e9+=0x1){_0x4254e9>0x0&&(_0x6d7d83+='\x20'+_0x59c6c8[_0x8886('0x63')]+'\x20');_0x6d7d83+=_0x59c6c8[_0x8886('0x62')][_0x4254e9][_0x8886('0x64')]?_0x1c98c1(_0x59c6c8[_0x8886('0x62')][_0x4254e9][_0x8886('0x64')]):_0x59c6c8['rules'][_0x4254e9][_0x8886('0x65')]+'\x20'+_0x59c6c8['rules'][_0x4254e9][_0x8886('0x66')]+(_0x34ebfe(_0x59c6c8[_0x8886('0x62')][_0x4254e9][_0x8886('0x66')])?'\x20'+_0x59c6c8[_0x8886('0x62')][_0x4254e9][_0x8886('0x85')]:'');}return _0x6d7d83+')';};var _0xe8221e={'where':{'id':_0x17fae1[_0x8886('0x44')]['id']}},_0x154fa9,_0x1754aa,_0x192377,_0x1e6016,_0x8861cd;_0xe8221e=_[_0x8886('0x3d')]({},_0xe8221e,_0x17fae1['options']);return db[_0x8886('0x2c')]['find'](_0xe8221e)[_0x8886('0x24')](function(_0xba9245){if(_0xba9245){_0x154fa9=_0xba9245;return _0xba9245[_0x8886('0xa0')]();}return null;})[_0x8886('0x24')](function(_0x2f6a6e){if(_0x2f6a6e){if(!_0x2f6a6e[_0x8886('0x36')]){throw new db[(_0x8886('0x67'))][(_0x8886('0x68'))](_0x8886('0xa1'),0x193);}_0x1754aa=_0x2f6a6e;return db['AnalyticMetric'][_0x8886('0x42')]({'raw':!![]});}return null;})[_0x8886('0x24')](function(_0x4d90f3){if(_0x4d90f3){_0x192377=_[_0x8886('0x6a')](_0x4d90f3,'id');var _0xa69acd;var _0x492bd0=squel['select']();_0x492bd0['from'](_0x154fa9['table']);for(var _0x31a4e3=0x0;_0x31a4e3<_0x1754aa[_0x8886('0x36')];_0x31a4e3+=0x1){_0xa69acd=_0x1754aa[_0x31a4e3][_0x8886('0x6d')]?_0x192377[_0x1754aa[_0x31a4e3][_0x8886('0x6d')]][_0x8886('0x6e')]:_0x1754aa[_0x31a4e3][_0x8886('0x65')];_0xa69acd=_0x1754aa[_0x31a4e3]['function']?_[_0x8886('0x71')](_0x500198[_0x1754aa[_0x31a4e3][_0x8886('0x6f')]],'%s',_0xa69acd):_0xa69acd;_0xa69acd=_0x1754aa[_0x31a4e3][_0x8886('0x70')]?_[_0x8886('0x71')](_0x3d8838[_0x1754aa[_0x31a4e3][_0x8886('0x70')]],'%s',_0xa69acd):_0xa69acd;if(_0x1754aa[_0x31a4e3][_0x8886('0x72')]){_0x492bd0[_0x8886('0x64')](_0xa69acd);}_0x1754aa[_0x31a4e3][_0x8886('0x73')]&&_0x492bd0[_0x8886('0x39')](_0xa69acd,_0x1754aa[_0x31a4e3]['orderBy']==='DESC'?![]:!![]);_0x492bd0[_0x8886('0x65')](_0xa69acd,_0x1754aa[_0x31a4e3]['alias']||_0xa69acd);}if(_0x154fa9[_0x8886('0x75')]){_0x154fa9[_0x8886('0x75')]=JSON[_0x8886('0x76')](_0x154fa9[_0x8886('0x75')]);for(var _0x1295bd=0x0;_0x1295bd<_0x154fa9[_0x8886('0x75')][_0x8886('0x36')];_0x1295bd+=0x1){if(_0x154fa9['joins'][_0x1295bd][_0x8886('0x2e')]&&_[_0x8886('0x5f')](_0x50c7d4,_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x2e')])&&_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x7a')]&&_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x77')]&&_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x78')]){_0x492bd0[_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x2e')]](_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x77')],null,util[_0x8886('0x70')]('%s.%s\x20=\x20%s.%s',_0x154fa9[_0x8886('0x6c')],_0x154fa9['joins'][_0x1295bd][_0x8886('0x7a')],_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x77')],_0x154fa9[_0x8886('0x75')][_0x1295bd][_0x8886('0x78')]));}}}if(_0x154fa9[_0x8886('0x7b')]){_0x154fa9[_0x8886('0x7b')]=JSON['parse'](_0x154fa9[_0x8886('0x7b')]);_0x492bd0[_0x8886('0x3b')](_0x1c98c1(_0x154fa9[_0x8886('0x7b')][_0x8886('0x64')]));}_0x8861cd=_0x492bd0[_0x8886('0x87')]();_0x492bd0[_0x8886('0x1c')](_0x4895a9);_0x492bd0[_0x8886('0x1b')](0x0);logger[_0x8886('0x7c')](_0x8886('0x7d'),_0x492bd0['toString']());return db[_0x8886('0x7f')][_0x8886('0x32')](_0x492bd0[_0x8886('0x7e')](),{'type':db[_0x8886('0x7f')][_0x8886('0x9c')][_0x8886('0x80')]});}})[_0x8886('0x24')](function(){return{'sql':_0x8861cd[_0x8886('0x7e')]()};})[_0x8886('0x24')](respondWithResult(_0x117977,null))['catch'](handleError(_0x117977,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 904ba41..38ae033 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 _0xb201=['../../config/logger','api','bluebird','request-promise','path','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb201,0x117));var _0x1b20=function(_0x41aa7e,_0x325838){_0x41aa7e=_0x41aa7e-0x0;var _0x314671=_0xb201[_0x41aa7e];return _0x314671;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var logger=require(_0x1b20('0x1'))(_0x1b20('0x2'));var moment=require('moment');var BPromise=require(_0x1b20('0x3'));var rp=require(_0x1b20('0x4'));var fs=require('fs');var path=require(_0x1b20('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b20('0x6'));module[_0x1b20('0x7')]=function(_0x5836c2,_0x14f112){return _0x5836c2['define'](_0x1b20('0x8'),attributes,{'tableName':_0x1b20('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8084=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ce99b,_0x4eb4c8){var _0x5bd461=function(_0x3a2737){while(--_0x3a2737){_0x5ce99b['push'](_0x5ce99b['shift']());}};_0x5bd461(++_0x4eb4c8);}(_0x8084,0x13b));var _0x4808=function(_0x48a0b9,_0x148bdc){_0x48a0b9=_0x48a0b9-0x0;var _0x3d0e26=_0x8084[_0x48a0b9];return _0x3d0e26;};'use strict';var _=require(_0x4808('0x0'));var util=require(_0x4808('0x1'));var logger=require(_0x4808('0x2'))(_0x4808('0x3'));var moment=require(_0x4808('0x4'));var BPromise=require(_0x4808('0x5'));var rp=require(_0x4808('0x6'));var fs=require('fs');var path=require(_0x4808('0x7'));var rimraf=require(_0x4808('0x8'));var config=require(_0x4808('0x9'));var attributes=require(_0x4808('0xa'));module[_0x4808('0xb')]=function(_0x409ae5,_0x31f3c7){return _0x409ae5[_0x4808('0xc')](_0x4808('0xd'),attributes,{'tableName':'analytics_custom_reports','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 ff0699f..11a93f3 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 _0x0273=['client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xe22416,_0x1baa24){var _0x794ae2=function(_0x7818ec){while(--_0x7818ec){_0xe22416['push'](_0xe22416['shift']());}};_0x794ae2(++_0x1baa24);}(_0x0273,0xa8));var _0x3027=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0273[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3027('0x0'));var moment=require(_0x3027('0x1'));var BPromise=require(_0x3027('0x2'));var rs=require(_0x3027('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3027('0x4'))(_0x3027('0x5'));var config=require(_0x3027('0x6'));var jayson=require(_0x3027('0x7'));var client=jayson[_0x3027('0x8')][_0x3027('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35afb2,_0x4c0765,_0x2f2378){return new BPromise(function(_0x60c0f5,_0x503f66){return client[_0x3027('0xa')](_0x35afb2,_0x2f2378)[_0x3027('0xb')](function(_0x541aca){logger['info'](_0x3027('0xc'),_0x4c0765,_0x3027('0xd'));logger[_0x3027('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x4c0765,_0x3027('0xd'),JSON[_0x3027('0xf')](_0x541aca));if(_0x541aca[_0x3027('0x10')]){if(_0x541aca[_0x3027('0x10')][_0x3027('0x11')]===0x1f4){logger[_0x3027('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c0765,_0x541aca[_0x3027('0x10')][_0x3027('0x12')]);return _0x503f66(_0x541aca[_0x3027('0x10')][_0x3027('0x12')]);}logger[_0x3027('0x10')](_0x3027('0xc'),_0x4c0765,_0x541aca['error'][_0x3027('0x12')]);return _0x60c0f5(_0x541aca[_0x3027('0x10')][_0x3027('0x12')]);}else{logger[_0x3027('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c0765,'request\x20sent');_0x60c0f5(_0x541aca[_0x3027('0x14')][_0x3027('0x12')]);}})[_0x3027('0x15')](function(_0x92aa04){logger['error'](_0x3027('0xc'),_0x4c0765,_0x92aa04);_0x503f66(_0x92aa04);});});} \ No newline at end of file +var _0x106e=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5ea15d,_0x4af291){var _0x26e8da=function(_0x5d67ca){while(--_0x5d67ca){_0x5ea15d['push'](_0x5ea15d['shift']());}};_0x26e8da(++_0x4af291);}(_0x106e,0x10e));var _0xe106=function(_0x4f0c51,_0x18a7d8){_0x4f0c51=_0x4f0c51-0x0;var _0x439525=_0x106e[_0x4f0c51];return _0x439525;};'use strict';var _=require(_0xe106('0x0'));var util=require('util');var moment=require(_0xe106('0x1'));var BPromise=require(_0xe106('0x2'));var rs=require(_0xe106('0x3'));var fs=require('fs');var Redis=require(_0xe106('0x4'));var db=require(_0xe106('0x5'))['db'];var utils=require(_0xe106('0x6'));var logger=require(_0xe106('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe106('0x8'));var client=jayson[_0xe106('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dce0,_0x4fb830,_0x5e597c){return new BPromise(function(_0x5f1ff6,_0x351575){return client[_0xe106('0xa')](_0x19dce0,_0x5e597c)[_0xe106('0xb')](function(_0x11bc60){logger[_0xe106('0xc')](_0xe106('0xd'),_0x4fb830,_0xe106('0xe'));logger[_0xe106('0xf')](_0xe106('0x10'),_0x4fb830,_0xe106('0xe'),JSON[_0xe106('0x11')](_0x11bc60));if(_0x11bc60[_0xe106('0x12')]){if(_0x11bc60[_0xe106('0x12')]['code']===0x1f4){logger['error'](_0xe106('0xd'),_0x4fb830,_0x11bc60['error']['message']);return _0x351575(_0x11bc60[_0xe106('0x12')]['message']);}logger[_0xe106('0x12')](_0xe106('0xd'),_0x4fb830,_0x11bc60[_0xe106('0x12')][_0xe106('0x13')]);return _0x5f1ff6(_0x11bc60[_0xe106('0x12')]['message']);}else{logger[_0xe106('0xc')](_0xe106('0xd'),_0x4fb830,_0xe106('0xe'));_0x5f1ff6(_0x11bc60[_0xe106('0x14')][_0xe106('0x13')]);}})[_0xe106('0x15')](function(_0x2a804){logger['error'](_0xe106('0xd'),_0x4fb830,_0x2a804);_0x351575(_0x2a804);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 08e0ecb..9a661a0 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 _0x398b=['show','/:id/preview','/:id/run','post','create','put','update','delete','destroy','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x43a51c,_0xfe6cb){var _0x2aa067=function(_0x258256){while(--_0x258256){_0x43a51c['push'](_0x43a51c['shift']());}};_0x2aa067(++_0xfe6cb);}(_0x398b,0x1e9));var _0xb398=function(_0x11731f,_0x2271b5){_0x11731f=_0x11731f-0x0;var _0x14587c=_0x398b[_0x11731f];return _0x14587c;};'use strict';var multer=require('multer');var util=require(_0xb398('0x0'));var path=require(_0xb398('0x1'));var timeout=require('connect-timeout');var express=require(_0xb398('0x2'));var router=express[_0xb398('0x3')]();var auth=require(_0xb398('0x4'));var interaction=require(_0xb398('0x5'));var config=require('../../config/environment');var controller=require(_0xb398('0x6'));router[_0xb398('0x7')]('/',auth[_0xb398('0x8')](),controller[_0xb398('0x9')]);router[_0xb398('0x7')](_0xb398('0xa'),auth[_0xb398('0x8')](),controller[_0xb398('0xb')]);router[_0xb398('0x7')](_0xb398('0xc'),auth[_0xb398('0x8')](),controller['preview']);router[_0xb398('0x7')](_0xb398('0xd'),auth[_0xb398('0x8')](),controller['run']);router[_0xb398('0x7')]('/:id/query',auth[_0xb398('0x8')](),controller['query']);router[_0xb398('0xe')]('/',auth['isAuthenticated'](),controller[_0xb398('0xf')]);router[_0xb398('0x10')](_0xb398('0xa'),auth[_0xb398('0x8')](),controller[_0xb398('0x11')]);router[_0xb398('0x12')](_0xb398('0xa'),auth[_0xb398('0x8')](),controller[_0xb398('0x13')]);module['exports']=router; \ No newline at end of file +var _0xf56d=['express','../../components/interaction/service','get','index','isAuthenticated','show','/:id/preview','preview','run','/:id/query','query','/:id','update','delete','multer','connect-timeout'];(function(_0x54f72b,_0x59fa9){var _0x1adb60=function(_0x1b3882){while(--_0x1b3882){_0x54f72b['push'](_0x54f72b['shift']());}};_0x1adb60(++_0x59fa9);}(_0xf56d,0x17e));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xdf56('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf56('0x1'));var express=require(_0xdf56('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xdf56('0x3'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xdf56('0x4')]('/',auth['isAuthenticated'](),controller[_0xdf56('0x5')]);router[_0xdf56('0x4')]('/:id',auth[_0xdf56('0x6')](),controller[_0xdf56('0x7')]);router[_0xdf56('0x4')](_0xdf56('0x8'),auth[_0xdf56('0x6')](),controller[_0xdf56('0x9')]);router['get']('/:id/run',auth[_0xdf56('0x6')](),controller[_0xdf56('0xa')]);router[_0xdf56('0x4')](_0xdf56('0xb'),auth[_0xdf56('0x6')](),controller[_0xdf56('0xc')]);router['post']('/',auth[_0xdf56('0x6')](),controller['create']);router['put'](_0xdf56('0xd'),auth[_0xdf56('0x6')](),controller[_0xdf56('0xe')]);router[_0xdf56('0xf')]('/:id',auth[_0xdf56('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7200d3d..00b1cef 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 _0x6081=['STRING','TEXT','sequelize','exports'];(function(_0x44f79f,_0x5a5ccf){var _0x413d35=function(_0x237f47){while(--_0x237f47){_0x44f79f['push'](_0x44f79f['shift']());}};_0x413d35(++_0x5a5ccf);}(_0x6081,0x176));var _0x1608=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6081[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1608('0x0'));module[_0x1608('0x1')]={'name':{'type':Sequelize[_0x1608('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x1608('0x2')]},'table':{'type':Sequelize[_0x1608('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x1608('0x3')]}}; \ No newline at end of file +var _0xd7b5=['STRING','sequelize','exports'];(function(_0x5058d4,_0x5c9315){var _0x527bc5=function(_0x52ef4d){while(--_0x52ef4d){_0x5058d4['push'](_0x5058d4['shift']());}};_0x527bc5(++_0x5c9315);}(_0xd7b5,0x16c));var _0x5d7b=function(_0x17b6ee,_0x41f598){_0x17b6ee=_0x17b6ee-0x0;var _0x9818b0=_0xd7b5[_0x17b6ee];return _0x9818b0;};'use strict';var Sequelize=require(_0x5d7b('0x0'));module[_0x5d7b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5d7b('0x2')]},'parent':{'type':Sequelize[_0x5d7b('0x2')]},'table':{'type':Sequelize[_0x5d7b('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a3526bf..1310797 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 _0x705a=['fullPath','randomstring','output','csv','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','runReport','left_join','MAX(%s)','ROUND(%s)','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','dbH','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','sendStatus','stack','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','includeAll','show','params','include','options','find','create','user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','join','HOUR(%s)','getFields','Please\x20insert\x20at\x20least\x20one\x20field','web'];(function(_0x39f211,_0x3b551b){var _0x1c1f5c=function(_0x14278c){while(--_0x14278c){_0x39f211['push'](_0x39f211['shift']());}};_0x1c1f5c(++_0x3b551b);}(_0x705a,0xb1));var _0xa705=function(_0x941099,_0x47fb57){_0x941099=_0x941099-0x0;var _0x1b6ad6=_0x705a[_0x941099];return _0x1b6ad6;};'use strict';var pdf=require(_0xa705('0x0'));var emlformat=require(_0xa705('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa705('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa705('0x3'));var moment=require('moment');var BPromise=require(_0xa705('0x4'));var Mustache=require(_0xa705('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa705('0x6'));var squel=require('squel');var crypto=require(_0xa705('0x7'));var jsforce=require(_0xa705('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xa705('0x9'));var querystring=require(_0xa705('0xa'));var Papa=require('papaparse');var Redis=require(_0xa705('0xb'));var authService=require(_0xa705('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xa705('0xd'));var hardwareService=require(_0xa705('0xe'));var logger=require('../../config/logger')('api');var utils=require(_0xa705('0xf'));var config=require('../../config/environment');var db=require(_0xa705('0x10'))['db'];var dbH=require(_0xa705('0x10'))[_0xa705('0x11')];function respondWithStatusCode(_0x8fe288,_0xd58555){_0xd58555=_0xd58555||0xcc;return function(_0x4f95ec){if(_0x4f95ec){return _0x8fe288['sendStatus'](_0xd58555);}return _0x8fe288[_0xa705('0x12')](_0xd58555)[_0xa705('0x13')]();};}function respondWithResult(_0x3a283a,_0x4878bc){_0x4878bc=_0x4878bc||0xc8;return function(_0x3f74ed){if(_0x3f74ed){return _0x3a283a[_0xa705('0x12')](_0x4878bc)[_0xa705('0x14')](_0x3f74ed);}};}function respondWithFilteredResult(_0x48315b,_0x4bb679){return function(_0x374077){if(_0x374077){var _0x513f83=_0x374077[_0xa705('0x15')],_0x4ffc62=_0x4bb679[_0xa705('0x16')],_0x1c1b82=_0x4bb679[_0xa705('0x16')]+_0x4bb679[_0xa705('0x17')],_0x505086;if(_0x1c1b82>=_0x513f83){_0x1c1b82=_0x513f83;_0x505086=0xc8;}else{_0x505086=0xce;}_0x48315b['status'](_0x505086);return _0x48315b[_0xa705('0x18')](_0xa705('0x19'),_0x4ffc62+'-'+_0x1c1b82+'/'+_0x513f83)['json'](_0x374077);}return null;};}function patchUpdates(_0x5466dc){return function(_0x1c94c7){try{jsonpatch[_0xa705('0x1a')](_0x1c94c7,_0x5466dc,!![]);}catch(_0x126838){return BPromise[_0xa705('0x1b')](_0x126838);}return _0x1c94c7[_0xa705('0x1c')]();};}function saveUpdates(_0x7cbeb2,_0x5a4d18){return function(_0x33c720){if(_0x33c720){return _0x33c720[_0xa705('0x1d')](_0x7cbeb2)[_0xa705('0x1e')](function(_0x9d6202){return _0x9d6202;});}return null;};}function removeEntity(_0xaff627,_0x1c50c1){return function(_0xd1ff52){if(_0xd1ff52){return _0xd1ff52['destroy']()[_0xa705('0x1e')](function(){var _0x4e3149=_0xd1ff52[_0xa705('0x1f')]({'plain':!![]});var _0x57284a=_0xa705('0x20');return db[_0xa705('0x21')][_0xa705('0x22')]({'where':{'type':_0x57284a,'resourceId':_0x4e3149['id']}})[_0xa705('0x1e')](function(){return _0xd1ff52;});})[_0xa705('0x1e')](function(){_0xaff627[_0xa705('0x12')](0xcc)[_0xa705('0x13')]();});}};}function handleEntityNotFound(_0x35c91f,_0x2e5aac){return function(_0x5b6d51){if(!_0x5b6d51){_0x35c91f[_0xa705('0x23')](0x194);}return _0x5b6d51;};}function handleError(_0x34eb24,_0x34e5d0){_0x34e5d0=_0x34e5d0||0x1f4;return function(_0x4d7f59){logger['error'](_0x4d7f59[_0xa705('0x24')]);if(_0x4d7f59[_0xa705('0x25')]){delete _0x4d7f59[_0xa705('0x25')];}_0x34eb24[_0xa705('0x12')](_0x34e5d0)[_0xa705('0x26')](_0x4d7f59);};}exports[_0xa705('0x27')]=function(_0x21390e,_0x89793e){var _0x4b1588={},_0x3d9583={},_0x5e2cc7={'count':0x0,'rows':[]};var _0x31ae1d=_['map'](db[_0xa705('0x28')][_0xa705('0x29')],function(_0x3bdcc2){return{'name':_0x3bdcc2[_0xa705('0x2a')],'type':_0x3bdcc2['type']['key']};});_0x3d9583[_0xa705('0x2b')]=_[_0xa705('0x2c')](_0x31ae1d,'name');_0x3d9583[_0xa705('0x2d')]=_[_0xa705('0x2e')](_0x21390e[_0xa705('0x2d')]);_0x3d9583[_0xa705('0x2f')]=_[_0xa705('0x30')](_0x3d9583[_0xa705('0x2b')],_0x3d9583[_0xa705('0x2d')]);_0x4b1588[_0xa705('0x31')]=_[_0xa705('0x30')](_0x3d9583[_0xa705('0x2b')],qs[_0xa705('0x32')](_0x21390e[_0xa705('0x2d')][_0xa705('0x32')]));_0x4b1588[_0xa705('0x31')]=_0x4b1588['attributes'][_0xa705('0x33')]?_0x4b1588[_0xa705('0x31')]:_0x3d9583[_0xa705('0x2b')];if(!_0x21390e[_0xa705('0x2d')][_0xa705('0x34')](_0xa705('0x35'))){_0x4b1588[_0xa705('0x17')]=qs[_0xa705('0x17')](_0x21390e[_0xa705('0x2d')][_0xa705('0x17')]);_0x4b1588[_0xa705('0x16')]=qs[_0xa705('0x16')](_0x21390e['query'][_0xa705('0x16')]);}_0x4b1588[_0xa705('0x36')]=qs[_0xa705('0x37')](_0x21390e[_0xa705('0x2d')][_0xa705('0x37')]);_0x4b1588['where']=qs[_0xa705('0x2f')](_[_0xa705('0x38')](_0x21390e['query'],_0x3d9583[_0xa705('0x2f')]),_0x31ae1d);if(_0x21390e[_0xa705('0x2d')][_0xa705('0x39')]){_0x4b1588['where']=_[_0xa705('0x3a')](_0x4b1588[_0xa705('0x3b')],{'$or':_[_0xa705('0x2c')](_0x31ae1d,function(_0x14bce9){if(_0x14bce9[_0xa705('0x3c')]!==_0xa705('0x3d')){var _0x485c24={};_0x485c24[_0x14bce9['name']]={'$like':'%'+_0x21390e['query'][_0xa705('0x39')]+'%'};return _0x485c24;}})});}_0x4b1588=_[_0xa705('0x3a')]({},_0x4b1588,_0x21390e['options']);var _0x2ccdf4={'where':_0x4b1588['where']};return db[_0xa705('0x28')]['count'](_0x2ccdf4)['then'](function(_0x31b490){_0x5e2cc7[_0xa705('0x15')]=_0x31b490;if(_0x21390e[_0xa705('0x2d')][_0xa705('0x3e')]){_0x4b1588['include']=[{'all':!![]}];}return db[_0xa705('0x28')]['findAll'](_0x4b1588);})[_0xa705('0x1e')](function(_0xec57e2){_0x5e2cc7['rows']=_0xec57e2;return _0x5e2cc7;})[_0xa705('0x1e')](respondWithFilteredResult(_0x89793e,_0x4b1588))['catch'](handleError(_0x89793e,null));};exports[_0xa705('0x3f')]=function(_0x239ec3,_0x31f564){var _0x3f1f90={'raw':!![],'where':{'id':_0x239ec3[_0xa705('0x40')]['id']}},_0x4f64c1={};_0x4f64c1[_0xa705('0x2b')]=_[_0xa705('0x2e')](db['AnalyticDefaultReport']['rawAttributes']);_0x4f64c1[_0xa705('0x2d')]=_['keys'](_0x239ec3[_0xa705('0x2d')]);_0x4f64c1[_0xa705('0x2f')]=_['intersection'](_0x4f64c1[_0xa705('0x2b')],_0x4f64c1[_0xa705('0x2d')]);_0x3f1f90[_0xa705('0x31')]=_['intersection'](_0x4f64c1[_0xa705('0x2b')],qs[_0xa705('0x32')](_0x239ec3[_0xa705('0x2d')]['fields']));_0x3f1f90[_0xa705('0x31')]=_0x3f1f90['attributes'][_0xa705('0x33')]?_0x3f1f90[_0xa705('0x31')]:_0x4f64c1[_0xa705('0x2b')];if(_0x239ec3['query'][_0xa705('0x3e')]){_0x3f1f90[_0xa705('0x41')]=[{'all':!![]}];}_0x3f1f90=_[_0xa705('0x3a')]({},_0x3f1f90,_0x239ec3[_0xa705('0x42')]);return db[_0xa705('0x28')][_0xa705('0x43')](_0x3f1f90)[_0xa705('0x1e')](handleEntityNotFound(_0x31f564,null))[_0xa705('0x1e')](respondWithResult(_0x31f564,null))['catch'](handleError(_0x31f564,null));};exports[_0xa705('0x44')]=function(_0x26a10b,_0x5494f5){return db[_0xa705('0x28')][_0xa705('0x44')](_0x26a10b['body'],{})[_0xa705('0x1e')](function(_0x51db0c){var _0x4a387a=_0x26a10b[_0xa705('0x45')]['get']({'plain':!![]});if(!_0x4a387a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a387a['role']==='user'){var _0x2faf1e=_0x51db0c[_0xa705('0x1f')]({'plain':!![]});var _0x5e355f=_0xa705('0x46');return db[_0xa705('0x47')]['find']({'where':{'name':_0x5e355f,'userProfileId':_0x4a387a[_0xa705('0x48')]},'raw':!![]})['then'](function(_0x5d6175){if(_0x5d6175&&_0x5d6175[_0xa705('0x49')]===0x0){return db[_0xa705('0x21')][_0xa705('0x44')]({'name':_0x2faf1e[_0xa705('0x25')],'resourceId':_0x2faf1e['id'],'type':_0xa705('0x20'),'sectionId':_0x5d6175['id']},{})['then'](function(){return _0x51db0c;});}else{return _0x51db0c;}})[_0xa705('0x4a')](function(_0x208586){logger[_0xa705('0x4b')](_0xa705('0x4c'),_0x208586);throw _0x208586;});}return _0x51db0c;})[_0xa705('0x1e')](respondWithResult(_0x5494f5,0xc9))[_0xa705('0x4a')](handleError(_0x5494f5,null));};exports[_0xa705('0x1d')]=function(_0x1ce876,_0x4366c3){if(_0x1ce876[_0xa705('0x4d')]['id']){delete _0x1ce876['body']['id'];}return db[_0xa705('0x28')][_0xa705('0x43')]({'where':{'id':_0x1ce876[_0xa705('0x40')]['id']}})['then'](handleEntityNotFound(_0x4366c3,null))[_0xa705('0x1e')](saveUpdates(_0x1ce876[_0xa705('0x4d')],null))['then'](respondWithResult(_0x4366c3,null))[_0xa705('0x4a')](handleError(_0x4366c3,null));};exports[_0xa705('0x22')]=function(_0x2f8caa,_0x49a6ea){return db[_0xa705('0x28')][_0xa705('0x43')]({'where':{'id':_0x2f8caa[_0xa705('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a6ea,null))[_0xa705('0x1e')](removeEntity(_0x49a6ea,null))[_0xa705('0x4a')](handleError(_0x49a6ea,null));};exports['preview']=function(_0x16be85,_0x572192){var _0x105073=0xa;var _0x44a27d=['join','left_join',_0xa705('0x4e'),_0xa705('0x4f')];var _0x22bb92={'SUM':_0xa705('0x50'),'COUNT':_0xa705('0x51'),'COUNT DISTINCT':_0xa705('0x52'),'MAX':'MAX(%s)','MIN':_0xa705('0x53'),'AVG':_0xa705('0x54'),'GROUP_CONCAT':_0xa705('0x55'),'GROUP_CONCAT ASC':_0xa705('0x56'),'GROUP_CONCAT DESC':_0xa705('0x57')};var _0x4a1a5f={'SEC_TO_TIME':_0xa705('0x58'),'DATE':_0xa705('0x59'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa705('0x5a')};var _0x246d05=function(_0x5898b8){return!_[_0xa705('0x5b')]([_0xa705('0x5c'),_0xa705('0x5d'),_0xa705('0x5e'),_0xa705('0x5f')],_0x5898b8);};var _0x49e9da=function(_0x470c7b){if(!_0x470c7b||!_0x470c7b['rules'][_0xa705('0x33')]){return'';}for(var _0x16c65e='(',_0x2facc5=0x0;_0x2facc5<_0x470c7b[_0xa705('0x60')][_0xa705('0x33')];_0x2facc5+=0x1){_0x2facc5>0x0&&(_0x16c65e+='\x20'+_0x470c7b[_0xa705('0x61')]+'\x20');_0x16c65e+=_0x470c7b[_0xa705('0x60')][_0x2facc5][_0xa705('0x62')]?_0x49e9da(_0x470c7b[_0xa705('0x60')][_0x2facc5][_0xa705('0x62')]):_0x470c7b['rules'][_0x2facc5][_0xa705('0x63')]+'\x20'+_0x470c7b['rules'][_0x2facc5]['condition']+(_0x246d05(_0x470c7b[_0xa705('0x60')][_0x2facc5][_0xa705('0x64')])?'\x20'+_0x470c7b['rules'][_0x2facc5][_0xa705('0x65')]:'');}return _0x16c65e+')';};var _0x39f4eb={'where':{'id':_0x16be85[_0xa705('0x40')]['id']}},_0x59dadf,_0x5a2446,_0x5c8b8a,_0x2dd742,_0x1fdd40;_0x39f4eb=_[_0xa705('0x3a')]({},_0x39f4eb,_0x16be85[_0xa705('0x42')]);return db[_0xa705('0x28')][_0xa705('0x43')](_0x39f4eb)[_0xa705('0x1e')](function(_0x2724dd){if(_0x2724dd){_0x59dadf=_0x2724dd;return _0x2724dd['getFields']();}return null;})[_0xa705('0x1e')](function(_0x3ba3ce){if(_0x3ba3ce){if(!_0x3ba3ce['length']){throw new db[(_0xa705('0x66'))][(_0xa705('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5a2446=_0x3ba3ce;return db[_0xa705('0x68')][_0xa705('0x69')]({'raw':!![]});}return null;})[_0xa705('0x1e')](function(_0x2608bf){if(_0x2608bf){_0x5c8b8a=_[_0xa705('0x6a')](_0x2608bf,'id');var _0x330326;var _0x5f1ea4=squel[_0xa705('0x6b')]();_0x5f1ea4[_0xa705('0x6c')](_0x59dadf[_0xa705('0x6d')]);for(var _0x417015=0x0;_0x417015<_0x5a2446[_0xa705('0x33')];_0x417015+=0x1){_0x330326=_0x5a2446[_0x417015][_0xa705('0x6e')]?_0x5c8b8a[_0x5a2446[_0x417015]['MetricId']][_0xa705('0x6f')]:_0x5a2446[_0x417015][_0xa705('0x63')];_0x330326=_0x5a2446[_0x417015][_0xa705('0x70')]?_[_0xa705('0x71')](_0x22bb92[_0x5a2446[_0x417015][_0xa705('0x70')]],'%s',_0x330326):_0x330326;_0x330326=_0x5a2446[_0x417015][_0xa705('0x72')]?_[_0xa705('0x71')](_0x4a1a5f[_0x5a2446[_0x417015][_0xa705('0x72')]],'%s',_0x330326):_0x330326;if(_0x5a2446[_0x417015][_0xa705('0x73')]){_0x5f1ea4['group'](_0x330326);}_0x5a2446[_0x417015][_0xa705('0x74')]&&_0x5f1ea4[_0xa705('0x36')](_0x330326,_0x5a2446[_0x417015][_0xa705('0x74')]===_0xa705('0x75')?![]:!![]);_0x5f1ea4[_0xa705('0x63')](_0x330326,_0x5a2446[_0x417015][_0xa705('0x76')]||_0x330326);}if(_0x59dadf['joins']){_0x59dadf[_0xa705('0x77')]=JSON[_0xa705('0x78')](_0x59dadf[_0xa705('0x77')]);for(var _0x474a63=0x0;_0x474a63<_0x59dadf[_0xa705('0x77')][_0xa705('0x33')];_0x474a63+=0x1){if(_0x59dadf[_0xa705('0x77')][_0x474a63][_0xa705('0x3c')]&&_[_0xa705('0x5b')](_0x44a27d,_0x59dadf[_0xa705('0x77')][_0x474a63]['type'])&&_0x59dadf[_0xa705('0x77')][_0x474a63][_0xa705('0x79')]&&_0x59dadf[_0xa705('0x77')][_0x474a63][_0xa705('0x7a')]&&_0x59dadf[_0xa705('0x77')][_0x474a63]['foreignKey']){_0x5f1ea4[_0x59dadf[_0xa705('0x77')][_0x474a63]['type']](_0x59dadf['joins'][_0x474a63][_0xa705('0x7a')],null,util[_0xa705('0x72')](_0xa705('0x7b'),_0x59dadf[_0xa705('0x6d')],_0x59dadf[_0xa705('0x77')][_0x474a63][_0xa705('0x79')],_0x59dadf[_0xa705('0x77')][_0x474a63][_0xa705('0x7a')],_0x59dadf['joins'][_0x474a63][_0xa705('0x7c')]));}}}if(_0x59dadf[_0xa705('0x7d')]){_0x59dadf[_0xa705('0x7d')]=JSON['parse'](_0x59dadf[_0xa705('0x7d')]);_0x5f1ea4[_0xa705('0x3b')](_0x49e9da(_0x59dadf[_0xa705('0x7d')]['group']));}_0x1fdd40=_0x5f1ea4[_0xa705('0x7e')]();_0x5f1ea4[_0xa705('0x17')](_0x105073);_0x5f1ea4['offset'](0x0);logger[_0xa705('0x7f')](_0xa705('0x80'),_0x5f1ea4[_0xa705('0x81')]());return db[_0xa705('0x82')][_0xa705('0x2d')](_0x5f1ea4[_0xa705('0x81')](),{'type':db[_0xa705('0x82')]['QueryTypes'][_0xa705('0x83')]});}})[_0xa705('0x1e')](respondWithResult(_0x572192,null))['catch'](handleError(_0x572192,null));};function runReport(_0x38edf1,_0x306f6a,_0x5999c0){var _0x51ca6f=_0x306f6a[_0xa705('0x25')];var _0x89f284=0xa;var _0x5aa887=[_0xa705('0x84'),'left_join','right_join',_0xa705('0x4f')];var _0x4be1fa={'SUM':_0xa705('0x50'),'COUNT':_0xa705('0x51'),'COUNT DISTINCT':_0xa705('0x52'),'MAX':'MAX(%s)','MIN':_0xa705('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xa705('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4e74a0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa705('0x59'),'HOUR':_0xa705('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xa705('0x5a')};var _0x51b87b=function(_0x39909b){return!_[_0xa705('0x5b')]([_0xa705('0x5c'),_0xa705('0x5d'),_0xa705('0x5e'),_0xa705('0x5f')],_0x39909b);};var _0x183611=function(_0x3929a7){if(!_0x3929a7||!_0x3929a7[_0xa705('0x60')]['length']){return'';}for(var _0x298588='(',_0x20b753=0x0;_0x20b753<_0x3929a7[_0xa705('0x60')][_0xa705('0x33')];_0x20b753+=0x1){_0x20b753>0x0&&(_0x298588+='\x20'+_0x3929a7[_0xa705('0x61')]+'\x20');_0x298588+=_0x3929a7['rules'][_0x20b753][_0xa705('0x62')]?_0x183611(_0x3929a7['rules'][_0x20b753]['group']):_0x3929a7[_0xa705('0x60')][_0x20b753][_0xa705('0x63')]+'\x20'+_0x3929a7['rules'][_0x20b753][_0xa705('0x64')]+(_0x51b87b(_0x3929a7['rules'][_0x20b753]['condition'])?'\x20'+_0x3929a7['rules'][_0x20b753][_0xa705('0x65')]:'');}return _0x298588+')';};var _0x42736c={'where':{'id':_0x38edf1['id']}},_0x451739,_0x565a58,_0x764e91,_0x21c6ba,_0x4fe699;_0x42736c=_[_0xa705('0x3a')]({},_0x42736c,_0x5999c0);return db[_0xa705('0x28')][_0xa705('0x43')](_0x42736c)[_0xa705('0x1e')](function(_0x47dd49){if(_0x47dd49){_0x451739=_0x47dd49;return _0x47dd49[_0xa705('0x86')]();}return null;})[_0xa705('0x1e')](function(_0x46ae34){if(_0x46ae34){if(!_0x46ae34[_0xa705('0x33')]){throw new db['Sequelize'][(_0xa705('0x67'))](_0xa705('0x87'),0x193);}_0x565a58=_0x46ae34;return db[_0xa705('0x68')][_0xa705('0x69')]({'raw':!![]});}return null;})['then'](function(_0x2e8e98){if(_0x2e8e98){_0x764e91=_[_0xa705('0x6a')](_0x2e8e98,'id');var _0x1f2f2e;var _0xbc33a9=squel[_0xa705('0x6b')]();_0xbc33a9[_0xa705('0x6c')](_0x451739[_0xa705('0x6d')]);for(var _0x4d81b2=0x0;_0x4d81b2<_0x565a58[_0xa705('0x33')];_0x4d81b2+=0x1){_0x1f2f2e=_0x565a58[_0x4d81b2]['MetricId']?_0x764e91[_0x565a58[_0x4d81b2][_0xa705('0x6e')]]['metric']:_0x565a58[_0x4d81b2]['field'];_0x1f2f2e=_0x565a58[_0x4d81b2][_0xa705('0x70')]?_['replace'](_0x4be1fa[_0x565a58[_0x4d81b2][_0xa705('0x70')]],'%s',_0x1f2f2e):_0x1f2f2e;_0x1f2f2e=_0x565a58[_0x4d81b2][_0xa705('0x72')]?_[_0xa705('0x71')](_0x4e74a0[_0x565a58[_0x4d81b2][_0xa705('0x72')]],'%s',_0x1f2f2e):_0x1f2f2e;if(_0x565a58[_0x4d81b2][_0xa705('0x73')]){_0xbc33a9['group'](_0x1f2f2e);}_0x565a58[_0x4d81b2][_0xa705('0x74')]&&_0xbc33a9['order'](_0x1f2f2e,_0x565a58[_0x4d81b2][_0xa705('0x74')]===_0xa705('0x75')?![]:!![]);_0xbc33a9[_0xa705('0x63')](_0x1f2f2e,_0x565a58[_0x4d81b2][_0xa705('0x76')]||_0x1f2f2e);}if(_0x451739[_0xa705('0x77')]){_0x451739[_0xa705('0x77')]=JSON['parse'](_0x451739[_0xa705('0x77')]);for(var _0x183cd2=0x0;_0x183cd2<_0x451739[_0xa705('0x77')]['length'];_0x183cd2+=0x1){if(_0x451739[_0xa705('0x77')][_0x183cd2][_0xa705('0x3c')]&&_[_0xa705('0x5b')](_0x5aa887,_0x451739[_0xa705('0x77')][_0x183cd2][_0xa705('0x3c')])&&_0x451739['joins'][_0x183cd2][_0xa705('0x79')]&&_0x451739['joins'][_0x183cd2]['foreignTable']&&_0x451739[_0xa705('0x77')][_0x183cd2][_0xa705('0x7c')]){_0xbc33a9[_0x451739['joins'][_0x183cd2][_0xa705('0x3c')]](_0x451739['joins'][_0x183cd2][_0xa705('0x7a')],null,util[_0xa705('0x72')](_0xa705('0x7b'),_0x451739[_0xa705('0x6d')],_0x451739[_0xa705('0x77')][_0x183cd2][_0xa705('0x79')],_0x451739[_0xa705('0x77')][_0x183cd2][_0xa705('0x7a')],_0x451739['joins'][_0x183cd2][_0xa705('0x7c')]));}}}if(_0x451739[_0xa705('0x7d')]){_0x451739[_0xa705('0x7d')]=JSON[_0xa705('0x78')](_0x451739[_0xa705('0x7d')]);_0xbc33a9[_0xa705('0x3b')](_0x183611(_0x451739[_0xa705('0x7d')]['group']));}_0x4fe699=_0xbc33a9[_0xa705('0x7e')]();_0xbc33a9['limit'](_0x89f284);_0xbc33a9[_0xa705('0x16')](0x0);logger[_0xa705('0x7f')](_0xa705('0x80'),_0xbc33a9[_0xa705('0x81')]());return db[_0xa705('0x82')][_0xa705('0x2d')](_0xbc33a9[_0xa705('0x81')](),{'type':db[_0xa705('0x82')]['QueryTypes'][_0xa705('0x83')]});}})['then'](function(_0x1f8a21){if(!_0x1f8a21['length']){throw new db['Sequelize'][(_0xa705('0x67'))]('No\x20available\x20data',0xcc);}if(_0x306f6a['output']===_0xa705('0x88')){return null;}var _0x47e830=_[_0xa705('0x3a')](_0x306f6a,{'name':_0x306f6a[_0xa705('0x89')]||_0x306f6a[_0xa705('0x25')]||_0x451739[_0xa705('0x25')],'basename':_0x51ca6f,'savename':util[_0xa705('0x72')]('%s-%s.%s',_0x306f6a[_0xa705('0x25')]||_0x451739[_0xa705('0x25')],require(_0xa705('0x8a'))['generate'](0x4),_0x306f6a[_0xa705('0x8b')]||_0xa705('0x8c')),'reportId':_0x451739['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0xa705('0x44')](_0x47e830,{'raw':!![]});})[_0xa705('0x1e')](function(_0xa2a698){if(_0x451739[_0xa705('0x6d')]==='cdr'){_0x4fe699[_0xa705('0x3b')](_0x451739['table']+_0xa705('0x8d'),_0x306f6a['startDate'],_0x306f6a[_0xa705('0x8e')]);}else{_0x4fe699[_0xa705('0x3b')](_0x451739[_0xa705('0x6d')]+_0xa705('0x8f'),_0x306f6a[_0xa705('0x90')],_0x306f6a['endDate']);}if(_0xa2a698){logger[_0xa705('0x91')](_0xa705('0x92'),_0x4fe699[_0xa705('0x81')]());require('child_process')[_0xa705('0x93')](path[_0xa705('0x84')](__dirname,_0xa705('0x94'),_0xa2a698[_0xa705('0x8b')]),[_0xa2a698['id'],_0x4fe699[_0xa705('0x81')](),path[_0xa705('0x84')](__dirname,_0xa705('0x95'),_0xa2a698[_0xa705('0x96')]),_0x51ca6f]);return _0xa2a698;}else{var _0x9d5e1a=squel[_0xa705('0x6b')]();_0x9d5e1a[_0xa705('0x6c')]('('+_0x4fe699['toString']()+')',_0xa705('0x97'));_0x9d5e1a['field']('COUNT(*)',_0xa705('0x15'));_0x4fe699[_0xa705('0x17')](_0x306f6a['limit']||_0x89f284);_0x4fe699[_0xa705('0x16')](_0x306f6a[_0xa705('0x16')]||0x0);return dbH[_0xa705('0x82')][_0xa705('0x2d')](_0x9d5e1a[_0xa705('0x81')](),{'type':dbH[_0xa705('0x82')][_0xa705('0x98')][_0xa705('0x83')]})[_0xa705('0x1e')](function(_0x329d9f){if(!_0x329d9f['length']){_0x21c6ba=0x0;}else{_0x21c6ba=_0x329d9f[0x0][_0xa705('0x15')]||0x0;}return dbH[_0xa705('0x82')][_0xa705('0x2d')](_0x4fe699[_0xa705('0x81')](),{'type':dbH[_0xa705('0x82')][_0xa705('0x98')][_0xa705('0x83')]});})[_0xa705('0x1e')](function(_0x117a21){return{'rows':_0x117a21||[],'count':_0x21c6ba};});}});}exports['run']=function(_0x408748,_0x5650db){return runReport(_0x408748[_0xa705('0x40')],_0x408748[_0xa705('0x2d')],_0x408748[_0xa705('0x42')])[_0xa705('0x1e')](respondWithResult(_0x5650db,null))['catch'](handleError(_0x5650db,null));};exports[_0xa705('0x99')]=runReport;exports['query']=function(_0x14d1b7,_0x498e8c){var _0x384de4=0xa;var _0x294928=[_0xa705('0x84'),_0xa705('0x9a'),'right_join',_0xa705('0x4f')];var _0x3e896d={'SUM':_0xa705('0x50'),'COUNT':_0xa705('0x51'),'COUNT DISTINCT':_0xa705('0x52'),'MAX':_0xa705('0x9b'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xa705('0x55'),'GROUP_CONCAT ASC':_0xa705('0x56'),'GROUP_CONCAT DESC':_0xa705('0x57')};var _0x264695={'SEC_TO_TIME':_0xa705('0x58'),'DATE':_0xa705('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xa705('0x9c'),'UNIX_TIMESTAMP':_0xa705('0x5a')};var _0x13b342=function(_0x320296){return!_['includes']([_0xa705('0x5c'),_0xa705('0x5d'),_0xa705('0x5e'),_0xa705('0x5f')],_0x320296);};var _0x54cff0=function(_0xaf09e0){if(!_0xaf09e0||!_0xaf09e0[_0xa705('0x60')]['length']){return'';}for(var _0x3a4ed0='(',_0x589118=0x0;_0x589118<_0xaf09e0[_0xa705('0x60')]['length'];_0x589118+=0x1){_0x589118>0x0&&(_0x3a4ed0+='\x20'+_0xaf09e0[_0xa705('0x61')]+'\x20');_0x3a4ed0+=_0xaf09e0[_0xa705('0x60')][_0x589118][_0xa705('0x62')]?_0x54cff0(_0xaf09e0[_0xa705('0x60')][_0x589118][_0xa705('0x62')]):_0xaf09e0['rules'][_0x589118]['field']+'\x20'+_0xaf09e0[_0xa705('0x60')][_0x589118][_0xa705('0x64')]+(_0x13b342(_0xaf09e0['rules'][_0x589118][_0xa705('0x64')])?'\x20'+_0xaf09e0[_0xa705('0x60')][_0x589118][_0xa705('0x65')]:'');}return _0x3a4ed0+')';};var _0x250a92={'where':{'id':_0x14d1b7[_0xa705('0x40')]['id']}},_0xc0d68b,_0x237568,_0x5236b7,_0x1bd2f5,_0x4207ae;_0x250a92=_['merge']({},_0x250a92,_0x14d1b7[_0xa705('0x42')]);return db[_0xa705('0x28')][_0xa705('0x43')](_0x250a92)[_0xa705('0x1e')](function(_0x1cce3b){if(_0x1cce3b){_0xc0d68b=_0x1cce3b;return _0x1cce3b[_0xa705('0x86')]();}return null;})[_0xa705('0x1e')](function(_0x55b346){if(_0x55b346){if(!_0x55b346[_0xa705('0x33')]){throw new db['Sequelize'][(_0xa705('0x67'))](_0xa705('0x87'),0x193);}_0x237568=_0x55b346;return db[_0xa705('0x68')][_0xa705('0x69')]({'raw':!![]});}return null;})[_0xa705('0x1e')](function(_0x5a1bf8){if(_0x5a1bf8){_0x5236b7=_[_0xa705('0x6a')](_0x5a1bf8,'id');var _0x374763;var _0x5808fd=squel[_0xa705('0x6b')]();_0x5808fd[_0xa705('0x6c')](_0xc0d68b['table']);for(var _0x336f36=0x0;_0x336f36<_0x237568[_0xa705('0x33')];_0x336f36+=0x1){_0x374763=_0x237568[_0x336f36][_0xa705('0x6e')]?_0x5236b7[_0x237568[_0x336f36][_0xa705('0x6e')]][_0xa705('0x6f')]:_0x237568[_0x336f36][_0xa705('0x63')];_0x374763=_0x237568[_0x336f36][_0xa705('0x70')]?_[_0xa705('0x71')](_0x3e896d[_0x237568[_0x336f36][_0xa705('0x70')]],'%s',_0x374763):_0x374763;_0x374763=_0x237568[_0x336f36][_0xa705('0x72')]?_[_0xa705('0x71')](_0x264695[_0x237568[_0x336f36]['format']],'%s',_0x374763):_0x374763;if(_0x237568[_0x336f36][_0xa705('0x73')]){_0x5808fd[_0xa705('0x62')](_0x374763);}_0x237568[_0x336f36][_0xa705('0x74')]&&_0x5808fd[_0xa705('0x36')](_0x374763,_0x237568[_0x336f36][_0xa705('0x74')]===_0xa705('0x75')?![]:!![]);_0x5808fd['field'](_0x374763,_0x237568[_0x336f36][_0xa705('0x76')]||_0x374763);}if(_0xc0d68b[_0xa705('0x77')]){_0xc0d68b[_0xa705('0x77')]=JSON[_0xa705('0x78')](_0xc0d68b[_0xa705('0x77')]);for(var _0x53d510=0x0;_0x53d510<_0xc0d68b[_0xa705('0x77')]['length'];_0x53d510+=0x1){if(_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x3c')]&&_[_0xa705('0x5b')](_0x294928,_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x3c')])&&_0xc0d68b[_0xa705('0x77')][_0x53d510]['parentKey']&&_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x7a')]&&_0xc0d68b[_0xa705('0x77')][_0x53d510]['foreignKey']){_0x5808fd[_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x3c')]](_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x7a')],null,util['format'](_0xa705('0x7b'),_0xc0d68b[_0xa705('0x6d')],_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x79')],_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x7a')],_0xc0d68b[_0xa705('0x77')][_0x53d510][_0xa705('0x7c')]));}}}if(_0xc0d68b[_0xa705('0x7d')]){_0xc0d68b[_0xa705('0x7d')]=JSON[_0xa705('0x78')](_0xc0d68b[_0xa705('0x7d')]);_0x5808fd[_0xa705('0x3b')](_0x54cff0(_0xc0d68b[_0xa705('0x7d')][_0xa705('0x62')]));}_0x4207ae=_0x5808fd[_0xa705('0x7e')]();_0x5808fd['limit'](_0x384de4);_0x5808fd[_0xa705('0x16')](0x0);logger[_0xa705('0x7f')](_0xa705('0x80'),_0x5808fd[_0xa705('0x81')]());return db['sequelize']['query'](_0x5808fd[_0xa705('0x81')](),{'type':db[_0xa705('0x82')][_0xa705('0x98')][_0xa705('0x83')]});}})[_0xa705('0x1e')](function(){return{'sql':_0x4207ae[_0xa705('0x81')]()};})[_0xa705('0x1e')](respondWithResult(_0x498e8c,null))[_0xa705('0x4a')](handleError(_0x498e8c,null));}; \ No newline at end of file +var _0xd243=['metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','cross_join','field','Sequelize','AnalyticMetric','from','toString','No\x20available\x20data','fullPath','%s-%s.%s','generate','output','default','AnalyticExtractedReport','cdr','startDate','endDate','Run\x20Query:','child_process','fork','../../components/export/','countTable','run','runReport','GROUP_CONCAT(%s)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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)','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','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','MetricId'];(function(_0x4bedce,_0x265ebf){var _0x4fd2fb=function(_0x14122b){while(--_0x14122b){_0x4bedce['push'](_0x4bedce['shift']());}};_0x4fd2fb(++_0x265ebf);}(_0xd243,0x181));var _0x3d24=function(_0x336de3,_0x1e2e3b){_0x336de3=_0x336de3-0x0;var _0x4ede5b=_0xd243[_0x336de3];return _0x4ede5b;};'use strict';var pdf=require(_0x3d24('0x0'));var emlformat=require(_0x3d24('0x1'));var rimraf=require(_0x3d24('0x2'));var zipdir=require(_0x3d24('0x3'));var jsonpatch=require(_0x3d24('0x4'));var rp=require(_0x3d24('0x5'));var moment=require(_0x3d24('0x6'));var BPromise=require(_0x3d24('0x7'));var Mustache=require(_0x3d24('0x8'));var util=require('util');var path=require(_0x3d24('0x9'));var sox=require(_0x3d24('0xa'));var csv=require(_0x3d24('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3d24('0xc'));var squel=require(_0x3d24('0xd'));var crypto=require(_0x3d24('0xe'));var jsforce=require(_0x3d24('0xf'));var deskjs=require(_0x3d24('0x10'));var toCsv=require(_0x3d24('0xb'));var querystring=require(_0x3d24('0x11'));var Papa=require(_0x3d24('0x12'));var Redis=require(_0x3d24('0x13'));var authService=require(_0x3d24('0x14'));var qs=require(_0x3d24('0x15'));var as=require(_0x3d24('0x16'));var hardwareService=require(_0x3d24('0x17'));var logger=require('../../config/logger')(_0x3d24('0x18'));var utils=require(_0x3d24('0x19'));var config=require(_0x3d24('0x1a'));var db=require(_0x3d24('0x1b'))['db'];var dbH=require(_0x3d24('0x1b'))[_0x3d24('0x1c')];function respondWithStatusCode(_0x9d6d35,_0x3195b0){_0x3195b0=_0x3195b0||0xcc;return function(_0x134862){if(_0x134862){return _0x9d6d35[_0x3d24('0x1d')](_0x3195b0);}return _0x9d6d35[_0x3d24('0x1e')](_0x3195b0)[_0x3d24('0x1f')]();};}function respondWithResult(_0x4109a0,_0x4390fb){_0x4390fb=_0x4390fb||0xc8;return function(_0x426d70){if(_0x426d70){return _0x4109a0[_0x3d24('0x1e')](_0x4390fb)['json'](_0x426d70);}};}function respondWithFilteredResult(_0x36530f,_0xaed5ee){return function(_0x910264){if(_0x910264){var _0x336004=_0x910264[_0x3d24('0x20')],_0x442163=_0xaed5ee[_0x3d24('0x21')],_0x2f6695=_0xaed5ee[_0x3d24('0x21')]+_0xaed5ee['limit'],_0x1e1c0c;if(_0x2f6695>=_0x336004){_0x2f6695=_0x336004;_0x1e1c0c=0xc8;}else{_0x1e1c0c=0xce;}_0x36530f[_0x3d24('0x1e')](_0x1e1c0c);return _0x36530f[_0x3d24('0x22')](_0x3d24('0x23'),_0x442163+'-'+_0x2f6695+'/'+_0x336004)[_0x3d24('0x24')](_0x910264);}return null;};}function patchUpdates(_0x103431){return function(_0x293362){try{jsonpatch[_0x3d24('0x25')](_0x293362,_0x103431,!![]);}catch(_0xc0fe8a){return BPromise[_0x3d24('0x26')](_0xc0fe8a);}return _0x293362[_0x3d24('0x27')]();};}function saveUpdates(_0x81a1d6,_0x257ea8){return function(_0x21770b){if(_0x21770b){return _0x21770b['update'](_0x81a1d6)[_0x3d24('0x28')](function(_0x23fe5d){return _0x23fe5d;});}return null;};}function removeEntity(_0x30165b,_0xa805f0){return function(_0x2d9f62){if(_0x2d9f62){return _0x2d9f62['destroy']()[_0x3d24('0x28')](function(){var _0x23d3f5=_0x2d9f62[_0x3d24('0x29')]({'plain':!![]});var _0x240276=_0x3d24('0x2a');return db[_0x3d24('0x2b')][_0x3d24('0x2c')]({'where':{'type':_0x240276,'resourceId':_0x23d3f5['id']}})[_0x3d24('0x28')](function(){return _0x2d9f62;});})[_0x3d24('0x28')](function(){_0x30165b[_0x3d24('0x1e')](0xcc)[_0x3d24('0x1f')]();});}};}function handleEntityNotFound(_0x526fd4,_0x4d0de4){return function(_0x433646){if(!_0x433646){_0x526fd4[_0x3d24('0x1d')](0x194);}return _0x433646;};}function handleError(_0x3c74a1,_0x28416a){_0x28416a=_0x28416a||0x1f4;return function(_0x5f215d){logger[_0x3d24('0x2d')](_0x5f215d[_0x3d24('0x2e')]);if(_0x5f215d[_0x3d24('0x2f')]){delete _0x5f215d['name'];}_0x3c74a1[_0x3d24('0x1e')](_0x28416a)[_0x3d24('0x30')](_0x5f215d);};}exports['index']=function(_0x571feb,_0x3cec53){var _0x5b4929={},_0x10d863={},_0x4bc0c1={'count':0x0,'rows':[]};var _0x1322b7=_[_0x3d24('0x31')](db[_0x3d24('0x32')][_0x3d24('0x33')],function(_0x1257f2){return{'name':_0x1257f2[_0x3d24('0x34')],'type':_0x1257f2['type'][_0x3d24('0x35')]};});_0x10d863[_0x3d24('0x36')]=_['map'](_0x1322b7,_0x3d24('0x2f'));_0x10d863[_0x3d24('0x37')]=_[_0x3d24('0x38')](_0x571feb[_0x3d24('0x37')]);_0x10d863['filters']=_[_0x3d24('0x39')](_0x10d863[_0x3d24('0x36')],_0x10d863['query']);_0x5b4929[_0x3d24('0x3a')]=_['intersection'](_0x10d863[_0x3d24('0x36')],qs['fields'](_0x571feb[_0x3d24('0x37')]['fields']));_0x5b4929[_0x3d24('0x3a')]=_0x5b4929[_0x3d24('0x3a')]['length']?_0x5b4929['attributes']:_0x10d863[_0x3d24('0x36')];if(!_0x571feb[_0x3d24('0x37')][_0x3d24('0x3b')](_0x3d24('0x3c'))){_0x5b4929[_0x3d24('0x3d')]=qs[_0x3d24('0x3d')](_0x571feb['query'][_0x3d24('0x3d')]);_0x5b4929['offset']=qs['offset'](_0x571feb[_0x3d24('0x37')][_0x3d24('0x21')]);}_0x5b4929[_0x3d24('0x3e')]=qs[_0x3d24('0x3f')](_0x571feb[_0x3d24('0x37')][_0x3d24('0x3f')]);_0x5b4929[_0x3d24('0x40')]=qs[_0x3d24('0x41')](_['pick'](_0x571feb[_0x3d24('0x37')],_0x10d863[_0x3d24('0x41')]),_0x1322b7);if(_0x571feb['query'][_0x3d24('0x42')]){_0x5b4929[_0x3d24('0x40')]=_['merge'](_0x5b4929[_0x3d24('0x40')],{'$or':_[_0x3d24('0x31')](_0x1322b7,function(_0x4be7b1){if(_0x4be7b1[_0x3d24('0x43')]!==_0x3d24('0x44')){var _0x5ce267={};_0x5ce267[_0x4be7b1['name']]={'$like':'%'+_0x571feb[_0x3d24('0x37')][_0x3d24('0x42')]+'%'};return _0x5ce267;}})});}_0x5b4929=_[_0x3d24('0x45')]({},_0x5b4929,_0x571feb[_0x3d24('0x46')]);var _0x409394={'where':_0x5b4929[_0x3d24('0x40')]};return db['AnalyticDefaultReport'][_0x3d24('0x20')](_0x409394)['then'](function(_0x3f7ed9){_0x4bc0c1[_0x3d24('0x20')]=_0x3f7ed9;if(_0x571feb[_0x3d24('0x37')]['includeAll']){_0x5b4929[_0x3d24('0x47')]=[{'all':!![]}];}return db[_0x3d24('0x32')][_0x3d24('0x48')](_0x5b4929);})[_0x3d24('0x28')](function(_0x1a532b){_0x4bc0c1[_0x3d24('0x49')]=_0x1a532b;return _0x4bc0c1;})[_0x3d24('0x28')](respondWithFilteredResult(_0x3cec53,_0x5b4929))[_0x3d24('0x4a')](handleError(_0x3cec53,null));};exports[_0x3d24('0x4b')]=function(_0x31560a,_0x4dcece){var _0x17c0f0={'raw':!![],'where':{'id':_0x31560a[_0x3d24('0x4c')]['id']}},_0x1eedfb={};_0x1eedfb[_0x3d24('0x36')]=_[_0x3d24('0x38')](db[_0x3d24('0x32')][_0x3d24('0x33')]);_0x1eedfb['query']=_['keys'](_0x31560a[_0x3d24('0x37')]);_0x1eedfb[_0x3d24('0x41')]=_['intersection'](_0x1eedfb['model'],_0x1eedfb[_0x3d24('0x37')]);_0x17c0f0[_0x3d24('0x3a')]=_['intersection'](_0x1eedfb[_0x3d24('0x36')],qs['fields'](_0x31560a[_0x3d24('0x37')]['fields']));_0x17c0f0[_0x3d24('0x3a')]=_0x17c0f0[_0x3d24('0x3a')][_0x3d24('0x4d')]?_0x17c0f0['attributes']:_0x1eedfb[_0x3d24('0x36')];if(_0x31560a[_0x3d24('0x37')][_0x3d24('0x4e')]){_0x17c0f0['include']=[{'all':!![]}];}_0x17c0f0=_['merge']({},_0x17c0f0,_0x31560a[_0x3d24('0x46')]);return db[_0x3d24('0x32')][_0x3d24('0x4f')](_0x17c0f0)[_0x3d24('0x28')](handleEntityNotFound(_0x4dcece,null))[_0x3d24('0x28')](respondWithResult(_0x4dcece,null))['catch'](handleError(_0x4dcece,null));};exports[_0x3d24('0x50')]=function(_0x4d6d2b,_0x29bbd8){return db[_0x3d24('0x32')][_0x3d24('0x50')](_0x4d6d2b[_0x3d24('0x51')],{})[_0x3d24('0x28')](function(_0x35964b){var _0x45b3f7=_0x4d6d2b[_0x3d24('0x52')][_0x3d24('0x29')]({'plain':!![]});if(!_0x45b3f7)throw new Error(_0x3d24('0x53'));if(_0x45b3f7[_0x3d24('0x54')]===_0x3d24('0x52')){var _0xe478ea=_0x35964b[_0x3d24('0x29')]({'plain':!![]});var _0x3b42f8=_0x3d24('0x55');return db['UserProfileSection'][_0x3d24('0x4f')]({'where':{'name':_0x3b42f8,'userProfileId':_0x45b3f7[_0x3d24('0x56')]},'raw':!![]})[_0x3d24('0x28')](function(_0x280877){if(_0x280877&&_0x280877[_0x3d24('0x57')]===0x0){return db[_0x3d24('0x2b')][_0x3d24('0x50')]({'name':_0xe478ea['name'],'resourceId':_0xe478ea['id'],'type':'DefaultReports','sectionId':_0x280877['id']},{})['then'](function(){return _0x35964b;});}else{return _0x35964b;}})[_0x3d24('0x4a')](function(_0x203f46){logger[_0x3d24('0x2d')](_0x3d24('0x58'),_0x203f46);throw _0x203f46;});}return _0x35964b;})[_0x3d24('0x28')](respondWithResult(_0x29bbd8,0xc9))[_0x3d24('0x4a')](handleError(_0x29bbd8,null));};exports[_0x3d24('0x59')]=function(_0xaa002,_0x50572f){if(_0xaa002[_0x3d24('0x51')]['id']){delete _0xaa002[_0x3d24('0x51')]['id'];}return db[_0x3d24('0x32')]['find']({'where':{'id':_0xaa002['params']['id']}})[_0x3d24('0x28')](handleEntityNotFound(_0x50572f,null))['then'](saveUpdates(_0xaa002[_0x3d24('0x51')],null))[_0x3d24('0x28')](respondWithResult(_0x50572f,null))[_0x3d24('0x4a')](handleError(_0x50572f,null));};exports[_0x3d24('0x2c')]=function(_0x1217a9,_0x589a50){return db['AnalyticDefaultReport'][_0x3d24('0x4f')]({'where':{'id':_0x1217a9[_0x3d24('0x4c')]['id']}})[_0x3d24('0x28')](handleEntityNotFound(_0x589a50,null))['then'](removeEntity(_0x589a50,null))[_0x3d24('0x4a')](handleError(_0x589a50,null));};exports[_0x3d24('0x5a')]=function(_0x228b7b,_0x4d40e6){var _0x368e8c=0xa;var _0x3f8e3c=[_0x3d24('0x5b'),'left_join',_0x3d24('0x5c'),'cross_join'];var _0x3353c8={'SUM':_0x3d24('0x5d'),'COUNT':_0x3d24('0x5e'),'COUNT DISTINCT':_0x3d24('0x5f'),'MAX':_0x3d24('0x60'),'MIN':_0x3d24('0x61'),'AVG':_0x3d24('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3d24('0x63'),'GROUP_CONCAT DESC':_0x3d24('0x64')};var _0x5bb59a={'SEC_TO_TIME':_0x3d24('0x65'),'DATE':_0x3d24('0x66'),'HOUR':_0x3d24('0x67'),'ROUND':_0x3d24('0x68'),'UNIX_TIMESTAMP':_0x3d24('0x69')};var _0x4429c1=function(_0x4146a0){return!_[_0x3d24('0x6a')]([_0x3d24('0x6b'),_0x3d24('0x6c'),_0x3d24('0x6d'),_0x3d24('0x6e')],_0x4146a0);};var _0x3c6c5c=function(_0x21b763){if(!_0x21b763||!_0x21b763[_0x3d24('0x6f')]['length']){return'';}for(var _0x4a3d44='(',_0x13c16e=0x0;_0x13c16e<_0x21b763[_0x3d24('0x6f')][_0x3d24('0x4d')];_0x13c16e+=0x1){_0x13c16e>0x0&&(_0x4a3d44+='\x20'+_0x21b763[_0x3d24('0x70')]+'\x20');_0x4a3d44+=_0x21b763[_0x3d24('0x6f')][_0x13c16e][_0x3d24('0x71')]?_0x3c6c5c(_0x21b763[_0x3d24('0x6f')][_0x13c16e][_0x3d24('0x71')]):_0x21b763['rules'][_0x13c16e]['field']+'\x20'+_0x21b763[_0x3d24('0x6f')][_0x13c16e][_0x3d24('0x72')]+(_0x4429c1(_0x21b763['rules'][_0x13c16e][_0x3d24('0x72')])?'\x20'+_0x21b763[_0x3d24('0x6f')][_0x13c16e][_0x3d24('0x73')]:'');}return _0x4a3d44+')';};var _0x2fda59={'where':{'id':_0x228b7b[_0x3d24('0x4c')]['id']}},_0xa1aa47,_0x43f5e6,_0x3ea9f9,_0x3c4682,_0x402ad4;_0x2fda59=_[_0x3d24('0x45')]({},_0x2fda59,_0x228b7b[_0x3d24('0x46')]);return db[_0x3d24('0x32')]['find'](_0x2fda59)[_0x3d24('0x28')](function(_0x451942){if(_0x451942){_0xa1aa47=_0x451942;return _0x451942[_0x3d24('0x74')]();}return null;})['then'](function(_0x1cd93d){if(_0x1cd93d){if(!_0x1cd93d[_0x3d24('0x4d')]){throw new db['Sequelize'][(_0x3d24('0x75'))](_0x3d24('0x76'),0x193);}_0x43f5e6=_0x1cd93d;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x3d24('0x28')](function(_0x138de3){if(_0x138de3){_0x3ea9f9=_[_0x3d24('0x77')](_0x138de3,'id');var _0x2279ec;var _0x3eae46=squel[_0x3d24('0x78')]();_0x3eae46['from'](_0xa1aa47['table']);for(var _0x33a3d3=0x0;_0x33a3d3<_0x43f5e6[_0x3d24('0x4d')];_0x33a3d3+=0x1){_0x2279ec=_0x43f5e6[_0x33a3d3][_0x3d24('0x79')]?_0x3ea9f9[_0x43f5e6[_0x33a3d3][_0x3d24('0x79')]][_0x3d24('0x7a')]:_0x43f5e6[_0x33a3d3]['field'];_0x2279ec=_0x43f5e6[_0x33a3d3][_0x3d24('0x7b')]?_[_0x3d24('0x7c')](_0x3353c8[_0x43f5e6[_0x33a3d3][_0x3d24('0x7b')]],'%s',_0x2279ec):_0x2279ec;_0x2279ec=_0x43f5e6[_0x33a3d3][_0x3d24('0x7d')]?_['replace'](_0x5bb59a[_0x43f5e6[_0x33a3d3]['format']],'%s',_0x2279ec):_0x2279ec;if(_0x43f5e6[_0x33a3d3][_0x3d24('0x7e')]){_0x3eae46[_0x3d24('0x71')](_0x2279ec);}_0x43f5e6[_0x33a3d3][_0x3d24('0x7f')]&&_0x3eae46['order'](_0x2279ec,_0x43f5e6[_0x33a3d3]['orderBy']===_0x3d24('0x80')?![]:!![]);_0x3eae46['field'](_0x2279ec,_0x43f5e6[_0x33a3d3][_0x3d24('0x81')]||_0x2279ec);}if(_0xa1aa47[_0x3d24('0x82')]){_0xa1aa47[_0x3d24('0x82')]=JSON[_0x3d24('0x83')](_0xa1aa47[_0x3d24('0x82')]);for(var _0x29bbbe=0x0;_0x29bbbe<_0xa1aa47[_0x3d24('0x82')][_0x3d24('0x4d')];_0x29bbbe+=0x1){if(_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x43')]&&_[_0x3d24('0x6a')](_0x3f8e3c,_0xa1aa47['joins'][_0x29bbbe][_0x3d24('0x43')])&&_0xa1aa47['joins'][_0x29bbbe][_0x3d24('0x84')]&&_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x85')]&&_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x86')]){_0x3eae46[_0xa1aa47['joins'][_0x29bbbe]['type']](_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x85')],null,util[_0x3d24('0x7d')](_0x3d24('0x87'),_0xa1aa47[_0x3d24('0x88')],_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x84')],_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x85')],_0xa1aa47[_0x3d24('0x82')][_0x29bbbe][_0x3d24('0x86')]));}}}if(_0xa1aa47[_0x3d24('0x89')]){_0xa1aa47['conditions']=JSON[_0x3d24('0x83')](_0xa1aa47['conditions']);_0x3eae46[_0x3d24('0x40')](_0x3c6c5c(_0xa1aa47['conditions'][_0x3d24('0x71')]));}_0x402ad4=_0x3eae46[_0x3d24('0x8a')]();_0x3eae46['limit'](_0x368e8c);_0x3eae46['offset'](0x0);logger[_0x3d24('0x8b')](_0x3d24('0x8c'),_0x3eae46['toString']());return db[_0x3d24('0x8d')]['query'](_0x3eae46['toString'](),{'type':db[_0x3d24('0x8d')][_0x3d24('0x8e')][_0x3d24('0x8f')]});}})[_0x3d24('0x28')](respondWithResult(_0x4d40e6,null))['catch'](handleError(_0x4d40e6,null));};function runReport(_0x209146,_0x2fe25d,_0x5c2f26){var _0x442407=_0x2fe25d[_0x3d24('0x2f')];var _0x1dd3fc=0xa;var _0x2a4bc1=[_0x3d24('0x5b'),_0x3d24('0x90'),_0x3d24('0x5c'),_0x3d24('0x91')];var _0xaba4df={'SUM':_0x3d24('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3d24('0x5f'),'MAX':_0x3d24('0x60'),'MIN':_0x3d24('0x61'),'AVG':_0x3d24('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x3d24('0x63'),'GROUP_CONCAT DESC':_0x3d24('0x64')};var _0x198294={'SEC_TO_TIME':_0x3d24('0x65'),'DATE':'DATE(%s)','HOUR':_0x3d24('0x67'),'ROUND':_0x3d24('0x68'),'UNIX_TIMESTAMP':_0x3d24('0x69')};var _0x47ea88=function(_0x388066){return!_['includes']([_0x3d24('0x6b'),_0x3d24('0x6c'),_0x3d24('0x6d'),'IS\x20NOT\x20EMPTY'],_0x388066);};var _0x46bb01=function(_0x129322){if(!_0x129322||!_0x129322['rules'][_0x3d24('0x4d')]){return'';}for(var _0x506123='(',_0x1cf420=0x0;_0x1cf420<_0x129322[_0x3d24('0x6f')][_0x3d24('0x4d')];_0x1cf420+=0x1){_0x1cf420>0x0&&(_0x506123+='\x20'+_0x129322[_0x3d24('0x70')]+'\x20');_0x506123+=_0x129322[_0x3d24('0x6f')][_0x1cf420][_0x3d24('0x71')]?_0x46bb01(_0x129322[_0x3d24('0x6f')][_0x1cf420]['group']):_0x129322[_0x3d24('0x6f')][_0x1cf420][_0x3d24('0x92')]+'\x20'+_0x129322[_0x3d24('0x6f')][_0x1cf420][_0x3d24('0x72')]+(_0x47ea88(_0x129322['rules'][_0x1cf420][_0x3d24('0x72')])?'\x20'+_0x129322[_0x3d24('0x6f')][_0x1cf420][_0x3d24('0x73')]:'');}return _0x506123+')';};var _0x3616f9={'where':{'id':_0x209146['id']}},_0x50bffc,_0x2dba88,_0x298f93,_0x395983,_0x40ebdd;_0x3616f9=_['merge']({},_0x3616f9,_0x5c2f26);return db[_0x3d24('0x32')][_0x3d24('0x4f')](_0x3616f9)['then'](function(_0x3c5dda){if(_0x3c5dda){_0x50bffc=_0x3c5dda;return _0x3c5dda[_0x3d24('0x74')]();}return null;})[_0x3d24('0x28')](function(_0x318f76){if(_0x318f76){if(!_0x318f76[_0x3d24('0x4d')]){throw new db[(_0x3d24('0x93'))][(_0x3d24('0x75'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2dba88=_0x318f76;return db[_0x3d24('0x94')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x364fd0){if(_0x364fd0){_0x298f93=_[_0x3d24('0x77')](_0x364fd0,'id');var _0x282de8;var _0xf681fa=squel[_0x3d24('0x78')]();_0xf681fa[_0x3d24('0x95')](_0x50bffc[_0x3d24('0x88')]);for(var _0x3d1678=0x0;_0x3d1678<_0x2dba88['length'];_0x3d1678+=0x1){_0x282de8=_0x2dba88[_0x3d1678][_0x3d24('0x79')]?_0x298f93[_0x2dba88[_0x3d1678][_0x3d24('0x79')]][_0x3d24('0x7a')]:_0x2dba88[_0x3d1678]['field'];_0x282de8=_0x2dba88[_0x3d1678][_0x3d24('0x7b')]?_[_0x3d24('0x7c')](_0xaba4df[_0x2dba88[_0x3d1678][_0x3d24('0x7b')]],'%s',_0x282de8):_0x282de8;_0x282de8=_0x2dba88[_0x3d1678]['format']?_[_0x3d24('0x7c')](_0x198294[_0x2dba88[_0x3d1678][_0x3d24('0x7d')]],'%s',_0x282de8):_0x282de8;if(_0x2dba88[_0x3d1678][_0x3d24('0x7e')]){_0xf681fa[_0x3d24('0x71')](_0x282de8);}_0x2dba88[_0x3d1678][_0x3d24('0x7f')]&&_0xf681fa[_0x3d24('0x3e')](_0x282de8,_0x2dba88[_0x3d1678][_0x3d24('0x7f')]===_0x3d24('0x80')?![]:!![]);_0xf681fa[_0x3d24('0x92')](_0x282de8,_0x2dba88[_0x3d1678][_0x3d24('0x81')]||_0x282de8);}if(_0x50bffc['joins']){_0x50bffc[_0x3d24('0x82')]=JSON[_0x3d24('0x83')](_0x50bffc[_0x3d24('0x82')]);for(var _0x25c348=0x0;_0x25c348<_0x50bffc[_0x3d24('0x82')][_0x3d24('0x4d')];_0x25c348+=0x1){if(_0x50bffc[_0x3d24('0x82')][_0x25c348][_0x3d24('0x43')]&&_[_0x3d24('0x6a')](_0x2a4bc1,_0x50bffc[_0x3d24('0x82')][_0x25c348][_0x3d24('0x43')])&&_0x50bffc[_0x3d24('0x82')][_0x25c348][_0x3d24('0x84')]&&_0x50bffc[_0x3d24('0x82')][_0x25c348]['foreignTable']&&_0x50bffc[_0x3d24('0x82')][_0x25c348]['foreignKey']){_0xf681fa[_0x50bffc['joins'][_0x25c348]['type']](_0x50bffc[_0x3d24('0x82')][_0x25c348]['foreignTable'],null,util['format'](_0x3d24('0x87'),_0x50bffc['table'],_0x50bffc[_0x3d24('0x82')][_0x25c348][_0x3d24('0x84')],_0x50bffc['joins'][_0x25c348]['foreignTable'],_0x50bffc[_0x3d24('0x82')][_0x25c348][_0x3d24('0x86')]));}}}if(_0x50bffc[_0x3d24('0x89')]){_0x50bffc[_0x3d24('0x89')]=JSON[_0x3d24('0x83')](_0x50bffc[_0x3d24('0x89')]);_0xf681fa[_0x3d24('0x40')](_0x46bb01(_0x50bffc[_0x3d24('0x89')][_0x3d24('0x71')]));}_0x40ebdd=_0xf681fa[_0x3d24('0x8a')]();_0xf681fa[_0x3d24('0x3d')](_0x1dd3fc);_0xf681fa[_0x3d24('0x21')](0x0);logger[_0x3d24('0x8b')](_0x3d24('0x8c'),_0xf681fa[_0x3d24('0x96')]());return db[_0x3d24('0x8d')][_0x3d24('0x37')](_0xf681fa[_0x3d24('0x96')](),{'type':db[_0x3d24('0x8d')][_0x3d24('0x8e')]['SELECT']});}})[_0x3d24('0x28')](function(_0x338a3f){if(!_0x338a3f['length']){throw new db[(_0x3d24('0x93'))][(_0x3d24('0x75'))](_0x3d24('0x97'),0xcc);}if(_0x2fe25d['output']==='web'){return null;}var _0x8aaa2=_[_0x3d24('0x45')](_0x2fe25d,{'name':_0x2fe25d[_0x3d24('0x98')]||_0x2fe25d[_0x3d24('0x2f')]||_0x50bffc[_0x3d24('0x2f')],'basename':_0x442407,'savename':util[_0x3d24('0x7d')](_0x3d24('0x99'),_0x2fe25d['name']||_0x50bffc[_0x3d24('0x2f')],require('randomstring')[_0x3d24('0x9a')](0x4),_0x2fe25d[_0x3d24('0x9b')]||'csv'),'reportId':_0x50bffc['id'],'reportType':_0x3d24('0x9c')});return db[_0x3d24('0x9d')][_0x3d24('0x50')](_0x8aaa2,{'raw':!![]});})[_0x3d24('0x28')](function(_0x18e618){if(_0x50bffc[_0x3d24('0x88')]===_0x3d24('0x9e')){_0x40ebdd[_0x3d24('0x40')](_0x50bffc[_0x3d24('0x88')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2fe25d[_0x3d24('0x9f')],_0x2fe25d[_0x3d24('0xa0')]);}else{_0x40ebdd[_0x3d24('0x40')](_0x50bffc['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2fe25d[_0x3d24('0x9f')],_0x2fe25d[_0x3d24('0xa0')]);}if(_0x18e618){logger['info'](_0x3d24('0xa1'),_0x40ebdd[_0x3d24('0x96')]());require(_0x3d24('0xa2'))[_0x3d24('0xa3')](path['join'](__dirname,_0x3d24('0xa4'),_0x18e618[_0x3d24('0x9b')]),[_0x18e618['id'],_0x40ebdd[_0x3d24('0x96')](),path['join'](__dirname,'../../files/reports',_0x18e618['savename']),_0x442407]);return _0x18e618;}else{var _0x1cb658=squel['select']();_0x1cb658[_0x3d24('0x95')]('('+_0x40ebdd[_0x3d24('0x96')]()+')',_0x3d24('0xa5'));_0x1cb658[_0x3d24('0x92')]('COUNT(*)',_0x3d24('0x20'));_0x40ebdd[_0x3d24('0x3d')](_0x2fe25d[_0x3d24('0x3d')]||_0x1dd3fc);_0x40ebdd['offset'](_0x2fe25d[_0x3d24('0x21')]||0x0);return dbH[_0x3d24('0x8d')][_0x3d24('0x37')](_0x1cb658[_0x3d24('0x96')](),{'type':dbH[_0x3d24('0x8d')][_0x3d24('0x8e')]['SELECT']})[_0x3d24('0x28')](function(_0x59e711){if(!_0x59e711['length']){_0x395983=0x0;}else{_0x395983=_0x59e711[0x0][_0x3d24('0x20')]||0x0;}return dbH[_0x3d24('0x8d')]['query'](_0x40ebdd[_0x3d24('0x96')](),{'type':dbH[_0x3d24('0x8d')]['QueryTypes'][_0x3d24('0x8f')]});})[_0x3d24('0x28')](function(_0x363992){return{'rows':_0x363992||[],'count':_0x395983};});}});}exports[_0x3d24('0xa6')]=function(_0x3e9f5f,_0x2a4a4){return runReport(_0x3e9f5f['params'],_0x3e9f5f[_0x3d24('0x37')],_0x3e9f5f[_0x3d24('0x46')])[_0x3d24('0x28')](respondWithResult(_0x2a4a4,null))[_0x3d24('0x4a')](handleError(_0x2a4a4,null));};exports[_0x3d24('0xa7')]=runReport;exports[_0x3d24('0x37')]=function(_0x558461,_0x4a492a){var _0x5d6bd2=0xa;var _0x1236ec=[_0x3d24('0x5b'),'left_join',_0x3d24('0x5c'),_0x3d24('0x91')];var _0x5a949f={'SUM':_0x3d24('0x5d'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3d24('0x5f'),'MAX':_0x3d24('0x60'),'MIN':_0x3d24('0x61'),'AVG':_0x3d24('0x62'),'GROUP_CONCAT':_0x3d24('0xa8'),'GROUP_CONCAT ASC':_0x3d24('0x63'),'GROUP_CONCAT DESC':_0x3d24('0x64')};var _0xc46a80={'SEC_TO_TIME':_0x3d24('0x65'),'DATE':_0x3d24('0x66'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x3d24('0x69')};var _0x3a9567=function(_0x53b88c){return!_['includes']([_0x3d24('0x6b'),_0x3d24('0x6c'),_0x3d24('0x6d'),_0x3d24('0x6e')],_0x53b88c);};var _0x981faa=function(_0x15d965){if(!_0x15d965||!_0x15d965[_0x3d24('0x6f')][_0x3d24('0x4d')]){return'';}for(var _0x14d493='(',_0x20cd76=0x0;_0x20cd76<_0x15d965[_0x3d24('0x6f')]['length'];_0x20cd76+=0x1){_0x20cd76>0x0&&(_0x14d493+='\x20'+_0x15d965['operator']+'\x20');_0x14d493+=_0x15d965['rules'][_0x20cd76][_0x3d24('0x71')]?_0x981faa(_0x15d965['rules'][_0x20cd76][_0x3d24('0x71')]):_0x15d965[_0x3d24('0x6f')][_0x20cd76][_0x3d24('0x92')]+'\x20'+_0x15d965[_0x3d24('0x6f')][_0x20cd76][_0x3d24('0x72')]+(_0x3a9567(_0x15d965[_0x3d24('0x6f')][_0x20cd76][_0x3d24('0x72')])?'\x20'+_0x15d965[_0x3d24('0x6f')][_0x20cd76][_0x3d24('0x73')]:'');}return _0x14d493+')';};var _0xf2ba7f={'where':{'id':_0x558461[_0x3d24('0x4c')]['id']}},_0x424c8a,_0x17d1ac,_0x1646e8,_0x4b5994,_0x58df5f;_0xf2ba7f=_['merge']({},_0xf2ba7f,_0x558461[_0x3d24('0x46')]);return db[_0x3d24('0x32')][_0x3d24('0x4f')](_0xf2ba7f)[_0x3d24('0x28')](function(_0x5c57c2){if(_0x5c57c2){_0x424c8a=_0x5c57c2;return _0x5c57c2[_0x3d24('0x74')]();}return null;})[_0x3d24('0x28')](function(_0x4ac601){if(_0x4ac601){if(!_0x4ac601[_0x3d24('0x4d')]){throw new db['Sequelize'][(_0x3d24('0x75'))](_0x3d24('0x76'),0x193);}_0x17d1ac=_0x4ac601;return db[_0x3d24('0x94')][_0x3d24('0x48')]({'raw':!![]});}return null;})['then'](function(_0x54c599){if(_0x54c599){_0x1646e8=_[_0x3d24('0x77')](_0x54c599,'id');var _0x42a28e;var _0x4d9729=squel[_0x3d24('0x78')]();_0x4d9729[_0x3d24('0x95')](_0x424c8a[_0x3d24('0x88')]);for(var _0x224445=0x0;_0x224445<_0x17d1ac[_0x3d24('0x4d')];_0x224445+=0x1){_0x42a28e=_0x17d1ac[_0x224445][_0x3d24('0x79')]?_0x1646e8[_0x17d1ac[_0x224445][_0x3d24('0x79')]][_0x3d24('0x7a')]:_0x17d1ac[_0x224445]['field'];_0x42a28e=_0x17d1ac[_0x224445][_0x3d24('0x7b')]?_[_0x3d24('0x7c')](_0x5a949f[_0x17d1ac[_0x224445][_0x3d24('0x7b')]],'%s',_0x42a28e):_0x42a28e;_0x42a28e=_0x17d1ac[_0x224445]['format']?_[_0x3d24('0x7c')](_0xc46a80[_0x17d1ac[_0x224445][_0x3d24('0x7d')]],'%s',_0x42a28e):_0x42a28e;if(_0x17d1ac[_0x224445]['groupBy']){_0x4d9729[_0x3d24('0x71')](_0x42a28e);}_0x17d1ac[_0x224445][_0x3d24('0x7f')]&&_0x4d9729[_0x3d24('0x3e')](_0x42a28e,_0x17d1ac[_0x224445][_0x3d24('0x7f')]===_0x3d24('0x80')?![]:!![]);_0x4d9729[_0x3d24('0x92')](_0x42a28e,_0x17d1ac[_0x224445][_0x3d24('0x81')]||_0x42a28e);}if(_0x424c8a['joins']){_0x424c8a[_0x3d24('0x82')]=JSON[_0x3d24('0x83')](_0x424c8a[_0x3d24('0x82')]);for(var _0x28e213=0x0;_0x28e213<_0x424c8a[_0x3d24('0x82')][_0x3d24('0x4d')];_0x28e213+=0x1){if(_0x424c8a['joins'][_0x28e213][_0x3d24('0x43')]&&_[_0x3d24('0x6a')](_0x1236ec,_0x424c8a['joins'][_0x28e213]['type'])&&_0x424c8a[_0x3d24('0x82')][_0x28e213]['parentKey']&&_0x424c8a[_0x3d24('0x82')][_0x28e213][_0x3d24('0x85')]&&_0x424c8a[_0x3d24('0x82')][_0x28e213]['foreignKey']){_0x4d9729[_0x424c8a[_0x3d24('0x82')][_0x28e213][_0x3d24('0x43')]](_0x424c8a[_0x3d24('0x82')][_0x28e213]['foreignTable'],null,util[_0x3d24('0x7d')]('%s.%s\x20=\x20%s.%s',_0x424c8a[_0x3d24('0x88')],_0x424c8a[_0x3d24('0x82')][_0x28e213][_0x3d24('0x84')],_0x424c8a['joins'][_0x28e213][_0x3d24('0x85')],_0x424c8a[_0x3d24('0x82')][_0x28e213][_0x3d24('0x86')]));}}}if(_0x424c8a['conditions']){_0x424c8a[_0x3d24('0x89')]=JSON[_0x3d24('0x83')](_0x424c8a[_0x3d24('0x89')]);_0x4d9729[_0x3d24('0x40')](_0x981faa(_0x424c8a[_0x3d24('0x89')][_0x3d24('0x71')]));}_0x58df5f=_0x4d9729['clone']();_0x4d9729['limit'](_0x5d6bd2);_0x4d9729[_0x3d24('0x21')](0x0);logger[_0x3d24('0x8b')](_0x3d24('0x8c'),_0x4d9729[_0x3d24('0x96')]());return db[_0x3d24('0x8d')][_0x3d24('0x37')](_0x4d9729[_0x3d24('0x96')](),{'type':db[_0x3d24('0x8d')][_0x3d24('0x8e')][_0x3d24('0x8f')]});}})[_0x3d24('0x28')](function(){return{'sql':_0x58df5f[_0x3d24('0x96')]()};})[_0x3d24('0x28')](respondWithResult(_0x4a492a,null))[_0x3d24('0x4a')](handleError(_0x4a492a,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 1308331..ebf4ed0 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 _0x1967=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0x1967,0x173));var _0x7196=function(_0x402fc4,_0x2f1c2a){_0x402fc4=_0x402fc4-0x0;var _0x24fade=_0x1967[_0x402fc4];return _0x24fade;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ca=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x2b39e6,_0x36fdfe){var _0x5c83ac=function(_0x4bc2ed){while(--_0x4bc2ed){_0x2b39e6['push'](_0x2b39e6['shift']());}};_0x5c83ac(++_0x36fdfe);}(_0x57ca,0x108));var _0xa57c=function(_0x19a4aa,_0x2e2822){_0x19a4aa=_0x19a4aa-0x0;var _0x38f792=_0x57ca[_0x19a4aa];return _0x38f792;};'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/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 6f9b009..7dcdbb8 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 _0x96cc=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis'];(function(_0xfa959f,_0xcedc31){var _0x3151e5=function(_0x3d2a08){while(--_0x3d2a08){_0xfa959f['push'](_0xfa959f['shift']());}};_0x3151e5(++_0xcedc31);}(_0x96cc,0x16c));var _0xc96c=function(_0x2f6af4,_0x2875fc){_0x2f6af4=_0x2f6af4-0x0;var _0xa5f3be=_0x96cc[_0x2f6af4];return _0xa5f3be;};'use strict';var _=require(_0xc96c('0x0'));var util=require('util');var moment=require(_0xc96c('0x1'));var BPromise=require('bluebird');var rs=require(_0xc96c('0x2'));var fs=require('fs');var Redis=require(_0xc96c('0x3'));var db=require(_0xc96c('0x4'))['db'];var utils=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var config=require(_0xc96c('0x8'));var jayson=require(_0xc96c('0x9'));var client=jayson[_0xc96c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10b411,_0x18eb9c,_0x408afb){return new BPromise(function(_0x86c1a8,_0x13363d){return client[_0xc96c('0xb')](_0x10b411,_0x408afb)[_0xc96c('0xc')](function(_0x54e765){logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));logger['debug'](_0xc96c('0x10'),_0x18eb9c,'request\x20sent',JSON[_0xc96c('0x11')](_0x54e765));if(_0x54e765['error']){if(_0x54e765[_0xc96c('0x12')][_0xc96c('0x13')]===0x1f4){logger[_0xc96c('0x12')](_0xc96c('0xe'),_0x18eb9c,_0x54e765['error'][_0xc96c('0x14')]);return _0x13363d(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}logger[_0xc96c('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x18eb9c,_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);return _0x86c1a8(_0x54e765[_0xc96c('0x12')][_0xc96c('0x14')]);}else{logger[_0xc96c('0xd')](_0xc96c('0xe'),_0x18eb9c,_0xc96c('0xf'));_0x86c1a8(_0x54e765[_0xc96c('0x15')][_0xc96c('0x14')]);}})[_0xc96c('0x16')](function(_0x861230){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x18eb9c,_0x861230);_0x13363d(_0x861230);});});} \ No newline at end of file +var _0x777d=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x5c9c22,_0x1d5ad6){var _0x309c0a=function(_0x389ac1){while(--_0x389ac1){_0x5c9c22['push'](_0x5c9c22['shift']());}};_0x309c0a(++_0x1d5ad6);}(_0x777d,0xe9));var _0xd777=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x777d[_0xf71120];return _0xbe2fd3;};'use strict';var _=require('lodash');var util=require(_0xd777('0x0'));var moment=require(_0xd777('0x1'));var BPromise=require(_0xd777('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd777('0x3'));var db=require(_0xd777('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd777('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xd777('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc7c954,_0x5d1a5f,_0x57d67f){return new BPromise(function(_0x49d55d,_0x197296){return client[_0xd777('0x7')](_0xc7c954,_0x57d67f)[_0xd777('0x8')](function(_0x25450d){logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));logger[_0xd777('0xc')](_0xd777('0xd'),_0x5d1a5f,_0xd777('0xb'),JSON[_0xd777('0xe')](_0x25450d));if(_0x25450d[_0xd777('0xf')]){if(_0x25450d[_0xd777('0xf')]['code']===0x1f4){logger['error'](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x197296(_0x25450d[_0xd777('0xf')][_0xd777('0x10')]);}logger[_0xd777('0xf')](_0xd777('0xa'),_0x5d1a5f,_0x25450d['error'][_0xd777('0x10')]);return _0x49d55d(_0x25450d['error'][_0xd777('0x10')]);}else{logger[_0xd777('0x9')](_0xd777('0xa'),_0x5d1a5f,_0xd777('0xb'));_0x49d55d(_0x25450d[_0xd777('0x11')]['message']);}})[_0xd777('0x12')](function(_0x4b3d52){logger[_0xd777('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x5d1a5f,_0x4b3d52);_0x197296(_0x4b3d52);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 706209e..9eab287 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 _0x5f83=['./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','query','create','put','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2dfc6a,_0x3f5c18){var _0x11229e=function(_0x2758c2){while(--_0x2758c2){_0x2dfc6a['push'](_0x2dfc6a['shift']());}};_0x11229e(++_0x3f5c18);}(_0x5f83,0xeb));var _0x35f8=function(_0x41b21a,_0x4255e9){_0x41b21a=_0x41b21a-0x0;var _0x346898=_0x5f83[_0x41b21a];return _0x346898;};'use strict';var multer=require(_0x35f8('0x0'));var util=require('util');var path=require(_0x35f8('0x1'));var timeout=require(_0x35f8('0x2'));var express=require('express');var router=express[_0x35f8('0x3')]();var auth=require(_0x35f8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x35f8('0x5'));router[_0x35f8('0x6')]('/',auth[_0x35f8('0x7')](),controller[_0x35f8('0x8')]);router['get'](_0x35f8('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x35f8('0xa'),auth[_0x35f8('0x7')](),controller[_0x35f8('0xb')]);router['get']('/:id/run',auth[_0x35f8('0x7')](),controller[_0x35f8('0xc')]);router['get'](_0x35f8('0xd'),auth[_0x35f8('0x7')](),controller[_0x35f8('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x35f8('0xf')]);router[_0x35f8('0x10')]('/:id',auth[_0x35f8('0x7')](),controller[_0x35f8('0x11')]);router[_0x35f8('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x35f8('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6a17=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run','query','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x25caec,_0x225163){var _0x386db0=function(_0x4d3acf){while(--_0x4d3acf){_0x25caec['push'](_0x25caec['shift']());}};_0x386db0(++_0x225163);}(_0x6a17,0x1aa));var _0x76a1=function(_0x50bfba,_0x1cbced){_0x50bfba=_0x50bfba-0x0;var _0x26eff2=_0x6a17[_0x50bfba];return _0x26eff2;};'use strict';var multer=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var path=require(_0x76a1('0x2'));var timeout=require(_0x76a1('0x3'));var express=require(_0x76a1('0x4'));var router=express[_0x76a1('0x5')]();var auth=require(_0x76a1('0x6'));var interaction=require(_0x76a1('0x7'));var config=require(_0x76a1('0x8'));var controller=require(_0x76a1('0x9'));router['get']('/',auth[_0x76a1('0xa')](),controller[_0x76a1('0xb')]);router[_0x76a1('0xc')](_0x76a1('0xd'),auth[_0x76a1('0xa')](),controller[_0x76a1('0xe')]);router['get'](_0x76a1('0xf'),auth[_0x76a1('0xa')](),controller[_0x76a1('0x10')]);router['get']('/:id/run',auth['isAuthenticated'](),controller[_0x76a1('0x11')]);router[_0x76a1('0xc')]('/:id/query',auth[_0x76a1('0xa')](),controller[_0x76a1('0x12')]);router[_0x76a1('0x13')]('/',auth[_0x76a1('0xa')](),controller[_0x76a1('0x14')]);router[_0x76a1('0x15')](_0x76a1('0xd'),auth['isAuthenticated'](),controller[_0x76a1('0x16')]);router['delete'](_0x76a1('0xd'),auth['isAuthenticated'](),controller[_0x76a1('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index dc33cd8..62f779a 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 _0x83b6=['scheduled','UNSIGNED','sequelize','moment','STRING','ENUM','xlsx','csv','DATE','manual'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x83b6,0x1ba));var _0x683b=function(_0x3d6989,_0x3bac20){_0x3d6989=_0x3d6989-0x0;var _0x150ae7=_0x83b6[_0x3d6989];return _0x150ae7;};'use strict';var Sequelize=require(_0x683b('0x0'));var moment=require(_0x683b('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x683b('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x683b('0x3')]('csv','pdf',_0x683b('0x4')),'allowNull':![],'defaultValue':_0x683b('0x5')},'savename':{'type':Sequelize[_0x683b('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x683b('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x683b('0x3')](_0x683b('0x7'),_0x683b('0x8')),'allowNull':![],'defaultValue':_0x683b('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x683b('0x9')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcf00=['STRING','csv','pdf','DATE','Loading','ENUM','manual','INTEGER','UNSIGNED'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0xcf00,0xcf));var _0x0cf0=function(_0x5013f2,_0x3d896b){_0x5013f2=_0x5013f2-0x0;var _0x166b9f=_0xcf00[_0x5013f2];return _0x166b9f;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x0cf0('0x0')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x0cf0('0x1'),_0x0cf0('0x2'),'xlsx'),'allowNull':![],'defaultValue':_0x0cf0('0x1')},'savename':{'type':Sequelize[_0x0cf0('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0cf0('0x3')]},'endDate':{'type':Sequelize[_0x0cf0('0x3')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x0cf0('0x4')},'type':{'type':Sequelize[_0x0cf0('0x5')](_0x0cf0('0x6'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x0cf0('0x7')](0xb)[_0x0cf0('0x8')]},'reportType':{'type':Sequelize[_0x0cf0('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 276b9ec..d04bf73 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 _0x5327=['reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','index','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','include','catch','show','rawAttributes','intersection','length','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','download','basename','savename','output','join','server/files/reports','Sequelize','ValidationError','exists','root','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range'];(function(_0x3c1676,_0x2ede5e){var _0x48fc10=function(_0x204c74){while(--_0x204c74){_0x3c1676['push'](_0x3c1676['shift']());}};_0x48fc10(++_0x2ede5e);}(_0x5327,0xea));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x7532('0x0'));var emlformat=require(_0x7532('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7532('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7532('0x3'));var moment=require(_0x7532('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7532('0x5'));var util=require(_0x7532('0x6'));var path=require(_0x7532('0x7'));var sox=require(_0x7532('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7532('0x9'));var squel=require('squel');var crypto=require(_0x7532('0xa'));var jsforce=require(_0x7532('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7532('0xc'));var querystring=require(_0x7532('0xd'));var Papa=require(_0x7532('0xe'));var Redis=require(_0x7532('0xf'));var authService=require(_0x7532('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7532('0x11'));var hardwareService=require(_0x7532('0x12'));var logger=require(_0x7532('0x13'))(_0x7532('0x14'));var utils=require('../../config/utils');var config=require(_0x7532('0x15'));var db=require(_0x7532('0x16'))['db'];function respondWithStatusCode(_0xec4338,_0x8675b3){_0x8675b3=_0x8675b3||0xcc;return function(_0x584955){if(_0x584955){return _0xec4338[_0x7532('0x17')](_0x8675b3);}return _0xec4338[_0x7532('0x18')](_0x8675b3)[_0x7532('0x19')]();};}function respondWithResult(_0x5c590d,_0x198f79){_0x198f79=_0x198f79||0xc8;return function(_0x104824){if(_0x104824){return _0x5c590d[_0x7532('0x18')](_0x198f79)[_0x7532('0x1a')](_0x104824);}};}function respondWithFilteredResult(_0x2e874d,_0x189746){return function(_0xa1a243){if(_0xa1a243){var _0x4b0a02=_0xa1a243[_0x7532('0x1b')],_0x226a31=_0x189746[_0x7532('0x1c')],_0x5807c3=_0x189746[_0x7532('0x1c')]+_0x189746['limit'],_0x1ec9dd;if(_0x5807c3>=_0x4b0a02){_0x5807c3=_0x4b0a02;_0x1ec9dd=0xc8;}else{_0x1ec9dd=0xce;}_0x2e874d[_0x7532('0x18')](_0x1ec9dd);return _0x2e874d['set'](_0x7532('0x1d'),_0x226a31+'-'+_0x5807c3+'/'+_0x4b0a02)['json'](_0xa1a243);}return null;};}function patchUpdates(_0x11b53b){return function(_0x13c11e){try{jsonpatch['apply'](_0x13c11e,_0x11b53b,!![]);}catch(_0x14030d){return BPromise[_0x7532('0x1e')](_0x14030d);}return _0x13c11e[_0x7532('0x1f')]();};}function saveUpdates(_0x12d612,_0x37258f){return function(_0x53a916){if(_0x53a916){return _0x53a916[_0x7532('0x20')](_0x12d612)[_0x7532('0x21')](function(_0x4ced9e){return _0x4ced9e;});}return null;};}function removeEntity(_0x27c9df,_0x31433d){return function(_0x3c2932){if(_0x3c2932){return _0x3c2932[_0x7532('0x22')]()[_0x7532('0x21')](function(){var _0x5b14f1=_0x3c2932[_0x7532('0x23')]({'plain':!![]});var _0x4dd9c9=_0x7532('0x24');return db[_0x7532('0x25')]['destroy']({'where':{'type':_0x4dd9c9,'resourceId':_0x5b14f1['id']}})['then'](function(){return _0x3c2932;});})[_0x7532('0x21')](function(){_0x27c9df[_0x7532('0x18')](0xcc)[_0x7532('0x19')]();});}};}function handleEntityNotFound(_0xea2b4a,_0x5d82b8){return function(_0x1c17e4){if(!_0x1c17e4){_0xea2b4a[_0x7532('0x17')](0x194);}return _0x1c17e4;};}function handleError(_0x2d9043,_0x28521a){_0x28521a=_0x28521a||0x1f4;return function(_0x3883eb){logger[_0x7532('0x26')](_0x3883eb['stack']);if(_0x3883eb[_0x7532('0x27')]){delete _0x3883eb[_0x7532('0x27')];}_0x2d9043['status'](_0x28521a)['send'](_0x3883eb);};}exports[_0x7532('0x28')]=function(_0x4214f5,_0x54b3d0){var _0x1cc70d={},_0x5f28de={},_0x1d3b2b={'count':0x0,'rows':[]};var _0x9fdb1d=_[_0x7532('0x29')](db[_0x7532('0x2a')]['rawAttributes'],function(_0x27666e){return{'name':_0x27666e[_0x7532('0x2b')],'type':_0x27666e[_0x7532('0x2c')][_0x7532('0x2d')]};});_0x5f28de[_0x7532('0x2e')]=_[_0x7532('0x29')](_0x9fdb1d,'name');_0x5f28de[_0x7532('0x2f')]=_[_0x7532('0x30')](_0x4214f5[_0x7532('0x2f')]);_0x5f28de[_0x7532('0x31')]=_['intersection'](_0x5f28de['model'],_0x5f28de[_0x7532('0x2f')]);_0x1cc70d[_0x7532('0x32')]=_['intersection'](_0x5f28de[_0x7532('0x2e')],qs[_0x7532('0x33')](_0x4214f5[_0x7532('0x2f')]['fields']));_0x1cc70d[_0x7532('0x32')]=_0x1cc70d[_0x7532('0x32')]['length']?_0x1cc70d[_0x7532('0x32')]:_0x5f28de['model'];if(!_0x4214f5[_0x7532('0x2f')][_0x7532('0x34')](_0x7532('0x35'))){_0x1cc70d[_0x7532('0x36')]=qs[_0x7532('0x36')](_0x4214f5['query'][_0x7532('0x36')]);_0x1cc70d[_0x7532('0x1c')]=qs[_0x7532('0x1c')](_0x4214f5[_0x7532('0x2f')][_0x7532('0x1c')]);}_0x1cc70d['order']=qs[_0x7532('0x37')](_0x4214f5[_0x7532('0x2f')][_0x7532('0x37')]);_0x1cc70d[_0x7532('0x38')]=qs[_0x7532('0x31')](_['pick'](_0x4214f5['query'],_0x5f28de['filters']),_0x9fdb1d);if(_0x4214f5[_0x7532('0x2f')][_0x7532('0x39')]){_0x1cc70d['where']=_[_0x7532('0x3a')](_0x1cc70d[_0x7532('0x38')],{'$or':_[_0x7532('0x29')](_0x9fdb1d,function(_0x20d0d2){if(_0x20d0d2[_0x7532('0x2c')]!==_0x7532('0x3b')){var _0x2968cd={};_0x2968cd[_0x20d0d2['name']]={'$like':'%'+_0x4214f5[_0x7532('0x2f')][_0x7532('0x39')]+'%'};return _0x2968cd;}})});}_0x1cc70d=_[_0x7532('0x3a')]({},_0x1cc70d,_0x4214f5['options']);var _0xfba0f3={'where':_0x1cc70d[_0x7532('0x38')]};return db[_0x7532('0x2a')][_0x7532('0x1b')](_0xfba0f3)[_0x7532('0x21')](function(_0x37ef6f){_0x1d3b2b[_0x7532('0x1b')]=_0x37ef6f;if(_0x4214f5[_0x7532('0x2f')][_0x7532('0x3c')]){_0x1cc70d[_0x7532('0x3d')]=[{'all':!![]}];}return db[_0x7532('0x2a')]['findAll'](_0x1cc70d);})[_0x7532('0x21')](function(_0x15f009){_0x1d3b2b['rows']=_0x15f009;return _0x1d3b2b;})[_0x7532('0x21')](respondWithFilteredResult(_0x54b3d0,_0x1cc70d))[_0x7532('0x3e')](handleError(_0x54b3d0,null));};exports[_0x7532('0x3f')]=function(_0x4a12e4,_0x11a0c8){var _0x238e38={'raw':!![],'where':{'id':_0x4a12e4['params']['id']}},_0x9a76d0={};_0x9a76d0['model']=_[_0x7532('0x30')](db[_0x7532('0x2a')][_0x7532('0x40')]);_0x9a76d0[_0x7532('0x2f')]=_[_0x7532('0x30')](_0x4a12e4[_0x7532('0x2f')]);_0x9a76d0[_0x7532('0x31')]=_[_0x7532('0x41')](_0x9a76d0[_0x7532('0x2e')],_0x9a76d0[_0x7532('0x2f')]);_0x238e38[_0x7532('0x32')]=_[_0x7532('0x41')](_0x9a76d0[_0x7532('0x2e')],qs[_0x7532('0x33')](_0x4a12e4[_0x7532('0x2f')][_0x7532('0x33')]));_0x238e38['attributes']=_0x238e38[_0x7532('0x32')][_0x7532('0x42')]?_0x238e38[_0x7532('0x32')]:_0x9a76d0[_0x7532('0x2e')];if(_0x4a12e4[_0x7532('0x2f')][_0x7532('0x3c')]){_0x238e38[_0x7532('0x3d')]=[{'all':!![]}];}_0x238e38=_[_0x7532('0x3a')]({},_0x238e38,_0x4a12e4[_0x7532('0x43')]);return db[_0x7532('0x2a')]['find'](_0x238e38)[_0x7532('0x21')](handleEntityNotFound(_0x11a0c8,null))[_0x7532('0x21')](respondWithResult(_0x11a0c8,null))[_0x7532('0x3e')](handleError(_0x11a0c8,null));};exports[_0x7532('0x44')]=function(_0x40dd98,_0x30ab02){return db[_0x7532('0x2a')][_0x7532('0x44')](_0x40dd98['body'],{})[_0x7532('0x21')](function(_0x334af1){var _0x3c906f=_0x40dd98[_0x7532('0x45')][_0x7532('0x23')]({'plain':!![]});if(!_0x3c906f)throw new Error(_0x7532('0x46'));if(_0x3c906f[_0x7532('0x47')]==='user'){var _0x2212eb=_0x334af1[_0x7532('0x23')]({'plain':!![]});var _0xcc46de=_0x7532('0x24');return db[_0x7532('0x48')][_0x7532('0x49')]({'where':{'name':_0xcc46de,'userProfileId':_0x3c906f['userProfileId']},'raw':!![]})[_0x7532('0x21')](function(_0x405f85){if(_0x405f85&&_0x405f85[_0x7532('0x4a')]===0x0){return db[_0x7532('0x25')][_0x7532('0x44')]({'name':_0x2212eb[_0x7532('0x27')],'resourceId':_0x2212eb['id'],'type':_0x405f85[_0x7532('0x27')],'sectionId':_0x405f85['id']},{})[_0x7532('0x21')](function(){return _0x334af1;});}else{return _0x334af1;}})[_0x7532('0x3e')](function(_0x187c44){logger[_0x7532('0x26')](_0x7532('0x4b'),_0x187c44);throw _0x187c44;});}return _0x334af1;})[_0x7532('0x21')](respondWithResult(_0x30ab02,0xc9))[_0x7532('0x3e')](handleError(_0x30ab02,null));};exports['update']=function(_0x2e577f,_0x17fd89){if(_0x2e577f['body']['id']){delete _0x2e577f[_0x7532('0x4c')]['id'];}return db[_0x7532('0x2a')]['find']({'where':{'id':_0x2e577f[_0x7532('0x4d')]['id']}})[_0x7532('0x21')](handleEntityNotFound(_0x17fd89,null))[_0x7532('0x21')](saveUpdates(_0x2e577f[_0x7532('0x4c')],null))[_0x7532('0x21')](respondWithResult(_0x17fd89,null))[_0x7532('0x3e')](handleError(_0x17fd89,null));};exports[_0x7532('0x22')]=function(_0x1d6e22,_0x28311e){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1d6e22[_0x7532('0x4d')]['id']}})[_0x7532('0x21')](handleEntityNotFound(_0x28311e,null))['then'](removeEntity(_0x28311e,null))[_0x7532('0x3e')](handleError(_0x28311e,null));};exports[_0x7532('0x4e')]=function(_0x54ffe8,_0x49d5d0,_0x24795f){return db[_0x7532('0x2a')]['find']({'where':{'id':_0x54ffe8[_0x7532('0x4d')]['id']},'attributes':[_0x7532('0x27'),_0x7532('0x4f'),_0x7532('0x50'),_0x7532('0x51')],'raw':!![]})[_0x7532('0x21')](handleEntityNotFound(_0x49d5d0,null))[_0x7532('0x21')](function(_0x4d50fd){if(_0x4d50fd){if(!fs['existsSync'](path[_0x7532('0x52')](config['root'],_0x7532('0x53'),_0x4d50fd[_0x7532('0x50')]))){throw new db[(_0x7532('0x54'))][(_0x7532('0x55'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x54ffe8[_0x7532('0x2f')][_0x7532('0x56')]){return _0x49d5d0[_0x7532('0x17')](0xc8);}return _0x49d5d0[_0x7532('0x4e')](path[_0x7532('0x52')](config[_0x7532('0x57')],_0x7532('0x53'),_0x4d50fd[_0x7532('0x50')]),util['format']('%s.%s',_0x4d50fd[_0x7532('0x4f')]||_0x4d50fd[_0x7532('0x27')],_0x4d50fd[_0x7532('0x51')]['toLowerCase']()));}})['catch'](handleError(_0x49d5d0,null));}; \ No newline at end of file +var _0x3ef4=['get','ExtractedReports','UserProfileResource','end','error','name','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy'];(function(_0x1449de,_0x151e8b){var _0x390c3b=function(_0x39e018){while(--_0x39e018){_0x1449de['push'](_0x1449de['shift']());}};_0x390c3b(++_0x151e8b);}(_0x3ef4,0x1a8));var _0x43ef=function(_0x2c654f,_0x11ce94){_0x2c654f=_0x2c654f-0x0;var _0xa53d15=_0x3ef4[_0x2c654f];return _0xa53d15;};'use strict';var pdf=require(_0x43ef('0x0'));var emlformat=require(_0x43ef('0x1'));var rimraf=require(_0x43ef('0x2'));var zipdir=require(_0x43ef('0x3'));var jsonpatch=require(_0x43ef('0x4'));var rp=require('request-promise');var moment=require(_0x43ef('0x5'));var BPromise=require(_0x43ef('0x6'));var Mustache=require('mustache');var util=require(_0x43ef('0x7'));var path=require(_0x43ef('0x8'));var sox=require('sox');var csv=require(_0x43ef('0x9'));var ejs=require(_0x43ef('0xa'));var fs=require('fs');var _=require(_0x43ef('0xb'));var squel=require(_0x43ef('0xc'));var crypto=require(_0x43ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x43ef('0xe'));var toCsv=require('to-csv');var querystring=require(_0x43ef('0xf'));var Papa=require(_0x43ef('0x10'));var Redis=require(_0x43ef('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x43ef('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x43ef('0x13'));var logger=require(_0x43ef('0x14'))(_0x43ef('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x43ef('0x16'))['db'];function respondWithStatusCode(_0x571fd5,_0x5054a2){_0x5054a2=_0x5054a2||0xcc;return function(_0x175ccc){if(_0x175ccc){return _0x571fd5[_0x43ef('0x17')](_0x5054a2);}return _0x571fd5[_0x43ef('0x18')](_0x5054a2)['end']();};}function respondWithResult(_0x32e6b7,_0x219970){_0x219970=_0x219970||0xc8;return function(_0x2fb69e){if(_0x2fb69e){return _0x32e6b7[_0x43ef('0x18')](_0x219970)[_0x43ef('0x19')](_0x2fb69e);}};}function respondWithFilteredResult(_0x55bb44,_0xa7b21f){return function(_0x12b37b){if(_0x12b37b){var _0x55a05d=_0x12b37b[_0x43ef('0x1a')],_0x442d90=_0xa7b21f['offset'],_0x4b57e6=_0xa7b21f[_0x43ef('0x1b')]+_0xa7b21f[_0x43ef('0x1c')],_0x5bd790;if(_0x4b57e6>=_0x55a05d){_0x4b57e6=_0x55a05d;_0x5bd790=0xc8;}else{_0x5bd790=0xce;}_0x55bb44[_0x43ef('0x18')](_0x5bd790);return _0x55bb44[_0x43ef('0x1d')](_0x43ef('0x1e'),_0x442d90+'-'+_0x4b57e6+'/'+_0x55a05d)[_0x43ef('0x19')](_0x12b37b);}return null;};}function patchUpdates(_0x50c183){return function(_0x17f574){try{jsonpatch[_0x43ef('0x1f')](_0x17f574,_0x50c183,!![]);}catch(_0xe2e9c5){return BPromise['reject'](_0xe2e9c5);}return _0x17f574[_0x43ef('0x20')]();};}function saveUpdates(_0x5e83d4,_0x38f4bf){return function(_0x58fce1){if(_0x58fce1){return _0x58fce1[_0x43ef('0x21')](_0x5e83d4)[_0x43ef('0x22')](function(_0x1e3d96){return _0x1e3d96;});}return null;};}function removeEntity(_0x4e6570,_0x76b53){return function(_0x5e30b5){if(_0x5e30b5){return _0x5e30b5[_0x43ef('0x23')]()[_0x43ef('0x22')](function(){var _0x20165e=_0x5e30b5[_0x43ef('0x24')]({'plain':!![]});var _0x4c6275=_0x43ef('0x25');return db[_0x43ef('0x26')]['destroy']({'where':{'type':_0x4c6275,'resourceId':_0x20165e['id']}})[_0x43ef('0x22')](function(){return _0x5e30b5;});})[_0x43ef('0x22')](function(){_0x4e6570[_0x43ef('0x18')](0xcc)[_0x43ef('0x27')]();});}};}function handleEntityNotFound(_0x26e8d2,_0x1dabeb){return function(_0xb3ed0c){if(!_0xb3ed0c){_0x26e8d2[_0x43ef('0x17')](0x194);}return _0xb3ed0c;};}function handleError(_0x41d1e5,_0x199503){_0x199503=_0x199503||0x1f4;return function(_0x5dd001){logger[_0x43ef('0x28')](_0x5dd001['stack']);if(_0x5dd001['name']){delete _0x5dd001[_0x43ef('0x29')];}_0x41d1e5['status'](_0x199503)['send'](_0x5dd001);};}exports['index']=function(_0x13eea8,_0x2aa531){var _0x23e01d={},_0x34e71e={},_0x35bb72={'count':0x0,'rows':[]};var _0x3b3501=_[_0x43ef('0x2a')](db[_0x43ef('0x2b')]['rawAttributes'],function(_0x9890d5){return{'name':_0x9890d5[_0x43ef('0x2c')],'type':_0x9890d5[_0x43ef('0x2d')][_0x43ef('0x2e')]};});_0x34e71e[_0x43ef('0x2f')]=_[_0x43ef('0x2a')](_0x3b3501,'name');_0x34e71e[_0x43ef('0x30')]=_[_0x43ef('0x31')](_0x13eea8[_0x43ef('0x30')]);_0x34e71e[_0x43ef('0x32')]=_['intersection'](_0x34e71e[_0x43ef('0x2f')],_0x34e71e['query']);_0x23e01d[_0x43ef('0x33')]=_[_0x43ef('0x34')](_0x34e71e[_0x43ef('0x2f')],qs[_0x43ef('0x35')](_0x13eea8[_0x43ef('0x30')]['fields']));_0x23e01d[_0x43ef('0x33')]=_0x23e01d[_0x43ef('0x33')][_0x43ef('0x36')]?_0x23e01d[_0x43ef('0x33')]:_0x34e71e[_0x43ef('0x2f')];if(!_0x13eea8['query'][_0x43ef('0x37')](_0x43ef('0x38'))){_0x23e01d[_0x43ef('0x1c')]=qs[_0x43ef('0x1c')](_0x13eea8['query']['limit']);_0x23e01d[_0x43ef('0x1b')]=qs['offset'](_0x13eea8[_0x43ef('0x30')][_0x43ef('0x1b')]);}_0x23e01d[_0x43ef('0x39')]=qs['sort'](_0x13eea8[_0x43ef('0x30')][_0x43ef('0x3a')]);_0x23e01d[_0x43ef('0x3b')]=qs[_0x43ef('0x32')](_['pick'](_0x13eea8[_0x43ef('0x30')],_0x34e71e[_0x43ef('0x32')]),_0x3b3501);if(_0x13eea8[_0x43ef('0x30')][_0x43ef('0x3c')]){_0x23e01d['where']=_[_0x43ef('0x3d')](_0x23e01d[_0x43ef('0x3b')],{'$or':_[_0x43ef('0x2a')](_0x3b3501,function(_0x4120f8){if(_0x4120f8[_0x43ef('0x2d')]!=='VIRTUAL'){var _0x57c07d={};_0x57c07d[_0x4120f8[_0x43ef('0x29')]]={'$like':'%'+_0x13eea8[_0x43ef('0x30')][_0x43ef('0x3c')]+'%'};return _0x57c07d;}})});}_0x23e01d=_['merge']({},_0x23e01d,_0x13eea8['options']);var _0xd9fc0e={'where':_0x23e01d[_0x43ef('0x3b')]};return db['AnalyticExtractedReport']['count'](_0xd9fc0e)[_0x43ef('0x22')](function(_0x53ede5){_0x35bb72[_0x43ef('0x1a')]=_0x53ede5;if(_0x13eea8[_0x43ef('0x30')][_0x43ef('0x3e')]){_0x23e01d['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x43ef('0x3f')](_0x23e01d);})[_0x43ef('0x22')](function(_0x24db38){_0x35bb72[_0x43ef('0x40')]=_0x24db38;return _0x35bb72;})[_0x43ef('0x22')](respondWithFilteredResult(_0x2aa531,_0x23e01d))['catch'](handleError(_0x2aa531,null));};exports[_0x43ef('0x41')]=function(_0xfc3874,_0x4e2940){var _0x305ae0={'raw':!![],'where':{'id':_0xfc3874[_0x43ef('0x42')]['id']}},_0x920b9a={};_0x920b9a[_0x43ef('0x2f')]=_[_0x43ef('0x31')](db[_0x43ef('0x2b')][_0x43ef('0x43')]);_0x920b9a[_0x43ef('0x30')]=_['keys'](_0xfc3874[_0x43ef('0x30')]);_0x920b9a[_0x43ef('0x32')]=_[_0x43ef('0x34')](_0x920b9a[_0x43ef('0x2f')],_0x920b9a['query']);_0x305ae0[_0x43ef('0x33')]=_[_0x43ef('0x34')](_0x920b9a[_0x43ef('0x2f')],qs[_0x43ef('0x35')](_0xfc3874[_0x43ef('0x30')]['fields']));_0x305ae0['attributes']=_0x305ae0[_0x43ef('0x33')]['length']?_0x305ae0[_0x43ef('0x33')]:_0x920b9a[_0x43ef('0x2f')];if(_0xfc3874[_0x43ef('0x30')][_0x43ef('0x3e')]){_0x305ae0[_0x43ef('0x44')]=[{'all':!![]}];}_0x305ae0=_[_0x43ef('0x3d')]({},_0x305ae0,_0xfc3874['options']);return db[_0x43ef('0x2b')][_0x43ef('0x45')](_0x305ae0)[_0x43ef('0x22')](handleEntityNotFound(_0x4e2940,null))[_0x43ef('0x22')](respondWithResult(_0x4e2940,null))[_0x43ef('0x46')](handleError(_0x4e2940,null));};exports[_0x43ef('0x47')]=function(_0x4fc019,_0x5846ca){return db['AnalyticExtractedReport'][_0x43ef('0x47')](_0x4fc019['body'],{})[_0x43ef('0x22')](function(_0x5478c2){var _0x50a307=_0x4fc019[_0x43ef('0x48')]['get']({'plain':!![]});if(!_0x50a307)throw new Error(_0x43ef('0x49'));if(_0x50a307[_0x43ef('0x4a')]===_0x43ef('0x48')){var _0x232011=_0x5478c2['get']({'plain':!![]});var _0x301dbc='ExtractedReports';return db[_0x43ef('0x4b')][_0x43ef('0x45')]({'where':{'name':_0x301dbc,'userProfileId':_0x50a307['userProfileId']},'raw':!![]})['then'](function(_0x28adc6){if(_0x28adc6&&_0x28adc6[_0x43ef('0x4c')]===0x0){return db[_0x43ef('0x26')]['create']({'name':_0x232011[_0x43ef('0x29')],'resourceId':_0x232011['id'],'type':_0x28adc6[_0x43ef('0x29')],'sectionId':_0x28adc6['id']},{})[_0x43ef('0x22')](function(){return _0x5478c2;});}else{return _0x5478c2;}})['catch'](function(_0x3a5912){logger['error'](_0x43ef('0x4d'),_0x3a5912);throw _0x3a5912;});}return _0x5478c2;})[_0x43ef('0x22')](respondWithResult(_0x5846ca,0xc9))['catch'](handleError(_0x5846ca,null));};exports[_0x43ef('0x21')]=function(_0x3d142a,_0xb5a23c){if(_0x3d142a['body']['id']){delete _0x3d142a[_0x43ef('0x4e')]['id'];}return db[_0x43ef('0x2b')][_0x43ef('0x45')]({'where':{'id':_0x3d142a[_0x43ef('0x42')]['id']}})[_0x43ef('0x22')](handleEntityNotFound(_0xb5a23c,null))[_0x43ef('0x22')](saveUpdates(_0x3d142a[_0x43ef('0x4e')],null))[_0x43ef('0x22')](respondWithResult(_0xb5a23c,null))[_0x43ef('0x46')](handleError(_0xb5a23c,null));};exports[_0x43ef('0x23')]=function(_0x3e4552,_0x5b8769){return db['AnalyticExtractedReport'][_0x43ef('0x45')]({'where':{'id':_0x3e4552[_0x43ef('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b8769,null))['then'](removeEntity(_0x5b8769,null))[_0x43ef('0x46')](handleError(_0x5b8769,null));};exports[_0x43ef('0x4f')]=function(_0x25893b,_0x3f2998,_0x23fac4){return db['AnalyticExtractedReport'][_0x43ef('0x45')]({'where':{'id':_0x25893b[_0x43ef('0x42')]['id']},'attributes':[_0x43ef('0x29'),'basename',_0x43ef('0x50'),'output'],'raw':!![]})[_0x43ef('0x22')](handleEntityNotFound(_0x3f2998,null))[_0x43ef('0x22')](function(_0x1702df){if(_0x1702df){if(!fs[_0x43ef('0x51')](path[_0x43ef('0x52')](config[_0x43ef('0x53')],_0x43ef('0x54'),_0x1702df[_0x43ef('0x50')]))){throw new db[(_0x43ef('0x55'))][(_0x43ef('0x56'))](_0x43ef('0x57'));}if(_0x25893b[_0x43ef('0x30')][_0x43ef('0x58')]){return _0x3f2998[_0x43ef('0x17')](0xc8);}return _0x3f2998[_0x43ef('0x4f')](path[_0x43ef('0x52')](config[_0x43ef('0x53')],_0x43ef('0x54'),_0x1702df[_0x43ef('0x50')]),util[_0x43ef('0x59')](_0x43ef('0x5a'),_0x1702df['basename']||_0x1702df['name'],_0x1702df['output'][_0x43ef('0x5b')]()));}})[_0x43ef('0x46')](handleError(_0x3f2998,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7fac12a..bcd7a6f 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 _0xcafa=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','analytics_extracted_reports','lodash','util'];(function(_0x30ef84,_0x127f85){var _0x14ae3=function(_0x56889a){while(--_0x56889a){_0x30ef84['push'](_0x30ef84['shift']());}};_0x14ae3(++_0x127f85);}(_0xcafa,0xfb));var _0xacaf=function(_0x43fa8f,_0x4f7417){_0x43fa8f=_0x43fa8f-0x0;var _0x1221a6=_0xcafa[_0x43fa8f];return _0x1221a6;};'use strict';var _=require(_0xacaf('0x0'));var util=require(_0xacaf('0x1'));var logger=require('../../config/logger')(_0xacaf('0x2'));var moment=require(_0xacaf('0x3'));var BPromise=require(_0xacaf('0x4'));var rp=require(_0xacaf('0x5'));var fs=require('fs');var path=require(_0xacaf('0x6'));var rimraf=require('rimraf');var config=require(_0xacaf('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0xacaf('0x8')]=function(_0x2fb1bf,_0x392405){return _0x2fb1bf[_0xacaf('0x9')]('AnalyticExtractedReport',attributes,{'tableName':_0xacaf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe08d=['AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x3428ed,_0x510627){var _0x46c9cf=function(_0x48eaf8){while(--_0x48eaf8){_0x3428ed['push'](_0x3428ed['shift']());}};_0x46c9cf(++_0x510627);}(_0xe08d,0x8e));var _0xde08=function(_0x57b4cf,_0x565772){_0x57b4cf=_0x57b4cf-0x0;var _0x49f8a8=_0xe08d[_0x57b4cf];return _0x49f8a8;};'use strict';var _=require(_0xde08('0x0'));var util=require(_0xde08('0x1'));var logger=require(_0xde08('0x2'))('api');var moment=require(_0xde08('0x3'));var BPromise=require(_0xde08('0x4'));var rp=require(_0xde08('0x5'));var fs=require('fs');var path=require(_0xde08('0x6'));var rimraf=require(_0xde08('0x7'));var config=require(_0xde08('0x8'));var attributes=require(_0xde08('0x9'));module[_0xde08('0xa')]=function(_0x47e406,_0x1d214f){return _0x47e406[_0xde08('0xb')](_0xde08('0xc'),attributes,{'tableName':_0xde08('0xd'),'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 ed03294..23cde68 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 _0x2836=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x505df1,_0xafc616){var _0x2fb363=function(_0x1d1b53){while(--_0x1d1b53){_0x505df1['push'](_0x505df1['shift']());}};_0x2fb363(++_0xafc616);}(_0x2836,0x148));var _0x6283=function(_0x1d8610,_0x55d241){_0x1d8610=_0x1d8610-0x0;var _0x22c405=_0x2836[_0x1d8610];return _0x22c405;};'use strict';var _=require(_0x6283('0x0'));var util=require(_0x6283('0x1'));var moment=require('moment');var BPromise=require(_0x6283('0x2'));var rs=require(_0x6283('0x3'));var fs=require('fs');var Redis=require(_0x6283('0x4'));var db=require(_0x6283('0x5'))['db'];var utils=require(_0x6283('0x6'));var logger=require(_0x6283('0x7'))(_0x6283('0x8'));var config=require(_0x6283('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6283('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb723ac,_0x15d6f4,_0x5b5c84){return new BPromise(function(_0x434417,_0x10b6b0){return client[_0x6283('0xb')](_0xb723ac,_0x5b5c84)['then'](function(_0x5c984e){logger[_0x6283('0xc')](_0x6283('0xd'),_0x15d6f4,_0x6283('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x15d6f4,_0x6283('0xe'),JSON['stringify'](_0x5c984e));if(_0x5c984e[_0x6283('0xf')]){if(_0x5c984e[_0x6283('0xf')][_0x6283('0x10')]===0x1f4){logger[_0x6283('0xf')](_0x6283('0xd'),_0x15d6f4,_0x5c984e[_0x6283('0xf')][_0x6283('0x11')]);return _0x10b6b0(_0x5c984e['error']['message']);}logger[_0x6283('0xf')](_0x6283('0xd'),_0x15d6f4,_0x5c984e['error'][_0x6283('0x11')]);return _0x434417(_0x5c984e['error'][_0x6283('0x11')]);}else{logger[_0x6283('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x15d6f4,_0x6283('0xe'));_0x434417(_0x5c984e[_0x6283('0x12')][_0x6283('0x11')]);}})[_0x6283('0x13')](function(_0x21104a){logger[_0x6283('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x15d6f4,_0x21104a);_0x10b6b0(_0x21104a);});});} \ No newline at end of file +var _0x291a=['result','catch','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x291a,0x66));var _0xa291=function(_0x34fbd4,_0x3b303b){_0x34fbd4=_0x34fbd4-0x0;var _0x5723dc=_0x291a[_0x34fbd4];return _0x5723dc;};'use strict';var _=require('lodash');var util=require(_0xa291('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa291('0x1'));var fs=require('fs');var Redis=require(_0xa291('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa291('0x3'))(_0xa291('0x4'));var config=require(_0xa291('0x5'));var jayson=require(_0xa291('0x6'));var client=jayson['client'][_0xa291('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x36459c,_0x8d962d,_0x10c7ea){return new BPromise(function(_0x2456d0,_0x2029eb){return client[_0xa291('0x8')](_0x36459c,_0x10c7ea)[_0xa291('0x9')](function(_0x3beabf){logger['info'](_0xa291('0xa'),_0x8d962d,_0xa291('0xb'));logger['debug'](_0xa291('0xc'),_0x8d962d,_0xa291('0xb'),JSON[_0xa291('0xd')](_0x3beabf));if(_0x3beabf['error']){if(_0x3beabf['error'][_0xa291('0xe')]===0x1f4){logger[_0xa291('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x8d962d,_0x3beabf[_0xa291('0xf')][_0xa291('0x10')]);return _0x2029eb(_0x3beabf[_0xa291('0xf')][_0xa291('0x10')]);}logger[_0xa291('0xf')](_0xa291('0xa'),_0x8d962d,_0x3beabf[_0xa291('0xf')][_0xa291('0x10')]);return _0x2456d0(_0x3beabf[_0xa291('0xf')][_0xa291('0x10')]);}else{logger[_0xa291('0x11')](_0xa291('0xa'),_0x8d962d,_0xa291('0xb'));_0x2456d0(_0x3beabf[_0xa291('0x12')][_0xa291('0x10')]);}})[_0xa291('0x13')](function(_0x3c9ba1){logger[_0xa291('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x8d962d,_0x3c9ba1);_0x2029eb(_0x3c9ba1);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 95a28e3..0587963 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 _0x1058=['/:id/download','isAuthenticated','download','post','create','put','delete','exports','multer','util','express','Router','./analyticExtractedReport.controller','index','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1058,0x148));var _0x8105=function(_0x572911,_0x11d671){_0x572911=_0x572911-0x0;var _0xda6d77=_0x1058[_0x572911];return _0xda6d77;};'use strict';var multer=require(_0x8105('0x0'));var util=require(_0x8105('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8105('0x2'));var router=express[_0x8105('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8105('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x8105('0x5')]);router[_0x8105('0x6')](_0x8105('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x8105('0x6')](_0x8105('0x8'),auth[_0x8105('0x9')](),controller[_0x8105('0xa')]);router[_0x8105('0xb')]('/',auth[_0x8105('0x9')](),controller[_0x8105('0xc')]);router[_0x8105('0xd')](_0x8105('0x7'),auth[_0x8105('0x9')](),controller['update']);router[_0x8105('0xe')](_0x8105('0x7'),auth[_0x8105('0x9')](),controller['destroy']);module[_0x8105('0xf')]=router; \ No newline at end of file +var _0xa846=['isAuthenticated','index','get','/:id','show','/:id/download','download','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x5812d7,_0x241b39){var _0xb101af=function(_0x22b39c){while(--_0x22b39c){_0x5812d7['push'](_0x5812d7['shift']());}};_0xb101af(++_0x241b39);}(_0xa846,0x70));var _0x6a84=function(_0x326109,_0x2055e0){_0x326109=_0x326109-0x0;var _0x3302d4=_0xa846[_0x326109];return _0x3302d4;};'use strict';var multer=require('multer');var util=require(_0x6a84('0x0'));var path=require(_0x6a84('0x1'));var timeout=require(_0x6a84('0x2'));var express=require(_0x6a84('0x3'));var router=express[_0x6a84('0x4')]();var auth=require(_0x6a84('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a84('0x6'));var controller=require(_0x6a84('0x7'));router['get']('/',auth[_0x6a84('0x8')](),controller[_0x6a84('0x9')]);router[_0x6a84('0xa')](_0x6a84('0xb'),auth['isAuthenticated'](),controller[_0x6a84('0xc')]);router['get'](_0x6a84('0xd'),auth['isAuthenticated'](),controller[_0x6a84('0xe')]);router['post']('/',auth[_0x6a84('0x8')](),controller[_0x6a84('0xf')]);router[_0x6a84('0x10')](_0x6a84('0xb'),auth[_0x6a84('0x8')](),controller[_0x6a84('0x11')]);router[_0x6a84('0x12')]('/:id',auth[_0x6a84('0x8')](),controller[_0x6a84('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 2d4d441..8663148 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 _0x5fc3=['sequelize','exports','STRING','BOOLEAN'];(function(_0x221d87,_0x2c548c){var _0x15a198=function(_0x58235c){while(--_0x58235c){_0x221d87['push'](_0x221d87['shift']());}};_0x15a198(++_0x2c548c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x5fc3[_0x35f7f5];return _0x5567a4;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x35fc('0x2')]},'function':{'type':Sequelize[_0x35fc('0x2')]},'format':{'type':Sequelize[_0x35fc('0x2')]},'groupBy':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','BOOLEAN'];(function(_0x18852b,_0x1c8700){var _0x5cf5d6=function(_0xe39163){while(--_0xe39163){_0x18852b['push'](_0x18852b['shift']());}};_0x5cf5d6(++_0x1c8700);}(_0x5fc3,0xa8));var _0x35fc=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0x5fc3[_0xf2662b];return _0x257dc7;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x35fc('0x2')]},'function':{'type':Sequelize[_0x35fc('0x2')]},'format':{'type':Sequelize[_0x35fc('0x2')]},'groupBy':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index a23d0dc..ae315ae 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 _0x4f88=['merge','VIRTUAL','filter','options','includeAll','rows','catch','params','find','body','bulkCreate','AnalyticFieldReport','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','findAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2d876e,_0x6cb88d){var _0x21fa1b=function(_0x546c8a){while(--_0x546c8a){_0x2d876e['push'](_0x2d876e['shift']());}};_0x21fa1b(++_0x6cb88d);}(_0x4f88,0xf3));var _0x84f8=function(_0x27bcf5,_0x236765){_0x27bcf5=_0x27bcf5-0x0;var _0x4ce4cf=_0x4f88[_0x27bcf5];return _0x4ce4cf;};'use strict';var pdf=require(_0x84f8('0x0'));var emlformat=require(_0x84f8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x84f8('0x2'));var jsonpatch=require(_0x84f8('0x3'));var rp=require(_0x84f8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x84f8('0x5'));var util=require(_0x84f8('0x6'));var path=require(_0x84f8('0x7'));var sox=require(_0x84f8('0x8'));var csv=require(_0x84f8('0x9'));var ejs=require(_0x84f8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x84f8('0xb'));var crypto=require(_0x84f8('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x84f8('0x9'));var querystring=require(_0x84f8('0xd'));var Papa=require(_0x84f8('0xe'));var Redis=require(_0x84f8('0xf'));var authService=require(_0x84f8('0x10'));var qs=require(_0x84f8('0x11'));var as=require(_0x84f8('0x12'));var hardwareService=require(_0x84f8('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x84f8('0x14'));var config=require(_0x84f8('0x15'));var db=require(_0x84f8('0x16'))['db'];function respondWithStatusCode(_0x238c5d,_0xc8d4b3){_0xc8d4b3=_0xc8d4b3||0xcc;return function(_0x49812d){if(_0x49812d){return _0x238c5d[_0x84f8('0x17')](_0xc8d4b3);}return _0x238c5d[_0x84f8('0x18')](_0xc8d4b3)[_0x84f8('0x19')]();};}function respondWithResult(_0x3a3809,_0x25750c){_0x25750c=_0x25750c||0xc8;return function(_0x58d1e7){if(_0x58d1e7){return _0x3a3809[_0x84f8('0x18')](_0x25750c)[_0x84f8('0x1a')](_0x58d1e7);}};}function respondWithFilteredResult(_0x284427,_0x39f903){return function(_0x4c4d61){if(_0x4c4d61){var _0x15fc4a=_0x4c4d61[_0x84f8('0x1b')],_0x5ed4b3=_0x39f903['offset'],_0x4642e9=_0x39f903[_0x84f8('0x1c')]+_0x39f903[_0x84f8('0x1d')],_0x3862da;if(_0x4642e9>=_0x15fc4a){_0x4642e9=_0x15fc4a;_0x3862da=0xc8;}else{_0x3862da=0xce;}_0x284427[_0x84f8('0x18')](_0x3862da);return _0x284427[_0x84f8('0x1e')](_0x84f8('0x1f'),_0x5ed4b3+'-'+_0x4642e9+'/'+_0x15fc4a)[_0x84f8('0x1a')](_0x4c4d61);}return null;};}function patchUpdates(_0x53c7ca){return function(_0x12a29a){try{jsonpatch[_0x84f8('0x20')](_0x12a29a,_0x53c7ca,!![]);}catch(_0x20c99d){return BPromise['reject'](_0x20c99d);}return _0x12a29a['save']();};}function saveUpdates(_0x2e23e4,_0x5ecb0d){return function(_0x224909){if(_0x224909){return _0x224909[_0x84f8('0x21')](_0x2e23e4)[_0x84f8('0x22')](function(_0x38e39a){return _0x38e39a;});}return null;};}function removeEntity(_0x5ad055,_0x2e6da3){return function(_0x19193a){if(_0x19193a){return _0x19193a[_0x84f8('0x23')]()[_0x84f8('0x22')](function(){_0x5ad055['status'](0xcc)[_0x84f8('0x19')]();});}};}function handleEntityNotFound(_0x2d924a,_0x28a651){return function(_0x4a47f1){if(!_0x4a47f1){_0x2d924a[_0x84f8('0x17')](0x194);}return _0x4a47f1;};}function handleError(_0xc040a2,_0x230ea3){_0x230ea3=_0x230ea3||0x1f4;return function(_0xf7270a){logger[_0x84f8('0x24')](_0xf7270a['stack']);if(_0xf7270a[_0x84f8('0x25')]){delete _0xf7270a['name'];}_0xc040a2['status'](_0x230ea3)[_0x84f8('0x26')](_0xf7270a);};}exports[_0x84f8('0x27')]=function(_0x27fe17,_0x5b896e){var _0x18731d={},_0x454a11={},_0x550b29={'count':0x0,'rows':[]};var _0x2561ff=_[_0x84f8('0x28')](db['AnalyticFieldReport']['rawAttributes'],function(_0x2c08e1){return{'name':_0x2c08e1[_0x84f8('0x29')],'type':_0x2c08e1[_0x84f8('0x2a')][_0x84f8('0x2b')]};});_0x454a11['model']=_[_0x84f8('0x28')](_0x2561ff,_0x84f8('0x25'));_0x454a11[_0x84f8('0x2c')]=_[_0x84f8('0x2d')](_0x27fe17['query']);_0x454a11[_0x84f8('0x2e')]=_[_0x84f8('0x2f')](_0x454a11[_0x84f8('0x30')],_0x454a11[_0x84f8('0x2c')]);_0x18731d['attributes']=_['intersection'](_0x454a11['model'],qs[_0x84f8('0x31')](_0x27fe17[_0x84f8('0x2c')][_0x84f8('0x31')]));_0x18731d[_0x84f8('0x32')]=_0x18731d[_0x84f8('0x32')][_0x84f8('0x33')]?_0x18731d[_0x84f8('0x32')]:_0x454a11[_0x84f8('0x30')];if(!_0x27fe17[_0x84f8('0x2c')][_0x84f8('0x34')](_0x84f8('0x35'))){_0x18731d[_0x84f8('0x1d')]=qs[_0x84f8('0x1d')](_0x27fe17[_0x84f8('0x2c')][_0x84f8('0x1d')]);_0x18731d[_0x84f8('0x1c')]=qs['offset'](_0x27fe17[_0x84f8('0x2c')]['offset']);}_0x18731d[_0x84f8('0x36')]=qs[_0x84f8('0x37')](_0x27fe17['query'][_0x84f8('0x37')]);_0x18731d[_0x84f8('0x38')]=qs[_0x84f8('0x2e')](_['pick'](_0x27fe17[_0x84f8('0x2c')],_0x454a11['filters']),_0x2561ff);if(_0x27fe17['query']['filter']){_0x18731d[_0x84f8('0x38')]=_[_0x84f8('0x39')](_0x18731d[_0x84f8('0x38')],{'$or':_[_0x84f8('0x28')](_0x2561ff,function(_0x139a35){if(_0x139a35[_0x84f8('0x2a')]!==_0x84f8('0x3a')){var _0x3a54c2={};_0x3a54c2[_0x139a35[_0x84f8('0x25')]]={'$like':'%'+_0x27fe17[_0x84f8('0x2c')][_0x84f8('0x3b')]+'%'};return _0x3a54c2;}})});}_0x18731d=_[_0x84f8('0x39')]({},_0x18731d,_0x27fe17[_0x84f8('0x3c')]);var _0x472a05={'where':_0x18731d[_0x84f8('0x38')]};return db['AnalyticFieldReport'][_0x84f8('0x1b')](_0x472a05)[_0x84f8('0x22')](function(_0x2ff8c8){_0x550b29['count']=_0x2ff8c8;if(_0x27fe17[_0x84f8('0x2c')][_0x84f8('0x3d')]){_0x18731d['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x18731d);})[_0x84f8('0x22')](function(_0x2776fa){_0x550b29[_0x84f8('0x3e')]=_0x2776fa;return _0x550b29;})[_0x84f8('0x22')](respondWithFilteredResult(_0x5b896e,_0x18731d))[_0x84f8('0x3f')](handleError(_0x5b896e,null));};exports['show']=function(_0x2b1915,_0x5b007c){var _0x3cbcd7={'raw':![],'where':{'id':_0x2b1915[_0x84f8('0x40')]['id']}},_0x642aa8={};_0x642aa8['model']=_[_0x84f8('0x2d')](db['AnalyticFieldReport']['rawAttributes']);_0x642aa8[_0x84f8('0x2c')]=_['keys'](_0x2b1915[_0x84f8('0x2c')]);_0x642aa8[_0x84f8('0x2e')]=_[_0x84f8('0x2f')](_0x642aa8[_0x84f8('0x30')],_0x642aa8[_0x84f8('0x2c')]);_0x3cbcd7['attributes']=_[_0x84f8('0x2f')](_0x642aa8[_0x84f8('0x30')],qs[_0x84f8('0x31')](_0x2b1915[_0x84f8('0x2c')]['fields']));_0x3cbcd7[_0x84f8('0x32')]=_0x3cbcd7['attributes']['length']?_0x3cbcd7[_0x84f8('0x32')]:_0x642aa8[_0x84f8('0x30')];if(_0x2b1915[_0x84f8('0x2c')][_0x84f8('0x3d')]){_0x3cbcd7['include']=[{'all':!![]}];}_0x3cbcd7=_[_0x84f8('0x39')]({},_0x3cbcd7,_0x2b1915[_0x84f8('0x3c')]);return db['AnalyticFieldReport'][_0x84f8('0x41')](_0x3cbcd7)[_0x84f8('0x22')](handleEntityNotFound(_0x5b007c,null))[_0x84f8('0x22')](respondWithResult(_0x5b007c,null))[_0x84f8('0x3f')](handleError(_0x5b007c,null));};exports['create']=function(_0x475ef,_0x4e779){return db['AnalyticFieldReport']['create'](_0x475ef[_0x84f8('0x42')],{})[_0x84f8('0x22')](respondWithResult(_0x4e779,0xc9))[_0x84f8('0x3f')](handleError(_0x4e779,null));};exports[_0x84f8('0x43')]=function(_0x518ade,_0x363bd8){return db[_0x84f8('0x44')][_0x84f8('0x43')](_0x518ade[_0x84f8('0x42')],{'raw':![],'individualHooks':!![]})[_0x84f8('0x22')](respondWithResult(_0x363bd8,0xc9))[_0x84f8('0x3f')](handleError(_0x363bd8,null));};exports[_0x84f8('0x21')]=function(_0x2568ab,_0x342165){if(_0x2568ab[_0x84f8('0x42')]['id']){delete _0x2568ab[_0x84f8('0x42')]['id'];}return db[_0x84f8('0x44')][_0x84f8('0x41')]({'where':{'id':_0x2568ab[_0x84f8('0x40')]['id']}})[_0x84f8('0x22')](handleEntityNotFound(_0x342165,null))[_0x84f8('0x22')](saveUpdates(_0x2568ab[_0x84f8('0x42')],null))[_0x84f8('0x22')](respondWithResult(_0x342165,null))['catch'](handleError(_0x342165,null));};exports['destroy']=function(_0x53424f,_0x1f9453){return db['AnalyticFieldReport'][_0x84f8('0x41')]({'where':{'id':_0x53424f[_0x84f8('0x40')]['id']}})['then'](handleEntityNotFound(_0x1f9453,null))[_0x84f8('0x22')](removeEntity(_0x1f9453,null))[_0x84f8('0x3f')](handleError(_0x1f9453,null));};exports[_0x84f8('0x45')]=function(_0x11d392,_0x4230bd){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x11d392[_0x84f8('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x84f8('0x22')](respondWithResult(_0x4230bd,0xcc))[_0x84f8('0x3f')](handleError(_0x4230bd,null));};exports[_0x84f8('0x46')]=function(_0x41c243,_0x33eca3,_0x86f8c7){return db[_0x84f8('0x47')][_0x84f8('0x48')]({'where':{'id':_0x41c243[_0x84f8('0x40')]['id']}})[_0x84f8('0x22')](handleEntityNotFound(_0x33eca3,null))[_0x84f8('0x22')](function(_0x50cc40){if(_0x50cc40){return db[_0x84f8('0x49')]['transaction'](function(_0x2b089c){return db[_0x84f8('0x44')][_0x84f8('0x23')]({'where':{'CustomReportId':_0x41c243[_0x84f8('0x40')]['id']},'transaction':_0x2b089c})[_0x84f8('0x22')](function(_0xac248b){var _0x15e25b=_['map'](_0x41c243[_0x84f8('0x42')],function(_0x14d212){delete _0x14d212['id'];_0x14d212['CustomReportId']=_0x41c243[_0x84f8('0x40')]['id'];return _0x14d212;});return db[_0x84f8('0x44')][_0x84f8('0x43')](_0x15e25b,{'transaction':_0x2b089c});});})[_0x84f8('0x22')](function(){return db[_0x84f8('0x44')][_0x84f8('0x4a')]({'where':{'CustomReportId':_0x41c243[_0x84f8('0x40')]['id']}});});}})['then'](respondWithResult(_0x33eca3,null))[_0x84f8('0x3f')](handleError(_0x33eca3,null));}; \ No newline at end of file +var _0xaa45=['Content-Range','json','apply','reject','save','update','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','rows','catch','includeAll','find','create','body','bulkCreate','params','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','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/environment','../../mysqldb','sendStatus','status','end','offset','limit','set'];(function(_0x3e38fb,_0x3b9176){var _0x54cb5a=function(_0x25e3e4){while(--_0x25e3e4){_0x3e38fb['push'](_0x3e38fb['shift']());}};_0x54cb5a(++_0x3b9176);}(_0xaa45,0x17d));var _0x5aa4=function(_0xc36d01,_0x3bf1a6){_0xc36d01=_0xc36d01-0x0;var _0xecb231=_0xaa45[_0xc36d01];return _0xecb231;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5aa4('0x0'));var rimraf=require(_0x5aa4('0x1'));var zipdir=require(_0x5aa4('0x2'));var jsonpatch=require(_0x5aa4('0x3'));var rp=require(_0x5aa4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5aa4('0x5'));var util=require('util');var path=require(_0x5aa4('0x6'));var sox=require(_0x5aa4('0x7'));var csv=require(_0x5aa4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5aa4('0x9'));var squel=require(_0x5aa4('0xa'));var crypto=require(_0x5aa4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5aa4('0xc'));var toCsv=require(_0x5aa4('0x8'));var querystring=require('querystring');var Papa=require(_0x5aa4('0xd'));var Redis=require(_0x5aa4('0xe'));var authService=require(_0x5aa4('0xf'));var qs=require(_0x5aa4('0x10'));var as=require(_0x5aa4('0x11'));var hardwareService=require(_0x5aa4('0x12'));var logger=require(_0x5aa4('0x13'))(_0x5aa4('0x14'));var utils=require('../../config/utils');var config=require(_0x5aa4('0x15'));var db=require(_0x5aa4('0x16'))['db'];function respondWithStatusCode(_0x157cac,_0x5aba44){_0x5aba44=_0x5aba44||0xcc;return function(_0x466fcf){if(_0x466fcf){return _0x157cac[_0x5aa4('0x17')](_0x5aba44);}return _0x157cac[_0x5aa4('0x18')](_0x5aba44)[_0x5aa4('0x19')]();};}function respondWithResult(_0x29b334,_0x1df98a){_0x1df98a=_0x1df98a||0xc8;return function(_0x31eee8){if(_0x31eee8){return _0x29b334['status'](_0x1df98a)['json'](_0x31eee8);}};}function respondWithFilteredResult(_0x38d7f0,_0x23742d){return function(_0x54d658){if(_0x54d658){var _0xe6a7a5=_0x54d658['count'],_0x26a139=_0x23742d[_0x5aa4('0x1a')],_0x4cee29=_0x23742d[_0x5aa4('0x1a')]+_0x23742d[_0x5aa4('0x1b')],_0x2eed4a;if(_0x4cee29>=_0xe6a7a5){_0x4cee29=_0xe6a7a5;_0x2eed4a=0xc8;}else{_0x2eed4a=0xce;}_0x38d7f0[_0x5aa4('0x18')](_0x2eed4a);return _0x38d7f0[_0x5aa4('0x1c')](_0x5aa4('0x1d'),_0x26a139+'-'+_0x4cee29+'/'+_0xe6a7a5)[_0x5aa4('0x1e')](_0x54d658);}return null;};}function patchUpdates(_0x274a6c){return function(_0x182708){try{jsonpatch[_0x5aa4('0x1f')](_0x182708,_0x274a6c,!![]);}catch(_0x2caf0d){return BPromise[_0x5aa4('0x20')](_0x2caf0d);}return _0x182708[_0x5aa4('0x21')]();};}function saveUpdates(_0x3531be,_0x15714b){return function(_0x29aec7){if(_0x29aec7){return _0x29aec7[_0x5aa4('0x22')](_0x3531be)[_0x5aa4('0x23')](function(_0x1dd718){return _0x1dd718;});}return null;};}function removeEntity(_0x39a73c,_0x1bf85d){return function(_0x254bc4){if(_0x254bc4){return _0x254bc4['destroy']()[_0x5aa4('0x23')](function(){_0x39a73c[_0x5aa4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c6d78,_0x183653){return function(_0x414204){if(!_0x414204){_0x1c6d78[_0x5aa4('0x17')](0x194);}return _0x414204;};}function handleError(_0x403980,_0x2275ae){_0x2275ae=_0x2275ae||0x1f4;return function(_0x1a0858){logger[_0x5aa4('0x24')](_0x1a0858['stack']);if(_0x1a0858['name']){delete _0x1a0858[_0x5aa4('0x25')];}_0x403980[_0x5aa4('0x18')](_0x2275ae)[_0x5aa4('0x26')](_0x1a0858);};}exports[_0x5aa4('0x27')]=function(_0x1ee624,_0x46ce15){var _0x1576ce={},_0x41a22f={},_0x29f36e={'count':0x0,'rows':[]};var _0x32999a=_[_0x5aa4('0x28')](db[_0x5aa4('0x29')][_0x5aa4('0x2a')],function(_0x526b67){return{'name':_0x526b67[_0x5aa4('0x2b')],'type':_0x526b67[_0x5aa4('0x2c')]['key']};});_0x41a22f[_0x5aa4('0x2d')]=_['map'](_0x32999a,'name');_0x41a22f[_0x5aa4('0x2e')]=_[_0x5aa4('0x2f')](_0x1ee624[_0x5aa4('0x2e')]);_0x41a22f[_0x5aa4('0x30')]=_[_0x5aa4('0x31')](_0x41a22f[_0x5aa4('0x2d')],_0x41a22f['query']);_0x1576ce[_0x5aa4('0x32')]=_[_0x5aa4('0x31')](_0x41a22f['model'],qs[_0x5aa4('0x33')](_0x1ee624['query'][_0x5aa4('0x33')]));_0x1576ce[_0x5aa4('0x32')]=_0x1576ce[_0x5aa4('0x32')][_0x5aa4('0x34')]?_0x1576ce['attributes']:_0x41a22f['model'];if(!_0x1ee624[_0x5aa4('0x2e')][_0x5aa4('0x35')](_0x5aa4('0x36'))){_0x1576ce[_0x5aa4('0x1b')]=qs[_0x5aa4('0x1b')](_0x1ee624[_0x5aa4('0x2e')][_0x5aa4('0x1b')]);_0x1576ce[_0x5aa4('0x1a')]=qs['offset'](_0x1ee624[_0x5aa4('0x2e')][_0x5aa4('0x1a')]);}_0x1576ce[_0x5aa4('0x37')]=qs[_0x5aa4('0x38')](_0x1ee624['query']['sort']);_0x1576ce[_0x5aa4('0x39')]=qs[_0x5aa4('0x30')](_[_0x5aa4('0x3a')](_0x1ee624[_0x5aa4('0x2e')],_0x41a22f['filters']),_0x32999a);if(_0x1ee624[_0x5aa4('0x2e')][_0x5aa4('0x3b')]){_0x1576ce['where']=_['merge'](_0x1576ce['where'],{'$or':_[_0x5aa4('0x28')](_0x32999a,function(_0x380dff){if(_0x380dff[_0x5aa4('0x2c')]!==_0x5aa4('0x3c')){var _0x1de8c0={};_0x1de8c0[_0x380dff['name']]={'$like':'%'+_0x1ee624[_0x5aa4('0x2e')]['filter']+'%'};return _0x1de8c0;}})});}_0x1576ce=_[_0x5aa4('0x3d')]({},_0x1576ce,_0x1ee624[_0x5aa4('0x3e')]);var _0xb064fa={'where':_0x1576ce[_0x5aa4('0x39')]};return db[_0x5aa4('0x29')][_0x5aa4('0x3f')](_0xb064fa)[_0x5aa4('0x23')](function(_0x4df62c){_0x29f36e[_0x5aa4('0x3f')]=_0x4df62c;if(_0x1ee624[_0x5aa4('0x2e')]['includeAll']){_0x1576ce[_0x5aa4('0x40')]=[{'all':!![]}];}return db[_0x5aa4('0x29')]['findAll'](_0x1576ce);})[_0x5aa4('0x23')](function(_0xbbee3c){_0x29f36e[_0x5aa4('0x41')]=_0xbbee3c;return _0x29f36e;})[_0x5aa4('0x23')](respondWithFilteredResult(_0x46ce15,_0x1576ce))[_0x5aa4('0x42')](handleError(_0x46ce15,null));};exports['show']=function(_0x2a741a,_0x3b1556){var _0x254dd7={'raw':![],'where':{'id':_0x2a741a['params']['id']}},_0x24ede3={};_0x24ede3[_0x5aa4('0x2d')]=_[_0x5aa4('0x2f')](db[_0x5aa4('0x29')][_0x5aa4('0x2a')]);_0x24ede3[_0x5aa4('0x2e')]=_[_0x5aa4('0x2f')](_0x2a741a[_0x5aa4('0x2e')]);_0x24ede3['filters']=_['intersection'](_0x24ede3[_0x5aa4('0x2d')],_0x24ede3[_0x5aa4('0x2e')]);_0x254dd7[_0x5aa4('0x32')]=_[_0x5aa4('0x31')](_0x24ede3[_0x5aa4('0x2d')],qs[_0x5aa4('0x33')](_0x2a741a[_0x5aa4('0x2e')]['fields']));_0x254dd7[_0x5aa4('0x32')]=_0x254dd7[_0x5aa4('0x32')][_0x5aa4('0x34')]?_0x254dd7['attributes']:_0x24ede3[_0x5aa4('0x2d')];if(_0x2a741a[_0x5aa4('0x2e')][_0x5aa4('0x43')]){_0x254dd7[_0x5aa4('0x40')]=[{'all':!![]}];}_0x254dd7=_[_0x5aa4('0x3d')]({},_0x254dd7,_0x2a741a['options']);return db[_0x5aa4('0x29')][_0x5aa4('0x44')](_0x254dd7)[_0x5aa4('0x23')](handleEntityNotFound(_0x3b1556,null))[_0x5aa4('0x23')](respondWithResult(_0x3b1556,null))[_0x5aa4('0x42')](handleError(_0x3b1556,null));};exports[_0x5aa4('0x45')]=function(_0x3341d,_0x2a0d55){return db[_0x5aa4('0x29')][_0x5aa4('0x45')](_0x3341d[_0x5aa4('0x46')],{})[_0x5aa4('0x23')](respondWithResult(_0x2a0d55,0xc9))['catch'](handleError(_0x2a0d55,null));};exports['bulkCreate']=function(_0xb5851b,_0x18f11f){return db['AnalyticFieldReport'][_0x5aa4('0x47')](_0xb5851b[_0x5aa4('0x46')],{'raw':![],'individualHooks':!![]})[_0x5aa4('0x23')](respondWithResult(_0x18f11f,0xc9))['catch'](handleError(_0x18f11f,null));};exports[_0x5aa4('0x22')]=function(_0x2685b5,_0x29d030){if(_0x2685b5[_0x5aa4('0x46')]['id']){delete _0x2685b5[_0x5aa4('0x46')]['id'];}return db[_0x5aa4('0x29')][_0x5aa4('0x44')]({'where':{'id':_0x2685b5[_0x5aa4('0x48')]['id']}})[_0x5aa4('0x23')](handleEntityNotFound(_0x29d030,null))[_0x5aa4('0x23')](saveUpdates(_0x2685b5[_0x5aa4('0x46')],null))['then'](respondWithResult(_0x29d030,null))[_0x5aa4('0x42')](handleError(_0x29d030,null));};exports['destroy']=function(_0x28d29d,_0x52fe7a){return db[_0x5aa4('0x29')][_0x5aa4('0x44')]({'where':{'id':_0x28d29d['params']['id']}})[_0x5aa4('0x23')](handleEntityNotFound(_0x52fe7a,null))[_0x5aa4('0x23')](removeEntity(_0x52fe7a,null))[_0x5aa4('0x42')](handleError(_0x52fe7a,null));};exports[_0x5aa4('0x49')]=function(_0x348491,_0x115502){return db[_0x5aa4('0x29')][_0x5aa4('0x4a')]({'where':{'id':_0x348491[_0x5aa4('0x2e')][_0x5aa4('0x4b')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x115502,0xcc))[_0x5aa4('0x42')](handleError(_0x115502,null));};exports[_0x5aa4('0x4c')]=function(_0x475b6d,_0x4fc182,_0x13a2d9){return db[_0x5aa4('0x4d')][_0x5aa4('0x4e')]({'where':{'id':_0x475b6d['params']['id']}})[_0x5aa4('0x23')](handleEntityNotFound(_0x4fc182,null))[_0x5aa4('0x23')](function(_0x97def){if(_0x97def){return db[_0x5aa4('0x4f')]['transaction'](function(_0x5212f6){return db[_0x5aa4('0x29')]['destroy']({'where':{'CustomReportId':_0x475b6d[_0x5aa4('0x48')]['id']},'transaction':_0x5212f6})[_0x5aa4('0x23')](function(_0x1f3948){var _0x4f0325=_['map'](_0x475b6d[_0x5aa4('0x46')],function(_0x2c62d1){delete _0x2c62d1['id'];_0x2c62d1[_0x5aa4('0x50')]=_0x475b6d[_0x5aa4('0x48')]['id'];return _0x2c62d1;});return db['AnalyticFieldReport'][_0x5aa4('0x47')](_0x4f0325,{'transaction':_0x5212f6});});})[_0x5aa4('0x23')](function(){return db[_0x5aa4('0x29')][_0x5aa4('0x51')]({'where':{'CustomReportId':_0x475b6d[_0x5aa4('0x48')]['id']}});});}})[_0x5aa4('0x23')](respondWithResult(_0x4fc182,null))[_0x5aa4('0x42')](handleError(_0x4fc182,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 369ab1c..009a737 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 _0x1e57=['analytics_report_fields','util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1e57,0xcd));var _0x71e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1e57[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x71e5('0x0'));var logger=require(_0x71e5('0x1'))(_0x71e5('0x2'));var moment=require(_0x71e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x71e5('0x4'));var fs=require('fs');var path=require(_0x71e5('0x5'));var rimraf=require(_0x71e5('0x6'));var config=require('../../config/environment');var attributes=require(_0x71e5('0x7'));module[_0x71e5('0x8')]=function(_0x2869c0,_0x2506e1){return _0x2869c0[_0x71e5('0x9')](_0x71e5('0xa'),attributes,{'tableName':_0x71e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7f6=['request-promise','path','rimraf','../../config/environment','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','moment','bluebird'];(function(_0xa6f070,_0x3d39f5){var _0x1f45f2=function(_0x3c6e36){while(--_0x3c6e36){_0xa6f070['push'](_0xa6f070['shift']());}};_0x1f45f2(++_0x3d39f5);}(_0xa7f6,0x158));var _0x6a7f=function(_0x2731ea,_0x2d7cd6){_0x2731ea=_0x2731ea-0x0;var _0x3fe2df=_0xa7f6[_0x2731ea];return _0x3fe2df;};'use strict';var _=require(_0x6a7f('0x0'));var util=require(_0x6a7f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6a7f('0x2'));var BPromise=require(_0x6a7f('0x3'));var rp=require(_0x6a7f('0x4'));var fs=require('fs');var path=require(_0x6a7f('0x5'));var rimraf=require(_0x6a7f('0x6'));var config=require(_0x6a7f('0x7'));var attributes=require('./analyticFieldReport.attributes');module[_0x6a7f('0x8')]=function(_0x2c4f4f,_0x3c1f30){return _0x2c4f4f[_0x6a7f('0x9')](_0x6a7f('0xa'),attributes,{'tableName':_0x6a7f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 2a3e587..e266c0a 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 _0xb343=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2f0755,_0x117f40){var _0x390bc6=function(_0x37862a){while(--_0x37862a){_0x2f0755['push'](_0x2f0755['shift']());}};_0x390bc6(++_0x117f40);}(_0xb343,0xc4));var _0x3b34=function(_0x3b9100,_0x3b19b8){_0x3b9100=_0x3b9100-0x0;var _0x395c2a=_0xb343[_0x3b9100];return _0x395c2a;};'use strict';var _=require('lodash');var util=require(_0x3b34('0x0'));var moment=require('moment');var BPromise=require(_0x3b34('0x1'));var rs=require(_0x3b34('0x2'));var fs=require('fs');var Redis=require(_0x3b34('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3b34('0x4'));var logger=require(_0x3b34('0x5'))(_0x3b34('0x6'));var config=require(_0x3b34('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3b34('0x8')][_0x3b34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cfa4,_0x473710,_0x571db0){return new BPromise(function(_0x4e3c86,_0x1e5c1c){return client[_0x3b34('0xa')](_0x41cfa4,_0x571db0)[_0x3b34('0xb')](function(_0x17955b){logger['info'](_0x3b34('0xc'),_0x473710,_0x3b34('0xd'));logger[_0x3b34('0xe')](_0x3b34('0xf'),_0x473710,_0x3b34('0xd'),JSON[_0x3b34('0x10')](_0x17955b));if(_0x17955b[_0x3b34('0x11')]){if(_0x17955b[_0x3b34('0x11')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x473710,_0x17955b[_0x3b34('0x11')][_0x3b34('0x12')]);return _0x1e5c1c(_0x17955b[_0x3b34('0x11')]['message']);}logger[_0x3b34('0x11')](_0x3b34('0xc'),_0x473710,_0x17955b[_0x3b34('0x11')][_0x3b34('0x12')]);return _0x4e3c86(_0x17955b[_0x3b34('0x11')][_0x3b34('0x12')]);}else{logger[_0x3b34('0x13')](_0x3b34('0xc'),_0x473710,'request\x20sent');_0x4e3c86(_0x17955b['result']['message']);}})[_0x3b34('0x14')](function(_0x5605db){logger[_0x3b34('0x11')](_0x3b34('0xc'),_0x473710,_0x5605db);_0x1e5c1c(_0x5605db);});});} \ No newline at end of file +var _0xf8d0=['then','info','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4d2e99,_0x591f4a){var _0x3a81ba=function(_0x49ecd7){while(--_0x49ecd7){_0x4d2e99['push'](_0x4d2e99['shift']());}};_0x3a81ba(++_0x591f4a);}(_0xf8d0,0x190));var _0x0f8d=function(_0x868a53,_0x451b0c){_0x868a53=_0x868a53-0x0;var _0x4ad583=_0xf8d0[_0x868a53];return _0x4ad583;};'use strict';var _=require(_0x0f8d('0x0'));var util=require(_0x0f8d('0x1'));var moment=require(_0x0f8d('0x2'));var BPromise=require(_0x0f8d('0x3'));var rs=require(_0x0f8d('0x4'));var fs=require('fs');var Redis=require(_0x0f8d('0x5'));var db=require(_0x0f8d('0x6'))['db'];var utils=require(_0x0f8d('0x7'));var logger=require(_0x0f8d('0x8'))(_0x0f8d('0x9'));var config=require(_0x0f8d('0xa'));var jayson=require(_0x0f8d('0xb'));var client=jayson[_0x0f8d('0xc')][_0x0f8d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x251482,_0xe5de2b,_0x507ed9){return new BPromise(function(_0x36a7f5,_0x27a2dd){return client['request'](_0x251482,_0x507ed9)[_0x0f8d('0xe')](function(_0x40a03b){logger[_0x0f8d('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0xe5de2b,_0x0f8d('0x10'));logger['debug'](_0x0f8d('0x11'),_0xe5de2b,_0x0f8d('0x10'),JSON[_0x0f8d('0x12')](_0x40a03b));if(_0x40a03b[_0x0f8d('0x13')]){if(_0x40a03b[_0x0f8d('0x13')][_0x0f8d('0x14')]===0x1f4){logger[_0x0f8d('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0xe5de2b,_0x40a03b[_0x0f8d('0x13')][_0x0f8d('0x15')]);return _0x27a2dd(_0x40a03b[_0x0f8d('0x13')][_0x0f8d('0x15')]);}logger[_0x0f8d('0x13')](_0x0f8d('0x16'),_0xe5de2b,_0x40a03b[_0x0f8d('0x13')][_0x0f8d('0x15')]);return _0x36a7f5(_0x40a03b[_0x0f8d('0x13')][_0x0f8d('0x15')]);}else{logger[_0x0f8d('0xf')](_0x0f8d('0x16'),_0xe5de2b,_0x0f8d('0x10'));_0x36a7f5(_0x40a03b['result'][_0x0f8d('0x15')]);}})['catch'](function(_0x5b8fa2){logger[_0x0f8d('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0xe5de2b,_0x5b8fa2);_0x27a2dd(_0x5b8fa2);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 3f465a8..ed86b83 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(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file +var _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x32e43a,_0x19eff3){var _0x218fb9=function(_0x2328c1){while(--_0x2328c1){_0x32e43a['push'](_0x32e43a['shift']());}};_0x218fb9(++_0x19eff3);}(_0x814b,0x1a2));var _0xb814=function(_0x20a822,_0x5dc295){_0x20a822=_0x20a822-0x0;var _0x3775d1=_0x814b[_0x20a822];return _0x3775d1;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index e597ea6..aeb3eda 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 _0x336d=['name','TEXT','exports','STRING'];(function(_0x18e2ef,_0x10c907){var _0x483023=function(_0x476872){while(--_0x476872){_0x18e2ef['push'](_0x18e2ef['shift']());}};_0x483023(++_0x10c907);}(_0x336d,0xae));var _0xd336=function(_0x1d6b06,_0x4173ba){_0x1d6b06=_0x1d6b06-0x0;var _0x37dd35=_0x336d[_0x1d6b06];return _0x37dd35;};'use strict';var Sequelize=require('sequelize');module[_0xd336('0x0')]={'name':{'type':Sequelize[_0xd336('0x1')],'allowNull':![],'unique':_0xd336('0x2')},'table':{'type':Sequelize[_0xd336('0x1')]},'metric':{'type':Sequelize[_0xd336('0x3')]},'description':{'type':Sequelize[_0xd336('0x1')]}}; \ No newline at end of file +var _0x6594=['TEXT','STRING'];(function(_0x6f32da,_0xd805cc){var _0xf6b205=function(_0x5d7dae){while(--_0x5d7dae){_0x6f32da['push'](_0x6f32da['shift']());}};_0xf6b205(++_0xd805cc);}(_0x6594,0xcb));var _0x4659=function(_0x2550ce,_0x45209b){_0x2550ce=_0x2550ce-0x0;var _0x25748d=_0x6594[_0x2550ce];return _0x25748d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x4659('0x0')]},'metric':{'type':Sequelize[_0x4659('0x1')]},'description':{'type':Sequelize[_0x4659('0x0')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 90d7409..0b03e15 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 _0x4024=['lodash','crypto','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','destroy','get','Metrics','UserProfileResource','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','findAll','catch','params','keys','length','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','to-csv','ejs'];(function(_0x47ad1a,_0x467d68){var _0x586211=function(_0x169364){while(--_0x169364){_0x47ad1a['push'](_0x47ad1a['shift']());}};_0x586211(++_0x467d68);}(_0x4024,0x89));var _0x4402=function(_0x56cdb3,_0x67287e){_0x56cdb3=_0x56cdb3-0x0;var _0x1f7b03=_0x4024[_0x56cdb3];return _0x1f7b03;};'use strict';var pdf=require(_0x4402('0x0'));var emlformat=require(_0x4402('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4402('0x2'));var jsonpatch=require(_0x4402('0x3'));var rp=require('request-promise');var moment=require(_0x4402('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4402('0x5'));var util=require(_0x4402('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4402('0x7'));var ejs=require(_0x4402('0x8'));var fs=require('fs');var _=require(_0x4402('0x9'));var squel=require('squel');var crypto=require(_0x4402('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4402('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4402('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x4402('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4402('0xd'));var logger=require('../../config/logger')(_0x4402('0xe'));var utils=require(_0x4402('0xf'));var config=require('../../config/environment');var db=require(_0x4402('0x10'))['db'];function respondWithStatusCode(_0x302c4d,_0xa819e9){_0xa819e9=_0xa819e9||0xcc;return function(_0x4c9032){if(_0x4c9032){return _0x302c4d[_0x4402('0x11')](_0xa819e9);}return _0x302c4d[_0x4402('0x12')](_0xa819e9)[_0x4402('0x13')]();};}function respondWithResult(_0x19d2f4,_0x248ad9){_0x248ad9=_0x248ad9||0xc8;return function(_0x31710c){if(_0x31710c){return _0x19d2f4[_0x4402('0x12')](_0x248ad9)[_0x4402('0x14')](_0x31710c);}};}function respondWithFilteredResult(_0x295ac5,_0x263a57){return function(_0x375166){if(_0x375166){var _0xc03f65=_0x375166[_0x4402('0x15')],_0x2a2ce8=_0x263a57[_0x4402('0x16')],_0x19fe7b=_0x263a57[_0x4402('0x16')]+_0x263a57[_0x4402('0x17')],_0xfd9853;if(_0x19fe7b>=_0xc03f65){_0x19fe7b=_0xc03f65;_0xfd9853=0xc8;}else{_0xfd9853=0xce;}_0x295ac5[_0x4402('0x12')](_0xfd9853);return _0x295ac5['set']('Content-Range',_0x2a2ce8+'-'+_0x19fe7b+'/'+_0xc03f65)[_0x4402('0x14')](_0x375166);}return null;};}function patchUpdates(_0x2a7afc){return function(_0x5681c5){try{jsonpatch[_0x4402('0x18')](_0x5681c5,_0x2a7afc,!![]);}catch(_0x192855){return BPromise['reject'](_0x192855);}return _0x5681c5[_0x4402('0x19')]();};}function saveUpdates(_0x4e0340,_0x55cc8c){return function(_0x1b9599){if(_0x1b9599){return _0x1b9599[_0x4402('0x1a')](_0x4e0340)[_0x4402('0x1b')](function(_0x49bc21){return _0x49bc21;});}return null;};}function removeEntity(_0x42509b,_0x57a25e){return function(_0x47ab54){if(_0x47ab54){return _0x47ab54[_0x4402('0x1c')]()[_0x4402('0x1b')](function(){var _0x110787=_0x47ab54[_0x4402('0x1d')]({'plain':!![]});var _0x258d10=_0x4402('0x1e');return db[_0x4402('0x1f')][_0x4402('0x1c')]({'where':{'type':_0x258d10,'resourceId':_0x110787['id']}})[_0x4402('0x1b')](function(){return _0x47ab54;});})['then'](function(){_0x42509b[_0x4402('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3733cd,_0x5ab28d){return function(_0x29f56b){if(!_0x29f56b){_0x3733cd[_0x4402('0x11')](0x194);}return _0x29f56b;};}function handleError(_0x5a43d0,_0x15c19f){_0x15c19f=_0x15c19f||0x1f4;return function(_0x4e9cb5){logger['error'](_0x4e9cb5[_0x4402('0x20')]);if(_0x4e9cb5[_0x4402('0x21')]){delete _0x4e9cb5[_0x4402('0x21')];}_0x5a43d0[_0x4402('0x12')](_0x15c19f)[_0x4402('0x22')](_0x4e9cb5);};}exports['index']=function(_0x41de44,_0x52e625){var _0x71da2f={},_0x1e2340={},_0x42dd32={'count':0x0,'rows':[]};var _0x48d20d=_[_0x4402('0x23')](db[_0x4402('0x24')][_0x4402('0x25')],function(_0x3f4bcb){return{'name':_0x3f4bcb[_0x4402('0x26')],'type':_0x3f4bcb[_0x4402('0x27')][_0x4402('0x28')]};});_0x1e2340[_0x4402('0x29')]=_[_0x4402('0x23')](_0x48d20d,_0x4402('0x21'));_0x1e2340[_0x4402('0x2a')]=_['keys'](_0x41de44[_0x4402('0x2a')]);_0x1e2340['filters']=_[_0x4402('0x2b')](_0x1e2340['model'],_0x1e2340[_0x4402('0x2a')]);_0x71da2f[_0x4402('0x2c')]=_[_0x4402('0x2b')](_0x1e2340[_0x4402('0x29')],qs[_0x4402('0x2d')](_0x41de44['query'][_0x4402('0x2d')]));_0x71da2f[_0x4402('0x2c')]=_0x71da2f[_0x4402('0x2c')]['length']?_0x71da2f[_0x4402('0x2c')]:_0x1e2340[_0x4402('0x29')];if(!_0x41de44['query'][_0x4402('0x2e')](_0x4402('0x2f'))){_0x71da2f[_0x4402('0x17')]=qs[_0x4402('0x17')](_0x41de44[_0x4402('0x2a')][_0x4402('0x17')]);_0x71da2f[_0x4402('0x16')]=qs[_0x4402('0x16')](_0x41de44[_0x4402('0x2a')]['offset']);}_0x71da2f[_0x4402('0x30')]=qs[_0x4402('0x31')](_0x41de44[_0x4402('0x2a')]['sort']);_0x71da2f[_0x4402('0x32')]=qs[_0x4402('0x33')](_['pick'](_0x41de44['query'],_0x1e2340[_0x4402('0x33')]),_0x48d20d);if(_0x41de44[_0x4402('0x2a')][_0x4402('0x34')]){_0x71da2f[_0x4402('0x32')]=_['merge'](_0x71da2f['where'],{'$or':_['map'](_0x48d20d,function(_0x3a5e62){if(_0x3a5e62[_0x4402('0x27')]!==_0x4402('0x35')){var _0x3fd8ce={};_0x3fd8ce[_0x3a5e62['name']]={'$like':'%'+_0x41de44[_0x4402('0x2a')][_0x4402('0x34')]+'%'};return _0x3fd8ce;}})});}_0x71da2f=_[_0x4402('0x36')]({},_0x71da2f,_0x41de44['options']);var _0x2b92b7={'where':_0x71da2f['where']};return db[_0x4402('0x24')][_0x4402('0x15')](_0x2b92b7)['then'](function(_0x16ef2e){_0x42dd32['count']=_0x16ef2e;if(_0x41de44[_0x4402('0x2a')][_0x4402('0x37')]){_0x71da2f['include']=[{'all':!![]}];}return db[_0x4402('0x24')][_0x4402('0x38')](_0x71da2f);})[_0x4402('0x1b')](function(_0x23c43a){_0x42dd32['rows']=_0x23c43a;return _0x42dd32;})['then'](respondWithFilteredResult(_0x52e625,_0x71da2f))[_0x4402('0x39')](handleError(_0x52e625,null));};exports['show']=function(_0x3a589b,_0x2a6d78){var _0xb9cf85={'raw':!![],'where':{'id':_0x3a589b[_0x4402('0x3a')]['id']}},_0x2e2391={};_0x2e2391[_0x4402('0x29')]=_[_0x4402('0x3b')](db[_0x4402('0x24')][_0x4402('0x25')]);_0x2e2391[_0x4402('0x2a')]=_['keys'](_0x3a589b[_0x4402('0x2a')]);_0x2e2391[_0x4402('0x33')]=_['intersection'](_0x2e2391[_0x4402('0x29')],_0x2e2391[_0x4402('0x2a')]);_0xb9cf85['attributes']=_[_0x4402('0x2b')](_0x2e2391[_0x4402('0x29')],qs[_0x4402('0x2d')](_0x3a589b[_0x4402('0x2a')][_0x4402('0x2d')]));_0xb9cf85['attributes']=_0xb9cf85[_0x4402('0x2c')][_0x4402('0x3c')]?_0xb9cf85[_0x4402('0x2c')]:_0x2e2391[_0x4402('0x29')];if(_0x3a589b[_0x4402('0x2a')][_0x4402('0x37')]){_0xb9cf85[_0x4402('0x3d')]=[{'all':!![]}];}_0xb9cf85=_[_0x4402('0x36')]({},_0xb9cf85,_0x3a589b[_0x4402('0x3e')]);return db[_0x4402('0x24')][_0x4402('0x3f')](_0xb9cf85)['then'](handleEntityNotFound(_0x2a6d78,null))[_0x4402('0x1b')](respondWithResult(_0x2a6d78,null))['catch'](handleError(_0x2a6d78,null));};exports[_0x4402('0x40')]=function(_0x34ce00,_0x54e67a){return db[_0x4402('0x24')][_0x4402('0x40')](_0x34ce00[_0x4402('0x41')],{})[_0x4402('0x1b')](function(_0x4436b2){var _0x2503eb=_0x34ce00['user'][_0x4402('0x1d')]({'plain':!![]});if(!_0x2503eb)throw new Error(_0x4402('0x42'));if(_0x2503eb[_0x4402('0x43')]===_0x4402('0x44')){var _0x2b2ed3=_0x4436b2[_0x4402('0x1d')]({'plain':!![]});var _0x43cfbd=_0x4402('0x1e');return db[_0x4402('0x45')]['find']({'where':{'name':_0x43cfbd,'userProfileId':_0x2503eb['userProfileId']},'raw':!![]})['then'](function(_0x4c2d2e){if(_0x4c2d2e&&_0x4c2d2e[_0x4402('0x46')]===0x0){return db[_0x4402('0x1f')][_0x4402('0x40')]({'name':_0x2b2ed3[_0x4402('0x21')],'resourceId':_0x2b2ed3['id'],'type':_0x4c2d2e['name'],'sectionId':_0x4c2d2e['id']},{})[_0x4402('0x1b')](function(){return _0x4436b2;});}else{return _0x4436b2;}})[_0x4402('0x39')](function(_0x203b33){logger[_0x4402('0x47')](_0x4402('0x48'),_0x203b33);throw _0x203b33;});}return _0x4436b2;})[_0x4402('0x1b')](respondWithResult(_0x54e67a,0xc9))[_0x4402('0x39')](handleError(_0x54e67a,null));};exports['update']=function(_0x325b20,_0x2a8085){if(_0x325b20[_0x4402('0x41')]['id']){delete _0x325b20[_0x4402('0x41')]['id'];}return db[_0x4402('0x24')][_0x4402('0x3f')]({'where':{'id':_0x325b20['params']['id']}})[_0x4402('0x1b')](handleEntityNotFound(_0x2a8085,null))[_0x4402('0x1b')](saveUpdates(_0x325b20[_0x4402('0x41')],null))[_0x4402('0x1b')](respondWithResult(_0x2a8085,null))[_0x4402('0x39')](handleError(_0x2a8085,null));};exports[_0x4402('0x1c')]=function(_0x137d88,_0x5dbf62){return db['AnalyticMetric'][_0x4402('0x3f')]({'where':{'id':_0x137d88[_0x4402('0x3a')]['id']}})[_0x4402('0x1b')](handleEntityNotFound(_0x5dbf62,null))['then'](removeEntity(_0x5dbf62,null))['catch'](handleError(_0x5dbf62,null));}; \ No newline at end of file +var _0xd290=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','AnalyticMetric','includeAll','include','findAll','rows','catch','show','params','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','Metrics','UserProfileResource','sendStatus','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields'];(function(_0x34cf18,_0x12faa6){var _0x4376f6=function(_0x3aff87){while(--_0x3aff87){_0x34cf18['push'](_0x34cf18['shift']());}};_0x4376f6(++_0x12faa6);}(_0xd290,0x165));var _0x0d29=function(_0x313cb5,_0x14e880){_0x313cb5=_0x313cb5-0x0;var _0x28dc82=_0xd290[_0x313cb5];return _0x28dc82;};'use strict';var pdf=require(_0x0d29('0x0'));var emlformat=require(_0x0d29('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0d29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0d29('0x3'));var BPromise=require(_0x0d29('0x4'));var Mustache=require(_0x0d29('0x5'));var util=require(_0x0d29('0x6'));var path=require(_0x0d29('0x7'));var sox=require('sox');var csv=require(_0x0d29('0x8'));var ejs=require(_0x0d29('0x9'));var fs=require('fs');var _=require(_0x0d29('0xa'));var squel=require(_0x0d29('0xb'));var crypto=require(_0x0d29('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0d29('0xd'));var toCsv=require(_0x0d29('0x8'));var querystring=require(_0x0d29('0xe'));var Papa=require('papaparse');var Redis=require(_0x0d29('0xf'));var authService=require(_0x0d29('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0d29('0x11'));var hardwareService=require(_0x0d29('0x12'));var logger=require('../../config/logger')(_0x0d29('0x13'));var utils=require('../../config/utils');var config=require(_0x0d29('0x14'));var db=require(_0x0d29('0x15'))['db'];function respondWithStatusCode(_0x259768,_0x87cf36){_0x87cf36=_0x87cf36||0xcc;return function(_0x1b8787){if(_0x1b8787){return _0x259768['sendStatus'](_0x87cf36);}return _0x259768[_0x0d29('0x16')](_0x87cf36)[_0x0d29('0x17')]();};}function respondWithResult(_0x26d2b6,_0x94b2f5){_0x94b2f5=_0x94b2f5||0xc8;return function(_0x1a0f48){if(_0x1a0f48){return _0x26d2b6['status'](_0x94b2f5)['json'](_0x1a0f48);}};}function respondWithFilteredResult(_0x49f132,_0x247d1d){return function(_0x4acfd6){if(_0x4acfd6){var _0x44fe29=_0x4acfd6[_0x0d29('0x18')],_0x4c4044=_0x247d1d[_0x0d29('0x19')],_0x3131e1=_0x247d1d[_0x0d29('0x19')]+_0x247d1d[_0x0d29('0x1a')],_0x396172;if(_0x3131e1>=_0x44fe29){_0x3131e1=_0x44fe29;_0x396172=0xc8;}else{_0x396172=0xce;}_0x49f132['status'](_0x396172);return _0x49f132[_0x0d29('0x1b')](_0x0d29('0x1c'),_0x4c4044+'-'+_0x3131e1+'/'+_0x44fe29)[_0x0d29('0x1d')](_0x4acfd6);}return null;};}function patchUpdates(_0x24e774){return function(_0xd3ccf3){try{jsonpatch[_0x0d29('0x1e')](_0xd3ccf3,_0x24e774,!![]);}catch(_0x37dbc5){return BPromise['reject'](_0x37dbc5);}return _0xd3ccf3[_0x0d29('0x1f')]();};}function saveUpdates(_0x11d2ec,_0x215cd7){return function(_0x138465){if(_0x138465){return _0x138465[_0x0d29('0x20')](_0x11d2ec)[_0x0d29('0x21')](function(_0x392394){return _0x392394;});}return null;};}function removeEntity(_0x822a9a,_0x44fbce){return function(_0xed8228){if(_0xed8228){return _0xed8228[_0x0d29('0x22')]()[_0x0d29('0x21')](function(){var _0xb9fffc=_0xed8228['get']({'plain':!![]});var _0x30e109=_0x0d29('0x23');return db[_0x0d29('0x24')][_0x0d29('0x22')]({'where':{'type':_0x30e109,'resourceId':_0xb9fffc['id']}})['then'](function(){return _0xed8228;});})[_0x0d29('0x21')](function(){_0x822a9a[_0x0d29('0x16')](0xcc)[_0x0d29('0x17')]();});}};}function handleEntityNotFound(_0xceff8a,_0x887384){return function(_0x1f4451){if(!_0x1f4451){_0xceff8a[_0x0d29('0x25')](0x194);}return _0x1f4451;};}function handleError(_0x4a9d6f,_0x511281){_0x511281=_0x511281||0x1f4;return function(_0x2f1814){logger['error'](_0x2f1814[_0x0d29('0x26')]);if(_0x2f1814['name']){delete _0x2f1814['name'];}_0x4a9d6f[_0x0d29('0x16')](_0x511281)['send'](_0x2f1814);};}exports[_0x0d29('0x27')]=function(_0x5c197f,_0x230097){var _0x2f7202={},_0x4d274e={},_0x37f925={'count':0x0,'rows':[]};var _0xcda103=_[_0x0d29('0x28')](db['AnalyticMetric'][_0x0d29('0x29')],function(_0x3a22a1){return{'name':_0x3a22a1[_0x0d29('0x2a')],'type':_0x3a22a1[_0x0d29('0x2b')][_0x0d29('0x2c')]};});_0x4d274e[_0x0d29('0x2d')]=_[_0x0d29('0x28')](_0xcda103,_0x0d29('0x2e'));_0x4d274e[_0x0d29('0x2f')]=_[_0x0d29('0x30')](_0x5c197f['query']);_0x4d274e[_0x0d29('0x31')]=_[_0x0d29('0x32')](_0x4d274e[_0x0d29('0x2d')],_0x4d274e[_0x0d29('0x2f')]);_0x2f7202[_0x0d29('0x33')]=_[_0x0d29('0x32')](_0x4d274e['model'],qs[_0x0d29('0x34')](_0x5c197f[_0x0d29('0x2f')][_0x0d29('0x34')]));_0x2f7202[_0x0d29('0x33')]=_0x2f7202[_0x0d29('0x33')][_0x0d29('0x35')]?_0x2f7202[_0x0d29('0x33')]:_0x4d274e['model'];if(!_0x5c197f[_0x0d29('0x2f')][_0x0d29('0x36')](_0x0d29('0x37'))){_0x2f7202[_0x0d29('0x1a')]=qs[_0x0d29('0x1a')](_0x5c197f[_0x0d29('0x2f')]['limit']);_0x2f7202[_0x0d29('0x19')]=qs['offset'](_0x5c197f[_0x0d29('0x2f')][_0x0d29('0x19')]);}_0x2f7202[_0x0d29('0x38')]=qs[_0x0d29('0x39')](_0x5c197f[_0x0d29('0x2f')]['sort']);_0x2f7202[_0x0d29('0x3a')]=qs[_0x0d29('0x31')](_[_0x0d29('0x3b')](_0x5c197f['query'],_0x4d274e[_0x0d29('0x31')]),_0xcda103);if(_0x5c197f[_0x0d29('0x2f')][_0x0d29('0x3c')]){_0x2f7202['where']=_['merge'](_0x2f7202[_0x0d29('0x3a')],{'$or':_[_0x0d29('0x28')](_0xcda103,function(_0x24a679){if(_0x24a679[_0x0d29('0x2b')]!=='VIRTUAL'){var _0x34db8b={};_0x34db8b[_0x24a679[_0x0d29('0x2e')]]={'$like':'%'+_0x5c197f[_0x0d29('0x2f')]['filter']+'%'};return _0x34db8b;}})});}_0x2f7202=_['merge']({},_0x2f7202,_0x5c197f['options']);var _0x5a1a25={'where':_0x2f7202[_0x0d29('0x3a')]};return db[_0x0d29('0x3d')]['count'](_0x5a1a25)[_0x0d29('0x21')](function(_0x3c46e9){_0x37f925[_0x0d29('0x18')]=_0x3c46e9;if(_0x5c197f[_0x0d29('0x2f')][_0x0d29('0x3e')]){_0x2f7202[_0x0d29('0x3f')]=[{'all':!![]}];}return db[_0x0d29('0x3d')][_0x0d29('0x40')](_0x2f7202);})[_0x0d29('0x21')](function(_0x568a01){_0x37f925[_0x0d29('0x41')]=_0x568a01;return _0x37f925;})['then'](respondWithFilteredResult(_0x230097,_0x2f7202))[_0x0d29('0x42')](handleError(_0x230097,null));};exports[_0x0d29('0x43')]=function(_0x2cfbd4,_0x831055){var _0x3bf16e={'raw':!![],'where':{'id':_0x2cfbd4[_0x0d29('0x44')]['id']}},_0x433fce={};_0x433fce[_0x0d29('0x2d')]=_[_0x0d29('0x30')](db[_0x0d29('0x3d')]['rawAttributes']);_0x433fce[_0x0d29('0x2f')]=_['keys'](_0x2cfbd4['query']);_0x433fce[_0x0d29('0x31')]=_['intersection'](_0x433fce[_0x0d29('0x2d')],_0x433fce[_0x0d29('0x2f')]);_0x3bf16e[_0x0d29('0x33')]=_[_0x0d29('0x32')](_0x433fce[_0x0d29('0x2d')],qs[_0x0d29('0x34')](_0x2cfbd4[_0x0d29('0x2f')]['fields']));_0x3bf16e[_0x0d29('0x33')]=_0x3bf16e['attributes'][_0x0d29('0x35')]?_0x3bf16e['attributes']:_0x433fce['model'];if(_0x2cfbd4[_0x0d29('0x2f')][_0x0d29('0x3e')]){_0x3bf16e[_0x0d29('0x3f')]=[{'all':!![]}];}_0x3bf16e=_[_0x0d29('0x45')]({},_0x3bf16e,_0x2cfbd4[_0x0d29('0x46')]);return db[_0x0d29('0x3d')]['find'](_0x3bf16e)[_0x0d29('0x21')](handleEntityNotFound(_0x831055,null))['then'](respondWithResult(_0x831055,null))['catch'](handleError(_0x831055,null));};exports[_0x0d29('0x47')]=function(_0x324ee8,_0x5bcaec){return db['AnalyticMetric']['create'](_0x324ee8[_0x0d29('0x48')],{})[_0x0d29('0x21')](function(_0x3c014a){var _0x241ea1=_0x324ee8['user'][_0x0d29('0x49')]({'plain':!![]});if(!_0x241ea1)throw new Error(_0x0d29('0x4a'));if(_0x241ea1['role']===_0x0d29('0x4b')){var _0x33c67f=_0x3c014a[_0x0d29('0x49')]({'plain':!![]});var _0x366260='Metrics';return db[_0x0d29('0x4c')]['find']({'where':{'name':_0x366260,'userProfileId':_0x241ea1[_0x0d29('0x4d')]},'raw':!![]})[_0x0d29('0x21')](function(_0x3c6513){if(_0x3c6513&&_0x3c6513[_0x0d29('0x4e')]===0x0){return db[_0x0d29('0x24')][_0x0d29('0x47')]({'name':_0x33c67f[_0x0d29('0x2e')],'resourceId':_0x33c67f['id'],'type':_0x3c6513[_0x0d29('0x2e')],'sectionId':_0x3c6513['id']},{})[_0x0d29('0x21')](function(){return _0x3c014a;});}else{return _0x3c014a;}})[_0x0d29('0x42')](function(_0x4ba640){logger[_0x0d29('0x4f')](_0x0d29('0x50'),_0x4ba640);throw _0x4ba640;});}return _0x3c014a;})[_0x0d29('0x21')](respondWithResult(_0x5bcaec,0xc9))[_0x0d29('0x42')](handleError(_0x5bcaec,null));};exports['update']=function(_0x4ae9ff,_0x1220cf){if(_0x4ae9ff['body']['id']){delete _0x4ae9ff['body']['id'];}return db[_0x0d29('0x3d')][_0x0d29('0x51')]({'where':{'id':_0x4ae9ff['params']['id']}})[_0x0d29('0x21')](handleEntityNotFound(_0x1220cf,null))[_0x0d29('0x21')](saveUpdates(_0x4ae9ff['body'],null))[_0x0d29('0x21')](respondWithResult(_0x1220cf,null))['catch'](handleError(_0x1220cf,null));};exports[_0x0d29('0x22')]=function(_0xf41b5e,_0x4b77d8){return db[_0x0d29('0x3d')][_0x0d29('0x51')]({'where':{'id':_0xf41b5e[_0x0d29('0x44')]['id']}})['then'](handleEntityNotFound(_0x4b77d8,null))[_0x0d29('0x21')](removeEntity(_0x4b77d8,null))['catch'](handleError(_0x4b77d8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 709f459..02d51e8 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 _0xf9a7=['../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x3d07a2,_0x34306c){var _0x1afa35=function(_0x4128ba){while(--_0x4128ba){_0x3d07a2['push'](_0x3d07a2['shift']());}};_0x1afa35(++_0x34306c);}(_0xf9a7,0xc5));var _0x7f9a=function(_0x4212ad,_0x2d4232){_0x4212ad=_0x4212ad-0x0;var _0x3b666d=_0xf9a7[_0x4212ad];return _0x3b666d;};'use strict';var _=require(_0x7f9a('0x0'));var util=require(_0x7f9a('0x1'));var logger=require('../../config/logger')(_0x7f9a('0x2'));var moment=require(_0x7f9a('0x3'));var BPromise=require(_0x7f9a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f9a('0x5'));var rimraf=require(_0x7f9a('0x6'));var config=require(_0x7f9a('0x7'));var attributes=require(_0x7f9a('0x8'));module['exports']=function(_0x324542,_0x5c95dd){return _0x324542[_0x7f9a('0x9')](_0x7f9a('0xa'),attributes,{'tableName':_0x7f9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb26a=['moment','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','../../config/logger','api'];(function(_0x362733,_0x46e9fa){var _0x4fccca=function(_0x57289e){while(--_0x57289e){_0x362733['push'](_0x362733['shift']());}};_0x4fccca(++_0x46e9fa);}(_0xb26a,0x6a));var _0xab26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb26a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab26('0x0'))(_0xab26('0x1'));var moment=require(_0xab26('0x2'));var BPromise=require('bluebird');var rp=require(_0xab26('0x3'));var fs=require('fs');var path=require(_0xab26('0x4'));var rimraf=require(_0xab26('0x5'));var config=require(_0xab26('0x6'));var attributes=require(_0xab26('0x7'));module[_0xab26('0x8')]=function(_0x97ad6a,_0x25b25a){return _0x97ad6a[_0xab26('0x9')](_0xab26('0xa'),attributes,{'tableName':_0xab26('0xb'),'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 43c3987..785367e 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 _0x4524=['stringify','error','code','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xdfb0e5,_0x205b9a){var _0x2b24f2=function(_0x290a75){while(--_0x290a75){_0xdfb0e5['push'](_0xdfb0e5['shift']());}};_0x2b24f2(++_0x205b9a);}(_0x4524,0x16a));var _0x4452=function(_0x573819,_0x54c1d4){_0x573819=_0x573819-0x0;var _0x103e4a=_0x4524[_0x573819];return _0x103e4a;};'use strict';var _=require(_0x4452('0x0'));var util=require(_0x4452('0x1'));var moment=require('moment');var BPromise=require(_0x4452('0x2'));var rs=require(_0x4452('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4452('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4452('0x5'))(_0x4452('0x6'));var config=require(_0x4452('0x7'));var jayson=require(_0x4452('0x8'));var client=jayson[_0x4452('0x9')][_0x4452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a6f5d,_0x1dbaf4,_0x2f2453){return new BPromise(function(_0x4589d9,_0x133518){return client[_0x4452('0xb')](_0x3a6f5d,_0x2f2453)[_0x4452('0xc')](function(_0x3c2aa0){logger['info'](_0x4452('0xd'),_0x1dbaf4,_0x4452('0xe'));logger[_0x4452('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x1dbaf4,_0x4452('0xe'),JSON[_0x4452('0x10')](_0x3c2aa0));if(_0x3c2aa0['error']){if(_0x3c2aa0[_0x4452('0x11')][_0x4452('0x12')]===0x1f4){logger[_0x4452('0x11')](_0x4452('0xd'),_0x1dbaf4,_0x3c2aa0['error'][_0x4452('0x13')]);return _0x133518(_0x3c2aa0[_0x4452('0x11')][_0x4452('0x13')]);}logger[_0x4452('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x1dbaf4,_0x3c2aa0[_0x4452('0x11')][_0x4452('0x13')]);return _0x4589d9(_0x3c2aa0['error']['message']);}else{logger['info'](_0x4452('0xd'),_0x1dbaf4,_0x4452('0xe'));_0x4589d9(_0x3c2aa0[_0x4452('0x14')][_0x4452('0x13')]);}})['catch'](function(_0x4a2635){logger['error'](_0x4452('0xd'),_0x1dbaf4,_0x4a2635);_0x133518(_0x4a2635);});});} \ No newline at end of file +var _0x7890=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7890,0xc3));var _0x0789=function(_0xf1d250,_0x3aafc5){_0xf1d250=_0xf1d250-0x0;var _0x58a35d=_0x7890[_0xf1d250];return _0x58a35d;};'use strict';var _=require(_0x0789('0x0'));var util=require('util');var moment=require(_0x0789('0x1'));var BPromise=require(_0x0789('0x2'));var rs=require(_0x0789('0x3'));var fs=require('fs');var Redis=require(_0x0789('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0789('0x5'));var logger=require('../../config/logger')(_0x0789('0x6'));var config=require(_0x0789('0x7'));var jayson=require(_0x0789('0x8'));var client=jayson[_0x0789('0x9')][_0x0789('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17f122,_0xa61761,_0x17fbc3){return new BPromise(function(_0x129a32,_0x54b76b){return client['request'](_0x17f122,_0x17fbc3)[_0x0789('0xb')](function(_0x41fb0d){logger[_0x0789('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0xa61761,_0x0789('0xd'));logger[_0x0789('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0xa61761,_0x0789('0xd'),JSON[_0x0789('0xf')](_0x41fb0d));if(_0x41fb0d[_0x0789('0x10')]){if(_0x41fb0d[_0x0789('0x10')][_0x0789('0x11')]===0x1f4){logger[_0x0789('0x10')](_0x0789('0x12'),_0xa61761,_0x41fb0d[_0x0789('0x10')][_0x0789('0x13')]);return _0x54b76b(_0x41fb0d['error'][_0x0789('0x13')]);}logger['error'](_0x0789('0x12'),_0xa61761,_0x41fb0d[_0x0789('0x10')][_0x0789('0x13')]);return _0x129a32(_0x41fb0d[_0x0789('0x10')][_0x0789('0x13')]);}else{logger[_0x0789('0xc')](_0x0789('0x12'),_0xa61761,_0x0789('0xd'));_0x129a32(_0x41fb0d[_0x0789('0x14')]['message']);}})[_0x0789('0x15')](function(_0x24cfa2){logger[_0x0789('0x10')](_0x0789('0x12'),_0xa61761,_0x24cfa2);_0x54b76b(_0x24cfa2);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index d9782d0..63d0460 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 _0x326f=['show','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x326f,0xd1));var _0xf326=function(_0x112eb0,_0x401288){_0x112eb0=_0x112eb0-0x0;var _0x181076=_0x326f[_0x112eb0];return _0x181076;};'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 +var _0xf494=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x2553ec,_0x2c39ab){var _0x3b730a=function(_0x21ee6b){while(--_0x21ee6b){_0x2553ec['push'](_0x2553ec['shift']());}};_0x3b730a(++_0x2c39ab);}(_0xf494,0x1c6));var _0x4f49=function(_0x1d58c2,_0x42a7f6){_0x1d58c2=_0x1d58c2-0x0;var _0x519d20=_0xf494[_0x1d58c2];return _0x519d20;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xb')]);router[_0x4f49('0x9')](_0x4f49('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4f49('0xd')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xc'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')]('/:id',auth[_0x4f49('0xa')](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index ff702d4..9faa320 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 _0x5c37=['exports','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5c37,0x64));var _0x75c3=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0x5c37[_0x457b64];return _0x437111;};'use strict';var Sequelize=require('sequelize');module[_0x75c3('0x0')]={'tree':{'type':Sequelize[_0x75c3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x2fa5=['TEXT','sequelize'];(function(_0x138523,_0x5e9d11){var _0x2cf065=function(_0x1da1c2){while(--_0x1da1c2){_0x138523['push'](_0x138523['shift']());}};_0x2cf065(++_0x5e9d11);}(_0x2fa5,0x81));var _0x52fa=function(_0x41f9b4,_0x3eb163){_0x41f9b4=_0x41f9b4-0x0;var _0x575c67=_0x2fa5[_0x41f9b4];return _0x575c67;};'use strict';var Sequelize=require(_0x52fa('0x0'));module['exports']={'tree':{'type':Sequelize[_0x52fa('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 830f78e..d245637 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 _0xbcfe=['to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../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','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','keys','find','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x165320,_0x2626f2){var _0x2dfda3=function(_0x33cd81){while(--_0x33cd81){_0x165320['push'](_0x165320['shift']());}};_0x2dfda3(++_0x2626f2);}(_0xbcfe,0x1b7));var _0xebcf=function(_0x49417a,_0x1d7efa){_0x49417a=_0x49417a-0x0;var _0x22badb=_0xbcfe[_0x49417a];return _0x22badb;};'use strict';var pdf=require(_0xebcf('0x0'));var emlformat=require(_0xebcf('0x1'));var rimraf=require(_0xebcf('0x2'));var zipdir=require(_0xebcf('0x3'));var jsonpatch=require(_0xebcf('0x4'));var rp=require('request-promise');var moment=require(_0xebcf('0x5'));var BPromise=require(_0xebcf('0x6'));var Mustache=require(_0xebcf('0x7'));var util=require(_0xebcf('0x8'));var path=require(_0xebcf('0x9'));var sox=require(_0xebcf('0xa'));var csv=require(_0xebcf('0xb'));var ejs=require(_0xebcf('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xebcf('0xd'));var crypto=require(_0xebcf('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xebcf('0xb'));var querystring=require(_0xebcf('0xf'));var Papa=require(_0xebcf('0x10'));var Redis=require('ioredis');var authService=require(_0xebcf('0x11'));var qs=require(_0xebcf('0x12'));var as=require(_0xebcf('0x13'));var hardwareService=require(_0xebcf('0x14'));var logger=require(_0xebcf('0x15'))(_0xebcf('0x16'));var utils=require(_0xebcf('0x17'));var config=require('../../config/environment');var db=require(_0xebcf('0x18'))['db'];function respondWithStatusCode(_0x2c503e,_0x9bc3c){_0x9bc3c=_0x9bc3c||0xcc;return function(_0xcc2b1a){if(_0xcc2b1a){return _0x2c503e[_0xebcf('0x19')](_0x9bc3c);}return _0x2c503e[_0xebcf('0x1a')](_0x9bc3c)[_0xebcf('0x1b')]();};}function respondWithResult(_0x43f3e0,_0x151560){_0x151560=_0x151560||0xc8;return function(_0x3236bc){if(_0x3236bc){return _0x43f3e0[_0xebcf('0x1a')](_0x151560)[_0xebcf('0x1c')](_0x3236bc);}};}function respondWithFilteredResult(_0x42dcfb,_0x4244eb){return function(_0x3365d9){if(_0x3365d9){var _0x29e6c0=_0x3365d9[_0xebcf('0x1d')],_0x3e40a8=_0x4244eb[_0xebcf('0x1e')],_0x5e1956=_0x4244eb[_0xebcf('0x1e')]+_0x4244eb[_0xebcf('0x1f')],_0x16378f;if(_0x5e1956>=_0x29e6c0){_0x5e1956=_0x29e6c0;_0x16378f=0xc8;}else{_0x16378f=0xce;}_0x42dcfb[_0xebcf('0x1a')](_0x16378f);return _0x42dcfb[_0xebcf('0x20')](_0xebcf('0x21'),_0x3e40a8+'-'+_0x5e1956+'/'+_0x29e6c0)[_0xebcf('0x1c')](_0x3365d9);}return null;};}function patchUpdates(_0x20d12e){return function(_0xdec3d7){try{jsonpatch[_0xebcf('0x22')](_0xdec3d7,_0x20d12e,!![]);}catch(_0x2e9c7c){return BPromise[_0xebcf('0x23')](_0x2e9c7c);}return _0xdec3d7[_0xebcf('0x24')]();};}function saveUpdates(_0x41741b,_0x151111){return function(_0x38fc7c){if(_0x38fc7c){return _0x38fc7c[_0xebcf('0x25')](_0x41741b)[_0xebcf('0x26')](function(_0x4e0360){return _0x4e0360;});}return null;};}function removeEntity(_0x41cfb9,_0xdbe276){return function(_0x26f4cc){if(_0x26f4cc){return _0x26f4cc['destroy']()[_0xebcf('0x26')](function(){_0x41cfb9['status'](0xcc)[_0xebcf('0x1b')]();});}};}function handleEntityNotFound(_0x3c8f0a,_0x3f572d){return function(_0x4423b1){if(!_0x4423b1){_0x3c8f0a[_0xebcf('0x19')](0x194);}return _0x4423b1;};}function handleError(_0x442706,_0x56bed1){_0x56bed1=_0x56bed1||0x1f4;return function(_0x12e14a){logger[_0xebcf('0x27')](_0x12e14a[_0xebcf('0x28')]);if(_0x12e14a[_0xebcf('0x29')]){delete _0x12e14a[_0xebcf('0x29')];}_0x442706[_0xebcf('0x1a')](_0x56bed1)['send'](_0x12e14a);};}exports[_0xebcf('0x2a')]=function(_0x2166e3,_0x1a9cff){var _0x943b6b={},_0xba4cd5={},_0x10e5b3={'count':0x0,'rows':[]};var _0x28fbf8=_['map'](db['AnalyticTreeReport'][_0xebcf('0x2b')],function(_0x355ab8){return{'name':_0x355ab8[_0xebcf('0x2c')],'type':_0x355ab8['type'][_0xebcf('0x2d')]};});_0xba4cd5[_0xebcf('0x2e')]=_[_0xebcf('0x2f')](_0x28fbf8,_0xebcf('0x29'));_0xba4cd5[_0xebcf('0x30')]=_['keys'](_0x2166e3[_0xebcf('0x30')]);_0xba4cd5[_0xebcf('0x31')]=_[_0xebcf('0x32')](_0xba4cd5['model'],_0xba4cd5['query']);_0x943b6b['attributes']=_[_0xebcf('0x32')](_0xba4cd5[_0xebcf('0x2e')],qs[_0xebcf('0x33')](_0x2166e3[_0xebcf('0x30')][_0xebcf('0x33')]));_0x943b6b[_0xebcf('0x34')]=_0x943b6b['attributes'][_0xebcf('0x35')]?_0x943b6b[_0xebcf('0x34')]:_0xba4cd5[_0xebcf('0x2e')];if(!_0x2166e3[_0xebcf('0x30')][_0xebcf('0x36')](_0xebcf('0x37'))){_0x943b6b[_0xebcf('0x1f')]=qs[_0xebcf('0x1f')](_0x2166e3[_0xebcf('0x30')][_0xebcf('0x1f')]);_0x943b6b[_0xebcf('0x1e')]=qs[_0xebcf('0x1e')](_0x2166e3[_0xebcf('0x30')][_0xebcf('0x1e')]);}_0x943b6b[_0xebcf('0x38')]=qs[_0xebcf('0x39')](_0x2166e3[_0xebcf('0x30')][_0xebcf('0x39')]);_0x943b6b['where']=qs[_0xebcf('0x31')](_[_0xebcf('0x3a')](_0x2166e3[_0xebcf('0x30')],_0xba4cd5[_0xebcf('0x31')]),_0x28fbf8);if(_0x2166e3['query'][_0xebcf('0x3b')]){_0x943b6b['where']=_['merge'](_0x943b6b[_0xebcf('0x3c')],{'$or':_[_0xebcf('0x2f')](_0x28fbf8,function(_0x49c22d){if(_0x49c22d['type']!==_0xebcf('0x3d')){var _0x5548d5={};_0x5548d5[_0x49c22d['name']]={'$like':'%'+_0x2166e3['query'][_0xebcf('0x3b')]+'%'};return _0x5548d5;}})});}_0x943b6b=_[_0xebcf('0x3e')]({},_0x943b6b,_0x2166e3[_0xebcf('0x3f')]);var _0x5b903b={'where':_0x943b6b[_0xebcf('0x3c')]};return db[_0xebcf('0x40')][_0xebcf('0x1d')](_0x5b903b)[_0xebcf('0x26')](function(_0x38fbea){_0x10e5b3[_0xebcf('0x1d')]=_0x38fbea;if(_0x2166e3[_0xebcf('0x30')][_0xebcf('0x41')]){_0x943b6b[_0xebcf('0x42')]=[{'all':!![]}];}return db[_0xebcf('0x40')][_0xebcf('0x43')](_0x943b6b);})['then'](function(_0x41b7a4){_0x10e5b3[_0xebcf('0x44')]=_0x41b7a4;return _0x10e5b3;})['then'](respondWithFilteredResult(_0x1a9cff,_0x943b6b))[_0xebcf('0x45')](handleError(_0x1a9cff,null));};exports[_0xebcf('0x46')]=function(_0x5c82b3,_0x38116c){var _0x101ac8={'raw':!![],'where':{'id':_0x5c82b3[_0xebcf('0x47')]['id']}},_0x266818={};_0x266818[_0xebcf('0x2e')]=_[_0xebcf('0x48')](db[_0xebcf('0x40')][_0xebcf('0x2b')]);_0x266818[_0xebcf('0x30')]=_['keys'](_0x5c82b3[_0xebcf('0x30')]);_0x266818[_0xebcf('0x31')]=_[_0xebcf('0x32')](_0x266818['model'],_0x266818['query']);_0x101ac8[_0xebcf('0x34')]=_[_0xebcf('0x32')](_0x266818[_0xebcf('0x2e')],qs[_0xebcf('0x33')](_0x5c82b3[_0xebcf('0x30')][_0xebcf('0x33')]));_0x101ac8[_0xebcf('0x34')]=_0x101ac8[_0xebcf('0x34')][_0xebcf('0x35')]?_0x101ac8['attributes']:_0x266818['model'];if(_0x5c82b3[_0xebcf('0x30')][_0xebcf('0x41')]){_0x101ac8[_0xebcf('0x42')]=[{'all':!![]}];}_0x101ac8=_['merge']({},_0x101ac8,_0x5c82b3[_0xebcf('0x3f')]);return db[_0xebcf('0x40')][_0xebcf('0x49')](_0x101ac8)[_0xebcf('0x26')](handleEntityNotFound(_0x38116c,null))['then'](respondWithResult(_0x38116c,null))[_0xebcf('0x45')](handleError(_0x38116c,null));};exports['create']=function(_0x2290ec,_0x2cbf93){return db['AnalyticTreeReport']['create'](_0x2290ec[_0xebcf('0x4a')],{})[_0xebcf('0x26')](respondWithResult(_0x2cbf93,0xc9))[_0xebcf('0x45')](handleError(_0x2cbf93,null));};exports[_0xebcf('0x25')]=function(_0x1ad7d0,_0xb690ca){if(_0x1ad7d0['body']['id']){delete _0x1ad7d0[_0xebcf('0x4a')]['id'];}return db[_0xebcf('0x40')][_0xebcf('0x49')]({'where':{'id':_0x1ad7d0[_0xebcf('0x47')]['id']}})[_0xebcf('0x26')](handleEntityNotFound(_0xb690ca,null))[_0xebcf('0x26')](saveUpdates(_0x1ad7d0[_0xebcf('0x4a')],null))[_0xebcf('0x26')](respondWithResult(_0xb690ca,null))[_0xebcf('0x45')](handleError(_0xb690ca,null));};exports['destroy']=function(_0x4e21f1,_0x38e20f){return db['AnalyticTreeReport'][_0xebcf('0x49')]({'where':{'id':_0x4e21f1[_0xebcf('0x47')]['id']}})[_0xebcf('0x26')](handleEntityNotFound(_0x38e20f,null))[_0xebcf('0x26')](removeEntity(_0x38e20f,null))[_0xebcf('0x45')](handleError(_0x38e20f,null));}; \ No newline at end of file +var _0xdb27=['filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','merge','find','create','body','params','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x5736ea,_0x4b2d48){var _0x66457e=function(_0x41b7b6){while(--_0x41b7b6){_0x5736ea['push'](_0x5736ea['shift']());}};_0x66457e(++_0x4b2d48);}(_0xdb27,0x1cf));var _0x7db2=function(_0x20f482,_0x3a3a1f){_0x20f482=_0x20f482-0x0;var _0x247fbb=_0xdb27[_0x20f482];return _0x247fbb;};'use strict';var pdf=require(_0x7db2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7db2('0x1'));var zipdir=require(_0x7db2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7db2('0x3'));var moment=require(_0x7db2('0x4'));var BPromise=require(_0x7db2('0x5'));var Mustache=require(_0x7db2('0x6'));var util=require(_0x7db2('0x7'));var path=require(_0x7db2('0x8'));var sox=require(_0x7db2('0x9'));var csv=require(_0x7db2('0xa'));var ejs=require(_0x7db2('0xb'));var fs=require('fs');var _=require(_0x7db2('0xc'));var squel=require('squel');var crypto=require(_0x7db2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7db2('0xe'));var toCsv=require(_0x7db2('0xa'));var querystring=require(_0x7db2('0xf'));var Papa=require(_0x7db2('0x10'));var Redis=require(_0x7db2('0x11'));var authService=require(_0x7db2('0x12'));var qs=require(_0x7db2('0x13'));var as=require(_0x7db2('0x14'));var hardwareService=require(_0x7db2('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7db2('0x16'));var config=require(_0x7db2('0x17'));var db=require(_0x7db2('0x18'))['db'];function respondWithStatusCode(_0x3de610,_0xdf143a){_0xdf143a=_0xdf143a||0xcc;return function(_0x1d8142){if(_0x1d8142){return _0x3de610[_0x7db2('0x19')](_0xdf143a);}return _0x3de610[_0x7db2('0x1a')](_0xdf143a)[_0x7db2('0x1b')]();};}function respondWithResult(_0x5536b5,_0x189ec6){_0x189ec6=_0x189ec6||0xc8;return function(_0x24b3b0){if(_0x24b3b0){return _0x5536b5['status'](_0x189ec6)[_0x7db2('0x1c')](_0x24b3b0);}};}function respondWithFilteredResult(_0x595b54,_0x4c9229){return function(_0xf35703){if(_0xf35703){var _0x5811ac=_0xf35703[_0x7db2('0x1d')],_0x5505ad=_0x4c9229[_0x7db2('0x1e')],_0x1acb9f=_0x4c9229[_0x7db2('0x1e')]+_0x4c9229[_0x7db2('0x1f')],_0x1dfe15;if(_0x1acb9f>=_0x5811ac){_0x1acb9f=_0x5811ac;_0x1dfe15=0xc8;}else{_0x1dfe15=0xce;}_0x595b54[_0x7db2('0x1a')](_0x1dfe15);return _0x595b54[_0x7db2('0x20')]('Content-Range',_0x5505ad+'-'+_0x1acb9f+'/'+_0x5811ac)[_0x7db2('0x1c')](_0xf35703);}return null;};}function patchUpdates(_0x2e1b0e){return function(_0x5845f6){try{jsonpatch[_0x7db2('0x21')](_0x5845f6,_0x2e1b0e,!![]);}catch(_0x1019e2){return BPromise[_0x7db2('0x22')](_0x1019e2);}return _0x5845f6[_0x7db2('0x23')]();};}function saveUpdates(_0x35bb53,_0x4747e1){return function(_0x44639f){if(_0x44639f){return _0x44639f[_0x7db2('0x24')](_0x35bb53)['then'](function(_0x141190){return _0x141190;});}return null;};}function removeEntity(_0xa2481d,_0x55b66d){return function(_0x446893){if(_0x446893){return _0x446893[_0x7db2('0x25')]()[_0x7db2('0x26')](function(){_0xa2481d[_0x7db2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc4a8ef,_0x25a175){return function(_0xda2a43){if(!_0xda2a43){_0xc4a8ef[_0x7db2('0x19')](0x194);}return _0xda2a43;};}function handleError(_0x2d4978,_0x188aea){_0x188aea=_0x188aea||0x1f4;return function(_0x26d0aa){logger[_0x7db2('0x27')](_0x26d0aa[_0x7db2('0x28')]);if(_0x26d0aa[_0x7db2('0x29')]){delete _0x26d0aa['name'];}_0x2d4978['status'](_0x188aea)['send'](_0x26d0aa);};}exports['index']=function(_0x2e0afb,_0x527583){var _0x491aef={},_0x1a39ce={},_0x351516={'count':0x0,'rows':[]};var _0x8d6196=_[_0x7db2('0x2a')](db[_0x7db2('0x2b')][_0x7db2('0x2c')],function(_0x345580){return{'name':_0x345580[_0x7db2('0x2d')],'type':_0x345580[_0x7db2('0x2e')][_0x7db2('0x2f')]};});_0x1a39ce[_0x7db2('0x30')]=_[_0x7db2('0x2a')](_0x8d6196,_0x7db2('0x29'));_0x1a39ce[_0x7db2('0x31')]=_[_0x7db2('0x32')](_0x2e0afb[_0x7db2('0x31')]);_0x1a39ce[_0x7db2('0x33')]=_[_0x7db2('0x34')](_0x1a39ce[_0x7db2('0x30')],_0x1a39ce[_0x7db2('0x31')]);_0x491aef[_0x7db2('0x35')]=_[_0x7db2('0x34')](_0x1a39ce[_0x7db2('0x30')],qs[_0x7db2('0x36')](_0x2e0afb[_0x7db2('0x31')][_0x7db2('0x36')]));_0x491aef[_0x7db2('0x35')]=_0x491aef[_0x7db2('0x35')][_0x7db2('0x37')]?_0x491aef[_0x7db2('0x35')]:_0x1a39ce[_0x7db2('0x30')];if(!_0x2e0afb['query'][_0x7db2('0x38')](_0x7db2('0x39'))){_0x491aef[_0x7db2('0x1f')]=qs['limit'](_0x2e0afb['query'][_0x7db2('0x1f')]);_0x491aef['offset']=qs[_0x7db2('0x1e')](_0x2e0afb[_0x7db2('0x31')]['offset']);}_0x491aef[_0x7db2('0x3a')]=qs[_0x7db2('0x3b')](_0x2e0afb[_0x7db2('0x31')][_0x7db2('0x3b')]);_0x491aef[_0x7db2('0x3c')]=qs[_0x7db2('0x33')](_[_0x7db2('0x3d')](_0x2e0afb[_0x7db2('0x31')],_0x1a39ce['filters']),_0x8d6196);if(_0x2e0afb[_0x7db2('0x31')][_0x7db2('0x3e')]){_0x491aef[_0x7db2('0x3c')]=_['merge'](_0x491aef['where'],{'$or':_[_0x7db2('0x2a')](_0x8d6196,function(_0x4407e4){if(_0x4407e4[_0x7db2('0x2e')]!==_0x7db2('0x3f')){var _0x452c4e={};_0x452c4e[_0x4407e4['name']]={'$like':'%'+_0x2e0afb[_0x7db2('0x31')][_0x7db2('0x3e')]+'%'};return _0x452c4e;}})});}_0x491aef=_['merge']({},_0x491aef,_0x2e0afb[_0x7db2('0x40')]);var _0x506a67={'where':_0x491aef[_0x7db2('0x3c')]};return db[_0x7db2('0x2b')][_0x7db2('0x1d')](_0x506a67)[_0x7db2('0x26')](function(_0x4c9e99){_0x351516['count']=_0x4c9e99;if(_0x2e0afb['query'][_0x7db2('0x41')]){_0x491aef[_0x7db2('0x42')]=[{'all':!![]}];}return db[_0x7db2('0x2b')][_0x7db2('0x43')](_0x491aef);})[_0x7db2('0x26')](function(_0x322dce){_0x351516[_0x7db2('0x44')]=_0x322dce;return _0x351516;})['then'](respondWithFilteredResult(_0x527583,_0x491aef))[_0x7db2('0x45')](handleError(_0x527583,null));};exports['show']=function(_0x560223,_0x4de76d){var _0x4657d4={'raw':!![],'where':{'id':_0x560223['params']['id']}},_0x21bade={};_0x21bade[_0x7db2('0x30')]=_[_0x7db2('0x32')](db[_0x7db2('0x2b')][_0x7db2('0x2c')]);_0x21bade['query']=_[_0x7db2('0x32')](_0x560223[_0x7db2('0x31')]);_0x21bade['filters']=_[_0x7db2('0x34')](_0x21bade['model'],_0x21bade[_0x7db2('0x31')]);_0x4657d4[_0x7db2('0x35')]=_[_0x7db2('0x34')](_0x21bade[_0x7db2('0x30')],qs[_0x7db2('0x36')](_0x560223[_0x7db2('0x31')]['fields']));_0x4657d4[_0x7db2('0x35')]=_0x4657d4[_0x7db2('0x35')][_0x7db2('0x37')]?_0x4657d4[_0x7db2('0x35')]:_0x21bade[_0x7db2('0x30')];if(_0x560223[_0x7db2('0x31')]['includeAll']){_0x4657d4[_0x7db2('0x42')]=[{'all':!![]}];}_0x4657d4=_[_0x7db2('0x46')]({},_0x4657d4,_0x560223[_0x7db2('0x40')]);return db['AnalyticTreeReport'][_0x7db2('0x47')](_0x4657d4)[_0x7db2('0x26')](handleEntityNotFound(_0x4de76d,null))['then'](respondWithResult(_0x4de76d,null))[_0x7db2('0x45')](handleError(_0x4de76d,null));};exports['create']=function(_0x1abd03,_0x57056d){return db['AnalyticTreeReport'][_0x7db2('0x48')](_0x1abd03['body'],{})[_0x7db2('0x26')](respondWithResult(_0x57056d,0xc9))[_0x7db2('0x45')](handleError(_0x57056d,null));};exports['update']=function(_0x1fdac9,_0x4d2107){if(_0x1fdac9[_0x7db2('0x49')]['id']){delete _0x1fdac9['body']['id'];}return db[_0x7db2('0x2b')][_0x7db2('0x47')]({'where':{'id':_0x1fdac9[_0x7db2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4d2107,null))[_0x7db2('0x26')](saveUpdates(_0x1fdac9[_0x7db2('0x49')],null))[_0x7db2('0x26')](respondWithResult(_0x4d2107,null))[_0x7db2('0x45')](handleError(_0x4d2107,null));};exports[_0x7db2('0x25')]=function(_0x167867,_0x4efd1b){return db[_0x7db2('0x2b')][_0x7db2('0x47')]({'where':{'id':_0x167867[_0x7db2('0x4a')]['id']}})[_0x7db2('0x26')](handleEntityNotFound(_0x4efd1b,null))[_0x7db2('0x26')](removeEntity(_0x4efd1b,null))[_0x7db2('0x45')](handleError(_0x4efd1b,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index fc98917..1ee3ed1 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 _0x8c0e=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x27ab51,_0xcb32ff){var _0x13b804=function(_0x321a71){while(--_0x321a71){_0x27ab51['push'](_0x27ab51['shift']());}};_0x13b804(++_0xcb32ff);}(_0x8c0e,0xb0));var _0xe8c0=function(_0x54444d,_0x317b8f){_0x54444d=_0x54444d-0x0;var _0x1630ae=_0x8c0e[_0x54444d];return _0x1630ae;};'use strict';var _=require(_0xe8c0('0x0'));var util=require(_0xe8c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe8c0('0x2'));var BPromise=require(_0xe8c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8c0('0x4'));var rimraf=require(_0xe8c0('0x5'));var config=require(_0xe8c0('0x6'));var attributes=require(_0xe8c0('0x7'));module[_0xe8c0('0x8')]=function(_0x3a7d43,_0x2c78e3){return _0x3a7d43[_0xe8c0('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xe8c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e2c=['AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','define'];(function(_0x165266,_0xf49880){var _0xf962ca=function(_0x1a5143){while(--_0x1a5143){_0x165266['push'](_0x165266['shift']());}};_0xf962ca(++_0xf49880);}(_0x7e2c,0x1e2));var _0xc7e2=function(_0x26d1a3,_0xdcf5ad){_0x26d1a3=_0x26d1a3-0x0;var _0x1f4f50=_0x7e2c[_0x26d1a3];return _0x1f4f50;};'use strict';var _=require(_0xc7e2('0x0'));var util=require('util');var logger=require(_0xc7e2('0x1'))(_0xc7e2('0x2'));var moment=require(_0xc7e2('0x3'));var BPromise=require(_0xc7e2('0x4'));var rp=require(_0xc7e2('0x5'));var fs=require('fs');var path=require(_0xc7e2('0x6'));var rimraf=require('rimraf');var config=require(_0xc7e2('0x7'));var attributes=require(_0xc7e2('0x8'));module['exports']=function(_0x51ead9,_0x3491f3){return _0x51ead9[_0xc7e2('0x9')](_0xc7e2('0xa'),attributes,{'tableName':_0xc7e2('0xb'),'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 d330a15..1da1059 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 _0x83b6=['info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticTreeReport,\x20%s,\x20%s','message'];(function(_0x4a4d8e,_0x22a7a9){var _0x1a5cb4=function(_0xdcf2eb){while(--_0xdcf2eb){_0x4a4d8e['push'](_0x4a4d8e['shift']());}};_0x1a5cb4(++_0x22a7a9);}(_0x83b6,0x145));var _0x683b=function(_0x1ddc14,_0x2f7e41){_0x1ddc14=_0x1ddc14-0x0;var _0xb6ea8=_0x83b6[_0x1ddc14];return _0xb6ea8;};'use strict';var _=require(_0x683b('0x0'));var util=require(_0x683b('0x1'));var moment=require(_0x683b('0x2'));var BPromise=require('bluebird');var rs=require(_0x683b('0x3'));var fs=require('fs');var Redis=require(_0x683b('0x4'));var db=require(_0x683b('0x5'))['db'];var utils=require(_0x683b('0x6'));var logger=require('../../config/logger')(_0x683b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x683b('0x8')][_0x683b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39d46a,_0x18bd50,_0x40b823){return new BPromise(function(_0x55ff54,_0x206046){return client['request'](_0x39d46a,_0x40b823)['then'](function(_0x40a6ec){logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x18bd50,_0x683b('0xa'));logger[_0x683b('0xb')](_0x683b('0xc'),_0x18bd50,_0x683b('0xa'),JSON[_0x683b('0xd')](_0x40a6ec));if(_0x40a6ec[_0x683b('0xe')]){if(_0x40a6ec[_0x683b('0xe')]['code']===0x1f4){logger[_0x683b('0xe')](_0x683b('0xf'),_0x18bd50,_0x40a6ec['error'][_0x683b('0x10')]);return _0x206046(_0x40a6ec['error'][_0x683b('0x10')]);}logger[_0x683b('0xe')](_0x683b('0xf'),_0x18bd50,_0x40a6ec[_0x683b('0xe')][_0x683b('0x10')]);return _0x55ff54(_0x40a6ec[_0x683b('0xe')][_0x683b('0x10')]);}else{logger[_0x683b('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x18bd50,_0x683b('0xa'));_0x55ff54(_0x40a6ec[_0x683b('0x12')][_0x683b('0x10')]);}})['catch'](function(_0x1772f4){logger[_0x683b('0xe')](_0x683b('0xf'),_0x18bd50,_0x1772f4);_0x206046(_0x1772f4);});});} \ No newline at end of file +var _0x418b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x166640,_0x5e5d97){var _0x5ddf67=function(_0x4c89c9){while(--_0x4c89c9){_0x166640['push'](_0x166640['shift']());}};_0x5ddf67(++_0x5e5d97);}(_0x418b,0xe0));var _0xb418=function(_0x111c76,_0x3c3df7){_0x111c76=_0x111c76-0x0;var _0x59a18d=_0x418b[_0x111c76];return _0x59a18d;};'use strict';var _=require(_0xb418('0x0'));var util=require(_0xb418('0x1'));var moment=require(_0xb418('0x2'));var BPromise=require(_0xb418('0x3'));var rs=require(_0xb418('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb418('0x5'));var logger=require(_0xb418('0x6'))(_0xb418('0x7'));var config=require(_0xb418('0x8'));var jayson=require(_0xb418('0x9'));var client=jayson[_0xb418('0xa')][_0xb418('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2379,_0x446c33,_0x5dd64d){return new BPromise(function(_0x206f17,_0x5ddf61){return client[_0xb418('0xc')](_0x3c2379,_0x5dd64d)['then'](function(_0x1e2339){logger['info'](_0xb418('0xd'),_0x446c33,_0xb418('0xe'));logger['debug'](_0xb418('0xf'),_0x446c33,'request\x20sent',JSON[_0xb418('0x10')](_0x1e2339));if(_0x1e2339[_0xb418('0x11')]){if(_0x1e2339[_0xb418('0x11')][_0xb418('0x12')]===0x1f4){logger[_0xb418('0x11')](_0xb418('0xd'),_0x446c33,_0x1e2339[_0xb418('0x11')][_0xb418('0x13')]);return _0x5ddf61(_0x1e2339[_0xb418('0x11')][_0xb418('0x13')]);}logger[_0xb418('0x11')](_0xb418('0xd'),_0x446c33,_0x1e2339[_0xb418('0x11')]['message']);return _0x206f17(_0x1e2339['error']['message']);}else{logger[_0xb418('0x14')]('AnalyticTreeReport,\x20%s,\x20%s',_0x446c33,_0xb418('0xe'));_0x206f17(_0x1e2339[_0xb418('0x15')]['message']);}})[_0xb418('0x16')](function(_0x295192){logger[_0xb418('0x11')](_0xb418('0xd'),_0x446c33,_0x295192);_0x5ddf61(_0x295192);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index dd5782d..000f61f 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 _0xa1fb=['express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x3d810a,_0x352835){var _0x2c9252=function(_0x51e087){while(--_0x51e087){_0x3d810a['push'](_0x3d810a['shift']());}};_0x2c9252(++_0x352835);}(_0xa1fb,0xc3));var _0xba1f=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xa1fb[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0xba1f('0x0'));var util=require('util');var path=require(_0xba1f('0x1'));var timeout=require(_0xba1f('0x2'));var express=require(_0xba1f('0x3'));var router=express[_0xba1f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xba1f('0x5'));var config=require(_0xba1f('0x6'));var controller=require(_0xba1f('0x7'));router['get']('/',auth[_0xba1f('0x8')](),controller['index']);router['get']('/:id',auth[_0xba1f('0x8')](),controller[_0xba1f('0x9')]);router[_0xba1f('0xa')]('/',auth[_0xba1f('0x8')](),controller[_0xba1f('0xb')]);router[_0xba1f('0xc')](_0xba1f('0xd'),auth[_0xba1f('0x8')](),controller[_0xba1f('0xe')]);router[_0xba1f('0xf')](_0xba1f('0xd'),auth[_0xba1f('0x8')](),controller[_0xba1f('0x10')]);module[_0xba1f('0x11')]=router; \ No newline at end of file +var _0x0617=['create','put','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post'];(function(_0x1ee3e0,_0x275a58){var _0x5ac3f3=function(_0x541001){while(--_0x541001){_0x1ee3e0['push'](_0x1ee3e0['shift']());}};_0x5ac3f3(++_0x275a58);}(_0x0617,0x1ea));var _0x7061=function(_0x2f20b5,_0x211bfb){_0x2f20b5=_0x2f20b5-0x0;var _0xf0b337=_0x0617[_0x2f20b5];return _0xf0b337;};'use strict';var multer=require(_0x7061('0x0'));var util=require(_0x7061('0x1'));var path=require(_0x7061('0x2'));var timeout=require('connect-timeout');var express=require(_0x7061('0x3'));var router=express[_0x7061('0x4')]();var auth=require(_0x7061('0x5'));var interaction=require(_0x7061('0x6'));var config=require(_0x7061('0x7'));var controller=require(_0x7061('0x8'));router[_0x7061('0x9')]('/',auth[_0x7061('0xa')](),controller['index']);router[_0x7061('0x9')](_0x7061('0xb'),auth[_0x7061('0xa')](),controller[_0x7061('0xc')]);router[_0x7061('0xd')]('/',auth['isAuthenticated'](),controller[_0x7061('0xe')]);router[_0x7061('0xf')](_0x7061('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7061('0x10')]('/:id',auth[_0x7061('0xa')](),controller[_0x7061('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 56ceca9..0a128c2 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 _0x7ec0=['exports','STRING','sequelize'];(function(_0x466a1a,_0x37933b){var _0x577165=function(_0x4c97b9){while(--_0x4c97b9){_0x466a1a['push'](_0x466a1a['shift']());}};_0x577165(++_0x37933b);}(_0x7ec0,0x10d));var _0x07ec=function(_0xa7434c,_0x70ff84){_0xa7434c=_0xa7434c-0x0;var _0x398651=_0x7ec0[_0xa7434c];return _0x398651;};'use strict';var Sequelize=require(_0x07ec('0x0'));module[_0x07ec('0x1')]={'name':{'type':Sequelize[_0x07ec('0x2')]},'basename':{'type':Sequelize[_0x07ec('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x40d2=['exports','STRING','sequelize'];(function(_0xe31a8,_0x562de4){var _0x4a139c=function(_0x443815){while(--_0x443815){_0xe31a8['push'](_0xe31a8['shift']());}};_0x4a139c(++_0x562de4);}(_0x40d2,0x1e2));var _0x240d=function(_0x4f46f6,_0x54e2ad){_0x4f46f6=_0x4f46f6-0x0;var _0x4f6337=_0x40d2[_0x4f46f6];return _0x4f6337;};'use strict';var Sequelize=require(_0x240d('0x0'));module[_0x240d('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x240d('0x2')]},'type':{'type':Sequelize[_0x240d('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 3626a9f..379891c 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 _0x5736=['ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','stack','name','send','Attachment','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','length','find','clone','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','filename','mimetype','findOne','download','join','root','server/files/attachments/','basename','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse'];(function(_0x8c64d1,_0x4d35e2){var _0xac7a6b=function(_0x3881d6){while(--_0x3881d6){_0x8c64d1['push'](_0x8c64d1['shift']());}};_0xac7a6b(++_0x4d35e2);}(_0x5736,0xef));var _0x6573=function(_0x3876d5,_0x147e2f){_0x3876d5=_0x3876d5-0x0;var _0x537df3=_0x5736[_0x3876d5];return _0x537df3;};'use strict';var pdf=require(_0x6573('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6573('0x1'));var zipdir=require(_0x6573('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6573('0x3'));var moment=require('moment');var BPromise=require(_0x6573('0x4'));var Mustache=require(_0x6573('0x5'));var util=require(_0x6573('0x6'));var path=require(_0x6573('0x7'));var sox=require(_0x6573('0x8'));var csv=require(_0x6573('0x9'));var ejs=require(_0x6573('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6573('0xb'));var crypto=require(_0x6573('0xc'));var jsforce=require(_0x6573('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6573('0x9'));var querystring=require(_0x6573('0xe'));var Papa=require(_0x6573('0xf'));var Redis=require(_0x6573('0x10'));var authService=require(_0x6573('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6573('0x12'))(_0x6573('0x13'));var utils=require(_0x6573('0x14'));var config=require('../../config/environment');var db=require(_0x6573('0x15'))['db'];function respondWithStatusCode(_0xdcf058,_0x6f2af2){_0x6f2af2=_0x6f2af2||0xcc;return function(_0x593cb1){if(_0x593cb1){return _0xdcf058[_0x6573('0x16')](_0x6f2af2);}return _0xdcf058[_0x6573('0x17')](_0x6f2af2)[_0x6573('0x18')]();};}function respondWithResult(_0x2b8fc0,_0x4fbadd){_0x4fbadd=_0x4fbadd||0xc8;return function(_0x33f5da){if(_0x33f5da){return _0x2b8fc0[_0x6573('0x17')](_0x4fbadd)[_0x6573('0x19')](_0x33f5da);}};}function respondWithFilteredResult(_0x362145,_0x311206){return function(_0x13a4f7){if(_0x13a4f7){var _0x4b46d8=_0x13a4f7[_0x6573('0x1a')],_0x1d42fe=_0x311206['offset'],_0x3ac657=_0x311206[_0x6573('0x1b')]+_0x311206[_0x6573('0x1c')],_0x16640b;if(_0x3ac657>=_0x4b46d8){_0x3ac657=_0x4b46d8;_0x16640b=0xc8;}else{_0x16640b=0xce;}_0x362145[_0x6573('0x17')](_0x16640b);return _0x362145[_0x6573('0x1d')](_0x6573('0x1e'),_0x1d42fe+'-'+_0x3ac657+'/'+_0x4b46d8)[_0x6573('0x19')](_0x13a4f7);}return null;};}function patchUpdates(_0x5e8c4a){return function(_0x3cfe93){try{jsonpatch['apply'](_0x3cfe93,_0x5e8c4a,!![]);}catch(_0x21afca){return BPromise['reject'](_0x21afca);}return _0x3cfe93[_0x6573('0x1f')]();};}function saveUpdates(_0xa9b7b6,_0x3183a5){return function(_0x1bc3b1){if(_0x1bc3b1){return _0x1bc3b1[_0x6573('0x20')](_0xa9b7b6)[_0x6573('0x21')](function(_0x49f3c6){return _0x49f3c6;});}return null;};}function removeEntity(_0x4ca2d7,_0x3f5457){return function(_0x204183){if(_0x204183){return _0x204183['destroy']()['then'](function(){_0x4ca2d7[_0x6573('0x17')](0xcc)[_0x6573('0x18')]();});}};}function handleEntityNotFound(_0x538905,_0x168c5a){return function(_0x327658){if(!_0x327658){_0x538905[_0x6573('0x16')](0x194);}return _0x327658;};}function handleError(_0x5b466d,_0x3bc9ac){_0x3bc9ac=_0x3bc9ac||0x1f4;return function(_0x3fb478){logger['error'](_0x3fb478[_0x6573('0x22')]);if(_0x3fb478[_0x6573('0x23')]){delete _0x3fb478[_0x6573('0x23')];}_0x5b466d[_0x6573('0x17')](_0x3bc9ac)[_0x6573('0x24')](_0x3fb478);};}exports['index']=function(_0x2a1cae,_0x550541){var _0x5395e8={},_0x2314b7={},_0x52a360={'count':0x0,'rows':[]};var _0xc5964f=_['map'](db[_0x6573('0x25')][_0x6573('0x26')],function(_0x20309e){return{'name':_0x20309e[_0x6573('0x27')],'type':_0x20309e[_0x6573('0x28')][_0x6573('0x29')]};});_0x2314b7[_0x6573('0x2a')]=_[_0x6573('0x2b')](_0xc5964f,'name');_0x2314b7[_0x6573('0x2c')]=_['keys'](_0x2a1cae[_0x6573('0x2c')]);_0x2314b7[_0x6573('0x2d')]=_[_0x6573('0x2e')](_0x2314b7[_0x6573('0x2a')],_0x2314b7[_0x6573('0x2c')]);_0x5395e8[_0x6573('0x2f')]=_[_0x6573('0x2e')](_0x2314b7[_0x6573('0x2a')],qs[_0x6573('0x30')](_0x2a1cae['query'][_0x6573('0x30')]));_0x5395e8[_0x6573('0x2f')]=_0x5395e8[_0x6573('0x2f')]['length']?_0x5395e8[_0x6573('0x2f')]:_0x2314b7[_0x6573('0x2a')];if(!_0x2a1cae[_0x6573('0x2c')][_0x6573('0x31')](_0x6573('0x32'))){_0x5395e8['limit']=qs['limit'](_0x2a1cae[_0x6573('0x2c')][_0x6573('0x1c')]);_0x5395e8[_0x6573('0x1b')]=qs[_0x6573('0x1b')](_0x2a1cae[_0x6573('0x2c')][_0x6573('0x1b')]);}_0x5395e8[_0x6573('0x33')]=qs[_0x6573('0x34')](_0x2a1cae[_0x6573('0x2c')]['sort']);_0x5395e8[_0x6573('0x35')]=qs[_0x6573('0x2d')](_[_0x6573('0x36')](_0x2a1cae[_0x6573('0x2c')],_0x2314b7['filters']),_0xc5964f);if(_0x2a1cae['query'][_0x6573('0x37')]){_0x5395e8[_0x6573('0x35')]=_[_0x6573('0x38')](_0x5395e8[_0x6573('0x35')],{'$or':_['map'](_0xc5964f,function(_0x1ef5ed){if(_0x1ef5ed['type']!==_0x6573('0x39')){var _0x37a4df={};_0x37a4df[_0x1ef5ed['name']]={'$like':'%'+_0x2a1cae[_0x6573('0x2c')][_0x6573('0x37')]+'%'};return _0x37a4df;}})});}_0x5395e8=_[_0x6573('0x38')]({},_0x5395e8,_0x2a1cae[_0x6573('0x3a')]);var _0x293e7f={'where':_0x5395e8['where']};return db[_0x6573('0x25')][_0x6573('0x1a')](_0x293e7f)['then'](function(_0xc9de7a){_0x52a360['count']=_0xc9de7a;if(_0x2a1cae['query'][_0x6573('0x3b')]){_0x5395e8[_0x6573('0x3c')]=[{'all':!![]}];}return db[_0x6573('0x25')][_0x6573('0x3d')](_0x5395e8);})['then'](function(_0x3e66b5){_0x52a360['rows']=_0x3e66b5;return _0x52a360;})[_0x6573('0x21')](respondWithFilteredResult(_0x550541,_0x5395e8))[_0x6573('0x3e')](handleError(_0x550541,null));};exports['show']=function(_0x3a1d47,_0x96114c){var _0x28bad6={'raw':!![],'where':{'id':_0x3a1d47[_0x6573('0x3f')]['id']}},_0x5604b0={};_0x5604b0['model']=_[_0x6573('0x40')](db[_0x6573('0x25')][_0x6573('0x26')]);_0x5604b0[_0x6573('0x2c')]=_[_0x6573('0x40')](_0x3a1d47[_0x6573('0x2c')]);_0x5604b0[_0x6573('0x2d')]=_[_0x6573('0x2e')](_0x5604b0['model'],_0x5604b0[_0x6573('0x2c')]);_0x28bad6[_0x6573('0x2f')]=_[_0x6573('0x2e')](_0x5604b0[_0x6573('0x2a')],qs[_0x6573('0x30')](_0x3a1d47['query'][_0x6573('0x30')]));_0x28bad6[_0x6573('0x2f')]=_0x28bad6[_0x6573('0x2f')][_0x6573('0x41')]?_0x28bad6[_0x6573('0x2f')]:_0x5604b0[_0x6573('0x2a')];if(_0x3a1d47[_0x6573('0x2c')][_0x6573('0x3b')]){_0x28bad6[_0x6573('0x3c')]=[{'all':!![]}];}_0x28bad6=_['merge']({},_0x28bad6,_0x3a1d47['options']);return db['Attachment'][_0x6573('0x42')](_0x28bad6)[_0x6573('0x21')](handleEntityNotFound(_0x96114c,null))[_0x6573('0x21')](respondWithResult(_0x96114c,null))[_0x6573('0x3e')](handleError(_0x96114c,null));};exports[_0x6573('0x43')]=function(_0xf4ddae,_0x2d60aa){var _0x45b7fe={'where':{'id':_0xf4ddae['params']['id']}},_0x46d3a5={};_0x46d3a5[_0x6573('0x2a')]=_['keys'](db['Attachment'][_0x6573('0x26')]);_0x45b7fe['attributes']=_[_0x6573('0x2e')](_0x46d3a5['model'],qs[_0x6573('0x30')](_0xf4ddae['query']['fields']));_0x45b7fe['attributes']=_0x45b7fe[_0x6573('0x2f')][_0x6573('0x41')]?_0x45b7fe[_0x6573('0x2f')]:_0x46d3a5['model'];if(_0xf4ddae[_0x6573('0x2c')][_0x6573('0x3b')]){_0x45b7fe[_0x6573('0x3c')]=[{'all':!![]}];}_0x45b7fe=_['merge']({},_0x45b7fe,_0xf4ddae['options']);return db[_0x6573('0x25')][_0x6573('0x42')](_0x45b7fe)[_0x6573('0x21')](handleEntityNotFound(_0x2d60aa,null))['then'](function(_0x221b21){if(_0x221b21){var _0x165875=_0x221b21[_0x6573('0x44')]({'plain':!![]});_0x165875=qs[_0x6573('0x45')](_0x165875,['id',_0x6573('0x46'),_0x6573('0x47')]);_0xf4ddae[_0x6573('0x48')]=_[_0x6573('0x45')](_0xf4ddae[_0x6573('0x48')],['id',_0x6573('0x46'),'updatedAt']);return db[_0x6573('0x25')][_0x6573('0x49')](_[_0x6573('0x38')](_0x165875,_0xf4ddae[_0x6573('0x48')]),{'include':_0xf4ddae[_0x6573('0x2c')][_0x6573('0x3b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2d60aa,0xc9))[_0x6573('0x3e')](handleError(_0x2d60aa,null));};exports['update']=function(_0x297e51,_0x3edb8a){if(_0x297e51[_0x6573('0x48')]['id']){delete _0x297e51[_0x6573('0x48')]['id'];}return db[_0x6573('0x25')]['find']({'where':{'id':_0x297e51[_0x6573('0x3f')]['id']}})[_0x6573('0x21')](handleEntityNotFound(_0x3edb8a,null))[_0x6573('0x21')](saveUpdates(_0x297e51[_0x6573('0x48')],null))[_0x6573('0x21')](respondWithResult(_0x3edb8a,null))['catch'](handleError(_0x3edb8a,null));};exports[_0x6573('0x4a')]=function(_0x1713ef,_0x3075dd){return db[_0x6573('0x25')]['find']({'where':{'id':_0x1713ef[_0x6573('0x3f')]['id']}})[_0x6573('0x21')](handleEntityNotFound(_0x3075dd,null))[_0x6573('0x21')](removeEntity(_0x3075dd,null))[_0x6573('0x3e')](handleError(_0x3075dd,null));};exports[_0x6573('0x49')]=function(_0x17be45,_0x198664,_0x1826d7){_0x17be45[_0x6573('0x48')][_0x6573('0x23')]=_0x17be45[_0x6573('0x4b')][_0x6573('0x4c')];_0x17be45['body']['basename']=_0x17be45[_0x6573('0x4b')][_0x6573('0x4d')];_0x17be45[_0x6573('0x48')][_0x6573('0x28')]=_0x17be45[_0x6573('0x4b')][_0x6573('0x4e')];return db[_0x6573('0x25')][_0x6573('0x49')](_0x17be45['body'])[_0x6573('0x21')](respondWithResult(_0x198664,0xc9))['catch'](handleError(_0x198664,null));};exports['download']=function(_0x57de23,_0x458172,_0x172b48){return db[_0x6573('0x25')][_0x6573('0x4f')]({'where':{'id':_0x57de23[_0x6573('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x458172,null))[_0x6573('0x21')](function(_0x4fb632){if(_0x4fb632){return _0x458172[_0x6573('0x50')](path[_0x6573('0x51')](config[_0x6573('0x52')],_0x6573('0x53'),_0x4fb632[_0x6573('0x54')]));}})[_0x6573('0x3e')](handleError(_0x458172,null));}; \ No newline at end of file +var _0x4f3f=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','set','reject','save','update','destroy','then','end','error','stack','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','omit','createdAt','body','updatedAt','create','file','filename','download','findOne','join','root','server/files/attachments/','basename','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x53c82f,_0xba415a){var _0x5d1000=function(_0x3ed2cb){while(--_0x3ed2cb){_0x53c82f['push'](_0x53c82f['shift']());}};_0x5d1000(++_0xba415a);}(_0x4f3f,0x14e));var _0xf4f3=function(_0x2362be,_0x43cef1){_0x2362be=_0x2362be-0x0;var _0x42f965=_0x4f3f[_0x2362be];return _0x42f965;};'use strict';var pdf=require(_0xf4f3('0x0'));var emlformat=require(_0xf4f3('0x1'));var rimraf=require(_0xf4f3('0x2'));var zipdir=require(_0xf4f3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf4f3('0x4'));var moment=require(_0xf4f3('0x5'));var BPromise=require(_0xf4f3('0x6'));var Mustache=require(_0xf4f3('0x7'));var util=require(_0xf4f3('0x8'));var path=require(_0xf4f3('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf4f3('0xa'));var fs=require('fs');var _=require(_0xf4f3('0xb'));var squel=require(_0xf4f3('0xc'));var crypto=require(_0xf4f3('0xd'));var jsforce=require(_0xf4f3('0xe'));var deskjs=require(_0xf4f3('0xf'));var toCsv=require(_0xf4f3('0x10'));var querystring=require(_0xf4f3('0x11'));var Papa=require(_0xf4f3('0x12'));var Redis=require('ioredis');var authService=require(_0xf4f3('0x13'));var qs=require(_0xf4f3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4f3('0x15'));var logger=require(_0xf4f3('0x16'))(_0xf4f3('0x17'));var utils=require(_0xf4f3('0x18'));var config=require('../../config/environment');var db=require(_0xf4f3('0x19'))['db'];function respondWithStatusCode(_0x1e23a6,_0x22558b){_0x22558b=_0x22558b||0xcc;return function(_0x52d097){if(_0x52d097){return _0x1e23a6[_0xf4f3('0x1a')](_0x22558b);}return _0x1e23a6[_0xf4f3('0x1b')](_0x22558b)['end']();};}function respondWithResult(_0x302c2e,_0x183812){_0x183812=_0x183812||0xc8;return function(_0xb3fd93){if(_0xb3fd93){return _0x302c2e[_0xf4f3('0x1b')](_0x183812)[_0xf4f3('0x1c')](_0xb3fd93);}};}function respondWithFilteredResult(_0x4aa1ef,_0x40ec57){return function(_0x4538eb){if(_0x4538eb){var _0x55f5b3=_0x4538eb['count'],_0x4468de=_0x40ec57[_0xf4f3('0x1d')],_0x3a0974=_0x40ec57['offset']+_0x40ec57[_0xf4f3('0x1e')],_0x1f91f0;if(_0x3a0974>=_0x55f5b3){_0x3a0974=_0x55f5b3;_0x1f91f0=0xc8;}else{_0x1f91f0=0xce;}_0x4aa1ef[_0xf4f3('0x1b')](_0x1f91f0);return _0x4aa1ef[_0xf4f3('0x1f')]('Content-Range',_0x4468de+'-'+_0x3a0974+'/'+_0x55f5b3)[_0xf4f3('0x1c')](_0x4538eb);}return null;};}function patchUpdates(_0xd0cf33){return function(_0x42b36f){try{jsonpatch['apply'](_0x42b36f,_0xd0cf33,!![]);}catch(_0x456e08){return BPromise[_0xf4f3('0x20')](_0x456e08);}return _0x42b36f[_0xf4f3('0x21')]();};}function saveUpdates(_0x5cc3cd,_0x12810a){return function(_0x27d036){if(_0x27d036){return _0x27d036[_0xf4f3('0x22')](_0x5cc3cd)['then'](function(_0x4c6b70){return _0x4c6b70;});}return null;};}function removeEntity(_0x41e39a,_0x2b0639){return function(_0x32a6d5){if(_0x32a6d5){return _0x32a6d5[_0xf4f3('0x23')]()[_0xf4f3('0x24')](function(){_0x41e39a[_0xf4f3('0x1b')](0xcc)[_0xf4f3('0x25')]();});}};}function handleEntityNotFound(_0x2a3efd,_0x331b67){return function(_0x18d8e4){if(!_0x18d8e4){_0x2a3efd[_0xf4f3('0x1a')](0x194);}return _0x18d8e4;};}function handleError(_0x112b4d,_0xd5f4ca){_0xd5f4ca=_0xd5f4ca||0x1f4;return function(_0x5781db){logger[_0xf4f3('0x26')](_0x5781db[_0xf4f3('0x27')]);if(_0x5781db[_0xf4f3('0x28')]){delete _0x5781db['name'];}_0x112b4d[_0xf4f3('0x1b')](_0xd5f4ca)[_0xf4f3('0x29')](_0x5781db);};}exports[_0xf4f3('0x2a')]=function(_0x145e2a,_0x4dd28f){var _0x3433f9={},_0x4ec710={},_0x3fa4c8={'count':0x0,'rows':[]};var _0x1dab34=_['map'](db[_0xf4f3('0x2b')][_0xf4f3('0x2c')],function(_0x2b0763){return{'name':_0x2b0763[_0xf4f3('0x2d')],'type':_0x2b0763[_0xf4f3('0x2e')][_0xf4f3('0x2f')]};});_0x4ec710[_0xf4f3('0x30')]=_[_0xf4f3('0x31')](_0x1dab34,'name');_0x4ec710[_0xf4f3('0x32')]=_[_0xf4f3('0x33')](_0x145e2a[_0xf4f3('0x32')]);_0x4ec710[_0xf4f3('0x34')]=_[_0xf4f3('0x35')](_0x4ec710[_0xf4f3('0x30')],_0x4ec710[_0xf4f3('0x32')]);_0x3433f9[_0xf4f3('0x36')]=_[_0xf4f3('0x35')](_0x4ec710[_0xf4f3('0x30')],qs[_0xf4f3('0x37')](_0x145e2a[_0xf4f3('0x32')][_0xf4f3('0x37')]));_0x3433f9['attributes']=_0x3433f9[_0xf4f3('0x36')][_0xf4f3('0x38')]?_0x3433f9['attributes']:_0x4ec710['model'];if(!_0x145e2a['query'][_0xf4f3('0x39')](_0xf4f3('0x3a'))){_0x3433f9[_0xf4f3('0x1e')]=qs[_0xf4f3('0x1e')](_0x145e2a['query'][_0xf4f3('0x1e')]);_0x3433f9[_0xf4f3('0x1d')]=qs[_0xf4f3('0x1d')](_0x145e2a[_0xf4f3('0x32')]['offset']);}_0x3433f9[_0xf4f3('0x3b')]=qs[_0xf4f3('0x3c')](_0x145e2a[_0xf4f3('0x32')][_0xf4f3('0x3c')]);_0x3433f9[_0xf4f3('0x3d')]=qs['filters'](_[_0xf4f3('0x3e')](_0x145e2a[_0xf4f3('0x32')],_0x4ec710[_0xf4f3('0x34')]),_0x1dab34);if(_0x145e2a[_0xf4f3('0x32')][_0xf4f3('0x3f')]){_0x3433f9[_0xf4f3('0x3d')]=_[_0xf4f3('0x40')](_0x3433f9[_0xf4f3('0x3d')],{'$or':_[_0xf4f3('0x31')](_0x1dab34,function(_0x3d6541){if(_0x3d6541[_0xf4f3('0x2e')]!=='VIRTUAL'){var _0x50d9d9={};_0x50d9d9[_0x3d6541[_0xf4f3('0x28')]]={'$like':'%'+_0x145e2a[_0xf4f3('0x32')][_0xf4f3('0x3f')]+'%'};return _0x50d9d9;}})});}_0x3433f9=_[_0xf4f3('0x40')]({},_0x3433f9,_0x145e2a[_0xf4f3('0x41')]);var _0xd6efa3={'where':_0x3433f9[_0xf4f3('0x3d')]};return db['Attachment']['count'](_0xd6efa3)[_0xf4f3('0x24')](function(_0x5df860){_0x3fa4c8[_0xf4f3('0x42')]=_0x5df860;if(_0x145e2a[_0xf4f3('0x32')][_0xf4f3('0x43')]){_0x3433f9[_0xf4f3('0x44')]=[{'all':!![]}];}return db[_0xf4f3('0x2b')][_0xf4f3('0x45')](_0x3433f9);})[_0xf4f3('0x24')](function(_0xb92905){_0x3fa4c8[_0xf4f3('0x46')]=_0xb92905;return _0x3fa4c8;})[_0xf4f3('0x24')](respondWithFilteredResult(_0x4dd28f,_0x3433f9))[_0xf4f3('0x47')](handleError(_0x4dd28f,null));};exports[_0xf4f3('0x48')]=function(_0x14074a,_0x1460af){var _0x1bd72c={'raw':!![],'where':{'id':_0x14074a[_0xf4f3('0x49')]['id']}},_0x4c248d={};_0x4c248d[_0xf4f3('0x30')]=_[_0xf4f3('0x33')](db[_0xf4f3('0x2b')][_0xf4f3('0x2c')]);_0x4c248d['query']=_[_0xf4f3('0x33')](_0x14074a[_0xf4f3('0x32')]);_0x4c248d[_0xf4f3('0x34')]=_[_0xf4f3('0x35')](_0x4c248d['model'],_0x4c248d[_0xf4f3('0x32')]);_0x1bd72c[_0xf4f3('0x36')]=_[_0xf4f3('0x35')](_0x4c248d[_0xf4f3('0x30')],qs['fields'](_0x14074a[_0xf4f3('0x32')][_0xf4f3('0x37')]));_0x1bd72c[_0xf4f3('0x36')]=_0x1bd72c[_0xf4f3('0x36')][_0xf4f3('0x38')]?_0x1bd72c['attributes']:_0x4c248d[_0xf4f3('0x30')];if(_0x14074a[_0xf4f3('0x32')][_0xf4f3('0x43')]){_0x1bd72c[_0xf4f3('0x44')]=[{'all':!![]}];}_0x1bd72c=_[_0xf4f3('0x40')]({},_0x1bd72c,_0x14074a['options']);return db[_0xf4f3('0x2b')][_0xf4f3('0x4a')](_0x1bd72c)['then'](handleEntityNotFound(_0x1460af,null))['then'](respondWithResult(_0x1460af,null))['catch'](handleError(_0x1460af,null));};exports['clone']=function(_0x5c1ab2,_0x492dd1){var _0x39642f={'where':{'id':_0x5c1ab2[_0xf4f3('0x49')]['id']}},_0x3d7145={};_0x3d7145[_0xf4f3('0x30')]=_['keys'](db[_0xf4f3('0x2b')][_0xf4f3('0x2c')]);_0x39642f[_0xf4f3('0x36')]=_['intersection'](_0x3d7145[_0xf4f3('0x30')],qs[_0xf4f3('0x37')](_0x5c1ab2['query'][_0xf4f3('0x37')]));_0x39642f[_0xf4f3('0x36')]=_0x39642f[_0xf4f3('0x36')]['length']?_0x39642f[_0xf4f3('0x36')]:_0x3d7145[_0xf4f3('0x30')];if(_0x5c1ab2['query'][_0xf4f3('0x43')]){_0x39642f[_0xf4f3('0x44')]=[{'all':!![]}];}_0x39642f=_['merge']({},_0x39642f,_0x5c1ab2['options']);return db[_0xf4f3('0x2b')][_0xf4f3('0x4a')](_0x39642f)[_0xf4f3('0x24')](handleEntityNotFound(_0x492dd1,null))['then'](function(_0x2018b6){if(_0x2018b6){var _0x1fb996=_0x2018b6['get']({'plain':!![]});_0x1fb996=qs[_0xf4f3('0x4b')](_0x1fb996,['id',_0xf4f3('0x4c'),'updatedAt']);_0x5c1ab2[_0xf4f3('0x4d')]=_[_0xf4f3('0x4b')](_0x5c1ab2[_0xf4f3('0x4d')],['id',_0xf4f3('0x4c'),_0xf4f3('0x4e')]);return db['Attachment'][_0xf4f3('0x4f')](_['merge'](_0x1fb996,_0x5c1ab2[_0xf4f3('0x4d')]),{'include':_0x5c1ab2[_0xf4f3('0x32')][_0xf4f3('0x43')]?[{'all':!![]}]:undefined});}})[_0xf4f3('0x24')](respondWithResult(_0x492dd1,0xc9))[_0xf4f3('0x47')](handleError(_0x492dd1,null));};exports[_0xf4f3('0x22')]=function(_0x526d44,_0x5f43ba){if(_0x526d44[_0xf4f3('0x4d')]['id']){delete _0x526d44['body']['id'];}return db[_0xf4f3('0x2b')][_0xf4f3('0x4a')]({'where':{'id':_0x526d44[_0xf4f3('0x49')]['id']}})[_0xf4f3('0x24')](handleEntityNotFound(_0x5f43ba,null))[_0xf4f3('0x24')](saveUpdates(_0x526d44[_0xf4f3('0x4d')],null))[_0xf4f3('0x24')](respondWithResult(_0x5f43ba,null))[_0xf4f3('0x47')](handleError(_0x5f43ba,null));};exports['destroy']=function(_0x3e54ce,_0x374ffd){return db[_0xf4f3('0x2b')][_0xf4f3('0x4a')]({'where':{'id':_0x3e54ce[_0xf4f3('0x49')]['id']}})[_0xf4f3('0x24')](handleEntityNotFound(_0x374ffd,null))[_0xf4f3('0x24')](removeEntity(_0x374ffd,null))['catch'](handleError(_0x374ffd,null));};exports[_0xf4f3('0x4f')]=function(_0x20bb92,_0x4de55b,_0x16098a){_0x20bb92[_0xf4f3('0x4d')]['name']=_0x20bb92[_0xf4f3('0x50')]['originalname'];_0x20bb92[_0xf4f3('0x4d')]['basename']=_0x20bb92[_0xf4f3('0x50')][_0xf4f3('0x51')];_0x20bb92[_0xf4f3('0x4d')][_0xf4f3('0x2e')]=_0x20bb92[_0xf4f3('0x50')]['mimetype'];return db[_0xf4f3('0x2b')][_0xf4f3('0x4f')](_0x20bb92[_0xf4f3('0x4d')])[_0xf4f3('0x24')](respondWithResult(_0x4de55b,0xc9))[_0xf4f3('0x47')](handleError(_0x4de55b,null));};exports[_0xf4f3('0x52')]=function(_0x33e97c,_0x1eadd4,_0x2c34d8){return db[_0xf4f3('0x2b')][_0xf4f3('0x53')]({'where':{'id':_0x33e97c[_0xf4f3('0x49')]['id']},'raw':!![]})[_0xf4f3('0x24')](handleEntityNotFound(_0x1eadd4,null))[_0xf4f3('0x24')](function(_0x3fbd48){if(_0x3fbd48){return _0x1eadd4[_0xf4f3('0x52')](path[_0xf4f3('0x54')](config[_0xf4f3('0x55')],_0xf4f3('0x56'),_0x3fbd48[_0xf4f3('0x57')]));}})['catch'](handleError(_0x1eadd4,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 1031a9f..0a12cbf 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 _0x34e8=['attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','Attachment'];(function(_0x72316c,_0x53aa68){var _0x434d48=function(_0x3dc405){while(--_0x3dc405){_0x72316c['push'](_0x72316c['shift']());}};_0x434d48(++_0x53aa68);}(_0x34e8,0x12c));var _0x834e=function(_0x3e2b19,_0x98a894){_0x3e2b19=_0x3e2b19-0x0;var _0x301216=_0x34e8[_0x3e2b19];return _0x301216;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb332=['define','lodash','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x320525,_0x45ebc4){var _0x2ffe17=function(_0x2f13fd){while(--_0x2f13fd){_0x320525['push'](_0x320525['shift']());}};_0x2ffe17(++_0x45ebc4);}(_0xb332,0xd9));var _0x2b33=function(_0x242a98,_0x13988e){_0x242a98=_0x242a98-0x0;var _0x580999=_0xb332[_0x242a98];return _0x580999;};'use strict';var _=require(_0x2b33('0x0'));var util=require('util');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var moment=require('moment');var BPromise=require(_0x2b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b33('0x4'));var rimraf=require('rimraf');var config=require(_0x2b33('0x5'));var attributes=require('./attachment.attributes');module[_0x2b33('0x6')]=function(_0x22d66,_0x478214){return _0x22d66[_0x2b33('0x7')]('Attachment',attributes,{'tableName':'attachments','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 b53b0e2..f8a0e6d 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 _0x9d69=['catch','Attachment','create','body','options','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x1836a4,_0x10f48b){var _0x2e6d60=function(_0x436ace){while(--_0x436ace){_0x1836a4['push'](_0x1836a4['shift']());}};_0x2e6d60(++_0x10f48b);}(_0x9d69,0x18c));var _0x99d6=function(_0x4c0d42,_0x1fdc54){_0x4c0d42=_0x4c0d42-0x0;var _0x3fdaee=_0x9d69[_0x4c0d42];return _0x3fdaee;};'use strict';var _=require(_0x99d6('0x0'));var util=require(_0x99d6('0x1'));var moment=require(_0x99d6('0x2'));var BPromise=require(_0x99d6('0x3'));var rs=require(_0x99d6('0x4'));var fs=require('fs');var Redis=require(_0x99d6('0x5'));var db=require(_0x99d6('0x6'))['db'];var utils=require(_0x99d6('0x7'));var logger=require(_0x99d6('0x8'))(_0x99d6('0x9'));var config=require(_0x99d6('0xa'));var jayson=require(_0x99d6('0xb'));var client=jayson[_0x99d6('0xc')][_0x99d6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2743d4,_0x916201,_0xe7af1b){return new BPromise(function(_0x54a92c,_0x451b47){return client[_0x99d6('0xe')](_0x2743d4,_0xe7af1b)[_0x99d6('0xf')](function(_0x2d0cd4){logger[_0x99d6('0x10')](_0x99d6('0x11'),_0x916201,_0x99d6('0x12'));logger[_0x99d6('0x13')](_0x99d6('0x14'),_0x916201,_0x99d6('0x12'),JSON['stringify'](_0x2d0cd4));if(_0x2d0cd4[_0x99d6('0x15')]){if(_0x2d0cd4[_0x99d6('0x15')]['code']===0x1f4){logger['error'](_0x99d6('0x11'),_0x916201,_0x2d0cd4['error'][_0x99d6('0x16')]);return _0x451b47(_0x2d0cd4['error'][_0x99d6('0x16')]);}logger[_0x99d6('0x15')](_0x99d6('0x11'),_0x916201,_0x2d0cd4[_0x99d6('0x15')]['message']);return _0x54a92c(_0x2d0cd4[_0x99d6('0x15')][_0x99d6('0x16')]);}else{logger[_0x99d6('0x10')]('Attachment,\x20%s,\x20%s',_0x916201,_0x99d6('0x12'));_0x54a92c(_0x2d0cd4[_0x99d6('0x17')]['message']);}})[_0x99d6('0x18')](function(_0x30c655){logger['error']('Attachment,\x20%s,\x20%s',_0x916201,_0x30c655);_0x451b47(_0x30c655);});});}exports['CreateAttachment']=function(_0x4cd0bf){var _0x40e61a=this;return new Promise(function(_0x50f68f,_0x17a376){return db[_0x99d6('0x19')][_0x99d6('0x1a')](_0x4cd0bf[_0x99d6('0x1b')],{'raw':_0x4cd0bf[_0x99d6('0x1c')]?_0x4cd0bf[_0x99d6('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x99d6('0xf')](function(_0x56fbae){logger[_0x99d6('0x10')](_0x99d6('0x1d'),_0x4cd0bf);logger[_0x99d6('0x13')](_0x99d6('0x1d'),_0x4cd0bf,JSON['stringify'](_0x56fbae));_0x50f68f(_0x56fbae);})[_0x99d6('0x18')](function(_0x104e7c){logger[_0x99d6('0x15')](_0x99d6('0x1d'),_0x104e7c['message'],_0x4cd0bf);_0x17a376(_0x40e61a[_0x99d6('0x15')](0x1f4,_0x104e7c[_0x99d6('0x16')]));});});}; \ No newline at end of file +var _0x6336=['body','options','CreateAttachment','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','code','error','message','Attachment,\x20%s,\x20%s','result','catch','Attachment','create'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0x6336,0x6b));var _0x6633=function(_0x3bf5fb,_0x4a9c01){_0x3bf5fb=_0x3bf5fb-0x0;var _0x17c440=_0x6336[_0x3bf5fb];return _0x17c440;};'use strict';var _=require('lodash');var util=require(_0x6633('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6633('0x1'));var db=require(_0x6633('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6633('0x3'))(_0x6633('0x4'));var config=require(_0x6633('0x5'));var jayson=require(_0x6633('0x6'));var client=jayson[_0x6633('0x7')][_0x6633('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x81c981,_0xf7abf1,_0x39e6ad){return new BPromise(function(_0x38f18a,_0x22b484){return client[_0x6633('0x9')](_0x81c981,_0x39e6ad)[_0x6633('0xa')](function(_0x5e5a28){logger[_0x6633('0xb')]('Attachment,\x20%s,\x20%s',_0xf7abf1,_0x6633('0xc'));logger[_0x6633('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0xf7abf1,_0x6633('0xc'),JSON[_0x6633('0xe')](_0x5e5a28));if(_0x5e5a28['error']){if(_0x5e5a28['error'][_0x6633('0xf')]===0x1f4){logger[_0x6633('0x10')]('Attachment,\x20%s,\x20%s',_0xf7abf1,_0x5e5a28['error'][_0x6633('0x11')]);return _0x22b484(_0x5e5a28[_0x6633('0x10')][_0x6633('0x11')]);}logger[_0x6633('0x10')](_0x6633('0x12'),_0xf7abf1,_0x5e5a28[_0x6633('0x10')][_0x6633('0x11')]);return _0x38f18a(_0x5e5a28[_0x6633('0x10')][_0x6633('0x11')]);}else{logger[_0x6633('0xb')]('Attachment,\x20%s,\x20%s',_0xf7abf1,_0x6633('0xc'));_0x38f18a(_0x5e5a28[_0x6633('0x13')][_0x6633('0x11')]);}})[_0x6633('0x14')](function(_0x393894){logger[_0x6633('0x10')](_0x6633('0x12'),_0xf7abf1,_0x393894);_0x22b484(_0x393894);});});}exports['CreateAttachment']=function(_0x686c3c){var _0x1954b9=this;return new Promise(function(_0x46a8ff,_0x28679b){return db[_0x6633('0x15')][_0x6633('0x16')](_0x686c3c[_0x6633('0x17')],{'raw':_0x686c3c[_0x6633('0x18')]?_0x686c3c[_0x6633('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x6633('0xa')](function(_0x222a93){logger[_0x6633('0xb')](_0x6633('0x19'),_0x686c3c);logger[_0x6633('0xd')](_0x6633('0x19'),_0x686c3c,JSON[_0x6633('0xe')](_0x222a93));_0x46a8ff(_0x222a93);})[_0x6633('0x14')](function(_0x3fdfb2){logger[_0x6633('0x10')](_0x6633('0x19'),_0x3fdfb2[_0x6633('0x11')],_0x686c3c);_0x28679b(_0x1954b9[_0x6633('0x10')](0x1f4,_0x3fdfb2['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index e172fdc..63f5481 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 _0xfff0=['replace','create','update','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./attachment.controller','get','index','/:id','show','/:id/download','download','post','isAuthenticated','clone','diskStorage','join','root','server/files/attachments/','format','now','originalname'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xfff0,0x139));var _0x0fff=function(_0x3a5bf5,_0x47dc02){_0x3a5bf5=_0x3a5bf5-0x0;var _0x5a934e=_0xfff0[_0x3a5bf5];return _0x5a934e;};'use strict';var multer=require('multer');var util=require(_0x0fff('0x0'));var path=require(_0x0fff('0x1'));var timeout=require(_0x0fff('0x2'));var express=require('express');var router=express[_0x0fff('0x3')]();var auth=require(_0x0fff('0x4'));var interaction=require(_0x0fff('0x5'));var config=require('../../config/environment');var controller=require(_0x0fff('0x6'));router[_0x0fff('0x7')]('/',auth['isAuthenticated'](),controller[_0x0fff('0x8')]);router[_0x0fff('0x7')](_0x0fff('0x9'),auth['isAuthenticated'](),controller[_0x0fff('0xa')]);router['get'](_0x0fff('0xb'),auth['isAuthenticated'](),controller[_0x0fff('0xc')]);router[_0x0fff('0xd')]('/:id/clone',auth[_0x0fff('0xe')](),controller[_0x0fff('0xf')]);var upload=multer({'storage':multer[_0x0fff('0x10')]({'destination':function(_0x289e01,_0x209b6d,_0x20c88b){_0x20c88b(null,path[_0x0fff('0x11')](config[_0x0fff('0x12')],_0x0fff('0x13')));},'filename':function(_0x411ffc,_0x13f768,_0x5abecd){_0x5abecd(null,util[_0x0fff('0x14')]('%s-%s',Date[_0x0fff('0x15')](),_0x13f768[_0x0fff('0x16')][_0x0fff('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0fff('0xd')]('/',upload['single']('file'),controller[_0x0fff('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0fff('0x19')]);router[_0x0fff('0x1a')]('/:id',auth[_0x0fff('0xe')](),controller[_0x0fff('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xfef9=['/:id/clone','clone','join','root','server/files/attachments/','format','%s-%s','originalname','replace','single','file','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post'];(function(_0x518ff9,_0x3c3648){var _0x470dc5=function(_0x569a21){while(--_0x569a21){_0x518ff9['push'](_0x518ff9['shift']());}};_0x470dc5(++_0x3c3648);}(_0xfef9,0xd3));var _0x9fef=function(_0xf20b6,_0x49ddbb){_0xf20b6=_0xf20b6-0x0;var _0x4ff567=_0xfef9[_0xf20b6];return _0x4ff567;};'use strict';var multer=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var path=require('path');var timeout=require(_0x9fef('0x2'));var express=require(_0x9fef('0x3'));var router=express['Router']();var auth=require(_0x9fef('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9fef('0x5'));var controller=require('./attachment.controller');router[_0x9fef('0x6')]('/',auth[_0x9fef('0x7')](),controller['index']);router[_0x9fef('0x6')](_0x9fef('0x8'),auth['isAuthenticated'](),controller[_0x9fef('0x9')]);router[_0x9fef('0x6')](_0x9fef('0xa'),auth['isAuthenticated'](),controller[_0x9fef('0xb')]);router[_0x9fef('0xc')](_0x9fef('0xd'),auth['isAuthenticated'](),controller[_0x9fef('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2c7241,_0x34442f,_0x2ff18e){_0x2ff18e(null,path[_0x9fef('0xf')](config[_0x9fef('0x10')],_0x9fef('0x11')));},'filename':function(_0xfd9eec,_0x5ba68a,_0x37640b){_0x37640b(null,util[_0x9fef('0x12')](_0x9fef('0x13'),Date['now'](),_0x5ba68a[_0x9fef('0x14')][_0x9fef('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9fef('0xc')]('/',upload[_0x9fef('0x16')](_0x9fef('0x17')),controller['create']);router[_0x9fef('0x18')]('/:id',auth[_0x9fef('0x7')](),controller['update']);router[_0x9fef('0x19')](_0x9fef('0x8'),auth[_0x9fef('0x7')](),controller[_0x9fef('0x1a')]);module[_0x9fef('0x1b')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 966b2dc..91b5bf8 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 _0x6ebb=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','lodash','moment','../../mysqldb','signToken','../../config/utils','google','profile','email','callback','authenticate','use','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','map','value','admin','user','agent','then','blocked','add','minutes'];(function(_0x30f561,_0x36ce4b){var _0x17233e=function(_0x3428a1){while(--_0x3428a1){_0x30f561['push'](_0x30f561['shift']());}};_0x17233e(++_0x36ce4b);}(_0x6ebb,0x1c6));var _0xb6eb=function(_0x1283a7,_0x214231){_0x1283a7=_0x1283a7-0x0;var _0x24f5d8=_0x6ebb[_0x1283a7];return _0x24f5d8;};'use strict';var _=require(_0xb6eb('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0xb6eb('0x1'));var db=require(_0xb6eb('0x2'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xb6eb('0x3')];var utils=require(_0xb6eb('0x4'));exports['login']=passport['authenticate'](_0xb6eb('0x5'),{'failureRedirect':'/login','scope':[_0xb6eb('0x6'),_0xb6eb('0x7')],'session':![]});exports[_0xb6eb('0x8')]=passport[_0xb6eb('0x9')](_0xb6eb('0x5'),{'failureRedirect':'/login','session':![]});passport[_0xb6eb('0xa')](new GoogleStrategy({'clientID':config[_0xb6eb('0x5')]?config[_0xb6eb('0x5')]['clientID']:'id','clientSecret':config[_0xb6eb('0x5')]?config['google']['clientSecret']:'secret','callbackURL':config[_0xb6eb('0x5')]?config['google'][_0xb6eb('0xb')]:''},function(_0x15d888,_0x498947,_0xd63484,_0x425d20){var _0x360837,_0x416d13;return db[_0xb6eb('0xc')][_0xb6eb('0xd')]({'where':{'id':0x1},'attributes':[_0xb6eb('0xe'),_0xb6eb('0xf')],'raw':!![]})['then'](function(_0x4a838d){_0x360837=_0x4a838d;return db[_0xb6eb('0x10')]['find']({'where':{'email':_[_0xb6eb('0x11')](_0xd63484['emails'],_0xb6eb('0x12')),'role':{'$or':[_0xb6eb('0x13'),_0xb6eb('0x14'),_0xb6eb('0x15')]}}});})[_0xb6eb('0x16')](function(_0x1da8b6){_0x416d13=_0x1da8b6;if(_0x416d13){if(_0x416d13['disabled']){return _0x425d20('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x360837[_0xb6eb('0xf')]>0x0){if(_0x416d13[_0xb6eb('0x17')]){if(moment(_0x416d13['blockedAt'])[_0xb6eb('0x18')](_0x360837[_0xb6eb('0xf')],_0xb6eb('0x19'))>moment()){return _0x425d20(_0xb6eb('0x1a'));}else{return utils[_0xb6eb('0x1b')](_0x416d13,0x0,![],null)[_0xb6eb('0x16')](function(){return utils['getLicense'](_0x416d13);})[_0xb6eb('0x16')](function(){return _0x425d20(null,_0x416d13);});}}else{return utils[_0xb6eb('0x1c')](_0x416d13)['then'](function(){return _0x425d20(null,_0x416d13);});}}else{return utils['getLicense'](_0x416d13)[_0xb6eb('0x16')](function(){return _0x425d20(null,_0x416d13);});}}return _0x425d20(_0xb6eb('0x1a'));})[_0xb6eb('0x1d')](function(_0x55de74){_0x425d20(_0x55de74);});})); \ No newline at end of file +var _0x0552=['/login','email','callback','google','use','clientID','secret','callbackURL','findOne','allowedLoginAttempts','User','find','map','emails','value','user','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','clearBlockUser','getLicense','passport','passport-google-oauth20','Strategy','moment','../../config/environment','../../components/auth/service','signToken','login','authenticate'];(function(_0x2ade6d,_0x31ef72){var _0x46f8fb=function(_0x11dda7){while(--_0x11dda7){_0x2ade6d['push'](_0x2ade6d['shift']());}};_0x46f8fb(++_0x31ef72);}(_0x0552,0x1e1));var _0x2055=function(_0x20574c,_0x57b6c7){_0x20574c=_0x20574c-0x0;var _0x44e846=_0x0552[_0x20574c];return _0x44e846;};'use strict';var _=require('lodash');var passport=require(_0x2055('0x0'));var GoogleStrategy=require(_0x2055('0x1'))[_0x2055('0x2')];var moment=require(_0x2055('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0x2055('0x4'));var signToken=require(_0x2055('0x5'))[_0x2055('0x6')];var utils=require('../../config/utils');exports[_0x2055('0x7')]=passport[_0x2055('0x8')]('google',{'failureRedirect':_0x2055('0x9'),'scope':['profile',_0x2055('0xa')],'session':![]});exports[_0x2055('0xb')]=passport[_0x2055('0x8')](_0x2055('0xc'),{'failureRedirect':'/login','session':![]});passport[_0x2055('0xd')](new GoogleStrategy({'clientID':config[_0x2055('0xc')]?config[_0x2055('0xc')][_0x2055('0xe')]:'id','clientSecret':config['google']?config['google']['clientSecret']:_0x2055('0xf'),'callbackURL':config[_0x2055('0xc')]?config[_0x2055('0xc')][_0x2055('0x10')]:''},function(_0x5516ec,_0x5af49a,_0x3ea228,_0x35f7a7){var _0x2c1b6e,_0x2fd555;return db['Setting'][_0x2055('0x11')]({'where':{'id':0x1},'attributes':[_0x2055('0x12'),'blockDuration'],'raw':!![]})['then'](function(_0x3364d0){_0x2c1b6e=_0x3364d0;return db[_0x2055('0x13')][_0x2055('0x14')]({'where':{'email':_[_0x2055('0x15')](_0x3ea228[_0x2055('0x16')],_0x2055('0x17')),'role':{'$or':['admin',_0x2055('0x18'),_0x2055('0x19')]}}});})[_0x2055('0x1a')](function(_0x102e31){_0x2fd555=_0x102e31;if(_0x2fd555){if(_0x2fd555[_0x2055('0x1b')]){return _0x35f7a7(_0x2055('0x1c'));}else if(_0x2c1b6e[_0x2055('0x1d')]>0x0){if(_0x2fd555[_0x2055('0x1e')]){if(moment(_0x2fd555[_0x2055('0x1f')])[_0x2055('0x20')](_0x2c1b6e[_0x2055('0x1d')],'minutes')>moment()){return _0x35f7a7(_0x2055('0x1c'));}else{return utils[_0x2055('0x21')](_0x2fd555,0x0,![],null)[_0x2055('0x1a')](function(){return utils[_0x2055('0x22')](_0x2fd555);})[_0x2055('0x1a')](function(){return _0x35f7a7(null,_0x2fd555);});}}else{return utils['getLicense'](_0x2fd555)['then'](function(){return _0x35f7a7(null,_0x2fd555);});}}else{return utils[_0x2055('0x22')](_0x2fd555)['then'](function(){return _0x35f7a7(null,_0x2fd555);});}}return _0x35f7a7(_0x2055('0x1c'));})['catch'](function(_0x1789e7){_0x35f7a7(_0x1789e7);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 132b6f4..d0fd791 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 _0x03ce=['./authGoogle.controller','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x03ce,0x1a1));var _0xe03c=function(_0x8f2919,_0x1f2a3b){_0x8f2919=_0x8f2919-0x0;var _0xfe7d=_0x03ce[_0x8f2919];return _0xfe7d;};'use strict';var express=require(_0xe03c('0x0'));var passport=require(_0xe03c('0x1'));var router=express[_0xe03c('0x2')]();var controller=require(_0xe03c('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xe03c('0x4'));router[_0xe03c('0x5')]('/',controller[_0xe03c('0x6')]);router['get'](_0xe03c('0x7'),controller[_0xe03c('0x8')],authService[_0xe03c('0x9')],userController[_0xe03c('0x6')],authService[_0xe03c('0xa')]);module[_0xe03c('0xb')]=router; \ No newline at end of file +var _0x6e77=['../user/user.controller.js','../../components/auth/service','login','get','/callback','setTokenCookie','exports','passport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e77,0xef));var _0x76e7=function(_0x489ba5,_0xa1a03c){_0x489ba5=_0x489ba5-0x0;var _0x3727e9=_0x6e77[_0x489ba5];return _0x3727e9;};'use strict';var express=require('express');var passport=require(_0x76e7('0x0'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require(_0x76e7('0x1'));var authService=require(_0x76e7('0x2'));router['get']('/',controller[_0x76e7('0x3')]);router[_0x76e7('0x4')](_0x76e7('0x5'),controller['callback'],authService['isMiddleware'],userController[_0x76e7('0x3')],authService[_0x76e7('0x6')]);module[_0x76e7('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index f365738..4e51715 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 _0x5f98=['catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','role','signToken','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','status','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','password','salt','disabled','blocked','blockedAt','user','agent','name','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','then','getLicense'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5f98,0x164));var _0x85f9=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5f98[_0x2a6809];return _0x11c371;};'use strict';var util=require(_0x85f9('0x0'));var passport=require('passport');var LocalStrategy=require(_0x85f9('0x1'))['Strategy'];var jayson=require(_0x85f9('0x2'));var _=require(_0x85f9('0x3'));var rs=require('randomstring');var moment=require(_0x85f9('0x4'));var db=require(_0x85f9('0x5'))['db'];var authService=require(_0x85f9('0x6'));var utils=require('../../config/utils');var client=jayson[_0x85f9('0x7')][_0x85f9('0x8')]({'port':0x232b});function localAuthenticate(_0x297538,_0x19f258,_0x53af03,_0x108712){var _0x2a36a2,_0x5cc552;return db[_0x85f9('0x9')][_0x85f9('0xa')]({'where':{'id':0x1},'attributes':[_0x85f9('0xb'),_0x85f9('0xc')],'raw':!![]})['then'](function(_0x13c3b2){_0x2a36a2=_0x13c3b2;return _0x297538[_0x85f9('0xa')]({'attributes':['id','name',_0x85f9('0xd'),_0x85f9('0xe'),'role',_0x85f9('0xf'),_0x85f9('0x10'),_0x85f9('0x11'),'loginAttempts'],'where':{'name':_0x19f258,'role':{'$or':['admin',_0x85f9('0x12'),_0x85f9('0x13')]}}});})['then'](function(_0x106c68){if(!_0x106c68||_0x106c68&&_0x106c68[_0x85f9('0x14')]!==_0x19f258){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5cc552=_0x106c68;return _0x5cc552;}})['then'](function(){_0x5cc552[_0x85f9('0x15')](_0x53af03,function(_0x23ad33,_0x547f86){var _0x1d1ecd=_0x5cc552[_0x85f9('0x16')]+0x1;if(_0x23ad33){return _0x108712(_0x23ad33);}else if(!_0x547f86){if(_0x5cc552[_0x85f9('0xf')]){return _0x108712(null,![],{'message':_0x85f9('0x17')});}else if(_0x2a36a2[_0x85f9('0xb')]>0x0){if(_0x5cc552['blocked']){if(_0x2a36a2[_0x85f9('0xc')]>0x0){if(moment(_0x5cc552[_0x85f9('0x11')])[_0x85f9('0x18')](_0x2a36a2[_0x85f9('0xc')],_0x85f9('0x19'))>moment()){return _0x108712(null,![],{'message':_0x85f9('0x17')});}else{return utils[_0x85f9('0x1a')](_0x5cc552,_0x1d1ecd,![],null)[_0x85f9('0x1b')](function(){return _0x108712(null,![],{'message':_0x85f9('0x17')});});}}else{return _0x108712(null,![],{'message':_0x85f9('0x17')});}}else{if(_0x1d1ecd>=_0x2a36a2['allowedLoginAttempts']){return utils['clearBlockUser'](_0x5cc552,0x0,!![],moment())[_0x85f9('0x1b')](function(){return _0x108712(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x85f9('0x1a')](_0x5cc552,_0x1d1ecd,![],null)[_0x85f9('0x1b')](function(){return _0x108712(null,![],{'message':_0x85f9('0x17')});});}}}else{return _0x108712(null,![],{'message':_0x85f9('0x17')});}}else{if(_0x5cc552[_0x85f9('0xf')]){return _0x108712(null,![],{'message':_0x85f9('0x17')});}else if(_0x2a36a2[_0x85f9('0xb')]>0x0){if(_0x5cc552['blocked']){if(_0x2a36a2[_0x85f9('0xc')]>0x0){if(moment(_0x5cc552[_0x85f9('0x11')])[_0x85f9('0x18')](_0x2a36a2[_0x85f9('0xc')],_0x85f9('0x19'))>moment()){return _0x108712(null,![],{'message':_0x85f9('0x17')});}else{return utils[_0x85f9('0x1a')](_0x5cc552,0x0,![],null)[_0x85f9('0x1b')](function(){return utils[_0x85f9('0x1c')](_0x5cc552);})[_0x85f9('0x1b')](function(){return _0x108712(null,_0x5cc552);});}}else{return _0x108712(null,![],{'message':_0x85f9('0x17')});}}else{return utils['clearBlockUser'](_0x5cc552,0x0,![],null)[_0x85f9('0x1b')](function(){return utils['getLicense'](_0x5cc552);})[_0x85f9('0x1b')](function(){return _0x108712(null,_0x5cc552);})[_0x85f9('0x1d')](function(_0x22ceff){return _0x108712(null,![],_0x22ceff);});}}else{if(_0x5cc552[_0x85f9('0x10')]){return _0x108712(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x5cc552)['then'](function(){return _0x108712(null,_0x5cc552);});}}}});})[_0x85f9('0x1d')](function(_0x49e9a3){return _0x108712(null,![],_0x49e9a3);});}function sendServiceMail(_0x45b0f2){return db[_0x85f9('0x1e')][_0x85f9('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x85f9('0x14'),_0x85f9('0x20')],'include':[{'model':db[_0x85f9('0x21')],'as':_0x85f9('0x22')}]})[_0x85f9('0x1b')](function(_0x132526){if(!_0x132526){throw new Error(_0x85f9('0x23'));}var _0x3df7df={'tls':{'rejectUnauthorized':![]}};if(_0x132526[_0x85f9('0x22')][_0x85f9('0x24')]){_0x3df7df[_0x85f9('0x24')]=_0x132526[_0x85f9('0x22')][_0x85f9('0x24')];}else{_0x3df7df[_0x85f9('0x25')]=_0x132526[_0x85f9('0x22')]['host'];_0x3df7df[_0x85f9('0x26')]=_0x132526[_0x85f9('0x22')][_0x85f9('0x26')];_0x3df7df[_0x85f9('0x27')]=_0x132526[_0x85f9('0x22')]['secure'];}if(_0x132526[_0x85f9('0x22')][_0x85f9('0x28')]){_0x3df7df['auth']={'user':_0x132526[_0x85f9('0x22')][_0x85f9('0x12')],'pass':_0x132526['Smtp'][_0x85f9('0x29')]};}var _0x39f6b1={'account':_0x3df7df,'message':_[_0x85f9('0x2a')]({'from':util[_0x85f9('0x2b')](_0x85f9('0x2c'),_0x132526['name'],_0x132526[_0x85f9('0x20')]||_0x132526[_0x85f9('0x22')][_0x85f9('0x12')])},_0x45b0f2)};return client['request'](_0x85f9('0x2d'),_0x39f6b1);})[_0x85f9('0x1b')](function(_0x2f789b){if(_0x2f789b[_0x85f9('0x2e')]){throw new Error(util[_0x85f9('0x2b')](_0x85f9('0x2f'),_0x2f789b[_0x85f9('0x2e')][_0x85f9('0x30')]||JSON[_0x85f9('0x31')](_0x2f789b[_0x85f9('0x2e')])));}return!![];});}function handleError(_0x1d9bdb,_0x348bcf,_0xfd7523){return _0x1d9bdb['status'](_0x348bcf||0x1f4)[_0x85f9('0x32')]({'message':_0xfd7523?_0xfd7523[_0x85f9('0x30')]||_0xfd7523:''});}function checkPasswordPattern(_0x3c5f16,_0x2a0746,_0x1ec9ab){if(_0x1ec9ab){var _0x5524cb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5524cb['test'](_0x2a0746)){return _0x3c5f16;}else{throw new Error(_0x85f9('0x33'));}}else{return _0x3c5f16;}}exports[_0x85f9('0x34')]=function(_0x176a76,_0x470c80,_0x1c636c){passport[_0x85f9('0x15')](_0x85f9('0x35'),function(_0x29fd4d,_0xe988a4,_0x302169){var _0x38ca6a=_0x29fd4d||_0x302169;if(_0x38ca6a){return handleError(_0x470c80,0x191,_0x38ca6a);}if(!_0xe988a4){return handleError(_0x470c80,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x24bfdb={'payload':{'id':_0xe988a4['id'],'role':_0xe988a4[_0x85f9('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0x85f9('0x37')](_0x24bfdb)[_0x85f9('0x1b')](function(_0x117a23){_0x470c80['json']({'id':_0xe988a4['id'],'token':_0x117a23,'statusCall':'','isAlreadyLogged':_0xe988a4['online']});});}})(_0x176a76,_0x470c80,_0x1c636c);};exports[_0x85f9('0x38')]=function(_0xd4d78f,_0x1b5a9a,_0x4b92ba){if(!_0xd4d78f['body'][_0x85f9('0x20')]){return handleError(_0x1b5a9a,0x1f4,{'message':_0x85f9('0x39')});}var _0x4870b2=rs[_0x85f9('0x3a')]();_0xd4d78f[_0x85f9('0x3b')]['email']=_0xd4d78f['body'][_0x85f9('0x20')][_0x85f9('0x3c')]()[_0x85f9('0x3d')]();var _0x3c7a45;return db[_0x85f9('0x9')][_0x85f9('0xa')]({'where':{'id':0x1},'attributes':[_0x85f9('0xb'),_0x85f9('0xc')],'raw':!![]})[_0x85f9('0x1b')](function(_0x297750){_0x3c7a45=_0x297750;return db[_0x85f9('0x3e')][_0x85f9('0x1f')]({'where':{'email':_0xd4d78f[_0x85f9('0x3b')][_0x85f9('0x20')]}});})[_0x85f9('0x1b')](function(_0x250b4f){if(!_0x250b4f){throw new Error(_0x85f9('0x3f'));}if(_0x250b4f['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x250b4f['blocked']){if(moment(_0x250b4f[_0x85f9('0x11')])['add'](_0x3c7a45[_0x85f9('0xc')],_0x85f9('0x19'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x250b4f['blocked']=![];_0x250b4f['blockedAt']=null;}}_0x250b4f[_0x85f9('0x40')]=_0x4870b2;_0x250b4f['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x250b4f[_0x85f9('0x41')]();})[_0x85f9('0x1b')](function(){return sendServiceMail({'to':_0xd4d78f[_0x85f9('0x3b')]['email'],'subject':_0x85f9('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x85f9('0x43')+'http://'+_0xd4d78f[_0x85f9('0x44')][_0x85f9('0x25')]+_0x85f9('0x45')+_0x4870b2+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x85f9('0x1b')](function(){_0x1b5a9a[_0x85f9('0x46')](0xc8)[_0x85f9('0x32')]({'message':'Reset\x20Email\x20sent!'});})[_0x85f9('0x1d')](function(_0x2213b1){return handleError(_0x1b5a9a,0x1f4,_0x2213b1);});};exports['reset']=function(_0x4ac97c,_0x31afd9,_0x191e6c){var _0x510fae;return db[_0x85f9('0x3e')][_0x85f9('0x1f')]({'where':{'resetPasswordToken':_0x4ac97c[_0x85f9('0x47')][_0x85f9('0x48')],'resetPasswordExpires':{'$gt':Date[_0x85f9('0x49')]()}}})[_0x85f9('0x1b')](function(_0x78a7e3){_0x510fae=_0x78a7e3;if(!_0x510fae){throw new Error(_0x85f9('0x4a'));}return db['Setting'][_0x85f9('0xa')]({'attributes':['id','securePassword']});})[_0x85f9('0x1b')](function(_0x4b58e6){return checkPasswordPattern(_0x4b58e6,_0x4ac97c[_0x85f9('0x3b')][_0x85f9('0xd')],_0x4b58e6['securePassword']);})[_0x85f9('0x1b')](function(){_0x510fae[_0x85f9('0xd')]=_0x4ac97c['body'][_0x85f9('0xd')];_0x510fae['resetPasswordToken']=null;_0x510fae['resetPasswordExpires']=null;return _0x510fae[_0x85f9('0x41')]();})[_0x85f9('0x1b')](function(){_0x31afd9['status'](0xc8)[_0x85f9('0x32')]({'message':_0x85f9('0x4b')});})[_0x85f9('0x1d')](function(_0x40a26e){return handleError(_0x31afd9,0x1f4,_0x40a26e);});};passport[_0x85f9('0x4c')](new LocalStrategy({'usernameField':_0x85f9('0x14'),'passwordField':_0x85f9('0xd')},function(_0x3484be,_0x16e4b8,_0x57377c){return localAuthenticate(db[_0x85f9('0x3e')],_0x3484be,_0x16e4b8,_0x57377c);})); \ No newline at end of file +var _0x674b=['stringify','status','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','local','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','securePassword','password','save','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../components/auth/service','client','http','Setting','findOne','name','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockDuration','minutes','clearBlockUser','add','getLicense','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','Smtp','host','port','secure','pass','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message'];(function(_0x5cacb7,_0x15f641){var _0x8b049f=function(_0xdbec23){while(--_0xdbec23){_0x5cacb7['push'](_0x5cacb7['shift']());}};_0x8b049f(++_0x15f641);}(_0x674b,0xcd));var _0xb674=function(_0x246f92,_0xcf7bd4){_0x246f92=_0x246f92-0x0;var _0x2b8e7d=_0x674b[_0x246f92];return _0x2b8e7d;};'use strict';var util=require(_0xb674('0x0'));var passport=require(_0xb674('0x1'));var LocalStrategy=require(_0xb674('0x2'))[_0xb674('0x3')];var jayson=require(_0xb674('0x4'));var _=require(_0xb674('0x5'));var rs=require(_0xb674('0x6'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xb674('0x7'));var utils=require('../../config/utils');var client=jayson[_0xb674('0x8')][_0xb674('0x9')]({'port':0x232b});function localAuthenticate(_0x5e738c,_0x20a428,_0x18254b,_0x26f937){var _0x52c102,_0x3d86f3;return db[_0xb674('0xa')][_0xb674('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x4bccd6){_0x52c102=_0x4bccd6;return _0x5e738c[_0xb674('0xb')]({'attributes':['id',_0xb674('0xc'),'password',_0xb674('0xd'),_0xb674('0xe'),_0xb674('0xf'),_0xb674('0x10'),_0xb674('0x11'),_0xb674('0x12')],'where':{'name':_0x20a428,'role':{'$or':[_0xb674('0x13'),_0xb674('0x14'),_0xb674('0x15')]}}});})[_0xb674('0x16')](function(_0x31ed8f){if(!_0x31ed8f||_0x31ed8f&&_0x31ed8f[_0xb674('0xc')]!==_0x20a428){throw new Error(_0xb674('0x17'));}else{_0x3d86f3=_0x31ed8f;return _0x3d86f3;}})[_0xb674('0x16')](function(){_0x3d86f3[_0xb674('0x18')](_0x18254b,function(_0x118cdc,_0x10abce){var _0x3db67f=_0x3d86f3[_0xb674('0x12')]+0x1;if(_0x118cdc){return _0x26f937(_0x118cdc);}else if(!_0x10abce){if(_0x3d86f3[_0xb674('0xf')]){return _0x26f937(null,![],{'message':_0xb674('0x17')});}else if(_0x52c102[_0xb674('0x19')]>0x0){if(_0x3d86f3[_0xb674('0x10')]){if(_0x52c102[_0xb674('0x1a')]>0x0){if(moment(_0x3d86f3[_0xb674('0x11')])['add'](_0x52c102[_0xb674('0x1a')],_0xb674('0x1b'))>moment()){return _0x26f937(null,![],{'message':_0xb674('0x17')});}else{return utils[_0xb674('0x1c')](_0x3d86f3,_0x3db67f,![],null)['then'](function(){return _0x26f937(null,![],{'message':_0xb674('0x17')});});}}else{return _0x26f937(null,![],{'message':_0xb674('0x17')});}}else{if(_0x3db67f>=_0x52c102['allowedLoginAttempts']){return utils[_0xb674('0x1c')](_0x3d86f3,0x0,!![],moment())[_0xb674('0x16')](function(){return _0x26f937(null,![],{'message':_0xb674('0x17')});});}else{return utils[_0xb674('0x1c')](_0x3d86f3,_0x3db67f,![],null)[_0xb674('0x16')](function(){return _0x26f937(null,![],{'message':_0xb674('0x17')});});}}}else{return _0x26f937(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3d86f3[_0xb674('0xf')]){return _0x26f937(null,![],{'message':_0xb674('0x17')});}else if(_0x52c102[_0xb674('0x19')]>0x0){if(_0x3d86f3[_0xb674('0x10')]){if(_0x52c102[_0xb674('0x1a')]>0x0){if(moment(_0x3d86f3['blockedAt'])[_0xb674('0x1d')](_0x52c102[_0xb674('0x1a')],_0xb674('0x1b'))>moment()){return _0x26f937(null,![],{'message':_0xb674('0x17')});}else{return utils[_0xb674('0x1c')](_0x3d86f3,0x0,![],null)[_0xb674('0x16')](function(){return utils[_0xb674('0x1e')](_0x3d86f3);})['then'](function(){return _0x26f937(null,_0x3d86f3);});}}else{return _0x26f937(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xb674('0x1c')](_0x3d86f3,0x0,![],null)[_0xb674('0x16')](function(){return utils[_0xb674('0x1e')](_0x3d86f3);})[_0xb674('0x16')](function(){return _0x26f937(null,_0x3d86f3);})[_0xb674('0x1f')](function(_0x2cd63b){return _0x26f937(null,![],_0x2cd63b);});}}else{if(_0x3d86f3[_0xb674('0x10')]){return _0x26f937(null,![],{'message':_0xb674('0x17')});}else{return utils[_0xb674('0x1e')](_0x3d86f3)[_0xb674('0x16')](function(){return _0x26f937(null,_0x3d86f3);});}}}});})[_0xb674('0x1f')](function(_0x4752e8){return _0x26f937(null,![],_0x4752e8);});}function sendServiceMail(_0x44ae4b){return db[_0xb674('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0xb674('0xc'),_0xb674('0x21')],'include':[{'model':db[_0xb674('0x22')],'as':'Smtp'}]})['then'](function(_0x13ce60){if(!_0x13ce60){throw new Error(_0xb674('0x23'));}var _0x181d4d={'tls':{'rejectUnauthorized':![]}};if(_0x13ce60['Smtp'][_0xb674('0x24')]){_0x181d4d[_0xb674('0x24')]=_0x13ce60[_0xb674('0x25')][_0xb674('0x24')];}else{_0x181d4d[_0xb674('0x26')]=_0x13ce60[_0xb674('0x25')][_0xb674('0x26')];_0x181d4d[_0xb674('0x27')]=_0x13ce60[_0xb674('0x25')][_0xb674('0x27')];_0x181d4d[_0xb674('0x28')]=_0x13ce60[_0xb674('0x25')][_0xb674('0x28')];}if(_0x13ce60['Smtp']['authentication']){_0x181d4d['auth']={'user':_0x13ce60['Smtp'][_0xb674('0x14')],'pass':_0x13ce60[_0xb674('0x25')][_0xb674('0x29')]};}var _0x35779d={'account':_0x181d4d,'message':_[_0xb674('0x2a')]({'from':util['format'](_0xb674('0x2b'),_0x13ce60[_0xb674('0xc')],_0x13ce60[_0xb674('0x21')]||_0x13ce60[_0xb674('0x25')]['user'])},_0x44ae4b)};return client[_0xb674('0x2c')](_0xb674('0x2d'),_0x35779d);})['then'](function(_0x76eb95){if(_0x76eb95[_0xb674('0x2e')]){throw new Error(util[_0xb674('0x2f')](_0xb674('0x30'),_0x76eb95['error'][_0xb674('0x31')]||JSON[_0xb674('0x32')](_0x76eb95['error'])));}return!![];});}function handleError(_0x404265,_0x356568,_0x526449){return _0x404265[_0xb674('0x33')](_0x356568||0x1f4)[_0xb674('0x34')]({'message':_0x526449?_0x526449[_0xb674('0x31')]||_0x526449:''});}function checkPasswordPattern(_0x288487,_0x5c9721,_0x28c569){if(_0x28c569){var _0x22e67b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x22e67b[_0xb674('0x35')](_0x5c9721)){return _0x288487;}else{throw new Error(_0xb674('0x36'));}}else{return _0x288487;}}exports[_0xb674('0x37')]=function(_0x319a01,_0xfedde8,_0x51abd8){passport[_0xb674('0x18')](_0xb674('0x38'),function(_0x11d696,_0x5af02b,_0x336495){var _0x57eec5=_0x11d696||_0x336495;if(_0x57eec5){return handleError(_0xfedde8,0x191,_0x57eec5);}if(!_0x5af02b){return handleError(_0xfedde8,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xd8c0ce={'payload':{'id':_0x5af02b['id'],'role':_0x5af02b['role']},'options':{'expiresIn':0x15180}};return authService[_0xb674('0x39')](_0xd8c0ce)[_0xb674('0x16')](function(_0x325937){_0xfedde8[_0xb674('0x3a')]({'id':_0x5af02b['id'],'token':_0x325937,'statusCall':'','isAlreadyLogged':_0x5af02b[_0xb674('0x3b')]});});}})(_0x319a01,_0xfedde8,_0x51abd8);};exports[_0xb674('0x3c')]=function(_0x51e6fd,_0x56b251,_0x1c2128){if(!_0x51e6fd[_0xb674('0x3d')][_0xb674('0x21')]){return handleError(_0x56b251,0x1f4,{'message':_0xb674('0x3e')});}var _0x10302a=rs[_0xb674('0x3f')]();_0x51e6fd['body'][_0xb674('0x21')]=_0x51e6fd[_0xb674('0x3d')][_0xb674('0x21')][_0xb674('0x40')]()['toLowerCase']();var _0x2caefc;return db[_0xb674('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})['then'](function(_0x120fcb){_0x2caefc=_0x120fcb;return db[_0xb674('0x41')][_0xb674('0x42')]({'where':{'email':_0x51e6fd[_0xb674('0x3d')][_0xb674('0x21')]}});})[_0xb674('0x16')](function(_0x4c5596){if(!_0x4c5596){throw new Error(_0xb674('0x43'));}if(_0x4c5596[_0xb674('0xf')]){throw new Error(_0xb674('0x44'));}if(_0x4c5596[_0xb674('0x10')]){if(moment(_0x4c5596['blockedAt'])[_0xb674('0x1d')](_0x2caefc[_0xb674('0x1a')],'minutes')>moment()){throw new Error(_0xb674('0x45'));}else{_0x4c5596[_0xb674('0x10')]=![];_0x4c5596[_0xb674('0x11')]=null;}}_0x4c5596[_0xb674('0x46')]=_0x10302a;_0x4c5596[_0xb674('0x47')]=Date[_0xb674('0x48')]()+0x36ee80;return _0x4c5596['save']();})[_0xb674('0x16')](function(){return sendServiceMail({'to':_0x51e6fd[_0xb674('0x3d')][_0xb674('0x21')],'subject':_0xb674('0x49'),'text':_0xb674('0x4a')+_0xb674('0x4b')+_0xb674('0x4c')+_0x51e6fd[_0xb674('0x4d')][_0xb674('0x26')]+_0xb674('0x4e')+_0x10302a+'\x0a\x0a'+_0xb674('0x4f')});})['then'](function(){_0x56b251[_0xb674('0x33')](0xc8)[_0xb674('0x34')]({'message':'Reset\x20Email\x20sent!'});})[_0xb674('0x1f')](function(_0x14b677){return handleError(_0x56b251,0x1f4,_0x14b677);});};exports[_0xb674('0x50')]=function(_0x440b79,_0x424615,_0x32d1dc){var _0x158be5;return db[_0xb674('0x41')]['find']({'where':{'resetPasswordToken':_0x440b79['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xb674('0x16')](function(_0x3aee8f){_0x158be5=_0x3aee8f;if(!_0x158be5){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xb674('0xa')]['findOne']({'attributes':['id',_0xb674('0x51')]});})[_0xb674('0x16')](function(_0x2ffacd){return checkPasswordPattern(_0x2ffacd,_0x440b79['body'][_0xb674('0x52')],_0x2ffacd[_0xb674('0x51')]);})[_0xb674('0x16')](function(){_0x158be5[_0xb674('0x52')]=_0x440b79[_0xb674('0x3d')][_0xb674('0x52')];_0x158be5['resetPasswordToken']=null;_0x158be5['resetPasswordExpires']=null;return _0x158be5[_0xb674('0x53')]();})[_0xb674('0x16')](function(){_0x424615[_0xb674('0x33')](0xc8)[_0xb674('0x34')]({'message':_0xb674('0x54')});})[_0xb674('0x1f')](function(_0x1f3b72){return handleError(_0x424615,0x1f4,_0x1f3b72);});};passport['use'](new LocalStrategy({'usernameField':_0xb674('0xc'),'passwordField':_0xb674('0x52')},function(_0x1b9a53,_0x2c255a,_0x1ea9b0){return localAuthenticate(db[_0xb674('0x41')],_0x1b9a53,_0x2c255a,_0x1ea9b0);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 252a3c9..cac14d9 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 _0x2af4=['reset','exports','Router','./authLocal.controller','post','login','forgot','/reset/:token'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2af4,0x9a));var _0x42af=function(_0x3d4c02,_0x3460fe){_0x3d4c02=_0x3d4c02-0x0;var _0x2c9a56=_0x2af4[_0x3d4c02];return _0x2c9a56;};'use strict';var express=require('express');var router=express[_0x42af('0x0')]();var controller=require(_0x42af('0x1'));router[_0x42af('0x2')]('/',controller[_0x42af('0x3')]);router['post']('/forgot',controller[_0x42af('0x4')]);router[_0x42af('0x2')](_0x42af('0x5'),controller[_0x42af('0x6')]);module[_0x42af('0x7')]=router; \ No newline at end of file +var _0x67ce=['express','Router','post','/forgot','forgot','reset','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x67ce,0x149));var _0xe67c=function(_0xe6c51b,_0x55e728){_0xe6c51b=_0xe6c51b-0x0;var _0x5d3bef=_0x67ce[_0xe6c51b];return _0x5d3bef;};'use strict';var express=require(_0xe67c('0x0'));var router=express[_0xe67c('0x1')]();var controller=require('./authLocal.controller');router[_0xe67c('0x2')]('/',controller['login']);router['post'](_0xe67c('0x3'),controller[_0xe67c('0x4')]);router[_0xe67c('0x2')]('/reset/:token',controller[_0xe67c('0x5')]);module[_0xe67c('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 07caaf4..10102c4 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 _0x26a8=['STRING','INTEGER','sequelize','exports'];(function(_0x26c272,_0x4de7a0){var _0xbc0b9c=function(_0x4d1edd){while(--_0x4d1edd){_0x26c272['push'](_0x26c272['shift']());}};_0xbc0b9c(++_0x4de7a0);}(_0x26a8,0xa6));var _0x826a=function(_0x28d745,_0x16f88b){_0x28d745=_0x28d745-0x0;var _0x14d5b3=_0x26a8[_0x28d745];return _0x14d5b3;};'use strict';var Sequelize=require(_0x826a('0x0'));module[_0x826a('0x1')]={'name':{'type':Sequelize[_0x826a('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x826a('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd475=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xd475,0x1e7));var _0x5d47=function(_0x2867bd,_0x42c92a){_0x2867bd=_0x2867bd-0x0;var _0x55668f=_0xd475[_0x2867bd];return _0x55668f;};'use strict';var Sequelize=require(_0x5d47('0x0'));module[_0x5d47('0x1')]={'name':{'type':Sequelize[_0x5d47('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5d47('0x2')]},'description':{'type':Sequelize[_0x5d47('0x2')]},'status':{'type':Sequelize[_0x5d47('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5d47('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 87f9d2e..1ad775f 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 _0x4cbb=['limit','set','reject','then','error','name','send','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','rows','show','params','keys','rawAttributes','find','catch','create','body','update','destroy','addConditions','Condition','omit','getConditions','pick','Action','addActions','ids','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x14ec9d,_0x45d283){var _0x3636df=function(_0x472568){while(--_0x472568){_0x14ec9d['push'](_0x14ec9d['shift']());}};_0x3636df(++_0x45d283);}(_0x4cbb,0x180));var _0xb4cb=function(_0x118439,_0x1907d9){_0x118439=_0x118439-0x0;var _0x209b67=_0x4cbb[_0x118439];return _0x209b67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb4cb('0x0'));var rimraf=require(_0xb4cb('0x1'));var zipdir=require(_0xb4cb('0x2'));var jsonpatch=require(_0xb4cb('0x3'));var rp=require(_0xb4cb('0x4'));var moment=require(_0xb4cb('0x5'));var BPromise=require(_0xb4cb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb4cb('0x7'));var sox=require(_0xb4cb('0x8'));var csv=require('to-csv');var ejs=require(_0xb4cb('0x9'));var fs=require('fs');var _=require(_0xb4cb('0xa'));var squel=require(_0xb4cb('0xb'));var crypto=require(_0xb4cb('0xc'));var jsforce=require(_0xb4cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4cb('0xe'));var querystring=require(_0xb4cb('0xf'));var Papa=require(_0xb4cb('0x10'));var Redis=require(_0xb4cb('0x11'));var authService=require(_0xb4cb('0x12'));var qs=require(_0xb4cb('0x13'));var as=require(_0xb4cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb4cb('0x15'));var utils=require(_0xb4cb('0x16'));var config=require(_0xb4cb('0x17'));var db=require(_0xb4cb('0x18'))['db'];function respondWithStatusCode(_0xe833d4,_0xe1ea34){_0xe1ea34=_0xe1ea34||0xcc;return function(_0x127f17){if(_0x127f17){return _0xe833d4[_0xb4cb('0x19')](_0xe1ea34);}return _0xe833d4[_0xb4cb('0x1a')](_0xe1ea34)[_0xb4cb('0x1b')]();};}function respondWithResult(_0x3ca5af,_0x1e1002){_0x1e1002=_0x1e1002||0xc8;return function(_0x39e2c7){if(_0x39e2c7){return _0x3ca5af[_0xb4cb('0x1a')](_0x1e1002)[_0xb4cb('0x1c')](_0x39e2c7);}};}function respondWithFilteredResult(_0x1d04ce,_0x3a1d7e){return function(_0x13ae52){if(_0x13ae52){var _0x5248a4=_0x13ae52[_0xb4cb('0x1d')],_0x1caff7=_0x3a1d7e[_0xb4cb('0x1e')],_0x584d2d=_0x3a1d7e[_0xb4cb('0x1e')]+_0x3a1d7e[_0xb4cb('0x1f')],_0x204388;if(_0x584d2d>=_0x5248a4){_0x584d2d=_0x5248a4;_0x204388=0xc8;}else{_0x204388=0xce;}_0x1d04ce['status'](_0x204388);return _0x1d04ce[_0xb4cb('0x20')]('Content-Range',_0x1caff7+'-'+_0x584d2d+'/'+_0x5248a4)[_0xb4cb('0x1c')](_0x13ae52);}return null;};}function patchUpdates(_0x4a725b){return function(_0x1f758b){try{jsonpatch['apply'](_0x1f758b,_0x4a725b,!![]);}catch(_0x1f1a9e){return BPromise[_0xb4cb('0x21')](_0x1f1a9e);}return _0x1f758b['save']();};}function saveUpdates(_0x579698,_0x36adc6){return function(_0x59676e){if(_0x59676e){return _0x59676e['update'](_0x579698)[_0xb4cb('0x22')](function(_0x12329e){return _0x12329e;});}return null;};}function removeEntity(_0x545f23,_0x1e82c8){return function(_0x2754dd){if(_0x2754dd){return _0x2754dd['destroy']()['then'](function(){_0x545f23[_0xb4cb('0x1a')](0xcc)[_0xb4cb('0x1b')]();});}};}function handleEntityNotFound(_0x3ef486,_0x4358bc){return function(_0x58d6d1){if(!_0x58d6d1){_0x3ef486[_0xb4cb('0x19')](0x194);}return _0x58d6d1;};}function handleError(_0xc118c8,_0x3599f1){_0x3599f1=_0x3599f1||0x1f4;return function(_0x5c6dce){logger[_0xb4cb('0x23')](_0x5c6dce['stack']);if(_0x5c6dce[_0xb4cb('0x24')]){delete _0x5c6dce['name'];}_0xc118c8['status'](_0x3599f1)[_0xb4cb('0x25')](_0x5c6dce);};}exports['index']=function(_0xbaee57,_0xa3fa28){var _0x531df5={},_0x280f7f={},_0x175df8={'count':0x0,'rows':[]};var _0x20ed75=_[_0xb4cb('0x26')](db['Automation']['rawAttributes'],function(_0x23519c){return{'name':_0x23519c[_0xb4cb('0x27')],'type':_0x23519c[_0xb4cb('0x28')][_0xb4cb('0x29')]};});_0x280f7f[_0xb4cb('0x2a')]=_[_0xb4cb('0x26')](_0x20ed75,'name');_0x280f7f[_0xb4cb('0x2b')]=_['keys'](_0xbaee57[_0xb4cb('0x2b')]);_0x280f7f[_0xb4cb('0x2c')]=_[_0xb4cb('0x2d')](_0x280f7f['model'],_0x280f7f[_0xb4cb('0x2b')]);_0x531df5[_0xb4cb('0x2e')]=_[_0xb4cb('0x2d')](_0x280f7f[_0xb4cb('0x2a')],qs[_0xb4cb('0x2f')](_0xbaee57[_0xb4cb('0x2b')][_0xb4cb('0x2f')]));_0x531df5[_0xb4cb('0x2e')]=_0x531df5['attributes'][_0xb4cb('0x30')]?_0x531df5[_0xb4cb('0x2e')]:_0x280f7f[_0xb4cb('0x2a')];if(!_0xbaee57[_0xb4cb('0x2b')][_0xb4cb('0x31')](_0xb4cb('0x32'))){_0x531df5['limit']=qs['limit'](_0xbaee57[_0xb4cb('0x2b')][_0xb4cb('0x1f')]);_0x531df5[_0xb4cb('0x1e')]=qs[_0xb4cb('0x1e')](_0xbaee57['query'][_0xb4cb('0x1e')]);}_0x531df5[_0xb4cb('0x33')]=qs['sort'](_0xbaee57['query'][_0xb4cb('0x34')]);_0x531df5[_0xb4cb('0x35')]=qs[_0xb4cb('0x2c')](_['pick'](_0xbaee57['query'],_0x280f7f[_0xb4cb('0x2c')]),_0x20ed75);if(_0xbaee57[_0xb4cb('0x2b')][_0xb4cb('0x36')]){_0x531df5[_0xb4cb('0x35')]=_[_0xb4cb('0x37')](_0x531df5[_0xb4cb('0x35')],{'$or':_[_0xb4cb('0x26')](_0x20ed75,function(_0x99553b){if(_0x99553b[_0xb4cb('0x28')]!==_0xb4cb('0x38')){var _0x1169d2={};_0x1169d2[_0x99553b['name']]={'$like':'%'+_0xbaee57[_0xb4cb('0x2b')][_0xb4cb('0x36')]+'%'};return _0x1169d2;}})});}_0x531df5=_[_0xb4cb('0x37')]({},_0x531df5,_0xbaee57[_0xb4cb('0x39')]);var _0x44aecc={'where':_0x531df5[_0xb4cb('0x35')]};return db[_0xb4cb('0x3a')][_0xb4cb('0x1d')](_0x44aecc)[_0xb4cb('0x22')](function(_0x4bc1f4){_0x175df8[_0xb4cb('0x1d')]=_0x4bc1f4;if(_0xbaee57[_0xb4cb('0x2b')][_0xb4cb('0x3b')]){_0x531df5[_0xb4cb('0x3c')]=[{'all':!![]}];}return db['Automation'][_0xb4cb('0x3d')](_0x531df5);})[_0xb4cb('0x22')](function(_0x350709){_0x175df8[_0xb4cb('0x3e')]=_0x350709;return _0x175df8;})[_0xb4cb('0x22')](respondWithFilteredResult(_0xa3fa28,_0x531df5))['catch'](handleError(_0xa3fa28,null));};exports[_0xb4cb('0x3f')]=function(_0x5245e9,_0x233677){var _0x5071ce={'raw':![],'where':{'id':_0x5245e9[_0xb4cb('0x40')]['id']}},_0x430468={};_0x430468['model']=_[_0xb4cb('0x41')](db[_0xb4cb('0x3a')][_0xb4cb('0x42')]);_0x430468[_0xb4cb('0x2b')]=_['keys'](_0x5245e9[_0xb4cb('0x2b')]);_0x430468[_0xb4cb('0x2c')]=_[_0xb4cb('0x2d')](_0x430468[_0xb4cb('0x2a')],_0x430468[_0xb4cb('0x2b')]);_0x5071ce[_0xb4cb('0x2e')]=_[_0xb4cb('0x2d')](_0x430468[_0xb4cb('0x2a')],qs[_0xb4cb('0x2f')](_0x5245e9[_0xb4cb('0x2b')][_0xb4cb('0x2f')]));_0x5071ce[_0xb4cb('0x2e')]=_0x5071ce[_0xb4cb('0x2e')][_0xb4cb('0x30')]?_0x5071ce[_0xb4cb('0x2e')]:_0x430468[_0xb4cb('0x2a')];if(_0x5245e9[_0xb4cb('0x2b')][_0xb4cb('0x3b')]){_0x5071ce[_0xb4cb('0x3c')]=[{'all':!![]}];}_0x5071ce=_[_0xb4cb('0x37')]({},_0x5071ce,_0x5245e9[_0xb4cb('0x39')]);return db[_0xb4cb('0x3a')][_0xb4cb('0x43')](_0x5071ce)['then'](handleEntityNotFound(_0x233677,null))[_0xb4cb('0x22')](respondWithResult(_0x233677,null))[_0xb4cb('0x44')](handleError(_0x233677,null));};exports[_0xb4cb('0x45')]=function(_0x3a536e,_0x1c023a){return db[_0xb4cb('0x3a')][_0xb4cb('0x45')](_0x3a536e[_0xb4cb('0x46')],{})['then'](respondWithResult(_0x1c023a,0xc9))[_0xb4cb('0x44')](handleError(_0x1c023a,null));};exports[_0xb4cb('0x47')]=function(_0x27ff73,_0x34b5f0){if(_0x27ff73[_0xb4cb('0x46')]['id']){delete _0x27ff73['body']['id'];}return db[_0xb4cb('0x3a')][_0xb4cb('0x43')]({'where':{'id':_0x27ff73[_0xb4cb('0x40')]['id']}})[_0xb4cb('0x22')](handleEntityNotFound(_0x34b5f0,null))['then'](saveUpdates(_0x27ff73[_0xb4cb('0x46')],null))[_0xb4cb('0x22')](respondWithResult(_0x34b5f0,null))[_0xb4cb('0x44')](handleError(_0x34b5f0,null));};exports[_0xb4cb('0x48')]=function(_0x4be946,_0x293cfd){return db[_0xb4cb('0x3a')][_0xb4cb('0x43')]({'where':{'id':_0x4be946[_0xb4cb('0x40')]['id']}})[_0xb4cb('0x22')](handleEntityNotFound(_0x293cfd,null))['then'](removeEntity(_0x293cfd,null))[_0xb4cb('0x44')](handleError(_0x293cfd,null));};exports[_0xb4cb('0x49')]=function(_0x15b074,_0x5360dc,_0x1a0071){return db[_0xb4cb('0x4a')][_0xb4cb('0x43')]({'where':{'id':_0x15b074['params']['id']}})[_0xb4cb('0x22')](handleEntityNotFound(_0x5360dc,null))[_0xb4cb('0x22')](function(_0x4b12ba){if(_0x4b12ba){return _0x4b12ba[_0xb4cb('0x49')](_0x15b074['body']['ids'],_[_0xb4cb('0x4b')](_0x15b074['body'],['ids','id'])||{});}})[_0xb4cb('0x22')](respondWithResult(_0x5360dc,null))['catch'](handleError(_0x5360dc,null));};exports[_0xb4cb('0x4c')]=function(_0x4f5a8d,_0xff2a57,_0xdc752a){var _0x559662={};var _0xb2d13={};var _0x1ade02;var _0x3bdfc8;return db[_0xb4cb('0x3a')]['findOne']({'where':{'id':_0x4f5a8d['params']['id']}})[_0xb4cb('0x22')](handleEntityNotFound(_0xff2a57,null))[_0xb4cb('0x22')](function(_0x4b1a21){if(_0x4b1a21){_0x1ade02=_0x4b1a21;_0xb2d13['model']=_['keys'](db[_0xb4cb('0x4a')][_0xb4cb('0x42')]);_0xb2d13[_0xb4cb('0x2b')]=_['keys'](_0x4f5a8d[_0xb4cb('0x2b')]);_0xb2d13[_0xb4cb('0x2c')]=_[_0xb4cb('0x2d')](_0xb2d13[_0xb4cb('0x2a')],_0xb2d13[_0xb4cb('0x2b')]);_0x559662[_0xb4cb('0x2e')]=_[_0xb4cb('0x2d')](_0xb2d13[_0xb4cb('0x2a')],qs['fields'](_0x4f5a8d[_0xb4cb('0x2b')][_0xb4cb('0x2f')]));_0x559662[_0xb4cb('0x2e')]=_0x559662[_0xb4cb('0x2e')][_0xb4cb('0x30')]?_0x559662['attributes']:_0xb2d13[_0xb4cb('0x2a')];_0x559662[_0xb4cb('0x33')]=qs['sort'](_0x4f5a8d[_0xb4cb('0x2b')]['sort']);_0x559662['where']=qs['filters'](_[_0xb4cb('0x4d')](_0x4f5a8d[_0xb4cb('0x2b')],_0xb2d13[_0xb4cb('0x2c')]));if(_0x4f5a8d[_0xb4cb('0x2b')][_0xb4cb('0x36')]){_0x559662[_0xb4cb('0x35')]=_[_0xb4cb('0x37')](_0x559662[_0xb4cb('0x35')],{'$or':_['map'](_0x559662[_0xb4cb('0x2e')],function(_0x30c720){var _0x384376={};_0x384376[_0x30c720]={'$like':'%'+_0x4f5a8d[_0xb4cb('0x2b')][_0xb4cb('0x36')]+'%'};return _0x384376;})});}_0x559662=_['merge']({},_0x559662,_0x4f5a8d[_0xb4cb('0x39')]);return _0x1ade02[_0xb4cb('0x4c')](_0x559662);}})[_0xb4cb('0x22')](function(_0x51c57c){if(_0x51c57c){_0x3bdfc8=_0x51c57c[_0xb4cb('0x30')];if(!_0x4f5a8d[_0xb4cb('0x2b')][_0xb4cb('0x31')](_0xb4cb('0x32'))){_0x559662['limit']=qs[_0xb4cb('0x1f')](_0x4f5a8d[_0xb4cb('0x2b')]['limit']);_0x559662[_0xb4cb('0x1e')]=qs['offset'](_0x4f5a8d[_0xb4cb('0x2b')]['offset']);}return _0x1ade02[_0xb4cb('0x4c')](_0x559662);}})[_0xb4cb('0x22')](function(_0x12d7ef){if(_0x12d7ef){return _0x12d7ef?{'count':_0x3bdfc8,'rows':_0x12d7ef}:null;}})['then'](respondWithResult(_0xff2a57,null))[_0xb4cb('0x44')](handleError(_0xff2a57,null));};exports['addActions']=function(_0x7c1b46,_0xdb2766,_0x1f8f56){return db[_0xb4cb('0x4e')][_0xb4cb('0x43')]({'where':{'id':_0x7c1b46[_0xb4cb('0x40')]['id']}})[_0xb4cb('0x22')](handleEntityNotFound(_0xdb2766,null))[_0xb4cb('0x22')](function(_0x401541){if(_0x401541){return _0x401541[_0xb4cb('0x4f')](_0x7c1b46[_0xb4cb('0x46')][_0xb4cb('0x50')],_[_0xb4cb('0x4b')](_0x7c1b46[_0xb4cb('0x46')],[_0xb4cb('0x50'),'id'])||{});}})['then'](respondWithResult(_0xdb2766,null))['catch'](handleError(_0xdb2766,null));};exports[_0xb4cb('0x51')]=function(_0x2a1949,_0x32c0ef,_0x3139b3){var _0x5c7734={};var _0x5b6913={};var _0x46eb6f;var _0x26a2ee;return db[_0xb4cb('0x3a')][_0xb4cb('0x52')]({'where':{'id':_0x2a1949[_0xb4cb('0x40')]['id']}})[_0xb4cb('0x22')](handleEntityNotFound(_0x32c0ef,null))[_0xb4cb('0x22')](function(_0x4a31b5){if(_0x4a31b5){_0x46eb6f=_0x4a31b5;_0x5b6913['model']=_[_0xb4cb('0x41')](db[_0xb4cb('0x4e')][_0xb4cb('0x42')]);_0x5b6913['query']=_[_0xb4cb('0x41')](_0x2a1949['query']);_0x5b6913['filters']=_[_0xb4cb('0x2d')](_0x5b6913[_0xb4cb('0x2a')],_0x5b6913['query']);_0x5c7734[_0xb4cb('0x2e')]=_[_0xb4cb('0x2d')](_0x5b6913[_0xb4cb('0x2a')],qs[_0xb4cb('0x2f')](_0x2a1949[_0xb4cb('0x2b')][_0xb4cb('0x2f')]));_0x5c7734[_0xb4cb('0x2e')]=_0x5c7734[_0xb4cb('0x2e')]['length']?_0x5c7734[_0xb4cb('0x2e')]:_0x5b6913[_0xb4cb('0x2a')];_0x5c7734[_0xb4cb('0x33')]=qs[_0xb4cb('0x34')](_0x2a1949[_0xb4cb('0x2b')][_0xb4cb('0x34')]);_0x5c7734['where']=qs[_0xb4cb('0x2c')](_['pick'](_0x2a1949[_0xb4cb('0x2b')],_0x5b6913[_0xb4cb('0x2c')]));if(_0x2a1949['query']['filter']){_0x5c7734[_0xb4cb('0x35')]=_['merge'](_0x5c7734[_0xb4cb('0x35')],{'$or':_[_0xb4cb('0x26')](_0x5c7734['attributes'],function(_0x544c7a){var _0x259cf9={};_0x259cf9[_0x544c7a]={'$like':'%'+_0x2a1949[_0xb4cb('0x2b')][_0xb4cb('0x36')]+'%'};return _0x259cf9;})});}_0x5c7734=_[_0xb4cb('0x37')]({},_0x5c7734,_0x2a1949['options']);return _0x46eb6f[_0xb4cb('0x51')](_0x5c7734);}})[_0xb4cb('0x22')](function(_0x3a4571){if(_0x3a4571){_0x26a2ee=_0x3a4571[_0xb4cb('0x30')];if(!_0x2a1949[_0xb4cb('0x2b')][_0xb4cb('0x31')](_0xb4cb('0x32'))){_0x5c7734['limit']=qs['limit'](_0x2a1949[_0xb4cb('0x2b')][_0xb4cb('0x1f')]);_0x5c7734[_0xb4cb('0x1e')]=qs[_0xb4cb('0x1e')](_0x2a1949[_0xb4cb('0x2b')][_0xb4cb('0x1e')]);}return _0x46eb6f[_0xb4cb('0x51')](_0x5c7734);}})[_0xb4cb('0x22')](function(_0x579c1b){if(_0x579c1b){return _0x579c1b?{'count':_0x26a2ee,'rows':_0x579c1b}:null;}})[_0xb4cb('0x22')](respondWithResult(_0x32c0ef,null))[_0xb4cb('0x44')](handleError(_0x32c0ef,null));}; \ No newline at end of file +var _0x502f=['body','params','Condition','addConditions','omit','ids','getConditions','findOne','addActions','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','map','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','Automation','includeAll','include','findAll','rows','rawAttributes','find','catch','create'];(function(_0x583fc6,_0x355254){var _0x580750=function(_0xe0cae9){while(--_0xe0cae9){_0x583fc6['push'](_0x583fc6['shift']());}};_0x580750(++_0x355254);}(_0x502f,0xf2));var _0xf502=function(_0x217f8c,_0x52c7ad){_0x217f8c=_0x217f8c-0x0;var _0xa826d2=_0x502f[_0x217f8c];return _0xa826d2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf502('0x0'));var zipdir=require(_0xf502('0x1'));var jsonpatch=require(_0xf502('0x2'));var rp=require(_0xf502('0x3'));var moment=require(_0xf502('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf502('0x5'));var util=require('util');var path=require(_0xf502('0x6'));var sox=require(_0xf502('0x7'));var csv=require(_0xf502('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf502('0x9'));var squel=require(_0xf502('0xa'));var crypto=require('crypto');var jsforce=require(_0xf502('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf502('0x8'));var querystring=require(_0xf502('0xc'));var Papa=require(_0xf502('0xd'));var Redis=require(_0xf502('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf502('0xf'));var logger=require(_0xf502('0x10'))(_0xf502('0x11'));var utils=require(_0xf502('0x12'));var config=require(_0xf502('0x13'));var db=require(_0xf502('0x14'))['db'];function respondWithStatusCode(_0x5c6683,_0x47ecc7){_0x47ecc7=_0x47ecc7||0xcc;return function(_0x317e16){if(_0x317e16){return _0x5c6683[_0xf502('0x15')](_0x47ecc7);}return _0x5c6683[_0xf502('0x16')](_0x47ecc7)[_0xf502('0x17')]();};}function respondWithResult(_0x2b14d5,_0x313780){_0x313780=_0x313780||0xc8;return function(_0x490141){if(_0x490141){return _0x2b14d5[_0xf502('0x16')](_0x313780)['json'](_0x490141);}};}function respondWithFilteredResult(_0xaddece,_0x23ed20){return function(_0x13ac75){if(_0x13ac75){var _0x3d0025=_0x13ac75[_0xf502('0x18')],_0x4cd99b=_0x23ed20[_0xf502('0x19')],_0x123891=_0x23ed20[_0xf502('0x19')]+_0x23ed20['limit'],_0xc726cf;if(_0x123891>=_0x3d0025){_0x123891=_0x3d0025;_0xc726cf=0xc8;}else{_0xc726cf=0xce;}_0xaddece[_0xf502('0x16')](_0xc726cf);return _0xaddece[_0xf502('0x1a')](_0xf502('0x1b'),_0x4cd99b+'-'+_0x123891+'/'+_0x3d0025)['json'](_0x13ac75);}return null;};}function patchUpdates(_0x718e92){return function(_0x1a3b23){try{jsonpatch['apply'](_0x1a3b23,_0x718e92,!![]);}catch(_0x1cd892){return BPromise[_0xf502('0x1c')](_0x1cd892);}return _0x1a3b23[_0xf502('0x1d')]();};}function saveUpdates(_0x4b8266,_0x2b7064){return function(_0x91d42f){if(_0x91d42f){return _0x91d42f['update'](_0x4b8266)[_0xf502('0x1e')](function(_0x33f291){return _0x33f291;});}return null;};}function removeEntity(_0x3d45bd,_0x27c34b){return function(_0x185d50){if(_0x185d50){return _0x185d50[_0xf502('0x1f')]()[_0xf502('0x1e')](function(){_0x3d45bd['status'](0xcc)[_0xf502('0x17')]();});}};}function handleEntityNotFound(_0x489888,_0x1c2a17){return function(_0x158897){if(!_0x158897){_0x489888[_0xf502('0x15')](0x194);}return _0x158897;};}function handleError(_0x51df0c,_0x3aa8c3){_0x3aa8c3=_0x3aa8c3||0x1f4;return function(_0x153a1d){logger[_0xf502('0x20')](_0x153a1d[_0xf502('0x21')]);if(_0x153a1d[_0xf502('0x22')]){delete _0x153a1d[_0xf502('0x22')];}_0x51df0c['status'](_0x3aa8c3)['send'](_0x153a1d);};}exports['index']=function(_0x216b8c,_0xf07538){var _0x46b579={},_0x3c97ff={},_0x2f3d1e={'count':0x0,'rows':[]};var _0xca229d=_[_0xf502('0x23')](db['Automation']['rawAttributes'],function(_0x191621){return{'name':_0x191621[_0xf502('0x24')],'type':_0x191621[_0xf502('0x25')][_0xf502('0x26')]};});_0x3c97ff[_0xf502('0x27')]=_[_0xf502('0x23')](_0xca229d,_0xf502('0x22'));_0x3c97ff[_0xf502('0x28')]=_[_0xf502('0x29')](_0x216b8c[_0xf502('0x28')]);_0x3c97ff['filters']=_[_0xf502('0x2a')](_0x3c97ff[_0xf502('0x27')],_0x3c97ff[_0xf502('0x28')]);_0x46b579['attributes']=_[_0xf502('0x2a')](_0x3c97ff[_0xf502('0x27')],qs[_0xf502('0x2b')](_0x216b8c[_0xf502('0x28')][_0xf502('0x2b')]));_0x46b579[_0xf502('0x2c')]=_0x46b579[_0xf502('0x2c')][_0xf502('0x2d')]?_0x46b579[_0xf502('0x2c')]:_0x3c97ff[_0xf502('0x27')];if(!_0x216b8c[_0xf502('0x28')][_0xf502('0x2e')](_0xf502('0x2f'))){_0x46b579['limit']=qs[_0xf502('0x30')](_0x216b8c[_0xf502('0x28')][_0xf502('0x30')]);_0x46b579[_0xf502('0x19')]=qs[_0xf502('0x19')](_0x216b8c[_0xf502('0x28')]['offset']);}_0x46b579['order']=qs[_0xf502('0x31')](_0x216b8c['query'][_0xf502('0x31')]);_0x46b579[_0xf502('0x32')]=qs[_0xf502('0x33')](_[_0xf502('0x34')](_0x216b8c['query'],_0x3c97ff['filters']),_0xca229d);if(_0x216b8c[_0xf502('0x28')][_0xf502('0x35')]){_0x46b579[_0xf502('0x32')]=_[_0xf502('0x36')](_0x46b579[_0xf502('0x32')],{'$or':_['map'](_0xca229d,function(_0x592b73){if(_0x592b73['type']!==_0xf502('0x37')){var _0x508a3f={};_0x508a3f[_0x592b73[_0xf502('0x22')]]={'$like':'%'+_0x216b8c[_0xf502('0x28')]['filter']+'%'};return _0x508a3f;}})});}_0x46b579=_['merge']({},_0x46b579,_0x216b8c[_0xf502('0x38')]);var _0x4f5138={'where':_0x46b579[_0xf502('0x32')]};return db[_0xf502('0x39')][_0xf502('0x18')](_0x4f5138)[_0xf502('0x1e')](function(_0x40bd55){_0x2f3d1e[_0xf502('0x18')]=_0x40bd55;if(_0x216b8c['query'][_0xf502('0x3a')]){_0x46b579[_0xf502('0x3b')]=[{'all':!![]}];}return db[_0xf502('0x39')][_0xf502('0x3c')](_0x46b579);})[_0xf502('0x1e')](function(_0x14a874){_0x2f3d1e[_0xf502('0x3d')]=_0x14a874;return _0x2f3d1e;})[_0xf502('0x1e')](respondWithFilteredResult(_0xf07538,_0x46b579))['catch'](handleError(_0xf07538,null));};exports['show']=function(_0x4c66ca,_0x2c5a36){var _0xd10940={'raw':![],'where':{'id':_0x4c66ca['params']['id']}},_0x42179b={};_0x42179b['model']=_['keys'](db['Automation'][_0xf502('0x3e')]);_0x42179b[_0xf502('0x28')]=_[_0xf502('0x29')](_0x4c66ca[_0xf502('0x28')]);_0x42179b[_0xf502('0x33')]=_['intersection'](_0x42179b[_0xf502('0x27')],_0x42179b[_0xf502('0x28')]);_0xd10940[_0xf502('0x2c')]=_[_0xf502('0x2a')](_0x42179b['model'],qs[_0xf502('0x2b')](_0x4c66ca[_0xf502('0x28')]['fields']));_0xd10940[_0xf502('0x2c')]=_0xd10940[_0xf502('0x2c')][_0xf502('0x2d')]?_0xd10940['attributes']:_0x42179b[_0xf502('0x27')];if(_0x4c66ca[_0xf502('0x28')][_0xf502('0x3a')]){_0xd10940[_0xf502('0x3b')]=[{'all':!![]}];}_0xd10940=_[_0xf502('0x36')]({},_0xd10940,_0x4c66ca[_0xf502('0x38')]);return db[_0xf502('0x39')][_0xf502('0x3f')](_0xd10940)[_0xf502('0x1e')](handleEntityNotFound(_0x2c5a36,null))['then'](respondWithResult(_0x2c5a36,null))[_0xf502('0x40')](handleError(_0x2c5a36,null));};exports[_0xf502('0x41')]=function(_0x513c60,_0x33d2db){return db['Automation'][_0xf502('0x41')](_0x513c60[_0xf502('0x42')],{})[_0xf502('0x1e')](respondWithResult(_0x33d2db,0xc9))[_0xf502('0x40')](handleError(_0x33d2db,null));};exports['update']=function(_0x5c0044,_0x2e0f10){if(_0x5c0044[_0xf502('0x42')]['id']){delete _0x5c0044['body']['id'];}return db[_0xf502('0x39')][_0xf502('0x3f')]({'where':{'id':_0x5c0044[_0xf502('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e0f10,null))[_0xf502('0x1e')](saveUpdates(_0x5c0044[_0xf502('0x42')],null))[_0xf502('0x1e')](respondWithResult(_0x2e0f10,null))[_0xf502('0x40')](handleError(_0x2e0f10,null));};exports[_0xf502('0x1f')]=function(_0x2f7a6e,_0x13702c){return db[_0xf502('0x39')][_0xf502('0x3f')]({'where':{'id':_0x2f7a6e['params']['id']}})['then'](handleEntityNotFound(_0x13702c,null))[_0xf502('0x1e')](removeEntity(_0x13702c,null))[_0xf502('0x40')](handleError(_0x13702c,null));};exports['addConditions']=function(_0x37a608,_0x18ae39,_0xfec677){return db[_0xf502('0x44')][_0xf502('0x3f')]({'where':{'id':_0x37a608[_0xf502('0x43')]['id']}})['then'](handleEntityNotFound(_0x18ae39,null))[_0xf502('0x1e')](function(_0x1bfde6){if(_0x1bfde6){return _0x1bfde6[_0xf502('0x45')](_0x37a608[_0xf502('0x42')]['ids'],_[_0xf502('0x46')](_0x37a608['body'],[_0xf502('0x47'),'id'])||{});}})[_0xf502('0x1e')](respondWithResult(_0x18ae39,null))['catch'](handleError(_0x18ae39,null));};exports[_0xf502('0x48')]=function(_0x4eca87,_0x3205c4,_0x58b2d3){var _0x2bae17={};var _0x111d64={};var _0x1d1dd9;var _0x51e1bd;return db[_0xf502('0x39')][_0xf502('0x49')]({'where':{'id':_0x4eca87['params']['id']}})[_0xf502('0x1e')](handleEntityNotFound(_0x3205c4,null))[_0xf502('0x1e')](function(_0x5488dc){if(_0x5488dc){_0x1d1dd9=_0x5488dc;_0x111d64[_0xf502('0x27')]=_[_0xf502('0x29')](db[_0xf502('0x44')][_0xf502('0x3e')]);_0x111d64[_0xf502('0x28')]=_[_0xf502('0x29')](_0x4eca87[_0xf502('0x28')]);_0x111d64[_0xf502('0x33')]=_[_0xf502('0x2a')](_0x111d64['model'],_0x111d64[_0xf502('0x28')]);_0x2bae17[_0xf502('0x2c')]=_[_0xf502('0x2a')](_0x111d64[_0xf502('0x27')],qs['fields'](_0x4eca87[_0xf502('0x28')][_0xf502('0x2b')]));_0x2bae17[_0xf502('0x2c')]=_0x2bae17['attributes'][_0xf502('0x2d')]?_0x2bae17[_0xf502('0x2c')]:_0x111d64['model'];_0x2bae17['order']=qs[_0xf502('0x31')](_0x4eca87[_0xf502('0x28')]['sort']);_0x2bae17[_0xf502('0x32')]=qs['filters'](_[_0xf502('0x34')](_0x4eca87[_0xf502('0x28')],_0x111d64[_0xf502('0x33')]));if(_0x4eca87['query'][_0xf502('0x35')]){_0x2bae17[_0xf502('0x32')]=_[_0xf502('0x36')](_0x2bae17['where'],{'$or':_[_0xf502('0x23')](_0x2bae17['attributes'],function(_0x3d3ce2){var _0x2236ac={};_0x2236ac[_0x3d3ce2]={'$like':'%'+_0x4eca87[_0xf502('0x28')][_0xf502('0x35')]+'%'};return _0x2236ac;})});}_0x2bae17=_[_0xf502('0x36')]({},_0x2bae17,_0x4eca87[_0xf502('0x38')]);return _0x1d1dd9['getConditions'](_0x2bae17);}})['then'](function(_0x138f52){if(_0x138f52){_0x51e1bd=_0x138f52[_0xf502('0x2d')];if(!_0x4eca87[_0xf502('0x28')][_0xf502('0x2e')](_0xf502('0x2f'))){_0x2bae17[_0xf502('0x30')]=qs[_0xf502('0x30')](_0x4eca87[_0xf502('0x28')][_0xf502('0x30')]);_0x2bae17['offset']=qs[_0xf502('0x19')](_0x4eca87[_0xf502('0x28')][_0xf502('0x19')]);}return _0x1d1dd9['getConditions'](_0x2bae17);}})[_0xf502('0x1e')](function(_0x5a590f){if(_0x5a590f){return _0x5a590f?{'count':_0x51e1bd,'rows':_0x5a590f}:null;}})[_0xf502('0x1e')](respondWithResult(_0x3205c4,null))[_0xf502('0x40')](handleError(_0x3205c4,null));};exports[_0xf502('0x4a')]=function(_0x2dda02,_0x4e7051,_0x428929){return db[_0xf502('0x4b')][_0xf502('0x3f')]({'where':{'id':_0x2dda02[_0xf502('0x43')]['id']}})[_0xf502('0x1e')](handleEntityNotFound(_0x4e7051,null))['then'](function(_0x596ae0){if(_0x596ae0){return _0x596ae0['addActions'](_0x2dda02['body']['ids'],_[_0xf502('0x46')](_0x2dda02[_0xf502('0x42')],[_0xf502('0x47'),'id'])||{});}})[_0xf502('0x1e')](respondWithResult(_0x4e7051,null))['catch'](handleError(_0x4e7051,null));};exports[_0xf502('0x4c')]=function(_0x366fd4,_0x37ffc6,_0x50501f){var _0xb300c2={};var _0xff1dc0={};var _0xf78867;var _0x558a44;return db['Automation'][_0xf502('0x49')]({'where':{'id':_0x366fd4[_0xf502('0x43')]['id']}})[_0xf502('0x1e')](handleEntityNotFound(_0x37ffc6,null))[_0xf502('0x1e')](function(_0x9a4553){if(_0x9a4553){_0xf78867=_0x9a4553;_0xff1dc0[_0xf502('0x27')]=_[_0xf502('0x29')](db[_0xf502('0x4b')]['rawAttributes']);_0xff1dc0['query']=_[_0xf502('0x29')](_0x366fd4[_0xf502('0x28')]);_0xff1dc0['filters']=_[_0xf502('0x2a')](_0xff1dc0[_0xf502('0x27')],_0xff1dc0[_0xf502('0x28')]);_0xb300c2[_0xf502('0x2c')]=_[_0xf502('0x2a')](_0xff1dc0[_0xf502('0x27')],qs[_0xf502('0x2b')](_0x366fd4[_0xf502('0x28')][_0xf502('0x2b')]));_0xb300c2['attributes']=_0xb300c2[_0xf502('0x2c')][_0xf502('0x2d')]?_0xb300c2['attributes']:_0xff1dc0['model'];_0xb300c2['order']=qs[_0xf502('0x31')](_0x366fd4['query'][_0xf502('0x31')]);_0xb300c2[_0xf502('0x32')]=qs[_0xf502('0x33')](_[_0xf502('0x34')](_0x366fd4[_0xf502('0x28')],_0xff1dc0[_0xf502('0x33')]));if(_0x366fd4[_0xf502('0x28')][_0xf502('0x35')]){_0xb300c2[_0xf502('0x32')]=_[_0xf502('0x36')](_0xb300c2[_0xf502('0x32')],{'$or':_[_0xf502('0x23')](_0xb300c2[_0xf502('0x2c')],function(_0x1360db){var _0x18a16f={};_0x18a16f[_0x1360db]={'$like':'%'+_0x366fd4[_0xf502('0x28')][_0xf502('0x35')]+'%'};return _0x18a16f;})});}_0xb300c2=_[_0xf502('0x36')]({},_0xb300c2,_0x366fd4[_0xf502('0x38')]);return _0xf78867['getActions'](_0xb300c2);}})[_0xf502('0x1e')](function(_0x2fbe0c){if(_0x2fbe0c){_0x558a44=_0x2fbe0c[_0xf502('0x2d')];if(!_0x366fd4[_0xf502('0x28')][_0xf502('0x2e')](_0xf502('0x2f'))){_0xb300c2['limit']=qs[_0xf502('0x30')](_0x366fd4[_0xf502('0x28')][_0xf502('0x30')]);_0xb300c2[_0xf502('0x19')]=qs[_0xf502('0x19')](_0x366fd4[_0xf502('0x28')][_0xf502('0x19')]);}return _0xf78867[_0xf502('0x4c')](_0xb300c2);}})['then'](function(_0x257ea1){if(_0x257ea1){return _0x257ea1?{'count':_0x558a44,'rows':_0x257ea1}:null;}})['then'](respondWithResult(_0x37ffc6,null))['catch'](handleError(_0x37ffc6,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 87bb4d6..d5ecf45 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 _0xeec6=['path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4e7c56,_0x39022f){var _0x255531=function(_0x321618){while(--_0x321618){_0x4e7c56['push'](_0x4e7c56['shift']());}};_0x255531(++_0x39022f);}(_0xeec6,0x1c2));var _0x6eec=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0xeec6[_0x1cc961];return _0x471d86;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var logger=require(_0x6eec('0x2'))(_0x6eec('0x3'));var moment=require('moment');var BPromise=require(_0x6eec('0x4'));var rp=require(_0x6eec('0x5'));var fs=require('fs');var path=require(_0x6eec('0x6'));var rimraf=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var attributes=require(_0x6eec('0x9'));module['exports']=function(_0x185f31,_0x3c6eda){return _0x185f31['define'](_0x6eec('0xa'),attributes,{'tableName':_0x6eec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash','util','../../config/logger','api','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5075,0x73));var _0x5507=function(_0xeead8a,_0x3d2400){_0xeead8a=_0xeead8a-0x0;var _0x24742c=_0x5075[_0xeead8a];return _0x24742c;};'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(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));module['exports']=function(_0x5b6d7f,_0x2cd9ee){return _0x5b6d7f[_0x5507('0xa')]('Automation',attributes,{'tableName':_0x5507('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 613492e..54fc65d 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 _0xfc60=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x401286,_0x23a64b){var _0x3ac67d=function(_0x57cfa1){while(--_0x57cfa1){_0x401286['push'](_0x401286['shift']());}};_0x3ac67d(++_0x23a64b);}(_0xfc60,0xb3));var _0x0fc6=function(_0x49fa22,_0x3a8ccb){_0x49fa22=_0x49fa22-0x0;var _0x4af7a1=_0xfc60[_0x49fa22];return _0x4af7a1;};'use strict';var _=require(_0x0fc6('0x0'));var util=require(_0x0fc6('0x1'));var moment=require('moment');var BPromise=require(_0x0fc6('0x2'));var rs=require(_0x0fc6('0x3'));var fs=require('fs');var Redis=require(_0x0fc6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0fc6('0x5'));var logger=require(_0x0fc6('0x6'))('rpc');var config=require(_0x0fc6('0x7'));var jayson=require(_0x0fc6('0x8'));var client=jayson[_0x0fc6('0x9')][_0x0fc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f3c0d,_0x5e4bb7,_0x12db30){return new BPromise(function(_0x292ee9,_0x183ea1){return client[_0x0fc6('0xb')](_0x4f3c0d,_0x12db30)['then'](function(_0x3768f9){logger[_0x0fc6('0xc')](_0x0fc6('0xd'),_0x5e4bb7,_0x0fc6('0xe'));logger[_0x0fc6('0xf')](_0x0fc6('0x10'),_0x5e4bb7,_0x0fc6('0xe'),JSON[_0x0fc6('0x11')](_0x3768f9));if(_0x3768f9[_0x0fc6('0x12')]){if(_0x3768f9['error'][_0x0fc6('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x5e4bb7,_0x3768f9[_0x0fc6('0x12')][_0x0fc6('0x14')]);return _0x183ea1(_0x3768f9[_0x0fc6('0x12')][_0x0fc6('0x14')]);}logger[_0x0fc6('0x12')](_0x0fc6('0xd'),_0x5e4bb7,_0x3768f9['error'][_0x0fc6('0x14')]);return _0x292ee9(_0x3768f9[_0x0fc6('0x12')][_0x0fc6('0x14')]);}else{logger[_0x0fc6('0xc')](_0x0fc6('0xd'),_0x5e4bb7,'request\x20sent');_0x292ee9(_0x3768f9[_0x0fc6('0x15')][_0x0fc6('0x14')]);}})[_0x0fc6('0x16')](function(_0x558523){logger[_0x0fc6('0x12')]('Automation,\x20%s,\x20%s',_0x5e4bb7,_0x558523);_0x183ea1(_0x558523);});});} \ No newline at end of file +var _0x4c20=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x53999b,_0x14a7d6){var _0x4fb77f=function(_0x2d2a27){while(--_0x2d2a27){_0x53999b['push'](_0x53999b['shift']());}};_0x4fb77f(++_0x14a7d6);}(_0x4c20,0x133));var _0x04c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4c20[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x04c2('0x0'));var util=require(_0x04c2('0x1'));var moment=require(_0x04c2('0x2'));var BPromise=require(_0x04c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c2('0x4'));var db=require(_0x04c2('0x5'))['db'];var utils=require(_0x04c2('0x6'));var logger=require(_0x04c2('0x7'))(_0x04c2('0x8'));var config=require(_0x04c2('0x9'));var jayson=require(_0x04c2('0xa'));var client=jayson[_0x04c2('0xb')][_0x04c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14ac11,_0x3a9363,_0x48499b){return new BPromise(function(_0x1bffaf,_0x57cfac){return client['request'](_0x14ac11,_0x48499b)[_0x04c2('0xd')](function(_0x12d70f){logger['info'](_0x04c2('0xe'),_0x3a9363,_0x04c2('0xf'));logger[_0x04c2('0x10')](_0x04c2('0x11'),_0x3a9363,_0x04c2('0xf'),JSON[_0x04c2('0x12')](_0x12d70f));if(_0x12d70f[_0x04c2('0x13')]){if(_0x12d70f['error'][_0x04c2('0x14')]===0x1f4){logger[_0x04c2('0x13')](_0x04c2('0xe'),_0x3a9363,_0x12d70f[_0x04c2('0x13')][_0x04c2('0x15')]);return _0x57cfac(_0x12d70f[_0x04c2('0x13')]['message']);}logger[_0x04c2('0x13')](_0x04c2('0xe'),_0x3a9363,_0x12d70f[_0x04c2('0x13')][_0x04c2('0x15')]);return _0x1bffaf(_0x12d70f[_0x04c2('0x13')]['message']);}else{logger['info'](_0x04c2('0xe'),_0x3a9363,_0x04c2('0xf'));_0x1bffaf(_0x12d70f[_0x04c2('0x16')][_0x04c2('0x15')]);}})[_0x04c2('0x17')](function(_0x10e8a1){logger[_0x04c2('0x13')](_0x04c2('0xe'),_0x3a9363,_0x10e8a1);_0x57cfac(_0x10e8a1);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 09a357c..7297171 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 _0xea67=['post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions'];(function(_0x3d6e69,_0x5abbf3){var _0x230335=function(_0x1ff08b){while(--_0x1ff08b){_0x3d6e69['push'](_0x3d6e69['shift']());}};_0x230335(++_0x5abbf3);}(_0xea67,0x1e9));var _0x7ea6=function(_0x2fc026,_0xdc4f7a){_0x2fc026=_0x2fc026-0x0;var _0x34d056=_0xea67[_0x2fc026];return _0x34d056;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require(_0x7ea6('0x4'));var router=express[_0x7ea6('0x5')]();var auth=require(_0x7ea6('0x6'));var interaction=require(_0x7ea6('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x7ea6('0x8')]('/',auth[_0x7ea6('0x9')](),controller[_0x7ea6('0xa')]);router[_0x7ea6('0x8')](_0x7ea6('0xb'),auth[_0x7ea6('0x9')](),controller[_0x7ea6('0xc')]);router[_0x7ea6('0x8')](_0x7ea6('0xd'),auth['isAuthenticated'](),controller['getConditions']);router[_0x7ea6('0x8')](_0x7ea6('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0x7ea6('0xf')]('/',auth['isAuthenticated'](),controller[_0x7ea6('0x10')]);router['post'](_0x7ea6('0xd'),auth[_0x7ea6('0x9')](),controller[_0x7ea6('0x11')]);router[_0x7ea6('0xf')]('/:id/actions',auth[_0x7ea6('0x9')](),controller[_0x7ea6('0x12')]);router[_0x7ea6('0x13')](_0x7ea6('0xb'),auth['isAuthenticated'](),controller[_0x7ea6('0x14')]);router[_0x7ea6('0x15')](_0x7ea6('0xb'),auth[_0x7ea6('0x9')](),controller[_0x7ea6('0x16')]);module[_0x7ea6('0x17')]=router; \ No newline at end of file +var _0x5df3=['/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x3cb9c0,_0x52ed16){var _0xfb545=function(_0x4f016c){while(--_0x4f016c){_0x3cb9c0['push'](_0x3cb9c0['shift']());}};_0xfb545(++_0x52ed16);}(_0x5df3,0x15f));var _0x35df=function(_0x20a086,_0x15cef2){_0x20a086=_0x20a086-0x0;var _0x379cc3=_0x5df3[_0x20a086];return _0x379cc3;};'use strict';var multer=require(_0x35df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x35df('0x1'));var express=require(_0x35df('0x2'));var router=express[_0x35df('0x3')]();var auth=require(_0x35df('0x4'));var interaction=require(_0x35df('0x5'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x35df('0x6')]('/',auth[_0x35df('0x7')](),controller[_0x35df('0x8')]);router['get'](_0x35df('0x9'),auth[_0x35df('0x7')](),controller[_0x35df('0xa')]);router[_0x35df('0x6')](_0x35df('0xb'),auth[_0x35df('0x7')](),controller[_0x35df('0xc')]);router[_0x35df('0x6')](_0x35df('0xd'),auth[_0x35df('0x7')](),controller[_0x35df('0xe')]);router[_0x35df('0xf')]('/',auth['isAuthenticated'](),controller[_0x35df('0x10')]);router[_0x35df('0xf')](_0x35df('0xb'),auth[_0x35df('0x7')](),controller[_0x35df('0x11')]);router['post'](_0x35df('0xd'),auth[_0x35df('0x7')](),controller[_0x35df('0x12')]);router[_0x35df('0x13')](_0x35df('0x9'),auth[_0x35df('0x7')](),controller[_0x35df('0x14')]);router[_0x35df('0x15')]('/:id',auth[_0x35df('0x7')](),controller[_0x35df('0x16')]);module[_0x35df('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3608635..bd88d3d 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 _0x5b7e=['name','ENUM','ivr','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','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING'];(function(_0x240df3,_0x515368){var _0x4a2815=function(_0x5ae814){while(--_0x5ae814){_0x240df3['push'](_0x240df3['shift']());}};_0x4a2815(++_0x515368);}(_0x5b7e,0x1ec));var _0xe5b7=function(_0x381e4e,_0x4d46c6){_0x381e4e=_0x381e4e-0x0;var _0x52fc95=_0x5b7e[_0x381e4e];return _0x52fc95;};'use strict';var Sequelize=require(_0xe5b7('0x0'));module['exports']={'name':{'type':Sequelize[_0xe5b7('0x1')],'unique':_0xe5b7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe5b7('0x3')](_0xe5b7('0x4')),'allowNull':![],'defaultValue':_0xe5b7('0x4')},'description':{'type':Sequelize[_0xe5b7('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe5b7('0x5')},'limitCalls':{'type':Sequelize[_0xe5b7('0x6')](0x4)[_0xe5b7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xe5b7('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xe5b7('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)[_0xe5b7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b7('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'defaultValue':0x3,'comment':_0xe5b7('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b7('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xe5b7('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe5b7('0x1')],'defaultValue':_0xe5b7('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xe5b7('0x3')](_0xe5b7('0x11'),_0xe5b7('0x12'),_0xe5b7('0x13')),'defaultValue':_0xe5b7('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe5b7('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xe5b7('0x6')](0x9)[_0xe5b7('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xe5b7('0x6')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe5b7('0x6')](0x9)[_0xe5b7('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe5b7('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe5b7('0x6')](0x9)[_0xe5b7('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xe5b7('0x6')](0x9)[_0xe5b7('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe5b7('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe5b7('0x6')](0x9)[_0xe5b7('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe5b7('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xe5b7('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe5b7('0x6')](0x5)[_0xe5b7('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe5b7('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe5b7('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe5b7('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xe5b7('0x1a'),_0xe5b7('0x1b')),'defaultValue':_0xe5b7('0x1a')},'dialPrefix':{'type':Sequelize[_0xe5b7('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe5b7('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe5b7('0x1c')},'dialCutDigit':{'type':Sequelize[_0xe5b7('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe5b7('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)[_0xe5b7('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b7('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b7('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe5b7('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b7('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe5b7('0x6')](0x3)[_0xe5b7('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe5b7('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe5b7('0x25')}}; \ No newline at end of file +var _0xb438=['always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x1efbca,_0xa8b72f){var _0x29fc3e=function(_0x46177a){while(--_0x46177a){_0x1efbca['push'](_0x1efbca['shift']());}};_0x29fc3e(++_0xa8b72f);}(_0xb438,0xd8));var _0x8b43=function(_0x537e16,_0x21f9d7){_0x537e16=_0x537e16-0x0;var _0x7bf894=_0xb438[_0x537e16];return _0x7bf894;};'use strict';var Sequelize=require(_0x8b43('0x0'));module[_0x8b43('0x1')]={'name':{'type':Sequelize[_0x8b43('0x2')],'unique':_0x8b43('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x8b43('0x4')](_0x8b43('0x5')),'allowNull':![],'defaultValue':_0x8b43('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x8b43('0x6')],'defaultValue':0x0,'comment':_0x8b43('0x7')},'limitCalls':{'type':Sequelize[_0x8b43('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x8b43('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8b43('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x8b43('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8b43('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b43('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x8b43('0x8')](0x3)[_0x8b43('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b43('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8b43('0x8')](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x8b43('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x8b43('0x8')](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b43('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x8b43('0x8')](0x3)[_0x8b43('0xa')],'defaultValue':0x3,'comment':_0x8b43('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b43('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8b43('0x10')},'dialTimezone':{'type':Sequelize[_0x8b43('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8b43('0x2')],'defaultValue':_0x8b43('0x11')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x8b43('0x12'),_0x8b43('0x13'),'onlyIfOpen'),'defaultValue':_0x8b43('0x12')},'dialAMDActive':{'type':Sequelize[_0x8b43('0x6')],'defaultValue':0x0,'comment':_0x8b43('0x14')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8b43('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8b43('0x15')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8b43('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8b43('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8b43('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8b43('0x8')](0x9)[_0x8b43('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8b43('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0x8b43('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8b43('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x8b43('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x8b43('0x8')](0x9)[_0x8b43('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8b43('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8b43('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x8b43('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8b43('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8b43('0x4')](_0x8b43('0x1d'),'ASC'),'defaultValue':_0x8b43('0x1d')},'dialPrefix':{'type':Sequelize[_0x8b43('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8b43('0x8')](0x3)[_0x8b43('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8b43('0x1e')},'dialCutDigit':{'type':Sequelize[_0x8b43('0x8')](0x3)[_0x8b43('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8b43('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8b43('0x8')](0x3)[_0x8b43('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b43('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x8b43('0x8')](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b43('0x21')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8b43('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x8b43('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b43('0x22')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8b43('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b43('0x23')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8b43('0x8')](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x8b43('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b43('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8b43('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8b43('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8b43('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8b43('0x8')](0x5)[_0x8b43('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ea9a0a4..4453df7 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 _0x1c75=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','update','then','destroy','get','UserProfileResource','name','send','index','Campaign','rawAttributes','fieldName','type','model','map','query','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','where','filter','merge','count','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','getHoppers','findOne','hasOwnProperty','CmHopper','CmHopperHistory','CmHopperFinal','CampaignId','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x1c75,0x82));var _0x51c7=function(_0x4ba8c3,_0x33c457){_0x4ba8c3=_0x4ba8c3-0x0;var _0xf65364=_0x1c75[_0x4ba8c3];return _0xf65364;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51c7('0x0'));var zipdir=require(_0x51c7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x51c7('0x2'));var moment=require(_0x51c7('0x3'));var BPromise=require(_0x51c7('0x4'));var Mustache=require(_0x51c7('0x5'));var util=require(_0x51c7('0x6'));var path=require('path');var sox=require(_0x51c7('0x7'));var csv=require(_0x51c7('0x8'));var ejs=require(_0x51c7('0x9'));var fs=require('fs');var _=require(_0x51c7('0xa'));var squel=require(_0x51c7('0xb'));var crypto=require('crypto');var jsforce=require(_0x51c7('0xc'));var deskjs=require(_0x51c7('0xd'));var toCsv=require(_0x51c7('0x8'));var querystring=require(_0x51c7('0xe'));var Papa=require(_0x51c7('0xf'));var Redis=require(_0x51c7('0x10'));var authService=require(_0x51c7('0x11'));var qs=require(_0x51c7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x51c7('0x13'));var logger=require(_0x51c7('0x14'))(_0x51c7('0x15'));var utils=require(_0x51c7('0x16'));var config=require('../../config/environment');var db=require(_0x51c7('0x17'))['db'];function respondWithStatusCode(_0x1766bb,_0x3ddb08){_0x3ddb08=_0x3ddb08||0xcc;return function(_0x226747){if(_0x226747){return _0x1766bb[_0x51c7('0x18')](_0x3ddb08);}return _0x1766bb[_0x51c7('0x19')](_0x3ddb08)[_0x51c7('0x1a')]();};}function respondWithResult(_0x108a1a,_0x493aa9){_0x493aa9=_0x493aa9||0xc8;return function(_0x4145f2){if(_0x4145f2){return _0x108a1a['status'](_0x493aa9)[_0x51c7('0x1b')](_0x4145f2);}};}function respondWithFilteredResult(_0x1b3f3e,_0x433e75){return function(_0x8ad923){if(_0x8ad923){var _0x5c0d17=_0x8ad923['count'],_0x57532e=_0x433e75[_0x51c7('0x1c')],_0x26fd89=_0x433e75[_0x51c7('0x1c')]+_0x433e75[_0x51c7('0x1d')],_0x4662f9;if(_0x26fd89>=_0x5c0d17){_0x26fd89=_0x5c0d17;_0x4662f9=0xc8;}else{_0x4662f9=0xce;}_0x1b3f3e['status'](_0x4662f9);return _0x1b3f3e[_0x51c7('0x1e')]('Content-Range',_0x57532e+'-'+_0x26fd89+'/'+_0x5c0d17)[_0x51c7('0x1b')](_0x8ad923);}return null;};}function patchUpdates(_0x4c18bb){return function(_0xd75ad8){try{jsonpatch[_0x51c7('0x1f')](_0xd75ad8,_0x4c18bb,!![]);}catch(_0x86b728){return BPromise[_0x51c7('0x20')](_0x86b728);}return _0xd75ad8['save']();};}function saveUpdates(_0xa1e232,_0xb7babf){return function(_0x4e3060){if(_0x4e3060){return _0x4e3060[_0x51c7('0x21')](_0xa1e232)[_0x51c7('0x22')](function(_0x1d0b48){return _0x1d0b48;});}return null;};}function removeEntity(_0x22eedc,_0x30ba6e){return function(_0x5f2fac){if(_0x5f2fac){return _0x5f2fac[_0x51c7('0x23')]()['then'](function(){var _0x140d74=_0x5f2fac[_0x51c7('0x24')]({'plain':!![]});var _0x1c8ca6='IvrCampaigns';return db[_0x51c7('0x25')]['destroy']({'where':{'type':_0x1c8ca6,'resourceId':_0x140d74['id']}})[_0x51c7('0x22')](function(){return _0x5f2fac;});})['then'](function(){_0x22eedc[_0x51c7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30bf37,_0x362788){return function(_0x14907c){if(!_0x14907c){_0x30bf37[_0x51c7('0x18')](0x194);}return _0x14907c;};}function handleError(_0x4b8c94,_0xca144c){_0xca144c=_0xca144c||0x1f4;return function(_0x509085){logger['error'](_0x509085['stack']);if(_0x509085[_0x51c7('0x26')]){delete _0x509085['name'];}_0x4b8c94[_0x51c7('0x19')](_0xca144c)[_0x51c7('0x27')](_0x509085);};}exports[_0x51c7('0x28')]=function(_0x42ee4c,_0x41498f){var _0x49e963={},_0x14b33c={},_0x551da7={'count':0x0,'rows':[]};var _0x4c342c=_['map'](db[_0x51c7('0x29')][_0x51c7('0x2a')],function(_0x45e4f4){return{'name':_0x45e4f4[_0x51c7('0x2b')],'type':_0x45e4f4[_0x51c7('0x2c')]['key']};});_0x14b33c[_0x51c7('0x2d')]=_[_0x51c7('0x2e')](_0x4c342c,_0x51c7('0x26'));_0x14b33c[_0x51c7('0x2f')]=_['keys'](_0x42ee4c['query']);_0x14b33c['filters']=_['intersection'](_0x14b33c[_0x51c7('0x2d')],_0x14b33c[_0x51c7('0x2f')]);_0x49e963[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x14b33c[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x42ee4c[_0x51c7('0x2f')][_0x51c7('0x32')]));_0x49e963[_0x51c7('0x30')]=_0x49e963[_0x51c7('0x30')][_0x51c7('0x33')]?_0x49e963[_0x51c7('0x30')]:_0x14b33c['model'];if(!_0x42ee4c['query']['hasOwnProperty'](_0x51c7('0x34'))){_0x49e963[_0x51c7('0x1d')]=qs[_0x51c7('0x1d')](_0x42ee4c[_0x51c7('0x2f')]['limit']);_0x49e963['offset']=qs[_0x51c7('0x1c')](_0x42ee4c[_0x51c7('0x2f')][_0x51c7('0x1c')]);}_0x49e963[_0x51c7('0x35')]=qs[_0x51c7('0x36')](_0x42ee4c[_0x51c7('0x2f')][_0x51c7('0x36')]);_0x49e963['where']=qs[_0x51c7('0x37')](_[_0x51c7('0x38')](_0x42ee4c[_0x51c7('0x2f')],_0x14b33c[_0x51c7('0x37')]),_0x4c342c);if(_0x42ee4c[_0x51c7('0x2f')]['filter']){_0x49e963[_0x51c7('0x39')]=_['merge'](_0x49e963['where'],{'$or':_[_0x51c7('0x2e')](_0x4c342c,function(_0x2631e1){if(_0x2631e1[_0x51c7('0x2c')]!=='VIRTUAL'){var _0x1ed4c5={};_0x1ed4c5[_0x2631e1[_0x51c7('0x26')]]={'$like':'%'+_0x42ee4c[_0x51c7('0x2f')][_0x51c7('0x3a')]+'%'};return _0x1ed4c5;}})});}_0x49e963=_[_0x51c7('0x3b')]({},_0x49e963,_0x42ee4c['options']);var _0x54d78b={'where':_0x49e963['where']};return db[_0x51c7('0x29')][_0x51c7('0x3c')](_0x54d78b)[_0x51c7('0x22')](function(_0xb2fbbe){_0x551da7[_0x51c7('0x3c')]=_0xb2fbbe;if(_0x42ee4c[_0x51c7('0x2f')]['includeAll']){_0x49e963[_0x51c7('0x3d')]=[{'all':!![]}];}return db[_0x51c7('0x29')][_0x51c7('0x3e')](_0x49e963);})[_0x51c7('0x22')](function(_0x5e05f7){_0x551da7[_0x51c7('0x3f')]=_0x5e05f7;return _0x551da7;})['then'](respondWithFilteredResult(_0x41498f,_0x49e963))[_0x51c7('0x40')](handleError(_0x41498f,null));};exports[_0x51c7('0x41')]=function(_0x4041b2,_0x56b90d){var _0x2fedf2={'raw':![],'where':{'id':_0x4041b2[_0x51c7('0x42')]['id']}},_0x219968={};_0x219968[_0x51c7('0x2d')]=_[_0x51c7('0x43')](db[_0x51c7('0x29')][_0x51c7('0x2a')]);_0x219968[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x4041b2[_0x51c7('0x2f')]);_0x219968[_0x51c7('0x37')]=_[_0x51c7('0x31')](_0x219968[_0x51c7('0x2d')],_0x219968['query']);_0x2fedf2['attributes']=_[_0x51c7('0x31')](_0x219968[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x4041b2[_0x51c7('0x2f')][_0x51c7('0x32')]));_0x2fedf2[_0x51c7('0x30')]=_0x2fedf2[_0x51c7('0x30')]['length']?_0x2fedf2[_0x51c7('0x30')]:_0x219968['model'];if(_0x4041b2['query'][_0x51c7('0x44')]){_0x2fedf2[_0x51c7('0x3d')]=[{'all':!![]}];}_0x2fedf2=_[_0x51c7('0x3b')]({},_0x2fedf2,_0x4041b2[_0x51c7('0x45')]);return db[_0x51c7('0x29')][_0x51c7('0x46')](_0x2fedf2)[_0x51c7('0x22')](handleEntityNotFound(_0x56b90d,null))['then'](respondWithResult(_0x56b90d,null))[_0x51c7('0x40')](handleError(_0x56b90d,null));};exports[_0x51c7('0x47')]=function(_0x37d29b,_0x4d3b31){return db[_0x51c7('0x29')][_0x51c7('0x47')](_0x37d29b[_0x51c7('0x48')],{})[_0x51c7('0x22')](function(_0x26a0f9){var _0x58e5b5=_0x37d29b[_0x51c7('0x49')][_0x51c7('0x24')]({'plain':!![]});if(!_0x58e5b5)throw new Error(_0x51c7('0x4a'));if(_0x58e5b5[_0x51c7('0x4b')]===_0x51c7('0x49')){var _0x4be92c=_0x26a0f9['get']({'plain':!![]});var _0x228f2c=_0x51c7('0x4c');return db[_0x51c7('0x4d')][_0x51c7('0x46')]({'where':{'name':_0x228f2c,'userProfileId':_0x58e5b5[_0x51c7('0x4e')]},'raw':!![]})['then'](function(_0x3ac180){if(_0x3ac180&&_0x3ac180[_0x51c7('0x4f')]===0x0){return db[_0x51c7('0x25')]['create']({'name':_0x4be92c[_0x51c7('0x26')],'resourceId':_0x4be92c['id'],'type':_0x3ac180[_0x51c7('0x26')],'sectionId':_0x3ac180['id']},{})[_0x51c7('0x22')](function(){return _0x26a0f9;});}else{return _0x26a0f9;}})[_0x51c7('0x40')](function(_0x146922){logger[_0x51c7('0x50')](_0x51c7('0x51'),_0x146922);throw _0x146922;});}return _0x26a0f9;})[_0x51c7('0x22')](respondWithResult(_0x4d3b31,0xc9))[_0x51c7('0x40')](handleError(_0x4d3b31,null));};exports[_0x51c7('0x52')]=function(_0x577f75,_0x259323){var _0x290c4b={'where':{'id':_0x577f75['params']['id']}},_0x9050da={};_0x9050da['model']=_[_0x51c7('0x43')](db[_0x51c7('0x29')]['rawAttributes']);_0x290c4b[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x9050da[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x577f75['query'][_0x51c7('0x32')]));_0x290c4b[_0x51c7('0x30')]=_0x290c4b[_0x51c7('0x30')][_0x51c7('0x33')]?_0x290c4b[_0x51c7('0x30')]:_0x9050da[_0x51c7('0x2d')];if(_0x577f75[_0x51c7('0x2f')][_0x51c7('0x44')]){_0x290c4b['include']=[{'all':!![]}];}_0x290c4b=_['merge']({},_0x290c4b,_0x577f75[_0x51c7('0x45')]);return db[_0x51c7('0x29')]['find'](_0x290c4b)['then'](handleEntityNotFound(_0x259323,null))[_0x51c7('0x22')](function(_0x42a3f6){if(_0x42a3f6){var _0x5efae5=_0x42a3f6[_0x51c7('0x24')]({'plain':!![]});_0x5efae5=qs[_0x51c7('0x53')](_0x5efae5,['id','createdAt',_0x51c7('0x54')]);_0x577f75[_0x51c7('0x48')]=_[_0x51c7('0x53')](_0x577f75[_0x51c7('0x48')],['id',_0x51c7('0x55'),_0x51c7('0x54')]);return db[_0x51c7('0x29')]['create'](_[_0x51c7('0x3b')](_0x5efae5,_0x577f75[_0x51c7('0x48')]),{'include':_0x577f75[_0x51c7('0x2f')][_0x51c7('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x11924a){var _0x5dadb0=_0x577f75['user'][_0x51c7('0x24')]({'plain':!![]});if(!_0x5dadb0)throw new Error(_0x51c7('0x4a'));if(_0x5dadb0[_0x51c7('0x4b')]===_0x51c7('0x49')){var _0x168ed8=_0x11924a[_0x51c7('0x24')]({'plain':!![]});var _0x7e263c=_0x51c7('0x4c');return db[_0x51c7('0x4d')][_0x51c7('0x46')]({'where':{'name':_0x7e263c,'userProfileId':_0x5dadb0[_0x51c7('0x4e')]},'raw':!![]})['then'](function(_0x2fdedd){if(_0x2fdedd&&_0x2fdedd[_0x51c7('0x4f')]===0x0){return db[_0x51c7('0x25')][_0x51c7('0x47')]({'name':_0x168ed8[_0x51c7('0x26')],'resourceId':_0x168ed8['id'],'type':_0x2fdedd[_0x51c7('0x26')],'sectionId':_0x2fdedd['id']},{})[_0x51c7('0x22')](function(){return _0x11924a;});}else{return _0x11924a;}})[_0x51c7('0x40')](function(_0x57cfcf){logger[_0x51c7('0x50')](_0x51c7('0x51'),_0x57cfcf);throw _0x57cfcf;});}return _0x11924a;});}})['then'](respondWithResult(_0x259323,0xc9))[_0x51c7('0x40')](handleError(_0x259323,null));};exports[_0x51c7('0x21')]=function(_0x579d28,_0x2137f7){if(_0x579d28[_0x51c7('0x48')]['id']){delete _0x579d28['body']['id'];}return db['Campaign'][_0x51c7('0x46')]({'where':{'id':_0x579d28[_0x51c7('0x42')]['id']}})['then'](handleEntityNotFound(_0x2137f7,null))[_0x51c7('0x22')](saveUpdates(_0x579d28[_0x51c7('0x48')],null))[_0x51c7('0x22')](respondWithResult(_0x2137f7,null))[_0x51c7('0x40')](handleError(_0x2137f7,null));};exports[_0x51c7('0x23')]=function(_0x20782f,_0x4ee77a){return db[_0x51c7('0x29')][_0x51c7('0x46')]({'where':{'id':_0x20782f[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x4ee77a,null))[_0x51c7('0x22')](removeEntity(_0x4ee77a,null))[_0x51c7('0x40')](handleError(_0x4ee77a,null));};exports[_0x51c7('0x56')]=function(_0x53180f,_0x5dce2f,_0x56a07a){var _0x479047={'raw':!![],'where':{}};var _0x3c299a={};var _0x49b87a={'count':0x0,'rows':[]};return db['Campaign'][_0x51c7('0x57')]({'where':{'id':_0x53180f[_0x51c7('0x42')]['id']}})['then'](handleEntityNotFound(_0x5dce2f,null))['then'](function(_0x52132b){if(_0x52132b){_0x3c299a[_0x51c7('0x2d')]=_['keys'](db['CmHopper']['rawAttributes']);_0x3c299a[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x53180f[_0x51c7('0x2f')]);_0x3c299a[_0x51c7('0x37')]=_[_0x51c7('0x31')](_0x3c299a[_0x51c7('0x2d')],_0x3c299a['query']);_0x479047[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x3c299a[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x53180f[_0x51c7('0x2f')][_0x51c7('0x32')]));_0x479047[_0x51c7('0x30')]=_0x479047['attributes'][_0x51c7('0x33')]?_0x479047[_0x51c7('0x30')]:_0x3c299a[_0x51c7('0x2d')];if(!_0x53180f[_0x51c7('0x2f')][_0x51c7('0x58')](_0x51c7('0x34'))){_0x479047['limit']=qs[_0x51c7('0x1d')](_0x53180f[_0x51c7('0x2f')][_0x51c7('0x1d')]);_0x479047[_0x51c7('0x1c')]=qs[_0x51c7('0x1c')](_0x53180f[_0x51c7('0x2f')][_0x51c7('0x1c')]);}_0x479047[_0x51c7('0x35')]=qs[_0x51c7('0x36')](_0x53180f[_0x51c7('0x2f')][_0x51c7('0x36')]);_0x479047['where']=qs[_0x51c7('0x37')](_['pick'](_0x53180f[_0x51c7('0x2f')],_0x3c299a[_0x51c7('0x37')]));_0x479047[_0x51c7('0x39')]['CampaignId']=_0x52132b['id'];if(_0x53180f[_0x51c7('0x2f')][_0x51c7('0x3a')]){_0x479047['where']=_[_0x51c7('0x3b')](_0x479047[_0x51c7('0x39')],{'$or':_[_0x51c7('0x2e')](_0x479047[_0x51c7('0x30')],function(_0x386d8e){var _0x13e34d={};_0x13e34d[_0x386d8e]={'$like':'%'+_0x53180f[_0x51c7('0x2f')][_0x51c7('0x3a')]+'%'};return _0x13e34d;})});}_0x479047=_[_0x51c7('0x3b')]({},_0x479047,_0x53180f['options']);return db[_0x51c7('0x59')][_0x51c7('0x3c')]({'where':_0x479047['where']})[_0x51c7('0x22')](function(_0xc9b3c4){_0x49b87a['count']=_0xc9b3c4;if(_0x53180f['query'][_0x51c7('0x44')]){_0x479047[_0x51c7('0x3d')]=[{'all':!![]}];}return db[_0x51c7('0x59')][_0x51c7('0x3e')](_0x479047);})[_0x51c7('0x22')](function(_0x1ae508){_0x49b87a['rows']=_0x1ae508;return _0x49b87a;});}})[_0x51c7('0x22')](respondWithFilteredResult(_0x5dce2f,_0x479047))['catch'](handleError(_0x5dce2f,null));};exports['getHopperHistories']=function(_0x1ea027,_0x325353,_0xe67016){var _0x1740b1={'raw':!![],'where':{}};var _0x3ca9a5={};var _0x6cf028={'count':0x0,'rows':[]};return db[_0x51c7('0x29')][_0x51c7('0x57')]({'where':{'id':_0x1ea027[_0x51c7('0x42')]['id']}})['then'](handleEntityNotFound(_0x325353,null))[_0x51c7('0x22')](function(_0x1f3c3d){if(_0x1f3c3d){_0x3ca9a5['model']=_['keys'](db[_0x51c7('0x5a')][_0x51c7('0x2a')]);_0x3ca9a5[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x1ea027['query']);_0x3ca9a5[_0x51c7('0x37')]=_['intersection'](_0x3ca9a5[_0x51c7('0x2d')],_0x3ca9a5['query']);_0x1740b1[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x3ca9a5[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x1ea027['query'][_0x51c7('0x32')]));_0x1740b1[_0x51c7('0x30')]=_0x1740b1['attributes'][_0x51c7('0x33')]?_0x1740b1[_0x51c7('0x30')]:_0x3ca9a5[_0x51c7('0x2d')];if(!_0x1ea027['query'][_0x51c7('0x58')](_0x51c7('0x34'))){_0x1740b1[_0x51c7('0x1d')]=qs[_0x51c7('0x1d')](_0x1ea027[_0x51c7('0x2f')][_0x51c7('0x1d')]);_0x1740b1[_0x51c7('0x1c')]=qs[_0x51c7('0x1c')](_0x1ea027[_0x51c7('0x2f')]['offset']);}_0x1740b1[_0x51c7('0x35')]=qs[_0x51c7('0x36')](_0x1ea027[_0x51c7('0x2f')][_0x51c7('0x36')]);_0x1740b1[_0x51c7('0x39')]=qs[_0x51c7('0x37')](_[_0x51c7('0x38')](_0x1ea027['query'],_0x3ca9a5[_0x51c7('0x37')]));_0x1740b1[_0x51c7('0x39')]['CampaignId']=_0x1f3c3d['id'];if(_0x1ea027['query'][_0x51c7('0x3a')]){_0x1740b1[_0x51c7('0x39')]=_[_0x51c7('0x3b')](_0x1740b1[_0x51c7('0x39')],{'$or':_[_0x51c7('0x2e')](_0x1740b1[_0x51c7('0x30')],function(_0x4b14ed){var _0x3f1abb={};_0x3f1abb[_0x4b14ed]={'$like':'%'+_0x1ea027[_0x51c7('0x2f')][_0x51c7('0x3a')]+'%'};return _0x3f1abb;})});}_0x1740b1=_['merge']({},_0x1740b1,_0x1ea027[_0x51c7('0x45')]);return db[_0x51c7('0x5a')][_0x51c7('0x3c')]({'where':_0x1740b1[_0x51c7('0x39')]})[_0x51c7('0x22')](function(_0x4ec987){_0x6cf028[_0x51c7('0x3c')]=_0x4ec987;if(_0x1ea027['query']['includeAll']){_0x1740b1[_0x51c7('0x3d')]=[{'all':!![]}];}return db[_0x51c7('0x5a')]['findAll'](_0x1740b1);})[_0x51c7('0x22')](function(_0x1bffe1){_0x6cf028[_0x51c7('0x3f')]=_0x1bffe1;return _0x6cf028;});}})[_0x51c7('0x22')](respondWithFilteredResult(_0x325353,_0x1740b1))[_0x51c7('0x40')](handleError(_0x325353,null));};exports['getHopperFinals']=function(_0x3ade71,_0x5156cc,_0x551cf8){var _0x4b339d={'raw':!![],'where':{}};var _0x2de6e1={};var _0x28a00c={'count':0x0,'rows':[]};return db[_0x51c7('0x29')]['findOne']({'where':{'id':_0x3ade71[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x5156cc,null))['then'](function(_0x5dbaba){if(_0x5dbaba){_0x2de6e1['model']=_[_0x51c7('0x43')](db[_0x51c7('0x5b')][_0x51c7('0x2a')]);_0x2de6e1[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x3ade71[_0x51c7('0x2f')]);_0x2de6e1[_0x51c7('0x37')]=_[_0x51c7('0x31')](_0x2de6e1[_0x51c7('0x2d')],_0x2de6e1[_0x51c7('0x2f')]);_0x4b339d[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x2de6e1[_0x51c7('0x2d')],qs['fields'](_0x3ade71[_0x51c7('0x2f')][_0x51c7('0x32')]));_0x4b339d[_0x51c7('0x30')]=_0x4b339d[_0x51c7('0x30')][_0x51c7('0x33')]?_0x4b339d['attributes']:_0x2de6e1['model'];if(!_0x3ade71[_0x51c7('0x2f')][_0x51c7('0x58')]('nolimit')){_0x4b339d[_0x51c7('0x1d')]=qs[_0x51c7('0x1d')](_0x3ade71[_0x51c7('0x2f')]['limit']);_0x4b339d[_0x51c7('0x1c')]=qs[_0x51c7('0x1c')](_0x3ade71['query'][_0x51c7('0x1c')]);}_0x4b339d[_0x51c7('0x35')]=qs[_0x51c7('0x36')](_0x3ade71[_0x51c7('0x2f')][_0x51c7('0x36')]);_0x4b339d[_0x51c7('0x39')]=qs[_0x51c7('0x37')](_[_0x51c7('0x38')](_0x3ade71['query'],_0x2de6e1[_0x51c7('0x37')]));_0x4b339d[_0x51c7('0x39')][_0x51c7('0x5c')]=_0x5dbaba['id'];if(_0x3ade71[_0x51c7('0x2f')][_0x51c7('0x3a')]){_0x4b339d[_0x51c7('0x39')]=_['merge'](_0x4b339d[_0x51c7('0x39')],{'$or':_[_0x51c7('0x2e')](_0x4b339d[_0x51c7('0x30')],function(_0x497d04){var _0x374a00={};_0x374a00[_0x497d04]={'$like':'%'+_0x3ade71['query'][_0x51c7('0x3a')]+'%'};return _0x374a00;})});}_0x4b339d=_['merge']({},_0x4b339d,_0x3ade71[_0x51c7('0x45')]);return db[_0x51c7('0x5b')][_0x51c7('0x3c')]({'where':_0x4b339d['where']})[_0x51c7('0x22')](function(_0x6e1362){_0x28a00c[_0x51c7('0x3c')]=_0x6e1362;if(_0x3ade71[_0x51c7('0x2f')]['includeAll']){_0x4b339d[_0x51c7('0x3d')]=[{'all':!![]}];}return db[_0x51c7('0x5b')][_0x51c7('0x3e')](_0x4b339d);})[_0x51c7('0x22')](function(_0x2ea19b){_0x28a00c[_0x51c7('0x3f')]=_0x2ea19b;return _0x28a00c;});}})[_0x51c7('0x22')](respondWithFilteredResult(_0x5156cc,_0x4b339d))[_0x51c7('0x40')](handleError(_0x5156cc,null));};exports[_0x51c7('0x5d')]=function(_0x226654,_0x31f946,_0x1542b4){var _0x1b8a37={'raw':!![],'where':{}};var _0x54c2be={};var _0x4070f6={'count':0x0,'rows':[]};return db[_0x51c7('0x29')][_0x51c7('0x57')]({'where':{'id':_0x226654[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x31f946,null))[_0x51c7('0x22')](function(_0x2e2319){if(_0x2e2319){_0x54c2be[_0x51c7('0x2d')]=_[_0x51c7('0x43')](db[_0x51c7('0x5e')]['rawAttributes']);_0x54c2be[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x226654['query']);_0x54c2be[_0x51c7('0x37')]=_['intersection'](_0x54c2be[_0x51c7('0x2d')],_0x54c2be[_0x51c7('0x2f')]);_0x1b8a37[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x54c2be['model'],qs['fields'](_0x226654[_0x51c7('0x2f')][_0x51c7('0x32')]));_0x1b8a37[_0x51c7('0x30')]=_0x1b8a37[_0x51c7('0x30')][_0x51c7('0x33')]?_0x1b8a37[_0x51c7('0x30')]:_0x54c2be[_0x51c7('0x2d')];if(!_0x226654[_0x51c7('0x2f')]['hasOwnProperty']('nolimit')){_0x1b8a37['limit']=qs['limit'](_0x226654[_0x51c7('0x2f')]['limit']);_0x1b8a37[_0x51c7('0x1c')]=qs['offset'](_0x226654[_0x51c7('0x2f')]['offset']);}_0x1b8a37[_0x51c7('0x35')]=qs[_0x51c7('0x36')](_0x226654[_0x51c7('0x2f')]['sort']);_0x1b8a37['where']=qs['filters'](_['pick'](_0x226654['query'],_0x54c2be[_0x51c7('0x37')]));_0x1b8a37[_0x51c7('0x39')][_0x51c7('0x5c')]=_0x2e2319['id'];if(_0x226654[_0x51c7('0x2f')][_0x51c7('0x3a')]){_0x1b8a37[_0x51c7('0x39')]=_[_0x51c7('0x3b')](_0x1b8a37['where'],{'$or':_[_0x51c7('0x2e')](_0x1b8a37[_0x51c7('0x30')],function(_0x4c33fe){var _0x49827a={};_0x49827a[_0x4c33fe]={'$like':'%'+_0x226654[_0x51c7('0x2f')][_0x51c7('0x3a')]+'%'};return _0x49827a;})});}_0x1b8a37=_[_0x51c7('0x3b')]({},_0x1b8a37,_0x226654[_0x51c7('0x45')]);return db[_0x51c7('0x5e')][_0x51c7('0x3c')]({'where':_0x1b8a37['where']})[_0x51c7('0x22')](function(_0x2601cc){_0x4070f6['count']=_0x2601cc;if(_0x226654['query'][_0x51c7('0x44')]){_0x1b8a37['include']=[{'all':!![]}];}return db[_0x51c7('0x5e')]['findAll'](_0x1b8a37);})[_0x51c7('0x22')](function(_0x280066){_0x4070f6[_0x51c7('0x3f')]=_0x280066;return _0x4070f6;});}})['then'](respondWithFilteredResult(_0x31f946,_0x1b8a37))[_0x51c7('0x40')](handleError(_0x31f946,null));};exports['getLists']=function(_0x10305c,_0x2c490a,_0x218238){var _0x2c9b4e={};var _0x1270e1={};var _0xf6b169;var _0x46f89d;return db['Campaign'][_0x51c7('0x57')]({'where':{'id':_0x10305c[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x2c490a,null))[_0x51c7('0x22')](function(_0x2f1ed0){if(_0x2f1ed0){_0xf6b169=_0x2f1ed0;_0x1270e1[_0x51c7('0x2d')]=_[_0x51c7('0x43')](db[_0x51c7('0x5f')][_0x51c7('0x2a')]);_0x1270e1[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x10305c[_0x51c7('0x2f')]);_0x1270e1[_0x51c7('0x37')]=_['intersection'](_0x1270e1[_0x51c7('0x2d')],_0x1270e1[_0x51c7('0x2f')]);_0x2c9b4e[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x1270e1[_0x51c7('0x2d')],qs[_0x51c7('0x32')](_0x10305c[_0x51c7('0x2f')][_0x51c7('0x32')]));_0x2c9b4e[_0x51c7('0x30')]=_0x2c9b4e[_0x51c7('0x30')][_0x51c7('0x33')]?_0x2c9b4e[_0x51c7('0x30')]:_0x1270e1['model'];_0x2c9b4e[_0x51c7('0x35')]=qs['sort'](_0x10305c[_0x51c7('0x2f')][_0x51c7('0x36')]);_0x2c9b4e[_0x51c7('0x39')]=qs['filters'](_[_0x51c7('0x38')](_0x10305c[_0x51c7('0x2f')],_0x1270e1['filters']));if(_0x10305c[_0x51c7('0x2f')]['filter']){_0x2c9b4e[_0x51c7('0x39')]=_[_0x51c7('0x3b')](_0x2c9b4e[_0x51c7('0x39')],{'$or':_[_0x51c7('0x2e')](_0x2c9b4e[_0x51c7('0x30')],function(_0x28f167){var _0xcac30f={};_0xcac30f[_0x28f167]={'$like':'%'+_0x10305c[_0x51c7('0x2f')][_0x51c7('0x3a')]+'%'};return _0xcac30f;})});}_0x2c9b4e=_[_0x51c7('0x3b')]({},_0x2c9b4e,_0x10305c[_0x51c7('0x45')]);return _0xf6b169[_0x51c7('0x60')](_0x2c9b4e);}})[_0x51c7('0x22')](function(_0x5bb6fc){if(_0x5bb6fc){_0x46f89d=_0x5bb6fc['length'];if(!_0x10305c['query']['hasOwnProperty'](_0x51c7('0x34'))){_0x2c9b4e[_0x51c7('0x1d')]=qs[_0x51c7('0x1d')](_0x10305c[_0x51c7('0x2f')][_0x51c7('0x1d')]);_0x2c9b4e[_0x51c7('0x1c')]=qs[_0x51c7('0x1c')](_0x10305c['query'][_0x51c7('0x1c')]);}return _0xf6b169['getLists'](_0x2c9b4e);}})['then'](function(_0x1b0f47){if(_0x1b0f47){return _0x1b0f47?{'count':_0x46f89d,'rows':_0x1b0f47}:null;}})[_0x51c7('0x22')](respondWithResult(_0x2c490a,null))[_0x51c7('0x40')](handleError(_0x2c490a,null));};exports['addLists']=function(_0x338479,_0x3f9488,_0x5ca7c6){var _0x398ca5,_0x1d73cf;return db[_0x51c7('0x29')][_0x51c7('0x46')]({'where':{'id':_0x338479['params']['id']}})['then'](handleEntityNotFound(_0x3f9488,null))[_0x51c7('0x22')](function(_0x413507){if(_0x413507){_0x1d73cf=_0x413507;return _0x413507[_0x51c7('0x61')](_0x338479[_0x51c7('0x48')][_0x51c7('0x62')],_[_0x51c7('0x53')](_0x338479[_0x51c7('0x48')],[_0x51c7('0x62'),'id'])||{});}return null;})[_0x51c7('0x63')](function(_0x1241e4){var _0xbd47f3;_0x398ca5=_0x1241e4||[];var _0x5995b0=[];if(_0x1241e4){for(var _0x25354a=0x0;_0x25354a<_0x1241e4[_0x51c7('0x33')];_0x25354a+=0x1){var _0x40d5e6=_0x1241e4[_0x25354a][_0x51c7('0x24')]({'plain':!![]});_0x1d73cf[_0x51c7('0x64')]=_0x338479['body']['dialCheckDuplicateType']?_0x338479[_0x51c7('0x48')][_0x51c7('0x64')]:_0x1d73cf[_0x51c7('0x64')];switch(_0x1d73cf[_0x51c7('0x64')]){case _0x51c7('0x65'):_0xbd47f3=squel[_0x51c7('0x66')]()[_0x51c7('0x67')](_0x51c7('0x68'))[_0x51c7('0x69')]([_0x51c7('0x6a'),_0x51c7('0x6b'),_0x51c7('0x6c'),_0x51c7('0x6d'),_0x51c7('0x5c'),_0x51c7('0x55'),_0x51c7('0x54')],squel[_0x51c7('0x6e')]()[_0x51c7('0x6f')](_0x51c7('0x6a'),_0x51c7('0x6a'))[_0x51c7('0x6f')](_0x51c7('0x70'),'scheduledAt')[_0x51c7('0x6f')]('id',_0x51c7('0x6c'))[_0x51c7('0x6f')](_0x40d5e6[_0x51c7('0x71')]['toString'](),_0x51c7('0x6d'))[_0x51c7('0x6f')](_0x338479[_0x51c7('0x42')]['id'][_0x51c7('0x72')](),_0x51c7('0x5c'))[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x55'))[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x54'))[_0x51c7('0x73')](_0x51c7('0x74'))[_0x51c7('0x39')](_0x51c7('0x75'))[_0x51c7('0x39')]('ListId\x20=\x20?',_0x40d5e6[_0x51c7('0x71')][_0x51c7('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x51c7('0x39')](_0x51c7('0x76'),squel['select']()['field'](_0x51c7('0x77'))['from'](_0x51c7('0x78'))[_0x51c7('0x39')](_0x51c7('0x79'),_0x338479[_0x51c7('0x42')]['id'][_0x51c7('0x72')]()))[_0x51c7('0x39')](_0x51c7('0x76'),squel['select']()[_0x51c7('0x6f')](_0x51c7('0x7a'))['from'](_0x51c7('0x68'))['where']('CampaignId\x20=\x20?',_0x338479[_0x51c7('0x42')]['id'][_0x51c7('0x72')]())))[_0x51c7('0x72')]();break;case _0x51c7('0x7b'):_0xbd47f3=squel[_0x51c7('0x66')]()[_0x51c7('0x67')](_0x51c7('0x68'))[_0x51c7('0x69')]([_0x51c7('0x6a'),_0x51c7('0x6b'),_0x51c7('0x6c'),_0x51c7('0x6d'),'CampaignId',_0x51c7('0x55'),_0x51c7('0x54')],squel['select']()[_0x51c7('0x6f')](_0x51c7('0x6a'),'phone')[_0x51c7('0x6f')]('NOW()',_0x51c7('0x6b'))[_0x51c7('0x6f')]('id',_0x51c7('0x6c'))[_0x51c7('0x6f')](_0x40d5e6[_0x51c7('0x71')][_0x51c7('0x72')](),'ListId')['field'](_0x338479['params']['id'][_0x51c7('0x72')](),_0x51c7('0x5c'))[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x55'))[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x54'))[_0x51c7('0x73')](_0x51c7('0x74'))['where'](_0x51c7('0x75'))['where'](_0x51c7('0x7c'),_0x40d5e6[_0x51c7('0x71')]['toString']())[_0x51c7('0x39')](_0x51c7('0x7d'))[_0x51c7('0x39')](_0x51c7('0x76'),squel['select']()[_0x51c7('0x6f')](_0x51c7('0x7a'))[_0x51c7('0x73')](_0x51c7('0x68'))[_0x51c7('0x39')](_0x51c7('0x79'),_0x338479[_0x51c7('0x42')]['id'][_0x51c7('0x72')]())))[_0x51c7('0x72')]();break;default:_0xbd47f3=squel['insert']()[_0x51c7('0x67')]('cm_hopper')[_0x51c7('0x69')](['phone',_0x51c7('0x6b'),_0x51c7('0x6c'),'ListId',_0x51c7('0x5c'),'createdAt',_0x51c7('0x54')],squel['select']()[_0x51c7('0x6f')](_0x51c7('0x6a'),'phone')[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x6b'))[_0x51c7('0x6f')]('id','ContactId')[_0x51c7('0x6f')](_0x40d5e6[_0x51c7('0x71')][_0x51c7('0x72')](),'ListId')[_0x51c7('0x6f')](_0x338479[_0x51c7('0x42')]['id']['toString'](),_0x51c7('0x5c'))[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x55'))['field'](_0x51c7('0x70'),_0x51c7('0x54'))[_0x51c7('0x73')](_0x51c7('0x74'))[_0x51c7('0x39')](_0x51c7('0x75'))[_0x51c7('0x39')](_0x51c7('0x7c'),_0x40d5e6['CmListId'][_0x51c7('0x72')]())[_0x51c7('0x39')](_0x51c7('0x7d')))[_0x51c7('0x72')]();}_0x5995b0[_0x51c7('0x7e')](db[_0x51c7('0x7f')]['query'](_0xbd47f3));}return BPromise[_0x51c7('0x80')](_0x5995b0);}})[_0x51c7('0x22')](function(){return _0x398ca5;})[_0x51c7('0x22')](respondWithResult(_0x3f9488,null))[_0x51c7('0x40')](handleError(_0x3f9488,null));};exports[_0x51c7('0x81')]=function(_0x9f9d8c,_0x370dd3,_0x2ff145){return db[_0x51c7('0x29')][_0x51c7('0x46')]({'where':{'id':_0x9f9d8c['params']['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x370dd3,null))[_0x51c7('0x22')](function(_0xf80898){if(_0xf80898){return _0xf80898[_0x51c7('0x81')](_0x9f9d8c[_0x51c7('0x2f')][_0x51c7('0x62')]);}})[_0x51c7('0x22')](function(_0x129c04){if(_0x129c04){return db[_0x51c7('0x59')][_0x51c7('0x23')]({'where':{'ListId':_0x9f9d8c[_0x51c7('0x2f')][_0x51c7('0x62')],'CampaignId':_0x9f9d8c[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](function(){return _0x129c04;});}})['then'](respondWithStatusCode(_0x370dd3,null))['catch'](handleError(_0x370dd3,null));};exports[_0x51c7('0x82')]=function(_0x197927,_0x1b93f7,_0x1ae918){var _0x16c99b={'raw':!![],'where':{}};var _0x449bb6={};var _0x254717={'count':0x0,'rows':[]};return db[_0x51c7('0x29')][_0x51c7('0x57')]({'where':{'id':_0x197927[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x1b93f7,null))['then'](function(_0x3fc5f4){if(_0x3fc5f4){_0x449bb6[_0x51c7('0x2d')]=_[_0x51c7('0x43')](db[_0x51c7('0x5f')][_0x51c7('0x2a')]);_0x449bb6[_0x51c7('0x2f')]=_[_0x51c7('0x43')](_0x197927[_0x51c7('0x2f')]);_0x449bb6[_0x51c7('0x37')]=_[_0x51c7('0x31')](_0x449bb6['model'],_0x449bb6[_0x51c7('0x2f')]);_0x16c99b[_0x51c7('0x30')]=_[_0x51c7('0x31')](_0x449bb6['model'],qs[_0x51c7('0x32')](_0x197927['query'][_0x51c7('0x32')]));_0x16c99b[_0x51c7('0x30')]=_0x16c99b[_0x51c7('0x30')][_0x51c7('0x33')]?_0x16c99b[_0x51c7('0x30')]:_0x449bb6['model'];if(!_0x197927[_0x51c7('0x2f')][_0x51c7('0x58')](_0x51c7('0x34'))){_0x16c99b['limit']=qs[_0x51c7('0x1d')](_0x197927[_0x51c7('0x2f')][_0x51c7('0x1d')]);_0x16c99b[_0x51c7('0x1c')]=qs[_0x51c7('0x1c')](_0x197927[_0x51c7('0x2f')][_0x51c7('0x1c')]);}_0x16c99b[_0x51c7('0x35')]=qs[_0x51c7('0x36')](_0x197927['query']['sort']);_0x16c99b['where']=qs[_0x51c7('0x37')](_[_0x51c7('0x38')](_0x197927['query'],_0x449bb6[_0x51c7('0x37')]));_0x16c99b[_0x51c7('0x39')]['CampaignId']=_0x3fc5f4['id'];if(_0x197927[_0x51c7('0x2f')][_0x51c7('0x3a')]){_0x16c99b[_0x51c7('0x39')]=_['merge'](_0x16c99b[_0x51c7('0x39')],{'$or':_['map'](_0x16c99b['attributes'],function(_0x2fb166){var _0x3f1d34={};_0x3f1d34[_0x2fb166]={'$like':'%'+_0x197927[_0x51c7('0x2f')][_0x51c7('0x3a')]+'%'};return _0x3f1d34;})});}_0x16c99b=_[_0x51c7('0x3b')]({},_0x16c99b,_0x197927[_0x51c7('0x45')]);return db[_0x51c7('0x5f')][_0x51c7('0x3c')]({'where':_0x16c99b['where']})[_0x51c7('0x22')](function(_0x28555e){_0x254717[_0x51c7('0x3c')]=_0x28555e;if(_0x197927['query'][_0x51c7('0x44')]){_0x16c99b[_0x51c7('0x3d')]=[{'all':!![]}];}return db[_0x51c7('0x5f')]['findAll'](_0x16c99b);})[_0x51c7('0x22')](function(_0xaa3698){_0x254717[_0x51c7('0x3f')]=_0xaa3698;return _0x254717;});}})['then'](respondWithFilteredResult(_0x1b93f7,_0x16c99b))['catch'](handleError(_0x1b93f7,null));};exports['addBlackLists']=function(_0x361324,_0x13b72a,_0x124d86){var _0x1471ba,_0x46b4f;return db['Campaign']['find']({'where':{'id':_0x361324[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x13b72a,null))[_0x51c7('0x22')](function(_0x579e39){if(_0x579e39){_0x46b4f=_0x579e39;return _0x579e39[_0x51c7('0x83')](_0x361324[_0x51c7('0x48')]['ids'],_[_0x51c7('0x53')](_0x361324[_0x51c7('0x48')],[_0x51c7('0x62'),'id'])||{});}return null;})[_0x51c7('0x63')](function(_0x2a5ce3){var _0x1e26e2;_0x1471ba=_0x2a5ce3||[];var _0x31847c=[];if(_0x2a5ce3){for(var _0x2c821e=0x0;_0x2c821e<_0x2a5ce3[_0x51c7('0x33')];_0x2c821e+=0x1){var _0x212906=_0x2a5ce3[_0x2c821e][_0x51c7('0x24')]({'plain':!![]});_0x1e26e2=squel['insert']()[_0x51c7('0x67')](_0x51c7('0x84'))[_0x51c7('0x69')]([_0x51c7('0x6a'),_0x51c7('0x6c'),_0x51c7('0x6d'),'CampaignId',_0x51c7('0x55'),'updatedAt'],squel[_0x51c7('0x6e')]()['field'](_0x51c7('0x6a'),_0x51c7('0x6a'))['field']('id',_0x51c7('0x6c'))['field'](_0x212906[_0x51c7('0x71')]['toString'](),_0x51c7('0x6d'))[_0x51c7('0x6f')](_0x361324[_0x51c7('0x42')]['id'][_0x51c7('0x72')](),_0x51c7('0x5c'))[_0x51c7('0x6f')](_0x51c7('0x70'),_0x51c7('0x55'))[_0x51c7('0x6f')]('NOW()',_0x51c7('0x54'))[_0x51c7('0x73')]('cm_contacts')[_0x51c7('0x39')](_0x51c7('0x75'))[_0x51c7('0x39')](_0x51c7('0x7c'),_0x212906[_0x51c7('0x71')][_0x51c7('0x72')]())[_0x51c7('0x39')](_0x51c7('0x7d')))['toString']();_0x31847c['push'](db[_0x51c7('0x7f')][_0x51c7('0x2f')](_0x1e26e2));}return BPromise[_0x51c7('0x80')](_0x31847c);}})['then'](function(){return _0x1471ba;})[_0x51c7('0x22')](respondWithResult(_0x13b72a,null))[_0x51c7('0x40')](handleError(_0x13b72a,null));};exports[_0x51c7('0x85')]=function(_0x46bb0a,_0x11fe79,_0xa5ab58){return db['Campaign'][_0x51c7('0x46')]({'where':{'id':_0x46bb0a[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](handleEntityNotFound(_0x11fe79,null))[_0x51c7('0x22')](function(_0x23b268){if(_0x23b268){return _0x23b268[_0x51c7('0x85')](_0x46bb0a['query']['ids']);}})[_0x51c7('0x22')](function(_0x157d80){if(_0x157d80){return db[_0x51c7('0x5e')][_0x51c7('0x23')]({'where':{'ListId':_0x46bb0a[_0x51c7('0x2f')][_0x51c7('0x62')],'CampaignId':_0x46bb0a[_0x51c7('0x42')]['id']}})[_0x51c7('0x22')](function(){return _0x157d80;});}})[_0x51c7('0x22')](respondWithStatusCode(_0x11fe79,null))[_0x51c7('0x40')](handleError(_0x11fe79,null));}; \ No newline at end of file +var _0x56a6=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','error','name','map','Campaign','rawAttributes','type','key','query','keys','intersection','model','fields','attributes','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','createdAt','updatedAt','omit','user','findOne','CmHopper','hasOwnProperty','nolimit','getHopperHistories','CmHopperHistory','getHopperFinals','CampaignId','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','ListId\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js'];(function(_0x10291b,_0x518773){var _0x1d5fbe=function(_0x24df58){while(--_0x24df58){_0x10291b['push'](_0x10291b['shift']());}};_0x1d5fbe(++_0x518773);}(_0x56a6,0x17b));var _0x656a=function(_0x2eef50,_0x2df7ee){_0x2eef50=_0x2eef50-0x0;var _0x331663=_0x56a6[_0x2eef50];return _0x331663;};'use strict';var pdf=require(_0x656a('0x0'));var emlformat=require(_0x656a('0x1'));var rimraf=require(_0x656a('0x2'));var zipdir=require(_0x656a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x656a('0x4'));var BPromise=require(_0x656a('0x5'));var Mustache=require(_0x656a('0x6'));var util=require('util');var path=require(_0x656a('0x7'));var sox=require(_0x656a('0x8'));var csv=require(_0x656a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x656a('0xa'));var squel=require(_0x656a('0xb'));var crypto=require(_0x656a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x656a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x656a('0xe'));var Redis=require(_0x656a('0xf'));var authService=require(_0x656a('0x10'));var qs=require(_0x656a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x656a('0x12'));var logger=require(_0x656a('0x13'))(_0x656a('0x14'));var utils=require(_0x656a('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cc2ce,_0x16312b){_0x16312b=_0x16312b||0xcc;return function(_0x32a319){if(_0x32a319){return _0x4cc2ce[_0x656a('0x16')](_0x16312b);}return _0x4cc2ce[_0x656a('0x17')](_0x16312b)[_0x656a('0x18')]();};}function respondWithResult(_0x5707b4,_0x30e0ab){_0x30e0ab=_0x30e0ab||0xc8;return function(_0x2721cd){if(_0x2721cd){return _0x5707b4[_0x656a('0x17')](_0x30e0ab)[_0x656a('0x19')](_0x2721cd);}};}function respondWithFilteredResult(_0x3473e1,_0x29f176){return function(_0x55ed){if(_0x55ed){var _0x3c8d71=_0x55ed[_0x656a('0x1a')],_0x552b5b=_0x29f176[_0x656a('0x1b')],_0x1052ca=_0x29f176[_0x656a('0x1b')]+_0x29f176[_0x656a('0x1c')],_0x27a11;if(_0x1052ca>=_0x3c8d71){_0x1052ca=_0x3c8d71;_0x27a11=0xc8;}else{_0x27a11=0xce;}_0x3473e1[_0x656a('0x17')](_0x27a11);return _0x3473e1[_0x656a('0x1d')](_0x656a('0x1e'),_0x552b5b+'-'+_0x1052ca+'/'+_0x3c8d71)['json'](_0x55ed);}return null;};}function patchUpdates(_0x38be9f){return function(_0xe31a24){try{jsonpatch[_0x656a('0x1f')](_0xe31a24,_0x38be9f,!![]);}catch(_0x2affe9){return BPromise[_0x656a('0x20')](_0x2affe9);}return _0xe31a24[_0x656a('0x21')]();};}function saveUpdates(_0x3e1307,_0x1cecf4){return function(_0x53661e){if(_0x53661e){return _0x53661e[_0x656a('0x22')](_0x3e1307)['then'](function(_0x507cad){return _0x507cad;});}return null;};}function removeEntity(_0x5c2e25,_0x53c0b6){return function(_0x124f76){if(_0x124f76){return _0x124f76[_0x656a('0x23')]()['then'](function(){var _0x6bab7f=_0x124f76[_0x656a('0x24')]({'plain':!![]});var _0x39d148='IvrCampaigns';return db[_0x656a('0x25')][_0x656a('0x23')]({'where':{'type':_0x39d148,'resourceId':_0x6bab7f['id']}})[_0x656a('0x26')](function(){return _0x124f76;});})[_0x656a('0x26')](function(){_0x5c2e25[_0x656a('0x17')](0xcc)[_0x656a('0x18')]();});}};}function handleEntityNotFound(_0xa9ec33,_0x15271f){return function(_0x4b4a00){if(!_0x4b4a00){_0xa9ec33[_0x656a('0x16')](0x194);}return _0x4b4a00;};}function handleError(_0x4c79cd,_0x223d67){_0x223d67=_0x223d67||0x1f4;return function(_0x568066){logger[_0x656a('0x27')](_0x568066['stack']);if(_0x568066[_0x656a('0x28')]){delete _0x568066['name'];}_0x4c79cd[_0x656a('0x17')](_0x223d67)['send'](_0x568066);};}exports['index']=function(_0x47bcc0,_0x2a00ba){var _0x49a723={},_0xb19ba7={},_0x5a756c={'count':0x0,'rows':[]};var _0x2ac965=_[_0x656a('0x29')](db[_0x656a('0x2a')][_0x656a('0x2b')],function(_0x551fa6){return{'name':_0x551fa6['fieldName'],'type':_0x551fa6[_0x656a('0x2c')][_0x656a('0x2d')]};});_0xb19ba7['model']=_[_0x656a('0x29')](_0x2ac965,_0x656a('0x28'));_0xb19ba7[_0x656a('0x2e')]=_[_0x656a('0x2f')](_0x47bcc0['query']);_0xb19ba7['filters']=_[_0x656a('0x30')](_0xb19ba7[_0x656a('0x31')],_0xb19ba7['query']);_0x49a723['attributes']=_[_0x656a('0x30')](_0xb19ba7[_0x656a('0x31')],qs[_0x656a('0x32')](_0x47bcc0['query']['fields']));_0x49a723[_0x656a('0x33')]=_0x49a723[_0x656a('0x33')][_0x656a('0x34')]?_0x49a723[_0x656a('0x33')]:_0xb19ba7[_0x656a('0x31')];if(!_0x47bcc0[_0x656a('0x2e')]['hasOwnProperty']('nolimit')){_0x49a723[_0x656a('0x1c')]=qs[_0x656a('0x1c')](_0x47bcc0['query'][_0x656a('0x1c')]);_0x49a723[_0x656a('0x1b')]=qs['offset'](_0x47bcc0[_0x656a('0x2e')][_0x656a('0x1b')]);}_0x49a723[_0x656a('0x35')]=qs[_0x656a('0x36')](_0x47bcc0[_0x656a('0x2e')][_0x656a('0x36')]);_0x49a723[_0x656a('0x37')]=qs[_0x656a('0x38')](_[_0x656a('0x39')](_0x47bcc0['query'],_0xb19ba7['filters']),_0x2ac965);if(_0x47bcc0['query'][_0x656a('0x3a')]){_0x49a723['where']=_[_0x656a('0x3b')](_0x49a723[_0x656a('0x37')],{'$or':_[_0x656a('0x29')](_0x2ac965,function(_0x1372dd){if(_0x1372dd['type']!==_0x656a('0x3c')){var _0x2a693e={};_0x2a693e[_0x1372dd[_0x656a('0x28')]]={'$like':'%'+_0x47bcc0[_0x656a('0x2e')][_0x656a('0x3a')]+'%'};return _0x2a693e;}})});}_0x49a723=_[_0x656a('0x3b')]({},_0x49a723,_0x47bcc0[_0x656a('0x3d')]);var _0x4f5399={'where':_0x49a723[_0x656a('0x37')]};return db[_0x656a('0x2a')][_0x656a('0x1a')](_0x4f5399)[_0x656a('0x26')](function(_0x34efa3){_0x5a756c[_0x656a('0x1a')]=_0x34efa3;if(_0x47bcc0[_0x656a('0x2e')][_0x656a('0x3e')]){_0x49a723[_0x656a('0x3f')]=[{'all':!![]}];}return db[_0x656a('0x2a')][_0x656a('0x40')](_0x49a723);})[_0x656a('0x26')](function(_0x3f969e){_0x5a756c[_0x656a('0x41')]=_0x3f969e;return _0x5a756c;})[_0x656a('0x26')](respondWithFilteredResult(_0x2a00ba,_0x49a723))[_0x656a('0x42')](handleError(_0x2a00ba,null));};exports[_0x656a('0x43')]=function(_0x511e00,_0x17e8fa){var _0x4b823a={'raw':![],'where':{'id':_0x511e00['params']['id']}},_0x5cee3f={};_0x5cee3f['model']=_[_0x656a('0x2f')](db['Campaign'][_0x656a('0x2b')]);_0x5cee3f[_0x656a('0x2e')]=_[_0x656a('0x2f')](_0x511e00[_0x656a('0x2e')]);_0x5cee3f[_0x656a('0x38')]=_[_0x656a('0x30')](_0x5cee3f[_0x656a('0x31')],_0x5cee3f['query']);_0x4b823a[_0x656a('0x33')]=_[_0x656a('0x30')](_0x5cee3f[_0x656a('0x31')],qs[_0x656a('0x32')](_0x511e00[_0x656a('0x2e')]['fields']));_0x4b823a['attributes']=_0x4b823a[_0x656a('0x33')][_0x656a('0x34')]?_0x4b823a[_0x656a('0x33')]:_0x5cee3f['model'];if(_0x511e00['query'][_0x656a('0x3e')]){_0x4b823a[_0x656a('0x3f')]=[{'all':!![]}];}_0x4b823a=_[_0x656a('0x3b')]({},_0x4b823a,_0x511e00[_0x656a('0x3d')]);return db[_0x656a('0x2a')][_0x656a('0x44')](_0x4b823a)[_0x656a('0x26')](handleEntityNotFound(_0x17e8fa,null))[_0x656a('0x26')](respondWithResult(_0x17e8fa,null))[_0x656a('0x42')](handleError(_0x17e8fa,null));};exports[_0x656a('0x45')]=function(_0xd5ad0d,_0x42560d){return db[_0x656a('0x2a')][_0x656a('0x45')](_0xd5ad0d[_0x656a('0x46')],{})['then'](function(_0x1f3b8e){var _0xd6af61=_0xd5ad0d['user']['get']({'plain':!![]});if(!_0xd6af61)throw new Error(_0x656a('0x47'));if(_0xd6af61[_0x656a('0x48')]==='user'){var _0x5167ad=_0x1f3b8e['get']({'plain':!![]});var _0x467016=_0x656a('0x49');return db[_0x656a('0x4a')][_0x656a('0x44')]({'where':{'name':_0x467016,'userProfileId':_0xd6af61[_0x656a('0x4b')]},'raw':!![]})[_0x656a('0x26')](function(_0x25039d){if(_0x25039d&&_0x25039d[_0x656a('0x4c')]===0x0){return db[_0x656a('0x25')]['create']({'name':_0x5167ad[_0x656a('0x28')],'resourceId':_0x5167ad['id'],'type':_0x25039d[_0x656a('0x28')],'sectionId':_0x25039d['id']},{})[_0x656a('0x26')](function(){return _0x1f3b8e;});}else{return _0x1f3b8e;}})[_0x656a('0x42')](function(_0x5b3632){logger[_0x656a('0x27')](_0x656a('0x4d'),_0x5b3632);throw _0x5b3632;});}return _0x1f3b8e;})[_0x656a('0x26')](respondWithResult(_0x42560d,0xc9))[_0x656a('0x42')](handleError(_0x42560d,null));};exports['clone']=function(_0x4d44e3,_0x4e86fc){var _0x136b17={'where':{'id':_0x4d44e3[_0x656a('0x4e')]['id']}},_0x3f3e97={};_0x3f3e97[_0x656a('0x31')]=_[_0x656a('0x2f')](db['Campaign'][_0x656a('0x2b')]);_0x136b17['attributes']=_[_0x656a('0x30')](_0x3f3e97[_0x656a('0x31')],qs[_0x656a('0x32')](_0x4d44e3['query']['fields']));_0x136b17[_0x656a('0x33')]=_0x136b17[_0x656a('0x33')][_0x656a('0x34')]?_0x136b17[_0x656a('0x33')]:_0x3f3e97['model'];if(_0x4d44e3[_0x656a('0x2e')]['includeAll']){_0x136b17[_0x656a('0x3f')]=[{'all':!![]}];}_0x136b17=_[_0x656a('0x3b')]({},_0x136b17,_0x4d44e3[_0x656a('0x3d')]);return db['Campaign']['find'](_0x136b17)[_0x656a('0x26')](handleEntityNotFound(_0x4e86fc,null))[_0x656a('0x26')](function(_0x1c7f00){if(_0x1c7f00){var _0x3f7603=_0x1c7f00[_0x656a('0x24')]({'plain':!![]});_0x3f7603=qs['omit'](_0x3f7603,['id',_0x656a('0x4f'),_0x656a('0x50')]);_0x4d44e3[_0x656a('0x46')]=_[_0x656a('0x51')](_0x4d44e3['body'],['id','createdAt',_0x656a('0x50')]);return db['Campaign']['create'](_['merge'](_0x3f7603,_0x4d44e3[_0x656a('0x46')]),{'include':_0x4d44e3[_0x656a('0x2e')][_0x656a('0x3e')]?[{'all':!![]}]:undefined})[_0x656a('0x26')](function(_0x320dce){var _0x468c18=_0x4d44e3[_0x656a('0x52')][_0x656a('0x24')]({'plain':!![]});if(!_0x468c18)throw new Error(_0x656a('0x47'));if(_0x468c18['role']==='user'){var _0x24ba37=_0x320dce[_0x656a('0x24')]({'plain':!![]});var _0x285f05=_0x656a('0x49');return db[_0x656a('0x4a')][_0x656a('0x44')]({'where':{'name':_0x285f05,'userProfileId':_0x468c18[_0x656a('0x4b')]},'raw':!![]})['then'](function(_0x3321cf){if(_0x3321cf&&_0x3321cf[_0x656a('0x4c')]===0x0){return db[_0x656a('0x25')]['create']({'name':_0x24ba37[_0x656a('0x28')],'resourceId':_0x24ba37['id'],'type':_0x3321cf['name'],'sectionId':_0x3321cf['id']},{})[_0x656a('0x26')](function(){return _0x320dce;});}else{return _0x320dce;}})[_0x656a('0x42')](function(_0x3cc741){logger[_0x656a('0x27')](_0x656a('0x4d'),_0x3cc741);throw _0x3cc741;});}return _0x320dce;});}})[_0x656a('0x26')](respondWithResult(_0x4e86fc,0xc9))[_0x656a('0x42')](handleError(_0x4e86fc,null));};exports[_0x656a('0x22')]=function(_0x29e7b6,_0x34449b){if(_0x29e7b6[_0x656a('0x46')]['id']){delete _0x29e7b6[_0x656a('0x46')]['id'];}return db[_0x656a('0x2a')][_0x656a('0x44')]({'where':{'id':_0x29e7b6[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x34449b,null))[_0x656a('0x26')](saveUpdates(_0x29e7b6['body'],null))[_0x656a('0x26')](respondWithResult(_0x34449b,null))[_0x656a('0x42')](handleError(_0x34449b,null));};exports[_0x656a('0x23')]=function(_0x4e3ef3,_0x51cbbf){return db[_0x656a('0x2a')][_0x656a('0x44')]({'where':{'id':_0x4e3ef3[_0x656a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x51cbbf,null))[_0x656a('0x26')](removeEntity(_0x51cbbf,null))[_0x656a('0x42')](handleError(_0x51cbbf,null));};exports['getHoppers']=function(_0x12891c,_0xce3544,_0x303713){var _0x4de495={'raw':!![],'where':{}};var _0xaef75b={};var _0x6db27={'count':0x0,'rows':[]};return db[_0x656a('0x2a')][_0x656a('0x53')]({'where':{'id':_0x12891c[_0x656a('0x4e')]['id']}})['then'](handleEntityNotFound(_0xce3544,null))['then'](function(_0x59191f){if(_0x59191f){_0xaef75b[_0x656a('0x31')]=_[_0x656a('0x2f')](db[_0x656a('0x54')]['rawAttributes']);_0xaef75b[_0x656a('0x2e')]=_[_0x656a('0x2f')](_0x12891c[_0x656a('0x2e')]);_0xaef75b[_0x656a('0x38')]=_['intersection'](_0xaef75b[_0x656a('0x31')],_0xaef75b[_0x656a('0x2e')]);_0x4de495[_0x656a('0x33')]=_[_0x656a('0x30')](_0xaef75b[_0x656a('0x31')],qs['fields'](_0x12891c[_0x656a('0x2e')][_0x656a('0x32')]));_0x4de495[_0x656a('0x33')]=_0x4de495[_0x656a('0x33')][_0x656a('0x34')]?_0x4de495['attributes']:_0xaef75b[_0x656a('0x31')];if(!_0x12891c[_0x656a('0x2e')][_0x656a('0x55')](_0x656a('0x56'))){_0x4de495['limit']=qs['limit'](_0x12891c[_0x656a('0x2e')]['limit']);_0x4de495[_0x656a('0x1b')]=qs[_0x656a('0x1b')](_0x12891c[_0x656a('0x2e')][_0x656a('0x1b')]);}_0x4de495[_0x656a('0x35')]=qs[_0x656a('0x36')](_0x12891c[_0x656a('0x2e')][_0x656a('0x36')]);_0x4de495[_0x656a('0x37')]=qs[_0x656a('0x38')](_[_0x656a('0x39')](_0x12891c[_0x656a('0x2e')],_0xaef75b[_0x656a('0x38')]));_0x4de495[_0x656a('0x37')]['CampaignId']=_0x59191f['id'];if(_0x12891c[_0x656a('0x2e')]['filter']){_0x4de495[_0x656a('0x37')]=_['merge'](_0x4de495[_0x656a('0x37')],{'$or':_['map'](_0x4de495[_0x656a('0x33')],function(_0x5d1fef){var _0xdc9451={};_0xdc9451[_0x5d1fef]={'$like':'%'+_0x12891c[_0x656a('0x2e')]['filter']+'%'};return _0xdc9451;})});}_0x4de495=_[_0x656a('0x3b')]({},_0x4de495,_0x12891c['options']);return db[_0x656a('0x54')][_0x656a('0x1a')]({'where':_0x4de495[_0x656a('0x37')]})[_0x656a('0x26')](function(_0x2239a2){_0x6db27['count']=_0x2239a2;if(_0x12891c[_0x656a('0x2e')][_0x656a('0x3e')]){_0x4de495[_0x656a('0x3f')]=[{'all':!![]}];}return db[_0x656a('0x54')]['findAll'](_0x4de495);})[_0x656a('0x26')](function(_0xbc202b){_0x6db27['rows']=_0xbc202b;return _0x6db27;});}})[_0x656a('0x26')](respondWithFilteredResult(_0xce3544,_0x4de495))[_0x656a('0x42')](handleError(_0xce3544,null));};exports[_0x656a('0x57')]=function(_0x5bbe5c,_0x121f7b,_0x153ef5){var _0x139675={'raw':!![],'where':{}};var _0x16d518={};var _0x3134a5={'count':0x0,'rows':[]};return db[_0x656a('0x2a')]['findOne']({'where':{'id':_0x5bbe5c['params']['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x121f7b,null))[_0x656a('0x26')](function(_0x4496b4){if(_0x4496b4){_0x16d518[_0x656a('0x31')]=_[_0x656a('0x2f')](db[_0x656a('0x58')][_0x656a('0x2b')]);_0x16d518[_0x656a('0x2e')]=_[_0x656a('0x2f')](_0x5bbe5c[_0x656a('0x2e')]);_0x16d518[_0x656a('0x38')]=_[_0x656a('0x30')](_0x16d518[_0x656a('0x31')],_0x16d518['query']);_0x139675[_0x656a('0x33')]=_[_0x656a('0x30')](_0x16d518[_0x656a('0x31')],qs[_0x656a('0x32')](_0x5bbe5c[_0x656a('0x2e')]['fields']));_0x139675[_0x656a('0x33')]=_0x139675[_0x656a('0x33')][_0x656a('0x34')]?_0x139675[_0x656a('0x33')]:_0x16d518['model'];if(!_0x5bbe5c[_0x656a('0x2e')][_0x656a('0x55')]('nolimit')){_0x139675[_0x656a('0x1c')]=qs[_0x656a('0x1c')](_0x5bbe5c[_0x656a('0x2e')][_0x656a('0x1c')]);_0x139675[_0x656a('0x1b')]=qs[_0x656a('0x1b')](_0x5bbe5c[_0x656a('0x2e')][_0x656a('0x1b')]);}_0x139675[_0x656a('0x35')]=qs[_0x656a('0x36')](_0x5bbe5c[_0x656a('0x2e')][_0x656a('0x36')]);_0x139675['where']=qs[_0x656a('0x38')](_[_0x656a('0x39')](_0x5bbe5c[_0x656a('0x2e')],_0x16d518[_0x656a('0x38')]));_0x139675[_0x656a('0x37')]['CampaignId']=_0x4496b4['id'];if(_0x5bbe5c['query']['filter']){_0x139675[_0x656a('0x37')]=_['merge'](_0x139675[_0x656a('0x37')],{'$or':_[_0x656a('0x29')](_0x139675[_0x656a('0x33')],function(_0x53cfb1){var _0x3677d9={};_0x3677d9[_0x53cfb1]={'$like':'%'+_0x5bbe5c['query'][_0x656a('0x3a')]+'%'};return _0x3677d9;})});}_0x139675=_[_0x656a('0x3b')]({},_0x139675,_0x5bbe5c['options']);return db[_0x656a('0x58')][_0x656a('0x1a')]({'where':_0x139675[_0x656a('0x37')]})[_0x656a('0x26')](function(_0x442aba){_0x3134a5[_0x656a('0x1a')]=_0x442aba;if(_0x5bbe5c['query'][_0x656a('0x3e')]){_0x139675['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x656a('0x40')](_0x139675);})['then'](function(_0x8168d){_0x3134a5[_0x656a('0x41')]=_0x8168d;return _0x3134a5;});}})['then'](respondWithFilteredResult(_0x121f7b,_0x139675))[_0x656a('0x42')](handleError(_0x121f7b,null));};exports[_0x656a('0x59')]=function(_0x2699de,_0x2bfa72,_0x5acf77){var _0x1c940a={'raw':!![],'where':{}};var _0x2c0f53={};var _0x3ecdd8={'count':0x0,'rows':[]};return db['Campaign'][_0x656a('0x53')]({'where':{'id':_0x2699de[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x2bfa72,null))[_0x656a('0x26')](function(_0x25bb52){if(_0x25bb52){_0x2c0f53[_0x656a('0x31')]=_[_0x656a('0x2f')](db['CmHopperFinal'][_0x656a('0x2b')]);_0x2c0f53[_0x656a('0x2e')]=_['keys'](_0x2699de[_0x656a('0x2e')]);_0x2c0f53[_0x656a('0x38')]=_[_0x656a('0x30')](_0x2c0f53[_0x656a('0x31')],_0x2c0f53[_0x656a('0x2e')]);_0x1c940a[_0x656a('0x33')]=_[_0x656a('0x30')](_0x2c0f53[_0x656a('0x31')],qs[_0x656a('0x32')](_0x2699de[_0x656a('0x2e')][_0x656a('0x32')]));_0x1c940a[_0x656a('0x33')]=_0x1c940a[_0x656a('0x33')]['length']?_0x1c940a[_0x656a('0x33')]:_0x2c0f53['model'];if(!_0x2699de[_0x656a('0x2e')][_0x656a('0x55')](_0x656a('0x56'))){_0x1c940a[_0x656a('0x1c')]=qs['limit'](_0x2699de[_0x656a('0x2e')]['limit']);_0x1c940a[_0x656a('0x1b')]=qs[_0x656a('0x1b')](_0x2699de[_0x656a('0x2e')][_0x656a('0x1b')]);}_0x1c940a['order']=qs['sort'](_0x2699de[_0x656a('0x2e')][_0x656a('0x36')]);_0x1c940a[_0x656a('0x37')]=qs['filters'](_[_0x656a('0x39')](_0x2699de[_0x656a('0x2e')],_0x2c0f53['filters']));_0x1c940a[_0x656a('0x37')][_0x656a('0x5a')]=_0x25bb52['id'];if(_0x2699de[_0x656a('0x2e')][_0x656a('0x3a')]){_0x1c940a[_0x656a('0x37')]=_[_0x656a('0x3b')](_0x1c940a[_0x656a('0x37')],{'$or':_[_0x656a('0x29')](_0x1c940a[_0x656a('0x33')],function(_0x1dc862){var _0xa262fd={};_0xa262fd[_0x1dc862]={'$like':'%'+_0x2699de[_0x656a('0x2e')][_0x656a('0x3a')]+'%'};return _0xa262fd;})});}_0x1c940a=_[_0x656a('0x3b')]({},_0x1c940a,_0x2699de['options']);return db[_0x656a('0x5b')][_0x656a('0x1a')]({'where':_0x1c940a[_0x656a('0x37')]})[_0x656a('0x26')](function(_0x8bcf82){_0x3ecdd8['count']=_0x8bcf82;if(_0x2699de['query']['includeAll']){_0x1c940a[_0x656a('0x3f')]=[{'all':!![]}];}return db[_0x656a('0x5b')][_0x656a('0x40')](_0x1c940a);})[_0x656a('0x26')](function(_0x1bbbab){_0x3ecdd8[_0x656a('0x41')]=_0x1bbbab;return _0x3ecdd8;});}})[_0x656a('0x26')](respondWithFilteredResult(_0x2bfa72,_0x1c940a))['catch'](handleError(_0x2bfa72,null));};exports['getHopperBlacks']=function(_0x2549a4,_0x2c8871,_0x44ac0b){var _0x16f743={'raw':!![],'where':{}};var _0x16872a={};var _0x383d8a={'count':0x0,'rows':[]};return db[_0x656a('0x2a')]['findOne']({'where':{'id':_0x2549a4[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x2c8871,null))[_0x656a('0x26')](function(_0x477771){if(_0x477771){_0x16872a[_0x656a('0x31')]=_[_0x656a('0x2f')](db[_0x656a('0x5c')][_0x656a('0x2b')]);_0x16872a[_0x656a('0x2e')]=_['keys'](_0x2549a4[_0x656a('0x2e')]);_0x16872a[_0x656a('0x38')]=_[_0x656a('0x30')](_0x16872a[_0x656a('0x31')],_0x16872a[_0x656a('0x2e')]);_0x16f743[_0x656a('0x33')]=_[_0x656a('0x30')](_0x16872a[_0x656a('0x31')],qs[_0x656a('0x32')](_0x2549a4[_0x656a('0x2e')][_0x656a('0x32')]));_0x16f743[_0x656a('0x33')]=_0x16f743[_0x656a('0x33')]['length']?_0x16f743[_0x656a('0x33')]:_0x16872a[_0x656a('0x31')];if(!_0x2549a4[_0x656a('0x2e')][_0x656a('0x55')](_0x656a('0x56'))){_0x16f743[_0x656a('0x1c')]=qs[_0x656a('0x1c')](_0x2549a4[_0x656a('0x2e')][_0x656a('0x1c')]);_0x16f743[_0x656a('0x1b')]=qs[_0x656a('0x1b')](_0x2549a4['query'][_0x656a('0x1b')]);}_0x16f743[_0x656a('0x35')]=qs[_0x656a('0x36')](_0x2549a4[_0x656a('0x2e')]['sort']);_0x16f743[_0x656a('0x37')]=qs[_0x656a('0x38')](_[_0x656a('0x39')](_0x2549a4[_0x656a('0x2e')],_0x16872a[_0x656a('0x38')]));_0x16f743[_0x656a('0x37')][_0x656a('0x5a')]=_0x477771['id'];if(_0x2549a4['query'][_0x656a('0x3a')]){_0x16f743[_0x656a('0x37')]=_[_0x656a('0x3b')](_0x16f743[_0x656a('0x37')],{'$or':_[_0x656a('0x29')](_0x16f743[_0x656a('0x33')],function(_0x321454){var _0x329e7a={};_0x329e7a[_0x321454]={'$like':'%'+_0x2549a4['query'][_0x656a('0x3a')]+'%'};return _0x329e7a;})});}_0x16f743=_[_0x656a('0x3b')]({},_0x16f743,_0x2549a4[_0x656a('0x3d')]);return db[_0x656a('0x5c')][_0x656a('0x1a')]({'where':_0x16f743[_0x656a('0x37')]})[_0x656a('0x26')](function(_0x2295a1){_0x383d8a[_0x656a('0x1a')]=_0x2295a1;if(_0x2549a4[_0x656a('0x2e')][_0x656a('0x3e')]){_0x16f743[_0x656a('0x3f')]=[{'all':!![]}];}return db[_0x656a('0x5c')][_0x656a('0x40')](_0x16f743);})[_0x656a('0x26')](function(_0x2a8cd2){_0x383d8a[_0x656a('0x41')]=_0x2a8cd2;return _0x383d8a;});}})[_0x656a('0x26')](respondWithFilteredResult(_0x2c8871,_0x16f743))['catch'](handleError(_0x2c8871,null));};exports[_0x656a('0x5d')]=function(_0x5579db,_0x349e53,_0x3ae64d){var _0x25ae81={};var _0x11c9ff={};var _0x5d8d2a;var _0x709242;return db[_0x656a('0x2a')][_0x656a('0x53')]({'where':{'id':_0x5579db[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x349e53,null))[_0x656a('0x26')](function(_0x838cf0){if(_0x838cf0){_0x5d8d2a=_0x838cf0;_0x11c9ff[_0x656a('0x31')]=_[_0x656a('0x2f')](db[_0x656a('0x5e')]['rawAttributes']);_0x11c9ff[_0x656a('0x2e')]=_[_0x656a('0x2f')](_0x5579db['query']);_0x11c9ff[_0x656a('0x38')]=_['intersection'](_0x11c9ff[_0x656a('0x31')],_0x11c9ff['query']);_0x25ae81[_0x656a('0x33')]=_['intersection'](_0x11c9ff[_0x656a('0x31')],qs[_0x656a('0x32')](_0x5579db[_0x656a('0x2e')][_0x656a('0x32')]));_0x25ae81[_0x656a('0x33')]=_0x25ae81['attributes'][_0x656a('0x34')]?_0x25ae81['attributes']:_0x11c9ff['model'];_0x25ae81[_0x656a('0x35')]=qs[_0x656a('0x36')](_0x5579db['query'][_0x656a('0x36')]);_0x25ae81[_0x656a('0x37')]=qs['filters'](_[_0x656a('0x39')](_0x5579db['query'],_0x11c9ff[_0x656a('0x38')]));if(_0x5579db[_0x656a('0x2e')][_0x656a('0x3a')]){_0x25ae81[_0x656a('0x37')]=_[_0x656a('0x3b')](_0x25ae81['where'],{'$or':_['map'](_0x25ae81[_0x656a('0x33')],function(_0x3d3ddc){var _0x1d6ece={};_0x1d6ece[_0x3d3ddc]={'$like':'%'+_0x5579db[_0x656a('0x2e')][_0x656a('0x3a')]+'%'};return _0x1d6ece;})});}_0x25ae81=_[_0x656a('0x3b')]({},_0x25ae81,_0x5579db[_0x656a('0x3d')]);return _0x5d8d2a['getLists'](_0x25ae81);}})[_0x656a('0x26')](function(_0x35a28b){if(_0x35a28b){_0x709242=_0x35a28b[_0x656a('0x34')];if(!_0x5579db['query']['hasOwnProperty'](_0x656a('0x56'))){_0x25ae81[_0x656a('0x1c')]=qs[_0x656a('0x1c')](_0x5579db['query']['limit']);_0x25ae81[_0x656a('0x1b')]=qs['offset'](_0x5579db[_0x656a('0x2e')][_0x656a('0x1b')]);}return _0x5d8d2a[_0x656a('0x5d')](_0x25ae81);}})['then'](function(_0xa73c7c){if(_0xa73c7c){return _0xa73c7c?{'count':_0x709242,'rows':_0xa73c7c}:null;}})[_0x656a('0x26')](respondWithResult(_0x349e53,null))[_0x656a('0x42')](handleError(_0x349e53,null));};exports['addLists']=function(_0x514606,_0x54c3b1,_0x4e6745){var _0x2c9d86,_0x5e50cd;return db[_0x656a('0x2a')][_0x656a('0x44')]({'where':{'id':_0x514606[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x54c3b1,null))[_0x656a('0x26')](function(_0x5cabd3){if(_0x5cabd3){_0x5e50cd=_0x5cabd3;return _0x5cabd3[_0x656a('0x5f')](_0x514606[_0x656a('0x46')][_0x656a('0x60')],_[_0x656a('0x51')](_0x514606[_0x656a('0x46')],[_0x656a('0x60'),'id'])||{});}return null;})[_0x656a('0x61')](function(_0x2e893c){var _0x4b3e0c;_0x2c9d86=_0x2e893c||[];var _0x3fa07c=[];if(_0x2e893c){for(var _0x51108c=0x0;_0x51108c<_0x2e893c['length'];_0x51108c+=0x1){var _0x1da17a=_0x2e893c[_0x51108c][_0x656a('0x24')]({'plain':!![]});_0x5e50cd[_0x656a('0x62')]=_0x514606[_0x656a('0x46')][_0x656a('0x62')]?_0x514606[_0x656a('0x46')][_0x656a('0x62')]:_0x5e50cd[_0x656a('0x62')];switch(_0x5e50cd[_0x656a('0x62')]){case'always':_0x4b3e0c=squel[_0x656a('0x63')]()[_0x656a('0x64')](_0x656a('0x65'))[_0x656a('0x66')]([_0x656a('0x67'),_0x656a('0x68'),'ContactId',_0x656a('0x69'),_0x656a('0x5a'),_0x656a('0x4f'),_0x656a('0x50')],squel[_0x656a('0x6a')]()[_0x656a('0x6b')](_0x656a('0x67'),_0x656a('0x67'))['field'](_0x656a('0x6c'),_0x656a('0x68'))[_0x656a('0x6b')]('id',_0x656a('0x6d'))['field'](_0x1da17a[_0x656a('0x6e')][_0x656a('0x6f')](),_0x656a('0x69'))[_0x656a('0x6b')](_0x514606[_0x656a('0x4e')]['id'][_0x656a('0x6f')](),_0x656a('0x5a'))[_0x656a('0x6b')]('NOW()',_0x656a('0x4f'))[_0x656a('0x6b')](_0x656a('0x6c'),_0x656a('0x50'))[_0x656a('0x70')](_0x656a('0x71'))['where'](_0x656a('0x72'))[_0x656a('0x37')]('ListId\x20=\x20?',_0x1da17a[_0x656a('0x6e')][_0x656a('0x6f')]())[_0x656a('0x37')](_0x656a('0x73'))['where'](_0x656a('0x74'),squel[_0x656a('0x6a')]()['field'](_0x656a('0x75'))[_0x656a('0x70')](_0x656a('0x76'))[_0x656a('0x37')]('CampaignId\x20=\x20?',_0x514606[_0x656a('0x4e')]['id']['toString']()))['where'](_0x656a('0x74'),squel[_0x656a('0x6a')]()[_0x656a('0x6b')](_0x656a('0x77'))[_0x656a('0x70')]('cm_hopper')[_0x656a('0x37')](_0x656a('0x78'),_0x514606['params']['id'][_0x656a('0x6f')]())))[_0x656a('0x6f')]();break;case _0x656a('0x79'):_0x4b3e0c=squel[_0x656a('0x63')]()[_0x656a('0x64')](_0x656a('0x65'))[_0x656a('0x66')](['phone',_0x656a('0x68'),_0x656a('0x6d'),_0x656a('0x69'),_0x656a('0x5a'),_0x656a('0x4f'),_0x656a('0x50')],squel[_0x656a('0x6a')]()[_0x656a('0x6b')](_0x656a('0x67'),_0x656a('0x67'))[_0x656a('0x6b')]('NOW()',_0x656a('0x68'))['field']('id','ContactId')['field'](_0x1da17a[_0x656a('0x6e')]['toString'](),'ListId')[_0x656a('0x6b')](_0x514606[_0x656a('0x4e')]['id']['toString'](),_0x656a('0x5a'))[_0x656a('0x6b')](_0x656a('0x6c'),_0x656a('0x4f'))[_0x656a('0x6b')]('NOW()','updatedAt')[_0x656a('0x70')]('cm_contacts')[_0x656a('0x37')](_0x656a('0x72'))[_0x656a('0x37')](_0x656a('0x7a'),_0x1da17a[_0x656a('0x6e')][_0x656a('0x6f')]())['where'](_0x656a('0x73'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x656a('0x6a')]()['field'](_0x656a('0x77'))['from'](_0x656a('0x65'))[_0x656a('0x37')](_0x656a('0x78'),_0x514606[_0x656a('0x4e')]['id'][_0x656a('0x6f')]())))[_0x656a('0x6f')]();break;default:_0x4b3e0c=squel['insert']()['into'](_0x656a('0x65'))[_0x656a('0x66')]([_0x656a('0x67'),'scheduledAt',_0x656a('0x6d'),_0x656a('0x69'),_0x656a('0x5a'),_0x656a('0x4f'),_0x656a('0x50')],squel['select']()[_0x656a('0x6b')](_0x656a('0x67'),_0x656a('0x67'))['field'](_0x656a('0x6c'),_0x656a('0x68'))['field']('id','ContactId')[_0x656a('0x6b')](_0x1da17a[_0x656a('0x6e')][_0x656a('0x6f')](),_0x656a('0x69'))['field'](_0x514606[_0x656a('0x4e')]['id'][_0x656a('0x6f')](),_0x656a('0x5a'))['field']('NOW()',_0x656a('0x4f'))['field'](_0x656a('0x6c'),_0x656a('0x50'))[_0x656a('0x70')](_0x656a('0x71'))[_0x656a('0x37')]('deletedAt\x20IS\x20NULL')[_0x656a('0x37')](_0x656a('0x7a'),_0x1da17a[_0x656a('0x6e')]['toString']())[_0x656a('0x37')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x3fa07c[_0x656a('0x7b')](db['sequelize']['query'](_0x4b3e0c));}return BPromise[_0x656a('0x7c')](_0x3fa07c);}})['then'](function(){return _0x2c9d86;})[_0x656a('0x26')](respondWithResult(_0x54c3b1,null))[_0x656a('0x42')](handleError(_0x54c3b1,null));};exports[_0x656a('0x7d')]=function(_0x2ea63a,_0x883e2a,_0x492f9b){return db[_0x656a('0x2a')]['find']({'where':{'id':_0x2ea63a[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x883e2a,null))[_0x656a('0x26')](function(_0x3967c5){if(_0x3967c5){return _0x3967c5[_0x656a('0x7d')](_0x2ea63a[_0x656a('0x2e')][_0x656a('0x60')]);}})['then'](function(_0x2a59a6){if(_0x2a59a6){return db[_0x656a('0x54')][_0x656a('0x23')]({'where':{'ListId':_0x2ea63a['query'][_0x656a('0x60')],'CampaignId':_0x2ea63a[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](function(){return _0x2a59a6;});}})[_0x656a('0x26')](respondWithStatusCode(_0x883e2a,null))[_0x656a('0x42')](handleError(_0x883e2a,null));};exports[_0x656a('0x7e')]=function(_0x3c926f,_0x94689a,_0x5754b2){var _0x467d77={'raw':!![],'where':{}};var _0x3ddba0={};var _0x4bd5bc={'count':0x0,'rows':[]};return db[_0x656a('0x2a')][_0x656a('0x53')]({'where':{'id':_0x3c926f['params']['id']}})['then'](handleEntityNotFound(_0x94689a,null))[_0x656a('0x26')](function(_0x1a837d){if(_0x1a837d){_0x3ddba0['model']=_[_0x656a('0x2f')](db['CmList'][_0x656a('0x2b')]);_0x3ddba0[_0x656a('0x2e')]=_[_0x656a('0x2f')](_0x3c926f[_0x656a('0x2e')]);_0x3ddba0['filters']=_['intersection'](_0x3ddba0[_0x656a('0x31')],_0x3ddba0[_0x656a('0x2e')]);_0x467d77['attributes']=_[_0x656a('0x30')](_0x3ddba0[_0x656a('0x31')],qs[_0x656a('0x32')](_0x3c926f[_0x656a('0x2e')][_0x656a('0x32')]));_0x467d77[_0x656a('0x33')]=_0x467d77['attributes'][_0x656a('0x34')]?_0x467d77['attributes']:_0x3ddba0['model'];if(!_0x3c926f[_0x656a('0x2e')][_0x656a('0x55')](_0x656a('0x56'))){_0x467d77['limit']=qs[_0x656a('0x1c')](_0x3c926f[_0x656a('0x2e')][_0x656a('0x1c')]);_0x467d77[_0x656a('0x1b')]=qs[_0x656a('0x1b')](_0x3c926f[_0x656a('0x2e')][_0x656a('0x1b')]);}_0x467d77[_0x656a('0x35')]=qs[_0x656a('0x36')](_0x3c926f['query']['sort']);_0x467d77[_0x656a('0x37')]=qs[_0x656a('0x38')](_[_0x656a('0x39')](_0x3c926f['query'],_0x3ddba0['filters']));_0x467d77[_0x656a('0x37')][_0x656a('0x5a')]=_0x1a837d['id'];if(_0x3c926f[_0x656a('0x2e')][_0x656a('0x3a')]){_0x467d77[_0x656a('0x37')]=_[_0x656a('0x3b')](_0x467d77[_0x656a('0x37')],{'$or':_[_0x656a('0x29')](_0x467d77[_0x656a('0x33')],function(_0x32567f){var _0xfa54f0={};_0xfa54f0[_0x32567f]={'$like':'%'+_0x3c926f['query'][_0x656a('0x3a')]+'%'};return _0xfa54f0;})});}_0x467d77=_[_0x656a('0x3b')]({},_0x467d77,_0x3c926f[_0x656a('0x3d')]);return db['CmList'][_0x656a('0x1a')]({'where':_0x467d77[_0x656a('0x37')]})[_0x656a('0x26')](function(_0x140f75){_0x4bd5bc[_0x656a('0x1a')]=_0x140f75;if(_0x3c926f['query'][_0x656a('0x3e')]){_0x467d77['include']=[{'all':!![]}];}return db[_0x656a('0x5e')][_0x656a('0x40')](_0x467d77);})['then'](function(_0x1d10a6){_0x4bd5bc[_0x656a('0x41')]=_0x1d10a6;return _0x4bd5bc;});}})[_0x656a('0x26')](respondWithFilteredResult(_0x94689a,_0x467d77))[_0x656a('0x42')](handleError(_0x94689a,null));};exports[_0x656a('0x7f')]=function(_0x3c867b,_0x23cfa4,_0x324ef2){var _0xb802fe,_0x29dcda;return db[_0x656a('0x2a')][_0x656a('0x44')]({'where':{'id':_0x3c867b[_0x656a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x23cfa4,null))[_0x656a('0x26')](function(_0x534ce4){if(_0x534ce4){_0x29dcda=_0x534ce4;return _0x534ce4[_0x656a('0x7f')](_0x3c867b[_0x656a('0x46')][_0x656a('0x60')],_['omit'](_0x3c867b[_0x656a('0x46')],[_0x656a('0x60'),'id'])||{});}return null;})['spread'](function(_0x1ebb80){var _0xf2569e;_0xb802fe=_0x1ebb80||[];var _0x26ce9c=[];if(_0x1ebb80){for(var _0x4216e5=0x0;_0x4216e5<_0x1ebb80[_0x656a('0x34')];_0x4216e5+=0x1){var _0x30a60e=_0x1ebb80[_0x4216e5]['get']({'plain':!![]});_0xf2569e=squel[_0x656a('0x63')]()[_0x656a('0x64')](_0x656a('0x80'))[_0x656a('0x66')]([_0x656a('0x67'),'ContactId','ListId',_0x656a('0x5a'),_0x656a('0x4f'),_0x656a('0x50')],squel['select']()['field'](_0x656a('0x67'),'phone')[_0x656a('0x6b')]('id','ContactId')[_0x656a('0x6b')](_0x30a60e[_0x656a('0x6e')][_0x656a('0x6f')](),'ListId')[_0x656a('0x6b')](_0x3c867b[_0x656a('0x4e')]['id']['toString'](),_0x656a('0x5a'))[_0x656a('0x6b')](_0x656a('0x6c'),_0x656a('0x4f'))[_0x656a('0x6b')]('NOW()',_0x656a('0x50'))[_0x656a('0x70')](_0x656a('0x71'))[_0x656a('0x37')]('deletedAt\x20IS\x20NULL')[_0x656a('0x37')](_0x656a('0x7a'),_0x30a60e['CmListId'][_0x656a('0x6f')]())[_0x656a('0x37')](_0x656a('0x73')))[_0x656a('0x6f')]();_0x26ce9c[_0x656a('0x7b')](db[_0x656a('0x81')][_0x656a('0x2e')](_0xf2569e));}return BPromise[_0x656a('0x7c')](_0x26ce9c);}})[_0x656a('0x26')](function(){return _0xb802fe;})['then'](respondWithResult(_0x23cfa4,null))[_0x656a('0x42')](handleError(_0x23cfa4,null));};exports[_0x656a('0x82')]=function(_0x253c06,_0x42de4c,_0x1b99e2){return db['Campaign'][_0x656a('0x44')]({'where':{'id':_0x253c06[_0x656a('0x4e')]['id']}})[_0x656a('0x26')](handleEntityNotFound(_0x42de4c,null))[_0x656a('0x26')](function(_0xbcd8dc){if(_0xbcd8dc){return _0xbcd8dc[_0x656a('0x82')](_0x253c06[_0x656a('0x2e')][_0x656a('0x60')]);}})['then'](function(_0x2cf813){if(_0x2cf813){return db['CmHopperBlack'][_0x656a('0x23')]({'where':{'ListId':_0x253c06[_0x656a('0x2e')][_0x656a('0x60')],'CampaignId':_0x253c06[_0x656a('0x4e')]['id']}})['then'](function(){return _0x2cf813;});}})[_0x656a('0x26')](respondWithStatusCode(_0x42de4c,null))['catch'](handleError(_0x42de4c,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 17551fc..bf74eb3 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 _0xa9e0=['../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xfdc4f4,_0x34aaa3){var _0x55beae=function(_0xf33a8d){while(--_0xf33a8d){_0xfdc4f4['push'](_0xfdc4f4['shift']());}};_0x55beae(++_0x34aaa3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0x317497,_0x2d6cf7){var _0x3445b0=function(_0x22fe4d){while(--_0x22fe4d){_0x317497['push'](_0x317497['shift']());}};_0x3445b0(++_0x2d6cf7);}(_0xb10b,0x12a));var _0xbb10=function(_0x208b7a,_0x2e3baa){_0x208b7a=_0x208b7a-0x0;var _0x37b7ec=_0xb10b[_0x208b7a];return _0x37b7ec;};'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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 8f39a7d..bf65e22 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(_0x795571,_0x33581b){var _0x315ea9=function(_0x1f702e){while(--_0x1f702e){_0x795571['push'](_0x795571['shift']());}};_0x315ea9(++_0x33581b);}(_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 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x59c3af,_0x468c29){var _0x1330d9=function(_0x2abcc3){while(--_0x2abcc3){_0x59c3af['push'](_0x59c3af['shift']());}};_0x1330d9(++_0x468c29);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d072ab4..5826cc6 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 _0x05a8=['delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','/:id','get','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/blacklists','getBlackLists','create','post','clone','/:id/lists','put'];(function(_0x321e6f,_0x154d5d){var _0x15c9f5=function(_0xdd88f2){while(--_0xdd88f2){_0x321e6f['push'](_0x321e6f['shift']());}};_0x15c9f5(++_0x154d5d);}(_0x05a8,0x1d6));var _0x805a=function(_0x3ac030,_0x4ec63c){_0x3ac030=_0x3ac030-0x0;var _0x388fd0=_0x05a8[_0x3ac030];return _0x388fd0;};'use strict';var multer=require(_0x805a('0x0'));var util=require(_0x805a('0x1'));var path=require(_0x805a('0x2'));var timeout=require(_0x805a('0x3'));var express=require(_0x805a('0x4'));var router=express[_0x805a('0x5')]();var auth=require(_0x805a('0x6'));var interaction=require(_0x805a('0x7'));var config=require('../../config/environment');var controller=require(_0x805a('0x8'));router['get']('/',auth[_0x805a('0x9')](),controller[_0x805a('0xa')]);router['get'](_0x805a('0xb'),auth[_0x805a('0x9')](),controller['show']);router[_0x805a('0xc')](_0x805a('0xd'),auth[_0x805a('0x9')](),controller[_0x805a('0xe')]);router['get'](_0x805a('0xf'),auth[_0x805a('0x9')](),controller['getHopperHistories']);router[_0x805a('0xc')](_0x805a('0x10'),auth[_0x805a('0x9')](),controller['getHopperFinals']);router[_0x805a('0xc')](_0x805a('0x11'),auth[_0x805a('0x9')](),controller[_0x805a('0x12')]);router[_0x805a('0xc')]('/:id/lists',auth[_0x805a('0x9')](),controller['getLists']);router[_0x805a('0xc')](_0x805a('0x13'),auth['isAuthenticated'](),controller[_0x805a('0x14')]);router['post']('/',auth[_0x805a('0x9')](),controller[_0x805a('0x15')]);router[_0x805a('0x16')]('/:id/clone',auth[_0x805a('0x9')](),controller[_0x805a('0x17')]);router[_0x805a('0x16')](_0x805a('0x18'),auth[_0x805a('0x9')](),controller['addLists']);router['post']('/:id/blacklists',auth[_0x805a('0x9')](),controller['addBlackLists']);router[_0x805a('0x19')](_0x805a('0xb'),auth[_0x805a('0x9')](),controller['update']);router[_0x805a('0x1a')](_0x805a('0xb'),auth['isAuthenticated'](),controller[_0x805a('0x1b')]);router[_0x805a('0x1a')](_0x805a('0x18'),auth['isAuthenticated'](),controller[_0x805a('0x1c')]);router['delete']('/:id/blacklists',auth[_0x805a('0x9')](),controller[_0x805a('0x1d')]);module[_0x805a('0x1e')]=router; \ No newline at end of file +var _0xf6c9=['create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','removeLists','removeBlackLists','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xf6c9,0x10b));var _0x9f6c=function(_0x17cfa6,_0x19e94f){_0x17cfa6=_0x17cfa6-0x0;var _0x596517=_0xf6c9[_0x17cfa6];return _0x596517;};'use strict';var multer=require(_0x9f6c('0x0'));var util=require('util');var path=require(_0x9f6c('0x1'));var timeout=require(_0x9f6c('0x2'));var express=require('express');var router=express[_0x9f6c('0x3')]();var auth=require(_0x9f6c('0x4'));var interaction=require(_0x9f6c('0x5'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x9f6c('0x6')]('/',auth[_0x9f6c('0x7')](),controller[_0x9f6c('0x8')]);router[_0x9f6c('0x6')](_0x9f6c('0x9'),auth['isAuthenticated'](),controller[_0x9f6c('0xa')]);router[_0x9f6c('0x6')]('/:id/hoppers',auth[_0x9f6c('0x7')](),controller[_0x9f6c('0xb')]);router['get']('/:id/hopper_histories',auth[_0x9f6c('0x7')](),controller[_0x9f6c('0xc')]);router[_0x9f6c('0x6')](_0x9f6c('0xd'),auth[_0x9f6c('0x7')](),controller['getHopperFinals']);router[_0x9f6c('0x6')](_0x9f6c('0xe'),auth[_0x9f6c('0x7')](),controller[_0x9f6c('0xf')]);router[_0x9f6c('0x6')](_0x9f6c('0x10'),auth['isAuthenticated'](),controller[_0x9f6c('0x11')]);router[_0x9f6c('0x6')](_0x9f6c('0x12'),auth['isAuthenticated'](),controller[_0x9f6c('0x13')]);router[_0x9f6c('0x14')]('/',auth[_0x9f6c('0x7')](),controller[_0x9f6c('0x15')]);router[_0x9f6c('0x14')](_0x9f6c('0x16'),auth[_0x9f6c('0x7')](),controller[_0x9f6c('0x17')]);router[_0x9f6c('0x14')](_0x9f6c('0x10'),auth['isAuthenticated'](),controller[_0x9f6c('0x18')]);router[_0x9f6c('0x14')](_0x9f6c('0x12'),auth['isAuthenticated'](),controller[_0x9f6c('0x19')]);router[_0x9f6c('0x1a')](_0x9f6c('0x9'),auth[_0x9f6c('0x7')](),controller[_0x9f6c('0x1b')]);router[_0x9f6c('0x1c')](_0x9f6c('0x9'),auth[_0x9f6c('0x7')](),controller['destroy']);router[_0x9f6c('0x1c')]('/:id/lists',auth[_0x9f6c('0x7')](),controller[_0x9f6c('0x1d')]);router[_0x9f6c('0x1c')](_0x9f6c('0x12'),auth[_0x9f6c('0x7')](),controller[_0x9f6c('0x1e')]);module[_0x9f6c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 6db52f4..79dc2ba 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 _0x05a9=['VIRTUAL','getDataValue','key','sequelize','STRING'];(function(_0x2ed834,_0x259f12){var _0x538d2d=function(_0x396a12){while(--_0x396a12){_0x2ed834['push'](_0x2ed834['shift']());}};_0x538d2d(++_0x259f12);}(_0x05a9,0x9e));var _0x905a=function(_0xb1d46d,_0x210916){_0xb1d46d=_0xb1d46d-0x0;var _0x5174f5=_0x05a9[_0xb1d46d];return _0x5174f5;};'use strict';var Sequelize=require(_0x905a('0x0'));module['exports']={'key':{'type':Sequelize[_0x905a('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x905a('0x1')]},'name':{'type':Sequelize[_0x905a('0x2')],'get':function(){return this[_0x905a('0x3')](_0x905a('0x4'));}}}; \ No newline at end of file +var _0xebc9=['getDataValue','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xebc9,0x127));var _0x9ebc=function(_0x509867,_0x449160){_0x509867=_0x509867-0x0;var _0x51df03=_0xebc9[_0x509867];return _0x51df03;};'use strict';var Sequelize=require(_0x9ebc('0x0'));module[_0x9ebc('0x1')]={'key':{'type':Sequelize[_0x9ebc('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9ebc('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9ebc('0x2')]},'name':{'type':Sequelize[_0x9ebc('0x4')],'get':function(){return this[_0x9ebc('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 68cba0c..3b2b5eb 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 _0x620a=['CannedAnswer','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','offset','order','sort','where','filters','filter','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','mustache','util','path','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','limit','set','apply','reject','update','then','destroy','get','CannedAnswers','error','name','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x620a,0x82));var _0xa620=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x620a[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa620('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa620('0x1'));var moment=require(_0xa620('0x2'));var BPromise=require(_0xa620('0x3'));var Mustache=require(_0xa620('0x4'));var util=require(_0xa620('0x5'));var path=require(_0xa620('0x6'));var sox=require(_0xa620('0x7'));var csv=require(_0xa620('0x8'));var ejs=require(_0xa620('0x9'));var fs=require('fs');var _=require(_0xa620('0xa'));var squel=require(_0xa620('0xb'));var crypto=require(_0xa620('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa620('0xd'));var toCsv=require(_0xa620('0x8'));var querystring=require(_0xa620('0xe'));var Papa=require(_0xa620('0xf'));var Redis=require(_0xa620('0x10'));var authService=require(_0xa620('0x11'));var qs=require(_0xa620('0x12'));var as=require(_0xa620('0x13'));var hardwareService=require(_0xa620('0x14'));var logger=require(_0xa620('0x15'))(_0xa620('0x16'));var utils=require(_0xa620('0x17'));var config=require(_0xa620('0x18'));var db=require(_0xa620('0x19'))['db'];function respondWithStatusCode(_0x51b622,_0x4dc275){_0x4dc275=_0x4dc275||0xcc;return function(_0x4836f0){if(_0x4836f0){return _0x51b622[_0xa620('0x1a')](_0x4dc275);}return _0x51b622['status'](_0x4dc275)[_0xa620('0x1b')]();};}function respondWithResult(_0x38f77e,_0x5b7f3a){_0x5b7f3a=_0x5b7f3a||0xc8;return function(_0x4fc750){if(_0x4fc750){return _0x38f77e[_0xa620('0x1c')](_0x5b7f3a)[_0xa620('0x1d')](_0x4fc750);}};}function respondWithFilteredResult(_0x11c914,_0x26e776){return function(_0x423bfe){if(_0x423bfe){var _0x5b2eaf=_0x423bfe[_0xa620('0x1e')],_0x547e84=_0x26e776['offset'],_0x5392a8=_0x26e776['offset']+_0x26e776[_0xa620('0x1f')],_0x3d6a27;if(_0x5392a8>=_0x5b2eaf){_0x5392a8=_0x5b2eaf;_0x3d6a27=0xc8;}else{_0x3d6a27=0xce;}_0x11c914[_0xa620('0x1c')](_0x3d6a27);return _0x11c914[_0xa620('0x20')]('Content-Range',_0x547e84+'-'+_0x5392a8+'/'+_0x5b2eaf)[_0xa620('0x1d')](_0x423bfe);}return null;};}function patchUpdates(_0x108386){return function(_0x67f6c4){try{jsonpatch[_0xa620('0x21')](_0x67f6c4,_0x108386,!![]);}catch(_0x13ea0c){return BPromise[_0xa620('0x22')](_0x13ea0c);}return _0x67f6c4['save']();};}function saveUpdates(_0x3e333a,_0x1b2241){return function(_0x29c72d){if(_0x29c72d){return _0x29c72d[_0xa620('0x23')](_0x3e333a)[_0xa620('0x24')](function(_0x267f81){return _0x267f81;});}return null;};}function removeEntity(_0x207801,_0x5821d8){return function(_0x1232ae){if(_0x1232ae){return _0x1232ae[_0xa620('0x25')]()[_0xa620('0x24')](function(){var _0x4a54cf=_0x1232ae[_0xa620('0x26')]({'plain':!![]});var _0x5ec005=_0xa620('0x27');return db['UserProfileResource'][_0xa620('0x25')]({'where':{'type':_0x5ec005,'resourceId':_0x4a54cf['id']}})['then'](function(){return _0x1232ae;});})[_0xa620('0x24')](function(){_0x207801[_0xa620('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a061c,_0x197531){return function(_0x27e261){if(!_0x27e261){_0x4a061c[_0xa620('0x1a')](0x194);}return _0x27e261;};}function handleError(_0x4e0bb4,_0x42c8a2){_0x42c8a2=_0x42c8a2||0x1f4;return function(_0x2dea48){logger[_0xa620('0x28')](_0x2dea48['stack']);if(_0x2dea48['name']){delete _0x2dea48[_0xa620('0x29')];}_0x4e0bb4[_0xa620('0x1c')](_0x42c8a2)['send'](_0x2dea48);};}exports[_0xa620('0x2a')]=function(_0x3082f4,_0x340806){var _0x30c17d={},_0x422f44={},_0x37e04f={'count':0x0,'rows':[]};var _0x48cdbc=_[_0xa620('0x2b')](db[_0xa620('0x2c')][_0xa620('0x2d')],function(_0x2ffd31){return{'name':_0x2ffd31[_0xa620('0x2e')],'type':_0x2ffd31['type'][_0xa620('0x2f')]};});_0x422f44['model']=_[_0xa620('0x2b')](_0x48cdbc,_0xa620('0x29'));_0x422f44[_0xa620('0x30')]=_[_0xa620('0x31')](_0x3082f4[_0xa620('0x30')]);_0x422f44['filters']=_[_0xa620('0x32')](_0x422f44[_0xa620('0x33')],_0x422f44['query']);_0x30c17d[_0xa620('0x34')]=_[_0xa620('0x32')](_0x422f44['model'],qs['fields'](_0x3082f4[_0xa620('0x30')][_0xa620('0x35')]));_0x30c17d[_0xa620('0x34')]=_0x30c17d['attributes'][_0xa620('0x36')]?_0x30c17d[_0xa620('0x34')]:_0x422f44[_0xa620('0x33')];if(!_0x3082f4[_0xa620('0x30')][_0xa620('0x37')]('nolimit')){_0x30c17d['limit']=qs['limit'](_0x3082f4['query'][_0xa620('0x1f')]);_0x30c17d['offset']=qs[_0xa620('0x38')](_0x3082f4['query'][_0xa620('0x38')]);}_0x30c17d[_0xa620('0x39')]=qs[_0xa620('0x3a')](_0x3082f4[_0xa620('0x30')]['sort']);_0x30c17d[_0xa620('0x3b')]=qs['filters'](_['pick'](_0x3082f4[_0xa620('0x30')],_0x422f44[_0xa620('0x3c')]),_0x48cdbc);if(_0x3082f4[_0xa620('0x30')][_0xa620('0x3d')]){_0x30c17d[_0xa620('0x3b')]=_[_0xa620('0x3e')](_0x30c17d[_0xa620('0x3b')],{'$or':_[_0xa620('0x2b')](_0x48cdbc,function(_0xe599b5){if(_0xe599b5[_0xa620('0x3f')]!==_0xa620('0x40')){var _0x16af45={};_0x16af45[_0xe599b5[_0xa620('0x29')]]={'$like':'%'+_0x3082f4[_0xa620('0x30')]['filter']+'%'};return _0x16af45;}})});}_0x30c17d=_[_0xa620('0x3e')]({},_0x30c17d,_0x3082f4[_0xa620('0x41')]);var _0x39b438={'where':_0x30c17d[_0xa620('0x3b')]};return db['CannedAnswer'][_0xa620('0x1e')](_0x39b438)[_0xa620('0x24')](function(_0x26b062){_0x37e04f[_0xa620('0x1e')]=_0x26b062;if(_0x3082f4[_0xa620('0x30')]['includeAll']){_0x30c17d[_0xa620('0x42')]=[{'all':!![]}];}return db[_0xa620('0x2c')][_0xa620('0x43')](_0x30c17d);})[_0xa620('0x24')](function(_0x497aab){_0x37e04f['rows']=_0x497aab;return _0x37e04f;})[_0xa620('0x24')](respondWithFilteredResult(_0x340806,_0x30c17d))[_0xa620('0x44')](handleError(_0x340806,null));};exports[_0xa620('0x45')]=function(_0x41cb96,_0x727073){var _0x5b99a0={'raw':!![],'where':{'id':_0x41cb96[_0xa620('0x46')]['id']}},_0x2ffa67={};_0x2ffa67[_0xa620('0x33')]=_[_0xa620('0x31')](db[_0xa620('0x2c')][_0xa620('0x2d')]);_0x2ffa67[_0xa620('0x30')]=_[_0xa620('0x31')](_0x41cb96['query']);_0x2ffa67[_0xa620('0x3c')]=_[_0xa620('0x32')](_0x2ffa67[_0xa620('0x33')],_0x2ffa67[_0xa620('0x30')]);_0x5b99a0[_0xa620('0x34')]=_[_0xa620('0x32')](_0x2ffa67['model'],qs['fields'](_0x41cb96[_0xa620('0x30')]['fields']));_0x5b99a0[_0xa620('0x34')]=_0x5b99a0[_0xa620('0x34')]['length']?_0x5b99a0[_0xa620('0x34')]:_0x2ffa67[_0xa620('0x33')];if(_0x41cb96[_0xa620('0x30')][_0xa620('0x47')]){_0x5b99a0[_0xa620('0x42')]=[{'all':!![]}];}_0x5b99a0=_[_0xa620('0x3e')]({},_0x5b99a0,_0x41cb96[_0xa620('0x41')]);return db['CannedAnswer'][_0xa620('0x48')](_0x5b99a0)['then'](handleEntityNotFound(_0x727073,null))['then'](respondWithResult(_0x727073,null))[_0xa620('0x44')](handleError(_0x727073,null));};exports['update']=function(_0x369054,_0x3b8cc0){if(_0x369054[_0xa620('0x49')]['id']){delete _0x369054[_0xa620('0x49')]['id'];}return db[_0xa620('0x2c')][_0xa620('0x48')]({'where':{'id':_0x369054[_0xa620('0x46')]['id']}})[_0xa620('0x24')](handleEntityNotFound(_0x3b8cc0,null))[_0xa620('0x24')](saveUpdates(_0x369054[_0xa620('0x49')],null))[_0xa620('0x24')](respondWithResult(_0x3b8cc0,null))['catch'](handleError(_0x3b8cc0,null));};exports['destroy']=function(_0x5248b2,_0x5aa92d){return db[_0xa620('0x2c')][_0xa620('0x48')]({'where':{'id':_0x5248b2['params']['id']}})[_0xa620('0x24')](handleEntityNotFound(_0x5aa92d,null))[_0xa620('0x24')](removeEntity(_0x5aa92d,null))[_0xa620('0x44')](handleError(_0x5aa92d,null));};exports[_0xa620('0x4a')]=function(_0x110eee,_0x3c4a64){var _0x29e169={'key':_0x110eee['body']['key']};if(_0x110eee[_0xa620('0x49')][_0xa620('0x4b')]){_0x29e169[_0xa620('0x4b')]=_0x110eee[_0xa620('0x49')][_0xa620('0x4b')];}else if(_0x110eee['body'][_0xa620('0x4c')]){_0x29e169[_0xa620('0x4c')]=_0x110eee[_0xa620('0x49')][_0xa620('0x4c')];}else if(_0x110eee[_0xa620('0x49')]['OpenchannelAccountId']){_0x29e169[_0xa620('0x4d')]=_0x110eee[_0xa620('0x49')][_0xa620('0x4d')];}else if(_0x110eee[_0xa620('0x49')]['ChatWebsiteId']){_0x29e169[_0xa620('0x4e')]=_0x110eee['body'][_0xa620('0x4e')];}return db[_0xa620('0x2c')][_0xa620('0x48')]({'where':_0x29e169})['then'](function(_0x11519a){if(_0x11519a){throw new db['Sequelize'][(_0xa620('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db['CannedAnswer'][_0xa620('0x4a')](_0x110eee[_0xa620('0x49')]);})['then'](function(_0x20772f){var _0x3bab22=_0x110eee[_0xa620('0x50')]['get']({'plain':!![]});if(!_0x3bab22)throw new Error(_0xa620('0x51'));if(_0x3bab22[_0xa620('0x52')]===_0xa620('0x50')){var _0x5bccbe=_0x20772f[_0xa620('0x26')]({'plain':!![]});return db[_0xa620('0x53')][_0xa620('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x3bab22[_0xa620('0x54')]},'raw':!![]})[_0xa620('0x24')](function(_0x1eebd1){if(_0x1eebd1&&_0x1eebd1['autoAssociation']===0x0){return db[_0xa620('0x55')][_0xa620('0x4a')]({'name':_0x5bccbe['name'],'resourceId':_0x5bccbe['id'],'type':_0x1eebd1['name'],'sectionId':_0x1eebd1['id']},{})[_0xa620('0x24')](function(){return _0x20772f;});}else{return _0x20772f;}})[_0xa620('0x44')](function(_0x375c30){logger['error'](_0xa620('0x56'),_0x375c30);throw _0x375c30;});}return _0x20772f;})[_0xa620('0x24')](respondWithResult(_0x3c4a64,0xc9))[_0xa620('0x44')](handleError(_0x3c4a64,null));}; \ No newline at end of file +var _0xf42b=['find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','error','stack','name','index','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include'];(function(_0x15ab46,_0x1b2ab7){var _0x524284=function(_0x384989){while(--_0x384989){_0x15ab46['push'](_0x15ab46['shift']());}};_0x524284(++_0x1b2ab7);}(_0xf42b,0x1b2));var _0xbf42=function(_0x4ba23e,_0x17d90e){_0x4ba23e=_0x4ba23e-0x0;var _0x7e1b98=_0xf42b[_0x4ba23e];return _0x7e1b98;};'use strict';var pdf=require(_0xbf42('0x0'));var emlformat=require(_0xbf42('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf42('0x2'));var BPromise=require(_0xbf42('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbf42('0x4'));var sox=require(_0xbf42('0x5'));var csv=require(_0xbf42('0x6'));var ejs=require(_0xbf42('0x7'));var fs=require('fs');var _=require(_0xbf42('0x8'));var squel=require(_0xbf42('0x9'));var crypto=require(_0xbf42('0xa'));var jsforce=require(_0xbf42('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xbf42('0x6'));var querystring=require('querystring');var Papa=require(_0xbf42('0xc'));var Redis=require(_0xbf42('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbf42('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbf42('0xf'));var logger=require(_0xbf42('0x10'))(_0xbf42('0x11'));var utils=require(_0xbf42('0x12'));var config=require(_0xbf42('0x13'));var db=require(_0xbf42('0x14'))['db'];function respondWithStatusCode(_0x3cbd32,_0x1f3cb7){_0x1f3cb7=_0x1f3cb7||0xcc;return function(_0x1c4258){if(_0x1c4258){return _0x3cbd32[_0xbf42('0x15')](_0x1f3cb7);}return _0x3cbd32[_0xbf42('0x16')](_0x1f3cb7)[_0xbf42('0x17')]();};}function respondWithResult(_0x4983c8,_0x54beac){_0x54beac=_0x54beac||0xc8;return function(_0x5ee7c0){if(_0x5ee7c0){return _0x4983c8[_0xbf42('0x16')](_0x54beac)[_0xbf42('0x18')](_0x5ee7c0);}};}function respondWithFilteredResult(_0xb06239,_0x81261e){return function(_0x414436){if(_0x414436){var _0x1220a2=_0x414436[_0xbf42('0x19')],_0x48a347=_0x81261e[_0xbf42('0x1a')],_0x5d0440=_0x81261e[_0xbf42('0x1a')]+_0x81261e[_0xbf42('0x1b')],_0x6add59;if(_0x5d0440>=_0x1220a2){_0x5d0440=_0x1220a2;_0x6add59=0xc8;}else{_0x6add59=0xce;}_0xb06239[_0xbf42('0x16')](_0x6add59);return _0xb06239[_0xbf42('0x1c')](_0xbf42('0x1d'),_0x48a347+'-'+_0x5d0440+'/'+_0x1220a2)[_0xbf42('0x18')](_0x414436);}return null;};}function patchUpdates(_0x466e40){return function(_0x52977a){try{jsonpatch[_0xbf42('0x1e')](_0x52977a,_0x466e40,!![]);}catch(_0x50745f){return BPromise[_0xbf42('0x1f')](_0x50745f);}return _0x52977a[_0xbf42('0x20')]();};}function saveUpdates(_0x261bc0,_0x468aef){return function(_0xebef30){if(_0xebef30){return _0xebef30[_0xbf42('0x21')](_0x261bc0)[_0xbf42('0x22')](function(_0x5d7828){return _0x5d7828;});}return null;};}function removeEntity(_0xe4ca04,_0x55a688){return function(_0x4a82f7){if(_0x4a82f7){return _0x4a82f7[_0xbf42('0x23')]()[_0xbf42('0x22')](function(){var _0x1ea3c4=_0x4a82f7[_0xbf42('0x24')]({'plain':!![]});var _0x3299cc=_0xbf42('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x3299cc,'resourceId':_0x1ea3c4['id']}})['then'](function(){return _0x4a82f7;});})[_0xbf42('0x22')](function(){_0xe4ca04[_0xbf42('0x16')](0xcc)[_0xbf42('0x17')]();});}};}function handleEntityNotFound(_0x3820dc,_0x80f411){return function(_0x114bb7){if(!_0x114bb7){_0x3820dc[_0xbf42('0x15')](0x194);}return _0x114bb7;};}function handleError(_0x2b52e8,_0x51d819){_0x51d819=_0x51d819||0x1f4;return function(_0x4bbb0c){logger[_0xbf42('0x26')](_0x4bbb0c[_0xbf42('0x27')]);if(_0x4bbb0c[_0xbf42('0x28')]){delete _0x4bbb0c[_0xbf42('0x28')];}_0x2b52e8['status'](_0x51d819)['send'](_0x4bbb0c);};}exports[_0xbf42('0x29')]=function(_0x5523d0,_0x3fe817){var _0x53339c={},_0x557d42={},_0x102c84={'count':0x0,'rows':[]};var _0x26a8f0=_[_0xbf42('0x2a')](db[_0xbf42('0x2b')][_0xbf42('0x2c')],function(_0x5e565c){return{'name':_0x5e565c[_0xbf42('0x2d')],'type':_0x5e565c[_0xbf42('0x2e')][_0xbf42('0x2f')]};});_0x557d42[_0xbf42('0x30')]=_[_0xbf42('0x2a')](_0x26a8f0,'name');_0x557d42['query']=_[_0xbf42('0x31')](_0x5523d0[_0xbf42('0x32')]);_0x557d42[_0xbf42('0x33')]=_[_0xbf42('0x34')](_0x557d42[_0xbf42('0x30')],_0x557d42[_0xbf42('0x32')]);_0x53339c[_0xbf42('0x35')]=_[_0xbf42('0x34')](_0x557d42[_0xbf42('0x30')],qs[_0xbf42('0x36')](_0x5523d0['query'][_0xbf42('0x36')]));_0x53339c[_0xbf42('0x35')]=_0x53339c['attributes'][_0xbf42('0x37')]?_0x53339c['attributes']:_0x557d42[_0xbf42('0x30')];if(!_0x5523d0['query'][_0xbf42('0x38')](_0xbf42('0x39'))){_0x53339c['limit']=qs[_0xbf42('0x1b')](_0x5523d0[_0xbf42('0x32')][_0xbf42('0x1b')]);_0x53339c[_0xbf42('0x1a')]=qs['offset'](_0x5523d0[_0xbf42('0x32')]['offset']);}_0x53339c[_0xbf42('0x3a')]=qs[_0xbf42('0x3b')](_0x5523d0['query']['sort']);_0x53339c[_0xbf42('0x3c')]=qs[_0xbf42('0x33')](_['pick'](_0x5523d0['query'],_0x557d42[_0xbf42('0x33')]),_0x26a8f0);if(_0x5523d0[_0xbf42('0x32')][_0xbf42('0x3d')]){_0x53339c[_0xbf42('0x3c')]=_[_0xbf42('0x3e')](_0x53339c['where'],{'$or':_['map'](_0x26a8f0,function(_0x192c95){if(_0x192c95['type']!==_0xbf42('0x3f')){var _0x231b74={};_0x231b74[_0x192c95['name']]={'$like':'%'+_0x5523d0[_0xbf42('0x32')][_0xbf42('0x3d')]+'%'};return _0x231b74;}})});}_0x53339c=_[_0xbf42('0x3e')]({},_0x53339c,_0x5523d0['options']);var _0xb64d70={'where':_0x53339c[_0xbf42('0x3c')]};return db[_0xbf42('0x2b')][_0xbf42('0x19')](_0xb64d70)['then'](function(_0x4d873b){_0x102c84[_0xbf42('0x19')]=_0x4d873b;if(_0x5523d0['query'][_0xbf42('0x40')]){_0x53339c['include']=[{'all':!![]}];}return db[_0xbf42('0x2b')][_0xbf42('0x41')](_0x53339c);})['then'](function(_0x3fb76f){_0x102c84['rows']=_0x3fb76f;return _0x102c84;})['then'](respondWithFilteredResult(_0x3fe817,_0x53339c))[_0xbf42('0x42')](handleError(_0x3fe817,null));};exports[_0xbf42('0x43')]=function(_0x39aafc,_0xcfa45f){var _0x40d14b={'raw':!![],'where':{'id':_0x39aafc[_0xbf42('0x44')]['id']}},_0x24b4af={};_0x24b4af[_0xbf42('0x30')]=_[_0xbf42('0x31')](db[_0xbf42('0x2b')][_0xbf42('0x2c')]);_0x24b4af['query']=_[_0xbf42('0x31')](_0x39aafc[_0xbf42('0x32')]);_0x24b4af[_0xbf42('0x33')]=_[_0xbf42('0x34')](_0x24b4af[_0xbf42('0x30')],_0x24b4af['query']);_0x40d14b['attributes']=_[_0xbf42('0x34')](_0x24b4af[_0xbf42('0x30')],qs[_0xbf42('0x36')](_0x39aafc[_0xbf42('0x32')]['fields']));_0x40d14b['attributes']=_0x40d14b[_0xbf42('0x35')][_0xbf42('0x37')]?_0x40d14b[_0xbf42('0x35')]:_0x24b4af['model'];if(_0x39aafc[_0xbf42('0x32')][_0xbf42('0x40')]){_0x40d14b[_0xbf42('0x45')]=[{'all':!![]}];}_0x40d14b=_[_0xbf42('0x3e')]({},_0x40d14b,_0x39aafc['options']);return db['CannedAnswer'][_0xbf42('0x46')](_0x40d14b)[_0xbf42('0x22')](handleEntityNotFound(_0xcfa45f,null))['then'](respondWithResult(_0xcfa45f,null))[_0xbf42('0x42')](handleError(_0xcfa45f,null));};exports[_0xbf42('0x21')]=function(_0x45bac2,_0x10c31e){if(_0x45bac2['body']['id']){delete _0x45bac2[_0xbf42('0x47')]['id'];}return db['CannedAnswer'][_0xbf42('0x46')]({'where':{'id':_0x45bac2[_0xbf42('0x44')]['id']}})['then'](handleEntityNotFound(_0x10c31e,null))[_0xbf42('0x22')](saveUpdates(_0x45bac2[_0xbf42('0x47')],null))[_0xbf42('0x22')](respondWithResult(_0x10c31e,null))[_0xbf42('0x42')](handleError(_0x10c31e,null));};exports[_0xbf42('0x23')]=function(_0x163a08,_0x459df0){return db[_0xbf42('0x2b')][_0xbf42('0x46')]({'where':{'id':_0x163a08[_0xbf42('0x44')]['id']}})[_0xbf42('0x22')](handleEntityNotFound(_0x459df0,null))[_0xbf42('0x22')](removeEntity(_0x459df0,null))[_0xbf42('0x42')](handleError(_0x459df0,null));};exports[_0xbf42('0x48')]=function(_0x5dd22c,_0x380189){var _0x2ee539={'key':_0x5dd22c[_0xbf42('0x47')][_0xbf42('0x2f')]};if(_0x5dd22c['body'][_0xbf42('0x49')]){_0x2ee539['MailAccountId']=_0x5dd22c[_0xbf42('0x47')][_0xbf42('0x49')];}else if(_0x5dd22c['body'][_0xbf42('0x4a')]){_0x2ee539['SmsAccountId']=_0x5dd22c[_0xbf42('0x47')][_0xbf42('0x4a')];}else if(_0x5dd22c['body']['OpenchannelAccountId']){_0x2ee539[_0xbf42('0x4b')]=_0x5dd22c[_0xbf42('0x47')][_0xbf42('0x4b')];}else if(_0x5dd22c['body']['ChatWebsiteId']){_0x2ee539[_0xbf42('0x4c')]=_0x5dd22c[_0xbf42('0x47')][_0xbf42('0x4c')];}return db[_0xbf42('0x2b')]['find']({'where':_0x2ee539})[_0xbf42('0x22')](function(_0x40daab){if(_0x40daab){throw new db['Sequelize'][(_0xbf42('0x4d'))](_0xbf42('0x4e'));}return db[_0xbf42('0x2b')][_0xbf42('0x48')](_0x5dd22c[_0xbf42('0x47')]);})['then'](function(_0x1c56d2){var _0x49acfc=_0x5dd22c[_0xbf42('0x4f')][_0xbf42('0x24')]({'plain':!![]});if(!_0x49acfc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49acfc['role']===_0xbf42('0x4f')){var _0x5b5af0=_0x1c56d2['get']({'plain':!![]});return db[_0xbf42('0x50')]['find']({'where':{'name':_0xbf42('0x25'),'userProfileId':_0x49acfc[_0xbf42('0x51')]},'raw':!![]})[_0xbf42('0x22')](function(_0x53ecda){if(_0x53ecda&&_0x53ecda[_0xbf42('0x52')]===0x0){return db['UserProfileResource'][_0xbf42('0x48')]({'name':_0x5b5af0[_0xbf42('0x28')],'resourceId':_0x5b5af0['id'],'type':_0x53ecda['name'],'sectionId':_0x53ecda['id']},{})[_0xbf42('0x22')](function(){return _0x1c56d2;});}else{return _0x1c56d2;}})[_0xbf42('0x42')](function(_0x5c63b9){logger['error'](_0xbf42('0x53'),_0x5c63b9);throw _0x5c63b9;});}return _0x1c56d2;})['then'](respondWithResult(_0x380189,0xc9))['catch'](handleError(_0x380189,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 9065d51..71d751b 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 _0x3c94=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x258c72,_0x3a1005){var _0x19d501=function(_0x5165e2){while(--_0x5165e2){_0x258c72['push'](_0x258c72['shift']());}};_0x19d501(++_0x3a1005);}(_0x3c94,0xcd));var _0x43c9=function(_0x16ecad,_0x205047){_0x16ecad=_0x16ecad-0x0;var _0x313ff7=_0x3c94[_0x16ecad];return _0x313ff7;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43c9('0xf'),'collate':_0x43c9('0x10')});}; \ No newline at end of file +var _0x10dc=['define','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x10dc,0x107));var _0xc10d=function(_0x19aee6,_0xcb2918){_0x19aee6=_0x19aee6-0x0;var _0x511975=_0x10dc[_0x19aee6];return _0x511975;};'use strict';var _=require(_0xc10d('0x0'));var util=require(_0xc10d('0x1'));var logger=require('../../config/logger')(_0xc10d('0x2'));var moment=require('moment');var BPromise=require(_0xc10d('0x3'));var rp=require(_0xc10d('0x4'));var fs=require('fs');var path=require(_0xc10d('0x5'));var rimraf=require(_0xc10d('0x6'));var config=require(_0xc10d('0x7'));var attributes=require(_0xc10d('0x8'));module[_0xc10d('0x9')]=function(_0x25e10c,_0x48baac){return _0x25e10c[_0xc10d('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc10d('0xb'),'collate':_0xc10d('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 4482b13..0306dcb 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 _0xa87b=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xa87b,0x91));var _0xba87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa87b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba87('0x0'));var util=require(_0xba87('0x1'));var moment=require(_0xba87('0x2'));var BPromise=require(_0xba87('0x3'));var rs=require(_0xba87('0x4'));var fs=require('fs');var Redis=require(_0xba87('0x5'));var db=require(_0xba87('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xba87('0x7'))('rpc');var config=require(_0xba87('0x8'));var jayson=require(_0xba87('0x9'));var client=jayson[_0xba87('0xa')][_0xba87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9c67f2,_0x4abf92,_0x23b0f4){return new BPromise(function(_0x2868ca,_0xb27e85){return client[_0xba87('0xc')](_0x9c67f2,_0x23b0f4)[_0xba87('0xd')](function(_0x258f06){logger[_0xba87('0xe')]('CannedAnswer,\x20%s,\x20%s',_0x4abf92,_0xba87('0xf'));logger[_0xba87('0x10')](_0xba87('0x11'),_0x4abf92,_0xba87('0xf'),JSON[_0xba87('0x12')](_0x258f06));if(_0x258f06['error']){if(_0x258f06[_0xba87('0x13')][_0xba87('0x14')]===0x1f4){logger[_0xba87('0x13')](_0xba87('0x15'),_0x4abf92,_0x258f06[_0xba87('0x13')]['message']);return _0xb27e85(_0x258f06[_0xba87('0x13')][_0xba87('0x16')]);}logger[_0xba87('0x13')](_0xba87('0x15'),_0x4abf92,_0x258f06['error'][_0xba87('0x16')]);return _0x2868ca(_0x258f06[_0xba87('0x13')][_0xba87('0x16')]);}else{logger[_0xba87('0xe')](_0xba87('0x15'),_0x4abf92,_0xba87('0xf'));_0x2868ca(_0x258f06[_0xba87('0x17')][_0xba87('0x16')]);}})[_0xba87('0x18')](function(_0x161e33){logger['error'](_0xba87('0x15'),_0x4abf92,_0x161e33);_0xb27e85(_0x161e33);});});} \ No newline at end of file +var _0xde01=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x443ae8,_0x4a0f60){var _0x2fb3d1=function(_0x3aa37f){while(--_0x3aa37f){_0x443ae8['push'](_0x443ae8['shift']());}};_0x2fb3d1(++_0x4a0f60);}(_0xde01,0x1dd));var _0x1de0=function(_0xf20093,_0x325add){_0xf20093=_0xf20093-0x0;var _0x25bd83=_0xde01[_0xf20093];return _0x25bd83;};'use strict';var _=require('lodash');var util=require(_0x1de0('0x0'));var moment=require(_0x1de0('0x1'));var BPromise=require(_0x1de0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1de0('0x3'));var db=require(_0x1de0('0x4'))['db'];var utils=require(_0x1de0('0x5'));var logger=require(_0x1de0('0x6'))(_0x1de0('0x7'));var config=require(_0x1de0('0x8'));var jayson=require(_0x1de0('0x9'));var client=jayson[_0x1de0('0xa')][_0x1de0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5715a6,_0x4f568f,_0x24773d){return new BPromise(function(_0x32f97c,_0x44058e){return client['request'](_0x5715a6,_0x24773d)[_0x1de0('0xc')](function(_0x300319){logger[_0x1de0('0xd')](_0x1de0('0xe'),_0x4f568f,'request\x20sent');logger[_0x1de0('0xf')](_0x1de0('0x10'),_0x4f568f,_0x1de0('0x11'),JSON[_0x1de0('0x12')](_0x300319));if(_0x300319['error']){if(_0x300319[_0x1de0('0x13')][_0x1de0('0x14')]===0x1f4){logger['error'](_0x1de0('0xe'),_0x4f568f,_0x300319[_0x1de0('0x13')][_0x1de0('0x15')]);return _0x44058e(_0x300319['error']['message']);}logger['error'](_0x1de0('0xe'),_0x4f568f,_0x300319['error'][_0x1de0('0x15')]);return _0x32f97c(_0x300319['error'][_0x1de0('0x15')]);}else{logger[_0x1de0('0xd')](_0x1de0('0xe'),_0x4f568f,_0x1de0('0x11'));_0x32f97c(_0x300319[_0x1de0('0x16')][_0x1de0('0x15')]);}})['catch'](function(_0x472c51){logger[_0x1de0('0x13')](_0x1de0('0xe'),_0x4f568f,_0x472c51);_0x44058e(_0x472c51);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 357137e..9bd926d 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 _0xe8ce=['put','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1653b1,_0x35b7d1){var _0x3e0b17=function(_0x5f21fc){while(--_0x5f21fc){_0x1653b1['push'](_0x1653b1['shift']());}};_0x3e0b17(++_0x35b7d1);}(_0xe8ce,0xdc));var _0xee8c=function(_0x97d9cd,_0x23de5c){_0x97d9cd=_0x97d9cd-0x0;var _0xa5f7e2=_0xe8ce[_0x97d9cd];return _0xa5f7e2;};'use strict';var multer=require(_0xee8c('0x0'));var util=require(_0xee8c('0x1'));var path=require(_0xee8c('0x2'));var timeout=require('connect-timeout');var express=require(_0xee8c('0x3'));var router=express['Router']();var auth=require(_0xee8c('0x4'));var interaction=require(_0xee8c('0x5'));var config=require(_0xee8c('0x6'));var controller=require(_0xee8c('0x7'));router[_0xee8c('0x8')]('/',auth[_0xee8c('0x9')](),controller[_0xee8c('0xa')]);router[_0xee8c('0x8')](_0xee8c('0xb'),auth[_0xee8c('0x9')](),controller[_0xee8c('0xc')]);router[_0xee8c('0xd')]('/',auth[_0xee8c('0x9')](),controller['create']);router[_0xee8c('0xe')](_0xee8c('0xb'),auth[_0xee8c('0x9')](),controller['update']);router[_0xee8c('0xf')](_0xee8c('0xb'),auth[_0xee8c('0x9')](),controller[_0xee8c('0x10')]);module[_0xee8c('0x11')]=router; \ No newline at end of file +var _0x7698=['index','/:id','show','post','create','destroy','multer','util','path','connect-timeout','../../components/interaction/service','get','isAuthenticated'];(function(_0x4fbea3,_0x468a80){var _0x1ea3a4=function(_0x5d0935){while(--_0x5d0935){_0x4fbea3['push'](_0x4fbea3['shift']());}};_0x1ea3a4(++_0x468a80);}(_0x7698,0x7b));var _0x8769=function(_0x471254,_0x231bea){_0x471254=_0x471254-0x0;var _0x239ba4=_0x7698[_0x471254];return _0x239ba4;};'use strict';var multer=require(_0x8769('0x0'));var util=require(_0x8769('0x1'));var path=require(_0x8769('0x2'));var timeout=require(_0x8769('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8769('0x4'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0x8769('0x5')]('/',auth[_0x8769('0x6')](),controller[_0x8769('0x7')]);router[_0x8769('0x5')](_0x8769('0x8'),auth[_0x8769('0x6')](),controller[_0x8769('0x9')]);router[_0x8769('0xa')]('/',auth[_0x8769('0x6')](),controller[_0x8769('0xb')]);router['put'](_0x8769('0x8'),auth[_0x8769('0x6')](),controller['update']);router['delete']('/:id',auth[_0x8769('0x6')](),controller[_0x8769('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 81cfcb8..27159ad 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 _0x61d0=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x61d0,0x121));var _0x061d=function(_0x23ca3a,_0xe44c43){_0x23ca3a=_0x23ca3a-0x0;var _0x5c1aab=_0x61d0[_0x23ca3a];return _0x5c1aab;};'use strict';var Sequelize=require(_0x061d('0x0'));module[_0x061d('0x1')]={'calldate':{'type':Sequelize[_0x061d('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x061d('0x3')]},'dst':{'type':Sequelize[_0x061d('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x061d('0x3')]},'dstchannel':{'type':Sequelize[_0x061d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x061d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x061d('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x061d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x061d('0x3')]},'userfield':{'type':Sequelize[_0x061d('0x3')]},'uniqueid':{'type':Sequelize[_0x061d('0x3')]},'linkedid':{'type':Sequelize[_0x061d('0x3')]},'sequence':{'type':Sequelize[_0x061d('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x061d('0x3')]}}; \ No newline at end of file +var _0xa550=['STRING','INTEGER','sequelize','DATE','1970-01-01\x2000:00:01'];(function(_0x3b7b42,_0x31badd){var _0x1ebaad=function(_0x3655d9){while(--_0x3655d9){_0x3b7b42['push'](_0x3b7b42['shift']());}};_0x1ebaad(++_0x31badd);}(_0xa550,0x8e));var _0x0a55=function(_0x5013f2,_0x3d896b){_0x5013f2=_0x5013f2-0x0;var _0x166b9f=_0xa550[_0x5013f2];return _0x166b9f;};'use strict';var Sequelize=require(_0x0a55('0x0'));module['exports']={'calldate':{'type':Sequelize[_0x0a55('0x1')],'allowNull':![],'defaultValue':_0x0a55('0x2')},'clid':{'type':Sequelize[_0x0a55('0x3')]},'src':{'type':Sequelize[_0x0a55('0x3')]},'dst':{'type':Sequelize[_0x0a55('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0a55('0x3')]},'dstchannel':{'type':Sequelize[_0x0a55('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0a55('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0a55('0x3')]},'amaflags':{'type':Sequelize[_0x0a55('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0a55('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0a55('0x3')]},'linkedid':{'type':Sequelize[_0x0a55('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0a55('0x3')]},'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 24abdc0..628b4ce 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 _0xc4cf=['hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','count','findAll','rows','catch','show','params','keys','includeAll','include','options','find','create','body','describe','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc4cf,0xab));var _0xfc4c=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xc4cf[_0x2adbeb];return _0x5e18a6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc4c('0x0'));var rp=require('request-promise');var moment=require(_0xfc4c('0x1'));var BPromise=require(_0xfc4c('0x2'));var Mustache=require('mustache');var util=require(_0xfc4c('0x3'));var path=require(_0xfc4c('0x4'));var sox=require(_0xfc4c('0x5'));var csv=require(_0xfc4c('0x6'));var ejs=require(_0xfc4c('0x7'));var fs=require('fs');var _=require(_0xfc4c('0x8'));var squel=require('squel');var crypto=require(_0xfc4c('0x9'));var jsforce=require(_0xfc4c('0xa'));var deskjs=require(_0xfc4c('0xb'));var toCsv=require(_0xfc4c('0x6'));var querystring=require(_0xfc4c('0xc'));var Papa=require('papaparse');var Redis=require(_0xfc4c('0xd'));var authService=require(_0xfc4c('0xe'));var qs=require(_0xfc4c('0xf'));var as=require(_0xfc4c('0x10'));var hardwareService=require(_0xfc4c('0x11'));var logger=require(_0xfc4c('0x12'))(_0xfc4c('0x13'));var utils=require(_0xfc4c('0x14'));var config=require(_0xfc4c('0x15'));var db=require(_0xfc4c('0x16'))['db'];function respondWithStatusCode(_0x490e27,_0x54d176){_0x54d176=_0x54d176||0xcc;return function(_0x599f9a){if(_0x599f9a){return _0x490e27[_0xfc4c('0x17')](_0x54d176);}return _0x490e27[_0xfc4c('0x18')](_0x54d176)[_0xfc4c('0x19')]();};}function respondWithResult(_0x307fd2,_0x383ef4){_0x383ef4=_0x383ef4||0xc8;return function(_0x1621da){if(_0x1621da){return _0x307fd2[_0xfc4c('0x18')](_0x383ef4)['json'](_0x1621da);}};}function respondWithFilteredResult(_0x3cf2c1,_0x46d496){return function(_0x4daa86){if(_0x4daa86){var _0x4bc9d6=_0x4daa86['count'],_0x14f6b2=_0x46d496[_0xfc4c('0x1a')],_0x271755=_0x46d496[_0xfc4c('0x1a')]+_0x46d496['limit'],_0x4dfe3d;if(_0x271755>=_0x4bc9d6){_0x271755=_0x4bc9d6;_0x4dfe3d=0xc8;}else{_0x4dfe3d=0xce;}_0x3cf2c1['status'](_0x4dfe3d);return _0x3cf2c1['set'](_0xfc4c('0x1b'),_0x14f6b2+'-'+_0x271755+'/'+_0x4bc9d6)[_0xfc4c('0x1c')](_0x4daa86);}return null;};}function patchUpdates(_0xf57a0b){return function(_0x5a65e8){try{jsonpatch[_0xfc4c('0x1d')](_0x5a65e8,_0xf57a0b,!![]);}catch(_0x3ade0d){return BPromise[_0xfc4c('0x1e')](_0x3ade0d);}return _0x5a65e8[_0xfc4c('0x1f')]();};}function saveUpdates(_0x38faea,_0x5bd9fc){return function(_0x926574){if(_0x926574){return _0x926574[_0xfc4c('0x20')](_0x38faea)[_0xfc4c('0x21')](function(_0x23089b){return _0x23089b;});}return null;};}function removeEntity(_0x547d53,_0x596392){return function(_0x370322){if(_0x370322){return _0x370322[_0xfc4c('0x22')]()[_0xfc4c('0x21')](function(){_0x547d53[_0xfc4c('0x18')](0xcc)[_0xfc4c('0x19')]();});}};}function handleEntityNotFound(_0x2f9ddc,_0x4a7eaa){return function(_0x23ad94){if(!_0x23ad94){_0x2f9ddc[_0xfc4c('0x17')](0x194);}return _0x23ad94;};}function handleError(_0x1e704e,_0x460d83){_0x460d83=_0x460d83||0x1f4;return function(_0x2ba3c1){logger['error'](_0x2ba3c1['stack']);if(_0x2ba3c1[_0xfc4c('0x23')]){delete _0x2ba3c1[_0xfc4c('0x23')];}_0x1e704e[_0xfc4c('0x18')](_0x460d83)[_0xfc4c('0x24')](_0x2ba3c1);};}exports[_0xfc4c('0x25')]=function(_0x2d202f,_0x181a8e){var _0x2ecd4b={},_0x5b9e20={},_0x28079f={'count':0x0,'rows':[]};var _0x4fd830=_[_0xfc4c('0x26')](db[_0xfc4c('0x27')][_0xfc4c('0x28')],function(_0x2a1222){return{'name':_0x2a1222[_0xfc4c('0x29')],'type':_0x2a1222[_0xfc4c('0x2a')][_0xfc4c('0x2b')]};});_0x5b9e20[_0xfc4c('0x2c')]=_['map'](_0x4fd830,'name');_0x5b9e20[_0xfc4c('0x2d')]=_['keys'](_0x2d202f[_0xfc4c('0x2d')]);_0x5b9e20[_0xfc4c('0x2e')]=_[_0xfc4c('0x2f')](_0x5b9e20[_0xfc4c('0x2c')],_0x5b9e20[_0xfc4c('0x2d')]);_0x2ecd4b['attributes']=_[_0xfc4c('0x2f')](_0x5b9e20[_0xfc4c('0x2c')],qs[_0xfc4c('0x30')](_0x2d202f[_0xfc4c('0x2d')]['fields']));_0x2ecd4b[_0xfc4c('0x31')]=_0x2ecd4b[_0xfc4c('0x31')][_0xfc4c('0x32')]?_0x2ecd4b[_0xfc4c('0x31')]:_0x5b9e20[_0xfc4c('0x2c')];if(!_0x2d202f[_0xfc4c('0x2d')][_0xfc4c('0x33')](_0xfc4c('0x34'))){_0x2ecd4b[_0xfc4c('0x35')]=qs[_0xfc4c('0x35')](_0x2d202f[_0xfc4c('0x2d')][_0xfc4c('0x35')]);_0x2ecd4b[_0xfc4c('0x1a')]=qs[_0xfc4c('0x1a')](_0x2d202f[_0xfc4c('0x2d')][_0xfc4c('0x1a')]);}_0x2ecd4b[_0xfc4c('0x36')]=qs[_0xfc4c('0x37')](_0x2d202f[_0xfc4c('0x2d')][_0xfc4c('0x37')]);_0x2ecd4b[_0xfc4c('0x38')]=qs['filters'](_['pick'](_0x2d202f[_0xfc4c('0x2d')],_0x5b9e20[_0xfc4c('0x2e')]),_0x4fd830);if(_0x2d202f[_0xfc4c('0x2d')]['filter']){_0x2ecd4b[_0xfc4c('0x38')]=_[_0xfc4c('0x39')](_0x2ecd4b[_0xfc4c('0x38')],{'$or':_[_0xfc4c('0x26')](_0x4fd830,function(_0x19d316){if(_0x19d316['type']!==_0xfc4c('0x3a')){var _0x2ce8e1={};_0x2ce8e1[_0x19d316[_0xfc4c('0x23')]]={'$like':'%'+_0x2d202f[_0xfc4c('0x2d')][_0xfc4c('0x3b')]+'%'};return _0x2ce8e1;}})});}_0x2ecd4b=_[_0xfc4c('0x39')]({},_0x2ecd4b,_0x2d202f['options']);var _0x1dd684={'where':_0x2ecd4b[_0xfc4c('0x38')]};return db[_0xfc4c('0x27')][_0xfc4c('0x3c')](_0x1dd684)[_0xfc4c('0x21')](function(_0xb355bf){_0x28079f[_0xfc4c('0x3c')]=_0xb355bf;if(_0x2d202f[_0xfc4c('0x2d')]['includeAll']){_0x2ecd4b['include']=[{'all':!![]}];}return db[_0xfc4c('0x27')][_0xfc4c('0x3d')](_0x2ecd4b);})[_0xfc4c('0x21')](function(_0x138afd){_0x28079f[_0xfc4c('0x3e')]=_0x138afd;return _0x28079f;})[_0xfc4c('0x21')](respondWithFilteredResult(_0x181a8e,_0x2ecd4b))[_0xfc4c('0x3f')](handleError(_0x181a8e,null));};exports[_0xfc4c('0x40')]=function(_0x5866cb,_0x4dd314){var _0xa6f799={'raw':!![],'where':{'id':_0x5866cb[_0xfc4c('0x41')]['id']}},_0x11b883={};_0x11b883[_0xfc4c('0x2c')]=_[_0xfc4c('0x42')](db[_0xfc4c('0x27')][_0xfc4c('0x28')]);_0x11b883[_0xfc4c('0x2d')]=_['keys'](_0x5866cb[_0xfc4c('0x2d')]);_0x11b883['filters']=_['intersection'](_0x11b883[_0xfc4c('0x2c')],_0x11b883[_0xfc4c('0x2d')]);_0xa6f799[_0xfc4c('0x31')]=_[_0xfc4c('0x2f')](_0x11b883[_0xfc4c('0x2c')],qs['fields'](_0x5866cb[_0xfc4c('0x2d')][_0xfc4c('0x30')]));_0xa6f799[_0xfc4c('0x31')]=_0xa6f799['attributes'][_0xfc4c('0x32')]?_0xa6f799['attributes']:_0x11b883['model'];if(_0x5866cb['query'][_0xfc4c('0x43')]){_0xa6f799[_0xfc4c('0x44')]=[{'all':!![]}];}_0xa6f799=_[_0xfc4c('0x39')]({},_0xa6f799,_0x5866cb[_0xfc4c('0x45')]);return db[_0xfc4c('0x27')][_0xfc4c('0x46')](_0xa6f799)[_0xfc4c('0x21')](handleEntityNotFound(_0x4dd314,null))['then'](respondWithResult(_0x4dd314,null))[_0xfc4c('0x3f')](handleError(_0x4dd314,null));};exports['create']=function(_0xc7df7e,_0x290fa1){return db[_0xfc4c('0x27')][_0xfc4c('0x47')](_0xc7df7e[_0xfc4c('0x48')],{})['then'](respondWithResult(_0x290fa1,0xc9))[_0xfc4c('0x3f')](handleError(_0x290fa1,null));};exports[_0xfc4c('0x20')]=function(_0x39398a,_0x4e0ec1){if(_0x39398a[_0xfc4c('0x48')]['id']){delete _0x39398a['body']['id'];}return db[_0xfc4c('0x27')][_0xfc4c('0x46')]({'where':{'id':_0x39398a[_0xfc4c('0x41')]['id']}})[_0xfc4c('0x21')](handleEntityNotFound(_0x4e0ec1,null))[_0xfc4c('0x21')](saveUpdates(_0x39398a['body'],null))[_0xfc4c('0x21')](respondWithResult(_0x4e0ec1,null))[_0xfc4c('0x3f')](handleError(_0x4e0ec1,null));};exports[_0xfc4c('0x22')]=function(_0x5c5225,_0x41258c){return db[_0xfc4c('0x27')]['find']({'where':{'id':_0x5c5225[_0xfc4c('0x41')]['id']}})[_0xfc4c('0x21')](handleEntityNotFound(_0x41258c,null))[_0xfc4c('0x21')](removeEntity(_0x41258c,null))['catch'](handleError(_0x41258c,null));};exports[_0xfc4c('0x49')]=function(_0x473ad4,_0x515d96){return db[_0xfc4c('0x27')][_0xfc4c('0x49')]()[_0xfc4c('0x21')](respondWithResult(_0x515d96,null))[_0xfc4c('0x3f')](handleError(_0x515d96,null));}; \ No newline at end of file +var _0x7783=['pick','type','filter','options','count','includeAll','include','findAll','rows','catch','params','intersection','length','merge','create','body','find','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','key','query','keys','filters','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x31bada,_0x346e41){var _0x548bf0=function(_0x3ddcb3){while(--_0x3ddcb3){_0x31bada['push'](_0x31bada['shift']());}};_0x548bf0(++_0x346e41);}(_0x7783,0xa2));var _0x3778=function(_0x2c0019,_0x319d93){_0x2c0019=_0x2c0019-0x0;var _0x1c7ee3=_0x7783[_0x2c0019];return _0x1c7ee3;};'use strict';var pdf=require(_0x3778('0x0'));var emlformat=require(_0x3778('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3778('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3778('0x3'));var moment=require(_0x3778('0x4'));var BPromise=require(_0x3778('0x5'));var Mustache=require('mustache');var util=require(_0x3778('0x6'));var path=require(_0x3778('0x7'));var sox=require(_0x3778('0x8'));var csv=require('to-csv');var ejs=require(_0x3778('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3778('0xa'));var crypto=require('crypto');var jsforce=require(_0x3778('0xb'));var deskjs=require(_0x3778('0xc'));var toCsv=require(_0x3778('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3778('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3778('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3778('0x10'));var logger=require(_0x3778('0x11'))('api');var utils=require(_0x3778('0x12'));var config=require(_0x3778('0x13'));var db=require(_0x3778('0x14'))['db'];function respondWithStatusCode(_0x284969,_0x1fca3f){_0x1fca3f=_0x1fca3f||0xcc;return function(_0x135478){if(_0x135478){return _0x284969[_0x3778('0x15')](_0x1fca3f);}return _0x284969[_0x3778('0x16')](_0x1fca3f)[_0x3778('0x17')]();};}function respondWithResult(_0x2059df,_0x27ad2c){_0x27ad2c=_0x27ad2c||0xc8;return function(_0x41c320){if(_0x41c320){return _0x2059df[_0x3778('0x16')](_0x27ad2c)[_0x3778('0x18')](_0x41c320);}};}function respondWithFilteredResult(_0x6b29fe,_0x23dc14){return function(_0x47954c){if(_0x47954c){var _0x44f072=_0x47954c['count'],_0xf1f1e4=_0x23dc14[_0x3778('0x19')],_0x52e1b0=_0x23dc14[_0x3778('0x19')]+_0x23dc14[_0x3778('0x1a')],_0x131360;if(_0x52e1b0>=_0x44f072){_0x52e1b0=_0x44f072;_0x131360=0xc8;}else{_0x131360=0xce;}_0x6b29fe[_0x3778('0x16')](_0x131360);return _0x6b29fe['set']('Content-Range',_0xf1f1e4+'-'+_0x52e1b0+'/'+_0x44f072)[_0x3778('0x18')](_0x47954c);}return null;};}function patchUpdates(_0x34c634){return function(_0x5e15){try{jsonpatch[_0x3778('0x1b')](_0x5e15,_0x34c634,!![]);}catch(_0x49ede0){return BPromise[_0x3778('0x1c')](_0x49ede0);}return _0x5e15[_0x3778('0x1d')]();};}function saveUpdates(_0x877e94,_0x10d919){return function(_0xcb9da7){if(_0xcb9da7){return _0xcb9da7[_0x3778('0x1e')](_0x877e94)[_0x3778('0x1f')](function(_0x755e54){return _0x755e54;});}return null;};}function removeEntity(_0xf86c55,_0x104056){return function(_0x59c046){if(_0x59c046){return _0x59c046[_0x3778('0x20')]()[_0x3778('0x1f')](function(){_0xf86c55[_0x3778('0x16')](0xcc)[_0x3778('0x17')]();});}};}function handleEntityNotFound(_0x911b13,_0x485c70){return function(_0x31afee){if(!_0x31afee){_0x911b13[_0x3778('0x15')](0x194);}return _0x31afee;};}function handleError(_0x7ab630,_0x174bee){_0x174bee=_0x174bee||0x1f4;return function(_0x5a228a){logger[_0x3778('0x21')](_0x5a228a[_0x3778('0x22')]);if(_0x5a228a[_0x3778('0x23')]){delete _0x5a228a['name'];}_0x7ab630[_0x3778('0x16')](_0x174bee)[_0x3778('0x24')](_0x5a228a);};}exports[_0x3778('0x25')]=function(_0x2dea7f,_0x4aba35){var _0x4cd865={},_0x30323a={},_0x2be275={'count':0x0,'rows':[]};var _0x5db42a=_[_0x3778('0x26')](db[_0x3778('0x27')][_0x3778('0x28')],function(_0x555203){return{'name':_0x555203[_0x3778('0x29')],'type':_0x555203['type'][_0x3778('0x2a')]};});_0x30323a['model']=_[_0x3778('0x26')](_0x5db42a,_0x3778('0x23'));_0x30323a[_0x3778('0x2b')]=_[_0x3778('0x2c')](_0x2dea7f[_0x3778('0x2b')]);_0x30323a[_0x3778('0x2d')]=_['intersection'](_0x30323a['model'],_0x30323a['query']);_0x4cd865[_0x3778('0x2e')]=_['intersection'](_0x30323a[_0x3778('0x2f')],qs['fields'](_0x2dea7f[_0x3778('0x2b')][_0x3778('0x30')]));_0x4cd865[_0x3778('0x2e')]=_0x4cd865[_0x3778('0x2e')]['length']?_0x4cd865[_0x3778('0x2e')]:_0x30323a[_0x3778('0x2f')];if(!_0x2dea7f[_0x3778('0x2b')][_0x3778('0x31')](_0x3778('0x32'))){_0x4cd865[_0x3778('0x1a')]=qs[_0x3778('0x1a')](_0x2dea7f[_0x3778('0x2b')][_0x3778('0x1a')]);_0x4cd865[_0x3778('0x19')]=qs[_0x3778('0x19')](_0x2dea7f['query']['offset']);}_0x4cd865[_0x3778('0x33')]=qs['sort'](_0x2dea7f[_0x3778('0x2b')][_0x3778('0x34')]);_0x4cd865[_0x3778('0x35')]=qs['filters'](_[_0x3778('0x36')](_0x2dea7f[_0x3778('0x2b')],_0x30323a['filters']),_0x5db42a);if(_0x2dea7f[_0x3778('0x2b')]['filter']){_0x4cd865['where']=_['merge'](_0x4cd865[_0x3778('0x35')],{'$or':_['map'](_0x5db42a,function(_0x25027b){if(_0x25027b[_0x3778('0x37')]!=='VIRTUAL'){var _0x4f7091={};_0x4f7091[_0x25027b[_0x3778('0x23')]]={'$like':'%'+_0x2dea7f[_0x3778('0x2b')][_0x3778('0x38')]+'%'};return _0x4f7091;}})});}_0x4cd865=_['merge']({},_0x4cd865,_0x2dea7f[_0x3778('0x39')]);var _0x230e45={'where':_0x4cd865[_0x3778('0x35')]};return db[_0x3778('0x27')][_0x3778('0x3a')](_0x230e45)[_0x3778('0x1f')](function(_0xba0f12){_0x2be275[_0x3778('0x3a')]=_0xba0f12;if(_0x2dea7f[_0x3778('0x2b')][_0x3778('0x3b')]){_0x4cd865[_0x3778('0x3c')]=[{'all':!![]}];}return db[_0x3778('0x27')][_0x3778('0x3d')](_0x4cd865);})['then'](function(_0x1cbf5e){_0x2be275[_0x3778('0x3e')]=_0x1cbf5e;return _0x2be275;})[_0x3778('0x1f')](respondWithFilteredResult(_0x4aba35,_0x4cd865))[_0x3778('0x3f')](handleError(_0x4aba35,null));};exports['show']=function(_0x3bad69,_0x4a27e7){var _0x3a4731={'raw':!![],'where':{'id':_0x3bad69[_0x3778('0x40')]['id']}},_0x3f0bb9={};_0x3f0bb9[_0x3778('0x2f')]=_[_0x3778('0x2c')](db[_0x3778('0x27')]['rawAttributes']);_0x3f0bb9[_0x3778('0x2b')]=_[_0x3778('0x2c')](_0x3bad69[_0x3778('0x2b')]);_0x3f0bb9['filters']=_[_0x3778('0x41')](_0x3f0bb9[_0x3778('0x2f')],_0x3f0bb9['query']);_0x3a4731[_0x3778('0x2e')]=_[_0x3778('0x41')](_0x3f0bb9[_0x3778('0x2f')],qs[_0x3778('0x30')](_0x3bad69['query'][_0x3778('0x30')]));_0x3a4731[_0x3778('0x2e')]=_0x3a4731[_0x3778('0x2e')][_0x3778('0x42')]?_0x3a4731['attributes']:_0x3f0bb9[_0x3778('0x2f')];if(_0x3bad69[_0x3778('0x2b')]['includeAll']){_0x3a4731[_0x3778('0x3c')]=[{'all':!![]}];}_0x3a4731=_[_0x3778('0x43')]({},_0x3a4731,_0x3bad69[_0x3778('0x39')]);return db['Cdr']['find'](_0x3a4731)['then'](handleEntityNotFound(_0x4a27e7,null))['then'](respondWithResult(_0x4a27e7,null))[_0x3778('0x3f')](handleError(_0x4a27e7,null));};exports[_0x3778('0x44')]=function(_0x2b60bf,_0x4fb206){return db[_0x3778('0x27')]['create'](_0x2b60bf[_0x3778('0x45')],{})[_0x3778('0x1f')](respondWithResult(_0x4fb206,0xc9))[_0x3778('0x3f')](handleError(_0x4fb206,null));};exports[_0x3778('0x1e')]=function(_0xa3d55,_0xf9825d){if(_0xa3d55[_0x3778('0x45')]['id']){delete _0xa3d55[_0x3778('0x45')]['id'];}return db[_0x3778('0x27')][_0x3778('0x46')]({'where':{'id':_0xa3d55[_0x3778('0x40')]['id']}})[_0x3778('0x1f')](handleEntityNotFound(_0xf9825d,null))[_0x3778('0x1f')](saveUpdates(_0xa3d55[_0x3778('0x45')],null))['then'](respondWithResult(_0xf9825d,null))[_0x3778('0x3f')](handleError(_0xf9825d,null));};exports['destroy']=function(_0x568b68,_0x1b5818){return db['Cdr'][_0x3778('0x46')]({'where':{'id':_0x568b68[_0x3778('0x40')]['id']}})['then'](handleEntityNotFound(_0x1b5818,null))[_0x3778('0x1f')](removeEntity(_0x1b5818,null))['catch'](handleError(_0x1b5818,null));};exports[_0x3778('0x47')]=function(_0x2f15ab,_0x5070a5){return db[_0x3778('0x27')][_0x3778('0x47')]()[_0x3778('0x1f')](respondWithResult(_0x5070a5,null))['catch'](handleError(_0x5070a5,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 2356223..797c1f1 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 _0xd57a=['dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cdr.attributes','exports','cdr','accountcode','calldate','disposition'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd57a,0x179));var _0xad57=function(_0x5a9aa9,_0x30c824){_0x5a9aa9=_0x5a9aa9-0x0;var _0x2f17bf=_0xd57a[_0x5a9aa9];return _0x2f17bf;};'use strict';var _=require('lodash');var util=require(_0xad57('0x0'));var logger=require(_0xad57('0x1'))(_0xad57('0x2'));var moment=require(_0xad57('0x3'));var BPromise=require(_0xad57('0x4'));var rp=require(_0xad57('0x5'));var fs=require('fs');var path=require(_0xad57('0x6'));var rimraf=require('rimraf');var config=require(_0xad57('0x7'));var attributes=require(_0xad57('0x8'));module[_0xad57('0x9')]=function(_0x25a992,_0x587fc0){return _0x25a992['define']('Cdr',attributes,{'tableName':_0xad57('0xa'),'paranoid':![],'indexes':[{'name':_0xad57('0xb'),'fields':[_0xad57('0xb')]},{'name':'calldate','fields':[_0xad57('0xc')]},{'name':'disposition','fields':[_0xad57('0xd')]},{'name':_0xad57('0xe'),'fields':[_0xad57('0xe')]},{'name':'src','fields':[_0xad57('0xf')]},{'name':'uniqueid','fields':[_0xad57('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x48a4=['Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','api','path','../../config/environment','./cdr.attributes','define'];(function(_0x4cb408,_0x2054c9){var _0x28fc52=function(_0x5a2d57){while(--_0x5a2d57){_0x4cb408['push'](_0x4cb408['shift']());}};_0x28fc52(++_0x2054c9);}(_0x48a4,0x86));var _0x448a=function(_0x4bd012,_0x22323d){_0x4bd012=_0x4bd012-0x0;var _0x4813ac=_0x48a4[_0x4bd012];return _0x4813ac;};'use strict';var _=require(_0x448a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x448a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x448a('0x2'));var rimraf=require('rimraf');var config=require(_0x448a('0x3'));var attributes=require(_0x448a('0x4'));module['exports']=function(_0x3d32bb,_0x2251a8){return _0x3d32bb[_0x448a('0x5')](_0x448a('0x6'),attributes,{'tableName':_0x448a('0x7'),'paranoid':![],'indexes':[{'name':_0x448a('0x8'),'fields':['accountcode']},{'name':_0x448a('0x9'),'fields':[_0x448a('0x9')]},{'name':_0x448a('0xa'),'fields':['disposition']},{'name':_0x448a('0xb'),'fields':['dst']},{'name':_0x448a('0xc'),'fields':[_0x448a('0xc')]},{'name':_0x448a('0xd'),'fields':[_0x448a('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 647308b..7015511 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 _0x156b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis'];(function(_0x118014,_0x4aa892){var _0x51432c=function(_0x5a1a35){while(--_0x5a1a35){_0x118014['push'](_0x118014['shift']());}};_0x51432c(++_0x4aa892);}(_0x156b,0x114));var _0xb156=function(_0x337eeb,_0x4f17e9){_0x337eeb=_0x337eeb-0x0;var _0x2dfdd8=_0x156b[_0x337eeb];return _0x2dfdd8;};'use strict';var _=require(_0xb156('0x0'));var util=require(_0xb156('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb156('0x2'));var fs=require('fs');var Redis=require(_0xb156('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb156('0x4'));var logger=require(_0xb156('0x5'))(_0xb156('0x6'));var config=require(_0xb156('0x7'));var jayson=require(_0xb156('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23a983,_0x4d0daa,_0x24a256){return new BPromise(function(_0x1337f8,_0x5456db){return client['request'](_0x23a983,_0x24a256)[_0xb156('0x9')](function(_0x7555b8){logger[_0xb156('0xa')](_0xb156('0xb'),_0x4d0daa,_0xb156('0xc'));logger[_0xb156('0xd')](_0xb156('0xe'),_0x4d0daa,'request\x20sent',JSON[_0xb156('0xf')](_0x7555b8));if(_0x7555b8[_0xb156('0x10')]){if(_0x7555b8[_0xb156('0x10')][_0xb156('0x11')]===0x1f4){logger['error'](_0xb156('0xb'),_0x4d0daa,_0x7555b8[_0xb156('0x10')]['message']);return _0x5456db(_0x7555b8[_0xb156('0x10')][_0xb156('0x12')]);}logger[_0xb156('0x10')](_0xb156('0xb'),_0x4d0daa,_0x7555b8[_0xb156('0x10')]['message']);return _0x1337f8(_0x7555b8['error'][_0xb156('0x12')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x4d0daa,_0xb156('0xc'));_0x1337f8(_0x7555b8['result'][_0xb156('0x12')]);}})[_0xb156('0x13')](function(_0x341340){logger[_0xb156('0x10')]('Cdr,\x20%s,\x20%s',_0x4d0daa,_0x341340);_0x5456db(_0x341340);});});} \ No newline at end of file +var _0xf430=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis'];(function(_0x5d860a,_0xe2505b){var _0x2bd13a=function(_0x471d8c){while(--_0x471d8c){_0x5d860a['push'](_0x5d860a['shift']());}};_0x2bd13a(++_0xe2505b);}(_0xf430,0x1f4));var _0x0f43=function(_0x5528c3,_0x35a416){_0x5528c3=_0x5528c3-0x0;var _0x47ec1b=_0xf430[_0x5528c3];return _0x47ec1b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0f43('0x0'));var BPromise=require(_0x0f43('0x1'));var rs=require(_0x0f43('0x2'));var fs=require('fs');var Redis=require(_0x0f43('0x3'));var db=require(_0x0f43('0x4'))['db'];var utils=require(_0x0f43('0x5'));var logger=require(_0x0f43('0x6'))(_0x0f43('0x7'));var config=require(_0x0f43('0x8'));var jayson=require(_0x0f43('0x9'));var client=jayson[_0x0f43('0xa')][_0x0f43('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9a0a,_0x48fd76,_0x260758){return new BPromise(function(_0x49ed4a,_0x1023be){return client[_0x0f43('0xc')](_0x3f9a0a,_0x260758)[_0x0f43('0xd')](function(_0x490f4b){logger['info'](_0x0f43('0xe'),_0x48fd76,_0x0f43('0xf'));logger[_0x0f43('0x10')](_0x0f43('0x11'),_0x48fd76,_0x0f43('0xf'),JSON[_0x0f43('0x12')](_0x490f4b));if(_0x490f4b[_0x0f43('0x13')]){if(_0x490f4b[_0x0f43('0x13')][_0x0f43('0x14')]===0x1f4){logger[_0x0f43('0x13')](_0x0f43('0xe'),_0x48fd76,_0x490f4b[_0x0f43('0x13')][_0x0f43('0x15')]);return _0x1023be(_0x490f4b[_0x0f43('0x13')][_0x0f43('0x15')]);}logger['error'](_0x0f43('0xe'),_0x48fd76,_0x490f4b[_0x0f43('0x13')][_0x0f43('0x15')]);return _0x49ed4a(_0x490f4b[_0x0f43('0x13')][_0x0f43('0x15')]);}else{logger[_0x0f43('0x16')](_0x0f43('0xe'),_0x48fd76,'request\x20sent');_0x49ed4a(_0x490f4b['result']['message']);}})[_0x0f43('0x17')](function(_0x49e440){logger[_0x0f43('0x13')](_0x0f43('0xe'),_0x48fd76,_0x49e440);_0x1023be(_0x49e440);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index edd5980..ee7fea3 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 _0xe909=['post','update','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show'];(function(_0x525d78,_0x14175d){var _0x4c203d=function(_0x45d4f4){while(--_0x45d4f4){_0x525d78['push'](_0x525d78['shift']());}};_0x4c203d(++_0x14175d);}(_0xe909,0x120));var _0x9e90=function(_0x29bda0,_0x304d2c){_0x29bda0=_0x29bda0-0x0;var _0x23eee0=_0xe909[_0x29bda0];return _0x23eee0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9e90('0x0'));var timeout=require(_0x9e90('0x1'));var express=require('express');var router=express[_0x9e90('0x2')]();var auth=require(_0x9e90('0x3'));var interaction=require(_0x9e90('0x4'));var config=require(_0x9e90('0x5'));var controller=require('./cdr.controller');router[_0x9e90('0x6')]('/',auth[_0x9e90('0x7')](),controller[_0x9e90('0x8')]);router[_0x9e90('0x6')]('/describe',auth[_0x9e90('0x7')](),controller[_0x9e90('0x9')]);router[_0x9e90('0x6')](_0x9e90('0xa'),auth[_0x9e90('0x7')](),controller[_0x9e90('0xb')]);router[_0x9e90('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9e90('0xa'),auth[_0x9e90('0x7')](),controller[_0x9e90('0xd')]);router['delete'](_0x9e90('0xa'),auth['isAuthenticated'](),controller[_0x9e90('0xe')]);module['exports']=router; \ No newline at end of file +var _0xde89=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','/:id'];(function(_0x1367ff,_0x25e6fe){var _0xc253e0=function(_0x1a2859){while(--_0x1a2859){_0x1367ff['push'](_0x1367ff['shift']());}};_0xc253e0(++_0x25e6fe);}(_0xde89,0x1ec));var _0x9de8=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xde89[_0x237546];return _0x233e29;};'use strict';var multer=require(_0x9de8('0x0'));var util=require(_0x9de8('0x1'));var path=require(_0x9de8('0x2'));var timeout=require(_0x9de8('0x3'));var express=require(_0x9de8('0x4'));var router=express['Router']();var auth=require(_0x9de8('0x5'));var interaction=require(_0x9de8('0x6'));var config=require('../../config/environment');var controller=require('./cdr.controller');router['get']('/',auth[_0x9de8('0x7')](),controller['index']);router[_0x9de8('0x8')](_0x9de8('0x9'),auth[_0x9de8('0x7')](),controller[_0x9de8('0xa')]);router[_0x9de8('0x8')](_0x9de8('0xb'),auth[_0x9de8('0x7')](),controller[_0x9de8('0xc')]);router[_0x9de8('0xd')]('/',auth[_0x9de8('0x7')](),controller[_0x9de8('0xe')]);router['put'](_0x9de8('0xb'),auth[_0x9de8('0x7')](),controller[_0x9de8('0xf')]);router[_0x9de8('0x10')]('/:id',auth[_0x9de8('0x7')](),controller['destroy']);module[_0x9de8('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 94a9559..43eb232 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 _0xb8f1=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xb8f1,0x1d1));var _0x1b8f=function(_0x5bd76a,_0x4ed51a){_0x5bd76a=_0x5bd76a-0x0;var _0x242f7a=_0xb8f1[_0x5bd76a];return _0x242f7a;};'use strict';var Sequelize=require(_0x1b8f('0x0'));module[_0x1b8f('0x1')]={'priority':{'type':Sequelize[_0x1b8f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1b8f('0x3')],'allowNull':![],'defaultValue':_0x1b8f('0x4')},'appdata':{'type':Sequelize[_0x1b8f('0x5')]()},'description':{'type':Sequelize[_0x1b8f('0x3')]},'interval':{'type':Sequelize[_0x1b8f('0x3')],'defaultValue':_0x1b8f('0x6')}}; \ No newline at end of file +var _0xfe3f=['TEXT','*,*,*,*','exports','STRING','noop'];(function(_0x570683,_0x1a5200){var _0x1fc920=function(_0x70de15){while(--_0x70de15){_0x570683['push'](_0x570683['shift']());}};_0x1fc920(++_0x1a5200);}(_0xfe3f,0x1ec));var _0xffe3=function(_0x31b111,_0x14ee59){_0x31b111=_0x31b111-0x0;var _0x6deed4=_0xfe3f[_0x31b111];return _0x6deed4;};'use strict';var Sequelize=require('sequelize');module[_0xffe3('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xffe3('0x1')],'allowNull':![],'defaultValue':_0xffe3('0x2')},'appdata':{'type':Sequelize[_0xffe3('0x3')]()},'description':{'type':Sequelize[_0xffe3('0x1')]},'interval':{'type':Sequelize[_0xffe3('0x1')],'defaultValue':_0xffe3('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index eff565e..239b318 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 _0x5a41=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','end','error','name','send','show','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','model','fields','includeAll','merge','options','catch','body','params','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path'];(function(_0x3fa0b7,_0x381ac7){var _0x113f27=function(_0x2dde4d){while(--_0x2dde4d){_0x3fa0b7['push'](_0x3fa0b7['shift']());}};_0x113f27(++_0x381ac7);}(_0x5a41,0x13c));var _0x15a4=function(_0x4dccf2,_0x5cfcd7){_0x4dccf2=_0x4dccf2-0x0;var _0x12640e=_0x5a41[_0x4dccf2];return _0x12640e;};'use strict';var pdf=require(_0x15a4('0x0'));var emlformat=require(_0x15a4('0x1'));var rimraf=require(_0x15a4('0x2'));var zipdir=require(_0x15a4('0x3'));var jsonpatch=require(_0x15a4('0x4'));var rp=require(_0x15a4('0x5'));var moment=require(_0x15a4('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x15a4('0x7'));var sox=require(_0x15a4('0x8'));var csv=require(_0x15a4('0x9'));var ejs=require(_0x15a4('0xa'));var fs=require('fs');var _=require(_0x15a4('0xb'));var squel=require(_0x15a4('0xc'));var crypto=require(_0x15a4('0xd'));var jsforce=require(_0x15a4('0xe'));var deskjs=require(_0x15a4('0xf'));var toCsv=require('to-csv');var querystring=require(_0x15a4('0x10'));var Papa=require('papaparse');var Redis=require(_0x15a4('0x11'));var authService=require(_0x15a4('0x12'));var qs=require(_0x15a4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x15a4('0x14'))('api');var utils=require(_0x15a4('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4045a2,_0x542ad2){_0x542ad2=_0x542ad2||0xcc;return function(_0x18871f){if(_0x18871f){return _0x4045a2[_0x15a4('0x16')](_0x542ad2);}return _0x4045a2[_0x15a4('0x17')](_0x542ad2)['end']();};}function respondWithResult(_0x4ee9e3,_0x11830b){_0x11830b=_0x11830b||0xc8;return function(_0xcee68f){if(_0xcee68f){return _0x4ee9e3[_0x15a4('0x17')](_0x11830b)[_0x15a4('0x18')](_0xcee68f);}};}function respondWithFilteredResult(_0x75d9e3,_0x1d5682){return function(_0x324c8c){if(_0x324c8c){var _0x38e9c4=_0x324c8c[_0x15a4('0x19')],_0x23cb0c=_0x1d5682[_0x15a4('0x1a')],_0x28ef47=_0x1d5682[_0x15a4('0x1a')]+_0x1d5682[_0x15a4('0x1b')],_0x4e5c06;if(_0x28ef47>=_0x38e9c4){_0x28ef47=_0x38e9c4;_0x4e5c06=0xc8;}else{_0x4e5c06=0xce;}_0x75d9e3[_0x15a4('0x17')](_0x4e5c06);return _0x75d9e3['set'](_0x15a4('0x1c'),_0x23cb0c+'-'+_0x28ef47+'/'+_0x38e9c4)[_0x15a4('0x18')](_0x324c8c);}return null;};}function patchUpdates(_0x21451e){return function(_0x2ea279){try{jsonpatch[_0x15a4('0x1d')](_0x2ea279,_0x21451e,!![]);}catch(_0x1f46aa){return BPromise['reject'](_0x1f46aa);}return _0x2ea279['save']();};}function saveUpdates(_0x18f5e6,_0x85c16){return function(_0x267621){if(_0x267621){return _0x267621[_0x15a4('0x1e')](_0x18f5e6)[_0x15a4('0x1f')](function(_0x556365){return _0x556365;});}return null;};}function removeEntity(_0x2d5adc,_0x1f938a){return function(_0x4e1486){if(_0x4e1486){return _0x4e1486[_0x15a4('0x20')]()[_0x15a4('0x1f')](function(){_0x2d5adc[_0x15a4('0x17')](0xcc)[_0x15a4('0x21')]();});}};}function handleEntityNotFound(_0x9a339f,_0x36935b){return function(_0x2c0f2d){if(!_0x2c0f2d){_0x9a339f[_0x15a4('0x16')](0x194);}return _0x2c0f2d;};}function handleError(_0x3bad29,_0xf973f2){_0xf973f2=_0xf973f2||0x1f4;return function(_0x3bb474){logger[_0x15a4('0x22')](_0x3bb474['stack']);if(_0x3bb474[_0x15a4('0x23')]){delete _0x3bb474['name'];}_0x3bad29[_0x15a4('0x17')](_0xf973f2)[_0x15a4('0x24')](_0x3bb474);};}exports[_0x15a4('0x25')]=function(_0x13a6e2,_0x1961f9){var _0x3ee92c={'raw':!![],'where':{'id':_0x13a6e2['params']['id']}},_0x3f5fbd={};_0x3f5fbd['model']=_[_0x15a4('0x26')](db[_0x15a4('0x27')][_0x15a4('0x28')]);_0x3f5fbd[_0x15a4('0x29')]=_[_0x15a4('0x26')](_0x13a6e2[_0x15a4('0x29')]);_0x3f5fbd[_0x15a4('0x2a')]=_[_0x15a4('0x2b')](_0x3f5fbd['model'],_0x3f5fbd[_0x15a4('0x29')]);_0x3ee92c[_0x15a4('0x2c')]=_['intersection'](_0x3f5fbd[_0x15a4('0x2d')],qs[_0x15a4('0x2e')](_0x13a6e2[_0x15a4('0x29')][_0x15a4('0x2e')]));_0x3ee92c[_0x15a4('0x2c')]=_0x3ee92c[_0x15a4('0x2c')]['length']?_0x3ee92c[_0x15a4('0x2c')]:_0x3f5fbd['model'];if(_0x13a6e2[_0x15a4('0x29')][_0x15a4('0x2f')]){_0x3ee92c['include']=[{'all':!![]}];}_0x3ee92c=_[_0x15a4('0x30')]({},_0x3ee92c,_0x13a6e2[_0x15a4('0x31')]);return db[_0x15a4('0x27')]['find'](_0x3ee92c)['then'](handleEntityNotFound(_0x1961f9,null))['then'](respondWithResult(_0x1961f9,null))[_0x15a4('0x32')](handleError(_0x1961f9,null));};exports[_0x15a4('0x1e')]=function(_0x6e5726,_0x586ca1){if(_0x6e5726[_0x15a4('0x33')]['id']){delete _0x6e5726[_0x15a4('0x33')]['id'];}return db[_0x15a4('0x27')]['find']({'where':{'id':_0x6e5726[_0x15a4('0x34')]['id']}})[_0x15a4('0x1f')](handleEntityNotFound(_0x586ca1,null))[_0x15a4('0x1f')](saveUpdates(_0x6e5726['body'],null))[_0x15a4('0x1f')](respondWithResult(_0x586ca1,null))[_0x15a4('0x32')](handleError(_0x586ca1,null));};exports['destroy']=function(_0x23bf64,_0x446167){return db[_0x15a4('0x27')][_0x15a4('0x35')]({'where':{'id':_0x23bf64[_0x15a4('0x34')]['id']}})['then'](handleEntityNotFound(_0x446167,null))['then'](removeEntity(_0x446167,null))[_0x15a4('0x32')](handleError(_0x446167,null));}; \ No newline at end of file +var _0xb708=['count','offset','limit','set','Content-Range','apply','reject','save','then','name','send','show','params','model','keys','query','intersection','attributes','includeAll','include','merge','find','catch','update','body','destroy','ChatApplication','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json'];(function(_0x4a6605,_0x1e0224){var _0x3c3073=function(_0x3b6d9e){while(--_0x3b6d9e){_0x4a6605['push'](_0x4a6605['shift']());}};_0x3c3073(++_0x1e0224);}(_0xb708,0x138));var _0x8b70=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0xb708[_0x454165];return _0x56db53;};'use strict';var pdf=require(_0x8b70('0x0'));var emlformat=require(_0x8b70('0x1'));var rimraf=require(_0x8b70('0x2'));var zipdir=require(_0x8b70('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b70('0x4'));var moment=require('moment');var BPromise=require(_0x8b70('0x5'));var Mustache=require(_0x8b70('0x6'));var util=require('util');var path=require(_0x8b70('0x7'));var sox=require(_0x8b70('0x8'));var csv=require(_0x8b70('0x9'));var ejs=require(_0x8b70('0xa'));var fs=require('fs');var _=require(_0x8b70('0xb'));var squel=require('squel');var crypto=require(_0x8b70('0xc'));var jsforce=require(_0x8b70('0xd'));var deskjs=require(_0x8b70('0xe'));var toCsv=require(_0x8b70('0x9'));var querystring=require(_0x8b70('0xf'));var Papa=require(_0x8b70('0x10'));var Redis=require('ioredis');var authService=require(_0x8b70('0x11'));var qs=require(_0x8b70('0x12'));var as=require(_0x8b70('0x13'));var hardwareService=require(_0x8b70('0x14'));var logger=require(_0x8b70('0x15'))(_0x8b70('0x16'));var utils=require(_0x8b70('0x17'));var config=require(_0x8b70('0x18'));var db=require(_0x8b70('0x19'))['db'];function respondWithStatusCode(_0x5c5875,_0x46e69e){_0x46e69e=_0x46e69e||0xcc;return function(_0x2e8f75){if(_0x2e8f75){return _0x5c5875[_0x8b70('0x1a')](_0x46e69e);}return _0x5c5875['status'](_0x46e69e)[_0x8b70('0x1b')]();};}function respondWithResult(_0x3bd574,_0x36d1fe){_0x36d1fe=_0x36d1fe||0xc8;return function(_0x196c94){if(_0x196c94){return _0x3bd574[_0x8b70('0x1c')](_0x36d1fe)[_0x8b70('0x1d')](_0x196c94);}};}function respondWithFilteredResult(_0x15ce14,_0x50e2fb){return function(_0x292493){if(_0x292493){var _0x5eb397=_0x292493[_0x8b70('0x1e')],_0x339194=_0x50e2fb[_0x8b70('0x1f')],_0xe386b=_0x50e2fb['offset']+_0x50e2fb[_0x8b70('0x20')],_0x2b97a7;if(_0xe386b>=_0x5eb397){_0xe386b=_0x5eb397;_0x2b97a7=0xc8;}else{_0x2b97a7=0xce;}_0x15ce14[_0x8b70('0x1c')](_0x2b97a7);return _0x15ce14[_0x8b70('0x21')](_0x8b70('0x22'),_0x339194+'-'+_0xe386b+'/'+_0x5eb397)['json'](_0x292493);}return null;};}function patchUpdates(_0x2d2348){return function(_0x391185){try{jsonpatch[_0x8b70('0x23')](_0x391185,_0x2d2348,!![]);}catch(_0x5a8eda){return BPromise[_0x8b70('0x24')](_0x5a8eda);}return _0x391185[_0x8b70('0x25')]();};}function saveUpdates(_0x5701b4,_0x3bf942){return function(_0x2e76cd){if(_0x2e76cd){return _0x2e76cd['update'](_0x5701b4)[_0x8b70('0x26')](function(_0x45bb5e){return _0x45bb5e;});}return null;};}function removeEntity(_0x27d8ad,_0x1cad97){return function(_0x43de8a){if(_0x43de8a){return _0x43de8a['destroy']()[_0x8b70('0x26')](function(){_0x27d8ad[_0x8b70('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47745e,_0x24abbd){return function(_0x27daa6){if(!_0x27daa6){_0x47745e[_0x8b70('0x1a')](0x194);}return _0x27daa6;};}function handleError(_0x4d5e44,_0xb0cb57){_0xb0cb57=_0xb0cb57||0x1f4;return function(_0x14b71c){logger['error'](_0x14b71c['stack']);if(_0x14b71c[_0x8b70('0x27')]){delete _0x14b71c['name'];}_0x4d5e44[_0x8b70('0x1c')](_0xb0cb57)[_0x8b70('0x28')](_0x14b71c);};}exports[_0x8b70('0x29')]=function(_0x1fd0b5,_0x2845e4){var _0x48ea6a={'raw':!![],'where':{'id':_0x1fd0b5[_0x8b70('0x2a')]['id']}},_0x49ce2a={};_0x49ce2a[_0x8b70('0x2b')]=_[_0x8b70('0x2c')](db['ChatApplication']['rawAttributes']);_0x49ce2a[_0x8b70('0x2d')]=_[_0x8b70('0x2c')](_0x1fd0b5[_0x8b70('0x2d')]);_0x49ce2a['filters']=_['intersection'](_0x49ce2a[_0x8b70('0x2b')],_0x49ce2a[_0x8b70('0x2d')]);_0x48ea6a['attributes']=_[_0x8b70('0x2e')](_0x49ce2a[_0x8b70('0x2b')],qs['fields'](_0x1fd0b5[_0x8b70('0x2d')]['fields']));_0x48ea6a[_0x8b70('0x2f')]=_0x48ea6a[_0x8b70('0x2f')]['length']?_0x48ea6a[_0x8b70('0x2f')]:_0x49ce2a[_0x8b70('0x2b')];if(_0x1fd0b5[_0x8b70('0x2d')][_0x8b70('0x30')]){_0x48ea6a[_0x8b70('0x31')]=[{'all':!![]}];}_0x48ea6a=_[_0x8b70('0x32')]({},_0x48ea6a,_0x1fd0b5['options']);return db['ChatApplication'][_0x8b70('0x33')](_0x48ea6a)[_0x8b70('0x26')](handleEntityNotFound(_0x2845e4,null))[_0x8b70('0x26')](respondWithResult(_0x2845e4,null))[_0x8b70('0x34')](handleError(_0x2845e4,null));};exports[_0x8b70('0x35')]=function(_0x14a81a,_0x329085){if(_0x14a81a[_0x8b70('0x36')]['id']){delete _0x14a81a['body']['id'];}return db['ChatApplication'][_0x8b70('0x33')]({'where':{'id':_0x14a81a[_0x8b70('0x2a')]['id']}})[_0x8b70('0x26')](handleEntityNotFound(_0x329085,null))[_0x8b70('0x26')](saveUpdates(_0x14a81a[_0x8b70('0x36')],null))['then'](respondWithResult(_0x329085,null))[_0x8b70('0x34')](handleError(_0x329085,null));};exports[_0x8b70('0x37')]=function(_0x203347,_0x34b7d4){return db[_0x8b70('0x38')][_0x8b70('0x33')]({'where':{'id':_0x203347[_0x8b70('0x2a')]['id']}})[_0x8b70('0x26')](handleEntityNotFound(_0x34b7d4,null))[_0x8b70('0x26')](removeEntity(_0x34b7d4,null))['catch'](handleError(_0x34b7d4,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4f711a2..cb0b156 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 _0x3067=['chat_applications','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define'];(function(_0x4bb01e,_0x262d51){var _0x43b3b6=function(_0x4b994b){while(--_0x4b994b){_0x4bb01e['push'](_0x4bb01e['shift']());}};_0x43b3b6(++_0x262d51);}(_0x3067,0x1e3));var _0x7306=function(_0x35cc52,_0x1dbdd8){_0x35cc52=_0x35cc52-0x0;var _0x5a52f4=_0x3067[_0x35cc52];return _0x5a52f4;};'use strict';var _=require(_0x7306('0x0'));var util=require(_0x7306('0x1'));var logger=require(_0x7306('0x2'))('api');var moment=require(_0x7306('0x3'));var BPromise=require(_0x7306('0x4'));var rp=require(_0x7306('0x5'));var fs=require('fs');var path=require(_0x7306('0x6'));var rimraf=require('rimraf');var config=require(_0x7306('0x7'));var attributes=require(_0x7306('0x8'));module[_0x7306('0x9')]=function(_0x2adad1,_0x30deff){return _0x2adad1[_0x7306('0xa')]('ChatApplication',attributes,{'tableName':_0x7306('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7306('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x202d=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x202d,0xe2));var _0xd202=function(_0x2d7db6,_0x1cafa5){_0x2d7db6=_0x2d7db6-0x0;var _0x2ce3aa=_0x202d[_0x2d7db6];return _0x2ce3aa;};'use strict';var _=require(_0xd202('0x0'));var util=require(_0xd202('0x1'));var logger=require(_0xd202('0x2'))(_0xd202('0x3'));var moment=require(_0xd202('0x4'));var BPromise=require('bluebird');var rp=require(_0xd202('0x5'));var fs=require('fs');var path=require(_0xd202('0x6'));var rimraf=require('rimraf');var config=require(_0xd202('0x7'));var attributes=require(_0xd202('0x8'));module[_0xd202('0x9')]=function(_0x5101e0,_0x5ed504){return _0x5101e0[_0xd202('0xa')](_0xd202('0xb'),attributes,{'tableName':_0xd202('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd202('0xd'),'collate':_0xd202('0xe')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index c0fcf67..81076d6 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 _0xc10a=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','ChatApplication,\x20%s,\x20%s','message','catch','util','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc10a,0x1ab));var _0xac10=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0xc10a[_0x3f3f40];return _0x403b7a;};'use strict';var _=require('lodash');var util=require(_0xac10('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac10('0x1'));var db=require(_0xac10('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xac10('0x3'))(_0xac10('0x4'));var config=require(_0xac10('0x5'));var jayson=require(_0xac10('0x6'));var client=jayson[_0xac10('0x7')][_0xac10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x208a91,_0x22fb5c,_0x497911){return new BPromise(function(_0x47b944,_0x3c5f26){return client['request'](_0x208a91,_0x497911)[_0xac10('0x9')](function(_0x1d2810){logger[_0xac10('0xa')]('ChatApplication,\x20%s,\x20%s',_0x22fb5c,_0xac10('0xb'));logger[_0xac10('0xc')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x22fb5c,_0xac10('0xb'),JSON[_0xac10('0xd')](_0x1d2810));if(_0x1d2810[_0xac10('0xe')]){if(_0x1d2810[_0xac10('0xe')]['code']===0x1f4){logger[_0xac10('0xe')](_0xac10('0xf'),_0x22fb5c,_0x1d2810[_0xac10('0xe')][_0xac10('0x10')]);return _0x3c5f26(_0x1d2810[_0xac10('0xe')][_0xac10('0x10')]);}logger[_0xac10('0xe')](_0xac10('0xf'),_0x22fb5c,_0x1d2810[_0xac10('0xe')][_0xac10('0x10')]);return _0x47b944(_0x1d2810['error'][_0xac10('0x10')]);}else{logger[_0xac10('0xa')](_0xac10('0xf'),_0x22fb5c,_0xac10('0xb'));_0x47b944(_0x1d2810['result'][_0xac10('0x10')]);}})[_0xac10('0x11')](function(_0x21ad27){logger[_0xac10('0xe')]('ChatApplication,\x20%s,\x20%s',_0x22fb5c,_0x21ad27);_0x3c5f26(_0x21ad27);});});} \ No newline at end of file +var _0x9750=['client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x19536f,_0x5abaad){var _0x2ad248=function(_0x4ca131){while(--_0x4ca131){_0x19536f['push'](_0x19536f['shift']());}};_0x2ad248(++_0x5abaad);}(_0x9750,0xf2));var _0x0975=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x9750[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x0975('0x0'));var util=require(_0x0975('0x1'));var moment=require(_0x0975('0x2'));var BPromise=require(_0x0975('0x3'));var rs=require(_0x0975('0x4'));var fs=require('fs');var Redis=require(_0x0975('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0975('0x6'));var logger=require(_0x0975('0x7'))(_0x0975('0x8'));var config=require('../../config/environment');var jayson=require(_0x0975('0x9'));var client=jayson[_0x0975('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x380bd7,_0x4a46c7,_0x4da967){return new BPromise(function(_0x583ddf,_0x56ee85){return client['request'](_0x380bd7,_0x4da967)[_0x0975('0xb')](function(_0x4a0ed2){logger[_0x0975('0xc')](_0x0975('0xd'),_0x4a46c7,_0x0975('0xe'));logger[_0x0975('0xf')](_0x0975('0x10'),_0x4a46c7,_0x0975('0xe'),JSON[_0x0975('0x11')](_0x4a0ed2));if(_0x4a0ed2[_0x0975('0x12')]){if(_0x4a0ed2[_0x0975('0x12')]['code']===0x1f4){logger[_0x0975('0x12')](_0x0975('0xd'),_0x4a46c7,_0x4a0ed2[_0x0975('0x12')][_0x0975('0x13')]);return _0x56ee85(_0x4a0ed2[_0x0975('0x12')][_0x0975('0x13')]);}logger[_0x0975('0x12')](_0x0975('0xd'),_0x4a46c7,_0x4a0ed2[_0x0975('0x12')][_0x0975('0x13')]);return _0x583ddf(_0x4a0ed2[_0x0975('0x12')][_0x0975('0x13')]);}else{logger['info'](_0x0975('0xd'),_0x4a46c7,_0x0975('0xe'));_0x583ddf(_0x4a0ed2[_0x0975('0x14')][_0x0975('0x13')]);}})['catch'](function(_0x479738){logger[_0x0975('0x12')]('ChatApplication,\x20%s,\x20%s',_0x4a46c7,_0x479738);_0x56ee85(_0x479738);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 58521f8..2a3a495 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 _0xf2f5=['update','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x351b46,_0x26b265){var _0x1515df=function(_0x22896a){while(--_0x22896a){_0x351b46['push'](_0x351b46['shift']());}};_0x1515df(++_0x26b265);}(_0xf2f5,0x179));var _0x5f2f=function(_0x4942d8,_0x548618){_0x4942d8=_0x4942d8-0x0;var _0x15fd09=_0xf2f5[_0x4942d8];return _0x15fd09;};'use strict';var multer=require(_0x5f2f('0x0'));var util=require('util');var path=require(_0x5f2f('0x1'));var timeout=require('connect-timeout');var express=require(_0x5f2f('0x2'));var router=express[_0x5f2f('0x3')]();var auth=require(_0x5f2f('0x4'));var interaction=require(_0x5f2f('0x5'));var config=require(_0x5f2f('0x6'));var controller=require(_0x5f2f('0x7'));router[_0x5f2f('0x8')](_0x5f2f('0x9'),auth[_0x5f2f('0xa')](),controller[_0x5f2f('0xb')]);router[_0x5f2f('0xc')](_0x5f2f('0x9'),auth[_0x5f2f('0xa')](),controller[_0x5f2f('0xd')]);router['delete'](_0x5f2f('0x9'),auth[_0x5f2f('0xa')](),controller['destroy']);module[_0x5f2f('0xe')]=router; \ No newline at end of file +var _0x38c1=['update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','put','/:id'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x38c1,0xed));var _0x138c=function(_0x2eac4f,_0x5173f9){_0x2eac4f=_0x2eac4f-0x0;var _0x58f73b=_0x38c1[_0x2eac4f];return _0x58f73b;};'use strict';var multer=require(_0x138c('0x0'));var util=require(_0x138c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x138c('0x2'));var router=express[_0x138c('0x3')]();var auth=require(_0x138c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x138c('0x5'));var controller=require('./chatApplication.controller');router[_0x138c('0x6')]('/:id',auth[_0x138c('0x7')](),controller['show']);router[_0x138c('0x8')](_0x138c('0x9'),auth[_0x138c('0x7')](),controller[_0x138c('0xa')]);router['delete']('/:id',auth[_0x138c('0x7')](),controller[_0x138c('0xb')]);module[_0x138c('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index cce64b1..658c6bd 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 _0x13c8=['BOOLEAN','sequelize','exports','STRING'];(function(_0x4f3d39,_0x4342d6){var _0x485861=function(_0x2a5ebb){while(--_0x2a5ebb){_0x4f3d39['push'](_0x4f3d39['shift']());}};_0x485861(++_0x4342d6);}(_0x13c8,0x139));var _0x813c=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x13c8[_0xaf25ae];return _0x49732d;};'use strict';var Sequelize=require(_0x813c('0x0'));module[_0x813c('0x1')]={'name':{'type':Sequelize[_0x813c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x813c('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd5c5=['sequelize','STRING','BOOLEAN'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xd5c5,0x156));var _0x5d5c=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0xd5c5[_0x3207aa];return _0x51758f;};'use strict';var Sequelize=require(_0x5d5c('0x0'));module['exports']={'name':{'type':Sequelize[_0x5d5c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5d5c('0x1')]},'write':{'type':Sequelize[_0x5d5c('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 1fbb6dd..4dff530 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 _0xe63f=['describe','getUnread','ChatInternalMessage','user','addMembers','omit','getMembers','findOne','User','hasOwnProperty','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','./chatGroup.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~!@#$%^&-_=+[{]}.','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','Content-Range','reject','update','destroy','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','then','includeAll','findAll','rows','show','params','create','body','find'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xe63f,0xe5));var _0xfe63=function(_0x451f7f,_0x56fdd7){_0x451f7f=_0x451f7f-0x0;var _0x22fe20=_0xe63f[_0x451f7f];return _0x22fe20;};'use strict';var pdf=require(_0xfe63('0x0'));var emlformat=require(_0xfe63('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfe63('0x2'));var rp=require(_0xfe63('0x3'));var moment=require(_0xfe63('0x4'));var BPromise=require(_0xfe63('0x5'));var Mustache=require(_0xfe63('0x6'));var util=require(_0xfe63('0x7'));var path=require(_0xfe63('0x8'));var sox=require(_0xfe63('0x9'));var csv=require(_0xfe63('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xfe63('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe63('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfe63('0xd'));var Papa=require(_0xfe63('0xe'));var Redis=require(_0xfe63('0xf'));var authService=require(_0xfe63('0x10'));var qs=require(_0xfe63('0x11'));var as=require(_0xfe63('0x12'));var hardwareService=require(_0xfe63('0x13'));var logger=require(_0xfe63('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xfe63('0x15'));var db=require('../../mysqldb')['db'];config[_0xfe63('0x16')]=_[_0xfe63('0x17')](config[_0xfe63('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe63('0x16')]));require(_0xfe63('0x18'))['register'](socket);var jayson=require(_0xfe63('0x19'));var client=jayson[_0xfe63('0x1a')][_0xfe63('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x53011c,_0x495dda,_0x11efb4){if(_0x11efb4){var _0x4eda44=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4eda44[_0xfe63('0x1c')](_0x495dda)){return _0x53011c;}else{throw new db[(_0xfe63('0x1d'))][(_0xfe63('0x1e'))](_0xfe63('0x1f'));}}else{return _0x53011c;}}function respondWithRpcPromise(_0x5bbce7,_0x1f068c,_0x3a49de,_0x48bfa9){return new BPromise(function(_0x1ebac0,_0x575797){var _0x468617=_0x48bfa9||client;return _0x468617['request'](_0x5bbce7,_0x3a49de)['then'](function(_0x148d47){logger['info'](_0xfe63('0x20'),_0x1f068c,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1f068c,_0xfe63('0x21'),JSON['stringify'](_0x148d47));if(_0x148d47[_0xfe63('0x22')]){if(_0x148d47['error'][_0xfe63('0x23')]===0x1f4){logger[_0xfe63('0x22')](_0xfe63('0x20'),_0x1f068c,_0x148d47[_0xfe63('0x22')]['message']);return _0x575797(_0x148d47[_0xfe63('0x22')]['message']);}logger[_0xfe63('0x22')](_0xfe63('0x20'),_0x1f068c,_0x148d47[_0xfe63('0x22')]['message']);return _0x1ebac0(_0x148d47[_0xfe63('0x22')][_0xfe63('0x24')]);}else{logger[_0xfe63('0x25')](_0xfe63('0x20'),_0x1f068c,_0xfe63('0x21'));_0x1ebac0(_0x148d47[_0xfe63('0x26')]['message']);}})[_0xfe63('0x27')](function(_0xd252a0){logger[_0xfe63('0x22')](_0xfe63('0x20'),_0x1f068c,_0xd252a0);_0x575797(_0xd252a0);});});}function respondWithStatusCode(_0x38b0e1,_0x5035ba){_0x5035ba=_0x5035ba||0xcc;return function(_0x1edee8){if(_0x1edee8){return _0x38b0e1[_0xfe63('0x28')](_0x5035ba);}return _0x38b0e1[_0xfe63('0x29')](_0x5035ba)[_0xfe63('0x2a')]();};}function respondWithResult(_0x8f69e7,_0x11e1ed){_0x11e1ed=_0x11e1ed||0xc8;return function(_0x462ba9){if(_0x462ba9){return _0x8f69e7['status'](_0x11e1ed)[_0xfe63('0x2b')](_0x462ba9);}};}function respondWithFilteredResult(_0x209d21,_0x54de75){return function(_0x9feea8){if(_0x9feea8){var _0x344a09=_0x9feea8['count'],_0x49bce1=_0x54de75[_0xfe63('0x2c')],_0x40fb8d=_0x54de75[_0xfe63('0x2c')]+_0x54de75[_0xfe63('0x2d')],_0x45e922;if(_0x40fb8d>=_0x344a09){_0x40fb8d=_0x344a09;_0x45e922=0xc8;}else{_0x45e922=0xce;}_0x209d21['status'](_0x45e922);return _0x209d21['set'](_0xfe63('0x2e'),_0x49bce1+'-'+_0x40fb8d+'/'+_0x344a09)[_0xfe63('0x2b')](_0x9feea8);}return null;};}function patchUpdates(_0x55758a){return function(_0x1b7034){try{jsonpatch['apply'](_0x1b7034,_0x55758a,!![]);}catch(_0x3213a6){return BPromise[_0xfe63('0x2f')](_0x3213a6);}return _0x1b7034['save']();};}function saveUpdates(_0x309bd6,_0x4a144b){return function(_0x23a6a0){if(_0x23a6a0){return _0x23a6a0[_0xfe63('0x30')](_0x309bd6)['then'](function(_0x2537df){return _0x2537df;});}return null;};}function removeEntity(_0x3d3798,_0x1db0d2){return function(_0x7d761b){if(_0x7d761b){return _0x7d761b[_0xfe63('0x31')]()['then'](function(){_0x3d3798[_0xfe63('0x29')](0xcc)[_0xfe63('0x2a')]();});}};}function handleEntityNotFound(_0x58f619,_0x1fcdb8){return function(_0x150bd6){if(!_0x150bd6){_0x58f619['sendStatus'](0x194);}return _0x150bd6;};}function handleError(_0x1b55b4,_0x26715a){_0x26715a=_0x26715a||0x1f4;return function(_0x1200be){logger[_0xfe63('0x22')](_0x1200be[_0xfe63('0x32')]);if(_0x1200be[_0xfe63('0x33')]){delete _0x1200be[_0xfe63('0x33')];}_0x1b55b4[_0xfe63('0x29')](_0x26715a)[_0xfe63('0x34')](_0x1200be);};}exports['index']=function(_0x3617a8,_0x56aa96){var _0x8286eb={},_0x30af33={},_0x5cd543={'count':0x0,'rows':[]};var _0x240d7d=_[_0xfe63('0x35')](db[_0xfe63('0x36')][_0xfe63('0x37')],function(_0x2204fe){return{'name':_0x2204fe[_0xfe63('0x38')],'type':_0x2204fe[_0xfe63('0x39')][_0xfe63('0x3a')]};});_0x30af33[_0xfe63('0x3b')]=_['map'](_0x240d7d,'name');_0x30af33[_0xfe63('0x3c')]=_[_0xfe63('0x3d')](_0x3617a8['query']);_0x30af33[_0xfe63('0x3e')]=_[_0xfe63('0x3f')](_0x30af33['model'],_0x30af33[_0xfe63('0x3c')]);_0x8286eb[_0xfe63('0x40')]=_[_0xfe63('0x3f')](_0x30af33[_0xfe63('0x3b')],qs[_0xfe63('0x41')](_0x3617a8[_0xfe63('0x3c')][_0xfe63('0x41')]));_0x8286eb['attributes']=_0x8286eb[_0xfe63('0x40')][_0xfe63('0x42')]?_0x8286eb[_0xfe63('0x40')]:_0x30af33['model'];if(!_0x3617a8[_0xfe63('0x3c')]['hasOwnProperty'](_0xfe63('0x43'))){_0x8286eb['limit']=qs[_0xfe63('0x2d')](_0x3617a8[_0xfe63('0x3c')][_0xfe63('0x2d')]);_0x8286eb[_0xfe63('0x2c')]=qs[_0xfe63('0x2c')](_0x3617a8['query']['offset']);}_0x8286eb[_0xfe63('0x44')]=qs[_0xfe63('0x45')](_0x3617a8[_0xfe63('0x3c')][_0xfe63('0x45')]);_0x8286eb[_0xfe63('0x46')]=qs[_0xfe63('0x3e')](_[_0xfe63('0x47')](_0x3617a8[_0xfe63('0x3c')],_0x30af33['filters']),_0x240d7d);if(_0x3617a8[_0xfe63('0x3c')]['filter']){_0x8286eb[_0xfe63('0x46')]=_[_0xfe63('0x48')](_0x8286eb[_0xfe63('0x46')],{'$or':_[_0xfe63('0x35')](_0x240d7d,function(_0x244bb2){if(_0x244bb2[_0xfe63('0x39')]!==_0xfe63('0x49')){var _0x165ce2={};_0x165ce2[_0x244bb2['name']]={'$like':'%'+_0x3617a8[_0xfe63('0x3c')][_0xfe63('0x4a')]+'%'};return _0x165ce2;}})});}_0x8286eb=_['merge']({},_0x8286eb,_0x3617a8[_0xfe63('0x4b')]);var _0x41fbd0={'where':_0x8286eb['where']};return db[_0xfe63('0x36')][_0xfe63('0x4c')](_0x41fbd0)[_0xfe63('0x4d')](function(_0x3214a0){_0x5cd543['count']=_0x3214a0;if(_0x3617a8[_0xfe63('0x3c')][_0xfe63('0x4e')]){_0x8286eb['include']=[{'all':!![]}];}return db[_0xfe63('0x36')][_0xfe63('0x4f')](_0x8286eb);})[_0xfe63('0x4d')](function(_0x19c5f4){_0x5cd543[_0xfe63('0x50')]=_0x19c5f4;return _0x5cd543;})[_0xfe63('0x4d')](respondWithFilteredResult(_0x56aa96,_0x8286eb))[_0xfe63('0x27')](handleError(_0x56aa96,null));};exports[_0xfe63('0x51')]=function(_0x5b942f,_0x372a0b){var _0x22753e={'raw':!![],'where':{'id':_0x5b942f[_0xfe63('0x52')]['id']}},_0x5a1dd3={};_0x5a1dd3['model']=_['keys'](db['ChatGroup']['rawAttributes']);_0x5a1dd3['query']=_[_0xfe63('0x3d')](_0x5b942f['query']);_0x5a1dd3['filters']=_[_0xfe63('0x3f')](_0x5a1dd3['model'],_0x5a1dd3['query']);_0x22753e[_0xfe63('0x40')]=_[_0xfe63('0x3f')](_0x5a1dd3['model'],qs[_0xfe63('0x41')](_0x5b942f[_0xfe63('0x3c')][_0xfe63('0x41')]));_0x22753e[_0xfe63('0x40')]=_0x22753e[_0xfe63('0x40')][_0xfe63('0x42')]?_0x22753e[_0xfe63('0x40')]:_0x5a1dd3[_0xfe63('0x3b')];if(_0x5b942f[_0xfe63('0x3c')][_0xfe63('0x4e')]){_0x22753e['include']=[{'all':!![]}];}_0x22753e=_[_0xfe63('0x48')]({},_0x22753e,_0x5b942f[_0xfe63('0x4b')]);return db[_0xfe63('0x36')]['find'](_0x22753e)[_0xfe63('0x4d')](handleEntityNotFound(_0x372a0b,null))[_0xfe63('0x4d')](respondWithResult(_0x372a0b,null))[_0xfe63('0x27')](handleError(_0x372a0b,null));};exports[_0xfe63('0x53')]=function(_0x40a736,_0x4df98f){return db[_0xfe63('0x36')][_0xfe63('0x53')](_0x40a736[_0xfe63('0x54')],{})[_0xfe63('0x4d')](respondWithResult(_0x4df98f,0xc9))['catch'](handleError(_0x4df98f,null));};exports[_0xfe63('0x30')]=function(_0x129161,_0x53ff6e){if(_0x129161[_0xfe63('0x54')]['id']){delete _0x129161[_0xfe63('0x54')]['id'];}return db[_0xfe63('0x36')][_0xfe63('0x55')]({'where':{'id':_0x129161[_0xfe63('0x52')]['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x53ff6e,null))[_0xfe63('0x4d')](saveUpdates(_0x129161[_0xfe63('0x54')],null))[_0xfe63('0x4d')](respondWithResult(_0x53ff6e,null))[_0xfe63('0x27')](handleError(_0x53ff6e,null));};exports[_0xfe63('0x31')]=function(_0x2fb6e3,_0x4700a7){return db[_0xfe63('0x36')][_0xfe63('0x55')]({'where':{'id':_0x2fb6e3[_0xfe63('0x52')]['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x4700a7,null))[_0xfe63('0x4d')](removeEntity(_0x4700a7,null))[_0xfe63('0x27')](handleError(_0x4700a7,null));};exports[_0xfe63('0x56')]=function(_0x5174ee,_0x2fae44){return db[_0xfe63('0x36')][_0xfe63('0x56')]()[_0xfe63('0x4d')](respondWithResult(_0x2fae44,null))[_0xfe63('0x27')](handleError(_0x2fae44,null));};exports[_0xfe63('0x57')]=function(_0x46ccab,_0x433f17,_0x3b1c3c){return db[_0xfe63('0x58')][_0xfe63('0x4c')]({'where':{'ChatGroupId':_0x46ccab[_0xfe63('0x52')]['id'],'ToId':_0x46ccab[_0xfe63('0x59')]['id'],'read':![]}})[_0xfe63('0x4d')](function(_0x16ad92){return{'id':_['toInteger'](_0x46ccab[_0xfe63('0x52')]['id']),'count':_0x16ad92};})['then'](respondWithResult(_0x433f17,null))[_0xfe63('0x27')](handleError(_0x433f17,null));};exports[_0xfe63('0x5a')]=function(_0x5e229d,_0x45bf11,_0x37a334){return db[_0xfe63('0x36')][_0xfe63('0x55')]({'where':{'id':_0x5e229d[_0xfe63('0x52')]['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x45bf11,null))[_0xfe63('0x4d')](function(_0xdab5a0){if(_0xdab5a0){return _0xdab5a0[_0xfe63('0x5a')](_0x5e229d[_0xfe63('0x54')]['ids'],_[_0xfe63('0x5b')](_0x5e229d[_0xfe63('0x54')],['ids','id'])||{});}})[_0xfe63('0x4d')](respondWithResult(_0x45bf11,null))[_0xfe63('0x27')](handleError(_0x45bf11,null));};exports[_0xfe63('0x5c')]=function(_0x1483b4,_0x675f8d,_0x1ec24c){var _0x435e75={};var _0x518d7a={};var _0x2f4c3e;var _0x2ca70e;return db[_0xfe63('0x36')][_0xfe63('0x5d')]({'where':{'id':_0x1483b4[_0xfe63('0x52')]['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x675f8d,null))[_0xfe63('0x4d')](function(_0xf89d85){if(_0xf89d85){_0x2f4c3e=_0xf89d85;_0x518d7a['model']=_[_0xfe63('0x3d')](db[_0xfe63('0x5e')][_0xfe63('0x37')]);_0x518d7a['query']=_[_0xfe63('0x3d')](_0x1483b4[_0xfe63('0x3c')]);_0x518d7a['filters']=_[_0xfe63('0x3f')](_0x518d7a[_0xfe63('0x3b')],_0x518d7a[_0xfe63('0x3c')]);_0x435e75[_0xfe63('0x40')]=_[_0xfe63('0x3f')](_0x518d7a[_0xfe63('0x3b')],qs[_0xfe63('0x41')](_0x1483b4['query'][_0xfe63('0x41')]));_0x435e75['attributes']=_0x435e75[_0xfe63('0x40')][_0xfe63('0x42')]?_0x435e75[_0xfe63('0x40')]:_0x518d7a[_0xfe63('0x3b')];_0x435e75[_0xfe63('0x44')]=qs[_0xfe63('0x45')](_0x1483b4[_0xfe63('0x3c')][_0xfe63('0x45')]);_0x435e75[_0xfe63('0x46')]=qs[_0xfe63('0x3e')](_['pick'](_0x1483b4[_0xfe63('0x3c')],_0x518d7a[_0xfe63('0x3e')]));if(_0x1483b4[_0xfe63('0x3c')][_0xfe63('0x4a')]){_0x435e75[_0xfe63('0x46')]=_[_0xfe63('0x48')](_0x435e75['where'],{'$or':_[_0xfe63('0x35')](_0x435e75[_0xfe63('0x40')],function(_0x23c872){var _0x31997d={};_0x31997d[_0x23c872]={'$like':'%'+_0x1483b4['query']['filter']+'%'};return _0x31997d;})});}_0x435e75=_[_0xfe63('0x48')]({},_0x435e75,_0x1483b4[_0xfe63('0x4b')]);return _0x2f4c3e[_0xfe63('0x5c')](_0x435e75);}})[_0xfe63('0x4d')](function(_0x26a070){if(_0x26a070){_0x2ca70e=_0x26a070[_0xfe63('0x42')];if(!_0x1483b4[_0xfe63('0x3c')][_0xfe63('0x5f')](_0xfe63('0x43'))){_0x435e75[_0xfe63('0x2d')]=qs['limit'](_0x1483b4['query'][_0xfe63('0x2d')]);_0x435e75[_0xfe63('0x2c')]=qs['offset'](_0x1483b4['query'][_0xfe63('0x2c')]);}return _0x2f4c3e[_0xfe63('0x5c')](_0x435e75);}})[_0xfe63('0x4d')](function(_0x1cefd4){if(_0x1cefd4){return _0x1cefd4?{'count':_0x2ca70e,'rows':_0x1cefd4}:null;}})['then'](respondWithResult(_0x675f8d,null))[_0xfe63('0x27')](handleError(_0x675f8d,null));};exports[_0xfe63('0x60')]=function(_0x4bed7a,_0x97ec85,_0xf2e29e){return db[_0xfe63('0x36')][_0xfe63('0x55')]({'where':{'id':_0x4bed7a[_0xfe63('0x52')]['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x97ec85,null))[_0xfe63('0x4d')](function(_0x4477d8){if(_0x4477d8){return _0x4477d8[_0xfe63('0x60')](_0x4bed7a[_0xfe63('0x3c')][_0xfe63('0x61')]);}})[_0xfe63('0x4d')](respondWithStatusCode(_0x97ec85,null))[_0xfe63('0x27')](handleError(_0x97ec85,null));};exports[_0xfe63('0x62')]=function(_0x4ae86c,_0x8f0718,_0xcb4ba){if(_0x4ae86c['body']['id']){delete _0x4ae86c['body']['id'];}return db['ChatGroup']['find']({'where':{'id':_0x4ae86c['params']['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x8f0718,null))['then'](function(_0x3d1490){if(_0x3d1490){_0x4ae86c['body'][_0xfe63('0x63')]=_0x3d1490['id'];return db[_0xfe63('0x58')][_0xfe63('0x53')](_0x4ae86c[_0xfe63('0x54')]);}})[_0xfe63('0x4d')](respondWithResult(_0x8f0718,null))['catch'](handleError(_0x8f0718,null));};exports[_0xfe63('0x64')]=function(_0x263214,_0x289bc6,_0x3b624c){var _0x41c94c={};var _0x149b2e={};var _0x263f63;var _0x45825f;return db[_0xfe63('0x36')][_0xfe63('0x5d')]({'where':{'id':_0x263214[_0xfe63('0x52')]['id']}})[_0xfe63('0x4d')](handleEntityNotFound(_0x289bc6,null))['then'](function(_0x154ab2){if(_0x154ab2){_0x263f63=_0x154ab2;_0x149b2e[_0xfe63('0x3b')]=_[_0xfe63('0x3d')](db['ChatInternalMessage']['rawAttributes']);_0x149b2e[_0xfe63('0x3c')]=_['keys'](_0x263214[_0xfe63('0x3c')]);_0x149b2e[_0xfe63('0x3e')]=_[_0xfe63('0x3f')](_0x149b2e[_0xfe63('0x3b')],_0x149b2e['query']);_0x41c94c['attributes']=_[_0xfe63('0x3f')](_0x149b2e['model'],qs[_0xfe63('0x41')](_0x263214[_0xfe63('0x3c')][_0xfe63('0x41')]));_0x41c94c[_0xfe63('0x40')]=_0x41c94c[_0xfe63('0x40')][_0xfe63('0x42')]?_0x41c94c[_0xfe63('0x40')]:_0x149b2e['model'];_0x41c94c[_0xfe63('0x44')]=qs[_0xfe63('0x45')](_0x263214[_0xfe63('0x3c')][_0xfe63('0x45')]);_0x41c94c[_0xfe63('0x46')]=qs[_0xfe63('0x3e')](_['pick'](_0x263214['query'],_0x149b2e[_0xfe63('0x3e')]));if(_0x263214[_0xfe63('0x3c')][_0xfe63('0x4a')]){_0x41c94c[_0xfe63('0x46')]=_[_0xfe63('0x48')](_0x41c94c[_0xfe63('0x46')],{'$or':_[_0xfe63('0x35')](_0x41c94c['attributes'],function(_0x4dba84){var _0x379ed2={};_0x379ed2[_0x4dba84]={'$like':'%'+_0x263214[_0xfe63('0x3c')][_0xfe63('0x4a')]+'%'};return _0x379ed2;})});}if(_0x263214[_0xfe63('0x3c')][_0xfe63('0x65')]){var _0x3d8519=_0x263214[_0xfe63('0x3c')]['$gte'][_0xfe63('0x66')](',');var _0x448a72={};_0x448a72[_0x3d8519[0x0]]={'$gte':moment(_0x3d8519[0x1])[_0xfe63('0x67')](_0xfe63('0x68'))};_0x41c94c[_0xfe63('0x46')]=_[_0xfe63('0x48')](_0x41c94c[_0xfe63('0x46')],_0x448a72);}_0x41c94c=_[_0xfe63('0x48')]({},_0x41c94c,_0x263214[_0xfe63('0x4b')]);return _0x263f63[_0xfe63('0x64')](_0x41c94c);}})[_0xfe63('0x4d')](function(_0x1c895f){if(_0x1c895f){_0x45825f=_0x1c895f[_0xfe63('0x42')];if(!_0x263214[_0xfe63('0x3c')]['hasOwnProperty']('nolimit')){_0x41c94c[_0xfe63('0x2d')]=qs[_0xfe63('0x2d')](_0x263214[_0xfe63('0x3c')][_0xfe63('0x2d')]);_0x41c94c[_0xfe63('0x2c')]=qs[_0xfe63('0x2c')](_0x263214['query'][_0xfe63('0x2c')]);}return _0x263f63[_0xfe63('0x64')](_0x41c94c);}})[_0xfe63('0x4d')](function(_0x22324f){if(_0x22324f){return _0x22324f?{'count':_0x45825f,'rows':_0x22324f}:null;}})['then'](respondWithResult(_0x289bc6,null))[_0xfe63('0x27')](handleError(_0x289bc6,null));}; \ No newline at end of file +var _0xea2b=['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','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','set','apply','reject','save','update','stack','name','send','index','map','ChatGroup','rawAttributes','type','query','filters','model','attributes','intersection','fields','hasOwnProperty','limit','offset','order','sort','pick','filter','where','merge','options','includeAll','include','rows','show','params','keys','length','create','body','find','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','User','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','format','nolimit','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xea2b,0x198));var _0xbea2=function(_0x1b0d2c,_0x17fb0a){_0x1b0d2c=_0x1b0d2c-0x0;var _0x1a49fb=_0xea2b[_0x1b0d2c];return _0x1a49fb;};'use strict';var pdf=require(_0xbea2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbea2('0x1'));var jsonpatch=require(_0xbea2('0x2'));var rp=require(_0xbea2('0x3'));var moment=require(_0xbea2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbea2('0x5'));var util=require('util');var path=require(_0xbea2('0x6'));var sox=require('sox');var csv=require(_0xbea2('0x7'));var ejs=require(_0xbea2('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbea2('0x9'));var toCsv=require('to-csv');var querystring=require(_0xbea2('0xa'));var Papa=require(_0xbea2('0xb'));var Redis=require(_0xbea2('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xbea2('0xd'));var as=require(_0xbea2('0xe'));var hardwareService=require(_0xbea2('0xf'));var logger=require(_0xbea2('0x10'))('api');var utils=require(_0xbea2('0x11'));var config=require(_0xbea2('0x12'));var db=require(_0xbea2('0x13'))['db'];config['redis']=_[_0xbea2('0x14')](config[_0xbea2('0x15')],{'host':_0xbea2('0x16'),'port':0x18eb});var socket=require(_0xbea2('0x17'))(new Redis(config[_0xbea2('0x15')]));require(_0xbea2('0x18'))[_0xbea2('0x19')](socket);var jayson=require(_0xbea2('0x1a'));var client=jayson[_0xbea2('0x1b')][_0xbea2('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x534148,_0x158971,_0x37797b){if(_0x37797b){var _0x320240=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x320240[_0xbea2('0x1d')](_0x158971)){return _0x534148;}else{throw new db['Sequelize'][(_0xbea2('0x1e'))](_0xbea2('0x1f'));}}else{return _0x534148;}}function respondWithRpcPromise(_0x22f219,_0x34911f,_0x3341ed,_0x3f0d54){return new BPromise(function(_0xeebe75,_0x3b2bed){var _0x5d102a=_0x3f0d54||client;return _0x5d102a[_0xbea2('0x20')](_0x22f219,_0x3341ed)[_0xbea2('0x21')](function(_0x2b8edf){logger[_0xbea2('0x22')](_0xbea2('0x23'),_0x34911f,'request\x20sent');logger[_0xbea2('0x24')](_0xbea2('0x25'),_0x34911f,_0xbea2('0x26'),JSON[_0xbea2('0x27')](_0x2b8edf));if(_0x2b8edf[_0xbea2('0x28')]){if(_0x2b8edf[_0xbea2('0x28')][_0xbea2('0x29')]===0x1f4){logger[_0xbea2('0x28')](_0xbea2('0x23'),_0x34911f,_0x2b8edf[_0xbea2('0x28')][_0xbea2('0x2a')]);return _0x3b2bed(_0x2b8edf[_0xbea2('0x28')][_0xbea2('0x2a')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x34911f,_0x2b8edf[_0xbea2('0x28')][_0xbea2('0x2a')]);return _0xeebe75(_0x2b8edf['error'][_0xbea2('0x2a')]);}else{logger[_0xbea2('0x22')](_0xbea2('0x23'),_0x34911f,_0xbea2('0x26'));_0xeebe75(_0x2b8edf[_0xbea2('0x2b')]['message']);}})[_0xbea2('0x2c')](function(_0x55c440){logger[_0xbea2('0x28')]('ChatGroup,\x20%s,\x20%s',_0x34911f,_0x55c440);_0x3b2bed(_0x55c440);});});}function respondWithStatusCode(_0x4160fb,_0x9f060c){_0x9f060c=_0x9f060c||0xcc;return function(_0x358bb3){if(_0x358bb3){return _0x4160fb[_0xbea2('0x2d')](_0x9f060c);}return _0x4160fb[_0xbea2('0x2e')](_0x9f060c)[_0xbea2('0x2f')]();};}function respondWithResult(_0x4d05f4,_0x5734cb){_0x5734cb=_0x5734cb||0xc8;return function(_0x496563){if(_0x496563){return _0x4d05f4[_0xbea2('0x2e')](_0x5734cb)[_0xbea2('0x30')](_0x496563);}};}function respondWithFilteredResult(_0x2d2bf1,_0x4fd8b9){return function(_0x994a8f){if(_0x994a8f){var _0x56581d=_0x994a8f[_0xbea2('0x31')],_0x1f1199=_0x4fd8b9['offset'],_0x5662c2=_0x4fd8b9['offset']+_0x4fd8b9['limit'],_0x5786c6;if(_0x5662c2>=_0x56581d){_0x5662c2=_0x56581d;_0x5786c6=0xc8;}else{_0x5786c6=0xce;}_0x2d2bf1[_0xbea2('0x2e')](_0x5786c6);return _0x2d2bf1[_0xbea2('0x32')]('Content-Range',_0x1f1199+'-'+_0x5662c2+'/'+_0x56581d)[_0xbea2('0x30')](_0x994a8f);}return null;};}function patchUpdates(_0xd3cc29){return function(_0x1e48cc){try{jsonpatch[_0xbea2('0x33')](_0x1e48cc,_0xd3cc29,!![]);}catch(_0x16f991){return BPromise[_0xbea2('0x34')](_0x16f991);}return _0x1e48cc[_0xbea2('0x35')]();};}function saveUpdates(_0x174a36,_0x366686){return function(_0x56020d){if(_0x56020d){return _0x56020d[_0xbea2('0x36')](_0x174a36)[_0xbea2('0x21')](function(_0x1daf9a){return _0x1daf9a;});}return null;};}function removeEntity(_0x40b185,_0x57011d){return function(_0x17893a){if(_0x17893a){return _0x17893a['destroy']()[_0xbea2('0x21')](function(){_0x40b185[_0xbea2('0x2e')](0xcc)[_0xbea2('0x2f')]();});}};}function handleEntityNotFound(_0x4e8088,_0x1fb800){return function(_0x12a13c){if(!_0x12a13c){_0x4e8088['sendStatus'](0x194);}return _0x12a13c;};}function handleError(_0x4ff7da,_0x4b7067){_0x4b7067=_0x4b7067||0x1f4;return function(_0x503c83){logger['error'](_0x503c83[_0xbea2('0x37')]);if(_0x503c83['name']){delete _0x503c83[_0xbea2('0x38')];}_0x4ff7da[_0xbea2('0x2e')](_0x4b7067)[_0xbea2('0x39')](_0x503c83);};}exports[_0xbea2('0x3a')]=function(_0x16db73,_0x517290){var _0x2476e2={},_0x5e3e55={},_0x18b973={'count':0x0,'rows':[]};var _0x29b206=_[_0xbea2('0x3b')](db[_0xbea2('0x3c')][_0xbea2('0x3d')],function(_0x1e53dc){return{'name':_0x1e53dc['fieldName'],'type':_0x1e53dc[_0xbea2('0x3e')]['key']};});_0x5e3e55['model']=_['map'](_0x29b206,'name');_0x5e3e55[_0xbea2('0x3f')]=_['keys'](_0x16db73[_0xbea2('0x3f')]);_0x5e3e55[_0xbea2('0x40')]=_['intersection'](_0x5e3e55[_0xbea2('0x41')],_0x5e3e55[_0xbea2('0x3f')]);_0x2476e2[_0xbea2('0x42')]=_[_0xbea2('0x43')](_0x5e3e55[_0xbea2('0x41')],qs[_0xbea2('0x44')](_0x16db73[_0xbea2('0x3f')][_0xbea2('0x44')]));_0x2476e2[_0xbea2('0x42')]=_0x2476e2['attributes']['length']?_0x2476e2['attributes']:_0x5e3e55[_0xbea2('0x41')];if(!_0x16db73['query'][_0xbea2('0x45')]('nolimit')){_0x2476e2[_0xbea2('0x46')]=qs[_0xbea2('0x46')](_0x16db73[_0xbea2('0x3f')][_0xbea2('0x46')]);_0x2476e2[_0xbea2('0x47')]=qs[_0xbea2('0x47')](_0x16db73[_0xbea2('0x3f')][_0xbea2('0x47')]);}_0x2476e2[_0xbea2('0x48')]=qs[_0xbea2('0x49')](_0x16db73[_0xbea2('0x3f')][_0xbea2('0x49')]);_0x2476e2['where']=qs['filters'](_[_0xbea2('0x4a')](_0x16db73[_0xbea2('0x3f')],_0x5e3e55['filters']),_0x29b206);if(_0x16db73[_0xbea2('0x3f')][_0xbea2('0x4b')]){_0x2476e2[_0xbea2('0x4c')]=_[_0xbea2('0x4d')](_0x2476e2['where'],{'$or':_[_0xbea2('0x3b')](_0x29b206,function(_0x554bab){if(_0x554bab[_0xbea2('0x3e')]!=='VIRTUAL'){var _0x13335a={};_0x13335a[_0x554bab[_0xbea2('0x38')]]={'$like':'%'+_0x16db73[_0xbea2('0x3f')][_0xbea2('0x4b')]+'%'};return _0x13335a;}})});}_0x2476e2=_[_0xbea2('0x4d')]({},_0x2476e2,_0x16db73[_0xbea2('0x4e')]);var _0x557309={'where':_0x2476e2[_0xbea2('0x4c')]};return db[_0xbea2('0x3c')][_0xbea2('0x31')](_0x557309)[_0xbea2('0x21')](function(_0x4d0f85){_0x18b973[_0xbea2('0x31')]=_0x4d0f85;if(_0x16db73[_0xbea2('0x3f')][_0xbea2('0x4f')]){_0x2476e2[_0xbea2('0x50')]=[{'all':!![]}];}return db[_0xbea2('0x3c')]['findAll'](_0x2476e2);})[_0xbea2('0x21')](function(_0x520584){_0x18b973[_0xbea2('0x51')]=_0x520584;return _0x18b973;})[_0xbea2('0x21')](respondWithFilteredResult(_0x517290,_0x2476e2))[_0xbea2('0x2c')](handleError(_0x517290,null));};exports[_0xbea2('0x52')]=function(_0x2e0551,_0x59e2e1){var _0x34ec03={'raw':!![],'where':{'id':_0x2e0551[_0xbea2('0x53')]['id']}},_0x3b54ec={};_0x3b54ec[_0xbea2('0x41')]=_[_0xbea2('0x54')](db[_0xbea2('0x3c')][_0xbea2('0x3d')]);_0x3b54ec[_0xbea2('0x3f')]=_[_0xbea2('0x54')](_0x2e0551['query']);_0x3b54ec[_0xbea2('0x40')]=_['intersection'](_0x3b54ec[_0xbea2('0x41')],_0x3b54ec['query']);_0x34ec03[_0xbea2('0x42')]=_['intersection'](_0x3b54ec['model'],qs[_0xbea2('0x44')](_0x2e0551[_0xbea2('0x3f')]['fields']));_0x34ec03[_0xbea2('0x42')]=_0x34ec03[_0xbea2('0x42')][_0xbea2('0x55')]?_0x34ec03[_0xbea2('0x42')]:_0x3b54ec[_0xbea2('0x41')];if(_0x2e0551['query'][_0xbea2('0x4f')]){_0x34ec03['include']=[{'all':!![]}];}_0x34ec03=_[_0xbea2('0x4d')]({},_0x34ec03,_0x2e0551[_0xbea2('0x4e')]);return db[_0xbea2('0x3c')]['find'](_0x34ec03)[_0xbea2('0x21')](handleEntityNotFound(_0x59e2e1,null))[_0xbea2('0x21')](respondWithResult(_0x59e2e1,null))[_0xbea2('0x2c')](handleError(_0x59e2e1,null));};exports[_0xbea2('0x56')]=function(_0x4ecba4,_0x2961c5){return db[_0xbea2('0x3c')]['create'](_0x4ecba4[_0xbea2('0x57')],{})['then'](respondWithResult(_0x2961c5,0xc9))['catch'](handleError(_0x2961c5,null));};exports['update']=function(_0x51e397,_0xdce6dc){if(_0x51e397[_0xbea2('0x57')]['id']){delete _0x51e397[_0xbea2('0x57')]['id'];}return db[_0xbea2('0x3c')][_0xbea2('0x58')]({'where':{'id':_0x51e397[_0xbea2('0x53')]['id']}})[_0xbea2('0x21')](handleEntityNotFound(_0xdce6dc,null))[_0xbea2('0x21')](saveUpdates(_0x51e397[_0xbea2('0x57')],null))[_0xbea2('0x21')](respondWithResult(_0xdce6dc,null))[_0xbea2('0x2c')](handleError(_0xdce6dc,null));};exports[_0xbea2('0x59')]=function(_0x373a7b,_0x353067){return db[_0xbea2('0x3c')][_0xbea2('0x58')]({'where':{'id':_0x373a7b[_0xbea2('0x53')]['id']}})['then'](handleEntityNotFound(_0x353067,null))[_0xbea2('0x21')](removeEntity(_0x353067,null))[_0xbea2('0x2c')](handleError(_0x353067,null));};exports[_0xbea2('0x5a')]=function(_0x347dea,_0x1b4edb){return db[_0xbea2('0x3c')][_0xbea2('0x5a')]()[_0xbea2('0x21')](respondWithResult(_0x1b4edb,null))[_0xbea2('0x2c')](handleError(_0x1b4edb,null));};exports[_0xbea2('0x5b')]=function(_0x4f6822,_0x355070,_0x3b25f4){return db[_0xbea2('0x5c')][_0xbea2('0x31')]({'where':{'ChatGroupId':_0x4f6822[_0xbea2('0x53')]['id'],'ToId':_0x4f6822[_0xbea2('0x5d')]['id'],'read':![]}})[_0xbea2('0x21')](function(_0x54cf40){return{'id':_[_0xbea2('0x5e')](_0x4f6822[_0xbea2('0x53')]['id']),'count':_0x54cf40};})[_0xbea2('0x21')](respondWithResult(_0x355070,null))[_0xbea2('0x2c')](handleError(_0x355070,null));};exports[_0xbea2('0x5f')]=function(_0x16e524,_0x197399,_0x43f699){return db['ChatGroup']['find']({'where':{'id':_0x16e524['params']['id']}})[_0xbea2('0x21')](handleEntityNotFound(_0x197399,null))[_0xbea2('0x21')](function(_0x16142e){if(_0x16142e){return _0x16142e[_0xbea2('0x5f')](_0x16e524[_0xbea2('0x57')][_0xbea2('0x60')],_[_0xbea2('0x61')](_0x16e524[_0xbea2('0x57')],[_0xbea2('0x60'),'id'])||{});}})[_0xbea2('0x21')](respondWithResult(_0x197399,null))[_0xbea2('0x2c')](handleError(_0x197399,null));};exports[_0xbea2('0x62')]=function(_0x3e2788,_0x4f8b2a,_0x5e15f0){var _0x319e9f={};var _0x3d0575={};var _0x456fd5;var _0x15ed72;return db[_0xbea2('0x3c')]['findOne']({'where':{'id':_0x3e2788[_0xbea2('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f8b2a,null))[_0xbea2('0x21')](function(_0xdbb94b){if(_0xdbb94b){_0x456fd5=_0xdbb94b;_0x3d0575['model']=_['keys'](db[_0xbea2('0x63')][_0xbea2('0x3d')]);_0x3d0575[_0xbea2('0x3f')]=_['keys'](_0x3e2788[_0xbea2('0x3f')]);_0x3d0575[_0xbea2('0x40')]=_[_0xbea2('0x43')](_0x3d0575[_0xbea2('0x41')],_0x3d0575[_0xbea2('0x3f')]);_0x319e9f[_0xbea2('0x42')]=_[_0xbea2('0x43')](_0x3d0575[_0xbea2('0x41')],qs[_0xbea2('0x44')](_0x3e2788[_0xbea2('0x3f')][_0xbea2('0x44')]));_0x319e9f[_0xbea2('0x42')]=_0x319e9f[_0xbea2('0x42')][_0xbea2('0x55')]?_0x319e9f[_0xbea2('0x42')]:_0x3d0575[_0xbea2('0x41')];_0x319e9f[_0xbea2('0x48')]=qs['sort'](_0x3e2788[_0xbea2('0x3f')][_0xbea2('0x49')]);_0x319e9f[_0xbea2('0x4c')]=qs['filters'](_['pick'](_0x3e2788['query'],_0x3d0575[_0xbea2('0x40')]));if(_0x3e2788['query'][_0xbea2('0x4b')]){_0x319e9f['where']=_[_0xbea2('0x4d')](_0x319e9f[_0xbea2('0x4c')],{'$or':_['map'](_0x319e9f[_0xbea2('0x42')],function(_0x58fc94){var _0x1c1dba={};_0x1c1dba[_0x58fc94]={'$like':'%'+_0x3e2788[_0xbea2('0x3f')][_0xbea2('0x4b')]+'%'};return _0x1c1dba;})});}_0x319e9f=_[_0xbea2('0x4d')]({},_0x319e9f,_0x3e2788[_0xbea2('0x4e')]);return _0x456fd5['getMembers'](_0x319e9f);}})['then'](function(_0x2d758f){if(_0x2d758f){_0x15ed72=_0x2d758f[_0xbea2('0x55')];if(!_0x3e2788[_0xbea2('0x3f')]['hasOwnProperty']('nolimit')){_0x319e9f['limit']=qs[_0xbea2('0x46')](_0x3e2788[_0xbea2('0x3f')]['limit']);_0x319e9f[_0xbea2('0x47')]=qs['offset'](_0x3e2788[_0xbea2('0x3f')][_0xbea2('0x47')]);}return _0x456fd5[_0xbea2('0x62')](_0x319e9f);}})['then'](function(_0x975d34){if(_0x975d34){return _0x975d34?{'count':_0x15ed72,'rows':_0x975d34}:null;}})['then'](respondWithResult(_0x4f8b2a,null))[_0xbea2('0x2c')](handleError(_0x4f8b2a,null));};exports[_0xbea2('0x64')]=function(_0x4f948f,_0x3d3436,_0x1b65a5){return db[_0xbea2('0x3c')][_0xbea2('0x58')]({'where':{'id':_0x4f948f[_0xbea2('0x53')]['id']}})[_0xbea2('0x21')](handleEntityNotFound(_0x3d3436,null))[_0xbea2('0x21')](function(_0x3e8218){if(_0x3e8218){return _0x3e8218[_0xbea2('0x64')](_0x4f948f[_0xbea2('0x3f')][_0xbea2('0x60')]);}})[_0xbea2('0x21')](respondWithStatusCode(_0x3d3436,null))['catch'](handleError(_0x3d3436,null));};exports[_0xbea2('0x65')]=function(_0x3ed6b5,_0x2952ad,_0x145c52){if(_0x3ed6b5[_0xbea2('0x57')]['id']){delete _0x3ed6b5[_0xbea2('0x57')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x3ed6b5[_0xbea2('0x53')]['id']}})[_0xbea2('0x21')](handleEntityNotFound(_0x2952ad,null))['then'](function(_0x40e850){if(_0x40e850){_0x3ed6b5[_0xbea2('0x57')][_0xbea2('0x66')]=_0x40e850['id'];return db[_0xbea2('0x5c')][_0xbea2('0x56')](_0x3ed6b5[_0xbea2('0x57')]);}})[_0xbea2('0x21')](respondWithResult(_0x2952ad,null))[_0xbea2('0x2c')](handleError(_0x2952ad,null));};exports[_0xbea2('0x67')]=function(_0x307100,_0x4f10cf,_0x28d9ea){var _0x418986={};var _0x1b90ff={};var _0x250eb3;var _0x61fd84;return db['ChatGroup'][_0xbea2('0x68')]({'where':{'id':_0x307100[_0xbea2('0x53')]['id']}})[_0xbea2('0x21')](handleEntityNotFound(_0x4f10cf,null))[_0xbea2('0x21')](function(_0x4f44e2){if(_0x4f44e2){_0x250eb3=_0x4f44e2;_0x1b90ff[_0xbea2('0x41')]=_[_0xbea2('0x54')](db[_0xbea2('0x5c')][_0xbea2('0x3d')]);_0x1b90ff[_0xbea2('0x3f')]=_['keys'](_0x307100[_0xbea2('0x3f')]);_0x1b90ff[_0xbea2('0x40')]=_[_0xbea2('0x43')](_0x1b90ff[_0xbea2('0x41')],_0x1b90ff[_0xbea2('0x3f')]);_0x418986[_0xbea2('0x42')]=_['intersection'](_0x1b90ff['model'],qs['fields'](_0x307100[_0xbea2('0x3f')]['fields']));_0x418986['attributes']=_0x418986['attributes'][_0xbea2('0x55')]?_0x418986[_0xbea2('0x42')]:_0x1b90ff[_0xbea2('0x41')];_0x418986['order']=qs['sort'](_0x307100[_0xbea2('0x3f')][_0xbea2('0x49')]);_0x418986['where']=qs[_0xbea2('0x40')](_['pick'](_0x307100[_0xbea2('0x3f')],_0x1b90ff[_0xbea2('0x40')]));if(_0x307100[_0xbea2('0x3f')]['filter']){_0x418986[_0xbea2('0x4c')]=_[_0xbea2('0x4d')](_0x418986[_0xbea2('0x4c')],{'$or':_[_0xbea2('0x3b')](_0x418986[_0xbea2('0x42')],function(_0xcb90ab){var _0x45666d={};_0x45666d[_0xcb90ab]={'$like':'%'+_0x307100[_0xbea2('0x3f')][_0xbea2('0x4b')]+'%'};return _0x45666d;})});}if(_0x307100['query'][_0xbea2('0x69')]){var _0x5e2ac1=_0x307100[_0xbea2('0x3f')]['$gte'][_0xbea2('0x6a')](',');var _0x28e96b={};_0x28e96b[_0x5e2ac1[0x0]]={'$gte':moment(_0x5e2ac1[0x1])[_0xbea2('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x418986['where']=_[_0xbea2('0x4d')](_0x418986['where'],_0x28e96b);}_0x418986=_['merge']({},_0x418986,_0x307100[_0xbea2('0x4e')]);return _0x250eb3['getMessages'](_0x418986);}})['then'](function(_0x44094f){if(_0x44094f){_0x61fd84=_0x44094f[_0xbea2('0x55')];if(!_0x307100['query']['hasOwnProperty'](_0xbea2('0x6c'))){_0x418986[_0xbea2('0x46')]=qs[_0xbea2('0x46')](_0x307100[_0xbea2('0x3f')][_0xbea2('0x46')]);_0x418986[_0xbea2('0x47')]=qs[_0xbea2('0x47')](_0x307100[_0xbea2('0x3f')]['offset']);}return _0x250eb3[_0xbea2('0x67')](_0x418986);}})['then'](function(_0x4d5098){if(_0x4d5098){return _0x4d5098?{'count':_0x61fd84,'rows':_0x4d5098}:null;}})[_0xbea2('0x21')](respondWithResult(_0x4f10cf,null))[_0xbea2('0x2c')](handleError(_0x4f10cf,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index caaca22..bd81e99 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 _0x2032=['exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x2032,0xd9));var _0x2203=function(_0x104085,_0x317ed0){_0x104085=_0x104085-0x0;var _0x30b787=_0x2032[_0x104085];return _0x30b787;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];ChatGroup[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x153009,_0x2b5fba){var _0x1e2702=function(_0x5e037d){while(--_0x5e037d){_0x153009['push'](_0x153009['shift']());}};_0x1e2702(++_0x2b5fba);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65f6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){ChatGroupEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);ChatGroupEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 750136b..2445be3 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 _0x90b1=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x47468e,_0x591016){var _0x100d42=function(_0x5030f0){while(--_0x5030f0){_0x47468e['push'](_0x47468e['shift']());}};_0x100d42(++_0x591016);}(_0x90b1,0x1bb));var _0x190b=function(_0x2236dc,_0x43c7f9){_0x2236dc=_0x2236dc-0x0;var _0x20583f=_0x90b1[_0x2236dc];return _0x20583f;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./chatGroup.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafdd=['request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a84fb,_0x59b8e4){var _0x7feddb=function(_0x2ad51d){while(--_0x2ad51d){_0x4a84fb['push'](_0x4a84fb['shift']());}};_0x7feddb(++_0x59b8e4);}(_0xafdd,0x19a));var _0xdafd=function(_0x363974,_0x34a5ef){_0x363974=_0x363974-0x0;var _0x524fdc=_0xafdd[_0x363974];return _0x524fdc;};'use strict';var _=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var logger=require(_0xdafd('0x2'))(_0xdafd('0x3'));var moment=require(_0xdafd('0x4'));var BPromise=require(_0xdafd('0x5'));var rp=require(_0xdafd('0x6'));var fs=require('fs');var path=require(_0xdafd('0x7'));var rimraf=require('rimraf');var config=require(_0xdafd('0x8'));var attributes=require(_0xdafd('0x9'));module[_0xdafd('0xa')]=function(_0x37f05a,_0xfa4ad6){return _0x37f05a[_0xdafd('0xb')](_0xdafd('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 7754e18..c13ca53 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 _0x7f18=['ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','info','ChatGroup,\x20%s,\x20%s','debug'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x7f18,0x7d));var _0x87f1=function(_0xdbe2de,_0x3bdc5a){_0xdbe2de=_0xdbe2de-0x0;var _0x2facd7=_0x7f18[_0xdbe2de];return _0x2facd7;};'use strict';var _=require(_0x87f1('0x0'));var util=require(_0x87f1('0x1'));var moment=require('moment');var BPromise=require(_0x87f1('0x2'));var rs=require(_0x87f1('0x3'));var fs=require('fs');var Redis=require(_0x87f1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x87f1('0x5'));var logger=require(_0x87f1('0x6'))(_0x87f1('0x7'));var config=require(_0x87f1('0x8'));var jayson=require(_0x87f1('0x9'));var client=jayson[_0x87f1('0xa')][_0x87f1('0xb')]({'port':0x232a});config[_0x87f1('0xc')]=_[_0x87f1('0xd')](config[_0x87f1('0xc')],{'host':_0x87f1('0xe'),'port':0x18eb});var socket=require(_0x87f1('0xf'))(new Redis(config[_0x87f1('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x45d5a6,_0x55f348,_0x37df5b){return new BPromise(function(_0x3461dc,_0x35dac2){return client['request'](_0x45d5a6,_0x37df5b)['then'](function(_0x30e899){logger[_0x87f1('0x10')](_0x87f1('0x11'),_0x55f348,'request\x20sent');logger[_0x87f1('0x12')](_0x87f1('0x13'),_0x55f348,_0x87f1('0x14'),JSON['stringify'](_0x30e899));if(_0x30e899[_0x87f1('0x15')]){if(_0x30e899[_0x87f1('0x15')]['code']===0x1f4){logger[_0x87f1('0x15')](_0x87f1('0x11'),_0x55f348,_0x30e899['error'][_0x87f1('0x16')]);return _0x35dac2(_0x30e899[_0x87f1('0x15')][_0x87f1('0x16')]);}logger[_0x87f1('0x15')](_0x87f1('0x11'),_0x55f348,_0x30e899['error'][_0x87f1('0x16')]);return _0x3461dc(_0x30e899[_0x87f1('0x15')][_0x87f1('0x16')]);}else{logger[_0x87f1('0x10')](_0x87f1('0x11'),_0x55f348,'request\x20sent');_0x3461dc(_0x30e899['result']['message']);}})[_0x87f1('0x17')](function(_0x698818){logger['error'](_0x87f1('0x11'),_0x55f348,_0x698818);_0x35dac2(_0x698818);});});} \ No newline at end of file +var _0x7f78=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent'];(function(_0x2b568f,_0x2071a0){var _0xd385f=function(_0x2ab9d4){while(--_0x2ab9d4){_0x2b568f['push'](_0x2b568f['shift']());}};_0xd385f(++_0x2071a0);}(_0x7f78,0x6a));var _0x87f7=function(_0x4e0de3,_0x306197){_0x4e0de3=_0x4e0de3-0x0;var _0x377965=_0x7f78[_0x4e0de3];return _0x377965;};'use strict';var _=require(_0x87f7('0x0'));var util=require('util');var moment=require(_0x87f7('0x1'));var BPromise=require(_0x87f7('0x2'));var rs=require(_0x87f7('0x3'));var fs=require('fs');var Redis=require(_0x87f7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x87f7('0x5'));var config=require(_0x87f7('0x6'));var jayson=require(_0x87f7('0x7'));var client=jayson[_0x87f7('0x8')][_0x87f7('0x9')]({'port':0x232a});config[_0x87f7('0xa')]=_[_0x87f7('0xb')](config[_0x87f7('0xa')],{'host':_0x87f7('0xc'),'port':0x18eb});var socket=require(_0x87f7('0xd'))(new Redis(config[_0x87f7('0xa')]));require(_0x87f7('0xe'))[_0x87f7('0xf')](socket);function respondWithRpcPromise(_0xf5cc14,_0x1415b9,_0x484327){return new BPromise(function(_0x1e1c90,_0x3febda){return client['request'](_0xf5cc14,_0x484327)['then'](function(_0x3d304c){logger[_0x87f7('0x10')](_0x87f7('0x11'),_0x1415b9,_0x87f7('0x12'));logger[_0x87f7('0x13')](_0x87f7('0x14'),_0x1415b9,'request\x20sent',JSON['stringify'](_0x3d304c));if(_0x3d304c[_0x87f7('0x15')]){if(_0x3d304c[_0x87f7('0x15')][_0x87f7('0x16')]===0x1f4){logger['error'](_0x87f7('0x11'),_0x1415b9,_0x3d304c[_0x87f7('0x15')][_0x87f7('0x17')]);return _0x3febda(_0x3d304c[_0x87f7('0x15')][_0x87f7('0x17')]);}logger['error'](_0x87f7('0x11'),_0x1415b9,_0x3d304c['error'][_0x87f7('0x17')]);return _0x1e1c90(_0x3d304c[_0x87f7('0x15')][_0x87f7('0x17')]);}else{logger[_0x87f7('0x10')]('ChatGroup,\x20%s,\x20%s',_0x1415b9,_0x87f7('0x12'));_0x1e1c90(_0x3d304c['result'][_0x87f7('0x17')]);}})[_0x87f7('0x18')](function(_0x13d60){logger[_0x87f7('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1415b9,_0x13d60);_0x3febda(_0x13d60);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9af4012..88f16ba 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 _0xf070=['emit','removeListener','register','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x18daa2,_0x5600fe){var _0x515b87=function(_0x3b18a9){while(--_0x3b18a9){_0x18daa2['push'](_0x18daa2['shift']());}};_0x515b87(++_0x5600fe);}(_0xf070,0x1a5));var _0x0f07=function(_0x262e7e,_0x4a399f){_0x262e7e=_0x262e7e-0x0;var _0x628e1a=_0xf070[_0x262e7e];return _0x628e1a;};'use strict';var ChatGroupEvents=require(_0x0f07('0x0'));var events=[_0x0f07('0x1'),'remove',_0x0f07('0x2')];function createListener(_0x116fd9,_0xb62d27){return function(_0xb85b11){_0xb62d27[_0x0f07('0x3')](_0x116fd9,_0xb85b11);};}function removeListener(_0xdd16bc,_0x16f099){return function(){ChatGroupEvents[_0x0f07('0x4')](_0xdd16bc,_0x16f099);};}exports[_0x0f07('0x5')]=function(_0x4ad134){for(var _0x5bab96=0x0,_0x82fba8=events[_0x0f07('0x6')];_0x5bab96<_0x82fba8;_0x5bab96++){var _0x175e17=events[_0x5bab96];var _0x1f1aa1=createListener(_0x0f07('0x7')+_0x175e17,_0x4ad134);ChatGroupEvents['on'](_0x175e17,_0x1f1aa1);}}; \ No newline at end of file +var _0xe830=['remove','emit','register','length','chatGroup:','./chatGroup.events','save'];(function(_0x2a096e,_0x1653cd){var _0x4eab9f=function(_0x31bee5){while(--_0x31bee5){_0x2a096e['push'](_0x2a096e['shift']());}};_0x4eab9f(++_0x1653cd);}(_0xe830,0xd7));var _0x0e83=function(_0x11c54e,_0x37edfe){_0x11c54e=_0x11c54e-0x0;var _0x46ff45=_0xe830[_0x11c54e];return _0x46ff45;};'use strict';var ChatGroupEvents=require(_0x0e83('0x0'));var events=[_0x0e83('0x1'),_0x0e83('0x2'),'update'];function createListener(_0x2acac6,_0x2be2d3){return function(_0x54185f){_0x2be2d3[_0x0e83('0x3')](_0x2acac6,_0x54185f);};}function removeListener(_0x520a7d,_0x14f2d5){return function(){ChatGroupEvents['removeListener'](_0x520a7d,_0x14f2d5);};}exports[_0x0e83('0x4')]=function(_0x3cefa7){for(var _0x26a77d=0x0,_0xc9adc1=events[_0x0e83('0x5')];_0x26a77d<_0xc9adc1;_0x26a77d++){var _0x57f083=events[_0x26a77d];var _0x313ec6=createListener(_0x0e83('0x6')+_0x57f083,_0x3cefa7);ChatGroupEvents['on'](_0x57f083,_0x313ec6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 86e5992..9535589 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 _0x18bb=['../../config/environment','./chatGroup.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','destroy','delete','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x18bb,0xe9));var _0xb18b=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x18bb[_0x3cea78];return _0x33b66b;};'use strict';var multer=require(_0xb18b('0x0'));var util=require(_0xb18b('0x1'));var path=require(_0xb18b('0x2'));var timeout=require(_0xb18b('0x3'));var express=require(_0xb18b('0x4'));var router=express[_0xb18b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb18b('0x6'));var config=require(_0xb18b('0x7'));var controller=require(_0xb18b('0x8'));router[_0xb18b('0x9')]('/',auth['isAuthenticated'](),controller[_0xb18b('0xa')]);router[_0xb18b('0x9')](_0xb18b('0xb'),auth[_0xb18b('0xc')](),controller[_0xb18b('0xd')]);router['get'](_0xb18b('0xe'),auth['isAuthenticated'](),controller[_0xb18b('0xf')]);router[_0xb18b('0x9')](_0xb18b('0x10'),auth[_0xb18b('0xc')](),controller[_0xb18b('0x11')]);router['get']('/:id/members',auth[_0xb18b('0xc')](),controller[_0xb18b('0x12')]);router[_0xb18b('0x9')](_0xb18b('0x13'),auth[_0xb18b('0xc')](),controller[_0xb18b('0x14')]);router[_0xb18b('0x15')]('/',auth[_0xb18b('0xc')](),controller[_0xb18b('0x16')]);router[_0xb18b('0x15')]('/:id/members',auth[_0xb18b('0xc')](),controller['addMembers']);router[_0xb18b('0x15')](_0xb18b('0x13'),auth[_0xb18b('0xc')](),controller[_0xb18b('0x17')]);router[_0xb18b('0x18')]('/:id',auth[_0xb18b('0xc')](),controller[_0xb18b('0x19')]);router['delete'](_0xb18b('0xe'),auth[_0xb18b('0xc')](),controller[_0xb18b('0x1a')]);router[_0xb18b('0x1b')]('/:id/members',auth[_0xb18b('0xc')](),controller[_0xb18b('0x1c')]);module[_0xb18b('0x1d')]=router; \ No newline at end of file +var _0x0f8f=['destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','delete'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x0f8f,0x1d3));var _0xf0f8=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0x0f8f[_0x3f25b2];return _0xd8caeb;};'use strict';var multer=require('multer');var util=require(_0xf0f8('0x0'));var path=require(_0xf0f8('0x1'));var timeout=require(_0xf0f8('0x2'));var express=require(_0xf0f8('0x3'));var router=express[_0xf0f8('0x4')]();var auth=require(_0xf0f8('0x5'));var interaction=require(_0xf0f8('0x6'));var config=require('../../config/environment');var controller=require(_0xf0f8('0x7'));router[_0xf0f8('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf0f8('0x9'),auth[_0xf0f8('0xa')](),controller[_0xf0f8('0xb')]);router[_0xf0f8('0x8')](_0xf0f8('0xc'),auth[_0xf0f8('0xa')](),controller[_0xf0f8('0xd')]);router[_0xf0f8('0x8')](_0xf0f8('0xe'),auth['isAuthenticated'](),controller[_0xf0f8('0xf')]);router[_0xf0f8('0x8')](_0xf0f8('0x10'),auth[_0xf0f8('0xa')](),controller[_0xf0f8('0x11')]);router[_0xf0f8('0x8')](_0xf0f8('0x12'),auth[_0xf0f8('0xa')](),controller[_0xf0f8('0x13')]);router[_0xf0f8('0x14')]('/',auth[_0xf0f8('0xa')](),controller[_0xf0f8('0x15')]);router[_0xf0f8('0x14')](_0xf0f8('0x10'),auth[_0xf0f8('0xa')](),controller['addMembers']);router[_0xf0f8('0x14')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf0f8('0x16')]);router[_0xf0f8('0x17')](_0xf0f8('0xc'),auth[_0xf0f8('0xa')](),controller[_0xf0f8('0x18')]);router[_0xf0f8('0x19')]('/:id',auth[_0xf0f8('0xa')](),controller[_0xf0f8('0x1a')]);router[_0xf0f8('0x19')](_0xf0f8('0x10'),auth[_0xf0f8('0xa')](),controller[_0xf0f8('0x1b')]);module[_0xf0f8('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index fa6e80a..6247def 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 _0x3e9c=['INTEGER','ENUM','star','TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN'];(function(_0x435f73,_0x2d1d9a){var _0x3d2529=function(_0x5000f1){while(--_0x5000f1){_0x435f73['push'](_0x435f73['shift']());}};_0x3d2529(++_0x2d1d9a);}(_0x3e9c,0xfa));var _0xc3e9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3e9c[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xc3e9('0x0'));module[_0xc3e9('0x1')]={'closed':{'type':Sequelize[_0xc3e9('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xc3e9('0x3')]},'ratingType':{'type':Sequelize[_0xc3e9('0x4')](_0xc3e9('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xc3e9('0x6')]},'pathTranscript':{'type':Sequelize[_0xc3e9('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xc3e9('0x7')]},'disposition':{'type':Sequelize[_0xc3e9('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xc3e9('0x8')]},'browserVersion':{'type':Sequelize[_0xc3e9('0x8')]},'osName':{'type':Sequelize[_0xc3e9('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xc3e9('0x8')]},'deviceVendor':{'type':Sequelize[_0xc3e9('0x8')]},'deviceType':{'type':Sequelize[_0xc3e9('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xc3e9('0x8')]},'formData':{'type':Sequelize[_0xc3e9('0x6')](_0xc3e9('0x9'))},'read1stAt':{'type':Sequelize[_0xc3e9('0x7')]},'lastMsgAt':{'type':Sequelize[_0xc3e9('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xc3e9('0x4')]('in',_0xc3e9('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xc3e9('0x8')]},'customerPort':{'type':Sequelize[_0xc3e9('0x8')]},'vidaooSessionId':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6bd7=['BOOLEAN','INTEGER','star','TEXT','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x503d2f,_0x4fdc02){var _0x36bbfb=function(_0x462be2){while(--_0x462be2){_0x503d2f['push'](_0x503d2f['shift']());}};_0x36bbfb(++_0x4fdc02);}(_0x6bd7,0xa8));var _0x76bd=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x6bd7[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x76bd('0x0'));module[_0x76bd('0x1')]={'closed':{'type':Sequelize[_0x76bd('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x76bd('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':_0x76bd('0x4')},'ratingMessage':{'type':Sequelize[_0x76bd('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x76bd('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x76bd('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x76bd('0x6')]},'osName':{'type':Sequelize[_0x76bd('0x6')]},'osVersion':{'type':Sequelize[_0x76bd('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x76bd('0x5')]},'customerIp':{'type':Sequelize[_0x76bd('0x6')]},'formData':{'type':Sequelize[_0x76bd('0x5')]('long')},'read1stAt':{'type':Sequelize[_0x76bd('0x7')]},'lastMsgAt':{'type':Sequelize[_0x76bd('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x76bd('0x8')]('in',_0x76bd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x76bd('0x6')]},'customerPort':{'type':Sequelize[_0x76bd('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x76bd('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 3eb4bdf..c83f43a 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 _0x68b3=['text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','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?','group','i.id','Sequelize','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','toString','merge','Account.mandatoryDisposition','c.firstName','c.email','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','sequelize','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','rawAttributes','includeAll','create','update','describe','createVidaooSession','params','findOne','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','download','join','root','server/files/attachments/','close','server/files/chat/upload/','transcript-%s.txt','now','Messages','ChatWebsite','CmContact','format','agentAlias','System','customer','Visitor','website_alias','%s%d','agent_alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','email','mailTranscript','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','getMyMessages','include','includeAgent','alias','setTags','spread','findAll','chatInteractionTags:save','removeTags','files','server','transcript-%d-%s.zip','firstName','lastName','attachments','Account','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','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','Owner','N.A.','closedAt','disposition','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.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~!@#$%^&-_=+[{]}.','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','stack','name','send','Users','map','Tags','TagIds','split','forEach','push','index','ChatInteraction','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','a.id\x20=\x20i.ChatWebsiteId','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','$substring','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x68b3,0x1d8));var _0x368b=function(_0x5cb434,_0x1e7784){_0x5cb434=_0x5cb434-0x0;var _0x2fb19e=_0x68b3[_0x5cb434];return _0x2fb19e;};'use strict';var pdf=require(_0x368b('0x0'));var emlformat=require(_0x368b('0x1'));var rimraf=require(_0x368b('0x2'));var zipdir=require(_0x368b('0x3'));var jsonpatch=require(_0x368b('0x4'));var rp=require('request-promise');var moment=require(_0x368b('0x5'));var BPromise=require(_0x368b('0x6'));var Mustache=require(_0x368b('0x7'));var util=require(_0x368b('0x8'));var path=require('path');var sox=require(_0x368b('0x9'));var csv=require(_0x368b('0xa'));var ejs=require(_0x368b('0xb'));var fs=require('fs');var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0xa'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var db=require(_0x368b('0x19'))['db'];config[_0x368b('0x1a')]=_['defaults'](config[_0x368b('0x1a')],{'host':_0x368b('0x1b'),'port':0x18eb});var socket=require(_0x368b('0x1c'))(new Redis(config[_0x368b('0x1a')]));require(_0x368b('0x1d'))['register'](socket);var jayson=require(_0x368b('0x1e'));var client=jayson[_0x368b('0x1f')]['http']({'port':0x232b});var client9004=jayson[_0x368b('0x1f')][_0x368b('0x20')]({'port':0x232c});function checkPasswordPattern(_0x30c245,_0x515350,_0x220cd5){if(_0x220cd5){var _0x392376=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x392376[_0x368b('0x21')](_0x515350)){return _0x30c245;}else{throw new db['Sequelize'][(_0x368b('0x22'))](_0x368b('0x23'));}}else{return _0x30c245;}}function respondWithRpcPromise(_0x1c2956,_0x540f57,_0x5d543e,_0x3e2e9f){return new BPromise(function(_0x27d2a0,_0x2c3cec){var _0x1e632a=_0x3e2e9f||client;return _0x1e632a[_0x368b('0x24')](_0x1c2956,_0x5d543e)['then'](function(_0x26447c){logger[_0x368b('0x25')](_0x368b('0x26'),_0x540f57,_0x368b('0x27'));logger[_0x368b('0x28')](_0x368b('0x29'),_0x540f57,_0x368b('0x27'),JSON[_0x368b('0x2a')](_0x26447c));if(_0x26447c['error']){if(_0x26447c[_0x368b('0x2b')][_0x368b('0x2c')]===0x1f4){logger[_0x368b('0x2b')](_0x368b('0x26'),_0x540f57,_0x26447c[_0x368b('0x2b')]['message']);return _0x2c3cec(_0x26447c[_0x368b('0x2b')][_0x368b('0x2d')]);}logger[_0x368b('0x2b')](_0x368b('0x26'),_0x540f57,_0x26447c[_0x368b('0x2b')][_0x368b('0x2d')]);return _0x27d2a0(_0x26447c[_0x368b('0x2b')][_0x368b('0x2d')]);}else{logger[_0x368b('0x25')](_0x368b('0x26'),_0x540f57,_0x368b('0x27'));_0x27d2a0(_0x26447c[_0x368b('0x2e')][_0x368b('0x2d')]);}})[_0x368b('0x2f')](function(_0x4636f4){logger[_0x368b('0x2b')](_0x368b('0x26'),_0x540f57,_0x4636f4);_0x2c3cec(_0x4636f4);});});}function respondWithStatusCode(_0x9f192e,_0x39ef94){_0x39ef94=_0x39ef94||0xcc;return function(_0x1e0e46){if(_0x1e0e46){return _0x9f192e[_0x368b('0x30')](_0x39ef94);}return _0x9f192e[_0x368b('0x31')](_0x39ef94)[_0x368b('0x32')]();};}function respondWithResult(_0x3c80b5,_0x5db0b4){_0x5db0b4=_0x5db0b4||0xc8;return function(_0x4af77a){if(_0x4af77a){return _0x3c80b5[_0x368b('0x31')](_0x5db0b4)[_0x368b('0x33')](_0x4af77a);}};}function respondWithFilteredResult(_0x3d1ceb,_0x152048){return function(_0x5d6ebf){if(_0x5d6ebf){var _0x12ae59=_0x5d6ebf[_0x368b('0x34')],_0x1f3ed3=_0x152048['offset'],_0x3699fe=_0x152048[_0x368b('0x35')]+_0x152048[_0x368b('0x36')],_0x1c68ca;if(_0x3699fe>=_0x12ae59){_0x3699fe=_0x12ae59;_0x1c68ca=0xc8;}else{_0x1c68ca=0xce;}_0x3d1ceb[_0x368b('0x31')](_0x1c68ca);return _0x3d1ceb[_0x368b('0x37')]('Content-Range',_0x1f3ed3+'-'+_0x3699fe+'/'+_0x12ae59)['json'](_0x5d6ebf);}return null;};}function patchUpdates(_0x5e98ac){return function(_0x152142){try{jsonpatch[_0x368b('0x38')](_0x152142,_0x5e98ac,!![]);}catch(_0x46e01c){return BPromise[_0x368b('0x39')](_0x46e01c);}return _0x152142[_0x368b('0x3a')]();};}function saveUpdates(_0x5e9895,_0xfade29){return function(_0x50ae22){if(_0x50ae22){return _0x50ae22['update'](_0x5e9895)[_0x368b('0x3b')](function(_0x1a8908){return _0x1a8908;});}return null;};}function removeEntity(_0x52b50b,_0x24ea25){return function(_0x242f03){if(_0x242f03){return _0x242f03['destroy']()[_0x368b('0x3b')](function(){_0x52b50b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51b313,_0xe4994d){return function(_0x4d6f22){if(!_0x4d6f22){_0x51b313[_0x368b('0x30')](0x194);}return _0x4d6f22;};}function handleError(_0x1ad002,_0x3b00fe){_0x3b00fe=_0x3b00fe||0x1f4;return function(_0xd0f23f){logger[_0x368b('0x2b')](_0xd0f23f[_0x368b('0x3c')]);if(_0xd0f23f[_0x368b('0x3d')]){delete _0xd0f23f[_0x368b('0x3d')];}_0x1ad002['status'](_0x3b00fe)[_0x368b('0x3e')](_0xd0f23f);};}function getInteractionUsers(_0x1f60ea,_0x484cc6){return new BPromise(function(_0x221210,_0x12fd35){try{if(_0x484cc6[_0x1f60ea['id']]){_0x1f60ea[_0x368b('0x3f')]=_[_0x368b('0x40')](_0x484cc6[_0x1f60ea['id']],function(_0x248b2b){return{'id':_0x248b2b['id'],'fullname':_0x248b2b['fullname']};});}}catch(_0x24b993){_0x12fd35(_0x24b993);}_0x221210(_0x1f60ea);});}function getInteractionTags(_0x4287c6,_0x2a7f70){return new BPromise(function(_0x3e0210,_0x4e44d0){try{if(_0x4287c6['TagIds']){_0x4287c6[_0x368b('0x41')]=[];_0x4287c6[_0x368b('0x42')][_0x368b('0x43')](',')[_0x368b('0x44')](function(_0x248487){_0x4287c6[_0x368b('0x41')][_0x368b('0x45')](_0x2a7f70[_0x248487]);});}delete _0x4287c6[_0x368b('0x42')];}catch(_0x3a5254){_0x4e44d0(_0x3a5254);}_0x3e0210(_0x4287c6);});}function updateChatInteraction(_0x1c30ff,_0x5dde7f,_0x87ede1){return new BPromise(function(_0x179e46,_0x5a3ff1){return getInteractionUsers(_0x1c30ff,_0x87ede1)[_0x368b('0x3b')](function(_0x1ea901){return getInteractionTags(_0x1ea901,_0x5dde7f);})[_0x368b('0x3b')](function(_0x360a27){_0x179e46(_0x360a27);})['catch'](function(_0x490eb6){_0x5a3ff1(_0x490eb6);});});}exports[_0x368b('0x46')]=function(_0x4a0275,_0x91bb0b){var _0x1e8891={},_0x25beec={},_0x575e58={'count':0x0,'rows':[]};var _0x46a72f=_[_0x368b('0x40')](db[_0x368b('0x47')]['rawAttributes'],function(_0x4c9373){return{'name':_0x4c9373[_0x368b('0x48')],'type':_0x4c9373[_0x368b('0x49')]['key']};});_0x25beec[_0x368b('0x4a')]=_[_0x368b('0x40')](_0x46a72f,_0x368b('0x3d'));_0x25beec[_0x368b('0x4b')]=_[_0x368b('0x4c')](_0x4a0275[_0x368b('0x4b')]);_0x25beec[_0x368b('0x4d')]=_[_0x368b('0x4e')](_0x25beec[_0x368b('0x4a')],_0x25beec[_0x368b('0x4b')]);_0x1e8891[_0x368b('0x4f')]=_[_0x368b('0x4e')](_0x25beec[_0x368b('0x4a')],qs['fields'](_0x4a0275[_0x368b('0x4b')][_0x368b('0x50')]));_0x1e8891[_0x368b('0x4f')]=_0x1e8891[_0x368b('0x4f')][_0x368b('0x51')]?_0x1e8891['attributes']:_0x25beec['model'];if(!_0x4a0275[_0x368b('0x4b')][_0x368b('0x52')](_0x368b('0x53'))){_0x1e8891['limit']=qs[_0x368b('0x36')](_0x4a0275[_0x368b('0x4b')][_0x368b('0x36')]);_0x1e8891[_0x368b('0x35')]=qs[_0x368b('0x35')](_0x4a0275[_0x368b('0x4b')][_0x368b('0x35')]);}_0x1e8891[_0x368b('0x54')]=qs[_0x368b('0x55')](_0x4a0275[_0x368b('0x4b')]['sort']);_0x1e8891[_0x368b('0x56')]=qs['filters'](_[_0x368b('0x57')](_0x4a0275['query'],_0x25beec[_0x368b('0x4d')]),_0x46a72f);var _0x4b2d5f=[];var _0x456f19=squel[_0x368b('0x58')]()[_0x368b('0x59')]('id')[_0x368b('0x59')]('name')[_0x368b('0x59')](_0x368b('0x5a'))[_0x368b('0x5b')](_0x368b('0x5c'));var _0x424aa1=squel[_0x368b('0x58')]()[_0x368b('0x59')](_0x368b('0x5d'))[_0x368b('0x59')]('u.fullname')[_0x368b('0x59')](_0x368b('0x5e'))[_0x368b('0x5b')](_0x368b('0x5f'),'ui')[_0x368b('0x60')]('users','u',_0x368b('0x61'));var _0x1ddb6e=squel[_0x368b('0x58')]()[_0x368b('0x5b')](_0x368b('0x62'),'i')[_0x368b('0x60')](_0x368b('0x63'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x368b('0x60')]('chat_websites','a',_0x368b('0x64'))[_0x368b('0x60')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x368b('0x60')]('chat_interaction_has_tags','it',_0x368b('0x65'))[_0x368b('0x60')]('tools_tags','t',_0x368b('0x66'));var _0x8b2667=squel['expr']();var _0x212b68=[];var _0x4d590f=squel[_0x368b('0x67')]();var _0x359bc6;if(_0x4a0275[_0x368b('0x4b')][_0x368b('0x68')]){_0x359bc6=as['parseSearch'](_0x4a0275[_0x368b('0x4b')][_0x368b('0x68')]);var _0x670789=_0x359bc6[_0x368b('0x69')];for(var _0x49a634=0x0;_0x49a634<_0x359bc6[_0x368b('0x6a')]['length'];_0x49a634++){var _0xa320cc=_0x359bc6[_0x368b('0x6a')][_0x49a634];var _0x49a651='i';var _0x58a473=_[_0x368b('0x6b')](_0x46a72f,[_0x368b('0x3d'),_0xa320cc[_0x368b('0x59')]]);if(!_0x58a473){switch(_0xa320cc[_0x368b('0x59')]){case _0x368b('0x6c'):if(_0xa320cc['value']==0x1){_0x1ddb6e[_0x368b('0x6d')]('`'+_0xa320cc[_0x368b('0x59')]+'`\x20=\x200');}else{_0x1ddb6e[_0x368b('0x6d')]('`'+_0xa320cc[_0x368b('0x59')]+_0x368b('0x6e'));}break;case _0x368b('0x6f'):if(_0xa320cc['operator']===_0x368b('0x70')){if(_0xa320cc[_0x368b('0x71')][_0x368b('0x43')]('\x20')[_0x368b('0x51')]>0x1){_0x8b2667[_0x670789]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xa320cc['value']),null);}else{var _0x4b949f='%'+_0xa320cc[_0x368b('0x71')]+'%';_0x8b2667[_0x670789](_0x368b('0x72'),_0x4b949f,_0x4b949f,_0x4b949f);}}else{_0x58a473=_['find'](_0x46a72f,['name','ContactId']);_0xa320cc['field']='ContactId';_0x4f9018=as[_0x368b('0x73')](_0x49a651,_0x58a473[_0x368b('0x49')],_0xa320cc);_0x8b2667[_0x670789](_0x4f9018[_0x368b('0x74')],_0x4f9018['value'][_0x368b('0x75')],_0x4f9018['value']['end']);}break;case _0x368b('0x76'):var _0x3b4937=_0xa320cc[_0x368b('0x71')][_0x368b('0x43')](',')['map'](function(_0x2c4488){return Number(_0x2c4488);});_0x3b4937[_0x368b('0x44')](function(_0x20feff){_0x4d590f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20feff+',%');});_0x212b68=_[_0x368b('0x77')](_0x212b68,_0x3b4937);break;case _0x368b('0x78'):if(_0xa320cc['operator']===_0x368b('0x70')){_0x8b2667[_0x670789](_0x368b('0x79'),'%'+_0xa320cc['value']+'%',null);}else{_0x58a473=_[_0x368b('0x6b')](_0x46a72f,['name',_0x368b('0x7a')]);_0xa320cc[_0x368b('0x59')]='UserId';_0x4f9018=as[_0x368b('0x73')](_0x49a651,_0x58a473[_0x368b('0x49')],_0xa320cc);_0x8b2667[_0x670789](_0x4f9018[_0x368b('0x74')],_0x4f9018[_0x368b('0x71')][_0x368b('0x75')],_0x4f9018['value'][_0x368b('0x32')]);}break;case _0x368b('0x7b'):_0x4f9018=as[_0x368b('0x73')]('me',null,_0xa320cc);_0x8b2667[_0x670789](_0x4f9018[_0x368b('0x74')],_0x4f9018[_0x368b('0x71')][_0x368b('0x75')],_0x4f9018[_0x368b('0x71')][_0x368b('0x32')]);break;}}else{var _0x4f9018=as[_0x368b('0x73')](_0x49a651,_0x58a473[_0x368b('0x49')],_0xa320cc);_0x8b2667[_0x670789](_0x4f9018['text'],_0x4f9018[_0x368b('0x71')][_0x368b('0x75')],_0x4f9018[_0x368b('0x71')]['end']);}}}else{var _0x49ba44=_(_0x4a0275[_0x368b('0x4b')])[_0x368b('0x4c')]()[_0x368b('0x40')](function(_0xb7cef7){return _['some'](_0x46a72f,[_0x368b('0x3d'),_0xb7cef7])?_0xb7cef7:undefined;})['compact']()[_0x368b('0x71')]();if(!_[_0x368b('0x7c')](_0x49ba44)){_0x49ba44[_0x368b('0x44')](function(_0x59b02c){if(_0x59b02c===_0x368b('0x7d')){_0x1ddb6e[_0x368b('0x56')](_0x368b('0x7e'),[]['concat'](_0x4a0275['query'][_0x59b02c]));}else if(_0x59b02c==='createdAt'){var _0x7bca21=JSON[_0x368b('0x7f')](_0x4a0275[_0x368b('0x4b')][_0x59b02c])[_0x368b('0x80')];var _0x321112=JSON['parse'](_0x4a0275[_0x368b('0x4b')][_0x59b02c])[_0x368b('0x81')];_0x1ddb6e['where'](_0x368b('0x82'),_0x7bca21,_0x321112);}else{if(_0x4a0275['query'][_0x59b02c]==='null'){_0x1ddb6e[_0x368b('0x56')]('i.'+_0x59b02c+_0x368b('0x83'));}else{_0x1ddb6e[_0x368b('0x56')]('i.'+_0x59b02c+_0x368b('0x84'),_0x4a0275[_0x368b('0x4b')][_0x59b02c]);}}});}if(_0x4a0275[_0x368b('0x4b')][_0x368b('0x85')]){if(_0x4a0275[_0x368b('0x4b')][_0x368b('0x85')]==0x1){_0x1ddb6e[_0x368b('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x1ddb6e['having']('`unreadMessages`\x20>\x200');}}if(_0x4a0275['query'][_0x368b('0x86')]){_0x212b68=_['isArray'](_0x4a0275['query'][_0x368b('0x86')])?_0x4a0275[_0x368b('0x4b')][_0x368b('0x86')]:new Array(_0x4a0275[_0x368b('0x4b')][_0x368b('0x86')]);_0x212b68[_0x368b('0x44')](function(_0x67794e){_0x4d590f['or'](_0x368b('0x87'),'%,'+_0x67794e+',%');});}if(_0x4a0275['query'][_0x368b('0x88')]){var _0x99599c=_0x4a0275['query'][_0x368b('0x88')][_0x368b('0x89')]('\x5c','\x5c\x5c')[_0x368b('0x89')]('\x27\x27',_0x368b('0x8a'));if(qs[_0x368b('0x8b')](_0x99599c)){_0x8b2667['or'](_0x368b('0x8c'),_0x99599c+'%');}else{_0x8b2667['or'](_0x368b('0x8d'),qs[_0x368b('0x8e')](_0x99599c))['or'](_0x368b('0x8f'),_0x99599c+'%');}}}_0x1ddb6e[_0x368b('0x56')](_0x8b2667);_0x1ddb6e[_0x368b('0x90')](_0x368b('0x91'));var _0x26b234={'type':db[_0x368b('0x92')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2a8eea=_0x1ddb6e[_0x368b('0x93')]();_0x2a8eea[_0x368b('0x59')]('i.id');_0x2a8eea[_0x368b('0x59')](_0x368b('0x94'),_0x368b('0x6c'));if(_0x1e8891['order']){_0x1e8891[_0x368b('0x54')][_0x368b('0x44')](function(_0x5053b3){_0x1ddb6e[_0x368b('0x54')]('i.'+_0x5053b3[0x0],_0x5053b3[0x1]===_0x368b('0x95')?![]:!![]);});}if(!_[_0x368b('0x7c')](_0x212b68)){_0x1ddb6e['having'](_0x4d590f);_0x2a8eea['where'](_0x368b('0x96'),_0x212b68);}BPromise['resolve']()[_0x368b('0x3b')](function(){if(!_0x359bc6){if(_0x4a0275[_0x368b('0x4b')][_0x368b('0x7d')]||_0x4a0275[_0x368b('0x4b')]['journey'])return;_0x2a8eea[_0x368b('0x56')](_0x368b('0x97'));_0x1ddb6e[_0x368b('0x56')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0x4a0275[_0x368b('0x98')][_0x368b('0x99')]({'attributes':['id'],'raw':!![]})[_0x368b('0x3b')](function(_0x252bbd){if(_['isEmpty'](_0x252bbd)){_0x2a8eea[_0x368b('0x56')]('i.ChatWebsiteId\x20IS\x20NULL');_0x1ddb6e[_0x368b('0x56')](_0x368b('0x9a'));}else{_0x2a8eea[_0x368b('0x56')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x252bbd,'id'));_0x1ddb6e['where']('i.ChatWebsiteId\x20IN\x20?',_[_0x368b('0x40')](_0x252bbd,'id'));}});})[_0x368b('0x3b')](function(){db['sequelize']['query'](_0x2a8eea[_0x368b('0x9b')](),_0x26b234)['then'](function(_0x197d3a){_0x575e58[_0x368b('0x34')]=_0x197d3a['length'];if(_0x575e58[_0x368b('0x34')]===0x0)return[];return db['sequelize'][_0x368b('0x4b')](_0x456f19['toString'](),_0x26b234)[_0x368b('0x3b')](function(_0x12cad7){_0x4b2d5f=_['keyBy'](_0x12cad7,'id');_0x26b234=_[_0x368b('0x9c')](_0x26b234,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4a0275[_0x368b('0x4b')][_0x368b('0x50')]){_0x1e8891['attributes']['forEach'](function(_0x34e436){_0x1ddb6e['field']('i.'+_0x34e436);});}else{_0x1ddb6e['field'](_0x368b('0x94'),'unreadMessages');_0x1ddb6e['field']('a.key','Account.key');_0x1ddb6e[_0x368b('0x59')]('a.mandatoryDisposition',_0x368b('0x9d'));_0x1ddb6e[_0x368b('0x59')]('i.*');_0x1ddb6e[_0x368b('0x59')](_0x368b('0x9e'),'Contact.firstName');_0x1ddb6e[_0x368b('0x59')]('c.lastName','Contact.lastName');_0x1ddb6e[_0x368b('0x59')](_0x368b('0x9f'),'Contact.email');_0x1ddb6e[_0x368b('0x59')]('c.phone','Contact.phone');_0x1ddb6e[_0x368b('0x59')]('c.mobile',_0x368b('0xa0'));_0x1ddb6e['field']('c.fax',_0x368b('0xa1'));_0x1ddb6e['field'](_0x368b('0xa2'),_0x368b('0xa3'));_0x1ddb6e[_0x368b('0x59')](_0x368b('0xa4'),_0x368b('0xa5'));_0x1ddb6e[_0x368b('0x59')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x368b('0x42'));}if(_0x1e8891[_0x368b('0x36')])_0x1ddb6e[_0x368b('0x36')](_0x1e8891[_0x368b('0x36')]);if(_0x1e8891[_0x368b('0x35')])_0x1ddb6e['offset'](_0x1e8891[_0x368b('0x35')]);return db[_0x368b('0xa6')][_0x368b('0x4b')](_0x1ddb6e[_0x368b('0x9b')](),_0x26b234);})[_0x368b('0x3b')](function(_0x20ee9f){_0x424aa1[_0x368b('0x56')](_0x368b('0xa7'),_[_0x368b('0x40')](_0x20ee9f,'id'));return db[_0x368b('0xa6')][_0x368b('0x4b')](_0x424aa1[_0x368b('0x9b')](),_0x26b234)[_0x368b('0x3b')](function(_0x509092){var _0x4136e6=_[_0x368b('0xa8')](_0x509092,_0x368b('0xa9'));var _0x179c33=[];_0x20ee9f[_0x368b('0x44')](function(_0x2cf41b){_0x179c33[_0x368b('0x45')](updateChatInteraction(_0x2cf41b,_0x4b2d5f,_0x4136e6));});return BPromise[_0x368b('0xaa')](_0x179c33);});});})[_0x368b('0x3b')](function(_0x30e6c3){_0x575e58[_0x368b('0xab')]=_0x30e6c3;return _0x575e58;})[_0x368b('0x3b')](respondWithFilteredResult(_0x91bb0b,_0x1e8891));})[_0x368b('0x2f')](handleError(_0x91bb0b,null));};exports['show']=function(_0x2148a4,_0x31d21a){var _0x57de30={'raw':![],'where':{'id':_0x2148a4['params']['id']}},_0x5f0032={};_0x5f0032[_0x368b('0x4a')]=_['keys'](db['ChatInteraction'][_0x368b('0xac')]);_0x5f0032[_0x368b('0x4b')]=_[_0x368b('0x4c')](_0x2148a4[_0x368b('0x4b')]);_0x5f0032['filters']=_[_0x368b('0x4e')](_0x5f0032[_0x368b('0x4a')],_0x5f0032[_0x368b('0x4b')]);_0x57de30[_0x368b('0x4f')]=_[_0x368b('0x4e')](_0x5f0032[_0x368b('0x4a')],qs['fields'](_0x2148a4[_0x368b('0x4b')][_0x368b('0x50')]));_0x57de30[_0x368b('0x4f')]=_0x57de30[_0x368b('0x4f')][_0x368b('0x51')]?_0x57de30['attributes']:_0x5f0032[_0x368b('0x4a')];if(_0x2148a4['query'][_0x368b('0xad')]){_0x57de30['include']=[{'all':!![]}];}_0x57de30=_[_0x368b('0x9c')]({},_0x57de30,_0x2148a4['options']);return db[_0x368b('0x47')]['find'](_0x57de30)[_0x368b('0x3b')](handleEntityNotFound(_0x31d21a,null))[_0x368b('0x3b')](respondWithResult(_0x31d21a,null))['catch'](handleError(_0x31d21a,null));};exports[_0x368b('0xae')]=function(_0x11a086,_0x18167e){return db[_0x368b('0x47')][_0x368b('0xae')](_0x11a086[_0x368b('0x7b')],{})[_0x368b('0x3b')](respondWithResult(_0x18167e,0xc9))[_0x368b('0x2f')](handleError(_0x18167e,null));};exports[_0x368b('0xaf')]=function(_0xa6938a,_0x390fa2){if(_0xa6938a[_0x368b('0x7b')]['id']){delete _0xa6938a[_0x368b('0x7b')]['id'];}return db['ChatInteraction'][_0x368b('0x6b')]({'where':{'id':_0xa6938a['params']['id']}})[_0x368b('0x3b')](handleEntityNotFound(_0x390fa2,null))['then'](saveUpdates(_0xa6938a[_0x368b('0x7b')],null))[_0x368b('0x3b')](respondWithResult(_0x390fa2,null))[_0x368b('0x2f')](handleError(_0x390fa2,null));};exports['destroy']=function(_0x24c71c,_0x475234){return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0x24c71c['params']['id']}})[_0x368b('0x3b')](handleEntityNotFound(_0x475234,null))[_0x368b('0x3b')](removeEntity(_0x475234,null))[_0x368b('0x2f')](handleError(_0x475234,null));};exports[_0x368b('0xb0')]=function(_0x575b61,_0x486c46){return db['ChatInteraction'][_0x368b('0xb0')]()[_0x368b('0x3b')](respondWithResult(_0x486c46,null))[_0x368b('0x2f')](handleError(_0x486c46,null));};exports[_0x368b('0xb1')]=function(_0x7ce688,_0x121542){var _0x331839=_0x7ce688[_0x368b('0xb2')]['id'];var _0xaa6479;var _0x57ffb1;var _0x4da490;return db[_0x368b('0x47')][_0x368b('0xb3')]({'where':{'id':_0x331839}})[_0x368b('0x3b')](function(_0x81e72e){_0xaa6479=_0x81e72e;return db['ChatWebsite']['findOne']({'where':{'id':_0x81e72e[_0x368b('0x7d')]},'attributes':['id',_0x368b('0xb4'),'vidaooEscalation'],'raw':!![]});})[_0x368b('0x3b')](function(_0x3c0ebc){if(_0x3c0ebc&&_0x3c0ebc[_0x368b('0xb4')]&&_0x3c0ebc[_0x368b('0xb5')]){_0x57ffb1=_0x3c0ebc;var _0x4df73a={'rejectUnauthorized':![],'method':_0x368b('0xb6'),'uri':_0x368b('0xb7'),'headers':{'X-APIKEY':_0x3c0ebc[_0x368b('0xb4')]},'body':{'name':'MotionCWB:'+_0x331839},'redirect':'follow','json':!![]};return rp(_0x4df73a);}else{throw new db[(_0x368b('0x92'))]['ValidationError'](_0x368b('0xb8'));}})[_0x368b('0x3b')](function(_0x23856f){_0x4da490=_0x23856f;if(_0x4da490['id']){var _0x43ec0e={'body':_0x4da490[_0x368b('0xb9')],'ChatWebsiteId':_0x57ffb1['id'],'ChatInteractionId':_0xaa6479['id'],'direction':_0x368b('0xba'),'UserId':_0x7ce688[_0x368b('0x98')]['id']};return db[_0x368b('0xbb')][_0x368b('0xae')](_0x43ec0e,{});}else{throw new db[(_0x368b('0x92'))][(_0x368b('0x22'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x368b('0x3b')](function(){return _0xaa6479[_0x368b('0xbc')]({'vidaooSessionId':_0x4da490['id']});})[_0x368b('0x3b')](respondWithResult(_0x121542,null))['catch'](handleError(_0x121542,null));};exports[_0x368b('0xbd')]=function(_0x5b6c56,_0x184636){if(_0x5b6c56[_0x368b('0x7b')]['id']){delete _0x5b6c56['body']['id'];}return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0x5b6c56[_0x368b('0xb2')]['id']}})[_0x368b('0x3b')](handleEntityNotFound(_0x184636,null))[_0x368b('0x3b')](saveUpdates(_0x5b6c56[_0x368b('0x7b')],null))['then'](respondWithResult(_0x184636,null))[_0x368b('0x2f')](handleError(_0x184636,null));};exports['abandon']=function(_0x22805c,_0x2c4a5d,_0x2e594e){if(_0x22805c['body']['id']){delete _0x22805c[_0x368b('0x7b')]['id'];}return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0x22805c['params']['id']}})[_0x368b('0x3b')](function(_0x26e337){if(!_0x26e337){logger[_0x368b('0x2b')](_0x368b('0xbe'),_0x368b('0xbf'),0x194,_0x368b('0xc0'));_0x2c4a5d[_0x368b('0x30')](0x194);}else{if(_0x26e337[_0x368b('0x7a')]){throw new db[(_0x368b('0x92'))][(_0x368b('0x22'))](_0x368b('0xc1'));}}return _0x26e337;})['then'](function(_0xb2f4cd){if(_0xb2f4cd){return _0xb2f4cd['update']({'closed':_0x22805c[_0x368b('0x7b')][_0x368b('0xc2')],'disposition':_0x22805c[_0x368b('0x7b')]['disposition']})[_0x368b('0x3b')](function(_0x5c7863){return _0x5c7863;});}})[_0x368b('0x3b')](function(_0x49e400){return respondWithRpcPromise(_0x368b('0xc3'),_0x368b('0xbf'),_0x22805c[_0x368b('0x7b')],client9004);})['then'](respondWithResult(_0x2c4a5d,null))[_0x368b('0x2f')](handleError(_0x2c4a5d,null));};exports[_0x368b('0xc4')]=function(_0xb342e4,_0x6cd99c,_0x18ef5c){_0xb342e4[_0x368b('0x7b')]['name']=_0xb342e4['file'][_0x368b('0xc5')];_0xb342e4[_0x368b('0x7b')][_0x368b('0xc6')]=_0xb342e4[_0x368b('0xc7')][_0x368b('0xc8')];_0xb342e4[_0x368b('0x7b')]['type']=_0xb342e4['file'][_0x368b('0xc9')];return db[_0x368b('0xca')]['create'](_0xb342e4[_0x368b('0x7b')])['then'](respondWithResult(_0x6cd99c,0xc9))[_0x368b('0x2f')](handleError(_0x6cd99c,null));};exports[_0x368b('0xcb')]=function(_0x3ec82c,_0x3af1b0,_0x47353a){return db[_0x368b('0x47')]['findOne']({'where':{'id':_0x3ec82c[_0x368b('0xb2')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3af1b0,null))[_0x368b('0x3b')](function(_0x4b9522){if(_0x4b9522){if(_0x4b9522[_0x368b('0xc2')]){return _0x3af1b0['status'](0x193)['json']({'status':0x193,'message':_0x368b('0xcc')});}return db['Attachment'][_0x368b('0xb3')]({'where':{'id':_0x3ec82c[_0x368b('0x4b')][_0x368b('0xcd')]},'raw':!![]})[_0x368b('0x3b')](handleEntityNotFound(_0x3af1b0,null));}})[_0x368b('0x3b')](function(_0x41b455){if(_0x41b455){return _0x3af1b0[_0x368b('0xce')](path[_0x368b('0xcf')](config[_0x368b('0xd0')],_0x368b('0xd1'),_0x41b455[_0x368b('0xc6')]));}})[_0x368b('0x2f')](handleError(_0x3af1b0,null));};exports[_0x368b('0xd2')]=function(_0x28f26f,_0x5a43df){var _0x37a510=null;var _0x2f52f9=null;var _0x185bb6=null;var _0x55b248=null;if(_0x28f26f[_0x368b('0x7b')]['id']){delete _0x28f26f['body']['id'];}if(_0x28f26f[_0x368b('0x7b')]['mailTranscript']){_0x55b248=path[_0x368b('0xcf')](config[_0x368b('0xd0')],_0x368b('0xd3'),util['format'](_0x368b('0xd4'),Date[_0x368b('0xd5')]()));_0x28f26f[_0x368b('0x7b')]['pathTranscript']=_0x55b248;}return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0x28f26f[_0x368b('0xb2')]['id']},'include':[{'model':db[_0x368b('0xbb')],'as':_0x368b('0xd6'),'include':[{'model':db['User'],'as':_0x368b('0x78')}]}]})[_0x368b('0x3b')](handleEntityNotFound(_0x5a43df,null))['then'](saveUpdates(_0x28f26f[_0x368b('0x7b')],null))[_0x368b('0x3b')](function(_0xccff5a){if(_0xccff5a){_0x37a510=_0xccff5a;return db[_0x368b('0xd7')][_0x368b('0x6b')]({'where':{'id':_0x37a510[_0x368b('0x7d')]}});}})[_0x368b('0x3b')](function(_0x107b7b){if(_0x107b7b){_0x185bb6=_0x107b7b;return db[_0x368b('0xd8')][_0x368b('0x6b')]({'where':{'id':_0x37a510['ContactId']}});}})['then'](function(_0x5d9011){if(_0x5d9011){_0x2f52f9=_0x5d9011;if(_0x55b248){var _0x226de8=null;for(var _0x4dc01b=0x1;_0x4dc01b<_0x37a510[_0x368b('0xd6')][_0x368b('0x51')];++_0x4dc01b){_0x226de8=_0x37a510[_0x368b('0xd6')][_0x4dc01b];var _0x5bce06=_0x226de8[_0x368b('0x7a')]?util[_0x368b('0xd9')]('%s%d',_0x185bb6[_0x368b('0xda')],_0x226de8[_0x368b('0x7a')]):_0x368b('0xdb');var _0x1ab6f5=_0x28f26f[_0x368b('0x7b')][_0x368b('0xdc')]||util[_0x368b('0xd9')]('%s%d',_0x368b('0xdd'),_0x226de8['ContactId']);switch(_0x185bb6['agentIdentifier']){case _0x368b('0xde'):_0x5bce06=_0x226de8['UserId']?util[_0x368b('0xd9')](_0x368b('0xdf'),_0x185bb6[_0x368b('0xda')],_0x226de8[_0x368b('0x7a')]):_0x368b('0xdb');break;case _0x368b('0xe0'):_0x5bce06=_0x226de8['UserId']?_0x226de8[_0x368b('0x78')]['alias']||_0x226de8[_0x368b('0x78')][_0x368b('0xe1')]:_0x368b('0xdb');break;case'agent_fullname':_0x5bce06=_0x226de8[_0x368b('0x7a')]?_0x226de8[_0x368b('0x78')]['fullname']:_0x368b('0xdb');break;default:_0x5bce06=_0x226de8['UserId']?util[_0x368b('0xd9')](_0x368b('0xdf'),_0x185bb6['agentAlias'],_0x226de8['UserId']):_0x368b('0xdb');}var _0x4a8754=util[_0x368b('0xd9')](_0x368b('0xe2'),moment(_0x226de8[_0x368b('0xe3')])[_0x368b('0xd9')](_0x368b('0xe4')),_0x226de8[_0x368b('0xe5')]==='in'?_0x1ab6f5:_0x5bce06,_0x226de8[_0x368b('0x7b')]);if(!_0x226de8[_0x368b('0xe6')]){fs[_0x368b('0xe7')](_0x55b248,_0x4a8754);}}return db['MailAccount'][_0x368b('0xb3')]({'where':{'service':!![]},'include':[{'model':db[_0x368b('0xe8')],'as':_0x368b('0xe9'),'raw':!![]}]});}}})[_0x368b('0x3b')](function(_0x5a2b9e){if(_0x5a2b9e&&_0x5a2b9e[_0x368b('0xe9')]&&_0x28f26f[_0x368b('0x7b')]){var _0x281f03={'tls':{'rejectUnauthorized':![]}};if(_0x5a2b9e[_0x368b('0xe9')][_0x368b('0xea')]){_0x281f03[_0x368b('0xea')]=_0x5a2b9e[_0x368b('0xe9')][_0x368b('0xea')];}else{_0x281f03['host']=_0x5a2b9e[_0x368b('0xe9')][_0x368b('0xeb')];_0x281f03['port']=_0x5a2b9e[_0x368b('0xe9')][_0x368b('0xec')];_0x281f03[_0x368b('0xed')]=_0x5a2b9e[_0x368b('0xe9')][_0x368b('0xed')];}if(_0x5a2b9e['Smtp']['authentication']){_0x281f03[_0x368b('0xee')]={'user':_0x5a2b9e['Smtp'][_0x368b('0x98')],'pass':_0x5a2b9e[_0x368b('0xe9')][_0x368b('0xef')]};}return respondWithRpcPromise(_0x368b('0xf0'),_0x368b('0xf1'),{'account':_0x281f03,'message':{'from':util[_0x368b('0xd9')]('\x22%s\x22\x20<%s>',_0x5a2b9e[_0x368b('0x3d')],_0x5a2b9e[_0x368b('0xf2')]||_0x5a2b9e[_0x368b('0xe9')][_0x368b('0x98')]),'to':_0x28f26f['body'][_0x368b('0xf3')],'subject':'Mail\x20Transcript','text':util[_0x368b('0xd9')](_0x368b('0xf4'),_0x28f26f[_0x368b('0x7b')][_0x368b('0xf3')]),'attachments':[{'path':_0x55b248}]}})['then'](function(){return _0x37a510;})[_0x368b('0x2f')](function(_0x8f5427){console[_0x368b('0x2b')](_0x8f5427);});}else{return _0x37a510;}})['then'](respondWithStatusCode(_0x5a43df,0xc8))['catch'](handleError(_0x5a43df,null));};exports[_0x368b('0xf5')]=function(_0x25d07e,_0x19d475,_0x2964b8){return db[_0x368b('0xbb')][_0x368b('0x6b')]({'where':{'id':_0x25d07e[_0x368b('0xb2')]['id']}})[_0x368b('0x3b')](handleEntityNotFound(_0x19d475,null))['then'](function(_0x172172){if(_0x172172){return _0x172172['addMessage'](_0x25d07e[_0x368b('0x7b')][_0x368b('0xf6')],_['omit'](_0x25d07e[_0x368b('0x7b')],[_0x368b('0xf6'),'id'])||{});}})[_0x368b('0x3b')](respondWithResult(_0x19d475,null))['catch'](handleError(_0x19d475,null));};exports['getMessages']=function(_0xc4b426,_0x5cc02f,_0x3ba246){var _0x59538f={'raw':![],'where':{}};var _0x35d8dc={};var _0x14205c={'count':0x0,'rows':[]};return db[_0x368b('0x47')]['findOne']({'where':{'id':_0xc4b426[_0x368b('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5cc02f,null))[_0x368b('0x3b')](function(_0xf330fa){if(_0xf330fa){_0x35d8dc['model']=_['keys'](db[_0x368b('0xbb')][_0x368b('0xac')]);_0x35d8dc['query']=_[_0x368b('0x4c')](_0xc4b426['query']);_0x35d8dc['filters']=_[_0x368b('0x4e')](_0x35d8dc[_0x368b('0x4a')],_0x35d8dc[_0x368b('0x4b')]);_0x59538f['attributes']=_[_0x368b('0x4e')](_0x35d8dc[_0x368b('0x4a')],qs['fields'](_0xc4b426[_0x368b('0x4b')]['fields']));_0x59538f[_0x368b('0x4f')]=_0x59538f[_0x368b('0x4f')]['length']?_0x59538f[_0x368b('0x4f')]:_0x35d8dc['model'];if(!_0xc4b426[_0x368b('0x4b')][_0x368b('0x52')](_0x368b('0x53'))){_0x59538f[_0x368b('0x36')]=qs[_0x368b('0x36')](_0xc4b426[_0x368b('0x4b')][_0x368b('0x36')]);_0x59538f[_0x368b('0x35')]=qs[_0x368b('0x35')](_0xc4b426[_0x368b('0x4b')][_0x368b('0x35')]);}_0x59538f[_0x368b('0x54')]=qs['sort'](_0xc4b426[_0x368b('0x4b')][_0x368b('0x55')]);_0x59538f[_0x368b('0x56')]=qs['filters'](_[_0x368b('0x57')](_0xc4b426[_0x368b('0x4b')],_0x35d8dc[_0x368b('0x4d')]));_0x59538f['where'][_0x368b('0xa9')]=_0xf330fa['id'];if(_0xc4b426[_0x368b('0x4b')][_0x368b('0x88')]){_0x59538f['where']=_[_0x368b('0x9c')](_0x59538f[_0x368b('0x56')],{'$or':_['map'](_0x59538f['attributes'],function(_0x4f1af7){var _0xd1d71f={};_0xd1d71f[_0x4f1af7]={'$like':'%'+_0xc4b426[_0x368b('0x4b')][_0x368b('0x88')]+'%'};return _0xd1d71f;})});}if(_0xc4b426['query'][_0x368b('0x80')]){var _0x5c02c8=_0xc4b426['query'][_0x368b('0x80')][_0x368b('0x43')](',');var _0x6fb766={};_0x6fb766[_0x5c02c8[0x0]]={'$gte':moment(_0x5c02c8[0x1])[_0x368b('0xd9')](_0x368b('0xf7'))};_0x59538f[_0x368b('0x56')]=_[_0x368b('0x9c')](_0x59538f[_0x368b('0x56')],_0x6fb766);}_0x59538f=_[_0x368b('0x9c')]({},_0x59538f,_0xc4b426[_0x368b('0xf8')]);return db[_0x368b('0xbb')][_0x368b('0x34')]({'where':_0x59538f[_0x368b('0x56')]})[_0x368b('0x3b')](function(_0x205e9c){_0x14205c['count']=_0x205e9c;if(_0xc4b426[_0x368b('0x4b')][_0x368b('0xad')]){_0x59538f['include']=[{'all':!![]}];}return db[_0x368b('0xbb')]['findAll'](_0x59538f);})[_0x368b('0x3b')](function(_0x2af132){_0x14205c[_0x368b('0xab')]=_0x2af132;return _0x14205c;});}})[_0x368b('0x3b')](respondWithFilteredResult(_0x5cc02f,_0x59538f))[_0x368b('0x2f')](handleError(_0x5cc02f,null));};exports[_0x368b('0xf9')]=function(_0x49e570,_0x291e24,_0x5c53c2){var _0x161823={'where':{}},_0x5b0471={},_0x6e6c9b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x368b('0xb3')]({'where':{'id':_0x49e570[_0x368b('0xb2')]['id']}})[_0x368b('0x3b')](handleEntityNotFound(_0x291e24,null))[_0x368b('0x3b')](function(_0xf148ef){if(_0xf148ef){_0x5b0471[_0x368b('0x4a')]=_[_0x368b('0x4c')](db[_0x368b('0xbb')][_0x368b('0xac')]);_0x5b0471['query']=_[_0x368b('0x4c')](_0x49e570['query']);_0x5b0471[_0x368b('0x4d')]=_[_0x368b('0x4e')](_0x5b0471['model'],_0x5b0471[_0x368b('0x4b')]);_0x161823[_0x368b('0x4f')]=_[_0x368b('0x4e')](_0x5b0471[_0x368b('0x4a')],qs[_0x368b('0x50')](_0x49e570['query']['fields']));_0x161823['attributes']=_0x161823['attributes']['length']?_0x161823[_0x368b('0x4f')]:_0x5b0471['model'];if(!_0x49e570[_0x368b('0x4b')][_0x368b('0x52')]('nolimit')){_0x161823[_0x368b('0x36')]=qs[_0x368b('0x36')](_0x49e570[_0x368b('0x4b')]['limit']);_0x161823[_0x368b('0x35')]=qs[_0x368b('0x35')](_0x49e570[_0x368b('0x4b')][_0x368b('0x35')]);}_0x161823[_0x368b('0x54')]=qs[_0x368b('0x55')](_0x49e570[_0x368b('0x4b')][_0x368b('0x55')]);_0x161823[_0x368b('0x56')]=qs['filters'](_['pick'](_0x49e570[_0x368b('0x4b')],_0x5b0471['filters']));_0x161823[_0x368b('0x56')]['ChatInteractionId']=_0xf148ef['id'];if(_0x49e570[_0x368b('0x4b')][_0x368b('0x88')]){_0x161823[_0x368b('0x56')]=_[_0x368b('0x9c')](_0x161823[_0x368b('0x56')],{'$or':_[_0x368b('0x40')](_0x161823[_0x368b('0x4f')],function(_0x398e91){var _0x44e4c4={};_0x44e4c4[_0x398e91]={'$like':'%'+_0x49e570[_0x368b('0x4b')][_0x368b('0x88')]+'%'};return _0x44e4c4;})});}_0x161823[_0x368b('0x56')][_0x368b('0xe6')]=![];if(_0x49e570['query']['id']){_0x161823[_0x368b('0x56')]['id']={'$gt':_0x49e570['query']['id']};}_0x161823=_['merge']({},_0x161823,_0x49e570[_0x368b('0xf8')]);return db[_0x368b('0xbb')][_0x368b('0x34')]({'where':_0x161823['where']})[_0x368b('0x3b')](function(_0xab911c){_0x6e6c9b['count']=_0xab911c;_0x161823[_0x368b('0xfa')]=[];if(_0x49e570[_0x368b('0x4b')][_0x368b('0xfb')]){_0x161823['include'][_0x368b('0x45')]({'model':db[_0x368b('0x78')],'as':_0x368b('0x78'),'attributes':['id','fullname',_0x368b('0xfc')]});}if(_0x49e570[_0x368b('0x4b')][_0x368b('0xad')]){_0x161823[_0x368b('0xfa')]=[{'all':!![]}];}return db[_0x368b('0xbb')]['findAll'](_0x161823);})[_0x368b('0x3b')](function(_0x5147fd){_0x6e6c9b['rows']=_0x5147fd;return _0x6e6c9b;});}})['then'](respondWithFilteredResult(_0x291e24,_0x161823))['catch'](handleError(_0x291e24,null));};exports['addTags']=function(_0x33268c,_0x4fe0a8,_0x53ca1a){return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0x33268c[_0x368b('0xb2')]['id']}})[_0x368b('0x3b')](handleEntityNotFound(_0x4fe0a8,null))[_0x368b('0x3b')](function(_0x24ce03){if(_0x24ce03){return _0x24ce03[_0x368b('0xfd')](_0x33268c[_0x368b('0x7b')]['ids'],_['omit'](_0x33268c[_0x368b('0x7b')],[_0x368b('0xf6'),'id'])||{})[_0x368b('0xfe')](function(){return db[_0x368b('0x76')][_0x368b('0xff')]({'attributes':['id',_0x368b('0x3d'),_0x368b('0x5a')],'where':{'id':_0x33268c[_0x368b('0x7b')][_0x368b('0xf6')]}});})[_0x368b('0x3b')](function(_0x9d7032){socket['emit'](_0x368b('0x100'),{'id':Number(_0x33268c[_0x368b('0xb2')]['id']),'tags':_0x9d7032||[]});return{'id':Number(_0x33268c['params']['id']),'tags':_0x9d7032||[]};});}})[_0x368b('0x3b')](respondWithResult(_0x4fe0a8,null))[_0x368b('0x2f')](handleError(_0x4fe0a8,null));};exports['removeTags']=function(_0xd6c4bb,_0x51ac2c,_0xcc36ae){return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0xd6c4bb[_0x368b('0xb2')]['id']}})['then'](handleEntityNotFound(_0x51ac2c,null))[_0x368b('0x3b')](function(_0x3eeb82){if(_0x3eeb82){return _0x3eeb82[_0x368b('0x101')](_0xd6c4bb[_0x368b('0x4b')][_0x368b('0xf6')]);}})[_0x368b('0x3b')](respondWithStatusCode(_0x51ac2c,null))[_0x368b('0x2f')](handleError(_0x51ac2c,null));};exports['download']=function(_0x1af3e4,_0x21aba7){var _0x4edf50=moment()['unix']()[_0x368b('0x9b')]();var _0x4ff590=path[_0x368b('0xcf')](config[_0x368b('0xd0')],'server',_0x368b('0x102'),'tmp');var _0x58d475=path['join'](config[_0x368b('0xd0')],_0x368b('0x103'),_0x368b('0x102'),'attachments');var _0x47fbb2=path[_0x368b('0xcf')](_0x4ff590,_0x4edf50);var _0x54b1f7=util[_0x368b('0xd9')](_0x368b('0x104'),_0x1af3e4[_0x368b('0xb2')]['id'],_0x4edf50);var _0x33417b=path['join'](_0x4ff590,_0x54b1f7);var _0x16fca8=[];_0x16fca8[_0x368b('0x45')]({'model':db['User'],'as':_0x368b('0x78'),'attributes':['id',_0x368b('0xe1')],'raw':!![]});_0x16fca8[_0x368b('0x45')]({'model':db[_0x368b('0xd8')],'as':_0x368b('0x6f'),'attributes':['id',_0x368b('0x105'),_0x368b('0x106')],'raw':!![]});if(_0x1af3e4[_0x368b('0x4b')][_0x368b('0x107')]){_0x16fca8['push']({'model':db[_0x368b('0xca')],'as':_0x368b('0xca'),'raw':!![]});}var _0x3a394c=[{'model':db[_0x368b('0xbb')],'as':_0x368b('0xd6'),'attributes':['id','body','createdAt','direction',_0x368b('0xe6'),_0x368b('0x85')],'include':_0x16fca8}];_0x3a394c['push']({'model':db[_0x368b('0xd7')],'as':_0x368b('0x108'),'attributes':['id','name']});_0x3a394c['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x368b('0xe1')]});return db[_0x368b('0x47')][_0x368b('0x6b')]({'where':{'id':_0x1af3e4[_0x368b('0xb2')]['id']},'include':_0x3a394c})[_0x368b('0x3b')](handleEntityNotFound(_0x21aba7,null))[_0x368b('0x3b')](function(_0xe3ef0f){if(_0xe3ef0f){var _0x54c0fb=_0xe3ef0f[_0x368b('0x109')]({'plain':!![]});fs['mkdirSync'](_0x47fbb2);var _0x10eba5={'format':'A4','border':_0x368b('0x10a'),'header':{'height':_0x368b('0x10b'),'contents':{'first':_0x368b('0x10c')}},'footer':{'height':_0x368b('0x10d'),'contents':{'default':util[_0x368b('0xd9')](_0x368b('0x10e'),util[_0x368b('0xd9')](_0x368b('0x10f'),_0x368b('0x110'),_0x54c0fb['id']),moment()['format'](_0x368b('0x111'))[_0x368b('0x9b')]())}}};var _0x915c02={'channel':_0x368b('0x110'),'account':_0x54c0fb['Account'][_0x368b('0x3d')],'agent':_0x54c0fb['Owner']?_0x54c0fb[_0x368b('0x112')][_0x368b('0xe1')]:_0x368b('0x113'),'createdAt':moment(_0x54c0fb[_0x368b('0xe3')])[_0x368b('0xd9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x368b('0x9b')](),'closedAt':_0x54c0fb[_0x368b('0xc2')]?moment(_0x54c0fb[_0x368b('0x114')])[_0x368b('0xd9')](_0x368b('0xf7'))[_0x368b('0x9b')]():'','disposition':_0x54c0fb[_0x368b('0x115')],'chatInfo':{'browser':_0x54c0fb[_0x368b('0x116')],'os':_0x54c0fb[_0x368b('0x117')],'referer':_0x54c0fb[_0x368b('0x118')],'customerIp':_0x54c0fb['customerIp'],'customerPort':_0x54c0fb['customerPort']?_0x54c0fb[_0x368b('0x119')]:_0x368b('0x113')},'messages':_(_0x54c0fb[_0x368b('0xd6')])[_0x368b('0x11a')]()['filter']({'secret':![]})[_0x368b('0x40')](function(_0x3743ed){if(_0x3743ed[_0x368b('0xca')]){var _0x85688f=path[_0x368b('0xcf')](_0x58d475,_0x3743ed['Attachment'][_0x368b('0xc6')]);if(fs[_0x368b('0x11b')](_0x85688f)){fs[_0x368b('0x11c')](_0x85688f)[_0x368b('0x11d')](fs[_0x368b('0x11e')](path['join'](_0x47fbb2,_0x3743ed[_0x368b('0xca')]['basename'])));}}return{'date':moment(_0x3743ed['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x368b('0x9b')](),'sender':_0x3743ed[_0x368b('0xe5')]===_0x368b('0xba')?_0x3743ed[_0x368b('0x78')]?_0x3743ed[_0x368b('0x78')][_0x368b('0xe1')]:_0x368b('0xdb'):_0x3743ed[_0x368b('0x6f')][_0x368b('0x105')]+(_0x3743ed[_0x368b('0x6f')]['lastName']?'\x20'+_0x3743ed[_0x368b('0x6f')][_0x368b('0x106')]:''),'body':_0x3743ed['Attachment']?_0x3743ed[_0x368b('0xca')][_0x368b('0xc6')]:_0x3743ed[_0x368b('0x7b')],'direction':_0x3743ed['direction']===_0x368b('0xba')?'A':'C','secret':_0x3743ed[_0x368b('0xe6')],'read':_0x3743ed[_0x368b('0x85')],'attachment':_0x3743ed[_0x368b('0xca')]};})[_0x368b('0x71')]()};return ejs['renderFile'](path[_0x368b('0xcf')](config[_0x368b('0xd0')],_0x368b('0x103'),_0x368b('0x11f'),_0x368b('0x120')),{'interaction':_0x915c02})[_0x368b('0x3b')](function(_0x12d3fa){return new BPromise(function(_0x1a53aa,_0x101812){pdf[_0x368b('0xae')](_0x12d3fa,_0x10eba5)[_0x368b('0x121')](path[_0x368b('0xcf')](_0x47fbb2,_0x368b('0x122')+_0x54c0fb['id']+'-'+_0x4edf50+_0x368b('0x123')),function(_0x28a8c2,_0x5965ae){if(_0x28a8c2)return _0x101812(_0x28a8c2);_0x1a53aa(_0x5965ae);});});})[_0x368b('0x3b')](function(){return new BPromise(function(_0x1c6390,_0x46fc82){zipdir(_0x47fbb2,{'saveTo':_0x33417b},function(_0x5bdbde,_0xcf865a){if(_0x5bdbde)return _0x46fc82(_0x5bdbde);return _0x1c6390(_0xcf865a);});})[_0x368b('0x3b')](function(){return new BPromise(function(_0x344201,_0x517c49){rimraf(_0x47fbb2,function(_0xa14fd9){if(_0xa14fd9)_0x517c49(_0xa14fd9);return _0x344201();});});})[_0x368b('0x3b')](function(){return _0x21aba7[_0x368b('0xce')](_0x33417b,_0x54b1f7,function(_0x5cc515){if(_0x5cc515){console[_0x368b('0x124')](_0x368b('0x125'),_0x5cc515);}else{fs['unlinkSync'](_0x33417b);}});});});}else{return _0x21aba7['sendStatus'](0xc8);}})[_0x368b('0x2f')](handleError(_0x21aba7,null));}; \ No newline at end of file +var _0x1623=['having','`unreadMessages`\x20>\x200','tag','isArray','replace','\x27\x27\x27\x27','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?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','ChatInteraction','includeAll','include','create','update','params','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','filename','file','mimetype','Attachment','attachmentDownload','Unauthorized','download','root','server/files/attachments/','close','mailTranscript','format','transcript-%s.txt','now','ChatMessage','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','fullname','agent_fullname','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','pass','SendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','addMessage','omit','ids','getMessages','pick','filter','options','findAll','getMyMessages','includeAgent','addTags','spread','Tag','emit','removeTags','unix','join','files','attachments','transcript-%d-%s.zip','push','lastName','direction','Account','Owner','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','Chat','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','server','downloadInteraction.html','toFile','.pdf','log','err','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','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','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','then','end','name','Users','Tags','TagIds','split','forEach','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','field','color','from','tools_tags','select','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','expr','search','parseSearch','conditions','find','unreadMessages','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','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','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200'];(function(_0x4914ad,_0x551a18){var _0x3cd61f=function(_0x2a773e){while(--_0x2a773e){_0x4914ad['push'](_0x4914ad['shift']());}};_0x3cd61f(++_0x551a18);}(_0x1623,0xab));var _0x3162=function(_0x1e1e66,_0x1cbf28){_0x1e1e66=_0x1e1e66-0x0;var _0x4673cd=_0x1623[_0x1e1e66];return _0x4673cd;};'use strict';var pdf=require(_0x3162('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3162('0x1'));var jsonpatch=require(_0x3162('0x2'));var rp=require(_0x3162('0x3'));var moment=require(_0x3162('0x4'));var BPromise=require(_0x3162('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3162('0x6'));var sox=require('sox');var csv=require(_0x3162('0x7'));var ejs=require(_0x3162('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0x7'));var querystring=require(_0x3162('0xd'));var Papa=require(_0x3162('0xe'));var Redis=require(_0x3162('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x10'));var hardwareService=require(_0x3162('0x11'));var logger=require(_0x3162('0x12'))(_0x3162('0x13'));var utils=require(_0x3162('0x14'));var config=require(_0x3162('0x15'));var db=require(_0x3162('0x16'))['db'];config[_0x3162('0x17')]=_[_0x3162('0x18')](config['redis'],{'host':_0x3162('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3162('0x17')]));require(_0x3162('0x1a'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3162('0x1b')][_0x3162('0x1c')]({'port':0x232b});var client9004=jayson[_0x3162('0x1b')]['http']({'port':0x232c});function checkPasswordPattern(_0x15e348,_0x3d0bea,_0x2705d1){if(_0x2705d1){var _0x490371=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x490371[_0x3162('0x1d')](_0x3d0bea)){return _0x15e348;}else{throw new db[(_0x3162('0x1e'))][(_0x3162('0x1f'))](_0x3162('0x20'));}}else{return _0x15e348;}}function respondWithRpcPromise(_0x930415,_0x1eed46,_0x391d97,_0x4b2bf3){return new BPromise(function(_0x42f283,_0x1e3d75){var _0x460b7b=_0x4b2bf3||client;return _0x460b7b[_0x3162('0x21')](_0x930415,_0x391d97)['then'](function(_0x1dfd5c){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1eed46,_0x3162('0x22'));logger[_0x3162('0x23')](_0x3162('0x24'),_0x1eed46,'request\x20sent',JSON['stringify'](_0x1dfd5c));if(_0x1dfd5c[_0x3162('0x25')]){if(_0x1dfd5c[_0x3162('0x25')][_0x3162('0x26')]===0x1f4){logger[_0x3162('0x25')](_0x3162('0x27'),_0x1eed46,_0x1dfd5c[_0x3162('0x25')][_0x3162('0x28')]);return _0x1e3d75(_0x1dfd5c[_0x3162('0x25')]['message']);}logger[_0x3162('0x25')](_0x3162('0x27'),_0x1eed46,_0x1dfd5c[_0x3162('0x25')][_0x3162('0x28')]);return _0x42f283(_0x1dfd5c[_0x3162('0x25')][_0x3162('0x28')]);}else{logger[_0x3162('0x29')](_0x3162('0x27'),_0x1eed46,_0x3162('0x22'));_0x42f283(_0x1dfd5c[_0x3162('0x2a')][_0x3162('0x28')]);}})[_0x3162('0x2b')](function(_0x1c03a4){logger['error'](_0x3162('0x27'),_0x1eed46,_0x1c03a4);_0x1e3d75(_0x1c03a4);});});}function respondWithStatusCode(_0x552469,_0x37acdd){_0x37acdd=_0x37acdd||0xcc;return function(_0x31f7fd){if(_0x31f7fd){return _0x552469[_0x3162('0x2c')](_0x37acdd);}return _0x552469['status'](_0x37acdd)['end']();};}function respondWithResult(_0xda0389,_0xaa1f35){_0xaa1f35=_0xaa1f35||0xc8;return function(_0x14df16){if(_0x14df16){return _0xda0389[_0x3162('0x2d')](_0xaa1f35)[_0x3162('0x2e')](_0x14df16);}};}function respondWithFilteredResult(_0x5c2d28,_0x8a7bce){return function(_0x4e3cc2){if(_0x4e3cc2){var _0xf11765=_0x4e3cc2[_0x3162('0x2f')],_0x3a188e=_0x8a7bce[_0x3162('0x30')],_0x41e933=_0x8a7bce[_0x3162('0x30')]+_0x8a7bce[_0x3162('0x31')],_0x221b38;if(_0x41e933>=_0xf11765){_0x41e933=_0xf11765;_0x221b38=0xc8;}else{_0x221b38=0xce;}_0x5c2d28['status'](_0x221b38);return _0x5c2d28[_0x3162('0x32')](_0x3162('0x33'),_0x3a188e+'-'+_0x41e933+'/'+_0xf11765)['json'](_0x4e3cc2);}return null;};}function patchUpdates(_0x110bb4){return function(_0x155b78){try{jsonpatch['apply'](_0x155b78,_0x110bb4,!![]);}catch(_0x5b7efb){return BPromise[_0x3162('0x34')](_0x5b7efb);}return _0x155b78['save']();};}function saveUpdates(_0x266aab,_0x47241c){return function(_0x1de909){if(_0x1de909){return _0x1de909['update'](_0x266aab)['then'](function(_0x3bb9d0){return _0x3bb9d0;});}return null;};}function removeEntity(_0x1cf9a6,_0x5d8714){return function(_0x1a79fc){if(_0x1a79fc){return _0x1a79fc['destroy']()[_0x3162('0x35')](function(){_0x1cf9a6[_0x3162('0x2d')](0xcc)[_0x3162('0x36')]();});}};}function handleEntityNotFound(_0x137e9b,_0x435aed){return function(_0x3b6c91){if(!_0x3b6c91){_0x137e9b[_0x3162('0x2c')](0x194);}return _0x3b6c91;};}function handleError(_0x25951b,_0x3ee5f8){_0x3ee5f8=_0x3ee5f8||0x1f4;return function(_0x16c5d6){logger[_0x3162('0x25')](_0x16c5d6['stack']);if(_0x16c5d6[_0x3162('0x37')]){delete _0x16c5d6[_0x3162('0x37')];}_0x25951b[_0x3162('0x2d')](_0x3ee5f8)['send'](_0x16c5d6);};}function getInteractionUsers(_0x59759d,_0x3b0a0b){return new BPromise(function(_0x124c92,_0x2e1ab5){try{if(_0x3b0a0b[_0x59759d['id']]){_0x59759d[_0x3162('0x38')]=_['map'](_0x3b0a0b[_0x59759d['id']],function(_0x4186b6){return{'id':_0x4186b6['id'],'fullname':_0x4186b6['fullname']};});}}catch(_0x59e049){_0x2e1ab5(_0x59e049);}_0x124c92(_0x59759d);});}function getInteractionTags(_0x5dee49,_0x298ed7){return new BPromise(function(_0x3fe4d2,_0x315fdb){try{if(_0x5dee49['TagIds']){_0x5dee49[_0x3162('0x39')]=[];_0x5dee49[_0x3162('0x3a')][_0x3162('0x3b')](',')[_0x3162('0x3c')](function(_0x1e8d5e){_0x5dee49['Tags']['push'](_0x298ed7[_0x1e8d5e]);});}delete _0x5dee49[_0x3162('0x3a')];}catch(_0x3783bd){_0x315fdb(_0x3783bd);}_0x3fe4d2(_0x5dee49);});}function updateChatInteraction(_0x5ae385,_0x5960cd,_0x43f780){return new BPromise(function(_0x32c960,_0x379756){return getInteractionUsers(_0x5ae385,_0x43f780)['then'](function(_0x3502ba){return getInteractionTags(_0x3502ba,_0x5960cd);})[_0x3162('0x35')](function(_0x1831f5){_0x32c960(_0x1831f5);})[_0x3162('0x2b')](function(_0x534708){_0x379756(_0x534708);});});}exports[_0x3162('0x3d')]=function(_0x282e3e,_0x522cce){var _0x1d78de={},_0x337352={},_0x500e6b={'count':0x0,'rows':[]};var _0xbb8846=_[_0x3162('0x3e')](db['ChatInteraction'][_0x3162('0x3f')],function(_0x555d33){return{'name':_0x555d33[_0x3162('0x40')],'type':_0x555d33[_0x3162('0x41')][_0x3162('0x42')]};});_0x337352[_0x3162('0x43')]=_[_0x3162('0x3e')](_0xbb8846,_0x3162('0x37'));_0x337352['query']=_[_0x3162('0x44')](_0x282e3e[_0x3162('0x45')]);_0x337352[_0x3162('0x46')]=_['intersection'](_0x337352[_0x3162('0x43')],_0x337352[_0x3162('0x45')]);_0x1d78de['attributes']=_[_0x3162('0x47')](_0x337352['model'],qs['fields'](_0x282e3e['query'][_0x3162('0x48')]));_0x1d78de[_0x3162('0x49')]=_0x1d78de[_0x3162('0x49')][_0x3162('0x4a')]?_0x1d78de[_0x3162('0x49')]:_0x337352[_0x3162('0x43')];if(!_0x282e3e[_0x3162('0x45')][_0x3162('0x4b')](_0x3162('0x4c'))){_0x1d78de[_0x3162('0x31')]=qs[_0x3162('0x31')](_0x282e3e[_0x3162('0x45')][_0x3162('0x31')]);_0x1d78de['offset']=qs[_0x3162('0x30')](_0x282e3e['query']['offset']);}_0x1d78de[_0x3162('0x4d')]=qs[_0x3162('0x4e')](_0x282e3e[_0x3162('0x45')][_0x3162('0x4e')]);_0x1d78de['where']=qs[_0x3162('0x46')](_['pick'](_0x282e3e[_0x3162('0x45')],_0x337352[_0x3162('0x46')]),_0xbb8846);var _0x4b23e8=[];var _0x146758=squel['select']()['field']('id')[_0x3162('0x4f')](_0x3162('0x37'))[_0x3162('0x4f')](_0x3162('0x50'))[_0x3162('0x51')](_0x3162('0x52'));var _0x871a24=squel[_0x3162('0x53')]()['field']('u.id')['field'](_0x3162('0x54'))[_0x3162('0x4f')](_0x3162('0x55'))[_0x3162('0x51')](_0x3162('0x56'),'ui')[_0x3162('0x57')](_0x3162('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x1f35ae=squel['select']()[_0x3162('0x51')]('chat_interactions','i')[_0x3162('0x57')]('cm_contacts','c',_0x3162('0x59'))[_0x3162('0x57')]('users','o','o.id\x20=\x20i.UserId')[_0x3162('0x57')](_0x3162('0x5a'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x3162('0x57')](_0x3162('0x5b'),'me',_0x3162('0x5c'))[_0x3162('0x57')](_0x3162('0x5d'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x3162('0x57')](_0x3162('0x52'),'t','t.id\x20=\x20it.TagId');var _0x5e1f2b=squel[_0x3162('0x5e')]();var _0x6ed643=[];var _0x27eaba=squel['expr']();var _0xf7d3e1;if(_0x282e3e[_0x3162('0x45')][_0x3162('0x5f')]){_0xf7d3e1=as[_0x3162('0x60')](_0x282e3e['query'][_0x3162('0x5f')]);var _0x286aad=_0xf7d3e1['sqlOperator'];for(var _0x3179a=0x0;_0x3179a<_0xf7d3e1['conditions'][_0x3162('0x4a')];_0x3179a++){var _0x1b0f2b=_0xf7d3e1[_0x3162('0x61')][_0x3179a];var _0x53ad9b='i';var _0x291aa7=_[_0x3162('0x62')](_0xbb8846,[_0x3162('0x37'),_0x1b0f2b[_0x3162('0x4f')]]);if(!_0x291aa7){switch(_0x1b0f2b[_0x3162('0x4f')]){case _0x3162('0x63'):if(_0x1b0f2b['value']==0x1){_0x1f35ae['having']('`'+_0x1b0f2b['field']+_0x3162('0x64'));}else{_0x1f35ae['having']('`'+_0x1b0f2b[_0x3162('0x4f')]+_0x3162('0x65'));}break;case _0x3162('0x66'):if(_0x1b0f2b[_0x3162('0x67')]===_0x3162('0x68')){if(_0x1b0f2b['value']['split']('\x20')[_0x3162('0x4a')]>0x1){_0x5e1f2b[_0x286aad](_0x3162('0x69'),qs['getFullTextValue'](_0x1b0f2b[_0x3162('0x6a')]),null);}else{var _0x2bd1ba='%'+_0x1b0f2b[_0x3162('0x6a')]+'%';_0x5e1f2b[_0x286aad](_0x3162('0x6b'),_0x2bd1ba,_0x2bd1ba,_0x2bd1ba);}}else{_0x291aa7=_[_0x3162('0x62')](_0xbb8846,['name',_0x3162('0x6c')]);_0x1b0f2b[_0x3162('0x4f')]=_0x3162('0x6c');_0x355cae=as[_0x3162('0x6d')](_0x53ad9b,_0x291aa7[_0x3162('0x41')],_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae['text'],_0x355cae[_0x3162('0x6a')][_0x3162('0x6e')],_0x355cae[_0x3162('0x6a')][_0x3162('0x36')]);}break;case'Tag':var _0x134a99=_0x1b0f2b[_0x3162('0x6a')][_0x3162('0x3b')](',')[_0x3162('0x3e')](function(_0x2f6fa2){return Number(_0x2f6fa2);});_0x134a99[_0x3162('0x3c')](function(_0xbc75f){_0x27eaba['or'](_0x3162('0x6f'),'%,'+_0xbc75f+',%');});_0x6ed643=_[_0x3162('0x70')](_0x6ed643,_0x134a99);break;case _0x3162('0x71'):if(_0x1b0f2b['operator']===_0x3162('0x68')){_0x5e1f2b[_0x286aad](_0x3162('0x72'),'%'+_0x1b0f2b['value']+'%',null);}else{_0x291aa7=_[_0x3162('0x62')](_0xbb8846,['name',_0x3162('0x73')]);_0x1b0f2b[_0x3162('0x4f')]=_0x3162('0x73');_0x355cae=as[_0x3162('0x6d')](_0x53ad9b,_0x291aa7[_0x3162('0x41')],_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae[_0x3162('0x74')],_0x355cae['value'][_0x3162('0x6e')],_0x355cae[_0x3162('0x6a')][_0x3162('0x36')]);}break;case _0x3162('0x75'):_0x355cae=as[_0x3162('0x6d')]('me',null,_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae[_0x3162('0x74')],_0x355cae['value'][_0x3162('0x6e')],_0x355cae[_0x3162('0x6a')][_0x3162('0x36')]);break;}}else{var _0x355cae=as[_0x3162('0x6d')](_0x53ad9b,_0x291aa7[_0x3162('0x41')],_0x1b0f2b);_0x5e1f2b[_0x286aad](_0x355cae[_0x3162('0x74')],_0x355cae['value']['start'],_0x355cae['value'][_0x3162('0x36')]);}}}else{var _0x3b4afd=_(_0x282e3e['query'])[_0x3162('0x44')]()[_0x3162('0x3e')](function(_0x4acd77){return _[_0x3162('0x76')](_0xbb8846,['name',_0x4acd77])?_0x4acd77:undefined;})[_0x3162('0x77')]()[_0x3162('0x6a')]();if(!_['isEmpty'](_0x3b4afd)){_0x3b4afd[_0x3162('0x3c')](function(_0x5e5892){if(_0x5e5892===_0x3162('0x78')){_0x1f35ae['where'](_0x3162('0x79'),[]['concat'](_0x282e3e[_0x3162('0x45')][_0x5e5892]));}else if(_0x5e5892===_0x3162('0x7a')){var _0x22c234=JSON[_0x3162('0x7b')](_0x282e3e[_0x3162('0x45')][_0x5e5892])[_0x3162('0x7c')];var _0x5885dd=JSON[_0x3162('0x7b')](_0x282e3e[_0x3162('0x45')][_0x5e5892])[_0x3162('0x7d')];_0x1f35ae['where'](_0x3162('0x7e'),_0x22c234,_0x5885dd);}else{if(_0x282e3e[_0x3162('0x45')][_0x5e5892]===_0x3162('0x7f')){_0x1f35ae[_0x3162('0x80')]('i.'+_0x5e5892+_0x3162('0x81'));}else{_0x1f35ae['where']('i.'+_0x5e5892+_0x3162('0x82'),_0x282e3e[_0x3162('0x45')][_0x5e5892]);}}});}if(_0x282e3e['query']['read']){if(_0x282e3e[_0x3162('0x45')][_0x3162('0x83')]==0x1){_0x1f35ae['having'](_0x3162('0x84'));}else{_0x1f35ae[_0x3162('0x85')](_0x3162('0x86'));}}if(_0x282e3e[_0x3162('0x45')][_0x3162('0x87')]){_0x6ed643=_[_0x3162('0x88')](_0x282e3e[_0x3162('0x45')][_0x3162('0x87')])?_0x282e3e[_0x3162('0x45')]['tag']:new Array(_0x282e3e['query'][_0x3162('0x87')]);_0x6ed643[_0x3162('0x3c')](function(_0x5d9af1){_0x27eaba['or'](_0x3162('0x6f'),'%,'+_0x5d9af1+',%');});}if(_0x282e3e['query']['filter']){var _0x4bc14c=_0x282e3e[_0x3162('0x45')]['filter'][_0x3162('0x89')]('\x5c','\x5c\x5c')[_0x3162('0x89')]('\x27\x27',_0x3162('0x8a'));if(qs[_0x3162('0x8b')](_0x4bc14c)){_0x5e1f2b['or'](_0x3162('0x8c'),_0x4bc14c+'%');}else{_0x5e1f2b['or'](_0x3162('0x8d'),qs[_0x3162('0x8e')](_0x4bc14c))['or'](_0x3162('0x8f'),_0x4bc14c+'%');}}}_0x1f35ae[_0x3162('0x80')](_0x5e1f2b);_0x1f35ae[_0x3162('0x90')](_0x3162('0x91'));var _0x53d6d9={'type':db[_0x3162('0x1e')][_0x3162('0x92')][_0x3162('0x93')],'raw':!![]};var _0x38ac7a=_0x1f35ae[_0x3162('0x94')]();_0x38ac7a[_0x3162('0x4f')](_0x3162('0x91'));_0x38ac7a[_0x3162('0x4f')](_0x3162('0x95'),_0x3162('0x63'));if(_0x1d78de[_0x3162('0x4d')]){_0x1d78de[_0x3162('0x4d')]['forEach'](function(_0x22bfb6){_0x1f35ae[_0x3162('0x4d')]('i.'+_0x22bfb6[0x0],_0x22bfb6[0x1]===_0x3162('0x96')?![]:!![]);});}if(!_['isEmpty'](_0x6ed643)){_0x1f35ae[_0x3162('0x85')](_0x27eaba);_0x38ac7a['where'](_0x3162('0x97'),_0x6ed643);}BPromise[_0x3162('0x98')]()['then'](function(){if(!_0xf7d3e1){if(_0x282e3e['query'][_0x3162('0x78')]||_0x282e3e[_0x3162('0x45')]['journey'])return;_0x38ac7a[_0x3162('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x1f35ae[_0x3162('0x80')](_0x3162('0x99'));return;}return _0x282e3e[_0x3162('0x9a')][_0x3162('0x9b')]({'attributes':['id'],'raw':!![]})[_0x3162('0x35')](function(_0x32b6cf){if(_[_0x3162('0x9c')](_0x32b6cf)){_0x38ac7a[_0x3162('0x80')](_0x3162('0x9d'));_0x1f35ae['where'](_0x3162('0x9d'));}else{_0x38ac7a['where'](_0x3162('0x79'),_[_0x3162('0x3e')](_0x32b6cf,'id'));_0x1f35ae['where'](_0x3162('0x79'),_[_0x3162('0x3e')](_0x32b6cf,'id'));}});})[_0x3162('0x35')](function(){db[_0x3162('0x9e')][_0x3162('0x45')](_0x38ac7a[_0x3162('0x9f')](),_0x53d6d9)[_0x3162('0x35')](function(_0x59a84b){_0x500e6b[_0x3162('0x2f')]=_0x59a84b[_0x3162('0x4a')];if(_0x500e6b[_0x3162('0x2f')]===0x0)return[];return db['sequelize'][_0x3162('0x45')](_0x146758[_0x3162('0x9f')](),_0x53d6d9)[_0x3162('0x35')](function(_0x2b8e21){_0x4b23e8=_[_0x3162('0xa0')](_0x2b8e21,'id');_0x53d6d9=_[_0x3162('0xa1')](_0x53d6d9,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x282e3e[_0x3162('0x45')][_0x3162('0x48')]){_0x1d78de[_0x3162('0x49')][_0x3162('0x3c')](function(_0x40ae99){_0x1f35ae['field']('i.'+_0x40ae99);});}else{_0x1f35ae[_0x3162('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3162('0x63'));_0x1f35ae[_0x3162('0x4f')]('a.key',_0x3162('0xa2'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xa3'),'Account.mandatoryDisposition');_0x1f35ae[_0x3162('0x4f')]('i.*');_0x1f35ae['field'](_0x3162('0xa4'),_0x3162('0xa5'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xa6'),_0x3162('0xa7'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xa8'),'Contact.email');_0x1f35ae['field']('c.phone',_0x3162('0xa9'));_0x1f35ae[_0x3162('0x4f')]('c.mobile','Contact.mobile');_0x1f35ae[_0x3162('0x4f')]('c.fax',_0x3162('0xaa'));_0x1f35ae[_0x3162('0x4f')](_0x3162('0xab'),_0x3162('0xac'));_0x1f35ae['field'](_0x3162('0xad'),_0x3162('0xae'));_0x1f35ae[_0x3162('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3162('0x3a'));}if(_0x1d78de['limit'])_0x1f35ae[_0x3162('0x31')](_0x1d78de['limit']);if(_0x1d78de[_0x3162('0x30')])_0x1f35ae[_0x3162('0x30')](_0x1d78de[_0x3162('0x30')]);return db['sequelize'][_0x3162('0x45')](_0x1f35ae[_0x3162('0x9f')](),_0x53d6d9);})[_0x3162('0x35')](function(_0x249b87){_0x871a24['where'](_0x3162('0xaf'),_[_0x3162('0x3e')](_0x249b87,'id'));return db['sequelize'][_0x3162('0x45')](_0x871a24[_0x3162('0x9f')](),_0x53d6d9)[_0x3162('0x35')](function(_0x2243b3){var _0xdccc1a=_[_0x3162('0xb0')](_0x2243b3,_0x3162('0xb1'));var _0x3d977b=[];_0x249b87[_0x3162('0x3c')](function(_0xa2b606){_0x3d977b['push'](updateChatInteraction(_0xa2b606,_0x4b23e8,_0xdccc1a));});return BPromise[_0x3162('0xb2')](_0x3d977b);});});})[_0x3162('0x35')](function(_0x1ccb06){_0x500e6b[_0x3162('0xb3')]=_0x1ccb06;return _0x500e6b;})[_0x3162('0x35')](respondWithFilteredResult(_0x522cce,_0x1d78de));})[_0x3162('0x2b')](handleError(_0x522cce,null));};exports[_0x3162('0xb4')]=function(_0x3a103f,_0x49a2fe){var _0x2d179b={'raw':![],'where':{'id':_0x3a103f['params']['id']}},_0x3f0764={};_0x3f0764[_0x3162('0x43')]=_[_0x3162('0x44')](db[_0x3162('0xb5')][_0x3162('0x3f')]);_0x3f0764[_0x3162('0x45')]=_['keys'](_0x3a103f[_0x3162('0x45')]);_0x3f0764[_0x3162('0x46')]=_['intersection'](_0x3f0764[_0x3162('0x43')],_0x3f0764[_0x3162('0x45')]);_0x2d179b[_0x3162('0x49')]=_['intersection'](_0x3f0764['model'],qs[_0x3162('0x48')](_0x3a103f[_0x3162('0x45')]['fields']));_0x2d179b[_0x3162('0x49')]=_0x2d179b[_0x3162('0x49')][_0x3162('0x4a')]?_0x2d179b[_0x3162('0x49')]:_0x3f0764[_0x3162('0x43')];if(_0x3a103f[_0x3162('0x45')][_0x3162('0xb6')]){_0x2d179b[_0x3162('0xb7')]=[{'all':!![]}];}_0x2d179b=_[_0x3162('0xa1')]({},_0x2d179b,_0x3a103f['options']);return db[_0x3162('0xb5')][_0x3162('0x62')](_0x2d179b)['then'](handleEntityNotFound(_0x49a2fe,null))[_0x3162('0x35')](respondWithResult(_0x49a2fe,null))[_0x3162('0x2b')](handleError(_0x49a2fe,null));};exports[_0x3162('0xb8')]=function(_0x21a870,_0x334634){return db[_0x3162('0xb5')][_0x3162('0xb8')](_0x21a870[_0x3162('0x75')],{})[_0x3162('0x35')](respondWithResult(_0x334634,0xc9))[_0x3162('0x2b')](handleError(_0x334634,null));};exports[_0x3162('0xb9')]=function(_0x29b50e,_0x3fdb63){if(_0x29b50e['body']['id']){delete _0x29b50e[_0x3162('0x75')]['id'];}return db[_0x3162('0xb5')]['find']({'where':{'id':_0x29b50e[_0x3162('0xba')]['id']}})['then'](handleEntityNotFound(_0x3fdb63,null))[_0x3162('0x35')](saveUpdates(_0x29b50e[_0x3162('0x75')],null))[_0x3162('0x35')](respondWithResult(_0x3fdb63,null))[_0x3162('0x2b')](handleError(_0x3fdb63,null));};exports['destroy']=function(_0x301b3e,_0x43b706){return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x301b3e[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x43b706,null))[_0x3162('0x35')](removeEntity(_0x43b706,null))[_0x3162('0x2b')](handleError(_0x43b706,null));};exports[_0x3162('0xbb')]=function(_0x185974,_0x448ea9){return db['ChatInteraction'][_0x3162('0xbb')]()[_0x3162('0x35')](respondWithResult(_0x448ea9,null))[_0x3162('0x2b')](handleError(_0x448ea9,null));};exports[_0x3162('0xbc')]=function(_0x543964,_0x1b53ac){var _0xd056ef=_0x543964[_0x3162('0xba')]['id'];var _0x5ab418;var _0xa64510;var _0x411582;return db['ChatInteraction'][_0x3162('0xbd')]({'where':{'id':_0xd056ef}})[_0x3162('0x35')](function(_0x562335){_0x5ab418=_0x562335;return db[_0x3162('0xbe')][_0x3162('0xbd')]({'where':{'id':_0x562335[_0x3162('0x78')]},'attributes':['id',_0x3162('0xbf'),'vidaooEscalation'],'raw':!![]});})[_0x3162('0x35')](function(_0x13f37d){if(_0x13f37d&&_0x13f37d[_0x3162('0xbf')]&&_0x13f37d['vidaooEscalation']){_0xa64510=_0x13f37d;var _0x1dbdcc={'rejectUnauthorized':![],'method':_0x3162('0xc0'),'uri':_0x3162('0xc1'),'headers':{'X-APIKEY':_0x13f37d[_0x3162('0xbf')]},'body':{'name':_0x3162('0xc2')+_0xd056ef},'redirect':_0x3162('0xc3'),'json':!![]};return rp(_0x1dbdcc);}else{throw new db[(_0x3162('0x1e'))]['ValidationError'](_0x3162('0xc4'));}})[_0x3162('0x35')](function(_0x348241){_0x411582=_0x348241;if(_0x411582['id']){var _0x56ba1e={'body':_0x411582[_0x3162('0xc5')],'ChatWebsiteId':_0xa64510['id'],'ChatInteractionId':_0x5ab418['id'],'direction':_0x3162('0xc6'),'UserId':_0x543964[_0x3162('0x9a')]['id']};return db['ChatMessage'][_0x3162('0xb8')](_0x56ba1e,{});}else{throw new db[(_0x3162('0x1e'))][(_0x3162('0x1f'))](_0x3162('0xc7'));}})[_0x3162('0x35')](function(){return _0x5ab418[_0x3162('0xc8')]({'vidaooSessionId':_0x411582['id']});})[_0x3162('0x35')](respondWithResult(_0x1b53ac,null))[_0x3162('0x2b')](handleError(_0x1b53ac,null));};exports[_0x3162('0xc9')]=function(_0x2f1bc1,_0x42c65a){if(_0x2f1bc1[_0x3162('0x75')]['id']){delete _0x2f1bc1[_0x3162('0x75')]['id'];}return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x2f1bc1[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x42c65a,null))[_0x3162('0x35')](saveUpdates(_0x2f1bc1[_0x3162('0x75')],null))[_0x3162('0x35')](respondWithResult(_0x42c65a,null))[_0x3162('0x2b')](handleError(_0x42c65a,null));};exports[_0x3162('0xca')]=function(_0x5f3a9b,_0x13507d,_0x4137cb){if(_0x5f3a9b['body']['id']){delete _0x5f3a9b[_0x3162('0x75')]['id'];}return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x5f3a9b[_0x3162('0xba')]['id']}})[_0x3162('0x35')](function(_0x3bd8e4){if(!_0x3bd8e4){logger['error'](_0x3162('0xcb'),_0x3162('0xca'),0x194,'entity\x20not\x20found');_0x13507d[_0x3162('0x2c')](0x194);}else{if(_0x3bd8e4['UserId']){throw new db[(_0x3162('0x1e'))][(_0x3162('0x1f'))](_0x3162('0xcc'));}}return _0x3bd8e4;})[_0x3162('0x35')](function(_0x545f3e){if(_0x545f3e){return _0x545f3e[_0x3162('0xb9')]({'closed':_0x5f3a9b[_0x3162('0x75')][_0x3162('0xcd')],'disposition':_0x5f3a9b[_0x3162('0x75')][_0x3162('0xce')]})[_0x3162('0x35')](function(_0x4555ec){return _0x4555ec;});}})[_0x3162('0x35')](function(_0x594f55){return respondWithRpcPromise(_0x3162('0xcf'),_0x3162('0xca'),_0x5f3a9b[_0x3162('0x75')],client9004);})[_0x3162('0x35')](respondWithResult(_0x13507d,null))[_0x3162('0x2b')](handleError(_0x13507d,null));};exports[_0x3162('0xd0')]=function(_0x59c60a,_0x12282c,_0x421bb7){_0x59c60a[_0x3162('0x75')][_0x3162('0x37')]=_0x59c60a['file'][_0x3162('0xd1')];_0x59c60a[_0x3162('0x75')][_0x3162('0xd2')]=_0x59c60a['file'][_0x3162('0xd3')];_0x59c60a['body'][_0x3162('0x41')]=_0x59c60a[_0x3162('0xd4')][_0x3162('0xd5')];return db[_0x3162('0xd6')][_0x3162('0xb8')](_0x59c60a[_0x3162('0x75')])[_0x3162('0x35')](respondWithResult(_0x12282c,0xc9))['catch'](handleError(_0x12282c,null));};exports[_0x3162('0xd7')]=function(_0x71b6b9,_0x26a8ff,_0x30e1b7){return db[_0x3162('0xb5')][_0x3162('0xbd')]({'where':{'id':_0x71b6b9['params']['id']},'raw':!![]})[_0x3162('0x35')](handleEntityNotFound(_0x26a8ff,null))[_0x3162('0x35')](function(_0x1cca9a){if(_0x1cca9a){if(_0x1cca9a[_0x3162('0xcd')]){return _0x26a8ff['status'](0x193)[_0x3162('0x2e')]({'status':0x193,'message':_0x3162('0xd8')});}return db[_0x3162('0xd6')][_0x3162('0xbd')]({'where':{'id':_0x71b6b9[_0x3162('0x45')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x26a8ff,null));}})[_0x3162('0x35')](function(_0xc6d3a1){if(_0xc6d3a1){return _0x26a8ff[_0x3162('0xd9')](path['join'](config[_0x3162('0xda')],_0x3162('0xdb'),_0xc6d3a1[_0x3162('0xd2')]));}})[_0x3162('0x2b')](handleError(_0x26a8ff,null));};exports[_0x3162('0xdc')]=function(_0x391873,_0x548926){var _0x2df99e=null;var _0x4a7364=null;var _0x4749ba=null;var _0x468c8d=null;if(_0x391873['body']['id']){delete _0x391873[_0x3162('0x75')]['id'];}if(_0x391873[_0x3162('0x75')][_0x3162('0xdd')]){_0x468c8d=path['join'](config['root'],'server/files/chat/upload/',util[_0x3162('0xde')](_0x3162('0xdf'),Date[_0x3162('0xe0')]()));_0x391873[_0x3162('0x75')]['pathTranscript']=_0x468c8d;}return db['ChatInteraction'][_0x3162('0x62')]({'where':{'id':_0x391873['params']['id']},'include':[{'model':db[_0x3162('0xe1')],'as':_0x3162('0xe2'),'include':[{'model':db[_0x3162('0x71')],'as':_0x3162('0x71')}]}]})[_0x3162('0x35')](handleEntityNotFound(_0x548926,null))[_0x3162('0x35')](saveUpdates(_0x391873['body'],null))[_0x3162('0x35')](function(_0x459392){if(_0x459392){_0x2df99e=_0x459392;return db['ChatWebsite'][_0x3162('0x62')]({'where':{'id':_0x2df99e['ChatWebsiteId']}});}})[_0x3162('0x35')](function(_0x54e1ac){if(_0x54e1ac){_0x4749ba=_0x54e1ac;return db[_0x3162('0xe3')][_0x3162('0x62')]({'where':{'id':_0x2df99e[_0x3162('0x6c')]}});}})['then'](function(_0x332e31){if(_0x332e31){_0x4a7364=_0x332e31;if(_0x468c8d){var _0x505ef9=null;for(var _0x5381bc=0x1;_0x5381bc<_0x2df99e['Messages'][_0x3162('0x4a')];++_0x5381bc){_0x505ef9=_0x2df99e[_0x3162('0xe2')][_0x5381bc];var _0x341b67=_0x505ef9[_0x3162('0x73')]?util[_0x3162('0xde')](_0x3162('0xe4'),_0x4749ba[_0x3162('0xe5')],_0x505ef9[_0x3162('0x73')]):_0x3162('0xe6');var _0x2d298e=_0x391873[_0x3162('0x75')][_0x3162('0xe7')]||util[_0x3162('0xde')](_0x3162('0xe4'),_0x3162('0xe8'),_0x505ef9[_0x3162('0x6c')]);switch(_0x4749ba['agentIdentifier']){case _0x3162('0xe9'):_0x341b67=_0x505ef9['UserId']?util[_0x3162('0xde')](_0x3162('0xe4'),_0x4749ba[_0x3162('0xe5')],_0x505ef9[_0x3162('0x73')]):_0x3162('0xe6');break;case _0x3162('0xea'):_0x341b67=_0x505ef9[_0x3162('0x73')]?_0x505ef9[_0x3162('0x71')][_0x3162('0xeb')]||_0x505ef9[_0x3162('0x71')][_0x3162('0xec')]:_0x3162('0xe6');break;case _0x3162('0xed'):_0x341b67=_0x505ef9['UserId']?_0x505ef9['User'][_0x3162('0xec')]:_0x3162('0xe6');break;default:_0x341b67=_0x505ef9[_0x3162('0x73')]?util['format']('%s%d',_0x4749ba['agentAlias'],_0x505ef9[_0x3162('0x73')]):_0x3162('0xe6');}var _0x39785a=util[_0x3162('0xde')]('[%s]\x20%s:\x20%s\x0a',moment(_0x505ef9[_0x3162('0x7a')])['format'](_0x3162('0xee')),_0x505ef9['direction']==='in'?_0x2d298e:_0x341b67,_0x505ef9[_0x3162('0x75')]);if(!_0x505ef9[_0x3162('0xef')]){fs[_0x3162('0xf0')](_0x468c8d,_0x39785a);}}return db[_0x3162('0xf1')][_0x3162('0xbd')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}}})[_0x3162('0x35')](function(_0x2c485b){if(_0x2c485b&&_0x2c485b[_0x3162('0xf2')]&&_0x391873[_0x3162('0x75')]){var _0x1be5ab={'tls':{'rejectUnauthorized':![]}};if(_0x2c485b['Smtp'][_0x3162('0xf3')]){_0x1be5ab[_0x3162('0xf3')]=_0x2c485b[_0x3162('0xf2')][_0x3162('0xf3')];}else{_0x1be5ab[_0x3162('0xf4')]=_0x2c485b[_0x3162('0xf2')]['host'];_0x1be5ab[_0x3162('0xf5')]=_0x2c485b[_0x3162('0xf2')]['port'];_0x1be5ab[_0x3162('0xf6')]=_0x2c485b['Smtp']['secure'];}if(_0x2c485b['Smtp'][_0x3162('0xf7')]){_0x1be5ab['auth']={'user':_0x2c485b[_0x3162('0xf2')]['user'],'pass':_0x2c485b[_0x3162('0xf2')][_0x3162('0xf8')]};}return respondWithRpcPromise(_0x3162('0xf9'),'sendMail',{'account':_0x1be5ab,'message':{'from':util[_0x3162('0xde')](_0x3162('0xfa'),_0x2c485b[_0x3162('0x37')],_0x2c485b[_0x3162('0xfb')]||_0x2c485b[_0x3162('0xf2')][_0x3162('0x9a')]),'to':_0x391873[_0x3162('0x75')][_0x3162('0xdd')],'subject':_0x3162('0xfc'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x391873['body']['mailTranscript']),'attachments':[{'path':_0x468c8d}]}})[_0x3162('0x35')](function(){return _0x2df99e;})[_0x3162('0x2b')](function(_0x560089){console[_0x3162('0x25')](_0x560089);});}else{return _0x2df99e;}})[_0x3162('0x35')](respondWithStatusCode(_0x548926,0xc8))['catch'](handleError(_0x548926,null));};exports[_0x3162('0xfd')]=function(_0x4e54ed,_0x2b3e5e,_0x58b2c8){return db['ChatMessage']['find']({'where':{'id':_0x4e54ed[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x2b3e5e,null))['then'](function(_0x1d3e81){if(_0x1d3e81){return _0x1d3e81[_0x3162('0xfd')](_0x4e54ed[_0x3162('0x75')]['ids'],_[_0x3162('0xfe')](_0x4e54ed['body'],[_0x3162('0xff'),'id'])||{});}})[_0x3162('0x35')](respondWithResult(_0x2b3e5e,null))[_0x3162('0x2b')](handleError(_0x2b3e5e,null));};exports[_0x3162('0x100')]=function(_0x12e467,_0x26f3ad,_0x5397e2){var _0x8d0df={'raw':![],'where':{}};var _0x167d75={};var _0x2dcc43={'count':0x0,'rows':[]};return db[_0x3162('0xb5')]['findOne']({'where':{'id':_0x12e467[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x26f3ad,null))[_0x3162('0x35')](function(_0x2d7dc2){if(_0x2d7dc2){_0x167d75[_0x3162('0x43')]=_[_0x3162('0x44')](db[_0x3162('0xe1')]['rawAttributes']);_0x167d75[_0x3162('0x45')]=_[_0x3162('0x44')](_0x12e467[_0x3162('0x45')]);_0x167d75[_0x3162('0x46')]=_[_0x3162('0x47')](_0x167d75[_0x3162('0x43')],_0x167d75['query']);_0x8d0df[_0x3162('0x49')]=_['intersection'](_0x167d75[_0x3162('0x43')],qs[_0x3162('0x48')](_0x12e467['query'][_0x3162('0x48')]));_0x8d0df[_0x3162('0x49')]=_0x8d0df[_0x3162('0x49')]['length']?_0x8d0df[_0x3162('0x49')]:_0x167d75['model'];if(!_0x12e467[_0x3162('0x45')][_0x3162('0x4b')](_0x3162('0x4c'))){_0x8d0df[_0x3162('0x31')]=qs[_0x3162('0x31')](_0x12e467[_0x3162('0x45')]['limit']);_0x8d0df[_0x3162('0x30')]=qs['offset'](_0x12e467[_0x3162('0x45')][_0x3162('0x30')]);}_0x8d0df[_0x3162('0x4d')]=qs[_0x3162('0x4e')](_0x12e467['query'][_0x3162('0x4e')]);_0x8d0df[_0x3162('0x80')]=qs[_0x3162('0x46')](_[_0x3162('0x101')](_0x12e467[_0x3162('0x45')],_0x167d75[_0x3162('0x46')]));_0x8d0df[_0x3162('0x80')]['ChatInteractionId']=_0x2d7dc2['id'];if(_0x12e467[_0x3162('0x45')][_0x3162('0x102')]){_0x8d0df[_0x3162('0x80')]=_['merge'](_0x8d0df[_0x3162('0x80')],{'$or':_[_0x3162('0x3e')](_0x8d0df['attributes'],function(_0x109f34){var _0xf633c5={};_0xf633c5[_0x109f34]={'$like':'%'+_0x12e467[_0x3162('0x45')][_0x3162('0x102')]+'%'};return _0xf633c5;})});}if(_0x12e467['query'][_0x3162('0x7c')]){var _0x655e50=_0x12e467[_0x3162('0x45')]['$gte'][_0x3162('0x3b')](',');var _0x1df3ef={};_0x1df3ef[_0x655e50[0x0]]={'$gte':moment(_0x655e50[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x8d0df[_0x3162('0x80')]=_['merge'](_0x8d0df['where'],_0x1df3ef);}_0x8d0df=_[_0x3162('0xa1')]({},_0x8d0df,_0x12e467[_0x3162('0x103')]);return db[_0x3162('0xe1')][_0x3162('0x2f')]({'where':_0x8d0df[_0x3162('0x80')]})[_0x3162('0x35')](function(_0x4db20b){_0x2dcc43[_0x3162('0x2f')]=_0x4db20b;if(_0x12e467[_0x3162('0x45')][_0x3162('0xb6')]){_0x8d0df[_0x3162('0xb7')]=[{'all':!![]}];}return db['ChatMessage'][_0x3162('0x104')](_0x8d0df);})[_0x3162('0x35')](function(_0x25a0b8){_0x2dcc43[_0x3162('0xb3')]=_0x25a0b8;return _0x2dcc43;});}})['then'](respondWithFilteredResult(_0x26f3ad,_0x8d0df))[_0x3162('0x2b')](handleError(_0x26f3ad,null));};exports[_0x3162('0x105')]=function(_0x1f1e55,_0x2aeef7,_0x12655a){var _0x2bd203={'where':{}},_0x579bf2={},_0x1363c8={'count':0x0,'rows':[]};return db[_0x3162('0xb5')][_0x3162('0xbd')]({'where':{'id':_0x1f1e55[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x2aeef7,null))['then'](function(_0x506aad){if(_0x506aad){_0x579bf2[_0x3162('0x43')]=_['keys'](db[_0x3162('0xe1')][_0x3162('0x3f')]);_0x579bf2[_0x3162('0x45')]=_[_0x3162('0x44')](_0x1f1e55['query']);_0x579bf2[_0x3162('0x46')]=_['intersection'](_0x579bf2[_0x3162('0x43')],_0x579bf2[_0x3162('0x45')]);_0x2bd203[_0x3162('0x49')]=_['intersection'](_0x579bf2[_0x3162('0x43')],qs[_0x3162('0x48')](_0x1f1e55[_0x3162('0x45')]['fields']));_0x2bd203[_0x3162('0x49')]=_0x2bd203[_0x3162('0x49')][_0x3162('0x4a')]?_0x2bd203[_0x3162('0x49')]:_0x579bf2[_0x3162('0x43')];if(!_0x1f1e55['query']['hasOwnProperty'](_0x3162('0x4c'))){_0x2bd203['limit']=qs[_0x3162('0x31')](_0x1f1e55['query'][_0x3162('0x31')]);_0x2bd203[_0x3162('0x30')]=qs[_0x3162('0x30')](_0x1f1e55['query'][_0x3162('0x30')]);}_0x2bd203[_0x3162('0x4d')]=qs['sort'](_0x1f1e55[_0x3162('0x45')]['sort']);_0x2bd203[_0x3162('0x80')]=qs[_0x3162('0x46')](_[_0x3162('0x101')](_0x1f1e55[_0x3162('0x45')],_0x579bf2[_0x3162('0x46')]));_0x2bd203[_0x3162('0x80')][_0x3162('0xb1')]=_0x506aad['id'];if(_0x1f1e55[_0x3162('0x45')][_0x3162('0x102')]){_0x2bd203[_0x3162('0x80')]=_['merge'](_0x2bd203[_0x3162('0x80')],{'$or':_[_0x3162('0x3e')](_0x2bd203[_0x3162('0x49')],function(_0x476077){var _0xa09807={};_0xa09807[_0x476077]={'$like':'%'+_0x1f1e55[_0x3162('0x45')]['filter']+'%'};return _0xa09807;})});}_0x2bd203[_0x3162('0x80')][_0x3162('0xef')]=![];if(_0x1f1e55[_0x3162('0x45')]['id']){_0x2bd203['where']['id']={'$gt':_0x1f1e55[_0x3162('0x45')]['id']};}_0x2bd203=_['merge']({},_0x2bd203,_0x1f1e55[_0x3162('0x103')]);return db[_0x3162('0xe1')][_0x3162('0x2f')]({'where':_0x2bd203[_0x3162('0x80')]})['then'](function(_0x548fb5){_0x1363c8[_0x3162('0x2f')]=_0x548fb5;_0x2bd203[_0x3162('0xb7')]=[];if(_0x1f1e55[_0x3162('0x45')][_0x3162('0x106')]){_0x2bd203[_0x3162('0xb7')]['push']({'model':db[_0x3162('0x71')],'as':'User','attributes':['id',_0x3162('0xec'),_0x3162('0xeb')]});}if(_0x1f1e55[_0x3162('0x45')]['includeAll']){_0x2bd203[_0x3162('0xb7')]=[{'all':!![]}];}return db[_0x3162('0xe1')][_0x3162('0x104')](_0x2bd203);})[_0x3162('0x35')](function(_0x201644){_0x1363c8['rows']=_0x201644;return _0x1363c8;});}})[_0x3162('0x35')](respondWithFilteredResult(_0x2aeef7,_0x2bd203))['catch'](handleError(_0x2aeef7,null));};exports[_0x3162('0x107')]=function(_0x491aed,_0x235e9f,_0x3c2e92){return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x491aed[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x235e9f,null))[_0x3162('0x35')](function(_0x26cf0e){if(_0x26cf0e){return _0x26cf0e['setTags'](_0x491aed['body'][_0x3162('0xff')],_[_0x3162('0xfe')](_0x491aed[_0x3162('0x75')],[_0x3162('0xff'),'id'])||{})[_0x3162('0x108')](function(){return db[_0x3162('0x109')]['findAll']({'attributes':['id',_0x3162('0x37'),_0x3162('0x50')],'where':{'id':_0x491aed[_0x3162('0x75')]['ids']}});})[_0x3162('0x35')](function(_0x442122){socket[_0x3162('0x10a')]('chatInteractionTags:save',{'id':Number(_0x491aed[_0x3162('0xba')]['id']),'tags':_0x442122||[]});return{'id':Number(_0x491aed[_0x3162('0xba')]['id']),'tags':_0x442122||[]};});}})['then'](respondWithResult(_0x235e9f,null))[_0x3162('0x2b')](handleError(_0x235e9f,null));};exports[_0x3162('0x10b')]=function(_0x2af795,_0x4d031b,_0x10c3ab){return db['ChatInteraction'][_0x3162('0x62')]({'where':{'id':_0x2af795[_0x3162('0xba')]['id']}})[_0x3162('0x35')](handleEntityNotFound(_0x4d031b,null))[_0x3162('0x35')](function(_0x41f32a){if(_0x41f32a){return _0x41f32a[_0x3162('0x10b')](_0x2af795[_0x3162('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x4d031b,null))['catch'](handleError(_0x4d031b,null));};exports[_0x3162('0xd9')]=function(_0x3dbcbe,_0x39a4b8){var _0x4f9c36=moment()[_0x3162('0x10c')]()['toString']();var _0x35ae89=path[_0x3162('0x10d')](config[_0x3162('0xda')],'server',_0x3162('0x10e'),'tmp');var _0x41500b=path['join'](config[_0x3162('0xda')],'server','files',_0x3162('0x10f'));var _0xe47f9b=path[_0x3162('0x10d')](_0x35ae89,_0x4f9c36);var _0x4f3266=util[_0x3162('0xde')](_0x3162('0x110'),_0x3dbcbe[_0x3162('0xba')]['id'],_0x4f9c36);var _0x478f9f=path[_0x3162('0x10d')](_0x35ae89,_0x4f3266);var _0xfadf2a=[];_0xfadf2a[_0x3162('0x111')]({'model':db[_0x3162('0x71')],'as':_0x3162('0x71'),'attributes':['id','fullname'],'raw':!![]});_0xfadf2a[_0x3162('0x111')]({'model':db['CmContact'],'as':_0x3162('0x66'),'attributes':['id','firstName',_0x3162('0x112')],'raw':!![]});if(_0x3dbcbe['query']['attachments']){_0xfadf2a[_0x3162('0x111')]({'model':db[_0x3162('0xd6')],'as':_0x3162('0xd6'),'raw':!![]});}var _0x238eef=[{'model':db[_0x3162('0xe1')],'as':'Messages','attributes':['id','body',_0x3162('0x7a'),_0x3162('0x113'),_0x3162('0xef'),'read'],'include':_0xfadf2a}];_0x238eef['push']({'model':db[_0x3162('0xbe')],'as':_0x3162('0x114'),'attributes':['id',_0x3162('0x37')]});_0x238eef[_0x3162('0x111')]({'model':db['User'],'as':_0x3162('0x115'),'attributes':['id',_0x3162('0xec')]});return db[_0x3162('0xb5')][_0x3162('0x62')]({'where':{'id':_0x3dbcbe[_0x3162('0xba')]['id']},'include':_0x238eef})['then'](handleEntityNotFound(_0x39a4b8,null))['then'](function(_0x471d89){if(_0x471d89){var _0x4f536c=_0x471d89['get']({'plain':!![]});fs[_0x3162('0x116')](_0xe47f9b);var _0x3d15ec={'format':'A4','border':_0x3162('0x117'),'header':{'height':_0x3162('0x118'),'contents':{'first':_0x3162('0x119')}},'footer':{'height':_0x3162('0x11a'),'contents':{'default':util[_0x3162('0xde')]('\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[_0x3162('0xde')]('%s\x20#%d',_0x3162('0x11b'),_0x4f536c['id']),moment()[_0x3162('0xde')](_0x3162('0x11c'))[_0x3162('0x9f')]())}}};var _0x6023bd={'channel':_0x3162('0x11b'),'account':_0x4f536c['Account'][_0x3162('0x37')],'agent':_0x4f536c[_0x3162('0x115')]?_0x4f536c[_0x3162('0x115')]['fullname']:_0x3162('0x11d'),'createdAt':moment(_0x4f536c[_0x3162('0x7a')])[_0x3162('0xde')](_0x3162('0x11e'))[_0x3162('0x9f')](),'closedAt':_0x4f536c['closed']?moment(_0x4f536c['closedAt'])[_0x3162('0xde')](_0x3162('0x11e'))['toString']():'','disposition':_0x4f536c[_0x3162('0xce')],'chatInfo':{'browser':_0x4f536c[_0x3162('0x11f')],'os':_0x4f536c[_0x3162('0x120')],'referer':_0x4f536c[_0x3162('0x121')],'customerIp':_0x4f536c['customerIp'],'customerPort':_0x4f536c['customerPort']?_0x4f536c[_0x3162('0x122')]:_0x3162('0x11d')},'messages':_(_0x4f536c[_0x3162('0xe2')])[_0x3162('0x123')]()['filter']({'secret':![]})[_0x3162('0x3e')](function(_0x42ce41){if(_0x42ce41[_0x3162('0xd6')]){var _0x5c2208=path[_0x3162('0x10d')](_0x41500b,_0x42ce41[_0x3162('0xd6')][_0x3162('0xd2')]);if(fs[_0x3162('0x124')](_0x5c2208)){fs[_0x3162('0x125')](_0x5c2208)[_0x3162('0x126')](fs[_0x3162('0x127')](path[_0x3162('0x10d')](_0xe47f9b,_0x42ce41[_0x3162('0xd6')][_0x3162('0xd2')])));}}return{'date':moment(_0x42ce41['createdAt'])[_0x3162('0xde')](_0x3162('0x11e'))[_0x3162('0x9f')](),'sender':_0x42ce41[_0x3162('0x113')]===_0x3162('0xc6')?_0x42ce41[_0x3162('0x71')]?_0x42ce41['User'][_0x3162('0xec')]:_0x3162('0xe6'):_0x42ce41[_0x3162('0x66')]['firstName']+(_0x42ce41[_0x3162('0x66')][_0x3162('0x112')]?'\x20'+_0x42ce41[_0x3162('0x66')][_0x3162('0x112')]:''),'body':_0x42ce41[_0x3162('0xd6')]?_0x42ce41[_0x3162('0xd6')][_0x3162('0xd2')]:_0x42ce41[_0x3162('0x75')],'direction':_0x42ce41[_0x3162('0x113')]==='out'?'A':'C','secret':_0x42ce41[_0x3162('0xef')],'read':_0x42ce41['read'],'attachment':_0x42ce41[_0x3162('0xd6')]};})['value']()};return ejs[_0x3162('0x128')](path[_0x3162('0x10d')](config[_0x3162('0xda')],_0x3162('0x129'),'views',_0x3162('0x12a')),{'interaction':_0x6023bd})['then'](function(_0x4d23a9){return new BPromise(function(_0x549a4b,_0x25b697){pdf[_0x3162('0xb8')](_0x4d23a9,_0x3d15ec)[_0x3162('0x12b')](path[_0x3162('0x10d')](_0xe47f9b,'transcript-'+_0x4f536c['id']+'-'+_0x4f9c36+_0x3162('0x12c')),function(_0x8d17c4,_0x52718f){if(_0x8d17c4)return _0x25b697(_0x8d17c4);_0x549a4b(_0x52718f);});});})[_0x3162('0x35')](function(){return new BPromise(function(_0x4ca74a,_0xe54261){zipdir(_0xe47f9b,{'saveTo':_0x478f9f},function(_0x5964b7,_0x19f1d6){if(_0x5964b7)return _0xe54261(_0x5964b7);return _0x4ca74a(_0x19f1d6);});})['then'](function(){return new BPromise(function(_0x4716b2,_0x5b89b7){rimraf(_0xe47f9b,function(_0x1be91b){if(_0x1be91b)_0x5b89b7(_0x1be91b);return _0x4716b2();});});})[_0x3162('0x35')](function(){return _0x39a4b8[_0x3162('0xd9')](_0x478f9f,_0x4f3266,function(_0x8922b5){if(_0x8922b5){console[_0x3162('0x12d')](_0x3162('0x12e'),_0x8922b5);}else{fs[_0x3162('0x12f')](_0x478f9f);}});});});}else{return _0x39a4b8[_0x3162('0x2c')](0xc8);}})[_0x3162('0x2b')](handleError(_0x39a4b8,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 4cb46e5..9c8a0de 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 _0x0a1c=['hook','exports','ChatInteraction','../../mysqldb','ChatMessage','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','hasOwnProperty'];(function(_0x1da94d,_0x5291ed){var _0x20da12=function(_0x5250bf){while(--_0x5250bf){_0x1da94d['push'](_0x1da94d['shift']());}};_0x20da12(++_0x5291ed);}(_0x0a1c,0xd2));var _0xc0a1=function(_0x319cb9,_0x4b8d35){_0x319cb9=_0x319cb9-0x0;var _0x1735fc=_0x0a1c[_0x319cb9];return _0x1735fc;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0xc0a1('0x0')];var ChatMessage=require(_0xc0a1('0x1'))['db'][_0xc0a1('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc0a1('0x3'),'afterDestroy':_0xc0a1('0x4')};function emitEvent(_0x108afd){return function(_0x1df4bf,_0x3f1c7e,_0x3549cf){_0x1df4bf[_0xc0a1('0x5')]({'attributes':['id'],'raw':!![]})[_0xc0a1('0x6')](function(_0x1712cd){_0x1df4bf[_0xc0a1('0x7')](_0xc0a1('0x8'),_0x1712cd[_0xc0a1('0x9')](function(_0x14e116){return{'id':_0x14e116['id']};}));return ChatMessage[_0xc0a1('0xa')]({'where':{'ChatInteractionId':_0x1df4bf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc0a1('0x6')](function(_0xa025f6){_0x1df4bf[_0xc0a1('0x7')]('unreadMessages',_0xa025f6[_0xc0a1('0xb')]);ChatInteractionEvents[_0xc0a1('0xc')](_0x108afd+':'+_0x1df4bf['id'],_0x1df4bf);ChatInteractionEvents[_0xc0a1('0xc')](_0x108afd,_0x1df4bf);_0x3549cf(null);})['catch'](_0x3549cf(null));};}for(var e in events){if(events[_0xc0a1('0xd')](e)){var event=events[e];ChatInteraction[_0xc0a1('0xe')](e,emitEvent(event));}}module[_0xc0a1('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0xf96b=['save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xf96b,0x109));var _0xbf96=function(_0x1b5bce,_0x8b2c12){_0x1b5bce=_0x1b5bce-0x0;var _0x4fb53c=_0xf96b[_0x1b5bce];return _0x4fb53c;};'use strict';var EventEmitter=require(_0xbf96('0x0'));var ChatInteraction=require(_0xbf96('0x1'))['db'][_0xbf96('0x2')];var ChatMessage=require(_0xbf96('0x1'))['db'][_0xbf96('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbf96('0x4')](0x0);var events={'afterCreate':_0xbf96('0x5'),'afterUpdate':_0xbf96('0x6'),'afterDestroy':_0xbf96('0x7')};function emitEvent(_0x38565){return function(_0xab8e7,_0xd04324,_0x162c19){_0xab8e7['getUsers']({'attributes':['id'],'raw':!![]})[_0xbf96('0x8')](function(_0x9270ca){_0xab8e7[_0xbf96('0x9')](_0xbf96('0xa'),_0x9270ca['map'](function(_0x337087){return{'id':_0x337087['id']};}));return ChatMessage[_0xbf96('0xb')]({'where':{'ChatInteractionId':_0xab8e7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbf96('0x8')](function(_0x253863){_0xab8e7[_0xbf96('0x9')](_0xbf96('0xc'),_0x253863[_0xbf96('0xd')]);ChatInteractionEvents[_0xbf96('0xe')](_0x38565+':'+_0xab8e7['id'],_0xab8e7);ChatInteractionEvents['emit'](_0x38565,_0xab8e7);_0x162c19(null);})[_0xbf96('0xf')](_0x162c19(null));};}for(var e in events){if(events[_0xbf96('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xbf96('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index cef5330..6e3862f 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 _0x10b2=['utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x431613,_0x326fcf){var _0x526421=function(_0x46a9ff){while(--_0x46a9ff){_0x431613['push'](_0x431613['shift']());}};_0x526421(++_0x326fcf);}(_0x10b2,0x89));var _0x210b=function(_0x3d2c65,_0x1517e8){_0x3d2c65=_0x3d2c65-0x0;var _0x408d28=_0x10b2[_0x3d2c65];return _0x408d28;};'use strict';var _=require(_0x210b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x210b('0x1'));var moment=require('moment');var BPromise=require(_0x210b('0x2'));var rp=require(_0x210b('0x3'));var fs=require('fs');var path=require(_0x210b('0x4'));var rimraf=require(_0x210b('0x5'));var config=require(_0x210b('0x6'));var attributes=require(_0x210b('0x7'));module[_0x210b('0x8')]=function(_0x132dfc,_0x27d66d){return _0x132dfc[_0x210b('0x9')](_0x210b('0xa'),attributes,{'tableName':_0x210b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7449d8,_0x2c4c29,_0x5bc313){if(_0x7449d8['changed'](_0x210b('0xc'))){_0x7449d8['closedAt']=moment()[_0x210b('0xd')](_0x210b('0xe'));}_0x5bc313(null,_0x7449d8);}},'charset':_0x210b('0xf'),'collate':_0x210b('0x10')});}; \ No newline at end of file +var _0x0cb9=['YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed'];(function(_0x30cb74,_0x3baf5f){var _0x1fce6f=function(_0x3e45f3){while(--_0x3e45f3){_0x30cb74['push'](_0x30cb74['shift']());}};_0x1fce6f(++_0x3baf5f);}(_0x0cb9,0xa9));var _0x90cb=function(_0x49420f,_0x453be2){_0x49420f=_0x49420f-0x0;var _0x540633=_0x0cb9[_0x49420f];return _0x540633;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x90cb('0x0'))(_0x90cb('0x1'));var moment=require(_0x90cb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x90cb('0x3'));var rimraf=require(_0x90cb('0x4'));var config=require(_0x90cb('0x5'));var attributes=require(_0x90cb('0x6'));module['exports']=function(_0x216bd3,_0x7ca819){return _0x216bd3[_0x90cb('0x7')](_0x90cb('0x8'),attributes,{'tableName':_0x90cb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b14c5,_0x154a41,_0x1e6016){if(_0x1b14c5[_0x90cb('0xa')]('closed')){_0x1b14c5['closedAt']=moment()['format'](_0x90cb('0xb'));}_0x1e6016(null,_0x1b14c5);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index cba434b..828c0b5 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 _0x4f4b=['options','raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','spread','AddTags','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateChatInteraction','ChatInteraction','update','body'];(function(_0xc941ea,_0x408c2e){var _0x3b0f27=function(_0x5a4233){while(--_0x5a4233){_0xc941ea['push'](_0xc941ea['shift']());}};_0x3b0f27(++_0x408c2e);}(_0x4f4b,0xf5));var _0xb4f4=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x4f4b[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require('lodash');var util=require(_0xb4f4('0x0'));var moment=require(_0xb4f4('0x1'));var BPromise=require(_0xb4f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb4f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4f4('0x4'))('rpc');var config=require(_0xb4f4('0x5'));var jayson=require(_0xb4f4('0x6'));var client=jayson[_0xb4f4('0x7')][_0xb4f4('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb4f4('0x9')],{'host':_0xb4f4('0xa'),'port':0x18eb});var socket=require(_0xb4f4('0xb'))(new Redis(config[_0xb4f4('0x9')]));require('./chatInteraction.socket')[_0xb4f4('0xc')](socket);function respondWithRpcPromise(_0xa9845f,_0x3fe26e,_0x25e526){return new BPromise(function(_0x2ef369,_0x242ae5){return client['request'](_0xa9845f,_0x25e526)[_0xb4f4('0xd')](function(_0x40ca2b){logger['info'](_0xb4f4('0xe'),_0x3fe26e,'request\x20sent');logger[_0xb4f4('0xf')](_0xb4f4('0x10'),_0x3fe26e,_0xb4f4('0x11'),JSON[_0xb4f4('0x12')](_0x40ca2b));if(_0x40ca2b['error']){if(_0x40ca2b[_0xb4f4('0x13')]['code']===0x1f4){logger[_0xb4f4('0x13')](_0xb4f4('0xe'),_0x3fe26e,_0x40ca2b['error'][_0xb4f4('0x14')]);return _0x242ae5(_0x40ca2b[_0xb4f4('0x13')][_0xb4f4('0x14')]);}logger[_0xb4f4('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x3fe26e,_0x40ca2b[_0xb4f4('0x13')][_0xb4f4('0x14')]);return _0x2ef369(_0x40ca2b[_0xb4f4('0x13')][_0xb4f4('0x14')]);}else{logger[_0xb4f4('0x15')](_0xb4f4('0xe'),_0x3fe26e,_0xb4f4('0x11'));_0x2ef369(_0x40ca2b[_0xb4f4('0x16')][_0xb4f4('0x14')]);}})[_0xb4f4('0x17')](function(_0x3ce668){logger[_0xb4f4('0x13')](_0xb4f4('0xe'),_0x3fe26e,_0x3ce668);_0x242ae5(_0x3ce668);});});}exports[_0xb4f4('0x18')]=function(_0x3fe747){var _0x529117=this;return new Promise(function(_0x196915,_0x5dd6a7){return db[_0xb4f4('0x19')][_0xb4f4('0x1a')](_0x3fe747[_0xb4f4('0x1b')],{'raw':_0x3fe747[_0xb4f4('0x1c')]?_0x3fe747[_0xb4f4('0x1c')][_0xb4f4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fe747[_0xb4f4('0x1c')]?_0x3fe747[_0xb4f4('0x1c')][_0xb4f4('0x1e')]||null:null,'attributes':_0x3fe747['options']?_0x3fe747[_0xb4f4('0x1c')][_0xb4f4('0x1f')]||null:null,'limit':_0x3fe747[_0xb4f4('0x1c')]?_0x3fe747[_0xb4f4('0x1c')][_0xb4f4('0x20')]||null:null})[_0xb4f4('0xd')](function(_0x1a8cbb){logger[_0xb4f4('0x15')]('UpdateChatInteraction',_0x3fe747);logger[_0xb4f4('0xf')](_0xb4f4('0x18'),_0x3fe747,JSON[_0xb4f4('0x12')](_0x1a8cbb));_0x196915(_0x1a8cbb);})[_0xb4f4('0x17')](function(_0x4db087){logger[_0xb4f4('0x13')](_0xb4f4('0x18'),_0x4db087[_0xb4f4('0x14')],_0x3fe747);_0x5dd6a7(_0x529117[_0xb4f4('0x13')](0x1f4,_0x4db087['message']));});});};exports[_0xb4f4('0x21')]=function(_0x436876){return new Promise(function(_0xb24f17,_0x55b054){return db[_0xb4f4('0x19')][_0xb4f4('0x22')]({'where':_0x436876['options']?_0x436876['options'][_0xb4f4('0x1e')]||null:null})[_0xb4f4('0xd')](function(_0x24ee51){if(_0x24ee51){return _0x24ee51['addTags'](_0x436876['body'][_0xb4f4('0x23')],_[_0xb4f4('0x24')](_0x436876[_0xb4f4('0x1b')],['ids','id'])||{});}})[_0xb4f4('0x25')](function(_0x2dbea0){logger[_0xb4f4('0x15')]('AddTags',_0x436876);logger[_0xb4f4('0xf')](_0xb4f4('0x26'),_0x436876,JSON[_0xb4f4('0x12')](_0x2dbea0));_0xb24f17(_0x2dbea0);})[_0xb4f4('0x17')](function(_0x27f341){logger[_0xb4f4('0x13')](_0xb4f4('0x26'),_0x27f341[_0xb4f4('0x14')],_0x436876);_0x55b054(_this[_0xb4f4('0x13')](0x1f4,_0x27f341['message']));});});}; \ No newline at end of file +var _0x563d=['raw','where','attributes','limit','AddTagsToChatInteraction','find','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x563d,0x138));var _0xd563=function(_0x189d3c,_0x5efebf){_0x189d3c=_0x189d3c-0x0;var _0x485959=_0x563d[_0x189d3c];return _0x485959;};'use strict';var _=require(_0xd563('0x0'));var util=require(_0xd563('0x1'));var moment=require(_0xd563('0x2'));var BPromise=require(_0xd563('0x3'));var rs=require(_0xd563('0x4'));var fs=require('fs');var Redis=require(_0xd563('0x5'));var db=require(_0xd563('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd563('0x7'))(_0xd563('0x8'));var config=require(_0xd563('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd563('0xa')][_0xd563('0xb')]({'port':0x232a});config[_0xd563('0xc')]=_[_0xd563('0xd')](config[_0xd563('0xc')],{'host':_0xd563('0xe'),'port':0x18eb});var socket=require(_0xd563('0xf'))(new Redis(config[_0xd563('0xc')]));require('./chatInteraction.socket')[_0xd563('0x10')](socket);function respondWithRpcPromise(_0x406a7d,_0x1c78bd,_0x5eb875){return new BPromise(function(_0x4c6cd5,_0x47128b){return client['request'](_0x406a7d,_0x5eb875)[_0xd563('0x11')](function(_0x1d1fd3){logger[_0xd563('0x12')](_0xd563('0x13'),_0x1c78bd,'request\x20sent');logger[_0xd563('0x14')](_0xd563('0x15'),_0x1c78bd,'request\x20sent',JSON[_0xd563('0x16')](_0x1d1fd3));if(_0x1d1fd3[_0xd563('0x17')]){if(_0x1d1fd3[_0xd563('0x17')][_0xd563('0x18')]===0x1f4){logger[_0xd563('0x17')](_0xd563('0x13'),_0x1c78bd,_0x1d1fd3[_0xd563('0x17')][_0xd563('0x19')]);return _0x47128b(_0x1d1fd3[_0xd563('0x17')]['message']);}logger[_0xd563('0x17')](_0xd563('0x13'),_0x1c78bd,_0x1d1fd3['error'][_0xd563('0x19')]);return _0x4c6cd5(_0x1d1fd3[_0xd563('0x17')][_0xd563('0x19')]);}else{logger[_0xd563('0x12')](_0xd563('0x13'),_0x1c78bd,'request\x20sent');_0x4c6cd5(_0x1d1fd3[_0xd563('0x1a')][_0xd563('0x19')]);}})[_0xd563('0x1b')](function(_0x26b52f){logger['error'](_0xd563('0x13'),_0x1c78bd,_0x26b52f);_0x47128b(_0x26b52f);});});}exports[_0xd563('0x1c')]=function(_0x2183c3){var _0x467482=this;return new Promise(function(_0x969082,_0x26f87a){return db[_0xd563('0x1d')][_0xd563('0x1e')](_0x2183c3['body'],{'raw':_0x2183c3['options']?_0x2183c3[_0xd563('0x1f')][_0xd563('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2183c3[_0xd563('0x1f')]?_0x2183c3[_0xd563('0x1f')][_0xd563('0x21')]||null:null,'attributes':_0x2183c3['options']?_0x2183c3[_0xd563('0x1f')][_0xd563('0x22')]||null:null,'limit':_0x2183c3[_0xd563('0x1f')]?_0x2183c3[_0xd563('0x1f')][_0xd563('0x23')]||null:null})['then'](function(_0x2da4d1){logger['info']('UpdateChatInteraction',_0x2183c3);logger['debug'](_0xd563('0x1c'),_0x2183c3,JSON[_0xd563('0x16')](_0x2da4d1));_0x969082(_0x2da4d1);})[_0xd563('0x1b')](function(_0x56197c){logger['error']('UpdateChatInteraction',_0x56197c['message'],_0x2183c3);_0x26f87a(_0x467482[_0xd563('0x17')](0x1f4,_0x56197c[_0xd563('0x19')]));});});};exports[_0xd563('0x24')]=function(_0x15ddd9){return new Promise(function(_0x5e0675,_0x29718e){return db[_0xd563('0x1d')][_0xd563('0x25')]({'where':_0x15ddd9[_0xd563('0x1f')]?_0x15ddd9[_0xd563('0x1f')][_0xd563('0x21')]||null:null})[_0xd563('0x11')](function(_0x1290e4){if(_0x1290e4){return _0x1290e4['addTags'](_0x15ddd9['body'][_0xd563('0x26')],_[_0xd563('0x27')](_0x15ddd9[_0xd563('0x28')],[_0xd563('0x26'),'id'])||{});}})[_0xd563('0x29')](function(_0x260ed1){logger[_0xd563('0x12')]('AddTags',_0x15ddd9);logger[_0xd563('0x14')](_0xd563('0x2a'),_0x15ddd9,JSON[_0xd563('0x16')](_0x260ed1));_0x5e0675(_0x260ed1);})[_0xd563('0x1b')](function(_0x4e46e9){logger[_0xd563('0x17')]('AddTags',_0x4e46e9[_0xd563('0x19')],_0x15ddd9);_0x29718e(_this['error'](0x1f4,_0x4e46e9[_0xd563('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 9eaced8..1dd1b52 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 _0x5cc8=['save','removeListener','chatInteraction:','./chatInteraction.events'];(function(_0x20b20f,_0x1a52bc){var _0x27f90c=function(_0x481321){while(--_0x481321){_0x20b20f['push'](_0x20b20f['shift']());}};_0x27f90c(++_0x1a52bc);}(_0x5cc8,0x11f));var _0x85cc=function(_0x45de1d,_0x3bee30){_0x45de1d=_0x45de1d-0x0;var _0x8df294=_0x5cc8[_0x45de1d];return _0x8df294;};'use strict';var ChatInteractionEvents=require(_0x85cc('0x0'));var events=[_0x85cc('0x1'),'remove','update'];function createListener(_0x19ff7e,_0x2ebc06){return function(_0x14313d){_0x2ebc06['emit'](_0x19ff7e,_0x14313d);};}function removeListener(_0x3367cf,_0x2466ec){return function(){ChatInteractionEvents[_0x85cc('0x2')](_0x3367cf,_0x2466ec);};}exports['register']=function(_0x2f421d){for(var _0x3c2bf6=0x0,_0x2593c5=events['length'];_0x3c2bf6<_0x2593c5;_0x3c2bf6++){var _0x22d463=events[_0x3c2bf6];var _0x2c9c04=createListener(_0x85cc('0x3')+_0x22d463,_0x2f421d);ChatInteractionEvents['on'](_0x22d463,_0x2c9c04);}}; \ No newline at end of file +var _0x7421=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x6c01fc,_0x49da43){var _0x4f6c39=function(_0x4a8b04){while(--_0x4a8b04){_0x6c01fc['push'](_0x6c01fc['shift']());}};_0x4f6c39(++_0x49da43);}(_0x7421,0xe9));var _0x1742=function(_0x22cbfc,_0x2b9ec8){_0x22cbfc=_0x22cbfc-0x0;var _0x441883=_0x7421[_0x22cbfc];return _0x441883;};'use strict';var ChatInteractionEvents=require(_0x1742('0x0'));var events=[_0x1742('0x1'),_0x1742('0x2'),_0x1742('0x3')];function createListener(_0x5a7422,_0xd60d8c){return function(_0x54781d){_0xd60d8c[_0x1742('0x4')](_0x5a7422,_0x54781d);};}function removeListener(_0x2a6346,_0x248fb0){return function(){ChatInteractionEvents[_0x1742('0x5')](_0x2a6346,_0x248fb0);};}exports[_0x1742('0x6')]=function(_0x3ae76c){for(var _0x4166df=0x0,_0x4f1b59=events[_0x1742('0x7')];_0x4166df<_0x4f1b59;_0x4166df++){var _0x459994=events[_0x4166df];var _0x265c00=createListener('chatInteraction:'+_0x459994,_0x3ae76c);ChatInteractionEvents['on'](_0x459994,_0x265c00);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 586185c..1dc18de 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 _0xa486=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','path','express'];(function(_0xde2f8c,_0xbb9408){var _0x3ee25c=function(_0x3ad9d5){while(--_0x3ad9d5){_0xde2f8c['push'](_0xde2f8c['shift']());}};_0x3ee25c(++_0xbb9408);}(_0xa486,0x17d));var _0x6a48=function(_0x289995,_0x344805){_0x289995=_0x289995-0x0;var _0x50c5ce=_0xa486[_0x289995];return _0x50c5ce;};'use strict';var multer=require(_0x6a48('0x0'));var util=require('util');var path=require(_0x6a48('0x1'));var timeout=require('connect-timeout');var express=require(_0x6a48('0x2'));var router=express['Router']();var auth=require(_0x6a48('0x3'));var interaction=require(_0x6a48('0x4'));var config=require(_0x6a48('0x5'));var controller=require(_0x6a48('0x6'));router[_0x6a48('0x7')]('/',auth[_0x6a48('0x8')](),controller[_0x6a48('0x9')]);router[_0x6a48('0x7')](_0x6a48('0xa'),auth[_0x6a48('0x8')](),controller[_0x6a48('0xb')]);router[_0x6a48('0x7')](_0x6a48('0xc'),auth[_0x6a48('0xd')](),controller[_0x6a48('0xe')]);router[_0x6a48('0x7')]('/:id/attachment_download',auth[_0x6a48('0xd')](),controller['attachmentDownload']);router[_0x6a48('0x7')](_0x6a48('0xf'),auth[_0x6a48('0x8')](),controller[_0x6a48('0x10')]);router[_0x6a48('0x7')](_0x6a48('0x11'),auth[_0x6a48('0xd')](),controller[_0x6a48('0x12')]);router[_0x6a48('0x7')](_0x6a48('0x13'),auth[_0x6a48('0x8')](),controller[_0x6a48('0x14')]);router[_0x6a48('0x15')]('/',auth[_0x6a48('0x8')](),controller[_0x6a48('0x16')]);router[_0x6a48('0x15')](_0x6a48('0x17'),auth[_0x6a48('0x8')](),controller[_0x6a48('0x18')]);var upload=multer({'storage':multer[_0x6a48('0x19')]({'destination':function(_0x3315c1,_0x10867e,_0x231930){_0x231930(null,path[_0x6a48('0x1a')](config[_0x6a48('0x1b')],_0x6a48('0x1c')));},'filename':function(_0x41218a,_0x20cab5,_0x506bd2){_0x506bd2(null,util[_0x6a48('0x1d')](_0x6a48('0x1e'),Date[_0x6a48('0x1f')](),_0x20cab5[_0x6a48('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6a48('0x15')](_0x6a48('0x21'),upload[_0x6a48('0x22')]('file'),controller[_0x6a48('0x23')]);router[_0x6a48('0x15')](_0x6a48('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x6a48('0x24')]);router[_0x6a48('0x15')](_0x6a48('0x25'),auth[_0x6a48('0x8')](),interaction['tracked'](_0x6a48('0x26'),_0x6a48('0x27')),controller['addTags']);router['put'](_0x6a48('0xc'),auth[_0x6a48('0x8')](),interaction['tracked'](_0x6a48('0x26'),'chatinteraction:update'),controller['update']);router['put']('/:id/custom_update',controller[_0x6a48('0x28')]);router['put'](_0x6a48('0x29'),auth['isChatInteractionAuthorized'](),controller['abandon']);router['put']('/:id/close',controller[_0x6a48('0x2a')]);router[_0x6a48('0x2b')](_0x6a48('0xc'),auth[_0x6a48('0x8')](),interaction['tracked'](_0x6a48('0x26'),_0x6a48('0x2c')),controller[_0x6a48('0x2d')]);router[_0x6a48('0x2b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6a48('0x2e')]);module[_0x6a48('0x2f')]=router; \ No newline at end of file +var _0x693f=['delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/my_messages','isChatInteractionAuthorized','/:id/download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x693f,0x9d));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var path=require(_0xf693('0x2'));var timeout=require(_0xf693('0x3'));var express=require('express');var router=express[_0xf693('0x4')]();var auth=require(_0xf693('0x5'));var interaction=require(_0xf693('0x6'));var config=require(_0xf693('0x7'));var controller=require(_0xf693('0x8'));router[_0xf693('0x9')]('/',auth[_0xf693('0xa')](),controller['index']);router[_0xf693('0x9')](_0xf693('0xb'),auth['isAuthenticated'](),controller[_0xf693('0xc')]);router['get'](_0xf693('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xf693('0xe')]);router[_0xf693('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xf693('0x9')]('/:id/messages',auth[_0xf693('0xa')](),controller[_0xf693('0xf')]);router[_0xf693('0x9')](_0xf693('0x10'),auth[_0xf693('0x11')](),controller['getMyMessages']);router['get'](_0xf693('0x12'),auth[_0xf693('0xa')](),controller['download']);router[_0xf693('0x13')]('/',auth[_0xf693('0xa')](),controller['create']);router['post'](_0xf693('0x14'),auth[_0xf693('0xa')](),controller[_0xf693('0x15')]);var upload=multer({'storage':multer[_0xf693('0x16')]({'destination':function(_0x36d92c,_0x5541a7,_0x1d9278){_0x1d9278(null,path[_0xf693('0x17')](config[_0xf693('0x18')],_0xf693('0x19')));},'filename':function(_0x345539,_0x19ea07,_0x49fbbb){_0x49fbbb(null,util['format']('%s-%s',Date[_0xf693('0x1a')](),_0x19ea07[_0xf693('0x1b')][_0xf693('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf693('0x13')](_0xf693('0x1d'),upload['single'](_0xf693('0x1e')),controller[_0xf693('0x1f')]);router[_0xf693('0x13')](_0xf693('0x20'),auth[_0xf693('0x11')](),controller[_0xf693('0x21')]);router[_0xf693('0x13')](_0xf693('0x22'),auth['isAuthenticated'](),interaction[_0xf693('0x23')](_0xf693('0x24'),_0xf693('0x25')),controller[_0xf693('0x26')]);router[_0xf693('0x27')](_0xf693('0xd'),auth[_0xf693('0xa')](),interaction['tracked'](_0xf693('0x24'),_0xf693('0x28')),controller[_0xf693('0x29')]);router[_0xf693('0x27')]('/:id/custom_update',controller[_0xf693('0x2a')]);router[_0xf693('0x27')](_0xf693('0x2b'),auth[_0xf693('0x11')](),controller[_0xf693('0x2c')]);router[_0xf693('0x27')](_0xf693('0x2d'),controller[_0xf693('0x2e')]);router[_0xf693('0x2f')](_0xf693('0xd'),auth['isAuthenticated'](),interaction[_0xf693('0x23')](_0xf693('0x24'),_0xf693('0x30')),controller[_0xf693('0x31')]);router[_0xf693('0x2f')](_0xf693('0x22'),auth[_0xf693('0xa')](),controller[_0xf693('0x32')]);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 19fb50b..5760877 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 _0x1a85=['BOOLEAN','TEXT','medium'];(function(_0x531cb8,_0x8ef36f){var _0x5cf297=function(_0x45acb4){while(--_0x45acb4){_0x531cb8['push'](_0x531cb8['shift']());}};_0x5cf297(++_0x8ef36f);}(_0x1a85,0x178));var _0x51a8=function(_0x5c23cc,_0x3bac85){_0x5c23cc=_0x5c23cc-0x0;var _0x1add2d=_0x1a85[_0x5c23cc];return _0x1add2d;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x51a8('0x0')](_0x51a8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1a85=['BOOLEAN','TEXT','medium'];(function(_0x211632,_0x378e2e){var _0x5a1da1=function(_0x44aff2){while(--_0x44aff2){_0x211632['push'](_0x211632['shift']());}};_0x5a1da1(++_0x378e2e);}(_0x1a85,0x178));var _0x51a8=function(_0x4f7a97,_0x14f986){_0x4f7a97=_0x4f7a97-0x0;var _0x2d97cb=_0x1a85[_0x4f7a97];return _0x2d97cb;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x51a8('0x0')](_0x51a8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x51a8('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 9087667..ebe1b20 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 _0xe78f=['where','VIRTUAL','merge','options','ChatInternalMessage','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','update','describe','get','messages','createdAt','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','UserProfileSection','userProfileId','autoAssociation','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','limit','sort','pick','filter'];(function(_0x403509,_0x113905){var _0x38711a=function(_0x3e96e6){while(--_0x3e96e6){_0x403509['push'](_0x403509['shift']());}};_0x38711a(++_0x113905);}(_0xe78f,0x15f));var _0xfe78=function(_0x1a5266,_0x30ac46){_0x1a5266=_0x1a5266-0x0;var _0x139a98=_0xe78f[_0x1a5266];return _0x139a98;};'use strict';var pdf=require(_0xfe78('0x0'));var emlformat=require(_0xfe78('0x1'));var rimraf=require(_0xfe78('0x2'));var zipdir=require(_0xfe78('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe78('0x4'));var moment=require(_0xfe78('0x5'));var BPromise=require(_0xfe78('0x6'));var Mustache=require(_0xfe78('0x7'));var util=require('util');var path=require(_0xfe78('0x8'));var sox=require(_0xfe78('0x9'));var csv=require(_0xfe78('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfe78('0xb'));var squel=require(_0xfe78('0xc'));var crypto=require(_0xfe78('0xd'));var jsforce=require(_0xfe78('0xe'));var deskjs=require(_0xfe78('0xf'));var toCsv=require(_0xfe78('0xa'));var querystring=require(_0xfe78('0x10'));var Papa=require(_0xfe78('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfe78('0x12'));var as=require(_0xfe78('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe78('0x14'))(_0xfe78('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xfe78('0x16')],{'host':_0xfe78('0x17'),'port':0x18eb});var socket=require(_0xfe78('0x18'))(new Redis(config[_0xfe78('0x16')]));require(_0xfe78('0x19'))['register'](socket);function respondWithStatusCode(_0x4a8b15,_0x5b4477){_0x5b4477=_0x5b4477||0xcc;return function(_0x2524b0){if(_0x2524b0){return _0x4a8b15['sendStatus'](_0x5b4477);}return _0x4a8b15[_0xfe78('0x1a')](_0x5b4477)['end']();};}function respondWithResult(_0x4aea2d,_0x1d83cd){_0x1d83cd=_0x1d83cd||0xc8;return function(_0x436999){if(_0x436999){return _0x4aea2d[_0xfe78('0x1a')](_0x1d83cd)[_0xfe78('0x1b')](_0x436999);}};}function respondWithFilteredResult(_0x5477bf,_0x58d07b){return function(_0x1fa9c9){if(_0x1fa9c9){var _0x176ca5=_0x1fa9c9[_0xfe78('0x1c')],_0x36a366=_0x58d07b[_0xfe78('0x1d')],_0x33e88e=_0x58d07b[_0xfe78('0x1d')]+_0x58d07b['limit'],_0x58ed73;if(_0x33e88e>=_0x176ca5){_0x33e88e=_0x176ca5;_0x58ed73=0xc8;}else{_0x58ed73=0xce;}_0x5477bf[_0xfe78('0x1a')](_0x58ed73);return _0x5477bf['set'](_0xfe78('0x1e'),_0x36a366+'-'+_0x33e88e+'/'+_0x176ca5)[_0xfe78('0x1b')](_0x1fa9c9);}return null;};}function patchUpdates(_0x405fae){return function(_0x1b006a){try{jsonpatch[_0xfe78('0x1f')](_0x1b006a,_0x405fae,!![]);}catch(_0x1b6735){return BPromise[_0xfe78('0x20')](_0x1b6735);}return _0x1b006a[_0xfe78('0x21')]();};}function saveUpdates(_0x13d780,_0x25fafb){return function(_0x3cb12a){if(_0x3cb12a){return _0x3cb12a['update'](_0x13d780)[_0xfe78('0x22')](function(_0x1513c3){return _0x1513c3;});}return null;};}function removeEntity(_0x3eca99,_0x5eea61){return function(_0x45f901){if(_0x45f901){return _0x45f901[_0xfe78('0x23')]()[_0xfe78('0x22')](function(){_0x3eca99[_0xfe78('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14e443,_0x23ae1f){return function(_0x4779b7){if(!_0x4779b7){_0x14e443[_0xfe78('0x24')](0x194);}return _0x4779b7;};}function handleError(_0x940cb2,_0x686b8c){_0x686b8c=_0x686b8c||0x1f4;return function(_0x1c26fe){logger[_0xfe78('0x25')](_0x1c26fe[_0xfe78('0x26')]);if(_0x1c26fe['name']){delete _0x1c26fe[_0xfe78('0x27')];}_0x940cb2[_0xfe78('0x1a')](_0x686b8c)[_0xfe78('0x28')](_0x1c26fe);};}exports['index']=function(_0xdcba08,_0x870078){var _0x59d891={},_0x56cffd={},_0x17203c={'count':0x0,'rows':[]};var _0x484b5a=_[_0xfe78('0x29')](db['ChatInternalMessage'][_0xfe78('0x2a')],function(_0x2eb999){return{'name':_0x2eb999[_0xfe78('0x2b')],'type':_0x2eb999[_0xfe78('0x2c')]['key']};});_0x56cffd['model']=_[_0xfe78('0x29')](_0x484b5a,_0xfe78('0x27'));_0x56cffd[_0xfe78('0x2d')]=_['keys'](_0xdcba08[_0xfe78('0x2d')]);_0x56cffd[_0xfe78('0x2e')]=_[_0xfe78('0x2f')](_0x56cffd['model'],_0x56cffd[_0xfe78('0x2d')]);_0x59d891[_0xfe78('0x30')]=_['intersection'](_0x56cffd[_0xfe78('0x31')],qs['fields'](_0xdcba08[_0xfe78('0x2d')][_0xfe78('0x32')]));_0x59d891[_0xfe78('0x30')]=_0x59d891[_0xfe78('0x30')][_0xfe78('0x33')]?_0x59d891[_0xfe78('0x30')]:_0x56cffd[_0xfe78('0x31')];if(!_0xdcba08[_0xfe78('0x2d')]['hasOwnProperty'](_0xfe78('0x34'))){_0x59d891[_0xfe78('0x35')]=qs[_0xfe78('0x35')](_0xdcba08['query']['limit']);_0x59d891[_0xfe78('0x1d')]=qs[_0xfe78('0x1d')](_0xdcba08[_0xfe78('0x2d')][_0xfe78('0x1d')]);}_0x59d891['order']=qs['sort'](_0xdcba08['query'][_0xfe78('0x36')]);_0x59d891['where']=qs[_0xfe78('0x2e')](_[_0xfe78('0x37')](_0xdcba08[_0xfe78('0x2d')],_0x56cffd[_0xfe78('0x2e')]),_0x484b5a);if(_0xdcba08[_0xfe78('0x2d')][_0xfe78('0x38')]){_0x59d891['where']=_['merge'](_0x59d891[_0xfe78('0x39')],{'$or':_[_0xfe78('0x29')](_0x484b5a,function(_0x1b32f4){if(_0x1b32f4[_0xfe78('0x2c')]!==_0xfe78('0x3a')){var _0x3ca781={};_0x3ca781[_0x1b32f4[_0xfe78('0x27')]]={'$like':'%'+_0xdcba08[_0xfe78('0x2d')]['filter']+'%'};return _0x3ca781;}})});}_0x59d891=_[_0xfe78('0x3b')]({},_0x59d891,_0xdcba08[_0xfe78('0x3c')]);var _0x4ba781={'where':_0x59d891[_0xfe78('0x39')]};return db[_0xfe78('0x3d')][_0xfe78('0x1c')](_0x4ba781)[_0xfe78('0x22')](function(_0x5bc18e){_0x17203c[_0xfe78('0x1c')]=_0x5bc18e;if(_0xdcba08['query']['includeAll']){_0x59d891[_0xfe78('0x3e')]=[{'all':!![]}];}return db[_0xfe78('0x3d')][_0xfe78('0x3f')](_0x59d891);})['then'](function(_0x3e0a85){_0x17203c[_0xfe78('0x40')]=_0x3e0a85;return _0x17203c;})['then'](respondWithFilteredResult(_0x870078,_0x59d891))['catch'](handleError(_0x870078,null));};exports[_0xfe78('0x41')]=function(_0x3a2db0,_0x4aa36a){var _0x423215={'raw':!![],'where':{'id':_0x3a2db0[_0xfe78('0x42')]['id']}},_0x44ca06={};_0x44ca06[_0xfe78('0x31')]=_[_0xfe78('0x43')](db[_0xfe78('0x3d')][_0xfe78('0x2a')]);_0x44ca06['query']=_[_0xfe78('0x43')](_0x3a2db0['query']);_0x44ca06['filters']=_[_0xfe78('0x2f')](_0x44ca06[_0xfe78('0x31')],_0x44ca06[_0xfe78('0x2d')]);_0x423215[_0xfe78('0x30')]=_['intersection'](_0x44ca06[_0xfe78('0x31')],qs['fields'](_0x3a2db0['query'][_0xfe78('0x32')]));_0x423215[_0xfe78('0x30')]=_0x423215[_0xfe78('0x30')]['length']?_0x423215['attributes']:_0x44ca06[_0xfe78('0x31')];if(_0x3a2db0[_0xfe78('0x2d')][_0xfe78('0x44')]){_0x423215[_0xfe78('0x3e')]=[{'all':!![]}];}_0x423215=_['merge']({},_0x423215,_0x3a2db0['options']);return db[_0xfe78('0x3d')][_0xfe78('0x45')](_0x423215)['then'](handleEntityNotFound(_0x4aa36a,null))[_0xfe78('0x22')](respondWithResult(_0x4aa36a,null))[_0xfe78('0x46')](handleError(_0x4aa36a,null));};exports['create']=function(_0x17f937,_0x3daedc){return db[_0xfe78('0x3d')][_0xfe78('0x47')](_0x17f937[_0xfe78('0x48')],{})['then'](respondWithResult(_0x3daedc,0xc9))['catch'](handleError(_0x3daedc,null));};exports[_0xfe78('0x49')]=function(_0x3cdca8,_0x448b2d){if(_0x3cdca8['body']['id']){delete _0x3cdca8['body']['id'];}return db[_0xfe78('0x3d')][_0xfe78('0x45')]({'where':{'id':_0x3cdca8[_0xfe78('0x42')]['id']}})[_0xfe78('0x22')](handleEntityNotFound(_0x448b2d,null))[_0xfe78('0x22')](saveUpdates(_0x3cdca8['body'],null))['then'](respondWithResult(_0x448b2d,null))[_0xfe78('0x46')](handleError(_0x448b2d,null));};exports['destroy']=function(_0x3df663,_0x483592){return db[_0xfe78('0x3d')][_0xfe78('0x45')]({'where':{'id':_0x3df663[_0xfe78('0x42')]['id']}})[_0xfe78('0x22')](handleEntityNotFound(_0x483592,null))[_0xfe78('0x22')](removeEntity(_0x483592,null))[_0xfe78('0x46')](handleError(_0x483592,null));};exports[_0xfe78('0x4a')]=function(_0x3cafdf,_0x47e353){return db[_0xfe78('0x3d')][_0xfe78('0x4a')]()[_0xfe78('0x22')](respondWithResult(_0x47e353,null))[_0xfe78('0x46')](handleError(_0x47e353,null));};function wrapUser(_0x151a1f){return function(_0x1cb469){var _0x59ea86=_0x151a1f[_0xfe78('0x4b')]({'plain':!![]});_0x59ea86[_0xfe78('0x4c')]=[];if(_0x1cb469){_0x59ea86['lastMessageAt']=_0x1cb469[_0xfe78('0x4d')];_0x59ea86['lastMessage']=_0x1cb469;}else{_0x59ea86[_0xfe78('0x4e')]=moment(0x0)['format'](_0xfe78('0x4f'));_0x59ea86['lastMessage']={};}return _0x59ea86;};}exports['getUsers']=function(_0x25a119,_0x16706f,_0x37f2d0){var _0xe0f65f=[];return db[_0xfe78('0x50')][_0xfe78('0x3f')]({'where':{'role':[_0xfe78('0x51'),_0xfe78('0x52'),_0xfe78('0x53')]},'attributes':['id','fullname',_0xfe78('0x27'),_0xfe78('0x54'),_0xfe78('0x55'),'internal',_0xfe78('0x56'),_0xfe78('0x57'),_0xfe78('0x58'),'showWebBar'],'order':qs[_0xfe78('0x36')](_0xfe78('0x59')),'include':[{'model':db[_0xfe78('0x5a')],'as':'VoiceQueues','attributes':['id',_0xfe78('0x27'),_0xfe78('0x2c')],'through':{'attributes':[]}}]})['then'](function(_0x323c3d){if(_0x323c3d){var _0x1d5058=_0x25a119[_0xfe78('0x53')][_0xfe78('0x4b')]({'plain':!![]});if(!_0x1d5058)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1d5058[_0xfe78('0x54')]===_0xfe78('0x53')){return db[_0xfe78('0x5b')][_0xfe78('0x45')]({'where':{'name':'Agents','userProfileId':_0x1d5058[_0xfe78('0x5c')]},'raw':!![]})[_0xfe78('0x22')](function(_0x48e9d5){if(_0x48e9d5){if(_0x48e9d5[_0xfe78('0x5d')]===0x0){return db['UserProfileResource'][_0xfe78('0x3f')]({'where':{'sectionId':_0x48e9d5['id']},'raw':!![]})[_0xfe78('0x22')](function(_0x965c50){var _0x80da5a=[];if(_[_0xfe78('0x5e')](_0x965c50)){_0x80da5a=_[_0xfe78('0x38')](_0x323c3d,function(_0x5cd777){if(_0x5cd777[_0xfe78('0x54')]!==_0xfe78('0x51')){return _0x5cd777;}});return _0x80da5a;}else{for(var _0x4bdd1e=0x0;_0x4bdd1e<_0x323c3d[_0xfe78('0x33')];_0x4bdd1e++){var _0x1df130=_0x323c3d[_0x4bdd1e];if(_0x1df130[_0xfe78('0x54')]===_0xfe78('0x51')){var _0x318d7a=_[_0xfe78('0x45')](_0x965c50,function(_0x438dd5){return _0x438dd5[_0xfe78('0x5f')]===_0x1df130['id'];});if(_0x318d7a)_0x80da5a[_0xfe78('0x60')](_0x1df130);}else{_0x80da5a[_0xfe78('0x60')](_0x1df130);}}return _0x80da5a;}});}else{return _0x323c3d;}}else{var _0x1a897c=_[_0xfe78('0x38')](_0x323c3d,function(_0x4ec7a2){if(_0x4ec7a2[_0xfe78('0x54')]!==_0xfe78('0x51')){return _0x4ec7a2;}});return _0x1a897c;}});}else{return _0x323c3d;}}})[_0xfe78('0x22')](function(_0xb85653){var _0x17d5fb=[];if(_0xb85653){_0xe0f65f=_0xb85653;for(var _0x320095=0x0;_0x320095<_0xb85653['length'];_0x320095+=0x1){_0xe0f65f[_0x320095][_0xfe78('0x4c')]=[];_0x17d5fb[_0xfe78('0x60')](db[_0xfe78('0x3d')]['find']({'where':{'FromId':[_0x25a119[_0xfe78('0x53')]['id'],_0xb85653[_0x320095]['id']],'ToId':[_0x25a119['user']['id'],_0xb85653[_0x320095]['id']],'ChatGroupId':null},'attributes':['id',_0xfe78('0x4d'),_0xfe78('0x61'),_0xfe78('0x62'),_0xfe78('0x63'),_0xfe78('0x48')],'order':qs[_0xfe78('0x36')](_0xfe78('0x64')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xfe78('0x22')](wrapUser(_0xb85653[_0x320095])));}return BPromise[_0xfe78('0x65')](_0x17d5fb);}return[];})[_0xfe78('0x22')](function(_0x478286){return{'rows':_0x478286,'count':_0x478286[_0xfe78('0x33')]};})[_0xfe78('0x22')](respondWithResult(_0x16706f,null))['catch'](handleError(_0x16706f,null));}; \ No newline at end of file +var _0x8bfe=['util','sox','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','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','then','destroy','stack','name','send','map','ChatInternalMessage','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','read','all','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xf5c31b,_0x52c369){var _0xfd1027=function(_0x27b252){while(--_0x27b252){_0xf5c31b['push'](_0xf5c31b['shift']());}};_0xfd1027(++_0x52c369);}(_0x8bfe,0x1a9));var _0xe8bf=function(_0x33c2af,_0x163198){_0x33c2af=_0x33c2af-0x0;var _0x13c04a=_0x8bfe[_0x33c2af];return _0x13c04a;};'use strict';var pdf=require(_0xe8bf('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe8bf('0x1'));var jsonpatch=require(_0xe8bf('0x2'));var rp=require(_0xe8bf('0x3'));var moment=require(_0xe8bf('0x4'));var BPromise=require(_0xe8bf('0x5'));var Mustache=require(_0xe8bf('0x6'));var util=require(_0xe8bf('0x7'));var path=require('path');var sox=require(_0xe8bf('0x8'));var csv=require(_0xe8bf('0x9'));var ejs=require(_0xe8bf('0xa'));var fs=require('fs');var _=require(_0xe8bf('0xb'));var squel=require(_0xe8bf('0xc'));var crypto=require(_0xe8bf('0xd'));var jsforce=require(_0xe8bf('0xe'));var deskjs=require(_0xe8bf('0xf'));var toCsv=require(_0xe8bf('0x9'));var querystring=require('querystring');var Papa=require(_0xe8bf('0x10'));var Redis=require(_0xe8bf('0x11'));var authService=require(_0xe8bf('0x12'));var qs=require(_0xe8bf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe8bf('0x14'));var logger=require(_0xe8bf('0x15'))(_0xe8bf('0x16'));var utils=require(_0xe8bf('0x17'));var config=require('../../config/environment');var db=require(_0xe8bf('0x18'))['db'];config[_0xe8bf('0x19')]=_[_0xe8bf('0x1a')](config[_0xe8bf('0x19')],{'host':_0xe8bf('0x1b'),'port':0x18eb});var socket=require(_0xe8bf('0x1c'))(new Redis(config[_0xe8bf('0x19')]));require(_0xe8bf('0x1d'))[_0xe8bf('0x1e')](socket);function respondWithStatusCode(_0x31fc8a,_0x2f6c37){_0x2f6c37=_0x2f6c37||0xcc;return function(_0x56e9f0){if(_0x56e9f0){return _0x31fc8a[_0xe8bf('0x1f')](_0x2f6c37);}return _0x31fc8a['status'](_0x2f6c37)[_0xe8bf('0x20')]();};}function respondWithResult(_0x599724,_0x2b2907){_0x2b2907=_0x2b2907||0xc8;return function(_0x5a74da){if(_0x5a74da){return _0x599724[_0xe8bf('0x21')](_0x2b2907)[_0xe8bf('0x22')](_0x5a74da);}};}function respondWithFilteredResult(_0x55094c,_0x52b035){return function(_0x4da61b){if(_0x4da61b){var _0x3a95d8=_0x4da61b[_0xe8bf('0x23')],_0x595275=_0x52b035['offset'],_0x36b0ad=_0x52b035[_0xe8bf('0x24')]+_0x52b035[_0xe8bf('0x25')],_0x46b287;if(_0x36b0ad>=_0x3a95d8){_0x36b0ad=_0x3a95d8;_0x46b287=0xc8;}else{_0x46b287=0xce;}_0x55094c[_0xe8bf('0x21')](_0x46b287);return _0x55094c['set'](_0xe8bf('0x26'),_0x595275+'-'+_0x36b0ad+'/'+_0x3a95d8)[_0xe8bf('0x22')](_0x4da61b);}return null;};}function patchUpdates(_0xb91d69){return function(_0x38aef3){try{jsonpatch['apply'](_0x38aef3,_0xb91d69,!![]);}catch(_0x2b5904){return BPromise[_0xe8bf('0x27')](_0x2b5904);}return _0x38aef3['save']();};}function saveUpdates(_0x5b3bc6,_0x18085b){return function(_0x2dac8f){if(_0x2dac8f){return _0x2dac8f['update'](_0x5b3bc6)[_0xe8bf('0x28')](function(_0x394961){return _0x394961;});}return null;};}function removeEntity(_0x17a152,_0x2553df){return function(_0x34843a){if(_0x34843a){return _0x34843a[_0xe8bf('0x29')]()[_0xe8bf('0x28')](function(){_0x17a152[_0xe8bf('0x21')](0xcc)[_0xe8bf('0x20')]();});}};}function handleEntityNotFound(_0xcdecae,_0x4a6d8f){return function(_0x23adee){if(!_0x23adee){_0xcdecae[_0xe8bf('0x1f')](0x194);}return _0x23adee;};}function handleError(_0x5e95ff,_0x47ed59){_0x47ed59=_0x47ed59||0x1f4;return function(_0x593c07){logger['error'](_0x593c07[_0xe8bf('0x2a')]);if(_0x593c07[_0xe8bf('0x2b')]){delete _0x593c07['name'];}_0x5e95ff[_0xe8bf('0x21')](_0x47ed59)[_0xe8bf('0x2c')](_0x593c07);};}exports['index']=function(_0x27e0ec,_0x36c013){var _0x3ca8fa={},_0x5d5197={},_0x5d19b0={'count':0x0,'rows':[]};var _0x270ed2=_[_0xe8bf('0x2d')](db[_0xe8bf('0x2e')][_0xe8bf('0x2f')],function(_0x1f83fd){return{'name':_0x1f83fd[_0xe8bf('0x30')],'type':_0x1f83fd[_0xe8bf('0x31')]['key']};});_0x5d5197[_0xe8bf('0x32')]=_[_0xe8bf('0x2d')](_0x270ed2,_0xe8bf('0x2b'));_0x5d5197['query']=_[_0xe8bf('0x33')](_0x27e0ec[_0xe8bf('0x34')]);_0x5d5197[_0xe8bf('0x35')]=_[_0xe8bf('0x36')](_0x5d5197[_0xe8bf('0x32')],_0x5d5197[_0xe8bf('0x34')]);_0x3ca8fa[_0xe8bf('0x37')]=_['intersection'](_0x5d5197['model'],qs[_0xe8bf('0x38')](_0x27e0ec[_0xe8bf('0x34')][_0xe8bf('0x38')]));_0x3ca8fa[_0xe8bf('0x37')]=_0x3ca8fa[_0xe8bf('0x37')][_0xe8bf('0x39')]?_0x3ca8fa[_0xe8bf('0x37')]:_0x5d5197[_0xe8bf('0x32')];if(!_0x27e0ec['query']['hasOwnProperty'](_0xe8bf('0x3a'))){_0x3ca8fa['limit']=qs[_0xe8bf('0x25')](_0x27e0ec[_0xe8bf('0x34')]['limit']);_0x3ca8fa['offset']=qs[_0xe8bf('0x24')](_0x27e0ec[_0xe8bf('0x34')]['offset']);}_0x3ca8fa[_0xe8bf('0x3b')]=qs[_0xe8bf('0x3c')](_0x27e0ec[_0xe8bf('0x34')][_0xe8bf('0x3c')]);_0x3ca8fa[_0xe8bf('0x3d')]=qs[_0xe8bf('0x35')](_[_0xe8bf('0x3e')](_0x27e0ec['query'],_0x5d5197[_0xe8bf('0x35')]),_0x270ed2);if(_0x27e0ec['query'][_0xe8bf('0x3f')]){_0x3ca8fa[_0xe8bf('0x3d')]=_['merge'](_0x3ca8fa[_0xe8bf('0x3d')],{'$or':_[_0xe8bf('0x2d')](_0x270ed2,function(_0x3f8e8e){if(_0x3f8e8e[_0xe8bf('0x31')]!==_0xe8bf('0x40')){var _0x3d65ab={};_0x3d65ab[_0x3f8e8e[_0xe8bf('0x2b')]]={'$like':'%'+_0x27e0ec[_0xe8bf('0x34')][_0xe8bf('0x3f')]+'%'};return _0x3d65ab;}})});}_0x3ca8fa=_[_0xe8bf('0x41')]({},_0x3ca8fa,_0x27e0ec[_0xe8bf('0x42')]);var _0x2b5a35={'where':_0x3ca8fa[_0xe8bf('0x3d')]};return db[_0xe8bf('0x2e')][_0xe8bf('0x23')](_0x2b5a35)[_0xe8bf('0x28')](function(_0x38881a){_0x5d19b0[_0xe8bf('0x23')]=_0x38881a;if(_0x27e0ec[_0xe8bf('0x34')][_0xe8bf('0x43')]){_0x3ca8fa[_0xe8bf('0x44')]=[{'all':!![]}];}return db[_0xe8bf('0x2e')][_0xe8bf('0x45')](_0x3ca8fa);})[_0xe8bf('0x28')](function(_0x4e5252){_0x5d19b0['rows']=_0x4e5252;return _0x5d19b0;})[_0xe8bf('0x28')](respondWithFilteredResult(_0x36c013,_0x3ca8fa))[_0xe8bf('0x46')](handleError(_0x36c013,null));};exports[_0xe8bf('0x47')]=function(_0x575417,_0x526715){var _0x7ed9b5={'raw':!![],'where':{'id':_0x575417[_0xe8bf('0x48')]['id']}},_0x5f03a7={};_0x5f03a7['model']=_[_0xe8bf('0x33')](db[_0xe8bf('0x2e')][_0xe8bf('0x2f')]);_0x5f03a7[_0xe8bf('0x34')]=_[_0xe8bf('0x33')](_0x575417[_0xe8bf('0x34')]);_0x5f03a7[_0xe8bf('0x35')]=_['intersection'](_0x5f03a7[_0xe8bf('0x32')],_0x5f03a7[_0xe8bf('0x34')]);_0x7ed9b5[_0xe8bf('0x37')]=_[_0xe8bf('0x36')](_0x5f03a7[_0xe8bf('0x32')],qs[_0xe8bf('0x38')](_0x575417[_0xe8bf('0x34')][_0xe8bf('0x38')]));_0x7ed9b5[_0xe8bf('0x37')]=_0x7ed9b5[_0xe8bf('0x37')][_0xe8bf('0x39')]?_0x7ed9b5['attributes']:_0x5f03a7[_0xe8bf('0x32')];if(_0x575417[_0xe8bf('0x34')][_0xe8bf('0x43')]){_0x7ed9b5[_0xe8bf('0x44')]=[{'all':!![]}];}_0x7ed9b5=_[_0xe8bf('0x41')]({},_0x7ed9b5,_0x575417['options']);return db['ChatInternalMessage'][_0xe8bf('0x49')](_0x7ed9b5)[_0xe8bf('0x28')](handleEntityNotFound(_0x526715,null))[_0xe8bf('0x28')](respondWithResult(_0x526715,null))[_0xe8bf('0x46')](handleError(_0x526715,null));};exports['create']=function(_0x445736,_0x1370af){return db['ChatInternalMessage'][_0xe8bf('0x4a')](_0x445736[_0xe8bf('0x4b')],{})[_0xe8bf('0x28')](respondWithResult(_0x1370af,0xc9))[_0xe8bf('0x46')](handleError(_0x1370af,null));};exports['update']=function(_0x1045b6,_0x49c603){if(_0x1045b6['body']['id']){delete _0x1045b6[_0xe8bf('0x4b')]['id'];}return db[_0xe8bf('0x2e')]['find']({'where':{'id':_0x1045b6[_0xe8bf('0x48')]['id']}})[_0xe8bf('0x28')](handleEntityNotFound(_0x49c603,null))['then'](saveUpdates(_0x1045b6[_0xe8bf('0x4b')],null))[_0xe8bf('0x28')](respondWithResult(_0x49c603,null))[_0xe8bf('0x46')](handleError(_0x49c603,null));};exports[_0xe8bf('0x29')]=function(_0x3b519f,_0x48d900){return db['ChatInternalMessage'][_0xe8bf('0x49')]({'where':{'id':_0x3b519f[_0xe8bf('0x48')]['id']}})['then'](handleEntityNotFound(_0x48d900,null))[_0xe8bf('0x28')](removeEntity(_0x48d900,null))[_0xe8bf('0x46')](handleError(_0x48d900,null));};exports[_0xe8bf('0x4c')]=function(_0x28c300,_0x42b6dd){return db[_0xe8bf('0x2e')][_0xe8bf('0x4c')]()[_0xe8bf('0x28')](respondWithResult(_0x42b6dd,null))[_0xe8bf('0x46')](handleError(_0x42b6dd,null));};function wrapUser(_0x230044){return function(_0x344b87){var _0x1399ae=_0x230044[_0xe8bf('0x4d')]({'plain':!![]});_0x1399ae[_0xe8bf('0x4e')]=[];if(_0x344b87){_0x1399ae[_0xe8bf('0x4f')]=_0x344b87[_0xe8bf('0x50')];_0x1399ae[_0xe8bf('0x51')]=_0x344b87;}else{_0x1399ae[_0xe8bf('0x4f')]=moment(0x0)[_0xe8bf('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x1399ae[_0xe8bf('0x51')]={};}return _0x1399ae;};}exports[_0xe8bf('0x53')]=function(_0x264f58,_0x2822ab,_0x32fd69){var _0x59d11c=[];return db[_0xe8bf('0x54')][_0xe8bf('0x45')]({'where':{'role':[_0xe8bf('0x55'),'admin',_0xe8bf('0x56')]},'attributes':['id',_0xe8bf('0x57'),_0xe8bf('0x2b'),_0xe8bf('0x58'),_0xe8bf('0x59'),_0xe8bf('0x5a'),_0xe8bf('0x5b'),_0xe8bf('0x5c'),'allowmessenger',_0xe8bf('0x5d')],'order':qs[_0xe8bf('0x3c')](_0xe8bf('0x5e')),'include':[{'model':db[_0xe8bf('0x5f')],'as':_0xe8bf('0x60'),'attributes':['id',_0xe8bf('0x2b'),'type'],'through':{'attributes':[]}}]})[_0xe8bf('0x28')](function(_0x1e8ea5){if(_0x1e8ea5){var _0x4951e1=_0x264f58['user'][_0xe8bf('0x4d')]({'plain':!![]});if(!_0x4951e1)throw new Error(_0xe8bf('0x61'));if(_0x4951e1['role']===_0xe8bf('0x56')){return db[_0xe8bf('0x62')]['find']({'where':{'name':_0xe8bf('0x63'),'userProfileId':_0x4951e1[_0xe8bf('0x64')]},'raw':!![]})[_0xe8bf('0x28')](function(_0x3371d1){if(_0x3371d1){if(_0x3371d1['autoAssociation']===0x0){return db[_0xe8bf('0x65')]['findAll']({'where':{'sectionId':_0x3371d1['id']},'raw':!![]})[_0xe8bf('0x28')](function(_0x5131a2){var _0x499474=[];if(_[_0xe8bf('0x66')](_0x5131a2)){_0x499474=_['filter'](_0x1e8ea5,function(_0x532c09){if(_0x532c09[_0xe8bf('0x58')]!==_0xe8bf('0x55')){return _0x532c09;}});return _0x499474;}else{for(var _0x24dd87=0x0;_0x24dd87<_0x1e8ea5['length'];_0x24dd87++){var _0x4b61e6=_0x1e8ea5[_0x24dd87];if(_0x4b61e6[_0xe8bf('0x58')]===_0xe8bf('0x55')){var _0x332dc6=_[_0xe8bf('0x49')](_0x5131a2,function(_0x2c5c4){return _0x2c5c4[_0xe8bf('0x67')]===_0x4b61e6['id'];});if(_0x332dc6)_0x499474[_0xe8bf('0x68')](_0x4b61e6);}else{_0x499474[_0xe8bf('0x68')](_0x4b61e6);}}return _0x499474;}});}else{return _0x1e8ea5;}}else{var _0x197665=_['filter'](_0x1e8ea5,function(_0x257142){if(_0x257142['role']!==_0xe8bf('0x55')){return _0x257142;}});return _0x197665;}});}else{return _0x1e8ea5;}}})[_0xe8bf('0x28')](function(_0x5a30bc){var _0x1edf39=[];if(_0x5a30bc){_0x59d11c=_0x5a30bc;for(var _0x4b0944=0x0;_0x4b0944<_0x5a30bc[_0xe8bf('0x39')];_0x4b0944+=0x1){_0x59d11c[_0x4b0944][_0xe8bf('0x4e')]=[];_0x1edf39[_0xe8bf('0x68')](db['ChatInternalMessage'][_0xe8bf('0x49')]({'where':{'FromId':[_0x264f58[_0xe8bf('0x56')]['id'],_0x5a30bc[_0x4b0944]['id']],'ToId':[_0x264f58['user']['id'],_0x5a30bc[_0x4b0944]['id']],'ChatGroupId':null},'attributes':['id',_0xe8bf('0x50'),_0xe8bf('0x69'),'ToId',_0xe8bf('0x6a'),'body'],'order':qs[_0xe8bf('0x3c')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe8bf('0x28')](wrapUser(_0x5a30bc[_0x4b0944])));}return BPromise[_0xe8bf('0x6b')](_0x1edf39);}return[];})[_0xe8bf('0x28')](function(_0x4fbd90){return{'rows':_0x4fbd90,'count':_0x4fbd90['length']};})[_0xe8bf('0x28')](respondWithResult(_0x2822ab,null))[_0xe8bf('0x46')](handleError(_0x2822ab,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 825ff32..22df35e 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 _0xcee8=['hasOwnProperty','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit'];(function(_0x3e5325,_0x55af33){var _0x5a1c63=function(_0x545694){while(--_0x545694){_0x3e5325['push'](_0x3e5325['shift']());}};_0x5a1c63(++_0x55af33);}(_0xcee8,0xb1));var _0x8cee=function(_0x174c20,_0x474b2){_0x174c20=_0x174c20-0x0;var _0x5ecaec=_0xcee8[_0x174c20];return _0x5ecaec;};'use strict';var EventEmitter=require(_0x8cee('0x0'));var ChatInternalMessage=require(_0x8cee('0x1'))['db'][_0x8cee('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x8cee('0x3')](0x0);var events={'afterCreate':_0x8cee('0x4'),'afterUpdate':_0x8cee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x127360){return function(_0x4e4143,_0xffd42d,_0x1ec415){ChatInternalMessageEvents['emit'](_0x127360+':'+_0x4e4143['id'],_0x4e4143);ChatInternalMessageEvents[_0x8cee('0x6')](_0x127360,_0x4e4143);_0x1ec415(null);};}for(var e in events){if(events[_0x8cee('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x036b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x2cd71a,_0x4038f3){var _0x2b2331=function(_0x1cffd3){while(--_0x1cffd3){_0x2cd71a['push'](_0x2cd71a['shift']());}};_0x2b2331(++_0x4038f3);}(_0x036b,0x145));var _0xb036=function(_0x190c49,_0x103457){_0x190c49=_0x190c49-0x0;var _0x475b9a=_0x036b[_0x190c49];return _0x475b9a;};'use strict';var EventEmitter=require(_0xb036('0x0'));var ChatInternalMessage=require(_0xb036('0x1'))['db'][_0xb036('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb036('0x3'),'afterUpdate':_0xb036('0x4'),'afterDestroy':_0xb036('0x5')};function emitEvent(_0xef47db){return function(_0x392829,_0x523abc,_0x14b834){ChatInternalMessageEvents[_0xb036('0x6')](_0xef47db+':'+_0x392829['id'],_0x392829);ChatInternalMessageEvents[_0xb036('0x6')](_0xef47db,_0x392829);_0x14b834(null);};}for(var e in events){if(events[_0xb036('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb036('0x8')](e,emitEvent(event));}}module[_0xb036('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 48e53c5..902b775 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 _0x4f49=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x5eca25,_0x212aad){var _0x27040b=function(_0x3139a9){while(--_0x3139a9){_0x5eca25['push'](_0x5eca25['shift']());}};_0x27040b(++_0x212aad);}(_0x4f49,0x142));var _0x94f4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4f49[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x94f4('0x0'));var util=require(_0x94f4('0x1'));var logger=require(_0x94f4('0x2'))(_0x94f4('0x3'));var moment=require(_0x94f4('0x4'));var BPromise=require(_0x94f4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x94f4('0x6'));var config=require(_0x94f4('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x94f4('0x8')]=function(_0x1b7b0b,_0x20500c){return _0x1b7b0b[_0x94f4('0x9')](_0x94f4('0xa'),attributes,{'tableName':_0x94f4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x94f4('0xc'),'collate':_0x94f4('0xd')});}; \ No newline at end of file +var _0x69b7=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0x69b7,0x1f1));var _0x769b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x69b7[_0x432682];return _0x463d05;};'use strict';var _=require(_0x769b('0x0'));var util=require('util');var logger=require(_0x769b('0x1'))('api');var moment=require(_0x769b('0x2'));var BPromise=require('bluebird');var rp=require(_0x769b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x769b('0x4'));var config=require(_0x769b('0x5'));var attributes=require(_0x769b('0x6'));module[_0x769b('0x7')]=function(_0x6ec1ef,_0x500a96){return _0x6ec1ef[_0x769b('0x8')](_0x769b('0x9'),attributes,{'tableName':_0x769b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x769b('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 45be40d..8f86f15 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 _0x36c1=['request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter'];(function(_0x4a5488,_0x5868a9){var _0x538364=function(_0x2265b3){while(--_0x2265b3){_0x4a5488['push'](_0x4a5488['shift']());}};_0x538364(++_0x5868a9);}(_0x36c1,0x1e7));var _0x136c=function(_0x36f797,_0x351603){_0x36f797=_0x36f797-0x0;var _0x44ba30=_0x36c1[_0x36f797];return _0x44ba30;};'use strict';var _=require(_0x136c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x136c('0x1'));var rs=require(_0x136c('0x2'));var fs=require('fs');var Redis=require(_0x136c('0x3'));var db=require(_0x136c('0x4'))['db'];var utils=require(_0x136c('0x5'));var logger=require(_0x136c('0x6'))('rpc');var config=require(_0x136c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x136c('0x8')][_0x136c('0x9')]({'port':0x232a});config[_0x136c('0xa')]=_[_0x136c('0xb')](config[_0x136c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x136c('0xc'))(new Redis(config[_0x136c('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x48d85f,_0x2dabdd,_0x32468d){return new BPromise(function(_0x10fef2,_0x426881){return client[_0x136c('0xd')](_0x48d85f,_0x32468d)[_0x136c('0xe')](function(_0x5b5c6a){logger[_0x136c('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x2dabdd,_0x136c('0x10'));logger[_0x136c('0x11')](_0x136c('0x12'),_0x2dabdd,'request\x20sent',JSON[_0x136c('0x13')](_0x5b5c6a));if(_0x5b5c6a[_0x136c('0x14')]){if(_0x5b5c6a['error']['code']===0x1f4){logger[_0x136c('0x14')](_0x136c('0x15'),_0x2dabdd,_0x5b5c6a[_0x136c('0x14')][_0x136c('0x16')]);return _0x426881(_0x5b5c6a[_0x136c('0x14')][_0x136c('0x16')]);}logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x2dabdd,_0x5b5c6a[_0x136c('0x14')][_0x136c('0x16')]);return _0x10fef2(_0x5b5c6a[_0x136c('0x14')][_0x136c('0x16')]);}else{logger[_0x136c('0xf')](_0x136c('0x15'),_0x2dabdd,_0x136c('0x10'));_0x10fef2(_0x5b5c6a[_0x136c('0x17')]['message']);}})[_0x136c('0x18')](function(_0x3abd03){logger[_0x136c('0x14')](_0x136c('0x15'),_0x2dabdd,_0x3abd03);_0x426881(_0x3abd03);});});} \ No newline at end of file +var _0x6888=['../../mysqldb','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6888,0x91));var _0x8688=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x6888[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0x8688('0x0'));var util=require(_0x8688('0x1'));var moment=require(_0x8688('0x2'));var BPromise=require(_0x8688('0x3'));var rs=require(_0x8688('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8688('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8688('0x6'));var jayson=require(_0x8688('0x7'));var client=jayson['client'][_0x8688('0x8')]({'port':0x232a});config['redis']=_[_0x8688('0x9')](config[_0x8688('0xa')],{'host':_0x8688('0xb'),'port':0x18eb});var socket=require(_0x8688('0xc'))(new Redis(config[_0x8688('0xa')]));require(_0x8688('0xd'))[_0x8688('0xe')](socket);function respondWithRpcPromise(_0x3678a7,_0x35b167,_0x57ab83){return new BPromise(function(_0x42b374,_0x1fa4b0){return client[_0x8688('0xf')](_0x3678a7,_0x57ab83)[_0x8688('0x10')](function(_0x33832d){logger[_0x8688('0x11')](_0x8688('0x12'),_0x35b167,_0x8688('0x13'));logger['debug'](_0x8688('0x14'),_0x35b167,'request\x20sent',JSON['stringify'](_0x33832d));if(_0x33832d[_0x8688('0x15')]){if(_0x33832d['error']['code']===0x1f4){logger[_0x8688('0x15')](_0x8688('0x12'),_0x35b167,_0x33832d[_0x8688('0x15')][_0x8688('0x16')]);return _0x1fa4b0(_0x33832d[_0x8688('0x15')][_0x8688('0x16')]);}logger[_0x8688('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x35b167,_0x33832d[_0x8688('0x15')][_0x8688('0x16')]);return _0x42b374(_0x33832d[_0x8688('0x15')][_0x8688('0x16')]);}else{logger[_0x8688('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x35b167,_0x8688('0x13'));_0x42b374(_0x33832d[_0x8688('0x17')][_0x8688('0x16')]);}})[_0x8688('0x18')](function(_0x259348){logger['error'](_0x8688('0x12'),_0x35b167,_0x259348);_0x1fa4b0(_0x259348);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index b0e7c8f..0905a16 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 _0x37b4=['remove','update','emit','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x312189,_0x50d133){var _0x4bcbdc=function(_0x1e3fc9){while(--_0x1e3fc9){_0x312189['push'](_0x312189['shift']());}};_0x4bcbdc(++_0x50d133);}(_0x37b4,0xef));var _0x437b=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x37b4[_0x1261c2];return _0x3aabd2;};'use strict';var ChatInternalMessageEvents=require(_0x437b('0x0'));var events=['save',_0x437b('0x1'),_0x437b('0x2')];function createListener(_0xc42699,_0x5bc1e3){return function(_0x308d00){_0x5bc1e3[_0x437b('0x3')](_0xc42699,_0x308d00);};}function removeListener(_0x317df4,_0x3d353d){return function(){ChatInternalMessageEvents['removeListener'](_0x317df4,_0x3d353d);};}exports['register']=function(_0x1bab79){for(var _0x560099=0x0,_0x3c7dea=events['length'];_0x560099<_0x3c7dea;_0x560099++){var _0x226e3c=events[_0x560099];var _0x5df980=createListener(_0x437b('0x4')+_0x226e3c,_0x1bab79);ChatInternalMessageEvents['on'](_0x226e3c,_0x5df980);}}; \ No newline at end of file +var _0x01fe=['./chatInternalMessage.events','remove','update','emit','register','length'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x01fe,0x102));var _0xe01f=function(_0x31b4a6,_0x2b1369){_0x31b4a6=_0x31b4a6-0x0;var _0x51cfde=_0x01fe[_0x31b4a6];return _0x51cfde;};'use strict';var ChatInternalMessageEvents=require(_0xe01f('0x0'));var events=['save',_0xe01f('0x1'),_0xe01f('0x2')];function createListener(_0x4a9e90,_0x577c82){return function(_0x15f6ba){_0x577c82[_0xe01f('0x3')](_0x4a9e90,_0x15f6ba);};}function removeListener(_0x9505fa,_0x92b885){return function(){ChatInternalMessageEvents['removeListener'](_0x9505fa,_0x92b885);};}exports[_0xe01f('0x4')]=function(_0x574969){for(var _0x3effc4=0x0,_0x3b754f=events[_0xe01f('0x5')];_0x3effc4<_0x3b754f;_0x3effc4++){var _0x40376f=events[_0x3effc4];var _0x377881=createListener('chatInternalMessage:'+_0x40376f,_0x574969);ChatInternalMessageEvents['on'](_0x40376f,_0x377881);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 46d82e4..04eb757 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 _0xd8b0=['put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','describe','isAuthenticated','getUsers','/:id','show','post'];(function(_0x511d8e,_0x4ff491){var _0x17ae57=function(_0x5d2668){while(--_0x5d2668){_0x511d8e['push'](_0x511d8e['shift']());}};_0x17ae57(++_0x4ff491);}(_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')]('/users',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0xb')](),controller['create']);router[_0x0d8b('0x10')]('/:id',controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);module[_0x0d8b('0x14')]=router; \ No newline at end of file +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(_0x5c1b05,_0x4510fd){var _0x417d35=function(_0x1d73e2){while(--_0x1d73e2){_0x5c1b05['push'](_0x5c1b05['shift']());}};_0x417d35(++_0x4510fd);}(_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 diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 7335187..5d37e4c 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 _0x4e90=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x1c3676,_0x146ece){var _0x2ac5ae=function(_0x20f834){while(--_0x20f834){_0x1c3676['push'](_0x1c3676['shift']());}};_0x2ac5ae(++_0x146ece);}(_0x4e90,0x1c5));var _0x04e9=function(_0x75c01e,_0x17dabd){_0x75c01e=_0x75c01e-0x0;var _0x47dc5f=_0x4e90[_0x75c01e];return _0x47dc5f;};'use strict';var Sequelize=require(_0x04e9('0x0'));module[_0x04e9('0x1')]={'body':{'type':Sequelize[_0x04e9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x04e9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x04e9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x04e9('0x4')]('in',_0x04e9('0x5')),'defaultValue':_0x04e9('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x04e9('0x6')]}}; \ No newline at end of file +var _0xa4ce=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x54417c,_0x155f01){var _0x1462c0=function(_0x5d8c0f){while(--_0x5d8c0f){_0x54417c['push'](_0x54417c['shift']());}};_0x1462c0(++_0x155f01);}(_0xa4ce,0x7f));var _0xea4c=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa4ce[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xea4c('0x0'));module[_0xea4c('0x1')]={'body':{'type':Sequelize[_0xea4c('0x2')](_0xea4c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xea4c('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xea4c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xea4c('0x5')]('in',_0xea4c('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xea4c('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3ecb7d9..9c82b40 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 _0xe85f=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','formData','agent','interaction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','end','sendStatus','stack','name','send','index','ChatMessage','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','options','includeAll','include','findAll','keys','merge','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','user','Contact','get','ChatInteraction','ChatInteractionId','UserId','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xe323bb,_0x1703c0){var _0x114089=function(_0x27d4cc){while(--_0x27d4cc){_0xe323bb['push'](_0xe323bb['shift']());}};_0x114089(++_0x1703c0);}(_0xe85f,0x18a));var _0xfe85=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xe85f[_0x42bdad];return _0x122626;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe85('0x0'));var rimraf=require(_0xfe85('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe85('0x2'));var rp=require(_0xfe85('0x3'));var moment=require(_0xfe85('0x4'));var BPromise=require(_0xfe85('0x5'));var Mustache=require(_0xfe85('0x6'));var util=require('util');var path=require('path');var sox=require(_0xfe85('0x7'));var csv=require(_0xfe85('0x8'));var ejs=require(_0xfe85('0x9'));var fs=require('fs');var _=require(_0xfe85('0xa'));var squel=require(_0xfe85('0xb'));var crypto=require(_0xfe85('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe85('0x8'));var querystring=require(_0xfe85('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe85('0xe'));var authService=require(_0xfe85('0xf'));var qs=require(_0xfe85('0x10'));var as=require(_0xfe85('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe85('0x12'))(_0xfe85('0x13'));var utils=require(_0xfe85('0x14'));var config=require(_0xfe85('0x15'));var db=require(_0xfe85('0x16'))['db'];config[_0xfe85('0x17')]=_[_0xfe85('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe85('0x19'))(new Redis(config[_0xfe85('0x17')]));require(_0xfe85('0x1a'))[_0xfe85('0x1b')](socket);var jayson=require(_0xfe85('0x1c'));var client=jayson[_0xfe85('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xfe85('0x1d')][_0xfe85('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x37b95b,_0x506d52,_0x30699b){if(_0x30699b){var _0x3bda96=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bda96['test'](_0x506d52)){return _0x37b95b;}else{throw new db[(_0xfe85('0x1f'))][(_0xfe85('0x20'))](_0xfe85('0x21'));}}else{return _0x37b95b;}}function respondWithRpcPromise(_0x1772af,_0x146394,_0x334601,_0x4875f3){return new BPromise(function(_0x4fa936,_0x3f7e3c){var _0x4a14d0=_0x4875f3||client;return _0x4a14d0[_0xfe85('0x22')](_0x1772af,_0x334601)[_0xfe85('0x23')](function(_0x33d3e8){logger[_0xfe85('0x24')](_0xfe85('0x25'),_0x146394,'request\x20sent');logger[_0xfe85('0x26')](_0xfe85('0x27'),_0x146394,_0xfe85('0x28'),JSON[_0xfe85('0x29')](_0x33d3e8));if(_0x33d3e8[_0xfe85('0x2a')]){if(_0x33d3e8[_0xfe85('0x2a')][_0xfe85('0x2b')]===0x1f4){logger[_0xfe85('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x146394,_0x33d3e8['error'][_0xfe85('0x2c')]);return _0x3f7e3c(_0x33d3e8[_0xfe85('0x2a')]['message']);}logger[_0xfe85('0x2a')](_0xfe85('0x25'),_0x146394,_0x33d3e8[_0xfe85('0x2a')][_0xfe85('0x2c')]);return _0x4fa936(_0x33d3e8['error'][_0xfe85('0x2c')]);}else{logger[_0xfe85('0x24')](_0xfe85('0x25'),_0x146394,_0xfe85('0x28'));_0x4fa936(_0x33d3e8['result'][_0xfe85('0x2c')]);}})[_0xfe85('0x2d')](function(_0x50a5cb){logger['error']('ChatMessage,\x20%s,\x20%s',_0x146394,_0x50a5cb);_0x3f7e3c(_0x50a5cb);});});}function respondWithStatusCode(_0x39f895,_0x238865){_0x238865=_0x238865||0xcc;return function(_0x34d8e3){if(_0x34d8e3){return _0x39f895['sendStatus'](_0x238865);}return _0x39f895['status'](_0x238865)['end']();};}function respondWithResult(_0x4c767f,_0x46032b){_0x46032b=_0x46032b||0xc8;return function(_0x4ff5f2){if(_0x4ff5f2){return _0x4c767f[_0xfe85('0x2e')](_0x46032b)[_0xfe85('0x2f')](_0x4ff5f2);}};}function respondWithFilteredResult(_0x195aea,_0x45eb2f){return function(_0x4bc6e9){if(_0x4bc6e9){var _0x19c8c6=_0x4bc6e9[_0xfe85('0x30')],_0x907e92=_0x45eb2f['offset'],_0x27d000=_0x45eb2f[_0xfe85('0x31')]+_0x45eb2f[_0xfe85('0x32')],_0x2623c7;if(_0x27d000>=_0x19c8c6){_0x27d000=_0x19c8c6;_0x2623c7=0xc8;}else{_0x2623c7=0xce;}_0x195aea[_0xfe85('0x2e')](_0x2623c7);return _0x195aea[_0xfe85('0x33')](_0xfe85('0x34'),_0x907e92+'-'+_0x27d000+'/'+_0x19c8c6)[_0xfe85('0x2f')](_0x4bc6e9);}return null;};}function patchUpdates(_0x4bd8d5){return function(_0x2517bf){try{jsonpatch['apply'](_0x2517bf,_0x4bd8d5,!![]);}catch(_0x2046a0){return BPromise[_0xfe85('0x35')](_0x2046a0);}return _0x2517bf['save']();};}function saveUpdates(_0x39130e,_0x3354f2){return function(_0x516f98){if(_0x516f98){return _0x516f98[_0xfe85('0x36')](_0x39130e)['then'](function(_0x28a935){return _0x28a935;});}return null;};}function removeEntity(_0x206294,_0x399339){return function(_0x30c5ab){if(_0x30c5ab){return _0x30c5ab[_0xfe85('0x37')]()[_0xfe85('0x23')](function(){_0x206294[_0xfe85('0x2e')](0xcc)[_0xfe85('0x38')]();});}};}function handleEntityNotFound(_0xf30d18,_0x41ee2a){return function(_0x23cf9b){if(!_0x23cf9b){_0xf30d18[_0xfe85('0x39')](0x194);}return _0x23cf9b;};}function handleError(_0x468590,_0x43fd38){_0x43fd38=_0x43fd38||0x1f4;return function(_0x90c8de){logger[_0xfe85('0x2a')](_0x90c8de[_0xfe85('0x3a')]);if(_0x90c8de[_0xfe85('0x3b')]){delete _0x90c8de['name'];}_0x468590[_0xfe85('0x2e')](_0x43fd38)[_0xfe85('0x3c')](_0x90c8de);};}exports[_0xfe85('0x3d')]=function(_0x42ade5,_0x4c98c1){var _0x3bbb25={},_0x33eff3={},_0x2f14fa={'count':0x0,'rows':[]};var _0x1909b4=_['map'](db[_0xfe85('0x3e')]['rawAttributes'],function(_0x5c885e){return{'name':_0x5c885e[_0xfe85('0x3f')],'type':_0x5c885e['type'][_0xfe85('0x40')]};});_0x33eff3[_0xfe85('0x41')]=_[_0xfe85('0x42')](_0x1909b4,_0xfe85('0x3b'));_0x33eff3[_0xfe85('0x43')]=_['keys'](_0x42ade5[_0xfe85('0x43')]);_0x33eff3['filters']=_[_0xfe85('0x44')](_0x33eff3[_0xfe85('0x41')],_0x33eff3[_0xfe85('0x43')]);_0x3bbb25[_0xfe85('0x45')]=_[_0xfe85('0x44')](_0x33eff3[_0xfe85('0x41')],qs[_0xfe85('0x46')](_0x42ade5[_0xfe85('0x43')][_0xfe85('0x46')]));_0x3bbb25['attributes']=_0x3bbb25['attributes'][_0xfe85('0x47')]?_0x3bbb25['attributes']:_0x33eff3['model'];if(!_0x42ade5[_0xfe85('0x43')][_0xfe85('0x48')](_0xfe85('0x49'))){_0x3bbb25[_0xfe85('0x32')]=qs[_0xfe85('0x32')](_0x42ade5['query'][_0xfe85('0x32')]);_0x3bbb25[_0xfe85('0x31')]=qs[_0xfe85('0x31')](_0x42ade5[_0xfe85('0x43')][_0xfe85('0x31')]);}_0x3bbb25[_0xfe85('0x4a')]=qs['sort'](_0x42ade5['query'][_0xfe85('0x4b')]);_0x3bbb25[_0xfe85('0x4c')]=qs['filters'](_[_0xfe85('0x4d')](_0x42ade5[_0xfe85('0x43')],_0x33eff3[_0xfe85('0x4e')]),_0x1909b4);if(_0x42ade5['query'][_0xfe85('0x4f')]){_0x3bbb25[_0xfe85('0x4c')]=_['merge'](_0x3bbb25[_0xfe85('0x4c')],{'$or':_[_0xfe85('0x42')](_0x1909b4,function(_0x2abfcf){if(_0x2abfcf[_0xfe85('0x50')]!==_0xfe85('0x51')){var _0x5a838f={};_0x5a838f[_0x2abfcf['name']]={'$like':'%'+_0x42ade5[_0xfe85('0x43')][_0xfe85('0x4f')]+'%'};return _0x5a838f;}})});}_0x3bbb25=_['merge']({},_0x3bbb25,_0x42ade5[_0xfe85('0x52')]);var _0x46d8ab={'where':_0x3bbb25[_0xfe85('0x4c')]};return db[_0xfe85('0x3e')][_0xfe85('0x30')](_0x46d8ab)[_0xfe85('0x23')](function(_0x2c97da){_0x2f14fa[_0xfe85('0x30')]=_0x2c97da;if(_0x42ade5[_0xfe85('0x43')][_0xfe85('0x53')]){_0x3bbb25[_0xfe85('0x54')]=[{'all':!![]}];}return db[_0xfe85('0x3e')][_0xfe85('0x55')](_0x3bbb25);})['then'](function(_0x54da39){_0x2f14fa['rows']=_0x54da39;return _0x2f14fa;})[_0xfe85('0x23')](respondWithFilteredResult(_0x4c98c1,_0x3bbb25))[_0xfe85('0x2d')](handleError(_0x4c98c1,null));};exports['show']=function(_0x1976e7,_0x2a2c22){var _0x3bb2e5={'raw':!![],'where':{'id':_0x1976e7['params']['id']}},_0x390841={};_0x390841[_0xfe85('0x41')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x390841[_0xfe85('0x43')]=_[_0xfe85('0x56')](_0x1976e7[_0xfe85('0x43')]);_0x390841[_0xfe85('0x4e')]=_[_0xfe85('0x44')](_0x390841[_0xfe85('0x41')],_0x390841[_0xfe85('0x43')]);_0x3bb2e5[_0xfe85('0x45')]=_[_0xfe85('0x44')](_0x390841['model'],qs[_0xfe85('0x46')](_0x1976e7[_0xfe85('0x43')]['fields']));_0x3bb2e5[_0xfe85('0x45')]=_0x3bb2e5[_0xfe85('0x45')]['length']?_0x3bb2e5[_0xfe85('0x45')]:_0x390841['model'];if(_0x1976e7[_0xfe85('0x43')][_0xfe85('0x53')]){_0x3bb2e5[_0xfe85('0x54')]=[{'all':!![]}];}_0x3bb2e5=_[_0xfe85('0x57')]({},_0x3bb2e5,_0x1976e7[_0xfe85('0x52')]);return db[_0xfe85('0x3e')][_0xfe85('0x58')](_0x3bb2e5)[_0xfe85('0x23')](handleEntityNotFound(_0x2a2c22,null))[_0xfe85('0x23')](respondWithResult(_0x2a2c22,null))[_0xfe85('0x2d')](handleError(_0x2a2c22,null));};exports[_0xfe85('0x59')]=function(_0x4d1f3c,_0x3d0d2e){return db[_0xfe85('0x3e')]['create'](_0x4d1f3c[_0xfe85('0x5a')],{})['then'](respondWithResult(_0x3d0d2e,0xc9))[_0xfe85('0x2d')](handleError(_0x3d0d2e,null));};exports[_0xfe85('0x36')]=function(_0x65937d,_0x19f854){if(_0x65937d['body']['id']){delete _0x65937d[_0xfe85('0x5a')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x65937d[_0xfe85('0x5b')]['id']}})[_0xfe85('0x23')](handleEntityNotFound(_0x19f854,null))[_0xfe85('0x23')](saveUpdates(_0x65937d['body'],null))[_0xfe85('0x23')](respondWithResult(_0x19f854,null))[_0xfe85('0x2d')](handleError(_0x19f854,null));};exports[_0xfe85('0x37')]=function(_0x1cd805,_0x54e7ef){return db['ChatMessage'][_0xfe85('0x58')]({'where':{'id':_0x1cd805['params']['id']}})[_0xfe85('0x23')](handleEntityNotFound(_0x54e7ef,null))[_0xfe85('0x23')](removeEntity(_0x54e7ef,null))['catch'](handleError(_0x54e7ef,null));};exports[_0xfe85('0x5c')]=function(_0x38c2bf,_0x187c26){return db[_0xfe85('0x3e')]['describe']()['then'](respondWithResult(_0x187c26,null))['catch'](handleError(_0x187c26,null));};var interaction_log=require(_0xfe85('0x12'))(_0xfe85('0x5d'));exports[_0xfe85('0x5e')]=function(_0x171fde,_0x3c692a,_0x4795ee){var _0x5bc4d8={'channel':_0xfe85('0x5f')};if(_0x171fde[_0xfe85('0x5a')]['id']){delete _0x171fde['body']['id'];}_0x171fde[_0xfe85('0x5a')][_0xfe85('0x60')]=!![];_0x171fde[_0xfe85('0x5a')][_0xfe85('0x61')]=moment()[_0xfe85('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x171fde[_0xfe85('0x5a')]['UserId']=_0x171fde[_0xfe85('0x5a')]['UserId']||_0x171fde[_0xfe85('0x63')]['id'];return db[_0xfe85('0x3e')][_0xfe85('0x58')]({'where':{'id':_0x171fde[_0xfe85('0x5b')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xfe85('0x64')}]})[_0xfe85('0x23')](handleEntityNotFound(_0x3c692a,null))[_0xfe85('0x23')](saveUpdates(_0x171fde['body'],null))[_0xfe85('0x23')](function(_0x284c71){if(_0x284c71){_0x5bc4d8[_0xfe85('0x2c')]=_0x284c71[_0xfe85('0x65')]({'plain':!![]});return db[_0xfe85('0x66')][_0xfe85('0x58')]({'where':{'id':_0x284c71[_0xfe85('0x67')]}});}return null;})[_0xfe85('0x23')](handleEntityNotFound(_0x3c692a,null))[_0xfe85('0x23')](function(_0x7b1aa1){if(_0x7b1aa1){return _0x7b1aa1['update']({'UserId':_0x171fde[_0xfe85('0x5a')][_0xfe85('0x68')],'read1stAt':_['isNil'](_0x7b1aa1['read1stAt'])?moment()['format'](_0xfe85('0x69')):undefined});}return null;})[_0xfe85('0x23')](function(_0x44f362){if(_0x44f362){_0x5bc4d8['interaction']=_0x44f362[_0xfe85('0x65')]({'plain':!![]});interaction_log[_0xfe85('0x24')](_0xfe85('0x6a'),_0x171fde['user']['id'],_0x171fde[_0xfe85('0x63')][_0xfe85('0x3b')],_0x171fde[_0xfe85('0x63')][_0xfe85('0x6b')],_0x5bc4d8['interaction']['id'],_0x171fde['body']?JSON['stringify'](_0x171fde[_0xfe85('0x5a')]):_0xfe85('0x6c'));return respondWithRpcPromise(_0xfe85('0x6d'),_0xfe85('0x6e'),_0x5bc4d8);}return null;})['then'](function(_0x98bd8){if(_0x98bd8){if(_0x171fde['body'][_0xfe85('0x6f')]){_0x5bc4d8[_0xfe85('0x2c')][_0xfe85('0x70')]=util[_0xfe85('0x62')]('SIP/%s',_0x171fde['user'][_0xfe85('0x3b')]);_0x5bc4d8[_0xfe85('0x2c')]['channel']=_0x5bc4d8[_0xfe85('0x71')];_0x5bc4d8[_0xfe85('0x2c')][_0xfe85('0x72')]=_0xfe85('0x5e');return respondWithRpcPromise(_0xfe85('0x73'),_0xfe85('0x73'),{'event':_0xfe85('0x74'),'message':_[_0xfe85('0x57')](_0x5bc4d8['message'],JSON['parse'](_0x5bc4d8['interaction'][_0xfe85('0x75')]))},client9002)[_0xfe85('0x23')](function(){return _0x5bc4d8;});}return _0x5bc4d8;}return null;})['then'](respondWithResult(_0x3c692a,null))[_0xfe85('0x2d')](handleError(_0x3c692a,null));};var interaction_log=require(_0xfe85('0x12'))(_0xfe85('0x5d'));exports[_0xfe85('0x35')]=function(_0x35cbaf,_0x436f8a,_0x4326da){var _0x250cf8={'agent':{},'channel':'chat'};if(_0x35cbaf[_0xfe85('0x5a')]['id']){delete _0x35cbaf['body']['id'];}_0x35cbaf['body'][_0xfe85('0x68')]=_0x35cbaf[_0xfe85('0x5a')][_0xfe85('0x68')]||_0x35cbaf[_0xfe85('0x63')]['id'];_0x250cf8[_0xfe85('0x76')]['id']=_0x35cbaf['body'][_0xfe85('0x68')];return db[_0xfe85('0x3e')][_0xfe85('0x58')]({'where':{'id':_0x35cbaf[_0xfe85('0x5b')]['id'],'UserId':null}})[_0xfe85('0x23')](handleEntityNotFound(_0x436f8a,null))['then'](function(_0x57fe6c){if(_0x57fe6c){_0x250cf8['message']=_0x57fe6c[_0xfe85('0x65')]({'plain':!![]});return db[_0xfe85('0x66')][_0xfe85('0x58')]({'where':{'id':_0x57fe6c[_0xfe85('0x67')]}});}return null;})[_0xfe85('0x23')](handleEntityNotFound(_0x436f8a,null))[_0xfe85('0x23')](function(_0x57fb0e){if(_0x57fb0e){_0x250cf8[_0xfe85('0x77')]=_0x57fb0e[_0xfe85('0x65')]({'plain':!![]});interaction_log[_0xfe85('0x24')](_0xfe85('0x78'),_0x35cbaf[_0xfe85('0x63')]['id'],_0x35cbaf[_0xfe85('0x63')][_0xfe85('0x3b')],_0x35cbaf[_0xfe85('0x63')][_0xfe85('0x6b')],_0x250cf8[_0xfe85('0x77')]['id'],_0x35cbaf[_0xfe85('0x5a')]?JSON[_0xfe85('0x29')](_0x35cbaf[_0xfe85('0x5a')]):_0xfe85('0x6c'));return respondWithRpcPromise(_0xfe85('0x79'),_0xfe85('0x7a'),_0x250cf8);}return null;})[_0xfe85('0x23')](function(_0x340a52){if(_0x340a52){_0x340a52[_0xfe85('0x2c')][_0xfe85('0x70')]=util[_0xfe85('0x62')](_0xfe85('0x7b'),_0x35cbaf[_0xfe85('0x63')][_0xfe85('0x3b')]);_0x340a52[_0xfe85('0x2c')]['channel']=_0x250cf8[_0xfe85('0x71')];_0x340a52[_0xfe85('0x2c')][_0xfe85('0x72')]=_0xfe85('0x35');respondWithRpcPromise(_0xfe85('0x73'),_0xfe85('0x73'),{'event':_0xfe85('0x7c'),'message':_0x340a52[_0xfe85('0x2c')]},client9002);return _0x250cf8;}return null;})['then'](respondWithResult(_0x436f8a,null))[_0xfe85('0x2d')](handleError(_0x436f8a,null));}; \ No newline at end of file +var _0x044f=['fields','length','hasOwnProperty','offset','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','intersection','find','create','body','describe','accept','chat','readAt','format','UserId','user','CmContact','Contact','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','manual','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','reject','agent','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','sendStatus','status','end','json','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','keys','query','filters','attributes'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0x044f,0xb8));var _0xf044=function(_0x23d160,_0x15e4dc){_0x23d160=_0x23d160-0x0;var _0x5df430=_0x044f[_0x23d160];return _0x5df430;};'use strict';var pdf=require(_0xf044('0x0'));var emlformat=require(_0xf044('0x1'));var rimraf=require(_0xf044('0x2'));var zipdir=require(_0xf044('0x3'));var jsonpatch=require(_0xf044('0x4'));var rp=require(_0xf044('0x5'));var moment=require(_0xf044('0x6'));var BPromise=require(_0xf044('0x7'));var Mustache=require(_0xf044('0x8'));var util=require(_0xf044('0x9'));var path=require('path');var sox=require(_0xf044('0xa'));var csv=require('to-csv');var ejs=require(_0xf044('0xb'));var fs=require('fs');var _=require(_0xf044('0xc'));var squel=require(_0xf044('0xd'));var crypto=require(_0xf044('0xe'));var jsforce=require(_0xf044('0xf'));var deskjs=require(_0xf044('0x10'));var toCsv=require(_0xf044('0x11'));var querystring=require('querystring');var Papa=require(_0xf044('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf044('0x13'));var as=require(_0xf044('0x14'));var hardwareService=require(_0xf044('0x15'));var logger=require(_0xf044('0x16'))(_0xf044('0x17'));var utils=require(_0xf044('0x18'));var config=require(_0xf044('0x19'));var db=require(_0xf044('0x1a'))['db'];config[_0xf044('0x1b')]=_['defaults'](config[_0xf044('0x1b')],{'host':_0xf044('0x1c'),'port':0x18eb});var socket=require(_0xf044('0x1d'))(new Redis(config[_0xf044('0x1b')]));require('./chatMessage.socket')[_0xf044('0x1e')](socket);var jayson=require(_0xf044('0x1f'));var client=jayson[_0xf044('0x20')][_0xf044('0x21')]({'port':0x232c});var client9002=jayson[_0xf044('0x20')][_0xf044('0x21')]({'port':0x232a});function checkPasswordPattern(_0x2831f9,_0x30aea0,_0x38f572){if(_0x38f572){var _0x2a7c2d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a7c2d['test'](_0x30aea0)){return _0x2831f9;}else{throw new db[(_0xf044('0x22'))][(_0xf044('0x23'))]('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 _0x2831f9;}}function respondWithRpcPromise(_0x2d6a18,_0x1c661e,_0x4d999b,_0x436b87){return new BPromise(function(_0x2cf155,_0x8adbfe){var _0x1a6d44=_0x436b87||client;return _0x1a6d44[_0xf044('0x24')](_0x2d6a18,_0x4d999b)[_0xf044('0x25')](function(_0x2cffee){logger['info'](_0xf044('0x26'),_0x1c661e,_0xf044('0x27'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x1c661e,_0xf044('0x27'),JSON['stringify'](_0x2cffee));if(_0x2cffee[_0xf044('0x28')]){if(_0x2cffee[_0xf044('0x28')]['code']===0x1f4){logger[_0xf044('0x28')](_0xf044('0x26'),_0x1c661e,_0x2cffee[_0xf044('0x28')][_0xf044('0x29')]);return _0x8adbfe(_0x2cffee[_0xf044('0x28')][_0xf044('0x29')]);}logger[_0xf044('0x28')](_0xf044('0x26'),_0x1c661e,_0x2cffee['error']['message']);return _0x2cf155(_0x2cffee[_0xf044('0x28')][_0xf044('0x29')]);}else{logger[_0xf044('0x2a')](_0xf044('0x26'),_0x1c661e,_0xf044('0x27'));_0x2cf155(_0x2cffee[_0xf044('0x2b')][_0xf044('0x29')]);}})[_0xf044('0x2c')](function(_0x1e574f){logger[_0xf044('0x28')](_0xf044('0x26'),_0x1c661e,_0x1e574f);_0x8adbfe(_0x1e574f);});});}function respondWithStatusCode(_0x172995,_0xeac6f0){_0xeac6f0=_0xeac6f0||0xcc;return function(_0x51a0ad){if(_0x51a0ad){return _0x172995[_0xf044('0x2d')](_0xeac6f0);}return _0x172995[_0xf044('0x2e')](_0xeac6f0)[_0xf044('0x2f')]();};}function respondWithResult(_0xc3bf4,_0x3cf1ce){_0x3cf1ce=_0x3cf1ce||0xc8;return function(_0x3cee08){if(_0x3cee08){return _0xc3bf4[_0xf044('0x2e')](_0x3cf1ce)[_0xf044('0x30')](_0x3cee08);}};}function respondWithFilteredResult(_0x1716c7,_0x43d9ce){return function(_0x1adaa5){if(_0x1adaa5){var _0x16a503=_0x1adaa5['count'],_0x491232=_0x43d9ce['offset'],_0x16baab=_0x43d9ce['offset']+_0x43d9ce[_0xf044('0x31')],_0x495c1d;if(_0x16baab>=_0x16a503){_0x16baab=_0x16a503;_0x495c1d=0xc8;}else{_0x495c1d=0xce;}_0x1716c7[_0xf044('0x2e')](_0x495c1d);return _0x1716c7[_0xf044('0x32')](_0xf044('0x33'),_0x491232+'-'+_0x16baab+'/'+_0x16a503)[_0xf044('0x30')](_0x1adaa5);}return null;};}function patchUpdates(_0x1961e6){return function(_0x161048){try{jsonpatch[_0xf044('0x34')](_0x161048,_0x1961e6,!![]);}catch(_0x105368){return BPromise['reject'](_0x105368);}return _0x161048[_0xf044('0x35')]();};}function saveUpdates(_0x22059a,_0x33d901){return function(_0x56951a){if(_0x56951a){return _0x56951a[_0xf044('0x36')](_0x22059a)['then'](function(_0x16acbb){return _0x16acbb;});}return null;};}function removeEntity(_0x3be50a,_0x5bcdd6){return function(_0x5e495b){if(_0x5e495b){return _0x5e495b[_0xf044('0x37')]()[_0xf044('0x25')](function(){_0x3be50a[_0xf044('0x2e')](0xcc)[_0xf044('0x2f')]();});}};}function handleEntityNotFound(_0x32e496,_0x4df2e6){return function(_0x23101b){if(!_0x23101b){_0x32e496[_0xf044('0x2d')](0x194);}return _0x23101b;};}function handleError(_0x2f6be0,_0xdc7002){_0xdc7002=_0xdc7002||0x1f4;return function(_0x54127d){logger['error'](_0x54127d[_0xf044('0x38')]);if(_0x54127d[_0xf044('0x39')]){delete _0x54127d[_0xf044('0x39')];}_0x2f6be0[_0xf044('0x2e')](_0xdc7002)[_0xf044('0x3a')](_0x54127d);};}exports[_0xf044('0x3b')]=function(_0x45ae37,_0x4165c4){var _0x5c09c1={},_0x563478={},_0x3121c1={'count':0x0,'rows':[]};var _0x5ae182=_[_0xf044('0x3c')](db[_0xf044('0x3d')][_0xf044('0x3e')],function(_0x5130c7){return{'name':_0x5130c7[_0xf044('0x3f')],'type':_0x5130c7['type'][_0xf044('0x40')]};});_0x563478[_0xf044('0x41')]=_[_0xf044('0x3c')](_0x5ae182,_0xf044('0x39'));_0x563478['query']=_[_0xf044('0x42')](_0x45ae37[_0xf044('0x43')]);_0x563478[_0xf044('0x44')]=_['intersection'](_0x563478[_0xf044('0x41')],_0x563478[_0xf044('0x43')]);_0x5c09c1[_0xf044('0x45')]=_['intersection'](_0x563478['model'],qs[_0xf044('0x46')](_0x45ae37[_0xf044('0x43')][_0xf044('0x46')]));_0x5c09c1[_0xf044('0x45')]=_0x5c09c1[_0xf044('0x45')][_0xf044('0x47')]?_0x5c09c1[_0xf044('0x45')]:_0x563478['model'];if(!_0x45ae37[_0xf044('0x43')][_0xf044('0x48')]('nolimit')){_0x5c09c1[_0xf044('0x31')]=qs[_0xf044('0x31')](_0x45ae37[_0xf044('0x43')][_0xf044('0x31')]);_0x5c09c1[_0xf044('0x49')]=qs[_0xf044('0x49')](_0x45ae37[_0xf044('0x43')][_0xf044('0x49')]);}_0x5c09c1['order']=qs[_0xf044('0x4a')](_0x45ae37[_0xf044('0x43')][_0xf044('0x4a')]);_0x5c09c1['where']=qs[_0xf044('0x44')](_[_0xf044('0x4b')](_0x45ae37[_0xf044('0x43')],_0x563478['filters']),_0x5ae182);if(_0x45ae37['query'][_0xf044('0x4c')]){_0x5c09c1[_0xf044('0x4d')]=_[_0xf044('0x4e')](_0x5c09c1[_0xf044('0x4d')],{'$or':_[_0xf044('0x3c')](_0x5ae182,function(_0x4b01a5){if(_0x4b01a5[_0xf044('0x4f')]!==_0xf044('0x50')){var _0x485337={};_0x485337[_0x4b01a5[_0xf044('0x39')]]={'$like':'%'+_0x45ae37[_0xf044('0x43')][_0xf044('0x4c')]+'%'};return _0x485337;}})});}_0x5c09c1=_[_0xf044('0x4e')]({},_0x5c09c1,_0x45ae37[_0xf044('0x51')]);var _0x19ec6f={'where':_0x5c09c1['where']};return db['ChatMessage'][_0xf044('0x52')](_0x19ec6f)['then'](function(_0x356c86){_0x3121c1[_0xf044('0x52')]=_0x356c86;if(_0x45ae37['query'][_0xf044('0x53')]){_0x5c09c1[_0xf044('0x54')]=[{'all':!![]}];}return db[_0xf044('0x3d')][_0xf044('0x55')](_0x5c09c1);})['then'](function(_0x1b9a10){_0x3121c1['rows']=_0x1b9a10;return _0x3121c1;})[_0xf044('0x25')](respondWithFilteredResult(_0x4165c4,_0x5c09c1))[_0xf044('0x2c')](handleError(_0x4165c4,null));};exports[_0xf044('0x56')]=function(_0x491cf0,_0x5a1dfc){var _0x401b89={'raw':!![],'where':{'id':_0x491cf0[_0xf044('0x57')]['id']}},_0x2bd83b={};_0x2bd83b['model']=_['keys'](db[_0xf044('0x3d')][_0xf044('0x3e')]);_0x2bd83b[_0xf044('0x43')]=_[_0xf044('0x42')](_0x491cf0[_0xf044('0x43')]);_0x2bd83b['filters']=_[_0xf044('0x58')](_0x2bd83b[_0xf044('0x41')],_0x2bd83b[_0xf044('0x43')]);_0x401b89[_0xf044('0x45')]=_[_0xf044('0x58')](_0x2bd83b[_0xf044('0x41')],qs[_0xf044('0x46')](_0x491cf0[_0xf044('0x43')][_0xf044('0x46')]));_0x401b89[_0xf044('0x45')]=_0x401b89[_0xf044('0x45')][_0xf044('0x47')]?_0x401b89[_0xf044('0x45')]:_0x2bd83b[_0xf044('0x41')];if(_0x491cf0[_0xf044('0x43')][_0xf044('0x53')]){_0x401b89[_0xf044('0x54')]=[{'all':!![]}];}_0x401b89=_[_0xf044('0x4e')]({},_0x401b89,_0x491cf0['options']);return db[_0xf044('0x3d')][_0xf044('0x59')](_0x401b89)[_0xf044('0x25')](handleEntityNotFound(_0x5a1dfc,null))['then'](respondWithResult(_0x5a1dfc,null))[_0xf044('0x2c')](handleError(_0x5a1dfc,null));};exports['create']=function(_0x45f77c,_0x297e8c){return db['ChatMessage'][_0xf044('0x5a')](_0x45f77c['body'],{})[_0xf044('0x25')](respondWithResult(_0x297e8c,0xc9))['catch'](handleError(_0x297e8c,null));};exports[_0xf044('0x36')]=function(_0x47857e,_0x1dd9a3){if(_0x47857e[_0xf044('0x5b')]['id']){delete _0x47857e[_0xf044('0x5b')]['id'];}return db[_0xf044('0x3d')][_0xf044('0x59')]({'where':{'id':_0x47857e[_0xf044('0x57')]['id']}})[_0xf044('0x25')](handleEntityNotFound(_0x1dd9a3,null))[_0xf044('0x25')](saveUpdates(_0x47857e[_0xf044('0x5b')],null))[_0xf044('0x25')](respondWithResult(_0x1dd9a3,null))[_0xf044('0x2c')](handleError(_0x1dd9a3,null));};exports[_0xf044('0x37')]=function(_0x5db2a6,_0x1ef73f){return db[_0xf044('0x3d')][_0xf044('0x59')]({'where':{'id':_0x5db2a6[_0xf044('0x57')]['id']}})[_0xf044('0x25')](handleEntityNotFound(_0x1ef73f,null))[_0xf044('0x25')](removeEntity(_0x1ef73f,null))[_0xf044('0x2c')](handleError(_0x1ef73f,null));};exports[_0xf044('0x5c')]=function(_0x9e1e0,_0xbb367f){return db[_0xf044('0x3d')][_0xf044('0x5c')]()[_0xf044('0x25')](respondWithResult(_0xbb367f,null))['catch'](handleError(_0xbb367f,null));};var interaction_log=require(_0xf044('0x16'))('chat-interactions');exports[_0xf044('0x5d')]=function(_0x2dadb3,_0x503188,_0x19600c){var _0x23d642={'channel':_0xf044('0x5e')};if(_0x2dadb3[_0xf044('0x5b')]['id']){delete _0x2dadb3['body']['id'];}_0x2dadb3[_0xf044('0x5b')]['read']=!![];_0x2dadb3[_0xf044('0x5b')][_0xf044('0x5f')]=moment()[_0xf044('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2dadb3['body'][_0xf044('0x61')]=_0x2dadb3[_0xf044('0x5b')][_0xf044('0x61')]||_0x2dadb3[_0xf044('0x62')]['id'];return db[_0xf044('0x3d')][_0xf044('0x59')]({'where':{'id':_0x2dadb3[_0xf044('0x57')]['id'],'UserId':null},'include':[{'model':db[_0xf044('0x63')],'as':_0xf044('0x64')}]})[_0xf044('0x25')](handleEntityNotFound(_0x503188,null))[_0xf044('0x25')](saveUpdates(_0x2dadb3[_0xf044('0x5b')],null))[_0xf044('0x25')](function(_0x5c0f93){if(_0x5c0f93){_0x23d642['message']=_0x5c0f93['get']({'plain':!![]});return db[_0xf044('0x65')][_0xf044('0x59')]({'where':{'id':_0x5c0f93[_0xf044('0x66')]}});}return null;})[_0xf044('0x25')](handleEntityNotFound(_0x503188,null))[_0xf044('0x25')](function(_0x7c75ec){if(_0x7c75ec){return _0x7c75ec[_0xf044('0x36')]({'UserId':_0x2dadb3['body']['UserId'],'read1stAt':_[_0xf044('0x67')](_0x7c75ec[_0xf044('0x68')])?moment()[_0xf044('0x60')](_0xf044('0x69')):undefined});}return null;})[_0xf044('0x25')](function(_0x456760){if(_0x456760){_0x23d642[_0xf044('0x6a')]=_0x456760[_0xf044('0x6b')]({'plain':!![]});interaction_log[_0xf044('0x2a')](_0xf044('0x6c'),_0x2dadb3[_0xf044('0x62')]['id'],_0x2dadb3[_0xf044('0x62')][_0xf044('0x39')],_0x2dadb3[_0xf044('0x62')][_0xf044('0x6d')],_0x23d642[_0xf044('0x6a')]['id'],_0x2dadb3[_0xf044('0x5b')]?JSON[_0xf044('0x6e')](_0x2dadb3[_0xf044('0x5b')]):_0xf044('0x6f'));return respondWithRpcPromise('AcceptMessage',_0xf044('0x70'),_0x23d642);}return null;})['then'](function(_0x31cb4a){if(_0x31cb4a){if(_0x2dadb3[_0xf044('0x5b')][_0xf044('0x71')]){_0x23d642[_0xf044('0x29')]['interface']=util[_0xf044('0x60')](_0xf044('0x72'),_0x2dadb3[_0xf044('0x62')][_0xf044('0x39')]);_0x23d642['message'][_0xf044('0x73')]=_0x23d642[_0xf044('0x73')];_0x23d642[_0xf044('0x29')][_0xf044('0x74')]=_0xf044('0x5d');return respondWithRpcPromise('EventManager',_0xf044('0x75'),{'event':_0xf044('0x76'),'message':_[_0xf044('0x4e')](_0x23d642['message'],JSON[_0xf044('0x77')](_0x23d642[_0xf044('0x6a')][_0xf044('0x78')]))},client9002)['then'](function(){return _0x23d642;});}return _0x23d642;}return null;})[_0xf044('0x25')](respondWithResult(_0x503188,null))[_0xf044('0x2c')](handleError(_0x503188,null));};var interaction_log=require('../../config/logger')(_0xf044('0x79'));exports[_0xf044('0x7a')]=function(_0x42569d,_0x4da254,_0x11a5fd){var _0x25ab85={'agent':{},'channel':'chat'};if(_0x42569d[_0xf044('0x5b')]['id']){delete _0x42569d['body']['id'];}_0x42569d[_0xf044('0x5b')][_0xf044('0x61')]=_0x42569d[_0xf044('0x5b')][_0xf044('0x61')]||_0x42569d[_0xf044('0x62')]['id'];_0x25ab85[_0xf044('0x7b')]['id']=_0x42569d['body'][_0xf044('0x61')];return db[_0xf044('0x3d')][_0xf044('0x59')]({'where':{'id':_0x42569d[_0xf044('0x57')]['id'],'UserId':null}})[_0xf044('0x25')](handleEntityNotFound(_0x4da254,null))[_0xf044('0x25')](function(_0x219937){if(_0x219937){_0x25ab85['message']=_0x219937[_0xf044('0x6b')]({'plain':!![]});return db['ChatInteraction'][_0xf044('0x59')]({'where':{'id':_0x219937[_0xf044('0x66')]}});}return null;})[_0xf044('0x25')](handleEntityNotFound(_0x4da254,null))[_0xf044('0x25')](function(_0x1b3be7){if(_0x1b3be7){_0x25ab85[_0xf044('0x6a')]=_0x1b3be7[_0xf044('0x6b')]({'plain':!![]});interaction_log[_0xf044('0x2a')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42569d[_0xf044('0x62')]['id'],_0x42569d[_0xf044('0x62')]['name'],_0x42569d[_0xf044('0x62')][_0xf044('0x6d')],_0x25ab85[_0xf044('0x6a')]['id'],_0x42569d[_0xf044('0x5b')]?JSON[_0xf044('0x6e')](_0x42569d[_0xf044('0x5b')]):_0xf044('0x6f'));return respondWithRpcPromise('RejectMessage',_0xf044('0x7c'),_0x25ab85);}return null;})[_0xf044('0x25')](function(_0x18ff98){if(_0x18ff98){_0x18ff98[_0xf044('0x29')][_0xf044('0x7d')]=util[_0xf044('0x60')](_0xf044('0x72'),_0x42569d['user']['name']);_0x18ff98[_0xf044('0x29')][_0xf044('0x73')]=_0x25ab85['channel'];_0x18ff98[_0xf044('0x29')]['event']=_0xf044('0x7a');respondWithRpcPromise(_0xf044('0x75'),_0xf044('0x75'),{'event':_0xf044('0x7e'),'message':_0x18ff98['message']},client9002);return _0x25ab85;}return null;})[_0xf044('0x25')](respondWithResult(_0x4da254,null))[_0xf044('0x2c')](handleError(_0x4da254,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 3ac3305..3b2ae90 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 _0xa63a=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x288184,_0x3e574a){var _0x1e54c1=function(_0x5e3be1){while(--_0x5e3be1){_0x288184['push'](_0x288184['shift']());}};_0x1e54c1(++_0x3e574a);}(_0xa63a,0x1a2));var _0xaa63=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xa63a[_0x3df871];return _0x570f7b;};'use strict';var EventEmitter=require(_0xaa63('0x0'));var ChatMessage=require(_0xaa63('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaa63('0x2')](0x0);var events={'afterCreate':_0xaa63('0x3'),'afterUpdate':_0xaa63('0x4'),'afterDestroy':_0xaa63('0x5')};function emitEvent(_0x46440e){return function(_0x3c9320,_0x288308,_0x23ca23){ChatMessageEvents[_0xaa63('0x6')](_0x46440e+':'+_0x3c9320['id'],_0x3c9320);ChatMessageEvents[_0xaa63('0x6')](_0x46440e,_0x3c9320);_0x23ca23(null);};}for(var e in events){if(events[_0xaa63('0x7')](e)){var event=events[e];ChatMessage[_0xaa63('0x8')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x54b1=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0xd8a8af,_0x1e93f0){var _0x5b7278=function(_0x458800){while(--_0x458800){_0xd8a8af['push'](_0xd8a8af['shift']());}};_0x5b7278(++_0x1e93f0);}(_0x54b1,0x151));var _0x154b=function(_0x2d2c60,_0x29e1ea){_0x2d2c60=_0x2d2c60-0x0;var _0x1b9816=_0x54b1[_0x2d2c60];return _0x1b9816;};'use strict';var EventEmitter=require(_0x154b('0x0'));var ChatMessage=require(_0x154b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x154b('0x2')](0x0);var events={'afterCreate':_0x154b('0x3'),'afterUpdate':_0x154b('0x4'),'afterDestroy':_0x154b('0x5')};function emitEvent(_0x116fcf){return function(_0x31e508,_0x5dc792,_0x284f71){ChatMessageEvents['emit'](_0x116fcf+':'+_0x31e508['id'],_0x31e508);ChatMessageEvents[_0x154b('0x6')](_0x116fcf,_0x31e508);_0x284f71(null);};}for(var e in events){if(events[_0x154b('0x7')](e)){var event=events[e];ChatMessage[_0x154b('0x8')](e,emitEvent(event));}}module[_0x154b('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 897da95..c16b3e9 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 _0xbb13=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','then','update','createdAt'];(function(_0x1a6aaa,_0x39b1c5){var _0x52b6ca=function(_0x1dfe75){while(--_0x1dfe75){_0x1a6aaa['push'](_0x1a6aaa['shift']());}};_0x52b6ca(++_0x39b1c5);}(_0xbb13,0x126));var _0x3bb1=function(_0x50b01c,_0x304f9a){_0x50b01c=_0x50b01c-0x0;var _0x533245=_0xbb13[_0x50b01c];return _0x533245;};'use strict';var _=require(_0x3bb1('0x0'));var util=require(_0x3bb1('0x1'));var logger=require(_0x3bb1('0x2'))('api');var moment=require(_0x3bb1('0x3'));var BPromise=require(_0x3bb1('0x4'));var rp=require(_0x3bb1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3bb1('0x6'));var attributes=require(_0x3bb1('0x7'));module[_0x3bb1('0x8')]=function(_0x1b9986,_0x6b9f8){return _0x1b9986[_0x3bb1('0x9')](_0x3bb1('0xa'),attributes,{'tableName':_0x3bb1('0xb'),'paranoid':![],'indexes':[{'name':_0x3bb1('0xc'),'fields':[_0x3bb1('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x278aa8,_0x56d1fa,_0x206e43){var _0x588380=_0x1b9986[_0x3bb1('0xe')];var _0x2825e3=_0x278aa8['get']({'plain':!![]});if(_0x2825e3[_0x3bb1('0xf')][_0x3bb1('0x10')]()==='in'||_0x2825e3[_0x3bb1('0xf')]['toLowerCase']()===_0x3bb1('0x11')&&!_0x2825e3[_0x3bb1('0x12')]&&!_[_0x3bb1('0x13')](_0x2825e3[_0x3bb1('0x14')])){_0x588380[_0x3bb1('0x15')]['findOne']({'where':{'id':_0x2825e3['ChatInteractionId']}})[_0x3bb1('0x16')](function(_0x5228b2){if(_0x5228b2){_0x5228b2[_0x3bb1('0x17')]({'lastMsgAt':_0x2825e3[_0x3bb1('0x18')],'lastMsgDirection':_0x2825e3[_0x3bb1('0xf')][_0x3bb1('0x10')]()});}})[_0x3bb1('0x19')](function(_0x5c8488){console[_0x3bb1('0x1a')](_0x5c8488);});}_0x206e43();}},'charset':_0x3bb1('0x1b'),'collate':_0x3bb1('0x1c')});}; \ No newline at end of file +var _0x090a=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x090a,0x1cf));var _0xa090=function(_0x580f53,_0x634e22){_0x580f53=_0x580f53-0x0;var _0x12c8fc=_0x090a[_0x580f53];return _0x12c8fc;};'use strict';var _=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var logger=require(_0xa090('0x2'))(_0xa090('0x3'));var moment=require(_0xa090('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa090('0x5'));var rimraf=require(_0xa090('0x6'));var config=require(_0xa090('0x7'));var attributes=require('./chatMessage.attributes');module[_0xa090('0x8')]=function(_0x55a9f3,_0x382efc){return _0x55a9f3[_0xa090('0x9')](_0xa090('0xa'),attributes,{'tableName':_0xa090('0xb'),'paranoid':![],'indexes':[{'name':_0xa090('0xc'),'fields':[_0xa090('0xd')],'type':_0xa090('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x212e97,_0x56092a,_0x16fd0e){var _0x7a03d3=_0x55a9f3['models'];var _0x46353c=_0x212e97[_0xa090('0xf')]({'plain':!![]});if(_0x46353c[_0xa090('0x10')][_0xa090('0x11')]()==='in'||_0x46353c['direction'][_0xa090('0x11')]()==='out'&&!_0x46353c[_0xa090('0x12')]&&!_[_0xa090('0x13')](_0x46353c[_0xa090('0x14')])){_0x7a03d3[_0xa090('0x15')][_0xa090('0x16')]({'where':{'id':_0x46353c[_0xa090('0x17')]}})[_0xa090('0x18')](function(_0x460d18){if(_0x460d18){_0x460d18[_0xa090('0x19')]({'lastMsgAt':_0x46353c[_0xa090('0x1a')],'lastMsgDirection':_0x46353c[_0xa090('0x10')][_0xa090('0x11')]()});}})[_0xa090('0x1b')](function(_0x252838){console[_0xa090('0x1c')](_0x252838);});}_0x16fd0e();}},'charset':_0xa090('0x1d'),'collate':_0xa090('0x1e')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index e0f9adf..4d268dc 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 _0xbb88=['body','options','raw','CreateChatMessage','stringify','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','ChatMessage,\x20%s,\x20%s','result','ChatMessage','create'];(function(_0x38d499,_0x1cbb6b){var _0x274b18=function(_0x488d64){while(--_0x488d64){_0x38d499['push'](_0x38d499['shift']());}};_0x274b18(++_0x1cbb6b);}(_0xbb88,0x171));var _0x8bb8=function(_0x4a1b1f,_0x245607){_0x4a1b1f=_0x4a1b1f-0x0;var _0x1ffdef=_0xbb88[_0x4a1b1f];return _0x1ffdef;};'use strict';var _=require(_0x8bb8('0x0'));var util=require(_0x8bb8('0x1'));var moment=require('moment');var BPromise=require(_0x8bb8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bb8('0x3'))['db'];var utils=require(_0x8bb8('0x4'));var logger=require(_0x8bb8('0x5'))('rpc');var config=require(_0x8bb8('0x6'));var jayson=require(_0x8bb8('0x7'));var client=jayson[_0x8bb8('0x8')][_0x8bb8('0x9')]({'port':0x232a});config[_0x8bb8('0xa')]=_[_0x8bb8('0xb')](config[_0x8bb8('0xa')],{'host':_0x8bb8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8bb8('0xa')]));require('./chatMessage.socket')[_0x8bb8('0xd')](socket);function respondWithRpcPromise(_0x5de0b3,_0x504bdf,_0x3fadb5){return new BPromise(function(_0x43e591,_0x2e057e){return client[_0x8bb8('0xe')](_0x5de0b3,_0x3fadb5)[_0x8bb8('0xf')](function(_0x3bfa63){logger[_0x8bb8('0x10')]('ChatMessage,\x20%s,\x20%s',_0x504bdf,_0x8bb8('0x11'));logger[_0x8bb8('0x12')](_0x8bb8('0x13'),_0x504bdf,_0x8bb8('0x11'),JSON['stringify'](_0x3bfa63));if(_0x3bfa63[_0x8bb8('0x14')]){if(_0x3bfa63['error'][_0x8bb8('0x15')]===0x1f4){logger[_0x8bb8('0x14')]('ChatMessage,\x20%s,\x20%s',_0x504bdf,_0x3bfa63[_0x8bb8('0x14')][_0x8bb8('0x16')]);return _0x2e057e(_0x3bfa63[_0x8bb8('0x14')][_0x8bb8('0x16')]);}logger[_0x8bb8('0x14')](_0x8bb8('0x17'),_0x504bdf,_0x3bfa63[_0x8bb8('0x14')][_0x8bb8('0x16')]);return _0x43e591(_0x3bfa63[_0x8bb8('0x14')][_0x8bb8('0x16')]);}else{logger[_0x8bb8('0x10')](_0x8bb8('0x17'),_0x504bdf,_0x8bb8('0x11'));_0x43e591(_0x3bfa63[_0x8bb8('0x18')][_0x8bb8('0x16')]);}})['catch'](function(_0x131436){logger[_0x8bb8('0x14')](_0x8bb8('0x17'),_0x504bdf,_0x131436);_0x2e057e(_0x131436);});});}exports['CreateChatMessage']=function(_0x336000){var _0xc8fb9a=this;return new Promise(function(_0x5e91e9,_0x42f8c8){return db[_0x8bb8('0x19')][_0x8bb8('0x1a')](_0x336000[_0x8bb8('0x1b')],{'raw':_0x336000[_0x8bb8('0x1c')]?_0x336000['options'][_0x8bb8('0x1d')]===undefined?!![]:![]:!![]})[_0x8bb8('0xf')](function(_0x1699ba){logger[_0x8bb8('0x10')](_0x8bb8('0x1e'),_0x336000);logger[_0x8bb8('0x12')](_0x8bb8('0x1e'),_0x336000,JSON[_0x8bb8('0x1f')](_0x1699ba));_0x5e91e9(_0x1699ba);})[_0x8bb8('0x20')](function(_0x19dbd6){logger[_0x8bb8('0x14')]('CreateChatMessage',_0x19dbd6['message'],_0x336000);_0x42f8c8(_0xc8fb9a[_0x8bb8('0x14')](0x1f4,_0x19dbd6[_0x8bb8('0x16')]));});});}; \ No newline at end of file +var _0x1cba=['then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateChatMessage','ChatMessage','body','options','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','localhost','./chatMessage.socket','register','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1cba,0x188));var _0xa1cb=function(_0x36a560,_0x57378b){_0x36a560=_0x36a560-0x0;var _0x10923a=_0x1cba[_0x36a560];return _0x10923a;};'use strict';var _=require(_0xa1cb('0x0'));var util=require(_0xa1cb('0x1'));var moment=require('moment');var BPromise=require(_0xa1cb('0x2'));var rs=require(_0xa1cb('0x3'));var fs=require('fs');var Redis=require(_0xa1cb('0x4'));var db=require(_0xa1cb('0x5'))['db'];var utils=require(_0xa1cb('0x6'));var logger=require('../../config/logger')(_0xa1cb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xa1cb('0x8')]({'port':0x232a});config[_0xa1cb('0x9')]=_['defaults'](config['redis'],{'host':_0xa1cb('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa1cb('0xb'))[_0xa1cb('0xc')](socket);function respondWithRpcPromise(_0x249872,_0x43995f,_0x4ce661){return new BPromise(function(_0x9edae,_0x4df8ae){return client[_0xa1cb('0xd')](_0x249872,_0x4ce661)[_0xa1cb('0xe')](function(_0x216a83){logger[_0xa1cb('0xf')](_0xa1cb('0x10'),_0x43995f,'request\x20sent');logger[_0xa1cb('0x11')](_0xa1cb('0x12'),_0x43995f,_0xa1cb('0x13'),JSON[_0xa1cb('0x14')](_0x216a83));if(_0x216a83[_0xa1cb('0x15')]){if(_0x216a83[_0xa1cb('0x15')]['code']===0x1f4){logger[_0xa1cb('0x15')](_0xa1cb('0x10'),_0x43995f,_0x216a83['error'][_0xa1cb('0x16')]);return _0x4df8ae(_0x216a83[_0xa1cb('0x15')][_0xa1cb('0x16')]);}logger[_0xa1cb('0x15')](_0xa1cb('0x10'),_0x43995f,_0x216a83[_0xa1cb('0x15')][_0xa1cb('0x16')]);return _0x9edae(_0x216a83[_0xa1cb('0x15')][_0xa1cb('0x16')]);}else{logger['info'](_0xa1cb('0x10'),_0x43995f,_0xa1cb('0x13'));_0x9edae(_0x216a83[_0xa1cb('0x17')][_0xa1cb('0x16')]);}})['catch'](function(_0x1ca435){logger[_0xa1cb('0x15')](_0xa1cb('0x10'),_0x43995f,_0x1ca435);_0x4df8ae(_0x1ca435);});});}exports[_0xa1cb('0x18')]=function(_0xae928a){var _0x2da30c=this;return new Promise(function(_0x12dc8b,_0xeb5ad3){return db[_0xa1cb('0x19')]['create'](_0xae928a[_0xa1cb('0x1a')],{'raw':_0xae928a[_0xa1cb('0x1b')]?_0xae928a[_0xa1cb('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xa1cb('0xe')](function(_0x3d7eec){logger[_0xa1cb('0xf')](_0xa1cb('0x18'),_0xae928a);logger[_0xa1cb('0x11')](_0xa1cb('0x18'),_0xae928a,JSON[_0xa1cb('0x14')](_0x3d7eec));_0x12dc8b(_0x3d7eec);})[_0xa1cb('0x1c')](function(_0xb9f9a4){logger[_0xa1cb('0x15')]('CreateChatMessage',_0xb9f9a4[_0xa1cb('0x16')],_0xae928a);_0xeb5ad3(_0x2da30c['error'](0x1f4,_0xb9f9a4[_0xa1cb('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f253435..6bc43a1 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 _0x5d58=['register'];(function(_0x56618b,_0x15065a){var _0x4cdd7f=function(_0x35a0dd){while(--_0x35a0dd){_0x56618b['push'](_0x56618b['shift']());}};_0x4cdd7f(++_0x15065a);}(_0x5d58,0x187));var _0x85d5=function(_0x17d2c1,_0x5261ed){_0x17d2c1=_0x17d2c1-0x0;var _0x3e952d=_0x5d58[_0x17d2c1];return _0x3e952d;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove','update'];function createListener(_0x501631,_0x64d32c){return function(_0x1eff3b){_0x64d32c['emit'](_0x501631,_0x1eff3b);};}function removeListener(_0x1469fc,_0x30bfe8){return function(){ChatMessageEvents['removeListener'](_0x1469fc,_0x30bfe8);};}exports[_0x85d5('0x0')]=function(_0x2d457a){for(var _0x578fad=0x0,_0x46e7b4=events['length'];_0x578fad<_0x46e7b4;_0x578fad++){var _0x98c963=events[_0x578fad];var _0x3fecca=createListener('chatMessage:'+_0x98c963,_0x2d457a);ChatMessageEvents['on'](_0x98c963,_0x3fecca);}}; \ No newline at end of file +var _0xd117=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x1e7ffa,_0x21f9e4){var _0x5dbae8=function(_0x13c2da){while(--_0x13c2da){_0x1e7ffa['push'](_0x1e7ffa['shift']());}};_0x5dbae8(++_0x21f9e4);}(_0xd117,0x182));var _0x7d11=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0xd117[_0xf73c09];return _0xa8923c;};'use strict';var ChatMessageEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){ChatMessageEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);ChatMessageEvents['on'](_0x47b5e6,_0x3803b5);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index ce609c5..84ca741 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 _0x783f=['/:id','isAuthenticated','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe'];(function(_0x4d81aa,_0x1cede4){var _0x332ee2=function(_0x46ce20){while(--_0x46ce20){_0x4d81aa['push'](_0x4d81aa['shift']());}};_0x332ee2(++_0x1cede4);}(_0x783f,0x102));var _0xf783=function(_0x5c92a7,_0x5d9b3d){_0x5c92a7=_0x5c92a7-0x0;var _0x38142b=_0x783f[_0x5c92a7];return _0x38142b;};'use strict';var multer=require(_0xf783('0x0'));var util=require(_0xf783('0x1'));var path=require(_0xf783('0x2'));var timeout=require(_0xf783('0x3'));var express=require('express');var router=express[_0xf783('0x4')]();var auth=require(_0xf783('0x5'));var interaction=require(_0xf783('0x6'));var config=require(_0xf783('0x7'));var controller=require('./chatMessage.controller');router[_0xf783('0x8')]('/',auth['isAuthenticated'](),controller[_0xf783('0x9')]);router[_0xf783('0x8')](_0xf783('0xa'),auth['isAuthenticated'](),controller[_0xf783('0xb')]);router[_0xf783('0x8')](_0xf783('0xc'),auth[_0xf783('0xd')](),controller[_0xf783('0xe')]);router[_0xf783('0xf')]('/',auth[_0xf783('0xd')](),interaction[_0xf783('0x10')](_0xf783('0x11'),_0xf783('0x12')),controller[_0xf783('0x13')]);router[_0xf783('0x14')](_0xf783('0xc'),controller[_0xf783('0x15')]);router[_0xf783('0x14')](_0xf783('0x16'),auth[_0xf783('0xd')](),controller[_0xf783('0x17')]);router[_0xf783('0x14')](_0xf783('0x18'),auth[_0xf783('0xd')](),controller['reject']);router['delete'](_0xf783('0xc'),auth[_0xf783('0xd')](),controller[_0xf783('0x19')]);module[_0xf783('0x1a')]=router; \ No newline at end of file +var _0x29db=['show','post','tracked','chat','chatmessage:create','update','put','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4d40a2,_0x46f6bd){var _0x3d8c00=function(_0x419cb6){while(--_0x419cb6){_0x4d40a2['push'](_0x4d40a2['shift']());}};_0x3d8c00(++_0x46f6bd);}(_0x29db,0x1c5));var _0xb29d=function(_0x2ec0f,_0x256d14){_0x2ec0f=_0x2ec0f-0x0;var _0x2f0861=_0x29db[_0x2ec0f];return _0x2f0861;};'use strict';var multer=require(_0xb29d('0x0'));var util=require(_0xb29d('0x1'));var path=require(_0xb29d('0x2'));var timeout=require(_0xb29d('0x3'));var express=require('express');var router=express[_0xb29d('0x4')]();var auth=require(_0xb29d('0x5'));var interaction=require(_0xb29d('0x6'));var config=require(_0xb29d('0x7'));var controller=require(_0xb29d('0x8'));router[_0xb29d('0x9')]('/',auth[_0xb29d('0xa')](),controller[_0xb29d('0xb')]);router[_0xb29d('0x9')](_0xb29d('0xc'),auth[_0xb29d('0xa')](),controller[_0xb29d('0xd')]);router[_0xb29d('0x9')](_0xb29d('0xe'),auth[_0xb29d('0xa')](),controller[_0xb29d('0xf')]);router[_0xb29d('0x10')]('/',auth[_0xb29d('0xa')](),interaction[_0xb29d('0x11')](_0xb29d('0x12'),_0xb29d('0x13')),controller['create']);router['put']('/:id',controller[_0xb29d('0x14')]);router[_0xb29d('0x15')]('/:id/accept',auth[_0xb29d('0xa')](),controller['accept']);router[_0xb29d('0x15')]('/:id/reject',auth[_0xb29d('0xa')](),controller[_0xb29d('0x16')]);router[_0xb29d('0x17')](_0xb29d('0xe'),auth[_0xb29d('0xa')](),controller[_0xb29d('0x18')]);module[_0xb29d('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 70be9e7..3eaae24 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 _0x2c46=['sequelize','exports','TEXT','medium'];(function(_0x14e037,_0x147cc8){var _0x5722f4=function(_0xc72f9c){while(--_0xc72f9c){_0x14e037['push'](_0x14e037['shift']());}};_0x5722f4(++_0x147cc8);}(_0x2c46,0x170));var _0x62c4=function(_0x534ef8,_0x400abe){_0x534ef8=_0x534ef8-0x0;var _0x14637c=_0x2c46[_0x534ef8];return _0x14637c;};'use strict';var Sequelize=require(_0x62c4('0x0'));module[_0x62c4('0x1')]={'body':{'type':Sequelize[_0x62c4('0x2')](_0x62c4('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x838b=['sequelize','exports','medium'];(function(_0x16880b,_0x297ccb){var _0x2f9c97=function(_0xb1534f){while(--_0xb1534f){_0x16880b['push'](_0x16880b['shift']());}};_0x2f9c97(++_0x297ccb);}(_0x838b,0x15c));var _0xb838=function(_0x302180,_0x398873){_0x302180=_0x302180-0x0;var _0x14634b=_0x838b[_0x302180];return _0x14634b;};'use strict';var Sequelize=require(_0xb838('0x0'));module[_0xb838('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb838('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 15e5388..624d810 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(_0x239608,_0x40559a){var _0x285922=function(_0x22c71c){while(--_0x22c71c){_0x239608['push'](_0x239608['shift']());}};_0x285922(++_0x40559a);}(_0xe14b,0x93));var _0xbe14=function(_0x460956,_0x1d613d){_0x460956=_0x460956-0x0;var _0x3b99e6=_0xe14b[_0x460956];return _0x3b99e6;};'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 _0xf2ca=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatOfflineMessage','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','body','describe','html-pdf','eml-format','rimraf'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x80bea0,_0x4c30f4){_0x80bea0=_0x80bea0-0x0;var _0x50fb90=_0xf2ca[_0x80bea0];return _0x50fb90;};'use strict';var pdf=require(_0xaf2c('0x0'));var emlformat=require(_0xaf2c('0x1'));var rimraf=require(_0xaf2c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf2c('0x3'));var rp=require(_0xaf2c('0x4'));var moment=require(_0xaf2c('0x5'));var BPromise=require(_0xaf2c('0x6'));var Mustache=require(_0xaf2c('0x7'));var util=require(_0xaf2c('0x8'));var path=require('path');var sox=require(_0xaf2c('0x9'));var csv=require(_0xaf2c('0xa'));var ejs=require(_0xaf2c('0xb'));var fs=require('fs');var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0xa'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var db=require(_0xaf2c('0x16'))['db'];function respondWithStatusCode(_0xd56a5d,_0x285dac){_0x285dac=_0x285dac||0xcc;return function(_0x59a59b){if(_0x59a59b){return _0xd56a5d['sendStatus'](_0x285dac);}return _0xd56a5d[_0xaf2c('0x17')](_0x285dac)[_0xaf2c('0x18')]();};}function respondWithResult(_0x935959,_0x18a8a5){_0x18a8a5=_0x18a8a5||0xc8;return function(_0x293ca6){if(_0x293ca6){return _0x935959[_0xaf2c('0x17')](_0x18a8a5)[_0xaf2c('0x19')](_0x293ca6);}};}function respondWithFilteredResult(_0x3c1088,_0x2119c8){return function(_0x1d0633){if(_0x1d0633){var _0x6ac8e=_0x1d0633[_0xaf2c('0x1a')],_0x2b4d13=_0x2119c8['offset'],_0x26bf7b=_0x2119c8[_0xaf2c('0x1b')]+_0x2119c8['limit'],_0x3432e4;if(_0x26bf7b>=_0x6ac8e){_0x26bf7b=_0x6ac8e;_0x3432e4=0xc8;}else{_0x3432e4=0xce;}_0x3c1088[_0xaf2c('0x17')](_0x3432e4);return _0x3c1088[_0xaf2c('0x1c')](_0xaf2c('0x1d'),_0x2b4d13+'-'+_0x26bf7b+'/'+_0x6ac8e)['json'](_0x1d0633);}return null;};}function patchUpdates(_0x28ae7b){return function(_0x297bcd){try{jsonpatch[_0xaf2c('0x1e')](_0x297bcd,_0x28ae7b,!![]);}catch(_0x20000b){return BPromise[_0xaf2c('0x1f')](_0x20000b);}return _0x297bcd[_0xaf2c('0x20')]();};}function saveUpdates(_0x531609,_0x35e712){return function(_0x164bcb){if(_0x164bcb){return _0x164bcb[_0xaf2c('0x21')](_0x531609)[_0xaf2c('0x22')](function(_0x237318){return _0x237318;});}return null;};}function removeEntity(_0x486de2,_0x396646){return function(_0xbf6f62){if(_0xbf6f62){return _0xbf6f62[_0xaf2c('0x23')]()['then'](function(){_0x486de2['status'](0xcc)[_0xaf2c('0x18')]();});}};}function handleEntityNotFound(_0x303546,_0x1cafad){return function(_0x99f78d){if(!_0x99f78d){_0x303546['sendStatus'](0x194);}return _0x99f78d;};}function handleError(_0x2b8f1a,_0xf1a7cf){_0xf1a7cf=_0xf1a7cf||0x1f4;return function(_0x3a0145){logger[_0xaf2c('0x24')](_0x3a0145[_0xaf2c('0x25')]);if(_0x3a0145[_0xaf2c('0x26')]){delete _0x3a0145[_0xaf2c('0x26')];}_0x2b8f1a['status'](_0xf1a7cf)[_0xaf2c('0x27')](_0x3a0145);};}exports[_0xaf2c('0x28')]=function(_0x36f37c,_0x410536){var _0x4b7cf2={},_0x3fb190={},_0x589d47={'count':0x0,'rows':[]};var _0x38db1b=_[_0xaf2c('0x29')](db[_0xaf2c('0x2a')]['rawAttributes'],function(_0x2747bb){return{'name':_0x2747bb[_0xaf2c('0x2b')],'type':_0x2747bb[_0xaf2c('0x2c')]['key']};});_0x3fb190[_0xaf2c('0x2d')]=_[_0xaf2c('0x29')](_0x38db1b,_0xaf2c('0x26'));_0x3fb190[_0xaf2c('0x2e')]=_['keys'](_0x36f37c[_0xaf2c('0x2e')]);_0x3fb190[_0xaf2c('0x2f')]=_[_0xaf2c('0x30')](_0x3fb190['model'],_0x3fb190['query']);_0x4b7cf2[_0xaf2c('0x31')]=_['intersection'](_0x3fb190[_0xaf2c('0x2d')],qs['fields'](_0x36f37c[_0xaf2c('0x2e')][_0xaf2c('0x32')]));_0x4b7cf2['attributes']=_0x4b7cf2[_0xaf2c('0x31')][_0xaf2c('0x33')]?_0x4b7cf2['attributes']:_0x3fb190[_0xaf2c('0x2d')];if(!_0x36f37c[_0xaf2c('0x2e')][_0xaf2c('0x34')](_0xaf2c('0x35'))){_0x4b7cf2[_0xaf2c('0x36')]=qs[_0xaf2c('0x36')](_0x36f37c['query'][_0xaf2c('0x36')]);_0x4b7cf2['offset']=qs[_0xaf2c('0x1b')](_0x36f37c['query'][_0xaf2c('0x1b')]);}_0x4b7cf2['order']=qs[_0xaf2c('0x37')](_0x36f37c['query'][_0xaf2c('0x37')]);_0x4b7cf2['where']=qs[_0xaf2c('0x2f')](_[_0xaf2c('0x38')](_0x36f37c[_0xaf2c('0x2e')],_0x3fb190[_0xaf2c('0x2f')]),_0x38db1b);if(_0x36f37c[_0xaf2c('0x2e')]['filter']){_0x4b7cf2['where']=_[_0xaf2c('0x39')](_0x4b7cf2[_0xaf2c('0x3a')],{'$or':_[_0xaf2c('0x29')](_0x38db1b,function(_0xa44813){if(_0xa44813[_0xaf2c('0x2c')]!==_0xaf2c('0x3b')){var _0x573db3={};_0x573db3[_0xa44813[_0xaf2c('0x26')]]={'$like':'%'+_0x36f37c[_0xaf2c('0x2e')]['filter']+'%'};return _0x573db3;}})});}_0x4b7cf2=_[_0xaf2c('0x39')]({},_0x4b7cf2,_0x36f37c[_0xaf2c('0x3c')]);var _0x25bebd={'where':_0x4b7cf2[_0xaf2c('0x3a')]};return db[_0xaf2c('0x2a')][_0xaf2c('0x1a')](_0x25bebd)[_0xaf2c('0x22')](function(_0x310d3b){_0x589d47[_0xaf2c('0x1a')]=_0x310d3b;if(_0x36f37c[_0xaf2c('0x2e')][_0xaf2c('0x3d')]){_0x4b7cf2[_0xaf2c('0x3e')]=[{'all':!![]}];}return db[_0xaf2c('0x2a')]['findAll'](_0x4b7cf2);})['then'](function(_0x4db7d0){_0x589d47[_0xaf2c('0x3f')]=_0x4db7d0;return _0x589d47;})[_0xaf2c('0x22')](respondWithFilteredResult(_0x410536,_0x4b7cf2))[_0xaf2c('0x40')](handleError(_0x410536,null));};exports[_0xaf2c('0x41')]=function(_0x715f39,_0x29460c){var _0x51c441={'raw':!![],'where':{'id':_0x715f39[_0xaf2c('0x42')]['id']}},_0x1d58bd={};_0x1d58bd[_0xaf2c('0x2d')]=_['keys'](db['ChatOfflineMessage'][_0xaf2c('0x43')]);_0x1d58bd['query']=_[_0xaf2c('0x44')](_0x715f39[_0xaf2c('0x2e')]);_0x1d58bd[_0xaf2c('0x2f')]=_[_0xaf2c('0x30')](_0x1d58bd['model'],_0x1d58bd[_0xaf2c('0x2e')]);_0x51c441['attributes']=_[_0xaf2c('0x30')](_0x1d58bd[_0xaf2c('0x2d')],qs['fields'](_0x715f39[_0xaf2c('0x2e')]['fields']));_0x51c441[_0xaf2c('0x31')]=_0x51c441[_0xaf2c('0x31')][_0xaf2c('0x33')]?_0x51c441[_0xaf2c('0x31')]:_0x1d58bd[_0xaf2c('0x2d')];if(_0x715f39[_0xaf2c('0x2e')][_0xaf2c('0x3d')]){_0x51c441[_0xaf2c('0x3e')]=[{'all':!![]}];}_0x51c441=_[_0xaf2c('0x39')]({},_0x51c441,_0x715f39['options']);return db['ChatOfflineMessage'][_0xaf2c('0x45')](_0x51c441)['then'](handleEntityNotFound(_0x29460c,null))['then'](respondWithResult(_0x29460c,null))['catch'](handleError(_0x29460c,null));};exports[_0xaf2c('0x46')]=function(_0x964b76,_0x3cabd4){return db[_0xaf2c('0x2a')]['create'](_0x964b76[_0xaf2c('0x47')],{})['then'](respondWithResult(_0x3cabd4,0xc9))[_0xaf2c('0x40')](handleError(_0x3cabd4,null));};exports['update']=function(_0x166c26,_0x133e8c){if(_0x166c26[_0xaf2c('0x47')]['id']){delete _0x166c26[_0xaf2c('0x47')]['id'];}return db[_0xaf2c('0x2a')]['find']({'where':{'id':_0x166c26[_0xaf2c('0x42')]['id']}})[_0xaf2c('0x22')](handleEntityNotFound(_0x133e8c,null))['then'](saveUpdates(_0x166c26['body'],null))[_0xaf2c('0x22')](respondWithResult(_0x133e8c,null))['catch'](handleError(_0x133e8c,null));};exports[_0xaf2c('0x23')]=function(_0x23642b,_0x17b9ec){return db[_0xaf2c('0x2a')][_0xaf2c('0x45')]({'where':{'id':_0x23642b[_0xaf2c('0x42')]['id']}})[_0xaf2c('0x22')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x22')](removeEntity(_0x17b9ec,null))[_0xaf2c('0x40')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x48')]=function(_0x371486,_0x5bf349){return db[_0xaf2c('0x2a')][_0xaf2c('0x48')]()['then'](respondWithResult(_0x5bf349,null))['catch'](handleError(_0x5bf349,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 2644092..162b8d2 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 _0x8f88=['request-promise','path','../../config/environment','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','api','moment','bluebird'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0x8f88,0x152));var _0x88f8=function(_0x2c2390,_0x37ef1c){_0x2c2390=_0x2c2390-0x0;var _0x478b7e=_0x8f88[_0x2c2390];return _0x478b7e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x88f8('0x0'));var moment=require(_0x88f8('0x1'));var BPromise=require(_0x88f8('0x2'));var rp=require(_0x88f8('0x3'));var fs=require('fs');var path=require(_0x88f8('0x4'));var rimraf=require('rimraf');var config=require(_0x88f8('0x5'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x46a38b,_0x58573a){return _0x46a38b[_0x88f8('0x6')](_0x88f8('0x7'),attributes,{'tableName':_0x88f8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x88f8('0x9'),'collate':_0x88f8('0xa')});}; \ No newline at end of file +var _0x8897=['./chatOfflineMessage.attributes','chat_offline_messages','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x8897,0x157));var _0x7889=function(_0x3179ee,_0x332f7d){_0x3179ee=_0x3179ee-0x0;var _0x56b59=_0x8897[_0x3179ee];return _0x56b59;};'use strict';var _=require('lodash');var util=require(_0x7889('0x0'));var logger=require(_0x7889('0x1'))(_0x7889('0x2'));var moment=require(_0x7889('0x3'));var BPromise=require(_0x7889('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7889('0x5'));var rimraf=require(_0x7889('0x6'));var config=require('../../config/environment');var attributes=require(_0x7889('0x7'));module['exports']=function(_0x1b9e89,_0x30e435){return _0x1b9e89['define']('ChatOfflineMessage',attributes,{'tableName':_0x7889('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7889('0x9')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f7acd77..2de5eb6 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 _0x360b=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x446969,_0x17b7d3){var _0x43f3fb=function(_0x16ed46){while(--_0x16ed46){_0x446969['push'](_0x446969['shift']());}};_0x43f3fb(++_0x17b7d3);}(_0x360b,0x68));var _0xb360=function(_0xb85542,_0x4b90b7){_0xb85542=_0xb85542-0x0;var _0xf0df12=_0x360b[_0xb85542];return _0xf0df12;};'use strict';var _=require(_0xb360('0x0'));var util=require(_0xb360('0x1'));var moment=require(_0xb360('0x2'));var BPromise=require('bluebird');var rs=require(_0xb360('0x3'));var fs=require('fs');var Redis=require(_0xb360('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb360('0x5'));var logger=require(_0xb360('0x6'))(_0xb360('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb360('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc65374,_0x38b0e7,_0x1be650){return new BPromise(function(_0xf041f8,_0x41a5df){return client[_0xb360('0x9')](_0xc65374,_0x1be650)['then'](function(_0x4fbee4){logger[_0xb360('0xa')](_0xb360('0xb'),_0x38b0e7,_0xb360('0xc'));logger[_0xb360('0xd')](_0xb360('0xe'),_0x38b0e7,_0xb360('0xc'),JSON[_0xb360('0xf')](_0x4fbee4));if(_0x4fbee4['error']){if(_0x4fbee4[_0xb360('0x10')][_0xb360('0x11')]===0x1f4){logger[_0xb360('0x10')](_0xb360('0xb'),_0x38b0e7,_0x4fbee4[_0xb360('0x10')]['message']);return _0x41a5df(_0x4fbee4[_0xb360('0x10')]['message']);}logger[_0xb360('0x10')](_0xb360('0xb'),_0x38b0e7,_0x4fbee4[_0xb360('0x10')][_0xb360('0x12')]);return _0xf041f8(_0x4fbee4[_0xb360('0x10')][_0xb360('0x12')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x38b0e7,_0xb360('0xc'));_0xf041f8(_0x4fbee4[_0xb360('0x13')][_0xb360('0x12')]);}})[_0xb360('0x14')](function(_0x4781bf){logger[_0xb360('0x10')](_0xb360('0xb'),_0x38b0e7,_0x4781bf);_0x41a5df(_0x4781bf);});});} \ No newline at end of file +var _0xaa1f=['http','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xaa1f,0x146));var _0xfaa1=function(_0x1592c8,_0x44cc37){_0x1592c8=_0x1592c8-0x0;var _0x36f59d=_0xaa1f[_0x1592c8];return _0x36f59d;};'use strict';var _=require('lodash');var util=require(_0xfaa1('0x0'));var moment=require(_0xfaa1('0x1'));var BPromise=require('bluebird');var rs=require(_0xfaa1('0x2'));var fs=require('fs');var Redis=require(_0xfaa1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfaa1('0x4'));var logger=require(_0xfaa1('0x5'))(_0xfaa1('0x6'));var config=require(_0xfaa1('0x7'));var jayson=require(_0xfaa1('0x8'));var client=jayson[_0xfaa1('0x9')][_0xfaa1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e5b06,_0x3816b8,_0xf40a57){return new BPromise(function(_0x238f6a,_0x5879f3){return client['request'](_0x5e5b06,_0xf40a57)[_0xfaa1('0xb')](function(_0x4f0ea9){logger[_0xfaa1('0xc')](_0xfaa1('0xd'),_0x3816b8,'request\x20sent');logger[_0xfaa1('0xe')](_0xfaa1('0xf'),_0x3816b8,'request\x20sent',JSON['stringify'](_0x4f0ea9));if(_0x4f0ea9[_0xfaa1('0x10')]){if(_0x4f0ea9[_0xfaa1('0x10')]['code']===0x1f4){logger[_0xfaa1('0x10')](_0xfaa1('0xd'),_0x3816b8,_0x4f0ea9[_0xfaa1('0x10')][_0xfaa1('0x11')]);return _0x5879f3(_0x4f0ea9[_0xfaa1('0x10')][_0xfaa1('0x11')]);}logger[_0xfaa1('0x10')](_0xfaa1('0xd'),_0x3816b8,_0x4f0ea9['error'][_0xfaa1('0x11')]);return _0x238f6a(_0x4f0ea9[_0xfaa1('0x10')][_0xfaa1('0x11')]);}else{logger[_0xfaa1('0xc')](_0xfaa1('0xd'),_0x3816b8,_0xfaa1('0x12'));_0x238f6a(_0x4f0ea9[_0xfaa1('0x13')][_0xfaa1('0x11')]);}})[_0xfaa1('0x14')](function(_0x3d3e18){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x3816b8,_0x3d3e18);_0x5879f3(_0x3d3e18);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 7a9fa91..f5d5058 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 _0x5468=['path','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','show','create','put','update','delete','/:id','exports','multer','util'];(function(_0x5300e9,_0x4f2695){var _0x2410de=function(_0x165390){while(--_0x165390){_0x5300e9['push'](_0x5300e9['shift']());}};_0x2410de(++_0x4f2695);}(_0x5468,0x11e));var _0x8546=function(_0x259c99,_0x28fc7b){_0x259c99=_0x259c99-0x0;var _0x589fef=_0x5468[_0x259c99];return _0x589fef;};'use strict';var multer=require(_0x8546('0x0'));var util=require(_0x8546('0x1'));var path=require(_0x8546('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8546('0x3')]();var auth=require(_0x8546('0x4'));var interaction=require(_0x8546('0x5'));var config=require('../../config/environment');var controller=require(_0x8546('0x6'));router['get']('/',auth[_0x8546('0x7')](),controller['index']);router[_0x8546('0x8')](_0x8546('0x9'),auth[_0x8546('0x7')](),controller[_0x8546('0xa')]);router[_0x8546('0x8')]('/:id',auth[_0x8546('0x7')](),controller[_0x8546('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8546('0xc')]);router[_0x8546('0xd')]('/:id',auth[_0x8546('0x7')](),controller[_0x8546('0xe')]);router[_0x8546('0xf')](_0x8546('0x10'),auth[_0x8546('0x7')](),controller['destroy']);module[_0x8546('0x11')]=router; \ No newline at end of file +var _0xdaa8=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1e1838,_0x22e4f3){var _0x3d4c54=function(_0x57274e){while(--_0x57274e){_0x1e1838['push'](_0x1e1838['shift']());}};_0x3d4c54(++_0x22e4f3);}(_0xdaa8,0x188));var _0x8daa=function(_0x15d1a7,_0x550c26){_0x15d1a7=_0x15d1a7-0x0;var _0x35b219=_0xdaa8[_0x15d1a7];return _0x35b219;};'use strict';var multer=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var path=require(_0x8daa('0x2'));var timeout=require(_0x8daa('0x3'));var express=require(_0x8daa('0x4'));var router=express[_0x8daa('0x5')]();var auth=require(_0x8daa('0x6'));var interaction=require(_0x8daa('0x7'));var config=require(_0x8daa('0x8'));var controller=require(_0x8daa('0x9'));router[_0x8daa('0xa')]('/',auth['isAuthenticated'](),controller[_0x8daa('0xb')]);router['get'](_0x8daa('0xc'),auth[_0x8daa('0xd')](),controller['describe']);router[_0x8daa('0xa')](_0x8daa('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x8daa('0xf')]('/',auth[_0x8daa('0xd')](),controller[_0x8daa('0x10')]);router[_0x8daa('0x11')](_0x8daa('0xe'),auth[_0x8daa('0xd')](),controller[_0x8daa('0x12')]);router[_0x8daa('0x13')](_0x8daa('0xe'),auth[_0x8daa('0xd')](),controller[_0x8daa('0x14')]);module[_0x8daa('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index c4baae2..2de4cf0 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 _0x1748=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x247902,_0x26d9ca){var _0x4f8697=function(_0x4d2dec){while(--_0x4d2dec){_0x247902['push'](_0x247902['shift']());}};_0x4f8697(++_0x26d9ca);}(_0x1748,0x146));var _0x8174=function(_0xec9511,_0x2497a0){_0xec9511=_0xec9511-0x0;var _0x3e2b4e=_0x1748[_0xec9511];return _0x3e2b4e;};'use strict';var Sequelize=require(_0x8174('0x0'));module[_0x8174('0x1')]={'name':{'type':Sequelize[_0x8174('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8174('0x3'),_0x8174('0x4')),'defaultValue':_0x8174('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8174('0x5')]}}; \ No newline at end of file +var _0x2b33=['mouseOver','INTEGER','sequelize','exports','STRING','timeout'];(function(_0xbbe604,_0x38ab7b){var _0x16b8cf=function(_0x507564){while(--_0x507564){_0xbbe604['push'](_0xbbe604['shift']());}};_0x16b8cf(++_0x38ab7b);}(_0x2b33,0xfe));var _0x32b3=function(_0xc52898,_0x165722){_0xc52898=_0xc52898-0x0;var _0x1941d7=_0x2b33[_0xc52898];return _0x1941d7;};'use strict';var Sequelize=require(_0x32b3('0x0'));module[_0x32b3('0x1')]={'name':{'type':Sequelize[_0x32b3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x32b3('0x3')),'defaultValue':_0x32b3('0x4')},'selector':{'type':Sequelize[_0x32b3('0x2')]},'timeout':{'type':Sequelize[_0x32b3('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 95d33ec..f579af6 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 _0xa9e0=['keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','length','include','options','find','create','body','catch','params','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','show','model'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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={'raw':!![],'where':{'id':_0x526cf3['params']['id']}},_0x45a1e7={};_0x45a1e7[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x45a1e7[_0x0a9e('0x2a')]=_[_0x0a9e('0x27')](_0x526cf3[_0x0a9e('0x2a')]);_0x45a1e7[_0x0a9e('0x2b')]=_['intersection'](_0x45a1e7[_0x0a9e('0x26')],_0x45a1e7[_0x0a9e('0x2a')]);_0x479bc4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x45a1e7['model'],qs[_0x0a9e('0x2e')](_0x526cf3[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x479bc4[_0x0a9e('0x2c')]=_0x479bc4[_0x0a9e('0x2c')][_0x0a9e('0x2f')]?_0x479bc4[_0x0a9e('0x2c')]:_0x45a1e7[_0x0a9e('0x26')];if(_0x526cf3[_0x0a9e('0x2a')]['includeAll']){_0x479bc4[_0x0a9e('0x30')]=[{'all':!![]}];}_0x479bc4=_['merge']({},_0x479bc4,_0x526cf3[_0x0a9e('0x31')]);return db[_0x0a9e('0x28')][_0x0a9e('0x32')](_0x479bc4)[_0x0a9e('0x1f')](handleEntityNotFound(_0x384319,null))[_0x0a9e('0x1f')](respondWithResult(_0x384319,null))['catch'](handleError(_0x384319,null));};exports[_0x0a9e('0x33')]=function(_0x46f0a5,_0x40cb85){return db[_0x0a9e('0x28')][_0x0a9e('0x33')](_0x46f0a5[_0x0a9e('0x34')],{})[_0x0a9e('0x1f')](respondWithResult(_0x40cb85,0xc9))[_0x0a9e('0x35')](handleError(_0x40cb85,null));};exports['update']=function(_0x44295a,_0x5e7238){if(_0x44295a[_0x0a9e('0x34')]['id']){delete _0x44295a[_0x0a9e('0x34')]['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x44295a['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5e7238,null))[_0x0a9e('0x1f')](saveUpdates(_0x44295a[_0x0a9e('0x34')],null))[_0x0a9e('0x1f')](respondWithResult(_0x5e7238,null))['catch'](handleError(_0x5e7238,null));};exports['destroy']=function(_0x1e8694,_0x5640eb){return db[_0x0a9e('0x28')][_0x0a9e('0x32')]({'where':{'id':_0x1e8694[_0x0a9e('0x36')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5640eb,null))['then'](removeEntity(_0x5640eb,null))[_0x0a9e('0x35')](handleError(_0x5640eb,null));}; \ No newline at end of file +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(_0x42f313,_0x318de0){var _0x5b4e78=function(_0x4f28f6){while(--_0x4f28f6){_0x42f313['push'](_0x42f313['shift']());}};_0x5b4e78(++_0x318de0);}(_0x70e0,0x17b));var _0x070e=function(_0x5dc77f,_0x217e36){_0x5dc77f=_0x5dc77f-0x0;var _0x10b602=_0x70e0[_0x5dc77f];return _0x10b602;};'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 diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 9f1d86b..6d9d7b4 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 _0x4fc5=['chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','ChatProactiveAction'];(function(_0x56fb7d,_0x539ea1){var _0x3be1c3=function(_0x521d3f){while(--_0x521d3f){_0x56fb7d['push'](_0x56fb7d['shift']());}};_0x3be1c3(++_0x539ea1);}(_0x4fc5,0x123));var _0x54fc=function(_0x327e47,_0x1f69a3){_0x327e47=_0x327e47-0x0;var _0xd2b5cd=_0x4fc5[_0x327e47];return _0xd2b5cd;};'use strict';var _=require(_0x54fc('0x0'));var util=require(_0x54fc('0x1'));var logger=require(_0x54fc('0x2'))('api');var moment=require(_0x54fc('0x3'));var BPromise=require(_0x54fc('0x4'));var rp=require(_0x54fc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x54fc('0x6'));var config=require(_0x54fc('0x7'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x55336d,_0xf6b4ae){return _0x55336d['define'](_0x54fc('0x8'),attributes,{'tableName':_0x54fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd81c=['bluebird','rimraf','../../config/environment','exports','define','chat_proactive_actions','lodash','api','moment'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0xd81c,0xba));var _0xcd81=function(_0x236de3,_0x150c42){_0x236de3=_0x236de3-0x0;var _0x2a741a=_0xd81c[_0x236de3];return _0x2a741a;};'use strict';var _=require(_0xcd81('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcd81('0x1'));var moment=require(_0xcd81('0x2'));var BPromise=require(_0xcd81('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcd81('0x4'));var config=require(_0xcd81('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xcd81('0x6')]=function(_0x123159,_0x35f2a3){return _0x123159[_0xcd81('0x7')]('ChatProactiveAction',attributes,{'tableName':_0xcd81('0x8'),'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 609e76c..2d56bed 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 _0x1759=['catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x52f2e0,_0x17a399){var _0x3b5e74=function(_0x4671ee){while(--_0x4671ee){_0x52f2e0['push'](_0x52f2e0['shift']());}};_0x3b5e74(++_0x17a399);}(_0x1759,0x1ef));var _0x9175=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x1759[_0x478414];return _0x5eb6b9;};'use strict';var _=require('lodash');var util=require(_0x9175('0x0'));var moment=require(_0x9175('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9175('0x2'))['db'];var utils=require(_0x9175('0x3'));var logger=require(_0x9175('0x4'))(_0x9175('0x5'));var config=require('../../config/environment');var jayson=require(_0x9175('0x6'));var client=jayson['client'][_0x9175('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35af82,_0x2c7227,_0x18f086){return new BPromise(function(_0x2d6917,_0x29cb54){return client[_0x9175('0x8')](_0x35af82,_0x18f086)['then'](function(_0x344ebc){logger[_0x9175('0x9')](_0x9175('0xa'),_0x2c7227,_0x9175('0xb'));logger[_0x9175('0xc')](_0x9175('0xd'),_0x2c7227,_0x9175('0xb'),JSON[_0x9175('0xe')](_0x344ebc));if(_0x344ebc['error']){if(_0x344ebc[_0x9175('0xf')]['code']===0x1f4){logger[_0x9175('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2c7227,_0x344ebc[_0x9175('0xf')][_0x9175('0x10')]);return _0x29cb54(_0x344ebc[_0x9175('0xf')][_0x9175('0x10')]);}logger['error'](_0x9175('0xa'),_0x2c7227,_0x344ebc[_0x9175('0xf')]['message']);return _0x2d6917(_0x344ebc['error'][_0x9175('0x10')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2c7227,_0x9175('0xb'));_0x2d6917(_0x344ebc[_0x9175('0x11')][_0x9175('0x10')]);}})[_0x9175('0x12')](function(_0x28b717){logger[_0x9175('0xf')](_0x9175('0xa'),_0x2c7227,_0x28b717);_0x29cb54(_0x28b717);});});} \ No newline at end of file +var _0xa432=['client','request','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3a6144,_0xb18290){var _0xc8fad4=function(_0x3a19d2){while(--_0x3a19d2){_0x3a6144['push'](_0x3a6144['shift']());}};_0xc8fad4(++_0xb18290);}(_0xa432,0x125));var _0x2a43=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xa432[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x2a43('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2a43('0x1'));var fs=require('fs');var Redis=require(_0x2a43('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a43('0x3'));var logger=require(_0x2a43('0x4'))(_0x2a43('0x5'));var config=require(_0x2a43('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2a43('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d040,_0x176050,_0x180d56){return new BPromise(function(_0x564ed5,_0x2a1af1){return client[_0x2a43('0x8')](_0x48d040,_0x180d56)['then'](function(_0x1e672d){logger['info'](_0x2a43('0x9'),_0x176050,_0x2a43('0xa'));logger[_0x2a43('0xb')](_0x2a43('0xc'),_0x176050,'request\x20sent',JSON[_0x2a43('0xd')](_0x1e672d));if(_0x1e672d['error']){if(_0x1e672d[_0x2a43('0xe')][_0x2a43('0xf')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x176050,_0x1e672d[_0x2a43('0xe')]['message']);return _0x2a1af1(_0x1e672d[_0x2a43('0xe')]['message']);}logger[_0x2a43('0xe')](_0x2a43('0x9'),_0x176050,_0x1e672d[_0x2a43('0xe')]['message']);return _0x564ed5(_0x1e672d[_0x2a43('0xe')][_0x2a43('0x10')]);}else{logger[_0x2a43('0x11')](_0x2a43('0x9'),_0x176050,_0x2a43('0xa'));_0x564ed5(_0x1e672d[_0x2a43('0x12')][_0x2a43('0x10')]);}})[_0x2a43('0x13')](function(_0x35c939){logger[_0x2a43('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x176050,_0x35c939);_0x2a1af1(_0x35c939);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 731d002..f00f9ab 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 _0x1979=['destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update'];(function(_0x307f13,_0x27e474){var _0x28eab2=function(_0x427d1d){while(--_0x427d1d){_0x307f13['push'](_0x307f13['shift']());}};_0x28eab2(++_0x27e474);}(_0x1979,0x156));var _0x9197=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x1979[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require('multer');var util=require(_0x9197('0x0'));var path=require(_0x9197('0x1'));var timeout=require(_0x9197('0x2'));var express=require(_0x9197('0x3'));var router=express[_0x9197('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9197('0x5'));var config=require(_0x9197('0x6'));var controller=require(_0x9197('0x7'));router[_0x9197('0x8')](_0x9197('0x9'),auth[_0x9197('0xa')](),controller[_0x9197('0xb')]);router[_0x9197('0xc')]('/',auth[_0x9197('0xa')](),controller['create']);router[_0x9197('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9197('0xe')]);router['delete'](_0x9197('0x9'),auth[_0x9197('0xa')](),controller[_0x9197('0xf')]);module[_0x9197('0x10')]=router; \ No newline at end of file +var _0x4fb6=['exports','path','connect-timeout','express','Router','./chatProactiveAction.controller','isAuthenticated','show','post','create','put','update','/:id','destroy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4fb6,0x15f));var _0x64fb=function(_0x4169d8,_0x3d7cd4){_0x4169d8=_0x4169d8-0x0;var _0x32084a=_0x4fb6[_0x4169d8];return _0x32084a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x64fb('0x0'));var timeout=require(_0x64fb('0x1'));var express=require(_0x64fb('0x2'));var router=express[_0x64fb('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x64fb('0x4'));router['get']('/:id',auth[_0x64fb('0x5')](),controller[_0x64fb('0x6')]);router[_0x64fb('0x7')]('/',auth[_0x64fb('0x5')](),controller[_0x64fb('0x8')]);router[_0x64fb('0x9')]('/:id',auth[_0x64fb('0x5')](),controller[_0x64fb('0xa')]);router['delete'](_0x64fb('0xb'),auth['isAuthenticated'](),controller[_0x64fb('0xc')]);module[_0x64fb('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index ae25c30..9c123aa 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 _0x24ac=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x168358,_0x3f253e){var _0x52c54c=function(_0x433d4a){while(--_0x433d4a){_0x168358['push'](_0x168358['shift']());}};_0x52c54c(++_0x3f253e);}(_0x24ac,0x1a8));var _0xc24a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x24ac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc24a('0x0'));module[_0xc24a('0x1')]={'name':{'type':Sequelize[_0xc24a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc24a('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc24a('0x3')](_0xc24a('0x4'),_0xc24a('0x5'),_0xc24a('0x6'))}}; \ No newline at end of file +var _0xf934=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x192b50,_0x523f5b){var _0x3054fb=function(_0x42aef2){while(--_0x42aef2){_0x192b50['push'](_0x192b50['shift']());}};_0x3054fb(++_0x523f5b);}(_0xf934,0xca));var _0x4f93=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xf934[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require(_0x4f93('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4f93('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4f93('0x2')]},'timeout':{'type':Sequelize[_0x4f93('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4f93('0x4')]('rrmemory',_0x4f93('0x5'),_0x4f93('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 624d3cb..3f0bd5e 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 _0xd5d3=['save','ChatQueues','UserProfileResource','destroy','stack','name','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','where','VIRTUAL','filter','merge','include','findAll','rows','catch','params','rawAttributes','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','order','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','length','addTeams','ids','Agents','online','interface','flatMap','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x520cac,_0x12824c){var _0x5f1a80=function(_0x54c36f){while(--_0x54c36f){_0x520cac['push'](_0x520cac['shift']());}};_0x5f1a80(++_0x12824c);}(_0xd5d3,0x1a5));var _0x3d5d=function(_0x3ce2e2,_0x5333f4){_0x3ce2e2=_0x3ce2e2-0x0;var _0x1a6338=_0xd5d3[_0x3ce2e2];return _0x1a6338;};'use strict';var pdf=require(_0x3d5d('0x0'));var emlformat=require(_0x3d5d('0x1'));var rimraf=require(_0x3d5d('0x2'));var zipdir=require(_0x3d5d('0x3'));var jsonpatch=require(_0x3d5d('0x4'));var rp=require(_0x3d5d('0x5'));var moment=require('moment');var BPromise=require(_0x3d5d('0x6'));var Mustache=require(_0x3d5d('0x7'));var util=require(_0x3d5d('0x8'));var path=require(_0x3d5d('0x9'));var sox=require(_0x3d5d('0xa'));var csv=require(_0x3d5d('0xb'));var ejs=require(_0x3d5d('0xc'));var fs=require('fs');var _=require(_0x3d5d('0xd'));var squel=require(_0x3d5d('0xe'));var crypto=require(_0x3d5d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3d5d('0x10'));var toCsv=require(_0x3d5d('0xb'));var querystring=require(_0x3d5d('0x11'));var Papa=require(_0x3d5d('0x12'));var Redis=require(_0x3d5d('0x13'));var authService=require(_0x3d5d('0x14'));var qs=require(_0x3d5d('0x15'));var as=require(_0x3d5d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d5d('0x17'))(_0x3d5d('0x18'));var utils=require(_0x3d5d('0x19'));var config=require(_0x3d5d('0x1a'));var db=require('../../mysqldb')['db'];config[_0x3d5d('0x1b')]=_[_0x3d5d('0x1c')](config[_0x3d5d('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d5d('0x1d'))(new Redis(config[_0x3d5d('0x1b')]));require(_0x3d5d('0x1e'))[_0x3d5d('0x1f')](socket);var jayson=require(_0x3d5d('0x20'));var client=jayson[_0x3d5d('0x21')][_0x3d5d('0x22')]({'port':0x232a});function checkPasswordPattern(_0x592d4a,_0x1a551b,_0x2e3c90){if(_0x2e3c90){var _0x25e4e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25e4e8[_0x3d5d('0x23')](_0x1a551b)){return _0x592d4a;}else{throw new db[(_0x3d5d('0x24'))][(_0x3d5d('0x25'))](_0x3d5d('0x26'));}}else{return _0x592d4a;}}function respondWithRpcPromise(_0x38fea6,_0x2e1333,_0x34d58d,_0x39db8c){return new BPromise(function(_0x445ba8,_0x1b2f51){var _0x5b05bb=_0x39db8c||client;return _0x5b05bb[_0x3d5d('0x27')](_0x38fea6,_0x34d58d)[_0x3d5d('0x28')](function(_0xd7edd4){logger[_0x3d5d('0x29')]('ChatQueue,\x20%s,\x20%s',_0x2e1333,_0x3d5d('0x2a'));logger['debug'](_0x3d5d('0x2b'),_0x2e1333,_0x3d5d('0x2a'),JSON['stringify'](_0xd7edd4));if(_0xd7edd4[_0x3d5d('0x2c')]){if(_0xd7edd4[_0x3d5d('0x2c')][_0x3d5d('0x2d')]===0x1f4){logger['error'](_0x3d5d('0x2e'),_0x2e1333,_0xd7edd4[_0x3d5d('0x2c')][_0x3d5d('0x2f')]);return _0x1b2f51(_0xd7edd4[_0x3d5d('0x2c')][_0x3d5d('0x2f')]);}logger[_0x3d5d('0x2c')](_0x3d5d('0x2e'),_0x2e1333,_0xd7edd4[_0x3d5d('0x2c')][_0x3d5d('0x2f')]);return _0x445ba8(_0xd7edd4[_0x3d5d('0x2c')]['message']);}else{logger['info'](_0x3d5d('0x2e'),_0x2e1333,'request\x20sent');_0x445ba8(_0xd7edd4[_0x3d5d('0x30')][_0x3d5d('0x2f')]);}})['catch'](function(_0x5c3c45){logger[_0x3d5d('0x2c')](_0x3d5d('0x2e'),_0x2e1333,_0x5c3c45);_0x1b2f51(_0x5c3c45);});});}function respondWithStatusCode(_0x47a9c1,_0x4eae81){_0x4eae81=_0x4eae81||0xcc;return function(_0x443356){if(_0x443356){return _0x47a9c1[_0x3d5d('0x31')](_0x4eae81);}return _0x47a9c1['status'](_0x4eae81)[_0x3d5d('0x32')]();};}function respondWithResult(_0x4b038e,_0x406184){_0x406184=_0x406184||0xc8;return function(_0x47e6ea){if(_0x47e6ea){return _0x4b038e[_0x3d5d('0x33')](_0x406184)[_0x3d5d('0x34')](_0x47e6ea);}};}function respondWithFilteredResult(_0x221270,_0x3ecfe1){return function(_0x15bdf3){if(_0x15bdf3){var _0x5d30b9=_0x15bdf3[_0x3d5d('0x35')],_0x56875a=_0x3ecfe1[_0x3d5d('0x36')],_0x2692de=_0x3ecfe1[_0x3d5d('0x36')]+_0x3ecfe1[_0x3d5d('0x37')],_0x4ff9a6;if(_0x2692de>=_0x5d30b9){_0x2692de=_0x5d30b9;_0x4ff9a6=0xc8;}else{_0x4ff9a6=0xce;}_0x221270[_0x3d5d('0x33')](_0x4ff9a6);return _0x221270[_0x3d5d('0x38')](_0x3d5d('0x39'),_0x56875a+'-'+_0x2692de+'/'+_0x5d30b9)['json'](_0x15bdf3);}return null;};}function patchUpdates(_0x1a3854){return function(_0x511009){try{jsonpatch[_0x3d5d('0x3a')](_0x511009,_0x1a3854,!![]);}catch(_0x53fa23){return BPromise['reject'](_0x53fa23);}return _0x511009[_0x3d5d('0x3b')]();};}function saveUpdates(_0x34b2a1,_0x468120){return function(_0x4a55dc){if(_0x4a55dc){return _0x4a55dc['update'](_0x34b2a1)[_0x3d5d('0x28')](function(_0x18cc64){return _0x18cc64;});}return null;};}function removeEntity(_0x1dd00f,_0x1dc66a){return function(_0x5d4eaf){if(_0x5d4eaf){return _0x5d4eaf['destroy']()[_0x3d5d('0x28')](function(){var _0x4dbb2b=_0x5d4eaf['get']({'plain':!![]});var _0x51e21e=_0x3d5d('0x3c');return db[_0x3d5d('0x3d')][_0x3d5d('0x3e')]({'where':{'type':_0x51e21e,'resourceId':_0x4dbb2b['id']}})[_0x3d5d('0x28')](function(){return _0x5d4eaf;});})[_0x3d5d('0x28')](function(){_0x1dd00f[_0x3d5d('0x33')](0xcc)[_0x3d5d('0x32')]();});}};}function handleEntityNotFound(_0x49d841,_0x1e7bdf){return function(_0x67f9d6){if(!_0x67f9d6){_0x49d841[_0x3d5d('0x31')](0x194);}return _0x67f9d6;};}function handleError(_0x29c277,_0x55818c){_0x55818c=_0x55818c||0x1f4;return function(_0x59ce71){logger['error'](_0x59ce71[_0x3d5d('0x3f')]);if(_0x59ce71[_0x3d5d('0x40')]){delete _0x59ce71[_0x3d5d('0x40')];}_0x29c277[_0x3d5d('0x33')](_0x55818c)['send'](_0x59ce71);};}exports[_0x3d5d('0x41')]=function(_0x500612,_0x334a32){var _0x4b1016={},_0x3fcd7b={},_0x148273={'count':0x0,'rows':[]};var _0x1ca06d=_[_0x3d5d('0x42')](db[_0x3d5d('0x43')]['rawAttributes'],function(_0x4aa223){return{'name':_0x4aa223[_0x3d5d('0x44')],'type':_0x4aa223[_0x3d5d('0x45')][_0x3d5d('0x46')]};});_0x3fcd7b[_0x3d5d('0x47')]=_[_0x3d5d('0x42')](_0x1ca06d,_0x3d5d('0x40'));_0x3fcd7b[_0x3d5d('0x48')]=_[_0x3d5d('0x49')](_0x500612['query']);_0x3fcd7b[_0x3d5d('0x4a')]=_[_0x3d5d('0x4b')](_0x3fcd7b[_0x3d5d('0x47')],_0x3fcd7b['query']);_0x4b1016['attributes']=_[_0x3d5d('0x4b')](_0x3fcd7b[_0x3d5d('0x47')],qs[_0x3d5d('0x4c')](_0x500612[_0x3d5d('0x48')][_0x3d5d('0x4c')]));_0x4b1016[_0x3d5d('0x4d')]=_0x4b1016[_0x3d5d('0x4d')]['length']?_0x4b1016[_0x3d5d('0x4d')]:_0x3fcd7b[_0x3d5d('0x47')];if(!_0x500612[_0x3d5d('0x48')][_0x3d5d('0x4e')](_0x3d5d('0x4f'))){_0x4b1016['limit']=qs[_0x3d5d('0x37')](_0x500612['query']['limit']);_0x4b1016[_0x3d5d('0x36')]=qs['offset'](_0x500612[_0x3d5d('0x48')][_0x3d5d('0x36')]);}_0x4b1016['order']=qs[_0x3d5d('0x50')](_0x500612[_0x3d5d('0x48')]['sort']);_0x4b1016['where']=qs[_0x3d5d('0x4a')](_[_0x3d5d('0x51')](_0x500612[_0x3d5d('0x48')],_0x3fcd7b[_0x3d5d('0x4a')]),_0x1ca06d);if(_0x500612['query']['filter']){_0x4b1016[_0x3d5d('0x52')]=_['merge'](_0x4b1016[_0x3d5d('0x52')],{'$or':_[_0x3d5d('0x42')](_0x1ca06d,function(_0x3f2c8c){if(_0x3f2c8c['type']!==_0x3d5d('0x53')){var _0x3daf35={};_0x3daf35[_0x3f2c8c[_0x3d5d('0x40')]]={'$like':'%'+_0x500612['query'][_0x3d5d('0x54')]+'%'};return _0x3daf35;}})});}_0x4b1016=_[_0x3d5d('0x55')]({},_0x4b1016,_0x500612['options']);var _0xda8ae7={'where':_0x4b1016[_0x3d5d('0x52')]};return db[_0x3d5d('0x43')][_0x3d5d('0x35')](_0xda8ae7)[_0x3d5d('0x28')](function(_0x317eff){_0x148273['count']=_0x317eff;if(_0x500612[_0x3d5d('0x48')]['includeAll']){_0x4b1016[_0x3d5d('0x56')]=[{'all':!![]}];}return db[_0x3d5d('0x43')][_0x3d5d('0x57')](_0x4b1016);})[_0x3d5d('0x28')](function(_0x4adabe){_0x148273[_0x3d5d('0x58')]=_0x4adabe;return _0x148273;})[_0x3d5d('0x28')](respondWithFilteredResult(_0x334a32,_0x4b1016))[_0x3d5d('0x59')](handleError(_0x334a32,null));};exports['show']=function(_0xe5d012,_0x40834a){var _0x5e02d8={'raw':!![],'where':{'id':_0xe5d012[_0x3d5d('0x5a')]['id']}},_0x1331fd={};_0x1331fd[_0x3d5d('0x47')]=_[_0x3d5d('0x49')](db['ChatQueue'][_0x3d5d('0x5b')]);_0x1331fd['query']=_[_0x3d5d('0x49')](_0xe5d012[_0x3d5d('0x48')]);_0x1331fd[_0x3d5d('0x4a')]=_[_0x3d5d('0x4b')](_0x1331fd[_0x3d5d('0x47')],_0x1331fd[_0x3d5d('0x48')]);_0x5e02d8[_0x3d5d('0x4d')]=_['intersection'](_0x1331fd[_0x3d5d('0x47')],qs[_0x3d5d('0x4c')](_0xe5d012[_0x3d5d('0x48')][_0x3d5d('0x4c')]));_0x5e02d8[_0x3d5d('0x4d')]=_0x5e02d8[_0x3d5d('0x4d')]['length']?_0x5e02d8[_0x3d5d('0x4d')]:_0x1331fd[_0x3d5d('0x47')];if(_0xe5d012['query']['includeAll']){_0x5e02d8['include']=[{'all':!![]}];}_0x5e02d8=_[_0x3d5d('0x55')]({},_0x5e02d8,_0xe5d012[_0x3d5d('0x5c')]);return db[_0x3d5d('0x43')][_0x3d5d('0x5d')](_0x5e02d8)[_0x3d5d('0x28')](handleEntityNotFound(_0x40834a,null))[_0x3d5d('0x28')](respondWithResult(_0x40834a,null))['catch'](handleError(_0x40834a,null));};exports[_0x3d5d('0x5e')]=function(_0x5dd6eb,_0x89d5a4){return db[_0x3d5d('0x43')][_0x3d5d('0x5e')](_0x5dd6eb['body'],{})['then'](function(_0x499ecc){var _0x63c8b3=_0x5dd6eb['user'][_0x3d5d('0x5f')]({'plain':!![]});if(!_0x63c8b3)throw new Error(_0x3d5d('0x60'));if(_0x63c8b3[_0x3d5d('0x61')]===_0x3d5d('0x62')){var _0x32a2eb=_0x499ecc[_0x3d5d('0x5f')]({'plain':!![]});var _0x3a1ba0=_0x3d5d('0x3c');return db[_0x3d5d('0x63')][_0x3d5d('0x5d')]({'where':{'name':_0x3a1ba0,'userProfileId':_0x63c8b3[_0x3d5d('0x64')]},'raw':!![]})['then'](function(_0x956103){if(_0x956103&&_0x956103[_0x3d5d('0x65')]===0x0){return db[_0x3d5d('0x3d')]['create']({'name':_0x32a2eb['name'],'resourceId':_0x32a2eb['id'],'type':_0x956103[_0x3d5d('0x40')],'sectionId':_0x956103['id']},{})[_0x3d5d('0x28')](function(){return _0x499ecc;});}else{return _0x499ecc;}})[_0x3d5d('0x59')](function(_0x2a912d){logger['error'](_0x3d5d('0x66'),_0x2a912d);throw _0x2a912d;});}return _0x499ecc;})['then'](respondWithResult(_0x89d5a4,0xc9))['catch'](handleError(_0x89d5a4,null));};exports['update']=function(_0x38bfff,_0x59be36){if(_0x38bfff[_0x3d5d('0x67')]['id']){delete _0x38bfff[_0x3d5d('0x67')]['id'];}return db[_0x3d5d('0x43')][_0x3d5d('0x5d')]({'where':{'id':_0x38bfff['params']['id']}})[_0x3d5d('0x28')](handleEntityNotFound(_0x59be36,null))[_0x3d5d('0x28')](saveUpdates(_0x38bfff[_0x3d5d('0x67')],null))['then'](respondWithResult(_0x59be36,null))[_0x3d5d('0x59')](handleError(_0x59be36,null));};exports['destroy']=function(_0x587d72,_0x3f2d45){return db[_0x3d5d('0x43')][_0x3d5d('0x5d')]({'where':{'id':_0x587d72['params']['id']}})[_0x3d5d('0x28')](handleEntityNotFound(_0x3f2d45,null))['then'](removeEntity(_0x3f2d45,null))[_0x3d5d('0x59')](handleError(_0x3f2d45,null));};exports['describe']=function(_0xd9591c,_0x27de46){return db['ChatQueue']['describe']()[_0x3d5d('0x28')](respondWithResult(_0x27de46,null))[_0x3d5d('0x59')](handleError(_0x27de46,null));};exports['getMembers']=function(_0x238e95,_0x12c7d9,_0x449512){var _0x598ca1={'raw':!![],'where':{}},_0x4cb32f={},_0x1327ba;return db[_0x3d5d('0x43')][_0x3d5d('0x68')]({'where':{'id':_0x238e95[_0x3d5d('0x5a')]['id']}})[_0x3d5d('0x28')](handleEntityNotFound(_0x12c7d9,null))[_0x3d5d('0x28')](function(_0x1ba457){if(_0x1ba457){_0x1327ba=_0x1ba457[_0x3d5d('0x5f')]({'plain':!![]});_0x4cb32f[_0x3d5d('0x47')]=_['keys'](db['UserChatQueue'][_0x3d5d('0x5b')]);_0x4cb32f[_0x3d5d('0x48')]=_[_0x3d5d('0x49')](_0x238e95['query']);_0x4cb32f[_0x3d5d('0x4a')]=_[_0x3d5d('0x4b')](_0x4cb32f[_0x3d5d('0x47')],_0x4cb32f['query']);_0x598ca1[_0x3d5d('0x4d')]=_[_0x3d5d('0x4b')](_0x4cb32f[_0x3d5d('0x47')],qs[_0x3d5d('0x4c')](_0x238e95[_0x3d5d('0x48')][_0x3d5d('0x4c')]));_0x598ca1['attributes']=_0x598ca1[_0x3d5d('0x4d')]['length']?_0x598ca1[_0x3d5d('0x4d')]:_0x4cb32f[_0x3d5d('0x47')];if(!_0x238e95[_0x3d5d('0x48')][_0x3d5d('0x4e')](_0x3d5d('0x4f'))){_0x598ca1['limit']=qs['limit'](_0x238e95[_0x3d5d('0x48')][_0x3d5d('0x37')]);_0x598ca1[_0x3d5d('0x36')]=qs[_0x3d5d('0x36')](_0x238e95['query'][_0x3d5d('0x36')]);}_0x598ca1[_0x3d5d('0x69')]=qs[_0x3d5d('0x50')](_0x238e95[_0x3d5d('0x48')][_0x3d5d('0x50')]);_0x598ca1[_0x3d5d('0x52')]=qs[_0x3d5d('0x4a')](_[_0x3d5d('0x51')](_0x238e95[_0x3d5d('0x48')],_0x4cb32f[_0x3d5d('0x4a')]));_0x598ca1[_0x3d5d('0x52')][_0x3d5d('0x6a')]=_0x1ba457['id'];if(_0x238e95[_0x3d5d('0x48')][_0x3d5d('0x54')]){_0x598ca1[_0x3d5d('0x52')]=_[_0x3d5d('0x55')](_0x598ca1[_0x3d5d('0x52')],{'$or':_[_0x3d5d('0x42')](_0x598ca1['attributes'],function(_0x1ae7b2){var _0x4a925b={};_0x4a925b[_0x1ae7b2]={'$like':'%'+_0x238e95[_0x3d5d('0x48')]['filter']+'%'};return _0x4a925b;})});}_0x598ca1=_['merge']({},_0x598ca1,_0x238e95[_0x3d5d('0x5c')]);return db[_0x3d5d('0x6b')][_0x3d5d('0x57')](_0x598ca1);}})[_0x3d5d('0x28')](function(_0x4382ad){if(_0x4382ad){return db[_0x3d5d('0x6c')][_0x3d5d('0x6d')]({'where':{'id':_[_0x3d5d('0x42')](_0x4382ad,_0x3d5d('0x6e')),'role':_0x3d5d('0x6f')},'attributes':['id',_0x3d5d('0x40'),_0x3d5d('0x70'),_0x3d5d('0x71'),_0x3d5d('0x72')]});}})[_0x3d5d('0x28')](function(_0x21f72e){if(_0x21f72e){return{'count':_0x21f72e[_0x3d5d('0x35')],'rows':_[_0x3d5d('0x42')](_0x21f72e['rows'],function(_0x29e1f8){return{'membername':_0x29e1f8[_0x3d5d('0x40')],'UserId':_0x29e1f8['id'],'queue_name':_0x1327ba[_0x3d5d('0x40')],'ChatQueueId':_0x1327ba['id'],'interface':util[_0x3d5d('0x73')](_0x3d5d('0x74'),_0x3d5d('0x75'),_0x29e1f8['name']),'penalty':0x0,'paused':_0x29e1f8[_0x3d5d('0x70')],'createdAt':_0x29e1f8[_0x3d5d('0x72')],'updatedAt':_0x29e1f8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3d5d('0x28')](respondWithFilteredResult(_0x12c7d9,_0x598ca1))[_0x3d5d('0x59')](handleError(_0x12c7d9,null));};exports[_0x3d5d('0x76')]=function(_0x564b85,_0xd49817,_0x1e71fe){var _0x3209ea={};var _0x3f333e={};var _0x4e3607;var _0x353539;return db['ChatQueue'][_0x3d5d('0x68')]({'where':{'id':_0x564b85[_0x3d5d('0x5a')]['id']}})['then'](handleEntityNotFound(_0xd49817,null))[_0x3d5d('0x28')](function(_0x32888f){if(_0x32888f){_0x4e3607=_0x32888f;_0x3f333e[_0x3d5d('0x47')]=_['keys'](db[_0x3d5d('0x77')][_0x3d5d('0x5b')]);_0x3f333e[_0x3d5d('0x48')]=_[_0x3d5d('0x49')](_0x564b85[_0x3d5d('0x48')]);_0x3f333e[_0x3d5d('0x4a')]=_[_0x3d5d('0x4b')](_0x3f333e[_0x3d5d('0x47')],_0x3f333e[_0x3d5d('0x48')]);_0x3209ea[_0x3d5d('0x4d')]=_[_0x3d5d('0x4b')](_0x3f333e[_0x3d5d('0x47')],qs[_0x3d5d('0x4c')](_0x564b85['query'][_0x3d5d('0x4c')]));_0x3209ea[_0x3d5d('0x4d')]=_0x3209ea['attributes'][_0x3d5d('0x78')]?_0x3209ea[_0x3d5d('0x4d')]:_0x3f333e['model'];_0x3209ea[_0x3d5d('0x69')]=qs[_0x3d5d('0x50')](_0x564b85[_0x3d5d('0x48')][_0x3d5d('0x50')]);_0x3209ea[_0x3d5d('0x52')]=qs[_0x3d5d('0x4a')](_[_0x3d5d('0x51')](_0x564b85[_0x3d5d('0x48')],_0x3f333e['filters']));if(_0x564b85[_0x3d5d('0x48')][_0x3d5d('0x54')]){_0x3209ea[_0x3d5d('0x52')]=_['merge'](_0x3209ea[_0x3d5d('0x52')],{'$or':_[_0x3d5d('0x42')](_0x3209ea[_0x3d5d('0x4d')],function(_0x525ba4){var _0x36e74b={};_0x36e74b[_0x525ba4]={'$like':'%'+_0x564b85[_0x3d5d('0x48')][_0x3d5d('0x54')]+'%'};return _0x36e74b;})});}_0x3209ea=_[_0x3d5d('0x55')]({},_0x3209ea,_0x564b85[_0x3d5d('0x5c')]);return _0x4e3607[_0x3d5d('0x76')](_0x3209ea);}})[_0x3d5d('0x28')](function(_0x1359d0){if(_0x1359d0){_0x353539=_0x1359d0[_0x3d5d('0x78')];if(!_0x564b85['query'][_0x3d5d('0x4e')](_0x3d5d('0x4f'))){_0x3209ea[_0x3d5d('0x37')]=qs['limit'](_0x564b85[_0x3d5d('0x48')][_0x3d5d('0x37')]);_0x3209ea[_0x3d5d('0x36')]=qs['offset'](_0x564b85[_0x3d5d('0x48')][_0x3d5d('0x36')]);}return _0x4e3607[_0x3d5d('0x76')](_0x3209ea);}})[_0x3d5d('0x28')](function(_0x2de06f){if(_0x2de06f){return _0x2de06f?{'count':_0x353539,'rows':_0x2de06f}:null;}})[_0x3d5d('0x28')](respondWithResult(_0xd49817,null))[_0x3d5d('0x59')](handleError(_0xd49817,null));};exports[_0x3d5d('0x79')]=function(_0x1b6ec5,_0x2c5814,_0x3432a2){var _0x3173b1=_0x1b6ec5['body'][_0x3d5d('0x7a')];return db[_0x3d5d('0x77')][_0x3d5d('0x57')]({'where':{'id':_0x3173b1},'attributes':['id'],'include':[{'model':db[_0x3d5d('0x6c')],'as':_0x3d5d('0x7b'),'attributes':['id','name',_0x3d5d('0x7c'),'voicePause',_0x3d5d('0x7d')],'raw':!![]}]})[_0x3d5d('0x28')](function(_0x2fe370){if(_0x2fe370){var _0x3e8e79=_[_0x3d5d('0x7e')](_0x2fe370,function(_0x57e8d1){var _0x15b064=_0x57e8d1['get']({'plain':!![]});return _0x15b064[_0x3d5d('0x7b')];});return db['ChatQueue'][_0x3d5d('0x5d')]({'where':{'id':_0x1b6ec5[_0x3d5d('0x5a')]['id']}})[_0x3d5d('0x28')](function(_0x47c4be){return db['sequelize']['transaction'](function(_0x230541){return _0x47c4be[_0x3d5d('0x79')](_0x3173b1,{'transaction':_0x230541})[_0x3d5d('0x28')](function(){return BPromise['each'](_0x3e8e79,function(_0x512315){return db[_0x3d5d('0x6b')][_0x3d5d('0x7f')]({'where':{'UserId':_0x512315['id'],'ChatQueueId':_0x1b6ec5[_0x3d5d('0x5a')]['id']},'transaction':_0x230541});});})['then'](function(){_0x3e8e79[_0x3d5d('0x80')](function(_0x5d960d){socket[_0x3d5d('0x81')]('userChatQueue:save',{'UserId':_0x5d960d['id'],'ChatQueueId':_0x47c4be['id']});});});});});}})[_0x3d5d('0x28')](respondWithStatusCode(_0x2c5814,null))[_0x3d5d('0x59')](handleError(_0x2c5814,null));};exports[_0x3d5d('0x82')]=function(_0x4db355,_0x3bb6e8,_0xe4534d){return db[_0x3d5d('0x77')]['findAll']({'where':{'id':_0x4db355[_0x3d5d('0x48')][_0x3d5d('0x7a')]},'attributes':['id'],'include':[{'model':db[_0x3d5d('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3bb6e8,null))[_0x3d5d('0x28')](function(_0x48a897){var _0xc08e17=_[_0x3d5d('0x42')](_0x48a897,'id');var _0x32dd70=[];var _0x1a281f=[];var _0x2cd2af=squel[_0x3d5d('0x83')]();_0x2cd2af[_0x3d5d('0x84')](_0x3d5d('0x85'))[_0x3d5d('0x86')](_0x3d5d('0x87'),'tq')[_0x3d5d('0x88')](_0x3d5d('0x89'),'ut',_0x3d5d('0x8a'))[_0x3d5d('0x52')]('ChatQueueId\x20=\x20?',_0x4db355[_0x3d5d('0x5a')]['id']);for(var _0x10886e=0x0;_0x10886e<_0x48a897[_0x3d5d('0x78')];_0x10886e+=0x1){let _0x9730c4=_0x48a897[_0x10886e];for(var _0x45620c=0x0;_0x45620c<_0x9730c4['Agents'][_0x3d5d('0x78')];_0x45620c+=0x1){let _0x122371=_0x9730c4[_0x3d5d('0x7b')][_0x45620c];var _0x348ed2=_0x2cd2af[_0x3d5d('0x8b')]();_0x348ed2['where']('ut.UserId\x20=\x20?',_0x122371['id']);_0x1a281f[_0x3d5d('0x8c')](db[_0x3d5d('0x8d')][_0x3d5d('0x48')](_0x348ed2[_0x3d5d('0x8e')](),{'type':db[_0x3d5d('0x8d')][_0x3d5d('0x8f')]['SELECT']})[_0x3d5d('0x28')](function(_0x4406c5){if(_0x4406c5['length']===0x1){return _0x122371['id'];}else{var _0x2ba961=_[_0x3d5d('0x90')](_[_0x3d5d('0x42')](_0x4406c5,_0x3d5d('0x91')),function(_0x49f1c1){return _[_0x3d5d('0x92')](_0xc08e17,_0x49f1c1);});if(_0x2ba961){return _0x122371['id'];}}}));}}return BPromise[_0x3d5d('0x93')](_0x1a281f)[_0x3d5d('0x28')](function(_0x43b947){_0x32dd70=_(_0x32dd70)[_0x3d5d('0x94')](_0x43b947)['compact']()[_0x3d5d('0x95')]();return db['ChatQueue']['find']({'where':{'id':_0x4db355['params']['id']}})['then'](function(_0x14da90){return db[_0x3d5d('0x8d')][_0x3d5d('0x96')](function(_0x1a9882){return _0x14da90[_0x3d5d('0x82')](_0x4db355[_0x3d5d('0x48')][_0x3d5d('0x7a')],{'transaction':_0x1a9882})[_0x3d5d('0x28')](function(){if(!_[_0x3d5d('0x97')](_0x32dd70)){return _0x14da90['removeAgents'](_0x32dd70,{'transaction':_0x1a9882});}})[_0x3d5d('0x28')](function(){_0x32dd70[_0x3d5d('0x80')](function(_0x182b8f){socket['emit'](_0x3d5d('0x98'),{'UserId':_0x182b8f,'ChatQueueId':_0x14da90['id']});});});});});});})[_0x3d5d('0x28')](respondWithStatusCode(_0x3bb6e8,null))[_0x3d5d('0x59')](handleError(_0x3bb6e8,null));};exports[_0x3d5d('0x99')]=function(_0x4c36b2,_0xd9a553,_0x13901e){return db['ChatQueue'][_0x3d5d('0x5d')]({'where':{'id':_0x4c36b2['params']['id']}})[_0x3d5d('0x28')](handleEntityNotFound(_0xd9a553,null))['then'](function(_0x40e664){if(_0x40e664){return _0x40e664[_0x3d5d('0x99')](_0x4c36b2[_0x3d5d('0x67')][_0x3d5d('0x7a')],_[_0x3d5d('0x9a')](_0x4c36b2[_0x3d5d('0x67')],['ids','id'])||{})[_0x3d5d('0x9b')](function(_0x272082){for(var _0x55a61c=0x0;_0x55a61c<_0x4c36b2[_0x3d5d('0x67')][_0x3d5d('0x7a')][_0x3d5d('0x78')];_0x55a61c+=0x1){socket[_0x3d5d('0x81')](_0x3d5d('0x9c'),{'UserId':_0x4c36b2[_0x3d5d('0x67')][_0x3d5d('0x7a')][_0x55a61c],'ChatQueueId':_0x4c36b2[_0x3d5d('0x5a')]['id']});}return _0x272082;});}})[_0x3d5d('0x28')](respondWithResult(_0xd9a553,null))[_0x3d5d('0x59')](handleError(_0xd9a553,null));};exports[_0x3d5d('0x9d')]=function(_0x154ba0,_0x29109b,_0x1bb7e3){return db['ChatQueue'][_0x3d5d('0x5d')]({'where':{'id':_0x154ba0[_0x3d5d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x29109b,null))[_0x3d5d('0x28')](function(_0x5e3b36){if(_0x5e3b36){return _0x5e3b36[_0x3d5d('0x9d')](_0x154ba0[_0x3d5d('0x48')]['ids'])[_0x3d5d('0x28')](function(){if(_[_0x3d5d('0x9e')](_0x154ba0[_0x3d5d('0x48')][_0x3d5d('0x7a')])){for(var _0x1a453f=0x0;_0x1a453f<_0x154ba0[_0x3d5d('0x48')][_0x3d5d('0x7a')][_0x3d5d('0x78')];_0x1a453f+=0x1){socket[_0x3d5d('0x81')](_0x3d5d('0x98'),{'UserId':Number(_0x154ba0[_0x3d5d('0x48')][_0x3d5d('0x7a')][_0x1a453f]),'ChatQueueId':Number(_0x154ba0[_0x3d5d('0x5a')]['id'])});}}else{socket[_0x3d5d('0x81')]('userChatQueue:remove',{'UserId':Number(_0x154ba0[_0x3d5d('0x48')][_0x3d5d('0x7a')]),'ChatQueueId':Number(_0x154ba0['params']['id'])});}});}})[_0x3d5d('0x28')](respondWithStatusCode(_0x29109b,null))[_0x3d5d('0x59')](handleError(_0x29109b,null));};exports[_0x3d5d('0x9f')]=function(_0x11c2ab,_0x5253a2,_0x2713d0){var _0xd52145={};var _0x19ef87={};var _0x54bea3;var _0x17b661;return db[_0x3d5d('0x43')][_0x3d5d('0x68')]({'where':{'id':_0x11c2ab[_0x3d5d('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5253a2,null))[_0x3d5d('0x28')](function(_0x4a4b8c){if(_0x4a4b8c){_0x54bea3=_0x4a4b8c;_0x19ef87[_0x3d5d('0x47')]=_[_0x3d5d('0x49')](db[_0x3d5d('0x6c')]['rawAttributes']);_0x19ef87['query']=_[_0x3d5d('0x49')](_0x11c2ab[_0x3d5d('0x48')]);_0x19ef87['filters']=_[_0x3d5d('0x4b')](_0x19ef87[_0x3d5d('0x47')],_0x19ef87[_0x3d5d('0x48')]);_0xd52145[_0x3d5d('0x4d')]=_[_0x3d5d('0x4b')](_0x19ef87[_0x3d5d('0x47')],qs[_0x3d5d('0x4c')](_0x11c2ab[_0x3d5d('0x48')]['fields']));_0xd52145['attributes']=_0xd52145[_0x3d5d('0x4d')]['length']?_0xd52145['attributes']:_0x19ef87[_0x3d5d('0x47')];_0xd52145['order']=qs[_0x3d5d('0x50')](_0x11c2ab['query'][_0x3d5d('0x50')]);_0xd52145[_0x3d5d('0x52')]=qs[_0x3d5d('0x4a')](_[_0x3d5d('0x51')](_0x11c2ab[_0x3d5d('0x48')],_0x19ef87[_0x3d5d('0x4a')]));if(_0x11c2ab['query']['filter']){_0xd52145[_0x3d5d('0x52')]=_[_0x3d5d('0x55')](_0xd52145[_0x3d5d('0x52')],{'$or':_[_0x3d5d('0x42')](_0xd52145['attributes'],function(_0x557685){var _0x41b309={};_0x41b309[_0x557685]={'$like':'%'+_0x11c2ab[_0x3d5d('0x48')][_0x3d5d('0x54')]+'%'};return _0x41b309;})});}_0xd52145=_['merge']({},_0xd52145,_0x11c2ab[_0x3d5d('0x5c')]);return _0x54bea3[_0x3d5d('0x9f')](_0xd52145);}})[_0x3d5d('0x28')](function(_0xcb6d37){if(_0xcb6d37){_0x17b661=_0xcb6d37[_0x3d5d('0x78')];if(!_0x11c2ab['query'][_0x3d5d('0x4e')](_0x3d5d('0x4f'))){_0xd52145[_0x3d5d('0x37')]=qs[_0x3d5d('0x37')](_0x11c2ab[_0x3d5d('0x48')]['limit']);_0xd52145[_0x3d5d('0x36')]=qs['offset'](_0x11c2ab[_0x3d5d('0x48')][_0x3d5d('0x36')]);}return _0x54bea3['getAgents'](_0xd52145);}})[_0x3d5d('0x28')](function(_0x38a048){if(_0x38a048){return _0x38a048?{'count':_0x17b661,'rows':_0x38a048}:null;}})[_0x3d5d('0x28')](respondWithResult(_0x5253a2,null))[_0x3d5d('0x59')](handleError(_0x5253a2,null));}; \ No newline at end of file +var _0xc4f4=['Team','pick','addTeams','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','emit','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','toString','QueryTypes','every','includes','all','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','socket.io-emitter','./chatQueue.socket','register','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','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','offset','set','Content-Range','json','apply','update','destroy','get','UserProfileResource','send','index','map','ChatQueue','fieldName','type','key','model','name','keys','query','filters','intersection','attributes','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','params','rawAttributes','fields','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','ChatQueueId','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams'];(function(_0x572b13,_0x5e0103){var _0x51aa20=function(_0x180542){while(--_0x180542){_0x572b13['push'](_0x572b13['shift']());}};_0x51aa20(++_0x5e0103);}(_0xc4f4,0xba));var _0x4c4f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4f4[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x4c4f('0x0'));var emlformat=require(_0x4c4f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4c4f('0x2'));var moment=require(_0x4c4f('0x3'));var BPromise=require(_0x4c4f('0x4'));var Mustache=require(_0x4c4f('0x5'));var util=require(_0x4c4f('0x6'));var path=require(_0x4c4f('0x7'));var sox=require(_0x4c4f('0x8'));var csv=require(_0x4c4f('0x9'));var ejs=require(_0x4c4f('0xa'));var fs=require('fs');var _=require(_0x4c4f('0xb'));var squel=require(_0x4c4f('0xc'));var crypto=require(_0x4c4f('0xd'));var jsforce=require(_0x4c4f('0xe'));var deskjs=require(_0x4c4f('0xf'));var toCsv=require(_0x4c4f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c4f('0x10'));var authService=require(_0x4c4f('0x11'));var qs=require(_0x4c4f('0x12'));var as=require(_0x4c4f('0x13'));var hardwareService=require(_0x4c4f('0x14'));var logger=require(_0x4c4f('0x15'))(_0x4c4f('0x16'));var utils=require(_0x4c4f('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4c4f('0x18')]=_['defaults'](config['redis'],{'host':_0x4c4f('0x19'),'port':0x18eb});var socket=require(_0x4c4f('0x1a'))(new Redis(config[_0x4c4f('0x18')]));require(_0x4c4f('0x1b'))[_0x4c4f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4c4f('0x1d')][_0x4c4f('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x331afd,_0x438c30,_0x40ade0){if(_0x40ade0){var _0x1beb98=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1beb98['test'](_0x438c30)){return _0x331afd;}else{throw new db[(_0x4c4f('0x1f'))]['ValidationError'](_0x4c4f('0x20'));}}else{return _0x331afd;}}function respondWithRpcPromise(_0x4f96bb,_0x14c376,_0x59fc41,_0x24696b){return new BPromise(function(_0x4992a8,_0x4398e8){var _0x194e4f=_0x24696b||client;return _0x194e4f[_0x4c4f('0x21')](_0x4f96bb,_0x59fc41)[_0x4c4f('0x22')](function(_0x4e0290){logger[_0x4c4f('0x23')](_0x4c4f('0x24'),_0x14c376,_0x4c4f('0x25'));logger[_0x4c4f('0x26')](_0x4c4f('0x27'),_0x14c376,'request\x20sent',JSON[_0x4c4f('0x28')](_0x4e0290));if(_0x4e0290[_0x4c4f('0x29')]){if(_0x4e0290['error'][_0x4c4f('0x2a')]===0x1f4){logger[_0x4c4f('0x29')](_0x4c4f('0x24'),_0x14c376,_0x4e0290[_0x4c4f('0x29')][_0x4c4f('0x2b')]);return _0x4398e8(_0x4e0290[_0x4c4f('0x29')][_0x4c4f('0x2b')]);}logger[_0x4c4f('0x29')](_0x4c4f('0x24'),_0x14c376,_0x4e0290[_0x4c4f('0x29')][_0x4c4f('0x2b')]);return _0x4992a8(_0x4e0290[_0x4c4f('0x29')][_0x4c4f('0x2b')]);}else{logger['info'](_0x4c4f('0x24'),_0x14c376,_0x4c4f('0x25'));_0x4992a8(_0x4e0290[_0x4c4f('0x2c')]['message']);}})[_0x4c4f('0x2d')](function(_0x1cc761){logger['error'](_0x4c4f('0x24'),_0x14c376,_0x1cc761);_0x4398e8(_0x1cc761);});});}function respondWithStatusCode(_0x341441,_0x35e0e3){_0x35e0e3=_0x35e0e3||0xcc;return function(_0x103ef4){if(_0x103ef4){return _0x341441[_0x4c4f('0x2e')](_0x35e0e3);}return _0x341441['status'](_0x35e0e3)[_0x4c4f('0x2f')]();};}function respondWithResult(_0x279a7d,_0x157d96){_0x157d96=_0x157d96||0xc8;return function(_0x481290){if(_0x481290){return _0x279a7d[_0x4c4f('0x30')](_0x157d96)['json'](_0x481290);}};}function respondWithFilteredResult(_0x1c0244,_0x120931){return function(_0x321164){if(_0x321164){var _0x5d1027=_0x321164['count'],_0x17234c=_0x120931[_0x4c4f('0x31')],_0x4dadf6=_0x120931[_0x4c4f('0x31')]+_0x120931['limit'],_0x42af35;if(_0x4dadf6>=_0x5d1027){_0x4dadf6=_0x5d1027;_0x42af35=0xc8;}else{_0x42af35=0xce;}_0x1c0244[_0x4c4f('0x30')](_0x42af35);return _0x1c0244[_0x4c4f('0x32')](_0x4c4f('0x33'),_0x17234c+'-'+_0x4dadf6+'/'+_0x5d1027)[_0x4c4f('0x34')](_0x321164);}return null;};}function patchUpdates(_0x42efe6){return function(_0x250150){try{jsonpatch[_0x4c4f('0x35')](_0x250150,_0x42efe6,!![]);}catch(_0xbbbe74){return BPromise['reject'](_0xbbbe74);}return _0x250150['save']();};}function saveUpdates(_0x438365,_0x3a85ff){return function(_0x597862){if(_0x597862){return _0x597862[_0x4c4f('0x36')](_0x438365)[_0x4c4f('0x22')](function(_0x408db9){return _0x408db9;});}return null;};}function removeEntity(_0x37b6a6,_0x42622e){return function(_0x292bac){if(_0x292bac){return _0x292bac[_0x4c4f('0x37')]()[_0x4c4f('0x22')](function(){var _0x28dd91=_0x292bac[_0x4c4f('0x38')]({'plain':!![]});var _0x20e4a4='ChatQueues';return db[_0x4c4f('0x39')][_0x4c4f('0x37')]({'where':{'type':_0x20e4a4,'resourceId':_0x28dd91['id']}})[_0x4c4f('0x22')](function(){return _0x292bac;});})[_0x4c4f('0x22')](function(){_0x37b6a6['status'](0xcc)[_0x4c4f('0x2f')]();});}};}function handleEntityNotFound(_0x3e41ee,_0x283fce){return function(_0x8d22f8){if(!_0x8d22f8){_0x3e41ee[_0x4c4f('0x2e')](0x194);}return _0x8d22f8;};}function handleError(_0x5ccae5,_0x1126ad){_0x1126ad=_0x1126ad||0x1f4;return function(_0xa3b783){logger[_0x4c4f('0x29')](_0xa3b783['stack']);if(_0xa3b783['name']){delete _0xa3b783['name'];}_0x5ccae5['status'](_0x1126ad)[_0x4c4f('0x3a')](_0xa3b783);};}exports[_0x4c4f('0x3b')]=function(_0x416f61,_0x3e5587){var _0x14c369={},_0x5aef53={},_0x52d71d={'count':0x0,'rows':[]};var _0xf9775c=_[_0x4c4f('0x3c')](db[_0x4c4f('0x3d')]['rawAttributes'],function(_0x3d0155){return{'name':_0x3d0155[_0x4c4f('0x3e')],'type':_0x3d0155[_0x4c4f('0x3f')][_0x4c4f('0x40')]};});_0x5aef53[_0x4c4f('0x41')]=_[_0x4c4f('0x3c')](_0xf9775c,_0x4c4f('0x42'));_0x5aef53['query']=_[_0x4c4f('0x43')](_0x416f61[_0x4c4f('0x44')]);_0x5aef53[_0x4c4f('0x45')]=_[_0x4c4f('0x46')](_0x5aef53[_0x4c4f('0x41')],_0x5aef53[_0x4c4f('0x44')]);_0x14c369['attributes']=_[_0x4c4f('0x46')](_0x5aef53[_0x4c4f('0x41')],qs['fields'](_0x416f61[_0x4c4f('0x44')]['fields']));_0x14c369[_0x4c4f('0x47')]=_0x14c369[_0x4c4f('0x47')]['length']?_0x14c369['attributes']:_0x5aef53['model'];if(!_0x416f61[_0x4c4f('0x44')]['hasOwnProperty'](_0x4c4f('0x48'))){_0x14c369[_0x4c4f('0x49')]=qs['limit'](_0x416f61[_0x4c4f('0x44')][_0x4c4f('0x49')]);_0x14c369[_0x4c4f('0x31')]=qs[_0x4c4f('0x31')](_0x416f61[_0x4c4f('0x44')][_0x4c4f('0x31')]);}_0x14c369[_0x4c4f('0x4a')]=qs[_0x4c4f('0x4b')](_0x416f61['query'][_0x4c4f('0x4b')]);_0x14c369[_0x4c4f('0x4c')]=qs[_0x4c4f('0x45')](_['pick'](_0x416f61['query'],_0x5aef53[_0x4c4f('0x45')]),_0xf9775c);if(_0x416f61[_0x4c4f('0x44')][_0x4c4f('0x4d')]){_0x14c369['where']=_[_0x4c4f('0x4e')](_0x14c369['where'],{'$or':_[_0x4c4f('0x3c')](_0xf9775c,function(_0x3783d6){if(_0x3783d6['type']!==_0x4c4f('0x4f')){var _0x6b4cb3={};_0x6b4cb3[_0x3783d6['name']]={'$like':'%'+_0x416f61[_0x4c4f('0x44')]['filter']+'%'};return _0x6b4cb3;}})});}_0x14c369=_[_0x4c4f('0x4e')]({},_0x14c369,_0x416f61[_0x4c4f('0x50')]);var _0x195399={'where':_0x14c369['where']};return db[_0x4c4f('0x3d')][_0x4c4f('0x51')](_0x195399)[_0x4c4f('0x22')](function(_0x5de0db){_0x52d71d['count']=_0x5de0db;if(_0x416f61['query']['includeAll']){_0x14c369[_0x4c4f('0x52')]=[{'all':!![]}];}return db[_0x4c4f('0x3d')][_0x4c4f('0x53')](_0x14c369);})[_0x4c4f('0x22')](function(_0x269295){_0x52d71d[_0x4c4f('0x54')]=_0x269295;return _0x52d71d;})[_0x4c4f('0x22')](respondWithFilteredResult(_0x3e5587,_0x14c369))['catch'](handleError(_0x3e5587,null));};exports[_0x4c4f('0x55')]=function(_0xdc9e86,_0x34e0cd){var _0x592470={'raw':!![],'where':{'id':_0xdc9e86[_0x4c4f('0x56')]['id']}},_0x5e74ad={};_0x5e74ad[_0x4c4f('0x41')]=_[_0x4c4f('0x43')](db['ChatQueue'][_0x4c4f('0x57')]);_0x5e74ad[_0x4c4f('0x44')]=_['keys'](_0xdc9e86[_0x4c4f('0x44')]);_0x5e74ad[_0x4c4f('0x45')]=_['intersection'](_0x5e74ad[_0x4c4f('0x41')],_0x5e74ad[_0x4c4f('0x44')]);_0x592470['attributes']=_['intersection'](_0x5e74ad['model'],qs[_0x4c4f('0x58')](_0xdc9e86[_0x4c4f('0x44')][_0x4c4f('0x58')]));_0x592470[_0x4c4f('0x47')]=_0x592470[_0x4c4f('0x47')][_0x4c4f('0x59')]?_0x592470['attributes']:_0x5e74ad[_0x4c4f('0x41')];if(_0xdc9e86[_0x4c4f('0x44')]['includeAll']){_0x592470[_0x4c4f('0x52')]=[{'all':!![]}];}_0x592470=_[_0x4c4f('0x4e')]({},_0x592470,_0xdc9e86[_0x4c4f('0x50')]);return db[_0x4c4f('0x3d')][_0x4c4f('0x5a')](_0x592470)['then'](handleEntityNotFound(_0x34e0cd,null))['then'](respondWithResult(_0x34e0cd,null))[_0x4c4f('0x2d')](handleError(_0x34e0cd,null));};exports[_0x4c4f('0x5b')]=function(_0x3694ab,_0x5c8adf){return db[_0x4c4f('0x3d')][_0x4c4f('0x5b')](_0x3694ab[_0x4c4f('0x5c')],{})['then'](function(_0x5d56e4){var _0x1fd67c=_0x3694ab['user']['get']({'plain':!![]});if(!_0x1fd67c)throw new Error(_0x4c4f('0x5d'));if(_0x1fd67c['role']===_0x4c4f('0x5e')){var _0x298f67=_0x5d56e4[_0x4c4f('0x38')]({'plain':!![]});var _0x4a1f72='ChatQueues';return db[_0x4c4f('0x5f')]['find']({'where':{'name':_0x4a1f72,'userProfileId':_0x1fd67c[_0x4c4f('0x60')]},'raw':!![]})[_0x4c4f('0x22')](function(_0x25c79c){if(_0x25c79c&&_0x25c79c['autoAssociation']===0x0){return db[_0x4c4f('0x39')][_0x4c4f('0x5b')]({'name':_0x298f67[_0x4c4f('0x42')],'resourceId':_0x298f67['id'],'type':_0x25c79c[_0x4c4f('0x42')],'sectionId':_0x25c79c['id']},{})[_0x4c4f('0x22')](function(){return _0x5d56e4;});}else{return _0x5d56e4;}})['catch'](function(_0x5e7171){logger[_0x4c4f('0x29')](_0x4c4f('0x61'),_0x5e7171);throw _0x5e7171;});}return _0x5d56e4;})[_0x4c4f('0x22')](respondWithResult(_0x5c8adf,0xc9))[_0x4c4f('0x2d')](handleError(_0x5c8adf,null));};exports['update']=function(_0x3b881b,_0x142380){if(_0x3b881b['body']['id']){delete _0x3b881b[_0x4c4f('0x5c')]['id'];}return db[_0x4c4f('0x3d')][_0x4c4f('0x5a')]({'where':{'id':_0x3b881b[_0x4c4f('0x56')]['id']}})[_0x4c4f('0x22')](handleEntityNotFound(_0x142380,null))['then'](saveUpdates(_0x3b881b['body'],null))[_0x4c4f('0x22')](respondWithResult(_0x142380,null))[_0x4c4f('0x2d')](handleError(_0x142380,null));};exports[_0x4c4f('0x37')]=function(_0x411899,_0x53d2f9){return db['ChatQueue'][_0x4c4f('0x5a')]({'where':{'id':_0x411899[_0x4c4f('0x56')]['id']}})['then'](handleEntityNotFound(_0x53d2f9,null))['then'](removeEntity(_0x53d2f9,null))[_0x4c4f('0x2d')](handleError(_0x53d2f9,null));};exports[_0x4c4f('0x62')]=function(_0x3a5de3,_0x2609cc){return db[_0x4c4f('0x3d')][_0x4c4f('0x62')]()[_0x4c4f('0x22')](respondWithResult(_0x2609cc,null))[_0x4c4f('0x2d')](handleError(_0x2609cc,null));};exports[_0x4c4f('0x63')]=function(_0x188fb6,_0x52c280,_0x5e16b1){var _0x3c0c78={'raw':!![],'where':{}},_0x5cc115={},_0x3d9e73;return db[_0x4c4f('0x3d')][_0x4c4f('0x64')]({'where':{'id':_0x188fb6[_0x4c4f('0x56')]['id']}})[_0x4c4f('0x22')](handleEntityNotFound(_0x52c280,null))[_0x4c4f('0x22')](function(_0x472764){if(_0x472764){_0x3d9e73=_0x472764[_0x4c4f('0x38')]({'plain':!![]});_0x5cc115[_0x4c4f('0x41')]=_['keys'](db['UserChatQueue'][_0x4c4f('0x57')]);_0x5cc115[_0x4c4f('0x44')]=_[_0x4c4f('0x43')](_0x188fb6[_0x4c4f('0x44')]);_0x5cc115[_0x4c4f('0x45')]=_[_0x4c4f('0x46')](_0x5cc115[_0x4c4f('0x41')],_0x5cc115[_0x4c4f('0x44')]);_0x3c0c78[_0x4c4f('0x47')]=_['intersection'](_0x5cc115[_0x4c4f('0x41')],qs[_0x4c4f('0x58')](_0x188fb6[_0x4c4f('0x44')]['fields']));_0x3c0c78[_0x4c4f('0x47')]=_0x3c0c78[_0x4c4f('0x47')]['length']?_0x3c0c78[_0x4c4f('0x47')]:_0x5cc115['model'];if(!_0x188fb6['query'][_0x4c4f('0x65')]('nolimit')){_0x3c0c78[_0x4c4f('0x49')]=qs[_0x4c4f('0x49')](_0x188fb6[_0x4c4f('0x44')]['limit']);_0x3c0c78['offset']=qs[_0x4c4f('0x31')](_0x188fb6[_0x4c4f('0x44')][_0x4c4f('0x31')]);}_0x3c0c78['order']=qs[_0x4c4f('0x4b')](_0x188fb6['query'][_0x4c4f('0x4b')]);_0x3c0c78[_0x4c4f('0x4c')]=qs['filters'](_['pick'](_0x188fb6['query'],_0x5cc115[_0x4c4f('0x45')]));_0x3c0c78['where'][_0x4c4f('0x66')]=_0x472764['id'];if(_0x188fb6[_0x4c4f('0x44')][_0x4c4f('0x4d')]){_0x3c0c78[_0x4c4f('0x4c')]=_[_0x4c4f('0x4e')](_0x3c0c78[_0x4c4f('0x4c')],{'$or':_['map'](_0x3c0c78[_0x4c4f('0x47')],function(_0x258cd7){var _0x56f5fd={};_0x56f5fd[_0x258cd7]={'$like':'%'+_0x188fb6[_0x4c4f('0x44')][_0x4c4f('0x4d')]+'%'};return _0x56f5fd;})});}_0x3c0c78=_[_0x4c4f('0x4e')]({},_0x3c0c78,_0x188fb6[_0x4c4f('0x50')]);return db['UserChatQueue'][_0x4c4f('0x53')](_0x3c0c78);}})[_0x4c4f('0x22')](function(_0x3efba7){if(_0x3efba7){return db[_0x4c4f('0x67')]['findAndCountAll']({'where':{'id':_['map'](_0x3efba7,_0x4c4f('0x68')),'role':_0x4c4f('0x69')},'attributes':['id','name',_0x4c4f('0x6a'),_0x4c4f('0x6b'),_0x4c4f('0x6c')]});}})[_0x4c4f('0x22')](function(_0x37491c){if(_0x37491c){return{'count':_0x37491c[_0x4c4f('0x51')],'rows':_[_0x4c4f('0x3c')](_0x37491c['rows'],function(_0x196157){return{'membername':_0x196157[_0x4c4f('0x42')],'UserId':_0x196157['id'],'queue_name':_0x3d9e73['name'],'ChatQueueId':_0x3d9e73['id'],'interface':util[_0x4c4f('0x6d')](_0x4c4f('0x6e'),'SIP',_0x196157[_0x4c4f('0x42')]),'penalty':0x0,'paused':_0x196157[_0x4c4f('0x6a')],'createdAt':_0x196157[_0x4c4f('0x6c')],'updatedAt':_0x196157['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x52c280,_0x3c0c78))[_0x4c4f('0x2d')](handleError(_0x52c280,null));};exports[_0x4c4f('0x6f')]=function(_0x108d5e,_0x4f5af5,_0x412a55){var _0x361ac6={};var _0x462477={};var _0x1e1f1c;var _0x25f607;return db[_0x4c4f('0x3d')][_0x4c4f('0x64')]({'where':{'id':_0x108d5e['params']['id']}})[_0x4c4f('0x22')](handleEntityNotFound(_0x4f5af5,null))['then'](function(_0xb3b093){if(_0xb3b093){_0x1e1f1c=_0xb3b093;_0x462477[_0x4c4f('0x41')]=_[_0x4c4f('0x43')](db[_0x4c4f('0x70')][_0x4c4f('0x57')]);_0x462477[_0x4c4f('0x44')]=_[_0x4c4f('0x43')](_0x108d5e[_0x4c4f('0x44')]);_0x462477[_0x4c4f('0x45')]=_[_0x4c4f('0x46')](_0x462477[_0x4c4f('0x41')],_0x462477[_0x4c4f('0x44')]);_0x361ac6[_0x4c4f('0x47')]=_[_0x4c4f('0x46')](_0x462477[_0x4c4f('0x41')],qs[_0x4c4f('0x58')](_0x108d5e['query'][_0x4c4f('0x58')]));_0x361ac6['attributes']=_0x361ac6[_0x4c4f('0x47')][_0x4c4f('0x59')]?_0x361ac6[_0x4c4f('0x47')]:_0x462477[_0x4c4f('0x41')];_0x361ac6[_0x4c4f('0x4a')]=qs[_0x4c4f('0x4b')](_0x108d5e[_0x4c4f('0x44')][_0x4c4f('0x4b')]);_0x361ac6[_0x4c4f('0x4c')]=qs[_0x4c4f('0x45')](_[_0x4c4f('0x71')](_0x108d5e['query'],_0x462477[_0x4c4f('0x45')]));if(_0x108d5e[_0x4c4f('0x44')][_0x4c4f('0x4d')]){_0x361ac6['where']=_[_0x4c4f('0x4e')](_0x361ac6['where'],{'$or':_[_0x4c4f('0x3c')](_0x361ac6[_0x4c4f('0x47')],function(_0x2a0480){var _0x3d3079={};_0x3d3079[_0x2a0480]={'$like':'%'+_0x108d5e['query'][_0x4c4f('0x4d')]+'%'};return _0x3d3079;})});}_0x361ac6=_[_0x4c4f('0x4e')]({},_0x361ac6,_0x108d5e[_0x4c4f('0x50')]);return _0x1e1f1c[_0x4c4f('0x6f')](_0x361ac6);}})[_0x4c4f('0x22')](function(_0xf0de19){if(_0xf0de19){_0x25f607=_0xf0de19[_0x4c4f('0x59')];if(!_0x108d5e[_0x4c4f('0x44')]['hasOwnProperty'](_0x4c4f('0x48'))){_0x361ac6['limit']=qs[_0x4c4f('0x49')](_0x108d5e['query'][_0x4c4f('0x49')]);_0x361ac6[_0x4c4f('0x31')]=qs[_0x4c4f('0x31')](_0x108d5e['query'][_0x4c4f('0x31')]);}return _0x1e1f1c[_0x4c4f('0x6f')](_0x361ac6);}})[_0x4c4f('0x22')](function(_0x3b62a9){if(_0x3b62a9){return _0x3b62a9?{'count':_0x25f607,'rows':_0x3b62a9}:null;}})['then'](respondWithResult(_0x4f5af5,null))[_0x4c4f('0x2d')](handleError(_0x4f5af5,null));};exports[_0x4c4f('0x72')]=function(_0x47dc44,_0x4726ef,_0xf8bf07){var _0x29a8a1=_0x47dc44[_0x4c4f('0x5c')][_0x4c4f('0x73')];return db[_0x4c4f('0x70')][_0x4c4f('0x53')]({'where':{'id':_0x29a8a1},'attributes':['id'],'include':[{'model':db[_0x4c4f('0x67')],'as':_0x4c4f('0x74'),'attributes':['id',_0x4c4f('0x42'),'online',_0x4c4f('0x75'),_0x4c4f('0x76')],'raw':!![]}]})[_0x4c4f('0x22')](function(_0x222e5b){if(_0x222e5b){var _0x5b5d8c=_[_0x4c4f('0x77')](_0x222e5b,function(_0x38c875){var _0x59e308=_0x38c875[_0x4c4f('0x38')]({'plain':!![]});return _0x59e308[_0x4c4f('0x74')];});return db[_0x4c4f('0x3d')][_0x4c4f('0x5a')]({'where':{'id':_0x47dc44[_0x4c4f('0x56')]['id']}})[_0x4c4f('0x22')](function(_0x166314){return db[_0x4c4f('0x78')][_0x4c4f('0x79')](function(_0xc28224){return _0x166314[_0x4c4f('0x72')](_0x29a8a1,{'transaction':_0xc28224})[_0x4c4f('0x22')](function(){return BPromise[_0x4c4f('0x7a')](_0x5b5d8c,function(_0x41cda2){return db[_0x4c4f('0x7b')][_0x4c4f('0x7c')]({'where':{'UserId':_0x41cda2['id'],'ChatQueueId':_0x47dc44['params']['id']},'transaction':_0xc28224});});})[_0x4c4f('0x22')](function(){_0x5b5d8c[_0x4c4f('0x7d')](function(_0x2b7db8){socket[_0x4c4f('0x7e')]('userChatQueue:save',{'UserId':_0x2b7db8['id'],'ChatQueueId':_0x166314['id']});});});});});}})[_0x4c4f('0x22')](respondWithStatusCode(_0x4726ef,null))[_0x4c4f('0x2d')](handleError(_0x4726ef,null));};exports[_0x4c4f('0x7f')]=function(_0x3fd433,_0x5674e7,_0x34dc67){return db[_0x4c4f('0x70')][_0x4c4f('0x53')]({'where':{'id':_0x3fd433[_0x4c4f('0x44')][_0x4c4f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x4c4f('0x67')],'as':_0x4c4f('0x74'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5674e7,null))['then'](function(_0xd633e9){var _0x103f14=_[_0x4c4f('0x3c')](_0xd633e9,'id');var _0x3ad49=[];var _0x5b7f7d=[];var _0x43c860=squel[_0x4c4f('0x80')]();_0x43c860[_0x4c4f('0x81')]('tq.TeamId')[_0x4c4f('0x82')]('team_has_chat_queues','tq')[_0x4c4f('0x83')](_0x4c4f('0x84'),'ut',_0x4c4f('0x85'))['where']('ChatQueueId\x20=\x20?',_0x3fd433[_0x4c4f('0x56')]['id']);for(var _0x432863=0x0;_0x432863<_0xd633e9['length'];_0x432863+=0x1){let _0x5f1eba=_0xd633e9[_0x432863];for(var _0x3ff1c7=0x0;_0x3ff1c7<_0x5f1eba[_0x4c4f('0x74')][_0x4c4f('0x59')];_0x3ff1c7+=0x1){let _0x4aacfa=_0x5f1eba[_0x4c4f('0x74')][_0x3ff1c7];var _0x14732b=_0x43c860['clone']();_0x14732b[_0x4c4f('0x4c')]('ut.UserId\x20=\x20?',_0x4aacfa['id']);_0x5b7f7d[_0x4c4f('0x86')](db[_0x4c4f('0x78')][_0x4c4f('0x44')](_0x14732b[_0x4c4f('0x87')](),{'type':db[_0x4c4f('0x78')][_0x4c4f('0x88')]['SELECT']})[_0x4c4f('0x22')](function(_0x4c9ac4){if(_0x4c9ac4[_0x4c4f('0x59')]===0x1){return _0x4aacfa['id'];}else{var _0x2d5cda=_[_0x4c4f('0x89')](_['map'](_0x4c9ac4,'TeamId'),function(_0x2bcac1){return _[_0x4c4f('0x8a')](_0x103f14,_0x2bcac1);});if(_0x2d5cda){return _0x4aacfa['id'];}}}));}}return BPromise[_0x4c4f('0x8b')](_0x5b7f7d)[_0x4c4f('0x22')](function(_0x226450){_0x3ad49=_(_0x3ad49)['union'](_0x226450)[_0x4c4f('0x8c')]()['value']();return db[_0x4c4f('0x3d')][_0x4c4f('0x5a')]({'where':{'id':_0x3fd433[_0x4c4f('0x56')]['id']}})[_0x4c4f('0x22')](function(_0x46b9f3){return db[_0x4c4f('0x78')]['transaction'](function(_0x3f653a){return _0x46b9f3[_0x4c4f('0x7f')](_0x3fd433[_0x4c4f('0x44')]['ids'],{'transaction':_0x3f653a})[_0x4c4f('0x22')](function(){if(!_[_0x4c4f('0x8d')](_0x3ad49)){return _0x46b9f3[_0x4c4f('0x8e')](_0x3ad49,{'transaction':_0x3f653a});}})[_0x4c4f('0x22')](function(){_0x3ad49[_0x4c4f('0x7d')](function(_0x579f20){socket[_0x4c4f('0x7e')](_0x4c4f('0x8f'),{'UserId':_0x579f20,'ChatQueueId':_0x46b9f3['id']});});});});});});})[_0x4c4f('0x22')](respondWithStatusCode(_0x5674e7,null))[_0x4c4f('0x2d')](handleError(_0x5674e7,null));};exports[_0x4c4f('0x90')]=function(_0x31f572,_0x3b9b6e,_0x591d0e){return db['ChatQueue']['find']({'where':{'id':_0x31f572[_0x4c4f('0x56')]['id']}})[_0x4c4f('0x22')](handleEntityNotFound(_0x3b9b6e,null))[_0x4c4f('0x22')](function(_0x3774b2){if(_0x3774b2){return _0x3774b2['addAgents'](_0x31f572['body'][_0x4c4f('0x73')],_[_0x4c4f('0x91')](_0x31f572[_0x4c4f('0x5c')],['ids','id'])||{})[_0x4c4f('0x92')](function(_0x3bc687){for(var _0x3fd868=0x0;_0x3fd868<_0x31f572[_0x4c4f('0x5c')]['ids'][_0x4c4f('0x59')];_0x3fd868+=0x1){socket['emit'](_0x4c4f('0x93'),{'UserId':_0x31f572['body'][_0x4c4f('0x73')][_0x3fd868],'ChatQueueId':_0x31f572[_0x4c4f('0x56')]['id']});}return _0x3bc687;});}})[_0x4c4f('0x22')](respondWithResult(_0x3b9b6e,null))['catch'](handleError(_0x3b9b6e,null));};exports[_0x4c4f('0x8e')]=function(_0x568b71,_0x37ef9d,_0x29104b){return db[_0x4c4f('0x3d')][_0x4c4f('0x5a')]({'where':{'id':_0x568b71[_0x4c4f('0x56')]['id']}})['then'](handleEntityNotFound(_0x37ef9d,null))[_0x4c4f('0x22')](function(_0x1ff514){if(_0x1ff514){return _0x1ff514[_0x4c4f('0x8e')](_0x568b71['query'][_0x4c4f('0x73')])['then'](function(){if(_['isArray'](_0x568b71[_0x4c4f('0x44')][_0x4c4f('0x73')])){for(var _0x2b124f=0x0;_0x2b124f<_0x568b71['query'][_0x4c4f('0x73')][_0x4c4f('0x59')];_0x2b124f+=0x1){socket[_0x4c4f('0x7e')](_0x4c4f('0x8f'),{'UserId':Number(_0x568b71[_0x4c4f('0x44')][_0x4c4f('0x73')][_0x2b124f]),'ChatQueueId':Number(_0x568b71['params']['id'])});}}else{socket[_0x4c4f('0x7e')](_0x4c4f('0x8f'),{'UserId':Number(_0x568b71[_0x4c4f('0x44')][_0x4c4f('0x73')]),'ChatQueueId':Number(_0x568b71['params']['id'])});}});}})[_0x4c4f('0x22')](respondWithStatusCode(_0x37ef9d,null))['catch'](handleError(_0x37ef9d,null));};exports[_0x4c4f('0x94')]=function(_0x35ff85,_0x1cd245,_0x210603){var _0x3630c2={};var _0x54df02={};var _0x137f64;var _0x30a7a1;return db['ChatQueue']['findOne']({'where':{'id':_0x35ff85['params']['id']}})[_0x4c4f('0x22')](handleEntityNotFound(_0x1cd245,null))[_0x4c4f('0x22')](function(_0x29edf7){if(_0x29edf7){_0x137f64=_0x29edf7;_0x54df02['model']=_['keys'](db['User'][_0x4c4f('0x57')]);_0x54df02['query']=_[_0x4c4f('0x43')](_0x35ff85[_0x4c4f('0x44')]);_0x54df02[_0x4c4f('0x45')]=_[_0x4c4f('0x46')](_0x54df02['model'],_0x54df02[_0x4c4f('0x44')]);_0x3630c2[_0x4c4f('0x47')]=_[_0x4c4f('0x46')](_0x54df02[_0x4c4f('0x41')],qs[_0x4c4f('0x58')](_0x35ff85[_0x4c4f('0x44')]['fields']));_0x3630c2[_0x4c4f('0x47')]=_0x3630c2[_0x4c4f('0x47')][_0x4c4f('0x59')]?_0x3630c2[_0x4c4f('0x47')]:_0x54df02[_0x4c4f('0x41')];_0x3630c2[_0x4c4f('0x4a')]=qs[_0x4c4f('0x4b')](_0x35ff85[_0x4c4f('0x44')]['sort']);_0x3630c2[_0x4c4f('0x4c')]=qs[_0x4c4f('0x45')](_[_0x4c4f('0x71')](_0x35ff85[_0x4c4f('0x44')],_0x54df02[_0x4c4f('0x45')]));if(_0x35ff85[_0x4c4f('0x44')][_0x4c4f('0x4d')]){_0x3630c2[_0x4c4f('0x4c')]=_[_0x4c4f('0x4e')](_0x3630c2[_0x4c4f('0x4c')],{'$or':_[_0x4c4f('0x3c')](_0x3630c2['attributes'],function(_0x188dd6){var _0x17b5eb={};_0x17b5eb[_0x188dd6]={'$like':'%'+_0x35ff85[_0x4c4f('0x44')]['filter']+'%'};return _0x17b5eb;})});}_0x3630c2=_[_0x4c4f('0x4e')]({},_0x3630c2,_0x35ff85['options']);return _0x137f64[_0x4c4f('0x94')](_0x3630c2);}})['then'](function(_0x45c162){if(_0x45c162){_0x30a7a1=_0x45c162[_0x4c4f('0x59')];if(!_0x35ff85['query'][_0x4c4f('0x65')](_0x4c4f('0x48'))){_0x3630c2[_0x4c4f('0x49')]=qs['limit'](_0x35ff85[_0x4c4f('0x44')][_0x4c4f('0x49')]);_0x3630c2[_0x4c4f('0x31')]=qs[_0x4c4f('0x31')](_0x35ff85['query']['offset']);}return _0x137f64[_0x4c4f('0x94')](_0x3630c2);}})[_0x4c4f('0x22')](function(_0x21a243){if(_0x21a243){return _0x21a243?{'count':_0x30a7a1,'rows':_0x21a243}:null;}})[_0x4c4f('0x22')](respondWithResult(_0x1cd245,null))[_0x4c4f('0x2d')](handleError(_0x1cd245,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 6edcf05..d8526a7 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 _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x58381c,_0x3b9374){var _0x1a7440=function(_0x2bc7f1){while(--_0x2bc7f1){_0x58381c['push'](_0x58381c['shift']());}};_0x1a7440(++_0x3b9374);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x45de70,_0x48e967){var _0x21ea23=function(_0x45a8e8){while(--_0x45a8e8){_0x45de70['push'](_0x45de70['shift']());}};_0x21ea23(++_0x48e967);}(_0xb10b,0x12a));var _0xbb10=function(_0x48b00c,_0x16690b){_0x48b00c=_0x48b00c-0x0;var _0x55d181=_0xb10b[_0x48b00c];return _0x55d181;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 94a03dd..77644d6 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 _0x9216=['../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','api','bluebird','request-promise','rimraf'];(function(_0x25b444,_0x20da5e){var _0x425f88=function(_0xe4183e){while(--_0xe4183e){_0x25b444['push'](_0x25b444['shift']());}};_0x425f88(++_0x20da5e);}(_0x9216,0x1de));var _0x6921=function(_0x4d7530,_0xdee31){_0x4d7530=_0x4d7530-0x0;var _0x1afc9e=_0x9216[_0x4d7530];return _0x1afc9e;};'use strict';var _=require(_0x6921('0x0'));var util=require(_0x6921('0x1'));var logger=require('../../config/logger')(_0x6921('0x2'));var moment=require('moment');var BPromise=require(_0x6921('0x3'));var rp=require(_0x6921('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6921('0x5'));var config=require(_0x6921('0x6'));var attributes=require(_0x6921('0x7'));module[_0x6921('0x8')]=function(_0x1cc8f3,_0x118a48){return _0x1cc8f3['define'](_0x6921('0x9'),attributes,{'tableName':_0x6921('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5327=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5327,0xd1));var _0x7532=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5327[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7532('0x0'));var util=require(_0x7532('0x1'));var logger=require(_0x7532('0x2'))(_0x7532('0x3'));var moment=require(_0x7532('0x4'));var BPromise=require(_0x7532('0x5'));var rp=require(_0x7532('0x6'));var fs=require('fs');var path=require(_0x7532('0x7'));var rimraf=require(_0x7532('0x8'));var config=require(_0x7532('0x9'));var attributes=require(_0x7532('0xa'));module[_0x7532('0xb')]=function(_0x5d3be9,_0x4b9a21){return _0x5d3be9['define'](_0x7532('0xc'),attributes,{'tableName':_0x7532('0xd'),'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 c535af1..4bb4d81 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 _0x1cf6=['info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','attributes','limit','map','include','stringify','find','where','model','ShowChatQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then'];(function(_0x499029,_0xa41dab){var _0xea8b32=function(_0x5f1782){while(--_0x5f1782){_0x499029['push'](_0x499029['shift']());}};_0xea8b32(++_0xa41dab);}(_0x1cf6,0x1a4));var _0x61cf=function(_0x334ffd,_0x1233f6){_0x334ffd=_0x334ffd-0x0;var _0x3b73d3=_0x1cf6[_0x334ffd];return _0x3b73d3;};'use strict';var _=require('lodash');var util=require(_0x61cf('0x0'));var moment=require(_0x61cf('0x1'));var BPromise=require(_0x61cf('0x2'));var rs=require(_0x61cf('0x3'));var fs=require('fs');var Redis=require(_0x61cf('0x4'));var db=require(_0x61cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x61cf('0x6'))(_0x61cf('0x7'));var config=require(_0x61cf('0x8'));var jayson=require(_0x61cf('0x9'));var client=jayson[_0x61cf('0xa')][_0x61cf('0xb')]({'port':0x232a});config[_0x61cf('0xc')]=_[_0x61cf('0xd')](config[_0x61cf('0xc')],{'host':_0x61cf('0xe'),'port':0x18eb});var socket=require(_0x61cf('0xf'))(new Redis(config[_0x61cf('0xc')]));require(_0x61cf('0x10'))[_0x61cf('0x11')](socket);function respondWithRpcPromise(_0x1aab6b,_0x43681d,_0x4b6ea4){return new BPromise(function(_0x24b82f,_0x4f6914){return client[_0x61cf('0x12')](_0x1aab6b,_0x4b6ea4)[_0x61cf('0x13')](function(_0x4b849d){logger[_0x61cf('0x14')](_0x61cf('0x15'),_0x43681d,_0x61cf('0x16'));logger[_0x61cf('0x17')](_0x61cf('0x18'),_0x43681d,'request\x20sent',JSON['stringify'](_0x4b849d));if(_0x4b849d[_0x61cf('0x19')]){if(_0x4b849d[_0x61cf('0x19')][_0x61cf('0x1a')]===0x1f4){logger[_0x61cf('0x19')](_0x61cf('0x15'),_0x43681d,_0x4b849d[_0x61cf('0x19')][_0x61cf('0x1b')]);return _0x4f6914(_0x4b849d['error'][_0x61cf('0x1b')]);}logger[_0x61cf('0x19')](_0x61cf('0x15'),_0x43681d,_0x4b849d[_0x61cf('0x19')][_0x61cf('0x1b')]);return _0x24b82f(_0x4b849d['error'][_0x61cf('0x1b')]);}else{logger[_0x61cf('0x14')](_0x61cf('0x15'),_0x43681d,_0x61cf('0x16'));_0x24b82f(_0x4b849d[_0x61cf('0x1c')][_0x61cf('0x1b')]);}})[_0x61cf('0x1d')](function(_0x5e203c){logger['error'](_0x61cf('0x15'),_0x43681d,_0x5e203c);_0x4f6914(_0x5e203c);});});}exports[_0x61cf('0x1e')]=function(_0x52cabf){var _0x15f8c1=this;return new Promise(function(_0x5bb38d,_0x508617){return db[_0x61cf('0x1f')][_0x61cf('0x20')]({'raw':_0x52cabf['options']?_0x52cabf['options'][_0x61cf('0x21')]===undefined?!![]:![]:!![],'where':_0x52cabf['options']?_0x52cabf[_0x61cf('0x22')]['where']||null:null,'attributes':_0x52cabf['options']?_0x52cabf[_0x61cf('0x22')][_0x61cf('0x23')]||null:null,'limit':_0x52cabf[_0x61cf('0x22')]?_0x52cabf[_0x61cf('0x22')][_0x61cf('0x24')]||null:null,'include':_0x52cabf[_0x61cf('0x22')]?_0x52cabf['options']['include']?_[_0x61cf('0x25')](_0x52cabf[_0x61cf('0x22')][_0x61cf('0x26')],function(_0x349e50){return{'model':db[_0x349e50['model']],'as':_0x349e50['as'],'attributes':_0x349e50[_0x61cf('0x23')],'include':_0x349e50[_0x61cf('0x26')]?_[_0x61cf('0x25')](_0x349e50[_0x61cf('0x26')],function(_0x533aa1){return{'model':db[_0x533aa1['model']],'as':_0x533aa1['as'],'attributes':_0x533aa1[_0x61cf('0x23')],'include':_0x533aa1[_0x61cf('0x26')]?_[_0x61cf('0x25')](_0x533aa1[_0x61cf('0x26')],function(_0x5368ba){return{'model':db[_0x5368ba['model']],'as':_0x5368ba['as'],'attributes':_0x5368ba['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e3e3d){logger[_0x61cf('0x14')](_0x61cf('0x1e'),_0x52cabf);logger[_0x61cf('0x17')]('GetChatQueue',_0x52cabf,JSON[_0x61cf('0x27')](_0x3e3e3d));_0x5bb38d(_0x3e3e3d);})[_0x61cf('0x1d')](function(_0x133e9f){logger['error'](_0x61cf('0x1e'),_0x133e9f[_0x61cf('0x1b')],_0x52cabf);_0x508617(_0x15f8c1[_0x61cf('0x19')](0x1f4,_0x133e9f[_0x61cf('0x1b')]));});});};exports['ShowChatQueue']=function(_0x1e29d7){var _0x2e0077=this;return new Promise(function(_0x2f4464,_0x3428de){return db[_0x61cf('0x1f')][_0x61cf('0x28')]({'raw':_0x1e29d7[_0x61cf('0x22')]?_0x1e29d7[_0x61cf('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x1e29d7[_0x61cf('0x22')]?_0x1e29d7[_0x61cf('0x22')][_0x61cf('0x29')]||null:null,'attributes':_0x1e29d7[_0x61cf('0x22')]?_0x1e29d7[_0x61cf('0x22')][_0x61cf('0x23')]||null:null,'include':_0x1e29d7['options']?_0x1e29d7[_0x61cf('0x22')][_0x61cf('0x26')]?_['map'](_0x1e29d7[_0x61cf('0x22')]['include'],function(_0x4a3467){return{'model':db[_0x4a3467['model']],'as':_0x4a3467['as'],'attributes':_0x4a3467[_0x61cf('0x23')],'include':_0x4a3467[_0x61cf('0x26')]?_[_0x61cf('0x25')](_0x4a3467['include'],function(_0x4437ea){return{'model':db[_0x4437ea[_0x61cf('0x2a')]],'as':_0x4437ea['as'],'attributes':_0x4437ea['attributes'],'include':_0x4437ea[_0x61cf('0x26')]?_[_0x61cf('0x25')](_0x4437ea[_0x61cf('0x26')],function(_0x318c76){return{'model':db[_0x318c76[_0x61cf('0x2a')]],'as':_0x318c76['as'],'attributes':_0x318c76[_0x61cf('0x23')]};}):[]};}):[]};}):[]:[]})[_0x61cf('0x13')](function(_0x162e35){logger['info']('ShowChatQueue',_0x1e29d7);logger['debug']('ShowChatQueue',_0x1e29d7,JSON[_0x61cf('0x27')](_0x162e35));_0x2f4464(_0x162e35);})[_0x61cf('0x1d')](function(_0x49331a){logger[_0x61cf('0x19')](_0x61cf('0x2b'),_0x49331a[_0x61cf('0x1b')],_0x1e29d7);_0x3428de(_0x2e0077[_0x61cf('0x19')](0x1f4,_0x49331a[_0x61cf('0x1b')]));});});}; \ No newline at end of file +var _0x7543=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','message','error','info','result','catch','ChatQueue','findAll','options','where','attributes','limit','include','map','model','GetChatQueue','stringify','find','raw','ShowChatQueue','util','moment','bluebird'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x7543,0xca));var _0x3754=function(_0x4df20d,_0x239ad9){_0x4df20d=_0x4df20d-0x0;var _0x553659=_0x7543[_0x4df20d];return _0x553659;};'use strict';var _=require('lodash');var util=require(_0x3754('0x0'));var moment=require(_0x3754('0x1'));var BPromise=require(_0x3754('0x2'));var rs=require(_0x3754('0x3'));var fs=require('fs');var Redis=require(_0x3754('0x4'));var db=require(_0x3754('0x5'))['db'];var utils=require(_0x3754('0x6'));var logger=require(_0x3754('0x7'))(_0x3754('0x8'));var config=require(_0x3754('0x9'));var jayson=require(_0x3754('0xa'));var client=jayson[_0x3754('0xb')]['http']({'port':0x232a});config[_0x3754('0xc')]=_[_0x3754('0xd')](config[_0x3754('0xc')],{'host':_0x3754('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3754('0xc')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x323b21,_0x3efe5b,_0x5210aa){return new BPromise(function(_0x2e92ee,_0x456b40){return client[_0x3754('0xf')](_0x323b21,_0x5210aa)[_0x3754('0x10')](function(_0x77549b){logger['info'](_0x3754('0x11'),_0x3efe5b,'request\x20sent');logger[_0x3754('0x12')](_0x3754('0x13'),_0x3efe5b,_0x3754('0x14'),JSON['stringify'](_0x77549b));if(_0x77549b['error']){if(_0x77549b['error'][_0x3754('0x15')]===0x1f4){logger['error'](_0x3754('0x11'),_0x3efe5b,_0x77549b['error'][_0x3754('0x16')]);return _0x456b40(_0x77549b[_0x3754('0x17')]['message']);}logger[_0x3754('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3efe5b,_0x77549b[_0x3754('0x17')][_0x3754('0x16')]);return _0x2e92ee(_0x77549b[_0x3754('0x17')][_0x3754('0x16')]);}else{logger[_0x3754('0x18')](_0x3754('0x11'),_0x3efe5b,'request\x20sent');_0x2e92ee(_0x77549b[_0x3754('0x19')]['message']);}})[_0x3754('0x1a')](function(_0x52a811){logger[_0x3754('0x17')](_0x3754('0x11'),_0x3efe5b,_0x52a811);_0x456b40(_0x52a811);});});}exports['GetChatQueue']=function(_0x3e6e12){var _0x3562d8=this;return new Promise(function(_0x3149eb,_0x5762cc){return db[_0x3754('0x1b')][_0x3754('0x1c')]({'raw':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12[_0x3754('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12[_0x3754('0x1d')][_0x3754('0x1e')]||null:null,'attributes':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12[_0x3754('0x1d')][_0x3754('0x1f')]||null:null,'limit':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12['options'][_0x3754('0x20')]||null:null,'include':_0x3e6e12[_0x3754('0x1d')]?_0x3e6e12['options'][_0x3754('0x21')]?_[_0x3754('0x22')](_0x3e6e12[_0x3754('0x1d')][_0x3754('0x21')],function(_0x132a34){return{'model':db[_0x132a34[_0x3754('0x23')]],'as':_0x132a34['as'],'attributes':_0x132a34[_0x3754('0x1f')],'include':_0x132a34['include']?_[_0x3754('0x22')](_0x132a34[_0x3754('0x21')],function(_0x78f082){return{'model':db[_0x78f082[_0x3754('0x23')]],'as':_0x78f082['as'],'attributes':_0x78f082['attributes'],'include':_0x78f082[_0x3754('0x21')]?_[_0x3754('0x22')](_0x78f082[_0x3754('0x21')],function(_0x27a327){return{'model':db[_0x27a327[_0x3754('0x23')]],'as':_0x27a327['as'],'attributes':_0x27a327[_0x3754('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45215e){logger[_0x3754('0x18')](_0x3754('0x24'),_0x3e6e12);logger[_0x3754('0x12')](_0x3754('0x24'),_0x3e6e12,JSON[_0x3754('0x25')](_0x45215e));_0x3149eb(_0x45215e);})['catch'](function(_0x578958){logger[_0x3754('0x17')](_0x3754('0x24'),_0x578958[_0x3754('0x16')],_0x3e6e12);_0x5762cc(_0x3562d8['error'](0x1f4,_0x578958[_0x3754('0x16')]));});});};exports['ShowChatQueue']=function(_0x198532){var _0x136172=this;return new Promise(function(_0x8b4fc7,_0x2dff32){return db[_0x3754('0x1b')][_0x3754('0x26')]({'raw':_0x198532[_0x3754('0x1d')]?_0x198532['options'][_0x3754('0x27')]===undefined?!![]:![]:!![],'where':_0x198532['options']?_0x198532[_0x3754('0x1d')]['where']||null:null,'attributes':_0x198532[_0x3754('0x1d')]?_0x198532[_0x3754('0x1d')][_0x3754('0x1f')]||null:null,'include':_0x198532[_0x3754('0x1d')]?_0x198532[_0x3754('0x1d')]['include']?_[_0x3754('0x22')](_0x198532[_0x3754('0x1d')][_0x3754('0x21')],function(_0x45bcba){return{'model':db[_0x45bcba[_0x3754('0x23')]],'as':_0x45bcba['as'],'attributes':_0x45bcba[_0x3754('0x1f')],'include':_0x45bcba[_0x3754('0x21')]?_[_0x3754('0x22')](_0x45bcba[_0x3754('0x21')],function(_0xbef4d0){return{'model':db[_0xbef4d0[_0x3754('0x23')]],'as':_0xbef4d0['as'],'attributes':_0xbef4d0['attributes'],'include':_0xbef4d0[_0x3754('0x21')]?_[_0x3754('0x22')](_0xbef4d0[_0x3754('0x21')],function(_0x2d2353){return{'model':db[_0x2d2353[_0x3754('0x23')]],'as':_0x2d2353['as'],'attributes':_0x2d2353[_0x3754('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3754('0x10')](function(_0x988157){logger[_0x3754('0x18')](_0x3754('0x28'),_0x198532);logger[_0x3754('0x12')](_0x3754('0x28'),_0x198532,JSON[_0x3754('0x25')](_0x988157));_0x8b4fc7(_0x988157);})[_0x3754('0x1a')](function(_0x12d4ef){logger['error'](_0x3754('0x28'),_0x12d4ef[_0x3754('0x16')],_0x198532);_0x2dff32(_0x136172[_0x3754('0x17')](0x1f4,_0x12d4ef['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f6da5e2..031ece9 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(_0x53a97a,_0x3135e8){var _0x3ff3ff=function(_0xc59fc1){while(--_0xc59fc1){_0x53a97a['push'](_0x53a97a['shift']());}};_0x3ff3ff(++_0x3135e8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x49b3c5,_0x3ddf83){_0x49b3c5=_0x49b3c5-0x0;var _0x13f73b=_0x5f2f[_0x49b3c5];return _0x13f73b;};'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(_0x4e6fc7,_0x6b9a5d){var _0x3c2ef6=function(_0x3907ed){while(--_0x3907ed){_0x4e6fc7['push'](_0x4e6fc7['shift']());}};_0x3c2ef6(++_0x6b9a5d);}(_0xb10b,0x12a));var _0xbb10=function(_0x11f1cf,_0x4cee87){_0x11f1cf=_0x11f1cf-0x0;var _0x22695a=_0xb10b[_0x11f1cf];return _0x22695a;};'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 546a5ce..aae4ede 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 _0x45b2=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x291733,_0x5b5719){var _0x350029=function(_0x32af1d){while(--_0x32af1d){_0x291733['push'](_0x291733['shift']());}};_0x350029(++_0x5b5719);}(_0x45b2,0x13f));var _0x245b=function(_0x70dd2c,_0x4f81c6){_0x70dd2c=_0x70dd2c-0x0;var _0x1982ef=_0x45b2[_0x70dd2c];return _0x1982ef;};'use strict';var multer=require('multer');var util=require(_0x245b('0x0'));var path=require('path');var timeout=require(_0x245b('0x1'));var express=require('express');var router=express[_0x245b('0x2')]();var auth=require(_0x245b('0x3'));var interaction=require(_0x245b('0x4'));var config=require(_0x245b('0x5'));var controller=require(_0x245b('0x6'));router[_0x245b('0x7')]('/',auth[_0x245b('0x8')](),controller[_0x245b('0x9')]);router[_0x245b('0x7')](_0x245b('0xa'),auth[_0x245b('0x8')](),controller['describe']);router['get'](_0x245b('0xb'),auth['isAuthenticated'](),controller[_0x245b('0xc')]);router[_0x245b('0x7')](_0x245b('0xd'),auth[_0x245b('0x8')](),controller[_0x245b('0xe')]);router[_0x245b('0x7')](_0x245b('0xf'),auth[_0x245b('0x8')](),controller[_0x245b('0x10')]);router[_0x245b('0x7')](_0x245b('0x11'),auth['isAuthenticated'](),controller[_0x245b('0x12')]);router['post']('/',auth[_0x245b('0x8')](),controller[_0x245b('0x13')]);router[_0x245b('0x14')](_0x245b('0xf'),auth[_0x245b('0x8')](),controller[_0x245b('0x15')]);router['post']('/:id/users',auth[_0x245b('0x8')](),controller[_0x245b('0x16')]);router[_0x245b('0x17')](_0x245b('0xb'),auth[_0x245b('0x8')](),controller[_0x245b('0x18')]);router[_0x245b('0x19')](_0x245b('0xb'),auth[_0x245b('0x8')](),controller[_0x245b('0x1a')]);router[_0x245b('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x245b('0x1b')]);router[_0x245b('0x19')]('/:id/users',auth[_0x245b('0x8')](),controller[_0x245b('0x1c')]);module[_0x245b('0x1d')]=router; \ No newline at end of file +var _0xd68a=['../../config/environment','./chatQueue.controller','get','index','/describe','isAuthenticated','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','update','destroy','removeTeams','delete','/:id/users','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4e5ebc,_0x3c48bc){var _0x4de422=function(_0x1ff877){while(--_0x1ff877){_0x4e5ebc['push'](_0x4e5ebc['shift']());}};_0x4de422(++_0x3c48bc);}(_0xd68a,0xc3));var _0xad68=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xd68a[_0x1fc122];return _0xa2cb13;};'use strict';var multer=require(_0xad68('0x0'));var util=require(_0xad68('0x1'));var path=require(_0xad68('0x2'));var timeout=require(_0xad68('0x3'));var express=require(_0xad68('0x4'));var router=express[_0xad68('0x5')]();var auth=require(_0xad68('0x6'));var interaction=require(_0xad68('0x7'));var config=require(_0xad68('0x8'));var controller=require(_0xad68('0x9'));router[_0xad68('0xa')]('/',auth['isAuthenticated'](),controller[_0xad68('0xb')]);router[_0xad68('0xa')](_0xad68('0xc'),auth[_0xad68('0xd')](),controller['describe']);router[_0xad68('0xa')](_0xad68('0xe'),auth['isAuthenticated'](),controller[_0xad68('0xf')]);router[_0xad68('0xa')]('/:id/members',auth[_0xad68('0xd')](),controller[_0xad68('0x10')]);router[_0xad68('0xa')](_0xad68('0x11'),auth[_0xad68('0xd')](),controller[_0xad68('0x12')]);router[_0xad68('0xa')]('/:id/users',auth[_0xad68('0xd')](),controller[_0xad68('0x13')]);router[_0xad68('0x14')]('/',auth[_0xad68('0xd')](),controller[_0xad68('0x15')]);router[_0xad68('0x14')]('/:id/teams',auth[_0xad68('0xd')](),controller[_0xad68('0x16')]);router[_0xad68('0x14')]('/:id/users',auth[_0xad68('0xd')](),controller['addAgents']);router['put'](_0xad68('0xe'),auth['isAuthenticated'](),controller[_0xad68('0x17')]);router['delete'](_0xad68('0xe'),auth[_0xad68('0xd')](),controller[_0xad68('0x18')]);router['delete'](_0xad68('0x11'),auth[_0xad68('0xd')](),controller[_0xad68('0x19')]);router[_0xad68('0x1a')](_0xad68('0x1b'),auth[_0xad68('0xd')](),controller['removeAgents']);module[_0xad68('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index ce8565e..dd84288 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 _0xba0f=['sequelize','exports','STRING','DATE'];(function(_0x31154d,_0x375ed2){var _0x26ba70=function(_0x183ec8){while(--_0x183ec8){_0x31154d['push'](_0x31154d['shift']());}};_0x26ba70(++_0x375ed2);}(_0xba0f,0xbc));var _0xfba0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xba0f[_0x2641f9];return _0x585741;};'use strict';var moment=require('moment');var Sequelize=require(_0xfba0('0x0'));module[_0xfba0('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xfba0('0x2')]},'joinAt':{'type':Sequelize[_0xfba0('0x3')]},'leaveAt':{'type':Sequelize[_0xfba0('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfba0('0x3')]},'reason':{'type':Sequelize[_0xfba0('0x2')]}}; \ No newline at end of file +var _0xddea=['exports','STRING','DATE','sequelize'];(function(_0x241d9c,_0x37d233){var _0x3783d4=function(_0x3f466e){while(--_0x3f466e){_0x241d9c['push'](_0x241d9c['shift']());}};_0x3783d4(++_0x37d233);}(_0xddea,0x1bb));var _0xadde=function(_0x45d9ad,_0x552dfd){_0x45d9ad=_0x45d9ad-0x0;var _0x41c3bc=_0xddea[_0x45d9ad];return _0x41c3bc;};'use strict';var moment=require('moment');var Sequelize=require(_0xadde('0x0'));module[_0xadde('0x1')]={'uniqueid':{'type':Sequelize[_0xadde('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xadde('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xadde('0x3')]},'acceptAt':{'type':Sequelize[_0xadde('0x3')]},'exitAt':{'type':Sequelize[_0xadde('0x3')]},'reason':{'type':Sequelize[_0xadde('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 1e2838c..2a081fa 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 _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','ChatQueueReport','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(_0x41ba9d,_0x35a56d){var _0x4b97a0=function(_0x307a3e){while(--_0x307a3e){_0x41ba9d['push'](_0x41ba9d['shift']());}};_0x4b97a0(++_0x35a56d);}(_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['ChatQueueReport'][_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['ChatQueueReport']['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['ChatQueueReport'][_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 +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(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x757a,0xde));var _0xa757=function(_0x14880b,_0x469d19){_0x14880b=_0x14880b-0x0;var _0x3330ee=_0x757a[_0x14880b];return _0x3330ee;};'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 diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 88dadaa..bc8f89a 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 _0x2109=['util','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','uniqueid'];(function(_0x13dd25,_0x5f0274){var _0x4663f7=function(_0x28b867){while(--_0x28b867){_0x13dd25['push'](_0x13dd25['shift']());}};_0x4663f7(++_0x5f0274);}(_0x2109,0x150));var _0x9210=function(_0xdd1908,_0x2e077e){_0xdd1908=_0xdd1908-0x0;var _0x48ab86=_0x2109[_0xdd1908];return _0x48ab86;};'use strict';var _=require('lodash');var util=require(_0x9210('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9210('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9210('0x2'));var config=require(_0x9210('0x3'));var attributes=require(_0x9210('0x4'));module[_0x9210('0x5')]=function(_0x5454de,_0x11863a){return _0x5454de['define']('ChatQueueReport',attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x9210('0x6'),'fields':[_0x9210('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b16=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','uniqueid'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x6b16,0x1c3));var _0x66b1=function(_0x531d15,_0x599af5){_0x531d15=_0x531d15-0x0;var _0x271a18=_0x6b16[_0x531d15];return _0x271a18;};'use strict';var _=require(_0x66b1('0x0'));var util=require(_0x66b1('0x1'));var logger=require(_0x66b1('0x2'))(_0x66b1('0x3'));var moment=require('moment');var BPromise=require(_0x66b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66b1('0x5'));var rimraf=require(_0x66b1('0x6'));var config=require(_0x66b1('0x7'));var attributes=require('./chatQueueReport.attributes');module[_0x66b1('0x8')]=function(_0xb96e49,_0x597402){return _0xb96e49[_0x66b1('0x9')]('ChatQueueReport',attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x66b1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 676910e..48727d2 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 _0xd9a4=['info','catch','ChatQueueReport','create','body','raw','CreateChatQueueReport','UpdateChatQueueReport','update','options','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b0135,_0x5e8c54){var _0x3ec7fd=function(_0x5a2006){while(--_0x5a2006){_0x4b0135['push'](_0x4b0135['shift']());}};_0x3ec7fd(++_0x5e8c54);}(_0xd9a4,0x136));var _0x4d9a=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xd9a4[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0x4d9a('0x0'));var util=require(_0x4d9a('0x1'));var moment=require(_0x4d9a('0x2'));var BPromise=require(_0x4d9a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d9a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4d9a('0x5'))(_0x4d9a('0x6'));var config=require('../../config/environment');var jayson=require(_0x4d9a('0x7'));var client=jayson[_0x4d9a('0x8')][_0x4d9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x316d61,_0x46ceb4,_0x458eb6){return new BPromise(function(_0x2c7354,_0x3f7283){return client[_0x4d9a('0xa')](_0x316d61,_0x458eb6)[_0x4d9a('0xb')](function(_0x57f745){logger['info'](_0x4d9a('0xc'),_0x46ceb4,_0x4d9a('0xd'));logger[_0x4d9a('0xe')](_0x4d9a('0xf'),_0x46ceb4,_0x4d9a('0xd'),JSON[_0x4d9a('0x10')](_0x57f745));if(_0x57f745[_0x4d9a('0x11')]){if(_0x57f745[_0x4d9a('0x11')][_0x4d9a('0x12')]===0x1f4){logger[_0x4d9a('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x46ceb4,_0x57f745[_0x4d9a('0x11')][_0x4d9a('0x13')]);return _0x3f7283(_0x57f745[_0x4d9a('0x11')]['message']);}logger['error'](_0x4d9a('0xc'),_0x46ceb4,_0x57f745[_0x4d9a('0x11')][_0x4d9a('0x13')]);return _0x2c7354(_0x57f745['error'][_0x4d9a('0x13')]);}else{logger[_0x4d9a('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x46ceb4,_0x4d9a('0xd'));_0x2c7354(_0x57f745['result'][_0x4d9a('0x13')]);}})[_0x4d9a('0x15')](function(_0x3933ff){logger[_0x4d9a('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x46ceb4,_0x3933ff);_0x3f7283(_0x3933ff);});});}exports['CreateChatQueueReport']=function(_0x4bbf93){var _0x480291=this;return new Promise(function(_0xde6bd4,_0x3c70a4){return db[_0x4d9a('0x16')][_0x4d9a('0x17')](_0x4bbf93[_0x4d9a('0x18')],{'raw':_0x4bbf93['options']?_0x4bbf93['options'][_0x4d9a('0x19')]===undefined?!![]:![]:!![]})[_0x4d9a('0xb')](function(_0x3ee818){logger[_0x4d9a('0x14')](_0x4d9a('0x1a'),_0x4bbf93);logger[_0x4d9a('0xe')](_0x4d9a('0x1a'),_0x4bbf93,JSON[_0x4d9a('0x10')](_0x3ee818));_0xde6bd4(_0x3ee818);})[_0x4d9a('0x15')](function(_0x1a1849){logger[_0x4d9a('0x11')](_0x4d9a('0x1a'),_0x1a1849[_0x4d9a('0x13')],_0x4bbf93);_0x3c70a4(_0x480291[_0x4d9a('0x11')](0x1f4,_0x1a1849[_0x4d9a('0x13')]));});});};exports[_0x4d9a('0x1b')]=function(_0x5b2469){var _0x374cfc=this;return new Promise(function(_0x2146fd,_0x3dc481){return db[_0x4d9a('0x16')][_0x4d9a('0x1c')](_0x5b2469[_0x4d9a('0x18')],{'raw':_0x5b2469[_0x4d9a('0x1d')]?_0x5b2469[_0x4d9a('0x1d')][_0x4d9a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b2469[_0x4d9a('0x1d')]?_0x5b2469[_0x4d9a('0x1d')][_0x4d9a('0x1e')]||null:null,'attributes':_0x5b2469[_0x4d9a('0x1d')]?_0x5b2469[_0x4d9a('0x1d')][_0x4d9a('0x1f')]||null:null,'limit':_0x5b2469[_0x4d9a('0x1d')]?_0x5b2469['options'][_0x4d9a('0x20')]||null:null})[_0x4d9a('0xb')](function(_0xbca9a5){logger[_0x4d9a('0x14')](_0x4d9a('0x1b'),_0x5b2469);logger[_0x4d9a('0xe')](_0x4d9a('0x1b'),_0x5b2469,JSON[_0x4d9a('0x10')](_0xbca9a5));_0x2146fd(_0xbca9a5);})[_0x4d9a('0x15')](function(_0x56a355){logger[_0x4d9a('0x11')]('UpdateChatQueueReport',_0x56a355[_0x4d9a('0x13')],_0x5b2469);_0x3dc481(_0x374cfc['error'](0x1f4,_0x56a355['message']));});});}; \ No newline at end of file +var _0x68e4=['UpdateChatQueueReport','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatQueueReport','ChatQueueReport','options','raw','stringify','catch','update','where'];(function(_0x27bfef,_0x10fe6e){var _0x3c67c6=function(_0x5d894e){while(--_0x5d894e){_0x27bfef['push'](_0x27bfef['shift']());}};_0x3c67c6(++_0x10fe6e);}(_0x68e4,0x97));var _0x468e=function(_0x3bb25a,_0x38441f){_0x3bb25a=_0x3bb25a-0x0;var _0xa89ae4=_0x68e4[_0x3bb25a];return _0xa89ae4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x468e('0x0'));var BPromise=require(_0x468e('0x1'));var rs=require(_0x468e('0x2'));var fs=require('fs');var Redis=require(_0x468e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x468e('0x4'));var logger=require('../../config/logger')(_0x468e('0x5'));var config=require(_0x468e('0x6'));var jayson=require(_0x468e('0x7'));var client=jayson[_0x468e('0x8')][_0x468e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a3eee,_0x24bdcd,_0x429cf5){return new BPromise(function(_0x9200f8,_0x4dadd8){return client[_0x468e('0xa')](_0x5a3eee,_0x429cf5)[_0x468e('0xb')](function(_0x5d78a7){logger[_0x468e('0xc')](_0x468e('0xd'),_0x24bdcd,_0x468e('0xe'));logger[_0x468e('0xf')](_0x468e('0x10'),_0x24bdcd,'request\x20sent',JSON['stringify'](_0x5d78a7));if(_0x5d78a7[_0x468e('0x11')]){if(_0x5d78a7[_0x468e('0x11')][_0x468e('0x12')]===0x1f4){logger[_0x468e('0x11')](_0x468e('0xd'),_0x24bdcd,_0x5d78a7[_0x468e('0x11')][_0x468e('0x13')]);return _0x4dadd8(_0x5d78a7['error'][_0x468e('0x13')]);}logger[_0x468e('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x24bdcd,_0x5d78a7[_0x468e('0x11')][_0x468e('0x13')]);return _0x9200f8(_0x5d78a7[_0x468e('0x11')][_0x468e('0x13')]);}else{logger[_0x468e('0xc')](_0x468e('0xd'),_0x24bdcd,_0x468e('0xe'));_0x9200f8(_0x5d78a7[_0x468e('0x14')][_0x468e('0x13')]);}})['catch'](function(_0x3bbe0b){logger[_0x468e('0x11')](_0x468e('0xd'),_0x24bdcd,_0x3bbe0b);_0x4dadd8(_0x3bbe0b);});});}exports[_0x468e('0x15')]=function(_0x2aba78){var _0x5a1e2c=this;return new Promise(function(_0x3e2a4c,_0x3ee86d){return db[_0x468e('0x16')]['create'](_0x2aba78['body'],{'raw':_0x2aba78[_0x468e('0x17')]?_0x2aba78['options'][_0x468e('0x18')]===undefined?!![]:![]:!![]})[_0x468e('0xb')](function(_0x2c02f6){logger[_0x468e('0xc')]('CreateChatQueueReport',_0x2aba78);logger[_0x468e('0xf')]('CreateChatQueueReport',_0x2aba78,JSON[_0x468e('0x19')](_0x2c02f6));_0x3e2a4c(_0x2c02f6);})[_0x468e('0x1a')](function(_0x18a86a){logger['error']('CreateChatQueueReport',_0x18a86a[_0x468e('0x13')],_0x2aba78);_0x3ee86d(_0x5a1e2c[_0x468e('0x11')](0x1f4,_0x18a86a[_0x468e('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0xbdbd4c){var _0x515930=this;return new Promise(function(_0xf68387,_0x45daf3){return db[_0x468e('0x16')][_0x468e('0x1b')](_0xbdbd4c['body'],{'raw':_0xbdbd4c[_0x468e('0x17')]?_0xbdbd4c[_0x468e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbdbd4c[_0x468e('0x17')]?_0xbdbd4c['options'][_0x468e('0x1c')]||null:null,'attributes':_0xbdbd4c[_0x468e('0x17')]?_0xbdbd4c['options']['attributes']||null:null,'limit':_0xbdbd4c['options']?_0xbdbd4c[_0x468e('0x17')]['limit']||null:null})[_0x468e('0xb')](function(_0x1c52c3){logger[_0x468e('0xc')](_0x468e('0x1d'),_0xbdbd4c);logger[_0x468e('0xf')]('UpdateChatQueueReport',_0xbdbd4c,JSON[_0x468e('0x19')](_0x1c52c3));_0xf68387(_0x1c52c3);})['catch'](function(_0x5eb998){logger[_0x468e('0x11')](_0x468e('0x1d'),_0x5eb998['message'],_0xbdbd4c);_0x45daf3(_0x515930[_0x468e('0x11')](0x1f4,_0x5eb998[_0x468e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 86dc53d..64437c5 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 _0xdcab=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x467da9,_0x511e26){var _0x3cdb78=function(_0x85983){while(--_0x85983){_0x467da9['push'](_0x467da9['shift']());}};_0x3cdb78(++_0x511e26);}(_0xdcab,0x79));var _0xbdca=function(_0x46cd52,_0x4bfc02){_0x46cd52=_0x46cd52-0x0;var _0x2aa522=_0xdcab[_0x46cd52];return _0x2aa522;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbdca('0x0'));var timeout=require(_0xbdca('0x1'));var express=require(_0xbdca('0x2'));var router=express[_0xbdca('0x3')]();var auth=require(_0xbdca('0x4'));var interaction=require(_0xbdca('0x5'));var config=require(_0xbdca('0x6'));var controller=require(_0xbdca('0x7'));router[_0xbdca('0x8')]('/',auth[_0xbdca('0x9')](),controller['index']);router[_0xbdca('0x8')](_0xbdca('0xa'),auth[_0xbdca('0x9')](),controller[_0xbdca('0xb')]);router[_0xbdca('0x8')](_0xbdca('0xc'),auth[_0xbdca('0x9')](),controller[_0xbdca('0xd')]);router[_0xbdca('0xe')]('/',auth['isAuthenticated'](),controller[_0xbdca('0xf')]);router[_0xbdca('0x10')]('/:id',auth[_0xbdca('0x9')](),controller[_0xbdca('0x11')]);router[_0xbdca('0x12')](_0xbdca('0xc'),auth[_0xbdca('0x9')](),controller[_0xbdca('0x13')]);module[_0xbdca('0x14')]=router; \ No newline at end of file +var _0x52ee=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1cc8a2,_0x5dce88){var _0xadb7a6=function(_0x385f03){while(--_0x385f03){_0x1cc8a2['push'](_0x1cc8a2['shift']());}};_0xadb7a6(++_0x5dce88);}(_0x52ee,0x118));var _0xe52e=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0x52ee[_0xf97eb0];return _0xea70f4;};'use strict';var multer=require(_0xe52e('0x0'));var util=require(_0xe52e('0x1'));var path=require(_0xe52e('0x2'));var timeout=require(_0xe52e('0x3'));var express=require(_0xe52e('0x4'));var router=express[_0xe52e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe52e('0x6'));var config=require(_0xe52e('0x7'));var controller=require(_0xe52e('0x8'));router[_0xe52e('0x9')]('/',auth['isAuthenticated'](),controller[_0xe52e('0xa')]);router[_0xe52e('0x9')](_0xe52e('0xb'),auth[_0xe52e('0xc')](),controller[_0xe52e('0xd')]);router['get'](_0xe52e('0xe'),auth['isAuthenticated'](),controller[_0xe52e('0xf')]);router[_0xe52e('0x10')]('/',auth[_0xe52e('0xc')](),controller[_0xe52e('0x11')]);router[_0xe52e('0x12')](_0xe52e('0xe'),auth[_0xe52e('0xc')](),controller['update']);router[_0xe52e('0x13')](_0xe52e('0xe'),auth[_0xe52e('0xc')](),controller[_0xe52e('0x14')]);module[_0xe52e('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index e255723..dbcc16f 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 _0x4ccc=['STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x46faa7,_0x1a0f99){var _0x428fd0=function(_0x3a620a){while(--_0x3a620a){_0x46faa7['push'](_0x46faa7['shift']());}};_0x428fd0(++_0x1a0f99);}(_0x4ccc,0x73));var _0xc4cc=function(_0x1f4dd5,_0x439ec1){_0x1f4dd5=_0x1f4dd5-0x0;var _0x2976d7=_0x4ccc[_0x1f4dd5];return _0x2976d7;};'use strict';var moment=require(_0xc4cc('0x0'));var Sequelize=require(_0xc4cc('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc4cc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc4cc('0x3')](_0xc4cc('0x4'),_0xc4cc('0x5'),_0xc4cc('0x6')),'allowNull':![],'defaultValue':_0xc4cc('0x6')},'transferredAt':{'type':Sequelize[_0xc4cc('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc4cc('0x8')]}}; \ No newline at end of file +var _0x38f1=['sequelize','ENUM','agent','queue','DATE','NOW'];(function(_0x2697c0,_0x4efeff){var _0x421db=function(_0x158293){while(--_0x158293){_0x2697c0['push'](_0x2697c0['shift']());}};_0x421db(++_0x4efeff);}(_0x38f1,0xb4));var _0x138f=function(_0x1633b3,_0x2d84af){_0x1633b3=_0x1633b3-0x0;var _0x149a74=_0x38f1[_0x1633b3];return _0x149a74;};'use strict';var moment=require('moment');var Sequelize=require(_0x138f('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x138f('0x1')]('account',_0x138f('0x2'),_0x138f('0x3')),'allowNull':![],'defaultValue':_0x138f('0x3')},'transferredAt':{'type':Sequelize[_0x138f('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x138f('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 2822290..5389ed2 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 _0x6946=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','merge','options','ChatTransferReport','count','then','includeAll','include','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6946,0x1bb));var _0x6694=function(_0x2b39ad,_0x149888){_0x2b39ad=_0x2b39ad-0x0;var _0x18e421=_0x6946[_0x2b39ad];return _0x18e421;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6694('0x0'));var rimraf=require(_0x6694('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6694('0x2'));var rp=require('request-promise');var moment=require(_0x6694('0x3'));var BPromise=require(_0x6694('0x4'));var Mustache=require(_0x6694('0x5'));var util=require(_0x6694('0x6'));var path=require(_0x6694('0x7'));var sox=require(_0x6694('0x8'));var csv=require('to-csv');var ejs=require(_0x6694('0x9'));var fs=require('fs');var _=require(_0x6694('0xa'));var squel=require(_0x6694('0xb'));var crypto=require(_0x6694('0xc'));var jsforce=require(_0x6694('0xd'));var deskjs=require(_0x6694('0xe'));var toCsv=require(_0x6694('0xf'));var querystring=require(_0x6694('0x10'));var Papa=require(_0x6694('0x11'));var Redis=require(_0x6694('0x12'));var authService=require(_0x6694('0x13'));var qs=require(_0x6694('0x14'));var as=require(_0x6694('0x15'));var hardwareService=require(_0x6694('0x16'));var logger=require(_0x6694('0x17'))(_0x6694('0x18'));var utils=require(_0x6694('0x19'));var config=require(_0x6694('0x1a'));var db=require(_0x6694('0x1b'))['db'];function respondWithStatusCode(_0x21f665,_0x13882a){_0x13882a=_0x13882a||0xcc;return function(_0xfe1e28){if(_0xfe1e28){return _0x21f665[_0x6694('0x1c')](_0x13882a);}return _0x21f665[_0x6694('0x1d')](_0x13882a)['end']();};}function respondWithResult(_0x3e2d25,_0xda844f){_0xda844f=_0xda844f||0xc8;return function(_0x173105){if(_0x173105){return _0x3e2d25[_0x6694('0x1d')](_0xda844f)[_0x6694('0x1e')](_0x173105);}};}function respondWithFilteredResult(_0x14dd3e,_0x91d969){return function(_0x2c3c7a){if(_0x2c3c7a){var _0x52e391=_0x2c3c7a['count'],_0x1c46d7=_0x91d969[_0x6694('0x1f')],_0x4fa341=_0x91d969['offset']+_0x91d969['limit'],_0x53d26b;if(_0x4fa341>=_0x52e391){_0x4fa341=_0x52e391;_0x53d26b=0xc8;}else{_0x53d26b=0xce;}_0x14dd3e[_0x6694('0x1d')](_0x53d26b);return _0x14dd3e[_0x6694('0x20')](_0x6694('0x21'),_0x1c46d7+'-'+_0x4fa341+'/'+_0x52e391)['json'](_0x2c3c7a);}return null;};}function patchUpdates(_0x251961){return function(_0x4ee2ca){try{jsonpatch[_0x6694('0x22')](_0x4ee2ca,_0x251961,!![]);}catch(_0x161dce){return BPromise[_0x6694('0x23')](_0x161dce);}return _0x4ee2ca[_0x6694('0x24')]();};}function saveUpdates(_0xa3934d,_0x38e672){return function(_0x3c55cc){if(_0x3c55cc){return _0x3c55cc[_0x6694('0x25')](_0xa3934d)['then'](function(_0x352c6a){return _0x352c6a;});}return null;};}function removeEntity(_0x27b8b0,_0x2acea3){return function(_0x32ab1a){if(_0x32ab1a){return _0x32ab1a[_0x6694('0x26')]()['then'](function(){_0x27b8b0[_0x6694('0x1d')](0xcc)[_0x6694('0x27')]();});}};}function handleEntityNotFound(_0x3bfb1c,_0x3e809f){return function(_0x1a37d5){if(!_0x1a37d5){_0x3bfb1c[_0x6694('0x1c')](0x194);}return _0x1a37d5;};}function handleError(_0x4a0f71,_0x211209){_0x211209=_0x211209||0x1f4;return function(_0x347ecc){logger[_0x6694('0x28')](_0x347ecc[_0x6694('0x29')]);if(_0x347ecc[_0x6694('0x2a')]){delete _0x347ecc['name'];}_0x4a0f71['status'](_0x211209)[_0x6694('0x2b')](_0x347ecc);};}exports['index']=function(_0x1fd095,_0xdb810b){var _0x2b0530={},_0x321d3e={},_0x451580={'count':0x0,'rows':[]};var _0x141271=_[_0x6694('0x2c')](db['ChatTransferReport'][_0x6694('0x2d')],function(_0x42f9a4){return{'name':_0x42f9a4[_0x6694('0x2e')],'type':_0x42f9a4['type'][_0x6694('0x2f')]};});_0x321d3e['model']=_['map'](_0x141271,_0x6694('0x2a'));_0x321d3e[_0x6694('0x30')]=_[_0x6694('0x31')](_0x1fd095['query']);_0x321d3e[_0x6694('0x32')]=_[_0x6694('0x33')](_0x321d3e[_0x6694('0x34')],_0x321d3e[_0x6694('0x30')]);_0x2b0530[_0x6694('0x35')]=_['intersection'](_0x321d3e[_0x6694('0x34')],qs[_0x6694('0x36')](_0x1fd095[_0x6694('0x30')][_0x6694('0x36')]));_0x2b0530[_0x6694('0x35')]=_0x2b0530[_0x6694('0x35')][_0x6694('0x37')]?_0x2b0530[_0x6694('0x35')]:_0x321d3e[_0x6694('0x34')];if(!_0x1fd095[_0x6694('0x30')][_0x6694('0x38')](_0x6694('0x39'))){_0x2b0530[_0x6694('0x3a')]=qs['limit'](_0x1fd095[_0x6694('0x30')]['limit']);_0x2b0530[_0x6694('0x1f')]=qs['offset'](_0x1fd095[_0x6694('0x30')]['offset']);}_0x2b0530['order']=qs[_0x6694('0x3b')](_0x1fd095['query'][_0x6694('0x3b')]);_0x2b0530[_0x6694('0x3c')]=qs[_0x6694('0x32')](_[_0x6694('0x3d')](_0x1fd095[_0x6694('0x30')],_0x321d3e[_0x6694('0x32')]),_0x141271);if(_0x1fd095[_0x6694('0x30')][_0x6694('0x3e')]){_0x2b0530['where']=_['merge'](_0x2b0530[_0x6694('0x3c')],{'$or':_[_0x6694('0x2c')](_0x141271,function(_0xcde535){if(_0xcde535[_0x6694('0x3f')]!=='VIRTUAL'){var _0xae1dcf={};_0xae1dcf[_0xcde535['name']]={'$like':'%'+_0x1fd095[_0x6694('0x30')][_0x6694('0x3e')]+'%'};return _0xae1dcf;}})});}_0x2b0530=_[_0x6694('0x40')]({},_0x2b0530,_0x1fd095[_0x6694('0x41')]);var _0x229229={'where':_0x2b0530[_0x6694('0x3c')]};return db[_0x6694('0x42')][_0x6694('0x43')](_0x229229)[_0x6694('0x44')](function(_0x457086){_0x451580['count']=_0x457086;if(_0x1fd095[_0x6694('0x30')][_0x6694('0x45')]){_0x2b0530[_0x6694('0x46')]=[{'all':!![]}];}return db[_0x6694('0x42')]['findAll'](_0x2b0530);})['then'](function(_0x32ff83){_0x451580['rows']=_0x32ff83;return _0x451580;})[_0x6694('0x44')](respondWithFilteredResult(_0xdb810b,_0x2b0530))[_0x6694('0x47')](handleError(_0xdb810b,null));};exports['show']=function(_0x3ac1e1,_0x23388d){var _0x55f64c={'raw':!![],'where':{'id':_0x3ac1e1[_0x6694('0x48')]['id']}},_0xee0290={};_0xee0290['model']=_[_0x6694('0x31')](db[_0x6694('0x42')]['rawAttributes']);_0xee0290['query']=_[_0x6694('0x31')](_0x3ac1e1['query']);_0xee0290['filters']=_['intersection'](_0xee0290[_0x6694('0x34')],_0xee0290[_0x6694('0x30')]);_0x55f64c[_0x6694('0x35')]=_[_0x6694('0x33')](_0xee0290['model'],qs['fields'](_0x3ac1e1[_0x6694('0x30')][_0x6694('0x36')]));_0x55f64c[_0x6694('0x35')]=_0x55f64c[_0x6694('0x35')]['length']?_0x55f64c[_0x6694('0x35')]:_0xee0290['model'];if(_0x3ac1e1['query'][_0x6694('0x45')]){_0x55f64c[_0x6694('0x46')]=[{'all':!![]}];}_0x55f64c=_['merge']({},_0x55f64c,_0x3ac1e1[_0x6694('0x41')]);return db['ChatTransferReport'][_0x6694('0x49')](_0x55f64c)[_0x6694('0x44')](handleEntityNotFound(_0x23388d,null))[_0x6694('0x44')](respondWithResult(_0x23388d,null))[_0x6694('0x47')](handleError(_0x23388d,null));};exports[_0x6694('0x4a')]=function(_0x4067b1,_0x5ae9f1){return db[_0x6694('0x42')][_0x6694('0x4a')](_0x4067b1['body'],{})[_0x6694('0x44')](respondWithResult(_0x5ae9f1,0xc9))[_0x6694('0x47')](handleError(_0x5ae9f1,null));};exports[_0x6694('0x25')]=function(_0x44cafa,_0xe9e6a0){if(_0x44cafa['body']['id']){delete _0x44cafa[_0x6694('0x4b')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x44cafa[_0x6694('0x48')]['id']}})[_0x6694('0x44')](handleEntityNotFound(_0xe9e6a0,null))[_0x6694('0x44')](saveUpdates(_0x44cafa['body'],null))[_0x6694('0x44')](respondWithResult(_0xe9e6a0,null))[_0x6694('0x47')](handleError(_0xe9e6a0,null));};exports[_0x6694('0x26')]=function(_0x2d9b18,_0xf4a632){return db[_0x6694('0x42')]['find']({'where':{'id':_0x2d9b18[_0x6694('0x48')]['id']}})[_0x6694('0x44')](handleEntityNotFound(_0xf4a632,null))['then'](removeEntity(_0xf4a632,null))[_0x6694('0x47')](handleError(_0xf4a632,null));};exports[_0x6694('0x4c')]=function(_0x46dfab,_0x289221){return db[_0x6694('0x42')]['describe']()['then'](respondWithResult(_0x289221,null))[_0x6694('0x47')](handleError(_0x289221,null));}; \ No newline at end of file +var _0xed54=['sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../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','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x265b74,_0x48f89d){var _0x2676b1=function(_0x3db713){while(--_0x3db713){_0x265b74['push'](_0x265b74['shift']());}};_0x2676b1(++_0x48f89d);}(_0xed54,0x198));var _0x4ed5=function(_0x1a5d6b,_0x5b14e1){_0x1a5d6b=_0x1a5d6b-0x0;var _0x5c80ee=_0xed54[_0x1a5d6b];return _0x5c80ee;};'use strict';var pdf=require(_0x4ed5('0x0'));var emlformat=require(_0x4ed5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4ed5('0x2'));var jsonpatch=require(_0x4ed5('0x3'));var rp=require(_0x4ed5('0x4'));var moment=require(_0x4ed5('0x5'));var BPromise=require(_0x4ed5('0x6'));var Mustache=require(_0x4ed5('0x7'));var util=require('util');var path=require(_0x4ed5('0x8'));var sox=require(_0x4ed5('0x9'));var csv=require(_0x4ed5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4ed5('0xb'));var squel=require(_0x4ed5('0xc'));var crypto=require(_0x4ed5('0xd'));var jsforce=require(_0x4ed5('0xe'));var deskjs=require(_0x4ed5('0xf'));var toCsv=require(_0x4ed5('0xa'));var querystring=require(_0x4ed5('0x10'));var Papa=require(_0x4ed5('0x11'));var Redis=require(_0x4ed5('0x12'));var authService=require(_0x4ed5('0x13'));var qs=require(_0x4ed5('0x14'));var as=require(_0x4ed5('0x15'));var hardwareService=require(_0x4ed5('0x16'));var logger=require(_0x4ed5('0x17'))(_0x4ed5('0x18'));var utils=require(_0x4ed5('0x19'));var config=require('../../config/environment');var db=require(_0x4ed5('0x1a'))['db'];function respondWithStatusCode(_0x271d5f,_0x199074){_0x199074=_0x199074||0xcc;return function(_0x1d7925){if(_0x1d7925){return _0x271d5f[_0x4ed5('0x1b')](_0x199074);}return _0x271d5f[_0x4ed5('0x1c')](_0x199074)[_0x4ed5('0x1d')]();};}function respondWithResult(_0x4cc88e,_0x4379ed){_0x4379ed=_0x4379ed||0xc8;return function(_0x4dd089){if(_0x4dd089){return _0x4cc88e['status'](_0x4379ed)[_0x4ed5('0x1e')](_0x4dd089);}};}function respondWithFilteredResult(_0x44e6d7,_0x25e337){return function(_0xe8b1dc){if(_0xe8b1dc){var _0x53058d=_0xe8b1dc[_0x4ed5('0x1f')],_0x445946=_0x25e337[_0x4ed5('0x20')],_0x2458f7=_0x25e337[_0x4ed5('0x20')]+_0x25e337[_0x4ed5('0x21')],_0x2da38d;if(_0x2458f7>=_0x53058d){_0x2458f7=_0x53058d;_0x2da38d=0xc8;}else{_0x2da38d=0xce;}_0x44e6d7[_0x4ed5('0x1c')](_0x2da38d);return _0x44e6d7[_0x4ed5('0x22')](_0x4ed5('0x23'),_0x445946+'-'+_0x2458f7+'/'+_0x53058d)[_0x4ed5('0x1e')](_0xe8b1dc);}return null;};}function patchUpdates(_0x563c4a){return function(_0xa70222){try{jsonpatch[_0x4ed5('0x24')](_0xa70222,_0x563c4a,!![]);}catch(_0xf27cc2){return BPromise[_0x4ed5('0x25')](_0xf27cc2);}return _0xa70222[_0x4ed5('0x26')]();};}function saveUpdates(_0x2c2854,_0x4ff642){return function(_0x3aa782){if(_0x3aa782){return _0x3aa782[_0x4ed5('0x27')](_0x2c2854)[_0x4ed5('0x28')](function(_0x18007d){return _0x18007d;});}return null;};}function removeEntity(_0x4e1533,_0x449676){return function(_0x4b6eff){if(_0x4b6eff){return _0x4b6eff[_0x4ed5('0x29')]()[_0x4ed5('0x28')](function(){_0x4e1533[_0x4ed5('0x1c')](0xcc)[_0x4ed5('0x1d')]();});}};}function handleEntityNotFound(_0x313a5d,_0x153219){return function(_0x51a864){if(!_0x51a864){_0x313a5d[_0x4ed5('0x1b')](0x194);}return _0x51a864;};}function handleError(_0x33e428,_0x3d32c5){_0x3d32c5=_0x3d32c5||0x1f4;return function(_0x13ccdc){logger[_0x4ed5('0x2a')](_0x13ccdc[_0x4ed5('0x2b')]);if(_0x13ccdc['name']){delete _0x13ccdc[_0x4ed5('0x2c')];}_0x33e428['status'](_0x3d32c5)[_0x4ed5('0x2d')](_0x13ccdc);};}exports[_0x4ed5('0x2e')]=function(_0x5ca132,_0x5ebceb){var _0x582a6e={},_0x4bc4b6={},_0x3c510f={'count':0x0,'rows':[]};var _0x2f0663=_[_0x4ed5('0x2f')](db[_0x4ed5('0x30')]['rawAttributes'],function(_0x481224){return{'name':_0x481224[_0x4ed5('0x31')],'type':_0x481224['type']['key']};});_0x4bc4b6[_0x4ed5('0x32')]=_[_0x4ed5('0x2f')](_0x2f0663,'name');_0x4bc4b6[_0x4ed5('0x33')]=_[_0x4ed5('0x34')](_0x5ca132[_0x4ed5('0x33')]);_0x4bc4b6[_0x4ed5('0x35')]=_['intersection'](_0x4bc4b6[_0x4ed5('0x32')],_0x4bc4b6['query']);_0x582a6e[_0x4ed5('0x36')]=_[_0x4ed5('0x37')](_0x4bc4b6[_0x4ed5('0x32')],qs[_0x4ed5('0x38')](_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x38')]));_0x582a6e[_0x4ed5('0x36')]=_0x582a6e[_0x4ed5('0x36')][_0x4ed5('0x39')]?_0x582a6e[_0x4ed5('0x36')]:_0x4bc4b6['model'];if(!_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x3a')](_0x4ed5('0x3b'))){_0x582a6e[_0x4ed5('0x21')]=qs[_0x4ed5('0x21')](_0x5ca132['query'][_0x4ed5('0x21')]);_0x582a6e['offset']=qs[_0x4ed5('0x20')](_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x20')]);}_0x582a6e['order']=qs[_0x4ed5('0x3c')](_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x3c')]);_0x582a6e[_0x4ed5('0x3d')]=qs['filters'](_[_0x4ed5('0x3e')](_0x5ca132[_0x4ed5('0x33')],_0x4bc4b6[_0x4ed5('0x35')]),_0x2f0663);if(_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x3f')]){_0x582a6e['where']=_[_0x4ed5('0x40')](_0x582a6e[_0x4ed5('0x3d')],{'$or':_[_0x4ed5('0x2f')](_0x2f0663,function(_0x1bc12c){if(_0x1bc12c[_0x4ed5('0x41')]!=='VIRTUAL'){var _0x165c76={};_0x165c76[_0x1bc12c['name']]={'$like':'%'+_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x3f')]+'%'};return _0x165c76;}})});}_0x582a6e=_[_0x4ed5('0x40')]({},_0x582a6e,_0x5ca132[_0x4ed5('0x42')]);var _0x1175a5={'where':_0x582a6e['where']};return db[_0x4ed5('0x30')][_0x4ed5('0x1f')](_0x1175a5)[_0x4ed5('0x28')](function(_0x7a2952){_0x3c510f['count']=_0x7a2952;if(_0x5ca132[_0x4ed5('0x33')][_0x4ed5('0x43')]){_0x582a6e[_0x4ed5('0x44')]=[{'all':!![]}];}return db[_0x4ed5('0x30')][_0x4ed5('0x45')](_0x582a6e);})['then'](function(_0x4c1956){_0x3c510f[_0x4ed5('0x46')]=_0x4c1956;return _0x3c510f;})['then'](respondWithFilteredResult(_0x5ebceb,_0x582a6e))['catch'](handleError(_0x5ebceb,null));};exports['show']=function(_0x224578,_0x684e){var _0x6cfd34={'raw':!![],'where':{'id':_0x224578[_0x4ed5('0x47')]['id']}},_0x2fb4bd={};_0x2fb4bd['model']=_[_0x4ed5('0x34')](db[_0x4ed5('0x30')][_0x4ed5('0x48')]);_0x2fb4bd['query']=_[_0x4ed5('0x34')](_0x224578[_0x4ed5('0x33')]);_0x2fb4bd[_0x4ed5('0x35')]=_[_0x4ed5('0x37')](_0x2fb4bd['model'],_0x2fb4bd['query']);_0x6cfd34[_0x4ed5('0x36')]=_[_0x4ed5('0x37')](_0x2fb4bd[_0x4ed5('0x32')],qs[_0x4ed5('0x38')](_0x224578[_0x4ed5('0x33')][_0x4ed5('0x38')]));_0x6cfd34[_0x4ed5('0x36')]=_0x6cfd34[_0x4ed5('0x36')][_0x4ed5('0x39')]?_0x6cfd34[_0x4ed5('0x36')]:_0x2fb4bd[_0x4ed5('0x32')];if(_0x224578[_0x4ed5('0x33')][_0x4ed5('0x43')]){_0x6cfd34[_0x4ed5('0x44')]=[{'all':!![]}];}_0x6cfd34=_[_0x4ed5('0x40')]({},_0x6cfd34,_0x224578[_0x4ed5('0x42')]);return db[_0x4ed5('0x30')][_0x4ed5('0x49')](_0x6cfd34)[_0x4ed5('0x28')](handleEntityNotFound(_0x684e,null))[_0x4ed5('0x28')](respondWithResult(_0x684e,null))[_0x4ed5('0x4a')](handleError(_0x684e,null));};exports[_0x4ed5('0x4b')]=function(_0x187d16,_0x28f738){return db['ChatTransferReport'][_0x4ed5('0x4b')](_0x187d16[_0x4ed5('0x4c')],{})[_0x4ed5('0x28')](respondWithResult(_0x28f738,0xc9))[_0x4ed5('0x4a')](handleError(_0x28f738,null));};exports[_0x4ed5('0x27')]=function(_0x5da586,_0x6307a4){if(_0x5da586[_0x4ed5('0x4c')]['id']){delete _0x5da586[_0x4ed5('0x4c')]['id'];}return db[_0x4ed5('0x30')][_0x4ed5('0x49')]({'where':{'id':_0x5da586['params']['id']}})[_0x4ed5('0x28')](handleEntityNotFound(_0x6307a4,null))[_0x4ed5('0x28')](saveUpdates(_0x5da586[_0x4ed5('0x4c')],null))[_0x4ed5('0x28')](respondWithResult(_0x6307a4,null))['catch'](handleError(_0x6307a4,null));};exports[_0x4ed5('0x29')]=function(_0x537ac5,_0x283b51){return db[_0x4ed5('0x30')]['find']({'where':{'id':_0x537ac5['params']['id']}})[_0x4ed5('0x28')](handleEntityNotFound(_0x283b51,null))[_0x4ed5('0x28')](removeEntity(_0x283b51,null))[_0x4ed5('0x4a')](handleError(_0x283b51,null));};exports[_0x4ed5('0x4d')]=function(_0x44e604,_0x3a7238){return db[_0x4ed5('0x30')]['describe']()[_0x4ed5('0x28')](respondWithResult(_0x3a7238,null))[_0x4ed5('0x4a')](handleError(_0x3a7238,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 1e87e96..b7ed165 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 _0x34e8=['../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x34e8,0x12c));var _0x834e=function(_0xb68cd0,_0x55d7ac){_0xb68cd0=_0xb68cd0-0x0;var _0x513ade=_0x34e8[_0xb68cd0];return _0x513ade;};'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('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatTransferReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x6b6340,_0x6302c4){_0x6b6340=_0x6b6340-0x0;var _0x3609bf=_0xf3cd[_0x6b6340];return _0x3609bf;};'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('./chatTransferReport.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdf3c('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c8cc7ef..b3cfe11 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 _0xcbb2=['../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1e9d62,_0x25bb8e){var _0x56c490=function(_0x19f4e7){while(--_0x19f4e7){_0x1e9d62['push'](_0x1e9d62['shift']());}};_0x56c490(++_0x25bb8e);}(_0xcbb2,0x7e));var _0x2cbb=function(_0x1247cc,_0x4ea41a){_0x1247cc=_0x1247cc-0x0;var _0x4aa826=_0xcbb2[_0x1247cc];return _0x4aa826;};'use strict';var _=require(_0x2cbb('0x0'));var util=require(_0x2cbb('0x1'));var moment=require(_0x2cbb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2cbb('0x3'))['db'];var utils=require(_0x2cbb('0x4'));var logger=require(_0x2cbb('0x5'))(_0x2cbb('0x6'));var config=require(_0x2cbb('0x7'));var jayson=require(_0x2cbb('0x8'));var client=jayson[_0x2cbb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192895,_0x2a32ea,_0x427f72){return new BPromise(function(_0xe89a26,_0xde8347){return client['request'](_0x192895,_0x427f72)[_0x2cbb('0xa')](function(_0x511701){logger[_0x2cbb('0xb')](_0x2cbb('0xc'),_0x2a32ea,_0x2cbb('0xd'));logger['debug'](_0x2cbb('0xe'),_0x2a32ea,_0x2cbb('0xd'),JSON[_0x2cbb('0xf')](_0x511701));if(_0x511701[_0x2cbb('0x10')]){if(_0x511701[_0x2cbb('0x10')]['code']===0x1f4){logger['error'](_0x2cbb('0xc'),_0x2a32ea,_0x511701['error'][_0x2cbb('0x11')]);return _0xde8347(_0x511701['error'][_0x2cbb('0x11')]);}logger[_0x2cbb('0x10')](_0x2cbb('0xc'),_0x2a32ea,_0x511701[_0x2cbb('0x10')][_0x2cbb('0x11')]);return _0xe89a26(_0x511701[_0x2cbb('0x10')][_0x2cbb('0x11')]);}else{logger[_0x2cbb('0xb')](_0x2cbb('0xc'),_0x2a32ea,_0x2cbb('0xd'));_0xe89a26(_0x511701['result'][_0x2cbb('0x11')]);}})[_0x2cbb('0x12')](function(_0x82761e){logger[_0x2cbb('0x10')](_0x2cbb('0xc'),_0x2a32ea,_0x82761e);_0xde8347(_0x82761e);});});} \ No newline at end of file +var _0x907c=['client','ChatTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x4f6c8f,_0x2735b0){var _0x308297=function(_0x2e1782){while(--_0x2e1782){_0x4f6c8f['push'](_0x4f6c8f['shift']());}};_0x308297(++_0x2735b0);}(_0x907c,0x98));var _0xc907=function(_0x3edc8f,_0xac527e){_0x3edc8f=_0x3edc8f-0x0;var _0x34f402=_0x907c[_0x3edc8f];return _0x34f402;};'use strict';var _=require(_0xc907('0x0'));var util=require(_0xc907('0x1'));var moment=require(_0xc907('0x2'));var BPromise=require(_0xc907('0x3'));var rs=require(_0xc907('0x4'));var fs=require('fs');var Redis=require(_0xc907('0x5'));var db=require(_0xc907('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc907('0x7'))(_0xc907('0x8'));var config=require(_0xc907('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc907('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eaded,_0x1ee3fa,_0x5608c4){return new BPromise(function(_0x46f1a3,_0x44946c){return client['request'](_0x3eaded,_0x5608c4)['then'](function(_0x44e40d){logger['info'](_0xc907('0xb'),_0x1ee3fa,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x1ee3fa,_0xc907('0xc'),JSON[_0xc907('0xd')](_0x44e40d));if(_0x44e40d['error']){if(_0x44e40d['error']['code']===0x1f4){logger[_0xc907('0xe')](_0xc907('0xb'),_0x1ee3fa,_0x44e40d[_0xc907('0xe')][_0xc907('0xf')]);return _0x44946c(_0x44e40d[_0xc907('0xe')][_0xc907('0xf')]);}logger[_0xc907('0xe')](_0xc907('0xb'),_0x1ee3fa,_0x44e40d['error']['message']);return _0x46f1a3(_0x44e40d['error'][_0xc907('0xf')]);}else{logger['info'](_0xc907('0xb'),_0x1ee3fa,_0xc907('0xc'));_0x46f1a3(_0x44e40d[_0xc907('0x10')][_0xc907('0xf')]);}})[_0xc907('0x11')](function(_0x4c3649){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x1ee3fa,_0x4c3649);_0x44946c(_0x4c3649);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ba0383e..806e2d8 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(_0x1410a9,_0x2d4289){var _0x43339d=function(_0x37df0e){while(--_0x37df0e){_0x1410a9['push'](_0x1410a9['shift']());}};_0x43339d(++_0x2d4289);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e0139,_0x4970a3){_0x1e0139=_0x1e0139-0x0;var _0xbfc2ba=_0xb10b[_0x1e0139];return _0xbfc2ba;};'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(_0x27d638,_0x4f8f75){var _0x4ebdc9=function(_0x12f931){while(--_0x12f931){_0x27d638['push'](_0x27d638['shift']());}};_0x4ebdc9(++_0x4f8f75);}(_0x2032,0xd9));var _0x2203=function(_0x25f8b5,_0x326035){_0x25f8b5=_0x25f8b5-0x0;var _0x594923=_0x2032[_0x25f8b5];return _0x594923;};'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 96f03ec..b9b8166 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 _0x8375=['stringify','input','name','text','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','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:','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x8375,0xa8));var _0x5837=function(_0x48b8ad,_0x45eee0){_0x48b8ad=_0x48b8ad-0x0;var _0x4933fc=_0x8375[_0x48b8ad];return _0x4933fc;};'use strict';var Sequelize=require(_0x5837('0x0'));var rs=require(_0x5837('0x1'));module[_0x5837('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x5837('0x3')],'allowNull':![],'unique':_0x5837('0x4')},'description':{'type':Sequelize[_0x5837('0x3')]},'mapKey':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x5')},'mapKeyOffline':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'email'},'key':{'type':Sequelize[_0x5837('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x6')},'customerAlias':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x5837('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5837('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x5837('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x5837('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x5837('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x5837('0xa')](_0x5837('0xb'),_0x5837('0xc')),'defaultValue':_0x5837('0xb')},'header_online':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0xd')},'offline_chat_button':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0xe')},'header_offline':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x5837('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x5837('0x10')]},'closingQuestion':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x5837('0x14')},'closingMessage':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x5837('0x16')},'conditionAgreement':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x17')},'ratingType':{'type':Sequelize[_0x5837('0xa')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x5837('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5837('0x18')]({'items':[{'type':_0x5837('0x19'),'variable':null,'config':{'placeholder':_0x5837('0x1a'),'type':_0x5837('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0x5837('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5837('0x5'),'type':_0x5837('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x5837('0x1c'))?JSON[_0x5837('0x1d')](this[_0x5837('0x1e')]('onlineForm')):{};},'set':function(_0x41f86a){return this[_0x5837('0x1f')](_0x5837('0x1c'),JSON['stringify'](_0x41f86a));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x5837('0x18')]({'items':[{'type':_0x5837('0x19'),'props':{'title':_0x5837('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x5837('0x5'),'type':_0x5837('0x5')},'variable':null},{'type':_0x5837('0x20'),'config':{'placeholder':_0x5837('0x21')},'props':{'title':_0x5837('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x5837('0x1e')](_0x5837('0x22'))?JSON[_0x5837('0x1d')](this[_0x5837('0x1e')](_0x5837('0x22'))):{};},'set':function(_0x228f1){return this[_0x5837('0x1f')](_0x5837('0x22'),JSON['stringify'](_0x228f1));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x5837('0x23')]();}},'autoclose':{'type':Sequelize[_0x5837('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x5837('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x5837('0x3')]},'waitingTitle':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x5837('0x25')},'offlineMessageBody':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x5837('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x5837('0x16')},'sendUnmanaged':{'type':Sequelize[_0x5837('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x5837('0x3')]},'notificationTemplate':{'type':Sequelize[_0x5837('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5837('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x5837('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x5837('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x28')},'verticalAlignment':{'type':Sequelize[_0x5837('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x5837('0x29')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x5837('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5837('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5837('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x5837('0x3')],'defaultValue':_0x5837('0x2b')},'systemAvatar':{'type':Sequelize[_0x5837('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x5837('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![],'comment':_0x5837('0x2d'),'set':function(_0x31710b){if(!_0x31710b)this[_0x5837('0x1f')](_0x5837('0x2e'),null);this[_0x5837('0x1f')](_0x5837('0x2f'),_0x31710b);}},'vidaooEscalation':{'type':Sequelize[_0x5837('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x5837('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa680=['Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','getDataValue','onlineForm','setDataValue','TEXT','email','textarea','Comments','Leave\x20your\x20comments','parse','offlineForm','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','address','Agent','#011F6A','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'];(function(_0x1d32db,_0x12ffc4){var _0x240aba=function(_0x37b362){while(--_0x37b362){_0x1d32db['push'](_0x1d32db['shift']());}};_0x240aba(++_0x12ffc4);}(_0xa680,0xb0));var _0x0a68=function(_0x2dfb0d,_0x761023){_0x2dfb0d=_0x2dfb0d-0x0;var _0x2ca23f=_0xa680[_0x2dfb0d];return _0x2ca23f;};'use strict';var Sequelize=require(_0x0a68('0x0'));var rs=require(_0x0a68('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0a68('0x2')],'allowNull':![],'unique':_0x0a68('0x3')},'description':{'type':Sequelize[_0x0a68('0x2')]},'mapKey':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0a68('0x4')},'customerAlias':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0a68('0x2')],'allowNull':![],'defaultValue':_0x0a68('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0a68('0x2')],'allowNull':![],'defaultValue':_0x0a68('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0a68('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0a68('0x2')]},'animation':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0a68('0x7')](_0x0a68('0x8'),_0x0a68('0x9')),'defaultValue':_0x0a68('0x8')},'header_online':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xa')},'start_chat_button':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xb')},'header_offline':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xc')},'download_transcript':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0a68('0xd')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a68('0x11')},'closingMessage':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x12')},'closingMessageButton':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xb')},'skipMessageButton':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x0a68('0x13'),_0x0a68('0x14')),'defaultValue':_0x0a68('0x13')},'ratingStarsNumber':{'type':Sequelize[_0x0a68('0xd')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0a68('0x15')]({'items':[{'type':_0x0a68('0x16'),'variable':null,'config':{'placeholder':_0x0a68('0x17'),'type':'text','required':!![]},'props':{'title':_0x0a68('0x17'),'helpText':''}},{'type':_0x0a68('0x16'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0a68('0x18')](_0x0a68('0x19'))?JSON['parse'](this['getDataValue'](_0x0a68('0x19'))):{};},'set':function(_0x4fc58e){return this[_0x0a68('0x1a')]('onlineForm',JSON[_0x0a68('0x15')](_0x4fc58e));}},'offlineForm':{'type':Sequelize[_0x0a68('0x1b')],'defaultValue':function(){return JSON[_0x0a68('0x15')]({'items':[{'type':_0x0a68('0x16'),'props':{'title':_0x0a68('0x1c'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x0a68('0x1c')},'variable':null},{'type':_0x0a68('0x1d'),'config':{'placeholder':_0x0a68('0x1e')},'props':{'title':'Comments','helpText':_0x0a68('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0x0a68('0x18')]('offlineForm')?JSON[_0x0a68('0x20')](this[_0x0a68('0x18')]('offlineForm')):{};},'set':function(_0x3349b2){return this[_0x0a68('0x1a')](_0x0a68('0x21'),JSON[_0x0a68('0x15')](_0x3349b2));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0a68('0x2')]},'forwardOffline':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0a68('0x2')]},'waitingTitle':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0a68('0x22')},'offlineMessageSubject':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x23')},'offlineMessageBody':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x24')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x25')},'sendUnmanaged':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0a68('0x2')]},'notificationTemplate':{'type':Sequelize[_0x0a68('0x1b')],'defaultValue':function(){return _0x0a68('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0a68('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x28')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x29')},'defaultTitle':{'type':Sequelize[_0x0a68('0x2')]},'customerAvatar':{'type':Sequelize[_0x0a68('0x1b')]},'showCustomerAvatar':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0a68('0xd')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0a68('0x2')],'allowNull':![],'defaultValue':_0x0a68('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0a68('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0a68('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':_0x0a68('0x2b')},'systemAvatar':{'type':Sequelize[_0x0a68('0x1b')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x0a68('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![],'comment':_0x0a68('0x2d'),'set':function(_0x2ee8dd){if(!_0x2ee8dd)this[_0x0a68('0x1a')](_0x0a68('0x2e'),null);this[_0x0a68('0x1a')](_0x0a68('0x2f'),_0x2ee8dd);}},'vidaooEscalation':{'type':Sequelize[_0x0a68('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0a68('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 106c902..c6e4b00 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 _0x6ca9=['UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','ChatWebsiteId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','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','CmList','List','Contacts','DESC','ChatApplication','applications','Applications','list','orderBy','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','ContactId','interaction','spread','firstName','messageId','update','created','push','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','addInteraction','omit','getInteractions','Owner','fullname','Tag','Tags','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','virtual','increment','chatLicenseExceeded','all','some','readFileSync','server/files/chat/iframe.js','utf8','remote','x-real-ip','render','alignment','verticalAlignment','color','textColor','addApplications','sequelize','transaction','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','getProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','Contact','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','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/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','ValidationError','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatWebsite','include','findAll','show','params','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x4e434c,_0x1c4105){var _0x52bab1=function(_0x4f72c5){while(--_0x4f72c5){_0x4e434c['push'](_0x4e434c['shift']());}};_0x52bab1(++_0x1c4105);}(_0x6ca9,0xc4));var _0x96ca=function(_0x5c4164,_0xcd47fc){_0x5c4164=_0x5c4164-0x0;var _0x51f164=_0x6ca9[_0x5c4164];return _0x51f164;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x96ca('0x0'));var zipdir=require(_0x96ca('0x1'));var jsonpatch=require(_0x96ca('0x2'));var rp=require(_0x96ca('0x3'));var moment=require(_0x96ca('0x4'));var BPromise=require(_0x96ca('0x5'));var Mustache=require(_0x96ca('0x6'));var util=require(_0x96ca('0x7'));var path=require(_0x96ca('0x8'));var sox=require(_0x96ca('0x9'));var csv=require(_0x96ca('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x96ca('0xb'));var squel=require(_0x96ca('0xc'));var crypto=require(_0x96ca('0xd'));var jsforce=require(_0x96ca('0xe'));var deskjs=require(_0x96ca('0xf'));var toCsv=require(_0x96ca('0xa'));var querystring=require(_0x96ca('0x10'));var Papa=require(_0x96ca('0x11'));var Redis=require(_0x96ca('0x12'));var authService=require(_0x96ca('0x13'));var qs=require(_0x96ca('0x14'));var as=require(_0x96ca('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96ca('0x16'))(_0x96ca('0x17'));var utils=require('../../config/utils');var config=require(_0x96ca('0x18'));var db=require(_0x96ca('0x19'))['db'];config[_0x96ca('0x1a')]=_[_0x96ca('0x1b')](config[_0x96ca('0x1a')],{'host':_0x96ca('0x1c'),'port':0x18eb});var socket=require(_0x96ca('0x1d'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x96ca('0x1e')](socket);var jayson=require(_0x96ca('0x1f'));var client=jayson[_0x96ca('0x20')][_0x96ca('0x21')]({'port':0x232c});var client9002=jayson[_0x96ca('0x20')]['http']({'port':0x232a});var client9003=jayson[_0x96ca('0x20')][_0x96ca('0x21')]({'port':0x232b});function checkPasswordPattern(_0x151449,_0x6b864f,_0x2b87ac){if(_0x2b87ac){var _0x139b10=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x139b10['test'](_0x6b864f)){return _0x151449;}else{throw new db['Sequelize'][(_0x96ca('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x151449;}}function respondWithRpcPromise(_0xa21696,_0x422c30,_0x59c015,_0x591ebb){return new BPromise(function(_0x4a391e,_0x126582){var _0x2fe077=_0x591ebb||client;return _0x2fe077['request'](_0xa21696,_0x59c015)[_0x96ca('0x23')](function(_0x56eeb4){logger[_0x96ca('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x422c30,_0x96ca('0x25'));logger[_0x96ca('0x26')](_0x96ca('0x27'),_0x422c30,_0x96ca('0x25'),JSON[_0x96ca('0x28')](_0x56eeb4));if(_0x56eeb4[_0x96ca('0x29')]){if(_0x56eeb4[_0x96ca('0x29')][_0x96ca('0x2a')]===0x1f4){logger[_0x96ca('0x29')](_0x96ca('0x2b'),_0x422c30,_0x56eeb4['error'][_0x96ca('0x2c')]);return _0x126582(_0x56eeb4['error'][_0x96ca('0x2c')]);}logger[_0x96ca('0x29')](_0x96ca('0x2b'),_0x422c30,_0x56eeb4[_0x96ca('0x29')][_0x96ca('0x2c')]);return _0x4a391e(_0x56eeb4['error'][_0x96ca('0x2c')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x422c30,_0x96ca('0x25'));_0x4a391e(_0x56eeb4['result'][_0x96ca('0x2c')]);}})[_0x96ca('0x2d')](function(_0x16f81d){logger[_0x96ca('0x29')](_0x96ca('0x2b'),_0x422c30,_0x16f81d);_0x126582(_0x16f81d);});});}function respondWithStatusCode(_0x1d8790,_0xbc09b0){_0xbc09b0=_0xbc09b0||0xcc;return function(_0x2d4e11){if(_0x2d4e11){return _0x1d8790[_0x96ca('0x2e')](_0xbc09b0);}return _0x1d8790[_0x96ca('0x2f')](_0xbc09b0)[_0x96ca('0x30')]();};}function respondWithResult(_0x3c1799,_0x3771ae){_0x3771ae=_0x3771ae||0xc8;return function(_0x2184b1){if(_0x2184b1){return _0x3c1799[_0x96ca('0x2f')](_0x3771ae)[_0x96ca('0x31')](_0x2184b1);}};}function respondWithFilteredResult(_0x225e60,_0x258387){return function(_0x248a33){if(_0x248a33){var _0x17972e=_0x248a33[_0x96ca('0x32')],_0x5ceabe=_0x258387[_0x96ca('0x33')],_0x286a3a=_0x258387[_0x96ca('0x33')]+_0x258387[_0x96ca('0x34')],_0x3f9752;if(_0x286a3a>=_0x17972e){_0x286a3a=_0x17972e;_0x3f9752=0xc8;}else{_0x3f9752=0xce;}_0x225e60[_0x96ca('0x2f')](_0x3f9752);return _0x225e60['set'](_0x96ca('0x35'),_0x5ceabe+'-'+_0x286a3a+'/'+_0x17972e)[_0x96ca('0x31')](_0x248a33);}return null;};}function patchUpdates(_0x35a173){return function(_0x2f8154){try{jsonpatch[_0x96ca('0x36')](_0x2f8154,_0x35a173,!![]);}catch(_0x500d67){return BPromise['reject'](_0x500d67);}return _0x2f8154[_0x96ca('0x37')]();};}function saveUpdates(_0x4a02ef,_0x53f160){return function(_0x2d2216){if(_0x2d2216){return _0x2d2216['update'](_0x4a02ef)[_0x96ca('0x23')](function(_0x44422d){return _0x44422d;});}return null;};}function removeEntity(_0x2685c3,_0x380883){return function(_0x1a09c2){if(_0x1a09c2){return _0x1a09c2['destroy']()[_0x96ca('0x23')](function(){var _0x5d594e=_0x1a09c2[_0x96ca('0x38')]({'plain':!![]});var _0x1a0e81=_0x96ca('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a0e81,'resourceId':_0x5d594e['id']}})['then'](function(){return _0x1a09c2;});})['then'](function(){_0x2685c3[_0x96ca('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d40e8,_0x5e7d3c){return function(_0x38efb0){if(!_0x38efb0){_0x5d40e8[_0x96ca('0x2e')](0x194);}return _0x38efb0;};}function handleError(_0x279ec4,_0x30644f){_0x30644f=_0x30644f||0x1f4;return function(_0x32be60){logger['error'](_0x32be60[_0x96ca('0x3a')]);if(_0x32be60[_0x96ca('0x3b')]){delete _0x32be60['name'];}_0x279ec4['status'](_0x30644f)[_0x96ca('0x3c')](_0x32be60);};}exports[_0x96ca('0x3d')]=function(_0x23d523,_0x141fec){var _0x561c82={'include':[{'model':db[_0x96ca('0x3e')],'as':_0x96ca('0x3f')}]},_0x11a181={},_0x4b9ec8={'count':0x0,'rows':[]};var _0x2fcd46=_[_0x96ca('0x40')](db['ChatWebsite'][_0x96ca('0x41')],function(_0x3e1f2d){return{'name':_0x3e1f2d[_0x96ca('0x42')],'type':_0x3e1f2d[_0x96ca('0x43')][_0x96ca('0x44')]};});_0x11a181[_0x96ca('0x45')]=_['map'](_0x2fcd46,_0x96ca('0x3b'));_0x11a181[_0x96ca('0x46')]=_[_0x96ca('0x47')](_0x23d523[_0x96ca('0x46')]);_0x11a181[_0x96ca('0x48')]=_[_0x96ca('0x49')](_0x11a181[_0x96ca('0x45')],_0x11a181['query']);_0x561c82[_0x96ca('0x4a')]=_[_0x96ca('0x49')](_0x11a181[_0x96ca('0x45')],qs[_0x96ca('0x4b')](_0x23d523[_0x96ca('0x46')][_0x96ca('0x4b')]));_0x561c82[_0x96ca('0x4a')]=_0x561c82[_0x96ca('0x4a')]['length']?_0x561c82['attributes']:_0x11a181[_0x96ca('0x45')];if(!_0x23d523[_0x96ca('0x46')][_0x96ca('0x4c')](_0x96ca('0x4d'))){_0x561c82[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x23d523[_0x96ca('0x46')]['limit']);_0x561c82[_0x96ca('0x33')]=qs[_0x96ca('0x33')](_0x23d523[_0x96ca('0x46')][_0x96ca('0x33')]);}_0x561c82[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x23d523[_0x96ca('0x46')][_0x96ca('0x4f')]);_0x561c82[_0x96ca('0x50')]=qs['filters'](_['pick'](_0x23d523[_0x96ca('0x46')],_0x11a181[_0x96ca('0x48')]),_0x2fcd46);if(_0x23d523[_0x96ca('0x46')][_0x96ca('0x51')]){_0x561c82[_0x96ca('0x50')]=_[_0x96ca('0x52')](_0x561c82[_0x96ca('0x50')],{'$or':_[_0x96ca('0x40')](_0x2fcd46,function(_0x271e2e){if(_0x271e2e['type']!==_0x96ca('0x53')){var _0x2afc13={};_0x2afc13[_0x271e2e[_0x96ca('0x3b')]]={'$like':'%'+_0x23d523[_0x96ca('0x46')]['filter']+'%'};return _0x2afc13;}})});}_0x561c82=_[_0x96ca('0x52')]({},_0x561c82,_0x23d523[_0x96ca('0x54')]);var _0x50e0bb={'where':_0x561c82[_0x96ca('0x50')]};return db[_0x96ca('0x55')][_0x96ca('0x32')](_0x50e0bb)[_0x96ca('0x23')](function(_0x35675c){_0x4b9ec8[_0x96ca('0x32')]=_0x35675c;if(_0x23d523['query']['includeAll']){_0x561c82[_0x96ca('0x56')]=[{'all':!![]}];}return db[_0x96ca('0x55')][_0x96ca('0x57')](_0x561c82);})[_0x96ca('0x23')](function(_0x2e547a){_0x4b9ec8['rows']=_0x2e547a;return _0x4b9ec8;})[_0x96ca('0x23')](respondWithFilteredResult(_0x141fec,_0x561c82))[_0x96ca('0x2d')](handleError(_0x141fec,null));};exports[_0x96ca('0x58')]=function(_0x968ffb,_0x215335){var _0x445980={'raw':![],'where':{'id':_0x968ffb[_0x96ca('0x59')]['id']},'include':[{'model':db[_0x96ca('0x3e')],'as':'mandatoryDispositionPause'}]},_0x8c9974={};_0x8c9974[_0x96ca('0x45')]=_[_0x96ca('0x47')](db[_0x96ca('0x55')]['rawAttributes']);_0x8c9974[_0x96ca('0x46')]=_[_0x96ca('0x47')](_0x968ffb[_0x96ca('0x46')]);_0x8c9974[_0x96ca('0x48')]=_['intersection'](_0x8c9974[_0x96ca('0x45')],_0x8c9974[_0x96ca('0x46')]);_0x445980[_0x96ca('0x4a')]=_['intersection'](_0x8c9974[_0x96ca('0x45')],qs[_0x96ca('0x4b')](_0x968ffb['query'][_0x96ca('0x4b')]));_0x445980[_0x96ca('0x4a')]=_0x445980[_0x96ca('0x4a')][_0x96ca('0x5a')]?_0x445980['attributes']:_0x8c9974[_0x96ca('0x45')];if(_0x968ffb[_0x96ca('0x46')][_0x96ca('0x5b')]){_0x445980[_0x96ca('0x56')]=[{'all':!![]}];}_0x445980=_[_0x96ca('0x52')]({},_0x445980,_0x968ffb['options']);return db['ChatWebsite']['find'](_0x445980)['then'](handleEntityNotFound(_0x215335,null))[_0x96ca('0x23')](respondWithResult(_0x215335,null))[_0x96ca('0x2d')](handleError(_0x215335,null));};exports[_0x96ca('0x5c')]=function(_0x53e9d8,_0x21f9f0){return db[_0x96ca('0x55')]['create'](_0x53e9d8['body'],{})['then'](function(_0x5840f9){var _0x4c6c6a=_0x53e9d8['user'][_0x96ca('0x38')]({'plain':!![]});if(!_0x4c6c6a)throw new Error(_0x96ca('0x5d'));if(_0x4c6c6a[_0x96ca('0x5e')]===_0x96ca('0x5f')){var _0x17d0c9=_0x5840f9[_0x96ca('0x38')]({'plain':!![]});var _0x53b172=_0x96ca('0x39');return db[_0x96ca('0x60')][_0x96ca('0x61')]({'where':{'name':_0x53b172,'userProfileId':_0x4c6c6a[_0x96ca('0x62')]},'raw':!![]})['then'](function(_0x52d047){if(_0x52d047&&_0x52d047['autoAssociation']===0x0){return db['UserProfileResource'][_0x96ca('0x5c')]({'name':_0x17d0c9[_0x96ca('0x3b')],'resourceId':_0x17d0c9['id'],'type':_0x52d047[_0x96ca('0x3b')],'sectionId':_0x52d047['id']},{})['then'](function(){return _0x5840f9;});}else{return _0x5840f9;}})['catch'](function(_0x44648f){logger[_0x96ca('0x29')](_0x96ca('0x63'),_0x44648f);throw _0x44648f;});}return _0x5840f9;})[_0x96ca('0x23')](respondWithResult(_0x21f9f0,0xc9))[_0x96ca('0x2d')](handleError(_0x21f9f0,null));};exports['update']=function(_0x15074c,_0x7c538a){if(_0x15074c[_0x96ca('0x64')]['id']){delete _0x15074c[_0x96ca('0x64')]['id'];}return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x15074c[_0x96ca('0x59')]['id']},'include':[{'model':db[_0x96ca('0x3e')],'as':_0x96ca('0x3f')}]})[_0x96ca('0x23')](handleEntityNotFound(_0x7c538a,null))[_0x96ca('0x23')](saveUpdates(_0x15074c[_0x96ca('0x64')],null))[_0x96ca('0x23')](respondWithResult(_0x7c538a,null))[_0x96ca('0x2d')](handleError(_0x7c538a,null));};exports[_0x96ca('0x65')]=function(_0x5176ea,_0x3863de){return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x5176ea['params']['id']}})['then'](handleEntityNotFound(_0x3863de,null))[_0x96ca('0x23')](removeEntity(_0x3863de,null))[_0x96ca('0x2d')](handleError(_0x3863de,null));};exports[_0x96ca('0x66')]=function(_0xaa4f81,_0x5c2852){return db[_0x96ca('0x55')][_0x96ca('0x66')]()[_0x96ca('0x23')](respondWithResult(_0x5c2852,null))[_0x96ca('0x2d')](handleError(_0x5c2852,null));};exports['addDisposition']=function(_0x505d87,_0xf1538c,_0x41f62e){if(_0x505d87[_0x96ca('0x64')]['id']){delete _0x505d87['body']['id'];}return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x505d87['params']['id']}})['then'](handleEntityNotFound(_0xf1538c,null))[_0x96ca('0x23')](function(_0xe670f9){if(_0xe670f9){_0x505d87[_0x96ca('0x64')][_0x96ca('0x67')]=_0xe670f9['id'];return db[_0x96ca('0x68')][_0x96ca('0x5c')](_0x505d87[_0x96ca('0x64')]);}})['then'](respondWithResult(_0xf1538c,null))[_0x96ca('0x2d')](handleError(_0xf1538c,null));};exports[_0x96ca('0x69')]=function(_0x35fe00,_0xf6fd7c,_0x4c96cf){var _0x15c596={'raw':![],'where':{}};var _0x2420ff={};var _0x547996={'count':0x0,'rows':[]};return db[_0x96ca('0x55')][_0x96ca('0x6a')]({'where':{'id':_0x35fe00[_0x96ca('0x59')]['id']}})['then'](handleEntityNotFound(_0xf6fd7c,null))[_0x96ca('0x23')](function(_0x5af61d){if(_0x5af61d){_0x2420ff[_0x96ca('0x45')]=_[_0x96ca('0x47')](db[_0x96ca('0x68')][_0x96ca('0x41')]);_0x2420ff[_0x96ca('0x46')]=_[_0x96ca('0x47')](_0x35fe00[_0x96ca('0x46')]);_0x2420ff[_0x96ca('0x48')]=_['intersection'](_0x2420ff[_0x96ca('0x45')],_0x2420ff[_0x96ca('0x46')]);_0x15c596[_0x96ca('0x4a')]=_[_0x96ca('0x49')](_0x2420ff['model'],qs['fields'](_0x35fe00[_0x96ca('0x46')][_0x96ca('0x4b')]));_0x15c596[_0x96ca('0x4a')]=_0x15c596[_0x96ca('0x4a')][_0x96ca('0x5a')]?_0x15c596['attributes']:_0x2420ff[_0x96ca('0x45')];if(!_0x35fe00[_0x96ca('0x46')][_0x96ca('0x4c')]('nolimit')){_0x15c596[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x35fe00[_0x96ca('0x46')]['limit']);_0x15c596[_0x96ca('0x33')]=qs[_0x96ca('0x33')](_0x35fe00[_0x96ca('0x46')][_0x96ca('0x33')]);}_0x15c596[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x35fe00[_0x96ca('0x46')][_0x96ca('0x4f')]);_0x15c596['where']=qs[_0x96ca('0x48')](_[_0x96ca('0x6b')](_0x35fe00[_0x96ca('0x46')],_0x2420ff[_0x96ca('0x48')]));_0x15c596[_0x96ca('0x50')][_0x96ca('0x67')]=_0x5af61d['id'];if(_0x35fe00[_0x96ca('0x46')][_0x96ca('0x51')]){_0x15c596[_0x96ca('0x50')]=_[_0x96ca('0x52')](_0x15c596[_0x96ca('0x50')],{'$or':_[_0x96ca('0x40')](_0x15c596[_0x96ca('0x4a')],function(_0x4ee48e){var _0x3c631b={};_0x3c631b[_0x4ee48e]={'$like':'%'+_0x35fe00[_0x96ca('0x46')][_0x96ca('0x51')]+'%'};return _0x3c631b;})});}_0x15c596=_['merge']({},_0x15c596,_0x35fe00[_0x96ca('0x54')]);return db[_0x96ca('0x68')][_0x96ca('0x32')]({'where':_0x15c596[_0x96ca('0x50')]})[_0x96ca('0x23')](function(_0x5a6dd8){_0x547996[_0x96ca('0x32')]=_0x5a6dd8;if(_0x35fe00['query'][_0x96ca('0x5b')]){_0x15c596['include']=[{'all':!![]}];}return db[_0x96ca('0x68')]['findAll'](_0x15c596);})[_0x96ca('0x23')](function(_0x86fb56){_0x547996[_0x96ca('0x6c')]=_0x86fb56;return _0x547996;});}})['then'](respondWithFilteredResult(_0xf6fd7c,_0x15c596))[_0x96ca('0x2d')](handleError(_0xf6fd7c,null));};exports[_0x96ca('0x6d')]=function(_0x23f156,_0x139b2e,_0x145f78){return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x23f156[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x139b2e,null))[_0x96ca('0x23')](function(_0x569484){if(_0x569484){return _0x569484['removeDispositions'](_0x23f156[_0x96ca('0x46')][_0x96ca('0x6e')]);}})['then'](respondWithStatusCode(_0x139b2e,null))[_0x96ca('0x2d')](handleError(_0x139b2e,null));};exports[_0x96ca('0x6f')]=function(_0x51cbfc,_0x5c7601,_0x39349f){if(_0x51cbfc[_0x96ca('0x64')]['id']){delete _0x51cbfc[_0x96ca('0x64')]['id'];}return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x51cbfc['params']['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x5c7601,null))[_0x96ca('0x23')](function(_0xb80f15){if(_0xb80f15){_0x51cbfc[_0x96ca('0x64')][_0x96ca('0x67')]=_0xb80f15['id'];return db[_0x96ca('0x70')][_0x96ca('0x5c')](_0x51cbfc[_0x96ca('0x64')]);}})[_0x96ca('0x23')](respondWithResult(_0x5c7601,null))['catch'](handleError(_0x5c7601,null));};exports['getAnswers']=function(_0x36948f,_0x48ecaa,_0x501e29){var _0xb2b5d3={'raw':![],'where':{}};var _0x4f650c={};var _0x4973b6={'count':0x0,'rows':[]};return db[_0x96ca('0x55')]['findOne']({'where':{'id':_0x36948f[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x48ecaa,null))[_0x96ca('0x23')](function(_0x35f3c1){if(_0x35f3c1){_0x4f650c[_0x96ca('0x45')]=_[_0x96ca('0x47')](db[_0x96ca('0x70')][_0x96ca('0x41')]);_0x4f650c['query']=_[_0x96ca('0x47')](_0x36948f[_0x96ca('0x46')]);_0x4f650c[_0x96ca('0x48')]=_[_0x96ca('0x49')](_0x4f650c[_0x96ca('0x45')],_0x4f650c['query']);_0xb2b5d3[_0x96ca('0x4a')]=_[_0x96ca('0x49')](_0x4f650c['model'],qs['fields'](_0x36948f[_0x96ca('0x46')][_0x96ca('0x4b')]));_0xb2b5d3[_0x96ca('0x4a')]=_0xb2b5d3[_0x96ca('0x4a')][_0x96ca('0x5a')]?_0xb2b5d3[_0x96ca('0x4a')]:_0x4f650c[_0x96ca('0x45')];if(!_0x36948f[_0x96ca('0x46')][_0x96ca('0x4c')]('nolimit')){_0xb2b5d3[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x36948f[_0x96ca('0x46')][_0x96ca('0x34')]);_0xb2b5d3[_0x96ca('0x33')]=qs[_0x96ca('0x33')](_0x36948f[_0x96ca('0x46')][_0x96ca('0x33')]);}_0xb2b5d3[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x36948f[_0x96ca('0x46')][_0x96ca('0x4f')]);_0xb2b5d3[_0x96ca('0x50')]=qs['filters'](_[_0x96ca('0x6b')](_0x36948f[_0x96ca('0x46')],_0x4f650c[_0x96ca('0x48')]));_0xb2b5d3[_0x96ca('0x50')][_0x96ca('0x67')]=_0x35f3c1['id'];if(_0x36948f[_0x96ca('0x46')][_0x96ca('0x51')]){_0xb2b5d3[_0x96ca('0x50')]=_[_0x96ca('0x52')](_0xb2b5d3['where'],{'$or':_[_0x96ca('0x40')](_0xb2b5d3['attributes'],function(_0x1e0f3c){var _0x3b5f56={};_0x3b5f56[_0x1e0f3c]={'$like':'%'+_0x36948f[_0x96ca('0x46')][_0x96ca('0x51')]+'%'};return _0x3b5f56;})});}_0xb2b5d3=_[_0x96ca('0x52')]({},_0xb2b5d3,_0x36948f['options']);return db[_0x96ca('0x70')]['count']({'where':_0xb2b5d3[_0x96ca('0x50')]})['then'](function(_0x1e2b0f){_0x4973b6[_0x96ca('0x32')]=_0x1e2b0f;if(_0x36948f[_0x96ca('0x46')]['includeAll']){_0xb2b5d3[_0x96ca('0x56')]=[{'all':!![]}];}return db[_0x96ca('0x70')][_0x96ca('0x57')](_0xb2b5d3);})[_0x96ca('0x23')](function(_0x134f63){_0x4973b6[_0x96ca('0x6c')]=_0x134f63;return _0x4973b6;});}})[_0x96ca('0x23')](respondWithFilteredResult(_0x48ecaa,_0xb2b5d3))['catch'](handleError(_0x48ecaa,null));};exports[_0x96ca('0x71')]=function(_0x2d5c59,_0x3fb96a,_0x353cd5){return db[_0x96ca('0x55')]['find']({'where':{'id':_0x2d5c59['params']['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x3fb96a,null))['then'](function(_0x4cbe3f){if(_0x4cbe3f){return _0x4cbe3f[_0x96ca('0x71')](_0x2d5c59[_0x96ca('0x46')]['ids']);}})[_0x96ca('0x23')](respondWithStatusCode(_0x3fb96a,null))['catch'](handleError(_0x3fb96a,null));};exports[_0x96ca('0x72')]=function(_0x48e2f7,_0x4fb7f2,_0x302071){_0x48e2f7[_0x96ca('0x64')][_0x96ca('0x73')]=_0x48e2f7['file'][_0x96ca('0x74')];return db[_0x96ca('0x55')]['find']({'where':{'id':_0x48e2f7[_0x96ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x4fb7f2,null))[_0x96ca('0x23')](saveUpdates(_0x48e2f7['body'],null))['then'](respondWithResult(_0x4fb7f2,null))[_0x96ca('0x2d')](handleError(_0x4fb7f2,null));};exports[_0x96ca('0x75')]=function(_0x520130,_0x4103c3,_0x15d784){_0x520130[_0x96ca('0x64')][_0x96ca('0x76')]=_0x520130[_0x96ca('0x77')][_0x96ca('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x520130[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x4103c3,null))['then'](saveUpdates(_0x520130[_0x96ca('0x64')],null))['then'](respondWithResult(_0x4103c3,null))[_0x96ca('0x2d')](handleError(_0x4103c3,null));};exports[_0x96ca('0x78')]=function(_0x1e324d,_0x1e587c,_0x2c5fd8){_0x1e324d['body'][_0x96ca('0x79')]=_0x1e324d[_0x96ca('0x77')][_0x96ca('0x74')];return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x1e324d[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x1e587c,null))[_0x96ca('0x23')](saveUpdates(_0x1e324d[_0x96ca('0x64')],null))[_0x96ca('0x23')](respondWithResult(_0x1e587c,null))['catch'](handleError(_0x1e587c,null));};exports[_0x96ca('0x7a')]=function(_0x40d9fd,_0x493401,_0x5ddd9c){_0x40d9fd[_0x96ca('0x64')][_0x96ca('0x7b')]=_0x40d9fd['file'][_0x96ca('0x74')];return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x40d9fd[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x493401,null))[_0x96ca('0x23')](saveUpdates(_0x40d9fd[_0x96ca('0x64')],null))[_0x96ca('0x23')](respondWithResult(_0x493401,null))[_0x96ca('0x2d')](handleError(_0x493401,null));};exports['getLogo']=function(_0x506138,_0xdb179a,_0x8af87b){var _0x19ea24=path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],_0x96ca('0x7e'));var _0x30be0f={'where':{'id':_0x506138['params']['id']},'attributes':['id',_0x96ca('0x73')],'raw':!![]};var _0x59ca9c=![];return require(_0x96ca('0x7f'))[_0x96ca('0x80')]()[_0x96ca('0x23')](function(_0x340051){if(_0x340051){_0x59ca9c=_0x340051[_0x96ca('0x81')];}})[_0x96ca('0x23')](function(){return db['ChatWebsite'][_0x96ca('0x61')](_0x30be0f);})['then'](handleEntityNotFound(_0xdb179a,null))[_0x96ca('0x23')](function(_0x44e00f){if(_0x44e00f){if(!_[_0x96ca('0x82')](_0x44e00f[_0x96ca('0x73')])){if(fs[_0x96ca('0x83')](path['join'](config[_0x96ca('0x7d')],_0x96ca('0x84'),_0x44e00f[_0x96ca('0x73')]))&&_0x59ca9c){_0x19ea24=path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],_0x96ca('0x84'),_0x44e00f[_0x96ca('0x73')]);}}return _0xdb179a[_0x96ca('0x85')](_0x19ea24);}})[_0x96ca('0x2d')](handleError(_0xdb179a,null));};exports['getAvatar']=function(_0x1fea00,_0x38cb59,_0x5088a0){var _0x400795=path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],'server/files/images/avatars/default_avatar.png');var _0xb0214c={'where':{'id':_0x1fea00['params']['id']},'attributes':['id',_0x96ca('0x76')],'raw':!![]};return db[_0x96ca('0x55')]['find'](_0xb0214c)['then'](handleEntityNotFound(_0x38cb59,null))[_0x96ca('0x23')](function(_0x23122f){if(_0x23122f){if(!_[_0x96ca('0x82')](_0x23122f[_0x96ca('0x76')])){if(fs[_0x96ca('0x83')](path[_0x96ca('0x7c')](config['root'],_0x96ca('0x86'),_0x23122f[_0x96ca('0x76')]))){_0x400795=path['join'](config[_0x96ca('0x7d')],'server/files/images/avatars/',_0x23122f[_0x96ca('0x76')]);}}return _0x38cb59[_0x96ca('0x85')](_0x400795);}})[_0x96ca('0x2d')](handleError(_0x38cb59,null));};exports[_0x96ca('0x87')]=function(_0x4cf163,_0xed70bc,_0x7731dc){var _0x4cde99=path['join'](config[_0x96ca('0x7d')],_0x96ca('0x88'));var _0x1cdf94={'where':{'id':_0x4cf163[_0x96ca('0x59')]['id']},'attributes':['id',_0x96ca('0x79'),_0x96ca('0x89')],'raw':!![]};return db['ChatWebsite'][_0x96ca('0x61')](_0x1cdf94)[_0x96ca('0x23')](handleEntityNotFound(_0xed70bc,null))[_0x96ca('0x23')](function(_0x14b707){if(_0x14b707){if(!_[_0x96ca('0x82')](_0x14b707[_0x96ca('0x79')])){if(fs[_0x96ca('0x83')](path[_0x96ca('0x7c')](config['root'],_0x96ca('0x86'),_0x14b707['customerAvatar']))&&_0x14b707[_0x96ca('0x89')]){_0x4cde99=path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],'server/files/images/avatars/',_0x14b707['customerAvatar']);}}return _0xed70bc[_0x96ca('0x85')](_0x4cde99);}})['catch'](handleError(_0xed70bc,null));};exports[_0x96ca('0x8a')]=function(_0x1e5aab,_0x350cc4,_0x4a8f21){var _0x4c685d=path[_0x96ca('0x7c')](config['root'],_0x96ca('0x8b'));var _0x490c87={'where':{'id':_0x1e5aab[_0x96ca('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x96ca('0x55')][_0x96ca('0x61')](_0x490c87)[_0x96ca('0x23')](handleEntityNotFound(_0x350cc4,null))['then'](function(_0x1f8ade){if(_0x1f8ade){if(!_[_0x96ca('0x82')](_0x1f8ade['systemAvatar'])){if(fs[_0x96ca('0x83')](path['join'](config['root'],_0x96ca('0x86'),_0x1f8ade[_0x96ca('0x7b')]))){_0x4c685d=path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],_0x96ca('0x86'),_0x1f8ade[_0x96ca('0x7b')]);}}return _0x350cc4[_0x96ca('0x85')](_0x4c685d);}})[_0x96ca('0x2d')](handleError(_0x350cc4,null));};exports[_0x96ca('0x8c')]=function(_0x1114f7,_0x453514,_0x211bd4){var _0x5dfc16=require(_0x96ca('0x8d'));var _0x5f2717=new _0x5dfc16();var _0x3c183b=_0x5f2717[_0x96ca('0x8e')](_0x1114f7[_0x96ca('0x8f')][_0x96ca('0x90')])[_0x96ca('0x91')]();var _0x3503c3={'body':_0x1114f7[_0x96ca('0x64')],'channel':'chat'};var _0x250965=[];var _0x4aa859=[];var _0x654979={};var _0x3cb1ad=![];return db[_0x96ca('0x92')][_0x96ca('0x66')]()[_0x96ca('0x23')](function(_0x2e0949){if(!_0x2e0949){throw new db['Sequelize'][(_0x96ca('0x22'))](_0x96ca('0x93'));}_0x250965=_[_0x96ca('0x94')](_[_0x96ca('0x47')](_0x2e0949),[_0x96ca('0x95'),'updatedAt']);_0x4aa859=_[_0x96ca('0x94')](_[_0x96ca('0x47')](_0x2e0949),['createdAt',_0x96ca('0x96'),_0x96ca('0x97'),_0x96ca('0x98')]);if(_0x1114f7[_0x96ca('0x64')]['id']){delete _0x1114f7[_0x96ca('0x64')]['id'];}if(_[_0x96ca('0x82')](_0x1114f7[_0x96ca('0x64')][_0x96ca('0x99')])){throw new db[(_0x96ca('0x9a'))]['ValidationError'](_0x96ca('0x9b'));}if(_['isNil'](_0x1114f7[_0x96ca('0x64')]['body'])||_0x1114f7[_0x96ca('0x64')][_0x96ca('0x64')]===''){throw new db[(_0x96ca('0x9a'))][(_0x96ca('0x22'))](_0x96ca('0x9c'));}if(_[_0x96ca('0x82')](_0x1114f7[_0x96ca('0x64')][_0x96ca('0x9d')])){throw new db[(_0x96ca('0x9a'))][(_0x96ca('0x22'))](_0x96ca('0x9e')+_0x4aa859);}if(!_[_0x96ca('0x9f')](_0x4aa859,_0x1114f7[_0x96ca('0x64')][_0x96ca('0x9d')])){throw new db[(_0x96ca('0x9a'))][(_0x96ca('0x22'))](_0x96ca('0xa0')+_0x4aa859);}_0x654979[_0x1114f7[_0x96ca('0x64')][_0x96ca('0x9d')]]=_0x1114f7['body']['from'];})[_0x96ca('0x23')](function(){return db['ChatWebsite'][_0x96ca('0x61')]({'where':{'id':_0x1114f7[_0x96ca('0x59')]['id']},'include':[{'model':db[_0x96ca('0xa1')],'as':_0x96ca('0xa2'),'include':[{'model':db['CmContact'],'as':_0x96ca('0xa3'),'where':_0x654979,'limit':0x1,'order':[['updatedAt',_0x96ca('0xa4')]]}]},{'model':db[_0x96ca('0xa5')],'as':'Applications'}]});})[_0x96ca('0x23')](handleEntityNotFound(_0x453514,null))[_0x96ca('0x23')](function(_0x210100){if(_0x210100&&_0x210100[_0x96ca('0xa2')]){_0x3503c3['account']=_0x210100;_0x3503c3[_0x96ca('0xa6')]=_0x210100[_0x96ca('0xa7')];_0x3503c3[_0x96ca('0xa8')]=_0x210100['List'];_0x3503c3[_0x96ca('0xa6')]=_[_0x96ca('0xa9')](_0x3503c3[_0x96ca('0xa6')],['priority'],[_0x96ca('0xaa')]);if(_0x3503c3[_0x96ca('0xab')]['Applications']){delete _0x3503c3[_0x96ca('0xab')][_0x96ca('0xa7')];}if(_0x3503c3[_0x96ca('0xab')][_0x96ca('0xa2')]&&_0x3503c3[_0x96ca('0xab')][_0x96ca('0xa2')][_0x96ca('0xa3')]['length']){return _0x3503c3['account'][_0x96ca('0xa2')][_0x96ca('0xa3')][0x0];}var _0x141c75=_[_0x96ca('0x1b')](_0x1114f7[_0x96ca('0x64')],{'firstName':_0x1114f7['body'][_0x96ca('0x99')],'ListId':_0x210100[_0x96ca('0x98')]});_0x141c75[_0x1114f7[_0x96ca('0x64')]['mapKey']]=_0x1114f7[_0x96ca('0x64')]['from'];return db['CmContact'][_0x96ca('0x5c')](_0x141c75,{'fields':_0x250965,'raw':!![]});}})['then'](handleEntityNotFound(_0x453514,null))[_0x96ca('0x23')](function(_0x342818){_0x3503c3[_0x96ca('0xac')]=_0x342818;var _0x4c16a6=_0x1114f7[_0x96ca('0x64')][_0x96ca('0xad')];if(_0x1114f7[_0x96ca('0x8f')]['cf-connecting-ip']){_0x4c16a6=_0x1114f7['headers'][_0x96ca('0xae')];}else if(_0x1114f7['headers'][_0x96ca('0xaf')]){_0x4c16a6=_[_0x96ca('0xb0')](_0x1114f7[_0x96ca('0x8f')][_0x96ca('0xaf')]['split'](','));}if(_0x342818){var _0x98d7a7={'ContactId':_0x342818['id'],'ChatWebsiteId':_0x1114f7[_0x96ca('0x59')]['id'],'from':(_0x342818['firstName']||'')+'\x20'+(_0x342818[_0x96ca('0xb1')]||''),'customerIp':_0x4c16a6,'customerPort':_0x1114f7[_0x96ca('0x8f')]['x-real-port']?_0x1114f7[_0x96ca('0x8f')][_0x96ca('0xb2')]:null,'referer':_0x1114f7['body'][_0x96ca('0xb3')],'browserName':_0x3c183b[_0x96ca('0xb4')]['name']&&_0x3c183b[_0x96ca('0xb4')][_0x96ca('0xb5')]?util[_0x96ca('0xb6')](_0x96ca('0xb7'),_0x3c183b[_0x96ca('0xb4')][_0x96ca('0x3b')],_0x3c183b['browser']['version']):_0x96ca('0xb8'),'browserVersion':_0x3c183b[_0x96ca('0xb4')]['version']||'unknown','osName':util['format'](_0x96ca('0xb7'),_0x3c183b['os'][_0x96ca('0x3b')],_0x3c183b['os'][_0x96ca('0xb5')]),'osVersion':_0x3c183b['os'][_0x96ca('0xb5')],'deviceModel':_0x3c183b['device'][_0x96ca('0x45')]&&_0x3c183b[_0x96ca('0xb9')][_0x96ca('0xba')]?util[_0x96ca('0xb6')](_0x96ca('0xbb'),_0x3c183b[_0x96ca('0xb9')][_0x96ca('0x45')],_0x3c183b[_0x96ca('0xb9')][_0x96ca('0xba')],_0x3c183b['device']['type']):null,'deviceVendor':_0x3c183b['device'][_0x96ca('0xba')],'deviceType':_0x3c183b[_0x96ca('0xb9')][_0x96ca('0x43')],'formData':JSON[_0x96ca('0x28')](_0x1114f7[_0x96ca('0x64')])};var _0x5bdb38={'ChatWebsiteId':_0x1114f7[_0x96ca('0x59')]['id'],'closed':![]};if(_0x1114f7[_0x96ca('0x64')][_0x96ca('0xbc')]){_0x5bdb38[_0x96ca('0xbc')]=_0x1114f7[_0x96ca('0x64')]['threadId'];return db[_0x96ca('0xbd')][_0x96ca('0x61')]({'where':_0x5bdb38})[_0x96ca('0x23')](function(_0xa496dd){if(_0xa496dd){return[_0xa496dd,![]];}_0x98d7a7[_0x96ca('0xbc')]=_0x1114f7[_0x96ca('0x64')][_0x96ca('0xbc')];_0x98d7a7['externalUrl']=_0x1114f7[_0x96ca('0x64')]['externalUrl'];return db[_0x96ca('0xbd')]['create'](_0x98d7a7)[_0x96ca('0x23')](function(_0x1057c6){return[_0x1057c6,!![]];});});}_0x5bdb38[_0x96ca('0xbe')]=_0x342818['id'];if(_0x1114f7[_0x96ca('0x64')][_0x96ca('0xbf')]&&_0x1114f7[_0x96ca('0x64')][_0x96ca('0xbf')]['id']){_0x5bdb38['id']=_0x1114f7[_0x96ca('0x64')]['interaction']['id'];return db[_0x96ca('0xbd')][_0x96ca('0x61')]({'where':_0x5bdb38})['then'](function(_0x429a2d){if(_0x429a2d){return[_0x429a2d,![]];}return db[_0x96ca('0xbd')][_0x96ca('0x5c')](_0x98d7a7)[_0x96ca('0x23')](function(_0x2fee60){return[_0x2fee60,!![]];});});}return db[_0x96ca('0xbd')][_0x96ca('0x5c')](_0x98d7a7)['then'](function(_0x1dfbc4){return[_0x1dfbc4,!![]];});}})[_0x96ca('0xc0')](function(_0x2817de,_0x708cdd){if(_0x2817de){_0x3cb1ad=_0x708cdd;if(!_0x708cdd){var _0x2c3081={'from':(_0x3503c3['contact'][_0x96ca('0xc1')]||'')+'\x20'+(_0x3503c3[_0x96ca('0xac')][_0x96ca('0xb1')]||'')};if(_0x1114f7[_0x96ca('0x64')][_0x96ca('0xbc')]&&_0x1114f7['body'][_0x96ca('0xc2')]&&_0x1114f7[_0x96ca('0x64')][_0x96ca('0xbc')]!=_0x1114f7['body'][_0x96ca('0xc2')]){_0x2c3081['threadId']=_0x1114f7['body'][_0x96ca('0xc2')];}return _0x2817de[_0x96ca('0xc3')](_0x2c3081);}else{return _0x2817de;}}})[_0x96ca('0x23')](function(_0x1f213f){_0x3503c3[_0x96ca('0xbf')]=_0x1f213f['get']({'plain':!![]});_0x3503c3[_0x96ca('0xbf')][_0x96ca('0xc4')]=_0x3cb1ad;if(_0x3503c3[_0x96ca('0xbf')]['created']){if(_0x3503c3[_0x96ca('0xab')]['autoclose']){_0x3503c3['applications'][_0x96ca('0xc5')]({'id':0x0,'priority':_0x3503c3[_0x96ca('0xa6')][_0x96ca('0x5a')]+0x1,'app':_0x96ca('0xc6'),'appdata':_0x96ca('0xc7'),'interval':'*,*,*,*'});}}return db[_0x96ca('0xc8')]['create']({'body':_0x1114f7[_0x96ca('0x64')][_0x96ca('0x64')],'ChatWebsiteId':_0x1114f7[_0x96ca('0x59')]['id'],'ChatInteractionId':_0x1f213f['id'],'direction':'in','ContactId':_0x3503c3[_0x96ca('0xac')]['id'],'AttachmentId':_0x1114f7[_0x96ca('0x64')][_0x96ca('0xc9')]});})[_0x96ca('0x23')](function(_0x2cb3a5){_0x3503c3[_0x96ca('0x2c')]=_0x2cb3a5;if(_0x3503c3[_0x96ca('0xbf')][_0x96ca('0xca')]){return db[_0x96ca('0xcb')][_0x96ca('0x61')]({'attributes':['id',_0x96ca('0x3b')],'where':{'id':_0x3503c3[_0x96ca('0xbf')][_0x96ca('0xca')]}})[_0x96ca('0x23')](function(_0x571867){if(_0x571867){_0x3503c3[_0x96ca('0xa6')][_0x96ca('0xcc')]({'id':0x0,'priority':0x0,'app':_0x96ca('0xcd'),'appdata':_0x571867['name']+','+(_0x3503c3[_0x96ca('0xab')]['waitForTheAssignedAgent']||0xa),'interval':_0x96ca('0xce')});_0x3503c3['forcedOwnership']=!![];}return respondWithRpcPromise(_0x96ca('0xcf'),_0x96ca('0xd0'),_0x3503c3);});}return respondWithRpcPromise('Start',_0x96ca('0xd0'),_0x3503c3);})[_0x96ca('0x23')](function(_0xc395da){respondWithRpcPromise(_0x96ca('0xd1'),_0x96ca('0xd1'),{'event':_0x96ca('0x8c'),'message':_0xc395da},client9002);return _0xc395da;})[_0x96ca('0x23')](respondWithResult(_0x453514,null))[_0x96ca('0x2d')](handleError(_0x453514,null));};exports[_0x96ca('0xd2')]=function(_0x1d0312,_0x3e5f51,_0x3e74f8){var _0xd79573,_0x5aec32,_0x460d6e;var _0x2d1d8c=[];var _0x5dce40=[];var _0x2f4fe3={};return db['CmContact'][_0x96ca('0x66')]()[_0x96ca('0x23')](function(_0x1a62ef){if(!_0x1a62ef){throw new db[(_0x96ca('0x9a'))][(_0x96ca('0x22'))](_0x96ca('0x93'));}_0x5dce40=_[_0x96ca('0x94')](_[_0x96ca('0x47')](_0x1a62ef),[_0x96ca('0x95'),'updatedAt']);_0x2d1d8c=_[_0x96ca('0x94')](_[_0x96ca('0x47')](_0x1a62ef),[_0x96ca('0x95'),_0x96ca('0x96'),'CompanyId',_0x96ca('0x98')]);if(_0x1d0312['body']['id']){delete _0x1d0312['body']['id'];}if(_[_0x96ca('0x82')](_0x1d0312['body'][_0x96ca('0x99')])){throw _0x3e5f51[_0x96ca('0x2f')](0x1f4)[_0x96ca('0x3c')](new db[(_0x96ca('0x9a'))][(_0x96ca('0x22'))](_0x96ca('0x9b')));}if(_[_0x96ca('0x82')](_0x1d0312[_0x96ca('0x64')][_0x96ca('0x64')])||_0x1d0312[_0x96ca('0x64')]['body']===''){throw _0x3e5f51[_0x96ca('0x2f')](0x1f4)['send'](new db['Sequelize'][(_0x96ca('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x96ca('0x82')](_0x1d0312[_0x96ca('0x64')][_0x96ca('0xd3')])){throw _0x3e5f51['status'](0x1f4)[_0x96ca('0x3c')](new db['Sequelize'][(_0x96ca('0x22'))](_0x96ca('0xd4')+_0x2d1d8c));}if(!_[_0x96ca('0x9f')](_0x2d1d8c,_0x1d0312[_0x96ca('0x64')][_0x96ca('0xd3')])){throw _0x3e5f51[_0x96ca('0x2f')](0x1f4)[_0x96ca('0x3c')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d1d8c));}_0x2f4fe3[_0x1d0312[_0x96ca('0x64')][_0x96ca('0xd3')]]=_0x1d0312[_0x96ca('0x64')][_0x96ca('0x99')];})[_0x96ca('0x23')](function(){return db[_0x96ca('0x55')]['find']({'where':{'id':_0x1d0312['params']['id']},'include':[{'model':db['CmList'],'as':'List'}]});})[_0x96ca('0x23')](handleEntityNotFound(_0x3e5f51,null))[_0x96ca('0x23')](function(_0x5aa20c){if(_0x5aa20c&&_0x5aa20c['List']){_0x5aec32=_0x5aa20c;var _0x5e1a74=_['defaults'](_0x1d0312['body'],{'firstName':_0x1d0312[_0x96ca('0x64')][_0x96ca('0x99')],'phone':_0x1d0312['body'][_0x96ca('0x99')],'ListId':_0x5aa20c['ListId']});_0x5e1a74[_0x1d0312['body']['mapKeyOffline']]=_0x1d0312[_0x96ca('0x64')]['from'];return db[_0x96ca('0x92')][_0x96ca('0xd5')]({'where':_0x2f4fe3,'defaults':_0x5e1a74});}})[_0x96ca('0xc0')](function(_0xe9c40b){if(_0xe9c40b){_0x460d6e=_0xe9c40b;var _0x5a56bb=fs['readFileSync'](path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],_0x96ca('0xd6')),'utf8');var _0x69116b=ejs['render'](_0x5a56bb,{'body':_['toPairs'](_0x1d0312['body'][_0x96ca('0x64')]),'bodyTitle':_0x5aec32[_0x96ca('0xd7')]});return db[_0x96ca('0xd8')]['create']({'body':_0x69116b,'ContactId':_0xe9c40b['id'],'ChatWebsiteId':_0x5aec32['id']});}})[_0x96ca('0x23')](function(_0xea1aa7){if(_0xea1aa7){_0xd79573=_0xea1aa7;return db[_0x96ca('0xd9')][_0x96ca('0x6a')]({'where':{'service':!![]},'include':[{'model':db[_0x96ca('0xda')],'as':'Smtp','raw':!![]}]});}})[_0x96ca('0x23')](function(_0x161afa){if(_0x161afa&&_0x161afa[_0x96ca('0xdb')]&&_0x5aec32[_0x96ca('0xdc')]){var _0x446d02={'tls':{'rejectUnauthorized':![]}};if(_0x161afa[_0x96ca('0xdb')][_0x96ca('0xdd')]){_0x446d02[_0x96ca('0xdd')]=_0x161afa[_0x96ca('0xdb')][_0x96ca('0xdd')];}else{_0x446d02['host']=_0x161afa[_0x96ca('0xdb')]['host'];_0x446d02[_0x96ca('0xde')]=_0x161afa['Smtp'][_0x96ca('0xde')];_0x446d02[_0x96ca('0xdf')]=_0x161afa['Smtp'][_0x96ca('0xdf')];}if(_0x161afa[_0x96ca('0xdb')][_0x96ca('0xe0')]){_0x446d02[_0x96ca('0xe1')]={'user':_0x161afa['Smtp'][_0x96ca('0x5f')],'pass':_0x161afa[_0x96ca('0xdb')][_0x96ca('0xe2')]};}return respondWithRpcPromise(_0x96ca('0xe3'),_0x96ca('0xe4'),{'account':_0x446d02,'message':{'from':util[_0x96ca('0xb6')](_0x96ca('0xe5'),_0x161afa[_0x96ca('0x3b')],_0x161afa[_0x96ca('0xe6')]||_0x161afa['Smtp']['user']),'to':_0x5aec32[_0x96ca('0xdc')],'subject':_0x5aec32['offlineMessageSubject'],'text':_0xd79573[_0x96ca('0x64')]}},client9003)[_0x96ca('0x23')](function(){return _0xd79573;})['catch'](function(_0xe7b6d2){console[_0x96ca('0x29')](_0xe7b6d2);});}})[_0x96ca('0x23')](function(){if(_0xd79573){return _0xd79573;}})[_0x96ca('0x23')](respondWithResult(_0x3e5f51,null))[_0x96ca('0x2d')](handleError(_0x3e5f51,null));};exports[_0x96ca('0xe7')]=function(_0x1bbb18,_0x2bcc2c,_0x2b9d58){return db[_0x96ca('0xbd')][_0x96ca('0x61')]({'where':{'id':_0x1bbb18[_0x96ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x2bcc2c,null))['then'](function(_0x4aa26c){if(_0x4aa26c){return _0x4aa26c[_0x96ca('0xe7')](_0x1bbb18[_0x96ca('0x64')][_0x96ca('0x6e')],_[_0x96ca('0xe8')](_0x1bbb18[_0x96ca('0x64')],[_0x96ca('0x6e'),'id'])||{});}})[_0x96ca('0x23')](respondWithResult(_0x2bcc2c,null))[_0x96ca('0x2d')](handleError(_0x2bcc2c,null));};exports[_0x96ca('0xe9')]=function(_0x3f7299,_0x20cb34,_0x1ab432){var _0x1dc483={'raw':![],'where':{}};var _0x1c8bea={};var _0x4c0e52={'count':0x0,'rows':[]};return db[_0x96ca('0x55')][_0x96ca('0x6a')]({'where':{'id':_0x3f7299['params']['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x20cb34,null))[_0x96ca('0x23')](function(_0x5061cd){if(_0x5061cd){_0x1c8bea[_0x96ca('0x45')]=_['keys'](db['ChatInteraction'][_0x96ca('0x41')]);_0x1c8bea[_0x96ca('0x46')]=_[_0x96ca('0x47')](_0x3f7299['query']);_0x1c8bea[_0x96ca('0x48')]=_[_0x96ca('0x49')](_0x1c8bea[_0x96ca('0x45')],_0x1c8bea[_0x96ca('0x46')]);_0x1dc483[_0x96ca('0x4a')]=_[_0x96ca('0x49')](_0x1c8bea[_0x96ca('0x45')],qs[_0x96ca('0x4b')](_0x3f7299[_0x96ca('0x46')][_0x96ca('0x4b')]));_0x1dc483[_0x96ca('0x4a')]=_0x1dc483['attributes'][_0x96ca('0x5a')]?_0x1dc483[_0x96ca('0x4a')]:_0x1c8bea[_0x96ca('0x45')];if(!_0x3f7299['query'][_0x96ca('0x4c')]('nolimit')){_0x1dc483[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x3f7299[_0x96ca('0x46')]['limit']);_0x1dc483['offset']=qs['offset'](_0x3f7299[_0x96ca('0x46')]['offset']);}_0x1dc483[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x3f7299[_0x96ca('0x46')][_0x96ca('0x4f')]);_0x1dc483[_0x96ca('0x50')]=qs[_0x96ca('0x48')](_[_0x96ca('0x6b')](_0x3f7299[_0x96ca('0x46')],_0x1c8bea[_0x96ca('0x48')]));_0x1dc483['where'][_0x96ca('0x67')]=_0x5061cd['id'];if(_0x3f7299['query']['filter']){_0x1dc483[_0x96ca('0x50')]=_[_0x96ca('0x52')](_0x1dc483[_0x96ca('0x50')],{'$or':_[_0x96ca('0x40')](_0x1dc483[_0x96ca('0x4a')],function(_0x4dca04){var _0xc1e697={};_0xc1e697[_0x4dca04]={'$like':'%'+_0x3f7299[_0x96ca('0x46')]['filter']+'%'};return _0xc1e697;})});}_0x1dc483=_[_0x96ca('0x52')]({},_0x1dc483,_0x3f7299[_0x96ca('0x54')]);return db[_0x96ca('0xbd')][_0x96ca('0x32')]({'where':_0x1dc483[_0x96ca('0x50')]})['then'](function(_0x2b4f28){_0x4c0e52['count']=_0x2b4f28;if(_0x3f7299['query']['includeAll']){_0x1dc483['include']=[{'model':db[_0x96ca('0x92')],'as':'Contact','required':![]},{'model':db[_0x96ca('0xcb')],'as':_0x96ca('0xea'),'attributes':[_0x96ca('0x3b'),_0x96ca('0xeb'),'internal'],'required':![]},{'model':db[_0x96ca('0xec')],'as':_0x96ca('0xed'),'attributes':['id',_0x96ca('0x3b'),'color'],'where':_0x3f7299['query'][_0x96ca('0xee')]?{'id':_0x3f7299['query'][_0x96ca('0xee')]}:undefined,'required':_0x3f7299['query'][_0x96ca('0xee')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1dc483);})[_0x96ca('0x23')](function(_0x2f3d52){_0x4c0e52[_0x96ca('0x6c')]=_0x2f3d52;return _0x4c0e52;});}})[_0x96ca('0x23')](respondWithFilteredResult(_0x20cb34,_0x1dc483))[_0x96ca('0x2d')](handleError(_0x20cb34,null));};function iftimePromise(_0x147318,_0x1f5b1f){return respondWithRpcPromise('Command',_0x96ca('0xef'),{'command':_0x1f5b1f[_0x96ca('0xf0')]?util[_0x96ca('0xb6')](_0x96ca('0xf1'),_0x147318[_0x96ca('0xf2')],_0x1f5b1f[_0x96ca('0xf0')]):util[_0x96ca('0xb6')](_0x96ca('0xf3'),_0x147318[_0x96ca('0xf2')])},client9002)['then'](function(_0x111089){var _0xf83c0f=_0x111089&&_0x111089[_0x96ca('0xf4')](_0x96ca('0xf5'))>=0x0?!![]:![];logger[_0x96ca('0x24')](_0x96ca('0xf6'),_0x1f5b1f['id'],_0x147318['id'],_0x147318['interval'],_0xf83c0f?_0x96ca('0xf7'):_0x96ca('0xf8'),_0x1f5b1f['timezone']?_0x1f5b1f[_0x96ca('0xf0')]:_0x96ca('0xf9'));return _0xf83c0f;})[_0x96ca('0x2d')](function(_0x2f7325){logger[_0x96ca('0x29')](_0x96ca('0xf6'),_0x1f5b1f['id'],_0x147318['id'],_0x147318[_0x96ca('0xf2')],util[_0x96ca('0xfa')](_0x2f7325,{'showHidden':![],'depth':null}),_0x1f5b1f[_0x96ca('0xf0')]?_0x1f5b1f['timezone']:_0x96ca('0xf9'));return![];});}exports[_0x96ca('0xef')]=function(_0x565898,_0xd0e661,_0x630cd3){var _0x520e8c=0x0;var _0x158c30=0x0;var _0x50bd7a=![];var _0x26bb77;var _0x27bf86;return db[_0x96ca('0x55')][_0x96ca('0x61')]({'where':{'id':_0x565898['params']['id']},'include':[{'model':db[_0x96ca('0xfb')],'as':_0x96ca('0xfb'),'include':[{'model':db['Interval'],'as':_0x96ca('0xfc'),'attributes':['id',_0x96ca('0xf2')],'raw':!![]}]}]})[_0x96ca('0x23')](handleEntityNotFound(_0xd0e661,null))[_0x96ca('0x23')](function(_0x5e6688){if(_0x5e6688){_0x26bb77=_0x5e6688;return _0x5e6688['getProactiveActions']({'raw':!![]});}})[_0x96ca('0x23')](function(_0xfdf3e2){if(_0x26bb77){if(_0xfdf3e2){_0x27bf86=_0xfdf3e2;}}return require(_0x96ca('0x7f'))[_0x96ca('0x80')]();})['then'](function(_0x47b9ad){if(_0x47b9ad){_0x158c30=_0x47b9ad[_0x96ca('0xfd')];_0x50bd7a=_0x47b9ad[_0x96ca('0x81')];}})[_0x96ca('0x23')](function(){return db[_0x96ca('0xbd')]['count']({'where':{'closed':![]}});})[_0x96ca('0x23')](function(_0x540e68){_0x520e8c=_0x540e68;if(_0x158c30&&_0x540e68>_0x158c30){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x3ccd97){if(_0x3ccd97){_0x3ccd97[_0x96ca('0xfe')](_0x96ca('0xff'));}});}})[_0x96ca('0x23')](function(){if(_0x26bb77['Interval']&&_0x26bb77[_0x96ca('0xfb')][_0x96ca('0xfc')]){var _0x2e17bc=[];for(var _0xf218e2=0x0;_0xf218e2<_0x26bb77[_0x96ca('0xfb')]['Intervals'][_0x96ca('0x5a')];_0xf218e2++){var _0x3c9554=_0x26bb77['Interval'][_0x96ca('0xfc')][_0xf218e2][_0x96ca('0x38')]({'plain':!![]});_0x2e17bc[_0x96ca('0xc5')](iftimePromise(_0x3c9554,_0x26bb77));}return BPromise[_0x96ca('0x100')](_0x2e17bc)[_0x96ca('0x23')](function(_0x482b49){return _[_0x96ca('0x101')](_0x482b49);});}else{return!![];}})[_0x96ca('0x23')](function(_0x1bd372){var _0x402191=fs[_0x96ca('0x102')](path[_0x96ca('0x7c')](config[_0x96ca('0x7d')],_0x96ca('0x103')),_0x96ca('0x104'));var _0x6e42e6={'remote':_0x26bb77[_0x96ca('0x105')],'query':querystring['stringify'](_[_0x96ca('0x52')](_0x26bb77[_0x96ca('0x38')]({'plain':!![]}),{'customerIp':_0x565898[_0x96ca('0x8f')][_0x96ca('0xaf')]||_0x565898['headers'][_0x96ca('0x106')]||_0x565898['connection']['remoteAddress']||_0x565898['ip'],'referer':_0x565898['headers'][_0x96ca('0xb3')],'openedInteractions':_0x520e8c,'maxInteractions':_0x158c30,'virtual':_0x50bd7a[_0x96ca('0xfd')],'online':_0x1bd372,'custom':_0x50bd7a}))['replace'](/'/g,'\x5c\x27')};_0xd0e661[_0x96ca('0x3c')](ejs[_0x96ca('0x107')](Mustache[_0x96ca('0x107')](_0x402191,_0x6e42e6),{'proactiveActions':_0x27bf86,'alignment':_0x26bb77[_0x96ca('0x108')],'verticalAlignment':_0x26bb77[_0x96ca('0x109')],'div_color':_0x26bb77[_0x96ca('0x10a')],'text_color':_0x26bb77[_0x96ca('0x10b')]}));})[_0x96ca('0x2d')](handleError(_0xd0e661,null));};exports[_0x96ca('0x10c')]=function(_0xf3ac8b,_0x1761a4,_0x15397a){return db['ChatWebsite'][_0x96ca('0x6a')]({'where':{'id':_0xf3ac8b[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x1761a4,null))[_0x96ca('0x23')](function(_0x408d94){if(_0x408d94){return db[_0x96ca('0x10d')][_0x96ca('0x10e')](function(_0xf3be4a){return db[_0x96ca('0xa5')][_0x96ca('0x65')]({'where':{'ChatWebsiteId':_0xf3ac8b[_0x96ca('0x59')]['id']},'transaction':_0xf3be4a})[_0x96ca('0x23')](function(_0x2894e2){var _0x45ee7a=_[_0x96ca('0x40')](_0xf3ac8b['body'],function(_0x4f1999){_0x4f1999[_0x96ca('0x67')]=_0xf3ac8b[_0x96ca('0x59')]['id'];return _0x4f1999;});return db[_0x96ca('0xa5')]['bulkCreate'](_0x45ee7a,{'transaction':_0xf3be4a});});})[_0x96ca('0x23')](function(){return db[_0x96ca('0xa5')][_0x96ca('0x10f')]({'where':{'ChatWebsiteId':_0xf3ac8b[_0x96ca('0x59')]['id']},'order':_0x96ca('0x110')});});}})['then'](respondWithResult(_0x1761a4,null))['catch'](handleError(_0x1761a4,null));};exports[_0x96ca('0x111')]=function(_0x44f0b1,_0x1401d8,_0x200f73){var _0x509166={};var _0x5dcbc1={};var _0x40838f;var _0x524cf9;return db[_0x96ca('0x55')][_0x96ca('0x6a')]({'where':{'id':_0x44f0b1[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x1401d8,null))[_0x96ca('0x23')](function(_0x3e0bf1){if(_0x3e0bf1){_0x40838f=_0x3e0bf1;_0x5dcbc1['model']=_[_0x96ca('0x47')](db[_0x96ca('0xa5')][_0x96ca('0x41')]);_0x5dcbc1[_0x96ca('0x46')]=_[_0x96ca('0x47')](_0x44f0b1[_0x96ca('0x46')]);_0x5dcbc1['filters']=_[_0x96ca('0x49')](_0x5dcbc1[_0x96ca('0x45')],_0x5dcbc1[_0x96ca('0x46')]);_0x509166[_0x96ca('0x4a')]=_['intersection'](_0x5dcbc1['model'],qs[_0x96ca('0x4b')](_0x44f0b1[_0x96ca('0x46')][_0x96ca('0x4b')]));_0x509166[_0x96ca('0x4a')]=_0x509166[_0x96ca('0x4a')][_0x96ca('0x5a')]?_0x509166['attributes']:_0x5dcbc1[_0x96ca('0x45')];_0x509166[_0x96ca('0x4e')]=qs['sort'](_0x44f0b1[_0x96ca('0x46')][_0x96ca('0x4f')]);_0x509166[_0x96ca('0x50')]=qs[_0x96ca('0x48')](_[_0x96ca('0x6b')](_0x44f0b1[_0x96ca('0x46')],_0x5dcbc1['filters']));if(_0x44f0b1[_0x96ca('0x46')][_0x96ca('0x51')]){_0x509166[_0x96ca('0x50')]=_[_0x96ca('0x52')](_0x509166[_0x96ca('0x50')],{'$or':_[_0x96ca('0x40')](_0x509166[_0x96ca('0x4a')],function(_0x4dd69f){var _0x1fe13f={};_0x1fe13f[_0x4dd69f]={'$like':'%'+_0x44f0b1[_0x96ca('0x46')]['filter']+'%'};return _0x1fe13f;})});}_0x509166=_[_0x96ca('0x52')]({},_0x509166,_0x44f0b1[_0x96ca('0x54')]);return _0x40838f[_0x96ca('0x111')](_0x509166);}})[_0x96ca('0x23')](function(_0x518ea4){if(_0x518ea4){_0x524cf9=_0x518ea4['length'];if(!_0x44f0b1[_0x96ca('0x46')][_0x96ca('0x4c')](_0x96ca('0x4d'))){_0x509166[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x44f0b1[_0x96ca('0x46')][_0x96ca('0x34')]);_0x509166[_0x96ca('0x33')]=qs[_0x96ca('0x33')](_0x44f0b1[_0x96ca('0x46')][_0x96ca('0x33')]);}return _0x40838f[_0x96ca('0x111')](_0x509166);}})[_0x96ca('0x23')](function(_0x3bd678){if(_0x3bd678){return _0x3bd678?{'count':_0x524cf9,'rows':_0x3bd678}:null;}})[_0x96ca('0x23')](respondWithResult(_0x1401d8,null))[_0x96ca('0x2d')](handleError(_0x1401d8,null));};exports[_0x96ca('0x112')]=function(_0xe1df76,_0x17062e,_0x349d5e){return db[_0x96ca('0x113')][_0x96ca('0x61')]({'where':{'id':_0xe1df76['params']['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x17062e,null))[_0x96ca('0x23')](function(_0x1b9a04){if(_0x1b9a04){return _0x1b9a04[_0x96ca('0x112')](_0xe1df76['body'][_0x96ca('0x6e')],_[_0x96ca('0xe8')](_0xe1df76[_0x96ca('0x64')],[_0x96ca('0x6e'),'id'])||{});}})[_0x96ca('0x23')](respondWithResult(_0x17062e,null))[_0x96ca('0x2d')](handleError(_0x17062e,null));};exports[_0x96ca('0x114')]=function(_0x41a6a3,_0x2ca612,_0x4446e8){var _0x1488fe={};var _0x1e31a8={};var _0x48303f;var _0x285cc0;return db[_0x96ca('0x55')][_0x96ca('0x6a')]({'where':{'id':_0x41a6a3[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x2ca612,null))[_0x96ca('0x23')](function(_0x16f076){if(_0x16f076){_0x48303f=_0x16f076;_0x1e31a8[_0x96ca('0x45')]=_[_0x96ca('0x47')](db[_0x96ca('0x115')]['rawAttributes']);_0x1e31a8[_0x96ca('0x46')]=_['keys'](_0x41a6a3[_0x96ca('0x46')]);_0x1e31a8[_0x96ca('0x48')]=_[_0x96ca('0x49')](_0x1e31a8['model'],_0x1e31a8[_0x96ca('0x46')]);_0x1488fe['attributes']=_[_0x96ca('0x49')](_0x1e31a8[_0x96ca('0x45')],qs[_0x96ca('0x4b')](_0x41a6a3[_0x96ca('0x46')][_0x96ca('0x4b')]));_0x1488fe[_0x96ca('0x4a')]=_0x1488fe[_0x96ca('0x4a')]['length']?_0x1488fe[_0x96ca('0x4a')]:_0x1e31a8[_0x96ca('0x45')];_0x1488fe[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x41a6a3[_0x96ca('0x46')][_0x96ca('0x4f')]);_0x1488fe[_0x96ca('0x50')]=qs['filters'](_[_0x96ca('0x6b')](_0x41a6a3[_0x96ca('0x46')],_0x1e31a8[_0x96ca('0x48')]));if(_0x41a6a3[_0x96ca('0x46')]['filter']){_0x1488fe['where']=_[_0x96ca('0x52')](_0x1488fe[_0x96ca('0x50')],{'$or':_['map'](_0x1488fe[_0x96ca('0x4a')],function(_0x11ade4){var _0xb4ec08={};_0xb4ec08[_0x11ade4]={'$like':'%'+_0x41a6a3[_0x96ca('0x46')][_0x96ca('0x51')]+'%'};return _0xb4ec08;})});}_0x1488fe=_[_0x96ca('0x52')]({},_0x1488fe,_0x41a6a3[_0x96ca('0x54')]);return _0x48303f['getProactiveActions'](_0x1488fe);}})[_0x96ca('0x23')](function(_0x2c8a0b){if(_0x2c8a0b){_0x285cc0=_0x2c8a0b['length'];if(!_0x41a6a3['query'][_0x96ca('0x4c')](_0x96ca('0x4d'))){_0x1488fe[_0x96ca('0x34')]=qs['limit'](_0x41a6a3[_0x96ca('0x46')][_0x96ca('0x34')]);_0x1488fe[_0x96ca('0x33')]=qs['offset'](_0x41a6a3[_0x96ca('0x46')]['offset']);}return _0x48303f['getProactiveActions'](_0x1488fe);}})[_0x96ca('0x23')](function(_0x1a4abb){if(_0x1a4abb){return _0x1a4abb?{'count':_0x285cc0,'rows':_0x1a4abb}:null;}})['then'](respondWithResult(_0x2ca612,null))[_0x96ca('0x2d')](handleError(_0x2ca612,null));};exports[_0x96ca('0x116')]=function(_0x13fb7b,_0x198484,_0x2e6c9b){var _0x31aab5=_0x13fb7b[_0x96ca('0x46')][_0x96ca('0x117')]===_0x96ca('0x118')?_0x96ca('0x119'):_0x96ca('0x11a');return db['ChatWebsite'][_0x96ca('0x61')]({'attributes':['id',_0x31aab5],'where':{'id':_0x13fb7b[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x198484,null))[_0x96ca('0x23')](function(_0xf523c8){if(_0xf523c8){var _0x174451=_0xf523c8[_0x31aab5];var _0x26216c=_0x174451&&_0x174451[_0x96ca('0x11b')]?_0x174451[_0x96ca('0x11b')]:[];_0x198484[_0x96ca('0x3c')]({'fromKey':_['isNil'](_0x174451[_0x96ca('0x11c')])?undefined:_0x174451[_0x96ca('0x11c')],'count':_0x26216c['length'],'rows':_0x26216c});}})[_0x96ca('0x2d')](handleError(_0x198484,null));};exports['getOfflineMessages']=function(_0x7bffdc,_0x239d3c,_0xf372a2){var _0x5d651f={'raw':![],'where':{}};var _0xf809b2={};var _0x5c0411={'count':0x0,'rows':[]};return db[_0x96ca('0x55')][_0x96ca('0x6a')]({'where':{'id':_0x7bffdc[_0x96ca('0x59')]['id']}})['then'](handleEntityNotFound(_0x239d3c,null))[_0x96ca('0x23')](function(_0x56de44){if(_0x56de44){_0xf809b2['model']=_[_0x96ca('0x47')](db[_0x96ca('0xd8')]['rawAttributes']);_0xf809b2[_0x96ca('0x46')]=_[_0x96ca('0x47')](_0x7bffdc[_0x96ca('0x46')]);_0xf809b2['filters']=_['intersection'](_0xf809b2[_0x96ca('0x45')],_0xf809b2[_0x96ca('0x46')]);_0x5d651f['attributes']=_['intersection'](_0xf809b2['model'],qs['fields'](_0x7bffdc['query']['fields']));_0x5d651f['attributes']=_0x5d651f[_0x96ca('0x4a')]['length']?_0x5d651f['attributes']:_0xf809b2[_0x96ca('0x45')];if(!_0x7bffdc[_0x96ca('0x46')][_0x96ca('0x4c')](_0x96ca('0x4d'))){_0x5d651f[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x7bffdc['query'][_0x96ca('0x34')]);_0x5d651f[_0x96ca('0x33')]=qs[_0x96ca('0x33')](_0x7bffdc[_0x96ca('0x46')][_0x96ca('0x33')]);}_0x5d651f[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x7bffdc[_0x96ca('0x46')][_0x96ca('0x4f')]);_0x5d651f['where']=qs[_0x96ca('0x48')](_[_0x96ca('0x6b')](_0x7bffdc[_0x96ca('0x46')],_0xf809b2[_0x96ca('0x48')]));_0x5d651f[_0x96ca('0x50')][_0x96ca('0x67')]=_0x56de44['id'];if(_0x7bffdc['query']['filter']){_0x5d651f['where']=_[_0x96ca('0x52')](_0x5d651f[_0x96ca('0x50')],{'$or':_[_0x96ca('0x40')](_0x5d651f[_0x96ca('0x4a')],function(_0x3a8a11){var _0x1acb8f={};_0x1acb8f[_0x3a8a11]={'$like':'%'+_0x7bffdc[_0x96ca('0x46')][_0x96ca('0x51')]+'%'};return _0x1acb8f;})});}_0x5d651f=_[_0x96ca('0x52')]({},_0x5d651f,_0x7bffdc['options']);return db[_0x96ca('0xd8')]['count']({'where':_0x5d651f[_0x96ca('0x50')]})[_0x96ca('0x23')](function(_0x3e28ef){_0x5c0411['count']=_0x3e28ef;if(_0x7bffdc[_0x96ca('0x46')][_0x96ca('0x5b')]){_0x5d651f['include']=[{'all':!![]}];}else{_0x5d651f[_0x96ca('0x56')]=[{'model':db[_0x96ca('0x92')],'as':_0x96ca('0x11d'),'required':![]}];}return db['ChatOfflineMessage'][_0x96ca('0x57')](_0x5d651f);})[_0x96ca('0x23')](function(_0x3d4c64){_0x5c0411['rows']=_0x3d4c64;return _0x5c0411;});}})[_0x96ca('0x23')](respondWithFilteredResult(_0x239d3c,_0x5d651f))[_0x96ca('0x2d')](handleError(_0x239d3c,null));};exports[_0x96ca('0x11e')]=function(_0x3ed29f,_0x8e3047,_0x3403f3){return db[_0x96ca('0x55')]['find']({'where':{'id':_0x3ed29f[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x8e3047,null))['then'](function(_0xb079b6){if(_0xb079b6){return _0xb079b6[_0x96ca('0x11e')](_0x3ed29f[_0x96ca('0x64')][_0x96ca('0x6e')],_[_0x96ca('0xe8')](_0x3ed29f[_0x96ca('0x64')],[_0x96ca('0x6e'),'id'])||{})[_0x96ca('0xc0')](function(_0x19c91f){for(var _0x48729d=0x0;_0x48729d<_0x3ed29f[_0x96ca('0x64')][_0x96ca('0x6e')][_0x96ca('0x5a')];_0x48729d+=0x1){socket[_0x96ca('0x11f')]('userChatWebsite:save',{'UserId':_0x3ed29f[_0x96ca('0x64')][_0x96ca('0x6e')][_0x48729d],'ChatWebsiteId':_0x3ed29f[_0x96ca('0x59')]['id']});}return _0x19c91f;});}})['then'](respondWithResult(_0x8e3047,null))[_0x96ca('0x2d')](handleError(_0x8e3047,null));};exports[_0x96ca('0x120')]=function(_0x157629,_0x48cf7f,_0x687047){return db[_0x96ca('0x55')]['find']({'where':{'id':_0x157629[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x48cf7f,null))[_0x96ca('0x23')](function(_0x566567){if(_0x566567){return _0x566567[_0x96ca('0x120')](_0x157629[_0x96ca('0x46')][_0x96ca('0x6e')])[_0x96ca('0x23')](function(){if(_[_0x96ca('0x121')](_0x157629[_0x96ca('0x46')][_0x96ca('0x6e')])){for(var _0x3cc74b=0x0;_0x3cc74b<_0x157629[_0x96ca('0x46')][_0x96ca('0x6e')]['length'];_0x3cc74b+=0x1){socket[_0x96ca('0x11f')](_0x96ca('0x122'),{'UserId':Number(_0x157629['query'][_0x96ca('0x6e')][_0x3cc74b]),'ChatWebsiteId':Number(_0x157629[_0x96ca('0x59')]['id'])});}}else{socket[_0x96ca('0x11f')](_0x96ca('0x122'),{'UserId':Number(_0x157629[_0x96ca('0x46')][_0x96ca('0x6e')]),'ChatWebsiteId':Number(_0x157629[_0x96ca('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x48cf7f,null))[_0x96ca('0x2d')](handleError(_0x48cf7f,null));};exports[_0x96ca('0x123')]=function(_0x5355d2,_0x1cd77,_0x2a0c0c){var _0x4c0a54={};var _0x5b594f={};var _0x2abf6b;var _0x55b047;return db['ChatWebsite'][_0x96ca('0x6a')]({'where':{'id':_0x5355d2[_0x96ca('0x59')]['id']}})[_0x96ca('0x23')](handleEntityNotFound(_0x1cd77,null))[_0x96ca('0x23')](function(_0x3abb1d){if(_0x3abb1d){_0x2abf6b=_0x3abb1d;_0x5b594f[_0x96ca('0x45')]=_[_0x96ca('0x47')](db[_0x96ca('0xcb')][_0x96ca('0x41')]);_0x5b594f[_0x96ca('0x46')]=_['keys'](_0x5355d2[_0x96ca('0x46')]);_0x5b594f[_0x96ca('0x48')]=_[_0x96ca('0x49')](_0x5b594f['model'],_0x5b594f[_0x96ca('0x46')]);_0x4c0a54[_0x96ca('0x4a')]=_[_0x96ca('0x49')](_0x5b594f['model'],qs[_0x96ca('0x4b')](_0x5355d2[_0x96ca('0x46')]['fields']));_0x4c0a54[_0x96ca('0x4a')]=_0x4c0a54[_0x96ca('0x4a')][_0x96ca('0x5a')]?_0x4c0a54[_0x96ca('0x4a')]:_0x5b594f['model'];_0x4c0a54[_0x96ca('0x4e')]=qs[_0x96ca('0x4f')](_0x5355d2[_0x96ca('0x46')]['sort']);_0x4c0a54[_0x96ca('0x50')]=qs[_0x96ca('0x48')](_[_0x96ca('0x6b')](_0x5355d2[_0x96ca('0x46')],_0x5b594f[_0x96ca('0x48')]));if(_0x5355d2[_0x96ca('0x46')][_0x96ca('0x51')]){_0x4c0a54['where']=_['merge'](_0x4c0a54[_0x96ca('0x50')],{'$or':_[_0x96ca('0x40')](_0x4c0a54[_0x96ca('0x4a')],function(_0x1d0e47){var _0x6cb5a={};_0x6cb5a[_0x1d0e47]={'$like':'%'+_0x5355d2[_0x96ca('0x46')][_0x96ca('0x51')]+'%'};return _0x6cb5a;})});}_0x4c0a54=_[_0x96ca('0x52')]({},_0x4c0a54,_0x5355d2[_0x96ca('0x54')]);return _0x2abf6b[_0x96ca('0x123')](_0x4c0a54);}})[_0x96ca('0x23')](function(_0x399148){if(_0x399148){_0x55b047=_0x399148[_0x96ca('0x5a')];if(!_0x5355d2['query'][_0x96ca('0x4c')]('nolimit')){_0x4c0a54[_0x96ca('0x34')]=qs[_0x96ca('0x34')](_0x5355d2[_0x96ca('0x46')][_0x96ca('0x34')]);_0x4c0a54[_0x96ca('0x33')]=qs[_0x96ca('0x33')](_0x5355d2[_0x96ca('0x46')][_0x96ca('0x33')]);}return _0x2abf6b['getAgents'](_0x4c0a54);}})['then'](function(_0x155409){if(_0x155409){return _0x155409?{'count':_0x55b047,'rows':_0x155409}:null;}})[_0x96ca('0x23')](respondWithResult(_0x1cd77,null))[_0x96ca('0x2d')](handleError(_0x1cd77,null));}; \ No newline at end of file +var _0xe72f=['tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','interval','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','readFileSync','server/files/chat/iframe.js','remote','connection','referer','replace','alignment','verticalAlignment','color','textColor','addApplications','sequelize','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.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','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','send','index','ChatWebsite','fieldName','type','key','map','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','Pause','mandatoryDispositionPause','rawAttributes','intersection','find','create','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','findOne','length','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','List','Contacts','ChatApplication','Applications','account','list','applications','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','browser','version','%s\x20%s','unknown','format','vendor','device','stringify','threadId','ChatInteraction','externalUrl','interaction','firstName','messageId','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','startRouting','EventManager','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','spread','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','User','Owner','internal','Tag','Tags'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0xe72f,0x14b));var _0xfe72=function(_0x3c1871,_0x497b6a){_0x3c1871=_0x3c1871-0x0;var _0x1b47d4=_0xe72f[_0x3c1871];return _0x1b47d4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe72('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfe72('0x1'));var rp=require(_0xfe72('0x2'));var moment=require(_0xfe72('0x3'));var BPromise=require(_0xfe72('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe72('0x5'));var sox=require(_0xfe72('0x6'));var csv=require(_0xfe72('0x7'));var ejs=require(_0xfe72('0x8'));var fs=require('fs');var _=require(_0xfe72('0x9'));var squel=require(_0xfe72('0xa'));var crypto=require(_0xfe72('0xb'));var jsforce=require(_0xfe72('0xc'));var deskjs=require(_0xfe72('0xd'));var toCsv=require(_0xfe72('0x7'));var querystring=require(_0xfe72('0xe'));var Papa=require(_0xfe72('0xf'));var Redis=require(_0xfe72('0x10'));var authService=require(_0xfe72('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe72('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfe72('0x13'));var db=require(_0xfe72('0x14'))['db'];config[_0xfe72('0x15')]=_[_0xfe72('0x16')](config['redis'],{'host':_0xfe72('0x17'),'port':0x18eb});var socket=require(_0xfe72('0x18'))(new Redis(config['redis']));require(_0xfe72('0x19'))[_0xfe72('0x1a')](socket);var jayson=require(_0xfe72('0x1b'));var client=jayson[_0xfe72('0x1c')][_0xfe72('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xfe72('0x1d')]({'port':0x232a});var client9003=jayson[_0xfe72('0x1c')]['http']({'port':0x232b});function checkPasswordPattern(_0x2d43d1,_0x1d3998,_0x250691){if(_0x250691){var _0x1d8ae5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d8ae5['test'](_0x1d3998)){return _0x2d43d1;}else{throw new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))](_0xfe72('0x20'));}}else{return _0x2d43d1;}}function respondWithRpcPromise(_0x338914,_0x42f7a3,_0x5dbdd2,_0x1b6b23){return new BPromise(function(_0x124d31,_0x368db3){var _0x17469b=_0x1b6b23||client;return _0x17469b[_0xfe72('0x21')](_0x338914,_0x5dbdd2)[_0xfe72('0x22')](function(_0x5ac82c){logger['info'](_0xfe72('0x23'),_0x42f7a3,_0xfe72('0x24'));logger[_0xfe72('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x42f7a3,_0xfe72('0x24'),JSON['stringify'](_0x5ac82c));if(_0x5ac82c[_0xfe72('0x26')]){if(_0x5ac82c[_0xfe72('0x26')][_0xfe72('0x27')]===0x1f4){logger[_0xfe72('0x26')](_0xfe72('0x23'),_0x42f7a3,_0x5ac82c[_0xfe72('0x26')][_0xfe72('0x28')]);return _0x368db3(_0x5ac82c['error']['message']);}logger[_0xfe72('0x26')](_0xfe72('0x23'),_0x42f7a3,_0x5ac82c[_0xfe72('0x26')][_0xfe72('0x28')]);return _0x124d31(_0x5ac82c[_0xfe72('0x26')][_0xfe72('0x28')]);}else{logger[_0xfe72('0x29')]('ChatWebsite,\x20%s,\x20%s',_0x42f7a3,'request\x20sent');_0x124d31(_0x5ac82c[_0xfe72('0x2a')][_0xfe72('0x28')]);}})[_0xfe72('0x2b')](function(_0x2d12ec){logger[_0xfe72('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x42f7a3,_0x2d12ec);_0x368db3(_0x2d12ec);});});}function respondWithStatusCode(_0x21aab9,_0x130488){_0x130488=_0x130488||0xcc;return function(_0x2dc9ad){if(_0x2dc9ad){return _0x21aab9['sendStatus'](_0x130488);}return _0x21aab9['status'](_0x130488)[_0xfe72('0x2c')]();};}function respondWithResult(_0x4698af,_0x53b61f){_0x53b61f=_0x53b61f||0xc8;return function(_0x4d0326){if(_0x4d0326){return _0x4698af[_0xfe72('0x2d')](_0x53b61f)[_0xfe72('0x2e')](_0x4d0326);}};}function respondWithFilteredResult(_0x3d7786,_0x4ab2f3){return function(_0xfccbb2){if(_0xfccbb2){var _0x542293=_0xfccbb2[_0xfe72('0x2f')],_0x2e235e=_0x4ab2f3[_0xfe72('0x30')],_0x104c2d=_0x4ab2f3[_0xfe72('0x30')]+_0x4ab2f3[_0xfe72('0x31')],_0xa6eb;if(_0x104c2d>=_0x542293){_0x104c2d=_0x542293;_0xa6eb=0xc8;}else{_0xa6eb=0xce;}_0x3d7786[_0xfe72('0x2d')](_0xa6eb);return _0x3d7786[_0xfe72('0x32')](_0xfe72('0x33'),_0x2e235e+'-'+_0x104c2d+'/'+_0x542293)['json'](_0xfccbb2);}return null;};}function patchUpdates(_0x12f57a){return function(_0x218a88){try{jsonpatch[_0xfe72('0x34')](_0x218a88,_0x12f57a,!![]);}catch(_0x41735c){return BPromise['reject'](_0x41735c);}return _0x218a88[_0xfe72('0x35')]();};}function saveUpdates(_0x332d44,_0x4a57ae){return function(_0x4dd65d){if(_0x4dd65d){return _0x4dd65d[_0xfe72('0x36')](_0x332d44)[_0xfe72('0x22')](function(_0x8e619d){return _0x8e619d;});}return null;};}function removeEntity(_0x1082c0,_0x2b8e15){return function(_0x41eb71){if(_0x41eb71){return _0x41eb71[_0xfe72('0x37')]()[_0xfe72('0x22')](function(){var _0x231969=_0x41eb71['get']({'plain':!![]});var _0x24277a=_0xfe72('0x38');return db[_0xfe72('0x39')]['destroy']({'where':{'type':_0x24277a,'resourceId':_0x231969['id']}})[_0xfe72('0x22')](function(){return _0x41eb71;});})[_0xfe72('0x22')](function(){_0x1082c0['status'](0xcc)[_0xfe72('0x2c')]();});}};}function handleEntityNotFound(_0xb762d,_0x2a0da0){return function(_0x1b3597){if(!_0x1b3597){_0xb762d[_0xfe72('0x3a')](0x194);}return _0x1b3597;};}function handleError(_0x36bff2,_0x6ae79a){_0x6ae79a=_0x6ae79a||0x1f4;return function(_0x163ccc){logger[_0xfe72('0x26')](_0x163ccc[_0xfe72('0x3b')]);if(_0x163ccc[_0xfe72('0x3c')]){delete _0x163ccc[_0xfe72('0x3c')];}_0x36bff2[_0xfe72('0x2d')](_0x6ae79a)[_0xfe72('0x3d')](_0x163ccc);};}exports[_0xfe72('0x3e')]=function(_0xba2056,_0x58e241){var _0xbc4a8={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x9f2e9={},_0x5c514e={'count':0x0,'rows':[]};var _0x19e2f4=_['map'](db[_0xfe72('0x3f')]['rawAttributes'],function(_0x342748){return{'name':_0x342748[_0xfe72('0x40')],'type':_0x342748[_0xfe72('0x41')][_0xfe72('0x42')]};});_0x9f2e9['model']=_[_0xfe72('0x43')](_0x19e2f4,'name');_0x9f2e9[_0xfe72('0x44')]=_[_0xfe72('0x45')](_0xba2056[_0xfe72('0x44')]);_0x9f2e9[_0xfe72('0x46')]=_['intersection'](_0x9f2e9[_0xfe72('0x47')],_0x9f2e9[_0xfe72('0x44')]);_0xbc4a8[_0xfe72('0x48')]=_['intersection'](_0x9f2e9[_0xfe72('0x47')],qs[_0xfe72('0x49')](_0xba2056[_0xfe72('0x44')][_0xfe72('0x49')]));_0xbc4a8['attributes']=_0xbc4a8[_0xfe72('0x48')]['length']?_0xbc4a8['attributes']:_0x9f2e9[_0xfe72('0x47')];if(!_0xba2056[_0xfe72('0x44')][_0xfe72('0x4a')](_0xfe72('0x4b'))){_0xbc4a8['limit']=qs[_0xfe72('0x31')](_0xba2056[_0xfe72('0x44')][_0xfe72('0x31')]);_0xbc4a8[_0xfe72('0x30')]=qs[_0xfe72('0x30')](_0xba2056[_0xfe72('0x44')]['offset']);}_0xbc4a8[_0xfe72('0x4c')]=qs[_0xfe72('0x4d')](_0xba2056[_0xfe72('0x44')][_0xfe72('0x4d')]);_0xbc4a8['where']=qs[_0xfe72('0x46')](_[_0xfe72('0x4e')](_0xba2056[_0xfe72('0x44')],_0x9f2e9[_0xfe72('0x46')]),_0x19e2f4);if(_0xba2056[_0xfe72('0x44')][_0xfe72('0x4f')]){_0xbc4a8[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0xbc4a8[_0xfe72('0x50')],{'$or':_[_0xfe72('0x43')](_0x19e2f4,function(_0x5a7d85){if(_0x5a7d85['type']!==_0xfe72('0x52')){var _0x3cc02d={};_0x3cc02d[_0x5a7d85[_0xfe72('0x3c')]]={'$like':'%'+_0xba2056[_0xfe72('0x44')]['filter']+'%'};return _0x3cc02d;}})});}_0xbc4a8=_[_0xfe72('0x51')]({},_0xbc4a8,_0xba2056[_0xfe72('0x53')]);var _0x1a4d76={'where':_0xbc4a8['where']};return db[_0xfe72('0x3f')]['count'](_0x1a4d76)[_0xfe72('0x22')](function(_0x31b27a){_0x5c514e[_0xfe72('0x2f')]=_0x31b27a;if(_0xba2056['query'][_0xfe72('0x54')]){_0xbc4a8[_0xfe72('0x55')]=[{'all':!![]}];}return db['ChatWebsite'][_0xfe72('0x56')](_0xbc4a8);})[_0xfe72('0x22')](function(_0x18567d){_0x5c514e[_0xfe72('0x57')]=_0x18567d;return _0x5c514e;})[_0xfe72('0x22')](respondWithFilteredResult(_0x58e241,_0xbc4a8))[_0xfe72('0x2b')](handleError(_0x58e241,null));};exports['show']=function(_0x2e8366,_0x160cc0){var _0x4bb19f={'raw':![],'where':{'id':_0x2e8366[_0xfe72('0x58')]['id']},'include':[{'model':db[_0xfe72('0x59')],'as':_0xfe72('0x5a')}]},_0x534323={};_0x534323['model']=_[_0xfe72('0x45')](db['ChatWebsite'][_0xfe72('0x5b')]);_0x534323[_0xfe72('0x44')]=_['keys'](_0x2e8366['query']);_0x534323[_0xfe72('0x46')]=_[_0xfe72('0x5c')](_0x534323[_0xfe72('0x47')],_0x534323[_0xfe72('0x44')]);_0x4bb19f[_0xfe72('0x48')]=_['intersection'](_0x534323[_0xfe72('0x47')],qs['fields'](_0x2e8366[_0xfe72('0x44')][_0xfe72('0x49')]));_0x4bb19f[_0xfe72('0x48')]=_0x4bb19f[_0xfe72('0x48')]['length']?_0x4bb19f['attributes']:_0x534323[_0xfe72('0x47')];if(_0x2e8366[_0xfe72('0x44')][_0xfe72('0x54')]){_0x4bb19f[_0xfe72('0x55')]=[{'all':!![]}];}_0x4bb19f=_[_0xfe72('0x51')]({},_0x4bb19f,_0x2e8366['options']);return db[_0xfe72('0x3f')][_0xfe72('0x5d')](_0x4bb19f)[_0xfe72('0x22')](handleEntityNotFound(_0x160cc0,null))[_0xfe72('0x22')](respondWithResult(_0x160cc0,null))[_0xfe72('0x2b')](handleError(_0x160cc0,null));};exports[_0xfe72('0x5e')]=function(_0x504323,_0x2aab3f){return db[_0xfe72('0x3f')][_0xfe72('0x5e')](_0x504323['body'],{})[_0xfe72('0x22')](function(_0x447c59){var _0x22c603=_0x504323[_0xfe72('0x5f')][_0xfe72('0x60')]({'plain':!![]});if(!_0x22c603)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22c603[_0xfe72('0x61')]===_0xfe72('0x5f')){var _0x11f757=_0x447c59[_0xfe72('0x60')]({'plain':!![]});var _0x111bf7=_0xfe72('0x38');return db[_0xfe72('0x62')][_0xfe72('0x5d')]({'where':{'name':_0x111bf7,'userProfileId':_0x22c603['userProfileId']},'raw':!![]})[_0xfe72('0x22')](function(_0x5f4c19){if(_0x5f4c19&&_0x5f4c19[_0xfe72('0x63')]===0x0){return db['UserProfileResource'][_0xfe72('0x5e')]({'name':_0x11f757['name'],'resourceId':_0x11f757['id'],'type':_0x5f4c19['name'],'sectionId':_0x5f4c19['id']},{})['then'](function(){return _0x447c59;});}else{return _0x447c59;}})[_0xfe72('0x2b')](function(_0xff5839){logger[_0xfe72('0x26')](_0xfe72('0x64'),_0xff5839);throw _0xff5839;});}return _0x447c59;})[_0xfe72('0x22')](respondWithResult(_0x2aab3f,0xc9))['catch'](handleError(_0x2aab3f,null));};exports[_0xfe72('0x36')]=function(_0x99d811,_0x1fdb9a){if(_0x99d811[_0xfe72('0x65')]['id']){delete _0x99d811[_0xfe72('0x65')]['id'];}return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x99d811[_0xfe72('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xfe72('0x5a')}]})['then'](handleEntityNotFound(_0x1fdb9a,null))['then'](saveUpdates(_0x99d811[_0xfe72('0x65')],null))[_0xfe72('0x22')](respondWithResult(_0x1fdb9a,null))['catch'](handleError(_0x1fdb9a,null));};exports[_0xfe72('0x37')]=function(_0x45d82b,_0x3fbf6a){return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x45d82b[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x3fbf6a,null))['then'](removeEntity(_0x3fbf6a,null))['catch'](handleError(_0x3fbf6a,null));};exports[_0xfe72('0x66')]=function(_0x2feca9,_0x5b27e1){return db[_0xfe72('0x3f')][_0xfe72('0x66')]()[_0xfe72('0x22')](respondWithResult(_0x5b27e1,null))[_0xfe72('0x2b')](handleError(_0x5b27e1,null));};exports[_0xfe72('0x67')]=function(_0x41c4b5,_0x5c70f1,_0x3513a7){if(_0x41c4b5['body']['id']){delete _0x41c4b5['body']['id'];}return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x41c4b5[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x5c70f1,null))[_0xfe72('0x22')](function(_0xab9c47){if(_0xab9c47){_0x41c4b5[_0xfe72('0x65')][_0xfe72('0x68')]=_0xab9c47['id'];return db['Disposition'][_0xfe72('0x5e')](_0x41c4b5[_0xfe72('0x65')]);}})['then'](respondWithResult(_0x5c70f1,null))[_0xfe72('0x2b')](handleError(_0x5c70f1,null));};exports['getDispositions']=function(_0x52935e,_0x429524,_0x459307){var _0x50c3b4={'raw':![],'where':{}};var _0x47d3a5={};var _0x30b2e5={'count':0x0,'rows':[]};return db[_0xfe72('0x3f')][_0xfe72('0x69')]({'where':{'id':_0x52935e[_0xfe72('0x58')]['id']}})['then'](handleEntityNotFound(_0x429524,null))[_0xfe72('0x22')](function(_0x209150){if(_0x209150){_0x47d3a5[_0xfe72('0x47')]=_[_0xfe72('0x45')](db['Disposition'][_0xfe72('0x5b')]);_0x47d3a5['query']=_[_0xfe72('0x45')](_0x52935e[_0xfe72('0x44')]);_0x47d3a5[_0xfe72('0x46')]=_[_0xfe72('0x5c')](_0x47d3a5['model'],_0x47d3a5[_0xfe72('0x44')]);_0x50c3b4[_0xfe72('0x48')]=_[_0xfe72('0x5c')](_0x47d3a5[_0xfe72('0x47')],qs['fields'](_0x52935e[_0xfe72('0x44')][_0xfe72('0x49')]));_0x50c3b4[_0xfe72('0x48')]=_0x50c3b4[_0xfe72('0x48')][_0xfe72('0x6a')]?_0x50c3b4[_0xfe72('0x48')]:_0x47d3a5[_0xfe72('0x47')];if(!_0x52935e[_0xfe72('0x44')]['hasOwnProperty'](_0xfe72('0x4b'))){_0x50c3b4[_0xfe72('0x31')]=qs['limit'](_0x52935e[_0xfe72('0x44')]['limit']);_0x50c3b4[_0xfe72('0x30')]=qs['offset'](_0x52935e[_0xfe72('0x44')][_0xfe72('0x30')]);}_0x50c3b4[_0xfe72('0x4c')]=qs[_0xfe72('0x4d')](_0x52935e[_0xfe72('0x44')]['sort']);_0x50c3b4[_0xfe72('0x50')]=qs[_0xfe72('0x46')](_['pick'](_0x52935e[_0xfe72('0x44')],_0x47d3a5['filters']));_0x50c3b4['where'][_0xfe72('0x68')]=_0x209150['id'];if(_0x52935e['query']['filter']){_0x50c3b4[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0x50c3b4[_0xfe72('0x50')],{'$or':_[_0xfe72('0x43')](_0x50c3b4[_0xfe72('0x48')],function(_0x629eca){var _0x725bd2={};_0x725bd2[_0x629eca]={'$like':'%'+_0x52935e[_0xfe72('0x44')][_0xfe72('0x4f')]+'%'};return _0x725bd2;})});}_0x50c3b4=_[_0xfe72('0x51')]({},_0x50c3b4,_0x52935e[_0xfe72('0x53')]);return db[_0xfe72('0x6b')][_0xfe72('0x2f')]({'where':_0x50c3b4[_0xfe72('0x50')]})[_0xfe72('0x22')](function(_0x56ac2e){_0x30b2e5[_0xfe72('0x2f')]=_0x56ac2e;if(_0x52935e[_0xfe72('0x44')][_0xfe72('0x54')]){_0x50c3b4[_0xfe72('0x55')]=[{'all':!![]}];}return db[_0xfe72('0x6b')]['findAll'](_0x50c3b4);})[_0xfe72('0x22')](function(_0x43e7f0){_0x30b2e5[_0xfe72('0x57')]=_0x43e7f0;return _0x30b2e5;});}})[_0xfe72('0x22')](respondWithFilteredResult(_0x429524,_0x50c3b4))[_0xfe72('0x2b')](handleError(_0x429524,null));};exports[_0xfe72('0x6c')]=function(_0x182592,_0x2b4a57,_0x3f9bac){return db['ChatWebsite'][_0xfe72('0x5d')]({'where':{'id':_0x182592[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x2b4a57,null))[_0xfe72('0x22')](function(_0x434419){if(_0x434419){return _0x434419['removeDispositions'](_0x182592[_0xfe72('0x44')][_0xfe72('0x6d')]);}})[_0xfe72('0x22')](respondWithStatusCode(_0x2b4a57,null))[_0xfe72('0x2b')](handleError(_0x2b4a57,null));};exports[_0xfe72('0x6e')]=function(_0x38ea50,_0x47abd8,_0x422f10){if(_0x38ea50['body']['id']){delete _0x38ea50[_0xfe72('0x65')]['id'];}return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x38ea50['params']['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x47abd8,null))[_0xfe72('0x22')](function(_0x2fd18a){if(_0x2fd18a){_0x38ea50[_0xfe72('0x65')][_0xfe72('0x68')]=_0x2fd18a['id'];return db[_0xfe72('0x6f')][_0xfe72('0x5e')](_0x38ea50[_0xfe72('0x65')]);}})[_0xfe72('0x22')](respondWithResult(_0x47abd8,null))[_0xfe72('0x2b')](handleError(_0x47abd8,null));};exports['getAnswers']=function(_0x5f2721,_0x2934b7,_0x598c3b){var _0x1867c8={'raw':![],'where':{}};var _0x4c99b1={};var _0x1481e9={'count':0x0,'rows':[]};return db[_0xfe72('0x3f')]['findOne']({'where':{'id':_0x5f2721['params']['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x2934b7,null))['then'](function(_0x3ed6a0){if(_0x3ed6a0){_0x4c99b1['model']=_[_0xfe72('0x45')](db['CannedAnswer']['rawAttributes']);_0x4c99b1[_0xfe72('0x44')]=_[_0xfe72('0x45')](_0x5f2721[_0xfe72('0x44')]);_0x4c99b1[_0xfe72('0x46')]=_[_0xfe72('0x5c')](_0x4c99b1[_0xfe72('0x47')],_0x4c99b1['query']);_0x1867c8[_0xfe72('0x48')]=_[_0xfe72('0x5c')](_0x4c99b1['model'],qs['fields'](_0x5f2721[_0xfe72('0x44')][_0xfe72('0x49')]));_0x1867c8[_0xfe72('0x48')]=_0x1867c8['attributes']['length']?_0x1867c8[_0xfe72('0x48')]:_0x4c99b1[_0xfe72('0x47')];if(!_0x5f2721[_0xfe72('0x44')]['hasOwnProperty'](_0xfe72('0x4b'))){_0x1867c8[_0xfe72('0x31')]=qs['limit'](_0x5f2721[_0xfe72('0x44')][_0xfe72('0x31')]);_0x1867c8[_0xfe72('0x30')]=qs[_0xfe72('0x30')](_0x5f2721[_0xfe72('0x44')][_0xfe72('0x30')]);}_0x1867c8[_0xfe72('0x4c')]=qs['sort'](_0x5f2721[_0xfe72('0x44')]['sort']);_0x1867c8[_0xfe72('0x50')]=qs[_0xfe72('0x46')](_[_0xfe72('0x4e')](_0x5f2721[_0xfe72('0x44')],_0x4c99b1[_0xfe72('0x46')]));_0x1867c8[_0xfe72('0x50')][_0xfe72('0x68')]=_0x3ed6a0['id'];if(_0x5f2721[_0xfe72('0x44')][_0xfe72('0x4f')]){_0x1867c8[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0x1867c8[_0xfe72('0x50')],{'$or':_[_0xfe72('0x43')](_0x1867c8[_0xfe72('0x48')],function(_0x57768d){var _0x4cd036={};_0x4cd036[_0x57768d]={'$like':'%'+_0x5f2721[_0xfe72('0x44')][_0xfe72('0x4f')]+'%'};return _0x4cd036;})});}_0x1867c8=_[_0xfe72('0x51')]({},_0x1867c8,_0x5f2721[_0xfe72('0x53')]);return db[_0xfe72('0x6f')]['count']({'where':_0x1867c8['where']})['then'](function(_0x2817f5){_0x1481e9[_0xfe72('0x2f')]=_0x2817f5;if(_0x5f2721['query'][_0xfe72('0x54')]){_0x1867c8[_0xfe72('0x55')]=[{'all':!![]}];}return db[_0xfe72('0x6f')][_0xfe72('0x56')](_0x1867c8);})[_0xfe72('0x22')](function(_0x1e65e0){_0x1481e9['rows']=_0x1e65e0;return _0x1481e9;});}})[_0xfe72('0x22')](respondWithFilteredResult(_0x2934b7,_0x1867c8))[_0xfe72('0x2b')](handleError(_0x2934b7,null));};exports[_0xfe72('0x70')]=function(_0x167ee8,_0x25c9c5,_0x2bb51c){return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x167ee8[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x25c9c5,null))[_0xfe72('0x22')](function(_0x3f4a57){if(_0x3f4a57){return _0x3f4a57['removeAnswers'](_0x167ee8[_0xfe72('0x44')][_0xfe72('0x6d')]);}})['then'](respondWithStatusCode(_0x25c9c5,null))[_0xfe72('0x2b')](handleError(_0x25c9c5,null));};exports[_0xfe72('0x71')]=function(_0x535de1,_0x5a9643,_0x5d17d8){_0x535de1[_0xfe72('0x65')][_0xfe72('0x72')]=_0x535de1['file'][_0xfe72('0x73')];return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x535de1[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x5a9643,null))[_0xfe72('0x22')](saveUpdates(_0x535de1[_0xfe72('0x65')],null))[_0xfe72('0x22')](respondWithResult(_0x5a9643,null))[_0xfe72('0x2b')](handleError(_0x5a9643,null));};exports[_0xfe72('0x74')]=function(_0x4eff8,_0x878b69,_0x12b8cd){_0x4eff8[_0xfe72('0x65')][_0xfe72('0x75')]=_0x4eff8[_0xfe72('0x76')][_0xfe72('0x73')];return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x4eff8[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x878b69,null))['then'](saveUpdates(_0x4eff8['body'],null))[_0xfe72('0x22')](respondWithResult(_0x878b69,null))['catch'](handleError(_0x878b69,null));};exports['addCustomerAvatar']=function(_0x14a37f,_0x26f8d0,_0x7d90de){_0x14a37f[_0xfe72('0x65')][_0xfe72('0x77')]=_0x14a37f[_0xfe72('0x76')][_0xfe72('0x73')];return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x14a37f[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x26f8d0,null))['then'](saveUpdates(_0x14a37f['body'],null))['then'](respondWithResult(_0x26f8d0,null))[_0xfe72('0x2b')](handleError(_0x26f8d0,null));};exports[_0xfe72('0x78')]=function(_0x4cad12,_0x13ac04,_0x474403){_0x4cad12['body'][_0xfe72('0x79')]=_0x4cad12[_0xfe72('0x76')]['filename'];return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x4cad12['params']['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x13ac04,null))[_0xfe72('0x22')](saveUpdates(_0x4cad12[_0xfe72('0x65')],null))['then'](respondWithResult(_0x13ac04,null))[_0xfe72('0x2b')](handleError(_0x13ac04,null));};exports[_0xfe72('0x7a')]=function(_0x3ca504,_0x8c5636,_0x282316){var _0x25fd1c=path[_0xfe72('0x7b')](config['root'],_0xfe72('0x7c'));var _0x1a4270={'where':{'id':_0x3ca504[_0xfe72('0x58')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x121500=![];return require(_0xfe72('0x7d'))[_0xfe72('0x7e')]()['then'](function(_0x32834e){if(_0x32834e){_0x121500=_0x32834e[_0xfe72('0x7f')];}})['then'](function(){return db['ChatWebsite']['find'](_0x1a4270);})[_0xfe72('0x22')](handleEntityNotFound(_0x8c5636,null))[_0xfe72('0x22')](function(_0x34b541){if(_0x34b541){if(!_[_0xfe72('0x80')](_0x34b541[_0xfe72('0x72')])){if(fs[_0xfe72('0x81')](path[_0xfe72('0x7b')](config[_0xfe72('0x82')],_0xfe72('0x83'),_0x34b541[_0xfe72('0x72')]))&&_0x121500){_0x25fd1c=path[_0xfe72('0x7b')](config[_0xfe72('0x82')],_0xfe72('0x83'),_0x34b541['sitepic']);}}return _0x8c5636[_0xfe72('0x84')](_0x25fd1c);}})[_0xfe72('0x2b')](handleError(_0x8c5636,null));};exports[_0xfe72('0x85')]=function(_0x7c64f1,_0x4d8156,_0x44e4fc){var _0x3f1435=path[_0xfe72('0x7b')](config[_0xfe72('0x82')],'server/files/images/avatars/default_avatar.png');var _0x453593={'where':{'id':_0x7c64f1['params']['id']},'attributes':['id',_0xfe72('0x75')],'raw':!![]};return db[_0xfe72('0x3f')][_0xfe72('0x5d')](_0x453593)[_0xfe72('0x22')](handleEntityNotFound(_0x4d8156,null))[_0xfe72('0x22')](function(_0x3552b2){if(_0x3552b2){if(!_['isNil'](_0x3552b2[_0xfe72('0x75')])){if(fs[_0xfe72('0x81')](path[_0xfe72('0x7b')](config['root'],'server/files/images/avatars/',_0x3552b2[_0xfe72('0x75')]))){_0x3f1435=path[_0xfe72('0x7b')](config[_0xfe72('0x82')],'server/files/images/avatars/',_0x3552b2[_0xfe72('0x75')]);}}return _0x4d8156['download'](_0x3f1435);}})[_0xfe72('0x2b')](handleError(_0x4d8156,null));};exports[_0xfe72('0x86')]=function(_0x41ad4f,_0x44016d,_0x4635e5){var _0x5eb55c=path['join'](config[_0xfe72('0x82')],_0xfe72('0x87'));var _0x2b6233={'where':{'id':_0x41ad4f[_0xfe72('0x58')]['id']},'attributes':['id','customerAvatar',_0xfe72('0x88')],'raw':!![]};return db[_0xfe72('0x3f')]['find'](_0x2b6233)['then'](handleEntityNotFound(_0x44016d,null))[_0xfe72('0x22')](function(_0x166b1a){if(_0x166b1a){if(!_[_0xfe72('0x80')](_0x166b1a[_0xfe72('0x77')])){if(fs[_0xfe72('0x81')](path[_0xfe72('0x7b')](config['root'],_0xfe72('0x89'),_0x166b1a[_0xfe72('0x77')]))&&_0x166b1a[_0xfe72('0x88')]){_0x5eb55c=path[_0xfe72('0x7b')](config[_0xfe72('0x82')],_0xfe72('0x89'),_0x166b1a['customerAvatar']);}}return _0x44016d[_0xfe72('0x84')](_0x5eb55c);}})[_0xfe72('0x2b')](handleError(_0x44016d,null));};exports[_0xfe72('0x8a')]=function(_0x41ca42,_0x47a3a7,_0x1235ad){var _0x155c6d=path[_0xfe72('0x7b')](config['root'],'server/files/images/avatars/system_avatar.png');var _0x2296b2={'where':{'id':_0x41ca42[_0xfe72('0x58')]['id']},'attributes':['id',_0xfe72('0x79')],'raw':!![]};return db[_0xfe72('0x3f')][_0xfe72('0x5d')](_0x2296b2)[_0xfe72('0x22')](handleEntityNotFound(_0x47a3a7,null))[_0xfe72('0x22')](function(_0x563738){if(_0x563738){if(!_[_0xfe72('0x80')](_0x563738[_0xfe72('0x79')])){if(fs[_0xfe72('0x81')](path[_0xfe72('0x7b')](config['root'],_0xfe72('0x89'),_0x563738[_0xfe72('0x79')]))){_0x155c6d=path[_0xfe72('0x7b')](config[_0xfe72('0x82')],_0xfe72('0x89'),_0x563738['systemAvatar']);}}return _0x47a3a7[_0xfe72('0x84')](_0x155c6d);}})[_0xfe72('0x2b')](handleError(_0x47a3a7,null));};exports[_0xfe72('0x8b')]=function(_0x1681b5,_0x2fe802,_0x2aa603){var _0x578363=require(_0xfe72('0x8c'));var _0xabaa1d=new _0x578363();var _0x43344f=_0xabaa1d[_0xfe72('0x8d')](_0x1681b5[_0xfe72('0x8e')][_0xfe72('0x8f')])[_0xfe72('0x90')]();var _0x30317f={'body':_0x1681b5['body'],'channel':'chat'};var _0x1ec99b=[];var _0x2e7141=[];var _0x47ec06={};var _0x3bfdd7=![];return db[_0xfe72('0x91')][_0xfe72('0x66')]()['then'](function(_0x2787c0){if(!_0x2787c0){throw new db['Sequelize']['ValidationError'](_0xfe72('0x92'));}_0x1ec99b=_[_0xfe72('0x93')](_['keys'](_0x2787c0),[_0xfe72('0x94'),_0xfe72('0x95')]);_0x2e7141=_[_0xfe72('0x93')](_[_0xfe72('0x45')](_0x2787c0),[_0xfe72('0x94'),_0xfe72('0x95'),_0xfe72('0x96'),_0xfe72('0x97')]);if(_0x1681b5['body']['id']){delete _0x1681b5[_0xfe72('0x65')]['id'];}if(_[_0xfe72('0x80')](_0x1681b5[_0xfe72('0x65')]['from'])){throw new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))]('from\x20is\x20mandatory');}if(_[_0xfe72('0x80')](_0x1681b5[_0xfe72('0x65')][_0xfe72('0x65')])||_0x1681b5[_0xfe72('0x65')][_0xfe72('0x65')]===''){throw new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))](_0xfe72('0x98'));}if(_[_0xfe72('0x80')](_0x1681b5[_0xfe72('0x65')]['mapKey'])){throw new db['Sequelize'][(_0xfe72('0x1f'))](_0xfe72('0x99')+_0x2e7141);}if(!_[_0xfe72('0x9a')](_0x2e7141,_0x1681b5['body'][_0xfe72('0x9b')])){throw new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))](_0xfe72('0x9c')+_0x2e7141);}_0x47ec06[_0x1681b5[_0xfe72('0x65')][_0xfe72('0x9b')]]=_0x1681b5['body'][_0xfe72('0x9d')];})[_0xfe72('0x22')](function(){return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x1681b5['params']['id']},'include':[{'model':db['CmList'],'as':_0xfe72('0x9e'),'include':[{'model':db[_0xfe72('0x91')],'as':_0xfe72('0x9f'),'where':_0x47ec06,'limit':0x1,'order':[[_0xfe72('0x95'),'DESC']]}]},{'model':db[_0xfe72('0xa0')],'as':_0xfe72('0xa1')}]});})['then'](handleEntityNotFound(_0x2fe802,null))[_0xfe72('0x22')](function(_0x52d3a7){if(_0x52d3a7&&_0x52d3a7[_0xfe72('0x9e')]){_0x30317f[_0xfe72('0xa2')]=_0x52d3a7;_0x30317f['applications']=_0x52d3a7[_0xfe72('0xa1')];_0x30317f[_0xfe72('0xa3')]=_0x52d3a7[_0xfe72('0x9e')];_0x30317f[_0xfe72('0xa4')]=_[_0xfe72('0xa5')](_0x30317f[_0xfe72('0xa4')],[_0xfe72('0xa6')],[_0xfe72('0xa7')]);if(_0x30317f['account']['Applications']){delete _0x30317f['account']['Applications'];}if(_0x30317f[_0xfe72('0xa2')][_0xfe72('0x9e')]&&_0x30317f[_0xfe72('0xa2')][_0xfe72('0x9e')][_0xfe72('0x9f')][_0xfe72('0x6a')]){return _0x30317f['account'][_0xfe72('0x9e')]['Contacts'][0x0];}var _0x3f06ce=_[_0xfe72('0x16')](_0x1681b5['body'],{'firstName':_0x1681b5[_0xfe72('0x65')]['from'],'ListId':_0x52d3a7[_0xfe72('0x97')]});_0x3f06ce[_0x1681b5[_0xfe72('0x65')]['mapKey']]=_0x1681b5[_0xfe72('0x65')]['from'];return db['CmContact'][_0xfe72('0x5e')](_0x3f06ce,{'fields':_0x1ec99b,'raw':!![]});}})[_0xfe72('0x22')](handleEntityNotFound(_0x2fe802,null))[_0xfe72('0x22')](function(_0x31ea86){_0x30317f[_0xfe72('0xa8')]=_0x31ea86;var _0x574209=_0x1681b5['body']['customerIp'];if(_0x1681b5[_0xfe72('0x8e')][_0xfe72('0xa9')]){_0x574209=_0x1681b5[_0xfe72('0x8e')][_0xfe72('0xa9')];}else if(_0x1681b5['headers'][_0xfe72('0xaa')]){_0x574209=_[_0xfe72('0xab')](_0x1681b5[_0xfe72('0x8e')][_0xfe72('0xaa')][_0xfe72('0xac')](','));}if(_0x31ea86){var _0x5ae455={'ContactId':_0x31ea86['id'],'ChatWebsiteId':_0x1681b5[_0xfe72('0x58')]['id'],'from':(_0x31ea86['firstName']||'')+'\x20'+(_0x31ea86[_0xfe72('0xad')]||''),'customerIp':_0x574209,'customerPort':_0x1681b5[_0xfe72('0x8e')][_0xfe72('0xae')]?_0x1681b5[_0xfe72('0x8e')][_0xfe72('0xae')]:null,'referer':_0x1681b5['body']['referer'],'browserName':_0x43344f[_0xfe72('0xaf')]['name']&&_0x43344f['browser'][_0xfe72('0xb0')]?util['format'](_0xfe72('0xb1'),_0x43344f[_0xfe72('0xaf')][_0xfe72('0x3c')],_0x43344f[_0xfe72('0xaf')][_0xfe72('0xb0')]):'unknown','browserVersion':_0x43344f[_0xfe72('0xaf')][_0xfe72('0xb0')]||_0xfe72('0xb2'),'osName':util[_0xfe72('0xb3')](_0xfe72('0xb1'),_0x43344f['os']['name'],_0x43344f['os']['version']),'osVersion':_0x43344f['os']['version'],'deviceModel':_0x43344f['device'][_0xfe72('0x47')]&&_0x43344f['device'][_0xfe72('0xb4')]?util[_0xfe72('0xb3')]('%s\x20%s\x20%s',_0x43344f[_0xfe72('0xb5')][_0xfe72('0x47')],_0x43344f['device'][_0xfe72('0xb4')],_0x43344f[_0xfe72('0xb5')][_0xfe72('0x41')]):null,'deviceVendor':_0x43344f[_0xfe72('0xb5')][_0xfe72('0xb4')],'deviceType':_0x43344f[_0xfe72('0xb5')][_0xfe72('0x41')],'formData':JSON[_0xfe72('0xb6')](_0x1681b5[_0xfe72('0x65')])};var _0x36480e={'ChatWebsiteId':_0x1681b5['params']['id'],'closed':![]};if(_0x1681b5[_0xfe72('0x65')][_0xfe72('0xb7')]){_0x36480e[_0xfe72('0xb7')]=_0x1681b5[_0xfe72('0x65')]['threadId'];return db[_0xfe72('0xb8')][_0xfe72('0x5d')]({'where':_0x36480e})[_0xfe72('0x22')](function(_0x31c3e0){if(_0x31c3e0){return[_0x31c3e0,![]];}_0x5ae455[_0xfe72('0xb7')]=_0x1681b5[_0xfe72('0x65')][_0xfe72('0xb7')];_0x5ae455[_0xfe72('0xb9')]=_0x1681b5['body'][_0xfe72('0xb9')];return db[_0xfe72('0xb8')][_0xfe72('0x5e')](_0x5ae455)['then'](function(_0xffd8b6){return[_0xffd8b6,!![]];});});}_0x36480e['ContactId']=_0x31ea86['id'];if(_0x1681b5[_0xfe72('0x65')][_0xfe72('0xba')]&&_0x1681b5[_0xfe72('0x65')][_0xfe72('0xba')]['id']){_0x36480e['id']=_0x1681b5[_0xfe72('0x65')][_0xfe72('0xba')]['id'];return db[_0xfe72('0xb8')]['find']({'where':_0x36480e})[_0xfe72('0x22')](function(_0x5c5e4d){if(_0x5c5e4d){return[_0x5c5e4d,![]];}return db[_0xfe72('0xb8')][_0xfe72('0x5e')](_0x5ae455)[_0xfe72('0x22')](function(_0x5b4120){return[_0x5b4120,!![]];});});}return db[_0xfe72('0xb8')][_0xfe72('0x5e')](_0x5ae455)[_0xfe72('0x22')](function(_0x1b048c){return[_0x1b048c,!![]];});}})['spread'](function(_0x5246e6,_0x3b0897){if(_0x5246e6){_0x3bfdd7=_0x3b0897;if(!_0x3b0897){var _0x55e141={'from':(_0x30317f[_0xfe72('0xa8')][_0xfe72('0xbb')]||'')+'\x20'+(_0x30317f['contact'][_0xfe72('0xad')]||'')};if(_0x1681b5['body'][_0xfe72('0xb7')]&&_0x1681b5[_0xfe72('0x65')][_0xfe72('0xbc')]&&_0x1681b5[_0xfe72('0x65')]['threadId']!=_0x1681b5[_0xfe72('0x65')][_0xfe72('0xbc')]){_0x55e141[_0xfe72('0xb7')]=_0x1681b5[_0xfe72('0x65')]['messageId'];}return _0x5246e6[_0xfe72('0x36')](_0x55e141);}else{return _0x5246e6;}}})[_0xfe72('0x22')](function(_0x4a555d){_0x30317f['interaction']=_0x4a555d[_0xfe72('0x60')]({'plain':!![]});_0x30317f[_0xfe72('0xba')]['created']=_0x3bfdd7;if(_0x30317f[_0xfe72('0xba')]['created']){if(_0x30317f[_0xfe72('0xa2')][_0xfe72('0xbd')]){_0x30317f[_0xfe72('0xa4')][_0xfe72('0xbe')]({'id':0x0,'priority':_0x30317f[_0xfe72('0xa4')][_0xfe72('0x6a')]+0x1,'app':_0xfe72('0xbf'),'appdata':_0xfe72('0xc0'),'interval':'*,*,*,*'});}}return db[_0xfe72('0xc1')][_0xfe72('0x5e')]({'body':_0x1681b5[_0xfe72('0x65')][_0xfe72('0x65')],'ChatWebsiteId':_0x1681b5[_0xfe72('0x58')]['id'],'ChatInteractionId':_0x4a555d['id'],'direction':'in','ContactId':_0x30317f[_0xfe72('0xa8')]['id'],'AttachmentId':_0x1681b5['body'][_0xfe72('0xc2')]});})[_0xfe72('0x22')](function(_0x296efc){_0x30317f[_0xfe72('0x28')]=_0x296efc;if(_0x30317f[_0xfe72('0xba')]['UserId']){return db['User']['find']({'attributes':['id',_0xfe72('0x3c')],'where':{'id':_0x30317f[_0xfe72('0xba')][_0xfe72('0xc3')]}})['then'](function(_0x1f12b9){if(_0x1f12b9){_0x30317f[_0xfe72('0xa4')][_0xfe72('0xc4')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1f12b9[_0xfe72('0x3c')]+','+(_0x30317f[_0xfe72('0xa2')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x30317f['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0xfe72('0xc5'),_0x30317f);});}return respondWithRpcPromise('Start','startRouting',_0x30317f);})[_0xfe72('0x22')](function(_0x2ce346){respondWithRpcPromise('EventManager',_0xfe72('0xc6'),{'event':_0xfe72('0x8b'),'message':_0x2ce346},client9002);return _0x2ce346;})[_0xfe72('0x22')](respondWithResult(_0x2fe802,null))[_0xfe72('0x2b')](handleError(_0x2fe802,null));};exports['offline']=function(_0x29352f,_0x3c10f4,_0x130895){var _0x28166a,_0x277e3e,_0x347918;var _0x318e96=[];var _0x43aeca=[];var _0x189253={};return db['CmContact'][_0xfe72('0x66')]()[_0xfe72('0x22')](function(_0x7e6122){if(!_0x7e6122){throw new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))](_0xfe72('0x92'));}_0x43aeca=_[_0xfe72('0x93')](_[_0xfe72('0x45')](_0x7e6122),[_0xfe72('0x94'),_0xfe72('0x95')]);_0x318e96=_[_0xfe72('0x93')](_[_0xfe72('0x45')](_0x7e6122),[_0xfe72('0x94'),_0xfe72('0x95'),_0xfe72('0x96'),'ListId']);if(_0x29352f[_0xfe72('0x65')]['id']){delete _0x29352f[_0xfe72('0x65')]['id'];}if(_[_0xfe72('0x80')](_0x29352f[_0xfe72('0x65')][_0xfe72('0x9d')])){throw _0x3c10f4['status'](0x1f4)[_0xfe72('0x3d')](new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))](_0xfe72('0xc7')));}if(_[_0xfe72('0x80')](_0x29352f['body'][_0xfe72('0x65')])||_0x29352f[_0xfe72('0x65')][_0xfe72('0x65')]===''){throw _0x3c10f4[_0xfe72('0x2d')](0x1f4)['send'](new db[(_0xfe72('0x1e'))]['ValidationError'](_0xfe72('0x98')));}if(_[_0xfe72('0x80')](_0x29352f[_0xfe72('0x65')][_0xfe72('0xc8')])){throw _0x3c10f4[_0xfe72('0x2d')](0x1f4)[_0xfe72('0x3d')](new db['Sequelize'][(_0xfe72('0x1f'))](_0xfe72('0xc9')+_0x318e96));}if(!_['includes'](_0x318e96,_0x29352f[_0xfe72('0x65')][_0xfe72('0xc8')])){throw _0x3c10f4[_0xfe72('0x2d')](0x1f4)[_0xfe72('0x3d')](new db[(_0xfe72('0x1e'))][(_0xfe72('0x1f'))](_0xfe72('0xca')+_0x318e96));}_0x189253[_0x29352f[_0xfe72('0x65')]['mapKeyOffline']]=_0x29352f[_0xfe72('0x65')][_0xfe72('0x9d')];})['then'](function(){return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x29352f[_0xfe72('0x58')]['id']},'include':[{'model':db[_0xfe72('0xcb')],'as':_0xfe72('0x9e')}]});})[_0xfe72('0x22')](handleEntityNotFound(_0x3c10f4,null))[_0xfe72('0x22')](function(_0x12dc57){if(_0x12dc57&&_0x12dc57[_0xfe72('0x9e')]){_0x277e3e=_0x12dc57;var _0x2d1b30=_[_0xfe72('0x16')](_0x29352f[_0xfe72('0x65')],{'firstName':_0x29352f[_0xfe72('0x65')][_0xfe72('0x9d')],'phone':_0x29352f['body'][_0xfe72('0x9d')],'ListId':_0x12dc57[_0xfe72('0x97')]});_0x2d1b30[_0x29352f['body']['mapKeyOffline']]=_0x29352f['body'][_0xfe72('0x9d')];return db[_0xfe72('0x91')][_0xfe72('0xcc')]({'where':_0x189253,'defaults':_0x2d1b30});}})[_0xfe72('0xcd')](function(_0x51cbc0){if(_0x51cbc0){_0x347918=_0x51cbc0;var _0x1f4053=fs['readFileSync'](path[_0xfe72('0x7b')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xfe72('0xce'));var _0x5be0a4=ejs[_0xfe72('0xcf')](_0x1f4053,{'body':_[_0xfe72('0xd0')](_0x29352f['body']['body']),'bodyTitle':_0x277e3e[_0xfe72('0xd1')]});return db[_0xfe72('0xd2')][_0xfe72('0x5e')]({'body':_0x5be0a4,'ContactId':_0x51cbc0['id'],'ChatWebsiteId':_0x277e3e['id']});}})[_0xfe72('0x22')](function(_0x2b7cf4){if(_0x2b7cf4){_0x28166a=_0x2b7cf4;return db[_0xfe72('0xd3')][_0xfe72('0x69')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xfe72('0xd4'),'raw':!![]}]});}})['then'](function(_0x50eaf1){if(_0x50eaf1&&_0x50eaf1[_0xfe72('0xd4')]&&_0x277e3e[_0xfe72('0xd5')]){var _0x35f4cc={'tls':{'rejectUnauthorized':![]}};if(_0x50eaf1['Smtp'][_0xfe72('0xd6')]){_0x35f4cc[_0xfe72('0xd6')]=_0x50eaf1['Smtp'][_0xfe72('0xd6')];}else{_0x35f4cc['host']=_0x50eaf1[_0xfe72('0xd4')]['host'];_0x35f4cc[_0xfe72('0xd7')]=_0x50eaf1[_0xfe72('0xd4')][_0xfe72('0xd7')];_0x35f4cc[_0xfe72('0xd8')]=_0x50eaf1['Smtp']['secure'];}if(_0x50eaf1[_0xfe72('0xd4')][_0xfe72('0xd9')]){_0x35f4cc[_0xfe72('0xda')]={'user':_0x50eaf1[_0xfe72('0xd4')]['user'],'pass':_0x50eaf1['Smtp'][_0xfe72('0xdb')]};}return respondWithRpcPromise(_0xfe72('0xdc'),'sendMail',{'account':_0x35f4cc,'message':{'from':util[_0xfe72('0xb3')](_0xfe72('0xdd'),_0x50eaf1[_0xfe72('0x3c')],_0x50eaf1[_0xfe72('0xde')]||_0x50eaf1['Smtp'][_0xfe72('0x5f')]),'to':_0x277e3e['forwardOfflineAddress'],'subject':_0x277e3e[_0xfe72('0xdf')],'text':_0x28166a[_0xfe72('0x65')]}},client9003)['then'](function(){return _0x28166a;})[_0xfe72('0x2b')](function(_0x51175f){console[_0xfe72('0x26')](_0x51175f);});}})[_0xfe72('0x22')](function(){if(_0x28166a){return _0x28166a;}})['then'](respondWithResult(_0x3c10f4,null))[_0xfe72('0x2b')](handleError(_0x3c10f4,null));};exports[_0xfe72('0xe0')]=function(_0x3f8e2c,_0x4c3cb3,_0x422ac9){return db[_0xfe72('0xb8')][_0xfe72('0x5d')]({'where':{'id':_0x3f8e2c['params']['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x4c3cb3,null))[_0xfe72('0x22')](function(_0x540cea){if(_0x540cea){return _0x540cea[_0xfe72('0xe0')](_0x3f8e2c['body'][_0xfe72('0x6d')],_[_0xfe72('0xe1')](_0x3f8e2c['body'],['ids','id'])||{});}})[_0xfe72('0x22')](respondWithResult(_0x4c3cb3,null))['catch'](handleError(_0x4c3cb3,null));};exports[_0xfe72('0xe2')]=function(_0x206baa,_0x419695,_0x33d58a){var _0x43c2ce={'raw':![],'where':{}};var _0x3e1f8d={};var _0x59a618={'count':0x0,'rows':[]};return db[_0xfe72('0x3f')][_0xfe72('0x69')]({'where':{'id':_0x206baa[_0xfe72('0x58')]['id']}})['then'](handleEntityNotFound(_0x419695,null))[_0xfe72('0x22')](function(_0x1df3c2){if(_0x1df3c2){_0x3e1f8d[_0xfe72('0x47')]=_['keys'](db[_0xfe72('0xb8')][_0xfe72('0x5b')]);_0x3e1f8d[_0xfe72('0x44')]=_[_0xfe72('0x45')](_0x206baa[_0xfe72('0x44')]);_0x3e1f8d[_0xfe72('0x46')]=_[_0xfe72('0x5c')](_0x3e1f8d[_0xfe72('0x47')],_0x3e1f8d[_0xfe72('0x44')]);_0x43c2ce[_0xfe72('0x48')]=_[_0xfe72('0x5c')](_0x3e1f8d['model'],qs[_0xfe72('0x49')](_0x206baa[_0xfe72('0x44')][_0xfe72('0x49')]));_0x43c2ce[_0xfe72('0x48')]=_0x43c2ce[_0xfe72('0x48')][_0xfe72('0x6a')]?_0x43c2ce[_0xfe72('0x48')]:_0x3e1f8d[_0xfe72('0x47')];if(!_0x206baa['query']['hasOwnProperty'](_0xfe72('0x4b'))){_0x43c2ce[_0xfe72('0x31')]=qs['limit'](_0x206baa[_0xfe72('0x44')][_0xfe72('0x31')]);_0x43c2ce[_0xfe72('0x30')]=qs[_0xfe72('0x30')](_0x206baa[_0xfe72('0x44')][_0xfe72('0x30')]);}_0x43c2ce[_0xfe72('0x4c')]=qs['sort'](_0x206baa[_0xfe72('0x44')]['sort']);_0x43c2ce[_0xfe72('0x50')]=qs[_0xfe72('0x46')](_[_0xfe72('0x4e')](_0x206baa['query'],_0x3e1f8d[_0xfe72('0x46')]));_0x43c2ce[_0xfe72('0x50')][_0xfe72('0x68')]=_0x1df3c2['id'];if(_0x206baa[_0xfe72('0x44')][_0xfe72('0x4f')]){_0x43c2ce[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0x43c2ce[_0xfe72('0x50')],{'$or':_['map'](_0x43c2ce[_0xfe72('0x48')],function(_0x1fdc8e){var _0x27a803={};_0x27a803[_0x1fdc8e]={'$like':'%'+_0x206baa[_0xfe72('0x44')][_0xfe72('0x4f')]+'%'};return _0x27a803;})});}_0x43c2ce=_['merge']({},_0x43c2ce,_0x206baa['options']);return db[_0xfe72('0xb8')][_0xfe72('0x2f')]({'where':_0x43c2ce['where']})[_0xfe72('0x22')](function(_0x175812){_0x59a618[_0xfe72('0x2f')]=_0x175812;if(_0x206baa[_0xfe72('0x44')][_0xfe72('0x54')]){_0x43c2ce[_0xfe72('0x55')]=[{'model':db[_0xfe72('0x91')],'as':_0xfe72('0xe3'),'required':![]},{'model':db[_0xfe72('0xe4')],'as':_0xfe72('0xe5'),'attributes':[_0xfe72('0x3c'),'fullname',_0xfe72('0xe6')],'required':![]},{'model':db[_0xfe72('0xe7')],'as':_0xfe72('0xe8'),'attributes':['id',_0xfe72('0x3c'),'color'],'where':_0x206baa['query'][_0xfe72('0xe9')]?{'id':_0x206baa['query'][_0xfe72('0xe9')]}:undefined,'required':_0x206baa['query'][_0xfe72('0xe9')]?!![]:![]}];}return db['ChatInteraction'][_0xfe72('0x56')](_0x43c2ce);})[_0xfe72('0x22')](function(_0x5e284b){_0x59a618[_0xfe72('0x57')]=_0x5e284b;return _0x59a618;});}})['then'](respondWithFilteredResult(_0x419695,_0x43c2ce))[_0xfe72('0x2b')](handleError(_0x419695,null));};function iftimePromise(_0x534e7d,_0x19363b){return respondWithRpcPromise(_0xfe72('0xea'),'getSnippet',{'command':_0x19363b['timezone']?util[_0xfe72('0xb3')](_0xfe72('0xeb'),_0x534e7d['interval'],_0x19363b[_0xfe72('0xec')]):util[_0xfe72('0xb3')](_0xfe72('0xed'),_0x534e7d['interval'])},client9002)[_0xfe72('0x22')](function(_0x8da166){var _0x53d291=_0x8da166&&_0x8da166[_0xfe72('0xee')]('true')>=0x0?!![]:![];logger['info'](_0xfe72('0xef'),_0x19363b['id'],_0x534e7d['id'],_0x534e7d[_0xfe72('0xf0')],_0x53d291?'ONLINE':_0xfe72('0xf1'),_0x19363b['timezone']?_0x19363b[_0xfe72('0xec')]:_0xfe72('0xf2'));return _0x53d291;})[_0xfe72('0x2b')](function(_0xdcad8e){logger[_0xfe72('0x26')](_0xfe72('0xef'),_0x19363b['id'],_0x534e7d['id'],_0x534e7d['interval'],util[_0xfe72('0xf3')](_0xdcad8e,{'showHidden':![],'depth':null}),_0x19363b['timezone']?_0x19363b[_0xfe72('0xec')]:_0xfe72('0xf2'));return![];});}exports[_0xfe72('0xf4')]=function(_0x10d3b4,_0x2803f3,_0x513b56){var _0x4a3c69=0x0;var _0x5aba7e=0x0;var _0x1055c4=![];var _0x437c1c;var _0x1bf572;return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x10d3b4[_0xfe72('0x58')]['id']},'include':[{'model':db[_0xfe72('0xf5')],'as':_0xfe72('0xf5'),'include':[{'model':db[_0xfe72('0xf5')],'as':'Intervals','attributes':['id',_0xfe72('0xf0')],'raw':!![]}]}]})[_0xfe72('0x22')](handleEntityNotFound(_0x2803f3,null))['then'](function(_0x18b33e){if(_0x18b33e){_0x437c1c=_0x18b33e;return _0x18b33e[_0xfe72('0xf6')]({'raw':!![]});}})['then'](function(_0x41cb49){if(_0x437c1c){if(_0x41cb49){_0x1bf572=_0x41cb49;}}return require('../../config/license/util')[_0xfe72('0x7e')]();})[_0xfe72('0x22')](function(_0x3c50f2){if(_0x3c50f2){_0x5aba7e=_0x3c50f2[_0xfe72('0xf7')];_0x1055c4=_0x3c50f2[_0xfe72('0x7f')];}})[_0xfe72('0x22')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xfe72('0x22')](function(_0x5e6cb2){_0x4a3c69=_0x5e6cb2;if(_0x5aba7e&&_0x5e6cb2>_0x5aba7e){return db[_0xfe72('0xf8')][_0xfe72('0x69')]({'where':{'id':0x1}})[_0xfe72('0x22')](function(_0x3d02a6){if(_0x3d02a6){_0x3d02a6[_0xfe72('0xf9')](_0xfe72('0xfa'));}});}})['then'](function(){if(_0x437c1c['Interval']&&_0x437c1c[_0xfe72('0xf5')][_0xfe72('0xfb')]){var _0x59dc35=[];for(var _0x4df302=0x0;_0x4df302<_0x437c1c[_0xfe72('0xf5')][_0xfe72('0xfb')][_0xfe72('0x6a')];_0x4df302++){var _0x2d2b4d=_0x437c1c[_0xfe72('0xf5')][_0xfe72('0xfb')][_0x4df302][_0xfe72('0x60')]({'plain':!![]});_0x59dc35[_0xfe72('0xbe')](iftimePromise(_0x2d2b4d,_0x437c1c));}return BPromise[_0xfe72('0xfc')](_0x59dc35)[_0xfe72('0x22')](function(_0x4b5a4a){return _[_0xfe72('0xfd')](_0x4b5a4a);});}else{return!![];}})['then'](function(_0x570fef){var _0x1fc681=fs[_0xfe72('0xfe')](path[_0xfe72('0x7b')](config['root'],_0xfe72('0xff')),_0xfe72('0xce'));var _0x36915d={'remote':_0x437c1c[_0xfe72('0x100')],'query':querystring[_0xfe72('0xb6')](_[_0xfe72('0x51')](_0x437c1c[_0xfe72('0x60')]({'plain':!![]}),{'customerIp':_0x10d3b4[_0xfe72('0x8e')][_0xfe72('0xaa')]||_0x10d3b4['headers']['x-real-ip']||_0x10d3b4[_0xfe72('0x101')]['remoteAddress']||_0x10d3b4['ip'],'referer':_0x10d3b4[_0xfe72('0x8e')][_0xfe72('0x102')],'openedInteractions':_0x4a3c69,'maxInteractions':_0x5aba7e,'virtual':_0x1055c4[_0xfe72('0xf7')],'online':_0x570fef,'custom':_0x1055c4}))[_0xfe72('0x103')](/'/g,'\x5c\x27')};_0x2803f3[_0xfe72('0x3d')](ejs[_0xfe72('0xcf')](Mustache[_0xfe72('0xcf')](_0x1fc681,_0x36915d),{'proactiveActions':_0x1bf572,'alignment':_0x437c1c[_0xfe72('0x104')],'verticalAlignment':_0x437c1c[_0xfe72('0x105')],'div_color':_0x437c1c[_0xfe72('0x106')],'text_color':_0x437c1c[_0xfe72('0x107')]}));})[_0xfe72('0x2b')](handleError(_0x2803f3,null));};exports[_0xfe72('0x108')]=function(_0x2a5e9d,_0x40997f,_0x264b17){return db[_0xfe72('0x3f')]['findOne']({'where':{'id':_0x2a5e9d['params']['id']}})['then'](handleEntityNotFound(_0x40997f,null))['then'](function(_0xa75eb8){if(_0xa75eb8){return db[_0xfe72('0x109')]['transaction'](function(_0x53facb){return db['ChatApplication'][_0xfe72('0x37')]({'where':{'ChatWebsiteId':_0x2a5e9d['params']['id']},'transaction':_0x53facb})[_0xfe72('0x22')](function(_0xa6e6c){var _0x205406=_[_0xfe72('0x43')](_0x2a5e9d[_0xfe72('0x65')],function(_0x479335){_0x479335[_0xfe72('0x68')]=_0x2a5e9d[_0xfe72('0x58')]['id'];return _0x479335;});return db[_0xfe72('0xa0')]['bulkCreate'](_0x205406,{'transaction':_0x53facb});});})[_0xfe72('0x22')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x2a5e9d['params']['id']},'order':_0xfe72('0xa6')});});}})[_0xfe72('0x22')](respondWithResult(_0x40997f,null))['catch'](handleError(_0x40997f,null));};exports[_0xfe72('0x10a')]=function(_0x3dbba6,_0x5b462f,_0x477ba1){var _0x21a134={};var _0x2ff78b={};var _0x405d2b;var _0x4fe95b;return db[_0xfe72('0x3f')][_0xfe72('0x69')]({'where':{'id':_0x3dbba6['params']['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x5b462f,null))['then'](function(_0x18d3e4){if(_0x18d3e4){_0x405d2b=_0x18d3e4;_0x2ff78b['model']=_[_0xfe72('0x45')](db['ChatApplication'][_0xfe72('0x5b')]);_0x2ff78b[_0xfe72('0x44')]=_[_0xfe72('0x45')](_0x3dbba6['query']);_0x2ff78b[_0xfe72('0x46')]=_['intersection'](_0x2ff78b[_0xfe72('0x47')],_0x2ff78b[_0xfe72('0x44')]);_0x21a134['attributes']=_['intersection'](_0x2ff78b[_0xfe72('0x47')],qs[_0xfe72('0x49')](_0x3dbba6[_0xfe72('0x44')]['fields']));_0x21a134['attributes']=_0x21a134['attributes'][_0xfe72('0x6a')]?_0x21a134['attributes']:_0x2ff78b['model'];_0x21a134[_0xfe72('0x4c')]=qs[_0xfe72('0x4d')](_0x3dbba6[_0xfe72('0x44')][_0xfe72('0x4d')]);_0x21a134['where']=qs[_0xfe72('0x46')](_[_0xfe72('0x4e')](_0x3dbba6[_0xfe72('0x44')],_0x2ff78b[_0xfe72('0x46')]));if(_0x3dbba6[_0xfe72('0x44')][_0xfe72('0x4f')]){_0x21a134[_0xfe72('0x50')]=_['merge'](_0x21a134[_0xfe72('0x50')],{'$or':_[_0xfe72('0x43')](_0x21a134[_0xfe72('0x48')],function(_0x54001e){var _0x283fd4={};_0x283fd4[_0x54001e]={'$like':'%'+_0x3dbba6[_0xfe72('0x44')][_0xfe72('0x4f')]+'%'};return _0x283fd4;})});}_0x21a134=_[_0xfe72('0x51')]({},_0x21a134,_0x3dbba6[_0xfe72('0x53')]);return _0x405d2b[_0xfe72('0x10a')](_0x21a134);}})[_0xfe72('0x22')](function(_0x5daad9){if(_0x5daad9){_0x4fe95b=_0x5daad9[_0xfe72('0x6a')];if(!_0x3dbba6['query']['hasOwnProperty'](_0xfe72('0x4b'))){_0x21a134['limit']=qs[_0xfe72('0x31')](_0x3dbba6['query'][_0xfe72('0x31')]);_0x21a134[_0xfe72('0x30')]=qs['offset'](_0x3dbba6[_0xfe72('0x44')][_0xfe72('0x30')]);}return _0x405d2b['getApplications'](_0x21a134);}})[_0xfe72('0x22')](function(_0x400b9b){if(_0x400b9b){return _0x400b9b?{'count':_0x4fe95b,'rows':_0x400b9b}:null;}})[_0xfe72('0x22')](respondWithResult(_0x5b462f,null))['catch'](handleError(_0x5b462f,null));};exports[_0xfe72('0x10b')]=function(_0x32d550,_0x55d2ad,_0x239455){return db[_0xfe72('0x10c')][_0xfe72('0x5d')]({'where':{'id':_0x32d550[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x55d2ad,null))['then'](function(_0x28ec02){if(_0x28ec02){return _0x28ec02[_0xfe72('0x10b')](_0x32d550[_0xfe72('0x65')][_0xfe72('0x6d')],_[_0xfe72('0xe1')](_0x32d550[_0xfe72('0x65')],[_0xfe72('0x6d'),'id'])||{});}})['then'](respondWithResult(_0x55d2ad,null))['catch'](handleError(_0x55d2ad,null));};exports[_0xfe72('0xf6')]=function(_0x109c22,_0x270f80,_0x670c6d){var _0x1e119e={};var _0x5af163={};var _0x371e12;var _0x513e6a;return db[_0xfe72('0x3f')][_0xfe72('0x69')]({'where':{'id':_0x109c22[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x270f80,null))['then'](function(_0x33afd9){if(_0x33afd9){_0x371e12=_0x33afd9;_0x5af163[_0xfe72('0x47')]=_[_0xfe72('0x45')](db[_0xfe72('0x10d')][_0xfe72('0x5b')]);_0x5af163['query']=_[_0xfe72('0x45')](_0x109c22[_0xfe72('0x44')]);_0x5af163[_0xfe72('0x46')]=_['intersection'](_0x5af163[_0xfe72('0x47')],_0x5af163['query']);_0x1e119e['attributes']=_[_0xfe72('0x5c')](_0x5af163[_0xfe72('0x47')],qs[_0xfe72('0x49')](_0x109c22[_0xfe72('0x44')][_0xfe72('0x49')]));_0x1e119e[_0xfe72('0x48')]=_0x1e119e[_0xfe72('0x48')][_0xfe72('0x6a')]?_0x1e119e['attributes']:_0x5af163[_0xfe72('0x47')];_0x1e119e[_0xfe72('0x4c')]=qs[_0xfe72('0x4d')](_0x109c22[_0xfe72('0x44')]['sort']);_0x1e119e[_0xfe72('0x50')]=qs[_0xfe72('0x46')](_[_0xfe72('0x4e')](_0x109c22[_0xfe72('0x44')],_0x5af163[_0xfe72('0x46')]));if(_0x109c22[_0xfe72('0x44')][_0xfe72('0x4f')]){_0x1e119e[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0x1e119e[_0xfe72('0x50')],{'$or':_[_0xfe72('0x43')](_0x1e119e['attributes'],function(_0x411195){var _0x3cac05={};_0x3cac05[_0x411195]={'$like':'%'+_0x109c22[_0xfe72('0x44')][_0xfe72('0x4f')]+'%'};return _0x3cac05;})});}_0x1e119e=_[_0xfe72('0x51')]({},_0x1e119e,_0x109c22['options']);return _0x371e12[_0xfe72('0xf6')](_0x1e119e);}})[_0xfe72('0x22')](function(_0x38c09b){if(_0x38c09b){_0x513e6a=_0x38c09b[_0xfe72('0x6a')];if(!_0x109c22['query']['hasOwnProperty'](_0xfe72('0x4b'))){_0x1e119e[_0xfe72('0x31')]=qs['limit'](_0x109c22['query'][_0xfe72('0x31')]);_0x1e119e[_0xfe72('0x30')]=qs[_0xfe72('0x30')](_0x109c22[_0xfe72('0x44')]['offset']);}return _0x371e12[_0xfe72('0xf6')](_0x1e119e);}})[_0xfe72('0x22')](function(_0x8439e){if(_0x8439e){return _0x8439e?{'count':_0x513e6a,'rows':_0x8439e}:null;}})[_0xfe72('0x22')](respondWithResult(_0x270f80,null))['catch'](handleError(_0x270f80,null));};exports['getFields']=function(_0x4f9d4e,_0x36f26c,_0x424b47){var _0x4d5166=_0x4f9d4e[_0xfe72('0x44')][_0xfe72('0x10e')]===_0xfe72('0x10f')?_0xfe72('0x110'):'onlineForm';return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'attributes':['id',_0x4d5166],'where':{'id':_0x4f9d4e[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x36f26c,null))['then'](function(_0x464623){if(_0x464623){var _0xf268c9=_0x464623[_0x4d5166];var _0x3b60a7=_0xf268c9&&_0xf268c9[_0xfe72('0x111')]?_0xf268c9['items']:[];_0x36f26c[_0xfe72('0x3d')]({'fromKey':_[_0xfe72('0x80')](_0xf268c9[_0xfe72('0x112')])?undefined:_0xf268c9[_0xfe72('0x112')],'count':_0x3b60a7[_0xfe72('0x6a')],'rows':_0x3b60a7});}})[_0xfe72('0x2b')](handleError(_0x36f26c,null));};exports[_0xfe72('0x113')]=function(_0x1fa975,_0x54c6f7,_0x2cf070){var _0x7e32d8={'raw':![],'where':{}};var _0x87f484={};var _0x3dc1d0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfe72('0x69')]({'where':{'id':_0x1fa975[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x54c6f7,null))[_0xfe72('0x22')](function(_0x7a26dc){if(_0x7a26dc){_0x87f484[_0xfe72('0x47')]=_[_0xfe72('0x45')](db['ChatOfflineMessage'][_0xfe72('0x5b')]);_0x87f484[_0xfe72('0x44')]=_[_0xfe72('0x45')](_0x1fa975[_0xfe72('0x44')]);_0x87f484[_0xfe72('0x46')]=_[_0xfe72('0x5c')](_0x87f484[_0xfe72('0x47')],_0x87f484['query']);_0x7e32d8[_0xfe72('0x48')]=_[_0xfe72('0x5c')](_0x87f484[_0xfe72('0x47')],qs[_0xfe72('0x49')](_0x1fa975[_0xfe72('0x44')][_0xfe72('0x49')]));_0x7e32d8[_0xfe72('0x48')]=_0x7e32d8[_0xfe72('0x48')][_0xfe72('0x6a')]?_0x7e32d8[_0xfe72('0x48')]:_0x87f484[_0xfe72('0x47')];if(!_0x1fa975[_0xfe72('0x44')][_0xfe72('0x4a')]('nolimit')){_0x7e32d8[_0xfe72('0x31')]=qs[_0xfe72('0x31')](_0x1fa975['query'][_0xfe72('0x31')]);_0x7e32d8['offset']=qs['offset'](_0x1fa975[_0xfe72('0x44')][_0xfe72('0x30')]);}_0x7e32d8[_0xfe72('0x4c')]=qs[_0xfe72('0x4d')](_0x1fa975[_0xfe72('0x44')][_0xfe72('0x4d')]);_0x7e32d8[_0xfe72('0x50')]=qs['filters'](_[_0xfe72('0x4e')](_0x1fa975[_0xfe72('0x44')],_0x87f484[_0xfe72('0x46')]));_0x7e32d8[_0xfe72('0x50')]['ChatWebsiteId']=_0x7a26dc['id'];if(_0x1fa975['query']['filter']){_0x7e32d8[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0x7e32d8['where'],{'$or':_[_0xfe72('0x43')](_0x7e32d8[_0xfe72('0x48')],function(_0x58f49a){var _0x337cd0={};_0x337cd0[_0x58f49a]={'$like':'%'+_0x1fa975['query'][_0xfe72('0x4f')]+'%'};return _0x337cd0;})});}_0x7e32d8=_[_0xfe72('0x51')]({},_0x7e32d8,_0x1fa975[_0xfe72('0x53')]);return db[_0xfe72('0xd2')][_0xfe72('0x2f')]({'where':_0x7e32d8[_0xfe72('0x50')]})[_0xfe72('0x22')](function(_0x3179ed){_0x3dc1d0['count']=_0x3179ed;if(_0x1fa975[_0xfe72('0x44')]['includeAll']){_0x7e32d8[_0xfe72('0x55')]=[{'all':!![]}];}else{_0x7e32d8[_0xfe72('0x55')]=[{'model':db['CmContact'],'as':_0xfe72('0xe3'),'required':![]}];}return db[_0xfe72('0xd2')][_0xfe72('0x56')](_0x7e32d8);})[_0xfe72('0x22')](function(_0x19bfda){_0x3dc1d0[_0xfe72('0x57')]=_0x19bfda;return _0x3dc1d0;});}})[_0xfe72('0x22')](respondWithFilteredResult(_0x54c6f7,_0x7e32d8))['catch'](handleError(_0x54c6f7,null));};exports['addAgents']=function(_0x16c555,_0x4f4108,_0x1682f3){return db[_0xfe72('0x3f')]['find']({'where':{'id':_0x16c555[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x4f4108,null))[_0xfe72('0x22')](function(_0x3f80e5){if(_0x3f80e5){return _0x3f80e5[_0xfe72('0x114')](_0x16c555[_0xfe72('0x65')][_0xfe72('0x6d')],_[_0xfe72('0xe1')](_0x16c555[_0xfe72('0x65')],['ids','id'])||{})[_0xfe72('0xcd')](function(_0x5647cd){for(var _0x2fc2fe=0x0;_0x2fc2fe<_0x16c555['body']['ids'][_0xfe72('0x6a')];_0x2fc2fe+=0x1){socket[_0xfe72('0x115')](_0xfe72('0x116'),{'UserId':_0x16c555['body'][_0xfe72('0x6d')][_0x2fc2fe],'ChatWebsiteId':_0x16c555[_0xfe72('0x58')]['id']});}return _0x5647cd;});}})[_0xfe72('0x22')](respondWithResult(_0x4f4108,null))[_0xfe72('0x2b')](handleError(_0x4f4108,null));};exports[_0xfe72('0x117')]=function(_0x2e298e,_0x1bd630,_0x498ab5){return db[_0xfe72('0x3f')][_0xfe72('0x5d')]({'where':{'id':_0x2e298e['params']['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x1bd630,null))['then'](function(_0x53fb50){if(_0x53fb50){return _0x53fb50[_0xfe72('0x117')](_0x2e298e[_0xfe72('0x44')][_0xfe72('0x6d')])[_0xfe72('0x22')](function(){if(_[_0xfe72('0x118')](_0x2e298e[_0xfe72('0x44')]['ids'])){for(var _0x54a981=0x0;_0x54a981<_0x2e298e[_0xfe72('0x44')][_0xfe72('0x6d')][_0xfe72('0x6a')];_0x54a981+=0x1){socket[_0xfe72('0x115')]('userChatWebsite:remove',{'UserId':Number(_0x2e298e[_0xfe72('0x44')][_0xfe72('0x6d')][_0x54a981]),'ChatWebsiteId':Number(_0x2e298e[_0xfe72('0x58')]['id'])});}}else{socket['emit'](_0xfe72('0x119'),{'UserId':Number(_0x2e298e[_0xfe72('0x44')][_0xfe72('0x6d')]),'ChatWebsiteId':Number(_0x2e298e[_0xfe72('0x58')]['id'])});}});}})[_0xfe72('0x22')](respondWithStatusCode(_0x1bd630,null))[_0xfe72('0x2b')](handleError(_0x1bd630,null));};exports['getAgents']=function(_0x49c1c4,_0x54b32e,_0x2f53d2){var _0xc48b2a={};var _0xfb111e={};var _0x817968;var _0x2a17e2;return db['ChatWebsite'][_0xfe72('0x69')]({'where':{'id':_0x49c1c4[_0xfe72('0x58')]['id']}})[_0xfe72('0x22')](handleEntityNotFound(_0x54b32e,null))[_0xfe72('0x22')](function(_0x2c8bfd){if(_0x2c8bfd){_0x817968=_0x2c8bfd;_0xfb111e['model']=_[_0xfe72('0x45')](db['User'][_0xfe72('0x5b')]);_0xfb111e[_0xfe72('0x44')]=_[_0xfe72('0x45')](_0x49c1c4[_0xfe72('0x44')]);_0xfb111e[_0xfe72('0x46')]=_[_0xfe72('0x5c')](_0xfb111e[_0xfe72('0x47')],_0xfb111e[_0xfe72('0x44')]);_0xc48b2a[_0xfe72('0x48')]=_['intersection'](_0xfb111e[_0xfe72('0x47')],qs[_0xfe72('0x49')](_0x49c1c4[_0xfe72('0x44')][_0xfe72('0x49')]));_0xc48b2a[_0xfe72('0x48')]=_0xc48b2a['attributes'][_0xfe72('0x6a')]?_0xc48b2a[_0xfe72('0x48')]:_0xfb111e[_0xfe72('0x47')];_0xc48b2a[_0xfe72('0x4c')]=qs[_0xfe72('0x4d')](_0x49c1c4[_0xfe72('0x44')][_0xfe72('0x4d')]);_0xc48b2a[_0xfe72('0x50')]=qs[_0xfe72('0x46')](_['pick'](_0x49c1c4['query'],_0xfb111e[_0xfe72('0x46')]));if(_0x49c1c4[_0xfe72('0x44')][_0xfe72('0x4f')]){_0xc48b2a[_0xfe72('0x50')]=_[_0xfe72('0x51')](_0xc48b2a[_0xfe72('0x50')],{'$or':_[_0xfe72('0x43')](_0xc48b2a[_0xfe72('0x48')],function(_0x43c489){var _0x4e8252={};_0x4e8252[_0x43c489]={'$like':'%'+_0x49c1c4[_0xfe72('0x44')][_0xfe72('0x4f')]+'%'};return _0x4e8252;})});}_0xc48b2a=_['merge']({},_0xc48b2a,_0x49c1c4['options']);return _0x817968['getAgents'](_0xc48b2a);}})[_0xfe72('0x22')](function(_0x4af8d0){if(_0x4af8d0){_0x2a17e2=_0x4af8d0[_0xfe72('0x6a')];if(!_0x49c1c4[_0xfe72('0x44')][_0xfe72('0x4a')]('nolimit')){_0xc48b2a[_0xfe72('0x31')]=qs[_0xfe72('0x31')](_0x49c1c4[_0xfe72('0x44')][_0xfe72('0x31')]);_0xc48b2a['offset']=qs[_0xfe72('0x30')](_0x49c1c4[_0xfe72('0x44')]['offset']);}return _0x817968['getAgents'](_0xc48b2a);}})[_0xfe72('0x22')](function(_0x2b9b74){if(_0x2b9b74){return _0x2b9b74?{'count':_0x2a17e2,'rows':_0x2b9b74}:null;}})[_0xfe72('0x22')](respondWithResult(_0x54b32e,null))[_0xfe72('0x2b')](handleError(_0x54b32e,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 2fd96ae..1d5e1d0 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 _0x3148=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x284258,_0x41159b){var _0x1231fc=function(_0x13683d){while(--_0x13683d){_0x284258['push'](_0x284258['shift']());}};_0x1231fc(++_0x41159b);}(_0x3148,0x1d3));var _0x8314=function(_0x23a216,_0x58097f){_0x23a216=_0x23a216-0x0;var _0x4d0c86=_0x3148[_0x23a216];return _0x4d0c86;};'use strict';var EventEmitter=require(_0x8314('0x0'));var ChatWebsite=require(_0x8314('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8314('0x2')](0x0);var events={'afterCreate':_0x8314('0x3'),'afterUpdate':_0x8314('0x4'),'afterDestroy':_0x8314('0x5')};function emitEvent(_0x58f818){return function(_0x35ee55,_0x41e9fd,_0x62c506){ChatWebsiteEvents[_0x8314('0x6')](_0x58f818+':'+_0x35ee55['id'],_0x35ee55);ChatWebsiteEvents[_0x8314('0x6')](_0x58f818,_0x35ee55);_0x62c506(null);};}for(var e in events){if(events[_0x8314('0x7')](e)){var event=events[e];ChatWebsite[_0x8314('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x7b47=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2bba14,_0x463a51){var _0x308039=function(_0x32a3da){while(--_0x32a3da){_0x2bba14['push'](_0x2bba14['shift']());}};_0x308039(++_0x463a51);}(_0x7b47,0x118));var _0x77b4=function(_0x3c9017,_0x1241c1){_0x3c9017=_0x3c9017-0x0;var _0x489f02=_0x7b47[_0x3c9017];return _0x489f02;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x77b4('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x77b4('0x1')](0x0);var events={'afterCreate':_0x77b4('0x2'),'afterUpdate':_0x77b4('0x3'),'afterDestroy':_0x77b4('0x4')};function emitEvent(_0x5257c1){return function(_0x3dd6f5,_0x55c9b4,_0x23f1f6){ChatWebsiteEvents[_0x77b4('0x5')](_0x5257c1+':'+_0x3dd6f5['id'],_0x3dd6f5);ChatWebsiteEvents[_0x77b4('0x5')](_0x5257c1,_0x3dd6f5);_0x23f1f6(null);};}for(var e in events){if(events[_0x77b4('0x6')](e)){var event=events[e];ChatWebsite[_0x77b4('0x7')](e,emitEvent(event));}}module[_0x77b4('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 723acbb..5dbea93 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 _0xed8a=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','ChatWebsite','chat_websites','lodash'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0xed8a,0xc5));var _0xaed8=function(_0x4001ce,_0x4d97be){_0x4001ce=_0x4001ce-0x0;var _0x37c881=_0xed8a[_0x4001ce];return _0x37c881;};'use strict';var _=require(_0xaed8('0x0'));var util=require(_0xaed8('0x1'));var logger=require(_0xaed8('0x2'))(_0xaed8('0x3'));var moment=require('moment');var BPromise=require(_0xaed8('0x4'));var rp=require(_0xaed8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaed8('0x6'));var config=require(_0xaed8('0x7'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x347ca1,_0x7e6c5e){return _0x347ca1[_0xaed8('0x8')](_0xaed8('0x9'),attributes,{'tableName':_0xaed8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ea3=['ChatWebsite','chat_websites','lodash','util','../../config/logger','api','bluebird','path','./chatWebsite.attributes','exports','define'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0x4ea3,0x70));var _0x34ea=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x4ea3[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var logger=require(_0x34ea('0x2'))(_0x34ea('0x3'));var moment=require('moment');var BPromise=require(_0x34ea('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34ea('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34ea('0x6'));module[_0x34ea('0x7')]=function(_0x962596,_0x123d48){return _0x962596[_0x34ea('0x8')](_0x34ea('0x9'),attributes,{'tableName':_0x34ea('0xa'),'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 d5ced45..1610e9d 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 _0x2542=['register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x16410d,_0x2509e0){var _0x23fa1c=function(_0x3126f9){while(--_0x3126f9){_0x16410d['push'](_0x16410d['shift']());}};_0x23fa1c(++_0x2509e0);}(_0x2542,0x169));var _0x2254=function(_0x3e3164,_0x86fa76){_0x3e3164=_0x3e3164-0x0;var _0x198e7f=_0x2542[_0x3e3164];return _0x198e7f;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});config[_0x2254('0xb')]=_[_0x2254('0xc')](config[_0x2254('0xb')],{'host':_0x2254('0xd'),'port':0x18eb});var socket=require(_0x2254('0xe'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xf'))[_0x2254('0x10')](socket);function respondWithRpcPromise(_0x1ae415,_0x38fb2b,_0x5b1ab9){return new BPromise(function(_0x336e14,_0x2655ea){return client[_0x2254('0x11')](_0x1ae415,_0x5b1ab9)[_0x2254('0x12')](function(_0x575d58){logger['info'](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));logger[_0x2254('0x15')](_0x2254('0x16'),_0x38fb2b,_0x2254('0x14'),JSON[_0x2254('0x17')](_0x575d58));if(_0x575d58['error']){if(_0x575d58[_0x2254('0x18')][_0x2254('0x19')]===0x1f4){logger['error'](_0x2254('0x13'),_0x38fb2b,_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);return _0x2655ea(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}logger[_0x2254('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x38fb2b,_0x575d58[_0x2254('0x18')]['message']);return _0x336e14(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}else{logger[_0x2254('0x1b')](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));_0x336e14(_0x575d58[_0x2254('0x1c')]['message']);}})['catch'](function(_0x5ec98d){logger[_0x2254('0x18')](_0x2254('0x13'),_0x38fb2b,_0x5ec98d);_0x2655ea(_0x5ec98d);});});} \ No newline at end of file +var _0x5c3c=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util'];(function(_0x23639b,_0x45f15e){var _0x6b0cca=function(_0x4af5d9){while(--_0x4af5d9){_0x23639b['push'](_0x23639b['shift']());}};_0x6b0cca(++_0x45f15e);}(_0x5c3c,0x132));var _0xc5c3=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5c3c[_0x122096];return _0x3d1966;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 17d5631..342e538 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(_0x1a151a,_0x44325f){var _0x3ce862=function(_0x10aeed){while(--_0x10aeed){_0x1a151a['push'](_0x1a151a['shift']());}};_0x3ce862(++_0x44325f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x564f4c,_0x49da12){_0x564f4c=_0x564f4c-0x0;var _0x3b2d04=_0x5f2f[_0x564f4c];return _0x3b2d04;};'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(_0x51244e,_0x24c7e6){var _0x58d71c=function(_0x3a8ea5){while(--_0x3a8ea5){_0x51244e['push'](_0x51244e['shift']());}};_0x58d71c(++_0x24c7e6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5402f4,_0x2d0eab){_0x5402f4=_0x5402f4-0x0;var _0x1aaa2f=_0x5f2f[_0x5402f4];return _0x1aaa2f;};'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 dd8a326..da8396d 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 _0xd61e=['destroy','removeAnswers','/:id/users','removeAgents','util','connect-timeout','express','../../config/environment','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','/:id/customer_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','diskStorage','join','server/files/images/logos/','format','now','/:id/logo','single','file','addLogo','root','server/files/images/avatars/','%s-%s','/:id/avatar','addAvatar','originalname','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','addAgents','put','update','delete'];(function(_0x4c5180,_0x179861){var _0x328f40=function(_0x43157c){while(--_0x43157c){_0x4c5180['push'](_0x4c5180['shift']());}};_0x328f40(++_0x179861);}(_0xd61e,0x1a1));var _0xed61=function(_0x21895c,_0x75b67d){_0x21895c=_0x21895c-0x0;var _0x25004a=_0xd61e[_0x21895c];return _0x25004a;};'use strict';var multer=require('multer');var util=require(_0xed61('0x0'));var path=require('path');var timeout=require(_0xed61('0x1'));var express=require(_0xed61('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xed61('0x3'));var controller=require('./chatWebsite.controller');router[_0xed61('0x4')]('/',auth[_0xed61('0x5')](),controller[_0xed61('0x6')]);router[_0xed61('0x4')](_0xed61('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0xed61('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xed61('0x8')]);router[_0xed61('0x4')](_0xed61('0x9'),auth[_0xed61('0x5')](),controller[_0xed61('0xa')]);router[_0xed61('0x4')](_0xed61('0xb'),auth['isAuthenticated'](),controller[_0xed61('0xc')]);router[_0xed61('0x4')]('/:id/logo',controller[_0xed61('0xd')]);router[_0xed61('0x4')]('/:id/avatar',controller[_0xed61('0xe')]);router[_0xed61('0x4')](_0xed61('0xf'),controller['getCustomerAvatar']);router['get']('/:id/system_avatar',controller['getSystemAvatar']);router['get'](_0xed61('0x10'),auth[_0xed61('0x5')](),controller[_0xed61('0x11')]);router[_0xed61('0x4')](_0xed61('0x12'),controller[_0xed61('0x13')]);router['get'](_0xed61('0x14'),auth[_0xed61('0x5')](),controller['getApplications']);router[_0xed61('0x4')](_0xed61('0x15'),auth[_0xed61('0x5')](),controller['getProactiveActions']);router[_0xed61('0x4')](_0xed61('0x16'),controller[_0xed61('0x17')]);router[_0xed61('0x4')](_0xed61('0x18'),auth[_0xed61('0x5')](),controller[_0xed61('0x19')]);router[_0xed61('0x4')]('/:id/users',auth[_0xed61('0x5')](),controller[_0xed61('0x1a')]);router[_0xed61('0x1b')]('/',auth['isAuthenticated'](),controller[_0xed61('0x1c')]);router['post'](_0xed61('0x9'),auth[_0xed61('0x5')](),controller['addDisposition']);router[_0xed61('0x1b')](_0xed61('0xb'),auth[_0xed61('0x5')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xed61('0x1d')]({'destination':function(_0x4b93f4,_0x760dca,_0x38b833){_0x38b833(null,path[_0xed61('0x1e')](config['root'],_0xed61('0x1f')));},'filename':function(_0x542419,_0x144c8d,_0x10c080){_0x10c080(null,util[_0xed61('0x20')]('%s-%s',Date[_0xed61('0x21')](),_0x144c8d['originalname']));}})});router['post'](_0xed61('0x22'),upload[_0xed61('0x23')](_0xed61('0x24')),controller[_0xed61('0x25')]);var upload=multer({'storage':multer[_0xed61('0x1d')]({'destination':function(_0x48f551,_0x31dc64,_0x2ed0b8){_0x2ed0b8(null,path[_0xed61('0x1e')](config[_0xed61('0x26')],_0xed61('0x27')));},'filename':function(_0x1b9260,_0x32f518,_0x4e003e){_0x4e003e(null,util[_0xed61('0x20')](_0xed61('0x28'),Date[_0xed61('0x21')](),_0x32f518['originalname']));}})});router['post'](_0xed61('0x29'),upload[_0xed61('0x23')](_0xed61('0x24')),controller[_0xed61('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x417a04,_0xc8b6e7,_0x412635){_0x412635(null,path[_0xed61('0x1e')](config[_0xed61('0x26')],_0xed61('0x27')));},'filename':function(_0x494ad0,_0x215665,_0x2510d4){_0x2510d4(null,util[_0xed61('0x20')](_0xed61('0x28'),Date[_0xed61('0x21')](),_0x215665[_0xed61('0x2b')]));}})});router[_0xed61('0x1b')](_0xed61('0xf'),upload[_0xed61('0x23')](_0xed61('0x24')),controller[_0xed61('0x2c')]);var upload=multer({'storage':multer[_0xed61('0x1d')]({'destination':function(_0x224d83,_0xfee75e,_0x8c80d0){_0x8c80d0(null,path['join'](config[_0xed61('0x26')],_0xed61('0x27')));},'filename':function(_0x3432f2,_0x4c18db,_0x3b9a61){_0x3b9a61(null,util[_0xed61('0x20')](_0xed61('0x28'),Date[_0xed61('0x21')](),_0x4c18db['originalname']));}})});router[_0xed61('0x1b')](_0xed61('0x2d'),upload[_0xed61('0x23')](_0xed61('0x24')),controller[_0xed61('0x2e')]);router[_0xed61('0x1b')](_0xed61('0x2f'),controller[_0xed61('0x30')]);router['post'](_0xed61('0x31'),controller[_0xed61('0x32')]);router[_0xed61('0x1b')](_0xed61('0x10'),auth[_0xed61('0x5')](),controller['addInteraction']);router[_0xed61('0x1b')](_0xed61('0x14'),auth[_0xed61('0x5')](),controller['addApplications']);router[_0xed61('0x1b')]('/:id/proactive_actions',auth['isAuthenticated'](),controller['addProactiveActions']);router[_0xed61('0x1b')]('/:id/users',auth[_0xed61('0x5')](),controller[_0xed61('0x33')]);router[_0xed61('0x34')]('/:id',auth[_0xed61('0x5')](),controller[_0xed61('0x35')]);router[_0xed61('0x36')]('/:id',auth['isAuthenticated'](),controller[_0xed61('0x37')]);router[_0xed61('0x36')](_0xed61('0x9'),auth[_0xed61('0x5')](),controller['removeDispositions']);router[_0xed61('0x36')](_0xed61('0xb'),auth[_0xed61('0x5')](),controller[_0xed61('0x38')]);router[_0xed61('0x36')](_0xed61('0x39'),auth[_0xed61('0x5')](),controller[_0xed61('0x3a')]);module['exports']=router; \ No newline at end of file +var _0x6ee1=['server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','addLogo','root','server/files/images/avatars/','file','/:id/notify','notify','offline','addInteraction','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join'];(function(_0x22420f,_0x536255){var _0x4204b0=function(_0x4c3a14){while(--_0x4c3a14){_0x22420f['push'](_0x22420f['shift']());}};_0x4204b0(++_0x536255);}(_0x6ee1,0x16c));var _0x16ee=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0x6ee1[_0x385c76];return _0x5c8367;};'use strict';var multer=require(_0x16ee('0x0'));var util=require(_0x16ee('0x1'));var path=require('path');var timeout=require(_0x16ee('0x2'));var express=require(_0x16ee('0x3'));var router=express[_0x16ee('0x4')]();var auth=require(_0x16ee('0x5'));var interaction=require(_0x16ee('0x6'));var config=require(_0x16ee('0x7'));var controller=require(_0x16ee('0x8'));router[_0x16ee('0x9')]('/',auth[_0x16ee('0xa')](),controller[_0x16ee('0xb')]);router[_0x16ee('0x9')]('/describe',auth[_0x16ee('0xa')](),controller[_0x16ee('0xc')]);router[_0x16ee('0x9')](_0x16ee('0xd'),auth['isAuthenticated'](),controller[_0x16ee('0xe')]);router[_0x16ee('0x9')](_0x16ee('0xf'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x10')]);router['get'](_0x16ee('0x11'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x12')]);router[_0x16ee('0x9')]('/:id/logo',controller[_0x16ee('0x13')]);router[_0x16ee('0x9')](_0x16ee('0x14'),controller['getAvatar']);router[_0x16ee('0x9')](_0x16ee('0x15'),controller[_0x16ee('0x16')]);router[_0x16ee('0x9')](_0x16ee('0x17'),controller[_0x16ee('0x18')]);router[_0x16ee('0x9')](_0x16ee('0x19'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x1a')]);router['get'](_0x16ee('0x1b'),controller[_0x16ee('0x1c')]);router[_0x16ee('0x9')](_0x16ee('0x1d'),auth['isAuthenticated'](),controller[_0x16ee('0x1e')]);router[_0x16ee('0x9')](_0x16ee('0x1f'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x20')]);router[_0x16ee('0x9')](_0x16ee('0x21'),controller[_0x16ee('0x22')]);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x16ee('0x23')]);router[_0x16ee('0x9')](_0x16ee('0x24'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x25')]);router[_0x16ee('0x26')]('/',auth['isAuthenticated'](),controller[_0x16ee('0x27')]);router['post'](_0x16ee('0xf'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x28')]);router[_0x16ee('0x26')](_0x16ee('0x11'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x29')]);var upload=multer({'storage':multer[_0x16ee('0x2a')]({'destination':function(_0x3aaf15,_0x47b123,_0x4eb430){_0x4eb430(null,path[_0x16ee('0x2b')](config['root'],_0x16ee('0x2c')));},'filename':function(_0x5bb448,_0x3da784,_0x38ed95){_0x38ed95(null,util[_0x16ee('0x2d')](_0x16ee('0x2e'),Date[_0x16ee('0x2f')](),_0x3da784[_0x16ee('0x30')]));}})});router[_0x16ee('0x26')](_0x16ee('0x31'),upload[_0x16ee('0x32')]('file'),controller[_0x16ee('0x33')]);var upload=multer({'storage':multer[_0x16ee('0x2a')]({'destination':function(_0x99edb3,_0x10ef73,_0x3ba5e7){_0x3ba5e7(null,path[_0x16ee('0x2b')](config[_0x16ee('0x34')],_0x16ee('0x35')));},'filename':function(_0x327d1d,_0x48b529,_0x4d936a){_0x4d936a(null,util['format'](_0x16ee('0x2e'),Date[_0x16ee('0x2f')](),_0x48b529[_0x16ee('0x30')]));}})});router[_0x16ee('0x26')](_0x16ee('0x14'),upload['single']('file'),controller['addAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2bf91f,_0x3b5026,_0x33944f){_0x33944f(null,path[_0x16ee('0x2b')](config['root'],_0x16ee('0x35')));},'filename':function(_0x89e790,_0x523433,_0x2edf76){_0x2edf76(null,util[_0x16ee('0x2d')](_0x16ee('0x2e'),Date[_0x16ee('0x2f')](),_0x523433[_0x16ee('0x30')]));}})});router[_0x16ee('0x26')](_0x16ee('0x15'),upload[_0x16ee('0x32')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x16ee('0x2a')]({'destination':function(_0x1b2826,_0x5959ac,_0x10434d){_0x10434d(null,path[_0x16ee('0x2b')](config[_0x16ee('0x34')],'server/files/images/avatars/'));},'filename':function(_0x2c5376,_0x212ceb,_0x33dc6b){_0x33dc6b(null,util[_0x16ee('0x2d')](_0x16ee('0x2e'),Date[_0x16ee('0x2f')](),_0x212ceb[_0x16ee('0x30')]));}})});router['post'](_0x16ee('0x17'),upload['single'](_0x16ee('0x36')),controller['addSystemAvatar']);router[_0x16ee('0x26')](_0x16ee('0x37'),controller[_0x16ee('0x38')]);router[_0x16ee('0x26')]('/:id/offline',controller[_0x16ee('0x39')]);router['post'](_0x16ee('0x19'),auth['isAuthenticated'](),controller[_0x16ee('0x3a')]);router[_0x16ee('0x26')](_0x16ee('0x1d'),auth['isAuthenticated'](),controller['addApplications']);router[_0x16ee('0x26')](_0x16ee('0x1f'),auth['isAuthenticated'](),controller[_0x16ee('0x3b')]);router[_0x16ee('0x26')](_0x16ee('0x24'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x3c')]);router[_0x16ee('0x3d')](_0x16ee('0xd'),auth[_0x16ee('0xa')](),controller['update']);router[_0x16ee('0x3e')](_0x16ee('0xd'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x3f')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x16ee('0x40')]);router['delete']('/:id/canned_answers',auth[_0x16ee('0xa')](),controller[_0x16ee('0x41')]);router[_0x16ee('0x3e')](_0x16ee('0x24'),auth[_0x16ee('0xa')](),controller[_0x16ee('0x42')]);module[_0x16ee('0x43')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index b00bbbf..cdc63e9 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 _0xe626=['ENUM','Google','sequelize','exports','STRING'];(function(_0x31c908,_0x36dc32){var _0x5bb4b1=function(_0x1b42a5){while(--_0x1b42a5){_0x31c908['push'](_0x31c908['shift']());}};_0x5bb4b1(++_0x36dc32);}(_0xe626,0x9d));var _0x6e62=function(_0x4f268f,_0x13275d){_0x4f268f=_0x4f268f-0x0;var _0x3d9fa9=_0xe626[_0x4f268f];return _0x3d9fa9;};'use strict';var Sequelize=require(_0x6e62('0x0'));module[_0x6e62('0x1')]={'name':{'type':Sequelize[_0x6e62('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6e62('0x3')]('AmazonAWS',_0x6e62('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x6e62('0x2')]},'data2':{'type':Sequelize[_0x6e62('0x2')]}}; \ No newline at end of file +var _0x8b8e=['sequelize','STRING','AmazonAWS'];(function(_0x524916,_0x3394bb){var _0xbc2dac=function(_0x1d6840){while(--_0x1d6840){_0x524916['push'](_0x524916['shift']());}};_0xbc2dac(++_0x3394bb);}(_0x8b8e,0x108));var _0xe8b8=function(_0x3f86aa,_0x306778){_0x3f86aa=_0x3f86aa-0x0;var _0x5e60e1=_0x8b8e[_0x3f86aa];return _0x5e60e1;};'use strict';var Sequelize=require(_0xe8b8('0x0'));module['exports']={'name':{'type':Sequelize[_0xe8b8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xe8b8('0x2'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xe8b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 3a8c5b0..22ce4a6 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 _0x53e9=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','index','map','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','CloudProvider','findAll','rows','catch','show','params','keys','length','find','create','update','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','../../components/auth/service'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x53e9,0x101));var _0x953e=function(_0x4ee5a3,_0x2a7bc6){_0x4ee5a3=_0x4ee5a3-0x0;var _0x3e1b6e=_0x53e9[_0x4ee5a3];return _0x3e1b6e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x953e('0x0'));var rimraf=require(_0x953e('0x1'));var zipdir=require(_0x953e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x953e('0x3'));var BPromise=require(_0x953e('0x4'));var Mustache=require(_0x953e('0x5'));var util=require(_0x953e('0x6'));var path=require(_0x953e('0x7'));var sox=require(_0x953e('0x8'));var csv=require(_0x953e('0x9'));var ejs=require(_0x953e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x953e('0xb'));var crypto=require('crypto');var jsforce=require(_0x953e('0xc'));var deskjs=require(_0x953e('0xd'));var toCsv=require(_0x953e('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x953e('0xe'));var qs=require(_0x953e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x953e('0x10'));var logger=require(_0x953e('0x11'))('api');var utils=require(_0x953e('0x12'));var config=require(_0x953e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b8b66,_0x4ca3d3){_0x4ca3d3=_0x4ca3d3||0xcc;return function(_0x45790f){if(_0x45790f){return _0x4b8b66[_0x953e('0x14')](_0x4ca3d3);}return _0x4b8b66[_0x953e('0x15')](_0x4ca3d3)[_0x953e('0x16')]();};}function respondWithResult(_0x33cf9d,_0x2da24d){_0x2da24d=_0x2da24d||0xc8;return function(_0x122a93){if(_0x122a93){return _0x33cf9d['status'](_0x2da24d)[_0x953e('0x17')](_0x122a93);}};}function respondWithFilteredResult(_0x5ab7ff,_0x138448){return function(_0x1e6d89){if(_0x1e6d89){var _0x26da69=_0x1e6d89[_0x953e('0x18')],_0x43a3bf=_0x138448[_0x953e('0x19')],_0x3c2b78=_0x138448[_0x953e('0x19')]+_0x138448['limit'],_0x381b2d;if(_0x3c2b78>=_0x26da69){_0x3c2b78=_0x26da69;_0x381b2d=0xc8;}else{_0x381b2d=0xce;}_0x5ab7ff[_0x953e('0x15')](_0x381b2d);return _0x5ab7ff[_0x953e('0x1a')](_0x953e('0x1b'),_0x43a3bf+'-'+_0x3c2b78+'/'+_0x26da69)[_0x953e('0x17')](_0x1e6d89);}return null;};}function patchUpdates(_0x43f4bc){return function(_0x428ca5){try{jsonpatch[_0x953e('0x1c')](_0x428ca5,_0x43f4bc,!![]);}catch(_0x437f19){return BPromise[_0x953e('0x1d')](_0x437f19);}return _0x428ca5[_0x953e('0x1e')]();};}function saveUpdates(_0x5a8c47,_0x62bd35){return function(_0x260c96){if(_0x260c96){return _0x260c96['update'](_0x5a8c47)[_0x953e('0x1f')](function(_0x599825){return _0x599825;});}return null;};}function removeEntity(_0x4a6db6,_0x55c8c1){return function(_0x528755){if(_0x528755){return _0x528755[_0x953e('0x20')]()['then'](function(){_0x4a6db6[_0x953e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x128ead,_0x2e02bb){return function(_0x219b91){if(!_0x219b91){_0x128ead['sendStatus'](0x194);}return _0x219b91;};}function handleError(_0x11752f,_0x2232cc){_0x2232cc=_0x2232cc||0x1f4;return function(_0x3f1ca3){logger['error'](_0x3f1ca3['stack']);if(_0x3f1ca3['name']){delete _0x3f1ca3['name'];}_0x11752f[_0x953e('0x15')](_0x2232cc)['send'](_0x3f1ca3);};}exports[_0x953e('0x21')]=function(_0x269a40,_0x110fa7){var _0x40747b={},_0x866ce3={},_0x5350b3={'count':0x0,'rows':[]};var _0x2d083d=_[_0x953e('0x22')](db['CloudProvider'][_0x953e('0x23')],function(_0x590673){return{'name':_0x590673[_0x953e('0x24')],'type':_0x590673[_0x953e('0x25')]['key']};});_0x866ce3[_0x953e('0x26')]=_[_0x953e('0x22')](_0x2d083d,_0x953e('0x27'));_0x866ce3['query']=_['keys'](_0x269a40[_0x953e('0x28')]);_0x866ce3[_0x953e('0x29')]=_[_0x953e('0x2a')](_0x866ce3[_0x953e('0x26')],_0x866ce3[_0x953e('0x28')]);_0x40747b[_0x953e('0x2b')]=_[_0x953e('0x2a')](_0x866ce3[_0x953e('0x26')],qs['fields'](_0x269a40[_0x953e('0x28')][_0x953e('0x2c')]));_0x40747b[_0x953e('0x2b')]=_0x40747b[_0x953e('0x2b')]['length']?_0x40747b[_0x953e('0x2b')]:_0x866ce3[_0x953e('0x26')];if(!_0x269a40[_0x953e('0x28')][_0x953e('0x2d')]('nolimit')){_0x40747b[_0x953e('0x2e')]=qs[_0x953e('0x2e')](_0x269a40[_0x953e('0x28')][_0x953e('0x2e')]);_0x40747b[_0x953e('0x19')]=qs[_0x953e('0x19')](_0x269a40['query']['offset']);}_0x40747b['order']=qs[_0x953e('0x2f')](_0x269a40['query'][_0x953e('0x2f')]);_0x40747b[_0x953e('0x30')]=qs[_0x953e('0x29')](_[_0x953e('0x31')](_0x269a40[_0x953e('0x28')],_0x866ce3[_0x953e('0x29')]),_0x2d083d);if(_0x269a40['query'][_0x953e('0x32')]){_0x40747b[_0x953e('0x30')]=_[_0x953e('0x33')](_0x40747b[_0x953e('0x30')],{'$or':_[_0x953e('0x22')](_0x2d083d,function(_0xbb4c2b){if(_0xbb4c2b[_0x953e('0x25')]!==_0x953e('0x34')){var _0x497e56={};_0x497e56[_0xbb4c2b['name']]={'$like':'%'+_0x269a40['query']['filter']+'%'};return _0x497e56;}})});}_0x40747b=_['merge']({},_0x40747b,_0x269a40[_0x953e('0x35')]);var _0x495567={'where':_0x40747b['where']};return db['CloudProvider'][_0x953e('0x18')](_0x495567)[_0x953e('0x1f')](function(_0x434743){_0x5350b3[_0x953e('0x18')]=_0x434743;if(_0x269a40[_0x953e('0x28')][_0x953e('0x36')]){_0x40747b[_0x953e('0x37')]=[{'all':!![]}];}return db[_0x953e('0x38')][_0x953e('0x39')](_0x40747b);})[_0x953e('0x1f')](function(_0x3595f7){_0x5350b3[_0x953e('0x3a')]=_0x3595f7;return _0x5350b3;})['then'](respondWithFilteredResult(_0x110fa7,_0x40747b))[_0x953e('0x3b')](handleError(_0x110fa7,null));};exports[_0x953e('0x3c')]=function(_0x2fa7dd,_0x2adb44){var _0xbfafd8={'raw':!![],'where':{'id':_0x2fa7dd[_0x953e('0x3d')]['id']}},_0x1b1c6c={};_0x1b1c6c[_0x953e('0x26')]=_['keys'](db[_0x953e('0x38')][_0x953e('0x23')]);_0x1b1c6c[_0x953e('0x28')]=_[_0x953e('0x3e')](_0x2fa7dd['query']);_0x1b1c6c[_0x953e('0x29')]=_['intersection'](_0x1b1c6c[_0x953e('0x26')],_0x1b1c6c[_0x953e('0x28')]);_0xbfafd8[_0x953e('0x2b')]=_[_0x953e('0x2a')](_0x1b1c6c[_0x953e('0x26')],qs['fields'](_0x2fa7dd['query']['fields']));_0xbfafd8[_0x953e('0x2b')]=_0xbfafd8[_0x953e('0x2b')][_0x953e('0x3f')]?_0xbfafd8[_0x953e('0x2b')]:_0x1b1c6c[_0x953e('0x26')];if(_0x2fa7dd[_0x953e('0x28')][_0x953e('0x36')]){_0xbfafd8[_0x953e('0x37')]=[{'all':!![]}];}_0xbfafd8=_[_0x953e('0x33')]({},_0xbfafd8,_0x2fa7dd[_0x953e('0x35')]);return db['CloudProvider'][_0x953e('0x40')](_0xbfafd8)[_0x953e('0x1f')](handleEntityNotFound(_0x2adb44,null))[_0x953e('0x1f')](respondWithResult(_0x2adb44,null))[_0x953e('0x3b')](handleError(_0x2adb44,null));};exports[_0x953e('0x41')]=function(_0x2d745c,_0xc8c8d){return db[_0x953e('0x38')][_0x953e('0x41')](_0x2d745c['body'],{})[_0x953e('0x1f')](respondWithResult(_0xc8c8d,0xc9))[_0x953e('0x3b')](handleError(_0xc8c8d,null));};exports[_0x953e('0x42')]=function(_0x4e338b,_0x1751a7){if(_0x4e338b['body']['id']){delete _0x4e338b[_0x953e('0x43')]['id'];}return db[_0x953e('0x38')]['find']({'where':{'id':_0x4e338b['params']['id']}})[_0x953e('0x1f')](handleEntityNotFound(_0x1751a7,null))[_0x953e('0x1f')](saveUpdates(_0x4e338b[_0x953e('0x43')],null))[_0x953e('0x1f')](respondWithResult(_0x1751a7,null))['catch'](handleError(_0x1751a7,null));};exports['destroy']=function(_0x3eacda,_0x1180b7){return db[_0x953e('0x38')][_0x953e('0x40')]({'where':{'id':_0x3eacda[_0x953e('0x3d')]['id']}})[_0x953e('0x1f')](handleEntityNotFound(_0x1180b7,null))['then'](removeEntity(_0x1180b7,null))['catch'](handleError(_0x1180b7,null));}; \ No newline at end of file +var _0x72a8=['body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','CloudProvider','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','VIRTUAL','filter','options','where','includeAll','rows','catch','show','params','fields','include','merge','find','create'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x72a8,0x182));var _0x872a=function(_0x3ab565,_0x93c0c1){_0x3ab565=_0x3ab565-0x0;var _0x3f01a9=_0x72a8[_0x3ab565];return _0x3f01a9;};'use strict';var pdf=require(_0x872a('0x0'));var emlformat=require(_0x872a('0x1'));var rimraf=require(_0x872a('0x2'));var zipdir=require(_0x872a('0x3'));var jsonpatch=require(_0x872a('0x4'));var rp=require(_0x872a('0x5'));var moment=require(_0x872a('0x6'));var BPromise=require(_0x872a('0x7'));var Mustache=require(_0x872a('0x8'));var util=require('util');var path=require(_0x872a('0x9'));var sox=require(_0x872a('0xa'));var csv=require('to-csv');var ejs=require(_0x872a('0xb'));var fs=require('fs');var _=require(_0x872a('0xc'));var squel=require(_0x872a('0xd'));var crypto=require(_0x872a('0xe'));var jsforce=require(_0x872a('0xf'));var deskjs=require(_0x872a('0x10'));var toCsv=require(_0x872a('0x11'));var querystring=require(_0x872a('0x12'));var Papa=require('papaparse');var Redis=require(_0x872a('0x13'));var authService=require(_0x872a('0x14'));var qs=require(_0x872a('0x15'));var as=require(_0x872a('0x16'));var hardwareService=require(_0x872a('0x17'));var logger=require(_0x872a('0x18'))(_0x872a('0x19'));var utils=require(_0x872a('0x1a'));var config=require(_0x872a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54ec3c,_0x18dedb){_0x18dedb=_0x18dedb||0xcc;return function(_0x4da851){if(_0x4da851){return _0x54ec3c[_0x872a('0x1c')](_0x18dedb);}return _0x54ec3c[_0x872a('0x1d')](_0x18dedb)[_0x872a('0x1e')]();};}function respondWithResult(_0x220fdd,_0x5d51f0){_0x5d51f0=_0x5d51f0||0xc8;return function(_0x1e1f2f){if(_0x1e1f2f){return _0x220fdd[_0x872a('0x1d')](_0x5d51f0)[_0x872a('0x1f')](_0x1e1f2f);}};}function respondWithFilteredResult(_0x18e5b7,_0xb3f3d3){return function(_0x5cd129){if(_0x5cd129){var _0x28f44f=_0x5cd129[_0x872a('0x20')],_0x61c957=_0xb3f3d3[_0x872a('0x21')],_0x444f36=_0xb3f3d3[_0x872a('0x21')]+_0xb3f3d3[_0x872a('0x22')],_0x29f018;if(_0x444f36>=_0x28f44f){_0x444f36=_0x28f44f;_0x29f018=0xc8;}else{_0x29f018=0xce;}_0x18e5b7[_0x872a('0x1d')](_0x29f018);return _0x18e5b7[_0x872a('0x23')](_0x872a('0x24'),_0x61c957+'-'+_0x444f36+'/'+_0x28f44f)['json'](_0x5cd129);}return null;};}function patchUpdates(_0x25bf81){return function(_0x2ff51d){try{jsonpatch[_0x872a('0x25')](_0x2ff51d,_0x25bf81,!![]);}catch(_0x117363){return BPromise['reject'](_0x117363);}return _0x2ff51d[_0x872a('0x26')]();};}function saveUpdates(_0x1f4be5,_0x2c31b6){return function(_0x2a57e0){if(_0x2a57e0){return _0x2a57e0[_0x872a('0x27')](_0x1f4be5)[_0x872a('0x28')](function(_0x40cc2c){return _0x40cc2c;});}return null;};}function removeEntity(_0x51def5,_0x340075){return function(_0x1d9485){if(_0x1d9485){return _0x1d9485[_0x872a('0x29')]()[_0x872a('0x28')](function(){_0x51def5[_0x872a('0x1d')](0xcc)[_0x872a('0x1e')]();});}};}function handleEntityNotFound(_0x1596b7,_0x1c7419){return function(_0x3257a8){if(!_0x3257a8){_0x1596b7[_0x872a('0x1c')](0x194);}return _0x3257a8;};}function handleError(_0x45f6d8,_0x547771){_0x547771=_0x547771||0x1f4;return function(_0x1a2d50){logger[_0x872a('0x2a')](_0x1a2d50[_0x872a('0x2b')]);if(_0x1a2d50[_0x872a('0x2c')]){delete _0x1a2d50[_0x872a('0x2c')];}_0x45f6d8[_0x872a('0x1d')](_0x547771)[_0x872a('0x2d')](_0x1a2d50);};}exports[_0x872a('0x2e')]=function(_0x57eece,_0x27585f){var _0x3df339={},_0x5e0342={},_0x53dda9={'count':0x0,'rows':[]};var _0x28cd4f=_['map'](db[_0x872a('0x2f')][_0x872a('0x30')],function(_0x214f3d){return{'name':_0x214f3d['fieldName'],'type':_0x214f3d[_0x872a('0x31')]['key']};});_0x5e0342[_0x872a('0x32')]=_[_0x872a('0x33')](_0x28cd4f,_0x872a('0x2c'));_0x5e0342[_0x872a('0x34')]=_[_0x872a('0x35')](_0x57eece[_0x872a('0x34')]);_0x5e0342[_0x872a('0x36')]=_[_0x872a('0x37')](_0x5e0342[_0x872a('0x32')],_0x5e0342['query']);_0x3df339['attributes']=_[_0x872a('0x37')](_0x5e0342['model'],qs['fields'](_0x57eece[_0x872a('0x34')]['fields']));_0x3df339[_0x872a('0x38')]=_0x3df339['attributes'][_0x872a('0x39')]?_0x3df339[_0x872a('0x38')]:_0x5e0342[_0x872a('0x32')];if(!_0x57eece[_0x872a('0x34')][_0x872a('0x3a')](_0x872a('0x3b'))){_0x3df339[_0x872a('0x22')]=qs[_0x872a('0x22')](_0x57eece[_0x872a('0x34')]['limit']);_0x3df339[_0x872a('0x21')]=qs[_0x872a('0x21')](_0x57eece[_0x872a('0x34')][_0x872a('0x21')]);}_0x3df339[_0x872a('0x3c')]=qs['sort'](_0x57eece['query'][_0x872a('0x3d')]);_0x3df339['where']=qs[_0x872a('0x36')](_['pick'](_0x57eece[_0x872a('0x34')],_0x5e0342[_0x872a('0x36')]),_0x28cd4f);if(_0x57eece['query']['filter']){_0x3df339['where']=_['merge'](_0x3df339['where'],{'$or':_[_0x872a('0x33')](_0x28cd4f,function(_0x48e82a){if(_0x48e82a[_0x872a('0x31')]!==_0x872a('0x3e')){var _0x59a5a6={};_0x59a5a6[_0x48e82a[_0x872a('0x2c')]]={'$like':'%'+_0x57eece[_0x872a('0x34')][_0x872a('0x3f')]+'%'};return _0x59a5a6;}})});}_0x3df339=_['merge']({},_0x3df339,_0x57eece[_0x872a('0x40')]);var _0xd67280={'where':_0x3df339[_0x872a('0x41')]};return db[_0x872a('0x2f')][_0x872a('0x20')](_0xd67280)['then'](function(_0x40f235){_0x53dda9[_0x872a('0x20')]=_0x40f235;if(_0x57eece[_0x872a('0x34')][_0x872a('0x42')]){_0x3df339['include']=[{'all':!![]}];}return db[_0x872a('0x2f')]['findAll'](_0x3df339);})[_0x872a('0x28')](function(_0x567016){_0x53dda9[_0x872a('0x43')]=_0x567016;return _0x53dda9;})[_0x872a('0x28')](respondWithFilteredResult(_0x27585f,_0x3df339))[_0x872a('0x44')](handleError(_0x27585f,null));};exports[_0x872a('0x45')]=function(_0x5453c1,_0x4c540c){var _0x54f7c6={'raw':!![],'where':{'id':_0x5453c1[_0x872a('0x46')]['id']}},_0x1d2565={};_0x1d2565[_0x872a('0x32')]=_[_0x872a('0x35')](db['CloudProvider'][_0x872a('0x30')]);_0x1d2565[_0x872a('0x34')]=_[_0x872a('0x35')](_0x5453c1[_0x872a('0x34')]);_0x1d2565[_0x872a('0x36')]=_[_0x872a('0x37')](_0x1d2565['model'],_0x1d2565[_0x872a('0x34')]);_0x54f7c6[_0x872a('0x38')]=_[_0x872a('0x37')](_0x1d2565['model'],qs[_0x872a('0x47')](_0x5453c1[_0x872a('0x34')][_0x872a('0x47')]));_0x54f7c6[_0x872a('0x38')]=_0x54f7c6[_0x872a('0x38')][_0x872a('0x39')]?_0x54f7c6['attributes']:_0x1d2565[_0x872a('0x32')];if(_0x5453c1[_0x872a('0x34')][_0x872a('0x42')]){_0x54f7c6[_0x872a('0x48')]=[{'all':!![]}];}_0x54f7c6=_[_0x872a('0x49')]({},_0x54f7c6,_0x5453c1['options']);return db[_0x872a('0x2f')][_0x872a('0x4a')](_0x54f7c6)['then'](handleEntityNotFound(_0x4c540c,null))['then'](respondWithResult(_0x4c540c,null))[_0x872a('0x44')](handleError(_0x4c540c,null));};exports[_0x872a('0x4b')]=function(_0x266686,_0x2d0f2){return db['CloudProvider'][_0x872a('0x4b')](_0x266686[_0x872a('0x4c')],{})[_0x872a('0x28')](respondWithResult(_0x2d0f2,0xc9))[_0x872a('0x44')](handleError(_0x2d0f2,null));};exports[_0x872a('0x27')]=function(_0x29d09e,_0x2953c1){if(_0x29d09e['body']['id']){delete _0x29d09e[_0x872a('0x4c')]['id'];}return db[_0x872a('0x2f')][_0x872a('0x4a')]({'where':{'id':_0x29d09e['params']['id']}})[_0x872a('0x28')](handleEntityNotFound(_0x2953c1,null))[_0x872a('0x28')](saveUpdates(_0x29d09e['body'],null))[_0x872a('0x28')](respondWithResult(_0x2953c1,null))['catch'](handleError(_0x2953c1,null));};exports[_0x872a('0x29')]=function(_0x529e36,_0x39ea34){return db['CloudProvider'][_0x872a('0x4a')]({'where':{'id':_0x529e36[_0x872a('0x46')]['id']}})[_0x872a('0x28')](handleEntityNotFound(_0x39ea34,null))[_0x872a('0x28')](removeEntity(_0x39ea34,null))['catch'](handleError(_0x39ea34,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index f617753..2f971f5 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 _0x45ac=['cloud_providers','lodash','util','api','moment','bluebird','request-promise','rimraf','define','CloudProvider'];(function(_0x883fef,_0x3dbf96){var _0x7d9f20=function(_0xb98afe){while(--_0xb98afe){_0x883fef['push'](_0x883fef['shift']());}};_0x7d9f20(++_0x3dbf96);}(_0x45ac,0x10f));var _0xc45a=function(_0x5ca5bc,_0x5b8a9d){_0x5ca5bc=_0x5ca5bc-0x0;var _0x26ca86=_0x45ac[_0x5ca5bc];return _0x26ca86;};'use strict';var _=require(_0xc45a('0x0'));var util=require(_0xc45a('0x1'));var logger=require('../../config/logger')(_0xc45a('0x2'));var moment=require(_0xc45a('0x3'));var BPromise=require(_0xc45a('0x4'));var rp=require(_0xc45a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc45a('0x6'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x425863,_0x31f79f){return _0x425863[_0xc45a('0x7')](_0xc45a('0x8'),attributes,{'tableName':_0xc45a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c03=['path','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','util','../../config/logger','api','moment','bluebird'];(function(_0x5541f3,_0x266df7){var _0xe30f20=function(_0x5498af){while(--_0x5498af){_0x5541f3['push'](_0x5541f3['shift']());}};_0xe30f20(++_0x266df7);}(_0x1c03,0x7f));var _0x31c0=function(_0x254076,_0x5e7b8d){_0x254076=_0x254076-0x0;var _0x21a93e=_0x1c03[_0x254076];return _0x21a93e;};'use strict';var _=require('lodash');var util=require(_0x31c0('0x0'));var logger=require(_0x31c0('0x1'))(_0x31c0('0x2'));var moment=require(_0x31c0('0x3'));var BPromise=require(_0x31c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31c0('0x5'));var rimraf=require('rimraf');var config=require(_0x31c0('0x6'));var attributes=require(_0x31c0('0x7'));module['exports']=function(_0x22a6a6,_0x1b294c){return _0x22a6a6[_0x31c0('0x8')](_0x31c0('0x9'),attributes,{'tableName':_0x31c0('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 305410f..8231251 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 _0x3abc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash'];(function(_0x40b396,_0x18a6c6){var _0x1f3cfd=function(_0x454fa5){while(--_0x454fa5){_0x40b396['push'](_0x40b396['shift']());}};_0x1f3cfd(++_0x18a6c6);}(_0x3abc,0x18e));var _0xc3ab=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x3abc[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0xc3ab('0x0'));var util=require('util');var moment=require(_0xc3ab('0x1'));var BPromise=require(_0xc3ab('0x2'));var rs=require(_0xc3ab('0x3'));var fs=require('fs');var Redis=require(_0xc3ab('0x4'));var db=require(_0xc3ab('0x5'))['db'];var utils=require(_0xc3ab('0x6'));var logger=require(_0xc3ab('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc3ab('0x8'));var client=jayson[_0xc3ab('0x9')][_0xc3ab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fbefb,_0x15ed2e,_0x25f6e3){return new BPromise(function(_0x272c39,_0x23f27d){return client[_0xc3ab('0xb')](_0x3fbefb,_0x25f6e3)['then'](function(_0x3d0cdd){logger[_0xc3ab('0xc')](_0xc3ab('0xd'),_0x15ed2e,'request\x20sent');logger['debug'](_0xc3ab('0xe'),_0x15ed2e,'request\x20sent',JSON[_0xc3ab('0xf')](_0x3d0cdd));if(_0x3d0cdd[_0xc3ab('0x10')]){if(_0x3d0cdd[_0xc3ab('0x10')][_0xc3ab('0x11')]===0x1f4){logger['error'](_0xc3ab('0xd'),_0x15ed2e,_0x3d0cdd[_0xc3ab('0x10')]['message']);return _0x23f27d(_0x3d0cdd[_0xc3ab('0x10')][_0xc3ab('0x12')]);}logger[_0xc3ab('0x10')]('CloudProvider,\x20%s,\x20%s',_0x15ed2e,_0x3d0cdd[_0xc3ab('0x10')]['message']);return _0x272c39(_0x3d0cdd[_0xc3ab('0x10')][_0xc3ab('0x12')]);}else{logger[_0xc3ab('0xc')](_0xc3ab('0xd'),_0x15ed2e,_0xc3ab('0x13'));_0x272c39(_0x3d0cdd['result'][_0xc3ab('0x12')]);}})[_0xc3ab('0x14')](function(_0x3cc8ba){logger['error'](_0xc3ab('0xd'),_0x15ed2e,_0x3cc8ba);_0x23f27d(_0x3cc8ba);});});} \ No newline at end of file +var _0x0792=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','error','code','CloudProvider,\x20%s,\x20%s','message','catch'];(function(_0x5697d6,_0x43bbc6){var _0x6e6b3=function(_0x350baf){while(--_0x350baf){_0x5697d6['push'](_0x5697d6['shift']());}};_0x6e6b3(++_0x43bbc6);}(_0x0792,0x140));var _0x2079=function(_0xbeab9,_0x37ec4a){_0xbeab9=_0xbeab9-0x0;var _0x27650c=_0x0792[_0xbeab9];return _0x27650c;};'use strict';var _=require(_0x2079('0x0'));var util=require('util');var moment=require(_0x2079('0x1'));var BPromise=require(_0x2079('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2079('0x3'));var db=require(_0x2079('0x4'))['db'];var utils=require(_0x2079('0x5'));var logger=require(_0x2079('0x6'))(_0x2079('0x7'));var config=require(_0x2079('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2079('0x9')][_0x2079('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e871d,_0x54f145,_0x43139b){return new BPromise(function(_0x50d196,_0x3b4f5d){return client[_0x2079('0xb')](_0x3e871d,_0x43139b)[_0x2079('0xc')](function(_0x49066c){logger[_0x2079('0xd')]('CloudProvider,\x20%s,\x20%s',_0x54f145,_0x2079('0xe'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x54f145,_0x2079('0xe'),JSON['stringify'](_0x49066c));if(_0x49066c[_0x2079('0xf')]){if(_0x49066c[_0x2079('0xf')][_0x2079('0x10')]===0x1f4){logger[_0x2079('0xf')](_0x2079('0x11'),_0x54f145,_0x49066c[_0x2079('0xf')][_0x2079('0x12')]);return _0x3b4f5d(_0x49066c[_0x2079('0xf')][_0x2079('0x12')]);}logger[_0x2079('0xf')](_0x2079('0x11'),_0x54f145,_0x49066c[_0x2079('0xf')]['message']);return _0x50d196(_0x49066c[_0x2079('0xf')][_0x2079('0x12')]);}else{logger[_0x2079('0xd')](_0x2079('0x11'),_0x54f145,_0x2079('0xe'));_0x50d196(_0x49066c['result'][_0x2079('0x12')]);}})[_0x2079('0x13')](function(_0x5db8fb){logger[_0x2079('0xf')](_0x2079('0x11'),_0x54f145,_0x5db8fb);_0x3b4f5d(_0x5db8fb);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 7d3caa5..f790e4b 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 _0x4aa2=['index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x2653ac,_0x338212){var _0x14a4ba=function(_0xccd7ed){while(--_0xccd7ed){_0x2653ac['push'](_0x2653ac['shift']());}};_0x14a4ba(++_0x338212);}(_0x4aa2,0x14c));var _0x24aa=function(_0x1b1f48,_0x395016){_0x1b1f48=_0x1b1f48-0x0;var _0x4a9a12=_0x4aa2[_0x1b1f48];return _0x4a9a12;};'use strict';var multer=require(_0x24aa('0x0'));var util=require(_0x24aa('0x1'));var path=require(_0x24aa('0x2'));var timeout=require(_0x24aa('0x3'));var express=require(_0x24aa('0x4'));var router=express[_0x24aa('0x5')]();var auth=require(_0x24aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24aa('0x7'));var controller=require('./cloudProvider.controller');router[_0x24aa('0x8')]('/',auth[_0x24aa('0x9')](),controller[_0x24aa('0xa')]);router[_0x24aa('0x8')](_0x24aa('0xb'),auth['isAuthenticated'](),controller[_0x24aa('0xc')]);router[_0x24aa('0xd')]('/',auth[_0x24aa('0x9')](),controller[_0x24aa('0xe')]);router['put'](_0x24aa('0xb'),auth['isAuthenticated'](),controller[_0x24aa('0xf')]);router[_0x24aa('0x10')](_0x24aa('0xb'),auth[_0x24aa('0x9')](),controller[_0x24aa('0x11')]);module[_0x24aa('0x12')]=router; \ No newline at end of file +var _0x4f03=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','/:id','isAuthenticated','show','post','create','put','destroy'];(function(_0x202f15,_0x57be77){var _0x11f74=function(_0x25e59f){while(--_0x25e59f){_0x202f15['push'](_0x202f15['shift']());}};_0x11f74(++_0x57be77);}(_0x4f03,0xb0));var _0x34f0=function(_0x39914e,_0x1ec745){_0x39914e=_0x39914e-0x0;var _0x56350b=_0x4f03[_0x39914e];return _0x56350b;};'use strict';var multer=require(_0x34f0('0x0'));var util=require('util');var path=require(_0x34f0('0x1'));var timeout=require(_0x34f0('0x2'));var express=require(_0x34f0('0x3'));var router=express[_0x34f0('0x4')]();var auth=require(_0x34f0('0x5'));var interaction=require(_0x34f0('0x6'));var config=require('../../config/environment');var controller=require(_0x34f0('0x7'));router[_0x34f0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x34f0('0x8')](_0x34f0('0x9'),auth[_0x34f0('0xa')](),controller[_0x34f0('0xb')]);router[_0x34f0('0xc')]('/',auth[_0x34f0('0xa')](),controller[_0x34f0('0xd')]);router[_0x34f0('0xe')]('/:id',auth[_0x34f0('0xa')](),controller['update']);router['delete'](_0x34f0('0x9'),auth['isAuthenticated'](),controller[_0x34f0('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 28db97e..f61bbf4 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 _0x55b9=['exports','STRING','name','sequelize'];(function(_0x27dbe5,_0x2642d7){var _0x2e8b15=function(_0x2b9119){while(--_0x2b9119){_0x27dbe5['push'](_0x27dbe5['shift']());}};_0x2e8b15(++_0x2642d7);}(_0x55b9,0x1b3));var _0x955b=function(_0x24e3f5,_0x1ea2a6){_0x24e3f5=_0x24e3f5-0x0;var _0x1be336=_0x55b9[_0x24e3f5];return _0x1be336;};'use strict';var Sequelize=require(_0x955b('0x0'));module[_0x955b('0x1')]={'name':{'type':Sequelize[_0x955b('0x2')],'unique':_0x955b('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x955b('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x955b('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x955b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x955b('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x955b('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x955b('0x2')]},'sCity':{'type':Sequelize[_0x955b('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x955b('0x2')]}}; \ No newline at end of file +var _0xb3db=['name','STRING','sequelize','exports'];(function(_0x400d6,_0x2aa11f){var _0x2f9d71=function(_0x243fa2){while(--_0x243fa2){_0x400d6['push'](_0x400d6['shift']());}};_0x2f9d71(++_0x2aa11f);}(_0xb3db,0xd2));var _0xbb3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb3db[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xbb3d('0x0'));module[_0xbb3d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xbb3d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbb3d('0x3')]},'companyId':{'type':Sequelize[_0xbb3d('0x3')]},'website':{'type':Sequelize[_0xbb3d('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbb3d('0x3')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xbb3d('0x3')]},'postalCode':{'type':Sequelize[_0xbb3d('0x3')]},'city':{'type':Sequelize[_0xbb3d('0x3')]},'country':{'type':Sequelize[_0xbb3d('0x3')]},'email':{'type':Sequelize[_0xbb3d('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xbb3d('0x3')]},'sPostalCode':{'type':Sequelize[_0xbb3d('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xbb3d('0x3')]},'description':{'type':Sequelize[_0xbb3d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b978f98..2f0706d 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 _0xa9ef=['options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','omit','ids','getContacts','findOne','hasOwnProperty','html-pdf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','reject','update','then','destroy','get','Companies','UserProfileResource','error','stack','name','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','count','includeAll','include','rows','catch','show','params','rawAttributes'];(function(_0xbb2b8b,_0x325cbe){var _0x65d0d3=function(_0x4444d2){while(--_0x4444d2){_0xbb2b8b['push'](_0xbb2b8b['shift']());}};_0x65d0d3(++_0x325cbe);}(_0xa9ef,0x155));var _0xfa9e=function(_0x546d39,_0x436507){_0x546d39=_0x546d39-0x0;var _0x24b39c=_0xa9ef[_0x546d39];return _0x24b39c;};'use strict';var pdf=require(_0xfa9e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa9e('0x1'));var rp=require('request-promise');var moment=require(_0xfa9e('0x2'));var BPromise=require(_0xfa9e('0x3'));var Mustache=require(_0xfa9e('0x4'));var util=require('util');var path=require(_0xfa9e('0x5'));var sox=require(_0xfa9e('0x6'));var csv=require(_0xfa9e('0x7'));var ejs=require(_0xfa9e('0x8'));var fs=require('fs');var _=require(_0xfa9e('0x9'));var squel=require(_0xfa9e('0xa'));var crypto=require(_0xfa9e('0xb'));var jsforce=require(_0xfa9e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfa9e('0x7'));var querystring=require('querystring');var Papa=require(_0xfa9e('0xd'));var Redis=require('ioredis');var authService=require(_0xfa9e('0xe'));var qs=require(_0xfa9e('0xf'));var as=require(_0xfa9e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfa9e('0x11'))(_0xfa9e('0x12'));var utils=require(_0xfa9e('0x13'));var config=require(_0xfa9e('0x14'));var db=require(_0xfa9e('0x15'))['db'];function respondWithStatusCode(_0xcec2b4,_0x39be2a){_0x39be2a=_0x39be2a||0xcc;return function(_0x5662ad){if(_0x5662ad){return _0xcec2b4[_0xfa9e('0x16')](_0x39be2a);}return _0xcec2b4['status'](_0x39be2a)['end']();};}function respondWithResult(_0x48914e,_0x20e3a8){_0x20e3a8=_0x20e3a8||0xc8;return function(_0x1ad1dc){if(_0x1ad1dc){return _0x48914e['status'](_0x20e3a8)[_0xfa9e('0x17')](_0x1ad1dc);}};}function respondWithFilteredResult(_0x4e6a93,_0x2a899f){return function(_0x5ce9c5){if(_0x5ce9c5){var _0x5bb77a=_0x5ce9c5['count'],_0x4b52aa=_0x2a899f[_0xfa9e('0x18')],_0x40ca74=_0x2a899f[_0xfa9e('0x18')]+_0x2a899f[_0xfa9e('0x19')],_0x24a3b7;if(_0x40ca74>=_0x5bb77a){_0x40ca74=_0x5bb77a;_0x24a3b7=0xc8;}else{_0x24a3b7=0xce;}_0x4e6a93[_0xfa9e('0x1a')](_0x24a3b7);return _0x4e6a93[_0xfa9e('0x1b')](_0xfa9e('0x1c'),_0x4b52aa+'-'+_0x40ca74+'/'+_0x5bb77a)[_0xfa9e('0x17')](_0x5ce9c5);}return null;};}function patchUpdates(_0x4e2b){return function(_0x1c999a){try{jsonpatch['apply'](_0x1c999a,_0x4e2b,!![]);}catch(_0x31546a){return BPromise[_0xfa9e('0x1d')](_0x31546a);}return _0x1c999a['save']();};}function saveUpdates(_0x2f20c5,_0x34f93b){return function(_0x5ec544){if(_0x5ec544){return _0x5ec544[_0xfa9e('0x1e')](_0x2f20c5)[_0xfa9e('0x1f')](function(_0x4c0dfa){return _0x4c0dfa;});}return null;};}function removeEntity(_0x473f1a,_0x5add00){return function(_0x5c92dc){if(_0x5c92dc){return _0x5c92dc[_0xfa9e('0x20')]()[_0xfa9e('0x1f')](function(){var _0x1d0b00=_0x5c92dc[_0xfa9e('0x21')]({'plain':!![]});var _0x31b6b7=_0xfa9e('0x22');return db[_0xfa9e('0x23')][_0xfa9e('0x20')]({'where':{'type':_0x31b6b7,'resourceId':_0x1d0b00['id']}})[_0xfa9e('0x1f')](function(){return _0x5c92dc;});})['then'](function(){_0x473f1a[_0xfa9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x434860,_0x118c66){return function(_0x148b36){if(!_0x148b36){_0x434860[_0xfa9e('0x16')](0x194);}return _0x148b36;};}function handleError(_0x4004f2,_0x8f24e6){_0x8f24e6=_0x8f24e6||0x1f4;return function(_0x3a92b9){logger[_0xfa9e('0x24')](_0x3a92b9[_0xfa9e('0x25')]);if(_0x3a92b9['name']){delete _0x3a92b9[_0xfa9e('0x26')];}_0x4004f2['status'](_0x8f24e6)['send'](_0x3a92b9);};}exports['index']=function(_0x154cdc,_0x5bd9ed){var _0x210757={},_0x46c396={},_0x201953={'count':0x0,'rows':[]};return db[_0xfa9e('0x27')][_0xfa9e('0x28')]()[_0xfa9e('0x1f')](function(_0x1b22a6){_0x46c396[_0xfa9e('0x29')]=_[_0xfa9e('0x2a')](_0x1b22a6);_0x46c396[_0xfa9e('0x2b')]=_['keys'](_0x154cdc[_0xfa9e('0x2b')]);_0x46c396[_0xfa9e('0x2c')]=_[_0xfa9e('0x2d')](_0x46c396['model'],_0x46c396[_0xfa9e('0x2b')]);_0x210757[_0xfa9e('0x2e')]=_[_0xfa9e('0x2d')](_0x46c396[_0xfa9e('0x29')],qs['fields'](_0x154cdc[_0xfa9e('0x2b')][_0xfa9e('0x2f')]));_0x210757[_0xfa9e('0x2e')]=_0x210757[_0xfa9e('0x2e')][_0xfa9e('0x30')]?_0x210757['attributes']:_0x46c396[_0xfa9e('0x29')];if(!_0x154cdc['query']['hasOwnProperty'](_0xfa9e('0x31'))){_0x210757[_0xfa9e('0x19')]=qs[_0xfa9e('0x19')](_0x154cdc[_0xfa9e('0x2b')][_0xfa9e('0x19')]);_0x210757[_0xfa9e('0x18')]=qs['offset'](_0x154cdc[_0xfa9e('0x2b')][_0xfa9e('0x18')]);}_0x210757['order']=qs['sort'](_0x154cdc['query'][_0xfa9e('0x32')]);_0x210757[_0xfa9e('0x33')]=qs[_0xfa9e('0x2c')](_[_0xfa9e('0x34')](_0x154cdc[_0xfa9e('0x2b')],_0x46c396['filters']),_0x1b22a6);if(_0x154cdc[_0xfa9e('0x2b')][_0xfa9e('0x35')]){_0x210757['where']=_[_0xfa9e('0x36')](_0x210757[_0xfa9e('0x33')],{'$or':_[_0xfa9e('0x37')](_0x210757['attributes'],function(_0x5d20b6){var _0x54d9e9={};_0x54d9e9[_0x5d20b6]={'$like':'%'+_0x154cdc[_0xfa9e('0x2b')][_0xfa9e('0x35')]+'%'};return _0x54d9e9;})});}_0x210757=_[_0xfa9e('0x36')]({},_0x210757,_0x154cdc['options']);var _0x45659f={'where':_0x210757[_0xfa9e('0x33')]};return db['CmCompany'][_0xfa9e('0x38')](_0x45659f)[_0xfa9e('0x1f')](function(_0x7ecdd9){_0x201953[_0xfa9e('0x38')]=_0x7ecdd9;if(_0x154cdc[_0xfa9e('0x2b')][_0xfa9e('0x39')]){_0x210757[_0xfa9e('0x3a')]=[{'all':!![]}];}return db[_0xfa9e('0x27')]['findAll'](_0x210757);})['then'](function(_0x446f8c){_0x201953[_0xfa9e('0x3b')]=_0x446f8c;return _0x201953;})[_0xfa9e('0x1f')](respondWithFilteredResult(_0x5bd9ed,_0x210757))[_0xfa9e('0x3c')](handleError(_0x5bd9ed,null));})[_0xfa9e('0x3c')](handleError(_0x5bd9ed,null));};exports[_0xfa9e('0x3d')]=function(_0xed2611,_0x575fde){var _0x186cd8={'raw':![],'where':{'id':_0xed2611[_0xfa9e('0x3e')]['id']}},_0xf65e38={};_0xf65e38[_0xfa9e('0x29')]=_[_0xfa9e('0x2a')](db['CmCompany'][_0xfa9e('0x3f')]);_0xf65e38[_0xfa9e('0x2b')]=_['keys'](_0xed2611[_0xfa9e('0x2b')]);_0xf65e38['filters']=_[_0xfa9e('0x2d')](_0xf65e38[_0xfa9e('0x29')],_0xf65e38['query']);_0x186cd8[_0xfa9e('0x2e')]=_[_0xfa9e('0x2d')](_0xf65e38[_0xfa9e('0x29')],qs[_0xfa9e('0x2f')](_0xed2611[_0xfa9e('0x2b')][_0xfa9e('0x2f')]));_0x186cd8['attributes']=_0x186cd8[_0xfa9e('0x2e')][_0xfa9e('0x30')]?_0x186cd8[_0xfa9e('0x2e')]:_0xf65e38[_0xfa9e('0x29')];if(_0xed2611[_0xfa9e('0x2b')][_0xfa9e('0x39')]){_0x186cd8[_0xfa9e('0x3a')]=[{'all':!![]}];}_0x186cd8=_['merge']({},_0x186cd8,_0xed2611[_0xfa9e('0x40')]);return db['CmCompany'][_0xfa9e('0x41')](_0x186cd8)[_0xfa9e('0x1f')](handleEntityNotFound(_0x575fde,null))[_0xfa9e('0x1f')](respondWithResult(_0x575fde,null))[_0xfa9e('0x3c')](handleError(_0x575fde,null));};exports[_0xfa9e('0x42')]=function(_0x34237c,_0x130498){return db[_0xfa9e('0x27')][_0xfa9e('0x42')](_0x34237c[_0xfa9e('0x43')],{})[_0xfa9e('0x1f')](function(_0x40425){var _0x378682=_0x34237c[_0xfa9e('0x44')]['get']({'plain':!![]});if(!_0x378682)throw new Error(_0xfa9e('0x45'));if(_0x378682[_0xfa9e('0x46')]===_0xfa9e('0x44')){var _0x272318=_0x40425[_0xfa9e('0x21')]({'plain':!![]});var _0x5402a6=_0xfa9e('0x22');return db[_0xfa9e('0x47')][_0xfa9e('0x41')]({'where':{'name':_0x5402a6,'userProfileId':_0x378682[_0xfa9e('0x48')]},'raw':!![]})[_0xfa9e('0x1f')](function(_0x21d6f4){if(_0x21d6f4&&_0x21d6f4[_0xfa9e('0x49')]===0x0){return db[_0xfa9e('0x23')][_0xfa9e('0x42')]({'name':_0x272318[_0xfa9e('0x26')],'resourceId':_0x272318['id'],'type':_0x21d6f4[_0xfa9e('0x26')],'sectionId':_0x21d6f4['id']},{})[_0xfa9e('0x1f')](function(){return _0x40425;});}else{return _0x40425;}})[_0xfa9e('0x3c')](function(_0x4464d3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4464d3);throw _0x4464d3;});}return _0x40425;})[_0xfa9e('0x1f')](respondWithResult(_0x130498,0xc9))['catch'](handleError(_0x130498,null));};exports[_0xfa9e('0x1e')]=function(_0x332c54,_0x4e98ac){if(_0x332c54[_0xfa9e('0x43')]['id']){delete _0x332c54['body']['id'];}return db[_0xfa9e('0x27')][_0xfa9e('0x41')]({'where':{'id':_0x332c54[_0xfa9e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4e98ac,null))[_0xfa9e('0x1f')](saveUpdates(_0x332c54[_0xfa9e('0x43')],null))[_0xfa9e('0x1f')](respondWithResult(_0x4e98ac,null))[_0xfa9e('0x3c')](handleError(_0x4e98ac,null));};exports[_0xfa9e('0x20')]=function(_0x7b3e19,_0x591e3b){return db[_0xfa9e('0x27')][_0xfa9e('0x41')]({'where':{'id':_0x7b3e19[_0xfa9e('0x3e')]['id']}})[_0xfa9e('0x1f')](handleEntityNotFound(_0x591e3b,null))[_0xfa9e('0x1f')](removeEntity(_0x591e3b,null))[_0xfa9e('0x3c')](handleError(_0x591e3b,null));};exports['describe']=function(_0x3dca8d,_0x27c427){return db[_0xfa9e('0x27')][_0xfa9e('0x28')]()[_0xfa9e('0x1f')](respondWithResult(_0x27c427,null))[_0xfa9e('0x3c')](handleError(_0x27c427,null));};exports[_0xfa9e('0x4a')]=function(_0x22b214,_0x19dba6,_0x565e6f){return db[_0xfa9e('0x4b')][_0xfa9e('0x41')]({'where':{'id':_0x22b214[_0xfa9e('0x3e')]['id']}})['then'](handleEntityNotFound(_0x19dba6,null))[_0xfa9e('0x1f')](function(_0x378bf6){if(_0x378bf6){return _0x378bf6[_0xfa9e('0x4a')](_0x22b214[_0xfa9e('0x43')]['ids'],_[_0xfa9e('0x4c')](_0x22b214[_0xfa9e('0x43')],[_0xfa9e('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x19dba6,null))[_0xfa9e('0x3c')](handleError(_0x19dba6,null));};exports[_0xfa9e('0x4e')]=function(_0x24ef46,_0x9af5a,_0x2086d3){var _0x1cc39e={};var _0x4b3049={};var _0x56f1a5;var _0x1a7d75;return db[_0xfa9e('0x27')][_0xfa9e('0x4f')]({'where':{'id':_0x24ef46[_0xfa9e('0x3e')]['id']}})[_0xfa9e('0x1f')](handleEntityNotFound(_0x9af5a,null))[_0xfa9e('0x1f')](function(_0x114d54){if(_0x114d54){_0x56f1a5=_0x114d54;_0x4b3049[_0xfa9e('0x29')]=_[_0xfa9e('0x2a')](db[_0xfa9e('0x4b')][_0xfa9e('0x3f')]);_0x4b3049[_0xfa9e('0x2b')]=_['keys'](_0x24ef46[_0xfa9e('0x2b')]);_0x4b3049[_0xfa9e('0x2c')]=_['intersection'](_0x4b3049[_0xfa9e('0x29')],_0x4b3049[_0xfa9e('0x2b')]);_0x1cc39e['attributes']=_['intersection'](_0x4b3049['model'],qs[_0xfa9e('0x2f')](_0x24ef46[_0xfa9e('0x2b')][_0xfa9e('0x2f')]));_0x1cc39e[_0xfa9e('0x2e')]=_0x1cc39e[_0xfa9e('0x2e')][_0xfa9e('0x30')]?_0x1cc39e[_0xfa9e('0x2e')]:_0x4b3049[_0xfa9e('0x29')];_0x1cc39e['order']=qs[_0xfa9e('0x32')](_0x24ef46[_0xfa9e('0x2b')]['sort']);_0x1cc39e['where']=qs[_0xfa9e('0x2c')](_[_0xfa9e('0x34')](_0x24ef46['query'],_0x4b3049[_0xfa9e('0x2c')]));if(_0x24ef46[_0xfa9e('0x2b')]['filter']){_0x1cc39e[_0xfa9e('0x33')]=_['merge'](_0x1cc39e['where'],{'$or':_[_0xfa9e('0x37')](_0x1cc39e[_0xfa9e('0x2e')],function(_0x1c6919){var _0x47bb59={};_0x47bb59[_0x1c6919]={'$like':'%'+_0x24ef46[_0xfa9e('0x2b')]['filter']+'%'};return _0x47bb59;})});}_0x1cc39e=_[_0xfa9e('0x36')]({},_0x1cc39e,_0x24ef46[_0xfa9e('0x40')]);return _0x56f1a5['getContacts'](_0x1cc39e);}})[_0xfa9e('0x1f')](function(_0x5667f3){if(_0x5667f3){_0x1a7d75=_0x5667f3[_0xfa9e('0x30')];if(!_0x24ef46['query'][_0xfa9e('0x50')]('nolimit')){_0x1cc39e['limit']=qs[_0xfa9e('0x19')](_0x24ef46[_0xfa9e('0x2b')][_0xfa9e('0x19')]);_0x1cc39e[_0xfa9e('0x18')]=qs[_0xfa9e('0x18')](_0x24ef46[_0xfa9e('0x2b')][_0xfa9e('0x18')]);}return _0x56f1a5['getContacts'](_0x1cc39e);}})[_0xfa9e('0x1f')](function(_0x2bc6ce){if(_0x2bc6ce){return _0x2bc6ce?{'count':_0x1a7d75,'rows':_0x2bc6ce}:null;}})['then'](respondWithResult(_0x9af5a,null))[_0xfa9e('0x3c')](handleError(_0x9af5a,null));}; \ No newline at end of file +var _0xad9e=['intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','merge','map','filter','options','where','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','addContacts','ids','getContacts','pick','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','count','offset','status','set','json','reject','save','update','then','destroy','get','Companies','UserProfileResource','end','error','name','send','index','CmCompany','describe','model','query','filters'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0xad9e,0x76));var _0xead9=function(_0x4a187e,_0x4c4b8c){_0x4a187e=_0x4a187e-0x0;var _0xa2600=_0xad9e[_0x4a187e];return _0xa2600;};'use strict';var pdf=require(_0xead9('0x0'));var emlformat=require(_0xead9('0x1'));var rimraf=require(_0xead9('0x2'));var zipdir=require(_0xead9('0x3'));var jsonpatch=require(_0xead9('0x4'));var rp=require(_0xead9('0x5'));var moment=require('moment');var BPromise=require(_0xead9('0x6'));var Mustache=require(_0xead9('0x7'));var util=require(_0xead9('0x8'));var path=require(_0xead9('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xead9('0xa'));var squel=require(_0xead9('0xb'));var crypto=require(_0xead9('0xc'));var jsforce=require(_0xead9('0xd'));var deskjs=require(_0xead9('0xe'));var toCsv=require(_0xead9('0xf'));var querystring=require(_0xead9('0x10'));var Papa=require('papaparse');var Redis=require(_0xead9('0x11'));var authService=require(_0xead9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xead9('0x13'));var logger=require(_0xead9('0x14'))(_0xead9('0x15'));var utils=require('../../config/utils');var config=require(_0xead9('0x16'));var db=require(_0xead9('0x17'))['db'];function respondWithStatusCode(_0xcf116d,_0x48b23b){_0x48b23b=_0x48b23b||0xcc;return function(_0x6140d3){if(_0x6140d3){return _0xcf116d[_0xead9('0x18')](_0x48b23b);}return _0xcf116d['status'](_0x48b23b)['end']();};}function respondWithResult(_0x1c28d7,_0xfd1f8){_0xfd1f8=_0xfd1f8||0xc8;return function(_0x400e5d){if(_0x400e5d){return _0x1c28d7['status'](_0xfd1f8)['json'](_0x400e5d);}};}function respondWithFilteredResult(_0x5db0ae,_0x3bb850){return function(_0x1c756e){if(_0x1c756e){var _0x6ddc7a=_0x1c756e[_0xead9('0x19')],_0x3c2bdd=_0x3bb850['offset'],_0xca0895=_0x3bb850[_0xead9('0x1a')]+_0x3bb850['limit'],_0xfc44a6;if(_0xca0895>=_0x6ddc7a){_0xca0895=_0x6ddc7a;_0xfc44a6=0xc8;}else{_0xfc44a6=0xce;}_0x5db0ae[_0xead9('0x1b')](_0xfc44a6);return _0x5db0ae[_0xead9('0x1c')]('Content-Range',_0x3c2bdd+'-'+_0xca0895+'/'+_0x6ddc7a)[_0xead9('0x1d')](_0x1c756e);}return null;};}function patchUpdates(_0x18f964){return function(_0x1883c4){try{jsonpatch['apply'](_0x1883c4,_0x18f964,!![]);}catch(_0x5dee17){return BPromise[_0xead9('0x1e')](_0x5dee17);}return _0x1883c4[_0xead9('0x1f')]();};}function saveUpdates(_0x57a093,_0x56c398){return function(_0x4501f8){if(_0x4501f8){return _0x4501f8[_0xead9('0x20')](_0x57a093)[_0xead9('0x21')](function(_0xd5d559){return _0xd5d559;});}return null;};}function removeEntity(_0x381272,_0x335588){return function(_0x138448){if(_0x138448){return _0x138448[_0xead9('0x22')]()[_0xead9('0x21')](function(){var _0x4653e5=_0x138448[_0xead9('0x23')]({'plain':!![]});var _0x3d2efb=_0xead9('0x24');return db[_0xead9('0x25')][_0xead9('0x22')]({'where':{'type':_0x3d2efb,'resourceId':_0x4653e5['id']}})[_0xead9('0x21')](function(){return _0x138448;});})[_0xead9('0x21')](function(){_0x381272[_0xead9('0x1b')](0xcc)[_0xead9('0x26')]();});}};}function handleEntityNotFound(_0x513ff7,_0x484106){return function(_0x4d0fe4){if(!_0x4d0fe4){_0x513ff7[_0xead9('0x18')](0x194);}return _0x4d0fe4;};}function handleError(_0x47bfee,_0x1d115d){_0x1d115d=_0x1d115d||0x1f4;return function(_0x395186){logger[_0xead9('0x27')](_0x395186['stack']);if(_0x395186[_0xead9('0x28')]){delete _0x395186[_0xead9('0x28')];}_0x47bfee[_0xead9('0x1b')](_0x1d115d)[_0xead9('0x29')](_0x395186);};}exports[_0xead9('0x2a')]=function(_0x4a7958,_0x28705d){var _0x183d34={},_0x5b4647={},_0xdee249={'count':0x0,'rows':[]};return db[_0xead9('0x2b')][_0xead9('0x2c')]()[_0xead9('0x21')](function(_0x3b2b20){_0x5b4647[_0xead9('0x2d')]=_['keys'](_0x3b2b20);_0x5b4647[_0xead9('0x2e')]=_['keys'](_0x4a7958['query']);_0x5b4647[_0xead9('0x2f')]=_[_0xead9('0x30')](_0x5b4647[_0xead9('0x2d')],_0x5b4647[_0xead9('0x2e')]);_0x183d34[_0xead9('0x31')]=_[_0xead9('0x30')](_0x5b4647['model'],qs[_0xead9('0x32')](_0x4a7958[_0xead9('0x2e')][_0xead9('0x32')]));_0x183d34[_0xead9('0x31')]=_0x183d34[_0xead9('0x31')][_0xead9('0x33')]?_0x183d34[_0xead9('0x31')]:_0x5b4647[_0xead9('0x2d')];if(!_0x4a7958[_0xead9('0x2e')][_0xead9('0x34')]('nolimit')){_0x183d34[_0xead9('0x35')]=qs[_0xead9('0x35')](_0x4a7958[_0xead9('0x2e')][_0xead9('0x35')]);_0x183d34[_0xead9('0x1a')]=qs[_0xead9('0x1a')](_0x4a7958[_0xead9('0x2e')][_0xead9('0x1a')]);}_0x183d34[_0xead9('0x36')]=qs[_0xead9('0x37')](_0x4a7958[_0xead9('0x2e')][_0xead9('0x37')]);_0x183d34['where']=qs['filters'](_['pick'](_0x4a7958[_0xead9('0x2e')],_0x5b4647[_0xead9('0x2f')]),_0x3b2b20);if(_0x4a7958[_0xead9('0x2e')]['filter']){_0x183d34['where']=_[_0xead9('0x38')](_0x183d34['where'],{'$or':_[_0xead9('0x39')](_0x183d34[_0xead9('0x31')],function(_0x46646f){var _0x23d987={};_0x23d987[_0x46646f]={'$like':'%'+_0x4a7958['query'][_0xead9('0x3a')]+'%'};return _0x23d987;})});}_0x183d34=_['merge']({},_0x183d34,_0x4a7958[_0xead9('0x3b')]);var _0x1a7ead={'where':_0x183d34[_0xead9('0x3c')]};return db[_0xead9('0x2b')][_0xead9('0x19')](_0x1a7ead)[_0xead9('0x21')](function(_0xf7c6ec){_0xdee249[_0xead9('0x19')]=_0xf7c6ec;if(_0x4a7958[_0xead9('0x2e')][_0xead9('0x3d')]){_0x183d34[_0xead9('0x3e')]=[{'all':!![]}];}return db['CmCompany'][_0xead9('0x3f')](_0x183d34);})[_0xead9('0x21')](function(_0x4e7411){_0xdee249[_0xead9('0x40')]=_0x4e7411;return _0xdee249;})[_0xead9('0x21')](respondWithFilteredResult(_0x28705d,_0x183d34))[_0xead9('0x41')](handleError(_0x28705d,null));})['catch'](handleError(_0x28705d,null));};exports[_0xead9('0x42')]=function(_0x561f1b,_0x64af25){var _0x2ab9d9={'raw':![],'where':{'id':_0x561f1b[_0xead9('0x43')]['id']}},_0x48dba4={};_0x48dba4['model']=_['keys'](db['CmCompany'][_0xead9('0x44')]);_0x48dba4['query']=_[_0xead9('0x45')](_0x561f1b[_0xead9('0x2e')]);_0x48dba4[_0xead9('0x2f')]=_[_0xead9('0x30')](_0x48dba4[_0xead9('0x2d')],_0x48dba4[_0xead9('0x2e')]);_0x2ab9d9['attributes']=_[_0xead9('0x30')](_0x48dba4[_0xead9('0x2d')],qs[_0xead9('0x32')](_0x561f1b[_0xead9('0x2e')][_0xead9('0x32')]));_0x2ab9d9[_0xead9('0x31')]=_0x2ab9d9[_0xead9('0x31')][_0xead9('0x33')]?_0x2ab9d9[_0xead9('0x31')]:_0x48dba4[_0xead9('0x2d')];if(_0x561f1b['query'][_0xead9('0x3d')]){_0x2ab9d9[_0xead9('0x3e')]=[{'all':!![]}];}_0x2ab9d9=_[_0xead9('0x38')]({},_0x2ab9d9,_0x561f1b[_0xead9('0x3b')]);return db[_0xead9('0x2b')][_0xead9('0x46')](_0x2ab9d9)['then'](handleEntityNotFound(_0x64af25,null))['then'](respondWithResult(_0x64af25,null))['catch'](handleError(_0x64af25,null));};exports[_0xead9('0x47')]=function(_0x13ea5b,_0x565892){return db[_0xead9('0x2b')][_0xead9('0x47')](_0x13ea5b[_0xead9('0x48')],{})[_0xead9('0x21')](function(_0x51525c){var _0x975e2=_0x13ea5b[_0xead9('0x49')][_0xead9('0x23')]({'plain':!![]});if(!_0x975e2)throw new Error(_0xead9('0x4a'));if(_0x975e2[_0xead9('0x4b')]==='user'){var _0x35491e=_0x51525c['get']({'plain':!![]});var _0x4fe95a=_0xead9('0x24');return db['UserProfileSection'][_0xead9('0x46')]({'where':{'name':_0x4fe95a,'userProfileId':_0x975e2[_0xead9('0x4c')]},'raw':!![]})['then'](function(_0x33ea57){if(_0x33ea57&&_0x33ea57[_0xead9('0x4d')]===0x0){return db[_0xead9('0x25')][_0xead9('0x47')]({'name':_0x35491e[_0xead9('0x28')],'resourceId':_0x35491e['id'],'type':_0x33ea57[_0xead9('0x28')],'sectionId':_0x33ea57['id']},{})[_0xead9('0x21')](function(){return _0x51525c;});}else{return _0x51525c;}})['catch'](function(_0x48e57c){logger[_0xead9('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x48e57c);throw _0x48e57c;});}return _0x51525c;})[_0xead9('0x21')](respondWithResult(_0x565892,0xc9))[_0xead9('0x41')](handleError(_0x565892,null));};exports['update']=function(_0x5beb89,_0x3cc7a5){if(_0x5beb89[_0xead9('0x48')]['id']){delete _0x5beb89['body']['id'];}return db[_0xead9('0x2b')]['find']({'where':{'id':_0x5beb89['params']['id']}})['then'](handleEntityNotFound(_0x3cc7a5,null))[_0xead9('0x21')](saveUpdates(_0x5beb89[_0xead9('0x48')],null))[_0xead9('0x21')](respondWithResult(_0x3cc7a5,null))[_0xead9('0x41')](handleError(_0x3cc7a5,null));};exports[_0xead9('0x22')]=function(_0x366578,_0x1aa2ab){return db['CmCompany']['find']({'where':{'id':_0x366578[_0xead9('0x43')]['id']}})[_0xead9('0x21')](handleEntityNotFound(_0x1aa2ab,null))['then'](removeEntity(_0x1aa2ab,null))[_0xead9('0x41')](handleError(_0x1aa2ab,null));};exports[_0xead9('0x2c')]=function(_0x2a43f7,_0x1b01ab){return db[_0xead9('0x2b')]['describe']()['then'](respondWithResult(_0x1b01ab,null))['catch'](handleError(_0x1b01ab,null));};exports[_0xead9('0x4e')]=function(_0x3ae7d,_0x423bd2,_0x5eb7f1){return db['CmContact'][_0xead9('0x46')]({'where':{'id':_0x3ae7d[_0xead9('0x43')]['id']}})[_0xead9('0x21')](handleEntityNotFound(_0x423bd2,null))[_0xead9('0x21')](function(_0x4bdd5d){if(_0x4bdd5d){return _0x4bdd5d[_0xead9('0x4e')](_0x3ae7d['body'][_0xead9('0x4f')],_['omit'](_0x3ae7d[_0xead9('0x48')],['ids','id'])||{});}})[_0xead9('0x21')](respondWithResult(_0x423bd2,null))[_0xead9('0x41')](handleError(_0x423bd2,null));};exports[_0xead9('0x50')]=function(_0x1ab2eb,_0x3b3b1f,_0x263f45){var _0x4413ea={};var _0x4f64bf={};var _0x10ffd8;var _0x2dcefa;return db[_0xead9('0x2b')]['findOne']({'where':{'id':_0x1ab2eb[_0xead9('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b3b1f,null))[_0xead9('0x21')](function(_0x4a3ca6){if(_0x4a3ca6){_0x10ffd8=_0x4a3ca6;_0x4f64bf['model']=_[_0xead9('0x45')](db['CmContact'][_0xead9('0x44')]);_0x4f64bf['query']=_[_0xead9('0x45')](_0x1ab2eb[_0xead9('0x2e')]);_0x4f64bf[_0xead9('0x2f')]=_[_0xead9('0x30')](_0x4f64bf['model'],_0x4f64bf[_0xead9('0x2e')]);_0x4413ea['attributes']=_[_0xead9('0x30')](_0x4f64bf[_0xead9('0x2d')],qs['fields'](_0x1ab2eb[_0xead9('0x2e')][_0xead9('0x32')]));_0x4413ea[_0xead9('0x31')]=_0x4413ea['attributes'][_0xead9('0x33')]?_0x4413ea[_0xead9('0x31')]:_0x4f64bf[_0xead9('0x2d')];_0x4413ea[_0xead9('0x36')]=qs[_0xead9('0x37')](_0x1ab2eb[_0xead9('0x2e')][_0xead9('0x37')]);_0x4413ea[_0xead9('0x3c')]=qs[_0xead9('0x2f')](_[_0xead9('0x51')](_0x1ab2eb[_0xead9('0x2e')],_0x4f64bf[_0xead9('0x2f')]));if(_0x1ab2eb['query'][_0xead9('0x3a')]){_0x4413ea[_0xead9('0x3c')]=_[_0xead9('0x38')](_0x4413ea[_0xead9('0x3c')],{'$or':_['map'](_0x4413ea[_0xead9('0x31')],function(_0x219203){var _0x353c34={};_0x353c34[_0x219203]={'$like':'%'+_0x1ab2eb[_0xead9('0x2e')]['filter']+'%'};return _0x353c34;})});}_0x4413ea=_['merge']({},_0x4413ea,_0x1ab2eb[_0xead9('0x3b')]);return _0x10ffd8[_0xead9('0x50')](_0x4413ea);}})[_0xead9('0x21')](function(_0x2d2ca8){if(_0x2d2ca8){_0x2dcefa=_0x2d2ca8[_0xead9('0x33')];if(!_0x1ab2eb['query'][_0xead9('0x34')](_0xead9('0x52'))){_0x4413ea[_0xead9('0x35')]=qs['limit'](_0x1ab2eb[_0xead9('0x2e')][_0xead9('0x35')]);_0x4413ea['offset']=qs['offset'](_0x1ab2eb[_0xead9('0x2e')][_0xead9('0x1a')]);}return _0x10ffd8[_0xead9('0x50')](_0x4413ea);}})[_0xead9('0x21')](function(_0x5274ca){if(_0x5274ca){return _0x5274ca?{'count':_0x2dcefa,'rows':_0x5274ca}:null;}})[_0xead9('0x21')](respondWithResult(_0x3b3b1f,null))[_0xead9('0x41')](handleError(_0x3b3b1f,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 3f2fdcb..6d45829 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 _0xb63b=['CmCompany','cm_companies','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xb63b,0x70));var _0xbb63=function(_0xd78108,_0x4702fd){_0xd78108=_0xd78108-0x0;var _0x3ebb14=_0xb63b[_0xd78108];return _0x3ebb14;};'use strict';var _=require('lodash');var util=require(_0xbb63('0x0'));var logger=require(_0xbb63('0x1'))(_0xbb63('0x2'));var moment=require('moment');var BPromise=require(_0xbb63('0x3'));var rp=require(_0xbb63('0x4'));var fs=require('fs');var path=require(_0xbb63('0x5'));var rimraf=require(_0xbb63('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb63('0x7'));module[_0xbb63('0x8')]=function(_0x3a12e6,_0x1fb713){return _0x3a12e6['define'](_0xbb63('0x9'),attributes,{'tableName':_0xbb63('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf081=['lodash','../../config/logger','api','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xf081,0xc8));var _0x1f08=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xf081[_0x29d915];return _0x160f86;};'use strict';var _=require(_0x1f08('0x0'));var util=require('util');var logger=require(_0x1f08('0x1'))(_0x1f08('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1f08('0x3'));var config=require(_0x1f08('0x4'));var attributes=require(_0x1f08('0x5'));module[_0x1f08('0x6')]=function(_0x870b79,_0xb9125c){return _0x870b79[_0x1f08('0x7')](_0x1f08('0x8'),attributes,{'tableName':_0x1f08('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 934485f..5673ed7 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 _0x6f20=['message','result','catch','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x6f20,0x87));var _0x06f2=function(_0x16a637,_0x5eb627){_0x16a637=_0x16a637-0x0;var _0x25126d=_0x6f20[_0x16a637];return _0x25126d;};'use strict';var _=require('lodash');var util=require(_0x06f2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x06f2('0x1'));var fs=require('fs');var Redis=require(_0x06f2('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x06f2('0x3'));var logger=require(_0x06f2('0x4'))('rpc');var config=require(_0x06f2('0x5'));var jayson=require(_0x06f2('0x6'));var client=jayson[_0x06f2('0x7')][_0x06f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f38d0,_0x5b6339,_0x4bd023){return new BPromise(function(_0x34b0ae,_0x47549a){return client[_0x06f2('0x9')](_0x3f38d0,_0x4bd023)[_0x06f2('0xa')](function(_0x5c09e7){logger[_0x06f2('0xb')](_0x06f2('0xc'),_0x5b6339,_0x06f2('0xd'));logger[_0x06f2('0xe')](_0x06f2('0xf'),_0x5b6339,_0x06f2('0xd'),JSON[_0x06f2('0x10')](_0x5c09e7));if(_0x5c09e7[_0x06f2('0x11')]){if(_0x5c09e7[_0x06f2('0x11')][_0x06f2('0x12')]===0x1f4){logger['error'](_0x06f2('0xc'),_0x5b6339,_0x5c09e7[_0x06f2('0x11')][_0x06f2('0x13')]);return _0x47549a(_0x5c09e7[_0x06f2('0x11')]['message']);}logger[_0x06f2('0x11')](_0x06f2('0xc'),_0x5b6339,_0x5c09e7['error'][_0x06f2('0x13')]);return _0x34b0ae(_0x5c09e7['error'][_0x06f2('0x13')]);}else{logger[_0x06f2('0xb')](_0x06f2('0xc'),_0x5b6339,_0x06f2('0xd'));_0x34b0ae(_0x5c09e7[_0x06f2('0x14')][_0x06f2('0x13')]);}})[_0x06f2('0x15')](function(_0x58e4e4){logger[_0x06f2('0x11')](_0x06f2('0xc'),_0x5b6339,_0x58e4e4);_0x47549a(_0x58e4e4);});});} \ No newline at end of file +var _0x02d2=['moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x4e95fb,_0x50c9b2){var _0x167bc7=function(_0x56c97d){while(--_0x56c97d){_0x4e95fb['push'](_0x4e95fb['shift']());}};_0x167bc7(++_0x50c9b2);}(_0x02d2,0x18a));var _0x202d=function(_0x3216d1,_0x247e46){_0x3216d1=_0x3216d1-0x0;var _0x4a231c=_0x02d2[_0x3216d1];return _0x4a231c;};'use strict';var _=require(_0x202d('0x0'));var util=require(_0x202d('0x1'));var moment=require(_0x202d('0x2'));var BPromise=require('bluebird');var rs=require(_0x202d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x202d('0x4'))['db'];var utils=require(_0x202d('0x5'));var logger=require('../../config/logger')(_0x202d('0x6'));var config=require(_0x202d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x202d('0x8')][_0x202d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c2e11,_0x22cee9,_0x497ead){return new BPromise(function(_0x184007,_0x288e43){return client[_0x202d('0xa')](_0x4c2e11,_0x497ead)[_0x202d('0xb')](function(_0x46918c){logger['info'](_0x202d('0xc'),_0x22cee9,_0x202d('0xd'));logger[_0x202d('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x22cee9,_0x202d('0xd'),JSON[_0x202d('0xf')](_0x46918c));if(_0x46918c[_0x202d('0x10')]){if(_0x46918c['error'][_0x202d('0x11')]===0x1f4){logger[_0x202d('0x10')]('CmCompany,\x20%s,\x20%s',_0x22cee9,_0x46918c[_0x202d('0x10')][_0x202d('0x12')]);return _0x288e43(_0x46918c['error']['message']);}logger[_0x202d('0x10')]('CmCompany,\x20%s,\x20%s',_0x22cee9,_0x46918c[_0x202d('0x10')][_0x202d('0x12')]);return _0x184007(_0x46918c[_0x202d('0x10')][_0x202d('0x12')]);}else{logger[_0x202d('0x13')](_0x202d('0xc'),_0x22cee9,_0x202d('0xd'));_0x184007(_0x46918c[_0x202d('0x14')][_0x202d('0x12')]);}})[_0x202d('0x15')](function(_0x260766){logger['error'](_0x202d('0xc'),_0x22cee9,_0x260766);_0x288e43(_0x260766);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 1f6aca2..8a1b6b7 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 _0x55ca=['multer','util','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','getContacts','post','create','/:id/contacts','addContacts','put','update','destroy','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x55ca,0x126));var _0xa55c=function(_0x4aa838,_0x4aa14f){_0x4aa838=_0x4aa838-0x0;var _0x3abff0=_0x55ca[_0x4aa838];return _0x3abff0;};'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',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['get']('/:id/contacts',auth[_0xa55c('0x7')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0xe')]);router[_0xa55c('0xd')](_0xa55c('0xf'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x10')]);router[_0xa55c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);module[_0xa55c('0x14')]=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(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./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 29a92cc..82cfcec 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 _0xa0d1=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x13137e,_0x29c0f3){var _0x346261=function(_0x8c7d4f){while(--_0x8c7d4f){_0x13137e['push'](_0x13137e['shift']());}};_0x346261(++_0x29c0f3);}(_0xa0d1,0x144));var _0x1a0d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa0d1[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x1a0d('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x1a0d('0x1')]},'street':{'type':Sequelize[_0x1a0d('0x1')]},'postalCode':{'type':Sequelize[_0x1a0d('0x1')]},'city':{'type':Sequelize[_0x1a0d('0x1')]},'country':{'type':Sequelize[_0x1a0d('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1a0d('0x2')]},'phone':{'type':Sequelize[_0x1a0d('0x1')]},'mobile':{'type':Sequelize[_0x1a0d('0x1')]},'fax':{'type':Sequelize[_0x1a0d('0x1')]},'email':{'type':Sequelize[_0x1a0d('0x1')]},'url':{'type':Sequelize[_0x1a0d('0x1')]},'facebook':{'type':Sequelize[_0x1a0d('0x1')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x1a0d('0x1')]},'teams':{'type':Sequelize[_0x1a0d('0x1')]},'viber':{'type':Sequelize[_0x1a0d('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x1a0d('0x1')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x1a0d('0x3')]},'priority':{'type':Sequelize[_0x1a0d('0x3')](0x2)[_0x1a0d('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1a0d('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x1a0d('0x1')]},'utcOffset':{'type':Sequelize[_0x1a0d('0x3')]}}; \ No newline at end of file +var _0xcaf0=['INTEGER','DATE','NOW','lodash','STRING','TEXT'];(function(_0xcf1ad7,_0x329d48){var _0x20d6e4=function(_0x3ad117){while(--_0x3ad117){_0xcf1ad7['push'](_0xcf1ad7['shift']());}};_0x20d6e4(++_0x329d48);}(_0xcaf0,0xf9));var _0x0caf=function(_0x2adad8,_0x2215b3){_0x2adad8=_0x2adad8-0x0;var _0x25cc90=_0xcaf0[_0x2adad8];return _0x25cc90;};'use strict';var _=require(_0x0caf('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x0caf('0x1')]},'postalCode':{'type':Sequelize[_0x0caf('0x1')]},'city':{'type':Sequelize[_0x0caf('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x0caf('0x1')]},'description':{'type':Sequelize[_0x0caf('0x2')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0caf('0x1')]},'email':{'type':Sequelize[_0x0caf('0x1')]},'url':{'type':Sequelize[_0x0caf('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x0caf('0x1')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x0caf('0x1')]},'teams':{'type':Sequelize[_0x0caf('0x1')]},'viber':{'type':Sequelize[_0x0caf('0x1')]},'line':{'type':Sequelize[_0x0caf('0x1')]},'wechat':{'type':Sequelize[_0x0caf('0x1')]},'telegram':{'type':Sequelize[_0x0caf('0x1')]},'UserId':{'type':Sequelize[_0x0caf('0x3')]},'priority':{'type':Sequelize[_0x0caf('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x0caf('0x4')],'defaultValue':Sequelize[_0x0caf('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x0caf('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 491fc17..00a5eff 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 _0x7bc8=['root','file','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','send','upload','createReadStream','parse','meta','User','binding','stringify','message','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','sendStatus','status','json','count','offset','set','Content-Range','reject','then','destroy','end','stack','name','index','CmContact','describe','keys','startsWith','push','CmCustomField','findOne','trimStart','cf_','fieldType','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','field','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','uc.UserId\x20=\x20?','castTo','DATE','type','text','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','\x27\x27\x27\x27','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','some','user','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','c.firstName','c.lastName','c.phone','c.fax','c.ListId','TagIds','Tags','catch','params','columnName','findAll','displayName','alias','values','body','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','bulkCreate','duplicates','$or','findOrCreate','spread','error','color','omit','format','cf_%d','$and','pickBy','table','setFields','toParam','phone','getTags','rawAttributes','merge','options','setTags','pick','ContactId','include','rows','getHopperHistories','includeAll','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified'];(function(_0x354818,_0x42055a){var _0xc1bdab=function(_0x54bbf5){while(--_0x54bbf5){_0x354818['push'](_0x354818['shift']());}};_0xc1bdab(++_0x42055a);}(_0x7bc8,0xf9));var _0x87bc=function(_0x2bed84,_0x2e3883){_0x2bed84=_0x2bed84-0x0;var _0x3e2401=_0x7bc8[_0x2bed84];return _0x3e2401;};'use strict';var pdf=require(_0x87bc('0x0'));var emlformat=require(_0x87bc('0x1'));var rimraf=require(_0x87bc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x87bc('0x3'));var util=require(_0x87bc('0x4'));var path=require(_0x87bc('0x5'));var sox=require('sox');var csv=require(_0x87bc('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x87bc('0x7'));var jsforce=require(_0x87bc('0x8'));var deskjs=require(_0x87bc('0x9'));var toCsv=require(_0x87bc('0x6'));var querystring=require(_0x87bc('0xa'));var Papa=require(_0x87bc('0xb'));var Redis=require('ioredis');var authService=require(_0x87bc('0xc'));var qs=require(_0x87bc('0xd'));var as=require(_0x87bc('0xe'));var hardwareService=require(_0x87bc('0xf'));var logger=require(_0x87bc('0x10'))(_0x87bc('0x11'));var utils=require(_0x87bc('0x12'));var config=require(_0x87bc('0x13'));var db=require(_0x87bc('0x14'))['db'];config[_0x87bc('0x15')]=_[_0x87bc('0x16')](config[_0x87bc('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x87bc('0x17'))(new Redis(config[_0x87bc('0x15')]));require(_0x87bc('0x18'))[_0x87bc('0x19')](socket);function respondWithStatusCode(_0x261d7f,_0xda8983){_0xda8983=_0xda8983||0xcc;return function(_0x2677d9){if(_0x2677d9){return _0x261d7f[_0x87bc('0x1a')](_0xda8983);}return _0x261d7f[_0x87bc('0x1b')](_0xda8983)['end']();};}function respondWithResult(_0x27fcad,_0x20138d){_0x20138d=_0x20138d||0xc8;return function(_0x2d7da8){if(_0x2d7da8){return _0x27fcad[_0x87bc('0x1b')](_0x20138d)[_0x87bc('0x1c')](_0x2d7da8);}};}function respondWithFilteredResult(_0x4387b0,_0x273259){return function(_0x42faf5){if(_0x42faf5){var _0x12ce06=_0x42faf5[_0x87bc('0x1d')],_0x32d198=_0x273259[_0x87bc('0x1e')],_0x3873b1=_0x273259['offset']+_0x273259['limit'],_0x20155a;if(_0x3873b1>=_0x12ce06){_0x3873b1=_0x12ce06;_0x20155a=0xc8;}else{_0x20155a=0xce;}_0x4387b0['status'](_0x20155a);return _0x4387b0[_0x87bc('0x1f')](_0x87bc('0x20'),_0x32d198+'-'+_0x3873b1+'/'+_0x12ce06)['json'](_0x42faf5);}return null;};}function patchUpdates(_0x16f8ef){return function(_0x19b4e1){try{jsonpatch['apply'](_0x19b4e1,_0x16f8ef,!![]);}catch(_0x3c2b19){return BPromise[_0x87bc('0x21')](_0x3c2b19);}return _0x19b4e1['save']();};}function saveUpdates(_0x5cdfcc,_0x38c9c9){return function(_0x475285){if(_0x475285){return _0x475285['update'](_0x5cdfcc)[_0x87bc('0x22')](function(_0x99f7e){return _0x99f7e;});}return null;};}function removeEntity(_0x161610,_0x12bdc6){return function(_0x113506){if(_0x113506){return _0x113506[_0x87bc('0x23')]()[_0x87bc('0x22')](function(){_0x161610[_0x87bc('0x1b')](0xcc)[_0x87bc('0x24')]();});}};}function handleEntityNotFound(_0x22ba3a,_0x13e6b4){return function(_0x138d1f){if(!_0x138d1f){_0x22ba3a[_0x87bc('0x1a')](0x194);}return _0x138d1f;};}function handleError(_0x136e1c,_0x1022d6){_0x1022d6=_0x1022d6||0x1f4;return function(_0x173fb9){logger['error'](_0x173fb9[_0x87bc('0x25')]);if(_0x173fb9[_0x87bc('0x26')]){delete _0x173fb9[_0x87bc('0x26')];}_0x136e1c['status'](_0x1022d6)['send'](_0x173fb9);};}exports[_0x87bc('0x27')]=function(_0x1640df,_0x542215){var _0xf0e9b4={},_0x274b7b={},_0x40a7fb={'count':0x0,'rows':[]};return db[_0x87bc('0x28')][_0x87bc('0x29')]()['then'](function(_0x3dd303){var _0x31eb99=[];for(var _0x9a04fe=0x0;_0x9a04fe0x1){_0x2e30dc['or'](_0x87bc('0x65'),qs['getFullTextValue'](_0x3e6971),null);}else{if(qs[_0x87bc('0x66')](_0x3e6971)){_0x2e30dc['or'](_0x87bc('0x67'),_0x3e6971+'%');_0x2e30dc['or']('c.phone\x20LIKE\x20?',_0x3e6971+'%');_0x2e30dc['or'](_0x87bc('0x68'),_0x3e6971+'%');_0x2e30dc['or']('c.fax\x20LIKE\x20?',_0x3e6971+'%');}else if(qs[_0x87bc('0x69')](_0x3e6971)){_0x2e30dc['or'](_0x87bc('0x6a'),_0x3e6971+'%');}else{_0x2e30dc['or'](_0x87bc('0x6b'),'%'+_0x3e6971+'%');_0x2e30dc['or'](_0x87bc('0x6c'),'%'+_0x3e6971+'%');_0x2e30dc['or']('c.email\x20LIKE\x20?','%'+_0x3e6971+'%');}}}}_0x5c387a[_0x87bc('0x3d')](_0x2e30dc);_0x5c387a['group'](_0x87bc('0x6d'));var _0x3e4744={'type':db[_0x87bc('0x6e')]['QueryTypes'][_0x87bc('0x6f')],'raw':!![]};var _0x5cf3a3=_0x5c387a[_0x87bc('0x70')]()[_0x87bc('0x3e')](_0x87bc('0x6d'));if(_0xf0e9b4[_0x87bc('0x71')]){_0xf0e9b4[_0x87bc('0x71')][_0x87bc('0x50')](function(_0x5bf9b5){_0x5c387a[_0x87bc('0x71')]('c.'+_0x5bf9b5[0x0],_0x5bf9b5[0x1]===_0x87bc('0x72')?![]:!![]);});}if(!_[_0x87bc('0x5b')](_0x27358f)){_0x5c387a['having'](_0x56c8fb);_0x5cf3a3[_0x87bc('0x3d')](_0x87bc('0x73'),_0x27358f);}BPromise[_0x87bc('0x74')]()['then'](function(){if(_0x3862d5&&!_[_0x87bc('0x75')](_0x3862d5['conditions'],[_0x87bc('0x3e'),'User'])){return _0x1640df[_0x87bc('0x76')][_0x87bc('0x77')]({'attributes':['id'],'raw':!![]})['then'](function(_0xa574f2){if(_[_0x87bc('0x5b')](_0xa574f2)){_0x5cf3a3[_0x87bc('0x3d')](_0x87bc('0x78'));_0x5c387a[_0x87bc('0x3d')](_0x87bc('0x78'));}else{_0x5cf3a3[_0x87bc('0x3d')](_0x87bc('0x5d'),_[_0x87bc('0x4f')](_0xa574f2,'id'));_0x5c387a[_0x87bc('0x3d')](_0x87bc('0x5d'),_[_0x87bc('0x4f')](_0xa574f2,'id'));}});}else{return;}})[_0x87bc('0x22')](function(){db['sequelize']['query'](_0x5cf3a3[_0x87bc('0x79')](),_0x3e4744)[_0x87bc('0x22')](function(_0x10a627){_0x40a7fb[_0x87bc('0x1d')]=_0x10a627[_0x87bc('0x38')];if(_0x40a7fb[_0x87bc('0x1d')]===0x0)return[];return db[_0x87bc('0x7a')]['query'](_0x374a56[_0x87bc('0x79')](),_0x3e4744);})[_0x87bc('0x22')](function(_0x45e83c){_0x3b9308=_['keyBy'](_0x45e83c,'id');_0x3e4744=_['merge'](_0x3e4744,{'model':db[_0x87bc('0x28')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1640df[_0x87bc('0x33')][_0x87bc('0x37')]){_0xf0e9b4[_0x87bc('0x36')][_0x87bc('0x50')](function(_0xa9a8aa){_0x5c387a[_0x87bc('0x3e')]('c.'+_0xa9a8aa);});}else{_0x5c387a[_0x87bc('0x3e')](_0x87bc('0x6d'));_0x5c387a['field'](_0x87bc('0x7b'));_0x5c387a[_0x87bc('0x3e')](_0x87bc('0x7c'));_0x5c387a['field'](_0x87bc('0x7d'));_0x5c387a['field']('c.mobile');_0x5c387a[_0x87bc('0x3e')](_0x87bc('0x7e'));_0x5c387a[_0x87bc('0x3e')]('c.email');_0x5c387a[_0x87bc('0x3e')](_0x87bc('0x7f'));_0x5c387a[_0x87bc('0x3e')]('c.deletedAt');_0x5c387a[_0x87bc('0x3e')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xf0e9b4[_0x87bc('0x3b')])_0x5c387a[_0x87bc('0x3b')](_0xf0e9b4[_0x87bc('0x3b')]);if(_0xf0e9b4[_0x87bc('0x1e')])_0x5c387a[_0x87bc('0x1e')](_0xf0e9b4[_0x87bc('0x1e')]);return db['sequelize'][_0x87bc('0x33')](_0x5c387a['toString'](),_0x3e4744);})[_0x87bc('0x22')](function(_0x53fa70){_0x53fa70[_0x87bc('0x50')](function(_0x28ee77){if(_0x28ee77[_0x87bc('0x80')]){_0x28ee77['Tags']=[];_0x28ee77[_0x87bc('0x80')][_0x87bc('0x4e')](',')[_0x87bc('0x50')](function(_0x2cf774){_0x28ee77[_0x87bc('0x81')][_0x87bc('0x2c')](_0x3b9308[_0x2cf774]);});}delete _0x28ee77[_0x87bc('0x80')];});_0x40a7fb['rows']=_0x53fa70;return _0x40a7fb;})[_0x87bc('0x22')](respondWithFilteredResult(_0x542215,_0xf0e9b4));});})[_0x87bc('0x82')](handleError(_0x542215,null));};exports[_0x87bc('0x23')]=function(_0x621466,_0x46abc4){return db[_0x87bc('0x28')][_0x87bc('0x4b')]({'where':{'id':_0x621466[_0x87bc('0x83')]['id']}})['then'](handleEntityNotFound(_0x46abc4,null))[_0x87bc('0x22')](removeEntity(_0x46abc4,null))[_0x87bc('0x82')](handleError(_0x46abc4,null));};exports[_0x87bc('0x29')]=function(_0x43ce42,_0x398aad){return db[_0x87bc('0x28')]['describe']()['then'](function(_0x2bea92){delete _0x2bea92['tags'];for(var _0x4964be=0x0;_0x4964be=_0x84a4e4){_0x1d3322=_0x84a4e4;_0x412639=0xc8;}else{_0x412639=0xce;}_0xa997a9[_0x8f8e('0x1b')](_0x412639);return _0xa997a9[_0x8f8e('0x21')]('Content-Range',_0x5052ed+'-'+_0x1d3322+'/'+_0x84a4e4)[_0x8f8e('0x1d')](_0x54e226);}return null;};}function patchUpdates(_0x3f18df){return function(_0x137e31){try{jsonpatch[_0x8f8e('0x22')](_0x137e31,_0x3f18df,!![]);}catch(_0x874869){return BPromise[_0x8f8e('0x23')](_0x874869);}return _0x137e31[_0x8f8e('0x24')]();};}function saveUpdates(_0xa20c09,_0x48e714){return function(_0x34a205){if(_0x34a205){return _0x34a205['update'](_0xa20c09)[_0x8f8e('0x25')](function(_0x23d389){return _0x23d389;});}return null;};}function removeEntity(_0x5ce41b,_0x4653d6){return function(_0x38382f){if(_0x38382f){return _0x38382f[_0x8f8e('0x26')]()[_0x8f8e('0x25')](function(){_0x5ce41b['status'](0xcc)[_0x8f8e('0x1c')]();});}};}function handleEntityNotFound(_0x3b2b25,_0x4279a1){return function(_0x5d808a){if(!_0x5d808a){_0x3b2b25[_0x8f8e('0x27')](0x194);}return _0x5d808a;};}function handleError(_0x540d3b,_0x4d54fb){_0x4d54fb=_0x4d54fb||0x1f4;return function(_0x24974d){logger['error'](_0x24974d[_0x8f8e('0x28')]);if(_0x24974d[_0x8f8e('0x29')]){delete _0x24974d[_0x8f8e('0x29')];}_0x540d3b['status'](_0x4d54fb)[_0x8f8e('0x2a')](_0x24974d);};}exports[_0x8f8e('0x2b')]=function(_0x38d3b7,_0xd456b8){var _0x4524a8={},_0x307159={},_0x274825={'count':0x0,'rows':[]};return db[_0x8f8e('0x2c')][_0x8f8e('0x2d')]()[_0x8f8e('0x25')](function(_0x4788c4){var _0x3bd348=[];for(var _0x516f25=0x0;_0x516f250x1){_0xd2efb9['or'](_0x8f8e('0x66'),qs[_0x8f8e('0x67')](_0x501e92),null);}else{if(qs[_0x8f8e('0x68')](_0x501e92)){_0xd2efb9['or'](_0x8f8e('0x69'),_0x501e92+'%');_0xd2efb9['or']('c.phone\x20LIKE\x20?',_0x501e92+'%');_0xd2efb9['or'](_0x8f8e('0x6a'),_0x501e92+'%');_0xd2efb9['or']('c.fax\x20LIKE\x20?',_0x501e92+'%');}else if(qs[_0x8f8e('0x6b')](_0x501e92)){_0xd2efb9['or']('c.email\x20LIKE\x20?',_0x501e92+'%');}else{_0xd2efb9['or'](_0x8f8e('0x6c'),'%'+_0x501e92+'%');_0xd2efb9['or'](_0x8f8e('0x6d'),'%'+_0x501e92+'%');_0xd2efb9['or'](_0x8f8e('0x6e'),'%'+_0x501e92+'%');}}}}_0xa80475[_0x8f8e('0x3e')](_0xd2efb9);_0xa80475[_0x8f8e('0x6f')](_0x8f8e('0x70'));var _0x4c0397={'type':db[_0x8f8e('0x71')][_0x8f8e('0x72')][_0x8f8e('0x73')],'raw':!![]};var _0x4f5561=_0xa80475[_0x8f8e('0x74')]()[_0x8f8e('0x3f')](_0x8f8e('0x70'));if(_0x4524a8[_0x8f8e('0x75')]){_0x4524a8[_0x8f8e('0x75')][_0x8f8e('0x50')](function(_0x1cc720){_0xa80475['order']('c.'+_0x1cc720[0x0],_0x1cc720[0x1]===_0x8f8e('0x76')?![]:!![]);});}if(!_['isEmpty'](_0xf467c4)){_0xa80475[_0x8f8e('0x77')](_0xcc5105);_0x4f5561[_0x8f8e('0x3e')](_0x8f8e('0x78'),_0xf467c4);}BPromise[_0x8f8e('0x79')]()[_0x8f8e('0x25')](function(){if(_0x369914&&!_[_0x8f8e('0x7a')](_0x369914[_0x8f8e('0x4c')],[_0x8f8e('0x3f'),_0x8f8e('0x52')])){return _0x38d3b7['user'][_0x8f8e('0x7b')]({'attributes':['id'],'raw':!![]})[_0x8f8e('0x25')](function(_0x14faf1){if(_[_0x8f8e('0x5e')](_0x14faf1)){_0x4f5561[_0x8f8e('0x3e')]('c.ListId\x20IS\x20NULL');_0xa80475[_0x8f8e('0x3e')](_0x8f8e('0x7c'));}else{_0x4f5561[_0x8f8e('0x3e')](_0x8f8e('0x7d'),_['map'](_0x14faf1,'id'));_0xa80475[_0x8f8e('0x3e')](_0x8f8e('0x7d'),_['map'](_0x14faf1,'id'));}});}else{return;}})['then'](function(){db['sequelize'][_0x8f8e('0x38')](_0x4f5561[_0x8f8e('0x7e')](),_0x4c0397)[_0x8f8e('0x25')](function(_0x12f7ee){_0x274825['count']=_0x12f7ee[_0x8f8e('0x2f')];if(_0x274825[_0x8f8e('0x1e')]===0x0)return[];return db[_0x8f8e('0x7f')][_0x8f8e('0x38')](_0x5d270c['toString'](),_0x4c0397);})[_0x8f8e('0x25')](function(_0x52a51a){_0x46bd54=_['keyBy'](_0x52a51a,'id');_0x4c0397=_[_0x8f8e('0x80')](_0x4c0397,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x38d3b7[_0x8f8e('0x38')][_0x8f8e('0x3c')]){_0x4524a8[_0x8f8e('0x3b')][_0x8f8e('0x50')](function(_0x21e1e1){_0xa80475[_0x8f8e('0x3f')]('c.'+_0x21e1e1);});}else{_0xa80475['field'](_0x8f8e('0x70'));_0xa80475[_0x8f8e('0x3f')](_0x8f8e('0x81'));_0xa80475['field']('c.lastName');_0xa80475[_0x8f8e('0x3f')]('c.phone');_0xa80475[_0x8f8e('0x3f')]('c.mobile');_0xa80475[_0x8f8e('0x3f')](_0x8f8e('0x82'));_0xa80475[_0x8f8e('0x3f')](_0x8f8e('0x83'));_0xa80475[_0x8f8e('0x3f')](_0x8f8e('0x84'));_0xa80475[_0x8f8e('0x3f')](_0x8f8e('0x85'));_0xa80475['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x8f8e('0x86'));}if(_0x4524a8['limit'])_0xa80475['limit'](_0x4524a8[_0x8f8e('0x20')]);if(_0x4524a8[_0x8f8e('0x1f')])_0xa80475[_0x8f8e('0x1f')](_0x4524a8[_0x8f8e('0x1f')]);return db['sequelize'][_0x8f8e('0x38')](_0xa80475[_0x8f8e('0x7e')](),_0x4c0397);})['then'](function(_0x22d0da){_0x22d0da['forEach'](function(_0x5ceee7){if(_0x5ceee7[_0x8f8e('0x86')]){_0x5ceee7[_0x8f8e('0x87')]=[];_0x5ceee7['TagIds'][_0x8f8e('0x4f')](',')[_0x8f8e('0x50')](function(_0x39e172){_0x5ceee7['Tags'][_0x8f8e('0x32')](_0x46bd54[_0x39e172]);});}delete _0x5ceee7[_0x8f8e('0x86')];});_0x274825['rows']=_0x22d0da;return _0x274825;})[_0x8f8e('0x25')](respondWithFilteredResult(_0xd456b8,_0x4524a8));});})[_0x8f8e('0x88')](handleError(_0xd456b8,null));};exports[_0x8f8e('0x26')]=function(_0x1e2ef5,_0x22da85){return db[_0x8f8e('0x2c')][_0x8f8e('0x89')]({'where':{'id':_0x1e2ef5[_0x8f8e('0x8a')]['id']}})['then'](handleEntityNotFound(_0x22da85,null))['then'](removeEntity(_0x22da85,null))[_0x8f8e('0x88')](handleError(_0x22da85,null));};exports[_0x8f8e('0x2d')]=function(_0x361a32,_0xd32c76){return db[_0x8f8e('0x2c')][_0x8f8e('0x2d')]()[_0x8f8e('0x25')](function(_0x48a88d){delete _0x48a88d['tags'];for(var _0x2dfc70=0x0;_0x2dfc70{}\s\\|]/g,'-');_0x35c0b0(null,util[_0xc207('0x1e')](_0xc207('0x1f'),path[_0xc207('0x20')](_0x2caec5['originalname'],path[_0xc207('0x21')](_0x2caec5['originalname'])),Date[_0xc207('0x22')](),path[_0xc207('0x21')](_0x2caec5[_0xc207('0x1c')])));}})});router[_0xc207('0x13')](_0xc207('0x23'),upload[_0xc207('0x24')](_0xc207('0x25')),controller[_0xc207('0x26')]);var upload=multer({'storage':multer[_0xc207('0x27')]({'destination':function(_0x2385f7,_0x25c91e,_0x27df03){_0x27df03(null,path[_0xc207('0x19')](config[_0xc207('0x1a')],_0xc207('0x1b')));},'filename':function(_0x56a066,_0x1e1440,_0x5e0bd1){_0x1e1440['originalname']=_0x1e1440[_0xc207('0x1c')][_0xc207('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5e0bd1(null,util[_0xc207('0x1e')](_0xc207('0x1f'),path[_0xc207('0x20')](_0x1e1440['originalname'],path[_0xc207('0x21')](_0x1e1440[_0xc207('0x1c')])),Date[_0xc207('0x22')](),path[_0xc207('0x21')](_0x1e1440[_0xc207('0x1c')])));}})});router[_0xc207('0x13')](_0xc207('0x28'),upload[_0xc207('0x24')](_0xc207('0x25')),controller[_0xc207('0x29')]);router[_0xc207('0x13')](_0xc207('0x2a'),auth[_0xc207('0xa')](),controller['import']);router[_0xc207('0x2b')](_0xc207('0xb'),auth[_0xc207('0xa')](),controller[_0xc207('0x2c')]);router[_0xc207('0x2d')](_0xc207('0xb'),auth['isAuthenticated'](),controller[_0xc207('0x2e')]);module[_0xc207('0x2f')]=router; \ No newline at end of file +var _0xa41a=['originalname','extname','/csv','single','file','now','/upload','upload','import','update','delete','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','describe','isAuthenticated','show','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','getHopperFinals','/:id/jscripty_sessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','replace','%s-%s%s','basename'];(function(_0x3f5d06,_0x177d1c){var _0x52e8fd=function(_0x31fc44){while(--_0x31fc44){_0x3f5d06['push'](_0x3f5d06['shift']());}};_0x52e8fd(++_0x177d1c);}(_0xa41a,0x6b));var _0xaa41=function(_0xd0f462,_0x771498){_0xd0f462=_0xd0f462-0x0;var _0x4beee4=_0xa41a[_0xd0f462];return _0x4beee4;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var auth=require(_0xaa41('0x5'));var interaction=require(_0xaa41('0x6'));var config=require(_0xaa41('0x7'));var controller=require(_0xaa41('0x8'));router[_0xaa41('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa41('0xa')]);router[_0xaa41('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0x9')]('/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0xd')]);router[_0xaa41('0x9')](_0xaa41('0xe'),auth[_0xaa41('0xc')](),controller[_0xaa41('0xf')]);router[_0xaa41('0x9')](_0xaa41('0x10'),auth[_0xaa41('0xc')](),controller['getHoppers']);router[_0xaa41('0x9')](_0xaa41('0x11'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xaa41('0x9')]('/:id/hopper_finals',auth[_0xaa41('0xc')](),controller[_0xaa41('0x12')]);router[_0xaa41('0x9')](_0xaa41('0x13'),auth[_0xaa41('0xc')](),controller['getJscriptySessions']);router[_0xaa41('0x14')](_0xaa41('0x15'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x16')]);router[_0xaa41('0x14')]('/',auth[_0xaa41('0xc')](),controller[_0xaa41('0x17')]);router['post'](_0xaa41('0x18'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x19')]);router[_0xaa41('0x14')](_0xaa41('0xe'),auth[_0xaa41('0xc')](),controller[_0xaa41('0x1a')]);var upload=multer({'storage':multer[_0xaa41('0x1b')]({'destination':function(_0x150ddf,_0x4fe1a4,_0x5cd936){_0x5cd936(null,path[_0xaa41('0x1c')](config[_0xaa41('0x1d')],_0xaa41('0x1e')));},'filename':function(_0x54c488,_0x2bf794,_0x1f692b){_0x2bf794['originalname']=_0x2bf794['originalname'][_0xaa41('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f692b(null,util['format'](_0xaa41('0x20'),path[_0xaa41('0x21')](_0x2bf794[_0xaa41('0x22')],path[_0xaa41('0x23')](_0x2bf794[_0xaa41('0x22')])),Date['now'](),path[_0xaa41('0x23')](_0x2bf794[_0xaa41('0x22')])));}})});router[_0xaa41('0x14')](_0xaa41('0x24'),upload[_0xaa41('0x25')](_0xaa41('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16aec5,_0x527cac,_0x493a10){_0x493a10(null,path[_0xaa41('0x1c')](config['root'],'server/files/tmp'));},'filename':function(_0x2d0ac0,_0x9c8c21,_0x392214){_0x9c8c21[_0xaa41('0x22')]=_0x9c8c21[_0xaa41('0x22')][_0xaa41('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x392214(null,util['format'](_0xaa41('0x20'),path[_0xaa41('0x21')](_0x9c8c21[_0xaa41('0x22')],path[_0xaa41('0x23')](_0x9c8c21[_0xaa41('0x22')])),Date[_0xaa41('0x27')](),path[_0xaa41('0x23')](_0x9c8c21[_0xaa41('0x22')])));}})});router['post'](_0xaa41('0x28'),upload['single']('file'),controller[_0xaa41('0x29')]);router[_0xaa41('0x14')]('/upload/:id',auth[_0xaa41('0xc')](),controller[_0xaa41('0x2a')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaa41('0x2b')]);router[_0xaa41('0x2c')](_0xaa41('0x2d'),auth[_0xaa41('0xc')](),controller['destroy']);module[_0xaa41('0x2e')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 60892ff..2f414ac 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 _0xa4bd=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x42c8a3,_0xd80dba){_0x42c8a3=_0x42c8a3-0x0;var _0xdec30e=_0xa4bd[_0x42c8a3];return _0xdec30e;};'use strict';var Sequelize=require(_0xda4b('0x0'));module[_0xda4b('0x1')]={'CmContactId':{'type':Sequelize[_0xda4b('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xda4b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xda4b('0x3')],'defaultValue':_0xda4b('0x4')},'OrderBy':{'type':Sequelize[_0xda4b('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x432b=['INTEGER','STRING','sequelize'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x432b,0x161));var _0xb432=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x432b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb432('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xb432('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xb432('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xb432('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xb432('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize['INTEGER'],'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 fab7325..e3657ee 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 _0xe23b=['to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','save','update','then','CmContactHasItems','destroy','sendStatus','error','stack','name','send','index','rawAttributes','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','CmContactHasItem','includeAll','rows','show','include','options','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox'];(function(_0x3f3fc0,_0x159820){var _0x52a339=function(_0x1d738d){while(--_0x1d738d){_0x3f3fc0['push'](_0x3f3fc0['shift']());}};_0x52a339(++_0x159820);}(_0xe23b,0x181));var _0xbe23=function(_0x751edd,_0x4dc970){_0x751edd=_0x751edd-0x0;var _0x350ab2=_0xe23b[_0x751edd];return _0x350ab2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbe23('0x0'));var rimraf=require(_0xbe23('0x1'));var zipdir=require(_0xbe23('0x2'));var jsonpatch=require(_0xbe23('0x3'));var rp=require('request-promise');var moment=require(_0xbe23('0x4'));var BPromise=require(_0xbe23('0x5'));var Mustache=require(_0xbe23('0x6'));var util=require(_0xbe23('0x7'));var path=require(_0xbe23('0x8'));var sox=require(_0xbe23('0x9'));var csv=require(_0xbe23('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbe23('0xb'));var crypto=require(_0xbe23('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbe23('0xd'));var toCsv=require(_0xbe23('0xa'));var querystring=require(_0xbe23('0xe'));var Papa=require(_0xbe23('0xf'));var Redis=require(_0xbe23('0x10'));var authService=require(_0xbe23('0x11'));var qs=require(_0xbe23('0x12'));var as=require(_0xbe23('0x13'));var hardwareService=require(_0xbe23('0x14'));var logger=require('../../config/logger')(_0xbe23('0x15'));var utils=require(_0xbe23('0x16'));var config=require(_0xbe23('0x17'));var db=require(_0xbe23('0x18'))['db'];function respondWithStatusCode(_0x3646d3,_0x25b636){_0x25b636=_0x25b636||0xcc;return function(_0x14d293){if(_0x14d293){return _0x3646d3['sendStatus'](_0x25b636);}return _0x3646d3[_0xbe23('0x19')](_0x25b636)[_0xbe23('0x1a')]();};}function respondWithResult(_0x50bfa3,_0x103ca2){_0x103ca2=_0x103ca2||0xc8;return function(_0x12a4aa){if(_0x12a4aa){return _0x50bfa3['status'](_0x103ca2)[_0xbe23('0x1b')](_0x12a4aa);}};}function respondWithFilteredResult(_0x3696d6,_0x5ae51a){return function(_0x211e6b){if(_0x211e6b){var _0x40bee3=_0x211e6b[_0xbe23('0x1c')],_0x5b8556=_0x5ae51a[_0xbe23('0x1d')],_0x7a780f=_0x5ae51a['offset']+_0x5ae51a[_0xbe23('0x1e')],_0x5a76e8;if(_0x7a780f>=_0x40bee3){_0x7a780f=_0x40bee3;_0x5a76e8=0xc8;}else{_0x5a76e8=0xce;}_0x3696d6[_0xbe23('0x19')](_0x5a76e8);return _0x3696d6[_0xbe23('0x1f')]('Content-Range',_0x5b8556+'-'+_0x7a780f+'/'+_0x40bee3)[_0xbe23('0x1b')](_0x211e6b);}return null;};}function patchUpdates(_0x4d13f6){return function(_0xc6e90e){try{jsonpatch[_0xbe23('0x20')](_0xc6e90e,_0x4d13f6,!![]);}catch(_0x19d025){return BPromise['reject'](_0x19d025);}return _0xc6e90e[_0xbe23('0x21')]();};}function saveUpdates(_0x430cad,_0x2d83bf){return function(_0x5b5c28){if(_0x5b5c28){return _0x5b5c28[_0xbe23('0x22')](_0x430cad)['then'](function(_0x1d38e9){return _0x1d38e9;});}return null;};}function removeEntity(_0x39331f,_0xc9a7a9){return function(_0x491e54){if(_0x491e54){return _0x491e54['destroy']()[_0xbe23('0x23')](function(){var _0x2df088=_0x491e54['get']({'plain':!![]});var _0x3cb25c=_0xbe23('0x24');return db['UserProfileResource'][_0xbe23('0x25')]({'where':{'type':_0x3cb25c,'resourceId':_0x2df088['id']}})[_0xbe23('0x23')](function(){return _0x491e54;});})[_0xbe23('0x23')](function(){_0x39331f[_0xbe23('0x19')](0xcc)[_0xbe23('0x1a')]();});}};}function handleEntityNotFound(_0xb481be,_0x4d59a4){return function(_0x2ca289){if(!_0x2ca289){_0xb481be[_0xbe23('0x26')](0x194);}return _0x2ca289;};}function handleError(_0x2a7d7d,_0x545077){_0x545077=_0x545077||0x1f4;return function(_0x329570){logger[_0xbe23('0x27')](_0x329570[_0xbe23('0x28')]);if(_0x329570['name']){delete _0x329570[_0xbe23('0x29')];}_0x2a7d7d[_0xbe23('0x19')](_0x545077)[_0xbe23('0x2a')](_0x329570);};}exports[_0xbe23('0x2b')]=function(_0x366ecc,_0x2db9f0){var _0x4fac0d={},_0x10f825={},_0x3089ce={'count':0x0,'rows':[]};var _0x50453f=_['map'](db['CmContactHasItem'][_0xbe23('0x2c')],function(_0x1078ff){return{'name':_0x1078ff['fieldName'],'type':_0x1078ff['type'][_0xbe23('0x2d')]};});_0x10f825[_0xbe23('0x2e')]=_['map'](_0x50453f,_0xbe23('0x29'));_0x10f825[_0xbe23('0x2f')]=_[_0xbe23('0x30')](_0x366ecc[_0xbe23('0x2f')]);_0x10f825['filters']=_[_0xbe23('0x31')](_0x10f825['model'],_0x10f825[_0xbe23('0x2f')]);_0x4fac0d[_0xbe23('0x32')]=_[_0xbe23('0x31')](_0x10f825[_0xbe23('0x2e')],qs[_0xbe23('0x33')](_0x366ecc[_0xbe23('0x2f')][_0xbe23('0x33')]));_0x4fac0d[_0xbe23('0x32')]=_0x4fac0d['attributes']['length']?_0x4fac0d['attributes']:_0x10f825[_0xbe23('0x2e')];if(!_0x366ecc['query'][_0xbe23('0x34')](_0xbe23('0x35'))){_0x4fac0d[_0xbe23('0x1e')]=qs[_0xbe23('0x1e')](_0x366ecc[_0xbe23('0x2f')][_0xbe23('0x1e')]);_0x4fac0d[_0xbe23('0x1d')]=qs['offset'](_0x366ecc[_0xbe23('0x2f')][_0xbe23('0x1d')]);}_0x4fac0d['order']=qs[_0xbe23('0x36')](_0x366ecc['query'][_0xbe23('0x36')]);_0x4fac0d[_0xbe23('0x37')]=qs[_0xbe23('0x38')](_[_0xbe23('0x39')](_0x366ecc['query'],_0x10f825[_0xbe23('0x38')]),_0x50453f);if(_0x366ecc['query'][_0xbe23('0x3a')]){_0x4fac0d[_0xbe23('0x37')]=_[_0xbe23('0x3b')](_0x4fac0d['where'],{'$or':_['map'](_0x50453f,function(_0xd77e87){if(_0xd77e87['type']!==_0xbe23('0x3c')){var _0xd741c3={};_0xd741c3[_0xd77e87[_0xbe23('0x29')]]={'$like':'%'+_0x366ecc['query'][_0xbe23('0x3a')]+'%'};return _0xd741c3;}})});}_0x4fac0d=_['merge']({},_0x4fac0d,_0x366ecc['options']);var _0x381285={'where':_0x4fac0d[_0xbe23('0x37')]};return db[_0xbe23('0x3d')][_0xbe23('0x1c')](_0x381285)[_0xbe23('0x23')](function(_0x5e063c){_0x3089ce[_0xbe23('0x1c')]=_0x5e063c;if(_0x366ecc['query'][_0xbe23('0x3e')]){_0x4fac0d['include']=[{'all':!![]}];}return db[_0xbe23('0x3d')]['findAll'](_0x4fac0d);})['then'](function(_0xa7b15c){_0x3089ce[_0xbe23('0x3f')]=_0xa7b15c;return _0x3089ce;})[_0xbe23('0x23')](respondWithFilteredResult(_0x2db9f0,_0x4fac0d))['catch'](handleError(_0x2db9f0,null));};exports[_0xbe23('0x40')]=function(_0x1b659a,_0x246cf9){var _0x5b3291={'raw':!![],'where':{'id':_0x1b659a['params']['id']}},_0x2fc4e8={};_0x2fc4e8['model']=_[_0xbe23('0x30')](db[_0xbe23('0x3d')][_0xbe23('0x2c')]);_0x2fc4e8[_0xbe23('0x2f')]=_['keys'](_0x1b659a[_0xbe23('0x2f')]);_0x2fc4e8[_0xbe23('0x38')]=_['intersection'](_0x2fc4e8[_0xbe23('0x2e')],_0x2fc4e8[_0xbe23('0x2f')]);_0x5b3291[_0xbe23('0x32')]=_[_0xbe23('0x31')](_0x2fc4e8['model'],qs[_0xbe23('0x33')](_0x1b659a[_0xbe23('0x2f')]['fields']));_0x5b3291[_0xbe23('0x32')]=_0x5b3291[_0xbe23('0x32')]['length']?_0x5b3291[_0xbe23('0x32')]:_0x2fc4e8[_0xbe23('0x2e')];if(_0x1b659a['query']['includeAll']){_0x5b3291[_0xbe23('0x41')]=[{'all':!![]}];}_0x5b3291=_[_0xbe23('0x3b')]({},_0x5b3291,_0x1b659a[_0xbe23('0x42')]);return db[_0xbe23('0x3d')][_0xbe23('0x43')](_0x5b3291)[_0xbe23('0x23')](handleEntityNotFound(_0x246cf9,null))['then'](respondWithResult(_0x246cf9,null))[_0xbe23('0x44')](handleError(_0x246cf9,null));};exports[_0xbe23('0x45')]=function(_0x3159e5,_0xa8a2b5){return db[_0xbe23('0x3d')][_0xbe23('0x45')](_0x3159e5[_0xbe23('0x46')],{})[_0xbe23('0x23')](function(_0x5870f1){var _0x53f0ae=_0x3159e5[_0xbe23('0x47')][_0xbe23('0x48')]({'plain':!![]});if(!_0x53f0ae)throw new Error(_0xbe23('0x49'));if(_0x53f0ae[_0xbe23('0x4a')]==='user'){var _0x282bd5=_0x5870f1[_0xbe23('0x48')]({'plain':!![]});var _0x1e1806=_0xbe23('0x24');return db[_0xbe23('0x4b')][_0xbe23('0x43')]({'where':{'name':_0x1e1806,'userProfileId':_0x53f0ae['userProfileId']},'raw':!![]})[_0xbe23('0x23')](function(_0x3e453f){if(_0x3e453f&&_0x3e453f[_0xbe23('0x4c')]===0x0){return db[_0xbe23('0x4d')][_0xbe23('0x45')]({'name':_0x282bd5[_0xbe23('0x29')],'resourceId':_0x282bd5['id'],'type':_0x3e453f['name'],'sectionId':_0x3e453f['id']},{})[_0xbe23('0x23')](function(){return _0x5870f1;});}else{return _0x5870f1;}})[_0xbe23('0x44')](function(_0x44f4a3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44f4a3);throw _0x44f4a3;});}return _0x5870f1;})['then'](respondWithResult(_0xa8a2b5,0xc9))[_0xbe23('0x44')](handleError(_0xa8a2b5,null));};exports['update']=function(_0x35f3be,_0x374a58){if(_0x35f3be[_0xbe23('0x46')]['id']){delete _0x35f3be[_0xbe23('0x46')]['id'];}return db[_0xbe23('0x3d')][_0xbe23('0x43')]({'where':{'id':_0x35f3be['params']['id']}})[_0xbe23('0x23')](handleEntityNotFound(_0x374a58,null))[_0xbe23('0x23')](saveUpdates(_0x35f3be['body'],null))['then'](respondWithResult(_0x374a58,null))[_0xbe23('0x44')](handleError(_0x374a58,null));};exports['destroy']=function(_0x229b63,_0xcab447){return db[_0xbe23('0x3d')][_0xbe23('0x43')]({'where':{'id':_0x229b63[_0xbe23('0x4e')]['id']}})[_0xbe23('0x23')](handleEntityNotFound(_0xcab447,null))[_0xbe23('0x23')](removeEntity(_0xcab447,null))[_0xbe23('0x44')](handleError(_0xcab447,null));}; \ No newline at end of file +var _0xc4bf=['intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','map','CmContactHasItem','rawAttributes','fieldName','type','key','keys','query','filters'];(function(_0x345f45,_0x4c7a5a){var _0x278bab=function(_0x53a96c){while(--_0x53a96c){_0x345f45['push'](_0x345f45['shift']());}};_0x278bab(++_0x4c7a5a);}(_0xc4bf,0x65));var _0xfc4b=function(_0x5d81a9,_0x5aaedd){_0x5d81a9=_0x5d81a9-0x0;var _0x1ceac5=_0xc4bf[_0x5d81a9];return _0x1ceac5;};'use strict';var pdf=require(_0xfc4b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfc4b('0x1'));var zipdir=require(_0xfc4b('0x2'));var jsonpatch=require(_0xfc4b('0x3'));var rp=require(_0xfc4b('0x4'));var moment=require('moment');var BPromise=require(_0xfc4b('0x5'));var Mustache=require(_0xfc4b('0x6'));var util=require('util');var path=require(_0xfc4b('0x7'));var sox=require(_0xfc4b('0x8'));var csv=require(_0xfc4b('0x9'));var ejs=require(_0xfc4b('0xa'));var fs=require('fs');var _=require(_0xfc4b('0xb'));var squel=require('squel');var crypto=require(_0xfc4b('0xc'));var jsforce=require(_0xfc4b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfc4b('0xe'));var Papa=require(_0xfc4b('0xf'));var Redis=require(_0xfc4b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfc4b('0x11'));var as=require(_0xfc4b('0x12'));var hardwareService=require(_0xfc4b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfc4b('0x14'));var config=require(_0xfc4b('0x15'));var db=require(_0xfc4b('0x16'))['db'];function respondWithStatusCode(_0x1cacbd,_0x2e5ab6){_0x2e5ab6=_0x2e5ab6||0xcc;return function(_0x4f6266){if(_0x4f6266){return _0x1cacbd[_0xfc4b('0x17')](_0x2e5ab6);}return _0x1cacbd[_0xfc4b('0x18')](_0x2e5ab6)[_0xfc4b('0x19')]();};}function respondWithResult(_0x231744,_0x2835d3){_0x2835d3=_0x2835d3||0xc8;return function(_0x13ab2a){if(_0x13ab2a){return _0x231744[_0xfc4b('0x18')](_0x2835d3)[_0xfc4b('0x1a')](_0x13ab2a);}};}function respondWithFilteredResult(_0x5c361d,_0x5b7ae9){return function(_0x225043){if(_0x225043){var _0x47b946=_0x225043[_0xfc4b('0x1b')],_0x34ca80=_0x5b7ae9['offset'],_0x1e28d6=_0x5b7ae9[_0xfc4b('0x1c')]+_0x5b7ae9[_0xfc4b('0x1d')],_0x5ea51f;if(_0x1e28d6>=_0x47b946){_0x1e28d6=_0x47b946;_0x5ea51f=0xc8;}else{_0x5ea51f=0xce;}_0x5c361d['status'](_0x5ea51f);return _0x5c361d[_0xfc4b('0x1e')](_0xfc4b('0x1f'),_0x34ca80+'-'+_0x1e28d6+'/'+_0x47b946)['json'](_0x225043);}return null;};}function patchUpdates(_0x259404){return function(_0x4de0e3){try{jsonpatch[_0xfc4b('0x20')](_0x4de0e3,_0x259404,!![]);}catch(_0xdfb5a8){return BPromise[_0xfc4b('0x21')](_0xdfb5a8);}return _0x4de0e3[_0xfc4b('0x22')]();};}function saveUpdates(_0x30d7db,_0x58967e){return function(_0x1f5ef9){if(_0x1f5ef9){return _0x1f5ef9[_0xfc4b('0x23')](_0x30d7db)['then'](function(_0x304c58){return _0x304c58;});}return null;};}function removeEntity(_0x504176,_0x8ba450){return function(_0xa1edfb){if(_0xa1edfb){return _0xa1edfb[_0xfc4b('0x24')]()[_0xfc4b('0x25')](function(){var _0xa2c6d0=_0xa1edfb[_0xfc4b('0x26')]({'plain':!![]});var _0x166061='CmContactHasItems';return db[_0xfc4b('0x27')][_0xfc4b('0x24')]({'where':{'type':_0x166061,'resourceId':_0xa2c6d0['id']}})[_0xfc4b('0x25')](function(){return _0xa1edfb;});})[_0xfc4b('0x25')](function(){_0x504176[_0xfc4b('0x18')](0xcc)[_0xfc4b('0x19')]();});}};}function handleEntityNotFound(_0x55f5af,_0x27648b){return function(_0x9482c){if(!_0x9482c){_0x55f5af['sendStatus'](0x194);}return _0x9482c;};}function handleError(_0x10a203,_0x19005a){_0x19005a=_0x19005a||0x1f4;return function(_0x4a5aab){logger[_0xfc4b('0x28')](_0x4a5aab['stack']);if(_0x4a5aab[_0xfc4b('0x29')]){delete _0x4a5aab['name'];}_0x10a203['status'](_0x19005a)['send'](_0x4a5aab);};}exports['index']=function(_0x40a643,_0x38bc77){var _0x91dbe={},_0x46e0de={},_0x5e3b4a={'count':0x0,'rows':[]};var _0x37fb78=_[_0xfc4b('0x2a')](db[_0xfc4b('0x2b')][_0xfc4b('0x2c')],function(_0x2a92f0){return{'name':_0x2a92f0[_0xfc4b('0x2d')],'type':_0x2a92f0[_0xfc4b('0x2e')][_0xfc4b('0x2f')]};});_0x46e0de['model']=_['map'](_0x37fb78,_0xfc4b('0x29'));_0x46e0de['query']=_[_0xfc4b('0x30')](_0x40a643[_0xfc4b('0x31')]);_0x46e0de[_0xfc4b('0x32')]=_[_0xfc4b('0x33')](_0x46e0de[_0xfc4b('0x34')],_0x46e0de['query']);_0x91dbe[_0xfc4b('0x35')]=_[_0xfc4b('0x33')](_0x46e0de[_0xfc4b('0x34')],qs['fields'](_0x40a643[_0xfc4b('0x31')]['fields']));_0x91dbe[_0xfc4b('0x35')]=_0x91dbe[_0xfc4b('0x35')][_0xfc4b('0x36')]?_0x91dbe[_0xfc4b('0x35')]:_0x46e0de[_0xfc4b('0x34')];if(!_0x40a643['query'][_0xfc4b('0x37')](_0xfc4b('0x38'))){_0x91dbe[_0xfc4b('0x1d')]=qs['limit'](_0x40a643[_0xfc4b('0x31')][_0xfc4b('0x1d')]);_0x91dbe[_0xfc4b('0x1c')]=qs[_0xfc4b('0x1c')](_0x40a643[_0xfc4b('0x31')][_0xfc4b('0x1c')]);}_0x91dbe[_0xfc4b('0x39')]=qs[_0xfc4b('0x3a')](_0x40a643[_0xfc4b('0x31')]['sort']);_0x91dbe[_0xfc4b('0x3b')]=qs[_0xfc4b('0x32')](_[_0xfc4b('0x3c')](_0x40a643[_0xfc4b('0x31')],_0x46e0de['filters']),_0x37fb78);if(_0x40a643[_0xfc4b('0x31')][_0xfc4b('0x3d')]){_0x91dbe[_0xfc4b('0x3b')]=_[_0xfc4b('0x3e')](_0x91dbe['where'],{'$or':_[_0xfc4b('0x2a')](_0x37fb78,function(_0x5b7e08){if(_0x5b7e08['type']!=='VIRTUAL'){var _0x4b2952={};_0x4b2952[_0x5b7e08[_0xfc4b('0x29')]]={'$like':'%'+_0x40a643[_0xfc4b('0x31')][_0xfc4b('0x3d')]+'%'};return _0x4b2952;}})});}_0x91dbe=_[_0xfc4b('0x3e')]({},_0x91dbe,_0x40a643['options']);var _0x1ffb0e={'where':_0x91dbe[_0xfc4b('0x3b')]};return db[_0xfc4b('0x2b')]['count'](_0x1ffb0e)[_0xfc4b('0x25')](function(_0x340c1f){_0x5e3b4a['count']=_0x340c1f;if(_0x40a643['query'][_0xfc4b('0x3f')]){_0x91dbe[_0xfc4b('0x40')]=[{'all':!![]}];}return db[_0xfc4b('0x2b')]['findAll'](_0x91dbe);})[_0xfc4b('0x25')](function(_0x4d200a){_0x5e3b4a[_0xfc4b('0x41')]=_0x4d200a;return _0x5e3b4a;})['then'](respondWithFilteredResult(_0x38bc77,_0x91dbe))[_0xfc4b('0x42')](handleError(_0x38bc77,null));};exports['show']=function(_0x559fa2,_0x59258c){var _0x357f4c={'raw':!![],'where':{'id':_0x559fa2['params']['id']}},_0x409937={};_0x409937[_0xfc4b('0x34')]=_[_0xfc4b('0x30')](db[_0xfc4b('0x2b')]['rawAttributes']);_0x409937[_0xfc4b('0x31')]=_['keys'](_0x559fa2[_0xfc4b('0x31')]);_0x409937[_0xfc4b('0x32')]=_[_0xfc4b('0x33')](_0x409937['model'],_0x409937[_0xfc4b('0x31')]);_0x357f4c[_0xfc4b('0x35')]=_[_0xfc4b('0x33')](_0x409937[_0xfc4b('0x34')],qs[_0xfc4b('0x43')](_0x559fa2[_0xfc4b('0x31')][_0xfc4b('0x43')]));_0x357f4c[_0xfc4b('0x35')]=_0x357f4c[_0xfc4b('0x35')][_0xfc4b('0x36')]?_0x357f4c[_0xfc4b('0x35')]:_0x409937[_0xfc4b('0x34')];if(_0x559fa2['query'][_0xfc4b('0x3f')]){_0x357f4c['include']=[{'all':!![]}];}_0x357f4c=_[_0xfc4b('0x3e')]({},_0x357f4c,_0x559fa2[_0xfc4b('0x44')]);return db[_0xfc4b('0x2b')][_0xfc4b('0x45')](_0x357f4c)[_0xfc4b('0x25')](handleEntityNotFound(_0x59258c,null))[_0xfc4b('0x25')](respondWithResult(_0x59258c,null))[_0xfc4b('0x42')](handleError(_0x59258c,null));};exports[_0xfc4b('0x46')]=function(_0x1465cd,_0x155df7){return db['CmContactHasItem'][_0xfc4b('0x46')](_0x1465cd['body'],{})[_0xfc4b('0x25')](function(_0x51e9f9){var _0x51da12=_0x1465cd['user']['get']({'plain':!![]});if(!_0x51da12)throw new Error(_0xfc4b('0x47'));if(_0x51da12[_0xfc4b('0x48')]==='user'){var _0x212183=_0x51e9f9[_0xfc4b('0x26')]({'plain':!![]});var _0x21dfb1='CmContactHasItems';return db['UserProfileSection'][_0xfc4b('0x45')]({'where':{'name':_0x21dfb1,'userProfileId':_0x51da12['userProfileId']},'raw':!![]})[_0xfc4b('0x25')](function(_0x829056){if(_0x829056&&_0x829056[_0xfc4b('0x49')]===0x0){return db[_0xfc4b('0x27')][_0xfc4b('0x46')]({'name':_0x212183[_0xfc4b('0x29')],'resourceId':_0x212183['id'],'type':_0x829056['name'],'sectionId':_0x829056['id']},{})[_0xfc4b('0x25')](function(){return _0x51e9f9;});}else{return _0x51e9f9;}})[_0xfc4b('0x42')](function(_0x115bc7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x115bc7);throw _0x115bc7;});}return _0x51e9f9;})['then'](respondWithResult(_0x155df7,0xc9))[_0xfc4b('0x42')](handleError(_0x155df7,null));};exports[_0xfc4b('0x23')]=function(_0x3dfa12,_0x1611cb){if(_0x3dfa12[_0xfc4b('0x4a')]['id']){delete _0x3dfa12[_0xfc4b('0x4a')]['id'];}return db[_0xfc4b('0x2b')][_0xfc4b('0x45')]({'where':{'id':_0x3dfa12[_0xfc4b('0x4b')]['id']}})[_0xfc4b('0x25')](handleEntityNotFound(_0x1611cb,null))[_0xfc4b('0x25')](saveUpdates(_0x3dfa12['body'],null))['then'](respondWithResult(_0x1611cb,null))[_0xfc4b('0x42')](handleError(_0x1611cb,null));};exports[_0xfc4b('0x24')]=function(_0x1b27d3,_0x4dd943){return db[_0xfc4b('0x2b')][_0xfc4b('0x45')]({'where':{'id':_0x1b27d3[_0xfc4b('0x4b')]['id']}})[_0xfc4b('0x25')](handleEntityNotFound(_0x4dd943,null))[_0xfc4b('0x25')](removeEntity(_0x4dd943,null))[_0xfc4b('0x42')](handleError(_0x4dd943,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index c6d42b7..fec64d3 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 _0x7046=['path','../../config/environment','./cmContactHasItem.attributes','exports','CmContactHasItem','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3906da,_0x2e3915){var _0x56e09c=function(_0x4d503e){while(--_0x4d503e){_0x3906da['push'](_0x3906da['shift']());}};_0x56e09c(++_0x2e3915);}(_0x7046,0x144));var _0x6704=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7046[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var logger=require(_0x6704('0x2'))(_0x6704('0x3'));var moment=require('moment');var BPromise=require(_0x6704('0x4'));var rp=require(_0x6704('0x5'));var fs=require('fs');var path=require(_0x6704('0x6'));var rimraf=require('rimraf');var config=require(_0x6704('0x7'));var attributes=require(_0x6704('0x8'));module[_0x6704('0x9')]=function(_0x626a14,_0x2917be){return _0x626a14['define'](_0x6704('0xa'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4975=['./cmContactHasItem.attributes','exports','CmContactHasItem','cm_contact_has_items','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5ee030,_0x17c9e3){var _0x213134=function(_0x56fa4a){while(--_0x56fa4a){_0x5ee030['push'](_0x5ee030['shift']());}};_0x213134(++_0x17c9e3);}(_0x4975,0x86));var _0x5497=function(_0x2c6354,_0x3c6a08){_0x2c6354=_0x2c6354-0x0;var _0x2c4c89=_0x4975[_0x2c6354];return _0x2c4c89;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 1ee2b2c..a11d770 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 _0xc910=['../../config/environment','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4dd0a7,_0xb4399f){var _0x487e9b=function(_0x355738){while(--_0x355738){_0x4dd0a7['push'](_0x4dd0a7['shift']());}};_0x487e9b(++_0xb4399f);}(_0xc910,0x109));var _0x0c91=function(_0x42f038,_0x242ecb){_0x42f038=_0x42f038-0x0;var _0xcfc343=_0xc910[_0x42f038];return _0xcfc343;};'use strict';var _=require(_0x0c91('0x0'));var util=require(_0x0c91('0x1'));var moment=require(_0x0c91('0x2'));var BPromise=require(_0x0c91('0x3'));var rs=require(_0x0c91('0x4'));var fs=require('fs');var Redis=require(_0x0c91('0x5'));var db=require(_0x0c91('0x6'))['db'];var utils=require(_0x0c91('0x7'));var logger=require(_0x0c91('0x8'))(_0x0c91('0x9'));var config=require(_0x0c91('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0c91('0xb')][_0x0c91('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xad809f,_0x2cd449,_0x143b03){return new BPromise(function(_0x57803d,_0x3a5df7){return client[_0x0c91('0xd')](_0xad809f,_0x143b03)[_0x0c91('0xe')](function(_0x313e6a){logger[_0x0c91('0xf')](_0x0c91('0x10'),_0x2cd449,_0x0c91('0x11'));logger[_0x0c91('0x12')](_0x0c91('0x13'),_0x2cd449,'request\x20sent',JSON[_0x0c91('0x14')](_0x313e6a));if(_0x313e6a['error']){if(_0x313e6a['error']['code']===0x1f4){logger[_0x0c91('0x15')](_0x0c91('0x10'),_0x2cd449,_0x313e6a[_0x0c91('0x15')]['message']);return _0x3a5df7(_0x313e6a['error'][_0x0c91('0x16')]);}logger[_0x0c91('0x15')](_0x0c91('0x10'),_0x2cd449,_0x313e6a[_0x0c91('0x15')][_0x0c91('0x16')]);return _0x57803d(_0x313e6a[_0x0c91('0x15')][_0x0c91('0x16')]);}else{logger[_0x0c91('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x2cd449,_0x0c91('0x11'));_0x57803d(_0x313e6a[_0x0c91('0x17')]['message']);}})[_0x0c91('0x18')](function(_0x4178d3){logger[_0x0c91('0x15')](_0x0c91('0x10'),_0x2cd449,_0x4178d3);_0x3a5df7(_0x4178d3);});});} \ No newline at end of file +var _0xbf1e=['result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xbf1e,0x75));var _0xebf1=function(_0x43b13a,_0x19bf83){_0x43b13a=_0x43b13a-0x0;var _0x10f606=_0xbf1e[_0x43b13a];return _0x10f606;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf1('0x0'));var BPromise=require('bluebird');var rs=require(_0xebf1('0x1'));var fs=require('fs');var Redis=require(_0xebf1('0x2'));var db=require(_0xebf1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xebf1('0x4'))(_0xebf1('0x5'));var config=require(_0xebf1('0x6'));var jayson=require(_0xebf1('0x7'));var client=jayson[_0xebf1('0x8')][_0xebf1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3019ec,_0x1dd664,_0x5d58a7){return new BPromise(function(_0x3a5521,_0x2ea308){return client[_0xebf1('0xa')](_0x3019ec,_0x5d58a7)[_0xebf1('0xb')](function(_0x5ae3a4){logger[_0xebf1('0xc')](_0xebf1('0xd'),_0x1dd664,_0xebf1('0xe'));logger[_0xebf1('0xf')](_0xebf1('0x10'),_0x1dd664,_0xebf1('0xe'),JSON[_0xebf1('0x11')](_0x5ae3a4));if(_0x5ae3a4[_0xebf1('0x12')]){if(_0x5ae3a4[_0xebf1('0x12')][_0xebf1('0x13')]===0x1f4){logger[_0xebf1('0x12')](_0xebf1('0xd'),_0x1dd664,_0x5ae3a4[_0xebf1('0x12')][_0xebf1('0x14')]);return _0x2ea308(_0x5ae3a4[_0xebf1('0x12')][_0xebf1('0x14')]);}logger[_0xebf1('0x12')](_0xebf1('0xd'),_0x1dd664,_0x5ae3a4[_0xebf1('0x12')][_0xebf1('0x14')]);return _0x3a5521(_0x5ae3a4['error'][_0xebf1('0x14')]);}else{logger['info'](_0xebf1('0xd'),_0x1dd664,_0xebf1('0xe'));_0x3a5521(_0x5ae3a4[_0xebf1('0x15')][_0xebf1('0x14')]);}})[_0xebf1('0x16')](function(_0x33a233){logger[_0xebf1('0x12')](_0xebf1('0xd'),_0x1dd664,_0x33a233);_0x2ea308(_0x33a233);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 8604b7f..6bc3a88 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 _0x4504=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','put','update','delete','exports','util','connect-timeout'];(function(_0x31d7c6,_0x449d6c){var _0x3805e1=function(_0x58e685){while(--_0x58e685){_0x31d7c6['push'](_0x31d7c6['shift']());}};_0x3805e1(++_0x449d6c);}(_0x4504,0xd0));var _0x4450=function(_0x173fa1,_0x49d291){_0x173fa1=_0x173fa1-0x0;var _0x1c8131=_0x4504[_0x173fa1];return _0x1c8131;};'use strict';var multer=require('multer');var util=require(_0x4450('0x0'));var path=require('path');var timeout=require(_0x4450('0x1'));var express=require(_0x4450('0x2'));var router=express[_0x4450('0x3')]();var auth=require(_0x4450('0x4'));var interaction=require(_0x4450('0x5'));var config=require(_0x4450('0x6'));var controller=require('./cmContactHasItem.controller');router[_0x4450('0x7')]('/',auth[_0x4450('0x8')](),controller['index']);router[_0x4450('0x7')](_0x4450('0x9'),auth['isAuthenticated'](),controller[_0x4450('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4450('0xb')](_0x4450('0x9'),auth[_0x4450('0x8')](),controller[_0x4450('0xc')]);router[_0x4450('0xd')](_0x4450('0x9'),auth[_0x4450('0x8')](),controller['destroy']);module[_0x4450('0xe')]=router; \ No newline at end of file +var _0xa8af=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','index','isAuthenticated','show','create','put','/:id','update','exports','util'];(function(_0x4e0d9d,_0xc84dba){var _0x54addc=function(_0xe1e7cd){while(--_0xe1e7cd){_0x4e0d9d['push'](_0x4e0d9d['shift']());}};_0x54addc(++_0xc84dba);}(_0xa8af,0xfe));var _0xfa8a=function(_0x4c9939,_0xb2ae08){_0x4c9939=_0x4c9939-0x0;var _0x11495b=_0xa8af[_0x4c9939];return _0x11495b;};'use strict';var multer=require('multer');var util=require(_0xfa8a('0x0'));var path=require(_0xfa8a('0x1'));var timeout=require(_0xfa8a('0x2'));var express=require(_0xfa8a('0x3'));var router=express['Router']();var auth=require(_0xfa8a('0x4'));var interaction=require(_0xfa8a('0x5'));var config=require(_0xfa8a('0x6'));var controller=require(_0xfa8a('0x7'));router[_0xfa8a('0x8')]('/',auth['isAuthenticated'](),controller[_0xfa8a('0x9')]);router[_0xfa8a('0x8')]('/:id',auth[_0xfa8a('0xa')](),controller[_0xfa8a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfa8a('0xc')]);router[_0xfa8a('0xd')](_0xfa8a('0xe'),auth[_0xfa8a('0xa')](),controller[_0xfa8a('0xf')]);router['delete'](_0xfa8a('0xe'),auth[_0xfa8a('0xa')](),controller['destroy']);module[_0xfa8a('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js index cc8b030..88767f0 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 _0xc238=['exports','INTEGER'];(function(_0x511a1f,_0xe41713){var _0x577061=function(_0xc402c4){while(--_0xc402c4){_0x511a1f['push'](_0x511a1f['shift']());}};_0x577061(++_0xe41713);}(_0xc238,0x16c));var _0x8c23=function(_0x641711,_0x5c4912){_0x641711=_0x641711-0x0;var _0x3a6d79=_0xc238[_0x641711];return _0x3a6d79;};'use strict';var Sequelize=require('sequelize');module[_0x8c23('0x0')]={'CmContactId':{'type':Sequelize[_0x8c23('0x1')],'primaryKey':!![]},'phone':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]}}; \ No newline at end of file +var _0x0cc7=['INTEGER','sequelize','exports'];(function(_0x2e10ec,_0x1e6bd2){var _0x20c62b=function(_0x37f540){while(--_0x37f540){_0x2e10ec['push'](_0x2e10ec['shift']());}};_0x20c62b(++_0x1e6bd2);}(_0x0cc7,0x1e7));var _0x70cc=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x0cc7[_0x4ae829];return _0x256b31;};'use strict';var Sequelize=require(_0x70cc('0x0'));module[_0x70cc('0x1')]={'CmContactId':{'type':Sequelize[_0x70cc('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize['STRING'],'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 dfeed08..420cff3 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 _0xa084=['bluebird','path','sox','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','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','CmContactHasPhones','UserProfileResource','sendStatus','error','stack','name','send','index','map','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','CmContactHasPhone','includeAll','include','findAll','rows','show','params','rawAttributes','keys','options','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','fast-json-patch','request-promise'];(function(_0x17882c,_0x4b964b){var _0x355a59=function(_0x534b5b){while(--_0x534b5b){_0x17882c['push'](_0x17882c['shift']());}};_0x355a59(++_0x4b964b);}(_0xa084,0x19b));var _0x4a08=function(_0x439c27,_0x2a6006){_0x439c27=_0x439c27-0x0;var _0x10de77=_0xa084[_0x439c27];return _0x10de77;};'use strict';var pdf=require(_0x4a08('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4a08('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a08('0x2'));var rp=require(_0x4a08('0x3'));var moment=require('moment');var BPromise=require(_0x4a08('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a08('0x5'));var sox=require(_0x4a08('0x6'));var csv=require(_0x4a08('0x7'));var ejs=require(_0x4a08('0x8'));var fs=require('fs');var _=require(_0x4a08('0x9'));var squel=require(_0x4a08('0xa'));var crypto=require(_0x4a08('0xb'));var jsforce=require(_0x4a08('0xc'));var deskjs=require(_0x4a08('0xd'));var toCsv=require(_0x4a08('0x7'));var querystring=require(_0x4a08('0xe'));var Papa=require(_0x4a08('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4a08('0x10'));var as=require(_0x4a08('0x11'));var hardwareService=require(_0x4a08('0x12'));var logger=require(_0x4a08('0x13'))(_0x4a08('0x14'));var utils=require(_0x4a08('0x15'));var config=require('../../config/environment');var db=require(_0x4a08('0x16'))['db'];function respondWithStatusCode(_0x117070,_0x5daf40){_0x5daf40=_0x5daf40||0xcc;return function(_0x236b8e){if(_0x236b8e){return _0x117070['sendStatus'](_0x5daf40);}return _0x117070[_0x4a08('0x17')](_0x5daf40)[_0x4a08('0x18')]();};}function respondWithResult(_0x26c063,_0x26a54a){_0x26a54a=_0x26a54a||0xc8;return function(_0x4beca4){if(_0x4beca4){return _0x26c063[_0x4a08('0x17')](_0x26a54a)[_0x4a08('0x19')](_0x4beca4);}};}function respondWithFilteredResult(_0x13cec1,_0x14063d){return function(_0x539890){if(_0x539890){var _0x1df5d1=_0x539890[_0x4a08('0x1a')],_0x5642f6=_0x14063d['offset'],_0x588cd4=_0x14063d[_0x4a08('0x1b')]+_0x14063d[_0x4a08('0x1c')],_0x39480d;if(_0x588cd4>=_0x1df5d1){_0x588cd4=_0x1df5d1;_0x39480d=0xc8;}else{_0x39480d=0xce;}_0x13cec1[_0x4a08('0x17')](_0x39480d);return _0x13cec1['set'](_0x4a08('0x1d'),_0x5642f6+'-'+_0x588cd4+'/'+_0x1df5d1)[_0x4a08('0x19')](_0x539890);}return null;};}function patchUpdates(_0xc92736){return function(_0x179758){try{jsonpatch[_0x4a08('0x1e')](_0x179758,_0xc92736,!![]);}catch(_0x5d30fa){return BPromise[_0x4a08('0x1f')](_0x5d30fa);}return _0x179758[_0x4a08('0x20')]();};}function saveUpdates(_0x4b1ea2,_0x55bc4d){return function(_0x3c6129){if(_0x3c6129){return _0x3c6129['update'](_0x4b1ea2)[_0x4a08('0x21')](function(_0x73e724){return _0x73e724;});}return null;};}function removeEntity(_0x15b3eb,_0x1c908b){return function(_0x8efc02){if(_0x8efc02){return _0x8efc02[_0x4a08('0x22')]()[_0x4a08('0x21')](function(){var _0x4195a1=_0x8efc02[_0x4a08('0x23')]({'plain':!![]});var _0x22faa5=_0x4a08('0x24');return db[_0x4a08('0x25')][_0x4a08('0x22')]({'where':{'type':_0x22faa5,'resourceId':_0x4195a1['id']}})['then'](function(){return _0x8efc02;});})[_0x4a08('0x21')](function(){_0x15b3eb[_0x4a08('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21956a,_0x1495bb){return function(_0x3dac61){if(!_0x3dac61){_0x21956a[_0x4a08('0x26')](0x194);}return _0x3dac61;};}function handleError(_0xda4e4b,_0x15ae1f){_0x15ae1f=_0x15ae1f||0x1f4;return function(_0x3b7500){logger[_0x4a08('0x27')](_0x3b7500[_0x4a08('0x28')]);if(_0x3b7500[_0x4a08('0x29')]){delete _0x3b7500[_0x4a08('0x29')];}_0xda4e4b['status'](_0x15ae1f)[_0x4a08('0x2a')](_0x3b7500);};}exports[_0x4a08('0x2b')]=function(_0x471f0e,_0x31fbb2){var _0x530975={},_0x5a9de7={},_0x56d5fe={'count':0x0,'rows':[]};var _0x5c65dd=_[_0x4a08('0x2c')](db['CmContactHasPhone']['rawAttributes'],function(_0x408474){return{'name':_0x408474[_0x4a08('0x2d')],'type':_0x408474['type']['key']};});_0x5a9de7[_0x4a08('0x2e')]=_[_0x4a08('0x2c')](_0x5c65dd,_0x4a08('0x29'));_0x5a9de7[_0x4a08('0x2f')]=_['keys'](_0x471f0e['query']);_0x5a9de7['filters']=_[_0x4a08('0x30')](_0x5a9de7[_0x4a08('0x2e')],_0x5a9de7[_0x4a08('0x2f')]);_0x530975[_0x4a08('0x31')]=_['intersection'](_0x5a9de7['model'],qs[_0x4a08('0x32')](_0x471f0e[_0x4a08('0x2f')][_0x4a08('0x32')]));_0x530975['attributes']=_0x530975[_0x4a08('0x31')][_0x4a08('0x33')]?_0x530975['attributes']:_0x5a9de7[_0x4a08('0x2e')];if(!_0x471f0e[_0x4a08('0x2f')][_0x4a08('0x34')](_0x4a08('0x35'))){_0x530975['limit']=qs[_0x4a08('0x1c')](_0x471f0e[_0x4a08('0x2f')]['limit']);_0x530975[_0x4a08('0x1b')]=qs[_0x4a08('0x1b')](_0x471f0e['query'][_0x4a08('0x1b')]);}_0x530975[_0x4a08('0x36')]=qs[_0x4a08('0x37')](_0x471f0e[_0x4a08('0x2f')][_0x4a08('0x37')]);_0x530975[_0x4a08('0x38')]=qs[_0x4a08('0x39')](_[_0x4a08('0x3a')](_0x471f0e[_0x4a08('0x2f')],_0x5a9de7[_0x4a08('0x39')]),_0x5c65dd);if(_0x471f0e[_0x4a08('0x2f')][_0x4a08('0x3b')]){_0x530975[_0x4a08('0x38')]=_[_0x4a08('0x3c')](_0x530975[_0x4a08('0x38')],{'$or':_[_0x4a08('0x2c')](_0x5c65dd,function(_0x1b3048){if(_0x1b3048['type']!==_0x4a08('0x3d')){var _0x4265c5={};_0x4265c5[_0x1b3048[_0x4a08('0x29')]]={'$like':'%'+_0x471f0e[_0x4a08('0x2f')][_0x4a08('0x3b')]+'%'};return _0x4265c5;}})});}_0x530975=_['merge']({},_0x530975,_0x471f0e['options']);var _0xd97290={'where':_0x530975[_0x4a08('0x38')]};return db[_0x4a08('0x3e')][_0x4a08('0x1a')](_0xd97290)[_0x4a08('0x21')](function(_0xba5ec){_0x56d5fe[_0x4a08('0x1a')]=_0xba5ec;if(_0x471f0e[_0x4a08('0x2f')][_0x4a08('0x3f')]){_0x530975[_0x4a08('0x40')]=[{'all':!![]}];}return db[_0x4a08('0x3e')][_0x4a08('0x41')](_0x530975);})[_0x4a08('0x21')](function(_0x1bbc18){_0x56d5fe[_0x4a08('0x42')]=_0x1bbc18;return _0x56d5fe;})[_0x4a08('0x21')](respondWithFilteredResult(_0x31fbb2,_0x530975))['catch'](handleError(_0x31fbb2,null));};exports[_0x4a08('0x43')]=function(_0x564700,_0x1d1447){var _0x567990={'raw':!![],'where':{'id':_0x564700[_0x4a08('0x44')]['id']}},_0x19b141={};_0x19b141[_0x4a08('0x2e')]=_['keys'](db['CmContactHasPhone'][_0x4a08('0x45')]);_0x19b141[_0x4a08('0x2f')]=_[_0x4a08('0x46')](_0x564700['query']);_0x19b141['filters']=_[_0x4a08('0x30')](_0x19b141[_0x4a08('0x2e')],_0x19b141[_0x4a08('0x2f')]);_0x567990[_0x4a08('0x31')]=_[_0x4a08('0x30')](_0x19b141['model'],qs[_0x4a08('0x32')](_0x564700['query']['fields']));_0x567990[_0x4a08('0x31')]=_0x567990['attributes'][_0x4a08('0x33')]?_0x567990[_0x4a08('0x31')]:_0x19b141['model'];if(_0x564700['query']['includeAll']){_0x567990[_0x4a08('0x40')]=[{'all':!![]}];}_0x567990=_['merge']({},_0x567990,_0x564700[_0x4a08('0x47')]);return db[_0x4a08('0x3e')][_0x4a08('0x48')](_0x567990)[_0x4a08('0x21')](handleEntityNotFound(_0x1d1447,null))[_0x4a08('0x21')](respondWithResult(_0x1d1447,null))[_0x4a08('0x49')](handleError(_0x1d1447,null));};exports['create']=function(_0x1cb230,_0xd6d61e){return db['CmContactHasPhone']['create'](_0x1cb230[_0x4a08('0x4a')],{})[_0x4a08('0x21')](function(_0x507107){var _0x8975c9=_0x1cb230[_0x4a08('0x4b')]['get']({'plain':!![]});if(!_0x8975c9)throw new Error(_0x4a08('0x4c'));if(_0x8975c9[_0x4a08('0x4d')]===_0x4a08('0x4b')){var _0xf612b1=_0x507107['get']({'plain':!![]});var _0x379ac8=_0x4a08('0x24');return db['UserProfileSection'][_0x4a08('0x48')]({'where':{'name':_0x379ac8,'userProfileId':_0x8975c9[_0x4a08('0x4e')]},'raw':!![]})[_0x4a08('0x21')](function(_0x46a046){if(_0x46a046&&_0x46a046[_0x4a08('0x4f')]===0x0){return db['UserProfileResource'][_0x4a08('0x50')]({'name':_0xf612b1['name'],'resourceId':_0xf612b1['id'],'type':_0x46a046[_0x4a08('0x29')],'sectionId':_0x46a046['id']},{})[_0x4a08('0x21')](function(){return _0x507107;});}else{return _0x507107;}})['catch'](function(_0x4e5157){logger[_0x4a08('0x27')](_0x4a08('0x51'),_0x4e5157);throw _0x4e5157;});}return _0x507107;})[_0x4a08('0x21')](respondWithResult(_0xd6d61e,0xc9))[_0x4a08('0x49')](handleError(_0xd6d61e,null));};exports[_0x4a08('0x52')]=function(_0x69665a,_0x1baad7){if(_0x69665a[_0x4a08('0x4a')]['id']){delete _0x69665a[_0x4a08('0x4a')]['id'];}return db['CmContactHasPhone'][_0x4a08('0x48')]({'where':{'id':_0x69665a[_0x4a08('0x44')]['id']}})[_0x4a08('0x21')](handleEntityNotFound(_0x1baad7,null))[_0x4a08('0x21')](saveUpdates(_0x69665a[_0x4a08('0x4a')],null))['then'](respondWithResult(_0x1baad7,null))[_0x4a08('0x49')](handleError(_0x1baad7,null));};exports[_0x4a08('0x22')]=function(_0x4c7158,_0x8143a2){return db[_0x4a08('0x3e')][_0x4a08('0x48')]({'where':{'id':_0x4c7158[_0x4a08('0x44')]['id']}})[_0x4a08('0x21')](handleEntityNotFound(_0x8143a2,null))[_0x4a08('0x21')](removeEntity(_0x8143a2,null))[_0x4a08('0x49')](handleError(_0x8143a2,null));}; \ No newline at end of file +var _0x321f=['UserProfileResource','error','name','send','index','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','CmContactHasPhone','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','CmContactHasPhones'];(function(_0x39e869,_0x2d7972){var _0x508ddd=function(_0x117815){while(--_0x117815){_0x39e869['push'](_0x39e869['shift']());}};_0x508ddd(++_0x2d7972);}(_0x321f,0x78));var _0xf321=function(_0x3f57db,_0x10e075){_0x3f57db=_0x3f57db-0x0;var _0x8cc430=_0x321f[_0x3f57db];return _0x8cc430;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf321('0x0'));var rimraf=require(_0xf321('0x1'));var zipdir=require(_0xf321('0x2'));var jsonpatch=require(_0xf321('0x3'));var rp=require(_0xf321('0x4'));var moment=require(_0xf321('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf321('0x6'));var util=require('util');var path=require(_0xf321('0x7'));var sox=require('sox');var csv=require(_0xf321('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf321('0x9'));var crypto=require(_0xf321('0xa'));var jsforce=require(_0xf321('0xb'));var deskjs=require(_0xf321('0xc'));var toCsv=require(_0xf321('0x8'));var querystring=require(_0xf321('0xd'));var Papa=require(_0xf321('0xe'));var Redis=require(_0xf321('0xf'));var authService=require(_0xf321('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf321('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf321('0x12'))(_0xf321('0x13'));var utils=require(_0xf321('0x14'));var config=require(_0xf321('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46b899,_0x4b1b5d){_0x4b1b5d=_0x4b1b5d||0xcc;return function(_0x5f4df2){if(_0x5f4df2){return _0x46b899[_0xf321('0x16')](_0x4b1b5d);}return _0x46b899['status'](_0x4b1b5d)[_0xf321('0x17')]();};}function respondWithResult(_0x4228c1,_0x1b0d99){_0x1b0d99=_0x1b0d99||0xc8;return function(_0x33e33b){if(_0x33e33b){return _0x4228c1[_0xf321('0x18')](_0x1b0d99)[_0xf321('0x19')](_0x33e33b);}};}function respondWithFilteredResult(_0x4c645c,_0x20f7d0){return function(_0x10509c){if(_0x10509c){var _0x1c6d5e=_0x10509c[_0xf321('0x1a')],_0x49fbb6=_0x20f7d0[_0xf321('0x1b')],_0x5032df=_0x20f7d0[_0xf321('0x1b')]+_0x20f7d0[_0xf321('0x1c')],_0x5ce4e9;if(_0x5032df>=_0x1c6d5e){_0x5032df=_0x1c6d5e;_0x5ce4e9=0xc8;}else{_0x5ce4e9=0xce;}_0x4c645c['status'](_0x5ce4e9);return _0x4c645c[_0xf321('0x1d')]('Content-Range',_0x49fbb6+'-'+_0x5032df+'/'+_0x1c6d5e)[_0xf321('0x19')](_0x10509c);}return null;};}function patchUpdates(_0x39126c){return function(_0xa8be93){try{jsonpatch[_0xf321('0x1e')](_0xa8be93,_0x39126c,!![]);}catch(_0x1f2b64){return BPromise[_0xf321('0x1f')](_0x1f2b64);}return _0xa8be93[_0xf321('0x20')]();};}function saveUpdates(_0x4cfda3,_0x344af3){return function(_0x4ca000){if(_0x4ca000){return _0x4ca000[_0xf321('0x21')](_0x4cfda3)[_0xf321('0x22')](function(_0x4d376f){return _0x4d376f;});}return null;};}function removeEntity(_0x1653e2,_0x14b33d){return function(_0x5d56e0){if(_0x5d56e0){return _0x5d56e0[_0xf321('0x23')]()[_0xf321('0x22')](function(){var _0x52248b=_0x5d56e0[_0xf321('0x24')]({'plain':!![]});var _0x420873=_0xf321('0x25');return db[_0xf321('0x26')][_0xf321('0x23')]({'where':{'type':_0x420873,'resourceId':_0x52248b['id']}})[_0xf321('0x22')](function(){return _0x5d56e0;});})[_0xf321('0x22')](function(){_0x1653e2[_0xf321('0x18')](0xcc)[_0xf321('0x17')]();});}};}function handleEntityNotFound(_0x487b0b,_0x145417){return function(_0x3335ca){if(!_0x3335ca){_0x487b0b[_0xf321('0x16')](0x194);}return _0x3335ca;};}function handleError(_0x218ae1,_0x4834c6){_0x4834c6=_0x4834c6||0x1f4;return function(_0x155efd){logger[_0xf321('0x27')](_0x155efd['stack']);if(_0x155efd[_0xf321('0x28')]){delete _0x155efd[_0xf321('0x28')];}_0x218ae1[_0xf321('0x18')](_0x4834c6)[_0xf321('0x29')](_0x155efd);};}exports[_0xf321('0x2a')]=function(_0x571561,_0x31a1f0){var _0x81380d={},_0x156fc9={},_0xfa54ec={'count':0x0,'rows':[]};var _0x354001=_['map'](db['CmContactHasPhone'][_0xf321('0x2b')],function(_0x5d8cf6){return{'name':_0x5d8cf6['fieldName'],'type':_0x5d8cf6['type'][_0xf321('0x2c')]};});_0x156fc9[_0xf321('0x2d')]=_[_0xf321('0x2e')](_0x354001,_0xf321('0x28'));_0x156fc9['query']=_[_0xf321('0x2f')](_0x571561[_0xf321('0x30')]);_0x156fc9[_0xf321('0x31')]=_[_0xf321('0x32')](_0x156fc9[_0xf321('0x2d')],_0x156fc9[_0xf321('0x30')]);_0x81380d[_0xf321('0x33')]=_[_0xf321('0x32')](_0x156fc9[_0xf321('0x2d')],qs[_0xf321('0x34')](_0x571561['query'][_0xf321('0x34')]));_0x81380d[_0xf321('0x33')]=_0x81380d['attributes'][_0xf321('0x35')]?_0x81380d[_0xf321('0x33')]:_0x156fc9['model'];if(!_0x571561[_0xf321('0x30')][_0xf321('0x36')]('nolimit')){_0x81380d[_0xf321('0x1c')]=qs[_0xf321('0x1c')](_0x571561[_0xf321('0x30')][_0xf321('0x1c')]);_0x81380d[_0xf321('0x1b')]=qs['offset'](_0x571561[_0xf321('0x30')][_0xf321('0x1b')]);}_0x81380d[_0xf321('0x37')]=qs['sort'](_0x571561[_0xf321('0x30')][_0xf321('0x38')]);_0x81380d[_0xf321('0x39')]=qs[_0xf321('0x31')](_[_0xf321('0x3a')](_0x571561[_0xf321('0x30')],_0x156fc9[_0xf321('0x31')]),_0x354001);if(_0x571561[_0xf321('0x30')][_0xf321('0x3b')]){_0x81380d[_0xf321('0x39')]=_[_0xf321('0x3c')](_0x81380d[_0xf321('0x39')],{'$or':_[_0xf321('0x2e')](_0x354001,function(_0x29f953){if(_0x29f953[_0xf321('0x3d')]!=='VIRTUAL'){var _0x3c969e={};_0x3c969e[_0x29f953[_0xf321('0x28')]]={'$like':'%'+_0x571561[_0xf321('0x30')]['filter']+'%'};return _0x3c969e;}})});}_0x81380d=_[_0xf321('0x3c')]({},_0x81380d,_0x571561[_0xf321('0x3e')]);var _0x1efc56={'where':_0x81380d[_0xf321('0x39')]};return db['CmContactHasPhone'][_0xf321('0x1a')](_0x1efc56)[_0xf321('0x22')](function(_0x33761a){_0xfa54ec['count']=_0x33761a;if(_0x571561['query'][_0xf321('0x3f')]){_0x81380d[_0xf321('0x40')]=[{'all':!![]}];}return db['CmContactHasPhone'][_0xf321('0x41')](_0x81380d);})['then'](function(_0x20beaa){_0xfa54ec[_0xf321('0x42')]=_0x20beaa;return _0xfa54ec;})[_0xf321('0x22')](respondWithFilteredResult(_0x31a1f0,_0x81380d))['catch'](handleError(_0x31a1f0,null));};exports[_0xf321('0x43')]=function(_0x54b048,_0x185b30){var _0x1b2a77={'raw':!![],'where':{'id':_0x54b048[_0xf321('0x44')]['id']}},_0x51c848={};_0x51c848[_0xf321('0x2d')]=_[_0xf321('0x2f')](db[_0xf321('0x45')][_0xf321('0x2b')]);_0x51c848[_0xf321('0x30')]=_[_0xf321('0x2f')](_0x54b048['query']);_0x51c848['filters']=_[_0xf321('0x32')](_0x51c848[_0xf321('0x2d')],_0x51c848['query']);_0x1b2a77[_0xf321('0x33')]=_[_0xf321('0x32')](_0x51c848[_0xf321('0x2d')],qs[_0xf321('0x34')](_0x54b048['query'][_0xf321('0x34')]));_0x1b2a77['attributes']=_0x1b2a77[_0xf321('0x33')][_0xf321('0x35')]?_0x1b2a77['attributes']:_0x51c848[_0xf321('0x2d')];if(_0x54b048[_0xf321('0x30')][_0xf321('0x3f')]){_0x1b2a77['include']=[{'all':!![]}];}_0x1b2a77=_[_0xf321('0x3c')]({},_0x1b2a77,_0x54b048[_0xf321('0x3e')]);return db[_0xf321('0x45')]['find'](_0x1b2a77)[_0xf321('0x22')](handleEntityNotFound(_0x185b30,null))['then'](respondWithResult(_0x185b30,null))[_0xf321('0x46')](handleError(_0x185b30,null));};exports[_0xf321('0x47')]=function(_0x4939a6,_0x4e3795){return db[_0xf321('0x45')][_0xf321('0x47')](_0x4939a6[_0xf321('0x48')],{})['then'](function(_0x1e5138){var _0x5b0415=_0x4939a6[_0xf321('0x49')]['get']({'plain':!![]});if(!_0x5b0415)throw new Error(_0xf321('0x4a'));if(_0x5b0415['role']===_0xf321('0x49')){var _0x2fbb93=_0x1e5138[_0xf321('0x24')]({'plain':!![]});var _0x34e18b='CmContactHasPhones';return db['UserProfileSection'][_0xf321('0x4b')]({'where':{'name':_0x34e18b,'userProfileId':_0x5b0415[_0xf321('0x4c')]},'raw':!![]})['then'](function(_0x5f41b1){if(_0x5f41b1&&_0x5f41b1[_0xf321('0x4d')]===0x0){return db['UserProfileResource'][_0xf321('0x47')]({'name':_0x2fbb93[_0xf321('0x28')],'resourceId':_0x2fbb93['id'],'type':_0x5f41b1[_0xf321('0x28')],'sectionId':_0x5f41b1['id']},{})[_0xf321('0x22')](function(){return _0x1e5138;});}else{return _0x1e5138;}})['catch'](function(_0x113dfe){logger[_0xf321('0x27')](_0xf321('0x4e'),_0x113dfe);throw _0x113dfe;});}return _0x1e5138;})['then'](respondWithResult(_0x4e3795,0xc9))[_0xf321('0x46')](handleError(_0x4e3795,null));};exports[_0xf321('0x21')]=function(_0x3affff,_0x5771f0){if(_0x3affff[_0xf321('0x48')]['id']){delete _0x3affff[_0xf321('0x48')]['id'];}return db[_0xf321('0x45')][_0xf321('0x4b')]({'where':{'id':_0x3affff[_0xf321('0x44')]['id']}})['then'](handleEntityNotFound(_0x5771f0,null))[_0xf321('0x22')](saveUpdates(_0x3affff[_0xf321('0x48')],null))[_0xf321('0x22')](respondWithResult(_0x5771f0,null))[_0xf321('0x46')](handleError(_0x5771f0,null));};exports[_0xf321('0x23')]=function(_0x350bbe,_0x3ac524){return db['CmContactHasPhone'][_0xf321('0x4b')]({'where':{'id':_0x350bbe['params']['id']}})[_0xf321('0x22')](handleEntityNotFound(_0x3ac524,null))[_0xf321('0x22')](removeEntity(_0x3ac524,null))['catch'](handleError(_0x3ac524,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.model.js b/server/api/cmContactHasPhone/cmContactHasPhone.model.js index 3e56c7b..4066149 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 _0xd3a6=['cm_contact_has_phones','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','CmContactHasPhone'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd3a6,0x181));var _0x6d3a=function(_0x341604,_0xa7bb93){_0x341604=_0x341604-0x0;var _0x2b6946=_0xd3a6[_0x341604];return _0x2b6946;};'use strict';var _=require(_0x6d3a('0x0'));var util=require('util');var logger=require(_0x6d3a('0x1'))(_0x6d3a('0x2'));var moment=require(_0x6d3a('0x3'));var BPromise=require(_0x6d3a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d3a('0x5'));var rimraf=require(_0x6d3a('0x6'));var config=require(_0x6d3a('0x7'));var attributes=require('./cmContactHasPhone.attributes');module[_0x6d3a('0x8')]=function(_0x41951b,_0x536a70){return _0x41951b[_0x6d3a('0x9')](_0x6d3a('0xa'),attributes,{'tableName':_0x6d3a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x579b=['moment','bluebird','request-promise','../../config/environment','./cmContactHasPhone.attributes','exports','CmContactHasPhone','cm_contact_has_phones','util'];(function(_0x2e7f07,_0x4cbab5){var _0x530477=function(_0x20c704){while(--_0x20c704){_0x2e7f07['push'](_0x2e7f07['shift']());}};_0x530477(++_0x4cbab5);}(_0x579b,0xbc));var _0xb579=function(_0x5c7e53,_0x174ce5){_0x5c7e53=_0x5c7e53-0x0;var _0x1c9af9=_0x579b[_0x5c7e53];return _0x1c9af9;};'use strict';var _=require('lodash');var util=require(_0xb579('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb579('0x1'));var BPromise=require(_0xb579('0x2'));var rp=require(_0xb579('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb579('0x4'));var attributes=require(_0xb579('0x5'));module[_0xb579('0x6')]=function(_0x593cda,_0x289c41){return _0x593cda['define'](_0xb579('0x7'),attributes,{'tableName':_0xb579('0x8'),'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 5ece8e3..1f7d7bd 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 _0x8294=['../../config/environment','client','http','then','CmContactHasPhone,\x20%s,\x20%s','debug','CmContactHasPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x22c057,_0x11657b){var _0x1d1734=function(_0x401ce2){while(--_0x401ce2){_0x22c057['push'](_0x22c057['shift']());}};_0x1d1734(++_0x11657b);}(_0x8294,0x1c6));var _0x4829=function(_0x369302,_0x5c41f4){_0x369302=_0x369302-0x0;var _0x49621b=_0x8294[_0x369302];return _0x49621b;};'use strict';var _=require(_0x4829('0x0'));var util=require(_0x4829('0x1'));var moment=require('moment');var BPromise=require(_0x4829('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4829('0x3'))['db'];var utils=require(_0x4829('0x4'));var logger=require(_0x4829('0x5'))('rpc');var config=require(_0x4829('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4829('0x7')][_0x4829('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x396b85,_0x4c4125,_0x1dc608){return new BPromise(function(_0x2d51b1,_0x3a7e4b){return client['request'](_0x396b85,_0x1dc608)[_0x4829('0x9')](function(_0x298b45){logger['info'](_0x4829('0xa'),_0x4c4125,'request\x20sent');logger[_0x4829('0xb')](_0x4829('0xc'),_0x4c4125,_0x4829('0xd'),JSON[_0x4829('0xe')](_0x298b45));if(_0x298b45['error']){if(_0x298b45[_0x4829('0xf')][_0x4829('0x10')]===0x1f4){logger[_0x4829('0xf')](_0x4829('0xa'),_0x4c4125,_0x298b45[_0x4829('0xf')][_0x4829('0x11')]);return _0x3a7e4b(_0x298b45['error'][_0x4829('0x11')]);}logger[_0x4829('0xf')](_0x4829('0xa'),_0x4c4125,_0x298b45[_0x4829('0xf')][_0x4829('0x11')]);return _0x2d51b1(_0x298b45[_0x4829('0xf')][_0x4829('0x11')]);}else{logger['info'](_0x4829('0xa'),_0x4c4125,'request\x20sent');_0x2d51b1(_0x298b45[_0x4829('0x12')][_0x4829('0x11')]);}})[_0x4829('0x13')](function(_0x4caf54){logger['error'](_0x4829('0xa'),_0x4c4125,_0x4caf54);_0x3a7e4b(_0x4caf54);});});} \ No newline at end of file +var _0x0d64=['error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmContactHasPhone,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x44fd42,_0x452c59){var _0x3ee59f=function(_0x194690){while(--_0x194690){_0x44fd42['push'](_0x44fd42['shift']());}};_0x3ee59f(++_0x452c59);}(_0x0d64,0xad));var _0x40d6=function(_0x1d8b31,_0xef220e){_0x1d8b31=_0x1d8b31-0x0;var _0x2548ce=_0x0d64[_0x1d8b31];return _0x2548ce;};'use strict';var _=require(_0x40d6('0x0'));var util=require(_0x40d6('0x1'));var moment=require(_0x40d6('0x2'));var BPromise=require(_0x40d6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40d6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x40d6('0x5'));var logger=require(_0x40d6('0x6'))(_0x40d6('0x7'));var config=require(_0x40d6('0x8'));var jayson=require(_0x40d6('0x9'));var client=jayson[_0x40d6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x283147,_0x1ae4fa,_0x2da2b4){return new BPromise(function(_0x21685a,_0x55a9f9){return client[_0x40d6('0xb')](_0x283147,_0x2da2b4)[_0x40d6('0xc')](function(_0x53d005){logger['info'](_0x40d6('0xd'),_0x1ae4fa,_0x40d6('0xe'));logger[_0x40d6('0xf')]('CmContactHasPhone,\x20%s,\x20%s,\x20%s',_0x1ae4fa,_0x40d6('0xe'),JSON['stringify'](_0x53d005));if(_0x53d005[_0x40d6('0x10')]){if(_0x53d005[_0x40d6('0x10')]['code']===0x1f4){logger[_0x40d6('0x10')](_0x40d6('0xd'),_0x1ae4fa,_0x53d005[_0x40d6('0x10')][_0x40d6('0x11')]);return _0x55a9f9(_0x53d005[_0x40d6('0x10')]['message']);}logger['error']('CmContactHasPhone,\x20%s,\x20%s',_0x1ae4fa,_0x53d005[_0x40d6('0x10')][_0x40d6('0x11')]);return _0x21685a(_0x53d005[_0x40d6('0x10')][_0x40d6('0x11')]);}else{logger[_0x40d6('0x12')](_0x40d6('0xd'),_0x1ae4fa,_0x40d6('0xe'));_0x21685a(_0x53d005[_0x40d6('0x13')][_0x40d6('0x11')]);}})[_0x40d6('0x14')](function(_0x4092f3){logger[_0x40d6('0x10')](_0x40d6('0xd'),_0x1ae4fa,_0x4092f3);_0x55a9f9(_0x4092f3);});});} \ No newline at end of file diff --git a/server/api/cmContactHasPhone/index.js b/server/api/cmContactHasPhone/index.js index 26c879d..088c823 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 _0x81be=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasPhone.controller','get','isAuthenticated','index','/:id','show','post','destroy','exports','multer','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81be,0x10a));var _0xe81b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x81be[_0x57b54c];return _0x59cc19;};'use strict';var multer=require(_0xe81b('0x0'));var util=require(_0xe81b('0x1'));var path=require(_0xe81b('0x2'));var timeout=require(_0xe81b('0x3'));var express=require(_0xe81b('0x4'));var router=express[_0xe81b('0x5')]();var auth=require(_0xe81b('0x6'));var interaction=require(_0xe81b('0x7'));var config=require(_0xe81b('0x8'));var controller=require(_0xe81b('0x9'));router[_0xe81b('0xa')]('/',auth[_0xe81b('0xb')](),controller[_0xe81b('0xc')]);router[_0xe81b('0xa')](_0xe81b('0xd'),auth[_0xe81b('0xb')](),controller[_0xe81b('0xe')]);router[_0xe81b('0xf')]('/',auth[_0xe81b('0xb')](),controller['create']);router['put']('/:id',auth[_0xe81b('0xb')](),controller['update']);router['delete'](_0xe81b('0xd'),auth[_0xe81b('0xb')](),controller[_0xe81b('0x10')]);module[_0xe81b('0x11')]=router; \ No newline at end of file +var _0x4d89=['connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','create','put','destroy','exports','multer','util','path'];(function(_0x56a803,_0x43cc5b){var _0x58fc48=function(_0x2fe19c){while(--_0x2fe19c){_0x56a803['push'](_0x56a803['shift']());}};_0x58fc48(++_0x43cc5b);}(_0x4d89,0xdd));var _0x94d8=function(_0x3d5a2a,_0x1e9dec){_0x3d5a2a=_0x3d5a2a-0x0;var _0x2820ca=_0x4d89[_0x3d5a2a];return _0x2820ca;};'use strict';var multer=require(_0x94d8('0x0'));var util=require(_0x94d8('0x1'));var path=require(_0x94d8('0x2'));var timeout=require(_0x94d8('0x3'));var express=require(_0x94d8('0x4'));var router=express[_0x94d8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x94d8('0x6'));var config=require('../../config/environment');var controller=require('./cmContactHasPhone.controller');router[_0x94d8('0x7')]('/',auth[_0x94d8('0x8')](),controller[_0x94d8('0x9')]);router[_0x94d8('0x7')](_0x94d8('0xa'),auth[_0x94d8('0x8')](),controller[_0x94d8('0xb')]);router['post']('/',auth[_0x94d8('0x8')](),controller[_0x94d8('0xc')]);router[_0x94d8('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x94d8('0xe')]);module[_0x94d8('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index c791cc9..fcc924e 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 _0xe39e=['setDataValue','getDataValue','long','type','select','parse','values','stringify','BOOLEAN','sequelize','exports','alias','STRING'];(function(_0x34c8bf,_0x3c9a44){var _0x2c5a61=function(_0x3ccd72){while(--_0x3ccd72){_0x34c8bf['push'](_0x34c8bf['shift']());}};_0x2c5a61(++_0x3c9a44);}(_0xe39e,0x71));var _0xee39=function(_0x48fb10,_0xa50a89){_0x48fb10=_0x48fb10-0x0;var _0x534251=_0xe39e[_0x48fb10];return _0x534251;};'use strict';var Sequelize=require(_0xee39('0x0'));var _=require('lodash');module[_0xee39('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x488290){return this['getDataValue'](_0xee39('0x2'));}},'alias':{'type':Sequelize[_0xee39('0x3')],'allowNull':![],'set':function(_0x3fd485){this[_0xee39('0x4')](_0xee39('0x2'),_0x3fd485?_0x3fd485:this[_0xee39('0x5')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xee39('0x6')),'get':function(){if(this['getDataValue'](_0xee39('0x7'))===_0xee39('0x8')){return JSON[_0xee39('0x9')](this[_0xee39('0x5')](_0xee39('0xa')));}else{return this['getDataValue'](_0xee39('0xa'));}},'set':function(_0x571b22){if(Array['isArray'](_0x571b22)){this[_0xee39('0x4')]('values',JSON[_0xee39('0xb')](_0x571b22));}else{this[_0xee39('0x4')](_0xee39('0xa'),_0x571b22);}}},'required':{'type':Sequelize[_0xee39('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x4273=['name','long','select','parse','values','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x4273,0x7d));var _0x3427=function(_0x5c8226,_0x43eff3){_0x5c8226=_0x5c8226-0x0;var _0xe07bfc=_0x4273[_0x5c8226];return _0xe07bfc;};'use strict';var Sequelize=require(_0x3427('0x0'));var _=require(_0x3427('0x1'));module['exports']={'name':{'type':Sequelize[_0x3427('0x2')],'get':function(_0x47fe60){return this[_0x3427('0x3')](_0x3427('0x4'));}},'alias':{'type':Sequelize[_0x3427('0x5')],'allowNull':![],'set':function(_0x50bad6){this[_0x3427('0x6')](_0x3427('0x4'),_0x50bad6?_0x50bad6:this[_0x3427('0x3')](_0x3427('0x7')));}},'type':{'type':Sequelize[_0x3427('0x5')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0x3427('0x8')),'get':function(){if(this[_0x3427('0x3')]('type')===_0x3427('0x9')){return JSON[_0x3427('0xa')](this[_0x3427('0x3')](_0x3427('0xb')));}else{return this[_0x3427('0x3')]('values');}},'set':function(_0x2b19db){if(Array['isArray'](_0x2b19db)){this[_0x3427('0x6')](_0x3427('0xb'),JSON['stringify'](_0x2b19db));}else{this[_0x3427('0x6')]('values',_0x2b19db);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 713050e..f876625 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 _0x2e8f=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','save','then','destroy','stack','name','send','index','map','CmCustomField','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','update','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','crypto','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x7ea795,_0x62c69a){var _0x521100=function(_0x2351c0){while(--_0x2351c0){_0x7ea795['push'](_0x7ea795['shift']());}};_0x521100(++_0x62c69a);}(_0x2e8f,0x138));var _0xf2e8=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x2e8f[_0x21549c];return _0x426cbd;};'use strict';var pdf=require(_0xf2e8('0x0'));var emlformat=require(_0xf2e8('0x1'));var rimraf=require(_0xf2e8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf2e8('0x3'));var rp=require(_0xf2e8('0x4'));var moment=require('moment');var BPromise=require(_0xf2e8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf2e8('0x6'));var sox=require(_0xf2e8('0x7'));var csv=require(_0xf2e8('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf2e8('0x9'));var squel=require('squel');var crypto=require(_0xf2e8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf2e8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf2e8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf2e8('0xd'));var as=require(_0xf2e8('0xe'));var hardwareService=require(_0xf2e8('0xf'));var logger=require(_0xf2e8('0x10'))(_0xf2e8('0x11'));var utils=require(_0xf2e8('0x12'));var config=require(_0xf2e8('0x13'));var db=require(_0xf2e8('0x14'))['db'];function respondWithStatusCode(_0x1f7c04,_0x3c5217){_0x3c5217=_0x3c5217||0xcc;return function(_0x2478cf){if(_0x2478cf){return _0x1f7c04[_0xf2e8('0x15')](_0x3c5217);}return _0x1f7c04[_0xf2e8('0x16')](_0x3c5217)[_0xf2e8('0x17')]();};}function respondWithResult(_0x222776,_0xff8c1d){_0xff8c1d=_0xff8c1d||0xc8;return function(_0x2bb301){if(_0x2bb301){return _0x222776[_0xf2e8('0x16')](_0xff8c1d)['json'](_0x2bb301);}};}function respondWithFilteredResult(_0x3a3c14,_0x5386c7){return function(_0x51f3fd){if(_0x51f3fd){var _0x45fb18=_0x51f3fd[_0xf2e8('0x18')],_0x245a70=_0x5386c7[_0xf2e8('0x19')],_0x2f30b5=_0x5386c7[_0xf2e8('0x19')]+_0x5386c7[_0xf2e8('0x1a')],_0x3dd511;if(_0x2f30b5>=_0x45fb18){_0x2f30b5=_0x45fb18;_0x3dd511=0xc8;}else{_0x3dd511=0xce;}_0x3a3c14[_0xf2e8('0x16')](_0x3dd511);return _0x3a3c14['set'](_0xf2e8('0x1b'),_0x245a70+'-'+_0x2f30b5+'/'+_0x45fb18)[_0xf2e8('0x1c')](_0x51f3fd);}return null;};}function patchUpdates(_0x5c9710){return function(_0x3b273d){try{jsonpatch['apply'](_0x3b273d,_0x5c9710,!![]);}catch(_0x3c9c89){return BPromise['reject'](_0x3c9c89);}return _0x3b273d[_0xf2e8('0x1d')]();};}function saveUpdates(_0x371df7,_0x272ee1){return function(_0x5e8be0){if(_0x5e8be0){return _0x5e8be0['update'](_0x371df7)[_0xf2e8('0x1e')](function(_0x4a244f){return _0x4a244f;});}return null;};}function removeEntity(_0x142853,_0x1ec257){return function(_0x39d933){if(_0x39d933){return _0x39d933[_0xf2e8('0x1f')]()['then'](function(){_0x142853[_0xf2e8('0x16')](0xcc)[_0xf2e8('0x17')]();});}};}function handleEntityNotFound(_0x5a9d44,_0x10a267){return function(_0x5f2a3b){if(!_0x5f2a3b){_0x5a9d44[_0xf2e8('0x15')](0x194);}return _0x5f2a3b;};}function handleError(_0x27da38,_0x5a64b0){_0x5a64b0=_0x5a64b0||0x1f4;return function(_0x4c9352){logger['error'](_0x4c9352[_0xf2e8('0x20')]);if(_0x4c9352[_0xf2e8('0x21')]){delete _0x4c9352['name'];}_0x27da38[_0xf2e8('0x16')](_0x5a64b0)[_0xf2e8('0x22')](_0x4c9352);};}exports[_0xf2e8('0x23')]=function(_0x26d9ac,_0xe4f3b6){var _0x2d86f4={},_0x560e9c={},_0x20f3fe={'count':0x0,'rows':[]};var _0x8107f9=_[_0xf2e8('0x24')](db[_0xf2e8('0x25')]['rawAttributes'],function(_0x19725f){return{'name':_0x19725f[_0xf2e8('0x26')],'type':_0x19725f[_0xf2e8('0x27')][_0xf2e8('0x28')]};});_0x560e9c[_0xf2e8('0x29')]=_[_0xf2e8('0x2a')](_[_0xf2e8('0x24')](_0x8107f9,_0xf2e8('0x21')),[_0xf2e8('0x21')]);_0x560e9c[_0xf2e8('0x2b')]=_[_0xf2e8('0x2c')](_0x26d9ac[_0xf2e8('0x2b')]);_0x560e9c[_0xf2e8('0x2d')]=_[_0xf2e8('0x2e')](_0x560e9c[_0xf2e8('0x29')],_0x560e9c[_0xf2e8('0x2b')]);_0x2d86f4['attributes']=_[_0xf2e8('0x2e')](_0x560e9c[_0xf2e8('0x29')],qs[_0xf2e8('0x2f')](_0x26d9ac[_0xf2e8('0x2b')][_0xf2e8('0x2f')]));_0x2d86f4[_0xf2e8('0x30')]=_0x2d86f4[_0xf2e8('0x30')][_0xf2e8('0x31')]?_0x2d86f4[_0xf2e8('0x30')]:_0x560e9c[_0xf2e8('0x29')];if(!_0x26d9ac[_0xf2e8('0x2b')][_0xf2e8('0x32')](_0xf2e8('0x33'))){_0x2d86f4['limit']=qs['limit'](_0x26d9ac[_0xf2e8('0x2b')][_0xf2e8('0x1a')]);_0x2d86f4['offset']=qs[_0xf2e8('0x19')](_0x26d9ac[_0xf2e8('0x2b')][_0xf2e8('0x19')]);}_0x2d86f4[_0xf2e8('0x34')]=qs[_0xf2e8('0x35')](_0x26d9ac[_0xf2e8('0x2b')]['sort']);_0x2d86f4[_0xf2e8('0x36')]=qs[_0xf2e8('0x2d')](_['pick'](_0x26d9ac['query'],_0x560e9c['filters']),_0x8107f9);if(_0x26d9ac[_0xf2e8('0x2b')][_0xf2e8('0x37')]){_0x2d86f4['where']=_[_0xf2e8('0x38')](_0x2d86f4[_0xf2e8('0x36')],{'$or':_['map'](_0x8107f9,function(_0x1a41ee){if(_0x1a41ee[_0xf2e8('0x27')]!==_0xf2e8('0x39')){var _0x1f40eb={};_0x1f40eb[_0x1a41ee[_0xf2e8('0x21')]]={'$like':'%'+_0x26d9ac[_0xf2e8('0x2b')]['filter']+'%'};return _0x1f40eb;}})});}_0x2d86f4=_[_0xf2e8('0x38')]({},_0x2d86f4,_0x26d9ac['options']);var _0x3e0bff={'where':_0x2d86f4[_0xf2e8('0x36')]};return db[_0xf2e8('0x25')][_0xf2e8('0x18')](_0x3e0bff)['then'](function(_0x56d271){_0x20f3fe[_0xf2e8('0x18')]=_0x56d271;if(_0x26d9ac[_0xf2e8('0x2b')][_0xf2e8('0x3a')]){_0x2d86f4[_0xf2e8('0x3b')]=[{'all':!![]}];}return db[_0xf2e8('0x25')][_0xf2e8('0x3c')](_0x2d86f4);})[_0xf2e8('0x1e')](function(_0x5e226c){_0x20f3fe[_0xf2e8('0x3d')]=_0x5e226c;return _0x20f3fe;})[_0xf2e8('0x1e')](respondWithFilteredResult(_0xe4f3b6,_0x2d86f4))[_0xf2e8('0x3e')](handleError(_0xe4f3b6,null));};exports[_0xf2e8('0x3f')]=function(_0x5e6589,_0x1a386b){var _0x5032a6={'raw':!![],'where':{'id':_0x5e6589[_0xf2e8('0x40')]['id']}},_0x39819c={};_0x39819c['model']=_['keys'](db[_0xf2e8('0x25')][_0xf2e8('0x41')]);_0x39819c[_0xf2e8('0x2b')]=_['keys'](_0x5e6589['query']);_0x39819c[_0xf2e8('0x2d')]=_[_0xf2e8('0x2e')](_0x39819c[_0xf2e8('0x29')],_0x39819c[_0xf2e8('0x2b')]);_0x5032a6[_0xf2e8('0x30')]=_[_0xf2e8('0x2e')](_0x39819c['model'],qs[_0xf2e8('0x2f')](_0x5e6589[_0xf2e8('0x2b')][_0xf2e8('0x2f')]));_0x5032a6[_0xf2e8('0x30')]=_0x5032a6[_0xf2e8('0x30')]['length']?_0x5032a6['attributes']:_0x39819c[_0xf2e8('0x29')];if(_0x5e6589[_0xf2e8('0x2b')][_0xf2e8('0x3a')]){_0x5032a6[_0xf2e8('0x3b')]=[{'all':!![]}];}_0x5032a6=_[_0xf2e8('0x38')]({},_0x5032a6,_0x5e6589[_0xf2e8('0x42')]);return db[_0xf2e8('0x25')][_0xf2e8('0x43')](_0x5032a6)[_0xf2e8('0x1e')](handleEntityNotFound(_0x1a386b,null))['then'](respondWithResult(_0x1a386b,null))[_0xf2e8('0x3e')](handleError(_0x1a386b,null));};exports[_0xf2e8('0x44')]=function(_0x1e7652,_0x5a659f){if(_0x1e7652[_0xf2e8('0x45')]['id']){delete _0x1e7652[_0xf2e8('0x45')]['id'];}return db[_0xf2e8('0x25')][_0xf2e8('0x43')]({'where':{'id':_0x1e7652['params']['id']}})['then'](handleEntityNotFound(_0x5a659f,null))[_0xf2e8('0x1e')](saveUpdates(_0x1e7652[_0xf2e8('0x45')],null))[_0xf2e8('0x1e')](respondWithResult(_0x5a659f,null))[_0xf2e8('0x3e')](handleError(_0x5a659f,null));};exports[_0xf2e8('0x1f')]=function(_0x5b2bd9,_0x2c4a3c){return db[_0xf2e8('0x25')][_0xf2e8('0x43')]({'where':{'id':_0x5b2bd9['params']['id']}})[_0xf2e8('0x1e')](handleEntityNotFound(_0x2c4a3c,null))[_0xf2e8('0x1e')](removeEntity(_0x2c4a3c,null))[_0xf2e8('0x3e')](handleError(_0x2c4a3c,null));};exports[_0xf2e8('0x46')]=function(_0x262411,_0x4dbdfa){var _0xf503aa;return db[_0xf2e8('0x47')][_0xf2e8('0x48')](function(_0x40c56e){return db[_0xf2e8('0x25')][_0xf2e8('0x46')](_0x262411[_0xf2e8('0x45')],{'transaction':_0x40c56e})[_0xf2e8('0x1e')](function(_0x2dedb8){_0xf503aa=_0x2dedb8;var _0x2540aa={'type':db[_0xf2e8('0x49')][_0xf2e8('0x4a')],'transaction':_0x40c56e};switch(_0x262411[_0xf2e8('0x45')]['type']){case _0xf2e8('0x4b'):_0x2540aa[_0xf2e8('0x27')]=db[_0xf2e8('0x49')]['TEXT'];break;case _0xf2e8('0x4c'):_0x2540aa[_0xf2e8('0x27')]=db['Sequelize'][_0xf2e8('0x4d')];break;case _0xf2e8('0x4e'):_0x2540aa[_0xf2e8('0x27')]=db[_0xf2e8('0x49')]['BOOLEAN'];_0x2540aa['defaultValue']=![];break;default:}return db[_0xf2e8('0x47')]['queryInterface']['addColumn'](_0xf2e8('0x4f'),util[_0xf2e8('0x50')](_0xf2e8('0x51'),_0xf503aa['id']),_0x2540aa);})['then'](function(){return _0xf503aa;});})[_0xf2e8('0x1e')](respondWithResult(_0x4dbdfa,0xc9))['catch'](handleError(_0x4dbdfa,null));}; \ No newline at end of file +var _0x050e=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','CmCustomField','include','findAll','rows','catch','show','params','includeAll','find','body','destroy','create','transaction','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','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/environment','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','differenceBy','keys','query','intersection','model','attributes'];(function(_0xfeaa2d,_0x5d864d){var _0x4a8441=function(_0x39133f){while(--_0x39133f){_0xfeaa2d['push'](_0xfeaa2d['shift']());}};_0x4a8441(++_0x5d864d);}(_0x050e,0x12d));var _0xe050=function(_0x4e8079,_0x34f064){_0x4e8079=_0x4e8079-0x0;var _0x3a2069=_0x050e[_0x4e8079];return _0x3a2069;};'use strict';var pdf=require(_0xe050('0x0'));var emlformat=require(_0xe050('0x1'));var rimraf=require(_0xe050('0x2'));var zipdir=require(_0xe050('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe050('0x4'));var BPromise=require(_0xe050('0x5'));var Mustache=require(_0xe050('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe050('0x7'));var csv=require('to-csv');var ejs=require(_0xe050('0x8'));var fs=require('fs');var _=require(_0xe050('0x9'));var squel=require(_0xe050('0xa'));var crypto=require('crypto');var jsforce=require(_0xe050('0xb'));var deskjs=require(_0xe050('0xc'));var toCsv=require(_0xe050('0xd'));var querystring=require(_0xe050('0xe'));var Papa=require(_0xe050('0xf'));var Redis=require(_0xe050('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe050('0x11'));var as=require(_0xe050('0x12'));var hardwareService=require(_0xe050('0x13'));var logger=require(_0xe050('0x14'))(_0xe050('0x15'));var utils=require('../../config/utils');var config=require(_0xe050('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d6c75,_0x5e4e5a){_0x5e4e5a=_0x5e4e5a||0xcc;return function(_0x45d5d3){if(_0x45d5d3){return _0x5d6c75[_0xe050('0x17')](_0x5e4e5a);}return _0x5d6c75[_0xe050('0x18')](_0x5e4e5a)['end']();};}function respondWithResult(_0x203a20,_0x59f210){_0x59f210=_0x59f210||0xc8;return function(_0x5dc4ad){if(_0x5dc4ad){return _0x203a20[_0xe050('0x18')](_0x59f210)[_0xe050('0x19')](_0x5dc4ad);}};}function respondWithFilteredResult(_0x58fecf,_0x520b89){return function(_0x320752){if(_0x320752){var _0x1adec1=_0x320752[_0xe050('0x1a')],_0x18afa0=_0x520b89[_0xe050('0x1b')],_0x48ba76=_0x520b89['offset']+_0x520b89[_0xe050('0x1c')],_0x5abc72;if(_0x48ba76>=_0x1adec1){_0x48ba76=_0x1adec1;_0x5abc72=0xc8;}else{_0x5abc72=0xce;}_0x58fecf[_0xe050('0x18')](_0x5abc72);return _0x58fecf[_0xe050('0x1d')]('Content-Range',_0x18afa0+'-'+_0x48ba76+'/'+_0x1adec1)['json'](_0x320752);}return null;};}function patchUpdates(_0x4654ee){return function(_0x3052f2){try{jsonpatch[_0xe050('0x1e')](_0x3052f2,_0x4654ee,!![]);}catch(_0x3245d7){return BPromise['reject'](_0x3245d7);}return _0x3052f2[_0xe050('0x1f')]();};}function saveUpdates(_0xf605d0,_0x56afd0){return function(_0x4acf37){if(_0x4acf37){return _0x4acf37[_0xe050('0x20')](_0xf605d0)[_0xe050('0x21')](function(_0x36ae16){return _0x36ae16;});}return null;};}function removeEntity(_0x23098b,_0x41be92){return function(_0x317338){if(_0x317338){return _0x317338['destroy']()[_0xe050('0x21')](function(){_0x23098b['status'](0xcc)[_0xe050('0x22')]();});}};}function handleEntityNotFound(_0x382239,_0x59b09f){return function(_0xdd2f4e){if(!_0xdd2f4e){_0x382239['sendStatus'](0x194);}return _0xdd2f4e;};}function handleError(_0x39fc5a,_0x41190b){_0x41190b=_0x41190b||0x1f4;return function(_0x54f3cb){logger[_0xe050('0x23')](_0x54f3cb[_0xe050('0x24')]);if(_0x54f3cb[_0xe050('0x25')]){delete _0x54f3cb[_0xe050('0x25')];}_0x39fc5a[_0xe050('0x18')](_0x41190b)[_0xe050('0x26')](_0x54f3cb);};}exports[_0xe050('0x27')]=function(_0x117944,_0xd903a){var _0xd50f8e={},_0x8773d1={},_0x1a2e2a={'count':0x0,'rows':[]};var _0x4dc412=_[_0xe050('0x28')](db['CmCustomField'][_0xe050('0x29')],function(_0x4c0f17){return{'name':_0x4c0f17[_0xe050('0x2a')],'type':_0x4c0f17[_0xe050('0x2b')][_0xe050('0x2c')]};});_0x8773d1['model']=_[_0xe050('0x2d')](_[_0xe050('0x28')](_0x4dc412,_0xe050('0x25')),[_0xe050('0x25')]);_0x8773d1['query']=_[_0xe050('0x2e')](_0x117944[_0xe050('0x2f')]);_0x8773d1['filters']=_[_0xe050('0x30')](_0x8773d1[_0xe050('0x31')],_0x8773d1[_0xe050('0x2f')]);_0xd50f8e[_0xe050('0x32')]=_['intersection'](_0x8773d1['model'],qs[_0xe050('0x33')](_0x117944[_0xe050('0x2f')][_0xe050('0x33')]));_0xd50f8e[_0xe050('0x32')]=_0xd50f8e['attributes'][_0xe050('0x34')]?_0xd50f8e[_0xe050('0x32')]:_0x8773d1[_0xe050('0x31')];if(!_0x117944[_0xe050('0x2f')][_0xe050('0x35')](_0xe050('0x36'))){_0xd50f8e[_0xe050('0x1c')]=qs[_0xe050('0x1c')](_0x117944['query'][_0xe050('0x1c')]);_0xd50f8e[_0xe050('0x1b')]=qs[_0xe050('0x1b')](_0x117944[_0xe050('0x2f')][_0xe050('0x1b')]);}_0xd50f8e[_0xe050('0x37')]=qs[_0xe050('0x38')](_0x117944['query'][_0xe050('0x38')]);_0xd50f8e[_0xe050('0x39')]=qs[_0xe050('0x3a')](_['pick'](_0x117944[_0xe050('0x2f')],_0x8773d1['filters']),_0x4dc412);if(_0x117944[_0xe050('0x2f')][_0xe050('0x3b')]){_0xd50f8e[_0xe050('0x39')]=_[_0xe050('0x3c')](_0xd50f8e[_0xe050('0x39')],{'$or':_[_0xe050('0x28')](_0x4dc412,function(_0x13cb94){if(_0x13cb94[_0xe050('0x2b')]!==_0xe050('0x3d')){var _0x21e28b={};_0x21e28b[_0x13cb94[_0xe050('0x25')]]={'$like':'%'+_0x117944[_0xe050('0x2f')][_0xe050('0x3b')]+'%'};return _0x21e28b;}})});}_0xd50f8e=_['merge']({},_0xd50f8e,_0x117944[_0xe050('0x3e')]);var _0x4ff52f={'where':_0xd50f8e[_0xe050('0x39')]};return db[_0xe050('0x3f')][_0xe050('0x1a')](_0x4ff52f)[_0xe050('0x21')](function(_0x37e1f0){_0x1a2e2a[_0xe050('0x1a')]=_0x37e1f0;if(_0x117944[_0xe050('0x2f')]['includeAll']){_0xd50f8e[_0xe050('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0xe050('0x41')](_0xd50f8e);})['then'](function(_0x11b623){_0x1a2e2a[_0xe050('0x42')]=_0x11b623;return _0x1a2e2a;})[_0xe050('0x21')](respondWithFilteredResult(_0xd903a,_0xd50f8e))[_0xe050('0x43')](handleError(_0xd903a,null));};exports[_0xe050('0x44')]=function(_0x247c8c,_0x89b2d2){var _0x599f0a={'raw':!![],'where':{'id':_0x247c8c[_0xe050('0x45')]['id']}},_0x149e27={};_0x149e27[_0xe050('0x31')]=_[_0xe050('0x2e')](db[_0xe050('0x3f')][_0xe050('0x29')]);_0x149e27[_0xe050('0x2f')]=_[_0xe050('0x2e')](_0x247c8c[_0xe050('0x2f')]);_0x149e27[_0xe050('0x3a')]=_[_0xe050('0x30')](_0x149e27[_0xe050('0x31')],_0x149e27['query']);_0x599f0a[_0xe050('0x32')]=_[_0xe050('0x30')](_0x149e27[_0xe050('0x31')],qs[_0xe050('0x33')](_0x247c8c[_0xe050('0x2f')][_0xe050('0x33')]));_0x599f0a[_0xe050('0x32')]=_0x599f0a[_0xe050('0x32')][_0xe050('0x34')]?_0x599f0a['attributes']:_0x149e27[_0xe050('0x31')];if(_0x247c8c[_0xe050('0x2f')][_0xe050('0x46')]){_0x599f0a[_0xe050('0x40')]=[{'all':!![]}];}_0x599f0a=_[_0xe050('0x3c')]({},_0x599f0a,_0x247c8c[_0xe050('0x3e')]);return db[_0xe050('0x3f')][_0xe050('0x47')](_0x599f0a)[_0xe050('0x21')](handleEntityNotFound(_0x89b2d2,null))[_0xe050('0x21')](respondWithResult(_0x89b2d2,null))[_0xe050('0x43')](handleError(_0x89b2d2,null));};exports[_0xe050('0x20')]=function(_0x6a31b2,_0x394a9c){if(_0x6a31b2[_0xe050('0x48')]['id']){delete _0x6a31b2[_0xe050('0x48')]['id'];}return db[_0xe050('0x3f')][_0xe050('0x47')]({'where':{'id':_0x6a31b2[_0xe050('0x45')]['id']}})[_0xe050('0x21')](handleEntityNotFound(_0x394a9c,null))[_0xe050('0x21')](saveUpdates(_0x6a31b2[_0xe050('0x48')],null))[_0xe050('0x21')](respondWithResult(_0x394a9c,null))[_0xe050('0x43')](handleError(_0x394a9c,null));};exports[_0xe050('0x49')]=function(_0x3ac594,_0x5043d3){return db[_0xe050('0x3f')]['find']({'where':{'id':_0x3ac594[_0xe050('0x45')]['id']}})['then'](handleEntityNotFound(_0x5043d3,null))[_0xe050('0x21')](removeEntity(_0x5043d3,null))[_0xe050('0x43')](handleError(_0x5043d3,null));};exports[_0xe050('0x4a')]=function(_0x2905fe,_0x3cc036){var _0x431e94;return db['sequelize'][_0xe050('0x4b')](function(_0x267bae){return db[_0xe050('0x3f')][_0xe050('0x4a')](_0x2905fe[_0xe050('0x48')],{'transaction':_0x267bae})[_0xe050('0x21')](function(_0x3cf871){_0x431e94=_0x3cf871;var _0x237f15={'type':db['Sequelize'][_0xe050('0x4c')],'transaction':_0x267bae};switch(_0x2905fe[_0xe050('0x48')][_0xe050('0x2b')]){case _0xe050('0x4d'):_0x237f15[_0xe050('0x2b')]=db[_0xe050('0x4e')][_0xe050('0x4c')];break;case _0xe050('0x4f'):_0x237f15[_0xe050('0x2b')]=db[_0xe050('0x4e')][_0xe050('0x50')];break;case'switch':_0x237f15[_0xe050('0x2b')]=db['Sequelize'][_0xe050('0x51')];_0x237f15[_0xe050('0x52')]=![];break;default:}return db[_0xe050('0x53')][_0xe050('0x54')][_0xe050('0x55')]('cm_contacts',util[_0xe050('0x56')](_0xe050('0x57'),_0x431e94['id']),_0x237f15);})[_0xe050('0x21')](function(){return _0x431e94;});})['then'](respondWithResult(_0x3cc036,0xc9))[_0xe050('0x43')](handleError(_0x3cc036,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b67847a..9f9cd2f 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 _0x1eba=['define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x551026,_0x4cfee5){var _0x399e25=function(_0x492dca){while(--_0x492dca){_0x551026['push'](_0x551026['shift']());}};_0x399e25(++_0x4cfee5);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x1eba[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb350=['define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./cmCustomField.attributes','exports'];(function(_0x1f8a2a,_0x906b0f){var _0x4dcaa7=function(_0x55098d){while(--_0x55098d){_0x1f8a2a['push'](_0x1f8a2a['shift']());}};_0x4dcaa7(++_0x906b0f);}(_0xb350,0x6f));var _0x0b35=function(_0x453c8,_0xd0e4b5){_0x453c8=_0x453c8-0x0;var _0x10ff7b=_0xb350[_0x453c8];return _0x10ff7b;};'use strict';var _=require(_0x0b35('0x0'));var util=require(_0x0b35('0x1'));var logger=require(_0x0b35('0x2'))(_0x0b35('0x3'));var moment=require('moment');var BPromise=require(_0x0b35('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b35('0x5'));var rimraf=require('rimraf');var config=require(_0x0b35('0x6'));var attributes=require(_0x0b35('0x7'));module[_0x0b35('0x8')]=function(_0x1218c3,_0x417722){return _0x1218c3[_0x0b35('0x9')](_0x0b35('0xa'),attributes,{'tableName':_0x0b35('0xb'),'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 d07655b..5a92ff5 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 _0x8d0e=['info','CmCustomField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then'];(function(_0x4e5c0b,_0x31e5a6){var _0x18c58f=function(_0x4db80c){while(--_0x4db80c){_0x4e5c0b['push'](_0x4e5c0b['shift']());}};_0x18c58f(++_0x31e5a6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x375272,_0x4f523b){_0x375272=_0x375272-0x0;var _0x277497=_0x8d0e[_0x375272];return _0x277497;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var moment=require(_0xe8d0('0x2'));var BPromise=require(_0xe8d0('0x3'));var rs=require(_0xe8d0('0x4'));var fs=require('fs');var Redis=require(_0xe8d0('0x5'));var db=require(_0xe8d0('0x6'))['db'];var utils=require(_0xe8d0('0x7'));var logger=require(_0xe8d0('0x8'))('rpc');var config=require(_0xe8d0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe8d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x92483d,_0x469d37,_0xcc03d0){return new BPromise(function(_0x2b6dce,_0x13aa63){return client[_0xe8d0('0xb')](_0x92483d,_0xcc03d0)[_0xe8d0('0xc')](function(_0x5605a0){logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,_0xe8d0('0xf'));logger['debug']('CmCustomField,\x20%s,\x20%s,\x20%s',_0x469d37,_0xe8d0('0xf'),JSON[_0xe8d0('0x10')](_0x5605a0));if(_0x5605a0[_0xe8d0('0x11')]){if(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x12')]===0x1f4){logger[_0xe8d0('0x11')]('CmCustomField,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x13aa63(_0x5605a0['error'][_0xe8d0('0x13')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x469d37,_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);return _0x2b6dce(_0x5605a0[_0xe8d0('0x11')][_0xe8d0('0x13')]);}else{logger[_0xe8d0('0xd')](_0xe8d0('0xe'),_0x469d37,'request\x20sent');_0x2b6dce(_0x5605a0[_0xe8d0('0x14')]['message']);}})[_0xe8d0('0x15')](function(_0x3c526c){logger[_0xe8d0('0x11')]('CmCustomField,\x20%s,\x20%s',_0x469d37,_0x3c526c);_0x13aa63(_0x3c526c);});});} \ No newline at end of file +var _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x43c168,_0xe52541){var _0x233b90=function(_0x4111c2){while(--_0x4111c2){_0x43c168['push'](_0x43c168['shift']());}};_0x233b90(++_0xe52541);}(_0xb821,0xa7));var _0x1b82=function(_0x5aa424,_0x5afd70){_0x5aa424=_0x5aa424-0x0;var _0x135d46=_0xb821[_0x5aa424];return _0x135d46;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('CmCustomField,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 10bacca..e98dfe4 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 _0x73f5=['get','isAuthenticated','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller'];(function(_0x4ecc22,_0x164023){var _0x1984bc=function(_0x28da2d){while(--_0x28da2d){_0x4ecc22['push'](_0x4ecc22['shift']());}};_0x1984bc(++_0x164023);}(_0x73f5,0x1cb));var _0x573f=function(_0x4fd84d,_0x320744){_0x4fd84d=_0x4fd84d-0x0;var _0x909966=_0x73f5[_0x4fd84d];return _0x909966;};'use strict';var multer=require(_0x573f('0x0'));var util=require(_0x573f('0x1'));var path=require(_0x573f('0x2'));var timeout=require(_0x573f('0x3'));var express=require('express');var router=express[_0x573f('0x4')]();var auth=require(_0x573f('0x5'));var interaction=require(_0x573f('0x6'));var config=require(_0x573f('0x7'));var controller=require(_0x573f('0x8'));router[_0x573f('0x9')]('/',auth[_0x573f('0xa')](),controller['index']);router[_0x573f('0x9')]('/:id',auth[_0x573f('0xa')](),controller['show']);router[_0x573f('0xb')]('/',auth['isAuthenticated'](),controller[_0x573f('0xc')]);router[_0x573f('0xd')](_0x573f('0xe'),auth['isAuthenticated'](),controller[_0x573f('0xf')]);router['delete'](_0x573f('0xe'),auth[_0x573f('0xa')](),controller[_0x573f('0x10')]);module[_0x573f('0x11')]=router; \ No newline at end of file +var _0xfaa3=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','show','post','create','put','exports','multer','connect-timeout','express','Router'];(function(_0x1eb856,_0x17f105){var _0x5a4b05=function(_0x572a42){while(--_0x572a42){_0x1eb856['push'](_0x1eb856['shift']());}};_0x5a4b05(++_0x17f105);}(_0xfaa3,0x137));var _0x3faa=function(_0x4aad3a,_0x3cc97b){_0x4aad3a=_0x4aad3a-0x0;var _0x380ed1=_0xfaa3[_0x4aad3a];return _0x380ed1;};'use strict';var multer=require(_0x3faa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3faa('0x1'));var express=require(_0x3faa('0x2'));var router=express[_0x3faa('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3faa('0x4'));var config=require(_0x3faa('0x5'));var controller=require(_0x3faa('0x6'));router[_0x3faa('0x7')]('/',auth[_0x3faa('0x8')](),controller['index']);router['get'](_0x3faa('0x9'),auth[_0x3faa('0x8')](),controller[_0x3faa('0xa')]);router[_0x3faa('0xb')]('/',auth[_0x3faa('0x8')](),controller[_0x3faa('0xc')]);router[_0x3faa('0xd')](_0x3faa('0x9'),auth[_0x3faa('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3faa('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index a2deab1..03fe5f0 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 _0x326f=['UNSIGNED','contactListQueue','moment','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x326f,0xd1));var _0xf326=function(_0x23cc68,_0x2f5902){_0x23cc68=_0x23cc68-0x0;var _0x34259d=_0x326f[_0x23cc68];return _0x34259d;};'use strict';var moment=require(_0xf326('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xf326('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf326('0x3')],'defaultValue':moment()[_0xf326('0x4')](_0xf326('0x5'))},'countbusyretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf326('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xf326('0x6')](0x2)[_0xf326('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf326('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xf326('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xf326('0x6')],'unique':_0xf326('0x8')},'CampaignId':{'type':Sequelize[_0xf326('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4975=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','exports','STRING','BOOLEAN','DATE','format'];(function(_0x529296,_0x1a6a23){var _0x1796bf=function(_0x3cae53){while(--_0x3cae53){_0x529296['push'](_0x529296['shift']());}};_0x1796bf(++_0x1a6a23);}(_0x4975,0x86));var _0x5497=function(_0x543dcf,_0x302e45){_0x543dcf=_0x543dcf-0x0;var _0x575a6f=_0x4975[_0x543dcf];return _0x575a6f;};'use strict';var moment=require(_0x5497('0x0'));var Sequelize=require('sequelize');module[_0x5497('0x1')]={'phone':{'type':Sequelize[_0x5497('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x5497('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5497('0x4')],'defaultValue':moment()[_0x5497('0x5')](_0x5497('0x6'))},'countbusyretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5497('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5497('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5497('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5497('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5497('0x7')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x5497('0x7')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x5497('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x5497('0x7')],'unique':_0x5497('0x9')},'CampaignId':{'type':Sequelize[_0x5497('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5497('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index efa239b..df8fb76 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 _0xd1e3=['preview','dialOrderByScheduledAt','sequelize','transaction','prev','isEmpty','hopperIds','priority','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','List','Queue','getOpenContacts','isNumber','getTimezones','timezones','push','utcOffset','getTimezone','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','ioredis','../../config/environment','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','filters','concat','$and','$gte','$lt','$lte','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','CmHopper','findAll','rows','catch','show','params','length','find','create','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','getPreview','getVoiceQueues','outbound'];(function(_0x30a6e8,_0x3b5610){var _0x5629a5=function(_0x5af72f){while(--_0x5af72f){_0x30a6e8['push'](_0x30a6e8['shift']());}};_0x5629a5(++_0x3b5610);}(_0xd1e3,0x142));var _0x3d1e=function(_0x226c11,_0x14c0a4){_0x226c11=_0x226c11-0x0;var _0x4dc73e=_0xd1e3[_0x226c11];return _0x4dc73e;};'use strict';var pdf=require(_0x3d1e('0x0'));var emlformat=require(_0x3d1e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3d1e('0x2'));var jsonpatch=require(_0x3d1e('0x3'));var rp=require(_0x3d1e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3d1e('0x5'));var path=require(_0x3d1e('0x6'));var sox=require(_0x3d1e('0x7'));var csv=require(_0x3d1e('0x8'));var ejs=require(_0x3d1e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3d1e('0xa'));var jsforce=require(_0x3d1e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3d1e('0x8'));var querystring=require(_0x3d1e('0xc'));var Papa=require('papaparse');var Redis=require(_0x3d1e('0xd'));var shared=require(_0x3d1e('0xe'));var authService=require(_0x3d1e('0xf'));var qs=require(_0x3d1e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d1e('0x11'))(_0x3d1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3d1e('0xe'));var db=require(_0x3d1e('0x13'))['db'];function respondWithStatusCode(_0x4c2376,_0x144d0a){_0x144d0a=_0x144d0a||0xcc;return function(_0x550893){if(_0x550893){return _0x4c2376[_0x3d1e('0x14')](_0x144d0a);}return _0x4c2376['status'](_0x144d0a)[_0x3d1e('0x15')]();};}function respondWithResult(_0xbdf1,_0x4263d4){_0x4263d4=_0x4263d4||0xc8;return function(_0x338515){if(_0x338515){return _0xbdf1[_0x3d1e('0x16')](_0x4263d4)['json'](_0x338515);}};}function respondWithFilteredResult(_0x3cef4d,_0x1a3949){return function(_0x504ac3){if(_0x504ac3){var _0x78ccb3=_0x504ac3[_0x3d1e('0x17')],_0x27d2f7=_0x1a3949[_0x3d1e('0x18')],_0x1721a9=_0x1a3949[_0x3d1e('0x18')]+_0x1a3949[_0x3d1e('0x19')],_0x21e4b0;if(_0x1721a9>=_0x78ccb3){_0x1721a9=_0x78ccb3;_0x21e4b0=0xc8;}else{_0x21e4b0=0xce;}_0x3cef4d[_0x3d1e('0x16')](_0x21e4b0);return _0x3cef4d[_0x3d1e('0x1a')](_0x3d1e('0x1b'),_0x27d2f7+'-'+_0x1721a9+'/'+_0x78ccb3)[_0x3d1e('0x1c')](_0x504ac3);}return null;};}function patchUpdates(_0x3e5a52){return function(_0x2cb597){try{jsonpatch['apply'](_0x2cb597,_0x3e5a52,!![]);}catch(_0x1a3705){return BPromise[_0x3d1e('0x1d')](_0x1a3705);}return _0x2cb597['save']();};}function saveUpdates(_0x505412,_0x437158){return function(_0x5c6321){if(_0x5c6321){return _0x5c6321[_0x3d1e('0x1e')](_0x505412)[_0x3d1e('0x1f')](function(_0x52375){return _0x52375;});}return null;};}function removeEntity(_0x403c4c,_0x1e460b){return function(_0x3bbefc){if(_0x3bbefc){return _0x3bbefc[_0x3d1e('0x20')]()[_0x3d1e('0x1f')](function(){_0x403c4c[_0x3d1e('0x16')](0xcc)[_0x3d1e('0x15')]();});}};}function handleEntityNotFound(_0x306c46,_0x43cab8){return function(_0x3f667d){if(!_0x3f667d){_0x306c46[_0x3d1e('0x14')](0x194);}return _0x3f667d;};}function handleError(_0x5c8de1,_0x41161f){_0x41161f=_0x41161f||0x1f4;return function(_0x247dae){logger[_0x3d1e('0x21')](_0x247dae[_0x3d1e('0x22')]);if(_0x247dae[_0x3d1e('0x23')]){delete _0x247dae[_0x3d1e('0x23')];}_0x5c8de1[_0x3d1e('0x16')](_0x41161f)[_0x3d1e('0x24')](_0x247dae);};}exports[_0x3d1e('0x25')]=function(_0x430f16,_0x2283af){var _0x28ecd2={},_0x3404e3={},_0x3f400a={'count':0x0,'rows':[]};var _0x561bd5=_[_0x3d1e('0x26')](db['CmHopper'][_0x3d1e('0x27')],function(_0x5442b2){return{'name':_0x5442b2[_0x3d1e('0x28')],'type':_0x5442b2['type'][_0x3d1e('0x29')]};});_0x3404e3[_0x3d1e('0x2a')]=_[_0x3d1e('0x26')](_0x561bd5,_0x3d1e('0x23'));_0x3404e3[_0x3d1e('0x2b')]=_[_0x3d1e('0x2c')](_0x430f16['query']);_0x3404e3['filters']=_[_0x3d1e('0x2d')](_0x3404e3[_0x3d1e('0x2a')],_0x3404e3['query']);_0x3404e3[_0x3d1e('0x2e')]=_[_0x3d1e('0x2f')](_0x3404e3[_0x3d1e('0x2e')],[_0x3d1e('0x30'),'$or','$gt',_0x3d1e('0x31'),_0x3d1e('0x32'),_0x3d1e('0x33'),'$ne',_0x3d1e('0x34'),_0x3d1e('0x35'),_0x3d1e('0x36'),_0x3d1e('0x37'),_0x3d1e('0x38'),_0x3d1e('0x39'),'$like',_0x3d1e('0x3a'),_0x3d1e('0x3b'),_0x3d1e('0x3c'),_0x3d1e('0x3d'),_0x3d1e('0x3e'),_0x3d1e('0x3f'),'$contained',_0x3d1e('0x40')]);_0x28ecd2[_0x3d1e('0x41')]=_[_0x3d1e('0x2d')](_0x3404e3[_0x3d1e('0x2a')],qs[_0x3d1e('0x42')](_0x430f16[_0x3d1e('0x2b')][_0x3d1e('0x42')]));_0x28ecd2[_0x3d1e('0x41')]=_0x28ecd2['attributes']['length']?_0x28ecd2[_0x3d1e('0x41')]:_0x3404e3[_0x3d1e('0x2a')];if(!_0x430f16['query'][_0x3d1e('0x43')](_0x3d1e('0x44'))){_0x28ecd2[_0x3d1e('0x19')]=qs[_0x3d1e('0x19')](_0x430f16[_0x3d1e('0x2b')][_0x3d1e('0x19')]);_0x28ecd2['offset']=qs['offset'](_0x430f16[_0x3d1e('0x2b')][_0x3d1e('0x18')]);}_0x28ecd2[_0x3d1e('0x45')]=qs[_0x3d1e('0x46')](_0x430f16[_0x3d1e('0x2b')][_0x3d1e('0x46')]);_0x28ecd2[_0x3d1e('0x47')]=qs[_0x3d1e('0x2e')](_['pick'](_0x430f16['query'],_0x3404e3[_0x3d1e('0x2e')]),_0x561bd5);if(_0x430f16[_0x3d1e('0x2b')][_0x3d1e('0x48')]){_0x28ecd2['where']=_[_0x3d1e('0x49')](_0x28ecd2['where'],{'$or':_[_0x3d1e('0x26')](_0x561bd5,function(_0x499d05){if(_0x499d05[_0x3d1e('0x4a')]!==_0x3d1e('0x4b')){var _0x3ca870={};_0x3ca870[_0x499d05[_0x3d1e('0x23')]]={'$like':'%'+_0x430f16[_0x3d1e('0x2b')][_0x3d1e('0x48')]+'%'};return _0x3ca870;}})});}_0x28ecd2=_[_0x3d1e('0x49')]({},_0x28ecd2,_0x430f16[_0x3d1e('0x4c')]);var _0x4b2599={'where':_0x28ecd2['where']};return db['CmHopper'][_0x3d1e('0x17')](_0x4b2599)[_0x3d1e('0x1f')](function(_0x40e398){_0x3f400a[_0x3d1e('0x17')]=_0x40e398;if(_0x430f16['query'][_0x3d1e('0x4d')]){_0x28ecd2[_0x3d1e('0x4e')]=[{'all':!![]}];}return db[_0x3d1e('0x4f')][_0x3d1e('0x50')](_0x28ecd2);})[_0x3d1e('0x1f')](function(_0x13798e){_0x3f400a[_0x3d1e('0x51')]=_0x13798e;return _0x3f400a;})[_0x3d1e('0x1f')](respondWithFilteredResult(_0x2283af,_0x28ecd2))[_0x3d1e('0x52')](handleError(_0x2283af,null));};exports[_0x3d1e('0x53')]=function(_0x5ae145,_0xd4dde0){var _0x9b172d={'raw':!![],'where':{'id':_0x5ae145[_0x3d1e('0x54')]['id']}},_0x453062={};_0x453062['model']=_[_0x3d1e('0x2c')](db[_0x3d1e('0x4f')][_0x3d1e('0x27')]);_0x453062[_0x3d1e('0x2b')]=_[_0x3d1e('0x2c')](_0x5ae145[_0x3d1e('0x2b')]);_0x453062[_0x3d1e('0x2e')]=_[_0x3d1e('0x2d')](_0x453062['model'],_0x453062[_0x3d1e('0x2b')]);_0x9b172d[_0x3d1e('0x41')]=_[_0x3d1e('0x2d')](_0x453062[_0x3d1e('0x2a')],qs[_0x3d1e('0x42')](_0x5ae145[_0x3d1e('0x2b')][_0x3d1e('0x42')]));_0x9b172d[_0x3d1e('0x41')]=_0x9b172d[_0x3d1e('0x41')][_0x3d1e('0x55')]?_0x9b172d[_0x3d1e('0x41')]:_0x453062[_0x3d1e('0x2a')];if(_0x5ae145[_0x3d1e('0x2b')]['includeAll']){_0x9b172d['include']=[{'all':!![]}];}_0x9b172d=_[_0x3d1e('0x49')]({},_0x9b172d,_0x5ae145[_0x3d1e('0x4c')]);return db['CmHopper'][_0x3d1e('0x56')](_0x9b172d)['then'](handleEntityNotFound(_0xd4dde0,null))['then'](respondWithResult(_0xd4dde0,null))[_0x3d1e('0x52')](handleError(_0xd4dde0,null));};exports['create']=function(_0x4a74be,_0x4c45ff){return db[_0x3d1e('0x4f')][_0x3d1e('0x57')](_0x4a74be[_0x3d1e('0x58')],{})['then'](respondWithResult(_0x4c45ff,0xc9))[_0x3d1e('0x52')](handleError(_0x4c45ff,null));};exports[_0x3d1e('0x1e')]=function(_0x2c98d3,_0x403a9){if(_0x2c98d3[_0x3d1e('0x58')]['id']){delete _0x2c98d3['body']['id'];}return db['CmHopper'][_0x3d1e('0x56')]({'where':{'id':_0x2c98d3[_0x3d1e('0x54')]['id']}})[_0x3d1e('0x1f')](handleEntityNotFound(_0x403a9,null))[_0x3d1e('0x1f')](saveUpdates(_0x2c98d3[_0x3d1e('0x58')],null))[_0x3d1e('0x1f')](respondWithResult(_0x403a9,null))[_0x3d1e('0x52')](handleError(_0x403a9,null));};exports[_0x3d1e('0x59')]=function(_0x4b08e9,_0x4f52b9){return db[_0x3d1e('0x4f')][_0x3d1e('0x59')]()['then'](respondWithResult(_0x4f52b9,null))[_0x3d1e('0x52')](handleError(_0x4f52b9,null));};exports[_0x3d1e('0x20')]=function(_0x5465c2,_0x2a2ea8){var _0x57fd1d;return db[_0x3d1e('0x4f')][_0x3d1e('0x56')]({'where':{'id':_0x5465c2[_0x3d1e('0x54')]['id']}})[_0x3d1e('0x1f')](handleEntityNotFound(_0x2a2ea8,null))[_0x3d1e('0x1f')](function(_0x30403c){if(_0x30403c){return _0x30403c[_0x3d1e('0x20')]()[_0x3d1e('0x1f')](function(_0xa995b3){return _0xa995b3;});}})[_0x3d1e('0x1f')](function(_0x1d0f14){_0x57fd1d=_0x1d0f14;if(_0x1d0f14){if(_0x1d0f14[_0x3d1e('0x5a')]||_0x1d0f14[_0x3d1e('0x5b')]){return db[_0x1d0f14[_0x3d1e('0x5a')]?_0x3d1e('0x5c'):_0x3d1e('0x5d')][_0x3d1e('0x56')]({'where':{'id':_0x1d0f14[_0x3d1e('0x5a')]?_0x1d0f14['VoiceQueueId']:_0x1d0f14[_0x3d1e('0x5b')]},'attributes':['id',_0x3d1e('0x23')],'raw':!![]});}}})[_0x3d1e('0x1f')](function(_0x41044d){var _0x3de953={};if(_0x41044d){_[_0x3d1e('0x49')](_0x3de953,_[_0x3d1e('0x5e')](_0x57fd1d[_0x3d1e('0x5f')],[_0x3d1e('0x60'),_0x3d1e('0x61'),'id']));_0x3de953[_0x3d1e('0x62')]=0x15;_0x3de953[_0x3d1e('0x63')]=_0x3d1e('0x64');_0x3de953[_0x3d1e('0x65')]=_0x41044d[_0x3d1e('0x23')];_0x3de953[_0x3d1e('0x66')]=_0x5465c2['user'][_0x3d1e('0x23')];_0x3de953['UserId']=_0x5465c2[_0x3d1e('0x67')]['id'];_0x3de953['deleted']=!![];_0x3de953[_0x3d1e('0x68')]=moment()[_0x3d1e('0x69')](_0x3d1e('0x6a'));_0x3de953['calleridnum']=_0x57fd1d[_0x3d1e('0x6b')];_0x3de953[_0x3d1e('0x6c')]=_0x57fd1d[_0x3d1e('0x5a')]?'queue':_0x3d1e('0x6d');return db[_0x3d1e('0x6e')][_0x3d1e('0x56')]({'where':{'id':_0x3de953[_0x3d1e('0x6f')]},'attributes':['firstName',_0x3d1e('0x70')]})['then'](function(_0x20423e){if(!_[_0x3d1e('0x71')](_0x2a2ea8)&&!_[_0x3d1e('0x71')](_0x20423e[_0x3d1e('0x72')])){_0x3de953[_0x3d1e('0x73')]=_0x20423e[_0x3d1e('0x72')];if(!_[_0x3d1e('0x71')](_0x20423e[_0x3d1e('0x70')])){_0x3de953[_0x3d1e('0x73')]+='\x20'+_0x20423e['lastName'];}}})['finally'](function(){return db['CmHopperFinal']['create'](_0x3de953);});}})[_0x3d1e('0x1f')](function(){return _0x2a2ea8[_0x3d1e('0x16')](0xcc)[_0x3d1e('0x15')]();})[_0x3d1e('0x52')](handleError(_0x2a2ea8,null));};exports[_0x3d1e('0x74')]=function(_0x441613,_0x19f7bb,_0x498f62){var _0x5b1c10=[];return db[_0x3d1e('0x6e')][_0x3d1e('0x59')]()[_0x3d1e('0x1f')](function(_0x4ee5ba){_0x5b1c10=_[_0x3d1e('0x2c')](_0x4ee5ba);return _0x441613['user'][_0x3d1e('0x75')]({'where':{'type':_0x3d1e('0x76'),'dialActive':!![],'dialMethod':_0x3d1e('0x77')},'attributes':['id',_0x3d1e('0x78')],'raw':!![]});})['then'](function(_0x451a13){if(_0x451a13&&_0x451a13[_0x3d1e('0x55')]){return db[_0x3d1e('0x79')][_0x3d1e('0x7a')](function(_0x5e09e4){var _0x2bfeec={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3d1e('0x69')](_0x3d1e('0x6a'))},'VoiceQueueId':{'$in':_[_0x3d1e('0x26')](_0x451a13,'id')},'$or':[{'UserId':null},{'UserId':_0x441613[_0x3d1e('0x67')]['id']}]};var _0x3f2824=[];if(_0x441613['body']['direction']&&_0x441613['body']['direction']===_0x3d1e('0x7b')){if(!_[_0x3d1e('0x7c')](_0x441613['body'][_0x3d1e('0x7d')])){_0x2bfeec['id']={'$in':_0x441613[_0x3d1e('0x58')]['hopperIds']};}_0x3f2824=[[_0x3d1e('0x7e'),_0x3d1e('0x7f')],['scheduledAt',_0x451a13[0x0][_0x3d1e('0x78')]===_0x3d1e('0x7f')?'DESC':'ASC'],db[_0x3d1e('0x79')][_0x3d1e('0x80')](_0x3d1e('0x81')),['id',_0x3d1e('0x82')]];}else{if(!_[_0x3d1e('0x7c')](_0x441613[_0x3d1e('0x58')][_0x3d1e('0x7d')])){_0x2bfeec['id']={'$notIn':_0x441613[_0x3d1e('0x58')]['hopperIds']};}_0x3f2824=[[_0x3d1e('0x7e'),'DESC'],[_0x3d1e('0x83'),_0x451a13[0x0]['dialOrderByScheduledAt']],db[_0x3d1e('0x79')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x3d1e('0x7f')]];}return db[_0x3d1e('0x4f')][_0x3d1e('0x84')]({'attributes':['id',_0x3d1e('0x85')],'where':_0x2bfeec,'order':_0x3f2824,'transaction':_0x5e09e4,'lock':_0x5e09e4['LOCK'][_0x3d1e('0x86')],'include':[{'model':db[_0x3d1e('0x6e')],'as':_0x3d1e('0x87'),'attributes':_0x5b1c10,'include':[{'model':db[_0x3d1e('0x88')],'as':_0x3d1e('0x89'),'attributes':['id',_0x3d1e('0x23')]}]},{'model':db['CmList'],'as':_0x3d1e('0x8a'),'attributes':['id',_0x3d1e('0x23')]},{'model':db[_0x3d1e('0x5c')],'as':_0x3d1e('0x8b'),'attributes':['id',_0x3d1e('0x23'),'dialActive']}]})[_0x3d1e('0x1f')](function(_0x46acf3){if(_0x46acf3){return _0x46acf3[_0x3d1e('0x1e')]({'UserId':_0x441613[_0x3d1e('0x67')]['id']},{'transaction':_0x5e09e4});}});});}})[_0x3d1e('0x1f')](handleEntityNotFound(_0x19f7bb,null))['then'](respondWithResult(_0x19f7bb,null))[_0x3d1e('0x52')](handleError(_0x19f7bb,null));};exports[_0x3d1e('0x8c')]=function(_0x2afeef,_0x159953,_0x3597e9){return _0x2afeef[_0x3d1e('0x67')][_0x3d1e('0x75')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x3d1e('0x77')},'attributes':['id'],'raw':!![]})[_0x3d1e('0x1f')](function(_0x28c435){if(_0x28c435&&_0x28c435[_0x3d1e('0x55')]){return db[_0x3d1e('0x4f')][_0x3d1e('0x17')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3d1e('0x69')](_0x3d1e('0x6a'))},'VoiceQueueId':{'$in':_[_0x3d1e('0x26')](_0x28c435,'id')},'$or':[{'UserId':null},{'UserId':_0x2afeef[_0x3d1e('0x67')]['id']}]}});}return 0x0;})[_0x3d1e('0x1f')](function(_0x557a7f){if(!_['isNil'](_0x557a7f)&&_[_0x3d1e('0x8d')](_0x557a7f)){return _0x159953['status'](0xc8)[_0x3d1e('0x1c')]({'contacts':_0x557a7f});}else{logger[_0x3d1e('0x21')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x3d1e('0x8c'),0x194,'entity\x20not\x20found');_0x159953[_0x3d1e('0x14')](0x194);}})[_0x3d1e('0x52')](handleError(_0x159953,null));};exports[_0x3d1e('0x8e')]=function(_0x314e4c,_0x50848f,_0x25bb73){var _0x5106a0=shared[_0x3d1e('0x8f')];var _0x4ba32f=[];_['map'](_0x5106a0,function(_0x5b2ce3){_0x4ba32f[_0x3d1e('0x90')]({'id':_0x5b2ce3[_0x3d1e('0x23')],'name':_0x5b2ce3[_0x3d1e('0x23')],'utcOffset':_0x5b2ce3[_0x3d1e('0x91')]});});return _0x50848f[_0x3d1e('0x16')](0xc8)['json']({'tz':_0x4ba32f});};exports[_0x3d1e('0x92')]=function(_0x52ae74,_0xf8a8d6,_0x414315){var _0x4763b2=shared[_0x3d1e('0x8f')];var _0x3e1ef2={};if(!_['isNil'](_0x4763b2[_0x52ae74[_0x3d1e('0x58')]['id']]))_0x3e1ef2=_0x4763b2[_0x52ae74[_0x3d1e('0x58')]['id']];return _0xf8a8d6[_0x3d1e('0x16')](0xc8)[_0x3d1e('0x1c')](_0x3e1ef2);}; \ No newline at end of file +var _0xc9de=['scheduledAt','DESC','ASC','literal','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','Company','List','dialActive','getOpenContacts','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','timezones','push','utcOffset','getTimezone','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','offset','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','create','body','find','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','getPreview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds'];(function(_0x16af01,_0x9c623c){var _0x4d4b9a=function(_0x26019f){while(--_0x26019f){_0x16af01['push'](_0x16af01['shift']());}};_0x4d4b9a(++_0x9c623c);}(_0xc9de,0x1f0));var _0xec9d=function(_0x2cae77,_0x1a445e){_0x2cae77=_0x2cae77-0x0;var _0x41116c=_0xc9de[_0x2cae77];return _0x41116c;};'use strict';var pdf=require(_0xec9d('0x0'));var emlformat=require(_0xec9d('0x1'));var rimraf=require(_0xec9d('0x2'));var zipdir=require(_0xec9d('0x3'));var jsonpatch=require(_0xec9d('0x4'));var rp=require(_0xec9d('0x5'));var moment=require(_0xec9d('0x6'));var BPromise=require(_0xec9d('0x7'));var Mustache=require(_0xec9d('0x8'));var util=require(_0xec9d('0x9'));var path=require(_0xec9d('0xa'));var sox=require(_0xec9d('0xb'));var csv=require(_0xec9d('0xc'));var ejs=require(_0xec9d('0xd'));var fs=require('fs');var _=require(_0xec9d('0xe'));var squel=require(_0xec9d('0xf'));var crypto=require(_0xec9d('0x10'));var jsforce=require(_0xec9d('0x11'));var deskjs=require('desk.js');var toCsv=require(_0xec9d('0xc'));var querystring=require(_0xec9d('0x12'));var Papa=require(_0xec9d('0x13'));var Redis=require(_0xec9d('0x14'));var shared=require('../../config/environment');var authService=require('../../components/auth/service');var qs=require(_0xec9d('0x15'));var as=require(_0xec9d('0x16'));var hardwareService=require(_0xec9d('0x17'));var logger=require('../../config/logger')(_0xec9d('0x18'));var utils=require('../../config/utils');var config=require(_0xec9d('0x19'));var db=require(_0xec9d('0x1a'))['db'];function respondWithStatusCode(_0x3b779f,_0x46e8ee){_0x46e8ee=_0x46e8ee||0xcc;return function(_0x301623){if(_0x301623){return _0x3b779f['sendStatus'](_0x46e8ee);}return _0x3b779f['status'](_0x46e8ee)[_0xec9d('0x1b')]();};}function respondWithResult(_0x5a92cc,_0x110291){_0x110291=_0x110291||0xc8;return function(_0x315c88){if(_0x315c88){return _0x5a92cc[_0xec9d('0x1c')](_0x110291)[_0xec9d('0x1d')](_0x315c88);}};}function respondWithFilteredResult(_0x46342d,_0x40fb52){return function(_0x5b4a21){if(_0x5b4a21){var _0x584fb3=_0x5b4a21['count'],_0x2c73ec=_0x40fb52['offset'],_0x4fbaf1=_0x40fb52[_0xec9d('0x1e')]+_0x40fb52['limit'],_0x2626ac;if(_0x4fbaf1>=_0x584fb3){_0x4fbaf1=_0x584fb3;_0x2626ac=0xc8;}else{_0x2626ac=0xce;}_0x46342d[_0xec9d('0x1c')](_0x2626ac);return _0x46342d[_0xec9d('0x1f')](_0xec9d('0x20'),_0x2c73ec+'-'+_0x4fbaf1+'/'+_0x584fb3)[_0xec9d('0x1d')](_0x5b4a21);}return null;};}function patchUpdates(_0xc95a38){return function(_0x4062a2){try{jsonpatch[_0xec9d('0x21')](_0x4062a2,_0xc95a38,!![]);}catch(_0xc68ca0){return BPromise['reject'](_0xc68ca0);}return _0x4062a2[_0xec9d('0x22')]();};}function saveUpdates(_0x2c36cd,_0x27d018){return function(_0x49aba2){if(_0x49aba2){return _0x49aba2[_0xec9d('0x23')](_0x2c36cd)[_0xec9d('0x24')](function(_0xb0ad66){return _0xb0ad66;});}return null;};}function removeEntity(_0x14406f,_0x1a1740){return function(_0x178406){if(_0x178406){return _0x178406['destroy']()[_0xec9d('0x24')](function(){_0x14406f[_0xec9d('0x1c')](0xcc)[_0xec9d('0x1b')]();});}};}function handleEntityNotFound(_0x5e6484,_0xd9acbd){return function(_0x5dacec){if(!_0x5dacec){_0x5e6484['sendStatus'](0x194);}return _0x5dacec;};}function handleError(_0x5eed36,_0x730929){_0x730929=_0x730929||0x1f4;return function(_0x14d2a1){logger[_0xec9d('0x25')](_0x14d2a1[_0xec9d('0x26')]);if(_0x14d2a1[_0xec9d('0x27')]){delete _0x14d2a1['name'];}_0x5eed36[_0xec9d('0x1c')](_0x730929)[_0xec9d('0x28')](_0x14d2a1);};}exports[_0xec9d('0x29')]=function(_0x3fa048,_0x3c7820){var _0x5c4875={},_0x49c1d4={},_0x59398c={'count':0x0,'rows':[]};var _0x2ed9a1=_[_0xec9d('0x2a')](db[_0xec9d('0x2b')][_0xec9d('0x2c')],function(_0x4b333f){return{'name':_0x4b333f[_0xec9d('0x2d')],'type':_0x4b333f[_0xec9d('0x2e')][_0xec9d('0x2f')]};});_0x49c1d4[_0xec9d('0x30')]=_['map'](_0x2ed9a1,'name');_0x49c1d4['query']=_[_0xec9d('0x31')](_0x3fa048[_0xec9d('0x32')]);_0x49c1d4[_0xec9d('0x33')]=_[_0xec9d('0x34')](_0x49c1d4[_0xec9d('0x30')],_0x49c1d4[_0xec9d('0x32')]);_0x49c1d4[_0xec9d('0x33')]=_['concat'](_0x49c1d4['filters'],[_0xec9d('0x35'),_0xec9d('0x36'),_0xec9d('0x37'),_0xec9d('0x38'),_0xec9d('0x39'),'$lte',_0xec9d('0x3a'),_0xec9d('0x3b'),_0xec9d('0x3c'),'$between',_0xec9d('0x3d'),_0xec9d('0x3e'),_0xec9d('0x3f'),_0xec9d('0x40'),_0xec9d('0x41'),_0xec9d('0x42'),'$notILike',_0xec9d('0x40'),_0xec9d('0x43'),_0xec9d('0x44'),_0xec9d('0x45'),_0xec9d('0x46')]);_0x5c4875[_0xec9d('0x47')]=_[_0xec9d('0x34')](_0x49c1d4[_0xec9d('0x30')],qs[_0xec9d('0x48')](_0x3fa048[_0xec9d('0x32')][_0xec9d('0x48')]));_0x5c4875['attributes']=_0x5c4875[_0xec9d('0x47')][_0xec9d('0x49')]?_0x5c4875[_0xec9d('0x47')]:_0x49c1d4[_0xec9d('0x30')];if(!_0x3fa048[_0xec9d('0x32')]['hasOwnProperty'](_0xec9d('0x4a'))){_0x5c4875[_0xec9d('0x4b')]=qs['limit'](_0x3fa048[_0xec9d('0x32')][_0xec9d('0x4b')]);_0x5c4875[_0xec9d('0x1e')]=qs['offset'](_0x3fa048[_0xec9d('0x32')][_0xec9d('0x1e')]);}_0x5c4875[_0xec9d('0x4c')]=qs[_0xec9d('0x4d')](_0x3fa048[_0xec9d('0x32')][_0xec9d('0x4d')]);_0x5c4875[_0xec9d('0x4e')]=qs['filters'](_[_0xec9d('0x4f')](_0x3fa048['query'],_0x49c1d4[_0xec9d('0x33')]),_0x2ed9a1);if(_0x3fa048[_0xec9d('0x32')][_0xec9d('0x50')]){_0x5c4875['where']=_[_0xec9d('0x51')](_0x5c4875[_0xec9d('0x4e')],{'$or':_[_0xec9d('0x2a')](_0x2ed9a1,function(_0x592d0e){if(_0x592d0e[_0xec9d('0x2e')]!=='VIRTUAL'){var _0x2739a6={};_0x2739a6[_0x592d0e[_0xec9d('0x27')]]={'$like':'%'+_0x3fa048[_0xec9d('0x32')][_0xec9d('0x50')]+'%'};return _0x2739a6;}})});}_0x5c4875=_[_0xec9d('0x51')]({},_0x5c4875,_0x3fa048[_0xec9d('0x52')]);var _0x229bea={'where':_0x5c4875['where']};return db['CmHopper'][_0xec9d('0x53')](_0x229bea)[_0xec9d('0x24')](function(_0x4f8445){_0x59398c[_0xec9d('0x53')]=_0x4f8445;if(_0x3fa048[_0xec9d('0x32')][_0xec9d('0x54')]){_0x5c4875[_0xec9d('0x55')]=[{'all':!![]}];}return db[_0xec9d('0x2b')]['findAll'](_0x5c4875);})['then'](function(_0x3f6360){_0x59398c[_0xec9d('0x56')]=_0x3f6360;return _0x59398c;})[_0xec9d('0x24')](respondWithFilteredResult(_0x3c7820,_0x5c4875))[_0xec9d('0x57')](handleError(_0x3c7820,null));};exports[_0xec9d('0x58')]=function(_0x4b1dfa,_0x1cb9bf){var _0x6cd981={'raw':!![],'where':{'id':_0x4b1dfa[_0xec9d('0x59')]['id']}},_0x5aa00d={};_0x5aa00d[_0xec9d('0x30')]=_[_0xec9d('0x31')](db['CmHopper'][_0xec9d('0x2c')]);_0x5aa00d[_0xec9d('0x32')]=_[_0xec9d('0x31')](_0x4b1dfa[_0xec9d('0x32')]);_0x5aa00d[_0xec9d('0x33')]=_[_0xec9d('0x34')](_0x5aa00d[_0xec9d('0x30')],_0x5aa00d[_0xec9d('0x32')]);_0x6cd981[_0xec9d('0x47')]=_[_0xec9d('0x34')](_0x5aa00d[_0xec9d('0x30')],qs[_0xec9d('0x48')](_0x4b1dfa[_0xec9d('0x32')]['fields']));_0x6cd981[_0xec9d('0x47')]=_0x6cd981['attributes'][_0xec9d('0x49')]?_0x6cd981[_0xec9d('0x47')]:_0x5aa00d[_0xec9d('0x30')];if(_0x4b1dfa['query'][_0xec9d('0x54')]){_0x6cd981['include']=[{'all':!![]}];}_0x6cd981=_[_0xec9d('0x51')]({},_0x6cd981,_0x4b1dfa['options']);return db[_0xec9d('0x2b')]['find'](_0x6cd981)[_0xec9d('0x24')](handleEntityNotFound(_0x1cb9bf,null))['then'](respondWithResult(_0x1cb9bf,null))[_0xec9d('0x57')](handleError(_0x1cb9bf,null));};exports[_0xec9d('0x5a')]=function(_0x58c934,_0x2e37d3){return db[_0xec9d('0x2b')]['create'](_0x58c934['body'],{})['then'](respondWithResult(_0x2e37d3,0xc9))['catch'](handleError(_0x2e37d3,null));};exports['update']=function(_0x5163c5,_0xdd82a0){if(_0x5163c5[_0xec9d('0x5b')]['id']){delete _0x5163c5[_0xec9d('0x5b')]['id'];}return db[_0xec9d('0x2b')][_0xec9d('0x5c')]({'where':{'id':_0x5163c5['params']['id']}})[_0xec9d('0x24')](handleEntityNotFound(_0xdd82a0,null))[_0xec9d('0x24')](saveUpdates(_0x5163c5[_0xec9d('0x5b')],null))[_0xec9d('0x24')](respondWithResult(_0xdd82a0,null))[_0xec9d('0x57')](handleError(_0xdd82a0,null));};exports['describe']=function(_0x2ecc54,_0x34cf38){return db[_0xec9d('0x2b')][_0xec9d('0x5d')]()[_0xec9d('0x24')](respondWithResult(_0x34cf38,null))[_0xec9d('0x57')](handleError(_0x34cf38,null));};exports[_0xec9d('0x5e')]=function(_0xdb09b1,_0x82f9f4){var _0x3aaa0d;return db[_0xec9d('0x2b')][_0xec9d('0x5c')]({'where':{'id':_0xdb09b1[_0xec9d('0x59')]['id']}})['then'](handleEntityNotFound(_0x82f9f4,null))[_0xec9d('0x24')](function(_0x402ce6){if(_0x402ce6){return _0x402ce6[_0xec9d('0x5e')]()[_0xec9d('0x24')](function(_0x9c4701){return _0x9c4701;});}})['then'](function(_0x570d8c){_0x3aaa0d=_0x570d8c;if(_0x570d8c){if(_0x570d8c[_0xec9d('0x5f')]||_0x570d8c[_0xec9d('0x60')]){return db[_0x570d8c[_0xec9d('0x5f')]?_0xec9d('0x61'):_0xec9d('0x62')][_0xec9d('0x5c')]({'where':{'id':_0x570d8c['VoiceQueueId']?_0x570d8c['VoiceQueueId']:_0x570d8c[_0xec9d('0x60')]},'attributes':['id',_0xec9d('0x27')],'raw':!![]});}}})[_0xec9d('0x24')](function(_0x149843){var _0x12f616={};if(_0x149843){_[_0xec9d('0x51')](_0x12f616,_[_0xec9d('0x63')](_0x3aaa0d[_0xec9d('0x64')],[_0xec9d('0x65'),_0xec9d('0x66'),'id']));_0x12f616[_0xec9d('0x67')]=0x15;_0x12f616[_0xec9d('0x68')]=_0xec9d('0x69');_0x12f616[_0xec9d('0x6a')]=_0x149843[_0xec9d('0x27')];_0x12f616[_0xec9d('0x6b')]=_0xdb09b1[_0xec9d('0x6c')][_0xec9d('0x27')];_0x12f616[_0xec9d('0x6d')]=_0xdb09b1[_0xec9d('0x6c')]['id'];_0x12f616[_0xec9d('0x69')]=!![];_0x12f616[_0xec9d('0x6e')]=moment()[_0xec9d('0x6f')]('YYYY-MM-DD\x20HH:mm:ss');_0x12f616[_0xec9d('0x70')]=_0x3aaa0d[_0xec9d('0x71')];_0x12f616[_0xec9d('0x72')]=_0x3aaa0d[_0xec9d('0x5f')]?'queue':_0xec9d('0x73');return db[_0xec9d('0x74')]['find']({'where':{'id':_0x12f616[_0xec9d('0x75')]},'attributes':[_0xec9d('0x76'),'lastName']})[_0xec9d('0x24')](function(_0x5aa329){if(!_[_0xec9d('0x77')](_0x82f9f4)&&!_['isNil'](_0x5aa329[_0xec9d('0x76')])){_0x12f616[_0xec9d('0x78')]=_0x5aa329['firstName'];if(!_[_0xec9d('0x77')](_0x5aa329[_0xec9d('0x79')])){_0x12f616[_0xec9d('0x78')]+='\x20'+_0x5aa329[_0xec9d('0x79')];}}})[_0xec9d('0x7a')](function(){return db['CmHopperFinal'][_0xec9d('0x5a')](_0x12f616);});}})[_0xec9d('0x24')](function(){return _0x82f9f4[_0xec9d('0x1c')](0xcc)[_0xec9d('0x1b')]();})['catch'](handleError(_0x82f9f4,null));};exports[_0xec9d('0x7b')]=function(_0x56c45e,_0x1cca29,_0x14db6e){var _0x49f9c7=[];return db[_0xec9d('0x74')][_0xec9d('0x5d')]()['then'](function(_0x2690b6){_0x49f9c7=_[_0xec9d('0x31')](_0x2690b6);return _0x56c45e['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xec9d('0x7c')],'raw':!![]});})['then'](function(_0x11f75a){if(_0x11f75a&&_0x11f75a['length']){return db[_0xec9d('0x7d')][_0xec9d('0x7e')](function(_0x1be0ce){var _0x1534fe={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xec9d('0x6f')](_0xec9d('0x7f'))},'VoiceQueueId':{'$in':_[_0xec9d('0x2a')](_0x11f75a,'id')},'$or':[{'UserId':null},{'UserId':_0x56c45e[_0xec9d('0x6c')]['id']}]};var _0x25362e=[];if(_0x56c45e[_0xec9d('0x5b')]['direction']&&_0x56c45e[_0xec9d('0x5b')][_0xec9d('0x80')]===_0xec9d('0x81')){if(!_[_0xec9d('0x82')](_0x56c45e['body'][_0xec9d('0x83')])){_0x1534fe['id']={'$in':_0x56c45e[_0xec9d('0x5b')][_0xec9d('0x83')]};}_0x25362e=[['priority','ASC'],[_0xec9d('0x84'),_0x11f75a[0x0][_0xec9d('0x7c')]==='ASC'?_0xec9d('0x85'):_0xec9d('0x86')],db[_0xec9d('0x7d')][_0xec9d('0x87')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_['isEmpty'](_0x56c45e[_0xec9d('0x5b')]['hopperIds'])){_0x1534fe['id']={'$notIn':_0x56c45e['body'][_0xec9d('0x83')]};}_0x25362e=[[_0xec9d('0x88'),_0xec9d('0x85')],[_0xec9d('0x84'),_0x11f75a[0x0][_0xec9d('0x7c')]],db['sequelize']['literal'](_0xec9d('0x89')),['id',_0xec9d('0x86')]];}return db[_0xec9d('0x2b')][_0xec9d('0x8a')]({'attributes':['id',_0xec9d('0x8b')],'where':_0x1534fe,'order':_0x25362e,'transaction':_0x1be0ce,'lock':_0x1be0ce[_0xec9d('0x8c')][_0xec9d('0x8d')],'include':[{'model':db[_0xec9d('0x74')],'as':_0xec9d('0x8e'),'attributes':_0x49f9c7,'include':[{'model':db['CmCompany'],'as':_0xec9d('0x8f'),'attributes':['id',_0xec9d('0x27')]}]},{'model':db['CmList'],'as':_0xec9d('0x90'),'attributes':['id',_0xec9d('0x27')]},{'model':db[_0xec9d('0x61')],'as':'Queue','attributes':['id',_0xec9d('0x27'),_0xec9d('0x91')]}]})['then'](function(_0xfb1df6){if(_0xfb1df6){return _0xfb1df6[_0xec9d('0x23')]({'UserId':_0x56c45e[_0xec9d('0x6c')]['id']},{'transaction':_0x1be0ce});}});});}})[_0xec9d('0x24')](handleEntityNotFound(_0x1cca29,null))['then'](respondWithResult(_0x1cca29,null))[_0xec9d('0x57')](handleError(_0x1cca29,null));};exports[_0xec9d('0x92')]=function(_0x4dc072,_0x286d2c,_0x58c9af){return _0x4dc072[_0xec9d('0x6c')]['getVoiceQueues']({'where':{'type':_0xec9d('0x93'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xec9d('0x24')](function(_0x263c72){if(_0x263c72&&_0x263c72[_0xec9d('0x49')]){return db[_0xec9d('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xec9d('0x6f')](_0xec9d('0x7f'))},'VoiceQueueId':{'$in':_[_0xec9d('0x2a')](_0x263c72,'id')},'$or':[{'UserId':null},{'UserId':_0x4dc072['user']['id']}]}});}return 0x0;})[_0xec9d('0x24')](function(_0x588b84){if(!_[_0xec9d('0x77')](_0x588b84)&&_[_0xec9d('0x94')](_0x588b84)){return _0x286d2c[_0xec9d('0x1c')](0xc8)[_0xec9d('0x1d')]({'contacts':_0x588b84});}else{logger[_0xec9d('0x25')](_0xec9d('0x95'),'getOpenContacts',0x194,_0xec9d('0x96'));_0x286d2c[_0xec9d('0x97')](0x194);}})[_0xec9d('0x57')](handleError(_0x286d2c,null));};exports[_0xec9d('0x98')]=function(_0x3094a4,_0x451315,_0x26e0a0){var _0x577ba3=shared[_0xec9d('0x99')];var _0x2ec5fd=[];_[_0xec9d('0x2a')](_0x577ba3,function(_0x11df7d){_0x2ec5fd[_0xec9d('0x9a')]({'id':_0x11df7d[_0xec9d('0x27')],'name':_0x11df7d['name'],'utcOffset':_0x11df7d[_0xec9d('0x9b')]});});return _0x451315[_0xec9d('0x1c')](0xc8)[_0xec9d('0x1d')]({'tz':_0x2ec5fd});};exports[_0xec9d('0x9c')]=function(_0x5438f8,_0x4596a9,_0x244a58){var _0x414ef7=shared[_0xec9d('0x99')];var _0x5958e2={};if(!_[_0xec9d('0x77')](_0x414ef7[_0x5438f8[_0xec9d('0x5b')]['id']]))_0x5958e2=_0x414ef7[_0x5438f8[_0xec9d('0x5b')]['id']];return _0x4596a9[_0xec9d('0x1c')](0xc8)[_0xec9d('0x1d')](_0x5958e2);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 881fa3f..1e862d5 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 _0x4360=['exports','define','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopper.attributes'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x4360,0xba));var _0x0436=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4360[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0436('0x0'));var util=require(_0x0436('0x1'));var logger=require(_0x0436('0x2'))(_0x0436('0x3'));var moment=require(_0x0436('0x4'));var BPromise=require(_0x0436('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0436('0x6'));var rimraf=require('rimraf');var config=require(_0x0436('0x7'));var attributes=require(_0x0436('0x8'));module[_0x0436('0x9')]=function(_0x32fa3f,_0x3a640e){return _0x32fa3f[_0x0436('0xa')](_0x0436('0xb'),attributes,{'tableName':_0x0436('0xc'),'paranoid':![],'indexes':[{'name':_0x0436('0xd'),'fields':[_0x0436('0xd')]},{'name':'phone','fields':['phone']},{'name':'priority','fields':[_0x0436('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11b0=['rimraf','../../config/environment','exports','scheduledat','phone','lodash','util','api','bluebird','path'];(function(_0x101af5,_0x3bead5){var _0x4c383f=function(_0xcc338f){while(--_0xcc338f){_0x101af5['push'](_0x101af5['shift']());}};_0x4c383f(++_0x3bead5);}(_0x11b0,0x69));var _0x011b=function(_0xf182ad,_0x1d6947){_0xf182ad=_0xf182ad-0x0;var _0x3f42e1=_0x11b0[_0xf182ad];return _0x3f42e1;};'use strict';var _=require(_0x011b('0x0'));var util=require(_0x011b('0x1'));var logger=require('../../config/logger')(_0x011b('0x2'));var moment=require('moment');var BPromise=require(_0x011b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x011b('0x4'));var rimraf=require(_0x011b('0x5'));var config=require(_0x011b('0x6'));var attributes=require('./cmHopper.attributes');module[_0x011b('0x7')]=function(_0x5aa6f1,_0x5d143f){return _0x5aa6f1['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x011b('0x8'),'fields':['scheduledat']},{'name':_0x011b('0x9'),'fields':['phone']},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index b6a8b4f..246b1df 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 _0xce59=['GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','keys','Agent','includes','UserId','push','all','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','UPDATE','length','GetContactRecallMe','GetCmHopperPreview','Contact','GetContactByPhone','log','req\x20value','phone\x20value','phone','dialTimezone','DESC','getContactByPhone','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopper,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetCmHopper','ShowCmHopper','CmHopper','CreateCmHopper','create','UpdateCmHopper','update','body','where','DestroyCmHopper'];(function(_0x4a7abd,_0x3cbb8f){var _0x20cdd3=function(_0x53224e){while(--_0x53224e){_0x4a7abd['push'](_0x4a7abd['shift']());}};_0x20cdd3(++_0x3cbb8f);}(_0xce59,0x195));var _0x9ce5=function(_0x483670,_0x3b6fed){_0x483670=_0x483670-0x0;var _0x3a7dc2=_0xce59[_0x483670];return _0x3a7dc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9ce5('0x0'));var rs=require(_0x9ce5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ce5('0x2'))['db'];var utils=require(_0x9ce5('0x3'));var logger=require(_0x9ce5('0x4'))(_0x9ce5('0x5'));var config=require(_0x9ce5('0x6'));var jayson=require(_0x9ce5('0x7'));var client=jayson['client'][_0x9ce5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dd67c,_0x2b1e70,_0x493703){return new BPromise(function(_0xec384f,_0x34252d){return client[_0x9ce5('0x9')](_0x2dd67c,_0x493703)[_0x9ce5('0xa')](function(_0x2ab6fc){logger[_0x9ce5('0xb')](_0x9ce5('0xc'),_0x2b1e70,'request\x20sent');logger[_0x9ce5('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x2b1e70,_0x9ce5('0xe'),JSON[_0x9ce5('0xf')](_0x2ab6fc));if(_0x2ab6fc['error']){if(_0x2ab6fc[_0x9ce5('0x10')][_0x9ce5('0x11')]===0x1f4){logger['error'](_0x9ce5('0xc'),_0x2b1e70,_0x2ab6fc[_0x9ce5('0x10')][_0x9ce5('0x12')]);return _0x34252d(_0x2ab6fc[_0x9ce5('0x10')]['message']);}logger[_0x9ce5('0x10')]('CmHopper,\x20%s,\x20%s',_0x2b1e70,_0x2ab6fc[_0x9ce5('0x10')]['message']);return _0xec384f(_0x2ab6fc[_0x9ce5('0x10')]['message']);}else{logger[_0x9ce5('0xb')](_0x9ce5('0xc'),_0x2b1e70,_0x9ce5('0xe'));_0xec384f(_0x2ab6fc[_0x9ce5('0x13')][_0x9ce5('0x12')]);}})[_0x9ce5('0x14')](function(_0x3d06af){logger[_0x9ce5('0x10')](_0x9ce5('0xc'),_0x2b1e70,_0x3d06af);_0x34252d(_0x3d06af);});});}exports['GetCmHopper']=function(_0x4c37c7){var _0x58554f=this;return new Promise(function(_0x1410ea,_0x1ac26d){return db['CmHopper'][_0x9ce5('0x15')]({'raw':_0x4c37c7[_0x9ce5('0x16')]?_0x4c37c7['options'][_0x9ce5('0x17')]===undefined?!![]:![]:!![],'where':_0x4c37c7['options']?_0x4c37c7[_0x9ce5('0x16')]['where']||null:null,'attributes':_0x4c37c7[_0x9ce5('0x16')]?_0x4c37c7[_0x9ce5('0x16')][_0x9ce5('0x18')]||null:null,'limit':_0x4c37c7[_0x9ce5('0x16')]?_0x4c37c7[_0x9ce5('0x16')][_0x9ce5('0x19')]||null:null,'include':_0x4c37c7[_0x9ce5('0x16')]?_0x4c37c7[_0x9ce5('0x16')]['include']?_['map'](_0x4c37c7[_0x9ce5('0x16')][_0x9ce5('0x1a')],function(_0xc5b00c){return{'model':db[_0xc5b00c['model']],'as':_0xc5b00c['as'],'attributes':_0xc5b00c[_0x9ce5('0x18')],'include':_0xc5b00c[_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0xc5b00c[_0x9ce5('0x1a')],function(_0x211455){return{'model':db[_0x211455[_0x9ce5('0x1c')]],'as':_0x211455['as'],'attributes':_0x211455[_0x9ce5('0x18')],'include':_0x211455[_0x9ce5('0x1a')]?_['map'](_0x211455[_0x9ce5('0x1a')],function(_0x3ef520){return{'model':db[_0x3ef520[_0x9ce5('0x1c')]],'as':_0x3ef520['as'],'attributes':_0x3ef520['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27ba0b){logger[_0x9ce5('0xb')](_0x9ce5('0x1d'),_0x4c37c7);logger['debug']('GetCmHopper',_0x4c37c7,JSON['stringify'](_0x27ba0b));_0x1410ea(_0x27ba0b);})[_0x9ce5('0x14')](function(_0x128ac2){logger[_0x9ce5('0x10')](_0x9ce5('0x1d'),_0x128ac2[_0x9ce5('0x12')],_0x4c37c7);_0x1ac26d(_0x58554f[_0x9ce5('0x10')](0x1f4,_0x128ac2['message']));});});};exports[_0x9ce5('0x1e')]=function(_0x3b409d){var _0x1e5290=this;return new Promise(function(_0x134642,_0x36ebdd){return db[_0x9ce5('0x1f')]['find']({'raw':_0x3b409d[_0x9ce5('0x16')]?_0x3b409d[_0x9ce5('0x16')][_0x9ce5('0x17')]===undefined?!![]:![]:!![],'where':_0x3b409d[_0x9ce5('0x16')]?_0x3b409d['options']['where']||null:null,'attributes':_0x3b409d[_0x9ce5('0x16')]?_0x3b409d[_0x9ce5('0x16')][_0x9ce5('0x18')]||null:null,'include':_0x3b409d['options']?_0x3b409d[_0x9ce5('0x16')]['include']?_[_0x9ce5('0x1b')](_0x3b409d[_0x9ce5('0x16')]['include'],function(_0x29fbfe){return{'model':db[_0x29fbfe[_0x9ce5('0x1c')]],'as':_0x29fbfe['as'],'attributes':_0x29fbfe[_0x9ce5('0x18')],'include':_0x29fbfe[_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0x29fbfe[_0x9ce5('0x1a')],function(_0x58d9d1){return{'model':db[_0x58d9d1[_0x9ce5('0x1c')]],'as':_0x58d9d1['as'],'attributes':_0x58d9d1[_0x9ce5('0x18')],'include':_0x58d9d1[_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0x58d9d1[_0x9ce5('0x1a')],function(_0x2e0795){return{'model':db[_0x2e0795[_0x9ce5('0x1c')]],'as':_0x2e0795['as'],'attributes':_0x2e0795[_0x9ce5('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9ce5('0xa')](function(_0x4808eb){logger['info'](_0x9ce5('0x1e'),_0x3b409d);logger[_0x9ce5('0xd')]('ShowCmHopper',_0x3b409d,JSON[_0x9ce5('0xf')](_0x4808eb));_0x134642(_0x4808eb);})[_0x9ce5('0x14')](function(_0x47bf8f){logger['error'](_0x9ce5('0x1e'),_0x47bf8f[_0x9ce5('0x12')],_0x3b409d);_0x36ebdd(_0x1e5290[_0x9ce5('0x10')](0x1f4,_0x47bf8f[_0x9ce5('0x12')]));});});};exports[_0x9ce5('0x20')]=function(_0x26e3aa){var _0x838dd8=this;return new Promise(function(_0x5f078e,_0x3af812){return db[_0x9ce5('0x1f')][_0x9ce5('0x21')](_0x26e3aa['body'],{'raw':_0x26e3aa[_0x9ce5('0x16')]?_0x26e3aa[_0x9ce5('0x16')][_0x9ce5('0x17')]===undefined?!![]:![]:!![]})[_0x9ce5('0xa')](function(_0x2ba2e7){logger[_0x9ce5('0xb')](_0x9ce5('0x20'),_0x26e3aa);logger['debug'](_0x9ce5('0x20'),_0x26e3aa,JSON['stringify'](_0x2ba2e7));_0x5f078e(_0x2ba2e7);})['catch'](function(_0x1daa54){logger[_0x9ce5('0x10')](_0x9ce5('0x20'),_0x1daa54['message'],_0x26e3aa);_0x3af812(_0x838dd8[_0x9ce5('0x10')](0x1f4,_0x1daa54[_0x9ce5('0x12')]));});});};exports[_0x9ce5('0x22')]=function(_0x46980f){var _0x1ef4c1=this;return new Promise(function(_0x3408ef,_0x480d9a){return db[_0x9ce5('0x1f')][_0x9ce5('0x23')](_0x46980f[_0x9ce5('0x24')],{'raw':_0x46980f[_0x9ce5('0x16')]?_0x46980f[_0x9ce5('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46980f[_0x9ce5('0x16')]?_0x46980f[_0x9ce5('0x16')][_0x9ce5('0x25')]||null:null,'attributes':_0x46980f[_0x9ce5('0x16')]?_0x46980f[_0x9ce5('0x16')][_0x9ce5('0x18')]||null:null,'limit':_0x46980f[_0x9ce5('0x16')]?_0x46980f[_0x9ce5('0x16')]['limit']||null:null})[_0x9ce5('0xa')](function(_0x444c3b){logger[_0x9ce5('0xb')](_0x9ce5('0x22'),_0x46980f);logger[_0x9ce5('0xd')]('UpdateCmHopper',_0x46980f,JSON[_0x9ce5('0xf')](_0x444c3b));_0x3408ef(_0x444c3b);})[_0x9ce5('0x14')](function(_0x45dc0a){logger[_0x9ce5('0x10')]('UpdateCmHopper',_0x45dc0a['message'],_0x46980f);_0x480d9a(_0x1ef4c1[_0x9ce5('0x10')](0x1f4,_0x45dc0a[_0x9ce5('0x12')]));});});};exports['DestroyCmHopper']=function(_0x4fb4e5){var _0x4170f9=this;return new Promise(function(_0x6d1120,_0x48244e){return db[_0x9ce5('0x1f')]['destroy']({'where':_0x4fb4e5['options']?_0x4fb4e5[_0x9ce5('0x16')][_0x9ce5('0x25')]||null:null})[_0x9ce5('0xa')](function(_0x2f6cde){logger[_0x9ce5('0xb')](_0x9ce5('0x26'),_0x4fb4e5);logger[_0x9ce5('0xd')](_0x9ce5('0x26'),_0x4fb4e5,JSON[_0x9ce5('0xf')](_0x2f6cde));_0x6d1120(_0x2f6cde);})['catch'](function(_0x3a6377){logger['error'](_0x9ce5('0x26'),_0x3a6377[_0x9ce5('0x12')],_0x4fb4e5);_0x48244e(_0x4170f9['error'](0x1f4,_0x3a6377['message']));});});};exports[_0x9ce5('0x27')]=function(_0xc3f154){var _0x5569a8=this;return new Promise(function(_0xf78f9b,_0x302dff){return db[_0x9ce5('0x28')][_0x9ce5('0x29')]()[_0x9ce5('0xa')](function(_0x3dfb76){return db[_0x9ce5('0x2a')][_0x9ce5('0x2b')](function(_0x2e83a1){return db[_0x9ce5('0x1f')][_0x9ce5('0x15')]({'where':_0xc3f154['options']?_0xc3f154['options'][_0x9ce5('0x25')]||null:null,'attributes':_0xc3f154['options']?_0xc3f154[_0x9ce5('0x16')][_0x9ce5('0x18')]||null:null,'limit':_0xc3f154[_0x9ce5('0x16')]?_0xc3f154[_0x9ce5('0x16')]['limit']||null:null,'order':_0xc3f154['options']?_0xc3f154[_0x9ce5('0x16')][_0x9ce5('0x2c')]||null:null,'transaction':_0x2e83a1,'lock':_0x2e83a1[_0x9ce5('0x2d')]['UPDATE'],'include':[{'model':db[_0x9ce5('0x28')],'as':'Contact','attributes':_[_0x9ce5('0x2e')](_0x3dfb76)},{'model':db['User'],'as':_0x9ce5('0x2f'),'attributes':['id','name','voicePause']}]})[_0x9ce5('0xa')](function(_0x37d52e){var _0x562e86=[];var _0x1bbdb2=[];for(var _0x34604b=0x0;_0x34604b<_0x37d52e['length'];_0x34604b+=0x1){if(!_0x1bbdb2[_0x9ce5('0x30')](_0x37d52e[_0x34604b][_0x9ce5('0x31')])){_0x1bbdb2[_0x9ce5('0x32')](_0x37d52e[_0x34604b][_0x9ce5('0x31')]);_0x562e86[_0x9ce5('0x32')](_0x37d52e[_0x34604b]['update'](_0xc3f154[_0x9ce5('0x24')],{'transaction':_0x2e83a1}));}}return BPromise[_0x9ce5('0x33')](_0x562e86);});})[_0x9ce5('0xa')](function(_0x231bda){logger[_0x9ce5('0xb')](_0x9ce5('0x27'),_0xc3f154);logger[_0x9ce5('0xd')](_0x9ce5('0x27'),_0xc3f154,JSON[_0x9ce5('0xf')](_0x231bda));_0xf78f9b(_0x231bda);})[_0x9ce5('0x14')](function(_0x13c512){logger[_0x9ce5('0x10')](_0x9ce5('0x27'),_0x13c512[_0x9ce5('0x12')],_0xc3f154);_0x302dff(_0x5569a8['error'](0x1f4,_0x13c512[_0x9ce5('0x12')]));});});});};exports[_0x9ce5('0x34')]=function(_0x1a1112){var _0xd92b11=this;return new Promise(function(_0x4face9,_0x55eefd){return db[_0x9ce5('0x2a')][_0x9ce5('0x2b')](function(_0x31aeec){return db['CmHopperFinal'][_0x9ce5('0x21')](_0x1a1112[_0x9ce5('0x24')],{'raw':_0x1a1112[_0x9ce5('0x16')]?_0x1a1112['options'][_0x9ce5('0x17')]===undefined?!![]:![]:!![],'transaction':_0x31aeec})[_0x9ce5('0xa')](function(){return db[_0x9ce5('0x1f')]['destroy']({'where':_0x1a1112[_0x9ce5('0x16')]?_0x1a1112[_0x9ce5('0x16')]['where']||null:null,'transaction':_0x31aeec});});})[_0x9ce5('0xa')](function(_0x3cc89e){logger[_0x9ce5('0xb')](_0x9ce5('0x34'),_0x1a1112);logger['debug']('MoveContactManagedDialer',_0x1a1112,JSON[_0x9ce5('0xf')](_0x3cc89e));_0x4face9(_0x3cc89e);})['catch'](function(_0x15ae20){logger[_0x9ce5('0x10')](_0x9ce5('0x34'),_0x15ae20[_0x9ce5('0x12')],_0x1a1112);_0x55eefd(_0xd92b11['error'](0x1f4,_0x15ae20[_0x9ce5('0x12')]));});});};exports[_0x9ce5('0x35')]=function(_0x27ccf0){var _0x4f2c0d=this;return new Promise(function(_0x485855,_0x5b11c7){return db['CmHopper'][_0x9ce5('0x15')]({'raw':_0x27ccf0['options']?_0x27ccf0[_0x9ce5('0x16')][_0x9ce5('0x17')]===undefined?!![]:![]:!![],'where':_0x27ccf0[_0x9ce5('0x16')]?_0x27ccf0[_0x9ce5('0x16')][_0x9ce5('0x25')]||null:null,'attributes':[[db['sequelize']['fn'](_0x9ce5('0x36'),db[_0x9ce5('0x2a')]['fn']('IF',db[_0x9ce5('0x2a')][_0x9ce5('0x37')](_0x9ce5('0x38')+util[_0x9ce5('0x39')](_0x9ce5('0x3a'),moment()[_0x9ce5('0x39')](_0x9ce5('0x3b')))+_0x9ce5('0x3c')))),'contactsRescheduled']]})[_0x9ce5('0xa')](function(_0x493aae){logger[_0x9ce5('0xb')](_0x9ce5('0x35'),_0x27ccf0);logger[_0x9ce5('0xd')](_0x9ce5('0x35'),_0x27ccf0,JSON['stringify'](_0x493aae));_0x485855(_0x493aae);})['catch'](function(_0x33baf8){logger[_0x9ce5('0x10')](_0x9ce5('0x35'),_0x33baf8[_0x9ce5('0x12')],_0x27ccf0);_0x5b11c7(_0x4f2c0d[_0x9ce5('0x10')](0x1f4,_0x33baf8['message']));});});};exports['GetContactRecallMe']=function(_0x525cb9){var _0xa238d7=this;return new Promise(function(_0x56297a,_0x2e04d3){return db['CmContact'][_0x9ce5('0x29')]()[_0x9ce5('0xa')](function(_0x1e04c5){return db[_0x9ce5('0x2a')][_0x9ce5('0x2b')](function(_0x210ecd){return db[_0x9ce5('0x1f')][_0x9ce5('0x15')]({'where':_0x525cb9['options']?_0x525cb9[_0x9ce5('0x16')][_0x9ce5('0x25')]||null:null,'attributes':_0x525cb9[_0x9ce5('0x16')]?_0x525cb9['options'][_0x9ce5('0x18')]||null:null,'limit':0x1,'order':_0x525cb9[_0x9ce5('0x16')]?_0x525cb9[_0x9ce5('0x16')][_0x9ce5('0x2c')]||null:null,'group':db[_0x9ce5('0x1f')]['UserId'],'transaction':_0x210ecd,'lock':_0x210ecd[_0x9ce5('0x2d')][_0x9ce5('0x3d')],'include':_0x525cb9[_0x9ce5('0x16')]?_0x525cb9[_0x9ce5('0x16')][_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0x525cb9[_0x9ce5('0x16')][_0x9ce5('0x1a')],function(_0x2ad971){return{'model':db[_0x2ad971[_0x9ce5('0x1c')]],'as':_0x2ad971['as'],'attributes':_0x2ad971[_0x9ce5('0x18')],'include':_0x2ad971['include']?_[_0x9ce5('0x1b')](_0x2ad971[_0x9ce5('0x1a')],function(_0x54e2d9){return{'model':db[_0x54e2d9[_0x9ce5('0x1c')]],'as':_0x54e2d9['as'],'attributes':_0x54e2d9[_0x9ce5('0x18')],'include':_0x54e2d9[_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0x54e2d9[_0x9ce5('0x1a')],function(_0x20eaf7){return{'model':db[_0x20eaf7[_0x9ce5('0x1c')]],'as':_0x20eaf7['as'],'attributes':_0x20eaf7['attributes']};}):[]};}):[]};}):[]:[]})[_0x9ce5('0xa')](function(_0x367eb5){var _0x45e1fc=[];for(var _0x1f6d17=0x0;_0x1f6d17<_0x367eb5[_0x9ce5('0x3e')];_0x1f6d17+=0x1){_0x45e1fc['push'](_0x367eb5[_0x1f6d17][_0x9ce5('0x23')](_0x525cb9[_0x9ce5('0x24')],{'transaction':_0x210ecd}));}return BPromise['all'](_0x45e1fc);});})[_0x9ce5('0xa')](function(_0x5aec5b){logger[_0x9ce5('0xb')]('GetContactRecallMe',_0x525cb9);logger[_0x9ce5('0xd')](_0x9ce5('0x3f'),_0x525cb9,JSON[_0x9ce5('0xf')](_0x5aec5b));_0x56297a(_0x5aec5b);})[_0x9ce5('0x14')](function(_0x33062c){logger[_0x9ce5('0x10')](_0x9ce5('0x3f'),_0x33062c[_0x9ce5('0x12')],_0x525cb9);_0x2e04d3(_0xa238d7[_0x9ce5('0x10')](0x1f4,_0x33062c[_0x9ce5('0x12')]));});});});};exports[_0x9ce5('0x40')]=function(_0x2b42c6){var _0x59c7eb=this;return new Promise(function(_0x3a9c76,_0xd6e16e){db[_0x9ce5('0x28')][_0x9ce5('0x29')]()[_0x9ce5('0xa')](function(_0x54f3cf){return db[_0x9ce5('0x1f')][_0x9ce5('0x15')]({'raw':_0x2b42c6[_0x9ce5('0x16')]?_0x2b42c6[_0x9ce5('0x16')][_0x9ce5('0x17')]===undefined?!![]:![]:!![],'where':_0x2b42c6[_0x9ce5('0x16')]?_0x2b42c6['options']['where']||null:null,'attributes':_0x2b42c6['options']?_0x2b42c6[_0x9ce5('0x16')][_0x9ce5('0x18')]||null:null,'limit':_0x2b42c6[_0x9ce5('0x16')]?_0x2b42c6[_0x9ce5('0x16')][_0x9ce5('0x19')]||null:null,'include':_0x2b42c6['options']?_0x2b42c6[_0x9ce5('0x16')][_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0x2b42c6['options'][_0x9ce5('0x1a')],function(_0xaf0092){return{'model':db[_0xaf0092[_0x9ce5('0x1c')]],'as':_0xaf0092['as'],'attributes':_0xaf0092['as']===_0x9ce5('0x41')?_[_0x9ce5('0x2e')](_0x54f3cf):_0xaf0092['attributes'],'include':_0xaf0092[_0x9ce5('0x1a')]?_[_0x9ce5('0x1b')](_0xaf0092[_0x9ce5('0x1a')],function(_0x49f070){return{'model':db[_0x49f070['model']],'as':_0x49f070['as'],'attributes':_0x49f070[_0x9ce5('0x18')],'include':_0x49f070['include']?_[_0x9ce5('0x1b')](_0x49f070[_0x9ce5('0x1a')],function(_0x2051ff){return{'model':db[_0x2051ff[_0x9ce5('0x1c')]],'as':_0x2051ff['as'],'attributes':_0x2051ff[_0x9ce5('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d1cca){logger['info']('GetCmHopper',_0x2b42c6);logger[_0x9ce5('0xd')](_0x9ce5('0x1d'),_0x2b42c6,JSON['stringify'](_0x1d1cca));_0x3a9c76(_0x1d1cca);})[_0x9ce5('0x14')](function(_0x12632a){logger['error']('GetCmHopper',_0x12632a[_0x9ce5('0x12')],_0x2b42c6);_0xd6e16e(_0x59c7eb[_0x9ce5('0x10')](0x1f4,_0x12632a['message']));});});});};exports[_0x9ce5('0x42')]=function(_0x470d60){console[_0x9ce5('0x43')](_0x9ce5('0x44'),_0x470d60);console[_0x9ce5('0x43')](_0x9ce5('0x45'),_0x470d60[_0x9ce5('0x16')][_0x9ce5('0x25')][_0x9ce5('0x46')]);_this=this;return new Promise(function(_0x57224b,_0x2615ee){return db[_0x9ce5('0x28')]['findOne']({'raw':!![],'where':{'phone':_0x470d60[_0x9ce5('0x16')][_0x9ce5('0x25')][_0x9ce5('0x46')]},'attributes':['id',_0x9ce5('0x47')],'order':[['id',_0x9ce5('0x48')]]})[_0x9ce5('0xa')](function(_0x18eb43){console['log']('getcontactbyohone',_0x18eb43);logger[_0x9ce5('0xb')]('getContactByPhone',_0x470d60);logger[_0x9ce5('0xd')](_0x9ce5('0x49'),_0x470d60,JSON[_0x9ce5('0xf')](_0x18eb43));_0x57224b(_0x18eb43);})['catch'](function(_0x329dab){logger[_0x9ce5('0x10')](_0x9ce5('0x49'),_0x329dab['message'],_0x470d60);_0x2615ee(_this['error'](0x1f4,_0x329dab['message']));});});}; \ No newline at end of file +var _0xf403=['CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','UPDATE','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','log','req\x20value','phone','findOne','dialTimezone','DESC','getcontactbyohone','getContactByPhone','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','code','error','CmHopper,\x20%s,\x20%s','message','result','catch','options','where','attributes','limit','include','map','model','GetCmHopper','debug','ShowCmHopper','CmHopper','find','CreateCmHopper','create','body','raw','UpdateCmHopper','update','DestroyCmHopper','destroy','describe','sequelize','transaction','findAll','LOCK','CmContact','Contact','keys','User','Agent','name','voicePause','length','UserId','push','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal'];(function(_0x435611,_0x4b5eb5){var _0x2a03d5=function(_0x28d07e){while(--_0x28d07e){_0x435611['push'](_0x435611['shift']());}};_0x2a03d5(++_0x4b5eb5);}(_0xf403,0x158));var _0x3f40=function(_0x3f8767,_0x1e8437){_0x3f8767=_0x3f8767-0x0;var _0x1b822a=_0xf403[_0x3f8767];return _0x1b822a;};'use strict';var _=require('lodash');var util=require(_0x3f40('0x0'));var moment=require(_0x3f40('0x1'));var BPromise=require(_0x3f40('0x2'));var rs=require(_0x3f40('0x3'));var fs=require('fs');var Redis=require(_0x3f40('0x4'));var db=require(_0x3f40('0x5'))['db'];var utils=require(_0x3f40('0x6'));var logger=require('../../config/logger')(_0x3f40('0x7'));var config=require(_0x3f40('0x8'));var jayson=require(_0x3f40('0x9'));var client=jayson['client'][_0x3f40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x294b87,_0x542e89,_0xa4334a){return new BPromise(function(_0x2dd895,_0xa7c3a7){return client[_0x3f40('0xb')](_0x294b87,_0xa4334a)[_0x3f40('0xc')](function(_0x19146f){logger[_0x3f40('0xd')]('CmHopper,\x20%s,\x20%s',_0x542e89,_0x3f40('0xe'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x542e89,_0x3f40('0xe'),JSON[_0x3f40('0xf')](_0x19146f));if(_0x19146f['error']){if(_0x19146f['error'][_0x3f40('0x10')]===0x1f4){logger[_0x3f40('0x11')](_0x3f40('0x12'),_0x542e89,_0x19146f[_0x3f40('0x11')]['message']);return _0xa7c3a7(_0x19146f[_0x3f40('0x11')][_0x3f40('0x13')]);}logger[_0x3f40('0x11')]('CmHopper,\x20%s,\x20%s',_0x542e89,_0x19146f[_0x3f40('0x11')]['message']);return _0x2dd895(_0x19146f[_0x3f40('0x11')][_0x3f40('0x13')]);}else{logger[_0x3f40('0xd')]('CmHopper,\x20%s,\x20%s',_0x542e89,_0x3f40('0xe'));_0x2dd895(_0x19146f[_0x3f40('0x14')][_0x3f40('0x13')]);}})[_0x3f40('0x15')](function(_0x5287ca){logger[_0x3f40('0x11')](_0x3f40('0x12'),_0x542e89,_0x5287ca);_0xa7c3a7(_0x5287ca);});});}exports['GetCmHopper']=function(_0x424359){var _0x59f6ee=this;return new Promise(function(_0xf57c88,_0x22783c){return db['CmHopper']['findAll']({'raw':_0x424359[_0x3f40('0x16')]?_0x424359[_0x3f40('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x424359[_0x3f40('0x16')]?_0x424359[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'attributes':_0x424359[_0x3f40('0x16')]?_0x424359[_0x3f40('0x16')][_0x3f40('0x18')]||null:null,'limit':_0x424359[_0x3f40('0x16')]?_0x424359[_0x3f40('0x16')][_0x3f40('0x19')]||null:null,'include':_0x424359[_0x3f40('0x16')]?_0x424359[_0x3f40('0x16')][_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0x424359[_0x3f40('0x16')]['include'],function(_0x838c6f){return{'model':db[_0x838c6f[_0x3f40('0x1c')]],'as':_0x838c6f['as'],'attributes':_0x838c6f[_0x3f40('0x18')],'include':_0x838c6f[_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0x838c6f[_0x3f40('0x1a')],function(_0x172baf){return{'model':db[_0x172baf['model']],'as':_0x172baf['as'],'attributes':_0x172baf[_0x3f40('0x18')],'include':_0x172baf[_0x3f40('0x1a')]?_['map'](_0x172baf[_0x3f40('0x1a')],function(_0x40255b){return{'model':db[_0x40255b['model']],'as':_0x40255b['as'],'attributes':_0x40255b[_0x3f40('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19bc2c){logger[_0x3f40('0xd')](_0x3f40('0x1d'),_0x424359);logger[_0x3f40('0x1e')](_0x3f40('0x1d'),_0x424359,JSON[_0x3f40('0xf')](_0x19bc2c));_0xf57c88(_0x19bc2c);})[_0x3f40('0x15')](function(_0x527b89){logger[_0x3f40('0x11')](_0x3f40('0x1d'),_0x527b89[_0x3f40('0x13')],_0x424359);_0x22783c(_0x59f6ee[_0x3f40('0x11')](0x1f4,_0x527b89[_0x3f40('0x13')]));});});};exports[_0x3f40('0x1f')]=function(_0x29ab9f){var _0x408a4d=this;return new Promise(function(_0x3ec025,_0x2ae718){return db[_0x3f40('0x20')][_0x3f40('0x21')]({'raw':_0x29ab9f[_0x3f40('0x16')]?_0x29ab9f[_0x3f40('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x29ab9f[_0x3f40('0x16')]?_0x29ab9f[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'attributes':_0x29ab9f[_0x3f40('0x16')]?_0x29ab9f[_0x3f40('0x16')][_0x3f40('0x18')]||null:null,'include':_0x29ab9f[_0x3f40('0x16')]?_0x29ab9f[_0x3f40('0x16')][_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0x29ab9f[_0x3f40('0x16')][_0x3f40('0x1a')],function(_0xb9333d){return{'model':db[_0xb9333d[_0x3f40('0x1c')]],'as':_0xb9333d['as'],'attributes':_0xb9333d[_0x3f40('0x18')],'include':_0xb9333d[_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0xb9333d[_0x3f40('0x1a')],function(_0x3298dd){return{'model':db[_0x3298dd[_0x3f40('0x1c')]],'as':_0x3298dd['as'],'attributes':_0x3298dd[_0x3f40('0x18')],'include':_0x3298dd[_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0x3298dd[_0x3f40('0x1a')],function(_0x4b9aea){return{'model':db[_0x4b9aea['model']],'as':_0x4b9aea['as'],'attributes':_0x4b9aea[_0x3f40('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e5016){logger[_0x3f40('0xd')](_0x3f40('0x1f'),_0x29ab9f);logger[_0x3f40('0x1e')](_0x3f40('0x1f'),_0x29ab9f,JSON[_0x3f40('0xf')](_0x5e5016));_0x3ec025(_0x5e5016);})[_0x3f40('0x15')](function(_0x2b5639){logger[_0x3f40('0x11')](_0x3f40('0x1f'),_0x2b5639[_0x3f40('0x13')],_0x29ab9f);_0x2ae718(_0x408a4d[_0x3f40('0x11')](0x1f4,_0x2b5639['message']));});});};exports[_0x3f40('0x22')]=function(_0x3c15da){var _0x3c2d42=this;return new Promise(function(_0x18afe1,_0x2a1c08){return db[_0x3f40('0x20')][_0x3f40('0x23')](_0x3c15da[_0x3f40('0x24')],{'raw':_0x3c15da[_0x3f40('0x16')]?_0x3c15da[_0x3f40('0x16')][_0x3f40('0x25')]===undefined?!![]:![]:!![]})[_0x3f40('0xc')](function(_0x5a20ae){logger[_0x3f40('0xd')](_0x3f40('0x22'),_0x3c15da);logger[_0x3f40('0x1e')](_0x3f40('0x22'),_0x3c15da,JSON[_0x3f40('0xf')](_0x5a20ae));_0x18afe1(_0x5a20ae);})['catch'](function(_0x3b091e){logger[_0x3f40('0x11')](_0x3f40('0x22'),_0x3b091e[_0x3f40('0x13')],_0x3c15da);_0x2a1c08(_0x3c2d42[_0x3f40('0x11')](0x1f4,_0x3b091e[_0x3f40('0x13')]));});});};exports[_0x3f40('0x26')]=function(_0x581f96){var _0x135cb8=this;return new Promise(function(_0x3c9037,_0x4e1fc9){return db[_0x3f40('0x20')][_0x3f40('0x27')](_0x581f96['body'],{'raw':_0x581f96['options']?_0x581f96[_0x3f40('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x581f96[_0x3f40('0x16')]?_0x581f96[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'attributes':_0x581f96[_0x3f40('0x16')]?_0x581f96[_0x3f40('0x16')]['attributes']||null:null,'limit':_0x581f96[_0x3f40('0x16')]?_0x581f96['options'][_0x3f40('0x19')]||null:null})[_0x3f40('0xc')](function(_0x6f508d){logger['info'](_0x3f40('0x26'),_0x581f96);logger[_0x3f40('0x1e')](_0x3f40('0x26'),_0x581f96,JSON['stringify'](_0x6f508d));_0x3c9037(_0x6f508d);})[_0x3f40('0x15')](function(_0xb57340){logger[_0x3f40('0x11')]('UpdateCmHopper',_0xb57340[_0x3f40('0x13')],_0x581f96);_0x4e1fc9(_0x135cb8[_0x3f40('0x11')](0x1f4,_0xb57340[_0x3f40('0x13')]));});});};exports[_0x3f40('0x28')]=function(_0x3e0bb8){var _0x188f8a=this;return new Promise(function(_0x4eb1f5,_0x25df1b){return db[_0x3f40('0x20')][_0x3f40('0x29')]({'where':_0x3e0bb8[_0x3f40('0x16')]?_0x3e0bb8[_0x3f40('0x16')][_0x3f40('0x17')]||null:null})[_0x3f40('0xc')](function(_0x51f41b){logger[_0x3f40('0xd')](_0x3f40('0x28'),_0x3e0bb8);logger[_0x3f40('0x1e')](_0x3f40('0x28'),_0x3e0bb8,JSON[_0x3f40('0xf')](_0x51f41b));_0x4eb1f5(_0x51f41b);})[_0x3f40('0x15')](function(_0x566de4){logger['error'](_0x3f40('0x28'),_0x566de4[_0x3f40('0x13')],_0x3e0bb8);_0x25df1b(_0x188f8a[_0x3f40('0x11')](0x1f4,_0x566de4['message']));});});};exports['GetContactDialer']=function(_0x1229d2){var _0x1cbedc=this;return new Promise(function(_0x55d907,_0x4f6e9f){return db['CmContact'][_0x3f40('0x2a')]()['then'](function(_0x285069){return db[_0x3f40('0x2b')][_0x3f40('0x2c')](function(_0x3662c7){return db[_0x3f40('0x20')][_0x3f40('0x2d')]({'where':_0x1229d2[_0x3f40('0x16')]?_0x1229d2[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'attributes':_0x1229d2[_0x3f40('0x16')]?_0x1229d2['options'][_0x3f40('0x18')]||null:null,'limit':_0x1229d2[_0x3f40('0x16')]?_0x1229d2[_0x3f40('0x16')][_0x3f40('0x19')]||null:null,'order':_0x1229d2[_0x3f40('0x16')]?_0x1229d2['options']['order']||null:null,'transaction':_0x3662c7,'lock':_0x3662c7[_0x3f40('0x2e')]['UPDATE'],'include':[{'model':db[_0x3f40('0x2f')],'as':_0x3f40('0x30'),'attributes':_[_0x3f40('0x31')](_0x285069)},{'model':db[_0x3f40('0x32')],'as':_0x3f40('0x33'),'attributes':['id',_0x3f40('0x34'),_0x3f40('0x35')]}]})[_0x3f40('0xc')](function(_0x45399c){var _0x4a347a=[];var _0x351453=[];for(var _0x22c7da=0x0;_0x22c7da<_0x45399c[_0x3f40('0x36')];_0x22c7da+=0x1){if(!_0x351453['includes'](_0x45399c[_0x22c7da][_0x3f40('0x37')])){_0x351453[_0x3f40('0x38')](_0x45399c[_0x22c7da][_0x3f40('0x37')]);_0x4a347a[_0x3f40('0x38')](_0x45399c[_0x22c7da]['update'](_0x1229d2[_0x3f40('0x24')],{'transaction':_0x3662c7}));}}return BPromise[_0x3f40('0x39')](_0x4a347a);});})[_0x3f40('0xc')](function(_0xb97e27){logger[_0x3f40('0xd')](_0x3f40('0x3a'),_0x1229d2);logger[_0x3f40('0x1e')](_0x3f40('0x3a'),_0x1229d2,JSON[_0x3f40('0xf')](_0xb97e27));_0x55d907(_0xb97e27);})[_0x3f40('0x15')](function(_0xe4676e){logger[_0x3f40('0x11')](_0x3f40('0x3a'),_0xe4676e[_0x3f40('0x13')],_0x1229d2);_0x4f6e9f(_0x1cbedc[_0x3f40('0x11')](0x1f4,_0xe4676e[_0x3f40('0x13')]));});});});};exports[_0x3f40('0x3b')]=function(_0x3d1e22){var _0x28e01d=this;return new Promise(function(_0x3b7217,_0x589359){return db[_0x3f40('0x2b')][_0x3f40('0x2c')](function(_0x2c0411){return db[_0x3f40('0x3c')]['create'](_0x3d1e22[_0x3f40('0x24')],{'raw':_0x3d1e22[_0x3f40('0x16')]?_0x3d1e22['options'][_0x3f40('0x25')]===undefined?!![]:![]:!![],'transaction':_0x2c0411})[_0x3f40('0xc')](function(){return db[_0x3f40('0x20')][_0x3f40('0x29')]({'where':_0x3d1e22['options']?_0x3d1e22[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'transaction':_0x2c0411});});})[_0x3f40('0xc')](function(_0x28bfec){logger[_0x3f40('0xd')](_0x3f40('0x3b'),_0x3d1e22);logger[_0x3f40('0x1e')](_0x3f40('0x3b'),_0x3d1e22,JSON[_0x3f40('0xf')](_0x28bfec));_0x3b7217(_0x28bfec);})[_0x3f40('0x15')](function(_0x221635){logger[_0x3f40('0x11')](_0x3f40('0x3b'),_0x221635[_0x3f40('0x13')],_0x3d1e22);_0x589359(_0x28e01d['error'](0x1f4,_0x221635[_0x3f40('0x13')]));});});};exports[_0x3f40('0x3d')]=function(_0x4eee1d){var _0x42294f=this;return new Promise(function(_0x40aff9,_0x4261e0){return db[_0x3f40('0x20')][_0x3f40('0x2d')]({'raw':_0x4eee1d['options']?_0x4eee1d[_0x3f40('0x16')][_0x3f40('0x25')]===undefined?!![]:![]:!![],'where':_0x4eee1d[_0x3f40('0x16')]?_0x4eee1d[_0x3f40('0x16')]['where']||null:null,'attributes':[[db[_0x3f40('0x2b')]['fn'](_0x3f40('0x3e'),db[_0x3f40('0x2b')]['fn']('IF',db['sequelize'][_0x3f40('0x3f')](_0x3f40('0x40')+util['format']('\x22%s\x22',moment()[_0x3f40('0x41')](_0x3f40('0x42')))+_0x3f40('0x43')))),_0x3f40('0x44')]]})['then'](function(_0x1bbb98){logger[_0x3f40('0xd')](_0x3f40('0x3d'),_0x4eee1d);logger['debug'](_0x3f40('0x3d'),_0x4eee1d,JSON[_0x3f40('0xf')](_0x1bbb98));_0x40aff9(_0x1bbb98);})[_0x3f40('0x15')](function(_0x3a1544){logger[_0x3f40('0x11')](_0x3f40('0x3d'),_0x3a1544[_0x3f40('0x13')],_0x4eee1d);_0x4261e0(_0x42294f[_0x3f40('0x11')](0x1f4,_0x3a1544['message']));});});};exports['GetContactRecallMe']=function(_0x11fa28){var _0x25ba5b=this;return new Promise(function(_0x4766e4,_0x49a5e5){return db[_0x3f40('0x2f')][_0x3f40('0x2a')]()[_0x3f40('0xc')](function(_0x163e54){return db[_0x3f40('0x2b')][_0x3f40('0x2c')](function(_0xc40ba8){return db[_0x3f40('0x20')]['findAll']({'where':_0x11fa28[_0x3f40('0x16')]?_0x11fa28[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'attributes':_0x11fa28['options']?_0x11fa28['options']['attributes']||null:null,'limit':0x1,'order':_0x11fa28[_0x3f40('0x16')]?_0x11fa28[_0x3f40('0x16')]['order']||null:null,'group':db['CmHopper']['UserId'],'transaction':_0xc40ba8,'lock':_0xc40ba8[_0x3f40('0x2e')][_0x3f40('0x45')],'include':_0x11fa28['options']?_0x11fa28['options'][_0x3f40('0x1a')]?_['map'](_0x11fa28[_0x3f40('0x16')][_0x3f40('0x1a')],function(_0x52b7af){return{'model':db[_0x52b7af[_0x3f40('0x1c')]],'as':_0x52b7af['as'],'attributes':_0x52b7af['attributes'],'include':_0x52b7af[_0x3f40('0x1a')]?_['map'](_0x52b7af[_0x3f40('0x1a')],function(_0x654d6a){return{'model':db[_0x654d6a[_0x3f40('0x1c')]],'as':_0x654d6a['as'],'attributes':_0x654d6a[_0x3f40('0x18')],'include':_0x654d6a[_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0x654d6a[_0x3f40('0x1a')],function(_0x3d2871){return{'model':db[_0x3d2871['model']],'as':_0x3d2871['as'],'attributes':_0x3d2871['attributes']};}):[]};}):[]};}):[]:[]})[_0x3f40('0xc')](function(_0x49038a){var _0x3dcb66=[];for(var _0x3a3d5d=0x0;_0x3a3d5d<_0x49038a['length'];_0x3a3d5d+=0x1){_0x3dcb66[_0x3f40('0x38')](_0x49038a[_0x3a3d5d][_0x3f40('0x27')](_0x11fa28[_0x3f40('0x24')],{'transaction':_0xc40ba8}));}return BPromise['all'](_0x3dcb66);});})[_0x3f40('0xc')](function(_0x4f5023){logger[_0x3f40('0xd')](_0x3f40('0x46'),_0x11fa28);logger[_0x3f40('0x1e')]('GetContactRecallMe',_0x11fa28,JSON[_0x3f40('0xf')](_0x4f5023));_0x4766e4(_0x4f5023);})[_0x3f40('0x15')](function(_0x56fc4e){logger['error'](_0x3f40('0x46'),_0x56fc4e['message'],_0x11fa28);_0x49a5e5(_0x25ba5b[_0x3f40('0x11')](0x1f4,_0x56fc4e[_0x3f40('0x13')]));});});});};exports[_0x3f40('0x47')]=function(_0x57ec4a){var _0x21ee89=this;return new Promise(function(_0x1511c4,_0xedceeb){db[_0x3f40('0x2f')][_0x3f40('0x2a')]()[_0x3f40('0xc')](function(_0x11a0be){return db[_0x3f40('0x20')][_0x3f40('0x2d')]({'raw':_0x57ec4a[_0x3f40('0x16')]?_0x57ec4a['options']['raw']===undefined?!![]:![]:!![],'where':_0x57ec4a[_0x3f40('0x16')]?_0x57ec4a[_0x3f40('0x16')][_0x3f40('0x17')]||null:null,'attributes':_0x57ec4a['options']?_0x57ec4a[_0x3f40('0x16')][_0x3f40('0x18')]||null:null,'limit':_0x57ec4a[_0x3f40('0x16')]?_0x57ec4a[_0x3f40('0x16')][_0x3f40('0x19')]||null:null,'include':_0x57ec4a[_0x3f40('0x16')]?_0x57ec4a['options'][_0x3f40('0x1a')]?_['map'](_0x57ec4a['options'][_0x3f40('0x1a')],function(_0x5331a0){return{'model':db[_0x5331a0[_0x3f40('0x1c')]],'as':_0x5331a0['as'],'attributes':_0x5331a0['as']==='Contact'?_['keys'](_0x11a0be):_0x5331a0[_0x3f40('0x18')],'include':_0x5331a0[_0x3f40('0x1a')]?_[_0x3f40('0x1b')](_0x5331a0[_0x3f40('0x1a')],function(_0x20c75f){return{'model':db[_0x20c75f[_0x3f40('0x1c')]],'as':_0x20c75f['as'],'attributes':_0x20c75f[_0x3f40('0x18')],'include':_0x20c75f['include']?_[_0x3f40('0x1b')](_0x20c75f[_0x3f40('0x1a')],function(_0x480b1a){return{'model':db[_0x480b1a['model']],'as':_0x480b1a['as'],'attributes':_0x480b1a[_0x3f40('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3f40('0xc')](function(_0x4f1fe1){logger['info'](_0x3f40('0x1d'),_0x57ec4a);logger[_0x3f40('0x1e')](_0x3f40('0x1d'),_0x57ec4a,JSON[_0x3f40('0xf')](_0x4f1fe1));_0x1511c4(_0x4f1fe1);})['catch'](function(_0x217d46){logger[_0x3f40('0x11')](_0x3f40('0x1d'),_0x217d46['message'],_0x57ec4a);_0xedceeb(_0x21ee89['error'](0x1f4,_0x217d46[_0x3f40('0x13')]));});});});};exports[_0x3f40('0x48')]=function(_0x56f245){console[_0x3f40('0x49')](_0x3f40('0x4a'),_0x56f245);console[_0x3f40('0x49')]('phone\x20value',_0x56f245[_0x3f40('0x16')][_0x3f40('0x17')][_0x3f40('0x4b')]);_this=this;return new Promise(function(_0x1642f3,_0x369cf5){return db['CmContact'][_0x3f40('0x4c')]({'raw':!![],'where':{'phone':_0x56f245[_0x3f40('0x16')][_0x3f40('0x17')][_0x3f40('0x4b')]},'attributes':['id',_0x3f40('0x4d')],'order':[['id',_0x3f40('0x4e')]]})[_0x3f40('0xc')](function(_0x5acdfe){console['log'](_0x3f40('0x4f'),_0x5acdfe);logger[_0x3f40('0xd')](_0x3f40('0x50'),_0x56f245);logger[_0x3f40('0x1e')](_0x3f40('0x50'),_0x56f245,JSON[_0x3f40('0xf')](_0x5acdfe));_0x1642f3(_0x5acdfe);})['catch'](function(_0x422031){logger['error']('getContactByPhone',_0x422031[_0x3f40('0x13')],_0x56f245);_0x369cf5(_this[_0x3f40('0x11')](0x1f4,_0x422031['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 6f747af..64edc57 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 _0x55ca=['getTimezone','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getOpenContacts','getTimezones','/:id','show','post','create','getPreview'];(function(_0x4c22f2,_0x5d6447){var _0x1915cd=function(_0x4d5cf2){while(--_0x4d5cf2){_0x4c22f2['push'](_0x4c22f2['shift']());}};_0x1915cd(++_0x5d6447);}(_0x55ca,0x126));var _0xa55c=function(_0x2c43f8,_0x261d10){_0x2c43f8=_0x2c43f8-0x0;var _0x3c0c0f=_0x55ca[_0x2c43f8];return _0x3c0c0f;};'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')]('/opencontacts',auth[_0xa55c('0x7')](),controller[_0xa55c('0xb')]);router['get']('/timezones',auth[_0xa55c('0x7')](),controller[_0xa55c('0xc')]);router[_0xa55c('0x6')](_0xa55c('0xd'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xe')]);router[_0xa55c('0xf')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x10')]);router[_0xa55c('0xf')]('/preview',auth['isAuthenticated'](),controller[_0xa55c('0x11')]);router['post']('/timezone',auth['isAuthenticated'](),controller[_0xa55c('0x12')]);router[_0xa55c('0x13')](_0xa55c('0xd'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')]('/:id',auth[_0xa55c('0x7')](),controller[_0xa55c('0x16')]);module[_0xa55c('0x17')]=router; \ No newline at end of file +var _0xac31=['/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','show','post','create','/preview','/timezone','getTimezone','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopper.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x5a57fc,_0x532520){var _0x36eb8a=function(_0x5837f3){while(--_0x5837f3){_0x5a57fc['push'](_0x5a57fc['shift']());}};_0x36eb8a(++_0x532520);}(_0xac31,0xca));var _0x1ac3=function(_0x529ace,_0x2c4ab8){_0x529ace=_0x529ace-0x0;var _0x511430=_0xac31[_0x529ace];return _0x511430;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['get'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0xa')](_0x1ac3('0x10'),auth['isAuthenticated'](),controller[_0x1ac3('0x11')]);router[_0x1ac3('0xa')](_0x1ac3('0x12'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x13')]);router[_0x1ac3('0x14')]('/',auth['isAuthenticated'](),controller[_0x1ac3('0x15')]);router[_0x1ac3('0x14')](_0x1ac3('0x16'),auth[_0x1ac3('0xc')](),controller['getPreview']);router[_0x1ac3('0x14')](_0x1ac3('0x17'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x18')]);router['put'](_0x1ac3('0x12'),auth[_0x1ac3('0xc')](),controller['update']);router[_0x1ac3('0x19')](_0x1ac3('0x12'),auth[_0x1ac3('0xc')](),controller['destroy']);module[_0x1ac3('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index a6cd487..06039bf 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 _0x43e5=['format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x43e5,0x1b2));var _0x543e=function(_0x120dd2,_0xe21dfa){_0x120dd2=_0x120dd2-0x0;var _0x2fa4c4=_0x43e5[_0x120dd2];return _0x2fa4c4;};'use strict';var moment=require(_0x543e('0x0'));var Sequelize=require(_0x543e('0x1'));module[_0x543e('0x2')]={'CmHopperId':{'type':Sequelize[_0x543e('0x3')]},'phone':{'type':Sequelize[_0x543e('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x543e('0x5')],'defaultValue':moment()[_0x543e('0x6')](_0x543e('0x7'))},'countbusyretry':{'type':Sequelize[_0x543e('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x543e('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x543e('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x543e('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x543e('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x543e('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x990a=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','STRING','INTEGER'];(function(_0xa4d02a,_0x2111b1){var _0x4cb1fd=function(_0x28b6e3){while(--_0x28b6e3){_0xa4d02a['push'](_0xa4d02a['shift']());}};_0x4cb1fd(++_0x2111b1);}(_0x990a,0x113));var _0xa990=function(_0x2a7e37,_0x327aca){_0x2a7e37=_0x2a7e37-0x0;var _0x18f97a=_0x990a[_0x2a7e37];return _0x18f97a;};'use strict';var moment=require(_0xa990('0x0'));var Sequelize=require(_0xa990('0x1'));module[_0xa990('0x2')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0xa990('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xa990('0x4')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xa990('0x5')],'defaultValue':moment()[_0xa990('0x6')](_0xa990('0x7'))},'countbusyretry':{'type':Sequelize[_0xa990('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa990('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xa990('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa990('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa990('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa990('0x4')],'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 d4c6466..9e58594 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 _0x9086=['mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','options','CmHopperAdditionalPhone','includeAll','include','findAll','rows','catch','show','params','rawAttributes','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','update','find','html-pdf','eml-format','fast-json-patch','request-promise','moment'];(function(_0x1585ad,_0x5ce3ab){var _0x10e1e4=function(_0x3470a5){while(--_0x3470a5){_0x1585ad['push'](_0x1585ad['shift']());}};_0x10e1e4(++_0x5ce3ab);}(_0x9086,0x147));var _0x6908=function(_0x26b034,_0x5a0893){_0x26b034=_0x26b034-0x0;var _0x3bdd88=_0x9086[_0x26b034];return _0x3bdd88;};'use strict';var pdf=require(_0x6908('0x0'));var emlformat=require(_0x6908('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6908('0x2'));var rp=require(_0x6908('0x3'));var moment=require(_0x6908('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6908('0x5'));var util=require(_0x6908('0x6'));var path=require('path');var sox=require(_0x6908('0x7'));var csv=require(_0x6908('0x8'));var ejs=require(_0x6908('0x9'));var fs=require('fs');var _=require(_0x6908('0xa'));var squel=require('squel');var crypto=require(_0x6908('0xb'));var jsforce=require(_0x6908('0xc'));var deskjs=require(_0x6908('0xd'));var toCsv=require(_0x6908('0x8'));var querystring=require('querystring');var Papa=require(_0x6908('0xe'));var Redis=require(_0x6908('0xf'));var authService=require(_0x6908('0x10'));var qs=require(_0x6908('0x11'));var as=require(_0x6908('0x12'));var hardwareService=require(_0x6908('0x13'));var logger=require(_0x6908('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x6908('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd849ff,_0x3c36b1){_0x3c36b1=_0x3c36b1||0xcc;return function(_0x5c9d29){if(_0x5c9d29){return _0xd849ff[_0x6908('0x16')](_0x3c36b1);}return _0xd849ff[_0x6908('0x17')](_0x3c36b1)[_0x6908('0x18')]();};}function respondWithResult(_0x10be37,_0x46baa6){_0x46baa6=_0x46baa6||0xc8;return function(_0x35a06d){if(_0x35a06d){return _0x10be37[_0x6908('0x17')](_0x46baa6)[_0x6908('0x19')](_0x35a06d);}};}function respondWithFilteredResult(_0x169e9f,_0x363745){return function(_0x31258f){if(_0x31258f){var _0x162d37=_0x31258f[_0x6908('0x1a')],_0x3c828c=_0x363745[_0x6908('0x1b')],_0x14f1ba=_0x363745[_0x6908('0x1b')]+_0x363745['limit'],_0x365bec;if(_0x14f1ba>=_0x162d37){_0x14f1ba=_0x162d37;_0x365bec=0xc8;}else{_0x365bec=0xce;}_0x169e9f[_0x6908('0x17')](_0x365bec);return _0x169e9f[_0x6908('0x1c')](_0x6908('0x1d'),_0x3c828c+'-'+_0x14f1ba+'/'+_0x162d37)[_0x6908('0x19')](_0x31258f);}return null;};}function patchUpdates(_0x5143d9){return function(_0x6344f4){try{jsonpatch[_0x6908('0x1e')](_0x6344f4,_0x5143d9,!![]);}catch(_0x47eb7e){return BPromise[_0x6908('0x1f')](_0x47eb7e);}return _0x6344f4[_0x6908('0x20')]();};}function saveUpdates(_0x1b3446,_0x5c64c2){return function(_0x5f53f3){if(_0x5f53f3){return _0x5f53f3['update'](_0x1b3446)[_0x6908('0x21')](function(_0x357090){return _0x357090;});}return null;};}function removeEntity(_0x467076,_0x58d5fd){return function(_0x255d86){if(_0x255d86){return _0x255d86[_0x6908('0x22')]()[_0x6908('0x21')](function(){var _0xbd4f26=_0x255d86['get']({'plain':!![]});var _0x10a58f=_0x6908('0x23');return db[_0x6908('0x24')][_0x6908('0x22')]({'where':{'type':_0x10a58f,'resourceId':_0xbd4f26['id']}})['then'](function(){return _0x255d86;});})[_0x6908('0x21')](function(){_0x467076[_0x6908('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f957,_0x498324){return function(_0x52f9f4){if(!_0x52f9f4){_0x38f957['sendStatus'](0x194);}return _0x52f9f4;};}function handleError(_0x3bb847,_0x489c0b){_0x489c0b=_0x489c0b||0x1f4;return function(_0x6bcee3){logger[_0x6908('0x25')](_0x6bcee3[_0x6908('0x26')]);if(_0x6bcee3[_0x6908('0x27')]){delete _0x6bcee3['name'];}_0x3bb847['status'](_0x489c0b)[_0x6908('0x28')](_0x6bcee3);};}exports[_0x6908('0x29')]=function(_0x225206,_0x224251){var _0x1c3c95={},_0xc3c7d8={},_0x23de57={'count':0x0,'rows':[]};var _0x13df9e=_['map'](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x190874){return{'name':_0x190874[_0x6908('0x2a')],'type':_0x190874[_0x6908('0x2b')][_0x6908('0x2c')]};});_0xc3c7d8['model']=_[_0x6908('0x2d')](_0x13df9e,_0x6908('0x27'));_0xc3c7d8[_0x6908('0x2e')]=_[_0x6908('0x2f')](_0x225206['query']);_0xc3c7d8['filters']=_[_0x6908('0x30')](_0xc3c7d8[_0x6908('0x31')],_0xc3c7d8[_0x6908('0x2e')]);_0x1c3c95[_0x6908('0x32')]=_[_0x6908('0x30')](_0xc3c7d8[_0x6908('0x31')],qs[_0x6908('0x33')](_0x225206[_0x6908('0x2e')][_0x6908('0x33')]));_0x1c3c95[_0x6908('0x32')]=_0x1c3c95[_0x6908('0x32')][_0x6908('0x34')]?_0x1c3c95[_0x6908('0x32')]:_0xc3c7d8[_0x6908('0x31')];if(!_0x225206[_0x6908('0x2e')]['hasOwnProperty'](_0x6908('0x35'))){_0x1c3c95['limit']=qs[_0x6908('0x36')](_0x225206['query'][_0x6908('0x36')]);_0x1c3c95[_0x6908('0x1b')]=qs[_0x6908('0x1b')](_0x225206['query'][_0x6908('0x1b')]);}_0x1c3c95['order']=qs[_0x6908('0x37')](_0x225206[_0x6908('0x2e')]['sort']);_0x1c3c95[_0x6908('0x38')]=qs[_0x6908('0x39')](_[_0x6908('0x3a')](_0x225206[_0x6908('0x2e')],_0xc3c7d8['filters']),_0x13df9e);if(_0x225206[_0x6908('0x2e')][_0x6908('0x3b')]){_0x1c3c95[_0x6908('0x38')]=_['merge'](_0x1c3c95['where'],{'$or':_[_0x6908('0x2d')](_0x13df9e,function(_0x46a7b9){if(_0x46a7b9[_0x6908('0x2b')]!==_0x6908('0x3c')){var _0x32a26c={};_0x32a26c[_0x46a7b9[_0x6908('0x27')]]={'$like':'%'+_0x225206[_0x6908('0x2e')]['filter']+'%'};return _0x32a26c;}})});}_0x1c3c95=_[_0x6908('0x3d')]({},_0x1c3c95,_0x225206[_0x6908('0x3e')]);var _0x103b79={'where':_0x1c3c95[_0x6908('0x38')]};return db[_0x6908('0x3f')][_0x6908('0x1a')](_0x103b79)[_0x6908('0x21')](function(_0x9d82f0){_0x23de57['count']=_0x9d82f0;if(_0x225206['query'][_0x6908('0x40')]){_0x1c3c95[_0x6908('0x41')]=[{'all':!![]}];}return db[_0x6908('0x3f')][_0x6908('0x42')](_0x1c3c95);})[_0x6908('0x21')](function(_0x44d165){_0x23de57[_0x6908('0x43')]=_0x44d165;return _0x23de57;})[_0x6908('0x21')](respondWithFilteredResult(_0x224251,_0x1c3c95))[_0x6908('0x44')](handleError(_0x224251,null));};exports[_0x6908('0x45')]=function(_0x1fc9a3,_0x59aacb){var _0x1ae996={'raw':!![],'where':{'id':_0x1fc9a3[_0x6908('0x46')]['id']}},_0x51de9c={};_0x51de9c[_0x6908('0x31')]=_['keys'](db[_0x6908('0x3f')][_0x6908('0x47')]);_0x51de9c['query']=_[_0x6908('0x2f')](_0x1fc9a3[_0x6908('0x2e')]);_0x51de9c[_0x6908('0x39')]=_[_0x6908('0x30')](_0x51de9c[_0x6908('0x31')],_0x51de9c[_0x6908('0x2e')]);_0x1ae996[_0x6908('0x32')]=_[_0x6908('0x30')](_0x51de9c[_0x6908('0x31')],qs[_0x6908('0x33')](_0x1fc9a3[_0x6908('0x2e')][_0x6908('0x33')]));_0x1ae996[_0x6908('0x32')]=_0x1ae996[_0x6908('0x32')][_0x6908('0x34')]?_0x1ae996[_0x6908('0x32')]:_0x51de9c['model'];if(_0x1fc9a3[_0x6908('0x2e')][_0x6908('0x40')]){_0x1ae996[_0x6908('0x41')]=[{'all':!![]}];}_0x1ae996=_['merge']({},_0x1ae996,_0x1fc9a3[_0x6908('0x3e')]);return db[_0x6908('0x3f')]['find'](_0x1ae996)[_0x6908('0x21')](handleEntityNotFound(_0x59aacb,null))[_0x6908('0x21')](respondWithResult(_0x59aacb,null))[_0x6908('0x44')](handleError(_0x59aacb,null));};exports['create']=function(_0x281c25,_0x35efba){return db[_0x6908('0x3f')]['create'](_0x281c25[_0x6908('0x48')],{})[_0x6908('0x21')](function(_0x14f2e9){var _0x4e3e0b=_0x281c25[_0x6908('0x49')][_0x6908('0x4a')]({'plain':!![]});if(!_0x4e3e0b)throw new Error(_0x6908('0x4b'));if(_0x4e3e0b[_0x6908('0x4c')]==='user'){var _0x55784c=_0x14f2e9[_0x6908('0x4a')]({'plain':!![]});var _0x124e59=_0x6908('0x23');return db[_0x6908('0x4d')]['find']({'where':{'name':_0x124e59,'userProfileId':_0x4e3e0b[_0x6908('0x4e')]},'raw':!![]})[_0x6908('0x21')](function(_0x203882){if(_0x203882&&_0x203882[_0x6908('0x4f')]===0x0){return db['UserProfileResource'][_0x6908('0x50')]({'name':_0x55784c[_0x6908('0x27')],'resourceId':_0x55784c['id'],'type':_0x203882[_0x6908('0x27')],'sectionId':_0x203882['id']},{})['then'](function(){return _0x14f2e9;});}else{return _0x14f2e9;}})[_0x6908('0x44')](function(_0x3f9011){logger[_0x6908('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f9011);throw _0x3f9011;});}return _0x14f2e9;})[_0x6908('0x21')](respondWithResult(_0x35efba,0xc9))[_0x6908('0x44')](handleError(_0x35efba,null));};exports[_0x6908('0x51')]=function(_0x357d80,_0x205a8){if(_0x357d80['body']['id']){delete _0x357d80[_0x6908('0x48')]['id'];}return db[_0x6908('0x3f')][_0x6908('0x52')]({'where':{'id':_0x357d80[_0x6908('0x46')]['id']}})[_0x6908('0x21')](handleEntityNotFound(_0x205a8,null))[_0x6908('0x21')](saveUpdates(_0x357d80[_0x6908('0x48')],null))[_0x6908('0x21')](respondWithResult(_0x205a8,null))[_0x6908('0x44')](handleError(_0x205a8,null));};exports['destroy']=function(_0x412aaa,_0x3dc977){return db['CmHopperAdditionalPhone'][_0x6908('0x52')]({'where':{'id':_0x412aaa['params']['id']}})[_0x6908('0x21')](handleEntityNotFound(_0x3dc977,null))[_0x6908('0x21')](removeEntity(_0x3dc977,null))[_0x6908('0x44')](handleError(_0x3dc977,null));}; \ No newline at end of file +var _0x8ab4=['error','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','VIRTUAL','merge','CmHopperAdditionalPhone','includeAll','include','catch','show','params','rawAttributes','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource'];(function(_0x541f4f,_0xe378b3){var _0x24f033=function(_0x381c16){while(--_0x381c16){_0x541f4f['push'](_0x541f4f['shift']());}};_0x24f033(++_0xe378b3);}(_0x8ab4,0xc6));var _0x48ab=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x8ab4[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0x48ab('0x0'));var emlformat=require(_0x48ab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x48ab('0x2'));var jsonpatch=require(_0x48ab('0x3'));var rp=require(_0x48ab('0x4'));var moment=require(_0x48ab('0x5'));var BPromise=require(_0x48ab('0x6'));var Mustache=require(_0x48ab('0x7'));var util=require(_0x48ab('0x8'));var path=require(_0x48ab('0x9'));var sox=require('sox');var csv=require(_0x48ab('0xa'));var ejs=require(_0x48ab('0xb'));var fs=require('fs');var _=require(_0x48ab('0xc'));var squel=require(_0x48ab('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x48ab('0xe'));var toCsv=require(_0x48ab('0xa'));var querystring=require('querystring');var Papa=require(_0x48ab('0xf'));var Redis=require(_0x48ab('0x10'));var authService=require(_0x48ab('0x11'));var qs=require(_0x48ab('0x12'));var as=require(_0x48ab('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x48ab('0x14'))(_0x48ab('0x15'));var utils=require(_0x48ab('0x16'));var config=require(_0x48ab('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251651,_0x6a7e9f){_0x6a7e9f=_0x6a7e9f||0xcc;return function(_0x569296){if(_0x569296){return _0x251651[_0x48ab('0x18')](_0x6a7e9f);}return _0x251651['status'](_0x6a7e9f)[_0x48ab('0x19')]();};}function respondWithResult(_0x17cfbd,_0x289732){_0x289732=_0x289732||0xc8;return function(_0x3e2744){if(_0x3e2744){return _0x17cfbd[_0x48ab('0x1a')](_0x289732)[_0x48ab('0x1b')](_0x3e2744);}};}function respondWithFilteredResult(_0x3cf859,_0x37eccb){return function(_0x12bae7){if(_0x12bae7){var _0x258881=_0x12bae7[_0x48ab('0x1c')],_0x120343=_0x37eccb[_0x48ab('0x1d')],_0x30ac7b=_0x37eccb[_0x48ab('0x1d')]+_0x37eccb[_0x48ab('0x1e')],_0x3b1a14;if(_0x30ac7b>=_0x258881){_0x30ac7b=_0x258881;_0x3b1a14=0xc8;}else{_0x3b1a14=0xce;}_0x3cf859['status'](_0x3b1a14);return _0x3cf859[_0x48ab('0x1f')]('Content-Range',_0x120343+'-'+_0x30ac7b+'/'+_0x258881)[_0x48ab('0x1b')](_0x12bae7);}return null;};}function patchUpdates(_0x2d0523){return function(_0x282d89){try{jsonpatch[_0x48ab('0x20')](_0x282d89,_0x2d0523,!![]);}catch(_0x59ac2a){return BPromise['reject'](_0x59ac2a);}return _0x282d89[_0x48ab('0x21')]();};}function saveUpdates(_0x2fa4f6,_0xbd5a76){return function(_0x189e0a){if(_0x189e0a){return _0x189e0a[_0x48ab('0x22')](_0x2fa4f6)[_0x48ab('0x23')](function(_0x32fbf3){return _0x32fbf3;});}return null;};}function removeEntity(_0x11ba6e,_0x9109ec){return function(_0x5157b0){if(_0x5157b0){return _0x5157b0[_0x48ab('0x24')]()['then'](function(){var _0xa47508=_0x5157b0['get']({'plain':!![]});var _0x3cbc95=_0x48ab('0x25');return db[_0x48ab('0x26')][_0x48ab('0x24')]({'where':{'type':_0x3cbc95,'resourceId':_0xa47508['id']}})['then'](function(){return _0x5157b0;});})[_0x48ab('0x23')](function(){_0x11ba6e[_0x48ab('0x1a')](0xcc)[_0x48ab('0x19')]();});}};}function handleEntityNotFound(_0x1c8015,_0x2119ce){return function(_0x54ff05){if(!_0x54ff05){_0x1c8015[_0x48ab('0x18')](0x194);}return _0x54ff05;};}function handleError(_0x5085cd,_0x4e3181){_0x4e3181=_0x4e3181||0x1f4;return function(_0xe1c68d){logger[_0x48ab('0x27')](_0xe1c68d[_0x48ab('0x28')]);if(_0xe1c68d[_0x48ab('0x29')]){delete _0xe1c68d['name'];}_0x5085cd[_0x48ab('0x1a')](_0x4e3181)[_0x48ab('0x2a')](_0xe1c68d);};}exports[_0x48ab('0x2b')]=function(_0x1b03fe,_0x26f41b){var _0x5df41d={},_0x4af7db={},_0x371cb7={'count':0x0,'rows':[]};var _0x468419=_[_0x48ab('0x2c')](db['CmHopperAdditionalPhone']['rawAttributes'],function(_0x4f88b2){return{'name':_0x4f88b2[_0x48ab('0x2d')],'type':_0x4f88b2[_0x48ab('0x2e')]['key']};});_0x4af7db['model']=_[_0x48ab('0x2c')](_0x468419,_0x48ab('0x29'));_0x4af7db[_0x48ab('0x2f')]=_[_0x48ab('0x30')](_0x1b03fe[_0x48ab('0x2f')]);_0x4af7db[_0x48ab('0x31')]=_[_0x48ab('0x32')](_0x4af7db[_0x48ab('0x33')],_0x4af7db['query']);_0x5df41d['attributes']=_['intersection'](_0x4af7db[_0x48ab('0x33')],qs[_0x48ab('0x34')](_0x1b03fe[_0x48ab('0x2f')][_0x48ab('0x34')]));_0x5df41d[_0x48ab('0x35')]=_0x5df41d[_0x48ab('0x35')]['length']?_0x5df41d[_0x48ab('0x35')]:_0x4af7db['model'];if(!_0x1b03fe['query']['hasOwnProperty'](_0x48ab('0x36'))){_0x5df41d['limit']=qs['limit'](_0x1b03fe[_0x48ab('0x2f')][_0x48ab('0x1e')]);_0x5df41d[_0x48ab('0x1d')]=qs[_0x48ab('0x1d')](_0x1b03fe['query'][_0x48ab('0x1d')]);}_0x5df41d[_0x48ab('0x37')]=qs[_0x48ab('0x38')](_0x1b03fe[_0x48ab('0x2f')][_0x48ab('0x38')]);_0x5df41d[_0x48ab('0x39')]=qs[_0x48ab('0x31')](_[_0x48ab('0x3a')](_0x1b03fe[_0x48ab('0x2f')],_0x4af7db['filters']),_0x468419);if(_0x1b03fe[_0x48ab('0x2f')]['filter']){_0x5df41d[_0x48ab('0x39')]=_['merge'](_0x5df41d[_0x48ab('0x39')],{'$or':_[_0x48ab('0x2c')](_0x468419,function(_0x22c0c1){if(_0x22c0c1[_0x48ab('0x2e')]!==_0x48ab('0x3b')){var _0x93f623={};_0x93f623[_0x22c0c1['name']]={'$like':'%'+_0x1b03fe['query']['filter']+'%'};return _0x93f623;}})});}_0x5df41d=_[_0x48ab('0x3c')]({},_0x5df41d,_0x1b03fe['options']);var _0x301e60={'where':_0x5df41d[_0x48ab('0x39')]};return db[_0x48ab('0x3d')][_0x48ab('0x1c')](_0x301e60)[_0x48ab('0x23')](function(_0x2fedaf){_0x371cb7[_0x48ab('0x1c')]=_0x2fedaf;if(_0x1b03fe[_0x48ab('0x2f')][_0x48ab('0x3e')]){_0x5df41d[_0x48ab('0x3f')]=[{'all':!![]}];}return db[_0x48ab('0x3d')]['findAll'](_0x5df41d);})[_0x48ab('0x23')](function(_0x5c02fd){_0x371cb7['rows']=_0x5c02fd;return _0x371cb7;})[_0x48ab('0x23')](respondWithFilteredResult(_0x26f41b,_0x5df41d))[_0x48ab('0x40')](handleError(_0x26f41b,null));};exports[_0x48ab('0x41')]=function(_0x24b8a8,_0x3055d8){var _0x15a51c={'raw':!![],'where':{'id':_0x24b8a8[_0x48ab('0x42')]['id']}},_0x400d5a={};_0x400d5a[_0x48ab('0x33')]=_[_0x48ab('0x30')](db[_0x48ab('0x3d')][_0x48ab('0x43')]);_0x400d5a[_0x48ab('0x2f')]=_[_0x48ab('0x30')](_0x24b8a8[_0x48ab('0x2f')]);_0x400d5a['filters']=_[_0x48ab('0x32')](_0x400d5a[_0x48ab('0x33')],_0x400d5a[_0x48ab('0x2f')]);_0x15a51c[_0x48ab('0x35')]=_[_0x48ab('0x32')](_0x400d5a[_0x48ab('0x33')],qs['fields'](_0x24b8a8[_0x48ab('0x2f')][_0x48ab('0x34')]));_0x15a51c[_0x48ab('0x35')]=_0x15a51c[_0x48ab('0x35')]['length']?_0x15a51c['attributes']:_0x400d5a[_0x48ab('0x33')];if(_0x24b8a8[_0x48ab('0x2f')][_0x48ab('0x3e')]){_0x15a51c['include']=[{'all':!![]}];}_0x15a51c=_[_0x48ab('0x3c')]({},_0x15a51c,_0x24b8a8[_0x48ab('0x44')]);return db[_0x48ab('0x3d')][_0x48ab('0x45')](_0x15a51c)['then'](handleEntityNotFound(_0x3055d8,null))[_0x48ab('0x23')](respondWithResult(_0x3055d8,null))[_0x48ab('0x40')](handleError(_0x3055d8,null));};exports[_0x48ab('0x46')]=function(_0x254bfc,_0x519492){return db['CmHopperAdditionalPhone'][_0x48ab('0x46')](_0x254bfc[_0x48ab('0x47')],{})[_0x48ab('0x23')](function(_0x365398){var _0x295efc=_0x254bfc[_0x48ab('0x48')][_0x48ab('0x49')]({'plain':!![]});if(!_0x295efc)throw new Error(_0x48ab('0x4a'));if(_0x295efc[_0x48ab('0x4b')]===_0x48ab('0x48')){var _0x4ec265=_0x365398[_0x48ab('0x49')]({'plain':!![]});var _0x4805cd=_0x48ab('0x25');return db[_0x48ab('0x4c')]['find']({'where':{'name':_0x4805cd,'userProfileId':_0x295efc[_0x48ab('0x4d')]},'raw':!![]})[_0x48ab('0x23')](function(_0x1558aa){if(_0x1558aa&&_0x1558aa[_0x48ab('0x4e')]===0x0){return db[_0x48ab('0x26')][_0x48ab('0x46')]({'name':_0x4ec265[_0x48ab('0x29')],'resourceId':_0x4ec265['id'],'type':_0x1558aa['name'],'sectionId':_0x1558aa['id']},{})[_0x48ab('0x23')](function(){return _0x365398;});}else{return _0x365398;}})['catch'](function(_0x994212){logger[_0x48ab('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x994212);throw _0x994212;});}return _0x365398;})[_0x48ab('0x23')](respondWithResult(_0x519492,0xc9))['catch'](handleError(_0x519492,null));};exports[_0x48ab('0x22')]=function(_0x4cc29b,_0x108ef4){if(_0x4cc29b[_0x48ab('0x47')]['id']){delete _0x4cc29b[_0x48ab('0x47')]['id'];}return db[_0x48ab('0x3d')]['find']({'where':{'id':_0x4cc29b[_0x48ab('0x42')]['id']}})[_0x48ab('0x23')](handleEntityNotFound(_0x108ef4,null))[_0x48ab('0x23')](saveUpdates(_0x4cc29b['body'],null))['then'](respondWithResult(_0x108ef4,null))[_0x48ab('0x40')](handleError(_0x108ef4,null));};exports[_0x48ab('0x24')]=function(_0x17ccbb,_0x4c40a6){return db[_0x48ab('0x3d')]['find']({'where':{'id':_0x17ccbb['params']['id']}})[_0x48ab('0x23')](handleEntityNotFound(_0x4c40a6,null))[_0x48ab('0x23')](removeEntity(_0x4c40a6,null))[_0x48ab('0x40')](handleError(_0x4c40a6,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 5015fc1..ab7bda3 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 _0xccaf=['lodash','util','../../config/logger','api','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xccaf,0x168));var _0xfcca=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xccaf[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0xfcca('0x0'));var util=require(_0xfcca('0x1'));var logger=require(_0xfcca('0x2'))(_0xfcca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfcca('0x4'));module[_0xfcca('0x5')]=function(_0x5ce7c2,_0x43b36e){return _0x5ce7c2[_0xfcca('0x6')](_0xfcca('0x7'),attributes,{'tableName':_0xfcca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9475=['./cmHopperAdditionalPhone.attributes','cm_hopper_additional_phones','lodash','util','api','path','rimraf','../../config/environment'];(function(_0x4babeb,_0x28aaa){var _0x40bc6f=function(_0x29559e){while(--_0x29559e){_0x4babeb['push'](_0x4babeb['shift']());}};_0x40bc6f(++_0x28aaa);}(_0x9475,0x172));var _0x5947=function(_0x4053ca,_0x25b1fd){_0x4053ca=_0x4053ca-0x0;var _0x364f65=_0x9475[_0x4053ca];return _0x364f65;};'use strict';var _=require(_0x5947('0x0'));var util=require(_0x5947('0x1'));var logger=require('../../config/logger')(_0x5947('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5947('0x3'));var rimraf=require(_0x5947('0x4'));var config=require(_0x5947('0x5'));var attributes=require(_0x5947('0x6'));module['exports']=function(_0x333a14,_0x5549e3){return _0x333a14['define']('CmHopperAdditionalPhone',attributes,{'tableName':_0x5947('0x7'),'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 9237f70..eb64e6b 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 _0x0c0b=['VerifyAdditionalPhones','findOne','body','ListId','VoiceQueueId','CampaignId','OrderBy','ASC','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry','SwapAdditionalPhones','CmHopper','ContactId','duration','waitTime','info','add','minutes','scheduledat','isNil','createdAt','updatedAt','phone','countcongestionretry','hopperToAdd','update','IncrementPreviewCounters','field','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x5c3194,_0x2ebfec){var _0x402748=function(_0x52a8b4){while(--_0x52a8b4){_0x5c3194['push'](_0x5c3194['shift']());}};_0x402748(++_0x2ebfec);}(_0x0c0b,0x1e4));var _0xb0c0=function(_0x5273d3,_0x40269d){_0x5273d3=_0x5273d3-0x0;var _0x325189=_0x0c0b[_0x5273d3];return _0x325189;};'use strict';var _=require(_0xb0c0('0x0'));var util=require(_0xb0c0('0x1'));var moment=require('moment');var BPromise=require(_0xb0c0('0x2'));var rs=require(_0xb0c0('0x3'));var fs=require('fs');var Redis=require(_0xb0c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb0c0('0x5'));var logger=require(_0xb0c0('0x6'))(_0xb0c0('0x7'));var config=require(_0xb0c0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb0c0('0x9')][_0xb0c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x332854,_0x41cd4f,_0x346b28){return new BPromise(function(_0x37fd07,_0x5af5f6){return client['request'](_0x332854,_0x346b28)[_0xb0c0('0xb')](function(_0x2c09e8){logger['info'](_0xb0c0('0xc'),_0x41cd4f,_0xb0c0('0xd'));logger[_0xb0c0('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x41cd4f,'request\x20sent',JSON[_0xb0c0('0xf')](_0x2c09e8));if(_0x2c09e8[_0xb0c0('0x10')]){if(_0x2c09e8['error'][_0xb0c0('0x11')]===0x1f4){logger[_0xb0c0('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x41cd4f,_0x2c09e8[_0xb0c0('0x10')]['message']);return _0x5af5f6(_0x2c09e8[_0xb0c0('0x10')][_0xb0c0('0x12')]);}logger[_0xb0c0('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x41cd4f,_0x2c09e8['error']['message']);return _0x37fd07(_0x2c09e8[_0xb0c0('0x10')][_0xb0c0('0x12')]);}else{logger['info'](_0xb0c0('0xc'),_0x41cd4f,_0xb0c0('0xd'));_0x37fd07(_0x2c09e8['result'][_0xb0c0('0x12')]);}})[_0xb0c0('0x13')](function(_0x4fbd0b){logger[_0xb0c0('0x10')](_0xb0c0('0xc'),_0x41cd4f,_0x4fbd0b);_0x5af5f6(_0x4fbd0b);});});}exports[_0xb0c0('0x14')]=function(_0x281181){var _0x36a02d=this;return new Promise(function(_0x2bad2a,_0x1f0edd){return db['CmHopper'][_0xb0c0('0x15')]({'raw':!![],'where':{'ContactId':_0x281181[_0xb0c0('0x16')]['ContactId'],'ListId':_0x281181[_0xb0c0('0x16')][_0xb0c0('0x17')],'VoiceQueueId':_0x281181[_0xb0c0('0x16')][_0xb0c0('0x18')]===undefined?null:_0x281181[_0xb0c0('0x16')][_0xb0c0('0x18')],'CampaignId':_0x281181[_0xb0c0('0x16')][_0xb0c0('0x19')]===undefined?null:_0x281181['body'][_0xb0c0('0x19')]}})['then'](function(_0x352738){if(_0x352738!=null){return db['CmHopperAdditionalPhone'][_0xb0c0('0x15')]({'raw':!![],'where':{'CmHopperId':_0x352738['id'],'OrderBy':{'$gt':_0x352738[_0xb0c0('0x1a')]}},'order':[[_0xb0c0('0x1a'),_0xb0c0('0x1b')]]})['then'](function(_0x4d7324){var _0x58030b=0x0;if(_0x4d7324){if(_0x4d7324[_0xb0c0('0x1c')]+_0x4d7324['countcongestionretry']+_0x4d7324[_0xb0c0('0x1d')]+_0x4d7324['countnosuchnumberretry']+_0x4d7324[_0xb0c0('0x1e')]+_0x4d7324[_0xb0c0('0x1f')]+_0x4d7324[_0xb0c0('0x20')]+_0x4d7324[_0xb0c0('0x21')]<_0x281181[_0xb0c0('0x22')][_0xb0c0('0x23')])_0x58030b=0x1;_0x2bad2a({'additional':_0x58030b});}else{return db[_0xb0c0('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x352738['id']},'order':[[_0xb0c0('0x1a'),_0xb0c0('0x1b')]]})[_0xb0c0('0xb')](function(_0x14e185){var _0x563c53=0x0;if(_0x14e185){if(_0x14e185[_0xb0c0('0x1c')]+_0x14e185['countcongestionretry']+_0x14e185[_0xb0c0('0x1d')]+_0x14e185[_0xb0c0('0x25')]+_0x14e185['countdropretry']+_0x14e185['countabandonedretry']+_0x14e185[_0xb0c0('0x20')]+_0x14e185['countagentrejectretry']<_0x281181[_0xb0c0('0x22')][_0xb0c0('0x23')])_0x563c53=0x1;_0x2bad2a({'additional':_0x563c53});}else{_0x2bad2a({'additional':0x0});}})[_0xb0c0('0x13')](function(_0x416a4f){logger[_0xb0c0('0x10')]('VerifyAdditionalPhones',_0x416a4f[_0xb0c0('0x12')],_0x281181);_0x1f0edd(_0x36a02d['error'](0x1f4,_0x416a4f[_0xb0c0('0x12')]));});}})[_0xb0c0('0x13')](function(_0x338235){logger[_0xb0c0('0x10')](_0xb0c0('0x14'),_0x338235[_0xb0c0('0x12')],_0x281181);_0x1f0edd(_0x36a02d[_0xb0c0('0x10')](0x1f4,_0x338235[_0xb0c0('0x12')]));});}else _0x2bad2a({'additional':0x0});});});};exports[_0xb0c0('0x26')]=function(_0x49376c){var _0x14cd27=this;return new Promise(function(_0x5927c4,_0x2b30b1){return db[_0xb0c0('0x27')][_0xb0c0('0x15')]({'raw':!![],'where':{'ContactId':_0x49376c[_0xb0c0('0x16')][_0xb0c0('0x28')],'ListId':_0x49376c['body']['ListId'],'VoiceQueueId':_0x49376c['body'][_0xb0c0('0x18')]===undefined?null:_0x49376c[_0xb0c0('0x16')]['VoiceQueueId'],'CampaignId':_0x49376c[_0xb0c0('0x16')]['CampaignId']===undefined?null:_0x49376c['body'][_0xb0c0('0x19')]}})[_0xb0c0('0xb')](function(_0x229c52){if(_0x229c52!=null){return db[_0xb0c0('0x24')][_0xb0c0('0x15')]({'raw':!![],'where':{'CmHopperId':_0x229c52['id'],'OrderBy':{'$gt':_0x229c52['OrderBy']}},'order':[[_0xb0c0('0x1a'),_0xb0c0('0x1b')]]})[_0xb0c0('0xb')](function(_0x3c49b5){if(_0x3c49b5)return activateAdditionalPhone(_0x229c52,_0x49376c[_0xb0c0('0x16')],_0x3c49b5,_0x49376c[_0xb0c0('0x29')],_0x49376c[_0xb0c0('0x2a')])['then'](function(_0x2fe50a){_0x5927c4(_0x2fe50a);});else{return db[_0xb0c0('0x24')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x229c52['id']},'order':[[_0xb0c0('0x1a'),_0xb0c0('0x1b')]]})[_0xb0c0('0xb')](function(_0x5e7645){if(_0x5e7645)return activateAdditionalPhone(_0x229c52,_0x49376c[_0xb0c0('0x16')],_0x5e7645,_0x49376c['duration'],_0x49376c[_0xb0c0('0x2a')])[_0xb0c0('0xb')](function(_0x2444f8){_0x5927c4(_0x2444f8);});else{_0x5927c4({'id':_0x229c52['id'],'phone':''});}})[_0xb0c0('0x13')](function(_0x5438ee){logger['error']('VerifyAdditionalPhones',_0x5438ee[_0xb0c0('0x12')],_0x49376c);_0x2b30b1(_0x14cd27['error'](0x1f4,_0x5438ee[_0xb0c0('0x12')]));});}})[_0xb0c0('0x13')](function(_0x5a1e1c){logger[_0xb0c0('0x10')](_0xb0c0('0x14'),_0x5a1e1c[_0xb0c0('0x12')],_0x49376c);_0x2b30b1(_0x14cd27[_0xb0c0('0x10')](0x1f4,_0x5a1e1c['message']));});}else _0x5927c4(0x1);});});};function activateAdditionalPhone(_0x2226fa,_0x18f035,_0x399a55,_0x22c508,_0x37a651){return new Promise(function(_0x16006b,_0x116816){logger[_0xb0c0('0x2b')](_0xb0c0('0x14'),_0x399a55);var _0xd9faa9;if(moment()>moment(_0x399a55['scheduledat'])){_0xd9faa9=moment()[_0xb0c0('0x2c')](_0x37a651||0x3,_0xb0c0('0x2d'));}else{if(_0x399a55[_0xb0c0('0x1a')]==0x0){_0xd9faa9=moment(_0x399a55[_0xb0c0('0x2e')]);}else{_0xd9faa9=moment()[_0xb0c0('0x2c')](_0x37a651||0x3,_0xb0c0('0x2d'));}}var _0x1b68d1={'phone':_0x2226fa['phone'],'active':0x0,'OrderBy':_[_0xb0c0('0x2f')](_0x2226fa[_0xb0c0('0x1a')])?0x0:_0x2226fa[_0xb0c0('0x1a')],'scheduledat':moment()['add'](_0x22c508||0x1,_0xb0c0('0x2d')),'countbusyretry':_0x18f035['countbusyretry'],'countcongestionretry':_0x18f035['countcongestionretry'],'countnoanswerretry':_0x18f035[_0xb0c0('0x1d')],'countnosuchnumberretry':_0x18f035[_0xb0c0('0x25')],'countdropretry':_0x18f035[_0xb0c0('0x1e')],'countabandonedretry':_0x18f035[_0xb0c0('0x1f')],'countmachineretry':_0x18f035[_0xb0c0('0x20')],'countagentrejectretry':_0x18f035[_0xb0c0('0x21')],'createdAt':_0x18f035[_0xb0c0('0x30')],'updatedAt':_0x18f035[_0xb0c0('0x31')]};var _0x29b356={'CmHopperId':_0x2226fa['id'],'phone':_0x399a55[_0xb0c0('0x32')],'active':0x0,'OrderBy':_[_0xb0c0('0x2f')](_0x399a55[_0xb0c0('0x1a')])?0x0:_0x399a55[_0xb0c0('0x1a')],'scheduledat':_0xd9faa9,'countbusyretry':_0x399a55[_0xb0c0('0x1c')],'countcongestionretry':_0x399a55[_0xb0c0('0x33')],'countnoanswerretry':_0x399a55['countnoanswerretry'],'countnosuchnumberretry':_0x18f035[_0xb0c0('0x25')],'countdropretry':_0x18f035[_0xb0c0('0x1e')],'countabandonedretry':_0x18f035[_0xb0c0('0x1f')],'countmachineretry':_0x18f035[_0xb0c0('0x20')],'countagentrejectretry':_0x18f035[_0xb0c0('0x21')],'createdAt':_0x399a55[_0xb0c0('0x30')],'updatedAt':_0x399a55[_0xb0c0('0x31')]};logger[_0xb0c0('0x2b')](_0xb0c0('0x34'),_0x1b68d1);logger[_0xb0c0('0x2b')]('additionalToHop',_0x29b356);return db['sequelize']['transaction'](function(_0x26a0b0){return db['CmHopperAdditionalPhone'][_0xb0c0('0x35')](_0x1b68d1,{'where':{'id':_0x399a55['id']}},{'transaction':_0x26a0b0})['then'](function(){return db['CmHopper'][_0xb0c0('0x35')](_0x29b356,{'where':{'id':_0x2226fa['id']}},{'transaction':_0x26a0b0});});})[_0xb0c0('0xb')](function(_0x407682){_0x16006b({'id':_0x2226fa['id'],'phone':_0x399a55[_0xb0c0('0x32')]});})[_0xb0c0('0x13')](function(_0x2377b8){logger[_0xb0c0('0x10')](_0xb0c0('0x14'),_0x2377b8[_0xb0c0('0x12')],req);_0x116816(_this[_0xb0c0('0x10')](0x1f4,_0x2377b8['message']));});});}exports[_0xb0c0('0x36')]=function(_0xab7937){var _0x3189fd=this;return new Promise(function(_0x2944a1,_0x53a00c){return db[_0xb0c0('0x27')][_0xb0c0('0x35')](_0xab7937[_0xb0c0('0x16')][_0xb0c0('0x37')],{'where':{'id':_0xab7937[_0xb0c0('0x16')]['id']}})[_0xb0c0('0xb')](function(_0x2f17db){_0x2944a1(_0x2f17db);})[_0xb0c0('0x13')](function(_0xc0d5b2){logger[_0xb0c0('0x10')](_0xb0c0('0x36'),_0xc0d5b2[_0xb0c0('0x12')],_0xab7937);_0x53a00c(_0x3189fd[_0xb0c0('0x10')](0x1f4,_0xc0d5b2['message']));});});}; \ No newline at end of file +var _0x2f6b=['minutes','phone','isNil','createdAt','updatedAt','hopperToAdd','additionalToHop','transaction','update','IncrementPreviewCounters','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','entity','dialGlobalMaxRetry','countnoanswerretry','countdropretry','countagentrejectretry','SwapAdditionalPhones','duration','waitTime','scheduledat','add'];(function(_0x27d724,_0x48f7a6){var _0x423a52=function(_0x3c7d1d){while(--_0x3c7d1d){_0x27d724['push'](_0x27d724['shift']());}};_0x423a52(++_0x48f7a6);}(_0x2f6b,0x172));var _0xb2f6=function(_0x21481c,_0x1b51ba){_0x21481c=_0x21481c-0x0;var _0x5dd77a=_0x2f6b[_0x21481c];return _0x5dd77a;};'use strict';var _=require('lodash');var util=require(_0xb2f6('0x0'));var moment=require(_0xb2f6('0x1'));var BPromise=require(_0xb2f6('0x2'));var rs=require(_0xb2f6('0x3'));var fs=require('fs');var Redis=require(_0xb2f6('0x4'));var db=require(_0xb2f6('0x5'))['db'];var utils=require(_0xb2f6('0x6'));var logger=require(_0xb2f6('0x7'))(_0xb2f6('0x8'));var config=require(_0xb2f6('0x9'));var jayson=require(_0xb2f6('0xa'));var client=jayson[_0xb2f6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9f27,_0x4123c6,_0x330b28){return new BPromise(function(_0x21ab5b,_0x4a63f4){return client[_0xb2f6('0xc')](_0x4e9f27,_0x330b28)['then'](function(_0x15c15a){logger[_0xb2f6('0xd')](_0xb2f6('0xe'),_0x4123c6,_0xb2f6('0xf'));logger[_0xb2f6('0x10')](_0xb2f6('0x11'),_0x4123c6,_0xb2f6('0xf'),JSON[_0xb2f6('0x12')](_0x15c15a));if(_0x15c15a[_0xb2f6('0x13')]){if(_0x15c15a['error'][_0xb2f6('0x14')]===0x1f4){logger[_0xb2f6('0x13')](_0xb2f6('0xe'),_0x4123c6,_0x15c15a[_0xb2f6('0x13')]['message']);return _0x4a63f4(_0x15c15a[_0xb2f6('0x13')]['message']);}logger['error'](_0xb2f6('0xe'),_0x4123c6,_0x15c15a[_0xb2f6('0x13')]['message']);return _0x21ab5b(_0x15c15a[_0xb2f6('0x13')][_0xb2f6('0x15')]);}else{logger[_0xb2f6('0xd')](_0xb2f6('0xe'),_0x4123c6,_0xb2f6('0xf'));_0x21ab5b(_0x15c15a['result'][_0xb2f6('0x15')]);}})[_0xb2f6('0x16')](function(_0x53df3f){logger[_0xb2f6('0x13')](_0xb2f6('0xe'),_0x4123c6,_0x53df3f);_0x4a63f4(_0x53df3f);});});}exports[_0xb2f6('0x17')]=function(_0x1fc9ac){var _0x170f27=this;return new Promise(function(_0x339675,_0x567eb4){return db[_0xb2f6('0x18')][_0xb2f6('0x19')]({'raw':!![],'where':{'ContactId':_0x1fc9ac[_0xb2f6('0x1a')][_0xb2f6('0x1b')],'ListId':_0x1fc9ac[_0xb2f6('0x1a')][_0xb2f6('0x1c')],'VoiceQueueId':_0x1fc9ac[_0xb2f6('0x1a')][_0xb2f6('0x1d')]===undefined?null:_0x1fc9ac[_0xb2f6('0x1a')][_0xb2f6('0x1d')],'CampaignId':_0x1fc9ac[_0xb2f6('0x1a')][_0xb2f6('0x1e')]===undefined?null:_0x1fc9ac['body'][_0xb2f6('0x1e')]}})[_0xb2f6('0x1f')](function(_0x5bb946){if(_0x5bb946!=null){return db[_0xb2f6('0x20')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x5bb946['id'],'OrderBy':{'$gt':_0x5bb946[_0xb2f6('0x21')]}},'order':[[_0xb2f6('0x21'),_0xb2f6('0x22')]]})['then'](function(_0x44dd7e){var _0x4d2c24=0x0;if(_0x44dd7e){if(_0x44dd7e[_0xb2f6('0x23')]+_0x44dd7e[_0xb2f6('0x24')]+_0x44dd7e['countnoanswerretry']+_0x44dd7e[_0xb2f6('0x25')]+_0x44dd7e['countdropretry']+_0x44dd7e[_0xb2f6('0x26')]+_0x44dd7e[_0xb2f6('0x27')]+_0x44dd7e['countagentrejectretry']<_0x1fc9ac[_0xb2f6('0x28')][_0xb2f6('0x29')])_0x4d2c24=0x1;_0x339675({'additional':_0x4d2c24});}else{return db[_0xb2f6('0x20')][_0xb2f6('0x19')]({'raw':!![],'where':{'CmHopperId':_0x5bb946['id']},'order':[[_0xb2f6('0x21'),_0xb2f6('0x22')]]})['then'](function(_0x5f18e2){var _0x11fe23=0x0;if(_0x5f18e2){if(_0x5f18e2[_0xb2f6('0x23')]+_0x5f18e2[_0xb2f6('0x24')]+_0x5f18e2[_0xb2f6('0x2a')]+_0x5f18e2[_0xb2f6('0x25')]+_0x5f18e2[_0xb2f6('0x2b')]+_0x5f18e2[_0xb2f6('0x26')]+_0x5f18e2['countmachineretry']+_0x5f18e2[_0xb2f6('0x2c')]<_0x1fc9ac[_0xb2f6('0x28')][_0xb2f6('0x29')])_0x11fe23=0x1;_0x339675({'additional':_0x11fe23});}else{_0x339675({'additional':0x0});}})[_0xb2f6('0x16')](function(_0x16d956){logger['error'](_0xb2f6('0x17'),_0x16d956[_0xb2f6('0x15')],_0x1fc9ac);_0x567eb4(_0x170f27[_0xb2f6('0x13')](0x1f4,_0x16d956[_0xb2f6('0x15')]));});}})[_0xb2f6('0x16')](function(_0x11feaa){logger[_0xb2f6('0x13')](_0xb2f6('0x17'),_0x11feaa[_0xb2f6('0x15')],_0x1fc9ac);_0x567eb4(_0x170f27['error'](0x1f4,_0x11feaa[_0xb2f6('0x15')]));});}else _0x339675({'additional':0x0});});});};exports[_0xb2f6('0x2d')]=function(_0x2d8262){var _0x174227=this;return new Promise(function(_0x36ce31,_0x2b3780){return db['CmHopper'][_0xb2f6('0x19')]({'raw':!![],'where':{'ContactId':_0x2d8262['body'][_0xb2f6('0x1b')],'ListId':_0x2d8262[_0xb2f6('0x1a')][_0xb2f6('0x1c')],'VoiceQueueId':_0x2d8262['body'][_0xb2f6('0x1d')]===undefined?null:_0x2d8262[_0xb2f6('0x1a')][_0xb2f6('0x1d')],'CampaignId':_0x2d8262[_0xb2f6('0x1a')][_0xb2f6('0x1e')]===undefined?null:_0x2d8262['body']['CampaignId']}})[_0xb2f6('0x1f')](function(_0x48805d){if(_0x48805d!=null){return db[_0xb2f6('0x20')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x48805d['id'],'OrderBy':{'$gt':_0x48805d[_0xb2f6('0x21')]}},'order':[[_0xb2f6('0x21'),_0xb2f6('0x22')]]})[_0xb2f6('0x1f')](function(_0x44385f){if(_0x44385f)return activateAdditionalPhone(_0x48805d,_0x2d8262[_0xb2f6('0x1a')],_0x44385f,_0x2d8262[_0xb2f6('0x2e')],_0x2d8262[_0xb2f6('0x2f')])['then'](function(_0x33d3d6){_0x36ce31(_0x33d3d6);});else{return db[_0xb2f6('0x20')][_0xb2f6('0x19')]({'raw':!![],'where':{'CmHopperId':_0x48805d['id']},'order':[[_0xb2f6('0x21'),'ASC']]})[_0xb2f6('0x1f')](function(_0x29eaff){if(_0x29eaff)return activateAdditionalPhone(_0x48805d,_0x2d8262[_0xb2f6('0x1a')],_0x29eaff,_0x2d8262[_0xb2f6('0x2e')],_0x2d8262[_0xb2f6('0x2f')])['then'](function(_0x48f9c7){_0x36ce31(_0x48f9c7);});else{_0x36ce31({'id':_0x48805d['id'],'phone':''});}})[_0xb2f6('0x16')](function(_0xfa9206){logger[_0xb2f6('0x13')](_0xb2f6('0x17'),_0xfa9206[_0xb2f6('0x15')],_0x2d8262);_0x2b3780(_0x174227['error'](0x1f4,_0xfa9206[_0xb2f6('0x15')]));});}})[_0xb2f6('0x16')](function(_0x10da01){logger[_0xb2f6('0x13')]('VerifyAdditionalPhones',_0x10da01[_0xb2f6('0x15')],_0x2d8262);_0x2b3780(_0x174227[_0xb2f6('0x13')](0x1f4,_0x10da01[_0xb2f6('0x15')]));});}else _0x36ce31(0x1);});});};function activateAdditionalPhone(_0x237f46,_0x24f4ff,_0x3806c9,_0x104096,_0x3b2a4d){return new Promise(function(_0x520e7d,_0x2618d1){logger[_0xb2f6('0xd')](_0xb2f6('0x17'),_0x3806c9);var _0xc2bbf8;if(moment()>moment(_0x3806c9[_0xb2f6('0x30')])){_0xc2bbf8=moment()[_0xb2f6('0x31')](_0x3b2a4d||0x3,_0xb2f6('0x32'));}else{if(_0x3806c9[_0xb2f6('0x21')]==0x0){_0xc2bbf8=moment(_0x3806c9[_0xb2f6('0x30')]);}else{_0xc2bbf8=moment()[_0xb2f6('0x31')](_0x3b2a4d||0x3,_0xb2f6('0x32'));}}var _0x41e341={'phone':_0x237f46[_0xb2f6('0x33')],'active':0x0,'OrderBy':_[_0xb2f6('0x34')](_0x237f46[_0xb2f6('0x21')])?0x0:_0x237f46['OrderBy'],'scheduledat':moment()[_0xb2f6('0x31')](_0x104096||0x1,_0xb2f6('0x32')),'countbusyretry':_0x24f4ff[_0xb2f6('0x23')],'countcongestionretry':_0x24f4ff[_0xb2f6('0x24')],'countnoanswerretry':_0x24f4ff[_0xb2f6('0x2a')],'countnosuchnumberretry':_0x24f4ff[_0xb2f6('0x25')],'countdropretry':_0x24f4ff[_0xb2f6('0x2b')],'countabandonedretry':_0x24f4ff[_0xb2f6('0x26')],'countmachineretry':_0x24f4ff[_0xb2f6('0x27')],'countagentrejectretry':_0x24f4ff['countagentrejectretry'],'createdAt':_0x24f4ff[_0xb2f6('0x35')],'updatedAt':_0x24f4ff[_0xb2f6('0x36')]};var _0x526c97={'CmHopperId':_0x237f46['id'],'phone':_0x3806c9['phone'],'active':0x0,'OrderBy':_[_0xb2f6('0x34')](_0x3806c9[_0xb2f6('0x21')])?0x0:_0x3806c9['OrderBy'],'scheduledat':_0xc2bbf8,'countbusyretry':_0x3806c9[_0xb2f6('0x23')],'countcongestionretry':_0x3806c9[_0xb2f6('0x24')],'countnoanswerretry':_0x3806c9[_0xb2f6('0x2a')],'countnosuchnumberretry':_0x24f4ff['countnosuchnumberretry'],'countdropretry':_0x24f4ff[_0xb2f6('0x2b')],'countabandonedretry':_0x24f4ff[_0xb2f6('0x26')],'countmachineretry':_0x24f4ff[_0xb2f6('0x27')],'countagentrejectretry':_0x24f4ff[_0xb2f6('0x2c')],'createdAt':_0x3806c9['createdAt'],'updatedAt':_0x3806c9[_0xb2f6('0x36')]};logger[_0xb2f6('0xd')](_0xb2f6('0x37'),_0x41e341);logger['info'](_0xb2f6('0x38'),_0x526c97);return db['sequelize'][_0xb2f6('0x39')](function(_0x3ef998){return db['CmHopperAdditionalPhone'][_0xb2f6('0x3a')](_0x41e341,{'where':{'id':_0x3806c9['id']}},{'transaction':_0x3ef998})[_0xb2f6('0x1f')](function(){return db[_0xb2f6('0x18')][_0xb2f6('0x3a')](_0x526c97,{'where':{'id':_0x237f46['id']}},{'transaction':_0x3ef998});});})[_0xb2f6('0x1f')](function(_0x3811a0){_0x520e7d({'id':_0x237f46['id'],'phone':_0x3806c9[_0xb2f6('0x33')]});})[_0xb2f6('0x16')](function(_0x309a81){logger['error'](_0xb2f6('0x17'),_0x309a81[_0xb2f6('0x15')],req);_0x2618d1(_this[_0xb2f6('0x13')](0x1f4,_0x309a81[_0xb2f6('0x15')]));});});}exports[_0xb2f6('0x3b')]=function(_0x15710c){var _0x597c2d=this;return new Promise(function(_0x254882,_0x517d11){return db[_0xb2f6('0x18')]['update'](_0x15710c['body']['field'],{'where':{'id':_0x15710c[_0xb2f6('0x1a')]['id']}})['then'](function(_0xa07c8e){_0x254882(_0xa07c8e);})['catch'](function(_0x2e1835){logger['error'](_0xb2f6('0x3b'),_0x2e1835[_0xb2f6('0x15')],_0x15710c);_0x517d11(_0x597c2d[_0xb2f6('0x13')](0x1f4,_0x2e1835[_0xb2f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index d99d625..390032f 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 _0xc765=['exports','multer','util','path','express','../../components/auth/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','post','create','put','update','/:id'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0xc765,0x14b));var _0x5c76=function(_0x5e104c,_0x10e9a6){_0x5e104c=_0x5e104c-0x0;var _0x3e9b68=_0xc765[_0x5e104c];return _0x3e9b68;};'use strict';var multer=require(_0x5c76('0x0'));var util=require(_0x5c76('0x1'));var path=require(_0x5c76('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c76('0x3'));var router=express['Router']();var auth=require(_0x5c76('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5c76('0x5'));var controller=require(_0x5c76('0x6'));router['get']('/',auth[_0x5c76('0x7')](),controller[_0x5c76('0x8')]);router['get']('/:id',auth[_0x5c76('0x7')](),controller['show']);router[_0x5c76('0x9')]('/',auth[_0x5c76('0x7')](),controller[_0x5c76('0xa')]);router[_0x5c76('0xb')]('/:id',auth[_0x5c76('0x7')](),controller[_0x5c76('0xc')]);router['delete'](_0x5c76('0xd'),auth[_0x5c76('0x7')](),controller['destroy']);module[_0x5c76('0xe')]=router; \ No newline at end of file +var _0x8bea=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update','delete','/:id','destroy','exports','multer','util'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8bea,0x96));var _0xa8be=function(_0x1d78bd,_0x55da95){_0x1d78bd=_0x1d78bd-0x0;var _0x51fc0e=_0x8bea[_0x1d78bd];return _0x51fc0e;};'use strict';var multer=require(_0xa8be('0x0'));var util=require(_0xa8be('0x1'));var path=require(_0xa8be('0x2'));var timeout=require(_0xa8be('0x3'));var express=require('express');var router=express[_0xa8be('0x4')]();var auth=require(_0xa8be('0x5'));var interaction=require(_0xa8be('0x6'));var config=require(_0xa8be('0x7'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xa8be('0x8')]('/',auth[_0xa8be('0x9')](),controller[_0xa8be('0xa')]);router['get']('/:id',auth[_0xa8be('0x9')](),controller['show']);router[_0xa8be('0xb')]('/',auth[_0xa8be('0x9')](),controller[_0xa8be('0xc')]);router[_0xa8be('0xd')]('/:id',auth[_0xa8be('0x9')](),controller[_0xa8be('0xe')]);router[_0xa8be('0xf')](_0xa8be('0x10'),auth[_0xa8be('0x9')](),controller[_0xa8be('0x11')]);module[_0xa8be('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index dcbdaa0..f4938ca 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 _0x298e=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x298e,0x159));var _0xe298=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x298e[_0x122ef9];return _0x42fba0;};'use strict';var moment=require(_0xe298('0x0'));var Sequelize=require(_0xe298('0x1'));module[_0xe298('0x2')]={'phone':{'type':Sequelize[_0xe298('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe298('0x4')],'unique':_0xe298('0x5')},'ListId':{'type':Sequelize[_0xe298('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe298('0x5')}}; \ No newline at end of file +var _0x13d5=['contactListQueue','sequelize','exports','INTEGER'];(function(_0x9366b5,_0x2f67c4){var _0x34334b=function(_0x14c5e6){while(--_0x14c5e6){_0x9366b5['push'](_0x9366b5['shift']());}};_0x34334b(++_0x2f67c4);}(_0x13d5,0xc1));var _0x513d=function(_0x15ab72,_0x1be302){_0x15ab72=_0x15ab72-0x0;var _0x45eee1=_0x13d5[_0x15ab72];return _0x45eee1;};'use strict';var moment=require('moment');var Sequelize=require(_0x513d('0x0'));module[_0x513d('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x513d('0x2')],'unique':_0x513d('0x3')},'ListId':{'type':Sequelize[_0x513d('0x2')],'unique':_0x513d('0x3')},'VoiceQueueId':{'type':Sequelize[_0x513d('0x2')],'unique':_0x513d('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index de09541..c4cfe8c 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(_0x59421b,_0x1fe6fa){var _0x12e0e6=function(_0x2f6e5b){while(--_0x2f6e5b){_0x59421b['push'](_0x59421b['shift']());}};_0x12e0e6(++_0x1fe6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_0x3f9570,_0x3b0ee3){var _0x79e824=function(_0x217bb7){while(--_0x217bb7){_0x3f9570['push'](_0x3f9570['shift']());}};_0x79e824(++_0x3b0ee3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 08d3855..6a56e7b 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 _0x9c44=['request-promise','path','./cmHopperBlack.attributes','define','CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird'];(function(_0x28ac5a,_0x5619b4){var _0x3f2860=function(_0x5d00f1){while(--_0x5d00f1){_0x28ac5a['push'](_0x28ac5a['shift']());}};_0x3f2860(++_0x5619b4);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5f3ec0,_0x2e5727){var _0x4fc278=function(_0x467657){while(--_0x467657){_0x5f3ec0['push'](_0x5f3ec0['shift']());}};_0x4fc278(++_0x2e5727);}(_0xe706,0xa3));var _0x6e70=function(_0x2d04a6,_0x5bbf0a){_0x2d04a6=_0x2d04a6-0x0;var _0x3cd00e=_0xe706[_0x2d04a6];return _0x3cd00e;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 999d94a..ac59d6a 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 _0x485c=['stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','include','model','map','UpdateCmHopperBlack','DestroyCmHopperBlack','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s'];(function(_0x5f30a0,_0xc98d78){var _0x347887=function(_0x1b668a){while(--_0x1b668a){_0x5f30a0['push'](_0x5f30a0['shift']());}};_0x347887(++_0xc98d78);}(_0x485c,0x1a9));var _0xc485=function(_0x379ca6,_0x576458){_0x379ca6=_0x379ca6-0x0;var _0xee4c27=_0x485c[_0x379ca6];return _0xee4c27;};'use strict';var _=require('lodash');var util=require(_0xc485('0x0'));var moment=require(_0xc485('0x1'));var BPromise=require(_0xc485('0x2'));var rs=require(_0xc485('0x3'));var fs=require('fs');var Redis=require(_0xc485('0x4'));var db=require(_0xc485('0x5'))['db'];var utils=require(_0xc485('0x6'));var logger=require(_0xc485('0x7'))(_0xc485('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc485('0x9')][_0xc485('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58e9be,_0x4804b8,_0x1461fb){return new BPromise(function(_0xc1666a,_0x5661e9){return client[_0xc485('0xb')](_0x58e9be,_0x1461fb)[_0xc485('0xc')](function(_0x4804a9){logger[_0xc485('0xd')](_0xc485('0xe'),_0x4804b8,'request\x20sent');logger[_0xc485('0xf')](_0xc485('0x10'),_0x4804b8,'request\x20sent',JSON[_0xc485('0x11')](_0x4804a9));if(_0x4804a9[_0xc485('0x12')]){if(_0x4804a9['error'][_0xc485('0x13')]===0x1f4){logger[_0xc485('0x12')](_0xc485('0xe'),_0x4804b8,_0x4804a9[_0xc485('0x12')][_0xc485('0x14')]);return _0x5661e9(_0x4804a9['error'][_0xc485('0x14')]);}logger[_0xc485('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x4804b8,_0x4804a9[_0xc485('0x12')][_0xc485('0x14')]);return _0xc1666a(_0x4804a9[_0xc485('0x12')][_0xc485('0x14')]);}else{logger[_0xc485('0xd')](_0xc485('0xe'),_0x4804b8,'request\x20sent');_0xc1666a(_0x4804a9['result']['message']);}})[_0xc485('0x15')](function(_0x3db83f){logger[_0xc485('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x4804b8,_0x3db83f);_0x5661e9(_0x3db83f);});});}exports[_0xc485('0x16')]=function(_0x423df1){var _0x485ba1=this;return new Promise(function(_0x49dc01,_0x2df51b){return db[_0xc485('0x17')][_0xc485('0x18')]({'raw':_0x423df1[_0xc485('0x19')]?_0x423df1[_0xc485('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x423df1[_0xc485('0x19')]?_0x423df1[_0xc485('0x19')][_0xc485('0x1a')]||null:null,'attributes':_0x423df1[_0xc485('0x19')]?_0x423df1[_0xc485('0x19')][_0xc485('0x1b')]||null:null,'limit':_0x423df1[_0xc485('0x19')]?_0x423df1[_0xc485('0x19')][_0xc485('0x1c')]||null:null,'include':_0x423df1[_0xc485('0x19')]?_0x423df1[_0xc485('0x19')]['include']?_['map'](_0x423df1[_0xc485('0x19')][_0xc485('0x1d')],function(_0x1386af){return{'model':db[_0x1386af[_0xc485('0x1e')]],'as':_0x1386af['as'],'attributes':_0x1386af['attributes'],'include':_0x1386af[_0xc485('0x1d')]?_[_0xc485('0x1f')](_0x1386af[_0xc485('0x1d')],function(_0x3d4c8f){return{'model':db[_0x3d4c8f['model']],'as':_0x3d4c8f['as'],'attributes':_0x3d4c8f[_0xc485('0x1b')],'include':_0x3d4c8f['include']?_[_0xc485('0x1f')](_0x3d4c8f[_0xc485('0x1d')],function(_0xe87655){return{'model':db[_0xe87655['model']],'as':_0xe87655['as'],'attributes':_0xe87655['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x106b33){logger['info'](_0xc485('0x16'),_0x423df1);logger[_0xc485('0xf')](_0xc485('0x16'),_0x423df1,JSON[_0xc485('0x11')](_0x106b33));_0x49dc01(_0x106b33);})['catch'](function(_0x206f8c){logger[_0xc485('0x12')](_0xc485('0x16'),_0x206f8c[_0xc485('0x14')],_0x423df1);_0x2df51b(_0x485ba1['error'](0x1f4,_0x206f8c['message']));});});};exports[_0xc485('0x20')]=function(_0x398dde){var _0x155a37=this;return new Promise(function(_0x53ad0a,_0x221cef){return db[_0xc485('0x17')]['update'](_0x398dde['body'],{'raw':_0x398dde['options']?_0x398dde[_0xc485('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398dde[_0xc485('0x19')]?_0x398dde[_0xc485('0x19')][_0xc485('0x1a')]||null:null,'attributes':_0x398dde['options']?_0x398dde[_0xc485('0x19')][_0xc485('0x1b')]||null:null,'limit':_0x398dde['options']?_0x398dde[_0xc485('0x19')]['limit']||null:null})[_0xc485('0xc')](function(_0x3a620c){logger['info'](_0xc485('0x20'),_0x398dde);logger['debug'](_0xc485('0x20'),_0x398dde,JSON[_0xc485('0x11')](_0x3a620c));_0x53ad0a(_0x3a620c);})['catch'](function(_0x539777){logger[_0xc485('0x12')]('UpdateCmHopperBlack',_0x539777['message'],_0x398dde);_0x221cef(_0x155a37[_0xc485('0x12')](0x1f4,_0x539777[_0xc485('0x14')]));});});};exports[_0xc485('0x21')]=function(_0x85d57b){var _0x4c49ae=this;return new Promise(function(_0x3b39fc,_0x10170c){return db['CmHopperBlack']['destroy']({'where':_0x85d57b[_0xc485('0x19')]?_0x85d57b['options'][_0xc485('0x1a')]||null:null})['then'](function(_0x3a41d7){logger[_0xc485('0xd')](_0xc485('0x21'),_0x85d57b);logger['debug']('DestroyCmHopperBlack',_0x85d57b,JSON[_0xc485('0x11')](_0x3a41d7));_0x3b39fc(_0x3a41d7);})['catch'](function(_0x3a3034){logger[_0xc485('0x12')]('DestroyCmHopperBlack',_0x3a3034['message'],_0x85d57b);_0x10170c(_0x4c49ae['error'](0x1f4,_0x3a3034[_0xc485('0x14')]));});});}; \ No newline at end of file +var _0xc200=['map','model','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','util','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include'];(function(_0x3267d8,_0x79830b){var _0xbc0cfa=function(_0x6c1f2a){while(--_0x6c1f2a){_0x3267d8['push'](_0x3267d8['shift']());}};_0xbc0cfa(++_0x79830b);}(_0xc200,0xbb));var _0x0c20=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc200[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x0c20('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c20('0x1'));var fs=require('fs');var Redis=require(_0x0c20('0x2'));var db=require(_0x0c20('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0c20('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x0c20('0x5')][_0x0c20('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x7c8bdb,_0x297a9a,_0x5e85d1){return new BPromise(function(_0x3882a7,_0x4ab901){return client['request'](_0x7c8bdb,_0x5e85d1)[_0x0c20('0x7')](function(_0x2406ab){logger[_0x0c20('0x8')](_0x0c20('0x9'),_0x297a9a,_0x0c20('0xa'));logger[_0x0c20('0xb')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x297a9a,_0x0c20('0xa'),JSON[_0x0c20('0xc')](_0x2406ab));if(_0x2406ab[_0x0c20('0xd')]){if(_0x2406ab[_0x0c20('0xd')]['code']===0x1f4){logger[_0x0c20('0xd')](_0x0c20('0x9'),_0x297a9a,_0x2406ab[_0x0c20('0xd')]['message']);return _0x4ab901(_0x2406ab[_0x0c20('0xd')][_0x0c20('0xe')]);}logger[_0x0c20('0xd')](_0x0c20('0x9'),_0x297a9a,_0x2406ab[_0x0c20('0xd')][_0x0c20('0xe')]);return _0x3882a7(_0x2406ab[_0x0c20('0xd')][_0x0c20('0xe')]);}else{logger[_0x0c20('0x8')]('CmHopperBlack,\x20%s,\x20%s',_0x297a9a,_0x0c20('0xa'));_0x3882a7(_0x2406ab['result'][_0x0c20('0xe')]);}})['catch'](function(_0x1bb0fb){logger[_0x0c20('0xd')]('CmHopperBlack,\x20%s,\x20%s',_0x297a9a,_0x1bb0fb);_0x4ab901(_0x1bb0fb);});});}exports[_0x0c20('0xf')]=function(_0xbce952){var _0x5155bc=this;return new Promise(function(_0x2cb3f1,_0x1f1dc9){return db[_0x0c20('0x10')]['findAll']({'raw':_0xbce952[_0x0c20('0x11')]?_0xbce952[_0x0c20('0x11')][_0x0c20('0x12')]===undefined?!![]:![]:!![],'where':_0xbce952[_0x0c20('0x11')]?_0xbce952[_0x0c20('0x11')][_0x0c20('0x13')]||null:null,'attributes':_0xbce952[_0x0c20('0x11')]?_0xbce952['options'][_0x0c20('0x14')]||null:null,'limit':_0xbce952[_0x0c20('0x11')]?_0xbce952[_0x0c20('0x11')][_0x0c20('0x15')]||null:null,'include':_0xbce952['options']?_0xbce952[_0x0c20('0x11')][_0x0c20('0x16')]?_[_0x0c20('0x17')](_0xbce952[_0x0c20('0x11')][_0x0c20('0x16')],function(_0x4818fd){return{'model':db[_0x4818fd['model']],'as':_0x4818fd['as'],'attributes':_0x4818fd[_0x0c20('0x14')],'include':_0x4818fd['include']?_[_0x0c20('0x17')](_0x4818fd[_0x0c20('0x16')],function(_0x4e08e7){return{'model':db[_0x4e08e7[_0x0c20('0x18')]],'as':_0x4e08e7['as'],'attributes':_0x4e08e7[_0x0c20('0x14')],'include':_0x4e08e7[_0x0c20('0x16')]?_[_0x0c20('0x17')](_0x4e08e7['include'],function(_0x77e18f){return{'model':db[_0x77e18f['model']],'as':_0x77e18f['as'],'attributes':_0x77e18f[_0x0c20('0x14')]};}):[]};}):[]};}):[]:[]})[_0x0c20('0x7')](function(_0x52f217){logger['info'](_0x0c20('0xf'),_0xbce952);logger[_0x0c20('0xb')](_0x0c20('0xf'),_0xbce952,JSON[_0x0c20('0xc')](_0x52f217));_0x2cb3f1(_0x52f217);})[_0x0c20('0x19')](function(_0x561101){logger[_0x0c20('0xd')](_0x0c20('0xf'),_0x561101[_0x0c20('0xe')],_0xbce952);_0x1f1dc9(_0x5155bc[_0x0c20('0xd')](0x1f4,_0x561101[_0x0c20('0xe')]));});});};exports[_0x0c20('0x1a')]=function(_0x17d141){var _0x4d7ee3=this;return new Promise(function(_0x5d0956,_0x34cd3d){return db[_0x0c20('0x10')][_0x0c20('0x1b')](_0x17d141[_0x0c20('0x1c')],{'raw':_0x17d141[_0x0c20('0x11')]?_0x17d141[_0x0c20('0x11')][_0x0c20('0x12')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17d141[_0x0c20('0x11')]?_0x17d141[_0x0c20('0x11')]['where']||null:null,'attributes':_0x17d141[_0x0c20('0x11')]?_0x17d141['options']['attributes']||null:null,'limit':_0x17d141[_0x0c20('0x11')]?_0x17d141[_0x0c20('0x11')]['limit']||null:null})[_0x0c20('0x7')](function(_0x445c7c){logger[_0x0c20('0x8')](_0x0c20('0x1a'),_0x17d141);logger[_0x0c20('0xb')]('UpdateCmHopperBlack',_0x17d141,JSON[_0x0c20('0xc')](_0x445c7c));_0x5d0956(_0x445c7c);})[_0x0c20('0x19')](function(_0x55ad2d){logger[_0x0c20('0xd')](_0x0c20('0x1a'),_0x55ad2d['message'],_0x17d141);_0x34cd3d(_0x4d7ee3['error'](0x1f4,_0x55ad2d['message']));});});};exports[_0x0c20('0x1d')]=function(_0x4b0c17){var _0x2a54d1=this;return new Promise(function(_0x3a81ca,_0xdc7d60){return db[_0x0c20('0x10')]['destroy']({'where':_0x4b0c17[_0x0c20('0x11')]?_0x4b0c17[_0x0c20('0x11')]['where']||null:null})[_0x0c20('0x7')](function(_0xe12be7){logger[_0x0c20('0x8')](_0x0c20('0x1d'),_0x4b0c17);logger[_0x0c20('0xb')](_0x0c20('0x1d'),_0x4b0c17,JSON[_0x0c20('0xc')](_0xe12be7));_0x3a81ca(_0xe12be7);})[_0x0c20('0x19')](function(_0x143754){logger[_0x0c20('0xd')](_0x0c20('0x1d'),_0x143754[_0x0c20('0xe')],_0x4b0c17);_0xdc7d60(_0x2a54d1[_0x0c20('0xd')](0x1f4,_0x143754[_0x0c20('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8c5ad31..6d602f7 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 _0x34e8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2650de,_0x12c23e){var _0x2db8c0=function(_0x2d482d){while(--_0x2d482d){_0x2650de['push'](_0x2650de['shift']());}};_0x2db8c0(++_0x12c23e);}(_0x34e8,0x12c));var _0x834e=function(_0x1bd038,_0x520bbe){_0x1bd038=_0x1bd038-0x0;var _0x297a88=_0x34e8[_0x1bd038];return _0x297a88;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x10')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x11')]);module[_0x834e('0x12')]=router; \ No newline at end of file +var _0xfd28=['index','/describe','/:id','put','delete','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1ab16a,_0x3ba5c9){var _0x28cf50=function(_0x442a55){while(--_0x442a55){_0x1ab16a['push'](_0x1ab16a['shift']());}};_0x28cf50(++_0x3ba5c9);}(_0xfd28,0x148));var _0x8fd2=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xfd28[_0x16b9ed];return _0x66b1f8;};'use strict';var multer=require('multer');var util=require(_0x8fd2('0x0'));var path=require(_0x8fd2('0x1'));var timeout=require('connect-timeout');var express=require(_0x8fd2('0x2'));var router=express['Router']();var auth=require(_0x8fd2('0x3'));var interaction=require(_0x8fd2('0x4'));var config=require(_0x8fd2('0x5'));var controller=require('./cmHopperBlack.controller');router[_0x8fd2('0x6')]('/',auth[_0x8fd2('0x7')](),controller[_0x8fd2('0x8')]);router[_0x8fd2('0x6')](_0x8fd2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x8fd2('0x6')](_0x8fd2('0xa'),auth[_0x8fd2('0x7')](),controller['show']);router[_0x8fd2('0xb')]('/:id',auth[_0x8fd2('0x7')](),controller['update']);router[_0x8fd2('0xc')]('/:id',auth[_0x8fd2('0x7')](),controller['destroy']);module[_0x8fd2('0xd')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 24d10a5..6b08ec6 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 _0x37c2=['BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','setDataValue','followuptime','diff','seconds','dispositionat'];(function(_0x4fc421,_0x94e88){var _0x8c6d63=function(_0x5b8b42){while(--_0x5b8b42){_0x4fc421['push'](_0x4fc421['shift']());}};_0x8c6d63(++_0x94e88);}(_0x37c2,0x6d));var _0x237c=function(_0x5cebbc,_0x2de914){_0x5cebbc=_0x5cebbc-0x0;var _0x12b054=_0x37c2[_0x5cebbc];return _0x12b054;};'use strict';var Sequelize=require(_0x237c('0x0'));var moment=require(_0x237c('0x1'));module[_0x237c('0x2')]={'state':{'type':Sequelize[_0x237c('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x237c('0x4')]},'scheduledat':{'type':Sequelize[_0x237c('0x5')]},'countbusyretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x237c('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x237c('0x4')]},'originatecalleridname':{'type':Sequelize[_0x237c('0x4')]},'calleridnum':{'type':Sequelize[_0x237c('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x237c('0x5')]},'responsetime':{'type':Sequelize[_0x237c('0x5')]},'answertime':{'type':Sequelize[_0x237c('0x5')]},'droptime':{'type':Sequelize[_0x237c('0x5')]},'endtime':{'type':Sequelize[_0x237c('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x237c('0x4')]},'campaigntype':{'type':Sequelize[_0x237c('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x237c('0x4')]},'disposition':{'type':Sequelize[_0x237c('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x293042){var _0x1cca9e=this['getDataValue']('endtime');if(_0x1cca9e&&_0x293042){this[_0x237c('0x6')](_0x237c('0x7'),moment(_0x293042)[_0x237c('0x8')](moment(_0x1cca9e),_0x237c('0x9')));}return this[_0x237c('0x6')](_0x237c('0xa'),_0x293042);}},'amd':{'type':Sequelize[_0x237c('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x237c('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x237c('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x237c('0x5')]},'callback':{'type':Sequelize[_0x237c('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x237c('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x237c('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x237c('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x237c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5a60=['diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE','STRING','setDataValue'];(function(_0xee80d5,_0x2f261f){var _0x409f0a=function(_0x117cc1){while(--_0x117cc1){_0xee80d5['push'](_0xee80d5['shift']());}};_0x409f0a(++_0x2f261f);}(_0x5a60,0x19d));var _0x05a6=function(_0x40d58a,_0x58d61e){_0x40d58a=_0x40d58a-0x0;var _0x221ee8=_0x5a60[_0x40d58a];return _0x221ee8;};'use strict';var Sequelize=require(_0x05a6('0x0'));var moment=require(_0x05a6('0x1'));module[_0x05a6('0x2')]={'state':{'type':Sequelize[_0x05a6('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x05a6('0x4')]},'countbusyretry':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x05a6('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x05a6('0x5')]},'originatecalleridname':{'type':Sequelize[_0x05a6('0x5')]},'calleridnum':{'type':Sequelize[_0x05a6('0x5')]},'calleridname':{'type':Sequelize[_0x05a6('0x5')]},'starttime':{'type':Sequelize[_0x05a6('0x4')]},'responsetime':{'type':Sequelize[_0x05a6('0x4')]},'answertime':{'type':Sequelize[_0x05a6('0x4')]},'droptime':{'type':Sequelize[_0x05a6('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x05a6('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x05a6('0x5')]},'membername':{'type':Sequelize[_0x05a6('0x5')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x05a6('0x5')]},'dispositionat':{'type':Sequelize[_0x05a6('0x4')],'set':function(_0x15775e){var _0x471e32=this['getDataValue']('endtime');if(_0x471e32&&_0x15775e){this[_0x05a6('0x6')]('followuptime',moment(_0x15775e)[_0x05a6('0x7')](moment(_0x471e32),_0x05a6('0x8')));}return this[_0x05a6('0x6')]('dispositionat',_0x15775e);}},'amd':{'type':Sequelize[_0x05a6('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x05a6('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x05a6('0x4')]},'callback':{'type':Sequelize[_0x05a6('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x05a6('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x05a6('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x05a6('0x4')]},'recallme':{'type':Sequelize[_0x05a6('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x05a6('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index b4161e4..bb7e03f 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 _0x5ed9=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','key','keys','attributes','intersection','model','fields','query','length','nolimit','offset','filters','pick','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','catch','show','params','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','VoiceQueue','find','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','select','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x352797,_0x25947f){var _0x46bb5e=function(_0x2721e5){while(--_0x2721e5){_0x352797['push'](_0x352797['shift']());}};_0x46bb5e(++_0x25947f);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5ed9[_0x36eaaa];return _0x461349;};'use strict';var pdf=require(_0x95ed('0x0'));var emlformat=require(_0x95ed('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x95ed('0x2'));var jsonpatch=require(_0x95ed('0x3'));var rp=require(_0x95ed('0x4'));var moment=require(_0x95ed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x95ed('0x6'));var util=require(_0x95ed('0x7'));var path=require(_0x95ed('0x8'));var sox=require('sox');var csv=require(_0x95ed('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x95ed('0xa'));var squel=require(_0x95ed('0xb'));var crypto=require(_0x95ed('0xc'));var jsforce=require(_0x95ed('0xd'));var deskjs=require(_0x95ed('0xe'));var toCsv=require(_0x95ed('0x9'));var querystring=require('querystring');var Papa=require(_0x95ed('0xf'));var Redis=require(_0x95ed('0x10'));var authService=require(_0x95ed('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x95ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x95ed('0x13'))(_0x95ed('0x14'));var utils=require(_0x95ed('0x15'));var config=require(_0x95ed('0x16'));var db=require(_0x95ed('0x17'))['db'];function respondWithStatusCode(_0x5bccde,_0x5e4571){_0x5e4571=_0x5e4571||0xcc;return function(_0x3da05b){if(_0x3da05b){return _0x5bccde[_0x95ed('0x18')](_0x5e4571);}return _0x5bccde['status'](_0x5e4571)['end']();};}function respondWithResult(_0x2782a5,_0x11671d){_0x11671d=_0x11671d||0xc8;return function(_0x22211f){if(_0x22211f){return _0x2782a5[_0x95ed('0x19')](_0x11671d)['json'](_0x22211f);}};}function respondWithFilteredResult(_0x213355,_0xd3fe73){return function(_0x477b8f){if(_0x477b8f){var _0x597a04=_0x477b8f['count'],_0x5fc6b5=_0xd3fe73['offset'],_0x554c6a=_0xd3fe73['offset']+_0xd3fe73[_0x95ed('0x1a')],_0x23c63f;if(_0x554c6a>=_0x597a04){_0x554c6a=_0x597a04;_0x23c63f=0xc8;}else{_0x23c63f=0xce;}_0x213355['status'](_0x23c63f);return _0x213355[_0x95ed('0x1b')](_0x95ed('0x1c'),_0x5fc6b5+'-'+_0x554c6a+'/'+_0x597a04)['json'](_0x477b8f);}return null;};}function patchUpdates(_0xa5a91){return function(_0x3e9d1e){try{jsonpatch[_0x95ed('0x1d')](_0x3e9d1e,_0xa5a91,!![]);}catch(_0x2a8dc3){return BPromise[_0x95ed('0x1e')](_0x2a8dc3);}return _0x3e9d1e[_0x95ed('0x1f')]();};}function saveUpdates(_0x2d427e,_0x3e05cf){return function(_0x10823b){if(_0x10823b){return _0x10823b[_0x95ed('0x20')](_0x2d427e)['then'](function(_0xd798ec){return _0xd798ec;});}return null;};}function removeEntity(_0x390d09,_0x4e8a5d){return function(_0x5d5afe){if(_0x5d5afe){return _0x5d5afe['destroy']()[_0x95ed('0x21')](function(){_0x390d09[_0x95ed('0x19')](0xcc)[_0x95ed('0x22')]();});}};}function handleEntityNotFound(_0x61d85e,_0x2c0824){return function(_0x19b664){if(!_0x19b664){_0x61d85e[_0x95ed('0x18')](0x194);}return _0x19b664;};}function handleError(_0x416d23,_0x146f74){_0x146f74=_0x146f74||0x1f4;return function(_0x3bcb6d){logger[_0x95ed('0x23')](_0x3bcb6d[_0x95ed('0x24')]);if(_0x3bcb6d[_0x95ed('0x25')]){delete _0x3bcb6d[_0x95ed('0x25')];}_0x416d23['status'](_0x146f74)[_0x95ed('0x26')](_0x3bcb6d);};}exports['index']=function(_0x4c7a2d,_0x2f515d){var _0x2d6df0={},_0x45e403={},_0x3096ad={'count':0x0,'rows':[]};var _0x2d5042=_[_0x95ed('0x27')](db[_0x95ed('0x28')][_0x95ed('0x29')],function(_0x39330d){return{'name':_0x39330d[_0x95ed('0x2a')],'type':_0x39330d[_0x95ed('0x2b')][_0x95ed('0x2c')]};});_0x45e403['model']=_[_0x95ed('0x27')](_0x2d5042,_0x95ed('0x25'));_0x45e403['query']=_[_0x95ed('0x2d')](_0x4c7a2d['query']);_0x45e403['filters']=_['intersection'](_0x45e403['model'],_0x45e403['query']);_0x2d6df0[_0x95ed('0x2e')]=_[_0x95ed('0x2f')](_0x45e403[_0x95ed('0x30')],qs[_0x95ed('0x31')](_0x4c7a2d[_0x95ed('0x32')][_0x95ed('0x31')]));_0x2d6df0[_0x95ed('0x2e')]=_0x2d6df0['attributes'][_0x95ed('0x33')]?_0x2d6df0[_0x95ed('0x2e')]:_0x45e403[_0x95ed('0x30')];if(!_0x4c7a2d['query']['hasOwnProperty'](_0x95ed('0x34'))){_0x2d6df0['limit']=qs['limit'](_0x4c7a2d['query']['limit']);_0x2d6df0[_0x95ed('0x35')]=qs['offset'](_0x4c7a2d[_0x95ed('0x32')][_0x95ed('0x35')]);}_0x2d6df0['order']=qs['sort'](_0x4c7a2d['query']['sort']);_0x2d6df0['where']=qs[_0x95ed('0x36')](_[_0x95ed('0x37')](_0x4c7a2d[_0x95ed('0x32')],_0x45e403[_0x95ed('0x36')]),_0x2d5042);if(_0x4c7a2d[_0x95ed('0x32')][_0x95ed('0x38')]){_0x2d6df0['where']=_[_0x95ed('0x39')](_0x2d6df0[_0x95ed('0x3a')],{'$or':_[_0x95ed('0x27')](_0x2d5042,function(_0x5218a3){if(_0x5218a3[_0x95ed('0x2b')]!==_0x95ed('0x3b')){var _0x355623={};_0x355623[_0x5218a3[_0x95ed('0x25')]]={'$like':'%'+_0x4c7a2d[_0x95ed('0x32')][_0x95ed('0x38')]+'%'};return _0x355623;}})});}_0x2d6df0=_[_0x95ed('0x39')]({},_0x2d6df0,_0x4c7a2d[_0x95ed('0x3c')]);var _0x4f9306={'where':_0x2d6df0['where']};return db['CmHopperFinal'][_0x95ed('0x3d')](_0x4f9306)[_0x95ed('0x21')](function(_0x237e8b){_0x3096ad[_0x95ed('0x3d')]=_0x237e8b;if(_0x4c7a2d[_0x95ed('0x32')][_0x95ed('0x3e')]){_0x2d6df0['include']=[{'all':!![]}];}return db[_0x95ed('0x28')][_0x95ed('0x3f')](_0x2d6df0);})[_0x95ed('0x21')](function(_0x5aeb8b){_0x3096ad['rows']=_0x5aeb8b;return _0x3096ad;})[_0x95ed('0x21')](respondWithFilteredResult(_0x2f515d,_0x2d6df0))[_0x95ed('0x40')](handleError(_0x2f515d,null));};exports[_0x95ed('0x41')]=function(_0x3a81df,_0x3754a7){var _0x5c4c54={'raw':!![],'where':{'id':_0x3a81df[_0x95ed('0x42')]['id']}},_0x5c068f={};_0x5c068f[_0x95ed('0x30')]=_[_0x95ed('0x2d')](db[_0x95ed('0x28')]['rawAttributes']);_0x5c068f[_0x95ed('0x32')]=_['keys'](_0x3a81df[_0x95ed('0x32')]);_0x5c068f[_0x95ed('0x36')]=_[_0x95ed('0x2f')](_0x5c068f['model'],_0x5c068f[_0x95ed('0x32')]);_0x5c4c54[_0x95ed('0x2e')]=_[_0x95ed('0x2f')](_0x5c068f['model'],qs['fields'](_0x3a81df[_0x95ed('0x32')]['fields']));_0x5c4c54[_0x95ed('0x2e')]=_0x5c4c54['attributes'][_0x95ed('0x33')]?_0x5c4c54[_0x95ed('0x2e')]:_0x5c068f[_0x95ed('0x30')];if(_0x3a81df[_0x95ed('0x32')][_0x95ed('0x3e')]){_0x5c4c54['include']=[{'all':!![]}];}_0x5c4c54=_[_0x95ed('0x39')]({},_0x5c4c54,_0x3a81df[_0x95ed('0x3c')]);return db[_0x95ed('0x28')]['find'](_0x5c4c54)[_0x95ed('0x21')](handleEntityNotFound(_0x3754a7,null))['then'](respondWithResult(_0x3754a7,null))[_0x95ed('0x40')](handleError(_0x3754a7,null));};exports[_0x95ed('0x43')]=function(_0x5f2444,_0x34e5e4){return db[_0x95ed('0x28')]['describe']()['then'](respondWithResult(_0x34e5e4,null))[_0x95ed('0x40')](handleError(_0x34e5e4,null));};exports['update']=function(_0x257a23,_0x5288e6){if(_0x257a23[_0x95ed('0x44')][_0x95ed('0x45')]){delete _0x257a23[_0x95ed('0x44')][_0x95ed('0x45')];}return db[_0x95ed('0x28')]['find']({'where':{'uniqueid':_0x257a23[_0x95ed('0x42')]['id']}})[_0x95ed('0x21')](handleEntityNotFound(_0x5288e6,null))[_0x95ed('0x21')](saveUpdates(_0x257a23[_0x95ed('0x44')],null))[_0x95ed('0x21')](respondWithResult(_0x5288e6,null))[_0x95ed('0x40')](handleError(_0x5288e6,null));};exports[_0x95ed('0x46')]=function(_0x26cd04,_0x485ab9,_0x3a77b0){return db[_0x95ed('0x28')][_0x95ed('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x26cd04[_0x95ed('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db['sequelize'][_0x95ed('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x95ed('0x4a')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x95ed('0x48')]['fn']('COUNT',db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')]['literal'](_0x95ed('0x4b')))),_0x95ed('0x4c')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x95ed('0x4d')))),_0x95ed('0x4e')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')]['literal'](_0x95ed('0x4f')))),_0x95ed('0x50')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db['sequelize']['literal'](_0x95ed('0x51')))),_0x95ed('0x52')],[db['sequelize']['fn']('COUNT',db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x95ed('0x47'),db['sequelize']['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')](_0x95ed('0x53')))),'answeringMachine']]})[_0x95ed('0x21')](handleEntityNotFound(_0x485ab9,null))[_0x95ed('0x21')](respondWithResult(_0x485ab9,null))[_0x95ed('0x40')](handleError(_0x485ab9,null));};exports[_0x95ed('0x54')]=function(_0x3e5925,_0x12a7b0,_0x2203c0){return db['CmHopperFinal'][_0x95ed('0x3f')]({'raw':![],'where':{'CampaignId':_0x3e5925[_0x95ed('0x42')]['id']},'attributes':[[db[_0x95ed('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x95ed('0x48')]['literal'](_0x95ed('0x55')))),_0x95ed('0x4a')],[db[_0x95ed('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')](_0x95ed('0x56')))),_0x95ed('0x57')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')](_0x95ed('0x4b')))),_0x95ed('0x4c')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db['sequelize']['fn']('IF',db['sequelize'][_0x95ed('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0x95ed('0x4e')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')](_0x95ed('0x4f')))),_0x95ed('0x50')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db['sequelize'][_0x95ed('0x49')](_0x95ed('0x51')))),_0x95ed('0x52')],[db[_0x95ed('0x48')]['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db['sequelize']['fn'](_0x95ed('0x47'),db[_0x95ed('0x48')]['fn']('IF',db[_0x95ed('0x48')][_0x95ed('0x49')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x95ed('0x21')](handleEntityNotFound(_0x12a7b0,null))['then'](respondWithResult(_0x12a7b0,null))[_0x95ed('0x40')](handleError(_0x12a7b0,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x4c858f,_0x95e046,_0x2ebbc8){return db[_0x95ed('0x58')][_0x95ed('0x59')]({'where':{'id':_0x4c858f[_0x95ed('0x42')]['id']}})[_0x95ed('0x21')](handleEntityNotFound(_0x95e046,null))[_0x95ed('0x21')](function(_0x36e7e2){var _0x339a9a;if(_0x36e7e2){_0x339a9a=squel[_0x95ed('0x5a')]()[_0x95ed('0x5b')](_0x95ed('0x5c'))[_0x95ed('0x5d')](['phone',_0x95ed('0x5e'),_0x95ed('0x5f'),_0x95ed('0x60'),_0x95ed('0x61'),_0x95ed('0x62'),_0x95ed('0x63')],squel['select']()[_0x95ed('0x64')](_0x95ed('0x65'),_0x95ed('0x66'))['field'](_0x95ed('0x67'),_0x95ed('0x5e'))[_0x95ed('0x64')](_0x95ed('0x68'),_0x95ed('0x5f'))[_0x95ed('0x64')]('ANY_VALUE(ListId)',_0x95ed('0x60'))['field'](_0x95ed('0x69'),_0x95ed('0x61'))['field'](_0x95ed('0x67'),'createdAt')[_0x95ed('0x64')]('NOW()','updatedAt')[_0x95ed('0x6a')](_0x95ed('0x6b'))[_0x95ed('0x3a')](_0x95ed('0x6c'),_0x4c858f[_0x95ed('0x42')]['id'][_0x95ed('0x6d')]())[_0x95ed('0x3a')](_0x95ed('0x6e'),_0x4c858f[_0x95ed('0x44')][_0x95ed('0x6f')][_0x95ed('0x6d')]())[_0x95ed('0x3a')](_0x95ed('0x70'))[_0x95ed('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x95ed('0x71')]()['field']('phone')[_0x95ed('0x6a')](_0x95ed('0x5c'))['where']('VoiceQueueId\x20=\x20?',_0x4c858f[_0x95ed('0x42')]['id'][_0x95ed('0x6d')]()))[_0x95ed('0x3a')](_0x95ed('0x72'),squel[_0x95ed('0x71')]()[_0x95ed('0x64')]('calleridnum')['from']('cm_hopper_final')[_0x95ed('0x3a')]('VoiceQueueId\x20=\x20?',_0x4c858f['params']['id'][_0x95ed('0x6d')]())[_0x95ed('0x3a')](_0x95ed('0x73')))[_0x95ed('0x74')](_0x95ed('0x5f')))[_0x95ed('0x6d')]();return db[_0x95ed('0x48')][_0x95ed('0x32')](_0x339a9a);}return[];})[_0x95ed('0x21')](respondWithResult(_0x95e046,null))[_0x95ed('0x40')](handleError(_0x95e046,null));};exports[_0x95ed('0x75')]=function(_0x528258,_0x9319af,_0x2df4f7){return db[_0x95ed('0x76')][_0x95ed('0x59')]({'where':{'id':_0x528258[_0x95ed('0x42')]['id']}})[_0x95ed('0x21')](handleEntityNotFound(_0x9319af,null))[_0x95ed('0x21')](function(_0x45caec){var _0x598291;if(_0x45caec){_0x598291=squel[_0x95ed('0x5a')]()[_0x95ed('0x5b')](_0x95ed('0x5c'))[_0x95ed('0x5d')]([_0x95ed('0x66'),_0x95ed('0x5e'),_0x95ed('0x5f'),_0x95ed('0x60'),_0x95ed('0x77'),_0x95ed('0x62'),_0x95ed('0x63')],squel['select']()[_0x95ed('0x64')](_0x95ed('0x65'),_0x95ed('0x66'))[_0x95ed('0x64')](_0x95ed('0x67'),'scheduledAt')[_0x95ed('0x64')](_0x95ed('0x68'),_0x95ed('0x5f'))[_0x95ed('0x64')](_0x95ed('0x78'),_0x95ed('0x60'))[_0x95ed('0x64')](_0x95ed('0x79'),_0x95ed('0x77'))[_0x95ed('0x64')]('NOW()',_0x95ed('0x62'))[_0x95ed('0x64')](_0x95ed('0x67'),_0x95ed('0x63'))[_0x95ed('0x6a')](_0x95ed('0x6b'))[_0x95ed('0x3a')](_0x95ed('0x7a'),_0x528258[_0x95ed('0x42')]['id'][_0x95ed('0x6d')]())[_0x95ed('0x3a')](_0x95ed('0x6e'),_0x528258['body']['state']['toString']())['where'](_0x95ed('0x70'))[_0x95ed('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x95ed('0x64')](_0x95ed('0x66'))[_0x95ed('0x6a')]('cm_hopper')['where'](_0x95ed('0x7a'),_0x528258['params']['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x95ed('0x71')]()[_0x95ed('0x64')](_0x95ed('0x7b'))[_0x95ed('0x6a')](_0x95ed('0x6b'))['where']('CampaignId\x20=\x20?',_0x528258['params']['id'][_0x95ed('0x6d')]())['where'](_0x95ed('0x73')))[_0x95ed('0x74')]('ContactId'))[_0x95ed('0x6d')]();return db[_0x95ed('0x48')][_0x95ed('0x32')](_0x598291);}return[];})[_0x95ed('0x21')](respondWithResult(_0x9319af,null))[_0x95ed('0x40')](handleError(_0x9319af,null));};exports[_0x95ed('0x7c')]=function(_0xe508b5,_0x52d165,_0x1f496e){return db[_0x95ed('0x7d')][_0x95ed('0x7e')]({'where':{'VoiceQueueId':_0xe508b5[_0x95ed('0x44')][_0x95ed('0x61')],'CampaignId':_0xe508b5['body'][_0x95ed('0x77')],'ContactId':_0xe508b5['body']['ContactId']}})[_0x95ed('0x21')](handleEntityNotFound(_0x52d165,null))[_0x95ed('0x21')](function(_0x559250){if(_0x559250){return _0x559250;}return null;})[_0x95ed('0x21')](respondWithResult(_0x52d165,null))[_0x95ed('0x40')](handleError(_0x52d165,null));}; \ No newline at end of file +var _0x7880=['CampaignId\x20=\x20?','state','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','send','map','CmHopperFinal','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','order','sort','filter','merge','where','VIRTUAL','count','include','findAll','catch','show','params','describe','body','uniqueid','find','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','literal','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0x7880,0x1f4));var _0x0788=function(_0x2cad63,_0x15a505){_0x2cad63=_0x2cad63-0x0;var _0x2ac69e=_0x7880[_0x2cad63];return _0x2ac69e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0788('0x0'));var rimraf=require(_0x0788('0x1'));var zipdir=require(_0x0788('0x2'));var jsonpatch=require(_0x0788('0x3'));var rp=require(_0x0788('0x4'));var moment=require(_0x0788('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0788('0x6'));var util=require(_0x0788('0x7'));var path=require(_0x0788('0x8'));var sox=require(_0x0788('0x9'));var csv=require(_0x0788('0xa'));var ejs=require(_0x0788('0xb'));var fs=require('fs');var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0xa'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var db=require(_0x0788('0x18'))['db'];function respondWithStatusCode(_0x2d8568,_0x311729){_0x311729=_0x311729||0xcc;return function(_0xce4342){if(_0xce4342){return _0x2d8568[_0x0788('0x19')](_0x311729);}return _0x2d8568['status'](_0x311729)[_0x0788('0x1a')]();};}function respondWithResult(_0x7e3407,_0x3bdcdf){_0x3bdcdf=_0x3bdcdf||0xc8;return function(_0x13cf07){if(_0x13cf07){return _0x7e3407['status'](_0x3bdcdf)[_0x0788('0x1b')](_0x13cf07);}};}function respondWithFilteredResult(_0x4ed024,_0x195f14){return function(_0x170d56){if(_0x170d56){var _0x3fd1e4=_0x170d56['count'],_0xb406fb=_0x195f14['offset'],_0x2ddd1a=_0x195f14[_0x0788('0x1c')]+_0x195f14[_0x0788('0x1d')],_0x430e34;if(_0x2ddd1a>=_0x3fd1e4){_0x2ddd1a=_0x3fd1e4;_0x430e34=0xc8;}else{_0x430e34=0xce;}_0x4ed024['status'](_0x430e34);return _0x4ed024[_0x0788('0x1e')](_0x0788('0x1f'),_0xb406fb+'-'+_0x2ddd1a+'/'+_0x3fd1e4)[_0x0788('0x1b')](_0x170d56);}return null;};}function patchUpdates(_0x52c339){return function(_0x42fe14){try{jsonpatch[_0x0788('0x20')](_0x42fe14,_0x52c339,!![]);}catch(_0x492c2c){return BPromise[_0x0788('0x21')](_0x492c2c);}return _0x42fe14['save']();};}function saveUpdates(_0x7d0869,_0x48bc5f){return function(_0x17cca3){if(_0x17cca3){return _0x17cca3[_0x0788('0x22')](_0x7d0869)[_0x0788('0x23')](function(_0x3cd197){return _0x3cd197;});}return null;};}function removeEntity(_0x3aa142,_0x4f0005){return function(_0x48ec43){if(_0x48ec43){return _0x48ec43[_0x0788('0x24')]()[_0x0788('0x23')](function(){_0x3aa142[_0x0788('0x25')](0xcc)[_0x0788('0x1a')]();});}};}function handleEntityNotFound(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(!_0x79204e){_0x5ba1da[_0x0788('0x19')](0x194);}return _0x79204e;};}function handleError(_0x40309d,_0x50b65c){_0x50b65c=_0x50b65c||0x1f4;return function(_0x4b2693){logger[_0x0788('0x26')](_0x4b2693[_0x0788('0x27')]);if(_0x4b2693['name']){delete _0x4b2693['name'];}_0x40309d[_0x0788('0x25')](_0x50b65c)[_0x0788('0x28')](_0x4b2693);};}exports['index']=function(_0x286730,_0x40e7a6){var _0x467d52={},_0x18fc0e={},_0xf9ba32={'count':0x0,'rows':[]};var _0xb2f4a5=_[_0x0788('0x29')](db[_0x0788('0x2a')]['rawAttributes'],function(_0x5a5178){return{'name':_0x5a5178[_0x0788('0x2b')],'type':_0x5a5178[_0x0788('0x2c')]['key']};});_0x18fc0e['model']=_[_0x0788('0x29')](_0xb2f4a5,_0x0788('0x2d'));_0x18fc0e[_0x0788('0x2e')]=_[_0x0788('0x2f')](_0x286730[_0x0788('0x2e')]);_0x18fc0e[_0x0788('0x30')]=_[_0x0788('0x31')](_0x18fc0e[_0x0788('0x32')],_0x18fc0e[_0x0788('0x2e')]);_0x467d52[_0x0788('0x33')]=_['intersection'](_0x18fc0e[_0x0788('0x32')],qs[_0x0788('0x34')](_0x286730[_0x0788('0x2e')][_0x0788('0x34')]));_0x467d52[_0x0788('0x33')]=_0x467d52[_0x0788('0x33')][_0x0788('0x35')]?_0x467d52[_0x0788('0x33')]:_0x18fc0e[_0x0788('0x32')];if(!_0x286730[_0x0788('0x2e')]['hasOwnProperty']('nolimit')){_0x467d52['limit']=qs['limit'](_0x286730['query']['limit']);_0x467d52[_0x0788('0x1c')]=qs[_0x0788('0x1c')](_0x286730[_0x0788('0x2e')]['offset']);}_0x467d52[_0x0788('0x36')]=qs[_0x0788('0x37')](_0x286730[_0x0788('0x2e')][_0x0788('0x37')]);_0x467d52['where']=qs[_0x0788('0x30')](_['pick'](_0x286730[_0x0788('0x2e')],_0x18fc0e['filters']),_0xb2f4a5);if(_0x286730[_0x0788('0x2e')][_0x0788('0x38')]){_0x467d52['where']=_[_0x0788('0x39')](_0x467d52[_0x0788('0x3a')],{'$or':_['map'](_0xb2f4a5,function(_0x17240e){if(_0x17240e['type']!==_0x0788('0x3b')){var _0x5576c4={};_0x5576c4[_0x17240e[_0x0788('0x2d')]]={'$like':'%'+_0x286730['query'][_0x0788('0x38')]+'%'};return _0x5576c4;}})});}_0x467d52=_['merge']({},_0x467d52,_0x286730['options']);var _0x3e31f8={'where':_0x467d52[_0x0788('0x3a')]};return db[_0x0788('0x2a')][_0x0788('0x3c')](_0x3e31f8)[_0x0788('0x23')](function(_0x53da74){_0xf9ba32['count']=_0x53da74;if(_0x286730['query']['includeAll']){_0x467d52[_0x0788('0x3d')]=[{'all':!![]}];}return db[_0x0788('0x2a')][_0x0788('0x3e')](_0x467d52);})[_0x0788('0x23')](function(_0x362c49){_0xf9ba32['rows']=_0x362c49;return _0xf9ba32;})['then'](respondWithFilteredResult(_0x40e7a6,_0x467d52))[_0x0788('0x3f')](handleError(_0x40e7a6,null));};exports[_0x0788('0x40')]=function(_0x330421,_0x29e09a){var _0x236b63={'raw':!![],'where':{'id':_0x330421[_0x0788('0x41')]['id']}},_0x4316aa={};_0x4316aa[_0x0788('0x32')]=_[_0x0788('0x2f')](db['CmHopperFinal']['rawAttributes']);_0x4316aa[_0x0788('0x2e')]=_[_0x0788('0x2f')](_0x330421[_0x0788('0x2e')]);_0x4316aa['filters']=_['intersection'](_0x4316aa['model'],_0x4316aa[_0x0788('0x2e')]);_0x236b63[_0x0788('0x33')]=_[_0x0788('0x31')](_0x4316aa[_0x0788('0x32')],qs[_0x0788('0x34')](_0x330421[_0x0788('0x2e')][_0x0788('0x34')]));_0x236b63[_0x0788('0x33')]=_0x236b63['attributes'][_0x0788('0x35')]?_0x236b63[_0x0788('0x33')]:_0x4316aa[_0x0788('0x32')];if(_0x330421[_0x0788('0x2e')]['includeAll']){_0x236b63[_0x0788('0x3d')]=[{'all':!![]}];}_0x236b63=_[_0x0788('0x39')]({},_0x236b63,_0x330421['options']);return db['CmHopperFinal']['find'](_0x236b63)[_0x0788('0x23')](handleEntityNotFound(_0x29e09a,null))['then'](respondWithResult(_0x29e09a,null))[_0x0788('0x3f')](handleError(_0x29e09a,null));};exports[_0x0788('0x42')]=function(_0x127ab4,_0x329508){return db[_0x0788('0x2a')][_0x0788('0x42')]()[_0x0788('0x23')](respondWithResult(_0x329508,null))[_0x0788('0x3f')](handleError(_0x329508,null));};exports['update']=function(_0x4c6366,_0x39c3cc){if(_0x4c6366[_0x0788('0x43')][_0x0788('0x44')]){delete _0x4c6366['body'][_0x0788('0x44')];}return db[_0x0788('0x2a')][_0x0788('0x45')]({'where':{'uniqueid':_0x4c6366[_0x0788('0x41')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x39c3cc,null))['then'](saveUpdates(_0x4c6366['body'],null))[_0x0788('0x23')](respondWithResult(_0x39c3cc,null))[_0x0788('0x3f')](handleError(_0x39c3cc,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x2b1479,_0x4a6cde,_0x2103aa){return db[_0x0788('0x2a')][_0x0788('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x2b1479[_0x0788('0x41')]['id']},'attributes':[[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')]['literal'](_0x0788('0x48')))),_0x0788('0x49')],[db[_0x0788('0x46')]['fn']('COUNT',db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')]['literal'](_0x0788('0x4a')))),_0x0788('0x4b')],[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x0788('0x4c')],[db[_0x0788('0x46')]['fn']('COUNT',db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x4e')))),_0x0788('0x4f')],[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x50')))),_0x0788('0x51')],[db['sequelize']['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')]['literal'](_0x0788('0x52')))),_0x0788('0x53')],[db['sequelize']['fn']('COUNT',db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x54')))),_0x0788('0x55')],[db[_0x0788('0x46')]['fn']('COUNT',db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x0788('0x23')](handleEntityNotFound(_0x4a6cde,null))['then'](respondWithResult(_0x4a6cde,null))[_0x0788('0x3f')](handleError(_0x4a6cde,null));};exports[_0x0788('0x56')]=function(_0x223767,_0x13a021,_0x101e8b){return db[_0x0788('0x2a')][_0x0788('0x3e')]({'raw':![],'where':{'CampaignId':_0x223767[_0x0788('0x41')]['id']},'attributes':[[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db['sequelize']['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x48')))),_0x0788('0x49')],[db['sequelize']['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x4a')))),'noAnswerContacts'],[db[_0x0788('0x46')]['fn']('COUNT',db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x57')))),_0x0788('0x4c')],[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')]['literal'](_0x0788('0x4e')))),_0x0788('0x4f')],[db[_0x0788('0x46')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x50')))),'dropContacts'],[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db['sequelize']['literal'](_0x0788('0x54')))),'reCallContacts'],[db[_0x0788('0x46')]['fn'](_0x0788('0x47'),db[_0x0788('0x46')]['fn']('IF',db[_0x0788('0x46')][_0x0788('0x4d')](_0x0788('0x58')))),_0x0788('0x59')]]})[_0x0788('0x23')](handleEntityNotFound(_0x13a021,null))[_0x0788('0x23')](respondWithResult(_0x13a021,null))[_0x0788('0x3f')](handleError(_0x13a021,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x240210,_0x30248c,_0x52926f){return db['VoiceQueue'][_0x0788('0x45')]({'where':{'id':_0x240210[_0x0788('0x41')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0x30248c,null))[_0x0788('0x23')](function(_0x3628d6){var _0x192798;if(_0x3628d6){_0x192798=squel['insert']()[_0x0788('0x5a')](_0x0788('0x5b'))[_0x0788('0x5c')]([_0x0788('0x5d'),'scheduledAt',_0x0788('0x5e'),_0x0788('0x5f'),_0x0788('0x60'),_0x0788('0x61'),'updatedAt'],squel['select']()[_0x0788('0x62')](_0x0788('0x63'),_0x0788('0x5d'))[_0x0788('0x62')](_0x0788('0x64'),_0x0788('0x65'))[_0x0788('0x62')](_0x0788('0x66'),_0x0788('0x5e'))['field'](_0x0788('0x67'),_0x0788('0x5f'))[_0x0788('0x62')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x0788('0x62')]('NOW()',_0x0788('0x61'))[_0x0788('0x62')](_0x0788('0x64'),_0x0788('0x68'))[_0x0788('0x69')](_0x0788('0x6a'))[_0x0788('0x3a')](_0x0788('0x6b'),_0x240210[_0x0788('0x41')]['id']['toString']())[_0x0788('0x3a')](_0x0788('0x6c'),_0x240210[_0x0788('0x43')]['state'][_0x0788('0x6d')]())[_0x0788('0x3a')](_0x0788('0x6e'))['where'](_0x0788('0x6f'),squel[_0x0788('0x70')]()[_0x0788('0x62')](_0x0788('0x5d'))[_0x0788('0x69')](_0x0788('0x5b'))[_0x0788('0x3a')](_0x0788('0x6b'),_0x240210[_0x0788('0x41')]['id']['toString']()))[_0x0788('0x3a')](_0x0788('0x6f'),squel[_0x0788('0x70')]()[_0x0788('0x62')](_0x0788('0x71'))['from'](_0x0788('0x6a'))[_0x0788('0x3a')](_0x0788('0x6b'),_0x240210['params']['id'][_0x0788('0x6d')]())[_0x0788('0x3a')](_0x0788('0x72')))[_0x0788('0x73')](_0x0788('0x5e')))['toString']();return db[_0x0788('0x46')][_0x0788('0x2e')](_0x192798);}return[];})['then'](respondWithResult(_0x30248c,null))[_0x0788('0x3f')](handleError(_0x30248c,null));};exports[_0x0788('0x74')]=function(_0x537a69,_0xc597d7,_0xe14a8e){return db[_0x0788('0x75')]['find']({'where':{'id':_0x537a69[_0x0788('0x41')]['id']}})[_0x0788('0x23')](handleEntityNotFound(_0xc597d7,null))[_0x0788('0x23')](function(_0x53730a){var _0xddfb97;if(_0x53730a){_0xddfb97=squel[_0x0788('0x76')]()[_0x0788('0x5a')](_0x0788('0x5b'))[_0x0788('0x5c')]([_0x0788('0x5d'),_0x0788('0x65'),_0x0788('0x5e'),'ListId',_0x0788('0x77'),_0x0788('0x61'),_0x0788('0x68')],squel[_0x0788('0x70')]()['field']('ANY_VALUE(calleridnum)',_0x0788('0x5d'))[_0x0788('0x62')]('NOW()',_0x0788('0x65'))[_0x0788('0x62')](_0x0788('0x66'),'ContactId')['field'](_0x0788('0x67'),_0x0788('0x5f'))['field']('ANY_VALUE(CampaignId)','CampaignId')[_0x0788('0x62')](_0x0788('0x64'),'createdAt')[_0x0788('0x62')](_0x0788('0x64'),_0x0788('0x68'))[_0x0788('0x69')](_0x0788('0x6a'))['where'](_0x0788('0x78'),_0x537a69['params']['id'][_0x0788('0x6d')]())['where'](_0x0788('0x6c'),_0x537a69[_0x0788('0x43')][_0x0788('0x79')][_0x0788('0x6d')]())[_0x0788('0x3a')](_0x0788('0x6e'))[_0x0788('0x3a')](_0x0788('0x6f'),squel[_0x0788('0x70')]()[_0x0788('0x62')](_0x0788('0x5d'))[_0x0788('0x69')](_0x0788('0x5b'))['where']('CampaignId\x20=\x20?',_0x537a69['params']['id'][_0x0788('0x6d')]()))[_0x0788('0x3a')](_0x0788('0x6f'),squel[_0x0788('0x70')]()[_0x0788('0x62')](_0x0788('0x71'))[_0x0788('0x69')](_0x0788('0x6a'))[_0x0788('0x3a')](_0x0788('0x78'),_0x537a69[_0x0788('0x41')]['id']['toString']())['where'](_0x0788('0x72')))[_0x0788('0x73')](_0x0788('0x5e')))[_0x0788('0x6d')]();return db[_0x0788('0x46')][_0x0788('0x2e')](_0xddfb97);}return[];})[_0x0788('0x23')](respondWithResult(_0xc597d7,null))[_0x0788('0x3f')](handleError(_0xc597d7,null));};exports['checkContactHopper']=function(_0x48b82c,_0x3b5c80,_0x22e770){return db[_0x0788('0x7a')][_0x0788('0x7b')]({'where':{'VoiceQueueId':_0x48b82c[_0x0788('0x43')][_0x0788('0x60')],'CampaignId':_0x48b82c['body'][_0x0788('0x77')],'ContactId':_0x48b82c[_0x0788('0x43')][_0x0788('0x5e')]}})[_0x0788('0x23')](handleEntityNotFound(_0x3b5c80,null))[_0x0788('0x23')](function(_0x1191e7){if(_0x1191e7){return _0x1191e7;}return null;})[_0x0788('0x23')](respondWithResult(_0x3b5c80,null))[_0x0788('0x3f')](handleError(_0x3b5c80,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 32c051a..f1d2e66 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 _0x07c3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x07c3,0x1bf));var _0x307c=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x07c3[_0x31b5b2];return _0x364f13;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var logger=require(_0x307c('0x2'))(_0x307c('0x3'));var moment=require(_0x307c('0x4'));var BPromise=require(_0x307c('0x5'));var rp=require(_0x307c('0x6'));var fs=require('fs');var path=require(_0x307c('0x7'));var rimraf=require('rimraf');var config=require(_0x307c('0x8'));var attributes=require(_0x307c('0x9'));module[_0x307c('0xa')]=function(_0x317066,_0x250f22){return _0x317066[_0x307c('0xb')](_0x307c('0xc'),attributes,{'tableName':_0x307c('0xd'),'paranoid':![],'indexes':[{'name':_0x307c('0xe'),'fields':[_0x307c('0xe')]},{'name':_0x307c('0xf'),'fields':[_0x307c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf874=['cm_hopper_final','calleridnum','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopperFinal.attributes','exports','define'];(function(_0x5f019e,_0x5b7d59){var _0x5a980b=function(_0x120aa9){while(--_0x120aa9){_0x5f019e['push'](_0x5f019e['shift']());}};_0x5a980b(++_0x5b7d59);}(_0xf874,0xed));var _0x4f87=function(_0x11225d,_0x3d68ad){_0x11225d=_0x11225d-0x0;var _0x266c57=_0xf874[_0x11225d];return _0x266c57;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f87('0x0'))(_0x4f87('0x1'));var moment=require(_0x4f87('0x2'));var BPromise=require(_0x4f87('0x3'));var rp=require(_0x4f87('0x4'));var fs=require('fs');var path=require(_0x4f87('0x5'));var rimraf=require('rimraf');var config=require(_0x4f87('0x6'));var attributes=require(_0x4f87('0x7'));module[_0x4f87('0x8')]=function(_0xf0ffb3,_0x104682){return _0xf0ffb3[_0x4f87('0x9')]('CmHopperFinal',attributes,{'tableName':_0x4f87('0xa'),'paranoid':![],'indexes':[{'name':_0x4f87('0xb'),'fields':['calleridnum']},{'name':_0x4f87('0xc'),'fields':[_0x4f87('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 70ecd52..e954082 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 _0x83f3=['../../config/logger','rpc','../../config/environment','jayson/promise','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopperFinal','create','options','raw','then','CreateCmHopperFinal','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x434807,_0x5509c3){var _0x26793a=function(_0x2ff9ee){while(--_0x2ff9ee){_0x434807['push'](_0x434807['shift']());}};_0x26793a(++_0x5509c3);}(_0x83f3,0xed));var _0x383f=function(_0x5d5f8d,_0x32f2a0){_0x5d5f8d=_0x5d5f8d-0x0;var _0x240e57=_0x83f3[_0x5d5f8d];return _0x240e57;};'use strict';var _=require(_0x383f('0x0'));var util=require(_0x383f('0x1'));var moment=require(_0x383f('0x2'));var BPromise=require(_0x383f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x383f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x383f('0x5'));var logger=require(_0x383f('0x6'))(_0x383f('0x7'));var config=require(_0x383f('0x8'));var jayson=require(_0x383f('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea054,_0x1d211b,_0x3a53a1){return new BPromise(function(_0x3af8d7,_0x5b2006){return client[_0x383f('0xa')](_0x2ea054,_0x3a53a1)['then'](function(_0x400523){logger[_0x383f('0xb')](_0x383f('0xc'),_0x1d211b,_0x383f('0xd'));logger[_0x383f('0xe')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x1d211b,'request\x20sent',JSON[_0x383f('0xf')](_0x400523));if(_0x400523[_0x383f('0x10')]){if(_0x400523[_0x383f('0x10')][_0x383f('0x11')]===0x1f4){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x1d211b,_0x400523[_0x383f('0x10')][_0x383f('0x12')]);return _0x5b2006(_0x400523['error']['message']);}logger[_0x383f('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x1d211b,_0x400523[_0x383f('0x10')]['message']);return _0x3af8d7(_0x400523[_0x383f('0x10')][_0x383f('0x12')]);}else{logger[_0x383f('0xb')](_0x383f('0xc'),_0x1d211b,'request\x20sent');_0x3af8d7(_0x400523[_0x383f('0x13')][_0x383f('0x12')]);}})[_0x383f('0x14')](function(_0x2fa978){logger[_0x383f('0x10')](_0x383f('0xc'),_0x1d211b,_0x2fa978);_0x5b2006(_0x2fa978);});});}exports['CreateCmHopperFinal']=function(_0x252e29){var _0x1a54b5=this;return new Promise(function(_0x1cb81b,_0x4c1322){return db[_0x383f('0x15')][_0x383f('0x16')](_0x252e29['body'],{'raw':_0x252e29[_0x383f('0x17')]?_0x252e29['options'][_0x383f('0x18')]===undefined?!![]:![]:!![]})[_0x383f('0x19')](function(_0x4b8ff6){logger['info'](_0x383f('0x1a'),_0x252e29);logger['debug'](_0x383f('0x1a'),_0x252e29,JSON[_0x383f('0xf')](_0x4b8ff6));_0x1cb81b(_0x4b8ff6);})[_0x383f('0x14')](function(_0x259b4a){logger['error'](_0x383f('0x1a'),_0x259b4a[_0x383f('0x12')],_0x252e29);_0x4c1322(_0x1a54b5['error'](0x1f4,_0x259b4a[_0x383f('0x12')]));});});}; \ No newline at end of file +var _0x6b76=['create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','code','CmHopperFinal,\x20%s,\x20%s','message','result','catch','CreateCmHopperFinal','CmHopperFinal'];(function(_0x1984b9,_0x28cc6e){var _0x3949ca=function(_0x2c4b69){while(--_0x2c4b69){_0x1984b9['push'](_0x1984b9['shift']());}};_0x3949ca(++_0x28cc6e);}(_0x6b76,0xa5));var _0x66b7=function(_0x4369f2,_0x2b7fe6){_0x4369f2=_0x4369f2-0x0;var _0x102739=_0x6b76[_0x4369f2];return _0x102739;};'use strict';var _=require(_0x66b7('0x0'));var util=require('util');var moment=require(_0x66b7('0x1'));var BPromise=require(_0x66b7('0x2'));var rs=require(_0x66b7('0x3'));var fs=require('fs');var Redis=require(_0x66b7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x66b7('0x5'));var logger=require(_0x66b7('0x6'))(_0x66b7('0x7'));var config=require(_0x66b7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x66b7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a2a77,_0x132ac0,_0x5931d7){return new BPromise(function(_0x265780,_0x39ca87){return client[_0x66b7('0xa')](_0x2a2a77,_0x5931d7)[_0x66b7('0xb')](function(_0x4944e1){logger[_0x66b7('0xc')]('CmHopperFinal,\x20%s,\x20%s',_0x132ac0,_0x66b7('0xd'));logger[_0x66b7('0xe')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x132ac0,_0x66b7('0xd'),JSON[_0x66b7('0xf')](_0x4944e1));if(_0x4944e1[_0x66b7('0x10')]){if(_0x4944e1[_0x66b7('0x10')][_0x66b7('0x11')]===0x1f4){logger[_0x66b7('0x10')](_0x66b7('0x12'),_0x132ac0,_0x4944e1[_0x66b7('0x10')][_0x66b7('0x13')]);return _0x39ca87(_0x4944e1[_0x66b7('0x10')]['message']);}logger[_0x66b7('0x10')]('CmHopperFinal,\x20%s,\x20%s',_0x132ac0,_0x4944e1[_0x66b7('0x10')][_0x66b7('0x13')]);return _0x265780(_0x4944e1[_0x66b7('0x10')][_0x66b7('0x13')]);}else{logger[_0x66b7('0xc')](_0x66b7('0x12'),_0x132ac0,_0x66b7('0xd'));_0x265780(_0x4944e1[_0x66b7('0x14')][_0x66b7('0x13')]);}})[_0x66b7('0x15')](function(_0x1e12f2){logger['error'](_0x66b7('0x12'),_0x132ac0,_0x1e12f2);_0x39ca87(_0x1e12f2);});});}exports[_0x66b7('0x16')]=function(_0x41fc88){var _0x36c2b8=this;return new Promise(function(_0x500490,_0x3b661b){return db[_0x66b7('0x17')][_0x66b7('0x18')](_0x41fc88['body'],{'raw':_0x41fc88[_0x66b7('0x19')]?_0x41fc88[_0x66b7('0x19')][_0x66b7('0x1a')]===undefined?!![]:![]:!![]})[_0x66b7('0xb')](function(_0x5dd4c4){logger[_0x66b7('0xc')](_0x66b7('0x16'),_0x41fc88);logger['debug'](_0x66b7('0x16'),_0x41fc88,JSON[_0x66b7('0xf')](_0x5dd4c4));_0x500490(_0x5dd4c4);})[_0x66b7('0x15')](function(_0x3e14f9){logger[_0x66b7('0x10')](_0x66b7('0x16'),_0x3e14f9[_0x66b7('0x13')],_0x41fc88);_0x3b661b(_0x36c2b8[_0x66b7('0x10')](0x1f4,_0x3e14f9[_0x66b7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 3479278..649a658 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 _0x09ba=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','get','/describe','describe','/:id','countContactsQueueCampaignHopperFinal'];(function(_0xfbb69e,_0x1c65dd){var _0x31666f=function(_0x344c9f){while(--_0x344c9f){_0xfbb69e['push'](_0xfbb69e['shift']());}};_0x31666f(++_0x1c65dd);}(_0x09ba,0xa6));var _0xa09b=function(_0xbb6da2,_0x24614b){_0xbb6da2=_0xbb6da2-0x0;var _0x2a84f5=_0x09ba[_0xbb6da2];return _0x2a84f5;};'use strict';var multer=require(_0xa09b('0x0'));var util=require(_0xa09b('0x1'));var path=require(_0xa09b('0x2'));var timeout=require(_0xa09b('0x3'));var express=require(_0xa09b('0x4'));var router=express[_0xa09b('0x5')]();var auth=require(_0xa09b('0x6'));var interaction=require(_0xa09b('0x7'));var config=require('../../config/environment');var controller=require(_0xa09b('0x8'));router['get']('/',auth[_0xa09b('0x9')](),controller[_0xa09b('0xa')]);router[_0xa09b('0xb')](_0xa09b('0xc'),auth['isAuthenticated'](),controller[_0xa09b('0xd')]);router['get'](_0xa09b('0xe'),auth[_0xa09b('0x9')](),controller['show']);router[_0xa09b('0xb')]('/voice/queue/countAttributes/:id',auth[_0xa09b('0x9')](),controller[_0xa09b('0xf')]);router[_0xa09b('0xb')]('/campaign/countAttributes/:id',auth[_0xa09b('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0xa09b('0x10'),auth[_0xa09b('0x9')](),controller[_0xa09b('0x11')]);router[_0xa09b('0x12')](_0xa09b('0x13'),auth[_0xa09b('0x9')](),controller[_0xa09b('0x14')]);router[_0xa09b('0x12')](_0xa09b('0x15'),auth[_0xa09b('0x9')](),controller[_0xa09b('0x16')]);router[_0xa09b('0x17')](_0xa09b('0xe'),auth[_0xa09b('0x9')](),controller[_0xa09b('0x18')]);module[_0xa09b('0x19')]=router; \ No newline at end of file +var _0x3701=['moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','put','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id'];(function(_0x3b0de,_0x2513d4){var _0x4277f1=function(_0x37bf59){while(--_0x37bf59){_0x3b0de['push'](_0x3b0de['shift']());}};_0x4277f1(++_0x2513d4);}(_0x3701,0xb4));var _0x1370=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3701[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1370('0x0'));var util=require(_0x1370('0x1'));var path=require(_0x1370('0x2'));var timeout=require(_0x1370('0x3'));var express=require(_0x1370('0x4'));var router=express['Router']();var auth=require(_0x1370('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1370('0x6'));var controller=require(_0x1370('0x7'));router[_0x1370('0x8')]('/',auth[_0x1370('0x9')](),controller['index']);router[_0x1370('0x8')](_0x1370('0xa'),auth[_0x1370('0x9')](),controller[_0x1370('0xb')]);router['get'](_0x1370('0xc'),auth[_0x1370('0x9')](),controller['show']);router['get'](_0x1370('0xd'),auth[_0x1370('0x9')](),controller[_0x1370('0xe')]);router['get'](_0x1370('0xf'),auth[_0x1370('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x1370('0x10')](_0x1370('0x11'),auth[_0x1370('0x9')](),controller[_0x1370('0x12')]);router[_0x1370('0x10')]('/voice/campaign/moveContacts/:id',auth[_0x1370('0x9')](),controller[_0x1370('0x13')]);router[_0x1370('0x10')]('/checkContactHopper',auth[_0x1370('0x9')](),controller['checkContactHopper']);router[_0x1370('0x14')](_0x1370('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x1370('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 fe2d3dd..5b68764 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 _0x5d01=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x5d01,0x190));var _0x15d0=function(_0x395dd4,_0x2b7020){_0x395dd4=_0x395dd4-0x0;var _0x5e09e4=_0x5d01[_0x395dd4];return _0x5e09e4;};'use strict';var Sequelize=require(_0x15d0('0x0'));module[_0x15d0('0x1')]={'state':{'type':Sequelize[_0x15d0('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x15d0('0x3')]},'scheduledat':{'type':Sequelize[_0x15d0('0x4')]},'countbusyretry':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x15d0('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x15d0('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x15d0('0x3')]},'starttime':{'type':Sequelize[_0x15d0('0x4')]},'responsetime':{'type':Sequelize[_0x15d0('0x4')]},'answertime':{'type':Sequelize[_0x15d0('0x4')]},'droptime':{'type':Sequelize[_0x15d0('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x15d0('0x3')]},'campaign':{'type':Sequelize[_0x15d0('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x15d0('0x3')]},'reason':{'type':Sequelize[_0x15d0('0x3')]},'amd':{'type':Sequelize[_0x15d0('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x15d0('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x15d0('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x15d0('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x15d0('0x4')]},'edited':{'type':Sequelize[_0x15d0('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x15d0('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x15d0('0x3')]}}; \ No newline at end of file +var _0x28c6=['DATE','BOOLEAN','exports','STRING','INTEGER'];(function(_0x585caa,_0x2b459e){var _0x2c7dc6=function(_0x5a590b){while(--_0x5a590b){_0x585caa['push'](_0x585caa['shift']());}};_0x2c7dc6(++_0x2b459e);}(_0x28c6,0x147));var _0x628c=function(_0x2f9467,_0x40576f){_0x2f9467=_0x2f9467-0x0;var _0x39894c=_0x28c6[_0x2f9467];return _0x39894c;};'use strict';var Sequelize=require('sequelize');module[_0x628c('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x628c('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x628c('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x628c('0x1')]},'originatecalleridname':{'type':Sequelize[_0x628c('0x1')]},'calleridnum':{'type':Sequelize[_0x628c('0x1')]},'calleridname':{'type':Sequelize[_0x628c('0x1')]},'starttime':{'type':Sequelize[_0x628c('0x3')]},'responsetime':{'type':Sequelize[_0x628c('0x3')]},'answertime':{'type':Sequelize[_0x628c('0x3')]},'droptime':{'type':Sequelize[_0x628c('0x3')]},'endtime':{'type':Sequelize[_0x628c('0x3')]},'ringtime':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x628c('0x1')]},'campaign':{'type':Sequelize[_0x628c('0x1')]},'campaigntype':{'type':Sequelize[_0x628c('0x1')]},'membername':{'type':Sequelize[_0x628c('0x1')]},'reason':{'type':Sequelize[_0x628c('0x1')]},'amd':{'type':Sequelize[_0x628c('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x628c('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x628c('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x628c('0x3')]},'recallme':{'type':Sequelize[_0x628c('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x628c('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x628c('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x628c('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index d2de151..50cf86b 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 _0x6969=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','json','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','CmHopperHistory','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','update','uniqueid','html-pdf','eml-format'];(function(_0x11d0a2,_0x594caf){var _0x443c9c=function(_0x1b299e){while(--_0x1b299e){_0x11d0a2['push'](_0x11d0a2['shift']());}};_0x443c9c(++_0x594caf);}(_0x6969,0x17f));var _0x9696=function(_0x429f79,_0x2d8b89){_0x429f79=_0x429f79-0x0;var _0x44935c=_0x6969[_0x429f79];return _0x44935c;};'use strict';var pdf=require(_0x9696('0x0'));var emlformat=require(_0x9696('0x1'));var rimraf=require(_0x9696('0x2'));var zipdir=require(_0x9696('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9696('0x4'));var moment=require(_0x9696('0x5'));var BPromise=require(_0x9696('0x6'));var Mustache=require(_0x9696('0x7'));var util=require(_0x9696('0x8'));var path=require('path');var sox=require(_0x9696('0x9'));var csv=require(_0x9696('0xa'));var ejs=require(_0x9696('0xb'));var fs=require('fs');var _=require(_0x9696('0xc'));var squel=require('squel');var crypto=require(_0x9696('0xd'));var jsforce=require(_0x9696('0xe'));var deskjs=require(_0x9696('0xf'));var toCsv=require(_0x9696('0xa'));var querystring=require('querystring');var Papa=require(_0x9696('0x10'));var Redis=require(_0x9696('0x11'));var authService=require(_0x9696('0x12'));var qs=require(_0x9696('0x13'));var as=require(_0x9696('0x14'));var hardwareService=require(_0x9696('0x15'));var logger=require(_0x9696('0x16'))(_0x9696('0x17'));var utils=require('../../config/utils');var config=require(_0x9696('0x18'));var db=require(_0x9696('0x19'))['db'];function respondWithStatusCode(_0x311bee,_0xc105f0){_0xc105f0=_0xc105f0||0xcc;return function(_0x4ce613){if(_0x4ce613){return _0x311bee['sendStatus'](_0xc105f0);}return _0x311bee[_0x9696('0x1a')](_0xc105f0)[_0x9696('0x1b')]();};}function respondWithResult(_0x31472d,_0x4ca883){_0x4ca883=_0x4ca883||0xc8;return function(_0x2a8a60){if(_0x2a8a60){return _0x31472d[_0x9696('0x1a')](_0x4ca883)['json'](_0x2a8a60);}};}function respondWithFilteredResult(_0x56dc6f,_0x12cfb6){return function(_0x3a8878){if(_0x3a8878){var _0x2d18f1=_0x3a8878[_0x9696('0x1c')],_0x23b643=_0x12cfb6[_0x9696('0x1d')],_0x31d48e=_0x12cfb6[_0x9696('0x1d')]+_0x12cfb6[_0x9696('0x1e')],_0x171c5d;if(_0x31d48e>=_0x2d18f1){_0x31d48e=_0x2d18f1;_0x171c5d=0xc8;}else{_0x171c5d=0xce;}_0x56dc6f['status'](_0x171c5d);return _0x56dc6f[_0x9696('0x1f')]('Content-Range',_0x23b643+'-'+_0x31d48e+'/'+_0x2d18f1)[_0x9696('0x20')](_0x3a8878);}return null;};}function patchUpdates(_0x3ee9f2){return function(_0x36191b){try{jsonpatch[_0x9696('0x21')](_0x36191b,_0x3ee9f2,!![]);}catch(_0x6f2044){return BPromise[_0x9696('0x22')](_0x6f2044);}return _0x36191b[_0x9696('0x23')]();};}function saveUpdates(_0x2b23cc,_0x3b389b){return function(_0x4048ab){if(_0x4048ab){return _0x4048ab['update'](_0x2b23cc)['then'](function(_0xade7d5){return _0xade7d5;});}return null;};}function removeEntity(_0x2b20f3,_0x3994f4){return function(_0x615166){if(_0x615166){return _0x615166[_0x9696('0x24')]()[_0x9696('0x25')](function(){_0x2b20f3[_0x9696('0x1a')](0xcc)[_0x9696('0x1b')]();});}};}function handleEntityNotFound(_0x41bb89,_0x14ac45){return function(_0x1df867){if(!_0x1df867){_0x41bb89['sendStatus'](0x194);}return _0x1df867;};}function handleError(_0x350489,_0x327cd8){_0x327cd8=_0x327cd8||0x1f4;return function(_0x40274f){logger[_0x9696('0x26')](_0x40274f[_0x9696('0x27')]);if(_0x40274f[_0x9696('0x28')]){delete _0x40274f['name'];}_0x350489[_0x9696('0x1a')](_0x327cd8)['send'](_0x40274f);};}exports[_0x9696('0x29')]=function(_0x23a339,_0x4c0e8e){var _0x3504d7={},_0x1012bb={},_0x706eee={'count':0x0,'rows':[]};var _0x12863d=_[_0x9696('0x2a')](db['CmHopperHistory'][_0x9696('0x2b')],function(_0x46d8d6){return{'name':_0x46d8d6[_0x9696('0x2c')],'type':_0x46d8d6['type'][_0x9696('0x2d')]};});_0x1012bb[_0x9696('0x2e')]=_[_0x9696('0x2a')](_0x12863d,_0x9696('0x28'));_0x1012bb[_0x9696('0x2f')]=_[_0x9696('0x30')](_0x23a339['query']);_0x1012bb['filters']=_[_0x9696('0x31')](_0x1012bb[_0x9696('0x2e')],_0x1012bb['query']);_0x3504d7[_0x9696('0x32')]=_[_0x9696('0x31')](_0x1012bb[_0x9696('0x2e')],qs[_0x9696('0x33')](_0x23a339[_0x9696('0x2f')]['fields']));_0x3504d7[_0x9696('0x32')]=_0x3504d7[_0x9696('0x32')]['length']?_0x3504d7['attributes']:_0x1012bb[_0x9696('0x2e')];if(!_0x23a339[_0x9696('0x2f')]['hasOwnProperty'](_0x9696('0x34'))){_0x3504d7[_0x9696('0x1e')]=qs['limit'](_0x23a339[_0x9696('0x2f')][_0x9696('0x1e')]);_0x3504d7[_0x9696('0x1d')]=qs[_0x9696('0x1d')](_0x23a339[_0x9696('0x2f')][_0x9696('0x1d')]);}_0x3504d7[_0x9696('0x35')]=qs[_0x9696('0x36')](_0x23a339[_0x9696('0x2f')][_0x9696('0x36')]);_0x3504d7[_0x9696('0x37')]=qs['filters'](_[_0x9696('0x38')](_0x23a339[_0x9696('0x2f')],_0x1012bb[_0x9696('0x39')]),_0x12863d);if(_0x23a339[_0x9696('0x2f')][_0x9696('0x3a')]){_0x3504d7[_0x9696('0x37')]=_['merge'](_0x3504d7[_0x9696('0x37')],{'$or':_[_0x9696('0x2a')](_0x12863d,function(_0x1510d7){if(_0x1510d7[_0x9696('0x3b')]!==_0x9696('0x3c')){var _0x27d940={};_0x27d940[_0x1510d7[_0x9696('0x28')]]={'$like':'%'+_0x23a339[_0x9696('0x2f')][_0x9696('0x3a')]+'%'};return _0x27d940;}})});}_0x3504d7=_[_0x9696('0x3d')]({},_0x3504d7,_0x23a339[_0x9696('0x3e')]);var _0x34c235={'where':_0x3504d7['where']};return db[_0x9696('0x3f')]['count'](_0x34c235)[_0x9696('0x25')](function(_0x5dab23){_0x706eee[_0x9696('0x1c')]=_0x5dab23;if(_0x23a339[_0x9696('0x2f')][_0x9696('0x40')]){_0x3504d7['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x9696('0x41')](_0x3504d7);})[_0x9696('0x25')](function(_0x39edce){_0x706eee[_0x9696('0x42')]=_0x39edce;return _0x706eee;})['then'](respondWithFilteredResult(_0x4c0e8e,_0x3504d7))['catch'](handleError(_0x4c0e8e,null));};exports[_0x9696('0x43')]=function(_0x34bbda,_0x350b71){var _0x2acedc={'raw':!![],'where':{'id':_0x34bbda[_0x9696('0x44')]['id']}},_0x3dc1e1={};_0x3dc1e1[_0x9696('0x2e')]=_[_0x9696('0x30')](db[_0x9696('0x3f')][_0x9696('0x2b')]);_0x3dc1e1['query']=_[_0x9696('0x30')](_0x34bbda[_0x9696('0x2f')]);_0x3dc1e1[_0x9696('0x39')]=_[_0x9696('0x31')](_0x3dc1e1[_0x9696('0x2e')],_0x3dc1e1[_0x9696('0x2f')]);_0x2acedc[_0x9696('0x32')]=_['intersection'](_0x3dc1e1[_0x9696('0x2e')],qs['fields'](_0x34bbda[_0x9696('0x2f')][_0x9696('0x33')]));_0x2acedc[_0x9696('0x32')]=_0x2acedc[_0x9696('0x32')]['length']?_0x2acedc['attributes']:_0x3dc1e1[_0x9696('0x2e')];if(_0x34bbda[_0x9696('0x2f')][_0x9696('0x40')]){_0x2acedc[_0x9696('0x45')]=[{'all':!![]}];}_0x2acedc=_[_0x9696('0x3d')]({},_0x2acedc,_0x34bbda[_0x9696('0x3e')]);return db[_0x9696('0x3f')][_0x9696('0x46')](_0x2acedc)[_0x9696('0x25')](handleEntityNotFound(_0x350b71,null))[_0x9696('0x25')](respondWithResult(_0x350b71,null))[_0x9696('0x47')](handleError(_0x350b71,null));};exports[_0x9696('0x48')]=function(_0x31730b,_0x988c9){return db[_0x9696('0x3f')]['create'](_0x31730b[_0x9696('0x49')],{})['then'](respondWithResult(_0x988c9,0xc9))[_0x9696('0x47')](handleError(_0x988c9,null));};exports[_0x9696('0x4a')]=function(_0x22824c,_0x15f759){return db[_0x9696('0x3f')][_0x9696('0x4a')]()[_0x9696('0x25')](respondWithResult(_0x15f759,null))[_0x9696('0x47')](handleError(_0x15f759,null));};exports[_0x9696('0x4b')]=function(_0x370552,_0x29e24b){if(_0x370552['body'][_0x9696('0x4c')]){delete _0x370552[_0x9696('0x49')]['uniqueid'];}return db[_0x9696('0x3f')][_0x9696('0x46')]({'where':{'uniqueid':_0x370552['params']['id']}})[_0x9696('0x25')](handleEntityNotFound(_0x29e24b,null))['then'](saveUpdates(_0x370552[_0x9696('0x49')],null))[_0x9696('0x25')](respondWithResult(_0x29e24b,null))[_0x9696('0x47')](handleError(_0x29e24b,null));}; \ No newline at end of file +var _0x0089=['path','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','then','destroy','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','include','find','create','describe','update','body','uniqueid','rimraf','zip-dir','fast-json-patch','mustache','util'];(function(_0x1482d9,_0x267672){var _0x4383b4=function(_0x302db1){while(--_0x302db1){_0x1482d9['push'](_0x1482d9['shift']());}};_0x4383b4(++_0x267672);}(_0x0089,0x14f));var _0x9008=function(_0x36b9cb,_0x5a9a26){_0x36b9cb=_0x36b9cb-0x0;var _0x1d94e3=_0x0089[_0x36b9cb];return _0x1d94e3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9008('0x0'));var zipdir=require(_0x9008('0x1'));var jsonpatch=require(_0x9008('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9008('0x3'));var util=require(_0x9008('0x4'));var path=require(_0x9008('0x5'));var sox=require('sox');var csv=require(_0x9008('0x6'));var ejs=require(_0x9008('0x7'));var fs=require('fs');var _=require(_0x9008('0x8'));var squel=require(_0x9008('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9008('0x6'));var querystring=require(_0x9008('0xa'));var Papa=require(_0x9008('0xb'));var Redis=require(_0x9008('0xc'));var authService=require(_0x9008('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9008('0xe'));var logger=require(_0x9008('0xf'))('api');var utils=require(_0x9008('0x10'));var config=require(_0x9008('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x587e45,_0xa280d1){_0xa280d1=_0xa280d1||0xcc;return function(_0x1382eb){if(_0x1382eb){return _0x587e45[_0x9008('0x12')](_0xa280d1);}return _0x587e45[_0x9008('0x13')](_0xa280d1)[_0x9008('0x14')]();};}function respondWithResult(_0x1baee9,_0x492283){_0x492283=_0x492283||0xc8;return function(_0x3a2cce){if(_0x3a2cce){return _0x1baee9['status'](_0x492283)[_0x9008('0x15')](_0x3a2cce);}};}function respondWithFilteredResult(_0x1f4ebf,_0x212a3d){return function(_0x3f7d94){if(_0x3f7d94){var _0xee3088=_0x3f7d94['count'],_0xb618ab=_0x212a3d[_0x9008('0x16')],_0x42e1d7=_0x212a3d[_0x9008('0x16')]+_0x212a3d[_0x9008('0x17')],_0x3e5586;if(_0x42e1d7>=_0xee3088){_0x42e1d7=_0xee3088;_0x3e5586=0xc8;}else{_0x3e5586=0xce;}_0x1f4ebf[_0x9008('0x13')](_0x3e5586);return _0x1f4ebf[_0x9008('0x18')]('Content-Range',_0xb618ab+'-'+_0x42e1d7+'/'+_0xee3088)[_0x9008('0x15')](_0x3f7d94);}return null;};}function patchUpdates(_0x4c1f53){return function(_0x563153){try{jsonpatch[_0x9008('0x19')](_0x563153,_0x4c1f53,!![]);}catch(_0x17fa6e){return BPromise[_0x9008('0x1a')](_0x17fa6e);}return _0x563153[_0x9008('0x1b')]();};}function saveUpdates(_0x26b5ce,_0x539392){return function(_0x5bfe0b){if(_0x5bfe0b){return _0x5bfe0b['update'](_0x26b5ce)[_0x9008('0x1c')](function(_0xfd770){return _0xfd770;});}return null;};}function removeEntity(_0x597eb7,_0x3355b8){return function(_0x397eed){if(_0x397eed){return _0x397eed[_0x9008('0x1d')]()[_0x9008('0x1c')](function(){_0x597eb7[_0x9008('0x13')](0xcc)[_0x9008('0x14')]();});}};}function handleEntityNotFound(_0x1e24da,_0x4416d3){return function(_0x32cae1){if(!_0x32cae1){_0x1e24da[_0x9008('0x12')](0x194);}return _0x32cae1;};}function handleError(_0x285bc8,_0x400238){_0x400238=_0x400238||0x1f4;return function(_0x1d875c){logger['error'](_0x1d875c['stack']);if(_0x1d875c[_0x9008('0x1e')]){delete _0x1d875c[_0x9008('0x1e')];}_0x285bc8[_0x9008('0x13')](_0x400238)[_0x9008('0x1f')](_0x1d875c);};}exports['index']=function(_0x368a73,_0x1dfabf){var _0x5bfd04={},_0x54e98d={},_0x39eb68={'count':0x0,'rows':[]};var _0x1b8b0d=_[_0x9008('0x20')](db[_0x9008('0x21')][_0x9008('0x22')],function(_0x5b9363){return{'name':_0x5b9363[_0x9008('0x23')],'type':_0x5b9363[_0x9008('0x24')]['key']};});_0x54e98d['model']=_[_0x9008('0x20')](_0x1b8b0d,'name');_0x54e98d[_0x9008('0x25')]=_[_0x9008('0x26')](_0x368a73[_0x9008('0x25')]);_0x54e98d[_0x9008('0x27')]=_[_0x9008('0x28')](_0x54e98d[_0x9008('0x29')],_0x54e98d['query']);_0x5bfd04['attributes']=_['intersection'](_0x54e98d[_0x9008('0x29')],qs[_0x9008('0x2a')](_0x368a73[_0x9008('0x25')][_0x9008('0x2a')]));_0x5bfd04['attributes']=_0x5bfd04['attributes'][_0x9008('0x2b')]?_0x5bfd04[_0x9008('0x2c')]:_0x54e98d[_0x9008('0x29')];if(!_0x368a73['query'][_0x9008('0x2d')](_0x9008('0x2e'))){_0x5bfd04['limit']=qs['limit'](_0x368a73[_0x9008('0x25')]['limit']);_0x5bfd04[_0x9008('0x16')]=qs[_0x9008('0x16')](_0x368a73[_0x9008('0x25')][_0x9008('0x16')]);}_0x5bfd04[_0x9008('0x2f')]=qs[_0x9008('0x30')](_0x368a73[_0x9008('0x25')]['sort']);_0x5bfd04[_0x9008('0x31')]=qs[_0x9008('0x27')](_[_0x9008('0x32')](_0x368a73[_0x9008('0x25')],_0x54e98d[_0x9008('0x27')]),_0x1b8b0d);if(_0x368a73[_0x9008('0x25')][_0x9008('0x33')]){_0x5bfd04[_0x9008('0x31')]=_[_0x9008('0x34')](_0x5bfd04[_0x9008('0x31')],{'$or':_[_0x9008('0x20')](_0x1b8b0d,function(_0x28a201){if(_0x28a201[_0x9008('0x24')]!==_0x9008('0x35')){var _0x20e6d4={};_0x20e6d4[_0x28a201[_0x9008('0x1e')]]={'$like':'%'+_0x368a73['query']['filter']+'%'};return _0x20e6d4;}})});}_0x5bfd04=_['merge']({},_0x5bfd04,_0x368a73[_0x9008('0x36')]);var _0x1d8b1c={'where':_0x5bfd04[_0x9008('0x31')]};return db[_0x9008('0x21')][_0x9008('0x37')](_0x1d8b1c)[_0x9008('0x1c')](function(_0x525b51){_0x39eb68[_0x9008('0x37')]=_0x525b51;if(_0x368a73['query'][_0x9008('0x38')]){_0x5bfd04['include']=[{'all':!![]}];}return db[_0x9008('0x21')][_0x9008('0x39')](_0x5bfd04);})['then'](function(_0x51851){_0x39eb68[_0x9008('0x3a')]=_0x51851;return _0x39eb68;})[_0x9008('0x1c')](respondWithFilteredResult(_0x1dfabf,_0x5bfd04))[_0x9008('0x3b')](handleError(_0x1dfabf,null));};exports['show']=function(_0x34d7f7,_0x50ce21){var _0x575871={'raw':!![],'where':{'id':_0x34d7f7[_0x9008('0x3c')]['id']}},_0x4de5ff={};_0x4de5ff[_0x9008('0x29')]=_[_0x9008('0x26')](db['CmHopperHistory'][_0x9008('0x22')]);_0x4de5ff[_0x9008('0x25')]=_[_0x9008('0x26')](_0x34d7f7[_0x9008('0x25')]);_0x4de5ff[_0x9008('0x27')]=_[_0x9008('0x28')](_0x4de5ff[_0x9008('0x29')],_0x4de5ff[_0x9008('0x25')]);_0x575871[_0x9008('0x2c')]=_[_0x9008('0x28')](_0x4de5ff[_0x9008('0x29')],qs['fields'](_0x34d7f7[_0x9008('0x25')]['fields']));_0x575871['attributes']=_0x575871[_0x9008('0x2c')][_0x9008('0x2b')]?_0x575871[_0x9008('0x2c')]:_0x4de5ff[_0x9008('0x29')];if(_0x34d7f7[_0x9008('0x25')][_0x9008('0x38')]){_0x575871[_0x9008('0x3d')]=[{'all':!![]}];}_0x575871=_[_0x9008('0x34')]({},_0x575871,_0x34d7f7[_0x9008('0x36')]);return db[_0x9008('0x21')][_0x9008('0x3e')](_0x575871)[_0x9008('0x1c')](handleEntityNotFound(_0x50ce21,null))[_0x9008('0x1c')](respondWithResult(_0x50ce21,null))[_0x9008('0x3b')](handleError(_0x50ce21,null));};exports[_0x9008('0x3f')]=function(_0x4559bc,_0x3fdffc){return db[_0x9008('0x21')]['create'](_0x4559bc['body'],{})[_0x9008('0x1c')](respondWithResult(_0x3fdffc,0xc9))[_0x9008('0x3b')](handleError(_0x3fdffc,null));};exports[_0x9008('0x40')]=function(_0x36b958,_0x54c7f6){return db[_0x9008('0x21')]['describe']()['then'](respondWithResult(_0x54c7f6,null))[_0x9008('0x3b')](handleError(_0x54c7f6,null));};exports[_0x9008('0x41')]=function(_0x59eb22,_0x263635){if(_0x59eb22[_0x9008('0x42')][_0x9008('0x43')]){delete _0x59eb22[_0x9008('0x42')][_0x9008('0x43')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x59eb22[_0x9008('0x3c')]['id']}})['then'](handleEntityNotFound(_0x263635,null))['then'](saveUpdates(_0x59eb22[_0x9008('0x42')],null))[_0x9008('0x1c')](respondWithResult(_0x263635,null))[_0x9008('0x3b')](handleError(_0x263635,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 552c210..405b8a1 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 _0xa909=['../../config/environment','./cmHopperHistory.attributes','define','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0xa909,0x19b));var _0x9a90=function(_0x491088,_0x1e26db){_0x491088=_0x491088-0x0;var _0x53e1a4=_0xa909[_0x491088];return _0x53e1a4;};'use strict';var _=require(_0x9a90('0x0'));var util=require(_0x9a90('0x1'));var logger=require(_0x9a90('0x2'))(_0x9a90('0x3'));var moment=require(_0x9a90('0x4'));var BPromise=require(_0x9a90('0x5'));var rp=require(_0x9a90('0x6'));var fs=require('fs');var path=require(_0x9a90('0x7'));var rimraf=require(_0x9a90('0x8'));var config=require(_0x9a90('0x9'));var attributes=require(_0x9a90('0xa'));module['exports']=function(_0x10764c,_0x3824e8){return _0x10764c[_0x9a90('0xb')]('CmHopperHistory',attributes,{'tableName':_0x9a90('0xc'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x9a90('0xd')]},{'name':_0x9a90('0xe'),'fields':[_0x9a90('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x65c6=['endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopperHistory.attributes','define','cm_hopper_history'];(function(_0x1b28a1,_0x29c65e){var _0x36c1be=function(_0x4ac8cb){while(--_0x4ac8cb){_0x1b28a1['push'](_0x1b28a1['shift']());}};_0x36c1be(++_0x29c65e);}(_0x65c6,0x198));var _0x665c=function(_0x1f1402,_0x498b4b){_0x1f1402=_0x1f1402-0x0;var _0x53759a=_0x65c6[_0x1f1402];return _0x53759a;};'use strict';var _=require(_0x665c('0x0'));var util=require(_0x665c('0x1'));var logger=require(_0x665c('0x2'))(_0x665c('0x3'));var moment=require(_0x665c('0x4'));var BPromise=require(_0x665c('0x5'));var rp=require(_0x665c('0x6'));var fs=require('fs');var path=require(_0x665c('0x7'));var rimraf=require(_0x665c('0x8'));var config=require('../../config/environment');var attributes=require(_0x665c('0x9'));module['exports']=function(_0x549c82,_0x257d1f){return _0x549c82[_0x665c('0xa')]('CmHopperHistory',attributes,{'tableName':_0x665c('0xb'),'paranoid':![],'indexes':[{'name':_0x665c('0xc'),'fields':[_0x665c('0xc')]},{'name':_0x665c('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index d6df2f1..a216944 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 _0x6e6c=['jayson/promise','client','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','AvgHandleTime','findAll','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','where','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','../../config/utils','rpc'];(function(_0x1414c0,_0x4d7272){var _0x33019b=function(_0x2294cf){while(--_0x2294cf){_0x1414c0['push'](_0x1414c0['shift']());}};_0x33019b(++_0x4d7272);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var moment=require('moment');var BPromise=require(_0xc6e6('0x2'));var rs=require(_0xc6e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc6e6('0x4'));var logger=require('../../config/logger')(_0xc6e6('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6e6('0x6'));var client=jayson[_0xc6e6('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x301f55,_0x30a10b,_0x4da7bd){return new BPromise(function(_0x324706,_0x15d268){return client['request'](_0x301f55,_0x4da7bd)[_0xc6e6('0x8')](function(_0x481799){logger[_0xc6e6('0x9')](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));logger[_0xc6e6('0xc')](_0xc6e6('0xd'),_0x30a10b,_0xc6e6('0xb'),JSON[_0xc6e6('0xe')](_0x481799));if(_0x481799[_0xc6e6('0xf')]){if(_0x481799[_0xc6e6('0xf')]['code']===0x1f4){logger[_0xc6e6('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x15d268(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}logger['error'](_0xc6e6('0xa'),_0x30a10b,_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);return _0x324706(_0x481799[_0xc6e6('0xf')][_0xc6e6('0x10')]);}else{logger['info'](_0xc6e6('0xa'),_0x30a10b,_0xc6e6('0xb'));_0x324706(_0x481799['result'][_0xc6e6('0x10')]);}})[_0xc6e6('0x11')](function(_0xedf127){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x30a10b,_0xedf127);_0x15d268(_0xedf127);});});}exports['CreateCmHopperHistory']=function(_0x3a1ccc){var _0x554262=this;return new Promise(function(_0x46e58f,_0x2069e4){return db[_0xc6e6('0x12')][_0xc6e6('0x13')](_0x3a1ccc[_0xc6e6('0x14')],{'raw':_0x3a1ccc[_0xc6e6('0x15')]?_0x3a1ccc[_0xc6e6('0x15')][_0xc6e6('0x16')]===undefined?!![]:![]:!![]})[_0xc6e6('0x8')](function(_0x3d734d){logger['info'](_0xc6e6('0x17'),_0x3a1ccc);logger['debug'](_0xc6e6('0x17'),_0x3a1ccc,JSON[_0xc6e6('0xe')](_0x3d734d));_0x46e58f(_0x3d734d);})[_0xc6e6('0x11')](function(_0x2f69f1){logger['error'](_0xc6e6('0x17'),_0x2f69f1[_0xc6e6('0x10')],_0x3a1ccc);_0x2069e4(_0x554262[_0xc6e6('0xf')](0x1f4,_0x2f69f1[_0xc6e6('0x10')]));});});};exports[_0xc6e6('0x18')]=function(_0x4c35ae){var _0x41fe96=this;return new Promise(function(_0x51fe51,_0x266786){return db[_0xc6e6('0x12')][_0xc6e6('0x19')]({'raw':_0x4c35ae[_0xc6e6('0x15')]?_0x4c35ae['options'][_0xc6e6('0x16')]===undefined?!![]:![]:!![],'where':_0x4c35ae['options']?_0x4c35ae[_0xc6e6('0x15')]['where']||null:null,'attributes':[[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')][_0xc6e6('0x1c')]('id')),_0xc6e6('0x1d')],[db['sequelize']['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xc6e6('0x1f')],[db['sequelize']['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x20')))),_0xc6e6('0x21')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x22')))),_0xc6e6('0x23')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x24'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')]['literal'](_0xc6e6('0x25')))),_0xc6e6('0x26')],[db['sequelize']['fn']('AVG',db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x27')))),_0xc6e6('0x28')]]})[_0xc6e6('0x8')](function(_0x59a8f0){logger[_0xc6e6('0x9')](_0xc6e6('0x18'),_0x4c35ae);logger[_0xc6e6('0xc')]('AvgHandleTime',_0x4c35ae,JSON['stringify'](_0x59a8f0));_0x51fe51(_0x59a8f0);})[_0xc6e6('0x11')](function(_0xcf753){logger[_0xc6e6('0xf')](_0xc6e6('0x18'),_0xcf753['message'],_0x4c35ae);_0x266786(_0x41fe96['error'](0x1f4,_0xcf753[_0xc6e6('0x10')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x268c8f){var _0x577aa6=this;return new Promise(function(_0x357eae,_0x404fb3){return db[_0xc6e6('0x12')][_0xc6e6('0x19')]({'raw':_0x268c8f['options']?_0x268c8f['options'][_0xc6e6('0x16')]===undefined?!![]:![]:!![],'where':_0x268c8f[_0xc6e6('0x15')]?_0x268c8f[_0xc6e6('0x15')][_0xc6e6('0x29')]||null:null,'attributes':[['campaign','name'],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')]['literal'](_0xc6e6('0x2a')))),_0xc6e6('0x2b')],[db['sequelize']['fn']('COUNT',db[_0xc6e6('0x1a')]['fn']('IF',db['sequelize'][_0xc6e6('0x1e')](_0xc6e6('0x2c')))),'outboundNoAnswerCallsDay'],[db[_0xc6e6('0x1a')]['fn']('COUNT',db[_0xc6e6('0x1a')]['fn']('IF',db['sequelize'][_0xc6e6('0x1e')](_0xc6e6('0x2d')))),_0xc6e6('0x2e')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x2f')))),'outboundBusyCallsDay'],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')]['literal'](_0xc6e6('0x30')))),_0xc6e6('0x31')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db['sequelize']['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x32')))),_0xc6e6('0x33')],[db[_0xc6e6('0x1a')]['fn']('COUNT',db[_0xc6e6('0x1a')]['fn']('IF',db['sequelize'][_0xc6e6('0x1e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xc6e6('0x34')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x35')))),_0xc6e6('0x36')],[db['sequelize']['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')]['literal'](_0xc6e6('0x37')))),_0xc6e6('0x38')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x39')))),_0xc6e6('0x3a')],[db[_0xc6e6('0x1a')]['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),_0xc6e6('0x3b')],[db['sequelize']['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')](_0xc6e6('0x3c')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xc6e6('0x1b'),db[_0xc6e6('0x1a')]['fn']('IF',db[_0xc6e6('0x1a')][_0xc6e6('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0xc6e6('0x3d')]],'group':[_0xc6e6('0x3e')]})[_0xc6e6('0x8')](function(_0x286dcf){logger[_0xc6e6('0x9')]('GetVoiceQueueHopperHistory',_0x268c8f);logger[_0xc6e6('0xc')](_0xc6e6('0x3f'),_0x268c8f,JSON[_0xc6e6('0xe')](_0x286dcf));_0x357eae(_0x286dcf);})['catch'](function(_0x3df0db){logger[_0xc6e6('0xf')](_0xc6e6('0x3f'),_0x3df0db[_0xc6e6('0x10')],_0x268c8f);_0x404fb3(_0x577aa6[_0xc6e6('0xf')](0x1f4,_0x3df0db['message']));});});};exports[_0xc6e6('0x40')]=function(_0x1de5ca){var _0x7c088c=this;return new Promise(function(_0x3e7ec5,_0x287fd4){return db['CmHopperHistory']['findAll']({'raw':_0x1de5ca['options']?_0x1de5ca[_0xc6e6('0x15')][_0xc6e6('0x16')]===undefined?!![]:![]:!![],'where':_0x1de5ca[_0xc6e6('0x15')]?_0x1de5ca[_0xc6e6('0x15')][_0xc6e6('0x29')]||null:null,'attributes':[[_0xc6e6('0x3e'),'name'],[db[_0xc6e6('0x1a')]['fn']('COUNT',db[_0xc6e6('0x1a')][_0xc6e6('0x1c')]('id')),_0xc6e6('0x41')],[db['sequelize']['fn'](_0xc6e6('0x1b'),db['sequelize']['fn']('IF',db[_0xc6e6('0x1a')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xc6e6('0x42')]],'group':['campaign']})['then'](function(_0x44cab4){logger[_0xc6e6('0x9')](_0xc6e6('0x40'),_0x1de5ca);logger[_0xc6e6('0xc')](_0xc6e6('0x40'),_0x1de5ca,JSON[_0xc6e6('0xe')](_0x44cab4));_0x3e7ec5(_0x44cab4);})[_0xc6e6('0x11')](function(_0x461d2b){logger['error'](_0xc6e6('0x40'),_0x461d2b[_0xc6e6('0x10')],_0x1de5ca);_0x287fd4(_0x7c088c[_0xc6e6('0xf')](0x1f4,_0x461d2b[_0xc6e6('0x10')]));});});}; \ No newline at end of file +var _0xd64b=['`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','name','col','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','then','debug','AvgHandleTime','findAll','raw','where','sequelize','literal','predictiveIntervalAnsweredCalls','COUNT','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay'];(function(_0x480df8,_0x2d8f90){var _0x3dc854=function(_0x1ce48c){while(--_0x1ce48c){_0x480df8['push'](_0x480df8['shift']());}};_0x3dc854(++_0x2d8f90);}(_0xd64b,0xc1));var _0xbd64=function(_0x5777ff,_0x41bcaf){_0x5777ff=_0x5777ff-0x0;var _0x147704=_0xd64b[_0x5777ff];return _0x147704;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});}exports[_0xbd64('0x13')]=function(_0x1d7a14){var _0x17d015=this;return new Promise(function(_0x2f4554,_0xa5491d){return db[_0xbd64('0x14')]['create'](_0x1d7a14[_0xbd64('0x15')],{'raw':_0x1d7a14[_0xbd64('0x16')]?_0x1d7a14['options']['raw']===undefined?!![]:![]:!![]})[_0xbd64('0x17')](function(_0x42b328){logger[_0xbd64('0x9')](_0xbd64('0x13'),_0x1d7a14);logger[_0xbd64('0x18')](_0xbd64('0x13'),_0x1d7a14,JSON['stringify'](_0x42b328));_0x2f4554(_0x42b328);})['catch'](function(_0x6038f){logger[_0xbd64('0xe')](_0xbd64('0x13'),_0x6038f[_0xbd64('0x10')],_0x1d7a14);_0xa5491d(_0x17d015['error'](0x1f4,_0x6038f['message']));});});};exports[_0xbd64('0x19')]=function(_0x4afaff){var _0x46ab38=this;return new Promise(function(_0x5b356b,_0x33452d){return db[_0xbd64('0x14')][_0xbd64('0x1a')]({'raw':_0x4afaff[_0xbd64('0x16')]?_0x4afaff['options'][_0xbd64('0x1b')]===undefined?!![]:![]:!![],'where':_0x4afaff[_0xbd64('0x16')]?_0x4afaff[_0xbd64('0x16')][_0xbd64('0x1c')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xbd64('0x1d')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db['sequelize'][_0xbd64('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0xbd64('0x1f')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),_0xbd64('0x21')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xbd64('0x1d')]['fn']('AVG',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbd64('0x22')],[db['sequelize']['fn']('AVG',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xbd64('0x23')]]})['then'](function(_0x1fc9cf){logger[_0xbd64('0x9')](_0xbd64('0x19'),_0x4afaff);logger[_0xbd64('0x18')](_0xbd64('0x19'),_0x4afaff,JSON[_0xbd64('0xd')](_0x1fc9cf));_0x5b356b(_0x1fc9cf);})['catch'](function(_0x4d870e){logger[_0xbd64('0xe')](_0xbd64('0x19'),_0x4d870e[_0xbd64('0x10')],_0x4afaff);_0x33452d(_0x46ab38[_0xbd64('0xe')](0x1f4,_0x4d870e[_0xbd64('0x10')]));});});};exports[_0xbd64('0x24')]=function(_0x54784f){var _0x5a74a9=this;return new Promise(function(_0x1db1fa,_0x1bcd4c){return db[_0xbd64('0x14')]['findAll']({'raw':_0x54784f['options']?_0x54784f[_0xbd64('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x54784f[_0xbd64('0x16')]?_0x54784f['options'][_0xbd64('0x1c')]||null:null,'attributes':[[_0xbd64('0x25'),'name'],[db[_0xbd64('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x26')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal'](_0xbd64('0x27')))),_0xbd64('0x28')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db['sequelize']['fn']('IF',db['sequelize'][_0xbd64('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'outboundAnswerCallsDay'],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x29')))),_0xbd64('0x2a')],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal'](_0xbd64('0x2b')))),_0xbd64('0x2c')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xbd64('0x2d')],[db['sequelize']['fn'](_0xbd64('0x20'),db['sequelize']['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x2e')))),'outboundDropCallsDayCallersExit'],[db[_0xbd64('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xbd64('0x1e')](_0xbd64('0x2f')))),_0xbd64('0x30')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')]['literal'](_0xbd64('0x31')))),_0xbd64('0x32')],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x33')))),_0xbd64('0x34')],[db['sequelize']['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x35')))),_0xbd64('0x36')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')](_0xbd64('0x37')))),_0xbd64('0x38')],[db[_0xbd64('0x1d')]['fn']('COUNT',db[_0xbd64('0x1d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xbd64('0x25')]})[_0xbd64('0x17')](function(_0x5480f5){logger[_0xbd64('0x9')](_0xbd64('0x24'),_0x54784f);logger[_0xbd64('0x18')]('GetVoiceQueueHopperHistory',_0x54784f,JSON[_0xbd64('0xd')](_0x5480f5));_0x1db1fa(_0x5480f5);})[_0xbd64('0x12')](function(_0x44cd4f){logger[_0xbd64('0xe')](_0xbd64('0x24'),_0x44cd4f[_0xbd64('0x10')],_0x54784f);_0x1bcd4c(_0x5a74a9['error'](0x1f4,_0x44cd4f['message']));});});};exports['GetCampaignHopperHistory']=function(_0x11c50e){var _0x15c0de=this;return new Promise(function(_0x3548fe,_0x958272){return db['CmHopperHistory'][_0xbd64('0x1a')]({'raw':_0x11c50e[_0xbd64('0x16')]?_0x11c50e[_0xbd64('0x16')][_0xbd64('0x1b')]===undefined?!![]:![]:!![],'where':_0x11c50e[_0xbd64('0x16')]?_0x11c50e[_0xbd64('0x16')]['where']||null:null,'attributes':[[_0xbd64('0x25'),_0xbd64('0x39')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')][_0xbd64('0x3a')]('id')),_0xbd64('0x3b')],[db[_0xbd64('0x1d')]['fn'](_0xbd64('0x20'),db[_0xbd64('0x1d')]['fn']('IF',db[_0xbd64('0x1d')][_0xbd64('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xbd64('0x25')]})[_0xbd64('0x17')](function(_0x5ab7b3){logger['info'](_0xbd64('0x3c'),_0x11c50e);logger[_0xbd64('0x18')]('GetCampaignHopperHistory',_0x11c50e,JSON[_0xbd64('0xd')](_0x5ab7b3));_0x3548fe(_0x5ab7b3);})[_0xbd64('0x12')](function(_0x45573c){logger[_0xbd64('0xe')](_0xbd64('0x3c'),_0x45573c[_0xbd64('0x10')],_0x11c50e);_0x958272(_0x15c0de[_0xbd64('0xe')](0x1f4,_0x45573c[_0xbd64('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a17590b..098707d 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 _0xdda4=['create','put','update','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x48e970,_0x259e69){var _0x2d524a=function(_0x30555c){while(--_0x30555c){_0x48e970['push'](_0x48e970['shift']());}};_0x2d524a(++_0x259e69);}(_0xdda4,0x1a6));var _0x4dda=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0xdda4[_0x810e4d];return _0x13f01c;};'use strict';var multer=require('multer');var util=require(_0x4dda('0x0'));var path=require('path');var timeout=require(_0x4dda('0x1'));var express=require(_0x4dda('0x2'));var router=express[_0x4dda('0x3')]();var auth=require(_0x4dda('0x4'));var interaction=require(_0x4dda('0x5'));var config=require(_0x4dda('0x6'));var controller=require(_0x4dda('0x7'));router[_0x4dda('0x8')]('/',auth[_0x4dda('0x9')](),controller[_0x4dda('0xa')]);router[_0x4dda('0x8')](_0x4dda('0xb'),auth[_0x4dda('0x9')](),controller[_0x4dda('0xc')]);router[_0x4dda('0x8')](_0x4dda('0xd'),auth['isAuthenticated'](),controller[_0x4dda('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4dda('0xf')]);router[_0x4dda('0x10')](_0x4dda('0xd'),auth[_0x4dda('0x9')](),controller[_0x4dda('0x11')]);module[_0x4dda('0x12')]=router; \ No newline at end of file +var _0x0b70=['show','post','create','put','update','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x44b533,_0x221c8d){var _0x42325b=function(_0x309350){while(--_0x309350){_0x44b533['push'](_0x44b533['shift']());}};_0x42325b(++_0x221c8d);}(_0x0b70,0x159));var _0x00b7=function(_0x528885,_0x620238){_0x528885=_0x528885-0x0;var _0x472e4d=_0x0b70[_0x528885];return _0x472e4d;};'use strict';var multer=require('multer');var util=require(_0x00b7('0x0'));var path=require('path');var timeout=require(_0x00b7('0x1'));var express=require(_0x00b7('0x2'));var router=express['Router']();var auth=require(_0x00b7('0x3'));var interaction=require(_0x00b7('0x4'));var config=require(_0x00b7('0x5'));var controller=require('./cmHopperHistory.controller');router[_0x00b7('0x6')]('/',auth['isAuthenticated'](),controller[_0x00b7('0x7')]);router['get'](_0x00b7('0x8'),auth['isAuthenticated'](),controller[_0x00b7('0x9')]);router['get'](_0x00b7('0xa'),auth[_0x00b7('0xb')](),controller[_0x00b7('0xc')]);router[_0x00b7('0xd')]('/',auth['isAuthenticated'](),controller[_0x00b7('0xe')]);router[_0x00b7('0xf')](_0x00b7('0xa'),auth['isAuthenticated'](),controller[_0x00b7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 7c24d68..a0cd361 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 _0x220e=['name','exports','STRING'];(function(_0x3adca1,_0x30c4ee){var _0x53e896=function(_0xd80163){while(--_0xd80163){_0x3adca1['push'](_0x3adca1['shift']());}};_0x53e896(++_0x30c4ee);}(_0x220e,0x115));var _0xe220=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x220e[_0x3a833e];return _0xdff445;};'use strict';var Sequelize=require('sequelize');module[_0xe220('0x0')]={'name':{'type':Sequelize[_0xe220('0x1')],'unique':_0xe220('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xe220('0x1')]}}; \ No newline at end of file +var _0xed3c=['STRING','name','sequelize'];(function(_0xe402ea,_0x594695){var _0xb3c0d4=function(_0x5192a5){while(--_0x5192a5){_0xe402ea['push'](_0xe402ea['shift']());}};_0xb3c0d4(++_0x594695);}(_0xed3c,0xa1));var _0xced3=function(_0x40bdbc,_0x3fabcd){_0x40bdbc=_0x40bdbc-0x0;var _0xc603a8=_0xed3c[_0x40bdbc];return _0xc603a8;};'use strict';var Sequelize=require(_0xced3('0x0'));module['exports']={'name':{'type':Sequelize[_0xced3('0x1')],'unique':_0xced3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xced3('0x1')]},'dialPrefix':{'type':Sequelize[_0xced3('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 8c437a3..cd86b68 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 _0xcca4=['update','describe','addDisposition','Disposition','ListId','count','findAll','rows','removeDispositions','isArray','tags','join','push','each','CmContact','ids','success','dataValues','message','Malformed\x20request\x20syntax','CustomFields','concat','format','cf_%d','order','getContacts','getContactsCsv','isEmpty','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','transaction','CmCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','getCustomFields','findOne','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0xaedebb,_0x4ff1b8){var _0x897990=function(_0x395d7b){while(--_0x395d7b){_0xaedebb['push'](_0xaedebb['shift']());}};_0x897990(++_0x4ff1b8);}(_0xcca4,0xcd));var _0x4cca=function(_0x33f66c,_0x21aa25){_0x33f66c=_0x33f66c-0x0;var _0xf868f2=_0xcca4[_0x33f66c];return _0xf868f2;};'use strict';var pdf=require(_0x4cca('0x0'));var emlformat=require(_0x4cca('0x1'));var rimraf=require(_0x4cca('0x2'));var zipdir=require(_0x4cca('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4cca('0x4'));var moment=require(_0x4cca('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4cca('0x6'));var sox=require('sox');var csv=require(_0x4cca('0x7'));var ejs=require(_0x4cca('0x8'));var fs=require('fs');var _=require(_0x4cca('0x9'));var squel=require('squel');var crypto=require(_0x4cca('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4cca('0xb'));var toCsv=require(_0x4cca('0x7'));var querystring=require(_0x4cca('0xc'));var Papa=require(_0x4cca('0xd'));var Redis=require(_0x4cca('0xe'));var authService=require(_0x4cca('0xf'));var qs=require(_0x4cca('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4cca('0x11'));var logger=require(_0x4cca('0x12'))(_0x4cca('0x13'));var utils=require(_0x4cca('0x14'));var config=require(_0x4cca('0x15'));var db=require('../../mysqldb')['db'];config[_0x4cca('0x16')]=_[_0x4cca('0x17')](config[_0x4cca('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x4cca('0x18'))(new Redis(config[_0x4cca('0x16')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x2ea102,_0x145cf7){_0x145cf7=_0x145cf7||0xcc;return function(_0x1574aa){if(_0x1574aa){return _0x2ea102[_0x4cca('0x19')](_0x145cf7);}return _0x2ea102[_0x4cca('0x1a')](_0x145cf7)[_0x4cca('0x1b')]();};}function respondWithResult(_0x2634c5,_0x2cae2b){_0x2cae2b=_0x2cae2b||0xc8;return function(_0x2b30b1){if(_0x2b30b1){return _0x2634c5['status'](_0x2cae2b)[_0x4cca('0x1c')](_0x2b30b1);}};}function respondWithFilteredResult(_0x40c5fa,_0x272d0f){return function(_0x235e1a){if(_0x235e1a){var _0x1bff89=_0x235e1a['count'],_0xfba7e8=_0x272d0f[_0x4cca('0x1d')],_0x18ced7=_0x272d0f[_0x4cca('0x1d')]+_0x272d0f['limit'],_0x2e7c8e;if(_0x18ced7>=_0x1bff89){_0x18ced7=_0x1bff89;_0x2e7c8e=0xc8;}else{_0x2e7c8e=0xce;}_0x40c5fa[_0x4cca('0x1a')](_0x2e7c8e);return _0x40c5fa[_0x4cca('0x1e')](_0x4cca('0x1f'),_0xfba7e8+'-'+_0x18ced7+'/'+_0x1bff89)[_0x4cca('0x1c')](_0x235e1a);}return null;};}function patchUpdates(_0x1cfb54){return function(_0x13305d){try{jsonpatch['apply'](_0x13305d,_0x1cfb54,!![]);}catch(_0x366a12){return BPromise[_0x4cca('0x20')](_0x366a12);}return _0x13305d[_0x4cca('0x21')]();};}function saveUpdates(_0x265428,_0x506425){return function(_0x381da7){if(_0x381da7){return _0x381da7['update'](_0x265428)[_0x4cca('0x22')](function(_0x3c55f4){return _0x3c55f4;});}return null;};}function removeEntity(_0x65866,_0x1b3fc7){return function(_0x28a988){if(_0x28a988){return _0x28a988[_0x4cca('0x23')]()[_0x4cca('0x22')](function(){var _0x1dc801=_0x28a988[_0x4cca('0x24')]({'plain':!![]});var _0x2024b8='Lists';return db[_0x4cca('0x25')][_0x4cca('0x23')]({'where':{'type':_0x2024b8,'resourceId':_0x1dc801['id']}})[_0x4cca('0x22')](function(){return _0x28a988;});})[_0x4cca('0x22')](function(){_0x65866[_0x4cca('0x1a')](0xcc)[_0x4cca('0x1b')]();});}};}function handleEntityNotFound(_0x5149a7,_0x33135b){return function(_0x1949fc){if(!_0x1949fc){_0x5149a7[_0x4cca('0x19')](0x194);}return _0x1949fc;};}function handleError(_0x140cd4,_0x2c53bf){_0x2c53bf=_0x2c53bf||0x1f4;return function(_0x4e0dcb){logger[_0x4cca('0x26')](_0x4e0dcb[_0x4cca('0x27')]);if(_0x4e0dcb[_0x4cca('0x28')]){delete _0x4e0dcb['name'];}_0x140cd4[_0x4cca('0x1a')](_0x2c53bf)[_0x4cca('0x29')](_0x4e0dcb);};}exports[_0x4cca('0x2a')]=function(_0x3526a6,_0x35aae5){var _0x2efaca={},_0x35fd72={},_0xaa3e70={'count':0x0,'rows':[]};var _0x5d94d4=_[_0x4cca('0x2b')](db[_0x4cca('0x2c')][_0x4cca('0x2d')],function(_0x33c28a){return{'name':_0x33c28a[_0x4cca('0x2e')],'type':_0x33c28a[_0x4cca('0x2f')][_0x4cca('0x30')]};});_0x35fd72[_0x4cca('0x31')]=_[_0x4cca('0x2b')](_0x5d94d4,'name');_0x35fd72[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x3526a6['query']);_0x35fd72[_0x4cca('0x34')]=_[_0x4cca('0x35')](_0x35fd72['model'],_0x35fd72[_0x4cca('0x32')]);_0x2efaca[_0x4cca('0x36')]=_[_0x4cca('0x35')](_0x35fd72[_0x4cca('0x31')],qs[_0x4cca('0x37')](_0x3526a6[_0x4cca('0x32')]['fields']));_0x2efaca[_0x4cca('0x36')]=_0x2efaca[_0x4cca('0x36')][_0x4cca('0x38')]?_0x2efaca[_0x4cca('0x36')]:_0x35fd72[_0x4cca('0x31')];if(!_0x3526a6['query'][_0x4cca('0x39')](_0x4cca('0x3a'))){_0x2efaca['limit']=qs[_0x4cca('0x3b')](_0x3526a6['query'][_0x4cca('0x3b')]);_0x2efaca[_0x4cca('0x1d')]=qs[_0x4cca('0x1d')](_0x3526a6[_0x4cca('0x32')]['offset']);}_0x2efaca['order']=qs['sort'](_0x3526a6['query'][_0x4cca('0x3c')]);_0x2efaca[_0x4cca('0x3d')]=qs[_0x4cca('0x34')](_[_0x4cca('0x3e')](_0x3526a6[_0x4cca('0x32')],_0x35fd72['filters']),_0x5d94d4);if(_0x3526a6[_0x4cca('0x32')][_0x4cca('0x3f')]){_0x2efaca[_0x4cca('0x3d')]=_[_0x4cca('0x40')](_0x2efaca[_0x4cca('0x3d')],{'$or':_['map'](_0x5d94d4,function(_0x2cda25){if(_0x2cda25[_0x4cca('0x2f')]!==_0x4cca('0x41')){var _0x25f67e={};_0x25f67e[_0x2cda25['name']]={'$like':'%'+_0x3526a6[_0x4cca('0x32')]['filter']+'%'};return _0x25f67e;}})});}_0x2efaca=_[_0x4cca('0x40')]({},_0x2efaca,_0x3526a6[_0x4cca('0x42')]);var _0x3a6588={'where':_0x2efaca[_0x4cca('0x3d')]};return db[_0x4cca('0x2c')]['count'](_0x3a6588)[_0x4cca('0x22')](function(_0x3069a5){_0xaa3e70['count']=_0x3069a5;if(_0x3526a6[_0x4cca('0x32')][_0x4cca('0x43')]){_0x2efaca[_0x4cca('0x44')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x2efaca);})[_0x4cca('0x22')](function(_0x41ebbc){_0xaa3e70['rows']=_0x41ebbc;return _0xaa3e70;})[_0x4cca('0x22')](respondWithFilteredResult(_0x35aae5,_0x2efaca))[_0x4cca('0x45')](handleError(_0x35aae5,null));};exports['show']=function(_0x3b288e,_0x13c734){var _0x25a998={'raw':![],'where':{'id':_0x3b288e[_0x4cca('0x46')]['id']}},_0x584639={};_0x584639[_0x4cca('0x31')]=_[_0x4cca('0x33')](db[_0x4cca('0x2c')][_0x4cca('0x2d')]);_0x584639[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x3b288e[_0x4cca('0x32')]);_0x584639[_0x4cca('0x34')]=_['intersection'](_0x584639[_0x4cca('0x31')],_0x584639[_0x4cca('0x32')]);_0x25a998[_0x4cca('0x36')]=_[_0x4cca('0x35')](_0x584639['model'],qs[_0x4cca('0x37')](_0x3b288e['query']['fields']));_0x25a998[_0x4cca('0x36')]=_0x25a998[_0x4cca('0x36')][_0x4cca('0x38')]?_0x25a998['attributes']:_0x584639[_0x4cca('0x31')];if(_0x3b288e['query']['includeAll']){_0x25a998[_0x4cca('0x44')]=[{'all':!![]}];}_0x25a998=_[_0x4cca('0x40')]({},_0x25a998,_0x3b288e[_0x4cca('0x42')]);return db[_0x4cca('0x2c')][_0x4cca('0x47')](_0x25a998)[_0x4cca('0x22')](handleEntityNotFound(_0x13c734,null))['then'](respondWithResult(_0x13c734,null))[_0x4cca('0x45')](handleError(_0x13c734,null));};exports[_0x4cca('0x48')]=function(_0x778b31,_0x1aa588){return db[_0x4cca('0x2c')]['create'](_0x778b31[_0x4cca('0x49')],{})['then'](function(_0xa9696){var _0x4add97=_0x778b31[_0x4cca('0x4a')][_0x4cca('0x24')]({'plain':!![]});if(!_0x4add97)throw new Error(_0x4cca('0x4b'));if(_0x4add97[_0x4cca('0x4c')]===_0x4cca('0x4a')){var _0x34a952=_0xa9696[_0x4cca('0x24')]({'plain':!![]});var _0xc48343=_0x4cca('0x4d');return db[_0x4cca('0x4e')][_0x4cca('0x47')]({'where':{'name':_0xc48343,'userProfileId':_0x4add97[_0x4cca('0x4f')]},'raw':!![]})['then'](function(_0x5725bf){if(_0x5725bf&&_0x5725bf['autoAssociation']===0x0){return db[_0x4cca('0x25')][_0x4cca('0x48')]({'name':_0x34a952[_0x4cca('0x28')],'resourceId':_0x34a952['id'],'type':_0x5725bf['name'],'sectionId':_0x5725bf['id']},{})[_0x4cca('0x22')](function(){return _0xa9696;});}else{return _0xa9696;}})['catch'](function(_0xf39cf0){logger[_0x4cca('0x26')](_0x4cca('0x50'),_0xf39cf0);throw _0xf39cf0;});}return _0xa9696;})[_0x4cca('0x22')](respondWithResult(_0x1aa588,0xc9))[_0x4cca('0x45')](handleError(_0x1aa588,null));};exports[_0x4cca('0x51')]=function(_0xe3d9d5,_0x2036b3){if(_0xe3d9d5[_0x4cca('0x49')]['id']){delete _0xe3d9d5[_0x4cca('0x49')]['id'];}return db[_0x4cca('0x2c')][_0x4cca('0x47')]({'where':{'id':_0xe3d9d5[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x2036b3,null))[_0x4cca('0x22')](saveUpdates(_0xe3d9d5[_0x4cca('0x49')],null))['then'](respondWithResult(_0x2036b3,null))[_0x4cca('0x45')](handleError(_0x2036b3,null));};exports['destroy']=function(_0x4e1c08,_0x2f4f89){return db[_0x4cca('0x2c')]['find']({'where':{'id':_0x4e1c08[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x2f4f89,null))[_0x4cca('0x22')](removeEntity(_0x2f4f89,null))[_0x4cca('0x45')](handleError(_0x2f4f89,null));};exports[_0x4cca('0x52')]=function(_0xc04cb6,_0x30330c){return db[_0x4cca('0x2c')][_0x4cca('0x52')]()[_0x4cca('0x22')](respondWithResult(_0x30330c,null))['catch'](handleError(_0x30330c,null));};exports[_0x4cca('0x53')]=function(_0x13d267,_0x59b134,_0x4cf0b3){if(_0x13d267[_0x4cca('0x49')]['id']){delete _0x13d267[_0x4cca('0x49')]['id'];}return db[_0x4cca('0x2c')]['find']({'where':{'id':_0x13d267['params']['id']}})['then'](handleEntityNotFound(_0x59b134,null))[_0x4cca('0x22')](function(_0x81b84d){if(_0x81b84d){_0x13d267[_0x4cca('0x49')]['ListId']=_0x81b84d['id'];return db['Disposition'][_0x4cca('0x48')](_0x13d267[_0x4cca('0x49')]);}})[_0x4cca('0x22')](respondWithResult(_0x59b134,null))[_0x4cca('0x45')](handleError(_0x59b134,null));};exports['getDispositions']=function(_0x613fbd,_0x1d7666,_0x41f0d0){var _0x1a39b0={'raw':![],'where':{}};var _0x102af0={};var _0x44c023={'count':0x0,'rows':[]};return db[_0x4cca('0x2c')]['findOne']({'where':{'id':_0x613fbd[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x1d7666,null))[_0x4cca('0x22')](function(_0x1d9f08){if(_0x1d9f08){_0x102af0[_0x4cca('0x31')]=_[_0x4cca('0x33')](db[_0x4cca('0x54')][_0x4cca('0x2d')]);_0x102af0[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x613fbd[_0x4cca('0x32')]);_0x102af0[_0x4cca('0x34')]=_[_0x4cca('0x35')](_0x102af0[_0x4cca('0x31')],_0x102af0[_0x4cca('0x32')]);_0x1a39b0[_0x4cca('0x36')]=_[_0x4cca('0x35')](_0x102af0['model'],qs[_0x4cca('0x37')](_0x613fbd[_0x4cca('0x32')]['fields']));_0x1a39b0[_0x4cca('0x36')]=_0x1a39b0['attributes'][_0x4cca('0x38')]?_0x1a39b0[_0x4cca('0x36')]:_0x102af0[_0x4cca('0x31')];if(!_0x613fbd[_0x4cca('0x32')]['hasOwnProperty'](_0x4cca('0x3a'))){_0x1a39b0['limit']=qs[_0x4cca('0x3b')](_0x613fbd[_0x4cca('0x32')][_0x4cca('0x3b')]);_0x1a39b0['offset']=qs[_0x4cca('0x1d')](_0x613fbd[_0x4cca('0x32')][_0x4cca('0x1d')]);}_0x1a39b0['order']=qs[_0x4cca('0x3c')](_0x613fbd[_0x4cca('0x32')][_0x4cca('0x3c')]);_0x1a39b0[_0x4cca('0x3d')]=qs[_0x4cca('0x34')](_[_0x4cca('0x3e')](_0x613fbd[_0x4cca('0x32')],_0x102af0[_0x4cca('0x34')]));_0x1a39b0[_0x4cca('0x3d')][_0x4cca('0x55')]=_0x1d9f08['id'];if(_0x613fbd[_0x4cca('0x32')][_0x4cca('0x3f')]){_0x1a39b0['where']=_[_0x4cca('0x40')](_0x1a39b0[_0x4cca('0x3d')],{'$or':_[_0x4cca('0x2b')](_0x1a39b0[_0x4cca('0x36')],function(_0x1ddeee){var _0x50a777={};_0x50a777[_0x1ddeee]={'$like':'%'+_0x613fbd[_0x4cca('0x32')]['filter']+'%'};return _0x50a777;})});}_0x1a39b0=_[_0x4cca('0x40')]({},_0x1a39b0,_0x613fbd[_0x4cca('0x42')]);return db[_0x4cca('0x54')][_0x4cca('0x56')]({'where':_0x1a39b0[_0x4cca('0x3d')]})['then'](function(_0x23a259){_0x44c023[_0x4cca('0x56')]=_0x23a259;if(_0x613fbd[_0x4cca('0x32')][_0x4cca('0x43')]){_0x1a39b0['include']=[{'all':!![]}];}return db[_0x4cca('0x54')][_0x4cca('0x57')](_0x1a39b0);})[_0x4cca('0x22')](function(_0x5aaad1){_0x44c023[_0x4cca('0x58')]=_0x5aaad1;return _0x44c023;});}})[_0x4cca('0x22')](respondWithFilteredResult(_0x1d7666,_0x1a39b0))['catch'](handleError(_0x1d7666,null));};exports[_0x4cca('0x59')]=function(_0x478535,_0x3fee4a,_0x591ed6){return db[_0x4cca('0x2c')][_0x4cca('0x47')]({'where':{'id':_0x478535[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x3fee4a,null))[_0x4cca('0x22')](function(_0x4fd179){if(_0x4fd179){return _0x4fd179[_0x4cca('0x59')](_0x478535[_0x4cca('0x32')]['ids']);}})[_0x4cca('0x22')](respondWithStatusCode(_0x3fee4a,null))[_0x4cca('0x45')](handleError(_0x3fee4a,null));};exports['addContacts']=function(_0x12f792,_0x4afa0c,_0x441660){return db['CmList'][_0x4cca('0x47')]({'where':{'id':_0x12f792[_0x4cca('0x46')]['id']}})['then'](handleEntityNotFound(_0x4afa0c,null))[_0x4cca('0x22')](function(_0x19df99){if(_0x19df99){var _0x123536=[];var _0x34b755={'success':[],'errors':[]};return db['CmContact'][_0x4cca('0x52')]()[_0x4cca('0x22')](function(_0x46bf24){if(_0x12f792[_0x4cca('0x49')]['tags']&&_[_0x4cca('0x5a')](_0x12f792[_0x4cca('0x49')][_0x4cca('0x5b')])){if(_0x12f792['body'][_0x4cca('0x5b')][_0x4cca('0x38')]){_0x12f792[_0x4cca('0x49')][_0x4cca('0x5b')]=_0x12f792[_0x4cca('0x49')][_0x4cca('0x5b')][_0x4cca('0x5c')](';')+';';}else{_0x12f792[_0x4cca('0x49')][_0x4cca('0x5b')]=null;}}else{_0x12f792[_0x4cca('0x49')][_0x4cca('0x5b')]=null;}if(_0x12f792[_0x4cca('0x49')]&&_[_0x4cca('0x5a')](_0x12f792[_0x4cca('0x49')])){for(var _0x23cd54=0x0;_0x23cd54<_0x12f792[_0x4cca('0x49')][_0x4cca('0x38')];_0x23cd54+=0x1){_0x12f792[_0x4cca('0x49')][_0x23cd54][_0x4cca('0x55')]=_0x12f792[_0x4cca('0x46')]['id'];_0x123536[_0x4cca('0x5d')](_0x12f792[_0x4cca('0x49')][_0x23cd54]);}return BPromise[_0x4cca('0x5e')](_0x123536,function(_0x4ad308){return db[_0x4cca('0x5f')]['create'](_['omit'](_0x4ad308,[_0x4cca('0x60'),'id'])||{},{'fields':_[_0x4cca('0x33')](_0x46bf24),'raw':!![]})[_0x4cca('0x22')](function(_0x5c0175){_0x34b755[_0x4cca('0x61')][_0x4cca('0x5d')](_0x5c0175[_0x4cca('0x62')]);})[_0x4cca('0x45')](function(_0x123900){_0x34b755['errors']['push']({'data':_0x4ad308,'error':_0x123900[_0x4cca('0x63')]});});})[_0x4cca('0x22')](function(_0x54265f){return _0x34b755;})['catch'](function(_0x241633){return _0x241633;});}else{_0x4afa0c['status'](0x190)[_0x4cca('0x1c')]({'message':_0x4cca('0x64')});}});}})[_0x4cca('0x22')](respondWithResult(_0x4afa0c,null))[_0x4cca('0x45')](handleError(_0x4afa0c,null));};exports['getContacts']=function(_0x3b23ab,_0x236e4b,_0x173960){var _0x317517;return db['CmList']['find']({'where':{'id':_0x3b23ab[_0x4cca('0x46')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x4cca('0x65')}]})[_0x4cca('0x22')](handleEntityNotFound(_0x236e4b,null))[_0x4cca('0x22')](function(_0x42ef4d){if(_0x42ef4d){_0x317517=_0x42ef4d;return db[_0x4cca('0x5f')][_0x4cca('0x2d')];}})[_0x4cca('0x22')](function(_0x352abf){if(_0x352abf){var _0x1ffdc9={};var _0x4bae1c={};_0x4bae1c[_0x4cca('0x31')]=_[_0x4cca('0x66')](_[_0x4cca('0x33')](_0x352abf),_['map'](_0x317517[_0x4cca('0x65')],function(_0x3368a0){return util[_0x4cca('0x67')](_0x4cca('0x68'),_0x3368a0['id']);}));_0x4bae1c[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x3b23ab[_0x4cca('0x32')]);_0x4bae1c[_0x4cca('0x34')]=_[_0x4cca('0x35')](_0x4bae1c[_0x4cca('0x31')],_0x4bae1c['query']);_0x1ffdc9['attributes']=_[_0x4cca('0x35')](_0x4bae1c[_0x4cca('0x31')],qs[_0x4cca('0x37')](_0x3b23ab[_0x4cca('0x32')][_0x4cca('0x37')]));_0x1ffdc9[_0x4cca('0x36')]=_0x1ffdc9[_0x4cca('0x36')][_0x4cca('0x38')]?_0x1ffdc9[_0x4cca('0x36')]:_0x4bae1c[_0x4cca('0x31')];if(!_0x3b23ab[_0x4cca('0x32')]['hasOwnProperty'](_0x4cca('0x3a'))){_0x1ffdc9[_0x4cca('0x3b')]=qs[_0x4cca('0x3b')](_0x3b23ab[_0x4cca('0x32')]['limit']);_0x1ffdc9['offset']=qs['offset'](_0x3b23ab['query']['offset']);}_0x1ffdc9[_0x4cca('0x69')]=qs[_0x4cca('0x3c')](_0x3b23ab[_0x4cca('0x32')][_0x4cca('0x3c')]);_0x1ffdc9[_0x4cca('0x3d')]=qs[_0x4cca('0x34')](_[_0x4cca('0x3e')](_0x3b23ab['query'],_0x4bae1c[_0x4cca('0x34')]));_0x1ffdc9['raw']=!![];if(_0x3b23ab[_0x4cca('0x32')][_0x4cca('0x3f')]){_0x1ffdc9[_0x4cca('0x3d')]=_['merge'](_0x1ffdc9[_0x4cca('0x3d')],{'$or':_[_0x4cca('0x2b')](_0x1ffdc9[_0x4cca('0x36')],function(_0x21e8a){var _0x123014={};_0x123014[_0x21e8a]={'$like':'%'+_0x3b23ab[_0x4cca('0x32')][_0x4cca('0x3f')]+'%'};return _0x123014;})});}_0x1ffdc9=_[_0x4cca('0x40')]({},_0x1ffdc9,_0x3b23ab[_0x4cca('0x42')]);return _0x317517[_0x4cca('0x6a')](_0x1ffdc9);}})['then'](respondWithResult(_0x236e4b,null))[_0x4cca('0x45')](handleError(_0x236e4b,null));};exports[_0x4cca('0x6b')]=function(_0x6d3bfe,_0x41281a,_0x3d92e9){var _0x491be1;return db[_0x4cca('0x2c')]['find']({'where':{'id':_0x6d3bfe[_0x4cca('0x46')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x4cca('0x22')](handleEntityNotFound(_0x41281a,null))[_0x4cca('0x22')](function(_0x2693b1){if(_0x2693b1){_0x491be1=_0x2693b1;return db[_0x4cca('0x5f')]['rawAttributes'];}})[_0x4cca('0x22')](function(_0xa6dd9b){if(_0xa6dd9b){var _0x7d9035={};var _0x590bbb={};_0x590bbb[_0x4cca('0x31')]=_[_0x4cca('0x66')](_[_0x4cca('0x33')](_0xa6dd9b),_['map'](_0x491be1['CustomFields'],function(_0x56e3bc){return util[_0x4cca('0x67')](_0x4cca('0x68'),_0x56e3bc['id']);}));_0x590bbb[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x6d3bfe['query']);_0x590bbb['filters']=_[_0x4cca('0x35')](_0x590bbb['model'],_0x590bbb[_0x4cca('0x32')]);_0x7d9035['attributes']=_[_0x4cca('0x35')](_0x590bbb['model'],qs[_0x4cca('0x37')](_0x6d3bfe[_0x4cca('0x32')][_0x4cca('0x37')]));_0x7d9035[_0x4cca('0x36')]=_0x7d9035['attributes'][_0x4cca('0x38')]?_0x7d9035[_0x4cca('0x36')]:_0x590bbb[_0x4cca('0x31')];if(!_0x6d3bfe[_0x4cca('0x32')]['hasOwnProperty']('nolimit')){_0x7d9035[_0x4cca('0x3b')]=qs[_0x4cca('0x3b')](_0x6d3bfe[_0x4cca('0x32')]['limit']);_0x7d9035[_0x4cca('0x1d')]=qs[_0x4cca('0x1d')](_0x6d3bfe[_0x4cca('0x32')][_0x4cca('0x1d')]);}_0x7d9035[_0x4cca('0x69')]=qs[_0x4cca('0x3c')](_0x6d3bfe[_0x4cca('0x32')][_0x4cca('0x3c')]);_0x7d9035[_0x4cca('0x3d')]=qs[_0x4cca('0x34')](_[_0x4cca('0x3e')](_0x6d3bfe[_0x4cca('0x32')],_0x590bbb[_0x4cca('0x34')]));_0x7d9035['raw']=!![];if(_0x6d3bfe[_0x4cca('0x32')][_0x4cca('0x3f')]){_0x7d9035['where']=_[_0x4cca('0x40')](_0x7d9035[_0x4cca('0x3d')],{'$or':_['map'](_0x7d9035[_0x4cca('0x36')],function(_0x2c9148){var _0x4f4ec5={};_0x4f4ec5[_0x2c9148]={'$like':'%'+_0x6d3bfe[_0x4cca('0x32')][_0x4cca('0x3f')]+'%'};return _0x4f4ec5;})});}_0x7d9035=_['merge']({},_0x7d9035,_0x6d3bfe[_0x4cca('0x42')]);return _0x491be1[_0x4cca('0x6a')](_0x7d9035);}})['then'](function(_0x4fac77){if(!_[_0x4cca('0x6c')](_0x4fac77)){var _0x2f4ca2=toCsv(_0x4fac77);var _0x5c698b=Date['now']();fs[_0x4cca('0x6d')](util[_0x4cca('0x67')]('/tmp/list_%d_%s.csv',_0x491be1['id'],_0x5c698b),_0x2f4ca2);_0x41281a[_0x4cca('0x6e')](_0x4cca('0x6f'),_0x4cca('0x70')+util['format'](_0x4cca('0x71'),_0x491be1['id'],_0x5c698b));_0x41281a[_0x4cca('0x6e')]('Content-type',_0x4cca('0x72'));return _0x41281a[_0x4cca('0x73')](util['format'](_0x4cca('0x74'),_0x491be1['id'],_0x5c698b));}else{return _0x41281a[_0x4cca('0x19')](0xcc);}})['catch'](handleError(_0x41281a,null));};exports[_0x4cca('0x75')]=function(_0x3e4d23,_0x426540,_0xdfd95f){var _0x404716;delete _0x3e4d23[_0x4cca('0x49')]['id'];return db[_0x4cca('0x2c')]['findOne']({'where':{'id':_0x3e4d23['params']['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x426540,null))['then'](function(_0x5f1661){if(_0x5f1661){return db['sequelize'][_0x4cca('0x76')](function(_0x1988e4){return db[_0x4cca('0x77')][_0x4cca('0x48')](_0x3e4d23['body'],{'transaction':_0x1988e4})[_0x4cca('0x22')](function(_0x4d3b6a){_0x404716=_0x4d3b6a;return _0x5f1661[_0x4cca('0x78')](_0x4d3b6a,{'transaction':_0x1988e4});})['then'](function(){var _0x53738b={'type':db[_0x4cca('0x79')][_0x4cca('0x7a')],'transaction':_0x1988e4};switch(_0x3e4d23['body']['type']){case _0x4cca('0x7b'):_0x53738b[_0x4cca('0x2f')]=db[_0x4cca('0x79')]['TEXT'];break;case _0x4cca('0x7c'):_0x53738b[_0x4cca('0x2f')]=db['Sequelize'][_0x4cca('0x7d')];break;case _0x4cca('0x7e'):_0x53738b[_0x4cca('0x2f')]=db['Sequelize']['BOOLEAN'];_0x53738b[_0x4cca('0x7f')]=![];break;default:}return db[_0x4cca('0x80')][_0x4cca('0x81')][_0x4cca('0x82')](_0x4cca('0x83'),util[_0x4cca('0x67')]('cf_%s',_0x404716['id']),_0x53738b);})['then'](function(){return _0x404716;});});}})[_0x4cca('0x22')](respondWithResult(_0x426540,null))[_0x4cca('0x45')](handleError(_0x426540,null));};exports[_0x4cca('0x84')]=function(_0x4490d0,_0x42b4bd,_0x188f1a){var _0x35fc1f={};var _0x4b11cd={};var _0x3697f7;var _0x2776f8;return db[_0x4cca('0x2c')][_0x4cca('0x85')]({'where':{'id':_0x4490d0[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x42b4bd,null))[_0x4cca('0x22')](function(_0x35a05f){if(_0x35a05f){_0x3697f7=_0x35a05f;_0x4b11cd[_0x4cca('0x31')]=_[_0x4cca('0x33')](db['CmCustomField'][_0x4cca('0x2d')]);_0x4b11cd[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x4490d0[_0x4cca('0x32')]);_0x4b11cd[_0x4cca('0x34')]=_['intersection'](_0x4b11cd[_0x4cca('0x31')],_0x4b11cd['query']);_0x35fc1f[_0x4cca('0x36')]=_[_0x4cca('0x35')](_0x4b11cd[_0x4cca('0x31')],qs['fields'](_0x4490d0['query'][_0x4cca('0x37')]));_0x35fc1f['attributes']=_0x35fc1f[_0x4cca('0x36')][_0x4cca('0x38')]?_0x35fc1f[_0x4cca('0x36')]:_0x4b11cd[_0x4cca('0x31')];_0x35fc1f[_0x4cca('0x69')]=qs[_0x4cca('0x3c')](_0x4490d0[_0x4cca('0x32')][_0x4cca('0x3c')]);_0x35fc1f['where']=qs[_0x4cca('0x34')](_[_0x4cca('0x3e')](_0x4490d0[_0x4cca('0x32')],_0x4b11cd[_0x4cca('0x34')]));_0x35fc1f[_0x4cca('0x3d')]=_['merge'](_0x35fc1f[_0x4cca('0x3d')],{'$or':[{'ListId':_0x35a05f['id']},{'ListId':null}]});if(_0x4490d0['query'][_0x4cca('0x3f')]){_0x35fc1f[_0x4cca('0x3d')]=_['merge'](_0x35fc1f[_0x4cca('0x3d')],{'$or':_[_0x4cca('0x2b')](_0x35fc1f[_0x4cca('0x36')],function(_0x5e221d){var _0x21a6c0={};_0x21a6c0[_0x5e221d]={'$like':'%'+_0x4490d0[_0x4cca('0x32')][_0x4cca('0x3f')]+'%'};return _0x21a6c0;})});}_0x35fc1f=_['merge']({},_0x35fc1f,_0x4490d0[_0x4cca('0x42')]);return db[_0x4cca('0x77')][_0x4cca('0x86')](_0x35fc1f);}})['then'](respondWithResult(_0x42b4bd,null))['catch'](handleError(_0x42b4bd,null));};exports[_0x4cca('0x87')]=function(_0x58d01a,_0x518c86,_0x1082f4){return db[_0x4cca('0x2c')][_0x4cca('0x47')]({'where':{'id':_0x58d01a[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x518c86,null))[_0x4cca('0x22')](function(_0x473f6e){if(_0x473f6e){return _0x473f6e['addAgents'](_0x58d01a['body'][_0x4cca('0x60')],_['omit'](_0x58d01a[_0x4cca('0x49')],[_0x4cca('0x60'),'id'])||{})[_0x4cca('0x88')](function(_0x3e3b96){for(var _0x57c81e=0x0;_0x57c81e<_0x58d01a[_0x4cca('0x49')][_0x4cca('0x60')][_0x4cca('0x38')];_0x57c81e+=0x1){socket[_0x4cca('0x89')](_0x4cca('0x8a'),{'UserId':_0x58d01a[_0x4cca('0x49')][_0x4cca('0x60')][_0x57c81e],'CmListId':_0x58d01a[_0x4cca('0x46')]['id']});}return _0x3e3b96;});}})['then'](respondWithResult(_0x518c86,null))[_0x4cca('0x45')](handleError(_0x518c86,null));};exports['removeAgents']=function(_0x1454d4,_0x40e946,_0x50354e){return db[_0x4cca('0x2c')]['find']({'where':{'id':_0x1454d4['params']['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x40e946,null))['then'](function(_0x587dac){if(_0x587dac){return _0x587dac[_0x4cca('0x8b')](_0x1454d4[_0x4cca('0x32')][_0x4cca('0x60')])['then'](function(){if(_[_0x4cca('0x5a')](_0x1454d4['query'][_0x4cca('0x60')])){for(var _0x4ff6f7=0x0;_0x4ff6f7<_0x1454d4[_0x4cca('0x32')]['ids'][_0x4cca('0x38')];_0x4ff6f7+=0x1){socket[_0x4cca('0x89')](_0x4cca('0x8c'),{'UserId':Number(_0x1454d4[_0x4cca('0x32')]['ids'][_0x4ff6f7]),'CmListId':Number(_0x1454d4['params']['id'])});}}else{socket[_0x4cca('0x89')](_0x4cca('0x8c'),{'UserId':Number(_0x1454d4[_0x4cca('0x32')][_0x4cca('0x60')]),'CmListId':Number(_0x1454d4[_0x4cca('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x40e946,null))[_0x4cca('0x45')](handleError(_0x40e946,null));};exports[_0x4cca('0x8d')]=function(_0x1679d6,_0x5b3714,_0x15177c){var _0x1fdf00={};var _0x39124c={};var _0x185297;var _0xd4793b;return db['CmList'][_0x4cca('0x85')]({'where':{'id':_0x1679d6[_0x4cca('0x46')]['id']}})[_0x4cca('0x22')](handleEntityNotFound(_0x5b3714,null))[_0x4cca('0x22')](function(_0x2a465e){if(_0x2a465e){_0x185297=_0x2a465e;_0x39124c[_0x4cca('0x31')]=_[_0x4cca('0x33')](db[_0x4cca('0x8e')]['rawAttributes']);_0x39124c[_0x4cca('0x32')]=_[_0x4cca('0x33')](_0x1679d6['query']);_0x39124c[_0x4cca('0x34')]=_['intersection'](_0x39124c[_0x4cca('0x31')],_0x39124c[_0x4cca('0x32')]);_0x1fdf00['attributes']=_[_0x4cca('0x35')](_0x39124c[_0x4cca('0x31')],qs[_0x4cca('0x37')](_0x1679d6['query'][_0x4cca('0x37')]));_0x1fdf00[_0x4cca('0x36')]=_0x1fdf00[_0x4cca('0x36')][_0x4cca('0x38')]?_0x1fdf00[_0x4cca('0x36')]:_0x39124c['model'];_0x1fdf00['order']=qs[_0x4cca('0x3c')](_0x1679d6['query'][_0x4cca('0x3c')]);_0x1fdf00[_0x4cca('0x3d')]=qs['filters'](_[_0x4cca('0x3e')](_0x1679d6[_0x4cca('0x32')],_0x39124c[_0x4cca('0x34')]));if(_0x1679d6[_0x4cca('0x32')]['filter']){_0x1fdf00[_0x4cca('0x3d')]=_[_0x4cca('0x40')](_0x1fdf00[_0x4cca('0x3d')],{'$or':_[_0x4cca('0x2b')](_0x1fdf00['attributes'],function(_0x2c1903){var _0x5c64a7={};_0x5c64a7[_0x2c1903]={'$like':'%'+_0x1679d6[_0x4cca('0x32')][_0x4cca('0x3f')]+'%'};return _0x5c64a7;})});}_0x1fdf00=_[_0x4cca('0x40')]({},_0x1fdf00,_0x1679d6[_0x4cca('0x42')]);return _0x185297[_0x4cca('0x8d')](_0x1fdf00);}})[_0x4cca('0x22')](function(_0x5e5d09){if(_0x5e5d09){_0xd4793b=_0x5e5d09[_0x4cca('0x38')];if(!_0x1679d6[_0x4cca('0x32')][_0x4cca('0x39')](_0x4cca('0x3a'))){_0x1fdf00[_0x4cca('0x3b')]=qs[_0x4cca('0x3b')](_0x1679d6['query']['limit']);_0x1fdf00[_0x4cca('0x1d')]=qs[_0x4cca('0x1d')](_0x1679d6[_0x4cca('0x32')][_0x4cca('0x1d')]);}return _0x185297[_0x4cca('0x8d')](_0x1fdf00);}})[_0x4cca('0x22')](function(_0x1b160e){if(_0x1b160e){return _0x1b160e?{'count':_0xd4793b,'rows':_0x1b160e}:null;}})['then'](respondWithResult(_0x5b3714,null))['catch'](handleError(_0x5b3714,null));}; \ No newline at end of file +var _0x5a3f=['moment','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','then','destroy','get','Lists','error','stack','name','send','CmList','fieldName','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','catch','params','rawAttributes','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','findOne','length','pick','removeDispositions','ids','CmContact','tags','isArray','join','each','omit','success','errors','push','message','CmCustomField','CustomFields','concat','cf_%d','raw','getContacts','getContactsCsv','isEmpty','now','writeFileSync','format','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','text/csv','download','sequelize','transaction','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','removeAgents','userCmList:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x32997b,_0x314a66){var _0x55995a=function(_0x41665c){while(--_0x41665c){_0x32997b['push'](_0x32997b['shift']());}};_0x55995a(++_0x314a66);}(_0x5a3f,0x117));var _0xf5a3=function(_0x58b299,_0x27b68c){_0x58b299=_0x58b299-0x0;var _0x25752e=_0x5a3f[_0x58b299];return _0x25752e;};'use strict';var pdf=require(_0xf5a3('0x0'));var emlformat=require(_0xf5a3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf5a3('0x2'));var jsonpatch=require(_0xf5a3('0x3'));var rp=require(_0xf5a3('0x4'));var moment=require(_0xf5a3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf5a3('0x6'));var util=require('util');var path=require(_0xf5a3('0x7'));var sox=require('sox');var csv=require(_0xf5a3('0x8'));var ejs=require(_0xf5a3('0x9'));var fs=require('fs');var _=require(_0xf5a3('0xa'));var squel=require(_0xf5a3('0xb'));var crypto=require('crypto');var jsforce=require(_0xf5a3('0xc'));var deskjs=require(_0xf5a3('0xd'));var toCsv=require(_0xf5a3('0x8'));var querystring=require(_0xf5a3('0xe'));var Papa=require(_0xf5a3('0xf'));var Redis=require(_0xf5a3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf5a3('0x11'));var as=require(_0xf5a3('0x12'));var hardwareService=require(_0xf5a3('0x13'));var logger=require(_0xf5a3('0x14'))(_0xf5a3('0x15'));var utils=require(_0xf5a3('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5a3('0x17')]=_[_0xf5a3('0x18')](config[_0xf5a3('0x17')],{'host':_0xf5a3('0x19'),'port':0x18eb});var socket=require(_0xf5a3('0x1a'))(new Redis(config[_0xf5a3('0x17')]));require(_0xf5a3('0x1b'))[_0xf5a3('0x1c')](socket);function respondWithStatusCode(_0x4fd38c,_0x2e838e){_0x2e838e=_0x2e838e||0xcc;return function(_0xdc4163){if(_0xdc4163){return _0x4fd38c[_0xf5a3('0x1d')](_0x2e838e);}return _0x4fd38c[_0xf5a3('0x1e')](_0x2e838e)[_0xf5a3('0x1f')]();};}function respondWithResult(_0x494008,_0x2150f4){_0x2150f4=_0x2150f4||0xc8;return function(_0x55186c){if(_0x55186c){return _0x494008[_0xf5a3('0x1e')](_0x2150f4)['json'](_0x55186c);}};}function respondWithFilteredResult(_0x5824b1,_0x282d0e){return function(_0x75bb60){if(_0x75bb60){var _0x5260fd=_0x75bb60[_0xf5a3('0x20')],_0x24cbc3=_0x282d0e[_0xf5a3('0x21')],_0x9f25e2=_0x282d0e[_0xf5a3('0x21')]+_0x282d0e[_0xf5a3('0x22')],_0x3a0eb5;if(_0x9f25e2>=_0x5260fd){_0x9f25e2=_0x5260fd;_0x3a0eb5=0xc8;}else{_0x3a0eb5=0xce;}_0x5824b1[_0xf5a3('0x1e')](_0x3a0eb5);return _0x5824b1[_0xf5a3('0x23')](_0xf5a3('0x24'),_0x24cbc3+'-'+_0x9f25e2+'/'+_0x5260fd)[_0xf5a3('0x25')](_0x75bb60);}return null;};}function patchUpdates(_0x356258){return function(_0x4df083){try{jsonpatch['apply'](_0x4df083,_0x356258,!![]);}catch(_0x1cade0){return BPromise['reject'](_0x1cade0);}return _0x4df083[_0xf5a3('0x26')]();};}function saveUpdates(_0x250452,_0x378504){return function(_0x11a330){if(_0x11a330){return _0x11a330[_0xf5a3('0x27')](_0x250452)[_0xf5a3('0x28')](function(_0x434ec8){return _0x434ec8;});}return null;};}function removeEntity(_0x2ef6f1,_0x4ad4b7){return function(_0x1bd9aa){if(_0x1bd9aa){return _0x1bd9aa[_0xf5a3('0x29')]()[_0xf5a3('0x28')](function(){var _0x575472=_0x1bd9aa[_0xf5a3('0x2a')]({'plain':!![]});var _0x3f32ca=_0xf5a3('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3f32ca,'resourceId':_0x575472['id']}})[_0xf5a3('0x28')](function(){return _0x1bd9aa;});})[_0xf5a3('0x28')](function(){_0x2ef6f1[_0xf5a3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c85c2,_0x654dcc){return function(_0x1dc5c7){if(!_0x1dc5c7){_0x3c85c2[_0xf5a3('0x1d')](0x194);}return _0x1dc5c7;};}function handleError(_0x5988b9,_0x1b9816){_0x1b9816=_0x1b9816||0x1f4;return function(_0x453856){logger[_0xf5a3('0x2c')](_0x453856[_0xf5a3('0x2d')]);if(_0x453856[_0xf5a3('0x2e')]){delete _0x453856['name'];}_0x5988b9[_0xf5a3('0x1e')](_0x1b9816)[_0xf5a3('0x2f')](_0x453856);};}exports['index']=function(_0x39e9e2,_0x5bb63e){var _0x5ab64e={},_0x1edf88={},_0x340904={'count':0x0,'rows':[]};var _0x1315dc=_['map'](db[_0xf5a3('0x30')]['rawAttributes'],function(_0x3d1a82){return{'name':_0x3d1a82[_0xf5a3('0x31')],'type':_0x3d1a82['type'][_0xf5a3('0x32')]};});_0x1edf88[_0xf5a3('0x33')]=_[_0xf5a3('0x34')](_0x1315dc,'name');_0x1edf88[_0xf5a3('0x35')]=_['keys'](_0x39e9e2['query']);_0x1edf88['filters']=_[_0xf5a3('0x36')](_0x1edf88[_0xf5a3('0x33')],_0x1edf88[_0xf5a3('0x35')]);_0x5ab64e[_0xf5a3('0x37')]=_[_0xf5a3('0x36')](_0x1edf88[_0xf5a3('0x33')],qs[_0xf5a3('0x38')](_0x39e9e2[_0xf5a3('0x35')][_0xf5a3('0x38')]));_0x5ab64e[_0xf5a3('0x37')]=_0x5ab64e[_0xf5a3('0x37')]['length']?_0x5ab64e['attributes']:_0x1edf88[_0xf5a3('0x33')];if(!_0x39e9e2['query'][_0xf5a3('0x39')](_0xf5a3('0x3a'))){_0x5ab64e[_0xf5a3('0x22')]=qs[_0xf5a3('0x22')](_0x39e9e2[_0xf5a3('0x35')][_0xf5a3('0x22')]);_0x5ab64e[_0xf5a3('0x21')]=qs[_0xf5a3('0x21')](_0x39e9e2['query'][_0xf5a3('0x21')]);}_0x5ab64e[_0xf5a3('0x3b')]=qs[_0xf5a3('0x3c')](_0x39e9e2['query'][_0xf5a3('0x3c')]);_0x5ab64e['where']=qs['filters'](_['pick'](_0x39e9e2[_0xf5a3('0x35')],_0x1edf88[_0xf5a3('0x3d')]),_0x1315dc);if(_0x39e9e2['query'][_0xf5a3('0x3e')]){_0x5ab64e['where']=_[_0xf5a3('0x3f')](_0x5ab64e['where'],{'$or':_[_0xf5a3('0x34')](_0x1315dc,function(_0x2d9887){if(_0x2d9887['type']!==_0xf5a3('0x40')){var _0x7cc353={};_0x7cc353[_0x2d9887[_0xf5a3('0x2e')]]={'$like':'%'+_0x39e9e2[_0xf5a3('0x35')][_0xf5a3('0x3e')]+'%'};return _0x7cc353;}})});}_0x5ab64e=_['merge']({},_0x5ab64e,_0x39e9e2[_0xf5a3('0x41')]);var _0x3215f8={'where':_0x5ab64e[_0xf5a3('0x42')]};return db[_0xf5a3('0x30')][_0xf5a3('0x20')](_0x3215f8)[_0xf5a3('0x28')](function(_0x3c44ad){_0x340904[_0xf5a3('0x20')]=_0x3c44ad;if(_0x39e9e2[_0xf5a3('0x35')][_0xf5a3('0x43')]){_0x5ab64e[_0xf5a3('0x44')]=[{'all':!![]}];}return db[_0xf5a3('0x30')][_0xf5a3('0x45')](_0x5ab64e);})[_0xf5a3('0x28')](function(_0x44798d){_0x340904[_0xf5a3('0x46')]=_0x44798d;return _0x340904;})[_0xf5a3('0x28')](respondWithFilteredResult(_0x5bb63e,_0x5ab64e))[_0xf5a3('0x47')](handleError(_0x5bb63e,null));};exports['show']=function(_0x471cba,_0xe4319a){var _0x310ed5={'raw':![],'where':{'id':_0x471cba[_0xf5a3('0x48')]['id']}},_0x20af74={};_0x20af74['model']=_['keys'](db[_0xf5a3('0x30')][_0xf5a3('0x49')]);_0x20af74[_0xf5a3('0x35')]=_[_0xf5a3('0x4a')](_0x471cba['query']);_0x20af74['filters']=_['intersection'](_0x20af74['model'],_0x20af74[_0xf5a3('0x35')]);_0x310ed5[_0xf5a3('0x37')]=_[_0xf5a3('0x36')](_0x20af74['model'],qs[_0xf5a3('0x38')](_0x471cba[_0xf5a3('0x35')][_0xf5a3('0x38')]));_0x310ed5['attributes']=_0x310ed5[_0xf5a3('0x37')]['length']?_0x310ed5[_0xf5a3('0x37')]:_0x20af74[_0xf5a3('0x33')];if(_0x471cba['query'][_0xf5a3('0x43')]){_0x310ed5[_0xf5a3('0x44')]=[{'all':!![]}];}_0x310ed5=_[_0xf5a3('0x3f')]({},_0x310ed5,_0x471cba[_0xf5a3('0x41')]);return db[_0xf5a3('0x30')][_0xf5a3('0x4b')](_0x310ed5)['then'](handleEntityNotFound(_0xe4319a,null))[_0xf5a3('0x28')](respondWithResult(_0xe4319a,null))[_0xf5a3('0x47')](handleError(_0xe4319a,null));};exports['create']=function(_0x35e2b3,_0x2c5f9f){return db['CmList'][_0xf5a3('0x4c')](_0x35e2b3['body'],{})[_0xf5a3('0x28')](function(_0x37c5cc){var _0x30c73f=_0x35e2b3['user']['get']({'plain':!![]});if(!_0x30c73f)throw new Error(_0xf5a3('0x4d'));if(_0x30c73f[_0xf5a3('0x4e')]==='user'){var _0x2b1bc9=_0x37c5cc['get']({'plain':!![]});var _0xd6c83c=_0xf5a3('0x2b');return db[_0xf5a3('0x4f')]['find']({'where':{'name':_0xd6c83c,'userProfileId':_0x30c73f['userProfileId']},'raw':!![]})[_0xf5a3('0x28')](function(_0x130a5c){if(_0x130a5c&&_0x130a5c['autoAssociation']===0x0){return db[_0xf5a3('0x50')][_0xf5a3('0x4c')]({'name':_0x2b1bc9[_0xf5a3('0x2e')],'resourceId':_0x2b1bc9['id'],'type':_0x130a5c[_0xf5a3('0x2e')],'sectionId':_0x130a5c['id']},{})[_0xf5a3('0x28')](function(){return _0x37c5cc;});}else{return _0x37c5cc;}})[_0xf5a3('0x47')](function(_0x5a6ee0){logger['error'](_0xf5a3('0x51'),_0x5a6ee0);throw _0x5a6ee0;});}return _0x37c5cc;})[_0xf5a3('0x28')](respondWithResult(_0x2c5f9f,0xc9))[_0xf5a3('0x47')](handleError(_0x2c5f9f,null));};exports['update']=function(_0x5c60c4,_0x1e851c){if(_0x5c60c4[_0xf5a3('0x52')]['id']){delete _0x5c60c4['body']['id'];}return db[_0xf5a3('0x30')][_0xf5a3('0x4b')]({'where':{'id':_0x5c60c4[_0xf5a3('0x48')]['id']}})[_0xf5a3('0x28')](handleEntityNotFound(_0x1e851c,null))['then'](saveUpdates(_0x5c60c4[_0xf5a3('0x52')],null))['then'](respondWithResult(_0x1e851c,null))['catch'](handleError(_0x1e851c,null));};exports['destroy']=function(_0x50b5c9,_0x7712d0){return db[_0xf5a3('0x30')]['find']({'where':{'id':_0x50b5c9[_0xf5a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x7712d0,null))['then'](removeEntity(_0x7712d0,null))['catch'](handleError(_0x7712d0,null));};exports[_0xf5a3('0x53')]=function(_0x5946f5,_0x3d6974){return db['CmList'][_0xf5a3('0x53')]()[_0xf5a3('0x28')](respondWithResult(_0x3d6974,null))[_0xf5a3('0x47')](handleError(_0x3d6974,null));};exports[_0xf5a3('0x54')]=function(_0x382a30,_0x35b056,_0x1f84f6){if(_0x382a30[_0xf5a3('0x52')]['id']){delete _0x382a30[_0xf5a3('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x382a30[_0xf5a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x35b056,null))[_0xf5a3('0x28')](function(_0x10e6f7){if(_0x10e6f7){_0x382a30[_0xf5a3('0x52')][_0xf5a3('0x55')]=_0x10e6f7['id'];return db[_0xf5a3('0x56')]['create'](_0x382a30[_0xf5a3('0x52')]);}})[_0xf5a3('0x28')](respondWithResult(_0x35b056,null))[_0xf5a3('0x47')](handleError(_0x35b056,null));};exports['getDispositions']=function(_0x3948ce,_0x2c4bca,_0x2a7432){var _0x2f4ebd={'raw':![],'where':{}};var _0x5c0c52={};var _0x152569={'count':0x0,'rows':[]};return db[_0xf5a3('0x30')][_0xf5a3('0x57')]({'where':{'id':_0x3948ce[_0xf5a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c4bca,null))[_0xf5a3('0x28')](function(_0x45d44d){if(_0x45d44d){_0x5c0c52[_0xf5a3('0x33')]=_[_0xf5a3('0x4a')](db[_0xf5a3('0x56')][_0xf5a3('0x49')]);_0x5c0c52[_0xf5a3('0x35')]=_[_0xf5a3('0x4a')](_0x3948ce[_0xf5a3('0x35')]);_0x5c0c52[_0xf5a3('0x3d')]=_['intersection'](_0x5c0c52[_0xf5a3('0x33')],_0x5c0c52[_0xf5a3('0x35')]);_0x2f4ebd[_0xf5a3('0x37')]=_[_0xf5a3('0x36')](_0x5c0c52[_0xf5a3('0x33')],qs['fields'](_0x3948ce[_0xf5a3('0x35')][_0xf5a3('0x38')]));_0x2f4ebd[_0xf5a3('0x37')]=_0x2f4ebd[_0xf5a3('0x37')][_0xf5a3('0x58')]?_0x2f4ebd[_0xf5a3('0x37')]:_0x5c0c52[_0xf5a3('0x33')];if(!_0x3948ce[_0xf5a3('0x35')][_0xf5a3('0x39')]('nolimit')){_0x2f4ebd[_0xf5a3('0x22')]=qs[_0xf5a3('0x22')](_0x3948ce[_0xf5a3('0x35')]['limit']);_0x2f4ebd[_0xf5a3('0x21')]=qs[_0xf5a3('0x21')](_0x3948ce['query']['offset']);}_0x2f4ebd[_0xf5a3('0x3b')]=qs['sort'](_0x3948ce['query'][_0xf5a3('0x3c')]);_0x2f4ebd['where']=qs['filters'](_[_0xf5a3('0x59')](_0x3948ce[_0xf5a3('0x35')],_0x5c0c52[_0xf5a3('0x3d')]));_0x2f4ebd[_0xf5a3('0x42')]['ListId']=_0x45d44d['id'];if(_0x3948ce[_0xf5a3('0x35')][_0xf5a3('0x3e')]){_0x2f4ebd[_0xf5a3('0x42')]=_[_0xf5a3('0x3f')](_0x2f4ebd['where'],{'$or':_[_0xf5a3('0x34')](_0x2f4ebd['attributes'],function(_0x4f1d03){var _0x43b715={};_0x43b715[_0x4f1d03]={'$like':'%'+_0x3948ce[_0xf5a3('0x35')][_0xf5a3('0x3e')]+'%'};return _0x43b715;})});}_0x2f4ebd=_[_0xf5a3('0x3f')]({},_0x2f4ebd,_0x3948ce['options']);return db['Disposition']['count']({'where':_0x2f4ebd[_0xf5a3('0x42')]})[_0xf5a3('0x28')](function(_0x4a288c){_0x152569['count']=_0x4a288c;if(_0x3948ce[_0xf5a3('0x35')]['includeAll']){_0x2f4ebd[_0xf5a3('0x44')]=[{'all':!![]}];}return db[_0xf5a3('0x56')][_0xf5a3('0x45')](_0x2f4ebd);})[_0xf5a3('0x28')](function(_0x3a0d14){_0x152569[_0xf5a3('0x46')]=_0x3a0d14;return _0x152569;});}})['then'](respondWithFilteredResult(_0x2c4bca,_0x2f4ebd))[_0xf5a3('0x47')](handleError(_0x2c4bca,null));};exports['removeDispositions']=function(_0x35aefb,_0x1cf572,_0x23882e){return db[_0xf5a3('0x30')][_0xf5a3('0x4b')]({'where':{'id':_0x35aefb[_0xf5a3('0x48')]['id']}})[_0xf5a3('0x28')](handleEntityNotFound(_0x1cf572,null))[_0xf5a3('0x28')](function(_0x29291f){if(_0x29291f){return _0x29291f[_0xf5a3('0x5a')](_0x35aefb[_0xf5a3('0x35')][_0xf5a3('0x5b')]);}})[_0xf5a3('0x28')](respondWithStatusCode(_0x1cf572,null))['catch'](handleError(_0x1cf572,null));};exports['addContacts']=function(_0x3f6583,_0x15406c,_0x4f573c){return db[_0xf5a3('0x30')][_0xf5a3('0x4b')]({'where':{'id':_0x3f6583['params']['id']}})['then'](handleEntityNotFound(_0x15406c,null))[_0xf5a3('0x28')](function(_0x2a8bf2){if(_0x2a8bf2){var _0x559c9f=[];var _0x7b0519={'success':[],'errors':[]};return db[_0xf5a3('0x5c')][_0xf5a3('0x53')]()[_0xf5a3('0x28')](function(_0x407572){if(_0x3f6583['body'][_0xf5a3('0x5d')]&&_[_0xf5a3('0x5e')](_0x3f6583[_0xf5a3('0x52')][_0xf5a3('0x5d')])){if(_0x3f6583['body'][_0xf5a3('0x5d')]['length']){_0x3f6583['body'][_0xf5a3('0x5d')]=_0x3f6583[_0xf5a3('0x52')][_0xf5a3('0x5d')][_0xf5a3('0x5f')](';')+';';}else{_0x3f6583[_0xf5a3('0x52')]['tags']=null;}}else{_0x3f6583[_0xf5a3('0x52')]['tags']=null;}if(_0x3f6583[_0xf5a3('0x52')]&&_[_0xf5a3('0x5e')](_0x3f6583[_0xf5a3('0x52')])){for(var _0x5b8598=0x0;_0x5b8598<_0x3f6583[_0xf5a3('0x52')]['length'];_0x5b8598+=0x1){_0x3f6583[_0xf5a3('0x52')][_0x5b8598][_0xf5a3('0x55')]=_0x3f6583[_0xf5a3('0x48')]['id'];_0x559c9f['push'](_0x3f6583['body'][_0x5b8598]);}return BPromise[_0xf5a3('0x60')](_0x559c9f,function(_0x28811f){return db[_0xf5a3('0x5c')][_0xf5a3('0x4c')](_[_0xf5a3('0x61')](_0x28811f,[_0xf5a3('0x5b'),'id'])||{},{'fields':_[_0xf5a3('0x4a')](_0x407572),'raw':!![]})[_0xf5a3('0x28')](function(_0x465e94){_0x7b0519[_0xf5a3('0x62')]['push'](_0x465e94['dataValues']);})['catch'](function(_0x3e9ac1){_0x7b0519[_0xf5a3('0x63')][_0xf5a3('0x64')]({'data':_0x28811f,'error':_0x3e9ac1[_0xf5a3('0x65')]});});})[_0xf5a3('0x28')](function(_0x258839){return _0x7b0519;})['catch'](function(_0x8a3f23){return _0x8a3f23;});}else{_0x15406c[_0xf5a3('0x1e')](0x190)[_0xf5a3('0x25')]({'message':'Malformed\x20request\x20syntax'});}});}})['then'](respondWithResult(_0x15406c,null))[_0xf5a3('0x47')](handleError(_0x15406c,null));};exports['getContacts']=function(_0x1d47d5,_0x3c8b5f,_0x3d3f9f){var _0x3b51df;return db[_0xf5a3('0x30')][_0xf5a3('0x4b')]({'where':{'id':_0x1d47d5['params']['id']},'include':[{'model':db[_0xf5a3('0x66')],'as':_0xf5a3('0x67')}]})[_0xf5a3('0x28')](handleEntityNotFound(_0x3c8b5f,null))['then'](function(_0x569145){if(_0x569145){_0x3b51df=_0x569145;return db[_0xf5a3('0x5c')][_0xf5a3('0x49')];}})['then'](function(_0x4b22d6){if(_0x4b22d6){var _0x2c121a={};var _0x4f661d={};_0x4f661d['model']=_[_0xf5a3('0x68')](_['keys'](_0x4b22d6),_[_0xf5a3('0x34')](_0x3b51df[_0xf5a3('0x67')],function(_0x10dabe){return util['format'](_0xf5a3('0x69'),_0x10dabe['id']);}));_0x4f661d[_0xf5a3('0x35')]=_[_0xf5a3('0x4a')](_0x1d47d5[_0xf5a3('0x35')]);_0x4f661d[_0xf5a3('0x3d')]=_[_0xf5a3('0x36')](_0x4f661d['model'],_0x4f661d[_0xf5a3('0x35')]);_0x2c121a[_0xf5a3('0x37')]=_['intersection'](_0x4f661d[_0xf5a3('0x33')],qs[_0xf5a3('0x38')](_0x1d47d5[_0xf5a3('0x35')][_0xf5a3('0x38')]));_0x2c121a[_0xf5a3('0x37')]=_0x2c121a[_0xf5a3('0x37')][_0xf5a3('0x58')]?_0x2c121a['attributes']:_0x4f661d[_0xf5a3('0x33')];if(!_0x1d47d5[_0xf5a3('0x35')][_0xf5a3('0x39')](_0xf5a3('0x3a'))){_0x2c121a[_0xf5a3('0x22')]=qs[_0xf5a3('0x22')](_0x1d47d5[_0xf5a3('0x35')][_0xf5a3('0x22')]);_0x2c121a['offset']=qs[_0xf5a3('0x21')](_0x1d47d5['query'][_0xf5a3('0x21')]);}_0x2c121a['order']=qs[_0xf5a3('0x3c')](_0x1d47d5[_0xf5a3('0x35')][_0xf5a3('0x3c')]);_0x2c121a[_0xf5a3('0x42')]=qs[_0xf5a3('0x3d')](_[_0xf5a3('0x59')](_0x1d47d5[_0xf5a3('0x35')],_0x4f661d['filters']));_0x2c121a[_0xf5a3('0x6a')]=!![];if(_0x1d47d5[_0xf5a3('0x35')][_0xf5a3('0x3e')]){_0x2c121a[_0xf5a3('0x42')]=_['merge'](_0x2c121a[_0xf5a3('0x42')],{'$or':_[_0xf5a3('0x34')](_0x2c121a[_0xf5a3('0x37')],function(_0x5f6d64){var _0x149798={};_0x149798[_0x5f6d64]={'$like':'%'+_0x1d47d5[_0xf5a3('0x35')][_0xf5a3('0x3e')]+'%'};return _0x149798;})});}_0x2c121a=_[_0xf5a3('0x3f')]({},_0x2c121a,_0x1d47d5[_0xf5a3('0x41')]);return _0x3b51df[_0xf5a3('0x6b')](_0x2c121a);}})['then'](respondWithResult(_0x3c8b5f,null))['catch'](handleError(_0x3c8b5f,null));};exports[_0xf5a3('0x6c')]=function(_0x3fba6b,_0x5ba488,_0x2347cd){var _0x53a9ed;return db[_0xf5a3('0x30')][_0xf5a3('0x4b')]({'where':{'id':_0x3fba6b['params']['id']},'include':[{'model':db[_0xf5a3('0x66')],'as':_0xf5a3('0x67')}]})[_0xf5a3('0x28')](handleEntityNotFound(_0x5ba488,null))[_0xf5a3('0x28')](function(_0x5b429d){if(_0x5b429d){_0x53a9ed=_0x5b429d;return db[_0xf5a3('0x5c')][_0xf5a3('0x49')];}})[_0xf5a3('0x28')](function(_0x407007){if(_0x407007){var _0x3236ec={};var _0x4ab18d={};_0x4ab18d['model']=_[_0xf5a3('0x68')](_[_0xf5a3('0x4a')](_0x407007),_[_0xf5a3('0x34')](_0x53a9ed[_0xf5a3('0x67')],function(_0x437111){return util['format'](_0xf5a3('0x69'),_0x437111['id']);}));_0x4ab18d['query']=_[_0xf5a3('0x4a')](_0x3fba6b[_0xf5a3('0x35')]);_0x4ab18d[_0xf5a3('0x3d')]=_[_0xf5a3('0x36')](_0x4ab18d[_0xf5a3('0x33')],_0x4ab18d[_0xf5a3('0x35')]);_0x3236ec[_0xf5a3('0x37')]=_[_0xf5a3('0x36')](_0x4ab18d[_0xf5a3('0x33')],qs[_0xf5a3('0x38')](_0x3fba6b['query']['fields']));_0x3236ec[_0xf5a3('0x37')]=_0x3236ec[_0xf5a3('0x37')][_0xf5a3('0x58')]?_0x3236ec[_0xf5a3('0x37')]:_0x4ab18d['model'];if(!_0x3fba6b[_0xf5a3('0x35')][_0xf5a3('0x39')](_0xf5a3('0x3a'))){_0x3236ec[_0xf5a3('0x22')]=qs['limit'](_0x3fba6b[_0xf5a3('0x35')][_0xf5a3('0x22')]);_0x3236ec['offset']=qs[_0xf5a3('0x21')](_0x3fba6b['query']['offset']);}_0x3236ec['order']=qs['sort'](_0x3fba6b[_0xf5a3('0x35')][_0xf5a3('0x3c')]);_0x3236ec['where']=qs[_0xf5a3('0x3d')](_['pick'](_0x3fba6b[_0xf5a3('0x35')],_0x4ab18d[_0xf5a3('0x3d')]));_0x3236ec[_0xf5a3('0x6a')]=!![];if(_0x3fba6b[_0xf5a3('0x35')]['filter']){_0x3236ec[_0xf5a3('0x42')]=_[_0xf5a3('0x3f')](_0x3236ec[_0xf5a3('0x42')],{'$or':_['map'](_0x3236ec['attributes'],function(_0x4de262){var _0x3c910c={};_0x3c910c[_0x4de262]={'$like':'%'+_0x3fba6b[_0xf5a3('0x35')][_0xf5a3('0x3e')]+'%'};return _0x3c910c;})});}_0x3236ec=_[_0xf5a3('0x3f')]({},_0x3236ec,_0x3fba6b[_0xf5a3('0x41')]);return _0x53a9ed[_0xf5a3('0x6b')](_0x3236ec);}})['then'](function(_0x37c2d2){if(!_[_0xf5a3('0x6d')](_0x37c2d2)){var _0x2316d2=toCsv(_0x37c2d2);var _0x947fb4=Date[_0xf5a3('0x6e')]();fs[_0xf5a3('0x6f')](util[_0xf5a3('0x70')](_0xf5a3('0x71'),_0x53a9ed['id'],_0x947fb4),_0x2316d2);_0x5ba488['setHeader'](_0xf5a3('0x72'),'attachment;\x20filename='+util[_0xf5a3('0x70')](_0xf5a3('0x73'),_0x53a9ed['id'],_0x947fb4));_0x5ba488[_0xf5a3('0x74')]('Content-type',_0xf5a3('0x75'));return _0x5ba488[_0xf5a3('0x76')](util['format'](_0xf5a3('0x71'),_0x53a9ed['id'],_0x947fb4));}else{return _0x5ba488['sendStatus'](0xcc);}})[_0xf5a3('0x47')](handleError(_0x5ba488,null));};exports['addCustomField']=function(_0x4125c5,_0x2d5400,_0x1502c4){var _0x21239d;delete _0x4125c5[_0xf5a3('0x52')]['id'];return db[_0xf5a3('0x30')][_0xf5a3('0x57')]({'where':{'id':_0x4125c5[_0xf5a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x2d5400,null))[_0xf5a3('0x28')](function(_0x6dcc9){if(_0x6dcc9){return db[_0xf5a3('0x77')][_0xf5a3('0x78')](function(_0x50d164){return db[_0xf5a3('0x66')]['create'](_0x4125c5[_0xf5a3('0x52')],{'transaction':_0x50d164})[_0xf5a3('0x28')](function(_0x12881e){_0x21239d=_0x12881e;return _0x6dcc9[_0xf5a3('0x79')](_0x12881e,{'transaction':_0x50d164});})[_0xf5a3('0x28')](function(){var _0x43f341={'type':db[_0xf5a3('0x7a')][_0xf5a3('0x7b')],'transaction':_0x50d164};switch(_0x4125c5[_0xf5a3('0x52')][_0xf5a3('0x7c')]){case _0xf5a3('0x7d'):_0x43f341[_0xf5a3('0x7c')]=db[_0xf5a3('0x7a')][_0xf5a3('0x7b')];break;case _0xf5a3('0x7e'):_0x43f341[_0xf5a3('0x7c')]=db['Sequelize'][_0xf5a3('0x7f')];break;case _0xf5a3('0x80'):_0x43f341[_0xf5a3('0x7c')]=db['Sequelize'][_0xf5a3('0x81')];_0x43f341[_0xf5a3('0x82')]=![];break;default:}return db[_0xf5a3('0x77')][_0xf5a3('0x83')][_0xf5a3('0x84')]('cm_contacts',util[_0xf5a3('0x70')](_0xf5a3('0x85'),_0x21239d['id']),_0x43f341);})[_0xf5a3('0x28')](function(){return _0x21239d;});});}})[_0xf5a3('0x28')](respondWithResult(_0x2d5400,null))['catch'](handleError(_0x2d5400,null));};exports[_0xf5a3('0x86')]=function(_0x45d7a4,_0x5c4746,_0x2d946c){var _0xd82b={};var _0x17a629={};var _0x16e991;var _0x3dceea;return db['CmList'][_0xf5a3('0x57')]({'where':{'id':_0x45d7a4['params']['id']}})['then'](handleEntityNotFound(_0x5c4746,null))[_0xf5a3('0x28')](function(_0x14202a){if(_0x14202a){_0x16e991=_0x14202a;_0x17a629[_0xf5a3('0x33')]=_[_0xf5a3('0x4a')](db[_0xf5a3('0x66')][_0xf5a3('0x49')]);_0x17a629[_0xf5a3('0x35')]=_[_0xf5a3('0x4a')](_0x45d7a4[_0xf5a3('0x35')]);_0x17a629[_0xf5a3('0x3d')]=_['intersection'](_0x17a629[_0xf5a3('0x33')],_0x17a629['query']);_0xd82b[_0xf5a3('0x37')]=_[_0xf5a3('0x36')](_0x17a629['model'],qs[_0xf5a3('0x38')](_0x45d7a4[_0xf5a3('0x35')]['fields']));_0xd82b['attributes']=_0xd82b[_0xf5a3('0x37')][_0xf5a3('0x58')]?_0xd82b[_0xf5a3('0x37')]:_0x17a629[_0xf5a3('0x33')];_0xd82b[_0xf5a3('0x3b')]=qs[_0xf5a3('0x3c')](_0x45d7a4[_0xf5a3('0x35')][_0xf5a3('0x3c')]);_0xd82b[_0xf5a3('0x42')]=qs[_0xf5a3('0x3d')](_[_0xf5a3('0x59')](_0x45d7a4[_0xf5a3('0x35')],_0x17a629[_0xf5a3('0x3d')]));_0xd82b['where']=_[_0xf5a3('0x3f')](_0xd82b[_0xf5a3('0x42')],{'$or':[{'ListId':_0x14202a['id']},{'ListId':null}]});if(_0x45d7a4[_0xf5a3('0x35')][_0xf5a3('0x3e')]){_0xd82b['where']=_[_0xf5a3('0x3f')](_0xd82b['where'],{'$or':_[_0xf5a3('0x34')](_0xd82b[_0xf5a3('0x37')],function(_0x56dc54){var _0x4fdf16={};_0x4fdf16[_0x56dc54]={'$like':'%'+_0x45d7a4['query'][_0xf5a3('0x3e')]+'%'};return _0x4fdf16;})});}_0xd82b=_[_0xf5a3('0x3f')]({},_0xd82b,_0x45d7a4[_0xf5a3('0x41')]);return db[_0xf5a3('0x66')][_0xf5a3('0x87')](_0xd82b);}})[_0xf5a3('0x28')](respondWithResult(_0x5c4746,null))['catch'](handleError(_0x5c4746,null));};exports[_0xf5a3('0x88')]=function(_0x2109b4,_0x4b0414,_0x1b335f){return db[_0xf5a3('0x30')]['find']({'where':{'id':_0x2109b4[_0xf5a3('0x48')]['id']}})[_0xf5a3('0x28')](handleEntityNotFound(_0x4b0414,null))[_0xf5a3('0x28')](function(_0x36a21b){if(_0x36a21b){return _0x36a21b[_0xf5a3('0x88')](_0x2109b4[_0xf5a3('0x52')][_0xf5a3('0x5b')],_['omit'](_0x2109b4[_0xf5a3('0x52')],['ids','id'])||{})[_0xf5a3('0x89')](function(_0x43cf23){for(var _0x29d7cc=0x0;_0x29d7cc<_0x2109b4[_0xf5a3('0x52')]['ids'][_0xf5a3('0x58')];_0x29d7cc+=0x1){socket[_0xf5a3('0x8a')]('userCmList:save',{'UserId':_0x2109b4[_0xf5a3('0x52')][_0xf5a3('0x5b')][_0x29d7cc],'CmListId':_0x2109b4[_0xf5a3('0x48')]['id']});}return _0x43cf23;});}})[_0xf5a3('0x28')](respondWithResult(_0x4b0414,null))['catch'](handleError(_0x4b0414,null));};exports[_0xf5a3('0x8b')]=function(_0x179c84,_0x18b17b,_0x5334dd){return db[_0xf5a3('0x30')][_0xf5a3('0x4b')]({'where':{'id':_0x179c84['params']['id']}})[_0xf5a3('0x28')](handleEntityNotFound(_0x18b17b,null))['then'](function(_0x3fc403){if(_0x3fc403){return _0x3fc403[_0xf5a3('0x8b')](_0x179c84[_0xf5a3('0x35')][_0xf5a3('0x5b')])[_0xf5a3('0x28')](function(){if(_[_0xf5a3('0x5e')](_0x179c84[_0xf5a3('0x35')][_0xf5a3('0x5b')])){for(var _0x5b7f43=0x0;_0x5b7f43<_0x179c84[_0xf5a3('0x35')][_0xf5a3('0x5b')]['length'];_0x5b7f43+=0x1){socket[_0xf5a3('0x8a')](_0xf5a3('0x8c'),{'UserId':Number(_0x179c84[_0xf5a3('0x35')]['ids'][_0x5b7f43]),'CmListId':Number(_0x179c84[_0xf5a3('0x48')]['id'])});}}else{socket[_0xf5a3('0x8a')](_0xf5a3('0x8c'),{'UserId':Number(_0x179c84[_0xf5a3('0x35')]['ids']),'CmListId':Number(_0x179c84['params']['id'])});}});}})[_0xf5a3('0x28')](respondWithStatusCode(_0x18b17b,null))['catch'](handleError(_0x18b17b,null));};exports[_0xf5a3('0x8d')]=function(_0x4cb0e9,_0x1a36ab,_0x551507){var _0x4d82d1={};var _0x357537={};var _0x46308f;var _0x1d4ec4;return db[_0xf5a3('0x30')][_0xf5a3('0x57')]({'where':{'id':_0x4cb0e9[_0xf5a3('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a36ab,null))['then'](function(_0x95b04c){if(_0x95b04c){_0x46308f=_0x95b04c;_0x357537[_0xf5a3('0x33')]=_[_0xf5a3('0x4a')](db['User'][_0xf5a3('0x49')]);_0x357537[_0xf5a3('0x35')]=_[_0xf5a3('0x4a')](_0x4cb0e9[_0xf5a3('0x35')]);_0x357537['filters']=_['intersection'](_0x357537[_0xf5a3('0x33')],_0x357537[_0xf5a3('0x35')]);_0x4d82d1['attributes']=_['intersection'](_0x357537[_0xf5a3('0x33')],qs[_0xf5a3('0x38')](_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x38')]));_0x4d82d1[_0xf5a3('0x37')]=_0x4d82d1['attributes']['length']?_0x4d82d1[_0xf5a3('0x37')]:_0x357537['model'];_0x4d82d1[_0xf5a3('0x3b')]=qs['sort'](_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x3c')]);_0x4d82d1[_0xf5a3('0x42')]=qs[_0xf5a3('0x3d')](_[_0xf5a3('0x59')](_0x4cb0e9[_0xf5a3('0x35')],_0x357537[_0xf5a3('0x3d')]));if(_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x3e')]){_0x4d82d1['where']=_['merge'](_0x4d82d1[_0xf5a3('0x42')],{'$or':_['map'](_0x4d82d1[_0xf5a3('0x37')],function(_0x116cd){var _0x1349d9={};_0x1349d9[_0x116cd]={'$like':'%'+_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x3e')]+'%'};return _0x1349d9;})});}_0x4d82d1=_[_0xf5a3('0x3f')]({},_0x4d82d1,_0x4cb0e9['options']);return _0x46308f[_0xf5a3('0x8d')](_0x4d82d1);}})[_0xf5a3('0x28')](function(_0x183adf){if(_0x183adf){_0x1d4ec4=_0x183adf[_0xf5a3('0x58')];if(!_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x39')](_0xf5a3('0x3a'))){_0x4d82d1[_0xf5a3('0x22')]=qs[_0xf5a3('0x22')](_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x22')]);_0x4d82d1[_0xf5a3('0x21')]=qs[_0xf5a3('0x21')](_0x4cb0e9[_0xf5a3('0x35')][_0xf5a3('0x21')]);}return _0x46308f[_0xf5a3('0x8d')](_0x4d82d1);}})[_0xf5a3('0x28')](function(_0x18415c){if(_0x18415c){return _0x18415c?{'count':_0x1d4ec4,'rows':_0x18415c}:null;}})['then'](respondWithResult(_0x1a36ab,null))[_0xf5a3('0x47')](handleError(_0x1a36ab,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 0c6f5a4..98185b2 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 _0x9d99=['emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save','update','remove'];(function(_0x17556e,_0x1aa9d6){var _0x3639bc=function(_0x1626b4){while(--_0x1626b4){_0x17556e['push'](_0x17556e['shift']());}};_0x3639bc(++_0x1aa9d6);}(_0x9d99,0x71));var _0x99d9=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x9d99[_0x1deb03];return _0x189fe7;};'use strict';var EventEmitter=require(_0x99d9('0x0'));var CmList=require(_0x99d9('0x1'))['db'][_0x99d9('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x99d9('0x3')](0x0);var events={'afterCreate':_0x99d9('0x4'),'afterUpdate':_0x99d9('0x5'),'afterDestroy':_0x99d9('0x6')};function emitEvent(_0x2f4e83){return function(_0x416b9d,_0x49ea94,_0x218ab6){CmListEvents[_0x99d9('0x7')](_0x2f4e83+':'+_0x416b9d['id'],_0x416b9d);CmListEvents[_0x99d9('0x7')](_0x2f4e83,_0x416b9d);_0x218ab6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x99d9('0x8')](e,emitEvent(event));}}module[_0x99d9('0x9')]=CmListEvents; \ No newline at end of file +var _0xf1ba=['exports','events','CmList','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf1ba,0x17b));var _0xaf1b=function(_0x8e5112,_0x7cab1f){_0x8e5112=_0x8e5112-0x0;var _0x2f1f31=_0xf1ba[_0x8e5112];return _0x2f1f31;};'use strict';var EventEmitter=require(_0xaf1b('0x0'));var CmList=require('../../mysqldb')['db'][_0xaf1b('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xaf1b('0x2')](0x0);var events={'afterCreate':_0xaf1b('0x3'),'afterUpdate':_0xaf1b('0x4'),'afterDestroy':_0xaf1b('0x5')};function emitEvent(_0x5c1e42){return function(_0x2fe656,_0x559e50,_0x1962cc){CmListEvents[_0xaf1b('0x6')](_0x5c1e42+':'+_0x2fe656['id'],_0x2fe656);CmListEvents[_0xaf1b('0x6')](_0x5c1e42,_0x2fe656);_0x1962cc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xaf1b('0x7')](e,emitEvent(event));}}module[_0xaf1b('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index bbdddba..82db37a 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 _0xcb2c=['./cmList.attributes','CmList','cm_lists','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2de22c,_0x5105af){var _0x3251ae=function(_0x3b0eb8){while(--_0x3b0eb8){_0x2de22c['push'](_0x2de22c['shift']());}};_0x3251ae(++_0x5105af);}(_0xcb2c,0x16b));var _0xccb2=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xcb2c[_0x433a86];return _0x23000c;};'use strict';var _=require(_0xccb2('0x0'));var util=require('util');var logger=require(_0xccb2('0x1'))(_0xccb2('0x2'));var moment=require(_0xccb2('0x3'));var BPromise=require(_0xccb2('0x4'));var rp=require(_0xccb2('0x5'));var fs=require('fs');var path=require(_0xccb2('0x6'));var rimraf=require(_0xccb2('0x7'));var config=require(_0xccb2('0x8'));var attributes=require(_0xccb2('0x9'));module['exports']=function(_0x299af9,_0x10db29){return _0x299af9['define'](_0xccb2('0xa'),attributes,{'tableName':_0xccb2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf820=['define','CmList','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xf820,0x86));var _0x0f82=function(_0x1902d8,_0x2927c4){_0x1902d8=_0x1902d8-0x0;var _0x29b5e1=_0xf820[_0x1902d8];return _0x29b5e1;};'use strict';var _=require(_0x0f82('0x0'));var util=require(_0x0f82('0x1'));var logger=require(_0x0f82('0x2'))('api');var moment=require(_0x0f82('0x3'));var BPromise=require(_0x0f82('0x4'));var rp=require(_0x0f82('0x5'));var fs=require('fs');var path=require(_0x0f82('0x6'));var rimraf=require(_0x0f82('0x7'));var config=require(_0x0f82('0x8'));var attributes=require(_0x0f82('0x9'));module['exports']=function(_0x169e1c,_0x3c8dd5){return _0x169e1c[_0x0f82('0xa')](_0x0f82('0xb'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 8048f17..4508362 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 _0x3e2e=['./cmList.socket','register','request','then','info','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmList,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x3e2e,0x10a));var _0xe3e2=function(_0x32bb87,_0x283aba){_0x32bb87=_0x32bb87-0x0;var _0x24e866=_0x3e2e[_0x32bb87];return _0x24e866;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe3e2('0x0'));var BPromise=require(_0xe3e2('0x1'));var rs=require(_0xe3e2('0x2'));var fs=require('fs');var Redis=require(_0xe3e2('0x3'));var db=require(_0xe3e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3e2('0x5'))(_0xe3e2('0x6'));var config=require(_0xe3e2('0x7'));var jayson=require(_0xe3e2('0x8'));var client=jayson['client'][_0xe3e2('0x9')]({'port':0x232a});config[_0xe3e2('0xa')]=_[_0xe3e2('0xb')](config[_0xe3e2('0xa')],{'host':_0xe3e2('0xc'),'port':0x18eb});var socket=require(_0xe3e2('0xd'))(new Redis(config[_0xe3e2('0xa')]));require(_0xe3e2('0xe'))[_0xe3e2('0xf')](socket);function respondWithRpcPromise(_0x224998,_0x2cce1b,_0x36b88c){return new BPromise(function(_0x2e3022,_0x35f279){return client[_0xe3e2('0x10')](_0x224998,_0x36b88c)[_0xe3e2('0x11')](function(_0x5065b6){logger[_0xe3e2('0x12')]('CmList,\x20%s,\x20%s',_0x2cce1b,'request\x20sent');logger[_0xe3e2('0x13')](_0xe3e2('0x14'),_0x2cce1b,_0xe3e2('0x15'),JSON[_0xe3e2('0x16')](_0x5065b6));if(_0x5065b6['error']){if(_0x5065b6[_0xe3e2('0x17')][_0xe3e2('0x18')]===0x1f4){logger[_0xe3e2('0x17')](_0xe3e2('0x19'),_0x2cce1b,_0x5065b6['error']['message']);return _0x35f279(_0x5065b6['error'][_0xe3e2('0x1a')]);}logger['error'](_0xe3e2('0x19'),_0x2cce1b,_0x5065b6[_0xe3e2('0x17')]['message']);return _0x2e3022(_0x5065b6['error'][_0xe3e2('0x1a')]);}else{logger['info'](_0xe3e2('0x19'),_0x2cce1b,'request\x20sent');_0x2e3022(_0x5065b6[_0xe3e2('0x1b')][_0xe3e2('0x1a')]);}})['catch'](function(_0x40e756){logger[_0xe3e2('0x17')](_0xe3e2('0x19'),_0x2cce1b,_0x40e756);_0x35f279(_0x40e756);});});} \ No newline at end of file +var _0xa038=['redis','./cmList.socket','register','request','then','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter'];(function(_0x2f9b44,_0x6b2a92){var _0x7bdfd0=function(_0x1c109d){while(--_0x1c109d){_0x2f9b44['push'](_0x2f9b44['shift']());}};_0x7bdfd0(++_0x6b2a92);}(_0xa038,0x197));var _0x8a03=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xa038[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x8a03('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a03('0x1'));var rs=require(_0x8a03('0x2'));var fs=require('fs');var Redis=require(_0x8a03('0x3'));var db=require(_0x8a03('0x4'))['db'];var utils=require(_0x8a03('0x5'));var logger=require(_0x8a03('0x6'))(_0x8a03('0x7'));var config=require(_0x8a03('0x8'));var jayson=require(_0x8a03('0x9'));var client=jayson['client'][_0x8a03('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x8a03('0xb'),'port':0x18eb});var socket=require(_0x8a03('0xc'))(new Redis(config[_0x8a03('0xd')]));require(_0x8a03('0xe'))[_0x8a03('0xf')](socket);function respondWithRpcPromise(_0x40954b,_0x446ccd,_0x8736fc){return new BPromise(function(_0x2fb62d,_0x4f6b64){return client[_0x8a03('0x10')](_0x40954b,_0x8736fc)[_0x8a03('0x11')](function(_0x52d606){logger[_0x8a03('0x12')]('CmList,\x20%s,\x20%s',_0x446ccd,_0x8a03('0x13'));logger[_0x8a03('0x14')](_0x8a03('0x15'),_0x446ccd,'request\x20sent',JSON[_0x8a03('0x16')](_0x52d606));if(_0x52d606[_0x8a03('0x17')]){if(_0x52d606['error'][_0x8a03('0x18')]===0x1f4){logger[_0x8a03('0x17')](_0x8a03('0x19'),_0x446ccd,_0x52d606[_0x8a03('0x17')][_0x8a03('0x1a')]);return _0x4f6b64(_0x52d606[_0x8a03('0x17')][_0x8a03('0x1a')]);}logger[_0x8a03('0x17')](_0x8a03('0x19'),_0x446ccd,_0x52d606['error'][_0x8a03('0x1a')]);return _0x2fb62d(_0x52d606[_0x8a03('0x17')][_0x8a03('0x1a')]);}else{logger[_0x8a03('0x12')](_0x8a03('0x19'),_0x446ccd,_0x8a03('0x13'));_0x2fb62d(_0x52d606['result'][_0x8a03('0x1a')]);}})[_0x8a03('0x1b')](function(_0x50b94b){logger[_0x8a03('0x17')](_0x8a03('0x19'),_0x446ccd,_0x50b94b);_0x4f6b64(_0x50b94b);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7897cfa..dbbdbcb 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 _0x8375=['./cmList.events','save','remove','emit','register','length','cmList:'];(function(_0x11ad21,_0x22ecc8){var _0x3220ad=function(_0x5cdd63){while(--_0x5cdd63){_0x11ad21['push'](_0x11ad21['shift']());}};_0x3220ad(++_0x22ecc8);}(_0x8375,0xa8));var _0x5837=function(_0xb6cfa4,_0x121e3b){_0xb6cfa4=_0xb6cfa4-0x0;var _0x51433b=_0x8375[_0xb6cfa4];return _0x51433b;};'use strict';var CmListEvents=require(_0x5837('0x0'));var events=[_0x5837('0x1'),_0x5837('0x2'),'update'];function createListener(_0x24c393,_0x181ec3){return function(_0x86f16a){_0x181ec3[_0x5837('0x3')](_0x24c393,_0x86f16a);};}function removeListener(_0x317452,_0x1edfc5){return function(){CmListEvents['removeListener'](_0x317452,_0x1edfc5);};}exports[_0x5837('0x4')]=function(_0x19491e){for(var _0x365da3=0x0,_0x2e383c=events[_0x5837('0x5')];_0x365da3<_0x2e383c;_0x365da3++){var _0x5bc421=events[_0x365da3];var _0x508caf=createListener(_0x5837('0x6')+_0x5bc421,_0x19491e);CmListEvents['on'](_0x5bc421,_0x508caf);}}; \ No newline at end of file +var _0x5549=['emit','removeListener','length','cmList:','./cmList.events','save','remove','update'];(function(_0x44718d,_0x2b7280){var _0x1232b0=function(_0x1ca2c4){while(--_0x1ca2c4){_0x44718d['push'](_0x44718d['shift']());}};_0x1232b0(++_0x2b7280);}(_0x5549,0x1f4));var _0x9554=function(_0x4dc318,_0x348f33){_0x4dc318=_0x4dc318-0x0;var _0x1842a1=_0x5549[_0x4dc318];return _0x1842a1;};'use strict';var CmListEvents=require(_0x9554('0x0'));var events=[_0x9554('0x1'),_0x9554('0x2'),_0x9554('0x3')];function createListener(_0x153cf2,_0x53ff34){return function(_0x1a31f7){_0x53ff34[_0x9554('0x4')](_0x153cf2,_0x1a31f7);};}function removeListener(_0x244b13,_0x36fc55){return function(){CmListEvents[_0x9554('0x5')](_0x244b13,_0x36fc55);};}exports['register']=function(_0x3a0631){for(var _0x4e8442=0x0,_0x456914=events[_0x9554('0x6')];_0x4e8442<_0x456914;_0x4e8442++){var _0xac6b80=events[_0x4e8442];var _0x5afdf7=createListener(_0x9554('0x7')+_0xac6b80,_0x3a0631);CmListEvents['on'](_0xac6b80,_0x5afdf7);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b8b96c2..a613290 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 _0x9f0e=['/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addCustomField','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x361fe1,_0x17d79a){var _0x4eec28=function(_0x2fa7b7){while(--_0x2fa7b7){_0x361fe1['push'](_0x361fe1['shift']());}};_0x4eec28(++_0x17d79a);}(_0x9f0e,0x8d));var _0xe9f0=function(_0x3abe01,_0x2b7784){_0x3abe01=_0x3abe01-0x0;var _0x329c96=_0x9f0e[_0x3abe01];return _0x329c96;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require('util');var path=require(_0xe9f0('0x1'));var timeout=require(_0xe9f0('0x2'));var express=require(_0xe9f0('0x3'));var router=express['Router']();var auth=require(_0xe9f0('0x4'));var interaction=require(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));var controller=require('./cmList.controller');router['get']('/',auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x8')]);router['get'](_0xe9f0('0x9'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0xa')]);router[_0xe9f0('0xb')](_0xe9f0('0xc'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xb')](_0xe9f0('0xe'),auth[_0xe9f0('0x7')](),controller['getDispositions']);router[_0xe9f0('0xb')](_0xe9f0('0xf'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x10')]);router['get'](_0xe9f0('0x11'),auth[_0xe9f0('0x7')](),controller['getContactsCsv']);router[_0xe9f0('0xb')](_0xe9f0('0x12'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x13')]);router[_0xe9f0('0xb')](_0xe9f0('0x14'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x15')]);router[_0xe9f0('0x16')]('/',auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x17')]);router[_0xe9f0('0x16')](_0xe9f0('0xe'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x18')]);router[_0xe9f0('0x16')](_0xe9f0('0xf'),auth[_0xe9f0('0x7')](),controller['addContacts']);router[_0xe9f0('0x16')](_0xe9f0('0x12'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x19')]);router[_0xe9f0('0x16')](_0xe9f0('0x14'),auth[_0xe9f0('0x7')](),controller['addAgents']);router['put']('/:id',auth[_0xe9f0('0x7')](),controller['update']);router[_0xe9f0('0x1a')](_0xe9f0('0xc'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x1b')]);router[_0xe9f0('0x1a')](_0xe9f0('0xe'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x1c')]);router[_0xe9f0('0x1a')]('/:id/users',auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x1d')]);module[_0xe9f0('0x1e')]=router; \ No newline at end of file +var _0x4421=['./cmList.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','getContacts','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','/:id/contacts','addContacts','addCustomField','/:id/users','addAgents','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4b3d12,_0x1d4133){var _0x104e8c=function(_0x55db69){while(--_0x55db69){_0x4b3d12['push'](_0x4b3d12['shift']());}};_0x104e8c(++_0x1d4133);}(_0x4421,0x163));var _0x1442=function(_0x121c8d,_0x5d71b9){_0x121c8d=_0x121c8d-0x0;var _0x46cb16=_0x4421[_0x121c8d];return _0x46cb16;};'use strict';var multer=require('multer');var util=require(_0x1442('0x0'));var path=require(_0x1442('0x1'));var timeout=require(_0x1442('0x2'));var express=require(_0x1442('0x3'));var router=express[_0x1442('0x4')]();var auth=require(_0x1442('0x5'));var interaction=require(_0x1442('0x6'));var config=require(_0x1442('0x7'));var controller=require(_0x1442('0x8'));router[_0x1442('0x9')]('/',auth[_0x1442('0xa')](),controller[_0x1442('0xb')]);router[_0x1442('0x9')](_0x1442('0xc'),auth[_0x1442('0xa')](),controller['describe']);router[_0x1442('0x9')](_0x1442('0xd'),auth[_0x1442('0xa')](),controller[_0x1442('0xe')]);router[_0x1442('0x9')](_0x1442('0xf'),auth[_0x1442('0xa')](),controller[_0x1442('0x10')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x1442('0x11')]);router[_0x1442('0x9')]('/:id/contacts/csv',auth[_0x1442('0xa')](),controller[_0x1442('0x12')]);router[_0x1442('0x9')](_0x1442('0x13'),auth['isAuthenticated'](),controller[_0x1442('0x14')]);router[_0x1442('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x1442('0x15')]);router[_0x1442('0x16')]('/',auth[_0x1442('0xa')](),controller[_0x1442('0x17')]);router[_0x1442('0x16')]('/:id/dispositions',auth[_0x1442('0xa')](),controller['addDisposition']);router[_0x1442('0x16')](_0x1442('0x18'),auth[_0x1442('0xa')](),controller[_0x1442('0x19')]);router[_0x1442('0x16')]('/:id/fields',auth[_0x1442('0xa')](),controller[_0x1442('0x1a')]);router[_0x1442('0x16')](_0x1442('0x1b'),auth[_0x1442('0xa')](),controller[_0x1442('0x1c')]);router[_0x1442('0x1d')](_0x1442('0xd'),auth[_0x1442('0xa')](),controller['update']);router[_0x1442('0x1e')](_0x1442('0xd'),auth[_0x1442('0xa')](),controller[_0x1442('0x1f')]);router[_0x1442('0x1e')](_0x1442('0xf'),auth[_0x1442('0xa')](),controller['removeDispositions']);router[_0x1442('0x1e')](_0x1442('0x1b'),auth[_0x1442('0xa')](),controller['removeAgents']);module[_0x1442('0x20')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 708e774..8512555 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(_0xc0f505,_0x515046){var _0x2e9d36=function(_0x44d879){while(--_0x44d879){_0xc0f505['push'](_0xc0f505['shift']());}};_0x2e9d36(++_0x515046);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x1cfcc0,_0x4f6b24){var _0x50a426=function(_0x461e4d){while(--_0x461e4d){_0x1cfcc0['push'](_0x1cfcc0['shift']());}};_0x50a426(++_0x4f6b24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 70c7be4..8cbdad8 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 _0x8b1c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','apply','reject','update','then','destroy','end','error','stack','name','send','body','find','catch','Condition','params','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x8b1c,0x1e1));var _0xc8b1=function(_0x171bc9,_0x1e7a49){_0x171bc9=_0x171bc9-0x0;var _0x422da2=_0x8b1c[_0x171bc9];return _0x422da2;};'use strict';var pdf=require(_0xc8b1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc8b1('0x1'));var zipdir=require(_0xc8b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc8b1('0x3'));var moment=require('moment');var BPromise=require(_0xc8b1('0x4'));var Mustache=require(_0xc8b1('0x5'));var util=require(_0xc8b1('0x6'));var path=require('path');var sox=require(_0xc8b1('0x7'));var csv=require(_0xc8b1('0x8'));var ejs=require(_0xc8b1('0x9'));var fs=require('fs');var _=require(_0xc8b1('0xa'));var squel=require('squel');var crypto=require(_0xc8b1('0xb'));var jsforce=require(_0xc8b1('0xc'));var deskjs=require(_0xc8b1('0xd'));var toCsv=require(_0xc8b1('0x8'));var querystring=require('querystring');var Papa=require(_0xc8b1('0xe'));var Redis=require(_0xc8b1('0xf'));var authService=require(_0xc8b1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc8b1('0x11'));var hardwareService=require(_0xc8b1('0x12'));var logger=require(_0xc8b1('0x13'))(_0xc8b1('0x14'));var utils=require(_0xc8b1('0x15'));var config=require(_0xc8b1('0x16'));var db=require(_0xc8b1('0x17'))['db'];function respondWithStatusCode(_0xb889a8,_0x597359){_0x597359=_0x597359||0xcc;return function(_0x1524af){if(_0x1524af){return _0xb889a8[_0xc8b1('0x18')](_0x597359);}return _0xb889a8[_0xc8b1('0x19')](_0x597359)['end']();};}function respondWithResult(_0x4e444b,_0x13c2e6){_0x13c2e6=_0x13c2e6||0xc8;return function(_0x23ac14){if(_0x23ac14){return _0x4e444b['status'](_0x13c2e6)['json'](_0x23ac14);}};}function respondWithFilteredResult(_0x4db5d2,_0x36f62f){return function(_0x4e3ecb){if(_0x4e3ecb){var _0x167c10=_0x4e3ecb[_0xc8b1('0x1a')],_0x2ab528=_0x36f62f[_0xc8b1('0x1b')],_0x22a3f2=_0x36f62f[_0xc8b1('0x1b')]+_0x36f62f[_0xc8b1('0x1c')],_0x527b7f;if(_0x22a3f2>=_0x167c10){_0x22a3f2=_0x167c10;_0x527b7f=0xc8;}else{_0x527b7f=0xce;}_0x4db5d2[_0xc8b1('0x19')](_0x527b7f);return _0x4db5d2[_0xc8b1('0x1d')]('Content-Range',_0x2ab528+'-'+_0x22a3f2+'/'+_0x167c10)['json'](_0x4e3ecb);}return null;};}function patchUpdates(_0x4043f8){return function(_0x1d2944){try{jsonpatch[_0xc8b1('0x1e')](_0x1d2944,_0x4043f8,!![]);}catch(_0x9329b2){return BPromise[_0xc8b1('0x1f')](_0x9329b2);}return _0x1d2944['save']();};}function saveUpdates(_0x129648,_0x3df231){return function(_0x53e9e7){if(_0x53e9e7){return _0x53e9e7[_0xc8b1('0x20')](_0x129648)[_0xc8b1('0x21')](function(_0x172672){return _0x172672;});}return null;};}function removeEntity(_0x2bdf4a,_0xcf32d4){return function(_0x5f03a5){if(_0x5f03a5){return _0x5f03a5[_0xc8b1('0x22')]()[_0xc8b1('0x21')](function(){_0x2bdf4a[_0xc8b1('0x19')](0xcc)[_0xc8b1('0x23')]();});}};}function handleEntityNotFound(_0x35f328,_0x26e5fa){return function(_0x4be7d3){if(!_0x4be7d3){_0x35f328[_0xc8b1('0x18')](0x194);}return _0x4be7d3;};}function handleError(_0x5c76b9,_0x42c52f){_0x42c52f=_0x42c52f||0x1f4;return function(_0x1af92e){logger[_0xc8b1('0x24')](_0x1af92e[_0xc8b1('0x25')]);if(_0x1af92e[_0xc8b1('0x26')]){delete _0x1af92e[_0xc8b1('0x26')];}_0x5c76b9[_0xc8b1('0x19')](_0x42c52f)[_0xc8b1('0x27')](_0x1af92e);};}exports[_0xc8b1('0x20')]=function(_0x46693c,_0x3dad3d){if(_0x46693c[_0xc8b1('0x28')]['id']){delete _0x46693c[_0xc8b1('0x28')]['id'];}return db['Condition'][_0xc8b1('0x29')]({'where':{'id':_0x46693c['params']['id']}})['then'](handleEntityNotFound(_0x3dad3d,null))[_0xc8b1('0x21')](saveUpdates(_0x46693c['body'],null))['then'](respondWithResult(_0x3dad3d,null))[_0xc8b1('0x2a')](handleError(_0x3dad3d,null));};exports[_0xc8b1('0x22')]=function(_0x487684,_0x162c16){return db[_0xc8b1('0x2b')][_0xc8b1('0x29')]({'where':{'id':_0x487684[_0xc8b1('0x2c')]['id']}})[_0xc8b1('0x21')](handleEntityNotFound(_0x162c16,null))['then'](removeEntity(_0x162c16,null))['catch'](handleError(_0x162c16,null));}; \ No newline at end of file +var _0x9bc8=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','then','error','stack','name','send','update','body','Condition','find','destroy','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x533e7f,_0x1abe38){var _0x121a9e=function(_0x8a44a6){while(--_0x8a44a6){_0x533e7f['push'](_0x533e7f['shift']());}};_0x121a9e(++_0x1abe38);}(_0x9bc8,0xa6));var _0x89bc=function(_0x4708de,_0x49f913){_0x4708de=_0x4708de-0x0;var _0x36fe33=_0x9bc8[_0x4708de];return _0x36fe33;};'use strict';var pdf=require(_0x89bc('0x0'));var emlformat=require(_0x89bc('0x1'));var rimraf=require(_0x89bc('0x2'));var zipdir=require(_0x89bc('0x3'));var jsonpatch=require(_0x89bc('0x4'));var rp=require(_0x89bc('0x5'));var moment=require(_0x89bc('0x6'));var BPromise=require(_0x89bc('0x7'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x89bc('0x8'));var csv=require(_0x89bc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x89bc('0xa'));var squel=require(_0x89bc('0xb'));var crypto=require(_0x89bc('0xc'));var jsforce=require(_0x89bc('0xd'));var deskjs=require(_0x89bc('0xe'));var toCsv=require(_0x89bc('0x9'));var querystring=require('querystring');var Papa=require(_0x89bc('0xf'));var Redis=require(_0x89bc('0x10'));var authService=require(_0x89bc('0x11'));var qs=require(_0x89bc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89bc('0x13'));var logger=require(_0x89bc('0x14'))(_0x89bc('0x15'));var utils=require(_0x89bc('0x16'));var config=require('../../config/environment');var db=require(_0x89bc('0x17'))['db'];function respondWithStatusCode(_0x3e149b,_0x5712e0){_0x5712e0=_0x5712e0||0xcc;return function(_0x10642d){if(_0x10642d){return _0x3e149b[_0x89bc('0x18')](_0x5712e0);}return _0x3e149b['status'](_0x5712e0)[_0x89bc('0x19')]();};}function respondWithResult(_0x1a0900,_0x148c1d){_0x148c1d=_0x148c1d||0xc8;return function(_0x5460fc){if(_0x5460fc){return _0x1a0900[_0x89bc('0x1a')](_0x148c1d)[_0x89bc('0x1b')](_0x5460fc);}};}function respondWithFilteredResult(_0x5b8d25,_0x1a04e8){return function(_0x9c8a2){if(_0x9c8a2){var _0x46dc91=_0x9c8a2[_0x89bc('0x1c')],_0x1f9d95=_0x1a04e8[_0x89bc('0x1d')],_0x13b0a3=_0x1a04e8['offset']+_0x1a04e8[_0x89bc('0x1e')],_0xa4f0a0;if(_0x13b0a3>=_0x46dc91){_0x13b0a3=_0x46dc91;_0xa4f0a0=0xc8;}else{_0xa4f0a0=0xce;}_0x5b8d25[_0x89bc('0x1a')](_0xa4f0a0);return _0x5b8d25[_0x89bc('0x1f')](_0x89bc('0x20'),_0x1f9d95+'-'+_0x13b0a3+'/'+_0x46dc91)[_0x89bc('0x1b')](_0x9c8a2);}return null;};}function patchUpdates(_0x3346e4){return function(_0x2c183f){try{jsonpatch['apply'](_0x2c183f,_0x3346e4,!![]);}catch(_0x5db3a1){return BPromise[_0x89bc('0x21')](_0x5db3a1);}return _0x2c183f['save']();};}function saveUpdates(_0x4d5611,_0xae8f32){return function(_0x4e7abf){if(_0x4e7abf){return _0x4e7abf['update'](_0x4d5611)[_0x89bc('0x22')](function(_0x5cf839){return _0x5cf839;});}return null;};}function removeEntity(_0x5b3dc2,_0x226776){return function(_0x2809ab){if(_0x2809ab){return _0x2809ab['destroy']()['then'](function(){_0x5b3dc2[_0x89bc('0x1a')](0xcc)[_0x89bc('0x19')]();});}};}function handleEntityNotFound(_0xd23bd6,_0x59e314){return function(_0x1320eb){if(!_0x1320eb){_0xd23bd6[_0x89bc('0x18')](0x194);}return _0x1320eb;};}function handleError(_0x5c7884,_0x135bf3){_0x135bf3=_0x135bf3||0x1f4;return function(_0x5cc033){logger[_0x89bc('0x23')](_0x5cc033[_0x89bc('0x24')]);if(_0x5cc033[_0x89bc('0x25')]){delete _0x5cc033[_0x89bc('0x25')];}_0x5c7884[_0x89bc('0x1a')](_0x135bf3)[_0x89bc('0x26')](_0x5cc033);};}exports[_0x89bc('0x27')]=function(_0x3d7c1e,_0x8c1108){if(_0x3d7c1e[_0x89bc('0x28')]['id']){delete _0x3d7c1e[_0x89bc('0x28')]['id'];}return db[_0x89bc('0x29')][_0x89bc('0x2a')]({'where':{'id':_0x3d7c1e['params']['id']}})['then'](handleEntityNotFound(_0x8c1108,null))[_0x89bc('0x22')](saveUpdates(_0x3d7c1e[_0x89bc('0x28')],null))['then'](respondWithResult(_0x8c1108,null))['catch'](handleError(_0x8c1108,null));};exports[_0x89bc('0x2b')]=function(_0x2fee35,_0x2ab99c){return db[_0x89bc('0x29')][_0x89bc('0x2a')]({'where':{'id':_0x2fee35[_0x89bc('0x2c')]['id']}})[_0x89bc('0x22')](handleEntityNotFound(_0x2ab99c,null))['then'](removeEntity(_0x2ab99c,null))['catch'](handleError(_0x2ab99c,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 704fb5c..eaa138c 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 _0xac3c=['request-promise','rimraf','../../config/environment','exports','define','Condition','tools_conditions','lodash','util','api','moment','bluebird'];(function(_0x228203,_0x2ab2d2){var _0x1e1b37=function(_0x54fff5){while(--_0x54fff5){_0x228203['push'](_0x228203['shift']());}};_0x1e1b37(++_0x2ab2d2);}(_0xac3c,0xaf));var _0xcac3=function(_0x22cb4e,_0x10af0a){_0x22cb4e=_0x22cb4e-0x0;var _0x53c592=_0xac3c[_0x22cb4e];return _0x53c592;};'use strict';var _=require(_0xcac3('0x0'));var util=require(_0xcac3('0x1'));var logger=require('../../config/logger')(_0xcac3('0x2'));var moment=require(_0xcac3('0x3'));var BPromise=require(_0xcac3('0x4'));var rp=require(_0xcac3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcac3('0x6'));var config=require(_0xcac3('0x7'));var attributes=require('./condition.attributes');module[_0xcac3('0x8')]=function(_0x40d70e,_0x5a0901){return _0x40d70e[_0xcac3('0x9')](_0xcac3('0xa'),attributes,{'tableName':_0xcac3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb82a=['api','moment','bluebird','request-promise','path','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xb82a,0x175));var _0xab82=function(_0x430fbe,_0x1a02c9){_0x430fbe=_0x430fbe-0x0;var _0x3af098=_0xb82a[_0x430fbe];return _0x3af098;};'use strict';var _=require(_0xab82('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xab82('0x1'));var moment=require(_0xab82('0x2'));var BPromise=require(_0xab82('0x3'));var rp=require(_0xab82('0x4'));var fs=require('fs');var path=require(_0xab82('0x5'));var rimraf=require('rimraf');var config=require(_0xab82('0x6'));var attributes=require(_0xab82('0x7'));module[_0xab82('0x8')]=function(_0x1c3067,_0x6a9bd4){return _0x1c3067['define'](_0xab82('0x9'),attributes,{'tableName':_0xab82('0xa'),'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 a2929e5..b578c73 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 _0xac3d=['message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac3d,0x1bc));var _0xdac3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdac3('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdac3('0x1'));var db=require(_0xdac3('0x2'))['db'];var utils=require(_0xdac3('0x3'));var logger=require(_0xdac3('0x4'))(_0xdac3('0x5'));var config=require(_0xdac3('0x6'));var jayson=require(_0xdac3('0x7'));var client=jayson[_0xdac3('0x8')][_0xdac3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d64d6,_0xbc0c1a,_0x4997f8){return new BPromise(function(_0x2a4f2f,_0x2a441a){return client[_0xdac3('0xa')](_0x4d64d6,_0x4997f8)[_0xdac3('0xb')](function(_0x3ba49a){logger[_0xdac3('0xc')](_0xdac3('0xd'),_0xbc0c1a,_0xdac3('0xe'));logger[_0xdac3('0xf')](_0xdac3('0x10'),_0xbc0c1a,_0xdac3('0xe'),JSON['stringify'](_0x3ba49a));if(_0x3ba49a['error']){if(_0x3ba49a[_0xdac3('0x11')]['code']===0x1f4){logger['error'](_0xdac3('0xd'),_0xbc0c1a,_0x3ba49a['error'][_0xdac3('0x12')]);return _0x2a441a(_0x3ba49a[_0xdac3('0x11')]['message']);}logger[_0xdac3('0x11')](_0xdac3('0xd'),_0xbc0c1a,_0x3ba49a['error'][_0xdac3('0x12')]);return _0x2a4f2f(_0x3ba49a[_0xdac3('0x11')]['message']);}else{logger[_0xdac3('0xc')]('Condition,\x20%s,\x20%s',_0xbc0c1a,_0xdac3('0xe'));_0x2a4f2f(_0x3ba49a[_0xdac3('0x13')][_0xdac3('0x12')]);}})[_0xdac3('0x14')](function(_0x96fa05){logger[_0xdac3('0x11')]('Condition,\x20%s,\x20%s',_0xbc0c1a,_0x96fa05);_0x2a441a(_0x96fa05);});});} \ No newline at end of file +var _0x2f20=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x2f20,0x12c));var _0x02f2=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0x2f20[_0x4ed520];return _0x4415a6;};'use strict';var _=require(_0x02f2('0x0'));var util=require(_0x02f2('0x1'));var moment=require(_0x02f2('0x2'));var BPromise=require(_0x02f2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02f2('0x4'));var db=require(_0x02f2('0x5'))['db'];var utils=require(_0x02f2('0x6'));var logger=require(_0x02f2('0x7'))(_0x02f2('0x8'));var config=require(_0x02f2('0x9'));var jayson=require(_0x02f2('0xa'));var client=jayson['client'][_0x02f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b85fd,_0x45c511,_0xb12972){return new BPromise(function(_0x228719,_0x35eff9){return client[_0x02f2('0xc')](_0x3b85fd,_0xb12972)[_0x02f2('0xd')](function(_0x36efe2){logger[_0x02f2('0xe')](_0x02f2('0xf'),_0x45c511,_0x02f2('0x10'));logger[_0x02f2('0x11')]('Condition,\x20%s,\x20%s,\x20%s',_0x45c511,_0x02f2('0x10'),JSON[_0x02f2('0x12')](_0x36efe2));if(_0x36efe2[_0x02f2('0x13')]){if(_0x36efe2[_0x02f2('0x13')][_0x02f2('0x14')]===0x1f4){logger['error'](_0x02f2('0xf'),_0x45c511,_0x36efe2[_0x02f2('0x13')][_0x02f2('0x15')]);return _0x35eff9(_0x36efe2[_0x02f2('0x13')][_0x02f2('0x15')]);}logger[_0x02f2('0x13')]('Condition,\x20%s,\x20%s',_0x45c511,_0x36efe2[_0x02f2('0x13')][_0x02f2('0x15')]);return _0x228719(_0x36efe2[_0x02f2('0x13')][_0x02f2('0x15')]);}else{logger[_0x02f2('0xe')]('Condition,\x20%s,\x20%s',_0x45c511,'request\x20sent');_0x228719(_0x36efe2['result'][_0x02f2('0x15')]);}})[_0x02f2('0x16')](function(_0x3ae908){logger['error'](_0x02f2('0xf'),_0x45c511,_0x3ae908);_0x35eff9(_0x3ae908);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1becb95..15a4b67 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 _0x6220=['../../config/environment','put','/:id','update','delete','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6220,0xf8));var _0x0622=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6220[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x0622('0x0'));var path=require(_0x0622('0x1'));var timeout=require(_0x0622('0x2'));var express=require(_0x0622('0x3'));var router=express[_0x0622('0x4')]();var auth=require(_0x0622('0x5'));var interaction=require(_0x0622('0x6'));var config=require(_0x0622('0x7'));var controller=require('./condition.controller');router[_0x0622('0x8')](_0x0622('0x9'),auth['isAuthenticated'](),controller[_0x0622('0xa')]);router[_0x0622('0xb')]('/:id',auth[_0x0622('0xc')](),controller[_0x0622('0xd')]);module[_0x0622('0xe')]=router; \ No newline at end of file +var _0xc854=['isAuthenticated','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','update','delete','/:id'];(function(_0x46ea7f,_0x2b133f){var _0x46b623=function(_0x438494){while(--_0x438494){_0x46ea7f['push'](_0x46ea7f['shift']());}};_0x46b623(++_0x2b133f);}(_0xc854,0x7b));var _0x4c85=function(_0x5a3fd7,_0x5919da){_0x5a3fd7=_0x5a3fd7-0x0;var _0x572299=_0xc854[_0x5a3fd7];return _0x572299;};'use strict';var multer=require(_0x4c85('0x0'));var util=require('util');var path=require(_0x4c85('0x1'));var timeout=require(_0x4c85('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x4c85('0x3'));var interaction=require(_0x4c85('0x4'));var config=require(_0x4c85('0x5'));var controller=require('./condition.controller');router['put']('/:id',auth['isAuthenticated'](),controller[_0x4c85('0x6')]);router[_0x4c85('0x7')](_0x4c85('0x8'),auth[_0x4c85('0x9')](),controller[_0x4c85('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 1e52e96..583f5dc 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 _0x0d4e=['STRING','name','INTEGER','sequelize','exports'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x0d4e,0x1ca));var _0xe0d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0d4e[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xe0d4('0x0'));module[_0xe0d4('0x1')]={'name':{'type':Sequelize[_0xe0d4('0x2')],'allowNull':![],'unique':_0xe0d4('0x3')},'OrderBy':{'type':Sequelize[_0xe0d4('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xe0d4('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xaab2=['name','exports','STRING'];(function(_0x1801e7,_0x140713){var _0x3a449b=function(_0x14739a){while(--_0x14739a){_0x1801e7['push'](_0x1801e7['shift']());}};_0x3a449b(++_0x140713);}(_0xaab2,0xca));var _0x2aab=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xaab2[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require('sequelize');module[_0x2aab('0x0')]={'name':{'type':Sequelize[_0x2aab('0x1')],'allowNull':![],'unique':_0x2aab('0x2')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x2aab('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 797da01..a52c504 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 _0x008c=['UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','destroy','then','send','index','map','ContactItemType','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ContactItemTypes'];(function(_0x23d89a,_0x115ed4){var _0x2b7686=function(_0x47d35c){while(--_0x47d35c){_0x23d89a['push'](_0x23d89a['shift']());}};_0x2b7686(++_0x115ed4);}(_0x008c,0x188));var _0xc008=function(_0x15b182,_0xb73a6e){_0x15b182=_0x15b182-0x0;var _0x400ac7=_0x008c[_0x15b182];return _0x400ac7;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];function respondWithStatusCode(_0x2a5b4e,_0x9ffa93){_0x9ffa93=_0x9ffa93||0xcc;return function(_0x1819c6){if(_0x1819c6){return _0x2a5b4e[_0xc008('0x17')](_0x9ffa93);}return _0x2a5b4e['status'](_0x9ffa93)['end']();};}function respondWithResult(_0x33f44c,_0x50c1ab){_0x50c1ab=_0x50c1ab||0xc8;return function(_0x25e13f){if(_0x25e13f){return _0x33f44c[_0xc008('0x18')](_0x50c1ab)[_0xc008('0x19')](_0x25e13f);}};}function respondWithFilteredResult(_0x339ffc,_0x3f0ecf){return function(_0x5ee00b){if(_0x5ee00b){var _0x5e894e=_0x5ee00b[_0xc008('0x1a')],_0x4bd0f4=_0x3f0ecf[_0xc008('0x1b')],_0x11ef38=_0x3f0ecf['offset']+_0x3f0ecf['limit'],_0x15a6ad;if(_0x11ef38>=_0x5e894e){_0x11ef38=_0x5e894e;_0x15a6ad=0xc8;}else{_0x15a6ad=0xce;}_0x339ffc['status'](_0x15a6ad);return _0x339ffc['set'](_0xc008('0x1c'),_0x4bd0f4+'-'+_0x11ef38+'/'+_0x5e894e)[_0xc008('0x19')](_0x5ee00b);}return null;};}function patchUpdates(_0x501137){return function(_0x813397){try{jsonpatch['apply'](_0x813397,_0x501137,!![]);}catch(_0x4bd611){return BPromise['reject'](_0x4bd611);}return _0x813397['save']();};}function saveUpdates(_0x5754a0,_0x4b9726){return function(_0x5560b1){if(_0x5560b1){return _0x5560b1['update'](_0x5754a0)['then'](function(_0x5a58bd){return _0x5a58bd;});}return null;};}function removeEntity(_0x13a263,_0x4777a6){return function(_0x251db2){if(_0x251db2){return _0x251db2[_0xc008('0x1d')]()[_0xc008('0x1e')](function(){var _0x110128=_0x251db2['get']({'plain':!![]});var _0x459fd9='ContactItemTypes';return db['UserProfileResource'][_0xc008('0x1d')]({'where':{'type':_0x459fd9,'resourceId':_0x110128['id']}})[_0xc008('0x1e')](function(){return _0x251db2;});})[_0xc008('0x1e')](function(){_0x13a263[_0xc008('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48582b,_0x5de1e9){return function(_0x3f7b07){if(!_0x3f7b07){_0x48582b[_0xc008('0x17')](0x194);}return _0x3f7b07;};}function handleError(_0x92c582,_0x2e31c2){_0x2e31c2=_0x2e31c2||0x1f4;return function(_0x5bebd9){logger['error'](_0x5bebd9['stack']);if(_0x5bebd9['name']){delete _0x5bebd9['name'];}_0x92c582[_0xc008('0x18')](_0x2e31c2)[_0xc008('0x1f')](_0x5bebd9);};}exports[_0xc008('0x20')]=function(_0x529961,_0x24c14c){var _0x32390d={},_0x209591={},_0x2a7d4f={'count':0x0,'rows':[]};var _0x4c5dec=_[_0xc008('0x21')](db[_0xc008('0x22')]['rawAttributes'],function(_0x58db82){return{'name':_0x58db82['fieldName'],'type':_0x58db82[_0xc008('0x23')][_0xc008('0x24')]};});_0x209591[_0xc008('0x25')]=_[_0xc008('0x21')](_0x4c5dec,_0xc008('0x26'));_0x209591[_0xc008('0x27')]=_[_0xc008('0x28')](_0x529961[_0xc008('0x27')]);_0x209591[_0xc008('0x29')]=_[_0xc008('0x2a')](_0x209591[_0xc008('0x25')],_0x209591[_0xc008('0x27')]);_0x32390d['attributes']=_[_0xc008('0x2a')](_0x209591[_0xc008('0x25')],qs['fields'](_0x529961[_0xc008('0x27')][_0xc008('0x2b')]));_0x32390d[_0xc008('0x2c')]=_0x32390d[_0xc008('0x2c')][_0xc008('0x2d')]?_0x32390d[_0xc008('0x2c')]:_0x209591[_0xc008('0x25')];if(!_0x529961[_0xc008('0x27')][_0xc008('0x2e')]('nolimit')){_0x32390d[_0xc008('0x2f')]=qs[_0xc008('0x2f')](_0x529961[_0xc008('0x27')][_0xc008('0x2f')]);_0x32390d[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x529961[_0xc008('0x27')]['offset']);}_0x32390d[_0xc008('0x30')]=qs[_0xc008('0x31')](_0x529961['query'][_0xc008('0x31')]);_0x32390d[_0xc008('0x32')]=qs['filters'](_[_0xc008('0x33')](_0x529961[_0xc008('0x27')],_0x209591[_0xc008('0x29')]),_0x4c5dec);if(_0x529961['query']['filter']){_0x32390d['where']=_[_0xc008('0x34')](_0x32390d['where'],{'$or':_[_0xc008('0x21')](_0x4c5dec,function(_0x3884dd){if(_0x3884dd[_0xc008('0x23')]!==_0xc008('0x35')){var _0x3148e1={};_0x3148e1[_0x3884dd[_0xc008('0x26')]]={'$like':'%'+_0x529961[_0xc008('0x27')][_0xc008('0x36')]+'%'};return _0x3148e1;}})});}_0x32390d=_[_0xc008('0x34')]({},_0x32390d,_0x529961[_0xc008('0x37')]);var _0x3ebb83={'where':_0x32390d[_0xc008('0x32')]};return db[_0xc008('0x22')][_0xc008('0x1a')](_0x3ebb83)['then'](function(_0x3238b4){_0x2a7d4f[_0xc008('0x1a')]=_0x3238b4;if(_0x529961[_0xc008('0x27')][_0xc008('0x38')]){_0x32390d['include']=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x39')](_0x32390d);})[_0xc008('0x1e')](function(_0x36e7ae){_0x2a7d4f[_0xc008('0x3a')]=_0x36e7ae;return _0x2a7d4f;})['then'](respondWithFilteredResult(_0x24c14c,_0x32390d))[_0xc008('0x3b')](handleError(_0x24c14c,null));};exports[_0xc008('0x3c')]=function(_0x3794b0,_0x3e9a99){var _0x7279e8={'raw':!![],'where':{'id':_0x3794b0[_0xc008('0x3d')]['id']}},_0x4f93a4={};_0x4f93a4[_0xc008('0x25')]=_[_0xc008('0x28')](db[_0xc008('0x22')]['rawAttributes']);_0x4f93a4[_0xc008('0x27')]=_[_0xc008('0x28')](_0x3794b0[_0xc008('0x27')]);_0x4f93a4['filters']=_[_0xc008('0x2a')](_0x4f93a4['model'],_0x4f93a4[_0xc008('0x27')]);_0x7279e8['attributes']=_[_0xc008('0x2a')](_0x4f93a4[_0xc008('0x25')],qs['fields'](_0x3794b0[_0xc008('0x27')][_0xc008('0x2b')]));_0x7279e8[_0xc008('0x2c')]=_0x7279e8['attributes'][_0xc008('0x2d')]?_0x7279e8[_0xc008('0x2c')]:_0x4f93a4[_0xc008('0x25')];if(_0x3794b0[_0xc008('0x27')][_0xc008('0x38')]){_0x7279e8[_0xc008('0x3e')]=[{'all':!![]}];}_0x7279e8=_['merge']({},_0x7279e8,_0x3794b0['options']);return db['ContactItemType'][_0xc008('0x3f')](_0x7279e8)[_0xc008('0x1e')](handleEntityNotFound(_0x3e9a99,null))[_0xc008('0x1e')](respondWithResult(_0x3e9a99,null))[_0xc008('0x3b')](handleError(_0x3e9a99,null));};exports[_0xc008('0x40')]=function(_0x24f6a4,_0x2cf641){return db[_0xc008('0x22')]['create'](_0x24f6a4['body'],{})['then'](function(_0x2d5a49){var _0x2651cf=_0x24f6a4[_0xc008('0x41')]['get']({'plain':!![]});if(!_0x2651cf)throw new Error(_0xc008('0x42'));if(_0x2651cf[_0xc008('0x43')]===_0xc008('0x41')){var _0x1c2c50=_0x2d5a49[_0xc008('0x44')]({'plain':!![]});var _0x56e4ac=_0xc008('0x45');return db[_0xc008('0x46')][_0xc008('0x3f')]({'where':{'name':_0x56e4ac,'userProfileId':_0x2651cf[_0xc008('0x47')]},'raw':!![]})['then'](function(_0x4c63d4){if(_0x4c63d4&&_0x4c63d4[_0xc008('0x48')]===0x0){return db['UserProfileResource'][_0xc008('0x40')]({'name':_0x1c2c50[_0xc008('0x26')],'resourceId':_0x1c2c50['id'],'type':_0x4c63d4[_0xc008('0x26')],'sectionId':_0x4c63d4['id']},{})['then'](function(){return _0x2d5a49;});}else{return _0x2d5a49;}})[_0xc008('0x3b')](function(_0x32b435){logger[_0xc008('0x49')](_0xc008('0x4a'),_0x32b435);throw _0x32b435;});}return _0x2d5a49;})[_0xc008('0x1e')](respondWithResult(_0x2cf641,0xc9))['catch'](handleError(_0x2cf641,null));};exports[_0xc008('0x4b')]=function(_0x27b022,_0x4b4c6d){if(_0x27b022[_0xc008('0x4c')]['id']){delete _0x27b022[_0xc008('0x4c')]['id'];}return db['ContactItemType']['find']({'where':{'id':_0x27b022[_0xc008('0x3d')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x4b4c6d,null))[_0xc008('0x1e')](saveUpdates(_0x27b022[_0xc008('0x4c')],null))[_0xc008('0x1e')](respondWithResult(_0x4b4c6d,null))['catch'](handleError(_0x4b4c6d,null));};exports['destroy']=function(_0x34b72a,_0x5d815d){return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x34b72a[_0xc008('0x3d')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x5d815d,null))[_0xc008('0x1e')](removeEntity(_0x5d815d,null))[_0xc008('0x3b')](handleError(_0x5d815d,null));}; \ No newline at end of file +var _0x4b84=['fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','set','Content-Range','reject','save','update','then','get','ContactItemTypes','destroy','status','stack','name','send','index','ContactItemType','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','html-pdf','eml-format'];(function(_0x3e5742,_0x5df524){var _0xd16f96=function(_0x3aa8a1){while(--_0x3aa8a1){_0x3e5742['push'](_0x3e5742['shift']());}};_0xd16f96(++_0x5df524);}(_0x4b84,0x1cc));var _0x44b8=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x4b84[_0x175e89];return _0x2ed996;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x147529,_0x4301a6){_0x4301a6=_0x4301a6||0xcc;return function(_0x4bcc43){if(_0x4bcc43){return _0x147529[_0x44b8('0x13')](_0x4301a6);}return _0x147529['status'](_0x4301a6)[_0x44b8('0x14')]();};}function respondWithResult(_0x18d642,_0x4df670){_0x4df670=_0x4df670||0xc8;return function(_0x63e8f6){if(_0x63e8f6){return _0x18d642['status'](_0x4df670)['json'](_0x63e8f6);}};}function respondWithFilteredResult(_0x2a3e4c,_0x2af0ad){return function(_0x1722da){if(_0x1722da){var _0x41ab46=_0x1722da[_0x44b8('0x15')],_0x5e52f2=_0x2af0ad['offset'],_0x495c74=_0x2af0ad[_0x44b8('0x16')]+_0x2af0ad[_0x44b8('0x17')],_0x5d6349;if(_0x495c74>=_0x41ab46){_0x495c74=_0x41ab46;_0x5d6349=0xc8;}else{_0x5d6349=0xce;}_0x2a3e4c['status'](_0x5d6349);return _0x2a3e4c[_0x44b8('0x18')](_0x44b8('0x19'),_0x5e52f2+'-'+_0x495c74+'/'+_0x41ab46)['json'](_0x1722da);}return null;};}function patchUpdates(_0x89bc30){return function(_0x3f4688){try{jsonpatch['apply'](_0x3f4688,_0x89bc30,!![]);}catch(_0xcce202){return BPromise[_0x44b8('0x1a')](_0xcce202);}return _0x3f4688[_0x44b8('0x1b')]();};}function saveUpdates(_0x235bdc,_0x102ef9){return function(_0x369c09){if(_0x369c09){return _0x369c09[_0x44b8('0x1c')](_0x235bdc)[_0x44b8('0x1d')](function(_0x429461){return _0x429461;});}return null;};}function removeEntity(_0x1e0f2d,_0x1d642b){return function(_0x14996c){if(_0x14996c){return _0x14996c['destroy']()[_0x44b8('0x1d')](function(){var _0x3a8aa4=_0x14996c[_0x44b8('0x1e')]({'plain':!![]});var _0x1418db=_0x44b8('0x1f');return db['UserProfileResource'][_0x44b8('0x20')]({'where':{'type':_0x1418db,'resourceId':_0x3a8aa4['id']}})['then'](function(){return _0x14996c;});})[_0x44b8('0x1d')](function(){_0x1e0f2d[_0x44b8('0x21')](0xcc)[_0x44b8('0x14')]();});}};}function handleEntityNotFound(_0x47689e,_0x230a3d){return function(_0x59acbc){if(!_0x59acbc){_0x47689e[_0x44b8('0x13')](0x194);}return _0x59acbc;};}function handleError(_0x502acf,_0x41d673){_0x41d673=_0x41d673||0x1f4;return function(_0x350482){logger['error'](_0x350482[_0x44b8('0x22')]);if(_0x350482[_0x44b8('0x23')]){delete _0x350482[_0x44b8('0x23')];}_0x502acf['status'](_0x41d673)[_0x44b8('0x24')](_0x350482);};}exports[_0x44b8('0x25')]=function(_0x53d9c7,_0x2e0174){var _0x4a182d={},_0xfb0028={},_0x5a544c={'count':0x0,'rows':[]};var _0x559f0b=_['map'](db[_0x44b8('0x26')][_0x44b8('0x27')],function(_0x44ce5a){return{'name':_0x44ce5a[_0x44b8('0x28')],'type':_0x44ce5a[_0x44b8('0x29')][_0x44b8('0x2a')]};});_0xfb0028[_0x44b8('0x2b')]=_[_0x44b8('0x2c')](_0x559f0b,_0x44b8('0x23'));_0xfb0028[_0x44b8('0x2d')]=_[_0x44b8('0x2e')](_0x53d9c7[_0x44b8('0x2d')]);_0xfb0028[_0x44b8('0x2f')]=_['intersection'](_0xfb0028[_0x44b8('0x2b')],_0xfb0028['query']);_0x4a182d[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0xfb0028[_0x44b8('0x2b')],qs[_0x44b8('0x32')](_0x53d9c7[_0x44b8('0x2d')]['fields']));_0x4a182d[_0x44b8('0x30')]=_0x4a182d[_0x44b8('0x30')][_0x44b8('0x33')]?_0x4a182d[_0x44b8('0x30')]:_0xfb0028[_0x44b8('0x2b')];if(!_0x53d9c7['query'][_0x44b8('0x34')](_0x44b8('0x35'))){_0x4a182d[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x17')]);_0x4a182d[_0x44b8('0x16')]=qs[_0x44b8('0x16')](_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x16')]);}_0x4a182d[_0x44b8('0x36')]=qs[_0x44b8('0x37')](_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x37')]);_0x4a182d[_0x44b8('0x38')]=qs[_0x44b8('0x2f')](_[_0x44b8('0x39')](_0x53d9c7[_0x44b8('0x2d')],_0xfb0028[_0x44b8('0x2f')]),_0x559f0b);if(_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x3a')]){_0x4a182d[_0x44b8('0x38')]=_['merge'](_0x4a182d[_0x44b8('0x38')],{'$or':_[_0x44b8('0x2c')](_0x559f0b,function(_0x4fcfa0){if(_0x4fcfa0[_0x44b8('0x29')]!==_0x44b8('0x3b')){var _0x6658be={};_0x6658be[_0x4fcfa0[_0x44b8('0x23')]]={'$like':'%'+_0x53d9c7['query'][_0x44b8('0x3a')]+'%'};return _0x6658be;}})});}_0x4a182d=_[_0x44b8('0x3c')]({},_0x4a182d,_0x53d9c7[_0x44b8('0x3d')]);var _0x1ee3cc={'where':_0x4a182d[_0x44b8('0x38')]};return db[_0x44b8('0x26')][_0x44b8('0x15')](_0x1ee3cc)[_0x44b8('0x1d')](function(_0x209039){_0x5a544c[_0x44b8('0x15')]=_0x209039;if(_0x53d9c7[_0x44b8('0x2d')][_0x44b8('0x3e')]){_0x4a182d[_0x44b8('0x3f')]=[{'all':!![]}];}return db[_0x44b8('0x26')][_0x44b8('0x40')](_0x4a182d);})[_0x44b8('0x1d')](function(_0x57d8c4){_0x5a544c[_0x44b8('0x41')]=_0x57d8c4;return _0x5a544c;})[_0x44b8('0x1d')](respondWithFilteredResult(_0x2e0174,_0x4a182d))[_0x44b8('0x42')](handleError(_0x2e0174,null));};exports['show']=function(_0xd424f8,_0x1054c5){var _0x229cc9={'raw':!![],'where':{'id':_0xd424f8[_0x44b8('0x43')]['id']}},_0x585a16={};_0x585a16[_0x44b8('0x2b')]=_[_0x44b8('0x2e')](db[_0x44b8('0x26')][_0x44b8('0x27')]);_0x585a16['query']=_['keys'](_0xd424f8[_0x44b8('0x2d')]);_0x585a16[_0x44b8('0x2f')]=_[_0x44b8('0x31')](_0x585a16[_0x44b8('0x2b')],_0x585a16[_0x44b8('0x2d')]);_0x229cc9[_0x44b8('0x30')]=_[_0x44b8('0x31')](_0x585a16[_0x44b8('0x2b')],qs[_0x44b8('0x32')](_0xd424f8[_0x44b8('0x2d')][_0x44b8('0x32')]));_0x229cc9[_0x44b8('0x30')]=_0x229cc9[_0x44b8('0x30')][_0x44b8('0x33')]?_0x229cc9[_0x44b8('0x30')]:_0x585a16[_0x44b8('0x2b')];if(_0xd424f8[_0x44b8('0x2d')][_0x44b8('0x3e')]){_0x229cc9[_0x44b8('0x3f')]=[{'all':!![]}];}_0x229cc9=_['merge']({},_0x229cc9,_0xd424f8['options']);return db[_0x44b8('0x26')][_0x44b8('0x44')](_0x229cc9)[_0x44b8('0x1d')](handleEntityNotFound(_0x1054c5,null))[_0x44b8('0x1d')](respondWithResult(_0x1054c5,null))[_0x44b8('0x42')](handleError(_0x1054c5,null));};exports[_0x44b8('0x45')]=function(_0x411ed6,_0x4fe73f){return db[_0x44b8('0x26')]['create'](_0x411ed6[_0x44b8('0x46')],{})[_0x44b8('0x1d')](function(_0x1dbc28){var _0x9207bf=_0x411ed6[_0x44b8('0x47')][_0x44b8('0x1e')]({'plain':!![]});if(!_0x9207bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9207bf[_0x44b8('0x48')]===_0x44b8('0x47')){var _0x10602c=_0x1dbc28[_0x44b8('0x1e')]({'plain':!![]});var _0x4ccc77=_0x44b8('0x1f');return db[_0x44b8('0x49')][_0x44b8('0x44')]({'where':{'name':_0x4ccc77,'userProfileId':_0x9207bf[_0x44b8('0x4a')]},'raw':!![]})[_0x44b8('0x1d')](function(_0x470ebb){if(_0x470ebb&&_0x470ebb['autoAssociation']===0x0){return db[_0x44b8('0x4b')][_0x44b8('0x45')]({'name':_0x10602c[_0x44b8('0x23')],'resourceId':_0x10602c['id'],'type':_0x470ebb[_0x44b8('0x23')],'sectionId':_0x470ebb['id']},{})[_0x44b8('0x1d')](function(){return _0x1dbc28;});}else{return _0x1dbc28;}})['catch'](function(_0x493840){logger[_0x44b8('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x493840);throw _0x493840;});}return _0x1dbc28;})[_0x44b8('0x1d')](respondWithResult(_0x4fe73f,0xc9))['catch'](handleError(_0x4fe73f,null));};exports[_0x44b8('0x1c')]=function(_0x434d6a,_0x1a29f6){if(_0x434d6a[_0x44b8('0x46')]['id']){delete _0x434d6a[_0x44b8('0x46')]['id'];}return db[_0x44b8('0x26')][_0x44b8('0x44')]({'where':{'id':_0x434d6a['params']['id']}})[_0x44b8('0x1d')](handleEntityNotFound(_0x1a29f6,null))[_0x44b8('0x1d')](saveUpdates(_0x434d6a[_0x44b8('0x46')],null))['then'](respondWithResult(_0x1a29f6,null))[_0x44b8('0x42')](handleError(_0x1a29f6,null));};exports[_0x44b8('0x20')]=function(_0x45f9a0,_0x2b256b){return db['ContactItemType'][_0x44b8('0x44')]({'where':{'id':_0x45f9a0[_0x44b8('0x43')]['id']}})['then'](handleEntityNotFound(_0x2b256b,null))[_0x44b8('0x1d')](removeEntity(_0x2b256b,null))[_0x44b8('0x42')](handleError(_0x2b256b,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index f0ea506..abb86bf 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 _0x0024=['util','api','bluebird','rimraf','../../config/environment','define','ContactItemType'];(function(_0x4ec13d,_0x358a8f){var _0x3c3fa7=function(_0x2615f6){while(--_0x2615f6){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0x3c3fa7(++_0x358a8f);}(_0x0024,0xa8));var _0x4002=function(_0x200766,_0x5114fa){_0x200766=_0x200766-0x0;var _0x8cc5d1=_0x0024[_0x200766];return _0x8cc5d1;};'use strict';var _=require('lodash');var util=require(_0x4002('0x0'));var logger=require('../../config/logger')(_0x4002('0x1'));var moment=require('moment');var BPromise=require(_0x4002('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4002('0x3'));var config=require(_0x4002('0x4'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x36c011,_0x144717){return _0x36c011[_0x4002('0x5')](_0x4002('0x6'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0324=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types'];(function(_0x246b5a,_0x4fd53d){var _0x352d9e=function(_0x4ad8d9){while(--_0x4ad8d9){_0x246b5a['push'](_0x246b5a['shift']());}};_0x352d9e(++_0x4fd53d);}(_0x0324,0x90));var _0x4032=function(_0x3f0fb4,_0x5d7940){_0x3f0fb4=_0x3f0fb4-0x0;var _0x32130f=_0x0324[_0x3f0fb4];return _0x32130f;};'use strict';var _=require('lodash');var util=require(_0x4032('0x0'));var logger=require(_0x4032('0x1'))(_0x4032('0x2'));var moment=require(_0x4032('0x3'));var BPromise=require(_0x4032('0x4'));var rp=require(_0x4032('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4032('0x6'));var config=require(_0x4032('0x7'));var attributes=require(_0x4032('0x8'));module[_0x4032('0x9')]=function(_0x77ac4c,_0xa41e9c){return _0x77ac4c['define'](_0x4032('0xa'),attributes,{'tableName':_0x4032('0xb'),'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 7641e0e..f169f00 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 _0xa74d=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa74d,0x1cf));var _0xda74=function(_0x1f800c,_0xbf544a){_0x1f800c=_0x1f800c-0x0;var _0x2129ec=_0xa74d[_0x1f800c];return _0x2129ec;};'use strict';var _=require('lodash');var util=require(_0xda74('0x0'));var moment=require(_0xda74('0x1'));var BPromise=require(_0xda74('0x2'));var rs=require(_0xda74('0x3'));var fs=require('fs');var Redis=require(_0xda74('0x4'));var db=require(_0xda74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xda74('0x6'))(_0xda74('0x7'));var config=require(_0xda74('0x8'));var jayson=require(_0xda74('0x9'));var client=jayson[_0xda74('0xa')][_0xda74('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2113f2,_0x3fa4e7,_0x5da443){return new BPromise(function(_0x23d5f5,_0x517251){return client['request'](_0x2113f2,_0x5da443)[_0xda74('0xc')](function(_0x411790){logger['info'](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));logger[_0xda74('0xf')](_0xda74('0x10'),_0x3fa4e7,_0xda74('0xe'),JSON[_0xda74('0x11')](_0x411790));if(_0x411790[_0xda74('0x12')]){if(_0x411790[_0xda74('0x12')]['code']===0x1f4){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')]['message']);return _0x517251(_0x411790[_0xda74('0x12')][_0xda74('0x13')]);}logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x411790[_0xda74('0x12')][_0xda74('0x13')]);return _0x23d5f5(_0x411790[_0xda74('0x12')]['message']);}else{logger[_0xda74('0x14')](_0xda74('0xd'),_0x3fa4e7,_0xda74('0xe'));_0x23d5f5(_0x411790[_0xda74('0x15')][_0xda74('0x13')]);}})['catch'](function(_0x1535d3){logger[_0xda74('0x12')](_0xda74('0xd'),_0x3fa4e7,_0x1535d3);_0x517251(_0x1535d3);});});} \ No newline at end of file +var _0x049e=['then','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','ContactItemType,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3e85a4,_0x18c3a9){var _0x21e7d1=function(_0x48457d){while(--_0x48457d){_0x3e85a4['push'](_0x3e85a4['shift']());}};_0x21e7d1(++_0x18c3a9);}(_0x049e,0x16a));var _0xe049=function(_0xf34109,_0x380779){_0xf34109=_0xf34109-0x0;var _0x570bfc=_0x049e[_0xf34109];return _0x570bfc;};'use strict';var _=require(_0xe049('0x0'));var util=require(_0xe049('0x1'));var moment=require('moment');var BPromise=require(_0xe049('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe049('0x3'));var db=require(_0xe049('0x4'))['db'];var utils=require(_0xe049('0x5'));var logger=require(_0xe049('0x6'))(_0xe049('0x7'));var config=require('../../config/environment');var jayson=require(_0xe049('0x8'));var client=jayson[_0xe049('0x9')][_0xe049('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x221a5f,_0x1d4fc6,_0x17945b){return new BPromise(function(_0x22abb2,_0x515823){return client[_0xe049('0xb')](_0x221a5f,_0x17945b)[_0xe049('0xc')](function(_0x6d04ed){logger['info']('ContactItemType,\x20%s,\x20%s',_0x1d4fc6,_0xe049('0xd'));logger[_0xe049('0xe')](_0xe049('0xf'),_0x1d4fc6,'request\x20sent',JSON['stringify'](_0x6d04ed));if(_0x6d04ed['error']){if(_0x6d04ed[_0xe049('0x10')][_0xe049('0x11')]===0x1f4){logger[_0xe049('0x10')](_0xe049('0x12'),_0x1d4fc6,_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);return _0x515823(_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);}logger['error'](_0xe049('0x12'),_0x1d4fc6,_0x6d04ed[_0xe049('0x10')][_0xe049('0x13')]);return _0x22abb2(_0x6d04ed[_0xe049('0x10')]['message']);}else{logger[_0xe049('0x14')](_0xe049('0x12'),_0x1d4fc6,'request\x20sent');_0x22abb2(_0x6d04ed[_0xe049('0x15')][_0xe049('0x13')]);}})['catch'](function(_0x8b9bfe){logger[_0xe049('0x10')]('ContactItemType,\x20%s,\x20%s',_0x1d4fc6,_0x8b9bfe);_0x515823(_0x8b9bfe);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index d77e998..5799045 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 _0x169f=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post'];(function(_0x2abdcb,_0x4a5307){var _0x2276c0=function(_0x168dce){while(--_0x168dce){_0x2abdcb['push'](_0x2abdcb['shift']());}};_0x2276c0(++_0x4a5307);}(_0x169f,0x15c));var _0xf169=function(_0x42fd3a,_0x4cbdab){_0x42fd3a=_0x42fd3a-0x0;var _0x1f7f53=_0x169f[_0x42fd3a];return _0x1f7f53;};'use strict';var multer=require(_0xf169('0x0'));var util=require(_0xf169('0x1'));var path=require(_0xf169('0x2'));var timeout=require(_0xf169('0x3'));var express=require('express');var router=express[_0xf169('0x4')]();var auth=require(_0xf169('0x5'));var interaction=require(_0xf169('0x6'));var config=require(_0xf169('0x7'));var controller=require('./contactItemType.controller');router[_0xf169('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf169('0x8')]('/:id',auth[_0xf169('0x9')](),controller[_0xf169('0xa')]);router[_0xf169('0xb')]('/',auth[_0xf169('0x9')](),controller['create']);router[_0xf169('0xc')](_0xf169('0xd'),auth[_0xf169('0x9')](),controller[_0xf169('0xe')]);router[_0xf169('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf169('0x10')]);module[_0xf169('0x11')]=router; \ No newline at end of file +var _0x1d00=['express','Router','../../components/interaction/service','./contactItemType.controller','get','index','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1ed034,_0x5d495d){var _0x4a82b7=function(_0x348231){while(--_0x348231){_0x1ed034['push'](_0x1ed034['shift']());}};_0x4a82b7(++_0x5d495d);}(_0x1d00,0x12c));var _0x01d0=function(_0x4cf3fa,_0x3aa06e){_0x4cf3fa=_0x4cf3fa-0x0;var _0x1f61d7=_0x1d00[_0x4cf3fa];return _0x1f61d7;};'use strict';var multer=require(_0x01d0('0x0'));var util=require(_0x01d0('0x1'));var path=require(_0x01d0('0x2'));var timeout=require(_0x01d0('0x3'));var express=require(_0x01d0('0x4'));var router=express[_0x01d0('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x01d0('0x6'));var config=require('../../config/environment');var controller=require(_0x01d0('0x7'));router[_0x01d0('0x8')]('/',auth['isAuthenticated'](),controller[_0x01d0('0x9')]);router[_0x01d0('0x8')](_0x01d0('0xa'),auth[_0x01d0('0xb')](),controller[_0x01d0('0xc')]);router[_0x01d0('0xd')]('/',auth[_0x01d0('0xb')](),controller[_0x01d0('0xe')]);router['put'](_0x01d0('0xa'),auth['isAuthenticated'](),controller[_0x01d0('0xf')]);router[_0x01d0('0x10')]('/:id',auth[_0x01d0('0xb')](),controller[_0x01d0('0x11')]);module[_0x01d0('0x12')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 45c9598..5f8e130 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 _0x6dd1=['sequelize','STRING','name'];(function(_0x42b362,_0x2fea19){var _0x49a47b=function(_0xe0a596){while(--_0xe0a596){_0x42b362['push'](_0x42b362['shift']());}};_0x49a47b(++_0x2fea19);}(_0x6dd1,0x111));var _0x16dd=function(_0x1d8c96,_0x341d73){_0x1d8c96=_0x1d8c96-0x0;var _0x5c8aa5=_0x6dd1[_0x1d8c96];return _0x5c8aa5;};'use strict';var Sequelize=require(_0x16dd('0x0'));module['exports']={'name':{'type':Sequelize[_0x16dd('0x1')],'allowNull':![],'unique':_0x16dd('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7f94=['STRING','name','sequelize'];(function(_0x1aafe2,_0x5b3f46){var _0x40060e=function(_0x2f4c51){while(--_0x2f4c51){_0x1aafe2['push'](_0x1aafe2['shift']());}};_0x40060e(++_0x5b3f46);}(_0x7f94,0x65));var _0x47f9=function(_0xf0b052,_0x5c5a8b){_0xf0b052=_0xf0b052-0x0;var _0x3f486a=_0x7f94[_0xf0b052];return _0x3f486a;};'use strict';var Sequelize=require(_0x47f9('0x0'));module['exports']={'name':{'type':Sequelize[_0x47f9('0x1')],'allowNull':![],'unique':_0x47f9('0x2')},'description':{'type':Sequelize[_0x47f9('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 2d33b7e..1bac105 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 _0x1f6a=['./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','CustomDashboards','UserProfileResource','then','error','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','Dashboard','includeAll','include','findAll','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','updatedAt','omit','createdAt','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x361026,_0x2375e2){var _0x37028e=function(_0x4f89e0){while(--_0x4f89e0){_0x361026['push'](_0x361026['shift']());}};_0x37028e(++_0x2375e2);}(_0x1f6a,0x15c));var _0xa1f6=function(_0x1280a1,_0x5967cd){_0x1280a1=_0x1280a1-0x0;var _0x240d6f=_0x1f6a[_0x1280a1];return _0x240d6f;};'use strict';var pdf=require(_0xa1f6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa1f6('0x1'));var zipdir=require(_0xa1f6('0x2'));var jsonpatch=require(_0xa1f6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa1f6('0x4'));var Mustache=require(_0xa1f6('0x5'));var util=require(_0xa1f6('0x6'));var path=require(_0xa1f6('0x7'));var sox=require(_0xa1f6('0x8'));var csv=require('to-csv');var ejs=require(_0xa1f6('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa1f6('0xa'));var crypto=require('crypto');var jsforce=require(_0xa1f6('0xb'));var deskjs=require(_0xa1f6('0xc'));var toCsv=require(_0xa1f6('0xd'));var querystring=require('querystring');var Papa=require(_0xa1f6('0xe'));var Redis=require(_0xa1f6('0xf'));var authService=require(_0xa1f6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa1f6('0x11'));var hardwareService=require(_0xa1f6('0x12'));var logger=require(_0xa1f6('0x13'))('api');var utils=require(_0xa1f6('0x14'));var config=require(_0xa1f6('0x15'));var db=require(_0xa1f6('0x16'))['db'];config[_0xa1f6('0x17')]=_[_0xa1f6('0x18')](config[_0xa1f6('0x17')],{'host':_0xa1f6('0x19'),'port':0x18eb});var socket=require(_0xa1f6('0x1a'))(new Redis(config[_0xa1f6('0x17')]));require(_0xa1f6('0x1b'))[_0xa1f6('0x1c')](socket);function respondWithStatusCode(_0x284e69,_0x5e93dc){_0x5e93dc=_0x5e93dc||0xcc;return function(_0x5c8a55){if(_0x5c8a55){return _0x284e69[_0xa1f6('0x1d')](_0x5e93dc);}return _0x284e69[_0xa1f6('0x1e')](_0x5e93dc)[_0xa1f6('0x1f')]();};}function respondWithResult(_0x10b9b8,_0x523bf8){_0x523bf8=_0x523bf8||0xc8;return function(_0x28d531){if(_0x28d531){return _0x10b9b8[_0xa1f6('0x1e')](_0x523bf8)[_0xa1f6('0x20')](_0x28d531);}};}function respondWithFilteredResult(_0x5fd998,_0x2255e3){return function(_0x404134){if(_0x404134){var _0x2cf450=_0x404134[_0xa1f6('0x21')],_0x10e9e2=_0x2255e3[_0xa1f6('0x22')],_0x3273b3=_0x2255e3[_0xa1f6('0x22')]+_0x2255e3[_0xa1f6('0x23')],_0x36c527;if(_0x3273b3>=_0x2cf450){_0x3273b3=_0x2cf450;_0x36c527=0xc8;}else{_0x36c527=0xce;}_0x5fd998[_0xa1f6('0x1e')](_0x36c527);return _0x5fd998[_0xa1f6('0x24')](_0xa1f6('0x25'),_0x10e9e2+'-'+_0x3273b3+'/'+_0x2cf450)[_0xa1f6('0x20')](_0x404134);}return null;};}function patchUpdates(_0x2c8fea){return function(_0x1e41c9){try{jsonpatch['apply'](_0x1e41c9,_0x2c8fea,!![]);}catch(_0x276148){return BPromise[_0xa1f6('0x26')](_0x276148);}return _0x1e41c9[_0xa1f6('0x27')]();};}function saveUpdates(_0x5d4971,_0x1ed4ab){return function(_0x21147d){if(_0x21147d){return _0x21147d[_0xa1f6('0x28')](_0x5d4971)['then'](function(_0x36722f){return _0x36722f;});}return null;};}function removeEntity(_0x46706c,_0x4bdc17){return function(_0x17b1ae){if(_0x17b1ae){return _0x17b1ae[_0xa1f6('0x29')]()['then'](function(){var _0x10a77e=_0x17b1ae[_0xa1f6('0x2a')]({'plain':!![]});var _0x335678=_0xa1f6('0x2b');return db[_0xa1f6('0x2c')][_0xa1f6('0x29')]({'where':{'type':_0x335678,'resourceId':_0x10a77e['id']}})[_0xa1f6('0x2d')](function(){return _0x17b1ae;});})[_0xa1f6('0x2d')](function(){_0x46706c[_0xa1f6('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x275a1d,_0x4611dc){return function(_0x2d5c5f){if(!_0x2d5c5f){_0x275a1d[_0xa1f6('0x1d')](0x194);}return _0x2d5c5f;};}function handleError(_0x2d37a1,_0x2a2fe8){_0x2a2fe8=_0x2a2fe8||0x1f4;return function(_0x52cd3d){logger[_0xa1f6('0x2e')](_0x52cd3d[_0xa1f6('0x2f')]);if(_0x52cd3d[_0xa1f6('0x30')]){delete _0x52cd3d[_0xa1f6('0x30')];}_0x2d37a1[_0xa1f6('0x1e')](_0x2a2fe8)[_0xa1f6('0x31')](_0x52cd3d);};}exports[_0xa1f6('0x32')]=function(_0x5ec811,_0xa1258f){var _0x39f10e={},_0x1bd855={},_0x448da9={'count':0x0,'rows':[]};var _0x51d7d1=_['map'](db['Dashboard'][_0xa1f6('0x33')],function(_0x48d831){return{'name':_0x48d831[_0xa1f6('0x34')],'type':_0x48d831['type'][_0xa1f6('0x35')]};});_0x1bd855[_0xa1f6('0x36')]=_[_0xa1f6('0x37')](_0x51d7d1,_0xa1f6('0x30'));_0x1bd855[_0xa1f6('0x38')]=_[_0xa1f6('0x39')](_0x5ec811[_0xa1f6('0x38')]);_0x1bd855[_0xa1f6('0x3a')]=_[_0xa1f6('0x3b')](_0x1bd855['model'],_0x1bd855[_0xa1f6('0x38')]);_0x39f10e[_0xa1f6('0x3c')]=_['intersection'](_0x1bd855[_0xa1f6('0x36')],qs['fields'](_0x5ec811[_0xa1f6('0x38')][_0xa1f6('0x3d')]));_0x39f10e['attributes']=_0x39f10e[_0xa1f6('0x3c')][_0xa1f6('0x3e')]?_0x39f10e['attributes']:_0x1bd855[_0xa1f6('0x36')];if(!_0x5ec811[_0xa1f6('0x38')]['hasOwnProperty'](_0xa1f6('0x3f'))){_0x39f10e['limit']=qs[_0xa1f6('0x23')](_0x5ec811[_0xa1f6('0x38')]['limit']);_0x39f10e['offset']=qs[_0xa1f6('0x22')](_0x5ec811['query'][_0xa1f6('0x22')]);}_0x39f10e[_0xa1f6('0x40')]=qs[_0xa1f6('0x41')](_0x5ec811['query'][_0xa1f6('0x41')]);_0x39f10e[_0xa1f6('0x42')]=qs[_0xa1f6('0x3a')](_[_0xa1f6('0x43')](_0x5ec811['query'],_0x1bd855[_0xa1f6('0x3a')]),_0x51d7d1);if(_0x5ec811[_0xa1f6('0x38')][_0xa1f6('0x44')]){_0x39f10e[_0xa1f6('0x42')]=_[_0xa1f6('0x45')](_0x39f10e[_0xa1f6('0x42')],{'$or':_['map'](_0x51d7d1,function(_0x1f801b){if(_0x1f801b[_0xa1f6('0x46')]!==_0xa1f6('0x47')){var _0x4f6b85={};_0x4f6b85[_0x1f801b['name']]={'$like':'%'+_0x5ec811[_0xa1f6('0x38')]['filter']+'%'};return _0x4f6b85;}})});}_0x39f10e=_[_0xa1f6('0x45')]({},_0x39f10e,_0x5ec811['options']);var _0x159f94={'where':_0x39f10e[_0xa1f6('0x42')]};return db[_0xa1f6('0x48')][_0xa1f6('0x21')](_0x159f94)[_0xa1f6('0x2d')](function(_0x140606){_0x448da9[_0xa1f6('0x21')]=_0x140606;if(_0x5ec811[_0xa1f6('0x38')][_0xa1f6('0x49')]){_0x39f10e[_0xa1f6('0x4a')]=[{'all':!![]}];}return db[_0xa1f6('0x48')][_0xa1f6('0x4b')](_0x39f10e);})[_0xa1f6('0x2d')](function(_0x25745e){_0x448da9['rows']=_0x25745e;return _0x448da9;})['then'](respondWithFilteredResult(_0xa1258f,_0x39f10e))[_0xa1f6('0x4c')](handleError(_0xa1258f,null));};exports[_0xa1f6('0x4d')]=function(_0x2feb5b,_0xc4a5f2){var _0xb3916f={'raw':![],'where':{'id':_0x2feb5b[_0xa1f6('0x4e')]['id']}},_0x475b9a={};_0x475b9a[_0xa1f6('0x36')]=_['keys'](db[_0xa1f6('0x48')][_0xa1f6('0x33')]);_0x475b9a[_0xa1f6('0x38')]=_[_0xa1f6('0x39')](_0x2feb5b[_0xa1f6('0x38')]);_0x475b9a[_0xa1f6('0x3a')]=_[_0xa1f6('0x3b')](_0x475b9a[_0xa1f6('0x36')],_0x475b9a[_0xa1f6('0x38')]);_0xb3916f['attributes']=_[_0xa1f6('0x3b')](_0x475b9a[_0xa1f6('0x36')],qs['fields'](_0x2feb5b[_0xa1f6('0x38')]['fields']));_0xb3916f[_0xa1f6('0x3c')]=_0xb3916f['attributes']['length']?_0xb3916f['attributes']:_0x475b9a[_0xa1f6('0x36')];if(_0x2feb5b[_0xa1f6('0x38')][_0xa1f6('0x49')]){_0xb3916f[_0xa1f6('0x4a')]=[{'all':!![]}];}_0xb3916f=_['merge']({},_0xb3916f,_0x2feb5b[_0xa1f6('0x4f')]);return db[_0xa1f6('0x48')][_0xa1f6('0x50')](_0xb3916f)[_0xa1f6('0x2d')](handleEntityNotFound(_0xc4a5f2,null))['then'](respondWithResult(_0xc4a5f2,null))[_0xa1f6('0x4c')](handleError(_0xc4a5f2,null));};exports[_0xa1f6('0x51')]=function(_0x4f6c72,_0x20e5e2){return db[_0xa1f6('0x48')][_0xa1f6('0x51')](_0x4f6c72[_0xa1f6('0x52')],{})[_0xa1f6('0x2d')](function(_0x327db2){var _0x3d580e=_0x4f6c72[_0xa1f6('0x53')][_0xa1f6('0x2a')]({'plain':!![]});if(!_0x3d580e)throw new Error(_0xa1f6('0x54'));if(_0x3d580e['role']==='user'){var _0x22455b=_0x327db2['get']({'plain':!![]});var _0x307bd4=_0xa1f6('0x2b');return db['UserProfileSection'][_0xa1f6('0x50')]({'where':{'name':_0x307bd4,'userProfileId':_0x3d580e[_0xa1f6('0x55')]},'raw':!![]})[_0xa1f6('0x2d')](function(_0x5da7c4){if(_0x5da7c4&&_0x5da7c4['autoAssociation']===0x0){return db[_0xa1f6('0x2c')]['create']({'name':_0x22455b[_0xa1f6('0x30')],'resourceId':_0x22455b['id'],'type':_0x5da7c4[_0xa1f6('0x30')],'sectionId':_0x5da7c4['id']},{})[_0xa1f6('0x2d')](function(){return _0x327db2;});}else{return _0x327db2;}})[_0xa1f6('0x4c')](function(_0x3f7b20){logger[_0xa1f6('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f7b20);throw _0x3f7b20;});}return _0x327db2;})['then'](respondWithResult(_0x20e5e2,0xc9))['catch'](handleError(_0x20e5e2,null));};exports['clone']=function(_0x421525,_0x1b1143){var _0x5843f1={'where':{'id':_0x421525['params']['id']}},_0x314844={};_0x314844[_0xa1f6('0x36')]=_[_0xa1f6('0x39')](db[_0xa1f6('0x48')][_0xa1f6('0x33')]);_0x5843f1[_0xa1f6('0x3c')]=_['intersection'](_0x314844[_0xa1f6('0x36')],qs['fields'](_0x421525[_0xa1f6('0x38')]['fields']));_0x5843f1[_0xa1f6('0x3c')]=_0x5843f1[_0xa1f6('0x3c')][_0xa1f6('0x3e')]?_0x5843f1['attributes']:_0x314844[_0xa1f6('0x36')];if(_0x421525[_0xa1f6('0x38')][_0xa1f6('0x49')]){_0x5843f1[_0xa1f6('0x4a')]=[{'all':!![]}];}_0x5843f1=_[_0xa1f6('0x45')]({},_0x5843f1,_0x421525[_0xa1f6('0x4f')]);return db['Dashboard'][_0xa1f6('0x50')](_0x5843f1)[_0xa1f6('0x2d')](handleEntityNotFound(_0x1b1143,null))['then'](function(_0x792899){if(_0x792899){var _0x5d2fc6=_0x792899['get']({'plain':!![]});_0x5d2fc6=qs['omit'](_0x5d2fc6,['id','createdAt',_0xa1f6('0x56')]);_0x421525[_0xa1f6('0x52')]=_[_0xa1f6('0x57')](_0x421525[_0xa1f6('0x52')],['id',_0xa1f6('0x58'),_0xa1f6('0x56')]);return db['Dashboard']['create'](_[_0xa1f6('0x45')](_0x5d2fc6,_0x421525[_0xa1f6('0x52')]),{'include':_0x421525[_0xa1f6('0x38')]['includeAll']?[{'all':!![]}]:undefined})[_0xa1f6('0x2d')](function(_0x221a7a){var _0x231434=_0x421525[_0xa1f6('0x53')][_0xa1f6('0x2a')]({'plain':!![]});if(!_0x231434)throw new Error(_0xa1f6('0x54'));if(_0x231434[_0xa1f6('0x59')]===_0xa1f6('0x53')){var _0x2dc2d1=_0x221a7a[_0xa1f6('0x2a')]({'plain':!![]});var _0x545284=_0xa1f6('0x2b');return db[_0xa1f6('0x5a')][_0xa1f6('0x50')]({'where':{'name':_0x545284,'userProfileId':_0x231434[_0xa1f6('0x55')]},'raw':!![]})['then'](function(_0x3f5caa){if(_0x3f5caa&&_0x3f5caa[_0xa1f6('0x5b')]===0x0){return db[_0xa1f6('0x2c')][_0xa1f6('0x51')]({'name':_0x2dc2d1[_0xa1f6('0x30')],'resourceId':_0x2dc2d1['id'],'type':_0x3f5caa[_0xa1f6('0x30')],'sectionId':_0x3f5caa['id']},{})[_0xa1f6('0x2d')](function(){return _0x221a7a;});}else{return _0x221a7a;}})[_0xa1f6('0x4c')](function(_0x54db00){logger[_0xa1f6('0x2e')](_0xa1f6('0x5c'),_0x54db00);throw _0x54db00;});}return _0x221a7a;});}})['then'](respondWithResult(_0x1b1143,0xc9))['catch'](handleError(_0x1b1143,null));};exports['update']=function(_0x33d4a1,_0x577fcb){if(_0x33d4a1[_0xa1f6('0x52')]['id']){delete _0x33d4a1['body']['id'];}return db[_0xa1f6('0x48')][_0xa1f6('0x50')]({'where':{'id':_0x33d4a1['params']['id']}})[_0xa1f6('0x2d')](handleEntityNotFound(_0x577fcb,null))[_0xa1f6('0x2d')](saveUpdates(_0x33d4a1[_0xa1f6('0x52')],null))[_0xa1f6('0x2d')](respondWithResult(_0x577fcb,null))[_0xa1f6('0x4c')](handleError(_0x577fcb,null));};exports[_0xa1f6('0x29')]=function(_0x160c31,_0x20065b){return db[_0xa1f6('0x48')][_0xa1f6('0x50')]({'where':{'id':_0x160c31[_0xa1f6('0x4e')]['id']}})[_0xa1f6('0x2d')](handleEntityNotFound(_0x20065b,null))[_0xa1f6('0x2d')](removeEntity(_0x20065b,null))[_0xa1f6('0x4c')](handleError(_0x20065b,null));};function widgetAttributes(_0x5b83c6){try{switch(_0x5b83c6['type']){case _0xa1f6('0x5d'):return[{'name':_0xa1f6('0x5e'),'value':_0x5b83c6[_0xa1f6('0x5e')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6[_0xa1f6('0x5f')][0x0]?_0x5b83c6['attrs'][0x0][_0xa1f6('0x60')]:undefined)||_0xa1f6('0x61')}];case'custom':return[{'name':_0xa1f6('0x62'),'value':_0x5b83c6['attrPath']||(_0x5b83c6['attrs']&&_0x5b83c6[_0xa1f6('0x5f')][0x0]?_0x5b83c6[_0xa1f6('0x5f')][0x0][_0xa1f6('0x60')]:undefined)||''}];case _0xa1f6('0x63'):return[{'name':'attrHourFormat','value':_0x5b83c6[_0xa1f6('0x64')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6[_0xa1f6('0x5f')][0x0]?_0x5b83c6['attrs'][0x0][_0xa1f6('0x60')]:undefined)||_0xa1f6('0x65')},{'name':'attrTimezone','value':_0x5b83c6[_0xa1f6('0x66')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6[_0xa1f6('0x5f')][0x1]?_0x5b83c6[_0xa1f6('0x5f')][0x1]['value']:undefined)||_0xa1f6('0x67')},{'name':_0xa1f6('0x68'),'value':_0x5b83c6[_0xa1f6('0x68')]||(_0x5b83c6['attrs']&&_0x5b83c6[_0xa1f6('0x5f')][0x2]?_0x5b83c6[_0xa1f6('0x5f')][0x2][_0xa1f6('0x60')]:undefined)||0xc}];case'counter':return[{'name':_0xa1f6('0x69'),'value':_0x5b83c6[_0xa1f6('0x69')]||(_0x5b83c6['attrs']&&_0x5b83c6['attrs'][0x0]?_0x5b83c6[_0xa1f6('0x5f')][0x0][_0xa1f6('0x60')]:undefined)||_0xa1f6('0x6a')},{'name':_0xa1f6('0x6b'),'value':_0x5b83c6['attrVoiceQueues']||(_0x5b83c6['attrs']&&_0x5b83c6['attrs'][0x1]?_0x5b83c6['attrs'][0x1][_0xa1f6('0x60')]:undefined)||[]},{'name':_0xa1f6('0x68'),'value':_0x5b83c6[_0xa1f6('0x68')]||(_0x5b83c6['attrs']&&_0x5b83c6['attrs'][0x2]?_0x5b83c6[_0xa1f6('0x5f')][0x2][_0xa1f6('0x60')]:undefined)||0x14}];case _0xa1f6('0x6c'):case _0xa1f6('0x6d'):return[{'name':_0xa1f6('0x6e'),'value':_0x5b83c6[_0xa1f6('0x6e')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6[_0xa1f6('0x5f')][0x0]?_0x5b83c6[_0xa1f6('0x5f')][0x0]['value']:undefined)||'total'},{'name':_0xa1f6('0x6f'),'value':_0x5b83c6[_0xa1f6('0x6f')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6[_0xa1f6('0x5f')][0x1]?_0x5b83c6['attrs'][0x1]['value']:undefined)||null},{'name':_0xa1f6('0x70'),'value':_0x5b83c6[_0xa1f6('0x70')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6['attrs'][0x2]?_0x5b83c6[_0xa1f6('0x5f')][0x2]['value']:undefined)||null},{'name':_0xa1f6('0x6b'),'value':_0x5b83c6[_0xa1f6('0x6b')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6['attrs'][0x3]?_0x5b83c6[_0xa1f6('0x5f')][0x3]['value']:undefined)||[]}];case _0xa1f6('0x71'):return[{'name':_0xa1f6('0x72'),'type':_0x5b83c6[_0xa1f6('0x73')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6[_0xa1f6('0x5f')][0x0]?_0x5b83c6[_0xa1f6('0x5f')][0x0]['type']:undefined)||null,'value':_0x5b83c6[_0xa1f6('0x72')]||(_0x5b83c6[_0xa1f6('0x5f')]&&_0x5b83c6['attrs'][0x0]?_0x5b83c6[_0xa1f6('0x5f')][0x0][_0xa1f6('0x60')]:undefined)||null},{'name':_0xa1f6('0x74'),'value':_0x5b83c6[_0xa1f6('0x74')]||(_0x5b83c6['attrs']&&_0x5b83c6[_0xa1f6('0x5f')][0x1]?_0x5b83c6[_0xa1f6('0x5f')][0x1][_0xa1f6('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x2dae1a){logger[_0xa1f6('0x2e')](_0xa1f6('0x75'),JSON[_0xa1f6('0x76')](_0x2dae1a));return[];}}exports[_0xa1f6('0x77')]=function(_0x3ddb61,_0x45c93f,_0x5a9e14){if(_0x3ddb61[_0xa1f6('0x52')]['id']){delete _0x3ddb61[_0xa1f6('0x52')]['id'];}return db[_0xa1f6('0x48')][_0xa1f6('0x50')]({'where':{'id':_0x3ddb61['params']['id']}})[_0xa1f6('0x2d')](handleEntityNotFound(_0x45c93f,null))[_0xa1f6('0x2d')](function(_0x7e8180){if(_0x7e8180){_0x3ddb61[_0xa1f6('0x52')][_0xa1f6('0x78')]=_0x7e8180['id'];_0x3ddb61[_0xa1f6('0x52')][_0xa1f6('0x5f')]=widgetAttributes(_0x3ddb61[_0xa1f6('0x52')]);return db[_0xa1f6('0x79')][_0xa1f6('0x51')](_0x3ddb61['body']);}})[_0xa1f6('0x2d')](respondWithResult(_0x45c93f,null))['catch'](handleError(_0x45c93f,null));};exports[_0xa1f6('0x7a')]=function(_0xbb094b,_0x2bd1f9,_0x53ec5f){var _0x5609a6={};var _0x186d19={};var _0x37a8b8;var _0x3f4f76;return db['Dashboard'][_0xa1f6('0x7b')]({'where':{'id':_0xbb094b[_0xa1f6('0x4e')]['id']}})[_0xa1f6('0x2d')](handleEntityNotFound(_0x2bd1f9,null))[_0xa1f6('0x2d')](function(_0x2ab28a){if(_0x2ab28a){_0x37a8b8=_0x2ab28a;_0x186d19['model']=_[_0xa1f6('0x39')](db[_0xa1f6('0x79')][_0xa1f6('0x33')]);_0x186d19[_0xa1f6('0x38')]=_['keys'](_0xbb094b['query']);_0x186d19[_0xa1f6('0x3a')]=_[_0xa1f6('0x3b')](_0x186d19[_0xa1f6('0x36')],_0x186d19['query']);_0x5609a6['attributes']=_[_0xa1f6('0x3b')](_0x186d19['model'],qs[_0xa1f6('0x3d')](_0xbb094b[_0xa1f6('0x38')][_0xa1f6('0x3d')]));_0x5609a6['attributes']=_0x5609a6[_0xa1f6('0x3c')]['length']?_0x5609a6[_0xa1f6('0x3c')]:_0x186d19['model'];_0x5609a6[_0xa1f6('0x40')]=qs[_0xa1f6('0x41')](_0xbb094b[_0xa1f6('0x38')]['sort']);_0x5609a6[_0xa1f6('0x42')]=qs[_0xa1f6('0x3a')](_[_0xa1f6('0x43')](_0xbb094b[_0xa1f6('0x38')],_0x186d19['filters']));if(_0xbb094b[_0xa1f6('0x38')]['filter']){_0x5609a6[_0xa1f6('0x42')]=_[_0xa1f6('0x45')](_0x5609a6[_0xa1f6('0x42')],{'$or':_[_0xa1f6('0x37')](_0x5609a6[_0xa1f6('0x3c')],function(_0x34bf58){var _0x2a5663={};_0x2a5663[_0x34bf58]={'$like':'%'+_0xbb094b[_0xa1f6('0x38')][_0xa1f6('0x44')]+'%'};return _0x2a5663;})});}_0x5609a6=_['merge']({},_0x5609a6,_0xbb094b['options']);return _0x37a8b8[_0xa1f6('0x7a')](_0x5609a6);}})[_0xa1f6('0x2d')](function(_0x4d2804){if(_0x4d2804){_0x3f4f76=_0x4d2804[_0xa1f6('0x3e')];if(!_0xbb094b[_0xa1f6('0x38')][_0xa1f6('0x7c')](_0xa1f6('0x3f'))){_0x5609a6[_0xa1f6('0x23')]=qs[_0xa1f6('0x23')](_0xbb094b[_0xa1f6('0x38')][_0xa1f6('0x23')]);_0x5609a6['offset']=qs['offset'](_0xbb094b[_0xa1f6('0x38')][_0xa1f6('0x22')]);}return _0x37a8b8[_0xa1f6('0x7a')](_0x5609a6);}})[_0xa1f6('0x2d')](function(_0x1636e6){if(_0x1636e6){return _0x1636e6?{'count':_0x3f4f76,'rows':_0x1636e6}:null;}})[_0xa1f6('0x2d')](respondWithResult(_0x2bd1f9,null))['catch'](handleError(_0x2bd1f9,null));}; \ No newline at end of file +var _0xb4b2=['attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','pick','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','count','offset','limit','Content-Range','json','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','Dashboard','find','create','body','user','UserProfileSection','autoAssociation','clone','include','createdAt','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3e8be9,_0x50ab41){var _0x5f083e=function(_0x386ce0){while(--_0x386ce0){_0x3e8be9['push'](_0x3e8be9['shift']());}};_0x5f083e(++_0x50ab41);}(_0xb4b2,0x9e));var _0x2b4b=function(_0x2f0d37,_0x1cc0ce){_0x2f0d37=_0x2f0d37-0x0;var _0x1c0a00=_0xb4b2[_0x2f0d37];return _0x1c0a00;};'use strict';var pdf=require(_0x2b4b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2b4b('0x1'));var zipdir=require(_0x2b4b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b4b('0x3'));var moment=require(_0x2b4b('0x4'));var BPromise=require(_0x2b4b('0x5'));var Mustache=require(_0x2b4b('0x6'));var util=require(_0x2b4b('0x7'));var path=require(_0x2b4b('0x8'));var sox=require(_0x2b4b('0x9'));var csv=require(_0x2b4b('0xa'));var ejs=require(_0x2b4b('0xb'));var fs=require('fs');var _=require(_0x2b4b('0xc'));var squel=require(_0x2b4b('0xd'));var crypto=require('crypto');var jsforce=require(_0x2b4b('0xe'));var deskjs=require(_0x2b4b('0xf'));var toCsv=require(_0x2b4b('0xa'));var querystring=require(_0x2b4b('0x10'));var Papa=require(_0x2b4b('0x11'));var Redis=require(_0x2b4b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x2b4b('0x13'));var as=require(_0x2b4b('0x14'));var hardwareService=require(_0x2b4b('0x15'));var logger=require(_0x2b4b('0x16'))(_0x2b4b('0x17'));var utils=require(_0x2b4b('0x18'));var config=require(_0x2b4b('0x19'));var db=require(_0x2b4b('0x1a'))['db'];config[_0x2b4b('0x1b')]=_[_0x2b4b('0x1c')](config[_0x2b4b('0x1b')],{'host':_0x2b4b('0x1d'),'port':0x18eb});var socket=require(_0x2b4b('0x1e'))(new Redis(config['redis']));require(_0x2b4b('0x1f'))['register'](socket);function respondWithStatusCode(_0xd580d0,_0x2bd706){_0x2bd706=_0x2bd706||0xcc;return function(_0x1fb735){if(_0x1fb735){return _0xd580d0[_0x2b4b('0x20')](_0x2bd706);}return _0xd580d0[_0x2b4b('0x21')](_0x2bd706)['end']();};}function respondWithResult(_0x49b598,_0x541f3c){_0x541f3c=_0x541f3c||0xc8;return function(_0x58f3cb){if(_0x58f3cb){return _0x49b598[_0x2b4b('0x21')](_0x541f3c)['json'](_0x58f3cb);}};}function respondWithFilteredResult(_0x166fa0,_0xbd74ef){return function(_0x44f581){if(_0x44f581){var _0x526e7e=_0x44f581[_0x2b4b('0x22')],_0x307c20=_0xbd74ef['offset'],_0x23014b=_0xbd74ef[_0x2b4b('0x23')]+_0xbd74ef[_0x2b4b('0x24')],_0x20a2a8;if(_0x23014b>=_0x526e7e){_0x23014b=_0x526e7e;_0x20a2a8=0xc8;}else{_0x20a2a8=0xce;}_0x166fa0[_0x2b4b('0x21')](_0x20a2a8);return _0x166fa0['set'](_0x2b4b('0x25'),_0x307c20+'-'+_0x23014b+'/'+_0x526e7e)[_0x2b4b('0x26')](_0x44f581);}return null;};}function patchUpdates(_0x31d663){return function(_0x341cbc){try{jsonpatch['apply'](_0x341cbc,_0x31d663,!![]);}catch(_0x4865e6){return BPromise['reject'](_0x4865e6);}return _0x341cbc[_0x2b4b('0x27')]();};}function saveUpdates(_0x38dc4b,_0x3f030e){return function(_0x19fc8a){if(_0x19fc8a){return _0x19fc8a[_0x2b4b('0x28')](_0x38dc4b)[_0x2b4b('0x29')](function(_0x32ae72){return _0x32ae72;});}return null;};}function removeEntity(_0x256994,_0x36ea63){return function(_0xf45ac1){if(_0xf45ac1){return _0xf45ac1[_0x2b4b('0x2a')]()[_0x2b4b('0x29')](function(){var _0x4acf9f=_0xf45ac1[_0x2b4b('0x2b')]({'plain':!![]});var _0xc04689=_0x2b4b('0x2c');return db[_0x2b4b('0x2d')][_0x2b4b('0x2a')]({'where':{'type':_0xc04689,'resourceId':_0x4acf9f['id']}})[_0x2b4b('0x29')](function(){return _0xf45ac1;});})[_0x2b4b('0x29')](function(){_0x256994[_0x2b4b('0x21')](0xcc)[_0x2b4b('0x2e')]();});}};}function handleEntityNotFound(_0x478328,_0x5468b7){return function(_0x1ebf2a){if(!_0x1ebf2a){_0x478328[_0x2b4b('0x20')](0x194);}return _0x1ebf2a;};}function handleError(_0x51b1cf,_0x20baaa){_0x20baaa=_0x20baaa||0x1f4;return function(_0x3e276e){logger[_0x2b4b('0x2f')](_0x3e276e[_0x2b4b('0x30')]);if(_0x3e276e[_0x2b4b('0x31')]){delete _0x3e276e[_0x2b4b('0x31')];}_0x51b1cf[_0x2b4b('0x21')](_0x20baaa)[_0x2b4b('0x32')](_0x3e276e);};}exports[_0x2b4b('0x33')]=function(_0xafe645,_0x3cce9d){var _0x1da8d3={},_0x1d6bfa={},_0x501cc2={'count':0x0,'rows':[]};var _0x176482=_[_0x2b4b('0x34')](db['Dashboard'][_0x2b4b('0x35')],function(_0x11382d){return{'name':_0x11382d['fieldName'],'type':_0x11382d[_0x2b4b('0x36')]['key']};});_0x1d6bfa[_0x2b4b('0x37')]=_[_0x2b4b('0x34')](_0x176482,_0x2b4b('0x31'));_0x1d6bfa[_0x2b4b('0x38')]=_[_0x2b4b('0x39')](_0xafe645[_0x2b4b('0x38')]);_0x1d6bfa['filters']=_[_0x2b4b('0x3a')](_0x1d6bfa[_0x2b4b('0x37')],_0x1d6bfa[_0x2b4b('0x38')]);_0x1da8d3[_0x2b4b('0x3b')]=_[_0x2b4b('0x3a')](_0x1d6bfa[_0x2b4b('0x37')],qs[_0x2b4b('0x3c')](_0xafe645['query'][_0x2b4b('0x3c')]));_0x1da8d3[_0x2b4b('0x3b')]=_0x1da8d3[_0x2b4b('0x3b')][_0x2b4b('0x3d')]?_0x1da8d3[_0x2b4b('0x3b')]:_0x1d6bfa['model'];if(!_0xafe645[_0x2b4b('0x38')][_0x2b4b('0x3e')](_0x2b4b('0x3f'))){_0x1da8d3[_0x2b4b('0x24')]=qs[_0x2b4b('0x24')](_0xafe645[_0x2b4b('0x38')][_0x2b4b('0x24')]);_0x1da8d3[_0x2b4b('0x23')]=qs[_0x2b4b('0x23')](_0xafe645[_0x2b4b('0x38')][_0x2b4b('0x23')]);}_0x1da8d3['order']=qs[_0x2b4b('0x40')](_0xafe645[_0x2b4b('0x38')][_0x2b4b('0x40')]);_0x1da8d3['where']=qs[_0x2b4b('0x41')](_['pick'](_0xafe645[_0x2b4b('0x38')],_0x1d6bfa[_0x2b4b('0x41')]),_0x176482);if(_0xafe645[_0x2b4b('0x38')]['filter']){_0x1da8d3['where']=_[_0x2b4b('0x42')](_0x1da8d3[_0x2b4b('0x43')],{'$or':_[_0x2b4b('0x34')](_0x176482,function(_0x3fc30b){if(_0x3fc30b[_0x2b4b('0x36')]!==_0x2b4b('0x44')){var _0x275a0a={};_0x275a0a[_0x3fc30b[_0x2b4b('0x31')]]={'$like':'%'+_0xafe645['query'][_0x2b4b('0x45')]+'%'};return _0x275a0a;}})});}_0x1da8d3=_[_0x2b4b('0x42')]({},_0x1da8d3,_0xafe645[_0x2b4b('0x46')]);var _0x131d3b={'where':_0x1da8d3[_0x2b4b('0x43')]};return db['Dashboard']['count'](_0x131d3b)[_0x2b4b('0x29')](function(_0xdca9c1){_0x501cc2[_0x2b4b('0x22')]=_0xdca9c1;if(_0xafe645[_0x2b4b('0x38')][_0x2b4b('0x47')]){_0x1da8d3['include']=[{'all':!![]}];}return db['Dashboard'][_0x2b4b('0x48')](_0x1da8d3);})['then'](function(_0x4fad13){_0x501cc2[_0x2b4b('0x49')]=_0x4fad13;return _0x501cc2;})[_0x2b4b('0x29')](respondWithFilteredResult(_0x3cce9d,_0x1da8d3))[_0x2b4b('0x4a')](handleError(_0x3cce9d,null));};exports['show']=function(_0x48d25e,_0x47cb77){var _0x2be41e={'raw':![],'where':{'id':_0x48d25e[_0x2b4b('0x4b')]['id']}},_0x54f8c1={};_0x54f8c1[_0x2b4b('0x37')]=_['keys'](db['Dashboard'][_0x2b4b('0x35')]);_0x54f8c1[_0x2b4b('0x38')]=_['keys'](_0x48d25e[_0x2b4b('0x38')]);_0x54f8c1[_0x2b4b('0x41')]=_[_0x2b4b('0x3a')](_0x54f8c1['model'],_0x54f8c1[_0x2b4b('0x38')]);_0x2be41e[_0x2b4b('0x3b')]=_[_0x2b4b('0x3a')](_0x54f8c1[_0x2b4b('0x37')],qs['fields'](_0x48d25e[_0x2b4b('0x38')][_0x2b4b('0x3c')]));_0x2be41e[_0x2b4b('0x3b')]=_0x2be41e[_0x2b4b('0x3b')][_0x2b4b('0x3d')]?_0x2be41e[_0x2b4b('0x3b')]:_0x54f8c1[_0x2b4b('0x37')];if(_0x48d25e[_0x2b4b('0x38')][_0x2b4b('0x47')]){_0x2be41e['include']=[{'all':!![]}];}_0x2be41e=_[_0x2b4b('0x42')]({},_0x2be41e,_0x48d25e[_0x2b4b('0x46')]);return db[_0x2b4b('0x4c')][_0x2b4b('0x4d')](_0x2be41e)[_0x2b4b('0x29')](handleEntityNotFound(_0x47cb77,null))[_0x2b4b('0x29')](respondWithResult(_0x47cb77,null))[_0x2b4b('0x4a')](handleError(_0x47cb77,null));};exports['create']=function(_0x3ebd99,_0x1f829f){return db[_0x2b4b('0x4c')][_0x2b4b('0x4e')](_0x3ebd99[_0x2b4b('0x4f')],{})[_0x2b4b('0x29')](function(_0x21cb46){var _0x412736=_0x3ebd99[_0x2b4b('0x50')]['get']({'plain':!![]});if(!_0x412736)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x412736['role']===_0x2b4b('0x50')){var _0x462a56=_0x21cb46[_0x2b4b('0x2b')]({'plain':!![]});var _0x478867=_0x2b4b('0x2c');return db[_0x2b4b('0x51')][_0x2b4b('0x4d')]({'where':{'name':_0x478867,'userProfileId':_0x412736['userProfileId']},'raw':!![]})[_0x2b4b('0x29')](function(_0x59c9ac){if(_0x59c9ac&&_0x59c9ac[_0x2b4b('0x52')]===0x0){return db[_0x2b4b('0x2d')][_0x2b4b('0x4e')]({'name':_0x462a56['name'],'resourceId':_0x462a56['id'],'type':_0x59c9ac[_0x2b4b('0x31')],'sectionId':_0x59c9ac['id']},{})[_0x2b4b('0x29')](function(){return _0x21cb46;});}else{return _0x21cb46;}})[_0x2b4b('0x4a')](function(_0x502a98){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x502a98);throw _0x502a98;});}return _0x21cb46;})['then'](respondWithResult(_0x1f829f,0xc9))[_0x2b4b('0x4a')](handleError(_0x1f829f,null));};exports[_0x2b4b('0x53')]=function(_0x18b27a,_0x2144f9){var _0x1e1c83={'where':{'id':_0x18b27a[_0x2b4b('0x4b')]['id']}},_0x25de2d={};_0x25de2d[_0x2b4b('0x37')]=_[_0x2b4b('0x39')](db[_0x2b4b('0x4c')]['rawAttributes']);_0x1e1c83[_0x2b4b('0x3b')]=_['intersection'](_0x25de2d['model'],qs[_0x2b4b('0x3c')](_0x18b27a[_0x2b4b('0x38')][_0x2b4b('0x3c')]));_0x1e1c83['attributes']=_0x1e1c83[_0x2b4b('0x3b')][_0x2b4b('0x3d')]?_0x1e1c83[_0x2b4b('0x3b')]:_0x25de2d['model'];if(_0x18b27a[_0x2b4b('0x38')][_0x2b4b('0x47')]){_0x1e1c83[_0x2b4b('0x54')]=[{'all':!![]}];}_0x1e1c83=_[_0x2b4b('0x42')]({},_0x1e1c83,_0x18b27a[_0x2b4b('0x46')]);return db[_0x2b4b('0x4c')][_0x2b4b('0x4d')](_0x1e1c83)[_0x2b4b('0x29')](handleEntityNotFound(_0x2144f9,null))[_0x2b4b('0x29')](function(_0x3d9e6b){if(_0x3d9e6b){var _0x1a6714=_0x3d9e6b[_0x2b4b('0x2b')]({'plain':!![]});_0x1a6714=qs['omit'](_0x1a6714,['id',_0x2b4b('0x55'),'updatedAt']);_0x18b27a['body']=_[_0x2b4b('0x56')](_0x18b27a[_0x2b4b('0x4f')],['id',_0x2b4b('0x55'),_0x2b4b('0x57')]);return db['Dashboard']['create'](_[_0x2b4b('0x42')](_0x1a6714,_0x18b27a[_0x2b4b('0x4f')]),{'include':_0x18b27a['query']['includeAll']?[{'all':!![]}]:undefined})[_0x2b4b('0x29')](function(_0x1b4f32){var _0x136fe6=_0x18b27a[_0x2b4b('0x50')][_0x2b4b('0x2b')]({'plain':!![]});if(!_0x136fe6)throw new Error(_0x2b4b('0x58'));if(_0x136fe6[_0x2b4b('0x59')]===_0x2b4b('0x50')){var _0xf1fbac=_0x1b4f32[_0x2b4b('0x2b')]({'plain':!![]});var _0x51178b=_0x2b4b('0x2c');return db[_0x2b4b('0x51')][_0x2b4b('0x4d')]({'where':{'name':_0x51178b,'userProfileId':_0x136fe6[_0x2b4b('0x5a')]},'raw':!![]})[_0x2b4b('0x29')](function(_0x4c1df0){if(_0x4c1df0&&_0x4c1df0['autoAssociation']===0x0){return db[_0x2b4b('0x2d')][_0x2b4b('0x4e')]({'name':_0xf1fbac[_0x2b4b('0x31')],'resourceId':_0xf1fbac['id'],'type':_0x4c1df0[_0x2b4b('0x31')],'sectionId':_0x4c1df0['id']},{})[_0x2b4b('0x29')](function(){return _0x1b4f32;});}else{return _0x1b4f32;}})[_0x2b4b('0x4a')](function(_0x514069){logger['error'](_0x2b4b('0x5b'),_0x514069);throw _0x514069;});}return _0x1b4f32;});}})[_0x2b4b('0x29')](respondWithResult(_0x2144f9,0xc9))[_0x2b4b('0x4a')](handleError(_0x2144f9,null));};exports[_0x2b4b('0x28')]=function(_0x348e90,_0x271b65){if(_0x348e90['body']['id']){delete _0x348e90['body']['id'];}return db[_0x2b4b('0x4c')][_0x2b4b('0x4d')]({'where':{'id':_0x348e90[_0x2b4b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x271b65,null))[_0x2b4b('0x29')](saveUpdates(_0x348e90[_0x2b4b('0x4f')],null))[_0x2b4b('0x29')](respondWithResult(_0x271b65,null))['catch'](handleError(_0x271b65,null));};exports[_0x2b4b('0x2a')]=function(_0x5032b3,_0x2a1d74){return db['Dashboard'][_0x2b4b('0x4d')]({'where':{'id':_0x5032b3[_0x2b4b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2a1d74,null))[_0x2b4b('0x29')](removeEntity(_0x2a1d74,null))[_0x2b4b('0x4a')](handleError(_0x2a1d74,null));};function widgetAttributes(_0x429f52){try{switch(_0x429f52['type']){case'iframe':return[{'name':'attrUrl','value':_0x429f52[_0x2b4b('0x5c')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x0]?_0x429f52[_0x2b4b('0x5d')][0x0][_0x2b4b('0x5e')]:undefined)||_0x2b4b('0x5f')}];case _0x2b4b('0x60'):return[{'name':_0x2b4b('0x61'),'value':_0x429f52[_0x2b4b('0x61')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x0]?_0x429f52[_0x2b4b('0x5d')][0x0][_0x2b4b('0x5e')]:undefined)||''}];case _0x2b4b('0x62'):return[{'name':_0x2b4b('0x63'),'value':_0x429f52['attrHourFormat']||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52['attrs'][0x0]?_0x429f52[_0x2b4b('0x5d')][0x0]['value']:undefined)||_0x2b4b('0x64')},{'name':_0x2b4b('0x65'),'value':_0x429f52[_0x2b4b('0x65')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x1]?_0x429f52[_0x2b4b('0x5d')][0x1]['value']:undefined)||_0x2b4b('0x66')},{'name':_0x2b4b('0x67'),'value':_0x429f52[_0x2b4b('0x67')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x2]?_0x429f52[_0x2b4b('0x5d')][0x2][_0x2b4b('0x5e')]:undefined)||0xc}];case _0x2b4b('0x68'):return[{'name':'attrMetric','value':_0x429f52[_0x2b4b('0x69')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52['attrs'][0x0]?_0x429f52['attrs'][0x0][_0x2b4b('0x5e')]:undefined)||_0x2b4b('0x6a')},{'name':_0x2b4b('0x6b'),'value':_0x429f52[_0x2b4b('0x6b')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x1]?_0x429f52[_0x2b4b('0x5d')][0x1][_0x2b4b('0x5e')]:undefined)||[]},{'name':_0x2b4b('0x67'),'value':_0x429f52[_0x2b4b('0x67')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52['attrs'][0x2]?_0x429f52[_0x2b4b('0x5d')][0x2]['value']:undefined)||0x14}];case _0x2b4b('0x6c'):case _0x2b4b('0x6d'):return[{'name':_0x2b4b('0x6e'),'value':_0x429f52['attrSerie1']||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x0]?_0x429f52['attrs'][0x0][_0x2b4b('0x5e')]:undefined)||_0x2b4b('0x6a')},{'name':_0x2b4b('0x6f'),'value':_0x429f52[_0x2b4b('0x6f')]||(_0x429f52['attrs']&&_0x429f52[_0x2b4b('0x5d')][0x1]?_0x429f52[_0x2b4b('0x5d')][0x1]['value']:undefined)||null},{'name':_0x2b4b('0x70'),'value':_0x429f52[_0x2b4b('0x70')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x2]?_0x429f52[_0x2b4b('0x5d')][0x2][_0x2b4b('0x5e')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x429f52[_0x2b4b('0x6b')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x3]?_0x429f52['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x429f52[_0x2b4b('0x71')]||(_0x429f52['attrs']&&_0x429f52[_0x2b4b('0x5d')][0x0]?_0x429f52[_0x2b4b('0x5d')][0x0][_0x2b4b('0x36')]:undefined)||null,'value':_0x429f52[_0x2b4b('0x72')]||(_0x429f52['attrs']&&_0x429f52[_0x2b4b('0x5d')][0x0]?_0x429f52['attrs'][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x429f52[_0x2b4b('0x73')]||(_0x429f52[_0x2b4b('0x5d')]&&_0x429f52[_0x2b4b('0x5d')][0x1]?_0x429f52[_0x2b4b('0x5d')][0x1][_0x2b4b('0x5e')]:undefined)||0x0}];default:return[];}}catch(_0x1898aa){logger[_0x2b4b('0x2f')](_0x2b4b('0x74'),JSON[_0x2b4b('0x75')](_0x1898aa));return[];}}exports[_0x2b4b('0x76')]=function(_0x89ed58,_0x544845,_0xdf348c){if(_0x89ed58['body']['id']){delete _0x89ed58[_0x2b4b('0x4f')]['id'];}return db[_0x2b4b('0x4c')]['find']({'where':{'id':_0x89ed58[_0x2b4b('0x4b')]['id']}})[_0x2b4b('0x29')](handleEntityNotFound(_0x544845,null))[_0x2b4b('0x29')](function(_0x42bbb6){if(_0x42bbb6){_0x89ed58[_0x2b4b('0x4f')][_0x2b4b('0x77')]=_0x42bbb6['id'];_0x89ed58[_0x2b4b('0x4f')][_0x2b4b('0x5d')]=widgetAttributes(_0x89ed58['body']);return db[_0x2b4b('0x78')]['create'](_0x89ed58['body']);}})['then'](respondWithResult(_0x544845,null))[_0x2b4b('0x4a')](handleError(_0x544845,null));};exports[_0x2b4b('0x79')]=function(_0x4f1cb1,_0xf5423f,_0xea44df){var _0x42c595={};var _0x294890={};var _0x1ca22b;var _0x2521c2;return db[_0x2b4b('0x4c')][_0x2b4b('0x7a')]({'where':{'id':_0x4f1cb1[_0x2b4b('0x4b')]['id']}})[_0x2b4b('0x29')](handleEntityNotFound(_0xf5423f,null))[_0x2b4b('0x29')](function(_0x1765a2){if(_0x1765a2){_0x1ca22b=_0x1765a2;_0x294890[_0x2b4b('0x37')]=_[_0x2b4b('0x39')](db[_0x2b4b('0x78')]['rawAttributes']);_0x294890['query']=_[_0x2b4b('0x39')](_0x4f1cb1[_0x2b4b('0x38')]);_0x294890[_0x2b4b('0x41')]=_[_0x2b4b('0x3a')](_0x294890[_0x2b4b('0x37')],_0x294890['query']);_0x42c595[_0x2b4b('0x3b')]=_['intersection'](_0x294890[_0x2b4b('0x37')],qs[_0x2b4b('0x3c')](_0x4f1cb1['query'][_0x2b4b('0x3c')]));_0x42c595[_0x2b4b('0x3b')]=_0x42c595['attributes']['length']?_0x42c595[_0x2b4b('0x3b')]:_0x294890[_0x2b4b('0x37')];_0x42c595[_0x2b4b('0x7b')]=qs['sort'](_0x4f1cb1['query'][_0x2b4b('0x40')]);_0x42c595[_0x2b4b('0x43')]=qs[_0x2b4b('0x41')](_[_0x2b4b('0x7c')](_0x4f1cb1[_0x2b4b('0x38')],_0x294890[_0x2b4b('0x41')]));if(_0x4f1cb1[_0x2b4b('0x38')][_0x2b4b('0x45')]){_0x42c595[_0x2b4b('0x43')]=_['merge'](_0x42c595['where'],{'$or':_[_0x2b4b('0x34')](_0x42c595[_0x2b4b('0x3b')],function(_0x3b2ebb){var _0x1d2449={};_0x1d2449[_0x3b2ebb]={'$like':'%'+_0x4f1cb1[_0x2b4b('0x38')][_0x2b4b('0x45')]+'%'};return _0x1d2449;})});}_0x42c595=_[_0x2b4b('0x42')]({},_0x42c595,_0x4f1cb1[_0x2b4b('0x46')]);return _0x1ca22b[_0x2b4b('0x79')](_0x42c595);}})['then'](function(_0x5e4642){if(_0x5e4642){_0x2521c2=_0x5e4642[_0x2b4b('0x3d')];if(!_0x4f1cb1[_0x2b4b('0x38')][_0x2b4b('0x3e')](_0x2b4b('0x3f'))){_0x42c595['limit']=qs[_0x2b4b('0x24')](_0x4f1cb1['query'][_0x2b4b('0x24')]);_0x42c595['offset']=qs[_0x2b4b('0x23')](_0x4f1cb1[_0x2b4b('0x38')][_0x2b4b('0x23')]);}return _0x1ca22b[_0x2b4b('0x79')](_0x42c595);}})[_0x2b4b('0x29')](function(_0x39b81b){if(_0x39b81b){return _0x39b81b?{'count':_0x2521c2,'rows':_0x39b81b}:null;}})['then'](respondWithResult(_0xf5423f,null))[_0x2b4b('0x4a')](handleError(_0xf5423f,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index c50f713..5301900 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 _0x7506=['hook','exports','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit'];(function(_0x911f74,_0x8020b1){var _0x114eeb=function(_0x1c8969){while(--_0x1c8969){_0x911f74['push'](_0x911f74['shift']());}};_0x114eeb(++_0x8020b1);}(_0x7506,0x1e8));var _0x6750=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x7506[_0xefd519];return _0x4bb882;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x6750('0x0'))['db'][_0x6750('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x6750('0x2')](0x0);var events={'afterCreate':_0x6750('0x3'),'afterUpdate':_0x6750('0x4'),'afterDestroy':_0x6750('0x5')};function emitEvent(_0x29b012){return function(_0x4b8bff,_0x30f9b8,_0x113679){DashboardEvents[_0x6750('0x6')](_0x29b012+':'+_0x4b8bff['id'],_0x4b8bff);DashboardEvents[_0x6750('0x6')](_0x29b012,_0x4b8bff);_0x113679(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x6750('0x7')](e,emitEvent(event));}}module[_0x6750('0x8')]=DashboardEvents; \ No newline at end of file +var _0x5543=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x5543,0x1d2));var _0x3554=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x5543[_0x5b34c0];return _0x242bd3;};'use strict';var EventEmitter=require(_0x3554('0x0'));var Dashboard=require(_0x3554('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3554('0x2')](0x0);var events={'afterCreate':_0x3554('0x3'),'afterUpdate':_0x3554('0x4'),'afterDestroy':'remove'};function emitEvent(_0x197cf3){return function(_0x3e544e,_0x38d6ff,_0x59647a){DashboardEvents[_0x3554('0x5')](_0x197cf3+':'+_0x3e544e['id'],_0x3e544e);DashboardEvents[_0x3554('0x5')](_0x197cf3,_0x3e544e);_0x59647a(null);};}for(var e in events){if(events[_0x3554('0x6')](e)){var event=events[e];Dashboard[_0x3554('0x7')](e,emitEvent(event));}}module[_0x3554('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 2c13829..1a6334b 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 _0x1515=['Dashboard','dashboards','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define'];(function(_0x9920bc,_0x570538){var _0x347352=function(_0x673cd5){while(--_0x673cd5){_0x9920bc['push'](_0x9920bc['shift']());}};_0x347352(++_0x570538);}(_0x1515,0x1c2));var _0x5151=function(_0x2e8e81,_0x2278b6){_0x2e8e81=_0x2e8e81-0x0;var _0x34589a=_0x1515[_0x2e8e81];return _0x34589a;};'use strict';var _=require(_0x5151('0x0'));var util=require(_0x5151('0x1'));var logger=require('../../config/logger')(_0x5151('0x2'));var moment=require(_0x5151('0x3'));var BPromise=require(_0x5151('0x4'));var rp=require(_0x5151('0x5'));var fs=require('fs');var path=require(_0x5151('0x6'));var rimraf=require(_0x5151('0x7'));var config=require(_0x5151('0x8'));var attributes=require(_0x5151('0x9'));module[_0x5151('0xa')]=function(_0x170b6a,_0x441b3b){return _0x170b6a[_0x5151('0xb')](_0x5151('0xc'),attributes,{'tableName':_0x5151('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9560=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util'];(function(_0x4526de,_0x2b4f4b){var _0x531a05=function(_0x1820f5){while(--_0x1820f5){_0x4526de['push'](_0x4526de['shift']());}};_0x531a05(++_0x2b4f4b);}(_0x9560,0x76));var _0x0956=function(_0x45aa72,_0x8af642){_0x45aa72=_0x45aa72-0x0;var _0x75adaa=_0x9560[_0x45aa72];return _0x75adaa;};'use strict';var _=require(_0x0956('0x0'));var util=require(_0x0956('0x1'));var logger=require(_0x0956('0x2'))(_0x0956('0x3'));var moment=require(_0x0956('0x4'));var BPromise=require(_0x0956('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0956('0x6'));var config=require(_0x0956('0x7'));var attributes=require(_0x0956('0x8'));module[_0x0956('0x9')]=function(_0x365e91,_0xbc3774){return _0x365e91[_0x0956('0xa')]('Dashboard',attributes,{'tableName':_0x0956('0xb'),'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 c64cd32..4a266a8 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 _0xd84e=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0xf0330b,_0x814253){var _0x538518=function(_0x9c7d43){while(--_0x9c7d43){_0xf0330b['push'](_0xf0330b['shift']());}};_0x538518(++_0x814253);}(_0xd84e,0x137));var _0xed84=function(_0x25e633,_0x5b6f07){_0x25e633=_0x25e633-0x0;var _0x555dd9=_0xd84e[_0x25e633];return _0x555dd9;};'use strict';var _=require(_0xed84('0x0'));var util=require(_0xed84('0x1'));var moment=require('moment');var BPromise=require(_0xed84('0x2'));var rs=require(_0xed84('0x3'));var fs=require('fs');var Redis=require(_0xed84('0x4'));var db=require(_0xed84('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed84('0x6'))(_0xed84('0x7'));var config=require('../../config/environment');var jayson=require(_0xed84('0x8'));var client=jayson['client'][_0xed84('0x9')]({'port':0x232a});config[_0xed84('0xa')]=_[_0xed84('0xb')](config[_0xed84('0xa')],{'host':_0xed84('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xed84('0xd'))[_0xed84('0xe')](socket);function respondWithRpcPromise(_0x1619e8,_0x29c3db,_0x4cec20){return new BPromise(function(_0x202bef,_0x126c22){return client[_0xed84('0xf')](_0x1619e8,_0x4cec20)[_0xed84('0x10')](function(_0x18908d){logger[_0xed84('0x11')](_0xed84('0x12'),_0x29c3db,'request\x20sent');logger[_0xed84('0x13')](_0xed84('0x14'),_0x29c3db,'request\x20sent',JSON[_0xed84('0x15')](_0x18908d));if(_0x18908d[_0xed84('0x16')]){if(_0x18908d['error'][_0xed84('0x17')]===0x1f4){logger[_0xed84('0x16')](_0xed84('0x12'),_0x29c3db,_0x18908d[_0xed84('0x16')][_0xed84('0x18')]);return _0x126c22(_0x18908d[_0xed84('0x16')][_0xed84('0x18')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x29c3db,_0x18908d[_0xed84('0x16')][_0xed84('0x18')]);return _0x202bef(_0x18908d['error'][_0xed84('0x18')]);}else{logger[_0xed84('0x11')](_0xed84('0x12'),_0x29c3db,'request\x20sent');_0x202bef(_0x18908d['result'][_0xed84('0x18')]);}})[_0xed84('0x19')](function(_0xdfb69c){logger['error']('Dashboard,\x20%s,\x20%s',_0x29c3db,_0xdfb69c);_0x126c22(_0xdfb69c);});});} \ No newline at end of file +var _0x84ff=['request\x20sent','debug','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','register','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0x84ff,0x156));var _0xf84f=function(_0x1cf830,_0x1740b7){_0x1cf830=_0x1cf830-0x0;var _0x10aa0f=_0x84ff[_0x1cf830];return _0x10aa0f;};'use strict';var _=require('lodash');var util=require(_0xf84f('0x0'));var moment=require('moment');var BPromise=require(_0xf84f('0x1'));var rs=require(_0xf84f('0x2'));var fs=require('fs');var Redis=require(_0xf84f('0x3'));var db=require(_0xf84f('0x4'))['db'];var utils=require(_0xf84f('0x5'));var logger=require(_0xf84f('0x6'))('rpc');var config=require(_0xf84f('0x7'));var jayson=require(_0xf84f('0x8'));var client=jayson[_0xf84f('0x9')][_0xf84f('0xa')]({'port':0x232a});config[_0xf84f('0xb')]=_[_0xf84f('0xc')](config[_0xf84f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf84f('0xb')]));require('./dashboard.socket')[_0xf84f('0xd')](socket);function respondWithRpcPromise(_0x1be5c4,_0xa04e60,_0x5babf9){return new BPromise(function(_0xec4af,_0x10dc7d){return client[_0xf84f('0xe')](_0x1be5c4,_0x5babf9)[_0xf84f('0xf')](function(_0x157433){logger[_0xf84f('0x10')](_0xf84f('0x11'),_0xa04e60,_0xf84f('0x12'));logger[_0xf84f('0x13')]('Dashboard,\x20%s,\x20%s,\x20%s',_0xa04e60,_0xf84f('0x12'),JSON['stringify'](_0x157433));if(_0x157433[_0xf84f('0x14')]){if(_0x157433[_0xf84f('0x14')][_0xf84f('0x15')]===0x1f4){logger[_0xf84f('0x14')](_0xf84f('0x11'),_0xa04e60,_0x157433[_0xf84f('0x14')][_0xf84f('0x16')]);return _0x10dc7d(_0x157433[_0xf84f('0x14')]['message']);}logger[_0xf84f('0x14')](_0xf84f('0x11'),_0xa04e60,_0x157433[_0xf84f('0x14')][_0xf84f('0x16')]);return _0xec4af(_0x157433[_0xf84f('0x14')]['message']);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0xa04e60,_0xf84f('0x12'));_0xec4af(_0x157433[_0xf84f('0x17')][_0xf84f('0x16')]);}})['catch'](function(_0x95cc5){logger[_0xf84f('0x14')]('Dashboard,\x20%s,\x20%s',_0xa04e60,_0x95cc5);_0x10dc7d(_0x95cc5);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9780711..05295bd 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 _0xc77d=['removeListener','register','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0xc77d,0x163));var _0xdc77=function(_0x507d71,_0x260c61){_0x507d71=_0x507d71-0x0;var _0xa8f225=_0xc77d[_0x507d71];return _0xa8f225;};'use strict';var DashboardEvents=require(_0xdc77('0x0'));var events=[_0xdc77('0x1'),_0xdc77('0x2'),_0xdc77('0x3')];function createListener(_0x54fca4,_0x5ee4e7){return function(_0x53332d){_0x5ee4e7[_0xdc77('0x4')](_0x54fca4,_0x53332d);};}function removeListener(_0x2092bb,_0x3e2cd4){return function(){DashboardEvents[_0xdc77('0x5')](_0x2092bb,_0x3e2cd4);};}exports[_0xdc77('0x6')]=function(_0x38436a){for(var _0xd1c430=0x0,_0x124a0b=events[_0xdc77('0x7')];_0xd1c430<_0x124a0b;_0xd1c430++){var _0x376adb=events[_0xd1c430];var _0xf7b841=createListener(_0xdc77('0x8')+_0x376adb,_0x38436a);DashboardEvents['on'](_0x376adb,_0xf7b841);}}; \ No newline at end of file +var _0x3223=['update','emit','removeListener','length','dashboard:','./dashboard.events','remove'];(function(_0x20678c,_0x1d31cc){var _0x51d614=function(_0x3cf99){while(--_0x3cf99){_0x20678c['push'](_0x20678c['shift']());}};_0x51d614(++_0x1d31cc);}(_0x3223,0x124));var _0x3322=function(_0x18bbc8,_0x4ef946){_0x18bbc8=_0x18bbc8-0x0;var _0x4e3316=_0x3223[_0x18bbc8];return _0x4e3316;};'use strict';var DashboardEvents=require(_0x3322('0x0'));var events=['save',_0x3322('0x1'),_0x3322('0x2')];function createListener(_0x2b8074,_0x3dab32){return function(_0x4d2221){_0x3dab32[_0x3322('0x3')](_0x2b8074,_0x4d2221);};}function removeListener(_0x4e50b4,_0x151630){return function(){DashboardEvents[_0x3322('0x4')](_0x4e50b4,_0x151630);};}exports['register']=function(_0x2ee966){for(var _0x41bd60=0x0,_0x43b1dd=events[_0x3322('0x5')];_0x41bd60<_0x43b1dd;_0x41bd60++){var _0xc455d=events[_0x41bd60];var _0x19f341=createListener(_0x3322('0x6')+_0xc455d,_0x2ee966);DashboardEvents['on'](_0xc455d,_0x19f341);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index c355b0a..1103e96 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(_0x254fae,_0x241be4){var _0x25db4b=function(_0x3bc3ba){while(--_0x3bc3ba){_0x254fae['push'](_0x254fae['shift']());}};_0x25db4b(++_0x241be4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0x77a1f4,_0xe7f54f){var _0x5f182f=function(_0x81a9d5){while(--_0x81a9d5){_0x77a1f4['push'](_0x77a1f4['shift']());}};_0x5f182f(++_0xe7f54f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 625b15a..ba2a47e 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 _0x5132=['parse','getDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','STRING','TEXT','long'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x5132,0x126));var _0x2513=function(_0x32da9e,_0x195b39){_0x32da9e=_0x32da9e-0x0;var _0x5ca730=_0x5132[_0x32da9e];return _0x5ca730;};'use strict';var Sequelize=require(_0x2513('0x0'));var squel=require(_0x2513('0x1'));var _=require(_0x2513('0x2'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2513('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x2513('0x4')](_0x2513('0x5')),'get':function(){try{return JSON[_0x2513('0x6')](this[_0x2513('0x7')]('attrs'));}catch(_0x2e3a5a){return[];}},'set':function(_0x57445d){try{this['setDataValue']('attrs',JSON[_0x2513('0x8')](_0x57445d));}catch(_0x18960f){this['setDataValue']('attrs',JSON[_0x2513('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x2513('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2513('0x9')]},'col':{'type':Sequelize[_0x2513('0x9')]},'background':{'type':Sequelize[_0x2513('0x3')],'allowNull':![],'defaultValue':_0x2513('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2513('0x3')],'allowNull':![],'defaultValue':_0x2513('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x2513('0x3')]}}; \ No newline at end of file +var _0x51b1=['INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','attrs','setDataValue','stringify'];(function(_0x38cd4b,_0x5727af){var _0x18f4f0=function(_0x40fab6){while(--_0x40fab6){_0x38cd4b['push'](_0x38cd4b['shift']());}};_0x18f4f0(++_0x5727af);}(_0x51b1,0xab));var _0x151b=function(_0x292ed7,_0x4fe68e){_0x292ed7=_0x292ed7-0x0;var _0xcfb8a0=_0x51b1[_0x292ed7];return _0xcfb8a0;};'use strict';var Sequelize=require(_0x151b('0x0'));var squel=require(_0x151b('0x1'));var _=require(_0x151b('0x2'));module[_0x151b('0x3')]={'title':{'type':Sequelize[_0x151b('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x151b('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x151b('0x5')](_0x151b('0x6')),'get':function(){try{return JSON[_0x151b('0x7')](this['getDataValue'](_0x151b('0x8')));}catch(_0x1487ea){return[];}},'set':function(_0xe81931){try{this[_0x151b('0x9')](_0x151b('0x8'),JSON[_0x151b('0xa')](_0xe81931));}catch(_0x35e454){this[_0x151b('0x9')]('attrs',JSON[_0x151b('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x151b('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x151b('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x151b('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x151b('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x151b('0x4')],'allowNull':![],'defaultValue':_0x151b('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x151b('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 470777b..da82ccb 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 _0x074a=['bluebird','util','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','name','send','show','model','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','params','iframe','attrUrl','attrs','https://','attrPath','value','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','html-pdf','eml-format','rimraf','request-promise'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x074a,0x1af));var _0xa074=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x074a[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xa074('0x0'));var emlformat=require(_0xa074('0x1'));var rimraf=require(_0xa074('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa074('0x3'));var moment=require('moment');var BPromise=require(_0xa074('0x4'));var Mustache=require('mustache');var util=require(_0xa074('0x5'));var path=require('path');var sox=require(_0xa074('0x6'));var csv=require(_0xa074('0x7'));var ejs=require(_0xa074('0x8'));var fs=require('fs');var _=require(_0xa074('0x9'));var squel=require('squel');var crypto=require(_0xa074('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa074('0xb'));var Papa=require(_0xa074('0xc'));var Redis=require(_0xa074('0xd'));var authService=require(_0xa074('0xe'));var qs=require(_0xa074('0xf'));var as=require(_0xa074('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa074('0x11'))(_0xa074('0x12'));var utils=require(_0xa074('0x13'));var config=require(_0xa074('0x14'));var db=require(_0xa074('0x15'))['db'];config[_0xa074('0x16')]=_[_0xa074('0x17')](config[_0xa074('0x16')],{'host':_0xa074('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa074('0x16')]));require(_0xa074('0x19'))[_0xa074('0x1a')](socket);function respondWithStatusCode(_0x545f99,_0x57ad9d){_0x57ad9d=_0x57ad9d||0xcc;return function(_0x12a98a){if(_0x12a98a){return _0x545f99[_0xa074('0x1b')](_0x57ad9d);}return _0x545f99[_0xa074('0x1c')](_0x57ad9d)[_0xa074('0x1d')]();};}function respondWithResult(_0x4b0cf2,_0x8f87e0){_0x8f87e0=_0x8f87e0||0xc8;return function(_0x2efb1a){if(_0x2efb1a){return _0x4b0cf2['status'](_0x8f87e0)[_0xa074('0x1e')](_0x2efb1a);}};}function respondWithFilteredResult(_0x2b175a,_0x59d0d0){return function(_0x3fe495){if(_0x3fe495){var _0x357da0=_0x3fe495[_0xa074('0x1f')],_0x5e5868=_0x59d0d0[_0xa074('0x20')],_0x325aca=_0x59d0d0['offset']+_0x59d0d0[_0xa074('0x21')],_0x3ad7e6;if(_0x325aca>=_0x357da0){_0x325aca=_0x357da0;_0x3ad7e6=0xc8;}else{_0x3ad7e6=0xce;}_0x2b175a[_0xa074('0x1c')](_0x3ad7e6);return _0x2b175a[_0xa074('0x22')](_0xa074('0x23'),_0x5e5868+'-'+_0x325aca+'/'+_0x357da0)['json'](_0x3fe495);}return null;};}function patchUpdates(_0x183ffc){return function(_0x7a5ce1){try{jsonpatch[_0xa074('0x24')](_0x7a5ce1,_0x183ffc,!![]);}catch(_0x52207d){return BPromise[_0xa074('0x25')](_0x52207d);}return _0x7a5ce1[_0xa074('0x26')]();};}function saveUpdates(_0x306afd,_0x12f3d3){return function(_0x17cd38){if(_0x17cd38){return _0x17cd38['update'](_0x306afd)[_0xa074('0x27')](function(_0xa4b089){return _0xa4b089;});}return null;};}function removeEntity(_0x30ce9b,_0x3aac78){return function(_0x2558b6){if(_0x2558b6){return _0x2558b6['destroy']()['then'](function(){_0x30ce9b[_0xa074('0x1c')](0xcc)[_0xa074('0x1d')]();});}};}function handleEntityNotFound(_0x4a90fc,_0x5baef8){return function(_0x269ad5){if(!_0x269ad5){_0x4a90fc[_0xa074('0x1b')](0x194);}return _0x269ad5;};}function handleError(_0xad783b,_0x395b06){_0x395b06=_0x395b06||0x1f4;return function(_0x336a80){logger[_0xa074('0x28')](_0x336a80['stack']);if(_0x336a80[_0xa074('0x29')]){delete _0x336a80['name'];}_0xad783b['status'](_0x395b06)[_0xa074('0x2a')](_0x336a80);};}exports[_0xa074('0x2b')]=function(_0x289a7a,_0x5a9e8c){var _0x19e534={'raw':![],'where':{'id':_0x289a7a['params']['id']}},_0x1bc0cf={};_0x1bc0cf[_0xa074('0x2c')]=_['keys'](db[_0xa074('0x2d')][_0xa074('0x2e')]);_0x1bc0cf[_0xa074('0x2f')]=_['keys'](_0x289a7a[_0xa074('0x2f')]);_0x1bc0cf[_0xa074('0x30')]=_['intersection'](_0x1bc0cf['model'],_0x1bc0cf[_0xa074('0x2f')]);_0x19e534['attributes']=_[_0xa074('0x31')](_0x1bc0cf[_0xa074('0x2c')],qs[_0xa074('0x32')](_0x289a7a[_0xa074('0x2f')]['fields']));_0x19e534[_0xa074('0x33')]=_0x19e534[_0xa074('0x33')][_0xa074('0x34')]?_0x19e534[_0xa074('0x33')]:_0x1bc0cf['model'];if(_0x289a7a[_0xa074('0x2f')][_0xa074('0x35')]){_0x19e534['include']=[{'all':!![]}];}_0x19e534=_[_0xa074('0x36')]({},_0x19e534,_0x289a7a[_0xa074('0x37')]);return db['DashboardItem'][_0xa074('0x38')](_0x19e534)[_0xa074('0x27')](handleEntityNotFound(_0x5a9e8c,null))[_0xa074('0x27')](respondWithResult(_0x5a9e8c,null))[_0xa074('0x39')](handleError(_0x5a9e8c,null));};exports['destroy']=function(_0x2fca74,_0x50d178){return db[_0xa074('0x2d')][_0xa074('0x38')]({'where':{'id':_0x2fca74[_0xa074('0x3a')]['id']}})[_0xa074('0x27')](handleEntityNotFound(_0x50d178,null))[_0xa074('0x27')](removeEntity(_0x50d178,null))[_0xa074('0x39')](handleError(_0x50d178,null));};function widgetAttributes(_0x23abc1){try{switch(_0x23abc1['type']){case _0xa074('0x3b'):return[{'name':_0xa074('0x3c'),'value':_0x23abc1[_0xa074('0x3c')]||(_0x23abc1['attrs']&&_0x23abc1[_0xa074('0x3d')][0x0]?_0x23abc1[_0xa074('0x3d')][0x0]['value']:undefined)||_0xa074('0x3e')}];case'custom':return[{'name':_0xa074('0x3f'),'value':_0x23abc1[_0xa074('0x3f')]||(_0x23abc1['attrs']&&_0x23abc1[_0xa074('0x3d')][0x0]?_0x23abc1[_0xa074('0x3d')][0x0][_0xa074('0x40')]:undefined)||''}];case _0xa074('0x41'):return[{'name':'attrHourFormat','value':_0x23abc1['attrHourFormat']||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x0]?_0x23abc1[_0xa074('0x3d')][0x0][_0xa074('0x40')]:undefined)||_0xa074('0x42')},{'name':'attrTimezone','value':_0x23abc1[_0xa074('0x43')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1['attrs'][0x1]?_0x23abc1[_0xa074('0x3d')][0x1][_0xa074('0x40')]:undefined)||_0xa074('0x44')},{'name':'attrFontSize','value':_0x23abc1[_0xa074('0x45')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1['attrs'][0x2]?_0x23abc1[_0xa074('0x3d')][0x2][_0xa074('0x40')]:undefined)||0xc}];case _0xa074('0x46'):return[{'name':_0xa074('0x47'),'value':_0x23abc1[_0xa074('0x47')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x0]?_0x23abc1[_0xa074('0x3d')][0x0][_0xa074('0x40')]:undefined)||_0xa074('0x48')},{'name':'attrVoiceQueues','value':_0x23abc1[_0xa074('0x49')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x1]?_0x23abc1[_0xa074('0x3d')][0x1]['value']:undefined)||[]},{'name':_0xa074('0x45'),'value':_0x23abc1['attrFontSize']||(_0x23abc1['attrs']&&_0x23abc1[_0xa074('0x3d')][0x2]?_0x23abc1['attrs'][0x2][_0xa074('0x40')]:undefined)||0x14}];case _0xa074('0x4a'):case _0xa074('0x4b'):return[{'name':'attrSerie1','value':_0x23abc1['attrSerie1']||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1['attrs'][0x0]?_0x23abc1['attrs'][0x0]['value']:undefined)||_0xa074('0x48')},{'name':'attrSerie2','value':_0x23abc1[_0xa074('0x4c')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1['attrs'][0x1]?_0x23abc1[_0xa074('0x3d')][0x1][_0xa074('0x40')]:undefined)||null},{'name':'attrSerie3','value':_0x23abc1[_0xa074('0x4d')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1['attrs'][0x2]?_0x23abc1[_0xa074('0x3d')][0x2][_0xa074('0x40')]:undefined)||null},{'name':_0xa074('0x49'),'value':_0x23abc1[_0xa074('0x49')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x3]?_0x23abc1[_0xa074('0x3d')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0xa074('0x4e'),'type':_0x23abc1[_0xa074('0x4f')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x0]?_0x23abc1['attrs'][0x0][_0xa074('0x50')]:undefined)||null,'value':_0x23abc1[_0xa074('0x4e')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x0]?_0x23abc1[_0xa074('0x3d')][0x0]['value']:undefined)||null},{'name':_0xa074('0x51'),'value':_0x23abc1[_0xa074('0x51')]||(_0x23abc1[_0xa074('0x3d')]&&_0x23abc1[_0xa074('0x3d')][0x1]?_0x23abc1[_0xa074('0x3d')][0x1][_0xa074('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x50d1cc){logger[_0xa074('0x28')](_0xa074('0x52'),JSON[_0xa074('0x53')](_0x50d1cc));return[];}}exports[_0xa074('0x54')]=function(_0x9759b1,_0x32cda4){if(_0x9759b1['body']){_0x9759b1['body'][_0xa074('0x3d')]=widgetAttributes(_0x9759b1[_0xa074('0x55')]);}return db[_0xa074('0x2d')]['create'](_0x9759b1[_0xa074('0x55')],{})[_0xa074('0x27')](respondWithResult(_0x32cda4,0xc9))['catch'](handleError(_0x32cda4,null));};exports[_0xa074('0x56')]=function(_0x13f444,_0x3720d9){if(_0x13f444[_0xa074('0x55')]['id']){delete _0x13f444[_0xa074('0x55')]['id'];}_0x13f444[_0xa074('0x55')]['attrs']=widgetAttributes(_0x13f444[_0xa074('0x55')]);return db[_0xa074('0x2d')][_0xa074('0x38')]({'where':{'id':_0x13f444['params']['id']}})[_0xa074('0x27')](handleEntityNotFound(_0x3720d9,null))[_0xa074('0x27')](saveUpdates(_0x13f444[_0xa074('0x55')],null))[_0xa074('0x27')](respondWithResult(_0x3720d9,null))['catch'](handleError(_0x3720d9,null));}; \ No newline at end of file +var _0x9f94=['stringify','body','create','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','json','offset','status','set','Content-Range','apply','save','then','error','name','send','params','model','DashboardItem','query','keys','filters','intersection','attributes','fields','length','include','merge','options','find','catch','type','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s'];(function(_0x11167c,_0xb0ff07){var _0x34bdb0=function(_0x34f17f){while(--_0x34f17f){_0x11167c['push'](_0x11167c['shift']());}};_0x34bdb0(++_0xb0ff07);}(_0x9f94,0x154));var _0x49f9=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9f94[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0x49f9('0x0'));var emlformat=require(_0x49f9('0x1'));var rimraf=require(_0x49f9('0x2'));var zipdir=require(_0x49f9('0x3'));var jsonpatch=require(_0x49f9('0x4'));var rp=require(_0x49f9('0x5'));var moment=require(_0x49f9('0x6'));var BPromise=require(_0x49f9('0x7'));var Mustache=require(_0x49f9('0x8'));var util=require(_0x49f9('0x9'));var path=require('path');var sox=require(_0x49f9('0xa'));var csv=require(_0x49f9('0xb'));var ejs=require(_0x49f9('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x49f9('0xd'));var deskjs=require(_0x49f9('0xe'));var toCsv=require(_0x49f9('0xb'));var querystring=require(_0x49f9('0xf'));var Papa=require(_0x49f9('0x10'));var Redis=require('ioredis');var authService=require(_0x49f9('0x11'));var qs=require(_0x49f9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49f9('0x13'));var logger=require(_0x49f9('0x14'))(_0x49f9('0x15'));var utils=require(_0x49f9('0x16'));var config=require(_0x49f9('0x17'));var db=require(_0x49f9('0x18'))['db'];config[_0x49f9('0x19')]=_['defaults'](config[_0x49f9('0x19')],{'host':_0x49f9('0x1a'),'port':0x18eb});var socket=require(_0x49f9('0x1b'))(new Redis(config[_0x49f9('0x19')]));require(_0x49f9('0x1c'))[_0x49f9('0x1d')](socket);function respondWithStatusCode(_0x3b5608,_0x3af611){_0x3af611=_0x3af611||0xcc;return function(_0x424b3a){if(_0x424b3a){return _0x3b5608[_0x49f9('0x1e')](_0x3af611);}return _0x3b5608['status'](_0x3af611)[_0x49f9('0x1f')]();};}function respondWithResult(_0x3a0a70,_0xf846ca){_0xf846ca=_0xf846ca||0xc8;return function(_0x53917d){if(_0x53917d){return _0x3a0a70['status'](_0xf846ca)[_0x49f9('0x20')](_0x53917d);}};}function respondWithFilteredResult(_0x528760,_0x411d6f){return function(_0x4d3503){if(_0x4d3503){var _0x55048c=_0x4d3503['count'],_0x454b79=_0x411d6f['offset'],_0x1d49d8=_0x411d6f[_0x49f9('0x21')]+_0x411d6f['limit'],_0x1588ce;if(_0x1d49d8>=_0x55048c){_0x1d49d8=_0x55048c;_0x1588ce=0xc8;}else{_0x1588ce=0xce;}_0x528760[_0x49f9('0x22')](_0x1588ce);return _0x528760[_0x49f9('0x23')](_0x49f9('0x24'),_0x454b79+'-'+_0x1d49d8+'/'+_0x55048c)['json'](_0x4d3503);}return null;};}function patchUpdates(_0x37f0de){return function(_0x2f107c){try{jsonpatch[_0x49f9('0x25')](_0x2f107c,_0x37f0de,!![]);}catch(_0x5d2f4b){return BPromise['reject'](_0x5d2f4b);}return _0x2f107c[_0x49f9('0x26')]();};}function saveUpdates(_0x5752c1,_0x286eeb){return function(_0x1a7b1a){if(_0x1a7b1a){return _0x1a7b1a['update'](_0x5752c1)[_0x49f9('0x27')](function(_0x2d5af0){return _0x2d5af0;});}return null;};}function removeEntity(_0x42ce1f,_0x28baf3){return function(_0x4c4bcd){if(_0x4c4bcd){return _0x4c4bcd['destroy']()[_0x49f9('0x27')](function(){_0x42ce1f[_0x49f9('0x22')](0xcc)[_0x49f9('0x1f')]();});}};}function handleEntityNotFound(_0x4f7bd3,_0x32f68a){return function(_0x5dacd4){if(!_0x5dacd4){_0x4f7bd3[_0x49f9('0x1e')](0x194);}return _0x5dacd4;};}function handleError(_0x3120dc,_0x167232){_0x167232=_0x167232||0x1f4;return function(_0x2f821a){logger[_0x49f9('0x28')](_0x2f821a['stack']);if(_0x2f821a['name']){delete _0x2f821a[_0x49f9('0x29')];}_0x3120dc[_0x49f9('0x22')](_0x167232)[_0x49f9('0x2a')](_0x2f821a);};}exports['show']=function(_0xa4d524,_0x231b9e){var _0x4190f5={'raw':![],'where':{'id':_0xa4d524[_0x49f9('0x2b')]['id']}},_0xfad46c={};_0xfad46c[_0x49f9('0x2c')]=_['keys'](db[_0x49f9('0x2d')]['rawAttributes']);_0xfad46c[_0x49f9('0x2e')]=_[_0x49f9('0x2f')](_0xa4d524[_0x49f9('0x2e')]);_0xfad46c[_0x49f9('0x30')]=_[_0x49f9('0x31')](_0xfad46c[_0x49f9('0x2c')],_0xfad46c['query']);_0x4190f5[_0x49f9('0x32')]=_[_0x49f9('0x31')](_0xfad46c[_0x49f9('0x2c')],qs[_0x49f9('0x33')](_0xa4d524[_0x49f9('0x2e')][_0x49f9('0x33')]));_0x4190f5['attributes']=_0x4190f5['attributes'][_0x49f9('0x34')]?_0x4190f5[_0x49f9('0x32')]:_0xfad46c[_0x49f9('0x2c')];if(_0xa4d524[_0x49f9('0x2e')]['includeAll']){_0x4190f5[_0x49f9('0x35')]=[{'all':!![]}];}_0x4190f5=_[_0x49f9('0x36')]({},_0x4190f5,_0xa4d524[_0x49f9('0x37')]);return db['DashboardItem'][_0x49f9('0x38')](_0x4190f5)['then'](handleEntityNotFound(_0x231b9e,null))[_0x49f9('0x27')](respondWithResult(_0x231b9e,null))[_0x49f9('0x39')](handleError(_0x231b9e,null));};exports['destroy']=function(_0x39d1e0,_0x1f8113){return db[_0x49f9('0x2d')][_0x49f9('0x38')]({'where':{'id':_0x39d1e0['params']['id']}})[_0x49f9('0x27')](handleEntityNotFound(_0x1f8113,null))[_0x49f9('0x27')](removeEntity(_0x1f8113,null))[_0x49f9('0x39')](handleError(_0x1f8113,null));};function widgetAttributes(_0x46bca3){try{switch(_0x46bca3[_0x49f9('0x3a')]){case'iframe':return[{'name':_0x49f9('0x3b'),'value':_0x46bca3[_0x49f9('0x3b')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3['attrs'][0x0]?_0x46bca3[_0x49f9('0x3c')][0x0][_0x49f9('0x3d')]:undefined)||'https://'}];case _0x49f9('0x3e'):return[{'name':_0x49f9('0x3f'),'value':_0x46bca3[_0x49f9('0x3f')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x0]?_0x46bca3[_0x49f9('0x3c')][0x0][_0x49f9('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x49f9('0x40'),'value':_0x46bca3[_0x49f9('0x40')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x0]?_0x46bca3['attrs'][0x0][_0x49f9('0x3d')]:undefined)||_0x49f9('0x41')},{'name':_0x49f9('0x42'),'value':_0x46bca3[_0x49f9('0x42')]||(_0x46bca3['attrs']&&_0x46bca3['attrs'][0x1]?_0x46bca3['attrs'][0x1][_0x49f9('0x3d')]:undefined)||_0x49f9('0x43')},{'name':_0x49f9('0x44'),'value':_0x46bca3[_0x49f9('0x44')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x2]?_0x46bca3[_0x49f9('0x3c')][0x2][_0x49f9('0x3d')]:undefined)||0xc}];case'counter':return[{'name':_0x49f9('0x45'),'value':_0x46bca3[_0x49f9('0x45')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x0]?_0x46bca3[_0x49f9('0x3c')][0x0][_0x49f9('0x3d')]:undefined)||_0x49f9('0x46')},{'name':'attrVoiceQueues','value':_0x46bca3[_0x49f9('0x47')]||(_0x46bca3['attrs']&&_0x46bca3['attrs'][0x1]?_0x46bca3[_0x49f9('0x3c')][0x1][_0x49f9('0x3d')]:undefined)||[]},{'name':_0x49f9('0x44'),'value':_0x46bca3[_0x49f9('0x44')]||(_0x46bca3['attrs']&&_0x46bca3[_0x49f9('0x3c')][0x2]?_0x46bca3[_0x49f9('0x3c')][0x2][_0x49f9('0x3d')]:undefined)||0x14}];case _0x49f9('0x48'):case'pie-chart':return[{'name':_0x49f9('0x49'),'value':_0x46bca3[_0x49f9('0x49')]||(_0x46bca3['attrs']&&_0x46bca3[_0x49f9('0x3c')][0x0]?_0x46bca3['attrs'][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x46bca3['attrSerie2']||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x1]?_0x46bca3[_0x49f9('0x3c')][0x1]['value']:undefined)||null},{'name':_0x49f9('0x4a'),'value':_0x46bca3[_0x49f9('0x4a')]||(_0x46bca3['attrs']&&_0x46bca3['attrs'][0x2]?_0x46bca3[_0x49f9('0x3c')][0x2][_0x49f9('0x3d')]:undefined)||null},{'name':_0x49f9('0x47'),'value':_0x46bca3[_0x49f9('0x47')]||(_0x46bca3['attrs']&&_0x46bca3[_0x49f9('0x3c')][0x3]?_0x46bca3[_0x49f9('0x3c')][0x3][_0x49f9('0x3d')]:undefined)||[]}];case _0x49f9('0x4b'):return[{'name':_0x49f9('0x4c'),'type':_0x46bca3[_0x49f9('0x4d')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x0]?_0x46bca3[_0x49f9('0x3c')][0x0]['type']:undefined)||null,'value':_0x46bca3[_0x49f9('0x4c')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3['attrs'][0x0]?_0x46bca3['attrs'][0x0][_0x49f9('0x3d')]:undefined)||null},{'name':'attrRefresh','value':_0x46bca3[_0x49f9('0x4e')]||(_0x46bca3[_0x49f9('0x3c')]&&_0x46bca3[_0x49f9('0x3c')][0x1]?_0x46bca3[_0x49f9('0x3c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x204386){logger[_0x49f9('0x28')](_0x49f9('0x4f'),JSON[_0x49f9('0x50')](_0x204386));return[];}}exports['create']=function(_0x4e13d3,_0x522997){if(_0x4e13d3[_0x49f9('0x51')]){_0x4e13d3[_0x49f9('0x51')][_0x49f9('0x3c')]=widgetAttributes(_0x4e13d3['body']);}return db[_0x49f9('0x2d')][_0x49f9('0x52')](_0x4e13d3[_0x49f9('0x51')],{})['then'](respondWithResult(_0x522997,0xc9))[_0x49f9('0x39')](handleError(_0x522997,null));};exports[_0x49f9('0x53')]=function(_0x432dc0,_0xf9c654){if(_0x432dc0['body']['id']){delete _0x432dc0['body']['id'];}_0x432dc0['body'][_0x49f9('0x3c')]=widgetAttributes(_0x432dc0[_0x49f9('0x51')]);return db[_0x49f9('0x2d')]['find']({'where':{'id':_0x432dc0['params']['id']}})[_0x49f9('0x27')](handleEntityNotFound(_0xf9c654,null))[_0x49f9('0x27')](saveUpdates(_0x432dc0[_0x49f9('0x51')],null))[_0x49f9('0x27')](respondWithResult(_0xf9c654,null))['catch'](handleError(_0xf9c654,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 19df329..0cfda4e 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 _0xc791=['exports','events','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x2eb7dd,_0x520d2f){var _0x52112f=function(_0x52939b){while(--_0x52939b){_0x2eb7dd['push'](_0x2eb7dd['shift']());}};_0x52112f(++_0x520d2f);}(_0xc791,0xa9));var _0x1c79=function(_0x3a290c,_0x5b4ef0){_0x3a290c=_0x3a290c-0x0;var _0x50227c=_0xc791[_0x3a290c];return _0x50227c;};'use strict';var EventEmitter=require(_0x1c79('0x0'));var DashboardItem=require(_0x1c79('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1c79('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1c79('0x3')};function emitEvent(_0x22c1a7){return function(_0x251052,_0x58903c,_0x5a1031){DashboardItemEvents[_0x1c79('0x4')](_0x22c1a7+':'+_0x251052['id'],_0x251052);DashboardItemEvents[_0x1c79('0x4')](_0x22c1a7,_0x251052);_0x5a1031(null);};}for(var e in events){if(events[_0x1c79('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x1c79('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x7f81=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x129c3c,_0x49f558){var _0x26d66c=function(_0x4bdb3d){while(--_0x4bdb3d){_0x129c3c['push'](_0x129c3c['shift']());}};_0x26d66c(++_0x49f558);}(_0x7f81,0x185));var _0x17f8=function(_0x3333a0,_0x411efa){_0x3333a0=_0x3333a0-0x0;var _0x383426=_0x7f81[_0x3333a0];return _0x383426;};'use strict';var EventEmitter=require(_0x17f8('0x0'));var DashboardItem=require(_0x17f8('0x1'))['db'][_0x17f8('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x17f8('0x3')](0x0);var events={'afterCreate':_0x17f8('0x4'),'afterUpdate':_0x17f8('0x5'),'afterDestroy':_0x17f8('0x6')};function emitEvent(_0x1e2e35){return function(_0x531c72,_0x13545f,_0x13937c){DashboardItemEvents[_0x17f8('0x7')](_0x1e2e35+':'+_0x531c72['id'],_0x531c72);DashboardItemEvents[_0x17f8('0x7')](_0x1e2e35,_0x531c72);_0x13937c(null);};}for(var e in events){if(events[_0x17f8('0x8')](e)){var event=events[e];DashboardItem[_0x17f8('0x9')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index de52c1b..de95ce8 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 _0x6ca0=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','lodash','util'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x6ca0,0x129));var _0x06ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ca0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x06ca('0x0'));var util=require(_0x06ca('0x1'));var logger=require(_0x06ca('0x2'))(_0x06ca('0x3'));var moment=require(_0x06ca('0x4'));var BPromise=require(_0x06ca('0x5'));var rp=require(_0x06ca('0x6'));var fs=require('fs');var path=require(_0x06ca('0x7'));var rimraf=require(_0x06ca('0x8'));var config=require(_0x06ca('0x9'));var attributes=require(_0x06ca('0xa'));module[_0x06ca('0xb')]=function(_0xda1428,_0x4d16b4){return _0xda1428['define'](_0x06ca('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a2a=['rimraf','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x44b410,_0x25262e){var _0x74977e=function(_0x303f10){while(--_0x303f10){_0x44b410['push'](_0x44b410['shift']());}};_0x74977e(++_0x25262e);}(_0x8a2a,0xfd));var _0xa8a2=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x8a2a[_0x409353];return _0x4f4b59;};'use strict';var _=require('lodash');var util=require(_0xa8a2('0x0'));var logger=require(_0xa8a2('0x1'))(_0xa8a2('0x2'));var moment=require(_0xa8a2('0x3'));var BPromise=require(_0xa8a2('0x4'));var rp=require(_0xa8a2('0x5'));var fs=require('fs');var path=require(_0xa8a2('0x6'));var rimraf=require(_0xa8a2('0x7'));var config=require(_0xa8a2('0x8'));var attributes=require(_0xa8a2('0x9'));module[_0xa8a2('0xa')]=function(_0x44f1e6,_0x2688c1){return _0x44f1e6['define'](_0xa8a2('0xb'),attributes,{'tableName':_0xa8a2('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 18d2aa2..82e3649 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 _0x82bb=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./dashboardItem.socket','register','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x551160,_0x3ba006){var _0x28fdd7=function(_0x123b2d){while(--_0x123b2d){_0x551160['push'](_0x551160['shift']());}};_0x28fdd7(++_0x3ba006);}(_0x82bb,0x6b));var _0xb82b=function(_0xcd939f,_0x33117d){_0xcd939f=_0xcd939f-0x0;var _0xe23e6f=_0x82bb[_0xcd939f];return _0xe23e6f;};'use strict';var _=require(_0xb82b('0x0'));var util=require(_0xb82b('0x1'));var moment=require(_0xb82b('0x2'));var BPromise=require(_0xb82b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb82b('0x4'))['db'];var utils=require(_0xb82b('0x5'));var logger=require(_0xb82b('0x6'))(_0xb82b('0x7'));var config=require(_0xb82b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb82b('0x9')][_0xb82b('0xa')]({'port':0x232a});config['redis']=_[_0xb82b('0xb')](config[_0xb82b('0xc')],{'host':_0xb82b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb82b('0xe'))[_0xb82b('0xf')](socket);function respondWithRpcPromise(_0x2b3b7b,_0x1e58ec,_0x2b9013){return new BPromise(function(_0x50b0b0,_0x2a9b56){return client['request'](_0x2b3b7b,_0x2b9013)[_0xb82b('0x10')](function(_0x144cea){logger['info'](_0xb82b('0x11'),_0x1e58ec,_0xb82b('0x12'));logger[_0xb82b('0x13')](_0xb82b('0x14'),_0x1e58ec,_0xb82b('0x12'),JSON[_0xb82b('0x15')](_0x144cea));if(_0x144cea[_0xb82b('0x16')]){if(_0x144cea['error'][_0xb82b('0x17')]===0x1f4){logger[_0xb82b('0x16')](_0xb82b('0x11'),_0x1e58ec,_0x144cea['error'][_0xb82b('0x18')]);return _0x2a9b56(_0x144cea[_0xb82b('0x16')][_0xb82b('0x18')]);}logger[_0xb82b('0x16')](_0xb82b('0x11'),_0x1e58ec,_0x144cea[_0xb82b('0x16')][_0xb82b('0x18')]);return _0x50b0b0(_0x144cea[_0xb82b('0x16')][_0xb82b('0x18')]);}else{logger[_0xb82b('0x19')](_0xb82b('0x11'),_0x1e58ec,_0xb82b('0x12'));_0x50b0b0(_0x144cea[_0xb82b('0x1a')][_0xb82b('0x18')]);}})[_0xb82b('0x1b')](function(_0x56886c){logger[_0xb82b('0x16')](_0xb82b('0x11'),_0x1e58ec,_0x56886c);_0x2a9b56(_0x56886c);});});} \ No newline at end of file +var _0x1805=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./dashboardItem.socket','register','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x187d33,_0x8a8c38){var _0x3d4258=function(_0x6ea673){while(--_0x6ea673){_0x187d33['push'](_0x187d33['shift']());}};_0x3d4258(++_0x8a8c38);}(_0x1805,0xd1));var _0x5180=function(_0x53f29b,_0x22cf73){_0x53f29b=_0x53f29b-0x0;var _0x18b486=_0x1805[_0x53f29b];return _0x18b486;};'use strict';var _=require(_0x5180('0x0'));var util=require(_0x5180('0x1'));var moment=require(_0x5180('0x2'));var BPromise=require(_0x5180('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5180('0x4'));var db=require(_0x5180('0x5'))['db'];var utils=require(_0x5180('0x6'));var logger=require(_0x5180('0x7'))(_0x5180('0x8'));var config=require(_0x5180('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5180('0xa')][_0x5180('0xb')]({'port':0x232a});config[_0x5180('0xc')]=_['defaults'](config[_0x5180('0xc')],{'host':_0x5180('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5180('0xc')]));require(_0x5180('0xe'))[_0x5180('0xf')](socket);function respondWithRpcPromise(_0x29d45a,_0x3c83a5,_0x58190c){return new BPromise(function(_0x414a8b,_0x41c9f9){return client['request'](_0x29d45a,_0x58190c)['then'](function(_0x102e52){logger['info'](_0x5180('0x10'),_0x3c83a5,_0x5180('0x11'));logger[_0x5180('0x12')](_0x5180('0x13'),_0x3c83a5,_0x5180('0x11'),JSON[_0x5180('0x14')](_0x102e52));if(_0x102e52[_0x5180('0x15')]){if(_0x102e52[_0x5180('0x15')]['code']===0x1f4){logger[_0x5180('0x15')](_0x5180('0x10'),_0x3c83a5,_0x102e52[_0x5180('0x15')][_0x5180('0x16')]);return _0x41c9f9(_0x102e52['error']['message']);}logger['error'](_0x5180('0x10'),_0x3c83a5,_0x102e52[_0x5180('0x15')][_0x5180('0x16')]);return _0x414a8b(_0x102e52[_0x5180('0x15')][_0x5180('0x16')]);}else{logger[_0x5180('0x17')](_0x5180('0x10'),_0x3c83a5,_0x5180('0x11'));_0x414a8b(_0x102e52[_0x5180('0x18')][_0x5180('0x16')]);}})[_0x5180('0x19')](function(_0x4fd1b0){logger[_0x5180('0x15')](_0x5180('0x10'),_0x3c83a5,_0x4fd1b0);_0x41c9f9(_0x4fd1b0);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 11dca7d..ea68955 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 _0x4dce=['emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x5e9c3a,_0x13acc2){var _0x12ccb4=function(_0x3ffd23){while(--_0x3ffd23){_0x5e9c3a['push'](_0x5e9c3a['shift']());}};_0x12ccb4(++_0x13acc2);}(_0x4dce,0xdd));var _0xe4dc=function(_0x4b3d13,_0x1993d5){_0x4b3d13=_0x4b3d13-0x0;var _0xf64dd8=_0x4dce[_0x4b3d13];return _0xf64dd8;};'use strict';var DashboardItemEvents=require(_0xe4dc('0x0'));var events=[_0xe4dc('0x1'),_0xe4dc('0x2'),'update'];function createListener(_0x2e226d,_0x457c29){return function(_0x22df9b){_0x457c29[_0xe4dc('0x3')](_0x2e226d,_0x22df9b);};}function removeListener(_0x17c99a,_0x3075fb){return function(){DashboardItemEvents[_0xe4dc('0x4')](_0x17c99a,_0x3075fb);};}exports[_0xe4dc('0x5')]=function(_0xfa9db8){for(var _0x111148=0x0,_0x508c00=events[_0xe4dc('0x6')];_0x111148<_0x508c00;_0x111148++){var _0x878459=events[_0x111148];var _0x3938dc=createListener(_0xe4dc('0x7')+_0x878459,_0xfa9db8);DashboardItemEvents['on'](_0x878459,_0x3938dc);}}; \ No newline at end of file +var _0x0f91=['update','removeListener','register','length','./dashboardItem.events','save','remove'];(function(_0x59b4d6,_0x155065){var _0x22161a=function(_0x15ce1b){while(--_0x15ce1b){_0x59b4d6['push'](_0x59b4d6['shift']());}};_0x22161a(++_0x155065);}(_0x0f91,0x19a));var _0x10f9=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0x0f91[_0x358806];return _0x19fdcb;};'use strict';var DashboardItemEvents=require(_0x10f9('0x0'));var events=[_0x10f9('0x1'),_0x10f9('0x2'),_0x10f9('0x3')];function createListener(_0x4b745d,_0x1ada94){return function(_0x4b749b){_0x1ada94['emit'](_0x4b745d,_0x4b749b);};}function removeListener(_0x30fb7f,_0x5c1d7c){return function(){DashboardItemEvents[_0x10f9('0x4')](_0x30fb7f,_0x5c1d7c);};}exports[_0x10f9('0x5')]=function(_0x327278){for(var _0x1842b7=0x0,_0x460838=events[_0x10f9('0x6')];_0x1842b7<_0x460838;_0x1842b7++){var _0x516ce3=events[_0x1842b7];var _0x57a9cd=createListener('dashboardItem:'+_0x516ce3,_0x327278);DashboardItemEvents['on'](_0x516ce3,_0x57a9cd);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index cf74e02..af12df0 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 _0x31f0=['create','put','/:id','isAuthenticated','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','get','post'];(function(_0x426a37,_0x1d32df){var _0x4e9e28=function(_0x420223){while(--_0x420223){_0x426a37['push'](_0x426a37['shift']());}};_0x4e9e28(++_0x1d32df);}(_0x31f0,0xb7));var _0x031f=function(_0x5dc02f,_0x53542a){_0x5dc02f=_0x5dc02f-0x0;var _0x20ff93=_0x31f0[_0x5dc02f];return _0x20ff93;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var auth=require(_0x031f('0x4'));var interaction=require(_0x031f('0x5'));var config=require('../../config/environment');var controller=require(_0x031f('0x6'));router[_0x031f('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x031f('0x8')]('/',auth['isAuthenticated'](),controller[_0x031f('0x9')]);router[_0x031f('0xa')](_0x031f('0xb'),auth[_0x031f('0xc')](),controller['update']);router[_0x031f('0xd')](_0x031f('0xb'),auth[_0x031f('0xc')](),controller[_0x031f('0xe')]);module[_0x031f('0xf')]=router; \ No newline at end of file +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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x37f212,_0x9bf1b2){_0x37f212=_0x37f212-0x0;var _0x57ba32=_0x7fbe[_0x37f212];return _0x57ba32;};'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 diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 03135a9..d4eaf3e 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 _0x8101=['sequelize','exports','STRING'];(function(_0x16367d,_0x528383){var _0x508889=function(_0x1bab33){while(--_0x1bab33){_0x16367d['push'](_0x16367d['shift']());}};_0x508889(++_0x528383);}(_0x8101,0x8d));var _0x1810=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x8101[_0x2c0be1];return _0x3d4bd2;};'use strict';var Sequelize=require(_0x1810('0x0'));module[_0x1810('0x1')]={'name':{'type':Sequelize[_0x1810('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x780e=['exports','STRING'];(function(_0x3e2465,_0x211e58){var _0x12df6c=function(_0x307aff){while(--_0x307aff){_0x3e2465['push'](_0x3e2465['shift']());}};_0x12df6c(++_0x211e58);}(_0x780e,0x78));var _0xe780=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x780e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0xe780('0x0')]={'name':{'type':Sequelize[_0xe780('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index bd69e81..ffec59d 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 _0xe47e=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Dispositions','UserProfileSection','userProfileId','autoAssociation','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','offset','limit','set','Content-Range','json','apply','reject','save','then','get','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x4c9c46,_0x3c4f5b){var _0x3e7607=function(_0x8ef8a0){while(--_0x8ef8a0){_0x4c9c46['push'](_0x4c9c46['shift']());}};_0x3e7607(++_0x3c4f5b);}(_0xe47e,0x1b6));var _0xee47=function(_0x386b03,_0x5d0000){_0x386b03=_0x386b03-0x0;var _0xd3d524=_0xe47e[_0x386b03];return _0xd3d524;};'use strict';var pdf=require(_0xee47('0x0'));var emlformat=require(_0xee47('0x1'));var rimraf=require(_0xee47('0x2'));var zipdir=require(_0xee47('0x3'));var jsonpatch=require(_0xee47('0x4'));var rp=require(_0xee47('0x5'));var moment=require('moment');var BPromise=require(_0xee47('0x6'));var Mustache=require('mustache');var util=require(_0xee47('0x7'));var path=require(_0xee47('0x8'));var sox=require(_0xee47('0x9'));var csv=require(_0xee47('0xa'));var ejs=require(_0xee47('0xb'));var fs=require('fs');var _=require(_0xee47('0xc'));var squel=require('squel');var crypto=require(_0xee47('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xee47('0xa'));var querystring=require('querystring');var Papa=require(_0xee47('0xe'));var Redis=require(_0xee47('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xee47('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee47('0x11'));var logger=require(_0xee47('0x12'))(_0xee47('0x13'));var utils=require('../../config/utils');var config=require(_0xee47('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30645e,_0x25937f){_0x25937f=_0x25937f||0xcc;return function(_0x27f233){if(_0x27f233){return _0x30645e['sendStatus'](_0x25937f);}return _0x30645e[_0xee47('0x15')](_0x25937f)[_0xee47('0x16')]();};}function respondWithResult(_0x3277b5,_0x4c598f){_0x4c598f=_0x4c598f||0xc8;return function(_0x199f87){if(_0x199f87){return _0x3277b5[_0xee47('0x15')](_0x4c598f)['json'](_0x199f87);}};}function respondWithFilteredResult(_0x5f3a2f,_0x2e6a78){return function(_0x587c65){if(_0x587c65){var _0x571c6e=_0x587c65['count'],_0x46dc2e=_0x2e6a78['offset'],_0x115634=_0x2e6a78[_0xee47('0x17')]+_0x2e6a78[_0xee47('0x18')],_0x4b3501;if(_0x115634>=_0x571c6e){_0x115634=_0x571c6e;_0x4b3501=0xc8;}else{_0x4b3501=0xce;}_0x5f3a2f[_0xee47('0x15')](_0x4b3501);return _0x5f3a2f[_0xee47('0x19')](_0xee47('0x1a'),_0x46dc2e+'-'+_0x115634+'/'+_0x571c6e)[_0xee47('0x1b')](_0x587c65);}return null;};}function patchUpdates(_0x201dd1){return function(_0x1c1448){try{jsonpatch[_0xee47('0x1c')](_0x1c1448,_0x201dd1,!![]);}catch(_0x75a33a){return BPromise[_0xee47('0x1d')](_0x75a33a);}return _0x1c1448[_0xee47('0x1e')]();};}function saveUpdates(_0x542aab,_0x280f2b){return function(_0x380b7c){if(_0x380b7c){return _0x380b7c['update'](_0x542aab)['then'](function(_0x6002c){return _0x6002c;});}return null;};}function removeEntity(_0x4771ab,_0x3766f8){return function(_0x412afd){if(_0x412afd){return _0x412afd['destroy']()[_0xee47('0x1f')](function(){var _0x3d8a5a=_0x412afd[_0xee47('0x20')]({'plain':!![]});var _0x45e5b3='Dispositions';return db[_0xee47('0x21')]['destroy']({'where':{'type':_0x45e5b3,'resourceId':_0x3d8a5a['id']}})['then'](function(){return _0x412afd;});})['then'](function(){_0x4771ab[_0xee47('0x15')](0xcc)[_0xee47('0x16')]();});}};}function handleEntityNotFound(_0x110199,_0x9604df){return function(_0x474cae){if(!_0x474cae){_0x110199['sendStatus'](0x194);}return _0x474cae;};}function handleError(_0x102f92,_0x49137e){_0x49137e=_0x49137e||0x1f4;return function(_0x4fe9f3){logger[_0xee47('0x22')](_0x4fe9f3[_0xee47('0x23')]);if(_0x4fe9f3[_0xee47('0x24')]){delete _0x4fe9f3[_0xee47('0x24')];}_0x102f92['status'](_0x49137e)[_0xee47('0x25')](_0x4fe9f3);};}exports[_0xee47('0x26')]=function(_0x58bd18,_0x10e886){var _0x46f225={},_0x2e4806={},_0x5cde67={'count':0x0,'rows':[]};var _0x1d67e2=_[_0xee47('0x27')](db[_0xee47('0x28')][_0xee47('0x29')],function(_0x32b01c){return{'name':_0x32b01c[_0xee47('0x2a')],'type':_0x32b01c[_0xee47('0x2b')][_0xee47('0x2c')]};});_0x2e4806[_0xee47('0x2d')]=_[_0xee47('0x27')](_0x1d67e2,'name');_0x2e4806['query']=_[_0xee47('0x2e')](_0x58bd18[_0xee47('0x2f')]);_0x2e4806[_0xee47('0x30')]=_[_0xee47('0x31')](_0x2e4806['model'],_0x2e4806[_0xee47('0x2f')]);_0x46f225['attributes']=_[_0xee47('0x31')](_0x2e4806[_0xee47('0x2d')],qs[_0xee47('0x32')](_0x58bd18[_0xee47('0x2f')]['fields']));_0x46f225['attributes']=_0x46f225[_0xee47('0x33')][_0xee47('0x34')]?_0x46f225[_0xee47('0x33')]:_0x2e4806[_0xee47('0x2d')];if(!_0x58bd18[_0xee47('0x2f')][_0xee47('0x35')](_0xee47('0x36'))){_0x46f225['limit']=qs[_0xee47('0x18')](_0x58bd18[_0xee47('0x2f')][_0xee47('0x18')]);_0x46f225[_0xee47('0x17')]=qs[_0xee47('0x17')](_0x58bd18[_0xee47('0x2f')][_0xee47('0x17')]);}_0x46f225[_0xee47('0x37')]=qs['sort'](_0x58bd18['query'][_0xee47('0x38')]);_0x46f225[_0xee47('0x39')]=qs[_0xee47('0x30')](_[_0xee47('0x3a')](_0x58bd18[_0xee47('0x2f')],_0x2e4806[_0xee47('0x30')]),_0x1d67e2);if(_0x58bd18['query'][_0xee47('0x3b')]){_0x46f225[_0xee47('0x39')]=_[_0xee47('0x3c')](_0x46f225[_0xee47('0x39')],{'$or':_[_0xee47('0x27')](_0x1d67e2,function(_0x1e7ad5){if(_0x1e7ad5['type']!==_0xee47('0x3d')){var _0x32af49={};_0x32af49[_0x1e7ad5['name']]={'$like':'%'+_0x58bd18[_0xee47('0x2f')][_0xee47('0x3b')]+'%'};return _0x32af49;}})});}_0x46f225=_['merge']({},_0x46f225,_0x58bd18[_0xee47('0x3e')]);var _0x5e9362={'where':_0x46f225[_0xee47('0x39')]};return db[_0xee47('0x28')]['count'](_0x5e9362)[_0xee47('0x1f')](function(_0x43313c){_0x5cde67[_0xee47('0x3f')]=_0x43313c;if(_0x58bd18[_0xee47('0x2f')][_0xee47('0x40')]){_0x46f225[_0xee47('0x41')]=[{'all':!![]}];}return db[_0xee47('0x28')][_0xee47('0x42')](_0x46f225);})[_0xee47('0x1f')](function(_0x196d79){_0x5cde67[_0xee47('0x43')]=_0x196d79;return _0x5cde67;})[_0xee47('0x1f')](respondWithFilteredResult(_0x10e886,_0x46f225))[_0xee47('0x44')](handleError(_0x10e886,null));};exports[_0xee47('0x45')]=function(_0x3808bb,_0x417bb4){var _0x5c3946={'raw':!![],'where':{'id':_0x3808bb[_0xee47('0x46')]['id']}},_0x5876fb={};_0x5876fb[_0xee47('0x2d')]=_[_0xee47('0x2e')](db[_0xee47('0x28')][_0xee47('0x29')]);_0x5876fb[_0xee47('0x2f')]=_[_0xee47('0x2e')](_0x3808bb['query']);_0x5876fb[_0xee47('0x30')]=_[_0xee47('0x31')](_0x5876fb[_0xee47('0x2d')],_0x5876fb[_0xee47('0x2f')]);_0x5c3946[_0xee47('0x33')]=_[_0xee47('0x31')](_0x5876fb[_0xee47('0x2d')],qs[_0xee47('0x32')](_0x3808bb[_0xee47('0x2f')][_0xee47('0x32')]));_0x5c3946[_0xee47('0x33')]=_0x5c3946['attributes'][_0xee47('0x34')]?_0x5c3946[_0xee47('0x33')]:_0x5876fb['model'];if(_0x3808bb[_0xee47('0x2f')][_0xee47('0x40')]){_0x5c3946['include']=[{'all':!![]}];}_0x5c3946=_[_0xee47('0x3c')]({},_0x5c3946,_0x3808bb[_0xee47('0x3e')]);return db[_0xee47('0x28')][_0xee47('0x47')](_0x5c3946)['then'](handleEntityNotFound(_0x417bb4,null))[_0xee47('0x1f')](respondWithResult(_0x417bb4,null))[_0xee47('0x44')](handleError(_0x417bb4,null));};exports[_0xee47('0x48')]=function(_0x2473b9,_0x28992b){return db[_0xee47('0x28')][_0xee47('0x48')](_0x2473b9[_0xee47('0x49')],{})[_0xee47('0x1f')](function(_0xa3c55f){var _0xc8008d=_0x2473b9[_0xee47('0x4a')]['get']({'plain':!![]});if(!_0xc8008d)throw new Error(_0xee47('0x4b'));if(_0xc8008d['role']===_0xee47('0x4a')){var _0x50a9f7=_0xa3c55f[_0xee47('0x20')]({'plain':!![]});var _0x390018=_0xee47('0x4c');return db[_0xee47('0x4d')]['find']({'where':{'name':_0x390018,'userProfileId':_0xc8008d[_0xee47('0x4e')]},'raw':!![]})[_0xee47('0x1f')](function(_0x455a15){if(_0x455a15&&_0x455a15[_0xee47('0x4f')]===0x0){return db[_0xee47('0x21')][_0xee47('0x48')]({'name':_0x50a9f7['name'],'resourceId':_0x50a9f7['id'],'type':_0x455a15['name'],'sectionId':_0x455a15['id']},{})[_0xee47('0x1f')](function(){return _0xa3c55f;});}else{return _0xa3c55f;}})[_0xee47('0x44')](function(_0x5d4575){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d4575);throw _0x5d4575;});}return _0xa3c55f;})[_0xee47('0x1f')](respondWithResult(_0x28992b,0xc9))['catch'](handleError(_0x28992b,null));};exports[_0xee47('0x50')]=function(_0x394e64,_0x4e29e0){if(_0x394e64[_0xee47('0x49')]['id']){delete _0x394e64[_0xee47('0x49')]['id'];}return db[_0xee47('0x28')]['find']({'where':{'id':_0x394e64[_0xee47('0x46')]['id']}})[_0xee47('0x1f')](handleEntityNotFound(_0x4e29e0,null))[_0xee47('0x1f')](saveUpdates(_0x394e64[_0xee47('0x49')],null))[_0xee47('0x1f')](respondWithResult(_0x4e29e0,null))[_0xee47('0x44')](handleError(_0x4e29e0,null));};exports['destroy']=function(_0x1bc11d,_0x518c89){return db[_0xee47('0x28')][_0xee47('0x47')]({'where':{'id':_0x1bc11d['params']['id']}})['then'](handleEntityNotFound(_0x518c89,null))[_0xee47('0x1f')](removeEntity(_0x518c89,null))[_0xee47('0x44')](handleError(_0x518c89,null));}; \ No newline at end of file +var _0x2c4d=['count','includeAll','rows','catch','fields','include','merge','body','user','role','Dispositions','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','squel','crypto','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','sendStatus','status','end','json','offset','limit','apply','reject','update','then','destroy','get','error','name','send','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options'];(function(_0xce5e10,_0x2bc043){var _0x1145f9=function(_0x1594d8){while(--_0x1594d8){_0xce5e10['push'](_0xce5e10['shift']());}};_0x1145f9(++_0x2bc043);}(_0x2c4d,0xa9));var _0xd2c4=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0x2c4d[_0x55754e];return _0x2e9948;};'use strict';var pdf=require(_0xd2c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd2c4('0x1'));var zipdir=require(_0xd2c4('0x2'));var jsonpatch=require(_0xd2c4('0x3'));var rp=require(_0xd2c4('0x4'));var moment=require('moment');var BPromise=require(_0xd2c4('0x5'));var Mustache=require(_0xd2c4('0x6'));var util=require('util');var path=require(_0xd2c4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd2c4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd2c4('0x9'));var crypto=require(_0xd2c4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd2c4('0xb'));var toCsv=require(_0xd2c4('0xc'));var querystring=require(_0xd2c4('0xd'));var Papa=require(_0xd2c4('0xe'));var Redis=require(_0xd2c4('0xf'));var authService=require(_0xd2c4('0x10'));var qs=require(_0xd2c4('0x11'));var as=require(_0xd2c4('0x12'));var hardwareService=require(_0xd2c4('0x13'));var logger=require(_0xd2c4('0x14'))(_0xd2c4('0x15'));var utils=require('../../config/utils');var config=require(_0xd2c4('0x16'));var db=require(_0xd2c4('0x17'))['db'];function respondWithStatusCode(_0x24003f,_0x467f0e){_0x467f0e=_0x467f0e||0xcc;return function(_0x2a3575){if(_0x2a3575){return _0x24003f[_0xd2c4('0x18')](_0x467f0e);}return _0x24003f[_0xd2c4('0x19')](_0x467f0e)[_0xd2c4('0x1a')]();};}function respondWithResult(_0x45fcae,_0x4c1d4a){_0x4c1d4a=_0x4c1d4a||0xc8;return function(_0x116a46){if(_0x116a46){return _0x45fcae['status'](_0x4c1d4a)[_0xd2c4('0x1b')](_0x116a46);}};}function respondWithFilteredResult(_0x357a2e,_0x37db0e){return function(_0x37af8f){if(_0x37af8f){var _0x4be650=_0x37af8f['count'],_0xf94fbb=_0x37db0e[_0xd2c4('0x1c')],_0x2ac5e7=_0x37db0e['offset']+_0x37db0e[_0xd2c4('0x1d')],_0x1ee720;if(_0x2ac5e7>=_0x4be650){_0x2ac5e7=_0x4be650;_0x1ee720=0xc8;}else{_0x1ee720=0xce;}_0x357a2e['status'](_0x1ee720);return _0x357a2e['set']('Content-Range',_0xf94fbb+'-'+_0x2ac5e7+'/'+_0x4be650)[_0xd2c4('0x1b')](_0x37af8f);}return null;};}function patchUpdates(_0x28831c){return function(_0x50a4de){try{jsonpatch[_0xd2c4('0x1e')](_0x50a4de,_0x28831c,!![]);}catch(_0x522558){return BPromise[_0xd2c4('0x1f')](_0x522558);}return _0x50a4de['save']();};}function saveUpdates(_0x5f134a,_0x5ab24a){return function(_0x16d4e7){if(_0x16d4e7){return _0x16d4e7[_0xd2c4('0x20')](_0x5f134a)[_0xd2c4('0x21')](function(_0x2e6d94){return _0x2e6d94;});}return null;};}function removeEntity(_0x25e6e5,_0x25ba48){return function(_0x5b069a){if(_0x5b069a){return _0x5b069a[_0xd2c4('0x22')]()['then'](function(){var _0x348d44=_0x5b069a[_0xd2c4('0x23')]({'plain':!![]});var _0x334fab='Dispositions';return db['UserProfileResource'][_0xd2c4('0x22')]({'where':{'type':_0x334fab,'resourceId':_0x348d44['id']}})[_0xd2c4('0x21')](function(){return _0x5b069a;});})['then'](function(){_0x25e6e5['status'](0xcc)[_0xd2c4('0x1a')]();});}};}function handleEntityNotFound(_0x43293d,_0x3731ef){return function(_0x518a6c){if(!_0x518a6c){_0x43293d[_0xd2c4('0x18')](0x194);}return _0x518a6c;};}function handleError(_0x314076,_0xf1c593){_0xf1c593=_0xf1c593||0x1f4;return function(_0x5ec9ce){logger[_0xd2c4('0x24')](_0x5ec9ce['stack']);if(_0x5ec9ce[_0xd2c4('0x25')]){delete _0x5ec9ce[_0xd2c4('0x25')];}_0x314076[_0xd2c4('0x19')](_0xf1c593)[_0xd2c4('0x26')](_0x5ec9ce);};}exports['index']=function(_0x5cdc8f,_0x57b362){var _0x429ce2={},_0x3742df={},_0x1ac64d={'count':0x0,'rows':[]};var _0x26efee=_[_0xd2c4('0x27')](db[_0xd2c4('0x28')][_0xd2c4('0x29')],function(_0x175e49){return{'name':_0x175e49[_0xd2c4('0x2a')],'type':_0x175e49['type'][_0xd2c4('0x2b')]};});_0x3742df[_0xd2c4('0x2c')]=_['map'](_0x26efee,_0xd2c4('0x25'));_0x3742df[_0xd2c4('0x2d')]=_[_0xd2c4('0x2e')](_0x5cdc8f[_0xd2c4('0x2d')]);_0x3742df[_0xd2c4('0x2f')]=_['intersection'](_0x3742df['model'],_0x3742df[_0xd2c4('0x2d')]);_0x429ce2[_0xd2c4('0x30')]=_[_0xd2c4('0x31')](_0x3742df[_0xd2c4('0x2c')],qs['fields'](_0x5cdc8f['query']['fields']));_0x429ce2[_0xd2c4('0x30')]=_0x429ce2[_0xd2c4('0x30')][_0xd2c4('0x32')]?_0x429ce2[_0xd2c4('0x30')]:_0x3742df['model'];if(!_0x5cdc8f[_0xd2c4('0x2d')][_0xd2c4('0x33')](_0xd2c4('0x34'))){_0x429ce2['limit']=qs[_0xd2c4('0x1d')](_0x5cdc8f[_0xd2c4('0x2d')][_0xd2c4('0x1d')]);_0x429ce2[_0xd2c4('0x1c')]=qs[_0xd2c4('0x1c')](_0x5cdc8f['query'][_0xd2c4('0x1c')]);}_0x429ce2['order']=qs[_0xd2c4('0x35')](_0x5cdc8f[_0xd2c4('0x2d')][_0xd2c4('0x35')]);_0x429ce2[_0xd2c4('0x36')]=qs[_0xd2c4('0x2f')](_[_0xd2c4('0x37')](_0x5cdc8f[_0xd2c4('0x2d')],_0x3742df['filters']),_0x26efee);if(_0x5cdc8f['query'][_0xd2c4('0x38')]){_0x429ce2[_0xd2c4('0x36')]=_['merge'](_0x429ce2[_0xd2c4('0x36')],{'$or':_[_0xd2c4('0x27')](_0x26efee,function(_0x390654){if(_0x390654['type']!==_0xd2c4('0x39')){var _0x2cbc00={};_0x2cbc00[_0x390654['name']]={'$like':'%'+_0x5cdc8f[_0xd2c4('0x2d')][_0xd2c4('0x38')]+'%'};return _0x2cbc00;}})});}_0x429ce2=_['merge']({},_0x429ce2,_0x5cdc8f[_0xd2c4('0x3a')]);var _0x30fe37={'where':_0x429ce2[_0xd2c4('0x36')]};return db[_0xd2c4('0x28')][_0xd2c4('0x3b')](_0x30fe37)[_0xd2c4('0x21')](function(_0xe039dd){_0x1ac64d['count']=_0xe039dd;if(_0x5cdc8f[_0xd2c4('0x2d')][_0xd2c4('0x3c')]){_0x429ce2['include']=[{'all':!![]}];}return db[_0xd2c4('0x28')]['findAll'](_0x429ce2);})[_0xd2c4('0x21')](function(_0x3da458){_0x1ac64d[_0xd2c4('0x3d')]=_0x3da458;return _0x1ac64d;})[_0xd2c4('0x21')](respondWithFilteredResult(_0x57b362,_0x429ce2))[_0xd2c4('0x3e')](handleError(_0x57b362,null));};exports['show']=function(_0x1acd18,_0x3c1fea){var _0x1f8089={'raw':!![],'where':{'id':_0x1acd18['params']['id']}},_0x1e1140={};_0x1e1140[_0xd2c4('0x2c')]=_['keys'](db['Disposition'][_0xd2c4('0x29')]);_0x1e1140[_0xd2c4('0x2d')]=_[_0xd2c4('0x2e')](_0x1acd18[_0xd2c4('0x2d')]);_0x1e1140['filters']=_[_0xd2c4('0x31')](_0x1e1140[_0xd2c4('0x2c')],_0x1e1140[_0xd2c4('0x2d')]);_0x1f8089[_0xd2c4('0x30')]=_[_0xd2c4('0x31')](_0x1e1140[_0xd2c4('0x2c')],qs[_0xd2c4('0x3f')](_0x1acd18['query'][_0xd2c4('0x3f')]));_0x1f8089[_0xd2c4('0x30')]=_0x1f8089[_0xd2c4('0x30')]['length']?_0x1f8089[_0xd2c4('0x30')]:_0x1e1140['model'];if(_0x1acd18[_0xd2c4('0x2d')][_0xd2c4('0x3c')]){_0x1f8089[_0xd2c4('0x40')]=[{'all':!![]}];}_0x1f8089=_[_0xd2c4('0x41')]({},_0x1f8089,_0x1acd18[_0xd2c4('0x3a')]);return db[_0xd2c4('0x28')]['find'](_0x1f8089)['then'](handleEntityNotFound(_0x3c1fea,null))[_0xd2c4('0x21')](respondWithResult(_0x3c1fea,null))[_0xd2c4('0x3e')](handleError(_0x3c1fea,null));};exports['create']=function(_0x17d655,_0x3e78c4){return db[_0xd2c4('0x28')]['create'](_0x17d655[_0xd2c4('0x42')],{})['then'](function(_0xbe7161){var _0x32ae45=_0x17d655[_0xd2c4('0x43')][_0xd2c4('0x23')]({'plain':!![]});if(!_0x32ae45)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32ae45[_0xd2c4('0x44')]===_0xd2c4('0x43')){var _0x1dc20e=_0xbe7161['get']({'plain':!![]});var _0x3b99d9=_0xd2c4('0x45');return db['UserProfileSection'][_0xd2c4('0x46')]({'where':{'name':_0x3b99d9,'userProfileId':_0x32ae45[_0xd2c4('0x47')]},'raw':!![]})['then'](function(_0x9c9d40){if(_0x9c9d40&&_0x9c9d40[_0xd2c4('0x48')]===0x0){return db[_0xd2c4('0x49')]['create']({'name':_0x1dc20e[_0xd2c4('0x25')],'resourceId':_0x1dc20e['id'],'type':_0x9c9d40['name'],'sectionId':_0x9c9d40['id']},{})[_0xd2c4('0x21')](function(){return _0xbe7161;});}else{return _0xbe7161;}})['catch'](function(_0x252f2d){logger[_0xd2c4('0x24')](_0xd2c4('0x4a'),_0x252f2d);throw _0x252f2d;});}return _0xbe7161;})[_0xd2c4('0x21')](respondWithResult(_0x3e78c4,0xc9))[_0xd2c4('0x3e')](handleError(_0x3e78c4,null));};exports[_0xd2c4('0x20')]=function(_0x5e7d44,_0x57af13){if(_0x5e7d44['body']['id']){delete _0x5e7d44['body']['id'];}return db[_0xd2c4('0x28')]['find']({'where':{'id':_0x5e7d44[_0xd2c4('0x4b')]['id']}})[_0xd2c4('0x21')](handleEntityNotFound(_0x57af13,null))[_0xd2c4('0x21')](saveUpdates(_0x5e7d44[_0xd2c4('0x42')],null))['then'](respondWithResult(_0x57af13,null))['catch'](handleError(_0x57af13,null));};exports[_0xd2c4('0x22')]=function(_0x4d6dae,_0x3c5be3){return db['Disposition'][_0xd2c4('0x46')]({'where':{'id':_0x4d6dae['params']['id']}})['then'](handleEntityNotFound(_0x3c5be3,null))[_0xd2c4('0x21')](removeEntity(_0x3c5be3,null))['catch'](handleError(_0x3c5be3,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index ba274a7..719f7b3 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 _0x6ac0=['WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x134813,_0x397328){var _0x3abb44=function(_0x3dc7f7){while(--_0x3dc7f7){_0x134813['push'](_0x134813['shift']());}};_0x3abb44(++_0x397328);}(_0x6ac0,0x1cd));var _0x06ac=function(_0x3fee5a,_0x11649c){_0x3fee5a=_0x3fee5a-0x0;var _0x4a4d10=_0x6ac0[_0x3fee5a];return _0x4a4d10;};'use strict';var _=require(_0x06ac('0x0'));var util=require(_0x06ac('0x1'));var logger=require(_0x06ac('0x2'))(_0x06ac('0x3'));var moment=require(_0x06ac('0x4'));var BPromise=require(_0x06ac('0x5'));var rp=require(_0x06ac('0x6'));var fs=require('fs');var path=require(_0x06ac('0x7'));var rimraf=require('rimraf');var config=require(_0x06ac('0x8'));var attributes=require('./disposition.attributes');module['exports']=function(_0x423adc,_0x328204){return _0x423adc[_0x06ac('0x9')](_0x06ac('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x06ac('0xb'),'fields':[_0x06ac('0xc'),_0x06ac('0xd')]},{'unique':!![],'name':_0x06ac('0xe'),'fields':[_0x06ac('0xc'),_0x06ac('0xf')]},{'unique':!![],'name':_0x06ac('0x10'),'fields':[_0x06ac('0xc'),_0x06ac('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x06ac('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x06ac('0xc'),_0x06ac('0x12')]},{'unique':!![],'name':_0x06ac('0x13'),'fields':[_0x06ac('0xc'),_0x06ac('0x14')]},{'unique':!![],'name':_0x06ac('0x15'),'fields':[_0x06ac('0xc'),_0x06ac('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x24ab=['api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','lodash','util','../../config/logger'];(function(_0x3304fa,_0x5000e2){var _0x1117bb=function(_0x1dddc5){while(--_0x1dddc5){_0x3304fa['push'](_0x3304fa['shift']());}};_0x1117bb(++_0x5000e2);}(_0x24ab,0x135));var _0xb24a=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x24ab[_0x95942];return _0x6d7f81;};'use strict';var _=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var logger=require(_0xb24a('0x2'))(_0xb24a('0x3'));var moment=require('moment');var BPromise=require(_0xb24a('0x4'));var rp=require(_0xb24a('0x5'));var fs=require('fs');var path=require(_0xb24a('0x6'));var rimraf=require(_0xb24a('0x7'));var config=require(_0xb24a('0x8'));var attributes=require(_0xb24a('0x9'));module[_0xb24a('0xa')]=function(_0x14658c,_0x57fa99){return _0x14658c[_0xb24a('0xb')](_0xb24a('0xc'),attributes,{'tableName':_0xb24a('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xb24a('0xe'),'fields':[_0xb24a('0xf'),_0xb24a('0x10')]},{'unique':!![],'name':_0xb24a('0x11'),'fields':['name',_0xb24a('0x12')]},{'unique':!![],'name':'name_mail','fields':[_0xb24a('0xf'),_0xb24a('0x13')]},{'unique':!![],'name':_0xb24a('0x14'),'fields':['name',_0xb24a('0x15')]},{'unique':!![],'name':_0xb24a('0x16'),'fields':[_0xb24a('0xf'),_0xb24a('0x17')]},{'unique':!![],'name':_0xb24a('0x18'),'fields':[_0xb24a('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':_0xb24a('0x19'),'fields':['name','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 1604be7..62ec9cb 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 _0xf646=['info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xf646,0xf9));var _0x6f64=function(_0x57d184,_0xbb269b){_0x57d184=_0x57d184-0x0;var _0x5570a7=_0xf646[_0x57d184];return _0x5570a7;};'use strict';var _=require(_0x6f64('0x0'));var util=require(_0x6f64('0x1'));var moment=require('moment');var BPromise=require(_0x6f64('0x2'));var rs=require(_0x6f64('0x3'));var fs=require('fs');var Redis=require(_0x6f64('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f64('0x5'));var logger=require(_0x6f64('0x6'))(_0x6f64('0x7'));var config=require(_0x6f64('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43ad84,_0x1e5c97,_0x140707){return new BPromise(function(_0x5b494c,_0x3382a9){return client[_0x6f64('0xa')](_0x43ad84,_0x140707)['then'](function(_0x19579e){logger[_0x6f64('0xb')](_0x6f64('0xc'),_0x1e5c97,_0x6f64('0xd'));logger[_0x6f64('0xe')](_0x6f64('0xf'),_0x1e5c97,_0x6f64('0xd'),JSON['stringify'](_0x19579e));if(_0x19579e['error']){if(_0x19579e[_0x6f64('0x10')][_0x6f64('0x11')]===0x1f4){logger['error'](_0x6f64('0xc'),_0x1e5c97,_0x19579e[_0x6f64('0x10')][_0x6f64('0x12')]);return _0x3382a9(_0x19579e['error'][_0x6f64('0x12')]);}logger[_0x6f64('0x10')](_0x6f64('0xc'),_0x1e5c97,_0x19579e[_0x6f64('0x10')]['message']);return _0x5b494c(_0x19579e[_0x6f64('0x10')]['message']);}else{logger[_0x6f64('0xb')]('Disposition,\x20%s,\x20%s',_0x1e5c97,_0x6f64('0xd'));_0x5b494c(_0x19579e[_0x6f64('0x13')][_0x6f64('0x12')]);}})['catch'](function(_0x54577b){logger[_0x6f64('0x10')](_0x6f64('0xc'),_0x1e5c97,_0x54577b);_0x3382a9(_0x54577b);});});} \ No newline at end of file +var _0x20d9=['error','code','message','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Disposition,\x20%s,\x20%s','debug','Disposition,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xcf31f3,_0x4517db){var _0x362842=function(_0x273529){while(--_0x273529){_0xcf31f3['push'](_0xcf31f3['shift']());}};_0x362842(++_0x4517db);}(_0x20d9,0x88));var _0x920d=function(_0x35a2ea,_0x1c44af){_0x35a2ea=_0x35a2ea-0x0;var _0x9cc255=_0x20d9[_0x35a2ea];return _0x9cc255;};'use strict';var _=require(_0x920d('0x0'));var util=require(_0x920d('0x1'));var moment=require('moment');var BPromise=require(_0x920d('0x2'));var rs=require(_0x920d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x920d('0x4'));var logger=require(_0x920d('0x5'))(_0x920d('0x6'));var config=require(_0x920d('0x7'));var jayson=require(_0x920d('0x8'));var client=jayson[_0x920d('0x9')][_0x920d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12d6c2,_0x47ad40,_0x24feba){return new BPromise(function(_0x21662e,_0x1d2f9a){return client[_0x920d('0xb')](_0x12d6c2,_0x24feba)[_0x920d('0xc')](function(_0x40a28d){logger[_0x920d('0xd')](_0x920d('0xe'),_0x47ad40,'request\x20sent');logger[_0x920d('0xf')](_0x920d('0x10'),_0x47ad40,_0x920d('0x11'),JSON['stringify'](_0x40a28d));if(_0x40a28d[_0x920d('0x12')]){if(_0x40a28d[_0x920d('0x12')][_0x920d('0x13')]===0x1f4){logger[_0x920d('0x12')](_0x920d('0xe'),_0x47ad40,_0x40a28d[_0x920d('0x12')]['message']);return _0x1d2f9a(_0x40a28d[_0x920d('0x12')][_0x920d('0x14')]);}logger[_0x920d('0x12')]('Disposition,\x20%s,\x20%s',_0x47ad40,_0x40a28d['error'][_0x920d('0x14')]);return _0x21662e(_0x40a28d[_0x920d('0x12')][_0x920d('0x14')]);}else{logger['info'](_0x920d('0xe'),_0x47ad40,'request\x20sent');_0x21662e(_0x40a28d['result'][_0x920d('0x14')]);}})[_0x920d('0x15')](function(_0x27810d){logger['error']('Disposition,\x20%s,\x20%s',_0x47ad40,_0x27810d);_0x1d2f9a(_0x27810d);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 84b897d..382a5f3 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 _0x6d5e=['put','/:id','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x28cbc0,_0x203516){var _0x4b3cf5=function(_0x2a15c6){while(--_0x2a15c6){_0x28cbc0['push'](_0x28cbc0['shift']());}};_0x4b3cf5(++_0x203516);}(_0x6d5e,0x103));var _0xe6d5=function(_0x580f58,_0x37cee4){_0x580f58=_0x580f58-0x0;var _0xd96fb3=_0x6d5e[_0x580f58];return _0xd96fb3;};'use strict';var multer=require(_0xe6d5('0x0'));var util=require(_0xe6d5('0x1'));var path=require(_0xe6d5('0x2'));var timeout=require(_0xe6d5('0x3'));var express=require('express');var router=express[_0xe6d5('0x4')]();var auth=require(_0xe6d5('0x5'));var interaction=require(_0xe6d5('0x6'));var config=require(_0xe6d5('0x7'));var controller=require(_0xe6d5('0x8'));router[_0xe6d5('0x9')]('/',auth[_0xe6d5('0xa')](),controller['index']);router[_0xe6d5('0x9')]('/:id',auth[_0xe6d5('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe6d5('0xb')](_0xe6d5('0xc'),auth[_0xe6d5('0xa')](),controller[_0xe6d5('0xd')]);router['delete'](_0xe6d5('0xc'),auth[_0xe6d5('0xa')](),controller[_0xe6d5('0xe')]);module['exports']=router; \ No newline at end of file +var _0x500c=['../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5d6a67,_0x15db02){var _0x18369a=function(_0x333e9f){while(--_0x333e9f){_0x5d6a67['push'](_0x5d6a67['shift']());}};_0x18369a(++_0x15db02);}(_0x500c,0x188));var _0xc500=function(_0x48f4d8,_0x20203c){_0x48f4d8=_0x48f4d8-0x0;var _0x3a6f7e=_0x500c[_0x48f4d8];return _0x3a6f7e;};'use strict';var multer=require(_0xc500('0x0'));var util=require(_0xc500('0x1'));var path=require(_0xc500('0x2'));var timeout=require(_0xc500('0x3'));var express=require(_0xc500('0x4'));var router=express[_0xc500('0x5')]();var auth=require(_0xc500('0x6'));var interaction=require(_0xc500('0x7'));var config=require(_0xc500('0x8'));var controller=require(_0xc500('0x9'));router[_0xc500('0xa')]('/',auth[_0xc500('0xb')](),controller[_0xc500('0xc')]);router[_0xc500('0xa')](_0xc500('0xd'),auth['isAuthenticated'](),controller[_0xc500('0xe')]);router['post']('/',auth[_0xc500('0xb')](),controller[_0xc500('0xf')]);router[_0xc500('0x10')](_0xc500('0xd'),auth[_0xc500('0xb')](),controller[_0xc500('0x11')]);router['delete'](_0xc500('0xd'),auth['isAuthenticated'](),controller[_0xc500('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index bf5e8c2..41da520 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 _0xb4b5=['v17,v27,v29','INTEGER','SIP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','ENUM','2400','4800','7200','9600','12000','14400'];(function(_0x5a2013,_0x1fd232){var _0x543b9f=function(_0x57caf6){while(--_0x57caf6){_0x5a2013['push'](_0x5a2013['shift']());}};_0x543b9f(++_0x1fd232);}(_0xb4b5,0x1ed));var _0x5b4b=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0xb4b5[_0x2e5f9c];return _0x538b44;};'use strict';var Sequelize=require(_0x5b4b('0x0'));module[_0x5b4b('0x1')]={'name':{'type':Sequelize[_0x5b4b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5b4b('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x5b4b('0x3'),'no'),'defaultValue':_0x5b4b('0x3')},'headerinfo':{'type':Sequelize[_0x5b4b('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x5b4b('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x5b4b('0x4')](_0x5b4b('0x5'),_0x5b4b('0x6'),_0x5b4b('0x7'),_0x5b4b('0x8'),_0x5b4b('0x9'),'14400'),'defaultValue':_0x5b4b('0x6')},'maxrate':{'type':Sequelize[_0x5b4b('0x4')](_0x5b4b('0x5'),'4800','7200',_0x5b4b('0x8'),'12000','14400'),'defaultValue':_0x5b4b('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5b4b('0xb')},'gateway':{'type':Sequelize[_0x5b4b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5b4b('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5b4b('0x4')](_0x5b4b('0xd'),'IAX','DADHI','KHOMP'),'defaultValue':_0x5b4b('0xd')},'key':{'type':Sequelize[_0x5b4b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5b4b('0xe');}},'notificationSound':{'type':Sequelize[_0x5b4b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5b4b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5b4b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b4b('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5b4b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5b4b('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b4b('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b4b('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x5b4b('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x5b4b('0xf')],'defaultValue':![],'comment':_0x5b4b('0x11'),'set':function(_0x523b8b){if(!_0x523b8b)this[_0x5b4b('0x12')](_0x5b4b('0x13'),null);this[_0x5b4b('0x12')](_0x5b4b('0x14'),_0x523b8b);}}}; \ No newline at end of file +var _0x9501=['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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600','14400','12000','DADHI','KHOMP'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x9501,0x11d));var _0x1950=function(_0x5c9781,_0x4c20c0){_0x5c9781=_0x5c9781-0x0;var _0x4db976=_0x9501[_0x5c9781];return _0x4db976;};'use strict';var Sequelize=require(_0x1950('0x0'));module[_0x1950('0x1')]={'name':{'type':Sequelize[_0x1950('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1950('0x2')]},'ecm':{'type':Sequelize[_0x1950('0x3')]('yes','no'),'defaultValue':_0x1950('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x1950('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x1950('0x6')},'minrate':{'type':Sequelize[_0x1950('0x3')](_0x1950('0x7'),_0x1950('0x8'),'7200',_0x1950('0x9'),'12000',_0x1950('0xa')),'defaultValue':_0x1950('0x8')},'maxrate':{'type':Sequelize[_0x1950('0x3')]('2400','4800','7200',_0x1950('0x9'),_0x1950('0xb'),_0x1950('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x1950('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x1950('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1950('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1950('0x3')]('SIP','IAX',_0x1950('0xc'),_0x1950('0xd')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1950('0xe')],'defaultValue':function(){return _0x1950('0xf');}},'notificationSound':{'type':Sequelize[_0x1950('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1950('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1950('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1950('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1950('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1950('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x1950('0x10')],'defaultValue':![],'comment':_0x1950('0x13'),'set':function(_0x42fff4){if(!_0x42fff4)this['setDataValue'](_0x1950('0x14'),null);this[_0x1950('0x15')](_0x1950('0x16'),_0x42fff4);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 252bbd1..96f5c1a 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 _0x1929=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','ValidationError','request','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','FaxAccounts','UserProfileResource','end','name','index','Pause','FaxAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','Owner','internal','Tag','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','push','Answer','ecm','gateway','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Set','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','get','VoiceExtension','bulkCreate','omit','tech','createdAt','TrunkId','ListId','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x1929,0x187));var _0x9192=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0x1929[_0x4709c8];return _0x478cdd;};'use strict';var pdf=require(_0x9192('0x0'));var emlformat=require(_0x9192('0x1'));var rimraf=require(_0x9192('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9192('0x3'));var moment=require(_0x9192('0x4'));var BPromise=require(_0x9192('0x5'));var Mustache=require(_0x9192('0x6'));var util=require(_0x9192('0x7'));var path=require(_0x9192('0x8'));var sox=require(_0x9192('0x9'));var csv=require(_0x9192('0xa'));var ejs=require(_0x9192('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9192('0xc'));var crypto=require(_0x9192('0xd'));var jsforce=require(_0x9192('0xe'));var deskjs=require(_0x9192('0xf'));var toCsv=require(_0x9192('0xa'));var querystring=require(_0x9192('0x10'));var Papa=require(_0x9192('0x11'));var Redis=require(_0x9192('0x12'));var authService=require(_0x9192('0x13'));var qs=require(_0x9192('0x14'));var as=require(_0x9192('0x15'));var hardwareService=require(_0x9192('0x16'));var logger=require('../../config/logger')(_0x9192('0x17'));var utils=require(_0x9192('0x18'));var config=require(_0x9192('0x19'));var db=require(_0x9192('0x1a'))['db'];config[_0x9192('0x1b')]=_[_0x9192('0x1c')](config['redis'],{'host':_0x9192('0x1d'),'port':0x18eb});var socket=require(_0x9192('0x1e'))(new Redis(config[_0x9192('0x1b')]));require('./faxAccount.socket')[_0x9192('0x1f')](socket);var jayson=require(_0x9192('0x20'));var client=jayson[_0x9192('0x21')][_0x9192('0x22')]({'port':0x232c});var client9002=jayson[_0x9192('0x21')][_0x9192('0x22')]({'port':0x232a});function checkPasswordPattern(_0x11075e,_0x327ae4,_0x5979d6){if(_0x5979d6){var _0x21ce2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21ce2b['test'](_0x327ae4)){return _0x11075e;}else{throw new db['Sequelize'][(_0x9192('0x23'))]('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 _0x11075e;}}function respondWithRpcPromise(_0x58730f,_0x59db53,_0x1eafe0,_0x321a44){return new BPromise(function(_0x3c9fb2,_0x3b6674){var _0x7b1b85=_0x321a44||client;return _0x7b1b85[_0x9192('0x24')](_0x58730f,_0x1eafe0)[_0x9192('0x25')](function(_0x1a2f59){logger['info'](_0x9192('0x26'),_0x59db53,_0x9192('0x27'));logger[_0x9192('0x28')](_0x9192('0x29'),_0x59db53,_0x9192('0x27'),JSON['stringify'](_0x1a2f59));if(_0x1a2f59['error']){if(_0x1a2f59[_0x9192('0x2a')][_0x9192('0x2b')]===0x1f4){logger[_0x9192('0x2a')](_0x9192('0x26'),_0x59db53,_0x1a2f59[_0x9192('0x2a')][_0x9192('0x2c')]);return _0x3b6674(_0x1a2f59[_0x9192('0x2a')][_0x9192('0x2c')]);}logger['error'](_0x9192('0x26'),_0x59db53,_0x1a2f59[_0x9192('0x2a')]['message']);return _0x3c9fb2(_0x1a2f59['error'][_0x9192('0x2c')]);}else{logger[_0x9192('0x2d')]('FaxAccount,\x20%s,\x20%s',_0x59db53,_0x9192('0x27'));_0x3c9fb2(_0x1a2f59[_0x9192('0x2e')][_0x9192('0x2c')]);}})['catch'](function(_0x1a5542){logger[_0x9192('0x2a')](_0x9192('0x26'),_0x59db53,_0x1a5542);_0x3b6674(_0x1a5542);});});}function respondWithStatusCode(_0x32a8df,_0x4739b0){_0x4739b0=_0x4739b0||0xcc;return function(_0xcd2eec){if(_0xcd2eec){return _0x32a8df[_0x9192('0x2f')](_0x4739b0);}return _0x32a8df[_0x9192('0x30')](_0x4739b0)['end']();};}function respondWithResult(_0x75b9c8,_0x2d1aae){_0x2d1aae=_0x2d1aae||0xc8;return function(_0x181560){if(_0x181560){return _0x75b9c8['status'](_0x2d1aae)[_0x9192('0x31')](_0x181560);}};}function respondWithFilteredResult(_0x362d87,_0x3e3f93){return function(_0x591e1e){if(_0x591e1e){var _0x3fa14b=_0x591e1e[_0x9192('0x32')],_0x342cdd=_0x3e3f93[_0x9192('0x33')],_0x204c7a=_0x3e3f93[_0x9192('0x33')]+_0x3e3f93[_0x9192('0x34')],_0xb0209c;if(_0x204c7a>=_0x3fa14b){_0x204c7a=_0x3fa14b;_0xb0209c=0xc8;}else{_0xb0209c=0xce;}_0x362d87['status'](_0xb0209c);return _0x362d87['set'](_0x9192('0x35'),_0x342cdd+'-'+_0x204c7a+'/'+_0x3fa14b)['json'](_0x591e1e);}return null;};}function patchUpdates(_0x4e9f6e){return function(_0x5f59d8){try{jsonpatch[_0x9192('0x36')](_0x5f59d8,_0x4e9f6e,!![]);}catch(_0x129e58){return BPromise[_0x9192('0x37')](_0x129e58);}return _0x5f59d8[_0x9192('0x38')]();};}function saveUpdates(_0x261502,_0xd154b){return function(_0x129cff){if(_0x129cff){return _0x129cff[_0x9192('0x39')](_0x261502)[_0x9192('0x25')](function(_0x4ef1c8){return _0x4ef1c8;});}return null;};}function removeEntity(_0x2351e4,_0x528be9){return function(_0x3887bc){if(_0x3887bc){return _0x3887bc[_0x9192('0x3a')]()['then'](function(){var _0xe38c0d=_0x3887bc['get']({'plain':!![]});var _0x1eb304=_0x9192('0x3b');return db[_0x9192('0x3c')][_0x9192('0x3a')]({'where':{'type':_0x1eb304,'resourceId':_0xe38c0d['id']}})[_0x9192('0x25')](function(){return _0x3887bc;});})[_0x9192('0x25')](function(){_0x2351e4[_0x9192('0x30')](0xcc)[_0x9192('0x3d')]();});}};}function handleEntityNotFound(_0x30d300,_0x24e090){return function(_0x49e161){if(!_0x49e161){_0x30d300[_0x9192('0x2f')](0x194);}return _0x49e161;};}function handleError(_0x2d4167,_0x208d60){_0x208d60=_0x208d60||0x1f4;return function(_0x177b4d){logger['error'](_0x177b4d['stack']);if(_0x177b4d[_0x9192('0x3e')]){delete _0x177b4d['name'];}_0x2d4167[_0x9192('0x30')](_0x208d60)['send'](_0x177b4d);};}exports[_0x9192('0x3f')]=function(_0x75a7ec,_0x4de40a){var _0x1ba08d={'include':[{'model':db[_0x9192('0x40')],'as':'mandatoryDispositionPause'}]},_0x47ce04={},_0x2d346a={'count':0x0,'rows':[]};var _0x528aef=_['map'](db[_0x9192('0x41')][_0x9192('0x42')],function(_0x46d31d){return{'name':_0x46d31d['fieldName'],'type':_0x46d31d[_0x9192('0x43')][_0x9192('0x44')]};});_0x47ce04[_0x9192('0x45')]=_[_0x9192('0x46')](_0x528aef,_0x9192('0x3e'));_0x47ce04[_0x9192('0x47')]=_[_0x9192('0x48')](_0x75a7ec[_0x9192('0x47')]);_0x47ce04[_0x9192('0x49')]=_[_0x9192('0x4a')](_0x47ce04[_0x9192('0x45')],_0x47ce04[_0x9192('0x47')]);_0x1ba08d[_0x9192('0x4b')]=_[_0x9192('0x4a')](_0x47ce04[_0x9192('0x45')],qs['fields'](_0x75a7ec[_0x9192('0x47')][_0x9192('0x4c')]));_0x1ba08d[_0x9192('0x4b')]=_0x1ba08d[_0x9192('0x4b')][_0x9192('0x4d')]?_0x1ba08d['attributes']:_0x47ce04['model'];if(!_0x75a7ec[_0x9192('0x47')][_0x9192('0x4e')](_0x9192('0x4f'))){_0x1ba08d[_0x9192('0x34')]=qs[_0x9192('0x34')](_0x75a7ec[_0x9192('0x47')][_0x9192('0x34')]);_0x1ba08d[_0x9192('0x33')]=qs[_0x9192('0x33')](_0x75a7ec['query']['offset']);}_0x1ba08d['order']=qs[_0x9192('0x50')](_0x75a7ec[_0x9192('0x47')][_0x9192('0x50')]);_0x1ba08d[_0x9192('0x51')]=qs[_0x9192('0x49')](_[_0x9192('0x52')](_0x75a7ec[_0x9192('0x47')],_0x47ce04[_0x9192('0x49')]),_0x528aef);if(_0x75a7ec['query'][_0x9192('0x53')]){_0x1ba08d[_0x9192('0x51')]=_[_0x9192('0x54')](_0x1ba08d['where'],{'$or':_[_0x9192('0x46')](_0x528aef,function(_0x38a4ed){if(_0x38a4ed[_0x9192('0x43')]!==_0x9192('0x55')){var _0x4584a2={};_0x4584a2[_0x38a4ed[_0x9192('0x3e')]]={'$like':'%'+_0x75a7ec[_0x9192('0x47')][_0x9192('0x53')]+'%'};return _0x4584a2;}})});}_0x1ba08d=_[_0x9192('0x54')]({},_0x1ba08d,_0x75a7ec[_0x9192('0x56')]);var _0x536a98={'where':_0x1ba08d[_0x9192('0x51')]};return db['FaxAccount']['count'](_0x536a98)[_0x9192('0x25')](function(_0x8ea4ef){_0x2d346a['count']=_0x8ea4ef;if(_0x75a7ec[_0x9192('0x47')][_0x9192('0x57')]){_0x1ba08d['include']=[{'all':!![]}];}return db[_0x9192('0x41')][_0x9192('0x58')](_0x1ba08d);})[_0x9192('0x25')](function(_0x27efd2){_0x2d346a[_0x9192('0x59')]=_0x27efd2;return _0x2d346a;})[_0x9192('0x25')](respondWithFilteredResult(_0x4de40a,_0x1ba08d))['catch'](handleError(_0x4de40a,null));};exports[_0x9192('0x5a')]=function(_0x2f7baf,_0x427628){var _0xf2cb71={'raw':![],'where':{'id':_0x2f7baf[_0x9192('0x5b')]['id']},'include':[{'model':db[_0x9192('0x40')],'as':_0x9192('0x5c')}]},_0x379c33={};_0x379c33[_0x9192('0x45')]=_[_0x9192('0x48')](db[_0x9192('0x41')][_0x9192('0x42')]);_0x379c33[_0x9192('0x47')]=_[_0x9192('0x48')](_0x2f7baf['query']);_0x379c33['filters']=_[_0x9192('0x4a')](_0x379c33[_0x9192('0x45')],_0x379c33[_0x9192('0x47')]);_0xf2cb71[_0x9192('0x4b')]=_[_0x9192('0x4a')](_0x379c33['model'],qs[_0x9192('0x4c')](_0x2f7baf['query'][_0x9192('0x4c')]));_0xf2cb71[_0x9192('0x4b')]=_0xf2cb71[_0x9192('0x4b')]['length']?_0xf2cb71[_0x9192('0x4b')]:_0x379c33[_0x9192('0x45')];if(_0x2f7baf['query']['includeAll']){_0xf2cb71[_0x9192('0x5d')]=[{'all':!![]}];}_0xf2cb71=_[_0x9192('0x54')]({},_0xf2cb71,_0x2f7baf[_0x9192('0x56')]);return db[_0x9192('0x41')][_0x9192('0x5e')](_0xf2cb71)[_0x9192('0x25')](handleEntityNotFound(_0x427628,null))[_0x9192('0x25')](respondWithResult(_0x427628,null))[_0x9192('0x5f')](handleError(_0x427628,null));};exports[_0x9192('0x60')]=function(_0x564010,_0x3b6a01){return db['FaxAccount']['create'](_0x564010[_0x9192('0x61')],{})[_0x9192('0x25')](function(_0x4419d1){var _0x100537=_0x564010[_0x9192('0x62')]['get']({'plain':!![]});if(!_0x100537)throw new Error(_0x9192('0x63'));if(_0x100537['role']===_0x9192('0x62')){var _0x6a3b01=_0x4419d1['get']({'plain':!![]});var _0x325e4e='FaxAccounts';return db[_0x9192('0x64')]['find']({'where':{'name':_0x325e4e,'userProfileId':_0x100537[_0x9192('0x65')]},'raw':!![]})['then'](function(_0x4e8018){if(_0x4e8018&&_0x4e8018[_0x9192('0x66')]===0x0){return db[_0x9192('0x3c')][_0x9192('0x60')]({'name':_0x6a3b01[_0x9192('0x3e')],'resourceId':_0x6a3b01['id'],'type':_0x4e8018['name'],'sectionId':_0x4e8018['id']},{})['then'](function(){return _0x4419d1;});}else{return _0x4419d1;}})[_0x9192('0x5f')](function(_0x1ada4f){logger[_0x9192('0x2a')](_0x9192('0x67'),_0x1ada4f);throw _0x1ada4f;});}return _0x4419d1;})[_0x9192('0x25')](respondWithResult(_0x3b6a01,0xc9))[_0x9192('0x5f')](handleError(_0x3b6a01,null));};exports[_0x9192('0x39')]=function(_0x22a3e7,_0x4d1dce){if(_0x22a3e7[_0x9192('0x61')]['id']){delete _0x22a3e7['body']['id'];}return db[_0x9192('0x41')]['find']({'where':{'id':_0x22a3e7[_0x9192('0x5b')]['id']},'include':[{'model':db[_0x9192('0x40')],'as':'mandatoryDispositionPause'}]})[_0x9192('0x25')](handleEntityNotFound(_0x4d1dce,null))[_0x9192('0x25')](saveUpdates(_0x22a3e7[_0x9192('0x61')],null))[_0x9192('0x25')](respondWithResult(_0x4d1dce,null))[_0x9192('0x5f')](handleError(_0x4d1dce,null));};exports[_0x9192('0x3a')]=function(_0x2f01e1,_0x204611){return db['FaxAccount'][_0x9192('0x5e')]({'where':{'id':_0x2f01e1[_0x9192('0x5b')]['id']}})['then'](handleEntityNotFound(_0x204611,null))[_0x9192('0x25')](removeEntity(_0x204611,null))[_0x9192('0x5f')](handleError(_0x204611,null));};exports[_0x9192('0x68')]=function(_0x69365c,_0x2a74bd){return db[_0x9192('0x41')]['describe']()[_0x9192('0x25')](respondWithResult(_0x2a74bd,null))[_0x9192('0x5f')](handleError(_0x2a74bd,null));};exports[_0x9192('0x69')]=function(_0x630417,_0x3b85cb,_0xcf32ba){if(_0x630417['body']['id']){delete _0x630417[_0x9192('0x61')]['id'];}return db[_0x9192('0x41')][_0x9192('0x5e')]({'where':{'id':_0x630417[_0x9192('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3b85cb,null))['then'](function(_0x93d21){if(_0x93d21){_0x630417[_0x9192('0x61')][_0x9192('0x6a')]=_0x93d21['id'];return db[_0x9192('0x6b')][_0x9192('0x60')](_0x630417[_0x9192('0x61')]);}})[_0x9192('0x25')](respondWithResult(_0x3b85cb,null))[_0x9192('0x5f')](handleError(_0x3b85cb,null));};exports[_0x9192('0x6c')]=function(_0x53ea43,_0x5dc821,_0x4f90c2){var _0x131392={'raw':![],'where':{}};var _0x1d8523={};var _0x4d69a4={'count':0x0,'rows':[]};return db[_0x9192('0x41')]['findOne']({'where':{'id':_0x53ea43['params']['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x5dc821,null))[_0x9192('0x25')](function(_0x3abfd6){if(_0x3abfd6){_0x1d8523['model']=_[_0x9192('0x48')](db[_0x9192('0x6b')]['rawAttributes']);_0x1d8523[_0x9192('0x47')]=_[_0x9192('0x48')](_0x53ea43[_0x9192('0x47')]);_0x1d8523[_0x9192('0x49')]=_[_0x9192('0x4a')](_0x1d8523[_0x9192('0x45')],_0x1d8523[_0x9192('0x47')]);_0x131392[_0x9192('0x4b')]=_[_0x9192('0x4a')](_0x1d8523[_0x9192('0x45')],qs['fields'](_0x53ea43[_0x9192('0x47')]['fields']));_0x131392[_0x9192('0x4b')]=_0x131392['attributes']['length']?_0x131392[_0x9192('0x4b')]:_0x1d8523['model'];if(!_0x53ea43[_0x9192('0x47')][_0x9192('0x4e')](_0x9192('0x4f'))){_0x131392['limit']=qs['limit'](_0x53ea43[_0x9192('0x47')]['limit']);_0x131392[_0x9192('0x33')]=qs[_0x9192('0x33')](_0x53ea43[_0x9192('0x47')][_0x9192('0x33')]);}_0x131392[_0x9192('0x6d')]=qs[_0x9192('0x50')](_0x53ea43['query'][_0x9192('0x50')]);_0x131392[_0x9192('0x51')]=qs[_0x9192('0x49')](_['pick'](_0x53ea43[_0x9192('0x47')],_0x1d8523[_0x9192('0x49')]));_0x131392[_0x9192('0x51')]['FaxAccountId']=_0x3abfd6['id'];if(_0x53ea43[_0x9192('0x47')][_0x9192('0x53')]){_0x131392[_0x9192('0x51')]=_[_0x9192('0x54')](_0x131392['where'],{'$or':_[_0x9192('0x46')](_0x131392[_0x9192('0x4b')],function(_0x434134){var _0x1332f8={};_0x1332f8[_0x434134]={'$like':'%'+_0x53ea43[_0x9192('0x47')][_0x9192('0x53')]+'%'};return _0x1332f8;})});}_0x131392=_['merge']({},_0x131392,_0x53ea43['options']);return db[_0x9192('0x6b')][_0x9192('0x32')]({'where':_0x131392[_0x9192('0x51')]})[_0x9192('0x25')](function(_0x3d0582){_0x4d69a4['count']=_0x3d0582;if(_0x53ea43[_0x9192('0x47')][_0x9192('0x57')]){_0x131392[_0x9192('0x5d')]=[{'all':!![]}];}return db[_0x9192('0x6b')][_0x9192('0x58')](_0x131392);})[_0x9192('0x25')](function(_0x5efbe3){_0x4d69a4[_0x9192('0x59')]=_0x5efbe3;return _0x4d69a4;});}})[_0x9192('0x25')](respondWithFilteredResult(_0x5dc821,_0x131392))['catch'](handleError(_0x5dc821,null));};exports[_0x9192('0x6e')]=function(_0x17040d,_0xec34ba,_0x2973cf){return db[_0x9192('0x41')][_0x9192('0x5e')]({'where':{'id':_0x17040d[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0xec34ba,null))['then'](function(_0x435e56){if(_0x435e56){return _0x435e56[_0x9192('0x6e')](_0x17040d[_0x9192('0x47')]['ids']);}})[_0x9192('0x25')](respondWithStatusCode(_0xec34ba,null))[_0x9192('0x5f')](handleError(_0xec34ba,null));};exports[_0x9192('0x6f')]=function(_0x390e13,_0x51a363,_0x807641){if(_0x390e13[_0x9192('0x61')]['id']){delete _0x390e13['body']['id'];}return db[_0x9192('0x41')][_0x9192('0x5e')]({'where':{'id':_0x390e13[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x51a363,null))[_0x9192('0x25')](function(_0x395ac3){if(_0x395ac3){_0x390e13[_0x9192('0x61')]['FaxAccountId']=_0x395ac3['id'];return db[_0x9192('0x70')]['create'](_0x390e13[_0x9192('0x61')]);}})[_0x9192('0x25')](respondWithResult(_0x51a363,null))[_0x9192('0x5f')](handleError(_0x51a363,null));};exports[_0x9192('0x71')]=function(_0x3dc01e,_0x890bf4,_0xc43795){var _0x57585f={'raw':![],'where':{}};var _0x4e178b={};var _0x28e92f={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9192('0x72')]({'where':{'id':_0x3dc01e[_0x9192('0x5b')]['id']}})['then'](handleEntityNotFound(_0x890bf4,null))[_0x9192('0x25')](function(_0x113d3a){if(_0x113d3a){_0x4e178b[_0x9192('0x45')]=_[_0x9192('0x48')](db[_0x9192('0x70')][_0x9192('0x42')]);_0x4e178b[_0x9192('0x47')]=_[_0x9192('0x48')](_0x3dc01e['query']);_0x4e178b[_0x9192('0x49')]=_[_0x9192('0x4a')](_0x4e178b[_0x9192('0x45')],_0x4e178b[_0x9192('0x47')]);_0x57585f[_0x9192('0x4b')]=_['intersection'](_0x4e178b[_0x9192('0x45')],qs[_0x9192('0x4c')](_0x3dc01e[_0x9192('0x47')][_0x9192('0x4c')]));_0x57585f[_0x9192('0x4b')]=_0x57585f[_0x9192('0x4b')][_0x9192('0x4d')]?_0x57585f['attributes']:_0x4e178b['model'];if(!_0x3dc01e[_0x9192('0x47')]['hasOwnProperty']('nolimit')){_0x57585f['limit']=qs['limit'](_0x3dc01e['query']['limit']);_0x57585f['offset']=qs[_0x9192('0x33')](_0x3dc01e[_0x9192('0x47')]['offset']);}_0x57585f[_0x9192('0x6d')]=qs['sort'](_0x3dc01e[_0x9192('0x47')][_0x9192('0x50')]);_0x57585f['where']=qs['filters'](_[_0x9192('0x52')](_0x3dc01e[_0x9192('0x47')],_0x4e178b[_0x9192('0x49')]));_0x57585f['where'][_0x9192('0x6a')]=_0x113d3a['id'];if(_0x3dc01e[_0x9192('0x47')]['filter']){_0x57585f['where']=_[_0x9192('0x54')](_0x57585f[_0x9192('0x51')],{'$or':_['map'](_0x57585f['attributes'],function(_0x852ac7){var _0x2d1943={};_0x2d1943[_0x852ac7]={'$like':'%'+_0x3dc01e['query'][_0x9192('0x53')]+'%'};return _0x2d1943;})});}_0x57585f=_[_0x9192('0x54')]({},_0x57585f,_0x3dc01e[_0x9192('0x56')]);return db[_0x9192('0x70')]['count']({'where':_0x57585f['where']})[_0x9192('0x25')](function(_0x4e7153){_0x28e92f[_0x9192('0x32')]=_0x4e7153;if(_0x3dc01e[_0x9192('0x47')][_0x9192('0x57')]){_0x57585f[_0x9192('0x5d')]=[{'all':!![]}];}return db[_0x9192('0x70')][_0x9192('0x58')](_0x57585f);})[_0x9192('0x25')](function(_0x30cd56){_0x28e92f[_0x9192('0x59')]=_0x30cd56;return _0x28e92f;});}})[_0x9192('0x25')](respondWithFilteredResult(_0x890bf4,_0x57585f))[_0x9192('0x5f')](handleError(_0x890bf4,null));};exports[_0x9192('0x73')]=function(_0x1b8cad,_0x594417,_0x5afb9c){return db[_0x9192('0x41')][_0x9192('0x5e')]({'where':{'id':_0x1b8cad[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x594417,null))[_0x9192('0x25')](function(_0x3dcf3a){if(_0x3dcf3a){return _0x3dcf3a[_0x9192('0x73')](_0x1b8cad['query'][_0x9192('0x74')]);}})[_0x9192('0x25')](respondWithStatusCode(_0x594417,null))['catch'](handleError(_0x594417,null));};exports[_0x9192('0x75')]=function(_0x3d8d29,_0x541c20,_0x5de12a){return db[_0x9192('0x76')]['find']({'where':{'id':_0x3d8d29['params']['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x541c20,null))[_0x9192('0x25')](function(_0x261b77){if(_0x261b77){return _0x261b77['addInteraction'](_0x3d8d29[_0x9192('0x61')][_0x9192('0x74')],_['omit'](_0x3d8d29[_0x9192('0x61')],['ids','id'])||{});}})[_0x9192('0x25')](respondWithResult(_0x541c20,null))[_0x9192('0x5f')](handleError(_0x541c20,null));};exports[_0x9192('0x77')]=function(_0x552b43,_0x37596e,_0x4947d3){var _0x38f040={'raw':![],'where':{}};var _0x126be0={};var _0x344f5c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x9192('0x72')]({'where':{'id':_0x552b43['params']['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x37596e,null))[_0x9192('0x25')](function(_0x2f7183){if(_0x2f7183){_0x126be0[_0x9192('0x45')]=_[_0x9192('0x48')](db[_0x9192('0x76')][_0x9192('0x42')]);_0x126be0['query']=_[_0x9192('0x48')](_0x552b43['query']);_0x126be0['filters']=_[_0x9192('0x4a')](_0x126be0['model'],_0x126be0[_0x9192('0x47')]);_0x38f040[_0x9192('0x4b')]=_[_0x9192('0x4a')](_0x126be0[_0x9192('0x45')],qs['fields'](_0x552b43[_0x9192('0x47')][_0x9192('0x4c')]));_0x38f040[_0x9192('0x4b')]=_0x38f040[_0x9192('0x4b')]['length']?_0x38f040[_0x9192('0x4b')]:_0x126be0['model'];if(!_0x552b43[_0x9192('0x47')][_0x9192('0x4e')](_0x9192('0x4f'))){_0x38f040[_0x9192('0x34')]=qs[_0x9192('0x34')](_0x552b43[_0x9192('0x47')][_0x9192('0x34')]);_0x38f040[_0x9192('0x33')]=qs[_0x9192('0x33')](_0x552b43[_0x9192('0x47')][_0x9192('0x33')]);}_0x38f040['order']=qs[_0x9192('0x50')](_0x552b43['query'][_0x9192('0x50')]);_0x38f040[_0x9192('0x51')]=qs[_0x9192('0x49')](_['pick'](_0x552b43[_0x9192('0x47')],_0x126be0['filters']));_0x38f040[_0x9192('0x51')]['FaxAccountId']=_0x2f7183['id'];if(_0x552b43[_0x9192('0x47')][_0x9192('0x53')]){_0x38f040[_0x9192('0x51')]=_[_0x9192('0x54')](_0x38f040[_0x9192('0x51')],{'$or':_[_0x9192('0x46')](_0x38f040[_0x9192('0x4b')],function(_0x48b20e){var _0x76954b={};_0x76954b[_0x48b20e]={'$like':'%'+_0x552b43['query'][_0x9192('0x53')]+'%'};return _0x76954b;})});}_0x38f040=_[_0x9192('0x54')]({},_0x38f040,_0x552b43[_0x9192('0x56')]);return db[_0x9192('0x76')][_0x9192('0x32')]({'where':_0x38f040[_0x9192('0x51')]})[_0x9192('0x25')](function(_0x11837f){_0x344f5c[_0x9192('0x32')]=_0x11837f;if(_0x552b43[_0x9192('0x47')][_0x9192('0x57')]){_0x38f040[_0x9192('0x5d')]=[{'model':db[_0x9192('0x78')],'as':_0x9192('0x79'),'required':![]},{'model':db['User'],'as':_0x9192('0x7a'),'attributes':[_0x9192('0x3e'),'fullname',_0x9192('0x7b')],'required':![]},{'model':db[_0x9192('0x7c')],'as':'Tags','attributes':['id',_0x9192('0x3e'),_0x9192('0x7d')],'where':_0x552b43[_0x9192('0x47')][_0x9192('0x7e')]?{'id':_0x552b43['query'][_0x9192('0x7e')]}:undefined,'required':_0x552b43['query']['tag']?!![]:![]}];}return db['FaxInteraction'][_0x9192('0x58')](_0x38f040);})[_0x9192('0x25')](function(_0x4a6e33){_0x344f5c['rows']=_0x4a6e33;return _0x344f5c;});}})[_0x9192('0x25')](respondWithFilteredResult(_0x37596e,_0x38f040))[_0x9192('0x5f')](handleError(_0x37596e,null));};exports[_0x9192('0x7f')]=function(_0x196321,_0x3fcff2,_0x3ab0c6){return db[_0x9192('0x41')]['findOne']({'where':{'id':_0x196321['params']['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x3fcff2,null))['then'](function(_0x5985db){if(_0x5985db){return db[_0x9192('0x80')][_0x9192('0x81')](function(_0x1d6f71){return db[_0x9192('0x82')][_0x9192('0x3a')]({'where':{'FaxAccountId':_0x196321[_0x9192('0x5b')]['id']},'transaction':_0x1d6f71})[_0x9192('0x25')](function(_0x5424ec){var _0x5c6ba8=_[_0x9192('0x46')](_0x196321[_0x9192('0x61')],function(_0x2553e6){_0x2553e6[_0x9192('0x6a')]=_0x196321[_0x9192('0x5b')]['id'];return _0x2553e6;});return db[_0x9192('0x82')]['bulkCreate'](_0x5c6ba8,{'transaction':_0x1d6f71});});})[_0x9192('0x25')](function(){return db[_0x9192('0x82')][_0x9192('0x83')]({'where':{'FaxAccountId':_0x196321[_0x9192('0x5b')]['id']},'order':_0x9192('0x84')});});}})[_0x9192('0x25')](respondWithResult(_0x3fcff2,null))['catch'](handleError(_0x3fcff2,null));};exports['getApplications']=function(_0x47efad,_0x34905d,_0x4675f1){var _0xb3b633={};var _0x1b9ab6={};var _0xce2046;var _0x1973fa;return db[_0x9192('0x41')][_0x9192('0x72')]({'where':{'id':_0x47efad[_0x9192('0x5b')]['id']}})['then'](handleEntityNotFound(_0x34905d,null))['then'](function(_0x4241f7){if(_0x4241f7){_0xce2046=_0x4241f7;_0x1b9ab6[_0x9192('0x45')]=_['keys'](db['FaxApplication'][_0x9192('0x42')]);_0x1b9ab6['query']=_['keys'](_0x47efad['query']);_0x1b9ab6[_0x9192('0x49')]=_[_0x9192('0x4a')](_0x1b9ab6[_0x9192('0x45')],_0x1b9ab6['query']);_0xb3b633[_0x9192('0x4b')]=_['intersection'](_0x1b9ab6[_0x9192('0x45')],qs[_0x9192('0x4c')](_0x47efad[_0x9192('0x47')][_0x9192('0x4c')]));_0xb3b633[_0x9192('0x4b')]=_0xb3b633[_0x9192('0x4b')][_0x9192('0x4d')]?_0xb3b633[_0x9192('0x4b')]:_0x1b9ab6[_0x9192('0x45')];_0xb3b633[_0x9192('0x6d')]=qs[_0x9192('0x50')](_0x47efad['query'][_0x9192('0x50')]);_0xb3b633['where']=qs[_0x9192('0x49')](_[_0x9192('0x52')](_0x47efad['query'],_0x1b9ab6[_0x9192('0x49')]));if(_0x47efad['query']['filter']){_0xb3b633['where']=_[_0x9192('0x54')](_0xb3b633[_0x9192('0x51')],{'$or':_[_0x9192('0x46')](_0xb3b633[_0x9192('0x4b')],function(_0x3c0890){var _0x4ff19d={};_0x4ff19d[_0x3c0890]={'$like':'%'+_0x47efad['query']['filter']+'%'};return _0x4ff19d;})});}_0xb3b633=_[_0x9192('0x54')]({},_0xb3b633,_0x47efad[_0x9192('0x56')]);return _0xce2046[_0x9192('0x85')](_0xb3b633);}})[_0x9192('0x25')](function(_0x34d89f){if(_0x34d89f){_0x1973fa=_0x34d89f['length'];if(!_0x47efad[_0x9192('0x47')][_0x9192('0x4e')]('nolimit')){_0xb3b633[_0x9192('0x34')]=qs[_0x9192('0x34')](_0x47efad['query']['limit']);_0xb3b633[_0x9192('0x33')]=qs[_0x9192('0x33')](_0x47efad['query'][_0x9192('0x33')]);}return _0xce2046[_0x9192('0x85')](_0xb3b633);}})[_0x9192('0x25')](function(_0x162933){if(_0x162933){return _0x162933?{'count':_0x1973fa,'rows':_0x162933}:null;}})[_0x9192('0x25')](respondWithResult(_0x34905d,null))[_0x9192('0x5f')](handleError(_0x34905d,null));};function Extension(_0x10bfac,_0xbc5285,_0x3c3f51,_0xf08d4d){this[_0x9192('0x86')]=_0x9192('0x87');this['exten']=_0x10bfac[_0x9192('0x88')];this[_0x9192('0x89')]=_0xf08d4d;this[_0x9192('0x43')]=_0x9192('0x8a');this[_0x9192('0x8b')]=_0x9192('0x8c');this[_0x9192('0x6a')]=_0x10bfac['id'];this['priority']=_0xbc5285;this['appdata']=_0x3c3f51;}function createExtensionsReciveFax(_0x5f5511){var _0x15c0f1=0x1;var _0x2c6bff=[];_0x2c6bff[_0x9192('0x8d')](new Extension(_0x5f5511,_0x15c0f1,'',_0x9192('0x8e')));_0x15c0f1+=0x1;_0x2c6bff[_0x9192('0x8d')](new Extension(_0x5f5511,_0x15c0f1,'CDR(type)=inbound-fax','Set'));_0x15c0f1+=0x1;for(var _0x1fb74e in _0x5f5511){if(_0x5f5511['hasOwnProperty'](_0x1fb74e)&&(_0x1fb74e===_0x9192('0x8f')||_0x1fb74e===_0x9192('0x88')||_0x1fb74e===_0x9192('0x90')||_0x1fb74e==='faxdetect'||_0x1fb74e===_0x9192('0x91')||_0x1fb74e===_0x9192('0x92')||_0x1fb74e===_0x9192('0x93')||_0x1fb74e===_0x9192('0x94')||_0x1fb74e===_0x9192('0x95'))){_0x2c6bff[_0x9192('0x8d')](new Extension(_0x5f5511,_0x15c0f1,_0x9192('0x96')+_0x1fb74e+')='+_0x5f5511[_0x1fb74e],_0x9192('0x97')));_0x15c0f1+=0x1;}}_0x2c6bff[_0x9192('0x8d')](new Extension(_0x5f5511,_0x15c0f1,'6',_0x9192('0x98')));_0x15c0f1+=0x1;_0x2c6bff[_0x9192('0x8d')](new Extension(_0x5f5511,_0x15c0f1,_0x9192('0x99'),'ReceiveFax'));_0x15c0f1=0x0;return _0x2c6bff;}exports['addAccountApplications']=function(_0x126830,_0x593883,_0x18b91e){var _0x1d06dd;return db[_0x9192('0x80')][_0x9192('0x81')](function(_0x2ffa86){return db['FaxAccount'][_0x9192('0x60')](_0x126830[_0x9192('0x61')],{'transaction':_0x2ffa86})[_0x9192('0x25')](function(_0x43dcd3){_0x1d06dd=_0x43dcd3[_0x9192('0x9a')]({'plain':!![]});return db[_0x9192('0x9b')]['bulkCreate'](createExtensionsReciveFax(_0x1d06dd),{'transaction':_0x2ffa86});});})[_0x9192('0x25')](function(){return _0x1d06dd;})[_0x9192('0x25')](respondWithResult(_0x593883,null))['catch'](handleError(_0x593883,null));};exports['updateAccountApplications']=function(_0x56c0c4,_0x513c3a,_0x3161ba){var _0x2ed19f;return db[_0x9192('0x80')]['transaction'](function(_0xa02329){return db[_0x9192('0x41')]['update'](_0x56c0c4[_0x9192('0x61')],{'where':{'id':_0x56c0c4[_0x9192('0x61')]['id']},'transaction':_0xa02329})[_0x9192('0x25')](function(_0x591141){return db[_0x9192('0x9b')][_0x9192('0x3a')]({'where':{'FaxAccountId':_0x56c0c4[_0x9192('0x61')]['id']},'transaction':_0xa02329})[_0x9192('0x25')](function(_0xf25d34){return db[_0x9192('0x9b')][_0x9192('0x9c')](createExtensionsReciveFax(_[_0x9192('0x9d')](_0x56c0c4[_0x9192('0x61')],[_0x9192('0x9e'),'key',_0x9192('0x9f'),'updatedAt',_0x9192('0xa0'),_0x9192('0xa1')])),{'transaction':_0xa02329});});});})[_0x9192('0x25')](function(){return db[_0x9192('0x41')]['findById'](_0x56c0c4[_0x9192('0x61')]['id']);})[_0x9192('0x25')](respondWithResult(_0x513c3a,null))[_0x9192('0x5f')](handleError(_0x513c3a,null));};exports['getMessages']=function(_0x4fb654,_0x207f11,_0x103b8d){var _0x427941={'raw':!![],'where':{}};var _0x360445={};var _0x5e5961={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x4fb654[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x207f11,null))[_0x9192('0x25')](function(_0x3760ff){if(_0x3760ff){_0x360445[_0x9192('0x45')]=_['keys'](db[_0x9192('0xa2')]['rawAttributes']);_0x360445[_0x9192('0x47')]=_[_0x9192('0x48')](_0x4fb654[_0x9192('0x47')]);_0x360445[_0x9192('0x49')]=_[_0x9192('0x4a')](_0x360445[_0x9192('0x45')],_0x360445['query']);_0x427941[_0x9192('0x4b')]=_[_0x9192('0x4a')](_0x360445[_0x9192('0x45')],qs[_0x9192('0x4c')](_0x4fb654[_0x9192('0x47')]['fields']));_0x427941[_0x9192('0x4b')]=_0x427941[_0x9192('0x4b')][_0x9192('0x4d')]?_0x427941[_0x9192('0x4b')]:_0x360445[_0x9192('0x45')];if(!_0x4fb654[_0x9192('0x47')]['hasOwnProperty'](_0x9192('0x4f'))){_0x427941[_0x9192('0x34')]=qs[_0x9192('0x34')](_0x4fb654['query']['limit']);_0x427941['offset']=qs[_0x9192('0x33')](_0x4fb654['query'][_0x9192('0x33')]);}_0x427941[_0x9192('0x6d')]=qs['sort'](_0x4fb654['query']['sort']);_0x427941[_0x9192('0x51')]=qs[_0x9192('0x49')](_[_0x9192('0x52')](_0x4fb654['query'],_0x360445[_0x9192('0x49')]));_0x427941[_0x9192('0x51')][_0x9192('0x6a')]=_0x3760ff['id'];if(_0x4fb654[_0x9192('0x47')][_0x9192('0x53')]){_0x427941[_0x9192('0x51')]=_[_0x9192('0x54')](_0x427941[_0x9192('0x51')],{'$or':_[_0x9192('0x46')](_0x427941[_0x9192('0x4b')],function(_0x5c4ca4){var _0x7d3ad2={};_0x7d3ad2[_0x5c4ca4]={'$like':'%'+_0x4fb654['query'][_0x9192('0x53')]+'%'};return _0x7d3ad2;})});}if(_0x4fb654['query'][_0x9192('0xa3')]){var _0x49f257=_0x4fb654[_0x9192('0x47')][_0x9192('0xa3')][_0x9192('0xa4')](',');var _0x297032={};_0x297032[_0x49f257[0x0]]={'$gte':moment(_0x49f257[0x1])[_0x9192('0xa5')](_0x9192('0xa6'))};_0x427941[_0x9192('0x51')]=_['merge'](_0x427941[_0x9192('0x51')],_0x297032);}_0x427941=_['merge']({},_0x427941,_0x4fb654[_0x9192('0x56')]);return db[_0x9192('0xa2')][_0x9192('0x32')]({'where':_0x427941[_0x9192('0x51')]})[_0x9192('0x25')](function(_0x1991fb){_0x5e5961[_0x9192('0x32')]=_0x1991fb;if(_0x4fb654['query'][_0x9192('0x57')]){_0x427941[_0x9192('0x5d')]=[{'all':!![]}];}return db[_0x9192('0xa2')][_0x9192('0x58')](_0x427941);})['then'](function(_0x461823){_0x5e5961[_0x9192('0x59')]=_0x461823;return _0x5e5961;});}})['then'](respondWithFilteredResult(_0x207f11,_0x427941))[_0x9192('0x5f')](handleError(_0x207f11,null));};exports[_0x9192('0xa7')]=function(_0x3bd3a9,_0x1048b0,_0x456603){var _0x2094b9,_0x4ff2fd={},_0x428f18;if(_0x3bd3a9[_0x9192('0x61')]['to']){_0x428f18=_0x3bd3a9[_0x9192('0x61')]['to'][0x0];}return db['FaxAccount'][_0x9192('0x5e')]({'where':{'id':_0x3bd3a9[_0x9192('0x5b')]['id']},'include':[{'model':db[_0x9192('0xa8')],'as':_0x9192('0xa9'),'include':[{'model':db['CmContact'],'as':_0x9192('0xaa'),'where':{'fax':_0x428f18},'limit':0x1,'order':[['updatedAt',_0x9192('0xab')]]}]}]})[_0x9192('0x25')](handleEntityNotFound(_0x1048b0,null))[_0x9192('0x25')](function(_0x53e3af){_0x2094b9=_0x53e3af;if(_0x3bd3a9['body']['attachments']&&_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')]['length']){for(var _0x57d510=0x0;_0x57d510<_0x3bd3a9[_0x9192('0x61')]['attachments']['length'];_0x57d510+=0x1){_0x3bd3a9['body'][_0x9192('0xac')][_0x57d510]={'filename':_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')][_0x57d510][_0x9192('0x3e')],'id':_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')][_0x57d510]['id'],'path':path[_0x9192('0xad')](config[_0x9192('0xae')],'server/files/attachments',_0x3bd3a9[_0x9192('0x61')]['attachments'][_0x57d510][_0x9192('0xaf')])};}}return respondWithRpcPromise(_0x9192('0xb0'),_0x9192('0xb0'),{'FaxAccountId':_[_0x9192('0xb1')](_0x3bd3a9[_0x9192('0x5b')]['id'])?undefined:_0x3bd3a9[_0x9192('0x5b')]['id'],'path':_[_0x9192('0xb1')](_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')][0x0][_0x9192('0x8')])?undefined:_0x3bd3a9[_0x9192('0x61')]['attachments'][0x0][_0x9192('0x8')],'fax':_['isNil'](_0x3bd3a9[_0x9192('0x61')]['to'][0x0])?undefined:_0x3bd3a9[_0x9192('0x61')]['to'][0x0]},client9002);})[_0x9192('0x25')](function(){if(_0x2094b9){if(_[_0x9192('0xb1')](_0x3bd3a9[_0x9192('0x61')][_0x9192('0xb2')])){_0x3bd3a9['body'][_0x9192('0xb2')]=util[_0x9192('0xa5')](_0x9192('0xb3'),_0x2094b9['name'],_0x2094b9['fax']);}if(_0x2094b9[_0x9192('0xa9')]){if(_0x2094b9[_0x9192('0xa9')][_0x9192('0xaa')][_0x9192('0x4d')]){return _0x2094b9[_0x9192('0xa9')][_0x9192('0xaa')][0x0];}else{return db['CmContact'][_0x9192('0x60')](_[_0x9192('0x1c')](_0x3bd3a9[_0x9192('0x61')],{'firstName':_0x3bd3a9[_0x9192('0x61')]['to'][0x0],'phone':_0x3bd3a9[_0x9192('0x61')]['to'][0x0],'fax':_0x3bd3a9[_0x9192('0x61')]['to'][0x0],'ListId':_0x2094b9['ListId']}));}}else{throw new Error(_0x9192('0xb4'));}}else{throw new Error(_0x9192('0xb5'));}})[_0x9192('0x25')](function(_0x4e3d4d){if(_0x4e3d4d){return db[_0x9192('0x76')][_0x9192('0x5e')]({'where':{'ContactId':_0x4e3d4d['id'],'closed':![],'FaxAccountId':_0x2094b9['id']}})[_0x9192('0x25')](function(_0x4cf23d){if(_0x4cf23d){return[_0x4cf23d,![]];}return db['FaxInteraction'][_0x9192('0x60')]({'UserId':_0x3bd3a9['user']['id'],'ContactId':_0x4e3d4d['id'],'FaxAccountId':_0x2094b9['id'],'fax':_0x3bd3a9[_0x9192('0x61')]['to'][0x0],'firstMsgDirection':_0x9192('0xb6'),'Messages':[_[_0x9192('0x54')](_0x3bd3a9[_0x9192('0x61')],{'read':![],'body':_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')][0x0][_0x9192('0xb7')],'FaxAccountId':_0x2094b9['id'],'UserId':_0x3bd3a9[_0x9192('0x62')]['id'],'ContactId':_0x4e3d4d['id'],'AttachmentId':_0x3bd3a9[_0x9192('0x61')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x9192('0xa2')],'as':_0x9192('0xb8')}]})[_0x9192('0x25')](function(_0x33411a){return[_0x33411a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x9192('0xb9')](function(_0x5b9357,_0x410e13){if(_0x410e13){return _0x5b9357;}return db['FaxMessage'][_0x9192('0x60')]({'direction':_0x9192('0xb6'),'read':![],'body':_0x3bd3a9['body'][_0x9192('0xac')][0x0][_0x9192('0xb7')],'FaxAccountId':_0x2094b9['id'],'FaxInteractionId':_0x5b9357['id'],'UserId':_0x3bd3a9[_0x9192('0x62')]['id'],'ContactId':_0x5b9357[_0x9192('0xba')],'AttachmentId':_0x3bd3a9[_0x9192('0x61')]['attachments'][0x0]['id']})[_0x9192('0x25')](function(_0x502c69){_0x5b9357[_0x9192('0xbb')][_0x9192('0xb8')]=[];_0x5b9357[_0x9192('0xbb')][_0x9192('0xb8')][_0x9192('0x8d')](_0x502c69[_0x9192('0xbb')]);return _0x5b9357;});})['then'](function(_0xea0586){respondWithRpcPromise(_0x9192('0xbc'),_0x9192('0xbc'),{'FaxAccountId':_['isNil'](_0x3bd3a9[_0x9192('0x5b')]['id'])?undefined:_0x3bd3a9[_0x9192('0x5b')]['id'],'path':_[_0x9192('0xb1')](_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')][0x0][_0x9192('0x8')])?undefined:_0x3bd3a9['body']['attachments'][0x0][_0x9192('0x8')],'fax':_[_0x9192('0xb1')](_0x3bd3a9[_0x9192('0x61')]['to'][0x0])?undefined:_0x3bd3a9['body']['to'][0x0],'AttachmentId':_0x3bd3a9[_0x9192('0x61')][_0x9192('0xac')][0x0]['id']},client9002)[_0x9192('0x25')](function(_0x18e5fe){logger[_0x9192('0x2d')]('SendFaxRpc,\x20%s',_0x18e5fe);})[_0x9192('0x5f')](function(_0x3f2b91){logger['info'](_0x9192('0xbd'),_0x3f2b91);});return _0xea0586;})[_0x9192('0x25')](respondWithResult(_0x1048b0,null))['catch'](handleError(_0x1048b0,null));};exports[_0x9192('0xbe')]=function(_0x4c7bb5,_0x27ab7a,_0x426fc5){return db['FaxAccount'][_0x9192('0x5e')]({'where':{'id':_0x4c7bb5[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x27ab7a,null))['then'](function(_0x528c60){if(_0x528c60){return _0x528c60[_0x9192('0xbe')](_0x4c7bb5[_0x9192('0x61')][_0x9192('0x74')],_[_0x9192('0x9d')](_0x4c7bb5[_0x9192('0x61')],[_0x9192('0x74'),'id'])||{})['spread'](function(_0x6f82ab){for(var _0x3371f1=0x0;_0x3371f1<_0x4c7bb5[_0x9192('0x61')]['ids']['length'];_0x3371f1+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x4c7bb5[_0x9192('0x61')][_0x9192('0x74')][_0x3371f1],'FaxAccountId':_0x4c7bb5[_0x9192('0x5b')]['id']});}return _0x6f82ab;});}})[_0x9192('0x25')](respondWithResult(_0x27ab7a,null))[_0x9192('0x5f')](handleError(_0x27ab7a,null));};exports[_0x9192('0xbf')]=function(_0x18472d,_0x4f7996,_0x5880d9){return db[_0x9192('0x41')][_0x9192('0x5e')]({'where':{'id':_0x18472d[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x4f7996,null))[_0x9192('0x25')](function(_0x505204){if(_0x505204){return _0x505204[_0x9192('0xbf')](_0x18472d[_0x9192('0x47')][_0x9192('0x74')])['then'](function(){if(_[_0x9192('0xc0')](_0x18472d[_0x9192('0x47')]['ids'])){for(var _0x1f5495=0x0;_0x1f5495<_0x18472d['query'][_0x9192('0x74')][_0x9192('0x4d')];_0x1f5495+=0x1){socket[_0x9192('0xc1')](_0x9192('0xc2'),{'UserId':Number(_0x18472d[_0x9192('0x47')][_0x9192('0x74')][_0x1f5495]),'FaxAccountId':Number(_0x18472d['params']['id'])});}}else{socket[_0x9192('0xc1')](_0x9192('0xc2'),{'UserId':Number(_0x18472d[_0x9192('0x47')]['ids']),'FaxAccountId':Number(_0x18472d['params']['id'])});}});}})[_0x9192('0x25')](respondWithStatusCode(_0x4f7996,null))[_0x9192('0x5f')](handleError(_0x4f7996,null));};exports[_0x9192('0xc3')]=function(_0x815c49,_0x2ef2c6,_0x510e5a){var _0x4cd8eb={};var _0x37871b={};var _0x2b077f;var _0x339861;return db['FaxAccount'][_0x9192('0x72')]({'where':{'id':_0x815c49[_0x9192('0x5b')]['id']}})[_0x9192('0x25')](handleEntityNotFound(_0x2ef2c6,null))[_0x9192('0x25')](function(_0x5a661d){if(_0x5a661d){_0x2b077f=_0x5a661d;_0x37871b[_0x9192('0x45')]=_['keys'](db[_0x9192('0xc4')]['rawAttributes']);_0x37871b[_0x9192('0x47')]=_['keys'](_0x815c49[_0x9192('0x47')]);_0x37871b['filters']=_[_0x9192('0x4a')](_0x37871b[_0x9192('0x45')],_0x37871b['query']);_0x4cd8eb[_0x9192('0x4b')]=_[_0x9192('0x4a')](_0x37871b[_0x9192('0x45')],qs[_0x9192('0x4c')](_0x815c49['query'][_0x9192('0x4c')]));_0x4cd8eb['attributes']=_0x4cd8eb[_0x9192('0x4b')]['length']?_0x4cd8eb['attributes']:_0x37871b[_0x9192('0x45')];_0x4cd8eb[_0x9192('0x6d')]=qs['sort'](_0x815c49['query'][_0x9192('0x50')]);_0x4cd8eb[_0x9192('0x51')]=qs['filters'](_[_0x9192('0x52')](_0x815c49[_0x9192('0x47')],_0x37871b[_0x9192('0x49')]));if(_0x815c49[_0x9192('0x47')]['filter']){_0x4cd8eb[_0x9192('0x51')]=_[_0x9192('0x54')](_0x4cd8eb[_0x9192('0x51')],{'$or':_[_0x9192('0x46')](_0x4cd8eb[_0x9192('0x4b')],function(_0x4e9406){var _0x119202={};_0x119202[_0x4e9406]={'$like':'%'+_0x815c49['query']['filter']+'%'};return _0x119202;})});}_0x4cd8eb=_[_0x9192('0x54')]({},_0x4cd8eb,_0x815c49['options']);return _0x2b077f[_0x9192('0xc3')](_0x4cd8eb);}})['then'](function(_0x3ebc20){if(_0x3ebc20){_0x339861=_0x3ebc20['length'];if(!_0x815c49[_0x9192('0x47')][_0x9192('0x4e')](_0x9192('0x4f'))){_0x4cd8eb['limit']=qs[_0x9192('0x34')](_0x815c49[_0x9192('0x47')][_0x9192('0x34')]);_0x4cd8eb['offset']=qs['offset'](_0x815c49[_0x9192('0x47')][_0x9192('0x33')]);}return _0x2b077f['getAgents'](_0x4cd8eb);}})[_0x9192('0x25')](function(_0x535149){if(_0x535149){return _0x535149?{'count':_0x339861,'rows':_0x535149}:null;}})[_0x9192('0x25')](respondWithResult(_0x2ef2c6,null))[_0x9192('0x5f')](handleError(_0x2ef2c6,null));}; \ No newline at end of file +var _0x97ca=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','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','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','offset','limit','set','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','find','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','ids','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','tech','TrunkId','findById','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','emit','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97ca,0x172));var _0xa97c=function(_0x25d403,_0x5612bb){_0x25d403=_0x25d403-0x0;var _0x3f3b24=_0x97ca[_0x25d403];return _0x3f3b24;};'use strict';var pdf=require(_0xa97c('0x0'));var emlformat=require(_0xa97c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa97c('0x2'));var jsonpatch=require(_0xa97c('0x3'));var rp=require('request-promise');var moment=require(_0xa97c('0x4'));var BPromise=require(_0xa97c('0x5'));var Mustache=require(_0xa97c('0x6'));var util=require(_0xa97c('0x7'));var path=require(_0xa97c('0x8'));var sox=require('sox');var csv=require(_0xa97c('0x9'));var ejs=require(_0xa97c('0xa'));var fs=require('fs');var _=require(_0xa97c('0xb'));var squel=require(_0xa97c('0xc'));var crypto=require(_0xa97c('0xd'));var jsforce=require(_0xa97c('0xe'));var deskjs=require(_0xa97c('0xf'));var toCsv=require(_0xa97c('0x9'));var querystring=require(_0xa97c('0x10'));var Papa=require(_0xa97c('0x11'));var Redis=require(_0xa97c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa97c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa97c('0x14'));var logger=require('../../config/logger')(_0xa97c('0x15'));var utils=require(_0xa97c('0x16'));var config=require(_0xa97c('0x17'));var db=require(_0xa97c('0x18'))['db'];config[_0xa97c('0x19')]=_[_0xa97c('0x1a')](config[_0xa97c('0x19')],{'host':_0xa97c('0x1b'),'port':0x18eb});var socket=require(_0xa97c('0x1c'))(new Redis(config[_0xa97c('0x19')]));require(_0xa97c('0x1d'))[_0xa97c('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa97c('0x1f')][_0xa97c('0x20')]({'port':0x232c});var client9002=jayson[_0xa97c('0x1f')][_0xa97c('0x20')]({'port':0x232a});function checkPasswordPattern(_0x569dff,_0x335e2f,_0x3beb60){if(_0x3beb60){var _0x3bfa79=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bfa79[_0xa97c('0x21')](_0x335e2f)){return _0x569dff;}else{throw new db[(_0xa97c('0x22'))]['ValidationError'](_0xa97c('0x23'));}}else{return _0x569dff;}}function respondWithRpcPromise(_0x59736d,_0x3dda1f,_0x202d16,_0x1710bb){return new BPromise(function(_0x1160ec,_0x42413d){var _0x22ee44=_0x1710bb||client;return _0x22ee44[_0xa97c('0x24')](_0x59736d,_0x202d16)[_0xa97c('0x25')](function(_0x1f3990){logger[_0xa97c('0x26')](_0xa97c('0x27'),_0x3dda1f,'request\x20sent');logger['debug'](_0xa97c('0x28'),_0x3dda1f,'request\x20sent',JSON[_0xa97c('0x29')](_0x1f3990));if(_0x1f3990[_0xa97c('0x2a')]){if(_0x1f3990[_0xa97c('0x2a')]['code']===0x1f4){logger[_0xa97c('0x2a')](_0xa97c('0x27'),_0x3dda1f,_0x1f3990[_0xa97c('0x2a')][_0xa97c('0x2b')]);return _0x42413d(_0x1f3990[_0xa97c('0x2a')][_0xa97c('0x2b')]);}logger[_0xa97c('0x2a')](_0xa97c('0x27'),_0x3dda1f,_0x1f3990[_0xa97c('0x2a')][_0xa97c('0x2b')]);return _0x1160ec(_0x1f3990[_0xa97c('0x2a')][_0xa97c('0x2b')]);}else{logger['info'](_0xa97c('0x27'),_0x3dda1f,'request\x20sent');_0x1160ec(_0x1f3990[_0xa97c('0x2c')][_0xa97c('0x2b')]);}})['catch'](function(_0x5684ad){logger[_0xa97c('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x3dda1f,_0x5684ad);_0x42413d(_0x5684ad);});});}function respondWithStatusCode(_0x2016c0,_0x48539d){_0x48539d=_0x48539d||0xcc;return function(_0x3e5daf){if(_0x3e5daf){return _0x2016c0[_0xa97c('0x2d')](_0x48539d);}return _0x2016c0[_0xa97c('0x2e')](_0x48539d)[_0xa97c('0x2f')]();};}function respondWithResult(_0x5cad3d,_0x7abd0f){_0x7abd0f=_0x7abd0f||0xc8;return function(_0xc9d739){if(_0xc9d739){return _0x5cad3d[_0xa97c('0x2e')](_0x7abd0f)['json'](_0xc9d739);}};}function respondWithFilteredResult(_0xd5dce9,_0x59ffd9){return function(_0x34f8fc){if(_0x34f8fc){var _0x4cc5d2=_0x34f8fc['count'],_0x253915=_0x59ffd9['offset'],_0x54c2f5=_0x59ffd9[_0xa97c('0x30')]+_0x59ffd9[_0xa97c('0x31')],_0x1a0739;if(_0x54c2f5>=_0x4cc5d2){_0x54c2f5=_0x4cc5d2;_0x1a0739=0xc8;}else{_0x1a0739=0xce;}_0xd5dce9[_0xa97c('0x2e')](_0x1a0739);return _0xd5dce9[_0xa97c('0x32')]('Content-Range',_0x253915+'-'+_0x54c2f5+'/'+_0x4cc5d2)['json'](_0x34f8fc);}return null;};}function patchUpdates(_0x241477){return function(_0x5960b7){try{jsonpatch[_0xa97c('0x33')](_0x5960b7,_0x241477,!![]);}catch(_0x830798){return BPromise[_0xa97c('0x34')](_0x830798);}return _0x5960b7[_0xa97c('0x35')]();};}function saveUpdates(_0x3f35bf,_0x152d74){return function(_0x3fd143){if(_0x3fd143){return _0x3fd143[_0xa97c('0x36')](_0x3f35bf)[_0xa97c('0x25')](function(_0x3f8649){return _0x3f8649;});}return null;};}function removeEntity(_0x4ddce0,_0x36910c){return function(_0x4b65a6){if(_0x4b65a6){return _0x4b65a6[_0xa97c('0x37')]()['then'](function(){var _0x2a980f=_0x4b65a6[_0xa97c('0x38')]({'plain':!![]});var _0x7b33f5=_0xa97c('0x39');return db[_0xa97c('0x3a')][_0xa97c('0x37')]({'where':{'type':_0x7b33f5,'resourceId':_0x2a980f['id']}})[_0xa97c('0x25')](function(){return _0x4b65a6;});})[_0xa97c('0x25')](function(){_0x4ddce0['status'](0xcc)[_0xa97c('0x2f')]();});}};}function handleEntityNotFound(_0x367a35,_0x2df476){return function(_0x46c2ab){if(!_0x46c2ab){_0x367a35[_0xa97c('0x2d')](0x194);}return _0x46c2ab;};}function handleError(_0x3e55e1,_0x4dffde){_0x4dffde=_0x4dffde||0x1f4;return function(_0x49e4fd){logger['error'](_0x49e4fd['stack']);if(_0x49e4fd['name']){delete _0x49e4fd[_0xa97c('0x3b')];}_0x3e55e1[_0xa97c('0x2e')](_0x4dffde)[_0xa97c('0x3c')](_0x49e4fd);};}exports[_0xa97c('0x3d')]=function(_0x18f839,_0x306f69){var _0xb20520={'include':[{'model':db[_0xa97c('0x3e')],'as':_0xa97c('0x3f')}]},_0x27db2d={},_0x54e9a2={'count':0x0,'rows':[]};var _0x46369a=_['map'](db[_0xa97c('0x40')][_0xa97c('0x41')],function(_0xec25be){return{'name':_0xec25be[_0xa97c('0x42')],'type':_0xec25be[_0xa97c('0x43')][_0xa97c('0x44')]};});_0x27db2d['model']=_[_0xa97c('0x45')](_0x46369a,_0xa97c('0x3b'));_0x27db2d[_0xa97c('0x46')]=_[_0xa97c('0x47')](_0x18f839[_0xa97c('0x46')]);_0x27db2d[_0xa97c('0x48')]=_[_0xa97c('0x49')](_0x27db2d[_0xa97c('0x4a')],_0x27db2d[_0xa97c('0x46')]);_0xb20520[_0xa97c('0x4b')]=_[_0xa97c('0x49')](_0x27db2d[_0xa97c('0x4a')],qs[_0xa97c('0x4c')](_0x18f839[_0xa97c('0x46')]['fields']));_0xb20520[_0xa97c('0x4b')]=_0xb20520['attributes']['length']?_0xb20520['attributes']:_0x27db2d[_0xa97c('0x4a')];if(!_0x18f839[_0xa97c('0x46')][_0xa97c('0x4d')](_0xa97c('0x4e'))){_0xb20520[_0xa97c('0x31')]=qs['limit'](_0x18f839['query'][_0xa97c('0x31')]);_0xb20520[_0xa97c('0x30')]=qs['offset'](_0x18f839['query'][_0xa97c('0x30')]);}_0xb20520[_0xa97c('0x4f')]=qs['sort'](_0x18f839[_0xa97c('0x46')][_0xa97c('0x50')]);_0xb20520[_0xa97c('0x51')]=qs[_0xa97c('0x48')](_[_0xa97c('0x52')](_0x18f839[_0xa97c('0x46')],_0x27db2d[_0xa97c('0x48')]),_0x46369a);if(_0x18f839[_0xa97c('0x46')]['filter']){_0xb20520['where']=_['merge'](_0xb20520[_0xa97c('0x51')],{'$or':_[_0xa97c('0x45')](_0x46369a,function(_0x31dcaa){if(_0x31dcaa['type']!==_0xa97c('0x53')){var _0x355b1c={};_0x355b1c[_0x31dcaa[_0xa97c('0x3b')]]={'$like':'%'+_0x18f839[_0xa97c('0x46')][_0xa97c('0x54')]+'%'};return _0x355b1c;}})});}_0xb20520=_[_0xa97c('0x55')]({},_0xb20520,_0x18f839[_0xa97c('0x56')]);var _0x317733={'where':_0xb20520[_0xa97c('0x51')]};return db['FaxAccount']['count'](_0x317733)[_0xa97c('0x25')](function(_0x3e9268){_0x54e9a2[_0xa97c('0x57')]=_0x3e9268;if(_0x18f839[_0xa97c('0x46')][_0xa97c('0x58')]){_0xb20520[_0xa97c('0x59')]=[{'all':!![]}];}return db[_0xa97c('0x40')][_0xa97c('0x5a')](_0xb20520);})[_0xa97c('0x25')](function(_0x26e18f){_0x54e9a2[_0xa97c('0x5b')]=_0x26e18f;return _0x54e9a2;})['then'](respondWithFilteredResult(_0x306f69,_0xb20520))[_0xa97c('0x5c')](handleError(_0x306f69,null));};exports['show']=function(_0x1c6eaa,_0x4be84f){var _0x1e2e39={'raw':![],'where':{'id':_0x1c6eaa[_0xa97c('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0xa97c('0x3f')}]},_0x1caad1={};_0x1caad1[_0xa97c('0x4a')]=_[_0xa97c('0x47')](db[_0xa97c('0x40')]['rawAttributes']);_0x1caad1[_0xa97c('0x46')]=_[_0xa97c('0x47')](_0x1c6eaa[_0xa97c('0x46')]);_0x1caad1[_0xa97c('0x48')]=_[_0xa97c('0x49')](_0x1caad1['model'],_0x1caad1['query']);_0x1e2e39[_0xa97c('0x4b')]=_['intersection'](_0x1caad1[_0xa97c('0x4a')],qs[_0xa97c('0x4c')](_0x1c6eaa[_0xa97c('0x46')][_0xa97c('0x4c')]));_0x1e2e39['attributes']=_0x1e2e39[_0xa97c('0x4b')][_0xa97c('0x5e')]?_0x1e2e39[_0xa97c('0x4b')]:_0x1caad1[_0xa97c('0x4a')];if(_0x1c6eaa[_0xa97c('0x46')][_0xa97c('0x58')]){_0x1e2e39[_0xa97c('0x59')]=[{'all':!![]}];}_0x1e2e39=_[_0xa97c('0x55')]({},_0x1e2e39,_0x1c6eaa['options']);return db[_0xa97c('0x40')]['find'](_0x1e2e39)[_0xa97c('0x25')](handleEntityNotFound(_0x4be84f,null))[_0xa97c('0x25')](respondWithResult(_0x4be84f,null))[_0xa97c('0x5c')](handleError(_0x4be84f,null));};exports[_0xa97c('0x5f')]=function(_0xb810f8,_0xa6dbdb){return db['FaxAccount']['create'](_0xb810f8[_0xa97c('0x60')],{})[_0xa97c('0x25')](function(_0x525678){var _0x49587f=_0xb810f8[_0xa97c('0x61')][_0xa97c('0x38')]({'plain':!![]});if(!_0x49587f)throw new Error(_0xa97c('0x62'));if(_0x49587f[_0xa97c('0x63')]===_0xa97c('0x61')){var _0x3d15aa=_0x525678['get']({'plain':!![]});var _0x2ad9d7=_0xa97c('0x39');return db[_0xa97c('0x64')]['find']({'where':{'name':_0x2ad9d7,'userProfileId':_0x49587f[_0xa97c('0x65')]},'raw':!![]})['then'](function(_0x357a11){if(_0x357a11&&_0x357a11[_0xa97c('0x66')]===0x0){return db['UserProfileResource']['create']({'name':_0x3d15aa[_0xa97c('0x3b')],'resourceId':_0x3d15aa['id'],'type':_0x357a11[_0xa97c('0x3b')],'sectionId':_0x357a11['id']},{})[_0xa97c('0x25')](function(){return _0x525678;});}else{return _0x525678;}})[_0xa97c('0x5c')](function(_0x4c74b4){logger[_0xa97c('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c74b4);throw _0x4c74b4;});}return _0x525678;})['then'](respondWithResult(_0xa6dbdb,0xc9))[_0xa97c('0x5c')](handleError(_0xa6dbdb,null));};exports[_0xa97c('0x36')]=function(_0xcb58fa,_0x1383a4){if(_0xcb58fa[_0xa97c('0x60')]['id']){delete _0xcb58fa[_0xa97c('0x60')]['id'];}return db[_0xa97c('0x40')][_0xa97c('0x67')]({'where':{'id':_0xcb58fa['params']['id']},'include':[{'model':db['Pause'],'as':_0xa97c('0x3f')}]})[_0xa97c('0x25')](handleEntityNotFound(_0x1383a4,null))[_0xa97c('0x25')](saveUpdates(_0xcb58fa['body'],null))[_0xa97c('0x25')](respondWithResult(_0x1383a4,null))[_0xa97c('0x5c')](handleError(_0x1383a4,null));};exports['destroy']=function(_0x4471b9,_0x5b5585){return db[_0xa97c('0x40')]['find']({'where':{'id':_0x4471b9['params']['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x5b5585,null))[_0xa97c('0x25')](removeEntity(_0x5b5585,null))[_0xa97c('0x5c')](handleError(_0x5b5585,null));};exports['describe']=function(_0x56c995,_0x5d68d8){return db['FaxAccount'][_0xa97c('0x68')]()['then'](respondWithResult(_0x5d68d8,null))['catch'](handleError(_0x5d68d8,null));};exports[_0xa97c('0x69')]=function(_0x4a8d79,_0x4ec1d8,_0x31b299){if(_0x4a8d79[_0xa97c('0x60')]['id']){delete _0x4a8d79['body']['id'];}return db['FaxAccount'][_0xa97c('0x67')]({'where':{'id':_0x4a8d79[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x4ec1d8,null))[_0xa97c('0x25')](function(_0x28b9ab){if(_0x28b9ab){_0x4a8d79[_0xa97c('0x60')][_0xa97c('0x6a')]=_0x28b9ab['id'];return db['Disposition'][_0xa97c('0x5f')](_0x4a8d79[_0xa97c('0x60')]);}})['then'](respondWithResult(_0x4ec1d8,null))['catch'](handleError(_0x4ec1d8,null));};exports[_0xa97c('0x6b')]=function(_0x488709,_0x1f5273,_0x14da2a){var _0x2111e5={'raw':![],'where':{}};var _0x586521={};var _0xc0297a={'count':0x0,'rows':[]};return db[_0xa97c('0x40')][_0xa97c('0x6c')]({'where':{'id':_0x488709[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x1f5273,null))[_0xa97c('0x25')](function(_0x2e661e){if(_0x2e661e){_0x586521[_0xa97c('0x4a')]=_['keys'](db[_0xa97c('0x6d')]['rawAttributes']);_0x586521['query']=_['keys'](_0x488709[_0xa97c('0x46')]);_0x586521[_0xa97c('0x48')]=_[_0xa97c('0x49')](_0x586521[_0xa97c('0x4a')],_0x586521[_0xa97c('0x46')]);_0x2111e5[_0xa97c('0x4b')]=_[_0xa97c('0x49')](_0x586521[_0xa97c('0x4a')],qs[_0xa97c('0x4c')](_0x488709[_0xa97c('0x46')][_0xa97c('0x4c')]));_0x2111e5[_0xa97c('0x4b')]=_0x2111e5[_0xa97c('0x4b')]['length']?_0x2111e5[_0xa97c('0x4b')]:_0x586521['model'];if(!_0x488709[_0xa97c('0x46')]['hasOwnProperty'](_0xa97c('0x4e'))){_0x2111e5['limit']=qs[_0xa97c('0x31')](_0x488709[_0xa97c('0x46')][_0xa97c('0x31')]);_0x2111e5[_0xa97c('0x30')]=qs[_0xa97c('0x30')](_0x488709[_0xa97c('0x46')][_0xa97c('0x30')]);}_0x2111e5[_0xa97c('0x4f')]=qs[_0xa97c('0x50')](_0x488709[_0xa97c('0x46')][_0xa97c('0x50')]);_0x2111e5['where']=qs[_0xa97c('0x48')](_['pick'](_0x488709[_0xa97c('0x46')],_0x586521[_0xa97c('0x48')]));_0x2111e5[_0xa97c('0x51')]['FaxAccountId']=_0x2e661e['id'];if(_0x488709[_0xa97c('0x46')][_0xa97c('0x54')]){_0x2111e5['where']=_[_0xa97c('0x55')](_0x2111e5[_0xa97c('0x51')],{'$or':_[_0xa97c('0x45')](_0x2111e5[_0xa97c('0x4b')],function(_0x309740){var _0x34d5f3={};_0x34d5f3[_0x309740]={'$like':'%'+_0x488709['query']['filter']+'%'};return _0x34d5f3;})});}_0x2111e5=_[_0xa97c('0x55')]({},_0x2111e5,_0x488709[_0xa97c('0x56')]);return db['Disposition']['count']({'where':_0x2111e5[_0xa97c('0x51')]})[_0xa97c('0x25')](function(_0x1d7bcc){_0xc0297a['count']=_0x1d7bcc;if(_0x488709[_0xa97c('0x46')]['includeAll']){_0x2111e5[_0xa97c('0x59')]=[{'all':!![]}];}return db[_0xa97c('0x6d')]['findAll'](_0x2111e5);})[_0xa97c('0x25')](function(_0x368678){_0xc0297a[_0xa97c('0x5b')]=_0x368678;return _0xc0297a;});}})[_0xa97c('0x25')](respondWithFilteredResult(_0x1f5273,_0x2111e5))[_0xa97c('0x5c')](handleError(_0x1f5273,null));};exports[_0xa97c('0x6e')]=function(_0x165fb1,_0x428da2,_0x268892){return db[_0xa97c('0x40')][_0xa97c('0x67')]({'where':{'id':_0x165fb1[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x428da2,null))[_0xa97c('0x25')](function(_0x51c2bd){if(_0x51c2bd){return _0x51c2bd[_0xa97c('0x6e')](_0x165fb1[_0xa97c('0x46')]['ids']);}})[_0xa97c('0x25')](respondWithStatusCode(_0x428da2,null))['catch'](handleError(_0x428da2,null));};exports[_0xa97c('0x6f')]=function(_0x5452f0,_0x5d38b5,_0x55f6da){if(_0x5452f0[_0xa97c('0x60')]['id']){delete _0x5452f0[_0xa97c('0x60')]['id'];}return db[_0xa97c('0x40')][_0xa97c('0x67')]({'where':{'id':_0x5452f0[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x5d38b5,null))[_0xa97c('0x25')](function(_0x4fcd27){if(_0x4fcd27){_0x5452f0[_0xa97c('0x60')][_0xa97c('0x6a')]=_0x4fcd27['id'];return db[_0xa97c('0x70')][_0xa97c('0x5f')](_0x5452f0['body']);}})[_0xa97c('0x25')](respondWithResult(_0x5d38b5,null))[_0xa97c('0x5c')](handleError(_0x5d38b5,null));};exports[_0xa97c('0x71')]=function(_0x1b2147,_0x14f5fc,_0x437539){var _0x20dae7={'raw':![],'where':{}};var _0x1512d3={};var _0x4fe26e={'count':0x0,'rows':[]};return db[_0xa97c('0x40')][_0xa97c('0x6c')]({'where':{'id':_0x1b2147[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x14f5fc,null))[_0xa97c('0x25')](function(_0xd74a16){if(_0xd74a16){_0x1512d3[_0xa97c('0x4a')]=_[_0xa97c('0x47')](db[_0xa97c('0x70')][_0xa97c('0x41')]);_0x1512d3[_0xa97c('0x46')]=_['keys'](_0x1b2147[_0xa97c('0x46')]);_0x1512d3['filters']=_['intersection'](_0x1512d3[_0xa97c('0x4a')],_0x1512d3[_0xa97c('0x46')]);_0x20dae7[_0xa97c('0x4b')]=_[_0xa97c('0x49')](_0x1512d3[_0xa97c('0x4a')],qs[_0xa97c('0x4c')](_0x1b2147[_0xa97c('0x46')][_0xa97c('0x4c')]));_0x20dae7['attributes']=_0x20dae7['attributes'][_0xa97c('0x5e')]?_0x20dae7[_0xa97c('0x4b')]:_0x1512d3['model'];if(!_0x1b2147[_0xa97c('0x46')]['hasOwnProperty']('nolimit')){_0x20dae7['limit']=qs[_0xa97c('0x31')](_0x1b2147[_0xa97c('0x46')][_0xa97c('0x31')]);_0x20dae7[_0xa97c('0x30')]=qs[_0xa97c('0x30')](_0x1b2147[_0xa97c('0x46')]['offset']);}_0x20dae7[_0xa97c('0x4f')]=qs[_0xa97c('0x50')](_0x1b2147['query'][_0xa97c('0x50')]);_0x20dae7[_0xa97c('0x51')]=qs[_0xa97c('0x48')](_['pick'](_0x1b2147['query'],_0x1512d3[_0xa97c('0x48')]));_0x20dae7[_0xa97c('0x51')][_0xa97c('0x6a')]=_0xd74a16['id'];if(_0x1b2147[_0xa97c('0x46')]['filter']){_0x20dae7[_0xa97c('0x51')]=_['merge'](_0x20dae7['where'],{'$or':_['map'](_0x20dae7['attributes'],function(_0x3776e8){var _0x48a708={};_0x48a708[_0x3776e8]={'$like':'%'+_0x1b2147['query'][_0xa97c('0x54')]+'%'};return _0x48a708;})});}_0x20dae7=_['merge']({},_0x20dae7,_0x1b2147['options']);return db['CannedAnswer'][_0xa97c('0x57')]({'where':_0x20dae7['where']})[_0xa97c('0x25')](function(_0x45c2fd){_0x4fe26e[_0xa97c('0x57')]=_0x45c2fd;if(_0x1b2147['query']['includeAll']){_0x20dae7['include']=[{'all':!![]}];}return db[_0xa97c('0x70')]['findAll'](_0x20dae7);})['then'](function(_0x551c79){_0x4fe26e[_0xa97c('0x5b')]=_0x551c79;return _0x4fe26e;});}})[_0xa97c('0x25')](respondWithFilteredResult(_0x14f5fc,_0x20dae7))[_0xa97c('0x5c')](handleError(_0x14f5fc,null));};exports[_0xa97c('0x72')]=function(_0x4180a4,_0x450ec4,_0x3e7210){return db[_0xa97c('0x40')][_0xa97c('0x67')]({'where':{'id':_0x4180a4[_0xa97c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x450ec4,null))[_0xa97c('0x25')](function(_0x303677){if(_0x303677){return _0x303677['removeAnswers'](_0x4180a4[_0xa97c('0x46')]['ids']);}})[_0xa97c('0x25')](respondWithStatusCode(_0x450ec4,null))[_0xa97c('0x5c')](handleError(_0x450ec4,null));};exports[_0xa97c('0x73')]=function(_0x371748,_0x3a7643,_0x3283ae){return db['FaxInteraction'][_0xa97c('0x67')]({'where':{'id':_0x371748[_0xa97c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3a7643,null))['then'](function(_0x4fabe2){if(_0x4fabe2){return _0x4fabe2[_0xa97c('0x73')](_0x371748['body']['ids'],_[_0xa97c('0x74')](_0x371748[_0xa97c('0x60')],[_0xa97c('0x75'),'id'])||{});}})[_0xa97c('0x25')](respondWithResult(_0x3a7643,null))[_0xa97c('0x5c')](handleError(_0x3a7643,null));};exports[_0xa97c('0x76')]=function(_0x389cbe,_0x254572,_0x581902){var _0x5a0ae9={'raw':![],'where':{}};var _0x1f415b={};var _0x57963f={'count':0x0,'rows':[]};return db[_0xa97c('0x40')][_0xa97c('0x6c')]({'where':{'id':_0x389cbe['params']['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x254572,null))[_0xa97c('0x25')](function(_0x4abb2d){if(_0x4abb2d){_0x1f415b['model']=_[_0xa97c('0x47')](db[_0xa97c('0x77')][_0xa97c('0x41')]);_0x1f415b[_0xa97c('0x46')]=_['keys'](_0x389cbe[_0xa97c('0x46')]);_0x1f415b[_0xa97c('0x48')]=_['intersection'](_0x1f415b[_0xa97c('0x4a')],_0x1f415b[_0xa97c('0x46')]);_0x5a0ae9['attributes']=_['intersection'](_0x1f415b['model'],qs['fields'](_0x389cbe['query'][_0xa97c('0x4c')]));_0x5a0ae9[_0xa97c('0x4b')]=_0x5a0ae9[_0xa97c('0x4b')][_0xa97c('0x5e')]?_0x5a0ae9[_0xa97c('0x4b')]:_0x1f415b[_0xa97c('0x4a')];if(!_0x389cbe[_0xa97c('0x46')][_0xa97c('0x4d')](_0xa97c('0x4e'))){_0x5a0ae9[_0xa97c('0x31')]=qs[_0xa97c('0x31')](_0x389cbe[_0xa97c('0x46')][_0xa97c('0x31')]);_0x5a0ae9[_0xa97c('0x30')]=qs['offset'](_0x389cbe[_0xa97c('0x46')]['offset']);}_0x5a0ae9['order']=qs[_0xa97c('0x50')](_0x389cbe[_0xa97c('0x46')][_0xa97c('0x50')]);_0x5a0ae9[_0xa97c('0x51')]=qs[_0xa97c('0x48')](_[_0xa97c('0x52')](_0x389cbe[_0xa97c('0x46')],_0x1f415b[_0xa97c('0x48')]));_0x5a0ae9[_0xa97c('0x51')][_0xa97c('0x6a')]=_0x4abb2d['id'];if(_0x389cbe['query'][_0xa97c('0x54')]){_0x5a0ae9['where']=_['merge'](_0x5a0ae9[_0xa97c('0x51')],{'$or':_[_0xa97c('0x45')](_0x5a0ae9[_0xa97c('0x4b')],function(_0x41882d){var _0x32c963={};_0x32c963[_0x41882d]={'$like':'%'+_0x389cbe[_0xa97c('0x46')][_0xa97c('0x54')]+'%'};return _0x32c963;})});}_0x5a0ae9=_[_0xa97c('0x55')]({},_0x5a0ae9,_0x389cbe[_0xa97c('0x56')]);return db['FaxInteraction'][_0xa97c('0x57')]({'where':_0x5a0ae9[_0xa97c('0x51')]})[_0xa97c('0x25')](function(_0x38633d){_0x57963f[_0xa97c('0x57')]=_0x38633d;if(_0x389cbe[_0xa97c('0x46')]['includeAll']){_0x5a0ae9[_0xa97c('0x59')]=[{'model':db[_0xa97c('0x78')],'as':_0xa97c('0x79'),'required':![]},{'model':db[_0xa97c('0x7a')],'as':_0xa97c('0x7b'),'attributes':[_0xa97c('0x3b'),'fullname','internal'],'required':![]},{'model':db[_0xa97c('0x7c')],'as':_0xa97c('0x7d'),'attributes':['id',_0xa97c('0x3b'),_0xa97c('0x7e')],'where':_0x389cbe[_0xa97c('0x46')][_0xa97c('0x7f')]?{'id':_0x389cbe[_0xa97c('0x46')]['tag']}:undefined,'required':_0x389cbe[_0xa97c('0x46')][_0xa97c('0x7f')]?!![]:![]}];}return db[_0xa97c('0x77')][_0xa97c('0x5a')](_0x5a0ae9);})[_0xa97c('0x25')](function(_0x38a0dc){_0x57963f[_0xa97c('0x5b')]=_0x38a0dc;return _0x57963f;});}})[_0xa97c('0x25')](respondWithFilteredResult(_0x254572,_0x5a0ae9))[_0xa97c('0x5c')](handleError(_0x254572,null));};exports[_0xa97c('0x80')]=function(_0x481fc7,_0x5cc743,_0x2562dd){return db[_0xa97c('0x40')][_0xa97c('0x6c')]({'where':{'id':_0x481fc7[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x5cc743,null))[_0xa97c('0x25')](function(_0x4dadef){if(_0x4dadef){return db[_0xa97c('0x81')][_0xa97c('0x82')](function(_0x2529b9){return db[_0xa97c('0x83')][_0xa97c('0x37')]({'where':{'FaxAccountId':_0x481fc7[_0xa97c('0x5d')]['id']},'transaction':_0x2529b9})[_0xa97c('0x25')](function(_0x409b2e){var _0x2a2639=_[_0xa97c('0x45')](_0x481fc7['body'],function(_0x2eb4e5){_0x2eb4e5['FaxAccountId']=_0x481fc7[_0xa97c('0x5d')]['id'];return _0x2eb4e5;});return db['FaxApplication'][_0xa97c('0x84')](_0x2a2639,{'transaction':_0x2529b9});});})[_0xa97c('0x25')](function(){return db[_0xa97c('0x83')][_0xa97c('0x85')]({'where':{'FaxAccountId':_0x481fc7['params']['id']},'order':_0xa97c('0x86')});});}})['then'](respondWithResult(_0x5cc743,null))[_0xa97c('0x5c')](handleError(_0x5cc743,null));};exports['getApplications']=function(_0x29e158,_0x4373bb,_0x2315b3){var _0x398917={};var _0x336ac7={};var _0x9fa7ab;var _0xbbac3c;return db[_0xa97c('0x40')][_0xa97c('0x6c')]({'where':{'id':_0x29e158[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x4373bb,null))[_0xa97c('0x25')](function(_0x3ae4c7){if(_0x3ae4c7){_0x9fa7ab=_0x3ae4c7;_0x336ac7[_0xa97c('0x4a')]=_[_0xa97c('0x47')](db[_0xa97c('0x83')][_0xa97c('0x41')]);_0x336ac7[_0xa97c('0x46')]=_[_0xa97c('0x47')](_0x29e158[_0xa97c('0x46')]);_0x336ac7['filters']=_[_0xa97c('0x49')](_0x336ac7['model'],_0x336ac7['query']);_0x398917['attributes']=_['intersection'](_0x336ac7[_0xa97c('0x4a')],qs[_0xa97c('0x4c')](_0x29e158[_0xa97c('0x46')]['fields']));_0x398917[_0xa97c('0x4b')]=_0x398917[_0xa97c('0x4b')]['length']?_0x398917[_0xa97c('0x4b')]:_0x336ac7['model'];_0x398917[_0xa97c('0x4f')]=qs[_0xa97c('0x50')](_0x29e158[_0xa97c('0x46')][_0xa97c('0x50')]);_0x398917[_0xa97c('0x51')]=qs[_0xa97c('0x48')](_[_0xa97c('0x52')](_0x29e158[_0xa97c('0x46')],_0x336ac7['filters']));if(_0x29e158[_0xa97c('0x46')]['filter']){_0x398917['where']=_[_0xa97c('0x55')](_0x398917[_0xa97c('0x51')],{'$or':_['map'](_0x398917[_0xa97c('0x4b')],function(_0x9625e){var _0x147545={};_0x147545[_0x9625e]={'$like':'%'+_0x29e158['query'][_0xa97c('0x54')]+'%'};return _0x147545;})});}_0x398917=_[_0xa97c('0x55')]({},_0x398917,_0x29e158['options']);return _0x9fa7ab[_0xa97c('0x87')](_0x398917);}})[_0xa97c('0x25')](function(_0x65d44b){if(_0x65d44b){_0xbbac3c=_0x65d44b[_0xa97c('0x5e')];if(!_0x29e158['query'][_0xa97c('0x4d')](_0xa97c('0x4e'))){_0x398917[_0xa97c('0x31')]=qs[_0xa97c('0x31')](_0x29e158[_0xa97c('0x46')]['limit']);_0x398917[_0xa97c('0x30')]=qs[_0xa97c('0x30')](_0x29e158['query'][_0xa97c('0x30')]);}return _0x9fa7ab[_0xa97c('0x87')](_0x398917);}})['then'](function(_0x130b92){if(_0x130b92){return _0x130b92?{'count':_0xbbac3c,'rows':_0x130b92}:null;}})[_0xa97c('0x25')](respondWithResult(_0x4373bb,null))[_0xa97c('0x5c')](handleError(_0x4373bb,null));};function Extension(_0x402293,_0xaadf5e,_0x453c24,_0x270405){this[_0xa97c('0x88')]=_0xa97c('0x89');this[_0xa97c('0x8a')]=_0x402293[_0xa97c('0x8b')];this['app']=_0x270405;this['type']='system';this[_0xa97c('0x8c')]=_0xa97c('0x8d');this['FaxAccountId']=_0x402293['id'];this[_0xa97c('0x86')]=_0xaadf5e;this[_0xa97c('0x8e')]=_0x453c24;}function createExtensionsReciveFax(_0x5e5eea){var _0x3e7507=0x1;var _0x467761=[];_0x467761[_0xa97c('0x8f')](new Extension(_0x5e5eea,_0x3e7507,'','Answer'));_0x3e7507+=0x1;_0x467761[_0xa97c('0x8f')](new Extension(_0x5e5eea,_0x3e7507,_0xa97c('0x90'),_0xa97c('0x91')));_0x3e7507+=0x1;for(var _0x2cb119 in _0x5e5eea){if(_0x5e5eea[_0xa97c('0x4d')](_0x2cb119)&&(_0x2cb119===_0xa97c('0x92')||_0x2cb119===_0xa97c('0x8b')||_0x2cb119==='gateway'||_0x2cb119==='faxdetect'||_0x2cb119===_0xa97c('0x93')||_0x2cb119===_0xa97c('0x94')||_0x2cb119===_0xa97c('0x95')||_0x2cb119===_0xa97c('0x96')||_0x2cb119===_0xa97c('0x97'))){_0x467761[_0xa97c('0x8f')](new Extension(_0x5e5eea,_0x3e7507,_0xa97c('0x98')+_0x2cb119+')='+_0x5e5eea[_0x2cb119],_0xa97c('0x91')));_0x3e7507+=0x1;}}_0x467761[_0xa97c('0x8f')](new Extension(_0x5e5eea,_0x3e7507,'6',_0xa97c('0x99')));_0x3e7507+=0x1;_0x467761[_0xa97c('0x8f')](new Extension(_0x5e5eea,_0x3e7507,_0xa97c('0x9a'),'ReceiveFax'));_0x3e7507=0x0;return _0x467761;}exports[_0xa97c('0x9b')]=function(_0x4bec46,_0x311dad,_0x350b90){var _0x40e922;return db[_0xa97c('0x81')][_0xa97c('0x82')](function(_0x1d9fc9){return db[_0xa97c('0x40')][_0xa97c('0x5f')](_0x4bec46[_0xa97c('0x60')],{'transaction':_0x1d9fc9})[_0xa97c('0x25')](function(_0x19b304){_0x40e922=_0x19b304[_0xa97c('0x38')]({'plain':!![]});return db['VoiceExtension'][_0xa97c('0x84')](createExtensionsReciveFax(_0x40e922),{'transaction':_0x1d9fc9});});})[_0xa97c('0x25')](function(){return _0x40e922;})['then'](respondWithResult(_0x311dad,null))[_0xa97c('0x5c')](handleError(_0x311dad,null));};exports['updateAccountApplications']=function(_0x5bdba4,_0x1ef77f,_0x2ac211){var _0x1e535e;return db[_0xa97c('0x81')]['transaction'](function(_0x2ac559){return db[_0xa97c('0x40')][_0xa97c('0x36')](_0x5bdba4['body'],{'where':{'id':_0x5bdba4['body']['id']},'transaction':_0x2ac559})['then'](function(_0x50ff23){return db[_0xa97c('0x9c')]['destroy']({'where':{'FaxAccountId':_0x5bdba4[_0xa97c('0x60')]['id']},'transaction':_0x2ac559})[_0xa97c('0x25')](function(_0xcfcad1){return db[_0xa97c('0x9c')]['bulkCreate'](createExtensionsReciveFax(_[_0xa97c('0x74')](_0x5bdba4['body'],[_0xa97c('0x9d'),'key','createdAt','updatedAt',_0xa97c('0x9e'),'ListId'])),{'transaction':_0x2ac559});});});})[_0xa97c('0x25')](function(){return db[_0xa97c('0x40')][_0xa97c('0x9f')](_0x5bdba4[_0xa97c('0x60')]['id']);})[_0xa97c('0x25')](respondWithResult(_0x1ef77f,null))['catch'](handleError(_0x1ef77f,null));};exports['getMessages']=function(_0x28063c,_0x56fef5,_0x327aeb){var _0x5c9601={'raw':!![],'where':{}};var _0x1452ec={};var _0x4228e6={'count':0x0,'rows':[]};return db[_0xa97c('0x40')][_0xa97c('0x6c')]({'where':{'id':_0x28063c[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x56fef5,null))[_0xa97c('0x25')](function(_0x33581a){if(_0x33581a){_0x1452ec[_0xa97c('0x4a')]=_[_0xa97c('0x47')](db[_0xa97c('0xa0')][_0xa97c('0x41')]);_0x1452ec['query']=_[_0xa97c('0x47')](_0x28063c[_0xa97c('0x46')]);_0x1452ec[_0xa97c('0x48')]=_[_0xa97c('0x49')](_0x1452ec[_0xa97c('0x4a')],_0x1452ec[_0xa97c('0x46')]);_0x5c9601[_0xa97c('0x4b')]=_[_0xa97c('0x49')](_0x1452ec[_0xa97c('0x4a')],qs['fields'](_0x28063c[_0xa97c('0x46')][_0xa97c('0x4c')]));_0x5c9601[_0xa97c('0x4b')]=_0x5c9601[_0xa97c('0x4b')][_0xa97c('0x5e')]?_0x5c9601[_0xa97c('0x4b')]:_0x1452ec[_0xa97c('0x4a')];if(!_0x28063c[_0xa97c('0x46')][_0xa97c('0x4d')](_0xa97c('0x4e'))){_0x5c9601[_0xa97c('0x31')]=qs[_0xa97c('0x31')](_0x28063c[_0xa97c('0x46')][_0xa97c('0x31')]);_0x5c9601[_0xa97c('0x30')]=qs[_0xa97c('0x30')](_0x28063c[_0xa97c('0x46')]['offset']);}_0x5c9601['order']=qs[_0xa97c('0x50')](_0x28063c[_0xa97c('0x46')][_0xa97c('0x50')]);_0x5c9601[_0xa97c('0x51')]=qs[_0xa97c('0x48')](_['pick'](_0x28063c['query'],_0x1452ec[_0xa97c('0x48')]));_0x5c9601[_0xa97c('0x51')][_0xa97c('0x6a')]=_0x33581a['id'];if(_0x28063c[_0xa97c('0x46')][_0xa97c('0x54')]){_0x5c9601[_0xa97c('0x51')]=_[_0xa97c('0x55')](_0x5c9601['where'],{'$or':_['map'](_0x5c9601[_0xa97c('0x4b')],function(_0x4f4c13){var _0xebbd25={};_0xebbd25[_0x4f4c13]={'$like':'%'+_0x28063c[_0xa97c('0x46')]['filter']+'%'};return _0xebbd25;})});}if(_0x28063c['query'][_0xa97c('0xa1')]){var _0x26373b=_0x28063c[_0xa97c('0x46')][_0xa97c('0xa1')][_0xa97c('0xa2')](',');var _0x43ece3={};_0x43ece3[_0x26373b[0x0]]={'$gte':moment(_0x26373b[0x1])[_0xa97c('0xa3')](_0xa97c('0xa4'))};_0x5c9601[_0xa97c('0x51')]=_[_0xa97c('0x55')](_0x5c9601[_0xa97c('0x51')],_0x43ece3);}_0x5c9601=_['merge']({},_0x5c9601,_0x28063c[_0xa97c('0x56')]);return db[_0xa97c('0xa0')]['count']({'where':_0x5c9601['where']})[_0xa97c('0x25')](function(_0x1c6e8f){_0x4228e6['count']=_0x1c6e8f;if(_0x28063c[_0xa97c('0x46')][_0xa97c('0x58')]){_0x5c9601[_0xa97c('0x59')]=[{'all':!![]}];}return db[_0xa97c('0xa0')][_0xa97c('0x5a')](_0x5c9601);})[_0xa97c('0x25')](function(_0x31c16d){_0x4228e6['rows']=_0x31c16d;return _0x4228e6;});}})[_0xa97c('0x25')](respondWithFilteredResult(_0x56fef5,_0x5c9601))['catch'](handleError(_0x56fef5,null));};exports['send']=function(_0x1890ed,_0x1ba4ea,_0x4486ef){var _0x5e6050,_0x16cfd6={},_0x3b4424;if(_0x1890ed['body']['to']){_0x3b4424=_0x1890ed[_0xa97c('0x60')]['to'][0x0];}return db[_0xa97c('0x40')][_0xa97c('0x67')]({'where':{'id':_0x1890ed[_0xa97c('0x5d')]['id']},'include':[{'model':db['CmList'],'as':_0xa97c('0xa5'),'include':[{'model':db[_0xa97c('0x78')],'as':_0xa97c('0xa6'),'where':{'fax':_0x3b4424},'limit':0x1,'order':[[_0xa97c('0xa7'),_0xa97c('0xa8')]]}]}]})['then'](handleEntityNotFound(_0x1ba4ea,null))[_0xa97c('0x25')](function(_0x192de5){_0x5e6050=_0x192de5;if(_0x1890ed[_0xa97c('0x60')]['attachments']&&_0x1890ed['body'][_0xa97c('0xa9')][_0xa97c('0x5e')]){for(var _0x4b3890=0x0;_0x4b3890<_0x1890ed[_0xa97c('0x60')]['attachments']['length'];_0x4b3890+=0x1){_0x1890ed['body'][_0xa97c('0xa9')][_0x4b3890]={'filename':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][_0x4b3890][_0xa97c('0x3b')],'id':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][_0x4b3890]['id'],'path':path['join'](config[_0xa97c('0xaa')],_0xa97c('0xab'),_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][_0x4b3890][_0xa97c('0xac')])};}}return respondWithRpcPromise(_0xa97c('0xad'),_0xa97c('0xad'),{'FaxAccountId':_[_0xa97c('0xae')](_0x1890ed[_0xa97c('0x5d')]['id'])?undefined:_0x1890ed['params']['id'],'path':_['isNil'](_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0][_0xa97c('0x8')])?undefined:_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0][_0xa97c('0x8')],'fax':_[_0xa97c('0xae')](_0x1890ed[_0xa97c('0x60')]['to'][0x0])?undefined:_0x1890ed[_0xa97c('0x60')]['to'][0x0]},client9002);})[_0xa97c('0x25')](function(){if(_0x5e6050){if(_['isNil'](_0x1890ed[_0xa97c('0x60')][_0xa97c('0xaf')])){_0x1890ed[_0xa97c('0x60')][_0xa97c('0xaf')]=util[_0xa97c('0xa3')](_0xa97c('0xb0'),_0x5e6050['name'],_0x5e6050[_0xa97c('0xb1')]);}if(_0x5e6050[_0xa97c('0xa5')]){if(_0x5e6050['List'][_0xa97c('0xa6')][_0xa97c('0x5e')]){return _0x5e6050[_0xa97c('0xa5')][_0xa97c('0xa6')][0x0];}else{return db[_0xa97c('0x78')][_0xa97c('0x5f')](_[_0xa97c('0x1a')](_0x1890ed[_0xa97c('0x60')],{'firstName':_0x1890ed['body']['to'][0x0],'phone':_0x1890ed['body']['to'][0x0],'fax':_0x1890ed[_0xa97c('0x60')]['to'][0x0],'ListId':_0x5e6050[_0xa97c('0xb2')]}));}}else{throw new Error(_0xa97c('0xb3'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xa97c('0x25')](function(_0x5c72f0){if(_0x5c72f0){return db[_0xa97c('0x77')]['find']({'where':{'ContactId':_0x5c72f0['id'],'closed':![],'FaxAccountId':_0x5e6050['id']}})[_0xa97c('0x25')](function(_0x513260){if(_0x513260){return[_0x513260,![]];}return db[_0xa97c('0x77')][_0xa97c('0x5f')]({'UserId':_0x1890ed[_0xa97c('0x61')]['id'],'ContactId':_0x5c72f0['id'],'FaxAccountId':_0x5e6050['id'],'fax':_0x1890ed['body']['to'][0x0],'firstMsgDirection':_0xa97c('0xb4'),'Messages':[_[_0xa97c('0x55')](_0x1890ed[_0xa97c('0x60')],{'read':![],'body':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0]['filename'],'FaxAccountId':_0x5e6050['id'],'UserId':_0x1890ed[_0xa97c('0x61')]['id'],'ContactId':_0x5c72f0['id'],'AttachmentId':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0]['id']})]},{'include':[{'model':db[_0xa97c('0xa0')],'as':_0xa97c('0xb5')}]})['then'](function(_0x18f8ca){return[_0x18f8ca,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xa97c('0xb6')](function(_0x504a10,_0x35de07){if(_0x35de07){return _0x504a10;}return db['FaxMessage'][_0xa97c('0x5f')]({'direction':'out','read':![],'body':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0][_0xa97c('0xb7')],'FaxAccountId':_0x5e6050['id'],'FaxInteractionId':_0x504a10['id'],'UserId':_0x1890ed['user']['id'],'ContactId':_0x504a10[_0xa97c('0xb8')],'AttachmentId':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0]['id']})[_0xa97c('0x25')](function(_0x348d94){_0x504a10[_0xa97c('0xb9')][_0xa97c('0xb5')]=[];_0x504a10[_0xa97c('0xb9')][_0xa97c('0xb5')][_0xa97c('0x8f')](_0x348d94[_0xa97c('0xb9')]);return _0x504a10;});})[_0xa97c('0x25')](function(_0xa0ee99){respondWithRpcPromise('SendFax',_0xa97c('0xba'),{'FaxAccountId':_[_0xa97c('0xae')](_0x1890ed[_0xa97c('0x5d')]['id'])?undefined:_0x1890ed[_0xa97c('0x5d')]['id'],'path':_[_0xa97c('0xae')](_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0][_0xa97c('0x8')])?undefined:_0x1890ed[_0xa97c('0x60')]['attachments'][0x0][_0xa97c('0x8')],'fax':_[_0xa97c('0xae')](_0x1890ed[_0xa97c('0x60')]['to'][0x0])?undefined:_0x1890ed[_0xa97c('0x60')]['to'][0x0],'AttachmentId':_0x1890ed[_0xa97c('0x60')][_0xa97c('0xa9')][0x0]['id']},client9002)[_0xa97c('0x25')](function(_0xfffb93){logger[_0xa97c('0x26')]('SendFaxRpc,\x20%s',_0xfffb93);})['catch'](function(_0x5155c5){logger[_0xa97c('0x26')](_0xa97c('0xbb'),_0x5155c5);});return _0xa0ee99;})[_0xa97c('0x25')](respondWithResult(_0x1ba4ea,null))[_0xa97c('0x5c')](handleError(_0x1ba4ea,null));};exports[_0xa97c('0xbc')]=function(_0x13a091,_0x121877,_0x6e994e){return db[_0xa97c('0x40')][_0xa97c('0x67')]({'where':{'id':_0x13a091['params']['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x121877,null))['then'](function(_0x1c0cb0){if(_0x1c0cb0){return _0x1c0cb0[_0xa97c('0xbc')](_0x13a091[_0xa97c('0x60')][_0xa97c('0x75')],_[_0xa97c('0x74')](_0x13a091[_0xa97c('0x60')],['ids','id'])||{})[_0xa97c('0xb6')](function(_0xf2e16b){for(var _0x1f1999=0x0;_0x1f1999<_0x13a091['body'][_0xa97c('0x75')][_0xa97c('0x5e')];_0x1f1999+=0x1){socket['emit'](_0xa97c('0xbd'),{'UserId':_0x13a091[_0xa97c('0x60')][_0xa97c('0x75')][_0x1f1999],'FaxAccountId':_0x13a091['params']['id']});}return _0xf2e16b;});}})[_0xa97c('0x25')](respondWithResult(_0x121877,null))[_0xa97c('0x5c')](handleError(_0x121877,null));};exports[_0xa97c('0xbe')]=function(_0x351de9,_0x3bee44,_0x1238a1){return db[_0xa97c('0x40')]['find']({'where':{'id':_0x351de9[_0xa97c('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3bee44,null))[_0xa97c('0x25')](function(_0x5d33d8){if(_0x5d33d8){return _0x5d33d8[_0xa97c('0xbe')](_0x351de9['query'][_0xa97c('0x75')])[_0xa97c('0x25')](function(){if(_[_0xa97c('0xbf')](_0x351de9[_0xa97c('0x46')]['ids'])){for(var _0x5c2076=0x0;_0x5c2076<_0x351de9[_0xa97c('0x46')][_0xa97c('0x75')][_0xa97c('0x5e')];_0x5c2076+=0x1){socket['emit'](_0xa97c('0xc0'),{'UserId':Number(_0x351de9[_0xa97c('0x46')]['ids'][_0x5c2076]),'FaxAccountId':Number(_0x351de9[_0xa97c('0x5d')]['id'])});}}else{socket[_0xa97c('0xc1')](_0xa97c('0xc0'),{'UserId':Number(_0x351de9[_0xa97c('0x46')][_0xa97c('0x75')]),'FaxAccountId':Number(_0x351de9[_0xa97c('0x5d')]['id'])});}});}})[_0xa97c('0x25')](respondWithStatusCode(_0x3bee44,null))[_0xa97c('0x5c')](handleError(_0x3bee44,null));};exports[_0xa97c('0xc2')]=function(_0xab84f,_0x107fa8,_0x1fab85){var _0x5227dc={};var _0x1f698e={};var _0x38a414;var _0x21161b;return db[_0xa97c('0x40')]['findOne']({'where':{'id':_0xab84f[_0xa97c('0x5d')]['id']}})[_0xa97c('0x25')](handleEntityNotFound(_0x107fa8,null))[_0xa97c('0x25')](function(_0x21cc34){if(_0x21cc34){_0x38a414=_0x21cc34;_0x1f698e[_0xa97c('0x4a')]=_[_0xa97c('0x47')](db[_0xa97c('0x7a')][_0xa97c('0x41')]);_0x1f698e[_0xa97c('0x46')]=_[_0xa97c('0x47')](_0xab84f['query']);_0x1f698e[_0xa97c('0x48')]=_[_0xa97c('0x49')](_0x1f698e[_0xa97c('0x4a')],_0x1f698e['query']);_0x5227dc[_0xa97c('0x4b')]=_[_0xa97c('0x49')](_0x1f698e[_0xa97c('0x4a')],qs['fields'](_0xab84f[_0xa97c('0x46')]['fields']));_0x5227dc[_0xa97c('0x4b')]=_0x5227dc[_0xa97c('0x4b')]['length']?_0x5227dc[_0xa97c('0x4b')]:_0x1f698e[_0xa97c('0x4a')];_0x5227dc['order']=qs[_0xa97c('0x50')](_0xab84f[_0xa97c('0x46')][_0xa97c('0x50')]);_0x5227dc[_0xa97c('0x51')]=qs['filters'](_['pick'](_0xab84f['query'],_0x1f698e[_0xa97c('0x48')]));if(_0xab84f[_0xa97c('0x46')]['filter']){_0x5227dc['where']=_[_0xa97c('0x55')](_0x5227dc[_0xa97c('0x51')],{'$or':_['map'](_0x5227dc[_0xa97c('0x4b')],function(_0x395f60){var _0x2803f5={};_0x2803f5[_0x395f60]={'$like':'%'+_0xab84f[_0xa97c('0x46')][_0xa97c('0x54')]+'%'};return _0x2803f5;})});}_0x5227dc=_[_0xa97c('0x55')]({},_0x5227dc,_0xab84f[_0xa97c('0x56')]);return _0x38a414['getAgents'](_0x5227dc);}})[_0xa97c('0x25')](function(_0x23cf09){if(_0x23cf09){_0x21161b=_0x23cf09[_0xa97c('0x5e')];if(!_0xab84f[_0xa97c('0x46')][_0xa97c('0x4d')]('nolimit')){_0x5227dc[_0xa97c('0x31')]=qs[_0xa97c('0x31')](_0xab84f[_0xa97c('0x46')][_0xa97c('0x31')]);_0x5227dc[_0xa97c('0x30')]=qs[_0xa97c('0x30')](_0xab84f[_0xa97c('0x46')][_0xa97c('0x30')]);}return _0x38a414['getAgents'](_0x5227dc);}})['then'](function(_0x36fc80){if(_0x36fc80){return _0x36fc80?{'count':_0x21161b,'rows':_0x36fc80}:null;}})['then'](respondWithResult(_0x107fa8,null))[_0xa97c('0x5c')](handleError(_0x107fa8,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 370c1f5..69b13d2 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 _0x1190=['update','remove','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0xba36ac,_0x170493){var _0xd5c7ae=function(_0x945e48){while(--_0x945e48){_0xba36ac['push'](_0xba36ac['shift']());}};_0xd5c7ae(++_0x170493);}(_0x1190,0x79));var _0x0119=function(_0x4ee18d,_0x87408d){_0x4ee18d=_0x4ee18d-0x0;var _0x342597=_0x1190[_0x4ee18d];return _0x342597;};'use strict';var EventEmitter=require(_0x0119('0x0'));var FaxAccount=require(_0x0119('0x1'))['db'][_0x0119('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0119('0x3')](0x0);var events={'afterCreate':_0x0119('0x4'),'afterUpdate':_0x0119('0x5'),'afterDestroy':_0x0119('0x6')};function emitEvent(_0x5857c1){return function(_0x585edc,_0x30f1ee,_0x4f28f4){FaxAccountEvents['emit'](_0x5857c1+':'+_0x585edc['id'],_0x585edc);FaxAccountEvents['emit'](_0x5857c1,_0x585edc);_0x4f28f4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0119('0x7')](e,emitEvent(event));}}module[_0x0119('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x0517=['emit','hasOwnProperty','hook','../../mysqldb','FaxAccount','setMaxListeners','update','remove'];(function(_0x4adff1,_0x4a8cbe){var _0x318759=function(_0x32faef){while(--_0x32faef){_0x4adff1['push'](_0x4adff1['shift']());}};_0x318759(++_0x4a8cbe);}(_0x0517,0x1a3));var _0x7051=function(_0x2e5fb8,_0x1460c0){_0x2e5fb8=_0x2e5fb8-0x0;var _0x303036=_0x0517[_0x2e5fb8];return _0x303036;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x7051('0x0'))['db'][_0x7051('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x7051('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7051('0x3'),'afterDestroy':_0x7051('0x4')};function emitEvent(_0x31197f){return function(_0x51f167,_0x25a608,_0x1ff676){FaxAccountEvents[_0x7051('0x5')](_0x31197f+':'+_0x51f167['id'],_0x51f167);FaxAccountEvents[_0x7051('0x5')](_0x31197f,_0x51f167);_0x1ff676(null);};}for(var e in events){if(events[_0x7051('0x6')](e)){var event=events[e];FaxAccount[_0x7051('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 02ab533..e4ca71a 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 _0x0011=['bluebird','request-promise','path','rimraf','../../config/environment','fax_accounts','lodash','../../config/logger','api','moment'];(function(_0x4f9339,_0x39a501){var _0x141282=function(_0x312af5){while(--_0x312af5){_0x4f9339['push'](_0x4f9339['shift']());}};_0x141282(++_0x39a501);}(_0x0011,0x196));var _0x1001=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0011[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x1001('0x0'));var util=require('util');var logger=require(_0x1001('0x1'))(_0x1001('0x2'));var moment=require(_0x1001('0x3'));var BPromise=require(_0x1001('0x4'));var rp=require(_0x1001('0x5'));var fs=require('fs');var path=require(_0x1001('0x6'));var rimraf=require(_0x1001('0x7'));var config=require(_0x1001('0x8'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x31522f,_0x534b73){return _0x31522f['define']('FaxAccount',attributes,{'tableName':_0x1001('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6152=['request-promise','rimraf','../../config/environment','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x5428c1,_0x59c587){var _0x3fbeb6=function(_0x955829){while(--_0x955829){_0x5428c1['push'](_0x5428c1['shift']());}};_0x3fbeb6(++_0x59c587);}(_0x6152,0x163));var _0x2615=function(_0x52f798,_0x584649){_0x52f798=_0x52f798-0x0;var _0x3642cc=_0x6152[_0x52f798];return _0x3642cc;};'use strict';var _=require(_0x2615('0x0'));var util=require(_0x2615('0x1'));var logger=require(_0x2615('0x2'))(_0x2615('0x3'));var moment=require(_0x2615('0x4'));var BPromise=require('bluebird');var rp=require(_0x2615('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2615('0x6'));var config=require(_0x2615('0x7'));var attributes=require('./faxAccount.attributes');module[_0x2615('0x8')]=function(_0x266ca7,_0x4718f1){return _0x266ca7[_0x2615('0x9')](_0x2615('0xa'),attributes,{'tableName':_0x2615('0xb'),'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 cdc8a85..c900502 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 _0x9e1f=['request\x20sent','debug','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','Applications','get','applications','orderBy','asc','length','create','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','UserId','User','unshift','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s'];(function(_0x1bc06c,_0x138581){var _0x931224=function(_0x165db7){while(--_0x165db7){_0x1bc06c['push'](_0x1bc06c['shift']());}};_0x931224(++_0x138581);}(_0x9e1f,0x9c));var _0xf9e1=function(_0x3b1393,_0xa70d84){_0x3b1393=_0x3b1393-0x0;var _0x564aa7=_0x9e1f[_0x3b1393];return _0x564aa7;};'use strict';var _=require(_0xf9e1('0x0'));var util=require(_0xf9e1('0x1'));var moment=require(_0xf9e1('0x2'));var BPromise=require(_0xf9e1('0x3'));var rs=require(_0xf9e1('0x4'));var fs=require('fs');var Redis=require(_0xf9e1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf9e1('0x6'))(_0xf9e1('0x7'));var config=require(_0xf9e1('0x8'));var jayson=require(_0xf9e1('0x9'));var client=jayson[_0xf9e1('0xa')]['http']({'port':0x232c});config[_0xf9e1('0xb')]=_[_0xf9e1('0xc')](config[_0xf9e1('0xb')],{'host':_0xf9e1('0xd'),'port':0x18eb});var socket=require(_0xf9e1('0xe'))(new Redis(config[_0xf9e1('0xb')]));require(_0xf9e1('0xf'))['register'](socket);function respondWithRpcPromise(_0x3d7b40,_0x5a0627,_0x403cd4){return new BPromise(function(_0x4d90a0,_0x5a048e){return client[_0xf9e1('0x10')](_0x3d7b40,_0x403cd4)[_0xf9e1('0x11')](function(_0x1e8141){logger[_0xf9e1('0x12')](_0xf9e1('0x13'),_0x5a0627,_0xf9e1('0x14'));logger[_0xf9e1('0x15')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5a0627,'request\x20sent',JSON[_0xf9e1('0x16')](_0x1e8141));if(_0x1e8141['error']){if(_0x1e8141[_0xf9e1('0x17')]['code']===0x1f4){logger[_0xf9e1('0x17')](_0xf9e1('0x13'),_0x5a0627,_0x1e8141[_0xf9e1('0x17')]['message']);return _0x5a048e(_0x1e8141[_0xf9e1('0x17')]['message']);}logger[_0xf9e1('0x17')](_0xf9e1('0x13'),_0x5a0627,_0x1e8141[_0xf9e1('0x17')][_0xf9e1('0x18')]);return _0x4d90a0(_0x1e8141[_0xf9e1('0x17')][_0xf9e1('0x18')]);}else{logger['info'](_0xf9e1('0x13'),_0x5a0627,_0xf9e1('0x14'));_0x4d90a0(_0x1e8141[_0xf9e1('0x19')][_0xf9e1('0x18')]);}})[_0xf9e1('0x1a')](function(_0x41a283){logger[_0xf9e1('0x17')](_0xf9e1('0x13'),_0x5a0627,_0x41a283);_0x5a048e(_0x41a283);});});}exports[_0xf9e1('0x1b')]=function(_0x2b31f6){var _0x5ea63e=this;return new Promise(function(_0x2d30d6,_0x397164){return db[_0xf9e1('0x1c')]['findAll']({'raw':_0x2b31f6['options']?_0x2b31f6[_0xf9e1('0x1d')][_0xf9e1('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b31f6['options']?_0x2b31f6[_0xf9e1('0x1d')][_0xf9e1('0x1f')]||null:null,'attributes':_0x2b31f6[_0xf9e1('0x1d')]?_0x2b31f6['options'][_0xf9e1('0x20')]||null:null,'limit':_0x2b31f6[_0xf9e1('0x1d')]?_0x2b31f6[_0xf9e1('0x1d')][_0xf9e1('0x21')]||null:null,'include':_0x2b31f6['options']?_0x2b31f6['options'][_0xf9e1('0x22')]?_[_0xf9e1('0x23')](_0x2b31f6[_0xf9e1('0x1d')][_0xf9e1('0x22')],function(_0x4c8699){return{'model':db[_0x4c8699[_0xf9e1('0x24')]],'as':_0x4c8699['as'],'attributes':_0x4c8699[_0xf9e1('0x20')],'include':_0x4c8699[_0xf9e1('0x22')]?_['map'](_0x4c8699[_0xf9e1('0x22')],function(_0x1bb325){return{'model':db[_0x1bb325['model']],'as':_0x1bb325['as'],'attributes':_0x1bb325['attributes'],'include':_0x1bb325[_0xf9e1('0x22')]?_[_0xf9e1('0x23')](_0x1bb325[_0xf9e1('0x22')],function(_0x581803){return{'model':db[_0x581803[_0xf9e1('0x24')]],'as':_0x581803['as'],'attributes':_0x581803[_0xf9e1('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46fa3e){logger[_0xf9e1('0x12')](_0xf9e1('0x1b'),_0x2b31f6);logger[_0xf9e1('0x15')](_0xf9e1('0x1b'),_0x2b31f6,JSON[_0xf9e1('0x16')](_0x46fa3e));_0x2d30d6(_0x46fa3e);})[_0xf9e1('0x1a')](function(_0x13ae1f){logger[_0xf9e1('0x17')]('GetFaxAccount',_0x13ae1f[_0xf9e1('0x18')],_0x2b31f6);_0x397164(_0x5ea63e['error'](0x1f4,_0x13ae1f[_0xf9e1('0x18')]));});});};exports[_0xf9e1('0x25')]=function(_0x37c989,_0x44b380,_0x44358b){var _0x591b61=this;return new Promise(function(_0x50e721,_0x20e4c6){var _0x308d36={'body':_0x37c989[_0xf9e1('0x26')],'channel':_0xf9e1('0x27')};var _0x5804f2=[];var _0x3038ba=[];var _0x2408b7={};return db[_0xf9e1('0x28')][_0xf9e1('0x29')]()['then'](function(_0x24bb27){if(!_0x24bb27){throw new db[(_0xf9e1('0x2a'))][(_0xf9e1('0x2b'))](_0xf9e1('0x2c'));}_0x5804f2=_[_0xf9e1('0x2d')](_['keys'](_0x24bb27),[_0xf9e1('0x2e'),_0xf9e1('0x2f')]);_0x3038ba=_['difference'](_[_0xf9e1('0x30')](_0x24bb27),['createdAt','updatedAt',_0xf9e1('0x31'),_0xf9e1('0x32')]);if(_0x37c989[_0xf9e1('0x26')]['id']){delete _0x37c989[_0xf9e1('0x26')]['id'];}if(_[_0xf9e1('0x33')](_0x37c989['body'][_0xf9e1('0x34')])){throw new db[(_0xf9e1('0x2a'))][(_0xf9e1('0x2b'))](_0xf9e1('0x35'));}if(_[_0xf9e1('0x33')](_0x37c989[_0xf9e1('0x26')]['body'])||_0x37c989['body'][_0xf9e1('0x26')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x37c989['body'][_0xf9e1('0x36')])){throw new db[(_0xf9e1('0x2a'))][(_0xf9e1('0x2b'))](_0xf9e1('0x37')+_0x3038ba);}if(!_[_0xf9e1('0x38')](_0x3038ba,_0x37c989[_0xf9e1('0x26')][_0xf9e1('0x36')])){throw new db[(_0xf9e1('0x2a'))][(_0xf9e1('0x2b'))](_0xf9e1('0x39')+_0x3038ba);}_0x2408b7[_0x37c989[_0xf9e1('0x26')]['mapKey']]=_0x37c989[_0xf9e1('0x26')][_0xf9e1('0x34')];})[_0xf9e1('0x11')](function(){return db['FaxAccount'][_0xf9e1('0x3a')]({'where':{'id':_0x37c989[_0xf9e1('0x3b')]['id']},'include':[{'model':db[_0xf9e1('0x3c')],'as':_0xf9e1('0x3d'),'include':[{'model':db[_0xf9e1('0x28')],'as':_0xf9e1('0x3e'),'where':_0x2408b7,'limit':0x1,'order':[[_0xf9e1('0x2f'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0xf9e1('0x3f')}]});})[_0xf9e1('0x11')](function(_0x3d168f){if(_0x3d168f&&_0x3d168f['List']){var _0x31cf15=_0x3d168f[_0xf9e1('0x40')]({'plain':!![]});_0x308d36['account']=_0x31cf15;_0x308d36[_0xf9e1('0x41')]=_0x31cf15[_0xf9e1('0x3f')];_0x308d36['list']=_0x31cf15[_0xf9e1('0x3d')];_0x308d36[_0xf9e1('0x41')]=_[_0xf9e1('0x42')](_0x308d36[_0xf9e1('0x41')],['priority'],[_0xf9e1('0x43')]);if(_0x308d36[_0xf9e1('0x3b')][_0xf9e1('0x3f')]){delete _0x308d36[_0xf9e1('0x3b')][_0xf9e1('0x3f')];}if(_0x308d36[_0xf9e1('0x3b')][_0xf9e1('0x3d')]&&_0x308d36[_0xf9e1('0x3b')][_0xf9e1('0x3d')]['Contacts'][_0xf9e1('0x44')]){return _0x308d36['account']['List'][_0xf9e1('0x3e')][0x0];}var _0x30da41=_[_0xf9e1('0xc')](_0x37c989[_0xf9e1('0x26')],{'firstName':_0x37c989['body'][_0xf9e1('0x34')],'ListId':_0x31cf15[_0xf9e1('0x32')]});_0x30da41[_0x37c989['body']['mapKey']]=_0x37c989['body'][_0xf9e1('0x34')];return db['CmContact'][_0xf9e1('0x45')](_0x30da41,{'fields':_0x5804f2,'raw':!![]});}})[_0xf9e1('0x11')](function(_0x265ee1){_0x308d36['contact']=_0x265ee1;if(_0x265ee1){var _0x2571e6={'ContactId':_0x265ee1['id'],'FaxAccountId':_0x37c989['account']['id'],'fax':_0x265ee1['fax']};return db[_0xf9e1('0x46')][_0xf9e1('0x3a')]({'where':{'ContactId':_0x265ee1['id'],'closed':![],'FaxAccountId':_0x37c989[_0xf9e1('0x3b')]['id']}})['then'](function(_0x1b86ce){if(_0x1b86ce){return[_0x1b86ce,![]];}return db[_0xf9e1('0x46')][_0xf9e1('0x45')](_0x2571e6)[_0xf9e1('0x11')](function(_0x3e5166){return[_0x3e5166,!![]];});});}else{throw new Error(_0xf9e1('0x47'));}})[_0xf9e1('0x48')](function(_0x299fec,_0x313277){var _0x2ff6bf=_0x299fec['get']({'plain':!![]});if(_0x313277){if(_0x308d36[_0xf9e1('0x3b')][_0xf9e1('0x49')]){_0x308d36[_0xf9e1('0x41')][_0xf9e1('0x4a')]({'id':0x0,'priority':_0x308d36[_0xf9e1('0x41')][_0xf9e1('0x44')]+0x1,'app':_0xf9e1('0x4b'),'appdata':_0xf9e1('0x4c'),'interval':_0xf9e1('0x4d')});}_0x2ff6bf['created']=!![];}else{_0x2ff6bf[_0xf9e1('0x4e')]=![];}_0x308d36[_0xf9e1('0x4f')]=_0x2ff6bf;return db['FaxMessage'][_0xf9e1('0x45')]({'body':_0x37c989[_0xf9e1('0x26')][_0xf9e1('0x26')],'FaxAccountId':_0x37c989[_0xf9e1('0x3b')]['id'],'FaxInteractionId':_0x299fec['id'],'direction':'in','ContactId':_0x299fec[_0xf9e1('0x50')],'AttachmentId':_0x37c989[_0xf9e1('0x26')]['AttachmentId']});})[_0xf9e1('0x11')](function(_0x4ee596){_0x308d36[_0xf9e1('0x18')]=_0x4ee596;if(_0x308d36[_0xf9e1('0x4f')][_0xf9e1('0x51')]){return db[_0xf9e1('0x52')][_0xf9e1('0x3a')]({'attributes':['id','name'],'where':{'id':_0x308d36[_0xf9e1('0x4f')]['UserId']}})[_0xf9e1('0x11')](function(_0x4e1d57){if(_0x4e1d57){_0x308d36['applications'][_0xf9e1('0x53')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4e1d57[_0xf9e1('0x54')]+','+(_0x308d36[_0xf9e1('0x3b')][_0xf9e1('0x55')]||0xa),'interval':_0xf9e1('0x4d')});}return respondWithRpcPromise(_0xf9e1('0x56'),_0xf9e1('0x57'),_0x308d36);});}return respondWithRpcPromise(_0xf9e1('0x56'),_0xf9e1('0x57'),_0x308d36);})[_0xf9e1('0x11')](function(_0x38a30a){_0x50e721(_0x38a30a);})[_0xf9e1('0x1a')](function(_0xc4dfcb){_0x20e4c6(_0x591b61[_0xf9e1('0x17')](0x1f4,_0xc4dfcb[_0xf9e1('0x18')]));});});}; \ No newline at end of file +var _0x6d86=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','info','request\x20sent','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','findAll','options','raw','limit','include','map','model','attributes','then','debug','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','account','CmList','List','Contacts','updatedAt','DESC','Applications','list','applications','orderBy','priority','length','create','contact','find','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','name','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util'];(function(_0xb22b4b,_0x564a03){var _0x145a36=function(_0x42010b){while(--_0x42010b){_0xb22b4b['push'](_0xb22b4b['shift']());}};_0x145a36(++_0x564a03);}(_0x6d86,0x162));var _0x66d8=function(_0x14c1f3,_0xea173){_0x14c1f3=_0x14c1f3-0x0;var _0x30a979=_0x6d86[_0x14c1f3];return _0x30a979;};'use strict';var _=require(_0x66d8('0x0'));var util=require(_0x66d8('0x1'));var moment=require(_0x66d8('0x2'));var BPromise=require(_0x66d8('0x3'));var rs=require(_0x66d8('0x4'));var fs=require('fs');var Redis=require(_0x66d8('0x5'));var db=require(_0x66d8('0x6'))['db'];var utils=require(_0x66d8('0x7'));var logger=require(_0x66d8('0x8'))(_0x66d8('0x9'));var config=require(_0x66d8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x66d8('0xb')]['http']({'port':0x232c});config[_0x66d8('0xc')]=_[_0x66d8('0xd')](config[_0x66d8('0xc')],{'host':_0x66d8('0xe'),'port':0x18eb});var socket=require(_0x66d8('0xf'))(new Redis(config['redis']));require(_0x66d8('0x10'))[_0x66d8('0x11')](socket);function respondWithRpcPromise(_0x2b85a0,_0x375879,_0x330c31){return new BPromise(function(_0x3aded0,_0x25a8ec){return client[_0x66d8('0x12')](_0x2b85a0,_0x330c31)['then'](function(_0x6739a3){logger[_0x66d8('0x13')]('FaxAccount,\x20%s,\x20%s',_0x375879,_0x66d8('0x14'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x375879,_0x66d8('0x14'),JSON[_0x66d8('0x15')](_0x6739a3));if(_0x6739a3['error']){if(_0x6739a3[_0x66d8('0x16')][_0x66d8('0x17')]===0x1f4){logger[_0x66d8('0x16')]('FaxAccount,\x20%s,\x20%s',_0x375879,_0x6739a3[_0x66d8('0x16')]['message']);return _0x25a8ec(_0x6739a3[_0x66d8('0x16')][_0x66d8('0x18')]);}logger[_0x66d8('0x16')](_0x66d8('0x19'),_0x375879,_0x6739a3[_0x66d8('0x16')]['message']);return _0x3aded0(_0x6739a3[_0x66d8('0x16')]['message']);}else{logger[_0x66d8('0x13')](_0x66d8('0x19'),_0x375879,_0x66d8('0x14'));_0x3aded0(_0x6739a3[_0x66d8('0x1a')][_0x66d8('0x18')]);}})[_0x66d8('0x1b')](function(_0x428e00){logger[_0x66d8('0x16')](_0x66d8('0x19'),_0x375879,_0x428e00);_0x25a8ec(_0x428e00);});});}exports[_0x66d8('0x1c')]=function(_0x543bd3){var _0x1f2c75=this;return new Promise(function(_0x5c95bb,_0x2b88b7){return db['FaxAccount'][_0x66d8('0x1d')]({'raw':_0x543bd3[_0x66d8('0x1e')]?_0x543bd3[_0x66d8('0x1e')][_0x66d8('0x1f')]===undefined?!![]:![]:!![],'where':_0x543bd3[_0x66d8('0x1e')]?_0x543bd3['options']['where']||null:null,'attributes':_0x543bd3[_0x66d8('0x1e')]?_0x543bd3[_0x66d8('0x1e')]['attributes']||null:null,'limit':_0x543bd3[_0x66d8('0x1e')]?_0x543bd3['options'][_0x66d8('0x20')]||null:null,'include':_0x543bd3[_0x66d8('0x1e')]?_0x543bd3[_0x66d8('0x1e')][_0x66d8('0x21')]?_[_0x66d8('0x22')](_0x543bd3[_0x66d8('0x1e')][_0x66d8('0x21')],function(_0x359844){return{'model':db[_0x359844[_0x66d8('0x23')]],'as':_0x359844['as'],'attributes':_0x359844[_0x66d8('0x24')],'include':_0x359844[_0x66d8('0x21')]?_['map'](_0x359844['include'],function(_0x352472){return{'model':db[_0x352472['model']],'as':_0x352472['as'],'attributes':_0x352472['attributes'],'include':_0x352472[_0x66d8('0x21')]?_[_0x66d8('0x22')](_0x352472[_0x66d8('0x21')],function(_0x57ecb4){return{'model':db[_0x57ecb4[_0x66d8('0x23')]],'as':_0x57ecb4['as'],'attributes':_0x57ecb4[_0x66d8('0x24')]};}):[]};}):[]};}):[]:[]})[_0x66d8('0x25')](function(_0x537a54){logger[_0x66d8('0x13')]('GetFaxAccount',_0x543bd3);logger[_0x66d8('0x26')](_0x66d8('0x1c'),_0x543bd3,JSON[_0x66d8('0x15')](_0x537a54));_0x5c95bb(_0x537a54);})[_0x66d8('0x1b')](function(_0x1e7094){logger[_0x66d8('0x16')]('GetFaxAccount',_0x1e7094[_0x66d8('0x18')],_0x543bd3);_0x2b88b7(_0x1f2c75[_0x66d8('0x16')](0x1f4,_0x1e7094['message']));});});};exports['NotifyFaxAccount']=function(_0x3fc489,_0x3be073,_0x11100e){var _0x3e5b3d=this;return new Promise(function(_0xd9a354,_0x462715){var _0x27f436={'body':_0x3fc489[_0x66d8('0x27')],'channel':_0x66d8('0x28')};var _0x82620d=[];var _0x183536=[];var _0x2f3ea8={};return db['CmContact'][_0x66d8('0x29')]()['then'](function(_0x58c261){if(!_0x58c261){throw new db[(_0x66d8('0x2a'))][(_0x66d8('0x2b'))](_0x66d8('0x2c'));}_0x82620d=_[_0x66d8('0x2d')](_[_0x66d8('0x2e')](_0x58c261),[_0x66d8('0x2f'),'updatedAt']);_0x183536=_[_0x66d8('0x2d')](_[_0x66d8('0x2e')](_0x58c261),[_0x66d8('0x2f'),'updatedAt',_0x66d8('0x30'),_0x66d8('0x31')]);if(_0x3fc489[_0x66d8('0x27')]['id']){delete _0x3fc489['body']['id'];}if(_[_0x66d8('0x32')](_0x3fc489[_0x66d8('0x27')][_0x66d8('0x33')])){throw new db[(_0x66d8('0x2a'))][(_0x66d8('0x2b'))](_0x66d8('0x34'));}if(_[_0x66d8('0x32')](_0x3fc489['body'][_0x66d8('0x27')])||_0x3fc489[_0x66d8('0x27')]['body']===''){throw new db['Sequelize'][(_0x66d8('0x2b'))](_0x66d8('0x35'));}if(_[_0x66d8('0x32')](_0x3fc489[_0x66d8('0x27')]['mapKey'])){throw new db[(_0x66d8('0x2a'))][(_0x66d8('0x2b'))](_0x66d8('0x36')+_0x183536);}if(!_['includes'](_0x183536,_0x3fc489['body']['mapKey'])){throw new db[(_0x66d8('0x2a'))][(_0x66d8('0x2b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x183536);}_0x2f3ea8[_0x3fc489[_0x66d8('0x27')]['mapKey']]=_0x3fc489['body'][_0x66d8('0x33')];})[_0x66d8('0x25')](function(){return db[_0x66d8('0x37')]['find']({'where':{'id':_0x3fc489[_0x66d8('0x38')]['id']},'include':[{'model':db[_0x66d8('0x39')],'as':_0x66d8('0x3a'),'include':[{'model':db['CmContact'],'as':_0x66d8('0x3b'),'where':_0x2f3ea8,'limit':0x1,'order':[[_0x66d8('0x3c'),_0x66d8('0x3d')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})['then'](function(_0x5470fd){if(_0x5470fd&&_0x5470fd['List']){var _0x484bbb=_0x5470fd['get']({'plain':!![]});_0x27f436['account']=_0x484bbb;_0x27f436['applications']=_0x484bbb[_0x66d8('0x3e')];_0x27f436[_0x66d8('0x3f')]=_0x484bbb[_0x66d8('0x3a')];_0x27f436[_0x66d8('0x40')]=_[_0x66d8('0x41')](_0x27f436[_0x66d8('0x40')],[_0x66d8('0x42')],['asc']);if(_0x27f436[_0x66d8('0x38')]['Applications']){delete _0x27f436[_0x66d8('0x38')][_0x66d8('0x3e')];}if(_0x27f436[_0x66d8('0x38')][_0x66d8('0x3a')]&&_0x27f436[_0x66d8('0x38')][_0x66d8('0x3a')][_0x66d8('0x3b')][_0x66d8('0x43')]){return _0x27f436['account'][_0x66d8('0x3a')]['Contacts'][0x0];}var _0x32ad83=_['defaults'](_0x3fc489[_0x66d8('0x27')],{'firstName':_0x3fc489[_0x66d8('0x27')][_0x66d8('0x33')],'ListId':_0x484bbb['ListId']});_0x32ad83[_0x3fc489['body']['mapKey']]=_0x3fc489[_0x66d8('0x27')][_0x66d8('0x33')];return db['CmContact'][_0x66d8('0x44')](_0x32ad83,{'fields':_0x82620d,'raw':!![]});}})[_0x66d8('0x25')](function(_0x51f4c8){_0x27f436[_0x66d8('0x45')]=_0x51f4c8;if(_0x51f4c8){var _0x544fc0={'ContactId':_0x51f4c8['id'],'FaxAccountId':_0x3fc489[_0x66d8('0x38')]['id'],'fax':_0x51f4c8[_0x66d8('0x28')]};return db['FaxInteraction'][_0x66d8('0x46')]({'where':{'ContactId':_0x51f4c8['id'],'closed':![],'FaxAccountId':_0x3fc489[_0x66d8('0x38')]['id']}})[_0x66d8('0x25')](function(_0x25ec58){if(_0x25ec58){return[_0x25ec58,![]];}return db[_0x66d8('0x47')][_0x66d8('0x44')](_0x544fc0)['then'](function(_0x102d75){return[_0x102d75,!![]];});});}else{throw new Error(_0x66d8('0x48'));}})[_0x66d8('0x49')](function(_0x3a6c4d,_0x1b3b83){var _0xa7da69=_0x3a6c4d['get']({'plain':!![]});if(_0x1b3b83){if(_0x27f436[_0x66d8('0x38')][_0x66d8('0x4a')]){_0x27f436[_0x66d8('0x40')]['push']({'id':0x0,'priority':_0x27f436[_0x66d8('0x40')]['length']+0x1,'app':_0x66d8('0x4b'),'appdata':_0x66d8('0x4c'),'interval':'*,*,*,*'});}_0xa7da69[_0x66d8('0x4d')]=!![];}else{_0xa7da69['created']=![];}_0x27f436[_0x66d8('0x4e')]=_0xa7da69;return db[_0x66d8('0x4f')]['create']({'body':_0x3fc489[_0x66d8('0x27')][_0x66d8('0x27')],'FaxAccountId':_0x3fc489['account']['id'],'FaxInteractionId':_0x3a6c4d['id'],'direction':'in','ContactId':_0x3a6c4d[_0x66d8('0x50')],'AttachmentId':_0x3fc489['body'][_0x66d8('0x51')]});})['then'](function(_0x1f7553){_0x27f436[_0x66d8('0x18')]=_0x1f7553;if(_0x27f436[_0x66d8('0x4e')]['UserId']){return db['User'][_0x66d8('0x46')]({'attributes':['id',_0x66d8('0x52')],'where':{'id':_0x27f436['interaction'][_0x66d8('0x53')]}})[_0x66d8('0x25')](function(_0x13c8b8){if(_0x13c8b8){_0x27f436[_0x66d8('0x40')][_0x66d8('0x54')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x13c8b8[_0x66d8('0x52')]+','+(_0x27f436[_0x66d8('0x38')][_0x66d8('0x55')]||0xa),'interval':_0x66d8('0x56')});}return respondWithRpcPromise(_0x66d8('0x57'),_0x66d8('0x58'),_0x27f436);});}return respondWithRpcPromise(_0x66d8('0x57'),'startRouting',_0x27f436);})[_0x66d8('0x25')](function(_0x7376f7){_0xd9a354(_0x7376f7);})[_0x66d8('0x1b')](function(_0x2ff62c){_0x462715(_0x3e5b3d['error'](0x1f4,_0x2ff62c[_0x66d8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 900c46c..cfceb9e 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 _0xba34=['faxAccount:','./faxAccount.events','save','remove','update','removeListener','register'];(function(_0x9db750,_0xd34745){var _0x156866=function(_0xbd2151){while(--_0xbd2151){_0x9db750['push'](_0x9db750['shift']());}};_0x156866(++_0xd34745);}(_0xba34,0x119));var _0x4ba3=function(_0x104b59,_0x37d3c3){_0x104b59=_0x104b59-0x0;var _0x2cd5ff=_0xba34[_0x104b59];return _0x2cd5ff;};'use strict';var FaxAccountEvents=require(_0x4ba3('0x0'));var events=[_0x4ba3('0x1'),_0x4ba3('0x2'),_0x4ba3('0x3')];function createListener(_0xeb0ac4,_0x4d6e75){return function(_0x5aa88e){_0x4d6e75['emit'](_0xeb0ac4,_0x5aa88e);};}function removeListener(_0x4592fc,_0x2947f2){return function(){FaxAccountEvents[_0x4ba3('0x4')](_0x4592fc,_0x2947f2);};}exports[_0x4ba3('0x5')]=function(_0x3590a1){for(var _0xb88621=0x0,_0xe5f99a=events['length'];_0xb88621<_0xe5f99a;_0xb88621++){var _0x6254fb=events[_0xb88621];var _0x368eee=createListener(_0x4ba3('0x6')+_0x6254fb,_0x3590a1);FaxAccountEvents['on'](_0x6254fb,_0x368eee);}}; \ No newline at end of file +var _0x430c=['register','length','faxAccount:','./faxAccount.events','update','removeListener'];(function(_0x2587ce,_0xc1fcd7){var _0x1901a8=function(_0x214ebf){while(--_0x214ebf){_0x2587ce['push'](_0x2587ce['shift']());}};_0x1901a8(++_0xc1fcd7);}(_0x430c,0x1a1));var _0xc430=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x430c[_0x2cacef];return _0x289ba6;};'use strict';var FaxAccountEvents=require(_0xc430('0x0'));var events=['save','remove',_0xc430('0x1')];function createListener(_0xe2d084,_0x1d5b5e){return function(_0x503988){_0x1d5b5e['emit'](_0xe2d084,_0x503988);};}function removeListener(_0x5ccda6,_0x47d8b9){return function(){FaxAccountEvents[_0xc430('0x2')](_0x5ccda6,_0x47d8b9);};}exports[_0xc430('0x3')]=function(_0x50b256){for(var _0x42aa9c=0x0,_0x4de44f=events[_0xc430('0x4')];_0x42aa9c<_0x4de44f;_0x42aa9c++){var _0x2e51c6=events[_0x42aa9c];var _0x814a90=createListener(_0xc430('0x5')+_0x2e51c6,_0x50b256);FaxAccountEvents['on'](_0x2e51c6,_0x814a90);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 17ce410..408b348 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 _0xb4b2=['create','addDisposition','addAnswer','addInteraction','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users','put','update','delete','destroy','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','getAgents','post'];(function(_0x350258,_0x4e0a50){var _0x3714b3=function(_0x8918f7){while(--_0x8918f7){_0x350258['push'](_0x350258['shift']());}};_0x3714b3(++_0x4e0a50);}(_0xb4b2,0x139));var _0x2b4b=function(_0x57eb38,_0x7772d6){_0x57eb38=_0x57eb38-0x0;var _0x999897=_0xb4b2[_0x57eb38];return _0x999897;};'use strict';var multer=require(_0x2b4b('0x0'));var util=require('util');var path=require(_0x2b4b('0x1'));var timeout=require(_0x2b4b('0x2'));var express=require(_0x2b4b('0x3'));var router=express['Router']();var auth=require(_0x2b4b('0x4'));var interaction=require(_0x2b4b('0x5'));var config=require(_0x2b4b('0x6'));var controller=require('./faxAccount.controller');router[_0x2b4b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2b4b('0x7')]('/describe',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x9')]);router[_0x2b4b('0x7')](_0x2b4b('0xa'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0xb')]);router['get'](_0x2b4b('0xc'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0xd')]);router[_0x2b4b('0x7')]('/:id/canned_answers',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0xe')]);router['get'](_0x2b4b('0xf'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x10')]);router[_0x2b4b('0x7')](_0x2b4b('0x11'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x12')]);router[_0x2b4b('0x7')](_0x2b4b('0x13'),auth['isAuthenticated'](),controller[_0x2b4b('0x14')]);router['get']('/:id/users',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x15')]);router[_0x2b4b('0x16')]('/',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x17')]);router[_0x2b4b('0x16')](_0x2b4b('0xc'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x18')]);router[_0x2b4b('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2b4b('0x19')]);router[_0x2b4b('0x16')](_0x2b4b('0xf'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x1a')]);router[_0x2b4b('0x16')]('/:id/applications',auth[_0x2b4b('0x8')](),controller['addApplications']);router[_0x2b4b('0x16')](_0x2b4b('0x1b'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x1c')]);router['post'](_0x2b4b('0x1d'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x1e')]);router['post'](_0x2b4b('0x1f'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x20')]);router[_0x2b4b('0x16')](_0x2b4b('0x21'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2b4b('0x22')]('/:id',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x23')]);router[_0x2b4b('0x24')]('/:id',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x25')]);router[_0x2b4b('0x24')](_0x2b4b('0xc'),auth[_0x2b4b('0x8')](),controller['removeDispositions']);router['delete'](_0x2b4b('0x26'),auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x27')]);router[_0x2b4b('0x24')]('/:id/users',auth[_0x2b4b('0x8')](),controller[_0x2b4b('0x28')]);module[_0x2b4b('0x29')]=router; \ No newline at end of file +var _0x2f87=['create','/:id/canned_answers','addAnswer','/:id/interactions','addInteraction','/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','index','get','/describe','describe','isAuthenticated','show','/:id/dispositions','getDispositions','getAnswers','getInteractions','getApplications','/:id/users','post'];(function(_0xa5d052,_0x310712){var _0x12fd73=function(_0x187645){while(--_0x187645){_0xa5d052['push'](_0xa5d052['shift']());}};_0x12fd73(++_0x310712);}(_0x2f87,0x132));var _0x72f8=function(_0x2ad0a7,_0x418138){_0x2ad0a7=_0x2ad0a7-0x0;var _0x3f6916=_0x2f87[_0x2ad0a7];return _0x3f6916;};'use strict';var multer=require(_0x72f8('0x0'));var util=require(_0x72f8('0x1'));var path=require(_0x72f8('0x2'));var timeout=require('connect-timeout');var express=require(_0x72f8('0x3'));var router=express[_0x72f8('0x4')]();var auth=require(_0x72f8('0x5'));var interaction=require(_0x72f8('0x6'));var config=require(_0x72f8('0x7'));var controller=require(_0x72f8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x72f8('0x9')]);router[_0x72f8('0xa')](_0x72f8('0xb'),auth['isAuthenticated'](),controller[_0x72f8('0xc')]);router[_0x72f8('0xa')]('/:id',auth[_0x72f8('0xd')](),controller[_0x72f8('0xe')]);router[_0x72f8('0xa')](_0x72f8('0xf'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x10')]);router[_0x72f8('0xa')]('/:id/canned_answers',auth[_0x72f8('0xd')](),controller[_0x72f8('0x11')]);router['get']('/:id/interactions',auth[_0x72f8('0xd')](),controller[_0x72f8('0x12')]);router[_0x72f8('0xa')]('/:id/applications',auth[_0x72f8('0xd')](),controller[_0x72f8('0x13')]);router[_0x72f8('0xa')]('/:id/messages',auth[_0x72f8('0xd')](),controller['getMessages']);router[_0x72f8('0xa')](_0x72f8('0x14'),auth[_0x72f8('0xd')](),controller['getAgents']);router[_0x72f8('0x15')]('/',auth[_0x72f8('0xd')](),controller[_0x72f8('0x16')]);router['post'](_0x72f8('0xf'),auth[_0x72f8('0xd')](),controller['addDisposition']);router['post'](_0x72f8('0x17'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x18')]);router[_0x72f8('0x15')](_0x72f8('0x19'),auth['isAuthenticated'](),controller[_0x72f8('0x1a')]);router['post'](_0x72f8('0x1b'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x1c')]);router[_0x72f8('0x15')]('/addaccountapplications',auth[_0x72f8('0xd')](),controller[_0x72f8('0x1d')]);router[_0x72f8('0x15')](_0x72f8('0x1e'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x1f')]);router[_0x72f8('0x15')](_0x72f8('0x20'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x21')]);router[_0x72f8('0x15')]('/:id/users',auth[_0x72f8('0xd')](),controller['addAgents']);router['put'](_0x72f8('0x22'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x23')]);router['delete']('/:id',auth[_0x72f8('0xd')](),controller['destroy']);router[_0x72f8('0x24')](_0x72f8('0xf'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x25')]);router[_0x72f8('0x24')](_0x72f8('0x17'),auth[_0x72f8('0xd')](),controller[_0x72f8('0x26')]);router[_0x72f8('0x24')](_0x72f8('0x14'),auth['isAuthenticated'](),controller[_0x72f8('0x27')]);module[_0x72f8('0x28')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c82745b..d1dc925 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 _0x4ccb=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4d263e,_0x505e54){var _0x37d11a=function(_0x129341){while(--_0x129341){_0x4d263e['push'](_0x4d263e['shift']());}};_0x37d11a(++_0x505e54);}(_0x4ccb,0x196));var _0xb4cc=function(_0x351349,_0x48b658){_0x351349=_0x351349-0x0;var _0x4f6603=_0x4ccb[_0x351349];return _0x4f6603;};'use strict';var Sequelize=require(_0xb4cc('0x0'));module[_0xb4cc('0x1')]={'priority':{'type':Sequelize[_0xb4cc('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb4cc('0x3')},'appdata':{'type':Sequelize[_0xb4cc('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb4cc('0x5')],'defaultValue':_0xb4cc('0x6')}}; \ No newline at end of file +var _0x8374=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x470170,_0x454483){var _0x2cc1cc=function(_0x212a4c){while(--_0x212a4c){_0x470170['push'](_0x470170['shift']());}};_0x2cc1cc(++_0x454483);}(_0x8374,0x174));var _0x4837=function(_0x4d2bcc,_0x91f9e1){_0x4d2bcc=_0x4d2bcc-0x0;var _0x1821f5=_0x8374[_0x4d2bcc];return _0x1821f5;};'use strict';var Sequelize=require(_0x4837('0x0'));module[_0x4837('0x1')]={'priority':{'type':Sequelize[_0x4837('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4837('0x3')],'allowNull':![],'defaultValue':_0x4837('0x4')},'appdata':{'type':Sequelize[_0x4837('0x5')]()},'description':{'type':Sequelize[_0x4837('0x3')]},'interval':{'type':Sequelize[_0x4837('0x3')],'defaultValue':_0x4837('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 6d01587..6dc0832 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 _0xabce=['offset','limit','status','set','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','FaxApplication','find','catch','create','body','params','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'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_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['FaxApplication'][_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['FaxApplication'][_0xeabc('0x1c')](_0x257fe8)['then'](function(_0x3d48f4){_0x5bf8f2['count']=_0x3d48f4;if(_0x131722[_0xeabc('0x30')][_0xeabc('0x3d')]){_0x5b2934[_0xeabc('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['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['FaxApplication']['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));}; \ No newline at end of file +var _0x814b=['destroy','then','error','stack','name','send','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','FaxApplication','options','find','create','body','params','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'];(function(_0x4cffbf,_0x4e7e20){var _0x4f803e=function(_0x1ceb9a){while(--_0x1ceb9a){_0x4cffbf['push'](_0x4cffbf['shift']());}};_0x4f803e(++_0x4e7e20);}(_0x814b,0x1a2));var _0xb814=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x814b[_0x47a349];return _0x18ab75;};'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['FaxApplication'][_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['FaxApplication'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['FaxApplication'][_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));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a9f59d2..b2cc5b3 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 _0x34ca=['define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x1b89ea,_0x481aa2){var _0x4e713a=function(_0x798754){while(--_0x798754){_0x1b89ea['push'](_0x1b89ea['shift']());}};_0x4e713a(++_0x481aa2);}(_0x34ca,0x101));var _0xa34c=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x34ca[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0xa34c('0x0'));var util=require(_0xa34c('0x1'));var logger=require(_0xa34c('0x2'))(_0xa34c('0x3'));var moment=require(_0xa34c('0x4'));var BPromise=require(_0xa34c('0x5'));var rp=require(_0xa34c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa34c('0x7'));var attributes=require('./faxApplication.attributes');module[_0xa34c('0x8')]=function(_0x3c6f16,_0x457c88){return _0x3c6f16[_0xa34c('0x9')](_0xa34c('0xa'),attributes,{'tableName':_0xa34c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa34c('0xc'),'collate':_0xa34c('0xd')});}; \ No newline at end of file +var _0xbb04=['define','FaxApplication','fax_applications','utf8mb4','lodash','api','bluebird','path','rimraf','exports'];(function(_0xe636b5,_0x36a86b){var _0x455ca9=function(_0x4aead3){while(--_0x4aead3){_0xe636b5['push'](_0xe636b5['shift']());}};_0x455ca9(++_0x36a86b);}(_0xbb04,0x9a));var _0x4bb0=function(_0x158ab3,_0x4b5908){_0x158ab3=_0x158ab3-0x0;var _0x302830=_0xbb04[_0x158ab3];return _0x302830;};'use strict';var _=require(_0x4bb0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4bb0('0x1'));var moment=require('moment');var BPromise=require(_0x4bb0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bb0('0x3'));var rimraf=require(_0x4bb0('0x4'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x4bb0('0x5')]=function(_0x972398,_0x2c09d0){return _0x972398[_0x4bb0('0x6')](_0x4bb0('0x7'),attributes,{'tableName':_0x4bb0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4bb0('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index bf89b6c..dabf762 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 _0xed8d=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','limit'];(function(_0x4c8df3,_0x3624c7){var _0x205553=function(_0xd8ec43){while(--_0xd8ec43){_0x4c8df3['push'](_0x4c8df3['shift']());}};_0x205553(++_0x3624c7);}(_0xed8d,0x14b));var _0xded8=function(_0x45fb4f,_0x2ddb9d){_0x45fb4f=_0x45fb4f-0x0;var _0x55d8d4=_0xed8d[_0x45fb4f];return _0x55d8d4;};'use strict';var _=require(_0xded8('0x0'));var util=require(_0xded8('0x1'));var moment=require(_0xded8('0x2'));var BPromise=require(_0xded8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xded8('0x4'));var db=require(_0xded8('0x5'))['db'];var utils=require(_0xded8('0x6'));var logger=require(_0xded8('0x7'))(_0xded8('0x8'));var config=require(_0xded8('0x9'));var jayson=require(_0xded8('0xa'));var client=jayson['client'][_0xded8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x332262,_0x4bafb3,_0x58f63d){return new BPromise(function(_0x12df51,_0x3cd31c){return client[_0xded8('0xc')](_0x332262,_0x58f63d)[_0xded8('0xd')](function(_0x335237){logger[_0xded8('0xe')](_0xded8('0xf'),_0x4bafb3,_0xded8('0x10'));logger[_0xded8('0x11')](_0xded8('0x12'),_0x4bafb3,_0xded8('0x10'),JSON[_0xded8('0x13')](_0x335237));if(_0x335237[_0xded8('0x14')]){if(_0x335237[_0xded8('0x14')][_0xded8('0x15')]===0x1f4){logger[_0xded8('0x14')](_0xded8('0xf'),_0x4bafb3,_0x335237[_0xded8('0x14')][_0xded8('0x16')]);return _0x3cd31c(_0x335237[_0xded8('0x14')]['message']);}logger[_0xded8('0x14')](_0xded8('0xf'),_0x4bafb3,_0x335237[_0xded8('0x14')]['message']);return _0x12df51(_0x335237[_0xded8('0x14')][_0xded8('0x16')]);}else{logger[_0xded8('0xe')](_0xded8('0xf'),_0x4bafb3,_0xded8('0x10'));_0x12df51(_0x335237[_0xded8('0x17')][_0xded8('0x16')]);}})['catch'](function(_0x1b4dc4){logger[_0xded8('0x14')](_0xded8('0xf'),_0x4bafb3,_0x1b4dc4);_0x3cd31c(_0x1b4dc4);});});}exports[_0xded8('0x18')]=function(_0x44207c){var _0x52baf6=this;return new Promise(function(_0x479b73,_0x3afb79){return db[_0xded8('0x19')][_0xded8('0x1a')](_0x44207c[_0xded8('0x1b')],{'raw':_0x44207c['options']?_0x44207c[_0xded8('0x1c')][_0xded8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44207c[_0xded8('0x1c')]?_0x44207c['options'][_0xded8('0x1e')]||null:null,'attributes':_0x44207c[_0xded8('0x1c')]?_0x44207c[_0xded8('0x1c')]['attributes']||null:null,'limit':_0x44207c[_0xded8('0x1c')]?_0x44207c[_0xded8('0x1c')][_0xded8('0x1f')]||null:null})[_0xded8('0xd')](function(_0xbc928a){logger[_0xded8('0xe')](_0xded8('0x18'),_0x44207c);logger[_0xded8('0x11')](_0xded8('0x18'),_0x44207c,JSON[_0xded8('0x13')](_0xbc928a));_0x479b73(_0xbc928a);})[_0xded8('0x20')](function(_0xcea9b2){logger[_0xded8('0x14')]('UpdateFaxApplication',_0xcea9b2['message'],_0x44207c);_0x3afb79(_0x52baf6['error'](0x1f4,_0xcea9b2[_0xded8('0x16')]));});});}; \ No newline at end of file +var _0x4d20=['options','raw','where','attributes','limit','stringify','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateFaxApplication','FaxApplication','body'];(function(_0x43ad57,_0x463504){var _0x38c75f=function(_0x4c0185){while(--_0x4c0185){_0x43ad57['push'](_0x43ad57['shift']());}};_0x38c75f(++_0x463504);}(_0x4d20,0x18c));var _0x04d2=function(_0xa821d4,_0x575d04){_0xa821d4=_0xa821d4-0x0;var _0x4f9f8a=_0x4d20[_0xa821d4];return _0x4f9f8a;};'use strict';var _=require(_0x04d2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x04d2('0x1'));var rs=require(_0x04d2('0x2'));var fs=require('fs');var Redis=require(_0x04d2('0x3'));var db=require(_0x04d2('0x4'))['db'];var utils=require(_0x04d2('0x5'));var logger=require(_0x04d2('0x6'))(_0x04d2('0x7'));var config=require(_0x04d2('0x8'));var jayson=require(_0x04d2('0x9'));var client=jayson[_0x04d2('0xa')][_0x04d2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x315655,_0x567c8b,_0x87fd8b){return new BPromise(function(_0x3c5ad9,_0x1b9538){return client['request'](_0x315655,_0x87fd8b)[_0x04d2('0xc')](function(_0xb67063){logger[_0x04d2('0xd')](_0x04d2('0xe'),_0x567c8b,_0x04d2('0xf'));logger[_0x04d2('0x10')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x567c8b,_0x04d2('0xf'),JSON['stringify'](_0xb67063));if(_0xb67063[_0x04d2('0x11')]){if(_0xb67063['error'][_0x04d2('0x12')]===0x1f4){logger[_0x04d2('0x11')](_0x04d2('0xe'),_0x567c8b,_0xb67063[_0x04d2('0x11')]['message']);return _0x1b9538(_0xb67063[_0x04d2('0x11')][_0x04d2('0x13')]);}logger[_0x04d2('0x11')](_0x04d2('0xe'),_0x567c8b,_0xb67063['error'][_0x04d2('0x13')]);return _0x3c5ad9(_0xb67063[_0x04d2('0x11')][_0x04d2('0x13')]);}else{logger[_0x04d2('0xd')](_0x04d2('0xe'),_0x567c8b,_0x04d2('0xf'));_0x3c5ad9(_0xb67063[_0x04d2('0x14')]['message']);}})['catch'](function(_0x745571){logger[_0x04d2('0x11')](_0x04d2('0xe'),_0x567c8b,_0x745571);_0x1b9538(_0x745571);});});}exports[_0x04d2('0x15')]=function(_0x49eac9){var _0x43247e=this;return new Promise(function(_0xba6637,_0x38e5d3){return db[_0x04d2('0x16')]['update'](_0x49eac9[_0x04d2('0x17')],{'raw':_0x49eac9[_0x04d2('0x18')]?_0x49eac9[_0x04d2('0x18')][_0x04d2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49eac9[_0x04d2('0x18')]?_0x49eac9['options'][_0x04d2('0x1a')]||null:null,'attributes':_0x49eac9[_0x04d2('0x18')]?_0x49eac9[_0x04d2('0x18')][_0x04d2('0x1b')]||null:null,'limit':_0x49eac9[_0x04d2('0x18')]?_0x49eac9[_0x04d2('0x18')][_0x04d2('0x1c')]||null:null})[_0x04d2('0xc')](function(_0x473a51){logger[_0x04d2('0xd')](_0x04d2('0x15'),_0x49eac9);logger[_0x04d2('0x10')]('UpdateFaxApplication',_0x49eac9,JSON[_0x04d2('0x1d')](_0x473a51));_0xba6637(_0x473a51);})['catch'](function(_0x1d7a18){logger[_0x04d2('0x11')](_0x04d2('0x15'),_0x1d7a18[_0x04d2('0x13')],_0x49eac9);_0x38e5d3(_0x43247e['error'](0x1f4,_0x1d7a18[_0x04d2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 8c9d3ef..3b63986 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 _0xb138=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','multer','util','path'];(function(_0x31c112,_0x30612f){var _0xd2d71=function(_0x2d42c3){while(--_0x2d42c3){_0x31c112['push'](_0x31c112['shift']());}};_0xd2d71(++_0x30612f);}(_0xb138,0x1dd));var _0x8b13=function(_0x549d57,_0x6b8598){_0x549d57=_0x549d57-0x0;var _0x330291=_0xb138[_0x549d57];return _0x330291;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var auth=require(_0x8b13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b13('0x7'));var controller=require(_0x8b13('0x8'));router[_0x8b13('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b13('0xa')]);router[_0x8b13('0x9')]('/:id',auth[_0x8b13('0xb')](),controller[_0x8b13('0xc')]);router[_0x8b13('0xd')]('/',auth['isAuthenticated'](),controller[_0x8b13('0xe')]);router[_0x8b13('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8b13('0x10')]);router[_0x8b13('0x11')](_0x8b13('0x12'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x13')]);module['exports']=router; \ No newline at end of file +var _0xafc4=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','create','put','update','exports'];(function(_0xb6c0ae,_0x29c677){var _0x55b0f1=function(_0x1e2ff8){while(--_0x1e2ff8){_0xb6c0ae['push'](_0xb6c0ae['shift']());}};_0x55b0f1(++_0x29c677);}(_0xafc4,0x69));var _0x4afc=function(_0xc1ca83,_0xe01079){_0xc1ca83=_0xc1ca83-0x0;var _0x344ed3=_0xafc4[_0xc1ca83];return _0x344ed3;};'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 b78b913..35fdb15 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 _0x3d4b=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x1ec24e,_0x32c563){var _0x18b742=function(_0x2cfcf1){while(--_0x2cfcf1){_0x1ec24e['push'](_0x1ec24e['shift']());}};_0x18b742(++_0x32c563);}(_0x3d4b,0x1be));var _0xb3d4=function(_0x61ed7f,_0x31fa63){_0x61ed7f=_0x61ed7f-0x0;var _0x1d3e82=_0x3d4b[_0x61ed7f];return _0x1d3e82;};'use strict';var Sequelize=require(_0xb3d4('0x0'));module[_0xb3d4('0x1')]={'closed':{'type':Sequelize[_0xb3d4('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb3d4('0x3')]},'disposition':{'type':Sequelize[_0xb3d4('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xb3d4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xb3d4('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb3d4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb3d4('0x5')]('in',_0xb3d4('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x897a=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x55206a,_0x2b0787){var _0xd365be=function(_0x194445){while(--_0x194445){_0x55206a['push'](_0x55206a['shift']());}};_0xd365be(++_0x2b0787);}(_0x897a,0xa9));var _0xa897=function(_0x354126,_0xcd682b){_0x354126=_0x354126-0x0;var _0x19c269=_0x897a[_0x354126];return _0x19c269;};'use strict';var Sequelize=require(_0xa897('0x0'));module['exports']={'closed':{'type':Sequelize[_0xa897('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa897('0x2')]},'disposition':{'type':Sequelize[_0xa897('0x3')]},'note':{'type':Sequelize[_0xa897('0x3')]},'read1stAt':{'type':Sequelize[_0xa897('0x2')]},'fax':{'type':Sequelize[_0xa897('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa897('0x4')]('in',_0xa897('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa897('0x4')]('in',_0xa897('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 4deebee..ea21b46 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 _0x5454=['length','hasOwnProperty','offset','order','sort','where','filters','field','color','from','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','`unreadMessages`\x20=\x200','tag','filter','replace','\x27\x27\x27\x27','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','unlinkSync','zip-dir','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','count','limit','set','Content-Range','json','apply','reject','update','destroy','then','status','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','index','FaxInteraction','fieldName','type','key','model','query','keys','attributes','intersection','fields'];(function(_0x1353d8,_0x33f93b){var _0x35cd80=function(_0x456f45){while(--_0x456f45){_0x1353d8['push'](_0x1353d8['shift']());}};_0x35cd80(++_0x33f93b);}(_0x5454,0x15b));var _0x4545=function(_0x260992,_0x1ae28f){_0x260992=_0x260992-0x0;var _0x4b848f=_0x5454[_0x260992];return _0x4b848f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4545('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4545('0x1'));var Mustache=require(_0x4545('0x2'));var util=require(_0x4545('0x3'));var path=require(_0x4545('0x4'));var sox=require('sox');var csv=require(_0x4545('0x5'));var ejs=require(_0x4545('0x6'));var fs=require('fs');var _=require(_0x4545('0x7'));var squel=require(_0x4545('0x8'));var crypto=require(_0x4545('0x9'));var jsforce=require(_0x4545('0xa'));var deskjs=require(_0x4545('0xb'));var toCsv=require(_0x4545('0x5'));var querystring=require(_0x4545('0xc'));var Papa=require(_0x4545('0xd'));var Redis=require(_0x4545('0xe'));var authService=require(_0x4545('0xf'));var qs=require(_0x4545('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4545('0x11'));var logger=require(_0x4545('0x12'))(_0x4545('0x13'));var utils=require(_0x4545('0x14'));var config=require(_0x4545('0x15'));var db=require(_0x4545('0x16'))['db'];config['redis']=_[_0x4545('0x17')](config[_0x4545('0x18')],{'host':_0x4545('0x19'),'port':0x18eb});var socket=require(_0x4545('0x1a'))(new Redis(config[_0x4545('0x18')]));require(_0x4545('0x1b'))[_0x4545('0x1c')](socket);function respondWithStatusCode(_0x347072,_0x36bb8e){_0x36bb8e=_0x36bb8e||0xcc;return function(_0xab7856){if(_0xab7856){return _0x347072[_0x4545('0x1d')](_0x36bb8e);}return _0x347072['status'](_0x36bb8e)[_0x4545('0x1e')]();};}function respondWithResult(_0x3577f5,_0x2416b0){_0x2416b0=_0x2416b0||0xc8;return function(_0x3bb165){if(_0x3bb165){return _0x3577f5['status'](_0x2416b0)['json'](_0x3bb165);}};}function respondWithFilteredResult(_0x3bf878,_0x29effa){return function(_0x44704b){if(_0x44704b){var _0x2e13e0=_0x44704b[_0x4545('0x1f')],_0x207e38=_0x29effa['offset'],_0x33393b=_0x29effa['offset']+_0x29effa[_0x4545('0x20')],_0x3161c8;if(_0x33393b>=_0x2e13e0){_0x33393b=_0x2e13e0;_0x3161c8=0xc8;}else{_0x3161c8=0xce;}_0x3bf878['status'](_0x3161c8);return _0x3bf878[_0x4545('0x21')](_0x4545('0x22'),_0x207e38+'-'+_0x33393b+'/'+_0x2e13e0)[_0x4545('0x23')](_0x44704b);}return null;};}function patchUpdates(_0x6b3bc){return function(_0x7e47e5){try{jsonpatch[_0x4545('0x24')](_0x7e47e5,_0x6b3bc,!![]);}catch(_0x1a4f5a){return BPromise[_0x4545('0x25')](_0x1a4f5a);}return _0x7e47e5['save']();};}function saveUpdates(_0x580b57,_0x431b5d){return function(_0x483827){if(_0x483827){return _0x483827[_0x4545('0x26')](_0x580b57)['then'](function(_0x293c18){return _0x293c18;});}return null;};}function removeEntity(_0x4c47c0,_0x519489){return function(_0x21dbc2){if(_0x21dbc2){return _0x21dbc2[_0x4545('0x27')]()[_0x4545('0x28')](function(){_0x4c47c0[_0x4545('0x29')](0xcc)[_0x4545('0x1e')]();});}};}function handleEntityNotFound(_0x39eaa1,_0x43033c){return function(_0x889814){if(!_0x889814){_0x39eaa1[_0x4545('0x1d')](0x194);}return _0x889814;};}function handleError(_0x2a6842,_0x3e5807){_0x3e5807=_0x3e5807||0x1f4;return function(_0x43749b){logger[_0x4545('0x2a')](_0x43749b[_0x4545('0x2b')]);if(_0x43749b[_0x4545('0x2c')]){delete _0x43749b[_0x4545('0x2c')];}_0x2a6842['status'](_0x3e5807)[_0x4545('0x2d')](_0x43749b);};}function getInteractionUsers(_0x2c256b,_0x853476){return new BPromise(function(_0x394a8e,_0xb9c5ee){try{if(_0x853476[_0x2c256b['id']]){_0x2c256b['Users']=_[_0x4545('0x2e')](_0x853476[_0x2c256b['id']],function(_0x39ddcc){return{'id':_0x39ddcc['id'],'fullname':_0x39ddcc[_0x4545('0x2f')]};});}}catch(_0x247762){_0xb9c5ee(_0x247762);}_0x394a8e(_0x2c256b);});}function getInteractionTags(_0x1da2a9,_0x27b7d7){return new BPromise(function(_0x52dd8e,_0x406920){try{if(_0x1da2a9[_0x4545('0x30')]){_0x1da2a9[_0x4545('0x31')]=[];_0x1da2a9[_0x4545('0x30')][_0x4545('0x32')](',')[_0x4545('0x33')](function(_0x879927){_0x1da2a9[_0x4545('0x31')][_0x4545('0x34')](_0x27b7d7[_0x879927]);});}delete _0x1da2a9[_0x4545('0x30')];}catch(_0x196884){_0x406920(_0x196884);}_0x52dd8e(_0x1da2a9);});}function updateFaxInteraction(_0x4a606d,_0x1e3a47,_0x5d3f61){return new BPromise(function(_0x2848ac,_0x9bffd8){return getInteractionUsers(_0x4a606d,_0x5d3f61)['then'](function(_0x329417){return getInteractionTags(_0x329417,_0x1e3a47);})[_0x4545('0x28')](function(_0x46e814){_0x2848ac(_0x46e814);})[_0x4545('0x35')](function(_0x1f4a3b){_0x9bffd8(_0x1f4a3b);});});}exports[_0x4545('0x36')]=function(_0x16acf4,_0x54ea62){var _0x1abc06={},_0x386b38={},_0x36f4b9={'count':0x0,'rows':[]};var _0x1b7a11=_[_0x4545('0x2e')](db[_0x4545('0x37')]['rawAttributes'],function(_0x2db2f7){return{'name':_0x2db2f7[_0x4545('0x38')],'type':_0x2db2f7[_0x4545('0x39')][_0x4545('0x3a')]};});_0x386b38[_0x4545('0x3b')]=_[_0x4545('0x2e')](_0x1b7a11,_0x4545('0x2c'));_0x386b38[_0x4545('0x3c')]=_[_0x4545('0x3d')](_0x16acf4['query']);_0x386b38['filters']=_['intersection'](_0x386b38[_0x4545('0x3b')],_0x386b38['query']);_0x1abc06[_0x4545('0x3e')]=_[_0x4545('0x3f')](_0x386b38[_0x4545('0x3b')],qs[_0x4545('0x40')](_0x16acf4['query']['fields']));_0x1abc06[_0x4545('0x3e')]=_0x1abc06['attributes'][_0x4545('0x41')]?_0x1abc06[_0x4545('0x3e')]:_0x386b38[_0x4545('0x3b')];if(!_0x16acf4[_0x4545('0x3c')][_0x4545('0x42')]('nolimit')){_0x1abc06['limit']=qs[_0x4545('0x20')](_0x16acf4[_0x4545('0x3c')][_0x4545('0x20')]);_0x1abc06['offset']=qs[_0x4545('0x43')](_0x16acf4[_0x4545('0x3c')]['offset']);}_0x1abc06[_0x4545('0x44')]=qs['sort'](_0x16acf4[_0x4545('0x3c')][_0x4545('0x45')]);_0x1abc06[_0x4545('0x46')]=qs[_0x4545('0x47')](_['pick'](_0x16acf4[_0x4545('0x3c')],_0x386b38[_0x4545('0x47')]),_0x1b7a11);var _0x3d308e=[];var _0x299869=squel['select']()['field']('id')[_0x4545('0x48')]('name')[_0x4545('0x48')](_0x4545('0x49'))[_0x4545('0x4a')](_0x4545('0x4b'));var _0x427554=squel[_0x4545('0x4c')]()[_0x4545('0x48')](_0x4545('0x4d'))['field'](_0x4545('0x4e'))[_0x4545('0x48')](_0x4545('0x4f'))['from'](_0x4545('0x50'),'ui')[_0x4545('0x51')](_0x4545('0x52'),'u',_0x4545('0x53'));var _0x46123d=squel[_0x4545('0x4c')]()[_0x4545('0x4a')](_0x4545('0x54'),'i')['left_join'](_0x4545('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4545('0x51')]('users','o',_0x4545('0x56'))[_0x4545('0x51')](_0x4545('0x57'),'a','a.id\x20=\x20i.FaxAccountId')[_0x4545('0x51')](_0x4545('0x58'),'me',_0x4545('0x59'))[_0x4545('0x51')](_0x4545('0x5a'),'it',_0x4545('0x5b'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x563835=squel[_0x4545('0x5c')]();var _0x14153e=[];var _0x32b6fd=squel[_0x4545('0x5c')]();var _0x6fd3b6;if(_0x16acf4[_0x4545('0x3c')][_0x4545('0x5d')]){_0x6fd3b6=as['parseSearch'](_0x16acf4['query'][_0x4545('0x5d')]);var _0x32fdc1=_0x6fd3b6[_0x4545('0x5e')];for(var _0x2946b5=0x0;_0x2946b5<_0x6fd3b6[_0x4545('0x5f')][_0x4545('0x41')];_0x2946b5++){var _0x4e9a19=_0x6fd3b6[_0x4545('0x5f')][_0x2946b5];var _0xbf9ef4='i';var _0x59d9e5=_[_0x4545('0x60')](_0x1b7a11,['name',_0x4e9a19[_0x4545('0x48')]]);if(!_0x59d9e5){switch(_0x4e9a19[_0x4545('0x48')]){case _0x4545('0x61'):if(_0x4e9a19[_0x4545('0x62')]==0x1){_0x46123d[_0x4545('0x63')]('`'+_0x4e9a19[_0x4545('0x48')]+_0x4545('0x64'));}else{_0x46123d['having']('`'+_0x4e9a19[_0x4545('0x48')]+'`\x20>\x200');}break;case _0x4545('0x65'):if(_0x4e9a19['operator']===_0x4545('0x66')){if(_0x4e9a19[_0x4545('0x62')][_0x4545('0x32')]('\x20')['length']>0x1){_0x563835[_0x32fdc1](_0x4545('0x67'),qs[_0x4545('0x68')](_0x4e9a19['value']),null);}else{var _0x37a775='%'+_0x4e9a19['value']+'%';_0x563835[_0x32fdc1](_0x4545('0x69'),_0x37a775,_0x37a775,_0x37a775);}}else{_0x59d9e5=_[_0x4545('0x60')](_0x1b7a11,[_0x4545('0x2c'),_0x4545('0x6a')]);_0x4e9a19[_0x4545('0x48')]=_0x4545('0x6a');_0x40393b=as[_0x4545('0x6b')](_0xbf9ef4,_0x59d9e5[_0x4545('0x39')],_0x4e9a19);_0x563835[_0x32fdc1](_0x40393b[_0x4545('0x6c')],_0x40393b['value'][_0x4545('0x6d')],_0x40393b[_0x4545('0x62')][_0x4545('0x1e')]);}break;case _0x4545('0x6e'):var _0xcd6b7d=_0x4e9a19['value'][_0x4545('0x32')](',')[_0x4545('0x2e')](function(_0x40e25a){return Number(_0x40e25a);});_0xcd6b7d[_0x4545('0x33')](function(_0x8be55e){_0x32b6fd['or'](_0x4545('0x6f'),'%,'+_0x8be55e+',%');});_0x14153e=_[_0x4545('0x70')](_0x14153e,_0xcd6b7d);break;case _0x4545('0x71'):if(_0x4e9a19['operator']===_0x4545('0x66')){_0x563835[_0x32fdc1](_0x4545('0x72'),'%'+_0x4e9a19[_0x4545('0x62')]+'%',null);}else{_0x59d9e5=_[_0x4545('0x60')](_0x1b7a11,[_0x4545('0x2c'),_0x4545('0x73')]);_0x4e9a19[_0x4545('0x48')]=_0x4545('0x73');_0x40393b=as['buildExpression'](_0xbf9ef4,_0x59d9e5[_0x4545('0x39')],_0x4e9a19);_0x563835[_0x32fdc1](_0x40393b[_0x4545('0x6c')],_0x40393b[_0x4545('0x62')][_0x4545('0x6d')],_0x40393b[_0x4545('0x62')]['end']);}break;case _0x4545('0x74'):_0x40393b=as[_0x4545('0x6b')]('me',null,_0x4e9a19);_0x563835[_0x32fdc1](_0x40393b[_0x4545('0x6c')],_0x40393b[_0x4545('0x62')][_0x4545('0x6d')],_0x40393b[_0x4545('0x62')][_0x4545('0x1e')]);break;}}else{var _0x40393b=as[_0x4545('0x6b')](_0xbf9ef4,_0x59d9e5[_0x4545('0x39')],_0x4e9a19);_0x563835[_0x32fdc1](_0x40393b[_0x4545('0x6c')],_0x40393b[_0x4545('0x62')][_0x4545('0x6d')],_0x40393b['value'][_0x4545('0x1e')]);}}}else{var _0x4240cc=_(_0x16acf4[_0x4545('0x3c')])[_0x4545('0x3d')]()[_0x4545('0x2e')](function(_0x26dd68){return _['some'](_0x1b7a11,['name',_0x26dd68])?_0x26dd68:undefined;})[_0x4545('0x75')]()[_0x4545('0x62')]();if(!_[_0x4545('0x76')](_0x4240cc)){_0x4240cc[_0x4545('0x33')](function(_0x26cf0f){if(_0x26cf0f===_0x4545('0x77')){_0x46123d[_0x4545('0x46')](_0x4545('0x78'),[][_0x4545('0x79')](_0x16acf4[_0x4545('0x3c')][_0x26cf0f]));}else if(_0x26cf0f===_0x4545('0x7a')){var _0x447746=JSON['parse'](_0x16acf4[_0x4545('0x3c')][_0x26cf0f])['$gte'];var _0xceccec=JSON['parse'](_0x16acf4[_0x4545('0x3c')][_0x26cf0f])['$lte'];_0x46123d[_0x4545('0x46')](_0x4545('0x7b'),_0x447746,_0xceccec);}else{if(_0x16acf4[_0x4545('0x3c')][_0x26cf0f]==='null'){_0x46123d['where']('i.'+_0x26cf0f+_0x4545('0x7c'));}else{_0x46123d[_0x4545('0x46')]('i.'+_0x26cf0f+'\x20=\x20?',_0x16acf4[_0x4545('0x3c')][_0x26cf0f]);}}});}if(_0x16acf4[_0x4545('0x3c')]['read']){if(_0x16acf4[_0x4545('0x3c')]['read']==0x1){_0x46123d[_0x4545('0x63')](_0x4545('0x7d'));}else{_0x46123d['having']('`unreadMessages`\x20>\x200');}}if(_0x16acf4[_0x4545('0x3c')]['tag']){_0x14153e=_['isArray'](_0x16acf4[_0x4545('0x3c')][_0x4545('0x7e')])?_0x16acf4[_0x4545('0x3c')][_0x4545('0x7e')]:new Array(_0x16acf4[_0x4545('0x3c')]['tag']);_0x14153e['forEach'](function(_0x5e8b41){_0x32b6fd['or'](_0x4545('0x6f'),'%,'+_0x5e8b41+',%');});}if(_0x16acf4[_0x4545('0x3c')][_0x4545('0x7f')]){var _0x49e1fe=_0x16acf4[_0x4545('0x3c')][_0x4545('0x7f')]['replace']('\x5c','\x5c\x5c')[_0x4545('0x80')]('\x27\x27',_0x4545('0x81'));if(qs['isNumeric'](_0x49e1fe)){_0x563835['or']('i.id\x20LIKE\x20?',_0x49e1fe+'%')['or'](_0x4545('0x82'),_0x49e1fe+'%');}_0x563835['or'](_0x4545('0x83'),_0x49e1fe+'%');}}_0x46123d['where'](_0x563835);_0x46123d[_0x4545('0x84')]('i.id');var _0x127202={'type':db['Sequelize'][_0x4545('0x85')]['SELECT'],'raw':!![]};var _0x1178f3=_0x46123d[_0x4545('0x86')]();_0x1178f3[_0x4545('0x48')](_0x4545('0x87'));_0x1178f3[_0x4545('0x48')](_0x4545('0x88'),_0x4545('0x61'));if(_0x1abc06['order']){_0x1abc06[_0x4545('0x44')][_0x4545('0x33')](function(_0x3cb9de){_0x46123d[_0x4545('0x44')]('i.'+_0x3cb9de[0x0],_0x3cb9de[0x1]===_0x4545('0x89')?![]:!![]);});}if(!_['isEmpty'](_0x14153e)){_0x46123d['having'](_0x32b6fd);_0x1178f3[_0x4545('0x46')](_0x4545('0x8a'),_0x14153e);}BPromise['resolve']()[_0x4545('0x28')](function(){if(!_0x6fd3b6){if(_0x16acf4[_0x4545('0x3c')][_0x4545('0x77')]||_0x16acf4['query']['journey'])return;_0x1178f3[_0x4545('0x46')](_0x4545('0x8b'));_0x46123d[_0x4545('0x46')](_0x4545('0x8b'));return;}return _0x16acf4[_0x4545('0x8c')][_0x4545('0x8d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x45ee11){if(_[_0x4545('0x76')](_0x45ee11)){_0x1178f3[_0x4545('0x46')](_0x4545('0x8e'));_0x46123d[_0x4545('0x46')](_0x4545('0x8e'));}else{_0x1178f3[_0x4545('0x46')](_0x4545('0x78'),_[_0x4545('0x2e')](_0x45ee11,'id'));_0x46123d[_0x4545('0x46')](_0x4545('0x78'),_[_0x4545('0x2e')](_0x45ee11,'id'));}});})[_0x4545('0x28')](function(){db[_0x4545('0x8f')][_0x4545('0x3c')](_0x1178f3[_0x4545('0x90')](),_0x127202)[_0x4545('0x28')](function(_0x49baaa){_0x36f4b9[_0x4545('0x1f')]=_0x49baaa[_0x4545('0x41')];if(_0x36f4b9[_0x4545('0x1f')]===0x0)return[];return db[_0x4545('0x8f')][_0x4545('0x3c')](_0x299869['toString'](),_0x127202)[_0x4545('0x28')](function(_0x4399d7){_0x3d308e=_[_0x4545('0x91')](_0x4399d7,'id');_0x127202=_[_0x4545('0x92')](_0x127202,{'model':db[_0x4545('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x16acf4['query'][_0x4545('0x40')]){_0x1abc06['attributes'][_0x4545('0x33')](function(_0x3f096a){_0x46123d[_0x4545('0x48')]('i.'+_0x3f096a);});}else{_0x46123d[_0x4545('0x48')](_0x4545('0x88'),_0x4545('0x61'));_0x46123d['field'](_0x4545('0x93'),_0x4545('0x94'));_0x46123d[_0x4545('0x48')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x46123d[_0x4545('0x48')](_0x4545('0x95'));_0x46123d[_0x4545('0x48')](_0x4545('0x96'),_0x4545('0x97'));_0x46123d[_0x4545('0x48')](_0x4545('0x98'),_0x4545('0x99'));_0x46123d[_0x4545('0x48')]('c.email','Contact.email');_0x46123d[_0x4545('0x48')](_0x4545('0x9a'),_0x4545('0x9b'));_0x46123d[_0x4545('0x48')](_0x4545('0x9c'),_0x4545('0x9d'));_0x46123d[_0x4545('0x48')](_0x4545('0x9e'),_0x4545('0x9f'));_0x46123d[_0x4545('0x48')]('o.fullname',_0x4545('0xa0'));_0x46123d['field'](_0x4545('0xa1'),'Owner.internal');_0x46123d[_0x4545('0x48')](_0x4545('0xa2'),_0x4545('0x30'));}if(_0x1abc06[_0x4545('0x20')])_0x46123d['limit'](_0x1abc06[_0x4545('0x20')]);if(_0x1abc06[_0x4545('0x43')])_0x46123d[_0x4545('0x43')](_0x1abc06[_0x4545('0x43')]);return db['sequelize']['query'](_0x46123d[_0x4545('0x90')](),_0x127202);})[_0x4545('0x28')](function(_0x4ec72d){_0x427554[_0x4545('0x46')](_0x4545('0xa3'),_[_0x4545('0x2e')](_0x4ec72d,'id'));return db[_0x4545('0x8f')][_0x4545('0x3c')](_0x427554[_0x4545('0x90')](),_0x127202)[_0x4545('0x28')](function(_0x2db58f){var _0x21f6f7=_[_0x4545('0xa4')](_0x2db58f,_0x4545('0xa5'));var _0x4a3bcc=[];_0x4ec72d[_0x4545('0x33')](function(_0x30bf62){_0x4a3bcc[_0x4545('0x34')](updateFaxInteraction(_0x30bf62,_0x3d308e,_0x21f6f7));});return BPromise[_0x4545('0xa6')](_0x4a3bcc);});});})[_0x4545('0x28')](function(_0x37e18b){_0x36f4b9[_0x4545('0xa7')]=_0x37e18b;return _0x36f4b9;})[_0x4545('0x28')](respondWithFilteredResult(_0x54ea62,_0x1abc06));})[_0x4545('0x35')](handleError(_0x54ea62,null));};exports[_0x4545('0xa8')]=function(_0x2573e7,_0x5675f5){var _0x21c6fd={'raw':![],'where':{'id':_0x2573e7[_0x4545('0xa9')]['id']}},_0x34165c={};_0x34165c[_0x4545('0x3b')]=_['keys'](db['FaxInteraction'][_0x4545('0xaa')]);_0x34165c['query']=_['keys'](_0x2573e7['query']);_0x34165c[_0x4545('0x47')]=_[_0x4545('0x3f')](_0x34165c[_0x4545('0x3b')],_0x34165c[_0x4545('0x3c')]);_0x21c6fd[_0x4545('0x3e')]=_[_0x4545('0x3f')](_0x34165c[_0x4545('0x3b')],qs[_0x4545('0x40')](_0x2573e7[_0x4545('0x3c')][_0x4545('0x40')]));_0x21c6fd[_0x4545('0x3e')]=_0x21c6fd[_0x4545('0x3e')][_0x4545('0x41')]?_0x21c6fd['attributes']:_0x34165c[_0x4545('0x3b')];if(_0x2573e7[_0x4545('0x3c')][_0x4545('0xab')]){_0x21c6fd[_0x4545('0xac')]=[{'all':!![]}];}_0x21c6fd=_[_0x4545('0x92')]({},_0x21c6fd,_0x2573e7[_0x4545('0xad')]);return db['FaxInteraction'][_0x4545('0x60')](_0x21c6fd)[_0x4545('0x28')](handleEntityNotFound(_0x5675f5,null))[_0x4545('0x28')](respondWithResult(_0x5675f5,null))[_0x4545('0x35')](handleError(_0x5675f5,null));};exports[_0x4545('0xae')]=function(_0x9583c7,_0xc2b350){return db[_0x4545('0x37')][_0x4545('0xae')](_0x9583c7[_0x4545('0x74')],{})[_0x4545('0x28')](respondWithResult(_0xc2b350,0xc9))[_0x4545('0x35')](handleError(_0xc2b350,null));};exports[_0x4545('0x26')]=function(_0x4dba03,_0x2e194e){if(_0x4dba03[_0x4545('0x74')]['id']){delete _0x4dba03[_0x4545('0x74')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x4dba03[_0x4545('0xa9')]['id']}})[_0x4545('0x28')](handleEntityNotFound(_0x2e194e,null))[_0x4545('0x28')](saveUpdates(_0x4dba03[_0x4545('0x74')],null))[_0x4545('0x28')](respondWithResult(_0x2e194e,null))[_0x4545('0x35')](handleError(_0x2e194e,null));};exports[_0x4545('0x27')]=function(_0x5ee905,_0x244533){return db[_0x4545('0x37')][_0x4545('0x60')]({'where':{'id':_0x5ee905[_0x4545('0xa9')]['id']}})[_0x4545('0x28')](handleEntityNotFound(_0x244533,null))[_0x4545('0x28')](removeEntity(_0x244533,null))[_0x4545('0x35')](handleError(_0x244533,null));};exports[_0x4545('0xaf')]=function(_0x2dec48,_0x49ebc0){return db[_0x4545('0x37')][_0x4545('0xaf')]()[_0x4545('0x28')](respondWithResult(_0x49ebc0,null))['catch'](handleError(_0x49ebc0,null));};exports[_0x4545('0xb0')]=function(_0x2a56bb,_0x5c05eb,_0x1e12e2){return db[_0x4545('0xb1')][_0x4545('0x60')]({'where':{'id':_0x2a56bb[_0x4545('0xa9')]['id']}})[_0x4545('0x28')](handleEntityNotFound(_0x5c05eb,null))[_0x4545('0x28')](function(_0x2ae1e2){if(_0x2ae1e2){return _0x2ae1e2[_0x4545('0xb0')](_0x2a56bb[_0x4545('0x74')][_0x4545('0xb2')],_[_0x4545('0xb3')](_0x2a56bb[_0x4545('0x74')],[_0x4545('0xb2'),'id'])||{});}})[_0x4545('0x28')](respondWithResult(_0x5c05eb,null))[_0x4545('0x35')](handleError(_0x5c05eb,null));};exports[_0x4545('0xb4')]=function(_0x24281c,_0x9bf7d5,_0x4c948c){var _0x5310bd={'raw':![],'where':{}};var _0x257d4a={};var _0x35c9f0={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x4545('0xb5')]({'where':{'id':_0x24281c[_0x4545('0xa9')]['id']}})[_0x4545('0x28')](handleEntityNotFound(_0x9bf7d5,null))[_0x4545('0x28')](function(_0x22aff2){if(_0x22aff2){_0x257d4a[_0x4545('0x3b')]=_[_0x4545('0x3d')](db[_0x4545('0xb1')]['rawAttributes']);_0x257d4a[_0x4545('0x3c')]=_[_0x4545('0x3d')](_0x24281c[_0x4545('0x3c')]);_0x257d4a['filters']=_[_0x4545('0x3f')](_0x257d4a[_0x4545('0x3b')],_0x257d4a[_0x4545('0x3c')]);_0x5310bd[_0x4545('0x3e')]=_[_0x4545('0x3f')](_0x257d4a[_0x4545('0x3b')],qs[_0x4545('0x40')](_0x24281c[_0x4545('0x3c')][_0x4545('0x40')]));_0x5310bd['attributes']=_0x5310bd[_0x4545('0x3e')][_0x4545('0x41')]?_0x5310bd[_0x4545('0x3e')]:_0x257d4a['model'];if(!_0x24281c[_0x4545('0x3c')]['hasOwnProperty'](_0x4545('0xb6'))){_0x5310bd['limit']=qs[_0x4545('0x20')](_0x24281c[_0x4545('0x3c')][_0x4545('0x20')]);_0x5310bd[_0x4545('0x43')]=qs[_0x4545('0x43')](_0x24281c[_0x4545('0x3c')][_0x4545('0x43')]);}_0x5310bd[_0x4545('0x44')]=qs[_0x4545('0x45')](_0x24281c[_0x4545('0x3c')]['sort']);_0x5310bd[_0x4545('0x46')]=qs['filters'](_['pick'](_0x24281c[_0x4545('0x3c')],_0x257d4a[_0x4545('0x47')]));_0x5310bd[_0x4545('0x46')][_0x4545('0xa5')]=_0x22aff2['id'];if(_0x24281c['query'][_0x4545('0x7f')]){_0x5310bd['where']=_[_0x4545('0x92')](_0x5310bd[_0x4545('0x46')],{'$or':_['map'](_0x5310bd['attributes'],function(_0x3c74a4){var _0x1cbdba={};_0x1cbdba[_0x3c74a4]={'$like':'%'+_0x24281c[_0x4545('0x3c')][_0x4545('0x7f')]+'%'};return _0x1cbdba;})});}if(_0x24281c[_0x4545('0x3c')]['$gte']){var _0x2b736b=_0x24281c[_0x4545('0x3c')]['$gte']['split'](',');var _0x4edd00={};_0x4edd00[_0x2b736b[0x0]]={'$gte':moment(_0x2b736b[0x1])[_0x4545('0xb7')](_0x4545('0xb8'))};_0x5310bd['where']=_['merge'](_0x5310bd[_0x4545('0x46')],_0x4edd00);}_0x5310bd=_[_0x4545('0x92')]({},_0x5310bd,_0x24281c[_0x4545('0xad')]);return db[_0x4545('0xb1')][_0x4545('0x1f')]({'where':_0x5310bd[_0x4545('0x46')]})[_0x4545('0x28')](function(_0x5b2dd6){_0x35c9f0['count']=_0x5b2dd6;if(_0x24281c[_0x4545('0x3c')][_0x4545('0xab')]){_0x5310bd[_0x4545('0xac')]=[{'all':!![]}];}return db[_0x4545('0xb1')][_0x4545('0xb9')](_0x5310bd);})[_0x4545('0x28')](function(_0xecf5da){_0x35c9f0[_0x4545('0xa7')]=_0xecf5da;return _0x35c9f0;});}})[_0x4545('0x28')](respondWithFilteredResult(_0x9bf7d5,_0x5310bd))[_0x4545('0x35')](handleError(_0x9bf7d5,null));};exports['addTags']=function(_0x280a65,_0xbbb9da,_0x569cb1){return db[_0x4545('0x37')][_0x4545('0x60')]({'where':{'id':_0x280a65[_0x4545('0xa9')]['id']}})['then'](handleEntityNotFound(_0xbbb9da,null))[_0x4545('0x28')](function(_0x39065d){if(_0x39065d){return _0x39065d[_0x4545('0xba')](_0x280a65[_0x4545('0x74')][_0x4545('0xb2')],_[_0x4545('0xb3')](_0x280a65['body'],[_0x4545('0xb2'),'id'])||{})['spread'](function(){return db[_0x4545('0x6e')][_0x4545('0xb9')]({'attributes':['id',_0x4545('0x2c'),_0x4545('0x49')],'where':{'id':_0x280a65[_0x4545('0x74')][_0x4545('0xb2')]}});})[_0x4545('0x28')](function(_0x2b4f20){socket['emit'](_0x4545('0xbb'),{'id':Number(_0x280a65['params']['id']),'tags':_0x2b4f20||[]});return{'id':Number(_0x280a65[_0x4545('0xa9')]['id']),'tags':_0x2b4f20||[]};});}})[_0x4545('0x28')](respondWithResult(_0xbbb9da,null))['catch'](handleError(_0xbbb9da,null));};exports[_0x4545('0xbc')]=function(_0x4aa081,_0x322e83,_0x2cb16f){return db['FaxInteraction']['find']({'where':{'id':_0x4aa081[_0x4545('0xa9')]['id']}})['then'](handleEntityNotFound(_0x322e83,null))[_0x4545('0x28')](function(_0x42e024){if(_0x42e024){return _0x42e024['removeTags'](_0x4aa081['query']['ids']);}})[_0x4545('0x28')](respondWithStatusCode(_0x322e83,null))[_0x4545('0x35')](handleError(_0x322e83,null));};exports[_0x4545('0xbd')]=function(_0x590657,_0x3d6df9){var _0x5cb382=moment()[_0x4545('0xbe')]()[_0x4545('0x90')]();var _0x44db91=path[_0x4545('0xbf')](config[_0x4545('0xc0')],_0x4545('0xc1'),_0x4545('0xc2'),'tmp');var _0x37f6e6=path[_0x4545('0xbf')](config['root'],_0x4545('0xc1'),'files',_0x4545('0xc3'));var _0x43a147=path['join'](_0x44db91,_0x5cb382);var _0x2e1d6b=util[_0x4545('0xb7')](_0x4545('0xc4'),_0x590657[_0x4545('0xa9')]['id'],_0x5cb382);var _0x3efc5d=path['join'](_0x44db91,_0x2e1d6b);var _0x280cd5=[];_0x280cd5[_0x4545('0x34')]({'model':db['Attachment'],'as':_0x4545('0xc5'),'raw':!![]});var _0x38fc3f=[{'model':db['FaxMessage'],'as':_0x4545('0xc6'),'attributes':['id',_0x4545('0x74'),_0x4545('0x7a')],'include':_0x280cd5}];return db['FaxInteraction'][_0x4545('0x60')]({'where':{'id':_0x590657['params']['id']},'include':_0x38fc3f})['then'](handleEntityNotFound(_0x3d6df9,null))[_0x4545('0x28')](function(_0x2e775c){if(_0x2e775c&&_0x2e775c[_0x4545('0xc6')]){var _0x39a68e=_0x2e775c['get']({'plain':!![]});fs[_0x4545('0xc7')](_0x43a147);for(var _0x2c6859=0x0;_0x2c6859<_0x39a68e[_0x4545('0xc6')][_0x4545('0x41')];_0x2c6859++){var _0x3731be=_0x39a68e[_0x4545('0xc6')][_0x2c6859][_0x4545('0xc5')];if(_0x3731be){var _0x5b23f4=path[_0x4545('0xbf')](_0x37f6e6,_0x3731be[_0x4545('0xc8')]);if(fs[_0x4545('0xc9')](_0x5b23f4)){fs[_0x4545('0xca')](_0x5b23f4)[_0x4545('0xcb')](fs['createWriteStream'](path[_0x4545('0xbf')](_0x43a147,_0x3731be['basename'])));}}}return BPromise[_0x4545('0xcc')]()[_0x4545('0x28')](function(){return new BPromise(function(_0x59edc8,_0x1e0a47){zipdir(_0x43a147,{'saveTo':_0x3efc5d},function(_0x3bcbd5,_0x1642f2){if(_0x3bcbd5)return _0x1e0a47(_0x3bcbd5);return _0x59edc8(_0x1642f2);});})[_0x4545('0x28')](function(){return new BPromise(function(_0x657fbf,_0x2e5a51){rimraf(_0x43a147,function(_0x305322){if(_0x305322)_0x2e5a51(_0x305322);return _0x657fbf();});});})[_0x4545('0x28')](function(){return _0x3d6df9[_0x4545('0xbd')](_0x3efc5d,_0x2e1d6b,function(_0x9d5b7f){if(_0x9d5b7f){console['log']('err',_0x9d5b7f);}else{fs[_0x4545('0xcd')](_0x3efc5d);}});});});}else{return _0x3d6df9['sendStatus'](0xc8);}})['catch'](handleError(_0x3d6df9,null));}; \ No newline at end of file +var _0x5a13=['null','\x20IS\x20NULL','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','FaxInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','merge','options','create','destroy','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','rawAttributes','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','pipe','createWriteStream','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','field','color','tools_tags','select','u.id','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','o.id\x20=\x20i.UserId','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','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','body','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a13,0x145));var _0x35a1=function(_0x8545fd,_0x3e7705){_0x8545fd=_0x8545fd-0x0;var _0x341b08=_0x5a13[_0x8545fd];return _0x341b08;};'use strict';var pdf=require(_0x35a1('0x0'));var emlformat=require(_0x35a1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35a1('0x2'));var jsonpatch=require(_0x35a1('0x3'));var rp=require(_0x35a1('0x4'));var moment=require(_0x35a1('0x5'));var BPromise=require(_0x35a1('0x6'));var Mustache=require(_0x35a1('0x7'));var util=require(_0x35a1('0x8'));var path=require(_0x35a1('0x9'));var sox=require(_0x35a1('0xa'));var csv=require(_0x35a1('0xb'));var ejs=require(_0x35a1('0xc'));var fs=require('fs');var _=require(_0x35a1('0xd'));var squel=require(_0x35a1('0xe'));var crypto=require(_0x35a1('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x35a1('0x10'));var Papa=require(_0x35a1('0x11'));var Redis=require('ioredis');var authService=require(_0x35a1('0x12'));var qs=require(_0x35a1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x35a1('0x14'))(_0x35a1('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x35a1('0x16'))['db'];config['redis']=_[_0x35a1('0x17')](config['redis'],{'host':_0x35a1('0x18'),'port':0x18eb});var socket=require(_0x35a1('0x19'))(new Redis(config[_0x35a1('0x1a')]));require(_0x35a1('0x1b'))[_0x35a1('0x1c')](socket);function respondWithStatusCode(_0xa149d0,_0x20d868){_0x20d868=_0x20d868||0xcc;return function(_0x42de36){if(_0x42de36){return _0xa149d0[_0x35a1('0x1d')](_0x20d868);}return _0xa149d0[_0x35a1('0x1e')](_0x20d868)[_0x35a1('0x1f')]();};}function respondWithResult(_0x41939f,_0x2f93be){_0x2f93be=_0x2f93be||0xc8;return function(_0x44c755){if(_0x44c755){return _0x41939f[_0x35a1('0x1e')](_0x2f93be)[_0x35a1('0x20')](_0x44c755);}};}function respondWithFilteredResult(_0x9bdc,_0x2b22b4){return function(_0x3e7b28){if(_0x3e7b28){var _0x1de373=_0x3e7b28[_0x35a1('0x21')],_0x5e4317=_0x2b22b4[_0x35a1('0x22')],_0x3b17dc=_0x2b22b4[_0x35a1('0x22')]+_0x2b22b4[_0x35a1('0x23')],_0xbeb751;if(_0x3b17dc>=_0x1de373){_0x3b17dc=_0x1de373;_0xbeb751=0xc8;}else{_0xbeb751=0xce;}_0x9bdc[_0x35a1('0x1e')](_0xbeb751);return _0x9bdc[_0x35a1('0x24')](_0x35a1('0x25'),_0x5e4317+'-'+_0x3b17dc+'/'+_0x1de373)['json'](_0x3e7b28);}return null;};}function patchUpdates(_0x473186){return function(_0xf089dd){try{jsonpatch['apply'](_0xf089dd,_0x473186,!![]);}catch(_0xfce076){return BPromise[_0x35a1('0x26')](_0xfce076);}return _0xf089dd['save']();};}function saveUpdates(_0xc13bad,_0x5a1742){return function(_0x28af51){if(_0x28af51){return _0x28af51[_0x35a1('0x27')](_0xc13bad)[_0x35a1('0x28')](function(_0x5e42cf){return _0x5e42cf;});}return null;};}function removeEntity(_0x1ced16,_0x2b87a1){return function(_0x48f1bd){if(_0x48f1bd){return _0x48f1bd['destroy']()['then'](function(){_0x1ced16[_0x35a1('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5408a7,_0x52d22b){return function(_0x2ee03c){if(!_0x2ee03c){_0x5408a7[_0x35a1('0x1d')](0x194);}return _0x2ee03c;};}function handleError(_0x39248b,_0x3f1563){_0x3f1563=_0x3f1563||0x1f4;return function(_0x536394){logger[_0x35a1('0x29')](_0x536394[_0x35a1('0x2a')]);if(_0x536394[_0x35a1('0x2b')]){delete _0x536394[_0x35a1('0x2b')];}_0x39248b[_0x35a1('0x1e')](_0x3f1563)[_0x35a1('0x2c')](_0x536394);};}function getInteractionUsers(_0x3d3453,_0x24bb2d){return new BPromise(function(_0x243841,_0x381bcc){try{if(_0x24bb2d[_0x3d3453['id']]){_0x3d3453[_0x35a1('0x2d')]=_[_0x35a1('0x2e')](_0x24bb2d[_0x3d3453['id']],function(_0xacadf2){return{'id':_0xacadf2['id'],'fullname':_0xacadf2[_0x35a1('0x2f')]};});}}catch(_0x2ae0ca){_0x381bcc(_0x2ae0ca);}_0x243841(_0x3d3453);});}function getInteractionTags(_0x4b74b3,_0x9720a4){return new BPromise(function(_0x379819,_0x10b65e){try{if(_0x4b74b3[_0x35a1('0x30')]){_0x4b74b3[_0x35a1('0x31')]=[];_0x4b74b3[_0x35a1('0x30')][_0x35a1('0x32')](',')[_0x35a1('0x33')](function(_0x2609ab){_0x4b74b3[_0x35a1('0x31')][_0x35a1('0x34')](_0x9720a4[_0x2609ab]);});}delete _0x4b74b3['TagIds'];}catch(_0x581740){_0x10b65e(_0x581740);}_0x379819(_0x4b74b3);});}function updateFaxInteraction(_0x351894,_0x5e1dad,_0x192dce){return new BPromise(function(_0x5756bb,_0x8c37b0){return getInteractionUsers(_0x351894,_0x192dce)[_0x35a1('0x28')](function(_0x42c365){return getInteractionTags(_0x42c365,_0x5e1dad);})[_0x35a1('0x28')](function(_0x7b0d18){_0x5756bb(_0x7b0d18);})[_0x35a1('0x35')](function(_0x316b10){_0x8c37b0(_0x316b10);});});}exports[_0x35a1('0x36')]=function(_0x2e9d35,_0x44ed30){var _0x25d757={},_0x4a4903={},_0x227856={'count':0x0,'rows':[]};var _0x2f5248=_[_0x35a1('0x2e')](db['FaxInteraction']['rawAttributes'],function(_0x5d947d){return{'name':_0x5d947d['fieldName'],'type':_0x5d947d['type']['key']};});_0x4a4903[_0x35a1('0x37')]=_[_0x35a1('0x2e')](_0x2f5248,_0x35a1('0x2b'));_0x4a4903[_0x35a1('0x38')]=_[_0x35a1('0x39')](_0x2e9d35[_0x35a1('0x38')]);_0x4a4903[_0x35a1('0x3a')]=_[_0x35a1('0x3b')](_0x4a4903['model'],_0x4a4903[_0x35a1('0x38')]);_0x25d757['attributes']=_[_0x35a1('0x3b')](_0x4a4903[_0x35a1('0x37')],qs[_0x35a1('0x3c')](_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x3c')]));_0x25d757['attributes']=_0x25d757[_0x35a1('0x3d')][_0x35a1('0x3e')]?_0x25d757[_0x35a1('0x3d')]:_0x4a4903['model'];if(!_0x2e9d35['query'][_0x35a1('0x3f')](_0x35a1('0x40'))){_0x25d757[_0x35a1('0x23')]=qs[_0x35a1('0x23')](_0x2e9d35['query'][_0x35a1('0x23')]);_0x25d757['offset']=qs[_0x35a1('0x22')](_0x2e9d35['query'][_0x35a1('0x22')]);}_0x25d757[_0x35a1('0x41')]=qs['sort'](_0x2e9d35['query'][_0x35a1('0x42')]);_0x25d757['where']=qs[_0x35a1('0x3a')](_[_0x35a1('0x43')](_0x2e9d35['query'],_0x4a4903[_0x35a1('0x3a')]),_0x2f5248);var _0x502695=[];var _0xb1c14c=squel['select']()[_0x35a1('0x44')]('id')['field'](_0x35a1('0x2b'))['field'](_0x35a1('0x45'))['from'](_0x35a1('0x46'));var _0x260f29=squel[_0x35a1('0x47')]()[_0x35a1('0x44')](_0x35a1('0x48'))[_0x35a1('0x44')](_0x35a1('0x49'))['field'](_0x35a1('0x4a'))[_0x35a1('0x4b')](_0x35a1('0x4c'),'ui')[_0x35a1('0x4d')](_0x35a1('0x4e'),'u',_0x35a1('0x4f'));var _0x5e0898=squel[_0x35a1('0x47')]()[_0x35a1('0x4b')](_0x35a1('0x50'),'i')[_0x35a1('0x4d')](_0x35a1('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x35a1('0x4d')](_0x35a1('0x4e'),'o',_0x35a1('0x52'))[_0x35a1('0x4d')]('fax_accounts','a',_0x35a1('0x53'))[_0x35a1('0x4d')](_0x35a1('0x54'),'me',_0x35a1('0x55'))[_0x35a1('0x4d')](_0x35a1('0x56'),'it',_0x35a1('0x57'))['left_join']('tools_tags','t',_0x35a1('0x58'));var _0x34805f=squel[_0x35a1('0x59')]();var _0x2e9351=[];var _0x5a2f0b=squel['expr']();var _0x18e1dd;if(_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x5a')]){_0x18e1dd=as[_0x35a1('0x5b')](_0x2e9d35['query']['search']);var _0x5a2ee8=_0x18e1dd[_0x35a1('0x5c')];for(var _0x5d7f55=0x0;_0x5d7f55<_0x18e1dd[_0x35a1('0x5d')][_0x35a1('0x3e')];_0x5d7f55++){var _0xce6489=_0x18e1dd[_0x35a1('0x5d')][_0x5d7f55];var _0x1415bc='i';var _0x18329f=_[_0x35a1('0x5e')](_0x2f5248,[_0x35a1('0x2b'),_0xce6489['field']]);if(!_0x18329f){switch(_0xce6489[_0x35a1('0x44')]){case _0x35a1('0x5f'):if(_0xce6489[_0x35a1('0x60')]==0x1){_0x5e0898['having']('`'+_0xce6489['field']+'`\x20=\x200');}else{_0x5e0898['having']('`'+_0xce6489[_0x35a1('0x44')]+_0x35a1('0x61'));}break;case _0x35a1('0x62'):if(_0xce6489[_0x35a1('0x63')]===_0x35a1('0x64')){if(_0xce6489[_0x35a1('0x60')][_0x35a1('0x32')]('\x20')[_0x35a1('0x3e')]>0x1){_0x34805f[_0x5a2ee8](_0x35a1('0x65'),qs[_0x35a1('0x66')](_0xce6489['value']),null);}else{var _0x3ca42a='%'+_0xce6489[_0x35a1('0x60')]+'%';_0x34805f[_0x5a2ee8](_0x35a1('0x67'),_0x3ca42a,_0x3ca42a,_0x3ca42a);}}else{_0x18329f=_['find'](_0x2f5248,['name',_0x35a1('0x68')]);_0xce6489['field']=_0x35a1('0x68');_0x3b2412=as[_0x35a1('0x69')](_0x1415bc,_0x18329f[_0x35a1('0x6a')],_0xce6489);_0x34805f[_0x5a2ee8](_0x3b2412['text'],_0x3b2412['value'][_0x35a1('0x6b')],_0x3b2412['value']['end']);}break;case _0x35a1('0x6c'):var _0x4b3e29=_0xce6489[_0x35a1('0x60')][_0x35a1('0x32')](',')[_0x35a1('0x2e')](function(_0x413861){return Number(_0x413861);});_0x4b3e29[_0x35a1('0x33')](function(_0x1c0b1e){_0x5a2f0b['or'](_0x35a1('0x6d'),'%,'+_0x1c0b1e+',%');});_0x2e9351=_[_0x35a1('0x6e')](_0x2e9351,_0x4b3e29);break;case _0x35a1('0x6f'):if(_0xce6489[_0x35a1('0x63')]===_0x35a1('0x64')){_0x34805f[_0x5a2ee8]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xce6489[_0x35a1('0x60')]+'%',null);}else{_0x18329f=_[_0x35a1('0x5e')](_0x2f5248,[_0x35a1('0x2b'),'UserId']);_0xce6489[_0x35a1('0x44')]=_0x35a1('0x70');_0x3b2412=as[_0x35a1('0x69')](_0x1415bc,_0x18329f[_0x35a1('0x6a')],_0xce6489);_0x34805f[_0x5a2ee8](_0x3b2412[_0x35a1('0x71')],_0x3b2412[_0x35a1('0x60')][_0x35a1('0x6b')],_0x3b2412[_0x35a1('0x60')][_0x35a1('0x1f')]);}break;case _0x35a1('0x72'):_0x3b2412=as[_0x35a1('0x69')]('me',null,_0xce6489);_0x34805f[_0x5a2ee8](_0x3b2412[_0x35a1('0x71')],_0x3b2412['value'][_0x35a1('0x6b')],_0x3b2412[_0x35a1('0x60')][_0x35a1('0x1f')]);break;}}else{var _0x3b2412=as['buildExpression'](_0x1415bc,_0x18329f['type'],_0xce6489);_0x34805f[_0x5a2ee8](_0x3b2412[_0x35a1('0x71')],_0x3b2412[_0x35a1('0x60')][_0x35a1('0x6b')],_0x3b2412[_0x35a1('0x60')][_0x35a1('0x1f')]);}}}else{var _0x2e8c75=_(_0x2e9d35[_0x35a1('0x38')])['keys']()[_0x35a1('0x2e')](function(_0x506794){return _['some'](_0x2f5248,[_0x35a1('0x2b'),_0x506794])?_0x506794:undefined;})[_0x35a1('0x73')]()['value']();if(!_['isEmpty'](_0x2e8c75)){_0x2e8c75[_0x35a1('0x33')](function(_0x203b96){if(_0x203b96===_0x35a1('0x74')){_0x5e0898[_0x35a1('0x75')](_0x35a1('0x76'),[][_0x35a1('0x77')](_0x2e9d35[_0x35a1('0x38')][_0x203b96]));}else if(_0x203b96===_0x35a1('0x78')){var _0x578a95=JSON[_0x35a1('0x79')](_0x2e9d35[_0x35a1('0x38')][_0x203b96])[_0x35a1('0x7a')];var _0x114667=JSON[_0x35a1('0x79')](_0x2e9d35[_0x35a1('0x38')][_0x203b96])[_0x35a1('0x7b')];_0x5e0898[_0x35a1('0x75')](_0x35a1('0x7c'),_0x578a95,_0x114667);}else{if(_0x2e9d35[_0x35a1('0x38')][_0x203b96]===_0x35a1('0x7d')){_0x5e0898['where']('i.'+_0x203b96+_0x35a1('0x7e'));}else{_0x5e0898[_0x35a1('0x75')]('i.'+_0x203b96+'\x20=\x20?',_0x2e9d35[_0x35a1('0x38')][_0x203b96]);}}});}if(_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x7f')]){if(_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x7f')]==0x1){_0x5e0898[_0x35a1('0x80')](_0x35a1('0x81'));}else{_0x5e0898[_0x35a1('0x80')](_0x35a1('0x82'));}}if(_0x2e9d35['query']['tag']){_0x2e9351=_[_0x35a1('0x83')](_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x84')])?_0x2e9d35[_0x35a1('0x38')]['tag']:new Array(_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x84')]);_0x2e9351[_0x35a1('0x33')](function(_0x3ed836){_0x5a2f0b['or'](_0x35a1('0x6d'),'%,'+_0x3ed836+',%');});}if(_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x85')]){var _0xa8bb13=_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x85')][_0x35a1('0x86')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x35a1('0x87'));if(qs[_0x35a1('0x88')](_0xa8bb13)){_0x34805f['or']('i.id\x20LIKE\x20?',_0xa8bb13+'%')['or'](_0x35a1('0x89'),_0xa8bb13+'%');}_0x34805f['or'](_0x35a1('0x8a'),_0xa8bb13+'%');}}_0x5e0898[_0x35a1('0x75')](_0x34805f);_0x5e0898[_0x35a1('0x8b')]('i.id');var _0xe4fe48={'type':db[_0x35a1('0x8c')][_0x35a1('0x8d')][_0x35a1('0x8e')],'raw':!![]};var _0x301961=_0x5e0898[_0x35a1('0x8f')]();_0x301961[_0x35a1('0x44')](_0x35a1('0x90'));_0x301961[_0x35a1('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x25d757['order']){_0x25d757[_0x35a1('0x41')][_0x35a1('0x33')](function(_0x76c11b){_0x5e0898[_0x35a1('0x41')]('i.'+_0x76c11b[0x0],_0x76c11b[0x1]===_0x35a1('0x91')?![]:!![]);});}if(!_[_0x35a1('0x92')](_0x2e9351)){_0x5e0898['having'](_0x5a2f0b);_0x301961['where'](_0x35a1('0x93'),_0x2e9351);}BPromise[_0x35a1('0x94')]()[_0x35a1('0x28')](function(){if(!_0x18e1dd){if(_0x2e9d35['query'][_0x35a1('0x74')]||_0x2e9d35[_0x35a1('0x38')][_0x35a1('0x95')])return;_0x301961[_0x35a1('0x75')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x5e0898['where'](_0x35a1('0x96'));return;}return _0x2e9d35[_0x35a1('0x97')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x35a1('0x28')](function(_0x441130){if(_[_0x35a1('0x92')](_0x441130)){_0x301961[_0x35a1('0x75')]('i.FaxAccountId\x20IS\x20NULL');_0x5e0898[_0x35a1('0x75')](_0x35a1('0x98'));}else{_0x301961['where'](_0x35a1('0x76'),_[_0x35a1('0x2e')](_0x441130,'id'));_0x5e0898[_0x35a1('0x75')]('i.FaxAccountId\x20IN\x20?',_[_0x35a1('0x2e')](_0x441130,'id'));}});})[_0x35a1('0x28')](function(){db[_0x35a1('0x99')][_0x35a1('0x38')](_0x301961[_0x35a1('0x9a')](),_0xe4fe48)[_0x35a1('0x28')](function(_0x37e2ce){_0x227856[_0x35a1('0x21')]=_0x37e2ce[_0x35a1('0x3e')];if(_0x227856[_0x35a1('0x21')]===0x0)return[];return db[_0x35a1('0x99')][_0x35a1('0x38')](_0xb1c14c[_0x35a1('0x9a')](),_0xe4fe48)[_0x35a1('0x28')](function(_0xd1c6d7){_0x502695=_[_0x35a1('0x9b')](_0xd1c6d7,'id');_0xe4fe48=_['merge'](_0xe4fe48,{'model':db[_0x35a1('0x9c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2e9d35['query'][_0x35a1('0x3c')]){_0x25d757[_0x35a1('0x3d')]['forEach'](function(_0x1ec6e5){_0x5e0898['field']('i.'+_0x1ec6e5);});}else{_0x5e0898['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x35a1('0x5f'));_0x5e0898[_0x35a1('0x44')]('a.key',_0x35a1('0x9d'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0x9e'),_0x35a1('0x9f'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0xa0'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0xa1'),_0x35a1('0xa2'));_0x5e0898[_0x35a1('0x44')]('c.lastName',_0x35a1('0xa3'));_0x5e0898['field'](_0x35a1('0xa4'),_0x35a1('0xa5'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0xa6'),_0x35a1('0xa7'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0xa8'),_0x35a1('0xa9'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0xaa'),_0x35a1('0xab'));_0x5e0898[_0x35a1('0x44')](_0x35a1('0xac'),'Owner.fullname');_0x5e0898['field'](_0x35a1('0xad'),'Owner.internal');_0x5e0898[_0x35a1('0x44')](_0x35a1('0xae'),_0x35a1('0x30'));}if(_0x25d757[_0x35a1('0x23')])_0x5e0898['limit'](_0x25d757['limit']);if(_0x25d757['offset'])_0x5e0898[_0x35a1('0x22')](_0x25d757[_0x35a1('0x22')]);return db[_0x35a1('0x99')][_0x35a1('0x38')](_0x5e0898[_0x35a1('0x9a')](),_0xe4fe48);})[_0x35a1('0x28')](function(_0x5af910){_0x260f29[_0x35a1('0x75')](_0x35a1('0xaf'),_[_0x35a1('0x2e')](_0x5af910,'id'));return db[_0x35a1('0x99')][_0x35a1('0x38')](_0x260f29['toString'](),_0xe4fe48)[_0x35a1('0x28')](function(_0x56087c){var _0x2a7646=_[_0x35a1('0xb0')](_0x56087c,_0x35a1('0xb1'));var _0x563505=[];_0x5af910[_0x35a1('0x33')](function(_0x4ca0f5){_0x563505[_0x35a1('0x34')](updateFaxInteraction(_0x4ca0f5,_0x502695,_0x2a7646));});return BPromise[_0x35a1('0xb2')](_0x563505);});});})[_0x35a1('0x28')](function(_0x21449e){_0x227856[_0x35a1('0xb3')]=_0x21449e;return _0x227856;})[_0x35a1('0x28')](respondWithFilteredResult(_0x44ed30,_0x25d757));})[_0x35a1('0x35')](handleError(_0x44ed30,null));};exports[_0x35a1('0xb4')]=function(_0x5c4d94,_0x5725d9){var _0x54ce40={'raw':![],'where':{'id':_0x5c4d94[_0x35a1('0xb5')]['id']}},_0xa5544e={};_0xa5544e[_0x35a1('0x37')]=_[_0x35a1('0x39')](db[_0x35a1('0x9c')]['rawAttributes']);_0xa5544e['query']=_[_0x35a1('0x39')](_0x5c4d94[_0x35a1('0x38')]);_0xa5544e[_0x35a1('0x3a')]=_[_0x35a1('0x3b')](_0xa5544e['model'],_0xa5544e['query']);_0x54ce40[_0x35a1('0x3d')]=_[_0x35a1('0x3b')](_0xa5544e[_0x35a1('0x37')],qs[_0x35a1('0x3c')](_0x5c4d94[_0x35a1('0x38')][_0x35a1('0x3c')]));_0x54ce40[_0x35a1('0x3d')]=_0x54ce40[_0x35a1('0x3d')][_0x35a1('0x3e')]?_0x54ce40[_0x35a1('0x3d')]:_0xa5544e[_0x35a1('0x37')];if(_0x5c4d94[_0x35a1('0x38')][_0x35a1('0xb6')]){_0x54ce40[_0x35a1('0xb7')]=[{'all':!![]}];}_0x54ce40=_[_0x35a1('0xb8')]({},_0x54ce40,_0x5c4d94[_0x35a1('0xb9')]);return db['FaxInteraction'][_0x35a1('0x5e')](_0x54ce40)[_0x35a1('0x28')](handleEntityNotFound(_0x5725d9,null))[_0x35a1('0x28')](respondWithResult(_0x5725d9,null))['catch'](handleError(_0x5725d9,null));};exports[_0x35a1('0xba')]=function(_0x27f1f7,_0x348c87){return db[_0x35a1('0x9c')]['create'](_0x27f1f7[_0x35a1('0x72')],{})[_0x35a1('0x28')](respondWithResult(_0x348c87,0xc9))[_0x35a1('0x35')](handleError(_0x348c87,null));};exports[_0x35a1('0x27')]=function(_0x525467,_0x29fad2){if(_0x525467[_0x35a1('0x72')]['id']){delete _0x525467['body']['id'];}return db[_0x35a1('0x9c')]['find']({'where':{'id':_0x525467[_0x35a1('0xb5')]['id']}})[_0x35a1('0x28')](handleEntityNotFound(_0x29fad2,null))[_0x35a1('0x28')](saveUpdates(_0x525467[_0x35a1('0x72')],null))[_0x35a1('0x28')](respondWithResult(_0x29fad2,null))[_0x35a1('0x35')](handleError(_0x29fad2,null));};exports[_0x35a1('0xbb')]=function(_0x83d3f7,_0x3766db){return db[_0x35a1('0x9c')][_0x35a1('0x5e')]({'where':{'id':_0x83d3f7[_0x35a1('0xb5')]['id']}})[_0x35a1('0x28')](handleEntityNotFound(_0x3766db,null))[_0x35a1('0x28')](removeEntity(_0x3766db,null))[_0x35a1('0x35')](handleError(_0x3766db,null));};exports[_0x35a1('0xbc')]=function(_0xa94fd,_0x562db2){return db[_0x35a1('0x9c')]['describe']()[_0x35a1('0x28')](respondWithResult(_0x562db2,null))['catch'](handleError(_0x562db2,null));};exports[_0x35a1('0xbd')]=function(_0x42e1c8,_0x30b832,_0x156960){return db[_0x35a1('0xbe')][_0x35a1('0x5e')]({'where':{'id':_0x42e1c8[_0x35a1('0xb5')]['id']}})[_0x35a1('0x28')](handleEntityNotFound(_0x30b832,null))[_0x35a1('0x28')](function(_0x366512){if(_0x366512){return _0x366512[_0x35a1('0xbd')](_0x42e1c8['body'][_0x35a1('0xbf')],_[_0x35a1('0xc0')](_0x42e1c8['body'],['ids','id'])||{});}})[_0x35a1('0x28')](respondWithResult(_0x30b832,null))[_0x35a1('0x35')](handleError(_0x30b832,null));};exports[_0x35a1('0xc1')]=function(_0x48e853,_0x146c7a,_0x5654a3){var _0x27c943={'raw':![],'where':{}};var _0x30aea4={};var _0x9fce29={'count':0x0,'rows':[]};return db[_0x35a1('0x9c')][_0x35a1('0xc2')]({'where':{'id':_0x48e853[_0x35a1('0xb5')]['id']}})[_0x35a1('0x28')](handleEntityNotFound(_0x146c7a,null))[_0x35a1('0x28')](function(_0x16baa2){if(_0x16baa2){_0x30aea4['model']=_[_0x35a1('0x39')](db[_0x35a1('0xbe')][_0x35a1('0xc3')]);_0x30aea4['query']=_['keys'](_0x48e853[_0x35a1('0x38')]);_0x30aea4[_0x35a1('0x3a')]=_[_0x35a1('0x3b')](_0x30aea4['model'],_0x30aea4[_0x35a1('0x38')]);_0x27c943['attributes']=_[_0x35a1('0x3b')](_0x30aea4[_0x35a1('0x37')],qs[_0x35a1('0x3c')](_0x48e853[_0x35a1('0x38')]['fields']));_0x27c943[_0x35a1('0x3d')]=_0x27c943['attributes'][_0x35a1('0x3e')]?_0x27c943['attributes']:_0x30aea4[_0x35a1('0x37')];if(!_0x48e853[_0x35a1('0x38')][_0x35a1('0x3f')](_0x35a1('0x40'))){_0x27c943[_0x35a1('0x23')]=qs['limit'](_0x48e853[_0x35a1('0x38')][_0x35a1('0x23')]);_0x27c943['offset']=qs['offset'](_0x48e853[_0x35a1('0x38')][_0x35a1('0x22')]);}_0x27c943[_0x35a1('0x41')]=qs[_0x35a1('0x42')](_0x48e853[_0x35a1('0x38')][_0x35a1('0x42')]);_0x27c943[_0x35a1('0x75')]=qs[_0x35a1('0x3a')](_[_0x35a1('0x43')](_0x48e853[_0x35a1('0x38')],_0x30aea4['filters']));_0x27c943[_0x35a1('0x75')][_0x35a1('0xb1')]=_0x16baa2['id'];if(_0x48e853['query']['filter']){_0x27c943[_0x35a1('0x75')]=_[_0x35a1('0xb8')](_0x27c943['where'],{'$or':_[_0x35a1('0x2e')](_0x27c943[_0x35a1('0x3d')],function(_0x306669){var _0x1ac121={};_0x1ac121[_0x306669]={'$like':'%'+_0x48e853[_0x35a1('0x38')][_0x35a1('0x85')]+'%'};return _0x1ac121;})});}if(_0x48e853['query'][_0x35a1('0x7a')]){var _0x20492b=_0x48e853['query']['$gte'][_0x35a1('0x32')](',');var _0x5605d6={};_0x5605d6[_0x20492b[0x0]]={'$gte':moment(_0x20492b[0x1])[_0x35a1('0xc4')](_0x35a1('0xc5'))};_0x27c943[_0x35a1('0x75')]=_[_0x35a1('0xb8')](_0x27c943[_0x35a1('0x75')],_0x5605d6);}_0x27c943=_[_0x35a1('0xb8')]({},_0x27c943,_0x48e853[_0x35a1('0xb9')]);return db[_0x35a1('0xbe')][_0x35a1('0x21')]({'where':_0x27c943[_0x35a1('0x75')]})[_0x35a1('0x28')](function(_0x1eef50){_0x9fce29['count']=_0x1eef50;if(_0x48e853[_0x35a1('0x38')]['includeAll']){_0x27c943[_0x35a1('0xb7')]=[{'all':!![]}];}return db[_0x35a1('0xbe')][_0x35a1('0xc6')](_0x27c943);})['then'](function(_0x34a619){_0x9fce29[_0x35a1('0xb3')]=_0x34a619;return _0x9fce29;});}})[_0x35a1('0x28')](respondWithFilteredResult(_0x146c7a,_0x27c943))[_0x35a1('0x35')](handleError(_0x146c7a,null));};exports[_0x35a1('0xc7')]=function(_0x424352,_0x3c32b1,_0x446795){return db[_0x35a1('0x9c')]['find']({'where':{'id':_0x424352[_0x35a1('0xb5')]['id']}})[_0x35a1('0x28')](handleEntityNotFound(_0x3c32b1,null))[_0x35a1('0x28')](function(_0x3d7823){if(_0x3d7823){return _0x3d7823[_0x35a1('0xc8')](_0x424352[_0x35a1('0x72')][_0x35a1('0xbf')],_[_0x35a1('0xc0')](_0x424352[_0x35a1('0x72')],[_0x35a1('0xbf'),'id'])||{})[_0x35a1('0xc9')](function(){return db['Tag']['findAll']({'attributes':['id','name','color'],'where':{'id':_0x424352[_0x35a1('0x72')][_0x35a1('0xbf')]}});})[_0x35a1('0x28')](function(_0x5bb908){socket[_0x35a1('0xca')](_0x35a1('0xcb'),{'id':Number(_0x424352['params']['id']),'tags':_0x5bb908||[]});return{'id':Number(_0x424352[_0x35a1('0xb5')]['id']),'tags':_0x5bb908||[]};});}})[_0x35a1('0x28')](respondWithResult(_0x3c32b1,null))[_0x35a1('0x35')](handleError(_0x3c32b1,null));};exports[_0x35a1('0xcc')]=function(_0x3426c7,_0x41243c,_0xec6cb6){return db[_0x35a1('0x9c')][_0x35a1('0x5e')]({'where':{'id':_0x3426c7[_0x35a1('0xb5')]['id']}})['then'](handleEntityNotFound(_0x41243c,null))['then'](function(_0x19cf5e){if(_0x19cf5e){return _0x19cf5e[_0x35a1('0xcc')](_0x3426c7[_0x35a1('0x38')][_0x35a1('0xbf')]);}})[_0x35a1('0x28')](respondWithStatusCode(_0x41243c,null))['catch'](handleError(_0x41243c,null));};exports[_0x35a1('0xcd')]=function(_0x43eeb0,_0x2d0d7e){var _0xb3da4d=moment()[_0x35a1('0xce')]()[_0x35a1('0x9a')]();var _0x526683=path[_0x35a1('0xcf')](config[_0x35a1('0xd0')],'server',_0x35a1('0xd1'),_0x35a1('0xd2'));var _0x4d7511=path[_0x35a1('0xcf')](config[_0x35a1('0xd0')],_0x35a1('0xd3'),_0x35a1('0xd1'),_0x35a1('0xd4'));var _0x20c22b=path[_0x35a1('0xcf')](_0x526683,_0xb3da4d);var _0x47726f=util['format'](_0x35a1('0xd5'),_0x43eeb0[_0x35a1('0xb5')]['id'],_0xb3da4d);var _0x1deab9=path[_0x35a1('0xcf')](_0x526683,_0x47726f);var _0x79f8cd=[];_0x79f8cd['push']({'model':db[_0x35a1('0xd6')],'as':'Attachment','raw':!![]});var _0xd2fcbe=[{'model':db[_0x35a1('0xbe')],'as':'Messages','attributes':['id',_0x35a1('0x72'),'createdAt'],'include':_0x79f8cd}];return db[_0x35a1('0x9c')][_0x35a1('0x5e')]({'where':{'id':_0x43eeb0[_0x35a1('0xb5')]['id']},'include':_0xd2fcbe})[_0x35a1('0x28')](handleEntityNotFound(_0x2d0d7e,null))[_0x35a1('0x28')](function(_0x133fd2){if(_0x133fd2&&_0x133fd2[_0x35a1('0xd7')]){var _0x199246=_0x133fd2[_0x35a1('0xd8')]({'plain':!![]});fs[_0x35a1('0xd9')](_0x20c22b);for(var _0x38e125=0x0;_0x38e125<_0x199246[_0x35a1('0xd7')][_0x35a1('0x3e')];_0x38e125++){var _0x525fed=_0x199246['Messages'][_0x38e125]['Attachment'];if(_0x525fed){var _0xbc9306=path[_0x35a1('0xcf')](_0x4d7511,_0x525fed[_0x35a1('0xda')]);if(fs[_0x35a1('0xdb')](_0xbc9306)){fs['createReadStream'](_0xbc9306)[_0x35a1('0xdc')](fs[_0x35a1('0xdd')](path[_0x35a1('0xcf')](_0x20c22b,_0x525fed[_0x35a1('0xda')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x59bb95,_0x22bf57){zipdir(_0x20c22b,{'saveTo':_0x1deab9},function(_0x207a94,_0xf3a311){if(_0x207a94)return _0x22bf57(_0x207a94);return _0x59bb95(_0xf3a311);});})[_0x35a1('0x28')](function(){return new BPromise(function(_0x2c4305,_0xb89740){rimraf(_0x20c22b,function(_0x3f1a27){if(_0x3f1a27)_0xb89740(_0x3f1a27);return _0x2c4305();});});})[_0x35a1('0x28')](function(){return _0x2d0d7e['download'](_0x1deab9,_0x47726f,function(_0x150a57){if(_0x150a57){console[_0x35a1('0xde')](_0x35a1('0xdf'),_0x150a57);}else{fs[_0x35a1('0xe0')](_0x1deab9);}});});});}else{return _0x2d0d7e[_0x35a1('0x1d')](0xc8);}})[_0x35a1('0x35')](handleError(_0x2d0d7e,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 51ea2e7..1daf30b 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 _0xc4aa=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','then','setDataValue','findAll'];(function(_0x4404ff,_0x13d7a9){var _0x5e7b19=function(_0x13847a){while(--_0x13847a){_0x4404ff['push'](_0x4404ff['shift']());}};_0x5e7b19(++_0x13d7a9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxInteraction=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xac4a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f48ed){return function(_0x15b967,_0x730a38,_0x215f39){_0x15b967[_0xac4a('0x5')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x6')](function(_0x3ef77c){_0x15b967[_0xac4a('0x7')]('Users',_0x3ef77c['map'](function(_0x1aba6d){return{'id':_0x1aba6d['id']};}));return FaxMessage[_0xac4a('0x8')]({'where':{'FaxInteractionId':_0x15b967['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac4a('0x6')](function(_0x4f4146){_0x15b967[_0xac4a('0x7')](_0xac4a('0x9'),_0x4f4146[_0xac4a('0xa')]);FaxInteractionEvents['emit'](_0x2f48ed+':'+_0x15b967['id'],_0x15b967);FaxInteractionEvents[_0xac4a('0xb')](_0x2f48ed,_0x15b967);_0x215f39(null);})['catch'](_0x215f39(null));};}for(var e in events){if(events[_0xac4a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xac4a('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0x1261=['exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x57be88,_0x27e0c0){var _0x48c988=function(_0x486021){while(--_0x486021){_0x57be88['push'](_0x57be88['shift']());}};_0x48c988(++_0x27e0c0);}(_0x1261,0x144));var _0x1126=function(_0x1436d8,_0x5135aa){_0x1436d8=_0x1436d8-0x0;var _0x252c31=_0x1261[_0x1436d8];return _0x252c31;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1126('0x0'))['db'][_0x1126('0x1')];var FaxMessage=require(_0x1126('0x0'))['db'][_0x1126('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1126('0x3')](0x0);var events={'afterCreate':_0x1126('0x4'),'afterUpdate':_0x1126('0x5'),'afterDestroy':_0x1126('0x6')};function emitEvent(_0x21a480){return function(_0x75a851,_0x5a2189,_0x5c68c8){_0x75a851[_0x1126('0x7')]({'attributes':['id'],'raw':!![]})[_0x1126('0x8')](function(_0x4f239c){_0x75a851[_0x1126('0x9')](_0x1126('0xa'),_0x4f239c[_0x1126('0xb')](function(_0x3abb0b){return{'id':_0x3abb0b['id']};}));return FaxMessage[_0x1126('0xc')]({'where':{'FaxInteractionId':_0x75a851['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3f09ac){_0x75a851[_0x1126('0x9')](_0x1126('0xd'),_0x3f09ac['length']);FaxInteractionEvents[_0x1126('0xe')](_0x21a480+':'+_0x75a851['id'],_0x75a851);FaxInteractionEvents['emit'](_0x21a480,_0x75a851);_0x5c68c8(null);})['catch'](_0x5c68c8(null));};}for(var e in events){if(events[_0x1126('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1126('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 1658d16..f9f2f12 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 _0xdace=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','FaxInteraction','fax_interactions','changed','closed'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xdace,0xc5));var _0xedac=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xdace[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./faxInteraction.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x162eea,_0x53fa43,_0x27243f){if(_0x162eea[_0xedac('0xb')](_0xedac('0xc'))){_0x162eea['closedAt']=moment()['format'](_0xedac('0xd'));}_0x27243f(null,_0x162eea);}}});}; \ No newline at end of file +var _0xb821=['../../config/logger','bluebird','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x4f7365,_0x197f0a){var _0x1a04a6=function(_0x1dd51d){while(--_0x1dd51d){_0x4f7365['push'](_0x4f7365['shift']());}};_0x1a04a6(++_0x197f0a);}(_0xb821,0xa7));var _0x1b82=function(_0x41f709,_0x1b5c71){_0x41f709=_0x41f709-0x0;var _0x279af4=_0xb821[_0x41f709];return _0x279af4;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18f45f,_0x7b87e8,_0x161155){if(_0x18f45f[_0x1b82('0xa')](_0x1b82('0xb'))){_0x18f45f['closedAt']=moment()[_0x1b82('0xc')](_0x1b82('0xd'));}_0x161155(null,_0x18f45f);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 2304a67..43fb80f 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 _0xb6d5=['raw','where','limit','AddTagsToFaxInteraction','FaxInteraction','find','ids','omit','spread','AddTags','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','body','options'];(function(_0x393775,_0x204e3f){var _0x9b5d4a=function(_0x14a32b){while(--_0x14a32b){_0x393775['push'](_0x393775['shift']());}};_0x9b5d4a(++_0x204e3f);}(_0xb6d5,0x13e));var _0x5b6d=function(_0x28876d,_0x46f49d){_0x28876d=_0x28876d-0x0;var _0x1eb326=_0xb6d5[_0x28876d];return _0x1eb326;};'use strict';var _=require(_0x5b6d('0x0'));var util=require(_0x5b6d('0x1'));var moment=require('moment');var BPromise=require(_0x5b6d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b6d('0x3'));var db=require(_0x5b6d('0x4'))['db'];var utils=require(_0x5b6d('0x5'));var logger=require(_0x5b6d('0x6'))(_0x5b6d('0x7'));var config=require(_0x5b6d('0x8'));var jayson=require(_0x5b6d('0x9'));var client=jayson[_0x5b6d('0xa')][_0x5b6d('0xb')]({'port':0x232a});config[_0x5b6d('0xc')]=_[_0x5b6d('0xd')](config[_0x5b6d('0xc')],{'host':_0x5b6d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b6d('0xc')]));require(_0x5b6d('0xf'))[_0x5b6d('0x10')](socket);function respondWithRpcPromise(_0x57ba99,_0x5d7059,_0x454819){return new BPromise(function(_0xace9b2,_0x1e5306){return client[_0x5b6d('0x11')](_0x57ba99,_0x454819)[_0x5b6d('0x12')](function(_0x693a7f){logger[_0x5b6d('0x13')](_0x5b6d('0x14'),_0x5d7059,_0x5b6d('0x15'));logger[_0x5b6d('0x16')](_0x5b6d('0x17'),_0x5d7059,_0x5b6d('0x15'),JSON[_0x5b6d('0x18')](_0x693a7f));if(_0x693a7f[_0x5b6d('0x19')]){if(_0x693a7f[_0x5b6d('0x19')][_0x5b6d('0x1a')]===0x1f4){logger[_0x5b6d('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x5d7059,_0x693a7f[_0x5b6d('0x19')][_0x5b6d('0x1b')]);return _0x1e5306(_0x693a7f[_0x5b6d('0x19')][_0x5b6d('0x1b')]);}logger[_0x5b6d('0x19')](_0x5b6d('0x14'),_0x5d7059,_0x693a7f[_0x5b6d('0x19')][_0x5b6d('0x1b')]);return _0xace9b2(_0x693a7f['error']['message']);}else{logger['info'](_0x5b6d('0x14'),_0x5d7059,_0x5b6d('0x15'));_0xace9b2(_0x693a7f[_0x5b6d('0x1c')][_0x5b6d('0x1b')]);}})[_0x5b6d('0x1d')](function(_0x50ac1b){logger[_0x5b6d('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x5d7059,_0x50ac1b);_0x1e5306(_0x50ac1b);});});}exports[_0x5b6d('0x1e')]=function(_0x45e310){var _0x106caa=this;return new Promise(function(_0x23672c,_0x1b1eb6){return db['FaxInteraction'][_0x5b6d('0x1f')](_0x45e310[_0x5b6d('0x20')],{'raw':_0x45e310[_0x5b6d('0x21')]?_0x45e310[_0x5b6d('0x21')][_0x5b6d('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45e310[_0x5b6d('0x21')]?_0x45e310[_0x5b6d('0x21')][_0x5b6d('0x23')]||null:null,'attributes':_0x45e310[_0x5b6d('0x21')]?_0x45e310['options']['attributes']||null:null,'limit':_0x45e310[_0x5b6d('0x21')]?_0x45e310['options'][_0x5b6d('0x24')]||null:null})[_0x5b6d('0x12')](function(_0x39fdcf){logger[_0x5b6d('0x13')](_0x5b6d('0x1e'),_0x45e310);logger['debug']('UpdateFaxInteraction',_0x45e310,JSON[_0x5b6d('0x18')](_0x39fdcf));_0x23672c(_0x39fdcf);})['catch'](function(_0x5afbc5){logger[_0x5b6d('0x19')](_0x5b6d('0x1e'),_0x5afbc5[_0x5b6d('0x1b')],_0x45e310);_0x1b1eb6(_0x106caa[_0x5b6d('0x19')](0x1f4,_0x5afbc5[_0x5b6d('0x1b')]));});});};exports[_0x5b6d('0x25')]=function(_0x49efef){return new Promise(function(_0x1d88c2,_0x5b86d7){return db[_0x5b6d('0x26')][_0x5b6d('0x27')]({'where':_0x49efef[_0x5b6d('0x21')]?_0x49efef[_0x5b6d('0x21')]['where']||null:null})[_0x5b6d('0x12')](function(_0x4683eb){if(_0x4683eb){return _0x4683eb['addTags'](_0x49efef['body'][_0x5b6d('0x28')],_[_0x5b6d('0x29')](_0x49efef[_0x5b6d('0x20')],['ids','id'])||{});}})[_0x5b6d('0x2a')](function(_0x1832f5){logger[_0x5b6d('0x13')](_0x5b6d('0x2b'),_0x49efef);logger[_0x5b6d('0x16')]('AddTags',_0x49efef,JSON[_0x5b6d('0x18')](_0x1832f5));_0x1d88c2(_0x1832f5);})[_0x5b6d('0x1d')](function(_0x27e99c){logger[_0x5b6d('0x19')]('AddTags',_0x27e99c['message'],_0x49efef);_0x5b86d7(_this[_0x5b6d('0x19')](0x1f4,_0x27e99c[_0x5b6d('0x1b')]));});});}; \ No newline at end of file +var _0x82cf=['spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','stringify','AddTagsToFaxInteraction','addTags','ids','omit'];(function(_0x472511,_0xdd8699){var _0x46878e=function(_0x3a1811){while(--_0x3a1811){_0x472511['push'](_0x472511['shift']());}};_0x46878e(++_0xdd8699);}(_0x82cf,0x1db));var _0xf82c=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0x82cf[_0x149ca0];return _0x56b6b9;};'use strict';var _=require('lodash');var util=require(_0xf82c('0x0'));var moment=require(_0xf82c('0x1'));var BPromise=require(_0xf82c('0x2'));var rs=require(_0xf82c('0x3'));var fs=require('fs');var Redis=require(_0xf82c('0x4'));var db=require(_0xf82c('0x5'))['db'];var utils=require(_0xf82c('0x6'));var logger=require(_0xf82c('0x7'))(_0xf82c('0x8'));var config=require(_0xf82c('0x9'));var jayson=require(_0xf82c('0xa'));var client=jayson['client'][_0xf82c('0xb')]({'port':0x232a});config[_0xf82c('0xc')]=_[_0xf82c('0xd')](config[_0xf82c('0xc')],{'host':_0xf82c('0xe'),'port':0x18eb});var socket=require(_0xf82c('0xf'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xf82c('0x10')](socket);function respondWithRpcPromise(_0x2600c1,_0x444320,_0x38dfa6){return new BPromise(function(_0x315e5d,_0x1912f4){return client[_0xf82c('0x11')](_0x2600c1,_0x38dfa6)[_0xf82c('0x12')](function(_0x5909f4){logger[_0xf82c('0x13')](_0xf82c('0x14'),_0x444320,_0xf82c('0x15'));logger[_0xf82c('0x16')](_0xf82c('0x17'),_0x444320,_0xf82c('0x15'),JSON['stringify'](_0x5909f4));if(_0x5909f4['error']){if(_0x5909f4[_0xf82c('0x18')][_0xf82c('0x19')]===0x1f4){logger['error'](_0xf82c('0x14'),_0x444320,_0x5909f4[_0xf82c('0x18')][_0xf82c('0x1a')]);return _0x1912f4(_0x5909f4[_0xf82c('0x18')][_0xf82c('0x1a')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x444320,_0x5909f4[_0xf82c('0x18')][_0xf82c('0x1a')]);return _0x315e5d(_0x5909f4[_0xf82c('0x18')][_0xf82c('0x1a')]);}else{logger['info'](_0xf82c('0x14'),_0x444320,'request\x20sent');_0x315e5d(_0x5909f4['result'][_0xf82c('0x1a')]);}})[_0xf82c('0x1b')](function(_0x5f21c1){logger[_0xf82c('0x18')](_0xf82c('0x14'),_0x444320,_0x5f21c1);_0x1912f4(_0x5f21c1);});});}exports[_0xf82c('0x1c')]=function(_0x2e7ae9){var _0x343850=this;return new Promise(function(_0x1b789e,_0xdc249c){return db[_0xf82c('0x1d')][_0xf82c('0x1e')](_0x2e7ae9[_0xf82c('0x1f')],{'raw':_0x2e7ae9[_0xf82c('0x20')]?_0x2e7ae9[_0xf82c('0x20')][_0xf82c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e7ae9[_0xf82c('0x20')]?_0x2e7ae9[_0xf82c('0x20')]['where']||null:null,'attributes':_0x2e7ae9[_0xf82c('0x20')]?_0x2e7ae9['options'][_0xf82c('0x22')]||null:null,'limit':_0x2e7ae9['options']?_0x2e7ae9['options'][_0xf82c('0x23')]||null:null})['then'](function(_0x2cb59e){logger[_0xf82c('0x13')]('UpdateFaxInteraction',_0x2e7ae9);logger[_0xf82c('0x16')]('UpdateFaxInteraction',_0x2e7ae9,JSON[_0xf82c('0x24')](_0x2cb59e));_0x1b789e(_0x2cb59e);})[_0xf82c('0x1b')](function(_0x365a71){logger['error'](_0xf82c('0x1c'),_0x365a71['message'],_0x2e7ae9);_0xdc249c(_0x343850[_0xf82c('0x18')](0x1f4,_0x365a71[_0xf82c('0x1a')]));});});};exports[_0xf82c('0x25')]=function(_0x6c4812){return new Promise(function(_0x2319f3,_0x413853){return db[_0xf82c('0x1d')]['find']({'where':_0x6c4812['options']?_0x6c4812['options']['where']||null:null})[_0xf82c('0x12')](function(_0x4c83b3){if(_0x4c83b3){return _0x4c83b3[_0xf82c('0x26')](_0x6c4812[_0xf82c('0x1f')][_0xf82c('0x27')],_[_0xf82c('0x28')](_0x6c4812['body'],[_0xf82c('0x27'),'id'])||{});}})[_0xf82c('0x29')](function(_0x6f898e){logger[_0xf82c('0x13')](_0xf82c('0x2a'),_0x6c4812);logger['debug'](_0xf82c('0x2a'),_0x6c4812,JSON['stringify'](_0x6f898e));_0x2319f3(_0x6f898e);})[_0xf82c('0x1b')](function(_0x51bd06){logger['error'](_0xf82c('0x2a'),_0x51bd06[_0xf82c('0x1a')],_0x6c4812);_0x413853(_this[_0xf82c('0x18')](0x1f4,_0x51bd06['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e8295cd..90c32c8 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 _0xdb78=['emit','removeListener','length','faxInteraction:','save','remove','update'];(function(_0x8b94ff,_0x1f846d){var _0x367202=function(_0x243ce9){while(--_0x243ce9){_0x8b94ff['push'](_0x8b94ff['shift']());}};_0x367202(++_0x1f846d);}(_0xdb78,0x1bd));var _0x8db7=function(_0x3d60bb,_0x2b95ee){_0x3d60bb=_0x3d60bb-0x0;var _0x11cef9=_0xdb78[_0x3d60bb];return _0x11cef9;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x8db7('0x0'),_0x8db7('0x1'),_0x8db7('0x2')];function createListener(_0x26d69c,_0x3fa1d4){return function(_0x1ae6f5){_0x3fa1d4[_0x8db7('0x3')](_0x26d69c,_0x1ae6f5);};}function removeListener(_0x24736b,_0x3fa728){return function(){FaxInteractionEvents[_0x8db7('0x4')](_0x24736b,_0x3fa728);};}exports['register']=function(_0x4f4cac){for(var _0x43313f=0x0,_0x5e732a=events[_0x8db7('0x5')];_0x43313f<_0x5e732a;_0x43313f++){var _0xea9750=events[_0x43313f];var _0x2dcf43=createListener(_0x8db7('0x6')+_0xea9750,_0x4f4cac);FaxInteractionEvents['on'](_0xea9750,_0x2dcf43);}}; \ No newline at end of file +var _0x0ff9=['removeListener','register','./faxInteraction.events','save','remove','update'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x0ff9,0x1ee));var _0x90ff=function(_0x2c636b,_0x244f49){_0x2c636b=_0x2c636b-0x0;var _0x48fa49=_0x0ff9[_0x2c636b];return _0x48fa49;};'use strict';var FaxInteractionEvents=require(_0x90ff('0x0'));var events=[_0x90ff('0x1'),_0x90ff('0x2'),_0x90ff('0x3')];function createListener(_0x34297a,_0x3de446){return function(_0x5098d2){_0x3de446['emit'](_0x34297a,_0x5098d2);};}function removeListener(_0x28db47,_0x405aee){return function(){FaxInteractionEvents[_0x90ff('0x4')](_0x28db47,_0x405aee);};}exports[_0x90ff('0x5')]=function(_0x5d1158){for(var _0x17766c=0x0,_0x4eaf26=events['length'];_0x17766c<_0x4eaf26;_0x17766c++){var _0xe04b69=events[_0x17766c];var _0x24b241=createListener('faxInteraction:'+_0xe04b69,_0x5d1158);FaxInteractionEvents['on'](_0xe04b69,_0x24b241);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 87ff359..5cf06fc 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 _0xfe11=['get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xfe11,0x94));var _0x1fe1=function(_0x567fff,_0xd8acd8){_0x567fff=_0x567fff-0x0;var _0x465a37=_0xfe11[_0x567fff];return _0x465a37;};'use strict';var multer=require(_0x1fe1('0x0'));var util=require(_0x1fe1('0x1'));var path=require(_0x1fe1('0x2'));var timeout=require(_0x1fe1('0x3'));var express=require(_0x1fe1('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1fe1('0x5'));var config=require(_0x1fe1('0x6'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1fe1('0x7')](_0x1fe1('0x8'),auth[_0x1fe1('0x9')](),controller[_0x1fe1('0xa')]);router['get'](_0x1fe1('0xb'),auth[_0x1fe1('0x9')](),controller[_0x1fe1('0xc')]);router[_0x1fe1('0x7')](_0x1fe1('0xd'),auth[_0x1fe1('0x9')](),controller[_0x1fe1('0xe')]);router[_0x1fe1('0x7')](_0x1fe1('0xf'),auth[_0x1fe1('0x9')](),controller['download']);router[_0x1fe1('0x10')]('/',auth[_0x1fe1('0x9')](),controller[_0x1fe1('0x11')]);router['post']('/:id/messages',auth[_0x1fe1('0x9')](),controller[_0x1fe1('0x12')]);router[_0x1fe1('0x10')](_0x1fe1('0x13'),auth[_0x1fe1('0x9')](),interaction[_0x1fe1('0x14')](_0x1fe1('0x15'),_0x1fe1('0x16')),controller[_0x1fe1('0x17')]);router[_0x1fe1('0x18')](_0x1fe1('0xb'),auth[_0x1fe1('0x9')](),interaction['tracked'](_0x1fe1('0x15'),_0x1fe1('0x19')),controller[_0x1fe1('0x1a')]);router[_0x1fe1('0x1b')](_0x1fe1('0xb'),auth[_0x1fe1('0x9')](),interaction['tracked'](_0x1fe1('0x15'),_0x1fe1('0x1c')),controller[_0x1fe1('0x1d')]);router[_0x1fe1('0x1b')](_0x1fe1('0x13'),auth[_0x1fe1('0x9')](),controller[_0x1fe1('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x9362=['post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','removeTags','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','/describe','/:id','/:id/messages','getMessages','/:id/download','download'];(function(_0x5c2757,_0x473b6b){var _0x321fd8=function(_0x3d4ca4){while(--_0x3d4ca4){_0x5c2757['push'](_0x5c2757['shift']());}};_0x321fd8(++_0x473b6b);}(_0x9362,0x169));var _0x2936=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9362[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2936('0x0'));var util=require('util');var path=require(_0x2936('0x1'));var timeout=require('connect-timeout');var express=require(_0x2936('0x2'));var router=express[_0x2936('0x3')]();var auth=require(_0x2936('0x4'));var interaction=require(_0x2936('0x5'));var config=require('../../config/environment');var controller=require(_0x2936('0x6'));router['get']('/',auth[_0x2936('0x7')](),controller[_0x2936('0x8')]);router[_0x2936('0x9')](_0x2936('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x2936('0x9')](_0x2936('0xb'),auth[_0x2936('0x7')](),controller['show']);router[_0x2936('0x9')](_0x2936('0xc'),auth[_0x2936('0x7')](),controller[_0x2936('0xd')]);router['get'](_0x2936('0xe'),auth[_0x2936('0x7')](),controller[_0x2936('0xf')]);router[_0x2936('0x10')]('/',auth[_0x2936('0x7')](),controller[_0x2936('0x11')]);router[_0x2936('0x10')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2936('0x12')]);router[_0x2936('0x10')](_0x2936('0x13'),auth['isAuthenticated'](),interaction[_0x2936('0x14')](_0x2936('0x15'),_0x2936('0x16')),controller[_0x2936('0x17')]);router[_0x2936('0x18')](_0x2936('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x2936('0x15'),_0x2936('0x19')),controller[_0x2936('0x1a')]);router[_0x2936('0x1b')](_0x2936('0xb'),auth['isAuthenticated'](),interaction[_0x2936('0x14')]('fax','faxinteraction:destroy'),controller['destroy']);router[_0x2936('0x1b')](_0x2936('0x13'),auth[_0x2936('0x7')](),controller[_0x2936('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6ae4e60..b4b0f0f 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 _0xd087=['exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x1bc1de,_0x25c6ca){var _0x21d681=function(_0x499869){while(--_0x499869){_0x1bc1de['push'](_0x1bc1de['shift']());}};_0x21d681(++_0x25c6ca);}(_0xd087,0xcf));var _0x7d08=function(_0x563129,_0x26d5f9){_0x563129=_0x563129-0x0;var _0x28d1a3=_0xd087[_0x563129];return _0x28d1a3;};'use strict';var Sequelize=require(_0x7d08('0x0'));module[_0x7d08('0x1')]={'body':{'type':Sequelize[_0x7d08('0x2')](_0x7d08('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7d08('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7d08('0x5')]('in',_0x7d08('0x6')),'defaultValue':_0x7d08('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7d08('0x7')]}}; \ No newline at end of file +var _0xecb9=['out','medium','BOOLEAN'];(function(_0x247031,_0x3948d4){var _0x4e6a28=function(_0x1395ea){while(--_0x1395ea){_0x247031['push'](_0x247031['shift']());}};_0x4e6a28(++_0x3948d4);}(_0xecb9,0x8b));var _0x9ecb=function(_0xdfcf22,_0x322509){_0xdfcf22=_0xdfcf22-0x0;var _0x59b62f=_0xecb9[_0xdfcf22];return _0x59b62f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0x9ecb('0x0')),'allowNull':![]},'read':{'type':Sequelize[_0x9ecb('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9ecb('0x2')),'defaultValue':_0x9ecb('0x2'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index c94ee4d..8fd3ca8 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 _0x874e=['body','find','params','describe','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','fax','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','event','rejectmessage','create','ContactId','Attachment','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./faxMessage.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','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','stack','name','send','index','FaxMessage','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','catch','length'];(function(_0x2474e3,_0x2203ba){var _0x5793ae=function(_0xb2cbff){while(--_0xb2cbff){_0x2474e3['push'](_0x2474e3['shift']());}};_0x5793ae(++_0x2203ba);}(_0x874e,0x139));var _0xe874=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x874e[_0x257642];return _0x3d813b;};'use strict';var pdf=require(_0xe874('0x0'));var emlformat=require(_0xe874('0x1'));var rimraf=require(_0xe874('0x2'));var zipdir=require(_0xe874('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe874('0x4'));var BPromise=require(_0xe874('0x5'));var Mustache=require(_0xe874('0x6'));var util=require(_0xe874('0x7'));var path=require('path');var sox=require(_0xe874('0x8'));var csv=require(_0xe874('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe874('0xa'));var squel=require(_0xe874('0xb'));var crypto=require(_0xe874('0xc'));var jsforce=require(_0xe874('0xd'));var deskjs=require(_0xe874('0xe'));var toCsv=require(_0xe874('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe874('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe874('0x10'));var hardwareService=require(_0xe874('0x11'));var logger=require(_0xe874('0x12'))(_0xe874('0x13'));var utils=require(_0xe874('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe874('0x15')]=_[_0xe874('0x16')](config[_0xe874('0x15')],{'host':_0xe874('0x17'),'port':0x18eb});var socket=require(_0xe874('0x18'))(new Redis(config[_0xe874('0x15')]));require(_0xe874('0x19'))[_0xe874('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xe874('0x1b')][_0xe874('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x28b8fe,_0x2333c2,_0x2fe05b){if(_0x2fe05b){var _0x4c6ac0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c6ac0[_0xe874('0x1d')](_0x2333c2)){return _0x28b8fe;}else{throw new db[(_0xe874('0x1e'))][(_0xe874('0x1f'))](_0xe874('0x20'));}}else{return _0x28b8fe;}}function respondWithRpcPromise(_0x470602,_0x3c718a,_0x1f2f29,_0x2b3def){return new BPromise(function(_0x2420fd,_0x36d89d){var _0x55c01b=_0x2b3def||client;return _0x55c01b[_0xe874('0x21')](_0x470602,_0x1f2f29)['then'](function(_0x5d5b18){logger['info'](_0xe874('0x22'),_0x3c718a,_0xe874('0x23'));logger[_0xe874('0x24')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x3c718a,_0xe874('0x23'),JSON[_0xe874('0x25')](_0x5d5b18));if(_0x5d5b18['error']){if(_0x5d5b18[_0xe874('0x26')]['code']===0x1f4){logger[_0xe874('0x26')]('FaxMessage,\x20%s,\x20%s',_0x3c718a,_0x5d5b18[_0xe874('0x26')][_0xe874('0x27')]);return _0x36d89d(_0x5d5b18[_0xe874('0x26')][_0xe874('0x27')]);}logger[_0xe874('0x26')](_0xe874('0x22'),_0x3c718a,_0x5d5b18['error'][_0xe874('0x27')]);return _0x2420fd(_0x5d5b18[_0xe874('0x26')][_0xe874('0x27')]);}else{logger[_0xe874('0x28')](_0xe874('0x22'),_0x3c718a,'request\x20sent');_0x2420fd(_0x5d5b18[_0xe874('0x29')][_0xe874('0x27')]);}})['catch'](function(_0xfc8c93){logger[_0xe874('0x26')](_0xe874('0x22'),_0x3c718a,_0xfc8c93);_0x36d89d(_0xfc8c93);});});}function respondWithStatusCode(_0x16cfab,_0x5a9537){_0x5a9537=_0x5a9537||0xcc;return function(_0x392bf6){if(_0x392bf6){return _0x16cfab[_0xe874('0x2a')](_0x5a9537);}return _0x16cfab[_0xe874('0x2b')](_0x5a9537)[_0xe874('0x2c')]();};}function respondWithResult(_0x22b97a,_0x3ed6a0){_0x3ed6a0=_0x3ed6a0||0xc8;return function(_0x2f9240){if(_0x2f9240){return _0x22b97a[_0xe874('0x2b')](_0x3ed6a0)[_0xe874('0x2d')](_0x2f9240);}};}function respondWithFilteredResult(_0x3e88fe,_0x2305bc){return function(_0x3a7aad){if(_0x3a7aad){var _0x599f77=_0x3a7aad[_0xe874('0x2e')],_0x2554ce=_0x2305bc[_0xe874('0x2f')],_0x29c68a=_0x2305bc['offset']+_0x2305bc[_0xe874('0x30')],_0x2f882f;if(_0x29c68a>=_0x599f77){_0x29c68a=_0x599f77;_0x2f882f=0xc8;}else{_0x2f882f=0xce;}_0x3e88fe[_0xe874('0x2b')](_0x2f882f);return _0x3e88fe['set'](_0xe874('0x31'),_0x2554ce+'-'+_0x29c68a+'/'+_0x599f77)[_0xe874('0x2d')](_0x3a7aad);}return null;};}function patchUpdates(_0x5a5bbd){return function(_0x3a93f8){try{jsonpatch[_0xe874('0x32')](_0x3a93f8,_0x5a5bbd,!![]);}catch(_0x48f98a){return BPromise['reject'](_0x48f98a);}return _0x3a93f8[_0xe874('0x33')]();};}function saveUpdates(_0x4229ed,_0x182f1d){return function(_0x3d24eb){if(_0x3d24eb){return _0x3d24eb[_0xe874('0x34')](_0x4229ed)['then'](function(_0x51247d){return _0x51247d;});}return null;};}function removeEntity(_0x268be3,_0x30119e){return function(_0xa171a3){if(_0xa171a3){return _0xa171a3[_0xe874('0x35')]()[_0xe874('0x36')](function(){_0x268be3['status'](0xcc)[_0xe874('0x2c')]();});}};}function handleEntityNotFound(_0x17c64f,_0x29d297){return function(_0x450d6a){if(!_0x450d6a){_0x17c64f[_0xe874('0x2a')](0x194);}return _0x450d6a;};}function handleError(_0x418a94,_0x384c3c){_0x384c3c=_0x384c3c||0x1f4;return function(_0x3a6cbe){logger['error'](_0x3a6cbe[_0xe874('0x37')]);if(_0x3a6cbe[_0xe874('0x38')]){delete _0x3a6cbe[_0xe874('0x38')];}_0x418a94[_0xe874('0x2b')](_0x384c3c)[_0xe874('0x39')](_0x3a6cbe);};}exports[_0xe874('0x3a')]=function(_0x39e46b,_0x3abdd0){var _0x22cbe5={},_0x379145={},_0x5b778b={'count':0x0,'rows':[]};var _0x428b64=_['map'](db[_0xe874('0x3b')]['rawAttributes'],function(_0x3f942){return{'name':_0x3f942[_0xe874('0x3c')],'type':_0x3f942[_0xe874('0x3d')][_0xe874('0x3e')]};});_0x379145[_0xe874('0x3f')]=_[_0xe874('0x40')](_0x428b64,_0xe874('0x38'));_0x379145[_0xe874('0x41')]=_[_0xe874('0x42')](_0x39e46b[_0xe874('0x41')]);_0x379145['filters']=_['intersection'](_0x379145['model'],_0x379145[_0xe874('0x41')]);_0x22cbe5[_0xe874('0x43')]=_[_0xe874('0x44')](_0x379145[_0xe874('0x3f')],qs[_0xe874('0x45')](_0x39e46b[_0xe874('0x41')]['fields']));_0x22cbe5[_0xe874('0x43')]=_0x22cbe5[_0xe874('0x43')]['length']?_0x22cbe5[_0xe874('0x43')]:_0x379145[_0xe874('0x3f')];if(!_0x39e46b['query'][_0xe874('0x46')](_0xe874('0x47'))){_0x22cbe5[_0xe874('0x30')]=qs[_0xe874('0x30')](_0x39e46b[_0xe874('0x41')]['limit']);_0x22cbe5[_0xe874('0x2f')]=qs[_0xe874('0x2f')](_0x39e46b[_0xe874('0x41')]['offset']);}_0x22cbe5[_0xe874('0x48')]=qs[_0xe874('0x49')](_0x39e46b[_0xe874('0x41')][_0xe874('0x49')]);_0x22cbe5['where']=qs[_0xe874('0x4a')](_[_0xe874('0x4b')](_0x39e46b[_0xe874('0x41')],_0x379145[_0xe874('0x4a')]),_0x428b64);if(_0x39e46b[_0xe874('0x41')]['filter']){_0x22cbe5['where']=_[_0xe874('0x4c')](_0x22cbe5['where'],{'$or':_[_0xe874('0x40')](_0x428b64,function(_0x4b5bc3){if(_0x4b5bc3[_0xe874('0x3d')]!==_0xe874('0x4d')){var _0x230533={};_0x230533[_0x4b5bc3[_0xe874('0x38')]]={'$like':'%'+_0x39e46b[_0xe874('0x41')][_0xe874('0x4e')]+'%'};return _0x230533;}})});}_0x22cbe5=_[_0xe874('0x4c')]({},_0x22cbe5,_0x39e46b[_0xe874('0x4f')]);var _0xa5268={'where':_0x22cbe5[_0xe874('0x50')]};return db[_0xe874('0x3b')]['count'](_0xa5268)[_0xe874('0x36')](function(_0x5aaebc){_0x5b778b[_0xe874('0x2e')]=_0x5aaebc;if(_0x39e46b[_0xe874('0x41')][_0xe874('0x51')]){_0x22cbe5[_0xe874('0x52')]=[{'all':!![]}];}return db['FaxMessage'][_0xe874('0x53')](_0x22cbe5);})[_0xe874('0x36')](function(_0x589784){_0x5b778b['rows']=_0x589784;return _0x5b778b;})[_0xe874('0x36')](respondWithFilteredResult(_0x3abdd0,_0x22cbe5))[_0xe874('0x54')](handleError(_0x3abdd0,null));};exports['show']=function(_0x4be4db,_0x396e78){var _0x23b61d={'raw':!![],'where':{'id':_0x4be4db['params']['id']}},_0x53e3e4={};_0x53e3e4[_0xe874('0x3f')]=_[_0xe874('0x42')](db['FaxMessage']['rawAttributes']);_0x53e3e4[_0xe874('0x41')]=_[_0xe874('0x42')](_0x4be4db[_0xe874('0x41')]);_0x53e3e4['filters']=_['intersection'](_0x53e3e4[_0xe874('0x3f')],_0x53e3e4[_0xe874('0x41')]);_0x23b61d['attributes']=_[_0xe874('0x44')](_0x53e3e4[_0xe874('0x3f')],qs[_0xe874('0x45')](_0x4be4db[_0xe874('0x41')][_0xe874('0x45')]));_0x23b61d[_0xe874('0x43')]=_0x23b61d['attributes'][_0xe874('0x55')]?_0x23b61d[_0xe874('0x43')]:_0x53e3e4[_0xe874('0x3f')];if(_0x4be4db['query'][_0xe874('0x51')]){_0x23b61d[_0xe874('0x52')]=[{'all':!![]}];}_0x23b61d=_[_0xe874('0x4c')]({},_0x23b61d,_0x4be4db[_0xe874('0x4f')]);return db[_0xe874('0x3b')]['find'](_0x23b61d)[_0xe874('0x36')](handleEntityNotFound(_0x396e78,null))['then'](respondWithResult(_0x396e78,null))[_0xe874('0x54')](handleError(_0x396e78,null));};exports[_0xe874('0x34')]=function(_0x2e83fb,_0x25ebd6){if(_0x2e83fb[_0xe874('0x56')]['id']){delete _0x2e83fb[_0xe874('0x56')]['id'];}return db['FaxMessage'][_0xe874('0x57')]({'where':{'id':_0x2e83fb[_0xe874('0x58')]['id']}})['then'](handleEntityNotFound(_0x25ebd6,null))[_0xe874('0x36')](saveUpdates(_0x2e83fb[_0xe874('0x56')],null))[_0xe874('0x36')](respondWithResult(_0x25ebd6,null))[_0xe874('0x54')](handleError(_0x25ebd6,null));};exports[_0xe874('0x35')]=function(_0x3150a4,_0x17684a){return db['FaxMessage'][_0xe874('0x57')]({'where':{'id':_0x3150a4[_0xe874('0x58')]['id']}})[_0xe874('0x36')](handleEntityNotFound(_0x17684a,null))[_0xe874('0x36')](removeEntity(_0x17684a,null))[_0xe874('0x54')](handleError(_0x17684a,null));};exports[_0xe874('0x59')]=function(_0x1cdc49,_0x17721c){return db['FaxMessage']['describe']()[_0xe874('0x36')](respondWithResult(_0x17721c,null))[_0xe874('0x54')](handleError(_0x17721c,null));};var interaction_log=require(_0xe874('0x12'))('fax-interactions');exports[_0xe874('0x5a')]=function(_0x25c5d7,_0x440cab,_0x444c17){var _0x1ccd29={'channel':'fax'};if(_0x25c5d7['body']['id']){delete _0x25c5d7[_0xe874('0x56')]['id'];}_0x25c5d7['body']['read']=!![];_0x25c5d7[_0xe874('0x56')]['readAt']=moment()['format'](_0xe874('0x5b'));_0x25c5d7[_0xe874('0x56')][_0xe874('0x5c')]=_0x25c5d7[_0xe874('0x56')]['UserId']||_0x25c5d7[_0xe874('0x5d')]['id'];return db[_0xe874('0x3b')]['find']({'where':{'id':_0x25c5d7[_0xe874('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xe874('0x5e')],'as':_0xe874('0x5f')}]})[_0xe874('0x36')](handleEntityNotFound(_0x440cab,null))[_0xe874('0x36')](saveUpdates(_0x25c5d7[_0xe874('0x56')],null))[_0xe874('0x36')](function(_0x4e732c){if(_0x4e732c){_0x1ccd29[_0xe874('0x27')]=_0x4e732c[_0xe874('0x60')]({'plain':!![]});return db[_0xe874('0x61')]['find']({'where':{'id':_0x4e732c[_0xe874('0x62')]}});}return null;})[_0xe874('0x36')](handleEntityNotFound(_0x440cab,null))[_0xe874('0x36')](function(_0x4ac043){if(_0x4ac043){return _0x4ac043[_0xe874('0x34')]({'UserId':_0x25c5d7[_0xe874('0x56')][_0xe874('0x5c')],'read1stAt':_[_0xe874('0x63')](_0x4ac043[_0xe874('0x64')])?moment()[_0xe874('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x13523e){if(_0x13523e){_0x1ccd29[_0xe874('0x66')]=_0x13523e['get']({'plain':!![]});interaction_log[_0xe874('0x28')](_0xe874('0x67'),_0x25c5d7[_0xe874('0x5d')]['id'],_0x25c5d7[_0xe874('0x5d')][_0xe874('0x38')],_0x25c5d7['user'][_0xe874('0x68')],_0x1ccd29['interaction']['id'],_0x25c5d7[_0xe874('0x56')]?JSON[_0xe874('0x25')](_0x25c5d7[_0xe874('0x56')]):'null');return respondWithRpcPromise(_0xe874('0x69'),_0xe874('0x6a'),_0x1ccd29);}return null;})['then'](function(_0xb5998a){if(_0xb5998a){if(_0x25c5d7[_0xe874('0x56')][_0xe874('0x6b')]){_0x1ccd29[_0xe874('0x27')][_0xe874('0x6c')]=util['format'](_0xe874('0x6d'),_0x25c5d7['user'][_0xe874('0x38')]);_0x1ccd29[_0xe874('0x27')][_0xe874('0x6e')]=_0x1ccd29['channel'];_0x1ccd29['message']['event']=_0xe874('0x5a');return respondWithRpcPromise(_0xe874('0x6f'),_0xe874('0x6f'),{'event':_0xe874('0x70'),'message':_0x1ccd29[_0xe874('0x27')]},client9002)[_0xe874('0x36')](function(){return _0x1ccd29;});}return _0x1ccd29;}return null;})['then'](respondWithResult(_0x440cab,null))[_0xe874('0x54')](handleError(_0x440cab,null));};var interaction_log=require(_0xe874('0x12'))('fax-interactions');exports[_0xe874('0x71')]=function(_0x389fbb,_0x4f5af1,_0x4a822c){var _0xd9a91f={'agent':{},'channel':_0xe874('0x72')};if(_0x389fbb[_0xe874('0x56')]['id']){delete _0x389fbb[_0xe874('0x56')]['id'];}_0x389fbb[_0xe874('0x56')][_0xe874('0x5c')]=_0x389fbb[_0xe874('0x56')][_0xe874('0x5c')]||_0x389fbb['user']['id'];_0xd9a91f[_0xe874('0x73')]['id']=_0x389fbb[_0xe874('0x56')][_0xe874('0x5c')];return db[_0xe874('0x3b')][_0xe874('0x57')]({'where':{'id':_0x389fbb[_0xe874('0x58')]['id'],'UserId':null}})[_0xe874('0x36')](handleEntityNotFound(_0x4f5af1,null))[_0xe874('0x36')](function(_0x1b8df9){if(_0x1b8df9){_0xd9a91f['message']=_0x1b8df9[_0xe874('0x60')]({'plain':!![]});return db[_0xe874('0x61')][_0xe874('0x57')]({'where':{'id':_0x1b8df9[_0xe874('0x62')]}});}return null;})[_0xe874('0x36')](handleEntityNotFound(_0x4f5af1,null))['then'](function(_0x17eeca){if(_0x17eeca){_0xd9a91f[_0xe874('0x66')]=_0x17eeca[_0xe874('0x60')]({'plain':!![]});interaction_log[_0xe874('0x28')](_0xe874('0x74'),_0x389fbb[_0xe874('0x5d')]['id'],_0x389fbb[_0xe874('0x5d')][_0xe874('0x38')],_0x389fbb[_0xe874('0x5d')]['role'],_0xd9a91f[_0xe874('0x66')]['id'],_0x389fbb[_0xe874('0x56')]?JSON[_0xe874('0x25')](_0x389fbb[_0xe874('0x56')]):'null');return respondWithRpcPromise(_0xe874('0x75'),'rejectMessage',_0xd9a91f);}return null;})['then'](function(_0x29d686){if(_0x29d686){_0x29d686[_0xe874('0x27')][_0xe874('0x6c')]=util['format'](_0xe874('0x6d'),_0x389fbb[_0xe874('0x5d')][_0xe874('0x38')]);_0x29d686[_0xe874('0x27')][_0xe874('0x6e')]=_0xd9a91f['channel'];_0x29d686['message'][_0xe874('0x76')]=_0xe874('0x71');respondWithRpcPromise(_0xe874('0x6f'),_0xe874('0x6f'),{'event':_0xe874('0x77'),'message':_0x29d686[_0xe874('0x27')]},client9002);return _0xd9a91f;}return null;})[_0xe874('0x36')](respondWithResult(_0x4f5af1,null))[_0xe874('0x54')](handleError(_0x4f5af1,null));};exports[_0xe874('0x78')]=function(_0x4e657e,_0x5f2bf6){var _0x218c52;return db['FaxMessage'][_0xe874('0x78')](_0x4e657e['body'],{})['then'](function(_0x4b27ce){_0x218c52=_0x4b27ce;return db[_0xe874('0x5e')]['findOne']({'where':{'id':_0x218c52[_0xe874('0x79')]}});})['then'](function(_0x5415ba){if(_['isNil'](_0x5415ba)){return;}else{_0x218c52[_0xe874('0x72')]=_0x5415ba['fax'];return db[_0xe874('0x7a')][_0xe874('0x7b')]({'where':{'id':_0x218c52[_0xe874('0x7c')]}});}})[_0xe874('0x36')](function(_0x46210e){return respondWithRpcPromise(_0xe874('0x7d'),_0xe874('0x7d'),{'FaxAccountId':_[_0xe874('0x63')](_0x4e657e['body'])?undefined:_0x4e657e[_0xe874('0x56')]['FaxAccountId'],'path':_[_0xe874('0x63')](_0x46210e)?undefined:util[_0xe874('0x65')](_0xe874('0x7e'),_0x46210e[_0xe874('0x7f')]),'fax':_[_0xe874('0x63')](_0x218c52[_0xe874('0x72')])?undefined:_0x218c52[_0xe874('0x72')],'AttachmentId':_0x218c52[_0xe874('0x7c')]},client9002);})[_0xe874('0x36')](respondWithResult(_0x5f2bf6,0xc9))['catch'](handleError(_0x5f2bf6,null));};exports[_0xe874('0x80')]=function(_0x517f08,_0x51f2f9){var _0x4298a0=path[_0xe874('0x81')](config['root'],_0xe874('0x82'),_0xe874('0x83'),_0xe874('0x84'));return db[_0xe874('0x3b')][_0xe874('0x57')]({'where':{'id':_0x517f08[_0xe874('0x58')]['id']},'include':[{'model':db[_0xe874('0x7a')],'as':'Attachment'}]})[_0xe874('0x36')](handleEntityNotFound(_0x51f2f9,null))[_0xe874('0x36')](function(_0x19731a){if(_0x19731a){return _0x51f2f9[_0xe874('0x80')](path[_0xe874('0x81')](_0x4298a0,_0x19731a['Attachment'][_0xe874('0x7f')]));}})[_0xe874('0x54')](handleError(_0x51f2f9,null));}; \ No newline at end of file +var _0xd782=['interface','SIP/%s','channel','event','EventManager','fax-interactions','agent','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','create','findOne','ContactId','SendFax','isNil','/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','root','server','files','attachments','Attachment','join','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.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','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','end','name','send','index','fieldName','key','map','keys','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','FaxMessage','findAll','rows','show','rawAttributes','find','update','body','params','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','FaxInteractionId','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual'];(function(_0x4fa91c,_0x135497){var _0xf0f4bb=function(_0xe80efb){while(--_0xe80efb){_0x4fa91c['push'](_0x4fa91c['shift']());}};_0xf0f4bb(++_0x135497);}(_0xd782,0xa4));var _0x2d78=function(_0xc94429,_0x56d676){_0xc94429=_0xc94429-0x0;var _0x3aad6c=_0xd782[_0xc94429];return _0x3aad6c;};'use strict';var pdf=require(_0x2d78('0x0'));var emlformat=require(_0x2d78('0x1'));var rimraf=require(_0x2d78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2d78('0x3'));var moment=require(_0x2d78('0x4'));var BPromise=require(_0x2d78('0x5'));var Mustache=require(_0x2d78('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2d78('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2d78('0x8'));var squel=require(_0x2d78('0x9'));var crypto=require(_0x2d78('0xa'));var jsforce=require(_0x2d78('0xb'));var deskjs=require(_0x2d78('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d78('0xd'));var Redis=require(_0x2d78('0xe'));var authService=require(_0x2d78('0xf'));var qs=require(_0x2d78('0x10'));var as=require(_0x2d78('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d78('0x12'))(_0x2d78('0x13'));var utils=require('../../config/utils');var config=require(_0x2d78('0x14'));var db=require(_0x2d78('0x15'))['db'];config[_0x2d78('0x16')]=_[_0x2d78('0x17')](config[_0x2d78('0x16')],{'host':_0x2d78('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2d78('0x19'))[_0x2d78('0x1a')](socket);var jayson=require(_0x2d78('0x1b'));var client=jayson[_0x2d78('0x1c')][_0x2d78('0x1d')]({'port':0x232c});var client9002=jayson[_0x2d78('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x1d1ff0,_0x49ddab,_0x3b80e6){if(_0x3b80e6){var _0x4cf909=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cf909['test'](_0x49ddab)){return _0x1d1ff0;}else{throw new db[(_0x2d78('0x1e'))][(_0x2d78('0x1f'))](_0x2d78('0x20'));}}else{return _0x1d1ff0;}}function respondWithRpcPromise(_0x42b459,_0xe9a02a,_0x31ba26,_0x5a49f6){return new BPromise(function(_0x1e185e,_0x135265){var _0x5e1f4b=_0x5a49f6||client;return _0x5e1f4b[_0x2d78('0x21')](_0x42b459,_0x31ba26)[_0x2d78('0x22')](function(_0x30de27){logger['info'](_0x2d78('0x23'),_0xe9a02a,_0x2d78('0x24'));logger[_0x2d78('0x25')](_0x2d78('0x26'),_0xe9a02a,_0x2d78('0x24'),JSON[_0x2d78('0x27')](_0x30de27));if(_0x30de27['error']){if(_0x30de27[_0x2d78('0x28')]['code']===0x1f4){logger[_0x2d78('0x28')](_0x2d78('0x23'),_0xe9a02a,_0x30de27[_0x2d78('0x28')][_0x2d78('0x29')]);return _0x135265(_0x30de27[_0x2d78('0x28')][_0x2d78('0x29')]);}logger[_0x2d78('0x28')](_0x2d78('0x23'),_0xe9a02a,_0x30de27['error'][_0x2d78('0x29')]);return _0x1e185e(_0x30de27[_0x2d78('0x28')][_0x2d78('0x29')]);}else{logger[_0x2d78('0x2a')](_0x2d78('0x23'),_0xe9a02a,'request\x20sent');_0x1e185e(_0x30de27[_0x2d78('0x2b')][_0x2d78('0x29')]);}})[_0x2d78('0x2c')](function(_0x430aec){logger[_0x2d78('0x28')](_0x2d78('0x23'),_0xe9a02a,_0x430aec);_0x135265(_0x430aec);});});}function respondWithStatusCode(_0x19a6c3,_0x3c7b8e){_0x3c7b8e=_0x3c7b8e||0xcc;return function(_0x36915f){if(_0x36915f){return _0x19a6c3[_0x2d78('0x2d')](_0x3c7b8e);}return _0x19a6c3[_0x2d78('0x2e')](_0x3c7b8e)['end']();};}function respondWithResult(_0x59f287,_0x5789db){_0x5789db=_0x5789db||0xc8;return function(_0xb58f56){if(_0xb58f56){return _0x59f287[_0x2d78('0x2e')](_0x5789db)[_0x2d78('0x2f')](_0xb58f56);}};}function respondWithFilteredResult(_0x1af55f,_0x5946b4){return function(_0x11a58b){if(_0x11a58b){var _0x22341e=_0x11a58b[_0x2d78('0x30')],_0x29f84b=_0x5946b4[_0x2d78('0x31')],_0x33534e=_0x5946b4[_0x2d78('0x31')]+_0x5946b4[_0x2d78('0x32')],_0x4a1158;if(_0x33534e>=_0x22341e){_0x33534e=_0x22341e;_0x4a1158=0xc8;}else{_0x4a1158=0xce;}_0x1af55f[_0x2d78('0x2e')](_0x4a1158);return _0x1af55f[_0x2d78('0x33')](_0x2d78('0x34'),_0x29f84b+'-'+_0x33534e+'/'+_0x22341e)[_0x2d78('0x2f')](_0x11a58b);}return null;};}function patchUpdates(_0x5ec945){return function(_0x2e1da2){try{jsonpatch[_0x2d78('0x35')](_0x2e1da2,_0x5ec945,!![]);}catch(_0x288f8e){return BPromise[_0x2d78('0x36')](_0x288f8e);}return _0x2e1da2['save']();};}function saveUpdates(_0xd6a377,_0xd914a8){return function(_0x1a8335){if(_0x1a8335){return _0x1a8335['update'](_0xd6a377)['then'](function(_0x426855){return _0x426855;});}return null;};}function removeEntity(_0x1f06eb,_0x2d9c8c){return function(_0x3fded5){if(_0x3fded5){return _0x3fded5[_0x2d78('0x37')]()[_0x2d78('0x22')](function(){_0x1f06eb['status'](0xcc)[_0x2d78('0x38')]();});}};}function handleEntityNotFound(_0x157959,_0x59e32d){return function(_0x5e76bb){if(!_0x5e76bb){_0x157959[_0x2d78('0x2d')](0x194);}return _0x5e76bb;};}function handleError(_0x4c3f7d,_0x325acd){_0x325acd=_0x325acd||0x1f4;return function(_0x31ea30){logger[_0x2d78('0x28')](_0x31ea30['stack']);if(_0x31ea30[_0x2d78('0x39')]){delete _0x31ea30['name'];}_0x4c3f7d[_0x2d78('0x2e')](_0x325acd)[_0x2d78('0x3a')](_0x31ea30);};}exports[_0x2d78('0x3b')]=function(_0x2a0c56,_0x554f49){var _0x31e205={},_0x39e988={},_0x57dfa1={'count':0x0,'rows':[]};var _0xfadd0e=_['map'](db['FaxMessage']['rawAttributes'],function(_0x7d76ab){return{'name':_0x7d76ab[_0x2d78('0x3c')],'type':_0x7d76ab['type'][_0x2d78('0x3d')]};});_0x39e988['model']=_[_0x2d78('0x3e')](_0xfadd0e,_0x2d78('0x39'));_0x39e988['query']=_[_0x2d78('0x3f')](_0x2a0c56['query']);_0x39e988['filters']=_[_0x2d78('0x40')](_0x39e988[_0x2d78('0x41')],_0x39e988[_0x2d78('0x42')]);_0x31e205[_0x2d78('0x43')]=_['intersection'](_0x39e988['model'],qs[_0x2d78('0x44')](_0x2a0c56[_0x2d78('0x42')][_0x2d78('0x44')]));_0x31e205[_0x2d78('0x43')]=_0x31e205[_0x2d78('0x43')][_0x2d78('0x45')]?_0x31e205[_0x2d78('0x43')]:_0x39e988[_0x2d78('0x41')];if(!_0x2a0c56[_0x2d78('0x42')][_0x2d78('0x46')](_0x2d78('0x47'))){_0x31e205[_0x2d78('0x32')]=qs['limit'](_0x2a0c56[_0x2d78('0x42')][_0x2d78('0x32')]);_0x31e205['offset']=qs['offset'](_0x2a0c56[_0x2d78('0x42')]['offset']);}_0x31e205[_0x2d78('0x48')]=qs[_0x2d78('0x49')](_0x2a0c56[_0x2d78('0x42')]['sort']);_0x31e205[_0x2d78('0x4a')]=qs['filters'](_['pick'](_0x2a0c56['query'],_0x39e988[_0x2d78('0x4b')]),_0xfadd0e);if(_0x2a0c56[_0x2d78('0x42')]['filter']){_0x31e205['where']=_[_0x2d78('0x4c')](_0x31e205[_0x2d78('0x4a')],{'$or':_[_0x2d78('0x3e')](_0xfadd0e,function(_0x45967e){if(_0x45967e[_0x2d78('0x4d')]!==_0x2d78('0x4e')){var _0x33fdc1={};_0x33fdc1[_0x45967e[_0x2d78('0x39')]]={'$like':'%'+_0x2a0c56[_0x2d78('0x42')][_0x2d78('0x4f')]+'%'};return _0x33fdc1;}})});}_0x31e205=_[_0x2d78('0x4c')]({},_0x31e205,_0x2a0c56[_0x2d78('0x50')]);var _0x82fd90={'where':_0x31e205[_0x2d78('0x4a')]};return db['FaxMessage'][_0x2d78('0x30')](_0x82fd90)['then'](function(_0x1ef960){_0x57dfa1[_0x2d78('0x30')]=_0x1ef960;if(_0x2a0c56[_0x2d78('0x42')][_0x2d78('0x51')]){_0x31e205['include']=[{'all':!![]}];}return db[_0x2d78('0x52')][_0x2d78('0x53')](_0x31e205);})[_0x2d78('0x22')](function(_0x4299fe){_0x57dfa1[_0x2d78('0x54')]=_0x4299fe;return _0x57dfa1;})[_0x2d78('0x22')](respondWithFilteredResult(_0x554f49,_0x31e205))[_0x2d78('0x2c')](handleError(_0x554f49,null));};exports[_0x2d78('0x55')]=function(_0x5571bb,_0x15f4ea){var _0x49bdda={'raw':!![],'where':{'id':_0x5571bb['params']['id']}},_0x1be132={};_0x1be132['model']=_[_0x2d78('0x3f')](db[_0x2d78('0x52')][_0x2d78('0x56')]);_0x1be132[_0x2d78('0x42')]=_[_0x2d78('0x3f')](_0x5571bb[_0x2d78('0x42')]);_0x1be132[_0x2d78('0x4b')]=_[_0x2d78('0x40')](_0x1be132['model'],_0x1be132['query']);_0x49bdda[_0x2d78('0x43')]=_[_0x2d78('0x40')](_0x1be132[_0x2d78('0x41')],qs[_0x2d78('0x44')](_0x5571bb[_0x2d78('0x42')][_0x2d78('0x44')]));_0x49bdda[_0x2d78('0x43')]=_0x49bdda[_0x2d78('0x43')]['length']?_0x49bdda['attributes']:_0x1be132[_0x2d78('0x41')];if(_0x5571bb[_0x2d78('0x42')]['includeAll']){_0x49bdda['include']=[{'all':!![]}];}_0x49bdda=_['merge']({},_0x49bdda,_0x5571bb[_0x2d78('0x50')]);return db[_0x2d78('0x52')][_0x2d78('0x57')](_0x49bdda)[_0x2d78('0x22')](handleEntityNotFound(_0x15f4ea,null))[_0x2d78('0x22')](respondWithResult(_0x15f4ea,null))['catch'](handleError(_0x15f4ea,null));};exports[_0x2d78('0x58')]=function(_0x705790,_0x98c5c2){if(_0x705790[_0x2d78('0x59')]['id']){delete _0x705790[_0x2d78('0x59')]['id'];}return db[_0x2d78('0x52')][_0x2d78('0x57')]({'where':{'id':_0x705790[_0x2d78('0x5a')]['id']}})[_0x2d78('0x22')](handleEntityNotFound(_0x98c5c2,null))[_0x2d78('0x22')](saveUpdates(_0x705790[_0x2d78('0x59')],null))[_0x2d78('0x22')](respondWithResult(_0x98c5c2,null))[_0x2d78('0x2c')](handleError(_0x98c5c2,null));};exports[_0x2d78('0x37')]=function(_0x58ec56,_0x1d7904){return db[_0x2d78('0x52')][_0x2d78('0x57')]({'where':{'id':_0x58ec56['params']['id']}})[_0x2d78('0x22')](handleEntityNotFound(_0x1d7904,null))['then'](removeEntity(_0x1d7904,null))['catch'](handleError(_0x1d7904,null));};exports[_0x2d78('0x5b')]=function(_0x2b2baf,_0x5ef852){return db[_0x2d78('0x52')][_0x2d78('0x5b')]()[_0x2d78('0x22')](respondWithResult(_0x5ef852,null))['catch'](handleError(_0x5ef852,null));};var interaction_log=require(_0x2d78('0x12'))('fax-interactions');exports[_0x2d78('0x5c')]=function(_0x1be9b4,_0x2a0b6a,_0x4ee663){var _0xc60c6d={'channel':_0x2d78('0x5d')};if(_0x1be9b4['body']['id']){delete _0x1be9b4['body']['id'];}_0x1be9b4[_0x2d78('0x59')][_0x2d78('0x5e')]=!![];_0x1be9b4[_0x2d78('0x59')][_0x2d78('0x5f')]=moment()[_0x2d78('0x60')](_0x2d78('0x61'));_0x1be9b4[_0x2d78('0x59')]['UserId']=_0x1be9b4['body'][_0x2d78('0x62')]||_0x1be9b4[_0x2d78('0x63')]['id'];return db[_0x2d78('0x52')][_0x2d78('0x57')]({'where':{'id':_0x1be9b4['params']['id'],'UserId':null},'include':[{'model':db[_0x2d78('0x64')],'as':_0x2d78('0x65')}]})[_0x2d78('0x22')](handleEntityNotFound(_0x2a0b6a,null))[_0x2d78('0x22')](saveUpdates(_0x1be9b4['body'],null))[_0x2d78('0x22')](function(_0xb20d05){if(_0xb20d05){_0xc60c6d['message']=_0xb20d05[_0x2d78('0x66')]({'plain':!![]});return db['FaxInteraction'][_0x2d78('0x57')]({'where':{'id':_0xb20d05[_0x2d78('0x67')]}});}return null;})[_0x2d78('0x22')](handleEntityNotFound(_0x2a0b6a,null))[_0x2d78('0x22')](function(_0x155f92){if(_0x155f92){return _0x155f92['update']({'UserId':_0x1be9b4[_0x2d78('0x59')][_0x2d78('0x62')],'read1stAt':_['isNil'](_0x155f92[_0x2d78('0x68')])?moment()[_0x2d78('0x60')](_0x2d78('0x61')):undefined});}return null;})[_0x2d78('0x22')](function(_0x490e13){if(_0x490e13){_0xc60c6d['interaction']=_0x490e13['get']({'plain':!![]});interaction_log['info'](_0x2d78('0x69'),_0x1be9b4['user']['id'],_0x1be9b4[_0x2d78('0x63')]['name'],_0x1be9b4[_0x2d78('0x63')][_0x2d78('0x6a')],_0xc60c6d[_0x2d78('0x6b')]['id'],_0x1be9b4[_0x2d78('0x59')]?JSON['stringify'](_0x1be9b4[_0x2d78('0x59')]):_0x2d78('0x6c'));return respondWithRpcPromise(_0x2d78('0x6d'),_0x2d78('0x6e'),_0xc60c6d);}return null;})[_0x2d78('0x22')](function(_0x1461a2){if(_0x1461a2){if(_0x1be9b4[_0x2d78('0x59')][_0x2d78('0x6f')]){_0xc60c6d[_0x2d78('0x29')][_0x2d78('0x70')]=util[_0x2d78('0x60')](_0x2d78('0x71'),_0x1be9b4[_0x2d78('0x63')]['name']);_0xc60c6d[_0x2d78('0x29')]['channel']=_0xc60c6d[_0x2d78('0x72')];_0xc60c6d[_0x2d78('0x29')][_0x2d78('0x73')]=_0x2d78('0x5c');return respondWithRpcPromise(_0x2d78('0x74'),_0x2d78('0x74'),{'event':'acceptmessage','message':_0xc60c6d[_0x2d78('0x29')]},client9002)['then'](function(){return _0xc60c6d;});}return _0xc60c6d;}return null;})[_0x2d78('0x22')](respondWithResult(_0x2a0b6a,null))['catch'](handleError(_0x2a0b6a,null));};var interaction_log=require(_0x2d78('0x12'))(_0x2d78('0x75'));exports['reject']=function(_0x5ef632,_0x190225,_0x42b618){var _0x4ca2c8={'agent':{},'channel':_0x2d78('0x5d')};if(_0x5ef632[_0x2d78('0x59')]['id']){delete _0x5ef632[_0x2d78('0x59')]['id'];}_0x5ef632[_0x2d78('0x59')][_0x2d78('0x62')]=_0x5ef632[_0x2d78('0x59')][_0x2d78('0x62')]||_0x5ef632[_0x2d78('0x63')]['id'];_0x4ca2c8[_0x2d78('0x76')]['id']=_0x5ef632[_0x2d78('0x59')][_0x2d78('0x62')];return db[_0x2d78('0x52')][_0x2d78('0x57')]({'where':{'id':_0x5ef632[_0x2d78('0x5a')]['id'],'UserId':null}})[_0x2d78('0x22')](handleEntityNotFound(_0x190225,null))['then'](function(_0x30f89d){if(_0x30f89d){_0x4ca2c8['message']=_0x30f89d['get']({'plain':!![]});return db[_0x2d78('0x77')]['find']({'where':{'id':_0x30f89d[_0x2d78('0x67')]}});}return null;})[_0x2d78('0x22')](handleEntityNotFound(_0x190225,null))[_0x2d78('0x22')](function(_0x4d15e2){if(_0x4d15e2){_0x4ca2c8[_0x2d78('0x6b')]=_0x4d15e2[_0x2d78('0x66')]({'plain':!![]});interaction_log[_0x2d78('0x2a')](_0x2d78('0x78'),_0x5ef632[_0x2d78('0x63')]['id'],_0x5ef632['user'][_0x2d78('0x39')],_0x5ef632['user'][_0x2d78('0x6a')],_0x4ca2c8[_0x2d78('0x6b')]['id'],_0x5ef632['body']?JSON[_0x2d78('0x27')](_0x5ef632[_0x2d78('0x59')]):_0x2d78('0x6c'));return respondWithRpcPromise(_0x2d78('0x79'),'rejectMessage',_0x4ca2c8);}return null;})[_0x2d78('0x22')](function(_0x29593e){if(_0x29593e){_0x29593e[_0x2d78('0x29')][_0x2d78('0x70')]=util[_0x2d78('0x60')](_0x2d78('0x71'),_0x5ef632['user'][_0x2d78('0x39')]);_0x29593e[_0x2d78('0x29')][_0x2d78('0x72')]=_0x4ca2c8[_0x2d78('0x72')];_0x29593e['message']['event']=_0x2d78('0x36');respondWithRpcPromise(_0x2d78('0x74'),'EventManager',{'event':_0x2d78('0x7a'),'message':_0x29593e[_0x2d78('0x29')]},client9002);return _0x4ca2c8;}return null;})[_0x2d78('0x22')](respondWithResult(_0x190225,null))[_0x2d78('0x2c')](handleError(_0x190225,null));};exports[_0x2d78('0x7b')]=function(_0x58d3eb,_0x54348f){var _0x2bb11f;return db[_0x2d78('0x52')]['create'](_0x58d3eb[_0x2d78('0x59')],{})['then'](function(_0x44fd6c){_0x2bb11f=_0x44fd6c;return db[_0x2d78('0x64')][_0x2d78('0x7c')]({'where':{'id':_0x2bb11f[_0x2d78('0x7d')]}});})['then'](function(_0x12b7f8){if(_['isNil'](_0x12b7f8)){return;}else{_0x2bb11f[_0x2d78('0x5d')]=_0x12b7f8[_0x2d78('0x5d')];return db['Attachment'][_0x2d78('0x7c')]({'where':{'id':_0x2bb11f['AttachmentId']}});}})[_0x2d78('0x22')](function(_0xf9274){return respondWithRpcPromise(_0x2d78('0x7e'),_0x2d78('0x7e'),{'FaxAccountId':_[_0x2d78('0x7f')](_0x58d3eb[_0x2d78('0x59')])?undefined:_0x58d3eb[_0x2d78('0x59')]['FaxAccountId'],'path':_[_0x2d78('0x7f')](_0xf9274)?undefined:util[_0x2d78('0x60')](_0x2d78('0x80'),_0xf9274[_0x2d78('0x81')]),'fax':_['isNil'](_0x2bb11f['fax'])?undefined:_0x2bb11f[_0x2d78('0x5d')],'AttachmentId':_0x2bb11f[_0x2d78('0x82')]},client9002);})[_0x2d78('0x22')](respondWithResult(_0x54348f,0xc9))[_0x2d78('0x2c')](handleError(_0x54348f,null));};exports[_0x2d78('0x83')]=function(_0x92adc4,_0x41619e){var _0x3d117f=path['join'](config[_0x2d78('0x84')],_0x2d78('0x85'),_0x2d78('0x86'),_0x2d78('0x87'));return db['FaxMessage'][_0x2d78('0x57')]({'where':{'id':_0x92adc4['params']['id']},'include':[{'model':db[_0x2d78('0x88')],'as':'Attachment'}]})[_0x2d78('0x22')](handleEntityNotFound(_0x41619e,null))[_0x2d78('0x22')](function(_0x271bec){if(_0x271bec){return _0x41619e[_0x2d78('0x83')](path[_0x2d78('0x89')](_0x3d117f,_0x271bec[_0x2d78('0x88')][_0x2d78('0x81')]));}})[_0x2d78('0x2c')](handleError(_0x41619e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e227083..c9842b9 100644 --- a/server/api/faxMessage/faxMessage.events.js +++ b/server/api/faxMessage/faxMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x36241a,_0x484a39){var _0x3ce5ba=function(_0x19a35a){while(--_0x19a35a){_0x36241a['push'](_0x36241a['shift']());}};_0x3ce5ba(++_0x484a39);}(_0x008c,0x188));var _0xc008=function(_0x14e65e,_0x461afd){_0x14e65e=_0x14e65e-0x0;var _0x4774a1=_0x008c[_0x14e65e];return _0x4774a1;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x4492a7,_0x34d6ad){var _0x523950=function(_0x1312d6){while(--_0x1312d6){_0x4492a7['push'](_0x4492a7['shift']());}};_0x523950(++_0x34d6ad);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index b5fe5d7..c6a9de6 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 _0x7aa9=['findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','FaxInteraction'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7aa9,0x19c));var _0x97aa=function(_0x244f5d,_0x3c98c6){_0x244f5d=_0x244f5d-0x0;var _0x1a3886=_0x7aa9[_0x244f5d];return _0x1a3886;};'use strict';var _=require(_0x97aa('0x0'));var util=require('util');var logger=require(_0x97aa('0x1'))(_0x97aa('0x2'));var moment=require(_0x97aa('0x3'));var BPromise=require(_0x97aa('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97aa('0x5'));var rimraf=require(_0x97aa('0x6'));var config=require(_0x97aa('0x7'));var attributes=require(_0x97aa('0x8'));module['exports']=function(_0x1a36d9,_0xf1b258){return _0x1a36d9[_0x97aa('0x9')](_0x97aa('0xa'),attributes,{'tableName':_0x97aa('0xb'),'paranoid':![],'indexes':[{'name':_0x97aa('0xc'),'fields':['body'],'type':_0x97aa('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e3f02,_0x3ef4ff,_0x228ba8){var _0x335e8f=_0x1a36d9[_0x97aa('0xe')];var _0x36a436=_0x2e3f02[_0x97aa('0xf')]({'plain':!![]});if(_0x36a436[_0x97aa('0x10')][_0x97aa('0x11')]()==='in'||_0x36a436[_0x97aa('0x10')]['toLowerCase']()==='out'&&!_0x36a436[_0x97aa('0x12')]&&!_[_0x97aa('0x13')](_0x36a436[_0x97aa('0x14')])){_0x335e8f[_0x97aa('0x15')][_0x97aa('0x16')]({'where':{'id':_0x36a436[_0x97aa('0x17')]}})[_0x97aa('0x18')](function(_0x21b03b){if(_0x21b03b){_0x21b03b[_0x97aa('0x19')]({'lastMsgAt':_0x36a436[_0x97aa('0x1a')],'lastMsgDirection':_0x36a436[_0x97aa('0x10')][_0x97aa('0x11')]()});}})[_0x97aa('0x1b')](function(_0x3d5187){console[_0x97aa('0x1c')](_0x3d5187);});}_0x228ba8();}},'charset':_0x97aa('0x1d'),'collate':_0x97aa('0x1e')});}; \ No newline at end of file +var _0xbb72=['out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x3330a1,_0x559d05){var _0x2004d1=function(_0x24d02e){while(--_0x24d02e){_0x3330a1['push'](_0x3330a1['shift']());}};_0x2004d1(++_0x559d05);}(_0xbb72,0x123));var _0x2bb7=function(_0x4498cd,_0x437daa){_0x4498cd=_0x4498cd-0x0;var _0xa2bec1=_0xbb72[_0x4498cd];return _0xa2bec1;};'use strict';var _=require(_0x2bb7('0x0'));var util=require(_0x2bb7('0x1'));var logger=require('../../config/logger')(_0x2bb7('0x2'));var moment=require(_0x2bb7('0x3'));var BPromise=require('bluebird');var rp=require(_0x2bb7('0x4'));var fs=require('fs');var path=require(_0x2bb7('0x5'));var rimraf=require('rimraf');var config=require(_0x2bb7('0x6'));var attributes=require(_0x2bb7('0x7'));module[_0x2bb7('0x8')]=function(_0x4fd9ad,_0x36730b){return _0x4fd9ad[_0x2bb7('0x9')](_0x2bb7('0xa'),attributes,{'tableName':_0x2bb7('0xb'),'paranoid':![],'indexes':[{'name':_0x2bb7('0xc'),'fields':[_0x2bb7('0xd')],'type':_0x2bb7('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4452d2,_0x453f15,_0x5dec47){var _0x2f3713=_0x4fd9ad[_0x2bb7('0xf')];var _0x527449=_0x4452d2[_0x2bb7('0x10')]({'plain':!![]});if(_0x527449[_0x2bb7('0x11')][_0x2bb7('0x12')]()==='in'||_0x527449[_0x2bb7('0x11')][_0x2bb7('0x12')]()===_0x2bb7('0x13')&&!_0x527449['secret']&&!_[_0x2bb7('0x14')](_0x527449[_0x2bb7('0x15')])){_0x2f3713[_0x2bb7('0x16')][_0x2bb7('0x17')]({'where':{'id':_0x527449[_0x2bb7('0x18')]}})['then'](function(_0xd9e525){if(_0xd9e525){_0xd9e525[_0x2bb7('0x19')]({'lastMsgAt':_0x527449[_0x2bb7('0x1a')],'lastMsgDirection':_0x527449[_0x2bb7('0x11')][_0x2bb7('0x12')]()});}})[_0x2bb7('0x1b')](function(_0x4d9f8e){console[_0x2bb7('0x1c')](_0x4d9f8e);});}_0x5dec47();}},'charset':_0x2bb7('0x1d'),'collate':_0x2bb7('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b644689..0f81282 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 _0x58a3=['CreateFaxMessage','FaxMessage','options','raw','UpdateFaxMessage','body','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x1d9cbc,_0x59d49c){var _0x500316=function(_0x162a70){while(--_0x162a70){_0x1d9cbc['push'](_0x1d9cbc['shift']());}};_0x500316(++_0x59d49c);}(_0x58a3,0xac));var _0x358a=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x58a3[_0x1460f6];return _0x46ce94;};'use strict';var _=require('lodash');var util=require(_0x358a('0x0'));var moment=require('moment');var BPromise=require(_0x358a('0x1'));var rs=require(_0x358a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x358a('0x3'));var logger=require(_0x358a('0x4'))(_0x358a('0x5'));var config=require(_0x358a('0x6'));var jayson=require(_0x358a('0x7'));var client=jayson[_0x358a('0x8')][_0x358a('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x358a('0xa')],{'host':_0x358a('0xb'),'port':0x18eb});var socket=require(_0x358a('0xc'))(new Redis(config['redis']));require(_0x358a('0xd'))[_0x358a('0xe')](socket);function respondWithRpcPromise(_0x1e838c,_0x20dadc,_0x311c7d){return new BPromise(function(_0x219063,_0x38b650){return client[_0x358a('0xf')](_0x1e838c,_0x311c7d)[_0x358a('0x10')](function(_0xb075ef){logger['info'](_0x358a('0x11'),_0x20dadc,_0x358a('0x12'));logger[_0x358a('0x13')](_0x358a('0x14'),_0x20dadc,'request\x20sent',JSON[_0x358a('0x15')](_0xb075ef));if(_0xb075ef[_0x358a('0x16')]){if(_0xb075ef['error']['code']===0x1f4){logger[_0x358a('0x16')](_0x358a('0x11'),_0x20dadc,_0xb075ef[_0x358a('0x16')][_0x358a('0x17')]);return _0x38b650(_0xb075ef[_0x358a('0x16')][_0x358a('0x17')]);}logger[_0x358a('0x16')](_0x358a('0x11'),_0x20dadc,_0xb075ef['error'][_0x358a('0x17')]);return _0x219063(_0xb075ef['error'][_0x358a('0x17')]);}else{logger[_0x358a('0x18')](_0x358a('0x11'),_0x20dadc,'request\x20sent');_0x219063(_0xb075ef[_0x358a('0x19')][_0x358a('0x17')]);}})['catch'](function(_0x1fe5e1){logger[_0x358a('0x16')](_0x358a('0x11'),_0x20dadc,_0x1fe5e1);_0x38b650(_0x1fe5e1);});});}exports[_0x358a('0x1a')]=function(_0x3f8536){var _0x13f858=this;return new Promise(function(_0x14ac52,_0x3ae2a9){return db[_0x358a('0x1b')]['create'](_0x3f8536['body'],{'raw':_0x3f8536[_0x358a('0x1c')]?_0x3f8536['options'][_0x358a('0x1d')]===undefined?!![]:![]:!![]})[_0x358a('0x10')](function(_0x5668e1){logger[_0x358a('0x18')](_0x358a('0x1a'),_0x3f8536);logger[_0x358a('0x13')](_0x358a('0x1a'),_0x3f8536,JSON['stringify'](_0x5668e1));_0x14ac52(_0x5668e1);})['catch'](function(_0x4e2b7d){logger[_0x358a('0x16')]('CreateFaxMessage',_0x4e2b7d[_0x358a('0x17')],_0x3f8536);_0x3ae2a9(_0x13f858['error'](0x1f4,_0x4e2b7d[_0x358a('0x17')]));});});};exports[_0x358a('0x1e')]=function(_0x42f976){var _0x42c995=this;return new Promise(function(_0x47a2c4,_0x5c8fa6){return db['FaxMessage']['update'](_0x42f976[_0x358a('0x1f')],{'raw':_0x42f976[_0x358a('0x1c')]?_0x42f976[_0x358a('0x1c')][_0x358a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42f976[_0x358a('0x1c')]?_0x42f976['options']['where']||null:null,'attributes':_0x42f976[_0x358a('0x1c')]?_0x42f976[_0x358a('0x1c')]['attributes']||null:null,'limit':_0x42f976[_0x358a('0x1c')]?_0x42f976[_0x358a('0x1c')]['limit']||null:null})[_0x358a('0x10')](function(_0x14a244){logger['info']('UpdateFaxMessage',_0x42f976);logger['debug'](_0x358a('0x1e'),_0x42f976,JSON[_0x358a('0x15')](_0x14a244));_0x47a2c4(_0x14a244);})[_0x358a('0x20')](function(_0x45a106){logger[_0x358a('0x16')]('UpdateFaxMessage',_0x45a106[_0x358a('0x17')],_0x42f976);_0x5c8fa6(_0x42c995[_0x358a('0x16')](0x1f4,_0x45a106[_0x358a('0x17')]));});});}; \ No newline at end of file +var _0x403c=['FaxMessage','body','raw','UpdateFaxMessage','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','register','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','FaxMessage,\x20%s,\x20%s','message','result','catch','CreateFaxMessage'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x403c,0x112));var _0xc403=function(_0x39289c,_0x127635){_0x39289c=_0x39289c-0x0;var _0x2736a9=_0x403c[_0x39289c];return _0x2736a9;};'use strict';var _=require(_0xc403('0x0'));var util=require(_0xc403('0x1'));var moment=require(_0xc403('0x2'));var BPromise=require(_0xc403('0x3'));var rs=require(_0xc403('0x4'));var fs=require('fs');var Redis=require(_0xc403('0x5'));var db=require(_0xc403('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc403('0x7'))(_0xc403('0x8'));var config=require(_0xc403('0x9'));var jayson=require(_0xc403('0xa'));var client=jayson[_0xc403('0xb')][_0xc403('0xc')]({'port':0x232a});config[_0xc403('0xd')]=_[_0xc403('0xe')](config['redis'],{'host':_0xc403('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc403('0x10'))[_0xc403('0x11')](socket);function respondWithRpcPromise(_0xace1e7,_0x5ca2c1,_0x5db74e){return new BPromise(function(_0xdbf5ad,_0x43231f){return client['request'](_0xace1e7,_0x5db74e)[_0xc403('0x12')](function(_0x1bcac7){logger[_0xc403('0x13')]('FaxMessage,\x20%s,\x20%s',_0x5ca2c1,_0xc403('0x14'));logger[_0xc403('0x15')](_0xc403('0x16'),_0x5ca2c1,_0xc403('0x14'),JSON[_0xc403('0x17')](_0x1bcac7));if(_0x1bcac7[_0xc403('0x18')]){if(_0x1bcac7['error']['code']===0x1f4){logger['error'](_0xc403('0x19'),_0x5ca2c1,_0x1bcac7['error'][_0xc403('0x1a')]);return _0x43231f(_0x1bcac7[_0xc403('0x18')][_0xc403('0x1a')]);}logger[_0xc403('0x18')](_0xc403('0x19'),_0x5ca2c1,_0x1bcac7[_0xc403('0x18')][_0xc403('0x1a')]);return _0xdbf5ad(_0x1bcac7[_0xc403('0x18')][_0xc403('0x1a')]);}else{logger[_0xc403('0x13')](_0xc403('0x19'),_0x5ca2c1,_0xc403('0x14'));_0xdbf5ad(_0x1bcac7[_0xc403('0x1b')][_0xc403('0x1a')]);}})[_0xc403('0x1c')](function(_0x4e5de9){logger[_0xc403('0x18')](_0xc403('0x19'),_0x5ca2c1,_0x4e5de9);_0x43231f(_0x4e5de9);});});}exports[_0xc403('0x1d')]=function(_0x428468){var _0x152850=this;return new Promise(function(_0x5335ac,_0x563b0e){return db[_0xc403('0x1e')]['create'](_0x428468[_0xc403('0x1f')],{'raw':_0x428468['options']?_0x428468['options'][_0xc403('0x20')]===undefined?!![]:![]:!![]})[_0xc403('0x12')](function(_0x2cf582){logger['info'](_0xc403('0x1d'),_0x428468);logger[_0xc403('0x15')](_0xc403('0x1d'),_0x428468,JSON[_0xc403('0x17')](_0x2cf582));_0x5335ac(_0x2cf582);})['catch'](function(_0x4c37e7){logger[_0xc403('0x18')]('CreateFaxMessage',_0x4c37e7[_0xc403('0x1a')],_0x428468);_0x563b0e(_0x152850[_0xc403('0x18')](0x1f4,_0x4c37e7[_0xc403('0x1a')]));});});};exports[_0xc403('0x21')]=function(_0x503176){var _0xfd6012=this;return new Promise(function(_0x3c2a14,_0xd856c5){return db[_0xc403('0x1e')][_0xc403('0x22')](_0x503176['body'],{'raw':_0x503176['options']?_0x503176['options'][_0xc403('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x503176[_0xc403('0x23')]?_0x503176[_0xc403('0x23')][_0xc403('0x24')]||null:null,'attributes':_0x503176[_0xc403('0x23')]?_0x503176[_0xc403('0x23')][_0xc403('0x25')]||null:null,'limit':_0x503176[_0xc403('0x23')]?_0x503176[_0xc403('0x23')]['limit']||null:null})[_0xc403('0x12')](function(_0x39c563){logger['info'](_0xc403('0x21'),_0x503176);logger[_0xc403('0x15')](_0xc403('0x21'),_0x503176,JSON[_0xc403('0x17')](_0x39c563));_0x3c2a14(_0x39c563);})[_0xc403('0x1c')](function(_0x341809){logger[_0xc403('0x18')](_0xc403('0x21'),_0x341809[_0xc403('0x1a')],_0x503176);_0xd856c5(_0xfd6012[_0xc403('0x18')](0x1f4,_0x341809['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 092b2fd..b610ba4 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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 96c253d..5aefead 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 _0xee4e=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','/:id','/:id/download','post','tracked','fax','faxmessage:create','put','update','accept','/:id/reject'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xee4e,0x122));var _0xeee4=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xee4e[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var path=require(_0xeee4('0x2'));var timeout=require('connect-timeout');var express=require(_0xeee4('0x3'));var router=express[_0xeee4('0x4')]();var auth=require(_0xeee4('0x5'));var interaction=require(_0xeee4('0x6'));var config=require(_0xeee4('0x7'));var controller=require(_0xeee4('0x8'));router[_0xeee4('0x9')]('/',auth[_0xeee4('0xa')](),controller['index']);router[_0xeee4('0x9')](_0xeee4('0xb'),auth[_0xeee4('0xa')](),controller['describe']);router[_0xeee4('0x9')](_0xeee4('0xc'),auth[_0xeee4('0xa')](),controller['show']);router[_0xeee4('0x9')](_0xeee4('0xd'),auth[_0xeee4('0xa')](),controller['download']);router[_0xeee4('0xe')]('/',auth['isAuthenticated'](),interaction[_0xeee4('0xf')](_0xeee4('0x10'),_0xeee4('0x11')),controller['create']);router[_0xeee4('0x12')](_0xeee4('0xc'),auth[_0xeee4('0xa')](),controller[_0xeee4('0x13')]);router['put']('/:id/accept',auth[_0xeee4('0xa')](),controller[_0xeee4('0x14')]);router[_0xeee4('0x12')](_0xeee4('0x15'),auth[_0xeee4('0xa')](),controller['reject']);router['delete'](_0xeee4('0xc'),auth[_0xeee4('0xa')](),controller[_0xeee4('0x16')]);module[_0xeee4('0x17')]=router; \ No newline at end of file +var _0xdd8e=['update','/:id/accept','/:id/reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','download','post','tracked','fax','faxmessage:create','put'];(function(_0xd097d3,_0x2d6030){var _0x22f399=function(_0x42be13){while(--_0x42be13){_0xd097d3['push'](_0xd097d3['shift']());}};_0x22f399(++_0x2d6030);}(_0xdd8e,0x1f4));var _0xedd8=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xdd8e[_0x376db5];return _0x304c17;};'use strict';var multer=require(_0xedd8('0x0'));var util=require('util');var path=require(_0xedd8('0x1'));var timeout=require(_0xedd8('0x2'));var express=require(_0xedd8('0x3'));var router=express[_0xedd8('0x4')]();var auth=require(_0xedd8('0x5'));var interaction=require(_0xedd8('0x6'));var config=require(_0xedd8('0x7'));var controller=require(_0xedd8('0x8'));router[_0xedd8('0x9')]('/',auth[_0xedd8('0xa')](),controller[_0xedd8('0xb')]);router[_0xedd8('0x9')](_0xedd8('0xc'),auth[_0xedd8('0xa')](),controller['describe']);router[_0xedd8('0x9')](_0xedd8('0xd'),auth[_0xedd8('0xa')](),controller['show']);router[_0xedd8('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xedd8('0xe')]);router[_0xedd8('0xf')]('/',auth[_0xedd8('0xa')](),interaction[_0xedd8('0x10')](_0xedd8('0x11'),_0xedd8('0x12')),controller['create']);router[_0xedd8('0x13')](_0xedd8('0xd'),auth['isAuthenticated'](),controller[_0xedd8('0x14')]);router[_0xedd8('0x13')](_0xedd8('0x15'),auth[_0xedd8('0xa')](),controller['accept']);router[_0xedd8('0x13')](_0xedd8('0x16'),auth[_0xedd8('0xa')](),controller['reject']);router[_0xedd8('0x17')](_0xedd8('0xd'),auth[_0xedd8('0xa')](),controller[_0xedd8('0x18')]);module[_0xedd8('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index d5b1e47..a331a0d 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 _0x4d88=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x20f68e,_0xc7c7ec){var _0x3c37a8=function(_0xc4d1d8){while(--_0xc4d1d8){_0x20f68e['push'](_0x20f68e['shift']());}};_0x3c37a8(++_0xc7c7ec);}(_0x4d88,0x195));var _0x84d8=function(_0x86794c,_0x5df4b0){_0x86794c=_0x86794c-0x0;var _0x2ea7a8=_0x4d88[_0x86794c];return _0x2ea7a8;};'use strict';var Sequelize=require(_0x84d8('0x0'));module[_0x84d8('0x1')]={'name':{'type':Sequelize[_0x84d8('0x2')],'unique':_0x84d8('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x84d8('0x2')]},'timeout':{'type':Sequelize[_0x84d8('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x84d8('0x5')](_0x84d8('0x6'),_0x84d8('0x7'),_0x84d8('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x84d8('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7501=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x331085,_0x46ef3b){var _0x1547f4=function(_0x549b5d){while(--_0x549b5d){_0x331085['push'](_0x331085['shift']());}};_0x1547f4(++_0x46ef3b);}(_0x7501,0xcc));var _0x1750=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x7501[_0x231e16];return _0x570a7c;};'use strict';var Sequelize=require(_0x1750('0x0'));module[_0x1750('0x1')]={'name':{'type':Sequelize[_0x1750('0x2')],'unique':_0x1750('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1750('0x2')]},'timeout':{'type':Sequelize[_0x1750('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1750('0x5')]('rrmemory',_0x1750('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x1750('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 41018dd..35956c8 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 _0x0993=['../../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','./faxQueue.socket','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','FaxQueues','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','pick','FaxQueueId','UserFaxQueue','User','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','interface','transaction','each','forEach','emit','userFaxQueue:save','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','union','compact','removeTeams','removeAgents','addAgents','omit','spread','userFaxQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x5de42f,_0x71db9a){var _0x5c7df7=function(_0x4c4af){while(--_0x4c4af){_0x5de42f['push'](_0x5de42f['shift']());}};_0x5c7df7(++_0x71db9a);}(_0x0993,0x81));var _0x3099=function(_0x43ca37,_0x5f3441){_0x43ca37=_0x43ca37-0x0;var _0x3de945=_0x0993[_0x43ca37];return _0x3de945;};'use strict';var pdf=require(_0x3099('0x0'));var emlformat=require(_0x3099('0x1'));var rimraf=require(_0x3099('0x2'));var zipdir=require(_0x3099('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3099('0x4'));var moment=require(_0x3099('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3099('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3099('0x7'));var csv=require(_0x3099('0x8'));var ejs=require(_0x3099('0x9'));var fs=require('fs');var _=require(_0x3099('0xa'));var squel=require(_0x3099('0xb'));var crypto=require(_0x3099('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3099('0xd'));var toCsv=require(_0x3099('0x8'));var querystring=require(_0x3099('0xe'));var Papa=require('papaparse');var Redis=require(_0x3099('0xf'));var authService=require(_0x3099('0x10'));var qs=require(_0x3099('0x11'));var as=require(_0x3099('0x12'));var hardwareService=require(_0x3099('0x13'));var logger=require(_0x3099('0x14'))(_0x3099('0x15'));var utils=require(_0x3099('0x16'));var config=require(_0x3099('0x17'));var db=require(_0x3099('0x18'))['db'];config[_0x3099('0x19')]=_[_0x3099('0x1a')](config['redis'],{'host':_0x3099('0x1b'),'port':0x18eb});var socket=require(_0x3099('0x1c'))(new Redis(config[_0x3099('0x19')]));require(_0x3099('0x1d'))['register'](socket);function respondWithStatusCode(_0x3c0020,_0x34ec5f){_0x34ec5f=_0x34ec5f||0xcc;return function(_0x1d236c){if(_0x1d236c){return _0x3c0020[_0x3099('0x1e')](_0x34ec5f);}return _0x3c0020[_0x3099('0x1f')](_0x34ec5f)[_0x3099('0x20')]();};}function respondWithResult(_0x5bd441,_0x137a51){_0x137a51=_0x137a51||0xc8;return function(_0x52c603){if(_0x52c603){return _0x5bd441[_0x3099('0x1f')](_0x137a51)['json'](_0x52c603);}};}function respondWithFilteredResult(_0x5ecbf8,_0x1bbe3c){return function(_0x49fec9){if(_0x49fec9){var _0x17e705=_0x49fec9[_0x3099('0x21')],_0x483875=_0x1bbe3c[_0x3099('0x22')],_0x392a42=_0x1bbe3c[_0x3099('0x22')]+_0x1bbe3c[_0x3099('0x23')],_0x22e129;if(_0x392a42>=_0x17e705){_0x392a42=_0x17e705;_0x22e129=0xc8;}else{_0x22e129=0xce;}_0x5ecbf8[_0x3099('0x1f')](_0x22e129);return _0x5ecbf8[_0x3099('0x24')]('Content-Range',_0x483875+'-'+_0x392a42+'/'+_0x17e705)[_0x3099('0x25')](_0x49fec9);}return null;};}function patchUpdates(_0x4d739d){return function(_0x156269){try{jsonpatch[_0x3099('0x26')](_0x156269,_0x4d739d,!![]);}catch(_0x22b881){return BPromise[_0x3099('0x27')](_0x22b881);}return _0x156269[_0x3099('0x28')]();};}function saveUpdates(_0x2137ee,_0x5cbf7f){return function(_0x2b0ad2){if(_0x2b0ad2){return _0x2b0ad2[_0x3099('0x29')](_0x2137ee)[_0x3099('0x2a')](function(_0x321b8e){return _0x321b8e;});}return null;};}function removeEntity(_0xf2e5fa,_0x357e54){return function(_0x34d657){if(_0x34d657){return _0x34d657[_0x3099('0x2b')]()[_0x3099('0x2a')](function(){var _0x5e510d=_0x34d657['get']({'plain':!![]});var _0x576c47=_0x3099('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x576c47,'resourceId':_0x5e510d['id']}})[_0x3099('0x2a')](function(){return _0x34d657;});})['then'](function(){_0xf2e5fa[_0x3099('0x1f')](0xcc)[_0x3099('0x20')]();});}};}function handleEntityNotFound(_0x4d3a9e,_0x3e9f4c){return function(_0x1d611f){if(!_0x1d611f){_0x4d3a9e['sendStatus'](0x194);}return _0x1d611f;};}function handleError(_0xf18a1e,_0x4f3678){_0x4f3678=_0x4f3678||0x1f4;return function(_0x5a451f){logger[_0x3099('0x2d')](_0x5a451f[_0x3099('0x2e')]);if(_0x5a451f[_0x3099('0x2f')]){delete _0x5a451f[_0x3099('0x2f')];}_0xf18a1e['status'](_0x4f3678)[_0x3099('0x30')](_0x5a451f);};}exports[_0x3099('0x31')]=function(_0x8639d8,_0xa70827){var _0x5a8912={},_0x431f8f={},_0x5e5604={'count':0x0,'rows':[]};var _0x368250=_[_0x3099('0x32')](db[_0x3099('0x33')][_0x3099('0x34')],function(_0x4c98c5){return{'name':_0x4c98c5[_0x3099('0x35')],'type':_0x4c98c5['type'][_0x3099('0x36')]};});_0x431f8f['model']=_[_0x3099('0x32')](_0x368250,_0x3099('0x2f'));_0x431f8f[_0x3099('0x37')]=_[_0x3099('0x38')](_0x8639d8['query']);_0x431f8f[_0x3099('0x39')]=_[_0x3099('0x3a')](_0x431f8f[_0x3099('0x3b')],_0x431f8f[_0x3099('0x37')]);_0x5a8912[_0x3099('0x3c')]=_[_0x3099('0x3a')](_0x431f8f[_0x3099('0x3b')],qs[_0x3099('0x3d')](_0x8639d8[_0x3099('0x37')][_0x3099('0x3d')]));_0x5a8912[_0x3099('0x3c')]=_0x5a8912['attributes'][_0x3099('0x3e')]?_0x5a8912['attributes']:_0x431f8f[_0x3099('0x3b')];if(!_0x8639d8[_0x3099('0x37')][_0x3099('0x3f')](_0x3099('0x40'))){_0x5a8912[_0x3099('0x23')]=qs[_0x3099('0x23')](_0x8639d8[_0x3099('0x37')][_0x3099('0x23')]);_0x5a8912['offset']=qs[_0x3099('0x22')](_0x8639d8[_0x3099('0x37')][_0x3099('0x22')]);}_0x5a8912['order']=qs[_0x3099('0x41')](_0x8639d8[_0x3099('0x37')][_0x3099('0x41')]);_0x5a8912[_0x3099('0x42')]=qs[_0x3099('0x39')](_['pick'](_0x8639d8['query'],_0x431f8f[_0x3099('0x39')]),_0x368250);if(_0x8639d8[_0x3099('0x37')]['filter']){_0x5a8912['where']=_[_0x3099('0x43')](_0x5a8912['where'],{'$or':_[_0x3099('0x32')](_0x368250,function(_0x3e38c7){if(_0x3e38c7[_0x3099('0x44')]!==_0x3099('0x45')){var _0x475cb6={};_0x475cb6[_0x3e38c7[_0x3099('0x2f')]]={'$like':'%'+_0x8639d8[_0x3099('0x37')][_0x3099('0x46')]+'%'};return _0x475cb6;}})});}_0x5a8912=_[_0x3099('0x43')]({},_0x5a8912,_0x8639d8[_0x3099('0x47')]);var _0x161fce={'where':_0x5a8912[_0x3099('0x42')]};return db['FaxQueue'][_0x3099('0x21')](_0x161fce)[_0x3099('0x2a')](function(_0x43e9dc){_0x5e5604[_0x3099('0x21')]=_0x43e9dc;if(_0x8639d8[_0x3099('0x37')][_0x3099('0x48')]){_0x5a8912[_0x3099('0x49')]=[{'all':!![]}];}return db[_0x3099('0x33')][_0x3099('0x4a')](_0x5a8912);})[_0x3099('0x2a')](function(_0x478c58){_0x5e5604[_0x3099('0x4b')]=_0x478c58;return _0x5e5604;})['then'](respondWithFilteredResult(_0xa70827,_0x5a8912))[_0x3099('0x4c')](handleError(_0xa70827,null));};exports[_0x3099('0x4d')]=function(_0x36cfe8,_0x453a5b){var _0x578622={'raw':!![],'where':{'id':_0x36cfe8[_0x3099('0x4e')]['id']}},_0x45fa4f={};_0x45fa4f['model']=_['keys'](db[_0x3099('0x33')]['rawAttributes']);_0x45fa4f[_0x3099('0x37')]=_['keys'](_0x36cfe8[_0x3099('0x37')]);_0x45fa4f[_0x3099('0x39')]=_['intersection'](_0x45fa4f['model'],_0x45fa4f[_0x3099('0x37')]);_0x578622[_0x3099('0x3c')]=_[_0x3099('0x3a')](_0x45fa4f[_0x3099('0x3b')],qs['fields'](_0x36cfe8[_0x3099('0x37')][_0x3099('0x3d')]));_0x578622[_0x3099('0x3c')]=_0x578622[_0x3099('0x3c')]['length']?_0x578622['attributes']:_0x45fa4f[_0x3099('0x3b')];if(_0x36cfe8[_0x3099('0x37')]['includeAll']){_0x578622[_0x3099('0x49')]=[{'all':!![]}];}_0x578622=_[_0x3099('0x43')]({},_0x578622,_0x36cfe8[_0x3099('0x47')]);return db[_0x3099('0x33')][_0x3099('0x4f')](_0x578622)[_0x3099('0x2a')](handleEntityNotFound(_0x453a5b,null))[_0x3099('0x2a')](respondWithResult(_0x453a5b,null))[_0x3099('0x4c')](handleError(_0x453a5b,null));};exports[_0x3099('0x50')]=function(_0x3a2d31,_0x1a9315){return db[_0x3099('0x33')][_0x3099('0x50')](_0x3a2d31[_0x3099('0x51')],{})['then'](function(_0x519739){var _0x549706=_0x3a2d31[_0x3099('0x52')]['get']({'plain':!![]});if(!_0x549706)throw new Error(_0x3099('0x53'));if(_0x549706[_0x3099('0x54')]==='user'){var _0x1a52b7=_0x519739[_0x3099('0x55')]({'plain':!![]});var _0xf8f66a=_0x3099('0x2c');return db[_0x3099('0x56')][_0x3099('0x4f')]({'where':{'name':_0xf8f66a,'userProfileId':_0x549706[_0x3099('0x57')]},'raw':!![]})['then'](function(_0x43e7d0){if(_0x43e7d0&&_0x43e7d0[_0x3099('0x58')]===0x0){return db[_0x3099('0x59')]['create']({'name':_0x1a52b7[_0x3099('0x2f')],'resourceId':_0x1a52b7['id'],'type':_0x43e7d0[_0x3099('0x2f')],'sectionId':_0x43e7d0['id']},{})[_0x3099('0x2a')](function(){return _0x519739;});}else{return _0x519739;}})['catch'](function(_0x56c94f){logger['error'](_0x3099('0x5a'),_0x56c94f);throw _0x56c94f;});}return _0x519739;})[_0x3099('0x2a')](respondWithResult(_0x1a9315,0xc9))[_0x3099('0x4c')](handleError(_0x1a9315,null));};exports[_0x3099('0x29')]=function(_0x3e9639,_0x3356bd){if(_0x3e9639['body']['id']){delete _0x3e9639[_0x3099('0x51')]['id'];}return db[_0x3099('0x33')][_0x3099('0x4f')]({'where':{'id':_0x3e9639[_0x3099('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3356bd,null))[_0x3099('0x2a')](saveUpdates(_0x3e9639[_0x3099('0x51')],null))[_0x3099('0x2a')](respondWithResult(_0x3356bd,null))[_0x3099('0x4c')](handleError(_0x3356bd,null));};exports['destroy']=function(_0x474994,_0x37d0a6){return db[_0x3099('0x33')]['find']({'where':{'id':_0x474994['params']['id']}})['then'](handleEntityNotFound(_0x37d0a6,null))['then'](removeEntity(_0x37d0a6,null))['catch'](handleError(_0x37d0a6,null));};exports['describe']=function(_0x4153fb,_0x2fa4ef){return db[_0x3099('0x33')][_0x3099('0x5b')]()[_0x3099('0x2a')](respondWithResult(_0x2fa4ef,null))[_0x3099('0x4c')](handleError(_0x2fa4ef,null));};exports[_0x3099('0x5c')]=function(_0x7078d2,_0x42f19d,_0x369b87){var _0x213373={'raw':!![],'where':{}},_0x4235fe={},_0x3e358f;return db[_0x3099('0x33')][_0x3099('0x5d')]({'where':{'id':_0x7078d2[_0x3099('0x4e')]['id']}})[_0x3099('0x2a')](handleEntityNotFound(_0x42f19d,null))[_0x3099('0x2a')](function(_0x5464d1){if(_0x5464d1){_0x3e358f=_0x5464d1[_0x3099('0x55')]({'plain':!![]});_0x4235fe[_0x3099('0x3b')]=_[_0x3099('0x38')](db['UserFaxQueue'][_0x3099('0x34')]);_0x4235fe[_0x3099('0x37')]=_['keys'](_0x7078d2[_0x3099('0x37')]);_0x4235fe[_0x3099('0x39')]=_['intersection'](_0x4235fe[_0x3099('0x3b')],_0x4235fe['query']);_0x213373['attributes']=_[_0x3099('0x3a')](_0x4235fe[_0x3099('0x3b')],qs['fields'](_0x7078d2[_0x3099('0x37')][_0x3099('0x3d')]));_0x213373[_0x3099('0x3c')]=_0x213373['attributes']['length']?_0x213373['attributes']:_0x4235fe[_0x3099('0x3b')];if(!_0x7078d2[_0x3099('0x37')][_0x3099('0x3f')](_0x3099('0x40'))){_0x213373[_0x3099('0x23')]=qs['limit'](_0x7078d2[_0x3099('0x37')]['limit']);_0x213373[_0x3099('0x22')]=qs['offset'](_0x7078d2[_0x3099('0x37')][_0x3099('0x22')]);}_0x213373['order']=qs[_0x3099('0x41')](_0x7078d2[_0x3099('0x37')][_0x3099('0x41')]);_0x213373['where']=qs[_0x3099('0x39')](_[_0x3099('0x5e')](_0x7078d2[_0x3099('0x37')],_0x4235fe[_0x3099('0x39')]));_0x213373[_0x3099('0x42')][_0x3099('0x5f')]=_0x5464d1['id'];if(_0x7078d2['query'][_0x3099('0x46')]){_0x213373[_0x3099('0x42')]=_[_0x3099('0x43')](_0x213373[_0x3099('0x42')],{'$or':_[_0x3099('0x32')](_0x213373['attributes'],function(_0x591738){var _0x87a7c0={};_0x87a7c0[_0x591738]={'$like':'%'+_0x7078d2[_0x3099('0x37')][_0x3099('0x46')]+'%'};return _0x87a7c0;})});}_0x213373=_[_0x3099('0x43')]({},_0x213373,_0x7078d2[_0x3099('0x47')]);return db[_0x3099('0x60')]['findAll'](_0x213373);}})['then'](function(_0x26c59b){if(_0x26c59b){return db[_0x3099('0x61')]['findAndCountAll']({'where':{'id':_[_0x3099('0x32')](_0x26c59b,_0x3099('0x62')),'role':_0x3099('0x63')},'attributes':['id',_0x3099('0x2f'),_0x3099('0x64'),_0x3099('0x65'),_0x3099('0x66')]});}})[_0x3099('0x2a')](function(_0x1aa863){if(_0x1aa863){return{'count':_0x1aa863[_0x3099('0x21')],'rows':_[_0x3099('0x32')](_0x1aa863['rows'],function(_0x2cf78f){return{'membername':_0x2cf78f[_0x3099('0x2f')],'UserId':_0x2cf78f['id'],'queue_name':_0x3e358f[_0x3099('0x2f')],'FaxQueueId':_0x3e358f['id'],'interface':util[_0x3099('0x67')](_0x3099('0x68'),_0x3099('0x69'),_0x2cf78f[_0x3099('0x2f')]),'penalty':0x0,'paused':_0x2cf78f[_0x3099('0x64')],'createdAt':_0x2cf78f['createdAt'],'updatedAt':_0x2cf78f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3099('0x2a')](respondWithFilteredResult(_0x42f19d,_0x213373))['catch'](handleError(_0x42f19d,null));};exports[_0x3099('0x6a')]=function(_0x3793cc,_0x10d893,_0x4e4b51){var _0x3fbcfb={};var _0x3dfd91={};var _0x3fda87;var _0xea9fdb;return db[_0x3099('0x33')][_0x3099('0x5d')]({'where':{'id':_0x3793cc[_0x3099('0x4e')]['id']}})[_0x3099('0x2a')](handleEntityNotFound(_0x10d893,null))['then'](function(_0x4bf61f){if(_0x4bf61f){_0x3fda87=_0x4bf61f;_0x3dfd91['model']=_['keys'](db[_0x3099('0x6b')][_0x3099('0x34')]);_0x3dfd91[_0x3099('0x37')]=_['keys'](_0x3793cc[_0x3099('0x37')]);_0x3dfd91[_0x3099('0x39')]=_[_0x3099('0x3a')](_0x3dfd91[_0x3099('0x3b')],_0x3dfd91['query']);_0x3fbcfb[_0x3099('0x3c')]=_[_0x3099('0x3a')](_0x3dfd91[_0x3099('0x3b')],qs[_0x3099('0x3d')](_0x3793cc['query'][_0x3099('0x3d')]));_0x3fbcfb[_0x3099('0x3c')]=_0x3fbcfb['attributes'][_0x3099('0x3e')]?_0x3fbcfb[_0x3099('0x3c')]:_0x3dfd91['model'];_0x3fbcfb[_0x3099('0x6c')]=qs[_0x3099('0x41')](_0x3793cc[_0x3099('0x37')][_0x3099('0x41')]);_0x3fbcfb[_0x3099('0x42')]=qs['filters'](_[_0x3099('0x5e')](_0x3793cc['query'],_0x3dfd91[_0x3099('0x39')]));if(_0x3793cc[_0x3099('0x37')][_0x3099('0x46')]){_0x3fbcfb[_0x3099('0x42')]=_[_0x3099('0x43')](_0x3fbcfb[_0x3099('0x42')],{'$or':_[_0x3099('0x32')](_0x3fbcfb[_0x3099('0x3c')],function(_0x31f1e5){var _0x51c130={};_0x51c130[_0x31f1e5]={'$like':'%'+_0x3793cc[_0x3099('0x37')][_0x3099('0x46')]+'%'};return _0x51c130;})});}_0x3fbcfb=_[_0x3099('0x43')]({},_0x3fbcfb,_0x3793cc[_0x3099('0x47')]);return _0x3fda87[_0x3099('0x6a')](_0x3fbcfb);}})[_0x3099('0x2a')](function(_0x261c78){if(_0x261c78){_0xea9fdb=_0x261c78[_0x3099('0x3e')];if(!_0x3793cc[_0x3099('0x37')]['hasOwnProperty'](_0x3099('0x40'))){_0x3fbcfb[_0x3099('0x23')]=qs['limit'](_0x3793cc[_0x3099('0x37')][_0x3099('0x23')]);_0x3fbcfb['offset']=qs['offset'](_0x3793cc[_0x3099('0x37')][_0x3099('0x22')]);}return _0x3fda87[_0x3099('0x6a')](_0x3fbcfb);}})[_0x3099('0x2a')](function(_0x2564d7){if(_0x2564d7){return _0x2564d7?{'count':_0xea9fdb,'rows':_0x2564d7}:null;}})[_0x3099('0x2a')](respondWithResult(_0x10d893,null))[_0x3099('0x4c')](handleError(_0x10d893,null));};exports[_0x3099('0x6d')]=function(_0x5ed924,_0x19e472,_0x2d12cc){var _0x4e1ee6=_0x5ed924[_0x3099('0x51')][_0x3099('0x6e')];return db[_0x3099('0x6b')][_0x3099('0x4a')]({'where':{'id':_0x4e1ee6},'attributes':['id'],'include':[{'model':db[_0x3099('0x61')],'as':_0x3099('0x6f'),'attributes':['id',_0x3099('0x2f'),_0x3099('0x70'),'voicePause',_0x3099('0x71')],'raw':!![]}]})[_0x3099('0x2a')](function(_0x14c294){if(_0x14c294){var _0x34531b=_['flatMap'](_0x14c294,function(_0x9cc36c){var _0x4d9e45=_0x9cc36c[_0x3099('0x55')]({'plain':!![]});return _0x4d9e45[_0x3099('0x6f')];});return db['FaxQueue'][_0x3099('0x4f')]({'where':{'id':_0x5ed924[_0x3099('0x4e')]['id']}})[_0x3099('0x2a')](function(_0x2f7253){return db['sequelize'][_0x3099('0x72')](function(_0x703bff){return _0x2f7253['addTeams'](_0x4e1ee6,{'transaction':_0x703bff})[_0x3099('0x2a')](function(){return BPromise[_0x3099('0x73')](_0x34531b,function(_0x4e71a8){return db[_0x3099('0x60')]['findOrCreate']({'where':{'UserId':_0x4e71a8['id'],'FaxQueueId':_0x5ed924['params']['id']},'transaction':_0x703bff});});})[_0x3099('0x2a')](function(){_0x34531b[_0x3099('0x74')](function(_0x2d6639){socket[_0x3099('0x75')](_0x3099('0x76'),{'UserId':_0x2d6639['id'],'FaxQueueId':_0x2f7253['id']});});});});});}})[_0x3099('0x2a')](respondWithStatusCode(_0x19e472,null))['catch'](handleError(_0x19e472,null));};exports['removeTeams']=function(_0x22e551,_0x3bdda2,_0x2bf0ab){return db[_0x3099('0x6b')][_0x3099('0x4a')]({'where':{'id':_0x22e551[_0x3099('0x37')][_0x3099('0x6e')]},'attributes':['id'],'include':[{'model':db[_0x3099('0x61')],'as':_0x3099('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x3099('0x2a')](handleEntityNotFound(_0x3bdda2,null))['then'](function(_0x24b4e9){var _0x15b0d5=_['map'](_0x24b4e9,'id');var _0x4043ea=[];var _0x5bddc7=[];var _0xa04cc1=squel['select']();_0xa04cc1[_0x3099('0x77')](_0x3099('0x78'))[_0x3099('0x79')](_0x3099('0x7a'),'tq')['join'](_0x3099('0x7b'),'ut',_0x3099('0x7c'))['where'](_0x3099('0x7d'),_0x22e551[_0x3099('0x4e')]['id']);for(var _0x5c5a74=0x0;_0x5c5a74<_0x24b4e9[_0x3099('0x3e')];_0x5c5a74+=0x1){let _0x632d23=_0x24b4e9[_0x5c5a74];for(var _0x134b89=0x0;_0x134b89<_0x632d23[_0x3099('0x6f')]['length'];_0x134b89+=0x1){let _0x331942=_0x632d23[_0x3099('0x6f')][_0x134b89];var _0x24d08d=_0xa04cc1[_0x3099('0x7e')]();_0x24d08d[_0x3099('0x42')](_0x3099('0x7f'),_0x331942['id']);_0x5bddc7[_0x3099('0x80')](db[_0x3099('0x81')][_0x3099('0x37')](_0x24d08d[_0x3099('0x82')](),{'type':db[_0x3099('0x81')][_0x3099('0x83')][_0x3099('0x84')]})[_0x3099('0x2a')](function(_0x2ee441){if(_0x2ee441[_0x3099('0x3e')]===0x1){return _0x331942['id'];}else{var _0x316116=_[_0x3099('0x85')](_['map'](_0x2ee441,'TeamId'),function(_0x22ccf0){return _[_0x3099('0x86')](_0x15b0d5,_0x22ccf0);});if(_0x316116){return _0x331942['id'];}}}));}}return BPromise[_0x3099('0x87')](_0x5bddc7)[_0x3099('0x2a')](function(_0x773bc5){_0x4043ea=_(_0x4043ea)[_0x3099('0x88')](_0x773bc5)[_0x3099('0x89')]()['value']();return db['FaxQueue'][_0x3099('0x4f')]({'where':{'id':_0x22e551[_0x3099('0x4e')]['id']}})[_0x3099('0x2a')](function(_0xf54391){return db[_0x3099('0x81')]['transaction'](function(_0xf1c5a6){return _0xf54391[_0x3099('0x8a')](_0x22e551['query'][_0x3099('0x6e')],{'transaction':_0xf1c5a6})[_0x3099('0x2a')](function(){if(!_['isEmpty'](_0x4043ea)){return _0xf54391[_0x3099('0x8b')](_0x4043ea,{'transaction':_0xf1c5a6});}})[_0x3099('0x2a')](function(){_0x4043ea[_0x3099('0x74')](function(_0x457849){socket[_0x3099('0x75')]('userFaxQueue:remove',{'UserId':_0x457849,'FaxQueueId':_0xf54391['id']});});});});});});})[_0x3099('0x2a')](respondWithStatusCode(_0x3bdda2,null))['catch'](handleError(_0x3bdda2,null));};exports[_0x3099('0x8c')]=function(_0x1ac8a7,_0x225d74,_0x1cc573){return db[_0x3099('0x33')][_0x3099('0x4f')]({'where':{'id':_0x1ac8a7[_0x3099('0x4e')]['id']}})[_0x3099('0x2a')](handleEntityNotFound(_0x225d74,null))[_0x3099('0x2a')](function(_0x4440a0){if(_0x4440a0){return _0x4440a0[_0x3099('0x8c')](_0x1ac8a7[_0x3099('0x51')][_0x3099('0x6e')],_[_0x3099('0x8d')](_0x1ac8a7[_0x3099('0x51')],[_0x3099('0x6e'),'id'])||{})[_0x3099('0x8e')](function(_0x5d1ee6){for(var _0x402ab7=0x0;_0x402ab7<_0x1ac8a7[_0x3099('0x51')]['ids'][_0x3099('0x3e')];_0x402ab7+=0x1){socket[_0x3099('0x75')](_0x3099('0x76'),{'UserId':_0x1ac8a7[_0x3099('0x51')]['ids'][_0x402ab7],'FaxQueueId':_0x1ac8a7[_0x3099('0x4e')]['id']});}return _0x5d1ee6;});}})[_0x3099('0x2a')](respondWithResult(_0x225d74,null))[_0x3099('0x4c')](handleError(_0x225d74,null));};exports[_0x3099('0x8b')]=function(_0x419d71,_0x18f57e,_0x4fa952){return db[_0x3099('0x33')][_0x3099('0x4f')]({'where':{'id':_0x419d71['params']['id']}})[_0x3099('0x2a')](handleEntityNotFound(_0x18f57e,null))[_0x3099('0x2a')](function(_0x15b4c9){if(_0x15b4c9){return _0x15b4c9['removeAgents'](_0x419d71['query'][_0x3099('0x6e')])[_0x3099('0x2a')](function(){if(_['isArray'](_0x419d71['query'][_0x3099('0x6e')])){for(var _0x336798=0x0;_0x336798<_0x419d71['query'][_0x3099('0x6e')]['length'];_0x336798+=0x1){socket[_0x3099('0x75')](_0x3099('0x8f'),{'UserId':Number(_0x419d71['query']['ids'][_0x336798]),'FaxQueueId':Number(_0x419d71['params']['id'])});}}else{socket[_0x3099('0x75')](_0x3099('0x8f'),{'UserId':Number(_0x419d71['query'][_0x3099('0x6e')]),'FaxQueueId':Number(_0x419d71[_0x3099('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x18f57e,null))[_0x3099('0x4c')](handleError(_0x18f57e,null));};exports[_0x3099('0x90')]=function(_0xe8e241,_0x7ed367,_0x3da4cc){var _0x4017a9={};var _0xe2af09={};var _0x2bd9f9;var _0x5b6050;return db[_0x3099('0x33')]['findOne']({'where':{'id':_0xe8e241['params']['id']}})[_0x3099('0x2a')](handleEntityNotFound(_0x7ed367,null))['then'](function(_0x36600a){if(_0x36600a){_0x2bd9f9=_0x36600a;_0xe2af09['model']=_[_0x3099('0x38')](db[_0x3099('0x61')][_0x3099('0x34')]);_0xe2af09[_0x3099('0x37')]=_[_0x3099('0x38')](_0xe8e241[_0x3099('0x37')]);_0xe2af09[_0x3099('0x39')]=_[_0x3099('0x3a')](_0xe2af09[_0x3099('0x3b')],_0xe2af09['query']);_0x4017a9[_0x3099('0x3c')]=_['intersection'](_0xe2af09[_0x3099('0x3b')],qs['fields'](_0xe8e241[_0x3099('0x37')]['fields']));_0x4017a9[_0x3099('0x3c')]=_0x4017a9[_0x3099('0x3c')][_0x3099('0x3e')]?_0x4017a9['attributes']:_0xe2af09[_0x3099('0x3b')];_0x4017a9[_0x3099('0x6c')]=qs['sort'](_0xe8e241['query']['sort']);_0x4017a9[_0x3099('0x42')]=qs[_0x3099('0x39')](_[_0x3099('0x5e')](_0xe8e241[_0x3099('0x37')],_0xe2af09[_0x3099('0x39')]));if(_0xe8e241[_0x3099('0x37')]['filter']){_0x4017a9[_0x3099('0x42')]=_['merge'](_0x4017a9[_0x3099('0x42')],{'$or':_['map'](_0x4017a9[_0x3099('0x3c')],function(_0x2e6408){var _0x5a24ae={};_0x5a24ae[_0x2e6408]={'$like':'%'+_0xe8e241[_0x3099('0x37')]['filter']+'%'};return _0x5a24ae;})});}_0x4017a9=_[_0x3099('0x43')]({},_0x4017a9,_0xe8e241[_0x3099('0x47')]);return _0x2bd9f9['getAgents'](_0x4017a9);}})['then'](function(_0x572377){if(_0x572377){_0x5b6050=_0x572377[_0x3099('0x3e')];if(!_0xe8e241[_0x3099('0x37')]['hasOwnProperty']('nolimit')){_0x4017a9[_0x3099('0x23')]=qs[_0x3099('0x23')](_0xe8e241[_0x3099('0x37')][_0x3099('0x23')]);_0x4017a9[_0x3099('0x22')]=qs[_0x3099('0x22')](_0xe8e241['query'][_0x3099('0x22')]);}return _0x2bd9f9[_0x3099('0x90')](_0x4017a9);}})[_0x3099('0x2a')](function(_0x3a836c){if(_0x3a836c){return _0x3a836c?{'count':_0x5b6050,'rows':_0x3a836c}:null;}})[_0x3099('0x2a')](respondWithResult(_0x7ed367,null))[_0x3099('0x4c')](handleError(_0x7ed367,null));}; \ No newline at end of file +var _0xf9ae=['crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','hasOwnProperty','nolimit','addTeams','ids','User','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userFaxQueue:save','removeTeams','Agents','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','compact','value','transaction','removeAgents','forEach','addAgents','omit','isArray','userFaxQueue:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel'];(function(_0x218cb5,_0x46e4f5){var _0x2b419d=function(_0x55b5bc){while(--_0x55b5bc){_0x218cb5['push'](_0x218cb5['shift']());}};_0x2b419d(++_0x46e4f5);}(_0xf9ae,0x85));var _0xef9a=function(_0x172fc4,_0x53df31){_0x172fc4=_0x172fc4-0x0;var _0x42ca0a=_0xf9ae[_0x172fc4];return _0x42ca0a;};'use strict';var pdf=require(_0xef9a('0x0'));var emlformat=require(_0xef9a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xef9a('0x2'));var jsonpatch=require(_0xef9a('0x3'));var rp=require(_0xef9a('0x4'));var moment=require(_0xef9a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xef9a('0x6'));var util=require(_0xef9a('0x7'));var path=require('path');var sox=require(_0xef9a('0x8'));var csv=require(_0xef9a('0x9'));var ejs=require(_0xef9a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xef9a('0xb'));var crypto=require(_0xef9a('0xc'));var jsforce=require(_0xef9a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xef9a('0x9'));var querystring=require(_0xef9a('0xe'));var Papa=require('papaparse');var Redis=require(_0xef9a('0xf'));var authService=require(_0xef9a('0x10'));var qs=require(_0xef9a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef9a('0x12'));var logger=require('../../config/logger')(_0xef9a('0x13'));var utils=require(_0xef9a('0x14'));var config=require(_0xef9a('0x15'));var db=require(_0xef9a('0x16'))['db'];config['redis']=_[_0xef9a('0x17')](config['redis'],{'host':_0xef9a('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xef9a('0x19')]));require(_0xef9a('0x1a'))[_0xef9a('0x1b')](socket);function respondWithStatusCode(_0x464288,_0x5ec28b){_0x5ec28b=_0x5ec28b||0xcc;return function(_0x1491a3){if(_0x1491a3){return _0x464288[_0xef9a('0x1c')](_0x5ec28b);}return _0x464288[_0xef9a('0x1d')](_0x5ec28b)[_0xef9a('0x1e')]();};}function respondWithResult(_0x352427,_0x4306f9){_0x4306f9=_0x4306f9||0xc8;return function(_0x476941){if(_0x476941){return _0x352427['status'](_0x4306f9)[_0xef9a('0x1f')](_0x476941);}};}function respondWithFilteredResult(_0x284fda,_0x4821be){return function(_0x14b38b){if(_0x14b38b){var _0x454c2c=_0x14b38b[_0xef9a('0x20')],_0x1b286c=_0x4821be[_0xef9a('0x21')],_0x428b31=_0x4821be[_0xef9a('0x21')]+_0x4821be[_0xef9a('0x22')],_0x24034b;if(_0x428b31>=_0x454c2c){_0x428b31=_0x454c2c;_0x24034b=0xc8;}else{_0x24034b=0xce;}_0x284fda['status'](_0x24034b);return _0x284fda[_0xef9a('0x23')](_0xef9a('0x24'),_0x1b286c+'-'+_0x428b31+'/'+_0x454c2c)[_0xef9a('0x1f')](_0x14b38b);}return null;};}function patchUpdates(_0x266b79){return function(_0xf17902){try{jsonpatch[_0xef9a('0x25')](_0xf17902,_0x266b79,!![]);}catch(_0xaf563d){return BPromise[_0xef9a('0x26')](_0xaf563d);}return _0xf17902[_0xef9a('0x27')]();};}function saveUpdates(_0x14640a,_0x5523e8){return function(_0x5e9932){if(_0x5e9932){return _0x5e9932[_0xef9a('0x28')](_0x14640a)['then'](function(_0x37b666){return _0x37b666;});}return null;};}function removeEntity(_0x21c221,_0x2cf102){return function(_0x530bf8){if(_0x530bf8){return _0x530bf8[_0xef9a('0x29')]()[_0xef9a('0x2a')](function(){var _0x51ddae=_0x530bf8[_0xef9a('0x2b')]({'plain':!![]});var _0x4a16b8='FaxQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x4a16b8,'resourceId':_0x51ddae['id']}})['then'](function(){return _0x530bf8;});})['then'](function(){_0x21c221[_0xef9a('0x1d')](0xcc)[_0xef9a('0x1e')]();});}};}function handleEntityNotFound(_0x4731ba,_0x58f0ec){return function(_0x570c4a){if(!_0x570c4a){_0x4731ba[_0xef9a('0x1c')](0x194);}return _0x570c4a;};}function handleError(_0x15f806,_0x3050cf){_0x3050cf=_0x3050cf||0x1f4;return function(_0x44a212){logger['error'](_0x44a212[_0xef9a('0x2c')]);if(_0x44a212[_0xef9a('0x2d')]){delete _0x44a212[_0xef9a('0x2d')];}_0x15f806['status'](_0x3050cf)[_0xef9a('0x2e')](_0x44a212);};}exports[_0xef9a('0x2f')]=function(_0x2e5a2e,_0x3f65b6){var _0x5f5c6a={},_0x5914c7={},_0x17883d={'count':0x0,'rows':[]};var _0x10a605=_['map'](db[_0xef9a('0x30')][_0xef9a('0x31')],function(_0x448e51){return{'name':_0x448e51[_0xef9a('0x32')],'type':_0x448e51[_0xef9a('0x33')][_0xef9a('0x34')]};});_0x5914c7[_0xef9a('0x35')]=_[_0xef9a('0x36')](_0x10a605,_0xef9a('0x2d'));_0x5914c7[_0xef9a('0x37')]=_[_0xef9a('0x38')](_0x2e5a2e['query']);_0x5914c7['filters']=_[_0xef9a('0x39')](_0x5914c7['model'],_0x5914c7[_0xef9a('0x37')]);_0x5f5c6a[_0xef9a('0x3a')]=_[_0xef9a('0x39')](_0x5914c7[_0xef9a('0x35')],qs[_0xef9a('0x3b')](_0x2e5a2e[_0xef9a('0x37')][_0xef9a('0x3b')]));_0x5f5c6a[_0xef9a('0x3a')]=_0x5f5c6a[_0xef9a('0x3a')][_0xef9a('0x3c')]?_0x5f5c6a[_0xef9a('0x3a')]:_0x5914c7[_0xef9a('0x35')];if(!_0x2e5a2e['query']['hasOwnProperty']('nolimit')){_0x5f5c6a[_0xef9a('0x22')]=qs[_0xef9a('0x22')](_0x2e5a2e['query'][_0xef9a('0x22')]);_0x5f5c6a['offset']=qs[_0xef9a('0x21')](_0x2e5a2e['query'][_0xef9a('0x21')]);}_0x5f5c6a['order']=qs[_0xef9a('0x3d')](_0x2e5a2e[_0xef9a('0x37')]['sort']);_0x5f5c6a[_0xef9a('0x3e')]=qs[_0xef9a('0x3f')](_[_0xef9a('0x40')](_0x2e5a2e[_0xef9a('0x37')],_0x5914c7[_0xef9a('0x3f')]),_0x10a605);if(_0x2e5a2e[_0xef9a('0x37')]['filter']){_0x5f5c6a['where']=_['merge'](_0x5f5c6a[_0xef9a('0x3e')],{'$or':_[_0xef9a('0x36')](_0x10a605,function(_0x2b816b){if(_0x2b816b['type']!==_0xef9a('0x41')){var _0x1a5aeb={};_0x1a5aeb[_0x2b816b[_0xef9a('0x2d')]]={'$like':'%'+_0x2e5a2e[_0xef9a('0x37')][_0xef9a('0x42')]+'%'};return _0x1a5aeb;}})});}_0x5f5c6a=_['merge']({},_0x5f5c6a,_0x2e5a2e[_0xef9a('0x43')]);var _0x1890ab={'where':_0x5f5c6a[_0xef9a('0x3e')]};return db[_0xef9a('0x30')][_0xef9a('0x20')](_0x1890ab)[_0xef9a('0x2a')](function(_0x539fe0){_0x17883d[_0xef9a('0x20')]=_0x539fe0;if(_0x2e5a2e[_0xef9a('0x37')][_0xef9a('0x44')]){_0x5f5c6a[_0xef9a('0x45')]=[{'all':!![]}];}return db[_0xef9a('0x30')][_0xef9a('0x46')](_0x5f5c6a);})[_0xef9a('0x2a')](function(_0x2f8fc3){_0x17883d[_0xef9a('0x47')]=_0x2f8fc3;return _0x17883d;})['then'](respondWithFilteredResult(_0x3f65b6,_0x5f5c6a))['catch'](handleError(_0x3f65b6,null));};exports[_0xef9a('0x48')]=function(_0xfcd62d,_0x2b47c1){var _0x4468ba={'raw':!![],'where':{'id':_0xfcd62d[_0xef9a('0x49')]['id']}},_0x5c60e7={};_0x5c60e7[_0xef9a('0x35')]=_[_0xef9a('0x38')](db[_0xef9a('0x30')][_0xef9a('0x31')]);_0x5c60e7[_0xef9a('0x37')]=_[_0xef9a('0x38')](_0xfcd62d[_0xef9a('0x37')]);_0x5c60e7['filters']=_[_0xef9a('0x39')](_0x5c60e7[_0xef9a('0x35')],_0x5c60e7[_0xef9a('0x37')]);_0x4468ba[_0xef9a('0x3a')]=_[_0xef9a('0x39')](_0x5c60e7['model'],qs[_0xef9a('0x3b')](_0xfcd62d[_0xef9a('0x37')][_0xef9a('0x3b')]));_0x4468ba[_0xef9a('0x3a')]=_0x4468ba[_0xef9a('0x3a')][_0xef9a('0x3c')]?_0x4468ba[_0xef9a('0x3a')]:_0x5c60e7['model'];if(_0xfcd62d[_0xef9a('0x37')][_0xef9a('0x44')]){_0x4468ba[_0xef9a('0x45')]=[{'all':!![]}];}_0x4468ba=_[_0xef9a('0x4a')]({},_0x4468ba,_0xfcd62d[_0xef9a('0x43')]);return db[_0xef9a('0x30')][_0xef9a('0x4b')](_0x4468ba)[_0xef9a('0x2a')](handleEntityNotFound(_0x2b47c1,null))[_0xef9a('0x2a')](respondWithResult(_0x2b47c1,null))[_0xef9a('0x4c')](handleError(_0x2b47c1,null));};exports[_0xef9a('0x4d')]=function(_0x427244,_0x3f285e){return db['FaxQueue'][_0xef9a('0x4d')](_0x427244[_0xef9a('0x4e')],{})[_0xef9a('0x2a')](function(_0x30c3ed){var _0x100362=_0x427244[_0xef9a('0x4f')][_0xef9a('0x2b')]({'plain':!![]});if(!_0x100362)throw new Error(_0xef9a('0x50'));if(_0x100362[_0xef9a('0x51')]===_0xef9a('0x4f')){var _0x430b49=_0x30c3ed[_0xef9a('0x2b')]({'plain':!![]});var _0x1cc870=_0xef9a('0x52');return db[_0xef9a('0x53')][_0xef9a('0x4b')]({'where':{'name':_0x1cc870,'userProfileId':_0x100362[_0xef9a('0x54')]},'raw':!![]})[_0xef9a('0x2a')](function(_0x2b4d0c){if(_0x2b4d0c&&_0x2b4d0c[_0xef9a('0x55')]===0x0){return db[_0xef9a('0x56')]['create']({'name':_0x430b49['name'],'resourceId':_0x430b49['id'],'type':_0x2b4d0c[_0xef9a('0x2d')],'sectionId':_0x2b4d0c['id']},{})[_0xef9a('0x2a')](function(){return _0x30c3ed;});}else{return _0x30c3ed;}})['catch'](function(_0x35fb8f){logger['error'](_0xef9a('0x57'),_0x35fb8f);throw _0x35fb8f;});}return _0x30c3ed;})[_0xef9a('0x2a')](respondWithResult(_0x3f285e,0xc9))[_0xef9a('0x4c')](handleError(_0x3f285e,null));};exports['update']=function(_0x3762fd,_0x1a5699){if(_0x3762fd['body']['id']){delete _0x3762fd['body']['id'];}return db[_0xef9a('0x30')][_0xef9a('0x4b')]({'where':{'id':_0x3762fd[_0xef9a('0x49')]['id']}})['then'](handleEntityNotFound(_0x1a5699,null))[_0xef9a('0x2a')](saveUpdates(_0x3762fd['body'],null))[_0xef9a('0x2a')](respondWithResult(_0x1a5699,null))['catch'](handleError(_0x1a5699,null));};exports[_0xef9a('0x29')]=function(_0x242e85,_0x125871){return db[_0xef9a('0x30')][_0xef9a('0x4b')]({'where':{'id':_0x242e85[_0xef9a('0x49')]['id']}})[_0xef9a('0x2a')](handleEntityNotFound(_0x125871,null))[_0xef9a('0x2a')](removeEntity(_0x125871,null))[_0xef9a('0x4c')](handleError(_0x125871,null));};exports[_0xef9a('0x58')]=function(_0x563b11,_0x2e9aa0){return db['FaxQueue'][_0xef9a('0x58')]()[_0xef9a('0x2a')](respondWithResult(_0x2e9aa0,null))['catch'](handleError(_0x2e9aa0,null));};exports[_0xef9a('0x59')]=function(_0x68d652,_0x54318b,_0x4b82e4){var _0x158eab={'raw':!![],'where':{}},_0x14fba8={},_0x251ac1;return db['FaxQueue'][_0xef9a('0x5a')]({'where':{'id':_0x68d652['params']['id']}})[_0xef9a('0x2a')](handleEntityNotFound(_0x54318b,null))[_0xef9a('0x2a')](function(_0x188ad8){if(_0x188ad8){_0x251ac1=_0x188ad8[_0xef9a('0x2b')]({'plain':!![]});_0x14fba8[_0xef9a('0x35')]=_[_0xef9a('0x38')](db[_0xef9a('0x5b')][_0xef9a('0x31')]);_0x14fba8[_0xef9a('0x37')]=_[_0xef9a('0x38')](_0x68d652['query']);_0x14fba8[_0xef9a('0x3f')]=_[_0xef9a('0x39')](_0x14fba8['model'],_0x14fba8[_0xef9a('0x37')]);_0x158eab[_0xef9a('0x3a')]=_['intersection'](_0x14fba8['model'],qs[_0xef9a('0x3b')](_0x68d652[_0xef9a('0x37')][_0xef9a('0x3b')]));_0x158eab['attributes']=_0x158eab[_0xef9a('0x3a')]['length']?_0x158eab[_0xef9a('0x3a')]:_0x14fba8[_0xef9a('0x35')];if(!_0x68d652['query']['hasOwnProperty']('nolimit')){_0x158eab[_0xef9a('0x22')]=qs[_0xef9a('0x22')](_0x68d652[_0xef9a('0x37')][_0xef9a('0x22')]);_0x158eab[_0xef9a('0x21')]=qs['offset'](_0x68d652[_0xef9a('0x37')][_0xef9a('0x21')]);}_0x158eab['order']=qs[_0xef9a('0x3d')](_0x68d652[_0xef9a('0x37')][_0xef9a('0x3d')]);_0x158eab[_0xef9a('0x3e')]=qs[_0xef9a('0x3f')](_[_0xef9a('0x40')](_0x68d652[_0xef9a('0x37')],_0x14fba8['filters']));_0x158eab['where'][_0xef9a('0x5c')]=_0x188ad8['id'];if(_0x68d652[_0xef9a('0x37')]['filter']){_0x158eab['where']=_[_0xef9a('0x4a')](_0x158eab['where'],{'$or':_[_0xef9a('0x36')](_0x158eab[_0xef9a('0x3a')],function(_0x25f164){var _0x15c5ef={};_0x15c5ef[_0x25f164]={'$like':'%'+_0x68d652[_0xef9a('0x37')][_0xef9a('0x42')]+'%'};return _0x15c5ef;})});}_0x158eab=_[_0xef9a('0x4a')]({},_0x158eab,_0x68d652[_0xef9a('0x43')]);return db[_0xef9a('0x5b')]['findAll'](_0x158eab);}})['then'](function(_0x3bf7f2){if(_0x3bf7f2){return db['User']['findAndCountAll']({'where':{'id':_[_0xef9a('0x36')](_0x3bf7f2,_0xef9a('0x5d')),'role':_0xef9a('0x5e')},'attributes':['id','name',_0xef9a('0x5f'),_0xef9a('0x60'),_0xef9a('0x61')]});}})['then'](function(_0xdaaeae){if(_0xdaaeae){return{'count':_0xdaaeae['count'],'rows':_[_0xef9a('0x36')](_0xdaaeae[_0xef9a('0x47')],function(_0x7b19ff){return{'membername':_0x7b19ff[_0xef9a('0x2d')],'UserId':_0x7b19ff['id'],'queue_name':_0x251ac1[_0xef9a('0x2d')],'FaxQueueId':_0x251ac1['id'],'interface':util[_0xef9a('0x62')](_0xef9a('0x63'),_0xef9a('0x64'),_0x7b19ff[_0xef9a('0x2d')]),'penalty':0x0,'paused':_0x7b19ff[_0xef9a('0x5f')],'createdAt':_0x7b19ff['createdAt'],'updatedAt':_0x7b19ff[_0xef9a('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xef9a('0x2a')](respondWithFilteredResult(_0x54318b,_0x158eab))[_0xef9a('0x4c')](handleError(_0x54318b,null));};exports[_0xef9a('0x65')]=function(_0x2a828e,_0x362fe4,_0x489748){var _0x374c0b={};var _0x333b08={};var _0x103910;var _0x2e0174;return db[_0xef9a('0x30')][_0xef9a('0x5a')]({'where':{'id':_0x2a828e[_0xef9a('0x49')]['id']}})[_0xef9a('0x2a')](handleEntityNotFound(_0x362fe4,null))[_0xef9a('0x2a')](function(_0x65b3e2){if(_0x65b3e2){_0x103910=_0x65b3e2;_0x333b08['model']=_[_0xef9a('0x38')](db[_0xef9a('0x66')]['rawAttributes']);_0x333b08['query']=_[_0xef9a('0x38')](_0x2a828e['query']);_0x333b08[_0xef9a('0x3f')]=_['intersection'](_0x333b08['model'],_0x333b08[_0xef9a('0x37')]);_0x374c0b[_0xef9a('0x3a')]=_[_0xef9a('0x39')](_0x333b08[_0xef9a('0x35')],qs[_0xef9a('0x3b')](_0x2a828e[_0xef9a('0x37')]['fields']));_0x374c0b[_0xef9a('0x3a')]=_0x374c0b[_0xef9a('0x3a')]['length']?_0x374c0b[_0xef9a('0x3a')]:_0x333b08[_0xef9a('0x35')];_0x374c0b[_0xef9a('0x67')]=qs[_0xef9a('0x3d')](_0x2a828e[_0xef9a('0x37')][_0xef9a('0x3d')]);_0x374c0b[_0xef9a('0x3e')]=qs['filters'](_[_0xef9a('0x40')](_0x2a828e['query'],_0x333b08[_0xef9a('0x3f')]));if(_0x2a828e[_0xef9a('0x37')][_0xef9a('0x42')]){_0x374c0b[_0xef9a('0x3e')]=_[_0xef9a('0x4a')](_0x374c0b[_0xef9a('0x3e')],{'$or':_[_0xef9a('0x36')](_0x374c0b['attributes'],function(_0x235cbb){var _0x5b575b={};_0x5b575b[_0x235cbb]={'$like':'%'+_0x2a828e[_0xef9a('0x37')][_0xef9a('0x42')]+'%'};return _0x5b575b;})});}_0x374c0b=_['merge']({},_0x374c0b,_0x2a828e[_0xef9a('0x43')]);return _0x103910[_0xef9a('0x65')](_0x374c0b);}})[_0xef9a('0x2a')](function(_0x2e9f59){if(_0x2e9f59){_0x2e0174=_0x2e9f59['length'];if(!_0x2a828e[_0xef9a('0x37')][_0xef9a('0x68')](_0xef9a('0x69'))){_0x374c0b['limit']=qs[_0xef9a('0x22')](_0x2a828e[_0xef9a('0x37')][_0xef9a('0x22')]);_0x374c0b['offset']=qs[_0xef9a('0x21')](_0x2a828e[_0xef9a('0x37')]['offset']);}return _0x103910[_0xef9a('0x65')](_0x374c0b);}})[_0xef9a('0x2a')](function(_0x52d046){if(_0x52d046){return _0x52d046?{'count':_0x2e0174,'rows':_0x52d046}:null;}})[_0xef9a('0x2a')](respondWithResult(_0x362fe4,null))['catch'](handleError(_0x362fe4,null));};exports[_0xef9a('0x6a')]=function(_0x1363cb,_0x33da13,_0x35650e){var _0x200e0e=_0x1363cb[_0xef9a('0x4e')][_0xef9a('0x6b')];return db[_0xef9a('0x66')][_0xef9a('0x46')]({'where':{'id':_0x200e0e},'attributes':['id'],'include':[{'model':db[_0xef9a('0x6c')],'as':'Agents','attributes':['id','name',_0xef9a('0x6d'),_0xef9a('0x6e'),_0xef9a('0x6f')],'raw':!![]}]})[_0xef9a('0x2a')](function(_0x27efb2){if(_0x27efb2){var _0x4ddd3f=_[_0xef9a('0x70')](_0x27efb2,function(_0x191195){var _0x15fa69=_0x191195[_0xef9a('0x2b')]({'plain':!![]});return _0x15fa69['Agents'];});return db[_0xef9a('0x30')][_0xef9a('0x4b')]({'where':{'id':_0x1363cb[_0xef9a('0x49')]['id']}})['then'](function(_0x5d85bc){return db[_0xef9a('0x71')]['transaction'](function(_0xdc45e3){return _0x5d85bc[_0xef9a('0x6a')](_0x200e0e,{'transaction':_0xdc45e3})['then'](function(){return BPromise[_0xef9a('0x72')](_0x4ddd3f,function(_0x5bb77d){return db['UserFaxQueue'][_0xef9a('0x73')]({'where':{'UserId':_0x5bb77d['id'],'FaxQueueId':_0x1363cb[_0xef9a('0x49')]['id']},'transaction':_0xdc45e3});});})[_0xef9a('0x2a')](function(){_0x4ddd3f['forEach'](function(_0x4ac9c6){socket[_0xef9a('0x74')](_0xef9a('0x75'),{'UserId':_0x4ac9c6['id'],'FaxQueueId':_0x5d85bc['id']});});});});});}})[_0xef9a('0x2a')](respondWithStatusCode(_0x33da13,null))[_0xef9a('0x4c')](handleError(_0x33da13,null));};exports[_0xef9a('0x76')]=function(_0x5bc86d,_0x580557,_0x585205){return db[_0xef9a('0x66')][_0xef9a('0x46')]({'where':{'id':_0x5bc86d[_0xef9a('0x37')]['ids']},'attributes':['id'],'include':[{'model':db[_0xef9a('0x6c')],'as':_0xef9a('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x580557,null))['then'](function(_0x422114){var _0x57b81b=_[_0xef9a('0x36')](_0x422114,'id');var _0x2b1594=[];var _0x70b9df=[];var _0x151a5f=squel[_0xef9a('0x78')]();_0x151a5f[_0xef9a('0x79')](_0xef9a('0x7a'))[_0xef9a('0x7b')](_0xef9a('0x7c'),'tq')[_0xef9a('0x7d')](_0xef9a('0x7e'),'ut',_0xef9a('0x7f'))['where']('FaxQueueId\x20=\x20?',_0x5bc86d['params']['id']);for(var _0x5efade=0x0;_0x5efade<_0x422114['length'];_0x5efade+=0x1){let _0x18a149=_0x422114[_0x5efade];for(var _0x1025fe=0x0;_0x1025fe<_0x18a149['Agents'][_0xef9a('0x3c')];_0x1025fe+=0x1){let _0x1765e9=_0x18a149['Agents'][_0x1025fe];var _0x360b8e=_0x151a5f['clone']();_0x360b8e[_0xef9a('0x3e')](_0xef9a('0x80'),_0x1765e9['id']);_0x70b9df['push'](db[_0xef9a('0x71')]['query'](_0x360b8e[_0xef9a('0x81')](),{'type':db[_0xef9a('0x71')][_0xef9a('0x82')][_0xef9a('0x83')]})[_0xef9a('0x2a')](function(_0x4bf122){if(_0x4bf122['length']===0x1){return _0x1765e9['id'];}else{var _0x2d5301=_[_0xef9a('0x84')](_['map'](_0x4bf122,'TeamId'),function(_0x2c69bf){return _[_0xef9a('0x85')](_0x57b81b,_0x2c69bf);});if(_0x2d5301){return _0x1765e9['id'];}}}));}}return BPromise[_0xef9a('0x86')](_0x70b9df)[_0xef9a('0x2a')](function(_0x42e065){_0x2b1594=_(_0x2b1594)['union'](_0x42e065)[_0xef9a('0x87')]()[_0xef9a('0x88')]();return db[_0xef9a('0x30')][_0xef9a('0x4b')]({'where':{'id':_0x5bc86d[_0xef9a('0x49')]['id']}})[_0xef9a('0x2a')](function(_0x26d17c){return db[_0xef9a('0x71')][_0xef9a('0x89')](function(_0x38edf3){return _0x26d17c['removeTeams'](_0x5bc86d[_0xef9a('0x37')][_0xef9a('0x6b')],{'transaction':_0x38edf3})[_0xef9a('0x2a')](function(){if(!_['isEmpty'](_0x2b1594)){return _0x26d17c[_0xef9a('0x8a')](_0x2b1594,{'transaction':_0x38edf3});}})['then'](function(){_0x2b1594[_0xef9a('0x8b')](function(_0x48dd22){socket[_0xef9a('0x74')]('userFaxQueue:remove',{'UserId':_0x48dd22,'FaxQueueId':_0x26d17c['id']});});});});});});})[_0xef9a('0x2a')](respondWithStatusCode(_0x580557,null))['catch'](handleError(_0x580557,null));};exports[_0xef9a('0x8c')]=function(_0x489973,_0x16b717,_0x5c3c79){return db[_0xef9a('0x30')][_0xef9a('0x4b')]({'where':{'id':_0x489973[_0xef9a('0x49')]['id']}})[_0xef9a('0x2a')](handleEntityNotFound(_0x16b717,null))[_0xef9a('0x2a')](function(_0x521151){if(_0x521151){return _0x521151[_0xef9a('0x8c')](_0x489973[_0xef9a('0x4e')][_0xef9a('0x6b')],_[_0xef9a('0x8d')](_0x489973[_0xef9a('0x4e')],[_0xef9a('0x6b'),'id'])||{})['spread'](function(_0x5a0eab){for(var _0x3db43e=0x0;_0x3db43e<_0x489973[_0xef9a('0x4e')]['ids'][_0xef9a('0x3c')];_0x3db43e+=0x1){socket['emit']('userFaxQueue:save',{'UserId':_0x489973[_0xef9a('0x4e')][_0xef9a('0x6b')][_0x3db43e],'FaxQueueId':_0x489973[_0xef9a('0x49')]['id']});}return _0x5a0eab;});}})[_0xef9a('0x2a')](respondWithResult(_0x16b717,null))[_0xef9a('0x4c')](handleError(_0x16b717,null));};exports[_0xef9a('0x8a')]=function(_0x581d72,_0x3dff91,_0x2206a7){return db[_0xef9a('0x30')][_0xef9a('0x4b')]({'where':{'id':_0x581d72['params']['id']}})[_0xef9a('0x2a')](handleEntityNotFound(_0x3dff91,null))[_0xef9a('0x2a')](function(_0x8dd476){if(_0x8dd476){return _0x8dd476[_0xef9a('0x8a')](_0x581d72[_0xef9a('0x37')][_0xef9a('0x6b')])['then'](function(){if(_[_0xef9a('0x8e')](_0x581d72[_0xef9a('0x37')]['ids'])){for(var _0x47c627=0x0;_0x47c627<_0x581d72[_0xef9a('0x37')][_0xef9a('0x6b')]['length'];_0x47c627+=0x1){socket[_0xef9a('0x74')](_0xef9a('0x8f'),{'UserId':Number(_0x581d72[_0xef9a('0x37')][_0xef9a('0x6b')][_0x47c627]),'FaxQueueId':Number(_0x581d72[_0xef9a('0x49')]['id'])});}}else{socket['emit'](_0xef9a('0x8f'),{'UserId':Number(_0x581d72[_0xef9a('0x37')][_0xef9a('0x6b')]),'FaxQueueId':Number(_0x581d72['params']['id'])});}});}})[_0xef9a('0x2a')](respondWithStatusCode(_0x3dff91,null))[_0xef9a('0x4c')](handleError(_0x3dff91,null));};exports[_0xef9a('0x90')]=function(_0x2ab118,_0x536fd6,_0x21c564){var _0x588294={};var _0x33efe6={};var _0x54b8c0;var _0x21c248;return db[_0xef9a('0x30')][_0xef9a('0x5a')]({'where':{'id':_0x2ab118[_0xef9a('0x49')]['id']}})[_0xef9a('0x2a')](handleEntityNotFound(_0x536fd6,null))['then'](function(_0x2404ca){if(_0x2404ca){_0x54b8c0=_0x2404ca;_0x33efe6[_0xef9a('0x35')]=_['keys'](db[_0xef9a('0x6c')][_0xef9a('0x31')]);_0x33efe6['query']=_[_0xef9a('0x38')](_0x2ab118[_0xef9a('0x37')]);_0x33efe6['filters']=_[_0xef9a('0x39')](_0x33efe6[_0xef9a('0x35')],_0x33efe6[_0xef9a('0x37')]);_0x588294['attributes']=_['intersection'](_0x33efe6['model'],qs[_0xef9a('0x3b')](_0x2ab118['query'][_0xef9a('0x3b')]));_0x588294[_0xef9a('0x3a')]=_0x588294[_0xef9a('0x3a')][_0xef9a('0x3c')]?_0x588294['attributes']:_0x33efe6[_0xef9a('0x35')];_0x588294[_0xef9a('0x67')]=qs[_0xef9a('0x3d')](_0x2ab118[_0xef9a('0x37')][_0xef9a('0x3d')]);_0x588294[_0xef9a('0x3e')]=qs[_0xef9a('0x3f')](_[_0xef9a('0x40')](_0x2ab118[_0xef9a('0x37')],_0x33efe6[_0xef9a('0x3f')]));if(_0x2ab118[_0xef9a('0x37')][_0xef9a('0x42')]){_0x588294['where']=_[_0xef9a('0x4a')](_0x588294['where'],{'$or':_[_0xef9a('0x36')](_0x588294[_0xef9a('0x3a')],function(_0x574b9a){var _0x3da08f={};_0x3da08f[_0x574b9a]={'$like':'%'+_0x2ab118[_0xef9a('0x37')][_0xef9a('0x42')]+'%'};return _0x3da08f;})});}_0x588294=_[_0xef9a('0x4a')]({},_0x588294,_0x2ab118[_0xef9a('0x43')]);return _0x54b8c0[_0xef9a('0x90')](_0x588294);}})[_0xef9a('0x2a')](function(_0x174f01){if(_0x174f01){_0x21c248=_0x174f01['length'];if(!_0x2ab118[_0xef9a('0x37')][_0xef9a('0x68')](_0xef9a('0x69'))){_0x588294[_0xef9a('0x22')]=qs['limit'](_0x2ab118[_0xef9a('0x37')][_0xef9a('0x22')]);_0x588294[_0xef9a('0x21')]=qs[_0xef9a('0x21')](_0x2ab118[_0xef9a('0x37')][_0xef9a('0x21')]);}return _0x54b8c0[_0xef9a('0x90')](_0x588294);}})[_0xef9a('0x2a')](function(_0x211d30){if(_0x211d30){return _0x211d30?{'count':_0x21c248,'rows':_0x211d30}:null;}})['then'](respondWithResult(_0x536fd6,null))[_0xef9a('0x4c')](handleError(_0x536fd6,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b91ca00..24e556d 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 _0x93fd=['exports','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x2cbaa5,_0x2349e2){var _0x5bb0cc=function(_0x2f9462){while(--_0x2f9462){_0x2cbaa5['push'](_0x2cbaa5['shift']());}};_0x5bb0cc(++_0x2349e2);}(_0x93fd,0x1dd));var _0xd93f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x93fd[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xd93f('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xd93f('0x1')](0x0);var events={'afterCreate':_0xd93f('0x2'),'afterUpdate':_0xd93f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2dc9e9){return function(_0x54cc23,_0x49ce75,_0xbacfe9){FaxQueueEvents[_0xd93f('0x4')](_0x2dc9e9+':'+_0x54cc23['id'],_0x54cc23);FaxQueueEvents[_0xd93f('0x4')](_0x2dc9e9,_0x54cc23);_0xbacfe9(null);};}for(var e in events){if(events[_0xd93f('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xd93f('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0xdd56=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x486f48,_0x23528f){var _0x5668eb=function(_0x1b570f){while(--_0x1b570f){_0x486f48['push'](_0x486f48['shift']());}};_0x5668eb(++_0x23528f);}(_0xdd56,0xc9));var _0x6dd5=function(_0x1baecc,_0x38bce1){_0x1baecc=_0x1baecc-0x0;var _0x4ab1d1=_0xdd56[_0x1baecc];return _0x4ab1d1;};'use strict';var EventEmitter=require(_0x6dd5('0x0'));var FaxQueue=require(_0x6dd5('0x1'))['db'][_0x6dd5('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x6dd5('0x3')](0x0);var events={'afterCreate':_0x6dd5('0x4'),'afterUpdate':_0x6dd5('0x5'),'afterDestroy':_0x6dd5('0x6')};function emitEvent(_0x53c44f){return function(_0x5254bc,_0x187b3a,_0x37dac5){FaxQueueEvents[_0x6dd5('0x7')](_0x53c44f+':'+_0x5254bc['id'],_0x5254bc);FaxQueueEvents[_0x6dd5('0x7')](_0x53c44f,_0x5254bc);_0x37dac5(null);};}for(var e in events){if(events[_0x6dd5('0x8')](e)){var event=events[e];FaxQueue[_0x6dd5('0x9')](e,emitEvent(event));}}module[_0x6dd5('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index b1f8117..d5a5114 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 _0xd805=['bluebird','path','./faxQueue.attributes','exports','define','FaxQueue','util','../../config/logger','api','moment'];(function(_0x2c42c5,_0x14255){var _0x524503=function(_0x3baeec){while(--_0x3baeec){_0x2c42c5['push'](_0x2c42c5['shift']());}};_0x524503(++_0x14255);}(_0xd805,0x13c));var _0x5d80=function(_0x2b84d5,_0x428914){_0x2b84d5=_0x2b84d5-0x0;var _0x51452a=_0xd805[_0x2b84d5];return _0x51452a;};'use strict';var _=require('lodash');var util=require(_0x5d80('0x0'));var logger=require(_0x5d80('0x1'))(_0x5d80('0x2'));var moment=require(_0x5d80('0x3'));var BPromise=require(_0x5d80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d80('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d80('0x6'));module[_0x5d80('0x7')]=function(_0x145804,_0x588668){return _0x145804[_0x5d80('0x8')](_0x5d80('0x9'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b46=['define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x2a4b4a,_0xc869f0){var _0x1d4bc2=function(_0x24392e){while(--_0x24392e){_0x2a4b4a['push'](_0x2a4b4a['shift']());}};_0x1d4bc2(++_0xc869f0);}(_0x5b46,0x1f1));var _0x65b4=function(_0xb35802,_0xa3d53f){_0xb35802=_0xb35802-0x0;var _0x11e6a3=_0x5b46[_0xb35802];return _0x11e6a3;};'use strict';var _=require(_0x65b4('0x0'));var util=require(_0x65b4('0x1'));var logger=require(_0x65b4('0x2'))(_0x65b4('0x3'));var moment=require(_0x65b4('0x4'));var BPromise=require(_0x65b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x65b4('0x6'));var config=require(_0x65b4('0x7'));var attributes=require(_0x65b4('0x8'));module[_0x65b4('0x9')]=function(_0x4929a0,_0x4d3deb){return _0x4929a0[_0x65b4('0xa')](_0x65b4('0xb'),attributes,{'tableName':_0x65b4('0xc'),'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 7bf4cef..51e1130 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 _0x15f2=['request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','raw','where','limit','map','model','attributes','include','catch','ShowFaxQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register'];(function(_0x6d34f7,_0x2194c4){var _0x98f803=function(_0x29808a){while(--_0x29808a){_0x6d34f7['push'](_0x6d34f7['shift']());}};_0x98f803(++_0x2194c4);}(_0x15f2,0xfb));var _0x215f=function(_0x4cba86,_0x51a278){_0x4cba86=_0x4cba86-0x0;var _0x268f75=_0x15f2[_0x4cba86];return _0x268f75;};'use strict';var _=require(_0x215f('0x0'));var util=require(_0x215f('0x1'));var moment=require(_0x215f('0x2'));var BPromise=require(_0x215f('0x3'));var rs=require(_0x215f('0x4'));var fs=require('fs');var Redis=require(_0x215f('0x5'));var db=require(_0x215f('0x6'))['db'];var utils=require(_0x215f('0x7'));var logger=require('../../config/logger')(_0x215f('0x8'));var config=require(_0x215f('0x9'));var jayson=require(_0x215f('0xa'));var client=jayson[_0x215f('0xb')][_0x215f('0xc')]({'port':0x232a});config[_0x215f('0xd')]=_[_0x215f('0xe')](config[_0x215f('0xd')],{'host':_0x215f('0xf'),'port':0x18eb});var socket=require(_0x215f('0x10'))(new Redis(config['redis']));require(_0x215f('0x11'))[_0x215f('0x12')](socket);function respondWithRpcPromise(_0x4d6202,_0x2835ad,_0x3db0ce){return new BPromise(function(_0x1a76b6,_0x20aa61){return client[_0x215f('0x13')](_0x4d6202,_0x3db0ce)[_0x215f('0x14')](function(_0x5ea655){logger[_0x215f('0x15')](_0x215f('0x16'),_0x2835ad,_0x215f('0x17'));logger[_0x215f('0x18')](_0x215f('0x19'),_0x2835ad,_0x215f('0x17'),JSON[_0x215f('0x1a')](_0x5ea655));if(_0x5ea655[_0x215f('0x1b')]){if(_0x5ea655[_0x215f('0x1b')][_0x215f('0x1c')]===0x1f4){logger[_0x215f('0x1b')](_0x215f('0x16'),_0x2835ad,_0x5ea655[_0x215f('0x1b')][_0x215f('0x1d')]);return _0x20aa61(_0x5ea655[_0x215f('0x1b')][_0x215f('0x1d')]);}logger[_0x215f('0x1b')](_0x215f('0x16'),_0x2835ad,_0x5ea655[_0x215f('0x1b')][_0x215f('0x1d')]);return _0x1a76b6(_0x5ea655['error'][_0x215f('0x1d')]);}else{logger[_0x215f('0x15')](_0x215f('0x16'),_0x2835ad,_0x215f('0x17'));_0x1a76b6(_0x5ea655[_0x215f('0x1e')][_0x215f('0x1d')]);}})['catch'](function(_0x4e1b38){logger['error']('FaxQueue,\x20%s,\x20%s',_0x2835ad,_0x4e1b38);_0x20aa61(_0x4e1b38);});});}exports[_0x215f('0x1f')]=function(_0x5c43ea){var _0x369c05=this;return new Promise(function(_0x548c75,_0x285b21){return db[_0x215f('0x20')][_0x215f('0x21')]({'raw':_0x5c43ea[_0x215f('0x22')]?_0x5c43ea[_0x215f('0x22')][_0x215f('0x23')]===undefined?!![]:![]:!![],'where':_0x5c43ea[_0x215f('0x22')]?_0x5c43ea[_0x215f('0x22')][_0x215f('0x24')]||null:null,'attributes':_0x5c43ea[_0x215f('0x22')]?_0x5c43ea[_0x215f('0x22')]['attributes']||null:null,'limit':_0x5c43ea[_0x215f('0x22')]?_0x5c43ea['options'][_0x215f('0x25')]||null:null,'include':_0x5c43ea[_0x215f('0x22')]?_0x5c43ea['options']['include']?_[_0x215f('0x26')](_0x5c43ea[_0x215f('0x22')]['include'],function(_0x1b8ccb){return{'model':db[_0x1b8ccb[_0x215f('0x27')]],'as':_0x1b8ccb['as'],'attributes':_0x1b8ccb[_0x215f('0x28')],'include':_0x1b8ccb[_0x215f('0x29')]?_[_0x215f('0x26')](_0x1b8ccb['include'],function(_0x33b4cc){return{'model':db[_0x33b4cc[_0x215f('0x27')]],'as':_0x33b4cc['as'],'attributes':_0x33b4cc[_0x215f('0x28')],'include':_0x33b4cc[_0x215f('0x29')]?_['map'](_0x33b4cc['include'],function(_0x6d5eb7){return{'model':db[_0x6d5eb7[_0x215f('0x27')]],'as':_0x6d5eb7['as'],'attributes':_0x6d5eb7[_0x215f('0x28')]};}):[]};}):[]};}):[]:[]})[_0x215f('0x14')](function(_0x247cae){logger[_0x215f('0x15')]('GetFaxQueue',_0x5c43ea);logger['debug']('GetFaxQueue',_0x5c43ea,JSON[_0x215f('0x1a')](_0x247cae));_0x548c75(_0x247cae);})[_0x215f('0x2a')](function(_0x4c32df){logger[_0x215f('0x1b')](_0x215f('0x1f'),_0x4c32df['message'],_0x5c43ea);_0x285b21(_0x369c05[_0x215f('0x1b')](0x1f4,_0x4c32df[_0x215f('0x1d')]));});});};exports[_0x215f('0x2b')]=function(_0x2743ad){var _0x324980=this;return new Promise(function(_0x50a7f1,_0x37865b){return db[_0x215f('0x20')][_0x215f('0x2c')]({'raw':_0x2743ad[_0x215f('0x22')]?_0x2743ad[_0x215f('0x22')][_0x215f('0x23')]===undefined?!![]:![]:!![],'where':_0x2743ad[_0x215f('0x22')]?_0x2743ad['options'][_0x215f('0x24')]||null:null,'attributes':_0x2743ad['options']?_0x2743ad[_0x215f('0x22')][_0x215f('0x28')]||null:null,'include':_0x2743ad['options']?_0x2743ad[_0x215f('0x22')][_0x215f('0x29')]?_[_0x215f('0x26')](_0x2743ad[_0x215f('0x22')][_0x215f('0x29')],function(_0x25b4a1){return{'model':db[_0x25b4a1[_0x215f('0x27')]],'as':_0x25b4a1['as'],'attributes':_0x25b4a1[_0x215f('0x28')],'include':_0x25b4a1[_0x215f('0x29')]?_[_0x215f('0x26')](_0x25b4a1[_0x215f('0x29')],function(_0x7d94e6){return{'model':db[_0x7d94e6[_0x215f('0x27')]],'as':_0x7d94e6['as'],'attributes':_0x7d94e6[_0x215f('0x28')],'include':_0x7d94e6[_0x215f('0x29')]?_[_0x215f('0x26')](_0x7d94e6['include'],function(_0x126466){return{'model':db[_0x126466[_0x215f('0x27')]],'as':_0x126466['as'],'attributes':_0x126466['attributes']};}):[]};}):[]};}):[]:[]})[_0x215f('0x14')](function(_0x2f9ed6){logger[_0x215f('0x15')](_0x215f('0x2b'),_0x2743ad);logger[_0x215f('0x18')]('ShowFaxQueue',_0x2743ad,JSON['stringify'](_0x2f9ed6));_0x50a7f1(_0x2f9ed6);})[_0x215f('0x2a')](function(_0x236284){logger[_0x215f('0x1b')](_0x215f('0x2b'),_0x236284[_0x215f('0x1d')],_0x2743ad);_0x37865b(_0x324980[_0x215f('0x1b')](0x1f4,_0x236284[_0x215f('0x1d')]));});});}; \ No newline at end of file +var _0x597b=['stringify','code','error','message','FaxQueue,\x20%s,\x20%s','info','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','debug','ShowFaxQueue','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','request','then','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0x89f89e,_0x5cbab5){var _0x1a9625=function(_0xc86b16){while(--_0xc86b16){_0x89f89e['push'](_0x89f89e['shift']());}};_0x1a9625(++_0x5cbab5);}(_0x597b,0x1d8));var _0xb597=function(_0xe278b9,_0x551708){_0xe278b9=_0xe278b9-0x0;var _0x2609a9=_0x597b[_0xe278b9];return _0x2609a9;};'use strict';var _=require(_0xb597('0x0'));var util=require(_0xb597('0x1'));var moment=require('moment');var BPromise=require(_0xb597('0x2'));var rs=require(_0xb597('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb597('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb597('0x5'))(_0xb597('0x6'));var config=require(_0xb597('0x7'));var jayson=require(_0xb597('0x8'));var client=jayson[_0xb597('0x9')][_0xb597('0xa')]({'port':0x232a});config['redis']=_[_0xb597('0xb')](config[_0xb597('0xc')],{'host':_0xb597('0xd'),'port':0x18eb});var socket=require(_0xb597('0xe'))(new Redis(config[_0xb597('0xc')]));require(_0xb597('0xf'))['register'](socket);function respondWithRpcPromise(_0xe1336c,_0x1e526d,_0x9fd7f7){return new BPromise(function(_0x38a790,_0x47e44c){return client[_0xb597('0x10')](_0xe1336c,_0x9fd7f7)[_0xb597('0x11')](function(_0x5df99e){logger['info']('FaxQueue,\x20%s,\x20%s',_0x1e526d,_0xb597('0x12'));logger['debug'](_0xb597('0x13'),_0x1e526d,_0xb597('0x12'),JSON[_0xb597('0x14')](_0x5df99e));if(_0x5df99e['error']){if(_0x5df99e['error'][_0xb597('0x15')]===0x1f4){logger[_0xb597('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1e526d,_0x5df99e[_0xb597('0x16')][_0xb597('0x17')]);return _0x47e44c(_0x5df99e[_0xb597('0x16')][_0xb597('0x17')]);}logger[_0xb597('0x16')](_0xb597('0x18'),_0x1e526d,_0x5df99e[_0xb597('0x16')][_0xb597('0x17')]);return _0x38a790(_0x5df99e[_0xb597('0x16')]['message']);}else{logger[_0xb597('0x19')]('FaxQueue,\x20%s,\x20%s',_0x1e526d,_0xb597('0x12'));_0x38a790(_0x5df99e[_0xb597('0x1a')][_0xb597('0x17')]);}})[_0xb597('0x1b')](function(_0x3a911f){logger[_0xb597('0x16')](_0xb597('0x18'),_0x1e526d,_0x3a911f);_0x47e44c(_0x3a911f);});});}exports[_0xb597('0x1c')]=function(_0x4caf49){var _0x4be26d=this;return new Promise(function(_0x32fae4,_0xe4718e){return db['FaxQueue'][_0xb597('0x1d')]({'raw':_0x4caf49[_0xb597('0x1e')]?_0x4caf49['options'][_0xb597('0x1f')]===undefined?!![]:![]:!![],'where':_0x4caf49[_0xb597('0x1e')]?_0x4caf49[_0xb597('0x1e')][_0xb597('0x20')]||null:null,'attributes':_0x4caf49[_0xb597('0x1e')]?_0x4caf49['options'][_0xb597('0x21')]||null:null,'limit':_0x4caf49[_0xb597('0x1e')]?_0x4caf49['options'][_0xb597('0x22')]||null:null,'include':_0x4caf49['options']?_0x4caf49[_0xb597('0x1e')][_0xb597('0x23')]?_[_0xb597('0x24')](_0x4caf49[_0xb597('0x1e')][_0xb597('0x23')],function(_0x3f033f){return{'model':db[_0x3f033f[_0xb597('0x25')]],'as':_0x3f033f['as'],'attributes':_0x3f033f[_0xb597('0x21')],'include':_0x3f033f[_0xb597('0x23')]?_[_0xb597('0x24')](_0x3f033f[_0xb597('0x23')],function(_0x38f16f){return{'model':db[_0x38f16f[_0xb597('0x25')]],'as':_0x38f16f['as'],'attributes':_0x38f16f[_0xb597('0x21')],'include':_0x38f16f[_0xb597('0x23')]?_[_0xb597('0x24')](_0x38f16f['include'],function(_0x2e131b){return{'model':db[_0x2e131b[_0xb597('0x25')]],'as':_0x2e131b['as'],'attributes':_0x2e131b['attributes']};}):[]};}):[]};}):[]:[]})[_0xb597('0x11')](function(_0x42e7e4){logger[_0xb597('0x19')](_0xb597('0x1c'),_0x4caf49);logger[_0xb597('0x26')](_0xb597('0x1c'),_0x4caf49,JSON['stringify'](_0x42e7e4));_0x32fae4(_0x42e7e4);})[_0xb597('0x1b')](function(_0x5c7308){logger['error']('GetFaxQueue',_0x5c7308[_0xb597('0x17')],_0x4caf49);_0xe4718e(_0x4be26d[_0xb597('0x16')](0x1f4,_0x5c7308[_0xb597('0x17')]));});});};exports[_0xb597('0x27')]=function(_0x541f81){var _0xb32346=this;return new Promise(function(_0x8472e9,_0x3dad86){return db['FaxQueue'][_0xb597('0x28')]({'raw':_0x541f81[_0xb597('0x1e')]?_0x541f81[_0xb597('0x1e')][_0xb597('0x1f')]===undefined?!![]:![]:!![],'where':_0x541f81[_0xb597('0x1e')]?_0x541f81[_0xb597('0x1e')][_0xb597('0x20')]||null:null,'attributes':_0x541f81[_0xb597('0x1e')]?_0x541f81['options'][_0xb597('0x21')]||null:null,'include':_0x541f81['options']?_0x541f81[_0xb597('0x1e')][_0xb597('0x23')]?_[_0xb597('0x24')](_0x541f81[_0xb597('0x1e')][_0xb597('0x23')],function(_0x467ddb){return{'model':db[_0x467ddb[_0xb597('0x25')]],'as':_0x467ddb['as'],'attributes':_0x467ddb[_0xb597('0x21')],'include':_0x467ddb[_0xb597('0x23')]?_['map'](_0x467ddb['include'],function(_0x34a565){return{'model':db[_0x34a565[_0xb597('0x25')]],'as':_0x34a565['as'],'attributes':_0x34a565[_0xb597('0x21')],'include':_0x34a565[_0xb597('0x23')]?_[_0xb597('0x24')](_0x34a565[_0xb597('0x23')],function(_0x4922ae){return{'model':db[_0x4922ae['model']],'as':_0x4922ae['as'],'attributes':_0x4922ae[_0xb597('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb597('0x11')](function(_0x4ccb84){logger[_0xb597('0x19')]('ShowFaxQueue',_0x541f81);logger[_0xb597('0x26')](_0xb597('0x27'),_0x541f81,JSON[_0xb597('0x14')](_0x4ccb84));_0x8472e9(_0x4ccb84);})[_0xb597('0x1b')](function(_0x149062){logger[_0xb597('0x16')](_0xb597('0x27'),_0x149062[_0xb597('0x17')],_0x541f81);_0x3dad86(_0xb32346[_0xb597('0x16')](0x1f4,_0x149062[_0xb597('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index b42ec44..a1ebf04 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 _0x83a4=['update','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x83a4,0x10d));var _0x483a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x83a4[_0xfae23b];return _0x200640;};'use strict';var FaxQueueEvents=require(_0x483a('0x0'));var events=[_0x483a('0x1'),_0x483a('0x2'),_0x483a('0x3')];function createListener(_0x3cf5a4,_0x114b12){return function(_0x37b8ab){_0x114b12['emit'](_0x3cf5a4,_0x37b8ab);};}function removeListener(_0x20f08e,_0x2554c2){return function(){FaxQueueEvents[_0x483a('0x4')](_0x20f08e,_0x2554c2);};}exports[_0x483a('0x5')]=function(_0x482af0){for(var _0x57c5b0=0x0,_0x19cd69=events[_0x483a('0x6')];_0x57c5b0<_0x19cd69;_0x57c5b0++){var _0xd700f0=events[_0x57c5b0];var _0x4da883=createListener(_0x483a('0x7')+_0xd700f0,_0x482af0);FaxQueueEvents['on'](_0xd700f0,_0x4da883);}}; \ No newline at end of file +var _0xf8b2=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf8b2,0x1a9));var _0x2f8b=function(_0x149225,_0x5869e2){_0x149225=_0x149225-0x0;var _0x21e6ac=_0xf8b2[_0x149225];return _0x21e6ac;};'use strict';var FaxQueueEvents=require(_0x2f8b('0x0'));var events=[_0x2f8b('0x1'),_0x2f8b('0x2'),_0x2f8b('0x3')];function createListener(_0x5714ba,_0x4dfef5){return function(_0x1a593a){_0x4dfef5[_0x2f8b('0x4')](_0x5714ba,_0x1a593a);};}function removeListener(_0x2f325f,_0x23e3df){return function(){FaxQueueEvents[_0x2f8b('0x5')](_0x2f325f,_0x23e3df);};}exports[_0x2f8b('0x6')]=function(_0x5075a8){for(var _0xc9accf=0x0,_0x2b210d=events[_0x2f8b('0x7')];_0xc9accf<_0x2b210d;_0xc9accf++){var _0x525e2e=events[_0xc9accf];var _0x36d6a6=createListener(_0x2f8b('0x8')+_0x525e2e,_0x5075a8);FaxQueueEvents['on'](_0x525e2e,_0x36d6a6);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index d4235c6..f802c4d 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 _0x5f2f=['removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','/:id/members','getTeams','getAgents','post','create','addTeams','/:id/users','put','update','delete','destroy','/:id/teams'];(function(_0x20b3ce,_0x3a749a){var _0x3cace2=function(_0x2832ba){while(--_0x2832ba){_0x20b3ce['push'](_0x20b3ce['shift']());}};_0x3cace2(++_0x3a749a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30db46,_0x5dedc8){_0x30db46=_0x30db46-0x0;var _0x366c5c=_0x5f2f[_0x30db46];return _0x366c5c;};'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('./faxQueue.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('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getMembers']);router[_0xf5f2('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x8')]('/:id/users',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x11')]);router[_0xf5f2('0x10')]('/:id/teams',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x10')](_0xf5f2('0x13'),auth[_0xf5f2('0x9')](),controller['addAgents']);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x15')]);router[_0xf5f2('0x16')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x16')](_0xf5f2('0x18'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x19')]);router[_0xf5f2('0x16')](_0xf5f2('0x13'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1a')]);module[_0xf5f2('0x1b')]=router; \ No newline at end of file +var _0x0b0e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x20e764,_0x19811d){_0x20e764=_0x20e764-0x0;var _0x4ebc22=_0x0b0e[_0x20e764];return _0x4ebc22;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getMembers']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x8')](_0xe0b0('0x11'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')]('/:id/teams',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);router[_0xe0b0('0x13')](_0xe0b0('0x11'),auth[_0xe0b0('0x9')](),controller['addAgents']);router[_0xe0b0('0x16')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x17')]);router['delete'](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0x18')]);router[_0xe0b0('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe0b0('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe0b0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 6491acd..9916ae8 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 _0x6008=['sequelize','STRING','DATE','moment'];(function(_0x315aa8,_0x262f9c){var _0x20f758=function(_0x1765e7){while(--_0x1765e7){_0x315aa8['push'](_0x315aa8['shift']());}};_0x20f758(++_0x262f9c);}(_0x6008,0x1bb));var _0x8600=function(_0x476654,_0x3f2547){_0x476654=_0x476654-0x0;var _0x55eebb=_0x6008[_0x476654];return _0x55eebb;};'use strict';var moment=require(_0x8600('0x0'));var Sequelize=require(_0x8600('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8600('0x2')]},'joinAt':{'type':Sequelize[_0x8600('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x8600('0x3')]},'exitAt':{'type':Sequelize[_0x8600('0x3')]},'reason':{'type':Sequelize[_0x8600('0x2')]}}; \ No newline at end of file +var _0x0917=['STRING','DATE','moment','exports'];(function(_0x2b37b5,_0x4f677b){var _0x36df6d=function(_0x501dc7){while(--_0x501dc7){_0x2b37b5['push'](_0x2b37b5['shift']());}};_0x36df6d(++_0x4f677b);}(_0x0917,0x17e));var _0x7091=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0x0917[_0x448f8];return _0xa73126;};'use strict';var moment=require(_0x7091('0x0'));var Sequelize=require('sequelize');module[_0x7091('0x1')]={'uniqueid':{'type':Sequelize[_0x7091('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7091('0x2')]},'joinAt':{'type':Sequelize[_0x7091('0x3')]},'leaveAt':{'type':Sequelize[_0x7091('0x3')]},'acceptAt':{'type':Sequelize[_0x7091('0x3')]},'exitAt':{'type':Sequelize[_0x7091('0x3')]},'reason':{'type':Sequelize[_0x7091('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 42b71c6..8fa5791 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 _0xa53b=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','count','offset','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','index','FaxQueueReport','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','moment','path','sox','to-csv','ejs','lodash','squel'];(function(_0x423ccb,_0x210002){var _0xafea3f=function(_0x3ebdc7){while(--_0x3ebdc7){_0x423ccb['push'](_0x423ccb['shift']());}};_0xafea3f(++_0x210002);}(_0xa53b,0x81));var _0xba53=function(_0x1442aa,_0x5e99f){_0x1442aa=_0x1442aa-0x0;var _0x294f34=_0xa53b[_0x1442aa];return _0x294f34;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba53('0x0'));var rimraf=require(_0xba53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xba53('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xba53('0x3'));var sox=require(_0xba53('0x4'));var csv=require(_0xba53('0x5'));var ejs=require(_0xba53('0x6'));var fs=require('fs');var _=require(_0xba53('0x7'));var squel=require(_0xba53('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba53('0x9'));var toCsv=require(_0xba53('0x5'));var querystring=require(_0xba53('0xa'));var Papa=require('papaparse');var Redis=require(_0xba53('0xb'));var authService=require(_0xba53('0xc'));var qs=require(_0xba53('0xd'));var as=require(_0xba53('0xe'));var hardwareService=require(_0xba53('0xf'));var logger=require(_0xba53('0x10'))('api');var utils=require(_0xba53('0x11'));var config=require('../../config/environment');var db=require(_0xba53('0x12'))['db'];function respondWithStatusCode(_0x382f2,_0x2999d5){_0x2999d5=_0x2999d5||0xcc;return function(_0x4ee8d6){if(_0x4ee8d6){return _0x382f2['sendStatus'](_0x2999d5);}return _0x382f2[_0xba53('0x13')](_0x2999d5)['end']();};}function respondWithResult(_0x4b8ac6,_0x2f62f3){_0x2f62f3=_0x2f62f3||0xc8;return function(_0x29ae73){if(_0x29ae73){return _0x4b8ac6[_0xba53('0x13')](_0x2f62f3)['json'](_0x29ae73);}};}function respondWithFilteredResult(_0x372972,_0x2241f7){return function(_0x537ad4){if(_0x537ad4){var _0x1f3397=_0x537ad4[_0xba53('0x14')],_0x20c9fc=_0x2241f7[_0xba53('0x15')],_0x3b60b0=_0x2241f7[_0xba53('0x15')]+_0x2241f7['limit'],_0xd3e207;if(_0x3b60b0>=_0x1f3397){_0x3b60b0=_0x1f3397;_0xd3e207=0xc8;}else{_0xd3e207=0xce;}_0x372972[_0xba53('0x13')](_0xd3e207);return _0x372972[_0xba53('0x16')](_0xba53('0x17'),_0x20c9fc+'-'+_0x3b60b0+'/'+_0x1f3397)[_0xba53('0x18')](_0x537ad4);}return null;};}function patchUpdates(_0x51d4b6){return function(_0x50711a){try{jsonpatch[_0xba53('0x19')](_0x50711a,_0x51d4b6,!![]);}catch(_0x33a586){return BPromise['reject'](_0x33a586);}return _0x50711a[_0xba53('0x1a')]();};}function saveUpdates(_0x5d5b3b,_0x35261f){return function(_0x43fb0d){if(_0x43fb0d){return _0x43fb0d[_0xba53('0x1b')](_0x5d5b3b)[_0xba53('0x1c')](function(_0x314586){return _0x314586;});}return null;};}function removeEntity(_0x1cde64,_0x3d80ad){return function(_0x38e046){if(_0x38e046){return _0x38e046[_0xba53('0x1d')]()['then'](function(){_0x1cde64[_0xba53('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26b0e6,_0x4050e9){return function(_0x46e98d){if(!_0x46e98d){_0x26b0e6[_0xba53('0x1e')](0x194);}return _0x46e98d;};}function handleError(_0x292c93,_0x5a3e1e){_0x5a3e1e=_0x5a3e1e||0x1f4;return function(_0x223928){logger[_0xba53('0x1f')](_0x223928[_0xba53('0x20')]);if(_0x223928['name']){delete _0x223928['name'];}_0x292c93[_0xba53('0x13')](_0x5a3e1e)['send'](_0x223928);};}exports[_0xba53('0x21')]=function(_0x164bc3,_0x297d5a){var _0x47d617={},_0x471739={},_0xaadf73={'count':0x0,'rows':[]};var _0x30b0cd=_['map'](db[_0xba53('0x22')][_0xba53('0x23')],function(_0x297d6d){return{'name':_0x297d6d[_0xba53('0x24')],'type':_0x297d6d[_0xba53('0x25')][_0xba53('0x26')]};});_0x471739[_0xba53('0x27')]=_[_0xba53('0x28')](_0x30b0cd,_0xba53('0x29'));_0x471739[_0xba53('0x2a')]=_[_0xba53('0x2b')](_0x164bc3['query']);_0x471739[_0xba53('0x2c')]=_['intersection'](_0x471739['model'],_0x471739[_0xba53('0x2a')]);_0x47d617[_0xba53('0x2d')]=_[_0xba53('0x2e')](_0x471739[_0xba53('0x27')],qs[_0xba53('0x2f')](_0x164bc3[_0xba53('0x2a')]['fields']));_0x47d617[_0xba53('0x2d')]=_0x47d617[_0xba53('0x2d')][_0xba53('0x30')]?_0x47d617[_0xba53('0x2d')]:_0x471739[_0xba53('0x27')];if(!_0x164bc3[_0xba53('0x2a')][_0xba53('0x31')](_0xba53('0x32'))){_0x47d617[_0xba53('0x33')]=qs['limit'](_0x164bc3['query']['limit']);_0x47d617[_0xba53('0x15')]=qs[_0xba53('0x15')](_0x164bc3[_0xba53('0x2a')][_0xba53('0x15')]);}_0x47d617['order']=qs[_0xba53('0x34')](_0x164bc3[_0xba53('0x2a')][_0xba53('0x34')]);_0x47d617['where']=qs[_0xba53('0x2c')](_[_0xba53('0x35')](_0x164bc3[_0xba53('0x2a')],_0x471739[_0xba53('0x2c')]),_0x30b0cd);if(_0x164bc3[_0xba53('0x2a')][_0xba53('0x36')]){_0x47d617[_0xba53('0x37')]=_['merge'](_0x47d617[_0xba53('0x37')],{'$or':_[_0xba53('0x28')](_0x30b0cd,function(_0x2254f2){if(_0x2254f2[_0xba53('0x25')]!==_0xba53('0x38')){var _0x340436={};_0x340436[_0x2254f2['name']]={'$like':'%'+_0x164bc3[_0xba53('0x2a')][_0xba53('0x36')]+'%'};return _0x340436;}})});}_0x47d617=_[_0xba53('0x39')]({},_0x47d617,_0x164bc3[_0xba53('0x3a')]);var _0x3a5d97={'where':_0x47d617[_0xba53('0x37')]};return db[_0xba53('0x22')][_0xba53('0x14')](_0x3a5d97)[_0xba53('0x1c')](function(_0x462f4d){_0xaadf73['count']=_0x462f4d;if(_0x164bc3['query']['includeAll']){_0x47d617[_0xba53('0x3b')]=[{'all':!![]}];}return db[_0xba53('0x22')][_0xba53('0x3c')](_0x47d617);})['then'](function(_0x39158f){_0xaadf73['rows']=_0x39158f;return _0xaadf73;})[_0xba53('0x1c')](respondWithFilteredResult(_0x297d5a,_0x47d617))[_0xba53('0x3d')](handleError(_0x297d5a,null));};exports[_0xba53('0x3e')]=function(_0x4993a8,_0x3c9b03){var _0x299ba3={'raw':!![],'where':{'id':_0x4993a8[_0xba53('0x3f')]['id']}},_0x4fb1ec={};_0x4fb1ec[_0xba53('0x27')]=_['keys'](db[_0xba53('0x22')][_0xba53('0x23')]);_0x4fb1ec[_0xba53('0x2a')]=_[_0xba53('0x2b')](_0x4993a8[_0xba53('0x2a')]);_0x4fb1ec[_0xba53('0x2c')]=_[_0xba53('0x2e')](_0x4fb1ec[_0xba53('0x27')],_0x4fb1ec[_0xba53('0x2a')]);_0x299ba3[_0xba53('0x2d')]=_[_0xba53('0x2e')](_0x4fb1ec['model'],qs[_0xba53('0x2f')](_0x4993a8[_0xba53('0x2a')]['fields']));_0x299ba3[_0xba53('0x2d')]=_0x299ba3[_0xba53('0x2d')][_0xba53('0x30')]?_0x299ba3[_0xba53('0x2d')]:_0x4fb1ec[_0xba53('0x27')];if(_0x4993a8['query'][_0xba53('0x40')]){_0x299ba3[_0xba53('0x3b')]=[{'all':!![]}];}_0x299ba3=_[_0xba53('0x39')]({},_0x299ba3,_0x4993a8['options']);return db['FaxQueueReport'][_0xba53('0x41')](_0x299ba3)[_0xba53('0x1c')](handleEntityNotFound(_0x3c9b03,null))[_0xba53('0x1c')](respondWithResult(_0x3c9b03,null))[_0xba53('0x3d')](handleError(_0x3c9b03,null));};exports[_0xba53('0x42')]=function(_0x44c2ec,_0x3bf5b2){return db[_0xba53('0x22')][_0xba53('0x42')](_0x44c2ec['body'],{})[_0xba53('0x1c')](respondWithResult(_0x3bf5b2,0xc9))[_0xba53('0x3d')](handleError(_0x3bf5b2,null));};exports['update']=function(_0xf60775,_0x5ccc4e){if(_0xf60775[_0xba53('0x43')]['id']){delete _0xf60775[_0xba53('0x43')]['id'];}return db[_0xba53('0x22')]['find']({'where':{'id':_0xf60775[_0xba53('0x3f')]['id']}})[_0xba53('0x1c')](handleEntityNotFound(_0x5ccc4e,null))[_0xba53('0x1c')](saveUpdates(_0xf60775['body'],null))[_0xba53('0x1c')](respondWithResult(_0x5ccc4e,null))[_0xba53('0x3d')](handleError(_0x5ccc4e,null));};exports['destroy']=function(_0x50c0ad,_0x19ab2c){return db[_0xba53('0x22')][_0xba53('0x41')]({'where':{'id':_0x50c0ad[_0xba53('0x3f')]['id']}})[_0xba53('0x1c')](handleEntityNotFound(_0x19ab2c,null))[_0xba53('0x1c')](removeEntity(_0x19ab2c,null))[_0xba53('0x3d')](handleError(_0x19ab2c,null));};exports[_0xba53('0x44')]=function(_0x18bbc7,_0x408a73){return db[_0xba53('0x22')][_0xba53('0x44')]()['then'](respondWithResult(_0x408a73,null))[_0xba53('0x3d')](handleError(_0x408a73,null));}; \ No newline at end of file +var _0x4bbf=['describe','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','papaparse','../../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','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','FaxQueueReport','includeAll','include','rows','catch','show','params','create','body','find'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4bbf,0x139));var _0xf4bb=function(_0x45543b,_0x56411d){_0x45543b=_0x45543b-0x0;var _0x492993=_0x4bbf[_0x45543b];return _0x492993;};'use strict';var pdf=require(_0xf4bb('0x0'));var emlformat=require(_0xf4bb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf4bb('0x2'));var jsonpatch=require(_0xf4bb('0x3'));var rp=require(_0xf4bb('0x4'));var moment=require(_0xf4bb('0x5'));var BPromise=require(_0xf4bb('0x6'));var Mustache=require(_0xf4bb('0x7'));var util=require(_0xf4bb('0x8'));var path=require(_0xf4bb('0x9'));var sox=require(_0xf4bb('0xa'));var csv=require(_0xf4bb('0xb'));var ejs=require(_0xf4bb('0xc'));var fs=require('fs');var _=require(_0xf4bb('0xd'));var squel=require(_0xf4bb('0xe'));var crypto=require(_0xf4bb('0xf'));var jsforce=require(_0xf4bb('0x10'));var deskjs=require(_0xf4bb('0x11'));var toCsv=require(_0xf4bb('0xb'));var querystring=require('querystring');var Papa=require(_0xf4bb('0x12'));var Redis=require('ioredis');var authService=require(_0xf4bb('0x13'));var qs=require(_0xf4bb('0x14'));var as=require(_0xf4bb('0x15'));var hardwareService=require(_0xf4bb('0x16'));var logger=require(_0xf4bb('0x17'))(_0xf4bb('0x18'));var utils=require(_0xf4bb('0x19'));var config=require(_0xf4bb('0x1a'));var db=require(_0xf4bb('0x1b'))['db'];function respondWithStatusCode(_0x2cd510,_0x9e7440){_0x9e7440=_0x9e7440||0xcc;return function(_0x4ae835){if(_0x4ae835){return _0x2cd510[_0xf4bb('0x1c')](_0x9e7440);}return _0x2cd510[_0xf4bb('0x1d')](_0x9e7440)[_0xf4bb('0x1e')]();};}function respondWithResult(_0x20a6ff,_0x376880){_0x376880=_0x376880||0xc8;return function(_0x486193){if(_0x486193){return _0x20a6ff[_0xf4bb('0x1d')](_0x376880)['json'](_0x486193);}};}function respondWithFilteredResult(_0x3ba39d,_0x291b6b){return function(_0x110632){if(_0x110632){var _0x5264fc=_0x110632[_0xf4bb('0x1f')],_0x16cc39=_0x291b6b[_0xf4bb('0x20')],_0x9d7c33=_0x291b6b[_0xf4bb('0x20')]+_0x291b6b[_0xf4bb('0x21')],_0x5024f4;if(_0x9d7c33>=_0x5264fc){_0x9d7c33=_0x5264fc;_0x5024f4=0xc8;}else{_0x5024f4=0xce;}_0x3ba39d[_0xf4bb('0x1d')](_0x5024f4);return _0x3ba39d[_0xf4bb('0x22')](_0xf4bb('0x23'),_0x16cc39+'-'+_0x9d7c33+'/'+_0x5264fc)[_0xf4bb('0x24')](_0x110632);}return null;};}function patchUpdates(_0x3b5913){return function(_0x5e8fdf){try{jsonpatch[_0xf4bb('0x25')](_0x5e8fdf,_0x3b5913,!![]);}catch(_0x2813fb){return BPromise[_0xf4bb('0x26')](_0x2813fb);}return _0x5e8fdf['save']();};}function saveUpdates(_0x509a64,_0x348ce2){return function(_0x36dfc2){if(_0x36dfc2){return _0x36dfc2[_0xf4bb('0x27')](_0x509a64)[_0xf4bb('0x28')](function(_0x4245b4){return _0x4245b4;});}return null;};}function removeEntity(_0x2f21ea,_0xc91a92){return function(_0x3c4808){if(_0x3c4808){return _0x3c4808['destroy']()['then'](function(){_0x2f21ea['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x68e997,_0x17dc1d){return function(_0x31e2ef){if(!_0x31e2ef){_0x68e997[_0xf4bb('0x1c')](0x194);}return _0x31e2ef;};}function handleError(_0x35fe96,_0x7df78c){_0x7df78c=_0x7df78c||0x1f4;return function(_0x8b95a2){logger[_0xf4bb('0x29')](_0x8b95a2[_0xf4bb('0x2a')]);if(_0x8b95a2['name']){delete _0x8b95a2[_0xf4bb('0x2b')];}_0x35fe96['status'](_0x7df78c)[_0xf4bb('0x2c')](_0x8b95a2);};}exports[_0xf4bb('0x2d')]=function(_0x432d27,_0x498880){var _0x30b9dd={},_0x40d0e3={},_0x136583={'count':0x0,'rows':[]};var _0x5658d0=_[_0xf4bb('0x2e')](db['FaxQueueReport'][_0xf4bb('0x2f')],function(_0x2dc27a){return{'name':_0x2dc27a[_0xf4bb('0x30')],'type':_0x2dc27a[_0xf4bb('0x31')][_0xf4bb('0x32')]};});_0x40d0e3[_0xf4bb('0x33')]=_['map'](_0x5658d0,_0xf4bb('0x2b'));_0x40d0e3[_0xf4bb('0x34')]=_[_0xf4bb('0x35')](_0x432d27[_0xf4bb('0x34')]);_0x40d0e3['filters']=_[_0xf4bb('0x36')](_0x40d0e3[_0xf4bb('0x33')],_0x40d0e3[_0xf4bb('0x34')]);_0x30b9dd['attributes']=_[_0xf4bb('0x36')](_0x40d0e3[_0xf4bb('0x33')],qs[_0xf4bb('0x37')](_0x432d27['query'][_0xf4bb('0x37')]));_0x30b9dd['attributes']=_0x30b9dd[_0xf4bb('0x38')][_0xf4bb('0x39')]?_0x30b9dd[_0xf4bb('0x38')]:_0x40d0e3[_0xf4bb('0x33')];if(!_0x432d27[_0xf4bb('0x34')]['hasOwnProperty'](_0xf4bb('0x3a'))){_0x30b9dd[_0xf4bb('0x21')]=qs[_0xf4bb('0x21')](_0x432d27[_0xf4bb('0x34')]['limit']);_0x30b9dd['offset']=qs[_0xf4bb('0x20')](_0x432d27['query'][_0xf4bb('0x20')]);}_0x30b9dd[_0xf4bb('0x3b')]=qs[_0xf4bb('0x3c')](_0x432d27[_0xf4bb('0x34')][_0xf4bb('0x3c')]);_0x30b9dd[_0xf4bb('0x3d')]=qs['filters'](_[_0xf4bb('0x3e')](_0x432d27[_0xf4bb('0x34')],_0x40d0e3[_0xf4bb('0x3f')]),_0x5658d0);if(_0x432d27[_0xf4bb('0x34')][_0xf4bb('0x40')]){_0x30b9dd['where']=_[_0xf4bb('0x41')](_0x30b9dd['where'],{'$or':_['map'](_0x5658d0,function(_0x11c787){if(_0x11c787[_0xf4bb('0x31')]!==_0xf4bb('0x42')){var _0x5ef4f5={};_0x5ef4f5[_0x11c787[_0xf4bb('0x2b')]]={'$like':'%'+_0x432d27[_0xf4bb('0x34')][_0xf4bb('0x40')]+'%'};return _0x5ef4f5;}})});}_0x30b9dd=_[_0xf4bb('0x41')]({},_0x30b9dd,_0x432d27['options']);var _0x45819c={'where':_0x30b9dd[_0xf4bb('0x3d')]};return db[_0xf4bb('0x43')][_0xf4bb('0x1f')](_0x45819c)['then'](function(_0x5222a4){_0x136583[_0xf4bb('0x1f')]=_0x5222a4;if(_0x432d27[_0xf4bb('0x34')][_0xf4bb('0x44')]){_0x30b9dd[_0xf4bb('0x45')]=[{'all':!![]}];}return db[_0xf4bb('0x43')]['findAll'](_0x30b9dd);})[_0xf4bb('0x28')](function(_0x51df0c){_0x136583[_0xf4bb('0x46')]=_0x51df0c;return _0x136583;})['then'](respondWithFilteredResult(_0x498880,_0x30b9dd))[_0xf4bb('0x47')](handleError(_0x498880,null));};exports[_0xf4bb('0x48')]=function(_0x31de5d,_0x4f2a29){var _0x4b25d2={'raw':!![],'where':{'id':_0x31de5d[_0xf4bb('0x49')]['id']}},_0x20e224={};_0x20e224[_0xf4bb('0x33')]=_[_0xf4bb('0x35')](db[_0xf4bb('0x43')][_0xf4bb('0x2f')]);_0x20e224[_0xf4bb('0x34')]=_[_0xf4bb('0x35')](_0x31de5d[_0xf4bb('0x34')]);_0x20e224[_0xf4bb('0x3f')]=_[_0xf4bb('0x36')](_0x20e224[_0xf4bb('0x33')],_0x20e224['query']);_0x4b25d2['attributes']=_[_0xf4bb('0x36')](_0x20e224[_0xf4bb('0x33')],qs['fields'](_0x31de5d['query'][_0xf4bb('0x37')]));_0x4b25d2[_0xf4bb('0x38')]=_0x4b25d2[_0xf4bb('0x38')][_0xf4bb('0x39')]?_0x4b25d2[_0xf4bb('0x38')]:_0x20e224[_0xf4bb('0x33')];if(_0x31de5d['query'][_0xf4bb('0x44')]){_0x4b25d2[_0xf4bb('0x45')]=[{'all':!![]}];}_0x4b25d2=_[_0xf4bb('0x41')]({},_0x4b25d2,_0x31de5d['options']);return db[_0xf4bb('0x43')]['find'](_0x4b25d2)[_0xf4bb('0x28')](handleEntityNotFound(_0x4f2a29,null))[_0xf4bb('0x28')](respondWithResult(_0x4f2a29,null))['catch'](handleError(_0x4f2a29,null));};exports[_0xf4bb('0x4a')]=function(_0x232f47,_0x534192){return db['FaxQueueReport'][_0xf4bb('0x4a')](_0x232f47[_0xf4bb('0x4b')],{})[_0xf4bb('0x28')](respondWithResult(_0x534192,0xc9))['catch'](handleError(_0x534192,null));};exports[_0xf4bb('0x27')]=function(_0x42f4e4,_0x95b7e5){if(_0x42f4e4[_0xf4bb('0x4b')]['id']){delete _0x42f4e4['body']['id'];}return db[_0xf4bb('0x43')]['find']({'where':{'id':_0x42f4e4[_0xf4bb('0x49')]['id']}})[_0xf4bb('0x28')](handleEntityNotFound(_0x95b7e5,null))[_0xf4bb('0x28')](saveUpdates(_0x42f4e4['body'],null))['then'](respondWithResult(_0x95b7e5,null))[_0xf4bb('0x47')](handleError(_0x95b7e5,null));};exports['destroy']=function(_0x577193,_0x2a996c){return db[_0xf4bb('0x43')][_0xf4bb('0x4c')]({'where':{'id':_0x577193[_0xf4bb('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a996c,null))[_0xf4bb('0x28')](removeEntity(_0x2a996c,null))['catch'](handleError(_0x2a996c,null));};exports[_0xf4bb('0x4d')]=function(_0x344c4f,_0x3b8ee5){return db[_0xf4bb('0x43')]['describe']()['then'](respondWithResult(_0x3b8ee5,null))[_0xf4bb('0x47')](handleError(_0x3b8ee5,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 11e3dca..2e6160a 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 _0x66fa=['rimraf','../../config/environment','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4aee4d,_0x1790ce){var _0xa28f7a=function(_0x4b9410){while(--_0x4b9410){_0x4aee4d['push'](_0x4aee4d['shift']());}};_0xa28f7a(++_0x1790ce);}(_0x66fa,0x117));var _0xa66f=function(_0x407869,_0x27d94d){_0x407869=_0x407869-0x0;var _0x13746b=_0x66fa[_0x407869];return _0x13746b;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x2239d3,_0x20a150){return _0x2239d3[_0xa66f('0x9')](_0xa66f('0xa'),attributes,{'tableName':_0xa66f('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa66f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x761c=['api','bluebird','request-promise','path','../../config/environment','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger'];(function(_0xf4946d,_0x19f222){var _0x328d8e=function(_0x5d001f){while(--_0x5d001f){_0xf4946d['push'](_0xf4946d['shift']());}};_0x328d8e(++_0x19f222);}(_0x761c,0x18a));var _0xc761=function(_0xf98303,_0x767b37){_0xf98303=_0xf98303-0x0;var _0x7837e8=_0x761c[_0xf98303];return _0x7837e8;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var logger=require(_0xc761('0x1'))(_0xc761('0x2'));var moment=require('moment');var BPromise=require(_0xc761('0x3'));var rp=require(_0xc761('0x4'));var fs=require('fs');var path=require(_0xc761('0x5'));var rimraf=require('rimraf');var config=require(_0xc761('0x6'));var attributes=require('./faxQueueReport.attributes');module[_0xc761('0x7')]=function(_0x468f51,_0x23ba0b){return _0x468f51[_0xc761('0x8')](_0xc761('0x9'),attributes,{'tableName':_0xc761('0xa'),'paranoid':![],'indexes':[{'name':_0xc761('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 afcdc3e..8740e97 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 _0x7212=['update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxQueueReport,\x20%s,\x20%s','request\x20sent','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7212,0xf2));var _0x2721=function(_0x433a8c,_0x45d79a){_0x433a8c=_0x433a8c-0x0;var _0x38fe59=_0x7212[_0x433a8c];return _0x38fe59;};'use strict';var _=require(_0x2721('0x0'));var util=require(_0x2721('0x1'));var moment=require(_0x2721('0x2'));var BPromise=require(_0x2721('0x3'));var rs=require(_0x2721('0x4'));var fs=require('fs');var Redis=require(_0x2721('0x5'));var db=require(_0x2721('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2721('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2721('0x8'));var client=jayson['client'][_0x2721('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ada5f,_0x52f44a,_0xc9b0cf){return new BPromise(function(_0x5ba1c7,_0x3bf92d){return client['request'](_0x4ada5f,_0xc9b0cf)[_0x2721('0xa')](function(_0x503119){logger[_0x2721('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x52f44a,'request\x20sent');logger[_0x2721('0xc')](_0x2721('0xd'),_0x52f44a,'request\x20sent',JSON[_0x2721('0xe')](_0x503119));if(_0x503119[_0x2721('0xf')]){if(_0x503119[_0x2721('0xf')][_0x2721('0x10')]===0x1f4){logger[_0x2721('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x52f44a,_0x503119[_0x2721('0xf')][_0x2721('0x11')]);return _0x3bf92d(_0x503119[_0x2721('0xf')]['message']);}logger[_0x2721('0xf')](_0x2721('0x12'),_0x52f44a,_0x503119['error'][_0x2721('0x11')]);return _0x5ba1c7(_0x503119[_0x2721('0xf')]['message']);}else{logger[_0x2721('0xb')](_0x2721('0x12'),_0x52f44a,_0x2721('0x13'));_0x5ba1c7(_0x503119['result'][_0x2721('0x11')]);}})[_0x2721('0x14')](function(_0x416ae7){logger[_0x2721('0xf')](_0x2721('0x12'),_0x52f44a,_0x416ae7);_0x3bf92d(_0x416ae7);});});}exports[_0x2721('0x15')]=function(_0x3deb97){var _0x163d84=this;return new Promise(function(_0x4d74a1,_0x431b86){return db[_0x2721('0x16')][_0x2721('0x17')](_0x3deb97[_0x2721('0x18')],{'raw':_0x3deb97[_0x2721('0x19')]?_0x3deb97[_0x2721('0x19')][_0x2721('0x1a')]===undefined?!![]:![]:!![]})[_0x2721('0xa')](function(_0x5dd8b5){logger[_0x2721('0xb')](_0x2721('0x15'),_0x3deb97);logger['debug'](_0x2721('0x15'),_0x3deb97,JSON['stringify'](_0x5dd8b5));_0x4d74a1(_0x5dd8b5);})[_0x2721('0x14')](function(_0x341a86){logger['error'](_0x2721('0x15'),_0x341a86[_0x2721('0x11')],_0x3deb97);_0x431b86(_0x163d84['error'](0x1f4,_0x341a86[_0x2721('0x11')]));});});};exports[_0x2721('0x1b')]=function(_0x56827e){var _0x3d7b64=this;return new Promise(function(_0x5a1842,_0x13ce6a){return db[_0x2721('0x16')][_0x2721('0x1c')](_0x56827e[_0x2721('0x18')],{'raw':_0x56827e[_0x2721('0x19')]?_0x56827e['options'][_0x2721('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56827e['options']?_0x56827e[_0x2721('0x19')]['where']||null:null,'attributes':_0x56827e[_0x2721('0x19')]?_0x56827e[_0x2721('0x19')][_0x2721('0x1d')]||null:null,'limit':_0x56827e['options']?_0x56827e[_0x2721('0x19')]['limit']||null:null})[_0x2721('0xa')](function(_0x3e73c5){logger[_0x2721('0xb')](_0x2721('0x1b'),_0x56827e);logger['debug'](_0x2721('0x1b'),_0x56827e,JSON['stringify'](_0x3e73c5));_0x5a1842(_0x3e73c5);})[_0x2721('0x14')](function(_0x18188f){logger[_0x2721('0xf')](_0x2721('0x1b'),_0x18188f[_0x2721('0x11')],_0x56827e);_0x13ce6a(_0x3d7b64['error'](0x1f4,_0x18188f[_0x2721('0x11')]));});});}; \ No newline at end of file +var _0x0954=['CreateFaxQueueReport','FaxQueueReport','options','update','raw','attributes','limit','UpdateFaxQueueReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch'];(function(_0x3323ce,_0x31152d){var _0x112db1=function(_0x2ddf4d){while(--_0x2ddf4d){_0x3323ce['push'](_0x3323ce['shift']());}};_0x112db1(++_0x31152d);}(_0x0954,0x15d));var _0x4095=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0x0954[_0x8cb2f9];return _0x164887;};'use strict';var _=require('lodash');var util=require(_0x4095('0x0'));var moment=require(_0x4095('0x1'));var BPromise=require('bluebird');var rs=require(_0x4095('0x2'));var fs=require('fs');var Redis=require(_0x4095('0x3'));var db=require(_0x4095('0x4'))['db'];var utils=require(_0x4095('0x5'));var logger=require('../../config/logger')(_0x4095('0x6'));var config=require(_0x4095('0x7'));var jayson=require(_0x4095('0x8'));var client=jayson[_0x4095('0x9')][_0x4095('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23b203,_0x71b73b,_0x1541bf){return new BPromise(function(_0x3ff92e,_0x109e18){return client[_0x4095('0xb')](_0x23b203,_0x1541bf)[_0x4095('0xc')](function(_0x31e57e){logger['info'](_0x4095('0xd'),_0x71b73b,'request\x20sent');logger[_0x4095('0xe')](_0x4095('0xf'),_0x71b73b,_0x4095('0x10'),JSON[_0x4095('0x11')](_0x31e57e));if(_0x31e57e[_0x4095('0x12')]){if(_0x31e57e[_0x4095('0x12')][_0x4095('0x13')]===0x1f4){logger['error'](_0x4095('0xd'),_0x71b73b,_0x31e57e['error'][_0x4095('0x14')]);return _0x109e18(_0x31e57e[_0x4095('0x12')][_0x4095('0x14')]);}logger['error'](_0x4095('0xd'),_0x71b73b,_0x31e57e[_0x4095('0x12')][_0x4095('0x14')]);return _0x3ff92e(_0x31e57e[_0x4095('0x12')]['message']);}else{logger[_0x4095('0x15')](_0x4095('0xd'),_0x71b73b,_0x4095('0x10'));_0x3ff92e(_0x31e57e['result'][_0x4095('0x14')]);}})[_0x4095('0x16')](function(_0x4aca7b){logger[_0x4095('0x12')](_0x4095('0xd'),_0x71b73b,_0x4aca7b);_0x109e18(_0x4aca7b);});});}exports[_0x4095('0x17')]=function(_0x409081){var _0x271048=this;return new Promise(function(_0x1dae17,_0x5bb773){return db[_0x4095('0x18')]['create'](_0x409081['body'],{'raw':_0x409081[_0x4095('0x19')]?_0x409081[_0x4095('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4095('0xc')](function(_0x429cc6){logger[_0x4095('0x15')]('CreateFaxQueueReport',_0x409081);logger[_0x4095('0xe')](_0x4095('0x17'),_0x409081,JSON[_0x4095('0x11')](_0x429cc6));_0x1dae17(_0x429cc6);})[_0x4095('0x16')](function(_0x480be6){logger['error'](_0x4095('0x17'),_0x480be6[_0x4095('0x14')],_0x409081);_0x5bb773(_0x271048[_0x4095('0x12')](0x1f4,_0x480be6[_0x4095('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x4eab6c){var _0x59d906=this;return new Promise(function(_0x32e44b,_0xac54d0){return db[_0x4095('0x18')][_0x4095('0x1a')](_0x4eab6c['body'],{'raw':_0x4eab6c['options']?_0x4eab6c[_0x4095('0x19')][_0x4095('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4eab6c[_0x4095('0x19')]?_0x4eab6c['options']['where']||null:null,'attributes':_0x4eab6c[_0x4095('0x19')]?_0x4eab6c[_0x4095('0x19')][_0x4095('0x1c')]||null:null,'limit':_0x4eab6c[_0x4095('0x19')]?_0x4eab6c[_0x4095('0x19')][_0x4095('0x1d')]||null:null})['then'](function(_0x30e02a){logger[_0x4095('0x15')]('UpdateFaxQueueReport',_0x4eab6c);logger[_0x4095('0xe')](_0x4095('0x1e'),_0x4eab6c,JSON[_0x4095('0x11')](_0x30e02a));_0x32e44b(_0x30e02a);})['catch'](function(_0x1b29fa){logger[_0x4095('0x12')](_0x4095('0x1e'),_0x1b29fa[_0x4095('0x14')],_0x4eab6c);_0xac54d0(_0x59d906[_0x4095('0x12')](0x1f4,_0x1b29fa['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8ab07bc..558f5e0 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 _0xbb58=['/:id','show','put','update','delete','destroy','exports','path','express','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x47deaa,_0x3593d7){var _0x521a0a=function(_0x24981a){while(--_0x24981a){_0x47deaa['push'](_0x47deaa['shift']());}};_0x521a0a(++_0x3593d7);}(_0xbb58,0xd7));var _0x8bb5=function(_0x1c4362,_0xa0c98b){_0x1c4362=_0x1c4362-0x0;var _0xd55e58=_0xbb58[_0x1c4362];return _0xd55e58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8bb5('0x0'));var timeout=require('connect-timeout');var express=require(_0x8bb5('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8bb5('0x2'));var controller=require(_0x8bb5('0x3'));router[_0x8bb5('0x4')]('/',auth[_0x8bb5('0x5')](),controller[_0x8bb5('0x6')]);router[_0x8bb5('0x4')](_0x8bb5('0x7'),auth[_0x8bb5('0x5')](),controller[_0x8bb5('0x8')]);router['get'](_0x8bb5('0x9'),auth[_0x8bb5('0x5')](),controller[_0x8bb5('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x8bb5('0xb')]('/:id',auth[_0x8bb5('0x5')](),controller[_0x8bb5('0xc')]);router[_0x8bb5('0xd')](_0x8bb5('0x9'),auth[_0x8bb5('0x5')](),controller[_0x8bb5('0xe')]);module[_0x8bb5('0xf')]=router; \ No newline at end of file +var _0x33ea=['../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','get','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33ea,0xcc));var _0xa33e=function(_0x20f1a0,_0x46469c){_0x20f1a0=_0x20f1a0-0x0;var _0x9e6b01=_0x33ea[_0x20f1a0];return _0x9e6b01;};'use strict';var multer=require(_0xa33e('0x0'));var util=require('util');var path=require(_0xa33e('0x1'));var timeout=require(_0xa33e('0x2'));var express=require(_0xa33e('0x3'));var router=express[_0xa33e('0x4')]();var auth=require(_0xa33e('0x5'));var interaction=require(_0xa33e('0x6'));var config=require(_0xa33e('0x7'));var controller=require(_0xa33e('0x8'));router['get']('/',auth[_0xa33e('0x9')](),controller['index']);router[_0xa33e('0xa')](_0xa33e('0xb'),auth[_0xa33e('0x9')](),controller['describe']);router[_0xa33e('0xa')](_0xa33e('0xc'),auth[_0xa33e('0x9')](),controller[_0xa33e('0xd')]);router[_0xa33e('0xe')]('/',auth[_0xa33e('0x9')](),controller[_0xa33e('0xf')]);router[_0xa33e('0x10')](_0xa33e('0xc'),auth[_0xa33e('0x9')](),controller[_0xa33e('0x11')]);router[_0xa33e('0x12')](_0xa33e('0xc'),auth[_0xa33e('0x9')](),controller[_0xa33e('0x13')]);module[_0xa33e('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index a326b33..1e7c65e 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 _0x9988=['account','agent','queue','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x9988,0x10a));var _0x8998=function(_0x212b5d,_0x318113){_0x212b5d=_0x212b5d-0x0;var _0xd29835=_0x9988[_0x212b5d];return _0xd29835;};'use strict';var moment=require('moment');var Sequelize=require(_0x8998('0x0'));module[_0x8998('0x1')]={'uniqueid':{'type':Sequelize[_0x8998('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8998('0x3')](_0x8998('0x4'),_0x8998('0x5'),_0x8998('0x6')),'allowNull':![],'defaultValue':_0x8998('0x6')},'transferredAt':{'type':Sequelize[_0x8998('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8998('0x8')]}}; \ No newline at end of file +var _0x290a=['sequelize','exports','STRING','account','agent','queue','DATE','NOW','moment'];(function(_0x4e8eed,_0xcd56a3){var _0x17bdfa=function(_0x4664bc){while(--_0x4664bc){_0x4e8eed['push'](_0x4e8eed['shift']());}};_0x17bdfa(++_0xcd56a3);}(_0x290a,0x131));var _0xa290=function(_0x5c067c,_0x4a1d18){_0x5c067c=_0x5c067c-0x0;var _0x1b27f2=_0x290a[_0x5c067c];return _0x1b27f2;};'use strict';var moment=require(_0xa290('0x0'));var Sequelize=require(_0xa290('0x1'));module[_0xa290('0x2')]={'uniqueid':{'type':Sequelize[_0xa290('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa290('0x4'),_0xa290('0x5'),'queue'),'allowNull':![],'defaultValue':_0xa290('0x6')},'transferredAt':{'type':Sequelize[_0xa290('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xa290('0x8')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 0fd94f5..aa1098d 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 _0xdb28=['Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','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','end','status','json','offset','limit','set'];(function(_0x16dfbf,_0x4fee91){var _0x64086c=function(_0x2c9160){while(--_0x2c9160){_0x16dfbf['push'](_0x16dfbf['shift']());}};_0x64086c(++_0x4fee91);}(_0xdb28,0x106));var _0x8db2=function(_0x5e1706,_0x254346){_0x5e1706=_0x5e1706-0x0;var _0x2b9d1e=_0xdb28[_0x5e1706];return _0x2b9d1e;};'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'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]),_0x11f398);if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['FaxTransferReport'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['FaxTransferReport'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));};exports[_0x8db2('0x48')]=function(_0x2908e4,_0x2f0bd0){return db[_0x8db2('0x29')][_0x8db2('0x48')]()[_0x8db2('0x22')](respondWithResult(_0x2f0bd0,null))[_0x8db2('0x44')](handleError(_0x2f0bd0,null));}; \ No newline at end of file +var _0x5f2f=['set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','FaxTransferReport','then','include','rows','catch','show','params','intersection','options','find','create','body','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'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5f2f,0x73));var _0xf5f2=function(_0x58b4cc,_0x22a59d){_0x58b4cc=_0x58b4cc-0x0;var _0x3f355b=_0x5f2f[_0x58b4cc];return _0x3f355b;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]),_0x198c73);if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));};exports[_0xf5f2('0x41')]=function(_0x462ea3,_0x2083b3){var _0x574f24={'raw':!![],'where':{'id':_0x462ea3[_0xf5f2('0x42')]['id']}},_0x31c3c={};_0x31c3c[_0xf5f2('0x2f')]=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x31c3c[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x462ea3['query']);_0x31c3c[_0xf5f2('0x38')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],_0x31c3c[_0xf5f2('0x2d')]);_0x574f24[_0xf5f2('0x30')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x462ea3[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x574f24[_0xf5f2('0x30')]=_0x574f24[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x574f24[_0xf5f2('0x30')]:_0x31c3c['model'];if(_0x462ea3[_0xf5f2('0x2d')]['includeAll']){_0x574f24[_0xf5f2('0x3e')]=[{'all':!![]}];}_0x574f24=_[_0xf5f2('0x3a')]({},_0x574f24,_0x462ea3[_0xf5f2('0x44')]);return db[_0xf5f2('0x3c')][_0xf5f2('0x45')](_0x574f24)[_0xf5f2('0x3d')](handleEntityNotFound(_0x2083b3,null))['then'](respondWithResult(_0x2083b3,null))[_0xf5f2('0x40')](handleError(_0x2083b3,null));};exports[_0xf5f2('0x46')]=function(_0x1c1497,_0x29b108){return db[_0xf5f2('0x3c')][_0xf5f2('0x46')](_0x1c1497[_0xf5f2('0x47')],{})[_0xf5f2('0x3d')](respondWithResult(_0x29b108,0xc9))['catch'](handleError(_0x29b108,null));};exports[_0xf5f2('0x22')]=function(_0x33ec29,_0x45db9a){if(_0x33ec29['body']['id']){delete _0x33ec29[_0xf5f2('0x47')]['id'];}return db[_0xf5f2('0x3c')][_0xf5f2('0x45')]({'where':{'id':_0x33ec29['params']['id']}})['then'](handleEntityNotFound(_0x45db9a,null))[_0xf5f2('0x3d')](saveUpdates(_0x33ec29[_0xf5f2('0x47')],null))['then'](respondWithResult(_0x45db9a,null))[_0xf5f2('0x40')](handleError(_0x45db9a,null));};exports['destroy']=function(_0x740321,_0x497eb8){return db[_0xf5f2('0x3c')]['find']({'where':{'id':_0x740321[_0xf5f2('0x42')]['id']}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x497eb8,null))[_0xf5f2('0x3d')](removeEntity(_0x497eb8,null))[_0xf5f2('0x40')](handleError(_0x497eb8,null));};exports['describe']=function(_0x3154c1,_0x2b782f){return db['FaxTransferReport']['describe']()[_0xf5f2('0x3d')](respondWithResult(_0x2b782f,null))[_0xf5f2('0x40')](handleError(_0x2b782f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0069fcc..63d4f8f 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 _0xc288=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x13aee8,_0x4e55b6){var _0x8d06f3=function(_0x2b26e9){while(--_0x2b26e9){_0x13aee8['push'](_0x13aee8['shift']());}};_0x8d06f3(++_0x4e55b6);}(_0xc288,0x1d3));var _0x8c28=function(_0x341862,_0x5c2f81){_0x341862=_0x341862-0x0;var _0x22b740=_0xc288[_0x341862];return _0x22b740;};'use strict';var _=require(_0x8c28('0x0'));var util=require(_0x8c28('0x1'));var logger=require(_0x8c28('0x2'))(_0x8c28('0x3'));var moment=require(_0x8c28('0x4'));var BPromise=require(_0x8c28('0x5'));var rp=require(_0x8c28('0x6'));var fs=require('fs');var path=require(_0x8c28('0x7'));var rimraf=require(_0x8c28('0x8'));var config=require(_0x8c28('0x9'));var attributes=require(_0x8c28('0xa'));module[_0x8c28('0xb')]=function(_0x3d124c,_0x2240c7){return _0x3d124c[_0x8c28('0xc')](_0x8c28('0xd'),attributes,{'tableName':_0x8c28('0xe'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8c28('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x2da823,_0xb1f692){var _0x4ce20e=function(_0x3b4953){while(--_0x3b4953){_0x2da823['push'](_0x2da823['shift']());}};_0x4ce20e(++_0xb1f692);}(_0xee5b,0x1f4));var _0xbee5=function(_0x2dac35,_0x159b5a){_0x2dac35=_0x2dac35-0x0;var _0x5bf548=_0xee5b[_0x2dac35];return _0x5bf548;};'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('./faxTransferReport.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('FaxTransferReport',attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index aba0ed2..7d18ebb 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 _0x3977=['bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3977,0x132));var _0x7397=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3977[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7397('0x0'));var util=require('util');var moment=require(_0x7397('0x1'));var BPromise=require(_0x7397('0x2'));var rs=require(_0x7397('0x3'));var fs=require('fs');var Redis=require(_0x7397('0x4'));var db=require(_0x7397('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7397('0x6'));var jayson=require(_0x7397('0x7'));var client=jayson['client'][_0x7397('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8e12ce,_0x6736f0,_0x547fde){return new BPromise(function(_0x327f47,_0x2f866f){return client[_0x7397('0x9')](_0x8e12ce,_0x547fde)[_0x7397('0xa')](function(_0x3d8e73){logger[_0x7397('0xb')](_0x7397('0xc'),_0x6736f0,_0x7397('0xd'));logger[_0x7397('0xe')](_0x7397('0xf'),_0x6736f0,_0x7397('0xd'),JSON[_0x7397('0x10')](_0x3d8e73));if(_0x3d8e73[_0x7397('0x11')]){if(_0x3d8e73['error'][_0x7397('0x12')]===0x1f4){logger[_0x7397('0x11')](_0x7397('0xc'),_0x6736f0,_0x3d8e73['error'][_0x7397('0x13')]);return _0x2f866f(_0x3d8e73[_0x7397('0x11')][_0x7397('0x13')]);}logger['error'](_0x7397('0xc'),_0x6736f0,_0x3d8e73['error'][_0x7397('0x13')]);return _0x327f47(_0x3d8e73[_0x7397('0x11')][_0x7397('0x13')]);}else{logger[_0x7397('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x6736f0,_0x7397('0xd'));_0x327f47(_0x3d8e73[_0x7397('0x14')][_0x7397('0x13')]);}})[_0x7397('0x15')](function(_0xb83e3f){logger[_0x7397('0x11')](_0x7397('0xc'),_0x6736f0,_0xb83e3f);_0x2f866f(_0xb83e3f);});});} \ No newline at end of file +var _0xdf0b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xdf0b,0xe4));var _0xbdf0=function(_0x286e93,_0x3d58fb){_0x286e93=_0x286e93-0x0;var _0x26caf3=_0xdf0b[_0x286e93];return _0x26caf3;};'use strict';var _=require(_0xbdf0('0x0'));var util=require(_0xbdf0('0x1'));var moment=require(_0xbdf0('0x2'));var BPromise=require(_0xbdf0('0x3'));var rs=require(_0xbdf0('0x4'));var fs=require('fs');var Redis=require(_0xbdf0('0x5'));var db=require(_0xbdf0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdf0('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbdf0('0x8'));var client=jayson[_0xbdf0('0x9')][_0xbdf0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x455ce8,_0x5da6fc,_0x17b56f){return new BPromise(function(_0x2299cb,_0x5d8df){return client[_0xbdf0('0xb')](_0x455ce8,_0x17b56f)['then'](function(_0x27b471){logger[_0xbdf0('0xc')](_0xbdf0('0xd'),_0x5da6fc,_0xbdf0('0xe'));logger[_0xbdf0('0xf')](_0xbdf0('0x10'),_0x5da6fc,_0xbdf0('0xe'),JSON[_0xbdf0('0x11')](_0x27b471));if(_0x27b471[_0xbdf0('0x12')]){if(_0x27b471[_0xbdf0('0x12')][_0xbdf0('0x13')]===0x1f4){logger[_0xbdf0('0x12')](_0xbdf0('0xd'),_0x5da6fc,_0x27b471['error'][_0xbdf0('0x14')]);return _0x5d8df(_0x27b471['error'][_0xbdf0('0x14')]);}logger['error'](_0xbdf0('0xd'),_0x5da6fc,_0x27b471[_0xbdf0('0x12')][_0xbdf0('0x14')]);return _0x2299cb(_0x27b471[_0xbdf0('0x12')][_0xbdf0('0x14')]);}else{logger[_0xbdf0('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x5da6fc,_0xbdf0('0xe'));_0x2299cb(_0x27b471[_0xbdf0('0x15')][_0xbdf0('0x14')]);}})[_0xbdf0('0x16')](function(_0x47d802){logger[_0xbdf0('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x5da6fc,_0x47d802);_0x5d8df(_0x47d802);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index d907485..e2966d3 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 _0x8fbb=['put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','/describe','describe','/:id','show','post','isAuthenticated','create'];(function(_0x12f11c,_0x4cdc42){var _0x46f7fb=function(_0x392745){while(--_0x392745){_0x12f11c['push'](_0x12f11c['shift']());}};_0x46f7fb(++_0x4cdc42);}(_0x8fbb,0x134));var _0xb8fb=function(_0x95a619,_0x1f9ad6){_0x95a619=_0x95a619-0x0;var _0x3f9473=_0x8fbb[_0x95a619];return _0x3f9473;};'use strict';var multer=require('multer');var util=require(_0xb8fb('0x0'));var path=require(_0xb8fb('0x1'));var timeout=require(_0xb8fb('0x2'));var express=require(_0xb8fb('0x3'));var router=express['Router']();var auth=require(_0xb8fb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb8fb('0x5'));var controller=require(_0xb8fb('0x6'));router[_0xb8fb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb8fb('0x7')](_0xb8fb('0x8'),auth['isAuthenticated'](),controller[_0xb8fb('0x9')]);router[_0xb8fb('0x7')](_0xb8fb('0xa'),auth['isAuthenticated'](),controller[_0xb8fb('0xb')]);router[_0xb8fb('0xc')]('/',auth[_0xb8fb('0xd')](),controller[_0xb8fb('0xe')]);router[_0xb8fb('0xf')](_0xb8fb('0xa'),auth[_0xb8fb('0xd')](),controller['update']);router[_0xb8fb('0x10')](_0xb8fb('0xa'),auth[_0xb8fb('0xd')](),controller[_0xb8fb('0x11')]);module[_0xb8fb('0x12')]=router; \ No newline at end of file +var _0x1e6a=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports','multer'];(function(_0x362285,_0x4ade35){var _0x1bed24=function(_0x33bbd3){while(--_0x33bbd3){_0x362285['push'](_0x362285['shift']());}};_0x1bed24(++_0x4ade35);}(_0x1e6a,0xbc));var _0xa1e6=function(_0x2988f9,_0x3eb9d4){_0x2988f9=_0x2988f9-0x0;var _0x58cd2d=_0x1e6a[_0x2988f9];return _0x58cd2d;};'use strict';var multer=require(_0xa1e6('0x0'));var util=require(_0xa1e6('0x1'));var path=require(_0xa1e6('0x2'));var timeout=require(_0xa1e6('0x3'));var express=require('express');var router=express[_0xa1e6('0x4')]();var auth=require(_0xa1e6('0x5'));var interaction=require(_0xa1e6('0x6'));var config=require(_0xa1e6('0x7'));var controller=require(_0xa1e6('0x8'));router['get']('/',auth[_0xa1e6('0x9')](),controller[_0xa1e6('0xa')]);router[_0xa1e6('0xb')](_0xa1e6('0xc'),auth[_0xa1e6('0x9')](),controller[_0xa1e6('0xd')]);router[_0xa1e6('0xb')](_0xa1e6('0xe'),auth[_0xa1e6('0x9')](),controller[_0xa1e6('0xf')]);router['post']('/',auth[_0xa1e6('0x9')](),controller['create']);router[_0xa1e6('0x10')](_0xa1e6('0xe'),auth[_0xa1e6('0x9')](),controller[_0xa1e6('0x11')]);router[_0xa1e6('0x12')](_0xa1e6('0xe'),auth['isAuthenticated'](),controller[_0xa1e6('0x13')]);module[_0xa1e6('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 163178a..2161f32 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 _0x2eb2=['../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','update','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0xf2efae,_0x307737){var _0x241311=function(_0x5ba928){while(--_0x5ba928){_0xf2efae['push'](_0xf2efae['shift']());}};_0x241311(++_0x307737);}(_0x2eb2,0x19f));var _0x22eb=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x2eb2[_0x397cfb];return _0x15fed9;};'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('./intDeskAccount.controller');router['get']('/',auth[_0x22eb('0x7')](),controller[_0x22eb('0x8')]);router[_0x22eb('0x9')](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xb')]);router[_0x22eb('0x9')](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller[_0x22eb('0xd')]);router[_0x22eb('0x9')](_0x22eb('0xe'),auth['isAuthenticated'](),controller[_0x22eb('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x22eb('0x10')]);router['post'](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller['addConfiguration']);router['put'](_0x22eb('0xa'),auth[_0x22eb('0x7')](),controller[_0x22eb('0x11')]);router[_0x22eb('0x12')](_0x22eb('0xa'),auth['isAuthenticated'](),controller[_0x22eb('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe198=['getFields','post','create','addConfiguration','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3fb080,_0x1783cf){var _0x18e86d=function(_0x465017){while(--_0x465017){_0x3fb080['push'](_0x3fb080['shift']());}};_0x18e86d(++_0x1783cf);}(_0xe198,0x6f));var _0x8e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe198[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8e19('0x0'));var util=require(_0x8e19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8e19('0x2'));var router=express[_0x8e19('0x3')]();var auth=require(_0x8e19('0x4'));var interaction=require(_0x8e19('0x5'));var config=require(_0x8e19('0x6'));var controller=require('./intDeskAccount.controller');router[_0x8e19('0x7')]('/',auth[_0x8e19('0x8')](),controller[_0x8e19('0x9')]);router[_0x8e19('0x7')](_0x8e19('0xa'),auth[_0x8e19('0x8')](),controller[_0x8e19('0xb')]);router[_0x8e19('0x7')](_0x8e19('0xc'),auth[_0x8e19('0x8')](),controller[_0x8e19('0xd')]);router[_0x8e19('0x7')](_0x8e19('0xe'),auth['isAuthenticated'](),controller[_0x8e19('0xf')]);router[_0x8e19('0x10')]('/',auth[_0x8e19('0x8')](),controller[_0x8e19('0x11')]);router[_0x8e19('0x10')](_0x8e19('0xc'),auth[_0x8e19('0x8')](),controller[_0x8e19('0x12')]);router['put']('/:id',auth[_0x8e19('0x8')](),controller['update']);router['delete'](_0x8e19('0xa'),auth[_0x8e19('0x8')](),controller[_0x8e19('0x13')]);module[_0x8e19('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 6a96ee5..0d5d789 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 _0x820d=['exports','STRING','basic','integrationTab','sequelize'];(function(_0x4491f0,_0x4d4d7f){var _0x2df09f=function(_0x4b9ceb){while(--_0x4b9ceb){_0x4491f0['push'](_0x4491f0['shift']());}};_0x2df09f(++_0x4d4d7f);}(_0x820d,0xb8));var _0xd820=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x820d[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0xd820('0x0'));module[_0xd820('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd820('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize['ENUM'](_0xd820('0x3')),'defaultValue':_0xd820('0x3')},'password':{'type':Sequelize[_0xd820('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xd820('0x2')]},'token':{'type':Sequelize[_0xd820('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd820('0x2')]},'type':{'type':Sequelize['ENUM'](_0xd820('0x4'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x77f1=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x77f1,0x7c));var _0x177f=function(_0x33bd8c,_0x342fbb){_0x33bd8c=_0x33bd8c-0x0;var _0x9e78b0=_0x77f1[_0x33bd8c];return _0x9e78b0;};'use strict';var Sequelize=require(_0x177f('0x0'));module[_0x177f('0x1')]={'name':{'type':Sequelize[_0x177f('0x2')]},'description':{'type':Sequelize[_0x177f('0x2')]},'username':{'type':Sequelize[_0x177f('0x2')]},'remoteUri':{'type':Sequelize[_0x177f('0x2')]},'authType':{'type':Sequelize[_0x177f('0x3')]('basic'),'defaultValue':_0x177f('0x4')},'password':{'type':Sequelize[_0x177f('0x2')]},'consumerKey':{'type':Sequelize[_0x177f('0x2')]},'consumerSecret':{'type':Sequelize[_0x177f('0x2')]},'token':{'type':Sequelize[_0x177f('0x2')]},'tokenSecret':{'type':Sequelize[_0x177f('0x2')]},'serverUrl':{'type':Sequelize[_0x177f('0x2')]},'type':{'type':Sequelize[_0x177f('0x3')](_0x177f('0x5'),_0x177f('0x6')),'defaultValue':_0x177f('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index df3d1bc..71e9e39 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 _0x5fc8=['sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','test','Sequelize','ValidationError','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','offset','set','save','name','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','DeskAccount','count','includeAll','include','findAll','rows','params','find','catch','create','body','destroy','getConfigurations','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','slice','substring','lastIndexOf','GET','format','application/json','basic','headers','Authorization','Basic\x20%s','username','toString','base64','concat','_embedded','entries','label','statusCode','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x5fc8,0x1ea));var _0x85fc=function(_0x24a9ef,_0x2e4758){_0x24a9ef=_0x24a9ef-0x0;var _0x6ca07e=_0x5fc8[_0x24a9ef];return _0x6ca07e;};'use strict';var pdf=require(_0x85fc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x85fc('0x1'));var zipdir=require(_0x85fc('0x2'));var jsonpatch=require(_0x85fc('0x3'));var rp=require(_0x85fc('0x4'));var moment=require(_0x85fc('0x5'));var BPromise=require(_0x85fc('0x6'));var Mustache=require(_0x85fc('0x7'));var util=require(_0x85fc('0x8'));var path=require(_0x85fc('0x9'));var sox=require(_0x85fc('0xa'));var csv=require(_0x85fc('0xb'));var ejs=require(_0x85fc('0xc'));var fs=require('fs');var _=require(_0x85fc('0xd'));var squel=require('squel');var crypto=require(_0x85fc('0xe'));var jsforce=require(_0x85fc('0xf'));var deskjs=require(_0x85fc('0x10'));var toCsv=require('to-csv');var querystring=require(_0x85fc('0x11'));var Papa=require(_0x85fc('0x12'));var Redis=require(_0x85fc('0x13'));var authService=require(_0x85fc('0x14'));var qs=require(_0x85fc('0x15'));var as=require(_0x85fc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x85fc('0x17'))(_0x85fc('0x18'));var utils=require(_0x85fc('0x19'));var config=require(_0x85fc('0x1a'));var db=require(_0x85fc('0x1b'))['db'];var integrations=require(_0x85fc('0x1c'));var jayson=require('jayson/promise');var client=jayson['client'][_0x85fc('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2ebb5e,_0x26b19d,_0x501145){if(_0x501145){var _0x5e65ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e65ad[_0x85fc('0x1e')](_0x26b19d)){return _0x2ebb5e;}else{throw new db[(_0x85fc('0x1f'))][(_0x85fc('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 _0x2ebb5e;}}function respondWithRpcPromise(_0x52c490,_0x2a22f1,_0x23417a,_0x1f5ece){return new BPromise(function(_0x5a1744,_0x4545c0){var _0x324ae8=_0x1f5ece||client;return _0x324ae8[_0x85fc('0x21')](_0x52c490,_0x23417a)[_0x85fc('0x22')](function(_0x4c41c7){logger['info'](_0x85fc('0x23'),_0x2a22f1,_0x85fc('0x24'));logger[_0x85fc('0x25')](_0x85fc('0x26'),_0x2a22f1,_0x85fc('0x24'),JSON[_0x85fc('0x27')](_0x4c41c7));if(_0x4c41c7[_0x85fc('0x28')]){if(_0x4c41c7[_0x85fc('0x28')]['code']===0x1f4){logger[_0x85fc('0x28')](_0x85fc('0x23'),_0x2a22f1,_0x4c41c7['error'][_0x85fc('0x29')]);return _0x4545c0(_0x4c41c7['error'][_0x85fc('0x29')]);}logger[_0x85fc('0x28')](_0x85fc('0x23'),_0x2a22f1,_0x4c41c7[_0x85fc('0x28')][_0x85fc('0x29')]);return _0x5a1744(_0x4c41c7[_0x85fc('0x28')][_0x85fc('0x29')]);}else{logger[_0x85fc('0x2a')]('DeskAccount,\x20%s,\x20%s',_0x2a22f1,_0x85fc('0x24'));_0x5a1744(_0x4c41c7[_0x85fc('0x2b')]['message']);}})['catch'](function(_0x49e8ce){logger[_0x85fc('0x28')](_0x85fc('0x23'),_0x2a22f1,_0x49e8ce);_0x4545c0(_0x49e8ce);});});}function respondWithStatusCode(_0x4c2d35,_0x3b7d22){_0x3b7d22=_0x3b7d22||0xcc;return function(_0x104bde){if(_0x104bde){return _0x4c2d35[_0x85fc('0x2c')](_0x3b7d22);}return _0x4c2d35[_0x85fc('0x2d')](_0x3b7d22)[_0x85fc('0x2e')]();};}function respondWithResult(_0x1547fd,_0x8a1864){_0x8a1864=_0x8a1864||0xc8;return function(_0x4f8c9b){if(_0x4f8c9b){return _0x1547fd[_0x85fc('0x2d')](_0x8a1864)[_0x85fc('0x2f')](_0x4f8c9b);}};}function respondWithFilteredResult(_0xc767c3,_0x264799){return function(_0x3d78f2){if(_0x3d78f2){var _0x510453=_0x3d78f2['count'],_0x3145da=_0x264799[_0x85fc('0x30')],_0x20de09=_0x264799[_0x85fc('0x30')]+_0x264799['limit'],_0x2895a2;if(_0x20de09>=_0x510453){_0x20de09=_0x510453;_0x2895a2=0xc8;}else{_0x2895a2=0xce;}_0xc767c3['status'](_0x2895a2);return _0xc767c3[_0x85fc('0x31')]('Content-Range',_0x3145da+'-'+_0x20de09+'/'+_0x510453)[_0x85fc('0x2f')](_0x3d78f2);}return null;};}function patchUpdates(_0x3acec2){return function(_0x2b8112){try{jsonpatch['apply'](_0x2b8112,_0x3acec2,!![]);}catch(_0x160589){return BPromise['reject'](_0x160589);}return _0x2b8112[_0x85fc('0x32')]();};}function saveUpdates(_0x3218a9,_0x3da711){return function(_0xe4ffdd){if(_0xe4ffdd){return _0xe4ffdd['update'](_0x3218a9)[_0x85fc('0x22')](function(_0x2067e4){return _0x2067e4;});}return null;};}function removeEntity(_0x567f91,_0x5ca6d4){return function(_0x29fbc0){if(_0x29fbc0){return _0x29fbc0['destroy']()['then'](function(){_0x567f91[_0x85fc('0x2d')](0xcc)[_0x85fc('0x2e')]();});}};}function handleEntityNotFound(_0x110cb3,_0x133ab9){return function(_0x53f92f){if(!_0x53f92f){_0x110cb3['sendStatus'](0x194);}return _0x53f92f;};}function handleError(_0x2421ec,_0x49a999){_0x49a999=_0x49a999||0x1f4;return function(_0x13595c){logger[_0x85fc('0x28')](_0x13595c['stack']);if(_0x13595c[_0x85fc('0x33')]){delete _0x13595c[_0x85fc('0x33')];}_0x2421ec['status'](_0x49a999)['send'](_0x13595c);};}exports['index']=function(_0x166a86,_0x4730f8){var _0x82a466={},_0x737e52={},_0x3db99c={'count':0x0,'rows':[]};var _0x17bf6f=_['map'](db['DeskAccount'][_0x85fc('0x34')],function(_0x297c8d){return{'name':_0x297c8d['fieldName'],'type':_0x297c8d['type'][_0x85fc('0x35')]};});_0x737e52[_0x85fc('0x36')]=_[_0x85fc('0x37')](_0x17bf6f,_0x85fc('0x33'));_0x737e52[_0x85fc('0x38')]=_[_0x85fc('0x39')](_0x166a86['query']);_0x737e52[_0x85fc('0x3a')]=_[_0x85fc('0x3b')](_0x737e52[_0x85fc('0x36')],_0x737e52[_0x85fc('0x38')]);_0x82a466[_0x85fc('0x3c')]=_['intersection'](_0x737e52[_0x85fc('0x36')],qs[_0x85fc('0x3d')](_0x166a86[_0x85fc('0x38')][_0x85fc('0x3d')]));_0x82a466[_0x85fc('0x3c')]=_0x82a466['attributes'][_0x85fc('0x3e')]?_0x82a466['attributes']:_0x737e52[_0x85fc('0x36')];if(!_0x166a86[_0x85fc('0x38')][_0x85fc('0x3f')](_0x85fc('0x40'))){_0x82a466[_0x85fc('0x41')]=qs[_0x85fc('0x41')](_0x166a86[_0x85fc('0x38')]['limit']);_0x82a466['offset']=qs[_0x85fc('0x30')](_0x166a86[_0x85fc('0x38')][_0x85fc('0x30')]);}_0x82a466[_0x85fc('0x42')]=qs['sort'](_0x166a86[_0x85fc('0x38')][_0x85fc('0x43')]);_0x82a466['where']=qs[_0x85fc('0x3a')](_[_0x85fc('0x44')](_0x166a86[_0x85fc('0x38')],_0x737e52[_0x85fc('0x3a')]),_0x17bf6f);if(_0x166a86[_0x85fc('0x38')]['filter']){_0x82a466[_0x85fc('0x45')]=_[_0x85fc('0x46')](_0x82a466[_0x85fc('0x45')],{'$or':_[_0x85fc('0x37')](_0x17bf6f,function(_0x14ad00){if(_0x14ad00[_0x85fc('0x47')]!==_0x85fc('0x48')){var _0x55b94f={};_0x55b94f[_0x14ad00['name']]={'$like':'%'+_0x166a86[_0x85fc('0x38')][_0x85fc('0x49')]+'%'};return _0x55b94f;}})});}_0x82a466=_[_0x85fc('0x46')]({},_0x82a466,_0x166a86[_0x85fc('0x4a')]);var _0x2723dd={'where':_0x82a466[_0x85fc('0x45')]};return db[_0x85fc('0x4b')]['count'](_0x2723dd)[_0x85fc('0x22')](function(_0x20cd99){_0x3db99c[_0x85fc('0x4c')]=_0x20cd99;if(_0x166a86[_0x85fc('0x38')][_0x85fc('0x4d')]){_0x82a466[_0x85fc('0x4e')]=[{'all':!![]}];}return db[_0x85fc('0x4b')][_0x85fc('0x4f')](_0x82a466);})[_0x85fc('0x22')](function(_0xd68870){_0x3db99c[_0x85fc('0x50')]=_0xd68870;return _0x3db99c;})[_0x85fc('0x22')](respondWithFilteredResult(_0x4730f8,_0x82a466))['catch'](handleError(_0x4730f8,null));};exports['show']=function(_0x56d2c6,_0x27423a){var _0x193307={'raw':![],'where':{'id':_0x56d2c6[_0x85fc('0x51')]['id']}},_0x379f85={};_0x379f85[_0x85fc('0x36')]=_[_0x85fc('0x39')](db[_0x85fc('0x4b')]['rawAttributes']);_0x379f85[_0x85fc('0x38')]=_[_0x85fc('0x39')](_0x56d2c6[_0x85fc('0x38')]);_0x379f85[_0x85fc('0x3a')]=_['intersection'](_0x379f85[_0x85fc('0x36')],_0x379f85[_0x85fc('0x38')]);_0x193307['attributes']=_[_0x85fc('0x3b')](_0x379f85[_0x85fc('0x36')],qs[_0x85fc('0x3d')](_0x56d2c6[_0x85fc('0x38')][_0x85fc('0x3d')]));_0x193307[_0x85fc('0x3c')]=_0x193307['attributes'][_0x85fc('0x3e')]?_0x193307[_0x85fc('0x3c')]:_0x379f85[_0x85fc('0x36')];if(_0x56d2c6['query']['includeAll']){_0x193307['include']=[{'all':!![]}];}_0x193307=_[_0x85fc('0x46')]({},_0x193307,_0x56d2c6[_0x85fc('0x4a')]);return db[_0x85fc('0x4b')][_0x85fc('0x52')](_0x193307)['then'](handleEntityNotFound(_0x27423a,null))[_0x85fc('0x22')](respondWithResult(_0x27423a,null))[_0x85fc('0x53')](handleError(_0x27423a,null));};exports[_0x85fc('0x54')]=function(_0x2b2f45,_0x402426){return db['DeskAccount'][_0x85fc('0x54')](_0x2b2f45['body'],{})[_0x85fc('0x22')](respondWithResult(_0x402426,0xc9))['catch'](handleError(_0x402426,null));};exports['update']=function(_0x4dab9e,_0x3c553f){if(_0x4dab9e[_0x85fc('0x55')]['id']){delete _0x4dab9e[_0x85fc('0x55')]['id'];}return db['DeskAccount'][_0x85fc('0x52')]({'where':{'id':_0x4dab9e['params']['id']}})[_0x85fc('0x22')](handleEntityNotFound(_0x3c553f,null))['then'](saveUpdates(_0x4dab9e[_0x85fc('0x55')],null))['then'](respondWithResult(_0x3c553f,null))['catch'](handleError(_0x3c553f,null));};exports[_0x85fc('0x56')]=function(_0x2f9ab5,_0x14e868){return db[_0x85fc('0x4b')][_0x85fc('0x52')]({'where':{'id':_0x2f9ab5[_0x85fc('0x51')]['id']}})[_0x85fc('0x22')](handleEntityNotFound(_0x14e868,null))['then'](removeEntity(_0x14e868,null))[_0x85fc('0x53')](handleError(_0x14e868,null));};exports[_0x85fc('0x57')]=function(_0x21a741,_0x2e9663,_0x45737f){var _0x4c2ad3={};var _0x1ec88f={};var _0x41cd60;var _0x39d520;return db[_0x85fc('0x4b')][_0x85fc('0x58')]({'where':{'id':_0x21a741[_0x85fc('0x51')]['id']}})[_0x85fc('0x22')](handleEntityNotFound(_0x2e9663,null))[_0x85fc('0x22')](function(_0x5f11b5){if(_0x5f11b5){_0x41cd60=_0x5f11b5;_0x1ec88f[_0x85fc('0x36')]=_[_0x85fc('0x39')](db[_0x85fc('0x59')][_0x85fc('0x34')]);_0x1ec88f[_0x85fc('0x38')]=_[_0x85fc('0x39')](_0x21a741[_0x85fc('0x38')]);_0x1ec88f[_0x85fc('0x3a')]=_[_0x85fc('0x3b')](_0x1ec88f[_0x85fc('0x36')],_0x1ec88f[_0x85fc('0x38')]);_0x4c2ad3[_0x85fc('0x3c')]=_[_0x85fc('0x3b')](_0x1ec88f[_0x85fc('0x36')],qs['fields'](_0x21a741[_0x85fc('0x38')]['fields']));_0x4c2ad3['attributes']=_0x4c2ad3[_0x85fc('0x3c')][_0x85fc('0x3e')]?_0x4c2ad3[_0x85fc('0x3c')]:_0x1ec88f['model'];_0x4c2ad3[_0x85fc('0x42')]=qs[_0x85fc('0x43')](_0x21a741[_0x85fc('0x38')][_0x85fc('0x43')]);_0x4c2ad3['where']=qs[_0x85fc('0x3a')](_[_0x85fc('0x44')](_0x21a741[_0x85fc('0x38')],_0x1ec88f[_0x85fc('0x3a')]));if(_0x21a741[_0x85fc('0x38')][_0x85fc('0x49')]){_0x4c2ad3[_0x85fc('0x45')]=_[_0x85fc('0x46')](_0x4c2ad3[_0x85fc('0x45')],{'$or':_['map'](_0x4c2ad3[_0x85fc('0x3c')],function(_0x4eb882){var _0x3d414b={};_0x3d414b[_0x4eb882]={'$like':'%'+_0x21a741['query']['filter']+'%'};return _0x3d414b;})});}_0x4c2ad3=_[_0x85fc('0x46')]({},_0x4c2ad3,_0x21a741[_0x85fc('0x4a')]);return _0x41cd60[_0x85fc('0x57')](_0x4c2ad3);}})['then'](function(_0x5007c4){if(_0x5007c4){_0x39d520=_0x5007c4['length'];if(!_0x21a741[_0x85fc('0x38')][_0x85fc('0x3f')](_0x85fc('0x40'))){_0x4c2ad3[_0x85fc('0x41')]=qs[_0x85fc('0x41')](_0x21a741['query'][_0x85fc('0x41')]);_0x4c2ad3[_0x85fc('0x30')]=qs['offset'](_0x21a741[_0x85fc('0x38')][_0x85fc('0x30')]);}return _0x41cd60[_0x85fc('0x57')](_0x4c2ad3);}})[_0x85fc('0x22')](function(_0x1e40ae){if(_0x1e40ae){return _0x1e40ae?{'count':_0x39d520,'rows':_0x1e40ae}:null;}})[_0x85fc('0x22')](respondWithResult(_0x2e9663,null))[_0x85fc('0x53')](handleError(_0x2e9663,null));};exports[_0x85fc('0x5a')]=function(_0x37030c,_0x145af5,_0x306c94){if(_0x37030c['body']['id']){delete _0x37030c[_0x85fc('0x55')]['id'];}return db[_0x85fc('0x4b')][_0x85fc('0x58')]({'where':{'id':_0x37030c[_0x85fc('0x51')]['id']}})[_0x85fc('0x22')](handleEntityNotFound(_0x145af5,null))[_0x85fc('0x22')](function(_0x222a4f){if(_0x222a4f){_0x37030c[_0x85fc('0x55')][_0x85fc('0x5b')]=_0x222a4f['id'];_0x37030c['body'][_0x85fc('0x5c')]=integrations[_0x85fc('0x5d')](_0x37030c['body'][_0x85fc('0x5e')],_0x37030c['body'][_0x85fc('0x47')]);_0x37030c['body'][_0x85fc('0x5f')]=integrations[_0x85fc('0x60')](_0x37030c[_0x85fc('0x55')][_0x85fc('0x5e')],_0x37030c[_0x85fc('0x55')][_0x85fc('0x47')]);return db[_0x85fc('0x59')][_0x85fc('0x54')](_0x37030c[_0x85fc('0x55')],{'include':[{'model':db[_0x85fc('0x61')],'as':_0x85fc('0x5c')},{'model':db['DeskField'],'as':_0x85fc('0x5f')}]});}return null;})[_0x85fc('0x22')](respondWithResult(_0x145af5,null))[_0x85fc('0x53')](handleError(_0x145af5,null));};exports[_0x85fc('0x62')]=function(_0x39d8c1,_0x26e022,_0x200408){var _0x187686=[{'name':_0x85fc('0x63'),'label':_0x85fc('0x63'),'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 _0x154b2e='';return db[_0x85fc('0x4b')][_0x85fc('0x58')]({'where':{'id':_0x39d8c1[_0x85fc('0x51')]['id']},'attributes':['id',_0x85fc('0x64'),_0x85fc('0x65'),'username',_0x85fc('0x66'),_0x85fc('0x67'),_0x85fc('0x68'),_0x85fc('0x69'),'tokenSecret']})[_0x85fc('0x22')](handleEntityNotFound(_0x26e022,null))[_0x85fc('0x22')](function(_0x216f3c){if(_0x216f3c){_0x154b2e=_0x216f3c[_0x85fc('0x64')];var _0x3de740=_0x154b2e[_0x85fc('0x6a')](-0x1);if(_0x3de740==='/'){_0x154b2e=_0x154b2e[_0x85fc('0x6b')](0x0,_0x154b2e[_0x85fc('0x6c')](_0x3de740));}var _0x57f0f0={'method':_0x85fc('0x6d'),'uri':util[_0x85fc('0x6e')]('%s/custom_fields',_0x154b2e),'headers':{'Content-Type':_0x85fc('0x6f'),'Accept':_0x85fc('0x6f')},'json':!![]};if(_0x216f3c['authType']===_0x85fc('0x70')){_0x57f0f0[_0x85fc('0x71')][_0x85fc('0x72')]=util['format'](_0x85fc('0x73'),new Buffer(util[_0x85fc('0x6e')]('%s:%s',_0x216f3c[_0x85fc('0x74')],_0x216f3c['password']))[_0x85fc('0x75')](_0x85fc('0x76')));}return rp(_0x57f0f0)['then'](function(_0x28b90c){return _0x187686[_0x85fc('0x77')](_[_0x85fc('0x37')](_0x28b90c[_0x85fc('0x78')][_0x85fc('0x79')],function(_0x2411c9){return{'id':_0x2411c9[_0x85fc('0x33')],'name':_0x2411c9['name'],'type':_0x2411c9['type'],'active':_0x2411c9['active'],'label':_0x2411c9[_0x85fc('0x7a')],'custom':!![]};}));});}})['then'](function(_0x55684c){return{'count':_0x55684c['length'],'rows':_0x55684c};})[_0x85fc('0x22')](respondWithResult(_0x26e022,null))[_0x85fc('0x53')](function(_0x764fc6){var _0x306c07=_0x39d8c1[_0x85fc('0x38')][_0x85fc('0x1e')]?0x1f4:_0x764fc6[_0x85fc('0x7b')]||0x1f4;logger[_0x85fc('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x85fc('0x62'),_0x306c07,JSON['stringify'](_0x764fc6));delete _0x764fc6[_0x85fc('0x33')];if(_0x306c07===0x191){_0x306c07=0x190;}_0x26e022[_0x85fc('0x2d')](_0x306c07)['send'](_0x39d8c1[_0x85fc('0x38')]['test']?{'message':_0x85fc('0x7c'),'statusCode':_0x764fc6['statusCode']}:_0x764fc6);});}; \ No newline at end of file +var _0x6ee9=['params','findOne','DeskConfiguration','keys','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','priority','remoteUri','username','password','consumerKey','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','%s:%s','concat','_embedded','entries','active','label','test','getFields,\x20%s,\x20%s,\x20%s','send','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','ValidationError','request','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','index','map','DeskAccount','rawAttributes','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show','intersection','find','create','body'];(function(_0x481812,_0x599a09){var _0xeadbb3=function(_0x48b22e){while(--_0x48b22e){_0x481812['push'](_0x481812['shift']());}};_0xeadbb3(++_0x599a09);}(_0x6ee9,0x18f));var _0x96ee=function(_0x104740,_0x71c28f){_0x104740=_0x104740-0x0;var _0x3ab618=_0x6ee9[_0x104740];return _0x3ab618;};'use strict';var pdf=require(_0x96ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x96ee('0x1'));var zipdir=require(_0x96ee('0x2'));var jsonpatch=require(_0x96ee('0x3'));var rp=require(_0x96ee('0x4'));var moment=require(_0x96ee('0x5'));var BPromise=require(_0x96ee('0x6'));var Mustache=require(_0x96ee('0x7'));var util=require(_0x96ee('0x8'));var path=require(_0x96ee('0x9'));var sox=require(_0x96ee('0xa'));var csv=require(_0x96ee('0xb'));var ejs=require(_0x96ee('0xc'));var fs=require('fs');var _=require(_0x96ee('0xd'));var squel=require('squel');var crypto=require(_0x96ee('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96ee('0xb'));var querystring=require(_0x96ee('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x96ee('0x10'));var qs=require(_0x96ee('0x11'));var as=require(_0x96ee('0x12'));var hardwareService=require(_0x96ee('0x13'));var logger=require(_0x96ee('0x14'))('api');var utils=require(_0x96ee('0x15'));var config=require('../../config/environment');var db=require(_0x96ee('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x96ee('0x17'));var client=jayson[_0x96ee('0x18')][_0x96ee('0x19')]({'port':0x232a});function checkPasswordPattern(_0x20a8ea,_0x14df0d,_0x21a5b8){if(_0x21a5b8){var _0x11dad4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11dad4['test'](_0x14df0d)){return _0x20a8ea;}else{throw new db['Sequelize'][(_0x96ee('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 _0x20a8ea;}}function respondWithRpcPromise(_0x568b8e,_0x118b3b,_0x3c67a7,_0x3b5b14){return new BPromise(function(_0x1da937,_0x57d721){var _0x406d60=_0x3b5b14||client;return _0x406d60[_0x96ee('0x1b')](_0x568b8e,_0x3c67a7)[_0x96ee('0x1c')](function(_0x3007ff){logger[_0x96ee('0x1d')](_0x96ee('0x1e'),_0x118b3b,'request\x20sent');logger[_0x96ee('0x1f')](_0x96ee('0x20'),_0x118b3b,_0x96ee('0x21'),JSON[_0x96ee('0x22')](_0x3007ff));if(_0x3007ff[_0x96ee('0x23')]){if(_0x3007ff[_0x96ee('0x23')][_0x96ee('0x24')]===0x1f4){logger['error'](_0x96ee('0x1e'),_0x118b3b,_0x3007ff[_0x96ee('0x23')][_0x96ee('0x25')]);return _0x57d721(_0x3007ff[_0x96ee('0x23')]['message']);}logger[_0x96ee('0x23')]('DeskAccount,\x20%s,\x20%s',_0x118b3b,_0x3007ff[_0x96ee('0x23')][_0x96ee('0x25')]);return _0x1da937(_0x3007ff[_0x96ee('0x23')]['message']);}else{logger[_0x96ee('0x1d')]('DeskAccount,\x20%s,\x20%s',_0x118b3b,_0x96ee('0x21'));_0x1da937(_0x3007ff[_0x96ee('0x26')][_0x96ee('0x25')]);}})[_0x96ee('0x27')](function(_0x2ad52b){logger[_0x96ee('0x23')](_0x96ee('0x1e'),_0x118b3b,_0x2ad52b);_0x57d721(_0x2ad52b);});});}function respondWithStatusCode(_0xc65c87,_0x5e3206){_0x5e3206=_0x5e3206||0xcc;return function(_0x16ff0a){if(_0x16ff0a){return _0xc65c87[_0x96ee('0x28')](_0x5e3206);}return _0xc65c87[_0x96ee('0x29')](_0x5e3206)[_0x96ee('0x2a')]();};}function respondWithResult(_0x2ae8ab,_0x132d43){_0x132d43=_0x132d43||0xc8;return function(_0x126a40){if(_0x126a40){return _0x2ae8ab[_0x96ee('0x29')](_0x132d43)[_0x96ee('0x2b')](_0x126a40);}};}function respondWithFilteredResult(_0x180f42,_0x3ccbcb){return function(_0x460c92){if(_0x460c92){var _0x56037a=_0x460c92[_0x96ee('0x2c')],_0x52541c=_0x3ccbcb[_0x96ee('0x2d')],_0x2f22b0=_0x3ccbcb[_0x96ee('0x2d')]+_0x3ccbcb[_0x96ee('0x2e')],_0x2e31a8;if(_0x2f22b0>=_0x56037a){_0x2f22b0=_0x56037a;_0x2e31a8=0xc8;}else{_0x2e31a8=0xce;}_0x180f42[_0x96ee('0x29')](_0x2e31a8);return _0x180f42[_0x96ee('0x2f')](_0x96ee('0x30'),_0x52541c+'-'+_0x2f22b0+'/'+_0x56037a)[_0x96ee('0x2b')](_0x460c92);}return null;};}function patchUpdates(_0x3ec6f4){return function(_0x4955c2){try{jsonpatch[_0x96ee('0x31')](_0x4955c2,_0x3ec6f4,!![]);}catch(_0x41155f){return BPromise['reject'](_0x41155f);}return _0x4955c2[_0x96ee('0x32')]();};}function saveUpdates(_0x366959,_0x40e86e){return function(_0x5b96c5){if(_0x5b96c5){return _0x5b96c5['update'](_0x366959)[_0x96ee('0x1c')](function(_0x2f5ae5){return _0x2f5ae5;});}return null;};}function removeEntity(_0x5ac325,_0x3c043d){return function(_0x3fbc6c){if(_0x3fbc6c){return _0x3fbc6c[_0x96ee('0x33')]()[_0x96ee('0x1c')](function(){_0x5ac325['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3088c5,_0xe42312){return function(_0x5df7f9){if(!_0x5df7f9){_0x3088c5[_0x96ee('0x28')](0x194);}return _0x5df7f9;};}function handleError(_0x358115,_0x86faf7){_0x86faf7=_0x86faf7||0x1f4;return function(_0x38acf3){logger[_0x96ee('0x23')](_0x38acf3[_0x96ee('0x34')]);if(_0x38acf3[_0x96ee('0x35')]){delete _0x38acf3[_0x96ee('0x35')];}_0x358115['status'](_0x86faf7)['send'](_0x38acf3);};}exports[_0x96ee('0x36')]=function(_0x4307d4,_0x2e34eb){var _0x3ff902={},_0x3946b0={},_0x3c38c8={'count':0x0,'rows':[]};var _0x554d2d=_[_0x96ee('0x37')](db[_0x96ee('0x38')][_0x96ee('0x39')],function(_0x389ccb){return{'name':_0x389ccb[_0x96ee('0x3a')],'type':_0x389ccb['type'][_0x96ee('0x3b')]};});_0x3946b0[_0x96ee('0x3c')]=_[_0x96ee('0x37')](_0x554d2d,_0x96ee('0x35'));_0x3946b0[_0x96ee('0x3d')]=_['keys'](_0x4307d4[_0x96ee('0x3d')]);_0x3946b0[_0x96ee('0x3e')]=_['intersection'](_0x3946b0[_0x96ee('0x3c')],_0x3946b0[_0x96ee('0x3d')]);_0x3ff902['attributes']=_['intersection'](_0x3946b0[_0x96ee('0x3c')],qs['fields'](_0x4307d4[_0x96ee('0x3d')][_0x96ee('0x3f')]));_0x3ff902[_0x96ee('0x40')]=_0x3ff902['attributes'][_0x96ee('0x41')]?_0x3ff902['attributes']:_0x3946b0['model'];if(!_0x4307d4['query'][_0x96ee('0x42')](_0x96ee('0x43'))){_0x3ff902['limit']=qs[_0x96ee('0x2e')](_0x4307d4[_0x96ee('0x3d')][_0x96ee('0x2e')]);_0x3ff902[_0x96ee('0x2d')]=qs[_0x96ee('0x2d')](_0x4307d4[_0x96ee('0x3d')][_0x96ee('0x2d')]);}_0x3ff902[_0x96ee('0x44')]=qs[_0x96ee('0x45')](_0x4307d4[_0x96ee('0x3d')]['sort']);_0x3ff902['where']=qs[_0x96ee('0x3e')](_[_0x96ee('0x46')](_0x4307d4[_0x96ee('0x3d')],_0x3946b0[_0x96ee('0x3e')]),_0x554d2d);if(_0x4307d4[_0x96ee('0x3d')][_0x96ee('0x47')]){_0x3ff902[_0x96ee('0x48')]=_[_0x96ee('0x49')](_0x3ff902[_0x96ee('0x48')],{'$or':_[_0x96ee('0x37')](_0x554d2d,function(_0x7f9904){if(_0x7f9904[_0x96ee('0x4a')]!=='VIRTUAL'){var _0x1937e8={};_0x1937e8[_0x7f9904[_0x96ee('0x35')]]={'$like':'%'+_0x4307d4[_0x96ee('0x3d')]['filter']+'%'};return _0x1937e8;}})});}_0x3ff902=_[_0x96ee('0x49')]({},_0x3ff902,_0x4307d4[_0x96ee('0x4b')]);var _0x2a4072={'where':_0x3ff902[_0x96ee('0x48')]};return db[_0x96ee('0x38')][_0x96ee('0x2c')](_0x2a4072)[_0x96ee('0x1c')](function(_0x1cdb82){_0x3c38c8[_0x96ee('0x2c')]=_0x1cdb82;if(_0x4307d4[_0x96ee('0x3d')][_0x96ee('0x4c')]){_0x3ff902[_0x96ee('0x4d')]=[{'all':!![]}];}return db[_0x96ee('0x38')][_0x96ee('0x4e')](_0x3ff902);})['then'](function(_0x207b8f){_0x3c38c8[_0x96ee('0x4f')]=_0x207b8f;return _0x3c38c8;})[_0x96ee('0x1c')](respondWithFilteredResult(_0x2e34eb,_0x3ff902))[_0x96ee('0x27')](handleError(_0x2e34eb,null));};exports[_0x96ee('0x50')]=function(_0x2a858c,_0x1d89ab){var _0x2a8f1={'raw':![],'where':{'id':_0x2a858c['params']['id']}},_0x4a9bfa={};_0x4a9bfa[_0x96ee('0x3c')]=_['keys'](db[_0x96ee('0x38')][_0x96ee('0x39')]);_0x4a9bfa[_0x96ee('0x3d')]=_['keys'](_0x2a858c['query']);_0x4a9bfa['filters']=_[_0x96ee('0x51')](_0x4a9bfa[_0x96ee('0x3c')],_0x4a9bfa[_0x96ee('0x3d')]);_0x2a8f1[_0x96ee('0x40')]=_[_0x96ee('0x51')](_0x4a9bfa['model'],qs[_0x96ee('0x3f')](_0x2a858c[_0x96ee('0x3d')][_0x96ee('0x3f')]));_0x2a8f1[_0x96ee('0x40')]=_0x2a8f1[_0x96ee('0x40')]['length']?_0x2a8f1[_0x96ee('0x40')]:_0x4a9bfa[_0x96ee('0x3c')];if(_0x2a858c[_0x96ee('0x3d')][_0x96ee('0x4c')]){_0x2a8f1[_0x96ee('0x4d')]=[{'all':!![]}];}_0x2a8f1=_[_0x96ee('0x49')]({},_0x2a8f1,_0x2a858c[_0x96ee('0x4b')]);return db[_0x96ee('0x38')][_0x96ee('0x52')](_0x2a8f1)[_0x96ee('0x1c')](handleEntityNotFound(_0x1d89ab,null))[_0x96ee('0x1c')](respondWithResult(_0x1d89ab,null))[_0x96ee('0x27')](handleError(_0x1d89ab,null));};exports['create']=function(_0x164db1,_0x36e452){return db[_0x96ee('0x38')][_0x96ee('0x53')](_0x164db1[_0x96ee('0x54')],{})[_0x96ee('0x1c')](respondWithResult(_0x36e452,0xc9))[_0x96ee('0x27')](handleError(_0x36e452,null));};exports['update']=function(_0x485358,_0x3304a4){if(_0x485358[_0x96ee('0x54')]['id']){delete _0x485358['body']['id'];}return db[_0x96ee('0x38')][_0x96ee('0x52')]({'where':{'id':_0x485358['params']['id']}})[_0x96ee('0x1c')](handleEntityNotFound(_0x3304a4,null))[_0x96ee('0x1c')](saveUpdates(_0x485358[_0x96ee('0x54')],null))['then'](respondWithResult(_0x3304a4,null))[_0x96ee('0x27')](handleError(_0x3304a4,null));};exports[_0x96ee('0x33')]=function(_0xfce2e,_0x3d9995){return db['DeskAccount'][_0x96ee('0x52')]({'where':{'id':_0xfce2e[_0x96ee('0x55')]['id']}})[_0x96ee('0x1c')](handleEntityNotFound(_0x3d9995,null))[_0x96ee('0x1c')](removeEntity(_0x3d9995,null))[_0x96ee('0x27')](handleError(_0x3d9995,null));};exports['getConfigurations']=function(_0x470575,_0x1263a5,_0x380367){var _0x1ca283={};var _0x2dc6a9={};var _0x53b15c;var _0xf4ced1;return db['DeskAccount'][_0x96ee('0x56')]({'where':{'id':_0x470575['params']['id']}})[_0x96ee('0x1c')](handleEntityNotFound(_0x1263a5,null))[_0x96ee('0x1c')](function(_0x442345){if(_0x442345){_0x53b15c=_0x442345;_0x2dc6a9['model']=_['keys'](db[_0x96ee('0x57')][_0x96ee('0x39')]);_0x2dc6a9['query']=_[_0x96ee('0x58')](_0x470575['query']);_0x2dc6a9[_0x96ee('0x3e')]=_['intersection'](_0x2dc6a9[_0x96ee('0x3c')],_0x2dc6a9[_0x96ee('0x3d')]);_0x1ca283[_0x96ee('0x40')]=_[_0x96ee('0x51')](_0x2dc6a9['model'],qs[_0x96ee('0x3f')](_0x470575[_0x96ee('0x3d')]['fields']));_0x1ca283[_0x96ee('0x40')]=_0x1ca283[_0x96ee('0x40')][_0x96ee('0x41')]?_0x1ca283[_0x96ee('0x40')]:_0x2dc6a9[_0x96ee('0x3c')];_0x1ca283[_0x96ee('0x44')]=qs[_0x96ee('0x45')](_0x470575['query'][_0x96ee('0x45')]);_0x1ca283[_0x96ee('0x48')]=qs[_0x96ee('0x3e')](_['pick'](_0x470575['query'],_0x2dc6a9[_0x96ee('0x3e')]));if(_0x470575[_0x96ee('0x3d')][_0x96ee('0x47')]){_0x1ca283[_0x96ee('0x48')]=_[_0x96ee('0x49')](_0x1ca283['where'],{'$or':_[_0x96ee('0x37')](_0x1ca283[_0x96ee('0x40')],function(_0x1f9b7b){var _0x2cc0c7={};_0x2cc0c7[_0x1f9b7b]={'$like':'%'+_0x470575[_0x96ee('0x3d')][_0x96ee('0x47')]+'%'};return _0x2cc0c7;})});}_0x1ca283=_[_0x96ee('0x49')]({},_0x1ca283,_0x470575[_0x96ee('0x4b')]);return _0x53b15c[_0x96ee('0x59')](_0x1ca283);}})[_0x96ee('0x1c')](function(_0x6a2dca){if(_0x6a2dca){_0xf4ced1=_0x6a2dca[_0x96ee('0x41')];if(!_0x470575['query'][_0x96ee('0x42')](_0x96ee('0x43'))){_0x1ca283[_0x96ee('0x2e')]=qs[_0x96ee('0x2e')](_0x470575[_0x96ee('0x3d')][_0x96ee('0x2e')]);_0x1ca283[_0x96ee('0x2d')]=qs[_0x96ee('0x2d')](_0x470575[_0x96ee('0x3d')][_0x96ee('0x2d')]);}return _0x53b15c[_0x96ee('0x59')](_0x1ca283);}})[_0x96ee('0x1c')](function(_0xc6cf25){if(_0xc6cf25){return _0xc6cf25?{'count':_0xf4ced1,'rows':_0xc6cf25}:null;}})[_0x96ee('0x1c')](respondWithResult(_0x1263a5,null))[_0x96ee('0x27')](handleError(_0x1263a5,null));};exports[_0x96ee('0x5a')]=function(_0x2e170c,_0x5c8ed8,_0x5e77a0){if(_0x2e170c[_0x96ee('0x54')]['id']){delete _0x2e170c[_0x96ee('0x54')]['id'];}return db['DeskAccount'][_0x96ee('0x56')]({'where':{'id':_0x2e170c[_0x96ee('0x55')]['id']}})[_0x96ee('0x1c')](handleEntityNotFound(_0x5c8ed8,null))['then'](function(_0x392ec0){if(_0x392ec0){_0x2e170c['body'][_0x96ee('0x5b')]=_0x392ec0['id'];_0x2e170c[_0x96ee('0x54')][_0x96ee('0x5c')]=integrations[_0x96ee('0x5d')](_0x2e170c['body'][_0x96ee('0x5e')],_0x2e170c[_0x96ee('0x54')]['type']);_0x2e170c['body'][_0x96ee('0x5f')]=integrations['getDescriptions'](_0x2e170c[_0x96ee('0x54')][_0x96ee('0x5e')],_0x2e170c[_0x96ee('0x54')][_0x96ee('0x4a')]);return db[_0x96ee('0x57')][_0x96ee('0x53')](_0x2e170c[_0x96ee('0x54')],{'include':[{'model':db[_0x96ee('0x60')],'as':_0x96ee('0x5c')},{'model':db[_0x96ee('0x60')],'as':'Descriptions'}]});}return null;})[_0x96ee('0x1c')](respondWithResult(_0x5c8ed8,null))[_0x96ee('0x27')](handleError(_0x5c8ed8,null));};exports['getFields']=function(_0x4fb38a,_0x141251,_0x13a3c6){var _0x583e9e=[{'name':_0x96ee('0x61'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x48709c='';return db[_0x96ee('0x38')]['findOne']({'where':{'id':_0x4fb38a['params']['id']},'attributes':['id',_0x96ee('0x62'),'authType',_0x96ee('0x63'),_0x96ee('0x64'),_0x96ee('0x65'),'consumerSecret',_0x96ee('0x66'),_0x96ee('0x67')]})[_0x96ee('0x1c')](handleEntityNotFound(_0x141251,null))[_0x96ee('0x1c')](function(_0x5567e6){if(_0x5567e6){_0x48709c=_0x5567e6[_0x96ee('0x62')];var _0x2276f5=_0x48709c[_0x96ee('0x68')](-0x1);if(_0x2276f5==='/'){_0x48709c=_0x48709c['substring'](0x0,_0x48709c[_0x96ee('0x69')](_0x2276f5));}var _0x15dd4c={'method':_0x96ee('0x6a'),'uri':util[_0x96ee('0x6b')](_0x96ee('0x6c'),_0x48709c),'headers':{'Content-Type':_0x96ee('0x6d'),'Accept':_0x96ee('0x6d')},'json':!![]};if(_0x5567e6['authType']==='basic'){_0x15dd4c[_0x96ee('0x6e')][_0x96ee('0x6f')]=util[_0x96ee('0x6b')]('Basic\x20%s',new Buffer(util[_0x96ee('0x6b')](_0x96ee('0x70'),_0x5567e6[_0x96ee('0x63')],_0x5567e6[_0x96ee('0x64')]))['toString']('base64'));}return rp(_0x15dd4c)[_0x96ee('0x1c')](function(_0x383658){return _0x583e9e[_0x96ee('0x71')](_[_0x96ee('0x37')](_0x383658[_0x96ee('0x72')][_0x96ee('0x73')],function(_0x2bf045){return{'id':_0x2bf045[_0x96ee('0x35')],'name':_0x2bf045[_0x96ee('0x35')],'type':_0x2bf045['type'],'active':_0x2bf045[_0x96ee('0x74')],'label':_0x2bf045[_0x96ee('0x75')],'custom':!![]};}));});}})[_0x96ee('0x1c')](function(_0x191048){return{'count':_0x191048[_0x96ee('0x41')],'rows':_0x191048};})[_0x96ee('0x1c')](respondWithResult(_0x141251,null))[_0x96ee('0x27')](function(_0x34c9ff){var _0x2ff208=_0x4fb38a[_0x96ee('0x3d')][_0x96ee('0x76')]?0x1f4:_0x34c9ff['statusCode']||0x1f4;logger[_0x96ee('0x23')](_0x96ee('0x77'),'getFields',_0x2ff208,JSON['stringify'](_0x34c9ff));delete _0x34c9ff[_0x96ee('0x35')];if(_0x2ff208===0x191){_0x2ff208=0x190;}_0x141251[_0x96ee('0x29')](_0x2ff208)[_0x96ee('0x78')](_0x4fb38a['query'][_0x96ee('0x76')]?{'message':'Wrong\x20credentials','statusCode':_0x34c9ff['statusCode']}:_0x34c9ff);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 51adc59..0094bb1 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 _0xe18c=['exports','define','DeskAccount','int_desk_accounts','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4911f1,_0xd974c8){var _0x113e48=function(_0x3bda54){while(--_0x3bda54){_0x4911f1['push'](_0x4911f1['shift']());}};_0x113e48(++_0xd974c8);}(_0xe18c,0x178));var _0xce18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe18c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xce18('0x0'));var util=require(_0xce18('0x1'));var logger=require('../../config/logger')(_0xce18('0x2'));var moment=require(_0xce18('0x3'));var BPromise=require('bluebird');var rp=require(_0xce18('0x4'));var fs=require('fs');var path=require(_0xce18('0x5'));var rimraf=require(_0xce18('0x6'));var config=require(_0xce18('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xce18('0x8')]=function(_0x444180,_0xb09964){return _0x444180[_0xce18('0x9')](_0xce18('0xa'),attributes,{'tableName':_0xce18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b34=['path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util','moment','bluebird','request-promise'];(function(_0x3e451f,_0x10500d){var _0x57978f=function(_0x52f960){while(--_0x52f960){_0x3e451f['push'](_0x3e451f['shift']());}};_0x57978f(++_0x10500d);}(_0x9b34,0xd4));var _0x49b3=function(_0x6d6332,_0x36425f){_0x6d6332=_0x6d6332-0x0;var _0x2d354e=_0x9b34[_0x6d6332];return _0x2d354e;};'use strict';var _=require('lodash');var util=require(_0x49b3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x49b3('0x1'));var BPromise=require(_0x49b3('0x2'));var rp=require(_0x49b3('0x3'));var fs=require('fs');var path=require(_0x49b3('0x4'));var rimraf=require(_0x49b3('0x5'));var config=require('../../config/environment');var attributes=require(_0x49b3('0x6'));var integrations=require(_0x49b3('0x7'));module[_0x49b3('0x8')]=function(_0x4a6716,_0x3ea3ed){return _0x4a6716[_0x49b3('0x9')](_0x49b3('0xa'),attributes,{'tableName':_0x49b3('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 5132411..f5d591e 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 _0xaaca=['catch','ShowDeskAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','include','map','model'];(function(_0x2ca7d9,_0x240b45){var _0x37e067=function(_0x14f36d){while(--_0x14f36d){_0x2ca7d9['push'](_0x2ca7d9['shift']());}};_0x37e067(++_0x240b45);}(_0xaaca,0x158));var _0xaaac=function(_0x513545,_0x158f2e){_0x513545=_0x513545-0x0;var _0x18b7c5=_0xaaca[_0x513545];return _0x18b7c5;};'use strict';var _=require(_0xaaac('0x0'));var util=require(_0xaaac('0x1'));var moment=require('moment');var BPromise=require(_0xaaac('0x2'));var rs=require(_0xaaac('0x3'));var fs=require('fs');var Redis=require(_0xaaac('0x4'));var db=require(_0xaaac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaaac('0x6'))('rpc');var config=require(_0xaaac('0x7'));var jayson=require(_0xaaac('0x8'));var client=jayson[_0xaaac('0x9')][_0xaaac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40be1f,_0xc3ebe,_0x2f2cf5){return new BPromise(function(_0x36dfa7,_0x33881f){return client['request'](_0x40be1f,_0x2f2cf5)[_0xaaac('0xb')](function(_0x48e4f1){logger[_0xaaac('0xc')](_0xaaac('0xd'),_0xc3ebe,_0xaaac('0xe'));logger[_0xaaac('0xf')](_0xaaac('0x10'),_0xc3ebe,'request\x20sent',JSON[_0xaaac('0x11')](_0x48e4f1));if(_0x48e4f1[_0xaaac('0x12')]){if(_0x48e4f1[_0xaaac('0x12')][_0xaaac('0x13')]===0x1f4){logger[_0xaaac('0x12')]('DeskAccount,\x20%s,\x20%s',_0xc3ebe,_0x48e4f1['error'][_0xaaac('0x14')]);return _0x33881f(_0x48e4f1[_0xaaac('0x12')][_0xaaac('0x14')]);}logger[_0xaaac('0x12')](_0xaaac('0xd'),_0xc3ebe,_0x48e4f1[_0xaaac('0x12')][_0xaaac('0x14')]);return _0x36dfa7(_0x48e4f1[_0xaaac('0x12')][_0xaaac('0x14')]);}else{logger[_0xaaac('0xc')](_0xaaac('0xd'),_0xc3ebe,'request\x20sent');_0x36dfa7(_0x48e4f1['result'][_0xaaac('0x14')]);}})['catch'](function(_0x20e374){logger[_0xaaac('0x12')](_0xaaac('0xd'),_0xc3ebe,_0x20e374);_0x33881f(_0x20e374);});});}exports[_0xaaac('0x15')]=function(_0x4e4668){var _0x85ca52=this;return new Promise(function(_0x186aa2,_0x42746d){return db[_0xaaac('0x16')][_0xaaac('0x17')]({'raw':_0x4e4668[_0xaaac('0x18')]?_0x4e4668[_0xaaac('0x18')][_0xaaac('0x19')]===undefined?!![]:![]:!![],'where':_0x4e4668[_0xaaac('0x18')]?_0x4e4668[_0xaaac('0x18')]['where']||null:null,'attributes':_0x4e4668[_0xaaac('0x18')]?_0x4e4668[_0xaaac('0x18')][_0xaaac('0x1a')]||null:null,'limit':_0x4e4668[_0xaaac('0x18')]?_0x4e4668[_0xaaac('0x18')]['limit']||null:null,'include':_0x4e4668[_0xaaac('0x18')]?_0x4e4668[_0xaaac('0x18')][_0xaaac('0x1b')]?_[_0xaaac('0x1c')](_0x4e4668[_0xaaac('0x18')]['include'],function(_0x3c92d7){return{'model':db[_0x3c92d7['model']],'as':_0x3c92d7['as'],'attributes':_0x3c92d7['attributes'],'include':_0x3c92d7[_0xaaac('0x1b')]?_[_0xaaac('0x1c')](_0x3c92d7[_0xaaac('0x1b')],function(_0x2b75eb){return{'model':db[_0x2b75eb[_0xaaac('0x1d')]],'as':_0x2b75eb['as'],'attributes':_0x2b75eb[_0xaaac('0x1a')],'include':_0x2b75eb['include']?_[_0xaaac('0x1c')](_0x2b75eb[_0xaaac('0x1b')],function(_0xc3c99a){return{'model':db[_0xc3c99a[_0xaaac('0x1d')]],'as':_0xc3c99a['as'],'attributes':_0xc3c99a['attributes']};}):[]};}):[]};}):[]:[]})[_0xaaac('0xb')](function(_0x17a85d){logger[_0xaaac('0xc')]('GetDeskAccount',_0x4e4668);logger['debug'](_0xaaac('0x15'),_0x4e4668,JSON[_0xaaac('0x11')](_0x17a85d));_0x186aa2(_0x17a85d);})[_0xaaac('0x1e')](function(_0x497277){logger[_0xaaac('0x12')](_0xaaac('0x15'),_0x497277[_0xaaac('0x14')],_0x4e4668);_0x42746d(_0x85ca52['error'](0x1f4,_0x497277[_0xaaac('0x14')]));});});};exports[_0xaaac('0x1f')]=function(_0x394f84){var _0x97890d=this;return new Promise(function(_0x29e184,_0x194bee){return db[_0xaaac('0x16')][_0xaaac('0x20')]({'raw':_0x394f84[_0xaaac('0x18')]?_0x394f84[_0xaaac('0x18')][_0xaaac('0x19')]===undefined?!![]:![]:!![],'where':_0x394f84[_0xaaac('0x18')]?_0x394f84[_0xaaac('0x18')][_0xaaac('0x21')]||null:null,'attributes':_0x394f84[_0xaaac('0x18')]?_0x394f84[_0xaaac('0x18')][_0xaaac('0x1a')]||null:null,'include':_0x394f84['options']?_0x394f84[_0xaaac('0x18')]['include']?_[_0xaaac('0x1c')](_0x394f84[_0xaaac('0x18')][_0xaaac('0x1b')],function(_0x49b93d){return{'model':db[_0x49b93d[_0xaaac('0x1d')]],'as':_0x49b93d['as'],'attributes':_0x49b93d[_0xaaac('0x1a')],'include':_0x49b93d['include']?_[_0xaaac('0x1c')](_0x49b93d[_0xaaac('0x1b')],function(_0x5c951a){return{'model':db[_0x5c951a['model']],'as':_0x5c951a['as'],'attributes':_0x5c951a[_0xaaac('0x1a')],'include':_0x5c951a[_0xaaac('0x1b')]?_[_0xaaac('0x1c')](_0x5c951a[_0xaaac('0x1b')],function(_0x475bd6){return{'model':db[_0x475bd6[_0xaaac('0x1d')]],'as':_0x475bd6['as'],'attributes':_0x475bd6[_0xaaac('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47f529){logger[_0xaaac('0xc')]('ShowDeskAccount',_0x394f84);logger[_0xaaac('0xf')](_0xaaac('0x1f'),_0x394f84,JSON['stringify'](_0x47f529));_0x29e184(_0x47f529);})[_0xaaac('0x1e')](function(_0x39aa7e){logger[_0xaaac('0x12')](_0xaaac('0x1f'),_0x39aa7e[_0xaaac('0x14')],_0x394f84);_0x194bee(_0x97890d[_0xaaac('0x12')](0x1f4,_0x39aa7e[_0xaaac('0x14')]));});});}; \ No newline at end of file +var _0x5778=['request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','info','result','catch','GetDeskAccount','DeskAccount','findAll','options','attributes','limit','include','map','model','ShowDeskAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','then'];(function(_0x157241,_0x2cc891){var _0x4d85bc=function(_0x146a9b){while(--_0x146a9b){_0x157241['push'](_0x157241['shift']());}};_0x4d85bc(++_0x2cc891);}(_0x5778,0x196));var _0x8577=function(_0x29fc26,_0x2d112a){_0x29fc26=_0x29fc26-0x0;var _0x21a90c=_0x5778[_0x29fc26];return _0x21a90c;};'use strict';var _=require(_0x8577('0x0'));var util=require(_0x8577('0x1'));var moment=require(_0x8577('0x2'));var BPromise=require('bluebird');var rs=require(_0x8577('0x3'));var fs=require('fs');var Redis=require(_0x8577('0x4'));var db=require(_0x8577('0x5'))['db'];var utils=require(_0x8577('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8577('0x7'));var client=jayson['client'][_0x8577('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b1366,_0x6866af,_0xa2853d){return new BPromise(function(_0xbce25f,_0x5021fa){return client['request'](_0x4b1366,_0xa2853d)[_0x8577('0x9')](function(_0x27d35f){logger['info']('DeskAccount,\x20%s,\x20%s',_0x6866af,_0x8577('0xa'));logger[_0x8577('0xb')](_0x8577('0xc'),_0x6866af,_0x8577('0xa'),JSON[_0x8577('0xd')](_0x27d35f));if(_0x27d35f[_0x8577('0xe')]){if(_0x27d35f[_0x8577('0xe')][_0x8577('0xf')]===0x1f4){logger[_0x8577('0xe')]('DeskAccount,\x20%s,\x20%s',_0x6866af,_0x27d35f[_0x8577('0xe')]['message']);return _0x5021fa(_0x27d35f[_0x8577('0xe')][_0x8577('0x10')]);}logger['error'](_0x8577('0x11'),_0x6866af,_0x27d35f[_0x8577('0xe')][_0x8577('0x10')]);return _0xbce25f(_0x27d35f['error'][_0x8577('0x10')]);}else{logger[_0x8577('0x12')](_0x8577('0x11'),_0x6866af,_0x8577('0xa'));_0xbce25f(_0x27d35f[_0x8577('0x13')][_0x8577('0x10')]);}})[_0x8577('0x14')](function(_0x775ddc){logger[_0x8577('0xe')](_0x8577('0x11'),_0x6866af,_0x775ddc);_0x5021fa(_0x775ddc);});});}exports[_0x8577('0x15')]=function(_0x22ca57){var _0x446f5d=this;return new Promise(function(_0x4df3f1,_0x149194){return db[_0x8577('0x16')][_0x8577('0x17')]({'raw':_0x22ca57[_0x8577('0x18')]?_0x22ca57[_0x8577('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x22ca57[_0x8577('0x18')]?_0x22ca57[_0x8577('0x18')]['where']||null:null,'attributes':_0x22ca57['options']?_0x22ca57[_0x8577('0x18')][_0x8577('0x19')]||null:null,'limit':_0x22ca57[_0x8577('0x18')]?_0x22ca57[_0x8577('0x18')][_0x8577('0x1a')]||null:null,'include':_0x22ca57[_0x8577('0x18')]?_0x22ca57[_0x8577('0x18')][_0x8577('0x1b')]?_[_0x8577('0x1c')](_0x22ca57['options']['include'],function(_0xe0605b){return{'model':db[_0xe0605b[_0x8577('0x1d')]],'as':_0xe0605b['as'],'attributes':_0xe0605b[_0x8577('0x19')],'include':_0xe0605b[_0x8577('0x1b')]?_[_0x8577('0x1c')](_0xe0605b[_0x8577('0x1b')],function(_0x16c753){return{'model':db[_0x16c753[_0x8577('0x1d')]],'as':_0x16c753['as'],'attributes':_0x16c753[_0x8577('0x19')],'include':_0x16c753['include']?_[_0x8577('0x1c')](_0x16c753[_0x8577('0x1b')],function(_0x620bd0){return{'model':db[_0x620bd0[_0x8577('0x1d')]],'as':_0x620bd0['as'],'attributes':_0x620bd0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c3018){logger[_0x8577('0x12')]('GetDeskAccount',_0x22ca57);logger[_0x8577('0xb')]('GetDeskAccount',_0x22ca57,JSON[_0x8577('0xd')](_0x4c3018));_0x4df3f1(_0x4c3018);})[_0x8577('0x14')](function(_0x46c704){logger[_0x8577('0xe')](_0x8577('0x15'),_0x46c704[_0x8577('0x10')],_0x22ca57);_0x149194(_0x446f5d[_0x8577('0xe')](0x1f4,_0x46c704[_0x8577('0x10')]));});});};exports[_0x8577('0x1e')]=function(_0x6e5c29){var _0x4d04eb=this;return new Promise(function(_0xd93355,_0x27316a){return db[_0x8577('0x16')]['find']({'raw':_0x6e5c29[_0x8577('0x18')]?_0x6e5c29['options'][_0x8577('0x1f')]===undefined?!![]:![]:!![],'where':_0x6e5c29[_0x8577('0x18')]?_0x6e5c29[_0x8577('0x18')]['where']||null:null,'attributes':_0x6e5c29[_0x8577('0x18')]?_0x6e5c29[_0x8577('0x18')][_0x8577('0x19')]||null:null,'include':_0x6e5c29['options']?_0x6e5c29[_0x8577('0x18')][_0x8577('0x1b')]?_[_0x8577('0x1c')](_0x6e5c29[_0x8577('0x18')][_0x8577('0x1b')],function(_0x53d479){return{'model':db[_0x53d479['model']],'as':_0x53d479['as'],'attributes':_0x53d479[_0x8577('0x19')],'include':_0x53d479[_0x8577('0x1b')]?_[_0x8577('0x1c')](_0x53d479[_0x8577('0x1b')],function(_0x20ac82){return{'model':db[_0x20ac82[_0x8577('0x1d')]],'as':_0x20ac82['as'],'attributes':_0x20ac82[_0x8577('0x19')],'include':_0x20ac82['include']?_[_0x8577('0x1c')](_0x20ac82[_0x8577('0x1b')],function(_0xa7bb2a){return{'model':db[_0xa7bb2a[_0x8577('0x1d')]],'as':_0xa7bb2a['as'],'attributes':_0xa7bb2a[_0x8577('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8577('0x9')](function(_0x1fd1cb){logger['info'](_0x8577('0x1e'),_0x6e5c29);logger[_0x8577('0xb')](_0x8577('0x1e'),_0x6e5c29,JSON['stringify'](_0x1fd1cb));_0xd93355(_0x1fd1cb);})[_0x8577('0x14')](function(_0x1c454a){logger['error']('ShowDeskAccount',_0x1c454a[_0x8577('0x10')],_0x6e5c29);_0x27316a(_0x4d04eb[_0x8577('0xe')](0x1f4,_0x1c454a['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index db4843e..0e8b48f 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 _0x8ed7=['/:id/descriptions','getTags','post','create','delete','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x8ed7,0x8b));var _0x78ed=function(_0x23960f,_0x4df89c){_0x23960f=_0x23960f-0x0;var _0x24d40b=_0x8ed7[_0x23960f];return _0x24d40b;};'use strict';var multer=require('multer');var util=require(_0x78ed('0x0'));var path=require(_0x78ed('0x1'));var timeout=require(_0x78ed('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x78ed('0x3'));var interaction=require(_0x78ed('0x4'));var config=require(_0x78ed('0x5'));var controller=require(_0x78ed('0x6'));router[_0x78ed('0x7')]('/',auth[_0x78ed('0x8')](),controller[_0x78ed('0x9')]);router[_0x78ed('0x7')](_0x78ed('0xa'),auth['isAuthenticated'](),controller[_0x78ed('0xb')]);router['get'](_0x78ed('0xc'),auth['isAuthenticated'](),controller[_0x78ed('0xd')]);router['get']('/:id/subjects',auth[_0x78ed('0x8')](),controller[_0x78ed('0xe')]);router['get'](_0x78ed('0xf'),auth[_0x78ed('0x8')](),controller['getDescriptions']);router[_0x78ed('0x7')]('/:id/tags',auth[_0x78ed('0x8')](),controller[_0x78ed('0x10')]);router[_0x78ed('0x11')]('/',auth[_0x78ed('0x8')](),controller[_0x78ed('0x12')]);router[_0x78ed('0x11')]('/:id/tags',auth[_0x78ed('0x8')](),controller['setTags']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x78ed('0x13')](_0x78ed('0xa'),auth[_0x78ed('0x8')](),controller[_0x78ed('0x14')]);module[_0x78ed('0x15')]=router; \ No newline at end of file +var _0x199c=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','/:id','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getFields'];(function(_0x3a1859,_0x596127){var _0x1cfab7=function(_0x558c0a){while(--_0x558c0a){_0x3a1859['push'](_0x3a1859['shift']());}};_0x1cfab7(++_0x596127);}(_0x199c,0x1d8));var _0xc199=function(_0x4f35c1,_0x1dbab0){_0x4f35c1=_0x4f35c1-0x0;var _0x42db7f=_0x199c[_0x4f35c1];return _0x42db7f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc199('0x0'));var timeout=require(_0xc199('0x1'));var express=require(_0xc199('0x2'));var router=express[_0xc199('0x3')]();var auth=require(_0xc199('0x4'));var interaction=require(_0xc199('0x5'));var config=require(_0xc199('0x6'));var controller=require(_0xc199('0x7'));router['get']('/',auth[_0xc199('0x8')](),controller[_0xc199('0x9')]);router['get']('/:id',auth[_0xc199('0x8')](),controller[_0xc199('0xa')]);router[_0xc199('0xb')](_0xc199('0xc'),auth[_0xc199('0x8')](),controller[_0xc199('0xd')]);router[_0xc199('0xb')](_0xc199('0xe'),auth['isAuthenticated'](),controller[_0xc199('0xf')]);router[_0xc199('0xb')](_0xc199('0x10'),auth[_0xc199('0x8')](),controller[_0xc199('0x11')]);router[_0xc199('0xb')]('/:id/tags',auth[_0xc199('0x8')](),controller[_0xc199('0x12')]);router[_0xc199('0x13')]('/',auth[_0xc199('0x8')](),controller[_0xc199('0x14')]);router['post'](_0xc199('0x15'),auth[_0xc199('0x8')](),controller[_0xc199('0x16')]);router[_0xc199('0x17')](_0xc199('0x18'),auth['isAuthenticated'](),controller['update']);router[_0xc199('0x19')]('/:id',auth[_0xc199('0x8')](),controller[_0xc199('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index eac25a9..d095e63 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 _0xded6=['exports','STRING','sequelize'];(function(_0x29db8a,_0x27424f){var _0x27ae25=function(_0x568a46){while(--_0x568a46){_0x29db8a['push'](_0x29db8a['shift']());}};_0x27ae25(++_0x27424f);}(_0xded6,0x1bb));var _0x6ded=function(_0x5a750a,_0x30d794){_0x5a750a=_0x5a750a-0x0;var _0x21335d=_0xded6[_0x5a750a];return _0x21335d;};'use strict';var Sequelize=require(_0x6ded('0x0'));module[_0x6ded('0x1')]={'name':{'type':Sequelize[_0x6ded('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x54c9=['exports','STRING','sequelize'];(function(_0x36cbd7,_0x233bff){var _0x1562fd=function(_0x1a0335){while(--_0x1a0335){_0x36cbd7['push'](_0x36cbd7['shift']());}};_0x1562fd(++_0x233bff);}(_0x54c9,0x1a3));var _0x954c=function(_0x2cdc65,_0x1898ea){_0x2cdc65=_0x2cdc65-0x0;var _0x4f875b=_0x54c9[_0x2cdc65];return _0x4f875b;};'use strict';var Sequelize=require(_0x954c('0x0'));module[_0x954c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x954c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 9abc7ea..17b7322 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 _0x2fed=['VIRTUAL','merge','options','DeskConfiguration','includeAll','include','rows','catch','show','params','length','find','create','body','getFields','findOne','DeskField','order','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','status','count','offset','limit','set','json','apply','reject','save','update','destroy','end','sendStatus','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','sort','filters','pick','filter','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fed,0x7c));var _0xd2fe=function(_0x55357e,_0x10226d){_0x55357e=_0x55357e-0x0;var _0x232aae=_0x2fed[_0x55357e];return _0x232aae;};'use strict';var pdf=require(_0xd2fe('0x0'));var emlformat=require(_0xd2fe('0x1'));var rimraf=require(_0xd2fe('0x2'));var zipdir=require(_0xd2fe('0x3'));var jsonpatch=require(_0xd2fe('0x4'));var rp=require('request-promise');var moment=require(_0xd2fe('0x5'));var BPromise=require(_0xd2fe('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd2fe('0x7'));var sox=require(_0xd2fe('0x8'));var csv=require(_0xd2fe('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd2fe('0xa'));var squel=require(_0xd2fe('0xb'));var crypto=require(_0xd2fe('0xc'));var jsforce=require(_0xd2fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd2fe('0x9'));var querystring=require(_0xd2fe('0xe'));var Papa=require(_0xd2fe('0xf'));var Redis=require(_0xd2fe('0x10'));var authService=require(_0xd2fe('0x11'));var qs=require(_0xd2fe('0x12'));var as=require(_0xd2fe('0x13'));var hardwareService=require(_0xd2fe('0x14'));var logger=require(_0xd2fe('0x15'))(_0xd2fe('0x16'));var utils=require(_0xd2fe('0x17'));var config=require(_0xd2fe('0x18'));var db=require(_0xd2fe('0x19'))['db'];var jayson=require(_0xd2fe('0x1a'));var client=jayson[_0xd2fe('0x1b')][_0xd2fe('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x22e414,_0x1e2b2a,_0x5eb0cb){if(_0x5eb0cb){var _0x1c2401=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c2401[_0xd2fe('0x1d')](_0x1e2b2a)){return _0x22e414;}else{throw new db[(_0xd2fe('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x22e414;}}function respondWithRpcPromise(_0x4ab9d2,_0x203bea,_0x54f4cc,_0x458f87){return new BPromise(function(_0x3085b4,_0x3d9bf9){var _0x3ea4e1=_0x458f87||client;return _0x3ea4e1[_0xd2fe('0x1f')](_0x4ab9d2,_0x54f4cc)[_0xd2fe('0x20')](function(_0x588d03){logger['info'](_0xd2fe('0x21'),_0x203bea,_0xd2fe('0x22'));logger['debug'](_0xd2fe('0x23'),_0x203bea,_0xd2fe('0x22'),JSON[_0xd2fe('0x24')](_0x588d03));if(_0x588d03[_0xd2fe('0x25')]){if(_0x588d03[_0xd2fe('0x25')][_0xd2fe('0x26')]===0x1f4){logger[_0xd2fe('0x25')](_0xd2fe('0x21'),_0x203bea,_0x588d03[_0xd2fe('0x25')][_0xd2fe('0x27')]);return _0x3d9bf9(_0x588d03['error'][_0xd2fe('0x27')]);}logger['error'](_0xd2fe('0x21'),_0x203bea,_0x588d03[_0xd2fe('0x25')][_0xd2fe('0x27')]);return _0x3085b4(_0x588d03[_0xd2fe('0x25')]['message']);}else{logger[_0xd2fe('0x28')]('DeskConfiguration,\x20%s,\x20%s',_0x203bea,_0xd2fe('0x22'));_0x3085b4(_0x588d03[_0xd2fe('0x29')][_0xd2fe('0x27')]);}})['catch'](function(_0x5a5f1b){logger[_0xd2fe('0x25')](_0xd2fe('0x21'),_0x203bea,_0x5a5f1b);_0x3d9bf9(_0x5a5f1b);});});}function respondWithStatusCode(_0x236294,_0x28bef3){_0x28bef3=_0x28bef3||0xcc;return function(_0x202531){if(_0x202531){return _0x236294['sendStatus'](_0x28bef3);}return _0x236294['status'](_0x28bef3)['end']();};}function respondWithResult(_0x39e20a,_0x1ba638){_0x1ba638=_0x1ba638||0xc8;return function(_0x28580a){if(_0x28580a){return _0x39e20a[_0xd2fe('0x2a')](_0x1ba638)['json'](_0x28580a);}};}function respondWithFilteredResult(_0x23682c,_0x39c71c){return function(_0x293364){if(_0x293364){var _0x6bba0d=_0x293364[_0xd2fe('0x2b')],_0x49ab21=_0x39c71c['offset'],_0x391e93=_0x39c71c[_0xd2fe('0x2c')]+_0x39c71c[_0xd2fe('0x2d')],_0x327730;if(_0x391e93>=_0x6bba0d){_0x391e93=_0x6bba0d;_0x327730=0xc8;}else{_0x327730=0xce;}_0x23682c[_0xd2fe('0x2a')](_0x327730);return _0x23682c[_0xd2fe('0x2e')]('Content-Range',_0x49ab21+'-'+_0x391e93+'/'+_0x6bba0d)[_0xd2fe('0x2f')](_0x293364);}return null;};}function patchUpdates(_0x328089){return function(_0x11bea2){try{jsonpatch[_0xd2fe('0x30')](_0x11bea2,_0x328089,!![]);}catch(_0x4d2f8b){return BPromise[_0xd2fe('0x31')](_0x4d2f8b);}return _0x11bea2[_0xd2fe('0x32')]();};}function saveUpdates(_0x1b4812,_0x425d1f){return function(_0x42c7b2){if(_0x42c7b2){return _0x42c7b2[_0xd2fe('0x33')](_0x1b4812)['then'](function(_0x4436e7){return _0x4436e7;});}return null;};}function removeEntity(_0x355679,_0x56d8d7){return function(_0x448416){if(_0x448416){return _0x448416[_0xd2fe('0x34')]()[_0xd2fe('0x20')](function(){_0x355679['status'](0xcc)[_0xd2fe('0x35')]();});}};}function handleEntityNotFound(_0x13f01a,_0x53409a){return function(_0x1cb22a){if(!_0x1cb22a){_0x13f01a[_0xd2fe('0x36')](0x194);}return _0x1cb22a;};}function handleError(_0xca7bf9,_0x426bd6){_0x426bd6=_0x426bd6||0x1f4;return function(_0x351ab3){logger[_0xd2fe('0x25')](_0x351ab3['stack']);if(_0x351ab3['name']){delete _0x351ab3[_0xd2fe('0x37')];}_0xca7bf9['status'](_0x426bd6)['send'](_0x351ab3);};}exports[_0xd2fe('0x38')]=function(_0x6cc70e,_0xfaf600){var _0x101ba2={},_0x32278d={},_0x4e0b4d={'count':0x0,'rows':[]};var _0x3daff0=_['map'](db['DeskConfiguration'][_0xd2fe('0x39')],function(_0x325ef7){return{'name':_0x325ef7[_0xd2fe('0x3a')],'type':_0x325ef7[_0xd2fe('0x3b')][_0xd2fe('0x3c')]};});_0x32278d[_0xd2fe('0x3d')]=_[_0xd2fe('0x3e')](_0x3daff0,'name');_0x32278d[_0xd2fe('0x3f')]=_[_0xd2fe('0x40')](_0x6cc70e[_0xd2fe('0x3f')]);_0x32278d['filters']=_['intersection'](_0x32278d[_0xd2fe('0x3d')],_0x32278d[_0xd2fe('0x3f')]);_0x101ba2[_0xd2fe('0x41')]=_[_0xd2fe('0x42')](_0x32278d[_0xd2fe('0x3d')],qs[_0xd2fe('0x43')](_0x6cc70e[_0xd2fe('0x3f')]['fields']));_0x101ba2[_0xd2fe('0x41')]=_0x101ba2[_0xd2fe('0x41')]['length']?_0x101ba2[_0xd2fe('0x41')]:_0x32278d[_0xd2fe('0x3d')];if(!_0x6cc70e[_0xd2fe('0x3f')][_0xd2fe('0x44')]('nolimit')){_0x101ba2[_0xd2fe('0x2d')]=qs[_0xd2fe('0x2d')](_0x6cc70e[_0xd2fe('0x3f')][_0xd2fe('0x2d')]);_0x101ba2['offset']=qs[_0xd2fe('0x2c')](_0x6cc70e[_0xd2fe('0x3f')][_0xd2fe('0x2c')]);}_0x101ba2['order']=qs[_0xd2fe('0x45')](_0x6cc70e[_0xd2fe('0x3f')][_0xd2fe('0x45')]);_0x101ba2['where']=qs[_0xd2fe('0x46')](_[_0xd2fe('0x47')](_0x6cc70e['query'],_0x32278d['filters']),_0x3daff0);if(_0x6cc70e['query'][_0xd2fe('0x48')]){_0x101ba2[_0xd2fe('0x49')]=_['merge'](_0x101ba2[_0xd2fe('0x49')],{'$or':_[_0xd2fe('0x3e')](_0x3daff0,function(_0x17589d){if(_0x17589d['type']!==_0xd2fe('0x4a')){var _0x3b0f93={};_0x3b0f93[_0x17589d[_0xd2fe('0x37')]]={'$like':'%'+_0x6cc70e[_0xd2fe('0x3f')][_0xd2fe('0x48')]+'%'};return _0x3b0f93;}})});}_0x101ba2=_[_0xd2fe('0x4b')]({},_0x101ba2,_0x6cc70e[_0xd2fe('0x4c')]);var _0x4fe5cb={'where':_0x101ba2[_0xd2fe('0x49')]};return db[_0xd2fe('0x4d')][_0xd2fe('0x2b')](_0x4fe5cb)[_0xd2fe('0x20')](function(_0x15e1fb){_0x4e0b4d['count']=_0x15e1fb;if(_0x6cc70e['query'][_0xd2fe('0x4e')]){_0x101ba2[_0xd2fe('0x4f')]=[{'all':!![]}];}return db[_0xd2fe('0x4d')]['findAll'](_0x101ba2);})['then'](function(_0xc09227){_0x4e0b4d[_0xd2fe('0x50')]=_0xc09227;return _0x4e0b4d;})[_0xd2fe('0x20')](respondWithFilteredResult(_0xfaf600,_0x101ba2))[_0xd2fe('0x51')](handleError(_0xfaf600,null));};exports[_0xd2fe('0x52')]=function(_0x44e45d,_0x377e88){var _0x13ec7d={'raw':![],'where':{'id':_0x44e45d[_0xd2fe('0x53')]['id']}},_0x465490={};_0x465490[_0xd2fe('0x3d')]=_['keys'](db[_0xd2fe('0x4d')][_0xd2fe('0x39')]);_0x465490[_0xd2fe('0x3f')]=_['keys'](_0x44e45d[_0xd2fe('0x3f')]);_0x465490['filters']=_['intersection'](_0x465490[_0xd2fe('0x3d')],_0x465490['query']);_0x13ec7d[_0xd2fe('0x41')]=_['intersection'](_0x465490[_0xd2fe('0x3d')],qs['fields'](_0x44e45d[_0xd2fe('0x3f')][_0xd2fe('0x43')]));_0x13ec7d['attributes']=_0x13ec7d['attributes'][_0xd2fe('0x54')]?_0x13ec7d[_0xd2fe('0x41')]:_0x465490['model'];if(_0x44e45d[_0xd2fe('0x3f')][_0xd2fe('0x4e')]){_0x13ec7d[_0xd2fe('0x4f')]=[{'all':!![]}];}_0x13ec7d=_['merge']({},_0x13ec7d,_0x44e45d['options']);return db['DeskConfiguration'][_0xd2fe('0x55')](_0x13ec7d)['then'](handleEntityNotFound(_0x377e88,null))[_0xd2fe('0x20')](respondWithResult(_0x377e88,null))[_0xd2fe('0x51')](handleError(_0x377e88,null));};exports[_0xd2fe('0x56')]=function(_0x1ffd92,_0xbb8303){return db['DeskConfiguration'][_0xd2fe('0x56')](_0x1ffd92[_0xd2fe('0x57')],{})['then'](respondWithResult(_0xbb8303,0xc9))[_0xd2fe('0x51')](handleError(_0xbb8303,null));};exports[_0xd2fe('0x33')]=function(_0x588dac,_0x2e108c){if(_0x588dac[_0xd2fe('0x57')]['id']){delete _0x588dac[_0xd2fe('0x57')]['id'];}return db[_0xd2fe('0x4d')]['find']({'where':{'id':_0x588dac['params']['id']}})[_0xd2fe('0x20')](handleEntityNotFound(_0x2e108c,null))[_0xd2fe('0x20')](saveUpdates(_0x588dac[_0xd2fe('0x57')],null))['then'](respondWithResult(_0x2e108c,null))[_0xd2fe('0x51')](handleError(_0x2e108c,null));};exports['destroy']=function(_0x3a3566,_0x4fae03){return db[_0xd2fe('0x4d')]['find']({'where':{'id':_0x3a3566[_0xd2fe('0x53')]['id']}})[_0xd2fe('0x20')](handleEntityNotFound(_0x4fae03,null))[_0xd2fe('0x20')](removeEntity(_0x4fae03,null))['catch'](handleError(_0x4fae03,null));};exports[_0xd2fe('0x58')]=function(_0x4c48b5,_0x2a8d97,_0x28737c){var _0x3089ca={};var _0x24eb5a={};var _0x58a8bf;var _0x217192;return db['DeskConfiguration'][_0xd2fe('0x59')]({'where':{'id':_0x4c48b5[_0xd2fe('0x53')]['id']}})[_0xd2fe('0x20')](handleEntityNotFound(_0x2a8d97,null))[_0xd2fe('0x20')](function(_0x2574bc){if(_0x2574bc){_0x58a8bf=_0x2574bc;_0x24eb5a[_0xd2fe('0x3d')]=_['keys'](db[_0xd2fe('0x5a')][_0xd2fe('0x39')]);_0x24eb5a['query']=_['keys'](_0x4c48b5[_0xd2fe('0x3f')]);_0x24eb5a['filters']=_[_0xd2fe('0x42')](_0x24eb5a[_0xd2fe('0x3d')],_0x24eb5a[_0xd2fe('0x3f')]);_0x3089ca[_0xd2fe('0x41')]=_[_0xd2fe('0x42')](_0x24eb5a['model'],qs[_0xd2fe('0x43')](_0x4c48b5['query']['fields']));_0x3089ca[_0xd2fe('0x41')]=_0x3089ca[_0xd2fe('0x41')]['length']?_0x3089ca['attributes']:_0x24eb5a[_0xd2fe('0x3d')];_0x3089ca[_0xd2fe('0x5b')]=qs[_0xd2fe('0x45')](_0x4c48b5[_0xd2fe('0x3f')][_0xd2fe('0x45')]);_0x3089ca[_0xd2fe('0x49')]=qs['filters'](_[_0xd2fe('0x47')](_0x4c48b5[_0xd2fe('0x3f')],_0x24eb5a[_0xd2fe('0x46')]));if(_0x4c48b5[_0xd2fe('0x3f')][_0xd2fe('0x48')]){_0x3089ca[_0xd2fe('0x49')]=_[_0xd2fe('0x4b')](_0x3089ca[_0xd2fe('0x49')],{'$or':_['map'](_0x3089ca['attributes'],function(_0x187951){var _0x3b0667={};_0x3b0667[_0x187951]={'$like':'%'+_0x4c48b5[_0xd2fe('0x3f')][_0xd2fe('0x48')]+'%'};return _0x3b0667;})});}_0x3089ca=_[_0xd2fe('0x4b')]({},_0x3089ca,_0x4c48b5['options']);return _0x58a8bf[_0xd2fe('0x58')](_0x3089ca);}})[_0xd2fe('0x20')](function(_0xa13fe){if(_0xa13fe){_0x217192=_0xa13fe['length'];if(!_0x4c48b5[_0xd2fe('0x3f')]['hasOwnProperty'](_0xd2fe('0x5c'))){_0x3089ca['limit']=qs[_0xd2fe('0x2d')](_0x4c48b5[_0xd2fe('0x3f')][_0xd2fe('0x2d')]);_0x3089ca[_0xd2fe('0x2c')]=qs[_0xd2fe('0x2c')](_0x4c48b5[_0xd2fe('0x3f')]['offset']);}return _0x58a8bf[_0xd2fe('0x58')](_0x3089ca);}})[_0xd2fe('0x20')](function(_0x33a71b){if(_0x33a71b){return _0x33a71b?{'count':_0x217192,'rows':_0x33a71b}:null;}})['then'](respondWithResult(_0x2a8d97,null))[_0xd2fe('0x51')](handleError(_0x2a8d97,null));};exports['getSubjects']=function(_0x43c3d6,_0x5eb1f5,_0x48a568){var _0x28fa56={};var _0x2de25f={};var _0x301f03;var _0x5d7ae1;return db[_0xd2fe('0x4d')][_0xd2fe('0x59')]({'where':{'id':_0x43c3d6['params']['id']}})[_0xd2fe('0x20')](handleEntityNotFound(_0x5eb1f5,null))[_0xd2fe('0x20')](function(_0x1b00da){if(_0x1b00da){_0x301f03=_0x1b00da;_0x2de25f[_0xd2fe('0x3d')]=_[_0xd2fe('0x40')](db[_0xd2fe('0x5a')][_0xd2fe('0x39')]);_0x2de25f[_0xd2fe('0x3f')]=_['keys'](_0x43c3d6[_0xd2fe('0x3f')]);_0x2de25f[_0xd2fe('0x46')]=_['intersection'](_0x2de25f['model'],_0x2de25f['query']);_0x28fa56[_0xd2fe('0x41')]=_[_0xd2fe('0x42')](_0x2de25f[_0xd2fe('0x3d')],qs[_0xd2fe('0x43')](_0x43c3d6['query'][_0xd2fe('0x43')]));_0x28fa56['attributes']=_0x28fa56['attributes'][_0xd2fe('0x54')]?_0x28fa56['attributes']:_0x2de25f[_0xd2fe('0x3d')];_0x28fa56[_0xd2fe('0x5b')]=qs[_0xd2fe('0x45')](_0x43c3d6[_0xd2fe('0x3f')]['sort']);_0x28fa56[_0xd2fe('0x49')]=qs[_0xd2fe('0x46')](_[_0xd2fe('0x47')](_0x43c3d6[_0xd2fe('0x3f')],_0x2de25f[_0xd2fe('0x46')]));if(_0x43c3d6[_0xd2fe('0x3f')]['filter']){_0x28fa56['where']=_[_0xd2fe('0x4b')](_0x28fa56[_0xd2fe('0x49')],{'$or':_[_0xd2fe('0x3e')](_0x28fa56[_0xd2fe('0x41')],function(_0x5b0472){var _0x3081ab={};_0x3081ab[_0x5b0472]={'$like':'%'+_0x43c3d6[_0xd2fe('0x3f')]['filter']+'%'};return _0x3081ab;})});}_0x28fa56=_['merge']({},_0x28fa56,_0x43c3d6[_0xd2fe('0x4c')]);return _0x301f03[_0xd2fe('0x5d')](_0x28fa56);}})[_0xd2fe('0x20')](function(_0xb4fc16){if(_0xb4fc16){_0x5d7ae1=_0xb4fc16[_0xd2fe('0x54')];if(!_0x43c3d6[_0xd2fe('0x3f')][_0xd2fe('0x44')](_0xd2fe('0x5c'))){_0x28fa56['limit']=qs[_0xd2fe('0x2d')](_0x43c3d6[_0xd2fe('0x3f')]['limit']);_0x28fa56[_0xd2fe('0x2c')]=qs['offset'](_0x43c3d6['query']['offset']);}return _0x301f03[_0xd2fe('0x5d')](_0x28fa56);}})['then'](function(_0x655d1){if(_0x655d1){return _0x655d1?{'count':_0x5d7ae1,'rows':_0x655d1}:null;}})[_0xd2fe('0x20')](respondWithResult(_0x5eb1f5,null))[_0xd2fe('0x51')](handleError(_0x5eb1f5,null));};exports[_0xd2fe('0x5e')]=function(_0x1d3914,_0x4c32f7,_0x3e2088){var _0x34549e={};var _0x41c0c3={};var _0x24ca22;var _0x351e99;return db[_0xd2fe('0x4d')][_0xd2fe('0x59')]({'where':{'id':_0x1d3914['params']['id']}})[_0xd2fe('0x20')](handleEntityNotFound(_0x4c32f7,null))['then'](function(_0x3a2d22){if(_0x3a2d22){_0x24ca22=_0x3a2d22;_0x41c0c3[_0xd2fe('0x3d')]=_[_0xd2fe('0x40')](db[_0xd2fe('0x5a')]['rawAttributes']);_0x41c0c3[_0xd2fe('0x3f')]=_[_0xd2fe('0x40')](_0x1d3914[_0xd2fe('0x3f')]);_0x41c0c3[_0xd2fe('0x46')]=_['intersection'](_0x41c0c3[_0xd2fe('0x3d')],_0x41c0c3[_0xd2fe('0x3f')]);_0x34549e[_0xd2fe('0x41')]=_[_0xd2fe('0x42')](_0x41c0c3[_0xd2fe('0x3d')],qs[_0xd2fe('0x43')](_0x1d3914[_0xd2fe('0x3f')]['fields']));_0x34549e['attributes']=_0x34549e[_0xd2fe('0x41')][_0xd2fe('0x54')]?_0x34549e[_0xd2fe('0x41')]:_0x41c0c3[_0xd2fe('0x3d')];_0x34549e[_0xd2fe('0x5b')]=qs[_0xd2fe('0x45')](_0x1d3914[_0xd2fe('0x3f')][_0xd2fe('0x45')]);_0x34549e[_0xd2fe('0x49')]=qs[_0xd2fe('0x46')](_[_0xd2fe('0x47')](_0x1d3914[_0xd2fe('0x3f')],_0x41c0c3[_0xd2fe('0x46')]));if(_0x1d3914[_0xd2fe('0x3f')][_0xd2fe('0x48')]){_0x34549e[_0xd2fe('0x49')]=_['merge'](_0x34549e[_0xd2fe('0x49')],{'$or':_[_0xd2fe('0x3e')](_0x34549e[_0xd2fe('0x41')],function(_0x48f49a){var _0x2a7eaf={};_0x2a7eaf[_0x48f49a]={'$like':'%'+_0x1d3914[_0xd2fe('0x3f')][_0xd2fe('0x48')]+'%'};return _0x2a7eaf;})});}_0x34549e=_['merge']({},_0x34549e,_0x1d3914[_0xd2fe('0x4c')]);return _0x24ca22[_0xd2fe('0x5e')](_0x34549e);}})[_0xd2fe('0x20')](function(_0x5d5a5a){if(_0x5d5a5a){_0x351e99=_0x5d5a5a[_0xd2fe('0x54')];if(!_0x1d3914[_0xd2fe('0x3f')][_0xd2fe('0x44')](_0xd2fe('0x5c'))){_0x34549e['limit']=qs[_0xd2fe('0x2d')](_0x1d3914[_0xd2fe('0x3f')][_0xd2fe('0x2d')]);_0x34549e[_0xd2fe('0x2c')]=qs['offset'](_0x1d3914[_0xd2fe('0x3f')][_0xd2fe('0x2c')]);}return _0x24ca22[_0xd2fe('0x5e')](_0x34549e);}})[_0xd2fe('0x20')](function(_0x4fdf73){if(_0x4fdf73){return _0x4fdf73?{'count':_0x351e99,'rows':_0x4fdf73}:null;}})['then'](respondWithResult(_0x4c32f7,null))[_0xd2fe('0x51')](handleError(_0x4c32f7,null));};exports[_0xd2fe('0x5f')]=function(_0x38c505,_0x5e6922,_0xb1b595){var _0x467f2a={};var _0x39a53d={};var _0x23cc4c;var _0x25d3aa;return db[_0xd2fe('0x4d')]['findOne']({'where':{'id':_0x38c505[_0xd2fe('0x53')]['id']}})['then'](handleEntityNotFound(_0x5e6922,null))[_0xd2fe('0x20')](function(_0x259a48){if(_0x259a48){_0x23cc4c=_0x259a48;_0x39a53d[_0xd2fe('0x3d')]=_[_0xd2fe('0x40')](db[_0xd2fe('0x60')][_0xd2fe('0x39')]);_0x39a53d['query']=_['keys'](_0x38c505['query']);_0x39a53d['filters']=_[_0xd2fe('0x42')](_0x39a53d[_0xd2fe('0x3d')],_0x39a53d[_0xd2fe('0x3f')]);_0x467f2a[_0xd2fe('0x41')]=_['intersection'](_0x39a53d[_0xd2fe('0x3d')],qs[_0xd2fe('0x43')](_0x38c505['query'][_0xd2fe('0x43')]));_0x467f2a['attributes']=_0x467f2a[_0xd2fe('0x41')][_0xd2fe('0x54')]?_0x467f2a[_0xd2fe('0x41')]:_0x39a53d[_0xd2fe('0x3d')];_0x467f2a['order']=qs[_0xd2fe('0x45')](_0x38c505[_0xd2fe('0x3f')][_0xd2fe('0x45')]);_0x467f2a[_0xd2fe('0x49')]=qs['filters'](_[_0xd2fe('0x47')](_0x38c505[_0xd2fe('0x3f')],_0x39a53d['filters']));if(_0x38c505[_0xd2fe('0x3f')][_0xd2fe('0x48')]){_0x467f2a[_0xd2fe('0x49')]=_[_0xd2fe('0x4b')](_0x467f2a[_0xd2fe('0x49')],{'$or':_[_0xd2fe('0x3e')](_0x467f2a[_0xd2fe('0x41')],function(_0x33dfc5){var _0x5dab41={};_0x5dab41[_0x33dfc5]={'$like':'%'+_0x38c505[_0xd2fe('0x3f')][_0xd2fe('0x48')]+'%'};return _0x5dab41;})});}_0x467f2a=_[_0xd2fe('0x4b')]({},_0x467f2a,_0x38c505[_0xd2fe('0x4c')]);return _0x23cc4c['getTags'](_0x467f2a);}})['then'](function(_0x4083de){if(_0x4083de){_0x25d3aa=_0x4083de[_0xd2fe('0x54')];if(!_0x38c505['query'][_0xd2fe('0x44')]('nolimit')){_0x467f2a[_0xd2fe('0x2d')]=qs['limit'](_0x38c505[_0xd2fe('0x3f')][_0xd2fe('0x2d')]);_0x467f2a[_0xd2fe('0x2c')]=qs[_0xd2fe('0x2c')](_0x38c505['query'][_0xd2fe('0x2c')]);}return _0x23cc4c[_0xd2fe('0x5f')](_0x467f2a);}})['then'](function(_0x5d00ae){if(_0x5d00ae){return _0x5d00ae?{'count':_0x25d3aa,'rows':_0x5d00ae}:null;}})[_0xd2fe('0x20')](respondWithResult(_0x5e6922,null))['catch'](handleError(_0x5e6922,null));};exports[_0xd2fe('0x61')]=function(_0xbb3ff9,_0x3ab333,_0x4c42f4){if(_0xbb3ff9[_0xd2fe('0x57')]['id']){delete _0xbb3ff9[_0xd2fe('0x57')]['id'];}return db[_0xd2fe('0x4d')]['findOne']({'where':{'id':_0xbb3ff9[_0xd2fe('0x53')]['id']}})[_0xd2fe('0x20')](handleEntityNotFound(_0x3ab333,null))['then'](function(_0x135641){if(_0x135641){return _0x135641[_0xd2fe('0x61')](_0xbb3ff9[_0xd2fe('0x57')][_0xd2fe('0x62')]||[]);}return null;})[_0xd2fe('0x20')](respondWithResult(_0x3ab333,null))[_0xd2fe('0x51')](handleError(_0x3ab333,null));}; \ No newline at end of file +var _0xd0b5=['request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','destroy','stack','DeskConfiguration','rawAttributes','fieldName','key','model','map','name','query','keys','filters','fields','attributes','length','order','sort','pick','filter','type','VIRTUAL','options','where','count','includeAll','include','rows','catch','show','params','intersection','merge','find','create','body','update','getFields','findOne','hasOwnProperty','getSubjects','DeskField','getDescriptions','getTags','nolimit','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','then','info','DeskConfiguration,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0x1c17ed,_0x3f9764){_0x1c17ed=_0x1c17ed-0x0;var _0xc3e653=_0xd0b5[_0x1c17ed];return _0xc3e653;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5d0b('0x0'));var zipdir=require(_0x5d0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d0b('0x2'));var moment=require(_0x5d0b('0x3'));var BPromise=require(_0x5d0b('0x4'));var Mustache=require(_0x5d0b('0x5'));var util=require(_0x5d0b('0x6'));var path=require(_0x5d0b('0x7'));var sox=require(_0x5d0b('0x8'));var csv=require(_0x5d0b('0x9'));var ejs=require(_0x5d0b('0xa'));var fs=require('fs');var _=require(_0x5d0b('0xb'));var squel=require(_0x5d0b('0xc'));var crypto=require(_0x5d0b('0xd'));var jsforce=require(_0x5d0b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5d0b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5d0b('0xf'));var authService=require(_0x5d0b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5d0b('0x11'));var hardwareService=require(_0x5d0b('0x12'));var logger=require('../../config/logger')(_0x5d0b('0x13'));var utils=require(_0x5d0b('0x14'));var config=require(_0x5d0b('0x15'));var db=require(_0x5d0b('0x16'))['db'];var jayson=require(_0x5d0b('0x17'));var client=jayson[_0x5d0b('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x1894d4,_0x10da29,_0x10d9aa){if(_0x10d9aa){var _0x263300=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x263300['test'](_0x10da29)){return _0x1894d4;}else{throw new db[(_0x5d0b('0x19'))][(_0x5d0b('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 _0x1894d4;}}function respondWithRpcPromise(_0x1274e2,_0x4d5256,_0x4ef01f,_0x2956ef){return new BPromise(function(_0x411ed2,_0x3bd719){var _0x2937db=_0x2956ef||client;return _0x2937db['request'](_0x1274e2,_0x4ef01f)[_0x5d0b('0x1b')](function(_0x4732d8){logger[_0x5d0b('0x1c')](_0x5d0b('0x1d'),_0x4d5256,_0x5d0b('0x1e'));logger[_0x5d0b('0x1f')](_0x5d0b('0x20'),_0x4d5256,_0x5d0b('0x1e'),JSON[_0x5d0b('0x21')](_0x4732d8));if(_0x4732d8[_0x5d0b('0x22')]){if(_0x4732d8[_0x5d0b('0x22')][_0x5d0b('0x23')]===0x1f4){logger[_0x5d0b('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x4d5256,_0x4732d8['error'][_0x5d0b('0x24')]);return _0x3bd719(_0x4732d8[_0x5d0b('0x22')][_0x5d0b('0x24')]);}logger[_0x5d0b('0x22')](_0x5d0b('0x1d'),_0x4d5256,_0x4732d8['error'][_0x5d0b('0x24')]);return _0x411ed2(_0x4732d8[_0x5d0b('0x22')]['message']);}else{logger[_0x5d0b('0x1c')](_0x5d0b('0x1d'),_0x4d5256,_0x5d0b('0x1e'));_0x411ed2(_0x4732d8[_0x5d0b('0x25')][_0x5d0b('0x24')]);}})['catch'](function(_0x2c0928){logger[_0x5d0b('0x22')](_0x5d0b('0x1d'),_0x4d5256,_0x2c0928);_0x3bd719(_0x2c0928);});});}function respondWithStatusCode(_0x2bdf03,_0x2d9d8b){_0x2d9d8b=_0x2d9d8b||0xcc;return function(_0x45c97f){if(_0x45c97f){return _0x2bdf03[_0x5d0b('0x26')](_0x2d9d8b);}return _0x2bdf03['status'](_0x2d9d8b)[_0x5d0b('0x27')]();};}function respondWithResult(_0x5b2adc,_0x4f0196){_0x4f0196=_0x4f0196||0xc8;return function(_0x40c6e2){if(_0x40c6e2){return _0x5b2adc[_0x5d0b('0x28')](_0x4f0196)[_0x5d0b('0x29')](_0x40c6e2);}};}function respondWithFilteredResult(_0x53b080,_0x33e3e1){return function(_0x29d194){if(_0x29d194){var _0x4bfcc2=_0x29d194['count'],_0x20e28b=_0x33e3e1[_0x5d0b('0x2a')],_0x15e418=_0x33e3e1[_0x5d0b('0x2a')]+_0x33e3e1[_0x5d0b('0x2b')],_0x2504b8;if(_0x15e418>=_0x4bfcc2){_0x15e418=_0x4bfcc2;_0x2504b8=0xc8;}else{_0x2504b8=0xce;}_0x53b080[_0x5d0b('0x28')](_0x2504b8);return _0x53b080[_0x5d0b('0x2c')](_0x5d0b('0x2d'),_0x20e28b+'-'+_0x15e418+'/'+_0x4bfcc2)['json'](_0x29d194);}return null;};}function patchUpdates(_0x1fcdaf){return function(_0x42ef84){try{jsonpatch['apply'](_0x42ef84,_0x1fcdaf,!![]);}catch(_0x11a58e){return BPromise[_0x5d0b('0x2e')](_0x11a58e);}return _0x42ef84[_0x5d0b('0x2f')]();};}function saveUpdates(_0x30adb0,_0x1a51fb){return function(_0x2f325f){if(_0x2f325f){return _0x2f325f['update'](_0x30adb0)[_0x5d0b('0x1b')](function(_0x13372b){return _0x13372b;});}return null;};}function removeEntity(_0x3e5d8f,_0x4e7048){return function(_0x561a6c){if(_0x561a6c){return _0x561a6c[_0x5d0b('0x30')]()[_0x5d0b('0x1b')](function(){_0x3e5d8f['status'](0xcc)[_0x5d0b('0x27')]();});}};}function handleEntityNotFound(_0xbdd1ee,_0x3b5f75){return function(_0x437de8){if(!_0x437de8){_0xbdd1ee[_0x5d0b('0x26')](0x194);}return _0x437de8;};}function handleError(_0x2dd746,_0x43ebc8){_0x43ebc8=_0x43ebc8||0x1f4;return function(_0xe4267a){logger['error'](_0xe4267a[_0x5d0b('0x31')]);if(_0xe4267a['name']){delete _0xe4267a['name'];}_0x2dd746['status'](_0x43ebc8)['send'](_0xe4267a);};}exports['index']=function(_0x14f3b2,_0x26e3cd){var _0x48432e={},_0x1b5a09={},_0x3ea09a={'count':0x0,'rows':[]};var _0x9265c7=_['map'](db[_0x5d0b('0x32')][_0x5d0b('0x33')],function(_0x2c3a48){return{'name':_0x2c3a48[_0x5d0b('0x34')],'type':_0x2c3a48['type'][_0x5d0b('0x35')]};});_0x1b5a09[_0x5d0b('0x36')]=_[_0x5d0b('0x37')](_0x9265c7,_0x5d0b('0x38'));_0x1b5a09[_0x5d0b('0x39')]=_[_0x5d0b('0x3a')](_0x14f3b2['query']);_0x1b5a09[_0x5d0b('0x3b')]=_['intersection'](_0x1b5a09['model'],_0x1b5a09[_0x5d0b('0x39')]);_0x48432e['attributes']=_['intersection'](_0x1b5a09['model'],qs[_0x5d0b('0x3c')](_0x14f3b2['query']['fields']));_0x48432e['attributes']=_0x48432e[_0x5d0b('0x3d')][_0x5d0b('0x3e')]?_0x48432e[_0x5d0b('0x3d')]:_0x1b5a09[_0x5d0b('0x36')];if(!_0x14f3b2[_0x5d0b('0x39')]['hasOwnProperty']('nolimit')){_0x48432e[_0x5d0b('0x2b')]=qs[_0x5d0b('0x2b')](_0x14f3b2[_0x5d0b('0x39')][_0x5d0b('0x2b')]);_0x48432e[_0x5d0b('0x2a')]=qs['offset'](_0x14f3b2[_0x5d0b('0x39')]['offset']);}_0x48432e[_0x5d0b('0x3f')]=qs[_0x5d0b('0x40')](_0x14f3b2['query'][_0x5d0b('0x40')]);_0x48432e['where']=qs['filters'](_[_0x5d0b('0x41')](_0x14f3b2['query'],_0x1b5a09[_0x5d0b('0x3b')]),_0x9265c7);if(_0x14f3b2['query'][_0x5d0b('0x42')]){_0x48432e['where']=_['merge'](_0x48432e['where'],{'$or':_['map'](_0x9265c7,function(_0x44bd03){if(_0x44bd03[_0x5d0b('0x43')]!==_0x5d0b('0x44')){var _0x204938={};_0x204938[_0x44bd03[_0x5d0b('0x38')]]={'$like':'%'+_0x14f3b2[_0x5d0b('0x39')][_0x5d0b('0x42')]+'%'};return _0x204938;}})});}_0x48432e=_['merge']({},_0x48432e,_0x14f3b2[_0x5d0b('0x45')]);var _0x55a11d={'where':_0x48432e[_0x5d0b('0x46')]};return db[_0x5d0b('0x32')]['count'](_0x55a11d)['then'](function(_0x47dac6){_0x3ea09a[_0x5d0b('0x47')]=_0x47dac6;if(_0x14f3b2[_0x5d0b('0x39')][_0x5d0b('0x48')]){_0x48432e[_0x5d0b('0x49')]=[{'all':!![]}];}return db[_0x5d0b('0x32')]['findAll'](_0x48432e);})[_0x5d0b('0x1b')](function(_0x212366){_0x3ea09a[_0x5d0b('0x4a')]=_0x212366;return _0x3ea09a;})[_0x5d0b('0x1b')](respondWithFilteredResult(_0x26e3cd,_0x48432e))[_0x5d0b('0x4b')](handleError(_0x26e3cd,null));};exports[_0x5d0b('0x4c')]=function(_0x429709,_0x3e62cd){var _0x1f107e={'raw':![],'where':{'id':_0x429709[_0x5d0b('0x4d')]['id']}},_0x250abf={};_0x250abf[_0x5d0b('0x36')]=_['keys'](db[_0x5d0b('0x32')][_0x5d0b('0x33')]);_0x250abf['query']=_[_0x5d0b('0x3a')](_0x429709['query']);_0x250abf[_0x5d0b('0x3b')]=_['intersection'](_0x250abf['model'],_0x250abf[_0x5d0b('0x39')]);_0x1f107e[_0x5d0b('0x3d')]=_[_0x5d0b('0x4e')](_0x250abf['model'],qs['fields'](_0x429709[_0x5d0b('0x39')][_0x5d0b('0x3c')]));_0x1f107e['attributes']=_0x1f107e[_0x5d0b('0x3d')][_0x5d0b('0x3e')]?_0x1f107e[_0x5d0b('0x3d')]:_0x250abf[_0x5d0b('0x36')];if(_0x429709[_0x5d0b('0x39')][_0x5d0b('0x48')]){_0x1f107e[_0x5d0b('0x49')]=[{'all':!![]}];}_0x1f107e=_[_0x5d0b('0x4f')]({},_0x1f107e,_0x429709[_0x5d0b('0x45')]);return db[_0x5d0b('0x32')][_0x5d0b('0x50')](_0x1f107e)[_0x5d0b('0x1b')](handleEntityNotFound(_0x3e62cd,null))['then'](respondWithResult(_0x3e62cd,null))[_0x5d0b('0x4b')](handleError(_0x3e62cd,null));};exports[_0x5d0b('0x51')]=function(_0x41a6fd,_0x332f61){return db[_0x5d0b('0x32')][_0x5d0b('0x51')](_0x41a6fd[_0x5d0b('0x52')],{})[_0x5d0b('0x1b')](respondWithResult(_0x332f61,0xc9))[_0x5d0b('0x4b')](handleError(_0x332f61,null));};exports[_0x5d0b('0x53')]=function(_0x24bdd0,_0x58f54f){if(_0x24bdd0[_0x5d0b('0x52')]['id']){delete _0x24bdd0[_0x5d0b('0x52')]['id'];}return db[_0x5d0b('0x32')][_0x5d0b('0x50')]({'where':{'id':_0x24bdd0[_0x5d0b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x58f54f,null))[_0x5d0b('0x1b')](saveUpdates(_0x24bdd0[_0x5d0b('0x52')],null))[_0x5d0b('0x1b')](respondWithResult(_0x58f54f,null))[_0x5d0b('0x4b')](handleError(_0x58f54f,null));};exports[_0x5d0b('0x30')]=function(_0x290dbd,_0x549ad1){return db[_0x5d0b('0x32')][_0x5d0b('0x50')]({'where':{'id':_0x290dbd['params']['id']}})[_0x5d0b('0x1b')](handleEntityNotFound(_0x549ad1,null))[_0x5d0b('0x1b')](removeEntity(_0x549ad1,null))[_0x5d0b('0x4b')](handleError(_0x549ad1,null));};exports[_0x5d0b('0x54')]=function(_0xfda652,_0xd8a0b9,_0x3a043e){var _0x248165={};var _0x4647b4={};var _0xfdc093;var _0x5d1364;return db['DeskConfiguration'][_0x5d0b('0x55')]({'where':{'id':_0xfda652[_0x5d0b('0x4d')]['id']}})[_0x5d0b('0x1b')](handleEntityNotFound(_0xd8a0b9,null))[_0x5d0b('0x1b')](function(_0x1ab7dc){if(_0x1ab7dc){_0xfdc093=_0x1ab7dc;_0x4647b4[_0x5d0b('0x36')]=_['keys'](db['DeskField'][_0x5d0b('0x33')]);_0x4647b4[_0x5d0b('0x39')]=_[_0x5d0b('0x3a')](_0xfda652['query']);_0x4647b4[_0x5d0b('0x3b')]=_[_0x5d0b('0x4e')](_0x4647b4[_0x5d0b('0x36')],_0x4647b4[_0x5d0b('0x39')]);_0x248165[_0x5d0b('0x3d')]=_[_0x5d0b('0x4e')](_0x4647b4['model'],qs[_0x5d0b('0x3c')](_0xfda652[_0x5d0b('0x39')][_0x5d0b('0x3c')]));_0x248165[_0x5d0b('0x3d')]=_0x248165[_0x5d0b('0x3d')][_0x5d0b('0x3e')]?_0x248165[_0x5d0b('0x3d')]:_0x4647b4[_0x5d0b('0x36')];_0x248165[_0x5d0b('0x3f')]=qs[_0x5d0b('0x40')](_0xfda652[_0x5d0b('0x39')]['sort']);_0x248165[_0x5d0b('0x46')]=qs[_0x5d0b('0x3b')](_[_0x5d0b('0x41')](_0xfda652[_0x5d0b('0x39')],_0x4647b4[_0x5d0b('0x3b')]));if(_0xfda652[_0x5d0b('0x39')]['filter']){_0x248165['where']=_[_0x5d0b('0x4f')](_0x248165[_0x5d0b('0x46')],{'$or':_[_0x5d0b('0x37')](_0x248165[_0x5d0b('0x3d')],function(_0x424cfa){var _0x42837a={};_0x42837a[_0x424cfa]={'$like':'%'+_0xfda652['query'][_0x5d0b('0x42')]+'%'};return _0x42837a;})});}_0x248165=_[_0x5d0b('0x4f')]({},_0x248165,_0xfda652['options']);return _0xfdc093[_0x5d0b('0x54')](_0x248165);}})[_0x5d0b('0x1b')](function(_0x48d53e){if(_0x48d53e){_0x5d1364=_0x48d53e['length'];if(!_0xfda652[_0x5d0b('0x39')][_0x5d0b('0x56')]('nolimit')){_0x248165[_0x5d0b('0x2b')]=qs['limit'](_0xfda652[_0x5d0b('0x39')][_0x5d0b('0x2b')]);_0x248165[_0x5d0b('0x2a')]=qs[_0x5d0b('0x2a')](_0xfda652['query'][_0x5d0b('0x2a')]);}return _0xfdc093[_0x5d0b('0x54')](_0x248165);}})[_0x5d0b('0x1b')](function(_0x3f465d){if(_0x3f465d){return _0x3f465d?{'count':_0x5d1364,'rows':_0x3f465d}:null;}})[_0x5d0b('0x1b')](respondWithResult(_0xd8a0b9,null))[_0x5d0b('0x4b')](handleError(_0xd8a0b9,null));};exports[_0x5d0b('0x57')]=function(_0x45da44,_0x1f37d4,_0x312e92){var _0x536575={};var _0x5392d5={};var _0x124915;var _0x14038f;return db[_0x5d0b('0x32')][_0x5d0b('0x55')]({'where':{'id':_0x45da44['params']['id']}})[_0x5d0b('0x1b')](handleEntityNotFound(_0x1f37d4,null))[_0x5d0b('0x1b')](function(_0x45a7e1){if(_0x45a7e1){_0x124915=_0x45a7e1;_0x5392d5[_0x5d0b('0x36')]=_['keys'](db[_0x5d0b('0x58')][_0x5d0b('0x33')]);_0x5392d5[_0x5d0b('0x39')]=_[_0x5d0b('0x3a')](_0x45da44[_0x5d0b('0x39')]);_0x5392d5[_0x5d0b('0x3b')]=_[_0x5d0b('0x4e')](_0x5392d5[_0x5d0b('0x36')],_0x5392d5[_0x5d0b('0x39')]);_0x536575[_0x5d0b('0x3d')]=_[_0x5d0b('0x4e')](_0x5392d5['model'],qs['fields'](_0x45da44[_0x5d0b('0x39')][_0x5d0b('0x3c')]));_0x536575[_0x5d0b('0x3d')]=_0x536575[_0x5d0b('0x3d')][_0x5d0b('0x3e')]?_0x536575['attributes']:_0x5392d5['model'];_0x536575['order']=qs[_0x5d0b('0x40')](_0x45da44['query'][_0x5d0b('0x40')]);_0x536575[_0x5d0b('0x46')]=qs[_0x5d0b('0x3b')](_['pick'](_0x45da44['query'],_0x5392d5[_0x5d0b('0x3b')]));if(_0x45da44['query'][_0x5d0b('0x42')]){_0x536575['where']=_[_0x5d0b('0x4f')](_0x536575['where'],{'$or':_[_0x5d0b('0x37')](_0x536575[_0x5d0b('0x3d')],function(_0x5014df){var _0x53a95f={};_0x53a95f[_0x5014df]={'$like':'%'+_0x45da44['query'][_0x5d0b('0x42')]+'%'};return _0x53a95f;})});}_0x536575=_[_0x5d0b('0x4f')]({},_0x536575,_0x45da44[_0x5d0b('0x45')]);return _0x124915[_0x5d0b('0x57')](_0x536575);}})[_0x5d0b('0x1b')](function(_0x1a01d9){if(_0x1a01d9){_0x14038f=_0x1a01d9[_0x5d0b('0x3e')];if(!_0x45da44[_0x5d0b('0x39')][_0x5d0b('0x56')]('nolimit')){_0x536575['limit']=qs[_0x5d0b('0x2b')](_0x45da44[_0x5d0b('0x39')]['limit']);_0x536575[_0x5d0b('0x2a')]=qs['offset'](_0x45da44['query'][_0x5d0b('0x2a')]);}return _0x124915[_0x5d0b('0x57')](_0x536575);}})[_0x5d0b('0x1b')](function(_0x5afe25){if(_0x5afe25){return _0x5afe25?{'count':_0x14038f,'rows':_0x5afe25}:null;}})[_0x5d0b('0x1b')](respondWithResult(_0x1f37d4,null))['catch'](handleError(_0x1f37d4,null));};exports[_0x5d0b('0x59')]=function(_0x427abd,_0x5ced0f,_0x867205){var _0x3cc485={};var _0x589a2f={};var _0x6077c;var _0x298cad;return db[_0x5d0b('0x32')][_0x5d0b('0x55')]({'where':{'id':_0x427abd[_0x5d0b('0x4d')]['id']}})[_0x5d0b('0x1b')](handleEntityNotFound(_0x5ced0f,null))[_0x5d0b('0x1b')](function(_0x360c4b){if(_0x360c4b){_0x6077c=_0x360c4b;_0x589a2f[_0x5d0b('0x36')]=_[_0x5d0b('0x3a')](db['DeskField']['rawAttributes']);_0x589a2f[_0x5d0b('0x39')]=_['keys'](_0x427abd[_0x5d0b('0x39')]);_0x589a2f[_0x5d0b('0x3b')]=_['intersection'](_0x589a2f[_0x5d0b('0x36')],_0x589a2f['query']);_0x3cc485['attributes']=_['intersection'](_0x589a2f['model'],qs[_0x5d0b('0x3c')](_0x427abd['query'][_0x5d0b('0x3c')]));_0x3cc485[_0x5d0b('0x3d')]=_0x3cc485[_0x5d0b('0x3d')][_0x5d0b('0x3e')]?_0x3cc485[_0x5d0b('0x3d')]:_0x589a2f['model'];_0x3cc485[_0x5d0b('0x3f')]=qs[_0x5d0b('0x40')](_0x427abd['query'][_0x5d0b('0x40')]);_0x3cc485[_0x5d0b('0x46')]=qs[_0x5d0b('0x3b')](_[_0x5d0b('0x41')](_0x427abd[_0x5d0b('0x39')],_0x589a2f[_0x5d0b('0x3b')]));if(_0x427abd[_0x5d0b('0x39')][_0x5d0b('0x42')]){_0x3cc485[_0x5d0b('0x46')]=_[_0x5d0b('0x4f')](_0x3cc485[_0x5d0b('0x46')],{'$or':_[_0x5d0b('0x37')](_0x3cc485[_0x5d0b('0x3d')],function(_0x101da0){var _0x9c7445={};_0x9c7445[_0x101da0]={'$like':'%'+_0x427abd[_0x5d0b('0x39')][_0x5d0b('0x42')]+'%'};return _0x9c7445;})});}_0x3cc485=_[_0x5d0b('0x4f')]({},_0x3cc485,_0x427abd['options']);return _0x6077c['getDescriptions'](_0x3cc485);}})['then'](function(_0x47d94c){if(_0x47d94c){_0x298cad=_0x47d94c[_0x5d0b('0x3e')];if(!_0x427abd[_0x5d0b('0x39')][_0x5d0b('0x56')]('nolimit')){_0x3cc485[_0x5d0b('0x2b')]=qs[_0x5d0b('0x2b')](_0x427abd[_0x5d0b('0x39')][_0x5d0b('0x2b')]);_0x3cc485[_0x5d0b('0x2a')]=qs[_0x5d0b('0x2a')](_0x427abd[_0x5d0b('0x39')]['offset']);}return _0x6077c[_0x5d0b('0x59')](_0x3cc485);}})[_0x5d0b('0x1b')](function(_0xb0b6a8){if(_0xb0b6a8){return _0xb0b6a8?{'count':_0x298cad,'rows':_0xb0b6a8}:null;}})[_0x5d0b('0x1b')](respondWithResult(_0x5ced0f,null))[_0x5d0b('0x4b')](handleError(_0x5ced0f,null));};exports['getTags']=function(_0x613c53,_0x35ebed,_0x41372d){var _0x3faf6d={};var _0x40f562={};var _0x404293;var _0xd00b90;return db[_0x5d0b('0x32')][_0x5d0b('0x55')]({'where':{'id':_0x613c53[_0x5d0b('0x4d')]['id']}})[_0x5d0b('0x1b')](handleEntityNotFound(_0x35ebed,null))['then'](function(_0x222417){if(_0x222417){_0x404293=_0x222417;_0x40f562[_0x5d0b('0x36')]=_[_0x5d0b('0x3a')](db['Tag']['rawAttributes']);_0x40f562[_0x5d0b('0x39')]=_[_0x5d0b('0x3a')](_0x613c53[_0x5d0b('0x39')]);_0x40f562[_0x5d0b('0x3b')]=_[_0x5d0b('0x4e')](_0x40f562[_0x5d0b('0x36')],_0x40f562[_0x5d0b('0x39')]);_0x3faf6d[_0x5d0b('0x3d')]=_[_0x5d0b('0x4e')](_0x40f562[_0x5d0b('0x36')],qs['fields'](_0x613c53['query'][_0x5d0b('0x3c')]));_0x3faf6d[_0x5d0b('0x3d')]=_0x3faf6d['attributes'][_0x5d0b('0x3e')]?_0x3faf6d['attributes']:_0x40f562[_0x5d0b('0x36')];_0x3faf6d[_0x5d0b('0x3f')]=qs[_0x5d0b('0x40')](_0x613c53['query']['sort']);_0x3faf6d[_0x5d0b('0x46')]=qs[_0x5d0b('0x3b')](_[_0x5d0b('0x41')](_0x613c53['query'],_0x40f562['filters']));if(_0x613c53[_0x5d0b('0x39')][_0x5d0b('0x42')]){_0x3faf6d['where']=_[_0x5d0b('0x4f')](_0x3faf6d[_0x5d0b('0x46')],{'$or':_['map'](_0x3faf6d['attributes'],function(_0x49d354){var _0x5e499e={};_0x5e499e[_0x49d354]={'$like':'%'+_0x613c53['query'][_0x5d0b('0x42')]+'%'};return _0x5e499e;})});}_0x3faf6d=_[_0x5d0b('0x4f')]({},_0x3faf6d,_0x613c53[_0x5d0b('0x45')]);return _0x404293[_0x5d0b('0x5a')](_0x3faf6d);}})[_0x5d0b('0x1b')](function(_0x199c7a){if(_0x199c7a){_0xd00b90=_0x199c7a[_0x5d0b('0x3e')];if(!_0x613c53[_0x5d0b('0x39')][_0x5d0b('0x56')](_0x5d0b('0x5b'))){_0x3faf6d['limit']=qs[_0x5d0b('0x2b')](_0x613c53[_0x5d0b('0x39')][_0x5d0b('0x2b')]);_0x3faf6d['offset']=qs[_0x5d0b('0x2a')](_0x613c53[_0x5d0b('0x39')]['offset']);}return _0x404293[_0x5d0b('0x5a')](_0x3faf6d);}})[_0x5d0b('0x1b')](function(_0x1f567b){if(_0x1f567b){return _0x1f567b?{'count':_0xd00b90,'rows':_0x1f567b}:null;}})['then'](respondWithResult(_0x35ebed,null))['catch'](handleError(_0x35ebed,null));};exports['setTags']=function(_0x3413b0,_0x5de1c4,_0x5cab28){if(_0x3413b0['body']['id']){delete _0x3413b0[_0x5d0b('0x52')]['id'];}return db[_0x5d0b('0x32')][_0x5d0b('0x55')]({'where':{'id':_0x3413b0['params']['id']}})[_0x5d0b('0x1b')](handleEntityNotFound(_0x5de1c4,null))[_0x5d0b('0x1b')](function(_0x16fa1d){if(_0x16fa1d){return _0x16fa1d[_0x5d0b('0x5c')](_0x3413b0[_0x5d0b('0x52')][_0x5d0b('0x5d')]||[]);}return null;})[_0x5d0b('0x1b')](respondWithResult(_0x5de1c4,null))['catch'](handleError(_0x5de1c4,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 5f5b13f..1174c85 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 _0x3343=['../../config/logger','api','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x3343,0x1ea));var _0x3334=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0x3343[_0x2055a7];return _0x42a14d;};'use strict';var _=require(_0x3334('0x0'));var util=require(_0x3334('0x1'));var logger=require(_0x3334('0x2'))(_0x3334('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3334('0x4'));var fs=require('fs');var path=require(_0x3334('0x5'));var rimraf=require('rimraf');var config=require(_0x3334('0x6'));var attributes=require(_0x3334('0x7'));module[_0x3334('0x8')]=function(_0xad03bf,_0x37fc45){return _0xad03bf[_0x3334('0x9')](_0x3334('0xa'),attributes,{'tableName':_0x3334('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x580e=['exports','define','DeskConfiguration','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x2df403,_0x5e84ad){var _0x258ce1=function(_0x3bc8d1){while(--_0x3bc8d1){_0x2df403['push'](_0x2df403['shift']());}};_0x258ce1(++_0x5e84ad);}(_0x580e,0x183));var _0xe580=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x580e[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xe580('0x0'));var util=require(_0xe580('0x1'));var logger=require(_0xe580('0x2'))(_0xe580('0x3'));var moment=require(_0xe580('0x4'));var BPromise=require('bluebird');var rp=require(_0xe580('0x5'));var fs=require('fs');var path=require(_0xe580('0x6'));var rimraf=require('rimraf');var config=require(_0xe580('0x7'));var attributes=require(_0xe580('0x8'));module[_0xe580('0x9')]=function(_0x441dd3,_0x27a949){return _0x441dd3[_0xe580('0xa')](_0xe580('0xb'),attributes,{'tableName':'int_desk_configurations','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 1d9171b..e2588fe 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 _0x8bdf=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a4d07,_0x3664aa){var _0x3d0203=function(_0x2bde31){while(--_0x2bde31){_0x2a4d07['push'](_0x2a4d07['shift']());}};_0x3d0203(++_0x3664aa);}(_0x8bdf,0x1a7));var _0xf8bd=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x8bdf[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0xf8bd('0x0'));var util=require(_0xf8bd('0x1'));var moment=require(_0xf8bd('0x2'));var BPromise=require(_0xf8bd('0x3'));var rs=require(_0xf8bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf8bd('0x5'))['db'];var utils=require(_0xf8bd('0x6'));var logger=require(_0xf8bd('0x7'))(_0xf8bd('0x8'));var config=require(_0xf8bd('0x9'));var jayson=require(_0xf8bd('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x504c82,_0x3ee99e,_0x22a277){return new BPromise(function(_0x3e1db1,_0x424831){return client['request'](_0x504c82,_0x22a277)[_0xf8bd('0xb')](function(_0x3d10d3){logger['info'](_0xf8bd('0xc'),_0x3ee99e,_0xf8bd('0xd'));logger['debug'](_0xf8bd('0xe'),_0x3ee99e,_0xf8bd('0xd'),JSON[_0xf8bd('0xf')](_0x3d10d3));if(_0x3d10d3[_0xf8bd('0x10')]){if(_0x3d10d3['error'][_0xf8bd('0x11')]===0x1f4){logger[_0xf8bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3ee99e,_0x3d10d3[_0xf8bd('0x10')]['message']);return _0x424831(_0x3d10d3[_0xf8bd('0x10')][_0xf8bd('0x12')]);}logger[_0xf8bd('0x10')](_0xf8bd('0xc'),_0x3ee99e,_0x3d10d3[_0xf8bd('0x10')][_0xf8bd('0x12')]);return _0x3e1db1(_0x3d10d3['error']['message']);}else{logger['info'](_0xf8bd('0xc'),_0x3ee99e,_0xf8bd('0xd'));_0x3e1db1(_0x3d10d3['result'][_0xf8bd('0x12')]);}})[_0xf8bd('0x13')](function(_0x1bd8c6){logger[_0xf8bd('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x3ee99e,_0x1bd8c6);_0x424831(_0x1bd8c6);});});} \ No newline at end of file +var _0xe062=['client','http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xe062,0xd5));var _0x2e06=function(_0x575a03,_0x555ecb){_0x575a03=_0x575a03-0x0;var _0x440412=_0xe062[_0x575a03];return _0x440412;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var moment=require('moment');var BPromise=require(_0x2e06('0x2'));var rs=require(_0x2e06('0x3'));var fs=require('fs');var Redis=require(_0x2e06('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e06('0x5'))(_0x2e06('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e06('0x7')][_0x2e06('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52bf0a,_0x5747de,_0x255317){return new BPromise(function(_0x31645b,_0x8ede0e){return client[_0x2e06('0x9')](_0x52bf0a,_0x255317)[_0x2e06('0xa')](function(_0x2a2ee4){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));logger[_0x2e06('0xc')](_0x2e06('0xd'),_0x5747de,'request\x20sent',JSON[_0x2e06('0xe')](_0x2a2ee4));if(_0x2a2ee4[_0x2e06('0xf')]){if(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x10')]===0x1f4){logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')]['message']);return _0x8ede0e(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}logger['error'](_0x2e06('0x11'),_0x5747de,_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);return _0x31645b(_0x2a2ee4[_0x2e06('0xf')][_0x2e06('0x12')]);}else{logger[_0x2e06('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x5747de,_0x2e06('0xb'));_0x31645b(_0x2a2ee4[_0x2e06('0x14')][_0x2e06('0x12')]);}})[_0x2e06('0x15')](function(_0x41d1fc){logger[_0x2e06('0xf')](_0x2e06('0x11'),_0x5747de,_0x41d1fc);_0x8ede0e(_0x41d1fc);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 505a519..1f06ee2 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 _0x643d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x71cd05,_0x36ac11){var _0x59c9e7=function(_0x5472cd){while(--_0x5472cd){_0x71cd05['push'](_0x71cd05['shift']());}};_0x59c9e7(++_0x36ac11);}(_0x643d,0x1bd));var _0xd643=function(_0x496221,_0xe39993){_0x496221=_0x496221-0x0;var _0x5b0642=_0x643d[_0x496221];return _0x5b0642;};'use strict';var multer=require(_0xd643('0x0'));var util=require(_0xd643('0x1'));var path=require(_0xd643('0x2'));var timeout=require(_0xd643('0x3'));var express=require(_0xd643('0x4'));var router=express[_0xd643('0x5')]();var auth=require(_0xd643('0x6'));var interaction=require(_0xd643('0x7'));var config=require('../../config/environment');var controller=require(_0xd643('0x8'));router[_0xd643('0x9')]('/',auth['isAuthenticated'](),controller[_0xd643('0xa')]);router[_0xd643('0x9')](_0xd643('0xb'),auth[_0xd643('0xc')](),controller[_0xd643('0xd')]);router[_0xd643('0xe')]('/',auth[_0xd643('0xc')](),controller[_0xd643('0xf')]);router[_0xd643('0x10')](_0xd643('0xb'),auth[_0xd643('0xc')](),controller[_0xd643('0x11')]);router[_0xd643('0x12')](_0xd643('0xb'),auth[_0xd643('0xc')](),controller[_0xd643('0x13')]);module[_0xd643('0x14')]=router; \ No newline at end of file +var _0xc853=['show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id'];(function(_0x987742,_0x41d7f1){var _0x355e18=function(_0x5bce7a){while(--_0x5bce7a){_0x987742['push'](_0x987742['shift']());}};_0x355e18(++_0x41d7f1);}(_0xc853,0x16f));var _0x3c85=function(_0x31ef02,_0xf6122a){_0x31ef02=_0x31ef02-0x0;var _0x1e1ee6=_0xc853[_0x31ef02];return _0x1e1ee6;};'use strict';var multer=require(_0x3c85('0x0'));var util=require(_0x3c85('0x1'));var path=require('path');var timeout=require(_0x3c85('0x2'));var express=require(_0x3c85('0x3'));var router=express[_0x3c85('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3c85('0x5'));var config=require(_0x3c85('0x6'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0x3c85('0x7')](),controller[_0x3c85('0x8')]);router[_0x3c85('0x9')](_0x3c85('0xa'),auth[_0x3c85('0x7')](),controller[_0x3c85('0xb')]);router[_0x3c85('0xc')]('/',auth['isAuthenticated'](),controller[_0x3c85('0xd')]);router[_0x3c85('0xe')](_0x3c85('0xa'),auth[_0x3c85('0x7')](),controller[_0x3c85('0xf')]);router[_0x3c85('0x10')](_0x3c85('0xa'),auth[_0x3c85('0x7')](),controller[_0x3c85('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 48df3b4..5744671 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 _0x2153=['keyValue','string','STRING','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x4390b5,_0x3d5732){var _0x40466f=function(_0x2a7d75){while(--_0x2a7d75){_0x4390b5['push'](_0x4390b5['shift']());}};_0x40466f(++_0x3d5732);}(_0x2153,0x14c));var _0x3215=function(_0xd40b55,_0x33116f){_0xd40b55=_0xd40b55-0x0;var _0x47169e=_0x2153[_0xd40b55];return _0x47169e;};'use strict';var Sequelize=require(_0x3215('0x0'));module[_0x3215('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x3215('0x2'),_0x3215('0x3'),_0x3215('0x4')),'defaultValue':_0x3215('0x5')},'content':{'type':Sequelize[_0x3215('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x3215('0x5'),'variable',_0x3215('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3215('0x6')]},'customField':{'type':Sequelize[_0x3215('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3215('0x6')]}}; \ No newline at end of file +var _0xc0af=['BOOLEAN','sequelize','exports','keyValue','STRING','ENUM','string','variable'];(function(_0x3258b6,_0x2d7ae1){var _0x54f732=function(_0x925439){while(--_0x925439){_0x3258b6['push'](_0x3258b6['shift']());}};_0x54f732(++_0x2d7ae1);}(_0xc0af,0x139));var _0xfc0a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc0af[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xfc0a('0x0'));module[_0xfc0a('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0xfc0a('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfc0a('0x3')]},'key':{'type':Sequelize[_0xfc0a('0x3')]},'keyType':{'type':Sequelize[_0xfc0a('0x4')](_0xfc0a('0x5'),_0xfc0a('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xfc0a('0x3')]},'idField':{'type':Sequelize[_0xfc0a('0x3')]},'nameField':{'type':Sequelize[_0xfc0a('0x3')]},'customField':{'type':Sequelize[_0xfc0a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfc0a('0x3')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index f1ec375..3c0a048 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 _0x4f16=['sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','find','create','body','params','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4a18f0,_0x903c50){var _0x158316=function(_0x3cf39c){while(--_0x3cf39c){_0x4a18f0['push'](_0x4a18f0['shift']());}};_0x158316(++_0x903c50);}(_0x4f16,0x9e));var _0x64f1=function(_0x21d532,_0x4552a4){_0x21d532=_0x21d532-0x0;var _0x37bda1=_0x4f16[_0x21d532];return _0x37bda1;};'use strict';var pdf=require(_0x64f1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x64f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x64f1('0x2'));var moment=require(_0x64f1('0x3'));var BPromise=require(_0x64f1('0x4'));var Mustache=require(_0x64f1('0x5'));var util=require(_0x64f1('0x6'));var path=require(_0x64f1('0x7'));var sox=require('sox');var csv=require(_0x64f1('0x8'));var ejs=require(_0x64f1('0x9'));var fs=require('fs');var _=require(_0x64f1('0xa'));var squel=require(_0x64f1('0xb'));var crypto=require(_0x64f1('0xc'));var jsforce=require(_0x64f1('0xd'));var deskjs=require(_0x64f1('0xe'));var toCsv=require(_0x64f1('0x8'));var querystring=require(_0x64f1('0xf'));var Papa=require(_0x64f1('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64f1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64f1('0x12'))(_0x64f1('0x13'));var utils=require(_0x64f1('0x14'));var config=require(_0x64f1('0x15'));var db=require(_0x64f1('0x16'))['db'];function respondWithStatusCode(_0x2676b,_0x5c3be4){_0x5c3be4=_0x5c3be4||0xcc;return function(_0x3a8c3f){if(_0x3a8c3f){return _0x2676b['sendStatus'](_0x5c3be4);}return _0x2676b[_0x64f1('0x17')](_0x5c3be4)[_0x64f1('0x18')]();};}function respondWithResult(_0x58ecd5,_0x2aa7c1){_0x2aa7c1=_0x2aa7c1||0xc8;return function(_0x3e7ece){if(_0x3e7ece){return _0x58ecd5[_0x64f1('0x17')](_0x2aa7c1)[_0x64f1('0x19')](_0x3e7ece);}};}function respondWithFilteredResult(_0x3df521,_0x299a66){return function(_0x471152){if(_0x471152){var _0x206c7b=_0x471152[_0x64f1('0x1a')],_0x5d728c=_0x299a66['offset'],_0x27b4f9=_0x299a66[_0x64f1('0x1b')]+_0x299a66[_0x64f1('0x1c')],_0x4da272;if(_0x27b4f9>=_0x206c7b){_0x27b4f9=_0x206c7b;_0x4da272=0xc8;}else{_0x4da272=0xce;}_0x3df521['status'](_0x4da272);return _0x3df521[_0x64f1('0x1d')](_0x64f1('0x1e'),_0x5d728c+'-'+_0x27b4f9+'/'+_0x206c7b)[_0x64f1('0x19')](_0x471152);}return null;};}function patchUpdates(_0x3a5b37){return function(_0x50dd87){try{jsonpatch[_0x64f1('0x1f')](_0x50dd87,_0x3a5b37,!![]);}catch(_0x2792c9){return BPromise['reject'](_0x2792c9);}return _0x50dd87[_0x64f1('0x20')]();};}function saveUpdates(_0x4357fb,_0x1142d2){return function(_0x4b8ca9){if(_0x4b8ca9){return _0x4b8ca9[_0x64f1('0x21')](_0x4357fb)[_0x64f1('0x22')](function(_0x20f0bd){return _0x20f0bd;});}return null;};}function removeEntity(_0x2c09d6,_0x29d46c){return function(_0x3be7fc){if(_0x3be7fc){return _0x3be7fc[_0x64f1('0x23')]()[_0x64f1('0x22')](function(){_0x2c09d6[_0x64f1('0x17')](0xcc)[_0x64f1('0x18')]();});}};}function handleEntityNotFound(_0x14d2d3,_0x3f80da){return function(_0xb0f36e){if(!_0xb0f36e){_0x14d2d3['sendStatus'](0x194);}return _0xb0f36e;};}function handleError(_0x5d1340,_0xa58178){_0xa58178=_0xa58178||0x1f4;return function(_0x203999){logger[_0x64f1('0x24')](_0x203999['stack']);if(_0x203999[_0x64f1('0x25')]){delete _0x203999[_0x64f1('0x25')];}_0x5d1340[_0x64f1('0x17')](_0xa58178)[_0x64f1('0x26')](_0x203999);};}exports[_0x64f1('0x27')]=function(_0x535d37,_0x169761){var _0x27a409={},_0x28c247={},_0x1bb576={'count':0x0,'rows':[]};var _0x1c5753=_[_0x64f1('0x28')](db[_0x64f1('0x29')][_0x64f1('0x2a')],function(_0x249ad7){return{'name':_0x249ad7[_0x64f1('0x2b')],'type':_0x249ad7[_0x64f1('0x2c')][_0x64f1('0x2d')]};});_0x28c247['model']=_['map'](_0x1c5753,_0x64f1('0x25'));_0x28c247[_0x64f1('0x2e')]=_[_0x64f1('0x2f')](_0x535d37['query']);_0x28c247['filters']=_[_0x64f1('0x30')](_0x28c247[_0x64f1('0x31')],_0x28c247['query']);_0x27a409[_0x64f1('0x32')]=_['intersection'](_0x28c247[_0x64f1('0x31')],qs[_0x64f1('0x33')](_0x535d37[_0x64f1('0x2e')][_0x64f1('0x33')]));_0x27a409[_0x64f1('0x32')]=_0x27a409[_0x64f1('0x32')][_0x64f1('0x34')]?_0x27a409[_0x64f1('0x32')]:_0x28c247['model'];if(!_0x535d37[_0x64f1('0x2e')][_0x64f1('0x35')](_0x64f1('0x36'))){_0x27a409['limit']=qs['limit'](_0x535d37[_0x64f1('0x2e')][_0x64f1('0x1c')]);_0x27a409[_0x64f1('0x1b')]=qs[_0x64f1('0x1b')](_0x535d37[_0x64f1('0x2e')]['offset']);}_0x27a409['order']=qs[_0x64f1('0x37')](_0x535d37[_0x64f1('0x2e')][_0x64f1('0x37')]);_0x27a409[_0x64f1('0x38')]=qs[_0x64f1('0x39')](_[_0x64f1('0x3a')](_0x535d37[_0x64f1('0x2e')],_0x28c247[_0x64f1('0x39')]),_0x1c5753);if(_0x535d37['query'][_0x64f1('0x3b')]){_0x27a409['where']=_[_0x64f1('0x3c')](_0x27a409[_0x64f1('0x38')],{'$or':_[_0x64f1('0x28')](_0x1c5753,function(_0x5b9898){if(_0x5b9898[_0x64f1('0x2c')]!=='VIRTUAL'){var _0x49f50e={};_0x49f50e[_0x5b9898[_0x64f1('0x25')]]={'$like':'%'+_0x535d37['query'][_0x64f1('0x3b')]+'%'};return _0x49f50e;}})});}_0x27a409=_[_0x64f1('0x3c')]({},_0x27a409,_0x535d37[_0x64f1('0x3d')]);var _0x45207e={'where':_0x27a409['where']};return db[_0x64f1('0x29')][_0x64f1('0x1a')](_0x45207e)[_0x64f1('0x22')](function(_0x1ec84a){_0x1bb576[_0x64f1('0x1a')]=_0x1ec84a;if(_0x535d37[_0x64f1('0x2e')][_0x64f1('0x3e')]){_0x27a409[_0x64f1('0x3f')]=[{'all':!![]}];}return db[_0x64f1('0x29')][_0x64f1('0x40')](_0x27a409);})[_0x64f1('0x22')](function(_0x212906){_0x1bb576[_0x64f1('0x41')]=_0x212906;return _0x1bb576;})[_0x64f1('0x22')](respondWithFilteredResult(_0x169761,_0x27a409))[_0x64f1('0x42')](handleError(_0x169761,null));};exports['show']=function(_0x4c12c1,_0x27ae4f){var _0x1b9ac={'raw':!![],'where':{'id':_0x4c12c1['params']['id']}},_0x502bef={};_0x502bef[_0x64f1('0x31')]=_[_0x64f1('0x2f')](db['DeskField'][_0x64f1('0x2a')]);_0x502bef[_0x64f1('0x2e')]=_[_0x64f1('0x2f')](_0x4c12c1['query']);_0x502bef[_0x64f1('0x39')]=_[_0x64f1('0x30')](_0x502bef['model'],_0x502bef['query']);_0x1b9ac[_0x64f1('0x32')]=_[_0x64f1('0x30')](_0x502bef['model'],qs[_0x64f1('0x33')](_0x4c12c1[_0x64f1('0x2e')]['fields']));_0x1b9ac[_0x64f1('0x32')]=_0x1b9ac['attributes'][_0x64f1('0x34')]?_0x1b9ac[_0x64f1('0x32')]:_0x502bef[_0x64f1('0x31')];if(_0x4c12c1['query'][_0x64f1('0x3e')]){_0x1b9ac[_0x64f1('0x3f')]=[{'all':!![]}];}_0x1b9ac=_[_0x64f1('0x3c')]({},_0x1b9ac,_0x4c12c1[_0x64f1('0x3d')]);return db[_0x64f1('0x29')][_0x64f1('0x43')](_0x1b9ac)['then'](handleEntityNotFound(_0x27ae4f,null))[_0x64f1('0x22')](respondWithResult(_0x27ae4f,null))[_0x64f1('0x42')](handleError(_0x27ae4f,null));};exports[_0x64f1('0x44')]=function(_0x5f05fa,_0xdf6b6c){return db[_0x64f1('0x29')][_0x64f1('0x44')](_0x5f05fa['body'],{})[_0x64f1('0x22')](respondWithResult(_0xdf6b6c,0xc9))[_0x64f1('0x42')](handleError(_0xdf6b6c,null));};exports[_0x64f1('0x21')]=function(_0x1b16bb,_0x525b5f){if(_0x1b16bb[_0x64f1('0x45')]['id']){delete _0x1b16bb[_0x64f1('0x45')]['id'];}return db['DeskField']['find']({'where':{'id':_0x1b16bb[_0x64f1('0x46')]['id']}})[_0x64f1('0x22')](handleEntityNotFound(_0x525b5f,null))[_0x64f1('0x22')](saveUpdates(_0x1b16bb[_0x64f1('0x45')],null))[_0x64f1('0x22')](respondWithResult(_0x525b5f,null))[_0x64f1('0x42')](handleError(_0x525b5f,null));};exports[_0x64f1('0x23')]=function(_0x1ad196,_0x1b970e){return db[_0x64f1('0x29')][_0x64f1('0x43')]({'where':{'id':_0x1ad196[_0x64f1('0x46')]['id']}})['then'](handleEntityNotFound(_0x1b970e,null))[_0x64f1('0x22')](removeEntity(_0x1b970e,null))[_0x64f1('0x42')](handleError(_0x1b970e,null));}; \ No newline at end of file +var _0x36a9=['mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','merge','where','filter','options','count','include','findAll','rows','params','keys','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x468493,_0x475605){var _0x4164dd=function(_0xf865cb){while(--_0xf865cb){_0x468493['push'](_0x468493['shift']());}};_0x4164dd(++_0x475605);}(_0x36a9,0x8e));var _0x936a=function(_0x4d32d3,_0x287c07){_0x4d32d3=_0x4d32d3-0x0;var _0x2d759c=_0x36a9[_0x4d32d3];return _0x2d759c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x936a('0x0'));var rimraf=require(_0x936a('0x1'));var zipdir=require(_0x936a('0x2'));var jsonpatch=require(_0x936a('0x3'));var rp=require(_0x936a('0x4'));var moment=require('moment');var BPromise=require(_0x936a('0x5'));var Mustache=require(_0x936a('0x6'));var util=require(_0x936a('0x7'));var path=require(_0x936a('0x8'));var sox=require(_0x936a('0x9'));var csv=require(_0x936a('0xa'));var ejs=require(_0x936a('0xb'));var fs=require('fs');var _=require(_0x936a('0xc'));var squel=require(_0x936a('0xd'));var crypto=require(_0x936a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x936a('0xa'));var querystring=require(_0x936a('0xf'));var Papa=require(_0x936a('0x10'));var Redis=require(_0x936a('0x11'));var authService=require(_0x936a('0x12'));var qs=require(_0x936a('0x13'));var as=require(_0x936a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x936a('0x15'));var config=require(_0x936a('0x16'));var db=require(_0x936a('0x17'))['db'];function respondWithStatusCode(_0x5089d2,_0x197209){_0x197209=_0x197209||0xcc;return function(_0x4c3685){if(_0x4c3685){return _0x5089d2[_0x936a('0x18')](_0x197209);}return _0x5089d2[_0x936a('0x19')](_0x197209)['end']();};}function respondWithResult(_0x5d5829,_0x3032b8){_0x3032b8=_0x3032b8||0xc8;return function(_0x3f198d){if(_0x3f198d){return _0x5d5829[_0x936a('0x19')](_0x3032b8)[_0x936a('0x1a')](_0x3f198d);}};}function respondWithFilteredResult(_0x57552a,_0x505fa8){return function(_0x408211){if(_0x408211){var _0x1909de=_0x408211['count'],_0x415a7c=_0x505fa8[_0x936a('0x1b')],_0x1fe7ee=_0x505fa8['offset']+_0x505fa8['limit'],_0x488e5d;if(_0x1fe7ee>=_0x1909de){_0x1fe7ee=_0x1909de;_0x488e5d=0xc8;}else{_0x488e5d=0xce;}_0x57552a[_0x936a('0x19')](_0x488e5d);return _0x57552a[_0x936a('0x1c')]('Content-Range',_0x415a7c+'-'+_0x1fe7ee+'/'+_0x1909de)[_0x936a('0x1a')](_0x408211);}return null;};}function patchUpdates(_0x4d6a5e){return function(_0x5d91c2){try{jsonpatch[_0x936a('0x1d')](_0x5d91c2,_0x4d6a5e,!![]);}catch(_0x2960f9){return BPromise[_0x936a('0x1e')](_0x2960f9);}return _0x5d91c2[_0x936a('0x1f')]();};}function saveUpdates(_0x2868bf,_0x3f02d7){return function(_0x7f1165){if(_0x7f1165){return _0x7f1165[_0x936a('0x20')](_0x2868bf)[_0x936a('0x21')](function(_0x302aaf){return _0x302aaf;});}return null;};}function removeEntity(_0x136f0e,_0x55bd64){return function(_0x193d30){if(_0x193d30){return _0x193d30['destroy']()['then'](function(){_0x136f0e['status'](0xcc)[_0x936a('0x22')]();});}};}function handleEntityNotFound(_0x1b437f,_0x10a6e8){return function(_0x874386){if(!_0x874386){_0x1b437f[_0x936a('0x18')](0x194);}return _0x874386;};}function handleError(_0x42080d,_0x54da6b){_0x54da6b=_0x54da6b||0x1f4;return function(_0x485540){logger[_0x936a('0x23')](_0x485540[_0x936a('0x24')]);if(_0x485540[_0x936a('0x25')]){delete _0x485540[_0x936a('0x25')];}_0x42080d[_0x936a('0x19')](_0x54da6b)[_0x936a('0x26')](_0x485540);};}exports[_0x936a('0x27')]=function(_0x3dc7f6,_0x40d5ff){var _0x30c683={},_0x12136f={},_0x1b8061={'count':0x0,'rows':[]};var _0x3b3eb5=_[_0x936a('0x28')](db[_0x936a('0x29')][_0x936a('0x2a')],function(_0x3cb632){return{'name':_0x3cb632[_0x936a('0x2b')],'type':_0x3cb632[_0x936a('0x2c')][_0x936a('0x2d')]};});_0x12136f['model']=_[_0x936a('0x28')](_0x3b3eb5,_0x936a('0x25'));_0x12136f[_0x936a('0x2e')]=_['keys'](_0x3dc7f6[_0x936a('0x2e')]);_0x12136f[_0x936a('0x2f')]=_[_0x936a('0x30')](_0x12136f['model'],_0x12136f[_0x936a('0x2e')]);_0x30c683[_0x936a('0x31')]=_[_0x936a('0x30')](_0x12136f[_0x936a('0x32')],qs[_0x936a('0x33')](_0x3dc7f6['query'][_0x936a('0x33')]));_0x30c683[_0x936a('0x31')]=_0x30c683['attributes'][_0x936a('0x34')]?_0x30c683['attributes']:_0x12136f[_0x936a('0x32')];if(!_0x3dc7f6[_0x936a('0x2e')][_0x936a('0x35')](_0x936a('0x36'))){_0x30c683[_0x936a('0x37')]=qs['limit'](_0x3dc7f6[_0x936a('0x2e')][_0x936a('0x37')]);_0x30c683[_0x936a('0x1b')]=qs[_0x936a('0x1b')](_0x3dc7f6['query'][_0x936a('0x1b')]);}_0x30c683[_0x936a('0x38')]=qs[_0x936a('0x39')](_0x3dc7f6[_0x936a('0x2e')]['sort']);_0x30c683['where']=qs[_0x936a('0x2f')](_[_0x936a('0x3a')](_0x3dc7f6[_0x936a('0x2e')],_0x12136f[_0x936a('0x2f')]),_0x3b3eb5);if(_0x3dc7f6['query']['filter']){_0x30c683['where']=_[_0x936a('0x3b')](_0x30c683[_0x936a('0x3c')],{'$or':_[_0x936a('0x28')](_0x3b3eb5,function(_0x83232d){if(_0x83232d[_0x936a('0x2c')]!=='VIRTUAL'){var _0x5cc737={};_0x5cc737[_0x83232d['name']]={'$like':'%'+_0x3dc7f6[_0x936a('0x2e')][_0x936a('0x3d')]+'%'};return _0x5cc737;}})});}_0x30c683=_[_0x936a('0x3b')]({},_0x30c683,_0x3dc7f6[_0x936a('0x3e')]);var _0x3eddd9={'where':_0x30c683[_0x936a('0x3c')]};return db[_0x936a('0x29')][_0x936a('0x3f')](_0x3eddd9)[_0x936a('0x21')](function(_0x17f945){_0x1b8061[_0x936a('0x3f')]=_0x17f945;if(_0x3dc7f6[_0x936a('0x2e')]['includeAll']){_0x30c683[_0x936a('0x40')]=[{'all':!![]}];}return db['DeskField'][_0x936a('0x41')](_0x30c683);})[_0x936a('0x21')](function(_0x5ed5ce){_0x1b8061[_0x936a('0x42')]=_0x5ed5ce;return _0x1b8061;})[_0x936a('0x21')](respondWithFilteredResult(_0x40d5ff,_0x30c683))['catch'](handleError(_0x40d5ff,null));};exports['show']=function(_0x13bc36,_0x435eb2){var _0x262430={'raw':!![],'where':{'id':_0x13bc36[_0x936a('0x43')]['id']}},_0x5cdf77={};_0x5cdf77[_0x936a('0x32')]=_[_0x936a('0x44')](db[_0x936a('0x29')][_0x936a('0x2a')]);_0x5cdf77[_0x936a('0x2e')]=_[_0x936a('0x44')](_0x13bc36[_0x936a('0x2e')]);_0x5cdf77['filters']=_[_0x936a('0x30')](_0x5cdf77['model'],_0x5cdf77[_0x936a('0x2e')]);_0x262430[_0x936a('0x31')]=_[_0x936a('0x30')](_0x5cdf77[_0x936a('0x32')],qs[_0x936a('0x33')](_0x13bc36[_0x936a('0x2e')][_0x936a('0x33')]));_0x262430['attributes']=_0x262430[_0x936a('0x31')]['length']?_0x262430[_0x936a('0x31')]:_0x5cdf77[_0x936a('0x32')];if(_0x13bc36[_0x936a('0x2e')][_0x936a('0x45')]){_0x262430[_0x936a('0x40')]=[{'all':!![]}];}_0x262430=_[_0x936a('0x3b')]({},_0x262430,_0x13bc36[_0x936a('0x3e')]);return db['DeskField'][_0x936a('0x46')](_0x262430)[_0x936a('0x21')](handleEntityNotFound(_0x435eb2,null))[_0x936a('0x21')](respondWithResult(_0x435eb2,null))[_0x936a('0x47')](handleError(_0x435eb2,null));};exports[_0x936a('0x48')]=function(_0x420cd5,_0x396e6f){return db['DeskField'][_0x936a('0x48')](_0x420cd5['body'],{})[_0x936a('0x21')](respondWithResult(_0x396e6f,0xc9))[_0x936a('0x47')](handleError(_0x396e6f,null));};exports['update']=function(_0x1caf62,_0x200d06){if(_0x1caf62[_0x936a('0x49')]['id']){delete _0x1caf62['body']['id'];}return db[_0x936a('0x29')][_0x936a('0x46')]({'where':{'id':_0x1caf62[_0x936a('0x43')]['id']}})[_0x936a('0x21')](handleEntityNotFound(_0x200d06,null))[_0x936a('0x21')](saveUpdates(_0x1caf62['body'],null))['then'](respondWithResult(_0x200d06,null))[_0x936a('0x47')](handleError(_0x200d06,null));};exports['destroy']=function(_0x308319,_0x29789d){return db[_0x936a('0x29')]['find']({'where':{'id':_0x308319[_0x936a('0x43')]['id']}})[_0x936a('0x21')](handleEntityNotFound(_0x29789d,null))[_0x936a('0x21')](removeEntity(_0x29789d,null))[_0x936a('0x47')](handleError(_0x29789d,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 8b755fc..2bfa347 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 _0xff0b=['exports','define','int_desk_fields','lodash','../../config/logger','bluebird','request-promise','path','./intDeskField.attributes'];(function(_0x1c3104,_0x19b2c6){var _0x6bcf08=function(_0x2e72b3){while(--_0x2e72b3){_0x1c3104['push'](_0x1c3104['shift']());}};_0x6bcf08(++_0x19b2c6);}(_0xff0b,0x18f));var _0xbff0=function(_0x4a6d3a,_0x1b2479){_0x4a6d3a=_0x4a6d3a-0x0;var _0x55d643=_0xff0b[_0x4a6d3a];return _0x55d643;};'use strict';var _=require(_0xbff0('0x0'));var util=require('util');var logger=require(_0xbff0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbff0('0x2'));var rp=require(_0xbff0('0x3'));var fs=require('fs');var path=require(_0xbff0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbff0('0x5'));module[_0xbff0('0x6')]=function(_0x172c6d,_0x9dcc98){return _0x172c6d[_0xbff0('0x7')]('DeskField',attributes,{'tableName':_0xbff0('0x8'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72dd=['../../config/environment','./intDeskField.attributes','define','DeskField','desk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x568d4c,_0x1dfaf2){var _0x486e05=function(_0x1fc9f1){while(--_0x1fc9f1){_0x568d4c['push'](_0x568d4c['shift']());}};_0x486e05(++_0x1dfaf2);}(_0x72dd,0xd7));var _0xd72d=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x72dd[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd72d('0x0'))(_0xd72d('0x1'));var moment=require(_0xd72d('0x2'));var BPromise=require(_0xd72d('0x3'));var rp=require(_0xd72d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd72d('0x5'));var config=require(_0xd72d('0x6'));var attributes=require(_0xd72d('0x7'));module['exports']=function(_0x28521b,_0x4fabf9){return _0x28521b[_0xd72d('0x8')](_0xd72d('0x9'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xd72d('0xa'),'fields':[_0xd72d('0xb'),_0xd72d('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 8ba73b4..2f9a301 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 _0xfee6=['code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfee6,0x14e));var _0x6fee=function(_0x348bb5,_0x32c723){_0x348bb5=_0x348bb5-0x0;var _0x4fbc6c=_0xfee6[_0x348bb5];return _0x4fbc6c;};'use strict';var _=require('lodash');var util=require(_0x6fee('0x0'));var moment=require('moment');var BPromise=require(_0x6fee('0x1'));var rs=require(_0x6fee('0x2'));var fs=require('fs');var Redis=require(_0x6fee('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fee('0x4'));var logger=require(_0x6fee('0x5'))(_0x6fee('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6fee('0x7')][_0x6fee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5252da,_0xa830a7,_0x4c5199){return new BPromise(function(_0x2faecf,_0x1cd267){return client[_0x6fee('0x9')](_0x5252da,_0x4c5199)[_0x6fee('0xa')](function(_0xe5ca4){logger[_0x6fee('0xb')](_0x6fee('0xc'),_0xa830a7,_0x6fee('0xd'));logger[_0x6fee('0xe')](_0x6fee('0xf'),_0xa830a7,_0x6fee('0xd'),JSON[_0x6fee('0x10')](_0xe5ca4));if(_0xe5ca4[_0x6fee('0x11')]){if(_0xe5ca4[_0x6fee('0x11')][_0x6fee('0x12')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0xa830a7,_0xe5ca4[_0x6fee('0x11')][_0x6fee('0x13')]);return _0x1cd267(_0xe5ca4['error'][_0x6fee('0x13')]);}logger[_0x6fee('0x11')](_0x6fee('0xc'),_0xa830a7,_0xe5ca4[_0x6fee('0x11')]['message']);return _0x2faecf(_0xe5ca4['error'][_0x6fee('0x13')]);}else{logger[_0x6fee('0xb')](_0x6fee('0xc'),_0xa830a7,_0x6fee('0xd'));_0x2faecf(_0xe5ca4[_0x6fee('0x14')][_0x6fee('0x13')]);}})[_0x6fee('0x15')](function(_0x114690){logger[_0x6fee('0x11')](_0x6fee('0xc'),_0xa830a7,_0x114690);_0x1cd267(_0x114690);});});} \ No newline at end of file +var _0x5d34=['http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x5e52f5,_0x1e2674){var _0xfc3428=function(_0x4c1f46){while(--_0x4c1f46){_0x5e52f5['push'](_0x5e52f5['shift']());}};_0xfc3428(++_0x1e2674);}(_0x5d34,0x64));var _0x45d3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d34[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x45d3('0x0'));var moment=require('moment');var BPromise=require(_0x45d3('0x1'));var rs=require(_0x45d3('0x2'));var fs=require('fs');var Redis=require(_0x45d3('0x3'));var db=require(_0x45d3('0x4'))['db'];var utils=require(_0x45d3('0x5'));var logger=require('../../config/logger')(_0x45d3('0x6'));var config=require(_0x45d3('0x7'));var jayson=require(_0x45d3('0x8'));var client=jayson[_0x45d3('0x9')][_0x45d3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x364df6,_0x480966,_0x28183f){return new BPromise(function(_0x29bd8d,_0x35e306){return client['request'](_0x364df6,_0x28183f)[_0x45d3('0xb')](function(_0x3610e6){logger[_0x45d3('0xc')]('DeskField,\x20%s,\x20%s',_0x480966,_0x45d3('0xd'));logger[_0x45d3('0xe')](_0x45d3('0xf'),_0x480966,_0x45d3('0xd'),JSON[_0x45d3('0x10')](_0x3610e6));if(_0x3610e6[_0x45d3('0x11')]){if(_0x3610e6['error'][_0x45d3('0x12')]===0x1f4){logger[_0x45d3('0x11')]('DeskField,\x20%s,\x20%s',_0x480966,_0x3610e6[_0x45d3('0x11')]['message']);return _0x35e306(_0x3610e6[_0x45d3('0x11')]['message']);}logger[_0x45d3('0x11')](_0x45d3('0x13'),_0x480966,_0x3610e6[_0x45d3('0x11')][_0x45d3('0x14')]);return _0x29bd8d(_0x3610e6[_0x45d3('0x11')][_0x45d3('0x14')]);}else{logger[_0x45d3('0xc')](_0x45d3('0x13'),_0x480966,'request\x20sent');_0x29bd8d(_0x3610e6[_0x45d3('0x15')][_0x45d3('0x14')]);}})['catch'](function(_0x25b1a8){logger[_0x45d3('0x11')](_0x45d3('0x13'),_0x480966,_0x25b1a8);_0x35e306(_0x25b1a8);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 4376bcd..1cea6fe 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 _0x2467=['delete','destroy','exports','util','path','connect-timeout','Router','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put'];(function(_0x2b3750,_0x4fd975){var _0x4f4199=function(_0x5f527b){while(--_0x5f527b){_0x2b3750['push'](_0x2b3750['shift']());}};_0x4f4199(++_0x4fd975);}(_0x2467,0xa3));var _0x7246=function(_0x263daa,_0x21d223){_0x263daa=_0x263daa-0x0;var _0x300814=_0x2467[_0x263daa];return _0x300814;};'use strict';var multer=require('multer');var util=require(_0x7246('0x0'));var path=require(_0x7246('0x1'));var timeout=require(_0x7246('0x2'));var express=require('express');var router=express[_0x7246('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7246('0x4'));router['get']('/',auth[_0x7246('0x5')](),controller[_0x7246('0x6')]);router[_0x7246('0x7')](_0x7246('0x8'),auth[_0x7246('0x5')](),controller[_0x7246('0x9')]);router[_0x7246('0x7')](_0x7246('0xa'),auth['isAuthenticated'](),controller[_0x7246('0xb')]);router['get'](_0x7246('0xc'),auth[_0x7246('0x5')](),controller[_0x7246('0xd')]);router[_0x7246('0xe')]('/',auth[_0x7246('0x5')](),controller[_0x7246('0xf')]);router['post'](_0x7246('0xa'),auth[_0x7246('0x5')](),controller['addConfiguration']);router[_0x7246('0x10')](_0x7246('0x8'),auth[_0x7246('0x5')](),controller['update']);router[_0x7246('0x11')](_0x7246('0x8'),auth['isAuthenticated'](),controller[_0x7246('0x12')]);module[_0x7246('0x13')]=router; \ No newline at end of file +var _0xda6f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x3ae3e2,_0x7aa47a){var _0x47d3b5=function(_0xc3fcd9){while(--_0xc3fcd9){_0x3ae3e2['push'](_0x3ae3e2['shift']());}};_0x47d3b5(++_0x7aa47a);}(_0xda6f,0xb4));var _0xfda6=function(_0x4ee791,_0x5897f6){_0x4ee791=_0x4ee791-0x0;var _0x3b6f42=_0xda6f[_0x4ee791];return _0x3b6f42;};'use strict';var multer=require(_0xfda6('0x0'));var util=require(_0xfda6('0x1'));var path=require(_0xfda6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfda6('0x3')]();var auth=require(_0xfda6('0x4'));var interaction=require(_0xfda6('0x5'));var config=require(_0xfda6('0x6'));var controller=require(_0xfda6('0x7'));router[_0xfda6('0x8')]('/',auth[_0xfda6('0x9')](),controller[_0xfda6('0xa')]);router[_0xfda6('0x8')](_0xfda6('0xb'),auth[_0xfda6('0x9')](),controller['show']);router['get'](_0xfda6('0xc'),auth['isAuthenticated'](),controller[_0xfda6('0xd')]);router[_0xfda6('0x8')](_0xfda6('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xfda6('0xf')]('/',auth[_0xfda6('0x9')](),controller[_0xfda6('0x10')]);router[_0xfda6('0xf')](_0xfda6('0xc'),auth['isAuthenticated'](),controller[_0xfda6('0x11')]);router[_0xfda6('0x12')](_0xfda6('0xb'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x13')]);router[_0xfda6('0x14')](_0xfda6('0xb'),auth[_0xfda6('0x9')](),controller[_0xfda6('0x15')]);module[_0xfda6('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 851807e..c50d7a3 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 _0x6442=['sequelize','exports','STRING'];(function(_0x160423,_0x515070){var _0x250bb2=function(_0x253b7e){while(--_0x253b7e){_0x160423['push'](_0x160423['shift']());}};_0x250bb2(++_0x515070);}(_0x6442,0x17d));var _0x2644=function(_0x1728d1,_0x1994e3){_0x1728d1=_0x1728d1-0x0;var _0x3ca811=_0x6442[_0x1728d1];return _0x3ca811;};'use strict';var Sequelize=require(_0x2644('0x0'));module[_0x2644('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2644('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x2644('0x2')]},'description':{'type':Sequelize[_0x2644('0x2')]}}; \ No newline at end of file +var _0x8e0b=['exports','STRING','sequelize'];(function(_0x311944,_0x27cbdb){var _0x4ea10b=function(_0x500078){while(--_0x500078){_0x311944['push'](_0x311944['shift']());}};_0x4ea10b(++_0x27cbdb);}(_0x8e0b,0x140));var _0xb8e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e0b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xb8e0('0x0'));module[_0xb8e0('0x1')]={'name':{'type':Sequelize[_0xb8e0('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb8e0('0x2')]},'remoteUri':{'type':Sequelize[_0xb8e0('0x2')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xb8e0('0x2')]},'clientSecret':{'type':Sequelize[_0xb8e0('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb8e0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index fa3e448..1faf5ef 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 _0x89ec=['StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','statusCode','stack',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../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~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','count','offset','limit','Content-Range','apply','reject','save','update','destroy','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','rows','show','params','length','include','find','create','catch','body','getConfigurations','Dynamics365Configuration','sort','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','Incident','PhoneCall','title','customerid','caseorigincode','subject','phonenumber','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','escalatedon','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientId','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','clientSecret','access_token','GET','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','LogicalName','substring','@odata.type','PicklistAttributeMetadata','push','all','forEach','isNil','BooleanAttributeMetadata'];(function(_0x4146bf,_0x25c865){var _0x5d189a=function(_0x179884){while(--_0x179884){_0x4146bf['push'](_0x4146bf['shift']());}};_0x5d189a(++_0x25c865);}(_0x89ec,0x1c1));var _0xc89e=function(_0x4bbadb,_0x168ff6){_0x4bbadb=_0x4bbadb-0x0;var _0x503ffc=_0x89ec[_0x4bbadb];return _0x503ffc;};'use strict';var pdf=require(_0xc89e('0x0'));var emlformat=require(_0xc89e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc89e('0x2'));var jsonpatch=require(_0xc89e('0x3'));var rp=require(_0xc89e('0x4'));var moment=require(_0xc89e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc89e('0x6'));var util=require(_0xc89e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc89e('0x8'));var ejs=require(_0xc89e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc89e('0xa'));var crypto=require(_0xc89e('0xb'));var jsforce=require(_0xc89e('0xc'));var deskjs=require(_0xc89e('0xd'));var toCsv=require(_0xc89e('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc89e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc89e('0xf'));var as=require(_0xc89e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc89e('0x11'));var utils=require(_0xc89e('0x12'));var config=require(_0xc89e('0x13'));var db=require(_0xc89e('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client'][_0xc89e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3c0ee7,_0x25937c,_0x2ce392){if(_0x2ce392){var _0x428dc4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x428dc4[_0xc89e('0x16')](_0x25937c)){return _0x3c0ee7;}else{throw new db[(_0xc89e('0x17'))][(_0xc89e('0x18'))](_0xc89e('0x19'));}}else{return _0x3c0ee7;}}function respondWithRpcPromise(_0x4ce12b,_0xac27b1,_0xdf0bae,_0x34154a){return new BPromise(function(_0x109c48,_0x39410d){var _0x450f74=_0x34154a||client;return _0x450f74[_0xc89e('0x1a')](_0x4ce12b,_0xdf0bae)[_0xc89e('0x1b')](function(_0x55eb0d){logger[_0xc89e('0x1c')](_0xc89e('0x1d'),_0xac27b1,_0xc89e('0x1e'));logger[_0xc89e('0x1f')](_0xc89e('0x20'),_0xac27b1,_0xc89e('0x1e'),JSON[_0xc89e('0x21')](_0x55eb0d));if(_0x55eb0d['error']){if(_0x55eb0d[_0xc89e('0x22')][_0xc89e('0x23')]===0x1f4){logger[_0xc89e('0x22')](_0xc89e('0x1d'),_0xac27b1,_0x55eb0d['error']['message']);return _0x39410d(_0x55eb0d['error'][_0xc89e('0x24')]);}logger[_0xc89e('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0xac27b1,_0x55eb0d['error'][_0xc89e('0x24')]);return _0x109c48(_0x55eb0d['error'][_0xc89e('0x24')]);}else{logger[_0xc89e('0x1c')](_0xc89e('0x1d'),_0xac27b1,'request\x20sent');_0x109c48(_0x55eb0d[_0xc89e('0x25')]['message']);}})['catch'](function(_0x5d6c5e){logger[_0xc89e('0x22')](_0xc89e('0x1d'),_0xac27b1,_0x5d6c5e);_0x39410d(_0x5d6c5e);});});}function respondWithStatusCode(_0x3a5929,_0x34220c){_0x34220c=_0x34220c||0xcc;return function(_0x5a357c){if(_0x5a357c){return _0x3a5929[_0xc89e('0x26')](_0x34220c);}return _0x3a5929['status'](_0x34220c)[_0xc89e('0x27')]();};}function respondWithResult(_0x11a94b,_0xc23938){_0xc23938=_0xc23938||0xc8;return function(_0x4299fd){if(_0x4299fd){return _0x11a94b[_0xc89e('0x28')](_0xc23938)['json'](_0x4299fd);}};}function respondWithFilteredResult(_0x4afc95,_0x41bd6c){return function(_0x37a327){if(_0x37a327){var _0xa72b06=_0x37a327[_0xc89e('0x29')],_0x3f5923=_0x41bd6c[_0xc89e('0x2a')],_0x418adf=_0x41bd6c[_0xc89e('0x2a')]+_0x41bd6c[_0xc89e('0x2b')],_0x12621d;if(_0x418adf>=_0xa72b06){_0x418adf=_0xa72b06;_0x12621d=0xc8;}else{_0x12621d=0xce;}_0x4afc95['status'](_0x12621d);return _0x4afc95['set'](_0xc89e('0x2c'),_0x3f5923+'-'+_0x418adf+'/'+_0xa72b06)['json'](_0x37a327);}return null;};}function patchUpdates(_0xb5bc14){return function(_0x287d2b){try{jsonpatch[_0xc89e('0x2d')](_0x287d2b,_0xb5bc14,!![]);}catch(_0x3cc972){return BPromise[_0xc89e('0x2e')](_0x3cc972);}return _0x287d2b[_0xc89e('0x2f')]();};}function saveUpdates(_0x193889,_0x33b034){return function(_0x490ff7){if(_0x490ff7){return _0x490ff7[_0xc89e('0x30')](_0x193889)[_0xc89e('0x1b')](function(_0x19edec){return _0x19edec;});}return null;};}function removeEntity(_0x3fb8fd,_0x6117e1){return function(_0x5620e0){if(_0x5620e0){return _0x5620e0[_0xc89e('0x31')]()[_0xc89e('0x1b')](function(){_0x3fb8fd[_0xc89e('0x28')](0xcc)[_0xc89e('0x27')]();});}};}function handleEntityNotFound(_0x2438fa,_0x323181){return function(_0x1e6568){if(!_0x1e6568){_0x2438fa[_0xc89e('0x26')](0x194);}return _0x1e6568;};}function handleError(_0x374480,_0x376a4a){_0x376a4a=_0x376a4a||0x1f4;return function(_0x1ab445){logger[_0xc89e('0x22')](_0x1ab445['stack']);if(_0x1ab445[_0xc89e('0x32')]){delete _0x1ab445[_0xc89e('0x32')];}_0x374480[_0xc89e('0x28')](_0x376a4a)[_0xc89e('0x33')](_0x1ab445);};}exports[_0xc89e('0x34')]=function(_0x2b5dc3,_0x5b7eff){var _0x56c245={},_0x293ebc={},_0x1ed5c3={'count':0x0,'rows':[]};var _0x23d720=_[_0xc89e('0x35')](db[_0xc89e('0x36')][_0xc89e('0x37')],function(_0x4673ce){return{'name':_0x4673ce[_0xc89e('0x38')],'type':_0x4673ce[_0xc89e('0x39')][_0xc89e('0x3a')]};});_0x293ebc[_0xc89e('0x3b')]=_[_0xc89e('0x35')](_0x23d720,_0xc89e('0x32'));_0x293ebc[_0xc89e('0x3c')]=_[_0xc89e('0x3d')](_0x2b5dc3[_0xc89e('0x3c')]);_0x293ebc[_0xc89e('0x3e')]=_['intersection'](_0x293ebc[_0xc89e('0x3b')],_0x293ebc[_0xc89e('0x3c')]);_0x56c245['attributes']=_[_0xc89e('0x3f')](_0x293ebc['model'],qs[_0xc89e('0x40')](_0x2b5dc3[_0xc89e('0x3c')][_0xc89e('0x40')]));_0x56c245[_0xc89e('0x41')]=_0x56c245[_0xc89e('0x41')]['length']?_0x56c245[_0xc89e('0x41')]:_0x293ebc['model'];if(!_0x2b5dc3['query'][_0xc89e('0x42')](_0xc89e('0x43'))){_0x56c245[_0xc89e('0x2b')]=qs['limit'](_0x2b5dc3[_0xc89e('0x3c')]['limit']);_0x56c245[_0xc89e('0x2a')]=qs['offset'](_0x2b5dc3[_0xc89e('0x3c')]['offset']);}_0x56c245[_0xc89e('0x44')]=qs['sort'](_0x2b5dc3['query']['sort']);_0x56c245[_0xc89e('0x45')]=qs[_0xc89e('0x3e')](_[_0xc89e('0x46')](_0x2b5dc3['query'],_0x293ebc[_0xc89e('0x3e')]),_0x23d720);if(_0x2b5dc3['query'][_0xc89e('0x47')]){_0x56c245[_0xc89e('0x45')]=_[_0xc89e('0x48')](_0x56c245['where'],{'$or':_[_0xc89e('0x35')](_0x23d720,function(_0xeaeae9){if(_0xeaeae9[_0xc89e('0x39')]!==_0xc89e('0x49')){var _0x38e732={};_0x38e732[_0xeaeae9['name']]={'$like':'%'+_0x2b5dc3['query'][_0xc89e('0x47')]+'%'};return _0x38e732;}})});}_0x56c245=_[_0xc89e('0x48')]({},_0x56c245,_0x2b5dc3['options']);var _0x2ed9a5={'where':_0x56c245[_0xc89e('0x45')]};return db['Dynamics365Account'][_0xc89e('0x29')](_0x2ed9a5)[_0xc89e('0x1b')](function(_0x2d583e){_0x1ed5c3[_0xc89e('0x29')]=_0x2d583e;if(_0x2b5dc3[_0xc89e('0x3c')]['includeAll']){_0x56c245['include']=[{'all':!![]}];}return db[_0xc89e('0x36')]['findAll'](_0x56c245);})[_0xc89e('0x1b')](function(_0x4626ba){_0x1ed5c3[_0xc89e('0x4a')]=_0x4626ba;return _0x1ed5c3;})['then'](respondWithFilteredResult(_0x5b7eff,_0x56c245))['catch'](handleError(_0x5b7eff,null));};exports[_0xc89e('0x4b')]=function(_0x2d5197,_0x224d33){var _0x193bf6={'raw':![],'where':{'id':_0x2d5197[_0xc89e('0x4c')]['id']}},_0x2d1171={};_0x2d1171[_0xc89e('0x3b')]=_[_0xc89e('0x3d')](db['Dynamics365Account'][_0xc89e('0x37')]);_0x2d1171[_0xc89e('0x3c')]=_[_0xc89e('0x3d')](_0x2d5197[_0xc89e('0x3c')]);_0x2d1171[_0xc89e('0x3e')]=_[_0xc89e('0x3f')](_0x2d1171['model'],_0x2d1171['query']);_0x193bf6['attributes']=_[_0xc89e('0x3f')](_0x2d1171[_0xc89e('0x3b')],qs['fields'](_0x2d5197[_0xc89e('0x3c')]['fields']));_0x193bf6[_0xc89e('0x41')]=_0x193bf6[_0xc89e('0x41')][_0xc89e('0x4d')]?_0x193bf6[_0xc89e('0x41')]:_0x2d1171[_0xc89e('0x3b')];if(_0x2d5197[_0xc89e('0x3c')]['includeAll']){_0x193bf6[_0xc89e('0x4e')]=[{'all':!![]}];}_0x193bf6=_['merge']({},_0x193bf6,_0x2d5197['options']);return db[_0xc89e('0x36')][_0xc89e('0x4f')](_0x193bf6)[_0xc89e('0x1b')](handleEntityNotFound(_0x224d33,null))['then'](respondWithResult(_0x224d33,null))['catch'](handleError(_0x224d33,null));};exports[_0xc89e('0x50')]=function(_0x48461e,_0x5dde16){return db[_0xc89e('0x36')][_0xc89e('0x50')](_0x48461e['body'],{})[_0xc89e('0x1b')](respondWithResult(_0x5dde16,0xc9))[_0xc89e('0x51')](handleError(_0x5dde16,null));};exports['update']=function(_0x1a3b3f,_0x1304f5){if(_0x1a3b3f[_0xc89e('0x52')]['id']){delete _0x1a3b3f[_0xc89e('0x52')]['id'];}return db[_0xc89e('0x36')]['find']({'where':{'id':_0x1a3b3f['params']['id']}})[_0xc89e('0x1b')](handleEntityNotFound(_0x1304f5,null))[_0xc89e('0x1b')](saveUpdates(_0x1a3b3f[_0xc89e('0x52')],null))[_0xc89e('0x1b')](respondWithResult(_0x1304f5,null))[_0xc89e('0x51')](handleError(_0x1304f5,null));};exports[_0xc89e('0x31')]=function(_0x3fc397,_0x3e5506){return db['Dynamics365Account'][_0xc89e('0x4f')]({'where':{'id':_0x3fc397[_0xc89e('0x4c')]['id']}})[_0xc89e('0x1b')](handleEntityNotFound(_0x3e5506,null))[_0xc89e('0x1b')](removeEntity(_0x3e5506,null))[_0xc89e('0x51')](handleError(_0x3e5506,null));};exports[_0xc89e('0x53')]=function(_0x36639d,_0xffd9bc,_0x579e76){var _0x108751={};var _0xd38397={};var _0x209fe5;var _0x5bb1bf;return db[_0xc89e('0x36')]['findOne']({'where':{'id':_0x36639d[_0xc89e('0x4c')]['id']}})['then'](handleEntityNotFound(_0xffd9bc,null))['then'](function(_0x450a92){if(_0x450a92){_0x209fe5=_0x450a92;_0xd38397[_0xc89e('0x3b')]=_['keys'](db[_0xc89e('0x54')]['rawAttributes']);_0xd38397[_0xc89e('0x3c')]=_[_0xc89e('0x3d')](_0x36639d[_0xc89e('0x3c')]);_0xd38397[_0xc89e('0x3e')]=_[_0xc89e('0x3f')](_0xd38397[_0xc89e('0x3b')],_0xd38397[_0xc89e('0x3c')]);_0x108751['attributes']=_[_0xc89e('0x3f')](_0xd38397[_0xc89e('0x3b')],qs['fields'](_0x36639d[_0xc89e('0x3c')][_0xc89e('0x40')]));_0x108751['attributes']=_0x108751[_0xc89e('0x41')][_0xc89e('0x4d')]?_0x108751[_0xc89e('0x41')]:_0xd38397[_0xc89e('0x3b')];_0x108751[_0xc89e('0x44')]=qs['sort'](_0x36639d['query'][_0xc89e('0x55')]);_0x108751[_0xc89e('0x45')]=qs[_0xc89e('0x3e')](_[_0xc89e('0x46')](_0x36639d['query'],_0xd38397[_0xc89e('0x3e')]));if(_0x36639d[_0xc89e('0x3c')][_0xc89e('0x47')]){_0x108751[_0xc89e('0x45')]=_[_0xc89e('0x48')](_0x108751[_0xc89e('0x45')],{'$or':_[_0xc89e('0x35')](_0x108751['attributes'],function(_0x3cfbfc){var _0x82eb6c={};_0x82eb6c[_0x3cfbfc]={'$like':'%'+_0x36639d[_0xc89e('0x3c')][_0xc89e('0x47')]+'%'};return _0x82eb6c;})});}_0x108751=_['merge']({},_0x108751,_0x36639d['options']);return _0x209fe5[_0xc89e('0x53')](_0x108751);}})[_0xc89e('0x1b')](function(_0x4f3e26){if(_0x4f3e26){_0x5bb1bf=_0x4f3e26['length'];if(!_0x36639d[_0xc89e('0x3c')][_0xc89e('0x42')](_0xc89e('0x43'))){_0x108751[_0xc89e('0x2b')]=qs[_0xc89e('0x2b')](_0x36639d[_0xc89e('0x3c')][_0xc89e('0x2b')]);_0x108751[_0xc89e('0x2a')]=qs['offset'](_0x36639d['query'][_0xc89e('0x2a')]);}return _0x209fe5[_0xc89e('0x53')](_0x108751);}})[_0xc89e('0x1b')](function(_0x2d093e){if(_0x2d093e){return _0x2d093e?{'count':_0x5bb1bf,'rows':_0x2d093e}:null;}})[_0xc89e('0x1b')](respondWithResult(_0xffd9bc,null))[_0xc89e('0x51')](handleError(_0xffd9bc,null));};exports[_0xc89e('0x56')]=function(_0x470cd6,_0x4e6743,_0x1b7a85){if(_0x470cd6['body']['id']){delete _0x470cd6['body']['id'];}return db['Dynamics365Account'][_0xc89e('0x57')]({'where':{'id':_0x470cd6['params']['id']}})['then'](handleEntityNotFound(_0x4e6743,null))[_0xc89e('0x1b')](function(_0x4b5ba5){if(_0x4b5ba5){_0x470cd6[_0xc89e('0x52')][_0xc89e('0x58')]=_0x4b5ba5['id'];_0x470cd6[_0xc89e('0x52')][_0xc89e('0x59')]=integrations['getSubjects'](_0x470cd6[_0xc89e('0x52')][_0xc89e('0x5a')],_0x470cd6[_0xc89e('0x52')]['type']);_0x470cd6['body'][_0xc89e('0x5b')]=integrations[_0xc89e('0x5c')](_0x470cd6[_0xc89e('0x52')]['channel'],_0x470cd6[_0xc89e('0x52')][_0xc89e('0x39')]);return db['Dynamics365Configuration'][_0xc89e('0x50')](_0x470cd6[_0xc89e('0x52')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xc89e('0x5d')],'as':_0xc89e('0x5b')}]});}return null;})['then'](respondWithResult(_0x4e6743,null))[_0xc89e('0x51')](handleError(_0x4e6743,null));};exports[_0xc89e('0x5e')]=function(_0x169a0c,_0x1e2214,_0x392cb7){var _0x5df681=_0x169a0c['query']['ticketType'];var _0x461f25=_0x5df681===_0xc89e('0x5f')?_0xc89e('0x60'):_0xc89e('0x61');var _0x464e87='';var _0x5ceca6='';var _0x50eaa9='';var _0x32aa98='';var _0xe722f2='';var _0x763465='';var _0x5a9740='';var _0x51b6a5='';var _0x42accb=[_0xc89e('0x62'),'description',_0xc89e('0x63'),'ownerid',_0xc89e('0x64'),_0xc89e('0x65'),_0xc89e('0x66'),'regardingobjectid','directioncode',_0xc89e('0x67')];var _0x54275f=['accountidname',_0xc89e('0x68'),'actualserviceunits',_0xc89e('0x69'),'contactidname',_0xc89e('0x6a'),_0xc89e('0x6b'),_0xc89e('0x6c'),_0xc89e('0x6d'),_0xc89e('0x6e'),_0xc89e('0x6f'),_0xc89e('0x70'),'createdon',_0xc89e('0x71'),'createdonbehalfbyyominame',_0xc89e('0x72'),_0xc89e('0x73'),_0xc89e('0x74'),'emailaddress',_0xc89e('0x75'),'entityimage_timestamp','entityimage_url',_0xc89e('0x76'),'exchangerate',_0xc89e('0x77'),'followupby',_0xc89e('0x78'),_0xc89e('0x79'),_0xc89e('0x7a'),_0xc89e('0x7b'),_0xc89e('0x7c'),_0xc89e('0x7d'),_0xc89e('0x7e'),_0xc89e('0x7f'),_0xc89e('0x80'),_0xc89e('0x81'),_0xc89e('0x82'),_0xc89e('0x83'),'msdyn_incidenttypename',_0xc89e('0x84'),_0xc89e('0x85'),_0xc89e('0x86'),_0xc89e('0x87'),_0xc89e('0x88'),'owneridtype',_0xc89e('0x89'),_0xc89e('0x8a'),_0xc89e('0x8b'),_0xc89e('0x8c'),_0xc89e('0x8d'),_0xc89e('0x8e'),_0xc89e('0x8f'),_0xc89e('0x90'),_0xc89e('0x91'),'responseby',_0xc89e('0x92'),_0xc89e('0x93'),_0xc89e('0x94'),'slainvokedidname','slaname',_0xc89e('0x95'),'statecode','statuscode',_0xc89e('0x96'),_0xc89e('0x97'),_0xc89e('0x98'),_0xc89e('0x99'),_0xc89e('0x9a'),_0xc89e('0x9b'),'versionnumber'];var _0x439bb8=_0x42accb[_0xc89e('0x9c')](_0x54275f);return db[_0xc89e('0x36')][_0xc89e('0x57')]({'where':{'id':_0x169a0c['params']['id']},'attributes':['id',_0xc89e('0x9d'),_0xc89e('0x9e'),_0xc89e('0x9f'),_0xc89e('0xa0'),_0xc89e('0xa1'),'clientSecret']})[_0xc89e('0x1b')](handleEntityNotFound(_0x1e2214,null))[_0xc89e('0x1b')](function(_0x19f905){if(_0x19f905){_0x51b6a5=_0x19f905['remoteUri'];var _0x182d64=_0x51b6a5[_0xc89e('0xa2')](-0x1);if(_0x182d64==='/'){_0x51b6a5=_0x51b6a5['substring'](0x0,_0x51b6a5[_0xc89e('0xa3')](_0x182d64));}_0x5a9740=util[_0xc89e('0xa4')](_0xc89e('0xa5'),_0x51b6a5);var _0x5c6711={'method':_0xc89e('0xa6'),'uri':_0xc89e('0xa7')+_0x19f905[_0xc89e('0xa0')]+'/oauth2/token','form':{'client_id':_0x19f905['clientId'],'resource':_0x51b6a5,'username':_0x19f905['username'],'password':_0x19f905[_0xc89e('0x9e')],'grant_type':_0xc89e('0x9e'),'client_secret':_0x19f905[_0xc89e('0xa8')]},'json':!![]};return rp(_0x5c6711);}})[_0xc89e('0x1b')](function(_0x5276f8){_0x763465=_0x5276f8[_0xc89e('0xa9')];var _0x227972={'method':_0xc89e('0xaa'),'uri':encodeURI(_0x5a9740+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x461f25+'\x27'),'headers':{'Authorization':_0xc89e('0xab')+_0x763465,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x227972);})['then'](function(_0x51deb1){var _0x50b97a=_0x51deb1[_0xc89e('0xac')][0x0];var _0x3ccdc4=_0x50b97a[_0xc89e('0xad')];var _0x32696c={'method':_0xc89e('0xaa'),'uri':_0x5a9740+_0xc89e('0xae')+_0x3ccdc4+_0xc89e('0xaf'),'headers':{'Authorization':_0xc89e('0xab')+_0x763465,'If-None-Match':null,'OData-Version':_0xc89e('0xb0')},'json':!![]};return rp(_0x32696c);})[_0xc89e('0x1b')](function(_0x2c78a2){_0x464e87=_0x2c78a2;_0x5ceca6=_0x464e87[_0xc89e('0xb1')];_0x5ceca6=_['remove'](_0x5ceca6,function(_0x28a6fc){return!_0x439bb8['includes'](_0x28a6fc[_0xc89e('0xb2')]);});var _0x3c0704=[];var _0x27c0dc=[];_0x5ceca6['forEach'](function(_0x59f359){if(_0x59f359['@odata.type']){var _0x2caa96=_0x59f359['@odata.type'][_0xc89e('0xb3')](_0x59f359[_0xc89e('0xb4')]['lastIndexOf']('.')+0x1);if(_0x2caa96===_0xc89e('0xb5')){_0x3c0704[_0xc89e('0xb6')](getSelectList(_0x5a9740,_0x5df681,_0x27c0dc,_0x464e87['MetadataId'],_0x59f359['MetadataId'],_0x763465));}}});return Promise[_0xc89e('0xb7')](_0x3c0704);})['then'](function(_0x7883e5){_0x50eaa9=_0x7883e5[0x0];var _0x298060=[];var _0xa296f3=[];_0x5ceca6[_0xc89e('0xb8')](function(_0x3e95f7){if(!_[_0xc89e('0xb9')](_0x3e95f7['@odata.type'])){var _0x5539d1=_0x3e95f7[_0xc89e('0xb4')][_0xc89e('0xb3')](_0x3e95f7[_0xc89e('0xb4')]['lastIndexOf']('.')+0x1);if(_0x5539d1===_0xc89e('0xba')){_0x298060[_0xc89e('0xb6')](getBooleanList(_0x5a9740,_0x5df681,_0xa296f3,_0x464e87['MetadataId'],_0x3e95f7['MetadataId'],_0x763465));}}});return Promise['all'](_0x298060);})[_0xc89e('0x1b')](function(_0x4c79ba){_0x32aa98=_0x4c79ba[0x0];var _0x4a1a4d=[];var _0x19d312=[];_0x5ceca6['forEach'](function(_0x252850){if(_0x252850[_0xc89e('0xb4')]){var _0x32bcae=_0x252850['@odata.type']['substring'](_0x252850[_0xc89e('0xb4')][_0xc89e('0xa3')]('.')+0x1);if(_0x32bcae===_0xc89e('0xbb')||_0x32bcae===_0xc89e('0xbc')||_0x32bcae===_0xc89e('0xbd')||_0x32bcae===_0xc89e('0xbe')||_0x32bcae===_0xc89e('0xbf')||_0x32bcae==='DateTimeAttributeMetadata'||_0x32bcae===_0xc89e('0xc0')||_0x32bcae==='EntityNameAttributeMetadata'||_0x32bcae===_0xc89e('0xc1')||_0x32bcae==='DecimalAttributeMetadata'){_0x4a1a4d[_0xc89e('0xb6')](getInputList(_0x5a9740,_0x5df681,_0x32bcae,_0x19d312,_0x464e87[_0xc89e('0xad')],_0x252850[_0xc89e('0xad')],_0x763465));}}});return Promise[_0xc89e('0xb7')](_0x4a1a4d);})[_0xc89e('0x1b')](function(_0x3fbb5d){_0xe722f2=_0x3fbb5d[0x0];var _0x2fcfd5=_0x50eaa9[_0xc89e('0x9c')](_0x32aa98)[_0xc89e('0x9c')](_0xe722f2);var _0x1506d6={'count':_0x2fcfd5[_0xc89e('0x4d')],'rows':_0x2fcfd5};return _0x1506d6;})['then'](respondWithResult(_0x1e2214,null))[_0xc89e('0x51')](function(_0x29d288){var _0x58bc05=_0x169a0c[_0xc89e('0x3c')][_0xc89e('0x16')]?0x1f4:_0x29d288[_0xc89e('0xc2')]||0x1f4;logger[_0xc89e('0x22')](_0x29d288[_0xc89e('0xc3')]);delete _0x29d288[_0xc89e('0x32')];if(_0x58bc05===0x191){_0x58bc05=0x190;}_0x1e2214[_0xc89e('0x28')](_0x58bc05)['send'](_0x169a0c[_0xc89e('0x3c')][_0xc89e('0x16')]?{'message':'Wrong\x20credentials','statusCode':_0x29d288[_0xc89e('0xc2')]}:_0x29d288);});};function getSelectList(_0xacd6dc,_0x11a854,_0x2600b7,_0x5bc502,_0x3efed2,_0x5e672e){var _0x54469d={'method':'GET','uri':_0xacd6dc+_0xc89e('0xae')+_0x5bc502+_0xc89e('0xc4')+_0x3efed2+_0xc89e('0xc5')+_0xc89e('0xc6'),'headers':{'Authorization':_0xc89e('0xab')+_0x5e672e,'If-None-Match':null,'OData-Version':_0xc89e('0xb0')},'json':!![]};return rp(_0x54469d)[_0xc89e('0x1b')](function(_0x3979d3){var _0x392bd5=[];var _0x45b699=_0x3979d3[_0xc89e('0xc7')][_0xc89e('0xc8')];_0x45b699[_0xc89e('0xb8')](function(_0x5ee379){_0x392bd5['push']({'name':_0x5ee379[_0xc89e('0xc9')][_0xc89e('0xca')][_0xc89e('0xc9')],'value':String(_0x5ee379[_0xc89e('0xcb')])});});var _0x33f246={'id':_0x11a854+'_'+_0x3979d3[_0xc89e('0xb2')],'name':_0x3979d3[_0xc89e('0xcc')][_0xc89e('0xca')][_0xc89e('0xc9')],'custom':![],'options':_0x392bd5};_0x2600b7['push'](_0x33f246);return _0x2600b7;});}function getBooleanList(_0x551927,_0x3af271,_0x1ef5f2,_0xfa660c,_0x31be0f,_0x5ab58f){var _0x435489={'method':_0xc89e('0xaa'),'uri':_0x551927+'EntityDefinitions('+_0xfa660c+_0xc89e('0xc4')+_0x31be0f+_0xc89e('0xcd'),'headers':{'Authorization':_0xc89e('0xab')+_0x5ab58f,'If-None-Match':null,'OData-Version':_0xc89e('0xb0')},'json':!![]};return rp(_0x435489)[_0xc89e('0x1b')](function(_0x447ee6){var _0x109533=[];_0x109533['push']({'name':_0x447ee6[_0xc89e('0xc7')][_0xc89e('0xce')][_0xc89e('0xc9')]['UserLocalizedLabel'][_0xc89e('0xc9')],'value':_0xc89e('0xcf')},{'name':_0x447ee6[_0xc89e('0xc7')][_0xc89e('0xd0')][_0xc89e('0xc9')][_0xc89e('0xca')]['Label'],'value':_0xc89e('0xd1')});var _0xbc1892={'id':_0x3af271+'_'+_0x447ee6[_0xc89e('0xb2')],'name':_0x447ee6[_0xc89e('0xcc')][_0xc89e('0xca')][_0xc89e('0xc9')],'custom':![],'options':_0x109533};_0x1ef5f2[_0xc89e('0xb6')](_0xbc1892);return _0x1ef5f2;});}function getInputList(_0x643ca5,_0xc56d88,_0x25b267,_0x3eb340,_0x39f1ff,_0x311dbd,_0xd724b0){var _0x3358c2={'method':_0xc89e('0xaa'),'uri':_0x643ca5+_0xc89e('0xae')+_0x39f1ff+_0xc89e('0xc4')+_0x311dbd+_0xc89e('0xd2')+_0x25b267+_0xc89e('0xd3'),'headers':{'Authorization':_0xc89e('0xab')+_0xd724b0,'If-None-Match':null,'OData-Version':_0xc89e('0xb0')},'json':!![]};return rp(_0x3358c2)[_0xc89e('0x1b')](function(_0x311bf4){var _0x2d976c={'id':_0xc56d88+'_'+_0x311bf4[_0xc89e('0xb2')],'name':_0x311bf4[_0xc89e('0xcc')]['UserLocalizedLabel']?_0x311bf4[_0xc89e('0xcc')][_0xc89e('0xca')][_0xc89e('0xc9')]:_0x311bf4['LogicalName'],'custom':![],'options':[]};_0x3eb340[_0xc89e('0xb6')](_0x2d976c);return _0x3eb340;});} \ No newline at end of file +var _0xb385=['filters','model','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','keys','fields','length','find','create','body','params','destroy','getConfigurations','Dynamics365Configuration','addConfiguration','AccountId','getSubjects','Descriptions','channel','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','findOne','remoteUri','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','POST','/oauth2/token','username','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','forEach','isNil','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../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','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','end','json','count','offset','limit','status','apply','reject','save','update','stack','name','send','index','Dynamics365Account','rawAttributes','type','key','query'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xb385,0xa1));var _0x5b38=function(_0x26cd81,_0x5e8ea2){_0x26cd81=_0x26cd81-0x0;var _0x502ca1=_0xb385[_0x26cd81];return _0x502ca1;};'use strict';var pdf=require(_0x5b38('0x0'));var emlformat=require(_0x5b38('0x1'));var rimraf=require(_0x5b38('0x2'));var zipdir=require(_0x5b38('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b38('0x4'));var moment=require('moment');var BPromise=require(_0x5b38('0x5'));var Mustache=require(_0x5b38('0x6'));var util=require(_0x5b38('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5b38('0x8'));var ejs=require(_0x5b38('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5b38('0xa'));var crypto=require(_0x5b38('0xb'));var jsforce=require(_0x5b38('0xc'));var deskjs=require(_0x5b38('0xd'));var toCsv=require(_0x5b38('0x8'));var querystring=require(_0x5b38('0xe'));var Papa=require(_0x5b38('0xf'));var Redis=require(_0x5b38('0x10'));var authService=require(_0x5b38('0x11'));var qs=require(_0x5b38('0x12'));var as=require(_0x5b38('0x13'));var hardwareService=require(_0x5b38('0x14'));var logger=require(_0x5b38('0x15'))(_0x5b38('0x16'));var utils=require(_0x5b38('0x17'));var config=require(_0x5b38('0x18'));var db=require(_0x5b38('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x5b38('0x1a'));var client=jayson[_0x5b38('0x1b')][_0x5b38('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2f8ce0,_0x1eec16,_0x3edbce){if(_0x3edbce){var _0x30fc8d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30fc8d[_0x5b38('0x1d')](_0x1eec16)){return _0x2f8ce0;}else{throw new db[(_0x5b38('0x1e'))][(_0x5b38('0x1f'))](_0x5b38('0x20'));}}else{return _0x2f8ce0;}}function respondWithRpcPromise(_0x497543,_0x3fc1a9,_0x31d310,_0x6deb5f){return new BPromise(function(_0x8c4a32,_0x821afb){var _0x442678=_0x6deb5f||client;return _0x442678[_0x5b38('0x21')](_0x497543,_0x31d310)[_0x5b38('0x22')](function(_0x5ae2c7){logger[_0x5b38('0x23')](_0x5b38('0x24'),_0x3fc1a9,_0x5b38('0x25'));logger[_0x5b38('0x26')](_0x5b38('0x27'),_0x3fc1a9,_0x5b38('0x25'),JSON['stringify'](_0x5ae2c7));if(_0x5ae2c7['error']){if(_0x5ae2c7[_0x5b38('0x28')][_0x5b38('0x29')]===0x1f4){logger['error'](_0x5b38('0x24'),_0x3fc1a9,_0x5ae2c7['error']['message']);return _0x821afb(_0x5ae2c7[_0x5b38('0x28')][_0x5b38('0x2a')]);}logger['error'](_0x5b38('0x24'),_0x3fc1a9,_0x5ae2c7[_0x5b38('0x28')]['message']);return _0x8c4a32(_0x5ae2c7['error'][_0x5b38('0x2a')]);}else{logger[_0x5b38('0x23')](_0x5b38('0x24'),_0x3fc1a9,_0x5b38('0x25'));_0x8c4a32(_0x5ae2c7['result']['message']);}})[_0x5b38('0x2b')](function(_0x33fdd8){logger[_0x5b38('0x28')](_0x5b38('0x24'),_0x3fc1a9,_0x33fdd8);_0x821afb(_0x33fdd8);});});}function respondWithStatusCode(_0x4d4055,_0x4281be){_0x4281be=_0x4281be||0xcc;return function(_0x25c1c0){if(_0x25c1c0){return _0x4d4055[_0x5b38('0x2c')](_0x4281be);}return _0x4d4055['status'](_0x4281be)[_0x5b38('0x2d')]();};}function respondWithResult(_0x17dfb0,_0x142f4a){_0x142f4a=_0x142f4a||0xc8;return function(_0x3df5a0){if(_0x3df5a0){return _0x17dfb0['status'](_0x142f4a)[_0x5b38('0x2e')](_0x3df5a0);}};}function respondWithFilteredResult(_0x59e001,_0x63bc95){return function(_0x5434dd){if(_0x5434dd){var _0x154f70=_0x5434dd[_0x5b38('0x2f')],_0x5bb0d7=_0x63bc95[_0x5b38('0x30')],_0x3e3065=_0x63bc95['offset']+_0x63bc95[_0x5b38('0x31')],_0x292810;if(_0x3e3065>=_0x154f70){_0x3e3065=_0x154f70;_0x292810=0xc8;}else{_0x292810=0xce;}_0x59e001[_0x5b38('0x32')](_0x292810);return _0x59e001['set']('Content-Range',_0x5bb0d7+'-'+_0x3e3065+'/'+_0x154f70)[_0x5b38('0x2e')](_0x5434dd);}return null;};}function patchUpdates(_0x3d8707){return function(_0xd7cd6f){try{jsonpatch[_0x5b38('0x33')](_0xd7cd6f,_0x3d8707,!![]);}catch(_0x3b16e3){return BPromise[_0x5b38('0x34')](_0x3b16e3);}return _0xd7cd6f[_0x5b38('0x35')]();};}function saveUpdates(_0x41cbf5,_0x19187b){return function(_0x3d9838){if(_0x3d9838){return _0x3d9838[_0x5b38('0x36')](_0x41cbf5)[_0x5b38('0x22')](function(_0x450312){return _0x450312;});}return null;};}function removeEntity(_0x2d43ad,_0x37730f){return function(_0x2c2fc4){if(_0x2c2fc4){return _0x2c2fc4['destroy']()[_0x5b38('0x22')](function(){_0x2d43ad[_0x5b38('0x32')](0xcc)[_0x5b38('0x2d')]();});}};}function handleEntityNotFound(_0x31be43,_0xf625b7){return function(_0x3701d4){if(!_0x3701d4){_0x31be43[_0x5b38('0x2c')](0x194);}return _0x3701d4;};}function handleError(_0x2d91a6,_0xc1cd19){_0xc1cd19=_0xc1cd19||0x1f4;return function(_0x57cf6a){logger[_0x5b38('0x28')](_0x57cf6a[_0x5b38('0x37')]);if(_0x57cf6a[_0x5b38('0x38')]){delete _0x57cf6a[_0x5b38('0x38')];}_0x2d91a6[_0x5b38('0x32')](_0xc1cd19)[_0x5b38('0x39')](_0x57cf6a);};}exports[_0x5b38('0x3a')]=function(_0x261da0,_0x75a90a){var _0xa5eae0={},_0x5db70f={},_0x5917d8={'count':0x0,'rows':[]};var _0x343278=_['map'](db[_0x5b38('0x3b')][_0x5b38('0x3c')],function(_0x273853){return{'name':_0x273853['fieldName'],'type':_0x273853[_0x5b38('0x3d')][_0x5b38('0x3e')]};});_0x5db70f['model']=_['map'](_0x343278,_0x5b38('0x38'));_0x5db70f[_0x5b38('0x3f')]=_['keys'](_0x261da0[_0x5b38('0x3f')]);_0x5db70f[_0x5b38('0x40')]=_['intersection'](_0x5db70f[_0x5b38('0x41')],_0x5db70f[_0x5b38('0x3f')]);_0xa5eae0['attributes']=_[_0x5b38('0x42')](_0x5db70f[_0x5b38('0x41')],qs['fields'](_0x261da0['query']['fields']));_0xa5eae0[_0x5b38('0x43')]=_0xa5eae0[_0x5b38('0x43')]['length']?_0xa5eae0[_0x5b38('0x43')]:_0x5db70f[_0x5b38('0x41')];if(!_0x261da0['query'][_0x5b38('0x44')](_0x5b38('0x45'))){_0xa5eae0[_0x5b38('0x31')]=qs['limit'](_0x261da0[_0x5b38('0x3f')][_0x5b38('0x31')]);_0xa5eae0['offset']=qs[_0x5b38('0x30')](_0x261da0[_0x5b38('0x3f')][_0x5b38('0x30')]);}_0xa5eae0[_0x5b38('0x46')]=qs[_0x5b38('0x47')](_0x261da0[_0x5b38('0x3f')][_0x5b38('0x47')]);_0xa5eae0[_0x5b38('0x48')]=qs['filters'](_[_0x5b38('0x49')](_0x261da0[_0x5b38('0x3f')],_0x5db70f[_0x5b38('0x40')]),_0x343278);if(_0x261da0[_0x5b38('0x3f')][_0x5b38('0x4a')]){_0xa5eae0[_0x5b38('0x48')]=_[_0x5b38('0x4b')](_0xa5eae0[_0x5b38('0x48')],{'$or':_[_0x5b38('0x4c')](_0x343278,function(_0x5d0385){if(_0x5d0385[_0x5b38('0x3d')]!==_0x5b38('0x4d')){var _0x401eab={};_0x401eab[_0x5d0385[_0x5b38('0x38')]]={'$like':'%'+_0x261da0[_0x5b38('0x3f')][_0x5b38('0x4a')]+'%'};return _0x401eab;}})});}_0xa5eae0=_[_0x5b38('0x4b')]({},_0xa5eae0,_0x261da0[_0x5b38('0x4e')]);var _0x5320d4={'where':_0xa5eae0[_0x5b38('0x48')]};return db['Dynamics365Account'][_0x5b38('0x2f')](_0x5320d4)[_0x5b38('0x22')](function(_0xd76082){_0x5917d8[_0x5b38('0x2f')]=_0xd76082;if(_0x261da0[_0x5b38('0x3f')][_0x5b38('0x4f')]){_0xa5eae0[_0x5b38('0x50')]=[{'all':!![]}];}return db[_0x5b38('0x3b')][_0x5b38('0x51')](_0xa5eae0);})[_0x5b38('0x22')](function(_0x203a3d){_0x5917d8[_0x5b38('0x52')]=_0x203a3d;return _0x5917d8;})[_0x5b38('0x22')](respondWithFilteredResult(_0x75a90a,_0xa5eae0))[_0x5b38('0x2b')](handleError(_0x75a90a,null));};exports['show']=function(_0x4dbeb,_0x257e73){var _0xd5c6cd={'raw':![],'where':{'id':_0x4dbeb['params']['id']}},_0x46d879={};_0x46d879[_0x5b38('0x41')]=_[_0x5b38('0x53')](db[_0x5b38('0x3b')][_0x5b38('0x3c')]);_0x46d879[_0x5b38('0x3f')]=_[_0x5b38('0x53')](_0x4dbeb[_0x5b38('0x3f')]);_0x46d879[_0x5b38('0x40')]=_['intersection'](_0x46d879[_0x5b38('0x41')],_0x46d879[_0x5b38('0x3f')]);_0xd5c6cd[_0x5b38('0x43')]=_['intersection'](_0x46d879[_0x5b38('0x41')],qs[_0x5b38('0x54')](_0x4dbeb[_0x5b38('0x3f')]['fields']));_0xd5c6cd['attributes']=_0xd5c6cd['attributes'][_0x5b38('0x55')]?_0xd5c6cd[_0x5b38('0x43')]:_0x46d879['model'];if(_0x4dbeb[_0x5b38('0x3f')][_0x5b38('0x4f')]){_0xd5c6cd[_0x5b38('0x50')]=[{'all':!![]}];}_0xd5c6cd=_[_0x5b38('0x4b')]({},_0xd5c6cd,_0x4dbeb[_0x5b38('0x4e')]);return db[_0x5b38('0x3b')][_0x5b38('0x56')](_0xd5c6cd)['then'](handleEntityNotFound(_0x257e73,null))[_0x5b38('0x22')](respondWithResult(_0x257e73,null))[_0x5b38('0x2b')](handleError(_0x257e73,null));};exports[_0x5b38('0x57')]=function(_0x51fdbe,_0x12c788){return db[_0x5b38('0x3b')][_0x5b38('0x57')](_0x51fdbe[_0x5b38('0x58')],{})['then'](respondWithResult(_0x12c788,0xc9))[_0x5b38('0x2b')](handleError(_0x12c788,null));};exports['update']=function(_0x3cca8d,_0xff59d0){if(_0x3cca8d[_0x5b38('0x58')]['id']){delete _0x3cca8d[_0x5b38('0x58')]['id'];}return db['Dynamics365Account'][_0x5b38('0x56')]({'where':{'id':_0x3cca8d[_0x5b38('0x59')]['id']}})[_0x5b38('0x22')](handleEntityNotFound(_0xff59d0,null))[_0x5b38('0x22')](saveUpdates(_0x3cca8d[_0x5b38('0x58')],null))[_0x5b38('0x22')](respondWithResult(_0xff59d0,null))[_0x5b38('0x2b')](handleError(_0xff59d0,null));};exports[_0x5b38('0x5a')]=function(_0x20434e,_0x4ef9fc){return db[_0x5b38('0x3b')]['find']({'where':{'id':_0x20434e[_0x5b38('0x59')]['id']}})[_0x5b38('0x22')](handleEntityNotFound(_0x4ef9fc,null))[_0x5b38('0x22')](removeEntity(_0x4ef9fc,null))[_0x5b38('0x2b')](handleError(_0x4ef9fc,null));};exports[_0x5b38('0x5b')]=function(_0x1c2ad7,_0x29513f,_0x2e6bb5){var _0x2f9877={};var _0x502ee3={};var _0x5ea059;var _0x397ee5;return db[_0x5b38('0x3b')]['findOne']({'where':{'id':_0x1c2ad7[_0x5b38('0x59')]['id']}})[_0x5b38('0x22')](handleEntityNotFound(_0x29513f,null))[_0x5b38('0x22')](function(_0x3ab822){if(_0x3ab822){_0x5ea059=_0x3ab822;_0x502ee3[_0x5b38('0x41')]=_[_0x5b38('0x53')](db[_0x5b38('0x5c')][_0x5b38('0x3c')]);_0x502ee3['query']=_['keys'](_0x1c2ad7[_0x5b38('0x3f')]);_0x502ee3['filters']=_[_0x5b38('0x42')](_0x502ee3[_0x5b38('0x41')],_0x502ee3[_0x5b38('0x3f')]);_0x2f9877[_0x5b38('0x43')]=_[_0x5b38('0x42')](_0x502ee3['model'],qs['fields'](_0x1c2ad7[_0x5b38('0x3f')][_0x5b38('0x54')]));_0x2f9877[_0x5b38('0x43')]=_0x2f9877[_0x5b38('0x43')][_0x5b38('0x55')]?_0x2f9877[_0x5b38('0x43')]:_0x502ee3['model'];_0x2f9877['order']=qs[_0x5b38('0x47')](_0x1c2ad7[_0x5b38('0x3f')][_0x5b38('0x47')]);_0x2f9877[_0x5b38('0x48')]=qs[_0x5b38('0x40')](_[_0x5b38('0x49')](_0x1c2ad7[_0x5b38('0x3f')],_0x502ee3[_0x5b38('0x40')]));if(_0x1c2ad7[_0x5b38('0x3f')]['filter']){_0x2f9877[_0x5b38('0x48')]=_['merge'](_0x2f9877[_0x5b38('0x48')],{'$or':_[_0x5b38('0x4c')](_0x2f9877['attributes'],function(_0x5d3647){var _0x5029be={};_0x5029be[_0x5d3647]={'$like':'%'+_0x1c2ad7[_0x5b38('0x3f')][_0x5b38('0x4a')]+'%'};return _0x5029be;})});}_0x2f9877=_[_0x5b38('0x4b')]({},_0x2f9877,_0x1c2ad7[_0x5b38('0x4e')]);return _0x5ea059[_0x5b38('0x5b')](_0x2f9877);}})[_0x5b38('0x22')](function(_0x50399f){if(_0x50399f){_0x397ee5=_0x50399f['length'];if(!_0x1c2ad7[_0x5b38('0x3f')][_0x5b38('0x44')](_0x5b38('0x45'))){_0x2f9877[_0x5b38('0x31')]=qs[_0x5b38('0x31')](_0x1c2ad7[_0x5b38('0x3f')]['limit']);_0x2f9877[_0x5b38('0x30')]=qs['offset'](_0x1c2ad7['query'][_0x5b38('0x30')]);}return _0x5ea059[_0x5b38('0x5b')](_0x2f9877);}})[_0x5b38('0x22')](function(_0x46412e){if(_0x46412e){return _0x46412e?{'count':_0x397ee5,'rows':_0x46412e}:null;}})['then'](respondWithResult(_0x29513f,null))[_0x5b38('0x2b')](handleError(_0x29513f,null));};exports[_0x5b38('0x5d')]=function(_0x17f1d6,_0x3f4ef8,_0x35d8fa){if(_0x17f1d6[_0x5b38('0x58')]['id']){delete _0x17f1d6['body']['id'];}return db[_0x5b38('0x3b')]['findOne']({'where':{'id':_0x17f1d6[_0x5b38('0x59')]['id']}})[_0x5b38('0x22')](handleEntityNotFound(_0x3f4ef8,null))[_0x5b38('0x22')](function(_0x1df354){if(_0x1df354){_0x17f1d6[_0x5b38('0x58')][_0x5b38('0x5e')]=_0x1df354['id'];_0x17f1d6[_0x5b38('0x58')]['Subjects']=integrations[_0x5b38('0x5f')](_0x17f1d6[_0x5b38('0x58')]['channel'],_0x17f1d6[_0x5b38('0x58')][_0x5b38('0x3d')]);_0x17f1d6['body'][_0x5b38('0x60')]=integrations['getDescriptions'](_0x17f1d6[_0x5b38('0x58')][_0x5b38('0x61')],_0x17f1d6[_0x5b38('0x58')][_0x5b38('0x3d')]);return db[_0x5b38('0x5c')][_0x5b38('0x57')](_0x17f1d6[_0x5b38('0x58')],{'include':[{'model':db[_0x5b38('0x62')],'as':_0x5b38('0x63')},{'model':db['Dynamics365Field'],'as':'Descriptions'}]});}return null;})[_0x5b38('0x22')](respondWithResult(_0x3f4ef8,null))[_0x5b38('0x2b')](handleError(_0x3f4ef8,null));};exports[_0x5b38('0x64')]=function(_0x177232,_0x380981,_0x1b7f86){var _0x109349=_0x177232[_0x5b38('0x3f')][_0x5b38('0x65')];var _0x3130cd=_0x109349===_0x5b38('0x66')?_0x5b38('0x67'):_0x5b38('0x68');var _0x19f4dd='';var _0x444496='';var _0x20ffc7='';var _0x205025='';var _0x51c6f3='';var _0x278ac7='';var _0x156024='';var _0x174f20='';var _0xaf099e=[_0x5b38('0x69'),'description',_0x5b38('0x6a'),_0x5b38('0x6b'),_0x5b38('0x6c'),_0x5b38('0x6d'),'phonenumber','regardingobjectid',_0x5b38('0x6e'),'phonecall_activity_parties'];var _0x419c48=[_0x5b38('0x6f'),_0x5b38('0x70'),_0x5b38('0x71'),_0x5b38('0x72'),'contactidname',_0x5b38('0x73'),_0x5b38('0x74'),_0x5b38('0x75'),_0x5b38('0x76'),_0x5b38('0x77'),'createdbyname',_0x5b38('0x78'),_0x5b38('0x79'),_0x5b38('0x7a'),_0x5b38('0x7b'),_0x5b38('0x7c'),_0x5b38('0x7d'),_0x5b38('0x7e'),_0x5b38('0x7f'),_0x5b38('0x80'),_0x5b38('0x81'),_0x5b38('0x82'),_0x5b38('0x83'),_0x5b38('0x84'),_0x5b38('0x85'),'followupby',_0x5b38('0x86'),_0x5b38('0x87'),_0x5b38('0x88'),_0x5b38('0x89'),_0x5b38('0x8a'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0x5b38('0x8b'),_0x5b38('0x8c'),'modifiedon',_0x5b38('0x8d'),'modifiedonbehalfbyyominame',_0x5b38('0x8e'),_0x5b38('0x8f'),_0x5b38('0x90'),_0x5b38('0x91'),_0x5b38('0x92'),_0x5b38('0x93'),'owneridtype',_0x5b38('0x94'),_0x5b38('0x95'),_0x5b38('0x96'),'primarycontactidyominame',_0x5b38('0x97'),_0x5b38('0x98'),_0x5b38('0x99'),_0x5b38('0x9a'),_0x5b38('0x9b'),_0x5b38('0x9c'),_0x5b38('0x9d'),_0x5b38('0x9e'),_0x5b38('0x9f'),'slainvokedidname',_0x5b38('0xa0'),_0x5b38('0xa1'),'statecode',_0x5b38('0xa2'),_0x5b38('0xa3'),_0x5b38('0xa4'),_0x5b38('0xa5'),_0x5b38('0xa6'),_0x5b38('0xa7'),'utcconversiontimezonecode',_0x5b38('0xa8')];var _0x157248=_0xaf099e[_0x5b38('0xa9')](_0x419c48);return db[_0x5b38('0x3b')][_0x5b38('0xaa')]({'where':{'id':_0x177232[_0x5b38('0x59')]['id']},'attributes':['id','username','password',_0x5b38('0xab'),_0x5b38('0xac'),_0x5b38('0xad'),_0x5b38('0xae')]})[_0x5b38('0x22')](handleEntityNotFound(_0x380981,null))[_0x5b38('0x22')](function(_0x3ef3cf){if(_0x3ef3cf){_0x174f20=_0x3ef3cf['remoteUri'];var _0x532d02=_0x174f20[_0x5b38('0xaf')](-0x1);if(_0x532d02==='/'){_0x174f20=_0x174f20[_0x5b38('0xb0')](0x0,_0x174f20[_0x5b38('0xb1')](_0x532d02));}_0x156024=util[_0x5b38('0xb2')]('%s/api/data/v9.0/',_0x174f20);var _0x6cfefc={'method':_0x5b38('0xb3'),'uri':'https://login.microsoftonline.com/'+_0x3ef3cf[_0x5b38('0xac')]+_0x5b38('0xb4'),'form':{'client_id':_0x3ef3cf[_0x5b38('0xad')],'resource':_0x174f20,'username':_0x3ef3cf[_0x5b38('0xb5')],'password':_0x3ef3cf[_0x5b38('0xb6')],'grant_type':'password','client_secret':_0x3ef3cf[_0x5b38('0xae')]},'json':!![]};return rp(_0x6cfefc);}})['then'](function(_0x32d4f9){_0x278ac7=_0x32d4f9[_0x5b38('0xb7')];var _0xe2ce38={'method':_0x5b38('0xb8'),'uri':encodeURI(_0x156024+_0x5b38('0xb9')+_0x3130cd+'\x27'),'headers':{'Authorization':_0x5b38('0xba')+_0x278ac7,'If-None-Match':null,'OData-Version':_0x5b38('0xbb')},'json':!![]};return rp(_0xe2ce38);})[_0x5b38('0x22')](function(_0x46eda9){var _0x155639=_0x46eda9[_0x5b38('0xbc')][0x0];var _0x5b75ee=_0x155639[_0x5b38('0xbd')];var _0x35ad78={'method':_0x5b38('0xb8'),'uri':_0x156024+_0x5b38('0xbe')+_0x5b75ee+_0x5b38('0xbf'),'headers':{'Authorization':_0x5b38('0xba')+_0x278ac7,'If-None-Match':null,'OData-Version':_0x5b38('0xbb')},'json':!![]};return rp(_0x35ad78);})[_0x5b38('0x22')](function(_0x233812){_0x19f4dd=_0x233812;_0x444496=_0x19f4dd[_0x5b38('0xc0')];_0x444496=_[_0x5b38('0xc1')](_0x444496,function(_0x377cab){return!_0x157248[_0x5b38('0xc2')](_0x377cab[_0x5b38('0xc3')]);});var _0x2a6a88=[];var _0x809928=[];_0x444496['forEach'](function(_0x5d5f34){if(_0x5d5f34['@odata.type']){var _0xe0652a=_0x5d5f34[_0x5b38('0xc4')][_0x5b38('0xb0')](_0x5d5f34[_0x5b38('0xc4')][_0x5b38('0xb1')]('.')+0x1);if(_0xe0652a===_0x5b38('0xc5')){_0x2a6a88[_0x5b38('0xc6')](getSelectList(_0x156024,_0x109349,_0x809928,_0x19f4dd[_0x5b38('0xbd')],_0x5d5f34[_0x5b38('0xbd')],_0x278ac7));}}});return Promise[_0x5b38('0xc7')](_0x2a6a88);})[_0x5b38('0x22')](function(_0x215b95){_0x20ffc7=_0x215b95[0x0];var _0x483bca=[];var _0x369afd=[];_0x444496[_0x5b38('0xc8')](function(_0xc704e4){if(!_[_0x5b38('0xc9')](_0xc704e4['@odata.type'])){var _0x3e9fa1=_0xc704e4[_0x5b38('0xc4')][_0x5b38('0xb0')](_0xc704e4[_0x5b38('0xc4')][_0x5b38('0xb1')]('.')+0x1);if(_0x3e9fa1==='BooleanAttributeMetadata'){_0x483bca['push'](getBooleanList(_0x156024,_0x109349,_0x369afd,_0x19f4dd[_0x5b38('0xbd')],_0xc704e4[_0x5b38('0xbd')],_0x278ac7));}}});return Promise[_0x5b38('0xc7')](_0x483bca);})[_0x5b38('0x22')](function(_0x2e2a96){_0x205025=_0x2e2a96[0x0];var _0x254dc9=[];var _0x19ebe7=[];_0x444496[_0x5b38('0xc8')](function(_0x3cfb45){if(_0x3cfb45[_0x5b38('0xc4')]){var _0x53c998=_0x3cfb45[_0x5b38('0xc4')]['substring'](_0x3cfb45[_0x5b38('0xc4')][_0x5b38('0xb1')]('.')+0x1);if(_0x53c998==='StringAttributeMetadata'||_0x53c998==='DoubleAttributeMetadata'||_0x53c998===_0x5b38('0xca')||_0x53c998===_0x5b38('0xcb')||_0x53c998===_0x5b38('0xcc')||_0x53c998===_0x5b38('0xcd')||_0x53c998===_0x5b38('0xce')||_0x53c998==='EntityNameAttributeMetadata'||_0x53c998===_0x5b38('0xcf')||_0x53c998===_0x5b38('0xd0')){_0x254dc9[_0x5b38('0xc6')](getInputList(_0x156024,_0x109349,_0x53c998,_0x19ebe7,_0x19f4dd[_0x5b38('0xbd')],_0x3cfb45[_0x5b38('0xbd')],_0x278ac7));}}});return Promise[_0x5b38('0xc7')](_0x254dc9);})['then'](function(_0x3960fb){_0x51c6f3=_0x3960fb[0x0];var _0x2c17bc=_0x20ffc7[_0x5b38('0xa9')](_0x205025)[_0x5b38('0xa9')](_0x51c6f3);var _0xcb2a63={'count':_0x2c17bc[_0x5b38('0x55')],'rows':_0x2c17bc};return _0xcb2a63;})['then'](respondWithResult(_0x380981,null))['catch'](function(_0x2e272f){var _0x348f64=_0x177232['query'][_0x5b38('0x1d')]?0x1f4:_0x2e272f[_0x5b38('0xd1')]||0x1f4;logger['error'](_0x2e272f['stack']);delete _0x2e272f[_0x5b38('0x38')];if(_0x348f64===0x191){_0x348f64=0x190;}_0x380981[_0x5b38('0x32')](_0x348f64)[_0x5b38('0x39')](_0x177232['query'][_0x5b38('0x1d')]?{'message':_0x5b38('0xd2'),'statusCode':_0x2e272f[_0x5b38('0xd1')]}:_0x2e272f);});};function getSelectList(_0x47de2c,_0x2c9497,_0x31cd2e,_0x135e5d,_0xbfefa3,_0x585a4a){var _0x4b864c={'method':'GET','uri':_0x47de2c+_0x5b38('0xbe')+_0x135e5d+_0x5b38('0xd3')+_0xbfefa3+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x5b38('0xd4'),'headers':{'Authorization':'Bearer\x20'+_0x585a4a,'If-None-Match':null,'OData-Version':_0x5b38('0xbb')},'json':!![]};return rp(_0x4b864c)[_0x5b38('0x22')](function(_0x51ecc8){var _0x9e832b=[];var _0x284e53=_0x51ecc8[_0x5b38('0xd5')][_0x5b38('0xd6')];_0x284e53[_0x5b38('0xc8')](function(_0x1ebce4){_0x9e832b[_0x5b38('0xc6')]({'name':_0x1ebce4[_0x5b38('0xd7')][_0x5b38('0xd8')][_0x5b38('0xd7')],'value':String(_0x1ebce4[_0x5b38('0xd9')])});});var _0x491813={'id':_0x2c9497+'_'+_0x51ecc8['LogicalName'],'name':_0x51ecc8['DisplayName'][_0x5b38('0xd8')][_0x5b38('0xd7')],'custom':![],'options':_0x9e832b};_0x31cd2e[_0x5b38('0xc6')](_0x491813);return _0x31cd2e;});}function getBooleanList(_0x4dde43,_0x5b2d25,_0x431e38,_0xd43c28,_0x2ad631,_0x2dc719){var _0x239da6={'method':'GET','uri':_0x4dde43+'EntityDefinitions('+_0xd43c28+_0x5b38('0xd3')+_0x2ad631+_0x5b38('0xda'),'headers':{'Authorization':_0x5b38('0xba')+_0x2dc719,'If-None-Match':null,'OData-Version':_0x5b38('0xbb')},'json':!![]};return rp(_0x239da6)[_0x5b38('0x22')](function(_0x24455a){var _0xac67bd=[];_0xac67bd[_0x5b38('0xc6')]({'name':_0x24455a[_0x5b38('0xd5')][_0x5b38('0xdb')]['Label']['UserLocalizedLabel'][_0x5b38('0xd7')],'value':_0x5b38('0xdc')},{'name':_0x24455a[_0x5b38('0xd5')][_0x5b38('0xdd')][_0x5b38('0xd7')]['UserLocalizedLabel'][_0x5b38('0xd7')],'value':'false'});var _0x57c3a3={'id':_0x5b2d25+'_'+_0x24455a[_0x5b38('0xc3')],'name':_0x24455a[_0x5b38('0xde')][_0x5b38('0xd8')][_0x5b38('0xd7')],'custom':![],'options':_0xac67bd};_0x431e38[_0x5b38('0xc6')](_0x57c3a3);return _0x431e38;});}function getInputList(_0x39d1f9,_0x52b59b,_0x17a290,_0x51ba31,_0x2a6daf,_0x566d30,_0x378d4c){var _0x57a5bd={'method':_0x5b38('0xb8'),'uri':_0x39d1f9+_0x5b38('0xbe')+_0x2a6daf+')/Attributes('+_0x566d30+_0x5b38('0xdf')+_0x17a290+_0x5b38('0xe0'),'headers':{'Authorization':_0x5b38('0xba')+_0x378d4c,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x57a5bd)[_0x5b38('0x22')](function(_0x51310c){var _0x310431={'id':_0x52b59b+'_'+_0x51310c[_0x5b38('0xc3')],'name':_0x51310c[_0x5b38('0xde')][_0x5b38('0xd8')]?_0x51310c[_0x5b38('0xde')][_0x5b38('0xd8')]['Label']:_0x51310c[_0x5b38('0xc3')],'custom':![],'options':[]};_0x51ba31[_0x5b38('0xc6')](_0x310431);return _0x51ba31;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 368660e..6477d9c 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 _0x8d41=['bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','int_dynamics365_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x8d41,0x167));var _0x18d4=function(_0x99302a,_0xc71da9){_0x99302a=_0x99302a-0x0;var _0x3273ff=_0x8d41[_0x99302a];return _0x3273ff;};'use strict';var _=require(_0x18d4('0x0'));var util=require(_0x18d4('0x1'));var logger=require(_0x18d4('0x2'))(_0x18d4('0x3'));var moment=require(_0x18d4('0x4'));var BPromise=require(_0x18d4('0x5'));var rp=require(_0x18d4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x18d4('0x7'));var config=require(_0x18d4('0x8'));var attributes=require(_0x18d4('0x9'));var integrations=require(_0x18d4('0xa'));module[_0x18d4('0xb')]=function(_0x2d5381,_0x396f5c){return _0x2d5381[_0x18d4('0xc')]('Dynamics365Account',attributes,{'tableName':_0x18d4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe24e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define','Dynamics365Account','lodash'];(function(_0x1adf4a,_0x55d81f){var _0x20c377=function(_0x484abb){while(--_0x484abb){_0x1adf4a['push'](_0x1adf4a['shift']());}};_0x20c377(++_0x55d81f);}(_0xe24e,0x15f));var _0xee24=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xe24e[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xee24('0x0'));var util=require(_0xee24('0x1'));var logger=require(_0xee24('0x2'))(_0xee24('0x3'));var moment=require(_0xee24('0x4'));var BPromise=require(_0xee24('0x5'));var rp=require(_0xee24('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee24('0x7'));var config=require('../../config/environment');var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0xee24('0x8')]=function(_0x20c8a0,_0x44f46c){return _0x20c8a0[_0xee24('0x9')](_0xee24('0xa'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 36e12a1..67eadb1 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 _0x02b6=['bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit','include','map','model','ShowDynamics365Account','find','lodash','moment'];(function(_0xa2111d,_0x559308){var _0x541547=function(_0x2b4c36){while(--_0x2b4c36){_0xa2111d['push'](_0xa2111d['shift']());}};_0x541547(++_0x559308);}(_0x02b6,0xfe));var _0x602b=function(_0x3ab950,_0x143d8f){_0x3ab950=_0x3ab950-0x0;var _0x4ab72b=_0x02b6[_0x3ab950];return _0x4ab72b;};'use strict';var _=require(_0x602b('0x0'));var util=require('util');var moment=require(_0x602b('0x1'));var BPromise=require(_0x602b('0x2'));var rs=require(_0x602b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x602b('0x4'));var logger=require(_0x602b('0x5'))(_0x602b('0x6'));var config=require(_0x602b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x602b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x265e3b,_0xac6c85,_0x140c8a){return new BPromise(function(_0x1edb2d,_0x51f151){return client[_0x602b('0x9')](_0x265e3b,_0x140c8a)[_0x602b('0xa')](function(_0x3a9579){logger[_0x602b('0xb')](_0x602b('0xc'),_0xac6c85,'request\x20sent');logger[_0x602b('0xd')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0xac6c85,'request\x20sent',JSON[_0x602b('0xe')](_0x3a9579));if(_0x3a9579['error']){if(_0x3a9579[_0x602b('0xf')][_0x602b('0x10')]===0x1f4){logger['error'](_0x602b('0xc'),_0xac6c85,_0x3a9579[_0x602b('0xf')][_0x602b('0x11')]);return _0x51f151(_0x3a9579['error'][_0x602b('0x11')]);}logger[_0x602b('0xf')](_0x602b('0xc'),_0xac6c85,_0x3a9579[_0x602b('0xf')][_0x602b('0x11')]);return _0x1edb2d(_0x3a9579[_0x602b('0xf')][_0x602b('0x11')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0xac6c85,_0x602b('0x12'));_0x1edb2d(_0x3a9579[_0x602b('0x13')][_0x602b('0x11')]);}})[_0x602b('0x14')](function(_0x2aed6b){logger[_0x602b('0xf')](_0x602b('0xc'),_0xac6c85,_0x2aed6b);_0x51f151(_0x2aed6b);});});}exports[_0x602b('0x15')]=function(_0x46758d){var _0x57057c=this;return new Promise(function(_0x48d992,_0x7dd35d){return db[_0x602b('0x16')]['findAll']({'raw':_0x46758d[_0x602b('0x17')]?_0x46758d['options']['raw']===undefined?!![]:![]:!![],'where':_0x46758d[_0x602b('0x17')]?_0x46758d['options'][_0x602b('0x18')]||null:null,'attributes':_0x46758d['options']?_0x46758d[_0x602b('0x17')][_0x602b('0x19')]||null:null,'limit':_0x46758d[_0x602b('0x17')]?_0x46758d['options'][_0x602b('0x1a')]||null:null,'include':_0x46758d[_0x602b('0x17')]?_0x46758d['options'][_0x602b('0x1b')]?_[_0x602b('0x1c')](_0x46758d[_0x602b('0x17')][_0x602b('0x1b')],function(_0x8510cf){return{'model':db[_0x8510cf[_0x602b('0x1d')]],'as':_0x8510cf['as'],'attributes':_0x8510cf[_0x602b('0x19')],'include':_0x8510cf[_0x602b('0x1b')]?_[_0x602b('0x1c')](_0x8510cf['include'],function(_0x43acc3){return{'model':db[_0x43acc3[_0x602b('0x1d')]],'as':_0x43acc3['as'],'attributes':_0x43acc3['attributes'],'include':_0x43acc3[_0x602b('0x1b')]?_[_0x602b('0x1c')](_0x43acc3['include'],function(_0x11dfd5){return{'model':db[_0x11dfd5[_0x602b('0x1d')]],'as':_0x11dfd5['as'],'attributes':_0x11dfd5[_0x602b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x602b('0xa')](function(_0xc4a556){logger[_0x602b('0xb')](_0x602b('0x15'),_0x46758d);logger[_0x602b('0xd')](_0x602b('0x15'),_0x46758d,JSON[_0x602b('0xe')](_0xc4a556));_0x48d992(_0xc4a556);})[_0x602b('0x14')](function(_0x529fa8){logger[_0x602b('0xf')]('GetDynamics365Account',_0x529fa8[_0x602b('0x11')],_0x46758d);_0x7dd35d(_0x57057c[_0x602b('0xf')](0x1f4,_0x529fa8[_0x602b('0x11')]));});});};exports[_0x602b('0x1e')]=function(_0x32b9b7){var _0x3647cf=this;return new Promise(function(_0x12b379,_0xdf4648){return db[_0x602b('0x16')][_0x602b('0x1f')]({'raw':_0x32b9b7[_0x602b('0x17')]?_0x32b9b7['options']['raw']===undefined?!![]:![]:!![],'where':_0x32b9b7[_0x602b('0x17')]?_0x32b9b7[_0x602b('0x17')][_0x602b('0x18')]||null:null,'attributes':_0x32b9b7[_0x602b('0x17')]?_0x32b9b7['options'][_0x602b('0x19')]||null:null,'include':_0x32b9b7[_0x602b('0x17')]?_0x32b9b7[_0x602b('0x17')]['include']?_[_0x602b('0x1c')](_0x32b9b7[_0x602b('0x17')][_0x602b('0x1b')],function(_0x5cca49){return{'model':db[_0x5cca49['model']],'as':_0x5cca49['as'],'attributes':_0x5cca49[_0x602b('0x19')],'include':_0x5cca49['include']?_[_0x602b('0x1c')](_0x5cca49[_0x602b('0x1b')],function(_0x19a4d4){return{'model':db[_0x19a4d4[_0x602b('0x1d')]],'as':_0x19a4d4['as'],'attributes':_0x19a4d4[_0x602b('0x19')],'include':_0x19a4d4[_0x602b('0x1b')]?_['map'](_0x19a4d4[_0x602b('0x1b')],function(_0x22a179){return{'model':db[_0x22a179[_0x602b('0x1d')]],'as':_0x22a179['as'],'attributes':_0x22a179['attributes']};}):[]};}):[]};}):[]:[]})[_0x602b('0xa')](function(_0x4b287b){logger[_0x602b('0xb')](_0x602b('0x1e'),_0x32b9b7);logger['debug']('ShowDynamics365Account',_0x32b9b7,JSON['stringify'](_0x4b287b));_0x12b379(_0x4b287b);})[_0x602b('0x14')](function(_0x199e7b){logger[_0x602b('0xf')](_0x602b('0x1e'),_0x199e7b[_0x602b('0x11')],_0x32b9b7);_0xdf4648(_0x3647cf[_0x602b('0xf')](0x1f4,_0x199e7b[_0x602b('0x11')]));});});}; \ No newline at end of file +var _0xe55d=['map','model','attributes','then','ShowDynamics365Account','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','request\x20sent','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','limit','include'];(function(_0x13f1eb,_0x141549){var _0x27fded=function(_0xb12a78){while(--_0xb12a78){_0x13f1eb['push'](_0x13f1eb['shift']());}};_0x27fded(++_0x141549);}(_0xe55d,0x126));var _0xde55=function(_0x5f58c2,_0x20129d){_0x5f58c2=_0x5f58c2-0x0;var _0x15c13c=_0xe55d[_0x5f58c2];return _0x15c13c;};'use strict';var _=require(_0xde55('0x0'));var util=require(_0xde55('0x1'));var moment=require('moment');var BPromise=require(_0xde55('0x2'));var rs=require(_0xde55('0x3'));var fs=require('fs');var Redis=require(_0xde55('0x4'));var db=require(_0xde55('0x5'))['db'];var utils=require(_0xde55('0x6'));var logger=require(_0xde55('0x7'))('rpc');var config=require(_0xde55('0x8'));var jayson=require(_0xde55('0x9'));var client=jayson[_0xde55('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e7b53,_0x1468f2,_0x1e342e){return new BPromise(function(_0x2094bb,_0x22cbd8){return client[_0xde55('0xb')](_0x1e7b53,_0x1e342e)['then'](function(_0x11aa16){logger[_0xde55('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x1468f2,'request\x20sent');logger[_0xde55('0xd')](_0xde55('0xe'),_0x1468f2,'request\x20sent',JSON[_0xde55('0xf')](_0x11aa16));if(_0x11aa16[_0xde55('0x10')]){if(_0x11aa16['error'][_0xde55('0x11')]===0x1f4){logger[_0xde55('0x10')](_0xde55('0x12'),_0x1468f2,_0x11aa16['error'][_0xde55('0x13')]);return _0x22cbd8(_0x11aa16[_0xde55('0x10')][_0xde55('0x13')]);}logger[_0xde55('0x10')](_0xde55('0x12'),_0x1468f2,_0x11aa16[_0xde55('0x10')]['message']);return _0x2094bb(_0x11aa16['error'][_0xde55('0x13')]);}else{logger[_0xde55('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x1468f2,_0xde55('0x14'));_0x2094bb(_0x11aa16[_0xde55('0x15')][_0xde55('0x13')]);}})[_0xde55('0x16')](function(_0x2f4a77){logger[_0xde55('0x10')](_0xde55('0x12'),_0x1468f2,_0x2f4a77);_0x22cbd8(_0x2f4a77);});});}exports[_0xde55('0x17')]=function(_0x4a97e2){var _0x1abffb=this;return new Promise(function(_0x42b6e4,_0x13551d){return db[_0xde55('0x18')]['findAll']({'raw':_0x4a97e2[_0xde55('0x19')]?_0x4a97e2['options'][_0xde55('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a97e2[_0xde55('0x19')]?_0x4a97e2['options'][_0xde55('0x1b')]||null:null,'attributes':_0x4a97e2['options']?_0x4a97e2[_0xde55('0x19')]['attributes']||null:null,'limit':_0x4a97e2[_0xde55('0x19')]?_0x4a97e2['options'][_0xde55('0x1c')]||null:null,'include':_0x4a97e2[_0xde55('0x19')]?_0x4a97e2[_0xde55('0x19')][_0xde55('0x1d')]?_[_0xde55('0x1e')](_0x4a97e2[_0xde55('0x19')][_0xde55('0x1d')],function(_0x2e7607){return{'model':db[_0x2e7607[_0xde55('0x1f')]],'as':_0x2e7607['as'],'attributes':_0x2e7607['attributes'],'include':_0x2e7607['include']?_[_0xde55('0x1e')](_0x2e7607[_0xde55('0x1d')],function(_0x15a04b){return{'model':db[_0x15a04b[_0xde55('0x1f')]],'as':_0x15a04b['as'],'attributes':_0x15a04b[_0xde55('0x20')],'include':_0x15a04b[_0xde55('0x1d')]?_[_0xde55('0x1e')](_0x15a04b[_0xde55('0x1d')],function(_0x35f246){return{'model':db[_0x35f246[_0xde55('0x1f')]],'as':_0x35f246['as'],'attributes':_0x35f246[_0xde55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xde55('0x21')](function(_0x43c1f4){logger['info']('GetDynamics365Account',_0x4a97e2);logger[_0xde55('0xd')]('GetDynamics365Account',_0x4a97e2,JSON[_0xde55('0xf')](_0x43c1f4));_0x42b6e4(_0x43c1f4);})[_0xde55('0x16')](function(_0x2c42a2){logger['error'](_0xde55('0x17'),_0x2c42a2[_0xde55('0x13')],_0x4a97e2);_0x13551d(_0x1abffb['error'](0x1f4,_0x2c42a2[_0xde55('0x13')]));});});};exports[_0xde55('0x22')]=function(_0x76b11f){var _0x513eb5=this;return new Promise(function(_0x586008,_0x2629ea){return db[_0xde55('0x18')][_0xde55('0x23')]({'raw':_0x76b11f[_0xde55('0x19')]?_0x76b11f[_0xde55('0x19')][_0xde55('0x1a')]===undefined?!![]:![]:!![],'where':_0x76b11f['options']?_0x76b11f[_0xde55('0x19')][_0xde55('0x1b')]||null:null,'attributes':_0x76b11f[_0xde55('0x19')]?_0x76b11f['options'][_0xde55('0x20')]||null:null,'include':_0x76b11f[_0xde55('0x19')]?_0x76b11f[_0xde55('0x19')][_0xde55('0x1d')]?_[_0xde55('0x1e')](_0x76b11f[_0xde55('0x19')][_0xde55('0x1d')],function(_0x58bac3){return{'model':db[_0x58bac3[_0xde55('0x1f')]],'as':_0x58bac3['as'],'attributes':_0x58bac3[_0xde55('0x20')],'include':_0x58bac3[_0xde55('0x1d')]?_['map'](_0x58bac3[_0xde55('0x1d')],function(_0x4e50dd){return{'model':db[_0x4e50dd[_0xde55('0x1f')]],'as':_0x4e50dd['as'],'attributes':_0x4e50dd['attributes'],'include':_0x4e50dd[_0xde55('0x1d')]?_[_0xde55('0x1e')](_0x4e50dd['include'],function(_0x4836de){return{'model':db[_0x4836de['model']],'as':_0x4836de['as'],'attributes':_0x4836de[_0xde55('0x20')]};}):[]};}):[]};}):[]:[]})[_0xde55('0x21')](function(_0x414502){logger[_0xde55('0xc')](_0xde55('0x22'),_0x76b11f);logger[_0xde55('0xd')](_0xde55('0x22'),_0x76b11f,JSON[_0xde55('0xf')](_0x414502));_0x586008(_0x414502);})['catch'](function(_0x59c82f){logger[_0xde55('0x10')](_0xde55('0x22'),_0x59c82f[_0xde55('0x13')],_0x76b11f);_0x2629ea(_0x513eb5[_0xde55('0x10')](0x1f4,_0x59c82f[_0xde55('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 8f0b4a5..e2ff3a0 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 _0x5d4c=['Router','../../components/auth/service','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x19e174,_0x357aca){var _0x2d6024=function(_0x282d23){while(--_0x282d23){_0x19e174['push'](_0x19e174['shift']());}};_0x2d6024(++_0x357aca);}(_0x5d4c,0x66));var _0xc5d4=function(_0x1c5a4f,_0x46d570){_0x1c5a4f=_0x1c5a4f-0x0;var _0x20f751=_0x5d4c[_0x1c5a4f];return _0x20f751;};'use strict';var multer=require('multer');var util=require(_0xc5d4('0x0'));var path=require(_0xc5d4('0x1'));var timeout=require(_0xc5d4('0x2'));var express=require('express');var router=express[_0xc5d4('0x3')]();var auth=require(_0xc5d4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc5d4('0x5'));router[_0xc5d4('0x6')]('/',auth['isAuthenticated'](),controller[_0xc5d4('0x7')]);router[_0xc5d4('0x6')](_0xc5d4('0x8'),auth[_0xc5d4('0x9')](),controller[_0xc5d4('0xa')]);router[_0xc5d4('0x6')](_0xc5d4('0xb'),auth[_0xc5d4('0x9')](),controller['getFields']);router[_0xc5d4('0x6')](_0xc5d4('0xc'),auth[_0xc5d4('0x9')](),controller[_0xc5d4('0xd')]);router['get'](_0xc5d4('0xe'),auth['isAuthenticated'](),controller[_0xc5d4('0xf')]);router['post']('/',auth[_0xc5d4('0x9')](),controller[_0xc5d4('0x10')]);router[_0xc5d4('0x11')]('/:id',auth[_0xc5d4('0x9')](),controller[_0xc5d4('0x12')]);router[_0xc5d4('0x13')](_0xc5d4('0x8'),auth[_0xc5d4('0x9')](),controller[_0xc5d4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xd46a=['show','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','util','path','express','Router','../../components/interaction/service','./intDynamics365Configuration.controller','get','/:id','isAuthenticated'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xd46a,0xbf));var _0xad46=function(_0x1a1ba8,_0x52a437){_0x1a1ba8=_0x1a1ba8-0x0;var _0x3c5118=_0xd46a[_0x1a1ba8];return _0x3c5118;};'use strict';var multer=require('multer');var util=require(_0xad46('0x0'));var path=require(_0xad46('0x1'));var timeout=require('connect-timeout');var express=require(_0xad46('0x2'));var router=express[_0xad46('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xad46('0x4'));var config=require('../../config/environment');var controller=require(_0xad46('0x5'));router[_0xad46('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xad46('0x6')](_0xad46('0x7'),auth[_0xad46('0x8')](),controller[_0xad46('0x9')]);router['get'](_0xad46('0xa'),auth['isAuthenticated'](),controller[_0xad46('0xb')]);router['get']('/:id/subjects',auth[_0xad46('0x8')](),controller['getSubjects']);router[_0xad46('0x6')](_0xad46('0xc'),auth['isAuthenticated'](),controller[_0xad46('0xd')]);router[_0xad46('0xe')]('/',auth[_0xad46('0x8')](),controller[_0xad46('0xf')]);router[_0xad46('0x10')](_0xad46('0x7'),auth[_0xad46('0x8')](),controller[_0xad46('0x11')]);router[_0xad46('0x12')](_0xad46('0x7'),auth[_0xad46('0x8')](),controller[_0xad46('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 261d333..3c9955e 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 _0xa9f0=['exports','STRING','ENUM','incident','sequelize'];(function(_0x46279a,_0x4e92c7){var _0x4cea87=function(_0x41e359){while(--_0x41e359){_0x46279a['push'](_0x46279a['shift']());}};_0x4cea87(++_0x4e92c7);}(_0xa9f0,0x1da));var _0x0a9f=function(_0x69e37c,_0x3d55c4){_0x69e37c=_0x69e37c-0x0;var _0x25df6b=_0xa9f0[_0x69e37c];return _0x25df6b;};'use strict';var Sequelize=require(_0x0a9f('0x0'));module[_0x0a9f('0x1')]={'name':{'type':Sequelize[_0x0a9f('0x2')]},'description':{'type':Sequelize[_0x0a9f('0x2')]},'ticketType':{'type':Sequelize[_0x0a9f('0x3')](_0x0a9f('0x4'),'phonecall'),'defaultValue':_0x0a9f('0x4')}}; \ No newline at end of file +var _0x87e4=['sequelize','exports','STRING','ENUM','phonecall','incident'];(function(_0x544fad,_0x47d1c4){var _0x160a0a=function(_0x11dc45){while(--_0x11dc45){_0x544fad['push'](_0x544fad['shift']());}};_0x160a0a(++_0x47d1c4);}(_0x87e4,0x1d4));var _0x487e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x87e4[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x487e('0x0'));module[_0x487e('0x1')]={'name':{'type':Sequelize[_0x487e('0x2')]},'description':{'type':Sequelize[_0x487e('0x2')]},'ticketType':{'type':Sequelize[_0x487e('0x3')]('incident',_0x487e('0x4')),'defaultValue':_0x487e('0x5')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index b2340d0..98cfd24 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 _0x4753=['getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','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','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','status','end','json','count','offset','limit','apply','reject','save','destroy','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','Dynamics365Configuration','find','create','body','update','getFields','findOne','keys','Dynamics365Field','nolimit'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4753,0x1bf));var _0x3475=function(_0x145abc,_0x27e946){_0x145abc=_0x145abc-0x0;var _0x4ac583=_0x4753[_0x145abc];return _0x4ac583;};'use strict';var pdf=require(_0x3475('0x0'));var emlformat=require(_0x3475('0x1'));var rimraf=require(_0x3475('0x2'));var zipdir=require(_0x3475('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3475('0x4'));var moment=require('moment');var BPromise=require(_0x3475('0x5'));var Mustache=require(_0x3475('0x6'));var util=require('util');var path=require(_0x3475('0x7'));var sox=require(_0x3475('0x8'));var csv=require(_0x3475('0x9'));var ejs=require(_0x3475('0xa'));var fs=require('fs');var _=require(_0x3475('0xb'));var squel=require(_0x3475('0xc'));var crypto=require(_0x3475('0xd'));var jsforce=require(_0x3475('0xe'));var deskjs=require(_0x3475('0xf'));var toCsv=require(_0x3475('0x9'));var querystring=require('querystring');var Papa=require(_0x3475('0x10'));var Redis=require('ioredis');var authService=require(_0x3475('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3475('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3475('0x13'));var utils=require(_0x3475('0x14'));var config=require(_0x3475('0x15'));var db=require(_0x3475('0x16'))['db'];var jayson=require(_0x3475('0x17'));var client=jayson[_0x3475('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d053d,_0x11c313,_0x470cf5){if(_0x470cf5){var _0x11edae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11edae[_0x3475('0x19')](_0x11c313)){return _0x2d053d;}else{throw new db[(_0x3475('0x1a'))]['ValidationError'](_0x3475('0x1b'));}}else{return _0x2d053d;}}function respondWithRpcPromise(_0x34c55d,_0x2d6ef3,_0x2ba71c,_0x1d603e){return new BPromise(function(_0x519057,_0x5ee0fc){var _0x1ac170=_0x1d603e||client;return _0x1ac170[_0x3475('0x1c')](_0x34c55d,_0x2ba71c)[_0x3475('0x1d')](function(_0x3c4365){logger['info'](_0x3475('0x1e'),_0x2d6ef3,_0x3475('0x1f'));logger[_0x3475('0x20')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x2d6ef3,'request\x20sent',JSON[_0x3475('0x21')](_0x3c4365));if(_0x3c4365['error']){if(_0x3c4365[_0x3475('0x22')]['code']===0x1f4){logger['error'](_0x3475('0x1e'),_0x2d6ef3,_0x3c4365[_0x3475('0x22')][_0x3475('0x23')]);return _0x5ee0fc(_0x3c4365[_0x3475('0x22')][_0x3475('0x23')]);}logger[_0x3475('0x22')](_0x3475('0x1e'),_0x2d6ef3,_0x3c4365[_0x3475('0x22')][_0x3475('0x23')]);return _0x519057(_0x3c4365[_0x3475('0x22')][_0x3475('0x23')]);}else{logger[_0x3475('0x24')](_0x3475('0x1e'),_0x2d6ef3,'request\x20sent');_0x519057(_0x3c4365[_0x3475('0x25')]['message']);}})['catch'](function(_0x3c3289){logger['error'](_0x3475('0x1e'),_0x2d6ef3,_0x3c3289);_0x5ee0fc(_0x3c3289);});});}function respondWithStatusCode(_0xfd93ad,_0x1aca37){_0x1aca37=_0x1aca37||0xcc;return function(_0x49b07b){if(_0x49b07b){return _0xfd93ad['sendStatus'](_0x1aca37);}return _0xfd93ad[_0x3475('0x26')](_0x1aca37)[_0x3475('0x27')]();};}function respondWithResult(_0x2d5299,_0x35fd9d){_0x35fd9d=_0x35fd9d||0xc8;return function(_0x31bc67){if(_0x31bc67){return _0x2d5299[_0x3475('0x26')](_0x35fd9d)[_0x3475('0x28')](_0x31bc67);}};}function respondWithFilteredResult(_0x5d6e73,_0x1d6de0){return function(_0x47bb20){if(_0x47bb20){var _0x4cb5eb=_0x47bb20[_0x3475('0x29')],_0x1a4132=_0x1d6de0[_0x3475('0x2a')],_0x46671b=_0x1d6de0[_0x3475('0x2a')]+_0x1d6de0[_0x3475('0x2b')],_0x7dac2c;if(_0x46671b>=_0x4cb5eb){_0x46671b=_0x4cb5eb;_0x7dac2c=0xc8;}else{_0x7dac2c=0xce;}_0x5d6e73[_0x3475('0x26')](_0x7dac2c);return _0x5d6e73['set']('Content-Range',_0x1a4132+'-'+_0x46671b+'/'+_0x4cb5eb)[_0x3475('0x28')](_0x47bb20);}return null;};}function patchUpdates(_0x70501c){return function(_0x3e72af){try{jsonpatch[_0x3475('0x2c')](_0x3e72af,_0x70501c,!![]);}catch(_0x3810e7){return BPromise[_0x3475('0x2d')](_0x3810e7);}return _0x3e72af[_0x3475('0x2e')]();};}function saveUpdates(_0xc33e8c,_0x424514){return function(_0x1c11f9){if(_0x1c11f9){return _0x1c11f9['update'](_0xc33e8c)['then'](function(_0x5bae8d){return _0x5bae8d;});}return null;};}function removeEntity(_0x3942d0,_0x9d002d){return function(_0x216ec9){if(_0x216ec9){return _0x216ec9[_0x3475('0x2f')]()[_0x3475('0x1d')](function(){_0x3942d0[_0x3475('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x529dbc,_0x4bc42c){return function(_0x3058ce){if(!_0x3058ce){_0x529dbc[_0x3475('0x30')](0x194);}return _0x3058ce;};}function handleError(_0x15b731,_0x4ccb5d){_0x4ccb5d=_0x4ccb5d||0x1f4;return function(_0x25cfd9){logger[_0x3475('0x22')](_0x25cfd9[_0x3475('0x31')]);if(_0x25cfd9[_0x3475('0x32')]){delete _0x25cfd9[_0x3475('0x32')];}_0x15b731['status'](_0x4ccb5d)['send'](_0x25cfd9);};}exports[_0x3475('0x33')]=function(_0x45b55d,_0x3d0a24){var _0x5ae777={},_0x58df67={},_0x374a98={'count':0x0,'rows':[]};var _0x35a9fe=_[_0x3475('0x34')](db['Dynamics365Configuration'][_0x3475('0x35')],function(_0x4a0b13){return{'name':_0x4a0b13['fieldName'],'type':_0x4a0b13[_0x3475('0x36')][_0x3475('0x37')]};});_0x58df67[_0x3475('0x38')]=_['map'](_0x35a9fe,_0x3475('0x32'));_0x58df67[_0x3475('0x39')]=_['keys'](_0x45b55d[_0x3475('0x39')]);_0x58df67['filters']=_[_0x3475('0x3a')](_0x58df67['model'],_0x58df67[_0x3475('0x39')]);_0x5ae777[_0x3475('0x3b')]=_[_0x3475('0x3a')](_0x58df67['model'],qs[_0x3475('0x3c')](_0x45b55d[_0x3475('0x39')][_0x3475('0x3c')]));_0x5ae777[_0x3475('0x3b')]=_0x5ae777[_0x3475('0x3b')][_0x3475('0x3d')]?_0x5ae777[_0x3475('0x3b')]:_0x58df67[_0x3475('0x38')];if(!_0x45b55d[_0x3475('0x39')][_0x3475('0x3e')]('nolimit')){_0x5ae777[_0x3475('0x2b')]=qs['limit'](_0x45b55d[_0x3475('0x39')]['limit']);_0x5ae777[_0x3475('0x2a')]=qs[_0x3475('0x2a')](_0x45b55d['query'][_0x3475('0x2a')]);}_0x5ae777[_0x3475('0x3f')]=qs[_0x3475('0x40')](_0x45b55d[_0x3475('0x39')][_0x3475('0x40')]);_0x5ae777[_0x3475('0x41')]=qs[_0x3475('0x42')](_[_0x3475('0x43')](_0x45b55d[_0x3475('0x39')],_0x58df67[_0x3475('0x42')]),_0x35a9fe);if(_0x45b55d[_0x3475('0x39')][_0x3475('0x44')]){_0x5ae777['where']=_[_0x3475('0x45')](_0x5ae777[_0x3475('0x41')],{'$or':_[_0x3475('0x34')](_0x35a9fe,function(_0x23bb79){if(_0x23bb79['type']!=='VIRTUAL'){var _0x6155e9={};_0x6155e9[_0x23bb79[_0x3475('0x32')]]={'$like':'%'+_0x45b55d['query'][_0x3475('0x44')]+'%'};return _0x6155e9;}})});}_0x5ae777=_[_0x3475('0x45')]({},_0x5ae777,_0x45b55d[_0x3475('0x46')]);var _0x24b97d={'where':_0x5ae777[_0x3475('0x41')]};return db['Dynamics365Configuration'][_0x3475('0x29')](_0x24b97d)[_0x3475('0x1d')](function(_0x449aa7){_0x374a98[_0x3475('0x29')]=_0x449aa7;if(_0x45b55d[_0x3475('0x39')][_0x3475('0x47')]){_0x5ae777['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x3475('0x48')](_0x5ae777);})[_0x3475('0x1d')](function(_0x3e57b3){_0x374a98[_0x3475('0x49')]=_0x3e57b3;return _0x374a98;})[_0x3475('0x1d')](respondWithFilteredResult(_0x3d0a24,_0x5ae777))[_0x3475('0x4a')](handleError(_0x3d0a24,null));};exports[_0x3475('0x4b')]=function(_0x4b4184,_0x4fab7b){var _0x4a5369={'raw':![],'where':{'id':_0x4b4184[_0x3475('0x4c')]['id']}},_0x5193f4={};_0x5193f4[_0x3475('0x38')]=_['keys'](db[_0x3475('0x4d')]['rawAttributes']);_0x5193f4['query']=_['keys'](_0x4b4184['query']);_0x5193f4[_0x3475('0x42')]=_[_0x3475('0x3a')](_0x5193f4[_0x3475('0x38')],_0x5193f4[_0x3475('0x39')]);_0x4a5369['attributes']=_['intersection'](_0x5193f4[_0x3475('0x38')],qs['fields'](_0x4b4184[_0x3475('0x39')][_0x3475('0x3c')]));_0x4a5369[_0x3475('0x3b')]=_0x4a5369['attributes'][_0x3475('0x3d')]?_0x4a5369[_0x3475('0x3b')]:_0x5193f4[_0x3475('0x38')];if(_0x4b4184[_0x3475('0x39')][_0x3475('0x47')]){_0x4a5369['include']=[{'all':!![]}];}_0x4a5369=_[_0x3475('0x45')]({},_0x4a5369,_0x4b4184[_0x3475('0x46')]);return db[_0x3475('0x4d')][_0x3475('0x4e')](_0x4a5369)['then'](handleEntityNotFound(_0x4fab7b,null))[_0x3475('0x1d')](respondWithResult(_0x4fab7b,null))[_0x3475('0x4a')](handleError(_0x4fab7b,null));};exports[_0x3475('0x4f')]=function(_0x513afa,_0x51fb66){return db[_0x3475('0x4d')]['create'](_0x513afa[_0x3475('0x50')],{})[_0x3475('0x1d')](respondWithResult(_0x51fb66,0xc9))[_0x3475('0x4a')](handleError(_0x51fb66,null));};exports[_0x3475('0x51')]=function(_0x232291,_0x1124ff){if(_0x232291[_0x3475('0x50')]['id']){delete _0x232291[_0x3475('0x50')]['id'];}return db[_0x3475('0x4d')]['find']({'where':{'id':_0x232291[_0x3475('0x4c')]['id']}})[_0x3475('0x1d')](handleEntityNotFound(_0x1124ff,null))['then'](saveUpdates(_0x232291[_0x3475('0x50')],null))['then'](respondWithResult(_0x1124ff,null))[_0x3475('0x4a')](handleError(_0x1124ff,null));};exports[_0x3475('0x2f')]=function(_0x2d7019,_0x3906ce){return db[_0x3475('0x4d')][_0x3475('0x4e')]({'where':{'id':_0x2d7019[_0x3475('0x4c')]['id']}})[_0x3475('0x1d')](handleEntityNotFound(_0x3906ce,null))[_0x3475('0x1d')](removeEntity(_0x3906ce,null))[_0x3475('0x4a')](handleError(_0x3906ce,null));};exports[_0x3475('0x52')]=function(_0x65ad02,_0xe0636f,_0x5b61f5){var _0x415d50={};var _0x5c654a={};var _0x426945;var _0x417589;return db['Dynamics365Configuration'][_0x3475('0x53')]({'where':{'id':_0x65ad02['params']['id']}})[_0x3475('0x1d')](handleEntityNotFound(_0xe0636f,null))[_0x3475('0x1d')](function(_0x4f64ba){if(_0x4f64ba){_0x426945=_0x4f64ba;_0x5c654a[_0x3475('0x38')]=_[_0x3475('0x54')](db[_0x3475('0x55')][_0x3475('0x35')]);_0x5c654a['query']=_['keys'](_0x65ad02[_0x3475('0x39')]);_0x5c654a[_0x3475('0x42')]=_[_0x3475('0x3a')](_0x5c654a['model'],_0x5c654a[_0x3475('0x39')]);_0x415d50['attributes']=_['intersection'](_0x5c654a[_0x3475('0x38')],qs['fields'](_0x65ad02[_0x3475('0x39')][_0x3475('0x3c')]));_0x415d50[_0x3475('0x3b')]=_0x415d50[_0x3475('0x3b')][_0x3475('0x3d')]?_0x415d50[_0x3475('0x3b')]:_0x5c654a[_0x3475('0x38')];_0x415d50[_0x3475('0x3f')]=qs[_0x3475('0x40')](_0x65ad02[_0x3475('0x39')][_0x3475('0x40')]);_0x415d50[_0x3475('0x41')]=qs[_0x3475('0x42')](_[_0x3475('0x43')](_0x65ad02[_0x3475('0x39')],_0x5c654a['filters']));if(_0x65ad02[_0x3475('0x39')][_0x3475('0x44')]){_0x415d50['where']=_['merge'](_0x415d50[_0x3475('0x41')],{'$or':_[_0x3475('0x34')](_0x415d50['attributes'],function(_0x3a1008){var _0x6dbef1={};_0x6dbef1[_0x3a1008]={'$like':'%'+_0x65ad02[_0x3475('0x39')][_0x3475('0x44')]+'%'};return _0x6dbef1;})});}_0x415d50=_[_0x3475('0x45')]({},_0x415d50,_0x65ad02[_0x3475('0x46')]);return _0x426945['getFields'](_0x415d50);}})[_0x3475('0x1d')](function(_0x41cc36){if(_0x41cc36){_0x417589=_0x41cc36[_0x3475('0x3d')];if(!_0x65ad02[_0x3475('0x39')]['hasOwnProperty'](_0x3475('0x56'))){_0x415d50['limit']=qs[_0x3475('0x2b')](_0x65ad02[_0x3475('0x39')]['limit']);_0x415d50[_0x3475('0x2a')]=qs['offset'](_0x65ad02[_0x3475('0x39')][_0x3475('0x2a')]);}return _0x426945[_0x3475('0x52')](_0x415d50);}})[_0x3475('0x1d')](function(_0x3a3cc6){if(_0x3a3cc6){return _0x3a3cc6?{'count':_0x417589,'rows':_0x3a3cc6}:null;}})[_0x3475('0x1d')](respondWithResult(_0xe0636f,null))['catch'](handleError(_0xe0636f,null));};exports[_0x3475('0x57')]=function(_0x30db64,_0x142e8c,_0x16864b){var _0x373d89={};var _0x103ea7={};var _0x5d921f;var _0x3f3842;return db[_0x3475('0x4d')]['findOne']({'where':{'id':_0x30db64[_0x3475('0x4c')]['id']}})[_0x3475('0x1d')](handleEntityNotFound(_0x142e8c,null))[_0x3475('0x1d')](function(_0x118c3f){if(_0x118c3f){_0x5d921f=_0x118c3f;_0x103ea7[_0x3475('0x38')]=_[_0x3475('0x54')](db[_0x3475('0x55')][_0x3475('0x35')]);_0x103ea7['query']=_[_0x3475('0x54')](_0x30db64[_0x3475('0x39')]);_0x103ea7['filters']=_['intersection'](_0x103ea7[_0x3475('0x38')],_0x103ea7[_0x3475('0x39')]);_0x373d89[_0x3475('0x3b')]=_[_0x3475('0x3a')](_0x103ea7['model'],qs[_0x3475('0x3c')](_0x30db64['query'][_0x3475('0x3c')]));_0x373d89[_0x3475('0x3b')]=_0x373d89[_0x3475('0x3b')][_0x3475('0x3d')]?_0x373d89['attributes']:_0x103ea7['model'];_0x373d89['order']=qs['sort'](_0x30db64[_0x3475('0x39')][_0x3475('0x40')]);_0x373d89[_0x3475('0x41')]=qs[_0x3475('0x42')](_[_0x3475('0x43')](_0x30db64[_0x3475('0x39')],_0x103ea7[_0x3475('0x42')]));if(_0x30db64[_0x3475('0x39')]['filter']){_0x373d89[_0x3475('0x41')]=_['merge'](_0x373d89[_0x3475('0x41')],{'$or':_[_0x3475('0x34')](_0x373d89['attributes'],function(_0x2b36a2){var _0x54801d={};_0x54801d[_0x2b36a2]={'$like':'%'+_0x30db64[_0x3475('0x39')][_0x3475('0x44')]+'%'};return _0x54801d;})});}_0x373d89=_['merge']({},_0x373d89,_0x30db64[_0x3475('0x46')]);return _0x5d921f['getSubjects'](_0x373d89);}})['then'](function(_0x1fce5d){if(_0x1fce5d){_0x3f3842=_0x1fce5d[_0x3475('0x3d')];if(!_0x30db64[_0x3475('0x39')][_0x3475('0x3e')]('nolimit')){_0x373d89[_0x3475('0x2b')]=qs['limit'](_0x30db64[_0x3475('0x39')][_0x3475('0x2b')]);_0x373d89[_0x3475('0x2a')]=qs['offset'](_0x30db64[_0x3475('0x39')]['offset']);}return _0x5d921f[_0x3475('0x57')](_0x373d89);}})['then'](function(_0x1e6e45){if(_0x1e6e45){return _0x1e6e45?{'count':_0x3f3842,'rows':_0x1e6e45}:null;}})[_0x3475('0x1d')](respondWithResult(_0x142e8c,null))[_0x3475('0x4a')](handleError(_0x142e8c,null));};exports[_0x3475('0x58')]=function(_0x137712,_0x3f9e08,_0x20fcbf){var _0x475516={};var _0x1847e5={};var _0x24443f;var _0xd55947;return db[_0x3475('0x4d')][_0x3475('0x53')]({'where':{'id':_0x137712[_0x3475('0x4c')]['id']}})[_0x3475('0x1d')](handleEntityNotFound(_0x3f9e08,null))[_0x3475('0x1d')](function(_0x46c66a){if(_0x46c66a){_0x24443f=_0x46c66a;_0x1847e5['model']=_['keys'](db[_0x3475('0x55')]['rawAttributes']);_0x1847e5['query']=_[_0x3475('0x54')](_0x137712[_0x3475('0x39')]);_0x1847e5[_0x3475('0x42')]=_['intersection'](_0x1847e5[_0x3475('0x38')],_0x1847e5[_0x3475('0x39')]);_0x475516[_0x3475('0x3b')]=_['intersection'](_0x1847e5[_0x3475('0x38')],qs[_0x3475('0x3c')](_0x137712[_0x3475('0x39')][_0x3475('0x3c')]));_0x475516[_0x3475('0x3b')]=_0x475516['attributes']['length']?_0x475516[_0x3475('0x3b')]:_0x1847e5[_0x3475('0x38')];_0x475516[_0x3475('0x3f')]=qs[_0x3475('0x40')](_0x137712[_0x3475('0x39')][_0x3475('0x40')]);_0x475516[_0x3475('0x41')]=qs[_0x3475('0x42')](_[_0x3475('0x43')](_0x137712[_0x3475('0x39')],_0x1847e5[_0x3475('0x42')]));if(_0x137712[_0x3475('0x39')][_0x3475('0x44')]){_0x475516['where']=_[_0x3475('0x45')](_0x475516['where'],{'$or':_[_0x3475('0x34')](_0x475516['attributes'],function(_0x3e3926){var _0x47f183={};_0x47f183[_0x3e3926]={'$like':'%'+_0x137712[_0x3475('0x39')][_0x3475('0x44')]+'%'};return _0x47f183;})});}_0x475516=_[_0x3475('0x45')]({},_0x475516,_0x137712[_0x3475('0x46')]);return _0x24443f['getDescriptions'](_0x475516);}})['then'](function(_0xa35119){if(_0xa35119){_0xd55947=_0xa35119['length'];if(!_0x137712[_0x3475('0x39')][_0x3475('0x3e')](_0x3475('0x56'))){_0x475516[_0x3475('0x2b')]=qs[_0x3475('0x2b')](_0x137712[_0x3475('0x39')][_0x3475('0x2b')]);_0x475516[_0x3475('0x2a')]=qs[_0x3475('0x2a')](_0x137712[_0x3475('0x39')]['offset']);}return _0x24443f[_0x3475('0x58')](_0x475516);}})[_0x3475('0x1d')](function(_0x3d44d5){if(_0x3d44d5){return _0x3d44d5?{'count':_0xd55947,'rows':_0x3d44d5}:null;}})[_0x3475('0x1d')](respondWithResult(_0x3f9e08,null))[_0x3475('0x4a')](handleError(_0x3f9e08,null));}; \ No newline at end of file +var _0x7ee5=['message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','findAll','rows','show','params','include','find','body','getFields','Dynamics365Field','getSubjects','findOne','getDescriptions','html-pdf','rimraf','zip-dir','request-promise','moment','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','jayson/promise','http','test','Sequelize','ValidationError','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48cb70,_0x721318){var _0x85b5e8=function(_0x13f33a){while(--_0x13f33a){_0x48cb70['push'](_0x48cb70['shift']());}};_0x85b5e8(++_0x721318);}(_0x7ee5,0x1bd));var _0x57ee=function(_0x4d77b8,_0x208e64){_0x4d77b8=_0x4d77b8-0x0;var _0x82da62=_0x7ee5[_0x4d77b8];return _0x82da62;};'use strict';var pdf=require(_0x57ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x57ee('0x1'));var zipdir=require(_0x57ee('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x57ee('0x3'));var moment=require(_0x57ee('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57ee('0x5'));var util=require(_0x57ee('0x6'));var path=require(_0x57ee('0x7'));var sox=require(_0x57ee('0x8'));var csv=require('to-csv');var ejs=require(_0x57ee('0x9'));var fs=require('fs');var _=require(_0x57ee('0xa'));var squel=require(_0x57ee('0xb'));var crypto=require('crypto');var jsforce=require(_0x57ee('0xc'));var deskjs=require(_0x57ee('0xd'));var toCsv=require(_0x57ee('0xe'));var querystring=require(_0x57ee('0xf'));var Papa=require(_0x57ee('0x10'));var Redis=require(_0x57ee('0x11'));var authService=require(_0x57ee('0x12'));var qs=require(_0x57ee('0x13'));var as=require(_0x57ee('0x14'));var hardwareService=require(_0x57ee('0x15'));var logger=require(_0x57ee('0x16'))(_0x57ee('0x17'));var utils=require(_0x57ee('0x18'));var config=require(_0x57ee('0x19'));var db=require(_0x57ee('0x1a'))['db'];var jayson=require(_0x57ee('0x1b'));var client=jayson['client'][_0x57ee('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x52a8ec,_0x105ab1,_0x9d1f2f){if(_0x9d1f2f){var _0x1ece3a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ece3a[_0x57ee('0x1d')](_0x105ab1)){return _0x52a8ec;}else{throw new db[(_0x57ee('0x1e'))][(_0x57ee('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 _0x52a8ec;}}function respondWithRpcPromise(_0x3cb9f3,_0x6d6bcf,_0x57e558,_0x48b858){return new BPromise(function(_0x44f71a,_0x3d1e5b){var _0x1e6f3c=_0x48b858||client;return _0x1e6f3c[_0x57ee('0x20')](_0x3cb9f3,_0x57e558)['then'](function(_0x32e0c8){logger[_0x57ee('0x21')](_0x57ee('0x22'),_0x6d6bcf,_0x57ee('0x23'));logger['debug'](_0x57ee('0x24'),_0x6d6bcf,_0x57ee('0x23'),JSON[_0x57ee('0x25')](_0x32e0c8));if(_0x32e0c8[_0x57ee('0x26')]){if(_0x32e0c8[_0x57ee('0x26')][_0x57ee('0x27')]===0x1f4){logger[_0x57ee('0x26')](_0x57ee('0x22'),_0x6d6bcf,_0x32e0c8[_0x57ee('0x26')][_0x57ee('0x28')]);return _0x3d1e5b(_0x32e0c8[_0x57ee('0x26')][_0x57ee('0x28')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x6d6bcf,_0x32e0c8[_0x57ee('0x26')][_0x57ee('0x28')]);return _0x44f71a(_0x32e0c8[_0x57ee('0x26')][_0x57ee('0x28')]);}else{logger[_0x57ee('0x21')]('Dynamics365Configuration,\x20%s,\x20%s',_0x6d6bcf,'request\x20sent');_0x44f71a(_0x32e0c8[_0x57ee('0x29')]['message']);}})[_0x57ee('0x2a')](function(_0x19b401){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x6d6bcf,_0x19b401);_0x3d1e5b(_0x19b401);});});}function respondWithStatusCode(_0x1c0b27,_0x37e984){_0x37e984=_0x37e984||0xcc;return function(_0x12b626){if(_0x12b626){return _0x1c0b27[_0x57ee('0x2b')](_0x37e984);}return _0x1c0b27[_0x57ee('0x2c')](_0x37e984)[_0x57ee('0x2d')]();};}function respondWithResult(_0x3822bf,_0x3dc93f){_0x3dc93f=_0x3dc93f||0xc8;return function(_0x22251a){if(_0x22251a){return _0x3822bf[_0x57ee('0x2c')](_0x3dc93f)[_0x57ee('0x2e')](_0x22251a);}};}function respondWithFilteredResult(_0x28419b,_0x58aa78){return function(_0x109630){if(_0x109630){var _0x5a9d8f=_0x109630[_0x57ee('0x2f')],_0x33fd13=_0x58aa78[_0x57ee('0x30')],_0x2a3bf8=_0x58aa78[_0x57ee('0x30')]+_0x58aa78[_0x57ee('0x31')],_0x1ac0af;if(_0x2a3bf8>=_0x5a9d8f){_0x2a3bf8=_0x5a9d8f;_0x1ac0af=0xc8;}else{_0x1ac0af=0xce;}_0x28419b[_0x57ee('0x2c')](_0x1ac0af);return _0x28419b[_0x57ee('0x32')](_0x57ee('0x33'),_0x33fd13+'-'+_0x2a3bf8+'/'+_0x5a9d8f)[_0x57ee('0x2e')](_0x109630);}return null;};}function patchUpdates(_0x4152e6){return function(_0xbcb9d){try{jsonpatch[_0x57ee('0x34')](_0xbcb9d,_0x4152e6,!![]);}catch(_0x54975e){return BPromise[_0x57ee('0x35')](_0x54975e);}return _0xbcb9d[_0x57ee('0x36')]();};}function saveUpdates(_0x506bf1,_0x29e153){return function(_0x91d50e){if(_0x91d50e){return _0x91d50e[_0x57ee('0x37')](_0x506bf1)[_0x57ee('0x38')](function(_0x4da51c){return _0x4da51c;});}return null;};}function removeEntity(_0x19c54f,_0x42554c){return function(_0x5b3738){if(_0x5b3738){return _0x5b3738[_0x57ee('0x39')]()[_0x57ee('0x38')](function(){_0x19c54f[_0x57ee('0x2c')](0xcc)[_0x57ee('0x2d')]();});}};}function handleEntityNotFound(_0x46fa2d,_0x2e487a){return function(_0x46ed15){if(!_0x46ed15){_0x46fa2d['sendStatus'](0x194);}return _0x46ed15;};}function handleError(_0x1c29d1,_0x6b95b2){_0x6b95b2=_0x6b95b2||0x1f4;return function(_0x4bdf2d){logger['error'](_0x4bdf2d[_0x57ee('0x3a')]);if(_0x4bdf2d[_0x57ee('0x3b')]){delete _0x4bdf2d[_0x57ee('0x3b')];}_0x1c29d1[_0x57ee('0x2c')](_0x6b95b2)['send'](_0x4bdf2d);};}exports[_0x57ee('0x3c')]=function(_0xe8619a,_0x1ee9c){var _0x50d0b2={},_0x4f0ed0={},_0xaab20={'count':0x0,'rows':[]};var _0xeb6aa1=_['map'](db['Dynamics365Configuration'][_0x57ee('0x3d')],function(_0x4d428d){return{'name':_0x4d428d['fieldName'],'type':_0x4d428d[_0x57ee('0x3e')][_0x57ee('0x3f')]};});_0x4f0ed0['model']=_[_0x57ee('0x40')](_0xeb6aa1,_0x57ee('0x3b'));_0x4f0ed0[_0x57ee('0x41')]=_[_0x57ee('0x42')](_0xe8619a[_0x57ee('0x41')]);_0x4f0ed0['filters']=_[_0x57ee('0x43')](_0x4f0ed0['model'],_0x4f0ed0[_0x57ee('0x41')]);_0x50d0b2[_0x57ee('0x44')]=_[_0x57ee('0x43')](_0x4f0ed0['model'],qs[_0x57ee('0x45')](_0xe8619a['query']['fields']));_0x50d0b2[_0x57ee('0x44')]=_0x50d0b2[_0x57ee('0x44')][_0x57ee('0x46')]?_0x50d0b2[_0x57ee('0x44')]:_0x4f0ed0[_0x57ee('0x47')];if(!_0xe8619a[_0x57ee('0x41')][_0x57ee('0x48')](_0x57ee('0x49'))){_0x50d0b2[_0x57ee('0x31')]=qs['limit'](_0xe8619a[_0x57ee('0x41')][_0x57ee('0x31')]);_0x50d0b2['offset']=qs[_0x57ee('0x30')](_0xe8619a['query'][_0x57ee('0x30')]);}_0x50d0b2[_0x57ee('0x4a')]=qs[_0x57ee('0x4b')](_0xe8619a[_0x57ee('0x41')][_0x57ee('0x4b')]);_0x50d0b2[_0x57ee('0x4c')]=qs[_0x57ee('0x4d')](_[_0x57ee('0x4e')](_0xe8619a[_0x57ee('0x41')],_0x4f0ed0[_0x57ee('0x4d')]),_0xeb6aa1);if(_0xe8619a[_0x57ee('0x41')][_0x57ee('0x4f')]){_0x50d0b2[_0x57ee('0x4c')]=_[_0x57ee('0x50')](_0x50d0b2[_0x57ee('0x4c')],{'$or':_[_0x57ee('0x40')](_0xeb6aa1,function(_0x48de76){if(_0x48de76[_0x57ee('0x3e')]!==_0x57ee('0x51')){var _0x2211ad={};_0x2211ad[_0x48de76[_0x57ee('0x3b')]]={'$like':'%'+_0xe8619a[_0x57ee('0x41')]['filter']+'%'};return _0x2211ad;}})});}_0x50d0b2=_[_0x57ee('0x50')]({},_0x50d0b2,_0xe8619a[_0x57ee('0x52')]);var _0x42f8fe={'where':_0x50d0b2['where']};return db[_0x57ee('0x53')][_0x57ee('0x2f')](_0x42f8fe)[_0x57ee('0x38')](function(_0x24f02f){_0xaab20[_0x57ee('0x2f')]=_0x24f02f;if(_0xe8619a[_0x57ee('0x41')][_0x57ee('0x54')]){_0x50d0b2['include']=[{'all':!![]}];}return db[_0x57ee('0x53')][_0x57ee('0x55')](_0x50d0b2);})[_0x57ee('0x38')](function(_0x5c319e){_0xaab20[_0x57ee('0x56')]=_0x5c319e;return _0xaab20;})['then'](respondWithFilteredResult(_0x1ee9c,_0x50d0b2))[_0x57ee('0x2a')](handleError(_0x1ee9c,null));};exports[_0x57ee('0x57')]=function(_0xc83e0d,_0x55ff02){var _0x4f85e9={'raw':![],'where':{'id':_0xc83e0d[_0x57ee('0x58')]['id']}},_0x17dc73={};_0x17dc73[_0x57ee('0x47')]=_['keys'](db[_0x57ee('0x53')][_0x57ee('0x3d')]);_0x17dc73[_0x57ee('0x41')]=_[_0x57ee('0x42')](_0xc83e0d['query']);_0x17dc73[_0x57ee('0x4d')]=_['intersection'](_0x17dc73[_0x57ee('0x47')],_0x17dc73[_0x57ee('0x41')]);_0x4f85e9[_0x57ee('0x44')]=_[_0x57ee('0x43')](_0x17dc73[_0x57ee('0x47')],qs['fields'](_0xc83e0d[_0x57ee('0x41')][_0x57ee('0x45')]));_0x4f85e9['attributes']=_0x4f85e9[_0x57ee('0x44')][_0x57ee('0x46')]?_0x4f85e9[_0x57ee('0x44')]:_0x17dc73[_0x57ee('0x47')];if(_0xc83e0d[_0x57ee('0x41')][_0x57ee('0x54')]){_0x4f85e9[_0x57ee('0x59')]=[{'all':!![]}];}_0x4f85e9=_[_0x57ee('0x50')]({},_0x4f85e9,_0xc83e0d[_0x57ee('0x52')]);return db['Dynamics365Configuration'][_0x57ee('0x5a')](_0x4f85e9)[_0x57ee('0x38')](handleEntityNotFound(_0x55ff02,null))['then'](respondWithResult(_0x55ff02,null))['catch'](handleError(_0x55ff02,null));};exports['create']=function(_0x4422a0,_0x48e1be){return db[_0x57ee('0x53')]['create'](_0x4422a0[_0x57ee('0x5b')],{})['then'](respondWithResult(_0x48e1be,0xc9))[_0x57ee('0x2a')](handleError(_0x48e1be,null));};exports[_0x57ee('0x37')]=function(_0xa30253,_0x17b1a1){if(_0xa30253[_0x57ee('0x5b')]['id']){delete _0xa30253[_0x57ee('0x5b')]['id'];}return db['Dynamics365Configuration']['find']({'where':{'id':_0xa30253[_0x57ee('0x58')]['id']}})[_0x57ee('0x38')](handleEntityNotFound(_0x17b1a1,null))[_0x57ee('0x38')](saveUpdates(_0xa30253[_0x57ee('0x5b')],null))[_0x57ee('0x38')](respondWithResult(_0x17b1a1,null))[_0x57ee('0x2a')](handleError(_0x17b1a1,null));};exports['destroy']=function(_0x2fab47,_0x16f31e){return db[_0x57ee('0x53')]['find']({'where':{'id':_0x2fab47[_0x57ee('0x58')]['id']}})['then'](handleEntityNotFound(_0x16f31e,null))[_0x57ee('0x38')](removeEntity(_0x16f31e,null))['catch'](handleError(_0x16f31e,null));};exports[_0x57ee('0x5c')]=function(_0x1bb220,_0x197a08,_0x51d2f5){var _0x1b7b45={};var _0x3eb1f7={};var _0x13339e;var _0x2d204c;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x1bb220[_0x57ee('0x58')]['id']}})[_0x57ee('0x38')](handleEntityNotFound(_0x197a08,null))['then'](function(_0x5c1c5c){if(_0x5c1c5c){_0x13339e=_0x5c1c5c;_0x3eb1f7[_0x57ee('0x47')]=_[_0x57ee('0x42')](db[_0x57ee('0x5d')]['rawAttributes']);_0x3eb1f7[_0x57ee('0x41')]=_[_0x57ee('0x42')](_0x1bb220[_0x57ee('0x41')]);_0x3eb1f7['filters']=_[_0x57ee('0x43')](_0x3eb1f7[_0x57ee('0x47')],_0x3eb1f7['query']);_0x1b7b45[_0x57ee('0x44')]=_[_0x57ee('0x43')](_0x3eb1f7['model'],qs[_0x57ee('0x45')](_0x1bb220[_0x57ee('0x41')]['fields']));_0x1b7b45[_0x57ee('0x44')]=_0x1b7b45['attributes'][_0x57ee('0x46')]?_0x1b7b45[_0x57ee('0x44')]:_0x3eb1f7[_0x57ee('0x47')];_0x1b7b45[_0x57ee('0x4a')]=qs[_0x57ee('0x4b')](_0x1bb220[_0x57ee('0x41')][_0x57ee('0x4b')]);_0x1b7b45[_0x57ee('0x4c')]=qs['filters'](_['pick'](_0x1bb220[_0x57ee('0x41')],_0x3eb1f7[_0x57ee('0x4d')]));if(_0x1bb220[_0x57ee('0x41')][_0x57ee('0x4f')]){_0x1b7b45[_0x57ee('0x4c')]=_[_0x57ee('0x50')](_0x1b7b45[_0x57ee('0x4c')],{'$or':_[_0x57ee('0x40')](_0x1b7b45[_0x57ee('0x44')],function(_0x42d32e){var _0xa9619e={};_0xa9619e[_0x42d32e]={'$like':'%'+_0x1bb220['query'][_0x57ee('0x4f')]+'%'};return _0xa9619e;})});}_0x1b7b45=_[_0x57ee('0x50')]({},_0x1b7b45,_0x1bb220[_0x57ee('0x52')]);return _0x13339e[_0x57ee('0x5c')](_0x1b7b45);}})[_0x57ee('0x38')](function(_0x1b6b7f){if(_0x1b6b7f){_0x2d204c=_0x1b6b7f[_0x57ee('0x46')];if(!_0x1bb220['query'][_0x57ee('0x48')](_0x57ee('0x49'))){_0x1b7b45[_0x57ee('0x31')]=qs[_0x57ee('0x31')](_0x1bb220[_0x57ee('0x41')][_0x57ee('0x31')]);_0x1b7b45[_0x57ee('0x30')]=qs[_0x57ee('0x30')](_0x1bb220['query'][_0x57ee('0x30')]);}return _0x13339e[_0x57ee('0x5c')](_0x1b7b45);}})[_0x57ee('0x38')](function(_0x110b9e){if(_0x110b9e){return _0x110b9e?{'count':_0x2d204c,'rows':_0x110b9e}:null;}})['then'](respondWithResult(_0x197a08,null))[_0x57ee('0x2a')](handleError(_0x197a08,null));};exports[_0x57ee('0x5e')]=function(_0x2062c8,_0x4b088f,_0xf80fbc){var _0x33f397={};var _0x3f8ed6={};var _0x134920;var _0x4bf654;return db[_0x57ee('0x53')][_0x57ee('0x5f')]({'where':{'id':_0x2062c8[_0x57ee('0x58')]['id']}})[_0x57ee('0x38')](handleEntityNotFound(_0x4b088f,null))[_0x57ee('0x38')](function(_0x30dd05){if(_0x30dd05){_0x134920=_0x30dd05;_0x3f8ed6[_0x57ee('0x47')]=_['keys'](db[_0x57ee('0x5d')][_0x57ee('0x3d')]);_0x3f8ed6['query']=_['keys'](_0x2062c8[_0x57ee('0x41')]);_0x3f8ed6[_0x57ee('0x4d')]=_[_0x57ee('0x43')](_0x3f8ed6[_0x57ee('0x47')],_0x3f8ed6[_0x57ee('0x41')]);_0x33f397['attributes']=_[_0x57ee('0x43')](_0x3f8ed6['model'],qs[_0x57ee('0x45')](_0x2062c8[_0x57ee('0x41')][_0x57ee('0x45')]));_0x33f397[_0x57ee('0x44')]=_0x33f397[_0x57ee('0x44')][_0x57ee('0x46')]?_0x33f397[_0x57ee('0x44')]:_0x3f8ed6[_0x57ee('0x47')];_0x33f397[_0x57ee('0x4a')]=qs[_0x57ee('0x4b')](_0x2062c8['query'][_0x57ee('0x4b')]);_0x33f397['where']=qs[_0x57ee('0x4d')](_['pick'](_0x2062c8['query'],_0x3f8ed6['filters']));if(_0x2062c8[_0x57ee('0x41')][_0x57ee('0x4f')]){_0x33f397[_0x57ee('0x4c')]=_[_0x57ee('0x50')](_0x33f397['where'],{'$or':_[_0x57ee('0x40')](_0x33f397[_0x57ee('0x44')],function(_0x28e3af){var _0x45e068={};_0x45e068[_0x28e3af]={'$like':'%'+_0x2062c8[_0x57ee('0x41')][_0x57ee('0x4f')]+'%'};return _0x45e068;})});}_0x33f397=_['merge']({},_0x33f397,_0x2062c8[_0x57ee('0x52')]);return _0x134920['getSubjects'](_0x33f397);}})[_0x57ee('0x38')](function(_0x370130){if(_0x370130){_0x4bf654=_0x370130[_0x57ee('0x46')];if(!_0x2062c8[_0x57ee('0x41')][_0x57ee('0x48')](_0x57ee('0x49'))){_0x33f397[_0x57ee('0x31')]=qs[_0x57ee('0x31')](_0x2062c8['query']['limit']);_0x33f397[_0x57ee('0x30')]=qs[_0x57ee('0x30')](_0x2062c8['query'][_0x57ee('0x30')]);}return _0x134920['getSubjects'](_0x33f397);}})[_0x57ee('0x38')](function(_0x50d376){if(_0x50d376){return _0x50d376?{'count':_0x4bf654,'rows':_0x50d376}:null;}})[_0x57ee('0x38')](respondWithResult(_0x4b088f,null))['catch'](handleError(_0x4b088f,null));};exports[_0x57ee('0x60')]=function(_0x15c011,_0x16a2ff,_0x58e630){var _0x77160e={};var _0x2b2a8e={};var _0x425cd7;var _0x260963;return db[_0x57ee('0x53')]['findOne']({'where':{'id':_0x15c011[_0x57ee('0x58')]['id']}})[_0x57ee('0x38')](handleEntityNotFound(_0x16a2ff,null))['then'](function(_0x1aa6a6){if(_0x1aa6a6){_0x425cd7=_0x1aa6a6;_0x2b2a8e[_0x57ee('0x47')]=_[_0x57ee('0x42')](db[_0x57ee('0x5d')][_0x57ee('0x3d')]);_0x2b2a8e[_0x57ee('0x41')]=_[_0x57ee('0x42')](_0x15c011['query']);_0x2b2a8e[_0x57ee('0x4d')]=_[_0x57ee('0x43')](_0x2b2a8e['model'],_0x2b2a8e['query']);_0x77160e[_0x57ee('0x44')]=_[_0x57ee('0x43')](_0x2b2a8e[_0x57ee('0x47')],qs['fields'](_0x15c011[_0x57ee('0x41')][_0x57ee('0x45')]));_0x77160e['attributes']=_0x77160e[_0x57ee('0x44')][_0x57ee('0x46')]?_0x77160e['attributes']:_0x2b2a8e[_0x57ee('0x47')];_0x77160e[_0x57ee('0x4a')]=qs[_0x57ee('0x4b')](_0x15c011[_0x57ee('0x41')][_0x57ee('0x4b')]);_0x77160e[_0x57ee('0x4c')]=qs[_0x57ee('0x4d')](_['pick'](_0x15c011[_0x57ee('0x41')],_0x2b2a8e[_0x57ee('0x4d')]));if(_0x15c011['query'][_0x57ee('0x4f')]){_0x77160e['where']=_[_0x57ee('0x50')](_0x77160e['where'],{'$or':_[_0x57ee('0x40')](_0x77160e['attributes'],function(_0x3bb8cc){var _0x45197c={};_0x45197c[_0x3bb8cc]={'$like':'%'+_0x15c011[_0x57ee('0x41')][_0x57ee('0x4f')]+'%'};return _0x45197c;})});}_0x77160e=_[_0x57ee('0x50')]({},_0x77160e,_0x15c011[_0x57ee('0x52')]);return _0x425cd7['getDescriptions'](_0x77160e);}})[_0x57ee('0x38')](function(_0x1bca77){if(_0x1bca77){_0x260963=_0x1bca77['length'];if(!_0x15c011[_0x57ee('0x41')][_0x57ee('0x48')]('nolimit')){_0x77160e['limit']=qs[_0x57ee('0x31')](_0x15c011[_0x57ee('0x41')][_0x57ee('0x31')]);_0x77160e['offset']=qs['offset'](_0x15c011[_0x57ee('0x41')]['offset']);}return _0x425cd7[_0x57ee('0x60')](_0x77160e);}})[_0x57ee('0x38')](function(_0x1b82cd){if(_0x1b82cd){return _0x1b82cd?{'count':_0x260963,'rows':_0x1b82cd}:null;}})[_0x57ee('0x38')](respondWithResult(_0x16a2ff,null))[_0x57ee('0x2a')](handleError(_0x16a2ff,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 0c09fa8..53a0f90 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 _0x9efb=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x2560d5,_0xefe8ec){var _0x3ebd21=function(_0x4d49d7){while(--_0x4d49d7){_0x2560d5['push'](_0x2560d5['shift']());}};_0x3ebd21(++_0xefe8ec);}(_0x9efb,0x74));var _0xb9ef=function(_0xc833a,_0x5a56cf){_0xc833a=_0xc833a-0x0;var _0x20170b=_0x9efb[_0xc833a];return _0x20170b;};'use strict';var _=require(_0xb9ef('0x0'));var util=require(_0xb9ef('0x1'));var logger=require(_0xb9ef('0x2'))(_0xb9ef('0x3'));var moment=require(_0xb9ef('0x4'));var BPromise=require(_0xb9ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb9ef('0x6'));var config=require(_0xb9ef('0x7'));var attributes=require(_0xb9ef('0x8'));module[_0xb9ef('0x9')]=function(_0x1e0ce6,_0xfd7d9d){return _0x1e0ce6[_0xb9ef('0xa')](_0xb9ef('0xb'),attributes,{'tableName':_0xb9ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa16=['util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./intDynamics365Configuration.attributes','define','int_dynamics365_configurations','lodash'];(function(_0xf37530,_0x34789e){var _0x3660ac=function(_0x5da7e2){while(--_0x5da7e2){_0xf37530['push'](_0xf37530['shift']());}};_0x3660ac(++_0x34789e);}(_0xaa16,0x15d));var _0x6aa1=function(_0x383929,_0x373985){_0x383929=_0x383929-0x0;var _0x2703fe=_0xaa16[_0x383929];return _0x2703fe;};'use strict';var _=require(_0x6aa1('0x0'));var util=require(_0x6aa1('0x1'));var logger=require(_0x6aa1('0x2'))('api');var moment=require(_0x6aa1('0x3'));var BPromise=require(_0x6aa1('0x4'));var rp=require(_0x6aa1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6aa1('0x6'));var attributes=require(_0x6aa1('0x7'));module['exports']=function(_0x5cf7c1,_0x3ff314){return _0x5cf7c1[_0x6aa1('0x8')]('Dynamics365Configuration',attributes,{'tableName':_0x6aa1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 4b6dea3..9349f0b 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 _0x96d7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x4f7125,_0x21c694){var _0x3d4326=function(_0x9d54ac){while(--_0x9d54ac){_0x4f7125['push'](_0x4f7125['shift']());}};_0x3d4326(++_0x21c694);}(_0x96d7,0x156));var _0x796d=function(_0x22acf3,_0x40935c){_0x22acf3=_0x22acf3-0x0;var _0x31bf79=_0x96d7[_0x22acf3];return _0x31bf79;};'use strict';var _=require(_0x796d('0x0'));var util=require(_0x796d('0x1'));var moment=require('moment');var BPromise=require(_0x796d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x796d('0x3'));var db=require(_0x796d('0x4'))['db'];var utils=require(_0x796d('0x5'));var logger=require(_0x796d('0x6'))(_0x796d('0x7'));var config=require('../../config/environment');var jayson=require(_0x796d('0x8'));var client=jayson[_0x796d('0x9')][_0x796d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dceef,_0x5b3bf8,_0x18d09){return new BPromise(function(_0x240f1a,_0x1adf6b){return client['request'](_0x5dceef,_0x18d09)[_0x796d('0xb')](function(_0x4aeaee){logger[_0x796d('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3bf8,_0x796d('0xd'));logger[_0x796d('0xe')](_0x796d('0xf'),_0x5b3bf8,_0x796d('0xd'),JSON[_0x796d('0x10')](_0x4aeaee));if(_0x4aeaee[_0x796d('0x11')]){if(_0x4aeaee[_0x796d('0x11')][_0x796d('0x12')]===0x1f4){logger[_0x796d('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3bf8,_0x4aeaee[_0x796d('0x11')][_0x796d('0x13')]);return _0x1adf6b(_0x4aeaee[_0x796d('0x11')][_0x796d('0x13')]);}logger[_0x796d('0x11')](_0x796d('0x14'),_0x5b3bf8,_0x4aeaee['error'][_0x796d('0x13')]);return _0x240f1a(_0x4aeaee[_0x796d('0x11')][_0x796d('0x13')]);}else{logger[_0x796d('0xc')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3bf8,_0x796d('0xd'));_0x240f1a(_0x4aeaee[_0x796d('0x15')][_0x796d('0x13')]);}})[_0x796d('0x16')](function(_0x128693){logger[_0x796d('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5b3bf8,_0x128693);_0x1adf6b(_0x128693);});});} \ No newline at end of file +var _0x6034=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0x1785a2,_0x15d901){var _0x58380c=function(_0x2739e8){while(--_0x2739e8){_0x1785a2['push'](_0x1785a2['shift']());}};_0x58380c(++_0x15d901);}(_0x6034,0x1f4));var _0x4603=function(_0x4ecd5f,_0x40c2cf){_0x4ecd5f=_0x4ecd5f-0x0;var _0xab6c7=_0x6034[_0x4ecd5f];return _0xab6c7;};'use strict';var _=require('lodash');var util=require(_0x4603('0x0'));var moment=require(_0x4603('0x1'));var BPromise=require(_0x4603('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4603('0x3'));var db=require(_0x4603('0x4'))['db'];var utils=require(_0x4603('0x5'));var logger=require(_0x4603('0x6'))(_0x4603('0x7'));var config=require(_0x4603('0x8'));var jayson=require(_0x4603('0x9'));var client=jayson[_0x4603('0xa')][_0x4603('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x316b78,_0x3666dd,_0x5a9622){return new BPromise(function(_0x4d0abf,_0x149045){return client[_0x4603('0xc')](_0x316b78,_0x5a9622)[_0x4603('0xd')](function(_0x57b578){logger['info'](_0x4603('0xe'),_0x3666dd,'request\x20sent');logger[_0x4603('0xf')](_0x4603('0x10'),_0x3666dd,'request\x20sent',JSON[_0x4603('0x11')](_0x57b578));if(_0x57b578[_0x4603('0x12')]){if(_0x57b578[_0x4603('0x12')][_0x4603('0x13')]===0x1f4){logger[_0x4603('0x12')](_0x4603('0xe'),_0x3666dd,_0x57b578[_0x4603('0x12')]['message']);return _0x149045(_0x57b578[_0x4603('0x12')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3666dd,_0x57b578[_0x4603('0x12')][_0x4603('0x14')]);return _0x4d0abf(_0x57b578[_0x4603('0x12')][_0x4603('0x14')]);}else{logger[_0x4603('0x15')](_0x4603('0xe'),_0x3666dd,_0x4603('0x16'));_0x4d0abf(_0x57b578[_0x4603('0x17')][_0x4603('0x14')]);}})[_0x4603('0x18')](function(_0xbaa02b){logger[_0x4603('0x12')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3666dd,_0xbaa02b);_0x149045(_0xbaa02b);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index b16e70c..4680f95 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 _0x0624=['isAuthenticated','show','put','update','delete','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','index','get','/:id'];(function(_0xa15fba,_0x115fc2){var _0x1ffbf0=function(_0x2b336e){while(--_0x2b336e){_0xa15fba['push'](_0xa15fba['shift']());}};_0x1ffbf0(++_0x115fc2);}(_0x0624,0x132));var _0x4062=function(_0x1e8250,_0xa62bc5){_0x1e8250=_0x1e8250-0x0;var _0x385579=_0x0624[_0x1e8250];return _0x385579;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4062('0x0'));var router=express[_0x4062('0x1')]();var auth=require(_0x4062('0x2'));var interaction=require(_0x4062('0x3'));var config=require(_0x4062('0x4'));var controller=require(_0x4062('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x4062('0x6')]);router[_0x4062('0x7')](_0x4062('0x8'),auth[_0x4062('0x9')](),controller[_0x4062('0xa')]);router['post']('/',auth[_0x4062('0x9')](),controller['create']);router[_0x4062('0xb')](_0x4062('0x8'),auth[_0x4062('0x9')](),controller[_0x4062('0xc')]);router[_0x4062('0xd')](_0x4062('0x8'),auth[_0x4062('0x9')](),controller['destroy']);module[_0x4062('0xe')]=router; \ No newline at end of file +var _0xa74f=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','put','update','exports','path','Router'];(function(_0x376024,_0x219bc2){var _0x4c9609=function(_0x1b78fa){while(--_0x1b78fa){_0x376024['push'](_0x376024['shift']());}};_0x4c9609(++_0x219bc2);}(_0xa74f,0x9a));var _0xfa74=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0xa74f[_0x23c73d];return _0x36ba47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var auth=require(_0xfa74('0x2'));var interaction=require(_0xfa74('0x3'));var config=require(_0xfa74('0x4'));var controller=require('./intDynamics365Field.controller');router[_0xfa74('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfa74('0x5')](_0xfa74('0x6'),auth[_0xfa74('0x7')](),controller[_0xfa74('0x8')]);router[_0xfa74('0x9')]('/',auth[_0xfa74('0x7')](),controller['create']);router[_0xfa74('0xa')](_0xfa74('0x6'),auth[_0xfa74('0x7')](),controller[_0xfa74('0xb')]);router['delete'](_0xfa74('0x6'),auth[_0xfa74('0x7')](),controller['destroy']);module[_0xfa74('0xc')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index ca5327e..cd710e3 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 _0x45a6=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x3c4bb5,_0x295111){var _0x2395d4=function(_0x4007c3){while(--_0x4007c3){_0x3c4bb5['push'](_0x3c4bb5['shift']());}};_0x2395d4(++_0x295111);}(_0x45a6,0x116));var _0x645a=function(_0x12c81e,_0x50a2f8){_0x12c81e=_0x12c81e-0x0;var _0x552be8=_0x45a6[_0x12c81e];return _0x552be8;};'use strict';var Sequelize=require(_0x645a('0x0'));module[_0x645a('0x1')]={'type':{'type':Sequelize[_0x645a('0x2')](_0x645a('0x3'),_0x645a('0x4'),_0x645a('0x5'),_0x645a('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x645a('0x7')]},'key':{'type':Sequelize[_0x645a('0x7')]},'keyType':{'type':Sequelize[_0x645a('0x2')](_0x645a('0x3'),_0x645a('0x4'),_0x645a('0x5'))},'keyContent':{'type':Sequelize[_0x645a('0x7')]},'idField':{'type':Sequelize[_0x645a('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x645a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x645a('0x7')]}}; \ No newline at end of file +var _0x57a0=['customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x1ea57a,_0x920358){var _0x1be668=function(_0x592021){while(--_0x592021){_0x1ea57a['push'](_0x1ea57a['shift']());}};_0x1be668(++_0x920358);}(_0x57a0,0x7b));var _0x057a=function(_0x51ae98,_0x26fe66){_0x51ae98=_0x51ae98-0x0;var _0x5e3cec=_0x57a0[_0x51ae98];return _0x5e3cec;};'use strict';var Sequelize=require(_0x057a('0x0'));module['exports']={'type':{'type':Sequelize[_0x057a('0x1')](_0x057a('0x2'),'variable',_0x057a('0x3'),_0x057a('0x4')),'defaultValue':_0x057a('0x2')},'content':{'type':Sequelize[_0x057a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x057a('0x1')](_0x057a('0x2'),'variable',_0x057a('0x3'))},'keyContent':{'type':Sequelize[_0x057a('0x5')]},'idField':{'type':Sequelize[_0x057a('0x5')]},'nameField':{'type':Sequelize[_0x057a('0x5')]},'customField':{'type':Sequelize[_0x057a('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x057a('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 407d19a..b569c2b 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 _0x7846=['json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','Dynamics365Field','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','merge','count','includeAll','include','rows','catch','show','params','options','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x2d8dcc,_0x5d5a76){var _0x3e2aa8=function(_0x129215){while(--_0x129215){_0x2d8dcc['push'](_0x2d8dcc['shift']());}};_0x3e2aa8(++_0x5d5a76);}(_0x7846,0xbf));var _0x6784=function(_0x37e845,_0x219f9f){_0x37e845=_0x37e845-0x0;var _0x59e55b=_0x7846[_0x37e845];return _0x59e55b;};'use strict';var pdf=require(_0x6784('0x0'));var emlformat=require(_0x6784('0x1'));var rimraf=require(_0x6784('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6784('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6784('0x4'));var Mustache=require(_0x6784('0x5'));var util=require('util');var path=require(_0x6784('0x6'));var sox=require(_0x6784('0x7'));var csv=require(_0x6784('0x8'));var ejs=require(_0x6784('0x9'));var fs=require('fs');var _=require(_0x6784('0xa'));var squel=require(_0x6784('0xb'));var crypto=require('crypto');var jsforce=require(_0x6784('0xc'));var deskjs=require(_0x6784('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6784('0xe'));var Papa=require(_0x6784('0xf'));var Redis=require('ioredis');var authService=require(_0x6784('0x10'));var qs=require(_0x6784('0x11'));var as=require(_0x6784('0x12'));var hardwareService=require(_0x6784('0x13'));var logger=require(_0x6784('0x14'))(_0x6784('0x15'));var utils=require(_0x6784('0x16'));var config=require(_0x6784('0x17'));var db=require(_0x6784('0x18'))['db'];function respondWithStatusCode(_0xfb6f6d,_0x30bcfd){_0x30bcfd=_0x30bcfd||0xcc;return function(_0x34c698){if(_0x34c698){return _0xfb6f6d[_0x6784('0x19')](_0x30bcfd);}return _0xfb6f6d[_0x6784('0x1a')](_0x30bcfd)[_0x6784('0x1b')]();};}function respondWithResult(_0x196578,_0x30c0cd){_0x30c0cd=_0x30c0cd||0xc8;return function(_0x3110c3){if(_0x3110c3){return _0x196578[_0x6784('0x1a')](_0x30c0cd)[_0x6784('0x1c')](_0x3110c3);}};}function respondWithFilteredResult(_0x234980,_0x30c158){return function(_0x1e24e2){if(_0x1e24e2){var _0x530227=_0x1e24e2['count'],_0x5cebbb=_0x30c158[_0x6784('0x1d')],_0x36b237=_0x30c158[_0x6784('0x1d')]+_0x30c158[_0x6784('0x1e')],_0x44faa5;if(_0x36b237>=_0x530227){_0x36b237=_0x530227;_0x44faa5=0xc8;}else{_0x44faa5=0xce;}_0x234980[_0x6784('0x1a')](_0x44faa5);return _0x234980[_0x6784('0x1f')](_0x6784('0x20'),_0x5cebbb+'-'+_0x36b237+'/'+_0x530227)[_0x6784('0x1c')](_0x1e24e2);}return null;};}function patchUpdates(_0x549bbc){return function(_0x4ccae9){try{jsonpatch[_0x6784('0x21')](_0x4ccae9,_0x549bbc,!![]);}catch(_0x5c54d3){return BPromise[_0x6784('0x22')](_0x5c54d3);}return _0x4ccae9[_0x6784('0x23')]();};}function saveUpdates(_0x26f55a,_0x10be67){return function(_0x50cce2){if(_0x50cce2){return _0x50cce2['update'](_0x26f55a)[_0x6784('0x24')](function(_0x113412){return _0x113412;});}return null;};}function removeEntity(_0x34d6ff,_0x42b2e4){return function(_0x32921c){if(_0x32921c){return _0x32921c[_0x6784('0x25')]()['then'](function(){_0x34d6ff['status'](0xcc)[_0x6784('0x1b')]();});}};}function handleEntityNotFound(_0x26c418,_0x34e51e){return function(_0x1a4347){if(!_0x1a4347){_0x26c418[_0x6784('0x19')](0x194);}return _0x1a4347;};}function handleError(_0x3c9bd0,_0x4ccc2a){_0x4ccc2a=_0x4ccc2a||0x1f4;return function(_0x20f962){logger[_0x6784('0x26')](_0x20f962[_0x6784('0x27')]);if(_0x20f962['name']){delete _0x20f962[_0x6784('0x28')];}_0x3c9bd0[_0x6784('0x1a')](_0x4ccc2a)['send'](_0x20f962);};}exports[_0x6784('0x29')]=function(_0x182ef4,_0x5a4ce7){var _0x5d396d={},_0x33dbd7={},_0x552463={'count':0x0,'rows':[]};var _0x2a9eaf=_[_0x6784('0x2a')](db[_0x6784('0x2b')][_0x6784('0x2c')],function(_0x3971d2){return{'name':_0x3971d2[_0x6784('0x2d')],'type':_0x3971d2[_0x6784('0x2e')][_0x6784('0x2f')]};});_0x33dbd7[_0x6784('0x30')]=_[_0x6784('0x2a')](_0x2a9eaf,'name');_0x33dbd7[_0x6784('0x31')]=_[_0x6784('0x32')](_0x182ef4[_0x6784('0x31')]);_0x33dbd7['filters']=_[_0x6784('0x33')](_0x33dbd7['model'],_0x33dbd7[_0x6784('0x31')]);_0x5d396d[_0x6784('0x34')]=_[_0x6784('0x33')](_0x33dbd7[_0x6784('0x30')],qs['fields'](_0x182ef4[_0x6784('0x31')][_0x6784('0x35')]));_0x5d396d[_0x6784('0x34')]=_0x5d396d['attributes']['length']?_0x5d396d[_0x6784('0x34')]:_0x33dbd7['model'];if(!_0x182ef4[_0x6784('0x31')]['hasOwnProperty']('nolimit')){_0x5d396d[_0x6784('0x1e')]=qs[_0x6784('0x1e')](_0x182ef4[_0x6784('0x31')][_0x6784('0x1e')]);_0x5d396d['offset']=qs[_0x6784('0x1d')](_0x182ef4[_0x6784('0x31')][_0x6784('0x1d')]);}_0x5d396d[_0x6784('0x36')]=qs['sort'](_0x182ef4[_0x6784('0x31')][_0x6784('0x37')]);_0x5d396d[_0x6784('0x38')]=qs[_0x6784('0x39')](_[_0x6784('0x3a')](_0x182ef4[_0x6784('0x31')],_0x33dbd7[_0x6784('0x39')]),_0x2a9eaf);if(_0x182ef4['query'][_0x6784('0x3b')]){_0x5d396d[_0x6784('0x38')]=_[_0x6784('0x3c')](_0x5d396d['where'],{'$or':_[_0x6784('0x2a')](_0x2a9eaf,function(_0x6b748e){if(_0x6b748e[_0x6784('0x2e')]!=='VIRTUAL'){var _0x19f1e4={};_0x19f1e4[_0x6b748e[_0x6784('0x28')]]={'$like':'%'+_0x182ef4['query'][_0x6784('0x3b')]+'%'};return _0x19f1e4;}})});}_0x5d396d=_[_0x6784('0x3c')]({},_0x5d396d,_0x182ef4['options']);var _0x3926a4={'where':_0x5d396d['where']};return db[_0x6784('0x2b')][_0x6784('0x3d')](_0x3926a4)[_0x6784('0x24')](function(_0xb753a6){_0x552463[_0x6784('0x3d')]=_0xb753a6;if(_0x182ef4[_0x6784('0x31')][_0x6784('0x3e')]){_0x5d396d[_0x6784('0x3f')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x5d396d);})[_0x6784('0x24')](function(_0x2c2fb0){_0x552463[_0x6784('0x40')]=_0x2c2fb0;return _0x552463;})[_0x6784('0x24')](respondWithFilteredResult(_0x5a4ce7,_0x5d396d))[_0x6784('0x41')](handleError(_0x5a4ce7,null));};exports[_0x6784('0x42')]=function(_0x563b5b,_0x3231e3){var _0x3e208b={'raw':!![],'where':{'id':_0x563b5b[_0x6784('0x43')]['id']}},_0x49cbb9={};_0x49cbb9['model']=_[_0x6784('0x32')](db[_0x6784('0x2b')][_0x6784('0x2c')]);_0x49cbb9[_0x6784('0x31')]=_['keys'](_0x563b5b[_0x6784('0x31')]);_0x49cbb9[_0x6784('0x39')]=_[_0x6784('0x33')](_0x49cbb9[_0x6784('0x30')],_0x49cbb9[_0x6784('0x31')]);_0x3e208b[_0x6784('0x34')]=_[_0x6784('0x33')](_0x49cbb9['model'],qs[_0x6784('0x35')](_0x563b5b[_0x6784('0x31')][_0x6784('0x35')]));_0x3e208b[_0x6784('0x34')]=_0x3e208b[_0x6784('0x34')]['length']?_0x3e208b[_0x6784('0x34')]:_0x49cbb9[_0x6784('0x30')];if(_0x563b5b[_0x6784('0x31')][_0x6784('0x3e')]){_0x3e208b['include']=[{'all':!![]}];}_0x3e208b=_['merge']({},_0x3e208b,_0x563b5b[_0x6784('0x44')]);return db[_0x6784('0x2b')][_0x6784('0x45')](_0x3e208b)[_0x6784('0x24')](handleEntityNotFound(_0x3231e3,null))[_0x6784('0x24')](respondWithResult(_0x3231e3,null))['catch'](handleError(_0x3231e3,null));};exports[_0x6784('0x46')]=function(_0x2d7ea3,_0x3e6e57){return db[_0x6784('0x2b')][_0x6784('0x46')](_0x2d7ea3[_0x6784('0x47')],{})[_0x6784('0x24')](respondWithResult(_0x3e6e57,0xc9))[_0x6784('0x41')](handleError(_0x3e6e57,null));};exports[_0x6784('0x48')]=function(_0x24635c,_0x3d0410){if(_0x24635c['body']['id']){delete _0x24635c[_0x6784('0x47')]['id'];}return db['Dynamics365Field'][_0x6784('0x45')]({'where':{'id':_0x24635c[_0x6784('0x43')]['id']}})[_0x6784('0x24')](handleEntityNotFound(_0x3d0410,null))[_0x6784('0x24')](saveUpdates(_0x24635c['body'],null))[_0x6784('0x24')](respondWithResult(_0x3d0410,null))[_0x6784('0x41')](handleError(_0x3d0410,null));};exports[_0x6784('0x25')]=function(_0x22fa72,_0x9fb1c6){return db['Dynamics365Field'][_0x6784('0x45')]({'where':{'id':_0x22fa72['params']['id']}})[_0x6784('0x24')](handleEntityNotFound(_0x9fb1c6,null))['then'](removeEntity(_0x9fb1c6,null))[_0x6784('0x41')](handleError(_0x9fb1c6,null));}; \ No newline at end of file +var _0xa459=['squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','update','then','error','stack','name','send','map','Dynamics365Field','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','merge','create','body','find','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','lodash'];(function(_0x239b31,_0x44a64d){var _0x41c8be=function(_0x27f031){while(--_0x27f031){_0x239b31['push'](_0x239b31['shift']());}};_0x41c8be(++_0x44a64d);}(_0xa459,0x1d8));var _0x9a45=function(_0xda302e,_0xc8df91){_0xda302e=_0xda302e-0x0;var _0x16e42e=_0xa459[_0xda302e];return _0x16e42e;};'use strict';var pdf=require(_0x9a45('0x0'));var emlformat=require(_0x9a45('0x1'));var rimraf=require(_0x9a45('0x2'));var zipdir=require(_0x9a45('0x3'));var jsonpatch=require(_0x9a45('0x4'));var rp=require(_0x9a45('0x5'));var moment=require(_0x9a45('0x6'));var BPromise=require(_0x9a45('0x7'));var Mustache=require(_0x9a45('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9a45('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9a45('0xa'));var squel=require(_0x9a45('0xb'));var crypto=require(_0x9a45('0xc'));var jsforce=require(_0x9a45('0xd'));var deskjs=require(_0x9a45('0xe'));var toCsv=require(_0x9a45('0x9'));var querystring=require('querystring');var Papa=require(_0x9a45('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9a45('0x10'));var hardwareService=require(_0x9a45('0x11'));var logger=require(_0x9a45('0x12'))('api');var utils=require(_0x9a45('0x13'));var config=require(_0x9a45('0x14'));var db=require(_0x9a45('0x15'))['db'];function respondWithStatusCode(_0x30bdf2,_0x3d0a8f){_0x3d0a8f=_0x3d0a8f||0xcc;return function(_0x463d99){if(_0x463d99){return _0x30bdf2[_0x9a45('0x16')](_0x3d0a8f);}return _0x30bdf2[_0x9a45('0x17')](_0x3d0a8f)[_0x9a45('0x18')]();};}function respondWithResult(_0x557e7b,_0x99c111){_0x99c111=_0x99c111||0xc8;return function(_0x435f90){if(_0x435f90){return _0x557e7b[_0x9a45('0x17')](_0x99c111)['json'](_0x435f90);}};}function respondWithFilteredResult(_0x403e2d,_0x59f693){return function(_0x38e771){if(_0x38e771){var _0x546495=_0x38e771[_0x9a45('0x19')],_0x18b793=_0x59f693[_0x9a45('0x1a')],_0x43fdfb=_0x59f693[_0x9a45('0x1a')]+_0x59f693['limit'],_0x1adce2;if(_0x43fdfb>=_0x546495){_0x43fdfb=_0x546495;_0x1adce2=0xc8;}else{_0x1adce2=0xce;}_0x403e2d[_0x9a45('0x17')](_0x1adce2);return _0x403e2d[_0x9a45('0x1b')](_0x9a45('0x1c'),_0x18b793+'-'+_0x43fdfb+'/'+_0x546495)[_0x9a45('0x1d')](_0x38e771);}return null;};}function patchUpdates(_0x31ca24){return function(_0x4d58af){try{jsonpatch[_0x9a45('0x1e')](_0x4d58af,_0x31ca24,!![]);}catch(_0x139842){return BPromise['reject'](_0x139842);}return _0x4d58af['save']();};}function saveUpdates(_0x5913b9,_0x1c662f){return function(_0x56428a){if(_0x56428a){return _0x56428a[_0x9a45('0x1f')](_0x5913b9)[_0x9a45('0x20')](function(_0x4c6f4c){return _0x4c6f4c;});}return null;};}function removeEntity(_0x44fe60,_0x48b3c3){return function(_0x4ccb7e){if(_0x4ccb7e){return _0x4ccb7e['destroy']()['then'](function(){_0x44fe60[_0x9a45('0x17')](0xcc)[_0x9a45('0x18')]();});}};}function handleEntityNotFound(_0x1b7a69,_0x285563){return function(_0x20dd61){if(!_0x20dd61){_0x1b7a69[_0x9a45('0x16')](0x194);}return _0x20dd61;};}function handleError(_0x14193b,_0x1f664f){_0x1f664f=_0x1f664f||0x1f4;return function(_0x1d1d26){logger[_0x9a45('0x21')](_0x1d1d26[_0x9a45('0x22')]);if(_0x1d1d26[_0x9a45('0x23')]){delete _0x1d1d26['name'];}_0x14193b[_0x9a45('0x17')](_0x1f664f)[_0x9a45('0x24')](_0x1d1d26);};}exports['index']=function(_0x106bfb,_0x454998){var _0x583d4c={},_0x7e9378={},_0x587b09={'count':0x0,'rows':[]};var _0x2a9aaa=_[_0x9a45('0x25')](db[_0x9a45('0x26')][_0x9a45('0x27')],function(_0x8cbaf){return{'name':_0x8cbaf[_0x9a45('0x28')],'type':_0x8cbaf[_0x9a45('0x29')]['key']};});_0x7e9378[_0x9a45('0x2a')]=_['map'](_0x2a9aaa,_0x9a45('0x23'));_0x7e9378[_0x9a45('0x2b')]=_[_0x9a45('0x2c')](_0x106bfb[_0x9a45('0x2b')]);_0x7e9378[_0x9a45('0x2d')]=_[_0x9a45('0x2e')](_0x7e9378['model'],_0x7e9378[_0x9a45('0x2b')]);_0x583d4c['attributes']=_[_0x9a45('0x2e')](_0x7e9378['model'],qs[_0x9a45('0x2f')](_0x106bfb[_0x9a45('0x2b')][_0x9a45('0x2f')]));_0x583d4c['attributes']=_0x583d4c[_0x9a45('0x30')]['length']?_0x583d4c[_0x9a45('0x30')]:_0x7e9378[_0x9a45('0x2a')];if(!_0x106bfb['query']['hasOwnProperty'](_0x9a45('0x31'))){_0x583d4c[_0x9a45('0x32')]=qs[_0x9a45('0x32')](_0x106bfb[_0x9a45('0x2b')][_0x9a45('0x32')]);_0x583d4c[_0x9a45('0x1a')]=qs['offset'](_0x106bfb[_0x9a45('0x2b')][_0x9a45('0x1a')]);}_0x583d4c[_0x9a45('0x33')]=qs[_0x9a45('0x34')](_0x106bfb['query'][_0x9a45('0x34')]);_0x583d4c[_0x9a45('0x35')]=qs[_0x9a45('0x2d')](_[_0x9a45('0x36')](_0x106bfb[_0x9a45('0x2b')],_0x7e9378[_0x9a45('0x2d')]),_0x2a9aaa);if(_0x106bfb['query'][_0x9a45('0x37')]){_0x583d4c['where']=_['merge'](_0x583d4c[_0x9a45('0x35')],{'$or':_[_0x9a45('0x25')](_0x2a9aaa,function(_0x4a31a4){if(_0x4a31a4[_0x9a45('0x29')]!==_0x9a45('0x38')){var _0x5914fd={};_0x5914fd[_0x4a31a4[_0x9a45('0x23')]]={'$like':'%'+_0x106bfb[_0x9a45('0x2b')][_0x9a45('0x37')]+'%'};return _0x5914fd;}})});}_0x583d4c=_['merge']({},_0x583d4c,_0x106bfb[_0x9a45('0x39')]);var _0x3e994b={'where':_0x583d4c[_0x9a45('0x35')]};return db['Dynamics365Field'][_0x9a45('0x19')](_0x3e994b)[_0x9a45('0x20')](function(_0x203dd7){_0x587b09[_0x9a45('0x19')]=_0x203dd7;if(_0x106bfb['query'][_0x9a45('0x3a')]){_0x583d4c['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x9a45('0x3b')](_0x583d4c);})[_0x9a45('0x20')](function(_0x5e4a4e){_0x587b09[_0x9a45('0x3c')]=_0x5e4a4e;return _0x587b09;})[_0x9a45('0x20')](respondWithFilteredResult(_0x454998,_0x583d4c))[_0x9a45('0x3d')](handleError(_0x454998,null));};exports[_0x9a45('0x3e')]=function(_0x42ae3f,_0x57e9f4){var _0x3b13a9={'raw':!![],'where':{'id':_0x42ae3f[_0x9a45('0x3f')]['id']}},_0x18e873={};_0x18e873[_0x9a45('0x2a')]=_[_0x9a45('0x2c')](db['Dynamics365Field'][_0x9a45('0x27')]);_0x18e873[_0x9a45('0x2b')]=_[_0x9a45('0x2c')](_0x42ae3f['query']);_0x18e873[_0x9a45('0x2d')]=_[_0x9a45('0x2e')](_0x18e873[_0x9a45('0x2a')],_0x18e873['query']);_0x3b13a9[_0x9a45('0x30')]=_[_0x9a45('0x2e')](_0x18e873[_0x9a45('0x2a')],qs[_0x9a45('0x2f')](_0x42ae3f[_0x9a45('0x2b')][_0x9a45('0x2f')]));_0x3b13a9[_0x9a45('0x30')]=_0x3b13a9['attributes']['length']?_0x3b13a9['attributes']:_0x18e873['model'];if(_0x42ae3f[_0x9a45('0x2b')][_0x9a45('0x3a')]){_0x3b13a9['include']=[{'all':!![]}];}_0x3b13a9=_[_0x9a45('0x40')]({},_0x3b13a9,_0x42ae3f[_0x9a45('0x39')]);return db[_0x9a45('0x26')]['find'](_0x3b13a9)['then'](handleEntityNotFound(_0x57e9f4,null))[_0x9a45('0x20')](respondWithResult(_0x57e9f4,null))[_0x9a45('0x3d')](handleError(_0x57e9f4,null));};exports[_0x9a45('0x41')]=function(_0x15b3d3,_0x5d812a){return db[_0x9a45('0x26')][_0x9a45('0x41')](_0x15b3d3[_0x9a45('0x42')],{})[_0x9a45('0x20')](respondWithResult(_0x5d812a,0xc9))['catch'](handleError(_0x5d812a,null));};exports['update']=function(_0x22d850,_0x263eee){if(_0x22d850[_0x9a45('0x42')]['id']){delete _0x22d850['body']['id'];}return db['Dynamics365Field'][_0x9a45('0x43')]({'where':{'id':_0x22d850[_0x9a45('0x3f')]['id']}})[_0x9a45('0x20')](handleEntityNotFound(_0x263eee,null))[_0x9a45('0x20')](saveUpdates(_0x22d850[_0x9a45('0x42')],null))['then'](respondWithResult(_0x263eee,null))['catch'](handleError(_0x263eee,null));};exports[_0x9a45('0x44')]=function(_0x4fef78,_0x436482){return db[_0x9a45('0x26')][_0x9a45('0x43')]({'where':{'id':_0x4fef78[_0x9a45('0x3f')]['id']}})[_0x9a45('0x20')](handleEntityNotFound(_0x436482,null))[_0x9a45('0x20')](removeEntity(_0x436482,null))[_0x9a45('0x3d')](handleError(_0x436482,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 60373b6..d9d2c5a 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 _0x4c24=['idField','FieldId','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields'];(function(_0x37a7c6,_0x3a84b6){var _0x539905=function(_0xa00c20){while(--_0xa00c20){_0x37a7c6['push'](_0x37a7c6['shift']());}};_0x539905(++_0x3a84b6);}(_0x4c24,0xb8));var _0x44c2=function(_0x597598,_0x3881dc){_0x597598=_0x597598-0x0;var _0x3df496=_0x4c24[_0x597598];return _0x3df496;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x44c2('0x0'))('api');var moment=require(_0x44c2('0x1'));var BPromise=require(_0x44c2('0x2'));var rp=require(_0x44c2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44c2('0x4'));var config=require(_0x44c2('0x5'));var attributes=require(_0x44c2('0x6'));module[_0x44c2('0x7')]=function(_0x138eb3,_0x4ddbc8){return _0x138eb3[_0x44c2('0x8')](_0x44c2('0x9'),attributes,{'tableName':_0x44c2('0xa'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x44c2('0xb'),_0x44c2('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf3b3=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xf3b3,0x1f1));var _0x3f3b=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0xf3b3[_0x383356];return _0x32ee5a;};'use strict';var _=require('lodash');var util=require(_0x3f3b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3f3b('0x1'));var BPromise=require('bluebird');var rp=require(_0x3f3b('0x2'));var fs=require('fs');var path=require(_0x3f3b('0x3'));var rimraf=require(_0x3f3b('0x4'));var config=require(_0x3f3b('0x5'));var attributes=require(_0x3f3b('0x6'));module[_0x3f3b('0x7')]=function(_0x2517a5,_0x239756){return _0x2517a5[_0x3f3b('0x8')](_0x3f3b('0x9'),attributes,{'tableName':_0x3f3b('0xa'),'paranoid':![],'indexes':[{'name':_0x3f3b('0xb'),'fields':[_0x3f3b('0xc'),_0x3f3b('0xd')],'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 8dc2414..21b94bc 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 _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x3d8977,_0x244dee){var _0xe6d544=function(_0x112b00){while(--_0x112b00){_0x3d8977['push'](_0x3d8977['shift']());}};_0xe6d544(++_0x244dee);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x52a99c,_0x386807){_0x52a99c=_0x52a99c-0x0;var _0x3cf27f=_0xc1c6[_0x52a99c];return _0x3cf27f;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file +var _0x80c3=['message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s'];(function(_0x423a30,_0x591f95){var _0x237086=function(_0x3ff512){while(--_0x3ff512){_0x423a30['push'](_0x423a30['shift']());}};_0x237086(++_0x591f95);}(_0x80c3,0x18f));var _0x380c=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0x80c3[_0x56756b];return _0xa3002;};'use strict';var _=require(_0x380c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x380c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x380c('0x2'));var db=require(_0x380c('0x3'))['db'];var utils=require(_0x380c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x380c('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x332ed3,_0x395efa,_0x1cdbad){return new BPromise(function(_0x59445f,_0x1d853e){return client[_0x380c('0x6')](_0x332ed3,_0x1cdbad)['then'](function(_0xdd635d){logger[_0x380c('0x7')]('Dynamics365Field,\x20%s,\x20%s',_0x395efa,_0x380c('0x8'));logger[_0x380c('0x9')](_0x380c('0xa'),_0x395efa,'request\x20sent',JSON[_0x380c('0xb')](_0xdd635d));if(_0xdd635d[_0x380c('0xc')]){if(_0xdd635d[_0x380c('0xc')][_0x380c('0xd')]===0x1f4){logger[_0x380c('0xc')](_0x380c('0xe'),_0x395efa,_0xdd635d[_0x380c('0xc')][_0x380c('0xf')]);return _0x1d853e(_0xdd635d[_0x380c('0xc')][_0x380c('0xf')]);}logger['error'](_0x380c('0xe'),_0x395efa,_0xdd635d[_0x380c('0xc')]['message']);return _0x59445f(_0xdd635d[_0x380c('0xc')][_0x380c('0xf')]);}else{logger[_0x380c('0x7')](_0x380c('0xe'),_0x395efa,_0x380c('0x8'));_0x59445f(_0xdd635d[_0x380c('0x10')][_0x380c('0xf')]);}})[_0x380c('0x11')](function(_0x3022e6){logger['error'](_0x380c('0xe'),_0x395efa,_0x3022e6);_0x1d853e(_0x3022e6);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index e6f9566..8cce865 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 _0x2d2e=['getConfigurations','getFields','post','create','addConfiguration','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x51498d,_0x57db51){var _0x48acb6=function(_0x2e94b3){while(--_0x2e94b3){_0x51498d['push'](_0x51498d['shift']());}};_0x48acb6(++_0x57db51);}(_0x2d2e,0x106));var _0xe2d2=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x2d2e[_0x1d6a82];return _0x5834ac;};'use strict';var multer=require('multer');var util=require(_0xe2d2('0x0'));var path=require(_0xe2d2('0x1'));var timeout=require(_0xe2d2('0x2'));var express=require(_0xe2d2('0x3'));var router=express[_0xe2d2('0x4')]();var auth=require(_0xe2d2('0x5'));var interaction=require(_0xe2d2('0x6'));var config=require(_0xe2d2('0x7'));var controller=require(_0xe2d2('0x8'));router[_0xe2d2('0x9')]('/',auth[_0xe2d2('0xa')](),controller['index']);router[_0xe2d2('0x9')](_0xe2d2('0xb'),auth[_0xe2d2('0xa')](),controller[_0xe2d2('0xc')]);router['get'](_0xe2d2('0xd'),auth[_0xe2d2('0xa')](),controller[_0xe2d2('0xe')]);router['get']('/:id/fields',auth[_0xe2d2('0xa')](),controller[_0xe2d2('0xf')]);router[_0xe2d2('0x10')]('/',auth[_0xe2d2('0xa')](),controller[_0xe2d2('0x11')]);router[_0xe2d2('0x10')](_0xe2d2('0xd'),auth[_0xe2d2('0xa')](),controller[_0xe2d2('0x12')]);router[_0xe2d2('0x13')](_0xe2d2('0xb'),auth[_0xe2d2('0xa')](),controller['update']);router[_0xe2d2('0x14')](_0xe2d2('0xb'),auth[_0xe2d2('0xa')](),controller[_0xe2d2('0x15')]);module[_0xe2d2('0x16')]=router; \ No newline at end of file +var _0x7ce8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','/:id','update','delete','destroy','exports','multer'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7ce8,0x15d));var _0x87ce=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x7ce8[_0x1d94d1];return _0x23c397;};'use strict';var multer=require(_0x87ce('0x0'));var util=require(_0x87ce('0x1'));var path=require(_0x87ce('0x2'));var timeout=require(_0x87ce('0x3'));var express=require(_0x87ce('0x4'));var router=express[_0x87ce('0x5')]();var auth=require(_0x87ce('0x6'));var interaction=require(_0x87ce('0x7'));var config=require(_0x87ce('0x8'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x87ce('0x9')](),controller[_0x87ce('0xa')]);router[_0x87ce('0xb')]('/:id',auth[_0x87ce('0x9')](),controller[_0x87ce('0xc')]);router[_0x87ce('0xb')](_0x87ce('0xd'),auth[_0x87ce('0x9')](),controller[_0x87ce('0xe')]);router['get'](_0x87ce('0xf'),auth[_0x87ce('0x9')](),controller[_0x87ce('0x10')]);router['post']('/',auth[_0x87ce('0x9')](),controller['create']);router[_0x87ce('0x11')](_0x87ce('0xd'),auth[_0x87ce('0x9')](),controller[_0x87ce('0x12')]);router[_0x87ce('0x13')](_0x87ce('0x14'),auth['isAuthenticated'](),controller[_0x87ce('0x15')]);router[_0x87ce('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x87ce('0x17')]);module[_0x87ce('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c5cbe67..0e7a36f 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 _0xe34f=['username','remoteUri','STRING'];(function(_0x434a7b,_0x1f126c){var _0x5eaff0=function(_0x45b7ac){while(--_0x45b7ac){_0x434a7b['push'](_0x434a7b['shift']());}};_0x5eaff0(++_0x1f126c);}(_0xe34f,0xbc));var _0xfe34=function(_0x5c286c,_0xb10ce5){_0x5c286c=_0x5c286c-0x0;var _0x4b0e7c=_0xe34f[_0x5c286c];return _0x4b0e7c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe34('0x0')],'unique':_0xfe34('0x1')},'apiKey':{'type':Sequelize[_0xfe34('0x0')]},'remoteUri':{'type':Sequelize[_0xfe34('0x0')],'unique':_0xfe34('0x2')},'serverUrl':{'type':Sequelize[_0xfe34('0x0')]}}; \ No newline at end of file +var _0xe785=['sequelize','exports','STRING','username'];(function(_0x13bafa,_0x56918c){var _0x3c317f=function(_0x171f70){while(--_0x171f70){_0x13bafa['push'](_0x13bafa['shift']());}};_0x3c317f(++_0x56918c);}(_0xe785,0x128));var _0x5e78=function(_0x5ca471,_0x2fb4de){_0x5ca471=_0x5ca471-0x0;var _0x1025c3=_0xe785[_0x5ca471];return _0x1025c3;};'use strict';var Sequelize=require(_0x5e78('0x0'));module[_0x5e78('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5e78('0x2')]},'username':{'type':Sequelize[_0x5e78('0x2')],'unique':_0x5e78('0x3')},'apiKey':{'type':Sequelize[_0x5e78('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x5e78('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index eaff202..e0538c4 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 _0x326f=['offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','FreshdeskConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','FreshdeskField','Subjects','getFields','apiKey','remoteUri','slice','substring','GET','api/v2/ticket_fields','format','base64','requester','subject','description','source','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','Sequelize','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count'];(function(_0x270928,_0x461c5f){var _0x56cae1=function(_0x46218e){while(--_0x46218e){_0x270928['push'](_0x270928['shift']());}};_0x56cae1(++_0x461c5f);}(_0x326f,0xd1));var _0xf326=function(_0x437356,_0x22a39b){_0x437356=_0x437356-0x0;var _0x46c1fb=_0x326f[_0x437356];return _0x46c1fb;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf326('0x17'));var client=jayson[_0xf326('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x342fe5,_0x472632,_0x3504eb){if(_0x3504eb){var _0x17a098=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17a098['test'](_0x472632)){return _0x342fe5;}else{throw new db[(_0xf326('0x19'))]['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 _0x342fe5;}}function respondWithRpcPromise(_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return new BPromise(function(_0x292f4b,_0x287a2a){var _0x34128e=_0xa63d1a||client;return _0x34128e[_0xf326('0x1a')](_0xdf21d9,_0x1f2e5a)['then'](function(_0x3ad7da){logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x11f6d2,'request\x20sent',JSON['stringify'](_0x3ad7da));if(_0x3ad7da['error']){if(_0x3ad7da[_0xf326('0x20')][_0xf326('0x21')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da['error'][_0xf326('0x22')]);return _0x292f4b(_0x3ad7da[_0xf326('0x20')]['message']);}else{logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));_0x292f4b(_0x3ad7da[_0xf326('0x23')][_0xf326('0x22')]);}})[_0xf326('0x24')](function(_0x5ce532){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x11f6d2,_0x5ce532);_0x287a2a(_0x5ce532);});});}function respondWithStatusCode(_0x520d85,_0x1a2c4e){_0x1a2c4e=_0x1a2c4e||0xcc;return function(_0x2cd45a){if(_0x2cd45a){return _0x520d85[_0xf326('0x25')](_0x1a2c4e);}return _0x520d85[_0xf326('0x26')](_0x1a2c4e)[_0xf326('0x27')]();};}function respondWithResult(_0x5217d4,_0x201d28){_0x201d28=_0x201d28||0xc8;return function(_0xa3c0b){if(_0xa3c0b){return _0x5217d4[_0xf326('0x26')](_0x201d28)['json'](_0xa3c0b);}};}function respondWithFilteredResult(_0x1617d2,_0x55ad0f){return function(_0x4a9abf){if(_0x4a9abf){var _0x6a8e89=_0x4a9abf[_0xf326('0x28')],_0x1ae23a=_0x55ad0f[_0xf326('0x29')],_0x2fa28e=_0x55ad0f['offset']+_0x55ad0f[_0xf326('0x2a')],_0x5dbe63;if(_0x2fa28e>=_0x6a8e89){_0x2fa28e=_0x6a8e89;_0x5dbe63=0xc8;}else{_0x5dbe63=0xce;}_0x1617d2[_0xf326('0x26')](_0x5dbe63);return _0x1617d2[_0xf326('0x2b')](_0xf326('0x2c'),_0x1ae23a+'-'+_0x2fa28e+'/'+_0x6a8e89)[_0xf326('0x2d')](_0x4a9abf);}return null;};}function patchUpdates(_0x269be9){return function(_0x161143){try{jsonpatch[_0xf326('0x2e')](_0x161143,_0x269be9,!![]);}catch(_0x43b951){return BPromise[_0xf326('0x2f')](_0x43b951);}return _0x161143['save']();};}function saveUpdates(_0x1035ed,_0x424104){return function(_0x21b23d){if(_0x21b23d){return _0x21b23d['update'](_0x1035ed)[_0xf326('0x30')](function(_0x1721fd){return _0x1721fd;});}return null;};}function removeEntity(_0x303dc6,_0x4df451){return function(_0x5b101d){if(_0x5b101d){return _0x5b101d[_0xf326('0x31')]()[_0xf326('0x30')](function(){_0x303dc6[_0xf326('0x26')](0xcc)[_0xf326('0x27')]();});}};}function handleEntityNotFound(_0x30694f,_0x2e8a64){return function(_0x62585a){if(!_0x62585a){_0x30694f[_0xf326('0x25')](0x194);}return _0x62585a;};}function handleError(_0x580374,_0x461e93){_0x461e93=_0x461e93||0x1f4;return function(_0x1981bc){logger['error'](_0x1981bc[_0xf326('0x32')]);if(_0x1981bc['name']){delete _0x1981bc[_0xf326('0x33')];}_0x580374['status'](_0x461e93)['send'](_0x1981bc);};}exports[_0xf326('0x34')]=function(_0x4d8eac,_0x40dcb4){var _0x57aa27={},_0x310dbb={},_0x409260={'count':0x0,'rows':[]};var _0x2750ae=_['map'](db[_0xf326('0x35')][_0xf326('0x36')],function(_0x48525a){return{'name':_0x48525a[_0xf326('0x37')],'type':_0x48525a[_0xf326('0x38')][_0xf326('0x39')]};});_0x310dbb[_0xf326('0x3a')]=_['map'](_0x2750ae,_0xf326('0x33'));_0x310dbb[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4d8eac[_0xf326('0x3b')]);_0x310dbb[_0xf326('0x3d')]=_['intersection'](_0x310dbb[_0xf326('0x3a')],_0x310dbb[_0xf326('0x3b')]);_0x57aa27['attributes']=_['intersection'](_0x310dbb[_0xf326('0x3a')],qs['fields'](_0x4d8eac['query'][_0xf326('0x3e')]));_0x57aa27['attributes']=_0x57aa27[_0xf326('0x3f')][_0xf326('0x40')]?_0x57aa27[_0xf326('0x3f')]:_0x310dbb[_0xf326('0x3a')];if(!_0x4d8eac['query'][_0xf326('0x41')](_0xf326('0x42'))){_0x57aa27[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x2a')]);_0x57aa27[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x29')]);}_0x57aa27[_0xf326('0x43')]=qs[_0xf326('0x44')](_0x4d8eac['query'][_0xf326('0x44')]);_0x57aa27[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x4d8eac[_0xf326('0x3b')],_0x310dbb[_0xf326('0x3d')]),_0x2750ae);if(_0x4d8eac['query'][_0xf326('0x47')]){_0x57aa27[_0xf326('0x45')]=_['merge'](_0x57aa27[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x2750ae,function(_0x130c56){if(_0x130c56[_0xf326('0x38')]!==_0xf326('0x49')){var _0x55361f={};_0x55361f[_0x130c56['name']]={'$like':'%'+_0x4d8eac[_0xf326('0x3b')][_0xf326('0x47')]+'%'};return _0x55361f;}})});}_0x57aa27=_['merge']({},_0x57aa27,_0x4d8eac['options']);var _0x8e318d={'where':_0x57aa27[_0xf326('0x45')]};return db[_0xf326('0x35')]['count'](_0x8e318d)[_0xf326('0x30')](function(_0xe96e1e){_0x409260[_0xf326('0x28')]=_0xe96e1e;if(_0x4d8eac[_0xf326('0x3b')][_0xf326('0x4a')]){_0x57aa27[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x35')][_0xf326('0x4c')](_0x57aa27);})[_0xf326('0x30')](function(_0x27ced1){_0x409260[_0xf326('0x4d')]=_0x27ced1;return _0x409260;})[_0xf326('0x30')](respondWithFilteredResult(_0x40dcb4,_0x57aa27))[_0xf326('0x24')](handleError(_0x40dcb4,null));};exports[_0xf326('0x4e')]=function(_0xeac1a1,_0x59f9a7){var _0x199f8b={'raw':![],'where':{'id':_0xeac1a1[_0xf326('0x4f')]['id']}},_0x1b0e03={};_0x1b0e03[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x35')][_0xf326('0x36')]);_0x1b0e03[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xeac1a1['query']);_0x1b0e03[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x1b0e03[_0xf326('0x3a')],_0x1b0e03[_0xf326('0x3b')]);_0x199f8b[_0xf326('0x3f')]=_['intersection'](_0x1b0e03['model'],qs[_0xf326('0x3e')](_0xeac1a1[_0xf326('0x3b')][_0xf326('0x3e')]));_0x199f8b['attributes']=_0x199f8b[_0xf326('0x3f')][_0xf326('0x40')]?_0x199f8b[_0xf326('0x3f')]:_0x1b0e03['model'];if(_0xeac1a1['query'][_0xf326('0x4a')]){_0x199f8b['include']=[{'all':!![]}];}_0x199f8b=_[_0xf326('0x51')]({},_0x199f8b,_0xeac1a1['options']);return db[_0xf326('0x35')][_0xf326('0x52')](_0x199f8b)[_0xf326('0x30')](handleEntityNotFound(_0x59f9a7,null))[_0xf326('0x30')](respondWithResult(_0x59f9a7,null))[_0xf326('0x24')](handleError(_0x59f9a7,null));};exports[_0xf326('0x53')]=function(_0x7f7ece,_0x495a16){return db[_0xf326('0x35')][_0xf326('0x53')](_0x7f7ece[_0xf326('0x54')],{})['then'](respondWithResult(_0x495a16,0xc9))[_0xf326('0x24')](handleError(_0x495a16,null));};exports[_0xf326('0x55')]=function(_0x3b8635,_0x16c578){if(_0x3b8635[_0xf326('0x54')]['id']){delete _0x3b8635['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x3b8635[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x16c578,null))['then'](saveUpdates(_0x3b8635[_0xf326('0x54')],null))[_0xf326('0x30')](respondWithResult(_0x16c578,null))[_0xf326('0x24')](handleError(_0x16c578,null));};exports[_0xf326('0x31')]=function(_0x4d3b9e,_0x5be2b1){return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x4d3b9e['params']['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x5be2b1,null))[_0xf326('0x30')](removeEntity(_0x5be2b1,null))[_0xf326('0x24')](handleError(_0x5be2b1,null));};exports[_0xf326('0x56')]=function(_0x5765b0,_0xb1c18c,_0x5657b7){var _0x5dbeb9={};var _0x9d84c3={};var _0x51d466;var _0x173760;return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x5765b0['params']['id']}})['then'](handleEntityNotFound(_0xb1c18c,null))[_0xf326('0x30')](function(_0xa85a42){if(_0xa85a42){_0x51d466=_0xa85a42;_0x9d84c3[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x58')]['rawAttributes']);_0x9d84c3[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5765b0[_0xf326('0x3b')]);_0x9d84c3[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],_0x9d84c3[_0xf326('0x3b')]);_0x5dbeb9[_0xf326('0x3f')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],qs[_0xf326('0x3e')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x3e')]));_0x5dbeb9['attributes']=_0x5dbeb9[_0xf326('0x3f')]['length']?_0x5dbeb9[_0xf326('0x3f')]:_0x9d84c3[_0xf326('0x3a')];_0x5dbeb9['order']=qs[_0xf326('0x44')](_0x5765b0['query'][_0xf326('0x44')]);_0x5dbeb9[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x5765b0[_0xf326('0x3b')],_0x9d84c3['filters']));if(_0x5765b0['query'][_0xf326('0x47')]){_0x5dbeb9[_0xf326('0x45')]=_[_0xf326('0x51')](_0x5dbeb9[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x5dbeb9['attributes'],function(_0x28c4f2){var _0x471da8={};_0x471da8[_0x28c4f2]={'$like':'%'+_0x5765b0['query']['filter']+'%'};return _0x471da8;})});}_0x5dbeb9=_['merge']({},_0x5dbeb9,_0x5765b0[_0xf326('0x59')]);return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})[_0xf326('0x30')](function(_0x235525){if(_0x235525){_0x173760=_0x235525[_0xf326('0x40')];if(!_0x5765b0[_0xf326('0x3b')][_0xf326('0x41')]('nolimit')){_0x5dbeb9[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x2a')]);_0x5dbeb9['offset']=qs[_0xf326('0x29')](_0x5765b0['query']['offset']);}return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})['then'](function(_0x78ba34){if(_0x78ba34){return _0x78ba34?{'count':_0x173760,'rows':_0x78ba34}:null;}})[_0xf326('0x30')](respondWithResult(_0xb1c18c,null))[_0xf326('0x24')](handleError(_0xb1c18c,null));};exports[_0xf326('0x5a')]=function(_0x17cd36,_0x541491,_0x4a053c){if(_0x17cd36['body']['id']){delete _0x17cd36[_0xf326('0x54')]['id'];}return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x17cd36[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x541491,null))['then'](function(_0x1ed961){if(_0x1ed961){_0x17cd36[_0xf326('0x54')][_0xf326('0x5b')]=_0x1ed961['id'];_0x17cd36['body']['Subjects']=integrations[_0xf326('0x5c')](_0x17cd36[_0xf326('0x54')]['channel'],_0x17cd36['body'][_0xf326('0x38')]);_0x17cd36['body'][_0xf326('0x5d')]=integrations['getDescriptions'](_0x17cd36['body']['channel'],_0x17cd36[_0xf326('0x54')][_0xf326('0x38')]);return db[_0xf326('0x58')]['create'](_0x17cd36[_0xf326('0x54')],{'include':[{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5f')},{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5d')}]});}return null;})[_0xf326('0x30')](respondWithResult(_0x541491,null))[_0xf326('0x24')](handleError(_0x541491,null));};exports[_0xf326('0x60')]=function(_0x3855a4,_0x5290da,_0x34c3cf){var _0x5b1494='';return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id','remoteUri',_0xf326('0x61')]})[_0xf326('0x30')](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x4dc8d7){if(_0x4dc8d7){_0x5b1494=_0x4dc8d7[_0xf326('0x62')];var _0x4057e1=_0x5b1494[_0xf326('0x63')](-0x1);if(_0x4057e1==='/'){_0x5b1494=_0x5b1494[_0xf326('0x64')](0x0,_0x5b1494['lastIndexOf'](_0x4057e1));}return rp({'method':_0xf326('0x65'),'uri':util['format']('%s/%s',_0x5b1494,_0xf326('0x66')),'headers':{'Authorization':util[_0xf326('0x67')]('Basic\x20%s',new Buffer(util['format']('%s:X',_0x4dc8d7[_0xf326('0x61')]))['toString'](_0xf326('0x68')))},'json':!![]});}})[_0xf326('0x30')](function(_0x3434b2){if(_0x3434b2){var _0x2ec314=[_0xf326('0x69'),_0xf326('0x6a'),'agent',_0xf326('0x6b'),_0xf326('0x26'),'priority','group',_0xf326('0x6c'),'ticket_type',_0xf326('0x6d'),_0xf326('0x6e')];_[_0xf326('0x6f')](_0x3434b2,function(_0x363e64){return _0x2ec314[_0xf326('0x70')](_0x363e64[_0xf326('0x33')])||!_0x363e64[_0xf326('0x71')]&&_0x363e64[_0xf326('0x38')]!==_0xf326('0x72')&&_0x363e64['type']!==_0xf326('0x73');});return{'count':_0x3434b2[_0xf326('0x40')],'rows':_['map'](_0x3434b2,function(_0x3c82cf){return{'id':_0x3c82cf['name'],'name':_0x3c82cf[_0xf326('0x74')],'custom':!_0x3c82cf[_0xf326('0x71')],'options':_0x3c82cf[_0xf326('0x75')]?_['map'](_0x3c82cf[_0xf326('0x75')],function(_0x1c86c8){return{'name':_[_0xf326('0x76')](_0x1c86c8),'value':_0x1c86c8};}):[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x1e50aa){var _0x148779=_0x3855a4[_0xf326('0x3b')][_0xf326('0x77')]?0x1f4:_0x1e50aa[_0xf326('0x78')]||0x1f4;logger[_0xf326('0x20')](_0xf326('0x79'),_0xf326('0x60'),_0x148779,JSON[_0xf326('0x7a')](_0x1e50aa));delete _0x1e50aa[_0xf326('0x33')];if(_0x148779===0x191){_0x148779=0x190;}_0x5290da['status'](_0x148779)[_0xf326('0x7b')](_0x3855a4[_0xf326('0x3b')]['test']?{'message':_0xf326('0x7c'),'statusCode':_0x1e50aa[_0xf326('0x78')]}:_0x1e50aa);});}; \ No newline at end of file +var _0x5fc3=['params','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','base64','requester','subject','agent','description','group','company','remove','includes','default','custom_text','label','choices','capitalize','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','client','test','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','filters','filter','where','merge','FreshdeskAccount','include','findAll','rows','show'];(function(_0x2c6d13,_0x55a2ed){var _0x4163a1=function(_0x574863){while(--_0x574863){_0x2c6d13['push'](_0x2c6d13['shift']());}};_0x4163a1(++_0x55a2ed);}(_0x5fc3,0xa8));var _0x35fc=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0x5fc3[_0xcda377];return _0x1c024f;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var as=require(_0x35fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x14'))(_0x35fc('0x15'));var utils=require('../../config/utils');var config=require(_0x35fc('0x16'));var db=require(_0x35fc('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x35fc('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x397738,_0x22055e,_0x2a6ad2){if(_0x2a6ad2){var _0x29730f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29730f[_0x35fc('0x19')](_0x22055e)){return _0x397738;}else{throw new db['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~!@#$%^&-_=+[{]}.');}}else{return _0x397738;}}function respondWithRpcPromise(_0x558364,_0x398b67,_0x229d56,_0x53b898){return new BPromise(function(_0x154958,_0x227a49){var _0x1121fa=_0x53b898||client;return _0x1121fa['request'](_0x558364,_0x229d56)[_0x35fc('0x1a')](function(_0x45c8b7){logger['info'](_0x35fc('0x1b'),_0x398b67,_0x35fc('0x1c'));logger[_0x35fc('0x1d')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x398b67,_0x35fc('0x1c'),JSON[_0x35fc('0x1e')](_0x45c8b7));if(_0x45c8b7[_0x35fc('0x1f')]){if(_0x45c8b7['error'][_0x35fc('0x20')]===0x1f4){logger[_0x35fc('0x1f')](_0x35fc('0x1b'),_0x398b67,_0x45c8b7[_0x35fc('0x1f')][_0x35fc('0x21')]);return _0x227a49(_0x45c8b7[_0x35fc('0x1f')][_0x35fc('0x21')]);}logger[_0x35fc('0x1f')](_0x35fc('0x1b'),_0x398b67,_0x45c8b7[_0x35fc('0x1f')]['message']);return _0x154958(_0x45c8b7[_0x35fc('0x1f')][_0x35fc('0x21')]);}else{logger[_0x35fc('0x22')](_0x35fc('0x1b'),_0x398b67,_0x35fc('0x1c'));_0x154958(_0x45c8b7['result'][_0x35fc('0x21')]);}})[_0x35fc('0x23')](function(_0x561bf8){logger[_0x35fc('0x1f')](_0x35fc('0x1b'),_0x398b67,_0x561bf8);_0x227a49(_0x561bf8);});});}function respondWithStatusCode(_0x3d4a98,_0x51cfec){_0x51cfec=_0x51cfec||0xcc;return function(_0x4086e9){if(_0x4086e9){return _0x3d4a98['sendStatus'](_0x51cfec);}return _0x3d4a98[_0x35fc('0x24')](_0x51cfec)[_0x35fc('0x25')]();};}function respondWithResult(_0x5cb986,_0x519264){_0x519264=_0x519264||0xc8;return function(_0x47774c){if(_0x47774c){return _0x5cb986['status'](_0x519264)[_0x35fc('0x26')](_0x47774c);}};}function respondWithFilteredResult(_0x1a5d92,_0x57001c){return function(_0x26b7cb){if(_0x26b7cb){var _0x645eac=_0x26b7cb[_0x35fc('0x27')],_0x383837=_0x57001c[_0x35fc('0x28')],_0x9f3c8a=_0x57001c[_0x35fc('0x28')]+_0x57001c['limit'],_0x3735da;if(_0x9f3c8a>=_0x645eac){_0x9f3c8a=_0x645eac;_0x3735da=0xc8;}else{_0x3735da=0xce;}_0x1a5d92[_0x35fc('0x24')](_0x3735da);return _0x1a5d92[_0x35fc('0x29')](_0x35fc('0x2a'),_0x383837+'-'+_0x9f3c8a+'/'+_0x645eac)['json'](_0x26b7cb);}return null;};}function patchUpdates(_0xe79f52){return function(_0x16f067){try{jsonpatch[_0x35fc('0x2b')](_0x16f067,_0xe79f52,!![]);}catch(_0xe6e4ba){return BPromise[_0x35fc('0x2c')](_0xe6e4ba);}return _0x16f067[_0x35fc('0x2d')]();};}function saveUpdates(_0x222ddb,_0x37b435){return function(_0xf4dfab){if(_0xf4dfab){return _0xf4dfab[_0x35fc('0x2e')](_0x222ddb)['then'](function(_0x5e0313){return _0x5e0313;});}return null;};}function removeEntity(_0x114bc1,_0x4af5fe){return function(_0x37b394){if(_0x37b394){return _0x37b394[_0x35fc('0x2f')]()[_0x35fc('0x1a')](function(){_0x114bc1[_0x35fc('0x24')](0xcc)[_0x35fc('0x25')]();});}};}function handleEntityNotFound(_0x12e78f,_0x4e43b4){return function(_0x3fe193){if(!_0x3fe193){_0x12e78f[_0x35fc('0x30')](0x194);}return _0x3fe193;};}function handleError(_0x46b9ef,_0x4441d8){_0x4441d8=_0x4441d8||0x1f4;return function(_0x2bbd36){logger[_0x35fc('0x1f')](_0x2bbd36['stack']);if(_0x2bbd36[_0x35fc('0x31')]){delete _0x2bbd36[_0x35fc('0x31')];}_0x46b9ef[_0x35fc('0x24')](_0x4441d8)['send'](_0x2bbd36);};}exports[_0x35fc('0x32')]=function(_0x48d223,_0x2ecb2e){var _0x33a377={},_0x266a11={},_0x2e00e3={'count':0x0,'rows':[]};var _0x4de4b7=_['map'](db['FreshdeskAccount'][_0x35fc('0x33')],function(_0x56c06c){return{'name':_0x56c06c[_0x35fc('0x34')],'type':_0x56c06c['type'][_0x35fc('0x35')]};});_0x266a11[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0x4de4b7,_0x35fc('0x31'));_0x266a11[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x48d223[_0x35fc('0x38')]);_0x266a11['filters']=_[_0x35fc('0x3a')](_0x266a11[_0x35fc('0x36')],_0x266a11['query']);_0x33a377[_0x35fc('0x3b')]=_[_0x35fc('0x3a')](_0x266a11[_0x35fc('0x36')],qs[_0x35fc('0x3c')](_0x48d223[_0x35fc('0x38')][_0x35fc('0x3c')]));_0x33a377['attributes']=_0x33a377[_0x35fc('0x3b')][_0x35fc('0x3d')]?_0x33a377[_0x35fc('0x3b')]:_0x266a11['model'];if(!_0x48d223[_0x35fc('0x38')][_0x35fc('0x3e')]('nolimit')){_0x33a377[_0x35fc('0x3f')]=qs[_0x35fc('0x3f')](_0x48d223[_0x35fc('0x38')][_0x35fc('0x3f')]);_0x33a377[_0x35fc('0x28')]=qs[_0x35fc('0x28')](_0x48d223[_0x35fc('0x38')][_0x35fc('0x28')]);}_0x33a377['order']=qs['sort'](_0x48d223[_0x35fc('0x38')][_0x35fc('0x40')]);_0x33a377['where']=qs['filters'](_['pick'](_0x48d223[_0x35fc('0x38')],_0x266a11[_0x35fc('0x41')]),_0x4de4b7);if(_0x48d223['query'][_0x35fc('0x42')]){_0x33a377[_0x35fc('0x43')]=_[_0x35fc('0x44')](_0x33a377[_0x35fc('0x43')],{'$or':_['map'](_0x4de4b7,function(_0x57105c){if(_0x57105c['type']!=='VIRTUAL'){var _0x56bdb9={};_0x56bdb9[_0x57105c[_0x35fc('0x31')]]={'$like':'%'+_0x48d223[_0x35fc('0x38')]['filter']+'%'};return _0x56bdb9;}})});}_0x33a377=_[_0x35fc('0x44')]({},_0x33a377,_0x48d223['options']);var _0x13d16c={'where':_0x33a377[_0x35fc('0x43')]};return db[_0x35fc('0x45')][_0x35fc('0x27')](_0x13d16c)[_0x35fc('0x1a')](function(_0x5d3d0f){_0x2e00e3[_0x35fc('0x27')]=_0x5d3d0f;if(_0x48d223[_0x35fc('0x38')]['includeAll']){_0x33a377[_0x35fc('0x46')]=[{'all':!![]}];}return db[_0x35fc('0x45')][_0x35fc('0x47')](_0x33a377);})[_0x35fc('0x1a')](function(_0x5bc8c3){_0x2e00e3[_0x35fc('0x48')]=_0x5bc8c3;return _0x2e00e3;})['then'](respondWithFilteredResult(_0x2ecb2e,_0x33a377))['catch'](handleError(_0x2ecb2e,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){var _0xca8aef={'raw':![],'where':{'id':_0x9db7e8[_0x35fc('0x4a')]['id']}},_0xf2ca20={};_0xf2ca20[_0x35fc('0x36')]=_[_0x35fc('0x39')](db['FreshdeskAccount'][_0x35fc('0x33')]);_0xf2ca20[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x9db7e8[_0x35fc('0x38')]);_0xf2ca20[_0x35fc('0x41')]=_[_0x35fc('0x3a')](_0xf2ca20[_0x35fc('0x36')],_0xf2ca20[_0x35fc('0x38')]);_0xca8aef[_0x35fc('0x3b')]=_[_0x35fc('0x3a')](_0xf2ca20[_0x35fc('0x36')],qs[_0x35fc('0x3c')](_0x9db7e8[_0x35fc('0x38')][_0x35fc('0x3c')]));_0xca8aef['attributes']=_0xca8aef['attributes'][_0x35fc('0x3d')]?_0xca8aef[_0x35fc('0x3b')]:_0xf2ca20[_0x35fc('0x36')];if(_0x9db7e8[_0x35fc('0x38')][_0x35fc('0x4b')]){_0xca8aef[_0x35fc('0x46')]=[{'all':!![]}];}_0xca8aef=_['merge']({},_0xca8aef,_0x9db7e8['options']);return db[_0x35fc('0x45')][_0x35fc('0x4c')](_0xca8aef)[_0x35fc('0x1a')](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x1a')](respondWithResult(_0x18dc78,null))['catch'](handleError(_0x18dc78,null));};exports[_0x35fc('0x4d')]=function(_0x13281f,_0x4965d2){return db[_0x35fc('0x45')][_0x35fc('0x4d')](_0x13281f['body'],{})[_0x35fc('0x1a')](respondWithResult(_0x4965d2,0xc9))[_0x35fc('0x23')](handleError(_0x4965d2,null));};exports[_0x35fc('0x2e')]=function(_0x18f18b,_0x5e4018){if(_0x18f18b['body']['id']){delete _0x18f18b['body']['id'];}return db[_0x35fc('0x45')][_0x35fc('0x4c')]({'where':{'id':_0x18f18b['params']['id']}})[_0x35fc('0x1a')](handleEntityNotFound(_0x5e4018,null))[_0x35fc('0x1a')](saveUpdates(_0x18f18b[_0x35fc('0x4e')],null))[_0x35fc('0x1a')](respondWithResult(_0x5e4018,null))[_0x35fc('0x23')](handleError(_0x5e4018,null));};exports['destroy']=function(_0x2d9d45,_0x757aa6){return db[_0x35fc('0x45')]['find']({'where':{'id':_0x2d9d45[_0x35fc('0x4a')]['id']}})[_0x35fc('0x1a')](handleEntityNotFound(_0x757aa6,null))['then'](removeEntity(_0x757aa6,null))[_0x35fc('0x23')](handleError(_0x757aa6,null));};exports[_0x35fc('0x4f')]=function(_0x1c46b1,_0x1c4c33,_0x314666){var _0x41453b={};var _0x8501d1={};var _0x998fd9;var _0x53a79d;return db[_0x35fc('0x45')][_0x35fc('0x50')]({'where':{'id':_0x1c46b1[_0x35fc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c4c33,null))[_0x35fc('0x1a')](function(_0x559d2b){if(_0x559d2b){_0x998fd9=_0x559d2b;_0x8501d1['model']=_['keys'](db[_0x35fc('0x51')][_0x35fc('0x33')]);_0x8501d1[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x1c46b1[_0x35fc('0x38')]);_0x8501d1['filters']=_['intersection'](_0x8501d1['model'],_0x8501d1['query']);_0x41453b['attributes']=_[_0x35fc('0x3a')](_0x8501d1[_0x35fc('0x36')],qs[_0x35fc('0x3c')](_0x1c46b1[_0x35fc('0x38')]['fields']));_0x41453b[_0x35fc('0x3b')]=_0x41453b[_0x35fc('0x3b')][_0x35fc('0x3d')]?_0x41453b[_0x35fc('0x3b')]:_0x8501d1[_0x35fc('0x36')];_0x41453b[_0x35fc('0x52')]=qs[_0x35fc('0x40')](_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x40')]);_0x41453b['where']=qs[_0x35fc('0x41')](_['pick'](_0x1c46b1[_0x35fc('0x38')],_0x8501d1[_0x35fc('0x41')]));if(_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x42')]){_0x41453b['where']=_[_0x35fc('0x44')](_0x41453b['where'],{'$or':_['map'](_0x41453b['attributes'],function(_0x10dd1a){var _0x5dfeb7={};_0x5dfeb7[_0x10dd1a]={'$like':'%'+_0x1c46b1[_0x35fc('0x38')]['filter']+'%'};return _0x5dfeb7;})});}_0x41453b=_[_0x35fc('0x44')]({},_0x41453b,_0x1c46b1['options']);return _0x998fd9[_0x35fc('0x4f')](_0x41453b);}})[_0x35fc('0x1a')](function(_0x3400f0){if(_0x3400f0){_0x53a79d=_0x3400f0[_0x35fc('0x3d')];if(!_0x1c46b1['query'][_0x35fc('0x3e')](_0x35fc('0x53'))){_0x41453b[_0x35fc('0x3f')]=qs['limit'](_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x3f')]);_0x41453b[_0x35fc('0x28')]=qs[_0x35fc('0x28')](_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x28')]);}return _0x998fd9[_0x35fc('0x4f')](_0x41453b);}})[_0x35fc('0x1a')](function(_0x5159a0){if(_0x5159a0){return _0x5159a0?{'count':_0x53a79d,'rows':_0x5159a0}:null;}})[_0x35fc('0x1a')](respondWithResult(_0x1c4c33,null))[_0x35fc('0x23')](handleError(_0x1c4c33,null));};exports[_0x35fc('0x54')]=function(_0x4a926d,_0x1c88d8,_0x1b76f0){if(_0x4a926d['body']['id']){delete _0x4a926d['body']['id'];}return db[_0x35fc('0x45')]['findOne']({'where':{'id':_0x4a926d[_0x35fc('0x4a')]['id']}})[_0x35fc('0x1a')](handleEntityNotFound(_0x1c88d8,null))[_0x35fc('0x1a')](function(_0x10952a){if(_0x10952a){_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x55')]=_0x10952a['id'];_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x56')]=integrations[_0x35fc('0x57')](_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x58')],_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x59')]);_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x5a')]=integrations[_0x35fc('0x5b')](_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x58')],_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x59')]);return db['FreshdeskConfiguration'][_0x35fc('0x4d')](_0x4a926d['body'],{'include':[{'model':db[_0x35fc('0x5c')],'as':_0x35fc('0x56')},{'model':db[_0x35fc('0x5c')],'as':_0x35fc('0x5a')}]});}return null;})[_0x35fc('0x1a')](respondWithResult(_0x1c88d8,null))[_0x35fc('0x23')](handleError(_0x1c88d8,null));};exports[_0x35fc('0x5d')]=function(_0x32023a,_0x2fed7b,_0x2656e5){var _0x2ee880='';return db['FreshdeskAccount'][_0x35fc('0x50')]({'where':{'id':_0x32023a[_0x35fc('0x4a')]['id']},'attributes':['id',_0x35fc('0x5e'),_0x35fc('0x5f')]})[_0x35fc('0x1a')](handleEntityNotFound(_0x2fed7b,null))[_0x35fc('0x1a')](function(_0x5416cd){if(_0x5416cd){_0x2ee880=_0x5416cd[_0x35fc('0x5e')];var _0x3353e0=_0x2ee880[_0x35fc('0x60')](-0x1);if(_0x3353e0==='/'){_0x2ee880=_0x2ee880[_0x35fc('0x61')](0x0,_0x2ee880[_0x35fc('0x62')](_0x3353e0));}return rp({'method':_0x35fc('0x63'),'uri':util[_0x35fc('0x64')](_0x35fc('0x65'),_0x2ee880,_0x35fc('0x66')),'headers':{'Authorization':util['format'](_0x35fc('0x67'),new Buffer(util['format'](_0x35fc('0x68'),_0x5416cd[_0x35fc('0x5f')]))['toString'](_0x35fc('0x69')))},'json':!![]});}})[_0x35fc('0x1a')](function(_0xcaa49){if(_0xcaa49){var _0x4274d6=[_0x35fc('0x6a'),_0x35fc('0x6b'),_0x35fc('0x6c'),_0x35fc('0x6d'),_0x35fc('0x24'),'priority','group','source','ticket_type',_0x35fc('0x6e'),_0x35fc('0x6f')];_[_0x35fc('0x70')](_0xcaa49,function(_0x1f5cbc){return _0x4274d6[_0x35fc('0x71')](_0x1f5cbc['name'])||!_0x1f5cbc[_0x35fc('0x72')]&&_0x1f5cbc[_0x35fc('0x59')]!==_0x35fc('0x73')&&_0x1f5cbc[_0x35fc('0x59')]!=='custom_dropdown';});return{'count':_0xcaa49[_0x35fc('0x3d')],'rows':_[_0x35fc('0x37')](_0xcaa49,function(_0x32b2df){return{'id':_0x32b2df['name'],'name':_0x32b2df[_0x35fc('0x74')],'custom':!_0x32b2df[_0x35fc('0x72')],'options':_0x32b2df[_0x35fc('0x75')]?_[_0x35fc('0x37')](_0x32b2df[_0x35fc('0x75')],function(_0x31d276){return{'name':_[_0x35fc('0x76')](_0x31d276),'value':_0x31d276};}):[]};})};}})[_0x35fc('0x1a')](respondWithResult(_0x2fed7b,null))['catch'](function(_0x2faff7){var _0xa2c5f8=_0x32023a[_0x35fc('0x38')][_0x35fc('0x19')]?0x1f4:_0x2faff7[_0x35fc('0x77')]||0x1f4;logger[_0x35fc('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0x35fc('0x5d'),_0xa2c5f8,JSON['stringify'](_0x2faff7));delete _0x2faff7['name'];if(_0xa2c5f8===0x191){_0xa2c5f8=0x190;}_0x2fed7b[_0x35fc('0x24')](_0xa2c5f8)['send'](_0x32023a[_0x35fc('0x38')][_0x35fc('0x19')]?{'message':_0x35fc('0x78'),'statusCode':_0x2faff7['statusCode']}:_0x2faff7);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 82fd530..483b9c4 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 _0xefdc=['FreshdeskAccount','int_freshdesk_accounts','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','exports','define'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0xefdc,0x1a6));var _0xcefd=function(_0x3d8d0a,_0x11bb87){_0x3d8d0a=_0x3d8d0a-0x0;var _0x5b9df5=_0xefdc[_0x3d8d0a];return _0x5b9df5;};'use strict';var _=require('lodash');var util=require(_0xcefd('0x0'));var logger=require(_0xcefd('0x1'))(_0xcefd('0x2'));var moment=require('moment');var BPromise=require(_0xcefd('0x3'));var rp=require(_0xcefd('0x4'));var fs=require('fs');var path=require(_0xcefd('0x5'));var rimraf=require('rimraf');var config=require(_0xcefd('0x6'));var attributes=require(_0xcefd('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xcefd('0x8')]=function(_0x332703,_0x475e25){return _0x332703[_0xcefd('0x9')](_0xcefd('0xa'),attributes,{'tableName':_0xcefd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f05=['FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0f05,0x1e3));var _0x50f0=function(_0x47c454,_0x256ebc){_0x47c454=_0x47c454-0x0;var _0x2bb87e=_0x0f05[_0x47c454];return _0x2bb87e;};'use strict';var _=require(_0x50f0('0x0'));var util=require('util');var logger=require(_0x50f0('0x1'))(_0x50f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x50f0('0x3'));var fs=require('fs');var path=require(_0x50f0('0x4'));var rimraf=require(_0x50f0('0x5'));var config=require(_0x50f0('0x6'));var attributes=require(_0x50f0('0x7'));var integrations=require(_0x50f0('0x8'));module[_0x50f0('0x9')]=function(_0x229976,_0x2bdd8a){return _0x229976[_0x50f0('0xa')](_0x50f0('0xb'),attributes,{'tableName':_0x50f0('0xc'),'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 0ab9dd8..2e4172c 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 _0x5fef=['client','http','request','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','FreshdeskAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','FreshdeskAccount','options','raw','where','include','map','model','attributes','stringify','GetFreshdeskAccount','ShowFreshdeskAccount','find','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x8e68e5,_0x430c07){var _0x48f0d4=function(_0x5e60d6){while(--_0x5e60d6){_0x8e68e5['push'](_0x8e68e5['shift']());}};_0x48f0d4(++_0x430c07);}(_0x5fef,0x118));var _0xf5fe=function(_0x33828f,_0x546b9e){_0x33828f=_0x33828f-0x0;var _0x3458ab=_0x5fef[_0x33828f];return _0x3458ab;};'use strict';var _=require(_0xf5fe('0x0'));var util=require(_0xf5fe('0x1'));var moment=require('moment');var BPromise=require(_0xf5fe('0x2'));var rs=require(_0xf5fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf5fe('0x5'));var config=require(_0xf5fe('0x6'));var jayson=require(_0xf5fe('0x7'));var client=jayson[_0xf5fe('0x8')][_0xf5fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c038d,_0x13c54f,_0x376199){return new BPromise(function(_0x5d0136,_0x1b79d9){return client[_0xf5fe('0xa')](_0x3c038d,_0x376199)['then'](function(_0x102b70){logger[_0xf5fe('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x13c54f,'request\x20sent');logger[_0xf5fe('0xc')](_0xf5fe('0xd'),_0x13c54f,'request\x20sent',JSON['stringify'](_0x102b70));if(_0x102b70[_0xf5fe('0xe')]){if(_0x102b70[_0xf5fe('0xe')]['code']===0x1f4){logger[_0xf5fe('0xe')](_0xf5fe('0xf'),_0x13c54f,_0x102b70['error'][_0xf5fe('0x10')]);return _0x1b79d9(_0x102b70[_0xf5fe('0xe')][_0xf5fe('0x10')]);}logger[_0xf5fe('0xe')](_0xf5fe('0xf'),_0x13c54f,_0x102b70[_0xf5fe('0xe')][_0xf5fe('0x10')]);return _0x5d0136(_0x102b70[_0xf5fe('0xe')][_0xf5fe('0x10')]);}else{logger[_0xf5fe('0xb')](_0xf5fe('0xf'),_0x13c54f,_0xf5fe('0x11'));_0x5d0136(_0x102b70[_0xf5fe('0x12')]['message']);}})[_0xf5fe('0x13')](function(_0x3cf1a4){logger[_0xf5fe('0xe')](_0xf5fe('0xf'),_0x13c54f,_0x3cf1a4);_0x1b79d9(_0x3cf1a4);});});}exports['GetFreshdeskAccount']=function(_0x11b3cb){var _0x4e764d=this;return new Promise(function(_0x2337ea,_0x521c4d){return db[_0xf5fe('0x14')]['findAll']({'raw':_0x11b3cb['options']?_0x11b3cb[_0xf5fe('0x15')][_0xf5fe('0x16')]===undefined?!![]:![]:!![],'where':_0x11b3cb['options']?_0x11b3cb['options'][_0xf5fe('0x17')]||null:null,'attributes':_0x11b3cb[_0xf5fe('0x15')]?_0x11b3cb[_0xf5fe('0x15')]['attributes']||null:null,'limit':_0x11b3cb['options']?_0x11b3cb[_0xf5fe('0x15')]['limit']||null:null,'include':_0x11b3cb[_0xf5fe('0x15')]?_0x11b3cb['options'][_0xf5fe('0x18')]?_[_0xf5fe('0x19')](_0x11b3cb[_0xf5fe('0x15')][_0xf5fe('0x18')],function(_0x154e88){return{'model':db[_0x154e88['model']],'as':_0x154e88['as'],'attributes':_0x154e88['attributes'],'include':_0x154e88['include']?_['map'](_0x154e88[_0xf5fe('0x18')],function(_0x57130b){return{'model':db[_0x57130b[_0xf5fe('0x1a')]],'as':_0x57130b['as'],'attributes':_0x57130b['attributes'],'include':_0x57130b[_0xf5fe('0x18')]?_[_0xf5fe('0x19')](_0x57130b[_0xf5fe('0x18')],function(_0x4881bb){return{'model':db[_0x4881bb[_0xf5fe('0x1a')]],'as':_0x4881bb['as'],'attributes':_0x4881bb[_0xf5fe('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4cac5c){logger[_0xf5fe('0xb')]('GetFreshdeskAccount',_0x11b3cb);logger[_0xf5fe('0xc')]('GetFreshdeskAccount',_0x11b3cb,JSON[_0xf5fe('0x1c')](_0x4cac5c));_0x2337ea(_0x4cac5c);})[_0xf5fe('0x13')](function(_0x5a756a){logger[_0xf5fe('0xe')](_0xf5fe('0x1d'),_0x5a756a['message'],_0x11b3cb);_0x521c4d(_0x4e764d[_0xf5fe('0xe')](0x1f4,_0x5a756a[_0xf5fe('0x10')]));});});};exports[_0xf5fe('0x1e')]=function(_0x162a9c){var _0x3f94db=this;return new Promise(function(_0x3a7204,_0x465eb9){return db[_0xf5fe('0x14')][_0xf5fe('0x1f')]({'raw':_0x162a9c['options']?_0x162a9c[_0xf5fe('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x162a9c[_0xf5fe('0x15')]?_0x162a9c[_0xf5fe('0x15')][_0xf5fe('0x17')]||null:null,'attributes':_0x162a9c[_0xf5fe('0x15')]?_0x162a9c[_0xf5fe('0x15')][_0xf5fe('0x1b')]||null:null,'include':_0x162a9c['options']?_0x162a9c[_0xf5fe('0x15')][_0xf5fe('0x18')]?_[_0xf5fe('0x19')](_0x162a9c[_0xf5fe('0x15')][_0xf5fe('0x18')],function(_0x42887e){return{'model':db[_0x42887e[_0xf5fe('0x1a')]],'as':_0x42887e['as'],'attributes':_0x42887e[_0xf5fe('0x1b')],'include':_0x42887e[_0xf5fe('0x18')]?_['map'](_0x42887e[_0xf5fe('0x18')],function(_0x493fdf){return{'model':db[_0x493fdf[_0xf5fe('0x1a')]],'as':_0x493fdf['as'],'attributes':_0x493fdf['attributes'],'include':_0x493fdf[_0xf5fe('0x18')]?_[_0xf5fe('0x19')](_0x493fdf[_0xf5fe('0x18')],function(_0x1197f2){return{'model':db[_0x1197f2[_0xf5fe('0x1a')]],'as':_0x1197f2['as'],'attributes':_0x1197f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a00fc){logger[_0xf5fe('0xb')](_0xf5fe('0x1e'),_0x162a9c);logger['debug'](_0xf5fe('0x1e'),_0x162a9c,JSON[_0xf5fe('0x1c')](_0x2a00fc));_0x3a7204(_0x2a00fc);})[_0xf5fe('0x13')](function(_0x11e2c6){logger['error'](_0xf5fe('0x1e'),_0x11e2c6[_0xf5fe('0x10')],_0x162a9c);_0x465eb9(_0x3f94db[_0xf5fe('0xe')](0x1f4,_0x11e2c6[_0xf5fe('0x10')]));});});}; \ No newline at end of file +var _0x0667=['find','where','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','include','map','model','attributes','stringify','ShowFreshdeskAccount'];(function(_0x414a1e,_0x28cb45){var _0x17c34b=function(_0x4ebbb8){while(--_0x4ebbb8){_0x414a1e['push'](_0x414a1e['shift']());}};_0x17c34b(++_0x28cb45);}(_0x0667,0xe9));var _0x7066=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0667[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x7066('0x0'));var moment=require(_0x7066('0x1'));var BPromise=require(_0x7066('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7066('0x3'))['db'];var utils=require(_0x7066('0x4'));var logger=require(_0x7066('0x5'))(_0x7066('0x6'));var config=require(_0x7066('0x7'));var jayson=require(_0x7066('0x8'));var client=jayson[_0x7066('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5cec,_0x9b1f1b,_0x483c64){return new BPromise(function(_0x48cef7,_0x487bcf){return client[_0x7066('0xa')](_0x1c5cec,_0x483c64)[_0x7066('0xb')](function(_0x3d5d9f){logger[_0x7066('0xc')](_0x7066('0xd'),_0x9b1f1b,_0x7066('0xe'));logger[_0x7066('0xf')](_0x7066('0x10'),_0x9b1f1b,_0x7066('0xe'),JSON['stringify'](_0x3d5d9f));if(_0x3d5d9f[_0x7066('0x11')]){if(_0x3d5d9f[_0x7066('0x11')][_0x7066('0x12')]===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x9b1f1b,_0x3d5d9f['error'][_0x7066('0x13')]);return _0x487bcf(_0x3d5d9f[_0x7066('0x11')][_0x7066('0x13')]);}logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x9b1f1b,_0x3d5d9f[_0x7066('0x11')][_0x7066('0x13')]);return _0x48cef7(_0x3d5d9f[_0x7066('0x11')][_0x7066('0x13')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x9b1f1b,_0x7066('0xe'));_0x48cef7(_0x3d5d9f['result'][_0x7066('0x13')]);}})[_0x7066('0x14')](function(_0xd464ae){logger[_0x7066('0x11')](_0x7066('0xd'),_0x9b1f1b,_0xd464ae);_0x487bcf(_0xd464ae);});});}exports[_0x7066('0x15')]=function(_0x565e93){var _0x30747c=this;return new Promise(function(_0x163476,_0x269182){return db[_0x7066('0x16')][_0x7066('0x17')]({'raw':_0x565e93[_0x7066('0x18')]?_0x565e93[_0x7066('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x565e93[_0x7066('0x18')]?_0x565e93['options']['where']||null:null,'attributes':_0x565e93['options']?_0x565e93[_0x7066('0x18')]['attributes']||null:null,'limit':_0x565e93[_0x7066('0x18')]?_0x565e93['options']['limit']||null:null,'include':_0x565e93[_0x7066('0x18')]?_0x565e93[_0x7066('0x18')][_0x7066('0x19')]?_[_0x7066('0x1a')](_0x565e93[_0x7066('0x18')][_0x7066('0x19')],function(_0x2c5c73){return{'model':db[_0x2c5c73[_0x7066('0x1b')]],'as':_0x2c5c73['as'],'attributes':_0x2c5c73[_0x7066('0x1c')],'include':_0x2c5c73[_0x7066('0x19')]?_[_0x7066('0x1a')](_0x2c5c73[_0x7066('0x19')],function(_0x1f4626){return{'model':db[_0x1f4626[_0x7066('0x1b')]],'as':_0x1f4626['as'],'attributes':_0x1f4626[_0x7066('0x1c')],'include':_0x1f4626[_0x7066('0x19')]?_['map'](_0x1f4626[_0x7066('0x19')],function(_0x4be617){return{'model':db[_0x4be617[_0x7066('0x1b')]],'as':_0x4be617['as'],'attributes':_0x4be617['attributes']};}):[]};}):[]};}):[]:[]})[_0x7066('0xb')](function(_0x1dfdc5){logger['info'](_0x7066('0x15'),_0x565e93);logger[_0x7066('0xf')](_0x7066('0x15'),_0x565e93,JSON[_0x7066('0x1d')](_0x1dfdc5));_0x163476(_0x1dfdc5);})[_0x7066('0x14')](function(_0x2d1573){logger[_0x7066('0x11')](_0x7066('0x15'),_0x2d1573['message'],_0x565e93);_0x269182(_0x30747c[_0x7066('0x11')](0x1f4,_0x2d1573[_0x7066('0x13')]));});});};exports[_0x7066('0x1e')]=function(_0x20e539){var _0x3a40dc=this;return new Promise(function(_0x1bd216,_0x180b98){return db[_0x7066('0x16')][_0x7066('0x1f')]({'raw':_0x20e539[_0x7066('0x18')]?_0x20e539['options']['raw']===undefined?!![]:![]:!![],'where':_0x20e539[_0x7066('0x18')]?_0x20e539[_0x7066('0x18')][_0x7066('0x20')]||null:null,'attributes':_0x20e539[_0x7066('0x18')]?_0x20e539[_0x7066('0x18')]['attributes']||null:null,'include':_0x20e539[_0x7066('0x18')]?_0x20e539[_0x7066('0x18')]['include']?_[_0x7066('0x1a')](_0x20e539[_0x7066('0x18')][_0x7066('0x19')],function(_0x27f6e4){return{'model':db[_0x27f6e4['model']],'as':_0x27f6e4['as'],'attributes':_0x27f6e4[_0x7066('0x1c')],'include':_0x27f6e4['include']?_[_0x7066('0x1a')](_0x27f6e4['include'],function(_0xf64868){return{'model':db[_0xf64868[_0x7066('0x1b')]],'as':_0xf64868['as'],'attributes':_0xf64868[_0x7066('0x1c')],'include':_0xf64868[_0x7066('0x19')]?_['map'](_0xf64868[_0x7066('0x19')],function(_0x5a3573){return{'model':db[_0x5a3573[_0x7066('0x1b')]],'as':_0x5a3573['as'],'attributes':_0x5a3573[_0x7066('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36ff15){logger[_0x7066('0xc')](_0x7066('0x1e'),_0x20e539);logger[_0x7066('0xf')](_0x7066('0x1e'),_0x20e539,JSON[_0x7066('0x1d')](_0x36ff15));_0x1bd216(_0x36ff15);})[_0x7066('0x14')](function(_0x1b1864){logger['error'](_0x7066('0x1e'),_0x1b1864['message'],_0x20e539);_0x180b98(_0x3a40dc['error'](0x1f4,_0x1b1864[_0x7066('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index e62fb91..7ddb37c 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 _0xdff0=['show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','create','post','/:id/tags','setTags','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdff0,0x1ec));var _0x0dff=function(_0x5f0a26,_0x251107){_0x5f0a26=_0x5f0a26-0x0;var _0x4f6b3b=_0xdff0[_0x5f0a26];return _0x4f6b3b;};'use strict';var multer=require('multer');var util=require(_0x0dff('0x0'));var path=require('path');var timeout=require(_0x0dff('0x1'));var express=require(_0x0dff('0x2'));var router=express[_0x0dff('0x3')]();var auth=require(_0x0dff('0x4'));var interaction=require(_0x0dff('0x5'));var config=require(_0x0dff('0x6'));var controller=require(_0x0dff('0x7'));router[_0x0dff('0x8')]('/',auth['isAuthenticated'](),controller[_0x0dff('0x9')]);router[_0x0dff('0x8')](_0x0dff('0xa'),auth[_0x0dff('0xb')](),controller[_0x0dff('0xc')]);router[_0x0dff('0x8')](_0x0dff('0xd'),auth['isAuthenticated'](),controller[_0x0dff('0xe')]);router['get']('/:id/subjects',auth[_0x0dff('0xb')](),controller[_0x0dff('0xf')]);router[_0x0dff('0x8')](_0x0dff('0x10'),auth['isAuthenticated'](),controller[_0x0dff('0x11')]);router[_0x0dff('0x8')]('/:id/tags',auth[_0x0dff('0xb')](),controller[_0x0dff('0x12')]);router['post']('/',auth[_0x0dff('0xb')](),controller[_0x0dff('0x13')]);router[_0x0dff('0x14')](_0x0dff('0x15'),auth[_0x0dff('0xb')](),controller[_0x0dff('0x16')]);router[_0x0dff('0x17')](_0x0dff('0xa'),auth['isAuthenticated'](),controller[_0x0dff('0x18')]);router[_0x0dff('0x19')](_0x0dff('0xa'),auth['isAuthenticated'](),controller[_0x0dff('0x1a')]);module[_0x0dff('0x1b')]=router; \ No newline at end of file +var _0xdd59=['/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x5e70c9,_0x20238b){var _0x422dc6=function(_0x330fb9){while(--_0x330fb9){_0x5e70c9['push'](_0x5e70c9['shift']());}};_0x422dc6(++_0x20238b);}(_0xdd59,0xa3));var _0x9dd5=function(_0x1fe346,_0x137578){_0x1fe346=_0x1fe346-0x0;var _0x2e2415=_0xdd59[_0x1fe346];return _0x2e2415;};'use strict';var multer=require(_0x9dd5('0x0'));var util=require(_0x9dd5('0x1'));var path=require(_0x9dd5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dd5('0x3')]();var auth=require(_0x9dd5('0x4'));var interaction=require(_0x9dd5('0x5'));var config=require(_0x9dd5('0x6'));var controller=require(_0x9dd5('0x7'));router[_0x9dd5('0x8')]('/',auth[_0x9dd5('0x9')](),controller[_0x9dd5('0xa')]);router[_0x9dd5('0x8')](_0x9dd5('0xb'),auth[_0x9dd5('0x9')](),controller['show']);router[_0x9dd5('0x8')](_0x9dd5('0xc'),auth[_0x9dd5('0x9')](),controller[_0x9dd5('0xd')]);router[_0x9dd5('0x8')](_0x9dd5('0xe'),auth[_0x9dd5('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x9dd5('0x9')](),controller[_0x9dd5('0xf')]);router[_0x9dd5('0x8')](_0x9dd5('0x10'),auth[_0x9dd5('0x9')](),controller[_0x9dd5('0x11')]);router['post']('/',auth[_0x9dd5('0x9')](),controller['create']);router[_0x9dd5('0x12')]('/:id/tags',auth[_0x9dd5('0x9')](),controller[_0x9dd5('0x13')]);router[_0x9dd5('0x14')](_0x9dd5('0xb'),auth[_0x9dd5('0x9')](),controller[_0x9dd5('0x15')]);router[_0x9dd5('0x16')](_0x9dd5('0xb'),auth[_0x9dd5('0x9')](),controller[_0x9dd5('0x17')]);module[_0x9dd5('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 536197f..19cac63 100644 --- a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js +++ b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6af7=['exports','STRING','sequelize'];(function(_0x54dc56,_0x1089ff){var _0x3c2b85=function(_0x51e7f8){while(--_0x51e7f8){_0x54dc56['push'](_0x54dc56['shift']());}};_0x3c2b85(++_0x1089ff);}(_0x6af7,0xfe));var _0x76af=function(_0x597be7,_0x5dfabe){_0x597be7=_0x597be7-0x0;var _0x1dcc97=_0x6af7[_0x597be7];return _0x1dcc97;};'use strict';var Sequelize=require(_0x76af('0x0'));module[_0x76af('0x1')]={'name':{'type':Sequelize[_0x76af('0x2')]},'description':{'type':Sequelize[_0x76af('0x2')]}}; \ No newline at end of file +var _0xf064=['sequelize','exports','STRING'];(function(_0xe77b5d,_0x2a6f59){var _0x111ba2=function(_0x514163){while(--_0x514163){_0xe77b5d['push'](_0xe77b5d['shift']());}};_0x111ba2(++_0x2a6f59);}(_0xf064,0x144));var _0x4f06=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0xf064[_0x2181fc];return _0x315da1;};'use strict';var Sequelize=require(_0x4f06('0x0'));module[_0x4f06('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f06('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f417f23..e6d1ce8 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 _0x383d=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','findOne','order','pick','getFields','getSubjects','FreshdeskField','getDescriptions','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key'];(function(_0x4a10fe,_0x250d29){var _0x49eb71=function(_0x107615){while(--_0x107615){_0x4a10fe['push'](_0x4a10fe['shift']());}};_0x49eb71(++_0x250d29);}(_0x383d,0x86));var _0xd383=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x383d[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd383('0x0'));var zipdir=require(_0xd383('0x1'));var jsonpatch=require(_0xd383('0x2'));var rp=require('request-promise');var moment=require(_0xd383('0x3'));var BPromise=require(_0xd383('0x4'));var Mustache=require(_0xd383('0x5'));var util=require(_0xd383('0x6'));var path=require(_0xd383('0x7'));var sox=require(_0xd383('0x8'));var csv=require('to-csv');var ejs=require(_0xd383('0x9'));var fs=require('fs');var _=require(_0xd383('0xa'));var squel=require(_0xd383('0xb'));var crypto=require(_0xd383('0xc'));var jsforce=require(_0xd383('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd383('0xe'));var Papa=require(_0xd383('0xf'));var Redis=require('ioredis');var authService=require(_0xd383('0x10'));var qs=require(_0xd383('0x11'));var as=require(_0xd383('0x12'));var hardwareService=require(_0xd383('0x13'));var logger=require(_0xd383('0x14'))(_0xd383('0x15'));var utils=require('../../config/utils');var config=require(_0xd383('0x16'));var db=require(_0xd383('0x17'))['db'];var jayson=require(_0xd383('0x18'));var client=jayson[_0xd383('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x42143c,_0x23fecb,_0x208d82){if(_0x208d82){var _0x3fe48f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fe48f['test'](_0x23fecb)){return _0x42143c;}else{throw new db[(_0xd383('0x1a'))]['ValidationError'](_0xd383('0x1b'));}}else{return _0x42143c;}}function respondWithRpcPromise(_0x1e35fe,_0xf2dcb6,_0x373876,_0x387f5f){return new BPromise(function(_0x18690a,_0x5359c6){var _0x508ef9=_0x387f5f||client;return _0x508ef9[_0xd383('0x1c')](_0x1e35fe,_0x373876)[_0xd383('0x1d')](function(_0x8639e8){logger[_0xd383('0x1e')](_0xd383('0x1f'),_0xf2dcb6,_0xd383('0x20'));logger[_0xd383('0x21')](_0xd383('0x22'),_0xf2dcb6,'request\x20sent',JSON[_0xd383('0x23')](_0x8639e8));if(_0x8639e8[_0xd383('0x24')]){if(_0x8639e8[_0xd383('0x24')][_0xd383('0x25')]===0x1f4){logger[_0xd383('0x24')](_0xd383('0x1f'),_0xf2dcb6,_0x8639e8['error'][_0xd383('0x26')]);return _0x5359c6(_0x8639e8['error'][_0xd383('0x26')]);}logger['error'](_0xd383('0x1f'),_0xf2dcb6,_0x8639e8[_0xd383('0x24')]['message']);return _0x18690a(_0x8639e8[_0xd383('0x24')][_0xd383('0x26')]);}else{logger[_0xd383('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xf2dcb6,'request\x20sent');_0x18690a(_0x8639e8[_0xd383('0x27')]['message']);}})['catch'](function(_0x2a95a8){logger['error'](_0xd383('0x1f'),_0xf2dcb6,_0x2a95a8);_0x5359c6(_0x2a95a8);});});}function respondWithStatusCode(_0x5b407e,_0x4c52c7){_0x4c52c7=_0x4c52c7||0xcc;return function(_0x54afc4){if(_0x54afc4){return _0x5b407e[_0xd383('0x28')](_0x4c52c7);}return _0x5b407e[_0xd383('0x29')](_0x4c52c7)[_0xd383('0x2a')]();};}function respondWithResult(_0x554758,_0x343d4d){_0x343d4d=_0x343d4d||0xc8;return function(_0x2b3ab6){if(_0x2b3ab6){return _0x554758[_0xd383('0x29')](_0x343d4d)[_0xd383('0x2b')](_0x2b3ab6);}};}function respondWithFilteredResult(_0x27750a,_0x2c7de2){return function(_0x13d395){if(_0x13d395){var _0x208247=_0x13d395[_0xd383('0x2c')],_0x1981db=_0x2c7de2[_0xd383('0x2d')],_0x4f2ec6=_0x2c7de2[_0xd383('0x2d')]+_0x2c7de2[_0xd383('0x2e')],_0x2f1fea;if(_0x4f2ec6>=_0x208247){_0x4f2ec6=_0x208247;_0x2f1fea=0xc8;}else{_0x2f1fea=0xce;}_0x27750a[_0xd383('0x29')](_0x2f1fea);return _0x27750a[_0xd383('0x2f')](_0xd383('0x30'),_0x1981db+'-'+_0x4f2ec6+'/'+_0x208247)[_0xd383('0x2b')](_0x13d395);}return null;};}function patchUpdates(_0xcea4cf){return function(_0x1f87da){try{jsonpatch[_0xd383('0x31')](_0x1f87da,_0xcea4cf,!![]);}catch(_0x107411){return BPromise[_0xd383('0x32')](_0x107411);}return _0x1f87da[_0xd383('0x33')]();};}function saveUpdates(_0x5a2cc5,_0x2bfce1){return function(_0x476dfc){if(_0x476dfc){return _0x476dfc[_0xd383('0x34')](_0x5a2cc5)[_0xd383('0x1d')](function(_0x263ed3){return _0x263ed3;});}return null;};}function removeEntity(_0x18f305,_0x2f2d1c){return function(_0x3bb4b5){if(_0x3bb4b5){return _0x3bb4b5[_0xd383('0x35')]()['then'](function(){_0x18f305[_0xd383('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c8b2f,_0x585c1c){return function(_0x2c2e1d){if(!_0x2c2e1d){_0x2c8b2f['sendStatus'](0x194);}return _0x2c2e1d;};}function handleError(_0x15d06b,_0x1bc5a5){_0x1bc5a5=_0x1bc5a5||0x1f4;return function(_0x4be0ea){logger[_0xd383('0x24')](_0x4be0ea[_0xd383('0x36')]);if(_0x4be0ea[_0xd383('0x37')]){delete _0x4be0ea[_0xd383('0x37')];}_0x15d06b[_0xd383('0x29')](_0x1bc5a5)[_0xd383('0x38')](_0x4be0ea);};}exports[_0xd383('0x39')]=function(_0x2d3f88,_0x9af1be){var _0x2a328d={},_0x55043d={},_0x3914ea={'count':0x0,'rows':[]};var _0x39c006=_[_0xd383('0x3a')](db[_0xd383('0x3b')][_0xd383('0x3c')],function(_0x3262c6){return{'name':_0x3262c6[_0xd383('0x3d')],'type':_0x3262c6[_0xd383('0x3e')][_0xd383('0x3f')]};});_0x55043d[_0xd383('0x40')]=_[_0xd383('0x3a')](_0x39c006,'name');_0x55043d[_0xd383('0x41')]=_[_0xd383('0x42')](_0x2d3f88[_0xd383('0x41')]);_0x55043d[_0xd383('0x43')]=_[_0xd383('0x44')](_0x55043d['model'],_0x55043d[_0xd383('0x41')]);_0x2a328d[_0xd383('0x45')]=_['intersection'](_0x55043d['model'],qs[_0xd383('0x46')](_0x2d3f88[_0xd383('0x41')][_0xd383('0x46')]));_0x2a328d[_0xd383('0x45')]=_0x2a328d[_0xd383('0x45')][_0xd383('0x47')]?_0x2a328d['attributes']:_0x55043d[_0xd383('0x40')];if(!_0x2d3f88[_0xd383('0x41')][_0xd383('0x48')](_0xd383('0x49'))){_0x2a328d[_0xd383('0x2e')]=qs[_0xd383('0x2e')](_0x2d3f88[_0xd383('0x41')][_0xd383('0x2e')]);_0x2a328d[_0xd383('0x2d')]=qs[_0xd383('0x2d')](_0x2d3f88[_0xd383('0x41')][_0xd383('0x2d')]);}_0x2a328d['order']=qs['sort'](_0x2d3f88['query'][_0xd383('0x4a')]);_0x2a328d[_0xd383('0x4b')]=qs[_0xd383('0x43')](_['pick'](_0x2d3f88[_0xd383('0x41')],_0x55043d[_0xd383('0x43')]),_0x39c006);if(_0x2d3f88[_0xd383('0x41')][_0xd383('0x4c')]){_0x2a328d['where']=_[_0xd383('0x4d')](_0x2a328d[_0xd383('0x4b')],{'$or':_[_0xd383('0x3a')](_0x39c006,function(_0x43feb6){if(_0x43feb6[_0xd383('0x3e')]!=='VIRTUAL'){var _0x6ac7a6={};_0x6ac7a6[_0x43feb6[_0xd383('0x37')]]={'$like':'%'+_0x2d3f88['query'][_0xd383('0x4c')]+'%'};return _0x6ac7a6;}})});}_0x2a328d=_[_0xd383('0x4d')]({},_0x2a328d,_0x2d3f88[_0xd383('0x4e')]);var _0x5f44a2={'where':_0x2a328d[_0xd383('0x4b')]};return db['FreshdeskConfiguration'][_0xd383('0x2c')](_0x5f44a2)[_0xd383('0x1d')](function(_0xb3f550){_0x3914ea['count']=_0xb3f550;if(_0x2d3f88['query'][_0xd383('0x4f')]){_0x2a328d[_0xd383('0x50')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xd383('0x51')](_0x2a328d);})[_0xd383('0x1d')](function(_0x160c0a){_0x3914ea[_0xd383('0x52')]=_0x160c0a;return _0x3914ea;})[_0xd383('0x1d')](respondWithFilteredResult(_0x9af1be,_0x2a328d))['catch'](handleError(_0x9af1be,null));};exports[_0xd383('0x53')]=function(_0x136de8,_0x36f2c2){var _0x41bbc6={'raw':![],'where':{'id':_0x136de8[_0xd383('0x54')]['id']}},_0x2df7ef={};_0x2df7ef[_0xd383('0x40')]=_[_0xd383('0x42')](db[_0xd383('0x3b')][_0xd383('0x3c')]);_0x2df7ef[_0xd383('0x41')]=_[_0xd383('0x42')](_0x136de8[_0xd383('0x41')]);_0x2df7ef['filters']=_[_0xd383('0x44')](_0x2df7ef[_0xd383('0x40')],_0x2df7ef['query']);_0x41bbc6[_0xd383('0x45')]=_[_0xd383('0x44')](_0x2df7ef[_0xd383('0x40')],qs[_0xd383('0x46')](_0x136de8[_0xd383('0x41')][_0xd383('0x46')]));_0x41bbc6[_0xd383('0x45')]=_0x41bbc6['attributes']['length']?_0x41bbc6[_0xd383('0x45')]:_0x2df7ef[_0xd383('0x40')];if(_0x136de8[_0xd383('0x41')][_0xd383('0x4f')]){_0x41bbc6[_0xd383('0x50')]=[{'all':!![]}];}_0x41bbc6=_[_0xd383('0x4d')]({},_0x41bbc6,_0x136de8['options']);return db[_0xd383('0x3b')][_0xd383('0x55')](_0x41bbc6)[_0xd383('0x1d')](handleEntityNotFound(_0x36f2c2,null))[_0xd383('0x1d')](respondWithResult(_0x36f2c2,null))[_0xd383('0x56')](handleError(_0x36f2c2,null));};exports[_0xd383('0x57')]=function(_0x121ba0,_0x5a2b26){return db[_0xd383('0x3b')][_0xd383('0x57')](_0x121ba0[_0xd383('0x58')],{})[_0xd383('0x1d')](respondWithResult(_0x5a2b26,0xc9))[_0xd383('0x56')](handleError(_0x5a2b26,null));};exports[_0xd383('0x34')]=function(_0x3f089d,_0x375a48){if(_0x3f089d[_0xd383('0x58')]['id']){delete _0x3f089d[_0xd383('0x58')]['id'];}return db['FreshdeskConfiguration'][_0xd383('0x55')]({'where':{'id':_0x3f089d[_0xd383('0x54')]['id']}})['then'](handleEntityNotFound(_0x375a48,null))['then'](saveUpdates(_0x3f089d['body'],null))['then'](respondWithResult(_0x375a48,null))['catch'](handleError(_0x375a48,null));};exports[_0xd383('0x35')]=function(_0x4655d9,_0x433a81){return db['FreshdeskConfiguration'][_0xd383('0x55')]({'where':{'id':_0x4655d9[_0xd383('0x54')]['id']}})[_0xd383('0x1d')](handleEntityNotFound(_0x433a81,null))[_0xd383('0x1d')](removeEntity(_0x433a81,null))[_0xd383('0x56')](handleError(_0x433a81,null));};exports['getFields']=function(_0x2c2d65,_0x23ae84,_0x1a4764){var _0x15d297={};var _0x374a69={};var _0x533fab;var _0x2812d0;return db[_0xd383('0x3b')][_0xd383('0x59')]({'where':{'id':_0x2c2d65['params']['id']}})[_0xd383('0x1d')](handleEntityNotFound(_0x23ae84,null))[_0xd383('0x1d')](function(_0xe75e94){if(_0xe75e94){_0x533fab=_0xe75e94;_0x374a69['model']=_[_0xd383('0x42')](db['FreshdeskField'][_0xd383('0x3c')]);_0x374a69['query']=_[_0xd383('0x42')](_0x2c2d65['query']);_0x374a69[_0xd383('0x43')]=_['intersection'](_0x374a69[_0xd383('0x40')],_0x374a69[_0xd383('0x41')]);_0x15d297[_0xd383('0x45')]=_['intersection'](_0x374a69[_0xd383('0x40')],qs[_0xd383('0x46')](_0x2c2d65[_0xd383('0x41')][_0xd383('0x46')]));_0x15d297[_0xd383('0x45')]=_0x15d297['attributes'][_0xd383('0x47')]?_0x15d297[_0xd383('0x45')]:_0x374a69[_0xd383('0x40')];_0x15d297[_0xd383('0x5a')]=qs['sort'](_0x2c2d65[_0xd383('0x41')][_0xd383('0x4a')]);_0x15d297[_0xd383('0x4b')]=qs[_0xd383('0x43')](_[_0xd383('0x5b')](_0x2c2d65[_0xd383('0x41')],_0x374a69[_0xd383('0x43')]));if(_0x2c2d65[_0xd383('0x41')][_0xd383('0x4c')]){_0x15d297[_0xd383('0x4b')]=_[_0xd383('0x4d')](_0x15d297[_0xd383('0x4b')],{'$or':_[_0xd383('0x3a')](_0x15d297['attributes'],function(_0x3003ac){var _0x2c8ce4={};_0x2c8ce4[_0x3003ac]={'$like':'%'+_0x2c2d65[_0xd383('0x41')][_0xd383('0x4c')]+'%'};return _0x2c8ce4;})});}_0x15d297=_[_0xd383('0x4d')]({},_0x15d297,_0x2c2d65[_0xd383('0x4e')]);return _0x533fab[_0xd383('0x5c')](_0x15d297);}})[_0xd383('0x1d')](function(_0x1b9b07){if(_0x1b9b07){_0x2812d0=_0x1b9b07[_0xd383('0x47')];if(!_0x2c2d65[_0xd383('0x41')][_0xd383('0x48')]('nolimit')){_0x15d297[_0xd383('0x2e')]=qs[_0xd383('0x2e')](_0x2c2d65['query']['limit']);_0x15d297[_0xd383('0x2d')]=qs['offset'](_0x2c2d65['query'][_0xd383('0x2d')]);}return _0x533fab[_0xd383('0x5c')](_0x15d297);}})[_0xd383('0x1d')](function(_0x16a8ea){if(_0x16a8ea){return _0x16a8ea?{'count':_0x2812d0,'rows':_0x16a8ea}:null;}})[_0xd383('0x1d')](respondWithResult(_0x23ae84,null))[_0xd383('0x56')](handleError(_0x23ae84,null));};exports[_0xd383('0x5d')]=function(_0x1b3a4f,_0x423a53,_0x5036c8){var _0x234471={};var _0x1c5326={};var _0x49d6ee;var _0x2adcf4;return db[_0xd383('0x3b')][_0xd383('0x59')]({'where':{'id':_0x1b3a4f[_0xd383('0x54')]['id']}})[_0xd383('0x1d')](handleEntityNotFound(_0x423a53,null))[_0xd383('0x1d')](function(_0x26a274){if(_0x26a274){_0x49d6ee=_0x26a274;_0x1c5326[_0xd383('0x40')]=_[_0xd383('0x42')](db[_0xd383('0x5e')]['rawAttributes']);_0x1c5326['query']=_[_0xd383('0x42')](_0x1b3a4f['query']);_0x1c5326[_0xd383('0x43')]=_[_0xd383('0x44')](_0x1c5326[_0xd383('0x40')],_0x1c5326[_0xd383('0x41')]);_0x234471[_0xd383('0x45')]=_['intersection'](_0x1c5326[_0xd383('0x40')],qs[_0xd383('0x46')](_0x1b3a4f[_0xd383('0x41')][_0xd383('0x46')]));_0x234471[_0xd383('0x45')]=_0x234471[_0xd383('0x45')]['length']?_0x234471[_0xd383('0x45')]:_0x1c5326[_0xd383('0x40')];_0x234471['order']=qs[_0xd383('0x4a')](_0x1b3a4f[_0xd383('0x41')][_0xd383('0x4a')]);_0x234471['where']=qs[_0xd383('0x43')](_['pick'](_0x1b3a4f[_0xd383('0x41')],_0x1c5326[_0xd383('0x43')]));if(_0x1b3a4f[_0xd383('0x41')][_0xd383('0x4c')]){_0x234471['where']=_[_0xd383('0x4d')](_0x234471[_0xd383('0x4b')],{'$or':_[_0xd383('0x3a')](_0x234471['attributes'],function(_0x173236){var _0xa6c6b8={};_0xa6c6b8[_0x173236]={'$like':'%'+_0x1b3a4f['query'][_0xd383('0x4c')]+'%'};return _0xa6c6b8;})});}_0x234471=_[_0xd383('0x4d')]({},_0x234471,_0x1b3a4f[_0xd383('0x4e')]);return _0x49d6ee[_0xd383('0x5d')](_0x234471);}})['then'](function(_0x4fe1ff){if(_0x4fe1ff){_0x2adcf4=_0x4fe1ff[_0xd383('0x47')];if(!_0x1b3a4f[_0xd383('0x41')][_0xd383('0x48')](_0xd383('0x49'))){_0x234471[_0xd383('0x2e')]=qs[_0xd383('0x2e')](_0x1b3a4f[_0xd383('0x41')]['limit']);_0x234471[_0xd383('0x2d')]=qs['offset'](_0x1b3a4f['query'][_0xd383('0x2d')]);}return _0x49d6ee['getSubjects'](_0x234471);}})[_0xd383('0x1d')](function(_0x1e56c0){if(_0x1e56c0){return _0x1e56c0?{'count':_0x2adcf4,'rows':_0x1e56c0}:null;}})[_0xd383('0x1d')](respondWithResult(_0x423a53,null))[_0xd383('0x56')](handleError(_0x423a53,null));};exports['getDescriptions']=function(_0x32106a,_0x11a7f5,_0x3fa13c){var _0x29f933={};var _0x1c48eb={};var _0x58effe;var _0x2a19d3;return db[_0xd383('0x3b')][_0xd383('0x59')]({'where':{'id':_0x32106a['params']['id']}})['then'](handleEntityNotFound(_0x11a7f5,null))[_0xd383('0x1d')](function(_0x492039){if(_0x492039){_0x58effe=_0x492039;_0x1c48eb[_0xd383('0x40')]=_[_0xd383('0x42')](db[_0xd383('0x5e')][_0xd383('0x3c')]);_0x1c48eb[_0xd383('0x41')]=_[_0xd383('0x42')](_0x32106a['query']);_0x1c48eb[_0xd383('0x43')]=_[_0xd383('0x44')](_0x1c48eb[_0xd383('0x40')],_0x1c48eb[_0xd383('0x41')]);_0x29f933[_0xd383('0x45')]=_[_0xd383('0x44')](_0x1c48eb[_0xd383('0x40')],qs[_0xd383('0x46')](_0x32106a['query'][_0xd383('0x46')]));_0x29f933['attributes']=_0x29f933[_0xd383('0x45')][_0xd383('0x47')]?_0x29f933[_0xd383('0x45')]:_0x1c48eb['model'];_0x29f933['order']=qs[_0xd383('0x4a')](_0x32106a[_0xd383('0x41')]['sort']);_0x29f933['where']=qs['filters'](_['pick'](_0x32106a[_0xd383('0x41')],_0x1c48eb[_0xd383('0x43')]));if(_0x32106a[_0xd383('0x41')][_0xd383('0x4c')]){_0x29f933[_0xd383('0x4b')]=_['merge'](_0x29f933[_0xd383('0x4b')],{'$or':_['map'](_0x29f933[_0xd383('0x45')],function(_0x2cb700){var _0x4a4b9e={};_0x4a4b9e[_0x2cb700]={'$like':'%'+_0x32106a[_0xd383('0x41')]['filter']+'%'};return _0x4a4b9e;})});}_0x29f933=_[_0xd383('0x4d')]({},_0x29f933,_0x32106a[_0xd383('0x4e')]);return _0x58effe[_0xd383('0x5f')](_0x29f933);}})[_0xd383('0x1d')](function(_0x438508){if(_0x438508){_0x2a19d3=_0x438508['length'];if(!_0x32106a[_0xd383('0x41')][_0xd383('0x48')](_0xd383('0x49'))){_0x29f933[_0xd383('0x2e')]=qs[_0xd383('0x2e')](_0x32106a[_0xd383('0x41')][_0xd383('0x2e')]);_0x29f933[_0xd383('0x2d')]=qs['offset'](_0x32106a[_0xd383('0x41')][_0xd383('0x2d')]);}return _0x58effe[_0xd383('0x5f')](_0x29f933);}})[_0xd383('0x1d')](function(_0x425fb5){if(_0x425fb5){return _0x425fb5?{'count':_0x2a19d3,'rows':_0x425fb5}:null;}})[_0xd383('0x1d')](respondWithResult(_0x11a7f5,null))[_0xd383('0x56')](handleError(_0x11a7f5,null));};exports['getTags']=function(_0x5a4722,_0x3843f2,_0x31d568){var _0x1fad7f={};var _0x3b259a={};var _0x27ce0e;var _0x2c0ae2;return db[_0xd383('0x3b')]['findOne']({'where':{'id':_0x5a4722[_0xd383('0x54')]['id']}})[_0xd383('0x1d')](handleEntityNotFound(_0x3843f2,null))[_0xd383('0x1d')](function(_0x377e47){if(_0x377e47){_0x27ce0e=_0x377e47;_0x3b259a[_0xd383('0x40')]=_[_0xd383('0x42')](db['Tag'][_0xd383('0x3c')]);_0x3b259a['query']=_['keys'](_0x5a4722[_0xd383('0x41')]);_0x3b259a[_0xd383('0x43')]=_[_0xd383('0x44')](_0x3b259a[_0xd383('0x40')],_0x3b259a[_0xd383('0x41')]);_0x1fad7f['attributes']=_[_0xd383('0x44')](_0x3b259a['model'],qs[_0xd383('0x46')](_0x5a4722[_0xd383('0x41')][_0xd383('0x46')]));_0x1fad7f[_0xd383('0x45')]=_0x1fad7f[_0xd383('0x45')][_0xd383('0x47')]?_0x1fad7f[_0xd383('0x45')]:_0x3b259a[_0xd383('0x40')];_0x1fad7f[_0xd383('0x5a')]=qs[_0xd383('0x4a')](_0x5a4722[_0xd383('0x41')][_0xd383('0x4a')]);_0x1fad7f[_0xd383('0x4b')]=qs['filters'](_[_0xd383('0x5b')](_0x5a4722['query'],_0x3b259a[_0xd383('0x43')]));if(_0x5a4722['query'][_0xd383('0x4c')]){_0x1fad7f[_0xd383('0x4b')]=_[_0xd383('0x4d')](_0x1fad7f[_0xd383('0x4b')],{'$or':_[_0xd383('0x3a')](_0x1fad7f['attributes'],function(_0x424dc4){var _0x343b7f={};_0x343b7f[_0x424dc4]={'$like':'%'+_0x5a4722[_0xd383('0x41')][_0xd383('0x4c')]+'%'};return _0x343b7f;})});}_0x1fad7f=_[_0xd383('0x4d')]({},_0x1fad7f,_0x5a4722[_0xd383('0x4e')]);return _0x27ce0e[_0xd383('0x60')](_0x1fad7f);}})[_0xd383('0x1d')](function(_0x3f4186){if(_0x3f4186){_0x2c0ae2=_0x3f4186['length'];if(!_0x5a4722[_0xd383('0x41')][_0xd383('0x48')]('nolimit')){_0x1fad7f[_0xd383('0x2e')]=qs[_0xd383('0x2e')](_0x5a4722[_0xd383('0x41')][_0xd383('0x2e')]);_0x1fad7f[_0xd383('0x2d')]=qs['offset'](_0x5a4722[_0xd383('0x41')]['offset']);}return _0x27ce0e[_0xd383('0x60')](_0x1fad7f);}})['then'](function(_0x55d98a){if(_0x55d98a){return _0x55d98a?{'count':_0x2c0ae2,'rows':_0x55d98a}:null;}})[_0xd383('0x1d')](respondWithResult(_0x3843f2,null))['catch'](handleError(_0x3843f2,null));};exports[_0xd383('0x61')]=function(_0x564925,_0x344124,_0x4de7ea){if(_0x564925[_0xd383('0x58')]['id']){delete _0x564925[_0xd383('0x58')]['id'];}return db[_0xd383('0x3b')][_0xd383('0x59')]({'where':{'id':_0x564925[_0xd383('0x54')]['id']}})[_0xd383('0x1d')](handleEntityNotFound(_0x344124,null))[_0xd383('0x1d')](function(_0x5e045b){if(_0x5e045b){return _0x5e045b[_0xd383('0x61')](_0x564925['body'][_0xd383('0x62')]||[]);}return null;})[_0xd383('0x1d')](respondWithResult(_0x344124,null))[_0xd383('0x56')](handleError(_0x344124,null));}; \ No newline at end of file +var _0x43fd=['catch','show','length','create','body','find','params','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','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','request\x20sent','debug','stringify','error','FreshdeskConfiguration,\x20%s,\x20%s','message','info','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','keys','intersection','attributes','fields','query','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','FreshdeskConfiguration','includeAll','include','findAll','rows'];(function(_0x5dc7bb,_0x3c2edc){var _0x3569c3=function(_0x13eb1d){while(--_0x13eb1d){_0x5dc7bb['push'](_0x5dc7bb['shift']());}};_0x3569c3(++_0x3c2edc);}(_0x43fd,0x1ec));var _0xd43f=function(_0x830bff,_0x1c0595){_0x830bff=_0x830bff-0x0;var _0x51ad06=_0x43fd[_0x830bff];return _0x51ad06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd43f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd43f('0x1'));var rp=require(_0xd43f('0x2'));var moment=require('moment');var BPromise=require(_0xd43f('0x3'));var Mustache=require('mustache');var util=require(_0xd43f('0x4'));var path=require(_0xd43f('0x5'));var sox=require(_0xd43f('0x6'));var csv=require(_0xd43f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd43f('0x8'));var squel=require(_0xd43f('0x9'));var crypto=require(_0xd43f('0xa'));var jsforce=require(_0xd43f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd43f('0x7'));var querystring=require(_0xd43f('0xc'));var Papa=require('papaparse');var Redis=require(_0xd43f('0xd'));var authService=require(_0xd43f('0xe'));var qs=require(_0xd43f('0xf'));var as=require(_0xd43f('0x10'));var hardwareService=require(_0xd43f('0x11'));var logger=require('../../config/logger')(_0xd43f('0x12'));var utils=require(_0xd43f('0x13'));var config=require(_0xd43f('0x14'));var db=require(_0xd43f('0x15'))['db'];var jayson=require(_0xd43f('0x16'));var client=jayson[_0xd43f('0x17')][_0xd43f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1a72f1,_0x2b4549,_0x1bed70){if(_0x1bed70){var _0x1eba90=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1eba90['test'](_0x2b4549)){return _0x1a72f1;}else{throw new db[(_0xd43f('0x19'))][(_0xd43f('0x1a'))](_0xd43f('0x1b'));}}else{return _0x1a72f1;}}function respondWithRpcPromise(_0x5802f2,_0x4c576e,_0x4a2b49,_0x1c729a){return new BPromise(function(_0x3ca2d4,_0x4f8862){var _0x3c0953=_0x1c729a||client;return _0x3c0953[_0xd43f('0x1c')](_0x5802f2,_0x4a2b49)['then'](function(_0x5ced70){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c576e,_0xd43f('0x1d'));logger[_0xd43f('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4c576e,_0xd43f('0x1d'),JSON[_0xd43f('0x1f')](_0x5ced70));if(_0x5ced70[_0xd43f('0x20')]){if(_0x5ced70[_0xd43f('0x20')]['code']===0x1f4){logger[_0xd43f('0x20')](_0xd43f('0x21'),_0x4c576e,_0x5ced70[_0xd43f('0x20')]['message']);return _0x4f8862(_0x5ced70['error']['message']);}logger[_0xd43f('0x20')](_0xd43f('0x21'),_0x4c576e,_0x5ced70[_0xd43f('0x20')][_0xd43f('0x22')]);return _0x3ca2d4(_0x5ced70[_0xd43f('0x20')][_0xd43f('0x22')]);}else{logger[_0xd43f('0x23')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4c576e,_0xd43f('0x1d'));_0x3ca2d4(_0x5ced70['result'][_0xd43f('0x22')]);}})['catch'](function(_0x5ab88f){logger[_0xd43f('0x20')](_0xd43f('0x21'),_0x4c576e,_0x5ab88f);_0x4f8862(_0x5ab88f);});});}function respondWithStatusCode(_0x2a9ce4,_0x2a38f6){_0x2a38f6=_0x2a38f6||0xcc;return function(_0x35acd0){if(_0x35acd0){return _0x2a9ce4[_0xd43f('0x24')](_0x2a38f6);}return _0x2a9ce4[_0xd43f('0x25')](_0x2a38f6)[_0xd43f('0x26')]();};}function respondWithResult(_0x2dcbf2,_0x49d043){_0x49d043=_0x49d043||0xc8;return function(_0x26a6c9){if(_0x26a6c9){return _0x2dcbf2[_0xd43f('0x25')](_0x49d043)[_0xd43f('0x27')](_0x26a6c9);}};}function respondWithFilteredResult(_0x2d54a7,_0x209ccd){return function(_0x4a8b4d){if(_0x4a8b4d){var _0x161540=_0x4a8b4d[_0xd43f('0x28')],_0x7b6761=_0x209ccd[_0xd43f('0x29')],_0x285b86=_0x209ccd['offset']+_0x209ccd[_0xd43f('0x2a')],_0x1dd81f;if(_0x285b86>=_0x161540){_0x285b86=_0x161540;_0x1dd81f=0xc8;}else{_0x1dd81f=0xce;}_0x2d54a7[_0xd43f('0x25')](_0x1dd81f);return _0x2d54a7['set'](_0xd43f('0x2b'),_0x7b6761+'-'+_0x285b86+'/'+_0x161540)['json'](_0x4a8b4d);}return null;};}function patchUpdates(_0x53aae7){return function(_0x45e84a){try{jsonpatch[_0xd43f('0x2c')](_0x45e84a,_0x53aae7,!![]);}catch(_0x29e123){return BPromise['reject'](_0x29e123);}return _0x45e84a[_0xd43f('0x2d')]();};}function saveUpdates(_0x23c4f7,_0x5bba3d){return function(_0x557a96){if(_0x557a96){return _0x557a96[_0xd43f('0x2e')](_0x23c4f7)[_0xd43f('0x2f')](function(_0xb9e156){return _0xb9e156;});}return null;};}function removeEntity(_0x202a05,_0x49ff92){return function(_0x2bfdea){if(_0x2bfdea){return _0x2bfdea[_0xd43f('0x30')]()[_0xd43f('0x2f')](function(){_0x202a05[_0xd43f('0x25')](0xcc)[_0xd43f('0x26')]();});}};}function handleEntityNotFound(_0x2461bc,_0x434b36){return function(_0x5c407c){if(!_0x5c407c){_0x2461bc[_0xd43f('0x24')](0x194);}return _0x5c407c;};}function handleError(_0x57ac0f,_0xd75865){_0xd75865=_0xd75865||0x1f4;return function(_0x645677){logger[_0xd43f('0x20')](_0x645677['stack']);if(_0x645677[_0xd43f('0x31')]){delete _0x645677[_0xd43f('0x31')];}_0x57ac0f['status'](_0xd75865)[_0xd43f('0x32')](_0x645677);};}exports[_0xd43f('0x33')]=function(_0x16c1f6,_0x4ed4eb){var _0x291f05={},_0x13f996={},_0x1c0d7f={'count':0x0,'rows':[]};var _0x20682d=_[_0xd43f('0x34')](db['FreshdeskConfiguration'][_0xd43f('0x35')],function(_0x4b1c73){return{'name':_0x4b1c73[_0xd43f('0x36')],'type':_0x4b1c73[_0xd43f('0x37')][_0xd43f('0x38')]};});_0x13f996['model']=_[_0xd43f('0x34')](_0x20682d,_0xd43f('0x31'));_0x13f996['query']=_[_0xd43f('0x39')](_0x16c1f6['query']);_0x13f996['filters']=_[_0xd43f('0x3a')](_0x13f996['model'],_0x13f996['query']);_0x291f05[_0xd43f('0x3b')]=_['intersection'](_0x13f996['model'],qs[_0xd43f('0x3c')](_0x16c1f6[_0xd43f('0x3d')][_0xd43f('0x3c')]));_0x291f05[_0xd43f('0x3b')]=_0x291f05[_0xd43f('0x3b')]['length']?_0x291f05[_0xd43f('0x3b')]:_0x13f996[_0xd43f('0x3e')];if(!_0x16c1f6[_0xd43f('0x3d')][_0xd43f('0x3f')](_0xd43f('0x40'))){_0x291f05[_0xd43f('0x2a')]=qs[_0xd43f('0x2a')](_0x16c1f6[_0xd43f('0x3d')][_0xd43f('0x2a')]);_0x291f05[_0xd43f('0x29')]=qs[_0xd43f('0x29')](_0x16c1f6['query'][_0xd43f('0x29')]);}_0x291f05[_0xd43f('0x41')]=qs['sort'](_0x16c1f6['query'][_0xd43f('0x42')]);_0x291f05[_0xd43f('0x43')]=qs[_0xd43f('0x44')](_['pick'](_0x16c1f6[_0xd43f('0x3d')],_0x13f996[_0xd43f('0x44')]),_0x20682d);if(_0x16c1f6[_0xd43f('0x3d')][_0xd43f('0x45')]){_0x291f05['where']=_['merge'](_0x291f05[_0xd43f('0x43')],{'$or':_[_0xd43f('0x34')](_0x20682d,function(_0x156e8a){if(_0x156e8a['type']!==_0xd43f('0x46')){var _0x710b1e={};_0x710b1e[_0x156e8a[_0xd43f('0x31')]]={'$like':'%'+_0x16c1f6[_0xd43f('0x3d')][_0xd43f('0x45')]+'%'};return _0x710b1e;}})});}_0x291f05=_[_0xd43f('0x47')]({},_0x291f05,_0x16c1f6[_0xd43f('0x48')]);var _0xadbc59={'where':_0x291f05['where']};return db[_0xd43f('0x49')][_0xd43f('0x28')](_0xadbc59)[_0xd43f('0x2f')](function(_0x400273){_0x1c0d7f[_0xd43f('0x28')]=_0x400273;if(_0x16c1f6[_0xd43f('0x3d')][_0xd43f('0x4a')]){_0x291f05[_0xd43f('0x4b')]=[{'all':!![]}];}return db[_0xd43f('0x49')][_0xd43f('0x4c')](_0x291f05);})[_0xd43f('0x2f')](function(_0x517509){_0x1c0d7f[_0xd43f('0x4d')]=_0x517509;return _0x1c0d7f;})[_0xd43f('0x2f')](respondWithFilteredResult(_0x4ed4eb,_0x291f05))[_0xd43f('0x4e')](handleError(_0x4ed4eb,null));};exports[_0xd43f('0x4f')]=function(_0x45207d,_0x4763b7){var _0x54eaa2={'raw':![],'where':{'id':_0x45207d['params']['id']}},_0x9e1727={};_0x9e1727[_0xd43f('0x3e')]=_['keys'](db[_0xd43f('0x49')][_0xd43f('0x35')]);_0x9e1727[_0xd43f('0x3d')]=_[_0xd43f('0x39')](_0x45207d[_0xd43f('0x3d')]);_0x9e1727[_0xd43f('0x44')]=_[_0xd43f('0x3a')](_0x9e1727[_0xd43f('0x3e')],_0x9e1727[_0xd43f('0x3d')]);_0x54eaa2['attributes']=_[_0xd43f('0x3a')](_0x9e1727[_0xd43f('0x3e')],qs[_0xd43f('0x3c')](_0x45207d[_0xd43f('0x3d')][_0xd43f('0x3c')]));_0x54eaa2[_0xd43f('0x3b')]=_0x54eaa2[_0xd43f('0x3b')][_0xd43f('0x50')]?_0x54eaa2[_0xd43f('0x3b')]:_0x9e1727[_0xd43f('0x3e')];if(_0x45207d[_0xd43f('0x3d')]['includeAll']){_0x54eaa2['include']=[{'all':!![]}];}_0x54eaa2=_[_0xd43f('0x47')]({},_0x54eaa2,_0x45207d[_0xd43f('0x48')]);return db[_0xd43f('0x49')]['find'](_0x54eaa2)['then'](handleEntityNotFound(_0x4763b7,null))[_0xd43f('0x2f')](respondWithResult(_0x4763b7,null))[_0xd43f('0x4e')](handleError(_0x4763b7,null));};exports[_0xd43f('0x51')]=function(_0x20e2e6,_0x1221b0){return db['FreshdeskConfiguration'][_0xd43f('0x51')](_0x20e2e6[_0xd43f('0x52')],{})[_0xd43f('0x2f')](respondWithResult(_0x1221b0,0xc9))[_0xd43f('0x4e')](handleError(_0x1221b0,null));};exports[_0xd43f('0x2e')]=function(_0x39f640,_0x481977){if(_0x39f640[_0xd43f('0x52')]['id']){delete _0x39f640[_0xd43f('0x52')]['id'];}return db[_0xd43f('0x49')][_0xd43f('0x53')]({'where':{'id':_0x39f640[_0xd43f('0x54')]['id']}})[_0xd43f('0x2f')](handleEntityNotFound(_0x481977,null))[_0xd43f('0x2f')](saveUpdates(_0x39f640[_0xd43f('0x52')],null))['then'](respondWithResult(_0x481977,null))[_0xd43f('0x4e')](handleError(_0x481977,null));};exports[_0xd43f('0x30')]=function(_0x60a5d2,_0x5c5a8a){return db[_0xd43f('0x49')][_0xd43f('0x53')]({'where':{'id':_0x60a5d2[_0xd43f('0x54')]['id']}})[_0xd43f('0x2f')](handleEntityNotFound(_0x5c5a8a,null))[_0xd43f('0x2f')](removeEntity(_0x5c5a8a,null))[_0xd43f('0x4e')](handleError(_0x5c5a8a,null));};exports[_0xd43f('0x55')]=function(_0x32590d,_0x1c1fd5,_0x418af0){var _0x4ca871={};var _0x1398ef={};var _0x340d13;var _0x52ac79;return db[_0xd43f('0x49')][_0xd43f('0x56')]({'where':{'id':_0x32590d[_0xd43f('0x54')]['id']}})['then'](handleEntityNotFound(_0x1c1fd5,null))[_0xd43f('0x2f')](function(_0x598609){if(_0x598609){_0x340d13=_0x598609;_0x1398ef[_0xd43f('0x3e')]=_['keys'](db[_0xd43f('0x57')]['rawAttributes']);_0x1398ef[_0xd43f('0x3d')]=_[_0xd43f('0x39')](_0x32590d[_0xd43f('0x3d')]);_0x1398ef['filters']=_['intersection'](_0x1398ef[_0xd43f('0x3e')],_0x1398ef[_0xd43f('0x3d')]);_0x4ca871['attributes']=_[_0xd43f('0x3a')](_0x1398ef[_0xd43f('0x3e')],qs['fields'](_0x32590d[_0xd43f('0x3d')][_0xd43f('0x3c')]));_0x4ca871[_0xd43f('0x3b')]=_0x4ca871[_0xd43f('0x3b')][_0xd43f('0x50')]?_0x4ca871[_0xd43f('0x3b')]:_0x1398ef[_0xd43f('0x3e')];_0x4ca871['order']=qs[_0xd43f('0x42')](_0x32590d[_0xd43f('0x3d')][_0xd43f('0x42')]);_0x4ca871[_0xd43f('0x43')]=qs[_0xd43f('0x44')](_[_0xd43f('0x58')](_0x32590d[_0xd43f('0x3d')],_0x1398ef['filters']));if(_0x32590d[_0xd43f('0x3d')][_0xd43f('0x45')]){_0x4ca871['where']=_[_0xd43f('0x47')](_0x4ca871[_0xd43f('0x43')],{'$or':_[_0xd43f('0x34')](_0x4ca871[_0xd43f('0x3b')],function(_0x2e87fa){var _0xd40a7b={};_0xd40a7b[_0x2e87fa]={'$like':'%'+_0x32590d[_0xd43f('0x3d')]['filter']+'%'};return _0xd40a7b;})});}_0x4ca871=_[_0xd43f('0x47')]({},_0x4ca871,_0x32590d[_0xd43f('0x48')]);return _0x340d13['getFields'](_0x4ca871);}})[_0xd43f('0x2f')](function(_0x5108e0){if(_0x5108e0){_0x52ac79=_0x5108e0[_0xd43f('0x50')];if(!_0x32590d[_0xd43f('0x3d')][_0xd43f('0x3f')](_0xd43f('0x40'))){_0x4ca871[_0xd43f('0x2a')]=qs[_0xd43f('0x2a')](_0x32590d[_0xd43f('0x3d')][_0xd43f('0x2a')]);_0x4ca871[_0xd43f('0x29')]=qs[_0xd43f('0x29')](_0x32590d[_0xd43f('0x3d')][_0xd43f('0x29')]);}return _0x340d13[_0xd43f('0x55')](_0x4ca871);}})[_0xd43f('0x2f')](function(_0x53b22b){if(_0x53b22b){return _0x53b22b?{'count':_0x52ac79,'rows':_0x53b22b}:null;}})[_0xd43f('0x2f')](respondWithResult(_0x1c1fd5,null))[_0xd43f('0x4e')](handleError(_0x1c1fd5,null));};exports[_0xd43f('0x59')]=function(_0x4ec758,_0x3a4086,_0x5211ee){var _0x16a2bf={};var _0xa317f2={};var _0x2096eb;var _0x3af7db;return db['FreshdeskConfiguration'][_0xd43f('0x56')]({'where':{'id':_0x4ec758[_0xd43f('0x54')]['id']}})[_0xd43f('0x2f')](handleEntityNotFound(_0x3a4086,null))['then'](function(_0x321cea){if(_0x321cea){_0x2096eb=_0x321cea;_0xa317f2['model']=_[_0xd43f('0x39')](db[_0xd43f('0x57')][_0xd43f('0x35')]);_0xa317f2[_0xd43f('0x3d')]=_['keys'](_0x4ec758[_0xd43f('0x3d')]);_0xa317f2['filters']=_[_0xd43f('0x3a')](_0xa317f2['model'],_0xa317f2[_0xd43f('0x3d')]);_0x16a2bf[_0xd43f('0x3b')]=_['intersection'](_0xa317f2[_0xd43f('0x3e')],qs[_0xd43f('0x3c')](_0x4ec758[_0xd43f('0x3d')][_0xd43f('0x3c')]));_0x16a2bf['attributes']=_0x16a2bf[_0xd43f('0x3b')][_0xd43f('0x50')]?_0x16a2bf[_0xd43f('0x3b')]:_0xa317f2[_0xd43f('0x3e')];_0x16a2bf['order']=qs[_0xd43f('0x42')](_0x4ec758[_0xd43f('0x3d')]['sort']);_0x16a2bf['where']=qs[_0xd43f('0x44')](_[_0xd43f('0x58')](_0x4ec758[_0xd43f('0x3d')],_0xa317f2['filters']));if(_0x4ec758[_0xd43f('0x3d')]['filter']){_0x16a2bf[_0xd43f('0x43')]=_[_0xd43f('0x47')](_0x16a2bf['where'],{'$or':_[_0xd43f('0x34')](_0x16a2bf[_0xd43f('0x3b')],function(_0x2d6b29){var _0x4564ed={};_0x4564ed[_0x2d6b29]={'$like':'%'+_0x4ec758[_0xd43f('0x3d')][_0xd43f('0x45')]+'%'};return _0x4564ed;})});}_0x16a2bf=_[_0xd43f('0x47')]({},_0x16a2bf,_0x4ec758[_0xd43f('0x48')]);return _0x2096eb[_0xd43f('0x59')](_0x16a2bf);}})[_0xd43f('0x2f')](function(_0x3703b5){if(_0x3703b5){_0x3af7db=_0x3703b5['length'];if(!_0x4ec758[_0xd43f('0x3d')]['hasOwnProperty'](_0xd43f('0x40'))){_0x16a2bf[_0xd43f('0x2a')]=qs[_0xd43f('0x2a')](_0x4ec758[_0xd43f('0x3d')]['limit']);_0x16a2bf['offset']=qs[_0xd43f('0x29')](_0x4ec758[_0xd43f('0x3d')]['offset']);}return _0x2096eb[_0xd43f('0x59')](_0x16a2bf);}})[_0xd43f('0x2f')](function(_0x3a5420){if(_0x3a5420){return _0x3a5420?{'count':_0x3af7db,'rows':_0x3a5420}:null;}})[_0xd43f('0x2f')](respondWithResult(_0x3a4086,null))[_0xd43f('0x4e')](handleError(_0x3a4086,null));};exports[_0xd43f('0x5a')]=function(_0x49a6b4,_0x6149b4,_0x37f6af){var _0xb888eb={};var _0x1c97c3={};var _0x282b84;var _0x21efee;return db[_0xd43f('0x49')][_0xd43f('0x56')]({'where':{'id':_0x49a6b4[_0xd43f('0x54')]['id']}})['then'](handleEntityNotFound(_0x6149b4,null))['then'](function(_0x40e75c){if(_0x40e75c){_0x282b84=_0x40e75c;_0x1c97c3[_0xd43f('0x3e')]=_['keys'](db[_0xd43f('0x57')][_0xd43f('0x35')]);_0x1c97c3['query']=_[_0xd43f('0x39')](_0x49a6b4[_0xd43f('0x3d')]);_0x1c97c3[_0xd43f('0x44')]=_['intersection'](_0x1c97c3['model'],_0x1c97c3[_0xd43f('0x3d')]);_0xb888eb[_0xd43f('0x3b')]=_[_0xd43f('0x3a')](_0x1c97c3[_0xd43f('0x3e')],qs[_0xd43f('0x3c')](_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x3c')]));_0xb888eb[_0xd43f('0x3b')]=_0xb888eb[_0xd43f('0x3b')][_0xd43f('0x50')]?_0xb888eb[_0xd43f('0x3b')]:_0x1c97c3[_0xd43f('0x3e')];_0xb888eb['order']=qs[_0xd43f('0x42')](_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x42')]);_0xb888eb[_0xd43f('0x43')]=qs[_0xd43f('0x44')](_[_0xd43f('0x58')](_0x49a6b4[_0xd43f('0x3d')],_0x1c97c3['filters']));if(_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x45')]){_0xb888eb[_0xd43f('0x43')]=_[_0xd43f('0x47')](_0xb888eb['where'],{'$or':_[_0xd43f('0x34')](_0xb888eb[_0xd43f('0x3b')],function(_0x37474c){var _0x13dd7f={};_0x13dd7f[_0x37474c]={'$like':'%'+_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x45')]+'%'};return _0x13dd7f;})});}_0xb888eb=_[_0xd43f('0x47')]({},_0xb888eb,_0x49a6b4[_0xd43f('0x48')]);return _0x282b84[_0xd43f('0x5a')](_0xb888eb);}})['then'](function(_0xd253bd){if(_0xd253bd){_0x21efee=_0xd253bd['length'];if(!_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x3f')](_0xd43f('0x40'))){_0xb888eb[_0xd43f('0x2a')]=qs['limit'](_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x2a')]);_0xb888eb['offset']=qs[_0xd43f('0x29')](_0x49a6b4[_0xd43f('0x3d')][_0xd43f('0x29')]);}return _0x282b84[_0xd43f('0x5a')](_0xb888eb);}})[_0xd43f('0x2f')](function(_0x1174a8){if(_0x1174a8){return _0x1174a8?{'count':_0x21efee,'rows':_0x1174a8}:null;}})['then'](respondWithResult(_0x6149b4,null))['catch'](handleError(_0x6149b4,null));};exports['getTags']=function(_0x40d6d3,_0x542ded,_0x10187c){var _0x569e74={};var _0x24fc08={};var _0x4fb4c5;var _0x16f95d;return db[_0xd43f('0x49')][_0xd43f('0x56')]({'where':{'id':_0x40d6d3[_0xd43f('0x54')]['id']}})[_0xd43f('0x2f')](handleEntityNotFound(_0x542ded,null))[_0xd43f('0x2f')](function(_0x17115b){if(_0x17115b){_0x4fb4c5=_0x17115b;_0x24fc08[_0xd43f('0x3e')]=_[_0xd43f('0x39')](db[_0xd43f('0x5b')][_0xd43f('0x35')]);_0x24fc08['query']=_[_0xd43f('0x39')](_0x40d6d3[_0xd43f('0x3d')]);_0x24fc08[_0xd43f('0x44')]=_[_0xd43f('0x3a')](_0x24fc08[_0xd43f('0x3e')],_0x24fc08['query']);_0x569e74[_0xd43f('0x3b')]=_[_0xd43f('0x3a')](_0x24fc08[_0xd43f('0x3e')],qs[_0xd43f('0x3c')](_0x40d6d3[_0xd43f('0x3d')][_0xd43f('0x3c')]));_0x569e74[_0xd43f('0x3b')]=_0x569e74['attributes']['length']?_0x569e74[_0xd43f('0x3b')]:_0x24fc08[_0xd43f('0x3e')];_0x569e74[_0xd43f('0x41')]=qs[_0xd43f('0x42')](_0x40d6d3['query']['sort']);_0x569e74['where']=qs['filters'](_[_0xd43f('0x58')](_0x40d6d3[_0xd43f('0x3d')],_0x24fc08[_0xd43f('0x44')]));if(_0x40d6d3[_0xd43f('0x3d')][_0xd43f('0x45')]){_0x569e74[_0xd43f('0x43')]=_['merge'](_0x569e74[_0xd43f('0x43')],{'$or':_[_0xd43f('0x34')](_0x569e74['attributes'],function(_0x4d93ba){var _0x557c13={};_0x557c13[_0x4d93ba]={'$like':'%'+_0x40d6d3[_0xd43f('0x3d')][_0xd43f('0x45')]+'%'};return _0x557c13;})});}_0x569e74=_['merge']({},_0x569e74,_0x40d6d3[_0xd43f('0x48')]);return _0x4fb4c5['getTags'](_0x569e74);}})[_0xd43f('0x2f')](function(_0x4c975e){if(_0x4c975e){_0x16f95d=_0x4c975e[_0xd43f('0x50')];if(!_0x40d6d3[_0xd43f('0x3d')]['hasOwnProperty'](_0xd43f('0x40'))){_0x569e74[_0xd43f('0x2a')]=qs[_0xd43f('0x2a')](_0x40d6d3['query']['limit']);_0x569e74[_0xd43f('0x29')]=qs['offset'](_0x40d6d3[_0xd43f('0x3d')][_0xd43f('0x29')]);}return _0x4fb4c5[_0xd43f('0x5c')](_0x569e74);}})[_0xd43f('0x2f')](function(_0x136422){if(_0x136422){return _0x136422?{'count':_0x16f95d,'rows':_0x136422}:null;}})['then'](respondWithResult(_0x542ded,null))[_0xd43f('0x4e')](handleError(_0x542ded,null));};exports['setTags']=function(_0x3dfe5b,_0x3bd29e,_0x547185){if(_0x3dfe5b[_0xd43f('0x52')]['id']){delete _0x3dfe5b[_0xd43f('0x52')]['id'];}return db['FreshdeskConfiguration'][_0xd43f('0x56')]({'where':{'id':_0x3dfe5b['params']['id']}})[_0xd43f('0x2f')](handleEntityNotFound(_0x3bd29e,null))[_0xd43f('0x2f')](function(_0x4a99c4){if(_0x4a99c4){return _0x4a99c4[_0xd43f('0x5d')](_0x3dfe5b[_0xd43f('0x52')][_0xd43f('0x5e')]||[]);}return null;})[_0xd43f('0x2f')](respondWithResult(_0x3bd29e,null))[_0xd43f('0x4e')](handleError(_0x3bd29e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index cdf497c..c3c9de1 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 _0x53ec=['bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x577ac4,_0x55ffd7){var _0x5cecc3=function(_0x37d1b9){while(--_0x37d1b9){_0x577ac4['push'](_0x577ac4['shift']());}};_0x5cecc3(++_0x55ffd7);}(_0x53ec,0x192));var _0xc53e=function(_0x31b7ff,_0x4d3503){_0x31b7ff=_0x31b7ff-0x0;var _0x33ba84=_0x53ec[_0x31b7ff];return _0x33ba84;};'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':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1e5db1,_0x3ad8f8){var _0x48e72e=function(_0x14dc1e){while(--_0x14dc1e){_0x1e5db1['push'](_0x1e5db1['shift']());}};_0x48e72e(++_0x3ad8f8);}(_0x1cb9,0x14e));var _0x91cb=function(_0x3fdc35,_0x4ee7dd){_0x3fdc35=_0x3fdc35-0x0;var _0x57a98a=_0x1cb9[_0x3fdc35];return _0x57a98a;};'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 diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 58f7ba9..793d0fe 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 _0x2c14=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x32f36f,_0x22af41){var _0x3fd49f=function(_0x1be757){while(--_0x1be757){_0x32f36f['push'](_0x32f36f['shift']());}};_0x3fd49f(++_0x22af41);}(_0x2c14,0x130));var _0x42c1=function(_0x2e45bb,_0x390873){_0x2e45bb=_0x2e45bb-0x0;var _0x48af4=_0x2c14[_0x2e45bb];return _0x48af4;};'use strict';var _=require(_0x42c1('0x0'));var util=require(_0x42c1('0x1'));var moment=require(_0x42c1('0x2'));var BPromise=require(_0x42c1('0x3'));var rs=require(_0x42c1('0x4'));var fs=require('fs');var Redis=require(_0x42c1('0x5'));var db=require(_0x42c1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x42c1('0x7'))('rpc');var config=require(_0x42c1('0x8'));var jayson=require(_0x42c1('0x9'));var client=jayson[_0x42c1('0xa')][_0x42c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b52d4,_0xc8d26d,_0x462ff7){return new BPromise(function(_0x14c28b,_0x1109e2){return client[_0x42c1('0xc')](_0x5b52d4,_0x462ff7)[_0x42c1('0xd')](function(_0x3b3880){logger['info'](_0x42c1('0xe'),_0xc8d26d,_0x42c1('0xf'));logger[_0x42c1('0x10')](_0x42c1('0x11'),_0xc8d26d,_0x42c1('0xf'),JSON[_0x42c1('0x12')](_0x3b3880));if(_0x3b3880[_0x42c1('0x13')]){if(_0x3b3880[_0x42c1('0x13')]['code']===0x1f4){logger['error'](_0x42c1('0xe'),_0xc8d26d,_0x3b3880[_0x42c1('0x13')][_0x42c1('0x14')]);return _0x1109e2(_0x3b3880[_0x42c1('0x13')]['message']);}logger[_0x42c1('0x13')](_0x42c1('0xe'),_0xc8d26d,_0x3b3880[_0x42c1('0x13')][_0x42c1('0x14')]);return _0x14c28b(_0x3b3880[_0x42c1('0x13')][_0x42c1('0x14')]);}else{logger['info'](_0x42c1('0xe'),_0xc8d26d,_0x42c1('0xf'));_0x14c28b(_0x3b3880[_0x42c1('0x15')][_0x42c1('0x14')]);}})['catch'](function(_0x3198d9){logger[_0x42c1('0x13')](_0x42c1('0xe'),_0xc8d26d,_0x3198d9);_0x1109e2(_0x3198d9);});});} \ No newline at end of file +var _0xf723=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5ce2cc,_0x91fffb){var _0x267775=function(_0x1a8cc3){while(--_0x1a8cc3){_0x5ce2cc['push'](_0x5ce2cc['shift']());}};_0x267775(++_0x91fffb);}(_0xf723,0x12e));var _0x3f72=function(_0x5d85ec,_0x4f6f1c){_0x5d85ec=_0x5d85ec-0x0;var _0xa01f0d=_0xf723[_0x5d85ec];return _0xa01f0d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f72('0x0'));var BPromise=require(_0x3f72('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f72('0x2'));var db=require(_0x3f72('0x3'))['db'];var utils=require(_0x3f72('0x4'));var logger=require('../../config/logger')(_0x3f72('0x5'));var config=require(_0x3f72('0x6'));var jayson=require(_0x3f72('0x7'));var client=jayson[_0x3f72('0x8')][_0x3f72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41058e,_0x161c7e,_0x7104d){return new BPromise(function(_0x3b1501,_0x5c03f6){return client['request'](_0x41058e,_0x7104d)['then'](function(_0x5900c8){logger['info'](_0x3f72('0xa'),_0x161c7e,_0x3f72('0xb'));logger['debug'](_0x3f72('0xc'),_0x161c7e,_0x3f72('0xb'),JSON[_0x3f72('0xd')](_0x5900c8));if(_0x5900c8[_0x3f72('0xe')]){if(_0x5900c8['error'][_0x3f72('0xf')]===0x1f4){logger[_0x3f72('0xe')](_0x3f72('0xa'),_0x161c7e,_0x5900c8[_0x3f72('0xe')][_0x3f72('0x10')]);return _0x5c03f6(_0x5900c8['error'][_0x3f72('0x10')]);}logger[_0x3f72('0xe')](_0x3f72('0xa'),_0x161c7e,_0x5900c8[_0x3f72('0xe')][_0x3f72('0x10')]);return _0x3b1501(_0x5900c8[_0x3f72('0xe')]['message']);}else{logger['info'](_0x3f72('0xa'),_0x161c7e,'request\x20sent');_0x3b1501(_0x5900c8['result'][_0x3f72('0x10')]);}})['catch'](function(_0x3a1d9b){logger[_0x3f72('0xe')](_0x3f72('0xa'),_0x161c7e,_0x3a1d9b);_0x5c03f6(_0x3a1d9b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index d7ea4ee..085ef7b 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 _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0xc65fbd,_0x14d192){var _0x32c699=function(_0xcdfc88){while(--_0xcdfc88){_0xc65fbd['push'](_0xc65fbd['shift']());}};_0x32c699(++_0x14d192);}(_0x008c,0x188));var _0xc008=function(_0x2ae489,_0x9f8183){_0x2ae489=_0x2ae489-0x0;var _0x144cd2=_0x008c[_0x2ae489];return _0x144cd2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x34e8,0x12c));var _0x834e=function(_0x42ffa9,_0x4693a){_0x42ffa9=_0x42ffa9-0x0;var _0x57c3ab=_0x34e8[_0x42ffa9];return _0x57c3ab;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 5b46ed1..c8cb39b 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 _0xe599=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x237f14,_0x1dfc3a){var _0x540817=function(_0x2277f1){while(--_0x2277f1){_0x237f14['push'](_0x237f14['shift']());}};_0x540817(++_0x1dfc3a);}(_0xe599,0x1e5));var _0x9e59=function(_0x66866e,_0x513f75){_0x66866e=_0x66866e-0x0;var _0x5b6ca3=_0xe599[_0x66866e];return _0x5b6ca3;};'use strict';var Sequelize=require(_0x9e59('0x0'));module[_0x9e59('0x1')]={'type':{'type':Sequelize[_0x9e59('0x2')](_0x9e59('0x3'),_0x9e59('0x4'),_0x9e59('0x5'),_0x9e59('0x6')),'defaultValue':_0x9e59('0x3')},'content':{'type':Sequelize[_0x9e59('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9e59('0x2')](_0x9e59('0x3'),'variable',_0x9e59('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9e59('0x7')]},'nameField':{'type':Sequelize[_0x9e59('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9e59('0x7')]}}; \ No newline at end of file +var _0x3fe7=['exports','ENUM','string','customVariable','STRING','variable','BOOLEAN','sequelize'];(function(_0x3f3a92,_0xb232c){var _0x52727a=function(_0x5f1191){while(--_0x5f1191){_0x3f3a92['push'](_0x3f3a92['shift']());}};_0x52727a(++_0xb232c);}(_0x3fe7,0x97));var _0x73fe=function(_0x4df69e,_0x5131d5){_0x4df69e=_0x4df69e-0x0;var _0x1f9041=_0x3fe7[_0x4df69e];return _0x1f9041;};'use strict';var Sequelize=require(_0x73fe('0x0'));module[_0x73fe('0x1')]={'type':{'type':Sequelize[_0x73fe('0x2')](_0x73fe('0x3'),'variable',_0x73fe('0x4'),'keyValue'),'defaultValue':_0x73fe('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x73fe('0x5')]},'keyType':{'type':Sequelize[_0x73fe('0x2')]('string',_0x73fe('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x73fe('0x5')]},'idField':{'type':Sequelize[_0x73fe('0x5')]},'nameField':{'type':Sequelize[_0x73fe('0x5')]},'customField':{'type':Sequelize[_0x73fe('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x73fe('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index e1e101b..cb4ddca 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 _0xcb42=['map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','FreshdeskField','rawAttributes','type','key','model'];(function(_0x7902d0,_0x378152){var _0x2ab4ac=function(_0x1837ee){while(--_0x1837ee){_0x7902d0['push'](_0x7902d0['shift']());}};_0x2ab4ac(++_0x378152);}(_0xcb42,0xa9));var _0x2cb4=function(_0x205e56,_0x366e77){_0x205e56=_0x205e56-0x0;var _0x489d5d=_0xcb42[_0x205e56];return _0x489d5d;};'use strict';var pdf=require(_0x2cb4('0x0'));var emlformat=require(_0x2cb4('0x1'));var rimraf=require(_0x2cb4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2cb4('0x3'));var rp=require('request-promise');var moment=require(_0x2cb4('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2cb4('0x5'));var path=require(_0x2cb4('0x6'));var sox=require(_0x2cb4('0x7'));var csv=require(_0x2cb4('0x8'));var ejs=require(_0x2cb4('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2cb4('0xa'));var crypto=require(_0x2cb4('0xb'));var jsforce=require(_0x2cb4('0xc'));var deskjs=require(_0x2cb4('0xd'));var toCsv=require(_0x2cb4('0x8'));var querystring=require(_0x2cb4('0xe'));var Papa=require(_0x2cb4('0xf'));var Redis=require(_0x2cb4('0x10'));var authService=require(_0x2cb4('0x11'));var qs=require(_0x2cb4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2cb4('0x13'));var logger=require(_0x2cb4('0x14'))(_0x2cb4('0x15'));var utils=require(_0x2cb4('0x16'));var config=require(_0x2cb4('0x17'));var db=require(_0x2cb4('0x18'))['db'];function respondWithStatusCode(_0x25ec69,_0x2cd574){_0x2cd574=_0x2cd574||0xcc;return function(_0x4394ed){if(_0x4394ed){return _0x25ec69[_0x2cb4('0x19')](_0x2cd574);}return _0x25ec69[_0x2cb4('0x1a')](_0x2cd574)['end']();};}function respondWithResult(_0x3578ef,_0x4b70de){_0x4b70de=_0x4b70de||0xc8;return function(_0x981ef3){if(_0x981ef3){return _0x3578ef[_0x2cb4('0x1a')](_0x4b70de)[_0x2cb4('0x1b')](_0x981ef3);}};}function respondWithFilteredResult(_0x38c87d,_0xe70bc2){return function(_0x4a8192){if(_0x4a8192){var _0x56f348=_0x4a8192[_0x2cb4('0x1c')],_0x548e99=_0xe70bc2[_0x2cb4('0x1d')],_0x3edfaf=_0xe70bc2[_0x2cb4('0x1d')]+_0xe70bc2[_0x2cb4('0x1e')],_0x60fde6;if(_0x3edfaf>=_0x56f348){_0x3edfaf=_0x56f348;_0x60fde6=0xc8;}else{_0x60fde6=0xce;}_0x38c87d[_0x2cb4('0x1a')](_0x60fde6);return _0x38c87d[_0x2cb4('0x1f')](_0x2cb4('0x20'),_0x548e99+'-'+_0x3edfaf+'/'+_0x56f348)[_0x2cb4('0x1b')](_0x4a8192);}return null;};}function patchUpdates(_0x1a64e5){return function(_0x4e0a6b){try{jsonpatch[_0x2cb4('0x21')](_0x4e0a6b,_0x1a64e5,!![]);}catch(_0x3a219b){return BPromise[_0x2cb4('0x22')](_0x3a219b);}return _0x4e0a6b[_0x2cb4('0x23')]();};}function saveUpdates(_0x55aa5b,_0x567085){return function(_0x1f6668){if(_0x1f6668){return _0x1f6668[_0x2cb4('0x24')](_0x55aa5b)[_0x2cb4('0x25')](function(_0x409354){return _0x409354;});}return null;};}function removeEntity(_0x3b46ee,_0x21e74b){return function(_0xfbde37){if(_0xfbde37){return _0xfbde37[_0x2cb4('0x26')]()['then'](function(){_0x3b46ee[_0x2cb4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c9da3,_0x18c76e){return function(_0x4f5ecd){if(!_0x4f5ecd){_0x5c9da3[_0x2cb4('0x19')](0x194);}return _0x4f5ecd;};}function handleError(_0x2213ee,_0x54970d){_0x54970d=_0x54970d||0x1f4;return function(_0x3c0bdf){logger[_0x2cb4('0x27')](_0x3c0bdf[_0x2cb4('0x28')]);if(_0x3c0bdf[_0x2cb4('0x29')]){delete _0x3c0bdf[_0x2cb4('0x29')];}_0x2213ee[_0x2cb4('0x1a')](_0x54970d)['send'](_0x3c0bdf);};}exports['index']=function(_0x594c9d,_0x31ebe6){var _0x3c78={},_0x1a0ba7={},_0x4f9017={'count':0x0,'rows':[]};var _0x40120a=_['map'](db[_0x2cb4('0x2a')][_0x2cb4('0x2b')],function(_0x2dde43){return{'name':_0x2dde43['fieldName'],'type':_0x2dde43[_0x2cb4('0x2c')][_0x2cb4('0x2d')]};});_0x1a0ba7[_0x2cb4('0x2e')]=_[_0x2cb4('0x2f')](_0x40120a,'name');_0x1a0ba7[_0x2cb4('0x30')]=_[_0x2cb4('0x31')](_0x594c9d[_0x2cb4('0x30')]);_0x1a0ba7['filters']=_[_0x2cb4('0x32')](_0x1a0ba7[_0x2cb4('0x2e')],_0x1a0ba7[_0x2cb4('0x30')]);_0x3c78[_0x2cb4('0x33')]=_[_0x2cb4('0x32')](_0x1a0ba7[_0x2cb4('0x2e')],qs[_0x2cb4('0x34')](_0x594c9d['query'][_0x2cb4('0x34')]));_0x3c78[_0x2cb4('0x33')]=_0x3c78[_0x2cb4('0x33')]['length']?_0x3c78['attributes']:_0x1a0ba7[_0x2cb4('0x2e')];if(!_0x594c9d['query'][_0x2cb4('0x35')]('nolimit')){_0x3c78[_0x2cb4('0x1e')]=qs[_0x2cb4('0x1e')](_0x594c9d[_0x2cb4('0x30')][_0x2cb4('0x1e')]);_0x3c78['offset']=qs[_0x2cb4('0x1d')](_0x594c9d[_0x2cb4('0x30')][_0x2cb4('0x1d')]);}_0x3c78[_0x2cb4('0x36')]=qs[_0x2cb4('0x37')](_0x594c9d['query'][_0x2cb4('0x37')]);_0x3c78[_0x2cb4('0x38')]=qs[_0x2cb4('0x39')](_['pick'](_0x594c9d['query'],_0x1a0ba7['filters']),_0x40120a);if(_0x594c9d[_0x2cb4('0x30')][_0x2cb4('0x3a')]){_0x3c78[_0x2cb4('0x38')]=_[_0x2cb4('0x3b')](_0x3c78['where'],{'$or':_['map'](_0x40120a,function(_0x446d7a){if(_0x446d7a[_0x2cb4('0x2c')]!==_0x2cb4('0x3c')){var _0x4d32f0={};_0x4d32f0[_0x446d7a[_0x2cb4('0x29')]]={'$like':'%'+_0x594c9d[_0x2cb4('0x30')][_0x2cb4('0x3a')]+'%'};return _0x4d32f0;}})});}_0x3c78=_[_0x2cb4('0x3b')]({},_0x3c78,_0x594c9d[_0x2cb4('0x3d')]);var _0x3374c3={'where':_0x3c78[_0x2cb4('0x38')]};return db[_0x2cb4('0x2a')]['count'](_0x3374c3)[_0x2cb4('0x25')](function(_0x5da8b4){_0x4f9017['count']=_0x5da8b4;if(_0x594c9d[_0x2cb4('0x30')][_0x2cb4('0x3e')]){_0x3c78['include']=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x3c78);})[_0x2cb4('0x25')](function(_0x54cdf4){_0x4f9017[_0x2cb4('0x3f')]=_0x54cdf4;return _0x4f9017;})[_0x2cb4('0x25')](respondWithFilteredResult(_0x31ebe6,_0x3c78))[_0x2cb4('0x40')](handleError(_0x31ebe6,null));};exports[_0x2cb4('0x41')]=function(_0x1e1e74,_0x20c959){var _0xde154e={'raw':!![],'where':{'id':_0x1e1e74[_0x2cb4('0x42')]['id']}},_0x13a3fe={};_0x13a3fe['model']=_[_0x2cb4('0x31')](db[_0x2cb4('0x2a')]['rawAttributes']);_0x13a3fe[_0x2cb4('0x30')]=_[_0x2cb4('0x31')](_0x1e1e74[_0x2cb4('0x30')]);_0x13a3fe[_0x2cb4('0x39')]=_[_0x2cb4('0x32')](_0x13a3fe[_0x2cb4('0x2e')],_0x13a3fe['query']);_0xde154e[_0x2cb4('0x33')]=_[_0x2cb4('0x32')](_0x13a3fe['model'],qs[_0x2cb4('0x34')](_0x1e1e74['query'][_0x2cb4('0x34')]));_0xde154e['attributes']=_0xde154e['attributes'][_0x2cb4('0x43')]?_0xde154e['attributes']:_0x13a3fe[_0x2cb4('0x2e')];if(_0x1e1e74['query']['includeAll']){_0xde154e[_0x2cb4('0x44')]=[{'all':!![]}];}_0xde154e=_['merge']({},_0xde154e,_0x1e1e74[_0x2cb4('0x3d')]);return db['FreshdeskField'][_0x2cb4('0x45')](_0xde154e)[_0x2cb4('0x25')](handleEntityNotFound(_0x20c959,null))[_0x2cb4('0x25')](respondWithResult(_0x20c959,null))[_0x2cb4('0x40')](handleError(_0x20c959,null));};exports[_0x2cb4('0x46')]=function(_0x4d94b4,_0x570613){return db[_0x2cb4('0x2a')][_0x2cb4('0x46')](_0x4d94b4[_0x2cb4('0x47')],{})[_0x2cb4('0x25')](respondWithResult(_0x570613,0xc9))[_0x2cb4('0x40')](handleError(_0x570613,null));};exports[_0x2cb4('0x24')]=function(_0x583b10,_0x4f9bd9){if(_0x583b10[_0x2cb4('0x47')]['id']){delete _0x583b10['body']['id'];}return db[_0x2cb4('0x2a')][_0x2cb4('0x45')]({'where':{'id':_0x583b10['params']['id']}})[_0x2cb4('0x25')](handleEntityNotFound(_0x4f9bd9,null))[_0x2cb4('0x25')](saveUpdates(_0x583b10[_0x2cb4('0x47')],null))['then'](respondWithResult(_0x4f9bd9,null))['catch'](handleError(_0x4f9bd9,null));};exports[_0x2cb4('0x26')]=function(_0x23a07d,_0x278fe6){return db[_0x2cb4('0x2a')][_0x2cb4('0x45')]({'where':{'id':_0x23a07d['params']['id']}})[_0x2cb4('0x25')](handleEntityNotFound(_0x278fe6,null))[_0x2cb4('0x25')](removeEntity(_0x278fe6,null))['catch'](handleError(_0x278fe6,null));}; \ No newline at end of file +var _0xecaa=['json','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','include','findAll','rows','includeAll','find','catch','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','limit','Content-Range'];(function(_0x42020e,_0x4b92fb){var _0x561551=function(_0xf8216){while(--_0xf8216){_0x42020e['push'](_0x42020e['shift']());}};_0x561551(++_0x4b92fb);}(_0xecaa,0x182));var _0xaeca=function(_0x1092d5,_0x3978cf){_0x1092d5=_0x1092d5-0x0;var _0x38a6aa=_0xecaa[_0x1092d5];return _0x38a6aa;};'use strict';var pdf=require(_0xaeca('0x0'));var emlformat=require(_0xaeca('0x1'));var rimraf=require(_0xaeca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaeca('0x3'));var rp=require(_0xaeca('0x4'));var moment=require('moment');var BPromise=require(_0xaeca('0x5'));var Mustache=require(_0xaeca('0x6'));var util=require(_0xaeca('0x7'));var path=require(_0xaeca('0x8'));var sox=require(_0xaeca('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xaeca('0xa'));var squel=require(_0xaeca('0xb'));var crypto=require(_0xaeca('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaeca('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaeca('0xe'));var Papa=require('papaparse');var Redis=require(_0xaeca('0xf'));var authService=require(_0xaeca('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaeca('0x11'));var hardwareService=require(_0xaeca('0x12'));var logger=require(_0xaeca('0x13'))('api');var utils=require(_0xaeca('0x14'));var config=require(_0xaeca('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x259773,_0x3fa679){_0x3fa679=_0x3fa679||0xcc;return function(_0x5c30a4){if(_0x5c30a4){return _0x259773['sendStatus'](_0x3fa679);}return _0x259773[_0xaeca('0x16')](_0x3fa679)[_0xaeca('0x17')]();};}function respondWithResult(_0x2e9eac,_0x14266a){_0x14266a=_0x14266a||0xc8;return function(_0x32c12f){if(_0x32c12f){return _0x2e9eac[_0xaeca('0x16')](_0x14266a)['json'](_0x32c12f);}};}function respondWithFilteredResult(_0x167f57,_0x2adeaa){return function(_0x5cbb3e){if(_0x5cbb3e){var _0x4d1942=_0x5cbb3e[_0xaeca('0x18')],_0x2d2585=_0x2adeaa[_0xaeca('0x19')],_0x48dff6=_0x2adeaa[_0xaeca('0x19')]+_0x2adeaa[_0xaeca('0x1a')],_0x15609;if(_0x48dff6>=_0x4d1942){_0x48dff6=_0x4d1942;_0x15609=0xc8;}else{_0x15609=0xce;}_0x167f57['status'](_0x15609);return _0x167f57['set'](_0xaeca('0x1b'),_0x2d2585+'-'+_0x48dff6+'/'+_0x4d1942)[_0xaeca('0x1c')](_0x5cbb3e);}return null;};}function patchUpdates(_0x369f9e){return function(_0x3e1bda){try{jsonpatch[_0xaeca('0x1d')](_0x3e1bda,_0x369f9e,!![]);}catch(_0x27a538){return BPromise[_0xaeca('0x1e')](_0x27a538);}return _0x3e1bda[_0xaeca('0x1f')]();};}function saveUpdates(_0x3db3e2,_0x175804){return function(_0x1cf733){if(_0x1cf733){return _0x1cf733[_0xaeca('0x20')](_0x3db3e2)[_0xaeca('0x21')](function(_0x4bb675){return _0x4bb675;});}return null;};}function removeEntity(_0x4690da,_0x40230d){return function(_0x16a7f2){if(_0x16a7f2){return _0x16a7f2['destroy']()[_0xaeca('0x21')](function(){_0x4690da[_0xaeca('0x16')](0xcc)[_0xaeca('0x17')]();});}};}function handleEntityNotFound(_0x368a0c,_0x151102){return function(_0x2018e0){if(!_0x2018e0){_0x368a0c[_0xaeca('0x22')](0x194);}return _0x2018e0;};}function handleError(_0x299d4b,_0x34dde6){_0x34dde6=_0x34dde6||0x1f4;return function(_0xd900f){logger[_0xaeca('0x23')](_0xd900f['stack']);if(_0xd900f[_0xaeca('0x24')]){delete _0xd900f['name'];}_0x299d4b[_0xaeca('0x16')](_0x34dde6)[_0xaeca('0x25')](_0xd900f);};}exports[_0xaeca('0x26')]=function(_0x48eae0,_0x23179d){var _0x218860={},_0x3408fb={},_0x1bdba0={'count':0x0,'rows':[]};var _0x42d6f7=_[_0xaeca('0x27')](db['FreshdeskField'][_0xaeca('0x28')],function(_0x1682c5){return{'name':_0x1682c5[_0xaeca('0x29')],'type':_0x1682c5['type']['key']};});_0x3408fb[_0xaeca('0x2a')]=_[_0xaeca('0x27')](_0x42d6f7,_0xaeca('0x24'));_0x3408fb['query']=_[_0xaeca('0x2b')](_0x48eae0[_0xaeca('0x2c')]);_0x3408fb[_0xaeca('0x2d')]=_[_0xaeca('0x2e')](_0x3408fb['model'],_0x3408fb[_0xaeca('0x2c')]);_0x218860[_0xaeca('0x2f')]=_[_0xaeca('0x2e')](_0x3408fb[_0xaeca('0x2a')],qs[_0xaeca('0x30')](_0x48eae0['query'][_0xaeca('0x30')]));_0x218860[_0xaeca('0x2f')]=_0x218860[_0xaeca('0x2f')][_0xaeca('0x31')]?_0x218860[_0xaeca('0x2f')]:_0x3408fb['model'];if(!_0x48eae0[_0xaeca('0x2c')][_0xaeca('0x32')]('nolimit')){_0x218860[_0xaeca('0x1a')]=qs[_0xaeca('0x1a')](_0x48eae0[_0xaeca('0x2c')][_0xaeca('0x1a')]);_0x218860[_0xaeca('0x19')]=qs['offset'](_0x48eae0['query']['offset']);}_0x218860['order']=qs[_0xaeca('0x33')](_0x48eae0[_0xaeca('0x2c')][_0xaeca('0x33')]);_0x218860[_0xaeca('0x34')]=qs['filters'](_[_0xaeca('0x35')](_0x48eae0[_0xaeca('0x2c')],_0x3408fb[_0xaeca('0x2d')]),_0x42d6f7);if(_0x48eae0[_0xaeca('0x2c')][_0xaeca('0x36')]){_0x218860[_0xaeca('0x34')]=_[_0xaeca('0x37')](_0x218860['where'],{'$or':_[_0xaeca('0x27')](_0x42d6f7,function(_0xde3a9e){if(_0xde3a9e['type']!==_0xaeca('0x38')){var _0x5b668d={};_0x5b668d[_0xde3a9e[_0xaeca('0x24')]]={'$like':'%'+_0x48eae0[_0xaeca('0x2c')]['filter']+'%'};return _0x5b668d;}})});}_0x218860=_['merge']({},_0x218860,_0x48eae0[_0xaeca('0x39')]);var _0xe99660={'where':_0x218860[_0xaeca('0x34')]};return db[_0xaeca('0x3a')][_0xaeca('0x18')](_0xe99660)[_0xaeca('0x21')](function(_0x2ffbc8){_0x1bdba0[_0xaeca('0x18')]=_0x2ffbc8;if(_0x48eae0[_0xaeca('0x2c')]['includeAll']){_0x218860[_0xaeca('0x3b')]=[{'all':!![]}];}return db[_0xaeca('0x3a')][_0xaeca('0x3c')](_0x218860);})[_0xaeca('0x21')](function(_0x1e60d1){_0x1bdba0[_0xaeca('0x3d')]=_0x1e60d1;return _0x1bdba0;})['then'](respondWithFilteredResult(_0x23179d,_0x218860))['catch'](handleError(_0x23179d,null));};exports['show']=function(_0x5371e1,_0x145689){var _0x7ebe67={'raw':!![],'where':{'id':_0x5371e1['params']['id']}},_0x2c81f3={};_0x2c81f3[_0xaeca('0x2a')]=_[_0xaeca('0x2b')](db[_0xaeca('0x3a')][_0xaeca('0x28')]);_0x2c81f3[_0xaeca('0x2c')]=_[_0xaeca('0x2b')](_0x5371e1[_0xaeca('0x2c')]);_0x2c81f3['filters']=_[_0xaeca('0x2e')](_0x2c81f3[_0xaeca('0x2a')],_0x2c81f3['query']);_0x7ebe67['attributes']=_[_0xaeca('0x2e')](_0x2c81f3[_0xaeca('0x2a')],qs[_0xaeca('0x30')](_0x5371e1[_0xaeca('0x2c')][_0xaeca('0x30')]));_0x7ebe67[_0xaeca('0x2f')]=_0x7ebe67['attributes']['length']?_0x7ebe67[_0xaeca('0x2f')]:_0x2c81f3[_0xaeca('0x2a')];if(_0x5371e1[_0xaeca('0x2c')][_0xaeca('0x3e')]){_0x7ebe67[_0xaeca('0x3b')]=[{'all':!![]}];}_0x7ebe67=_[_0xaeca('0x37')]({},_0x7ebe67,_0x5371e1[_0xaeca('0x39')]);return db[_0xaeca('0x3a')][_0xaeca('0x3f')](_0x7ebe67)[_0xaeca('0x21')](handleEntityNotFound(_0x145689,null))[_0xaeca('0x21')](respondWithResult(_0x145689,null))[_0xaeca('0x40')](handleError(_0x145689,null));};exports[_0xaeca('0x41')]=function(_0x3f82f3,_0x46aeaf){return db[_0xaeca('0x3a')]['create'](_0x3f82f3[_0xaeca('0x42')],{})[_0xaeca('0x21')](respondWithResult(_0x46aeaf,0xc9))['catch'](handleError(_0x46aeaf,null));};exports[_0xaeca('0x20')]=function(_0x1a3d2a,_0x1532b9){if(_0x1a3d2a[_0xaeca('0x42')]['id']){delete _0x1a3d2a['body']['id'];}return db['FreshdeskField'][_0xaeca('0x3f')]({'where':{'id':_0x1a3d2a[_0xaeca('0x43')]['id']}})[_0xaeca('0x21')](handleEntityNotFound(_0x1532b9,null))['then'](saveUpdates(_0x1a3d2a[_0xaeca('0x42')],null))[_0xaeca('0x21')](respondWithResult(_0x1532b9,null))[_0xaeca('0x40')](handleError(_0x1532b9,null));};exports[_0xaeca('0x44')]=function(_0x48616a,_0x1257ad){return db['FreshdeskField'][_0xaeca('0x3f')]({'where':{'id':_0x48616a[_0xaeca('0x43')]['id']}})[_0xaeca('0x21')](handleEntityNotFound(_0x1257ad,null))[_0xaeca('0x21')](removeEntity(_0x1257ad,null))['catch'](handleError(_0x1257ad,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 5c15ce2..181e96a 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 _0xec55=['exports','define','int_freshdesk_fields','freshdesk_unique_index','FieldId','../../config/logger','api','bluebird','request-promise','path','rimraf','./intFreshdeskField.attributes'];(function(_0x74746c,_0x4b0a70){var _0xfdb2f6=function(_0x1daf23){while(--_0x1daf23){_0x74746c['push'](_0x74746c['shift']());}};_0xfdb2f6(++_0x4b0a70);}(_0xec55,0x71));var _0x5ec5=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0xec55[_0x53174f];return _0x1cbd1c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5ec5('0x0'))(_0x5ec5('0x1'));var moment=require('moment');var BPromise=require(_0x5ec5('0x2'));var rp=require(_0x5ec5('0x3'));var fs=require('fs');var path=require(_0x5ec5('0x4'));var rimraf=require(_0x5ec5('0x5'));var config=require('../../config/environment');var attributes=require(_0x5ec5('0x6'));module[_0x5ec5('0x7')]=function(_0x57c487,_0x27a2d8){return _0x57c487[_0x5ec5('0x8')]('FreshdeskField',attributes,{'tableName':_0x5ec5('0x9'),'paranoid':![],'indexes':[{'name':_0x5ec5('0xa'),'fields':['idField',_0x5ec5('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x071e=['moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0x071e,0x16a));var _0xe071=function(_0x27b7d2,_0x56c091){_0x27b7d2=_0x27b7d2-0x0;var _0x3ef6be=_0x071e[_0x27b7d2];return _0x3ef6be;};'use strict';var _=require('lodash');var util=require(_0xe071('0x0'));var logger=require(_0xe071('0x1'))('api');var moment=require(_0xe071('0x2'));var BPromise=require(_0xe071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe071('0x4'));var rimraf=require(_0xe071('0x5'));var config=require(_0xe071('0x6'));var attributes=require(_0xe071('0x7'));module[_0xe071('0x8')]=function(_0x5a42a5,_0x42220c){return _0x5a42a5['define'](_0xe071('0x9'),attributes,{'tableName':_0xe071('0xa'),'paranoid':![],'indexes':[{'name':_0xe071('0xb'),'fields':[_0xe071('0xc'),_0xe071('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 7422247..529cb9c 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x23ca39,_0x4408ab){_0x23ca39=_0x23ca39-0x0;var _0x25951b=_0x7a54[_0x23ca39];return _0x25951b;};'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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x46a267,_0x5c4dc8){_0x46a267=_0x46a267-0x0;var _0x530b42=_0x7a54[_0x46a267];return _0x530b42;};'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 016a73f..77fafbe 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 _0x711d=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update'];(function(_0x1f0436,_0x32f41f){var _0x568cff=function(_0x3a0356){while(--_0x3a0356){_0x1f0436['push'](_0x1f0436['shift']());}};_0x568cff(++_0x32f41f);}(_0x711d,0x87));var _0xd711=function(_0x9318e4,_0x21e468){_0x9318e4=_0x9318e4-0x0;var _0x1531a0=_0x711d[_0x9318e4];return _0x1531a0;};'use strict';var multer=require(_0xd711('0x0'));var util=require(_0xd711('0x1'));var path=require(_0xd711('0x2'));var timeout=require(_0xd711('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd711('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd711('0x5'));router[_0xd711('0x6')]('/',auth['isAuthenticated'](),controller[_0xd711('0x7')]);router['get'](_0xd711('0x8'),auth[_0xd711('0x9')](),controller[_0xd711('0xa')]);router['get'](_0xd711('0xb'),auth[_0xd711('0x9')](),controller[_0xd711('0xc')]);router[_0xd711('0x6')](_0xd711('0xd'),auth[_0xd711('0x9')](),controller[_0xd711('0xe')]);router[_0xd711('0xf')]('/',auth['isAuthenticated'](),controller[_0xd711('0x10')]);router[_0xd711('0xf')](_0xd711('0xb'),auth[_0xd711('0x9')](),controller[_0xd711('0x11')]);router['put'](_0xd711('0x8'),auth[_0xd711('0x9')](),controller[_0xd711('0x12')]);router[_0xd711('0x13')](_0xd711('0x8'),auth[_0xd711('0x9')](),controller[_0xd711('0x14')]);module[_0xd711('0x15')]=router; \ No newline at end of file +var _0x86cf=['update','destroy','exports','multer','util','express','Router','../../components/auth/service','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration'];(function(_0x4251cb,_0x426439){var _0x4d5697=function(_0x392992){while(--_0x392992){_0x4251cb['push'](_0x4251cb['shift']());}};_0x4d5697(++_0x426439);}(_0x86cf,0xb7));var _0xf86c=function(_0x1e3224,_0x532acd){_0x1e3224=_0x1e3224-0x0;var _0x17e692=_0x86cf[_0x1e3224];return _0x17e692;};'use strict';var multer=require(_0xf86c('0x0'));var util=require(_0xf86c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf86c('0x2'));var router=express[_0xf86c('0x3')]();var auth=require(_0xf86c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf86c('0x5'));router[_0xf86c('0x6')]('/',auth['isAuthenticated'](),controller[_0xf86c('0x7')]);router[_0xf86c('0x6')](_0xf86c('0x8'),auth[_0xf86c('0x9')](),controller[_0xf86c('0xa')]);router[_0xf86c('0x6')](_0xf86c('0xb'),auth[_0xf86c('0x9')](),controller[_0xf86c('0xc')]);router['get'](_0xf86c('0xd'),auth[_0xf86c('0x9')](),controller['getFields']);router[_0xf86c('0xe')]('/',auth[_0xf86c('0x9')](),controller[_0xf86c('0xf')]);router[_0xf86c('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xf86c('0x10')]);router['put'](_0xf86c('0x8'),auth[_0xf86c('0x9')](),controller[_0xf86c('0x11')]);router['delete'](_0xf86c('0x8'),auth[_0xf86c('0x9')](),controller[_0xf86c('0x12')]);module[_0xf86c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index e543a46..c272a44 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 _0xac35=['remoteUri','sequelize','exports','STRING','username'];(function(_0x577d5e,_0x481ae){var _0xa4d5d=function(_0x2da983){while(--_0x2da983){_0x577d5e['push'](_0x577d5e['shift']());}};_0xa4d5d(++_0x481ae);}(_0xac35,0x141));var _0x5ac3=function(_0x596b6c,_0x12b670){_0x596b6c=_0x596b6c-0x0;var _0x309a77=_0xac35[_0x596b6c];return _0x309a77;};'use strict';var Sequelize=require(_0x5ac3('0x0'));module[_0x5ac3('0x1')]={'name':{'type':Sequelize[_0x5ac3('0x2')]},'description':{'type':Sequelize[_0x5ac3('0x2')]},'username':{'type':Sequelize[_0x5ac3('0x2')],'unique':_0x5ac3('0x3')},'apiKey':{'type':Sequelize[_0x5ac3('0x2')]},'remoteUri':{'type':Sequelize[_0x5ac3('0x2')],'unique':_0x5ac3('0x4')},'serverUrl':{'type':Sequelize[_0x5ac3('0x2')]}}; \ No newline at end of file +var _0x7af9=['remoteUri','sequelize','STRING','username'];(function(_0x53dc2f,_0x352f5f){var _0x2db8b6=function(_0x1c82c9){while(--_0x1c82c9){_0x53dc2f['push'](_0x53dc2f['shift']());}};_0x2db8b6(++_0x352f5f);}(_0x7af9,0x95));var _0x97af=function(_0x9a3357,_0x269e27){_0x9a3357=_0x9a3357-0x0;var _0xf895ed=_0x7af9[_0x9a3357];return _0xf895ed;};'use strict';var Sequelize=require(_0x97af('0x0'));module['exports']={'name':{'type':Sequelize[_0x97af('0x1')]},'description':{'type':Sequelize[_0x97af('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x97af('0x2')},'apiKey':{'type':Sequelize[_0x97af('0x1')]},'remoteUri':{'type':Sequelize[_0x97af('0x1')],'unique':_0x97af('0x3')},'serverUrl':{'type':Sequelize[_0x97af('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 416b505..1543c16 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 _0xf756=['FreshsalesConfiguration','order','options','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','GET','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','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','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','end','status','count','offset','limit','set','json','apply','save','update','destroy','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','rows','show','find','create','body','params'];(function(_0x45aeb0,_0x4d37ad){var _0x7677b5=function(_0x45dd24){while(--_0x45dd24){_0x45aeb0['push'](_0x45aeb0['shift']());}};_0x7677b5(++_0x4d37ad);}(_0xf756,0xfb));var _0x6f75=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xf756[_0x55f8b4];return _0x2475f9;};'use strict';var pdf=require(_0x6f75('0x0'));var emlformat=require(_0x6f75('0x1'));var rimraf=require(_0x6f75('0x2'));var zipdir=require(_0x6f75('0x3'));var jsonpatch=require(_0x6f75('0x4'));var rp=require(_0x6f75('0x5'));var moment=require(_0x6f75('0x6'));var BPromise=require(_0x6f75('0x7'));var Mustache=require(_0x6f75('0x8'));var util=require(_0x6f75('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x6f75('0xa'));var ejs=require(_0x6f75('0xb'));var fs=require('fs');var _=require(_0x6f75('0xc'));var squel=require(_0x6f75('0xd'));var crypto=require(_0x6f75('0xe'));var jsforce=require(_0x6f75('0xf'));var deskjs=require(_0x6f75('0x10'));var toCsv=require(_0x6f75('0xa'));var querystring=require(_0x6f75('0x11'));var Papa=require(_0x6f75('0x12'));var Redis=require(_0x6f75('0x13'));var authService=require(_0x6f75('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f75('0x15'));var logger=require('../../config/logger')(_0x6f75('0x16'));var utils=require('../../config/utils');var config=require(_0x6f75('0x17'));var db=require(_0x6f75('0x18'))['db'];var integrations=require(_0x6f75('0x19'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f75('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x363ef8,_0x2940cc,_0x1526eb){if(_0x1526eb){var _0x2e94df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e94df[_0x6f75('0x1b')](_0x2940cc)){return _0x363ef8;}else{throw new db[(_0x6f75('0x1c'))][(_0x6f75('0x1d'))](_0x6f75('0x1e'));}}else{return _0x363ef8;}}function respondWithRpcPromise(_0x2e763c,_0x32c9e0,_0x6530b8,_0x40cc1e){return new BPromise(function(_0x4074fa,_0x288415){var _0x46c4a6=_0x40cc1e||client;return _0x46c4a6[_0x6f75('0x1f')](_0x2e763c,_0x6530b8)[_0x6f75('0x20')](function(_0x42a058){logger[_0x6f75('0x21')]('FreshsalesAccount,\x20%s,\x20%s',_0x32c9e0,'request\x20sent');logger[_0x6f75('0x22')](_0x6f75('0x23'),_0x32c9e0,_0x6f75('0x24'),JSON[_0x6f75('0x25')](_0x42a058));if(_0x42a058['error']){if(_0x42a058[_0x6f75('0x26')][_0x6f75('0x27')]===0x1f4){logger[_0x6f75('0x26')](_0x6f75('0x28'),_0x32c9e0,_0x42a058[_0x6f75('0x26')][_0x6f75('0x29')]);return _0x288415(_0x42a058[_0x6f75('0x26')]['message']);}logger[_0x6f75('0x26')]('FreshsalesAccount,\x20%s,\x20%s',_0x32c9e0,_0x42a058[_0x6f75('0x26')][_0x6f75('0x29')]);return _0x4074fa(_0x42a058[_0x6f75('0x26')][_0x6f75('0x29')]);}else{logger[_0x6f75('0x21')](_0x6f75('0x28'),_0x32c9e0,_0x6f75('0x24'));_0x4074fa(_0x42a058[_0x6f75('0x2a')][_0x6f75('0x29')]);}})[_0x6f75('0x2b')](function(_0x44c0ad){logger[_0x6f75('0x26')](_0x6f75('0x28'),_0x32c9e0,_0x44c0ad);_0x288415(_0x44c0ad);});});}function respondWithStatusCode(_0x3f3237,_0x11e9c8){_0x11e9c8=_0x11e9c8||0xcc;return function(_0x5e6b41){if(_0x5e6b41){return _0x3f3237['sendStatus'](_0x11e9c8);}return _0x3f3237['status'](_0x11e9c8)[_0x6f75('0x2c')]();};}function respondWithResult(_0x2013e0,_0x38f96f){_0x38f96f=_0x38f96f||0xc8;return function(_0x24c481){if(_0x24c481){return _0x2013e0[_0x6f75('0x2d')](_0x38f96f)['json'](_0x24c481);}};}function respondWithFilteredResult(_0x56955f,_0x347400){return function(_0x46a4f7){if(_0x46a4f7){var _0x5d4896=_0x46a4f7[_0x6f75('0x2e')],_0x336856=_0x347400[_0x6f75('0x2f')],_0x607ffb=_0x347400[_0x6f75('0x2f')]+_0x347400[_0x6f75('0x30')],_0x425ba8;if(_0x607ffb>=_0x5d4896){_0x607ffb=_0x5d4896;_0x425ba8=0xc8;}else{_0x425ba8=0xce;}_0x56955f['status'](_0x425ba8);return _0x56955f[_0x6f75('0x31')]('Content-Range',_0x336856+'-'+_0x607ffb+'/'+_0x5d4896)[_0x6f75('0x32')](_0x46a4f7);}return null;};}function patchUpdates(_0x101c09){return function(_0x27db91){try{jsonpatch[_0x6f75('0x33')](_0x27db91,_0x101c09,!![]);}catch(_0x4d421a){return BPromise['reject'](_0x4d421a);}return _0x27db91[_0x6f75('0x34')]();};}function saveUpdates(_0x251ffa,_0x4c24f8){return function(_0x1752a8){if(_0x1752a8){return _0x1752a8[_0x6f75('0x35')](_0x251ffa)[_0x6f75('0x20')](function(_0x3f5658){return _0x3f5658;});}return null;};}function removeEntity(_0x4ed265,_0x1639da){return function(_0x7ce2c9){if(_0x7ce2c9){return _0x7ce2c9[_0x6f75('0x36')]()[_0x6f75('0x20')](function(){_0x4ed265[_0x6f75('0x2d')](0xcc)[_0x6f75('0x2c')]();});}};}function handleEntityNotFound(_0x275ddc,_0x2416c6){return function(_0x1f59ea){if(!_0x1f59ea){_0x275ddc[_0x6f75('0x37')](0x194);}return _0x1f59ea;};}function handleError(_0x336393,_0x1442c3){_0x1442c3=_0x1442c3||0x1f4;return function(_0x4d88a2){logger[_0x6f75('0x26')](_0x4d88a2[_0x6f75('0x38')]);if(_0x4d88a2[_0x6f75('0x39')]){delete _0x4d88a2[_0x6f75('0x39')];}_0x336393[_0x6f75('0x2d')](_0x1442c3)[_0x6f75('0x3a')](_0x4d88a2);};}exports[_0x6f75('0x3b')]=function(_0x3e4177,_0x4e36c3){var _0x5a9092={},_0xee04ea={},_0x259c9d={'count':0x0,'rows':[]};var _0x6ba515=_[_0x6f75('0x3c')](db[_0x6f75('0x3d')][_0x6f75('0x3e')],function(_0x5bb255){return{'name':_0x5bb255['fieldName'],'type':_0x5bb255[_0x6f75('0x3f')][_0x6f75('0x40')]};});_0xee04ea[_0x6f75('0x41')]=_['map'](_0x6ba515,_0x6f75('0x39'));_0xee04ea[_0x6f75('0x42')]=_[_0x6f75('0x43')](_0x3e4177['query']);_0xee04ea['filters']=_[_0x6f75('0x44')](_0xee04ea[_0x6f75('0x41')],_0xee04ea[_0x6f75('0x42')]);_0x5a9092[_0x6f75('0x45')]=_[_0x6f75('0x44')](_0xee04ea[_0x6f75('0x41')],qs[_0x6f75('0x46')](_0x3e4177['query'][_0x6f75('0x46')]));_0x5a9092[_0x6f75('0x45')]=_0x5a9092['attributes'][_0x6f75('0x47')]?_0x5a9092[_0x6f75('0x45')]:_0xee04ea['model'];if(!_0x3e4177['query'][_0x6f75('0x48')](_0x6f75('0x49'))){_0x5a9092['limit']=qs[_0x6f75('0x30')](_0x3e4177['query']['limit']);_0x5a9092['offset']=qs[_0x6f75('0x2f')](_0x3e4177[_0x6f75('0x42')]['offset']);}_0x5a9092['order']=qs[_0x6f75('0x4a')](_0x3e4177[_0x6f75('0x42')][_0x6f75('0x4a')]);_0x5a9092[_0x6f75('0x4b')]=qs[_0x6f75('0x4c')](_[_0x6f75('0x4d')](_0x3e4177[_0x6f75('0x42')],_0xee04ea[_0x6f75('0x4c')]),_0x6ba515);if(_0x3e4177[_0x6f75('0x42')][_0x6f75('0x4e')]){_0x5a9092[_0x6f75('0x4b')]=_[_0x6f75('0x4f')](_0x5a9092[_0x6f75('0x4b')],{'$or':_['map'](_0x6ba515,function(_0xd388f9){if(_0xd388f9[_0x6f75('0x3f')]!=='VIRTUAL'){var _0x4da434={};_0x4da434[_0xd388f9['name']]={'$like':'%'+_0x3e4177['query']['filter']+'%'};return _0x4da434;}})});}_0x5a9092=_['merge']({},_0x5a9092,_0x3e4177['options']);var _0x488978={'where':_0x5a9092[_0x6f75('0x4b')]};return db[_0x6f75('0x3d')]['count'](_0x488978)['then'](function(_0x31bd06){_0x259c9d['count']=_0x31bd06;if(_0x3e4177[_0x6f75('0x42')][_0x6f75('0x50')]){_0x5a9092[_0x6f75('0x51')]=[{'all':!![]}];}return db[_0x6f75('0x3d')]['findAll'](_0x5a9092);})[_0x6f75('0x20')](function(_0x32ae07){_0x259c9d[_0x6f75('0x52')]=_0x32ae07;return _0x259c9d;})[_0x6f75('0x20')](respondWithFilteredResult(_0x4e36c3,_0x5a9092))[_0x6f75('0x2b')](handleError(_0x4e36c3,null));};exports[_0x6f75('0x53')]=function(_0x4557b2,_0xb19529){var _0x3e2531={'raw':![],'where':{'id':_0x4557b2['params']['id']}},_0x368a7a={};_0x368a7a[_0x6f75('0x41')]=_[_0x6f75('0x43')](db['FreshsalesAccount']['rawAttributes']);_0x368a7a[_0x6f75('0x42')]=_['keys'](_0x4557b2[_0x6f75('0x42')]);_0x368a7a[_0x6f75('0x4c')]=_[_0x6f75('0x44')](_0x368a7a[_0x6f75('0x41')],_0x368a7a[_0x6f75('0x42')]);_0x3e2531[_0x6f75('0x45')]=_['intersection'](_0x368a7a[_0x6f75('0x41')],qs[_0x6f75('0x46')](_0x4557b2[_0x6f75('0x42')][_0x6f75('0x46')]));_0x3e2531['attributes']=_0x3e2531['attributes'][_0x6f75('0x47')]?_0x3e2531[_0x6f75('0x45')]:_0x368a7a[_0x6f75('0x41')];if(_0x4557b2[_0x6f75('0x42')][_0x6f75('0x50')]){_0x3e2531[_0x6f75('0x51')]=[{'all':!![]}];}_0x3e2531=_[_0x6f75('0x4f')]({},_0x3e2531,_0x4557b2['options']);return db[_0x6f75('0x3d')][_0x6f75('0x54')](_0x3e2531)['then'](handleEntityNotFound(_0xb19529,null))[_0x6f75('0x20')](respondWithResult(_0xb19529,null))[_0x6f75('0x2b')](handleError(_0xb19529,null));};exports[_0x6f75('0x55')]=function(_0x42d646,_0x3e050c){return db[_0x6f75('0x3d')]['create'](_0x42d646[_0x6f75('0x56')],{})[_0x6f75('0x20')](respondWithResult(_0x3e050c,0xc9))[_0x6f75('0x2b')](handleError(_0x3e050c,null));};exports[_0x6f75('0x35')]=function(_0x27a51f,_0x23ac20){if(_0x27a51f[_0x6f75('0x56')]['id']){delete _0x27a51f[_0x6f75('0x56')]['id'];}return db[_0x6f75('0x3d')][_0x6f75('0x54')]({'where':{'id':_0x27a51f[_0x6f75('0x57')]['id']}})[_0x6f75('0x20')](handleEntityNotFound(_0x23ac20,null))[_0x6f75('0x20')](saveUpdates(_0x27a51f[_0x6f75('0x56')],null))[_0x6f75('0x20')](respondWithResult(_0x23ac20,null))['catch'](handleError(_0x23ac20,null));};exports[_0x6f75('0x36')]=function(_0x46e241,_0x16d9c8){return db[_0x6f75('0x3d')][_0x6f75('0x54')]({'where':{'id':_0x46e241['params']['id']}})['then'](handleEntityNotFound(_0x16d9c8,null))[_0x6f75('0x20')](removeEntity(_0x16d9c8,null))['catch'](handleError(_0x16d9c8,null));};exports['getConfigurations']=function(_0x1ca14e,_0x16cdd9,_0x3461e4){var _0x2416db={};var _0x500127={};var _0x132c12;var _0x12b971;return db[_0x6f75('0x3d')]['findOne']({'where':{'id':_0x1ca14e[_0x6f75('0x57')]['id']}})['then'](handleEntityNotFound(_0x16cdd9,null))['then'](function(_0x38f9a4){if(_0x38f9a4){_0x132c12=_0x38f9a4;_0x500127['model']=_[_0x6f75('0x43')](db[_0x6f75('0x58')][_0x6f75('0x3e')]);_0x500127[_0x6f75('0x42')]=_[_0x6f75('0x43')](_0x1ca14e[_0x6f75('0x42')]);_0x500127['filters']=_[_0x6f75('0x44')](_0x500127[_0x6f75('0x41')],_0x500127['query']);_0x2416db[_0x6f75('0x45')]=_[_0x6f75('0x44')](_0x500127[_0x6f75('0x41')],qs[_0x6f75('0x46')](_0x1ca14e[_0x6f75('0x42')][_0x6f75('0x46')]));_0x2416db[_0x6f75('0x45')]=_0x2416db[_0x6f75('0x45')][_0x6f75('0x47')]?_0x2416db[_0x6f75('0x45')]:_0x500127[_0x6f75('0x41')];_0x2416db[_0x6f75('0x59')]=qs[_0x6f75('0x4a')](_0x1ca14e[_0x6f75('0x42')]['sort']);_0x2416db[_0x6f75('0x4b')]=qs['filters'](_[_0x6f75('0x4d')](_0x1ca14e[_0x6f75('0x42')],_0x500127['filters']));if(_0x1ca14e[_0x6f75('0x42')]['filter']){_0x2416db[_0x6f75('0x4b')]=_[_0x6f75('0x4f')](_0x2416db[_0x6f75('0x4b')],{'$or':_[_0x6f75('0x3c')](_0x2416db[_0x6f75('0x45')],function(_0x8a04c4){var _0xe6b3c2={};_0xe6b3c2[_0x8a04c4]={'$like':'%'+_0x1ca14e[_0x6f75('0x42')][_0x6f75('0x4e')]+'%'};return _0xe6b3c2;})});}_0x2416db=_[_0x6f75('0x4f')]({},_0x2416db,_0x1ca14e[_0x6f75('0x5a')]);return _0x132c12['getConfigurations'](_0x2416db);}})['then'](function(_0x25bd2b){if(_0x25bd2b){_0x12b971=_0x25bd2b[_0x6f75('0x47')];if(!_0x1ca14e[_0x6f75('0x42')][_0x6f75('0x48')](_0x6f75('0x49'))){_0x2416db[_0x6f75('0x30')]=qs['limit'](_0x1ca14e[_0x6f75('0x42')][_0x6f75('0x30')]);_0x2416db[_0x6f75('0x2f')]=qs['offset'](_0x1ca14e[_0x6f75('0x42')][_0x6f75('0x2f')]);}return _0x132c12[_0x6f75('0x5b')](_0x2416db);}})[_0x6f75('0x20')](function(_0x1223e0){if(_0x1223e0){return _0x1223e0?{'count':_0x12b971,'rows':_0x1223e0}:null;}})[_0x6f75('0x20')](respondWithResult(_0x16cdd9,null))[_0x6f75('0x2b')](handleError(_0x16cdd9,null));};exports['addConfiguration']=function(_0x4482b8,_0x21269a,_0x531264){if(_0x4482b8[_0x6f75('0x56')]['id']){delete _0x4482b8[_0x6f75('0x56')]['id'];}return db[_0x6f75('0x3d')][_0x6f75('0x5c')]({'where':{'id':_0x4482b8[_0x6f75('0x57')]['id']}})['then'](handleEntityNotFound(_0x21269a,null))[_0x6f75('0x20')](function(_0x4429ce){if(_0x4429ce){_0x4482b8[_0x6f75('0x56')][_0x6f75('0x5d')]=_0x4429ce['id'];_0x4482b8[_0x6f75('0x56')][_0x6f75('0x5e')]=integrations['getSubjects'](_0x4482b8[_0x6f75('0x56')][_0x6f75('0x5f')],_0x4482b8[_0x6f75('0x56')][_0x6f75('0x3f')]);_0x4482b8[_0x6f75('0x56')][_0x6f75('0x60')]=integrations[_0x6f75('0x61')](_0x4482b8[_0x6f75('0x56')][_0x6f75('0x5f')],_0x4482b8['body']['type']);return db[_0x6f75('0x58')][_0x6f75('0x55')](_0x4482b8[_0x6f75('0x56')],{'include':[{'model':db['FreshsalesField'],'as':_0x6f75('0x5e')},{'model':db[_0x6f75('0x62')],'as':_0x6f75('0x60')}]});}return null;})[_0x6f75('0x20')](respondWithResult(_0x21269a,null))[_0x6f75('0x2b')](handleError(_0x21269a,null));};exports[_0x6f75('0x63')]=function(_0x4dcdf9,_0xb786dd,_0x4d095f){var _0x118197='';var _0xde7b47='';return db[_0x6f75('0x3d')][_0x6f75('0x5c')]({'where':{'id':_0x4dcdf9[_0x6f75('0x57')]['id']},'attributes':['id',_0x6f75('0x64'),'remoteUri',_0x6f75('0x65')]})[_0x6f75('0x20')](handleEntityNotFound(_0xb786dd,null))['then'](function(_0x27690e){if(_0x27690e){_0xde7b47=_0x27690e[_0x6f75('0x64')];_0x118197=_0x27690e[_0x6f75('0x66')];var _0x3b33f0=_0x27690e[_0x6f75('0x66')][_0x6f75('0x67')](-0x1);if(_0x3b33f0==='/'){_0x118197=_0x118197[_0x6f75('0x68')](0x0,_0x118197['lastIndexOf'](_0x3b33f0));}return rp({'method':_0x6f75('0x69'),'uri':util['format']('%s%s',_0x118197,_0x6f75('0x6a')),'headers':{'Authorization':_0x6f75('0x6b')+_0x27690e[_0x6f75('0x65')]},'json':!![]});}})[_0x6f75('0x20')](function(_0xa9b88d){if(_0xa9b88d){var _0x40912c=_0xa9b88d[_0x6f75('0x6c')];var _0xb711fe=![];var _0x4a33ba=null;for(_0x4a33ba=0x0;_0x4a33ba<_0x40912c[_0x6f75('0x47')];_0x4a33ba++){if(_0x40912c[_0x4a33ba][_0x6f75('0x6d')]===_0xde7b47){_0xb711fe=!![];}}if(_0xb711fe){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x6f75('0x6e')});}}})[_0x6f75('0x20')](respondWithResult(_0xb786dd,null))[_0x6f75('0x2b')](function(_0x3b0b31){var _0x49b35c=_0x4dcdf9[_0x6f75('0x42')][_0x6f75('0x1b')]?0x1f4:_0x3b0b31[_0x6f75('0x6f')]||0x1f4;logger[_0x6f75('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x6f75('0x63'),_0x49b35c,JSON[_0x6f75('0x25')](_0x3b0b31));delete _0x3b0b31[_0x6f75('0x39')];if(_0x49b35c===0x191){_0x49b35c=0x190;}_0xb786dd[_0x6f75('0x2d')](_0x49b35c)['send'](_0x4dcdf9['query'][_0x6f75('0x1b')]?{'message':_0x6f75('0x70'),'statusCode':_0x3b0b31[_0x6f75('0x6f')]}:_0x3b0b31);});}; \ No newline at end of file +var _0x0335=['type','VIRTUAL','merge','options','where','includeAll','findAll','rows','show','params','keys','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesConfiguration','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter'];(function(_0x34a6e9,_0x25cabe){var _0x11015c=function(_0x5c2ced){while(--_0x5c2ced){_0x34a6e9['push'](_0x34a6e9['shift']());}};_0x11015c(++_0x25cabe);}(_0x0335,0x183));var _0x5033=function(_0x2e617d,_0x17c590){_0x2e617d=_0x2e617d-0x0;var _0x34c295=_0x0335[_0x2e617d];return _0x34c295;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5033('0x0'));var rimraf=require(_0x5033('0x1'));var zipdir=require(_0x5033('0x2'));var jsonpatch=require(_0x5033('0x3'));var rp=require(_0x5033('0x4'));var moment=require(_0x5033('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5033('0x6'));var util=require(_0x5033('0x7'));var path=require(_0x5033('0x8'));var sox=require('sox');var csv=require(_0x5033('0x9'));var ejs=require(_0x5033('0xa'));var fs=require('fs');var _=require(_0x5033('0xb'));var squel=require(_0x5033('0xc'));var crypto=require(_0x5033('0xd'));var jsforce=require(_0x5033('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5033('0x9'));var querystring=require(_0x5033('0xf'));var Papa=require('papaparse');var Redis=require(_0x5033('0x10'));var authService=require(_0x5033('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5033('0x12'));var logger=require(_0x5033('0x13'))(_0x5033('0x14'));var utils=require(_0x5033('0x15'));var config=require('../../config/environment');var db=require(_0x5033('0x16'))['db'];var integrations=require(_0x5033('0x17'));var jayson=require(_0x5033('0x18'));var client=jayson['client'][_0x5033('0x19')]({'port':0x232a});function checkPasswordPattern(_0x50808d,_0x5b26ac,_0x318f3f){if(_0x318f3f){var _0x43dd14=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43dd14[_0x5033('0x1a')](_0x5b26ac)){return _0x50808d;}else{throw new db['Sequelize'][(_0x5033('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x50808d;}}function respondWithRpcPromise(_0x17f0be,_0x2f0b72,_0x4406fe,_0x106c74){return new BPromise(function(_0xf193c6,_0x5db946){var _0x815c57=_0x106c74||client;return _0x815c57['request'](_0x17f0be,_0x4406fe)[_0x5033('0x1c')](function(_0x2f26dc){logger[_0x5033('0x1d')](_0x5033('0x1e'),_0x2f0b72,_0x5033('0x1f'));logger[_0x5033('0x20')](_0x5033('0x21'),_0x2f0b72,_0x5033('0x1f'),JSON[_0x5033('0x22')](_0x2f26dc));if(_0x2f26dc['error']){if(_0x2f26dc[_0x5033('0x23')][_0x5033('0x24')]===0x1f4){logger[_0x5033('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x2f0b72,_0x2f26dc['error'][_0x5033('0x25')]);return _0x5db946(_0x2f26dc['error']['message']);}logger[_0x5033('0x23')](_0x5033('0x1e'),_0x2f0b72,_0x2f26dc['error']['message']);return _0xf193c6(_0x2f26dc[_0x5033('0x23')][_0x5033('0x25')]);}else{logger[_0x5033('0x1d')]('FreshsalesAccount,\x20%s,\x20%s',_0x2f0b72,_0x5033('0x1f'));_0xf193c6(_0x2f26dc[_0x5033('0x26')]['message']);}})[_0x5033('0x27')](function(_0x242e6e){logger[_0x5033('0x23')](_0x5033('0x1e'),_0x2f0b72,_0x242e6e);_0x5db946(_0x242e6e);});});}function respondWithStatusCode(_0x2d89bd,_0x9e3010){_0x9e3010=_0x9e3010||0xcc;return function(_0x49b7ec){if(_0x49b7ec){return _0x2d89bd[_0x5033('0x28')](_0x9e3010);}return _0x2d89bd[_0x5033('0x29')](_0x9e3010)[_0x5033('0x2a')]();};}function respondWithResult(_0x4c1f91,_0x423a49){_0x423a49=_0x423a49||0xc8;return function(_0x349e5f){if(_0x349e5f){return _0x4c1f91['status'](_0x423a49)[_0x5033('0x2b')](_0x349e5f);}};}function respondWithFilteredResult(_0x6ed2d8,_0x18e3e6){return function(_0x55a840){if(_0x55a840){var _0x31c9e6=_0x55a840[_0x5033('0x2c')],_0x8065d9=_0x18e3e6[_0x5033('0x2d')],_0x6f6ab6=_0x18e3e6['offset']+_0x18e3e6[_0x5033('0x2e')],_0x4ced42;if(_0x6f6ab6>=_0x31c9e6){_0x6f6ab6=_0x31c9e6;_0x4ced42=0xc8;}else{_0x4ced42=0xce;}_0x6ed2d8[_0x5033('0x29')](_0x4ced42);return _0x6ed2d8[_0x5033('0x2f')]('Content-Range',_0x8065d9+'-'+_0x6f6ab6+'/'+_0x31c9e6)[_0x5033('0x2b')](_0x55a840);}return null;};}function patchUpdates(_0x4f9746){return function(_0x21d461){try{jsonpatch[_0x5033('0x30')](_0x21d461,_0x4f9746,!![]);}catch(_0x3e1702){return BPromise[_0x5033('0x31')](_0x3e1702);}return _0x21d461[_0x5033('0x32')]();};}function saveUpdates(_0x3e70cd,_0x306d98){return function(_0x4ae10e){if(_0x4ae10e){return _0x4ae10e[_0x5033('0x33')](_0x3e70cd)['then'](function(_0x1600fd){return _0x1600fd;});}return null;};}function removeEntity(_0x1900af,_0x41e850){return function(_0x4e49ce){if(_0x4e49ce){return _0x4e49ce[_0x5033('0x34')]()[_0x5033('0x1c')](function(){_0x1900af[_0x5033('0x29')](0xcc)[_0x5033('0x2a')]();});}};}function handleEntityNotFound(_0x4c40e4,_0x514440){return function(_0x332329){if(!_0x332329){_0x4c40e4['sendStatus'](0x194);}return _0x332329;};}function handleError(_0x12d2e9,_0x18836a){_0x18836a=_0x18836a||0x1f4;return function(_0x3c2f5d){logger['error'](_0x3c2f5d[_0x5033('0x35')]);if(_0x3c2f5d[_0x5033('0x36')]){delete _0x3c2f5d['name'];}_0x12d2e9[_0x5033('0x29')](_0x18836a)[_0x5033('0x37')](_0x3c2f5d);};}exports['index']=function(_0x1afc28,_0x5b5f31){var _0x4a2192={},_0x11f3e6={},_0x2cd030={'count':0x0,'rows':[]};var _0x29b2db=_[_0x5033('0x38')](db[_0x5033('0x39')][_0x5033('0x3a')],function(_0x3d52c9){return{'name':_0x3d52c9[_0x5033('0x3b')],'type':_0x3d52c9['type'][_0x5033('0x3c')]};});_0x11f3e6[_0x5033('0x3d')]=_[_0x5033('0x38')](_0x29b2db,_0x5033('0x36'));_0x11f3e6[_0x5033('0x3e')]=_['keys'](_0x1afc28[_0x5033('0x3e')]);_0x11f3e6[_0x5033('0x3f')]=_[_0x5033('0x40')](_0x11f3e6[_0x5033('0x3d')],_0x11f3e6[_0x5033('0x3e')]);_0x4a2192[_0x5033('0x41')]=_[_0x5033('0x40')](_0x11f3e6[_0x5033('0x3d')],qs[_0x5033('0x42')](_0x1afc28[_0x5033('0x3e')][_0x5033('0x42')]));_0x4a2192[_0x5033('0x41')]=_0x4a2192[_0x5033('0x41')][_0x5033('0x43')]?_0x4a2192[_0x5033('0x41')]:_0x11f3e6[_0x5033('0x3d')];if(!_0x1afc28[_0x5033('0x3e')][_0x5033('0x44')]('nolimit')){_0x4a2192[_0x5033('0x2e')]=qs[_0x5033('0x2e')](_0x1afc28[_0x5033('0x3e')][_0x5033('0x2e')]);_0x4a2192['offset']=qs[_0x5033('0x2d')](_0x1afc28['query'][_0x5033('0x2d')]);}_0x4a2192[_0x5033('0x45')]=qs[_0x5033('0x46')](_0x1afc28[_0x5033('0x3e')]['sort']);_0x4a2192['where']=qs[_0x5033('0x3f')](_[_0x5033('0x47')](_0x1afc28[_0x5033('0x3e')],_0x11f3e6['filters']),_0x29b2db);if(_0x1afc28[_0x5033('0x3e')][_0x5033('0x48')]){_0x4a2192['where']=_['merge'](_0x4a2192['where'],{'$or':_[_0x5033('0x38')](_0x29b2db,function(_0x15380d){if(_0x15380d[_0x5033('0x49')]!==_0x5033('0x4a')){var _0xafae16={};_0xafae16[_0x15380d[_0x5033('0x36')]]={'$like':'%'+_0x1afc28['query'][_0x5033('0x48')]+'%'};return _0xafae16;}})});}_0x4a2192=_[_0x5033('0x4b')]({},_0x4a2192,_0x1afc28[_0x5033('0x4c')]);var _0x4cd760={'where':_0x4a2192[_0x5033('0x4d')]};return db[_0x5033('0x39')]['count'](_0x4cd760)['then'](function(_0xb142dc){_0x2cd030[_0x5033('0x2c')]=_0xb142dc;if(_0x1afc28[_0x5033('0x3e')][_0x5033('0x4e')]){_0x4a2192['include']=[{'all':!![]}];}return db[_0x5033('0x39')][_0x5033('0x4f')](_0x4a2192);})['then'](function(_0x4573ed){_0x2cd030[_0x5033('0x50')]=_0x4573ed;return _0x2cd030;})[_0x5033('0x1c')](respondWithFilteredResult(_0x5b5f31,_0x4a2192))[_0x5033('0x27')](handleError(_0x5b5f31,null));};exports[_0x5033('0x51')]=function(_0x381c73,_0x645796){var _0xa90d00={'raw':![],'where':{'id':_0x381c73[_0x5033('0x52')]['id']}},_0x309baf={};_0x309baf[_0x5033('0x3d')]=_['keys'](db['FreshsalesAccount'][_0x5033('0x3a')]);_0x309baf[_0x5033('0x3e')]=_[_0x5033('0x53')](_0x381c73['query']);_0x309baf[_0x5033('0x3f')]=_['intersection'](_0x309baf['model'],_0x309baf['query']);_0xa90d00['attributes']=_['intersection'](_0x309baf[_0x5033('0x3d')],qs['fields'](_0x381c73[_0x5033('0x3e')][_0x5033('0x42')]));_0xa90d00[_0x5033('0x41')]=_0xa90d00[_0x5033('0x41')][_0x5033('0x43')]?_0xa90d00['attributes']:_0x309baf['model'];if(_0x381c73[_0x5033('0x3e')]['includeAll']){_0xa90d00[_0x5033('0x54')]=[{'all':!![]}];}_0xa90d00=_['merge']({},_0xa90d00,_0x381c73['options']);return db['FreshsalesAccount'][_0x5033('0x55')](_0xa90d00)[_0x5033('0x1c')](handleEntityNotFound(_0x645796,null))['then'](respondWithResult(_0x645796,null))[_0x5033('0x27')](handleError(_0x645796,null));};exports['create']=function(_0x54f7b3,_0x17d625){return db[_0x5033('0x39')][_0x5033('0x56')](_0x54f7b3[_0x5033('0x57')],{})[_0x5033('0x1c')](respondWithResult(_0x17d625,0xc9))[_0x5033('0x27')](handleError(_0x17d625,null));};exports['update']=function(_0x29a446,_0x34ad5b){if(_0x29a446[_0x5033('0x57')]['id']){delete _0x29a446[_0x5033('0x57')]['id'];}return db['FreshsalesAccount'][_0x5033('0x55')]({'where':{'id':_0x29a446['params']['id']}})[_0x5033('0x1c')](handleEntityNotFound(_0x34ad5b,null))[_0x5033('0x1c')](saveUpdates(_0x29a446[_0x5033('0x57')],null))[_0x5033('0x1c')](respondWithResult(_0x34ad5b,null))[_0x5033('0x27')](handleError(_0x34ad5b,null));};exports[_0x5033('0x34')]=function(_0x4897eb,_0x3498ed){return db[_0x5033('0x39')]['find']({'where':{'id':_0x4897eb[_0x5033('0x52')]['id']}})[_0x5033('0x1c')](handleEntityNotFound(_0x3498ed,null))['then'](removeEntity(_0x3498ed,null))['catch'](handleError(_0x3498ed,null));};exports[_0x5033('0x58')]=function(_0xef6d11,_0x1cdde3,_0x290150){var _0x119d64={};var _0xb2fff2={};var _0x890165;var _0x2ff4d7;return db[_0x5033('0x39')][_0x5033('0x59')]({'where':{'id':_0xef6d11['params']['id']}})[_0x5033('0x1c')](handleEntityNotFound(_0x1cdde3,null))['then'](function(_0x258f96){if(_0x258f96){_0x890165=_0x258f96;_0xb2fff2[_0x5033('0x3d')]=_[_0x5033('0x53')](db['FreshsalesConfiguration'][_0x5033('0x3a')]);_0xb2fff2[_0x5033('0x3e')]=_['keys'](_0xef6d11[_0x5033('0x3e')]);_0xb2fff2[_0x5033('0x3f')]=_[_0x5033('0x40')](_0xb2fff2[_0x5033('0x3d')],_0xb2fff2['query']);_0x119d64[_0x5033('0x41')]=_[_0x5033('0x40')](_0xb2fff2[_0x5033('0x3d')],qs[_0x5033('0x42')](_0xef6d11[_0x5033('0x3e')][_0x5033('0x42')]));_0x119d64[_0x5033('0x41')]=_0x119d64[_0x5033('0x41')][_0x5033('0x43')]?_0x119d64[_0x5033('0x41')]:_0xb2fff2[_0x5033('0x3d')];_0x119d64[_0x5033('0x45')]=qs[_0x5033('0x46')](_0xef6d11[_0x5033('0x3e')][_0x5033('0x46')]);_0x119d64[_0x5033('0x4d')]=qs[_0x5033('0x3f')](_[_0x5033('0x47')](_0xef6d11[_0x5033('0x3e')],_0xb2fff2[_0x5033('0x3f')]));if(_0xef6d11[_0x5033('0x3e')][_0x5033('0x48')]){_0x119d64[_0x5033('0x4d')]=_['merge'](_0x119d64[_0x5033('0x4d')],{'$or':_[_0x5033('0x38')](_0x119d64[_0x5033('0x41')],function(_0x13ae2f){var _0x24a399={};_0x24a399[_0x13ae2f]={'$like':'%'+_0xef6d11[_0x5033('0x3e')]['filter']+'%'};return _0x24a399;})});}_0x119d64=_[_0x5033('0x4b')]({},_0x119d64,_0xef6d11['options']);return _0x890165[_0x5033('0x58')](_0x119d64);}})[_0x5033('0x1c')](function(_0xb1bbcd){if(_0xb1bbcd){_0x2ff4d7=_0xb1bbcd[_0x5033('0x43')];if(!_0xef6d11[_0x5033('0x3e')][_0x5033('0x44')]('nolimit')){_0x119d64['limit']=qs[_0x5033('0x2e')](_0xef6d11[_0x5033('0x3e')][_0x5033('0x2e')]);_0x119d64['offset']=qs[_0x5033('0x2d')](_0xef6d11[_0x5033('0x3e')][_0x5033('0x2d')]);}return _0x890165['getConfigurations'](_0x119d64);}})[_0x5033('0x1c')](function(_0x1f9a00){if(_0x1f9a00){return _0x1f9a00?{'count':_0x2ff4d7,'rows':_0x1f9a00}:null;}})['then'](respondWithResult(_0x1cdde3,null))['catch'](handleError(_0x1cdde3,null));};exports[_0x5033('0x5a')]=function(_0x1c25a9,_0x28204a,_0x435558){if(_0x1c25a9[_0x5033('0x57')]['id']){delete _0x1c25a9[_0x5033('0x57')]['id'];}return db[_0x5033('0x39')][_0x5033('0x59')]({'where':{'id':_0x1c25a9[_0x5033('0x52')]['id']}})[_0x5033('0x1c')](handleEntityNotFound(_0x28204a,null))[_0x5033('0x1c')](function(_0x2d6029){if(_0x2d6029){_0x1c25a9[_0x5033('0x57')][_0x5033('0x5b')]=_0x2d6029['id'];_0x1c25a9['body'][_0x5033('0x5c')]=integrations['getSubjects'](_0x1c25a9['body']['channel'],_0x1c25a9[_0x5033('0x57')][_0x5033('0x49')]);_0x1c25a9[_0x5033('0x57')][_0x5033('0x5d')]=integrations[_0x5033('0x5e')](_0x1c25a9[_0x5033('0x57')][_0x5033('0x5f')],_0x1c25a9['body'][_0x5033('0x49')]);return db[_0x5033('0x60')]['create'](_0x1c25a9[_0x5033('0x57')],{'include':[{'model':db[_0x5033('0x61')],'as':_0x5033('0x5c')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0x5033('0x1c')](respondWithResult(_0x28204a,null))[_0x5033('0x27')](handleError(_0x28204a,null));};exports[_0x5033('0x62')]=function(_0x32aaf0,_0x4cba62,_0x385475){var _0x1a464f='';var _0x6867fb='';return db['FreshsalesAccount'][_0x5033('0x59')]({'where':{'id':_0x32aaf0[_0x5033('0x52')]['id']},'attributes':['id',_0x5033('0x63'),'remoteUri','apiKey']})[_0x5033('0x1c')](handleEntityNotFound(_0x4cba62,null))['then'](function(_0x53f5b9){if(_0x53f5b9){_0x6867fb=_0x53f5b9[_0x5033('0x63')];_0x1a464f=_0x53f5b9['remoteUri'];var _0x55c6ca=_0x53f5b9[_0x5033('0x64')][_0x5033('0x65')](-0x1);if(_0x55c6ca==='/'){_0x1a464f=_0x1a464f[_0x5033('0x66')](0x0,_0x1a464f[_0x5033('0x67')](_0x55c6ca));}return rp({'method':_0x5033('0x68'),'uri':util[_0x5033('0x69')](_0x5033('0x6a'),_0x1a464f,_0x5033('0x6b')),'headers':{'Authorization':_0x5033('0x6c')+_0x53f5b9['apiKey']},'json':!![]});}})[_0x5033('0x1c')](function(_0x44020d){if(_0x44020d){var _0x54fa37=_0x44020d[_0x5033('0x6d')];var _0x1e53b2=![];var _0x405db7=null;for(_0x405db7=0x0;_0x405db7<_0x54fa37[_0x5033('0x43')];_0x405db7++){if(_0x54fa37[_0x405db7][_0x5033('0x6e')]===_0x6867fb){_0x1e53b2=!![];}}if(_0x1e53b2){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5033('0x6f')});}}})[_0x5033('0x1c')](respondWithResult(_0x4cba62,null))[_0x5033('0x27')](function(_0x5b1901){var _0xec2566=_0x32aaf0[_0x5033('0x3e')]['test']?0x1f4:_0x5b1901[_0x5033('0x70')]||0x1f4;logger[_0x5033('0x23')](_0x5033('0x71'),_0x5033('0x62'),_0xec2566,JSON[_0x5033('0x22')](_0x5b1901));delete _0x5b1901[_0x5033('0x36')];if(_0xec2566===0x191){_0xec2566=0x190;}_0x4cba62[_0x5033('0x29')](_0xec2566)[_0x5033('0x37')](_0x32aaf0['query'][_0x5033('0x1a')]?{'message':_0x5033('0x72'),'statusCode':_0x5b1901[_0x5033('0x70')]}:_0x5b1901);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index f2c8d07..7cb0e3c 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 _0x29d4=['int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4a16c8,_0x443415){var _0x34e512=function(_0x2f06f8){while(--_0x2f06f8){_0x4a16c8['push'](_0x4a16c8['shift']());}};_0x34e512(++_0x443415);}(_0x29d4,0x1a1));var _0x429d=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x29d4[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var logger=require(_0x429d('0x1'))(_0x429d('0x2'));var moment=require(_0x429d('0x3'));var BPromise=require(_0x429d('0x4'));var rp=require(_0x429d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var attributes=require(_0x429d('0x8'));var integrations=require(_0x429d('0x9'));module[_0x429d('0xa')]=function(_0xa71445,_0x56aa2f){return _0xa71445[_0x429d('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x429d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe107=['define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration'];(function(_0x1034ca,_0x14ecd6){var _0x1a023a=function(_0x2cfa65){while(--_0x2cfa65){_0x1034ca['push'](_0x1034ca['shift']());}};_0x1a023a(++_0x14ecd6);}(_0xe107,0xb3));var _0x7e10=function(_0x1e2891,_0x3175d3){_0x1e2891=_0x1e2891-0x0;var _0x242719=_0xe107[_0x1e2891];return _0x242719;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var logger=require(_0x7e10('0x1'))(_0x7e10('0x2'));var moment=require(_0x7e10('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e10('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7e10('0x5'));var attributes=require(_0x7e10('0x6'));var integrations=require(_0x7e10('0x7'));module['exports']=function(_0x5f1edf,_0x1dd3de){return _0x5f1edf[_0x7e10('0x8')](_0x7e10('0x9'),attributes,{'tableName':_0x7e10('0xa'),'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 cb813bf..ae12311 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 _0x3c32=['message','catch','GetFreshsalesAccount','findAll','options','limit','include','model','map','attributes','ShowFreshsalesAccount','raw','where','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2dd708,_0x24624e){var _0x13a7fb=function(_0x354526){while(--_0x354526){_0x2dd708['push'](_0x2dd708['shift']());}};_0x13a7fb(++_0x24624e);}(_0x3c32,0x161));var _0x23c3=function(_0x4bbd8a,_0x294530){_0x4bbd8a=_0x4bbd8a-0x0;var _0x1b02f1=_0x3c32[_0x4bbd8a];return _0x1b02f1;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var moment=require(_0x23c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))('rpc');var config=require(_0x23c3('0x7'));var jayson=require(_0x23c3('0x8'));var client=jayson[_0x23c3('0x9')][_0x23c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6364,_0x56568e,_0x493ca6){return new BPromise(function(_0x4df5ee,_0x422558){return client[_0x23c3('0xb')](_0x4a6364,_0x493ca6)[_0x23c3('0xc')](function(_0x420987){logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));logger[_0x23c3('0x10')](_0x23c3('0x11'),_0x56568e,_0x23c3('0xf'),JSON[_0x23c3('0x12')](_0x420987));if(_0x420987[_0x23c3('0x13')]){if(_0x420987[_0x23c3('0x13')][_0x23c3('0x14')]===0x1f4){logger[_0x23c3('0x13')](_0x23c3('0xe'),_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x422558(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x4df5ee(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}else{logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));_0x4df5ee(_0x420987['result']['message']);}})[_0x23c3('0x16')](function(_0x43534b){logger['error'](_0x23c3('0xe'),_0x56568e,_0x43534b);_0x422558(_0x43534b);});});}exports[_0x23c3('0x17')]=function(_0x20a8b7){var _0x1456a3=this;return new Promise(function(_0x25880d,_0x18990f){return db['FreshsalesAccount'][_0x23c3('0x18')]({'raw':_0x20a8b7[_0x23c3('0x19')]?_0x20a8b7[_0x23c3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x20a8b7[_0x23c3('0x19')]?_0x20a8b7['options']['where']||null:null,'attributes':_0x20a8b7[_0x23c3('0x19')]?_0x20a8b7['options']['attributes']||null:null,'limit':_0x20a8b7[_0x23c3('0x19')]?_0x20a8b7[_0x23c3('0x19')][_0x23c3('0x1a')]||null:null,'include':_0x20a8b7[_0x23c3('0x19')]?_0x20a8b7['options'][_0x23c3('0x1b')]?_['map'](_0x20a8b7[_0x23c3('0x19')][_0x23c3('0x1b')],function(_0x30fe87){return{'model':db[_0x30fe87[_0x23c3('0x1c')]],'as':_0x30fe87['as'],'attributes':_0x30fe87['attributes'],'include':_0x30fe87[_0x23c3('0x1b')]?_[_0x23c3('0x1d')](_0x30fe87['include'],function(_0x24fabd){return{'model':db[_0x24fabd[_0x23c3('0x1c')]],'as':_0x24fabd['as'],'attributes':_0x24fabd[_0x23c3('0x1e')],'include':_0x24fabd[_0x23c3('0x1b')]?_[_0x23c3('0x1d')](_0x24fabd['include'],function(_0x30ad00){return{'model':db[_0x30ad00[_0x23c3('0x1c')]],'as':_0x30ad00['as'],'attributes':_0x30ad00[_0x23c3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x23c3('0xc')](function(_0xa520fc){logger[_0x23c3('0xd')](_0x23c3('0x17'),_0x20a8b7);logger[_0x23c3('0x10')](_0x23c3('0x17'),_0x20a8b7,JSON[_0x23c3('0x12')](_0xa520fc));_0x25880d(_0xa520fc);})[_0x23c3('0x16')](function(_0xbb7faa){logger[_0x23c3('0x13')](_0x23c3('0x17'),_0xbb7faa[_0x23c3('0x15')],_0x20a8b7);_0x18990f(_0x1456a3[_0x23c3('0x13')](0x1f4,_0xbb7faa[_0x23c3('0x15')]));});});};exports[_0x23c3('0x1f')]=function(_0x12b8be){var _0xd732d7=this;return new Promise(function(_0x1bc3ce,_0x47abc5){return db['FreshsalesAccount']['find']({'raw':_0x12b8be[_0x23c3('0x19')]?_0x12b8be['options'][_0x23c3('0x20')]===undefined?!![]:![]:!![],'where':_0x12b8be['options']?_0x12b8be[_0x23c3('0x19')][_0x23c3('0x21')]||null:null,'attributes':_0x12b8be[_0x23c3('0x19')]?_0x12b8be[_0x23c3('0x19')][_0x23c3('0x1e')]||null:null,'include':_0x12b8be[_0x23c3('0x19')]?_0x12b8be[_0x23c3('0x19')]['include']?_[_0x23c3('0x1d')](_0x12b8be['options'][_0x23c3('0x1b')],function(_0x157734){return{'model':db[_0x157734['model']],'as':_0x157734['as'],'attributes':_0x157734['attributes'],'include':_0x157734['include']?_[_0x23c3('0x1d')](_0x157734[_0x23c3('0x1b')],function(_0x152249){return{'model':db[_0x152249['model']],'as':_0x152249['as'],'attributes':_0x152249[_0x23c3('0x1e')],'include':_0x152249[_0x23c3('0x1b')]?_[_0x23c3('0x1d')](_0x152249[_0x23c3('0x1b')],function(_0x323fc7){return{'model':db[_0x323fc7['model']],'as':_0x323fc7['as'],'attributes':_0x323fc7[_0x23c3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x23c3('0xc')](function(_0x7a925e){logger['info']('ShowFreshsalesAccount',_0x12b8be);logger[_0x23c3('0x10')](_0x23c3('0x1f'),_0x12b8be,JSON[_0x23c3('0x12')](_0x7a925e));_0x1bc3ce(_0x7a925e);})[_0x23c3('0x16')](function(_0x508374){logger[_0x23c3('0x13')](_0x23c3('0x1f'),_0x508374[_0x23c3('0x15')],_0x12b8be);_0x47abc5(_0xd732d7[_0x23c3('0x13')](0x1f4,_0x508374[_0x23c3('0x15')]));});});}; \ No newline at end of file +var _0xdfdd=['catch','FreshsalesAccount','findAll','options','raw','where','limit','map','include','model','attributes','GetFreshsalesAccount','debug','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result'];(function(_0x59db34,_0x593726){var _0x568a53=function(_0x2bf3b4){while(--_0x2bf3b4){_0x59db34['push'](_0x59db34['shift']());}};_0x568a53(++_0x593726);}(_0xdfdd,0x104));var _0xddfd=function(_0x4dcb38,_0x4cdd7f){_0x4dcb38=_0x4dcb38-0x0;var _0x40dafa=_0xdfdd[_0x4dcb38];return _0x40dafa;};'use strict';var _=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var moment=require(_0xddfd('0x2'));var BPromise=require(_0xddfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddfd('0x5'));var logger=require('../../config/logger')(_0xddfd('0x6'));var config=require(_0xddfd('0x7'));var jayson=require(_0xddfd('0x8'));var client=jayson[_0xddfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fcbc,_0x485ede,_0x2e8f21){return new BPromise(function(_0x45bdd0,_0xf134d7){return client[_0xddfd('0xa')](_0x25fcbc,_0x2e8f21)[_0xddfd('0xb')](function(_0x2a3b1e){logger['info'](_0xddfd('0xc'),_0x485ede,_0xddfd('0xd'));logger['debug'](_0xddfd('0xe'),_0x485ede,_0xddfd('0xd'),JSON[_0xddfd('0xf')](_0x2a3b1e));if(_0x2a3b1e[_0xddfd('0x10')]){if(_0x2a3b1e[_0xddfd('0x10')]['code']===0x1f4){logger[_0xddfd('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')]['message']);return _0xf134d7(_0x2a3b1e[_0xddfd('0x10')]['message']);}logger[_0xddfd('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);return _0x45bdd0(_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);}else{logger[_0xddfd('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x485ede,_0xddfd('0xd'));_0x45bdd0(_0x2a3b1e[_0xddfd('0x13')][_0xddfd('0x11')]);}})[_0xddfd('0x14')](function(_0xa85d01){logger[_0xddfd('0x10')](_0xddfd('0xc'),_0x485ede,_0xa85d01);_0xf134d7(_0xa85d01);});});}exports['GetFreshsalesAccount']=function(_0x578f43){var _0x33c48e=this;return new Promise(function(_0x260dba,_0x2bc921){return db[_0xddfd('0x15')][_0xddfd('0x16')]({'raw':_0x578f43['options']?_0x578f43[_0xddfd('0x17')][_0xddfd('0x18')]===undefined?!![]:![]:!![],'where':_0x578f43[_0xddfd('0x17')]?_0x578f43[_0xddfd('0x17')][_0xddfd('0x19')]||null:null,'attributes':_0x578f43[_0xddfd('0x17')]?_0x578f43['options']['attributes']||null:null,'limit':_0x578f43['options']?_0x578f43[_0xddfd('0x17')][_0xddfd('0x1a')]||null:null,'include':_0x578f43[_0xddfd('0x17')]?_0x578f43[_0xddfd('0x17')]['include']?_[_0xddfd('0x1b')](_0x578f43[_0xddfd('0x17')][_0xddfd('0x1c')],function(_0x68caf6){return{'model':db[_0x68caf6[_0xddfd('0x1d')]],'as':_0x68caf6['as'],'attributes':_0x68caf6['attributes'],'include':_0x68caf6[_0xddfd('0x1c')]?_[_0xddfd('0x1b')](_0x68caf6[_0xddfd('0x1c')],function(_0x1dd7f3){return{'model':db[_0x1dd7f3['model']],'as':_0x1dd7f3['as'],'attributes':_0x1dd7f3['attributes'],'include':_0x1dd7f3['include']?_[_0xddfd('0x1b')](_0x1dd7f3['include'],function(_0xeb19b1){return{'model':db[_0xeb19b1[_0xddfd('0x1d')]],'as':_0xeb19b1['as'],'attributes':_0xeb19b1[_0xddfd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xddfd('0xb')](function(_0x3fb12c){logger['info'](_0xddfd('0x1f'),_0x578f43);logger[_0xddfd('0x20')](_0xddfd('0x1f'),_0x578f43,JSON[_0xddfd('0xf')](_0x3fb12c));_0x260dba(_0x3fb12c);})[_0xddfd('0x14')](function(_0x2baf5d){logger[_0xddfd('0x10')](_0xddfd('0x1f'),_0x2baf5d[_0xddfd('0x11')],_0x578f43);_0x2bc921(_0x33c48e['error'](0x1f4,_0x2baf5d[_0xddfd('0x11')]));});});};exports[_0xddfd('0x21')]=function(_0x4dcf94){var _0x3375d1=this;return new Promise(function(_0xf5d766,_0x279dd3){return db['FreshsalesAccount'][_0xddfd('0x22')]({'raw':_0x4dcf94['options']?_0x4dcf94[_0xddfd('0x17')][_0xddfd('0x18')]===undefined?!![]:![]:!![],'where':_0x4dcf94[_0xddfd('0x17')]?_0x4dcf94[_0xddfd('0x17')][_0xddfd('0x19')]||null:null,'attributes':_0x4dcf94['options']?_0x4dcf94[_0xddfd('0x17')]['attributes']||null:null,'include':_0x4dcf94['options']?_0x4dcf94[_0xddfd('0x17')]['include']?_[_0xddfd('0x1b')](_0x4dcf94[_0xddfd('0x17')][_0xddfd('0x1c')],function(_0x194d31){return{'model':db[_0x194d31[_0xddfd('0x1d')]],'as':_0x194d31['as'],'attributes':_0x194d31[_0xddfd('0x1e')],'include':_0x194d31[_0xddfd('0x1c')]?_['map'](_0x194d31[_0xddfd('0x1c')],function(_0x44a21b){return{'model':db[_0x44a21b[_0xddfd('0x1d')]],'as':_0x44a21b['as'],'attributes':_0x44a21b[_0xddfd('0x1e')],'include':_0x44a21b[_0xddfd('0x1c')]?_['map'](_0x44a21b['include'],function(_0x47bcf0){return{'model':db[_0x47bcf0[_0xddfd('0x1d')]],'as':_0x47bcf0['as'],'attributes':_0x47bcf0['attributes']};}):[]};}):[]};}):[]:[]})[_0xddfd('0xb')](function(_0x3700b8){logger['info'](_0xddfd('0x21'),_0x4dcf94);logger[_0xddfd('0x20')](_0xddfd('0x21'),_0x4dcf94,JSON[_0xddfd('0xf')](_0x3700b8));_0xf5d766(_0x3700b8);})[_0xddfd('0x14')](function(_0x47321a){logger[_0xddfd('0x10')]('ShowFreshsalesAccount',_0x47321a[_0xddfd('0x11')],_0x4dcf94);_0x279dd3(_0x3375d1[_0xddfd('0x10')](0x1f4,_0x47321a[_0xddfd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 6605667..6ed914c 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 _0x111b=['getFields','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions'];(function(_0x294b6,_0x2907ae){var _0x38bb97=function(_0x5aaa76){while(--_0x5aaa76){_0x294b6['push'](_0x294b6['shift']());}};_0x38bb97(++_0x2907ae);}(_0x111b,0x15f));var _0xb111=function(_0x4e6ba8,_0x4ca053){_0x4e6ba8=_0x4e6ba8-0x0;var _0x2d7f19=_0x111b[_0x4e6ba8];return _0x2d7f19;};'use strict';var multer=require('multer');var util=require(_0xb111('0x0'));var path=require(_0xb111('0x1'));var timeout=require(_0xb111('0x2'));var express=require(_0xb111('0x3'));var router=express[_0xb111('0x4')]();var auth=require(_0xb111('0x5'));var interaction=require(_0xb111('0x6'));var config=require(_0xb111('0x7'));var controller=require(_0xb111('0x8'));router[_0xb111('0x9')]('/',auth[_0xb111('0xa')](),controller[_0xb111('0xb')]);router[_0xb111('0x9')](_0xb111('0xc'),auth[_0xb111('0xa')](),controller[_0xb111('0xd')]);router[_0xb111('0x9')](_0xb111('0xe'),auth['isAuthenticated'](),controller[_0xb111('0xf')]);router[_0xb111('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xb111('0x10')]);router[_0xb111('0x9')]('/:id/fields',auth[_0xb111('0xa')](),controller[_0xb111('0x11')]);router['post']('/',auth[_0xb111('0xa')](),controller[_0xb111('0x12')]);router['put'](_0xb111('0xc'),auth['isAuthenticated'](),controller[_0xb111('0x13')]);router[_0xb111('0x14')]('/:id',auth[_0xb111('0xa')](),controller[_0xb111('0x15')]);module[_0xb111('0x16')]=router; \ No newline at end of file +var _0x8ad0=['/:id/descriptions','getDescriptions','getFields','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects'];(function(_0x2df2d0,_0x1d6ea8){var _0x3c4438=function(_0x456da2){while(--_0x456da2){_0x2df2d0['push'](_0x2df2d0['shift']());}};_0x3c4438(++_0x1d6ea8);}(_0x8ad0,0xb4));var _0x08ad=function(_0x35aaac,_0x29d994){_0x35aaac=_0x35aaac-0x0;var _0x4e8d17=_0x8ad0[_0x35aaac];return _0x4e8d17;};'use strict';var multer=require(_0x08ad('0x0'));var util=require(_0x08ad('0x1'));var path=require(_0x08ad('0x2'));var timeout=require(_0x08ad('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x08ad('0x4'));router[_0x08ad('0x5')]('/',auth[_0x08ad('0x6')](),controller[_0x08ad('0x7')]);router[_0x08ad('0x5')]('/:id',auth[_0x08ad('0x6')](),controller[_0x08ad('0x8')]);router[_0x08ad('0x5')](_0x08ad('0x9'),auth[_0x08ad('0x6')](),controller['getSubjects']);router[_0x08ad('0x5')](_0x08ad('0xa'),auth['isAuthenticated'](),controller[_0x08ad('0xb')]);router['get']('/:id/fields',auth[_0x08ad('0x6')](),controller[_0x08ad('0xc')]);router[_0x08ad('0xd')]('/',auth[_0x08ad('0x6')](),controller[_0x08ad('0xe')]);router[_0x08ad('0xf')](_0x08ad('0x10'),auth[_0x08ad('0x6')](),controller['update']);router[_0x08ad('0x11')](_0x08ad('0x10'),auth[_0x08ad('0x6')](),controller[_0x08ad('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 1462ea2..fe83589 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 _0xa108=['sequelize','exports','STRING'];(function(_0xcde320,_0x397361){var _0x18717f=function(_0x5c93ae){while(--_0x5c93ae){_0xcde320['push'](_0xcde320['shift']());}};_0x18717f(++_0x397361);}(_0xa108,0x1da));var _0x8a10=function(_0x14da4b,_0x54790c){_0x14da4b=_0x14da4b-0x0;var _0x4661e6=_0xa108[_0x14da4b];return _0x4661e6;};'use strict';var Sequelize=require(_0x8a10('0x0'));module[_0x8a10('0x1')]={'name':{'type':Sequelize[_0x8a10('0x2')]},'description':{'type':Sequelize[_0x8a10('0x2')]}}; \ No newline at end of file +var _0x7fad=['sequelize','exports','STRING'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x7fad,0x1d7));var _0xd7fa=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x7fad[_0x2ab3d9];return _0x210a54;};'use strict';var Sequelize=require(_0xd7fa('0x0'));module[_0xd7fa('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd7fa('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 9119863..da450a4 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 _0x0ae9=['FreshsalesField','sort','pick','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','filter','options','includeAll','include','FreshsalesConfiguration','findAll','rows','catch','show','params','find','create','body','getSubjects','findOne'];(function(_0x31c78e,_0x36dac3){var _0x116a8e=function(_0x370efe){while(--_0x370efe){_0x31c78e['push'](_0x31c78e['shift']());}};_0x116a8e(++_0x36dac3);}(_0x0ae9,0x128));var _0x90ae=function(_0x334799,_0x5ec338){_0x334799=_0x334799-0x0;var _0xf8b184=_0x0ae9[_0x334799];return _0xf8b184;};'use strict';var pdf=require(_0x90ae('0x0'));var emlformat=require(_0x90ae('0x1'));var rimraf=require(_0x90ae('0x2'));var zipdir=require(_0x90ae('0x3'));var jsonpatch=require(_0x90ae('0x4'));var rp=require(_0x90ae('0x5'));var moment=require('moment');var BPromise=require(_0x90ae('0x6'));var Mustache=require(_0x90ae('0x7'));var util=require(_0x90ae('0x8'));var path=require(_0x90ae('0x9'));var sox=require(_0x90ae('0xa'));var csv=require(_0x90ae('0xb'));var ejs=require(_0x90ae('0xc'));var fs=require('fs');var _=require(_0x90ae('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x90ae('0xe'));var deskjs=require(_0x90ae('0xf'));var toCsv=require(_0x90ae('0xb'));var querystring=require(_0x90ae('0x10'));var Papa=require(_0x90ae('0x11'));var Redis=require(_0x90ae('0x12'));var authService=require(_0x90ae('0x13'));var qs=require(_0x90ae('0x14'));var as=require(_0x90ae('0x15'));var hardwareService=require(_0x90ae('0x16'));var logger=require(_0x90ae('0x17'))(_0x90ae('0x18'));var utils=require('../../config/utils');var config=require(_0x90ae('0x19'));var db=require(_0x90ae('0x1a'))['db'];var jayson=require(_0x90ae('0x1b'));var client=jayson[_0x90ae('0x1c')][_0x90ae('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1428a5,_0x189882,_0x1673d8){if(_0x1673d8){var _0x3abc6b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3abc6b[_0x90ae('0x1e')](_0x189882)){return _0x1428a5;}else{throw new db[(_0x90ae('0x1f'))][(_0x90ae('0x20'))](_0x90ae('0x21'));}}else{return _0x1428a5;}}function respondWithRpcPromise(_0x2a8e2f,_0x30d746,_0x4785c3,_0x719815){return new BPromise(function(_0x5660ff,_0x3f89eb){var _0x5bcc8a=_0x719815||client;return _0x5bcc8a['request'](_0x2a8e2f,_0x4785c3)[_0x90ae('0x22')](function(_0x5014e6){logger['info'](_0x90ae('0x23'),_0x30d746,'request\x20sent');logger[_0x90ae('0x24')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x30d746,_0x90ae('0x25'),JSON[_0x90ae('0x26')](_0x5014e6));if(_0x5014e6[_0x90ae('0x27')]){if(_0x5014e6[_0x90ae('0x27')][_0x90ae('0x28')]===0x1f4){logger[_0x90ae('0x27')](_0x90ae('0x23'),_0x30d746,_0x5014e6[_0x90ae('0x27')][_0x90ae('0x29')]);return _0x3f89eb(_0x5014e6[_0x90ae('0x27')][_0x90ae('0x29')]);}logger[_0x90ae('0x27')](_0x90ae('0x23'),_0x30d746,_0x5014e6[_0x90ae('0x27')][_0x90ae('0x29')]);return _0x5660ff(_0x5014e6[_0x90ae('0x27')]['message']);}else{logger[_0x90ae('0x2a')](_0x90ae('0x23'),_0x30d746,_0x90ae('0x25'));_0x5660ff(_0x5014e6[_0x90ae('0x2b')]['message']);}})['catch'](function(_0x5d5bde){logger[_0x90ae('0x27')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x30d746,_0x5d5bde);_0x3f89eb(_0x5d5bde);});});}function respondWithStatusCode(_0x3a34d8,_0x97d338){_0x97d338=_0x97d338||0xcc;return function(_0x1af484){if(_0x1af484){return _0x3a34d8['sendStatus'](_0x97d338);}return _0x3a34d8[_0x90ae('0x2c')](_0x97d338)['end']();};}function respondWithResult(_0x470ca8,_0x5f3f57){_0x5f3f57=_0x5f3f57||0xc8;return function(_0x465d76){if(_0x465d76){return _0x470ca8['status'](_0x5f3f57)[_0x90ae('0x2d')](_0x465d76);}};}function respondWithFilteredResult(_0x503a33,_0x3b43b3){return function(_0x1762ce){if(_0x1762ce){var _0x285819=_0x1762ce[_0x90ae('0x2e')],_0x251196=_0x3b43b3['offset'],_0x2b4865=_0x3b43b3[_0x90ae('0x2f')]+_0x3b43b3[_0x90ae('0x30')],_0x5477f8;if(_0x2b4865>=_0x285819){_0x2b4865=_0x285819;_0x5477f8=0xc8;}else{_0x5477f8=0xce;}_0x503a33[_0x90ae('0x2c')](_0x5477f8);return _0x503a33[_0x90ae('0x31')](_0x90ae('0x32'),_0x251196+'-'+_0x2b4865+'/'+_0x285819)[_0x90ae('0x2d')](_0x1762ce);}return null;};}function patchUpdates(_0x5f55a8){return function(_0x4f78b9){try{jsonpatch['apply'](_0x4f78b9,_0x5f55a8,!![]);}catch(_0x393711){return BPromise[_0x90ae('0x33')](_0x393711);}return _0x4f78b9[_0x90ae('0x34')]();};}function saveUpdates(_0x197ea0,_0x11da5f){return function(_0x43dd40){if(_0x43dd40){return _0x43dd40[_0x90ae('0x35')](_0x197ea0)[_0x90ae('0x22')](function(_0x5de04a){return _0x5de04a;});}return null;};}function removeEntity(_0x1b172c,_0x562e41){return function(_0x44250d){if(_0x44250d){return _0x44250d[_0x90ae('0x36')]()[_0x90ae('0x22')](function(){_0x1b172c[_0x90ae('0x2c')](0xcc)[_0x90ae('0x37')]();});}};}function handleEntityNotFound(_0x477e6f,_0xe467fd){return function(_0x464ddb){if(!_0x464ddb){_0x477e6f[_0x90ae('0x38')](0x194);}return _0x464ddb;};}function handleError(_0x157e8c,_0x35944f){_0x35944f=_0x35944f||0x1f4;return function(_0x8a7aca){logger['error'](_0x8a7aca[_0x90ae('0x39')]);if(_0x8a7aca['name']){delete _0x8a7aca[_0x90ae('0x3a')];}_0x157e8c['status'](_0x35944f)[_0x90ae('0x3b')](_0x8a7aca);};}exports['index']=function(_0x39bb4f,_0x4b16d5){var _0x4a4c22={},_0x199bc7={},_0x43106d={'count':0x0,'rows':[]};var _0x8504d4=_[_0x90ae('0x3c')](db['FreshsalesConfiguration'][_0x90ae('0x3d')],function(_0x4dd873){return{'name':_0x4dd873[_0x90ae('0x3e')],'type':_0x4dd873[_0x90ae('0x3f')]['key']};});_0x199bc7[_0x90ae('0x40')]=_[_0x90ae('0x3c')](_0x8504d4,_0x90ae('0x3a'));_0x199bc7[_0x90ae('0x41')]=_[_0x90ae('0x42')](_0x39bb4f[_0x90ae('0x41')]);_0x199bc7[_0x90ae('0x43')]=_[_0x90ae('0x44')](_0x199bc7['model'],_0x199bc7[_0x90ae('0x41')]);_0x4a4c22[_0x90ae('0x45')]=_[_0x90ae('0x44')](_0x199bc7[_0x90ae('0x40')],qs['fields'](_0x39bb4f[_0x90ae('0x41')][_0x90ae('0x46')]));_0x4a4c22[_0x90ae('0x45')]=_0x4a4c22[_0x90ae('0x45')][_0x90ae('0x47')]?_0x4a4c22[_0x90ae('0x45')]:_0x199bc7[_0x90ae('0x40')];if(!_0x39bb4f['query'][_0x90ae('0x48')](_0x90ae('0x49'))){_0x4a4c22[_0x90ae('0x30')]=qs['limit'](_0x39bb4f[_0x90ae('0x41')][_0x90ae('0x30')]);_0x4a4c22[_0x90ae('0x2f')]=qs[_0x90ae('0x2f')](_0x39bb4f[_0x90ae('0x41')]['offset']);}_0x4a4c22[_0x90ae('0x4a')]=qs['sort'](_0x39bb4f['query']['sort']);_0x4a4c22['where']=qs[_0x90ae('0x43')](_['pick'](_0x39bb4f[_0x90ae('0x41')],_0x199bc7[_0x90ae('0x43')]),_0x8504d4);if(_0x39bb4f[_0x90ae('0x41')]['filter']){_0x4a4c22[_0x90ae('0x4b')]=_[_0x90ae('0x4c')](_0x4a4c22[_0x90ae('0x4b')],{'$or':_[_0x90ae('0x3c')](_0x8504d4,function(_0x1491a1){if(_0x1491a1['type']!=='VIRTUAL'){var _0x209851={};_0x209851[_0x1491a1[_0x90ae('0x3a')]]={'$like':'%'+_0x39bb4f['query'][_0x90ae('0x4d')]+'%'};return _0x209851;}})});}_0x4a4c22=_[_0x90ae('0x4c')]({},_0x4a4c22,_0x39bb4f[_0x90ae('0x4e')]);var _0x19a581={'where':_0x4a4c22['where']};return db['FreshsalesConfiguration'][_0x90ae('0x2e')](_0x19a581)[_0x90ae('0x22')](function(_0x7005c1){_0x43106d[_0x90ae('0x2e')]=_0x7005c1;if(_0x39bb4f['query'][_0x90ae('0x4f')]){_0x4a4c22[_0x90ae('0x50')]=[{'all':!![]}];}return db[_0x90ae('0x51')][_0x90ae('0x52')](_0x4a4c22);})[_0x90ae('0x22')](function(_0x5b059c){_0x43106d[_0x90ae('0x53')]=_0x5b059c;return _0x43106d;})[_0x90ae('0x22')](respondWithFilteredResult(_0x4b16d5,_0x4a4c22))[_0x90ae('0x54')](handleError(_0x4b16d5,null));};exports[_0x90ae('0x55')]=function(_0x48f3cf,_0x1c0195){var _0x41f311={'raw':![],'where':{'id':_0x48f3cf[_0x90ae('0x56')]['id']}},_0x272455={};_0x272455[_0x90ae('0x40')]=_['keys'](db[_0x90ae('0x51')][_0x90ae('0x3d')]);_0x272455[_0x90ae('0x41')]=_[_0x90ae('0x42')](_0x48f3cf[_0x90ae('0x41')]);_0x272455[_0x90ae('0x43')]=_[_0x90ae('0x44')](_0x272455[_0x90ae('0x40')],_0x272455[_0x90ae('0x41')]);_0x41f311['attributes']=_['intersection'](_0x272455[_0x90ae('0x40')],qs[_0x90ae('0x46')](_0x48f3cf['query']['fields']));_0x41f311['attributes']=_0x41f311['attributes'][_0x90ae('0x47')]?_0x41f311[_0x90ae('0x45')]:_0x272455['model'];if(_0x48f3cf[_0x90ae('0x41')][_0x90ae('0x4f')]){_0x41f311['include']=[{'all':!![]}];}_0x41f311=_[_0x90ae('0x4c')]({},_0x41f311,_0x48f3cf['options']);return db['FreshsalesConfiguration'][_0x90ae('0x57')](_0x41f311)[_0x90ae('0x22')](handleEntityNotFound(_0x1c0195,null))['then'](respondWithResult(_0x1c0195,null))[_0x90ae('0x54')](handleError(_0x1c0195,null));};exports[_0x90ae('0x58')]=function(_0x5a037c,_0x2646f4){return db['FreshsalesConfiguration']['create'](_0x5a037c[_0x90ae('0x59')],{})[_0x90ae('0x22')](respondWithResult(_0x2646f4,0xc9))[_0x90ae('0x54')](handleError(_0x2646f4,null));};exports[_0x90ae('0x35')]=function(_0x23e98d,_0x4c53d9){if(_0x23e98d[_0x90ae('0x59')]['id']){delete _0x23e98d[_0x90ae('0x59')]['id'];}return db[_0x90ae('0x51')]['find']({'where':{'id':_0x23e98d[_0x90ae('0x56')]['id']}})[_0x90ae('0x22')](handleEntityNotFound(_0x4c53d9,null))[_0x90ae('0x22')](saveUpdates(_0x23e98d[_0x90ae('0x59')],null))['then'](respondWithResult(_0x4c53d9,null))['catch'](handleError(_0x4c53d9,null));};exports[_0x90ae('0x36')]=function(_0x16234c,_0x2dccfe){return db[_0x90ae('0x51')][_0x90ae('0x57')]({'where':{'id':_0x16234c[_0x90ae('0x56')]['id']}})[_0x90ae('0x22')](handleEntityNotFound(_0x2dccfe,null))[_0x90ae('0x22')](removeEntity(_0x2dccfe,null))[_0x90ae('0x54')](handleError(_0x2dccfe,null));};exports[_0x90ae('0x5a')]=function(_0x1cec4c,_0x37b739,_0x22bcd9){var _0x1cfb95={};var _0x2415c2={};var _0x2575c3;var _0x1ba9de;return db['FreshsalesConfiguration'][_0x90ae('0x5b')]({'where':{'id':_0x1cec4c[_0x90ae('0x56')]['id']}})[_0x90ae('0x22')](handleEntityNotFound(_0x37b739,null))[_0x90ae('0x22')](function(_0xd0aa5a){if(_0xd0aa5a){_0x2575c3=_0xd0aa5a;_0x2415c2[_0x90ae('0x40')]=_[_0x90ae('0x42')](db[_0x90ae('0x5c')][_0x90ae('0x3d')]);_0x2415c2[_0x90ae('0x41')]=_['keys'](_0x1cec4c['query']);_0x2415c2[_0x90ae('0x43')]=_[_0x90ae('0x44')](_0x2415c2[_0x90ae('0x40')],_0x2415c2[_0x90ae('0x41')]);_0x1cfb95[_0x90ae('0x45')]=_[_0x90ae('0x44')](_0x2415c2[_0x90ae('0x40')],qs[_0x90ae('0x46')](_0x1cec4c[_0x90ae('0x41')][_0x90ae('0x46')]));_0x1cfb95['attributes']=_0x1cfb95['attributes']['length']?_0x1cfb95['attributes']:_0x2415c2['model'];_0x1cfb95[_0x90ae('0x4a')]=qs[_0x90ae('0x5d')](_0x1cec4c['query'][_0x90ae('0x5d')]);_0x1cfb95['where']=qs['filters'](_[_0x90ae('0x5e')](_0x1cec4c[_0x90ae('0x41')],_0x2415c2[_0x90ae('0x43')]));if(_0x1cec4c[_0x90ae('0x41')][_0x90ae('0x4d')]){_0x1cfb95[_0x90ae('0x4b')]=_[_0x90ae('0x4c')](_0x1cfb95[_0x90ae('0x4b')],{'$or':_['map'](_0x1cfb95[_0x90ae('0x45')],function(_0x3e43c0){var _0x5c6558={};_0x5c6558[_0x3e43c0]={'$like':'%'+_0x1cec4c[_0x90ae('0x41')]['filter']+'%'};return _0x5c6558;})});}_0x1cfb95=_[_0x90ae('0x4c')]({},_0x1cfb95,_0x1cec4c[_0x90ae('0x4e')]);return _0x2575c3['getSubjects'](_0x1cfb95);}})[_0x90ae('0x22')](function(_0x521fcd){if(_0x521fcd){_0x1ba9de=_0x521fcd[_0x90ae('0x47')];if(!_0x1cec4c[_0x90ae('0x41')]['hasOwnProperty']('nolimit')){_0x1cfb95[_0x90ae('0x30')]=qs[_0x90ae('0x30')](_0x1cec4c['query']['limit']);_0x1cfb95[_0x90ae('0x2f')]=qs[_0x90ae('0x2f')](_0x1cec4c[_0x90ae('0x41')]['offset']);}return _0x2575c3[_0x90ae('0x5a')](_0x1cfb95);}})['then'](function(_0x283001){if(_0x283001){return _0x283001?{'count':_0x1ba9de,'rows':_0x283001}:null;}})[_0x90ae('0x22')](respondWithResult(_0x37b739,null))[_0x90ae('0x54')](handleError(_0x37b739,null));};exports[_0x90ae('0x5f')]=function(_0x4e23c3,_0x21469f,_0x4aa482){var _0x43858e={};var _0x625e40={};var _0x5ca005;var _0x51e3ce;return db[_0x90ae('0x51')]['findOne']({'where':{'id':_0x4e23c3[_0x90ae('0x56')]['id']}})[_0x90ae('0x22')](handleEntityNotFound(_0x21469f,null))['then'](function(_0x2dad94){if(_0x2dad94){_0x5ca005=_0x2dad94;_0x625e40[_0x90ae('0x40')]=_['keys'](db['FreshsalesField'][_0x90ae('0x3d')]);_0x625e40[_0x90ae('0x41')]=_[_0x90ae('0x42')](_0x4e23c3['query']);_0x625e40['filters']=_[_0x90ae('0x44')](_0x625e40['model'],_0x625e40[_0x90ae('0x41')]);_0x43858e[_0x90ae('0x45')]=_[_0x90ae('0x44')](_0x625e40[_0x90ae('0x40')],qs['fields'](_0x4e23c3[_0x90ae('0x41')][_0x90ae('0x46')]));_0x43858e[_0x90ae('0x45')]=_0x43858e[_0x90ae('0x45')][_0x90ae('0x47')]?_0x43858e[_0x90ae('0x45')]:_0x625e40[_0x90ae('0x40')];_0x43858e[_0x90ae('0x4a')]=qs[_0x90ae('0x5d')](_0x4e23c3['query'][_0x90ae('0x5d')]);_0x43858e['where']=qs['filters'](_['pick'](_0x4e23c3[_0x90ae('0x41')],_0x625e40[_0x90ae('0x43')]));if(_0x4e23c3[_0x90ae('0x41')][_0x90ae('0x4d')]){_0x43858e[_0x90ae('0x4b')]=_[_0x90ae('0x4c')](_0x43858e[_0x90ae('0x4b')],{'$or':_['map'](_0x43858e[_0x90ae('0x45')],function(_0x5176a0){var _0x7f4d6b={};_0x7f4d6b[_0x5176a0]={'$like':'%'+_0x4e23c3[_0x90ae('0x41')][_0x90ae('0x4d')]+'%'};return _0x7f4d6b;})});}_0x43858e=_[_0x90ae('0x4c')]({},_0x43858e,_0x4e23c3[_0x90ae('0x4e')]);return _0x5ca005['getDescriptions'](_0x43858e);}})[_0x90ae('0x22')](function(_0x401185){if(_0x401185){_0x51e3ce=_0x401185[_0x90ae('0x47')];if(!_0x4e23c3[_0x90ae('0x41')][_0x90ae('0x48')](_0x90ae('0x49'))){_0x43858e[_0x90ae('0x30')]=qs[_0x90ae('0x30')](_0x4e23c3[_0x90ae('0x41')][_0x90ae('0x30')]);_0x43858e[_0x90ae('0x2f')]=qs[_0x90ae('0x2f')](_0x4e23c3[_0x90ae('0x41')][_0x90ae('0x2f')]);}return _0x5ca005[_0x90ae('0x5f')](_0x43858e);}})[_0x90ae('0x22')](function(_0x33a9eb){if(_0x33a9eb){return _0x33a9eb?{'count':_0x51e3ce,'rows':_0x33a9eb}:null;}})['then'](respondWithResult(_0x21469f,null))[_0x90ae('0x54')](handleError(_0x21469f,null));};exports[_0x90ae('0x60')]=function(_0x2c5bbe,_0x197d00,_0x359253){var _0xad981a={};var _0x37034b={};var _0x6f485a;var _0x25e911;return db[_0x90ae('0x51')][_0x90ae('0x5b')]({'where':{'id':_0x2c5bbe[_0x90ae('0x56')]['id']}})['then'](handleEntityNotFound(_0x197d00,null))['then'](function(_0x132a09){if(_0x132a09){_0x6f485a=_0x132a09;_0x37034b[_0x90ae('0x40')]=_[_0x90ae('0x42')](db['FreshsalesField'][_0x90ae('0x3d')]);_0x37034b['query']=_['keys'](_0x2c5bbe[_0x90ae('0x41')]);_0x37034b[_0x90ae('0x43')]=_[_0x90ae('0x44')](_0x37034b[_0x90ae('0x40')],_0x37034b[_0x90ae('0x41')]);_0xad981a[_0x90ae('0x45')]=_[_0x90ae('0x44')](_0x37034b[_0x90ae('0x40')],qs[_0x90ae('0x46')](_0x2c5bbe[_0x90ae('0x41')][_0x90ae('0x46')]));_0xad981a['attributes']=_0xad981a[_0x90ae('0x45')][_0x90ae('0x47')]?_0xad981a[_0x90ae('0x45')]:_0x37034b['model'];_0xad981a[_0x90ae('0x4a')]=qs['sort'](_0x2c5bbe[_0x90ae('0x41')]['sort']);_0xad981a[_0x90ae('0x4b')]=qs[_0x90ae('0x43')](_[_0x90ae('0x5e')](_0x2c5bbe[_0x90ae('0x41')],_0x37034b[_0x90ae('0x43')]));if(_0x2c5bbe[_0x90ae('0x41')][_0x90ae('0x4d')]){_0xad981a[_0x90ae('0x4b')]=_[_0x90ae('0x4c')](_0xad981a[_0x90ae('0x4b')],{'$or':_[_0x90ae('0x3c')](_0xad981a['attributes'],function(_0x5b4362){var _0x57aa46={};_0x57aa46[_0x5b4362]={'$like':'%'+_0x2c5bbe['query'][_0x90ae('0x4d')]+'%'};return _0x57aa46;})});}_0xad981a=_[_0x90ae('0x4c')]({},_0xad981a,_0x2c5bbe[_0x90ae('0x4e')]);return _0x6f485a[_0x90ae('0x60')](_0xad981a);}})[_0x90ae('0x22')](function(_0x2c3ea7){if(_0x2c3ea7){_0x25e911=_0x2c3ea7[_0x90ae('0x47')];if(!_0x2c5bbe[_0x90ae('0x41')][_0x90ae('0x48')]('nolimit')){_0xad981a[_0x90ae('0x30')]=qs[_0x90ae('0x30')](_0x2c5bbe[_0x90ae('0x41')][_0x90ae('0x30')]);_0xad981a['offset']=qs[_0x90ae('0x2f')](_0x2c5bbe['query'][_0x90ae('0x2f')]);}return _0x6f485a[_0x90ae('0x60')](_0xad981a);}})[_0x90ae('0x22')](function(_0x5c4667){if(_0x5c4667){return _0x5c4667?{'count':_0x25e911,'rows':_0x5c4667}:null;}})['then'](respondWithResult(_0x197d00,null))[_0x90ae('0x54')](handleError(_0x197d00,null));}; \ No newline at end of file +var _0x7084=['FreshsalesField','order','pick','nolimit','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../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~!@#$%^&-_=+[{]}.','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','end','status','count','offset','limit','set','json','apply','reject','save','update','destroy','stack','name','send','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','show','params','merge','find','create','body','getSubjects','findOne'];(function(_0x8005f8,_0xd984c1){var _0x594f82=function(_0x25bb49){while(--_0x25bb49){_0x8005f8['push'](_0x8005f8['shift']());}};_0x594f82(++_0xd984c1);}(_0x7084,0x1e6));var _0x4708=function(_0x14bcdf,_0x19c402){_0x14bcdf=_0x14bcdf-0x0;var _0x3605fc=_0x7084[_0x14bcdf];return _0x3605fc;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4708('0x0'));var zipdir=require(_0x4708('0x1'));var jsonpatch=require(_0x4708('0x2'));var rp=require('request-promise');var moment=require(_0x4708('0x3'));var BPromise=require(_0x4708('0x4'));var Mustache=require(_0x4708('0x5'));var util=require(_0x4708('0x6'));var path=require(_0x4708('0x7'));var sox=require(_0x4708('0x8'));var csv=require(_0x4708('0x9'));var ejs=require(_0x4708('0xa'));var fs=require('fs');var _=require(_0x4708('0xb'));var squel=require(_0x4708('0xc'));var crypto=require(_0x4708('0xd'));var jsforce=require(_0x4708('0xe'));var deskjs=require(_0x4708('0xf'));var toCsv=require(_0x4708('0x9'));var querystring=require(_0x4708('0x10'));var Papa=require('papaparse');var Redis=require(_0x4708('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4708('0x12'));var as=require(_0x4708('0x13'));var hardwareService=require(_0x4708('0x14'));var logger=require(_0x4708('0x15'))(_0x4708('0x16'));var utils=require('../../config/utils');var config=require(_0x4708('0x17'));var db=require(_0x4708('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x4708('0x19')][_0x4708('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xa98e6f,_0x198505,_0x5918d2){if(_0x5918d2){var _0x5f0f05=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f0f05[_0x4708('0x1b')](_0x198505)){return _0xa98e6f;}else{throw new db[(_0x4708('0x1c'))][(_0x4708('0x1d'))](_0x4708('0x1e'));}}else{return _0xa98e6f;}}function respondWithRpcPromise(_0x5c13a4,_0x5d4852,_0x30df6c,_0xfcaa5f){return new BPromise(function(_0x23fce5,_0x3eb97e){var _0x3ca4f7=_0xfcaa5f||client;return _0x3ca4f7[_0x4708('0x1f')](_0x5c13a4,_0x30df6c)[_0x4708('0x20')](function(_0x4fdcd0){logger['info'](_0x4708('0x21'),_0x5d4852,_0x4708('0x22'));logger[_0x4708('0x23')](_0x4708('0x24'),_0x5d4852,_0x4708('0x22'),JSON[_0x4708('0x25')](_0x4fdcd0));if(_0x4fdcd0[_0x4708('0x26')]){if(_0x4fdcd0[_0x4708('0x26')][_0x4708('0x27')]===0x1f4){logger[_0x4708('0x26')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5d4852,_0x4fdcd0[_0x4708('0x26')]['message']);return _0x3eb97e(_0x4fdcd0[_0x4708('0x26')][_0x4708('0x28')]);}logger[_0x4708('0x26')](_0x4708('0x21'),_0x5d4852,_0x4fdcd0[_0x4708('0x26')][_0x4708('0x28')]);return _0x23fce5(_0x4fdcd0[_0x4708('0x26')]['message']);}else{logger[_0x4708('0x29')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5d4852,'request\x20sent');_0x23fce5(_0x4fdcd0[_0x4708('0x2a')][_0x4708('0x28')]);}})[_0x4708('0x2b')](function(_0x456114){logger[_0x4708('0x26')](_0x4708('0x21'),_0x5d4852,_0x456114);_0x3eb97e(_0x456114);});});}function respondWithStatusCode(_0x204179,_0x585abe){_0x585abe=_0x585abe||0xcc;return function(_0x4f45df){if(_0x4f45df){return _0x204179['sendStatus'](_0x585abe);}return _0x204179['status'](_0x585abe)[_0x4708('0x2c')]();};}function respondWithResult(_0x212444,_0x14c609){_0x14c609=_0x14c609||0xc8;return function(_0x2efb58){if(_0x2efb58){return _0x212444[_0x4708('0x2d')](_0x14c609)['json'](_0x2efb58);}};}function respondWithFilteredResult(_0x4ae526,_0x2f3d65){return function(_0x388351){if(_0x388351){var _0xdb0f83=_0x388351[_0x4708('0x2e')],_0xb8b14e=_0x2f3d65['offset'],_0x2bb370=_0x2f3d65[_0x4708('0x2f')]+_0x2f3d65[_0x4708('0x30')],_0x436513;if(_0x2bb370>=_0xdb0f83){_0x2bb370=_0xdb0f83;_0x436513=0xc8;}else{_0x436513=0xce;}_0x4ae526[_0x4708('0x2d')](_0x436513);return _0x4ae526[_0x4708('0x31')]('Content-Range',_0xb8b14e+'-'+_0x2bb370+'/'+_0xdb0f83)[_0x4708('0x32')](_0x388351);}return null;};}function patchUpdates(_0x100ce9){return function(_0x14b6a3){try{jsonpatch[_0x4708('0x33')](_0x14b6a3,_0x100ce9,!![]);}catch(_0x192e3e){return BPromise[_0x4708('0x34')](_0x192e3e);}return _0x14b6a3[_0x4708('0x35')]();};}function saveUpdates(_0x547a31,_0x2bf2af){return function(_0x334250){if(_0x334250){return _0x334250[_0x4708('0x36')](_0x547a31)[_0x4708('0x20')](function(_0x32e17b){return _0x32e17b;});}return null;};}function removeEntity(_0x1e3e83,_0x5680d8){return function(_0x2ee1c5){if(_0x2ee1c5){return _0x2ee1c5[_0x4708('0x37')]()[_0x4708('0x20')](function(){_0x1e3e83[_0x4708('0x2d')](0xcc)[_0x4708('0x2c')]();});}};}function handleEntityNotFound(_0xb33d3e,_0x6fb4b1){return function(_0x2b2f96){if(!_0x2b2f96){_0xb33d3e['sendStatus'](0x194);}return _0x2b2f96;};}function handleError(_0x5180e0,_0x1be437){_0x1be437=_0x1be437||0x1f4;return function(_0x5bdad7){logger[_0x4708('0x26')](_0x5bdad7[_0x4708('0x38')]);if(_0x5bdad7[_0x4708('0x39')]){delete _0x5bdad7[_0x4708('0x39')];}_0x5180e0['status'](_0x1be437)[_0x4708('0x3a')](_0x5bdad7);};}exports['index']=function(_0x44841b,_0x15896e){var _0x534d04={},_0x179dfa={},_0x4ff7be={'count':0x0,'rows':[]};var _0x477d03=_[_0x4708('0x3b')](db[_0x4708('0x3c')][_0x4708('0x3d')],function(_0x1f348a){return{'name':_0x1f348a[_0x4708('0x3e')],'type':_0x1f348a[_0x4708('0x3f')][_0x4708('0x40')]};});_0x179dfa[_0x4708('0x41')]=_[_0x4708('0x3b')](_0x477d03,'name');_0x179dfa[_0x4708('0x42')]=_[_0x4708('0x43')](_0x44841b[_0x4708('0x42')]);_0x179dfa[_0x4708('0x44')]=_[_0x4708('0x45')](_0x179dfa[_0x4708('0x41')],_0x179dfa[_0x4708('0x42')]);_0x534d04[_0x4708('0x46')]=_[_0x4708('0x45')](_0x179dfa['model'],qs[_0x4708('0x47')](_0x44841b[_0x4708('0x42')][_0x4708('0x47')]));_0x534d04['attributes']=_0x534d04[_0x4708('0x46')][_0x4708('0x48')]?_0x534d04[_0x4708('0x46')]:_0x179dfa[_0x4708('0x41')];if(!_0x44841b[_0x4708('0x42')][_0x4708('0x49')]('nolimit')){_0x534d04['limit']=qs['limit'](_0x44841b[_0x4708('0x42')][_0x4708('0x30')]);_0x534d04['offset']=qs['offset'](_0x44841b[_0x4708('0x42')][_0x4708('0x2f')]);}_0x534d04['order']=qs[_0x4708('0x4a')](_0x44841b[_0x4708('0x42')][_0x4708('0x4a')]);_0x534d04[_0x4708('0x4b')]=qs[_0x4708('0x44')](_['pick'](_0x44841b[_0x4708('0x42')],_0x179dfa[_0x4708('0x44')]),_0x477d03);if(_0x44841b['query']['filter']){_0x534d04[_0x4708('0x4b')]=_['merge'](_0x534d04['where'],{'$or':_[_0x4708('0x3b')](_0x477d03,function(_0x581f92){if(_0x581f92[_0x4708('0x3f')]!==_0x4708('0x4c')){var _0x30d41c={};_0x30d41c[_0x581f92[_0x4708('0x39')]]={'$like':'%'+_0x44841b['query'][_0x4708('0x4d')]+'%'};return _0x30d41c;}})});}_0x534d04=_['merge']({},_0x534d04,_0x44841b[_0x4708('0x4e')]);var _0x443385={'where':_0x534d04[_0x4708('0x4b')]};return db[_0x4708('0x3c')]['count'](_0x443385)[_0x4708('0x20')](function(_0x3357cf){_0x4ff7be[_0x4708('0x2e')]=_0x3357cf;if(_0x44841b[_0x4708('0x42')][_0x4708('0x4f')]){_0x534d04[_0x4708('0x50')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x4708('0x51')](_0x534d04);})[_0x4708('0x20')](function(_0x45e10b){_0x4ff7be['rows']=_0x45e10b;return _0x4ff7be;})[_0x4708('0x20')](respondWithFilteredResult(_0x15896e,_0x534d04))[_0x4708('0x2b')](handleError(_0x15896e,null));};exports[_0x4708('0x52')]=function(_0x48e8ae,_0x414e5f){var _0x1f3389={'raw':![],'where':{'id':_0x48e8ae[_0x4708('0x53')]['id']}},_0x3f9a03={};_0x3f9a03[_0x4708('0x41')]=_[_0x4708('0x43')](db[_0x4708('0x3c')][_0x4708('0x3d')]);_0x3f9a03[_0x4708('0x42')]=_[_0x4708('0x43')](_0x48e8ae[_0x4708('0x42')]);_0x3f9a03[_0x4708('0x44')]=_[_0x4708('0x45')](_0x3f9a03[_0x4708('0x41')],_0x3f9a03[_0x4708('0x42')]);_0x1f3389[_0x4708('0x46')]=_[_0x4708('0x45')](_0x3f9a03[_0x4708('0x41')],qs['fields'](_0x48e8ae[_0x4708('0x42')][_0x4708('0x47')]));_0x1f3389[_0x4708('0x46')]=_0x1f3389['attributes']['length']?_0x1f3389[_0x4708('0x46')]:_0x3f9a03[_0x4708('0x41')];if(_0x48e8ae['query'][_0x4708('0x4f')]){_0x1f3389['include']=[{'all':!![]}];}_0x1f3389=_[_0x4708('0x54')]({},_0x1f3389,_0x48e8ae['options']);return db[_0x4708('0x3c')][_0x4708('0x55')](_0x1f3389)[_0x4708('0x20')](handleEntityNotFound(_0x414e5f,null))[_0x4708('0x20')](respondWithResult(_0x414e5f,null))[_0x4708('0x2b')](handleError(_0x414e5f,null));};exports[_0x4708('0x56')]=function(_0x31585e,_0x4540ab){return db[_0x4708('0x3c')][_0x4708('0x56')](_0x31585e[_0x4708('0x57')],{})[_0x4708('0x20')](respondWithResult(_0x4540ab,0xc9))[_0x4708('0x2b')](handleError(_0x4540ab,null));};exports[_0x4708('0x36')]=function(_0x53f028,_0x74e027){if(_0x53f028[_0x4708('0x57')]['id']){delete _0x53f028[_0x4708('0x57')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x53f028['params']['id']}})[_0x4708('0x20')](handleEntityNotFound(_0x74e027,null))['then'](saveUpdates(_0x53f028[_0x4708('0x57')],null))[_0x4708('0x20')](respondWithResult(_0x74e027,null))[_0x4708('0x2b')](handleError(_0x74e027,null));};exports[_0x4708('0x37')]=function(_0x1a4c17,_0x3c6087){return db[_0x4708('0x3c')][_0x4708('0x55')]({'where':{'id':_0x1a4c17['params']['id']}})[_0x4708('0x20')](handleEntityNotFound(_0x3c6087,null))[_0x4708('0x20')](removeEntity(_0x3c6087,null))[_0x4708('0x2b')](handleError(_0x3c6087,null));};exports[_0x4708('0x58')]=function(_0x3c8bc3,_0x23a869,_0x100b38){var _0x121a5b={};var _0x418e7e={};var _0x5653db;var _0x2421ed;return db[_0x4708('0x3c')][_0x4708('0x59')]({'where':{'id':_0x3c8bc3[_0x4708('0x53')]['id']}})[_0x4708('0x20')](handleEntityNotFound(_0x23a869,null))[_0x4708('0x20')](function(_0x45c904){if(_0x45c904){_0x5653db=_0x45c904;_0x418e7e[_0x4708('0x41')]=_[_0x4708('0x43')](db[_0x4708('0x5a')][_0x4708('0x3d')]);_0x418e7e['query']=_['keys'](_0x3c8bc3[_0x4708('0x42')]);_0x418e7e[_0x4708('0x44')]=_[_0x4708('0x45')](_0x418e7e[_0x4708('0x41')],_0x418e7e[_0x4708('0x42')]);_0x121a5b[_0x4708('0x46')]=_[_0x4708('0x45')](_0x418e7e[_0x4708('0x41')],qs['fields'](_0x3c8bc3[_0x4708('0x42')][_0x4708('0x47')]));_0x121a5b[_0x4708('0x46')]=_0x121a5b[_0x4708('0x46')]['length']?_0x121a5b[_0x4708('0x46')]:_0x418e7e['model'];_0x121a5b[_0x4708('0x5b')]=qs['sort'](_0x3c8bc3[_0x4708('0x42')][_0x4708('0x4a')]);_0x121a5b[_0x4708('0x4b')]=qs[_0x4708('0x44')](_[_0x4708('0x5c')](_0x3c8bc3[_0x4708('0x42')],_0x418e7e[_0x4708('0x44')]));if(_0x3c8bc3[_0x4708('0x42')][_0x4708('0x4d')]){_0x121a5b['where']=_[_0x4708('0x54')](_0x121a5b['where'],{'$or':_[_0x4708('0x3b')](_0x121a5b[_0x4708('0x46')],function(_0x56b54b){var _0xfd9fe7={};_0xfd9fe7[_0x56b54b]={'$like':'%'+_0x3c8bc3[_0x4708('0x42')]['filter']+'%'};return _0xfd9fe7;})});}_0x121a5b=_[_0x4708('0x54')]({},_0x121a5b,_0x3c8bc3['options']);return _0x5653db['getSubjects'](_0x121a5b);}})[_0x4708('0x20')](function(_0x3c2a1b){if(_0x3c2a1b){_0x2421ed=_0x3c2a1b[_0x4708('0x48')];if(!_0x3c8bc3[_0x4708('0x42')][_0x4708('0x49')](_0x4708('0x5d'))){_0x121a5b[_0x4708('0x30')]=qs[_0x4708('0x30')](_0x3c8bc3[_0x4708('0x42')][_0x4708('0x30')]);_0x121a5b[_0x4708('0x2f')]=qs[_0x4708('0x2f')](_0x3c8bc3[_0x4708('0x42')]['offset']);}return _0x5653db[_0x4708('0x58')](_0x121a5b);}})[_0x4708('0x20')](function(_0x14747a){if(_0x14747a){return _0x14747a?{'count':_0x2421ed,'rows':_0x14747a}:null;}})[_0x4708('0x20')](respondWithResult(_0x23a869,null))['catch'](handleError(_0x23a869,null));};exports['getDescriptions']=function(_0x386d88,_0x54f4e7,_0x47730b){var _0xe287fb={};var _0x1518cd={};var _0x34dd7c;var _0x8685e2;return db[_0x4708('0x3c')][_0x4708('0x59')]({'where':{'id':_0x386d88[_0x4708('0x53')]['id']}})['then'](handleEntityNotFound(_0x54f4e7,null))[_0x4708('0x20')](function(_0x3e582e){if(_0x3e582e){_0x34dd7c=_0x3e582e;_0x1518cd[_0x4708('0x41')]=_['keys'](db[_0x4708('0x5a')]['rawAttributes']);_0x1518cd[_0x4708('0x42')]=_[_0x4708('0x43')](_0x386d88[_0x4708('0x42')]);_0x1518cd[_0x4708('0x44')]=_[_0x4708('0x45')](_0x1518cd[_0x4708('0x41')],_0x1518cd[_0x4708('0x42')]);_0xe287fb[_0x4708('0x46')]=_[_0x4708('0x45')](_0x1518cd[_0x4708('0x41')],qs[_0x4708('0x47')](_0x386d88[_0x4708('0x42')]['fields']));_0xe287fb[_0x4708('0x46')]=_0xe287fb['attributes']['length']?_0xe287fb[_0x4708('0x46')]:_0x1518cd[_0x4708('0x41')];_0xe287fb[_0x4708('0x5b')]=qs[_0x4708('0x4a')](_0x386d88[_0x4708('0x42')][_0x4708('0x4a')]);_0xe287fb[_0x4708('0x4b')]=qs[_0x4708('0x44')](_[_0x4708('0x5c')](_0x386d88[_0x4708('0x42')],_0x1518cd[_0x4708('0x44')]));if(_0x386d88[_0x4708('0x42')][_0x4708('0x4d')]){_0xe287fb[_0x4708('0x4b')]=_[_0x4708('0x54')](_0xe287fb[_0x4708('0x4b')],{'$or':_[_0x4708('0x3b')](_0xe287fb['attributes'],function(_0x8fee03){var _0x3419e1={};_0x3419e1[_0x8fee03]={'$like':'%'+_0x386d88[_0x4708('0x42')]['filter']+'%'};return _0x3419e1;})});}_0xe287fb=_['merge']({},_0xe287fb,_0x386d88['options']);return _0x34dd7c[_0x4708('0x5e')](_0xe287fb);}})[_0x4708('0x20')](function(_0x560611){if(_0x560611){_0x8685e2=_0x560611['length'];if(!_0x386d88[_0x4708('0x42')][_0x4708('0x49')](_0x4708('0x5d'))){_0xe287fb['limit']=qs['limit'](_0x386d88['query'][_0x4708('0x30')]);_0xe287fb[_0x4708('0x2f')]=qs[_0x4708('0x2f')](_0x386d88[_0x4708('0x42')][_0x4708('0x2f')]);}return _0x34dd7c['getDescriptions'](_0xe287fb);}})[_0x4708('0x20')](function(_0x4fb612){if(_0x4fb612){return _0x4fb612?{'count':_0x8685e2,'rows':_0x4fb612}:null;}})[_0x4708('0x20')](respondWithResult(_0x54f4e7,null))[_0x4708('0x2b')](handleError(_0x54f4e7,null));};exports[_0x4708('0x5f')]=function(_0x15dbe2,_0x3e8a2f,_0x43399d){var _0x5531e2={};var _0x1aa6ab={};var _0x3c68f1;var _0x201a0f;return db[_0x4708('0x3c')][_0x4708('0x59')]({'where':{'id':_0x15dbe2[_0x4708('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e8a2f,null))[_0x4708('0x20')](function(_0x42d327){if(_0x42d327){_0x3c68f1=_0x42d327;_0x1aa6ab[_0x4708('0x41')]=_[_0x4708('0x43')](db[_0x4708('0x5a')][_0x4708('0x3d')]);_0x1aa6ab[_0x4708('0x42')]=_['keys'](_0x15dbe2[_0x4708('0x42')]);_0x1aa6ab[_0x4708('0x44')]=_[_0x4708('0x45')](_0x1aa6ab['model'],_0x1aa6ab[_0x4708('0x42')]);_0x5531e2['attributes']=_[_0x4708('0x45')](_0x1aa6ab[_0x4708('0x41')],qs[_0x4708('0x47')](_0x15dbe2[_0x4708('0x42')][_0x4708('0x47')]));_0x5531e2[_0x4708('0x46')]=_0x5531e2[_0x4708('0x46')][_0x4708('0x48')]?_0x5531e2[_0x4708('0x46')]:_0x1aa6ab[_0x4708('0x41')];_0x5531e2[_0x4708('0x5b')]=qs[_0x4708('0x4a')](_0x15dbe2[_0x4708('0x42')]['sort']);_0x5531e2[_0x4708('0x4b')]=qs[_0x4708('0x44')](_[_0x4708('0x5c')](_0x15dbe2[_0x4708('0x42')],_0x1aa6ab[_0x4708('0x44')]));if(_0x15dbe2['query']['filter']){_0x5531e2['where']=_[_0x4708('0x54')](_0x5531e2[_0x4708('0x4b')],{'$or':_[_0x4708('0x3b')](_0x5531e2[_0x4708('0x46')],function(_0x19cbdd){var _0x2b73d0={};_0x2b73d0[_0x19cbdd]={'$like':'%'+_0x15dbe2[_0x4708('0x42')][_0x4708('0x4d')]+'%'};return _0x2b73d0;})});}_0x5531e2=_[_0x4708('0x54')]({},_0x5531e2,_0x15dbe2[_0x4708('0x4e')]);return _0x3c68f1[_0x4708('0x5f')](_0x5531e2);}})[_0x4708('0x20')](function(_0x5e0b6c){if(_0x5e0b6c){_0x201a0f=_0x5e0b6c[_0x4708('0x48')];if(!_0x15dbe2[_0x4708('0x42')][_0x4708('0x49')](_0x4708('0x5d'))){_0x5531e2[_0x4708('0x30')]=qs[_0x4708('0x30')](_0x15dbe2[_0x4708('0x42')][_0x4708('0x30')]);_0x5531e2[_0x4708('0x2f')]=qs['offset'](_0x15dbe2[_0x4708('0x42')][_0x4708('0x2f')]);}return _0x3c68f1[_0x4708('0x5f')](_0x5531e2);}})[_0x4708('0x20')](function(_0x54a161){if(_0x54a161){return _0x54a161?{'count':_0x201a0f,'rows':_0x54a161}:null;}})[_0x4708('0x20')](respondWithResult(_0x3e8a2f,null))[_0x4708('0x2b')](handleError(_0x3e8a2f,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index e8ebaed..04b6736 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 _0x7017=['int_freshsales_configurations','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration'];(function(_0x3acb89,_0x2ca05e){var _0x4d38f2=function(_0x4cb6a9){while(--_0x4cb6a9){_0x3acb89['push'](_0x3acb89['shift']());}};_0x4d38f2(++_0x2ca05e);}(_0x7017,0x76));var _0x7701=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7017[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x7701('0x0'));var logger=require(_0x7701('0x1'))(_0x7701('0x2'));var moment=require('moment');var BPromise=require(_0x7701('0x3'));var rp=require(_0x7701('0x4'));var fs=require('fs');var path=require(_0x7701('0x5'));var rimraf=require(_0x7701('0x6'));var config=require(_0x7701('0x7'));var attributes=require(_0x7701('0x8'));module[_0x7701('0x9')]=function(_0x354e5d,_0x46ebf2){return _0x354e5d[_0x7701('0xa')](_0x7701('0xb'),attributes,{'tableName':_0x7701('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5a7=['exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x556634,_0x520958){var _0x4429fd=function(_0x1e7eb9){while(--_0x1e7eb9){_0x556634['push'](_0x556634['shift']());}};_0x4429fd(++_0x520958);}(_0xb5a7,0x18f));var _0x7b5a=function(_0x4589b5,_0x11f829){_0x4589b5=_0x4589b5-0x0;var _0x3b7d02=_0xb5a7[_0x4589b5];return _0x3b7d02;};'use strict';var _=require(_0x7b5a('0x0'));var util=require(_0x7b5a('0x1'));var logger=require('../../config/logger')(_0x7b5a('0x2'));var moment=require(_0x7b5a('0x3'));var BPromise=require(_0x7b5a('0x4'));var rp=require(_0x7b5a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b5a('0x6'));var config=require(_0x7b5a('0x7'));var attributes=require(_0x7b5a('0x8'));module[_0x7b5a('0x9')]=function(_0x2125a2,_0x52abf8){return _0x2125a2['define'](_0x7b5a('0xa'),attributes,{'tableName':_0x7b5a('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 cf261e2..0e7366c 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 _0x8c38=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash'];(function(_0x4ab99,_0x219ed2){var _0x29e39c=function(_0x2dd986){while(--_0x2dd986){_0x4ab99['push'](_0x4ab99['shift']());}};_0x29e39c(++_0x219ed2);}(_0x8c38,0x83));var _0x88c3=function(_0x198f04,_0x3b90ed){_0x198f04=_0x198f04-0x0;var _0x192415=_0x8c38[_0x198f04];return _0x192415;};'use strict';var _=require(_0x88c3('0x0'));var util=require(_0x88c3('0x1'));var moment=require('moment');var BPromise=require(_0x88c3('0x2'));var rs=require(_0x88c3('0x3'));var fs=require('fs');var Redis=require(_0x88c3('0x4'));var db=require(_0x88c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x88c3('0x6'))(_0x88c3('0x7'));var config=require(_0x88c3('0x8'));var jayson=require(_0x88c3('0x9'));var client=jayson[_0x88c3('0xa')][_0x88c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcdbc28,_0x25e385,_0x5020c9){return new BPromise(function(_0x350a11,_0x4efd63){return client[_0x88c3('0xc')](_0xcdbc28,_0x5020c9)['then'](function(_0x760391){logger['info'](_0x88c3('0xd'),_0x25e385,_0x88c3('0xe'));logger[_0x88c3('0xf')](_0x88c3('0x10'),_0x25e385,'request\x20sent',JSON[_0x88c3('0x11')](_0x760391));if(_0x760391[_0x88c3('0x12')]){if(_0x760391[_0x88c3('0x12')]['code']===0x1f4){logger[_0x88c3('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25e385,_0x760391['error'][_0x88c3('0x13')]);return _0x4efd63(_0x760391[_0x88c3('0x12')][_0x88c3('0x13')]);}logger[_0x88c3('0x12')](_0x88c3('0xd'),_0x25e385,_0x760391['error'][_0x88c3('0x13')]);return _0x350a11(_0x760391[_0x88c3('0x12')][_0x88c3('0x13')]);}else{logger[_0x88c3('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25e385,_0x88c3('0xe'));_0x350a11(_0x760391['result'][_0x88c3('0x13')]);}})[_0x88c3('0x15')](function(_0x26019e){logger[_0x88c3('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x25e385,_0x26019e);_0x4efd63(_0x26019e);});});} \ No newline at end of file +var _0xc112=['error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x167f2b,_0x2320d0){var _0x350752=function(_0x1a055b){while(--_0x1a055b){_0x167f2b['push'](_0x167f2b['shift']());}};_0x350752(++_0x2320d0);}(_0xc112,0xec));var _0x2c11=function(_0x1ab8fb,_0x4b41a0){_0x1ab8fb=_0x1ab8fb-0x0;var _0x258a8e=_0xc112[_0x1ab8fb];return _0x258a8e;};'use strict';var _=require(_0x2c11('0x0'));var util=require(_0x2c11('0x1'));var moment=require(_0x2c11('0x2'));var BPromise=require('bluebird');var rs=require(_0x2c11('0x3'));var fs=require('fs');var Redis=require(_0x2c11('0x4'));var db=require(_0x2c11('0x5'))['db'];var utils=require(_0x2c11('0x6'));var logger=require(_0x2c11('0x7'))(_0x2c11('0x8'));var config=require(_0x2c11('0x9'));var jayson=require(_0x2c11('0xa'));var client=jayson[_0x2c11('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2399,_0x39c244,_0x1fada4){return new BPromise(function(_0x29dfcf,_0x43c1f5){return client['request'](_0x5c2399,_0x1fada4)[_0x2c11('0xc')](function(_0x1e0381){logger['info'](_0x2c11('0xd'),_0x39c244,_0x2c11('0xe'));logger[_0x2c11('0xf')](_0x2c11('0x10'),_0x39c244,_0x2c11('0xe'),JSON['stringify'](_0x1e0381));if(_0x1e0381[_0x2c11('0x11')]){if(_0x1e0381[_0x2c11('0x11')][_0x2c11('0x12')]===0x1f4){logger[_0x2c11('0x11')](_0x2c11('0xd'),_0x39c244,_0x1e0381[_0x2c11('0x11')][_0x2c11('0x13')]);return _0x43c1f5(_0x1e0381['error'][_0x2c11('0x13')]);}logger[_0x2c11('0x11')](_0x2c11('0xd'),_0x39c244,_0x1e0381[_0x2c11('0x11')][_0x2c11('0x13')]);return _0x29dfcf(_0x1e0381[_0x2c11('0x11')][_0x2c11('0x13')]);}else{logger[_0x2c11('0x14')](_0x2c11('0xd'),_0x39c244,_0x2c11('0xe'));_0x29dfcf(_0x1e0381[_0x2c11('0x15')]['message']);}})[_0x2c11('0x16')](function(_0x3c31e4){logger[_0x2c11('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x39c244,_0x3c31e4);_0x43c1f5(_0x3c31e4);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 22f2779..992f8cd 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 _0xa663=['create','put','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post'];(function(_0x5cf8a7,_0x2da367){var _0x57f03f=function(_0x33dcc8){while(--_0x33dcc8){_0x5cf8a7['push'](_0x5cf8a7['shift']());}};_0x57f03f(++_0x2da367);}(_0xa663,0x188));var _0x3a66=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0xa663[_0x195c21];return _0x3576a8;};'use strict';var multer=require(_0x3a66('0x0'));var util=require('util');var path=require(_0x3a66('0x1'));var timeout=require(_0x3a66('0x2'));var express=require(_0x3a66('0x3'));var router=express[_0x3a66('0x4')]();var auth=require(_0x3a66('0x5'));var interaction=require(_0x3a66('0x6'));var config=require(_0x3a66('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x3a66('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3a66('0x8')](_0x3a66('0x9'),auth[_0x3a66('0xa')](),controller[_0x3a66('0xb')]);router[_0x3a66('0xc')]('/',auth[_0x3a66('0xa')](),controller[_0x3a66('0xd')]);router[_0x3a66('0xe')](_0x3a66('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x3a66('0x9'),auth[_0x3a66('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x73e8=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','post','put','update','delete','exports','util','path'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x73e8,0xfd));var _0x873e=function(_0x26e5a4,_0x24fba6){_0x26e5a4=_0x26e5a4-0x0;var _0x351321=_0x73e8[_0x26e5a4];return _0x351321;};'use strict';var multer=require('multer');var util=require(_0x873e('0x0'));var path=require(_0x873e('0x1'));var timeout=require(_0x873e('0x2'));var express=require(_0x873e('0x3'));var router=express['Router']();var auth=require(_0x873e('0x4'));var interaction=require(_0x873e('0x5'));var config=require('../../config/environment');var controller=require(_0x873e('0x6'));router[_0x873e('0x7')]('/',auth[_0x873e('0x8')](),controller['index']);router[_0x873e('0x7')](_0x873e('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x873e('0xa')]('/',auth[_0x873e('0x8')](),controller['create']);router[_0x873e('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x873e('0xc')]);router[_0x873e('0xd')](_0x873e('0x9'),auth[_0x873e('0x8')](),controller['destroy']);module[_0x873e('0xe')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1aca45c..fdbe0d3 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 _0xc8e9=['keyValue','STRING','string','variable','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x4141b1,_0x10dcd1){var _0x5d5a51=function(_0x525940){while(--_0x525940){_0x4141b1['push'](_0x4141b1['shift']());}};_0x5d5a51(++_0x10dcd1);}(_0xc8e9,0x1d6));var _0x9c8e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc8e9[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x9c8e('0x0'));module['exports']={'type':{'type':Sequelize[_0x9c8e('0x1')]('string','variable','customVariable',_0x9c8e('0x2')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9c8e('0x3')]},'keyType':{'type':Sequelize[_0x9c8e('0x1')](_0x9c8e('0x4'),_0x9c8e('0x5'),_0x9c8e('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9c8e('0x3')]},'nameField':{'type':Sequelize[_0x9c8e('0x3')]},'customField':{'type':Sequelize[_0x9c8e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3df4=['string','variable','customVariable','keyValue','STRING','BOOLEAN','ENUM'];(function(_0x5a22c3,_0x2cfdb4){var _0x5d5274=function(_0x4d2d7d){while(--_0x4d2d7d){_0x5a22c3['push'](_0x5a22c3['shift']());}};_0x5d5274(++_0x2cfdb4);}(_0x3df4,0x102));var _0x43df=function(_0x30a1ca,_0x2af49a){_0x30a1ca=_0x30a1ca-0x0;var _0x1ae192=_0x3df4[_0x30a1ca];return _0x1ae192;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x43df('0x0')](_0x43df('0x1'),_0x43df('0x2'),_0x43df('0x3'),_0x43df('0x4')),'defaultValue':_0x43df('0x1')},'content':{'type':Sequelize[_0x43df('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x43df('0x1'),_0x43df('0x2'),_0x43df('0x3'))},'keyContent':{'type':Sequelize[_0x43df('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x43df('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x43df('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b2b8dc9..ca68642 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 _0x4f99=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','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','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName'];(function(_0x37f184,_0x13ed3c){var _0x26e39f=function(_0x41a821){while(--_0x41a821){_0x37f184['push'](_0x37f184['shift']());}};_0x26e39f(++_0x13ed3c);}(_0x4f99,0x67));var _0x94f9=function(_0x3f8b73,_0x4c772e){_0x3f8b73=_0x3f8b73-0x0;var _0x38cbf6=_0x4f99[_0x3f8b73];return _0x38cbf6;};'use strict';var pdf=require(_0x94f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x94f9('0x1'));var zipdir=require(_0x94f9('0x2'));var jsonpatch=require(_0x94f9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x94f9('0x4'));var Mustache=require(_0x94f9('0x5'));var util=require(_0x94f9('0x6'));var path=require(_0x94f9('0x7'));var sox=require(_0x94f9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x94f9('0x9'));var squel=require(_0x94f9('0xa'));var crypto=require(_0x94f9('0xb'));var jsforce=require(_0x94f9('0xc'));var deskjs=require(_0x94f9('0xd'));var toCsv=require(_0x94f9('0xe'));var querystring=require(_0x94f9('0xf'));var Papa=require(_0x94f9('0x10'));var Redis=require('ioredis');var authService=require(_0x94f9('0x11'));var qs=require(_0x94f9('0x12'));var as=require(_0x94f9('0x13'));var hardwareService=require(_0x94f9('0x14'));var logger=require(_0x94f9('0x15'))(_0x94f9('0x16'));var utils=require(_0x94f9('0x17'));var config=require(_0x94f9('0x18'));var db=require(_0x94f9('0x19'))['db'];function respondWithStatusCode(_0x16025d,_0x1932d9){_0x1932d9=_0x1932d9||0xcc;return function(_0x5a8165){if(_0x5a8165){return _0x16025d['sendStatus'](_0x1932d9);}return _0x16025d[_0x94f9('0x1a')](_0x1932d9)[_0x94f9('0x1b')]();};}function respondWithResult(_0x578818,_0x419eca){_0x419eca=_0x419eca||0xc8;return function(_0x4403de){if(_0x4403de){return _0x578818[_0x94f9('0x1a')](_0x419eca)[_0x94f9('0x1c')](_0x4403de);}};}function respondWithFilteredResult(_0xe3d51,_0x582321){return function(_0x16e04d){if(_0x16e04d){var _0x272942=_0x16e04d['count'],_0x508c5f=_0x582321['offset'],_0x11fd0b=_0x582321[_0x94f9('0x1d')]+_0x582321[_0x94f9('0x1e')],_0x593931;if(_0x11fd0b>=_0x272942){_0x11fd0b=_0x272942;_0x593931=0xc8;}else{_0x593931=0xce;}_0xe3d51[_0x94f9('0x1a')](_0x593931);return _0xe3d51[_0x94f9('0x1f')](_0x94f9('0x20'),_0x508c5f+'-'+_0x11fd0b+'/'+_0x272942)['json'](_0x16e04d);}return null;};}function patchUpdates(_0x2dfdef){return function(_0x5128d2){try{jsonpatch[_0x94f9('0x21')](_0x5128d2,_0x2dfdef,!![]);}catch(_0x1ac6dc){return BPromise['reject'](_0x1ac6dc);}return _0x5128d2['save']();};}function saveUpdates(_0x2c6b9f,_0x21e301){return function(_0xb257c7){if(_0xb257c7){return _0xb257c7[_0x94f9('0x22')](_0x2c6b9f)[_0x94f9('0x23')](function(_0x34b5cb){return _0x34b5cb;});}return null;};}function removeEntity(_0x20c7af,_0x45ddde){return function(_0x3372c4){if(_0x3372c4){return _0x3372c4[_0x94f9('0x24')]()[_0x94f9('0x23')](function(){_0x20c7af[_0x94f9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9f4f72,_0x557d90){return function(_0x248a51){if(!_0x248a51){_0x9f4f72['sendStatus'](0x194);}return _0x248a51;};}function handleError(_0x5d74fb,_0x48d6bb){_0x48d6bb=_0x48d6bb||0x1f4;return function(_0xb24254){logger[_0x94f9('0x25')](_0xb24254[_0x94f9('0x26')]);if(_0xb24254[_0x94f9('0x27')]){delete _0xb24254['name'];}_0x5d74fb[_0x94f9('0x1a')](_0x48d6bb)['send'](_0xb24254);};}exports[_0x94f9('0x28')]=function(_0x2227ee,_0x46157f){var _0x5d6e1d={},_0x59e143={},_0x24d28b={'count':0x0,'rows':[]};var _0x3f85f1=_[_0x94f9('0x29')](db[_0x94f9('0x2a')][_0x94f9('0x2b')],function(_0x29b5ba){return{'name':_0x29b5ba[_0x94f9('0x2c')],'type':_0x29b5ba[_0x94f9('0x2d')][_0x94f9('0x2e')]};});_0x59e143[_0x94f9('0x2f')]=_[_0x94f9('0x29')](_0x3f85f1,_0x94f9('0x27'));_0x59e143[_0x94f9('0x30')]=_['keys'](_0x2227ee[_0x94f9('0x30')]);_0x59e143[_0x94f9('0x31')]=_['intersection'](_0x59e143[_0x94f9('0x2f')],_0x59e143['query']);_0x5d6e1d[_0x94f9('0x32')]=_[_0x94f9('0x33')](_0x59e143[_0x94f9('0x2f')],qs[_0x94f9('0x34')](_0x2227ee[_0x94f9('0x30')]['fields']));_0x5d6e1d[_0x94f9('0x32')]=_0x5d6e1d[_0x94f9('0x32')]['length']?_0x5d6e1d[_0x94f9('0x32')]:_0x59e143['model'];if(!_0x2227ee[_0x94f9('0x30')][_0x94f9('0x35')](_0x94f9('0x36'))){_0x5d6e1d['limit']=qs[_0x94f9('0x1e')](_0x2227ee[_0x94f9('0x30')][_0x94f9('0x1e')]);_0x5d6e1d[_0x94f9('0x1d')]=qs['offset'](_0x2227ee[_0x94f9('0x30')][_0x94f9('0x1d')]);}_0x5d6e1d[_0x94f9('0x37')]=qs[_0x94f9('0x38')](_0x2227ee['query'][_0x94f9('0x38')]);_0x5d6e1d[_0x94f9('0x39')]=qs[_0x94f9('0x31')](_[_0x94f9('0x3a')](_0x2227ee[_0x94f9('0x30')],_0x59e143[_0x94f9('0x31')]),_0x3f85f1);if(_0x2227ee[_0x94f9('0x30')][_0x94f9('0x3b')]){_0x5d6e1d[_0x94f9('0x39')]=_[_0x94f9('0x3c')](_0x5d6e1d[_0x94f9('0x39')],{'$or':_[_0x94f9('0x29')](_0x3f85f1,function(_0x40bb62){if(_0x40bb62[_0x94f9('0x2d')]!==_0x94f9('0x3d')){var _0x3d5f91={};_0x3d5f91[_0x40bb62[_0x94f9('0x27')]]={'$like':'%'+_0x2227ee[_0x94f9('0x30')][_0x94f9('0x3b')]+'%'};return _0x3d5f91;}})});}_0x5d6e1d=_['merge']({},_0x5d6e1d,_0x2227ee[_0x94f9('0x3e')]);var _0x12e3e0={'where':_0x5d6e1d[_0x94f9('0x39')]};return db[_0x94f9('0x2a')][_0x94f9('0x3f')](_0x12e3e0)['then'](function(_0x466154){_0x24d28b[_0x94f9('0x3f')]=_0x466154;if(_0x2227ee['query']['includeAll']){_0x5d6e1d[_0x94f9('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0x94f9('0x41')](_0x5d6e1d);})[_0x94f9('0x23')](function(_0x5b4dab){_0x24d28b[_0x94f9('0x42')]=_0x5b4dab;return _0x24d28b;})['then'](respondWithFilteredResult(_0x46157f,_0x5d6e1d))[_0x94f9('0x43')](handleError(_0x46157f,null));};exports[_0x94f9('0x44')]=function(_0x40d338,_0xcdfe01){var _0x1e03d2={'raw':!![],'where':{'id':_0x40d338[_0x94f9('0x45')]['id']}},_0x483c5f={};_0x483c5f[_0x94f9('0x2f')]=_[_0x94f9('0x46')](db[_0x94f9('0x2a')]['rawAttributes']);_0x483c5f['query']=_[_0x94f9('0x46')](_0x40d338[_0x94f9('0x30')]);_0x483c5f[_0x94f9('0x31')]=_[_0x94f9('0x33')](_0x483c5f['model'],_0x483c5f[_0x94f9('0x30')]);_0x1e03d2['attributes']=_[_0x94f9('0x33')](_0x483c5f['model'],qs[_0x94f9('0x34')](_0x40d338[_0x94f9('0x30')][_0x94f9('0x34')]));_0x1e03d2[_0x94f9('0x32')]=_0x1e03d2[_0x94f9('0x32')]['length']?_0x1e03d2['attributes']:_0x483c5f[_0x94f9('0x2f')];if(_0x40d338['query']['includeAll']){_0x1e03d2['include']=[{'all':!![]}];}_0x1e03d2=_[_0x94f9('0x3c')]({},_0x1e03d2,_0x40d338['options']);return db['FreshsalesField'][_0x94f9('0x47')](_0x1e03d2)[_0x94f9('0x23')](handleEntityNotFound(_0xcdfe01,null))[_0x94f9('0x23')](respondWithResult(_0xcdfe01,null))[_0x94f9('0x43')](handleError(_0xcdfe01,null));};exports['create']=function(_0x2746b3,_0x54c1f4){return db[_0x94f9('0x2a')][_0x94f9('0x48')](_0x2746b3[_0x94f9('0x49')],{})['then'](respondWithResult(_0x54c1f4,0xc9))[_0x94f9('0x43')](handleError(_0x54c1f4,null));};exports[_0x94f9('0x22')]=function(_0x3614e6,_0x105cfe){if(_0x3614e6[_0x94f9('0x49')]['id']){delete _0x3614e6['body']['id'];}return db['FreshsalesField']['find']({'where':{'id':_0x3614e6[_0x94f9('0x45')]['id']}})[_0x94f9('0x23')](handleEntityNotFound(_0x105cfe,null))['then'](saveUpdates(_0x3614e6['body'],null))[_0x94f9('0x23')](respondWithResult(_0x105cfe,null))[_0x94f9('0x43')](handleError(_0x105cfe,null));};exports['destroy']=function(_0x5032f9,_0x38bdb1){return db[_0x94f9('0x2a')][_0x94f9('0x47')]({'where':{'id':_0x5032f9[_0x94f9('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bdb1,null))[_0x94f9('0x23')](removeEntity(_0x38bdb1,null))[_0x94f9('0x43')](handleError(_0x38bdb1,null));}; \ No newline at end of file +var _0xe1d8=['rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','FreshsalesField','count','include','findAll','rows','catch','show','params','includeAll','create','body','find','html-pdf'];(function(_0x567942,_0x509e81){var _0x1a46d0=function(_0x1e2de3){while(--_0x1e2de3){_0x567942['push'](_0x567942['shift']());}};_0x1a46d0(++_0x509e81);}(_0xe1d8,0x91));var _0x8e1d=function(_0x120ca9,_0x428221){_0x120ca9=_0x120ca9-0x0;var _0x11b25e=_0xe1d8[_0x120ca9];return _0x11b25e;};'use strict';var pdf=require(_0x8e1d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8e1d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e1d('0x2'));var rp=require(_0x8e1d('0x3'));var moment=require('moment');var BPromise=require(_0x8e1d('0x4'));var Mustache=require(_0x8e1d('0x5'));var util=require(_0x8e1d('0x6'));var path=require(_0x8e1d('0x7'));var sox=require(_0x8e1d('0x8'));var csv=require(_0x8e1d('0x9'));var ejs=require(_0x8e1d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8e1d('0xb'));var crypto=require(_0x8e1d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8e1d('0x9'));var querystring=require(_0x8e1d('0xd'));var Papa=require(_0x8e1d('0xe'));var Redis=require('ioredis');var authService=require(_0x8e1d('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e1d('0x10'));var logger=require('../../config/logger')(_0x8e1d('0x11'));var utils=require(_0x8e1d('0x12'));var config=require(_0x8e1d('0x13'));var db=require(_0x8e1d('0x14'))['db'];function respondWithStatusCode(_0x2a6139,_0x27f6e9){_0x27f6e9=_0x27f6e9||0xcc;return function(_0x3dfb79){if(_0x3dfb79){return _0x2a6139[_0x8e1d('0x15')](_0x27f6e9);}return _0x2a6139[_0x8e1d('0x16')](_0x27f6e9)[_0x8e1d('0x17')]();};}function respondWithResult(_0x5d61d9,_0x2ef567){_0x2ef567=_0x2ef567||0xc8;return function(_0x495bfb){if(_0x495bfb){return _0x5d61d9[_0x8e1d('0x16')](_0x2ef567)[_0x8e1d('0x18')](_0x495bfb);}};}function respondWithFilteredResult(_0x4bb301,_0x62edde){return function(_0x4bc78a){if(_0x4bc78a){var _0x4ecec3=_0x4bc78a['count'],_0x2463a2=_0x62edde[_0x8e1d('0x19')],_0x281673=_0x62edde[_0x8e1d('0x19')]+_0x62edde[_0x8e1d('0x1a')],_0x154942;if(_0x281673>=_0x4ecec3){_0x281673=_0x4ecec3;_0x154942=0xc8;}else{_0x154942=0xce;}_0x4bb301[_0x8e1d('0x16')](_0x154942);return _0x4bb301[_0x8e1d('0x1b')](_0x8e1d('0x1c'),_0x2463a2+'-'+_0x281673+'/'+_0x4ecec3)[_0x8e1d('0x18')](_0x4bc78a);}return null;};}function patchUpdates(_0xe505db){return function(_0xd40bb9){try{jsonpatch[_0x8e1d('0x1d')](_0xd40bb9,_0xe505db,!![]);}catch(_0x58a848){return BPromise[_0x8e1d('0x1e')](_0x58a848);}return _0xd40bb9[_0x8e1d('0x1f')]();};}function saveUpdates(_0x482636,_0x343af1){return function(_0x1336dd){if(_0x1336dd){return _0x1336dd[_0x8e1d('0x20')](_0x482636)[_0x8e1d('0x21')](function(_0x3acab){return _0x3acab;});}return null;};}function removeEntity(_0x3a9894,_0x1aa544){return function(_0x7d4e2f){if(_0x7d4e2f){return _0x7d4e2f[_0x8e1d('0x22')]()[_0x8e1d('0x21')](function(){_0x3a9894['status'](0xcc)[_0x8e1d('0x17')]();});}};}function handleEntityNotFound(_0x5d5ce6,_0x5adf1c){return function(_0x20c12a){if(!_0x20c12a){_0x5d5ce6[_0x8e1d('0x15')](0x194);}return _0x20c12a;};}function handleError(_0x27af8c,_0x24f9a6){_0x24f9a6=_0x24f9a6||0x1f4;return function(_0x109ed4){logger[_0x8e1d('0x23')](_0x109ed4[_0x8e1d('0x24')]);if(_0x109ed4[_0x8e1d('0x25')]){delete _0x109ed4[_0x8e1d('0x25')];}_0x27af8c[_0x8e1d('0x16')](_0x24f9a6)[_0x8e1d('0x26')](_0x109ed4);};}exports[_0x8e1d('0x27')]=function(_0x3816bf,_0xea9151){var _0x537d65={},_0x4fe8a2={},_0x43f4a2={'count':0x0,'rows':[]};var _0x3f47b1=_[_0x8e1d('0x28')](db['FreshsalesField']['rawAttributes'],function(_0x3ea3f1){return{'name':_0x3ea3f1['fieldName'],'type':_0x3ea3f1[_0x8e1d('0x29')][_0x8e1d('0x2a')]};});_0x4fe8a2[_0x8e1d('0x2b')]=_[_0x8e1d('0x28')](_0x3f47b1,_0x8e1d('0x25'));_0x4fe8a2[_0x8e1d('0x2c')]=_[_0x8e1d('0x2d')](_0x3816bf[_0x8e1d('0x2c')]);_0x4fe8a2['filters']=_[_0x8e1d('0x2e')](_0x4fe8a2['model'],_0x4fe8a2[_0x8e1d('0x2c')]);_0x537d65[_0x8e1d('0x2f')]=_['intersection'](_0x4fe8a2['model'],qs[_0x8e1d('0x30')](_0x3816bf['query']['fields']));_0x537d65['attributes']=_0x537d65['attributes'][_0x8e1d('0x31')]?_0x537d65[_0x8e1d('0x2f')]:_0x4fe8a2[_0x8e1d('0x2b')];if(!_0x3816bf[_0x8e1d('0x2c')][_0x8e1d('0x32')](_0x8e1d('0x33'))){_0x537d65['limit']=qs[_0x8e1d('0x1a')](_0x3816bf[_0x8e1d('0x2c')][_0x8e1d('0x1a')]);_0x537d65[_0x8e1d('0x19')]=qs[_0x8e1d('0x19')](_0x3816bf[_0x8e1d('0x2c')]['offset']);}_0x537d65[_0x8e1d('0x34')]=qs[_0x8e1d('0x35')](_0x3816bf[_0x8e1d('0x2c')][_0x8e1d('0x35')]);_0x537d65[_0x8e1d('0x36')]=qs[_0x8e1d('0x37')](_[_0x8e1d('0x38')](_0x3816bf['query'],_0x4fe8a2[_0x8e1d('0x37')]),_0x3f47b1);if(_0x3816bf['query'][_0x8e1d('0x39')]){_0x537d65[_0x8e1d('0x36')]=_['merge'](_0x537d65['where'],{'$or':_[_0x8e1d('0x28')](_0x3f47b1,function(_0x4fed21){if(_0x4fed21[_0x8e1d('0x29')]!==_0x8e1d('0x3a')){var _0x5c231e={};_0x5c231e[_0x4fed21[_0x8e1d('0x25')]]={'$like':'%'+_0x3816bf[_0x8e1d('0x2c')][_0x8e1d('0x39')]+'%'};return _0x5c231e;}})});}_0x537d65=_[_0x8e1d('0x3b')]({},_0x537d65,_0x3816bf[_0x8e1d('0x3c')]);var _0x201c27={'where':_0x537d65[_0x8e1d('0x36')]};return db[_0x8e1d('0x3d')][_0x8e1d('0x3e')](_0x201c27)[_0x8e1d('0x21')](function(_0x392369){_0x43f4a2[_0x8e1d('0x3e')]=_0x392369;if(_0x3816bf[_0x8e1d('0x2c')]['includeAll']){_0x537d65[_0x8e1d('0x3f')]=[{'all':!![]}];}return db[_0x8e1d('0x3d')][_0x8e1d('0x40')](_0x537d65);})[_0x8e1d('0x21')](function(_0x593b74){_0x43f4a2[_0x8e1d('0x41')]=_0x593b74;return _0x43f4a2;})[_0x8e1d('0x21')](respondWithFilteredResult(_0xea9151,_0x537d65))[_0x8e1d('0x42')](handleError(_0xea9151,null));};exports[_0x8e1d('0x43')]=function(_0x1ba2e1,_0x1c0a8f){var _0x4f7ec2={'raw':!![],'where':{'id':_0x1ba2e1[_0x8e1d('0x44')]['id']}},_0x47c264={};_0x47c264[_0x8e1d('0x2b')]=_[_0x8e1d('0x2d')](db[_0x8e1d('0x3d')]['rawAttributes']);_0x47c264[_0x8e1d('0x2c')]=_[_0x8e1d('0x2d')](_0x1ba2e1[_0x8e1d('0x2c')]);_0x47c264[_0x8e1d('0x37')]=_[_0x8e1d('0x2e')](_0x47c264[_0x8e1d('0x2b')],_0x47c264[_0x8e1d('0x2c')]);_0x4f7ec2[_0x8e1d('0x2f')]=_[_0x8e1d('0x2e')](_0x47c264[_0x8e1d('0x2b')],qs['fields'](_0x1ba2e1['query'][_0x8e1d('0x30')]));_0x4f7ec2[_0x8e1d('0x2f')]=_0x4f7ec2['attributes'][_0x8e1d('0x31')]?_0x4f7ec2[_0x8e1d('0x2f')]:_0x47c264[_0x8e1d('0x2b')];if(_0x1ba2e1['query'][_0x8e1d('0x45')]){_0x4f7ec2['include']=[{'all':!![]}];}_0x4f7ec2=_[_0x8e1d('0x3b')]({},_0x4f7ec2,_0x1ba2e1[_0x8e1d('0x3c')]);return db[_0x8e1d('0x3d')]['find'](_0x4f7ec2)['then'](handleEntityNotFound(_0x1c0a8f,null))[_0x8e1d('0x21')](respondWithResult(_0x1c0a8f,null))[_0x8e1d('0x42')](handleError(_0x1c0a8f,null));};exports['create']=function(_0x5c6956,_0xe1be3a){return db[_0x8e1d('0x3d')][_0x8e1d('0x46')](_0x5c6956[_0x8e1d('0x47')],{})[_0x8e1d('0x21')](respondWithResult(_0xe1be3a,0xc9))[_0x8e1d('0x42')](handleError(_0xe1be3a,null));};exports['update']=function(_0x1ad844,_0x1f60bc){if(_0x1ad844[_0x8e1d('0x47')]['id']){delete _0x1ad844['body']['id'];}return db['FreshsalesField'][_0x8e1d('0x48')]({'where':{'id':_0x1ad844['params']['id']}})['then'](handleEntityNotFound(_0x1f60bc,null))['then'](saveUpdates(_0x1ad844[_0x8e1d('0x47')],null))['then'](respondWithResult(_0x1f60bc,null))[_0x8e1d('0x42')](handleError(_0x1f60bc,null));};exports[_0x8e1d('0x22')]=function(_0xe6dd7a,_0x40918d){return db[_0x8e1d('0x3d')][_0x8e1d('0x48')]({'where':{'id':_0xe6dd7a['params']['id']}})['then'](handleEntityNotFound(_0x40918d,null))[_0x8e1d('0x21')](removeEntity(_0x40918d,null))[_0x8e1d('0x42')](handleError(_0x40918d,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index e48828e..8958d6e 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 _0x186f=['../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x530418,_0x5f4046){var _0x5535d2=function(_0x4ce14d){while(--_0x4ce14d){_0x530418['push'](_0x530418['shift']());}};_0x5535d2(++_0x5f4046);}(_0x186f,0x9d));var _0xf186=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x186f[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf186('0x0'));var util=require(_0xf186('0x1'));var logger=require(_0xf186('0x2'))('api');var moment=require(_0xf186('0x3'));var BPromise=require(_0xf186('0x4'));var rp=require(_0xf186('0x5'));var fs=require('fs');var path=require(_0xf186('0x6'));var rimraf=require(_0xf186('0x7'));var config=require(_0xf186('0x8'));var attributes=require(_0xf186('0x9'));module['exports']=function(_0x532514,_0x811370){return _0x532514[_0xf186('0xa')](_0xf186('0xb'),attributes,{'tableName':_0xf186('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xf186('0xd'),_0xf186('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7209=['exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','request-promise','path','../../config/environment','./intFreshsalesField.attributes'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x7209,0x6e));var _0x9720=function(_0x1117a6,_0x9199b3){_0x1117a6=_0x1117a6-0x0;var _0x505a67=_0x7209[_0x1117a6];return _0x505a67;};'use strict';var _=require(_0x9720('0x0'));var util=require(_0x9720('0x1'));var logger=require(_0x9720('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9720('0x3'));var fs=require('fs');var path=require(_0x9720('0x4'));var rimraf=require('rimraf');var config=require(_0x9720('0x5'));var attributes=require(_0x9720('0x6'));module[_0x9720('0x7')]=function(_0x18b8b0,_0x51038f){return _0x18b8b0[_0x9720('0x8')](_0x9720('0x9'),attributes,{'tableName':_0x9720('0xa'),'paranoid':![],'indexes':[{'name':_0x9720('0xb'),'fields':['idField',_0x9720('0xc')],'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 d7d0533..de3cb72 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 _0x6c57=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesField,\x20%s,\x20%s'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x6c57,0x76));var _0x76c5=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x6c57[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x76c5('0x0'));var util=require(_0x76c5('0x1'));var moment=require(_0x76c5('0x2'));var BPromise=require(_0x76c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x76c5('0x4'));var db=require(_0x76c5('0x5'))['db'];var utils=require(_0x76c5('0x6'));var logger=require(_0x76c5('0x7'))(_0x76c5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76c5('0x9')][_0x76c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3602a8,_0x4cf6ea,_0x374cd5){return new BPromise(function(_0x27885a,_0x3f58b5){return client[_0x76c5('0xb')](_0x3602a8,_0x374cd5)[_0x76c5('0xc')](function(_0x2dd12d){logger[_0x76c5('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4cf6ea,_0x76c5('0xe'));logger[_0x76c5('0xf')](_0x76c5('0x10'),_0x4cf6ea,_0x76c5('0xe'),JSON[_0x76c5('0x11')](_0x2dd12d));if(_0x2dd12d[_0x76c5('0x12')]){if(_0x2dd12d['error']['code']===0x1f4){logger['error'](_0x76c5('0x13'),_0x4cf6ea,_0x2dd12d['error'][_0x76c5('0x14')]);return _0x3f58b5(_0x2dd12d[_0x76c5('0x12')][_0x76c5('0x14')]);}logger['error'](_0x76c5('0x13'),_0x4cf6ea,_0x2dd12d['error']['message']);return _0x27885a(_0x2dd12d[_0x76c5('0x12')][_0x76c5('0x14')]);}else{logger[_0x76c5('0xd')](_0x76c5('0x13'),_0x4cf6ea,_0x76c5('0xe'));_0x27885a(_0x2dd12d[_0x76c5('0x15')][_0x76c5('0x14')]);}})[_0x76c5('0x16')](function(_0x4e8d0d){logger[_0x76c5('0x12')](_0x76c5('0x13'),_0x4cf6ea,_0x4e8d0d);_0x3f58b5(_0x4e8d0d);});});} \ No newline at end of file +var _0x97e9=['request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x452b3e,_0x173a18){var _0x3fe701=function(_0xf2995d){while(--_0xf2995d){_0x452b3e['push'](_0x452b3e['shift']());}};_0x3fe701(++_0x173a18);}(_0x97e9,0x15c));var _0x997e=function(_0xbc4543,_0x4c9e4f){_0xbc4543=_0xbc4543-0x0;var _0x469773=_0x97e9[_0xbc4543];return _0x469773;};'use strict';var _=require(_0x997e('0x0'));var util=require(_0x997e('0x1'));var moment=require(_0x997e('0x2'));var BPromise=require(_0x997e('0x3'));var rs=require(_0x997e('0x4'));var fs=require('fs');var Redis=require(_0x997e('0x5'));var db=require(_0x997e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x997e('0x7'))(_0x997e('0x8'));var config=require(_0x997e('0x9'));var jayson=require(_0x997e('0xa'));var client=jayson['client'][_0x997e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2918f4,_0x565031,_0x45fe54){return new BPromise(function(_0x25ae66,_0x56773c){return client[_0x997e('0xc')](_0x2918f4,_0x45fe54)[_0x997e('0xd')](function(_0x2bb692){logger['info'](_0x997e('0xe'),_0x565031,_0x997e('0xf'));logger[_0x997e('0x10')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x565031,'request\x20sent',JSON[_0x997e('0x11')](_0x2bb692));if(_0x2bb692[_0x997e('0x12')]){if(_0x2bb692[_0x997e('0x12')][_0x997e('0x13')]===0x1f4){logger[_0x997e('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x565031,_0x2bb692['error'][_0x997e('0x14')]);return _0x56773c(_0x2bb692[_0x997e('0x12')]['message']);}logger[_0x997e('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x565031,_0x2bb692[_0x997e('0x12')][_0x997e('0x14')]);return _0x25ae66(_0x2bb692[_0x997e('0x12')][_0x997e('0x14')]);}else{logger[_0x997e('0x15')](_0x997e('0xe'),_0x565031,'request\x20sent');_0x25ae66(_0x2bb692[_0x997e('0x16')]['message']);}})[_0x997e('0x17')](function(_0x521c5d){logger[_0x997e('0x12')](_0x997e('0xe'),_0x565031,_0x521c5d);_0x56773c(_0x521c5d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b652085..97d8fb0 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 _0x29cd=['addConfiguration','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','create','post'];(function(_0x3a1712,_0x251664){var _0x1dc6dd=function(_0x54f295){while(--_0x54f295){_0x3a1712['push'](_0x3a1712['shift']());}};_0x1dc6dd(++_0x251664);}(_0x29cd,0x17b));var _0xd29c=function(_0x244d9d,_0x20f5c5){_0x244d9d=_0x244d9d-0x0;var _0x4d2b74=_0x29cd[_0x244d9d];return _0x4d2b74;};'use strict';var multer=require(_0xd29c('0x0'));var util=require('util');var path=require(_0xd29c('0x1'));var timeout=require(_0xd29c('0x2'));var express=require(_0xd29c('0x3'));var router=express[_0xd29c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd29c('0x5'));var config=require(_0xd29c('0x6'));var controller=require('./intSalesforceAccount.controller');router['get']('/',auth[_0xd29c('0x7')](),controller[_0xd29c('0x8')]);router[_0xd29c('0x9')](_0xd29c('0xa'),auth['isAuthenticated'](),controller[_0xd29c('0xb')]);router[_0xd29c('0x9')](_0xd29c('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xd29c('0x9')](_0xd29c('0xd'),auth[_0xd29c('0x7')](),controller[_0xd29c('0xe')]);router['post']('/',auth[_0xd29c('0x7')](),controller[_0xd29c('0xf')]);router[_0xd29c('0x10')](_0xd29c('0xc'),auth[_0xd29c('0x7')](),controller[_0xd29c('0x11')]);router[_0xd29c('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd29c('0x13')]);router[_0xd29c('0x14')]('/:id',auth[_0xd29c('0x7')](),controller['destroy']);module[_0xd29c('0x15')]=router; \ No newline at end of file +var _0xc2b2=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x3ccfbb,_0x583ac2){var _0x251eb0=function(_0x2b8f95){while(--_0x2b8f95){_0x3ccfbb['push'](_0x3ccfbb['shift']());}};_0x251eb0(++_0x583ac2);}(_0xc2b2,0xd3));var _0x2c2b=function(_0x5a9de9,_0x5a9714){_0x5a9de9=_0x5a9de9-0x0;var _0x295d6d=_0xc2b2[_0x5a9de9];return _0x295d6d;};'use strict';var multer=require(_0x2c2b('0x0'));var util=require(_0x2c2b('0x1'));var path=require(_0x2c2b('0x2'));var timeout=require(_0x2c2b('0x3'));var express=require(_0x2c2b('0x4'));var router=express[_0x2c2b('0x5')]();var auth=require(_0x2c2b('0x6'));var interaction=require(_0x2c2b('0x7'));var config=require(_0x2c2b('0x8'));var controller=require('./intSalesforceAccount.controller');router[_0x2c2b('0x9')]('/',auth[_0x2c2b('0xa')](),controller[_0x2c2b('0xb')]);router[_0x2c2b('0x9')](_0x2c2b('0xc'),auth['isAuthenticated'](),controller[_0x2c2b('0xd')]);router[_0x2c2b('0x9')]('/:id/configurations',auth[_0x2c2b('0xa')](),controller[_0x2c2b('0xe')]);router[_0x2c2b('0x9')](_0x2c2b('0xf'),auth[_0x2c2b('0xa')](),controller[_0x2c2b('0x10')]);router[_0x2c2b('0x11')]('/',auth['isAuthenticated'](),controller[_0x2c2b('0x12')]);router[_0x2c2b('0x11')](_0x2c2b('0x13'),auth[_0x2c2b('0xa')](),controller[_0x2c2b('0x14')]);router[_0x2c2b('0x15')](_0x2c2b('0xc'),auth['isAuthenticated'](),controller[_0x2c2b('0x16')]);router[_0x2c2b('0x17')](_0x2c2b('0xc'),auth['isAuthenticated'](),controller[_0x2c2b('0x18')]);module[_0x2c2b('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index ce3ffc2..2e469d5 100644 --- a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js +++ b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x27e5ff,_0x4c1442){var _0x20ccdf=function(_0x5a9c2f){while(--_0x5a9c2f){_0x27e5ff['push'](_0x27e5ff['shift']());}};_0x20ccdf(++_0x4c1442);}(_0x1cb9,0x14e));var _0x91cb=function(_0x20c4af,_0x4509fc){_0x20c4af=_0x20c4af-0x0;var _0x4e5bee=_0x1cb9[_0x20c4af];return _0x4e5bee;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')]},'description':{'type':Sequelize[_0x91cb('0x1')]},'username':{'type':Sequelize[_0x91cb('0x1')],'unique':_0x91cb('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x91cb('0x1')]},'clientId':{'type':Sequelize[_0x91cb('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x91cb('0x1')]},'serverUrl':{'type':Sequelize[_0x91cb('0x1')]},'type':{'type':Sequelize[_0x91cb('0x3')](_0x91cb('0x4'),_0x91cb('0x5')),'defaultValue':_0x91cb('0x4')}}; \ No newline at end of file +var _0x814b=['STRING','username','ENUM','newTab','integrationTab','sequelize','exports'];(function(_0x5aef17,_0x592cd4){var _0x43f9d0=function(_0x49ea9c){while(--_0x49ea9c){_0x5aef17['push'](_0x5aef17['shift']());}};_0x43f9d0(++_0x592cd4);}(_0x814b,0x1a2));var _0xb814=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x814b[_0x383356];return _0x32ee5a;};'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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 5398384..c2d8a2b 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 _0x8883=['SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientSecret','username','password','securityToken','lastIndexOf','clientId','ticketType','sobject','CallDisposition','CallObject','Type','Case','Reason','Status','Priority','IsEscalated','SuppliedName','remove','custom','includes','picklistValues','label','value','boolean','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../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~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne'];(function(_0x733c97,_0x40f9e7){var _0x57c50f=function(_0x116817){while(--_0x116817){_0x733c97['push'](_0x733c97['shift']());}};_0x57c50f(++_0x40f9e7);}(_0x8883,0xb0));var _0x3888=function(_0x3ee7e4,_0x40ae01){_0x3ee7e4=_0x3ee7e4-0x0;var _0x41ac03=_0x8883[_0x3ee7e4];return _0x41ac03;};'use strict';var pdf=require(_0x3888('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3888('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3888('0x2'));var BPromise=require(_0x3888('0x3'));var Mustache=require(_0x3888('0x4'));var util=require(_0x3888('0x5'));var path=require(_0x3888('0x6'));var sox=require(_0x3888('0x7'));var csv=require(_0x3888('0x8'));var ejs=require(_0x3888('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3888('0xa'));var crypto=require('crypto');var jsforce=require(_0x3888('0xb'));var deskjs=require(_0x3888('0xc'));var toCsv=require(_0x3888('0x8'));var querystring=require(_0x3888('0xd'));var Papa=require(_0x3888('0xe'));var Redis=require(_0x3888('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3888('0x10'));var as=require(_0x3888('0x11'));var hardwareService=require(_0x3888('0x12'));var logger=require(_0x3888('0x13'))(_0x3888('0x14'));var utils=require(_0x3888('0x15'));var config=require(_0x3888('0x16'));var db=require(_0x3888('0x17'))['db'];var integrations=require(_0x3888('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x3888('0x19')][_0x3888('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3da633,_0x5efe03,_0x29c472){if(_0x29c472){var _0x120da9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x120da9[_0x3888('0x1b')](_0x5efe03)){return _0x3da633;}else{throw new db[(_0x3888('0x1c'))]['ValidationError'](_0x3888('0x1d'));}}else{return _0x3da633;}}function respondWithRpcPromise(_0x6830f,_0x82b6dd,_0x272932,_0x33518d){return new BPromise(function(_0x537acc,_0x3614ca){var _0x51ff09=_0x33518d||client;return _0x51ff09[_0x3888('0x1e')](_0x6830f,_0x272932)[_0x3888('0x1f')](function(_0x401010){logger[_0x3888('0x20')](_0x3888('0x21'),_0x82b6dd,_0x3888('0x22'));logger['debug'](_0x3888('0x23'),_0x82b6dd,_0x3888('0x22'),JSON[_0x3888('0x24')](_0x401010));if(_0x401010['error']){if(_0x401010[_0x3888('0x25')][_0x3888('0x26')]===0x1f4){logger[_0x3888('0x25')](_0x3888('0x21'),_0x82b6dd,_0x401010[_0x3888('0x25')][_0x3888('0x27')]);return _0x3614ca(_0x401010['error'][_0x3888('0x27')]);}logger[_0x3888('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x82b6dd,_0x401010['error'][_0x3888('0x27')]);return _0x537acc(_0x401010[_0x3888('0x25')][_0x3888('0x27')]);}else{logger[_0x3888('0x20')](_0x3888('0x21'),_0x82b6dd,_0x3888('0x22'));_0x537acc(_0x401010[_0x3888('0x28')][_0x3888('0x27')]);}})['catch'](function(_0x24c278){logger[_0x3888('0x25')](_0x3888('0x21'),_0x82b6dd,_0x24c278);_0x3614ca(_0x24c278);});});}function respondWithStatusCode(_0x51782a,_0x12d655){_0x12d655=_0x12d655||0xcc;return function(_0xbee2c0){if(_0xbee2c0){return _0x51782a['sendStatus'](_0x12d655);}return _0x51782a['status'](_0x12d655)[_0x3888('0x29')]();};}function respondWithResult(_0x5199b8,_0x355848){_0x355848=_0x355848||0xc8;return function(_0x19c578){if(_0x19c578){return _0x5199b8[_0x3888('0x2a')](_0x355848)[_0x3888('0x2b')](_0x19c578);}};}function respondWithFilteredResult(_0x20bcc2,_0x558062){return function(_0x150160){if(_0x150160){var _0xa98f25=_0x150160[_0x3888('0x2c')],_0x11261a=_0x558062[_0x3888('0x2d')],_0x145595=_0x558062['offset']+_0x558062[_0x3888('0x2e')],_0x427607;if(_0x145595>=_0xa98f25){_0x145595=_0xa98f25;_0x427607=0xc8;}else{_0x427607=0xce;}_0x20bcc2[_0x3888('0x2a')](_0x427607);return _0x20bcc2[_0x3888('0x2f')](_0x3888('0x30'),_0x11261a+'-'+_0x145595+'/'+_0xa98f25)[_0x3888('0x2b')](_0x150160);}return null;};}function patchUpdates(_0x51bbf0){return function(_0x39ad29){try{jsonpatch['apply'](_0x39ad29,_0x51bbf0,!![]);}catch(_0x1b18f2){return BPromise[_0x3888('0x31')](_0x1b18f2);}return _0x39ad29[_0x3888('0x32')]();};}function saveUpdates(_0x22f685,_0x53de15){return function(_0x5d276e){if(_0x5d276e){return _0x5d276e[_0x3888('0x33')](_0x22f685)['then'](function(_0x44b55a){return _0x44b55a;});}return null;};}function removeEntity(_0x2d02da,_0xf583b6){return function(_0x50a200){if(_0x50a200){return _0x50a200[_0x3888('0x34')]()[_0x3888('0x1f')](function(){_0x2d02da[_0x3888('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150513,_0xdb7796){return function(_0x7c141d){if(!_0x7c141d){_0x150513[_0x3888('0x35')](0x194);}return _0x7c141d;};}function handleError(_0x44a6f2,_0x3ae264){_0x3ae264=_0x3ae264||0x1f4;return function(_0x67389d){logger[_0x3888('0x25')](_0x67389d[_0x3888('0x36')]);if(_0x67389d[_0x3888('0x37')]){delete _0x67389d[_0x3888('0x37')];}_0x44a6f2[_0x3888('0x2a')](_0x3ae264)[_0x3888('0x38')](_0x67389d);};}exports[_0x3888('0x39')]=function(_0xe09130,_0x687fdc){var _0x16cb26={},_0x4e3f6a={},_0x188b6={'count':0x0,'rows':[]};var _0x5dd8c6=_[_0x3888('0x3a')](db[_0x3888('0x3b')][_0x3888('0x3c')],function(_0x2d7184){return{'name':_0x2d7184[_0x3888('0x3d')],'type':_0x2d7184[_0x3888('0x3e')][_0x3888('0x3f')]};});_0x4e3f6a[_0x3888('0x40')]=_[_0x3888('0x3a')](_0x5dd8c6,_0x3888('0x37'));_0x4e3f6a[_0x3888('0x41')]=_['keys'](_0xe09130[_0x3888('0x41')]);_0x4e3f6a[_0x3888('0x42')]=_[_0x3888('0x43')](_0x4e3f6a[_0x3888('0x40')],_0x4e3f6a[_0x3888('0x41')]);_0x16cb26[_0x3888('0x44')]=_[_0x3888('0x43')](_0x4e3f6a[_0x3888('0x40')],qs[_0x3888('0x45')](_0xe09130[_0x3888('0x41')][_0x3888('0x45')]));_0x16cb26['attributes']=_0x16cb26[_0x3888('0x44')][_0x3888('0x46')]?_0x16cb26[_0x3888('0x44')]:_0x4e3f6a[_0x3888('0x40')];if(!_0xe09130[_0x3888('0x41')][_0x3888('0x47')](_0x3888('0x48'))){_0x16cb26[_0x3888('0x2e')]=qs[_0x3888('0x2e')](_0xe09130[_0x3888('0x41')][_0x3888('0x2e')]);_0x16cb26[_0x3888('0x2d')]=qs['offset'](_0xe09130[_0x3888('0x41')][_0x3888('0x2d')]);}_0x16cb26[_0x3888('0x49')]=qs['sort'](_0xe09130[_0x3888('0x41')][_0x3888('0x4a')]);_0x16cb26[_0x3888('0x4b')]=qs[_0x3888('0x42')](_[_0x3888('0x4c')](_0xe09130['query'],_0x4e3f6a[_0x3888('0x42')]),_0x5dd8c6);if(_0xe09130[_0x3888('0x41')][_0x3888('0x4d')]){_0x16cb26[_0x3888('0x4b')]=_[_0x3888('0x4e')](_0x16cb26[_0x3888('0x4b')],{'$or':_[_0x3888('0x3a')](_0x5dd8c6,function(_0x391468){if(_0x391468[_0x3888('0x3e')]!=='VIRTUAL'){var _0x5e6bef={};_0x5e6bef[_0x391468[_0x3888('0x37')]]={'$like':'%'+_0xe09130[_0x3888('0x41')]['filter']+'%'};return _0x5e6bef;}})});}_0x16cb26=_[_0x3888('0x4e')]({},_0x16cb26,_0xe09130[_0x3888('0x4f')]);var _0x4f32f9={'where':_0x16cb26[_0x3888('0x4b')]};return db[_0x3888('0x3b')][_0x3888('0x2c')](_0x4f32f9)['then'](function(_0x1fb39f){_0x188b6[_0x3888('0x2c')]=_0x1fb39f;if(_0xe09130[_0x3888('0x41')][_0x3888('0x50')]){_0x16cb26[_0x3888('0x51')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x3888('0x52')](_0x16cb26);})[_0x3888('0x1f')](function(_0x59541d){_0x188b6[_0x3888('0x53')]=_0x59541d;return _0x188b6;})[_0x3888('0x1f')](respondWithFilteredResult(_0x687fdc,_0x16cb26))[_0x3888('0x54')](handleError(_0x687fdc,null));};exports[_0x3888('0x55')]=function(_0x54d74e,_0x221eda){var _0x2b6e71={'raw':![],'where':{'id':_0x54d74e[_0x3888('0x56')]['id']}},_0x233fde={};_0x233fde['model']=_[_0x3888('0x57')](db[_0x3888('0x3b')]['rawAttributes']);_0x233fde[_0x3888('0x41')]=_[_0x3888('0x57')](_0x54d74e[_0x3888('0x41')]);_0x233fde['filters']=_['intersection'](_0x233fde['model'],_0x233fde[_0x3888('0x41')]);_0x2b6e71[_0x3888('0x44')]=_[_0x3888('0x43')](_0x233fde[_0x3888('0x40')],qs[_0x3888('0x45')](_0x54d74e[_0x3888('0x41')]['fields']));_0x2b6e71[_0x3888('0x44')]=_0x2b6e71[_0x3888('0x44')][_0x3888('0x46')]?_0x2b6e71['attributes']:_0x233fde[_0x3888('0x40')];if(_0x54d74e[_0x3888('0x41')][_0x3888('0x50')]){_0x2b6e71['include']=[{'all':!![]}];}_0x2b6e71=_[_0x3888('0x4e')]({},_0x2b6e71,_0x54d74e[_0x3888('0x4f')]);return db[_0x3888('0x3b')][_0x3888('0x58')](_0x2b6e71)['then'](handleEntityNotFound(_0x221eda,null))[_0x3888('0x1f')](respondWithResult(_0x221eda,null))[_0x3888('0x54')](handleError(_0x221eda,null));};exports[_0x3888('0x59')]=function(_0x5a0454,_0x320288){return db['SalesforceAccount'][_0x3888('0x59')](_0x5a0454[_0x3888('0x5a')],{})['then'](respondWithResult(_0x320288,0xc9))['catch'](handleError(_0x320288,null));};exports[_0x3888('0x33')]=function(_0x1f548d,_0x1e4049){if(_0x1f548d[_0x3888('0x5a')]['id']){delete _0x1f548d['body']['id'];}return db[_0x3888('0x3b')][_0x3888('0x58')]({'where':{'id':_0x1f548d['params']['id']}})[_0x3888('0x1f')](handleEntityNotFound(_0x1e4049,null))[_0x3888('0x1f')](saveUpdates(_0x1f548d[_0x3888('0x5a')],null))[_0x3888('0x1f')](respondWithResult(_0x1e4049,null))[_0x3888('0x54')](handleError(_0x1e4049,null));};exports[_0x3888('0x34')]=function(_0x2fdb60,_0x641bc1){return db[_0x3888('0x3b')][_0x3888('0x58')]({'where':{'id':_0x2fdb60['params']['id']}})[_0x3888('0x1f')](handleEntityNotFound(_0x641bc1,null))['then'](removeEntity(_0x641bc1,null))[_0x3888('0x54')](handleError(_0x641bc1,null));};exports['getConfigurations']=function(_0x1938ab,_0x30ce46,_0x2804ef){var _0x5e909={};var _0x2a583a={};var _0x1b7c09;var _0x208817;return db[_0x3888('0x3b')][_0x3888('0x5b')]({'where':{'id':_0x1938ab[_0x3888('0x56')]['id']}})[_0x3888('0x1f')](handleEntityNotFound(_0x30ce46,null))[_0x3888('0x1f')](function(_0x4fe775){if(_0x4fe775){_0x1b7c09=_0x4fe775;_0x2a583a[_0x3888('0x40')]=_[_0x3888('0x57')](db[_0x3888('0x5c')][_0x3888('0x3c')]);_0x2a583a['query']=_['keys'](_0x1938ab['query']);_0x2a583a['filters']=_[_0x3888('0x43')](_0x2a583a[_0x3888('0x40')],_0x2a583a[_0x3888('0x41')]);_0x5e909[_0x3888('0x44')]=_[_0x3888('0x43')](_0x2a583a[_0x3888('0x40')],qs[_0x3888('0x45')](_0x1938ab[_0x3888('0x41')][_0x3888('0x45')]));_0x5e909[_0x3888('0x44')]=_0x5e909[_0x3888('0x44')][_0x3888('0x46')]?_0x5e909[_0x3888('0x44')]:_0x2a583a[_0x3888('0x40')];_0x5e909[_0x3888('0x49')]=qs['sort'](_0x1938ab[_0x3888('0x41')][_0x3888('0x4a')]);_0x5e909['where']=qs['filters'](_[_0x3888('0x4c')](_0x1938ab['query'],_0x2a583a[_0x3888('0x42')]));if(_0x1938ab['query'][_0x3888('0x4d')]){_0x5e909['where']=_[_0x3888('0x4e')](_0x5e909[_0x3888('0x4b')],{'$or':_[_0x3888('0x3a')](_0x5e909['attributes'],function(_0x8650d9){var _0x415146={};_0x415146[_0x8650d9]={'$like':'%'+_0x1938ab[_0x3888('0x41')][_0x3888('0x4d')]+'%'};return _0x415146;})});}_0x5e909=_[_0x3888('0x4e')]({},_0x5e909,_0x1938ab[_0x3888('0x4f')]);return _0x1b7c09[_0x3888('0x5d')](_0x5e909);}})[_0x3888('0x1f')](function(_0x35f895){if(_0x35f895){_0x208817=_0x35f895[_0x3888('0x46')];if(!_0x1938ab[_0x3888('0x41')][_0x3888('0x47')]('nolimit')){_0x5e909['limit']=qs['limit'](_0x1938ab['query']['limit']);_0x5e909[_0x3888('0x2d')]=qs['offset'](_0x1938ab[_0x3888('0x41')][_0x3888('0x2d')]);}return _0x1b7c09[_0x3888('0x5d')](_0x5e909);}})['then'](function(_0x124b67){if(_0x124b67){return _0x124b67?{'count':_0x208817,'rows':_0x124b67}:null;}})[_0x3888('0x1f')](respondWithResult(_0x30ce46,null))['catch'](handleError(_0x30ce46,null));};exports[_0x3888('0x5e')]=function(_0x1d6b50,_0x1ccc45,_0x548393){if(_0x1d6b50[_0x3888('0x5a')]['id']){delete _0x1d6b50[_0x3888('0x5a')]['id'];}return db[_0x3888('0x3b')][_0x3888('0x5b')]({'where':{'id':_0x1d6b50['params']['id']}})[_0x3888('0x1f')](handleEntityNotFound(_0x1ccc45,null))['then'](function(_0x56f08e){if(_0x56f08e){_0x1d6b50[_0x3888('0x5a')][_0x3888('0x5f')]=_0x56f08e['id'];_0x1d6b50[_0x3888('0x5a')][_0x3888('0x60')]=integrations[_0x3888('0x61')](_0x1d6b50[_0x3888('0x5a')][_0x3888('0x62')],_0x1d6b50[_0x3888('0x5a')][_0x3888('0x3e')]);_0x1d6b50[_0x3888('0x5a')]['Descriptions']=integrations[_0x3888('0x63')](_0x1d6b50[_0x3888('0x5a')][_0x3888('0x62')],_0x1d6b50[_0x3888('0x5a')]['type']);return db[_0x3888('0x5c')]['create'](_0x1d6b50[_0x3888('0x5a')],{'include':[{'model':db[_0x3888('0x64')],'as':_0x3888('0x60')},{'model':db[_0x3888('0x64')],'as':_0x3888('0x65')}]});}return null;})[_0x3888('0x1f')](respondWithResult(_0x1ccc45,null))[_0x3888('0x54')](handleError(_0x1ccc45,null));};exports[_0x3888('0x66')]=function(_0x2c6547,_0x2b72a0,_0x1066bb){var _0x2db398;var _0x169764='';var _0x56eb61=_0x3888('0x67');return db['SalesforceAccount'][_0x3888('0x5b')]({'where':{'id':_0x2c6547['params']['id']},'attributes':['id',_0x3888('0x68'),'clientId',_0x3888('0x69'),_0x3888('0x6a'),_0x3888('0x6b'),_0x3888('0x6c')]})[_0x3888('0x1f')](handleEntityNotFound(_0x2b72a0,null))[_0x3888('0x1f')](function(_0x2b34b1){if(_0x2b34b1){_0x169764=_0x2b34b1['remoteUri'];var _0x48c88a=_0x169764['slice'](-0x1);if(_0x48c88a==='/'){_0x169764=_0x169764['substring'](0x0,_0x169764[_0x3888('0x6d')](_0x48c88a));}_0x2db398=new jsforce['Connection']({'oauth2':{'loginUrl':_0x169764,'clientId':_0x2b34b1[_0x3888('0x6e')],'clientSecret':_0x2b34b1['clientSecret']}});return _0x2db398['login'](_0x2b34b1[_0x3888('0x6a')],_0x2b34b1[_0x3888('0x6b')]['concat'](_0x2b34b1[_0x3888('0x6c')]));}})[_0x3888('0x1f')](function(_0x4570bf){if(_0x4570bf){if(!_['isNil'](_0x2c6547[_0x3888('0x41')][_0x3888('0x6f')])){_0x56eb61=_0x2c6547[_0x3888('0x41')]['ticketType'];}return _0x2db398[_0x3888('0x70')](_0x56eb61)['describe']();}})[_0x3888('0x1f')](function(_0x4ca694){var _0x3beba8=[_0x3888('0x71'),'CallDurationInSeconds',_0x3888('0x72'),'CallType','IsArchived','Priority','Status',_0x3888('0x73')];if(!_['isNil'](_0x2c6547[_0x3888('0x41')]['ticketType'])&&_0x2c6547[_0x3888('0x41')][_0x3888('0x6f')]===_0x3888('0x74')){_0x3beba8=[_0x3888('0x73'),'Origin',_0x3888('0x75'),_0x3888('0x76'),_0x3888('0x77'),_0x3888('0x78'),_0x3888('0x79'),'SuppliedCompany'];}if(_0x4ca694){_[_0x3888('0x7a')](_0x4ca694[_0x3888('0x45')],function(_0x58cdf8){return _0x58cdf8[_0x3888('0x7b')]===![]&&!_0x3beba8[_0x3888('0x7c')](_0x58cdf8[_0x3888('0x37')]);});return{'count':_0x4ca694[_0x3888('0x45')]['length'],'rows':_['map'](_0x4ca694[_0x3888('0x45')],function(_0x256505){return{'id':_0x256505['name'],'name':_0x256505['label'],'custom':_0x256505[_0x3888('0x7b')],'options':_0x256505['picklistValues'][_0x3888('0x46')]>0x0?_[_0x3888('0x3a')](_0x256505[_0x3888('0x7d')],function(_0x2a75cf){return{'name':_0x2a75cf[_0x3888('0x7e')],'value':_0x2a75cf[_0x3888('0x7f')]};}):_0x256505[_0x3888('0x3e')]==_0x3888('0x80')?[{'name':'True','value':'true'},{'name':_0x3888('0x81'),'value':_0x3888('0x82')}]:[]};})};}})[_0x3888('0x1f')](respondWithResult(_0x2b72a0,null))[_0x3888('0x54')](function(_0x550a68){var _0x4f1233=_0x2c6547[_0x3888('0x41')]['test']?0x1f4:_0x550a68[_0x3888('0x83')]||0x1f4;logger[_0x3888('0x25')](_0x3888('0x84'),_0x3888('0x66'),_0x4f1233,JSON[_0x3888('0x24')](_0x550a68));delete _0x550a68[_0x3888('0x37')];if(_0x4f1233===0x191){_0x4f1233=0x190;}_0x2b72a0['status'](_0x4f1233)[_0x3888('0x38')](_0x2c6547['query'][_0x3888('0x1b')]?{'message':_0x3888('0x85'),'statusCode':_0x550a68[_0x3888('0x83')]}:_0x550a68);});}; \ No newline at end of file +var _0x8b6d=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','include','find','create','body','update','params','findOne','model','SalesforceConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','Task','clientId','clientSecret','username','password','securityToken','substring','lastIndexOf','Connection','login','concat','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallType','Priority','Status','isNil','Case','Type','Origin','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','boolean','true','False','false','Wrong\x20credentials','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','stack','name','send','SalesforceAccount','rawAttributes','fieldName','type','map','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','query','order'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8b6d,0xc2));var _0xd8b6=function(_0x208dd9,_0x2140b0){_0x208dd9=_0x208dd9-0x0;var _0x1295ab=_0x8b6d[_0x208dd9];return _0x1295ab;};'use strict';var pdf=require(_0xd8b6('0x0'));var emlformat=require(_0xd8b6('0x1'));var rimraf=require(_0xd8b6('0x2'));var zipdir=require(_0xd8b6('0x3'));var jsonpatch=require(_0xd8b6('0x4'));var rp=require(_0xd8b6('0x5'));var moment=require(_0xd8b6('0x6'));var BPromise=require(_0xd8b6('0x7'));var Mustache=require(_0xd8b6('0x8'));var util=require(_0xd8b6('0x9'));var path=require(_0xd8b6('0xa'));var sox=require(_0xd8b6('0xb'));var csv=require(_0xd8b6('0xc'));var ejs=require(_0xd8b6('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd8b6('0xe'));var jsforce=require(_0xd8b6('0xf'));var deskjs=require(_0xd8b6('0x10'));var toCsv=require(_0xd8b6('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8b6('0x11'));var qs=require(_0xd8b6('0x12'));var as=require(_0xd8b6('0x13'));var hardwareService=require(_0xd8b6('0x14'));var logger=require(_0xd8b6('0x15'))(_0xd8b6('0x16'));var utils=require('../../config/utils');var config=require(_0xd8b6('0x17'));var db=require(_0xd8b6('0x18'))['db'];var integrations=require(_0xd8b6('0x19'));var jayson=require(_0xd8b6('0x1a'));var client=jayson['client'][_0xd8b6('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5d40f8,_0x6de9e9,_0x5c150f){if(_0x5c150f){var _0x58859e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58859e[_0xd8b6('0x1c')](_0x6de9e9)){return _0x5d40f8;}else{throw new db[(_0xd8b6('0x1d'))][(_0xd8b6('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 _0x5d40f8;}}function respondWithRpcPromise(_0xa8ff1b,_0x499d7e,_0x56a809,_0x1a97f1){return new BPromise(function(_0x20f9bd,_0x412f62){var _0x3487a3=_0x1a97f1||client;return _0x3487a3[_0xd8b6('0x1f')](_0xa8ff1b,_0x56a809)[_0xd8b6('0x20')](function(_0x51b66d){logger['info'](_0xd8b6('0x21'),_0x499d7e,_0xd8b6('0x22'));logger[_0xd8b6('0x23')](_0xd8b6('0x24'),_0x499d7e,'request\x20sent',JSON['stringify'](_0x51b66d));if(_0x51b66d[_0xd8b6('0x25')]){if(_0x51b66d['error'][_0xd8b6('0x26')]===0x1f4){logger[_0xd8b6('0x25')](_0xd8b6('0x21'),_0x499d7e,_0x51b66d['error'][_0xd8b6('0x27')]);return _0x412f62(_0x51b66d[_0xd8b6('0x25')][_0xd8b6('0x27')]);}logger[_0xd8b6('0x25')](_0xd8b6('0x21'),_0x499d7e,_0x51b66d[_0xd8b6('0x25')][_0xd8b6('0x27')]);return _0x20f9bd(_0x51b66d[_0xd8b6('0x25')][_0xd8b6('0x27')]);}else{logger['info'](_0xd8b6('0x21'),_0x499d7e,'request\x20sent');_0x20f9bd(_0x51b66d['result'][_0xd8b6('0x27')]);}})[_0xd8b6('0x28')](function(_0x40ce1c){logger[_0xd8b6('0x25')]('SalesforceAccount,\x20%s,\x20%s',_0x499d7e,_0x40ce1c);_0x412f62(_0x40ce1c);});});}function respondWithStatusCode(_0x3cff33,_0x215cad){_0x215cad=_0x215cad||0xcc;return function(_0x4a5336){if(_0x4a5336){return _0x3cff33[_0xd8b6('0x29')](_0x215cad);}return _0x3cff33[_0xd8b6('0x2a')](_0x215cad)[_0xd8b6('0x2b')]();};}function respondWithResult(_0x46922a,_0x5b420b){_0x5b420b=_0x5b420b||0xc8;return function(_0x5bb342){if(_0x5bb342){return _0x46922a[_0xd8b6('0x2a')](_0x5b420b)[_0xd8b6('0x2c')](_0x5bb342);}};}function respondWithFilteredResult(_0xa5282,_0x463dd7){return function(_0x185baa){if(_0x185baa){var _0x311471=_0x185baa[_0xd8b6('0x2d')],_0xfeb0bb=_0x463dd7[_0xd8b6('0x2e')],_0x4c1dbb=_0x463dd7['offset']+_0x463dd7[_0xd8b6('0x2f')],_0x47f0eb;if(_0x4c1dbb>=_0x311471){_0x4c1dbb=_0x311471;_0x47f0eb=0xc8;}else{_0x47f0eb=0xce;}_0xa5282[_0xd8b6('0x2a')](_0x47f0eb);return _0xa5282[_0xd8b6('0x30')](_0xd8b6('0x31'),_0xfeb0bb+'-'+_0x4c1dbb+'/'+_0x311471)['json'](_0x185baa);}return null;};}function patchUpdates(_0x34f20){return function(_0x35ba9c){try{jsonpatch[_0xd8b6('0x32')](_0x35ba9c,_0x34f20,!![]);}catch(_0x13d914){return BPromise['reject'](_0x13d914);}return _0x35ba9c[_0xd8b6('0x33')]();};}function saveUpdates(_0x477f9a,_0x1fd0e3){return function(_0x3baf72){if(_0x3baf72){return _0x3baf72['update'](_0x477f9a)['then'](function(_0x3a31ab){return _0x3a31ab;});}return null;};}function removeEntity(_0x29ec03,_0x8ed479){return function(_0x2485b7){if(_0x2485b7){return _0x2485b7['destroy']()['then'](function(){_0x29ec03[_0xd8b6('0x2a')](0xcc)[_0xd8b6('0x2b')]();});}};}function handleEntityNotFound(_0x3266d8,_0x4915a6){return function(_0x309d7b){if(!_0x309d7b){_0x3266d8[_0xd8b6('0x29')](0x194);}return _0x309d7b;};}function handleError(_0x494c29,_0x411238){_0x411238=_0x411238||0x1f4;return function(_0x302f1e){logger[_0xd8b6('0x25')](_0x302f1e[_0xd8b6('0x34')]);if(_0x302f1e['name']){delete _0x302f1e[_0xd8b6('0x35')];}_0x494c29['status'](_0x411238)[_0xd8b6('0x36')](_0x302f1e);};}exports['index']=function(_0x32b11d,_0x10c0ee){var _0x4ee321={},_0x267eb4={},_0x1b3fc6={'count':0x0,'rows':[]};var _0x59f747=_['map'](db[_0xd8b6('0x37')][_0xd8b6('0x38')],function(_0x744266){return{'name':_0x744266[_0xd8b6('0x39')],'type':_0x744266[_0xd8b6('0x3a')]['key']};});_0x267eb4['model']=_[_0xd8b6('0x3b')](_0x59f747,'name');_0x267eb4['query']=_[_0xd8b6('0x3c')](_0x32b11d['query']);_0x267eb4[_0xd8b6('0x3d')]=_[_0xd8b6('0x3e')](_0x267eb4['model'],_0x267eb4['query']);_0x4ee321[_0xd8b6('0x3f')]=_[_0xd8b6('0x3e')](_0x267eb4['model'],qs[_0xd8b6('0x40')](_0x32b11d['query'][_0xd8b6('0x40')]));_0x4ee321['attributes']=_0x4ee321[_0xd8b6('0x3f')][_0xd8b6('0x41')]?_0x4ee321[_0xd8b6('0x3f')]:_0x267eb4['model'];if(!_0x32b11d['query'][_0xd8b6('0x42')](_0xd8b6('0x43'))){_0x4ee321['limit']=qs[_0xd8b6('0x2f')](_0x32b11d[_0xd8b6('0x44')][_0xd8b6('0x2f')]);_0x4ee321[_0xd8b6('0x2e')]=qs['offset'](_0x32b11d[_0xd8b6('0x44')]['offset']);}_0x4ee321[_0xd8b6('0x45')]=qs[_0xd8b6('0x46')](_0x32b11d[_0xd8b6('0x44')][_0xd8b6('0x46')]);_0x4ee321[_0xd8b6('0x47')]=qs[_0xd8b6('0x3d')](_[_0xd8b6('0x48')](_0x32b11d['query'],_0x267eb4[_0xd8b6('0x3d')]),_0x59f747);if(_0x32b11d['query'][_0xd8b6('0x49')]){_0x4ee321[_0xd8b6('0x47')]=_[_0xd8b6('0x4a')](_0x4ee321[_0xd8b6('0x47')],{'$or':_['map'](_0x59f747,function(_0xe4a0e8){if(_0xe4a0e8['type']!==_0xd8b6('0x4b')){var _0x3e7b37={};_0x3e7b37[_0xe4a0e8[_0xd8b6('0x35')]]={'$like':'%'+_0x32b11d[_0xd8b6('0x44')][_0xd8b6('0x49')]+'%'};return _0x3e7b37;}})});}_0x4ee321=_[_0xd8b6('0x4a')]({},_0x4ee321,_0x32b11d[_0xd8b6('0x4c')]);var _0x40e072={'where':_0x4ee321[_0xd8b6('0x47')]};return db['SalesforceAccount'][_0xd8b6('0x2d')](_0x40e072)[_0xd8b6('0x20')](function(_0x2cd86e){_0x1b3fc6[_0xd8b6('0x2d')]=_0x2cd86e;if(_0x32b11d[_0xd8b6('0x44')][_0xd8b6('0x4d')]){_0x4ee321['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0xd8b6('0x4e')](_0x4ee321);})[_0xd8b6('0x20')](function(_0x5786c0){_0x1b3fc6['rows']=_0x5786c0;return _0x1b3fc6;})[_0xd8b6('0x20')](respondWithFilteredResult(_0x10c0ee,_0x4ee321))[_0xd8b6('0x28')](handleError(_0x10c0ee,null));};exports[_0xd8b6('0x4f')]=function(_0x23436d,_0x4647ab){var _0x1acb46={'raw':![],'where':{'id':_0x23436d['params']['id']}},_0x4b2bbd={};_0x4b2bbd['model']=_[_0xd8b6('0x3c')](db[_0xd8b6('0x37')]['rawAttributes']);_0x4b2bbd[_0xd8b6('0x44')]=_['keys'](_0x23436d[_0xd8b6('0x44')]);_0x4b2bbd['filters']=_['intersection'](_0x4b2bbd['model'],_0x4b2bbd['query']);_0x1acb46[_0xd8b6('0x3f')]=_['intersection'](_0x4b2bbd['model'],qs[_0xd8b6('0x40')](_0x23436d[_0xd8b6('0x44')][_0xd8b6('0x40')]));_0x1acb46[_0xd8b6('0x3f')]=_0x1acb46['attributes'][_0xd8b6('0x41')]?_0x1acb46[_0xd8b6('0x3f')]:_0x4b2bbd['model'];if(_0x23436d[_0xd8b6('0x44')][_0xd8b6('0x4d')]){_0x1acb46[_0xd8b6('0x50')]=[{'all':!![]}];}_0x1acb46=_[_0xd8b6('0x4a')]({},_0x1acb46,_0x23436d['options']);return db[_0xd8b6('0x37')][_0xd8b6('0x51')](_0x1acb46)[_0xd8b6('0x20')](handleEntityNotFound(_0x4647ab,null))['then'](respondWithResult(_0x4647ab,null))[_0xd8b6('0x28')](handleError(_0x4647ab,null));};exports[_0xd8b6('0x52')]=function(_0x13aad5,_0x4ffd7d){return db['SalesforceAccount'][_0xd8b6('0x52')](_0x13aad5[_0xd8b6('0x53')],{})[_0xd8b6('0x20')](respondWithResult(_0x4ffd7d,0xc9))[_0xd8b6('0x28')](handleError(_0x4ffd7d,null));};exports[_0xd8b6('0x54')]=function(_0x3b06d0,_0x44b647){if(_0x3b06d0[_0xd8b6('0x53')]['id']){delete _0x3b06d0[_0xd8b6('0x53')]['id'];}return db[_0xd8b6('0x37')]['find']({'where':{'id':_0x3b06d0[_0xd8b6('0x55')]['id']}})[_0xd8b6('0x20')](handleEntityNotFound(_0x44b647,null))[_0xd8b6('0x20')](saveUpdates(_0x3b06d0[_0xd8b6('0x53')],null))['then'](respondWithResult(_0x44b647,null))[_0xd8b6('0x28')](handleError(_0x44b647,null));};exports['destroy']=function(_0x19254e,_0x5a3de9){return db[_0xd8b6('0x37')][_0xd8b6('0x51')]({'where':{'id':_0x19254e['params']['id']}})[_0xd8b6('0x20')](handleEntityNotFound(_0x5a3de9,null))[_0xd8b6('0x20')](removeEntity(_0x5a3de9,null))[_0xd8b6('0x28')](handleError(_0x5a3de9,null));};exports['getConfigurations']=function(_0x352e8c,_0x3a424d,_0x44a213){var _0x38cff3={};var _0x3ea164={};var _0x507f3a;var _0x3f9450;return db[_0xd8b6('0x37')][_0xd8b6('0x56')]({'where':{'id':_0x352e8c[_0xd8b6('0x55')]['id']}})['then'](handleEntityNotFound(_0x3a424d,null))['then'](function(_0x3ad4b7){if(_0x3ad4b7){_0x507f3a=_0x3ad4b7;_0x3ea164[_0xd8b6('0x57')]=_[_0xd8b6('0x3c')](db[_0xd8b6('0x58')][_0xd8b6('0x38')]);_0x3ea164[_0xd8b6('0x44')]=_[_0xd8b6('0x3c')](_0x352e8c[_0xd8b6('0x44')]);_0x3ea164[_0xd8b6('0x3d')]=_[_0xd8b6('0x3e')](_0x3ea164[_0xd8b6('0x57')],_0x3ea164[_0xd8b6('0x44')]);_0x38cff3[_0xd8b6('0x3f')]=_['intersection'](_0x3ea164[_0xd8b6('0x57')],qs[_0xd8b6('0x40')](_0x352e8c['query']['fields']));_0x38cff3[_0xd8b6('0x3f')]=_0x38cff3[_0xd8b6('0x3f')][_0xd8b6('0x41')]?_0x38cff3[_0xd8b6('0x3f')]:_0x3ea164['model'];_0x38cff3['order']=qs[_0xd8b6('0x46')](_0x352e8c['query'][_0xd8b6('0x46')]);_0x38cff3[_0xd8b6('0x47')]=qs[_0xd8b6('0x3d')](_[_0xd8b6('0x48')](_0x352e8c[_0xd8b6('0x44')],_0x3ea164['filters']));if(_0x352e8c['query'][_0xd8b6('0x49')]){_0x38cff3['where']=_[_0xd8b6('0x4a')](_0x38cff3[_0xd8b6('0x47')],{'$or':_['map'](_0x38cff3[_0xd8b6('0x3f')],function(_0xceb660){var _0x3afb58={};_0x3afb58[_0xceb660]={'$like':'%'+_0x352e8c[_0xd8b6('0x44')]['filter']+'%'};return _0x3afb58;})});}_0x38cff3=_[_0xd8b6('0x4a')]({},_0x38cff3,_0x352e8c['options']);return _0x507f3a[_0xd8b6('0x59')](_0x38cff3);}})[_0xd8b6('0x20')](function(_0x475cfd){if(_0x475cfd){_0x3f9450=_0x475cfd['length'];if(!_0x352e8c[_0xd8b6('0x44')][_0xd8b6('0x42')](_0xd8b6('0x43'))){_0x38cff3['limit']=qs[_0xd8b6('0x2f')](_0x352e8c[_0xd8b6('0x44')][_0xd8b6('0x2f')]);_0x38cff3[_0xd8b6('0x2e')]=qs[_0xd8b6('0x2e')](_0x352e8c[_0xd8b6('0x44')]['offset']);}return _0x507f3a[_0xd8b6('0x59')](_0x38cff3);}})[_0xd8b6('0x20')](function(_0x466897){if(_0x466897){return _0x466897?{'count':_0x3f9450,'rows':_0x466897}:null;}})['then'](respondWithResult(_0x3a424d,null))[_0xd8b6('0x28')](handleError(_0x3a424d,null));};exports['addConfiguration']=function(_0x5805d7,_0x194586,_0x33137f){if(_0x5805d7['body']['id']){delete _0x5805d7['body']['id'];}return db[_0xd8b6('0x37')]['findOne']({'where':{'id':_0x5805d7['params']['id']}})[_0xd8b6('0x20')](handleEntityNotFound(_0x194586,null))[_0xd8b6('0x20')](function(_0xca0526){if(_0xca0526){_0x5805d7[_0xd8b6('0x53')][_0xd8b6('0x5a')]=_0xca0526['id'];_0x5805d7['body'][_0xd8b6('0x5b')]=integrations[_0xd8b6('0x5c')](_0x5805d7[_0xd8b6('0x53')][_0xd8b6('0x5d')],_0x5805d7[_0xd8b6('0x53')]['type']);_0x5805d7[_0xd8b6('0x53')][_0xd8b6('0x5e')]=integrations[_0xd8b6('0x5f')](_0x5805d7[_0xd8b6('0x53')]['channel'],_0x5805d7[_0xd8b6('0x53')][_0xd8b6('0x3a')]);return db[_0xd8b6('0x58')][_0xd8b6('0x52')](_0x5805d7['body'],{'include':[{'model':db['SalesforceField'],'as':_0xd8b6('0x5b')},{'model':db['SalesforceField'],'as':_0xd8b6('0x5e')}]});}return null;})[_0xd8b6('0x20')](respondWithResult(_0x194586,null))['catch'](handleError(_0x194586,null));};exports[_0xd8b6('0x60')]=function(_0x49dfd7,_0xeca175,_0x5d39a9){var _0x1fedb1;var _0x5011ec='';var _0x32ec77=_0xd8b6('0x61');return db[_0xd8b6('0x37')][_0xd8b6('0x56')]({'where':{'id':_0x49dfd7[_0xd8b6('0x55')]['id']},'attributes':['id','remoteUri',_0xd8b6('0x62'),_0xd8b6('0x63'),_0xd8b6('0x64'),_0xd8b6('0x65'),_0xd8b6('0x66')]})[_0xd8b6('0x20')](handleEntityNotFound(_0xeca175,null))[_0xd8b6('0x20')](function(_0x38daeb){if(_0x38daeb){_0x5011ec=_0x38daeb['remoteUri'];var _0x2ba9f0=_0x5011ec['slice'](-0x1);if(_0x2ba9f0==='/'){_0x5011ec=_0x5011ec[_0xd8b6('0x67')](0x0,_0x5011ec[_0xd8b6('0x68')](_0x2ba9f0));}_0x1fedb1=new jsforce[(_0xd8b6('0x69'))]({'oauth2':{'loginUrl':_0x5011ec,'clientId':_0x38daeb[_0xd8b6('0x62')],'clientSecret':_0x38daeb[_0xd8b6('0x63')]}});return _0x1fedb1[_0xd8b6('0x6a')](_0x38daeb['username'],_0x38daeb[_0xd8b6('0x65')][_0xd8b6('0x6b')](_0x38daeb[_0xd8b6('0x66')]));}})['then'](function(_0xaad263){if(_0xaad263){if(!_['isNil'](_0x49dfd7[_0xd8b6('0x44')][_0xd8b6('0x6c')])){_0x32ec77=_0x49dfd7['query'][_0xd8b6('0x6c')];}return _0x1fedb1[_0xd8b6('0x6d')](_0x32ec77)['describe']();}})['then'](function(_0x279437){var _0x19a8b9=[_0xd8b6('0x6e'),_0xd8b6('0x6f'),'CallObject',_0xd8b6('0x70'),'IsArchived',_0xd8b6('0x71'),_0xd8b6('0x72'),'Type'];if(!_[_0xd8b6('0x73')](_0x49dfd7[_0xd8b6('0x44')][_0xd8b6('0x6c')])&&_0x49dfd7[_0xd8b6('0x44')]['ticketType']===_0xd8b6('0x74')){_0x19a8b9=[_0xd8b6('0x75'),_0xd8b6('0x76'),'Reason',_0xd8b6('0x72'),_0xd8b6('0x71'),_0xd8b6('0x77'),_0xd8b6('0x78'),_0xd8b6('0x79')];}if(_0x279437){_[_0xd8b6('0x7a')](_0x279437[_0xd8b6('0x40')],function(_0x312da7){return _0x312da7[_0xd8b6('0x7b')]===![]&&!_0x19a8b9[_0xd8b6('0x7c')](_0x312da7['name']);});return{'count':_0x279437[_0xd8b6('0x40')][_0xd8b6('0x41')],'rows':_['map'](_0x279437['fields'],function(_0x2b762f){return{'id':_0x2b762f[_0xd8b6('0x35')],'name':_0x2b762f[_0xd8b6('0x7d')],'custom':_0x2b762f['custom'],'options':_0x2b762f[_0xd8b6('0x7e')][_0xd8b6('0x41')]>0x0?_['map'](_0x2b762f[_0xd8b6('0x7e')],function(_0x2c187c){return{'name':_0x2c187c[_0xd8b6('0x7d')],'value':_0x2c187c['value']};}):_0x2b762f[_0xd8b6('0x3a')]==_0xd8b6('0x7f')?[{'name':'True','value':_0xd8b6('0x80')},{'name':_0xd8b6('0x81'),'value':_0xd8b6('0x82')}]:[]};})};}})[_0xd8b6('0x20')](respondWithResult(_0xeca175,null))[_0xd8b6('0x28')](function(_0x2a251a){var _0x288402=_0x49dfd7['query']['test']?0x1f4:_0x2a251a['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xd8b6('0x60'),_0x288402,JSON['stringify'](_0x2a251a));delete _0x2a251a[_0xd8b6('0x35')];if(_0x288402===0x191){_0x288402=0x190;}_0xeca175[_0xd8b6('0x2a')](_0x288402)[_0xd8b6('0x36')](_0x49dfd7[_0xd8b6('0x44')][_0xd8b6('0x1c')]?{'message':_0xd8b6('0x83'),'statusCode':_0x2a251a['statusCode']}:_0x2a251a);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 8c850b1..f4e1d23 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 _0x1a90=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','SalesforceAccount','int_salesforce_accounts','lodash','util','api'];(function(_0x9f8671,_0x434bbc){var _0x4208fa=function(_0x3c31ef){while(--_0x3c31ef){_0x9f8671['push'](_0x9f8671['shift']());}};_0x4208fa(++_0x434bbc);}(_0x1a90,0xe7));var _0x01a9=function(_0x2c2cb8,_0x41f1c5){_0x2c2cb8=_0x2c2cb8-0x0;var _0x3147c4=_0x1a90[_0x2c2cb8];return _0x3147c4;};'use strict';var _=require(_0x01a9('0x0'));var util=require(_0x01a9('0x1'));var logger=require('../../config/logger')(_0x01a9('0x2'));var moment=require(_0x01a9('0x3'));var BPromise=require(_0x01a9('0x4'));var rp=require(_0x01a9('0x5'));var fs=require('fs');var path=require(_0x01a9('0x6'));var rimraf=require(_0x01a9('0x7'));var config=require(_0x01a9('0x8'));var attributes=require(_0x01a9('0x9'));var integrations=require(_0x01a9('0xa'));module['exports']=function(_0x55f069,_0x5d0e84){return _0x55f069['define'](_0x01a9('0xb'),attributes,{'tableName':_0x01a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x086f=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5dae9a,_0x5cb4be){var _0x378a34=function(_0x22a64){while(--_0x22a64){_0x5dae9a['push'](_0x5dae9a['shift']());}};_0x378a34(++_0x5cb4be);}(_0x086f,0x1c5));var _0xf086=function(_0xd12ba4,_0x186425){_0xd12ba4=_0xd12ba4-0x0;var _0x537d41=_0x086f[_0xd12ba4];return _0x537d41;};'use strict';var _=require(_0xf086('0x0'));var util=require(_0xf086('0x1'));var logger=require(_0xf086('0x2'))(_0xf086('0x3'));var moment=require(_0xf086('0x4'));var BPromise=require(_0xf086('0x5'));var rp=require(_0xf086('0x6'));var fs=require('fs');var path=require(_0xf086('0x7'));var rimraf=require(_0xf086('0x8'));var config=require(_0xf086('0x9'));var attributes=require(_0xf086('0xa'));var integrations=require(_0xf086('0xb'));module['exports']=function(_0x4eb08f,_0x24d6a5){return _0x4eb08f[_0xf086('0xc')](_0xf086('0xd'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 3c9cb1c..6527832 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 _0x4522=['limit','include','map','model','attributes','info','ShowSalesforceAccount','find','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','SalesforceAccount','options','raw','where'];(function(_0x570938,_0x14d25e){var _0x466dd2=function(_0x487210){while(--_0x487210){_0x570938['push'](_0x570938['shift']());}};_0x466dd2(++_0x14d25e);}(_0x4522,0x1a0));var _0x2452=function(_0x1cf707,_0x3ac2b6){_0x1cf707=_0x1cf707-0x0;var _0x5b5a59=_0x4522[_0x1cf707];return _0x5b5a59;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2452('0x0'));var BPromise=require(_0x2452('0x1'));var rs=require(_0x2452('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2452('0x3'))['db'];var utils=require(_0x2452('0x4'));var logger=require(_0x2452('0x5'))(_0x2452('0x6'));var config=require(_0x2452('0x7'));var jayson=require(_0x2452('0x8'));var client=jayson[_0x2452('0x9')][_0x2452('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0139,_0x149807,_0x3bc193){return new BPromise(function(_0x33b935,_0x24073f){return client[_0x2452('0xb')](_0x2f0139,_0x3bc193)[_0x2452('0xc')](function(_0x2995b5){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x149807,_0x2452('0xd'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x149807,_0x2452('0xd'),JSON[_0x2452('0xe')](_0x2995b5));if(_0x2995b5[_0x2452('0xf')]){if(_0x2995b5[_0x2452('0xf')][_0x2452('0x10')]===0x1f4){logger[_0x2452('0xf')](_0x2452('0x11'),_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x24073f(_0x2995b5['error']['message']);}logger[_0x2452('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x149807,_0x2995b5[_0x2452('0xf')]['message']);return _0x33b935(_0x2995b5[_0x2452('0xf')][_0x2452('0x12')]);}else{logger['info'](_0x2452('0x11'),_0x149807,'request\x20sent');_0x33b935(_0x2995b5[_0x2452('0x13')][_0x2452('0x12')]);}})[_0x2452('0x14')](function(_0xdede20){logger['error'](_0x2452('0x11'),_0x149807,_0xdede20);_0x24073f(_0xdede20);});});}exports[_0x2452('0x15')]=function(_0x59d89a){var _0x4802ad=this;return new Promise(function(_0x1bfb44,_0x37c6a6){return db[_0x2452('0x16')]['findAll']({'raw':_0x59d89a[_0x2452('0x17')]?_0x59d89a[_0x2452('0x17')][_0x2452('0x18')]===undefined?!![]:![]:!![],'where':_0x59d89a[_0x2452('0x17')]?_0x59d89a[_0x2452('0x17')][_0x2452('0x19')]||null:null,'attributes':_0x59d89a[_0x2452('0x17')]?_0x59d89a[_0x2452('0x17')]['attributes']||null:null,'limit':_0x59d89a['options']?_0x59d89a[_0x2452('0x17')][_0x2452('0x1a')]||null:null,'include':_0x59d89a['options']?_0x59d89a[_0x2452('0x17')][_0x2452('0x1b')]?_[_0x2452('0x1c')](_0x59d89a[_0x2452('0x17')][_0x2452('0x1b')],function(_0x397f21){return{'model':db[_0x397f21[_0x2452('0x1d')]],'as':_0x397f21['as'],'attributes':_0x397f21['attributes'],'include':_0x397f21[_0x2452('0x1b')]?_[_0x2452('0x1c')](_0x397f21[_0x2452('0x1b')],function(_0x231410){return{'model':db[_0x231410[_0x2452('0x1d')]],'as':_0x231410['as'],'attributes':_0x231410['attributes'],'include':_0x231410['include']?_[_0x2452('0x1c')](_0x231410[_0x2452('0x1b')],function(_0x46fcbb){return{'model':db[_0x46fcbb[_0x2452('0x1d')]],'as':_0x46fcbb['as'],'attributes':_0x46fcbb[_0x2452('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fba00){logger[_0x2452('0x1f')]('GetSalesforceAccount',_0x59d89a);logger['debug'](_0x2452('0x15'),_0x59d89a,JSON[_0x2452('0xe')](_0x3fba00));_0x1bfb44(_0x3fba00);})[_0x2452('0x14')](function(_0x28e6ea){logger[_0x2452('0xf')](_0x2452('0x15'),_0x28e6ea['message'],_0x59d89a);_0x37c6a6(_0x4802ad['error'](0x1f4,_0x28e6ea[_0x2452('0x12')]));});});};exports[_0x2452('0x20')]=function(_0x130565){var _0x5c36aa=this;return new Promise(function(_0x2fb2ae,_0x586a20){return db['SalesforceAccount'][_0x2452('0x21')]({'raw':_0x130565[_0x2452('0x17')]?_0x130565[_0x2452('0x17')][_0x2452('0x18')]===undefined?!![]:![]:!![],'where':_0x130565[_0x2452('0x17')]?_0x130565[_0x2452('0x17')][_0x2452('0x19')]||null:null,'attributes':_0x130565[_0x2452('0x17')]?_0x130565[_0x2452('0x17')][_0x2452('0x1e')]||null:null,'include':_0x130565[_0x2452('0x17')]?_0x130565[_0x2452('0x17')][_0x2452('0x1b')]?_['map'](_0x130565[_0x2452('0x17')][_0x2452('0x1b')],function(_0x4cd7e2){return{'model':db[_0x4cd7e2[_0x2452('0x1d')]],'as':_0x4cd7e2['as'],'attributes':_0x4cd7e2['attributes'],'include':_0x4cd7e2[_0x2452('0x1b')]?_[_0x2452('0x1c')](_0x4cd7e2['include'],function(_0x645722){return{'model':db[_0x645722[_0x2452('0x1d')]],'as':_0x645722['as'],'attributes':_0x645722[_0x2452('0x1e')],'include':_0x645722['include']?_[_0x2452('0x1c')](_0x645722[_0x2452('0x1b')],function(_0x4ba2ae){return{'model':db[_0x4ba2ae[_0x2452('0x1d')]],'as':_0x4ba2ae['as'],'attributes':_0x4ba2ae[_0x2452('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x2452('0xc')](function(_0x26264f){logger[_0x2452('0x1f')]('ShowSalesforceAccount',_0x130565);logger['debug']('ShowSalesforceAccount',_0x130565,JSON[_0x2452('0xe')](_0x26264f));_0x2fb2ae(_0x26264f);})[_0x2452('0x14')](function(_0x64965c){logger[_0x2452('0xf')](_0x2452('0x20'),_0x64965c['message'],_0x130565);_0x586a20(_0x5c36aa[_0x2452('0xf')](0x1f4,_0x64965c['message']));});});}; \ No newline at end of file +var _0xc368=['debug','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount','options','raw','where','attributes','limit','include','model','map','GetSalesforceAccount','ShowSalesforceAccount','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent'];(function(_0x4ee458,_0x4f966d){var _0x4df0c8=function(_0x36d4a0){while(--_0x36d4a0){_0x4ee458['push'](_0x4ee458['shift']());}};_0x4df0c8(++_0x4f966d);}(_0xc368,0x7b));var _0x8c36=function(_0x431912,_0x37b283){_0x431912=_0x431912-0x0;var _0x4a2982=_0xc368[_0x431912];return _0x4a2982;};'use strict';var _=require('lodash');var util=require(_0x8c36('0x0'));var moment=require('moment');var BPromise=require(_0x8c36('0x1'));var rs=require(_0x8c36('0x2'));var fs=require('fs');var Redis=require(_0x8c36('0x3'));var db=require(_0x8c36('0x4'))['db'];var utils=require(_0x8c36('0x5'));var logger=require('../../config/logger')(_0x8c36('0x6'));var config=require(_0x8c36('0x7'));var jayson=require(_0x8c36('0x8'));var client=jayson[_0x8c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554022,_0x8ed437,_0x384867){return new BPromise(function(_0x3e76be,_0x26bad1){return client[_0x8c36('0xa')](_0x554022,_0x384867)[_0x8c36('0xb')](function(_0x569f29){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'));logger[_0x8c36('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x8ed437,_0x8c36('0xc'),JSON[_0x8c36('0xe')](_0x569f29));if(_0x569f29[_0x8c36('0xf')]){if(_0x569f29[_0x8c36('0xf')][_0x8c36('0x10')]===0x1f4){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);return _0x26bad1(_0x569f29[_0x8c36('0xf')][_0x8c36('0x12')]);}logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x569f29[_0x8c36('0xf')]['message']);return _0x3e76be(_0x569f29[_0x8c36('0xf')]['message']);}else{logger[_0x8c36('0x13')](_0x8c36('0x11'),_0x8ed437,_0x8c36('0xc'));_0x3e76be(_0x569f29[_0x8c36('0x14')][_0x8c36('0x12')]);}})[_0x8c36('0x15')](function(_0x3c10eb){logger[_0x8c36('0xf')](_0x8c36('0x11'),_0x8ed437,_0x3c10eb);_0x26bad1(_0x3c10eb);});});}exports['GetSalesforceAccount']=function(_0x2be9b0){var _0x46ae6e=this;return new Promise(function(_0x47832a,_0x2d5e5b){return db[_0x8c36('0x16')]['findAll']({'raw':_0x2be9b0[_0x8c36('0x17')]?_0x2be9b0[_0x8c36('0x17')][_0x8c36('0x18')]===undefined?!![]:![]:!![],'where':_0x2be9b0[_0x8c36('0x17')]?_0x2be9b0[_0x8c36('0x17')][_0x8c36('0x19')]||null:null,'attributes':_0x2be9b0[_0x8c36('0x17')]?_0x2be9b0[_0x8c36('0x17')][_0x8c36('0x1a')]||null:null,'limit':_0x2be9b0[_0x8c36('0x17')]?_0x2be9b0[_0x8c36('0x17')][_0x8c36('0x1b')]||null:null,'include':_0x2be9b0[_0x8c36('0x17')]?_0x2be9b0['options']['include']?_['map'](_0x2be9b0['options'][_0x8c36('0x1c')],function(_0x7effb8){return{'model':db[_0x7effb8[_0x8c36('0x1d')]],'as':_0x7effb8['as'],'attributes':_0x7effb8[_0x8c36('0x1a')],'include':_0x7effb8[_0x8c36('0x1c')]?_[_0x8c36('0x1e')](_0x7effb8['include'],function(_0x1d39ca){return{'model':db[_0x1d39ca['model']],'as':_0x1d39ca['as'],'attributes':_0x1d39ca[_0x8c36('0x1a')],'include':_0x1d39ca['include']?_[_0x8c36('0x1e')](_0x1d39ca[_0x8c36('0x1c')],function(_0x271ec4){return{'model':db[_0x271ec4[_0x8c36('0x1d')]],'as':_0x271ec4['as'],'attributes':_0x271ec4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7e7e56){logger[_0x8c36('0x13')]('GetSalesforceAccount',_0x2be9b0);logger['debug'](_0x8c36('0x1f'),_0x2be9b0,JSON[_0x8c36('0xe')](_0x7e7e56));_0x47832a(_0x7e7e56);})['catch'](function(_0x1280a1){logger[_0x8c36('0xf')](_0x8c36('0x1f'),_0x1280a1['message'],_0x2be9b0);_0x2d5e5b(_0x46ae6e['error'](0x1f4,_0x1280a1[_0x8c36('0x12')]));});});};exports[_0x8c36('0x20')]=function(_0x3d7056){var _0x192ce3=this;return new Promise(function(_0x3ae970,_0x2e8855){return db[_0x8c36('0x16')][_0x8c36('0x21')]({'raw':_0x3d7056[_0x8c36('0x17')]?_0x3d7056[_0x8c36('0x17')][_0x8c36('0x18')]===undefined?!![]:![]:!![],'where':_0x3d7056[_0x8c36('0x17')]?_0x3d7056[_0x8c36('0x17')][_0x8c36('0x19')]||null:null,'attributes':_0x3d7056[_0x8c36('0x17')]?_0x3d7056[_0x8c36('0x17')][_0x8c36('0x1a')]||null:null,'include':_0x3d7056['options']?_0x3d7056['options']['include']?_[_0x8c36('0x1e')](_0x3d7056[_0x8c36('0x17')][_0x8c36('0x1c')],function(_0x2fedd6){return{'model':db[_0x2fedd6[_0x8c36('0x1d')]],'as':_0x2fedd6['as'],'attributes':_0x2fedd6[_0x8c36('0x1a')],'include':_0x2fedd6[_0x8c36('0x1c')]?_['map'](_0x2fedd6[_0x8c36('0x1c')],function(_0x59a4e6){return{'model':db[_0x59a4e6[_0x8c36('0x1d')]],'as':_0x59a4e6['as'],'attributes':_0x59a4e6['attributes'],'include':_0x59a4e6[_0x8c36('0x1c')]?_[_0x8c36('0x1e')](_0x59a4e6[_0x8c36('0x1c')],function(_0x4857b0){return{'model':db[_0x4857b0[_0x8c36('0x1d')]],'as':_0x4857b0['as'],'attributes':_0x4857b0[_0x8c36('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8c36('0xb')](function(_0xabdc0f){logger[_0x8c36('0x13')](_0x8c36('0x20'),_0x3d7056);logger[_0x8c36('0xd')](_0x8c36('0x20'),_0x3d7056,JSON[_0x8c36('0xe')](_0xabdc0f));_0x3ae970(_0xabdc0f);})[_0x8c36('0x15')](function(_0x4719de){logger[_0x8c36('0xf')](_0x8c36('0x20'),_0x4719de[_0x8c36('0x12')],_0x3d7056);_0x2e8855(_0x192ce3[_0x8c36('0xf')](0x1f4,_0x4719de[_0x8c36('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1d1040a..f15f389 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 _0x043e=['get','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','/:id','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','./intSalesforceConfiguration.controller','isAuthenticated','index'];(function(_0x328dd1,_0x311399){var _0x21b3e3=function(_0x41fd6a){while(--_0x41fd6a){_0x328dd1['push'](_0x328dd1['shift']());}};_0x21b3e3(++_0x311399);}(_0x043e,0x138));var _0xe043=function(_0x59b0e4,_0x26956e){_0x59b0e4=_0x59b0e4-0x0;var _0x418be1=_0x043e[_0x59b0e4];return _0x418be1;};'use strict';var multer=require(_0xe043('0x0'));var util=require('util');var path=require(_0xe043('0x1'));var timeout=require(_0xe043('0x2'));var express=require('express');var router=express[_0xe043('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe043('0x4'));var config=require('../../config/environment');var controller=require(_0xe043('0x5'));router['get']('/',auth[_0xe043('0x6')](),controller[_0xe043('0x7')]);router[_0xe043('0x8')]('/:id',auth[_0xe043('0x6')](),controller[_0xe043('0x9')]);router['get'](_0xe043('0xa'),auth[_0xe043('0x6')](),controller[_0xe043('0xb')]);router['get'](_0xe043('0xc'),auth[_0xe043('0x6')](),controller['getSubjects']);router[_0xe043('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe043('0xd')]);router[_0xe043('0xe')]('/',auth[_0xe043('0x6')](),controller[_0xe043('0xf')]);router[_0xe043('0x10')](_0xe043('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xe043('0x12')](_0xe043('0x11'),auth[_0xe043('0x6')](),controller['destroy']);module[_0xe043('0x13')]=router; \ No newline at end of file +var _0x0cf0=['/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index','get'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x0cf0,0x182));var _0x00cf=function(_0x2a51a4,_0x4fb2ff){_0x2a51a4=_0x2a51a4-0x0;var _0x1499ca=_0x0cf0[_0x2a51a4];return _0x1499ca;};'use strict';var multer=require('multer');var util=require(_0x00cf('0x0'));var path=require('path');var timeout=require(_0x00cf('0x1'));var express=require(_0x00cf('0x2'));var router=express[_0x00cf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x00cf('0x4'));var config=require(_0x00cf('0x5'));var controller=require(_0x00cf('0x6'));router['get']('/',auth[_0x00cf('0x7')](),controller[_0x00cf('0x8')]);router[_0x00cf('0x9')](_0x00cf('0xa'),auth[_0x00cf('0x7')](),controller[_0x00cf('0xb')]);router['get'](_0x00cf('0xc'),auth[_0x00cf('0x7')](),controller[_0x00cf('0xd')]);router['get'](_0x00cf('0xe'),auth[_0x00cf('0x7')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x00cf('0x7')](),controller[_0x00cf('0xf')]);router[_0x00cf('0x10')]('/',auth[_0x00cf('0x7')](),controller[_0x00cf('0x11')]);router[_0x00cf('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x00cf('0x13')]);router['delete'](_0x00cf('0xa'),auth[_0x00cf('0x7')](),controller[_0x00cf('0x14')]);module[_0x00cf('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 948d7eb..dea37c7 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 _0xef82=['nothing','exports','STRING','Task','Case','ENUM','contact_lead','contact','lead'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0xef82,0x17b));var _0x2ef8=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xef82[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require('sequelize');module[_0x2ef8('0x0')]={'name':{'type':Sequelize[_0x2ef8('0x1')]},'description':{'type':Sequelize[_0x2ef8('0x1')]},'ticketType':{'type':Sequelize['ENUM'](_0x2ef8('0x2'),_0x2ef8('0x3')),'defaultValue':_0x2ef8('0x2')},'moduleSearch':{'type':Sequelize[_0x2ef8('0x4')](_0x2ef8('0x5'),_0x2ef8('0x6'),_0x2ef8('0x7')),'defaultValue':_0x2ef8('0x5')},'moduleCreate':{'type':Sequelize['ENUM'](_0x2ef8('0x8'),'contact',_0x2ef8('0x7')),'defaultValue':_0x2ef8('0x7')}}; \ No newline at end of file +var _0xcf4b=['sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact','lead','nothing'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf4b,0x12c));var _0xbcf4=function(_0x56136b,_0x57e5ff){_0x56136b=_0x56136b-0x0;var _0x35cc8b=_0xcf4b[_0x56136b];return _0x35cc8b;};'use strict';var Sequelize=require(_0xbcf4('0x0'));module[_0xbcf4('0x1')]={'name':{'type':Sequelize[_0xbcf4('0x2')]},'description':{'type':Sequelize[_0xbcf4('0x2')]},'ticketType':{'type':Sequelize[_0xbcf4('0x3')]('Task',_0xbcf4('0x4')),'defaultValue':_0xbcf4('0x5')},'moduleSearch':{'type':Sequelize['ENUM'](_0xbcf4('0x6'),_0xbcf4('0x7'),_0xbcf4('0x8')),'defaultValue':_0xbcf4('0x6')},'moduleCreate':{'type':Sequelize[_0xbcf4('0x3')](_0xbcf4('0x9'),_0xbcf4('0x7'),_0xbcf4('0x8')),'defaultValue':_0xbcf4('0x8')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 6ad6706..8e2c424 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 _0x057f=['end','stack','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','count','includeAll','include','findAll','rows','show','params','length','options','create','body','find','getFields','SalesforceField','getSubjects','getDescriptions','findOne','eml-format','rimraf','fast-json-patch','moment','bluebird','path','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','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','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','catch','status','json','offset','limit','set','apply','reject','save','update','then','destroy'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x057f,0x85));var _0xf057=function(_0x48f9d4,_0x39d744){_0x48f9d4=_0x48f9d4-0x0;var _0x14e71d=_0x057f[_0x48f9d4];return _0x14e71d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf057('0x0'));var rimraf=require(_0xf057('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf057('0x2'));var rp=require('request-promise');var moment=require(_0xf057('0x3'));var BPromise=require(_0xf057('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf057('0x5'));var sox=require('sox');var csv=require(_0xf057('0x6'));var ejs=require(_0xf057('0x7'));var fs=require('fs');var _=require(_0xf057('0x8'));var squel=require(_0xf057('0x9'));var crypto=require(_0xf057('0xa'));var jsforce=require(_0xf057('0xb'));var deskjs=require(_0xf057('0xc'));var toCsv=require(_0xf057('0x6'));var querystring=require(_0xf057('0xd'));var Papa=require(_0xf057('0xe'));var Redis=require(_0xf057('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf057('0x10'));var as=require(_0xf057('0x11'));var hardwareService=require(_0xf057('0x12'));var logger=require(_0xf057('0x13'))(_0xf057('0x14'));var utils=require(_0xf057('0x15'));var config=require(_0xf057('0x16'));var db=require(_0xf057('0x17'))['db'];var jayson=require(_0xf057('0x18'));var client=jayson[_0xf057('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x3b8011,_0xad15b4,_0xbf4101){if(_0xbf4101){var _0x409bb8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x409bb8[_0xf057('0x1a')](_0xad15b4)){return _0x3b8011;}else{throw new db['Sequelize'][(_0xf057('0x1b'))](_0xf057('0x1c'));}}else{return _0x3b8011;}}function respondWithRpcPromise(_0x5af6c4,_0x3847ed,_0xa183de,_0x20fcfa){return new BPromise(function(_0x359e2b,_0x5d3b38){var _0xedcd43=_0x20fcfa||client;return _0xedcd43[_0xf057('0x1d')](_0x5af6c4,_0xa183de)['then'](function(_0x3cf590){logger[_0xf057('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3847ed,_0xf057('0x1f'));logger['debug'](_0xf057('0x20'),_0x3847ed,_0xf057('0x1f'),JSON['stringify'](_0x3cf590));if(_0x3cf590[_0xf057('0x21')]){if(_0x3cf590[_0xf057('0x21')][_0xf057('0x22')]===0x1f4){logger[_0xf057('0x21')](_0xf057('0x23'),_0x3847ed,_0x3cf590['error']['message']);return _0x5d3b38(_0x3cf590['error'][_0xf057('0x24')]);}logger[_0xf057('0x21')](_0xf057('0x23'),_0x3847ed,_0x3cf590[_0xf057('0x21')][_0xf057('0x24')]);return _0x359e2b(_0x3cf590[_0xf057('0x21')][_0xf057('0x24')]);}else{logger[_0xf057('0x1e')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3847ed,_0xf057('0x1f'));_0x359e2b(_0x3cf590['result'][_0xf057('0x24')]);}})[_0xf057('0x25')](function(_0x210fd2){logger[_0xf057('0x21')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3847ed,_0x210fd2);_0x5d3b38(_0x210fd2);});});}function respondWithStatusCode(_0x173ca8,_0x2eff89){_0x2eff89=_0x2eff89||0xcc;return function(_0x5786c2){if(_0x5786c2){return _0x173ca8['sendStatus'](_0x2eff89);}return _0x173ca8['status'](_0x2eff89)['end']();};}function respondWithResult(_0x438e7e,_0x5666eb){_0x5666eb=_0x5666eb||0xc8;return function(_0x457d22){if(_0x457d22){return _0x438e7e[_0xf057('0x26')](_0x5666eb)[_0xf057('0x27')](_0x457d22);}};}function respondWithFilteredResult(_0x3f700e,_0x40ab42){return function(_0x40062d){if(_0x40062d){var _0x3b5bc6=_0x40062d['count'],_0x37a49c=_0x40ab42[_0xf057('0x28')],_0x35ac14=_0x40ab42['offset']+_0x40ab42[_0xf057('0x29')],_0x42b977;if(_0x35ac14>=_0x3b5bc6){_0x35ac14=_0x3b5bc6;_0x42b977=0xc8;}else{_0x42b977=0xce;}_0x3f700e[_0xf057('0x26')](_0x42b977);return _0x3f700e[_0xf057('0x2a')]('Content-Range',_0x37a49c+'-'+_0x35ac14+'/'+_0x3b5bc6)['json'](_0x40062d);}return null;};}function patchUpdates(_0x383aa3){return function(_0x54d309){try{jsonpatch[_0xf057('0x2b')](_0x54d309,_0x383aa3,!![]);}catch(_0x116480){return BPromise[_0xf057('0x2c')](_0x116480);}return _0x54d309[_0xf057('0x2d')]();};}function saveUpdates(_0x1883b2,_0x53bcf6){return function(_0xc9af1c){if(_0xc9af1c){return _0xc9af1c[_0xf057('0x2e')](_0x1883b2)[_0xf057('0x2f')](function(_0x464f3e){return _0x464f3e;});}return null;};}function removeEntity(_0x46eaa6,_0x3d78d5){return function(_0x56d6e0){if(_0x56d6e0){return _0x56d6e0[_0xf057('0x30')]()['then'](function(){_0x46eaa6[_0xf057('0x26')](0xcc)[_0xf057('0x31')]();});}};}function handleEntityNotFound(_0x1d38c7,_0x50079d){return function(_0x2ee824){if(!_0x2ee824){_0x1d38c7['sendStatus'](0x194);}return _0x2ee824;};}function handleError(_0x66cd42,_0x379d56){_0x379d56=_0x379d56||0x1f4;return function(_0x521e7b){logger[_0xf057('0x21')](_0x521e7b[_0xf057('0x32')]);if(_0x521e7b[_0xf057('0x33')]){delete _0x521e7b[_0xf057('0x33')];}_0x66cd42[_0xf057('0x26')](_0x379d56)['send'](_0x521e7b);};}exports[_0xf057('0x34')]=function(_0x530e52,_0x41554c){var _0x14c884={},_0x58255f={},_0x235dac={'count':0x0,'rows':[]};var _0x2bc625=_[_0xf057('0x35')](db[_0xf057('0x36')][_0xf057('0x37')],function(_0x1b0b48){return{'name':_0x1b0b48[_0xf057('0x38')],'type':_0x1b0b48[_0xf057('0x39')][_0xf057('0x3a')]};});_0x58255f[_0xf057('0x3b')]=_[_0xf057('0x35')](_0x2bc625,_0xf057('0x33'));_0x58255f[_0xf057('0x3c')]=_[_0xf057('0x3d')](_0x530e52[_0xf057('0x3c')]);_0x58255f[_0xf057('0x3e')]=_[_0xf057('0x3f')](_0x58255f[_0xf057('0x3b')],_0x58255f['query']);_0x14c884[_0xf057('0x40')]=_['intersection'](_0x58255f[_0xf057('0x3b')],qs[_0xf057('0x41')](_0x530e52[_0xf057('0x3c')][_0xf057('0x41')]));_0x14c884['attributes']=_0x14c884[_0xf057('0x40')]['length']?_0x14c884[_0xf057('0x40')]:_0x58255f[_0xf057('0x3b')];if(!_0x530e52[_0xf057('0x3c')][_0xf057('0x42')](_0xf057('0x43'))){_0x14c884[_0xf057('0x29')]=qs[_0xf057('0x29')](_0x530e52['query'][_0xf057('0x29')]);_0x14c884[_0xf057('0x28')]=qs[_0xf057('0x28')](_0x530e52[_0xf057('0x3c')][_0xf057('0x28')]);}_0x14c884[_0xf057('0x44')]=qs[_0xf057('0x45')](_0x530e52[_0xf057('0x3c')][_0xf057('0x45')]);_0x14c884['where']=qs[_0xf057('0x3e')](_[_0xf057('0x46')](_0x530e52[_0xf057('0x3c')],_0x58255f['filters']),_0x2bc625);if(_0x530e52['query'][_0xf057('0x47')]){_0x14c884[_0xf057('0x48')]=_[_0xf057('0x49')](_0x14c884[_0xf057('0x48')],{'$or':_[_0xf057('0x35')](_0x2bc625,function(_0x443c52){if(_0x443c52[_0xf057('0x39')]!=='VIRTUAL'){var _0x42769a={};_0x42769a[_0x443c52[_0xf057('0x33')]]={'$like':'%'+_0x530e52[_0xf057('0x3c')][_0xf057('0x47')]+'%'};return _0x42769a;}})});}_0x14c884=_[_0xf057('0x49')]({},_0x14c884,_0x530e52['options']);var _0x49c66f={'where':_0x14c884[_0xf057('0x48')]};return db[_0xf057('0x36')][_0xf057('0x4a')](_0x49c66f)[_0xf057('0x2f')](function(_0x4ed7c4){_0x235dac[_0xf057('0x4a')]=_0x4ed7c4;if(_0x530e52[_0xf057('0x3c')][_0xf057('0x4b')]){_0x14c884[_0xf057('0x4c')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xf057('0x4d')](_0x14c884);})[_0xf057('0x2f')](function(_0x4c2a99){_0x235dac[_0xf057('0x4e')]=_0x4c2a99;return _0x235dac;})[_0xf057('0x2f')](respondWithFilteredResult(_0x41554c,_0x14c884))[_0xf057('0x25')](handleError(_0x41554c,null));};exports[_0xf057('0x4f')]=function(_0x12e25c,_0x1c8ee9){var _0xa58e8e={'raw':![],'where':{'id':_0x12e25c[_0xf057('0x50')]['id']}},_0x3d7a8c={};_0x3d7a8c[_0xf057('0x3b')]=_[_0xf057('0x3d')](db[_0xf057('0x36')][_0xf057('0x37')]);_0x3d7a8c[_0xf057('0x3c')]=_['keys'](_0x12e25c['query']);_0x3d7a8c[_0xf057('0x3e')]=_[_0xf057('0x3f')](_0x3d7a8c[_0xf057('0x3b')],_0x3d7a8c[_0xf057('0x3c')]);_0xa58e8e[_0xf057('0x40')]=_[_0xf057('0x3f')](_0x3d7a8c[_0xf057('0x3b')],qs[_0xf057('0x41')](_0x12e25c[_0xf057('0x3c')][_0xf057('0x41')]));_0xa58e8e[_0xf057('0x40')]=_0xa58e8e[_0xf057('0x40')][_0xf057('0x51')]?_0xa58e8e[_0xf057('0x40')]:_0x3d7a8c['model'];if(_0x12e25c[_0xf057('0x3c')]['includeAll']){_0xa58e8e[_0xf057('0x4c')]=[{'all':!![]}];}_0xa58e8e=_[_0xf057('0x49')]({},_0xa58e8e,_0x12e25c[_0xf057('0x52')]);return db['SalesforceConfiguration']['find'](_0xa58e8e)[_0xf057('0x2f')](handleEntityNotFound(_0x1c8ee9,null))[_0xf057('0x2f')](respondWithResult(_0x1c8ee9,null))[_0xf057('0x25')](handleError(_0x1c8ee9,null));};exports[_0xf057('0x53')]=function(_0x2c9941,_0x3ee842){return db['SalesforceConfiguration'][_0xf057('0x53')](_0x2c9941[_0xf057('0x54')],{})['then'](respondWithResult(_0x3ee842,0xc9))[_0xf057('0x25')](handleError(_0x3ee842,null));};exports[_0xf057('0x2e')]=function(_0x3acfc8,_0x405feb){if(_0x3acfc8[_0xf057('0x54')]['id']){delete _0x3acfc8['body']['id'];}return db[_0xf057('0x36')][_0xf057('0x55')]({'where':{'id':_0x3acfc8[_0xf057('0x50')]['id']}})[_0xf057('0x2f')](handleEntityNotFound(_0x405feb,null))[_0xf057('0x2f')](saveUpdates(_0x3acfc8[_0xf057('0x54')],null))[_0xf057('0x2f')](respondWithResult(_0x405feb,null))['catch'](handleError(_0x405feb,null));};exports[_0xf057('0x30')]=function(_0x40ef13,_0x5bd8dd){return db['SalesforceConfiguration']['find']({'where':{'id':_0x40ef13['params']['id']}})['then'](handleEntityNotFound(_0x5bd8dd,null))[_0xf057('0x2f')](removeEntity(_0x5bd8dd,null))[_0xf057('0x25')](handleError(_0x5bd8dd,null));};exports[_0xf057('0x56')]=function(_0x293dce,_0x49444a,_0x3f24d0){var _0x16c3aa={};var _0x81f880={};var _0x1cb179;var _0x21c818;return db[_0xf057('0x36')]['findOne']({'where':{'id':_0x293dce[_0xf057('0x50')]['id']}})[_0xf057('0x2f')](handleEntityNotFound(_0x49444a,null))[_0xf057('0x2f')](function(_0x2dfa60){if(_0x2dfa60){_0x1cb179=_0x2dfa60;_0x81f880[_0xf057('0x3b')]=_[_0xf057('0x3d')](db[_0xf057('0x57')][_0xf057('0x37')]);_0x81f880[_0xf057('0x3c')]=_[_0xf057('0x3d')](_0x293dce[_0xf057('0x3c')]);_0x81f880[_0xf057('0x3e')]=_[_0xf057('0x3f')](_0x81f880[_0xf057('0x3b')],_0x81f880[_0xf057('0x3c')]);_0x16c3aa[_0xf057('0x40')]=_[_0xf057('0x3f')](_0x81f880[_0xf057('0x3b')],qs[_0xf057('0x41')](_0x293dce[_0xf057('0x3c')]['fields']));_0x16c3aa[_0xf057('0x40')]=_0x16c3aa[_0xf057('0x40')][_0xf057('0x51')]?_0x16c3aa['attributes']:_0x81f880[_0xf057('0x3b')];_0x16c3aa[_0xf057('0x44')]=qs[_0xf057('0x45')](_0x293dce['query'][_0xf057('0x45')]);_0x16c3aa[_0xf057('0x48')]=qs[_0xf057('0x3e')](_['pick'](_0x293dce[_0xf057('0x3c')],_0x81f880[_0xf057('0x3e')]));if(_0x293dce[_0xf057('0x3c')][_0xf057('0x47')]){_0x16c3aa['where']=_[_0xf057('0x49')](_0x16c3aa[_0xf057('0x48')],{'$or':_[_0xf057('0x35')](_0x16c3aa[_0xf057('0x40')],function(_0x72744b){var _0x485692={};_0x485692[_0x72744b]={'$like':'%'+_0x293dce[_0xf057('0x3c')]['filter']+'%'};return _0x485692;})});}_0x16c3aa=_[_0xf057('0x49')]({},_0x16c3aa,_0x293dce[_0xf057('0x52')]);return _0x1cb179[_0xf057('0x56')](_0x16c3aa);}})['then'](function(_0x29872b){if(_0x29872b){_0x21c818=_0x29872b['length'];if(!_0x293dce[_0xf057('0x3c')][_0xf057('0x42')]('nolimit')){_0x16c3aa[_0xf057('0x29')]=qs[_0xf057('0x29')](_0x293dce['query'][_0xf057('0x29')]);_0x16c3aa['offset']=qs[_0xf057('0x28')](_0x293dce['query']['offset']);}return _0x1cb179['getFields'](_0x16c3aa);}})[_0xf057('0x2f')](function(_0x1b7b71){if(_0x1b7b71){return _0x1b7b71?{'count':_0x21c818,'rows':_0x1b7b71}:null;}})[_0xf057('0x2f')](respondWithResult(_0x49444a,null))[_0xf057('0x25')](handleError(_0x49444a,null));};exports[_0xf057('0x58')]=function(_0x3ded5d,_0x5a17fd,_0x138f57){var _0x308178={};var _0x4c87aa={};var _0x580cce;var _0x522140;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x3ded5d[_0xf057('0x50')]['id']}})[_0xf057('0x2f')](handleEntityNotFound(_0x5a17fd,null))[_0xf057('0x2f')](function(_0x8cc522){if(_0x8cc522){_0x580cce=_0x8cc522;_0x4c87aa['model']=_[_0xf057('0x3d')](db[_0xf057('0x57')]['rawAttributes']);_0x4c87aa[_0xf057('0x3c')]=_[_0xf057('0x3d')](_0x3ded5d['query']);_0x4c87aa['filters']=_[_0xf057('0x3f')](_0x4c87aa[_0xf057('0x3b')],_0x4c87aa[_0xf057('0x3c')]);_0x308178[_0xf057('0x40')]=_[_0xf057('0x3f')](_0x4c87aa[_0xf057('0x3b')],qs['fields'](_0x3ded5d[_0xf057('0x3c')]['fields']));_0x308178[_0xf057('0x40')]=_0x308178[_0xf057('0x40')][_0xf057('0x51')]?_0x308178[_0xf057('0x40')]:_0x4c87aa['model'];_0x308178[_0xf057('0x44')]=qs[_0xf057('0x45')](_0x3ded5d[_0xf057('0x3c')][_0xf057('0x45')]);_0x308178[_0xf057('0x48')]=qs[_0xf057('0x3e')](_[_0xf057('0x46')](_0x3ded5d[_0xf057('0x3c')],_0x4c87aa[_0xf057('0x3e')]));if(_0x3ded5d[_0xf057('0x3c')][_0xf057('0x47')]){_0x308178[_0xf057('0x48')]=_['merge'](_0x308178['where'],{'$or':_[_0xf057('0x35')](_0x308178[_0xf057('0x40')],function(_0x29c912){var _0x3c3e53={};_0x3c3e53[_0x29c912]={'$like':'%'+_0x3ded5d[_0xf057('0x3c')][_0xf057('0x47')]+'%'};return _0x3c3e53;})});}_0x308178=_[_0xf057('0x49')]({},_0x308178,_0x3ded5d[_0xf057('0x52')]);return _0x580cce[_0xf057('0x58')](_0x308178);}})[_0xf057('0x2f')](function(_0x490fe8){if(_0x490fe8){_0x522140=_0x490fe8['length'];if(!_0x3ded5d[_0xf057('0x3c')][_0xf057('0x42')](_0xf057('0x43'))){_0x308178[_0xf057('0x29')]=qs['limit'](_0x3ded5d[_0xf057('0x3c')]['limit']);_0x308178['offset']=qs[_0xf057('0x28')](_0x3ded5d[_0xf057('0x3c')][_0xf057('0x28')]);}return _0x580cce['getSubjects'](_0x308178);}})[_0xf057('0x2f')](function(_0x1d48dc){if(_0x1d48dc){return _0x1d48dc?{'count':_0x522140,'rows':_0x1d48dc}:null;}})[_0xf057('0x2f')](respondWithResult(_0x5a17fd,null))[_0xf057('0x25')](handleError(_0x5a17fd,null));};exports[_0xf057('0x59')]=function(_0x57f694,_0x7826de,_0x217fc9){var _0x3702fe={};var _0x2236e3={};var _0xdf7693;var _0x5cf74f;return db['SalesforceConfiguration'][_0xf057('0x5a')]({'where':{'id':_0x57f694['params']['id']}})[_0xf057('0x2f')](handleEntityNotFound(_0x7826de,null))['then'](function(_0x5a81ae){if(_0x5a81ae){_0xdf7693=_0x5a81ae;_0x2236e3[_0xf057('0x3b')]=_[_0xf057('0x3d')](db[_0xf057('0x57')][_0xf057('0x37')]);_0x2236e3[_0xf057('0x3c')]=_[_0xf057('0x3d')](_0x57f694[_0xf057('0x3c')]);_0x2236e3[_0xf057('0x3e')]=_['intersection'](_0x2236e3[_0xf057('0x3b')],_0x2236e3[_0xf057('0x3c')]);_0x3702fe[_0xf057('0x40')]=_[_0xf057('0x3f')](_0x2236e3['model'],qs[_0xf057('0x41')](_0x57f694[_0xf057('0x3c')][_0xf057('0x41')]));_0x3702fe['attributes']=_0x3702fe[_0xf057('0x40')][_0xf057('0x51')]?_0x3702fe[_0xf057('0x40')]:_0x2236e3[_0xf057('0x3b')];_0x3702fe[_0xf057('0x44')]=qs['sort'](_0x57f694['query'][_0xf057('0x45')]);_0x3702fe['where']=qs[_0xf057('0x3e')](_[_0xf057('0x46')](_0x57f694[_0xf057('0x3c')],_0x2236e3['filters']));if(_0x57f694[_0xf057('0x3c')][_0xf057('0x47')]){_0x3702fe['where']=_['merge'](_0x3702fe[_0xf057('0x48')],{'$or':_[_0xf057('0x35')](_0x3702fe[_0xf057('0x40')],function(_0x5bdb94){var _0x2a09f0={};_0x2a09f0[_0x5bdb94]={'$like':'%'+_0x57f694[_0xf057('0x3c')][_0xf057('0x47')]+'%'};return _0x2a09f0;})});}_0x3702fe=_[_0xf057('0x49')]({},_0x3702fe,_0x57f694[_0xf057('0x52')]);return _0xdf7693[_0xf057('0x59')](_0x3702fe);}})[_0xf057('0x2f')](function(_0x5cd14d){if(_0x5cd14d){_0x5cf74f=_0x5cd14d['length'];if(!_0x57f694[_0xf057('0x3c')][_0xf057('0x42')](_0xf057('0x43'))){_0x3702fe['limit']=qs['limit'](_0x57f694['query']['limit']);_0x3702fe['offset']=qs[_0xf057('0x28')](_0x57f694[_0xf057('0x3c')][_0xf057('0x28')]);}return _0xdf7693[_0xf057('0x59')](_0x3702fe);}})[_0xf057('0x2f')](function(_0xb53821){if(_0xb53821){return _0xb53821?{'count':_0x5cf74f,'rows':_0xb53821}:null;}})[_0xf057('0x2f')](respondWithResult(_0x7826de,null))[_0xf057('0x25')](handleError(_0x7826de,null));}; \ No newline at end of file +var _0xe60e=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../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','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','fieldName','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','SalesforceConfiguration','includeAll','include','rows','show','keys','create','body','update','find','params','getFields','findOne','SalesforceField','rawAttributes','length','nolimit','pick','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x58347e,_0x2c6409){var _0x493ca6=function(_0x8b3a4c){while(--_0x8b3a4c){_0x58347e['push'](_0x58347e['shift']());}};_0x493ca6(++_0x2c6409);}(_0xe60e,0x10a));var _0xee60=function(_0x3f1129,_0x1f0b7d){_0x3f1129=_0x3f1129-0x0;var _0x2ea49f=_0xe60e[_0x3f1129];return _0x2ea49f;};'use strict';var pdf=require(_0xee60('0x0'));var emlformat=require(_0xee60('0x1'));var rimraf=require(_0xee60('0x2'));var zipdir=require(_0xee60('0x3'));var jsonpatch=require(_0xee60('0x4'));var rp=require(_0xee60('0x5'));var moment=require(_0xee60('0x6'));var BPromise=require(_0xee60('0x7'));var Mustache=require(_0xee60('0x8'));var util=require('util');var path=require(_0xee60('0x9'));var sox=require(_0xee60('0xa'));var csv=require(_0xee60('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xee60('0xc'));var crypto=require(_0xee60('0xd'));var jsforce=require(_0xee60('0xe'));var deskjs=require(_0xee60('0xf'));var toCsv=require('to-csv');var querystring=require(_0xee60('0x10'));var Papa=require(_0xee60('0x11'));var Redis=require(_0xee60('0x12'));var authService=require(_0xee60('0x13'));var qs=require(_0xee60('0x14'));var as=require(_0xee60('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee60('0x16'))(_0xee60('0x17'));var utils=require(_0xee60('0x18'));var config=require('../../config/environment');var db=require(_0xee60('0x19'))['db'];var jayson=require(_0xee60('0x1a'));var client=jayson[_0xee60('0x1b')][_0xee60('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xe1be2c,_0x404ee7,_0x557a06){if(_0x557a06){var _0x13042f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13042f[_0xee60('0x1d')](_0x404ee7)){return _0xe1be2c;}else{throw new db['Sequelize'][(_0xee60('0x1e'))](_0xee60('0x1f'));}}else{return _0xe1be2c;}}function respondWithRpcPromise(_0x4cb7e5,_0x40846f,_0x21ee84,_0x2b425a){return new BPromise(function(_0x5ed628,_0x530630){var _0x42e037=_0x2b425a||client;return _0x42e037[_0xee60('0x20')](_0x4cb7e5,_0x21ee84)[_0xee60('0x21')](function(_0x15b05c){logger['info'](_0xee60('0x22'),_0x40846f,'request\x20sent');logger['debug'](_0xee60('0x23'),_0x40846f,'request\x20sent',JSON['stringify'](_0x15b05c));if(_0x15b05c['error']){if(_0x15b05c['error'][_0xee60('0x24')]===0x1f4){logger[_0xee60('0x25')]('SalesforceConfiguration,\x20%s,\x20%s',_0x40846f,_0x15b05c['error'][_0xee60('0x26')]);return _0x530630(_0x15b05c[_0xee60('0x25')][_0xee60('0x26')]);}logger[_0xee60('0x25')](_0xee60('0x22'),_0x40846f,_0x15b05c[_0xee60('0x25')]['message']);return _0x5ed628(_0x15b05c[_0xee60('0x25')][_0xee60('0x26')]);}else{logger[_0xee60('0x27')]('SalesforceConfiguration,\x20%s,\x20%s',_0x40846f,'request\x20sent');_0x5ed628(_0x15b05c[_0xee60('0x28')][_0xee60('0x26')]);}})[_0xee60('0x29')](function(_0x10adcd){logger[_0xee60('0x25')](_0xee60('0x22'),_0x40846f,_0x10adcd);_0x530630(_0x10adcd);});});}function respondWithStatusCode(_0x17f257,_0xd68ac7){_0xd68ac7=_0xd68ac7||0xcc;return function(_0x58bed0){if(_0x58bed0){return _0x17f257['sendStatus'](_0xd68ac7);}return _0x17f257[_0xee60('0x2a')](_0xd68ac7)[_0xee60('0x2b')]();};}function respondWithResult(_0x3a0522,_0x2cf7e6){_0x2cf7e6=_0x2cf7e6||0xc8;return function(_0xcc440){if(_0xcc440){return _0x3a0522[_0xee60('0x2a')](_0x2cf7e6)[_0xee60('0x2c')](_0xcc440);}};}function respondWithFilteredResult(_0x3471e1,_0x77351f){return function(_0x4ed1cc){if(_0x4ed1cc){var _0x5ab671=_0x4ed1cc[_0xee60('0x2d')],_0x43dd86=_0x77351f[_0xee60('0x2e')],_0x1ee74f=_0x77351f[_0xee60('0x2e')]+_0x77351f[_0xee60('0x2f')],_0x53b824;if(_0x1ee74f>=_0x5ab671){_0x1ee74f=_0x5ab671;_0x53b824=0xc8;}else{_0x53b824=0xce;}_0x3471e1[_0xee60('0x2a')](_0x53b824);return _0x3471e1['set'](_0xee60('0x30'),_0x43dd86+'-'+_0x1ee74f+'/'+_0x5ab671)[_0xee60('0x2c')](_0x4ed1cc);}return null;};}function patchUpdates(_0x1da42f){return function(_0x3badcf){try{jsonpatch[_0xee60('0x31')](_0x3badcf,_0x1da42f,!![]);}catch(_0x1682bd){return BPromise[_0xee60('0x32')](_0x1682bd);}return _0x3badcf[_0xee60('0x33')]();};}function saveUpdates(_0x21bd37,_0x1203f1){return function(_0x3cc97d){if(_0x3cc97d){return _0x3cc97d['update'](_0x21bd37)[_0xee60('0x21')](function(_0x55ae47){return _0x55ae47;});}return null;};}function removeEntity(_0x3bc11d,_0x5b0753){return function(_0x1f2b54){if(_0x1f2b54){return _0x1f2b54[_0xee60('0x34')]()['then'](function(){_0x3bc11d[_0xee60('0x2a')](0xcc)[_0xee60('0x2b')]();});}};}function handleEntityNotFound(_0x24988e,_0x540aaa){return function(_0x595095){if(!_0x595095){_0x24988e[_0xee60('0x35')](0x194);}return _0x595095;};}function handleError(_0x19e64a,_0x2bd562){_0x2bd562=_0x2bd562||0x1f4;return function(_0x3d8e8b){logger['error'](_0x3d8e8b[_0xee60('0x36')]);if(_0x3d8e8b[_0xee60('0x37')]){delete _0x3d8e8b[_0xee60('0x37')];}_0x19e64a[_0xee60('0x2a')](_0x2bd562)[_0xee60('0x38')](_0x3d8e8b);};}exports['index']=function(_0x1f5bdc,_0x255b95){var _0x30ce4d={},_0xee7c97={},_0x518530={'count':0x0,'rows':[]};var _0x4d8d94=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x5e93d5){return{'name':_0x5e93d5[_0xee60('0x39')],'type':_0x5e93d5['type'][_0xee60('0x3a')]};});_0xee7c97[_0xee60('0x3b')]=_[_0xee60('0x3c')](_0x4d8d94,_0xee60('0x37'));_0xee7c97['query']=_['keys'](_0x1f5bdc[_0xee60('0x3d')]);_0xee7c97[_0xee60('0x3e')]=_[_0xee60('0x3f')](_0xee7c97[_0xee60('0x3b')],_0xee7c97['query']);_0x30ce4d['attributes']=_['intersection'](_0xee7c97['model'],qs[_0xee60('0x40')](_0x1f5bdc['query'][_0xee60('0x40')]));_0x30ce4d[_0xee60('0x41')]=_0x30ce4d['attributes']['length']?_0x30ce4d[_0xee60('0x41')]:_0xee7c97[_0xee60('0x3b')];if(!_0x1f5bdc['query'][_0xee60('0x42')]('nolimit')){_0x30ce4d[_0xee60('0x2f')]=qs['limit'](_0x1f5bdc['query'][_0xee60('0x2f')]);_0x30ce4d[_0xee60('0x2e')]=qs['offset'](_0x1f5bdc[_0xee60('0x3d')][_0xee60('0x2e')]);}_0x30ce4d[_0xee60('0x43')]=qs[_0xee60('0x44')](_0x1f5bdc['query'][_0xee60('0x44')]);_0x30ce4d[_0xee60('0x45')]=qs[_0xee60('0x3e')](_['pick'](_0x1f5bdc[_0xee60('0x3d')],_0xee7c97[_0xee60('0x3e')]),_0x4d8d94);if(_0x1f5bdc['query'][_0xee60('0x46')]){_0x30ce4d[_0xee60('0x45')]=_[_0xee60('0x47')](_0x30ce4d[_0xee60('0x45')],{'$or':_['map'](_0x4d8d94,function(_0x38d5d0){if(_0x38d5d0[_0xee60('0x48')]!==_0xee60('0x49')){var _0x171a0d={};_0x171a0d[_0x38d5d0[_0xee60('0x37')]]={'$like':'%'+_0x1f5bdc[_0xee60('0x3d')][_0xee60('0x46')]+'%'};return _0x171a0d;}})});}_0x30ce4d=_[_0xee60('0x47')]({},_0x30ce4d,_0x1f5bdc[_0xee60('0x4a')]);var _0x30c490={'where':_0x30ce4d['where']};return db[_0xee60('0x4b')][_0xee60('0x2d')](_0x30c490)[_0xee60('0x21')](function(_0x336edf){_0x518530[_0xee60('0x2d')]=_0x336edf;if(_0x1f5bdc[_0xee60('0x3d')][_0xee60('0x4c')]){_0x30ce4d[_0xee60('0x4d')]=[{'all':!![]}];}return db[_0xee60('0x4b')]['findAll'](_0x30ce4d);})[_0xee60('0x21')](function(_0xc2d452){_0x518530[_0xee60('0x4e')]=_0xc2d452;return _0x518530;})[_0xee60('0x21')](respondWithFilteredResult(_0x255b95,_0x30ce4d))[_0xee60('0x29')](handleError(_0x255b95,null));};exports[_0xee60('0x4f')]=function(_0x1a0bed,_0x2d0642){var _0x151c98={'raw':![],'where':{'id':_0x1a0bed['params']['id']}},_0x2800cd={};_0x2800cd[_0xee60('0x3b')]=_[_0xee60('0x50')](db[_0xee60('0x4b')]['rawAttributes']);_0x2800cd[_0xee60('0x3d')]=_[_0xee60('0x50')](_0x1a0bed[_0xee60('0x3d')]);_0x2800cd[_0xee60('0x3e')]=_[_0xee60('0x3f')](_0x2800cd[_0xee60('0x3b')],_0x2800cd[_0xee60('0x3d')]);_0x151c98[_0xee60('0x41')]=_['intersection'](_0x2800cd['model'],qs[_0xee60('0x40')](_0x1a0bed[_0xee60('0x3d')][_0xee60('0x40')]));_0x151c98['attributes']=_0x151c98[_0xee60('0x41')]['length']?_0x151c98['attributes']:_0x2800cd[_0xee60('0x3b')];if(_0x1a0bed[_0xee60('0x3d')][_0xee60('0x4c')]){_0x151c98[_0xee60('0x4d')]=[{'all':!![]}];}_0x151c98=_[_0xee60('0x47')]({},_0x151c98,_0x1a0bed['options']);return db[_0xee60('0x4b')]['find'](_0x151c98)['then'](handleEntityNotFound(_0x2d0642,null))['then'](respondWithResult(_0x2d0642,null))[_0xee60('0x29')](handleError(_0x2d0642,null));};exports[_0xee60('0x51')]=function(_0x1d9e44,_0x4ffa44){return db[_0xee60('0x4b')][_0xee60('0x51')](_0x1d9e44[_0xee60('0x52')],{})[_0xee60('0x21')](respondWithResult(_0x4ffa44,0xc9))[_0xee60('0x29')](handleError(_0x4ffa44,null));};exports[_0xee60('0x53')]=function(_0x4b6360,_0x470af8){if(_0x4b6360[_0xee60('0x52')]['id']){delete _0x4b6360[_0xee60('0x52')]['id'];}return db[_0xee60('0x4b')][_0xee60('0x54')]({'where':{'id':_0x4b6360[_0xee60('0x55')]['id']}})['then'](handleEntityNotFound(_0x470af8,null))[_0xee60('0x21')](saveUpdates(_0x4b6360['body'],null))['then'](respondWithResult(_0x470af8,null))['catch'](handleError(_0x470af8,null));};exports[_0xee60('0x34')]=function(_0x2dacef,_0x4f7d8a){return db[_0xee60('0x4b')][_0xee60('0x54')]({'where':{'id':_0x2dacef[_0xee60('0x55')]['id']}})[_0xee60('0x21')](handleEntityNotFound(_0x4f7d8a,null))['then'](removeEntity(_0x4f7d8a,null))[_0xee60('0x29')](handleError(_0x4f7d8a,null));};exports[_0xee60('0x56')]=function(_0x3fc2ad,_0x326be1,_0x143dd0){var _0x1eb9e7={};var _0x2eca44={};var _0x4c69fe;var _0x388e7b;return db[_0xee60('0x4b')][_0xee60('0x57')]({'where':{'id':_0x3fc2ad[_0xee60('0x55')]['id']}})['then'](handleEntityNotFound(_0x326be1,null))[_0xee60('0x21')](function(_0x5ce65f){if(_0x5ce65f){_0x4c69fe=_0x5ce65f;_0x2eca44[_0xee60('0x3b')]=_[_0xee60('0x50')](db[_0xee60('0x58')][_0xee60('0x59')]);_0x2eca44[_0xee60('0x3d')]=_[_0xee60('0x50')](_0x3fc2ad[_0xee60('0x3d')]);_0x2eca44[_0xee60('0x3e')]=_[_0xee60('0x3f')](_0x2eca44[_0xee60('0x3b')],_0x2eca44[_0xee60('0x3d')]);_0x1eb9e7[_0xee60('0x41')]=_[_0xee60('0x3f')](_0x2eca44[_0xee60('0x3b')],qs[_0xee60('0x40')](_0x3fc2ad[_0xee60('0x3d')][_0xee60('0x40')]));_0x1eb9e7[_0xee60('0x41')]=_0x1eb9e7[_0xee60('0x41')][_0xee60('0x5a')]?_0x1eb9e7[_0xee60('0x41')]:_0x2eca44['model'];_0x1eb9e7[_0xee60('0x43')]=qs[_0xee60('0x44')](_0x3fc2ad[_0xee60('0x3d')]['sort']);_0x1eb9e7['where']=qs[_0xee60('0x3e')](_['pick'](_0x3fc2ad[_0xee60('0x3d')],_0x2eca44[_0xee60('0x3e')]));if(_0x3fc2ad[_0xee60('0x3d')][_0xee60('0x46')]){_0x1eb9e7[_0xee60('0x45')]=_[_0xee60('0x47')](_0x1eb9e7[_0xee60('0x45')],{'$or':_[_0xee60('0x3c')](_0x1eb9e7['attributes'],function(_0x9c6abf){var _0x1372ec={};_0x1372ec[_0x9c6abf]={'$like':'%'+_0x3fc2ad[_0xee60('0x3d')][_0xee60('0x46')]+'%'};return _0x1372ec;})});}_0x1eb9e7=_[_0xee60('0x47')]({},_0x1eb9e7,_0x3fc2ad[_0xee60('0x4a')]);return _0x4c69fe[_0xee60('0x56')](_0x1eb9e7);}})[_0xee60('0x21')](function(_0x3573a0){if(_0x3573a0){_0x388e7b=_0x3573a0['length'];if(!_0x3fc2ad[_0xee60('0x3d')][_0xee60('0x42')](_0xee60('0x5b'))){_0x1eb9e7[_0xee60('0x2f')]=qs['limit'](_0x3fc2ad[_0xee60('0x3d')]['limit']);_0x1eb9e7[_0xee60('0x2e')]=qs['offset'](_0x3fc2ad[_0xee60('0x3d')][_0xee60('0x2e')]);}return _0x4c69fe[_0xee60('0x56')](_0x1eb9e7);}})['then'](function(_0x1996d6){if(_0x1996d6){return _0x1996d6?{'count':_0x388e7b,'rows':_0x1996d6}:null;}})[_0xee60('0x21')](respondWithResult(_0x326be1,null))[_0xee60('0x29')](handleError(_0x326be1,null));};exports['getSubjects']=function(_0x12b236,_0x14b41d,_0x1cb0bb){var _0x26f4aa={};var _0x29cc99={};var _0x359249;var _0x4010a3;return db['SalesforceConfiguration'][_0xee60('0x57')]({'where':{'id':_0x12b236['params']['id']}})['then'](handleEntityNotFound(_0x14b41d,null))[_0xee60('0x21')](function(_0x607b30){if(_0x607b30){_0x359249=_0x607b30;_0x29cc99[_0xee60('0x3b')]=_[_0xee60('0x50')](db[_0xee60('0x58')][_0xee60('0x59')]);_0x29cc99['query']=_[_0xee60('0x50')](_0x12b236['query']);_0x29cc99[_0xee60('0x3e')]=_[_0xee60('0x3f')](_0x29cc99[_0xee60('0x3b')],_0x29cc99[_0xee60('0x3d')]);_0x26f4aa[_0xee60('0x41')]=_[_0xee60('0x3f')](_0x29cc99[_0xee60('0x3b')],qs[_0xee60('0x40')](_0x12b236[_0xee60('0x3d')][_0xee60('0x40')]));_0x26f4aa['attributes']=_0x26f4aa[_0xee60('0x41')][_0xee60('0x5a')]?_0x26f4aa[_0xee60('0x41')]:_0x29cc99['model'];_0x26f4aa[_0xee60('0x43')]=qs['sort'](_0x12b236[_0xee60('0x3d')][_0xee60('0x44')]);_0x26f4aa[_0xee60('0x45')]=qs[_0xee60('0x3e')](_[_0xee60('0x5c')](_0x12b236[_0xee60('0x3d')],_0x29cc99['filters']));if(_0x12b236['query'][_0xee60('0x46')]){_0x26f4aa[_0xee60('0x45')]=_[_0xee60('0x47')](_0x26f4aa[_0xee60('0x45')],{'$or':_['map'](_0x26f4aa[_0xee60('0x41')],function(_0x2a3704){var _0x374971={};_0x374971[_0x2a3704]={'$like':'%'+_0x12b236[_0xee60('0x3d')][_0xee60('0x46')]+'%'};return _0x374971;})});}_0x26f4aa=_[_0xee60('0x47')]({},_0x26f4aa,_0x12b236['options']);return _0x359249[_0xee60('0x5d')](_0x26f4aa);}})[_0xee60('0x21')](function(_0x3677dd){if(_0x3677dd){_0x4010a3=_0x3677dd[_0xee60('0x5a')];if(!_0x12b236[_0xee60('0x3d')][_0xee60('0x42')](_0xee60('0x5b'))){_0x26f4aa[_0xee60('0x2f')]=qs['limit'](_0x12b236['query'][_0xee60('0x2f')]);_0x26f4aa['offset']=qs[_0xee60('0x2e')](_0x12b236['query']['offset']);}return _0x359249[_0xee60('0x5d')](_0x26f4aa);}})[_0xee60('0x21')](function(_0x5738df){if(_0x5738df){return _0x5738df?{'count':_0x4010a3,'rows':_0x5738df}:null;}})[_0xee60('0x21')](respondWithResult(_0x14b41d,null))['catch'](handleError(_0x14b41d,null));};exports['getDescriptions']=function(_0x1f4d00,_0x7fe21d,_0xb5cf82){var _0x2bf4ef={};var _0x36f408={};var _0x144316;var _0x31e6c6;return db[_0xee60('0x4b')][_0xee60('0x57')]({'where':{'id':_0x1f4d00[_0xee60('0x55')]['id']}})[_0xee60('0x21')](handleEntityNotFound(_0x7fe21d,null))[_0xee60('0x21')](function(_0x1f4803){if(_0x1f4803){_0x144316=_0x1f4803;_0x36f408['model']=_[_0xee60('0x50')](db[_0xee60('0x58')]['rawAttributes']);_0x36f408['query']=_['keys'](_0x1f4d00[_0xee60('0x3d')]);_0x36f408[_0xee60('0x3e')]=_[_0xee60('0x3f')](_0x36f408[_0xee60('0x3b')],_0x36f408[_0xee60('0x3d')]);_0x2bf4ef[_0xee60('0x41')]=_[_0xee60('0x3f')](_0x36f408[_0xee60('0x3b')],qs[_0xee60('0x40')](_0x1f4d00[_0xee60('0x3d')][_0xee60('0x40')]));_0x2bf4ef[_0xee60('0x41')]=_0x2bf4ef[_0xee60('0x41')][_0xee60('0x5a')]?_0x2bf4ef[_0xee60('0x41')]:_0x36f408['model'];_0x2bf4ef['order']=qs[_0xee60('0x44')](_0x1f4d00[_0xee60('0x3d')][_0xee60('0x44')]);_0x2bf4ef[_0xee60('0x45')]=qs['filters'](_['pick'](_0x1f4d00[_0xee60('0x3d')],_0x36f408[_0xee60('0x3e')]));if(_0x1f4d00[_0xee60('0x3d')][_0xee60('0x46')]){_0x2bf4ef[_0xee60('0x45')]=_[_0xee60('0x47')](_0x2bf4ef[_0xee60('0x45')],{'$or':_[_0xee60('0x3c')](_0x2bf4ef[_0xee60('0x41')],function(_0x3d08bc){var _0x45e005={};_0x45e005[_0x3d08bc]={'$like':'%'+_0x1f4d00['query']['filter']+'%'};return _0x45e005;})});}_0x2bf4ef=_[_0xee60('0x47')]({},_0x2bf4ef,_0x1f4d00[_0xee60('0x4a')]);return _0x144316['getDescriptions'](_0x2bf4ef);}})['then'](function(_0xc19939){if(_0xc19939){_0x31e6c6=_0xc19939[_0xee60('0x5a')];if(!_0x1f4d00[_0xee60('0x3d')][_0xee60('0x42')](_0xee60('0x5b'))){_0x2bf4ef[_0xee60('0x2f')]=qs[_0xee60('0x2f')](_0x1f4d00[_0xee60('0x3d')]['limit']);_0x2bf4ef[_0xee60('0x2e')]=qs[_0xee60('0x2e')](_0x1f4d00[_0xee60('0x3d')][_0xee60('0x2e')]);}return _0x144316[_0xee60('0x5e')](_0x2bf4ef);}})[_0xee60('0x21')](function(_0x3a10f8){if(_0x3a10f8){return _0x3a10f8?{'count':_0x31e6c6,'rows':_0x3a10f8}:null;}})[_0xee60('0x21')](respondWithResult(_0x7fe21d,null))[_0xee60('0x29')](handleError(_0x7fe21d,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index be8f6c5..63acaf9 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 _0xeed7=['SalesforceConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define'];(function(_0x1f3e88,_0x583f45){var _0x419b01=function(_0x21deae){while(--_0x21deae){_0x1f3e88['push'](_0x1f3e88['shift']());}};_0x419b01(++_0x583f45);}(_0xeed7,0x105));var _0x7eed=function(_0x585ca1,_0x40c937){_0x585ca1=_0x585ca1-0x0;var _0x5309c2=_0xeed7[_0x585ca1];return _0x5309c2;};'use strict';var _=require(_0x7eed('0x0'));var util=require(_0x7eed('0x1'));var logger=require(_0x7eed('0x2'))(_0x7eed('0x3'));var moment=require(_0x7eed('0x4'));var BPromise=require(_0x7eed('0x5'));var rp=require(_0x7eed('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7eed('0x7'));var config=require(_0x7eed('0x8'));var attributes=require(_0x7eed('0x9'));module[_0x7eed('0xa')]=function(_0x575ecb,_0x30834c){return _0x575ecb[_0x7eed('0xb')](_0x7eed('0xc'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf1de=['exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x54b499,_0xa7ba06){var _0x18f599=function(_0xc2521){while(--_0xc2521){_0x54b499['push'](_0x54b499['shift']());}};_0x18f599(++_0xa7ba06);}(_0xf1de,0xf2));var _0xef1d=function(_0x53a0ad,_0x5700c9){_0x53a0ad=_0x53a0ad-0x0;var _0x2e1e21=_0xf1de[_0x53a0ad];return _0x2e1e21;};'use strict';var _=require(_0xef1d('0x0'));var util=require(_0xef1d('0x1'));var logger=require(_0xef1d('0x2'))(_0xef1d('0x3'));var moment=require(_0xef1d('0x4'));var BPromise=require(_0xef1d('0x5'));var rp=require(_0xef1d('0x6'));var fs=require('fs');var path=require(_0xef1d('0x7'));var rimraf=require(_0xef1d('0x8'));var config=require(_0xef1d('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xef1d('0xa')]=function(_0x5cb091,_0x553aaa){return _0x5cb091[_0xef1d('0xb')](_0xef1d('0xc'),attributes,{'tableName':_0xef1d('0xd'),'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 396b338..667d68b 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 _0x7fa9=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SalesforceConfiguration,\x20%s,\x20%s'];(function(_0xb28846,_0x54736a){var _0x3c2518=function(_0x559ede){while(--_0x559ede){_0xb28846['push'](_0xb28846['shift']());}};_0x3c2518(++_0x54736a);}(_0x7fa9,0x1ab));var _0x97fa=function(_0x22856d,_0x1abe86){_0x22856d=_0x22856d-0x0;var _0x517ae3=_0x7fa9[_0x22856d];return _0x517ae3;};'use strict';var _=require('lodash');var util=require(_0x97fa('0x0'));var moment=require(_0x97fa('0x1'));var BPromise=require(_0x97fa('0x2'));var rs=require(_0x97fa('0x3'));var fs=require('fs');var Redis=require(_0x97fa('0x4'));var db=require(_0x97fa('0x5'))['db'];var utils=require(_0x97fa('0x6'));var logger=require(_0x97fa('0x7'))(_0x97fa('0x8'));var config=require(_0x97fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x97fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x565c38,_0x461089,_0x16103e){return new BPromise(function(_0x583223,_0x4ebee1){return client['request'](_0x565c38,_0x16103e)[_0x97fa('0xb')](function(_0x4d5ca2){logger[_0x97fa('0xc')](_0x97fa('0xd'),_0x461089,'request\x20sent');logger['debug'](_0x97fa('0xe'),_0x461089,_0x97fa('0xf'),JSON[_0x97fa('0x10')](_0x4d5ca2));if(_0x4d5ca2[_0x97fa('0x11')]){if(_0x4d5ca2['error'][_0x97fa('0x12')]===0x1f4){logger[_0x97fa('0x11')](_0x97fa('0xd'),_0x461089,_0x4d5ca2[_0x97fa('0x11')][_0x97fa('0x13')]);return _0x4ebee1(_0x4d5ca2[_0x97fa('0x11')][_0x97fa('0x13')]);}logger[_0x97fa('0x11')](_0x97fa('0xd'),_0x461089,_0x4d5ca2[_0x97fa('0x11')][_0x97fa('0x13')]);return _0x583223(_0x4d5ca2[_0x97fa('0x11')][_0x97fa('0x13')]);}else{logger[_0x97fa('0xc')](_0x97fa('0xd'),_0x461089,_0x97fa('0xf'));_0x583223(_0x4d5ca2['result'][_0x97fa('0x13')]);}})[_0x97fa('0x14')](function(_0x456337){logger[_0x97fa('0x11')](_0x97fa('0xd'),_0x461089,_0x456337);_0x4ebee1(_0x456337);});});} \ No newline at end of file +var _0x819c=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4b3413,_0x58c416){var _0x3b01ba=function(_0xb25f43){while(--_0xb25f43){_0x4b3413['push'](_0x4b3413['shift']());}};_0x3b01ba(++_0x58c416);}(_0x819c,0x13a));var _0xc819=function(_0x3a47aa,_0x2b1b38){_0x3a47aa=_0x3a47aa-0x0;var _0x30da26=_0x819c[_0x3a47aa];return _0x30da26;};'use strict';var _=require(_0xc819('0x0'));var util=require(_0xc819('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc819('0x2'));var fs=require('fs');var Redis=require(_0xc819('0x3'));var db=require(_0xc819('0x4'))['db'];var utils=require(_0xc819('0x5'));var logger=require(_0xc819('0x6'))(_0xc819('0x7'));var config=require(_0xc819('0x8'));var jayson=require(_0xc819('0x9'));var client=jayson['client'][_0xc819('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x459ff9,_0x13bd27,_0x246e36){return new BPromise(function(_0x1b592a,_0x12fb9a){return client[_0xc819('0xb')](_0x459ff9,_0x246e36)[_0xc819('0xc')](function(_0x4cac2e){logger['info'](_0xc819('0xd'),_0x13bd27,_0xc819('0xe'));logger['debug'](_0xc819('0xf'),_0x13bd27,_0xc819('0xe'),JSON['stringify'](_0x4cac2e));if(_0x4cac2e[_0xc819('0x10')]){if(_0x4cac2e[_0xc819('0x10')][_0xc819('0x11')]===0x1f4){logger[_0xc819('0x10')](_0xc819('0xd'),_0x13bd27,_0x4cac2e[_0xc819('0x10')][_0xc819('0x12')]);return _0x12fb9a(_0x4cac2e[_0xc819('0x10')]['message']);}logger[_0xc819('0x10')](_0xc819('0xd'),_0x13bd27,_0x4cac2e[_0xc819('0x10')][_0xc819('0x12')]);return _0x1b592a(_0x4cac2e[_0xc819('0x10')]['message']);}else{logger['info'](_0xc819('0xd'),_0x13bd27,_0xc819('0xe'));_0x1b592a(_0x4cac2e['result'][_0xc819('0x12')]);}})[_0xc819('0x13')](function(_0x27bc2a){logger[_0xc819('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x13bd27,_0x27bc2a);_0x12fb9a(_0x27bc2a);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index e115bab..e991069 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 _0xe0ae=['../../config/environment','get','/:id','isAuthenticated','show','update','exports','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x5e6bc8,_0x269dc9){var _0x219c61=function(_0x5cb39e){while(--_0x5cb39e){_0x5e6bc8['push'](_0x5e6bc8['shift']());}};_0x219c61(++_0x269dc9);}(_0xe0ae,0xa1));var _0xee0a=function(_0x4a93bb,_0x495404){_0x4a93bb=_0x4a93bb-0x0;var _0x208468=_0xe0ae[_0x4a93bb];return _0x208468;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee0a('0x0'));var timeout=require(_0xee0a('0x1'));var express=require('express');var router=express[_0xee0a('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xee0a('0x3'));var config=require(_0xee0a('0x4'));var controller=require('./intSalesforceField.controller');router[_0xee0a('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xee0a('0x5')](_0xee0a('0x6'),auth[_0xee0a('0x7')](),controller[_0xee0a('0x8')]);router['post']('/',auth[_0xee0a('0x7')](),controller['create']);router['put'](_0xee0a('0x6'),auth[_0xee0a('0x7')](),controller[_0xee0a('0x9')]);router['delete'](_0xee0a('0x6'),auth[_0xee0a('0x7')](),controller['destroy']);module[_0xee0a('0xa')]=router; \ No newline at end of file +var _0xda19=['post','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x22334b,_0x4e7696){var _0x3a5b46=function(_0x326393){while(--_0x326393){_0x22334b['push'](_0x22334b['shift']());}};_0x3a5b46(++_0x4e7696);}(_0xda19,0xd5));var _0x9da1=function(_0xb3ba1b,_0x5745b6){_0xb3ba1b=_0xb3ba1b-0x0;var _0x22d20d=_0xda19[_0xb3ba1b];return _0x22d20d;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var auth=require(_0x9da1('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9da1('0x4'));var controller=require(_0x9da1('0x5'));router[_0x9da1('0x6')]('/',auth[_0x9da1('0x7')](),controller[_0x9da1('0x8')]);router[_0x9da1('0x6')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xa')]);router[_0x9da1('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9da1('0x9'),auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router[_0x9da1('0xd')](_0x9da1('0x9'),auth[_0x9da1('0x7')](),controller[_0x9da1('0xe')]);module[_0x9da1('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 7c00db4..8cc8792 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 _0x86d7=['customVariable','keyValue','STRING','sequelize','ENUM','string','variable'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x86d7,0x184));var _0x786d=function(_0x121e71,_0x3d3c13){_0x121e71=_0x121e71-0x0;var _0x2acc8c=_0x86d7[_0x121e71];return _0x2acc8c;};'use strict';var Sequelize=require(_0x786d('0x0'));module['exports']={'type':{'type':Sequelize[_0x786d('0x1')](_0x786d('0x2'),_0x786d('0x3'),_0x786d('0x4'),_0x786d('0x5')),'defaultValue':_0x786d('0x2')},'content':{'type':Sequelize[_0x786d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x786d('0x1')](_0x786d('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x786d('0x6')]},'variableName':{'type':Sequelize[_0x786d('0x6')]}}; \ No newline at end of file +var _0x2cea=['exports','ENUM','string','variable','customVariable','keyValue','STRING','sequelize'];(function(_0x4bc7dd,_0x4a6aa2){var _0x8a71a0=function(_0x249828){while(--_0x249828){_0x4bc7dd['push'](_0x4bc7dd['shift']());}};_0x8a71a0(++_0x4a6aa2);}(_0x2cea,0xa7));var _0xa2ce=function(_0x1d00c7,_0x9b96b2){_0x1d00c7=_0x1d00c7-0x0;var _0x5b4f51=_0x2cea[_0x1d00c7];return _0x5b4f51;};'use strict';var Sequelize=require(_0xa2ce('0x0'));module[_0xa2ce('0x1')]={'type':{'type':Sequelize[_0xa2ce('0x2')](_0xa2ce('0x3'),_0xa2ce('0x4'),_0xa2ce('0x5'),_0xa2ce('0x6')),'defaultValue':_0xa2ce('0x3')},'content':{'type':Sequelize[_0xa2ce('0x7')]},'key':{'type':Sequelize[_0xa2ce('0x7')]},'keyType':{'type':Sequelize[_0xa2ce('0x2')](_0xa2ce('0x3'),_0xa2ce('0x4'),_0xa2ce('0x5'))},'keyContent':{'type':Sequelize[_0xa2ce('0x7')]},'idField':{'type':Sequelize[_0xa2ce('0x7')]},'variableName':{'type':Sequelize[_0xa2ce('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 499c822..e0da00a 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 _0x1b5e=['to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','then','destroy','error','stack','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','findAll','rows','catch','show','include','merge','find','create','body','params','eml-format','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x1b5e,0x18b));var _0xe1b5=function(_0x3e007d,_0x4cfa51){_0x3e007d=_0x3e007d-0x0;var _0x58697b=_0x1b5e[_0x3e007d];return _0x58697b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe1b5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1b5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe1b5('0x2'));var Mustache=require(_0xe1b5('0x3'));var util=require(_0xe1b5('0x4'));var path=require(_0xe1b5('0x5'));var sox=require(_0xe1b5('0x6'));var csv=require(_0xe1b5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe1b5('0x8'));var squel=require(_0xe1b5('0x9'));var crypto=require(_0xe1b5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe1b5('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe1b5('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe1b5('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xe1b5('0xe'));var hardwareService=require(_0xe1b5('0xf'));var logger=require(_0xe1b5('0x10'))('api');var utils=require(_0xe1b5('0x11'));var config=require(_0xe1b5('0x12'));var db=require(_0xe1b5('0x13'))['db'];function respondWithStatusCode(_0x4cf6c2,_0x4a31ae){_0x4a31ae=_0x4a31ae||0xcc;return function(_0x1fbc8b){if(_0x1fbc8b){return _0x4cf6c2[_0xe1b5('0x14')](_0x4a31ae);}return _0x4cf6c2[_0xe1b5('0x15')](_0x4a31ae)[_0xe1b5('0x16')]();};}function respondWithResult(_0x58fa50,_0x5ea08a){_0x5ea08a=_0x5ea08a||0xc8;return function(_0x3bdd47){if(_0x3bdd47){return _0x58fa50[_0xe1b5('0x15')](_0x5ea08a)[_0xe1b5('0x17')](_0x3bdd47);}};}function respondWithFilteredResult(_0x211cff,_0x43a64b){return function(_0x1a4b31){if(_0x1a4b31){var _0xcb1022=_0x1a4b31[_0xe1b5('0x18')],_0x141547=_0x43a64b[_0xe1b5('0x19')],_0x1643c7=_0x43a64b[_0xe1b5('0x19')]+_0x43a64b[_0xe1b5('0x1a')],_0x592898;if(_0x1643c7>=_0xcb1022){_0x1643c7=_0xcb1022;_0x592898=0xc8;}else{_0x592898=0xce;}_0x211cff[_0xe1b5('0x15')](_0x592898);return _0x211cff[_0xe1b5('0x1b')]('Content-Range',_0x141547+'-'+_0x1643c7+'/'+_0xcb1022)[_0xe1b5('0x17')](_0x1a4b31);}return null;};}function patchUpdates(_0x5ba4e9){return function(_0x416de5){try{jsonpatch['apply'](_0x416de5,_0x5ba4e9,!![]);}catch(_0x9ba7a2){return BPromise['reject'](_0x9ba7a2);}return _0x416de5[_0xe1b5('0x1c')]();};}function saveUpdates(_0x40a7dd,_0x763723){return function(_0x108ce3){if(_0x108ce3){return _0x108ce3['update'](_0x40a7dd)[_0xe1b5('0x1d')](function(_0x40e829){return _0x40e829;});}return null;};}function removeEntity(_0x26e84f,_0x4034d2){return function(_0x38b4ff){if(_0x38b4ff){return _0x38b4ff[_0xe1b5('0x1e')]()[_0xe1b5('0x1d')](function(){_0x26e84f[_0xe1b5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a5d1a,_0xf711c2){return function(_0x490c89){if(!_0x490c89){_0x2a5d1a[_0xe1b5('0x14')](0x194);}return _0x490c89;};}function handleError(_0x55b630,_0x2e9f66){_0x2e9f66=_0x2e9f66||0x1f4;return function(_0x50e2a2){logger[_0xe1b5('0x1f')](_0x50e2a2[_0xe1b5('0x20')]);if(_0x50e2a2['name']){delete _0x50e2a2[_0xe1b5('0x21')];}_0x55b630[_0xe1b5('0x15')](_0x2e9f66)[_0xe1b5('0x22')](_0x50e2a2);};}exports[_0xe1b5('0x23')]=function(_0x15d700,_0x544fbf){var _0x3820e8={},_0x3facdc={},_0x38dbc5={'count':0x0,'rows':[]};var _0x5d16c9=_[_0xe1b5('0x24')](db[_0xe1b5('0x25')][_0xe1b5('0x26')],function(_0x53923d){return{'name':_0x53923d[_0xe1b5('0x27')],'type':_0x53923d[_0xe1b5('0x28')]['key']};});_0x3facdc['model']=_[_0xe1b5('0x24')](_0x5d16c9,_0xe1b5('0x21'));_0x3facdc[_0xe1b5('0x29')]=_[_0xe1b5('0x2a')](_0x15d700[_0xe1b5('0x29')]);_0x3facdc[_0xe1b5('0x2b')]=_[_0xe1b5('0x2c')](_0x3facdc['model'],_0x3facdc[_0xe1b5('0x29')]);_0x3820e8[_0xe1b5('0x2d')]=_[_0xe1b5('0x2c')](_0x3facdc[_0xe1b5('0x2e')],qs[_0xe1b5('0x2f')](_0x15d700[_0xe1b5('0x29')][_0xe1b5('0x2f')]));_0x3820e8[_0xe1b5('0x2d')]=_0x3820e8[_0xe1b5('0x2d')][_0xe1b5('0x30')]?_0x3820e8[_0xe1b5('0x2d')]:_0x3facdc[_0xe1b5('0x2e')];if(!_0x15d700[_0xe1b5('0x29')][_0xe1b5('0x31')]('nolimit')){_0x3820e8[_0xe1b5('0x1a')]=qs[_0xe1b5('0x1a')](_0x15d700[_0xe1b5('0x29')][_0xe1b5('0x1a')]);_0x3820e8[_0xe1b5('0x19')]=qs['offset'](_0x15d700[_0xe1b5('0x29')]['offset']);}_0x3820e8[_0xe1b5('0x32')]=qs[_0xe1b5('0x33')](_0x15d700[_0xe1b5('0x29')]['sort']);_0x3820e8['where']=qs['filters'](_[_0xe1b5('0x34')](_0x15d700[_0xe1b5('0x29')],_0x3facdc[_0xe1b5('0x2b')]),_0x5d16c9);if(_0x15d700['query'][_0xe1b5('0x35')]){_0x3820e8[_0xe1b5('0x36')]=_['merge'](_0x3820e8[_0xe1b5('0x36')],{'$or':_[_0xe1b5('0x24')](_0x5d16c9,function(_0x14f58f){if(_0x14f58f['type']!==_0xe1b5('0x37')){var _0x34625f={};_0x34625f[_0x14f58f['name']]={'$like':'%'+_0x15d700[_0xe1b5('0x29')][_0xe1b5('0x35')]+'%'};return _0x34625f;}})});}_0x3820e8=_['merge']({},_0x3820e8,_0x15d700[_0xe1b5('0x38')]);var _0x20efa5={'where':_0x3820e8[_0xe1b5('0x36')]};return db[_0xe1b5('0x25')]['count'](_0x20efa5)[_0xe1b5('0x1d')](function(_0x4634b2){_0x38dbc5[_0xe1b5('0x18')]=_0x4634b2;if(_0x15d700['query']['includeAll']){_0x3820e8['include']=[{'all':!![]}];}return db[_0xe1b5('0x25')][_0xe1b5('0x39')](_0x3820e8);})['then'](function(_0x1cc2c5){_0x38dbc5[_0xe1b5('0x3a')]=_0x1cc2c5;return _0x38dbc5;})[_0xe1b5('0x1d')](respondWithFilteredResult(_0x544fbf,_0x3820e8))[_0xe1b5('0x3b')](handleError(_0x544fbf,null));};exports[_0xe1b5('0x3c')]=function(_0x5dfa08,_0x188cf5){var _0x29b489={'raw':!![],'where':{'id':_0x5dfa08['params']['id']}},_0x2fd52={};_0x2fd52[_0xe1b5('0x2e')]=_[_0xe1b5('0x2a')](db[_0xe1b5('0x25')]['rawAttributes']);_0x2fd52['query']=_[_0xe1b5('0x2a')](_0x5dfa08[_0xe1b5('0x29')]);_0x2fd52['filters']=_[_0xe1b5('0x2c')](_0x2fd52[_0xe1b5('0x2e')],_0x2fd52[_0xe1b5('0x29')]);_0x29b489['attributes']=_[_0xe1b5('0x2c')](_0x2fd52[_0xe1b5('0x2e')],qs[_0xe1b5('0x2f')](_0x5dfa08[_0xe1b5('0x29')]['fields']));_0x29b489[_0xe1b5('0x2d')]=_0x29b489['attributes'][_0xe1b5('0x30')]?_0x29b489['attributes']:_0x2fd52[_0xe1b5('0x2e')];if(_0x5dfa08[_0xe1b5('0x29')]['includeAll']){_0x29b489[_0xe1b5('0x3d')]=[{'all':!![]}];}_0x29b489=_[_0xe1b5('0x3e')]({},_0x29b489,_0x5dfa08[_0xe1b5('0x38')]);return db['SalesforceField'][_0xe1b5('0x3f')](_0x29b489)[_0xe1b5('0x1d')](handleEntityNotFound(_0x188cf5,null))[_0xe1b5('0x1d')](respondWithResult(_0x188cf5,null))[_0xe1b5('0x3b')](handleError(_0x188cf5,null));};exports[_0xe1b5('0x40')]=function(_0x518eb3,_0xdc702d){return db[_0xe1b5('0x25')][_0xe1b5('0x40')](_0x518eb3[_0xe1b5('0x41')],{})[_0xe1b5('0x1d')](respondWithResult(_0xdc702d,0xc9))[_0xe1b5('0x3b')](handleError(_0xdc702d,null));};exports['update']=function(_0x4e110e,_0x281cea){if(_0x4e110e[_0xe1b5('0x41')]['id']){delete _0x4e110e[_0xe1b5('0x41')]['id'];}return db[_0xe1b5('0x25')][_0xe1b5('0x3f')]({'where':{'id':_0x4e110e[_0xe1b5('0x42')]['id']}})['then'](handleEntityNotFound(_0x281cea,null))[_0xe1b5('0x1d')](saveUpdates(_0x4e110e[_0xe1b5('0x41')],null))[_0xe1b5('0x1d')](respondWithResult(_0x281cea,null))['catch'](handleError(_0x281cea,null));};exports[_0xe1b5('0x1e')]=function(_0x3e1e0c,_0x426e81){return db['SalesforceField']['find']({'where':{'id':_0x3e1e0c[_0xe1b5('0x42')]['id']}})[_0xe1b5('0x1d')](handleEntityNotFound(_0x426e81,null))['then'](removeEntity(_0x426e81,null))[_0xe1b5('0x3b')](handleError(_0x426e81,null));}; \ No newline at end of file +var _0x2106=['length','hasOwnProperty','nolimit','order','sort','filters','pick','where','type','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','index','map','SalesforceField','fieldName','key','model','query','keys','intersection','attributes','fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2106,0x18e));var _0x6210=function(_0x17b2fa,_0x13f12f){_0x17b2fa=_0x17b2fa-0x0;var _0x1b2d66=_0x2106[_0x17b2fa];return _0x1b2d66;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6210('0x0'));var rimraf=require(_0x6210('0x1'));var zipdir=require(_0x6210('0x2'));var jsonpatch=require(_0x6210('0x3'));var rp=require(_0x6210('0x4'));var moment=require('moment');var BPromise=require(_0x6210('0x5'));var Mustache=require(_0x6210('0x6'));var util=require(_0x6210('0x7'));var path=require('path');var sox=require(_0x6210('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6210('0x9'));var squel=require(_0x6210('0xa'));var crypto=require(_0x6210('0xb'));var jsforce=require(_0x6210('0xc'));var deskjs=require(_0x6210('0xd'));var toCsv=require(_0x6210('0xe'));var querystring=require(_0x6210('0xf'));var Papa=require(_0x6210('0x10'));var Redis=require(_0x6210('0x11'));var authService=require(_0x6210('0x12'));var qs=require(_0x6210('0x13'));var as=require(_0x6210('0x14'));var hardwareService=require(_0x6210('0x15'));var logger=require(_0x6210('0x16'))(_0x6210('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6210('0x18'))['db'];function respondWithStatusCode(_0x5ea9f3,_0x13ffec){_0x13ffec=_0x13ffec||0xcc;return function(_0x2ad6e5){if(_0x2ad6e5){return _0x5ea9f3[_0x6210('0x19')](_0x13ffec);}return _0x5ea9f3[_0x6210('0x1a')](_0x13ffec)[_0x6210('0x1b')]();};}function respondWithResult(_0x2f91f4,_0x342ecf){_0x342ecf=_0x342ecf||0xc8;return function(_0x3e1b7a){if(_0x3e1b7a){return _0x2f91f4['status'](_0x342ecf)[_0x6210('0x1c')](_0x3e1b7a);}};}function respondWithFilteredResult(_0x1a82c8,_0x57840f){return function(_0x204faf){if(_0x204faf){var _0x5db825=_0x204faf[_0x6210('0x1d')],_0xcd6bf9=_0x57840f[_0x6210('0x1e')],_0x59d9df=_0x57840f[_0x6210('0x1e')]+_0x57840f[_0x6210('0x1f')],_0x22ccc7;if(_0x59d9df>=_0x5db825){_0x59d9df=_0x5db825;_0x22ccc7=0xc8;}else{_0x22ccc7=0xce;}_0x1a82c8['status'](_0x22ccc7);return _0x1a82c8[_0x6210('0x20')]('Content-Range',_0xcd6bf9+'-'+_0x59d9df+'/'+_0x5db825)['json'](_0x204faf);}return null;};}function patchUpdates(_0x3d4173){return function(_0x4dce9e){try{jsonpatch[_0x6210('0x21')](_0x4dce9e,_0x3d4173,!![]);}catch(_0x553d7f){return BPromise[_0x6210('0x22')](_0x553d7f);}return _0x4dce9e[_0x6210('0x23')]();};}function saveUpdates(_0x4456f6,_0x5582c4){return function(_0x31ffe0){if(_0x31ffe0){return _0x31ffe0[_0x6210('0x24')](_0x4456f6)[_0x6210('0x25')](function(_0x45451e){return _0x45451e;});}return null;};}function removeEntity(_0x31f243,_0x2de61a){return function(_0x175e86){if(_0x175e86){return _0x175e86[_0x6210('0x26')]()[_0x6210('0x25')](function(){_0x31f243[_0x6210('0x1a')](0xcc)[_0x6210('0x1b')]();});}};}function handleEntityNotFound(_0x589eeb,_0x2f2c93){return function(_0x8555d1){if(!_0x8555d1){_0x589eeb['sendStatus'](0x194);}return _0x8555d1;};}function handleError(_0x5d05d3,_0x2f425e){_0x2f425e=_0x2f425e||0x1f4;return function(_0x127da8){logger['error'](_0x127da8[_0x6210('0x27')]);if(_0x127da8[_0x6210('0x28')]){delete _0x127da8[_0x6210('0x28')];}_0x5d05d3[_0x6210('0x1a')](_0x2f425e)['send'](_0x127da8);};}exports[_0x6210('0x29')]=function(_0x4e1140,_0x369f7b){var _0x164aa5={},_0x4128d4={},_0x45a8da={'count':0x0,'rows':[]};var _0x30035a=_[_0x6210('0x2a')](db[_0x6210('0x2b')]['rawAttributes'],function(_0x20fd2e){return{'name':_0x20fd2e[_0x6210('0x2c')],'type':_0x20fd2e['type'][_0x6210('0x2d')]};});_0x4128d4[_0x6210('0x2e')]=_[_0x6210('0x2a')](_0x30035a,'name');_0x4128d4[_0x6210('0x2f')]=_[_0x6210('0x30')](_0x4e1140['query']);_0x4128d4['filters']=_[_0x6210('0x31')](_0x4128d4[_0x6210('0x2e')],_0x4128d4['query']);_0x164aa5[_0x6210('0x32')]=_[_0x6210('0x31')](_0x4128d4[_0x6210('0x2e')],qs['fields'](_0x4e1140[_0x6210('0x2f')][_0x6210('0x33')]));_0x164aa5['attributes']=_0x164aa5[_0x6210('0x32')][_0x6210('0x34')]?_0x164aa5[_0x6210('0x32')]:_0x4128d4[_0x6210('0x2e')];if(!_0x4e1140['query'][_0x6210('0x35')](_0x6210('0x36'))){_0x164aa5[_0x6210('0x1f')]=qs[_0x6210('0x1f')](_0x4e1140[_0x6210('0x2f')]['limit']);_0x164aa5[_0x6210('0x1e')]=qs[_0x6210('0x1e')](_0x4e1140[_0x6210('0x2f')][_0x6210('0x1e')]);}_0x164aa5[_0x6210('0x37')]=qs['sort'](_0x4e1140[_0x6210('0x2f')][_0x6210('0x38')]);_0x164aa5['where']=qs[_0x6210('0x39')](_[_0x6210('0x3a')](_0x4e1140[_0x6210('0x2f')],_0x4128d4[_0x6210('0x39')]),_0x30035a);if(_0x4e1140[_0x6210('0x2f')]['filter']){_0x164aa5[_0x6210('0x3b')]=_['merge'](_0x164aa5[_0x6210('0x3b')],{'$or':_[_0x6210('0x2a')](_0x30035a,function(_0x485e37){if(_0x485e37[_0x6210('0x3c')]!==_0x6210('0x3d')){var _0x4d9de8={};_0x4d9de8[_0x485e37[_0x6210('0x28')]]={'$like':'%'+_0x4e1140[_0x6210('0x2f')][_0x6210('0x3e')]+'%'};return _0x4d9de8;}})});}_0x164aa5=_[_0x6210('0x3f')]({},_0x164aa5,_0x4e1140['options']);var _0x2ce7f5={'where':_0x164aa5[_0x6210('0x3b')]};return db[_0x6210('0x2b')][_0x6210('0x1d')](_0x2ce7f5)[_0x6210('0x25')](function(_0x2324a5){_0x45a8da[_0x6210('0x1d')]=_0x2324a5;if(_0x4e1140[_0x6210('0x2f')][_0x6210('0x40')]){_0x164aa5[_0x6210('0x41')]=[{'all':!![]}];}return db[_0x6210('0x2b')][_0x6210('0x42')](_0x164aa5);})[_0x6210('0x25')](function(_0x51f4ae){_0x45a8da['rows']=_0x51f4ae;return _0x45a8da;})[_0x6210('0x25')](respondWithFilteredResult(_0x369f7b,_0x164aa5))[_0x6210('0x43')](handleError(_0x369f7b,null));};exports[_0x6210('0x44')]=function(_0x12a426,_0x5ab428){var _0x3e7bc4={'raw':!![],'where':{'id':_0x12a426[_0x6210('0x45')]['id']}},_0x1ceb90={};_0x1ceb90['model']=_['keys'](db['SalesforceField'][_0x6210('0x46')]);_0x1ceb90[_0x6210('0x2f')]=_[_0x6210('0x30')](_0x12a426[_0x6210('0x2f')]);_0x1ceb90[_0x6210('0x39')]=_[_0x6210('0x31')](_0x1ceb90[_0x6210('0x2e')],_0x1ceb90[_0x6210('0x2f')]);_0x3e7bc4[_0x6210('0x32')]=_['intersection'](_0x1ceb90[_0x6210('0x2e')],qs[_0x6210('0x33')](_0x12a426['query'][_0x6210('0x33')]));_0x3e7bc4[_0x6210('0x32')]=_0x3e7bc4[_0x6210('0x32')][_0x6210('0x34')]?_0x3e7bc4[_0x6210('0x32')]:_0x1ceb90[_0x6210('0x2e')];if(_0x12a426[_0x6210('0x2f')][_0x6210('0x40')]){_0x3e7bc4[_0x6210('0x41')]=[{'all':!![]}];}_0x3e7bc4=_[_0x6210('0x3f')]({},_0x3e7bc4,_0x12a426[_0x6210('0x47')]);return db['SalesforceField'][_0x6210('0x48')](_0x3e7bc4)[_0x6210('0x25')](handleEntityNotFound(_0x5ab428,null))[_0x6210('0x25')](respondWithResult(_0x5ab428,null))[_0x6210('0x43')](handleError(_0x5ab428,null));};exports[_0x6210('0x49')]=function(_0x546c55,_0x2fb7e1){return db[_0x6210('0x2b')][_0x6210('0x49')](_0x546c55[_0x6210('0x4a')],{})['then'](respondWithResult(_0x2fb7e1,0xc9))['catch'](handleError(_0x2fb7e1,null));};exports[_0x6210('0x24')]=function(_0x174bdb,_0x1a6117){if(_0x174bdb[_0x6210('0x4a')]['id']){delete _0x174bdb[_0x6210('0x4a')]['id'];}return db[_0x6210('0x2b')][_0x6210('0x48')]({'where':{'id':_0x174bdb['params']['id']}})[_0x6210('0x25')](handleEntityNotFound(_0x1a6117,null))[_0x6210('0x25')](saveUpdates(_0x174bdb[_0x6210('0x4a')],null))[_0x6210('0x25')](respondWithResult(_0x1a6117,null))[_0x6210('0x43')](handleError(_0x1a6117,null));};exports[_0x6210('0x26')]=function(_0x475144,_0x3abc74){return db[_0x6210('0x2b')][_0x6210('0x48')]({'where':{'id':_0x475144[_0x6210('0x45')]['id']}})[_0x6210('0x25')](handleEntityNotFound(_0x3abc74,null))[_0x6210('0x25')](removeEntity(_0x3abc74,null))[_0x6210('0x43')](handleError(_0x3abc74,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 52cec4d..5c903b4 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 _0x5388=['rimraf','./intSalesforceField.attributes','define','int_salesforce_fields','salesforce_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2d63bb,_0x45c2e0){var _0x1f95b3=function(_0x5836db){while(--_0x5836db){_0x2d63bb['push'](_0x2d63bb['shift']());}};_0x1f95b3(++_0x45c2e0);}(_0x5388,0x102));var _0x8538=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0x5388[_0x53bcc3];return _0x47c959;};'use strict';var _=require(_0x8538('0x0'));var util=require(_0x8538('0x1'));var logger=require(_0x8538('0x2'))(_0x8538('0x3'));var moment=require(_0x8538('0x4'));var BPromise=require(_0x8538('0x5'));var rp=require(_0x8538('0x6'));var fs=require('fs');var path=require(_0x8538('0x7'));var rimraf=require(_0x8538('0x8'));var config=require('../../config/environment');var attributes=require(_0x8538('0x9'));module['exports']=function(_0x3c8190,_0x39251e){return _0x3c8190[_0x8538('0xa')]('SalesforceField',attributes,{'tableName':_0x8538('0xb'),'paranoid':![],'indexes':[{'name':_0x8538('0xc'),'fields':[_0x8538('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x070a=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','salesforce_unique_index','idField','FieldId'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x070a,0x9c));var _0xa070=function(_0x18ea9f,_0x4709f6){_0x18ea9f=_0x18ea9f-0x0;var _0x51725d=_0x070a[_0x18ea9f];return _0x51725d;};'use strict';var _=require(_0xa070('0x0'));var util=require(_0xa070('0x1'));var logger=require(_0xa070('0x2'))(_0xa070('0x3'));var moment=require('moment');var BPromise=require(_0xa070('0x4'));var rp=require(_0xa070('0x5'));var fs=require('fs');var path=require(_0xa070('0x6'));var rimraf=require(_0xa070('0x7'));var config=require(_0xa070('0x8'));var attributes=require(_0xa070('0x9'));module['exports']=function(_0x56587a,_0x556084){return _0x56587a['define']('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xa070('0xa'),'fields':[_0xa070('0xb'),_0xa070('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 2e7d4bd..52a6a82 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 _0x5c00=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x5c00,0x17e));var _0x05c0=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0x5c00[_0x236c89];return _0x3b2a15;};'use strict';var _=require(_0x05c0('0x0'));var util=require(_0x05c0('0x1'));var moment=require(_0x05c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x05c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05c0('0x4'))['db'];var utils=require(_0x05c0('0x5'));var logger=require(_0x05c0('0x6'))(_0x05c0('0x7'));var config=require('../../config/environment');var jayson=require(_0x05c0('0x8'));var client=jayson[_0x05c0('0x9')][_0x05c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27dc10,_0x5b9f09,_0x3a3b1b){return new BPromise(function(_0x34eb5f,_0x3ad5b7){return client['request'](_0x27dc10,_0x3a3b1b)[_0x05c0('0xb')](function(_0x32cdfa){logger[_0x05c0('0xc')](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));logger[_0x05c0('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x5b9f09,'request\x20sent',JSON[_0x05c0('0x10')](_0x32cdfa));if(_0x32cdfa['error']){if(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x12')]===0x1f4){logger[_0x05c0('0x11')]('SalesforceField,\x20%s,\x20%s',_0x5b9f09,_0x32cdfa[_0x05c0('0x11')]['message']);return _0x3ad5b7(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);return _0x34eb5f(_0x32cdfa[_0x05c0('0x11')][_0x05c0('0x13')]);}else{logger['info'](_0x05c0('0xd'),_0x5b9f09,_0x05c0('0xe'));_0x34eb5f(_0x32cdfa[_0x05c0('0x14')][_0x05c0('0x13')]);}})[_0x05c0('0x15')](function(_0x40153e){logger[_0x05c0('0x11')](_0x05c0('0xd'),_0x5b9f09,_0x40153e);_0x3ad5b7(_0x40153e);});});} \ No newline at end of file +var _0x70e0=['code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x4b63f7,_0x18cef5){var _0x2bf5b8=function(_0x3beac7){while(--_0x3beac7){_0x4b63f7['push'](_0x4b63f7['shift']());}};_0x2bf5b8(++_0x18cef5);}(_0x70e0,0x17b));var _0x070e=function(_0x1c6313,_0x4544cc){_0x1c6313=_0x1c6313-0x0;var _0xdd41bb=_0x70e0[_0x1c6313];return _0xdd41bb;};'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')]('SalesforceField,\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')]('SalesforceField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('SalesforceField,\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/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 845013d..fc0e61a 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 _0x8585=['put','update','delete','destroy','exports','multer','util','path','express','Router','./intServicenowAccount.controller','get','/:id','isAuthenticated','/:id/configurations','/:id/fields','post','create','addConfiguration'];(function(_0x28d7fb,_0x50aa9d){var _0x234477=function(_0x384a51){while(--_0x384a51){_0x28d7fb['push'](_0x28d7fb['shift']());}};_0x234477(++_0x50aa9d);}(_0x8585,0x64));var _0x5858=function(_0x138f02,_0x37bdc0){_0x138f02=_0x138f02-0x0;var _0x41fe82=_0x8585[_0x138f02];return _0x41fe82;};'use strict';var multer=require(_0x5858('0x0'));var util=require(_0x5858('0x1'));var path=require(_0x5858('0x2'));var timeout=require('connect-timeout');var express=require(_0x5858('0x3'));var router=express[_0x5858('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5858('0x5'));router[_0x5858('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5858('0x6')](_0x5858('0x7'),auth[_0x5858('0x8')](),controller['show']);router['get'](_0x5858('0x9'),auth[_0x5858('0x8')](),controller['getConfigurations']);router['get'](_0x5858('0xa'),auth[_0x5858('0x8')](),controller['getFields']);router[_0x5858('0xb')]('/',auth[_0x5858('0x8')](),controller[_0x5858('0xc')]);router[_0x5858('0xb')](_0x5858('0x9'),auth[_0x5858('0x8')](),controller[_0x5858('0xd')]);router[_0x5858('0xe')](_0x5858('0x7'),auth['isAuthenticated'](),controller[_0x5858('0xf')]);router[_0x5858('0x10')](_0x5858('0x7'),auth['isAuthenticated'](),controller[_0x5858('0x11')]);module[_0x5858('0x12')]=router; \ No newline at end of file +var _0xd0bb=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','getFields','post'];(function(_0x283840,_0x4e1db6){var _0x36ef52=function(_0x2a7107){while(--_0x2a7107){_0x283840['push'](_0x283840['shift']());}};_0x36ef52(++_0x4e1db6);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x7033ad,_0x4f191a){_0x7033ad=_0x7033ad-0x0;var _0x4117fb=_0xd0bb[_0x7033ad];return _0x4117fb;};'use strict';var multer=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var path=require(_0xbd0b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbd0b('0x3'));var router=express['Router']();var auth=require(_0xbd0b('0x4'));var interaction=require(_0xbd0b('0x5'));var config=require('../../config/environment');var controller=require(_0xbd0b('0x6'));router['get']('/',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x8')]);router[_0xbd0b('0x9')](_0xbd0b('0xa'),auth[_0xbd0b('0x7')](),controller['show']);router[_0xbd0b('0x9')](_0xbd0b('0xb'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0xc')]);router[_0xbd0b('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbd0b('0xd')]);router[_0xbd0b('0xe')]('/',auth['isAuthenticated'](),controller[_0xbd0b('0xf')]);router[_0xbd0b('0xe')]('/:id/configurations',auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x10')]);router[_0xbd0b('0x11')](_0xbd0b('0xa'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x12')]);router[_0xbd0b('0x13')](_0xbd0b('0xa'),auth[_0xbd0b('0x7')](),controller[_0xbd0b('0x14')]);module[_0xbd0b('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 74452f2..c60bbe3 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 _0x7e80=['exports','STRING','username','remoteUri','sequelize'];(function(_0x517286,_0x1da6cd){var _0x156bbc=function(_0x3a8400){while(--_0x3a8400){_0x517286['push'](_0x517286['shift']());}};_0x156bbc(++_0x1da6cd);}(_0x7e80,0x103));var _0x07e8=function(_0x2815,_0x5f3c49){_0x2815=_0x2815-0x0;var _0x42d012=_0x7e80[_0x2815];return _0x42d012;};'use strict';var Sequelize=require(_0x07e8('0x0'));module[_0x07e8('0x1')]={'name':{'type':Sequelize[_0x07e8('0x2')]},'description':{'type':Sequelize[_0x07e8('0x2')]},'username':{'type':Sequelize[_0x07e8('0x2')],'unique':_0x07e8('0x3')},'password':{'type':Sequelize[_0x07e8('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x07e8('0x4')},'serverUrl':{'type':Sequelize[_0x07e8('0x2')]}}; \ No newline at end of file +var _0x1ce9=['remoteUri','sequelize','exports','STRING','username'];(function(_0x27aca0,_0x30fe39){var _0x70596c=function(_0x406ba0){while(--_0x406ba0){_0x27aca0['push'](_0x27aca0['shift']());}};_0x70596c(++_0x30fe39);}(_0x1ce9,0x15f));var _0x91ce=function(_0x4ade35,_0x194feb){_0x4ade35=_0x4ade35-0x0;var _0x2772e4=_0x1ce9[_0x4ade35];return _0x2772e4;};'use strict';var Sequelize=require(_0x91ce('0x0'));module[_0x91ce('0x1')]={'name':{'type':Sequelize[_0x91ce('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x91ce('0x2')],'unique':_0x91ce('0x3')},'password':{'type':Sequelize[_0x91ce('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x91ce('0x2')],'unique':_0x91ce('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index f3622c5..e5d38cc 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 _0xc5dc=['params','keys','length','find','create','body','getConfigurations','findOne','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','notify','incident_state','severity','parent','made_sla','caused_by','upon_reject','child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','knowledge','calendar_stc','closed_at','delivery_plan','impact','active','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','follow_up','parent_incident','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','correlation_id','location','username','password','remoteUri','serverUrl','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','includes','internalType','label','push','all','remove','forEach','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','boolean','False','false','inactive','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','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','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','includeAll','include','findAll','rows','show'];(function(_0xa3f0e7,_0x4dfd0d){var _0x46a1e4=function(_0x8ee6ad){while(--_0x8ee6ad){_0xa3f0e7['push'](_0xa3f0e7['shift']());}};_0x46a1e4(++_0x4dfd0d);}(_0xc5dc,0x128));var _0xcc5d=function(_0x15ae23,_0x3038a2){_0x15ae23=_0x15ae23-0x0;var _0x4ca313=_0xc5dc[_0x15ae23];return _0x4ca313;};'use strict';var pdf=require(_0xcc5d('0x0'));var emlformat=require(_0xcc5d('0x1'));var rimraf=require(_0xcc5d('0x2'));var zipdir=require(_0xcc5d('0x3'));var jsonpatch=require(_0xcc5d('0x4'));var rp=require(_0xcc5d('0x5'));var moment=require(_0xcc5d('0x6'));var BPromise=require(_0xcc5d('0x7'));var Mustache=require(_0xcc5d('0x8'));var util=require(_0xcc5d('0x9'));var path=require(_0xcc5d('0xa'));var sox=require('sox');var csv=require(_0xcc5d('0xb'));var ejs=require(_0xcc5d('0xc'));var fs=require('fs');var _=require(_0xcc5d('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcc5d('0xe'));var toCsv=require(_0xcc5d('0xb'));var querystring=require(_0xcc5d('0xf'));var Papa=require(_0xcc5d('0x10'));var Redis=require(_0xcc5d('0x11'));var authService=require(_0xcc5d('0x12'));var qs=require(_0xcc5d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcc5d('0x14'));var utils=require(_0xcc5d('0x15'));var config=require(_0xcc5d('0x16'));var db=require(_0xcc5d('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x1fdbcb,_0xfee5c4,_0x54bd87){if(_0x54bd87){var _0x139730=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x139730[_0xcc5d('0x18')](_0xfee5c4)){return _0x1fdbcb;}else{throw new db[(_0xcc5d('0x19'))]['ValidationError'](_0xcc5d('0x1a'));}}else{return _0x1fdbcb;}}function respondWithRpcPromise(_0x3e8d59,_0x54738f,_0x321e45,_0x18af90){return new BPromise(function(_0x17454c,_0x571d50){var _0x4cfc3f=_0x18af90||client;return _0x4cfc3f[_0xcc5d('0x1b')](_0x3e8d59,_0x321e45)['then'](function(_0x3cccf7){logger[_0xcc5d('0x1c')](_0xcc5d('0x1d'),_0x54738f,_0xcc5d('0x1e'));logger[_0xcc5d('0x1f')](_0xcc5d('0x20'),_0x54738f,_0xcc5d('0x1e'),JSON[_0xcc5d('0x21')](_0x3cccf7));if(_0x3cccf7[_0xcc5d('0x22')]){if(_0x3cccf7[_0xcc5d('0x22')][_0xcc5d('0x23')]===0x1f4){logger['error'](_0xcc5d('0x1d'),_0x54738f,_0x3cccf7[_0xcc5d('0x22')]['message']);return _0x571d50(_0x3cccf7['error']['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x54738f,_0x3cccf7[_0xcc5d('0x22')][_0xcc5d('0x24')]);return _0x17454c(_0x3cccf7['error'][_0xcc5d('0x24')]);}else{logger['info'](_0xcc5d('0x1d'),_0x54738f,_0xcc5d('0x1e'));_0x17454c(_0x3cccf7[_0xcc5d('0x25')][_0xcc5d('0x24')]);}})[_0xcc5d('0x26')](function(_0x2dfe5f){logger[_0xcc5d('0x22')](_0xcc5d('0x1d'),_0x54738f,_0x2dfe5f);_0x571d50(_0x2dfe5f);});});}function respondWithStatusCode(_0x2034c7,_0x13a0ce){_0x13a0ce=_0x13a0ce||0xcc;return function(_0x594007){if(_0x594007){return _0x2034c7['sendStatus'](_0x13a0ce);}return _0x2034c7[_0xcc5d('0x27')](_0x13a0ce)[_0xcc5d('0x28')]();};}function respondWithResult(_0x136c0e,_0x38344c){_0x38344c=_0x38344c||0xc8;return function(_0x3cf0f0){if(_0x3cf0f0){return _0x136c0e[_0xcc5d('0x27')](_0x38344c)[_0xcc5d('0x29')](_0x3cf0f0);}};}function respondWithFilteredResult(_0x11ec80,_0x3db0e1){return function(_0xe8f6f9){if(_0xe8f6f9){var _0x134363=_0xe8f6f9[_0xcc5d('0x2a')],_0xc0f633=_0x3db0e1[_0xcc5d('0x2b')],_0x239eb0=_0x3db0e1[_0xcc5d('0x2b')]+_0x3db0e1[_0xcc5d('0x2c')],_0x3205b5;if(_0x239eb0>=_0x134363){_0x239eb0=_0x134363;_0x3205b5=0xc8;}else{_0x3205b5=0xce;}_0x11ec80[_0xcc5d('0x27')](_0x3205b5);return _0x11ec80[_0xcc5d('0x2d')](_0xcc5d('0x2e'),_0xc0f633+'-'+_0x239eb0+'/'+_0x134363)[_0xcc5d('0x29')](_0xe8f6f9);}return null;};}function patchUpdates(_0x4532bf){return function(_0x552dca){try{jsonpatch[_0xcc5d('0x2f')](_0x552dca,_0x4532bf,!![]);}catch(_0x4bbf04){return BPromise[_0xcc5d('0x30')](_0x4bbf04);}return _0x552dca[_0xcc5d('0x31')]();};}function saveUpdates(_0xfd2cca,_0x4411cc){return function(_0x2dfb29){if(_0x2dfb29){return _0x2dfb29[_0xcc5d('0x32')](_0xfd2cca)['then'](function(_0x3cd8e9){return _0x3cd8e9;});}return null;};}function removeEntity(_0x583a04,_0x355214){return function(_0x2e2366){if(_0x2e2366){return _0x2e2366[_0xcc5d('0x33')]()[_0xcc5d('0x34')](function(){_0x583a04['status'](0xcc)[_0xcc5d('0x28')]();});}};}function handleEntityNotFound(_0x90cd40,_0x38902c){return function(_0x3ab106){if(!_0x3ab106){_0x90cd40[_0xcc5d('0x35')](0x194);}return _0x3ab106;};}function handleError(_0x390ac0,_0x4af3d4){_0x4af3d4=_0x4af3d4||0x1f4;return function(_0x2c7c46){logger[_0xcc5d('0x22')](_0x2c7c46[_0xcc5d('0x36')]);if(_0x2c7c46['name']){delete _0x2c7c46[_0xcc5d('0x37')];}_0x390ac0[_0xcc5d('0x27')](_0x4af3d4)['send'](_0x2c7c46);};}exports['index']=function(_0x4657f1,_0xe0c62a){var _0x326c48={},_0x55f389={},_0x3e40e4={'count':0x0,'rows':[]};var _0x209a7f=_[_0xcc5d('0x38')](db['ServicenowAccount'][_0xcc5d('0x39')],function(_0x268dfb){return{'name':_0x268dfb[_0xcc5d('0x3a')],'type':_0x268dfb[_0xcc5d('0x3b')][_0xcc5d('0x3c')]};});_0x55f389[_0xcc5d('0x3d')]=_[_0xcc5d('0x38')](_0x209a7f,'name');_0x55f389['query']=_['keys'](_0x4657f1[_0xcc5d('0x3e')]);_0x55f389[_0xcc5d('0x3f')]=_[_0xcc5d('0x40')](_0x55f389[_0xcc5d('0x3d')],_0x55f389[_0xcc5d('0x3e')]);_0x326c48[_0xcc5d('0x41')]=_[_0xcc5d('0x40')](_0x55f389['model'],qs['fields'](_0x4657f1[_0xcc5d('0x3e')][_0xcc5d('0x42')]));_0x326c48[_0xcc5d('0x41')]=_0x326c48['attributes']['length']?_0x326c48[_0xcc5d('0x41')]:_0x55f389['model'];if(!_0x4657f1[_0xcc5d('0x3e')][_0xcc5d('0x43')](_0xcc5d('0x44'))){_0x326c48[_0xcc5d('0x2c')]=qs[_0xcc5d('0x2c')](_0x4657f1['query'][_0xcc5d('0x2c')]);_0x326c48[_0xcc5d('0x2b')]=qs[_0xcc5d('0x2b')](_0x4657f1[_0xcc5d('0x3e')][_0xcc5d('0x2b')]);}_0x326c48[_0xcc5d('0x45')]=qs[_0xcc5d('0x46')](_0x4657f1['query'][_0xcc5d('0x46')]);_0x326c48[_0xcc5d('0x47')]=qs['filters'](_[_0xcc5d('0x48')](_0x4657f1['query'],_0x55f389['filters']),_0x209a7f);if(_0x4657f1['query'][_0xcc5d('0x49')]){_0x326c48[_0xcc5d('0x47')]=_[_0xcc5d('0x4a')](_0x326c48[_0xcc5d('0x47')],{'$or':_[_0xcc5d('0x38')](_0x209a7f,function(_0x39ed11){if(_0x39ed11[_0xcc5d('0x3b')]!==_0xcc5d('0x4b')){var _0x34958e={};_0x34958e[_0x39ed11[_0xcc5d('0x37')]]={'$like':'%'+_0x4657f1[_0xcc5d('0x3e')]['filter']+'%'};return _0x34958e;}})});}_0x326c48=_['merge']({},_0x326c48,_0x4657f1['options']);var _0x125500={'where':_0x326c48[_0xcc5d('0x47')]};return db[_0xcc5d('0x4c')][_0xcc5d('0x2a')](_0x125500)['then'](function(_0x283362){_0x3e40e4[_0xcc5d('0x2a')]=_0x283362;if(_0x4657f1['query'][_0xcc5d('0x4d')]){_0x326c48[_0xcc5d('0x4e')]=[{'all':!![]}];}return db[_0xcc5d('0x4c')][_0xcc5d('0x4f')](_0x326c48);})[_0xcc5d('0x34')](function(_0x25c453){_0x3e40e4[_0xcc5d('0x50')]=_0x25c453;return _0x3e40e4;})[_0xcc5d('0x34')](respondWithFilteredResult(_0xe0c62a,_0x326c48))[_0xcc5d('0x26')](handleError(_0xe0c62a,null));};exports[_0xcc5d('0x51')]=function(_0x3c6dec,_0x144935){var _0x286059={'raw':![],'where':{'id':_0x3c6dec[_0xcc5d('0x52')]['id']}},_0x20b39f={};_0x20b39f[_0xcc5d('0x3d')]=_[_0xcc5d('0x53')](db[_0xcc5d('0x4c')][_0xcc5d('0x39')]);_0x20b39f[_0xcc5d('0x3e')]=_[_0xcc5d('0x53')](_0x3c6dec['query']);_0x20b39f[_0xcc5d('0x3f')]=_[_0xcc5d('0x40')](_0x20b39f[_0xcc5d('0x3d')],_0x20b39f['query']);_0x286059[_0xcc5d('0x41')]=_['intersection'](_0x20b39f[_0xcc5d('0x3d')],qs[_0xcc5d('0x42')](_0x3c6dec['query'][_0xcc5d('0x42')]));_0x286059[_0xcc5d('0x41')]=_0x286059['attributes'][_0xcc5d('0x54')]?_0x286059[_0xcc5d('0x41')]:_0x20b39f[_0xcc5d('0x3d')];if(_0x3c6dec[_0xcc5d('0x3e')]['includeAll']){_0x286059['include']=[{'all':!![]}];}_0x286059=_[_0xcc5d('0x4a')]({},_0x286059,_0x3c6dec['options']);return db[_0xcc5d('0x4c')][_0xcc5d('0x55')](_0x286059)[_0xcc5d('0x34')](handleEntityNotFound(_0x144935,null))[_0xcc5d('0x34')](respondWithResult(_0x144935,null))[_0xcc5d('0x26')](handleError(_0x144935,null));};exports[_0xcc5d('0x56')]=function(_0x3d4c7a,_0x85fdb9){return db[_0xcc5d('0x4c')][_0xcc5d('0x56')](_0x3d4c7a[_0xcc5d('0x57')],{})[_0xcc5d('0x34')](respondWithResult(_0x85fdb9,0xc9))[_0xcc5d('0x26')](handleError(_0x85fdb9,null));};exports[_0xcc5d('0x32')]=function(_0x112c56,_0x4feeec){if(_0x112c56[_0xcc5d('0x57')]['id']){delete _0x112c56['body']['id'];}return db[_0xcc5d('0x4c')]['find']({'where':{'id':_0x112c56[_0xcc5d('0x52')]['id']}})[_0xcc5d('0x34')](handleEntityNotFound(_0x4feeec,null))[_0xcc5d('0x34')](saveUpdates(_0x112c56[_0xcc5d('0x57')],null))[_0xcc5d('0x34')](respondWithResult(_0x4feeec,null))[_0xcc5d('0x26')](handleError(_0x4feeec,null));};exports['destroy']=function(_0x2faafa,_0x2953e9){return db[_0xcc5d('0x4c')][_0xcc5d('0x55')]({'where':{'id':_0x2faafa['params']['id']}})[_0xcc5d('0x34')](handleEntityNotFound(_0x2953e9,null))[_0xcc5d('0x34')](removeEntity(_0x2953e9,null))[_0xcc5d('0x26')](handleError(_0x2953e9,null));};exports[_0xcc5d('0x58')]=function(_0x491996,_0x4968ef,_0x33ac66){var _0xe7923a={};var _0x2d206d={};var _0x1bdf1c;var _0x4f4704;return db[_0xcc5d('0x4c')][_0xcc5d('0x59')]({'where':{'id':_0x491996['params']['id']}})[_0xcc5d('0x34')](handleEntityNotFound(_0x4968ef,null))[_0xcc5d('0x34')](function(_0x17d71c){if(_0x17d71c){_0x1bdf1c=_0x17d71c;_0x2d206d[_0xcc5d('0x3d')]=_['keys'](db['ServicenowConfiguration'][_0xcc5d('0x39')]);_0x2d206d[_0xcc5d('0x3e')]=_[_0xcc5d('0x53')](_0x491996['query']);_0x2d206d[_0xcc5d('0x3f')]=_['intersection'](_0x2d206d[_0xcc5d('0x3d')],_0x2d206d[_0xcc5d('0x3e')]);_0xe7923a[_0xcc5d('0x41')]=_[_0xcc5d('0x40')](_0x2d206d[_0xcc5d('0x3d')],qs[_0xcc5d('0x42')](_0x491996[_0xcc5d('0x3e')][_0xcc5d('0x42')]));_0xe7923a['attributes']=_0xe7923a[_0xcc5d('0x41')][_0xcc5d('0x54')]?_0xe7923a[_0xcc5d('0x41')]:_0x2d206d['model'];_0xe7923a[_0xcc5d('0x45')]=qs[_0xcc5d('0x46')](_0x491996[_0xcc5d('0x3e')][_0xcc5d('0x46')]);_0xe7923a['where']=qs[_0xcc5d('0x3f')](_[_0xcc5d('0x48')](_0x491996[_0xcc5d('0x3e')],_0x2d206d[_0xcc5d('0x3f')]));if(_0x491996['query']['filter']){_0xe7923a['where']=_['merge'](_0xe7923a[_0xcc5d('0x47')],{'$or':_['map'](_0xe7923a[_0xcc5d('0x41')],function(_0x104a0f){var _0x58e4c1={};_0x58e4c1[_0x104a0f]={'$like':'%'+_0x491996['query'][_0xcc5d('0x49')]+'%'};return _0x58e4c1;})});}_0xe7923a=_[_0xcc5d('0x4a')]({},_0xe7923a,_0x491996[_0xcc5d('0x5a')]);return _0x1bdf1c['getConfigurations'](_0xe7923a);}})[_0xcc5d('0x34')](function(_0x11b3a0){if(_0x11b3a0){_0x4f4704=_0x11b3a0[_0xcc5d('0x54')];if(!_0x491996['query'][_0xcc5d('0x43')](_0xcc5d('0x44'))){_0xe7923a['limit']=qs['limit'](_0x491996[_0xcc5d('0x3e')][_0xcc5d('0x2c')]);_0xe7923a['offset']=qs[_0xcc5d('0x2b')](_0x491996[_0xcc5d('0x3e')]['offset']);}return _0x1bdf1c[_0xcc5d('0x58')](_0xe7923a);}})[_0xcc5d('0x34')](function(_0x307494){if(_0x307494){return _0x307494?{'count':_0x4f4704,'rows':_0x307494}:null;}})[_0xcc5d('0x34')](respondWithResult(_0x4968ef,null))[_0xcc5d('0x26')](handleError(_0x4968ef,null));};exports[_0xcc5d('0x5b')]=function(_0x26a1f8,_0x3646c8,_0x26b75c){if(_0x26a1f8['body']['id']){delete _0x26a1f8[_0xcc5d('0x57')]['id'];}return db[_0xcc5d('0x4c')][_0xcc5d('0x59')]({'where':{'id':_0x26a1f8[_0xcc5d('0x52')]['id']}})[_0xcc5d('0x34')](handleEntityNotFound(_0x3646c8,null))[_0xcc5d('0x34')](function(_0x87a5d5){if(_0x87a5d5){_0x26a1f8[_0xcc5d('0x57')][_0xcc5d('0x5c')]=_0x87a5d5['id'];_0x26a1f8['body'][_0xcc5d('0x5d')]=integrations[_0xcc5d('0x5e')](_0x26a1f8[_0xcc5d('0x57')][_0xcc5d('0x5f')],_0x26a1f8[_0xcc5d('0x57')][_0xcc5d('0x3b')]);_0x26a1f8[_0xcc5d('0x57')][_0xcc5d('0x60')]=integrations[_0xcc5d('0x61')](_0x26a1f8[_0xcc5d('0x57')]['channel'],_0x26a1f8[_0xcc5d('0x57')][_0xcc5d('0x3b')]);return db[_0xcc5d('0x62')][_0xcc5d('0x56')](_0x26a1f8[_0xcc5d('0x57')],{'include':[{'model':db[_0xcc5d('0x63')],'as':'Subjects'},{'model':db[_0xcc5d('0x63')],'as':_0xcc5d('0x60')}]});}return null;})[_0xcc5d('0x34')](respondWithResult(_0x3646c8,null))[_0xcc5d('0x26')](handleError(_0x3646c8,null));};exports[_0xcc5d('0x64')]=function(_0x198ad8,_0x1ab3ad,_0x4733c6){var _0x4c0948=['made_sla','hold_reason','knowledge','subcategory','close_code',_0xcc5d('0x65'),_0xcc5d('0x66'),_0xcc5d('0x67'),'category'];var _0x58fdf3=[_0xcc5d('0x68'),_0xcc5d('0x69'),_0xcc5d('0x6a'),'watch_list',_0xcc5d('0x6b'),'sys_updated_on',_0xcc5d('0x6c'),_0xcc5d('0x6d'),_0xcc5d('0x6e'),'number',_0xcc5d('0x6f'),'sys_updated_by',_0xcc5d('0x70'),_0xcc5d('0x71'),_0xcc5d('0x72'),'sys_domain','state','sys_created_by',_0xcc5d('0x73'),_0xcc5d('0x45'),_0xcc5d('0x74'),_0xcc5d('0x75'),'cmdb_ci',_0xcc5d('0x76'),_0xcc5d('0x77'),_0xcc5d('0x78'),'work_notes_list','business_service',_0xcc5d('0x79'),_0xcc5d('0x7a'),_0xcc5d('0x7b'),_0xcc5d('0x7c'),_0xcc5d('0x7d'),_0xcc5d('0x7e'),'business_duration',_0xcc5d('0x7f'),_0xcc5d('0x80'),_0xcc5d('0x81'),_0xcc5d('0x82'),_0xcc5d('0x83'),_0xcc5d('0x84'),'subcategory',_0xcc5d('0x85'),_0xcc5d('0x86'),_0xcc5d('0x87'),_0xcc5d('0x88'),'delivery_task',_0xcc5d('0x89'),_0xcc5d('0x8a'),_0xcc5d('0x8b'),_0xcc5d('0x8c'),_0xcc5d('0x8d'),_0xcc5d('0x8e'),'notify','sys_class_name',_0xcc5d('0x8f'),'closed_by',_0xcc5d('0x90'),_0xcc5d('0x91'),'sys_id',_0xcc5d('0x92'),_0xcc5d('0x93'),_0xcc5d('0x66'),'urgency',_0xcc5d('0x94'),_0xcc5d('0x95'),_0xcc5d('0x96'),_0xcc5d('0x97'),'assigned_to','severity','comments','sla_due',_0xcc5d('0x98'),_0xcc5d('0x99'),_0xcc5d('0x9a'),_0xcc5d('0x9b'),'reopen_count',_0xcc5d('0x9c'),_0xcc5d('0x9d'),'upon_approval',_0xcc5d('0x9e'),_0xcc5d('0x9f'),'category'];var _0x18cfa9='';var _0x27a029='';var _0x4f73af=[];var _0x344821='';var _0x52cde1='';var _0x33b554=[];var _0x3ba24b='';var _0x749580='';var _0xf80107={};var _0x39ef38='';return db[_0xcc5d('0x4c')][_0xcc5d('0x59')]({'where':{'id':_0x198ad8[_0xcc5d('0x52')]['id']},'attributes':['id',_0xcc5d('0xa0'),_0xcc5d('0xa1'),'email',_0xcc5d('0xa2'),_0xcc5d('0xa3')]})['then'](handleEntityNotFound(_0x1ab3ad,null))[_0xcc5d('0x34')](function(_0x590b71){if(_0x590b71){_0x39ef38=_0x590b71[_0xcc5d('0xa2')];var _0x27fc7c=_0x39ef38['slice'](-0x1);if(_0x27fc7c==='/'){_0x39ef38=_0x39ef38['substring'](0x0,_0x39ef38[_0xcc5d('0xa4')](_0x27fc7c));}_0x749580=util[_0xcc5d('0xa5')](_0xcc5d('0xa6'),_0x39ef38);_0x3ba24b=util[_0xcc5d('0xa5')](_0xcc5d('0xa7'),_0x39ef38);_0xf80107={'user':_0x590b71['username'],'pass':_0x590b71[_0xcc5d('0xa1')]};var _0x5978b0={'method':_0xcc5d('0xa8'),'uri':_0x749580+_0xcc5d('0xa9'),'auth':_0xf80107,'json':!![]};return rp(_0x5978b0);}})[_0xcc5d('0x34')](function(_0x393e81){if(_0x393e81[_0xcc5d('0x25')][_0xcc5d('0x54')]>0x0){_0x18cfa9=_0x393e81[_0xcc5d('0x25')];}console[_0xcc5d('0xaa')](_0xcc5d('0xab'),_0x18cfa9);_0x33b554=[];_0x27a029=Object[_0xcc5d('0xac')]([],_0x18cfa9);_['remove'](_0x27a029,function(_0x47040b){return!_0x4c0948[_0xcc5d('0xad')](_0x47040b['name']);});_0x27a029['forEach'](function(_0x4a36dc){var _0x5bf13e=createFieldObject(_0x3ba24b,_0xf80107,_0x4a36dc[_0xcc5d('0xae')],_0x4a36dc[_0xcc5d('0x37')],_0x4a36dc[_0xcc5d('0xaf')],![]);_0x33b554[_0xcc5d('0xb0')](_0x5bf13e);});return Promise[_0xcc5d('0xb1')](_0x33b554);})[_0xcc5d('0x34')](function(_0x2ed4a1){_0x4f73af=_0x2ed4a1;_0x344821=Object[_0xcc5d('0xac')]([],_0x18cfa9);console[_0xcc5d('0xaa')]('TCL:\x20_object',_0x18cfa9);_[_0xcc5d('0xb2')](_0x344821,function(_0x40f77a){return _0x58fdf3[_0xcc5d('0xad')](_0x40f77a['name']);});console[_0xcc5d('0xaa')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x344821);_0x33b554=[];_0x344821[_0xcc5d('0xb3')](function(_0x445893){var _0x5399b1=createFieldObject(_0x3ba24b,_0xf80107,_0x445893[_0xcc5d('0xae')],_0x445893[_0xcc5d('0x37')],_0x445893[_0xcc5d('0xaf')],!![]);_0x33b554['push'](_0x5399b1);});return Promise[_0xcc5d('0xb1')](_0x33b554);})['then'](function(_0x178e22){_0x52cde1=_0x178e22;var _0x82576d=_0x4f73af['concat'](_0x52cde1);return{'count':_0x82576d[_0xcc5d('0x54')],'rows':_0x82576d};})['then'](respondWithResult(_0x1ab3ad,null))[_0xcc5d('0x26')](function(_0x5b07ad){console[_0xcc5d('0xaa')](_0xcc5d('0xb4')+_0x5b07ad);var _0x2a1d91=_0x198ad8['query'][_0xcc5d('0x18')]?0x1f4:_0x5b07ad[_0xcc5d('0xb5')]||0x1f4;logger[_0xcc5d('0x22')](_0x5b07ad[_0xcc5d('0x36')]);delete _0x5b07ad['name'];if(_0x2a1d91===0x191){_0x2a1d91=0x190;}_0x1ab3ad['status'](_0x2a1d91)[_0xcc5d('0xb6')](_0x198ad8[_0xcc5d('0x3e')][_0xcc5d('0x18')]?{'message':_0xcc5d('0xb7'),'statusCode':_0x5b07ad[_0xcc5d('0xb5')]}:_0x5b07ad);});};function createFieldObject(_0x329ed3,_0x2adff4,_0x2896ba,_0x118042,_0x2a46d3,_0x1be55f){return new Promise(function(_0x20d7cf,_0xd53e38){var _0x2831d9={'id':_0x118042,'name':_0x2a46d3,'custom':_0x1be55f};if(_0x2896ba===_0xcc5d('0xb8')){_0x2831d9[_0xcc5d('0x5a')]=[{'name':'True','value':'true'},{'name':_0xcc5d('0xb9'),'value':_0xcc5d('0xba')}];_0x20d7cf(_0x2831d9);}else{var _0x300a67={'method':_0xcc5d('0xa8'),'uri':_0x329ed3+'sys_choice?sysparm_query=name=incident^element='+_0x118042,'auth':_0x2adff4,'json':!![]};return rp(_0x300a67)[_0xcc5d('0x34')](function(_0x1d8efd){var _0x1a740a=[];if(_0x1d8efd[_0xcc5d('0x25')]['length']>0x0){_0x1d8efd[_0xcc5d('0x25')][_0xcc5d('0xb3')](function(_0x348cc0){if(_0x348cc0[_0xcc5d('0xbb')]===_0xcc5d('0xba')){var _0x4a55d7={'name':_0x348cc0[_0xcc5d('0xaf')],'value':_0x348cc0[_0xcc5d('0xbc')]};_0x1a740a[_0xcc5d('0xb0')](_0x4a55d7);}});}_0x2831d9[_0xcc5d('0x5a')]=_0x1a740a;if(_0x2831d9[_0xcc5d('0x5a')][_0xcc5d('0x54')]>0x0){_0x20d7cf(_0x2831d9);}else{if(_0x1be55f==![]){_0x20d7cf();}else{_0x20d7cf(_0x2831d9);}}});}});} \ No newline at end of file +var _0x8fed=['../../config/logger','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','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','stack','name','send','index','map','ServicenowAccount','type','key','model','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','includeAll','include','rows','show','params','keys','rawAttributes','find','create','body','getConfigurations','findOne','filter','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','parent','watch_list','sys_updated_on','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','delivery_task','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','due_date','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','remoteUri','serverUrl','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident\x20table\x20objects','assign','remove','forEach','internalType','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','concat','ServiceNow\x20error:\x20','statusCode','boolean','True','true','false','inactive','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x165508,_0x3f7033){var _0x26b90f=function(_0x4de9aa){while(--_0x4de9aa){_0x165508['push'](_0x165508['shift']());}};_0x26b90f(++_0x3f7033);}(_0x8fed,0xab));var _0xd8fe=function(_0x5367a1,_0x11c0e0){_0x5367a1=_0x5367a1-0x0;var _0x928aeb=_0x8fed[_0x5367a1];return _0x928aeb;};'use strict';var pdf=require(_0xd8fe('0x0'));var emlformat=require(_0xd8fe('0x1'));var rimraf=require(_0xd8fe('0x2'));var zipdir=require(_0xd8fe('0x3'));var jsonpatch=require(_0xd8fe('0x4'));var rp=require(_0xd8fe('0x5'));var moment=require(_0xd8fe('0x6'));var BPromise=require(_0xd8fe('0x7'));var Mustache=require(_0xd8fe('0x8'));var util=require(_0xd8fe('0x9'));var path=require(_0xd8fe('0xa'));var sox=require(_0xd8fe('0xb'));var csv=require(_0xd8fe('0xc'));var ejs=require(_0xd8fe('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd8fe('0xe'));var crypto=require(_0xd8fe('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd8fe('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd8fe('0x11'));var Papa=require('papaparse');var Redis=require(_0xd8fe('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd8fe('0x13'));var hardwareService=require(_0xd8fe('0x14'));var logger=require(_0xd8fe('0x15'))(_0xd8fe('0x16'));var utils=require(_0xd8fe('0x17'));var config=require(_0xd8fe('0x18'));var db=require(_0xd8fe('0x19'))['db'];var integrations=require(_0xd8fe('0x1a'));var jayson=require(_0xd8fe('0x1b'));var client=jayson[_0xd8fe('0x1c')][_0xd8fe('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x181aa7,_0x4515d1,_0xe7e980){if(_0xe7e980){var _0x5b942=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5b942[_0xd8fe('0x1e')](_0x4515d1)){return _0x181aa7;}else{throw new db[(_0xd8fe('0x1f'))][(_0xd8fe('0x20'))](_0xd8fe('0x21'));}}else{return _0x181aa7;}}function respondWithRpcPromise(_0x3589e0,_0x54f9c6,_0x469404,_0x38ced3){return new BPromise(function(_0x3d8784,_0x7bdbfb){var _0x2034ac=_0x38ced3||client;return _0x2034ac[_0xd8fe('0x22')](_0x3589e0,_0x469404)[_0xd8fe('0x23')](function(_0x56805a){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x54f9c6,'request\x20sent');logger['debug'](_0xd8fe('0x24'),_0x54f9c6,_0xd8fe('0x25'),JSON[_0xd8fe('0x26')](_0x56805a));if(_0x56805a['error']){if(_0x56805a['error']['code']===0x1f4){logger[_0xd8fe('0x27')](_0xd8fe('0x28'),_0x54f9c6,_0x56805a['error']['message']);return _0x7bdbfb(_0x56805a[_0xd8fe('0x27')][_0xd8fe('0x29')]);}logger[_0xd8fe('0x27')]('ServicenowAccount,\x20%s,\x20%s',_0x54f9c6,_0x56805a[_0xd8fe('0x27')][_0xd8fe('0x29')]);return _0x3d8784(_0x56805a[_0xd8fe('0x27')][_0xd8fe('0x29')]);}else{logger[_0xd8fe('0x2a')]('ServicenowAccount,\x20%s,\x20%s',_0x54f9c6,_0xd8fe('0x25'));_0x3d8784(_0x56805a[_0xd8fe('0x2b')][_0xd8fe('0x29')]);}})[_0xd8fe('0x2c')](function(_0x4941a7){logger[_0xd8fe('0x27')](_0xd8fe('0x28'),_0x54f9c6,_0x4941a7);_0x7bdbfb(_0x4941a7);});});}function respondWithStatusCode(_0x48ad3b,_0x1330bb){_0x1330bb=_0x1330bb||0xcc;return function(_0x91c680){if(_0x91c680){return _0x48ad3b[_0xd8fe('0x2d')](_0x1330bb);}return _0x48ad3b[_0xd8fe('0x2e')](_0x1330bb)[_0xd8fe('0x2f')]();};}function respondWithResult(_0x3716af,_0x3a6782){_0x3a6782=_0x3a6782||0xc8;return function(_0x194545){if(_0x194545){return _0x3716af[_0xd8fe('0x2e')](_0x3a6782)['json'](_0x194545);}};}function respondWithFilteredResult(_0x49e50b,_0x21224d){return function(_0x18cf11){if(_0x18cf11){var _0x4cde41=_0x18cf11[_0xd8fe('0x30')],_0x19ef07=_0x21224d[_0xd8fe('0x31')],_0x5744f2=_0x21224d[_0xd8fe('0x31')]+_0x21224d[_0xd8fe('0x32')],_0x3b39f1;if(_0x5744f2>=_0x4cde41){_0x5744f2=_0x4cde41;_0x3b39f1=0xc8;}else{_0x3b39f1=0xce;}_0x49e50b[_0xd8fe('0x2e')](_0x3b39f1);return _0x49e50b['set'](_0xd8fe('0x33'),_0x19ef07+'-'+_0x5744f2+'/'+_0x4cde41)[_0xd8fe('0x34')](_0x18cf11);}return null;};}function patchUpdates(_0x4bdec2){return function(_0x5dc728){try{jsonpatch[_0xd8fe('0x35')](_0x5dc728,_0x4bdec2,!![]);}catch(_0x2f1d0a){return BPromise['reject'](_0x2f1d0a);}return _0x5dc728[_0xd8fe('0x36')]();};}function saveUpdates(_0x5d99d4,_0x4ca650){return function(_0x2b108e){if(_0x2b108e){return _0x2b108e[_0xd8fe('0x37')](_0x5d99d4)[_0xd8fe('0x23')](function(_0x5e6372){return _0x5e6372;});}return null;};}function removeEntity(_0x94222f,_0x44b407){return function(_0x40d375){if(_0x40d375){return _0x40d375[_0xd8fe('0x38')]()[_0xd8fe('0x23')](function(){_0x94222f[_0xd8fe('0x2e')](0xcc)[_0xd8fe('0x2f')]();});}};}function handleEntityNotFound(_0x329aa0,_0x4edb04){return function(_0x28a229){if(!_0x28a229){_0x329aa0['sendStatus'](0x194);}return _0x28a229;};}function handleError(_0x2a5000,_0x161ded){_0x161ded=_0x161ded||0x1f4;return function(_0x545766){logger[_0xd8fe('0x27')](_0x545766[_0xd8fe('0x39')]);if(_0x545766[_0xd8fe('0x3a')]){delete _0x545766[_0xd8fe('0x3a')];}_0x2a5000['status'](_0x161ded)[_0xd8fe('0x3b')](_0x545766);};}exports[_0xd8fe('0x3c')]=function(_0x46ccb6,_0x24c329){var _0x51b715={},_0x88e166={},_0x1f402e={'count':0x0,'rows':[]};var _0x1132c4=_[_0xd8fe('0x3d')](db[_0xd8fe('0x3e')]['rawAttributes'],function(_0x3f964e){return{'name':_0x3f964e['fieldName'],'type':_0x3f964e[_0xd8fe('0x3f')][_0xd8fe('0x40')]};});_0x88e166[_0xd8fe('0x41')]=_[_0xd8fe('0x3d')](_0x1132c4,_0xd8fe('0x3a'));_0x88e166['query']=_['keys'](_0x46ccb6['query']);_0x88e166['filters']=_[_0xd8fe('0x42')](_0x88e166[_0xd8fe('0x41')],_0x88e166[_0xd8fe('0x43')]);_0x51b715[_0xd8fe('0x44')]=_[_0xd8fe('0x42')](_0x88e166['model'],qs[_0xd8fe('0x45')](_0x46ccb6[_0xd8fe('0x43')][_0xd8fe('0x45')]));_0x51b715['attributes']=_0x51b715[_0xd8fe('0x44')][_0xd8fe('0x46')]?_0x51b715[_0xd8fe('0x44')]:_0x88e166[_0xd8fe('0x41')];if(!_0x46ccb6[_0xd8fe('0x43')][_0xd8fe('0x47')](_0xd8fe('0x48'))){_0x51b715[_0xd8fe('0x32')]=qs['limit'](_0x46ccb6[_0xd8fe('0x43')][_0xd8fe('0x32')]);_0x51b715['offset']=qs[_0xd8fe('0x31')](_0x46ccb6[_0xd8fe('0x43')][_0xd8fe('0x31')]);}_0x51b715[_0xd8fe('0x49')]=qs[_0xd8fe('0x4a')](_0x46ccb6['query']['sort']);_0x51b715[_0xd8fe('0x4b')]=qs[_0xd8fe('0x4c')](_[_0xd8fe('0x4d')](_0x46ccb6['query'],_0x88e166[_0xd8fe('0x4c')]),_0x1132c4);if(_0x46ccb6[_0xd8fe('0x43')]['filter']){_0x51b715['where']=_[_0xd8fe('0x4e')](_0x51b715[_0xd8fe('0x4b')],{'$or':_[_0xd8fe('0x3d')](_0x1132c4,function(_0x194cb6){if(_0x194cb6[_0xd8fe('0x3f')]!=='VIRTUAL'){var _0x50bbdf={};_0x50bbdf[_0x194cb6[_0xd8fe('0x3a')]]={'$like':'%'+_0x46ccb6[_0xd8fe('0x43')]['filter']+'%'};return _0x50bbdf;}})});}_0x51b715=_[_0xd8fe('0x4e')]({},_0x51b715,_0x46ccb6[_0xd8fe('0x4f')]);var _0x4a97fe={'where':_0x51b715['where']};return db[_0xd8fe('0x3e')][_0xd8fe('0x30')](_0x4a97fe)['then'](function(_0x37a4e9){_0x1f402e[_0xd8fe('0x30')]=_0x37a4e9;if(_0x46ccb6[_0xd8fe('0x43')][_0xd8fe('0x50')]){_0x51b715[_0xd8fe('0x51')]=[{'all':!![]}];}return db[_0xd8fe('0x3e')]['findAll'](_0x51b715);})[_0xd8fe('0x23')](function(_0x2576ee){_0x1f402e[_0xd8fe('0x52')]=_0x2576ee;return _0x1f402e;})[_0xd8fe('0x23')](respondWithFilteredResult(_0x24c329,_0x51b715))[_0xd8fe('0x2c')](handleError(_0x24c329,null));};exports[_0xd8fe('0x53')]=function(_0x40c8c8,_0x3b2da2){var _0xfabd6b={'raw':![],'where':{'id':_0x40c8c8[_0xd8fe('0x54')]['id']}},_0x41710c={};_0x41710c[_0xd8fe('0x41')]=_[_0xd8fe('0x55')](db[_0xd8fe('0x3e')][_0xd8fe('0x56')]);_0x41710c[_0xd8fe('0x43')]=_[_0xd8fe('0x55')](_0x40c8c8['query']);_0x41710c[_0xd8fe('0x4c')]=_[_0xd8fe('0x42')](_0x41710c['model'],_0x41710c[_0xd8fe('0x43')]);_0xfabd6b[_0xd8fe('0x44')]=_['intersection'](_0x41710c['model'],qs[_0xd8fe('0x45')](_0x40c8c8['query'][_0xd8fe('0x45')]));_0xfabd6b['attributes']=_0xfabd6b[_0xd8fe('0x44')][_0xd8fe('0x46')]?_0xfabd6b['attributes']:_0x41710c['model'];if(_0x40c8c8[_0xd8fe('0x43')][_0xd8fe('0x50')]){_0xfabd6b[_0xd8fe('0x51')]=[{'all':!![]}];}_0xfabd6b=_[_0xd8fe('0x4e')]({},_0xfabd6b,_0x40c8c8[_0xd8fe('0x4f')]);return db[_0xd8fe('0x3e')][_0xd8fe('0x57')](_0xfabd6b)['then'](handleEntityNotFound(_0x3b2da2,null))[_0xd8fe('0x23')](respondWithResult(_0x3b2da2,null))[_0xd8fe('0x2c')](handleError(_0x3b2da2,null));};exports[_0xd8fe('0x58')]=function(_0x293ad4,_0x3c140f){return db[_0xd8fe('0x3e')]['create'](_0x293ad4[_0xd8fe('0x59')],{})[_0xd8fe('0x23')](respondWithResult(_0x3c140f,0xc9))[_0xd8fe('0x2c')](handleError(_0x3c140f,null));};exports[_0xd8fe('0x37')]=function(_0x16bc3d,_0x450b6c){if(_0x16bc3d[_0xd8fe('0x59')]['id']){delete _0x16bc3d['body']['id'];}return db[_0xd8fe('0x3e')]['find']({'where':{'id':_0x16bc3d[_0xd8fe('0x54')]['id']}})[_0xd8fe('0x23')](handleEntityNotFound(_0x450b6c,null))['then'](saveUpdates(_0x16bc3d[_0xd8fe('0x59')],null))[_0xd8fe('0x23')](respondWithResult(_0x450b6c,null))[_0xd8fe('0x2c')](handleError(_0x450b6c,null));};exports[_0xd8fe('0x38')]=function(_0x41b986,_0x527161){return db['ServicenowAccount'][_0xd8fe('0x57')]({'where':{'id':_0x41b986[_0xd8fe('0x54')]['id']}})['then'](handleEntityNotFound(_0x527161,null))[_0xd8fe('0x23')](removeEntity(_0x527161,null))[_0xd8fe('0x2c')](handleError(_0x527161,null));};exports[_0xd8fe('0x5a')]=function(_0x16be91,_0x1c2385,_0xe63eb6){var _0x4a1e56={};var _0x155266={};var _0x14fb4d;var _0x318751;return db[_0xd8fe('0x3e')][_0xd8fe('0x5b')]({'where':{'id':_0x16be91['params']['id']}})[_0xd8fe('0x23')](handleEntityNotFound(_0x1c2385,null))['then'](function(_0x387b6b){if(_0x387b6b){_0x14fb4d=_0x387b6b;_0x155266['model']=_[_0xd8fe('0x55')](db['ServicenowConfiguration'][_0xd8fe('0x56')]);_0x155266[_0xd8fe('0x43')]=_[_0xd8fe('0x55')](_0x16be91[_0xd8fe('0x43')]);_0x155266[_0xd8fe('0x4c')]=_['intersection'](_0x155266['model'],_0x155266[_0xd8fe('0x43')]);_0x4a1e56['attributes']=_[_0xd8fe('0x42')](_0x155266['model'],qs['fields'](_0x16be91[_0xd8fe('0x43')][_0xd8fe('0x45')]));_0x4a1e56['attributes']=_0x4a1e56[_0xd8fe('0x44')][_0xd8fe('0x46')]?_0x4a1e56[_0xd8fe('0x44')]:_0x155266[_0xd8fe('0x41')];_0x4a1e56[_0xd8fe('0x49')]=qs[_0xd8fe('0x4a')](_0x16be91[_0xd8fe('0x43')][_0xd8fe('0x4a')]);_0x4a1e56[_0xd8fe('0x4b')]=qs['filters'](_['pick'](_0x16be91['query'],_0x155266[_0xd8fe('0x4c')]));if(_0x16be91['query'][_0xd8fe('0x5c')]){_0x4a1e56[_0xd8fe('0x4b')]=_[_0xd8fe('0x4e')](_0x4a1e56[_0xd8fe('0x4b')],{'$or':_[_0xd8fe('0x3d')](_0x4a1e56[_0xd8fe('0x44')],function(_0x1acef2){var _0x5622f1={};_0x5622f1[_0x1acef2]={'$like':'%'+_0x16be91['query']['filter']+'%'};return _0x5622f1;})});}_0x4a1e56=_['merge']({},_0x4a1e56,_0x16be91['options']);return _0x14fb4d[_0xd8fe('0x5a')](_0x4a1e56);}})[_0xd8fe('0x23')](function(_0x5d63ab){if(_0x5d63ab){_0x318751=_0x5d63ab[_0xd8fe('0x46')];if(!_0x16be91[_0xd8fe('0x43')][_0xd8fe('0x47')](_0xd8fe('0x48'))){_0x4a1e56[_0xd8fe('0x32')]=qs[_0xd8fe('0x32')](_0x16be91['query'][_0xd8fe('0x32')]);_0x4a1e56[_0xd8fe('0x31')]=qs['offset'](_0x16be91['query'][_0xd8fe('0x31')]);}return _0x14fb4d[_0xd8fe('0x5a')](_0x4a1e56);}})['then'](function(_0x32b1f7){if(_0x32b1f7){return _0x32b1f7?{'count':_0x318751,'rows':_0x32b1f7}:null;}})['then'](respondWithResult(_0x1c2385,null))['catch'](handleError(_0x1c2385,null));};exports[_0xd8fe('0x5d')]=function(_0x2db9ff,_0x53a612,_0x7982d8){if(_0x2db9ff[_0xd8fe('0x59')]['id']){delete _0x2db9ff['body']['id'];}return db[_0xd8fe('0x3e')][_0xd8fe('0x5b')]({'where':{'id':_0x2db9ff[_0xd8fe('0x54')]['id']}})['then'](handleEntityNotFound(_0x53a612,null))[_0xd8fe('0x23')](function(_0xa47ae1){if(_0xa47ae1){_0x2db9ff[_0xd8fe('0x59')]['AccountId']=_0xa47ae1['id'];_0x2db9ff['body'][_0xd8fe('0x5e')]=integrations[_0xd8fe('0x5f')](_0x2db9ff['body'][_0xd8fe('0x60')],_0x2db9ff[_0xd8fe('0x59')]['type']);_0x2db9ff[_0xd8fe('0x59')][_0xd8fe('0x61')]=integrations[_0xd8fe('0x62')](_0x2db9ff[_0xd8fe('0x59')][_0xd8fe('0x60')],_0x2db9ff['body']['type']);return db[_0xd8fe('0x63')][_0xd8fe('0x58')](_0x2db9ff['body'],{'include':[{'model':db['ServicenowField'],'as':_0xd8fe('0x5e')},{'model':db['ServicenowField'],'as':_0xd8fe('0x61')}]});}return null;})['then'](respondWithResult(_0x53a612,null))[_0xd8fe('0x2c')](handleError(_0x53a612,null));};exports[_0xd8fe('0x64')]=function(_0x583888,_0x2c8a1e,_0x2ec517){var _0x3c9593=[_0xd8fe('0x65'),_0xd8fe('0x66'),_0xd8fe('0x67'),_0xd8fe('0x68'),_0xd8fe('0x69'),_0xd8fe('0x6a'),_0xd8fe('0x6b'),_0xd8fe('0x6c'),'category'];var _0x4db783=[_0xd8fe('0x6d'),'made_sla','caused_by',_0xd8fe('0x6e'),'upon_reject',_0xd8fe('0x6f'),_0xd8fe('0x70'),_0xd8fe('0x66'),_0xd8fe('0x71'),'number','resolved_by',_0xd8fe('0x72'),_0xd8fe('0x73'),_0xd8fe('0x74'),'sys_created_on',_0xd8fe('0x75'),_0xd8fe('0x76'),_0xd8fe('0x77'),_0xd8fe('0x67'),_0xd8fe('0x49'),_0xd8fe('0x78'),_0xd8fe('0x79'),'cmdb_ci','delivery_plan','impact',_0xd8fe('0x7a'),'work_notes_list',_0xd8fe('0x7b'),_0xd8fe('0x7c'),_0xd8fe('0x7d'),_0xd8fe('0x7e'),_0xd8fe('0x7f'),_0xd8fe('0x80'),_0xd8fe('0x81'),_0xd8fe('0x82'),'group_list',_0xd8fe('0x83'),_0xd8fe('0x84'),_0xd8fe('0x85'),_0xd8fe('0x86'),_0xd8fe('0x87'),_0xd8fe('0x68'),_0xd8fe('0x88'),'short_description','close_code','correlation_display',_0xd8fe('0x89'),'work_start',_0xd8fe('0x8a'),_0xd8fe('0x8b'),'additional_assignee_list',_0xd8fe('0x8c'),_0xd8fe('0x8d'),_0xd8fe('0x6a'),_0xd8fe('0x8e'),_0xd8fe('0x8f'),_0xd8fe('0x90'),'follow_up',_0xd8fe('0x91'),_0xd8fe('0x92'),_0xd8fe('0x93'),_0xd8fe('0x94'),_0xd8fe('0x6b'),_0xd8fe('0x95'),_0xd8fe('0x96'),_0xd8fe('0x97'),_0xd8fe('0x98'),_0xd8fe('0x99'),_0xd8fe('0x9a'),_0xd8fe('0x6c'),'comments',_0xd8fe('0x9b'),'approval','comments_and_work_notes',_0xd8fe('0x9c'),'sys_mod_count',_0xd8fe('0x9d'),_0xd8fe('0x9e'),_0xd8fe('0x9f'),_0xd8fe('0xa0'),_0xd8fe('0xa1'),_0xd8fe('0xa2'),_0xd8fe('0xa3')];var _0x3ff528='';var _0x335c69='';var _0x289ee4=[];var _0x1f0232='';var _0x1465cb='';var _0x580aec=[];var _0xcc3954='';var _0x10c8fb='';var _0x11fd9e={};var _0x139ca1='';return db[_0xd8fe('0x3e')][_0xd8fe('0x5b')]({'where':{'id':_0x583888[_0xd8fe('0x54')]['id']},'attributes':['id',_0xd8fe('0xa4'),_0xd8fe('0xa5'),'email',_0xd8fe('0xa6'),_0xd8fe('0xa7')]})['then'](handleEntityNotFound(_0x2c8a1e,null))[_0xd8fe('0x23')](function(_0x40dd47){if(_0x40dd47){_0x139ca1=_0x40dd47['remoteUri'];var _0x133154=_0x139ca1['slice'](-0x1);if(_0x133154==='/'){_0x139ca1=_0x139ca1['substring'](0x0,_0x139ca1[_0xd8fe('0xa8')](_0x133154));}_0x10c8fb=util[_0xd8fe('0xa9')](_0xd8fe('0xaa'),_0x139ca1);_0xcc3954=util[_0xd8fe('0xa9')](_0xd8fe('0xab'),_0x139ca1);_0x11fd9e={'user':_0x40dd47[_0xd8fe('0xa4')],'pass':_0x40dd47[_0xd8fe('0xa5')]};var _0x2fb9f9={'method':_0xd8fe('0xac'),'uri':_0x10c8fb+'incident?sysparm_display_value=all','auth':_0x11fd9e,'json':!![]};return rp(_0x2fb9f9);}})[_0xd8fe('0x23')](function(_0xb46b05){if(_0xb46b05[_0xd8fe('0x2b')]['length']>0x0){_0x3ff528=_0xb46b05[_0xd8fe('0x2b')];}console['log'](_0xd8fe('0xad'),_0x3ff528);_0x580aec=[];_0x335c69=Object[_0xd8fe('0xae')]([],_0x3ff528);_[_0xd8fe('0xaf')](_0x335c69,function(_0xf74e51){return!_0x3c9593['includes'](_0xf74e51[_0xd8fe('0x3a')]);});_0x335c69[_0xd8fe('0xb0')](function(_0x5699e6){var _0x227c49=createFieldObject(_0xcc3954,_0x11fd9e,_0x5699e6[_0xd8fe('0xb1')],_0x5699e6['name'],_0x5699e6['label'],![]);_0x580aec[_0xd8fe('0xb2')](_0x227c49);});return Promise[_0xd8fe('0xb3')](_0x580aec);})[_0xd8fe('0x23')](function(_0x52c0f2){_0x289ee4=_0x52c0f2;_0x1f0232=Object[_0xd8fe('0xae')]([],_0x3ff528);console['log'](_0xd8fe('0xb4'),_0x3ff528);_[_0xd8fe('0xaf')](_0x1f0232,function(_0x263a08){return _0x4db783[_0xd8fe('0xb5')](_0x263a08[_0xd8fe('0x3a')]);});console['log'](_0xd8fe('0xb6'),_0x1f0232);_0x580aec=[];_0x1f0232[_0xd8fe('0xb0')](function(_0x67b402){var _0x2fc698=createFieldObject(_0xcc3954,_0x11fd9e,_0x67b402[_0xd8fe('0xb1')],_0x67b402['name'],_0x67b402[_0xd8fe('0xb7')],!![]);_0x580aec['push'](_0x2fc698);});return Promise['all'](_0x580aec);})[_0xd8fe('0x23')](function(_0x1d90b2){_0x1465cb=_0x1d90b2;var _0x2b74b9=_0x289ee4[_0xd8fe('0xb8')](_0x1465cb);return{'count':_0x2b74b9[_0xd8fe('0x46')],'rows':_0x2b74b9};})[_0xd8fe('0x23')](respondWithResult(_0x2c8a1e,null))['catch'](function(_0x4263d5){console['log'](_0xd8fe('0xb9')+_0x4263d5);var _0x3e65cf=_0x583888[_0xd8fe('0x43')]['test']?0x1f4:_0x4263d5[_0xd8fe('0xba')]||0x1f4;logger[_0xd8fe('0x27')](_0x4263d5['stack']);delete _0x4263d5[_0xd8fe('0x3a')];if(_0x3e65cf===0x191){_0x3e65cf=0x190;}_0x2c8a1e['status'](_0x3e65cf)[_0xd8fe('0x3b')](_0x583888[_0xd8fe('0x43')][_0xd8fe('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x4263d5['statusCode']}:_0x4263d5);});};function createFieldObject(_0x5aef39,_0x2c7acc,_0x198820,_0x370cf8,_0x108349,_0x5e33d8){return new Promise(function(_0x1a29ff,_0x3e34a4){var _0x45e682={'id':_0x370cf8,'name':_0x108349,'custom':_0x5e33d8};if(_0x198820===_0xd8fe('0xbb')){_0x45e682['options']=[{'name':_0xd8fe('0xbc'),'value':_0xd8fe('0xbd')},{'name':'False','value':_0xd8fe('0xbe')}];_0x1a29ff(_0x45e682);}else{var _0xf18cca={'method':'GET','uri':_0x5aef39+'sys_choice?sysparm_query=name=incident^element='+_0x370cf8,'auth':_0x2c7acc,'json':!![]};return rp(_0xf18cca)[_0xd8fe('0x23')](function(_0x1f659e){var _0x5d790c=[];if(_0x1f659e[_0xd8fe('0x2b')][_0xd8fe('0x46')]>0x0){_0x1f659e[_0xd8fe('0x2b')]['forEach'](function(_0x4cdb2f){if(_0x4cdb2f[_0xd8fe('0xbf')]===_0xd8fe('0xbe')){var _0x45f7bd={'name':_0x4cdb2f[_0xd8fe('0xb7')],'value':_0x4cdb2f['value']};_0x5d790c[_0xd8fe('0xb2')](_0x45f7bd);}});}_0x45e682[_0xd8fe('0x4f')]=_0x5d790c;if(_0x45e682[_0xd8fe('0x4f')]['length']>0x0){_0x1a29ff(_0x45e682);}else{if(_0x5e33d8==![]){_0x1a29ff();}else{_0x1a29ff(_0x45e682);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 9eed530..f870d9b 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 _0xc470=['lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x27c52f,_0x4052c5){var _0x121678=function(_0x16ee66){while(--_0x16ee66){_0x27c52f['push'](_0x27c52f['shift']());}};_0x121678(++_0x4052c5);}(_0xc470,0x12c));var _0x0c47=function(_0x330d8c,_0x477d0a){_0x330d8c=_0x330d8c-0x0;var _0x38ec91=_0xc470[_0x330d8c];return _0x38ec91;};'use strict';var _=require(_0x0c47('0x0'));var util=require(_0x0c47('0x1'));var logger=require(_0x0c47('0x2'))(_0x0c47('0x3'));var moment=require(_0x0c47('0x4'));var BPromise=require(_0x0c47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0c47('0x6'));var rimraf=require('rimraf');var config=require(_0x0c47('0x7'));var attributes=require(_0x0c47('0x8'));var integrations=require(_0x0c47('0x9'));module[_0x0c47('0xa')]=function(_0x41de22,_0x52ba2e){return _0x41de22[_0x0c47('0xb')]('ServicenowAccount',attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3334=['../../components/integrations/configuration','exports','define','ServicenowAccount','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x3334,0x13f));var _0x4333=function(_0x15fca1,_0x1e029c){_0x15fca1=_0x15fca1-0x0;var _0x576671=_0x3334[_0x15fca1];return _0x576671;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4333('0x0'))('api');var moment=require(_0x4333('0x1'));var BPromise=require('bluebird');var rp=require(_0x4333('0x2'));var fs=require('fs');var path=require(_0x4333('0x3'));var rimraf=require(_0x4333('0x4'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x4333('0x5'));module[_0x4333('0x6')]=function(_0xa15b8e,_0x38ee04){return _0xa15b8e[_0x4333('0x7')](_0x4333('0x8'),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 6e9f7c4..7553f66 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 _0xbd28=['GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','model','include','ShowServicenowAccount','find','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','result','catch'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xbd28,0x99));var _0x8bd2=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xbd28[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x8bd2('0x0'));var util=require(_0x8bd2('0x1'));var moment=require('moment');var BPromise=require(_0x8bd2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8bd2('0x3'));var logger=require(_0x8bd2('0x4'))(_0x8bd2('0x5'));var config=require(_0x8bd2('0x6'));var jayson=require(_0x8bd2('0x7'));var client=jayson[_0x8bd2('0x8')][_0x8bd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x317311,_0xe58493,_0x484c9e){return new BPromise(function(_0x5a641e,_0x434f21){return client['request'](_0x317311,_0x484c9e)[_0x8bd2('0xa')](function(_0x239deb){logger[_0x8bd2('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0xe58493,_0x8bd2('0xc'));logger[_0x8bd2('0xd')](_0x8bd2('0xe'),_0xe58493,'request\x20sent',JSON[_0x8bd2('0xf')](_0x239deb));if(_0x239deb[_0x8bd2('0x10')]){if(_0x239deb['error'][_0x8bd2('0x11')]===0x1f4){logger[_0x8bd2('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xe58493,_0x239deb[_0x8bd2('0x10')]['message']);return _0x434f21(_0x239deb[_0x8bd2('0x10')][_0x8bd2('0x12')]);}logger[_0x8bd2('0x10')](_0x8bd2('0x13'),_0xe58493,_0x239deb['error'][_0x8bd2('0x12')]);return _0x5a641e(_0x239deb[_0x8bd2('0x10')][_0x8bd2('0x12')]);}else{logger[_0x8bd2('0xb')](_0x8bd2('0x13'),_0xe58493,_0x8bd2('0xc'));_0x5a641e(_0x239deb[_0x8bd2('0x14')][_0x8bd2('0x12')]);}})[_0x8bd2('0x15')](function(_0x48b0b0){logger[_0x8bd2('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xe58493,_0x48b0b0);_0x434f21(_0x48b0b0);});});}exports[_0x8bd2('0x16')]=function(_0x5e5203){var _0x54787c=this;return new Promise(function(_0x5a8fcd,_0x449ef4){return db[_0x8bd2('0x17')][_0x8bd2('0x18')]({'raw':_0x5e5203[_0x8bd2('0x19')]?_0x5e5203[_0x8bd2('0x19')][_0x8bd2('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e5203['options']?_0x5e5203['options'][_0x8bd2('0x1b')]||null:null,'attributes':_0x5e5203[_0x8bd2('0x19')]?_0x5e5203['options'][_0x8bd2('0x1c')]||null:null,'limit':_0x5e5203['options']?_0x5e5203[_0x8bd2('0x19')][_0x8bd2('0x1d')]||null:null,'include':_0x5e5203['options']?_0x5e5203[_0x8bd2('0x19')]['include']?_[_0x8bd2('0x1e')](_0x5e5203[_0x8bd2('0x19')]['include'],function(_0x443993){return{'model':db[_0x443993[_0x8bd2('0x1f')]],'as':_0x443993['as'],'attributes':_0x443993[_0x8bd2('0x1c')],'include':_0x443993[_0x8bd2('0x20')]?_['map'](_0x443993[_0x8bd2('0x20')],function(_0x2cd71){return{'model':db[_0x2cd71[_0x8bd2('0x1f')]],'as':_0x2cd71['as'],'attributes':_0x2cd71[_0x8bd2('0x1c')],'include':_0x2cd71['include']?_['map'](_0x2cd71[_0x8bd2('0x20')],function(_0xac7861){return{'model':db[_0xac7861[_0x8bd2('0x1f')]],'as':_0xac7861['as'],'attributes':_0xac7861[_0x8bd2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8bd2('0xa')](function(_0x497e9c){logger['info'](_0x8bd2('0x16'),_0x5e5203);logger[_0x8bd2('0xd')](_0x8bd2('0x16'),_0x5e5203,JSON[_0x8bd2('0xf')](_0x497e9c));_0x5a8fcd(_0x497e9c);})[_0x8bd2('0x15')](function(_0x5ea241){logger[_0x8bd2('0x10')](_0x8bd2('0x16'),_0x5ea241[_0x8bd2('0x12')],_0x5e5203);_0x449ef4(_0x54787c['error'](0x1f4,_0x5ea241[_0x8bd2('0x12')]));});});};exports[_0x8bd2('0x21')]=function(_0x1dd432){var _0x1aaf0b=this;return new Promise(function(_0x1df8c6,_0x387e1e){return db[_0x8bd2('0x17')][_0x8bd2('0x22')]({'raw':_0x1dd432['options']?_0x1dd432[_0x8bd2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1dd432[_0x8bd2('0x19')]?_0x1dd432['options'][_0x8bd2('0x1b')]||null:null,'attributes':_0x1dd432['options']?_0x1dd432[_0x8bd2('0x19')]['attributes']||null:null,'include':_0x1dd432[_0x8bd2('0x19')]?_0x1dd432[_0x8bd2('0x19')][_0x8bd2('0x20')]?_[_0x8bd2('0x1e')](_0x1dd432[_0x8bd2('0x19')][_0x8bd2('0x20')],function(_0x6fc665){return{'model':db[_0x6fc665[_0x8bd2('0x1f')]],'as':_0x6fc665['as'],'attributes':_0x6fc665['attributes'],'include':_0x6fc665['include']?_[_0x8bd2('0x1e')](_0x6fc665[_0x8bd2('0x20')],function(_0x36d2e5){return{'model':db[_0x36d2e5[_0x8bd2('0x1f')]],'as':_0x36d2e5['as'],'attributes':_0x36d2e5['attributes'],'include':_0x36d2e5[_0x8bd2('0x20')]?_[_0x8bd2('0x1e')](_0x36d2e5[_0x8bd2('0x20')],function(_0x2dac4a){return{'model':db[_0x2dac4a['model']],'as':_0x2dac4a['as'],'attributes':_0x2dac4a[_0x8bd2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8bd2('0xa')](function(_0x2389ab){logger[_0x8bd2('0xb')]('ShowServicenowAccount',_0x1dd432);logger['debug'](_0x8bd2('0x21'),_0x1dd432,JSON[_0x8bd2('0xf')](_0x2389ab));_0x1df8c6(_0x2389ab);})[_0x8bd2('0x15')](function(_0x372503){logger['error']('ShowServicenowAccount',_0x372503[_0x8bd2('0x12')],_0x1dd432);_0x387e1e(_0x1aaf0b[_0x8bd2('0x10')](0x1f4,_0x372503['message']));});});}; \ No newline at end of file +var _0xb5b9=['debug','lodash','util','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','include','map','model','attributes','ShowServicenowAccount','find','then'];(function(_0x3f3bab,_0x2e7209){var _0xe6eba2=function(_0x1f5159){while(--_0x1f5159){_0x3f3bab['push'](_0x3f3bab['shift']());}};_0xe6eba2(++_0x2e7209);}(_0xb5b9,0x161));var _0x9b5b=function(_0x50fb7e,_0x326078){_0x50fb7e=_0x50fb7e-0x0;var _0x36a602=_0xb5b9[_0x50fb7e];return _0x36a602;};'use strict';var _=require(_0x9b5b('0x0'));var util=require(_0x9b5b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9b5b('0x2'));var db=require(_0x9b5b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b5b('0x4'));var config=require(_0x9b5b('0x5'));var jayson=require(_0x9b5b('0x6'));var client=jayson[_0x9b5b('0x7')][_0x9b5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c4051,_0x5bc9a8,_0x5584d1){return new BPromise(function(_0x1b9757,_0x3a3360){return client[_0x9b5b('0x9')](_0x2c4051,_0x5584d1)['then'](function(_0x3292c8){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x5bc9a8,_0x9b5b('0xa'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5bc9a8,_0x9b5b('0xa'),JSON[_0x9b5b('0xb')](_0x3292c8));if(_0x3292c8[_0x9b5b('0xc')]){if(_0x3292c8[_0x9b5b('0xc')]['code']===0x1f4){logger[_0x9b5b('0xc')](_0x9b5b('0xd'),_0x5bc9a8,_0x3292c8[_0x9b5b('0xc')]['message']);return _0x3a3360(_0x3292c8[_0x9b5b('0xc')][_0x9b5b('0xe')]);}logger[_0x9b5b('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0x5bc9a8,_0x3292c8[_0x9b5b('0xc')]['message']);return _0x1b9757(_0x3292c8[_0x9b5b('0xc')][_0x9b5b('0xe')]);}else{logger[_0x9b5b('0xf')](_0x9b5b('0xd'),_0x5bc9a8,_0x9b5b('0xa'));_0x1b9757(_0x3292c8[_0x9b5b('0x10')][_0x9b5b('0xe')]);}})[_0x9b5b('0x11')](function(_0x280146){logger[_0x9b5b('0xc')](_0x9b5b('0xd'),_0x5bc9a8,_0x280146);_0x3a3360(_0x280146);});});}exports[_0x9b5b('0x12')]=function(_0x16d659){var _0x391027=this;return new Promise(function(_0x1fd1ba,_0x28446c){return db[_0x9b5b('0x13')][_0x9b5b('0x14')]({'raw':_0x16d659[_0x9b5b('0x15')]?_0x16d659[_0x9b5b('0x15')][_0x9b5b('0x16')]===undefined?!![]:![]:!![],'where':_0x16d659[_0x9b5b('0x15')]?_0x16d659[_0x9b5b('0x15')][_0x9b5b('0x17')]||null:null,'attributes':_0x16d659['options']?_0x16d659[_0x9b5b('0x15')]['attributes']||null:null,'limit':_0x16d659[_0x9b5b('0x15')]?_0x16d659[_0x9b5b('0x15')]['limit']||null:null,'include':_0x16d659[_0x9b5b('0x15')]?_0x16d659[_0x9b5b('0x15')][_0x9b5b('0x18')]?_[_0x9b5b('0x19')](_0x16d659[_0x9b5b('0x15')][_0x9b5b('0x18')],function(_0xc39796){return{'model':db[_0xc39796[_0x9b5b('0x1a')]],'as':_0xc39796['as'],'attributes':_0xc39796[_0x9b5b('0x1b')],'include':_0xc39796[_0x9b5b('0x18')]?_[_0x9b5b('0x19')](_0xc39796[_0x9b5b('0x18')],function(_0x3dbb84){return{'model':db[_0x3dbb84[_0x9b5b('0x1a')]],'as':_0x3dbb84['as'],'attributes':_0x3dbb84[_0x9b5b('0x1b')],'include':_0x3dbb84[_0x9b5b('0x18')]?_['map'](_0x3dbb84[_0x9b5b('0x18')],function(_0x5ba986){return{'model':db[_0x5ba986[_0x9b5b('0x1a')]],'as':_0x5ba986['as'],'attributes':_0x5ba986['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x412cdb){logger[_0x9b5b('0xf')]('GetServicenowAccount',_0x16d659);logger['debug'](_0x9b5b('0x12'),_0x16d659,JSON[_0x9b5b('0xb')](_0x412cdb));_0x1fd1ba(_0x412cdb);})[_0x9b5b('0x11')](function(_0x3f733e){logger[_0x9b5b('0xc')](_0x9b5b('0x12'),_0x3f733e[_0x9b5b('0xe')],_0x16d659);_0x28446c(_0x391027[_0x9b5b('0xc')](0x1f4,_0x3f733e[_0x9b5b('0xe')]));});});};exports[_0x9b5b('0x1c')]=function(_0x5b8a19){var _0x444020=this;return new Promise(function(_0x4614cd,_0x5814af){return db[_0x9b5b('0x13')][_0x9b5b('0x1d')]({'raw':_0x5b8a19['options']?_0x5b8a19['options']['raw']===undefined?!![]:![]:!![],'where':_0x5b8a19[_0x9b5b('0x15')]?_0x5b8a19[_0x9b5b('0x15')][_0x9b5b('0x17')]||null:null,'attributes':_0x5b8a19['options']?_0x5b8a19['options'][_0x9b5b('0x1b')]||null:null,'include':_0x5b8a19[_0x9b5b('0x15')]?_0x5b8a19[_0x9b5b('0x15')]['include']?_['map'](_0x5b8a19['options'][_0x9b5b('0x18')],function(_0x4c3a3f){return{'model':db[_0x4c3a3f['model']],'as':_0x4c3a3f['as'],'attributes':_0x4c3a3f[_0x9b5b('0x1b')],'include':_0x4c3a3f[_0x9b5b('0x18')]?_[_0x9b5b('0x19')](_0x4c3a3f[_0x9b5b('0x18')],function(_0x34f181){return{'model':db[_0x34f181[_0x9b5b('0x1a')]],'as':_0x34f181['as'],'attributes':_0x34f181[_0x9b5b('0x1b')],'include':_0x34f181[_0x9b5b('0x18')]?_[_0x9b5b('0x19')](_0x34f181[_0x9b5b('0x18')],function(_0x588392){return{'model':db[_0x588392[_0x9b5b('0x1a')]],'as':_0x588392['as'],'attributes':_0x588392['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b5b('0x1e')](function(_0x5b7b00){logger[_0x9b5b('0xf')](_0x9b5b('0x1c'),_0x5b8a19);logger[_0x9b5b('0x1f')]('ShowServicenowAccount',_0x5b8a19,JSON[_0x9b5b('0xb')](_0x5b7b00));_0x4614cd(_0x5b7b00);})[_0x9b5b('0x11')](function(_0x25c33e){logger[_0x9b5b('0xc')]('ShowServicenowAccount',_0x25c33e[_0x9b5b('0xe')],_0x5b8a19);_0x5814af(_0x444020[_0x9b5b('0xc')](0x1f4,_0x25c33e[_0x9b5b('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1501670..0e21a81 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 _0x8636=['index','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','isAuthenticated'];(function(_0x48ae85,_0x4f6363){var _0x2257bc=function(_0x406d8f){while(--_0x406d8f){_0x48ae85['push'](_0x48ae85['shift']());}};_0x2257bc(++_0x4f6363);}(_0x8636,0x99));var _0x6863=function(_0x1dfa55,_0x1d2007){_0x1dfa55=_0x1dfa55-0x0;var _0x893d0e=_0x8636[_0x1dfa55];return _0x893d0e;};'use strict';var multer=require('multer');var util=require(_0x6863('0x0'));var path=require(_0x6863('0x1'));var timeout=require('connect-timeout');var express=require(_0x6863('0x2'));var router=express[_0x6863('0x3')]();var auth=require(_0x6863('0x4'));var interaction=require(_0x6863('0x5'));var config=require('../../config/environment');var controller=require(_0x6863('0x6'));router['get']('/',auth[_0x6863('0x7')](),controller[_0x6863('0x8')]);router[_0x6863('0x9')](_0x6863('0xa'),auth[_0x6863('0x7')](),controller[_0x6863('0xb')]);router[_0x6863('0x9')](_0x6863('0xc'),auth[_0x6863('0x7')](),controller[_0x6863('0xd')]);router['get'](_0x6863('0xe'),auth[_0x6863('0x7')](),controller[_0x6863('0xf')]);router[_0x6863('0x9')](_0x6863('0x10'),auth[_0x6863('0x7')](),controller[_0x6863('0x11')]);router[_0x6863('0x12')]('/',auth['isAuthenticated'](),controller[_0x6863('0x13')]);router['put'](_0x6863('0xa'),auth[_0x6863('0x7')](),controller[_0x6863('0x14')]);router[_0x6863('0x15')]('/:id',auth[_0x6863('0x7')](),controller['destroy']);module[_0x6863('0x16')]=router; \ No newline at end of file +var _0x2579=['put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x2579,0x186));var _0x9257=function(_0x5d60de,_0xbca3c8){_0x5d60de=_0x5d60de-0x0;var _0x3f1eb4=_0x2579[_0x5d60de];return _0x3f1eb4;};'use strict';var multer=require(_0x9257('0x0'));var util=require(_0x9257('0x1'));var path=require(_0x9257('0x2'));var timeout=require(_0x9257('0x3'));var express=require(_0x9257('0x4'));var router=express[_0x9257('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9257('0x6'));var controller=require(_0x9257('0x7'));router[_0x9257('0x8')]('/',auth[_0x9257('0x9')](),controller[_0x9257('0xa')]);router[_0x9257('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x9257('0xb')]);router[_0x9257('0x8')](_0x9257('0xc'),auth[_0x9257('0x9')](),controller[_0x9257('0xd')]);router[_0x9257('0x8')](_0x9257('0xe'),auth[_0x9257('0x9')](),controller['getSubjects']);router[_0x9257('0x8')](_0x9257('0xf'),auth[_0x9257('0x9')](),controller[_0x9257('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9257('0x11')]);router[_0x9257('0x12')](_0x9257('0x13'),auth[_0x9257('0x9')](),controller[_0x9257('0x14')]);router[_0x9257('0x15')]('/:id',auth[_0x9257('0x9')](),controller[_0x9257('0x16')]);module[_0x9257('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index c121c6a..d6b8766 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 _0x421d=['exports','STRING','sequelize'];(function(_0x5c066d,_0x383034){var _0x7080a7=function(_0x10e2ac){while(--_0x10e2ac){_0x5c066d['push'](_0x5c066d['shift']());}};_0x7080a7(++_0x383034);}(_0x421d,0x98));var _0xd421=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x421d[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0xd421('0x0'));module[_0xd421('0x1')]={'name':{'type':Sequelize[_0xd421('0x2')]},'description':{'type':Sequelize[_0xd421('0x2')]}}; \ No newline at end of file +var _0x308c=['STRING','sequelize'];(function(_0xacb6c3,_0x481ccc){var _0x379bef=function(_0x46f2af){while(--_0x46f2af){_0xacb6c3['push'](_0xacb6c3['shift']());}};_0x379bef(++_0x481ccc);}(_0x308c,0x1d3));var _0xc308=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x308c[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0xc308('0x0'));module['exports']={'name':{'type':Sequelize[_0xc308('0x1')]},'description':{'type':Sequelize[_0xc308('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 26bb996..40b4348 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 _0x36ee=['catch','sendStatus','status','end','json','limit','apply','reject','update','destroy','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','merge','VIRTUAL','options','ServicenowConfiguration','count','include','findAll','rows','show','params','length','includeAll','create','body','find','getFields','findOne','ServicenowField','order','pick','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x1b55de,_0xe4362a){var _0x461a2c=function(_0x3f23d7){while(--_0x3f23d7){_0x1b55de['push'](_0x1b55de['shift']());}};_0x461a2c(++_0xe4362a);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe36e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe36e('0x1'));var rp=require(_0xe36e('0x2'));var moment=require(_0xe36e('0x3'));var BPromise=require(_0xe36e('0x4'));var Mustache=require(_0xe36e('0x5'));var util=require(_0xe36e('0x6'));var path=require(_0xe36e('0x7'));var sox=require(_0xe36e('0x8'));var csv=require(_0xe36e('0x9'));var ejs=require(_0xe36e('0xa'));var fs=require('fs');var _=require(_0xe36e('0xb'));var squel=require(_0xe36e('0xc'));var crypto=require('crypto');var jsforce=require(_0xe36e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe36e('0x9'));var querystring=require(_0xe36e('0xe'));var Papa=require(_0xe36e('0xf'));var Redis=require('ioredis');var authService=require(_0xe36e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe36e('0x11'));var hardwareService=require(_0xe36e('0x12'));var logger=require(_0xe36e('0x13'))(_0xe36e('0x14'));var utils=require(_0xe36e('0x15'));var config=require(_0xe36e('0x16'));var db=require(_0xe36e('0x17'))['db'];var jayson=require(_0xe36e('0x18'));var client=jayson['client'][_0xe36e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x27841e,_0x23abfb,_0x1fdea2){if(_0x1fdea2){var _0x5c3f3c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c3f3c[_0xe36e('0x1a')](_0x23abfb)){return _0x27841e;}else{throw new db['Sequelize']['ValidationError'](_0xe36e('0x1b'));}}else{return _0x27841e;}}function respondWithRpcPromise(_0x300f21,_0x26fb37,_0x278135,_0xd6828e){return new BPromise(function(_0x924cd5,_0x2096f6){var _0x39bae8=_0xd6828e||client;return _0x39bae8[_0xe36e('0x1c')](_0x300f21,_0x278135)[_0xe36e('0x1d')](function(_0x5792e8){logger[_0xe36e('0x1e')](_0xe36e('0x1f'),_0x26fb37,'request\x20sent');logger[_0xe36e('0x20')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x26fb37,_0xe36e('0x21'),JSON[_0xe36e('0x22')](_0x5792e8));if(_0x5792e8['error']){if(_0x5792e8[_0xe36e('0x23')][_0xe36e('0x24')]===0x1f4){logger[_0xe36e('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x26fb37,_0x5792e8[_0xe36e('0x23')][_0xe36e('0x25')]);return _0x2096f6(_0x5792e8[_0xe36e('0x23')][_0xe36e('0x25')]);}logger[_0xe36e('0x23')](_0xe36e('0x1f'),_0x26fb37,_0x5792e8['error'][_0xe36e('0x25')]);return _0x924cd5(_0x5792e8[_0xe36e('0x23')][_0xe36e('0x25')]);}else{logger[_0xe36e('0x1e')](_0xe36e('0x1f'),_0x26fb37,'request\x20sent');_0x924cd5(_0x5792e8['result'][_0xe36e('0x25')]);}})[_0xe36e('0x26')](function(_0xb0cd85){logger[_0xe36e('0x23')](_0xe36e('0x1f'),_0x26fb37,_0xb0cd85);_0x2096f6(_0xb0cd85);});});}function respondWithStatusCode(_0x1507f9,_0x1a045c){_0x1a045c=_0x1a045c||0xcc;return function(_0x5ac484){if(_0x5ac484){return _0x1507f9[_0xe36e('0x27')](_0x1a045c);}return _0x1507f9[_0xe36e('0x28')](_0x1a045c)[_0xe36e('0x29')]();};}function respondWithResult(_0x262caa,_0x5e58d8){_0x5e58d8=_0x5e58d8||0xc8;return function(_0x2d757c){if(_0x2d757c){return _0x262caa['status'](_0x5e58d8)[_0xe36e('0x2a')](_0x2d757c);}};}function respondWithFilteredResult(_0x5993de,_0x19f001){return function(_0x5884cb){if(_0x5884cb){var _0x410504=_0x5884cb['count'],_0x4c5d98=_0x19f001['offset'],_0x3b1045=_0x19f001['offset']+_0x19f001[_0xe36e('0x2b')],_0x59548b;if(_0x3b1045>=_0x410504){_0x3b1045=_0x410504;_0x59548b=0xc8;}else{_0x59548b=0xce;}_0x5993de[_0xe36e('0x28')](_0x59548b);return _0x5993de['set']('Content-Range',_0x4c5d98+'-'+_0x3b1045+'/'+_0x410504)[_0xe36e('0x2a')](_0x5884cb);}return null;};}function patchUpdates(_0xb8d44e){return function(_0x259e19){try{jsonpatch[_0xe36e('0x2c')](_0x259e19,_0xb8d44e,!![]);}catch(_0x3d826e){return BPromise[_0xe36e('0x2d')](_0x3d826e);}return _0x259e19['save']();};}function saveUpdates(_0xb98e78,_0x11c95d){return function(_0x57272f){if(_0x57272f){return _0x57272f[_0xe36e('0x2e')](_0xb98e78)[_0xe36e('0x1d')](function(_0xba4869){return _0xba4869;});}return null;};}function removeEntity(_0x5d6f41,_0x21623e){return function(_0x253cdc){if(_0x253cdc){return _0x253cdc[_0xe36e('0x2f')]()[_0xe36e('0x1d')](function(){_0x5d6f41[_0xe36e('0x28')](0xcc)[_0xe36e('0x29')]();});}};}function handleEntityNotFound(_0xf808f5,_0x4c0c46){return function(_0x4507b9){if(!_0x4507b9){_0xf808f5['sendStatus'](0x194);}return _0x4507b9;};}function handleError(_0x4a717e,_0x81cf9a){_0x81cf9a=_0x81cf9a||0x1f4;return function(_0x4f620d){logger[_0xe36e('0x23')](_0x4f620d[_0xe36e('0x30')]);if(_0x4f620d[_0xe36e('0x31')]){delete _0x4f620d[_0xe36e('0x31')];}_0x4a717e['status'](_0x81cf9a)['send'](_0x4f620d);};}exports[_0xe36e('0x32')]=function(_0x222c65,_0x19a53f){var _0x243338={},_0x51894c={},_0xb2046c={'count':0x0,'rows':[]};var _0x2f828e=_[_0xe36e('0x33')](db['ServicenowConfiguration'][_0xe36e('0x34')],function(_0x2ff8f4){return{'name':_0x2ff8f4['fieldName'],'type':_0x2ff8f4[_0xe36e('0x35')][_0xe36e('0x36')]};});_0x51894c[_0xe36e('0x37')]=_[_0xe36e('0x33')](_0x2f828e,_0xe36e('0x31'));_0x51894c[_0xe36e('0x38')]=_[_0xe36e('0x39')](_0x222c65[_0xe36e('0x38')]);_0x51894c[_0xe36e('0x3a')]=_[_0xe36e('0x3b')](_0x51894c[_0xe36e('0x37')],_0x51894c[_0xe36e('0x38')]);_0x243338[_0xe36e('0x3c')]=_['intersection'](_0x51894c[_0xe36e('0x37')],qs[_0xe36e('0x3d')](_0x222c65[_0xe36e('0x38')][_0xe36e('0x3d')]));_0x243338[_0xe36e('0x3c')]=_0x243338['attributes']['length']?_0x243338[_0xe36e('0x3c')]:_0x51894c[_0xe36e('0x37')];if(!_0x222c65[_0xe36e('0x38')][_0xe36e('0x3e')](_0xe36e('0x3f'))){_0x243338[_0xe36e('0x2b')]=qs[_0xe36e('0x2b')](_0x222c65[_0xe36e('0x38')]['limit']);_0x243338[_0xe36e('0x40')]=qs[_0xe36e('0x40')](_0x222c65['query'][_0xe36e('0x40')]);}_0x243338['order']=qs[_0xe36e('0x41')](_0x222c65[_0xe36e('0x38')][_0xe36e('0x41')]);_0x243338[_0xe36e('0x42')]=qs[_0xe36e('0x3a')](_['pick'](_0x222c65[_0xe36e('0x38')],_0x51894c[_0xe36e('0x3a')]),_0x2f828e);if(_0x222c65[_0xe36e('0x38')][_0xe36e('0x43')]){_0x243338[_0xe36e('0x42')]=_[_0xe36e('0x44')](_0x243338['where'],{'$or':_[_0xe36e('0x33')](_0x2f828e,function(_0x134d71){if(_0x134d71[_0xe36e('0x35')]!==_0xe36e('0x45')){var _0x1cbb7d={};_0x1cbb7d[_0x134d71['name']]={'$like':'%'+_0x222c65[_0xe36e('0x38')][_0xe36e('0x43')]+'%'};return _0x1cbb7d;}})});}_0x243338=_[_0xe36e('0x44')]({},_0x243338,_0x222c65[_0xe36e('0x46')]);var _0x11d6b2={'where':_0x243338[_0xe36e('0x42')]};return db[_0xe36e('0x47')][_0xe36e('0x48')](_0x11d6b2)[_0xe36e('0x1d')](function(_0x52e744){_0xb2046c['count']=_0x52e744;if(_0x222c65[_0xe36e('0x38')]['includeAll']){_0x243338[_0xe36e('0x49')]=[{'all':!![]}];}return db[_0xe36e('0x47')][_0xe36e('0x4a')](_0x243338);})[_0xe36e('0x1d')](function(_0x51641c){_0xb2046c[_0xe36e('0x4b')]=_0x51641c;return _0xb2046c;})[_0xe36e('0x1d')](respondWithFilteredResult(_0x19a53f,_0x243338))['catch'](handleError(_0x19a53f,null));};exports[_0xe36e('0x4c')]=function(_0x40634a,_0x2c26e6){var _0x42eae5={'raw':![],'where':{'id':_0x40634a[_0xe36e('0x4d')]['id']}},_0x15895d={};_0x15895d[_0xe36e('0x37')]=_[_0xe36e('0x39')](db[_0xe36e('0x47')][_0xe36e('0x34')]);_0x15895d[_0xe36e('0x38')]=_[_0xe36e('0x39')](_0x40634a[_0xe36e('0x38')]);_0x15895d[_0xe36e('0x3a')]=_[_0xe36e('0x3b')](_0x15895d['model'],_0x15895d[_0xe36e('0x38')]);_0x42eae5['attributes']=_['intersection'](_0x15895d[_0xe36e('0x37')],qs[_0xe36e('0x3d')](_0x40634a['query'][_0xe36e('0x3d')]));_0x42eae5[_0xe36e('0x3c')]=_0x42eae5[_0xe36e('0x3c')][_0xe36e('0x4e')]?_0x42eae5[_0xe36e('0x3c')]:_0x15895d[_0xe36e('0x37')];if(_0x40634a[_0xe36e('0x38')][_0xe36e('0x4f')]){_0x42eae5[_0xe36e('0x49')]=[{'all':!![]}];}_0x42eae5=_['merge']({},_0x42eae5,_0x40634a[_0xe36e('0x46')]);return db[_0xe36e('0x47')]['find'](_0x42eae5)[_0xe36e('0x1d')](handleEntityNotFound(_0x2c26e6,null))[_0xe36e('0x1d')](respondWithResult(_0x2c26e6,null))[_0xe36e('0x26')](handleError(_0x2c26e6,null));};exports[_0xe36e('0x50')]=function(_0x3770bd,_0x53758e){return db['ServicenowConfiguration']['create'](_0x3770bd['body'],{})[_0xe36e('0x1d')](respondWithResult(_0x53758e,0xc9))[_0xe36e('0x26')](handleError(_0x53758e,null));};exports[_0xe36e('0x2e')]=function(_0x3e3d4d,_0x9025cd){if(_0x3e3d4d[_0xe36e('0x51')]['id']){delete _0x3e3d4d[_0xe36e('0x51')]['id'];}return db[_0xe36e('0x47')][_0xe36e('0x52')]({'where':{'id':_0x3e3d4d['params']['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x9025cd,null))[_0xe36e('0x1d')](saveUpdates(_0x3e3d4d['body'],null))[_0xe36e('0x1d')](respondWithResult(_0x9025cd,null))[_0xe36e('0x26')](handleError(_0x9025cd,null));};exports[_0xe36e('0x2f')]=function(_0x443154,_0x700b63){return db[_0xe36e('0x47')][_0xe36e('0x52')]({'where':{'id':_0x443154[_0xe36e('0x4d')]['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x700b63,null))[_0xe36e('0x1d')](removeEntity(_0x700b63,null))[_0xe36e('0x26')](handleError(_0x700b63,null));};exports[_0xe36e('0x53')]=function(_0x389e91,_0x6f979f,_0x3512ec){var _0x3e4860={};var _0x3c78ea={};var _0x275142;var _0x14738a;return db[_0xe36e('0x47')][_0xe36e('0x54')]({'where':{'id':_0x389e91[_0xe36e('0x4d')]['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x6f979f,null))[_0xe36e('0x1d')](function(_0x40604f){if(_0x40604f){_0x275142=_0x40604f;_0x3c78ea['model']=_[_0xe36e('0x39')](db[_0xe36e('0x55')]['rawAttributes']);_0x3c78ea[_0xe36e('0x38')]=_[_0xe36e('0x39')](_0x389e91[_0xe36e('0x38')]);_0x3c78ea[_0xe36e('0x3a')]=_[_0xe36e('0x3b')](_0x3c78ea[_0xe36e('0x37')],_0x3c78ea['query']);_0x3e4860[_0xe36e('0x3c')]=_['intersection'](_0x3c78ea[_0xe36e('0x37')],qs[_0xe36e('0x3d')](_0x389e91[_0xe36e('0x38')][_0xe36e('0x3d')]));_0x3e4860[_0xe36e('0x3c')]=_0x3e4860[_0xe36e('0x3c')][_0xe36e('0x4e')]?_0x3e4860[_0xe36e('0x3c')]:_0x3c78ea['model'];_0x3e4860[_0xe36e('0x56')]=qs[_0xe36e('0x41')](_0x389e91['query'][_0xe36e('0x41')]);_0x3e4860[_0xe36e('0x42')]=qs[_0xe36e('0x3a')](_[_0xe36e('0x57')](_0x389e91[_0xe36e('0x38')],_0x3c78ea[_0xe36e('0x3a')]));if(_0x389e91[_0xe36e('0x38')]['filter']){_0x3e4860[_0xe36e('0x42')]=_[_0xe36e('0x44')](_0x3e4860[_0xe36e('0x42')],{'$or':_[_0xe36e('0x33')](_0x3e4860[_0xe36e('0x3c')],function(_0x43d8c2){var _0xc1daf8={};_0xc1daf8[_0x43d8c2]={'$like':'%'+_0x389e91[_0xe36e('0x38')][_0xe36e('0x43')]+'%'};return _0xc1daf8;})});}_0x3e4860=_[_0xe36e('0x44')]({},_0x3e4860,_0x389e91[_0xe36e('0x46')]);return _0x275142['getFields'](_0x3e4860);}})[_0xe36e('0x1d')](function(_0x9a77de){if(_0x9a77de){_0x14738a=_0x9a77de[_0xe36e('0x4e')];if(!_0x389e91[_0xe36e('0x38')]['hasOwnProperty']('nolimit')){_0x3e4860[_0xe36e('0x2b')]=qs['limit'](_0x389e91['query']['limit']);_0x3e4860[_0xe36e('0x40')]=qs['offset'](_0x389e91[_0xe36e('0x38')][_0xe36e('0x40')]);}return _0x275142[_0xe36e('0x53')](_0x3e4860);}})[_0xe36e('0x1d')](function(_0x1bd60d){if(_0x1bd60d){return _0x1bd60d?{'count':_0x14738a,'rows':_0x1bd60d}:null;}})[_0xe36e('0x1d')](respondWithResult(_0x6f979f,null))[_0xe36e('0x26')](handleError(_0x6f979f,null));};exports[_0xe36e('0x58')]=function(_0x2a26f4,_0x5e7c92,_0x7b9501){var _0x54f14c={};var _0x13ad07={};var _0x517c2a;var _0x3080ad;return db[_0xe36e('0x47')][_0xe36e('0x54')]({'where':{'id':_0x2a26f4[_0xe36e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e7c92,null))['then'](function(_0x5cccb7){if(_0x5cccb7){_0x517c2a=_0x5cccb7;_0x13ad07[_0xe36e('0x37')]=_[_0xe36e('0x39')](db[_0xe36e('0x55')][_0xe36e('0x34')]);_0x13ad07[_0xe36e('0x38')]=_['keys'](_0x2a26f4[_0xe36e('0x38')]);_0x13ad07[_0xe36e('0x3a')]=_['intersection'](_0x13ad07[_0xe36e('0x37')],_0x13ad07['query']);_0x54f14c[_0xe36e('0x3c')]=_[_0xe36e('0x3b')](_0x13ad07[_0xe36e('0x37')],qs[_0xe36e('0x3d')](_0x2a26f4['query'][_0xe36e('0x3d')]));_0x54f14c['attributes']=_0x54f14c['attributes'][_0xe36e('0x4e')]?_0x54f14c[_0xe36e('0x3c')]:_0x13ad07['model'];_0x54f14c['order']=qs[_0xe36e('0x41')](_0x2a26f4['query'][_0xe36e('0x41')]);_0x54f14c[_0xe36e('0x42')]=qs[_0xe36e('0x3a')](_[_0xe36e('0x57')](_0x2a26f4[_0xe36e('0x38')],_0x13ad07[_0xe36e('0x3a')]));if(_0x2a26f4['query'][_0xe36e('0x43')]){_0x54f14c[_0xe36e('0x42')]=_[_0xe36e('0x44')](_0x54f14c[_0xe36e('0x42')],{'$or':_['map'](_0x54f14c[_0xe36e('0x3c')],function(_0x37409f){var _0x2eef73={};_0x2eef73[_0x37409f]={'$like':'%'+_0x2a26f4[_0xe36e('0x38')]['filter']+'%'};return _0x2eef73;})});}_0x54f14c=_[_0xe36e('0x44')]({},_0x54f14c,_0x2a26f4['options']);return _0x517c2a[_0xe36e('0x58')](_0x54f14c);}})['then'](function(_0x160621){if(_0x160621){_0x3080ad=_0x160621['length'];if(!_0x2a26f4['query'][_0xe36e('0x3e')](_0xe36e('0x3f'))){_0x54f14c[_0xe36e('0x2b')]=qs['limit'](_0x2a26f4[_0xe36e('0x38')][_0xe36e('0x2b')]);_0x54f14c['offset']=qs[_0xe36e('0x40')](_0x2a26f4[_0xe36e('0x38')][_0xe36e('0x40')]);}return _0x517c2a['getSubjects'](_0x54f14c);}})['then'](function(_0x72fcc){if(_0x72fcc){return _0x72fcc?{'count':_0x3080ad,'rows':_0x72fcc}:null;}})[_0xe36e('0x1d')](respondWithResult(_0x5e7c92,null))[_0xe36e('0x26')](handleError(_0x5e7c92,null));};exports[_0xe36e('0x59')]=function(_0x411305,_0x51bc99,_0x3797f0){var _0x2847a2={};var _0x15334c={};var _0x79882;var _0xdc59c5;return db['ServicenowConfiguration'][_0xe36e('0x54')]({'where':{'id':_0x411305[_0xe36e('0x4d')]['id']}})[_0xe36e('0x1d')](handleEntityNotFound(_0x51bc99,null))['then'](function(_0x25e4eb){if(_0x25e4eb){_0x79882=_0x25e4eb;_0x15334c['model']=_[_0xe36e('0x39')](db['ServicenowField'][_0xe36e('0x34')]);_0x15334c[_0xe36e('0x38')]=_['keys'](_0x411305[_0xe36e('0x38')]);_0x15334c['filters']=_[_0xe36e('0x3b')](_0x15334c[_0xe36e('0x37')],_0x15334c[_0xe36e('0x38')]);_0x2847a2[_0xe36e('0x3c')]=_[_0xe36e('0x3b')](_0x15334c['model'],qs[_0xe36e('0x3d')](_0x411305['query'][_0xe36e('0x3d')]));_0x2847a2[_0xe36e('0x3c')]=_0x2847a2[_0xe36e('0x3c')][_0xe36e('0x4e')]?_0x2847a2[_0xe36e('0x3c')]:_0x15334c[_0xe36e('0x37')];_0x2847a2['order']=qs[_0xe36e('0x41')](_0x411305[_0xe36e('0x38')][_0xe36e('0x41')]);_0x2847a2['where']=qs[_0xe36e('0x3a')](_[_0xe36e('0x57')](_0x411305[_0xe36e('0x38')],_0x15334c[_0xe36e('0x3a')]));if(_0x411305['query'][_0xe36e('0x43')]){_0x2847a2['where']=_[_0xe36e('0x44')](_0x2847a2['where'],{'$or':_[_0xe36e('0x33')](_0x2847a2[_0xe36e('0x3c')],function(_0xecf9d8){var _0x49a89c={};_0x49a89c[_0xecf9d8]={'$like':'%'+_0x411305[_0xe36e('0x38')][_0xe36e('0x43')]+'%'};return _0x49a89c;})});}_0x2847a2=_['merge']({},_0x2847a2,_0x411305[_0xe36e('0x46')]);return _0x79882[_0xe36e('0x59')](_0x2847a2);}})[_0xe36e('0x1d')](function(_0x531eac){if(_0x531eac){_0xdc59c5=_0x531eac['length'];if(!_0x411305[_0xe36e('0x38')][_0xe36e('0x3e')](_0xe36e('0x3f'))){_0x2847a2[_0xe36e('0x2b')]=qs[_0xe36e('0x2b')](_0x411305['query'][_0xe36e('0x2b')]);_0x2847a2[_0xe36e('0x40')]=qs[_0xe36e('0x40')](_0x411305[_0xe36e('0x38')]['offset']);}return _0x79882[_0xe36e('0x59')](_0x2847a2);}})[_0xe36e('0x1d')](function(_0x4b1024){if(_0x4b1024){return _0x4b1024?{'count':_0xdc59c5,'rows':_0x4b1024}:null;}})['then'](respondWithResult(_0x51bc99,null))['catch'](handleError(_0x51bc99,null));}; \ No newline at end of file +var _0xefda=['stringify','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','apply','update','destroy','then','end','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','limit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','length','find','create','body','getFields','findOne','ServicenowField','nolimit','getSubjects','getDescriptions','order','hasOwnProperty','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','../../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','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xf93b08,_0x2559d7){var _0x12f72e=function(_0x30534b){while(--_0x30534b){_0xf93b08['push'](_0xf93b08['shift']());}};_0x12f72e(++_0x2559d7);}(_0xefda,0x96));var _0xaefd=function(_0x1d0236,_0x4deb06){_0x1d0236=_0x1d0236-0x0;var _0x5d4a5c=_0xefda[_0x1d0236];return _0x5d4a5c;};'use strict';var pdf=require(_0xaefd('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xaefd('0x1'));var jsonpatch=require(_0xaefd('0x2'));var rp=require('request-promise');var moment=require(_0xaefd('0x3'));var BPromise=require(_0xaefd('0x4'));var Mustache=require(_0xaefd('0x5'));var util=require(_0xaefd('0x6'));var path=require(_0xaefd('0x7'));var sox=require(_0xaefd('0x8'));var csv=require('to-csv');var ejs=require(_0xaefd('0x9'));var fs=require('fs');var _=require(_0xaefd('0xa'));var squel=require(_0xaefd('0xb'));var crypto=require(_0xaefd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaefd('0xd'));var toCsv=require(_0xaefd('0xe'));var querystring=require(_0xaefd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaefd('0x10'));var as=require(_0xaefd('0x11'));var hardwareService=require(_0xaefd('0x12'));var logger=require(_0xaefd('0x13'))(_0xaefd('0x14'));var utils=require(_0xaefd('0x15'));var config=require(_0xaefd('0x16'));var db=require(_0xaefd('0x17'))['db'];var jayson=require(_0xaefd('0x18'));var client=jayson[_0xaefd('0x19')][_0xaefd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x4b2b5c,_0x3172d3,_0x4ac467){if(_0x4ac467){var _0xd88c7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd88c7c[_0xaefd('0x1b')](_0x3172d3)){return _0x4b2b5c;}else{throw new db[(_0xaefd('0x1c'))][(_0xaefd('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 _0x4b2b5c;}}function respondWithRpcPromise(_0x16e4f4,_0x13492c,_0x41f345,_0x411701){return new BPromise(function(_0x10ee28,_0x32f75e){var _0x277070=_0x411701||client;return _0x277070[_0xaefd('0x1e')](_0x16e4f4,_0x41f345)['then'](function(_0x9d9c29){logger[_0xaefd('0x1f')](_0xaefd('0x20'),_0x13492c,_0xaefd('0x21'));logger[_0xaefd('0x22')](_0xaefd('0x23'),_0x13492c,'request\x20sent',JSON[_0xaefd('0x24')](_0x9d9c29));if(_0x9d9c29[_0xaefd('0x25')]){if(_0x9d9c29[_0xaefd('0x25')][_0xaefd('0x26')]===0x1f4){logger[_0xaefd('0x25')](_0xaefd('0x20'),_0x13492c,_0x9d9c29['error'][_0xaefd('0x27')]);return _0x32f75e(_0x9d9c29[_0xaefd('0x25')][_0xaefd('0x27')]);}logger[_0xaefd('0x25')](_0xaefd('0x20'),_0x13492c,_0x9d9c29['error']['message']);return _0x10ee28(_0x9d9c29['error'][_0xaefd('0x27')]);}else{logger[_0xaefd('0x1f')](_0xaefd('0x20'),_0x13492c,'request\x20sent');_0x10ee28(_0x9d9c29[_0xaefd('0x28')]['message']);}})[_0xaefd('0x29')](function(_0x3caa99){logger[_0xaefd('0x25')]('ServicenowConfiguration,\x20%s,\x20%s',_0x13492c,_0x3caa99);_0x32f75e(_0x3caa99);});});}function respondWithStatusCode(_0x435413,_0x3ffc9c){_0x3ffc9c=_0x3ffc9c||0xcc;return function(_0x18e720){if(_0x18e720){return _0x435413[_0xaefd('0x2a')](_0x3ffc9c);}return _0x435413[_0xaefd('0x2b')](_0x3ffc9c)['end']();};}function respondWithResult(_0x2fe27e,_0x58c008){_0x58c008=_0x58c008||0xc8;return function(_0x810bf){if(_0x810bf){return _0x2fe27e[_0xaefd('0x2b')](_0x58c008)['json'](_0x810bf);}};}function respondWithFilteredResult(_0x2b3d3d,_0x2a8fa8){return function(_0x521839){if(_0x521839){var _0xbeb1b8=_0x521839[_0xaefd('0x2c')],_0x114ec0=_0x2a8fa8['offset'],_0x36b6b7=_0x2a8fa8[_0xaefd('0x2d')]+_0x2a8fa8['limit'],_0x4c0898;if(_0x36b6b7>=_0xbeb1b8){_0x36b6b7=_0xbeb1b8;_0x4c0898=0xc8;}else{_0x4c0898=0xce;}_0x2b3d3d['status'](_0x4c0898);return _0x2b3d3d[_0xaefd('0x2e')](_0xaefd('0x2f'),_0x114ec0+'-'+_0x36b6b7+'/'+_0xbeb1b8)['json'](_0x521839);}return null;};}function patchUpdates(_0x578378){return function(_0x4ee0c1){try{jsonpatch[_0xaefd('0x30')](_0x4ee0c1,_0x578378,!![]);}catch(_0x280eab){return BPromise['reject'](_0x280eab);}return _0x4ee0c1['save']();};}function saveUpdates(_0x62ef86,_0x465d99){return function(_0x3f4947){if(_0x3f4947){return _0x3f4947[_0xaefd('0x31')](_0x62ef86)['then'](function(_0x3ff5b2){return _0x3ff5b2;});}return null;};}function removeEntity(_0x36854f,_0x3b11e4){return function(_0xad59fc){if(_0xad59fc){return _0xad59fc[_0xaefd('0x32')]()[_0xaefd('0x33')](function(){_0x36854f[_0xaefd('0x2b')](0xcc)[_0xaefd('0x34')]();});}};}function handleEntityNotFound(_0x3e3fe2,_0x234780){return function(_0x3744a5){if(!_0x3744a5){_0x3e3fe2[_0xaefd('0x2a')](0x194);}return _0x3744a5;};}function handleError(_0x304d34,_0x26a6bd){_0x26a6bd=_0x26a6bd||0x1f4;return function(_0x1ffec4){logger[_0xaefd('0x25')](_0x1ffec4['stack']);if(_0x1ffec4[_0xaefd('0x35')]){delete _0x1ffec4[_0xaefd('0x35')];}_0x304d34[_0xaefd('0x2b')](_0x26a6bd)['send'](_0x1ffec4);};}exports[_0xaefd('0x36')]=function(_0x577389,_0x187e76){var _0x3498d9={},_0x99a883={},_0xbbbf6d={'count':0x0,'rows':[]};var _0x2c0d72=_[_0xaefd('0x37')](db[_0xaefd('0x38')][_0xaefd('0x39')],function(_0x407bea){return{'name':_0x407bea[_0xaefd('0x3a')],'type':_0x407bea[_0xaefd('0x3b')][_0xaefd('0x3c')]};});_0x99a883[_0xaefd('0x3d')]=_[_0xaefd('0x37')](_0x2c0d72,'name');_0x99a883[_0xaefd('0x3e')]=_['keys'](_0x577389[_0xaefd('0x3e')]);_0x99a883[_0xaefd('0x3f')]=_[_0xaefd('0x40')](_0x99a883[_0xaefd('0x3d')],_0x99a883[_0xaefd('0x3e')]);_0x3498d9[_0xaefd('0x41')]=_[_0xaefd('0x40')](_0x99a883[_0xaefd('0x3d')],qs[_0xaefd('0x42')](_0x577389[_0xaefd('0x3e')]['fields']));_0x3498d9[_0xaefd('0x41')]=_0x3498d9[_0xaefd('0x41')]['length']?_0x3498d9[_0xaefd('0x41')]:_0x99a883[_0xaefd('0x3d')];if(!_0x577389[_0xaefd('0x3e')]['hasOwnProperty']('nolimit')){_0x3498d9[_0xaefd('0x43')]=qs[_0xaefd('0x43')](_0x577389[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x3498d9[_0xaefd('0x2d')]=qs[_0xaefd('0x2d')](_0x577389[_0xaefd('0x3e')][_0xaefd('0x2d')]);}_0x3498d9['order']=qs[_0xaefd('0x44')](_0x577389[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x3498d9[_0xaefd('0x45')]=qs[_0xaefd('0x3f')](_[_0xaefd('0x46')](_0x577389[_0xaefd('0x3e')],_0x99a883[_0xaefd('0x3f')]),_0x2c0d72);if(_0x577389['query']['filter']){_0x3498d9[_0xaefd('0x45')]=_[_0xaefd('0x47')](_0x3498d9['where'],{'$or':_['map'](_0x2c0d72,function(_0x17d611){if(_0x17d611[_0xaefd('0x3b')]!==_0xaefd('0x48')){var _0x1ba03a={};_0x1ba03a[_0x17d611[_0xaefd('0x35')]]={'$like':'%'+_0x577389[_0xaefd('0x3e')][_0xaefd('0x49')]+'%'};return _0x1ba03a;}})});}_0x3498d9=_[_0xaefd('0x47')]({},_0x3498d9,_0x577389[_0xaefd('0x4a')]);var _0x558a75={'where':_0x3498d9[_0xaefd('0x45')]};return db[_0xaefd('0x38')][_0xaefd('0x2c')](_0x558a75)[_0xaefd('0x33')](function(_0x224613){_0xbbbf6d[_0xaefd('0x2c')]=_0x224613;if(_0x577389[_0xaefd('0x3e')]['includeAll']){_0x3498d9[_0xaefd('0x4b')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xaefd('0x4c')](_0x3498d9);})[_0xaefd('0x33')](function(_0x16c664){_0xbbbf6d[_0xaefd('0x4d')]=_0x16c664;return _0xbbbf6d;})['then'](respondWithFilteredResult(_0x187e76,_0x3498d9))['catch'](handleError(_0x187e76,null));};exports[_0xaefd('0x4e')]=function(_0x34839e,_0x179b8b){var _0x4eeb56={'raw':![],'where':{'id':_0x34839e[_0xaefd('0x4f')]['id']}},_0x2a836a={};_0x2a836a['model']=_[_0xaefd('0x50')](db[_0xaefd('0x38')][_0xaefd('0x39')]);_0x2a836a[_0xaefd('0x3e')]=_[_0xaefd('0x50')](_0x34839e[_0xaefd('0x3e')]);_0x2a836a[_0xaefd('0x3f')]=_[_0xaefd('0x40')](_0x2a836a['model'],_0x2a836a['query']);_0x4eeb56[_0xaefd('0x41')]=_[_0xaefd('0x40')](_0x2a836a['model'],qs[_0xaefd('0x42')](_0x34839e['query'][_0xaefd('0x42')]));_0x4eeb56[_0xaefd('0x41')]=_0x4eeb56[_0xaefd('0x41')][_0xaefd('0x51')]?_0x4eeb56[_0xaefd('0x41')]:_0x2a836a[_0xaefd('0x3d')];if(_0x34839e['query']['includeAll']){_0x4eeb56[_0xaefd('0x4b')]=[{'all':!![]}];}_0x4eeb56=_[_0xaefd('0x47')]({},_0x4eeb56,_0x34839e['options']);return db[_0xaefd('0x38')][_0xaefd('0x52')](_0x4eeb56)[_0xaefd('0x33')](handleEntityNotFound(_0x179b8b,null))[_0xaefd('0x33')](respondWithResult(_0x179b8b,null))['catch'](handleError(_0x179b8b,null));};exports['create']=function(_0x2b0d8e,_0x41ef40){return db[_0xaefd('0x38')][_0xaefd('0x53')](_0x2b0d8e[_0xaefd('0x54')],{})['then'](respondWithResult(_0x41ef40,0xc9))[_0xaefd('0x29')](handleError(_0x41ef40,null));};exports[_0xaefd('0x31')]=function(_0x5a54fb,_0xbeca29){if(_0x5a54fb[_0xaefd('0x54')]['id']){delete _0x5a54fb['body']['id'];}return db[_0xaefd('0x38')][_0xaefd('0x52')]({'where':{'id':_0x5a54fb[_0xaefd('0x4f')]['id']}})['then'](handleEntityNotFound(_0xbeca29,null))[_0xaefd('0x33')](saveUpdates(_0x5a54fb[_0xaefd('0x54')],null))['then'](respondWithResult(_0xbeca29,null))[_0xaefd('0x29')](handleError(_0xbeca29,null));};exports[_0xaefd('0x32')]=function(_0x14b472,_0x2dd1ee){return db['ServicenowConfiguration']['find']({'where':{'id':_0x14b472[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0x2dd1ee,null))[_0xaefd('0x33')](removeEntity(_0x2dd1ee,null))[_0xaefd('0x29')](handleError(_0x2dd1ee,null));};exports[_0xaefd('0x55')]=function(_0x8ab9e7,_0x314660,_0x368fd3){var _0x1e519e={};var _0x133c4f={};var _0x48636d;var _0x4fc1f9;return db[_0xaefd('0x38')][_0xaefd('0x56')]({'where':{'id':_0x8ab9e7[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0x314660,null))['then'](function(_0x13309e){if(_0x13309e){_0x48636d=_0x13309e;_0x133c4f[_0xaefd('0x3d')]=_[_0xaefd('0x50')](db[_0xaefd('0x57')][_0xaefd('0x39')]);_0x133c4f[_0xaefd('0x3e')]=_[_0xaefd('0x50')](_0x8ab9e7[_0xaefd('0x3e')]);_0x133c4f['filters']=_[_0xaefd('0x40')](_0x133c4f[_0xaefd('0x3d')],_0x133c4f[_0xaefd('0x3e')]);_0x1e519e[_0xaefd('0x41')]=_['intersection'](_0x133c4f[_0xaefd('0x3d')],qs['fields'](_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x42')]));_0x1e519e['attributes']=_0x1e519e['attributes'][_0xaefd('0x51')]?_0x1e519e['attributes']:_0x133c4f['model'];_0x1e519e['order']=qs[_0xaefd('0x44')](_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x1e519e[_0xaefd('0x45')]=qs[_0xaefd('0x3f')](_[_0xaefd('0x46')](_0x8ab9e7['query'],_0x133c4f['filters']));if(_0x8ab9e7['query']['filter']){_0x1e519e[_0xaefd('0x45')]=_['merge'](_0x1e519e[_0xaefd('0x45')],{'$or':_['map'](_0x1e519e[_0xaefd('0x41')],function(_0x32dc0d){var _0x416241={};_0x416241[_0x32dc0d]={'$like':'%'+_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x49')]+'%'};return _0x416241;})});}_0x1e519e=_[_0xaefd('0x47')]({},_0x1e519e,_0x8ab9e7[_0xaefd('0x4a')]);return _0x48636d['getFields'](_0x1e519e);}})[_0xaefd('0x33')](function(_0x4113e4){if(_0x4113e4){_0x4fc1f9=_0x4113e4[_0xaefd('0x51')];if(!_0x8ab9e7[_0xaefd('0x3e')]['hasOwnProperty'](_0xaefd('0x58'))){_0x1e519e['limit']=qs[_0xaefd('0x43')](_0x8ab9e7[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x1e519e[_0xaefd('0x2d')]=qs[_0xaefd('0x2d')](_0x8ab9e7[_0xaefd('0x3e')]['offset']);}return _0x48636d[_0xaefd('0x55')](_0x1e519e);}})[_0xaefd('0x33')](function(_0x4a9fa5){if(_0x4a9fa5){return _0x4a9fa5?{'count':_0x4fc1f9,'rows':_0x4a9fa5}:null;}})[_0xaefd('0x33')](respondWithResult(_0x314660,null))[_0xaefd('0x29')](handleError(_0x314660,null));};exports['getSubjects']=function(_0x3a2b63,_0x2a472f,_0x4247d9){var _0x46a793={};var _0x2c4ba7={};var _0x406c6d;var _0x2d8283;return db[_0xaefd('0x38')][_0xaefd('0x56')]({'where':{'id':_0x3a2b63[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0x2a472f,null))[_0xaefd('0x33')](function(_0x11a068){if(_0x11a068){_0x406c6d=_0x11a068;_0x2c4ba7[_0xaefd('0x3d')]=_[_0xaefd('0x50')](db[_0xaefd('0x57')][_0xaefd('0x39')]);_0x2c4ba7['query']=_[_0xaefd('0x50')](_0x3a2b63[_0xaefd('0x3e')]);_0x2c4ba7[_0xaefd('0x3f')]=_['intersection'](_0x2c4ba7[_0xaefd('0x3d')],_0x2c4ba7[_0xaefd('0x3e')]);_0x46a793[_0xaefd('0x41')]=_[_0xaefd('0x40')](_0x2c4ba7['model'],qs[_0xaefd('0x42')](_0x3a2b63['query'][_0xaefd('0x42')]));_0x46a793['attributes']=_0x46a793[_0xaefd('0x41')][_0xaefd('0x51')]?_0x46a793[_0xaefd('0x41')]:_0x2c4ba7['model'];_0x46a793['order']=qs[_0xaefd('0x44')](_0x3a2b63[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x46a793[_0xaefd('0x45')]=qs[_0xaefd('0x3f')](_[_0xaefd('0x46')](_0x3a2b63['query'],_0x2c4ba7['filters']));if(_0x3a2b63['query']['filter']){_0x46a793['where']=_[_0xaefd('0x47')](_0x46a793[_0xaefd('0x45')],{'$or':_[_0xaefd('0x37')](_0x46a793[_0xaefd('0x41')],function(_0x5ae635){var _0x3ae6ba={};_0x3ae6ba[_0x5ae635]={'$like':'%'+_0x3a2b63[_0xaefd('0x3e')]['filter']+'%'};return _0x3ae6ba;})});}_0x46a793=_[_0xaefd('0x47')]({},_0x46a793,_0x3a2b63['options']);return _0x406c6d[_0xaefd('0x59')](_0x46a793);}})['then'](function(_0x21d44b){if(_0x21d44b){_0x2d8283=_0x21d44b['length'];if(!_0x3a2b63[_0xaefd('0x3e')]['hasOwnProperty'](_0xaefd('0x58'))){_0x46a793[_0xaefd('0x43')]=qs['limit'](_0x3a2b63[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x46a793[_0xaefd('0x2d')]=qs['offset'](_0x3a2b63[_0xaefd('0x3e')][_0xaefd('0x2d')]);}return _0x406c6d[_0xaefd('0x59')](_0x46a793);}})[_0xaefd('0x33')](function(_0x23115d){if(_0x23115d){return _0x23115d?{'count':_0x2d8283,'rows':_0x23115d}:null;}})['then'](respondWithResult(_0x2a472f,null))[_0xaefd('0x29')](handleError(_0x2a472f,null));};exports[_0xaefd('0x5a')]=function(_0x4ebd3e,_0xdacfe3,_0x1a80ee){var _0x1298e4={};var _0x299868={};var _0x5e3743;var _0x2a62ac;return db['ServicenowConfiguration'][_0xaefd('0x56')]({'where':{'id':_0x4ebd3e[_0xaefd('0x4f')]['id']}})[_0xaefd('0x33')](handleEntityNotFound(_0xdacfe3,null))['then'](function(_0xa53ec){if(_0xa53ec){_0x5e3743=_0xa53ec;_0x299868[_0xaefd('0x3d')]=_[_0xaefd('0x50')](db['ServicenowField'][_0xaefd('0x39')]);_0x299868[_0xaefd('0x3e')]=_[_0xaefd('0x50')](_0x4ebd3e[_0xaefd('0x3e')]);_0x299868['filters']=_[_0xaefd('0x40')](_0x299868[_0xaefd('0x3d')],_0x299868[_0xaefd('0x3e')]);_0x1298e4[_0xaefd('0x41')]=_['intersection'](_0x299868[_0xaefd('0x3d')],qs[_0xaefd('0x42')](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x42')]));_0x1298e4['attributes']=_0x1298e4[_0xaefd('0x41')]['length']?_0x1298e4[_0xaefd('0x41')]:_0x299868['model'];_0x1298e4[_0xaefd('0x5b')]=qs[_0xaefd('0x44')](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x44')]);_0x1298e4[_0xaefd('0x45')]=qs['filters'](_[_0xaefd('0x46')](_0x4ebd3e['query'],_0x299868[_0xaefd('0x3f')]));if(_0x4ebd3e['query'][_0xaefd('0x49')]){_0x1298e4[_0xaefd('0x45')]=_[_0xaefd('0x47')](_0x1298e4['where'],{'$or':_[_0xaefd('0x37')](_0x1298e4['attributes'],function(_0xdb53cf){var _0x4310b1={};_0x4310b1[_0xdb53cf]={'$like':'%'+_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x49')]+'%'};return _0x4310b1;})});}_0x1298e4=_['merge']({},_0x1298e4,_0x4ebd3e[_0xaefd('0x4a')]);return _0x5e3743[_0xaefd('0x5a')](_0x1298e4);}})[_0xaefd('0x33')](function(_0x407c6a){if(_0x407c6a){_0x2a62ac=_0x407c6a[_0xaefd('0x51')];if(!_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x5c')](_0xaefd('0x58'))){_0x1298e4[_0xaefd('0x43')]=qs['limit'](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x43')]);_0x1298e4[_0xaefd('0x2d')]=qs[_0xaefd('0x2d')](_0x4ebd3e[_0xaefd('0x3e')][_0xaefd('0x2d')]);}return _0x5e3743[_0xaefd('0x5a')](_0x1298e4);}})[_0xaefd('0x33')](function(_0x190170){if(_0x190170){return _0x190170?{'count':_0x2a62ac,'rows':_0x190170}:null;}})[_0xaefd('0x33')](respondWithResult(_0xdacfe3,null))[_0xaefd('0x29')](handleError(_0xdacfe3,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index b76dd0e..e46dbba 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 _0x637e=['bluebird','request-promise','path','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','util','../../config/logger','api','moment'];(function(_0x8ae49d,_0x4a02c7){var _0x423bb4=function(_0x4df2dc){while(--_0x4df2dc){_0x8ae49d['push'](_0x8ae49d['shift']());}};_0x423bb4(++_0x4a02c7);}(_0x637e,0x158));var _0xe637=function(_0x4a4193,_0x4e3497){_0x4a4193=_0x4a4193-0x0;var _0x1e46a2=_0x637e[_0x4a4193];return _0x1e46a2;};'use strict';var _=require('lodash');var util=require(_0xe637('0x0'));var logger=require(_0xe637('0x1'))(_0xe637('0x2'));var moment=require(_0xe637('0x3'));var BPromise=require(_0xe637('0x4'));var rp=require(_0xe637('0x5'));var fs=require('fs');var path=require(_0xe637('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe637('0x7'));module[_0xe637('0x8')]=function(_0x92309e,_0x331ff1){return _0x92309e[_0xe637('0x9')](_0xe637('0xa'),attributes,{'tableName':_0xe637('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b12=['int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','ServicenowConfiguration'];(function(_0x10e326,_0xf72960){var _0x2f2fa4=function(_0x5215f6){while(--_0x5215f6){_0x10e326['push'](_0x10e326['shift']());}};_0x2f2fa4(++_0xf72960);}(_0x5b12,0xa3));var _0x25b1=function(_0x389a15,_0x1312b5){_0x389a15=_0x389a15-0x0;var _0x218517=_0x5b12[_0x389a15];return _0x218517;};'use strict';var _=require(_0x25b1('0x0'));var util=require(_0x25b1('0x1'));var logger=require(_0x25b1('0x2'))('api');var moment=require(_0x25b1('0x3'));var BPromise=require('bluebird');var rp=require(_0x25b1('0x4'));var fs=require('fs');var path=require(_0x25b1('0x5'));var rimraf=require('rimraf');var config=require(_0x25b1('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x35d90b,_0x5523c9){return _0x35d90b['define'](_0x25b1('0x7'),attributes,{'tableName':_0x25b1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 1621766..6d8d8ca 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 _0xdcae=['rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x56d443,_0x391396){var _0x317405=function(_0x5970e6){while(--_0x5970e6){_0x56d443['push'](_0x56d443['shift']());}};_0x317405(++_0x391396);}(_0xdcae,0x10c));var _0xedca=function(_0x5f52e4,_0x5a69b3){_0x5f52e4=_0x5f52e4-0x0;var _0x25148b=_0xdcae[_0x5f52e4];return _0x25148b;};'use strict';var _=require('lodash');var util=require(_0xedca('0x0'));var moment=require(_0xedca('0x1'));var BPromise=require(_0xedca('0x2'));var rs=require(_0xedca('0x3'));var fs=require('fs');var Redis=require(_0xedca('0x4'));var db=require(_0xedca('0x5'))['db'];var utils=require(_0xedca('0x6'));var logger=require(_0xedca('0x7'))(_0xedca('0x8'));var config=require(_0xedca('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xedca('0xa')][_0xedca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb26c9d,_0x4e0853,_0x506726){return new BPromise(function(_0x3682fc,_0x131018){return client[_0xedca('0xc')](_0xb26c9d,_0x506726)[_0xedca('0xd')](function(_0x1141e2){logger[_0xedca('0xe')](_0xedca('0xf'),_0x4e0853,_0xedca('0x10'));logger[_0xedca('0x11')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x4e0853,'request\x20sent',JSON[_0xedca('0x12')](_0x1141e2));if(_0x1141e2[_0xedca('0x13')]){if(_0x1141e2[_0xedca('0x13')][_0xedca('0x14')]===0x1f4){logger['error'](_0xedca('0xf'),_0x4e0853,_0x1141e2[_0xedca('0x13')][_0xedca('0x15')]);return _0x131018(_0x1141e2[_0xedca('0x13')]['message']);}logger['error'](_0xedca('0xf'),_0x4e0853,_0x1141e2[_0xedca('0x13')]['message']);return _0x3682fc(_0x1141e2[_0xedca('0x13')]['message']);}else{logger[_0xedca('0xe')](_0xedca('0xf'),_0x4e0853,_0xedca('0x10'));_0x3682fc(_0x1141e2[_0xedca('0x16')][_0xedca('0x15')]);}})['catch'](function(_0x5c2b0d){logger[_0xedca('0x13')](_0xedca('0xf'),_0x4e0853,_0x5c2b0d);_0x131018(_0x5c2b0d);});});} \ No newline at end of file +var _0xdd1c=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4f42c5,_0x33b0af){var _0x4f9764=function(_0x547ed8){while(--_0x547ed8){_0x4f42c5['push'](_0x4f42c5['shift']());}};_0x4f9764(++_0x33b0af);}(_0xdd1c,0xda));var _0xcdd1=function(_0x4cefbc,_0x3ffa6c){_0x4cefbc=_0x4cefbc-0x0;var _0x423c86=_0xdd1c[_0x4cefbc];return _0x423c86;};'use strict';var _=require(_0xcdd1('0x0'));var util=require(_0xcdd1('0x1'));var moment=require(_0xcdd1('0x2'));var BPromise=require(_0xcdd1('0x3'));var rs=require(_0xcdd1('0x4'));var fs=require('fs');var Redis=require(_0xcdd1('0x5'));var db=require(_0xcdd1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdd1('0x7'))(_0xcdd1('0x8'));var config=require(_0xcdd1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcdd1('0xa')][_0xcdd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17645a,_0x31efd4,_0x4c287b){return new BPromise(function(_0x241d64,_0x515254){return client[_0xcdd1('0xc')](_0x17645a,_0x4c287b)[_0xcdd1('0xd')](function(_0xa9a090){logger[_0xcdd1('0xe')](_0xcdd1('0xf'),_0x31efd4,_0xcdd1('0x10'));logger[_0xcdd1('0x11')](_0xcdd1('0x12'),_0x31efd4,_0xcdd1('0x10'),JSON[_0xcdd1('0x13')](_0xa9a090));if(_0xa9a090[_0xcdd1('0x14')]){if(_0xa9a090[_0xcdd1('0x14')][_0xcdd1('0x15')]===0x1f4){logger[_0xcdd1('0x14')](_0xcdd1('0xf'),_0x31efd4,_0xa9a090[_0xcdd1('0x14')][_0xcdd1('0x16')]);return _0x515254(_0xa9a090[_0xcdd1('0x14')][_0xcdd1('0x16')]);}logger[_0xcdd1('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x31efd4,_0xa9a090[_0xcdd1('0x14')][_0xcdd1('0x16')]);return _0x241d64(_0xa9a090['error']['message']);}else{logger[_0xcdd1('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x31efd4,_0xcdd1('0x10'));_0x241d64(_0xa9a090['result'][_0xcdd1('0x16')]);}})[_0xcdd1('0x17')](function(_0xa0d4d8){logger[_0xcdd1('0x14')](_0xcdd1('0xf'),_0x31efd4,_0xa0d4d8);_0x515254(_0xa0d4d8);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index ad4f5bf..b885de2 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 _0x1ba9=['post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x2cfce4,_0x19e9b3){var _0x32c9ce=function(_0x485f15){while(--_0x485f15){_0x2cfce4['push'](_0x2cfce4['shift']());}};_0x32c9ce(++_0x19e9b3);}(_0x1ba9,0xf5));var _0x91ba=function(_0x24dcd4,_0xf849b7){_0x24dcd4=_0x24dcd4-0x0;var _0x54ec84=_0x1ba9[_0x24dcd4];return _0x54ec84;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x91ba('0x0'));var timeout=require(_0x91ba('0x1'));var express=require(_0x91ba('0x2'));var router=express[_0x91ba('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x91ba('0x4'));var config=require(_0x91ba('0x5'));var controller=require('./intServicenowField.controller');router[_0x91ba('0x6')]('/',auth[_0x91ba('0x7')](),controller[_0x91ba('0x8')]);router['get'](_0x91ba('0x9'),auth[_0x91ba('0x7')](),controller['show']);router[_0x91ba('0xa')]('/',auth[_0x91ba('0x7')](),controller[_0x91ba('0xb')]);router[_0x91ba('0xc')]('/:id',auth[_0x91ba('0x7')](),controller[_0x91ba('0xd')]);router[_0x91ba('0xe')](_0x91ba('0x9'),auth[_0x91ba('0x7')](),controller[_0x91ba('0xf')]);module[_0x91ba('0x10')]=router; \ No newline at end of file +var _0x2288=['create','put','update','multer','path','connect-timeout','express','Router','../../config/environment','isAuthenticated','index','get','/:id','show','post'];(function(_0x2445d8,_0x22e09b){var _0x3e6299=function(_0x37eae3){while(--_0x37eae3){_0x2445d8['push'](_0x2445d8['shift']());}};_0x3e6299(++_0x22e09b);}(_0x2288,0x6c));var _0x8228=function(_0x15703b,_0x392f5d){_0x15703b=_0x15703b-0x0;var _0x487395=_0x2288[_0x15703b];return _0x487395;};'use strict';var multer=require(_0x8228('0x0'));var util=require('util');var path=require(_0x8228('0x1'));var timeout=require(_0x8228('0x2'));var express=require(_0x8228('0x3'));var router=express[_0x8228('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8228('0x5'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x8228('0x6')](),controller[_0x8228('0x7')]);router[_0x8228('0x8')](_0x8228('0x9'),auth['isAuthenticated'](),controller[_0x8228('0xa')]);router[_0x8228('0xb')]('/',auth[_0x8228('0x6')](),controller[_0x8228('0xc')]);router[_0x8228('0xd')](_0x8228('0x9'),auth[_0x8228('0x6')](),controller[_0x8228('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index c7963d3..fb7692b 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 _0x87c6=['ENUM','BOOLEAN','sequelize','variable','customVariable','string','STRING'];(function(_0x24431a,_0x52459a){var _0x454ec7=function(_0x34cd60){while(--_0x34cd60){_0x24431a['push'](_0x24431a['shift']());}};_0x454ec7(++_0x52459a);}(_0x87c6,0x87));var _0x687c=function(_0x5d0429,_0x4b4b7b){_0x5d0429=_0x5d0429-0x0;var _0x26065e=_0x87c6[_0x5d0429];return _0x26065e;};'use strict';var Sequelize=require(_0x687c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x687c('0x1'),_0x687c('0x2'),'keyValue'),'defaultValue':_0x687c('0x3')},'content':{'type':Sequelize[_0x687c('0x4')]},'key':{'type':Sequelize[_0x687c('0x4')]},'keyType':{'type':Sequelize[_0x687c('0x5')](_0x687c('0x3'),'variable',_0x687c('0x2'))},'keyContent':{'type':Sequelize[_0x687c('0x4')]},'idField':{'type':Sequelize[_0x687c('0x4')]},'nameField':{'type':Sequelize[_0x687c('0x4')]},'customField':{'type':Sequelize[_0x687c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x687c('0x4')]}}; \ No newline at end of file +var _0xe51b=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2bb24b,_0x421886){var _0x24ac0f=function(_0x2386f3){while(--_0x2386f3){_0x2bb24b['push'](_0x2bb24b['shift']());}};_0x24ac0f(++_0x421886);}(_0xe51b,0x177));var _0xbe51=function(_0x3f36f2,_0x380621){_0x3f36f2=_0x3f36f2-0x0;var _0x15821b=_0xe51b[_0x3f36f2];return _0x15821b;};'use strict';var Sequelize=require(_0xbe51('0x0'));module[_0xbe51('0x1')]={'type':{'type':Sequelize[_0xbe51('0x2')](_0xbe51('0x3'),_0xbe51('0x4'),_0xbe51('0x5'),_0xbe51('0x6')),'defaultValue':_0xbe51('0x3')},'content':{'type':Sequelize[_0xbe51('0x7')]},'key':{'type':Sequelize[_0xbe51('0x7')]},'keyType':{'type':Sequelize[_0xbe51('0x2')](_0xbe51('0x3'),'variable',_0xbe51('0x5'))},'keyContent':{'type':Sequelize[_0xbe51('0x7')]},'idField':{'type':Sequelize[_0xbe51('0x7')]},'nameField':{'type':Sequelize[_0xbe51('0x7')]},'customField':{'type':Sequelize[_0xbe51('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbe51('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 28deb4e..9fc839b 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(_0x430255,_0x49dbad){var _0x1aafe9=function(_0x4a20b1){while(--_0x4a20b1){_0x430255['push'](_0x430255['shift']());}};_0x1aafe9(++_0x49dbad);}(_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','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x47f785,_0x1d1a9e){var _0x3e8b44=function(_0x757060){while(--_0x757060){_0x47f785['push'](_0x47f785['shift']());}};_0x3e8b44(++_0x1d1a9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 af6a1e5..8927df3 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 _0x5d7c=['FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','define','servicenow_unique_index','idField'];(function(_0x2efe4f,_0x35b3d9){var _0x251e7e=function(_0x56be52){while(--_0x56be52){_0x2efe4f['push'](_0x2efe4f['shift']());}};_0x251e7e(++_0x35b3d9);}(_0x5d7c,0xb5));var _0xc5d7=function(_0x6dc163,_0x4c8603){_0x6dc163=_0x6dc163-0x0;var _0x7c1385=_0x5d7c[_0x6dc163];return _0x7c1385;};'use strict';var _=require(_0xc5d7('0x0'));var util=require(_0xc5d7('0x1'));var logger=require(_0xc5d7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc5d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5d7('0x4'));var rimraf=require(_0xc5d7('0x5'));var config=require(_0xc5d7('0x6'));var attributes=require(_0xc5d7('0x7'));module['exports']=function(_0x49ee20,_0x5db116){return _0x49ee20[_0xc5d7('0x8')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc5d7('0x9'),'fields':[_0xc5d7('0xa'),_0xc5d7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8122=['request-promise','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x431c7c,_0x5170e8){var _0x3d548a=function(_0x33d2d9){while(--_0x33d2d9){_0x431c7c['push'](_0x431c7c['shift']());}};_0x3d548a(++_0x5170e8);}(_0x8122,0x16a));var _0x2812=function(_0x7d9f57,_0x5eed70){_0x7d9f57=_0x7d9f57-0x0;var _0x3db58f=_0x8122[_0x7d9f57];return _0x3db58f;};'use strict';var _=require(_0x2812('0x0'));var util=require(_0x2812('0x1'));var logger=require(_0x2812('0x2'))(_0x2812('0x3'));var moment=require(_0x2812('0x4'));var BPromise=require(_0x2812('0x5'));var rp=require(_0x2812('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2812('0x7'));var config=require(_0x2812('0x8'));var attributes=require(_0x2812('0x9'));module['exports']=function(_0x5ab69c,_0xd6cad6){return _0x5ab69c[_0x2812('0xa')](_0x2812('0xb'),attributes,{'tableName':_0x2812('0xc'),'paranoid':![],'indexes':[{'name':_0x2812('0xd'),'fields':[_0x2812('0xe'),_0x2812('0xf')],'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 be779ff..c6f1344 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 _0x4291=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x12b298,_0x36e4c3){var _0x3ad431=function(_0x2c063e){while(--_0x2c063e){_0x12b298['push'](_0x12b298['shift']());}};_0x3ad431(++_0x36e4c3);}(_0x4291,0x164));var _0x1429=function(_0x25530e,_0x2e7c06){_0x25530e=_0x25530e-0x0;var _0x5a4c04=_0x4291[_0x25530e];return _0x5a4c04;};'use strict';var _=require(_0x1429('0x0'));var util=require(_0x1429('0x1'));var moment=require(_0x1429('0x2'));var BPromise=require(_0x1429('0x3'));var rs=require(_0x1429('0x4'));var fs=require('fs');var Redis=require(_0x1429('0x5'));var db=require(_0x1429('0x6'))['db'];var utils=require(_0x1429('0x7'));var logger=require(_0x1429('0x8'))('rpc');var config=require(_0x1429('0x9'));var jayson=require(_0x1429('0xa'));var client=jayson[_0x1429('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fb581,_0x3a6203,_0xc46961){return new BPromise(function(_0x59e3d9,_0x250b47){return client[_0x1429('0xc')](_0x3fb581,_0xc46961)[_0x1429('0xd')](function(_0x8cf4b8){logger[_0x1429('0xe')](_0x1429('0xf'),_0x3a6203,_0x1429('0x10'));logger['debug'](_0x1429('0x11'),_0x3a6203,_0x1429('0x10'),JSON[_0x1429('0x12')](_0x8cf4b8));if(_0x8cf4b8[_0x1429('0x13')]){if(_0x8cf4b8[_0x1429('0x13')][_0x1429('0x14')]===0x1f4){logger['error'](_0x1429('0xf'),_0x3a6203,_0x8cf4b8['error']['message']);return _0x250b47(_0x8cf4b8[_0x1429('0x13')][_0x1429('0x15')]);}logger[_0x1429('0x13')](_0x1429('0xf'),_0x3a6203,_0x8cf4b8[_0x1429('0x13')][_0x1429('0x15')]);return _0x59e3d9(_0x8cf4b8[_0x1429('0x13')][_0x1429('0x15')]);}else{logger['info'](_0x1429('0xf'),_0x3a6203,'request\x20sent');_0x59e3d9(_0x8cf4b8[_0x1429('0x16')]['message']);}})[_0x1429('0x17')](function(_0x50c3d9){logger[_0x1429('0x13')](_0x1429('0xf'),_0x3a6203,_0x50c3d9);_0x250b47(_0x50c3d9);});});} \ No newline at end of file +var _0x9655=['catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x16b561,_0x5a914f){var _0x22599f=function(_0x27ce85){while(--_0x27ce85){_0x16b561['push'](_0x16b561['shift']());}};_0x22599f(++_0x5a914f);}(_0x9655,0x151));var _0x5965=function(_0x1c6594,_0x6f51e5){_0x1c6594=_0x1c6594-0x0;var _0x414bce=_0x9655[_0x1c6594];return _0x414bce;};'use strict';var _=require('lodash');var util=require(_0x5965('0x0'));var moment=require(_0x5965('0x1'));var BPromise=require('bluebird');var rs=require(_0x5965('0x2'));var fs=require('fs');var Redis=require(_0x5965('0x3'));var db=require(_0x5965('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5965('0x5'))('rpc');var config=require(_0x5965('0x6'));var jayson=require(_0x5965('0x7'));var client=jayson[_0x5965('0x8')][_0x5965('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126257,_0x1640e6,_0x54502a){return new BPromise(function(_0x219e2,_0x303d9d){return client['request'](_0x126257,_0x54502a)['then'](function(_0x46bbb4){logger['info'](_0x5965('0xa'),_0x1640e6,'request\x20sent');logger[_0x5965('0xb')](_0x5965('0xc'),_0x1640e6,_0x5965('0xd'),JSON[_0x5965('0xe')](_0x46bbb4));if(_0x46bbb4[_0x5965('0xf')]){if(_0x46bbb4[_0x5965('0xf')][_0x5965('0x10')]===0x1f4){logger[_0x5965('0xf')](_0x5965('0xa'),_0x1640e6,_0x46bbb4[_0x5965('0xf')][_0x5965('0x11')]);return _0x303d9d(_0x46bbb4[_0x5965('0xf')][_0x5965('0x11')]);}logger[_0x5965('0xf')](_0x5965('0xa'),_0x1640e6,_0x46bbb4[_0x5965('0xf')][_0x5965('0x11')]);return _0x219e2(_0x46bbb4['error'][_0x5965('0x11')]);}else{logger[_0x5965('0x12')](_0x5965('0xa'),_0x1640e6,_0x5965('0xd'));_0x219e2(_0x46bbb4[_0x5965('0x13')][_0x5965('0x11')]);}})[_0x5965('0x14')](function(_0x1e68be){logger[_0x5965('0xf')](_0x5965('0xa'),_0x1640e6,_0x1e68be);_0x303d9d(_0x1e68be);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 526b260..04938a7 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 _0x3a57=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','show','getConfigurations'];(function(_0x47baa4,_0x522480){var _0x484801=function(_0x4a1c32){while(--_0x4a1c32){_0x47baa4['push'](_0x47baa4['shift']());}};_0x484801(++_0x522480);}(_0x3a57,0x14d));var _0x73a5=function(_0x45eba6,_0x2409d7){_0x45eba6=_0x45eba6-0x0;var _0x15cb73=_0x3a57[_0x45eba6];return _0x15cb73;};'use strict';var multer=require(_0x73a5('0x0'));var util=require(_0x73a5('0x1'));var path=require(_0x73a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x73a5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x73a5('0x4'));var config=require(_0x73a5('0x5'));var controller=require(_0x73a5('0x6'));router[_0x73a5('0x7')]('/',auth[_0x73a5('0x8')](),controller[_0x73a5('0x9')]);router[_0x73a5('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x73a5('0xa')]);router['get']('/:id/configurations',auth[_0x73a5('0x8')](),controller[_0x73a5('0xb')]);router['get'](_0x73a5('0xc'),auth['isAuthenticated'](),controller[_0x73a5('0xd')]);router[_0x73a5('0xe')]('/',auth[_0x73a5('0x8')](),controller[_0x73a5('0xf')]);router[_0x73a5('0xe')](_0x73a5('0x10'),auth['isAuthenticated'](),controller[_0x73a5('0x11')]);router['put'](_0x73a5('0x12'),auth[_0x73a5('0x8')](),controller[_0x73a5('0x13')]);router[_0x73a5('0x14')](_0x73a5('0x12'),auth[_0x73a5('0x8')](),controller[_0x73a5('0x15')]);module[_0x73a5('0x16')]=router; \ No newline at end of file +var _0x8406=['index','get','/:id','show','/:id/configurations','/:id/fields','getFields','create','put','update','destroy','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','isAuthenticated'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8406,0x174));var _0x6840=function(_0x4dbf2f,_0x164944){_0x4dbf2f=_0x4dbf2f-0x0;var _0x4db0ba=_0x8406[_0x4dbf2f];return _0x4db0ba;};'use strict';var multer=require(_0x6840('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6840('0x1'));var express=require(_0x6840('0x2'));var router=express[_0x6840('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6840('0x4'));var config=require(_0x6840('0x5'));var controller=require(_0x6840('0x6'));router['get']('/',auth[_0x6840('0x7')](),controller[_0x6840('0x8')]);router[_0x6840('0x9')](_0x6840('0xa'),auth[_0x6840('0x7')](),controller[_0x6840('0xb')]);router['get'](_0x6840('0xc'),auth[_0x6840('0x7')](),controller['getConfigurations']);router[_0x6840('0x9')](_0x6840('0xd'),auth[_0x6840('0x7')](),controller[_0x6840('0xe')]);router['post']('/',auth[_0x6840('0x7')](),controller[_0x6840('0xf')]);router['post'](_0x6840('0xc'),auth[_0x6840('0x7')](),controller['addConfiguration']);router[_0x6840('0x10')](_0x6840('0xa'),auth[_0x6840('0x7')](),controller[_0x6840('0x11')]);router['delete'](_0x6840('0xa'),auth[_0x6840('0x7')](),controller[_0x6840('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 7a231be..c3e6229 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 _0x75ba=['username','remoteUri','sequelize','STRING'];(function(_0x4ab585,_0x299f86){var _0x2fa953=function(_0x30bace){while(--_0x30bace){_0x4ab585['push'](_0x4ab585['shift']());}};_0x2fa953(++_0x299f86);}(_0x75ba,0x1c2));var _0xa75b=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x75ba[_0x149083];return _0x4dc74e;};'use strict';var Sequelize=require(_0xa75b('0x0'));module['exports']={'name':{'type':Sequelize[_0xa75b('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa75b('0x1')],'unique':_0xa75b('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xa75b('0x1')],'unique':_0xa75b('0x3')},'serverUrl':{'type':Sequelize[_0xa75b('0x1')]}}; \ No newline at end of file +var _0x930e=['username','remoteUri','sequelize','exports','STRING'];(function(_0x1c4f74,_0x59549b){var _0x5018bb=function(_0x1c8776){while(--_0x1c8776){_0x1c4f74['push'](_0x1c4f74['shift']());}};_0x5018bb(++_0x59549b);}(_0x930e,0x179));var _0xe930=function(_0x88746b,_0x586f4c){_0x88746b=_0x88746b-0x0;var _0x102160=_0x930e[_0x88746b];return _0x102160;};'use strict';var Sequelize=require(_0xe930('0x0'));module[_0xe930('0x1')]={'name':{'type':Sequelize[_0xe930('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe930('0x2')],'unique':_0xe930('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe930('0x4')},'serverUrl':{'type':Sequelize[_0xe930('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index f1f59ba..fb76fa4 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 _0xf99e=['duration_hours','parent_id','parent_type','parent_name','password','remoteUri','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','username','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../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','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','end','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','SugarcrmAccount','findAll','rows','catch','params','length','includeAll','options','create','body','find','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','assigned_user_id','created_by','description','date_start'];(function(_0x3ae425,_0x5538c0){var _0x12eac1=function(_0x3c92e2){while(--_0x3c92e2){_0x3ae425['push'](_0x3ae425['shift']());}};_0x12eac1(++_0x5538c0);}(_0xf99e,0xa4));var _0xef99=function(_0x5a3f92,_0x23e7df){_0x5a3f92=_0x5a3f92-0x0;var _0x467063=_0xf99e[_0x5a3f92];return _0x467063;};'use strict';var pdf=require(_0xef99('0x0'));var emlformat=require(_0xef99('0x1'));var rimraf=require(_0xef99('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xef99('0x3'));var rp=require(_0xef99('0x4'));var moment=require(_0xef99('0x5'));var BPromise=require(_0xef99('0x6'));var Mustache=require(_0xef99('0x7'));var util=require(_0xef99('0x8'));var path=require(_0xef99('0x9'));var sox=require(_0xef99('0xa'));var csv=require(_0xef99('0xb'));var ejs=require(_0xef99('0xc'));var fs=require('fs');var _=require(_0xef99('0xd'));var squel=require('squel');var crypto=require(_0xef99('0xe'));var jsforce=require(_0xef99('0xf'));var deskjs=require(_0xef99('0x10'));var toCsv=require(_0xef99('0xb'));var querystring=require(_0xef99('0x11'));var Papa=require('papaparse');var Redis=require(_0xef99('0x12'));var authService=require(_0xef99('0x13'));var qs=require(_0xef99('0x14'));var as=require(_0xef99('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xef99('0x16'));var config=require(_0xef99('0x17'));var db=require(_0xef99('0x18'))['db'];var integrations=require(_0xef99('0x19'));var jayson=require(_0xef99('0x1a'));var client=jayson[_0xef99('0x1b')][_0xef99('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x41cd2,_0x439cf8,_0x254cb9){if(_0x254cb9){var _0xe717d3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe717d3[_0xef99('0x1d')](_0x439cf8)){return _0x41cd2;}else{throw new db[(_0xef99('0x1e'))][(_0xef99('0x1f'))](_0xef99('0x20'));}}else{return _0x41cd2;}}function respondWithRpcPromise(_0x32facd,_0x86db0a,_0x20aa18,_0x27528){return new BPromise(function(_0x3f2d55,_0x278cf4){var _0x156d74=_0x27528||client;return _0x156d74[_0xef99('0x21')](_0x32facd,_0x20aa18)[_0xef99('0x22')](function(_0x5fade0){logger[_0xef99('0x23')](_0xef99('0x24'),_0x86db0a,_0xef99('0x25'));logger[_0xef99('0x26')](_0xef99('0x27'),_0x86db0a,_0xef99('0x25'),JSON[_0xef99('0x28')](_0x5fade0));if(_0x5fade0['error']){if(_0x5fade0[_0xef99('0x29')][_0xef99('0x2a')]===0x1f4){logger[_0xef99('0x29')](_0xef99('0x24'),_0x86db0a,_0x5fade0['error'][_0xef99('0x2b')]);return _0x278cf4(_0x5fade0[_0xef99('0x29')][_0xef99('0x2b')]);}logger['error'](_0xef99('0x24'),_0x86db0a,_0x5fade0['error'][_0xef99('0x2b')]);return _0x3f2d55(_0x5fade0['error']['message']);}else{logger[_0xef99('0x23')](_0xef99('0x24'),_0x86db0a,_0xef99('0x25'));_0x3f2d55(_0x5fade0[_0xef99('0x2c')][_0xef99('0x2b')]);}})['catch'](function(_0x36f16a){logger[_0xef99('0x29')](_0xef99('0x24'),_0x86db0a,_0x36f16a);_0x278cf4(_0x36f16a);});});}function respondWithStatusCode(_0x33964d,_0x3b7d68){_0x3b7d68=_0x3b7d68||0xcc;return function(_0x2d8fc1){if(_0x2d8fc1){return _0x33964d[_0xef99('0x2d')](_0x3b7d68);}return _0x33964d[_0xef99('0x2e')](_0x3b7d68)['end']();};}function respondWithResult(_0x507dd8,_0x2a513d){_0x2a513d=_0x2a513d||0xc8;return function(_0x269479){if(_0x269479){return _0x507dd8[_0xef99('0x2e')](_0x2a513d)[_0xef99('0x2f')](_0x269479);}};}function respondWithFilteredResult(_0x344bbd,_0x3496f0){return function(_0xde966a){if(_0xde966a){var _0x352119=_0xde966a[_0xef99('0x30')],_0x1389aa=_0x3496f0['offset'],_0x2e7e80=_0x3496f0[_0xef99('0x31')]+_0x3496f0[_0xef99('0x32')],_0x109ca4;if(_0x2e7e80>=_0x352119){_0x2e7e80=_0x352119;_0x109ca4=0xc8;}else{_0x109ca4=0xce;}_0x344bbd[_0xef99('0x2e')](_0x109ca4);return _0x344bbd[_0xef99('0x33')](_0xef99('0x34'),_0x1389aa+'-'+_0x2e7e80+'/'+_0x352119)[_0xef99('0x2f')](_0xde966a);}return null;};}function patchUpdates(_0xa216e9){return function(_0x4dad07){try{jsonpatch[_0xef99('0x35')](_0x4dad07,_0xa216e9,!![]);}catch(_0x24079d){return BPromise['reject'](_0x24079d);}return _0x4dad07['save']();};}function saveUpdates(_0x12e9ae,_0x59f2f0){return function(_0x58303c){if(_0x58303c){return _0x58303c[_0xef99('0x36')](_0x12e9ae)[_0xef99('0x22')](function(_0x35e8a1){return _0x35e8a1;});}return null;};}function removeEntity(_0x5d2357,_0x5730d2){return function(_0x285245){if(_0x285245){return _0x285245[_0xef99('0x37')]()[_0xef99('0x22')](function(){_0x5d2357['status'](0xcc)[_0xef99('0x38')]();});}};}function handleEntityNotFound(_0x58da3e,_0x2d4695){return function(_0x4b806f){if(!_0x4b806f){_0x58da3e['sendStatus'](0x194);}return _0x4b806f;};}function handleError(_0x3ba0fd,_0x189c2b){_0x189c2b=_0x189c2b||0x1f4;return function(_0x24c5ef){logger[_0xef99('0x29')](_0x24c5ef[_0xef99('0x39')]);if(_0x24c5ef[_0xef99('0x3a')]){delete _0x24c5ef[_0xef99('0x3a')];}_0x3ba0fd[_0xef99('0x2e')](_0x189c2b)[_0xef99('0x3b')](_0x24c5ef);};}exports[_0xef99('0x3c')]=function(_0x41bb69,_0x357ca3){var _0x2e2119={},_0x344ab4={},_0x291553={'count':0x0,'rows':[]};var _0x43b507=_[_0xef99('0x3d')](db['SugarcrmAccount'][_0xef99('0x3e')],function(_0x5b0b8e){return{'name':_0x5b0b8e['fieldName'],'type':_0x5b0b8e[_0xef99('0x3f')][_0xef99('0x40')]};});_0x344ab4[_0xef99('0x41')]=_['map'](_0x43b507,_0xef99('0x3a'));_0x344ab4[_0xef99('0x42')]=_[_0xef99('0x43')](_0x41bb69['query']);_0x344ab4[_0xef99('0x44')]=_[_0xef99('0x45')](_0x344ab4[_0xef99('0x41')],_0x344ab4[_0xef99('0x42')]);_0x2e2119['attributes']=_['intersection'](_0x344ab4['model'],qs[_0xef99('0x46')](_0x41bb69[_0xef99('0x42')][_0xef99('0x46')]));_0x2e2119[_0xef99('0x47')]=_0x2e2119[_0xef99('0x47')]['length']?_0x2e2119[_0xef99('0x47')]:_0x344ab4[_0xef99('0x41')];if(!_0x41bb69[_0xef99('0x42')][_0xef99('0x48')](_0xef99('0x49'))){_0x2e2119[_0xef99('0x32')]=qs[_0xef99('0x32')](_0x41bb69[_0xef99('0x42')][_0xef99('0x32')]);_0x2e2119[_0xef99('0x31')]=qs[_0xef99('0x31')](_0x41bb69['query'][_0xef99('0x31')]);}_0x2e2119[_0xef99('0x4a')]=qs[_0xef99('0x4b')](_0x41bb69[_0xef99('0x42')][_0xef99('0x4b')]);_0x2e2119[_0xef99('0x4c')]=qs[_0xef99('0x44')](_['pick'](_0x41bb69[_0xef99('0x42')],_0x344ab4[_0xef99('0x44')]),_0x43b507);if(_0x41bb69[_0xef99('0x42')][_0xef99('0x4d')]){_0x2e2119['where']=_['merge'](_0x2e2119[_0xef99('0x4c')],{'$or':_[_0xef99('0x3d')](_0x43b507,function(_0x5b1ef5){if(_0x5b1ef5[_0xef99('0x3f')]!==_0xef99('0x4e')){var _0x510543={};_0x510543[_0x5b1ef5['name']]={'$like':'%'+_0x41bb69[_0xef99('0x42')]['filter']+'%'};return _0x510543;}})});}_0x2e2119=_[_0xef99('0x4f')]({},_0x2e2119,_0x41bb69['options']);var _0x391429={'where':_0x2e2119[_0xef99('0x4c')]};return db[_0xef99('0x50')][_0xef99('0x30')](_0x391429)[_0xef99('0x22')](function(_0x3efaa5){_0x291553[_0xef99('0x30')]=_0x3efaa5;if(_0x41bb69[_0xef99('0x42')]['includeAll']){_0x2e2119['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0xef99('0x51')](_0x2e2119);})[_0xef99('0x22')](function(_0x2fa478){_0x291553[_0xef99('0x52')]=_0x2fa478;return _0x291553;})[_0xef99('0x22')](respondWithFilteredResult(_0x357ca3,_0x2e2119))[_0xef99('0x53')](handleError(_0x357ca3,null));};exports['show']=function(_0x37c1de,_0x4b3917){var _0xcf0680={'raw':![],'where':{'id':_0x37c1de[_0xef99('0x54')]['id']}},_0x59cf1a={};_0x59cf1a[_0xef99('0x41')]=_[_0xef99('0x43')](db['SugarcrmAccount'][_0xef99('0x3e')]);_0x59cf1a[_0xef99('0x42')]=_[_0xef99('0x43')](_0x37c1de[_0xef99('0x42')]);_0x59cf1a[_0xef99('0x44')]=_[_0xef99('0x45')](_0x59cf1a[_0xef99('0x41')],_0x59cf1a[_0xef99('0x42')]);_0xcf0680[_0xef99('0x47')]=_[_0xef99('0x45')](_0x59cf1a[_0xef99('0x41')],qs[_0xef99('0x46')](_0x37c1de[_0xef99('0x42')][_0xef99('0x46')]));_0xcf0680[_0xef99('0x47')]=_0xcf0680[_0xef99('0x47')][_0xef99('0x55')]?_0xcf0680[_0xef99('0x47')]:_0x59cf1a[_0xef99('0x41')];if(_0x37c1de['query'][_0xef99('0x56')]){_0xcf0680['include']=[{'all':!![]}];}_0xcf0680=_[_0xef99('0x4f')]({},_0xcf0680,_0x37c1de[_0xef99('0x57')]);return db['SugarcrmAccount']['find'](_0xcf0680)[_0xef99('0x22')](handleEntityNotFound(_0x4b3917,null))[_0xef99('0x22')](respondWithResult(_0x4b3917,null))[_0xef99('0x53')](handleError(_0x4b3917,null));};exports[_0xef99('0x58')]=function(_0x2a5d5d,_0x459c6a){return db[_0xef99('0x50')][_0xef99('0x58')](_0x2a5d5d[_0xef99('0x59')],{})[_0xef99('0x22')](respondWithResult(_0x459c6a,0xc9))[_0xef99('0x53')](handleError(_0x459c6a,null));};exports[_0xef99('0x36')]=function(_0x12d85a,_0x3a9b7a){if(_0x12d85a[_0xef99('0x59')]['id']){delete _0x12d85a[_0xef99('0x59')]['id'];}return db['SugarcrmAccount'][_0xef99('0x5a')]({'where':{'id':_0x12d85a[_0xef99('0x54')]['id']}})[_0xef99('0x22')](handleEntityNotFound(_0x3a9b7a,null))[_0xef99('0x22')](saveUpdates(_0x12d85a[_0xef99('0x59')],null))[_0xef99('0x22')](respondWithResult(_0x3a9b7a,null))['catch'](handleError(_0x3a9b7a,null));};exports[_0xef99('0x37')]=function(_0x4bca3a,_0x54265a){return db[_0xef99('0x50')][_0xef99('0x5a')]({'where':{'id':_0x4bca3a[_0xef99('0x54')]['id']}})[_0xef99('0x22')](handleEntityNotFound(_0x54265a,null))['then'](removeEntity(_0x54265a,null))[_0xef99('0x53')](handleError(_0x54265a,null));};exports['getConfigurations']=function(_0x3bedc1,_0x34118c,_0x4afac0){var _0x4000ea={};var _0x5d1250={};var _0x2bb7bc;var _0x55988b;return db[_0xef99('0x50')][_0xef99('0x5b')]({'where':{'id':_0x3bedc1['params']['id']}})[_0xef99('0x22')](handleEntityNotFound(_0x34118c,null))['then'](function(_0x3d69c8){if(_0x3d69c8){_0x2bb7bc=_0x3d69c8;_0x5d1250[_0xef99('0x41')]=_['keys'](db[_0xef99('0x5c')][_0xef99('0x3e')]);_0x5d1250[_0xef99('0x42')]=_[_0xef99('0x43')](_0x3bedc1[_0xef99('0x42')]);_0x5d1250['filters']=_[_0xef99('0x45')](_0x5d1250['model'],_0x5d1250[_0xef99('0x42')]);_0x4000ea[_0xef99('0x47')]=_[_0xef99('0x45')](_0x5d1250[_0xef99('0x41')],qs[_0xef99('0x46')](_0x3bedc1[_0xef99('0x42')]['fields']));_0x4000ea[_0xef99('0x47')]=_0x4000ea['attributes'][_0xef99('0x55')]?_0x4000ea[_0xef99('0x47')]:_0x5d1250[_0xef99('0x41')];_0x4000ea[_0xef99('0x4a')]=qs[_0xef99('0x4b')](_0x3bedc1[_0xef99('0x42')]['sort']);_0x4000ea[_0xef99('0x4c')]=qs[_0xef99('0x44')](_['pick'](_0x3bedc1['query'],_0x5d1250['filters']));if(_0x3bedc1[_0xef99('0x42')][_0xef99('0x4d')]){_0x4000ea[_0xef99('0x4c')]=_[_0xef99('0x4f')](_0x4000ea['where'],{'$or':_[_0xef99('0x3d')](_0x4000ea[_0xef99('0x47')],function(_0x577f25){var _0x2f95f8={};_0x2f95f8[_0x577f25]={'$like':'%'+_0x3bedc1['query'][_0xef99('0x4d')]+'%'};return _0x2f95f8;})});}_0x4000ea=_[_0xef99('0x4f')]({},_0x4000ea,_0x3bedc1[_0xef99('0x57')]);return _0x2bb7bc[_0xef99('0x5d')](_0x4000ea);}})[_0xef99('0x22')](function(_0x4c2d0d){if(_0x4c2d0d){_0x55988b=_0x4c2d0d[_0xef99('0x55')];if(!_0x3bedc1[_0xef99('0x42')][_0xef99('0x48')](_0xef99('0x49'))){_0x4000ea[_0xef99('0x32')]=qs['limit'](_0x3bedc1[_0xef99('0x42')][_0xef99('0x32')]);_0x4000ea['offset']=qs[_0xef99('0x31')](_0x3bedc1[_0xef99('0x42')][_0xef99('0x31')]);}return _0x2bb7bc['getConfigurations'](_0x4000ea);}})[_0xef99('0x22')](function(_0x1305c0){if(_0x1305c0){return _0x1305c0?{'count':_0x55988b,'rows':_0x1305c0}:null;}})[_0xef99('0x22')](respondWithResult(_0x34118c,null))[_0xef99('0x53')](handleError(_0x34118c,null));};exports[_0xef99('0x5e')]=function(_0x15ec22,_0x14767a,_0x55cb34){if(_0x15ec22[_0xef99('0x59')]['id']){delete _0x15ec22[_0xef99('0x59')]['id'];}return db[_0xef99('0x50')]['findOne']({'where':{'id':_0x15ec22[_0xef99('0x54')]['id']}})[_0xef99('0x22')](handleEntityNotFound(_0x14767a,null))[_0xef99('0x22')](function(_0x2c3c06){if(_0x2c3c06){_0x15ec22['body'][_0xef99('0x5f')]=_0x2c3c06['id'];_0x15ec22['body'][_0xef99('0x60')]=integrations[_0xef99('0x61')](_0x15ec22[_0xef99('0x59')][_0xef99('0x62')],_0x15ec22[_0xef99('0x59')][_0xef99('0x3f')]);_0x15ec22['body']['Descriptions']=integrations[_0xef99('0x63')](_0x15ec22[_0xef99('0x59')][_0xef99('0x62')],_0x15ec22[_0xef99('0x59')][_0xef99('0x3f')]);return db[_0xef99('0x5c')][_0xef99('0x58')](_0x15ec22[_0xef99('0x59')],{'include':[{'model':db[_0xef99('0x64')],'as':_0xef99('0x60')},{'model':db[_0xef99('0x64')],'as':_0xef99('0x65')}]});}return null;})['then'](respondWithResult(_0x14767a,null))[_0xef99('0x53')](handleError(_0x14767a,null));};exports['getFields']=function(_0x451d0b,_0x46442c,_0xacb1c7){var _0x5d6225='';var _0x585c4d=['id','name',_0xef99('0x66'),_0xef99('0x67'),_0xef99('0x68'),_0xef99('0x69'),_0xef99('0x6a'),'duration_minutes',_0xef99('0x6b'),_0xef99('0x6c'),_0xef99('0x6d'),'direction'];return db[_0xef99('0x50')]['findOne']({'where':{'id':_0x451d0b[_0xef99('0x54')]['id']},'attributes':['id','username',_0xef99('0x6e'),_0xef99('0x6f')]})[_0xef99('0x22')](handleEntityNotFound(_0x46442c,null))[_0xef99('0x22')](function(_0x3e4346){if(_0x3e4346){_0x5d6225=_0x3e4346[_0xef99('0x6f')];var _0x3a1dc6=_0x5d6225['slice'](-0x1);if(_0x3a1dc6==='/'){_0x5d6225=_0x5d6225[_0xef99('0x70')](0x0,_0x5d6225[_0xef99('0x71')](_0x3a1dc6));}return rp({'method':_0xef99('0x72'),'uri':util[_0xef99('0x73')]('%s%s',_0x5d6225,_0xef99('0x74')),'json':!![],'form':{'method':_0xef99('0x75'),'input_type':_0xef99('0x76'),'response_type':_0xef99('0x76'),'rest_data':JSON[_0xef99('0x28')]({'user_auth':{'user_name':_0x3e4346[_0xef99('0x77')],'password':_0x3e4346[_0xef99('0x6e')],'encryption':'PLAIN'},'application':_0xef99('0x78')})}});}})[_0xef99('0x22')](function(_0x98de10){if(_0x98de10&&_0x98de10[_0xef99('0x3a')]!==_0xef99('0x79')&&_0x98de10[_0xef99('0x3a')]!==_0xef99('0x7a')){return rp({'method':_0xef99('0x72'),'uri':util[_0xef99('0x73')](_0xef99('0x7b'),_0x5d6225,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xef99('0x7c'),'input_type':_0xef99('0x76'),'response_type':_0xef99('0x76'),'rest_data':JSON[_0xef99('0x28')]({'session':_0x98de10['id'],'module_name':_0xef99('0x7d')})}})[_0xef99('0x22')](function(_0xf0aeba){if(_0xf0aeba){var _0x275ed6=_[_0xef99('0x7e')](_0xf0aeba['module_fields']);_['remove'](_0x275ed6,function(_0x17d07e){return _0x585c4d[_0xef99('0x7f')](_0x17d07e['name']);});return{'count':_0x275ed6['length'],'rows':_[_0xef99('0x3d')](_0x275ed6,function(_0x621fd7){return{'id':_0x621fd7[_0xef99('0x3a')],'name':_0x621fd7[_0xef99('0x80')],'custom':_[_0xef99('0x81')](_0x621fd7[_0xef99('0x3a')],'_c')?!![]:![],'options':_0x621fd7[_0xef99('0x57')]?_[_0xef99('0x3d')](_[_0xef99('0x7e')](_0x621fd7['options']),function(_0x2108df){return{'name':_0x2108df[_0xef99('0x82')],'value':_0x2108df[_0xef99('0x3a')]};}):[]};})};}})[_0xef99('0x22')](respondWithResult(_0x46442c,null))[_0xef99('0x53')](function(_0x294c8e){var _0x3169ac=_0x451d0b[_0xef99('0x42')][_0xef99('0x1d')]?0x1f4:_0x294c8e[_0xef99('0x83')]||0x1f4;logger[_0xef99('0x29')](_0xef99('0x84'),_0xef99('0x85'),_0x3169ac,JSON[_0xef99('0x28')](_0x294c8e));delete _0x294c8e[_0xef99('0x3a')];if(_0x3169ac===0x191){_0x3169ac=0x190;}_0x46442c[_0xef99('0x2e')](_0x3169ac)[_0xef99('0x3b')](_0x451d0b[_0xef99('0x42')][_0xef99('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x294c8e['statusCode']}:_0x294c8e);});}else{var _0x7ab079=0x1f4;_0x46442c['status'](_0x7ab079)[_0xef99('0x3b')]({'message':_0xef99('0x86'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x4b29=['fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','show','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','created_by','description','parent_id','parent_type','parent_name','username','password','remoteUri','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SugarcrmAccount','rawAttributes'];(function(_0x259baf,_0x8574de){var _0x55d9c2=function(_0x4555d9){while(--_0x4555d9){_0x259baf['push'](_0x259baf['shift']());}};_0x55d9c2(++_0x8574de);}(_0x4b29,0x1cf));var _0x94b2=function(_0x58f695,_0x405614){_0x58f695=_0x58f695-0x0;var _0x56ebcf=_0x4b29[_0x58f695];return _0x56ebcf;};'use strict';var pdf=require(_0x94b2('0x0'));var emlformat=require(_0x94b2('0x1'));var rimraf=require(_0x94b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94b2('0x3'));var rp=require('request-promise');var moment=require(_0x94b2('0x4'));var BPromise=require(_0x94b2('0x5'));var Mustache=require(_0x94b2('0x6'));var util=require(_0x94b2('0x7'));var path=require('path');var sox=require(_0x94b2('0x8'));var csv=require(_0x94b2('0x9'));var ejs=require(_0x94b2('0xa'));var fs=require('fs');var _=require(_0x94b2('0xb'));var squel=require(_0x94b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x94b2('0xd'));var deskjs=require(_0x94b2('0xe'));var toCsv=require(_0x94b2('0x9'));var querystring=require(_0x94b2('0xf'));var Papa=require(_0x94b2('0x10'));var Redis=require(_0x94b2('0x11'));var authService=require(_0x94b2('0x12'));var qs=require(_0x94b2('0x13'));var as=require(_0x94b2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x94b2('0x15'))(_0x94b2('0x16'));var utils=require(_0x94b2('0x17'));var config=require(_0x94b2('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x94b2('0x19'));var jayson=require(_0x94b2('0x1a'));var client=jayson[_0x94b2('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x4c25e1,_0x558037,_0x2568f0){if(_0x2568f0){var _0xcec682=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcec682[_0x94b2('0x1c')](_0x558037)){return _0x4c25e1;}else{throw new db[(_0x94b2('0x1d'))][(_0x94b2('0x1e'))](_0x94b2('0x1f'));}}else{return _0x4c25e1;}}function respondWithRpcPromise(_0x379a0a,_0x5e82ff,_0xec55f2,_0x25d317){return new BPromise(function(_0x499190,_0x12d2ab){var _0x4b183c=_0x25d317||client;return _0x4b183c[_0x94b2('0x20')](_0x379a0a,_0xec55f2)['then'](function(_0x192a9c){logger[_0x94b2('0x21')](_0x94b2('0x22'),_0x5e82ff,_0x94b2('0x23'));logger[_0x94b2('0x24')](_0x94b2('0x25'),_0x5e82ff,'request\x20sent',JSON[_0x94b2('0x26')](_0x192a9c));if(_0x192a9c['error']){if(_0x192a9c['error'][_0x94b2('0x27')]===0x1f4){logger['error'](_0x94b2('0x22'),_0x5e82ff,_0x192a9c[_0x94b2('0x28')][_0x94b2('0x29')]);return _0x12d2ab(_0x192a9c['error'][_0x94b2('0x29')]);}logger[_0x94b2('0x28')](_0x94b2('0x22'),_0x5e82ff,_0x192a9c[_0x94b2('0x28')][_0x94b2('0x29')]);return _0x499190(_0x192a9c['error']['message']);}else{logger[_0x94b2('0x21')](_0x94b2('0x22'),_0x5e82ff,'request\x20sent');_0x499190(_0x192a9c[_0x94b2('0x2a')][_0x94b2('0x29')]);}})[_0x94b2('0x2b')](function(_0x3f2ce1){logger[_0x94b2('0x28')](_0x94b2('0x22'),_0x5e82ff,_0x3f2ce1);_0x12d2ab(_0x3f2ce1);});});}function respondWithStatusCode(_0x2b4e5d,_0xfe18ca){_0xfe18ca=_0xfe18ca||0xcc;return function(_0x52c6a1){if(_0x52c6a1){return _0x2b4e5d[_0x94b2('0x2c')](_0xfe18ca);}return _0x2b4e5d[_0x94b2('0x2d')](_0xfe18ca)[_0x94b2('0x2e')]();};}function respondWithResult(_0x216dbd,_0x4412d1){_0x4412d1=_0x4412d1||0xc8;return function(_0x1e9d4e){if(_0x1e9d4e){return _0x216dbd[_0x94b2('0x2d')](_0x4412d1)[_0x94b2('0x2f')](_0x1e9d4e);}};}function respondWithFilteredResult(_0x403705,_0x2badc4){return function(_0x28cefd){if(_0x28cefd){var _0x272dff=_0x28cefd['count'],_0x466137=_0x2badc4[_0x94b2('0x30')],_0x17e50d=_0x2badc4[_0x94b2('0x30')]+_0x2badc4[_0x94b2('0x31')],_0x473565;if(_0x17e50d>=_0x272dff){_0x17e50d=_0x272dff;_0x473565=0xc8;}else{_0x473565=0xce;}_0x403705['status'](_0x473565);return _0x403705[_0x94b2('0x32')](_0x94b2('0x33'),_0x466137+'-'+_0x17e50d+'/'+_0x272dff)[_0x94b2('0x2f')](_0x28cefd);}return null;};}function patchUpdates(_0xb026f1){return function(_0x2b6a96){try{jsonpatch[_0x94b2('0x34')](_0x2b6a96,_0xb026f1,!![]);}catch(_0x10e734){return BPromise[_0x94b2('0x35')](_0x10e734);}return _0x2b6a96[_0x94b2('0x36')]();};}function saveUpdates(_0x4ef294,_0x504f74){return function(_0x4673f7){if(_0x4673f7){return _0x4673f7[_0x94b2('0x37')](_0x4ef294)[_0x94b2('0x38')](function(_0x18ef03){return _0x18ef03;});}return null;};}function removeEntity(_0x28779d,_0x348d4b){return function(_0x4c51fc){if(_0x4c51fc){return _0x4c51fc[_0x94b2('0x39')]()['then'](function(){_0x28779d[_0x94b2('0x2d')](0xcc)[_0x94b2('0x2e')]();});}};}function handleEntityNotFound(_0xebbdda,_0x3bb584){return function(_0x4490e2){if(!_0x4490e2){_0xebbdda[_0x94b2('0x2c')](0x194);}return _0x4490e2;};}function handleError(_0x4d67e4,_0x256005){_0x256005=_0x256005||0x1f4;return function(_0x5455d4){logger[_0x94b2('0x28')](_0x5455d4[_0x94b2('0x3a')]);if(_0x5455d4[_0x94b2('0x3b')]){delete _0x5455d4[_0x94b2('0x3b')];}_0x4d67e4[_0x94b2('0x2d')](_0x256005)[_0x94b2('0x3c')](_0x5455d4);};}exports[_0x94b2('0x3d')]=function(_0x4e788f,_0x2a6d4c){var _0x1adbcf={},_0x4e2ab6={},_0x3b88d2={'count':0x0,'rows':[]};var _0x3116b9=_[_0x94b2('0x3e')](db[_0x94b2('0x3f')][_0x94b2('0x40')],function(_0x529193){return{'name':_0x529193[_0x94b2('0x41')],'type':_0x529193[_0x94b2('0x42')][_0x94b2('0x43')]};});_0x4e2ab6[_0x94b2('0x44')]=_[_0x94b2('0x3e')](_0x3116b9,'name');_0x4e2ab6[_0x94b2('0x45')]=_[_0x94b2('0x46')](_0x4e788f['query']);_0x4e2ab6['filters']=_[_0x94b2('0x47')](_0x4e2ab6['model'],_0x4e2ab6['query']);_0x1adbcf['attributes']=_[_0x94b2('0x47')](_0x4e2ab6[_0x94b2('0x44')],qs[_0x94b2('0x48')](_0x4e788f[_0x94b2('0x45')][_0x94b2('0x48')]));_0x1adbcf[_0x94b2('0x49')]=_0x1adbcf[_0x94b2('0x49')][_0x94b2('0x4a')]?_0x1adbcf[_0x94b2('0x49')]:_0x4e2ab6[_0x94b2('0x44')];if(!_0x4e788f[_0x94b2('0x45')][_0x94b2('0x4b')](_0x94b2('0x4c'))){_0x1adbcf[_0x94b2('0x31')]=qs[_0x94b2('0x31')](_0x4e788f[_0x94b2('0x45')]['limit']);_0x1adbcf[_0x94b2('0x30')]=qs[_0x94b2('0x30')](_0x4e788f['query'][_0x94b2('0x30')]);}_0x1adbcf[_0x94b2('0x4d')]=qs[_0x94b2('0x4e')](_0x4e788f[_0x94b2('0x45')][_0x94b2('0x4e')]);_0x1adbcf['where']=qs[_0x94b2('0x4f')](_[_0x94b2('0x50')](_0x4e788f[_0x94b2('0x45')],_0x4e2ab6[_0x94b2('0x4f')]),_0x3116b9);if(_0x4e788f['query'][_0x94b2('0x51')]){_0x1adbcf[_0x94b2('0x52')]=_[_0x94b2('0x53')](_0x1adbcf[_0x94b2('0x52')],{'$or':_[_0x94b2('0x3e')](_0x3116b9,function(_0x27095f){if(_0x27095f[_0x94b2('0x42')]!=='VIRTUAL'){var _0x578107={};_0x578107[_0x27095f['name']]={'$like':'%'+_0x4e788f['query'][_0x94b2('0x51')]+'%'};return _0x578107;}})});}_0x1adbcf=_[_0x94b2('0x53')]({},_0x1adbcf,_0x4e788f[_0x94b2('0x54')]);var _0x8a44c2={'where':_0x1adbcf[_0x94b2('0x52')]};return db[_0x94b2('0x3f')][_0x94b2('0x55')](_0x8a44c2)[_0x94b2('0x38')](function(_0x4fdbe8){_0x3b88d2[_0x94b2('0x55')]=_0x4fdbe8;if(_0x4e788f[_0x94b2('0x45')][_0x94b2('0x56')]){_0x1adbcf[_0x94b2('0x57')]=[{'all':!![]}];}return db[_0x94b2('0x3f')][_0x94b2('0x58')](_0x1adbcf);})[_0x94b2('0x38')](function(_0x43c1f5){_0x3b88d2[_0x94b2('0x59')]=_0x43c1f5;return _0x3b88d2;})[_0x94b2('0x38')](respondWithFilteredResult(_0x2a6d4c,_0x1adbcf))[_0x94b2('0x2b')](handleError(_0x2a6d4c,null));};exports[_0x94b2('0x5a')]=function(_0x4c8e9e,_0x171410){var _0x551bc1={'raw':![],'where':{'id':_0x4c8e9e['params']['id']}},_0x26c533={};_0x26c533[_0x94b2('0x44')]=_[_0x94b2('0x46')](db[_0x94b2('0x3f')][_0x94b2('0x40')]);_0x26c533[_0x94b2('0x45')]=_[_0x94b2('0x46')](_0x4c8e9e[_0x94b2('0x45')]);_0x26c533['filters']=_[_0x94b2('0x47')](_0x26c533[_0x94b2('0x44')],_0x26c533['query']);_0x551bc1[_0x94b2('0x49')]=_['intersection'](_0x26c533[_0x94b2('0x44')],qs[_0x94b2('0x48')](_0x4c8e9e[_0x94b2('0x45')][_0x94b2('0x48')]));_0x551bc1[_0x94b2('0x49')]=_0x551bc1[_0x94b2('0x49')][_0x94b2('0x4a')]?_0x551bc1['attributes']:_0x26c533[_0x94b2('0x44')];if(_0x4c8e9e[_0x94b2('0x45')][_0x94b2('0x56')]){_0x551bc1[_0x94b2('0x57')]=[{'all':!![]}];}_0x551bc1=_[_0x94b2('0x53')]({},_0x551bc1,_0x4c8e9e[_0x94b2('0x54')]);return db[_0x94b2('0x3f')][_0x94b2('0x5b')](_0x551bc1)[_0x94b2('0x38')](handleEntityNotFound(_0x171410,null))[_0x94b2('0x38')](respondWithResult(_0x171410,null))[_0x94b2('0x2b')](handleError(_0x171410,null));};exports[_0x94b2('0x5c')]=function(_0x323979,_0x34a34b){return db['SugarcrmAccount'][_0x94b2('0x5c')](_0x323979[_0x94b2('0x5d')],{})['then'](respondWithResult(_0x34a34b,0xc9))[_0x94b2('0x2b')](handleError(_0x34a34b,null));};exports[_0x94b2('0x37')]=function(_0x293967,_0x2a3ce5){if(_0x293967[_0x94b2('0x5d')]['id']){delete _0x293967['body']['id'];}return db[_0x94b2('0x3f')][_0x94b2('0x5b')]({'where':{'id':_0x293967[_0x94b2('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2a3ce5,null))[_0x94b2('0x38')](saveUpdates(_0x293967['body'],null))[_0x94b2('0x38')](respondWithResult(_0x2a3ce5,null))[_0x94b2('0x2b')](handleError(_0x2a3ce5,null));};exports[_0x94b2('0x39')]=function(_0x20679c,_0x1f7f44){return db[_0x94b2('0x3f')][_0x94b2('0x5b')]({'where':{'id':_0x20679c['params']['id']}})[_0x94b2('0x38')](handleEntityNotFound(_0x1f7f44,null))[_0x94b2('0x38')](removeEntity(_0x1f7f44,null))[_0x94b2('0x2b')](handleError(_0x1f7f44,null));};exports[_0x94b2('0x5f')]=function(_0x48a5e0,_0x766249,_0x5df9b1){var _0x1390bf={};var _0x1dda41={};var _0x763b56;var _0x2d63dd;return db['SugarcrmAccount'][_0x94b2('0x60')]({'where':{'id':_0x48a5e0['params']['id']}})['then'](handleEntityNotFound(_0x766249,null))[_0x94b2('0x38')](function(_0x366484){if(_0x366484){_0x763b56=_0x366484;_0x1dda41[_0x94b2('0x44')]=_[_0x94b2('0x46')](db['SugarcrmConfiguration'][_0x94b2('0x40')]);_0x1dda41['query']=_[_0x94b2('0x46')](_0x48a5e0['query']);_0x1dda41[_0x94b2('0x4f')]=_['intersection'](_0x1dda41[_0x94b2('0x44')],_0x1dda41['query']);_0x1390bf[_0x94b2('0x49')]=_[_0x94b2('0x47')](_0x1dda41['model'],qs[_0x94b2('0x48')](_0x48a5e0['query']['fields']));_0x1390bf[_0x94b2('0x49')]=_0x1390bf['attributes'][_0x94b2('0x4a')]?_0x1390bf[_0x94b2('0x49')]:_0x1dda41[_0x94b2('0x44')];_0x1390bf[_0x94b2('0x4d')]=qs[_0x94b2('0x4e')](_0x48a5e0[_0x94b2('0x45')][_0x94b2('0x4e')]);_0x1390bf[_0x94b2('0x52')]=qs['filters'](_[_0x94b2('0x50')](_0x48a5e0['query'],_0x1dda41[_0x94b2('0x4f')]));if(_0x48a5e0[_0x94b2('0x45')][_0x94b2('0x51')]){_0x1390bf[_0x94b2('0x52')]=_['merge'](_0x1390bf['where'],{'$or':_[_0x94b2('0x3e')](_0x1390bf[_0x94b2('0x49')],function(_0xc83874){var _0x58edd3={};_0x58edd3[_0xc83874]={'$like':'%'+_0x48a5e0[_0x94b2('0x45')]['filter']+'%'};return _0x58edd3;})});}_0x1390bf=_[_0x94b2('0x53')]({},_0x1390bf,_0x48a5e0['options']);return _0x763b56[_0x94b2('0x5f')](_0x1390bf);}})[_0x94b2('0x38')](function(_0x2bbca7){if(_0x2bbca7){_0x2d63dd=_0x2bbca7['length'];if(!_0x48a5e0[_0x94b2('0x45')]['hasOwnProperty'](_0x94b2('0x4c'))){_0x1390bf[_0x94b2('0x31')]=qs[_0x94b2('0x31')](_0x48a5e0[_0x94b2('0x45')]['limit']);_0x1390bf['offset']=qs[_0x94b2('0x30')](_0x48a5e0['query']['offset']);}return _0x763b56['getConfigurations'](_0x1390bf);}})['then'](function(_0x29196f){if(_0x29196f){return _0x29196f?{'count':_0x2d63dd,'rows':_0x29196f}:null;}})[_0x94b2('0x38')](respondWithResult(_0x766249,null))[_0x94b2('0x2b')](handleError(_0x766249,null));};exports[_0x94b2('0x61')]=function(_0xfac543,_0x5ba723,_0xca391){if(_0xfac543[_0x94b2('0x5d')]['id']){delete _0xfac543[_0x94b2('0x5d')]['id'];}return db[_0x94b2('0x3f')][_0x94b2('0x60')]({'where':{'id':_0xfac543[_0x94b2('0x5e')]['id']}})[_0x94b2('0x38')](handleEntityNotFound(_0x5ba723,null))[_0x94b2('0x38')](function(_0x589805){if(_0x589805){_0xfac543[_0x94b2('0x5d')][_0x94b2('0x62')]=_0x589805['id'];_0xfac543[_0x94b2('0x5d')]['Subjects']=integrations[_0x94b2('0x63')](_0xfac543[_0x94b2('0x5d')]['channel'],_0xfac543[_0x94b2('0x5d')][_0x94b2('0x42')]);_0xfac543['body'][_0x94b2('0x64')]=integrations[_0x94b2('0x65')](_0xfac543[_0x94b2('0x5d')]['channel'],_0xfac543[_0x94b2('0x5d')][_0x94b2('0x42')]);return db[_0x94b2('0x66')][_0x94b2('0x5c')](_0xfac543[_0x94b2('0x5d')],{'include':[{'model':db[_0x94b2('0x67')],'as':'Subjects'},{'model':db[_0x94b2('0x67')],'as':_0x94b2('0x64')}]});}return null;})[_0x94b2('0x38')](respondWithResult(_0x5ba723,null))['catch'](handleError(_0x5ba723,null));};exports['getFields']=function(_0xacaca4,_0x3feb21,_0x4bb6b0){var _0x4148c6='';var _0x26c406=['id',_0x94b2('0x3b'),'assigned_user_id',_0x94b2('0x68'),_0x94b2('0x69'),'date_start','duration_hours','duration_minutes',_0x94b2('0x6a'),_0x94b2('0x6b'),_0x94b2('0x6c'),'direction'];return db['SugarcrmAccount']['findOne']({'where':{'id':_0xacaca4[_0x94b2('0x5e')]['id']},'attributes':['id',_0x94b2('0x6d'),_0x94b2('0x6e'),_0x94b2('0x6f')]})['then'](handleEntityNotFound(_0x3feb21,null))['then'](function(_0x5c7434){if(_0x5c7434){_0x4148c6=_0x5c7434[_0x94b2('0x6f')];var _0x404d23=_0x4148c6['slice'](-0x1);if(_0x404d23==='/'){_0x4148c6=_0x4148c6[_0x94b2('0x70')](0x0,_0x4148c6['lastIndexOf'](_0x404d23));}return rp({'method':_0x94b2('0x71'),'uri':util[_0x94b2('0x72')](_0x94b2('0x73'),_0x4148c6,_0x94b2('0x74')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x94b2('0x75'),'rest_data':JSON[_0x94b2('0x26')]({'user_auth':{'user_name':_0x5c7434[_0x94b2('0x6d')],'password':_0x5c7434['password'],'encryption':_0x94b2('0x76')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x94b2('0x38')](function(_0x7c06cc){if(_0x7c06cc&&_0x7c06cc['name']!==_0x94b2('0x77')&&_0x7c06cc[_0x94b2('0x3b')]!==_0x94b2('0x78')){return rp({'method':_0x94b2('0x71'),'uri':util[_0x94b2('0x72')](_0x94b2('0x73'),_0x4148c6,_0x94b2('0x74')),'json':!![],'form':{'method':_0x94b2('0x79'),'input_type':_0x94b2('0x75'),'response_type':'JSON','rest_data':JSON[_0x94b2('0x26')]({'session':_0x7c06cc['id'],'module_name':_0x94b2('0x7a')})}})[_0x94b2('0x38')](function(_0x403352){if(_0x403352){var _0xd25ded=_[_0x94b2('0x7b')](_0x403352[_0x94b2('0x7c')]);_[_0x94b2('0x7d')](_0xd25ded,function(_0xffe7dc){return _0x26c406['includes'](_0xffe7dc['name']);});return{'count':_0xd25ded[_0x94b2('0x4a')],'rows':_[_0x94b2('0x3e')](_0xd25ded,function(_0x66507a){return{'id':_0x66507a['name'],'name':_0x66507a['label'],'custom':_[_0x94b2('0x7e')](_0x66507a[_0x94b2('0x3b')],'_c')?!![]:![],'options':_0x66507a[_0x94b2('0x54')]?_[_0x94b2('0x3e')](_[_0x94b2('0x7b')](_0x66507a['options']),function(_0x34e60f){return{'name':_0x34e60f[_0x94b2('0x7f')],'value':_0x34e60f[_0x94b2('0x3b')]};}):[]};})};}})[_0x94b2('0x38')](respondWithResult(_0x3feb21,null))['catch'](function(_0x3b43ff){var _0x3c59bf=_0xacaca4[_0x94b2('0x45')][_0x94b2('0x1c')]?0x1f4:_0x3b43ff[_0x94b2('0x80')]||0x1f4;logger[_0x94b2('0x28')](_0x94b2('0x81'),_0x94b2('0x82'),_0x3c59bf,JSON['stringify'](_0x3b43ff));delete _0x3b43ff[_0x94b2('0x3b')];if(_0x3c59bf===0x191){_0x3c59bf=0x190;}_0x3feb21[_0x94b2('0x2d')](_0x3c59bf)['send'](_0xacaca4['query']['test']?{'message':_0x94b2('0x83'),'statusCode':_0x3b43ff[_0x94b2('0x80')]}:_0x3b43ff);});}else{var _0x1e9907=0x1f4;_0x3feb21['status'](_0x1e9907)[_0x94b2('0x3c')]({'message':_0x94b2('0x83'),'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 089c7ae..a9d327e 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 _0x6bd9=['exports','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x158f9b,_0x30d3d2){var _0x11268f=function(_0x2b6c61){while(--_0x2b6c61){_0x158f9b['push'](_0x158f9b['shift']());}};_0x11268f(++_0x30d3d2);}(_0x6bd9,0xb3));var _0x96bd=function(_0x46d743,_0x1675ee){_0x46d743=_0x46d743-0x0;var _0x1c4972=_0x6bd9[_0x46d743];return _0x1c4972;};'use strict';var _=require(_0x96bd('0x0'));var util=require(_0x96bd('0x1'));var logger=require('../../config/logger')(_0x96bd('0x2'));var moment=require(_0x96bd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x96bd('0x4'));var rimraf=require(_0x96bd('0x5'));var config=require(_0x96bd('0x6'));var attributes=require(_0x96bd('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x96bd('0x8')]=function(_0x21287b,_0x44ebcb){return _0x21287b['define'](_0x96bd('0x9'),attributes,{'tableName':_0x96bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde34=['request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','SugarcrmAccount','int_sugarcrm_accounts','util','api','bluebird'];(function(_0x1e28e8,_0x321a48){var _0x1991ab=function(_0x55843c){while(--_0x55843c){_0x1e28e8['push'](_0x1e28e8['shift']());}};_0x1991ab(++_0x321a48);}(_0xde34,0xf9));var _0x4de3=function(_0x3863be,_0x3fb52c){_0x3863be=_0x3863be-0x0;var _0x17849a=_0xde34[_0x3863be];return _0x17849a;};'use strict';var _=require('lodash');var util=require(_0x4de3('0x0'));var logger=require('../../config/logger')(_0x4de3('0x1'));var moment=require('moment');var BPromise=require(_0x4de3('0x2'));var rp=require(_0x4de3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4de3('0x4'));var config=require('../../config/environment');var attributes=require(_0x4de3('0x5'));var integrations=require(_0x4de3('0x6'));module['exports']=function(_0x2a926a,_0x4a0dd0){return _0x2a926a['define'](_0x4de3('0x7'),attributes,{'tableName':_0x4de3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 4b23076..f84faf1 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 _0x2464=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','attributes','include','model','map','then','message','ShowSugarcrmAccount','find','where','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x800883,_0x397c5d){var _0x3e44e9=function(_0xa82521){while(--_0xa82521){_0x800883['push'](_0x800883['shift']());}};_0x3e44e9(++_0x397c5d);}(_0x2464,0x15a));var _0x4246=function(_0x29647c,_0x92be9e){_0x29647c=_0x29647c-0x0;var _0x276458=_0x2464[_0x29647c];return _0x276458;};'use strict';var _=require(_0x4246('0x0'));var util=require(_0x4246('0x1'));var moment=require('moment');var BPromise=require(_0x4246('0x2'));var rs=require(_0x4246('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4246('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4246('0x5'))(_0x4246('0x6'));var config=require(_0x4246('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4246('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43f904,_0x545bfd,_0x3b61c8){return new BPromise(function(_0x24ca34,_0x25389a){return client[_0x4246('0x9')](_0x43f904,_0x3b61c8)['then'](function(_0xc1ed68){logger[_0x4246('0xa')](_0x4246('0xb'),_0x545bfd,_0x4246('0xc'));logger[_0x4246('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x545bfd,'request\x20sent',JSON[_0x4246('0xe')](_0xc1ed68));if(_0xc1ed68[_0x4246('0xf')]){if(_0xc1ed68[_0x4246('0xf')][_0x4246('0x10')]===0x1f4){logger['error'](_0x4246('0xb'),_0x545bfd,_0xc1ed68[_0x4246('0xf')]['message']);return _0x25389a(_0xc1ed68[_0x4246('0xf')]['message']);}logger[_0x4246('0xf')](_0x4246('0xb'),_0x545bfd,_0xc1ed68['error']['message']);return _0x24ca34(_0xc1ed68[_0x4246('0xf')]['message']);}else{logger['info'](_0x4246('0xb'),_0x545bfd,_0x4246('0xc'));_0x24ca34(_0xc1ed68[_0x4246('0x11')]['message']);}})[_0x4246('0x12')](function(_0x94b307){logger[_0x4246('0xf')](_0x4246('0xb'),_0x545bfd,_0x94b307);_0x25389a(_0x94b307);});});}exports[_0x4246('0x13')]=function(_0x122020){var _0x10bc7e=this;return new Promise(function(_0x333522,_0x1dd7bb){return db[_0x4246('0x14')][_0x4246('0x15')]({'raw':_0x122020[_0x4246('0x16')]?_0x122020['options'][_0x4246('0x17')]===undefined?!![]:![]:!![],'where':_0x122020[_0x4246('0x16')]?_0x122020['options']['where']||null:null,'attributes':_0x122020['options']?_0x122020[_0x4246('0x16')][_0x4246('0x18')]||null:null,'limit':_0x122020[_0x4246('0x16')]?_0x122020[_0x4246('0x16')]['limit']||null:null,'include':_0x122020['options']?_0x122020[_0x4246('0x16')][_0x4246('0x19')]?_['map'](_0x122020[_0x4246('0x16')][_0x4246('0x19')],function(_0x44ea86){return{'model':db[_0x44ea86[_0x4246('0x1a')]],'as':_0x44ea86['as'],'attributes':_0x44ea86['attributes'],'include':_0x44ea86[_0x4246('0x19')]?_[_0x4246('0x1b')](_0x44ea86[_0x4246('0x19')],function(_0x2049fc){return{'model':db[_0x2049fc['model']],'as':_0x2049fc['as'],'attributes':_0x2049fc[_0x4246('0x18')],'include':_0x2049fc[_0x4246('0x19')]?_[_0x4246('0x1b')](_0x2049fc[_0x4246('0x19')],function(_0x52a50b){return{'model':db[_0x52a50b[_0x4246('0x1a')]],'as':_0x52a50b['as'],'attributes':_0x52a50b[_0x4246('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4246('0x1c')](function(_0x216989){logger[_0x4246('0xa')](_0x4246('0x13'),_0x122020);logger[_0x4246('0xd')](_0x4246('0x13'),_0x122020,JSON[_0x4246('0xe')](_0x216989));_0x333522(_0x216989);})[_0x4246('0x12')](function(_0x4d9f05){logger[_0x4246('0xf')](_0x4246('0x13'),_0x4d9f05[_0x4246('0x1d')],_0x122020);_0x1dd7bb(_0x10bc7e[_0x4246('0xf')](0x1f4,_0x4d9f05[_0x4246('0x1d')]));});});};exports[_0x4246('0x1e')]=function(_0x90eacd){var _0x4a9802=this;return new Promise(function(_0x4417af,_0x42ed94){return db[_0x4246('0x14')][_0x4246('0x1f')]({'raw':_0x90eacd[_0x4246('0x16')]?_0x90eacd[_0x4246('0x16')][_0x4246('0x17')]===undefined?!![]:![]:!![],'where':_0x90eacd['options']?_0x90eacd[_0x4246('0x16')][_0x4246('0x20')]||null:null,'attributes':_0x90eacd[_0x4246('0x16')]?_0x90eacd['options'][_0x4246('0x18')]||null:null,'include':_0x90eacd[_0x4246('0x16')]?_0x90eacd[_0x4246('0x16')]['include']?_[_0x4246('0x1b')](_0x90eacd['options']['include'],function(_0x5bd66c){return{'model':db[_0x5bd66c[_0x4246('0x1a')]],'as':_0x5bd66c['as'],'attributes':_0x5bd66c[_0x4246('0x18')],'include':_0x5bd66c['include']?_[_0x4246('0x1b')](_0x5bd66c[_0x4246('0x19')],function(_0x41752f){return{'model':db[_0x41752f[_0x4246('0x1a')]],'as':_0x41752f['as'],'attributes':_0x41752f['attributes'],'include':_0x41752f[_0x4246('0x19')]?_[_0x4246('0x1b')](_0x41752f[_0x4246('0x19')],function(_0x28c271){return{'model':db[_0x28c271[_0x4246('0x1a')]],'as':_0x28c271['as'],'attributes':_0x28c271[_0x4246('0x18')]};}):[]};}):[]};}):[]:[]})[_0x4246('0x1c')](function(_0x285f4d){logger['info'](_0x4246('0x1e'),_0x90eacd);logger[_0x4246('0xd')]('ShowSugarcrmAccount',_0x90eacd,JSON[_0x4246('0xe')](_0x285f4d));_0x4417af(_0x285f4d);})['catch'](function(_0x310caf){logger['error'](_0x4246('0x1e'),_0x310caf[_0x4246('0x1d')],_0x90eacd);_0x42ed94(_0x4a9802['error'](0x1f4,_0x310caf[_0x4246('0x1d')]));});});}; \ No newline at end of file +var _0xcd9d=['client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','map','include','model','debug','catch','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5211d4,_0x417556){var _0x9fc0b4=function(_0x1fbc21){while(--_0x1fbc21){_0x5211d4['push'](_0x5211d4['shift']());}};_0x9fc0b4(++_0x417556);}(_0xcd9d,0x86));var _0xdcd9=function(_0xa1d9c9,_0x56d5cf){_0xa1d9c9=_0xa1d9c9-0x0;var _0x301a7c=_0xcd9d[_0xa1d9c9];return _0x301a7c;};'use strict';var _=require(_0xdcd9('0x0'));var util=require(_0xdcd9('0x1'));var moment=require(_0xdcd9('0x2'));var BPromise=require(_0xdcd9('0x3'));var rs=require(_0xdcd9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcd9('0x5'))['db'];var utils=require(_0xdcd9('0x6'));var logger=require(_0xdcd9('0x7'))(_0xdcd9('0x8'));var config=require(_0xdcd9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdcd9('0xa')][_0xdcd9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8176fd,_0x13f5b6,_0x24d36f){return new BPromise(function(_0x47120b,_0x205cd1){return client[_0xdcd9('0xc')](_0x8176fd,_0x24d36f)[_0xdcd9('0xd')](function(_0x2e6107){logger[_0xdcd9('0xe')](_0xdcd9('0xf'),_0x13f5b6,_0xdcd9('0x10'));logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x13f5b6,_0xdcd9('0x10'),JSON[_0xdcd9('0x11')](_0x2e6107));if(_0x2e6107['error']){if(_0x2e6107[_0xdcd9('0x12')][_0xdcd9('0x13')]===0x1f4){logger[_0xdcd9('0x12')](_0xdcd9('0xf'),_0x13f5b6,_0x2e6107['error'][_0xdcd9('0x14')]);return _0x205cd1(_0x2e6107[_0xdcd9('0x12')][_0xdcd9('0x14')]);}logger[_0xdcd9('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x13f5b6,_0x2e6107[_0xdcd9('0x12')][_0xdcd9('0x14')]);return _0x47120b(_0x2e6107[_0xdcd9('0x12')][_0xdcd9('0x14')]);}else{logger[_0xdcd9('0xe')](_0xdcd9('0xf'),_0x13f5b6,_0xdcd9('0x10'));_0x47120b(_0x2e6107[_0xdcd9('0x15')][_0xdcd9('0x14')]);}})['catch'](function(_0xef20e5){logger[_0xdcd9('0x12')](_0xdcd9('0xf'),_0x13f5b6,_0xef20e5);_0x205cd1(_0xef20e5);});});}exports[_0xdcd9('0x16')]=function(_0xaff3d0){var _0x3ba244=this;return new Promise(function(_0x39efff,_0x4d2bad){return db[_0xdcd9('0x17')][_0xdcd9('0x18')]({'raw':_0xaff3d0[_0xdcd9('0x19')]?_0xaff3d0['options'][_0xdcd9('0x1a')]===undefined?!![]:![]:!![],'where':_0xaff3d0[_0xdcd9('0x19')]?_0xaff3d0[_0xdcd9('0x19')][_0xdcd9('0x1b')]||null:null,'attributes':_0xaff3d0['options']?_0xaff3d0['options'][_0xdcd9('0x1c')]||null:null,'limit':_0xaff3d0[_0xdcd9('0x19')]?_0xaff3d0[_0xdcd9('0x19')]['limit']||null:null,'include':_0xaff3d0[_0xdcd9('0x19')]?_0xaff3d0['options']['include']?_[_0xdcd9('0x1d')](_0xaff3d0[_0xdcd9('0x19')][_0xdcd9('0x1e')],function(_0x2662e9){return{'model':db[_0x2662e9['model']],'as':_0x2662e9['as'],'attributes':_0x2662e9[_0xdcd9('0x1c')],'include':_0x2662e9[_0xdcd9('0x1e')]?_['map'](_0x2662e9[_0xdcd9('0x1e')],function(_0x4709bd){return{'model':db[_0x4709bd[_0xdcd9('0x1f')]],'as':_0x4709bd['as'],'attributes':_0x4709bd['attributes'],'include':_0x4709bd[_0xdcd9('0x1e')]?_[_0xdcd9('0x1d')](_0x4709bd[_0xdcd9('0x1e')],function(_0x2270ed){return{'model':db[_0x2270ed['model']],'as':_0x2270ed['as'],'attributes':_0x2270ed[_0xdcd9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdcd9('0xd')](function(_0x90df46){logger[_0xdcd9('0xe')](_0xdcd9('0x16'),_0xaff3d0);logger[_0xdcd9('0x20')](_0xdcd9('0x16'),_0xaff3d0,JSON[_0xdcd9('0x11')](_0x90df46));_0x39efff(_0x90df46);})[_0xdcd9('0x21')](function(_0x577252){logger[_0xdcd9('0x12')](_0xdcd9('0x16'),_0x577252['message'],_0xaff3d0);_0x4d2bad(_0x3ba244[_0xdcd9('0x12')](0x1f4,_0x577252[_0xdcd9('0x14')]));});});};exports[_0xdcd9('0x22')]=function(_0x15796a){var _0x5e45f6=this;return new Promise(function(_0xb077d,_0x18864a){return db['SugarcrmAccount'][_0xdcd9('0x23')]({'raw':_0x15796a[_0xdcd9('0x19')]?_0x15796a['options'][_0xdcd9('0x1a')]===undefined?!![]:![]:!![],'where':_0x15796a[_0xdcd9('0x19')]?_0x15796a['options'][_0xdcd9('0x1b')]||null:null,'attributes':_0x15796a[_0xdcd9('0x19')]?_0x15796a['options'][_0xdcd9('0x1c')]||null:null,'include':_0x15796a[_0xdcd9('0x19')]?_0x15796a[_0xdcd9('0x19')]['include']?_['map'](_0x15796a[_0xdcd9('0x19')][_0xdcd9('0x1e')],function(_0x43ee44){return{'model':db[_0x43ee44[_0xdcd9('0x1f')]],'as':_0x43ee44['as'],'attributes':_0x43ee44[_0xdcd9('0x1c')],'include':_0x43ee44[_0xdcd9('0x1e')]?_['map'](_0x43ee44[_0xdcd9('0x1e')],function(_0x540cb8){return{'model':db[_0x540cb8[_0xdcd9('0x1f')]],'as':_0x540cb8['as'],'attributes':_0x540cb8['attributes'],'include':_0x540cb8['include']?_['map'](_0x540cb8[_0xdcd9('0x1e')],function(_0x5f2a7b){return{'model':db[_0x5f2a7b[_0xdcd9('0x1f')]],'as':_0x5f2a7b['as'],'attributes':_0x5f2a7b[_0xdcd9('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdcd9('0xd')](function(_0x2a9815){logger[_0xdcd9('0xe')](_0xdcd9('0x22'),_0x15796a);logger[_0xdcd9('0x20')](_0xdcd9('0x22'),_0x15796a,JSON[_0xdcd9('0x11')](_0x2a9815));_0xb077d(_0x2a9815);})['catch'](function(_0x3dff77){logger[_0xdcd9('0x12')](_0xdcd9('0x22'),_0x3dff77['message'],_0x15796a);_0x18864a(_0x5e45f6[_0xdcd9('0x12')](0x1f4,_0x3dff77[_0xdcd9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a1ebea4..2b0a0ae 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 _0xefdd=['get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller'];(function(_0x49ee44,_0x3cfc78){var _0x10b2bb=function(_0x2e7b27){while(--_0x2e7b27){_0x49ee44['push'](_0x49ee44['shift']());}};_0x10b2bb(++_0x3cfc78);}(_0xefdd,0x141));var _0xdefd=function(_0x48c510,_0x3989e1){_0x48c510=_0x48c510-0x0;var _0x54697c=_0xefdd[_0x48c510];return _0x54697c;};'use strict';var multer=require(_0xdefd('0x0'));var util=require(_0xdefd('0x1'));var path=require(_0xdefd('0x2'));var timeout=require(_0xdefd('0x3'));var express=require('express');var router=express[_0xdefd('0x4')]();var auth=require(_0xdefd('0x5'));var interaction=require(_0xdefd('0x6'));var config=require(_0xdefd('0x7'));var controller=require(_0xdefd('0x8'));router[_0xdefd('0x9')]('/',auth[_0xdefd('0xa')](),controller[_0xdefd('0xb')]);router['get'](_0xdefd('0xc'),auth[_0xdefd('0xa')](),controller['show']);router[_0xdefd('0x9')](_0xdefd('0xd'),auth[_0xdefd('0xa')](),controller[_0xdefd('0xe')]);router[_0xdefd('0x9')](_0xdefd('0xf'),auth[_0xdefd('0xa')](),controller['getSubjects']);router[_0xdefd('0x9')](_0xdefd('0x10'),auth[_0xdefd('0xa')](),controller[_0xdefd('0x11')]);router['post']('/',auth[_0xdefd('0xa')](),controller[_0xdefd('0x12')]);router[_0xdefd('0x13')](_0xdefd('0xc'),auth[_0xdefd('0xa')](),controller['update']);router[_0xdefd('0x14')](_0xdefd('0xc'),auth[_0xdefd('0xa')](),controller['destroy']);module[_0xdefd('0x15')]=router; \ No newline at end of file +var _0x488f=['Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','exports','multer','util','express'];(function(_0x2ac1ca,_0x1e47d4){var _0x596155=function(_0x374f16){while(--_0x374f16){_0x2ac1ca['push'](_0x2ac1ca['shift']());}};_0x596155(++_0x1e47d4);}(_0x488f,0xfa));var _0xf488=function(_0x5869ed,_0x2d1f78){_0x5869ed=_0x5869ed-0x0;var _0x33c0af=_0x488f[_0x5869ed];return _0x33c0af;};'use strict';var multer=require(_0xf488('0x0'));var util=require(_0xf488('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf488('0x2'));var router=express[_0xf488('0x3')]();var auth=require(_0xf488('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf488('0x5'));var controller=require(_0xf488('0x6'));router[_0xf488('0x7')]('/',auth[_0xf488('0x8')](),controller[_0xf488('0x9')]);router[_0xf488('0x7')](_0xf488('0xa'),auth['isAuthenticated'](),controller[_0xf488('0xb')]);router[_0xf488('0x7')](_0xf488('0xc'),auth[_0xf488('0x8')](),controller[_0xf488('0xd')]);router[_0xf488('0x7')](_0xf488('0xe'),auth[_0xf488('0x8')](),controller['getSubjects']);router[_0xf488('0x7')](_0xf488('0xf'),auth[_0xf488('0x8')](),controller[_0xf488('0x10')]);router[_0xf488('0x11')]('/',auth[_0xf488('0x8')](),controller[_0xf488('0x12')]);router[_0xf488('0x13')]('/:id',auth[_0xf488('0x8')](),controller[_0xf488('0x14')]);router[_0xf488('0x15')](_0xf488('0xa'),auth[_0xf488('0x8')](),controller['destroy']);module[_0xf488('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 0a61ce6..6d76716 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 _0x2365=['exports','STRING','sequelize'];(function(_0x282516,_0x433430){var _0x311feb=function(_0x23202f){while(--_0x23202f){_0x282516['push'](_0x282516['shift']());}};_0x311feb(++_0x433430);}(_0x2365,0x19a));var _0x5236=function(_0xfa631c,_0x3d9ca6){_0xfa631c=_0xfa631c-0x0;var _0x136ba4=_0x2365[_0xfa631c];return _0x136ba4;};'use strict';var Sequelize=require(_0x5236('0x0'));module[_0x5236('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5236('0x2')]}}; \ No newline at end of file +var _0xab39=['STRING','exports'];(function(_0x5de533,_0x47515a){var _0x25568a=function(_0x1d7c51){while(--_0x1d7c51){_0x5de533['push'](_0x5de533['shift']());}};_0x25568a(++_0x47515a);}(_0xab39,0x9f));var _0x9ab3=function(_0x2cc19d,_0x33d00f){_0x2cc19d=_0x2cc19d-0x0;var _0x37278f=_0xab39[_0x2cc19d];return _0x37278f;};'use strict';var Sequelize=require('sequelize');module[_0x9ab3('0x0')]={'name':{'type':Sequelize[_0x9ab3('0x1')]},'description':{'type':Sequelize[_0x9ab3('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 9d6f28c..bf438cb 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 _0x248a=['merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','destroy','getFields','hasOwnProperty','getSubjects','SugarcrmField','findOne','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','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','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter'];(function(_0x413663,_0x2bd760){var _0x7f3df8=function(_0x370fb0){while(--_0x370fb0){_0x413663['push'](_0x413663['shift']());}};_0x7f3df8(++_0x2bd760);}(_0x248a,0xd0));var _0xa248=function(_0x28f402,_0x5aec8a){_0x28f402=_0x28f402-0x0;var _0x498203=_0x248a[_0x28f402];return _0x498203;};'use strict';var pdf=require(_0xa248('0x0'));var emlformat=require(_0xa248('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa248('0x2'));var jsonpatch=require(_0xa248('0x3'));var rp=require(_0xa248('0x4'));var moment=require('moment');var BPromise=require(_0xa248('0x5'));var Mustache=require('mustache');var util=require(_0xa248('0x6'));var path=require('path');var sox=require(_0xa248('0x7'));var csv=require('to-csv');var ejs=require(_0xa248('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa248('0x9'));var jsforce=require(_0xa248('0xa'));var deskjs=require(_0xa248('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa248('0xc'));var Redis=require(_0xa248('0xd'));var authService=require(_0xa248('0xe'));var qs=require(_0xa248('0xf'));var as=require(_0xa248('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa248('0x11'))(_0xa248('0x12'));var utils=require(_0xa248('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xa248('0x14'));var client=jayson[_0xa248('0x15')][_0xa248('0x16')]({'port':0x232a});function checkPasswordPattern(_0x5ea628,_0xbce74e,_0x2a5ffa){if(_0x2a5ffa){var _0x1c4dda=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c4dda[_0xa248('0x17')](_0xbce74e)){return _0x5ea628;}else{throw new db[(_0xa248('0x18'))]['ValidationError'](_0xa248('0x19'));}}else{return _0x5ea628;}}function respondWithRpcPromise(_0x4c91eb,_0x250900,_0x75f815,_0x7c79b1){return new BPromise(function(_0xb185a,_0x431a98){var _0x105e3f=_0x7c79b1||client;return _0x105e3f[_0xa248('0x1a')](_0x4c91eb,_0x75f815)[_0xa248('0x1b')](function(_0x2aa938){logger[_0xa248('0x1c')](_0xa248('0x1d'),_0x250900,'request\x20sent');logger[_0xa248('0x1e')](_0xa248('0x1f'),_0x250900,_0xa248('0x20'),JSON[_0xa248('0x21')](_0x2aa938));if(_0x2aa938[_0xa248('0x22')]){if(_0x2aa938[_0xa248('0x22')][_0xa248('0x23')]===0x1f4){logger[_0xa248('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x250900,_0x2aa938[_0xa248('0x22')][_0xa248('0x24')]);return _0x431a98(_0x2aa938[_0xa248('0x22')]['message']);}logger[_0xa248('0x22')](_0xa248('0x1d'),_0x250900,_0x2aa938[_0xa248('0x22')][_0xa248('0x24')]);return _0xb185a(_0x2aa938[_0xa248('0x22')][_0xa248('0x24')]);}else{logger[_0xa248('0x1c')](_0xa248('0x1d'),_0x250900,'request\x20sent');_0xb185a(_0x2aa938[_0xa248('0x25')][_0xa248('0x24')]);}})[_0xa248('0x26')](function(_0x820729){logger[_0xa248('0x22')](_0xa248('0x1d'),_0x250900,_0x820729);_0x431a98(_0x820729);});});}function respondWithStatusCode(_0x27e15d,_0x5bea77){_0x5bea77=_0x5bea77||0xcc;return function(_0x3c3e94){if(_0x3c3e94){return _0x27e15d[_0xa248('0x27')](_0x5bea77);}return _0x27e15d[_0xa248('0x28')](_0x5bea77)[_0xa248('0x29')]();};}function respondWithResult(_0x179ff6,_0x1b9df8){_0x1b9df8=_0x1b9df8||0xc8;return function(_0x24719a){if(_0x24719a){return _0x179ff6[_0xa248('0x28')](_0x1b9df8)['json'](_0x24719a);}};}function respondWithFilteredResult(_0x5ef01d,_0xcdbbb4){return function(_0x2ebc2c){if(_0x2ebc2c){var _0x10d8b1=_0x2ebc2c[_0xa248('0x2a')],_0x1cb27c=_0xcdbbb4[_0xa248('0x2b')],_0x2d66df=_0xcdbbb4[_0xa248('0x2b')]+_0xcdbbb4[_0xa248('0x2c')],_0x44024f;if(_0x2d66df>=_0x10d8b1){_0x2d66df=_0x10d8b1;_0x44024f=0xc8;}else{_0x44024f=0xce;}_0x5ef01d[_0xa248('0x28')](_0x44024f);return _0x5ef01d[_0xa248('0x2d')](_0xa248('0x2e'),_0x1cb27c+'-'+_0x2d66df+'/'+_0x10d8b1)['json'](_0x2ebc2c);}return null;};}function patchUpdates(_0x5952e9){return function(_0x10629f){try{jsonpatch[_0xa248('0x2f')](_0x10629f,_0x5952e9,!![]);}catch(_0x1f073f){return BPromise[_0xa248('0x30')](_0x1f073f);}return _0x10629f[_0xa248('0x31')]();};}function saveUpdates(_0x5a7450,_0x253178){return function(_0x4a150e){if(_0x4a150e){return _0x4a150e[_0xa248('0x32')](_0x5a7450)[_0xa248('0x1b')](function(_0x4f4655){return _0x4f4655;});}return null;};}function removeEntity(_0x55a641,_0x16055d){return function(_0x5e871f){if(_0x5e871f){return _0x5e871f['destroy']()[_0xa248('0x1b')](function(){_0x55a641[_0xa248('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x196d71,_0x3e551d){return function(_0x483d51){if(!_0x483d51){_0x196d71[_0xa248('0x27')](0x194);}return _0x483d51;};}function handleError(_0x3d00ca,_0x4588bd){_0x4588bd=_0x4588bd||0x1f4;return function(_0x48113a){logger['error'](_0x48113a[_0xa248('0x33')]);if(_0x48113a[_0xa248('0x34')]){delete _0x48113a[_0xa248('0x34')];}_0x3d00ca[_0xa248('0x28')](_0x4588bd)[_0xa248('0x35')](_0x48113a);};}exports[_0xa248('0x36')]=function(_0x5459ef,_0x51679e){var _0x34e48a={},_0x38fa4b={},_0x335689={'count':0x0,'rows':[]};var _0xef2b68=_[_0xa248('0x37')](db[_0xa248('0x38')]['rawAttributes'],function(_0x4f0b8f){return{'name':_0x4f0b8f[_0xa248('0x39')],'type':_0x4f0b8f[_0xa248('0x3a')][_0xa248('0x3b')]};});_0x38fa4b[_0xa248('0x3c')]=_[_0xa248('0x37')](_0xef2b68,_0xa248('0x34'));_0x38fa4b[_0xa248('0x3d')]=_[_0xa248('0x3e')](_0x5459ef[_0xa248('0x3d')]);_0x38fa4b['filters']=_[_0xa248('0x3f')](_0x38fa4b['model'],_0x38fa4b[_0xa248('0x3d')]);_0x34e48a[_0xa248('0x40')]=_[_0xa248('0x3f')](_0x38fa4b[_0xa248('0x3c')],qs[_0xa248('0x41')](_0x5459ef[_0xa248('0x3d')]['fields']));_0x34e48a['attributes']=_0x34e48a[_0xa248('0x40')][_0xa248('0x42')]?_0x34e48a[_0xa248('0x40')]:_0x38fa4b[_0xa248('0x3c')];if(!_0x5459ef[_0xa248('0x3d')]['hasOwnProperty'](_0xa248('0x43'))){_0x34e48a[_0xa248('0x2c')]=qs[_0xa248('0x2c')](_0x5459ef['query'][_0xa248('0x2c')]);_0x34e48a[_0xa248('0x2b')]=qs[_0xa248('0x2b')](_0x5459ef[_0xa248('0x3d')][_0xa248('0x2b')]);}_0x34e48a[_0xa248('0x44')]=qs[_0xa248('0x45')](_0x5459ef[_0xa248('0x3d')][_0xa248('0x45')]);_0x34e48a[_0xa248('0x46')]=qs[_0xa248('0x47')](_[_0xa248('0x48')](_0x5459ef[_0xa248('0x3d')],_0x38fa4b[_0xa248('0x47')]),_0xef2b68);if(_0x5459ef['query'][_0xa248('0x49')]){_0x34e48a['where']=_[_0xa248('0x4a')](_0x34e48a['where'],{'$or':_[_0xa248('0x37')](_0xef2b68,function(_0xd47270){if(_0xd47270[_0xa248('0x3a')]!==_0xa248('0x4b')){var _0x19131c={};_0x19131c[_0xd47270[_0xa248('0x34')]]={'$like':'%'+_0x5459ef[_0xa248('0x3d')][_0xa248('0x49')]+'%'};return _0x19131c;}})});}_0x34e48a=_['merge']({},_0x34e48a,_0x5459ef[_0xa248('0x4c')]);var _0x3e8ffc={'where':_0x34e48a[_0xa248('0x46')]};return db[_0xa248('0x38')]['count'](_0x3e8ffc)[_0xa248('0x1b')](function(_0x19204d){_0x335689['count']=_0x19204d;if(_0x5459ef[_0xa248('0x3d')][_0xa248('0x4d')]){_0x34e48a[_0xa248('0x4e')]=[{'all':!![]}];}return db[_0xa248('0x38')][_0xa248('0x4f')](_0x34e48a);})['then'](function(_0x5cfff6){_0x335689[_0xa248('0x50')]=_0x5cfff6;return _0x335689;})[_0xa248('0x1b')](respondWithFilteredResult(_0x51679e,_0x34e48a))[_0xa248('0x26')](handleError(_0x51679e,null));};exports[_0xa248('0x51')]=function(_0x358522,_0x41ec38){var _0x4069b6={'raw':![],'where':{'id':_0x358522[_0xa248('0x52')]['id']}},_0x450b37={};_0x450b37[_0xa248('0x3c')]=_[_0xa248('0x3e')](db[_0xa248('0x38')][_0xa248('0x53')]);_0x450b37[_0xa248('0x3d')]=_[_0xa248('0x3e')](_0x358522[_0xa248('0x3d')]);_0x450b37[_0xa248('0x47')]=_[_0xa248('0x3f')](_0x450b37[_0xa248('0x3c')],_0x450b37[_0xa248('0x3d')]);_0x4069b6[_0xa248('0x40')]=_[_0xa248('0x3f')](_0x450b37[_0xa248('0x3c')],qs[_0xa248('0x41')](_0x358522['query'][_0xa248('0x41')]));_0x4069b6[_0xa248('0x40')]=_0x4069b6[_0xa248('0x40')][_0xa248('0x42')]?_0x4069b6[_0xa248('0x40')]:_0x450b37[_0xa248('0x3c')];if(_0x358522[_0xa248('0x3d')]['includeAll']){_0x4069b6[_0xa248('0x4e')]=[{'all':!![]}];}_0x4069b6=_[_0xa248('0x4a')]({},_0x4069b6,_0x358522[_0xa248('0x4c')]);return db['SugarcrmConfiguration'][_0xa248('0x54')](_0x4069b6)[_0xa248('0x1b')](handleEntityNotFound(_0x41ec38,null))[_0xa248('0x1b')](respondWithResult(_0x41ec38,null))[_0xa248('0x26')](handleError(_0x41ec38,null));};exports['create']=function(_0x53629b,_0x21f435){return db['SugarcrmConfiguration'][_0xa248('0x55')](_0x53629b[_0xa248('0x56')],{})[_0xa248('0x1b')](respondWithResult(_0x21f435,0xc9))[_0xa248('0x26')](handleError(_0x21f435,null));};exports[_0xa248('0x32')]=function(_0x9b8594,_0x5a757f){if(_0x9b8594[_0xa248('0x56')]['id']){delete _0x9b8594[_0xa248('0x56')]['id'];}return db[_0xa248('0x38')]['find']({'where':{'id':_0x9b8594[_0xa248('0x52')]['id']}})[_0xa248('0x1b')](handleEntityNotFound(_0x5a757f,null))['then'](saveUpdates(_0x9b8594[_0xa248('0x56')],null))[_0xa248('0x1b')](respondWithResult(_0x5a757f,null))[_0xa248('0x26')](handleError(_0x5a757f,null));};exports[_0xa248('0x57')]=function(_0x30c441,_0x3b16b2){return db[_0xa248('0x38')][_0xa248('0x54')]({'where':{'id':_0x30c441['params']['id']}})[_0xa248('0x1b')](handleEntityNotFound(_0x3b16b2,null))['then'](removeEntity(_0x3b16b2,null))['catch'](handleError(_0x3b16b2,null));};exports[_0xa248('0x58')]=function(_0x341e5e,_0x569a4c,_0x5a5f61){var _0xb4d388={};var _0x5f3e9c={};var _0x261c35;var _0x1a53fb;return db[_0xa248('0x38')]['findOne']({'where':{'id':_0x341e5e['params']['id']}})[_0xa248('0x1b')](handleEntityNotFound(_0x569a4c,null))['then'](function(_0x3533a9){if(_0x3533a9){_0x261c35=_0x3533a9;_0x5f3e9c['model']=_[_0xa248('0x3e')](db['SugarcrmField'][_0xa248('0x53')]);_0x5f3e9c[_0xa248('0x3d')]=_[_0xa248('0x3e')](_0x341e5e[_0xa248('0x3d')]);_0x5f3e9c[_0xa248('0x47')]=_[_0xa248('0x3f')](_0x5f3e9c[_0xa248('0x3c')],_0x5f3e9c[_0xa248('0x3d')]);_0xb4d388[_0xa248('0x40')]=_[_0xa248('0x3f')](_0x5f3e9c[_0xa248('0x3c')],qs[_0xa248('0x41')](_0x341e5e[_0xa248('0x3d')]['fields']));_0xb4d388[_0xa248('0x40')]=_0xb4d388[_0xa248('0x40')][_0xa248('0x42')]?_0xb4d388[_0xa248('0x40')]:_0x5f3e9c[_0xa248('0x3c')];_0xb4d388[_0xa248('0x44')]=qs['sort'](_0x341e5e['query'][_0xa248('0x45')]);_0xb4d388[_0xa248('0x46')]=qs[_0xa248('0x47')](_[_0xa248('0x48')](_0x341e5e[_0xa248('0x3d')],_0x5f3e9c[_0xa248('0x47')]));if(_0x341e5e['query']['filter']){_0xb4d388['where']=_[_0xa248('0x4a')](_0xb4d388[_0xa248('0x46')],{'$or':_[_0xa248('0x37')](_0xb4d388[_0xa248('0x40')],function(_0x1cfe98){var _0x201cf9={};_0x201cf9[_0x1cfe98]={'$like':'%'+_0x341e5e[_0xa248('0x3d')][_0xa248('0x49')]+'%'};return _0x201cf9;})});}_0xb4d388=_[_0xa248('0x4a')]({},_0xb4d388,_0x341e5e[_0xa248('0x4c')]);return _0x261c35['getFields'](_0xb4d388);}})[_0xa248('0x1b')](function(_0x214c2e){if(_0x214c2e){_0x1a53fb=_0x214c2e[_0xa248('0x42')];if(!_0x341e5e[_0xa248('0x3d')][_0xa248('0x59')](_0xa248('0x43'))){_0xb4d388[_0xa248('0x2c')]=qs[_0xa248('0x2c')](_0x341e5e['query']['limit']);_0xb4d388[_0xa248('0x2b')]=qs[_0xa248('0x2b')](_0x341e5e[_0xa248('0x3d')][_0xa248('0x2b')]);}return _0x261c35['getFields'](_0xb4d388);}})[_0xa248('0x1b')](function(_0x39a038){if(_0x39a038){return _0x39a038?{'count':_0x1a53fb,'rows':_0x39a038}:null;}})[_0xa248('0x1b')](respondWithResult(_0x569a4c,null))[_0xa248('0x26')](handleError(_0x569a4c,null));};exports[_0xa248('0x5a')]=function(_0x2f7777,_0x2f5d1f,_0x2f5612){var _0x33c98c={};var _0x472a0f={};var _0x2cf244;var _0x54fab1;return db[_0xa248('0x38')]['findOne']({'where':{'id':_0x2f7777[_0xa248('0x52')]['id']}})[_0xa248('0x1b')](handleEntityNotFound(_0x2f5d1f,null))[_0xa248('0x1b')](function(_0x17fcab){if(_0x17fcab){_0x2cf244=_0x17fcab;_0x472a0f[_0xa248('0x3c')]=_[_0xa248('0x3e')](db[_0xa248('0x5b')][_0xa248('0x53')]);_0x472a0f[_0xa248('0x3d')]=_[_0xa248('0x3e')](_0x2f7777[_0xa248('0x3d')]);_0x472a0f['filters']=_[_0xa248('0x3f')](_0x472a0f[_0xa248('0x3c')],_0x472a0f[_0xa248('0x3d')]);_0x33c98c[_0xa248('0x40')]=_[_0xa248('0x3f')](_0x472a0f['model'],qs[_0xa248('0x41')](_0x2f7777[_0xa248('0x3d')][_0xa248('0x41')]));_0x33c98c[_0xa248('0x40')]=_0x33c98c[_0xa248('0x40')][_0xa248('0x42')]?_0x33c98c[_0xa248('0x40')]:_0x472a0f['model'];_0x33c98c[_0xa248('0x44')]=qs[_0xa248('0x45')](_0x2f7777[_0xa248('0x3d')]['sort']);_0x33c98c['where']=qs[_0xa248('0x47')](_[_0xa248('0x48')](_0x2f7777[_0xa248('0x3d')],_0x472a0f[_0xa248('0x47')]));if(_0x2f7777[_0xa248('0x3d')][_0xa248('0x49')]){_0x33c98c['where']=_[_0xa248('0x4a')](_0x33c98c[_0xa248('0x46')],{'$or':_[_0xa248('0x37')](_0x33c98c[_0xa248('0x40')],function(_0x20773e){var _0x418d86={};_0x418d86[_0x20773e]={'$like':'%'+_0x2f7777[_0xa248('0x3d')]['filter']+'%'};return _0x418d86;})});}_0x33c98c=_[_0xa248('0x4a')]({},_0x33c98c,_0x2f7777['options']);return _0x2cf244[_0xa248('0x5a')](_0x33c98c);}})[_0xa248('0x1b')](function(_0x3c2937){if(_0x3c2937){_0x54fab1=_0x3c2937[_0xa248('0x42')];if(!_0x2f7777[_0xa248('0x3d')][_0xa248('0x59')](_0xa248('0x43'))){_0x33c98c[_0xa248('0x2c')]=qs[_0xa248('0x2c')](_0x2f7777[_0xa248('0x3d')][_0xa248('0x2c')]);_0x33c98c[_0xa248('0x2b')]=qs[_0xa248('0x2b')](_0x2f7777[_0xa248('0x3d')][_0xa248('0x2b')]);}return _0x2cf244[_0xa248('0x5a')](_0x33c98c);}})['then'](function(_0x42b8d8){if(_0x42b8d8){return _0x42b8d8?{'count':_0x54fab1,'rows':_0x42b8d8}:null;}})['then'](respondWithResult(_0x2f5d1f,null))[_0xa248('0x26')](handleError(_0x2f5d1f,null));};exports['getDescriptions']=function(_0x2172e7,_0x27773c,_0x22229a){var _0x26a863={};var _0x594187={};var _0x3e81d9;var _0x3fabe0;return db['SugarcrmConfiguration'][_0xa248('0x5c')]({'where':{'id':_0x2172e7['params']['id']}})[_0xa248('0x1b')](handleEntityNotFound(_0x27773c,null))['then'](function(_0x415615){if(_0x415615){_0x3e81d9=_0x415615;_0x594187[_0xa248('0x3c')]=_[_0xa248('0x3e')](db['SugarcrmField'][_0xa248('0x53')]);_0x594187[_0xa248('0x3d')]=_[_0xa248('0x3e')](_0x2172e7[_0xa248('0x3d')]);_0x594187[_0xa248('0x47')]=_[_0xa248('0x3f')](_0x594187['model'],_0x594187[_0xa248('0x3d')]);_0x26a863[_0xa248('0x40')]=_[_0xa248('0x3f')](_0x594187['model'],qs[_0xa248('0x41')](_0x2172e7[_0xa248('0x3d')][_0xa248('0x41')]));_0x26a863['attributes']=_0x26a863[_0xa248('0x40')][_0xa248('0x42')]?_0x26a863[_0xa248('0x40')]:_0x594187[_0xa248('0x3c')];_0x26a863['order']=qs['sort'](_0x2172e7['query'][_0xa248('0x45')]);_0x26a863[_0xa248('0x46')]=qs[_0xa248('0x47')](_[_0xa248('0x48')](_0x2172e7[_0xa248('0x3d')],_0x594187[_0xa248('0x47')]));if(_0x2172e7[_0xa248('0x3d')][_0xa248('0x49')]){_0x26a863[_0xa248('0x46')]=_[_0xa248('0x4a')](_0x26a863[_0xa248('0x46')],{'$or':_['map'](_0x26a863[_0xa248('0x40')],function(_0x2f50b9){var _0x59742e={};_0x59742e[_0x2f50b9]={'$like':'%'+_0x2172e7[_0xa248('0x3d')][_0xa248('0x49')]+'%'};return _0x59742e;})});}_0x26a863=_['merge']({},_0x26a863,_0x2172e7[_0xa248('0x4c')]);return _0x3e81d9[_0xa248('0x5d')](_0x26a863);}})[_0xa248('0x1b')](function(_0x454508){if(_0x454508){_0x3fabe0=_0x454508[_0xa248('0x42')];if(!_0x2172e7['query'][_0xa248('0x59')](_0xa248('0x43'))){_0x26a863[_0xa248('0x2c')]=qs[_0xa248('0x2c')](_0x2172e7[_0xa248('0x3d')]['limit']);_0x26a863[_0xa248('0x2b')]=qs['offset'](_0x2172e7['query']['offset']);}return _0x3e81d9[_0xa248('0x5d')](_0x26a863);}})[_0xa248('0x1b')](function(_0x4f5740){if(_0x4f5740){return _0x4f5740?{'count':_0x3fabe0,'rows':_0x4f5740}:null;}})[_0xa248('0x1b')](respondWithResult(_0x27773c,null))['catch'](handleError(_0x27773c,null));}; \ No newline at end of file +var _0xf5ff=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','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~!@#$%^&-_=+[{]}.','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','Content-Range','apply','save','update','end','stack','name','send','index','rawAttributes','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','SugarcrmConfiguration','findAll','rows','show','params','includeAll','create','body','find','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf'];(function(_0x3b46e0,_0x4ffb58){var _0x5a3eee=function(_0x4849fc){while(--_0x4849fc){_0x3b46e0['push'](_0x3b46e0['shift']());}};_0x5a3eee(++_0x4ffb58);}(_0xf5ff,0xaf));var _0xff5f=function(_0x2004c7,_0x423b09){_0x2004c7=_0x2004c7-0x0;var _0x51cd7a=_0xf5ff[_0x2004c7];return _0x51cd7a;};'use strict';var pdf=require(_0xff5f('0x0'));var emlformat=require(_0xff5f('0x1'));var rimraf=require(_0xff5f('0x2'));var zipdir=require(_0xff5f('0x3'));var jsonpatch=require(_0xff5f('0x4'));var rp=require(_0xff5f('0x5'));var moment=require(_0xff5f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xff5f('0x7'));var util=require(_0xff5f('0x8'));var path=require(_0xff5f('0x9'));var sox=require('sox');var csv=require(_0xff5f('0xa'));var ejs=require(_0xff5f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xff5f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xff5f('0xa'));var querystring=require('querystring');var Papa=require(_0xff5f('0xd'));var Redis=require(_0xff5f('0xe'));var authService=require(_0xff5f('0xf'));var qs=require(_0xff5f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff5f('0x11'));var logger=require(_0xff5f('0x12'))(_0xff5f('0x13'));var utils=require('../../config/utils');var config=require(_0xff5f('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xff5f('0x15'));var client=jayson[_0xff5f('0x16')][_0xff5f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x552e0a,_0x4ebfea,_0x2a4876){if(_0x2a4876){var _0x304d11=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x304d11['test'](_0x4ebfea)){return _0x552e0a;}else{throw new db[(_0xff5f('0x18'))][(_0xff5f('0x19'))](_0xff5f('0x1a'));}}else{return _0x552e0a;}}function respondWithRpcPromise(_0x57e556,_0x540d33,_0x38fc8e,_0x3fded9){return new BPromise(function(_0x926e94,_0x3c86e1){var _0x5391f7=_0x3fded9||client;return _0x5391f7['request'](_0x57e556,_0x38fc8e)[_0xff5f('0x1b')](function(_0x1b1841){logger[_0xff5f('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x540d33,'request\x20sent');logger[_0xff5f('0x1d')](_0xff5f('0x1e'),_0x540d33,_0xff5f('0x1f'),JSON['stringify'](_0x1b1841));if(_0x1b1841['error']){if(_0x1b1841[_0xff5f('0x20')][_0xff5f('0x21')]===0x1f4){logger[_0xff5f('0x20')](_0xff5f('0x22'),_0x540d33,_0x1b1841[_0xff5f('0x20')][_0xff5f('0x23')]);return _0x3c86e1(_0x1b1841['error'][_0xff5f('0x23')]);}logger[_0xff5f('0x20')](_0xff5f('0x22'),_0x540d33,_0x1b1841[_0xff5f('0x20')][_0xff5f('0x23')]);return _0x926e94(_0x1b1841[_0xff5f('0x20')][_0xff5f('0x23')]);}else{logger[_0xff5f('0x1c')](_0xff5f('0x22'),_0x540d33,'request\x20sent');_0x926e94(_0x1b1841['result'][_0xff5f('0x23')]);}})[_0xff5f('0x24')](function(_0x1f5469){logger['error'](_0xff5f('0x22'),_0x540d33,_0x1f5469);_0x3c86e1(_0x1f5469);});});}function respondWithStatusCode(_0x5d91ce,_0xe44095){_0xe44095=_0xe44095||0xcc;return function(_0x7e3ddc){if(_0x7e3ddc){return _0x5d91ce[_0xff5f('0x25')](_0xe44095);}return _0x5d91ce[_0xff5f('0x26')](_0xe44095)['end']();};}function respondWithResult(_0x25e245,_0x74d8ac){_0x74d8ac=_0x74d8ac||0xc8;return function(_0x20fe5d){if(_0x20fe5d){return _0x25e245[_0xff5f('0x26')](_0x74d8ac)[_0xff5f('0x27')](_0x20fe5d);}};}function respondWithFilteredResult(_0x3287c2,_0x330293){return function(_0x431713){if(_0x431713){var _0x589473=_0x431713[_0xff5f('0x28')],_0x1af7b6=_0x330293[_0xff5f('0x29')],_0x1112cd=_0x330293[_0xff5f('0x29')]+_0x330293['limit'],_0x4cf852;if(_0x1112cd>=_0x589473){_0x1112cd=_0x589473;_0x4cf852=0xc8;}else{_0x4cf852=0xce;}_0x3287c2[_0xff5f('0x26')](_0x4cf852);return _0x3287c2['set'](_0xff5f('0x2a'),_0x1af7b6+'-'+_0x1112cd+'/'+_0x589473)['json'](_0x431713);}return null;};}function patchUpdates(_0x427868){return function(_0x2bfd38){try{jsonpatch[_0xff5f('0x2b')](_0x2bfd38,_0x427868,!![]);}catch(_0x15632f){return BPromise['reject'](_0x15632f);}return _0x2bfd38[_0xff5f('0x2c')]();};}function saveUpdates(_0x38ab17,_0x6fb56f){return function(_0x364f89){if(_0x364f89){return _0x364f89[_0xff5f('0x2d')](_0x38ab17)[_0xff5f('0x1b')](function(_0x483c06){return _0x483c06;});}return null;};}function removeEntity(_0x146215,_0x5d5f89){return function(_0x484de6){if(_0x484de6){return _0x484de6['destroy']()['then'](function(){_0x146215['status'](0xcc)[_0xff5f('0x2e')]();});}};}function handleEntityNotFound(_0x3d1a55,_0x22142f){return function(_0x2a34cb){if(!_0x2a34cb){_0x3d1a55['sendStatus'](0x194);}return _0x2a34cb;};}function handleError(_0x4307dc,_0x357857){_0x357857=_0x357857||0x1f4;return function(_0x2d5c7e){logger['error'](_0x2d5c7e[_0xff5f('0x2f')]);if(_0x2d5c7e[_0xff5f('0x30')]){delete _0x2d5c7e[_0xff5f('0x30')];}_0x4307dc['status'](_0x357857)[_0xff5f('0x31')](_0x2d5c7e);};}exports[_0xff5f('0x32')]=function(_0x8cb710,_0x1e5df7){var _0x23753a={},_0x8d0229={},_0x34b252={'count':0x0,'rows':[]};var _0x4fe350=_['map'](db['SugarcrmConfiguration'][_0xff5f('0x33')],function(_0x1afc50){return{'name':_0x1afc50['fieldName'],'type':_0x1afc50[_0xff5f('0x34')]['key']};});_0x8d0229[_0xff5f('0x35')]=_[_0xff5f('0x36')](_0x4fe350,_0xff5f('0x30'));_0x8d0229[_0xff5f('0x37')]=_[_0xff5f('0x38')](_0x8cb710[_0xff5f('0x37')]);_0x8d0229['filters']=_[_0xff5f('0x39')](_0x8d0229[_0xff5f('0x35')],_0x8d0229['query']);_0x23753a['attributes']=_[_0xff5f('0x39')](_0x8d0229[_0xff5f('0x35')],qs[_0xff5f('0x3a')](_0x8cb710[_0xff5f('0x37')][_0xff5f('0x3a')]));_0x23753a['attributes']=_0x23753a[_0xff5f('0x3b')][_0xff5f('0x3c')]?_0x23753a[_0xff5f('0x3b')]:_0x8d0229[_0xff5f('0x35')];if(!_0x8cb710[_0xff5f('0x37')][_0xff5f('0x3d')](_0xff5f('0x3e'))){_0x23753a[_0xff5f('0x3f')]=qs[_0xff5f('0x3f')](_0x8cb710['query'][_0xff5f('0x3f')]);_0x23753a[_0xff5f('0x29')]=qs['offset'](_0x8cb710[_0xff5f('0x37')][_0xff5f('0x29')]);}_0x23753a[_0xff5f('0x40')]=qs[_0xff5f('0x41')](_0x8cb710[_0xff5f('0x37')][_0xff5f('0x41')]);_0x23753a[_0xff5f('0x42')]=qs[_0xff5f('0x43')](_[_0xff5f('0x44')](_0x8cb710[_0xff5f('0x37')],_0x8d0229[_0xff5f('0x43')]),_0x4fe350);if(_0x8cb710['query'][_0xff5f('0x45')]){_0x23753a[_0xff5f('0x42')]=_[_0xff5f('0x46')](_0x23753a[_0xff5f('0x42')],{'$or':_[_0xff5f('0x36')](_0x4fe350,function(_0x48e4b9){if(_0x48e4b9[_0xff5f('0x34')]!==_0xff5f('0x47')){var _0x12ae46={};_0x12ae46[_0x48e4b9['name']]={'$like':'%'+_0x8cb710[_0xff5f('0x37')][_0xff5f('0x45')]+'%'};return _0x12ae46;}})});}_0x23753a=_[_0xff5f('0x46')]({},_0x23753a,_0x8cb710[_0xff5f('0x48')]);var _0x5b6893={'where':_0x23753a[_0xff5f('0x42')]};return db['SugarcrmConfiguration']['count'](_0x5b6893)[_0xff5f('0x1b')](function(_0x499aae){_0x34b252['count']=_0x499aae;if(_0x8cb710[_0xff5f('0x37')]['includeAll']){_0x23753a[_0xff5f('0x49')]=[{'all':!![]}];}return db[_0xff5f('0x4a')][_0xff5f('0x4b')](_0x23753a);})[_0xff5f('0x1b')](function(_0x1c8cf2){_0x34b252[_0xff5f('0x4c')]=_0x1c8cf2;return _0x34b252;})[_0xff5f('0x1b')](respondWithFilteredResult(_0x1e5df7,_0x23753a))['catch'](handleError(_0x1e5df7,null));};exports[_0xff5f('0x4d')]=function(_0x54cb71,_0x4e1481){var _0x9c07e2={'raw':![],'where':{'id':_0x54cb71[_0xff5f('0x4e')]['id']}},_0x30716d={};_0x30716d[_0xff5f('0x35')]=_['keys'](db[_0xff5f('0x4a')][_0xff5f('0x33')]);_0x30716d[_0xff5f('0x37')]=_['keys'](_0x54cb71[_0xff5f('0x37')]);_0x30716d[_0xff5f('0x43')]=_[_0xff5f('0x39')](_0x30716d[_0xff5f('0x35')],_0x30716d[_0xff5f('0x37')]);_0x9c07e2[_0xff5f('0x3b')]=_['intersection'](_0x30716d[_0xff5f('0x35')],qs['fields'](_0x54cb71[_0xff5f('0x37')][_0xff5f('0x3a')]));_0x9c07e2[_0xff5f('0x3b')]=_0x9c07e2['attributes'][_0xff5f('0x3c')]?_0x9c07e2['attributes']:_0x30716d[_0xff5f('0x35')];if(_0x54cb71[_0xff5f('0x37')][_0xff5f('0x4f')]){_0x9c07e2[_0xff5f('0x49')]=[{'all':!![]}];}_0x9c07e2=_[_0xff5f('0x46')]({},_0x9c07e2,_0x54cb71['options']);return db[_0xff5f('0x4a')]['find'](_0x9c07e2)[_0xff5f('0x1b')](handleEntityNotFound(_0x4e1481,null))[_0xff5f('0x1b')](respondWithResult(_0x4e1481,null))[_0xff5f('0x24')](handleError(_0x4e1481,null));};exports[_0xff5f('0x50')]=function(_0x14ffd3,_0x5b135d){return db['SugarcrmConfiguration'][_0xff5f('0x50')](_0x14ffd3[_0xff5f('0x51')],{})[_0xff5f('0x1b')](respondWithResult(_0x5b135d,0xc9))['catch'](handleError(_0x5b135d,null));};exports['update']=function(_0x3adf39,_0x1506f8){if(_0x3adf39[_0xff5f('0x51')]['id']){delete _0x3adf39['body']['id'];}return db[_0xff5f('0x4a')]['find']({'where':{'id':_0x3adf39['params']['id']}})[_0xff5f('0x1b')](handleEntityNotFound(_0x1506f8,null))[_0xff5f('0x1b')](saveUpdates(_0x3adf39['body'],null))['then'](respondWithResult(_0x1506f8,null))['catch'](handleError(_0x1506f8,null));};exports['destroy']=function(_0x1a0371,_0x1536a3){return db[_0xff5f('0x4a')][_0xff5f('0x52')]({'where':{'id':_0x1a0371[_0xff5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1536a3,null))[_0xff5f('0x1b')](removeEntity(_0x1536a3,null))[_0xff5f('0x24')](handleError(_0x1536a3,null));};exports[_0xff5f('0x53')]=function(_0xe1dce7,_0x2a09b5,_0x101663){var _0x268f56={};var _0x1f4ddb={};var _0x2f3c10;var _0x59a21c;return db[_0xff5f('0x4a')][_0xff5f('0x54')]({'where':{'id':_0xe1dce7[_0xff5f('0x4e')]['id']}})[_0xff5f('0x1b')](handleEntityNotFound(_0x2a09b5,null))[_0xff5f('0x1b')](function(_0x13ea42){if(_0x13ea42){_0x2f3c10=_0x13ea42;_0x1f4ddb[_0xff5f('0x35')]=_[_0xff5f('0x38')](db[_0xff5f('0x55')][_0xff5f('0x33')]);_0x1f4ddb[_0xff5f('0x37')]=_[_0xff5f('0x38')](_0xe1dce7[_0xff5f('0x37')]);_0x1f4ddb[_0xff5f('0x43')]=_[_0xff5f('0x39')](_0x1f4ddb[_0xff5f('0x35')],_0x1f4ddb[_0xff5f('0x37')]);_0x268f56[_0xff5f('0x3b')]=_[_0xff5f('0x39')](_0x1f4ddb[_0xff5f('0x35')],qs[_0xff5f('0x3a')](_0xe1dce7[_0xff5f('0x37')][_0xff5f('0x3a')]));_0x268f56[_0xff5f('0x3b')]=_0x268f56[_0xff5f('0x3b')][_0xff5f('0x3c')]?_0x268f56[_0xff5f('0x3b')]:_0x1f4ddb['model'];_0x268f56['order']=qs[_0xff5f('0x41')](_0xe1dce7[_0xff5f('0x37')][_0xff5f('0x41')]);_0x268f56['where']=qs[_0xff5f('0x43')](_['pick'](_0xe1dce7[_0xff5f('0x37')],_0x1f4ddb[_0xff5f('0x43')]));if(_0xe1dce7[_0xff5f('0x37')][_0xff5f('0x45')]){_0x268f56[_0xff5f('0x42')]=_['merge'](_0x268f56['where'],{'$or':_[_0xff5f('0x36')](_0x268f56[_0xff5f('0x3b')],function(_0xbcd980){var _0xa49e8a={};_0xa49e8a[_0xbcd980]={'$like':'%'+_0xe1dce7[_0xff5f('0x37')][_0xff5f('0x45')]+'%'};return _0xa49e8a;})});}_0x268f56=_['merge']({},_0x268f56,_0xe1dce7[_0xff5f('0x48')]);return _0x2f3c10[_0xff5f('0x53')](_0x268f56);}})[_0xff5f('0x1b')](function(_0xad8b32){if(_0xad8b32){_0x59a21c=_0xad8b32[_0xff5f('0x3c')];if(!_0xe1dce7[_0xff5f('0x37')]['hasOwnProperty']('nolimit')){_0x268f56[_0xff5f('0x3f')]=qs['limit'](_0xe1dce7[_0xff5f('0x37')][_0xff5f('0x3f')]);_0x268f56['offset']=qs[_0xff5f('0x29')](_0xe1dce7[_0xff5f('0x37')][_0xff5f('0x29')]);}return _0x2f3c10[_0xff5f('0x53')](_0x268f56);}})[_0xff5f('0x1b')](function(_0x3d60a4){if(_0x3d60a4){return _0x3d60a4?{'count':_0x59a21c,'rows':_0x3d60a4}:null;}})[_0xff5f('0x1b')](respondWithResult(_0x2a09b5,null))[_0xff5f('0x24')](handleError(_0x2a09b5,null));};exports['getSubjects']=function(_0x27f4b0,_0x43ffd8,_0x336598){var _0x26e79a={};var _0x10ae83={};var _0xccc321;var _0x313f66;return db['SugarcrmConfiguration'][_0xff5f('0x54')]({'where':{'id':_0x27f4b0[_0xff5f('0x4e')]['id']}})[_0xff5f('0x1b')](handleEntityNotFound(_0x43ffd8,null))[_0xff5f('0x1b')](function(_0x4b9293){if(_0x4b9293){_0xccc321=_0x4b9293;_0x10ae83['model']=_[_0xff5f('0x38')](db['SugarcrmField'][_0xff5f('0x33')]);_0x10ae83[_0xff5f('0x37')]=_['keys'](_0x27f4b0[_0xff5f('0x37')]);_0x10ae83[_0xff5f('0x43')]=_[_0xff5f('0x39')](_0x10ae83['model'],_0x10ae83[_0xff5f('0x37')]);_0x26e79a[_0xff5f('0x3b')]=_[_0xff5f('0x39')](_0x10ae83[_0xff5f('0x35')],qs[_0xff5f('0x3a')](_0x27f4b0[_0xff5f('0x37')][_0xff5f('0x3a')]));_0x26e79a[_0xff5f('0x3b')]=_0x26e79a[_0xff5f('0x3b')][_0xff5f('0x3c')]?_0x26e79a[_0xff5f('0x3b')]:_0x10ae83[_0xff5f('0x35')];_0x26e79a[_0xff5f('0x40')]=qs[_0xff5f('0x41')](_0x27f4b0[_0xff5f('0x37')][_0xff5f('0x41')]);_0x26e79a[_0xff5f('0x42')]=qs['filters'](_[_0xff5f('0x44')](_0x27f4b0[_0xff5f('0x37')],_0x10ae83[_0xff5f('0x43')]));if(_0x27f4b0[_0xff5f('0x37')][_0xff5f('0x45')]){_0x26e79a['where']=_[_0xff5f('0x46')](_0x26e79a['where'],{'$or':_[_0xff5f('0x36')](_0x26e79a['attributes'],function(_0x5889d7){var _0x95ae11={};_0x95ae11[_0x5889d7]={'$like':'%'+_0x27f4b0[_0xff5f('0x37')][_0xff5f('0x45')]+'%'};return _0x95ae11;})});}_0x26e79a=_[_0xff5f('0x46')]({},_0x26e79a,_0x27f4b0['options']);return _0xccc321[_0xff5f('0x56')](_0x26e79a);}})['then'](function(_0xf67599){if(_0xf67599){_0x313f66=_0xf67599[_0xff5f('0x3c')];if(!_0x27f4b0[_0xff5f('0x37')][_0xff5f('0x3d')]('nolimit')){_0x26e79a[_0xff5f('0x3f')]=qs[_0xff5f('0x3f')](_0x27f4b0[_0xff5f('0x37')]['limit']);_0x26e79a['offset']=qs['offset'](_0x27f4b0[_0xff5f('0x37')][_0xff5f('0x29')]);}return _0xccc321[_0xff5f('0x56')](_0x26e79a);}})[_0xff5f('0x1b')](function(_0x1da086){if(_0x1da086){return _0x1da086?{'count':_0x313f66,'rows':_0x1da086}:null;}})[_0xff5f('0x1b')](respondWithResult(_0x43ffd8,null))['catch'](handleError(_0x43ffd8,null));};exports['getDescriptions']=function(_0x50b1c7,_0xb9ffb0,_0xd744c3){var _0x503648={};var _0x505a15={};var _0x3e43d5;var _0x21eb31;return db[_0xff5f('0x4a')]['findOne']({'where':{'id':_0x50b1c7[_0xff5f('0x4e')]['id']}})['then'](handleEntityNotFound(_0xb9ffb0,null))[_0xff5f('0x1b')](function(_0x1492bf){if(_0x1492bf){_0x3e43d5=_0x1492bf;_0x505a15['model']=_[_0xff5f('0x38')](db[_0xff5f('0x55')][_0xff5f('0x33')]);_0x505a15[_0xff5f('0x37')]=_[_0xff5f('0x38')](_0x50b1c7[_0xff5f('0x37')]);_0x505a15[_0xff5f('0x43')]=_[_0xff5f('0x39')](_0x505a15[_0xff5f('0x35')],_0x505a15['query']);_0x503648[_0xff5f('0x3b')]=_[_0xff5f('0x39')](_0x505a15[_0xff5f('0x35')],qs[_0xff5f('0x3a')](_0x50b1c7[_0xff5f('0x37')][_0xff5f('0x3a')]));_0x503648[_0xff5f('0x3b')]=_0x503648[_0xff5f('0x3b')][_0xff5f('0x3c')]?_0x503648[_0xff5f('0x3b')]:_0x505a15[_0xff5f('0x35')];_0x503648['order']=qs[_0xff5f('0x41')](_0x50b1c7[_0xff5f('0x37')][_0xff5f('0x41')]);_0x503648[_0xff5f('0x42')]=qs['filters'](_[_0xff5f('0x44')](_0x50b1c7[_0xff5f('0x37')],_0x505a15[_0xff5f('0x43')]));if(_0x50b1c7['query'][_0xff5f('0x45')]){_0x503648['where']=_[_0xff5f('0x46')](_0x503648[_0xff5f('0x42')],{'$or':_[_0xff5f('0x36')](_0x503648[_0xff5f('0x3b')],function(_0x5da641){var _0x5a7a5a={};_0x5a7a5a[_0x5da641]={'$like':'%'+_0x50b1c7[_0xff5f('0x37')][_0xff5f('0x45')]+'%'};return _0x5a7a5a;})});}_0x503648=_[_0xff5f('0x46')]({},_0x503648,_0x50b1c7[_0xff5f('0x48')]);return _0x3e43d5[_0xff5f('0x57')](_0x503648);}})[_0xff5f('0x1b')](function(_0x3026b9){if(_0x3026b9){_0x21eb31=_0x3026b9[_0xff5f('0x3c')];if(!_0x50b1c7[_0xff5f('0x37')][_0xff5f('0x3d')](_0xff5f('0x3e'))){_0x503648['limit']=qs[_0xff5f('0x3f')](_0x50b1c7[_0xff5f('0x37')][_0xff5f('0x3f')]);_0x503648['offset']=qs[_0xff5f('0x29')](_0x50b1c7[_0xff5f('0x37')][_0xff5f('0x29')]);}return _0x3e43d5[_0xff5f('0x57')](_0x503648);}})[_0xff5f('0x1b')](function(_0x12cd9a){if(_0x12cd9a){return _0x12cd9a?{'count':_0x21eb31,'rows':_0x12cd9a}:null;}})[_0xff5f('0x1b')](respondWithResult(_0xb9ffb0,null))['catch'](handleError(_0xb9ffb0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 6adcb35..f55dd51 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 _0x6c86=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','api','moment','bluebird','request-promise','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6c86,0x1e5));var _0x66c8=function(_0x485b1d,_0x569b78){_0x485b1d=_0x485b1d-0x0;var _0x5dfae7=_0x6c86[_0x485b1d];return _0x5dfae7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x66c8('0x0'));var moment=require(_0x66c8('0x1'));var BPromise=require(_0x66c8('0x2'));var rp=require(_0x66c8('0x3'));var fs=require('fs');var path=require(_0x66c8('0x4'));var rimraf=require(_0x66c8('0x5'));var config=require(_0x66c8('0x6'));var attributes=require(_0x66c8('0x7'));module[_0x66c8('0x8')]=function(_0x58dbb4,_0x5c03ea){return _0x58dbb4['define'](_0x66c8('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dec=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration'];(function(_0x424504,_0x31c597){var _0x3f2e43=function(_0x27c1eb){while(--_0x27c1eb){_0x424504['push'](_0x424504['shift']());}};_0x3f2e43(++_0x31c597);}(_0x4dec,0x193));var _0xc4de=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4dec[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xc4de('0x0'));var logger=require(_0xc4de('0x1'))(_0xc4de('0x2'));var moment=require(_0xc4de('0x3'));var BPromise=require(_0xc4de('0x4'));var rp=require(_0xc4de('0x5'));var fs=require('fs');var path=require(_0xc4de('0x6'));var rimraf=require(_0xc4de('0x7'));var config=require(_0xc4de('0x8'));var attributes=require(_0xc4de('0x9'));module[_0xc4de('0xa')]=function(_0x1978ac,_0x2b20eb){return _0x1978ac[_0xc4de('0xb')](_0xc4de('0xc'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index f649b24..3791d0f 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 _0x7c2d=['error','code','message','catch','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xec0590,_0xd27f54){var _0x58158f=function(_0x4e6cef){while(--_0x4e6cef){_0xec0590['push'](_0xec0590['shift']());}};_0x58158f(++_0xd27f54);}(_0x7c2d,0x1a8));var _0xd7c2=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x7c2d[_0x1deb03];return _0x189fe7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd7c2('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7c2('0x1'));var db=require(_0xd7c2('0x2'))['db'];var utils=require(_0xd7c2('0x3'));var logger=require('../../config/logger')(_0xd7c2('0x4'));var config=require(_0xd7c2('0x5'));var jayson=require(_0xd7c2('0x6'));var client=jayson[_0xd7c2('0x7')][_0xd7c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10a694,_0x5ba685,_0x3a96a3){return new BPromise(function(_0x23b847,_0x4ca46b){return client[_0xd7c2('0x9')](_0x10a694,_0x3a96a3)[_0xd7c2('0xa')](function(_0x3b70df){logger[_0xd7c2('0xb')](_0xd7c2('0xc'),_0x5ba685,_0xd7c2('0xd'));logger['debug'](_0xd7c2('0xe'),_0x5ba685,_0xd7c2('0xd'),JSON[_0xd7c2('0xf')](_0x3b70df));if(_0x3b70df[_0xd7c2('0x10')]){if(_0x3b70df['error'][_0xd7c2('0x11')]===0x1f4){logger['error'](_0xd7c2('0xc'),_0x5ba685,_0x3b70df['error']['message']);return _0x4ca46b(_0x3b70df[_0xd7c2('0x10')][_0xd7c2('0x12')]);}logger[_0xd7c2('0x10')](_0xd7c2('0xc'),_0x5ba685,_0x3b70df[_0xd7c2('0x10')][_0xd7c2('0x12')]);return _0x23b847(_0x3b70df[_0xd7c2('0x10')][_0xd7c2('0x12')]);}else{logger[_0xd7c2('0xb')](_0xd7c2('0xc'),_0x5ba685,'request\x20sent');_0x23b847(_0x3b70df['result'][_0xd7c2('0x12')]);}})[_0xd7c2('0x13')](function(_0x4da743){logger[_0xd7c2('0x10')](_0xd7c2('0xc'),_0x5ba685,_0x4da743);_0x4ca46b(_0x4da743);});});} \ No newline at end of file +var _0x9719=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9719,0x160));var _0x9971=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9719[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x9971('0x0'));var util=require(_0x9971('0x1'));var moment=require(_0x9971('0x2'));var BPromise=require(_0x9971('0x3'));var rs=require(_0x9971('0x4'));var fs=require('fs');var Redis=require(_0x9971('0x5'));var db=require(_0x9971('0x6'))['db'];var utils=require(_0x9971('0x7'));var logger=require(_0x9971('0x8'))(_0x9971('0x9'));var config=require(_0x9971('0xa'));var jayson=require(_0x9971('0xb'));var client=jayson[_0x9971('0xc')][_0x9971('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x48a8e9,_0x564899,_0x3e4738){return new BPromise(function(_0x5d901f,_0x4f1499){return client[_0x9971('0xe')](_0x48a8e9,_0x3e4738)[_0x9971('0xf')](function(_0x398a20){logger[_0x9971('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x564899,'request\x20sent');logger[_0x9971('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x564899,_0x9971('0x12'),JSON['stringify'](_0x398a20));if(_0x398a20['error']){if(_0x398a20[_0x9971('0x13')][_0x9971('0x14')]===0x1f4){logger[_0x9971('0x13')](_0x9971('0x15'),_0x564899,_0x398a20[_0x9971('0x13')][_0x9971('0x16')]);return _0x4f1499(_0x398a20[_0x9971('0x13')]['message']);}logger[_0x9971('0x13')](_0x9971('0x15'),_0x564899,_0x398a20[_0x9971('0x13')]['message']);return _0x5d901f(_0x398a20[_0x9971('0x13')]['message']);}else{logger[_0x9971('0x10')](_0x9971('0x15'),_0x564899,_0x9971('0x12'));_0x5d901f(_0x398a20[_0x9971('0x17')][_0x9971('0x16')]);}})['catch'](function(_0x2097f9){logger[_0x9971('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x564899,_0x2097f9);_0x4f1499(_0x2097f9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 37524e6..dea7558 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 _0x7ca9=['create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7ca9,0x1e8));var _0x97ca=function(_0x28effe,_0x5599e7){_0x28effe=_0x28effe-0x0;var _0x477a1a=_0x7ca9[_0x28effe];return _0x477a1a;};'use strict';var multer=require(_0x97ca('0x0'));var util=require(_0x97ca('0x1'));var path=require(_0x97ca('0x2'));var timeout=require(_0x97ca('0x3'));var express=require(_0x97ca('0x4'));var router=express[_0x97ca('0x5')]();var auth=require(_0x97ca('0x6'));var interaction=require(_0x97ca('0x7'));var config=require(_0x97ca('0x8'));var controller=require(_0x97ca('0x9'));router[_0x97ca('0xa')]('/',auth[_0x97ca('0xb')](),controller[_0x97ca('0xc')]);router[_0x97ca('0xa')](_0x97ca('0xd'),auth[_0x97ca('0xb')](),controller[_0x97ca('0xe')]);router[_0x97ca('0xf')]('/',auth['isAuthenticated'](),controller[_0x97ca('0x10')]);router[_0x97ca('0x11')](_0x97ca('0xd'),auth['isAuthenticated'](),controller[_0x97ca('0x12')]);router[_0x97ca('0x13')]('/:id',auth[_0x97ca('0xb')](),controller['destroy']);module[_0x97ca('0x14')]=router; \ No newline at end of file +var _0xaac2=['update','delete','/:id','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','show','put'];(function(_0xdbc3e2,_0x195d04){var _0x399a21=function(_0x219ec8){while(--_0x219ec8){_0xdbc3e2['push'](_0xdbc3e2['shift']());}};_0x399a21(++_0x195d04);}(_0xaac2,0x1b4));var _0x2aac=function(_0x31747e,_0x580e59){_0x31747e=_0x31747e-0x0;var _0x408ea9=_0xaac2[_0x31747e];return _0x408ea9;};'use strict';var multer=require('multer');var util=require(_0x2aac('0x0'));var path=require(_0x2aac('0x1'));var timeout=require(_0x2aac('0x2'));var express=require(_0x2aac('0x3'));var router=express[_0x2aac('0x4')]();var auth=require(_0x2aac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2aac('0x6'));var controller=require(_0x2aac('0x7'));router['get']('/',auth[_0x2aac('0x8')](),controller[_0x2aac('0x9')]);router['get']('/:id',auth[_0x2aac('0x8')](),controller[_0x2aac('0xa')]);router['post']('/',auth[_0x2aac('0x8')](),controller['create']);router[_0x2aac('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2aac('0xc')]);router[_0x2aac('0xd')](_0x2aac('0xe'),auth[_0x2aac('0x8')](),controller['destroy']);module[_0x2aac('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 8e27c74..f51ab0b 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 _0x5359=['variable','customVariable','string','STRING','exports','ENUM'];(function(_0x48999c,_0x4bda7c){var _0x5bfc51=function(_0x2346f9){while(--_0x2346f9){_0x48999c['push'](_0x48999c['shift']());}};_0x5bfc51(++_0x4bda7c);}(_0x5359,0x130));var _0x9535=function(_0x28c699,_0x43c787){_0x28c699=_0x28c699-0x0;var _0x6d16f0=_0x5359[_0x28c699];return _0x6d16f0;};'use strict';var Sequelize=require('sequelize');module[_0x9535('0x0')]={'type':{'type':Sequelize[_0x9535('0x1')]('string',_0x9535('0x2'),_0x9535('0x3'),'keyValue'),'defaultValue':_0x9535('0x4')},'content':{'type':Sequelize[_0x9535('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9535('0x1')]('string',_0x9535('0x2'),_0x9535('0x3'))},'keyContent':{'type':Sequelize[_0x9535('0x5')]},'idField':{'type':Sequelize[_0x9535('0x5')]},'nameField':{'type':Sequelize[_0x9535('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9535('0x5')]}}; \ No newline at end of file +var _0x6510=['exports','ENUM','string','variable','keyValue','STRING','customVariable','sequelize'];(function(_0x346d3e,_0x30abd9){var _0x56824f=function(_0x3324b4){while(--_0x3324b4){_0x346d3e['push'](_0x346d3e['shift']());}};_0x56824f(++_0x30abd9);}(_0x6510,0x77));var _0x0651=function(_0x214844,_0x342150){_0x214844=_0x214844-0x0;var _0x3cb5b1=_0x6510[_0x214844];return _0x3cb5b1;};'use strict';var Sequelize=require(_0x0651('0x0'));module[_0x0651('0x1')]={'type':{'type':Sequelize[_0x0651('0x2')](_0x0651('0x3'),_0x0651('0x4'),'customVariable',_0x0651('0x5')),'defaultValue':_0x0651('0x3')},'content':{'type':Sequelize[_0x0651('0x6')]},'key':{'type':Sequelize[_0x0651('0x6')]},'keyType':{'type':Sequelize[_0x0651('0x2')]('string',_0x0651('0x4'),_0x0651('0x7'))},'keyContent':{'type':Sequelize[_0x0651('0x6')]},'idField':{'type':Sequelize[_0x0651('0x6')]},'nameField':{'type':Sequelize[_0x0651('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0651('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 551e1fa..31fb6f3 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 _0x96bd=['merge','VIRTUAL','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','length','find','create','body','update','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','sort','where','filter'];(function(_0x3cbd3c,_0x1fe1cc){var _0x1bff6f=function(_0x31ebad){while(--_0x31ebad){_0x3cbd3c['push'](_0x3cbd3c['shift']());}};_0x1bff6f(++_0x1fe1cc);}(_0x96bd,0xee));var _0xd96b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x96bd[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0xd96b('0x0'));var emlformat=require(_0xd96b('0x1'));var rimraf=require(_0xd96b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd96b('0x3'));var rp=require(_0xd96b('0x4'));var moment=require(_0xd96b('0x5'));var BPromise=require(_0xd96b('0x6'));var Mustache=require(_0xd96b('0x7'));var util=require(_0xd96b('0x8'));var path=require(_0xd96b('0x9'));var sox=require('sox');var csv=require(_0xd96b('0xa'));var ejs=require(_0xd96b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd96b('0xc'));var jsforce=require(_0xd96b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd96b('0xa'));var querystring=require(_0xd96b('0xe'));var Papa=require(_0xd96b('0xf'));var Redis=require(_0xd96b('0x10'));var authService=require(_0xd96b('0x11'));var qs=require(_0xd96b('0x12'));var as=require(_0xd96b('0x13'));var hardwareService=require(_0xd96b('0x14'));var logger=require(_0xd96b('0x15'))('api');var utils=require(_0xd96b('0x16'));var config=require(_0xd96b('0x17'));var db=require(_0xd96b('0x18'))['db'];function respondWithStatusCode(_0x4cc876,_0xa9fc15){_0xa9fc15=_0xa9fc15||0xcc;return function(_0x1dcb39){if(_0x1dcb39){return _0x4cc876[_0xd96b('0x19')](_0xa9fc15);}return _0x4cc876[_0xd96b('0x1a')](_0xa9fc15)[_0xd96b('0x1b')]();};}function respondWithResult(_0x3cfe69,_0x19755c){_0x19755c=_0x19755c||0xc8;return function(_0x10e982){if(_0x10e982){return _0x3cfe69[_0xd96b('0x1a')](_0x19755c)[_0xd96b('0x1c')](_0x10e982);}};}function respondWithFilteredResult(_0x1520be,_0x309345){return function(_0xaf15d9){if(_0xaf15d9){var _0x5f1d84=_0xaf15d9[_0xd96b('0x1d')],_0x5de3ea=_0x309345[_0xd96b('0x1e')],_0x3a42c1=_0x309345[_0xd96b('0x1e')]+_0x309345[_0xd96b('0x1f')],_0x54342e;if(_0x3a42c1>=_0x5f1d84){_0x3a42c1=_0x5f1d84;_0x54342e=0xc8;}else{_0x54342e=0xce;}_0x1520be[_0xd96b('0x1a')](_0x54342e);return _0x1520be[_0xd96b('0x20')](_0xd96b('0x21'),_0x5de3ea+'-'+_0x3a42c1+'/'+_0x5f1d84)[_0xd96b('0x1c')](_0xaf15d9);}return null;};}function patchUpdates(_0xa75c96){return function(_0x2b5ae9){try{jsonpatch[_0xd96b('0x22')](_0x2b5ae9,_0xa75c96,!![]);}catch(_0x36d529){return BPromise[_0xd96b('0x23')](_0x36d529);}return _0x2b5ae9[_0xd96b('0x24')]();};}function saveUpdates(_0x1bb7ec,_0x5dd829){return function(_0xff4d87){if(_0xff4d87){return _0xff4d87['update'](_0x1bb7ec)[_0xd96b('0x25')](function(_0x3fb63e){return _0x3fb63e;});}return null;};}function removeEntity(_0x3c6ce2,_0x1eb134){return function(_0x26cc89){if(_0x26cc89){return _0x26cc89['destroy']()[_0xd96b('0x25')](function(){_0x3c6ce2['status'](0xcc)[_0xd96b('0x1b')]();});}};}function handleEntityNotFound(_0xc9f850,_0x54ea46){return function(_0x18a093){if(!_0x18a093){_0xc9f850[_0xd96b('0x19')](0x194);}return _0x18a093;};}function handleError(_0x1a1f21,_0x15ef7d){_0x15ef7d=_0x15ef7d||0x1f4;return function(_0x254cf6){logger[_0xd96b('0x26')](_0x254cf6[_0xd96b('0x27')]);if(_0x254cf6['name']){delete _0x254cf6[_0xd96b('0x28')];}_0x1a1f21[_0xd96b('0x1a')](_0x15ef7d)[_0xd96b('0x29')](_0x254cf6);};}exports['index']=function(_0x2a329b,_0x131ef4){var _0x22d048={},_0x223061={},_0x266c1f={'count':0x0,'rows':[]};var _0x52788a=_[_0xd96b('0x2a')](db['SugarcrmField'][_0xd96b('0x2b')],function(_0x2161eb){return{'name':_0x2161eb[_0xd96b('0x2c')],'type':_0x2161eb[_0xd96b('0x2d')][_0xd96b('0x2e')]};});_0x223061['model']=_[_0xd96b('0x2a')](_0x52788a,_0xd96b('0x28'));_0x223061[_0xd96b('0x2f')]=_[_0xd96b('0x30')](_0x2a329b[_0xd96b('0x2f')]);_0x223061[_0xd96b('0x31')]=_[_0xd96b('0x32')](_0x223061['model'],_0x223061['query']);_0x22d048[_0xd96b('0x33')]=_[_0xd96b('0x32')](_0x223061[_0xd96b('0x34')],qs['fields'](_0x2a329b[_0xd96b('0x2f')][_0xd96b('0x35')]));_0x22d048['attributes']=_0x22d048[_0xd96b('0x33')]['length']?_0x22d048['attributes']:_0x223061[_0xd96b('0x34')];if(!_0x2a329b[_0xd96b('0x2f')][_0xd96b('0x36')]('nolimit')){_0x22d048['limit']=qs[_0xd96b('0x1f')](_0x2a329b['query'][_0xd96b('0x1f')]);_0x22d048[_0xd96b('0x1e')]=qs[_0xd96b('0x1e')](_0x2a329b[_0xd96b('0x2f')][_0xd96b('0x1e')]);}_0x22d048['order']=qs[_0xd96b('0x37')](_0x2a329b[_0xd96b('0x2f')][_0xd96b('0x37')]);_0x22d048[_0xd96b('0x38')]=qs[_0xd96b('0x31')](_['pick'](_0x2a329b[_0xd96b('0x2f')],_0x223061['filters']),_0x52788a);if(_0x2a329b['query'][_0xd96b('0x39')]){_0x22d048[_0xd96b('0x38')]=_[_0xd96b('0x3a')](_0x22d048['where'],{'$or':_['map'](_0x52788a,function(_0xd74275){if(_0xd74275[_0xd96b('0x2d')]!==_0xd96b('0x3b')){var _0x231049={};_0x231049[_0xd74275['name']]={'$like':'%'+_0x2a329b[_0xd96b('0x2f')][_0xd96b('0x39')]+'%'};return _0x231049;}})});}_0x22d048=_[_0xd96b('0x3a')]({},_0x22d048,_0x2a329b['options']);var _0x1d2aaf={'where':_0x22d048['where']};return db['SugarcrmField'][_0xd96b('0x1d')](_0x1d2aaf)[_0xd96b('0x25')](function(_0x107d8a){_0x266c1f[_0xd96b('0x1d')]=_0x107d8a;if(_0x2a329b['query'][_0xd96b('0x3c')]){_0x22d048[_0xd96b('0x3d')]=[{'all':!![]}];}return db[_0xd96b('0x3e')][_0xd96b('0x3f')](_0x22d048);})[_0xd96b('0x25')](function(_0x4ecbd5){_0x266c1f[_0xd96b('0x40')]=_0x4ecbd5;return _0x266c1f;})[_0xd96b('0x25')](respondWithFilteredResult(_0x131ef4,_0x22d048))[_0xd96b('0x41')](handleError(_0x131ef4,null));};exports[_0xd96b('0x42')]=function(_0x739aa,_0x1f01dd){var _0x3a202b={'raw':!![],'where':{'id':_0x739aa[_0xd96b('0x43')]['id']}},_0x10d374={};_0x10d374['model']=_[_0xd96b('0x30')](db[_0xd96b('0x3e')][_0xd96b('0x2b')]);_0x10d374[_0xd96b('0x2f')]=_['keys'](_0x739aa[_0xd96b('0x2f')]);_0x10d374['filters']=_[_0xd96b('0x32')](_0x10d374[_0xd96b('0x34')],_0x10d374[_0xd96b('0x2f')]);_0x3a202b[_0xd96b('0x33')]=_[_0xd96b('0x32')](_0x10d374['model'],qs['fields'](_0x739aa[_0xd96b('0x2f')][_0xd96b('0x35')]));_0x3a202b[_0xd96b('0x33')]=_0x3a202b[_0xd96b('0x33')][_0xd96b('0x44')]?_0x3a202b['attributes']:_0x10d374[_0xd96b('0x34')];if(_0x739aa[_0xd96b('0x2f')][_0xd96b('0x3c')]){_0x3a202b[_0xd96b('0x3d')]=[{'all':!![]}];}_0x3a202b=_[_0xd96b('0x3a')]({},_0x3a202b,_0x739aa['options']);return db[_0xd96b('0x3e')][_0xd96b('0x45')](_0x3a202b)[_0xd96b('0x25')](handleEntityNotFound(_0x1f01dd,null))[_0xd96b('0x25')](respondWithResult(_0x1f01dd,null))['catch'](handleError(_0x1f01dd,null));};exports[_0xd96b('0x46')]=function(_0x4ea088,_0x3b5c02){return db[_0xd96b('0x3e')][_0xd96b('0x46')](_0x4ea088[_0xd96b('0x47')],{})['then'](respondWithResult(_0x3b5c02,0xc9))[_0xd96b('0x41')](handleError(_0x3b5c02,null));};exports[_0xd96b('0x48')]=function(_0x43cdbb,_0x5b7025){if(_0x43cdbb[_0xd96b('0x47')]['id']){delete _0x43cdbb[_0xd96b('0x47')]['id'];}return db[_0xd96b('0x3e')][_0xd96b('0x45')]({'where':{'id':_0x43cdbb[_0xd96b('0x43')]['id']}})[_0xd96b('0x25')](handleEntityNotFound(_0x5b7025,null))[_0xd96b('0x25')](saveUpdates(_0x43cdbb[_0xd96b('0x47')],null))['then'](respondWithResult(_0x5b7025,null))[_0xd96b('0x41')](handleError(_0x5b7025,null));};exports[_0xd96b('0x49')]=function(_0x3e1323,_0x56428d){return db[_0xd96b('0x3e')]['find']({'where':{'id':_0x3e1323[_0xd96b('0x43')]['id']}})[_0xd96b('0x25')](handleEntityNotFound(_0x56428d,null))[_0xd96b('0x25')](removeEntity(_0x56428d,null))['catch'](handleError(_0x56428d,null));}; \ No newline at end of file +var _0x015e=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','offset','sort','where','pick','merge','type','includeAll','include','SugarcrmField','findAll','catch','show','params','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1badb1,_0x375ec6){var _0x260dae=function(_0x2f3bbc){while(--_0x2f3bbc){_0x1badb1['push'](_0x1badb1['shift']());}};_0x260dae(++_0x375ec6);}(_0x015e,0x1cf));var _0xe015=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x015e[_0x32b542];return _0x554d54;};'use strict';var pdf=require(_0xe015('0x0'));var emlformat=require(_0xe015('0x1'));var rimraf=require(_0xe015('0x2'));var zipdir=require(_0xe015('0x3'));var jsonpatch=require(_0xe015('0x4'));var rp=require(_0xe015('0x5'));var moment=require(_0xe015('0x6'));var BPromise=require(_0xe015('0x7'));var Mustache=require('mustache');var util=require(_0xe015('0x8'));var path=require(_0xe015('0x9'));var sox=require(_0xe015('0xa'));var csv=require(_0xe015('0xb'));var ejs=require(_0xe015('0xc'));var fs=require('fs');var _=require(_0xe015('0xd'));var squel=require('squel');var crypto=require(_0xe015('0xe'));var jsforce=require(_0xe015('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe015('0xb'));var querystring=require('querystring');var Papa=require(_0xe015('0x10'));var Redis=require(_0xe015('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe015('0x12'));var as=require(_0xe015('0x13'));var hardwareService=require(_0xe015('0x14'));var logger=require(_0xe015('0x15'))('api');var utils=require(_0xe015('0x16'));var config=require(_0xe015('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d2b5c,_0x3b72f0){_0x3b72f0=_0x3b72f0||0xcc;return function(_0x2e5d18){if(_0x2e5d18){return _0x4d2b5c[_0xe015('0x18')](_0x3b72f0);}return _0x4d2b5c[_0xe015('0x19')](_0x3b72f0)[_0xe015('0x1a')]();};}function respondWithResult(_0xf848be,_0x432303){_0x432303=_0x432303||0xc8;return function(_0x4f3648){if(_0x4f3648){return _0xf848be[_0xe015('0x19')](_0x432303)['json'](_0x4f3648);}};}function respondWithFilteredResult(_0xbfae2f,_0xc77d89){return function(_0xfbd635){if(_0xfbd635){var _0x463e5b=_0xfbd635[_0xe015('0x1b')],_0x489e6d=_0xc77d89['offset'],_0x45b05a=_0xc77d89['offset']+_0xc77d89[_0xe015('0x1c')],_0x4a01b6;if(_0x45b05a>=_0x463e5b){_0x45b05a=_0x463e5b;_0x4a01b6=0xc8;}else{_0x4a01b6=0xce;}_0xbfae2f['status'](_0x4a01b6);return _0xbfae2f[_0xe015('0x1d')](_0xe015('0x1e'),_0x489e6d+'-'+_0x45b05a+'/'+_0x463e5b)[_0xe015('0x1f')](_0xfbd635);}return null;};}function patchUpdates(_0x2a6e47){return function(_0x56cf9a){try{jsonpatch[_0xe015('0x20')](_0x56cf9a,_0x2a6e47,!![]);}catch(_0x242adf){return BPromise[_0xe015('0x21')](_0x242adf);}return _0x56cf9a['save']();};}function saveUpdates(_0x3d7111,_0x1c328c){return function(_0x3e07f5){if(_0x3e07f5){return _0x3e07f5[_0xe015('0x22')](_0x3d7111)[_0xe015('0x23')](function(_0x211e17){return _0x211e17;});}return null;};}function removeEntity(_0x18736a,_0x2afcf0){return function(_0x360a95){if(_0x360a95){return _0x360a95[_0xe015('0x24')]()[_0xe015('0x23')](function(){_0x18736a[_0xe015('0x19')](0xcc)[_0xe015('0x1a')]();});}};}function handleEntityNotFound(_0x13dccf,_0x453855){return function(_0x276af9){if(!_0x276af9){_0x13dccf['sendStatus'](0x194);}return _0x276af9;};}function handleError(_0x296b53,_0x31e61b){_0x31e61b=_0x31e61b||0x1f4;return function(_0x41ca35){logger[_0xe015('0x25')](_0x41ca35['stack']);if(_0x41ca35['name']){delete _0x41ca35[_0xe015('0x26')];}_0x296b53[_0xe015('0x19')](_0x31e61b)[_0xe015('0x27')](_0x41ca35);};}exports[_0xe015('0x28')]=function(_0x270d52,_0x1cb0d4){var _0x13179c={},_0x5b0639={},_0x43ab52={'count':0x0,'rows':[]};var _0x42c5f5=_[_0xe015('0x29')](db['SugarcrmField'][_0xe015('0x2a')],function(_0x342670){return{'name':_0x342670[_0xe015('0x2b')],'type':_0x342670['type'][_0xe015('0x2c')]};});_0x5b0639[_0xe015('0x2d')]=_[_0xe015('0x29')](_0x42c5f5,_0xe015('0x26'));_0x5b0639[_0xe015('0x2e')]=_[_0xe015('0x2f')](_0x270d52[_0xe015('0x2e')]);_0x5b0639[_0xe015('0x30')]=_[_0xe015('0x31')](_0x5b0639['model'],_0x5b0639[_0xe015('0x2e')]);_0x13179c[_0xe015('0x32')]=_[_0xe015('0x31')](_0x5b0639['model'],qs['fields'](_0x270d52[_0xe015('0x2e')][_0xe015('0x33')]));_0x13179c[_0xe015('0x32')]=_0x13179c[_0xe015('0x32')]['length']?_0x13179c[_0xe015('0x32')]:_0x5b0639[_0xe015('0x2d')];if(!_0x270d52[_0xe015('0x2e')]['hasOwnProperty']('nolimit')){_0x13179c['limit']=qs['limit'](_0x270d52['query'][_0xe015('0x1c')]);_0x13179c['offset']=qs['offset'](_0x270d52[_0xe015('0x2e')][_0xe015('0x34')]);}_0x13179c['order']=qs['sort'](_0x270d52[_0xe015('0x2e')][_0xe015('0x35')]);_0x13179c[_0xe015('0x36')]=qs['filters'](_[_0xe015('0x37')](_0x270d52['query'],_0x5b0639[_0xe015('0x30')]),_0x42c5f5);if(_0x270d52[_0xe015('0x2e')]['filter']){_0x13179c['where']=_[_0xe015('0x38')](_0x13179c[_0xe015('0x36')],{'$or':_[_0xe015('0x29')](_0x42c5f5,function(_0x29c5bf){if(_0x29c5bf[_0xe015('0x39')]!=='VIRTUAL'){var _0x3a0c76={};_0x3a0c76[_0x29c5bf['name']]={'$like':'%'+_0x270d52[_0xe015('0x2e')]['filter']+'%'};return _0x3a0c76;}})});}_0x13179c=_[_0xe015('0x38')]({},_0x13179c,_0x270d52['options']);var _0x56d825={'where':_0x13179c[_0xe015('0x36')]};return db['SugarcrmField']['count'](_0x56d825)['then'](function(_0x36d925){_0x43ab52[_0xe015('0x1b')]=_0x36d925;if(_0x270d52[_0xe015('0x2e')][_0xe015('0x3a')]){_0x13179c[_0xe015('0x3b')]=[{'all':!![]}];}return db[_0xe015('0x3c')][_0xe015('0x3d')](_0x13179c);})['then'](function(_0x180820){_0x43ab52['rows']=_0x180820;return _0x43ab52;})[_0xe015('0x23')](respondWithFilteredResult(_0x1cb0d4,_0x13179c))[_0xe015('0x3e')](handleError(_0x1cb0d4,null));};exports[_0xe015('0x3f')]=function(_0x479a9d,_0x113dc0){var _0xf8638a={'raw':!![],'where':{'id':_0x479a9d[_0xe015('0x40')]['id']}},_0x233ff4={};_0x233ff4['model']=_[_0xe015('0x2f')](db['SugarcrmField']['rawAttributes']);_0x233ff4['query']=_[_0xe015('0x2f')](_0x479a9d[_0xe015('0x2e')]);_0x233ff4[_0xe015('0x30')]=_[_0xe015('0x31')](_0x233ff4[_0xe015('0x2d')],_0x233ff4[_0xe015('0x2e')]);_0xf8638a[_0xe015('0x32')]=_[_0xe015('0x31')](_0x233ff4[_0xe015('0x2d')],qs[_0xe015('0x33')](_0x479a9d[_0xe015('0x2e')][_0xe015('0x33')]));_0xf8638a[_0xe015('0x32')]=_0xf8638a[_0xe015('0x32')]['length']?_0xf8638a[_0xe015('0x32')]:_0x233ff4[_0xe015('0x2d')];if(_0x479a9d['query'][_0xe015('0x3a')]){_0xf8638a[_0xe015('0x3b')]=[{'all':!![]}];}_0xf8638a=_[_0xe015('0x38')]({},_0xf8638a,_0x479a9d[_0xe015('0x41')]);return db['SugarcrmField'][_0xe015('0x42')](_0xf8638a)[_0xe015('0x23')](handleEntityNotFound(_0x113dc0,null))[_0xe015('0x23')](respondWithResult(_0x113dc0,null))[_0xe015('0x3e')](handleError(_0x113dc0,null));};exports[_0xe015('0x43')]=function(_0x233275,_0x2dc5e3){return db[_0xe015('0x3c')][_0xe015('0x43')](_0x233275[_0xe015('0x44')],{})['then'](respondWithResult(_0x2dc5e3,0xc9))[_0xe015('0x3e')](handleError(_0x2dc5e3,null));};exports[_0xe015('0x22')]=function(_0x57b24a,_0x419290){if(_0x57b24a[_0xe015('0x44')]['id']){delete _0x57b24a[_0xe015('0x44')]['id'];}return db[_0xe015('0x3c')][_0xe015('0x42')]({'where':{'id':_0x57b24a[_0xe015('0x40')]['id']}})['then'](handleEntityNotFound(_0x419290,null))[_0xe015('0x23')](saveUpdates(_0x57b24a['body'],null))[_0xe015('0x23')](respondWithResult(_0x419290,null))[_0xe015('0x3e')](handleError(_0x419290,null));};exports[_0xe015('0x24')]=function(_0x3272e3,_0xd7394e){return db[_0xe015('0x3c')][_0xe015('0x42')]({'where':{'id':_0x3272e3['params']['id']}})['then'](handleEntityNotFound(_0xd7394e,null))[_0xe015('0x23')](removeEntity(_0xd7394e,null))[_0xe015('0x3e')](handleError(_0xd7394e,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 333f294..6509121 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 _0x0d5a=['bluebird','path','rimraf','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','lodash','util','../../config/logger','api','moment'];(function(_0x9d4ce4,_0x510f23){var _0x555e00=function(_0x2572f9){while(--_0x2572f9){_0x9d4ce4['push'](_0x9d4ce4['shift']());}};_0x555e00(++_0x510f23);}(_0x0d5a,0x18e));var _0xa0d5=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0d5a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xa0d5('0x0'));var util=require(_0xa0d5('0x1'));var logger=require(_0xa0d5('0x2'))(_0xa0d5('0x3'));var moment=require(_0xa0d5('0x4'));var BPromise=require(_0xa0d5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0d5('0x6'));var rimraf=require(_0xa0d5('0x7'));var config=require('../../config/environment');var attributes=require(_0xa0d5('0x8'));module[_0xa0d5('0x9')]=function(_0x50a240,_0x129642){return _0x50a240[_0xa0d5('0xa')](_0xa0d5('0xb'),attributes,{'tableName':_0xa0d5('0xc'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfda4=['request-promise','rimraf','../../config/environment','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fb6ed,_0x4c15ae){var _0x33d70c=function(_0x84d461){while(--_0x84d461){_0x2fb6ed['push'](_0x2fb6ed['shift']());}};_0x33d70c(++_0x4c15ae);}(_0xfda4,0x1ba));var _0x4fda=function(_0x261522,_0x1adc1f){_0x261522=_0x261522-0x0;var _0x98a25a=_0xfda4[_0x261522];return _0x98a25a;};'use strict';var _=require(_0x4fda('0x0'));var util=require(_0x4fda('0x1'));var logger=require(_0x4fda('0x2'))(_0x4fda('0x3'));var moment=require(_0x4fda('0x4'));var BPromise=require(_0x4fda('0x5'));var rp=require(_0x4fda('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fda('0x7'));var config=require(_0x4fda('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x4fda('0x9')]=function(_0x24c08b,_0x541b96){return _0x24c08b[_0x4fda('0xa')](_0x4fda('0xb'),attributes,{'tableName':_0x4fda('0xc'),'paranoid':![],'indexes':[{'name':_0x4fda('0xd'),'fields':[_0x4fda('0xe'),_0x4fda('0xf')],'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 67b95b1..b9b066e 100644 --- a/server/api/intSugarcrmField/intSugarcrmField.rpc.js +++ b/server/api/intSugarcrmField/intSugarcrmField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x169790,_0x48aa33){var _0x4d0f36=function(_0x2a848d){while(--_0x2a848d){_0x169790['push'](_0x169790['shift']());}};_0x4d0f36(++_0x48aa33);}(_0x14a0,0x8e));var _0x014a=function(_0x986bb1,_0x5024b6){_0x986bb1=_0x986bb1-0x0;var _0x468f28=_0x14a0[_0x986bb1];return _0x468f28;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x5e88a1,_0x11abbf){var _0x48eb01=function(_0xb966fc){while(--_0xb966fc){_0x5e88a1['push'](_0x5e88a1['shift']());}};_0x48eb01(++_0x11abbf);}(_0x2032,0xd9));var _0x2203=function(_0xaf6ba6,_0x378d86){_0xaf6ba6=_0xaf6ba6-0x0;var _0x11cb37=_0x2032[_0xaf6ba6];return _0x11cb37;};'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')]('SugarcrmField,\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')]('SugarcrmField,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('SugarcrmField,\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 diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 79c27e4..535b1aa 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 _0x52cc=['../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x33e4a2,_0x39316d){var _0x15e82a=function(_0xb9586e){while(--_0xb9586e){_0x33e4a2['push'](_0x33e4a2['shift']());}};_0x15e82a(++_0x39316d);}(_0x52cc,0x1c1));var _0xc52c=function(_0x34c03a,_0x5a1942){_0x34c03a=_0x34c03a-0x0;var _0x41eb10=_0x52cc[_0x34c03a];return _0x41eb10;};'use strict';var multer=require(_0xc52c('0x0'));var util=require(_0xc52c('0x1'));var path=require(_0xc52c('0x2'));var timeout=require(_0xc52c('0x3'));var express=require(_0xc52c('0x4'));var router=express[_0xc52c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc52c('0x6'));var config=require(_0xc52c('0x7'));var controller=require(_0xc52c('0x8'));router[_0xc52c('0x9')]('/',auth[_0xc52c('0xa')](),controller[_0xc52c('0xb')]);router['get'](_0xc52c('0xc'),auth[_0xc52c('0xa')](),controller[_0xc52c('0xd')]);router[_0xc52c('0x9')](_0xc52c('0xe'),auth[_0xc52c('0xa')](),controller[_0xc52c('0xf')]);router[_0xc52c('0x9')](_0xc52c('0x10'),auth[_0xc52c('0xa')](),controller[_0xc52c('0x11')]);router['post']('/',auth[_0xc52c('0xa')](),controller[_0xc52c('0x12')]);router[_0xc52c('0x13')](_0xc52c('0xe'),auth[_0xc52c('0xa')](),controller[_0xc52c('0x14')]);router['put'](_0xc52c('0xc'),auth[_0xc52c('0xa')](),controller[_0xc52c('0x15')]);router[_0xc52c('0x16')](_0xc52c('0xc'),auth[_0xc52c('0xa')](),controller[_0xc52c('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2d34=['./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f0d5e,_0xf52c0c){var _0x25c0a3=function(_0x124cf4){while(--_0x124cf4){_0x2f0d5e['push'](_0x2f0d5e['shift']());}};_0x25c0a3(++_0xf52c0c);}(_0x2d34,0x1ec));var _0x42d3=function(_0x2b33ef,_0x4e64c6){_0x2b33ef=_0x2b33ef-0x0;var _0x4d4f2d=_0x2d34[_0x2b33ef];return _0x4d4f2d;};'use strict';var multer=require(_0x42d3('0x0'));var util=require(_0x42d3('0x1'));var path=require(_0x42d3('0x2'));var timeout=require(_0x42d3('0x3'));var express=require(_0x42d3('0x4'));var router=express['Router']();var auth=require(_0x42d3('0x5'));var interaction=require(_0x42d3('0x6'));var config=require(_0x42d3('0x7'));var controller=require(_0x42d3('0x8'));router[_0x42d3('0x9')]('/',auth[_0x42d3('0xa')](),controller[_0x42d3('0xb')]);router[_0x42d3('0x9')](_0x42d3('0xc'),auth[_0x42d3('0xa')](),controller[_0x42d3('0xd')]);router[_0x42d3('0x9')]('/:id/configurations',auth[_0x42d3('0xa')](),controller[_0x42d3('0xe')]);router[_0x42d3('0x9')](_0x42d3('0xf'),auth[_0x42d3('0xa')](),controller[_0x42d3('0x10')]);router[_0x42d3('0x11')]('/',auth[_0x42d3('0xa')](),controller[_0x42d3('0x12')]);router[_0x42d3('0x11')](_0x42d3('0x13'),auth[_0x42d3('0xa')](),controller[_0x42d3('0x14')]);router['put'](_0x42d3('0xc'),auth[_0x42d3('0xa')](),controller[_0x42d3('0x15')]);router[_0x42d3('0x16')](_0x42d3('0xc'),auth['isAuthenticated'](),controller[_0x42d3('0x17')]);module[_0x42d3('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index d16d37f..a5b621a 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 _0x90fa=['STRING','HelpDesk','sequelize','exports'];(function(_0x77485d,_0x1c1392){var _0x2e3304=function(_0x14f017){while(--_0x14f017){_0x77485d['push'](_0x77485d['shift']());}};_0x2e3304(++_0x1c1392);}(_0x90fa,0x172));var _0xa90f=function(_0x1adcc4,_0x45e751){_0x1adcc4=_0x1adcc4-0x0;var _0x34a040=_0x90fa[_0x1adcc4];return _0x34a040;};'use strict';var Sequelize=require(_0xa90f('0x0'));module[_0xa90f('0x1')]={'name':{'type':Sequelize[_0xa90f('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa90f('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa90f('0x3')},'remoteUri':{'type':Sequelize[_0xa90f('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xa90f('0x2')]},'accessKey':{'type':Sequelize[_0xa90f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xe546=['exports','STRING','HelpDesk','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe546,0x1df));var _0x6e54=function(_0x4d3691,_0x4b13d1){_0x4d3691=_0x4d3691-0x0;var _0x576257=_0xe546[_0x4d3691];return _0x576257;};'use strict';var Sequelize=require(_0x6e54('0x0'));module[_0x6e54('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6e54('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6e54('0x2')],'allowNull':![],'defaultValue':_0x6e54('0x3')},'remoteUri':{'type':Sequelize[_0x6e54('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6e54('0x2')]},'accessKey':{'type':Sequelize[_0x6e54('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 ab92ee2..ee4d980 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 _0x0a27=['bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','include','catch','params','fields','find','create','body','getConfigurations','findOne','VtigerConfiguration','filter','addConfiguration','AccountId','getSubjects','channel','type','getDescriptions','VtigerField','Subjects','md5','getFields','username','description','moduleName','remoteUri','serverUrl','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise'];(function(_0xae4dec,_0x4bc635){var _0x36a0a9=function(_0x181e11){while(--_0x181e11){_0xae4dec['push'](_0xae4dec['shift']());}};_0x36a0a9(++_0x4bc635);}(_0x0a27,0xf9));var _0x70a2=function(_0x5bf234,_0x19ba4a){_0x5bf234=_0x5bf234-0x0;var _0x5d6144=_0x0a27[_0x5bf234];return _0x5d6144;};'use strict';var pdf=require(_0x70a2('0x0'));var emlformat=require(_0x70a2('0x1'));var rimraf=require(_0x70a2('0x2'));var zipdir=require(_0x70a2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x70a2('0x4'));var moment=require('moment');var BPromise=require(_0x70a2('0x5'));var Mustache=require('mustache');var util=require(_0x70a2('0x6'));var path=require(_0x70a2('0x7'));var sox=require(_0x70a2('0x8'));var csv=require(_0x70a2('0x9'));var ejs=require(_0x70a2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x70a2('0xb'));var crypto=require(_0x70a2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x70a2('0xd'));var toCsv=require('to-csv');var querystring=require(_0x70a2('0xe'));var Papa=require('papaparse');var Redis=require(_0x70a2('0xf'));var authService=require(_0x70a2('0x10'));var qs=require(_0x70a2('0x11'));var as=require(_0x70a2('0x12'));var hardwareService=require(_0x70a2('0x13'));var logger=require(_0x70a2('0x14'))(_0x70a2('0x15'));var utils=require(_0x70a2('0x16'));var config=require('../../config/environment');var db=require(_0x70a2('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x70a2('0x18'));var client=jayson['client'][_0x70a2('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5ebbbd,_0x172813,_0x5a669f){if(_0x5a669f){var _0x5445bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5445bd['test'](_0x172813)){return _0x5ebbbd;}else{throw new db['Sequelize'][(_0x70a2('0x1a'))](_0x70a2('0x1b'));}}else{return _0x5ebbbd;}}function respondWithRpcPromise(_0x49f56e,_0x1a554f,_0xe22caf,_0xe08bc3){return new BPromise(function(_0x17ac5a,_0x808c24){var _0x882844=_0xe08bc3||client;return _0x882844[_0x70a2('0x1c')](_0x49f56e,_0xe22caf)[_0x70a2('0x1d')](function(_0x416acd){logger['info'](_0x70a2('0x1e'),_0x1a554f,_0x70a2('0x1f'));logger[_0x70a2('0x20')](_0x70a2('0x21'),_0x1a554f,_0x70a2('0x1f'),JSON[_0x70a2('0x22')](_0x416acd));if(_0x416acd[_0x70a2('0x23')]){if(_0x416acd['error'][_0x70a2('0x24')]===0x1f4){logger['error'](_0x70a2('0x1e'),_0x1a554f,_0x416acd['error'][_0x70a2('0x25')]);return _0x808c24(_0x416acd[_0x70a2('0x23')][_0x70a2('0x25')]);}logger[_0x70a2('0x23')](_0x70a2('0x1e'),_0x1a554f,_0x416acd['error'][_0x70a2('0x25')]);return _0x17ac5a(_0x416acd['error'][_0x70a2('0x25')]);}else{logger['info'](_0x70a2('0x1e'),_0x1a554f,_0x70a2('0x1f'));_0x17ac5a(_0x416acd[_0x70a2('0x26')][_0x70a2('0x25')]);}})['catch'](function(_0xed4c1a){logger[_0x70a2('0x23')](_0x70a2('0x1e'),_0x1a554f,_0xed4c1a);_0x808c24(_0xed4c1a);});});}function respondWithStatusCode(_0x345846,_0x3fa5fe){_0x3fa5fe=_0x3fa5fe||0xcc;return function(_0x28e477){if(_0x28e477){return _0x345846[_0x70a2('0x27')](_0x3fa5fe);}return _0x345846[_0x70a2('0x28')](_0x3fa5fe)[_0x70a2('0x29')]();};}function respondWithResult(_0x2d8f68,_0x4faa44){_0x4faa44=_0x4faa44||0xc8;return function(_0x38519a){if(_0x38519a){return _0x2d8f68['status'](_0x4faa44)[_0x70a2('0x2a')](_0x38519a);}};}function respondWithFilteredResult(_0x5e0386,_0x4642fb){return function(_0x32e4f3){if(_0x32e4f3){var _0x55cd5c=_0x32e4f3[_0x70a2('0x2b')],_0x3eec3e=_0x4642fb[_0x70a2('0x2c')],_0x4e4c56=_0x4642fb[_0x70a2('0x2c')]+_0x4642fb['limit'],_0x188407;if(_0x4e4c56>=_0x55cd5c){_0x4e4c56=_0x55cd5c;_0x188407=0xc8;}else{_0x188407=0xce;}_0x5e0386['status'](_0x188407);return _0x5e0386[_0x70a2('0x2d')](_0x70a2('0x2e'),_0x3eec3e+'-'+_0x4e4c56+'/'+_0x55cd5c)[_0x70a2('0x2a')](_0x32e4f3);}return null;};}function patchUpdates(_0x498dec){return function(_0xab66a4){try{jsonpatch['apply'](_0xab66a4,_0x498dec,!![]);}catch(_0x5cb737){return BPromise[_0x70a2('0x2f')](_0x5cb737);}return _0xab66a4[_0x70a2('0x30')]();};}function saveUpdates(_0x389fb7,_0x12f107){return function(_0x519c24){if(_0x519c24){return _0x519c24[_0x70a2('0x31')](_0x389fb7)[_0x70a2('0x1d')](function(_0x1337bb){return _0x1337bb;});}return null;};}function removeEntity(_0x40f40c,_0x5f0845){return function(_0x40ed3e){if(_0x40ed3e){return _0x40ed3e[_0x70a2('0x32')]()['then'](function(){_0x40f40c['status'](0xcc)[_0x70a2('0x29')]();});}};}function handleEntityNotFound(_0x4f1d42,_0x26458b){return function(_0x15aace){if(!_0x15aace){_0x4f1d42[_0x70a2('0x27')](0x194);}return _0x15aace;};}function handleError(_0x93f238,_0x4d9419){_0x4d9419=_0x4d9419||0x1f4;return function(_0x2c5f52){logger[_0x70a2('0x23')](_0x2c5f52['stack']);if(_0x2c5f52[_0x70a2('0x33')]){delete _0x2c5f52['name'];}_0x93f238[_0x70a2('0x28')](_0x4d9419)[_0x70a2('0x34')](_0x2c5f52);};}exports[_0x70a2('0x35')]=function(_0x5781a4,_0x289a39){var _0x56eaae={},_0x2ef374={},_0x7ea383={'count':0x0,'rows':[]};var _0x33f1db=_[_0x70a2('0x36')](db[_0x70a2('0x37')][_0x70a2('0x38')],function(_0x377e0b){return{'name':_0x377e0b[_0x70a2('0x39')],'type':_0x377e0b['type'][_0x70a2('0x3a')]};});_0x2ef374[_0x70a2('0x3b')]=_['map'](_0x33f1db,_0x70a2('0x33'));_0x2ef374[_0x70a2('0x3c')]=_[_0x70a2('0x3d')](_0x5781a4[_0x70a2('0x3c')]);_0x2ef374['filters']=_[_0x70a2('0x3e')](_0x2ef374[_0x70a2('0x3b')],_0x2ef374[_0x70a2('0x3c')]);_0x56eaae[_0x70a2('0x3f')]=_[_0x70a2('0x3e')](_0x2ef374[_0x70a2('0x3b')],qs['fields'](_0x5781a4[_0x70a2('0x3c')]['fields']));_0x56eaae[_0x70a2('0x3f')]=_0x56eaae['attributes'][_0x70a2('0x40')]?_0x56eaae['attributes']:_0x2ef374['model'];if(!_0x5781a4[_0x70a2('0x3c')][_0x70a2('0x41')]('nolimit')){_0x56eaae[_0x70a2('0x42')]=qs[_0x70a2('0x42')](_0x5781a4[_0x70a2('0x3c')]['limit']);_0x56eaae[_0x70a2('0x2c')]=qs[_0x70a2('0x2c')](_0x5781a4[_0x70a2('0x3c')][_0x70a2('0x2c')]);}_0x56eaae[_0x70a2('0x43')]=qs[_0x70a2('0x44')](_0x5781a4[_0x70a2('0x3c')][_0x70a2('0x44')]);_0x56eaae[_0x70a2('0x45')]=qs[_0x70a2('0x46')](_[_0x70a2('0x47')](_0x5781a4['query'],_0x2ef374['filters']),_0x33f1db);if(_0x5781a4[_0x70a2('0x3c')]['filter']){_0x56eaae['where']=_[_0x70a2('0x48')](_0x56eaae[_0x70a2('0x45')],{'$or':_['map'](_0x33f1db,function(_0x3cff42){if(_0x3cff42['type']!==_0x70a2('0x49')){var _0xd9a737={};_0xd9a737[_0x3cff42[_0x70a2('0x33')]]={'$like':'%'+_0x5781a4[_0x70a2('0x3c')]['filter']+'%'};return _0xd9a737;}})});}_0x56eaae=_[_0x70a2('0x48')]({},_0x56eaae,_0x5781a4[_0x70a2('0x4a')]);var _0x44779b={'where':_0x56eaae[_0x70a2('0x45')]};return db[_0x70a2('0x37')][_0x70a2('0x2b')](_0x44779b)[_0x70a2('0x1d')](function(_0x1dace6){_0x7ea383['count']=_0x1dace6;if(_0x5781a4['query'][_0x70a2('0x4b')]){_0x56eaae[_0x70a2('0x4c')]=[{'all':!![]}];}return db[_0x70a2('0x37')]['findAll'](_0x56eaae);})['then'](function(_0x145803){_0x7ea383['rows']=_0x145803;return _0x7ea383;})[_0x70a2('0x1d')](respondWithFilteredResult(_0x289a39,_0x56eaae))[_0x70a2('0x4d')](handleError(_0x289a39,null));};exports['show']=function(_0x49c1f5,_0xa48f5c){var _0x1d7a7e={'raw':![],'where':{'id':_0x49c1f5[_0x70a2('0x4e')]['id']}},_0x1c16ac={};_0x1c16ac[_0x70a2('0x3b')]=_[_0x70a2('0x3d')](db[_0x70a2('0x37')][_0x70a2('0x38')]);_0x1c16ac['query']=_[_0x70a2('0x3d')](_0x49c1f5['query']);_0x1c16ac['filters']=_[_0x70a2('0x3e')](_0x1c16ac[_0x70a2('0x3b')],_0x1c16ac[_0x70a2('0x3c')]);_0x1d7a7e['attributes']=_['intersection'](_0x1c16ac[_0x70a2('0x3b')],qs[_0x70a2('0x4f')](_0x49c1f5[_0x70a2('0x3c')][_0x70a2('0x4f')]));_0x1d7a7e[_0x70a2('0x3f')]=_0x1d7a7e[_0x70a2('0x3f')][_0x70a2('0x40')]?_0x1d7a7e[_0x70a2('0x3f')]:_0x1c16ac[_0x70a2('0x3b')];if(_0x49c1f5['query'][_0x70a2('0x4b')]){_0x1d7a7e[_0x70a2('0x4c')]=[{'all':!![]}];}_0x1d7a7e=_[_0x70a2('0x48')]({},_0x1d7a7e,_0x49c1f5[_0x70a2('0x4a')]);return db[_0x70a2('0x37')][_0x70a2('0x50')](_0x1d7a7e)['then'](handleEntityNotFound(_0xa48f5c,null))[_0x70a2('0x1d')](respondWithResult(_0xa48f5c,null))['catch'](handleError(_0xa48f5c,null));};exports[_0x70a2('0x51')]=function(_0x4d7120,_0x522900){return db['VtigerAccount'][_0x70a2('0x51')](_0x4d7120['body'],{})[_0x70a2('0x1d')](respondWithResult(_0x522900,0xc9))['catch'](handleError(_0x522900,null));};exports[_0x70a2('0x31')]=function(_0x58963a,_0x468f48){if(_0x58963a[_0x70a2('0x52')]['id']){delete _0x58963a[_0x70a2('0x52')]['id'];}return db[_0x70a2('0x37')][_0x70a2('0x50')]({'where':{'id':_0x58963a[_0x70a2('0x4e')]['id']}})[_0x70a2('0x1d')](handleEntityNotFound(_0x468f48,null))[_0x70a2('0x1d')](saveUpdates(_0x58963a[_0x70a2('0x52')],null))[_0x70a2('0x1d')](respondWithResult(_0x468f48,null))[_0x70a2('0x4d')](handleError(_0x468f48,null));};exports[_0x70a2('0x32')]=function(_0x3e093e,_0x3bf735){return db[_0x70a2('0x37')]['find']({'where':{'id':_0x3e093e[_0x70a2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3bf735,null))['then'](removeEntity(_0x3bf735,null))[_0x70a2('0x4d')](handleError(_0x3bf735,null));};exports[_0x70a2('0x53')]=function(_0x4d4474,_0x4c45e5,_0x2f2d35){var _0x499b15={};var _0x116703={};var _0x1f9181;var _0x1f9b96;return db[_0x70a2('0x37')][_0x70a2('0x54')]({'where':{'id':_0x4d4474['params']['id']}})[_0x70a2('0x1d')](handleEntityNotFound(_0x4c45e5,null))[_0x70a2('0x1d')](function(_0x1aa6a8){if(_0x1aa6a8){_0x1f9181=_0x1aa6a8;_0x116703[_0x70a2('0x3b')]=_[_0x70a2('0x3d')](db[_0x70a2('0x55')][_0x70a2('0x38')]);_0x116703[_0x70a2('0x3c')]=_['keys'](_0x4d4474['query']);_0x116703['filters']=_[_0x70a2('0x3e')](_0x116703[_0x70a2('0x3b')],_0x116703[_0x70a2('0x3c')]);_0x499b15['attributes']=_[_0x70a2('0x3e')](_0x116703[_0x70a2('0x3b')],qs[_0x70a2('0x4f')](_0x4d4474[_0x70a2('0x3c')][_0x70a2('0x4f')]));_0x499b15[_0x70a2('0x3f')]=_0x499b15[_0x70a2('0x3f')][_0x70a2('0x40')]?_0x499b15[_0x70a2('0x3f')]:_0x116703[_0x70a2('0x3b')];_0x499b15[_0x70a2('0x43')]=qs[_0x70a2('0x44')](_0x4d4474[_0x70a2('0x3c')][_0x70a2('0x44')]);_0x499b15[_0x70a2('0x45')]=qs[_0x70a2('0x46')](_[_0x70a2('0x47')](_0x4d4474['query'],_0x116703['filters']));if(_0x4d4474[_0x70a2('0x3c')][_0x70a2('0x56')]){_0x499b15[_0x70a2('0x45')]=_[_0x70a2('0x48')](_0x499b15[_0x70a2('0x45')],{'$or':_['map'](_0x499b15['attributes'],function(_0x580e3c){var _0x459e6c={};_0x459e6c[_0x580e3c]={'$like':'%'+_0x4d4474[_0x70a2('0x3c')][_0x70a2('0x56')]+'%'};return _0x459e6c;})});}_0x499b15=_[_0x70a2('0x48')]({},_0x499b15,_0x4d4474['options']);return _0x1f9181[_0x70a2('0x53')](_0x499b15);}})[_0x70a2('0x1d')](function(_0x477525){if(_0x477525){_0x1f9b96=_0x477525[_0x70a2('0x40')];if(!_0x4d4474[_0x70a2('0x3c')][_0x70a2('0x41')]('nolimit')){_0x499b15['limit']=qs[_0x70a2('0x42')](_0x4d4474['query'][_0x70a2('0x42')]);_0x499b15['offset']=qs['offset'](_0x4d4474[_0x70a2('0x3c')][_0x70a2('0x2c')]);}return _0x1f9181[_0x70a2('0x53')](_0x499b15);}})['then'](function(_0x3ecf19){if(_0x3ecf19){return _0x3ecf19?{'count':_0x1f9b96,'rows':_0x3ecf19}:null;}})[_0x70a2('0x1d')](respondWithResult(_0x4c45e5,null))[_0x70a2('0x4d')](handleError(_0x4c45e5,null));};exports[_0x70a2('0x57')]=function(_0x3056fe,_0x51bc9e,_0x8cb961){if(_0x3056fe[_0x70a2('0x52')]['id']){delete _0x3056fe['body']['id'];}return db['VtigerAccount'][_0x70a2('0x54')]({'where':{'id':_0x3056fe['params']['id']}})[_0x70a2('0x1d')](handleEntityNotFound(_0x51bc9e,null))[_0x70a2('0x1d')](function(_0x66e3f1){if(_0x66e3f1){_0x3056fe['body'][_0x70a2('0x58')]=_0x66e3f1['id'];_0x3056fe[_0x70a2('0x52')]['Subjects']=integrations[_0x70a2('0x59')](_0x3056fe[_0x70a2('0x52')][_0x70a2('0x5a')],_0x3056fe[_0x70a2('0x52')][_0x70a2('0x5b')]);_0x3056fe[_0x70a2('0x52')]['Descriptions']=integrations[_0x70a2('0x5c')](_0x3056fe['body']['channel'],_0x3056fe['body'][_0x70a2('0x5b')]);return db[_0x70a2('0x55')][_0x70a2('0x51')](_0x3056fe[_0x70a2('0x52')],{'include':[{'model':db[_0x70a2('0x5d')],'as':_0x70a2('0x5e')},{'model':db[_0x70a2('0x5d')],'as':'Descriptions'}]});}return null;})[_0x70a2('0x1d')](respondWithResult(_0x51bc9e,null))['catch'](handleError(_0x51bc9e,null));};var md5=require(_0x70a2('0x5f'));exports[_0x70a2('0x60')]=function(_0x4367a3,_0x2c7202,_0x2468e9){var _0x41c962=null;var _0x22e297=null;var _0xa0c09a=null;var _0x322a9a=null;var _0x3ac4c5='';return db[_0x70a2('0x37')][_0x70a2('0x54')]({'where':{'id':_0x4367a3[_0x70a2('0x4e')]['id']},'attributes':['id',_0x70a2('0x33'),_0x70a2('0x61'),_0x70a2('0x62'),_0x70a2('0x63'),_0x70a2('0x64'),_0x70a2('0x65'),'accessKey']})['then'](handleEntityNotFound(_0x2c7202,null))[_0x70a2('0x1d')](function(_0x2f3e1d){if(_0x2f3e1d){_0x41c962=_0x2f3e1d['username'];_0x22e297=_0x2f3e1d['accessKey'];_0xa0c09a=_0x2f3e1d['moduleName'];_0x3ac4c5=_0x2f3e1d[_0x70a2('0x64')];var _0x313d00=_0x3ac4c5[_0x70a2('0x66')](-0x1);if(_0x313d00==='/'){_0x3ac4c5=_0x3ac4c5[_0x70a2('0x67')](0x0,_0x3ac4c5['lastIndexOf'](_0x313d00));}_0x322a9a=util[_0x70a2('0x68')](_0x70a2('0x69'),_0x3ac4c5);var _0x1cac20={'method':_0x70a2('0x6a'),'uri':_0x322a9a,'qs':{'operation':_0x70a2('0x6b'),'username':_0x2f3e1d[_0x70a2('0x61')]},'json':!![]};return rp(_0x1cac20);}})[_0x70a2('0x1d')](function(_0x3ec175){if(_0x3ec175[_0x70a2('0x6c')]){var _0x3063c0={'method':_0x70a2('0x6d'),'uri':_0x322a9a,'form':{'operation':_0x70a2('0x6e'),'username':_0x41c962,'accessKey':md5(_0x3ec175[_0x70a2('0x26')][_0x70a2('0x6f')]+_0x22e297)},'json':!![]};return rp(_0x3063c0);}})[_0x70a2('0x1d')](function(_0x2a769e){if(_0x2a769e[_0x70a2('0x6c')]){var _0x4d7222={'method':_0x70a2('0x6a'),'uri':_0x322a9a,'qs':{'operation':'describe','username':_0x41c962,'sessionName':_0x2a769e[_0x70a2('0x26')]['sessionName'],'elementType':_0xa0c09a},'json':!![]};return rp(_0x4d7222);}})[_0x70a2('0x1d')](function(_0x2b128b){if(_0x2b128b[_0x70a2('0x6c')]){var _0xad2bca=[_0x70a2('0x70'),_0x70a2('0x71'),_0x70a2('0x72')];_[_0x70a2('0x73')](_0x2b128b['result']['fields'],function(_0x35f825){return _0xad2bca[_0x70a2('0x74')](_0x35f825[_0x70a2('0x5b')][_0x70a2('0x33')]);});_['remove'](_0x2b128b[_0x70a2('0x26')]['fields'],function(_0x4018ca){return _0x4018ca[_0x70a2('0x75')]===_0x70a2('0x76');});return{'count':_0x2b128b[_0x70a2('0x26')][_0x70a2('0x4f')]['length'],'rows':_['map'](_0x2b128b[_0x70a2('0x26')][_0x70a2('0x4f')],function(_0x47b11a){return{'id':_0x47b11a[_0x70a2('0x33')],'name':_0x47b11a[_0x70a2('0x77')],'custom':_[_0x70a2('0x78')](_0x47b11a[_0x70a2('0x33')],'cf_')?!![]:![],'options':_0x47b11a['type']['name']==='picklist'&&_0x47b11a['type'][_0x70a2('0x79')][_0x70a2('0x40')]>0x0?_[_0x70a2('0x36')](_0x47b11a[_0x70a2('0x5b')][_0x70a2('0x79')],function(_0x2a06e6){return{'name':_0x2a06e6[_0x70a2('0x77')],'value':_0x2a06e6['value']};}):[]};})};}})['then'](respondWithResult(_0x2c7202,null))['catch'](function(_0x36e7d7){console[_0x70a2('0x7a')](_0x70a2('0x7b')+_0x36e7d7);var _0x1d450c=_0x4367a3[_0x70a2('0x3c')][_0x70a2('0x7c')]?0x1f4:_0x36e7d7[_0x70a2('0x7d')]||0x1f4;logger[_0x70a2('0x23')](_0x70a2('0x7e'),_0x70a2('0x60'),_0x1d450c,JSON[_0x70a2('0x22')](_0x36e7d7));delete _0x36e7d7[_0x70a2('0x33')];if(_0x1d450c===0x191){_0x1d450c=0x190;}_0x2c7202[_0x70a2('0x28')](_0x1d450c)['send'](_0x4367a3[_0x70a2('0x3c')][_0x70a2('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x36e7d7[_0x70a2('0x7d')]}:_0x36e7d7);});}; \ No newline at end of file +var _0x5007=['sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','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','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','merge','VtigerAccount','include','rows','show','keys','includeAll','options','create','body','find','params','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','login','token','success','sessionName','autogenerated','owner','remove','editable','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x11df47,_0x18bd89){var _0x52ab06=function(_0x294e9d){while(--_0x294e9d){_0x11df47['push'](_0x11df47['shift']());}};_0x52ab06(++_0x18bd89);}(_0x5007,0xfe));var _0x7500=function(_0x54c87a,_0x12d8e8){_0x54c87a=_0x54c87a-0x0;var _0x5ad548=_0x5007[_0x54c87a];return _0x5ad548;};'use strict';var pdf=require(_0x7500('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7500('0x1'));var zipdir=require(_0x7500('0x2'));var jsonpatch=require(_0x7500('0x3'));var rp=require(_0x7500('0x4'));var moment=require(_0x7500('0x5'));var BPromise=require(_0x7500('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7500('0x7'));var sox=require(_0x7500('0x8'));var csv=require(_0x7500('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7500('0xa'));var crypto=require(_0x7500('0xb'));var jsforce=require(_0x7500('0xc'));var deskjs=require(_0x7500('0xd'));var toCsv=require(_0x7500('0x9'));var querystring=require('querystring');var Papa=require(_0x7500('0xe'));var Redis=require(_0x7500('0xf'));var authService=require(_0x7500('0x10'));var qs=require(_0x7500('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7500('0x12'));var logger=require('../../config/logger')(_0x7500('0x13'));var utils=require(_0x7500('0x14'));var config=require(_0x7500('0x15'));var db=require(_0x7500('0x16'))['db'];var integrations=require(_0x7500('0x17'));var jayson=require(_0x7500('0x18'));var client=jayson[_0x7500('0x19')][_0x7500('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ba245,_0x2ff1b8,_0x462c7f){if(_0x462c7f){var _0x59d996=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59d996[_0x7500('0x1b')](_0x2ff1b8)){return _0x3ba245;}else{throw new db[(_0x7500('0x1c'))][(_0x7500('0x1d'))](_0x7500('0x1e'));}}else{return _0x3ba245;}}function respondWithRpcPromise(_0x16b3c3,_0x44d605,_0x4c31b7,_0x38315e){return new BPromise(function(_0x5cecd2,_0x4e353a){var _0x46e6c8=_0x38315e||client;return _0x46e6c8[_0x7500('0x1f')](_0x16b3c3,_0x4c31b7)[_0x7500('0x20')](function(_0x1c825d){logger[_0x7500('0x21')](_0x7500('0x22'),_0x44d605,'request\x20sent');logger['debug'](_0x7500('0x23'),_0x44d605,_0x7500('0x24'),JSON[_0x7500('0x25')](_0x1c825d));if(_0x1c825d[_0x7500('0x26')]){if(_0x1c825d[_0x7500('0x26')][_0x7500('0x27')]===0x1f4){logger[_0x7500('0x26')](_0x7500('0x22'),_0x44d605,_0x1c825d[_0x7500('0x26')][_0x7500('0x28')]);return _0x4e353a(_0x1c825d['error']['message']);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x44d605,_0x1c825d['error'][_0x7500('0x28')]);return _0x5cecd2(_0x1c825d[_0x7500('0x26')][_0x7500('0x28')]);}else{logger[_0x7500('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x44d605,_0x7500('0x24'));_0x5cecd2(_0x1c825d[_0x7500('0x29')][_0x7500('0x28')]);}})[_0x7500('0x2a')](function(_0x3d960d){logger[_0x7500('0x26')](_0x7500('0x22'),_0x44d605,_0x3d960d);_0x4e353a(_0x3d960d);});});}function respondWithStatusCode(_0x50a8ee,_0x3976c7){_0x3976c7=_0x3976c7||0xcc;return function(_0x281ab5){if(_0x281ab5){return _0x50a8ee[_0x7500('0x2b')](_0x3976c7);}return _0x50a8ee[_0x7500('0x2c')](_0x3976c7)[_0x7500('0x2d')]();};}function respondWithResult(_0x467a1d,_0x249e0c){_0x249e0c=_0x249e0c||0xc8;return function(_0x5b1bb2){if(_0x5b1bb2){return _0x467a1d[_0x7500('0x2c')](_0x249e0c)[_0x7500('0x2e')](_0x5b1bb2);}};}function respondWithFilteredResult(_0x2cc524,_0x5edc24){return function(_0xabdce8){if(_0xabdce8){var _0x51036a=_0xabdce8[_0x7500('0x2f')],_0x28bd35=_0x5edc24[_0x7500('0x30')],_0x4debb9=_0x5edc24[_0x7500('0x30')]+_0x5edc24[_0x7500('0x31')],_0x45b719;if(_0x4debb9>=_0x51036a){_0x4debb9=_0x51036a;_0x45b719=0xc8;}else{_0x45b719=0xce;}_0x2cc524[_0x7500('0x2c')](_0x45b719);return _0x2cc524['set'](_0x7500('0x32'),_0x28bd35+'-'+_0x4debb9+'/'+_0x51036a)[_0x7500('0x2e')](_0xabdce8);}return null;};}function patchUpdates(_0x369466){return function(_0x156e46){try{jsonpatch['apply'](_0x156e46,_0x369466,!![]);}catch(_0x2b3ed8){return BPromise['reject'](_0x2b3ed8);}return _0x156e46[_0x7500('0x33')]();};}function saveUpdates(_0x4b45a2,_0x44127b){return function(_0x4e903d){if(_0x4e903d){return _0x4e903d[_0x7500('0x34')](_0x4b45a2)[_0x7500('0x20')](function(_0x4a5d88){return _0x4a5d88;});}return null;};}function removeEntity(_0x8d5d10,_0x4a93b7){return function(_0x19ebc5){if(_0x19ebc5){return _0x19ebc5[_0x7500('0x35')]()[_0x7500('0x20')](function(){_0x8d5d10['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd31ef8,_0x45fab4){return function(_0x398723){if(!_0x398723){_0xd31ef8[_0x7500('0x2b')](0x194);}return _0x398723;};}function handleError(_0x2d7133,_0x99b3ac){_0x99b3ac=_0x99b3ac||0x1f4;return function(_0x46c9f2){logger[_0x7500('0x26')](_0x46c9f2[_0x7500('0x36')]);if(_0x46c9f2[_0x7500('0x37')]){delete _0x46c9f2['name'];}_0x2d7133['status'](_0x99b3ac)[_0x7500('0x38')](_0x46c9f2);};}exports[_0x7500('0x39')]=function(_0x52a81f,_0x18686b){var _0x1a35ec={},_0x57f579={},_0x2c4780={'count':0x0,'rows':[]};var _0x437dfa=_[_0x7500('0x3a')](db['VtigerAccount'][_0x7500('0x3b')],function(_0x1c6199){return{'name':_0x1c6199[_0x7500('0x3c')],'type':_0x1c6199[_0x7500('0x3d')][_0x7500('0x3e')]};});_0x57f579[_0x7500('0x3f')]=_[_0x7500('0x3a')](_0x437dfa,_0x7500('0x37'));_0x57f579[_0x7500('0x40')]=_['keys'](_0x52a81f[_0x7500('0x40')]);_0x57f579[_0x7500('0x41')]=_[_0x7500('0x42')](_0x57f579[_0x7500('0x3f')],_0x57f579[_0x7500('0x40')]);_0x1a35ec[_0x7500('0x43')]=_[_0x7500('0x42')](_0x57f579[_0x7500('0x3f')],qs['fields'](_0x52a81f[_0x7500('0x40')][_0x7500('0x44')]));_0x1a35ec['attributes']=_0x1a35ec[_0x7500('0x43')][_0x7500('0x45')]?_0x1a35ec[_0x7500('0x43')]:_0x57f579[_0x7500('0x3f')];if(!_0x52a81f[_0x7500('0x40')]['hasOwnProperty'](_0x7500('0x46'))){_0x1a35ec['limit']=qs['limit'](_0x52a81f[_0x7500('0x40')]['limit']);_0x1a35ec[_0x7500('0x30')]=qs[_0x7500('0x30')](_0x52a81f[_0x7500('0x40')][_0x7500('0x30')]);}_0x1a35ec['order']=qs['sort'](_0x52a81f[_0x7500('0x40')][_0x7500('0x47')]);_0x1a35ec['where']=qs[_0x7500('0x41')](_[_0x7500('0x48')](_0x52a81f['query'],_0x57f579[_0x7500('0x41')]),_0x437dfa);if(_0x52a81f['query'][_0x7500('0x49')]){_0x1a35ec[_0x7500('0x4a')]=_['merge'](_0x1a35ec[_0x7500('0x4a')],{'$or':_[_0x7500('0x3a')](_0x437dfa,function(_0x242f19){if(_0x242f19[_0x7500('0x3d')]!==_0x7500('0x4b')){var _0x50e9bc={};_0x50e9bc[_0x242f19['name']]={'$like':'%'+_0x52a81f[_0x7500('0x40')][_0x7500('0x49')]+'%'};return _0x50e9bc;}})});}_0x1a35ec=_[_0x7500('0x4c')]({},_0x1a35ec,_0x52a81f['options']);var _0x35c170={'where':_0x1a35ec[_0x7500('0x4a')]};return db[_0x7500('0x4d')][_0x7500('0x2f')](_0x35c170)[_0x7500('0x20')](function(_0x467f23){_0x2c4780[_0x7500('0x2f')]=_0x467f23;if(_0x52a81f[_0x7500('0x40')]['includeAll']){_0x1a35ec[_0x7500('0x4e')]=[{'all':!![]}];}return db['VtigerAccount']['findAll'](_0x1a35ec);})['then'](function(_0x330272){_0x2c4780[_0x7500('0x4f')]=_0x330272;return _0x2c4780;})[_0x7500('0x20')](respondWithFilteredResult(_0x18686b,_0x1a35ec))[_0x7500('0x2a')](handleError(_0x18686b,null));};exports[_0x7500('0x50')]=function(_0x46fe2d,_0x31d118){var _0x4a1ef1={'raw':![],'where':{'id':_0x46fe2d['params']['id']}},_0x396c7c={};_0x396c7c['model']=_[_0x7500('0x51')](db[_0x7500('0x4d')][_0x7500('0x3b')]);_0x396c7c[_0x7500('0x40')]=_[_0x7500('0x51')](_0x46fe2d[_0x7500('0x40')]);_0x396c7c[_0x7500('0x41')]=_[_0x7500('0x42')](_0x396c7c['model'],_0x396c7c['query']);_0x4a1ef1['attributes']=_['intersection'](_0x396c7c[_0x7500('0x3f')],qs[_0x7500('0x44')](_0x46fe2d[_0x7500('0x40')][_0x7500('0x44')]));_0x4a1ef1[_0x7500('0x43')]=_0x4a1ef1['attributes'][_0x7500('0x45')]?_0x4a1ef1[_0x7500('0x43')]:_0x396c7c[_0x7500('0x3f')];if(_0x46fe2d['query'][_0x7500('0x52')]){_0x4a1ef1[_0x7500('0x4e')]=[{'all':!![]}];}_0x4a1ef1=_['merge']({},_0x4a1ef1,_0x46fe2d[_0x7500('0x53')]);return db[_0x7500('0x4d')]['find'](_0x4a1ef1)[_0x7500('0x20')](handleEntityNotFound(_0x31d118,null))[_0x7500('0x20')](respondWithResult(_0x31d118,null))['catch'](handleError(_0x31d118,null));};exports[_0x7500('0x54')]=function(_0x50f206,_0x4a9808){return db[_0x7500('0x4d')][_0x7500('0x54')](_0x50f206[_0x7500('0x55')],{})[_0x7500('0x20')](respondWithResult(_0x4a9808,0xc9))[_0x7500('0x2a')](handleError(_0x4a9808,null));};exports[_0x7500('0x34')]=function(_0x3302e3,_0x339c4a){if(_0x3302e3[_0x7500('0x55')]['id']){delete _0x3302e3['body']['id'];}return db[_0x7500('0x4d')]['find']({'where':{'id':_0x3302e3['params']['id']}})[_0x7500('0x20')](handleEntityNotFound(_0x339c4a,null))['then'](saveUpdates(_0x3302e3[_0x7500('0x55')],null))[_0x7500('0x20')](respondWithResult(_0x339c4a,null))[_0x7500('0x2a')](handleError(_0x339c4a,null));};exports[_0x7500('0x35')]=function(_0x3080d4,_0x586ab8){return db['VtigerAccount'][_0x7500('0x56')]({'where':{'id':_0x3080d4[_0x7500('0x57')]['id']}})[_0x7500('0x20')](handleEntityNotFound(_0x586ab8,null))['then'](removeEntity(_0x586ab8,null))[_0x7500('0x2a')](handleError(_0x586ab8,null));};exports[_0x7500('0x58')]=function(_0x53a46c,_0x57fdcc,_0x511c17){var _0x588720={};var _0x2a8897={};var _0x2a3ef6;var _0x2eba01;return db['VtigerAccount'][_0x7500('0x59')]({'where':{'id':_0x53a46c[_0x7500('0x57')]['id']}})[_0x7500('0x20')](handleEntityNotFound(_0x57fdcc,null))[_0x7500('0x20')](function(_0x5c6f65){if(_0x5c6f65){_0x2a3ef6=_0x5c6f65;_0x2a8897[_0x7500('0x3f')]=_[_0x7500('0x51')](db[_0x7500('0x5a')][_0x7500('0x3b')]);_0x2a8897[_0x7500('0x40')]=_[_0x7500('0x51')](_0x53a46c[_0x7500('0x40')]);_0x2a8897[_0x7500('0x41')]=_['intersection'](_0x2a8897[_0x7500('0x3f')],_0x2a8897[_0x7500('0x40')]);_0x588720[_0x7500('0x43')]=_[_0x7500('0x42')](_0x2a8897[_0x7500('0x3f')],qs['fields'](_0x53a46c[_0x7500('0x40')][_0x7500('0x44')]));_0x588720['attributes']=_0x588720[_0x7500('0x43')][_0x7500('0x45')]?_0x588720['attributes']:_0x2a8897['model'];_0x588720[_0x7500('0x5b')]=qs[_0x7500('0x47')](_0x53a46c[_0x7500('0x40')][_0x7500('0x47')]);_0x588720[_0x7500('0x4a')]=qs[_0x7500('0x41')](_[_0x7500('0x48')](_0x53a46c[_0x7500('0x40')],_0x2a8897[_0x7500('0x41')]));if(_0x53a46c['query'][_0x7500('0x49')]){_0x588720['where']=_[_0x7500('0x4c')](_0x588720[_0x7500('0x4a')],{'$or':_['map'](_0x588720[_0x7500('0x43')],function(_0x5f1d19){var _0x3d4d47={};_0x3d4d47[_0x5f1d19]={'$like':'%'+_0x53a46c[_0x7500('0x40')]['filter']+'%'};return _0x3d4d47;})});}_0x588720=_[_0x7500('0x4c')]({},_0x588720,_0x53a46c[_0x7500('0x53')]);return _0x2a3ef6[_0x7500('0x58')](_0x588720);}})['then'](function(_0x3f06e2){if(_0x3f06e2){_0x2eba01=_0x3f06e2[_0x7500('0x45')];if(!_0x53a46c[_0x7500('0x40')]['hasOwnProperty'](_0x7500('0x46'))){_0x588720[_0x7500('0x31')]=qs[_0x7500('0x31')](_0x53a46c[_0x7500('0x40')][_0x7500('0x31')]);_0x588720[_0x7500('0x30')]=qs[_0x7500('0x30')](_0x53a46c[_0x7500('0x40')][_0x7500('0x30')]);}return _0x2a3ef6['getConfigurations'](_0x588720);}})[_0x7500('0x20')](function(_0x481f4a){if(_0x481f4a){return _0x481f4a?{'count':_0x2eba01,'rows':_0x481f4a}:null;}})[_0x7500('0x20')](respondWithResult(_0x57fdcc,null))[_0x7500('0x2a')](handleError(_0x57fdcc,null));};exports[_0x7500('0x5c')]=function(_0x13bd77,_0xb7d6fc,_0x38c8c4){if(_0x13bd77['body']['id']){delete _0x13bd77[_0x7500('0x55')]['id'];}return db[_0x7500('0x4d')][_0x7500('0x59')]({'where':{'id':_0x13bd77['params']['id']}})['then'](handleEntityNotFound(_0xb7d6fc,null))[_0x7500('0x20')](function(_0x13be76){if(_0x13be76){_0x13bd77[_0x7500('0x55')][_0x7500('0x5d')]=_0x13be76['id'];_0x13bd77[_0x7500('0x55')][_0x7500('0x5e')]=integrations[_0x7500('0x5f')](_0x13bd77[_0x7500('0x55')][_0x7500('0x60')],_0x13bd77[_0x7500('0x55')]['type']);_0x13bd77[_0x7500('0x55')][_0x7500('0x61')]=integrations['getDescriptions'](_0x13bd77['body']['channel'],_0x13bd77[_0x7500('0x55')][_0x7500('0x3d')]);return db[_0x7500('0x5a')][_0x7500('0x54')](_0x13bd77[_0x7500('0x55')],{'include':[{'model':db[_0x7500('0x62')],'as':_0x7500('0x5e')},{'model':db[_0x7500('0x62')],'as':_0x7500('0x61')}]});}return null;})[_0x7500('0x20')](respondWithResult(_0xb7d6fc,null))['catch'](handleError(_0xb7d6fc,null));};var md5=require(_0x7500('0x63'));exports['getFields']=function(_0x4334e7,_0x234fb7,_0x4103e8){var _0x49da28=null;var _0x367621=null;var _0x26fd3f=null;var _0x1eb57b=null;var _0x5e39c7='';return db[_0x7500('0x4d')][_0x7500('0x59')]({'where':{'id':_0x4334e7[_0x7500('0x57')]['id']},'attributes':['id',_0x7500('0x37'),_0x7500('0x64'),_0x7500('0x65'),'moduleName',_0x7500('0x66'),_0x7500('0x67'),_0x7500('0x68')]})[_0x7500('0x20')](handleEntityNotFound(_0x234fb7,null))[_0x7500('0x20')](function(_0x37f820){if(_0x37f820){_0x49da28=_0x37f820['username'];_0x367621=_0x37f820[_0x7500('0x68')];_0x26fd3f=_0x37f820[_0x7500('0x69')];_0x5e39c7=_0x37f820['remoteUri'];var _0x32e42e=_0x5e39c7[_0x7500('0x6a')](-0x1);if(_0x32e42e==='/'){_0x5e39c7=_0x5e39c7['substring'](0x0,_0x5e39c7[_0x7500('0x6b')](_0x32e42e));}_0x1eb57b=util[_0x7500('0x6c')](_0x7500('0x6d'),_0x5e39c7);var _0x42f68d={'method':_0x7500('0x6e'),'uri':_0x1eb57b,'qs':{'operation':_0x7500('0x6f'),'username':_0x37f820[_0x7500('0x64')]},'json':!![]};return rp(_0x42f68d);}})[_0x7500('0x20')](function(_0x3b44d9){if(_0x3b44d9['success']){var _0x1cc8f0={'method':'POST','uri':_0x1eb57b,'form':{'operation':_0x7500('0x70'),'username':_0x49da28,'accessKey':md5(_0x3b44d9[_0x7500('0x29')][_0x7500('0x71')]+_0x367621)},'json':!![]};return rp(_0x1cc8f0);}})[_0x7500('0x20')](function(_0x392a6c){if(_0x392a6c[_0x7500('0x72')]){var _0xd518f8={'method':_0x7500('0x6e'),'uri':_0x1eb57b,'qs':{'operation':'describe','username':_0x49da28,'sessionName':_0x392a6c[_0x7500('0x29')][_0x7500('0x73')],'elementType':_0x26fd3f},'json':!![]};return rp(_0xd518f8);}})[_0x7500('0x20')](function(_0x124d08){if(_0x124d08['success']){var _0x1f342c=[_0x7500('0x74'),'reference',_0x7500('0x75')];_[_0x7500('0x76')](_0x124d08[_0x7500('0x29')][_0x7500('0x44')],function(_0x492ab3){return _0x1f342c['includes'](_0x492ab3[_0x7500('0x3d')][_0x7500('0x37')]);});_[_0x7500('0x76')](_0x124d08[_0x7500('0x29')][_0x7500('0x44')],function(_0x44cc63){return _0x44cc63[_0x7500('0x77')]==='false';});return{'count':_0x124d08['result'][_0x7500('0x44')][_0x7500('0x45')],'rows':_[_0x7500('0x3a')](_0x124d08[_0x7500('0x29')][_0x7500('0x44')],function(_0x3b086b){return{'id':_0x3b086b[_0x7500('0x37')],'name':_0x3b086b['label'],'custom':_[_0x7500('0x78')](_0x3b086b[_0x7500('0x37')],_0x7500('0x79'))?!![]:![],'options':_0x3b086b[_0x7500('0x3d')][_0x7500('0x37')]===_0x7500('0x7a')&&_0x3b086b['type'][_0x7500('0x7b')][_0x7500('0x45')]>0x0?_[_0x7500('0x3a')](_0x3b086b[_0x7500('0x3d')][_0x7500('0x7b')],function(_0x7cd8fe){return{'name':_0x7cd8fe[_0x7500('0x7c')],'value':_0x7cd8fe[_0x7500('0x7d')]};}):[]};})};}})[_0x7500('0x20')](respondWithResult(_0x234fb7,null))[_0x7500('0x2a')](function(_0x25abd0){console[_0x7500('0x7e')](_0x7500('0x7f')+_0x25abd0);var _0x42d03c=_0x4334e7[_0x7500('0x40')][_0x7500('0x1b')]?0x1f4:_0x25abd0['statusCode']||0x1f4;logger[_0x7500('0x26')](_0x7500('0x80'),_0x7500('0x81'),_0x42d03c,JSON[_0x7500('0x25')](_0x25abd0));delete _0x25abd0[_0x7500('0x37')];if(_0x42d03c===0x191){_0x42d03c=0x190;}_0x234fb7[_0x7500('0x2c')](_0x42d03c)[_0x7500('0x38')](_0x4334e7[_0x7500('0x40')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x25abd0[_0x7500('0x82')]}:_0x25abd0);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 6683b67..e74432a 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 _0x209c=['./intVtigerAccount.attributes','exports','VtigerAccount','int_vtiger_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1fca6c,_0x2bbb55){var _0x4583de=function(_0x3cba69){while(--_0x3cba69){_0x1fca6c['push'](_0x1fca6c['shift']());}};_0x4583de(++_0x2bbb55);}(_0x209c,0xf4));var _0xc209=function(_0x1a4798,_0x36e48f){_0x1a4798=_0x1a4798-0x0;var _0x12bc9d=_0x209c[_0x1a4798];return _0x12bc9d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc209('0x0'))(_0xc209('0x1'));var moment=require(_0xc209('0x2'));var BPromise=require(_0xc209('0x3'));var rp=require(_0xc209('0x4'));var fs=require('fs');var path=require(_0xc209('0x5'));var rimraf=require(_0xc209('0x6'));var config=require(_0xc209('0x7'));var attributes=require(_0xc209('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xc209('0x9')]=function(_0x111ae7,_0x3b7960){return _0x111ae7['define'](_0xc209('0xa'),attributes,{'tableName':_0xc209('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ebc=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x1a4638,_0x3aff85){var _0x4c7799=function(_0x20a89d){while(--_0x20a89d){_0x1a4638['push'](_0x1a4638['shift']());}};_0x4c7799(++_0x3aff85);}(_0x8ebc,0x18c));var _0xc8eb=function(_0x351c61,_0x2a00de){_0x351c61=_0x351c61-0x0;var _0x328bee=_0x8ebc[_0x351c61];return _0x328bee;};'use strict';var _=require(_0xc8eb('0x0'));var util=require('util');var logger=require(_0xc8eb('0x1'))(_0xc8eb('0x2'));var moment=require('moment');var BPromise=require(_0xc8eb('0x3'));var rp=require(_0xc8eb('0x4'));var fs=require('fs');var path=require(_0xc8eb('0x5'));var rimraf=require(_0xc8eb('0x6'));var config=require('../../config/environment');var attributes=require(_0xc8eb('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xc8eb('0x8')]=function(_0x3061ec,_0x5c42ad){return _0x3061ec[_0xc8eb('0x9')](_0xc8eb('0xa'),attributes,{'tableName':_0xc8eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 22a634b..fabbe7f 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 _0x26fe=['request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','catch','VtigerAccount','options','limit','include','map','model','attributes','GetVtigerAccount','ShowVtigerAccount','find','raw','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x556995,_0x17ac79){var _0x30e3b5=function(_0x2e6f78){while(--_0x2e6f78){_0x556995['push'](_0x556995['shift']());}};_0x30e3b5(++_0x17ac79);}(_0x26fe,0x1b0));var _0xe26f=function(_0xb5e33a,_0x575801){_0xb5e33a=_0xb5e33a-0x0;var _0x3ee313=_0x26fe[_0xb5e33a];return _0x3ee313;};'use strict';var _=require('lodash');var util=require(_0xe26f('0x0'));var moment=require(_0xe26f('0x1'));var BPromise=require(_0xe26f('0x2'));var rs=require(_0xe26f('0x3'));var fs=require('fs');var Redis=require(_0xe26f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe26f('0x5'));var logger=require(_0xe26f('0x6'))(_0xe26f('0x7'));var config=require(_0xe26f('0x8'));var jayson=require(_0xe26f('0x9'));var client=jayson[_0xe26f('0xa')][_0xe26f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d1eb4,_0x56d274,_0x10ee81){return new BPromise(function(_0x1bdf75,_0x24d69e){return client[_0xe26f('0xc')](_0x3d1eb4,_0x10ee81)[_0xe26f('0xd')](function(_0x3a0bdb){logger[_0xe26f('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x56d274,_0xe26f('0xf'));logger[_0xe26f('0x10')](_0xe26f('0x11'),_0x56d274,_0xe26f('0xf'),JSON[_0xe26f('0x12')](_0x3a0bdb));if(_0x3a0bdb[_0xe26f('0x13')]){if(_0x3a0bdb[_0xe26f('0x13')][_0xe26f('0x14')]===0x1f4){logger[_0xe26f('0x13')](_0xe26f('0x15'),_0x56d274,_0x3a0bdb['error'][_0xe26f('0x16')]);return _0x24d69e(_0x3a0bdb[_0xe26f('0x13')]['message']);}logger[_0xe26f('0x13')](_0xe26f('0x15'),_0x56d274,_0x3a0bdb[_0xe26f('0x13')]['message']);return _0x1bdf75(_0x3a0bdb['error'][_0xe26f('0x16')]);}else{logger[_0xe26f('0xe')](_0xe26f('0x15'),_0x56d274,'request\x20sent');_0x1bdf75(_0x3a0bdb[_0xe26f('0x17')][_0xe26f('0x16')]);}})[_0xe26f('0x18')](function(_0x4a3779){logger[_0xe26f('0x13')](_0xe26f('0x15'),_0x56d274,_0x4a3779);_0x24d69e(_0x4a3779);});});}exports['GetVtigerAccount']=function(_0x29a835){var _0x2d5f3b=this;return new Promise(function(_0xa6ce57,_0x4c92b9){return db[_0xe26f('0x19')]['findAll']({'raw':_0x29a835[_0xe26f('0x1a')]?_0x29a835['options']['raw']===undefined?!![]:![]:!![],'where':_0x29a835[_0xe26f('0x1a')]?_0x29a835[_0xe26f('0x1a')]['where']||null:null,'attributes':_0x29a835['options']?_0x29a835[_0xe26f('0x1a')]['attributes']||null:null,'limit':_0x29a835[_0xe26f('0x1a')]?_0x29a835[_0xe26f('0x1a')][_0xe26f('0x1b')]||null:null,'include':_0x29a835[_0xe26f('0x1a')]?_0x29a835[_0xe26f('0x1a')][_0xe26f('0x1c')]?_[_0xe26f('0x1d')](_0x29a835[_0xe26f('0x1a')][_0xe26f('0x1c')],function(_0x10b3be){return{'model':db[_0x10b3be[_0xe26f('0x1e')]],'as':_0x10b3be['as'],'attributes':_0x10b3be[_0xe26f('0x1f')],'include':_0x10b3be[_0xe26f('0x1c')]?_[_0xe26f('0x1d')](_0x10b3be[_0xe26f('0x1c')],function(_0x5bb09d){return{'model':db[_0x5bb09d['model']],'as':_0x5bb09d['as'],'attributes':_0x5bb09d[_0xe26f('0x1f')],'include':_0x5bb09d['include']?_[_0xe26f('0x1d')](_0x5bb09d['include'],function(_0x59fa79){return{'model':db[_0x59fa79[_0xe26f('0x1e')]],'as':_0x59fa79['as'],'attributes':_0x59fa79[_0xe26f('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5538a8){logger[_0xe26f('0xe')](_0xe26f('0x20'),_0x29a835);logger[_0xe26f('0x10')]('GetVtigerAccount',_0x29a835,JSON[_0xe26f('0x12')](_0x5538a8));_0xa6ce57(_0x5538a8);})[_0xe26f('0x18')](function(_0x359be5){logger['error'](_0xe26f('0x20'),_0x359be5[_0xe26f('0x16')],_0x29a835);_0x4c92b9(_0x2d5f3b['error'](0x1f4,_0x359be5[_0xe26f('0x16')]));});});};exports[_0xe26f('0x21')]=function(_0x30830d){var _0xd59fc=this;return new Promise(function(_0x4051b8,_0x105ad0){return db[_0xe26f('0x19')][_0xe26f('0x22')]({'raw':_0x30830d['options']?_0x30830d[_0xe26f('0x1a')][_0xe26f('0x23')]===undefined?!![]:![]:!![],'where':_0x30830d[_0xe26f('0x1a')]?_0x30830d[_0xe26f('0x1a')][_0xe26f('0x24')]||null:null,'attributes':_0x30830d[_0xe26f('0x1a')]?_0x30830d[_0xe26f('0x1a')][_0xe26f('0x1f')]||null:null,'include':_0x30830d['options']?_0x30830d[_0xe26f('0x1a')][_0xe26f('0x1c')]?_[_0xe26f('0x1d')](_0x30830d[_0xe26f('0x1a')][_0xe26f('0x1c')],function(_0x4ea5a8){return{'model':db[_0x4ea5a8[_0xe26f('0x1e')]],'as':_0x4ea5a8['as'],'attributes':_0x4ea5a8[_0xe26f('0x1f')],'include':_0x4ea5a8[_0xe26f('0x1c')]?_[_0xe26f('0x1d')](_0x4ea5a8[_0xe26f('0x1c')],function(_0x53d0c5){return{'model':db[_0x53d0c5['model']],'as':_0x53d0c5['as'],'attributes':_0x53d0c5['attributes'],'include':_0x53d0c5['include']?_[_0xe26f('0x1d')](_0x53d0c5[_0xe26f('0x1c')],function(_0x529403){return{'model':db[_0x529403[_0xe26f('0x1e')]],'as':_0x529403['as'],'attributes':_0x529403[_0xe26f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xe26f('0xd')](function(_0x5d50a9){logger[_0xe26f('0xe')](_0xe26f('0x21'),_0x30830d);logger[_0xe26f('0x10')](_0xe26f('0x21'),_0x30830d,JSON['stringify'](_0x5d50a9));_0x4051b8(_0x5d50a9);})[_0xe26f('0x18')](function(_0x2c61f7){logger['error'](_0xe26f('0x21'),_0x2c61f7[_0xe26f('0x16')],_0x30830d);_0x105ad0(_0xd59fc[_0xe26f('0x13')](0x1f4,_0x2c61f7['message']));});});}; \ No newline at end of file +var _0xae07=['../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetVtigerAccount','VtigerAccount','findAll','options','where','include','map','attributes','model','debug','catch','ShowVtigerAccount','find','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x33fc43,_0x4b9e92){var _0x5666a9=function(_0x2fa26f){while(--_0x2fa26f){_0x33fc43['push'](_0x33fc43['shift']());}};_0x5666a9(++_0x4b9e92);}(_0xae07,0x14e));var _0x7ae0=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xae07[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x7ae0('0x0'));var util=require(_0x7ae0('0x1'));var moment=require(_0x7ae0('0x2'));var BPromise=require('bluebird');var rs=require(_0x7ae0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ae0('0x4'))['db'];var utils=require(_0x7ae0('0x5'));var logger=require(_0x7ae0('0x6'))(_0x7ae0('0x7'));var config=require('../../config/environment');var jayson=require(_0x7ae0('0x8'));var client=jayson[_0x7ae0('0x9')][_0x7ae0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x333e27,_0x1f23c4,_0x3a470e){return new BPromise(function(_0x31eed4,_0x311f06){return client[_0x7ae0('0xb')](_0x333e27,_0x3a470e)[_0x7ae0('0xc')](function(_0x59ff0b){logger['info'](_0x7ae0('0xd'),_0x1f23c4,'request\x20sent');logger['debug'](_0x7ae0('0xe'),_0x1f23c4,'request\x20sent',JSON[_0x7ae0('0xf')](_0x59ff0b));if(_0x59ff0b[_0x7ae0('0x10')]){if(_0x59ff0b[_0x7ae0('0x10')]['code']===0x1f4){logger['error'](_0x7ae0('0xd'),_0x1f23c4,_0x59ff0b['error'][_0x7ae0('0x11')]);return _0x311f06(_0x59ff0b[_0x7ae0('0x10')][_0x7ae0('0x11')]);}logger[_0x7ae0('0x10')](_0x7ae0('0xd'),_0x1f23c4,_0x59ff0b[_0x7ae0('0x10')][_0x7ae0('0x11')]);return _0x31eed4(_0x59ff0b[_0x7ae0('0x10')][_0x7ae0('0x11')]);}else{logger['info'](_0x7ae0('0xd'),_0x1f23c4,_0x7ae0('0x12'));_0x31eed4(_0x59ff0b[_0x7ae0('0x13')][_0x7ae0('0x11')]);}})['catch'](function(_0x539f22){logger[_0x7ae0('0x10')](_0x7ae0('0xd'),_0x1f23c4,_0x539f22);_0x311f06(_0x539f22);});});}exports[_0x7ae0('0x14')]=function(_0x1a1db6){var _0x45bac2=this;return new Promise(function(_0x189e12,_0x3bc352){return db[_0x7ae0('0x15')][_0x7ae0('0x16')]({'raw':_0x1a1db6['options']?_0x1a1db6[_0x7ae0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1a1db6[_0x7ae0('0x17')]?_0x1a1db6[_0x7ae0('0x17')][_0x7ae0('0x18')]||null:null,'attributes':_0x1a1db6[_0x7ae0('0x17')]?_0x1a1db6[_0x7ae0('0x17')]['attributes']||null:null,'limit':_0x1a1db6[_0x7ae0('0x17')]?_0x1a1db6[_0x7ae0('0x17')]['limit']||null:null,'include':_0x1a1db6[_0x7ae0('0x17')]?_0x1a1db6[_0x7ae0('0x17')][_0x7ae0('0x19')]?_[_0x7ae0('0x1a')](_0x1a1db6['options'][_0x7ae0('0x19')],function(_0x227d6c){return{'model':db[_0x227d6c['model']],'as':_0x227d6c['as'],'attributes':_0x227d6c[_0x7ae0('0x1b')],'include':_0x227d6c[_0x7ae0('0x19')]?_['map'](_0x227d6c['include'],function(_0x46120d){return{'model':db[_0x46120d['model']],'as':_0x46120d['as'],'attributes':_0x46120d['attributes'],'include':_0x46120d[_0x7ae0('0x19')]?_['map'](_0x46120d['include'],function(_0x11474c){return{'model':db[_0x11474c[_0x7ae0('0x1c')]],'as':_0x11474c['as'],'attributes':_0x11474c[_0x7ae0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7ae0('0xc')](function(_0x136807){logger['info']('GetVtigerAccount',_0x1a1db6);logger[_0x7ae0('0x1d')](_0x7ae0('0x14'),_0x1a1db6,JSON['stringify'](_0x136807));_0x189e12(_0x136807);})[_0x7ae0('0x1e')](function(_0x415edf){logger[_0x7ae0('0x10')](_0x7ae0('0x14'),_0x415edf[_0x7ae0('0x11')],_0x1a1db6);_0x3bc352(_0x45bac2[_0x7ae0('0x10')](0x1f4,_0x415edf['message']));});});};exports[_0x7ae0('0x1f')]=function(_0x1059df){var _0x457cb2=this;return new Promise(function(_0x179e79,_0x10dd2c){return db[_0x7ae0('0x15')][_0x7ae0('0x20')]({'raw':_0x1059df['options']?_0x1059df['options'][_0x7ae0('0x21')]===undefined?!![]:![]:!![],'where':_0x1059df[_0x7ae0('0x17')]?_0x1059df[_0x7ae0('0x17')]['where']||null:null,'attributes':_0x1059df[_0x7ae0('0x17')]?_0x1059df[_0x7ae0('0x17')][_0x7ae0('0x1b')]||null:null,'include':_0x1059df['options']?_0x1059df['options'][_0x7ae0('0x19')]?_[_0x7ae0('0x1a')](_0x1059df[_0x7ae0('0x17')][_0x7ae0('0x19')],function(_0x176a77){return{'model':db[_0x176a77[_0x7ae0('0x1c')]],'as':_0x176a77['as'],'attributes':_0x176a77[_0x7ae0('0x1b')],'include':_0x176a77[_0x7ae0('0x19')]?_[_0x7ae0('0x1a')](_0x176a77[_0x7ae0('0x19')],function(_0x11a813){return{'model':db[_0x11a813[_0x7ae0('0x1c')]],'as':_0x11a813['as'],'attributes':_0x11a813['attributes'],'include':_0x11a813['include']?_[_0x7ae0('0x1a')](_0x11a813[_0x7ae0('0x19')],function(_0x592f12){return{'model':db[_0x592f12['model']],'as':_0x592f12['as'],'attributes':_0x592f12[_0x7ae0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7ae0('0xc')](function(_0x26fab9){logger['info'](_0x7ae0('0x1f'),_0x1059df);logger[_0x7ae0('0x1d')]('ShowVtigerAccount',_0x1059df,JSON[_0x7ae0('0xf')](_0x26fab9));_0x179e79(_0x26fab9);})[_0x7ae0('0x1e')](function(_0x146d65){logger[_0x7ae0('0x10')](_0x7ae0('0x1f'),_0x146d65['message'],_0x1059df);_0x10dd2c(_0x457cb2[_0x7ae0('0x10')](0x1f4,_0x146d65[_0x7ae0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 1554059..c94bddb 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x267867,_0x1b632b){var _0x23a37a=function(_0x2a1283){while(--_0x2a1283){_0x267867['push'](_0x267867['shift']());}};_0x23a37a(++_0x1b632b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a10e3,_0x3cdb35){_0x3a10e3=_0x3a10e3-0x0;var _0xf067c8=_0x5f2f[_0x3a10e3];return _0xf067c8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _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(_0x57663c,_0x14624b){var _0x1139b1=function(_0x4af326){while(--_0x4af326){_0x57663c['push'](_0x57663c['shift']());}};_0x1139b1(++_0x14624b);}(_0xb10b,0x12a));var _0xbb10=function(_0x403c8d,_0x5e3825){_0x403c8d=_0x403c8d-0x0;var _0x4ca60d=_0xb10b[_0x403c8d];return _0x4ca60d;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6d60d26..386cbad 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 _0x8f6d=['sequelize','STRING'];(function(_0x335cba,_0x156ad5){var _0x2d9f05=function(_0x561868){while(--_0x561868){_0x335cba['push'](_0x335cba['shift']());}};_0x2d9f05(++_0x156ad5);}(_0x8f6d,0xae));var _0xd8f6=function(_0x57ce02,_0x125622){_0x57ce02=_0x57ce02-0x0;var _0x36bc51=_0x8f6d[_0x57ce02];return _0x36bc51;};'use strict';var Sequelize=require(_0xd8f6('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd8f6('0x1')]}}; \ No newline at end of file +var _0x9c2f=['exports','STRING','sequelize'];(function(_0x44b005,_0x51199e){var _0x304f0b=function(_0x5a810e){while(--_0x5a810e){_0x44b005['push'](_0x44b005['shift']());}};_0x304f0b(++_0x51199e);}(_0x9c2f,0x134));var _0xf9c2=function(_0x4e879b,_0x1ce91d){_0x4e879b=_0x4e879b-0x0;var _0x5b0ce3=_0x9c2f[_0x4e879b];return _0x5b0ce3;};'use strict';var Sequelize=require(_0xf9c2('0x0'));module[_0xf9c2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf9c2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0cd5726..d661c13 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 _0x64a4=['pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','find','create','body','params','getFields','findOne','VtigerField','order','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','destroy','stack','name','send','map','VtigerConfiguration','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','where'];(function(_0x16fe01,_0x5039e1){var _0x56c48a=function(_0x419884){while(--_0x419884){_0x16fe01['push'](_0x16fe01['shift']());}};_0x56c48a(++_0x5039e1);}(_0x64a4,0x1d2));var _0x464a=function(_0x4a9d03,_0x3db157){_0x4a9d03=_0x4a9d03-0x0;var _0x3ec097=_0x64a4[_0x4a9d03];return _0x3ec097;};'use strict';var pdf=require(_0x464a('0x0'));var emlformat=require(_0x464a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x464a('0x2'));var jsonpatch=require(_0x464a('0x3'));var rp=require('request-promise');var moment=require(_0x464a('0x4'));var BPromise=require(_0x464a('0x5'));var Mustache=require(_0x464a('0x6'));var util=require(_0x464a('0x7'));var path=require(_0x464a('0x8'));var sox=require(_0x464a('0x9'));var csv=require('to-csv');var ejs=require(_0x464a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x464a('0xb'));var crypto=require(_0x464a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x464a('0xd'));var toCsv=require(_0x464a('0xe'));var querystring=require(_0x464a('0xf'));var Papa=require(_0x464a('0x10'));var Redis=require(_0x464a('0x11'));var authService=require(_0x464a('0x12'));var qs=require(_0x464a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x464a('0x14'));var logger=require(_0x464a('0x15'))(_0x464a('0x16'));var utils=require(_0x464a('0x17'));var config=require('../../config/environment');var db=require(_0x464a('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x464a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x13bff9,_0x57960e,_0x49f47d){if(_0x49f47d){var _0x4aafa6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4aafa6[_0x464a('0x1a')](_0x57960e)){return _0x13bff9;}else{throw new db['Sequelize'][(_0x464a('0x1b'))](_0x464a('0x1c'));}}else{return _0x13bff9;}}function respondWithRpcPromise(_0x20d908,_0x19141f,_0x5e8424,_0x48a10b){return new BPromise(function(_0x5c1155,_0x5c7556){var _0x173c75=_0x48a10b||client;return _0x173c75[_0x464a('0x1d')](_0x20d908,_0x5e8424)[_0x464a('0x1e')](function(_0x4e3b74){logger[_0x464a('0x1f')](_0x464a('0x20'),_0x19141f,'request\x20sent');logger['debug'](_0x464a('0x21'),_0x19141f,_0x464a('0x22'),JSON['stringify'](_0x4e3b74));if(_0x4e3b74['error']){if(_0x4e3b74['error'][_0x464a('0x23')]===0x1f4){logger[_0x464a('0x24')]('VtigerConfiguration,\x20%s,\x20%s',_0x19141f,_0x4e3b74[_0x464a('0x24')]['message']);return _0x5c7556(_0x4e3b74[_0x464a('0x24')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x19141f,_0x4e3b74[_0x464a('0x24')][_0x464a('0x25')]);return _0x5c1155(_0x4e3b74[_0x464a('0x24')]['message']);}else{logger[_0x464a('0x1f')](_0x464a('0x20'),_0x19141f,_0x464a('0x22'));_0x5c1155(_0x4e3b74[_0x464a('0x26')]['message']);}})['catch'](function(_0x4f0989){logger['error'](_0x464a('0x20'),_0x19141f,_0x4f0989);_0x5c7556(_0x4f0989);});});}function respondWithStatusCode(_0x2bef5e,_0x5573c8){_0x5573c8=_0x5573c8||0xcc;return function(_0x27d4e0){if(_0x27d4e0){return _0x2bef5e[_0x464a('0x27')](_0x5573c8);}return _0x2bef5e[_0x464a('0x28')](_0x5573c8)[_0x464a('0x29')]();};}function respondWithResult(_0x4b8d71,_0x7810b1){_0x7810b1=_0x7810b1||0xc8;return function(_0x56b17e){if(_0x56b17e){return _0x4b8d71[_0x464a('0x28')](_0x7810b1)[_0x464a('0x2a')](_0x56b17e);}};}function respondWithFilteredResult(_0x4a45b2,_0x13b54c){return function(_0x3d762c){if(_0x3d762c){var _0x30d2dd=_0x3d762c[_0x464a('0x2b')],_0x17cd08=_0x13b54c[_0x464a('0x2c')],_0x42478d=_0x13b54c[_0x464a('0x2c')]+_0x13b54c['limit'],_0x1a8fb4;if(_0x42478d>=_0x30d2dd){_0x42478d=_0x30d2dd;_0x1a8fb4=0xc8;}else{_0x1a8fb4=0xce;}_0x4a45b2['status'](_0x1a8fb4);return _0x4a45b2['set'](_0x464a('0x2d'),_0x17cd08+'-'+_0x42478d+'/'+_0x30d2dd)[_0x464a('0x2a')](_0x3d762c);}return null;};}function patchUpdates(_0x2845fb){return function(_0x2e9a0a){try{jsonpatch[_0x464a('0x2e')](_0x2e9a0a,_0x2845fb,!![]);}catch(_0x5e0046){return BPromise[_0x464a('0x2f')](_0x5e0046);}return _0x2e9a0a[_0x464a('0x30')]();};}function saveUpdates(_0x3345d1,_0x144cb8){return function(_0x4ea26d){if(_0x4ea26d){return _0x4ea26d['update'](_0x3345d1)[_0x464a('0x1e')](function(_0x47798f){return _0x47798f;});}return null;};}function removeEntity(_0x3c604a,_0x3be369){return function(_0xc89b55){if(_0xc89b55){return _0xc89b55[_0x464a('0x31')]()['then'](function(){_0x3c604a['status'](0xcc)[_0x464a('0x29')]();});}};}function handleEntityNotFound(_0x258565,_0x5309f2){return function(_0x8d8c75){if(!_0x8d8c75){_0x258565[_0x464a('0x27')](0x194);}return _0x8d8c75;};}function handleError(_0x4cd528,_0x3874e7){_0x3874e7=_0x3874e7||0x1f4;return function(_0x390fa9){logger[_0x464a('0x24')](_0x390fa9[_0x464a('0x32')]);if(_0x390fa9[_0x464a('0x33')]){delete _0x390fa9[_0x464a('0x33')];}_0x4cd528[_0x464a('0x28')](_0x3874e7)[_0x464a('0x34')](_0x390fa9);};}exports['index']=function(_0x25b8fb,_0x340a05){var _0x30801a={},_0x3407bd={},_0x420f53={'count':0x0,'rows':[]};var _0x4e9943=_[_0x464a('0x35')](db[_0x464a('0x36')][_0x464a('0x37')],function(_0x11e9a5){return{'name':_0x11e9a5['fieldName'],'type':_0x11e9a5[_0x464a('0x38')]['key']};});_0x3407bd[_0x464a('0x39')]=_[_0x464a('0x35')](_0x4e9943,_0x464a('0x33'));_0x3407bd[_0x464a('0x3a')]=_['keys'](_0x25b8fb['query']);_0x3407bd[_0x464a('0x3b')]=_[_0x464a('0x3c')](_0x3407bd['model'],_0x3407bd[_0x464a('0x3a')]);_0x30801a['attributes']=_[_0x464a('0x3c')](_0x3407bd['model'],qs[_0x464a('0x3d')](_0x25b8fb[_0x464a('0x3a')][_0x464a('0x3d')]));_0x30801a[_0x464a('0x3e')]=_0x30801a['attributes'][_0x464a('0x3f')]?_0x30801a[_0x464a('0x3e')]:_0x3407bd[_0x464a('0x39')];if(!_0x25b8fb[_0x464a('0x3a')]['hasOwnProperty'](_0x464a('0x40'))){_0x30801a['limit']=qs[_0x464a('0x41')](_0x25b8fb[_0x464a('0x3a')][_0x464a('0x41')]);_0x30801a[_0x464a('0x2c')]=qs[_0x464a('0x2c')](_0x25b8fb[_0x464a('0x3a')][_0x464a('0x2c')]);}_0x30801a['order']=qs[_0x464a('0x42')](_0x25b8fb['query'][_0x464a('0x42')]);_0x30801a[_0x464a('0x43')]=qs[_0x464a('0x3b')](_[_0x464a('0x44')](_0x25b8fb[_0x464a('0x3a')],_0x3407bd[_0x464a('0x3b')]),_0x4e9943);if(_0x25b8fb[_0x464a('0x3a')][_0x464a('0x45')]){_0x30801a[_0x464a('0x43')]=_[_0x464a('0x46')](_0x30801a[_0x464a('0x43')],{'$or':_[_0x464a('0x35')](_0x4e9943,function(_0x3f6512){if(_0x3f6512['type']!==_0x464a('0x47')){var _0x119189={};_0x119189[_0x3f6512[_0x464a('0x33')]]={'$like':'%'+_0x25b8fb[_0x464a('0x3a')][_0x464a('0x45')]+'%'};return _0x119189;}})});}_0x30801a=_[_0x464a('0x46')]({},_0x30801a,_0x25b8fb[_0x464a('0x48')]);var _0x35c40d={'where':_0x30801a[_0x464a('0x43')]};return db[_0x464a('0x36')][_0x464a('0x2b')](_0x35c40d)[_0x464a('0x1e')](function(_0x5b19e7){_0x420f53[_0x464a('0x2b')]=_0x5b19e7;if(_0x25b8fb[_0x464a('0x3a')][_0x464a('0x49')]){_0x30801a['include']=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x30801a);})['then'](function(_0x314778){_0x420f53[_0x464a('0x4a')]=_0x314778;return _0x420f53;})[_0x464a('0x1e')](respondWithFilteredResult(_0x340a05,_0x30801a))[_0x464a('0x4b')](handleError(_0x340a05,null));};exports['show']=function(_0x35dc2d,_0x2c9b44){var _0x5ba763={'raw':![],'where':{'id':_0x35dc2d['params']['id']}},_0x898061={};_0x898061['model']=_[_0x464a('0x4c')](db[_0x464a('0x36')][_0x464a('0x37')]);_0x898061[_0x464a('0x3a')]=_[_0x464a('0x4c')](_0x35dc2d[_0x464a('0x3a')]);_0x898061[_0x464a('0x3b')]=_[_0x464a('0x3c')](_0x898061[_0x464a('0x39')],_0x898061['query']);_0x5ba763[_0x464a('0x3e')]=_['intersection'](_0x898061[_0x464a('0x39')],qs[_0x464a('0x3d')](_0x35dc2d['query'][_0x464a('0x3d')]));_0x5ba763['attributes']=_0x5ba763[_0x464a('0x3e')]['length']?_0x5ba763[_0x464a('0x3e')]:_0x898061['model'];if(_0x35dc2d[_0x464a('0x3a')]['includeAll']){_0x5ba763[_0x464a('0x4d')]=[{'all':!![]}];}_0x5ba763=_[_0x464a('0x46')]({},_0x5ba763,_0x35dc2d['options']);return db['VtigerConfiguration'][_0x464a('0x4e')](_0x5ba763)[_0x464a('0x1e')](handleEntityNotFound(_0x2c9b44,null))[_0x464a('0x1e')](respondWithResult(_0x2c9b44,null))['catch'](handleError(_0x2c9b44,null));};exports[_0x464a('0x4f')]=function(_0x4ae88f,_0xe3fefe){return db[_0x464a('0x36')]['create'](_0x4ae88f[_0x464a('0x50')],{})[_0x464a('0x1e')](respondWithResult(_0xe3fefe,0xc9))[_0x464a('0x4b')](handleError(_0xe3fefe,null));};exports['update']=function(_0x4524f7,_0x251ea9){if(_0x4524f7[_0x464a('0x50')]['id']){delete _0x4524f7['body']['id'];}return db[_0x464a('0x36')][_0x464a('0x4e')]({'where':{'id':_0x4524f7[_0x464a('0x51')]['id']}})[_0x464a('0x1e')](handleEntityNotFound(_0x251ea9,null))[_0x464a('0x1e')](saveUpdates(_0x4524f7[_0x464a('0x50')],null))['then'](respondWithResult(_0x251ea9,null))[_0x464a('0x4b')](handleError(_0x251ea9,null));};exports[_0x464a('0x31')]=function(_0x111ec2,_0x1340bc){return db[_0x464a('0x36')][_0x464a('0x4e')]({'where':{'id':_0x111ec2[_0x464a('0x51')]['id']}})[_0x464a('0x1e')](handleEntityNotFound(_0x1340bc,null))[_0x464a('0x1e')](removeEntity(_0x1340bc,null))[_0x464a('0x4b')](handleError(_0x1340bc,null));};exports[_0x464a('0x52')]=function(_0x48944c,_0x4cd7b5,_0x5e94a8){var _0x3fa735={};var _0x75f585={};var _0x2eb1dc;var _0xa0848d;return db[_0x464a('0x36')][_0x464a('0x53')]({'where':{'id':_0x48944c[_0x464a('0x51')]['id']}})[_0x464a('0x1e')](handleEntityNotFound(_0x4cd7b5,null))[_0x464a('0x1e')](function(_0x4f4371){if(_0x4f4371){_0x2eb1dc=_0x4f4371;_0x75f585['model']=_[_0x464a('0x4c')](db[_0x464a('0x54')][_0x464a('0x37')]);_0x75f585[_0x464a('0x3a')]=_[_0x464a('0x4c')](_0x48944c[_0x464a('0x3a')]);_0x75f585['filters']=_['intersection'](_0x75f585['model'],_0x75f585['query']);_0x3fa735[_0x464a('0x3e')]=_['intersection'](_0x75f585[_0x464a('0x39')],qs[_0x464a('0x3d')](_0x48944c[_0x464a('0x3a')]['fields']));_0x3fa735[_0x464a('0x3e')]=_0x3fa735[_0x464a('0x3e')][_0x464a('0x3f')]?_0x3fa735[_0x464a('0x3e')]:_0x75f585[_0x464a('0x39')];_0x3fa735[_0x464a('0x55')]=qs['sort'](_0x48944c['query'][_0x464a('0x42')]);_0x3fa735[_0x464a('0x43')]=qs[_0x464a('0x3b')](_[_0x464a('0x44')](_0x48944c[_0x464a('0x3a')],_0x75f585[_0x464a('0x3b')]));if(_0x48944c['query']['filter']){_0x3fa735[_0x464a('0x43')]=_[_0x464a('0x46')](_0x3fa735[_0x464a('0x43')],{'$or':_[_0x464a('0x35')](_0x3fa735['attributes'],function(_0x2201a4){var _0x35c32e={};_0x35c32e[_0x2201a4]={'$like':'%'+_0x48944c[_0x464a('0x3a')][_0x464a('0x45')]+'%'};return _0x35c32e;})});}_0x3fa735=_[_0x464a('0x46')]({},_0x3fa735,_0x48944c[_0x464a('0x48')]);return _0x2eb1dc[_0x464a('0x52')](_0x3fa735);}})['then'](function(_0x32fe44){if(_0x32fe44){_0xa0848d=_0x32fe44[_0x464a('0x3f')];if(!_0x48944c[_0x464a('0x3a')][_0x464a('0x56')](_0x464a('0x40'))){_0x3fa735['limit']=qs['limit'](_0x48944c[_0x464a('0x3a')][_0x464a('0x41')]);_0x3fa735['offset']=qs[_0x464a('0x2c')](_0x48944c['query']['offset']);}return _0x2eb1dc['getFields'](_0x3fa735);}})[_0x464a('0x1e')](function(_0x56de27){if(_0x56de27){return _0x56de27?{'count':_0xa0848d,'rows':_0x56de27}:null;}})[_0x464a('0x1e')](respondWithResult(_0x4cd7b5,null))[_0x464a('0x4b')](handleError(_0x4cd7b5,null));};exports[_0x464a('0x57')]=function(_0x50d39a,_0x550b83,_0x18d3f5){var _0x176eee={};var _0x461b81={};var _0x46a194;var _0x24c13a;return db[_0x464a('0x36')]['findOne']({'where':{'id':_0x50d39a[_0x464a('0x51')]['id']}})[_0x464a('0x1e')](handleEntityNotFound(_0x550b83,null))['then'](function(_0x56525d){if(_0x56525d){_0x46a194=_0x56525d;_0x461b81[_0x464a('0x39')]=_['keys'](db['VtigerField'][_0x464a('0x37')]);_0x461b81[_0x464a('0x3a')]=_[_0x464a('0x4c')](_0x50d39a[_0x464a('0x3a')]);_0x461b81[_0x464a('0x3b')]=_[_0x464a('0x3c')](_0x461b81['model'],_0x461b81['query']);_0x176eee['attributes']=_[_0x464a('0x3c')](_0x461b81[_0x464a('0x39')],qs[_0x464a('0x3d')](_0x50d39a[_0x464a('0x3a')]['fields']));_0x176eee[_0x464a('0x3e')]=_0x176eee[_0x464a('0x3e')][_0x464a('0x3f')]?_0x176eee[_0x464a('0x3e')]:_0x461b81[_0x464a('0x39')];_0x176eee['order']=qs[_0x464a('0x42')](_0x50d39a[_0x464a('0x3a')][_0x464a('0x42')]);_0x176eee['where']=qs[_0x464a('0x3b')](_[_0x464a('0x44')](_0x50d39a[_0x464a('0x3a')],_0x461b81[_0x464a('0x3b')]));if(_0x50d39a['query']['filter']){_0x176eee[_0x464a('0x43')]=_[_0x464a('0x46')](_0x176eee[_0x464a('0x43')],{'$or':_[_0x464a('0x35')](_0x176eee['attributes'],function(_0x5742ec){var _0x43eb18={};_0x43eb18[_0x5742ec]={'$like':'%'+_0x50d39a[_0x464a('0x3a')][_0x464a('0x45')]+'%'};return _0x43eb18;})});}_0x176eee=_[_0x464a('0x46')]({},_0x176eee,_0x50d39a[_0x464a('0x48')]);return _0x46a194[_0x464a('0x57')](_0x176eee);}})[_0x464a('0x1e')](function(_0x48b9d6){if(_0x48b9d6){_0x24c13a=_0x48b9d6[_0x464a('0x3f')];if(!_0x50d39a[_0x464a('0x3a')]['hasOwnProperty']('nolimit')){_0x176eee[_0x464a('0x41')]=qs[_0x464a('0x41')](_0x50d39a[_0x464a('0x3a')][_0x464a('0x41')]);_0x176eee['offset']=qs[_0x464a('0x2c')](_0x50d39a['query'][_0x464a('0x2c')]);}return _0x46a194['getSubjects'](_0x176eee);}})['then'](function(_0xac7f2f){if(_0xac7f2f){return _0xac7f2f?{'count':_0x24c13a,'rows':_0xac7f2f}:null;}})[_0x464a('0x1e')](respondWithResult(_0x550b83,null))[_0x464a('0x4b')](handleError(_0x550b83,null));};exports[_0x464a('0x58')]=function(_0x496bd5,_0x29454c,_0x5e1be2){var _0x9647={};var _0x3b2604={};var _0xc6d807;var _0x40fed3;return db[_0x464a('0x36')][_0x464a('0x53')]({'where':{'id':_0x496bd5['params']['id']}})[_0x464a('0x1e')](handleEntityNotFound(_0x29454c,null))['then'](function(_0x9cd97d){if(_0x9cd97d){_0xc6d807=_0x9cd97d;_0x3b2604[_0x464a('0x39')]=_[_0x464a('0x4c')](db[_0x464a('0x54')]['rawAttributes']);_0x3b2604[_0x464a('0x3a')]=_[_0x464a('0x4c')](_0x496bd5[_0x464a('0x3a')]);_0x3b2604[_0x464a('0x3b')]=_[_0x464a('0x3c')](_0x3b2604[_0x464a('0x39')],_0x3b2604[_0x464a('0x3a')]);_0x9647[_0x464a('0x3e')]=_[_0x464a('0x3c')](_0x3b2604['model'],qs[_0x464a('0x3d')](_0x496bd5[_0x464a('0x3a')][_0x464a('0x3d')]));_0x9647[_0x464a('0x3e')]=_0x9647[_0x464a('0x3e')]['length']?_0x9647[_0x464a('0x3e')]:_0x3b2604['model'];_0x9647[_0x464a('0x55')]=qs[_0x464a('0x42')](_0x496bd5[_0x464a('0x3a')][_0x464a('0x42')]);_0x9647[_0x464a('0x43')]=qs[_0x464a('0x3b')](_[_0x464a('0x44')](_0x496bd5[_0x464a('0x3a')],_0x3b2604['filters']));if(_0x496bd5[_0x464a('0x3a')][_0x464a('0x45')]){_0x9647['where']=_[_0x464a('0x46')](_0x9647[_0x464a('0x43')],{'$or':_[_0x464a('0x35')](_0x9647[_0x464a('0x3e')],function(_0x33dd60){var _0x5318ef={};_0x5318ef[_0x33dd60]={'$like':'%'+_0x496bd5[_0x464a('0x3a')][_0x464a('0x45')]+'%'};return _0x5318ef;})});}_0x9647=_['merge']({},_0x9647,_0x496bd5[_0x464a('0x48')]);return _0xc6d807[_0x464a('0x58')](_0x9647);}})[_0x464a('0x1e')](function(_0x34e347){if(_0x34e347){_0x40fed3=_0x34e347['length'];if(!_0x496bd5[_0x464a('0x3a')]['hasOwnProperty']('nolimit')){_0x9647[_0x464a('0x41')]=qs['limit'](_0x496bd5[_0x464a('0x3a')][_0x464a('0x41')]);_0x9647[_0x464a('0x2c')]=qs[_0x464a('0x2c')](_0x496bd5[_0x464a('0x3a')]['offset']);}return _0xc6d807[_0x464a('0x58')](_0x9647);}})[_0x464a('0x1e')](function(_0x4c8aca){if(_0x4c8aca){return _0x4c8aca?{'count':_0x40fed3,'rows':_0x4c8aca}:null;}})[_0x464a('0x1e')](respondWithResult(_0x29454c,null))['catch'](handleError(_0x29454c,null));}; \ No newline at end of file +var _0x42d7=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','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','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','end','status','json','offset','limit','set','reject','save','update','destroy','then','sendStatus','stack','name','send','index','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','merge','where','map','options','count','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','order','filter','nolimit','getSubjects','VtigerField','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3a9690,_0x5e06e8){var _0x146bef=function(_0x28f514){while(--_0x28f514){_0x3a9690['push'](_0x3a9690['shift']());}};_0x146bef(++_0x5e06e8);}(_0x42d7,0xa8));var _0x742d=function(_0x3f25b2,_0x412bd4){_0x3f25b2=_0x3f25b2-0x0;var _0xd8caeb=_0x42d7[_0x3f25b2];return _0xd8caeb;};'use strict';var pdf=require(_0x742d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x742d('0x1'));var zipdir=require(_0x742d('0x2'));var jsonpatch=require(_0x742d('0x3'));var rp=require(_0x742d('0x4'));var moment=require('moment');var BPromise=require(_0x742d('0x5'));var Mustache=require(_0x742d('0x6'));var util=require(_0x742d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x742d('0x8'));var ejs=require(_0x742d('0x9'));var fs=require('fs');var _=require(_0x742d('0xa'));var squel=require(_0x742d('0xb'));var crypto=require(_0x742d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x742d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x742d('0xe'));var Papa=require(_0x742d('0xf'));var Redis=require(_0x742d('0x10'));var authService=require(_0x742d('0x11'));var qs=require(_0x742d('0x12'));var as=require(_0x742d('0x13'));var hardwareService=require(_0x742d('0x14'));var logger=require('../../config/logger')(_0x742d('0x15'));var utils=require(_0x742d('0x16'));var config=require(_0x742d('0x17'));var db=require(_0x742d('0x18'))['db'];var jayson=require(_0x742d('0x19'));var client=jayson[_0x742d('0x1a')][_0x742d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5e5283,_0x17f353,_0x42eaac){if(_0x42eaac){var _0x3304e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3304e4[_0x742d('0x1c')](_0x17f353)){return _0x5e5283;}else{throw new db['Sequelize']['ValidationError'](_0x742d('0x1d'));}}else{return _0x5e5283;}}function respondWithRpcPromise(_0x26f4bc,_0x1ee55d,_0x5e399b,_0x4b5ce4){return new BPromise(function(_0x1a7a50,_0x512b16){var _0x3eecfa=_0x4b5ce4||client;return _0x3eecfa[_0x742d('0x1e')](_0x26f4bc,_0x5e399b)['then'](function(_0x48c469){logger[_0x742d('0x1f')](_0x742d('0x20'),_0x1ee55d,'request\x20sent');logger[_0x742d('0x21')](_0x742d('0x22'),_0x1ee55d,_0x742d('0x23'),JSON[_0x742d('0x24')](_0x48c469));if(_0x48c469[_0x742d('0x25')]){if(_0x48c469['error']['code']===0x1f4){logger[_0x742d('0x25')](_0x742d('0x20'),_0x1ee55d,_0x48c469[_0x742d('0x25')]['message']);return _0x512b16(_0x48c469[_0x742d('0x25')]['message']);}logger['error'](_0x742d('0x20'),_0x1ee55d,_0x48c469[_0x742d('0x25')][_0x742d('0x26')]);return _0x1a7a50(_0x48c469[_0x742d('0x25')][_0x742d('0x26')]);}else{logger[_0x742d('0x1f')](_0x742d('0x20'),_0x1ee55d,'request\x20sent');_0x1a7a50(_0x48c469['result'][_0x742d('0x26')]);}})[_0x742d('0x27')](function(_0x5255e6){logger[_0x742d('0x25')](_0x742d('0x20'),_0x1ee55d,_0x5255e6);_0x512b16(_0x5255e6);});});}function respondWithStatusCode(_0x59452a,_0x1e1d77){_0x1e1d77=_0x1e1d77||0xcc;return function(_0x9919f8){if(_0x9919f8){return _0x59452a['sendStatus'](_0x1e1d77);}return _0x59452a['status'](_0x1e1d77)[_0x742d('0x28')]();};}function respondWithResult(_0x2f0b60,_0x34e1cc){_0x34e1cc=_0x34e1cc||0xc8;return function(_0xe88860){if(_0xe88860){return _0x2f0b60[_0x742d('0x29')](_0x34e1cc)[_0x742d('0x2a')](_0xe88860);}};}function respondWithFilteredResult(_0xc3e8cf,_0x114eb3){return function(_0x2d0726){if(_0x2d0726){var _0x560771=_0x2d0726['count'],_0x18bb99=_0x114eb3[_0x742d('0x2b')],_0x3c1a6b=_0x114eb3['offset']+_0x114eb3[_0x742d('0x2c')],_0x28ec0b;if(_0x3c1a6b>=_0x560771){_0x3c1a6b=_0x560771;_0x28ec0b=0xc8;}else{_0x28ec0b=0xce;}_0xc3e8cf[_0x742d('0x29')](_0x28ec0b);return _0xc3e8cf[_0x742d('0x2d')]('Content-Range',_0x18bb99+'-'+_0x3c1a6b+'/'+_0x560771)['json'](_0x2d0726);}return null;};}function patchUpdates(_0x5e8284){return function(_0x465473){try{jsonpatch['apply'](_0x465473,_0x5e8284,!![]);}catch(_0x2716e0){return BPromise[_0x742d('0x2e')](_0x2716e0);}return _0x465473[_0x742d('0x2f')]();};}function saveUpdates(_0x16f87d,_0x3ee60c){return function(_0x1d8aef){if(_0x1d8aef){return _0x1d8aef[_0x742d('0x30')](_0x16f87d)['then'](function(_0x425519){return _0x425519;});}return null;};}function removeEntity(_0x2d4c05,_0x164ebd){return function(_0x20dce3){if(_0x20dce3){return _0x20dce3[_0x742d('0x31')]()[_0x742d('0x32')](function(){_0x2d4c05['status'](0xcc)[_0x742d('0x28')]();});}};}function handleEntityNotFound(_0x73b0eb,_0x42159e){return function(_0x14c93c){if(!_0x14c93c){_0x73b0eb[_0x742d('0x33')](0x194);}return _0x14c93c;};}function handleError(_0x289bdc,_0x55326c){_0x55326c=_0x55326c||0x1f4;return function(_0x38cb49){logger[_0x742d('0x25')](_0x38cb49[_0x742d('0x34')]);if(_0x38cb49['name']){delete _0x38cb49[_0x742d('0x35')];}_0x289bdc['status'](_0x55326c)[_0x742d('0x36')](_0x38cb49);};}exports[_0x742d('0x37')]=function(_0x7f91f4,_0x26d155){var _0x17c917={},_0x1c7415={},_0x195b2c={'count':0x0,'rows':[]};var _0x1043bf=_['map'](db[_0x742d('0x38')][_0x742d('0x39')],function(_0x10db2e){return{'name':_0x10db2e[_0x742d('0x3a')],'type':_0x10db2e[_0x742d('0x3b')][_0x742d('0x3c')]};});_0x1c7415[_0x742d('0x3d')]=_['map'](_0x1043bf,_0x742d('0x35'));_0x1c7415[_0x742d('0x3e')]=_[_0x742d('0x3f')](_0x7f91f4[_0x742d('0x3e')]);_0x1c7415[_0x742d('0x40')]=_['intersection'](_0x1c7415[_0x742d('0x3d')],_0x1c7415['query']);_0x17c917['attributes']=_[_0x742d('0x41')](_0x1c7415[_0x742d('0x3d')],qs[_0x742d('0x42')](_0x7f91f4[_0x742d('0x3e')][_0x742d('0x42')]));_0x17c917[_0x742d('0x43')]=_0x17c917[_0x742d('0x43')][_0x742d('0x44')]?_0x17c917[_0x742d('0x43')]:_0x1c7415[_0x742d('0x3d')];if(!_0x7f91f4[_0x742d('0x3e')][_0x742d('0x45')]('nolimit')){_0x17c917[_0x742d('0x2c')]=qs[_0x742d('0x2c')](_0x7f91f4['query'][_0x742d('0x2c')]);_0x17c917[_0x742d('0x2b')]=qs[_0x742d('0x2b')](_0x7f91f4['query'][_0x742d('0x2b')]);}_0x17c917['order']=qs[_0x742d('0x46')](_0x7f91f4['query'][_0x742d('0x46')]);_0x17c917['where']=qs[_0x742d('0x40')](_[_0x742d('0x47')](_0x7f91f4[_0x742d('0x3e')],_0x1c7415[_0x742d('0x40')]),_0x1043bf);if(_0x7f91f4[_0x742d('0x3e')]['filter']){_0x17c917['where']=_[_0x742d('0x48')](_0x17c917[_0x742d('0x49')],{'$or':_[_0x742d('0x4a')](_0x1043bf,function(_0x5669e4){if(_0x5669e4[_0x742d('0x3b')]!=='VIRTUAL'){var _0x18841c={};_0x18841c[_0x5669e4[_0x742d('0x35')]]={'$like':'%'+_0x7f91f4['query']['filter']+'%'};return _0x18841c;}})});}_0x17c917=_[_0x742d('0x48')]({},_0x17c917,_0x7f91f4[_0x742d('0x4b')]);var _0x542eed={'where':_0x17c917[_0x742d('0x49')]};return db[_0x742d('0x38')]['count'](_0x542eed)[_0x742d('0x32')](function(_0x510d16){_0x195b2c[_0x742d('0x4c')]=_0x510d16;if(_0x7f91f4[_0x742d('0x3e')][_0x742d('0x4d')]){_0x17c917[_0x742d('0x4e')]=[{'all':!![]}];}return db[_0x742d('0x38')][_0x742d('0x4f')](_0x17c917);})[_0x742d('0x32')](function(_0x4eee21){_0x195b2c[_0x742d('0x50')]=_0x4eee21;return _0x195b2c;})[_0x742d('0x32')](respondWithFilteredResult(_0x26d155,_0x17c917))[_0x742d('0x27')](handleError(_0x26d155,null));};exports[_0x742d('0x51')]=function(_0x25191a,_0x91a085){var _0x6ae093={'raw':![],'where':{'id':_0x25191a[_0x742d('0x52')]['id']}},_0xd3f12c={};_0xd3f12c[_0x742d('0x3d')]=_[_0x742d('0x3f')](db[_0x742d('0x38')][_0x742d('0x39')]);_0xd3f12c[_0x742d('0x3e')]=_[_0x742d('0x3f')](_0x25191a[_0x742d('0x3e')]);_0xd3f12c[_0x742d('0x40')]=_[_0x742d('0x41')](_0xd3f12c['model'],_0xd3f12c[_0x742d('0x3e')]);_0x6ae093[_0x742d('0x43')]=_['intersection'](_0xd3f12c[_0x742d('0x3d')],qs[_0x742d('0x42')](_0x25191a[_0x742d('0x3e')]['fields']));_0x6ae093[_0x742d('0x43')]=_0x6ae093[_0x742d('0x43')][_0x742d('0x44')]?_0x6ae093[_0x742d('0x43')]:_0xd3f12c['model'];if(_0x25191a['query']['includeAll']){_0x6ae093['include']=[{'all':!![]}];}_0x6ae093=_[_0x742d('0x48')]({},_0x6ae093,_0x25191a[_0x742d('0x4b')]);return db[_0x742d('0x38')][_0x742d('0x53')](_0x6ae093)[_0x742d('0x32')](handleEntityNotFound(_0x91a085,null))[_0x742d('0x32')](respondWithResult(_0x91a085,null))[_0x742d('0x27')](handleError(_0x91a085,null));};exports['create']=function(_0x17ce5e,_0x3c5f3f){return db[_0x742d('0x38')][_0x742d('0x54')](_0x17ce5e[_0x742d('0x55')],{})[_0x742d('0x32')](respondWithResult(_0x3c5f3f,0xc9))['catch'](handleError(_0x3c5f3f,null));};exports[_0x742d('0x30')]=function(_0xf97cd7,_0x1d3c58){if(_0xf97cd7[_0x742d('0x55')]['id']){delete _0xf97cd7[_0x742d('0x55')]['id'];}return db['VtigerConfiguration'][_0x742d('0x53')]({'where':{'id':_0xf97cd7[_0x742d('0x52')]['id']}})[_0x742d('0x32')](handleEntityNotFound(_0x1d3c58,null))[_0x742d('0x32')](saveUpdates(_0xf97cd7['body'],null))['then'](respondWithResult(_0x1d3c58,null))['catch'](handleError(_0x1d3c58,null));};exports[_0x742d('0x31')]=function(_0x47bbef,_0x4bc96c){return db['VtigerConfiguration'][_0x742d('0x53')]({'where':{'id':_0x47bbef['params']['id']}})[_0x742d('0x32')](handleEntityNotFound(_0x4bc96c,null))[_0x742d('0x32')](removeEntity(_0x4bc96c,null))[_0x742d('0x27')](handleError(_0x4bc96c,null));};exports[_0x742d('0x56')]=function(_0xd142c0,_0x425f8a,_0x137161){var _0xad5d94={};var _0x4ebcad={};var _0x87ec40;var _0x203d47;return db[_0x742d('0x38')][_0x742d('0x57')]({'where':{'id':_0xd142c0['params']['id']}})[_0x742d('0x32')](handleEntityNotFound(_0x425f8a,null))[_0x742d('0x32')](function(_0x9af4f3){if(_0x9af4f3){_0x87ec40=_0x9af4f3;_0x4ebcad['model']=_[_0x742d('0x3f')](db['VtigerField']['rawAttributes']);_0x4ebcad[_0x742d('0x3e')]=_[_0x742d('0x3f')](_0xd142c0[_0x742d('0x3e')]);_0x4ebcad['filters']=_[_0x742d('0x41')](_0x4ebcad[_0x742d('0x3d')],_0x4ebcad[_0x742d('0x3e')]);_0xad5d94[_0x742d('0x43')]=_[_0x742d('0x41')](_0x4ebcad[_0x742d('0x3d')],qs[_0x742d('0x42')](_0xd142c0['query'][_0x742d('0x42')]));_0xad5d94[_0x742d('0x43')]=_0xad5d94[_0x742d('0x43')][_0x742d('0x44')]?_0xad5d94['attributes']:_0x4ebcad[_0x742d('0x3d')];_0xad5d94[_0x742d('0x58')]=qs[_0x742d('0x46')](_0xd142c0[_0x742d('0x3e')]['sort']);_0xad5d94[_0x742d('0x49')]=qs[_0x742d('0x40')](_['pick'](_0xd142c0[_0x742d('0x3e')],_0x4ebcad[_0x742d('0x40')]));if(_0xd142c0[_0x742d('0x3e')][_0x742d('0x59')]){_0xad5d94[_0x742d('0x49')]=_[_0x742d('0x48')](_0xad5d94[_0x742d('0x49')],{'$or':_['map'](_0xad5d94[_0x742d('0x43')],function(_0x6c866){var _0x2d0f82={};_0x2d0f82[_0x6c866]={'$like':'%'+_0xd142c0[_0x742d('0x3e')][_0x742d('0x59')]+'%'};return _0x2d0f82;})});}_0xad5d94=_[_0x742d('0x48')]({},_0xad5d94,_0xd142c0['options']);return _0x87ec40[_0x742d('0x56')](_0xad5d94);}})[_0x742d('0x32')](function(_0xa3f2e6){if(_0xa3f2e6){_0x203d47=_0xa3f2e6['length'];if(!_0xd142c0[_0x742d('0x3e')][_0x742d('0x45')](_0x742d('0x5a'))){_0xad5d94[_0x742d('0x2c')]=qs[_0x742d('0x2c')](_0xd142c0[_0x742d('0x3e')]['limit']);_0xad5d94['offset']=qs[_0x742d('0x2b')](_0xd142c0[_0x742d('0x3e')][_0x742d('0x2b')]);}return _0x87ec40[_0x742d('0x56')](_0xad5d94);}})[_0x742d('0x32')](function(_0x2af72f){if(_0x2af72f){return _0x2af72f?{'count':_0x203d47,'rows':_0x2af72f}:null;}})[_0x742d('0x32')](respondWithResult(_0x425f8a,null))[_0x742d('0x27')](handleError(_0x425f8a,null));};exports[_0x742d('0x5b')]=function(_0x475a5a,_0x1db062,_0x3300b7){var _0x3923e2={};var _0x1421cd={};var _0x375755;var _0x311167;return db['VtigerConfiguration'][_0x742d('0x57')]({'where':{'id':_0x475a5a[_0x742d('0x52')]['id']}})[_0x742d('0x32')](handleEntityNotFound(_0x1db062,null))[_0x742d('0x32')](function(_0x3623c1){if(_0x3623c1){_0x375755=_0x3623c1;_0x1421cd['model']=_['keys'](db['VtigerField']['rawAttributes']);_0x1421cd['query']=_[_0x742d('0x3f')](_0x475a5a[_0x742d('0x3e')]);_0x1421cd['filters']=_[_0x742d('0x41')](_0x1421cd[_0x742d('0x3d')],_0x1421cd[_0x742d('0x3e')]);_0x3923e2[_0x742d('0x43')]=_[_0x742d('0x41')](_0x1421cd[_0x742d('0x3d')],qs[_0x742d('0x42')](_0x475a5a[_0x742d('0x3e')][_0x742d('0x42')]));_0x3923e2[_0x742d('0x43')]=_0x3923e2[_0x742d('0x43')][_0x742d('0x44')]?_0x3923e2[_0x742d('0x43')]:_0x1421cd[_0x742d('0x3d')];_0x3923e2[_0x742d('0x58')]=qs['sort'](_0x475a5a['query'][_0x742d('0x46')]);_0x3923e2[_0x742d('0x49')]=qs['filters'](_[_0x742d('0x47')](_0x475a5a[_0x742d('0x3e')],_0x1421cd['filters']));if(_0x475a5a['query'][_0x742d('0x59')]){_0x3923e2['where']=_[_0x742d('0x48')](_0x3923e2['where'],{'$or':_['map'](_0x3923e2[_0x742d('0x43')],function(_0x39e25f){var _0x48169f={};_0x48169f[_0x39e25f]={'$like':'%'+_0x475a5a[_0x742d('0x3e')][_0x742d('0x59')]+'%'};return _0x48169f;})});}_0x3923e2=_[_0x742d('0x48')]({},_0x3923e2,_0x475a5a[_0x742d('0x4b')]);return _0x375755[_0x742d('0x5b')](_0x3923e2);}})[_0x742d('0x32')](function(_0x50a15c){if(_0x50a15c){_0x311167=_0x50a15c[_0x742d('0x44')];if(!_0x475a5a[_0x742d('0x3e')][_0x742d('0x45')](_0x742d('0x5a'))){_0x3923e2[_0x742d('0x2c')]=qs[_0x742d('0x2c')](_0x475a5a[_0x742d('0x3e')]['limit']);_0x3923e2[_0x742d('0x2b')]=qs['offset'](_0x475a5a[_0x742d('0x3e')][_0x742d('0x2b')]);}return _0x375755[_0x742d('0x5b')](_0x3923e2);}})[_0x742d('0x32')](function(_0x2b7c42){if(_0x2b7c42){return _0x2b7c42?{'count':_0x311167,'rows':_0x2b7c42}:null;}})[_0x742d('0x32')](respondWithResult(_0x1db062,null))[_0x742d('0x27')](handleError(_0x1db062,null));};exports['getDescriptions']=function(_0x493084,_0x27b9e3,_0x4da6e4){var _0x288b95={};var _0x5e6ec5={};var _0x2d20a5;var _0x51f88b;return db[_0x742d('0x38')]['findOne']({'where':{'id':_0x493084[_0x742d('0x52')]['id']}})[_0x742d('0x32')](handleEntityNotFound(_0x27b9e3,null))['then'](function(_0x288c20){if(_0x288c20){_0x2d20a5=_0x288c20;_0x5e6ec5['model']=_[_0x742d('0x3f')](db[_0x742d('0x5c')]['rawAttributes']);_0x5e6ec5[_0x742d('0x3e')]=_['keys'](_0x493084[_0x742d('0x3e')]);_0x5e6ec5['filters']=_[_0x742d('0x41')](_0x5e6ec5[_0x742d('0x3d')],_0x5e6ec5[_0x742d('0x3e')]);_0x288b95[_0x742d('0x43')]=_['intersection'](_0x5e6ec5[_0x742d('0x3d')],qs[_0x742d('0x42')](_0x493084[_0x742d('0x3e')][_0x742d('0x42')]));_0x288b95['attributes']=_0x288b95[_0x742d('0x43')][_0x742d('0x44')]?_0x288b95[_0x742d('0x43')]:_0x5e6ec5[_0x742d('0x3d')];_0x288b95[_0x742d('0x58')]=qs['sort'](_0x493084['query'][_0x742d('0x46')]);_0x288b95[_0x742d('0x49')]=qs[_0x742d('0x40')](_[_0x742d('0x47')](_0x493084['query'],_0x5e6ec5[_0x742d('0x40')]));if(_0x493084[_0x742d('0x3e')]['filter']){_0x288b95[_0x742d('0x49')]=_['merge'](_0x288b95[_0x742d('0x49')],{'$or':_[_0x742d('0x4a')](_0x288b95[_0x742d('0x43')],function(_0x56f03a){var _0x4acfe8={};_0x4acfe8[_0x56f03a]={'$like':'%'+_0x493084[_0x742d('0x3e')][_0x742d('0x59')]+'%'};return _0x4acfe8;})});}_0x288b95=_['merge']({},_0x288b95,_0x493084[_0x742d('0x4b')]);return _0x2d20a5[_0x742d('0x5d')](_0x288b95);}})[_0x742d('0x32')](function(_0x5df8b5){if(_0x5df8b5){_0x51f88b=_0x5df8b5[_0x742d('0x44')];if(!_0x493084[_0x742d('0x3e')][_0x742d('0x45')](_0x742d('0x5a'))){_0x288b95['limit']=qs[_0x742d('0x2c')](_0x493084[_0x742d('0x3e')][_0x742d('0x2c')]);_0x288b95[_0x742d('0x2b')]=qs[_0x742d('0x2b')](_0x493084[_0x742d('0x3e')]['offset']);}return _0x2d20a5['getDescriptions'](_0x288b95);}})[_0x742d('0x32')](function(_0x3ec746){if(_0x3ec746){return _0x3ec746?{'count':_0x51f88b,'rows':_0x3ec746}:null;}})[_0x742d('0x32')](respondWithResult(_0x27b9e3,null))[_0x742d('0x27')](handleError(_0x27b9e3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 232970b..dd00749 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 _0x1678=['api','bluebird','path','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger'];(function(_0x278192,_0x337902){var _0x39df77=function(_0xa8ea7d){while(--_0xa8ea7d){_0x278192['push'](_0x278192['shift']());}};_0x39df77(++_0x337902);}(_0x1678,0x66));var _0x8167=function(_0x21405a,_0x192c00){_0x21405a=_0x21405a-0x0;var _0x28d49e=_0x1678[_0x21405a];return _0x28d49e;};'use strict';var _=require('lodash');var util=require(_0x8167('0x0'));var logger=require(_0x8167('0x1'))(_0x8167('0x2'));var moment=require('moment');var BPromise=require(_0x8167('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8167('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8167('0x5'));module['exports']=function(_0xebface,_0x5414f9){return _0xebface['define'](_0x8167('0x6'),attributes,{'tableName':_0x8167('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a20=['exports','define','int_vtiger_configurations','util','../../config/logger','moment','path','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x51e07d,_0x8466c8){var _0x5e9cbe=function(_0x387269){while(--_0x387269){_0x51e07d['push'](_0x51e07d['shift']());}};_0x5e9cbe(++_0x8466c8);}(_0x1a20,0x111));var _0x01a2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1a20[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x01a2('0x0'));var logger=require(_0x01a2('0x1'))('api');var moment=require(_0x01a2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01a2('0x3'));var rimraf=require('rimraf');var config=require(_0x01a2('0x4'));var attributes=require(_0x01a2('0x5'));module[_0x01a2('0x6')]=function(_0x4a1917,_0x2211ba){return _0x4a1917[_0x01a2('0x7')]('VtigerConfiguration',attributes,{'tableName':_0x01a2('0x8'),'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 e3d9871..72a64ca 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 _0xfc27=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x1ee215,_0x21f401){var _0xe71a24=function(_0x31300a){while(--_0x31300a){_0x1ee215['push'](_0x1ee215['shift']());}};_0xe71a24(++_0x21f401);}(_0xfc27,0xb4));var _0x7fc2=function(_0x6f40e6,_0x4fc4c3){_0x6f40e6=_0x6f40e6-0x0;var _0x25fc5a=_0xfc27[_0x6f40e6];return _0x25fc5a;};'use strict';var _=require('lodash');var util=require(_0x7fc2('0x0'));var moment=require(_0x7fc2('0x1'));var BPromise=require(_0x7fc2('0x2'));var rs=require(_0x7fc2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fc2('0x4'))['db'];var utils=require(_0x7fc2('0x5'));var logger=require(_0x7fc2('0x6'))(_0x7fc2('0x7'));var config=require('../../config/environment');var jayson=require(_0x7fc2('0x8'));var client=jayson[_0x7fc2('0x9')][_0x7fc2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f5e57,_0x4be7d4,_0x23d3d0){return new BPromise(function(_0xc79d81,_0x100710){return client['request'](_0x2f5e57,_0x23d3d0)[_0x7fc2('0xb')](function(_0x1c4e77){logger[_0x7fc2('0xc')](_0x7fc2('0xd'),_0x4be7d4,_0x7fc2('0xe'));logger[_0x7fc2('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4be7d4,_0x7fc2('0xe'),JSON['stringify'](_0x1c4e77));if(_0x1c4e77[_0x7fc2('0x10')]){if(_0x1c4e77[_0x7fc2('0x10')][_0x7fc2('0x11')]===0x1f4){logger[_0x7fc2('0x10')](_0x7fc2('0xd'),_0x4be7d4,_0x1c4e77['error']['message']);return _0x100710(_0x1c4e77['error'][_0x7fc2('0x12')]);}logger[_0x7fc2('0x10')](_0x7fc2('0xd'),_0x4be7d4,_0x1c4e77[_0x7fc2('0x10')]['message']);return _0xc79d81(_0x1c4e77['error'][_0x7fc2('0x12')]);}else{logger[_0x7fc2('0xc')](_0x7fc2('0xd'),_0x4be7d4,_0x7fc2('0xe'));_0xc79d81(_0x1c4e77[_0x7fc2('0x13')][_0x7fc2('0x12')]);}})['catch'](function(_0x3ff99a){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x4be7d4,_0x3ff99a);_0x100710(_0x3ff99a);});});} \ No newline at end of file +var _0xc1a0=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xc1a0,0x1a1));var _0x0c1a=function(_0x22e47a,_0x4ea10c){_0x22e47a=_0x22e47a-0x0;var _0x15a12a=_0xc1a0[_0x22e47a];return _0x15a12a;};'use strict';var _=require(_0x0c1a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0c1a('0x1'));var fs=require('fs');var Redis=require(_0x0c1a('0x2'));var db=require(_0x0c1a('0x3'))['db'];var utils=require(_0x0c1a('0x4'));var logger=require(_0x0c1a('0x5'))('rpc');var config=require(_0x0c1a('0x6'));var jayson=require(_0x0c1a('0x7'));var client=jayson[_0x0c1a('0x8')][_0x0c1a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1dc884,_0x2d00b9,_0xf0f186){return new BPromise(function(_0x3acb2b,_0x3f1df3){return client[_0x0c1a('0xa')](_0x1dc884,_0xf0f186)[_0x0c1a('0xb')](function(_0x1fcfb7){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x2d00b9,_0x0c1a('0xc'));logger['debug'](_0x0c1a('0xd'),_0x2d00b9,'request\x20sent',JSON[_0x0c1a('0xe')](_0x1fcfb7));if(_0x1fcfb7[_0x0c1a('0xf')]){if(_0x1fcfb7[_0x0c1a('0xf')][_0x0c1a('0x10')]===0x1f4){logger[_0x0c1a('0xf')](_0x0c1a('0x11'),_0x2d00b9,_0x1fcfb7[_0x0c1a('0xf')][_0x0c1a('0x12')]);return _0x3f1df3(_0x1fcfb7[_0x0c1a('0xf')][_0x0c1a('0x12')]);}logger[_0x0c1a('0xf')](_0x0c1a('0x11'),_0x2d00b9,_0x1fcfb7[_0x0c1a('0xf')][_0x0c1a('0x12')]);return _0x3acb2b(_0x1fcfb7[_0x0c1a('0xf')][_0x0c1a('0x12')]);}else{logger[_0x0c1a('0x13')](_0x0c1a('0x11'),_0x2d00b9,_0x0c1a('0xc'));_0x3acb2b(_0x1fcfb7[_0x0c1a('0x14')][_0x0c1a('0x12')]);}})[_0x0c1a('0x15')](function(_0xe824c2){logger[_0x0c1a('0xf')](_0x0c1a('0x11'),_0x2d00b9,_0xe824c2);_0x3f1df3(_0xe824c2);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 3194c94..880dfad 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 _0xcfe5=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xcfe5,0x115));var _0x5cfe=function(_0x30ac04,_0x365f1b){_0x30ac04=_0x30ac04-0x0;var _0x56b497=_0xcfe5[_0x30ac04];return _0x56b497;};'use strict';var multer=require(_0x5cfe('0x0'));var util=require(_0x5cfe('0x1'));var path=require(_0x5cfe('0x2'));var timeout=require(_0x5cfe('0x3'));var express=require(_0x5cfe('0x4'));var router=express[_0x5cfe('0x5')]();var auth=require(_0x5cfe('0x6'));var interaction=require(_0x5cfe('0x7'));var config=require(_0x5cfe('0x8'));var controller=require(_0x5cfe('0x9'));router[_0x5cfe('0xa')]('/',auth['isAuthenticated'](),controller[_0x5cfe('0xb')]);router[_0x5cfe('0xa')](_0x5cfe('0xc'),auth[_0x5cfe('0xd')](),controller[_0x5cfe('0xe')]);router[_0x5cfe('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5cfe('0x10')](_0x5cfe('0xc'),auth[_0x5cfe('0xd')](),controller[_0x5cfe('0x11')]);router[_0x5cfe('0x12')](_0x5cfe('0xc'),auth[_0x5cfe('0xd')](),controller[_0x5cfe('0x13')]);module[_0x5cfe('0x14')]=router; \ No newline at end of file +var _0xc7fe=['./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4e658c,_0x4e681a){var _0x4f32ea=function(_0x5b5f91){while(--_0x5b5f91){_0x4e658c['push'](_0x4e658c['shift']());}};_0x4f32ea(++_0x4e681a);}(_0xc7fe,0x108));var _0xec7f=function(_0x454018,_0x46e33a){_0x454018=_0x454018-0x0;var _0x24697d=_0xc7fe[_0x454018];return _0x24697d;};'use strict';var multer=require(_0xec7f('0x0'));var util=require(_0xec7f('0x1'));var path=require(_0xec7f('0x2'));var timeout=require(_0xec7f('0x3'));var express=require(_0xec7f('0x4'));var router=express[_0xec7f('0x5')]();var auth=require(_0xec7f('0x6'));var interaction=require(_0xec7f('0x7'));var config=require(_0xec7f('0x8'));var controller=require(_0xec7f('0x9'));router[_0xec7f('0xa')]('/',auth[_0xec7f('0xb')](),controller[_0xec7f('0xc')]);router[_0xec7f('0xa')](_0xec7f('0xd'),auth['isAuthenticated'](),controller[_0xec7f('0xe')]);router[_0xec7f('0xf')]('/',auth['isAuthenticated'](),controller[_0xec7f('0x10')]);router[_0xec7f('0x11')](_0xec7f('0xd'),auth[_0xec7f('0xb')](),controller[_0xec7f('0x12')]);router['delete'](_0xec7f('0xd'),auth[_0xec7f('0xb')](),controller[_0xec7f('0x13')]);module[_0xec7f('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 3744d56..f099916 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 _0x97f6=['variable','customVariable','keyValue','STRING','string'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x97f6,0x199));var _0x697f=function(_0xacbb95,_0x466526){_0xacbb95=_0xacbb95-0x0;var _0x560048=_0x97f6[_0xacbb95];return _0x560048;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x697f('0x0'),_0x697f('0x1'),_0x697f('0x2'),_0x697f('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x697f('0x4')]},'key':{'type':Sequelize[_0x697f('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x697f('0x0'),_0x697f('0x1'),_0x697f('0x2'))},'keyContent':{'type':Sequelize[_0x697f('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x697f('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x697f('0x4')]}}; \ No newline at end of file +var _0x9a19=['customVariable','keyValue','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x9a19,0x114));var _0x99a1=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x9a19[_0x4bb145];return _0x4db596;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'type':{'type':Sequelize[_0x99a1('0x2')]('string',_0x99a1('0x3'),_0x99a1('0x4'),_0x99a1('0x5')),'defaultValue':_0x99a1('0x6')},'content':{'type':Sequelize[_0x99a1('0x7')]},'key':{'type':Sequelize[_0x99a1('0x7')]},'keyType':{'type':Sequelize[_0x99a1('0x2')](_0x99a1('0x6'),_0x99a1('0x3'),_0x99a1('0x4'))},'keyContent':{'type':Sequelize[_0x99a1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x99a1('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 283df47..3ea5b16 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 _0x409d=['key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','VtigerField','fieldName'];(function(_0x2bf8c6,_0x314fff){var _0x28bf19=function(_0xddccf6){while(--_0xddccf6){_0x2bf8c6['push'](_0x2bf8c6['shift']());}};_0x28bf19(++_0x314fff);}(_0x409d,0x195));var _0xd409=function(_0x362f63,_0x505e9b){_0x362f63=_0x362f63-0x0;var _0xf62a8d=_0x409d[_0x362f63];return _0xf62a8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd409('0x0'));var rimraf=require(_0xd409('0x1'));var zipdir=require(_0xd409('0x2'));var jsonpatch=require(_0xd409('0x3'));var rp=require(_0xd409('0x4'));var moment=require(_0xd409('0x5'));var BPromise=require(_0xd409('0x6'));var Mustache=require(_0xd409('0x7'));var util=require(_0xd409('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xd409('0x9'));var ejs=require(_0xd409('0xa'));var fs=require('fs');var _=require(_0xd409('0xb'));var squel=require(_0xd409('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd409('0x9'));var querystring=require(_0xd409('0xd'));var Papa=require(_0xd409('0xe'));var Redis=require(_0xd409('0xf'));var authService=require(_0xd409('0x10'));var qs=require(_0xd409('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd409('0x12'));var logger=require(_0xd409('0x13'))(_0xd409('0x14'));var utils=require(_0xd409('0x15'));var config=require(_0xd409('0x16'));var db=require(_0xd409('0x17'))['db'];function respondWithStatusCode(_0x1cc65c,_0x1a8098){_0x1a8098=_0x1a8098||0xcc;return function(_0x44dc57){if(_0x44dc57){return _0x1cc65c[_0xd409('0x18')](_0x1a8098);}return _0x1cc65c[_0xd409('0x19')](_0x1a8098)[_0xd409('0x1a')]();};}function respondWithResult(_0x58e9ed,_0x34a23f){_0x34a23f=_0x34a23f||0xc8;return function(_0x397ce0){if(_0x397ce0){return _0x58e9ed[_0xd409('0x19')](_0x34a23f)[_0xd409('0x1b')](_0x397ce0);}};}function respondWithFilteredResult(_0x35c2bc,_0x4558e2){return function(_0x1e4d14){if(_0x1e4d14){var _0x567a28=_0x1e4d14[_0xd409('0x1c')],_0x13ae22=_0x4558e2[_0xd409('0x1d')],_0x2ae87a=_0x4558e2['offset']+_0x4558e2[_0xd409('0x1e')],_0x11d627;if(_0x2ae87a>=_0x567a28){_0x2ae87a=_0x567a28;_0x11d627=0xc8;}else{_0x11d627=0xce;}_0x35c2bc[_0xd409('0x19')](_0x11d627);return _0x35c2bc['set'](_0xd409('0x1f'),_0x13ae22+'-'+_0x2ae87a+'/'+_0x567a28)['json'](_0x1e4d14);}return null;};}function patchUpdates(_0xf88e49){return function(_0x178483){try{jsonpatch[_0xd409('0x20')](_0x178483,_0xf88e49,!![]);}catch(_0x18a150){return BPromise[_0xd409('0x21')](_0x18a150);}return _0x178483[_0xd409('0x22')]();};}function saveUpdates(_0x56a568,_0x2afae8){return function(_0x18139e){if(_0x18139e){return _0x18139e[_0xd409('0x23')](_0x56a568)[_0xd409('0x24')](function(_0x1c51b9){return _0x1c51b9;});}return null;};}function removeEntity(_0x33ff43,_0x2d457c){return function(_0x3fc2f5){if(_0x3fc2f5){return _0x3fc2f5[_0xd409('0x25')]()[_0xd409('0x24')](function(){_0x33ff43[_0xd409('0x19')](0xcc)[_0xd409('0x1a')]();});}};}function handleEntityNotFound(_0x2f6bce,_0x74b1f5){return function(_0x290298){if(!_0x290298){_0x2f6bce[_0xd409('0x18')](0x194);}return _0x290298;};}function handleError(_0x390cbf,_0x18f705){_0x18f705=_0x18f705||0x1f4;return function(_0x3f8f14){logger[_0xd409('0x26')](_0x3f8f14[_0xd409('0x27')]);if(_0x3f8f14['name']){delete _0x3f8f14[_0xd409('0x28')];}_0x390cbf[_0xd409('0x19')](_0x18f705)[_0xd409('0x29')](_0x3f8f14);};}exports['index']=function(_0x41a967,_0x1bfab1){var _0x55a319={},_0x358de7={},_0x1b180c={'count':0x0,'rows':[]};var _0x15406b=_[_0xd409('0x2a')](db[_0xd409('0x2b')]['rawAttributes'],function(_0x2c5fab){return{'name':_0x2c5fab[_0xd409('0x2c')],'type':_0x2c5fab['type'][_0xd409('0x2d')]};});_0x358de7[_0xd409('0x2e')]=_[_0xd409('0x2a')](_0x15406b,_0xd409('0x28'));_0x358de7[_0xd409('0x2f')]=_[_0xd409('0x30')](_0x41a967['query']);_0x358de7['filters']=_[_0xd409('0x31')](_0x358de7['model'],_0x358de7[_0xd409('0x2f')]);_0x55a319[_0xd409('0x32')]=_[_0xd409('0x31')](_0x358de7[_0xd409('0x2e')],qs[_0xd409('0x33')](_0x41a967['query'][_0xd409('0x33')]));_0x55a319[_0xd409('0x32')]=_0x55a319[_0xd409('0x32')][_0xd409('0x34')]?_0x55a319['attributes']:_0x358de7[_0xd409('0x2e')];if(!_0x41a967[_0xd409('0x2f')][_0xd409('0x35')]('nolimit')){_0x55a319[_0xd409('0x1e')]=qs['limit'](_0x41a967['query']['limit']);_0x55a319['offset']=qs[_0xd409('0x1d')](_0x41a967[_0xd409('0x2f')][_0xd409('0x1d')]);}_0x55a319[_0xd409('0x36')]=qs[_0xd409('0x37')](_0x41a967[_0xd409('0x2f')]['sort']);_0x55a319[_0xd409('0x38')]=qs[_0xd409('0x39')](_[_0xd409('0x3a')](_0x41a967[_0xd409('0x2f')],_0x358de7[_0xd409('0x39')]),_0x15406b);if(_0x41a967[_0xd409('0x2f')][_0xd409('0x3b')]){_0x55a319['where']=_[_0xd409('0x3c')](_0x55a319[_0xd409('0x38')],{'$or':_[_0xd409('0x2a')](_0x15406b,function(_0x2115af){if(_0x2115af[_0xd409('0x3d')]!==_0xd409('0x3e')){var _0x2e25c9={};_0x2e25c9[_0x2115af[_0xd409('0x28')]]={'$like':'%'+_0x41a967[_0xd409('0x2f')]['filter']+'%'};return _0x2e25c9;}})});}_0x55a319=_[_0xd409('0x3c')]({},_0x55a319,_0x41a967[_0xd409('0x3f')]);var _0xa6bab7={'where':_0x55a319['where']};return db[_0xd409('0x2b')][_0xd409('0x1c')](_0xa6bab7)['then'](function(_0x2f2747){_0x1b180c[_0xd409('0x1c')]=_0x2f2747;if(_0x41a967[_0xd409('0x2f')][_0xd409('0x40')]){_0x55a319[_0xd409('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0xd409('0x42')](_0x55a319);})[_0xd409('0x24')](function(_0x21751f){_0x1b180c[_0xd409('0x43')]=_0x21751f;return _0x1b180c;})[_0xd409('0x24')](respondWithFilteredResult(_0x1bfab1,_0x55a319))['catch'](handleError(_0x1bfab1,null));};exports[_0xd409('0x44')]=function(_0x3fc04b,_0x194576){var _0x20290c={'raw':!![],'where':{'id':_0x3fc04b[_0xd409('0x45')]['id']}},_0x453eef={};_0x453eef[_0xd409('0x2e')]=_[_0xd409('0x30')](db[_0xd409('0x2b')][_0xd409('0x46')]);_0x453eef['query']=_['keys'](_0x3fc04b['query']);_0x453eef[_0xd409('0x39')]=_[_0xd409('0x31')](_0x453eef[_0xd409('0x2e')],_0x453eef[_0xd409('0x2f')]);_0x20290c['attributes']=_[_0xd409('0x31')](_0x453eef[_0xd409('0x2e')],qs[_0xd409('0x33')](_0x3fc04b[_0xd409('0x2f')][_0xd409('0x33')]));_0x20290c['attributes']=_0x20290c[_0xd409('0x32')]['length']?_0x20290c[_0xd409('0x32')]:_0x453eef['model'];if(_0x3fc04b[_0xd409('0x2f')][_0xd409('0x40')]){_0x20290c[_0xd409('0x41')]=[{'all':!![]}];}_0x20290c=_[_0xd409('0x3c')]({},_0x20290c,_0x3fc04b[_0xd409('0x3f')]);return db[_0xd409('0x2b')][_0xd409('0x47')](_0x20290c)[_0xd409('0x24')](handleEntityNotFound(_0x194576,null))['then'](respondWithResult(_0x194576,null))[_0xd409('0x48')](handleError(_0x194576,null));};exports[_0xd409('0x49')]=function(_0xcade9f,_0x2650c0){return db[_0xd409('0x2b')]['create'](_0xcade9f[_0xd409('0x4a')],{})[_0xd409('0x24')](respondWithResult(_0x2650c0,0xc9))[_0xd409('0x48')](handleError(_0x2650c0,null));};exports[_0xd409('0x23')]=function(_0x2cdac1,_0xf84b64){if(_0x2cdac1[_0xd409('0x4a')]['id']){delete _0x2cdac1[_0xd409('0x4a')]['id'];}return db[_0xd409('0x2b')]['find']({'where':{'id':_0x2cdac1[_0xd409('0x45')]['id']}})[_0xd409('0x24')](handleEntityNotFound(_0xf84b64,null))['then'](saveUpdates(_0x2cdac1[_0xd409('0x4a')],null))[_0xd409('0x24')](respondWithResult(_0xf84b64,null))[_0xd409('0x48')](handleError(_0xf84b64,null));};exports[_0xd409('0x25')]=function(_0x344d76,_0x5ec8d9){return db[_0xd409('0x2b')][_0xd409('0x47')]({'where':{'id':_0x344d76[_0xd409('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ec8d9,null))[_0xd409('0x24')](removeEntity(_0x5ec8d9,null))['catch'](handleError(_0x5ec8d9,null));}; \ No newline at end of file +var _0x0839=['rimraf','zip-dir','moment','bluebird','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','limit','sort','filter','merge','where','VIRTUAL','options','includeAll','VtigerField','findAll','rows','catch','show','params','keys','length','create','update','body','find','destroy','html-pdf','eml-format'];(function(_0x2bf1d6,_0x410efd){var _0x1be08a=function(_0x39c3a2){while(--_0x39c3a2){_0x2bf1d6['push'](_0x2bf1d6['shift']());}};_0x1be08a(++_0x410efd);}(_0x0839,0x112));var _0x9083=function(_0x24243c,_0x1b75ad){_0x24243c=_0x24243c-0x0;var _0x42e1ef=_0x0839[_0x24243c];return _0x42e1ef;};'use strict';var pdf=require(_0x9083('0x0'));var emlformat=require(_0x9083('0x1'));var rimraf=require(_0x9083('0x2'));var zipdir=require(_0x9083('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9083('0x4'));var BPromise=require(_0x9083('0x5'));var Mustache=require('mustache');var util=require(_0x9083('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9083('0x7'));var ejs=require(_0x9083('0x8'));var fs=require('fs');var _=require(_0x9083('0x9'));var squel=require('squel');var crypto=require(_0x9083('0xa'));var jsforce=require(_0x9083('0xb'));var deskjs=require(_0x9083('0xc'));var toCsv=require(_0x9083('0x7'));var querystring=require('querystring');var Papa=require(_0x9083('0xd'));var Redis=require(_0x9083('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9083('0xf'));var as=require(_0x9083('0x10'));var hardwareService=require(_0x9083('0x11'));var logger=require(_0x9083('0x12'))(_0x9083('0x13'));var utils=require(_0x9083('0x14'));var config=require(_0x9083('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x99d5c3,_0x5024c4){_0x5024c4=_0x5024c4||0xcc;return function(_0x5483ec){if(_0x5483ec){return _0x99d5c3[_0x9083('0x16')](_0x5024c4);}return _0x99d5c3[_0x9083('0x17')](_0x5024c4)[_0x9083('0x18')]();};}function respondWithResult(_0x2cc53a,_0x138ba2){_0x138ba2=_0x138ba2||0xc8;return function(_0x34e565){if(_0x34e565){return _0x2cc53a[_0x9083('0x17')](_0x138ba2)[_0x9083('0x19')](_0x34e565);}};}function respondWithFilteredResult(_0x353a63,_0x16162c){return function(_0x6cdc5c){if(_0x6cdc5c){var _0x22ec66=_0x6cdc5c[_0x9083('0x1a')],_0x17e48e=_0x16162c[_0x9083('0x1b')],_0x509472=_0x16162c[_0x9083('0x1b')]+_0x16162c['limit'],_0x1fcba3;if(_0x509472>=_0x22ec66){_0x509472=_0x22ec66;_0x1fcba3=0xc8;}else{_0x1fcba3=0xce;}_0x353a63[_0x9083('0x17')](_0x1fcba3);return _0x353a63[_0x9083('0x1c')]('Content-Range',_0x17e48e+'-'+_0x509472+'/'+_0x22ec66)[_0x9083('0x19')](_0x6cdc5c);}return null;};}function patchUpdates(_0x567c69){return function(_0x15896c){try{jsonpatch[_0x9083('0x1d')](_0x15896c,_0x567c69,!![]);}catch(_0x3e22ae){return BPromise[_0x9083('0x1e')](_0x3e22ae);}return _0x15896c[_0x9083('0x1f')]();};}function saveUpdates(_0x3e3749,_0x2fc459){return function(_0x1b62ba){if(_0x1b62ba){return _0x1b62ba['update'](_0x3e3749)['then'](function(_0x332e08){return _0x332e08;});}return null;};}function removeEntity(_0x37d7be,_0x3ae0bc){return function(_0x53ae71){if(_0x53ae71){return _0x53ae71['destroy']()[_0x9083('0x20')](function(){_0x37d7be[_0x9083('0x17')](0xcc)[_0x9083('0x18')]();});}};}function handleEntityNotFound(_0x522f7c,_0x5efbdf){return function(_0x132b25){if(!_0x132b25){_0x522f7c[_0x9083('0x16')](0x194);}return _0x132b25;};}function handleError(_0x31ab2e,_0x5a29d6){_0x5a29d6=_0x5a29d6||0x1f4;return function(_0x59bc00){logger[_0x9083('0x21')](_0x59bc00[_0x9083('0x22')]);if(_0x59bc00[_0x9083('0x23')]){delete _0x59bc00['name'];}_0x31ab2e[_0x9083('0x17')](_0x5a29d6)['send'](_0x59bc00);};}exports['index']=function(_0x2db262,_0x29d3c4){var _0x16930a={},_0x4d3ce9={},_0x47307d={'count':0x0,'rows':[]};var _0x48c54f=_[_0x9083('0x24')](db['VtigerField'][_0x9083('0x25')],function(_0x37a2ae){return{'name':_0x37a2ae[_0x9083('0x26')],'type':_0x37a2ae[_0x9083('0x27')][_0x9083('0x28')]};});_0x4d3ce9[_0x9083('0x29')]=_['map'](_0x48c54f,'name');_0x4d3ce9['query']=_['keys'](_0x2db262[_0x9083('0x2a')]);_0x4d3ce9[_0x9083('0x2b')]=_[_0x9083('0x2c')](_0x4d3ce9['model'],_0x4d3ce9[_0x9083('0x2a')]);_0x16930a['attributes']=_['intersection'](_0x4d3ce9[_0x9083('0x29')],qs[_0x9083('0x2d')](_0x2db262['query'][_0x9083('0x2d')]));_0x16930a[_0x9083('0x2e')]=_0x16930a[_0x9083('0x2e')]['length']?_0x16930a[_0x9083('0x2e')]:_0x4d3ce9[_0x9083('0x29')];if(!_0x2db262[_0x9083('0x2a')]['hasOwnProperty'](_0x9083('0x2f'))){_0x16930a['limit']=qs[_0x9083('0x30')](_0x2db262[_0x9083('0x2a')][_0x9083('0x30')]);_0x16930a[_0x9083('0x1b')]=qs['offset'](_0x2db262[_0x9083('0x2a')]['offset']);}_0x16930a['order']=qs[_0x9083('0x31')](_0x2db262[_0x9083('0x2a')]['sort']);_0x16930a['where']=qs[_0x9083('0x2b')](_['pick'](_0x2db262[_0x9083('0x2a')],_0x4d3ce9[_0x9083('0x2b')]),_0x48c54f);if(_0x2db262[_0x9083('0x2a')][_0x9083('0x32')]){_0x16930a['where']=_[_0x9083('0x33')](_0x16930a[_0x9083('0x34')],{'$or':_[_0x9083('0x24')](_0x48c54f,function(_0x538ec0){if(_0x538ec0[_0x9083('0x27')]!==_0x9083('0x35')){var _0x20472b={};_0x20472b[_0x538ec0[_0x9083('0x23')]]={'$like':'%'+_0x2db262[_0x9083('0x2a')][_0x9083('0x32')]+'%'};return _0x20472b;}})});}_0x16930a=_[_0x9083('0x33')]({},_0x16930a,_0x2db262[_0x9083('0x36')]);var _0x47507e={'where':_0x16930a[_0x9083('0x34')]};return db['VtigerField']['count'](_0x47507e)[_0x9083('0x20')](function(_0x32bb8b){_0x47307d['count']=_0x32bb8b;if(_0x2db262[_0x9083('0x2a')][_0x9083('0x37')]){_0x16930a['include']=[{'all':!![]}];}return db[_0x9083('0x38')][_0x9083('0x39')](_0x16930a);})[_0x9083('0x20')](function(_0x3460ba){_0x47307d[_0x9083('0x3a')]=_0x3460ba;return _0x47307d;})[_0x9083('0x20')](respondWithFilteredResult(_0x29d3c4,_0x16930a))[_0x9083('0x3b')](handleError(_0x29d3c4,null));};exports[_0x9083('0x3c')]=function(_0x1881a7,_0x972d48){var _0x2058f7={'raw':!![],'where':{'id':_0x1881a7[_0x9083('0x3d')]['id']}},_0x4d4c70={};_0x4d4c70['model']=_[_0x9083('0x3e')](db[_0x9083('0x38')][_0x9083('0x25')]);_0x4d4c70['query']=_[_0x9083('0x3e')](_0x1881a7[_0x9083('0x2a')]);_0x4d4c70[_0x9083('0x2b')]=_[_0x9083('0x2c')](_0x4d4c70[_0x9083('0x29')],_0x4d4c70[_0x9083('0x2a')]);_0x2058f7[_0x9083('0x2e')]=_[_0x9083('0x2c')](_0x4d4c70[_0x9083('0x29')],qs[_0x9083('0x2d')](_0x1881a7[_0x9083('0x2a')]['fields']));_0x2058f7[_0x9083('0x2e')]=_0x2058f7[_0x9083('0x2e')][_0x9083('0x3f')]?_0x2058f7[_0x9083('0x2e')]:_0x4d4c70[_0x9083('0x29')];if(_0x1881a7[_0x9083('0x2a')]['includeAll']){_0x2058f7['include']=[{'all':!![]}];}_0x2058f7=_[_0x9083('0x33')]({},_0x2058f7,_0x1881a7['options']);return db[_0x9083('0x38')]['find'](_0x2058f7)[_0x9083('0x20')](handleEntityNotFound(_0x972d48,null))[_0x9083('0x20')](respondWithResult(_0x972d48,null))[_0x9083('0x3b')](handleError(_0x972d48,null));};exports[_0x9083('0x40')]=function(_0x324743,_0x105041){return db[_0x9083('0x38')][_0x9083('0x40')](_0x324743['body'],{})[_0x9083('0x20')](respondWithResult(_0x105041,0xc9))['catch'](handleError(_0x105041,null));};exports[_0x9083('0x41')]=function(_0x17d280,_0x52041f){if(_0x17d280['body']['id']){delete _0x17d280[_0x9083('0x42')]['id'];}return db[_0x9083('0x38')][_0x9083('0x43')]({'where':{'id':_0x17d280[_0x9083('0x3d')]['id']}})[_0x9083('0x20')](handleEntityNotFound(_0x52041f,null))[_0x9083('0x20')](saveUpdates(_0x17d280[_0x9083('0x42')],null))['then'](respondWithResult(_0x52041f,null))['catch'](handleError(_0x52041f,null));};exports[_0x9083('0x44')]=function(_0xcb8490,_0x1b6fce){return db[_0x9083('0x38')][_0x9083('0x43')]({'where':{'id':_0xcb8490['params']['id']}})[_0x9083('0x20')](handleEntityNotFound(_0x1b6fce,null))[_0x9083('0x20')](removeEntity(_0x1b6fce,null))[_0x9083('0x3b')](handleError(_0x1b6fce,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 3cddf34..d619d6e 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 _0x9c44=['VtigerField','int_vtiger_fields','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','./intVtigerField.attributes','define'];(function(_0x48c5e6,_0x1bd5d3){var _0xce37c0=function(_0x1aaa08){while(--_0x1aaa08){_0x48c5e6['push'](_0x48c5e6['shift']());}};_0xce37c0(++_0x1bd5d3);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x49c4('0xa'),_0x49c4('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['exports','define','int_vtiger_fields','vtiger_unique_index','FieldId','../../config/logger','api','moment','bluebird','path','rimraf','./intVtigerField.attributes'];(function(_0x1195a6,_0x2c946e){var _0x37d89d=function(_0x917774){while(--_0x917774){_0x1195a6['push'](_0x1195a6['shift']());}};_0x37d89d(++_0x2c946e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0xcb91[_0xf31767];return _0x24bd0c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('VtigerField',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['idField',_0x1cb9('0xb')],'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 e58a29b..7f46bad 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 _0x2d93=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5b9d23,_0x437c38){var _0x56985a=function(_0x59237e){while(--_0x59237e){_0x5b9d23['push'](_0x5b9d23['shift']());}};_0x56985a(++_0x437c38);}(_0x2d93,0xf3));var _0x32d9=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x2d93[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x32d9('0x0'));var util=require(_0x32d9('0x1'));var moment=require(_0x32d9('0x2'));var BPromise=require(_0x32d9('0x3'));var rs=require(_0x32d9('0x4'));var fs=require('fs');var Redis=require(_0x32d9('0x5'));var db=require(_0x32d9('0x6'))['db'];var utils=require(_0x32d9('0x7'));var logger=require(_0x32d9('0x8'))(_0x32d9('0x9'));var config=require(_0x32d9('0xa'));var jayson=require(_0x32d9('0xb'));var client=jayson[_0x32d9('0xc')][_0x32d9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d2424,_0x161a9f,_0x12c49f){return new BPromise(function(_0x42cec8,_0x43dd2c){return client[_0x32d9('0xe')](_0x4d2424,_0x12c49f)['then'](function(_0x21df58){logger[_0x32d9('0xf')](_0x32d9('0x10'),_0x161a9f,_0x32d9('0x11'));logger[_0x32d9('0x12')](_0x32d9('0x13'),_0x161a9f,_0x32d9('0x11'),JSON[_0x32d9('0x14')](_0x21df58));if(_0x21df58[_0x32d9('0x15')]){if(_0x21df58[_0x32d9('0x15')][_0x32d9('0x16')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x161a9f,_0x21df58[_0x32d9('0x15')][_0x32d9('0x17')]);return _0x43dd2c(_0x21df58[_0x32d9('0x15')][_0x32d9('0x17')]);}logger[_0x32d9('0x15')](_0x32d9('0x10'),_0x161a9f,_0x21df58[_0x32d9('0x15')][_0x32d9('0x17')]);return _0x42cec8(_0x21df58[_0x32d9('0x15')][_0x32d9('0x17')]);}else{logger[_0x32d9('0xf')](_0x32d9('0x10'),_0x161a9f,'request\x20sent');_0x42cec8(_0x21df58[_0x32d9('0x18')][_0x32d9('0x17')]);}})['catch'](function(_0x24ab70){logger[_0x32d9('0x15')](_0x32d9('0x10'),_0x161a9f,_0x24ab70);_0x43dd2c(_0x24ab70);});});} \ No newline at end of file +var _0x5269=['../../config/environment','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','ioredis','../../mysqldb','../../config/utils'];(function(_0x358678,_0x47b2ac){var _0x4f2428=function(_0x3775c5){while(--_0x3775c5){_0x358678['push'](_0x358678['shift']());}};_0x4f2428(++_0x47b2ac);}(_0x5269,0x150));var _0x9526=function(_0x45adce,_0x5d145c){_0x45adce=_0x45adce-0x0;var _0x54306d=_0x5269[_0x45adce];return _0x54306d;};'use strict';var _=require(_0x9526('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9526('0x1'));var db=require(_0x9526('0x2'))['db'];var utils=require(_0x9526('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x9526('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9526('0x5')][_0x9526('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2e217a,_0x2082b4,_0x1d4acf){return new BPromise(function(_0x4569a0,_0x161880){return client[_0x9526('0x7')](_0x2e217a,_0x1d4acf)[_0x9526('0x8')](function(_0x320908){logger[_0x9526('0x9')](_0x9526('0xa'),_0x2082b4,'request\x20sent');logger[_0x9526('0xb')](_0x9526('0xc'),_0x2082b4,'request\x20sent',JSON[_0x9526('0xd')](_0x320908));if(_0x320908[_0x9526('0xe')]){if(_0x320908[_0x9526('0xe')][_0x9526('0xf')]===0x1f4){logger[_0x9526('0xe')](_0x9526('0xa'),_0x2082b4,_0x320908[_0x9526('0xe')]['message']);return _0x161880(_0x320908[_0x9526('0xe')][_0x9526('0x10')]);}logger['error'](_0x9526('0xa'),_0x2082b4,_0x320908[_0x9526('0xe')]['message']);return _0x4569a0(_0x320908['error']['message']);}else{logger[_0x9526('0x9')]('VtigerField,\x20%s,\x20%s',_0x2082b4,_0x9526('0x11'));_0x4569a0(_0x320908[_0x9526('0x12')][_0x9526('0x10')]);}})[_0x9526('0x13')](function(_0x3108ba){logger[_0x9526('0xe')]('VtigerField,\x20%s,\x20%s',_0x2082b4,_0x3108ba);_0x161880(_0x3108ba);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d74aac2..99d88d9 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 _0xeb88=['update','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','/:id/fields','getFields','post','create','put','/:id'];(function(_0x1113ce,_0x314645){var _0x3aefb8=function(_0x19ded2){while(--_0x19ded2){_0x1113ce['push'](_0x1113ce['shift']());}};_0x3aefb8(++_0x314645);}(_0xeb88,0xc0));var _0x8eb8=function(_0x3edd80,_0x4fff6f){_0x3edd80=_0x3edd80-0x0;var _0x580be5=_0xeb88[_0x3edd80];return _0x580be5;};'use strict';var multer=require('multer');var util=require(_0x8eb8('0x0'));var path=require('path');var timeout=require(_0x8eb8('0x1'));var express=require(_0x8eb8('0x2'));var router=express[_0x8eb8('0x3')]();var auth=require(_0x8eb8('0x4'));var interaction=require(_0x8eb8('0x5'));var config=require('../../config/environment');var controller=require(_0x8eb8('0x6'));router[_0x8eb8('0x7')]('/',auth[_0x8eb8('0x8')](),controller[_0x8eb8('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x8eb8('0xa')]);router[_0x8eb8('0x7')]('/:id/configurations',auth[_0x8eb8('0x8')](),controller[_0x8eb8('0xb')]);router[_0x8eb8('0x7')](_0x8eb8('0xc'),auth['isAuthenticated'](),controller[_0x8eb8('0xd')]);router[_0x8eb8('0xe')]('/',auth[_0x8eb8('0x8')](),controller[_0x8eb8('0xf')]);router['post']('/:id/configurations',auth[_0x8eb8('0x8')](),controller['addConfiguration']);router[_0x8eb8('0x10')](_0x8eb8('0x11'),auth['isAuthenticated'](),controller[_0x8eb8('0x12')]);router[_0x8eb8('0x13')](_0x8eb8('0x11'),auth[_0x8eb8('0x8')](),controller[_0x8eb8('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc54b=['util','path','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','create','addConfiguration','put','destroy','multer'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xc54b,0xd7));var _0xbc54=function(_0x108b66,_0x37db88){_0x108b66=_0x108b66-0x0;var _0x3ed76=_0xc54b[_0x108b66];return _0x3ed76;};'use strict';var multer=require(_0xbc54('0x0'));var util=require(_0xbc54('0x1'));var path=require(_0xbc54('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xbc54('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xbc54('0x4'));var controller=require(_0xbc54('0x5'));router[_0xbc54('0x6')]('/',auth['isAuthenticated'](),controller[_0xbc54('0x7')]);router['get'](_0xbc54('0x8'),auth[_0xbc54('0x9')](),controller['show']);router[_0xbc54('0x6')](_0xbc54('0xa'),auth[_0xbc54('0x9')](),controller[_0xbc54('0xb')]);router['get'](_0xbc54('0xc'),auth[_0xbc54('0x9')](),controller[_0xbc54('0xd')]);router['post']('/',auth[_0xbc54('0x9')](),controller[_0xbc54('0xe')]);router['post'](_0xbc54('0xa'),auth['isAuthenticated'](),controller[_0xbc54('0xf')]);router[_0xbc54('0x10')](_0xbc54('0x8'),auth[_0xbc54('0x9')](),controller['update']);router['delete'](_0xbc54('0x8'),auth[_0xbc54('0x9')](),controller[_0xbc54('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index cc8f79c..26c1c61 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 _0xea5a=['token','ENUM','integrationTab','exports','STRING','username','remoteUri','password'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xea5a,0x1e3));var _0xaea5=function(_0x24a992,_0x5c49eb){_0x24a992=_0x24a992-0x0;var _0x26e1d4=_0xea5a[_0x24a992];return _0x26e1d4;};'use strict';var Sequelize=require('sequelize');module[_0xaea5('0x0')]={'name':{'type':Sequelize[_0xaea5('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xaea5('0x1')],'unique':_0xaea5('0x2')},'password':{'type':Sequelize[_0xaea5('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xaea5('0x1')],'unique':_0xaea5('0x3')},'authType':{'type':Sequelize['ENUM'](_0xaea5('0x4'),_0xaea5('0x5')),'defaultValue':_0xaea5('0x4')},'serverUrl':{'type':Sequelize[_0xaea5('0x1')]},'type':{'type':Sequelize[_0xaea5('0x6')](_0xaea5('0x7'),'newTab'),'defaultValue':_0xaea5('0x7')}}; \ No newline at end of file +var _0x540b=['ENUM','password','token','newTab','integrationTab','sequelize','exports','username','STRING','remoteUri'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x540b,0x159));var _0xb540=function(_0x343703,_0x121249){_0x343703=_0x343703-0x0;var _0x13363c=_0x540b[_0x343703];return _0x13363c;};'use strict';var Sequelize=require(_0xb540('0x0'));module[_0xb540('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xb540('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xb540('0x3')]},'remoteUri':{'type':Sequelize[_0xb540('0x3')],'unique':_0xb540('0x4')},'authType':{'type':Sequelize[_0xb540('0x5')](_0xb540('0x6'),_0xb540('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb540('0x5')]('integrationTab',_0xb540('0x8')),'defaultValue':_0xb540('0x9')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3c741b6..a9b2c6b 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 _0x1bc0=['eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../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','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','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','ZendeskAccount','options','find','create','body','getConfigurations','ZendeskConfiguration','order','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','ZendeskField','getFields','username','password','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','subject','description','group','assignee','remove','includes','title','position','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','html-pdf'];(function(_0x577caa,_0x3194d4){var _0x2b4fae=function(_0x1ffa0a){while(--_0x1ffa0a){_0x577caa['push'](_0x577caa['shift']());}};_0x2b4fae(++_0x3194d4);}(_0x1bc0,0x188));var _0x01bc=function(_0x225400,_0x3f62cf){_0x225400=_0x225400-0x0;var _0xabf49a=_0x1bc0[_0x225400];return _0xabf49a;};'use strict';var pdf=require(_0x01bc('0x0'));var emlformat=require(_0x01bc('0x1'));var rimraf=require(_0x01bc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x01bc('0x3'));var rp=require(_0x01bc('0x4'));var moment=require(_0x01bc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x01bc('0x6'));var util=require('util');var path=require('path');var sox=require(_0x01bc('0x7'));var csv=require(_0x01bc('0x8'));var ejs=require(_0x01bc('0x9'));var fs=require('fs');var _=require(_0x01bc('0xa'));var squel=require('squel');var crypto=require(_0x01bc('0xb'));var jsforce=require(_0x01bc('0xc'));var deskjs=require(_0x01bc('0xd'));var toCsv=require(_0x01bc('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x01bc('0xe'));var qs=require(_0x01bc('0xf'));var as=require(_0x01bc('0x10'));var hardwareService=require(_0x01bc('0x11'));var logger=require(_0x01bc('0x12'))(_0x01bc('0x13'));var utils=require(_0x01bc('0x14'));var config=require('../../config/environment');var db=require(_0x01bc('0x15'))['db'];var integrations=require(_0x01bc('0x16'));var jayson=require(_0x01bc('0x17'));var client=jayson[_0x01bc('0x18')][_0x01bc('0x19')]({'port':0x232a});function checkPasswordPattern(_0x6614e7,_0x3ae122,_0x54a81f){if(_0x54a81f){var _0x5f1af3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f1af3[_0x01bc('0x1a')](_0x3ae122)){return _0x6614e7;}else{throw new db[(_0x01bc('0x1b'))][(_0x01bc('0x1c'))](_0x01bc('0x1d'));}}else{return _0x6614e7;}}function respondWithRpcPromise(_0x3695f3,_0x5c71ca,_0x131789,_0xc7e75f){return new BPromise(function(_0x500a04,_0x5707e0){var _0x21ded4=_0xc7e75f||client;return _0x21ded4[_0x01bc('0x1e')](_0x3695f3,_0x131789)[_0x01bc('0x1f')](function(_0x2f1623){logger[_0x01bc('0x20')](_0x01bc('0x21'),_0x5c71ca,_0x01bc('0x22'));logger[_0x01bc('0x23')](_0x01bc('0x24'),_0x5c71ca,_0x01bc('0x22'),JSON['stringify'](_0x2f1623));if(_0x2f1623[_0x01bc('0x25')]){if(_0x2f1623[_0x01bc('0x25')][_0x01bc('0x26')]===0x1f4){logger['error'](_0x01bc('0x21'),_0x5c71ca,_0x2f1623[_0x01bc('0x25')][_0x01bc('0x27')]);return _0x5707e0(_0x2f1623[_0x01bc('0x25')]['message']);}logger[_0x01bc('0x25')](_0x01bc('0x21'),_0x5c71ca,_0x2f1623[_0x01bc('0x25')][_0x01bc('0x27')]);return _0x500a04(_0x2f1623[_0x01bc('0x25')]['message']);}else{logger['info'](_0x01bc('0x21'),_0x5c71ca,_0x01bc('0x22'));_0x500a04(_0x2f1623[_0x01bc('0x28')][_0x01bc('0x27')]);}})['catch'](function(_0x51b75b){logger[_0x01bc('0x25')](_0x01bc('0x21'),_0x5c71ca,_0x51b75b);_0x5707e0(_0x51b75b);});});}function respondWithStatusCode(_0x19b69d,_0x1e5afe){_0x1e5afe=_0x1e5afe||0xcc;return function(_0x3eb605){if(_0x3eb605){return _0x19b69d['sendStatus'](_0x1e5afe);}return _0x19b69d[_0x01bc('0x29')](_0x1e5afe)[_0x01bc('0x2a')]();};}function respondWithResult(_0x5d1ec4,_0x3d649b){_0x3d649b=_0x3d649b||0xc8;return function(_0x277711){if(_0x277711){return _0x5d1ec4[_0x01bc('0x29')](_0x3d649b)[_0x01bc('0x2b')](_0x277711);}};}function respondWithFilteredResult(_0x4df68f,_0xba98e3){return function(_0x37bbdb){if(_0x37bbdb){var _0x1a4895=_0x37bbdb[_0x01bc('0x2c')],_0xef1bb7=_0xba98e3[_0x01bc('0x2d')],_0x423cfb=_0xba98e3['offset']+_0xba98e3[_0x01bc('0x2e')],_0x59bc07;if(_0x423cfb>=_0x1a4895){_0x423cfb=_0x1a4895;_0x59bc07=0xc8;}else{_0x59bc07=0xce;}_0x4df68f[_0x01bc('0x29')](_0x59bc07);return _0x4df68f[_0x01bc('0x2f')](_0x01bc('0x30'),_0xef1bb7+'-'+_0x423cfb+'/'+_0x1a4895)[_0x01bc('0x2b')](_0x37bbdb);}return null;};}function patchUpdates(_0x434eda){return function(_0x53831d){try{jsonpatch[_0x01bc('0x31')](_0x53831d,_0x434eda,!![]);}catch(_0x4d170e){return BPromise['reject'](_0x4d170e);}return _0x53831d[_0x01bc('0x32')]();};}function saveUpdates(_0x15f06f,_0x2c7767){return function(_0x33c1e7){if(_0x33c1e7){return _0x33c1e7[_0x01bc('0x33')](_0x15f06f)[_0x01bc('0x1f')](function(_0x27504){return _0x27504;});}return null;};}function removeEntity(_0x286ac9,_0x50a4da){return function(_0x1b9968){if(_0x1b9968){return _0x1b9968['destroy']()[_0x01bc('0x1f')](function(){_0x286ac9[_0x01bc('0x29')](0xcc)[_0x01bc('0x2a')]();});}};}function handleEntityNotFound(_0x340142,_0x557a59){return function(_0x44f978){if(!_0x44f978){_0x340142[_0x01bc('0x34')](0x194);}return _0x44f978;};}function handleError(_0x52c9ee,_0x3fd443){_0x3fd443=_0x3fd443||0x1f4;return function(_0x27cac6){logger['error'](_0x27cac6[_0x01bc('0x35')]);if(_0x27cac6[_0x01bc('0x36')]){delete _0x27cac6[_0x01bc('0x36')];}_0x52c9ee[_0x01bc('0x29')](_0x3fd443)[_0x01bc('0x37')](_0x27cac6);};}exports[_0x01bc('0x38')]=function(_0x2b45cc,_0x338b25){var _0x49a153={},_0x2a5a06={},_0x156aae={'count':0x0,'rows':[]};var _0x55ee9c=_[_0x01bc('0x39')](db['ZendeskAccount'][_0x01bc('0x3a')],function(_0x13b70c){return{'name':_0x13b70c[_0x01bc('0x3b')],'type':_0x13b70c[_0x01bc('0x3c')][_0x01bc('0x3d')]};});_0x2a5a06[_0x01bc('0x3e')]=_[_0x01bc('0x39')](_0x55ee9c,_0x01bc('0x36'));_0x2a5a06[_0x01bc('0x3f')]=_[_0x01bc('0x40')](_0x2b45cc[_0x01bc('0x3f')]);_0x2a5a06[_0x01bc('0x41')]=_[_0x01bc('0x42')](_0x2a5a06[_0x01bc('0x3e')],_0x2a5a06[_0x01bc('0x3f')]);_0x49a153[_0x01bc('0x43')]=_[_0x01bc('0x42')](_0x2a5a06['model'],qs[_0x01bc('0x44')](_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x44')]));_0x49a153[_0x01bc('0x43')]=_0x49a153[_0x01bc('0x43')][_0x01bc('0x45')]?_0x49a153[_0x01bc('0x43')]:_0x2a5a06[_0x01bc('0x3e')];if(!_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x46')](_0x01bc('0x47'))){_0x49a153[_0x01bc('0x2e')]=qs[_0x01bc('0x2e')](_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x2e')]);_0x49a153[_0x01bc('0x2d')]=qs[_0x01bc('0x2d')](_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x2d')]);}_0x49a153['order']=qs['sort'](_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x48')]);_0x49a153[_0x01bc('0x49')]=qs[_0x01bc('0x41')](_[_0x01bc('0x4a')](_0x2b45cc['query'],_0x2a5a06[_0x01bc('0x41')]),_0x55ee9c);if(_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x4b')]){_0x49a153['where']=_['merge'](_0x49a153[_0x01bc('0x49')],{'$or':_[_0x01bc('0x39')](_0x55ee9c,function(_0x5c4a84){if(_0x5c4a84[_0x01bc('0x3c')]!==_0x01bc('0x4c')){var _0x583177={};_0x583177[_0x5c4a84[_0x01bc('0x36')]]={'$like':'%'+_0x2b45cc[_0x01bc('0x3f')]['filter']+'%'};return _0x583177;}})});}_0x49a153=_[_0x01bc('0x4d')]({},_0x49a153,_0x2b45cc['options']);var _0x8b7e5a={'where':_0x49a153['where']};return db['ZendeskAccount'][_0x01bc('0x2c')](_0x8b7e5a)[_0x01bc('0x1f')](function(_0x35b31d){_0x156aae[_0x01bc('0x2c')]=_0x35b31d;if(_0x2b45cc[_0x01bc('0x3f')][_0x01bc('0x4e')]){_0x49a153[_0x01bc('0x4f')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x01bc('0x50')](_0x49a153);})[_0x01bc('0x1f')](function(_0xd81d5c){_0x156aae[_0x01bc('0x51')]=_0xd81d5c;return _0x156aae;})[_0x01bc('0x1f')](respondWithFilteredResult(_0x338b25,_0x49a153))[_0x01bc('0x52')](handleError(_0x338b25,null));};exports['show']=function(_0xd8a0fc,_0x590c6b){var _0x3e303f={'raw':![],'where':{'id':_0xd8a0fc[_0x01bc('0x53')]['id']}},_0x120a1e={};_0x120a1e[_0x01bc('0x3e')]=_[_0x01bc('0x40')](db[_0x01bc('0x54')][_0x01bc('0x3a')]);_0x120a1e[_0x01bc('0x3f')]=_['keys'](_0xd8a0fc[_0x01bc('0x3f')]);_0x120a1e[_0x01bc('0x41')]=_[_0x01bc('0x42')](_0x120a1e[_0x01bc('0x3e')],_0x120a1e[_0x01bc('0x3f')]);_0x3e303f[_0x01bc('0x43')]=_['intersection'](_0x120a1e['model'],qs[_0x01bc('0x44')](_0xd8a0fc[_0x01bc('0x3f')][_0x01bc('0x44')]));_0x3e303f[_0x01bc('0x43')]=_0x3e303f['attributes']['length']?_0x3e303f[_0x01bc('0x43')]:_0x120a1e[_0x01bc('0x3e')];if(_0xd8a0fc['query'][_0x01bc('0x4e')]){_0x3e303f['include']=[{'all':!![]}];}_0x3e303f=_[_0x01bc('0x4d')]({},_0x3e303f,_0xd8a0fc[_0x01bc('0x55')]);return db[_0x01bc('0x54')][_0x01bc('0x56')](_0x3e303f)[_0x01bc('0x1f')](handleEntityNotFound(_0x590c6b,null))[_0x01bc('0x1f')](respondWithResult(_0x590c6b,null))[_0x01bc('0x52')](handleError(_0x590c6b,null));};exports[_0x01bc('0x57')]=function(_0xa709f5,_0x9a0a70){return db[_0x01bc('0x54')][_0x01bc('0x57')](_0xa709f5['body'],{})[_0x01bc('0x1f')](respondWithResult(_0x9a0a70,0xc9))['catch'](handleError(_0x9a0a70,null));};exports[_0x01bc('0x33')]=function(_0x5c7e97,_0x2e2156){if(_0x5c7e97[_0x01bc('0x58')]['id']){delete _0x5c7e97[_0x01bc('0x58')]['id'];}return db[_0x01bc('0x54')]['find']({'where':{'id':_0x5c7e97[_0x01bc('0x53')]['id']}})[_0x01bc('0x1f')](handleEntityNotFound(_0x2e2156,null))[_0x01bc('0x1f')](saveUpdates(_0x5c7e97['body'],null))[_0x01bc('0x1f')](respondWithResult(_0x2e2156,null))[_0x01bc('0x52')](handleError(_0x2e2156,null));};exports['destroy']=function(_0x1c4277,_0x56b6eb){return db[_0x01bc('0x54')][_0x01bc('0x56')]({'where':{'id':_0x1c4277[_0x01bc('0x53')]['id']}})[_0x01bc('0x1f')](handleEntityNotFound(_0x56b6eb,null))['then'](removeEntity(_0x56b6eb,null))['catch'](handleError(_0x56b6eb,null));};exports[_0x01bc('0x59')]=function(_0x179c32,_0x11e0cc,_0x24ce37){var _0x117e7f={};var _0x1ff6f4={};var _0x58b073;var _0x4531b4;return db[_0x01bc('0x54')]['findOne']({'where':{'id':_0x179c32['params']['id']}})['then'](handleEntityNotFound(_0x11e0cc,null))[_0x01bc('0x1f')](function(_0x58f064){if(_0x58f064){_0x58b073=_0x58f064;_0x1ff6f4[_0x01bc('0x3e')]=_[_0x01bc('0x40')](db[_0x01bc('0x5a')][_0x01bc('0x3a')]);_0x1ff6f4[_0x01bc('0x3f')]=_['keys'](_0x179c32[_0x01bc('0x3f')]);_0x1ff6f4[_0x01bc('0x41')]=_[_0x01bc('0x42')](_0x1ff6f4[_0x01bc('0x3e')],_0x1ff6f4[_0x01bc('0x3f')]);_0x117e7f[_0x01bc('0x43')]=_[_0x01bc('0x42')](_0x1ff6f4[_0x01bc('0x3e')],qs[_0x01bc('0x44')](_0x179c32[_0x01bc('0x3f')][_0x01bc('0x44')]));_0x117e7f[_0x01bc('0x43')]=_0x117e7f['attributes']['length']?_0x117e7f[_0x01bc('0x43')]:_0x1ff6f4['model'];_0x117e7f[_0x01bc('0x5b')]=qs[_0x01bc('0x48')](_0x179c32[_0x01bc('0x3f')][_0x01bc('0x48')]);_0x117e7f[_0x01bc('0x49')]=qs['filters'](_[_0x01bc('0x4a')](_0x179c32[_0x01bc('0x3f')],_0x1ff6f4[_0x01bc('0x41')]));if(_0x179c32[_0x01bc('0x3f')][_0x01bc('0x4b')]){_0x117e7f[_0x01bc('0x49')]=_[_0x01bc('0x4d')](_0x117e7f[_0x01bc('0x49')],{'$or':_[_0x01bc('0x39')](_0x117e7f[_0x01bc('0x43')],function(_0xf808cd){var _0x2b6a0c={};_0x2b6a0c[_0xf808cd]={'$like':'%'+_0x179c32[_0x01bc('0x3f')][_0x01bc('0x4b')]+'%'};return _0x2b6a0c;})});}_0x117e7f=_[_0x01bc('0x4d')]({},_0x117e7f,_0x179c32[_0x01bc('0x55')]);return _0x58b073[_0x01bc('0x59')](_0x117e7f);}})[_0x01bc('0x1f')](function(_0x305f2a){if(_0x305f2a){_0x4531b4=_0x305f2a[_0x01bc('0x45')];if(!_0x179c32[_0x01bc('0x3f')][_0x01bc('0x46')](_0x01bc('0x47'))){_0x117e7f[_0x01bc('0x2e')]=qs[_0x01bc('0x2e')](_0x179c32[_0x01bc('0x3f')][_0x01bc('0x2e')]);_0x117e7f[_0x01bc('0x2d')]=qs[_0x01bc('0x2d')](_0x179c32['query'][_0x01bc('0x2d')]);}return _0x58b073[_0x01bc('0x59')](_0x117e7f);}})[_0x01bc('0x1f')](function(_0x109e57){if(_0x109e57){return _0x109e57?{'count':_0x4531b4,'rows':_0x109e57}:null;}})[_0x01bc('0x1f')](respondWithResult(_0x11e0cc,null))[_0x01bc('0x52')](handleError(_0x11e0cc,null));};exports[_0x01bc('0x5c')]=function(_0x14e973,_0x2c8b64,_0x4ca1d6){if(_0x14e973[_0x01bc('0x58')]['id']){delete _0x14e973['body']['id'];}return db[_0x01bc('0x54')][_0x01bc('0x5d')]({'where':{'id':_0x14e973[_0x01bc('0x53')]['id']}})[_0x01bc('0x1f')](handleEntityNotFound(_0x2c8b64,null))[_0x01bc('0x1f')](function(_0x4da9c2){if(_0x4da9c2){_0x14e973[_0x01bc('0x58')][_0x01bc('0x5e')]=_0x4da9c2['id'];_0x14e973[_0x01bc('0x58')][_0x01bc('0x5f')]=integrations['getSubjects'](_0x14e973['body'][_0x01bc('0x60')],_0x14e973[_0x01bc('0x58')][_0x01bc('0x3c')]);_0x14e973[_0x01bc('0x58')][_0x01bc('0x61')]=integrations['getDescriptions'](_0x14e973['body'][_0x01bc('0x60')],_0x14e973['body'][_0x01bc('0x3c')]);return db[_0x01bc('0x5a')][_0x01bc('0x57')](_0x14e973[_0x01bc('0x58')],{'include':[{'model':db[_0x01bc('0x62')],'as':'Subjects'},{'model':db[_0x01bc('0x62')],'as':_0x01bc('0x61')}]});}return null;})['then'](respondWithResult(_0x2c8b64,null))[_0x01bc('0x52')](handleError(_0x2c8b64,null));};exports[_0x01bc('0x63')]=function(_0xd36753,_0x4d2b96,_0x52d6d8){var _0x94bf03='';return db[_0x01bc('0x54')]['findOne']({'where':{'id':_0xd36753[_0x01bc('0x53')]['id']},'attributes':['id',_0x01bc('0x64'),_0x01bc('0x65'),'token',_0x01bc('0x66'),_0x01bc('0x67')]})[_0x01bc('0x1f')](handleEntityNotFound(_0x4d2b96,null))[_0x01bc('0x1f')](function(_0x5e43a1){if(_0x5e43a1){_0x94bf03=_0x5e43a1[_0x01bc('0x67')];var _0x19a9df=_0x94bf03[_0x01bc('0x68')](-0x1);if(_0x19a9df==='/'){_0x94bf03=_0x94bf03[_0x01bc('0x69')](0x0,_0x94bf03[_0x01bc('0x6a')](_0x19a9df));}var _0x46c6f5={'method':_0x01bc('0x6b'),'uri':util[_0x01bc('0x6c')](_0x01bc('0x6d'),_0x94bf03,_0x01bc('0x6e')),'json':!![]};switch(_0x5e43a1[_0x01bc('0x66')]){case _0x01bc('0x65'):_0x46c6f5[_0x01bc('0x6f')]={'Authorization':util['format'](_0x01bc('0x70'),new Buffer(util[_0x01bc('0x6c')](_0x01bc('0x71'),_0x5e43a1[_0x01bc('0x64')],_0x5e43a1[_0x01bc('0x65')]))[_0x01bc('0x72')](_0x01bc('0x73')))};break;case _0x01bc('0x74'):_0x46c6f5['headers']={'Authorization':util[_0x01bc('0x6c')]('Basic\x20%s',new Buffer(util[_0x01bc('0x6c')](_0x01bc('0x75'),_0x5e43a1[_0x01bc('0x64')],_0x5e43a1[_0x01bc('0x74')]))['toString'](_0x01bc('0x73')))};break;default:throw new db[(_0x01bc('0x1b'))][(_0x01bc('0x1c'))]('Unknown\x20authentication\x20type');}return rp(_0x46c6f5);}})[_0x01bc('0x1f')](function(_0x240b6f){if(_0x240b6f){var _0x3595cc=[_0x01bc('0x76'),_0x01bc('0x77'),_0x01bc('0x78'),_0x01bc('0x79')];_[_0x01bc('0x7a')](_0x240b6f[_0x01bc('0x6e')],function(_0x54a6bd){return _0x3595cc[_0x01bc('0x7b')](_0x54a6bd['type']);});return{'count':_0x240b6f['ticket_fields'][_0x01bc('0x45')],'rows':_[_0x01bc('0x39')](_0x240b6f[_0x01bc('0x6e')],function(_0x326339){return{'id':_0x326339['id'],'name':_0x326339['position']>0x7?_0x326339[_0x01bc('0x7c')]:_0x326339[_0x01bc('0x3c')],'custom':_0x326339[_0x01bc('0x7d')]>0x7?!![]:![],'options':_0x326339['system_field_options']?_0x326339[_0x01bc('0x7e')]:_0x326339[_0x01bc('0x7f')]?_0x326339[_0x01bc('0x7f')]:[]};})};}})['then'](respondWithResult(_0x4d2b96,null))[_0x01bc('0x52')](function(_0x3acc39){var _0x3f549b=_0xd36753[_0x01bc('0x3f')][_0x01bc('0x1a')]?0x1f4:_0x3acc39['statusCode']||0x1f4;logger[_0x01bc('0x25')](_0x01bc('0x80'),_0x01bc('0x63'),_0x3f549b,JSON[_0x01bc('0x81')](_0x3acc39));delete _0x3acc39['name'];if(_0x3f549b===0x191){_0x3f549b=0x190;}_0x4d2b96['status'](_0x3f549b)['send'](_0xd36753[_0x01bc('0x3f')][_0x01bc('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x3acc39[_0x01bc('0x82')]}:_0x3acc39);});}; \ No newline at end of file +var _0x9980=['../../config/logger','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','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','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','index','map','ZendeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','create','body','getConfigurations','findOne','ZendeskConfiguration','length','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','ticket_fields','headers','Basic\x20%s','%s:%s','%s/token:%s','toString','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9980,0x1f4));var _0x0998=function(_0x42b769,_0x2aa6fc){_0x42b769=_0x42b769-0x0;var _0x195644=_0x9980[_0x42b769];return _0x195644;};'use strict';var pdf=require(_0x0998('0x0'));var emlformat=require(_0x0998('0x1'));var rimraf=require(_0x0998('0x2'));var zipdir=require(_0x0998('0x3'));var jsonpatch=require(_0x0998('0x4'));var rp=require(_0x0998('0x5'));var moment=require(_0x0998('0x6'));var BPromise=require(_0x0998('0x7'));var Mustache=require(_0x0998('0x8'));var util=require(_0x0998('0x9'));var path=require(_0x0998('0xa'));var sox=require(_0x0998('0xb'));var csv=require(_0x0998('0xc'));var ejs=require(_0x0998('0xd'));var fs=require('fs');var _=require(_0x0998('0xe'));var squel=require('squel');var crypto=require(_0x0998('0xf'));var jsforce=require(_0x0998('0x10'));var deskjs=require(_0x0998('0x11'));var toCsv=require(_0x0998('0xc'));var querystring=require(_0x0998('0x12'));var Papa=require(_0x0998('0x13'));var Redis=require(_0x0998('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x0998('0x15'));var as=require(_0x0998('0x16'));var hardwareService=require(_0x0998('0x17'));var logger=require(_0x0998('0x18'))(_0x0998('0x19'));var utils=require(_0x0998('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0998('0x1b'));var jayson=require(_0x0998('0x1c'));var client=jayson[_0x0998('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x1b5975,_0x4d0895,_0x13f585){if(_0x13f585){var _0x516189=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x516189[_0x0998('0x1e')](_0x4d0895)){return _0x1b5975;}else{throw new db[(_0x0998('0x1f'))]['ValidationError'](_0x0998('0x20'));}}else{return _0x1b5975;}}function respondWithRpcPromise(_0x128ed5,_0xa93dac,_0x1da0ad,_0x16e66d){return new BPromise(function(_0x9174,_0xb5a784){var _0x2e687d=_0x16e66d||client;return _0x2e687d[_0x0998('0x21')](_0x128ed5,_0x1da0ad)[_0x0998('0x22')](function(_0xb5b815){logger['info'](_0x0998('0x23'),_0xa93dac,_0x0998('0x24'));logger[_0x0998('0x25')](_0x0998('0x26'),_0xa93dac,_0x0998('0x24'),JSON[_0x0998('0x27')](_0xb5b815));if(_0xb5b815['error']){if(_0xb5b815[_0x0998('0x28')][_0x0998('0x29')]===0x1f4){logger['error'](_0x0998('0x23'),_0xa93dac,_0xb5b815[_0x0998('0x28')][_0x0998('0x2a')]);return _0xb5a784(_0xb5b815[_0x0998('0x28')]['message']);}logger[_0x0998('0x28')](_0x0998('0x23'),_0xa93dac,_0xb5b815[_0x0998('0x28')][_0x0998('0x2a')]);return _0x9174(_0xb5b815[_0x0998('0x28')]['message']);}else{logger[_0x0998('0x2b')](_0x0998('0x23'),_0xa93dac,_0x0998('0x24'));_0x9174(_0xb5b815[_0x0998('0x2c')][_0x0998('0x2a')]);}})[_0x0998('0x2d')](function(_0x103ff1){logger['error'](_0x0998('0x23'),_0xa93dac,_0x103ff1);_0xb5a784(_0x103ff1);});});}function respondWithStatusCode(_0x5b3ae9,_0x42a4a3){_0x42a4a3=_0x42a4a3||0xcc;return function(_0x30a036){if(_0x30a036){return _0x5b3ae9[_0x0998('0x2e')](_0x42a4a3);}return _0x5b3ae9[_0x0998('0x2f')](_0x42a4a3)[_0x0998('0x30')]();};}function respondWithResult(_0x20e030,_0x54062b){_0x54062b=_0x54062b||0xc8;return function(_0x20affa){if(_0x20affa){return _0x20e030['status'](_0x54062b)[_0x0998('0x31')](_0x20affa);}};}function respondWithFilteredResult(_0x582eea,_0x4c1d14){return function(_0x485afe){if(_0x485afe){var _0x58dd7f=_0x485afe[_0x0998('0x32')],_0x375718=_0x4c1d14[_0x0998('0x33')],_0x225b26=_0x4c1d14[_0x0998('0x33')]+_0x4c1d14[_0x0998('0x34')],_0x376663;if(_0x225b26>=_0x58dd7f){_0x225b26=_0x58dd7f;_0x376663=0xc8;}else{_0x376663=0xce;}_0x582eea[_0x0998('0x2f')](_0x376663);return _0x582eea[_0x0998('0x35')](_0x0998('0x36'),_0x375718+'-'+_0x225b26+'/'+_0x58dd7f)[_0x0998('0x31')](_0x485afe);}return null;};}function patchUpdates(_0x2cdd33){return function(_0x2d7faf){try{jsonpatch[_0x0998('0x37')](_0x2d7faf,_0x2cdd33,!![]);}catch(_0x5c61d4){return BPromise[_0x0998('0x38')](_0x5c61d4);}return _0x2d7faf['save']();};}function saveUpdates(_0x79f353,_0x3ea69e){return function(_0x18403c){if(_0x18403c){return _0x18403c[_0x0998('0x39')](_0x79f353)[_0x0998('0x22')](function(_0x420cb9){return _0x420cb9;});}return null;};}function removeEntity(_0x675774,_0x24670b){return function(_0x29ee40){if(_0x29ee40){return _0x29ee40[_0x0998('0x3a')]()[_0x0998('0x22')](function(){_0x675774[_0x0998('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6674f7,_0x181680){return function(_0x595626){if(!_0x595626){_0x6674f7[_0x0998('0x2e')](0x194);}return _0x595626;};}function handleError(_0x36cd51,_0x5eafcb){_0x5eafcb=_0x5eafcb||0x1f4;return function(_0x1bd878){logger[_0x0998('0x28')](_0x1bd878[_0x0998('0x3b')]);if(_0x1bd878[_0x0998('0x3c')]){delete _0x1bd878[_0x0998('0x3c')];}_0x36cd51['status'](_0x5eafcb)['send'](_0x1bd878);};}exports[_0x0998('0x3d')]=function(_0x521d05,_0x54c18f){var _0x33da92={},_0x4ad2ab={},_0x258041={'count':0x0,'rows':[]};var _0x7356da=_[_0x0998('0x3e')](db[_0x0998('0x3f')][_0x0998('0x40')],function(_0x4bcc6e){return{'name':_0x4bcc6e['fieldName'],'type':_0x4bcc6e[_0x0998('0x41')][_0x0998('0x42')]};});_0x4ad2ab[_0x0998('0x43')]=_[_0x0998('0x3e')](_0x7356da,_0x0998('0x3c'));_0x4ad2ab[_0x0998('0x44')]=_[_0x0998('0x45')](_0x521d05['query']);_0x4ad2ab[_0x0998('0x46')]=_[_0x0998('0x47')](_0x4ad2ab[_0x0998('0x43')],_0x4ad2ab[_0x0998('0x44')]);_0x33da92['attributes']=_[_0x0998('0x47')](_0x4ad2ab[_0x0998('0x43')],qs[_0x0998('0x48')](_0x521d05['query']['fields']));_0x33da92[_0x0998('0x49')]=_0x33da92[_0x0998('0x49')]['length']?_0x33da92[_0x0998('0x49')]:_0x4ad2ab[_0x0998('0x43')];if(!_0x521d05[_0x0998('0x44')][_0x0998('0x4a')]('nolimit')){_0x33da92[_0x0998('0x34')]=qs[_0x0998('0x34')](_0x521d05[_0x0998('0x44')][_0x0998('0x34')]);_0x33da92[_0x0998('0x33')]=qs['offset'](_0x521d05[_0x0998('0x44')][_0x0998('0x33')]);}_0x33da92['order']=qs[_0x0998('0x4b')](_0x521d05['query'][_0x0998('0x4b')]);_0x33da92[_0x0998('0x4c')]=qs['filters'](_[_0x0998('0x4d')](_0x521d05[_0x0998('0x44')],_0x4ad2ab[_0x0998('0x46')]),_0x7356da);if(_0x521d05[_0x0998('0x44')][_0x0998('0x4e')]){_0x33da92[_0x0998('0x4c')]=_[_0x0998('0x4f')](_0x33da92[_0x0998('0x4c')],{'$or':_[_0x0998('0x3e')](_0x7356da,function(_0x213fe4){if(_0x213fe4[_0x0998('0x41')]!=='VIRTUAL'){var _0x1d382f={};_0x1d382f[_0x213fe4['name']]={'$like':'%'+_0x521d05[_0x0998('0x44')][_0x0998('0x4e')]+'%'};return _0x1d382f;}})});}_0x33da92=_[_0x0998('0x4f')]({},_0x33da92,_0x521d05[_0x0998('0x50')]);var _0x36569f={'where':_0x33da92[_0x0998('0x4c')]};return db[_0x0998('0x3f')][_0x0998('0x32')](_0x36569f)[_0x0998('0x22')](function(_0x55f2e6){_0x258041[_0x0998('0x32')]=_0x55f2e6;if(_0x521d05[_0x0998('0x44')][_0x0998('0x51')]){_0x33da92[_0x0998('0x52')]=[{'all':!![]}];}return db[_0x0998('0x3f')][_0x0998('0x53')](_0x33da92);})[_0x0998('0x22')](function(_0x1bef87){_0x258041[_0x0998('0x54')]=_0x1bef87;return _0x258041;})[_0x0998('0x22')](respondWithFilteredResult(_0x54c18f,_0x33da92))['catch'](handleError(_0x54c18f,null));};exports[_0x0998('0x55')]=function(_0x4bcacb,_0x14534d){var _0x146bbb={'raw':![],'where':{'id':_0x4bcacb[_0x0998('0x56')]['id']}},_0x199f0b={};_0x199f0b[_0x0998('0x43')]=_['keys'](db['ZendeskAccount'][_0x0998('0x40')]);_0x199f0b[_0x0998('0x44')]=_[_0x0998('0x45')](_0x4bcacb[_0x0998('0x44')]);_0x199f0b[_0x0998('0x46')]=_[_0x0998('0x47')](_0x199f0b[_0x0998('0x43')],_0x199f0b[_0x0998('0x44')]);_0x146bbb[_0x0998('0x49')]=_[_0x0998('0x47')](_0x199f0b['model'],qs[_0x0998('0x48')](_0x4bcacb[_0x0998('0x44')]['fields']));_0x146bbb[_0x0998('0x49')]=_0x146bbb[_0x0998('0x49')]['length']?_0x146bbb['attributes']:_0x199f0b[_0x0998('0x43')];if(_0x4bcacb['query'][_0x0998('0x51')]){_0x146bbb[_0x0998('0x52')]=[{'all':!![]}];}_0x146bbb=_[_0x0998('0x4f')]({},_0x146bbb,_0x4bcacb[_0x0998('0x50')]);return db['ZendeskAccount']['find'](_0x146bbb)[_0x0998('0x22')](handleEntityNotFound(_0x14534d,null))['then'](respondWithResult(_0x14534d,null))[_0x0998('0x2d')](handleError(_0x14534d,null));};exports[_0x0998('0x57')]=function(_0x3529cb,_0x13fe8d){return db[_0x0998('0x3f')][_0x0998('0x57')](_0x3529cb['body'],{})[_0x0998('0x22')](respondWithResult(_0x13fe8d,0xc9))[_0x0998('0x2d')](handleError(_0x13fe8d,null));};exports[_0x0998('0x39')]=function(_0xd6dc4e,_0x593dcf){if(_0xd6dc4e['body']['id']){delete _0xd6dc4e[_0x0998('0x58')]['id'];}return db[_0x0998('0x3f')]['find']({'where':{'id':_0xd6dc4e[_0x0998('0x56')]['id']}})[_0x0998('0x22')](handleEntityNotFound(_0x593dcf,null))[_0x0998('0x22')](saveUpdates(_0xd6dc4e['body'],null))[_0x0998('0x22')](respondWithResult(_0x593dcf,null))[_0x0998('0x2d')](handleError(_0x593dcf,null));};exports[_0x0998('0x3a')]=function(_0x283f67,_0x415e0c){return db['ZendeskAccount']['find']({'where':{'id':_0x283f67['params']['id']}})['then'](handleEntityNotFound(_0x415e0c,null))[_0x0998('0x22')](removeEntity(_0x415e0c,null))[_0x0998('0x2d')](handleError(_0x415e0c,null));};exports[_0x0998('0x59')]=function(_0x264504,_0x5071ea,_0x1a492e){var _0x5d6b49={};var _0x543e11={};var _0x59c5cf;var _0x240560;return db[_0x0998('0x3f')][_0x0998('0x5a')]({'where':{'id':_0x264504[_0x0998('0x56')]['id']}})[_0x0998('0x22')](handleEntityNotFound(_0x5071ea,null))[_0x0998('0x22')](function(_0x30deb8){if(_0x30deb8){_0x59c5cf=_0x30deb8;_0x543e11[_0x0998('0x43')]=_[_0x0998('0x45')](db[_0x0998('0x5b')]['rawAttributes']);_0x543e11['query']=_[_0x0998('0x45')](_0x264504['query']);_0x543e11[_0x0998('0x46')]=_[_0x0998('0x47')](_0x543e11[_0x0998('0x43')],_0x543e11['query']);_0x5d6b49[_0x0998('0x49')]=_[_0x0998('0x47')](_0x543e11[_0x0998('0x43')],qs[_0x0998('0x48')](_0x264504[_0x0998('0x44')][_0x0998('0x48')]));_0x5d6b49[_0x0998('0x49')]=_0x5d6b49[_0x0998('0x49')][_0x0998('0x5c')]?_0x5d6b49[_0x0998('0x49')]:_0x543e11[_0x0998('0x43')];_0x5d6b49[_0x0998('0x5d')]=qs[_0x0998('0x4b')](_0x264504['query'][_0x0998('0x4b')]);_0x5d6b49['where']=qs[_0x0998('0x46')](_[_0x0998('0x4d')](_0x264504[_0x0998('0x44')],_0x543e11[_0x0998('0x46')]));if(_0x264504[_0x0998('0x44')][_0x0998('0x4e')]){_0x5d6b49[_0x0998('0x4c')]=_[_0x0998('0x4f')](_0x5d6b49[_0x0998('0x4c')],{'$or':_[_0x0998('0x3e')](_0x5d6b49[_0x0998('0x49')],function(_0x7c6514){var _0x1dacc1={};_0x1dacc1[_0x7c6514]={'$like':'%'+_0x264504[_0x0998('0x44')][_0x0998('0x4e')]+'%'};return _0x1dacc1;})});}_0x5d6b49=_[_0x0998('0x4f')]({},_0x5d6b49,_0x264504[_0x0998('0x50')]);return _0x59c5cf['getConfigurations'](_0x5d6b49);}})[_0x0998('0x22')](function(_0x34161b){if(_0x34161b){_0x240560=_0x34161b[_0x0998('0x5c')];if(!_0x264504['query'][_0x0998('0x4a')]('nolimit')){_0x5d6b49[_0x0998('0x34')]=qs[_0x0998('0x34')](_0x264504['query'][_0x0998('0x34')]);_0x5d6b49['offset']=qs[_0x0998('0x33')](_0x264504[_0x0998('0x44')][_0x0998('0x33')]);}return _0x59c5cf[_0x0998('0x59')](_0x5d6b49);}})['then'](function(_0x1a9b3d){if(_0x1a9b3d){return _0x1a9b3d?{'count':_0x240560,'rows':_0x1a9b3d}:null;}})[_0x0998('0x22')](respondWithResult(_0x5071ea,null))['catch'](handleError(_0x5071ea,null));};exports[_0x0998('0x5e')]=function(_0x260568,_0x4a4e96,_0x16be39){if(_0x260568[_0x0998('0x58')]['id']){delete _0x260568[_0x0998('0x58')]['id'];}return db[_0x0998('0x3f')][_0x0998('0x5a')]({'where':{'id':_0x260568[_0x0998('0x56')]['id']}})[_0x0998('0x22')](handleEntityNotFound(_0x4a4e96,null))['then'](function(_0xc03230){if(_0xc03230){_0x260568[_0x0998('0x58')][_0x0998('0x5f')]=_0xc03230['id'];_0x260568[_0x0998('0x58')][_0x0998('0x60')]=integrations[_0x0998('0x61')](_0x260568['body'][_0x0998('0x62')],_0x260568[_0x0998('0x58')][_0x0998('0x41')]);_0x260568[_0x0998('0x58')][_0x0998('0x63')]=integrations[_0x0998('0x64')](_0x260568[_0x0998('0x58')][_0x0998('0x62')],_0x260568[_0x0998('0x58')][_0x0998('0x41')]);return db[_0x0998('0x5b')][_0x0998('0x57')](_0x260568[_0x0998('0x58')],{'include':[{'model':db['ZendeskField'],'as':_0x0998('0x60')},{'model':db[_0x0998('0x65')],'as':_0x0998('0x63')}]});}return null;})[_0x0998('0x22')](respondWithResult(_0x4a4e96,null))[_0x0998('0x2d')](handleError(_0x4a4e96,null));};exports[_0x0998('0x66')]=function(_0x2209c9,_0x352ba2,_0x1b8ab4){var _0x101896='';return db[_0x0998('0x3f')]['findOne']({'where':{'id':_0x2209c9[_0x0998('0x56')]['id']},'attributes':['id',_0x0998('0x67'),_0x0998('0x68'),_0x0998('0x69'),_0x0998('0x6a'),'remoteUri']})[_0x0998('0x22')](handleEntityNotFound(_0x352ba2,null))[_0x0998('0x22')](function(_0x165e09){if(_0x165e09){_0x101896=_0x165e09[_0x0998('0x6b')];var _0x3cc580=_0x101896[_0x0998('0x6c')](-0x1);if(_0x3cc580==='/'){_0x101896=_0x101896[_0x0998('0x6d')](0x0,_0x101896[_0x0998('0x6e')](_0x3cc580));}var _0x1a7ba2={'method':_0x0998('0x6f'),'uri':util[_0x0998('0x70')]('%s/%s',_0x101896,_0x0998('0x71')),'json':!![]};switch(_0x165e09[_0x0998('0x6a')]){case _0x0998('0x68'):_0x1a7ba2[_0x0998('0x72')]={'Authorization':util['format'](_0x0998('0x73'),new Buffer(util[_0x0998('0x70')](_0x0998('0x74'),_0x165e09['username'],_0x165e09[_0x0998('0x68')]))['toString']('base64'))};break;case _0x0998('0x69'):_0x1a7ba2[_0x0998('0x72')]={'Authorization':util['format'](_0x0998('0x73'),new Buffer(util[_0x0998('0x70')](_0x0998('0x75'),_0x165e09[_0x0998('0x67')],_0x165e09[_0x0998('0x69')]))[_0x0998('0x76')]('base64'))};break;default:throw new db['Sequelize']['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x1a7ba2);}})[_0x0998('0x22')](function(_0xc79830){if(_0xc79830){var _0x1a3638=[_0x0998('0x77'),_0x0998('0x78'),_0x0998('0x79'),_0x0998('0x7a')];_[_0x0998('0x7b')](_0xc79830[_0x0998('0x71')],function(_0x1bd98c){return _0x1a3638[_0x0998('0x7c')](_0x1bd98c[_0x0998('0x41')]);});return{'count':_0xc79830[_0x0998('0x71')]['length'],'rows':_['map'](_0xc79830[_0x0998('0x71')],function(_0x5c222a){return{'id':_0x5c222a['id'],'name':_0x5c222a[_0x0998('0x7d')]>0x7?_0x5c222a['title']:_0x5c222a[_0x0998('0x41')],'custom':_0x5c222a[_0x0998('0x7d')]>0x7?!![]:![],'options':_0x5c222a[_0x0998('0x7e')]?_0x5c222a[_0x0998('0x7e')]:_0x5c222a[_0x0998('0x7f')]?_0x5c222a['custom_field_options']:[]};})};}})[_0x0998('0x22')](respondWithResult(_0x352ba2,null))[_0x0998('0x2d')](function(_0x59a1a3){var _0x57ec23=_0x2209c9['query'][_0x0998('0x1e')]?0x1f4:_0x59a1a3[_0x0998('0x80')]||0x1f4;logger['error'](_0x0998('0x81'),_0x0998('0x66'),_0x57ec23,JSON[_0x0998('0x27')](_0x59a1a3));delete _0x59a1a3[_0x0998('0x3c')];if(_0x57ec23===0x191){_0x57ec23=0x190;}_0x352ba2['status'](_0x57ec23)[_0x0998('0x82')](_0x2209c9[_0x0998('0x44')][_0x0998('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x59a1a3['statusCode']}:_0x59a1a3);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 29fa807..0590430 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 _0x3a69=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash'];(function(_0x2576c1,_0x49c89b){var _0x4e69e5=function(_0x3c253c){while(--_0x3c253c){_0x2576c1['push'](_0x2576c1['shift']());}};_0x4e69e5(++_0x49c89b);}(_0x3a69,0x110));var _0x93a6=function(_0x20cdd2,_0x24da9b){_0x20cdd2=_0x20cdd2-0x0;var _0x8bd09e=_0x3a69[_0x20cdd2];return _0x8bd09e;};'use strict';var _=require(_0x93a6('0x0'));var util=require(_0x93a6('0x1'));var logger=require(_0x93a6('0x2'))(_0x93a6('0x3'));var moment=require(_0x93a6('0x4'));var BPromise=require(_0x93a6('0x5'));var rp=require(_0x93a6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93a6('0x7'));var config=require('../../config/environment');var attributes=require(_0x93a6('0x8'));var integrations=require(_0x93a6('0x9'));module[_0x93a6('0xa')]=function(_0x4d4dda,_0x4dcbd9){return _0x4d4dda[_0x93a6('0xb')]('ZendeskAccount',attributes,{'tableName':_0x93a6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x424f=['request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1b1754,_0x1cc242){var _0x5ce5ab=function(_0x1b38d5){while(--_0x1b38d5){_0x1b1754['push'](_0x1b1754['shift']());}};_0x5ce5ab(++_0x1cc242);}(_0x424f,0x103));var _0xf424=function(_0x582466,_0x5df8bf){_0x582466=_0x582466-0x0;var _0x495b37=_0x424f[_0x582466];return _0x495b37;};'use strict';var _=require(_0xf424('0x0'));var util=require('util');var logger=require(_0xf424('0x1'))(_0xf424('0x2'));var moment=require(_0xf424('0x3'));var BPromise=require(_0xf424('0x4'));var rp=require(_0xf424('0x5'));var fs=require('fs');var path=require(_0xf424('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf424('0x7'));var integrations=require(_0xf424('0x8'));module[_0xf424('0x9')]=function(_0x222be6,_0x86ff37){return _0x222be6['define'](_0xf424('0xa'),attributes,{'tableName':_0xf424('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 4ee9613..937d000 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(_0x245545,_0x4983b3){var _0x106a5f=function(_0x278277){while(--_0x278277){_0x245545['push'](_0x245545['shift']());}};_0x106a5f(++_0x4983b3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 _0xb7e7=['request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x36b559,_0x5a3347){var _0x433afa=function(_0x5e4beb){while(--_0x5e4beb){_0x36b559['push'](_0x36b559['shift']());}};_0x433afa(++_0x5a3347);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xb7e7[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetZendeskAccount',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['ZendeskAccount'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowZendeskAccount',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index b6982ea..c94729c 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 _0xe018=['/:id/tags','getTags','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','/:id/descriptions'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xe018,0x1e4));var _0x8e01=function(_0x4d2e69,_0x445a1a){_0x4d2e69=_0x4d2e69-0x0;var _0x5562ae=_0xe018[_0x4d2e69];return _0x5562ae;};'use strict';var multer=require('multer');var util=require(_0x8e01('0x0'));var path=require(_0x8e01('0x1'));var timeout=require(_0x8e01('0x2'));var express=require(_0x8e01('0x3'));var router=express[_0x8e01('0x4')]();var auth=require(_0x8e01('0x5'));var interaction=require(_0x8e01('0x6'));var config=require(_0x8e01('0x7'));var controller=require(_0x8e01('0x8'));router[_0x8e01('0x9')]('/',auth[_0x8e01('0xa')](),controller['index']);router[_0x8e01('0x9')](_0x8e01('0xb'),auth[_0x8e01('0xa')](),controller[_0x8e01('0xc')]);router[_0x8e01('0x9')](_0x8e01('0xd'),auth[_0x8e01('0xa')](),controller['getFields']);router[_0x8e01('0x9')]('/:id/subjects',auth[_0x8e01('0xa')](),controller[_0x8e01('0xe')]);router[_0x8e01('0x9')](_0x8e01('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x8e01('0x9')](_0x8e01('0x10'),auth[_0x8e01('0xa')](),controller[_0x8e01('0x11')]);router[_0x8e01('0x12')]('/',auth[_0x8e01('0xa')](),controller[_0x8e01('0x13')]);router[_0x8e01('0x12')]('/:id/tags',auth[_0x8e01('0xa')](),controller['setTags']);router[_0x8e01('0x14')](_0x8e01('0xb'),auth[_0x8e01('0xa')](),controller[_0x8e01('0x15')]);router[_0x8e01('0x16')]('/:id',auth[_0x8e01('0xa')](),controller[_0x8e01('0x17')]);module[_0x8e01('0x18')]=router; \ No newline at end of file +var _0xf113=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','setTags','put','update','destroy','multer'];(function(_0x1f239e,_0x367b43){var _0x826971=function(_0x2c5777){while(--_0x2c5777){_0x1f239e['push'](_0x1f239e['shift']());}};_0x826971(++_0x367b43);}(_0xf113,0x12b));var _0x3f11=function(_0x43a69e,_0x2a677f){_0x43a69e=_0x43a69e-0x0;var _0x34e327=_0xf113[_0x43a69e];return _0x34e327;};'use strict';var multer=require(_0x3f11('0x0'));var util=require(_0x3f11('0x1'));var path=require('path');var timeout=require(_0x3f11('0x2'));var express=require(_0x3f11('0x3'));var router=express[_0x3f11('0x4')]();var auth=require(_0x3f11('0x5'));var interaction=require(_0x3f11('0x6'));var config=require(_0x3f11('0x7'));var controller=require(_0x3f11('0x8'));router['get']('/',auth[_0x3f11('0x9')](),controller[_0x3f11('0xa')]);router[_0x3f11('0xb')](_0x3f11('0xc'),auth[_0x3f11('0x9')](),controller[_0x3f11('0xd')]);router[_0x3f11('0xb')](_0x3f11('0xe'),auth[_0x3f11('0x9')](),controller[_0x3f11('0xf')]);router[_0x3f11('0xb')]('/:id/subjects',auth[_0x3f11('0x9')](),controller[_0x3f11('0x10')]);router[_0x3f11('0xb')](_0x3f11('0x11'),auth[_0x3f11('0x9')](),controller[_0x3f11('0x12')]);router[_0x3f11('0xb')](_0x3f11('0x13'),auth['isAuthenticated'](),controller['getTags']);router[_0x3f11('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3f11('0x14')](_0x3f11('0x13'),auth[_0x3f11('0x9')](),controller[_0x3f11('0x15')]);router[_0x3f11('0x16')](_0x3f11('0xc'),auth[_0x3f11('0x9')](),controller[_0x3f11('0x17')]);router['delete'](_0x3f11('0xc'),auth[_0x3f11('0x9')](),controller[_0x3f11('0x18')]);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 6fd1ac8..7911e27 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 _0xb548=['exports','STRING'];(function(_0x526f1f,_0x4e49d8){var _0x399828=function(_0x42b329){while(--_0x42b329){_0x526f1f['push'](_0x526f1f['shift']());}};_0x399828(++_0x4e49d8);}(_0xb548,0x1e8));var _0x8b54=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xb548[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require('sequelize');module[_0x8b54('0x0')]={'name':{'type':Sequelize[_0x8b54('0x1')]},'description':{'type':Sequelize[_0x8b54('0x1')]}}; \ No newline at end of file +var _0x742b=['STRING'];(function(_0x33347a,_0x1ed1dd){var _0x23d9b1=function(_0x5d6c98){while(--_0x5d6c98){_0x33347a['push'](_0x33347a['shift']());}};_0x23d9b1(++_0x1ed1dd);}(_0x742b,0x1c9));var _0xb742=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x742b[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb742('0x0')]},'description':{'type':Sequelize[_0xb742('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 90d06cb..64e3773 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 _0xf96c=['length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','ZendeskConfiguration','create','body','find','getFields','findOne','ZendeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','info','catch','sendStatus','status','end','json','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xf96c,0x140));var _0xcf96=function(_0x84445b,_0x4ab3ad){_0x84445b=_0x84445b-0x0;var _0x46d165=_0xf96c[_0x84445b];return _0x46d165;};'use strict';var pdf=require(_0xcf96('0x0'));var emlformat=require(_0xcf96('0x1'));var rimraf=require(_0xcf96('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcf96('0x3'));var rp=require(_0xcf96('0x4'));var moment=require(_0xcf96('0x5'));var BPromise=require(_0xcf96('0x6'));var Mustache=require(_0xcf96('0x7'));var util=require(_0xcf96('0x8'));var path=require(_0xcf96('0x9'));var sox=require(_0xcf96('0xa'));var csv=require(_0xcf96('0xb'));var ejs=require(_0xcf96('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcf96('0xd'));var jsforce=require(_0xcf96('0xe'));var deskjs=require(_0xcf96('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf96('0x10'));var Papa=require(_0xcf96('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf96('0x12'));var as=require(_0xcf96('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcf96('0x14'))(_0xcf96('0x15'));var utils=require(_0xcf96('0x16'));var config=require('../../config/environment');var db=require(_0xcf96('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xcf96('0x18')]({'port':0x232a});function checkPasswordPattern(_0x227695,_0x50f044,_0x490614){if(_0x490614){var _0x12cc3c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12cc3c['test'](_0x50f044)){return _0x227695;}else{throw new db[(_0xcf96('0x19'))][(_0xcf96('0x1a'))](_0xcf96('0x1b'));}}else{return _0x227695;}}function respondWithRpcPromise(_0x29b2cf,_0x5582d0,_0x294525,_0x1ade07){return new BPromise(function(_0x277510,_0x57fd07){var _0x251d75=_0x1ade07||client;return _0x251d75['request'](_0x29b2cf,_0x294525)[_0xcf96('0x1c')](function(_0x5689ed){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x5582d0,_0xcf96('0x1d'));logger[_0xcf96('0x1e')](_0xcf96('0x1f'),_0x5582d0,_0xcf96('0x1d'),JSON['stringify'](_0x5689ed));if(_0x5689ed[_0xcf96('0x20')]){if(_0x5689ed[_0xcf96('0x20')][_0xcf96('0x21')]===0x1f4){logger[_0xcf96('0x20')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5582d0,_0x5689ed[_0xcf96('0x20')][_0xcf96('0x22')]);return _0x57fd07(_0x5689ed[_0xcf96('0x20')][_0xcf96('0x22')]);}logger[_0xcf96('0x20')](_0xcf96('0x23'),_0x5582d0,_0x5689ed['error'][_0xcf96('0x22')]);return _0x277510(_0x5689ed[_0xcf96('0x20')][_0xcf96('0x22')]);}else{logger[_0xcf96('0x24')](_0xcf96('0x23'),_0x5582d0,_0xcf96('0x1d'));_0x277510(_0x5689ed['result'][_0xcf96('0x22')]);}})[_0xcf96('0x25')](function(_0x305fa8){logger[_0xcf96('0x20')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5582d0,_0x305fa8);_0x57fd07(_0x305fa8);});});}function respondWithStatusCode(_0x4cf823,_0x1daf0a){_0x1daf0a=_0x1daf0a||0xcc;return function(_0x59c6ba){if(_0x59c6ba){return _0x4cf823[_0xcf96('0x26')](_0x1daf0a);}return _0x4cf823[_0xcf96('0x27')](_0x1daf0a)[_0xcf96('0x28')]();};}function respondWithResult(_0x1cc38a,_0xe44d25){_0xe44d25=_0xe44d25||0xc8;return function(_0x31c14b){if(_0x31c14b){return _0x1cc38a[_0xcf96('0x27')](_0xe44d25)[_0xcf96('0x29')](_0x31c14b);}};}function respondWithFilteredResult(_0x2a614a,_0x3eee65){return function(_0x225351){if(_0x225351){var _0x162d56=_0x225351[_0xcf96('0x2a')],_0x39ccf3=_0x3eee65['offset'],_0x585ddf=_0x3eee65['offset']+_0x3eee65['limit'],_0xac76b7;if(_0x585ddf>=_0x162d56){_0x585ddf=_0x162d56;_0xac76b7=0xc8;}else{_0xac76b7=0xce;}_0x2a614a[_0xcf96('0x27')](_0xac76b7);return _0x2a614a['set'](_0xcf96('0x2b'),_0x39ccf3+'-'+_0x585ddf+'/'+_0x162d56)[_0xcf96('0x29')](_0x225351);}return null;};}function patchUpdates(_0x4c563a){return function(_0x577841){try{jsonpatch[_0xcf96('0x2c')](_0x577841,_0x4c563a,!![]);}catch(_0x55c1e9){return BPromise[_0xcf96('0x2d')](_0x55c1e9);}return _0x577841[_0xcf96('0x2e')]();};}function saveUpdates(_0x3cc0d1,_0x2d335a){return function(_0x3c5ce9){if(_0x3c5ce9){return _0x3c5ce9[_0xcf96('0x2f')](_0x3cc0d1)['then'](function(_0x25f076){return _0x25f076;});}return null;};}function removeEntity(_0xa8c8d,_0x5006da){return function(_0x5ce67f){if(_0x5ce67f){return _0x5ce67f[_0xcf96('0x30')]()[_0xcf96('0x1c')](function(){_0xa8c8d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14712d,_0x264f82){return function(_0x3e724c){if(!_0x3e724c){_0x14712d[_0xcf96('0x26')](0x194);}return _0x3e724c;};}function handleError(_0xf103ce,_0x5a3f77){_0x5a3f77=_0x5a3f77||0x1f4;return function(_0x87ec75){logger['error'](_0x87ec75[_0xcf96('0x31')]);if(_0x87ec75['name']){delete _0x87ec75[_0xcf96('0x32')];}_0xf103ce['status'](_0x5a3f77)[_0xcf96('0x33')](_0x87ec75);};}exports[_0xcf96('0x34')]=function(_0x25b8b9,_0x288e2f){var _0x4580b9={},_0x43edb0={},_0x559b3d={'count':0x0,'rows':[]};var _0xdf0f67=_[_0xcf96('0x35')](db['ZendeskConfiguration'][_0xcf96('0x36')],function(_0x24ac51){return{'name':_0x24ac51[_0xcf96('0x37')],'type':_0x24ac51[_0xcf96('0x38')][_0xcf96('0x39')]};});_0x43edb0[_0xcf96('0x3a')]=_[_0xcf96('0x35')](_0xdf0f67,_0xcf96('0x32'));_0x43edb0[_0xcf96('0x3b')]=_['keys'](_0x25b8b9['query']);_0x43edb0[_0xcf96('0x3c')]=_['intersection'](_0x43edb0[_0xcf96('0x3a')],_0x43edb0[_0xcf96('0x3b')]);_0x4580b9['attributes']=_[_0xcf96('0x3d')](_0x43edb0['model'],qs[_0xcf96('0x3e')](_0x25b8b9[_0xcf96('0x3b')]['fields']));_0x4580b9[_0xcf96('0x3f')]=_0x4580b9[_0xcf96('0x3f')][_0xcf96('0x40')]?_0x4580b9['attributes']:_0x43edb0[_0xcf96('0x3a')];if(!_0x25b8b9[_0xcf96('0x3b')][_0xcf96('0x41')](_0xcf96('0x42'))){_0x4580b9['limit']=qs[_0xcf96('0x43')](_0x25b8b9[_0xcf96('0x3b')][_0xcf96('0x43')]);_0x4580b9[_0xcf96('0x44')]=qs['offset'](_0x25b8b9[_0xcf96('0x3b')]['offset']);}_0x4580b9[_0xcf96('0x45')]=qs[_0xcf96('0x46')](_0x25b8b9['query'][_0xcf96('0x46')]);_0x4580b9[_0xcf96('0x47')]=qs['filters'](_['pick'](_0x25b8b9[_0xcf96('0x3b')],_0x43edb0['filters']),_0xdf0f67);if(_0x25b8b9[_0xcf96('0x3b')][_0xcf96('0x48')]){_0x4580b9['where']=_['merge'](_0x4580b9[_0xcf96('0x47')],{'$or':_[_0xcf96('0x35')](_0xdf0f67,function(_0x44363a){if(_0x44363a['type']!==_0xcf96('0x49')){var _0x46ef51={};_0x46ef51[_0x44363a[_0xcf96('0x32')]]={'$like':'%'+_0x25b8b9[_0xcf96('0x3b')][_0xcf96('0x48')]+'%'};return _0x46ef51;}})});}_0x4580b9=_[_0xcf96('0x4a')]({},_0x4580b9,_0x25b8b9[_0xcf96('0x4b')]);var _0x1b5882={'where':_0x4580b9['where']};return db['ZendeskConfiguration'][_0xcf96('0x2a')](_0x1b5882)[_0xcf96('0x1c')](function(_0x276ae3){_0x559b3d[_0xcf96('0x2a')]=_0x276ae3;if(_0x25b8b9['query'][_0xcf96('0x4c')]){_0x4580b9[_0xcf96('0x4d')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xcf96('0x4e')](_0x4580b9);})[_0xcf96('0x1c')](function(_0xb45af7){_0x559b3d['rows']=_0xb45af7;return _0x559b3d;})[_0xcf96('0x1c')](respondWithFilteredResult(_0x288e2f,_0x4580b9))[_0xcf96('0x25')](handleError(_0x288e2f,null));};exports[_0xcf96('0x4f')]=function(_0x436ed0,_0x19a89b){var _0x11dfec={'raw':![],'where':{'id':_0x436ed0[_0xcf96('0x50')]['id']}},_0x146cd3={};_0x146cd3[_0xcf96('0x3a')]=_[_0xcf96('0x51')](db[_0xcf96('0x52')][_0xcf96('0x36')]);_0x146cd3[_0xcf96('0x3b')]=_[_0xcf96('0x51')](_0x436ed0[_0xcf96('0x3b')]);_0x146cd3['filters']=_[_0xcf96('0x3d')](_0x146cd3[_0xcf96('0x3a')],_0x146cd3[_0xcf96('0x3b')]);_0x11dfec[_0xcf96('0x3f')]=_['intersection'](_0x146cd3[_0xcf96('0x3a')],qs[_0xcf96('0x3e')](_0x436ed0['query'][_0xcf96('0x3e')]));_0x11dfec[_0xcf96('0x3f')]=_0x11dfec[_0xcf96('0x3f')]['length']?_0x11dfec[_0xcf96('0x3f')]:_0x146cd3[_0xcf96('0x3a')];if(_0x436ed0[_0xcf96('0x3b')][_0xcf96('0x4c')]){_0x11dfec[_0xcf96('0x4d')]=[{'all':!![]}];}_0x11dfec=_[_0xcf96('0x4a')]({},_0x11dfec,_0x436ed0[_0xcf96('0x4b')]);return db[_0xcf96('0x52')]['find'](_0x11dfec)[_0xcf96('0x1c')](handleEntityNotFound(_0x19a89b,null))['then'](respondWithResult(_0x19a89b,null))[_0xcf96('0x25')](handleError(_0x19a89b,null));};exports[_0xcf96('0x53')]=function(_0x3af6e2,_0x2e5c72){return db[_0xcf96('0x52')]['create'](_0x3af6e2[_0xcf96('0x54')],{})[_0xcf96('0x1c')](respondWithResult(_0x2e5c72,0xc9))[_0xcf96('0x25')](handleError(_0x2e5c72,null));};exports[_0xcf96('0x2f')]=function(_0x1f3188,_0xdc46c){if(_0x1f3188[_0xcf96('0x54')]['id']){delete _0x1f3188[_0xcf96('0x54')]['id'];}return db['ZendeskConfiguration'][_0xcf96('0x55')]({'where':{'id':_0x1f3188['params']['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0xdc46c,null))[_0xcf96('0x1c')](saveUpdates(_0x1f3188[_0xcf96('0x54')],null))[_0xcf96('0x1c')](respondWithResult(_0xdc46c,null))[_0xcf96('0x25')](handleError(_0xdc46c,null));};exports[_0xcf96('0x30')]=function(_0x38aeb9,_0x327680){return db[_0xcf96('0x52')][_0xcf96('0x55')]({'where':{'id':_0x38aeb9[_0xcf96('0x50')]['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0x327680,null))[_0xcf96('0x1c')](removeEntity(_0x327680,null))[_0xcf96('0x25')](handleError(_0x327680,null));};exports[_0xcf96('0x56')]=function(_0x4c4305,_0x4b1930,_0x55bc39){var _0x4b1edc={};var _0x233d21={};var _0x508fb3;var _0x5eccf7;return db[_0xcf96('0x52')][_0xcf96('0x57')]({'where':{'id':_0x4c4305[_0xcf96('0x50')]['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0x4b1930,null))[_0xcf96('0x1c')](function(_0x38f885){if(_0x38f885){_0x508fb3=_0x38f885;_0x233d21['model']=_[_0xcf96('0x51')](db[_0xcf96('0x58')][_0xcf96('0x36')]);_0x233d21[_0xcf96('0x3b')]=_[_0xcf96('0x51')](_0x4c4305[_0xcf96('0x3b')]);_0x233d21[_0xcf96('0x3c')]=_['intersection'](_0x233d21['model'],_0x233d21['query']);_0x4b1edc[_0xcf96('0x3f')]=_[_0xcf96('0x3d')](_0x233d21[_0xcf96('0x3a')],qs[_0xcf96('0x3e')](_0x4c4305[_0xcf96('0x3b')][_0xcf96('0x3e')]));_0x4b1edc[_0xcf96('0x3f')]=_0x4b1edc[_0xcf96('0x3f')][_0xcf96('0x40')]?_0x4b1edc[_0xcf96('0x3f')]:_0x233d21['model'];_0x4b1edc[_0xcf96('0x45')]=qs[_0xcf96('0x46')](_0x4c4305[_0xcf96('0x3b')]['sort']);_0x4b1edc[_0xcf96('0x47')]=qs[_0xcf96('0x3c')](_[_0xcf96('0x59')](_0x4c4305[_0xcf96('0x3b')],_0x233d21[_0xcf96('0x3c')]));if(_0x4c4305[_0xcf96('0x3b')]['filter']){_0x4b1edc[_0xcf96('0x47')]=_[_0xcf96('0x4a')](_0x4b1edc[_0xcf96('0x47')],{'$or':_['map'](_0x4b1edc['attributes'],function(_0x24a518){var _0x1ae0f0={};_0x1ae0f0[_0x24a518]={'$like':'%'+_0x4c4305[_0xcf96('0x3b')][_0xcf96('0x48')]+'%'};return _0x1ae0f0;})});}_0x4b1edc=_[_0xcf96('0x4a')]({},_0x4b1edc,_0x4c4305[_0xcf96('0x4b')]);return _0x508fb3['getFields'](_0x4b1edc);}})[_0xcf96('0x1c')](function(_0x475ac6){if(_0x475ac6){_0x5eccf7=_0x475ac6[_0xcf96('0x40')];if(!_0x4c4305['query']['hasOwnProperty'](_0xcf96('0x42'))){_0x4b1edc['limit']=qs['limit'](_0x4c4305['query'][_0xcf96('0x43')]);_0x4b1edc['offset']=qs['offset'](_0x4c4305[_0xcf96('0x3b')]['offset']);}return _0x508fb3[_0xcf96('0x56')](_0x4b1edc);}})[_0xcf96('0x1c')](function(_0x51ff26){if(_0x51ff26){return _0x51ff26?{'count':_0x5eccf7,'rows':_0x51ff26}:null;}})[_0xcf96('0x1c')](respondWithResult(_0x4b1930,null))[_0xcf96('0x25')](handleError(_0x4b1930,null));};exports['getSubjects']=function(_0x48c29d,_0x47525d,_0x1b68d0){var _0x1646f4={};var _0x8124ca={};var _0x34ce3b;var _0x2965a7;return db[_0xcf96('0x52')][_0xcf96('0x57')]({'where':{'id':_0x48c29d[_0xcf96('0x50')]['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0x47525d,null))[_0xcf96('0x1c')](function(_0x2e551f){if(_0x2e551f){_0x34ce3b=_0x2e551f;_0x8124ca[_0xcf96('0x3a')]=_[_0xcf96('0x51')](db[_0xcf96('0x58')][_0xcf96('0x36')]);_0x8124ca[_0xcf96('0x3b')]=_['keys'](_0x48c29d[_0xcf96('0x3b')]);_0x8124ca[_0xcf96('0x3c')]=_[_0xcf96('0x3d')](_0x8124ca[_0xcf96('0x3a')],_0x8124ca[_0xcf96('0x3b')]);_0x1646f4[_0xcf96('0x3f')]=_[_0xcf96('0x3d')](_0x8124ca[_0xcf96('0x3a')],qs[_0xcf96('0x3e')](_0x48c29d['query'][_0xcf96('0x3e')]));_0x1646f4[_0xcf96('0x3f')]=_0x1646f4['attributes'][_0xcf96('0x40')]?_0x1646f4['attributes']:_0x8124ca['model'];_0x1646f4[_0xcf96('0x45')]=qs[_0xcf96('0x46')](_0x48c29d['query'][_0xcf96('0x46')]);_0x1646f4['where']=qs['filters'](_[_0xcf96('0x59')](_0x48c29d[_0xcf96('0x3b')],_0x8124ca['filters']));if(_0x48c29d[_0xcf96('0x3b')][_0xcf96('0x48')]){_0x1646f4[_0xcf96('0x47')]=_['merge'](_0x1646f4['where'],{'$or':_[_0xcf96('0x35')](_0x1646f4[_0xcf96('0x3f')],function(_0x431f7d){var _0x7d9151={};_0x7d9151[_0x431f7d]={'$like':'%'+_0x48c29d[_0xcf96('0x3b')]['filter']+'%'};return _0x7d9151;})});}_0x1646f4=_[_0xcf96('0x4a')]({},_0x1646f4,_0x48c29d[_0xcf96('0x4b')]);return _0x34ce3b['getSubjects'](_0x1646f4);}})[_0xcf96('0x1c')](function(_0x5bde7f){if(_0x5bde7f){_0x2965a7=_0x5bde7f['length'];if(!_0x48c29d['query'][_0xcf96('0x41')](_0xcf96('0x42'))){_0x1646f4[_0xcf96('0x43')]=qs['limit'](_0x48c29d[_0xcf96('0x3b')][_0xcf96('0x43')]);_0x1646f4[_0xcf96('0x44')]=qs['offset'](_0x48c29d[_0xcf96('0x3b')][_0xcf96('0x44')]);}return _0x34ce3b[_0xcf96('0x5a')](_0x1646f4);}})[_0xcf96('0x1c')](function(_0x381eea){if(_0x381eea){return _0x381eea?{'count':_0x2965a7,'rows':_0x381eea}:null;}})[_0xcf96('0x1c')](respondWithResult(_0x47525d,null))[_0xcf96('0x25')](handleError(_0x47525d,null));};exports['getDescriptions']=function(_0x39b6c2,_0x56e5f6,_0x26a4bd){var _0x42df6c={};var _0x3a1b61={};var _0x182dcd;var _0x5af11f;return db[_0xcf96('0x52')][_0xcf96('0x57')]({'where':{'id':_0x39b6c2['params']['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0x56e5f6,null))[_0xcf96('0x1c')](function(_0x8b276f){if(_0x8b276f){_0x182dcd=_0x8b276f;_0x3a1b61['model']=_['keys'](db['ZendeskField']['rawAttributes']);_0x3a1b61[_0xcf96('0x3b')]=_[_0xcf96('0x51')](_0x39b6c2['query']);_0x3a1b61[_0xcf96('0x3c')]=_[_0xcf96('0x3d')](_0x3a1b61[_0xcf96('0x3a')],_0x3a1b61[_0xcf96('0x3b')]);_0x42df6c[_0xcf96('0x3f')]=_[_0xcf96('0x3d')](_0x3a1b61[_0xcf96('0x3a')],qs['fields'](_0x39b6c2[_0xcf96('0x3b')][_0xcf96('0x3e')]));_0x42df6c[_0xcf96('0x3f')]=_0x42df6c['attributes'][_0xcf96('0x40')]?_0x42df6c['attributes']:_0x3a1b61[_0xcf96('0x3a')];_0x42df6c[_0xcf96('0x45')]=qs[_0xcf96('0x46')](_0x39b6c2[_0xcf96('0x3b')]['sort']);_0x42df6c[_0xcf96('0x47')]=qs[_0xcf96('0x3c')](_[_0xcf96('0x59')](_0x39b6c2[_0xcf96('0x3b')],_0x3a1b61[_0xcf96('0x3c')]));if(_0x39b6c2[_0xcf96('0x3b')][_0xcf96('0x48')]){_0x42df6c['where']=_[_0xcf96('0x4a')](_0x42df6c['where'],{'$or':_[_0xcf96('0x35')](_0x42df6c[_0xcf96('0x3f')],function(_0x21a890){var _0x5ae9f6={};_0x5ae9f6[_0x21a890]={'$like':'%'+_0x39b6c2[_0xcf96('0x3b')][_0xcf96('0x48')]+'%'};return _0x5ae9f6;})});}_0x42df6c=_[_0xcf96('0x4a')]({},_0x42df6c,_0x39b6c2[_0xcf96('0x4b')]);return _0x182dcd[_0xcf96('0x5b')](_0x42df6c);}})[_0xcf96('0x1c')](function(_0x54126c){if(_0x54126c){_0x5af11f=_0x54126c[_0xcf96('0x40')];if(!_0x39b6c2[_0xcf96('0x3b')]['hasOwnProperty'](_0xcf96('0x42'))){_0x42df6c[_0xcf96('0x43')]=qs[_0xcf96('0x43')](_0x39b6c2[_0xcf96('0x3b')][_0xcf96('0x43')]);_0x42df6c[_0xcf96('0x44')]=qs[_0xcf96('0x44')](_0x39b6c2[_0xcf96('0x3b')][_0xcf96('0x44')]);}return _0x182dcd[_0xcf96('0x5b')](_0x42df6c);}})[_0xcf96('0x1c')](function(_0x5954b8){if(_0x5954b8){return _0x5954b8?{'count':_0x5af11f,'rows':_0x5954b8}:null;}})[_0xcf96('0x1c')](respondWithResult(_0x56e5f6,null))['catch'](handleError(_0x56e5f6,null));};exports[_0xcf96('0x5c')]=function(_0x1ec02e,_0x2004b3,_0x27f975){var _0x33742d={};var _0x14b347={};var _0x28efde;var _0x4acd81;return db['ZendeskConfiguration'][_0xcf96('0x57')]({'where':{'id':_0x1ec02e[_0xcf96('0x50')]['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0x2004b3,null))[_0xcf96('0x1c')](function(_0x1e054f){if(_0x1e054f){_0x28efde=_0x1e054f;_0x14b347[_0xcf96('0x3a')]=_[_0xcf96('0x51')](db[_0xcf96('0x5d')][_0xcf96('0x36')]);_0x14b347[_0xcf96('0x3b')]=_[_0xcf96('0x51')](_0x1ec02e['query']);_0x14b347[_0xcf96('0x3c')]=_['intersection'](_0x14b347[_0xcf96('0x3a')],_0x14b347['query']);_0x33742d[_0xcf96('0x3f')]=_[_0xcf96('0x3d')](_0x14b347[_0xcf96('0x3a')],qs[_0xcf96('0x3e')](_0x1ec02e[_0xcf96('0x3b')][_0xcf96('0x3e')]));_0x33742d[_0xcf96('0x3f')]=_0x33742d['attributes'][_0xcf96('0x40')]?_0x33742d[_0xcf96('0x3f')]:_0x14b347[_0xcf96('0x3a')];_0x33742d[_0xcf96('0x45')]=qs['sort'](_0x1ec02e[_0xcf96('0x3b')][_0xcf96('0x46')]);_0x33742d[_0xcf96('0x47')]=qs[_0xcf96('0x3c')](_[_0xcf96('0x59')](_0x1ec02e[_0xcf96('0x3b')],_0x14b347[_0xcf96('0x3c')]));if(_0x1ec02e['query']['filter']){_0x33742d[_0xcf96('0x47')]=_[_0xcf96('0x4a')](_0x33742d[_0xcf96('0x47')],{'$or':_[_0xcf96('0x35')](_0x33742d['attributes'],function(_0x35e538){var _0xddbe7={};_0xddbe7[_0x35e538]={'$like':'%'+_0x1ec02e['query']['filter']+'%'};return _0xddbe7;})});}_0x33742d=_[_0xcf96('0x4a')]({},_0x33742d,_0x1ec02e[_0xcf96('0x4b')]);return _0x28efde[_0xcf96('0x5c')](_0x33742d);}})[_0xcf96('0x1c')](function(_0x26d45b){if(_0x26d45b){_0x4acd81=_0x26d45b[_0xcf96('0x40')];if(!_0x1ec02e[_0xcf96('0x3b')]['hasOwnProperty']('nolimit')){_0x33742d['limit']=qs[_0xcf96('0x43')](_0x1ec02e[_0xcf96('0x3b')][_0xcf96('0x43')]);_0x33742d[_0xcf96('0x44')]=qs[_0xcf96('0x44')](_0x1ec02e[_0xcf96('0x3b')][_0xcf96('0x44')]);}return _0x28efde[_0xcf96('0x5c')](_0x33742d);}})['then'](function(_0x3b1446){if(_0x3b1446){return _0x3b1446?{'count':_0x4acd81,'rows':_0x3b1446}:null;}})[_0xcf96('0x1c')](respondWithResult(_0x2004b3,null))[_0xcf96('0x25')](handleError(_0x2004b3,null));};exports[_0xcf96('0x5e')]=function(_0xa49029,_0x8876c8,_0x1d1c95){if(_0xa49029[_0xcf96('0x54')]['id']){delete _0xa49029[_0xcf96('0x54')]['id'];}return db[_0xcf96('0x52')][_0xcf96('0x57')]({'where':{'id':_0xa49029['params']['id']}})[_0xcf96('0x1c')](handleEntityNotFound(_0x8876c8,null))[_0xcf96('0x1c')](function(_0xf44e22){if(_0xf44e22){return _0xf44e22[_0xcf96('0x5e')](_0xa49029[_0xcf96('0x54')][_0xcf96('0x5f')]||[]);}return null;})[_0xcf96('0x1c')](respondWithResult(_0x8876c8,null))['catch'](handleError(_0x8876c8,null));}; \ No newline at end of file +var _0x48e0=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','create','body','find','params','getFields','ZendeskField','getSubjects','findOne','getDescriptions','getTags','setTags','ids','html-pdf','zip-dir','moment','util','path','sox','to-csv','crypto','desk.js','papaparse'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x48e0,0xa8));var _0x048e=function(_0x248811,_0xc05bc9){_0x248811=_0x248811-0x0;var _0x5aff06=_0x48e0[_0x248811];return _0x5aff06;};'use strict';var pdf=require(_0x048e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x048e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x048e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x048e('0x3'));var path=require(_0x048e('0x4'));var sox=require(_0x048e('0x5'));var csv=require(_0x048e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x048e('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x048e('0x8'));var toCsv=require(_0x048e('0x6'));var querystring=require('querystring');var Papa=require(_0x048e('0x9'));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(_0x048e('0xa'))('api');var utils=require(_0x048e('0xb'));var config=require(_0x048e('0xc'));var db=require(_0x048e('0xd'))['db'];var jayson=require(_0x048e('0xe'));var client=jayson[_0x048e('0xf')][_0x048e('0x10')]({'port':0x232a});function checkPasswordPattern(_0x5e04c6,_0x3cffad,_0xd1d4ee){if(_0xd1d4ee){var _0x2edbdc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2edbdc[_0x048e('0x11')](_0x3cffad)){return _0x5e04c6;}else{throw new db[(_0x048e('0x12'))][(_0x048e('0x13'))](_0x048e('0x14'));}}else{return _0x5e04c6;}}function respondWithRpcPromise(_0x59cc6b,_0x3100c5,_0x42700b,_0x41a23d){return new BPromise(function(_0x1bd090,_0x1cc244){var _0x2c3273=_0x41a23d||client;return _0x2c3273[_0x048e('0x15')](_0x59cc6b,_0x42700b)[_0x048e('0x16')](function(_0x3e1cbb){logger['info'](_0x048e('0x17'),_0x3100c5,_0x048e('0x18'));logger['debug'](_0x048e('0x19'),_0x3100c5,_0x048e('0x18'),JSON[_0x048e('0x1a')](_0x3e1cbb));if(_0x3e1cbb[_0x048e('0x1b')]){if(_0x3e1cbb['error'][_0x048e('0x1c')]===0x1f4){logger[_0x048e('0x1b')](_0x048e('0x17'),_0x3100c5,_0x3e1cbb[_0x048e('0x1b')]['message']);return _0x1cc244(_0x3e1cbb[_0x048e('0x1b')][_0x048e('0x1d')]);}logger[_0x048e('0x1b')](_0x048e('0x17'),_0x3100c5,_0x3e1cbb[_0x048e('0x1b')][_0x048e('0x1d')]);return _0x1bd090(_0x3e1cbb['error'][_0x048e('0x1d')]);}else{logger[_0x048e('0x1e')](_0x048e('0x17'),_0x3100c5,'request\x20sent');_0x1bd090(_0x3e1cbb['result'][_0x048e('0x1d')]);}})[_0x048e('0x1f')](function(_0x4dff92){logger['error'](_0x048e('0x17'),_0x3100c5,_0x4dff92);_0x1cc244(_0x4dff92);});});}function respondWithStatusCode(_0x289874,_0x5e52e2){_0x5e52e2=_0x5e52e2||0xcc;return function(_0x28eaf1){if(_0x28eaf1){return _0x289874['sendStatus'](_0x5e52e2);}return _0x289874[_0x048e('0x20')](_0x5e52e2)[_0x048e('0x21')]();};}function respondWithResult(_0x278552,_0x1472ce){_0x1472ce=_0x1472ce||0xc8;return function(_0x1739b8){if(_0x1739b8){return _0x278552[_0x048e('0x20')](_0x1472ce)[_0x048e('0x22')](_0x1739b8);}};}function respondWithFilteredResult(_0x2095cb,_0x539db3){return function(_0x275889){if(_0x275889){var _0x54f357=_0x275889[_0x048e('0x23')],_0x19a910=_0x539db3[_0x048e('0x24')],_0x59ef22=_0x539db3[_0x048e('0x24')]+_0x539db3[_0x048e('0x25')],_0x11307b;if(_0x59ef22>=_0x54f357){_0x59ef22=_0x54f357;_0x11307b=0xc8;}else{_0x11307b=0xce;}_0x2095cb[_0x048e('0x20')](_0x11307b);return _0x2095cb[_0x048e('0x26')](_0x048e('0x27'),_0x19a910+'-'+_0x59ef22+'/'+_0x54f357)['json'](_0x275889);}return null;};}function patchUpdates(_0xe6f82b){return function(_0xae2155){try{jsonpatch[_0x048e('0x28')](_0xae2155,_0xe6f82b,!![]);}catch(_0x5402cb){return BPromise[_0x048e('0x29')](_0x5402cb);}return _0xae2155[_0x048e('0x2a')]();};}function saveUpdates(_0x29a7b3,_0x31a80d){return function(_0xd9cba9){if(_0xd9cba9){return _0xd9cba9[_0x048e('0x2b')](_0x29a7b3)[_0x048e('0x16')](function(_0x440ac7){return _0x440ac7;});}return null;};}function removeEntity(_0x2f927b,_0x208c15){return function(_0x417f0a){if(_0x417f0a){return _0x417f0a[_0x048e('0x2c')]()[_0x048e('0x16')](function(){_0x2f927b[_0x048e('0x20')](0xcc)[_0x048e('0x21')]();});}};}function handleEntityNotFound(_0x393733,_0x56e535){return function(_0x19fe1d){if(!_0x19fe1d){_0x393733[_0x048e('0x2d')](0x194);}return _0x19fe1d;};}function handleError(_0x350e60,_0x393616){_0x393616=_0x393616||0x1f4;return function(_0x27a09a){logger[_0x048e('0x1b')](_0x27a09a[_0x048e('0x2e')]);if(_0x27a09a['name']){delete _0x27a09a[_0x048e('0x2f')];}_0x350e60[_0x048e('0x20')](_0x393616)['send'](_0x27a09a);};}exports['index']=function(_0x12d224,_0x429919){var _0x201014={},_0x5365ef={},_0x452452={'count':0x0,'rows':[]};var _0x172638=_[_0x048e('0x30')](db[_0x048e('0x31')][_0x048e('0x32')],function(_0xb4c498){return{'name':_0xb4c498[_0x048e('0x33')],'type':_0xb4c498[_0x048e('0x34')][_0x048e('0x35')]};});_0x5365ef['model']=_['map'](_0x172638,_0x048e('0x2f'));_0x5365ef['query']=_[_0x048e('0x36')](_0x12d224[_0x048e('0x37')]);_0x5365ef[_0x048e('0x38')]=_[_0x048e('0x39')](_0x5365ef['model'],_0x5365ef['query']);_0x201014[_0x048e('0x3a')]=_[_0x048e('0x39')](_0x5365ef[_0x048e('0x3b')],qs[_0x048e('0x3c')](_0x12d224[_0x048e('0x37')]['fields']));_0x201014[_0x048e('0x3a')]=_0x201014[_0x048e('0x3a')][_0x048e('0x3d')]?_0x201014[_0x048e('0x3a')]:_0x5365ef[_0x048e('0x3b')];if(!_0x12d224['query'][_0x048e('0x3e')](_0x048e('0x3f'))){_0x201014[_0x048e('0x25')]=qs['limit'](_0x12d224[_0x048e('0x37')][_0x048e('0x25')]);_0x201014['offset']=qs[_0x048e('0x24')](_0x12d224[_0x048e('0x37')][_0x048e('0x24')]);}_0x201014[_0x048e('0x40')]=qs['sort'](_0x12d224[_0x048e('0x37')][_0x048e('0x41')]);_0x201014[_0x048e('0x42')]=qs[_0x048e('0x38')](_[_0x048e('0x43')](_0x12d224[_0x048e('0x37')],_0x5365ef['filters']),_0x172638);if(_0x12d224[_0x048e('0x37')][_0x048e('0x44')]){_0x201014['where']=_[_0x048e('0x45')](_0x201014['where'],{'$or':_[_0x048e('0x30')](_0x172638,function(_0x472070){if(_0x472070[_0x048e('0x34')]!==_0x048e('0x46')){var _0x298f76={};_0x298f76[_0x472070[_0x048e('0x2f')]]={'$like':'%'+_0x12d224[_0x048e('0x37')][_0x048e('0x44')]+'%'};return _0x298f76;}})});}_0x201014=_['merge']({},_0x201014,_0x12d224[_0x048e('0x47')]);var _0x570e9c={'where':_0x201014[_0x048e('0x42')]};return db[_0x048e('0x31')]['count'](_0x570e9c)[_0x048e('0x16')](function(_0x3271a7){_0x452452[_0x048e('0x23')]=_0x3271a7;if(_0x12d224[_0x048e('0x37')]['includeAll']){_0x201014[_0x048e('0x48')]=[{'all':!![]}];}return db[_0x048e('0x31')][_0x048e('0x49')](_0x201014);})[_0x048e('0x16')](function(_0x4c4bc3){_0x452452[_0x048e('0x4a')]=_0x4c4bc3;return _0x452452;})['then'](respondWithFilteredResult(_0x429919,_0x201014))[_0x048e('0x1f')](handleError(_0x429919,null));};exports[_0x048e('0x4b')]=function(_0x46b873,_0x4280b6){var _0x38027b={'raw':![],'where':{'id':_0x46b873['params']['id']}},_0xe3ac7b={};_0xe3ac7b[_0x048e('0x3b')]=_[_0x048e('0x36')](db[_0x048e('0x31')][_0x048e('0x32')]);_0xe3ac7b[_0x048e('0x37')]=_[_0x048e('0x36')](_0x46b873[_0x048e('0x37')]);_0xe3ac7b[_0x048e('0x38')]=_[_0x048e('0x39')](_0xe3ac7b[_0x048e('0x3b')],_0xe3ac7b[_0x048e('0x37')]);_0x38027b['attributes']=_[_0x048e('0x39')](_0xe3ac7b['model'],qs[_0x048e('0x3c')](_0x46b873[_0x048e('0x37')][_0x048e('0x3c')]));_0x38027b[_0x048e('0x3a')]=_0x38027b['attributes']['length']?_0x38027b[_0x048e('0x3a')]:_0xe3ac7b[_0x048e('0x3b')];if(_0x46b873[_0x048e('0x37')][_0x048e('0x4c')]){_0x38027b[_0x048e('0x48')]=[{'all':!![]}];}_0x38027b=_['merge']({},_0x38027b,_0x46b873['options']);return db[_0x048e('0x31')]['find'](_0x38027b)[_0x048e('0x16')](handleEntityNotFound(_0x4280b6,null))[_0x048e('0x16')](respondWithResult(_0x4280b6,null))['catch'](handleError(_0x4280b6,null));};exports[_0x048e('0x4d')]=function(_0x3c38d7,_0x589b70){return db[_0x048e('0x31')][_0x048e('0x4d')](_0x3c38d7[_0x048e('0x4e')],{})[_0x048e('0x16')](respondWithResult(_0x589b70,0xc9))[_0x048e('0x1f')](handleError(_0x589b70,null));};exports[_0x048e('0x2b')]=function(_0x4f7340,_0x428599){if(_0x4f7340['body']['id']){delete _0x4f7340['body']['id'];}return db[_0x048e('0x31')][_0x048e('0x4f')]({'where':{'id':_0x4f7340['params']['id']}})[_0x048e('0x16')](handleEntityNotFound(_0x428599,null))[_0x048e('0x16')](saveUpdates(_0x4f7340[_0x048e('0x4e')],null))[_0x048e('0x16')](respondWithResult(_0x428599,null))['catch'](handleError(_0x428599,null));};exports[_0x048e('0x2c')]=function(_0x4e92d0,_0x21422f){return db[_0x048e('0x31')]['find']({'where':{'id':_0x4e92d0[_0x048e('0x50')]['id']}})['then'](handleEntityNotFound(_0x21422f,null))[_0x048e('0x16')](removeEntity(_0x21422f,null))['catch'](handleError(_0x21422f,null));};exports[_0x048e('0x51')]=function(_0x1d8a7b,_0x1fe5f4,_0x544330){var _0x97dbce={};var _0x5a868d={};var _0x249927;var _0x579d88;return db[_0x048e('0x31')]['findOne']({'where':{'id':_0x1d8a7b[_0x048e('0x50')]['id']}})[_0x048e('0x16')](handleEntityNotFound(_0x1fe5f4,null))[_0x048e('0x16')](function(_0x188e2f){if(_0x188e2f){_0x249927=_0x188e2f;_0x5a868d[_0x048e('0x3b')]=_[_0x048e('0x36')](db[_0x048e('0x52')][_0x048e('0x32')]);_0x5a868d['query']=_['keys'](_0x1d8a7b[_0x048e('0x37')]);_0x5a868d['filters']=_[_0x048e('0x39')](_0x5a868d[_0x048e('0x3b')],_0x5a868d[_0x048e('0x37')]);_0x97dbce[_0x048e('0x3a')]=_[_0x048e('0x39')](_0x5a868d[_0x048e('0x3b')],qs[_0x048e('0x3c')](_0x1d8a7b[_0x048e('0x37')][_0x048e('0x3c')]));_0x97dbce[_0x048e('0x3a')]=_0x97dbce['attributes'][_0x048e('0x3d')]?_0x97dbce[_0x048e('0x3a')]:_0x5a868d[_0x048e('0x3b')];_0x97dbce[_0x048e('0x40')]=qs[_0x048e('0x41')](_0x1d8a7b['query'][_0x048e('0x41')]);_0x97dbce['where']=qs['filters'](_[_0x048e('0x43')](_0x1d8a7b['query'],_0x5a868d['filters']));if(_0x1d8a7b[_0x048e('0x37')]['filter']){_0x97dbce['where']=_[_0x048e('0x45')](_0x97dbce['where'],{'$or':_[_0x048e('0x30')](_0x97dbce[_0x048e('0x3a')],function(_0x25077c){var _0x3da655={};_0x3da655[_0x25077c]={'$like':'%'+_0x1d8a7b[_0x048e('0x37')][_0x048e('0x44')]+'%'};return _0x3da655;})});}_0x97dbce=_[_0x048e('0x45')]({},_0x97dbce,_0x1d8a7b['options']);return _0x249927[_0x048e('0x51')](_0x97dbce);}})[_0x048e('0x16')](function(_0x145cf9){if(_0x145cf9){_0x579d88=_0x145cf9[_0x048e('0x3d')];if(!_0x1d8a7b[_0x048e('0x37')][_0x048e('0x3e')](_0x048e('0x3f'))){_0x97dbce[_0x048e('0x25')]=qs[_0x048e('0x25')](_0x1d8a7b[_0x048e('0x37')][_0x048e('0x25')]);_0x97dbce['offset']=qs['offset'](_0x1d8a7b['query'][_0x048e('0x24')]);}return _0x249927['getFields'](_0x97dbce);}})[_0x048e('0x16')](function(_0x5f44ec){if(_0x5f44ec){return _0x5f44ec?{'count':_0x579d88,'rows':_0x5f44ec}:null;}})[_0x048e('0x16')](respondWithResult(_0x1fe5f4,null))[_0x048e('0x1f')](handleError(_0x1fe5f4,null));};exports[_0x048e('0x53')]=function(_0x128d44,_0x1eb9b1,_0x4ece9a){var _0x298bc0={};var _0x519944={};var _0xfd0a62;var _0x8765b8;return db[_0x048e('0x31')][_0x048e('0x54')]({'where':{'id':_0x128d44[_0x048e('0x50')]['id']}})[_0x048e('0x16')](handleEntityNotFound(_0x1eb9b1,null))[_0x048e('0x16')](function(_0x19dafc){if(_0x19dafc){_0xfd0a62=_0x19dafc;_0x519944[_0x048e('0x3b')]=_['keys'](db[_0x048e('0x52')][_0x048e('0x32')]);_0x519944[_0x048e('0x37')]=_[_0x048e('0x36')](_0x128d44[_0x048e('0x37')]);_0x519944[_0x048e('0x38')]=_[_0x048e('0x39')](_0x519944['model'],_0x519944['query']);_0x298bc0['attributes']=_[_0x048e('0x39')](_0x519944['model'],qs[_0x048e('0x3c')](_0x128d44['query'][_0x048e('0x3c')]));_0x298bc0['attributes']=_0x298bc0[_0x048e('0x3a')]['length']?_0x298bc0[_0x048e('0x3a')]:_0x519944[_0x048e('0x3b')];_0x298bc0['order']=qs[_0x048e('0x41')](_0x128d44[_0x048e('0x37')]['sort']);_0x298bc0['where']=qs[_0x048e('0x38')](_[_0x048e('0x43')](_0x128d44['query'],_0x519944['filters']));if(_0x128d44[_0x048e('0x37')][_0x048e('0x44')]){_0x298bc0[_0x048e('0x42')]=_[_0x048e('0x45')](_0x298bc0[_0x048e('0x42')],{'$or':_[_0x048e('0x30')](_0x298bc0[_0x048e('0x3a')],function(_0x3b00d8){var _0x102717={};_0x102717[_0x3b00d8]={'$like':'%'+_0x128d44['query'][_0x048e('0x44')]+'%'};return _0x102717;})});}_0x298bc0=_[_0x048e('0x45')]({},_0x298bc0,_0x128d44['options']);return _0xfd0a62['getSubjects'](_0x298bc0);}})[_0x048e('0x16')](function(_0x12d413){if(_0x12d413){_0x8765b8=_0x12d413[_0x048e('0x3d')];if(!_0x128d44[_0x048e('0x37')][_0x048e('0x3e')](_0x048e('0x3f'))){_0x298bc0[_0x048e('0x25')]=qs['limit'](_0x128d44[_0x048e('0x37')][_0x048e('0x25')]);_0x298bc0[_0x048e('0x24')]=qs[_0x048e('0x24')](_0x128d44[_0x048e('0x37')][_0x048e('0x24')]);}return _0xfd0a62[_0x048e('0x53')](_0x298bc0);}})[_0x048e('0x16')](function(_0x4732b7){if(_0x4732b7){return _0x4732b7?{'count':_0x8765b8,'rows':_0x4732b7}:null;}})['then'](respondWithResult(_0x1eb9b1,null))[_0x048e('0x1f')](handleError(_0x1eb9b1,null));};exports[_0x048e('0x55')]=function(_0x98fe0a,_0x54ea9c,_0xd562e0){var _0x1b0796={};var _0x21e8c7={};var _0x2d0a79;var _0x49881a;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x98fe0a[_0x048e('0x50')]['id']}})[_0x048e('0x16')](handleEntityNotFound(_0x54ea9c,null))[_0x048e('0x16')](function(_0x19ba54){if(_0x19ba54){_0x2d0a79=_0x19ba54;_0x21e8c7[_0x048e('0x3b')]=_[_0x048e('0x36')](db['ZendeskField'][_0x048e('0x32')]);_0x21e8c7[_0x048e('0x37')]=_[_0x048e('0x36')](_0x98fe0a['query']);_0x21e8c7[_0x048e('0x38')]=_[_0x048e('0x39')](_0x21e8c7['model'],_0x21e8c7['query']);_0x1b0796['attributes']=_[_0x048e('0x39')](_0x21e8c7['model'],qs['fields'](_0x98fe0a[_0x048e('0x37')][_0x048e('0x3c')]));_0x1b0796[_0x048e('0x3a')]=_0x1b0796[_0x048e('0x3a')][_0x048e('0x3d')]?_0x1b0796['attributes']:_0x21e8c7[_0x048e('0x3b')];_0x1b0796['order']=qs[_0x048e('0x41')](_0x98fe0a[_0x048e('0x37')][_0x048e('0x41')]);_0x1b0796[_0x048e('0x42')]=qs[_0x048e('0x38')](_[_0x048e('0x43')](_0x98fe0a[_0x048e('0x37')],_0x21e8c7[_0x048e('0x38')]));if(_0x98fe0a[_0x048e('0x37')]['filter']){_0x1b0796['where']=_[_0x048e('0x45')](_0x1b0796['where'],{'$or':_[_0x048e('0x30')](_0x1b0796[_0x048e('0x3a')],function(_0x975739){var _0x1be6a1={};_0x1be6a1[_0x975739]={'$like':'%'+_0x98fe0a[_0x048e('0x37')][_0x048e('0x44')]+'%'};return _0x1be6a1;})});}_0x1b0796=_[_0x048e('0x45')]({},_0x1b0796,_0x98fe0a[_0x048e('0x47')]);return _0x2d0a79['getDescriptions'](_0x1b0796);}})[_0x048e('0x16')](function(_0xf742f5){if(_0xf742f5){_0x49881a=_0xf742f5['length'];if(!_0x98fe0a['query'][_0x048e('0x3e')](_0x048e('0x3f'))){_0x1b0796[_0x048e('0x25')]=qs[_0x048e('0x25')](_0x98fe0a[_0x048e('0x37')][_0x048e('0x25')]);_0x1b0796[_0x048e('0x24')]=qs[_0x048e('0x24')](_0x98fe0a[_0x048e('0x37')]['offset']);}return _0x2d0a79[_0x048e('0x55')](_0x1b0796);}})[_0x048e('0x16')](function(_0x433f2f){if(_0x433f2f){return _0x433f2f?{'count':_0x49881a,'rows':_0x433f2f}:null;}})[_0x048e('0x16')](respondWithResult(_0x54ea9c,null))[_0x048e('0x1f')](handleError(_0x54ea9c,null));};exports[_0x048e('0x56')]=function(_0x252a95,_0x2dfa2b,_0x31e5ec){var _0x1868e5={};var _0x54d47b={};var _0x15c676;var _0x18a390;return db[_0x048e('0x31')]['findOne']({'where':{'id':_0x252a95[_0x048e('0x50')]['id']}})[_0x048e('0x16')](handleEntityNotFound(_0x2dfa2b,null))[_0x048e('0x16')](function(_0xd27ca4){if(_0xd27ca4){_0x15c676=_0xd27ca4;_0x54d47b[_0x048e('0x3b')]=_[_0x048e('0x36')](db['Tag'][_0x048e('0x32')]);_0x54d47b[_0x048e('0x37')]=_[_0x048e('0x36')](_0x252a95[_0x048e('0x37')]);_0x54d47b['filters']=_[_0x048e('0x39')](_0x54d47b[_0x048e('0x3b')],_0x54d47b[_0x048e('0x37')]);_0x1868e5[_0x048e('0x3a')]=_[_0x048e('0x39')](_0x54d47b[_0x048e('0x3b')],qs[_0x048e('0x3c')](_0x252a95['query']['fields']));_0x1868e5[_0x048e('0x3a')]=_0x1868e5['attributes'][_0x048e('0x3d')]?_0x1868e5[_0x048e('0x3a')]:_0x54d47b[_0x048e('0x3b')];_0x1868e5[_0x048e('0x40')]=qs['sort'](_0x252a95[_0x048e('0x37')][_0x048e('0x41')]);_0x1868e5['where']=qs[_0x048e('0x38')](_[_0x048e('0x43')](_0x252a95[_0x048e('0x37')],_0x54d47b[_0x048e('0x38')]));if(_0x252a95[_0x048e('0x37')]['filter']){_0x1868e5[_0x048e('0x42')]=_[_0x048e('0x45')](_0x1868e5[_0x048e('0x42')],{'$or':_[_0x048e('0x30')](_0x1868e5[_0x048e('0x3a')],function(_0x24eb6d){var _0x2795db={};_0x2795db[_0x24eb6d]={'$like':'%'+_0x252a95[_0x048e('0x37')][_0x048e('0x44')]+'%'};return _0x2795db;})});}_0x1868e5=_[_0x048e('0x45')]({},_0x1868e5,_0x252a95[_0x048e('0x47')]);return _0x15c676[_0x048e('0x56')](_0x1868e5);}})[_0x048e('0x16')](function(_0x113b6c){if(_0x113b6c){_0x18a390=_0x113b6c[_0x048e('0x3d')];if(!_0x252a95['query'][_0x048e('0x3e')](_0x048e('0x3f'))){_0x1868e5['limit']=qs[_0x048e('0x25')](_0x252a95[_0x048e('0x37')][_0x048e('0x25')]);_0x1868e5['offset']=qs['offset'](_0x252a95[_0x048e('0x37')][_0x048e('0x24')]);}return _0x15c676['getTags'](_0x1868e5);}})[_0x048e('0x16')](function(_0x1d4745){if(_0x1d4745){return _0x1d4745?{'count':_0x18a390,'rows':_0x1d4745}:null;}})[_0x048e('0x16')](respondWithResult(_0x2dfa2b,null))[_0x048e('0x1f')](handleError(_0x2dfa2b,null));};exports[_0x048e('0x57')]=function(_0x41587d,_0x4e117e,_0x395c5e){if(_0x41587d[_0x048e('0x4e')]['id']){delete _0x41587d['body']['id'];}return db[_0x048e('0x31')][_0x048e('0x54')]({'where':{'id':_0x41587d[_0x048e('0x50')]['id']}})[_0x048e('0x16')](handleEntityNotFound(_0x4e117e,null))['then'](function(_0x3c3b3d){if(_0x3c3b3d){return _0x3c3b3d[_0x048e('0x57')](_0x41587d[_0x048e('0x4e')][_0x048e('0x58')]||[]);}return null;})[_0x048e('0x16')](respondWithResult(_0x4e117e,null))[_0x048e('0x1f')](handleError(_0x4e117e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index b1f9913..b635e2a 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 _0xe3fa=['request-promise','rimraf','../../config/environment','exports','ZendeskConfiguration','util','../../config/logger','moment','bluebird'];(function(_0x1b2e6b,_0x2f97fb){var _0x1dd2aa=function(_0x413974){while(--_0x413974){_0x1b2e6b['push'](_0x1b2e6b['shift']());}};_0x1dd2aa(++_0x2f97fb);}(_0xe3fa,0x19a));var _0xae3f=function(_0x4f0e62,_0x28e44f){_0x4f0e62=_0x4f0e62-0x0;var _0x117ab8=_0xe3fa[_0x4f0e62];return _0x117ab8;};'use strict';var _=require('lodash');var util=require(_0xae3f('0x0'));var logger=require(_0xae3f('0x1'))('api');var moment=require(_0xae3f('0x2'));var BPromise=require(_0xae3f('0x3'));var rp=require(_0xae3f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae3f('0x5'));var config=require(_0xae3f('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xae3f('0x7')]=function(_0x5884e9,_0x5a1fc9){return _0x5884e9['define'](_0xae3f('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7736=['./intZendeskConfiguration.attributes','define','int_zendesk_configurations','util','api','path'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0x7736,0x11d));var _0x6773=function(_0x5a177d,_0x152fb8){_0x5a177d=_0x5a177d-0x0;var _0x26da2b=_0x7736[_0x5a177d];return _0x26da2b;};'use strict';var _=require('lodash');var util=require(_0x6773('0x0'));var logger=require('../../config/logger')(_0x6773('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6773('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6773('0x3'));module['exports']=function(_0x10d2a7,_0x605964){return _0x10d2a7[_0x6773('0x4')]('ZendeskConfiguration',attributes,{'tableName':_0x6773('0x5'),'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 5167fcf..37f8ac4 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 _0x62fb=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x62fb,0x6c));var _0xb62f=function(_0x1ce2fc,_0x3ab648){_0x1ce2fc=_0x1ce2fc-0x0;var _0x269f03=_0x62fb[_0x1ce2fc];return _0x269f03;};'use strict';var _=require(_0xb62f('0x0'));var util=require('util');var moment=require(_0xb62f('0x1'));var BPromise=require(_0xb62f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb62f('0x3'));var db=require(_0xb62f('0x4'))['db'];var utils=require(_0xb62f('0x5'));var logger=require(_0xb62f('0x6'))(_0xb62f('0x7'));var config=require('../../config/environment');var jayson=require(_0xb62f('0x8'));var client=jayson[_0xb62f('0x9')][_0xb62f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7426da,_0x203b04,_0x5157f4){return new BPromise(function(_0x51d361,_0x6d8c27){return client[_0xb62f('0xb')](_0x7426da,_0x5157f4)[_0xb62f('0xc')](function(_0x58f732){logger[_0xb62f('0xd')](_0xb62f('0xe'),_0x203b04,_0xb62f('0xf'));logger['debug'](_0xb62f('0x10'),_0x203b04,_0xb62f('0xf'),JSON['stringify'](_0x58f732));if(_0x58f732[_0xb62f('0x11')]){if(_0x58f732['error'][_0xb62f('0x12')]===0x1f4){logger[_0xb62f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x203b04,_0x58f732[_0xb62f('0x11')][_0xb62f('0x13')]);return _0x6d8c27(_0x58f732[_0xb62f('0x11')]['message']);}logger[_0xb62f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x203b04,_0x58f732[_0xb62f('0x11')][_0xb62f('0x13')]);return _0x51d361(_0x58f732[_0xb62f('0x11')][_0xb62f('0x13')]);}else{logger[_0xb62f('0xd')](_0xb62f('0xe'),_0x203b04,_0xb62f('0xf'));_0x51d361(_0x58f732[_0xb62f('0x14')][_0xb62f('0x13')]);}})[_0xb62f('0x15')](function(_0xbb8069){logger[_0xb62f('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x203b04,_0xbb8069);_0x6d8c27(_0xbb8069);});});} \ No newline at end of file +var _0xaaad=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x4cebcc,_0x56253e){var _0x4d1669=function(_0x89e326){while(--_0x89e326){_0x4cebcc['push'](_0x4cebcc['shift']());}};_0x4d1669(++_0x56253e);}(_0xaaad,0x177));var _0xdaaa=function(_0x3f219f,_0x29f40a){_0x3f219f=_0x3f219f-0x0;var _0x4f64e3=_0xaaad[_0x3f219f];return _0x4f64e3;};'use strict';var _=require(_0xdaaa('0x0'));var util=require(_0xdaaa('0x1'));var moment=require('moment');var BPromise=require(_0xdaaa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdaaa('0x3'))['db'];var utils=require(_0xdaaa('0x4'));var logger=require(_0xdaaa('0x5'))(_0xdaaa('0x6'));var config=require(_0xdaaa('0x7'));var jayson=require(_0xdaaa('0x8'));var client=jayson[_0xdaaa('0x9')][_0xdaaa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f0061,_0x8883d3,_0xb69aa7){return new BPromise(function(_0x1e9674,_0x1b7054){return client[_0xdaaa('0xb')](_0x4f0061,_0xb69aa7)['then'](function(_0x3e1539){logger[_0xdaaa('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8883d3,_0xdaaa('0xd'));logger[_0xdaaa('0xe')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x8883d3,_0xdaaa('0xd'),JSON[_0xdaaa('0xf')](_0x3e1539));if(_0x3e1539[_0xdaaa('0x10')]){if(_0x3e1539['error'][_0xdaaa('0x11')]===0x1f4){logger[_0xdaaa('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8883d3,_0x3e1539[_0xdaaa('0x10')][_0xdaaa('0x12')]);return _0x1b7054(_0x3e1539[_0xdaaa('0x10')][_0xdaaa('0x12')]);}logger[_0xdaaa('0x10')](_0xdaaa('0x13'),_0x8883d3,_0x3e1539[_0xdaaa('0x10')][_0xdaaa('0x12')]);return _0x1e9674(_0x3e1539[_0xdaaa('0x10')][_0xdaaa('0x12')]);}else{logger[_0xdaaa('0xc')](_0xdaaa('0x13'),_0x8883d3,'request\x20sent');_0x1e9674(_0x3e1539[_0xdaaa('0x14')]['message']);}})['catch'](function(_0x44884f){logger[_0xdaaa('0x10')](_0xdaaa('0x13'),_0x8883d3,_0x44884f);_0x1b7054(_0x44884f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index f7c707e..076f54b 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 _0xe20e=['express','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xe20e,0x195));var _0xee20=function(_0x143896,_0x31f415){_0x143896=_0x143896-0x0;var _0x27d303=_0xe20e[_0x143896];return _0x27d303;};'use strict';var multer=require(_0xee20('0x0'));var util=require(_0xee20('0x1'));var path=require('path');var timeout=require(_0xee20('0x2'));var express=require(_0xee20('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xee20('0x4'));var config=require('../../config/environment');var controller=require(_0xee20('0x5'));router[_0xee20('0x6')]('/',auth[_0xee20('0x7')](),controller[_0xee20('0x8')]);router[_0xee20('0x6')](_0xee20('0x9'),auth[_0xee20('0x7')](),controller[_0xee20('0xa')]);router[_0xee20('0xb')]('/',auth[_0xee20('0x7')](),controller[_0xee20('0xc')]);router[_0xee20('0xd')]('/:id',auth[_0xee20('0x7')](),controller[_0xee20('0xe')]);router['delete']('/:id',auth[_0xee20('0x7')](),controller[_0xee20('0xf')]);module[_0xee20('0x10')]=router; \ No newline at end of file +var _0x6e80=['../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e80,0x1cd));var _0x06e8=function(_0x430de8,_0x3ba2a2){_0x430de8=_0x430de8-0x0;var _0x231beb=_0x6e80[_0x430de8];return _0x231beb;};'use strict';var multer=require(_0x06e8('0x0'));var util=require(_0x06e8('0x1'));var path=require(_0x06e8('0x2'));var timeout=require(_0x06e8('0x3'));var express=require(_0x06e8('0x4'));var router=express['Router']();var auth=require(_0x06e8('0x5'));var interaction=require(_0x06e8('0x6'));var config=require(_0x06e8('0x7'));var controller=require('./intZendeskField.controller');router[_0x06e8('0x8')]('/',auth[_0x06e8('0x9')](),controller[_0x06e8('0xa')]);router[_0x06e8('0x8')](_0x06e8('0xb'),auth[_0x06e8('0x9')](),controller[_0x06e8('0xc')]);router['post']('/',auth[_0x06e8('0x9')](),controller[_0x06e8('0xd')]);router[_0x06e8('0xe')](_0x06e8('0xb'),auth['isAuthenticated'](),controller[_0x06e8('0xf')]);router['delete'](_0x06e8('0xb'),auth['isAuthenticated'](),controller[_0x06e8('0x10')]);module[_0x06e8('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 6bc3b3f..af6c1ad 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 _0x8f23=['string','variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2dc513,_0x2699e9){var _0x4f6e06=function(_0x3b4421){while(--_0x3b4421){_0x2dc513['push'](_0x2dc513['shift']());}};_0x4f6e06(++_0x2699e9);}(_0x8f23,0x1e5));var _0x38f2=function(_0x4ca81c,_0x25d85a){_0x4ca81c=_0x4ca81c-0x0;var _0x5caa07=_0x8f23[_0x4ca81c];return _0x5caa07;};'use strict';var Sequelize=require(_0x38f2('0x0'));module[_0x38f2('0x1')]={'type':{'type':Sequelize[_0x38f2('0x2')](_0x38f2('0x3'),_0x38f2('0x4'),_0x38f2('0x5'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x38f2('0x6')]},'key':{'type':Sequelize[_0x38f2('0x6')]},'keyType':{'type':Sequelize[_0x38f2('0x2')](_0x38f2('0x3'),_0x38f2('0x4'),_0x38f2('0x5'))},'keyContent':{'type':Sequelize[_0x38f2('0x6')]},'idField':{'type':Sequelize[_0x38f2('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x38f2('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x38f2('0x6')]}}; \ No newline at end of file +var _0xe2cd=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xe2cd,0x64));var _0xde2c=function(_0x1d654e,_0x2b8e28){_0x1d654e=_0x1d654e-0x0;var _0x37d34a=_0xe2cd[_0x1d654e];return _0x37d34a;};'use strict';var Sequelize=require(_0xde2c('0x0'));module[_0xde2c('0x1')]={'type':{'type':Sequelize[_0xde2c('0x2')](_0xde2c('0x3'),_0xde2c('0x4'),_0xde2c('0x5'),_0xde2c('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xde2c('0x7')]},'key':{'type':Sequelize[_0xde2c('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xde2c('0x3'),_0xde2c('0x4'),_0xde2c('0x5'))},'keyContent':{'type':Sequelize[_0xde2c('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xde2c('0x7')]},'customField':{'type':Sequelize[_0xde2c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xde2c('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index fbbca63..eb599cc 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 _0xe407=['rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','offset','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','limit','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskField'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0xe407,0xf0));var _0x7e40=function(_0x53fdad,_0x57a51d){_0x53fdad=_0x53fdad-0x0;var _0x2ea811=_0xe407[_0x53fdad];return _0x2ea811;};'use strict';var pdf=require(_0x7e40('0x0'));var emlformat=require(_0x7e40('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7e40('0x2'));var jsonpatch=require(_0x7e40('0x3'));var rp=require('request-promise');var moment=require(_0x7e40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e40('0x5'));var util=require('util');var path=require(_0x7e40('0x6'));var sox=require(_0x7e40('0x7'));var csv=require(_0x7e40('0x8'));var ejs=require(_0x7e40('0x9'));var fs=require('fs');var _=require(_0x7e40('0xa'));var squel=require(_0x7e40('0xb'));var crypto=require('crypto');var jsforce=require(_0x7e40('0xc'));var deskjs=require(_0x7e40('0xd'));var toCsv=require(_0x7e40('0x8'));var querystring=require(_0x7e40('0xe'));var Papa=require(_0x7e40('0xf'));var Redis=require(_0x7e40('0x10'));var authService=require(_0x7e40('0x11'));var qs=require(_0x7e40('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7e40('0x13'));var logger=require(_0x7e40('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7e40('0x15'));var db=require(_0x7e40('0x16'))['db'];function respondWithStatusCode(_0x50cd80,_0x1cec1c){_0x1cec1c=_0x1cec1c||0xcc;return function(_0x52bb08){if(_0x52bb08){return _0x50cd80[_0x7e40('0x17')](_0x1cec1c);}return _0x50cd80[_0x7e40('0x18')](_0x1cec1c)['end']();};}function respondWithResult(_0x21ab0f,_0x5b2834){_0x5b2834=_0x5b2834||0xc8;return function(_0x1f1f97){if(_0x1f1f97){return _0x21ab0f[_0x7e40('0x18')](_0x5b2834)[_0x7e40('0x19')](_0x1f1f97);}};}function respondWithFilteredResult(_0x255f63,_0x2fab65){return function(_0x166a19){if(_0x166a19){var _0x532ca9=_0x166a19['count'],_0x33b12d=_0x2fab65['offset'],_0x415330=_0x2fab65['offset']+_0x2fab65[_0x7e40('0x1a')],_0x739e86;if(_0x415330>=_0x532ca9){_0x415330=_0x532ca9;_0x739e86=0xc8;}else{_0x739e86=0xce;}_0x255f63[_0x7e40('0x18')](_0x739e86);return _0x255f63[_0x7e40('0x1b')]('Content-Range',_0x33b12d+'-'+_0x415330+'/'+_0x532ca9)[_0x7e40('0x19')](_0x166a19);}return null;};}function patchUpdates(_0x26e83e){return function(_0x26d9ab){try{jsonpatch[_0x7e40('0x1c')](_0x26d9ab,_0x26e83e,!![]);}catch(_0x3948b9){return BPromise[_0x7e40('0x1d')](_0x3948b9);}return _0x26d9ab['save']();};}function saveUpdates(_0x4aedcd,_0x1c33bb){return function(_0x33df9a){if(_0x33df9a){return _0x33df9a[_0x7e40('0x1e')](_0x4aedcd)[_0x7e40('0x1f')](function(_0x3d98d5){return _0x3d98d5;});}return null;};}function removeEntity(_0x291bd3,_0x2736f2){return function(_0x57d64b){if(_0x57d64b){return _0x57d64b[_0x7e40('0x20')]()[_0x7e40('0x1f')](function(){_0x291bd3[_0x7e40('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f341d,_0x561f6e){return function(_0x174d65){if(!_0x174d65){_0x4f341d[_0x7e40('0x17')](0x194);}return _0x174d65;};}function handleError(_0x5b93e3,_0x25a049){_0x25a049=_0x25a049||0x1f4;return function(_0x514628){logger[_0x7e40('0x21')](_0x514628[_0x7e40('0x22')]);if(_0x514628[_0x7e40('0x23')]){delete _0x514628[_0x7e40('0x23')];}_0x5b93e3[_0x7e40('0x18')](_0x25a049)[_0x7e40('0x24')](_0x514628);};}exports[_0x7e40('0x25')]=function(_0x59c030,_0x39a8da){var _0x1ea68a={},_0x1c21c5={},_0x1cb393={'count':0x0,'rows':[]};var _0x5878ff=_[_0x7e40('0x26')](db[_0x7e40('0x27')][_0x7e40('0x28')],function(_0x807e81){return{'name':_0x807e81[_0x7e40('0x29')],'type':_0x807e81['type'][_0x7e40('0x2a')]};});_0x1c21c5[_0x7e40('0x2b')]=_[_0x7e40('0x26')](_0x5878ff,'name');_0x1c21c5[_0x7e40('0x2c')]=_[_0x7e40('0x2d')](_0x59c030['query']);_0x1c21c5['filters']=_[_0x7e40('0x2e')](_0x1c21c5[_0x7e40('0x2b')],_0x1c21c5[_0x7e40('0x2c')]);_0x1ea68a[_0x7e40('0x2f')]=_[_0x7e40('0x2e')](_0x1c21c5[_0x7e40('0x2b')],qs['fields'](_0x59c030[_0x7e40('0x2c')][_0x7e40('0x30')]));_0x1ea68a[_0x7e40('0x2f')]=_0x1ea68a[_0x7e40('0x2f')][_0x7e40('0x31')]?_0x1ea68a[_0x7e40('0x2f')]:_0x1c21c5[_0x7e40('0x2b')];if(!_0x59c030[_0x7e40('0x2c')]['hasOwnProperty']('nolimit')){_0x1ea68a['limit']=qs[_0x7e40('0x1a')](_0x59c030['query'][_0x7e40('0x1a')]);_0x1ea68a[_0x7e40('0x32')]=qs['offset'](_0x59c030[_0x7e40('0x2c')][_0x7e40('0x32')]);}_0x1ea68a[_0x7e40('0x33')]=qs['sort'](_0x59c030['query']['sort']);_0x1ea68a[_0x7e40('0x34')]=qs[_0x7e40('0x35')](_[_0x7e40('0x36')](_0x59c030[_0x7e40('0x2c')],_0x1c21c5[_0x7e40('0x35')]),_0x5878ff);if(_0x59c030['query'][_0x7e40('0x37')]){_0x1ea68a[_0x7e40('0x34')]=_[_0x7e40('0x38')](_0x1ea68a[_0x7e40('0x34')],{'$or':_['map'](_0x5878ff,function(_0x14791f){if(_0x14791f['type']!==_0x7e40('0x39')){var _0x425109={};_0x425109[_0x14791f[_0x7e40('0x23')]]={'$like':'%'+_0x59c030[_0x7e40('0x2c')][_0x7e40('0x37')]+'%'};return _0x425109;}})});}_0x1ea68a=_['merge']({},_0x1ea68a,_0x59c030[_0x7e40('0x3a')]);var _0x1fd621={'where':_0x1ea68a['where']};return db[_0x7e40('0x27')][_0x7e40('0x3b')](_0x1fd621)[_0x7e40('0x1f')](function(_0x2d817a){_0x1cb393[_0x7e40('0x3b')]=_0x2d817a;if(_0x59c030['query'][_0x7e40('0x3c')]){_0x1ea68a[_0x7e40('0x3d')]=[{'all':!![]}];}return db['ZendeskField'][_0x7e40('0x3e')](_0x1ea68a);})['then'](function(_0x10c171){_0x1cb393[_0x7e40('0x3f')]=_0x10c171;return _0x1cb393;})[_0x7e40('0x1f')](respondWithFilteredResult(_0x39a8da,_0x1ea68a))[_0x7e40('0x40')](handleError(_0x39a8da,null));};exports[_0x7e40('0x41')]=function(_0x2a379c,_0x2c967d){var _0x191b33={'raw':!![],'where':{'id':_0x2a379c['params']['id']}},_0x4ac17c={};_0x4ac17c[_0x7e40('0x2b')]=_[_0x7e40('0x2d')](db[_0x7e40('0x27')][_0x7e40('0x28')]);_0x4ac17c[_0x7e40('0x2c')]=_['keys'](_0x2a379c['query']);_0x4ac17c[_0x7e40('0x35')]=_[_0x7e40('0x2e')](_0x4ac17c[_0x7e40('0x2b')],_0x4ac17c['query']);_0x191b33[_0x7e40('0x2f')]=_[_0x7e40('0x2e')](_0x4ac17c[_0x7e40('0x2b')],qs['fields'](_0x2a379c['query'][_0x7e40('0x30')]));_0x191b33[_0x7e40('0x2f')]=_0x191b33[_0x7e40('0x2f')]['length']?_0x191b33[_0x7e40('0x2f')]:_0x4ac17c['model'];if(_0x2a379c[_0x7e40('0x2c')][_0x7e40('0x3c')]){_0x191b33['include']=[{'all':!![]}];}_0x191b33=_[_0x7e40('0x38')]({},_0x191b33,_0x2a379c['options']);return db[_0x7e40('0x27')][_0x7e40('0x42')](_0x191b33)['then'](handleEntityNotFound(_0x2c967d,null))[_0x7e40('0x1f')](respondWithResult(_0x2c967d,null))[_0x7e40('0x40')](handleError(_0x2c967d,null));};exports[_0x7e40('0x43')]=function(_0x21c479,_0x2ecd57){return db[_0x7e40('0x27')][_0x7e40('0x43')](_0x21c479['body'],{})[_0x7e40('0x1f')](respondWithResult(_0x2ecd57,0xc9))['catch'](handleError(_0x2ecd57,null));};exports[_0x7e40('0x1e')]=function(_0x53ab2d,_0x3e775d){if(_0x53ab2d['body']['id']){delete _0x53ab2d[_0x7e40('0x44')]['id'];}return db[_0x7e40('0x27')]['find']({'where':{'id':_0x53ab2d[_0x7e40('0x45')]['id']}})['then'](handleEntityNotFound(_0x3e775d,null))[_0x7e40('0x1f')](saveUpdates(_0x53ab2d[_0x7e40('0x44')],null))[_0x7e40('0x1f')](respondWithResult(_0x3e775d,null))[_0x7e40('0x40')](handleError(_0x3e775d,null));};exports[_0x7e40('0x20')]=function(_0x2a537f,_0x32d26e){return db['ZendeskField'][_0x7e40('0x42')]({'where':{'id':_0x2a537f[_0x7e40('0x45')]['id']}})['then'](handleEntityNotFound(_0x32d26e,null))[_0x7e40('0x1f')](removeEntity(_0x32d26e,null))[_0x7e40('0x40')](handleError(_0x32d26e,null));}; \ No newline at end of file +var _0xa3f4=['save','then','destroy','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','find','catch','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject'];(function(_0x5eec0d,_0xc48f11){var _0x11394a=function(_0x4c0a90){while(--_0x4c0a90){_0x5eec0d['push'](_0x5eec0d['shift']());}};_0x11394a(++_0xc48f11);}(_0xa3f4,0x1f0));var _0x4a3f=function(_0x6e2fc5,_0x17e1e9){_0x6e2fc5=_0x6e2fc5-0x0;var _0x2366f1=_0xa3f4[_0x6e2fc5];return _0x2366f1;};'use strict';var pdf=require(_0x4a3f('0x0'));var emlformat=require(_0x4a3f('0x1'));var rimraf=require(_0x4a3f('0x2'));var zipdir=require(_0x4a3f('0x3'));var jsonpatch=require(_0x4a3f('0x4'));var rp=require(_0x4a3f('0x5'));var moment=require('moment');var BPromise=require(_0x4a3f('0x6'));var Mustache=require(_0x4a3f('0x7'));var util=require(_0x4a3f('0x8'));var path=require(_0x4a3f('0x9'));var sox=require(_0x4a3f('0xa'));var csv=require(_0x4a3f('0xb'));var ejs=require(_0x4a3f('0xc'));var fs=require('fs');var _=require(_0x4a3f('0xd'));var squel=require(_0x4a3f('0xe'));var crypto=require(_0x4a3f('0xf'));var jsforce=require(_0x4a3f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4a3f('0xb'));var querystring=require('querystring');var Papa=require(_0x4a3f('0x11'));var Redis=require('ioredis');var authService=require(_0x4a3f('0x12'));var qs=require(_0x4a3f('0x13'));var as=require(_0x4a3f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4a3f('0x15'));var utils=require(_0x4a3f('0x16'));var config=require(_0x4a3f('0x17'));var db=require(_0x4a3f('0x18'))['db'];function respondWithStatusCode(_0xcdd8a6,_0x86a5f1){_0x86a5f1=_0x86a5f1||0xcc;return function(_0x50c425){if(_0x50c425){return _0xcdd8a6[_0x4a3f('0x19')](_0x86a5f1);}return _0xcdd8a6[_0x4a3f('0x1a')](_0x86a5f1)[_0x4a3f('0x1b')]();};}function respondWithResult(_0x5dafca,_0x37815d){_0x37815d=_0x37815d||0xc8;return function(_0x3a63fe){if(_0x3a63fe){return _0x5dafca[_0x4a3f('0x1a')](_0x37815d)[_0x4a3f('0x1c')](_0x3a63fe);}};}function respondWithFilteredResult(_0x2c42e3,_0x411e39){return function(_0xc383c2){if(_0xc383c2){var _0x31201d=_0xc383c2[_0x4a3f('0x1d')],_0x23013e=_0x411e39[_0x4a3f('0x1e')],_0x5a0fdc=_0x411e39['offset']+_0x411e39[_0x4a3f('0x1f')],_0x3b2a28;if(_0x5a0fdc>=_0x31201d){_0x5a0fdc=_0x31201d;_0x3b2a28=0xc8;}else{_0x3b2a28=0xce;}_0x2c42e3[_0x4a3f('0x1a')](_0x3b2a28);return _0x2c42e3[_0x4a3f('0x20')](_0x4a3f('0x21'),_0x23013e+'-'+_0x5a0fdc+'/'+_0x31201d)[_0x4a3f('0x1c')](_0xc383c2);}return null;};}function patchUpdates(_0x5ef2e0){return function(_0x228686){try{jsonpatch[_0x4a3f('0x22')](_0x228686,_0x5ef2e0,!![]);}catch(_0x390644){return BPromise[_0x4a3f('0x23')](_0x390644);}return _0x228686[_0x4a3f('0x24')]();};}function saveUpdates(_0x142c73,_0x24c051){return function(_0xe2e7dd){if(_0xe2e7dd){return _0xe2e7dd['update'](_0x142c73)[_0x4a3f('0x25')](function(_0x39812d){return _0x39812d;});}return null;};}function removeEntity(_0x595ca9,_0x56ce94){return function(_0x3da0ad){if(_0x3da0ad){return _0x3da0ad[_0x4a3f('0x26')]()[_0x4a3f('0x25')](function(){_0x595ca9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5aee6f,_0x53d0c8){return function(_0x4ad0e0){if(!_0x4ad0e0){_0x5aee6f[_0x4a3f('0x19')](0x194);}return _0x4ad0e0;};}function handleError(_0x1ed0d0,_0x45da39){_0x45da39=_0x45da39||0x1f4;return function(_0x5ad558){logger[_0x4a3f('0x27')](_0x5ad558[_0x4a3f('0x28')]);if(_0x5ad558['name']){delete _0x5ad558[_0x4a3f('0x29')];}_0x1ed0d0[_0x4a3f('0x1a')](_0x45da39)[_0x4a3f('0x2a')](_0x5ad558);};}exports[_0x4a3f('0x2b')]=function(_0x5b321f,_0x2b13de){var _0x1bcb79={},_0x1fccaf={},_0x1f63b3={'count':0x0,'rows':[]};var _0x9a65b9=_['map'](db[_0x4a3f('0x2c')][_0x4a3f('0x2d')],function(_0x550a7f){return{'name':_0x550a7f[_0x4a3f('0x2e')],'type':_0x550a7f['type']['key']};});_0x1fccaf[_0x4a3f('0x2f')]=_[_0x4a3f('0x30')](_0x9a65b9,'name');_0x1fccaf[_0x4a3f('0x31')]=_[_0x4a3f('0x32')](_0x5b321f[_0x4a3f('0x31')]);_0x1fccaf[_0x4a3f('0x33')]=_[_0x4a3f('0x34')](_0x1fccaf['model'],_0x1fccaf[_0x4a3f('0x31')]);_0x1bcb79[_0x4a3f('0x35')]=_['intersection'](_0x1fccaf['model'],qs['fields'](_0x5b321f['query'][_0x4a3f('0x36')]));_0x1bcb79[_0x4a3f('0x35')]=_0x1bcb79[_0x4a3f('0x35')]['length']?_0x1bcb79[_0x4a3f('0x35')]:_0x1fccaf[_0x4a3f('0x2f')];if(!_0x5b321f[_0x4a3f('0x31')][_0x4a3f('0x37')](_0x4a3f('0x38'))){_0x1bcb79['limit']=qs[_0x4a3f('0x1f')](_0x5b321f['query'][_0x4a3f('0x1f')]);_0x1bcb79[_0x4a3f('0x1e')]=qs[_0x4a3f('0x1e')](_0x5b321f['query']['offset']);}_0x1bcb79[_0x4a3f('0x39')]=qs[_0x4a3f('0x3a')](_0x5b321f[_0x4a3f('0x31')]['sort']);_0x1bcb79['where']=qs['filters'](_[_0x4a3f('0x3b')](_0x5b321f[_0x4a3f('0x31')],_0x1fccaf[_0x4a3f('0x33')]),_0x9a65b9);if(_0x5b321f['query'][_0x4a3f('0x3c')]){_0x1bcb79['where']=_['merge'](_0x1bcb79[_0x4a3f('0x3d')],{'$or':_[_0x4a3f('0x30')](_0x9a65b9,function(_0x15b9d0){if(_0x15b9d0[_0x4a3f('0x3e')]!==_0x4a3f('0x3f')){var _0xfbb120={};_0xfbb120[_0x15b9d0[_0x4a3f('0x29')]]={'$like':'%'+_0x5b321f[_0x4a3f('0x31')][_0x4a3f('0x3c')]+'%'};return _0xfbb120;}})});}_0x1bcb79=_[_0x4a3f('0x40')]({},_0x1bcb79,_0x5b321f[_0x4a3f('0x41')]);var _0x5dc66f={'where':_0x1bcb79[_0x4a3f('0x3d')]};return db[_0x4a3f('0x2c')][_0x4a3f('0x1d')](_0x5dc66f)[_0x4a3f('0x25')](function(_0x571caa){_0x1f63b3[_0x4a3f('0x1d')]=_0x571caa;if(_0x5b321f[_0x4a3f('0x31')][_0x4a3f('0x42')]){_0x1bcb79[_0x4a3f('0x43')]=[{'all':!![]}];}return db['ZendeskField'][_0x4a3f('0x44')](_0x1bcb79);})[_0x4a3f('0x25')](function(_0x3db3cf){_0x1f63b3[_0x4a3f('0x45')]=_0x3db3cf;return _0x1f63b3;})[_0x4a3f('0x25')](respondWithFilteredResult(_0x2b13de,_0x1bcb79))['catch'](handleError(_0x2b13de,null));};exports['show']=function(_0x44f55f,_0xace857){var _0x3b6800={'raw':!![],'where':{'id':_0x44f55f[_0x4a3f('0x46')]['id']}},_0x2ce21b={};_0x2ce21b[_0x4a3f('0x2f')]=_[_0x4a3f('0x32')](db[_0x4a3f('0x2c')][_0x4a3f('0x2d')]);_0x2ce21b[_0x4a3f('0x31')]=_[_0x4a3f('0x32')](_0x44f55f['query']);_0x2ce21b[_0x4a3f('0x33')]=_[_0x4a3f('0x34')](_0x2ce21b[_0x4a3f('0x2f')],_0x2ce21b['query']);_0x3b6800[_0x4a3f('0x35')]=_[_0x4a3f('0x34')](_0x2ce21b[_0x4a3f('0x2f')],qs[_0x4a3f('0x36')](_0x44f55f[_0x4a3f('0x31')]['fields']));_0x3b6800[_0x4a3f('0x35')]=_0x3b6800[_0x4a3f('0x35')]['length']?_0x3b6800[_0x4a3f('0x35')]:_0x2ce21b['model'];if(_0x44f55f[_0x4a3f('0x31')][_0x4a3f('0x42')]){_0x3b6800[_0x4a3f('0x43')]=[{'all':!![]}];}_0x3b6800=_[_0x4a3f('0x40')]({},_0x3b6800,_0x44f55f[_0x4a3f('0x41')]);return db['ZendeskField'][_0x4a3f('0x47')](_0x3b6800)[_0x4a3f('0x25')](handleEntityNotFound(_0xace857,null))[_0x4a3f('0x25')](respondWithResult(_0xace857,null))[_0x4a3f('0x48')](handleError(_0xace857,null));};exports[_0x4a3f('0x49')]=function(_0x21082b,_0x37b234){return db[_0x4a3f('0x2c')][_0x4a3f('0x49')](_0x21082b['body'],{})[_0x4a3f('0x25')](respondWithResult(_0x37b234,0xc9))['catch'](handleError(_0x37b234,null));};exports[_0x4a3f('0x4a')]=function(_0x1ccd9c,_0x466b48){if(_0x1ccd9c[_0x4a3f('0x4b')]['id']){delete _0x1ccd9c[_0x4a3f('0x4b')]['id'];}return db[_0x4a3f('0x2c')][_0x4a3f('0x47')]({'where':{'id':_0x1ccd9c['params']['id']}})['then'](handleEntityNotFound(_0x466b48,null))[_0x4a3f('0x25')](saveUpdates(_0x1ccd9c[_0x4a3f('0x4b')],null))[_0x4a3f('0x25')](respondWithResult(_0x466b48,null))[_0x4a3f('0x48')](handleError(_0x466b48,null));};exports[_0x4a3f('0x26')]=function(_0x3a9902,_0x4abd0f){return db[_0x4a3f('0x2c')][_0x4a3f('0x47')]({'where':{'id':_0x3a9902[_0x4a3f('0x46')]['id']}})[_0x4a3f('0x25')](handleEntityNotFound(_0x4abd0f,null))['then'](removeEntity(_0x4abd0f,null))[_0x4a3f('0x48')](handleError(_0x4abd0f,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 19c467f..5b23c15 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 _0xa571=['int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','ZendeskField'];(function(_0x2811b2,_0x36fd3f){var _0x22eace=function(_0x28f15c){while(--_0x28f15c){_0x2811b2['push'](_0x2811b2['shift']());}};_0x22eace(++_0x36fd3f);}(_0xa571,0x107));var _0x1a57=function(_0x2f8f44,_0x4989a4){_0x2f8f44=_0x2f8f44-0x0;var _0x547293=_0xa571[_0x2f8f44];return _0x547293;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var logger=require(_0x1a57('0x2'))(_0x1a57('0x3'));var moment=require('moment');var BPromise=require(_0x1a57('0x4'));var rp=require(_0x1a57('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a57('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x1a57('0x7')]=function(_0xd97a33,_0x22ca20){return _0xd97a33[_0x1a57('0x8')](_0x1a57('0x9'),attributes,{'tableName':_0x1a57('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x1a57('0xb'),_0x1a57('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x97c1=['rimraf','../../config/environment','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','FieldId','lodash','util','api','request-promise','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x97c1,0xdf));var _0x197c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x97c1[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var logger=require('../../config/logger')(_0x197c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x197c('0x3'));var fs=require('fs');var path=require(_0x197c('0x4'));var rimraf=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var attributes=require(_0x197c('0x7'));module['exports']=function(_0x5cbff6,_0x1cb6e1){return _0x5cbff6[_0x197c('0x8')](_0x197c('0x9'),attributes,{'tableName':_0x197c('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0x197c('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 4e34a0a..d58aa5c 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 _0x9aee=['randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','ZendeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird'];(function(_0x1e6e99,_0xd3bb5f){var _0x6b6ca8=function(_0xa29245){while(--_0xa29245){_0x1e6e99['push'](_0x1e6e99['shift']());}};_0x6b6ca8(++_0xd3bb5f);}(_0x9aee,0x1df));var _0xe9ae=function(_0x3927a9,_0x253765){_0x3927a9=_0x3927a9-0x0;var _0xa3231a=_0x9aee[_0x3927a9];return _0xa3231a;};'use strict';var _=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var moment=require(_0xe9ae('0x2'));var BPromise=require(_0xe9ae('0x3'));var rs=require(_0xe9ae('0x4'));var fs=require('fs');var Redis=require(_0xe9ae('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9ae('0x6'));var config=require('../../config/environment');var jayson=require(_0xe9ae('0x7'));var client=jayson[_0xe9ae('0x8')][_0xe9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe61e51,_0x2cd275,_0x3c3f82){return new BPromise(function(_0x5448c8,_0x2c797e){return client[_0xe9ae('0xa')](_0xe61e51,_0x3c3f82)[_0xe9ae('0xb')](function(_0xfe0f7){logger[_0xe9ae('0xc')]('ZendeskField,\x20%s,\x20%s',_0x2cd275,_0xe9ae('0xd'));logger[_0xe9ae('0xe')](_0xe9ae('0xf'),_0x2cd275,'request\x20sent',JSON['stringify'](_0xfe0f7));if(_0xfe0f7[_0xe9ae('0x10')]){if(_0xfe0f7['error'][_0xe9ae('0x11')]===0x1f4){logger[_0xe9ae('0x10')](_0xe9ae('0x12'),_0x2cd275,_0xfe0f7[_0xe9ae('0x10')][_0xe9ae('0x13')]);return _0x2c797e(_0xfe0f7['error'][_0xe9ae('0x13')]);}logger[_0xe9ae('0x10')](_0xe9ae('0x12'),_0x2cd275,_0xfe0f7[_0xe9ae('0x10')][_0xe9ae('0x13')]);return _0x5448c8(_0xfe0f7['error'][_0xe9ae('0x13')]);}else{logger[_0xe9ae('0xc')](_0xe9ae('0x12'),_0x2cd275,'request\x20sent');_0x5448c8(_0xfe0f7[_0xe9ae('0x14')][_0xe9ae('0x13')]);}})['catch'](function(_0x407e35){logger[_0xe9ae('0x10')](_0xe9ae('0x12'),_0x2cd275,_0x407e35);_0x2c797e(_0x407e35);});});} \ No newline at end of file +var _0x74a1=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','code','error','message','result','catch'];(function(_0x5e883c,_0x493118){var _0x2de3e9=function(_0x440b80){while(--_0x440b80){_0x5e883c['push'](_0x5e883c['shift']());}};_0x2de3e9(++_0x493118);}(_0x74a1,0x1b0));var _0x174a=function(_0x123831,_0x8fe1d6){_0x123831=_0x123831-0x0;var _0x47455b=_0x74a1[_0x123831];return _0x47455b;};'use strict';var _=require(_0x174a('0x0'));var util=require('util');var moment=require(_0x174a('0x1'));var BPromise=require(_0x174a('0x2'));var rs=require(_0x174a('0x3'));var fs=require('fs');var Redis=require(_0x174a('0x4'));var db=require(_0x174a('0x5'))['db'];var utils=require(_0x174a('0x6'));var logger=require(_0x174a('0x7'))(_0x174a('0x8'));var config=require(_0x174a('0x9'));var jayson=require(_0x174a('0xa'));var client=jayson[_0x174a('0xb')][_0x174a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14464e,_0x36c23d,_0x114519){return new BPromise(function(_0x526f7e,_0x228d20){return client[_0x174a('0xd')](_0x14464e,_0x114519)[_0x174a('0xe')](function(_0x126b46){logger[_0x174a('0xf')](_0x174a('0x10'),_0x36c23d,_0x174a('0x11'));logger['debug'](_0x174a('0x12'),_0x36c23d,_0x174a('0x11'),JSON['stringify'](_0x126b46));if(_0x126b46['error']){if(_0x126b46['error'][_0x174a('0x13')]===0x1f4){logger[_0x174a('0x14')](_0x174a('0x10'),_0x36c23d,_0x126b46['error'][_0x174a('0x15')]);return _0x228d20(_0x126b46['error'][_0x174a('0x15')]);}logger[_0x174a('0x14')]('ZendeskField,\x20%s,\x20%s',_0x36c23d,_0x126b46['error'][_0x174a('0x15')]);return _0x526f7e(_0x126b46[_0x174a('0x14')]['message']);}else{logger[_0x174a('0xf')](_0x174a('0x10'),_0x36c23d,_0x174a('0x11'));_0x526f7e(_0x126b46[_0x174a('0x16')][_0x174a('0x15')]);}})[_0x174a('0x17')](function(_0x5b7b5d){logger[_0x174a('0x14')](_0x174a('0x10'),_0x36c23d,_0x5b7b5d);_0x228d20(_0x5b7b5d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 9aee68f..4928806 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 _0xf595=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3be2f5,_0x53447f){var _0x5dc05f=function(_0x4c4b48){while(--_0x4c4b48){_0x3be2f5['push'](_0x3be2f5['shift']());}};_0x5dc05f(++_0x53447f);}(_0xf595,0x15d));var _0x5f59=function(_0x43d1fd,_0x5ce01d){_0x43d1fd=_0x43d1fd-0x0;var _0x341d0a=_0xf595[_0x43d1fd];return _0x341d0a;};'use strict';var multer=require(_0x5f59('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5f59('0x1'));var express=require('express');var router=express[_0x5f59('0x2')]();var auth=require(_0x5f59('0x3'));var interaction=require(_0x5f59('0x4'));var config=require(_0x5f59('0x5'));var controller=require('./intZohoAccount.controller');router[_0x5f59('0x6')]('/',auth[_0x5f59('0x7')](),controller['index']);router[_0x5f59('0x6')](_0x5f59('0x8'),auth['isAuthenticated'](),controller[_0x5f59('0x9')]);router[_0x5f59('0x6')](_0x5f59('0xa'),auth[_0x5f59('0x7')](),controller[_0x5f59('0xb')]);router[_0x5f59('0x6')](_0x5f59('0xc'),auth[_0x5f59('0x7')](),controller[_0x5f59('0xd')]);router[_0x5f59('0xe')]('/',auth['isAuthenticated'](),controller[_0x5f59('0xf')]);router[_0x5f59('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5f59('0x10')]);router[_0x5f59('0x11')](_0x5f59('0x8'),auth[_0x5f59('0x7')](),controller[_0x5f59('0x12')]);router[_0x5f59('0x13')](_0x5f59('0x8'),auth[_0x5f59('0x7')](),controller['destroy']);module[_0x5f59('0x14')]=router; \ No newline at end of file +var _0x5770=['/:id/configurations','getConfigurations','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id'];(function(_0x57f9bb,_0x53d4bf){var _0x540dc9=function(_0x2fbb5f){while(--_0x2fbb5f){_0x57f9bb['push'](_0x57f9bb['shift']());}};_0x540dc9(++_0x53d4bf);}(_0x5770,0x8d));var _0x0577=function(_0x17c8cc,_0x5e5647){_0x17c8cc=_0x17c8cc-0x0;var _0x3db4eb=_0x5770[_0x17c8cc];return _0x3db4eb;};'use strict';var multer=require(_0x0577('0x0'));var util=require(_0x0577('0x1'));var path=require(_0x0577('0x2'));var timeout=require(_0x0577('0x3'));var express=require('express');var router=express[_0x0577('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0577('0x5'));var config=require(_0x0577('0x6'));var controller=require(_0x0577('0x7'));router[_0x0577('0x8')]('/',auth[_0x0577('0x9')](),controller['index']);router['get'](_0x0577('0xa'),auth[_0x0577('0x9')](),controller['show']);router[_0x0577('0x8')](_0x0577('0xb'),auth[_0x0577('0x9')](),controller[_0x0577('0xc')]);router['get']('/:id/fields',auth[_0x0577('0x9')](),controller['getFields']);router['post']('/',auth[_0x0577('0x9')](),controller[_0x0577('0xd')]);router['post']('/:id/configurations',auth[_0x0577('0x9')](),controller['addConfiguration']);router[_0x0577('0xe')](_0x0577('0xa'),auth['isAuthenticated'](),controller[_0x0577('0xf')]);router[_0x0577('0x10')](_0x0577('0xa'),auth[_0x0577('0x9')](),controller[_0x0577('0x11')]);module[_0x0577('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 5dedc90..38eb7d6 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 _0x0e2a=['STRING','exports'];(function(_0x39dac8,_0x981ece){var _0x310a98=function(_0x23ef4b){while(--_0x23ef4b){_0x39dac8['push'](_0x39dac8['shift']());}};_0x310a98(++_0x981ece);}(_0x0e2a,0xfb));var _0xa0e2=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x0e2a[_0x3b7a0c];return _0x3bb70f;};'use strict';var Sequelize=require('sequelize');module[_0xa0e2('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa0e2('0x1')]},'zone':{'type':Sequelize[_0xa0e2('0x1')]},'clientId':{'type':Sequelize[_0xa0e2('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0xa0e2('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x49c5=['STRING','sequelize'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x49c5,0x191));var _0x549c=function(_0x4df1d5,_0xc0749d){_0x4df1d5=_0x4df1d5-0x0;var _0x1a62dd=_0x49c5[_0x4df1d5];return _0x1a62dd;};'use strict';var Sequelize=require(_0x549c('0x0'));module['exports']={'name':{'type':Sequelize[_0x549c('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x549c('0x1')]},'zone':{'type':Sequelize[_0x549c('0x1')]},'clientId':{'type':Sequelize[_0x549c('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x549c('0x1')]},'code':{'type':Sequelize[_0x549c('0x1')]},'refreshToken':{'type':Sequelize[_0x549c('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 900e37b..07506cd 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 _0x1609=['response','Owner','Subject','Call_Result','Call_Start_Time','Call_Type','remove','includes','system_mandatory','display_label','custom_field','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\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','then','destroy','stack','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','rows','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZohoField','Descriptions','zone','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','com','serverUrl','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1609,0x99));var _0x9160=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x1609[_0xbb091];return _0x467a04;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9160('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9160('0x1'));var jsonpatch=require(_0x9160('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9160('0x3'));var Mustache=require('mustache');var util=require(_0x9160('0x4'));var path=require(_0x9160('0x5'));var sox=require(_0x9160('0x6'));var csv=require(_0x9160('0x7'));var ejs=require(_0x9160('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9160('0x9'));var crypto=require(_0x9160('0xa'));var jsforce=require(_0x9160('0xb'));var deskjs=require(_0x9160('0xc'));var toCsv=require(_0x9160('0x7'));var querystring=require(_0x9160('0xd'));var Papa=require(_0x9160('0xe'));var Redis=require('ioredis');var authService=require(_0x9160('0xf'));var qs=require(_0x9160('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9160('0x11'));var logger=require(_0x9160('0x12'))(_0x9160('0x13'));var utils=require('../../config/utils');var config=require(_0x9160('0x14'));var db=require(_0x9160('0x15'))['db'];var integrations=require(_0x9160('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x9160('0x17')][_0x9160('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4ebb56,_0x7e2382,_0x53f647){if(_0x53f647){var _0x20928e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20928e[_0x9160('0x19')](_0x7e2382)){return _0x4ebb56;}else{throw new db['Sequelize'][(_0x9160('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 _0x4ebb56;}}function respondWithRpcPromise(_0x5d5652,_0x26a13f,_0x400de3,_0x1f6d14){return new BPromise(function(_0x3819da,_0x2edb99){var _0x4953ed=_0x1f6d14||client;return _0x4953ed['request'](_0x5d5652,_0x400de3)['then'](function(_0x111bf2){logger[_0x9160('0x1b')](_0x9160('0x1c'),_0x26a13f,_0x9160('0x1d'));logger[_0x9160('0x1e')](_0x9160('0x1f'),_0x26a13f,_0x9160('0x1d'),JSON[_0x9160('0x20')](_0x111bf2));if(_0x111bf2[_0x9160('0x21')]){if(_0x111bf2[_0x9160('0x21')][_0x9160('0x22')]===0x1f4){logger[_0x9160('0x21')](_0x9160('0x1c'),_0x26a13f,_0x111bf2[_0x9160('0x21')][_0x9160('0x23')]);return _0x2edb99(_0x111bf2[_0x9160('0x21')]['message']);}logger[_0x9160('0x21')](_0x9160('0x1c'),_0x26a13f,_0x111bf2[_0x9160('0x21')]['message']);return _0x3819da(_0x111bf2[_0x9160('0x21')]['message']);}else{logger[_0x9160('0x1b')](_0x9160('0x1c'),_0x26a13f,_0x9160('0x1d'));_0x3819da(_0x111bf2[_0x9160('0x24')][_0x9160('0x23')]);}})[_0x9160('0x25')](function(_0x8f3171){logger[_0x9160('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x26a13f,_0x8f3171);_0x2edb99(_0x8f3171);});});}function respondWithStatusCode(_0x124a78,_0x5d61fe){_0x5d61fe=_0x5d61fe||0xcc;return function(_0x2ba33e){if(_0x2ba33e){return _0x124a78[_0x9160('0x26')](_0x5d61fe);}return _0x124a78[_0x9160('0x27')](_0x5d61fe)[_0x9160('0x28')]();};}function respondWithResult(_0x134d28,_0x2f3389){_0x2f3389=_0x2f3389||0xc8;return function(_0x45a3dd){if(_0x45a3dd){return _0x134d28[_0x9160('0x27')](_0x2f3389)[_0x9160('0x29')](_0x45a3dd);}};}function respondWithFilteredResult(_0x242c3b,_0x4a93e4){return function(_0x924d29){if(_0x924d29){var _0x560172=_0x924d29[_0x9160('0x2a')],_0x1111f4=_0x4a93e4[_0x9160('0x2b')],_0x3e9682=_0x4a93e4[_0x9160('0x2b')]+_0x4a93e4[_0x9160('0x2c')],_0x5b4dd3;if(_0x3e9682>=_0x560172){_0x3e9682=_0x560172;_0x5b4dd3=0xc8;}else{_0x5b4dd3=0xce;}_0x242c3b[_0x9160('0x27')](_0x5b4dd3);return _0x242c3b[_0x9160('0x2d')](_0x9160('0x2e'),_0x1111f4+'-'+_0x3e9682+'/'+_0x560172)['json'](_0x924d29);}return null;};}function patchUpdates(_0x47e84a){return function(_0x4657c5){try{jsonpatch[_0x9160('0x2f')](_0x4657c5,_0x47e84a,!![]);}catch(_0x56ccd7){return BPromise[_0x9160('0x30')](_0x56ccd7);}return _0x4657c5['save']();};}function saveUpdates(_0x1ef795,_0x2124e3){return function(_0x3f5ab1){if(_0x3f5ab1){return _0x3f5ab1[_0x9160('0x31')](_0x1ef795)[_0x9160('0x32')](function(_0x47fda5){return _0x47fda5;});}return null;};}function removeEntity(_0x22937b,_0x18362e){return function(_0x12c7c3){if(_0x12c7c3){return _0x12c7c3[_0x9160('0x33')]()[_0x9160('0x32')](function(){_0x22937b[_0x9160('0x27')](0xcc)[_0x9160('0x28')]();});}};}function handleEntityNotFound(_0xa43a4d,_0x44db75){return function(_0x24bb08){if(!_0x24bb08){_0xa43a4d[_0x9160('0x26')](0x194);}return _0x24bb08;};}function handleError(_0x3e8b68,_0x31a48e){_0x31a48e=_0x31a48e||0x1f4;return function(_0xfa4748){logger[_0x9160('0x21')](_0xfa4748[_0x9160('0x34')]);if(_0xfa4748['name']){delete _0xfa4748['name'];}_0x3e8b68[_0x9160('0x27')](_0x31a48e)[_0x9160('0x35')](_0xfa4748);};}exports[_0x9160('0x36')]=function(_0x396f9f,_0x553fbd){var _0xd130f3={},_0x4b7fde={},_0x45bd24={'count':0x0,'rows':[]};var _0x30f1b4=_[_0x9160('0x37')](db[_0x9160('0x38')][_0x9160('0x39')],function(_0x5f3797){return{'name':_0x5f3797[_0x9160('0x3a')],'type':_0x5f3797[_0x9160('0x3b')][_0x9160('0x3c')]};});_0x4b7fde[_0x9160('0x3d')]=_[_0x9160('0x37')](_0x30f1b4,_0x9160('0x3e'));_0x4b7fde['query']=_[_0x9160('0x3f')](_0x396f9f['query']);_0x4b7fde[_0x9160('0x40')]=_[_0x9160('0x41')](_0x4b7fde['model'],_0x4b7fde[_0x9160('0x42')]);_0xd130f3[_0x9160('0x43')]=_['intersection'](_0x4b7fde[_0x9160('0x3d')],qs[_0x9160('0x44')](_0x396f9f[_0x9160('0x42')][_0x9160('0x44')]));_0xd130f3['attributes']=_0xd130f3[_0x9160('0x43')][_0x9160('0x45')]?_0xd130f3[_0x9160('0x43')]:_0x4b7fde[_0x9160('0x3d')];if(!_0x396f9f[_0x9160('0x42')][_0x9160('0x46')](_0x9160('0x47'))){_0xd130f3[_0x9160('0x2c')]=qs[_0x9160('0x2c')](_0x396f9f[_0x9160('0x42')][_0x9160('0x2c')]);_0xd130f3[_0x9160('0x2b')]=qs[_0x9160('0x2b')](_0x396f9f[_0x9160('0x42')][_0x9160('0x2b')]);}_0xd130f3[_0x9160('0x48')]=qs[_0x9160('0x49')](_0x396f9f[_0x9160('0x42')][_0x9160('0x49')]);_0xd130f3['where']=qs[_0x9160('0x40')](_[_0x9160('0x4a')](_0x396f9f[_0x9160('0x42')],_0x4b7fde['filters']),_0x30f1b4);if(_0x396f9f['query'][_0x9160('0x4b')]){_0xd130f3['where']=_[_0x9160('0x4c')](_0xd130f3['where'],{'$or':_[_0x9160('0x37')](_0x30f1b4,function(_0xf0ceba){if(_0xf0ceba[_0x9160('0x3b')]!==_0x9160('0x4d')){var _0x4852ea={};_0x4852ea[_0xf0ceba[_0x9160('0x3e')]]={'$like':'%'+_0x396f9f['query'][_0x9160('0x4b')]+'%'};return _0x4852ea;}})});}_0xd130f3=_[_0x9160('0x4c')]({},_0xd130f3,_0x396f9f[_0x9160('0x4e')]);var _0x209a26={'where':_0xd130f3[_0x9160('0x4f')]};return db[_0x9160('0x38')][_0x9160('0x2a')](_0x209a26)[_0x9160('0x32')](function(_0x592f74){_0x45bd24[_0x9160('0x2a')]=_0x592f74;if(_0x396f9f['query'][_0x9160('0x50')]){_0xd130f3[_0x9160('0x51')]=[{'all':!![]}];}return db[_0x9160('0x38')]['findAll'](_0xd130f3);})['then'](function(_0x356057){_0x45bd24[_0x9160('0x52')]=_0x356057;return _0x45bd24;})['then'](respondWithFilteredResult(_0x553fbd,_0xd130f3))['catch'](handleError(_0x553fbd,null));};exports[_0x9160('0x53')]=function(_0x34125e,_0xfc89b){var _0x540963={'raw':![],'where':{'id':_0x34125e[_0x9160('0x54')]['id']}},_0x1de247={};_0x1de247[_0x9160('0x3d')]=_[_0x9160('0x3f')](db['ZohoAccount'][_0x9160('0x39')]);_0x1de247['query']=_[_0x9160('0x3f')](_0x34125e[_0x9160('0x42')]);_0x1de247[_0x9160('0x40')]=_[_0x9160('0x41')](_0x1de247[_0x9160('0x3d')],_0x1de247[_0x9160('0x42')]);_0x540963[_0x9160('0x43')]=_['intersection'](_0x1de247['model'],qs[_0x9160('0x44')](_0x34125e['query'][_0x9160('0x44')]));_0x540963[_0x9160('0x43')]=_0x540963[_0x9160('0x43')]['length']?_0x540963[_0x9160('0x43')]:_0x1de247[_0x9160('0x3d')];if(_0x34125e[_0x9160('0x42')][_0x9160('0x50')]){_0x540963[_0x9160('0x51')]=[{'all':!![]}];}_0x540963=_[_0x9160('0x4c')]({},_0x540963,_0x34125e[_0x9160('0x4e')]);return db[_0x9160('0x38')][_0x9160('0x55')](_0x540963)[_0x9160('0x32')](handleEntityNotFound(_0xfc89b,null))[_0x9160('0x32')](respondWithResult(_0xfc89b,null))[_0x9160('0x25')](handleError(_0xfc89b,null));};exports[_0x9160('0x56')]=function(_0x53febf,_0x412031){return db[_0x9160('0x38')][_0x9160('0x56')](_0x53febf[_0x9160('0x57')],{})[_0x9160('0x32')](respondWithResult(_0x412031,0xc9))[_0x9160('0x25')](handleError(_0x412031,null));};exports[_0x9160('0x31')]=function(_0x544c9b,_0x356fd1){if(_0x544c9b['body']['id']){delete _0x544c9b['body']['id'];}return db[_0x9160('0x38')][_0x9160('0x55')]({'where':{'id':_0x544c9b[_0x9160('0x54')]['id']}})['then'](handleEntityNotFound(_0x356fd1,null))[_0x9160('0x32')](saveUpdates(_0x544c9b[_0x9160('0x57')],null))['then'](respondWithResult(_0x356fd1,null))[_0x9160('0x25')](handleError(_0x356fd1,null));};exports[_0x9160('0x33')]=function(_0x1d3844,_0x28187c){return db[_0x9160('0x38')][_0x9160('0x55')]({'where':{'id':_0x1d3844['params']['id']}})['then'](handleEntityNotFound(_0x28187c,null))[_0x9160('0x32')](removeEntity(_0x28187c,null))[_0x9160('0x25')](handleError(_0x28187c,null));};exports[_0x9160('0x58')]=function(_0x5b5508,_0x45987c,_0xc49af4){var _0x130fdb={};var _0x2d2912={};var _0x268a94;var _0x5145ea;return db[_0x9160('0x38')][_0x9160('0x59')]({'where':{'id':_0x5b5508['params']['id']}})[_0x9160('0x32')](handleEntityNotFound(_0x45987c,null))[_0x9160('0x32')](function(_0x35a61a){if(_0x35a61a){_0x268a94=_0x35a61a;_0x2d2912[_0x9160('0x3d')]=_['keys'](db[_0x9160('0x5a')][_0x9160('0x39')]);_0x2d2912[_0x9160('0x42')]=_[_0x9160('0x3f')](_0x5b5508[_0x9160('0x42')]);_0x2d2912[_0x9160('0x40')]=_[_0x9160('0x41')](_0x2d2912[_0x9160('0x3d')],_0x2d2912[_0x9160('0x42')]);_0x130fdb['attributes']=_[_0x9160('0x41')](_0x2d2912[_0x9160('0x3d')],qs[_0x9160('0x44')](_0x5b5508[_0x9160('0x42')][_0x9160('0x44')]));_0x130fdb[_0x9160('0x43')]=_0x130fdb['attributes'][_0x9160('0x45')]?_0x130fdb[_0x9160('0x43')]:_0x2d2912[_0x9160('0x3d')];_0x130fdb[_0x9160('0x48')]=qs[_0x9160('0x49')](_0x5b5508[_0x9160('0x42')][_0x9160('0x49')]);_0x130fdb['where']=qs['filters'](_[_0x9160('0x4a')](_0x5b5508['query'],_0x2d2912[_0x9160('0x40')]));if(_0x5b5508['query']['filter']){_0x130fdb[_0x9160('0x4f')]=_[_0x9160('0x4c')](_0x130fdb[_0x9160('0x4f')],{'$or':_['map'](_0x130fdb[_0x9160('0x43')],function(_0x1af7ee){var _0x8c9a8b={};_0x8c9a8b[_0x1af7ee]={'$like':'%'+_0x5b5508[_0x9160('0x42')][_0x9160('0x4b')]+'%'};return _0x8c9a8b;})});}_0x130fdb=_[_0x9160('0x4c')]({},_0x130fdb,_0x5b5508[_0x9160('0x4e')]);return _0x268a94[_0x9160('0x58')](_0x130fdb);}})[_0x9160('0x32')](function(_0x31e309){if(_0x31e309){_0x5145ea=_0x31e309[_0x9160('0x45')];if(!_0x5b5508[_0x9160('0x42')][_0x9160('0x46')](_0x9160('0x47'))){_0x130fdb['limit']=qs[_0x9160('0x2c')](_0x5b5508[_0x9160('0x42')][_0x9160('0x2c')]);_0x130fdb[_0x9160('0x2b')]=qs['offset'](_0x5b5508[_0x9160('0x42')]['offset']);}return _0x268a94[_0x9160('0x58')](_0x130fdb);}})[_0x9160('0x32')](function(_0x2aa4b8){if(_0x2aa4b8){return _0x2aa4b8?{'count':_0x5145ea,'rows':_0x2aa4b8}:null;}})['then'](respondWithResult(_0x45987c,null))[_0x9160('0x25')](handleError(_0x45987c,null));};exports[_0x9160('0x5b')]=function(_0x2bfc1b,_0x4feacb,_0x270671){if(_0x2bfc1b[_0x9160('0x57')]['id']){delete _0x2bfc1b[_0x9160('0x57')]['id'];}return db['ZohoAccount'][_0x9160('0x59')]({'where':{'id':_0x2bfc1b[_0x9160('0x54')]['id']}})[_0x9160('0x32')](handleEntityNotFound(_0x4feacb,null))[_0x9160('0x32')](function(_0x35fc6e){if(_0x35fc6e){_0x2bfc1b[_0x9160('0x57')][_0x9160('0x5c')]=_0x35fc6e['id'];_0x2bfc1b[_0x9160('0x57')][_0x9160('0x5d')]=integrations[_0x9160('0x5e')](_0x2bfc1b[_0x9160('0x57')]['channel'],_0x2bfc1b[_0x9160('0x57')][_0x9160('0x3b')]);_0x2bfc1b[_0x9160('0x57')]['Descriptions']=integrations[_0x9160('0x5f')](_0x2bfc1b[_0x9160('0x57')][_0x9160('0x60')],_0x2bfc1b[_0x9160('0x57')][_0x9160('0x3b')]);return db[_0x9160('0x5a')][_0x9160('0x56')](_0x2bfc1b[_0x9160('0x57')],{'include':[{'model':db[_0x9160('0x61')],'as':'Subjects'},{'model':db[_0x9160('0x61')],'as':_0x9160('0x62')}]});}return null;})[_0x9160('0x32')](respondWithResult(_0x4feacb,null))['catch'](handleError(_0x4feacb,null));};function getAccessToken(_0x4ec63a){return new Promise(function(_0x4c8b21,_0x3c1995){var _0x288e7c;switch(_0x4ec63a[_0x9160('0x63')]){case'US':_0x288e7c='https://accounts.zoho.com';break;case'AU':_0x288e7c='https://accounts.zoho.com.au';break;case'EU':_0x288e7c=_0x9160('0x64');break;case'IN':_0x288e7c='https://accounts.zoho.in';break;case'CN':_0x288e7c=_0x9160('0x65');break;default:_0x288e7c='https://accounts.zoho.eu';break;}var _0x20990f={'method':_0x9160('0x66'),'uri':_0x288e7c+_0x9160('0x67'),'qs':{'refresh_token':_0x4ec63a[_0x9160('0x68')],'client_id':_0x4ec63a[_0x9160('0x69')],'client_secret':_0x4ec63a['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x20990f)['then'](function(_0x2e064e){if(_0x2e064e[_0x9160('0x6a')]){_0x4c8b21(_0x2e064e[_0x9160('0x6a')]);}else{_0x3c1995(_0x9160('0x6b'));}})[_0x9160('0x25')](function(_0x3b38c7){_0x3c1995(_0x3b38c7);});});}exports[_0x9160('0x6c')]=function(_0x2403f1,_0x522138,_0x2d0e77){var _0x50bbe5,_0x436640,_0x1931cd,_0xf36bfa,_0x5ac0fc;return db[_0x9160('0x38')][_0x9160('0x59')]({'where':{'id':_0x2403f1['params']['id']},'attributes':['id',_0x9160('0x6d'),'zone',_0x9160('0x69'),_0x9160('0x6e'),'serverUrl',_0x9160('0x22'),'refreshToken']})[_0x9160('0x32')](handleEntityNotFound(_0x522138,null))[_0x9160('0x32')](function(_0x1497b6){_0x5ac0fc=_0x1497b6;_0x50bbe5=_0x5ac0fc[_0x9160('0x6d')];_0x436640=_0x50bbe5==='zoho.eu'?'eu':_0x9160('0x6f');_0x1931cd=_0x5ac0fc[_0x9160('0x70')];var _0x103370=_0x1931cd[_0x9160('0x71')](-0x1);if(_0x103370==='/'||_0x103370==='\x5c'||_0x103370===':'){_0x1931cd=_0x1931cd['substring'](0x0,_0x1931cd[_0x9160('0x72')](_0x103370));}if(!_0x5ac0fc[_0x9160('0x68')]){throw new Error(_0x9160('0x73'));}return getAccessToken(_0x5ac0fc);})[_0x9160('0x32')](function(_0x27cc8c){if(_0x27cc8c){return rp({'method':_0x9160('0x74'),'uri':util[_0x9160('0x75')](_0x9160('0x76'),_0x436640),'qs':{'module':_0x9160('0x77')},'headers':{'Authorization':_0x9160('0x78')+_0x27cc8c},'json':!![]});}})[_0x9160('0x32')](function(_0x9ebdb9){if(_0x9ebdb9){if(_0x9ebdb9[_0x9160('0x79')]&&_0x9ebdb9[_0x9160('0x79')][_0x9160('0x21')]){throw new Error(_0x9ebdb9[_0x9160('0x79')][_0x9160('0x21')][_0x9160('0x23')]);}var _0x5e3017=[];var _0x185b11=[];var _0x1f5d64=[_0x9160('0x7a'),_0x9160('0x7b'),'Description','WhoId','Call_Duration',_0x9160('0x7c'),_0x9160('0x7d'),_0x9160('0x7e')];_0x185b11=_[_0x9160('0x7f')](_0x9ebdb9['fields'],function(_0x5e6292){return _0x1f5d64[_0x9160('0x80')](_0x5e6292['api_name']);});for(var _0x427035=0x0;_0x427035<_0x185b11[_0x9160('0x45')];_0x427035++){if(_0x185b11[_0x427035][_0x9160('0x81')]===![]){_0x5e3017['push']({'id':_0x185b11[_0x427035]['id'],'name':_0x185b11[_0x427035][_0x9160('0x82')],'custom':_0x185b11[_0x427035][_0x9160('0x83')],'options':_0x185b11[_0x427035]['data_type']===_0x9160('0x84')&&_0x185b11[_0x427035]['pick_list_values'][_0x9160('0x45')]>-0x1?_['map'](_0x185b11[_0x427035][_0x9160('0x85')],function(_0x2126ed){return{'name':_0x2126ed,'value':_0x2126ed};}):[]});}}return{'count':_0x5e3017[_0x9160('0x45')],'rows':_0x5e3017};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x522138,null))['catch'](function(_0x5521c6){var _0x525dcc=_0x2403f1[_0x9160('0x42')]['test']?0x1f4:_0x5521c6[_0x9160('0x86')]||0x1f4;logger[_0x9160('0x21')](_0x9160('0x87'),_0x9160('0x6c'),_0x525dcc,JSON['stringify'](_0x5521c6));delete _0x5521c6[_0x9160('0x3e')];if(_0x525dcc===0x191){_0x525dcc=0x190;}_0x522138[_0x9160('0x27')](_0x525dcc)[_0x9160('0x35')](_0x2403f1[_0x9160('0x42')][_0x9160('0x19')]?{'message':_0x9160('0x88'),'statusCode':_0x5521c6[_0x9160('0x86')]}:_0x5521c6);});}; \ No newline at end of file +var _0xe65e=['count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','include','find','create','body','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','Descriptions','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','host','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','WhoId','Call_Duration','Call_Result','Call_Type','includes','api_name','system_mandatory','push','display_label','pick_list_values','statusCode','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../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~!@#$%^&-_=+[{]}.','request','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xe65e,0x17a));var _0xee65=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe65e[_0x199572];return _0x13cfa3;};'use strict';var pdf=require(_0xee65('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xee65('0x1'));var zipdir=require(_0xee65('0x2'));var jsonpatch=require(_0xee65('0x3'));var rp=require(_0xee65('0x4'));var moment=require(_0xee65('0x5'));var BPromise=require(_0xee65('0x6'));var Mustache=require(_0xee65('0x7'));var util=require(_0xee65('0x8'));var path=require('path');var sox=require(_0xee65('0x9'));var csv=require('to-csv');var ejs=require(_0xee65('0xa'));var fs=require('fs');var _=require(_0xee65('0xb'));var squel=require('squel');var crypto=require(_0xee65('0xc'));var jsforce=require(_0xee65('0xd'));var deskjs=require(_0xee65('0xe'));var toCsv=require('to-csv');var querystring=require(_0xee65('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xee65('0x10'));var qs=require(_0xee65('0x11'));var as=require(_0xee65('0x12'));var hardwareService=require(_0xee65('0x13'));var logger=require(_0xee65('0x14'))(_0xee65('0x15'));var utils=require('../../config/utils');var config=require(_0xee65('0x16'));var db=require(_0xee65('0x17'))['db'];var integrations=require(_0xee65('0x18'));var jayson=require('jayson/promise');var client=jayson['client'][_0xee65('0x19')]({'port':0x232a});function checkPasswordPattern(_0x13e1e3,_0x39d21b,_0x51c198){if(_0x51c198){var _0x34cab1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34cab1[_0xee65('0x1a')](_0x39d21b)){return _0x13e1e3;}else{throw new db[(_0xee65('0x1b'))]['ValidationError'](_0xee65('0x1c'));}}else{return _0x13e1e3;}}function respondWithRpcPromise(_0x3da738,_0x2a3249,_0x393f5c,_0x1aa4d1){return new BPromise(function(_0x5c71a1,_0x4dda12){var _0x5961b2=_0x1aa4d1||client;return _0x5961b2[_0xee65('0x1d')](_0x3da738,_0x393f5c)[_0xee65('0x1e')](function(_0x49c087){logger['info'](_0xee65('0x1f'),_0x2a3249,_0xee65('0x20'));logger[_0xee65('0x21')](_0xee65('0x22'),_0x2a3249,'request\x20sent',JSON[_0xee65('0x23')](_0x49c087));if(_0x49c087[_0xee65('0x24')]){if(_0x49c087[_0xee65('0x24')][_0xee65('0x25')]===0x1f4){logger[_0xee65('0x24')]('ZohoAccount,\x20%s,\x20%s',_0x2a3249,_0x49c087['error'][_0xee65('0x26')]);return _0x4dda12(_0x49c087[_0xee65('0x24')][_0xee65('0x26')]);}logger['error'](_0xee65('0x1f'),_0x2a3249,_0x49c087[_0xee65('0x24')]['message']);return _0x5c71a1(_0x49c087[_0xee65('0x24')][_0xee65('0x26')]);}else{logger[_0xee65('0x27')]('ZohoAccount,\x20%s,\x20%s',_0x2a3249,_0xee65('0x20'));_0x5c71a1(_0x49c087[_0xee65('0x28')]['message']);}})[_0xee65('0x29')](function(_0x273dfd){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x2a3249,_0x273dfd);_0x4dda12(_0x273dfd);});});}function respondWithStatusCode(_0x5c4f52,_0x5b40c0){_0x5b40c0=_0x5b40c0||0xcc;return function(_0x1ab1ab){if(_0x1ab1ab){return _0x5c4f52['sendStatus'](_0x5b40c0);}return _0x5c4f52[_0xee65('0x2a')](_0x5b40c0)[_0xee65('0x2b')]();};}function respondWithResult(_0x29f61c,_0x5c0d17){_0x5c0d17=_0x5c0d17||0xc8;return function(_0x2fd3b2){if(_0x2fd3b2){return _0x29f61c[_0xee65('0x2a')](_0x5c0d17)[_0xee65('0x2c')](_0x2fd3b2);}};}function respondWithFilteredResult(_0x315648,_0x5cfa68){return function(_0x3eb5ae){if(_0x3eb5ae){var _0x4b290d=_0x3eb5ae[_0xee65('0x2d')],_0x2ae08b=_0x5cfa68[_0xee65('0x2e')],_0x10ac1c=_0x5cfa68[_0xee65('0x2e')]+_0x5cfa68['limit'],_0x586f9;if(_0x10ac1c>=_0x4b290d){_0x10ac1c=_0x4b290d;_0x586f9=0xc8;}else{_0x586f9=0xce;}_0x315648[_0xee65('0x2a')](_0x586f9);return _0x315648[_0xee65('0x2f')](_0xee65('0x30'),_0x2ae08b+'-'+_0x10ac1c+'/'+_0x4b290d)[_0xee65('0x2c')](_0x3eb5ae);}return null;};}function patchUpdates(_0x2acf1e){return function(_0x501ca2){try{jsonpatch[_0xee65('0x31')](_0x501ca2,_0x2acf1e,!![]);}catch(_0x2e3cc2){return BPromise[_0xee65('0x32')](_0x2e3cc2);}return _0x501ca2[_0xee65('0x33')]();};}function saveUpdates(_0x5cd07a,_0xacd149){return function(_0x53f37c){if(_0x53f37c){return _0x53f37c[_0xee65('0x34')](_0x5cd07a)[_0xee65('0x1e')](function(_0x242859){return _0x242859;});}return null;};}function removeEntity(_0x56a8e3,_0x33a074){return function(_0x220a11){if(_0x220a11){return _0x220a11[_0xee65('0x35')]()[_0xee65('0x1e')](function(){_0x56a8e3[_0xee65('0x2a')](0xcc)[_0xee65('0x2b')]();});}};}function handleEntityNotFound(_0x3173fa,_0x41a0da){return function(_0x266422){if(!_0x266422){_0x3173fa[_0xee65('0x36')](0x194);}return _0x266422;};}function handleError(_0x1d768f,_0x4c0138){_0x4c0138=_0x4c0138||0x1f4;return function(_0x4edcb8){logger[_0xee65('0x24')](_0x4edcb8[_0xee65('0x37')]);if(_0x4edcb8[_0xee65('0x38')]){delete _0x4edcb8[_0xee65('0x38')];}_0x1d768f[_0xee65('0x2a')](_0x4c0138)[_0xee65('0x39')](_0x4edcb8);};}exports['index']=function(_0x86a18c,_0x5a739b){var _0x4fba9d={},_0x2835af={},_0x13dae3={'count':0x0,'rows':[]};var _0x34a787=_[_0xee65('0x3a')](db[_0xee65('0x3b')][_0xee65('0x3c')],function(_0x27b060){return{'name':_0x27b060[_0xee65('0x3d')],'type':_0x27b060[_0xee65('0x3e')][_0xee65('0x3f')]};});_0x2835af['model']=_[_0xee65('0x3a')](_0x34a787,'name');_0x2835af[_0xee65('0x40')]=_[_0xee65('0x41')](_0x86a18c[_0xee65('0x40')]);_0x2835af[_0xee65('0x42')]=_[_0xee65('0x43')](_0x2835af[_0xee65('0x44')],_0x2835af[_0xee65('0x40')]);_0x4fba9d[_0xee65('0x45')]=_[_0xee65('0x43')](_0x2835af[_0xee65('0x44')],qs[_0xee65('0x46')](_0x86a18c[_0xee65('0x40')][_0xee65('0x46')]));_0x4fba9d[_0xee65('0x45')]=_0x4fba9d[_0xee65('0x45')][_0xee65('0x47')]?_0x4fba9d[_0xee65('0x45')]:_0x2835af[_0xee65('0x44')];if(!_0x86a18c['query'][_0xee65('0x48')](_0xee65('0x49'))){_0x4fba9d[_0xee65('0x4a')]=qs[_0xee65('0x4a')](_0x86a18c[_0xee65('0x40')][_0xee65('0x4a')]);_0x4fba9d['offset']=qs[_0xee65('0x2e')](_0x86a18c['query'][_0xee65('0x2e')]);}_0x4fba9d[_0xee65('0x4b')]=qs[_0xee65('0x4c')](_0x86a18c[_0xee65('0x40')]['sort']);_0x4fba9d[_0xee65('0x4d')]=qs['filters'](_[_0xee65('0x4e')](_0x86a18c[_0xee65('0x40')],_0x2835af[_0xee65('0x42')]),_0x34a787);if(_0x86a18c['query'][_0xee65('0x4f')]){_0x4fba9d[_0xee65('0x4d')]=_[_0xee65('0x50')](_0x4fba9d[_0xee65('0x4d')],{'$or':_[_0xee65('0x3a')](_0x34a787,function(_0xfabdae){if(_0xfabdae[_0xee65('0x3e')]!==_0xee65('0x51')){var _0x575d2b={};_0x575d2b[_0xfabdae[_0xee65('0x38')]]={'$like':'%'+_0x86a18c[_0xee65('0x40')][_0xee65('0x4f')]+'%'};return _0x575d2b;}})});}_0x4fba9d=_[_0xee65('0x50')]({},_0x4fba9d,_0x86a18c[_0xee65('0x52')]);var _0x178135={'where':_0x4fba9d[_0xee65('0x4d')]};return db[_0xee65('0x3b')][_0xee65('0x2d')](_0x178135)[_0xee65('0x1e')](function(_0x1cbeeb){_0x13dae3['count']=_0x1cbeeb;if(_0x86a18c[_0xee65('0x40')]['includeAll']){_0x4fba9d['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xee65('0x53')](_0x4fba9d);})[_0xee65('0x1e')](function(_0x3788b6){_0x13dae3[_0xee65('0x54')]=_0x3788b6;return _0x13dae3;})[_0xee65('0x1e')](respondWithFilteredResult(_0x5a739b,_0x4fba9d))[_0xee65('0x29')](handleError(_0x5a739b,null));};exports[_0xee65('0x55')]=function(_0x238411,_0x1804d4){var _0x1696a6={'raw':![],'where':{'id':_0x238411[_0xee65('0x56')]['id']}},_0x5deea0={};_0x5deea0[_0xee65('0x44')]=_[_0xee65('0x41')](db[_0xee65('0x3b')][_0xee65('0x3c')]);_0x5deea0[_0xee65('0x40')]=_[_0xee65('0x41')](_0x238411[_0xee65('0x40')]);_0x5deea0[_0xee65('0x42')]=_[_0xee65('0x43')](_0x5deea0[_0xee65('0x44')],_0x5deea0[_0xee65('0x40')]);_0x1696a6[_0xee65('0x45')]=_['intersection'](_0x5deea0['model'],qs[_0xee65('0x46')](_0x238411[_0xee65('0x40')][_0xee65('0x46')]));_0x1696a6['attributes']=_0x1696a6[_0xee65('0x45')][_0xee65('0x47')]?_0x1696a6[_0xee65('0x45')]:_0x5deea0[_0xee65('0x44')];if(_0x238411[_0xee65('0x40')]['includeAll']){_0x1696a6[_0xee65('0x57')]=[{'all':!![]}];}_0x1696a6=_['merge']({},_0x1696a6,_0x238411['options']);return db[_0xee65('0x3b')][_0xee65('0x58')](_0x1696a6)['then'](handleEntityNotFound(_0x1804d4,null))[_0xee65('0x1e')](respondWithResult(_0x1804d4,null))['catch'](handleError(_0x1804d4,null));};exports[_0xee65('0x59')]=function(_0x6fd6dc,_0x5481fe){return db['ZohoAccount']['create'](_0x6fd6dc[_0xee65('0x5a')],{})['then'](respondWithResult(_0x5481fe,0xc9))[_0xee65('0x29')](handleError(_0x5481fe,null));};exports['update']=function(_0x1bdbcd,_0x437c5f){if(_0x1bdbcd['body']['id']){delete _0x1bdbcd['body']['id'];}return db[_0xee65('0x3b')][_0xee65('0x58')]({'where':{'id':_0x1bdbcd[_0xee65('0x56')]['id']}})[_0xee65('0x1e')](handleEntityNotFound(_0x437c5f,null))['then'](saveUpdates(_0x1bdbcd['body'],null))[_0xee65('0x1e')](respondWithResult(_0x437c5f,null))[_0xee65('0x29')](handleError(_0x437c5f,null));};exports[_0xee65('0x35')]=function(_0x1b27c6,_0x3b5e4a){return db['ZohoAccount'][_0xee65('0x58')]({'where':{'id':_0x1b27c6[_0xee65('0x56')]['id']}})[_0xee65('0x1e')](handleEntityNotFound(_0x3b5e4a,null))[_0xee65('0x1e')](removeEntity(_0x3b5e4a,null))[_0xee65('0x29')](handleError(_0x3b5e4a,null));};exports['getConfigurations']=function(_0x2a0a5b,_0x5d9881,_0x4fe912){var _0x3f2378={};var _0x4b39f3={};var _0x8e661b;var _0x36a234;return db[_0xee65('0x3b')][_0xee65('0x5b')]({'where':{'id':_0x2a0a5b[_0xee65('0x56')]['id']}})['then'](handleEntityNotFound(_0x5d9881,null))[_0xee65('0x1e')](function(_0xebed15){if(_0xebed15){_0x8e661b=_0xebed15;_0x4b39f3[_0xee65('0x44')]=_['keys'](db[_0xee65('0x5c')][_0xee65('0x3c')]);_0x4b39f3[_0xee65('0x40')]=_['keys'](_0x2a0a5b[_0xee65('0x40')]);_0x4b39f3[_0xee65('0x42')]=_['intersection'](_0x4b39f3[_0xee65('0x44')],_0x4b39f3['query']);_0x3f2378[_0xee65('0x45')]=_[_0xee65('0x43')](_0x4b39f3[_0xee65('0x44')],qs[_0xee65('0x46')](_0x2a0a5b[_0xee65('0x40')][_0xee65('0x46')]));_0x3f2378[_0xee65('0x45')]=_0x3f2378['attributes'][_0xee65('0x47')]?_0x3f2378[_0xee65('0x45')]:_0x4b39f3[_0xee65('0x44')];_0x3f2378['order']=qs[_0xee65('0x4c')](_0x2a0a5b[_0xee65('0x40')][_0xee65('0x4c')]);_0x3f2378['where']=qs[_0xee65('0x42')](_[_0xee65('0x4e')](_0x2a0a5b[_0xee65('0x40')],_0x4b39f3[_0xee65('0x42')]));if(_0x2a0a5b['query'][_0xee65('0x4f')]){_0x3f2378[_0xee65('0x4d')]=_[_0xee65('0x50')](_0x3f2378[_0xee65('0x4d')],{'$or':_['map'](_0x3f2378[_0xee65('0x45')],function(_0x239925){var _0x190b93={};_0x190b93[_0x239925]={'$like':'%'+_0x2a0a5b['query'][_0xee65('0x4f')]+'%'};return _0x190b93;})});}_0x3f2378=_[_0xee65('0x50')]({},_0x3f2378,_0x2a0a5b[_0xee65('0x52')]);return _0x8e661b[_0xee65('0x5d')](_0x3f2378);}})[_0xee65('0x1e')](function(_0x4ba19b){if(_0x4ba19b){_0x36a234=_0x4ba19b[_0xee65('0x47')];if(!_0x2a0a5b[_0xee65('0x40')][_0xee65('0x48')](_0xee65('0x49'))){_0x3f2378[_0xee65('0x4a')]=qs[_0xee65('0x4a')](_0x2a0a5b[_0xee65('0x40')][_0xee65('0x4a')]);_0x3f2378['offset']=qs['offset'](_0x2a0a5b[_0xee65('0x40')]['offset']);}return _0x8e661b['getConfigurations'](_0x3f2378);}})['then'](function(_0x3fc928){if(_0x3fc928){return _0x3fc928?{'count':_0x36a234,'rows':_0x3fc928}:null;}})[_0xee65('0x1e')](respondWithResult(_0x5d9881,null))[_0xee65('0x29')](handleError(_0x5d9881,null));};exports[_0xee65('0x5e')]=function(_0x48f334,_0x33002d,_0x2470e0){if(_0x48f334[_0xee65('0x5a')]['id']){delete _0x48f334[_0xee65('0x5a')]['id'];}return db[_0xee65('0x3b')][_0xee65('0x5b')]({'where':{'id':_0x48f334[_0xee65('0x56')]['id']}})[_0xee65('0x1e')](handleEntityNotFound(_0x33002d,null))[_0xee65('0x1e')](function(_0x25cf77){if(_0x25cf77){_0x48f334[_0xee65('0x5a')][_0xee65('0x5f')]=_0x25cf77['id'];_0x48f334[_0xee65('0x5a')][_0xee65('0x60')]=integrations[_0xee65('0x61')](_0x48f334[_0xee65('0x5a')][_0xee65('0x62')],_0x48f334[_0xee65('0x5a')][_0xee65('0x3e')]);_0x48f334['body']['Descriptions']=integrations['getDescriptions'](_0x48f334[_0xee65('0x5a')][_0xee65('0x62')],_0x48f334[_0xee65('0x5a')][_0xee65('0x3e')]);return db['ZohoConfiguration'][_0xee65('0x59')](_0x48f334[_0xee65('0x5a')],{'include':[{'model':db[_0xee65('0x63')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xee65('0x64')}]});}return null;})['then'](respondWithResult(_0x33002d,null))['catch'](handleError(_0x33002d,null));};function getAccessToken(_0x10f5f2){return new Promise(function(_0x5a24bf,_0x4ce8ae){var _0x56baae;switch(_0x10f5f2['zone']){case'US':_0x56baae=_0xee65('0x65');break;case'AU':_0x56baae=_0xee65('0x66');break;case'EU':_0x56baae=_0xee65('0x67');break;case'IN':_0x56baae=_0xee65('0x68');break;case'CN':_0x56baae=_0xee65('0x69');break;default:_0x56baae='https://accounts.zoho.eu';break;}var _0x34ceba={'method':_0xee65('0x6a'),'uri':_0x56baae+_0xee65('0x6b'),'qs':{'refresh_token':_0x10f5f2[_0xee65('0x6c')],'client_id':_0x10f5f2[_0xee65('0x6d')],'client_secret':_0x10f5f2[_0xee65('0x6e')],'grant_type':_0xee65('0x6f')},'json':!![]};return rp(_0x34ceba)[_0xee65('0x1e')](function(_0x494cac){if(_0x494cac['access_token']){_0x5a24bf(_0x494cac['access_token']);}else{_0x4ce8ae(_0xee65('0x70'));}})[_0xee65('0x29')](function(_0x65a00a){_0x4ce8ae(_0x65a00a);});});}exports[_0xee65('0x71')]=function(_0x4305e2,_0xbca0ce,_0x2b17ac){var _0x3a71df,_0x26bcfe,_0x3f1423,_0x2355e2,_0xd392d6;return db[_0xee65('0x3b')]['findOne']({'where':{'id':_0x4305e2[_0xee65('0x56')]['id']},'attributes':['id','host',_0xee65('0x72'),_0xee65('0x6d'),_0xee65('0x6e'),_0xee65('0x73'),_0xee65('0x25'),'refreshToken']})[_0xee65('0x1e')](handleEntityNotFound(_0xbca0ce,null))[_0xee65('0x1e')](function(_0x14b60a){_0xd392d6=_0x14b60a;_0x3a71df=_0xd392d6[_0xee65('0x74')];_0x26bcfe=_0x3a71df==='zoho.eu'?'eu':_0xee65('0x75');_0x3f1423=_0xd392d6['serverUrl'];var _0x3d5f5f=_0x3f1423[_0xee65('0x76')](-0x1);if(_0x3d5f5f==='/'||_0x3d5f5f==='\x5c'||_0x3d5f5f===':'){_0x3f1423=_0x3f1423[_0xee65('0x77')](0x0,_0x3f1423[_0xee65('0x78')](_0x3d5f5f));}if(!_0xd392d6[_0xee65('0x6c')]){throw new Error(_0xee65('0x79'));}return getAccessToken(_0xd392d6);})[_0xee65('0x1e')](function(_0x30f112){if(_0x30f112){return rp({'method':_0xee65('0x7a'),'uri':util[_0xee65('0x7b')](_0xee65('0x7c'),_0x26bcfe),'qs':{'module':_0xee65('0x7d')},'headers':{'Authorization':_0xee65('0x7e')+_0x30f112},'json':!![]});}})[_0xee65('0x1e')](function(_0xc9fbdf){if(_0xc9fbdf){if(_0xc9fbdf[_0xee65('0x7f')]&&_0xc9fbdf[_0xee65('0x7f')]['error']){throw new Error(_0xc9fbdf['response'][_0xee65('0x24')]['message']);}var _0x496c2a=[];var _0x1cb447=[];var _0x572a36=['Owner',_0xee65('0x80'),'Description',_0xee65('0x81'),_0xee65('0x82'),_0xee65('0x83'),'Call_Start_Time',_0xee65('0x84')];_0x1cb447=_['remove'](_0xc9fbdf[_0xee65('0x46')],function(_0xcf9e2a){return _0x572a36[_0xee65('0x85')](_0xcf9e2a[_0xee65('0x86')]);});for(var _0x3d1efb=0x0;_0x3d1efb<_0x1cb447[_0xee65('0x47')];_0x3d1efb++){if(_0x1cb447[_0x3d1efb][_0xee65('0x87')]===![]){_0x496c2a[_0xee65('0x88')]({'id':_0x1cb447[_0x3d1efb]['id'],'name':_0x1cb447[_0x3d1efb][_0xee65('0x89')],'custom':_0x1cb447[_0x3d1efb]['custom_field'],'options':_0x1cb447[_0x3d1efb]['data_type']==='picklist'&&_0x1cb447[_0x3d1efb][_0xee65('0x8a')][_0xee65('0x47')]>-0x1?_['map'](_0x1cb447[_0x3d1efb][_0xee65('0x8a')],function(_0x3496c7){return{'name':_0x3496c7,'value':_0x3496c7};}):[]});}}return{'count':_0x496c2a[_0xee65('0x47')],'rows':_0x496c2a};}else{return{'count':0x0,'rows':[]};}})[_0xee65('0x1e')](respondWithResult(_0xbca0ce,null))[_0xee65('0x29')](function(_0x4044bb){var _0x543fc7=_0x4305e2['query'][_0xee65('0x1a')]?0x1f4:_0x4044bb[_0xee65('0x8b')]||0x1f4;logger[_0xee65('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xee65('0x71'),_0x543fc7,JSON[_0xee65('0x23')](_0x4044bb));delete _0x4044bb['name'];if(_0x543fc7===0x191){_0x543fc7=0x190;}_0xbca0ce[_0xee65('0x2a')](_0x543fc7)[_0xee65('0x39')](_0x4305e2[_0xee65('0x40')][_0xee65('0x1a')]?{'message':_0xee65('0x8c'),'statusCode':_0x4044bb[_0xee65('0x8b')]}:_0x4044bb);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 71b4c8f..9ebd431 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 _0x72e2=['changed','zone','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','moment','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts'];(function(_0x3f2cfe,_0x16fd1c){var _0x36c4ae=function(_0x5893cb){while(--_0x5893cb){_0x3f2cfe['push'](_0x3f2cfe['shift']());}};_0x36c4ae(++_0x16fd1c);}(_0x72e2,0x16f));var _0x272e=function(_0x209fdf,_0x31b8b7){_0x209fdf=_0x209fdf-0x0;var _0x2e2d99=_0x72e2[_0x209fdf];return _0x2e2d99;};'use strict';var _=require(_0x272e('0x0'));var util=require(_0x272e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x272e('0x2'));var BPromise=require(_0x272e('0x3'));var rp=require(_0x272e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x272e('0x5'));var attributes=require(_0x272e('0x6'));var integrations=require(_0x272e('0x7'));module[_0x272e('0x8')]=function(_0x49e933,_0x1d1355){return _0x49e933[_0x272e('0x9')]('ZohoAccount',attributes,{'tableName':_0x272e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x449158,_0x5f279c,_0x479ba0){if(_0x449158[_0x272e('0xb')](_0x272e('0xc'))||_0x449158['changed']('serverUrl')||_0x449158['changed']('clientId')||_0x449158[_0x272e('0xb')](_0x272e('0xd'))||_0x449158[_0x272e('0xb')](_0x272e('0xe'))||_0x449158[_0x272e('0xb')](_0x272e('0xf'))){var _0x125c1e,_0x46aa40;_0x125c1e=_0x449158[_0x272e('0x10')];var _0x1650b8=_0x125c1e[_0x272e('0x11')](-0x1);if(_0x1650b8==='/'||_0x1650b8==='\x5c'||_0x1650b8===':'){_0x125c1e=_0x125c1e[_0x272e('0x12')](0x0,_0x125c1e[_0x272e('0x13')](_0x1650b8));}switch(_0x449158[_0x272e('0xc')]){case'US':_0x46aa40=_0x272e('0x14');break;case'AU':_0x46aa40=_0x272e('0x15');break;case'IN':_0x46aa40=_0x272e('0x16');break;case'CN':_0x46aa40=_0x272e('0x17');break;default:_0x46aa40=_0x272e('0x18');break;}var _0x7d8c95={'method':_0x272e('0x19'),'uri':_0x46aa40+_0x272e('0x1a'),'form':{'grant_type':_0x272e('0x1b'),'client_id':_0x449158[_0x272e('0x1c')],'client_secret':_0x449158[_0x272e('0xd')],'redirect_uri':_0x449158['serverUrl'],'code':_0x449158[_0x272e('0xe')]},'headers':{'Content-Type':_0x272e('0x1d')}};return rp(_0x7d8c95)[_0x272e('0x1e')](function(_0x42c678){var _0x862c42=JSON[_0x272e('0x1f')](_0x42c678);if(_0x862c42[_0x272e('0x20')]){_0x449158[_0x272e('0x21')]=_0x862c42[_0x272e('0x20')];logger[_0x272e('0x22')](util[_0x272e('0x23')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x449158[_0x272e('0x24')],_0x449158['id']));}else{logger[_0x272e('0x25')](util['format'](_0x272e('0x26'),_0x449158[_0x272e('0x24')],_0x449158['id']),util[_0x272e('0x27')](_0x862c42,{'showHidden':![],'depth':null}));}return _0x479ba0(null,_0x5f279c);})[_0x272e('0x28')](function(_0x451fd8){logger['error'](util[_0x272e('0x23')](_0x272e('0x26'),_0x449158[_0x272e('0x24')],_0x449158['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x479ba0(_0x451fd8);});}else{return _0x479ba0(null,_0x5f279c);}},'beforeUpdate':function(_0x515566,_0x4cc13a,_0x35daed){if(_0x515566[_0x272e('0xb')]('zone')||_0x515566[_0x272e('0xb')]('serverUrl')||_0x515566[_0x272e('0xb')](_0x272e('0x1c'))||_0x515566[_0x272e('0xb')](_0x272e('0xd'))||_0x515566['changed']('code')||_0x515566[_0x272e('0xb')](_0x272e('0xf'))){var _0x6ffcad,_0x15c9e6;_0x6ffcad=_0x515566[_0x272e('0x10')];var _0x1b1a58=_0x6ffcad['slice'](-0x1);if(_0x1b1a58==='/'||_0x1b1a58==='\x5c'||_0x1b1a58===':'){_0x6ffcad=_0x6ffcad[_0x272e('0x12')](0x0,_0x6ffcad[_0x272e('0x13')](_0x1b1a58));}switch(_0x515566[_0x272e('0xc')]){case'US':_0x15c9e6=_0x272e('0x14');break;case'AU':_0x15c9e6='https://accounts.zoho.com.au';break;case'IN':_0x15c9e6='https://accounts.zoho.in';break;case'CN':_0x15c9e6=_0x272e('0x17');break;default:_0x15c9e6=_0x272e('0x18');break;}var _0x13befa={'method':_0x272e('0x19'),'uri':_0x15c9e6+_0x272e('0x1a'),'form':{'grant_type':_0x272e('0x1b'),'client_id':_0x515566['clientId'],'client_secret':_0x515566['clientSecret'],'redirect_uri':_0x515566['serverUrl'],'code':_0x515566['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x13befa)[_0x272e('0x1e')](function(_0x443840){var _0x3e2f44=JSON[_0x272e('0x1f')](_0x443840);if(_0x3e2f44[_0x272e('0x20')]){_0x515566[_0x272e('0x21')]=_0x3e2f44[_0x272e('0x20')];logger[_0x272e('0x22')](util[_0x272e('0x23')](_0x272e('0x29'),_0x515566[_0x272e('0x24')],_0x515566['id']));}else{logger[_0x272e('0x25')](util[_0x272e('0x23')](_0x272e('0x26'),_0x515566[_0x272e('0x24')],_0x515566['id']),util[_0x272e('0x27')](_0x3e2f44,{'showHidden':![],'depth':null}));}return _0x35daed(null,_0x4cc13a);})[_0x272e('0x28')](function(_0x3682c3){logger[_0x272e('0x25')](util[_0x272e('0x23')](_0x272e('0x26'),_0x515566[_0x272e('0x24')],_0x515566['id']),util[_0x272e('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x35daed(_0x3682c3);});}else{return _0x35daed(null,_0x4cc13a);}}}});}; \ No newline at end of file +var _0xab40=['https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refreshToken','refresh_token','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','catch','inspect','then','parse','../../config/logger','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in'];(function(_0x56a4bc,_0x504316){var _0x9e24e8=function(_0x541d35){while(--_0x541d35){_0x56a4bc['push'](_0x56a4bc['shift']());}};_0x9e24e8(++_0x504316);}(_0xab40,0x198));var _0x0ab4=function(_0x21e85e,_0x578c40){_0x21e85e=_0x21e85e-0x0;var _0x109088=_0xab40[_0x21e85e];return _0x109088;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0ab4('0x0'))('api');var moment=require(_0x0ab4('0x1'));var BPromise=require(_0x0ab4('0x2'));var rp=require(_0x0ab4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ab4('0x4'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x0ab4('0x5'));module[_0x0ab4('0x6')]=function(_0x59a234,_0x412079){return _0x59a234['define']('ZohoAccount',attributes,{'tableName':_0x0ab4('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x45557a,_0x44bb47,_0x2fd2af){if(_0x45557a[_0x0ab4('0x8')](_0x0ab4('0x9'))||_0x45557a[_0x0ab4('0x8')](_0x0ab4('0xa'))||_0x45557a['changed'](_0x0ab4('0xb'))||_0x45557a['changed'](_0x0ab4('0xc'))||_0x45557a[_0x0ab4('0x8')](_0x0ab4('0xd'))||_0x45557a['changed'](_0x0ab4('0xe'))){var _0x264315,_0x3bd8bf;_0x264315=_0x45557a['serverUrl'];var _0x4d8b79=_0x264315[_0x0ab4('0xf')](-0x1);if(_0x4d8b79==='/'||_0x4d8b79==='\x5c'||_0x4d8b79===':'){_0x264315=_0x264315[_0x0ab4('0x10')](0x0,_0x264315[_0x0ab4('0x11')](_0x4d8b79));}switch(_0x45557a[_0x0ab4('0x9')]){case'US':_0x3bd8bf=_0x0ab4('0x12');break;case'AU':_0x3bd8bf=_0x0ab4('0x13');break;case'IN':_0x3bd8bf=_0x0ab4('0x14');break;case'CN':_0x3bd8bf=_0x0ab4('0x15');break;default:_0x3bd8bf=_0x0ab4('0x16');break;}var _0x462570={'method':_0x0ab4('0x17'),'uri':_0x3bd8bf+_0x0ab4('0x18'),'form':{'grant_type':_0x0ab4('0x19'),'client_id':_0x45557a['clientId'],'client_secret':_0x45557a[_0x0ab4('0xc')],'redirect_uri':_0x45557a[_0x0ab4('0xa')],'code':_0x45557a[_0x0ab4('0xd')]},'headers':{'Content-Type':_0x0ab4('0x1a')}};return rp(_0x462570)['then'](function(_0x4a90a5){var _0x120833=JSON['parse'](_0x4a90a5);if(_0x120833['refresh_token']){_0x45557a[_0x0ab4('0x1b')]=_0x120833[_0x0ab4('0x1c')];logger[_0x0ab4('0x1d')](util[_0x0ab4('0x1e')](_0x0ab4('0x1f'),_0x45557a[_0x0ab4('0x20')],_0x45557a['id']));}else{logger[_0x0ab4('0x21')](util[_0x0ab4('0x1e')](_0x0ab4('0x22'),_0x45557a[_0x0ab4('0x20')],_0x45557a['id']),util['inspect'](_0x120833,{'showHidden':![],'depth':null}));}return _0x2fd2af(null,_0x44bb47);})[_0x0ab4('0x23')](function(_0x2c0516){logger[_0x0ab4('0x21')](util[_0x0ab4('0x1e')](_0x0ab4('0x22'),_0x45557a[_0x0ab4('0x20')],_0x45557a['id']),util[_0x0ab4('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x2fd2af(_0x2c0516);});}else{return _0x2fd2af(null,_0x44bb47);}},'beforeUpdate':function(_0x236132,_0x5d14db,_0x3e0e62){if(_0x236132[_0x0ab4('0x8')](_0x0ab4('0x9'))||_0x236132['changed'](_0x0ab4('0xa'))||_0x236132[_0x0ab4('0x8')]('clientId')||_0x236132['changed'](_0x0ab4('0xc'))||_0x236132[_0x0ab4('0x8')](_0x0ab4('0xd'))||_0x236132[_0x0ab4('0x8')](_0x0ab4('0xe'))){var _0x24f93c,_0x2c4403;_0x24f93c=_0x236132['serverUrl'];var _0x4b6bec=_0x24f93c[_0x0ab4('0xf')](-0x1);if(_0x4b6bec==='/'||_0x4b6bec==='\x5c'||_0x4b6bec===':'){_0x24f93c=_0x24f93c[_0x0ab4('0x10')](0x0,_0x24f93c[_0x0ab4('0x11')](_0x4b6bec));}switch(_0x236132[_0x0ab4('0x9')]){case'US':_0x2c4403=_0x0ab4('0x12');break;case'AU':_0x2c4403=_0x0ab4('0x13');break;case'IN':_0x2c4403='https://accounts.zoho.in';break;case'CN':_0x2c4403='https://accounts.zoho.com.cn';break;default:_0x2c4403=_0x0ab4('0x16');break;}var _0x35094e={'method':_0x0ab4('0x17'),'uri':_0x2c4403+_0x0ab4('0x18'),'form':{'grant_type':_0x0ab4('0x19'),'client_id':_0x236132[_0x0ab4('0xb')],'client_secret':_0x236132[_0x0ab4('0xc')],'redirect_uri':_0x236132[_0x0ab4('0xa')],'code':_0x236132[_0x0ab4('0xd')]},'headers':{'Content-Type':_0x0ab4('0x1a')}};return rp(_0x35094e)[_0x0ab4('0x25')](function(_0x467fcf){var _0x1e1ca3=JSON[_0x0ab4('0x26')](_0x467fcf);if(_0x1e1ca3[_0x0ab4('0x1c')]){_0x236132[_0x0ab4('0x1b')]=_0x1e1ca3[_0x0ab4('0x1c')];logger[_0x0ab4('0x1d')](util[_0x0ab4('0x1e')](_0x0ab4('0x1f'),_0x236132[_0x0ab4('0x20')],_0x236132['id']));}else{logger['error'](util[_0x0ab4('0x1e')](_0x0ab4('0x22'),_0x236132['name'],_0x236132['id']),util[_0x0ab4('0x24')](_0x1e1ca3,{'showHidden':![],'depth':null}));}return _0x3e0e62(null,_0x5d14db);})[_0x0ab4('0x23')](function(_0x2c63fb){logger['error'](util['format'](_0x0ab4('0x22'),_0x236132[_0x0ab4('0x20')],_0x236132['id']),util[_0x0ab4('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x3e0e62(_0x2c63fb);});}else{return _0x3e0e62(null,_0x5d14db);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 4305588..76ac7be 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 _0x226b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0xb3cc64,_0x4160db){var _0x492c7e=function(_0x3830b8){while(--_0x3830b8){_0xb3cc64['push'](_0xb3cc64['shift']());}};_0x492c7e(++_0x4160db);}(_0x226b,0x161));var _0xb226=function(_0x26236c,_0x234b4e){_0x26236c=_0x26236c-0x0;var _0x33d1dd=_0x226b[_0x26236c];return _0x33d1dd;};'use strict';var _=require(_0xb226('0x0'));var util=require(_0xb226('0x1'));var moment=require(_0xb226('0x2'));var BPromise=require(_0xb226('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb226('0x4'));var db=require(_0xb226('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb226('0x6'))(_0xb226('0x7'));var config=require(_0xb226('0x8'));var jayson=require(_0xb226('0x9'));var client=jayson[_0xb226('0xa')][_0xb226('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fd6bc,_0x3a0cb2,_0x450420){return new BPromise(function(_0x5ee216,_0x454cba){return client[_0xb226('0xc')](_0x3fd6bc,_0x450420)[_0xb226('0xd')](function(_0x5b85c8){logger[_0xb226('0xe')](_0xb226('0xf'),_0x3a0cb2,_0xb226('0x10'));logger[_0xb226('0x11')](_0xb226('0x12'),_0x3a0cb2,_0xb226('0x10'),JSON[_0xb226('0x13')](_0x5b85c8));if(_0x5b85c8['error']){if(_0x5b85c8[_0xb226('0x14')]['code']===0x1f4){logger[_0xb226('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x3a0cb2,_0x5b85c8['error']['message']);return _0x454cba(_0x5b85c8['error'][_0xb226('0x15')]);}logger[_0xb226('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x3a0cb2,_0x5b85c8[_0xb226('0x14')]['message']);return _0x5ee216(_0x5b85c8[_0xb226('0x14')][_0xb226('0x15')]);}else{logger['info'](_0xb226('0xf'),_0x3a0cb2,'request\x20sent');_0x5ee216(_0x5b85c8[_0xb226('0x16')][_0xb226('0x15')]);}})[_0xb226('0x17')](function(_0x119447){logger[_0xb226('0x14')](_0xb226('0xf'),_0x3a0cb2,_0x119447);_0x454cba(_0x119447);});});}exports[_0xb226('0x18')]=function(_0x5d0dfe){var _0x3405e6=this;return new Promise(function(_0x130ff0,_0x32d8b3){return db[_0xb226('0x19')][_0xb226('0x1a')]({'raw':_0x5d0dfe['options']?_0x5d0dfe[_0xb226('0x1b')][_0xb226('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d0dfe[_0xb226('0x1b')]?_0x5d0dfe[_0xb226('0x1b')][_0xb226('0x1d')]||null:null,'attributes':_0x5d0dfe[_0xb226('0x1b')]?_0x5d0dfe[_0xb226('0x1b')][_0xb226('0x1e')]||null:null,'limit':_0x5d0dfe[_0xb226('0x1b')]?_0x5d0dfe[_0xb226('0x1b')][_0xb226('0x1f')]||null:null,'include':_0x5d0dfe['options']?_0x5d0dfe['options'][_0xb226('0x20')]?_[_0xb226('0x21')](_0x5d0dfe[_0xb226('0x1b')][_0xb226('0x20')],function(_0x946099){return{'model':db[_0x946099[_0xb226('0x22')]],'as':_0x946099['as'],'attributes':_0x946099[_0xb226('0x1e')],'include':_0x946099['include']?_[_0xb226('0x21')](_0x946099[_0xb226('0x20')],function(_0x1f73aa){return{'model':db[_0x1f73aa['model']],'as':_0x1f73aa['as'],'attributes':_0x1f73aa['attributes'],'include':_0x1f73aa['include']?_['map'](_0x1f73aa[_0xb226('0x20')],function(_0xd2d479){return{'model':db[_0xd2d479[_0xb226('0x22')]],'as':_0xd2d479['as'],'attributes':_0xd2d479['attributes']};}):[]};}):[]};}):[]:[]})[_0xb226('0xd')](function(_0x3dd466){logger['info'](_0xb226('0x18'),_0x5d0dfe);logger[_0xb226('0x11')](_0xb226('0x18'),_0x5d0dfe,JSON[_0xb226('0x13')](_0x3dd466));_0x130ff0(_0x3dd466);})[_0xb226('0x17')](function(_0x21ce5c){logger[_0xb226('0x14')](_0xb226('0x18'),_0x21ce5c[_0xb226('0x15')],_0x5d0dfe);_0x32d8b3(_0x3405e6[_0xb226('0x14')](0x1f4,_0x21ce5c[_0xb226('0x15')]));});});};exports[_0xb226('0x23')]=function(_0x44578e){var _0x284588=this;return new Promise(function(_0x357166,_0x471ece){return db[_0xb226('0x19')]['find']({'raw':_0x44578e[_0xb226('0x1b')]?_0x44578e[_0xb226('0x1b')][_0xb226('0x1c')]===undefined?!![]:![]:!![],'where':_0x44578e[_0xb226('0x1b')]?_0x44578e[_0xb226('0x1b')]['where']||null:null,'attributes':_0x44578e[_0xb226('0x1b')]?_0x44578e[_0xb226('0x1b')][_0xb226('0x1e')]||null:null,'include':_0x44578e[_0xb226('0x1b')]?_0x44578e[_0xb226('0x1b')][_0xb226('0x20')]?_['map'](_0x44578e[_0xb226('0x1b')][_0xb226('0x20')],function(_0x57359a){return{'model':db[_0x57359a[_0xb226('0x22')]],'as':_0x57359a['as'],'attributes':_0x57359a['attributes'],'include':_0x57359a['include']?_[_0xb226('0x21')](_0x57359a[_0xb226('0x20')],function(_0x51b962){return{'model':db[_0x51b962[_0xb226('0x22')]],'as':_0x51b962['as'],'attributes':_0x51b962[_0xb226('0x1e')],'include':_0x51b962[_0xb226('0x20')]?_[_0xb226('0x21')](_0x51b962[_0xb226('0x20')],function(_0x4a3ab3){return{'model':db[_0x4a3ab3[_0xb226('0x22')]],'as':_0x4a3ab3['as'],'attributes':_0x4a3ab3[_0xb226('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x417628){logger['info'](_0xb226('0x23'),_0x44578e);logger[_0xb226('0x11')]('ShowZohoAccount',_0x44578e,JSON['stringify'](_0x417628));_0x357166(_0x417628);})[_0xb226('0x17')](function(_0x228e24){logger[_0xb226('0x14')](_0xb226('0x23'),_0x228e24[_0xb226('0x15')],_0x44578e);_0x471ece(_0x284588['error'](0x1f4,_0x228e24['message']));});});}; \ No newline at end of file +var _0x4d51=['options','raw','attributes','limit','include','map','model','debug','stringify','find','ShowZohoAccount','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4d51,0x87));var _0x14d5=function(_0x1c42b1,_0x4f05da){_0x1c42b1=_0x1c42b1-0x0;var _0x591c1e=_0x4d51[_0x1c42b1];return _0x591c1e;};'use strict';var _=require(_0x14d5('0x0'));var util=require(_0x14d5('0x1'));var moment=require(_0x14d5('0x2'));var BPromise=require(_0x14d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14d5('0x4'))['db'];var utils=require(_0x14d5('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x14d5('0x6'));var jayson=require(_0x14d5('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2892b0,_0x19274d,_0x27c99f){return new BPromise(function(_0x39d4aa,_0x1339a2){return client[_0x14d5('0x8')](_0x2892b0,_0x27c99f)[_0x14d5('0x9')](function(_0x4094d1){logger[_0x14d5('0xa')](_0x14d5('0xb'),_0x19274d,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x19274d,_0x14d5('0xc'),JSON['stringify'](_0x4094d1));if(_0x4094d1[_0x14d5('0xd')]){if(_0x4094d1[_0x14d5('0xd')]['code']===0x1f4){logger[_0x14d5('0xd')](_0x14d5('0xb'),_0x19274d,_0x4094d1[_0x14d5('0xd')][_0x14d5('0xe')]);return _0x1339a2(_0x4094d1['error'][_0x14d5('0xe')]);}logger[_0x14d5('0xd')](_0x14d5('0xb'),_0x19274d,_0x4094d1[_0x14d5('0xd')][_0x14d5('0xe')]);return _0x39d4aa(_0x4094d1[_0x14d5('0xd')]['message']);}else{logger[_0x14d5('0xa')](_0x14d5('0xb'),_0x19274d,'request\x20sent');_0x39d4aa(_0x4094d1[_0x14d5('0xf')]['message']);}})[_0x14d5('0x10')](function(_0x4be796){logger[_0x14d5('0xd')](_0x14d5('0xb'),_0x19274d,_0x4be796);_0x1339a2(_0x4be796);});});}exports[_0x14d5('0x11')]=function(_0x34fa51){var _0x31d5ca=this;return new Promise(function(_0x1dd3c3,_0x7eb982){return db[_0x14d5('0x12')][_0x14d5('0x13')]({'raw':_0x34fa51[_0x14d5('0x14')]?_0x34fa51['options'][_0x14d5('0x15')]===undefined?!![]:![]:!![],'where':_0x34fa51[_0x14d5('0x14')]?_0x34fa51[_0x14d5('0x14')]['where']||null:null,'attributes':_0x34fa51[_0x14d5('0x14')]?_0x34fa51[_0x14d5('0x14')][_0x14d5('0x16')]||null:null,'limit':_0x34fa51['options']?_0x34fa51[_0x14d5('0x14')][_0x14d5('0x17')]||null:null,'include':_0x34fa51[_0x14d5('0x14')]?_0x34fa51['options'][_0x14d5('0x18')]?_[_0x14d5('0x19')](_0x34fa51[_0x14d5('0x14')][_0x14d5('0x18')],function(_0x37d270){return{'model':db[_0x37d270[_0x14d5('0x1a')]],'as':_0x37d270['as'],'attributes':_0x37d270[_0x14d5('0x16')],'include':_0x37d270[_0x14d5('0x18')]?_[_0x14d5('0x19')](_0x37d270[_0x14d5('0x18')],function(_0x1a6d60){return{'model':db[_0x1a6d60['model']],'as':_0x1a6d60['as'],'attributes':_0x1a6d60[_0x14d5('0x16')],'include':_0x1a6d60[_0x14d5('0x18')]?_[_0x14d5('0x19')](_0x1a6d60[_0x14d5('0x18')],function(_0x4430fb){return{'model':db[_0x4430fb[_0x14d5('0x1a')]],'as':_0x4430fb['as'],'attributes':_0x4430fb[_0x14d5('0x16')]};}):[]};}):[]};}):[]:[]})[_0x14d5('0x9')](function(_0x1bdb9b){logger[_0x14d5('0xa')](_0x14d5('0x11'),_0x34fa51);logger[_0x14d5('0x1b')](_0x14d5('0x11'),_0x34fa51,JSON[_0x14d5('0x1c')](_0x1bdb9b));_0x1dd3c3(_0x1bdb9b);})[_0x14d5('0x10')](function(_0x1f7349){logger[_0x14d5('0xd')](_0x14d5('0x11'),_0x1f7349['message'],_0x34fa51);_0x7eb982(_0x31d5ca['error'](0x1f4,_0x1f7349[_0x14d5('0xe')]));});});};exports['ShowZohoAccount']=function(_0x6608cf){var _0x1660c5=this;return new Promise(function(_0x8e485e,_0x4ad3fd){return db[_0x14d5('0x12')][_0x14d5('0x1d')]({'raw':_0x6608cf[_0x14d5('0x14')]?_0x6608cf[_0x14d5('0x14')][_0x14d5('0x15')]===undefined?!![]:![]:!![],'where':_0x6608cf[_0x14d5('0x14')]?_0x6608cf[_0x14d5('0x14')]['where']||null:null,'attributes':_0x6608cf[_0x14d5('0x14')]?_0x6608cf['options'][_0x14d5('0x16')]||null:null,'include':_0x6608cf[_0x14d5('0x14')]?_0x6608cf[_0x14d5('0x14')][_0x14d5('0x18')]?_[_0x14d5('0x19')](_0x6608cf[_0x14d5('0x14')][_0x14d5('0x18')],function(_0xc01011){return{'model':db[_0xc01011[_0x14d5('0x1a')]],'as':_0xc01011['as'],'attributes':_0xc01011['attributes'],'include':_0xc01011[_0x14d5('0x18')]?_['map'](_0xc01011[_0x14d5('0x18')],function(_0x213d18){return{'model':db[_0x213d18[_0x14d5('0x1a')]],'as':_0x213d18['as'],'attributes':_0x213d18['attributes'],'include':_0x213d18[_0x14d5('0x18')]?_['map'](_0x213d18[_0x14d5('0x18')],function(_0x24a2f2){return{'model':db[_0x24a2f2[_0x14d5('0x1a')]],'as':_0x24a2f2['as'],'attributes':_0x24a2f2[_0x14d5('0x16')]};}):[]};}):[]};}):[]:[]})[_0x14d5('0x9')](function(_0x4e98d2){logger['info']('ShowZohoAccount',_0x6608cf);logger['debug'](_0x14d5('0x1e'),_0x6608cf,JSON[_0x14d5('0x1c')](_0x4e98d2));_0x8e485e(_0x4e98d2);})[_0x14d5('0x10')](function(_0x20df97){logger[_0x14d5('0xd')]('ShowZohoAccount',_0x20df97[_0x14d5('0xe')],_0x6608cf);_0x4ad3fd(_0x1660c5[_0x14d5('0xd')](0x1f4,_0x20df97[_0x14d5('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 2219f44..d285311 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 _0x7be1=['show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','put','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated'];(function(_0x3e4c02,_0x466584){var _0x12fc79=function(_0x8d5a20){while(--_0x8d5a20){_0x3e4c02['push'](_0x3e4c02['shift']());}};_0x12fc79(++_0x466584);}(_0x7be1,0x165));var _0x17be=function(_0x3ba2f6,_0x13cdb9){_0x3ba2f6=_0x3ba2f6-0x0;var _0x5bf772=_0x7be1[_0x3ba2f6];return _0x5bf772;};'use strict';var multer=require(_0x17be('0x0'));var util=require(_0x17be('0x1'));var path=require(_0x17be('0x2'));var timeout=require('connect-timeout');var express=require(_0x17be('0x3'));var router=express[_0x17be('0x4')]();var auth=require(_0x17be('0x5'));var interaction=require(_0x17be('0x6'));var config=require(_0x17be('0x7'));var controller=require('./intZohoConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x17be('0x8')]);router[_0x17be('0x9')]('/:id',auth[_0x17be('0xa')](),controller[_0x17be('0xb')]);router[_0x17be('0x9')](_0x17be('0xc'),auth[_0x17be('0xa')](),controller[_0x17be('0xd')]);router['get'](_0x17be('0xe'),auth['isAuthenticated'](),controller[_0x17be('0xf')]);router[_0x17be('0x9')]('/:id/descriptions',auth[_0x17be('0xa')](),controller[_0x17be('0x10')]);router[_0x17be('0x11')]('/',auth[_0x17be('0xa')](),controller['create']);router[_0x17be('0x12')]('/:id',auth[_0x17be('0xa')](),controller['update']);router[_0x17be('0x13')](_0x17be('0x14'),auth[_0x17be('0xa')](),controller[_0x17be('0x15')]);module[_0x17be('0x16')]=router; \ No newline at end of file +var _0x5269=['get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1d3892,_0x47d5fe){var _0x574ff2=function(_0x5cc441){while(--_0x5cc441){_0x1d3892['push'](_0x1d3892['shift']());}};_0x574ff2(++_0x47d5fe);}(_0x5269,0x150));var _0x9526=function(_0x90bf81,_0x306f4b){_0x90bf81=_0x90bf81-0x0;var _0x495748=_0x5269[_0x90bf81];return _0x495748;};'use strict';var multer=require(_0x9526('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9526('0x1')]();var auth=require(_0x9526('0x2'));var interaction=require(_0x9526('0x3'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x9526('0x4')]('/',auth['isAuthenticated'](),controller[_0x9526('0x5')]);router[_0x9526('0x4')](_0x9526('0x6'),auth[_0x9526('0x7')](),controller[_0x9526('0x8')]);router[_0x9526('0x4')](_0x9526('0x9'),auth[_0x9526('0x7')](),controller[_0x9526('0xa')]);router[_0x9526('0x4')](_0x9526('0xb'),auth[_0x9526('0x7')](),controller['getSubjects']);router[_0x9526('0x4')](_0x9526('0xc'),auth['isAuthenticated'](),controller[_0x9526('0xd')]);router[_0x9526('0xe')]('/',auth[_0x9526('0x7')](),controller[_0x9526('0xf')]);router[_0x9526('0x10')](_0x9526('0x6'),auth[_0x9526('0x7')](),controller['update']);router[_0x9526('0x11')](_0x9526('0x6'),auth['isAuthenticated'](),controller[_0x9526('0x12')]);module[_0x9526('0x13')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index dd15311..e4bbe99 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 _0xc8af=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x124aad,_0x37353a){var _0x582e38=function(_0x1640fd){while(--_0x1640fd){_0x124aad['push'](_0x124aad['shift']());}};_0x582e38(++_0x37353a);}(_0xc8af,0x118));var _0xfc8a=function(_0x3b1085,_0x5dd154){_0x3b1085=_0x3b1085-0x0;var _0x4fa273=_0xc8af[_0x3b1085];return _0x4fa273;};'use strict';var Sequelize=require(_0xfc8a('0x0'));module[_0xfc8a('0x1')]={'name':{'type':Sequelize[_0xfc8a('0x2')]},'moduleCreate':{'type':Sequelize[_0xfc8a('0x3')](_0xfc8a('0x4'),_0xfc8a('0x5'),_0xfc8a('0x6')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xfc8a('0x3')](_0xfc8a('0x7'),_0xfc8a('0x5'),_0xfc8a('0x4')),'defaultValue':_0xfc8a('0x7')},'description':{'type':Sequelize[_0xfc8a('0x2')]}}; \ No newline at end of file +var _0x1e56=['contact_lead','sequelize','STRING','ENUM','lead','contact','nothing'];(function(_0x61151d,_0x1eaadf){var _0x57752d=function(_0x1ac48a){while(--_0x1ac48a){_0x61151d['push'](_0x61151d['shift']());}};_0x57752d(++_0x1eaadf);}(_0x1e56,0x1dd));var _0x61e5=function(_0x3dd4ee,_0x5a1912){_0x3dd4ee=_0x3dd4ee-0x0;var _0xddb83=_0x1e56[_0x3dd4ee];return _0xddb83;};'use strict';var Sequelize=require(_0x61e5('0x0'));module['exports']={'name':{'type':Sequelize[_0x61e5('0x1')]},'moduleCreate':{'type':Sequelize[_0x61e5('0x2')](_0x61e5('0x3'),_0x61e5('0x4'),_0x61e5('0x5')),'defaultValue':_0x61e5('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x61e5('0x6'),_0x61e5('0x4'),'lead'),'defaultValue':_0x61e5('0x6')},'description':{'type':Sequelize[_0x61e5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 35ff3c9..75a69d1 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 _0x2222=['length','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','rawAttributes','find','create','body','params','getFields','findOne','hasOwnProperty','getSubjects','ZohoField','nolimit','getDescriptions','eml-format','zip-dir','request-promise','moment','util','path','sox','lodash','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../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~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','status','json','count','offset','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','index','map','ZohoConfiguration','fieldName','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3beb85,_0x4a0fbf){var _0x4b50e9=function(_0x491b5e){while(--_0x491b5e){_0x3beb85['push'](_0x3beb85['shift']());}};_0x4b50e9(++_0x4a0fbf);}(_0x2222,0x1c4));var _0x2222=function(_0x349a6d,_0x4b5ae0){_0x349a6d=_0x349a6d-0x0;var _0x391c7d=_0x2222[_0x349a6d];return _0x391c7d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2222('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2222('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2222('0x2'));var moment=require(_0x2222('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2222('0x4'));var path=require(_0x2222('0x5'));var sox=require(_0x2222('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2222('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2222('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x2222('0x9'));var querystring=require(_0x2222('0xa'));var Papa=require('papaparse');var Redis=require(_0x2222('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x2222('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2222('0xd'));var logger=require(_0x2222('0xe'))('api');var utils=require(_0x2222('0xf'));var config=require('../../config/environment');var db=require(_0x2222('0x10'))['db'];var jayson=require(_0x2222('0x11'));var client=jayson[_0x2222('0x12')][_0x2222('0x13')]({'port':0x232a});function checkPasswordPattern(_0x283585,_0x349bc1,_0x40f368){if(_0x40f368){var _0x530f21=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x530f21[_0x2222('0x14')](_0x349bc1)){return _0x283585;}else{throw new db[(_0x2222('0x15'))][(_0x2222('0x16'))](_0x2222('0x17'));}}else{return _0x283585;}}function respondWithRpcPromise(_0x40247c,_0x5ad656,_0x46cfc3,_0x446a7b){return new BPromise(function(_0x4abd2e,_0x840577){var _0x1a1e04=_0x446a7b||client;return _0x1a1e04['request'](_0x40247c,_0x46cfc3)[_0x2222('0x18')](function(_0x40b677){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x5ad656,_0x2222('0x19'));logger[_0x2222('0x1a')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x5ad656,_0x2222('0x19'),JSON[_0x2222('0x1b')](_0x40b677));if(_0x40b677[_0x2222('0x1c')]){if(_0x40b677[_0x2222('0x1c')][_0x2222('0x1d')]===0x1f4){logger[_0x2222('0x1c')](_0x2222('0x1e'),_0x5ad656,_0x40b677['error']['message']);return _0x840577(_0x40b677[_0x2222('0x1c')][_0x2222('0x1f')]);}logger[_0x2222('0x1c')]('ZohoConfiguration,\x20%s,\x20%s',_0x5ad656,_0x40b677['error']['message']);return _0x4abd2e(_0x40b677[_0x2222('0x1c')][_0x2222('0x1f')]);}else{logger[_0x2222('0x20')](_0x2222('0x1e'),_0x5ad656,'request\x20sent');_0x4abd2e(_0x40b677[_0x2222('0x21')]['message']);}})[_0x2222('0x22')](function(_0x1f55a5){logger['error'](_0x2222('0x1e'),_0x5ad656,_0x1f55a5);_0x840577(_0x1f55a5);});});}function respondWithStatusCode(_0x3b33fa,_0x3bf94b){_0x3bf94b=_0x3bf94b||0xcc;return function(_0x1c632f){if(_0x1c632f){return _0x3b33fa['sendStatus'](_0x3bf94b);}return _0x3b33fa[_0x2222('0x23')](_0x3bf94b)['end']();};}function respondWithResult(_0x3315d0,_0x324194){_0x324194=_0x324194||0xc8;return function(_0x14443f){if(_0x14443f){return _0x3315d0['status'](_0x324194)[_0x2222('0x24')](_0x14443f);}};}function respondWithFilteredResult(_0x1c277c,_0x1bb479){return function(_0x3b20ec){if(_0x3b20ec){var _0x13872d=_0x3b20ec[_0x2222('0x25')],_0x2e736b=_0x1bb479[_0x2222('0x26')],_0x1b29a8=_0x1bb479['offset']+_0x1bb479['limit'],_0xb442e7;if(_0x1b29a8>=_0x13872d){_0x1b29a8=_0x13872d;_0xb442e7=0xc8;}else{_0xb442e7=0xce;}_0x1c277c[_0x2222('0x23')](_0xb442e7);return _0x1c277c['set'](_0x2222('0x27'),_0x2e736b+'-'+_0x1b29a8+'/'+_0x13872d)['json'](_0x3b20ec);}return null;};}function patchUpdates(_0x2a1010){return function(_0x17f340){try{jsonpatch[_0x2222('0x28')](_0x17f340,_0x2a1010,!![]);}catch(_0x5a47aa){return BPromise[_0x2222('0x29')](_0x5a47aa);}return _0x17f340[_0x2222('0x2a')]();};}function saveUpdates(_0x1dfec3,_0x4800e8){return function(_0x6b8024){if(_0x6b8024){return _0x6b8024['update'](_0x1dfec3)[_0x2222('0x18')](function(_0x455ec4){return _0x455ec4;});}return null;};}function removeEntity(_0x30b8f1,_0x4da124){return function(_0x3ddca9){if(_0x3ddca9){return _0x3ddca9[_0x2222('0x2b')]()[_0x2222('0x18')](function(){_0x30b8f1[_0x2222('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b0b7d,_0x8c3a41){return function(_0x37f1d1){if(!_0x37f1d1){_0x1b0b7d[_0x2222('0x2c')](0x194);}return _0x37f1d1;};}function handleError(_0x58852b,_0x1babcc){_0x1babcc=_0x1babcc||0x1f4;return function(_0x477229){logger[_0x2222('0x1c')](_0x477229[_0x2222('0x2d')]);if(_0x477229['name']){delete _0x477229[_0x2222('0x2e')];}_0x58852b[_0x2222('0x23')](_0x1babcc)['send'](_0x477229);};}exports[_0x2222('0x2f')]=function(_0x3a8a52,_0x50c70f){var _0x4f7a93={},_0x2f31d8={},_0x4c1be3={'count':0x0,'rows':[]};var _0xd934ba=_[_0x2222('0x30')](db[_0x2222('0x31')]['rawAttributes'],function(_0x590ed7){return{'name':_0x590ed7[_0x2222('0x32')],'type':_0x590ed7['type']['key']};});_0x2f31d8[_0x2222('0x33')]=_[_0x2222('0x30')](_0xd934ba,_0x2222('0x2e'));_0x2f31d8[_0x2222('0x34')]=_[_0x2222('0x35')](_0x3a8a52[_0x2222('0x34')]);_0x2f31d8[_0x2222('0x36')]=_[_0x2222('0x37')](_0x2f31d8[_0x2222('0x33')],_0x2f31d8[_0x2222('0x34')]);_0x4f7a93[_0x2222('0x38')]=_['intersection'](_0x2f31d8[_0x2222('0x33')],qs[_0x2222('0x39')](_0x3a8a52[_0x2222('0x34')][_0x2222('0x39')]));_0x4f7a93[_0x2222('0x38')]=_0x4f7a93[_0x2222('0x38')][_0x2222('0x3a')]?_0x4f7a93[_0x2222('0x38')]:_0x2f31d8[_0x2222('0x33')];if(!_0x3a8a52[_0x2222('0x34')]['hasOwnProperty']('nolimit')){_0x4f7a93[_0x2222('0x3b')]=qs[_0x2222('0x3b')](_0x3a8a52[_0x2222('0x34')][_0x2222('0x3b')]);_0x4f7a93[_0x2222('0x26')]=qs[_0x2222('0x26')](_0x3a8a52['query'][_0x2222('0x26')]);}_0x4f7a93[_0x2222('0x3c')]=qs[_0x2222('0x3d')](_0x3a8a52[_0x2222('0x34')][_0x2222('0x3d')]);_0x4f7a93[_0x2222('0x3e')]=qs[_0x2222('0x36')](_[_0x2222('0x3f')](_0x3a8a52[_0x2222('0x34')],_0x2f31d8[_0x2222('0x36')]),_0xd934ba);if(_0x3a8a52[_0x2222('0x34')][_0x2222('0x40')]){_0x4f7a93[_0x2222('0x3e')]=_[_0x2222('0x41')](_0x4f7a93[_0x2222('0x3e')],{'$or':_[_0x2222('0x30')](_0xd934ba,function(_0xd1ea1c){if(_0xd1ea1c[_0x2222('0x42')]!==_0x2222('0x43')){var _0x17f81d={};_0x17f81d[_0xd1ea1c[_0x2222('0x2e')]]={'$like':'%'+_0x3a8a52['query'][_0x2222('0x40')]+'%'};return _0x17f81d;}})});}_0x4f7a93=_[_0x2222('0x41')]({},_0x4f7a93,_0x3a8a52[_0x2222('0x44')]);var _0x28cefc={'where':_0x4f7a93[_0x2222('0x3e')]};return db[_0x2222('0x31')][_0x2222('0x25')](_0x28cefc)[_0x2222('0x18')](function(_0x3e968b){_0x4c1be3[_0x2222('0x25')]=_0x3e968b;if(_0x3a8a52[_0x2222('0x34')][_0x2222('0x45')]){_0x4f7a93[_0x2222('0x46')]=[{'all':!![]}];}return db[_0x2222('0x31')]['findAll'](_0x4f7a93);})[_0x2222('0x18')](function(_0x4ccfc7){_0x4c1be3[_0x2222('0x47')]=_0x4ccfc7;return _0x4c1be3;})[_0x2222('0x18')](respondWithFilteredResult(_0x50c70f,_0x4f7a93))[_0x2222('0x22')](handleError(_0x50c70f,null));};exports[_0x2222('0x48')]=function(_0x5c23be,_0x4f12ba){var _0x40817c={'raw':![],'where':{'id':_0x5c23be['params']['id']}},_0x2415fe={};_0x2415fe[_0x2222('0x33')]=_[_0x2222('0x35')](db['ZohoConfiguration'][_0x2222('0x49')]);_0x2415fe[_0x2222('0x34')]=_['keys'](_0x5c23be[_0x2222('0x34')]);_0x2415fe[_0x2222('0x36')]=_[_0x2222('0x37')](_0x2415fe[_0x2222('0x33')],_0x2415fe[_0x2222('0x34')]);_0x40817c[_0x2222('0x38')]=_['intersection'](_0x2415fe[_0x2222('0x33')],qs[_0x2222('0x39')](_0x5c23be['query'][_0x2222('0x39')]));_0x40817c[_0x2222('0x38')]=_0x40817c[_0x2222('0x38')][_0x2222('0x3a')]?_0x40817c['attributes']:_0x2415fe[_0x2222('0x33')];if(_0x5c23be['query']['includeAll']){_0x40817c[_0x2222('0x46')]=[{'all':!![]}];}_0x40817c=_[_0x2222('0x41')]({},_0x40817c,_0x5c23be[_0x2222('0x44')]);return db[_0x2222('0x31')][_0x2222('0x4a')](_0x40817c)[_0x2222('0x18')](handleEntityNotFound(_0x4f12ba,null))[_0x2222('0x18')](respondWithResult(_0x4f12ba,null))[_0x2222('0x22')](handleError(_0x4f12ba,null));};exports[_0x2222('0x4b')]=function(_0x1288d7,_0x18571c){return db['ZohoConfiguration'][_0x2222('0x4b')](_0x1288d7[_0x2222('0x4c')],{})[_0x2222('0x18')](respondWithResult(_0x18571c,0xc9))[_0x2222('0x22')](handleError(_0x18571c,null));};exports['update']=function(_0x3951b3,_0xa23a0a){if(_0x3951b3[_0x2222('0x4c')]['id']){delete _0x3951b3[_0x2222('0x4c')]['id'];}return db[_0x2222('0x31')][_0x2222('0x4a')]({'where':{'id':_0x3951b3[_0x2222('0x4d')]['id']}})[_0x2222('0x18')](handleEntityNotFound(_0xa23a0a,null))[_0x2222('0x18')](saveUpdates(_0x3951b3['body'],null))['then'](respondWithResult(_0xa23a0a,null))[_0x2222('0x22')](handleError(_0xa23a0a,null));};exports[_0x2222('0x2b')]=function(_0x5da06e,_0x217c9d){return db[_0x2222('0x31')][_0x2222('0x4a')]({'where':{'id':_0x5da06e[_0x2222('0x4d')]['id']}})[_0x2222('0x18')](handleEntityNotFound(_0x217c9d,null))[_0x2222('0x18')](removeEntity(_0x217c9d,null))[_0x2222('0x22')](handleError(_0x217c9d,null));};exports[_0x2222('0x4e')]=function(_0x29a38d,_0x19dc10,_0x54af34){var _0x37fea1={};var _0x5f1a6a={};var _0x521533;var _0x4b786f;return db[_0x2222('0x31')][_0x2222('0x4f')]({'where':{'id':_0x29a38d[_0x2222('0x4d')]['id']}})['then'](handleEntityNotFound(_0x19dc10,null))[_0x2222('0x18')](function(_0x422653){if(_0x422653){_0x521533=_0x422653;_0x5f1a6a[_0x2222('0x33')]=_['keys'](db['ZohoField'][_0x2222('0x49')]);_0x5f1a6a['query']=_[_0x2222('0x35')](_0x29a38d[_0x2222('0x34')]);_0x5f1a6a['filters']=_[_0x2222('0x37')](_0x5f1a6a[_0x2222('0x33')],_0x5f1a6a[_0x2222('0x34')]);_0x37fea1[_0x2222('0x38')]=_[_0x2222('0x37')](_0x5f1a6a[_0x2222('0x33')],qs[_0x2222('0x39')](_0x29a38d[_0x2222('0x34')][_0x2222('0x39')]));_0x37fea1[_0x2222('0x38')]=_0x37fea1[_0x2222('0x38')][_0x2222('0x3a')]?_0x37fea1[_0x2222('0x38')]:_0x5f1a6a['model'];_0x37fea1[_0x2222('0x3c')]=qs[_0x2222('0x3d')](_0x29a38d[_0x2222('0x34')][_0x2222('0x3d')]);_0x37fea1[_0x2222('0x3e')]=qs[_0x2222('0x36')](_[_0x2222('0x3f')](_0x29a38d['query'],_0x5f1a6a[_0x2222('0x36')]));if(_0x29a38d[_0x2222('0x34')][_0x2222('0x40')]){_0x37fea1['where']=_[_0x2222('0x41')](_0x37fea1[_0x2222('0x3e')],{'$or':_[_0x2222('0x30')](_0x37fea1[_0x2222('0x38')],function(_0x5dde52){var _0x3abf2f={};_0x3abf2f[_0x5dde52]={'$like':'%'+_0x29a38d[_0x2222('0x34')][_0x2222('0x40')]+'%'};return _0x3abf2f;})});}_0x37fea1=_[_0x2222('0x41')]({},_0x37fea1,_0x29a38d[_0x2222('0x44')]);return _0x521533['getFields'](_0x37fea1);}})[_0x2222('0x18')](function(_0xbd8afb){if(_0xbd8afb){_0x4b786f=_0xbd8afb[_0x2222('0x3a')];if(!_0x29a38d['query'][_0x2222('0x50')]('nolimit')){_0x37fea1[_0x2222('0x3b')]=qs['limit'](_0x29a38d[_0x2222('0x34')][_0x2222('0x3b')]);_0x37fea1[_0x2222('0x26')]=qs['offset'](_0x29a38d[_0x2222('0x34')][_0x2222('0x26')]);}return _0x521533['getFields'](_0x37fea1);}})[_0x2222('0x18')](function(_0x1aa9b0){if(_0x1aa9b0){return _0x1aa9b0?{'count':_0x4b786f,'rows':_0x1aa9b0}:null;}})[_0x2222('0x18')](respondWithResult(_0x19dc10,null))[_0x2222('0x22')](handleError(_0x19dc10,null));};exports[_0x2222('0x51')]=function(_0x3de95e,_0x56a56b,_0x24aa86){var _0x20835c={};var _0x53ac5a={};var _0x36c2bf;var _0x1531c4;return db[_0x2222('0x31')][_0x2222('0x4f')]({'where':{'id':_0x3de95e[_0x2222('0x4d')]['id']}})[_0x2222('0x18')](handleEntityNotFound(_0x56a56b,null))[_0x2222('0x18')](function(_0x54cc5f){if(_0x54cc5f){_0x36c2bf=_0x54cc5f;_0x53ac5a[_0x2222('0x33')]=_[_0x2222('0x35')](db[_0x2222('0x52')][_0x2222('0x49')]);_0x53ac5a[_0x2222('0x34')]=_[_0x2222('0x35')](_0x3de95e[_0x2222('0x34')]);_0x53ac5a[_0x2222('0x36')]=_[_0x2222('0x37')](_0x53ac5a['model'],_0x53ac5a[_0x2222('0x34')]);_0x20835c[_0x2222('0x38')]=_[_0x2222('0x37')](_0x53ac5a[_0x2222('0x33')],qs[_0x2222('0x39')](_0x3de95e['query']['fields']));_0x20835c['attributes']=_0x20835c[_0x2222('0x38')]['length']?_0x20835c[_0x2222('0x38')]:_0x53ac5a['model'];_0x20835c['order']=qs[_0x2222('0x3d')](_0x3de95e[_0x2222('0x34')]['sort']);_0x20835c[_0x2222('0x3e')]=qs[_0x2222('0x36')](_[_0x2222('0x3f')](_0x3de95e['query'],_0x53ac5a['filters']));if(_0x3de95e[_0x2222('0x34')][_0x2222('0x40')]){_0x20835c[_0x2222('0x3e')]=_[_0x2222('0x41')](_0x20835c[_0x2222('0x3e')],{'$or':_['map'](_0x20835c[_0x2222('0x38')],function(_0x5d287b){var _0x555139={};_0x555139[_0x5d287b]={'$like':'%'+_0x3de95e[_0x2222('0x34')]['filter']+'%'};return _0x555139;})});}_0x20835c=_[_0x2222('0x41')]({},_0x20835c,_0x3de95e[_0x2222('0x44')]);return _0x36c2bf[_0x2222('0x51')](_0x20835c);}})['then'](function(_0x537889){if(_0x537889){_0x1531c4=_0x537889[_0x2222('0x3a')];if(!_0x3de95e[_0x2222('0x34')]['hasOwnProperty'](_0x2222('0x53'))){_0x20835c[_0x2222('0x3b')]=qs[_0x2222('0x3b')](_0x3de95e['query'][_0x2222('0x3b')]);_0x20835c['offset']=qs['offset'](_0x3de95e['query']['offset']);}return _0x36c2bf[_0x2222('0x51')](_0x20835c);}})[_0x2222('0x18')](function(_0x131785){if(_0x131785){return _0x131785?{'count':_0x1531c4,'rows':_0x131785}:null;}})[_0x2222('0x18')](respondWithResult(_0x56a56b,null))[_0x2222('0x22')](handleError(_0x56a56b,null));};exports[_0x2222('0x54')]=function(_0x12e895,_0x49607a,_0x156391){var _0xf98989={};var _0x29d91f={};var _0x473ca8;var _0x2f21a9;return db[_0x2222('0x31')]['findOne']({'where':{'id':_0x12e895[_0x2222('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49607a,null))[_0x2222('0x18')](function(_0x5f066d){if(_0x5f066d){_0x473ca8=_0x5f066d;_0x29d91f[_0x2222('0x33')]=_[_0x2222('0x35')](db[_0x2222('0x52')]['rawAttributes']);_0x29d91f[_0x2222('0x34')]=_[_0x2222('0x35')](_0x12e895[_0x2222('0x34')]);_0x29d91f[_0x2222('0x36')]=_[_0x2222('0x37')](_0x29d91f[_0x2222('0x33')],_0x29d91f[_0x2222('0x34')]);_0xf98989[_0x2222('0x38')]=_[_0x2222('0x37')](_0x29d91f[_0x2222('0x33')],qs[_0x2222('0x39')](_0x12e895[_0x2222('0x34')][_0x2222('0x39')]));_0xf98989[_0x2222('0x38')]=_0xf98989[_0x2222('0x38')][_0x2222('0x3a')]?_0xf98989[_0x2222('0x38')]:_0x29d91f[_0x2222('0x33')];_0xf98989['order']=qs[_0x2222('0x3d')](_0x12e895[_0x2222('0x34')][_0x2222('0x3d')]);_0xf98989[_0x2222('0x3e')]=qs[_0x2222('0x36')](_[_0x2222('0x3f')](_0x12e895[_0x2222('0x34')],_0x29d91f[_0x2222('0x36')]));if(_0x12e895[_0x2222('0x34')][_0x2222('0x40')]){_0xf98989[_0x2222('0x3e')]=_[_0x2222('0x41')](_0xf98989['where'],{'$or':_[_0x2222('0x30')](_0xf98989[_0x2222('0x38')],function(_0x51d6c8){var _0x4dee30={};_0x4dee30[_0x51d6c8]={'$like':'%'+_0x12e895['query'][_0x2222('0x40')]+'%'};return _0x4dee30;})});}_0xf98989=_[_0x2222('0x41')]({},_0xf98989,_0x12e895[_0x2222('0x44')]);return _0x473ca8['getDescriptions'](_0xf98989);}})['then'](function(_0x332be2){if(_0x332be2){_0x2f21a9=_0x332be2[_0x2222('0x3a')];if(!_0x12e895[_0x2222('0x34')][_0x2222('0x50')](_0x2222('0x53'))){_0xf98989['limit']=qs[_0x2222('0x3b')](_0x12e895[_0x2222('0x34')]['limit']);_0xf98989['offset']=qs[_0x2222('0x26')](_0x12e895['query'][_0x2222('0x26')]);}return _0x473ca8[_0x2222('0x54')](_0xf98989);}})[_0x2222('0x18')](function(_0x11fb42){if(_0x11fb42){return _0x11fb42?{'count':_0x2f21a9,'rows':_0x11fb42}:null;}})[_0x2222('0x18')](respondWithResult(_0x49607a,null))[_0x2222('0x22')](handleError(_0x49607a,null));}; \ No newline at end of file +var _0x3bc2=['index','map','ZohoConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','params','keys','length','includeAll','find','create','getFields','findOne','ZohoField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','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','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send'];(function(_0x1dbcaa,_0x3501e4){var _0x208531=function(_0x43450e){while(--_0x43450e){_0x1dbcaa['push'](_0x1dbcaa['shift']());}};_0x208531(++_0x3501e4);}(_0x3bc2,0x12c));var _0x23bc=function(_0xf62196,_0x389dd3){_0xf62196=_0xf62196-0x0;var _0x54934=_0x3bc2[_0xf62196];return _0x54934;};'use strict';var pdf=require(_0x23bc('0x0'));var emlformat=require(_0x23bc('0x1'));var rimraf=require(_0x23bc('0x2'));var zipdir=require(_0x23bc('0x3'));var jsonpatch=require(_0x23bc('0x4'));var rp=require(_0x23bc('0x5'));var moment=require(_0x23bc('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x23bc('0x7'));var util=require('util');var path=require(_0x23bc('0x8'));var sox=require(_0x23bc('0x9'));var csv=require(_0x23bc('0xa'));var ejs=require(_0x23bc('0xb'));var fs=require('fs');var _=require(_0x23bc('0xc'));var squel=require(_0x23bc('0xd'));var crypto=require(_0x23bc('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x23bc('0xa'));var querystring=require(_0x23bc('0xf'));var Papa=require(_0x23bc('0x10'));var Redis=require('ioredis');var authService=require(_0x23bc('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x23bc('0x12'));var logger=require(_0x23bc('0x13'))('api');var utils=require(_0x23bc('0x14'));var config=require(_0x23bc('0x15'));var db=require(_0x23bc('0x16'))['db'];var jayson=require(_0x23bc('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x42ac82,_0x4d6113,_0x3422ce){if(_0x3422ce){var _0x1a1bb2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a1bb2['test'](_0x4d6113)){return _0x42ac82;}else{throw new db[(_0x23bc('0x18'))][(_0x23bc('0x19'))](_0x23bc('0x1a'));}}else{return _0x42ac82;}}function respondWithRpcPromise(_0x439c33,_0x99b772,_0x498df5,_0x4edca4){return new BPromise(function(_0x5f4e97,_0x2e5a64){var _0x69ee90=_0x4edca4||client;return _0x69ee90[_0x23bc('0x1b')](_0x439c33,_0x498df5)[_0x23bc('0x1c')](function(_0xee97f){logger['info'](_0x23bc('0x1d'),_0x99b772,'request\x20sent');logger[_0x23bc('0x1e')](_0x23bc('0x1f'),_0x99b772,'request\x20sent',JSON[_0x23bc('0x20')](_0xee97f));if(_0xee97f[_0x23bc('0x21')]){if(_0xee97f['error'][_0x23bc('0x22')]===0x1f4){logger[_0x23bc('0x21')](_0x23bc('0x1d'),_0x99b772,_0xee97f[_0x23bc('0x21')]['message']);return _0x2e5a64(_0xee97f[_0x23bc('0x21')][_0x23bc('0x23')]);}logger[_0x23bc('0x21')](_0x23bc('0x1d'),_0x99b772,_0xee97f[_0x23bc('0x21')][_0x23bc('0x23')]);return _0x5f4e97(_0xee97f['error'][_0x23bc('0x23')]);}else{logger[_0x23bc('0x24')]('ZohoConfiguration,\x20%s,\x20%s',_0x99b772,_0x23bc('0x25'));_0x5f4e97(_0xee97f[_0x23bc('0x26')][_0x23bc('0x23')]);}})[_0x23bc('0x27')](function(_0x3471fb){logger[_0x23bc('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x99b772,_0x3471fb);_0x2e5a64(_0x3471fb);});});}function respondWithStatusCode(_0x33fe3e,_0x3a283b){_0x3a283b=_0x3a283b||0xcc;return function(_0x3221d6){if(_0x3221d6){return _0x33fe3e[_0x23bc('0x28')](_0x3a283b);}return _0x33fe3e[_0x23bc('0x29')](_0x3a283b)['end']();};}function respondWithResult(_0x4bf3ba,_0x12ee9a){_0x12ee9a=_0x12ee9a||0xc8;return function(_0x411f07){if(_0x411f07){return _0x4bf3ba[_0x23bc('0x29')](_0x12ee9a)[_0x23bc('0x2a')](_0x411f07);}};}function respondWithFilteredResult(_0x59da61,_0x59bc9c){return function(_0x1ceadb){if(_0x1ceadb){var _0x26522a=_0x1ceadb[_0x23bc('0x2b')],_0x2c9d7e=_0x59bc9c[_0x23bc('0x2c')],_0x4e5d24=_0x59bc9c[_0x23bc('0x2c')]+_0x59bc9c[_0x23bc('0x2d')],_0x31c29a;if(_0x4e5d24>=_0x26522a){_0x4e5d24=_0x26522a;_0x31c29a=0xc8;}else{_0x31c29a=0xce;}_0x59da61[_0x23bc('0x29')](_0x31c29a);return _0x59da61['set'](_0x23bc('0x2e'),_0x2c9d7e+'-'+_0x4e5d24+'/'+_0x26522a)['json'](_0x1ceadb);}return null;};}function patchUpdates(_0x135758){return function(_0x1b3d6d){try{jsonpatch[_0x23bc('0x2f')](_0x1b3d6d,_0x135758,!![]);}catch(_0x1a2450){return BPromise[_0x23bc('0x30')](_0x1a2450);}return _0x1b3d6d[_0x23bc('0x31')]();};}function saveUpdates(_0x4b33bf,_0x33cc2e){return function(_0x2a1720){if(_0x2a1720){return _0x2a1720[_0x23bc('0x32')](_0x4b33bf)['then'](function(_0x58c411){return _0x58c411;});}return null;};}function removeEntity(_0x1569be,_0x14b8ca){return function(_0x46efbb){if(_0x46efbb){return _0x46efbb[_0x23bc('0x33')]()[_0x23bc('0x1c')](function(){_0x1569be['status'](0xcc)[_0x23bc('0x34')]();});}};}function handleEntityNotFound(_0x198322,_0x36a9f3){return function(_0x5746ab){if(!_0x5746ab){_0x198322['sendStatus'](0x194);}return _0x5746ab;};}function handleError(_0xe3b2af,_0x41e37c){_0x41e37c=_0x41e37c||0x1f4;return function(_0x27f3cd){logger[_0x23bc('0x21')](_0x27f3cd[_0x23bc('0x35')]);if(_0x27f3cd[_0x23bc('0x36')]){delete _0x27f3cd['name'];}_0xe3b2af['status'](_0x41e37c)[_0x23bc('0x37')](_0x27f3cd);};}exports[_0x23bc('0x38')]=function(_0x542591,_0x5dbd25){var _0x215feb={},_0x5231e6={},_0x426efc={'count':0x0,'rows':[]};var _0x366416=_[_0x23bc('0x39')](db[_0x23bc('0x3a')][_0x23bc('0x3b')],function(_0x5c6e52){return{'name':_0x5c6e52[_0x23bc('0x3c')],'type':_0x5c6e52[_0x23bc('0x3d')]['key']};});_0x5231e6[_0x23bc('0x3e')]=_[_0x23bc('0x39')](_0x366416,_0x23bc('0x36'));_0x5231e6[_0x23bc('0x3f')]=_['keys'](_0x542591[_0x23bc('0x3f')]);_0x5231e6[_0x23bc('0x40')]=_['intersection'](_0x5231e6[_0x23bc('0x3e')],_0x5231e6[_0x23bc('0x3f')]);_0x215feb[_0x23bc('0x41')]=_[_0x23bc('0x42')](_0x5231e6[_0x23bc('0x3e')],qs['fields'](_0x542591[_0x23bc('0x3f')][_0x23bc('0x43')]));_0x215feb[_0x23bc('0x41')]=_0x215feb[_0x23bc('0x41')]['length']?_0x215feb['attributes']:_0x5231e6[_0x23bc('0x3e')];if(!_0x542591[_0x23bc('0x3f')][_0x23bc('0x44')](_0x23bc('0x45'))){_0x215feb[_0x23bc('0x2d')]=qs['limit'](_0x542591[_0x23bc('0x3f')][_0x23bc('0x2d')]);_0x215feb[_0x23bc('0x2c')]=qs[_0x23bc('0x2c')](_0x542591['query']['offset']);}_0x215feb[_0x23bc('0x46')]=qs[_0x23bc('0x47')](_0x542591[_0x23bc('0x3f')]['sort']);_0x215feb[_0x23bc('0x48')]=qs[_0x23bc('0x40')](_[_0x23bc('0x49')](_0x542591[_0x23bc('0x3f')],_0x5231e6[_0x23bc('0x40')]),_0x366416);if(_0x542591[_0x23bc('0x3f')][_0x23bc('0x4a')]){_0x215feb[_0x23bc('0x48')]=_[_0x23bc('0x4b')](_0x215feb[_0x23bc('0x48')],{'$or':_[_0x23bc('0x39')](_0x366416,function(_0x20653b){if(_0x20653b[_0x23bc('0x3d')]!==_0x23bc('0x4c')){var _0x2cb601={};_0x2cb601[_0x20653b[_0x23bc('0x36')]]={'$like':'%'+_0x542591[_0x23bc('0x3f')][_0x23bc('0x4a')]+'%'};return _0x2cb601;}})});}_0x215feb=_[_0x23bc('0x4b')]({},_0x215feb,_0x542591[_0x23bc('0x4d')]);var _0x32c28a={'where':_0x215feb['where']};return db['ZohoConfiguration'][_0x23bc('0x2b')](_0x32c28a)[_0x23bc('0x1c')](function(_0x4aa94b){_0x426efc[_0x23bc('0x2b')]=_0x4aa94b;if(_0x542591['query']['includeAll']){_0x215feb['include']=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x215feb);})[_0x23bc('0x1c')](function(_0x19d1c9){_0x426efc['rows']=_0x19d1c9;return _0x426efc;})[_0x23bc('0x1c')](respondWithFilteredResult(_0x5dbd25,_0x215feb))[_0x23bc('0x27')](handleError(_0x5dbd25,null));};exports['show']=function(_0x26dace,_0x7ed55b){var _0x5792ae={'raw':![],'where':{'id':_0x26dace[_0x23bc('0x4e')]['id']}},_0xc11eb1={};_0xc11eb1[_0x23bc('0x3e')]=_[_0x23bc('0x4f')](db[_0x23bc('0x3a')][_0x23bc('0x3b')]);_0xc11eb1[_0x23bc('0x3f')]=_[_0x23bc('0x4f')](_0x26dace[_0x23bc('0x3f')]);_0xc11eb1[_0x23bc('0x40')]=_[_0x23bc('0x42')](_0xc11eb1[_0x23bc('0x3e')],_0xc11eb1['query']);_0x5792ae[_0x23bc('0x41')]=_['intersection'](_0xc11eb1[_0x23bc('0x3e')],qs[_0x23bc('0x43')](_0x26dace[_0x23bc('0x3f')][_0x23bc('0x43')]));_0x5792ae[_0x23bc('0x41')]=_0x5792ae[_0x23bc('0x41')][_0x23bc('0x50')]?_0x5792ae[_0x23bc('0x41')]:_0xc11eb1[_0x23bc('0x3e')];if(_0x26dace['query'][_0x23bc('0x51')]){_0x5792ae['include']=[{'all':!![]}];}_0x5792ae=_[_0x23bc('0x4b')]({},_0x5792ae,_0x26dace[_0x23bc('0x4d')]);return db[_0x23bc('0x3a')][_0x23bc('0x52')](_0x5792ae)[_0x23bc('0x1c')](handleEntityNotFound(_0x7ed55b,null))['then'](respondWithResult(_0x7ed55b,null))['catch'](handleError(_0x7ed55b,null));};exports[_0x23bc('0x53')]=function(_0x337e6e,_0x59e16b){return db[_0x23bc('0x3a')]['create'](_0x337e6e['body'],{})[_0x23bc('0x1c')](respondWithResult(_0x59e16b,0xc9))['catch'](handleError(_0x59e16b,null));};exports[_0x23bc('0x32')]=function(_0x1dfeb4,_0x17d23f){if(_0x1dfeb4['body']['id']){delete _0x1dfeb4['body']['id'];}return db[_0x23bc('0x3a')][_0x23bc('0x52')]({'where':{'id':_0x1dfeb4[_0x23bc('0x4e')]['id']}})[_0x23bc('0x1c')](handleEntityNotFound(_0x17d23f,null))[_0x23bc('0x1c')](saveUpdates(_0x1dfeb4['body'],null))[_0x23bc('0x1c')](respondWithResult(_0x17d23f,null))[_0x23bc('0x27')](handleError(_0x17d23f,null));};exports[_0x23bc('0x33')]=function(_0x108ed7,_0x574e57){return db[_0x23bc('0x3a')][_0x23bc('0x52')]({'where':{'id':_0x108ed7[_0x23bc('0x4e')]['id']}})[_0x23bc('0x1c')](handleEntityNotFound(_0x574e57,null))[_0x23bc('0x1c')](removeEntity(_0x574e57,null))['catch'](handleError(_0x574e57,null));};exports[_0x23bc('0x54')]=function(_0x28cf75,_0x204402,_0x457bf2){var _0xf4e797={};var _0x44499e={};var _0x27103b;var _0x15d6a1;return db[_0x23bc('0x3a')][_0x23bc('0x55')]({'where':{'id':_0x28cf75[_0x23bc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x204402,null))['then'](function(_0x170f2a){if(_0x170f2a){_0x27103b=_0x170f2a;_0x44499e['model']=_[_0x23bc('0x4f')](db[_0x23bc('0x56')][_0x23bc('0x3b')]);_0x44499e[_0x23bc('0x3f')]=_['keys'](_0x28cf75[_0x23bc('0x3f')]);_0x44499e['filters']=_[_0x23bc('0x42')](_0x44499e[_0x23bc('0x3e')],_0x44499e['query']);_0xf4e797['attributes']=_[_0x23bc('0x42')](_0x44499e[_0x23bc('0x3e')],qs[_0x23bc('0x43')](_0x28cf75[_0x23bc('0x3f')][_0x23bc('0x43')]));_0xf4e797[_0x23bc('0x41')]=_0xf4e797['attributes']['length']?_0xf4e797[_0x23bc('0x41')]:_0x44499e[_0x23bc('0x3e')];_0xf4e797[_0x23bc('0x46')]=qs[_0x23bc('0x47')](_0x28cf75[_0x23bc('0x3f')]['sort']);_0xf4e797[_0x23bc('0x48')]=qs[_0x23bc('0x40')](_['pick'](_0x28cf75[_0x23bc('0x3f')],_0x44499e[_0x23bc('0x40')]));if(_0x28cf75[_0x23bc('0x3f')][_0x23bc('0x4a')]){_0xf4e797[_0x23bc('0x48')]=_[_0x23bc('0x4b')](_0xf4e797[_0x23bc('0x48')],{'$or':_[_0x23bc('0x39')](_0xf4e797[_0x23bc('0x41')],function(_0x37c671){var _0x372c8f={};_0x372c8f[_0x37c671]={'$like':'%'+_0x28cf75[_0x23bc('0x3f')][_0x23bc('0x4a')]+'%'};return _0x372c8f;})});}_0xf4e797=_[_0x23bc('0x4b')]({},_0xf4e797,_0x28cf75['options']);return _0x27103b[_0x23bc('0x54')](_0xf4e797);}})[_0x23bc('0x1c')](function(_0x3d7b74){if(_0x3d7b74){_0x15d6a1=_0x3d7b74['length'];if(!_0x28cf75[_0x23bc('0x3f')][_0x23bc('0x44')]('nolimit')){_0xf4e797[_0x23bc('0x2d')]=qs[_0x23bc('0x2d')](_0x28cf75['query']['limit']);_0xf4e797['offset']=qs[_0x23bc('0x2c')](_0x28cf75[_0x23bc('0x3f')][_0x23bc('0x2c')]);}return _0x27103b[_0x23bc('0x54')](_0xf4e797);}})[_0x23bc('0x1c')](function(_0x5d6a46){if(_0x5d6a46){return _0x5d6a46?{'count':_0x15d6a1,'rows':_0x5d6a46}:null;}})[_0x23bc('0x1c')](respondWithResult(_0x204402,null))[_0x23bc('0x27')](handleError(_0x204402,null));};exports['getSubjects']=function(_0x4318dc,_0x58f570,_0x5b732a){var _0x1f8ded={};var _0x209e79={};var _0xf4409a;var _0x3a28e5;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x4318dc['params']['id']}})[_0x23bc('0x1c')](handleEntityNotFound(_0x58f570,null))[_0x23bc('0x1c')](function(_0x18b839){if(_0x18b839){_0xf4409a=_0x18b839;_0x209e79[_0x23bc('0x3e')]=_['keys'](db[_0x23bc('0x56')]['rawAttributes']);_0x209e79[_0x23bc('0x3f')]=_[_0x23bc('0x4f')](_0x4318dc[_0x23bc('0x3f')]);_0x209e79[_0x23bc('0x40')]=_['intersection'](_0x209e79[_0x23bc('0x3e')],_0x209e79[_0x23bc('0x3f')]);_0x1f8ded[_0x23bc('0x41')]=_[_0x23bc('0x42')](_0x209e79['model'],qs[_0x23bc('0x43')](_0x4318dc[_0x23bc('0x3f')][_0x23bc('0x43')]));_0x1f8ded[_0x23bc('0x41')]=_0x1f8ded['attributes'][_0x23bc('0x50')]?_0x1f8ded[_0x23bc('0x41')]:_0x209e79['model'];_0x1f8ded[_0x23bc('0x46')]=qs[_0x23bc('0x47')](_0x4318dc['query'][_0x23bc('0x47')]);_0x1f8ded[_0x23bc('0x48')]=qs[_0x23bc('0x40')](_[_0x23bc('0x49')](_0x4318dc[_0x23bc('0x3f')],_0x209e79[_0x23bc('0x40')]));if(_0x4318dc[_0x23bc('0x3f')][_0x23bc('0x4a')]){_0x1f8ded[_0x23bc('0x48')]=_[_0x23bc('0x4b')](_0x1f8ded[_0x23bc('0x48')],{'$or':_[_0x23bc('0x39')](_0x1f8ded[_0x23bc('0x41')],function(_0x1fc1c9){var _0x1f9249={};_0x1f9249[_0x1fc1c9]={'$like':'%'+_0x4318dc['query'][_0x23bc('0x4a')]+'%'};return _0x1f9249;})});}_0x1f8ded=_['merge']({},_0x1f8ded,_0x4318dc[_0x23bc('0x4d')]);return _0xf4409a['getSubjects'](_0x1f8ded);}})[_0x23bc('0x1c')](function(_0x5ae116){if(_0x5ae116){_0x3a28e5=_0x5ae116[_0x23bc('0x50')];if(!_0x4318dc[_0x23bc('0x3f')][_0x23bc('0x44')](_0x23bc('0x45'))){_0x1f8ded[_0x23bc('0x2d')]=qs[_0x23bc('0x2d')](_0x4318dc[_0x23bc('0x3f')][_0x23bc('0x2d')]);_0x1f8ded[_0x23bc('0x2c')]=qs[_0x23bc('0x2c')](_0x4318dc['query']['offset']);}return _0xf4409a[_0x23bc('0x57')](_0x1f8ded);}})[_0x23bc('0x1c')](function(_0x329274){if(_0x329274){return _0x329274?{'count':_0x3a28e5,'rows':_0x329274}:null;}})[_0x23bc('0x1c')](respondWithResult(_0x58f570,null))[_0x23bc('0x27')](handleError(_0x58f570,null));};exports[_0x23bc('0x58')]=function(_0x5ad0eb,_0x3161dc,_0x2ef9f5){var _0x41dc62={};var _0x136794={};var _0x1e2b92;var _0x208e3a;return db[_0x23bc('0x3a')][_0x23bc('0x55')]({'where':{'id':_0x5ad0eb['params']['id']}})[_0x23bc('0x1c')](handleEntityNotFound(_0x3161dc,null))['then'](function(_0x3c8e83){if(_0x3c8e83){_0x1e2b92=_0x3c8e83;_0x136794[_0x23bc('0x3e')]=_['keys'](db[_0x23bc('0x56')][_0x23bc('0x3b')]);_0x136794[_0x23bc('0x3f')]=_[_0x23bc('0x4f')](_0x5ad0eb[_0x23bc('0x3f')]);_0x136794[_0x23bc('0x40')]=_['intersection'](_0x136794[_0x23bc('0x3e')],_0x136794['query']);_0x41dc62['attributes']=_[_0x23bc('0x42')](_0x136794['model'],qs[_0x23bc('0x43')](_0x5ad0eb['query'][_0x23bc('0x43')]));_0x41dc62['attributes']=_0x41dc62['attributes']['length']?_0x41dc62[_0x23bc('0x41')]:_0x136794[_0x23bc('0x3e')];_0x41dc62[_0x23bc('0x46')]=qs[_0x23bc('0x47')](_0x5ad0eb[_0x23bc('0x3f')][_0x23bc('0x47')]);_0x41dc62[_0x23bc('0x48')]=qs['filters'](_[_0x23bc('0x49')](_0x5ad0eb['query'],_0x136794['filters']));if(_0x5ad0eb[_0x23bc('0x3f')][_0x23bc('0x4a')]){_0x41dc62['where']=_[_0x23bc('0x4b')](_0x41dc62[_0x23bc('0x48')],{'$or':_['map'](_0x41dc62[_0x23bc('0x41')],function(_0x2e1f76){var _0x5c83af={};_0x5c83af[_0x2e1f76]={'$like':'%'+_0x5ad0eb[_0x23bc('0x3f')][_0x23bc('0x4a')]+'%'};return _0x5c83af;})});}_0x41dc62=_['merge']({},_0x41dc62,_0x5ad0eb[_0x23bc('0x4d')]);return _0x1e2b92[_0x23bc('0x58')](_0x41dc62);}})[_0x23bc('0x1c')](function(_0x11d8f0){if(_0x11d8f0){_0x208e3a=_0x11d8f0[_0x23bc('0x50')];if(!_0x5ad0eb[_0x23bc('0x3f')]['hasOwnProperty'](_0x23bc('0x45'))){_0x41dc62[_0x23bc('0x2d')]=qs['limit'](_0x5ad0eb['query'][_0x23bc('0x2d')]);_0x41dc62[_0x23bc('0x2c')]=qs[_0x23bc('0x2c')](_0x5ad0eb[_0x23bc('0x3f')][_0x23bc('0x2c')]);}return _0x1e2b92[_0x23bc('0x58')](_0x41dc62);}})[_0x23bc('0x1c')](function(_0x426a84){if(_0x426a84){return _0x426a84?{'count':_0x208e3a,'rows':_0x426a84}:null;}})[_0x23bc('0x1c')](respondWithResult(_0x3161dc,null))[_0x23bc('0x27')](handleError(_0x3161dc,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b9d03bf..04caf97 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 _0x4735=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api'];(function(_0x5392c3,_0x148af1){var _0x31f1d4=function(_0x3df335){while(--_0x3df335){_0x5392c3['push'](_0x5392c3['shift']());}};_0x31f1d4(++_0x148af1);}(_0x4735,0xec));var _0x5473=function(_0xa2c51c,_0x98ad95){_0xa2c51c=_0xa2c51c-0x0;var _0x2f5401=_0x4735[_0xa2c51c];return _0x2f5401;};'use strict';var _=require(_0x5473('0x0'));var util=require(_0x5473('0x1'));var logger=require(_0x5473('0x2'))(_0x5473('0x3'));var moment=require(_0x5473('0x4'));var BPromise=require(_0x5473('0x5'));var rp=require(_0x5473('0x6'));var fs=require('fs');var path=require(_0x5473('0x7'));var rimraf=require(_0x5473('0x8'));var config=require(_0x5473('0x9'));var attributes=require(_0x5473('0xa'));module[_0x5473('0xb')]=function(_0x18c9b0,_0xa8286d){return _0x18c9b0[_0x5473('0xc')](_0x5473('0xd'),attributes,{'tableName':_0x5473('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2cc8=['define','lodash','util','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x36ecf3,_0x1868d2){var _0x51efa7=function(_0x52e455){while(--_0x52e455){_0x36ecf3['push'](_0x36ecf3['shift']());}};_0x51efa7(++_0x1868d2);}(_0x2cc8,0x1c1));var _0x82cc=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0x2cc8[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0x82cc('0x0'));var util=require(_0x82cc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x82cc('0x2'));var fs=require('fs');var path=require(_0x82cc('0x3'));var rimraf=require(_0x82cc('0x4'));var config=require(_0x82cc('0x5'));var attributes=require('./intZohoConfiguration.attributes');module[_0x82cc('0x6')]=function(_0x2b7ce7,_0x21a7d6){return _0x2b7ce7[_0x82cc('0x7')]('ZohoConfiguration',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 82c6355..43929cc 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 _0x27bb=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x30a231,_0x59ec45){var _0x2e947c=function(_0x58200e){while(--_0x58200e){_0x30a231['push'](_0x30a231['shift']());}};_0x2e947c(++_0x59ec45);}(_0x27bb,0x1d6));var _0xb27b=function(_0x2d86a2,_0x303ebd){_0x2d86a2=_0x2d86a2-0x0;var _0x4bb98f=_0x27bb[_0x2d86a2];return _0x4bb98f;};'use strict';var _=require('lodash');var util=require(_0xb27b('0x0'));var moment=require(_0xb27b('0x1'));var BPromise=require('bluebird');var rs=require(_0xb27b('0x2'));var fs=require('fs');var Redis=require(_0xb27b('0x3'));var db=require(_0xb27b('0x4'))['db'];var utils=require(_0xb27b('0x5'));var logger=require('../../config/logger')(_0xb27b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34d817,_0x2c7d80,_0x540116){return new BPromise(function(_0x246364,_0x1ac125){return client['request'](_0x34d817,_0x540116)['then'](function(_0x1c536b){logger['info'](_0xb27b('0x7'),_0x2c7d80,_0xb27b('0x8'));logger[_0xb27b('0x9')](_0xb27b('0xa'),_0x2c7d80,_0xb27b('0x8'),JSON['stringify'](_0x1c536b));if(_0x1c536b[_0xb27b('0xb')]){if(_0x1c536b[_0xb27b('0xb')]['code']===0x1f4){logger[_0xb27b('0xb')](_0xb27b('0x7'),_0x2c7d80,_0x1c536b['error'][_0xb27b('0xc')]);return _0x1ac125(_0x1c536b[_0xb27b('0xb')][_0xb27b('0xc')]);}logger[_0xb27b('0xb')](_0xb27b('0x7'),_0x2c7d80,_0x1c536b[_0xb27b('0xb')][_0xb27b('0xc')]);return _0x246364(_0x1c536b[_0xb27b('0xb')]['message']);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x2c7d80,'request\x20sent');_0x246364(_0x1c536b[_0xb27b('0xd')][_0xb27b('0xc')]);}})[_0xb27b('0xe')](function(_0x5ef024){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2c7d80,_0x5ef024);_0x1ac125(_0x5ef024);});});} \ No newline at end of file +var _0x5a8c=['code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ba286,_0x33dcfa){var _0x317f97=function(_0x54846d){while(--_0x54846d){_0x3ba286['push'](_0x3ba286['shift']());}};_0x317f97(++_0x33dcfa);}(_0x5a8c,0xdf));var _0xc5a8=function(_0x21e9be,_0x145bbd){_0x21e9be=_0x21e9be-0x0;var _0x57797b=_0x5a8c[_0x21e9be];return _0x57797b;};'use strict';var _=require(_0xc5a8('0x0'));var util=require(_0xc5a8('0x1'));var moment=require(_0xc5a8('0x2'));var BPromise=require(_0xc5a8('0x3'));var rs=require(_0xc5a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc5a8('0x6'));var config=require(_0xc5a8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc5a8('0x8')][_0xc5a8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b6362,_0x2163b3,_0x178ebc){return new BPromise(function(_0x41e6b8,_0x4383a3){return client[_0xc5a8('0xa')](_0x4b6362,_0x178ebc)[_0xc5a8('0xb')](function(_0x463fb6){logger[_0xc5a8('0xc')](_0xc5a8('0xd'),_0x2163b3,_0xc5a8('0xe'));logger[_0xc5a8('0xf')](_0xc5a8('0x10'),_0x2163b3,_0xc5a8('0xe'),JSON[_0xc5a8('0x11')](_0x463fb6));if(_0x463fb6[_0xc5a8('0x12')]){if(_0x463fb6[_0xc5a8('0x12')][_0xc5a8('0x13')]===0x1f4){logger[_0xc5a8('0x12')](_0xc5a8('0xd'),_0x2163b3,_0x463fb6[_0xc5a8('0x12')]['message']);return _0x4383a3(_0x463fb6[_0xc5a8('0x12')]['message']);}logger[_0xc5a8('0x12')](_0xc5a8('0xd'),_0x2163b3,_0x463fb6[_0xc5a8('0x12')][_0xc5a8('0x14')]);return _0x41e6b8(_0x463fb6[_0xc5a8('0x12')][_0xc5a8('0x14')]);}else{logger[_0xc5a8('0xc')](_0xc5a8('0xd'),_0x2163b3,'request\x20sent');_0x41e6b8(_0x463fb6[_0xc5a8('0x15')][_0xc5a8('0x14')]);}})['catch'](function(_0x2f4041){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x2163b3,_0x2f4041);_0x4383a3(_0x2f4041);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f689d21..dfe39cc 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 _0xcf2f=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x4b0a80,_0x50a8a3){_0x4b0a80=_0x4b0a80-0x0;var _0x20f3bf=_0xcf2f[_0x4b0a80];return _0x20f3bf;};'use strict';var multer=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var path=require(_0xfcf2('0x2'));var timeout=require(_0xfcf2('0x3'));var express=require(_0xfcf2('0x4'));var router=express['Router']();var auth=require(_0xfcf2('0x5'));var interaction=require(_0xfcf2('0x6'));var config=require(_0xfcf2('0x7'));var controller=require(_0xfcf2('0x8'));router[_0xfcf2('0x9')]('/',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xb')]);router[_0xfcf2('0x9')](_0xfcf2('0xc'),auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xd')]);router[_0xfcf2('0xe')]('/',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfcf2('0x10')]);router[_0xfcf2('0x11')]('/:id',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0x12')]);module[_0xfcf2('0x13')]=router; \ No newline at end of file +var _0x3423=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','path','connect-timeout','express','Router'];(function(_0x39382e,_0xa7ba98){var _0xc126c9=function(_0x22fd6f){while(--_0x22fd6f){_0x39382e['push'](_0x39382e['shift']());}};_0xc126c9(++_0xa7ba98);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3342('0x0'));var timeout=require(_0x3342('0x1'));var express=require(_0x3342('0x2'));var router=express[_0x3342('0x3')]();var auth=require(_0x3342('0x4'));var interaction=require(_0x3342('0x5'));var config=require(_0x3342('0x6'));var controller=require(_0x3342('0x7'));router[_0x3342('0x8')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0xa')]);router[_0x3342('0x8')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0xc')]);router[_0x3342('0xd')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0xe')]);router[_0x3342('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3342('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3342('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 7a0587a..212f411 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 _0x4784=['variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x508ea7,_0x104766){var _0x4b14c2=function(_0x33c4ea){while(--_0x33c4ea){_0x508ea7['push'](_0x508ea7['shift']());}};_0x4b14c2(++_0x104766);}(_0x4784,0xe4));var _0x4478=function(_0x4b2741,_0x45ed3b){_0x4b2741=_0x4b2741-0x0;var _0x4d6ecc=_0x4784[_0x4b2741];return _0x4d6ecc;};'use strict';var Sequelize=require(_0x4478('0x0'));module[_0x4478('0x1')]={'type':{'type':Sequelize[_0x4478('0x2')](_0x4478('0x3'),_0x4478('0x4'),_0x4478('0x5'),'keyValue'),'defaultValue':_0x4478('0x3')},'content':{'type':Sequelize[_0x4478('0x6')]},'key':{'type':Sequelize[_0x4478('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x4478('0x3'),'variable',_0x4478('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4478('0x6')]},'nameField':{'type':Sequelize[_0x4478('0x6')]},'customField':{'type':Sequelize[_0x4478('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4478('0x6')]}}; \ No newline at end of file +var _0x5aaa=['STRING','ENUM','customVariable','sequelize','keyValue','string'];(function(_0x2b10bc,_0x39e518){var _0x26782c=function(_0x109ffd){while(--_0x109ffd){_0x2b10bc['push'](_0x2b10bc['shift']());}};_0x26782c(++_0x39e518);}(_0x5aaa,0xff));var _0xa5aa=function(_0x3761da,_0x3b45ad){_0x3761da=_0x3761da-0x0;var _0x591cfb=_0x5aaa[_0x3761da];return _0x591cfb;};'use strict';var Sequelize=require(_0xa5aa('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0xa5aa('0x1')),'defaultValue':_0xa5aa('0x2')},'content':{'type':Sequelize[_0xa5aa('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa5aa('0x4')](_0xa5aa('0x2'),'variable',_0xa5aa('0x5'))},'keyContent':{'type':Sequelize[_0xa5aa('0x3')]},'idField':{'type':Sequelize[_0xa5aa('0x3')]},'nameField':{'type':Sequelize[_0xa5aa('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 6b6177a..b4847e5 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(_0x2d818b,_0x3f2c79){var _0x3798a9=function(_0x265854){while(--_0x265854){_0x2d818b['push'](_0x2d818b['shift']());}};_0x3798a9(++_0x3f2c79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var 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(_0x3130c0,_0x1309a3){var _0x5e08e7=function(_0x37325e){while(--_0x37325e){_0x3130c0['push'](_0x3130c0['shift']());}};_0x5e08e7(++_0x1309a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 68d9606..20d488d 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 _0xe061=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','exports'];(function(_0x3e85e3,_0x15470e){var _0x184ba1=function(_0x3838bf){while(--_0x3838bf){_0x3e85e3['push'](_0x3e85e3['shift']());}};_0x184ba1(++_0x15470e);}(_0xe061,0x157));var _0x1e06=function(_0x41a247,_0x2b9560){_0x41a247=_0x41a247-0x0;var _0x4a313b=_0xe061[_0x41a247];return _0x4a313b;};'use strict';var _=require(_0x1e06('0x0'));var util=require(_0x1e06('0x1'));var logger=require(_0x1e06('0x2'))(_0x1e06('0x3'));var moment=require('moment');var BPromise=require(_0x1e06('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e06('0x5'));var rimraf=require(_0x1e06('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x1e06('0x7')]=function(_0x7f829,_0x5a28b4){return _0x7f829['define'](_0x1e06('0x8'),attributes,{'tableName':_0x1e06('0x9'),'paranoid':![],'indexes':[{'name':_0x1e06('0xa'),'fields':[_0x1e06('0xb'),_0x1e06('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x31b4=['define','ZohoField','int_zoho_fields','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x117bb5,_0x14169e){var _0x4dfa5b=function(_0x1403bf){while(--_0x1403bf){_0x117bb5['push'](_0x117bb5['shift']());}};_0x4dfa5b(++_0x14169e);}(_0x31b4,0xc9));var _0x431b=function(_0x364e7a,_0x1e4dea){_0x364e7a=_0x364e7a-0x0;var _0x38aedd=_0x31b4[_0x364e7a];return _0x38aedd;};'use strict';var _=require('lodash');var util=require(_0x431b('0x0'));var logger=require(_0x431b('0x1'))(_0x431b('0x2'));var moment=require(_0x431b('0x3'));var BPromise=require(_0x431b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x431b('0x5'));var rimraf=require(_0x431b('0x6'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x431b('0x7')]=function(_0x11c004,_0x39402a){return _0x11c004[_0x431b('0x8')](_0x431b('0x9'),attributes,{'tableName':_0x431b('0xa'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 398b5e7..7c2f963 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 _0x84ab=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xc15b70,_0x461d10){var _0x178f88=function(_0x3230fa){while(--_0x3230fa){_0xc15b70['push'](_0xc15b70['shift']());}};_0x178f88(++_0x461d10);}(_0x84ab,0x12f));var _0xb84a=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x84ab[_0x1098db];return _0x14f090;};'use strict';var _=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var moment=require(_0xb84a('0x2'));var BPromise=require(_0xb84a('0x3'));var rs=require(_0xb84a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84a('0x5'))['db'];var utils=require(_0xb84a('0x6'));var logger=require('../../config/logger')(_0xb84a('0x7'));var config=require(_0xb84a('0x8'));var jayson=require(_0xb84a('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc496,_0xd445b5,_0x4fac4d){return new BPromise(function(_0x3e9086,_0x8d9dbe){return client['request'](_0x4dc496,_0x4fac4d)[_0xb84a('0xa')](function(_0x525cb7){logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,_0xb84a('0xd'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0xd445b5,'request\x20sent',JSON[_0xb84a('0xe')](_0x525cb7));if(_0x525cb7[_0xb84a('0xf')]){if(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x10')]===0x1f4){logger[_0xb84a('0xf')]('ZohoField,\x20%s,\x20%s',_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x8d9dbe(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);return _0x3e9086(_0x525cb7[_0xb84a('0xf')][_0xb84a('0x11')]);}else{logger[_0xb84a('0xb')](_0xb84a('0xc'),_0xd445b5,'request\x20sent');_0x3e9086(_0x525cb7[_0xb84a('0x12')][_0xb84a('0x11')]);}})[_0xb84a('0x13')](function(_0x3c0b54){logger[_0xb84a('0xf')](_0xb84a('0xc'),_0xd445b5,_0x3c0b54);_0x8d9dbe(_0x3c0b54);});});} \ No newline at end of file +var _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x4b5eae,_0x43af1c){var _0x26d50b=function(_0x5e6ac0){while(--_0x5e6ac0){_0x4b5eae['push'](_0x4b5eae['shift']());}};_0x26d50b(++_0x43af1c);}(_0x55ca,0x126));var _0xa55c=function(_0x407bd8,_0x277add){_0x407bd8=_0x407bd8-0x0;var _0x20b6c9=_0x55ca[_0x407bd8];return _0x20b6c9;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('ZohoField,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('ZohoField,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2f8d863..7ad0f88 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 _0x5688=['Router','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x5688,0x199));var _0x8568=function(_0x323bf6,_0x19aed6){_0x323bf6=_0x323bf6-0x0;var _0x18da88=_0x5688[_0x323bf6];return _0x18da88;};'use strict';var multer=require(_0x8568('0x0'));var util=require(_0x8568('0x1'));var path=require(_0x8568('0x2'));var timeout=require(_0x8568('0x3'));var express=require(_0x8568('0x4'));var router=express[_0x8568('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8568('0x6'));var config=require(_0x8568('0x7'));module[_0x8568('0x8')]=router; \ No newline at end of file +var _0xd121=['util','connect-timeout','express','../../components/auth/service','../../config/environment','exports','multer'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xd121,0x187));var _0x1d12=function(_0xfaa41b,_0xfa170d){_0xfaa41b=_0xfaa41b-0x0;var _0x2257fd=_0xd121[_0xfaa41b];return _0x2257fd;};'use strict';var multer=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var path=require('path');var timeout=require(_0x1d12('0x2'));var express=require(_0x1d12('0x3'));var router=express['Router']();var auth=require(_0x1d12('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1d12('0x5'));module[_0x1d12('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index ddcdcf1..79042a8 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 _0x464c=['BOOLEAN','sequelize','exports','STRING','unique_name_and_version','app.js'];(function(_0x5a346f,_0x3baf33){var _0x149c19=function(_0x3f2743){while(--_0x3f2743){_0x5a346f['push'](_0x5a346f['shift']());}};_0x149c19(++_0x3baf33);}(_0x464c,0x1db));var _0xc464=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x464c[_0x11314c];return _0x12cb4a;};'use strict';var Sequelize=require(_0xc464('0x0'));module[_0xc464('0x1')]={'name':{'type':Sequelize[_0xc464('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xc464('0x2')],'allowNull':![],'unique':_0xc464('0x3')},'main':{'type':Sequelize[_0xc464('0x2')],'defaultValue':_0xc464('0x4')},'filename':{'type':Sequelize[_0xc464('0x2')]},'path':{'type':Sequelize[_0xc464('0x2')]},'type':{'type':Sequelize[_0xc464('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xc464('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xc464('0x2')]},'logo':{'type':Sequelize[_0xc464('0x2')]},'state':{'type':Sequelize[_0xc464('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xc464('0x2')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc464('0x2')]},'link':{'type':Sequelize[_0xc464('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x6fdf=['app.js','INTEGER','state','exports','STRING','unique_name_and_version'];(function(_0x561754,_0x1a780c){var _0x59ff11=function(_0x26d919){while(--_0x26d919){_0x561754['push'](_0x561754['shift']());}};_0x59ff11(++_0x1a780c);}(_0x6fdf,0x1c5));var _0xf6fd=function(_0x5759d9,_0x22b644){_0x5759d9=_0x5759d9-0x0;var _0x32f3bd=_0x6fdf[_0x5759d9];return _0x32f3bd;};'use strict';var Sequelize=require('sequelize');module[_0xf6fd('0x0')]={'name':{'type':Sequelize[_0xf6fd('0x1')],'allowNull':![],'unique':_0xf6fd('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf6fd('0x2')},'main':{'type':Sequelize[_0xf6fd('0x1')],'defaultValue':_0xf6fd('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xf6fd('0x1')]},'type':{'type':Sequelize[_0xf6fd('0x1')]},'size':{'type':Sequelize[_0xf6fd('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xf6fd('0x1')]},'logo':{'type':Sequelize[_0xf6fd('0x1')]},'state':{'type':Sequelize[_0xf6fd('0x1')],'unique':_0xf6fd('0x5')},'description':{'type':Sequelize[_0xf6fd('0x1')]},'title':{'type':Sequelize[_0xf6fd('0x1')]},'remoteUri':{'type':Sequelize[_0xf6fd('0x1')]},'link':{'type':Sequelize[_0xf6fd('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index e880362..888571b 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 _0x8469=['name','index','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','map','VIRTUAL','merge','then','includeAll','include','findAll','catch','show','params','fields','length','create','body','find','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack'];(function(_0x2b6b92,_0x57303d){var _0x2233dc=function(_0x310e88){while(--_0x310e88){_0x2b6b92['push'](_0x2b6b92['shift']());}};_0x2233dc(++_0x57303d);}(_0x8469,0x142));var _0x9846=function(_0xfd5f37,_0x24a79c){_0xfd5f37=_0xfd5f37-0x0;var _0x11bd01=_0x8469[_0xfd5f37];return _0x11bd01;};'use strict';var pdf=require(_0x9846('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9846('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9846('0x2'));var rp=require(_0x9846('0x3'));var moment=require(_0x9846('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9846('0x5'));var util=require(_0x9846('0x6'));var path=require(_0x9846('0x7'));var sox=require('sox');var csv=require(_0x9846('0x8'));var ejs=require(_0x9846('0x9'));var fs=require('fs');var _=require(_0x9846('0xa'));var squel=require(_0x9846('0xb'));var crypto=require(_0x9846('0xc'));var jsforce=require(_0x9846('0xd'));var deskjs=require(_0x9846('0xe'));var toCsv=require(_0x9846('0x8'));var querystring=require(_0x9846('0xf'));var Papa=require(_0x9846('0x10'));var Redis=require(_0x9846('0x11'));var authService=require(_0x9846('0x12'));var qs=require(_0x9846('0x13'));var as=require(_0x9846('0x14'));var hardwareService=require(_0x9846('0x15'));var logger=require('../../config/logger')(_0x9846('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9846('0x17'))['db'];function respondWithStatusCode(_0xa27500,_0x3bf234){_0x3bf234=_0x3bf234||0xcc;return function(_0x311f13){if(_0x311f13){return _0xa27500['sendStatus'](_0x3bf234);}return _0xa27500['status'](_0x3bf234)['end']();};}function respondWithResult(_0x3661f2,_0xeeef5c){_0xeeef5c=_0xeeef5c||0xc8;return function(_0x375c98){if(_0x375c98){return _0x3661f2[_0x9846('0x18')](_0xeeef5c)[_0x9846('0x19')](_0x375c98);}};}function respondWithFilteredResult(_0x3ad563,_0x261b43){return function(_0x3b4218){if(_0x3b4218){var _0x2047ea=_0x3b4218[_0x9846('0x1a')],_0x46b56b=_0x261b43[_0x9846('0x1b')],_0x42d678=_0x261b43[_0x9846('0x1b')]+_0x261b43['limit'],_0x5f4a5c;if(_0x42d678>=_0x2047ea){_0x42d678=_0x2047ea;_0x5f4a5c=0xc8;}else{_0x5f4a5c=0xce;}_0x3ad563[_0x9846('0x18')](_0x5f4a5c);return _0x3ad563[_0x9846('0x1c')](_0x9846('0x1d'),_0x46b56b+'-'+_0x42d678+'/'+_0x2047ea)[_0x9846('0x19')](_0x3b4218);}return null;};}function patchUpdates(_0x1ae27e){return function(_0x13064b){try{jsonpatch[_0x9846('0x1e')](_0x13064b,_0x1ae27e,!![]);}catch(_0x29d374){return BPromise[_0x9846('0x1f')](_0x29d374);}return _0x13064b[_0x9846('0x20')]();};}function saveUpdates(_0x522de5,_0x30579a){return function(_0x388d79){if(_0x388d79){return _0x388d79[_0x9846('0x21')](_0x522de5)['then'](function(_0x512805){return _0x512805;});}return null;};}function removeEntity(_0x152cc2,_0x573b08){return function(_0x4b558f){if(_0x4b558f){return _0x4b558f[_0x9846('0x22')]()['then'](function(){_0x152cc2[_0x9846('0x18')](0xcc)[_0x9846('0x23')]();});}};}function handleEntityNotFound(_0x46ad48,_0x33c2dd){return function(_0x1d8a63){if(!_0x1d8a63){_0x46ad48[_0x9846('0x24')](0x194);}return _0x1d8a63;};}function handleError(_0x39a397,_0x5bd682){_0x5bd682=_0x5bd682||0x1f4;return function(_0x3d9168){logger['error'](_0x3d9168[_0x9846('0x25')]);if(_0x3d9168[_0x9846('0x26')]){delete _0x3d9168['name'];}_0x39a397['status'](_0x5bd682)['send'](_0x3d9168);};}exports[_0x9846('0x27')]=function(_0x5d5c3f,_0x49b7ea){var _0x3325a3={},_0xf1e93f={},_0x186a44={'count':0x0,'rows':[]};var _0x3ffa2e=_['map'](db[_0x9846('0x28')][_0x9846('0x29')],function(_0x151b5b){return{'name':_0x151b5b['fieldName'],'type':_0x151b5b[_0x9846('0x2a')][_0x9846('0x2b')]};});_0xf1e93f[_0x9846('0x2c')]=_['map'](_0x3ffa2e,'name');_0xf1e93f[_0x9846('0x2d')]=_[_0x9846('0x2e')](_0x5d5c3f['query']);_0xf1e93f[_0x9846('0x2f')]=_[_0x9846('0x30')](_0xf1e93f[_0x9846('0x2c')],_0xf1e93f['query']);_0x3325a3[_0x9846('0x31')]=_[_0x9846('0x30')](_0xf1e93f['model'],qs['fields'](_0x5d5c3f[_0x9846('0x2d')]['fields']));_0x3325a3[_0x9846('0x31')]=_0x3325a3[_0x9846('0x31')]['length']?_0x3325a3['attributes']:_0xf1e93f[_0x9846('0x2c')];if(!_0x5d5c3f['query'][_0x9846('0x32')]('nolimit')){_0x3325a3['limit']=qs[_0x9846('0x33')](_0x5d5c3f[_0x9846('0x2d')][_0x9846('0x33')]);_0x3325a3[_0x9846('0x1b')]=qs[_0x9846('0x1b')](_0x5d5c3f[_0x9846('0x2d')][_0x9846('0x1b')]);}_0x3325a3[_0x9846('0x34')]=qs[_0x9846('0x35')](_0x5d5c3f['query'][_0x9846('0x35')]);_0x3325a3[_0x9846('0x36')]=qs['filters'](_[_0x9846('0x37')](_0x5d5c3f[_0x9846('0x2d')],_0xf1e93f[_0x9846('0x2f')]),_0x3ffa2e);if(_0x5d5c3f[_0x9846('0x2d')][_0x9846('0x38')]){_0x3325a3['where']=_['merge'](_0x3325a3['where'],{'$or':_[_0x9846('0x39')](_0x3ffa2e,function(_0x4f80a7){if(_0x4f80a7['type']!==_0x9846('0x3a')){var _0x33c9cf={};_0x33c9cf[_0x4f80a7[_0x9846('0x26')]]={'$like':'%'+_0x5d5c3f[_0x9846('0x2d')][_0x9846('0x38')]+'%'};return _0x33c9cf;}})});}_0x3325a3=_[_0x9846('0x3b')]({},_0x3325a3,_0x5d5c3f['options']);var _0x3a21ed={'where':_0x3325a3['where']};return db[_0x9846('0x28')]['count'](_0x3a21ed)[_0x9846('0x3c')](function(_0x1e85f2){_0x186a44[_0x9846('0x1a')]=_0x1e85f2;if(_0x5d5c3f['query'][_0x9846('0x3d')]){_0x3325a3[_0x9846('0x3e')]=[{'all':!![]}];}return db[_0x9846('0x28')][_0x9846('0x3f')](_0x3325a3);})[_0x9846('0x3c')](function(_0x481dfd){_0x186a44['rows']=_0x481dfd;return _0x186a44;})[_0x9846('0x3c')](respondWithFilteredResult(_0x49b7ea,_0x3325a3))[_0x9846('0x40')](handleError(_0x49b7ea,null));};exports[_0x9846('0x41')]=function(_0x27e0fc,_0x2f1f28){var _0x300e39={'raw':![],'where':{'id':_0x27e0fc[_0x9846('0x42')]['id']}},_0x3b7298={};_0x3b7298['model']=_[_0x9846('0x2e')](db[_0x9846('0x28')][_0x9846('0x29')]);_0x3b7298['query']=_[_0x9846('0x2e')](_0x27e0fc[_0x9846('0x2d')]);_0x3b7298['filters']=_[_0x9846('0x30')](_0x3b7298[_0x9846('0x2c')],_0x3b7298['query']);_0x300e39['attributes']=_[_0x9846('0x30')](_0x3b7298[_0x9846('0x2c')],qs[_0x9846('0x43')](_0x27e0fc[_0x9846('0x2d')][_0x9846('0x43')]));_0x300e39['attributes']=_0x300e39['attributes'][_0x9846('0x44')]?_0x300e39[_0x9846('0x31')]:_0x3b7298[_0x9846('0x2c')];if(_0x27e0fc[_0x9846('0x2d')][_0x9846('0x3d')]){_0x300e39[_0x9846('0x3e')]=[{'all':!![]}];}_0x300e39=_[_0x9846('0x3b')]({},_0x300e39,_0x27e0fc['options']);return db[_0x9846('0x28')]['find'](_0x300e39)['then'](handleEntityNotFound(_0x2f1f28,null))[_0x9846('0x3c')](respondWithResult(_0x2f1f28,null))['catch'](handleError(_0x2f1f28,null));};exports[_0x9846('0x45')]=function(_0x414e26,_0x448bde){return db[_0x9846('0x28')][_0x9846('0x45')](_0x414e26[_0x9846('0x46')],{})[_0x9846('0x3c')](respondWithResult(_0x448bde,0xc9))[_0x9846('0x40')](handleError(_0x448bde,null));};exports[_0x9846('0x21')]=function(_0xf69a15,_0x29f117){if(_0xf69a15[_0x9846('0x46')]['id']){delete _0xf69a15[_0x9846('0x46')]['id'];}return db[_0x9846('0x28')][_0x9846('0x47')]({'where':{'id':_0xf69a15[_0x9846('0x42')]['id']}})['then'](handleEntityNotFound(_0x29f117,null))[_0x9846('0x3c')](saveUpdates(_0xf69a15[_0x9846('0x46')],null))[_0x9846('0x3c')](respondWithResult(_0x29f117,null))['catch'](handleError(_0x29f117,null));};exports[_0x9846('0x22')]=function(_0x867765,_0x206888){return db['Integration'][_0x9846('0x47')]({'where':{'id':_0x867765['params']['id']}})[_0x9846('0x3c')](handleEntityNotFound(_0x206888,null))['then'](removeEntity(_0x206888,null))['catch'](handleError(_0x206888,null));}; \ No newline at end of file +var _0x0eb6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xc5775d,_0x3701ab){var _0x3b4edd=function(_0x37c3cb){while(--_0x37c3cb){_0xc5775d['push'](_0xc5775d['shift']());}};_0x3b4edd(++_0x3701ab);}(_0x0eb6,0x158));var _0x60eb=function(_0x1aeda2,_0x1217eb){_0x1aeda2=_0x1aeda2-0x0;var _0x32dc6d=_0x0eb6[_0x1aeda2];return _0x32dc6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x60eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x60eb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x60eb('0x2'));var BPromise=require(_0x60eb('0x3'));var Mustache=require(_0x60eb('0x4'));var util=require(_0x60eb('0x5'));var path=require(_0x60eb('0x6'));var sox=require(_0x60eb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x60eb('0x8'));var squel=require('squel');var crypto=require(_0x60eb('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x60eb('0xa'));var querystring=require(_0x60eb('0xb'));var Papa=require(_0x60eb('0xc'));var Redis=require(_0x60eb('0xd'));var authService=require(_0x60eb('0xe'));var qs=require(_0x60eb('0xf'));var as=require(_0x60eb('0x10'));var hardwareService=require(_0x60eb('0x11'));var logger=require('../../config/logger')(_0x60eb('0x12'));var utils=require('../../config/utils');var config=require(_0x60eb('0x13'));var db=require(_0x60eb('0x14'))['db'];function respondWithStatusCode(_0x24bee4,_0x153e1a){_0x153e1a=_0x153e1a||0xcc;return function(_0x4aff17){if(_0x4aff17){return _0x24bee4[_0x60eb('0x15')](_0x153e1a);}return _0x24bee4[_0x60eb('0x16')](_0x153e1a)[_0x60eb('0x17')]();};}function respondWithResult(_0x679916,_0x170dc3){_0x170dc3=_0x170dc3||0xc8;return function(_0x3d2db2){if(_0x3d2db2){return _0x679916[_0x60eb('0x16')](_0x170dc3)[_0x60eb('0x18')](_0x3d2db2);}};}function respondWithFilteredResult(_0x188e53,_0x5e7d03){return function(_0x4a5b44){if(_0x4a5b44){var _0x2f72eb=_0x4a5b44[_0x60eb('0x19')],_0x181c4c=_0x5e7d03['offset'],_0x4866ce=_0x5e7d03[_0x60eb('0x1a')]+_0x5e7d03['limit'],_0x2481e4;if(_0x4866ce>=_0x2f72eb){_0x4866ce=_0x2f72eb;_0x2481e4=0xc8;}else{_0x2481e4=0xce;}_0x188e53[_0x60eb('0x16')](_0x2481e4);return _0x188e53[_0x60eb('0x1b')](_0x60eb('0x1c'),_0x181c4c+'-'+_0x4866ce+'/'+_0x2f72eb)[_0x60eb('0x18')](_0x4a5b44);}return null;};}function patchUpdates(_0x4efe43){return function(_0x4c6020){try{jsonpatch[_0x60eb('0x1d')](_0x4c6020,_0x4efe43,!![]);}catch(_0x227e80){return BPromise[_0x60eb('0x1e')](_0x227e80);}return _0x4c6020[_0x60eb('0x1f')]();};}function saveUpdates(_0x268ac3,_0x4b13e1){return function(_0x5bd7ad){if(_0x5bd7ad){return _0x5bd7ad[_0x60eb('0x20')](_0x268ac3)['then'](function(_0x1026ba){return _0x1026ba;});}return null;};}function removeEntity(_0x177972,_0x1b46a3){return function(_0xbb6897){if(_0xbb6897){return _0xbb6897[_0x60eb('0x21')]()[_0x60eb('0x22')](function(){_0x177972['status'](0xcc)[_0x60eb('0x17')]();});}};}function handleEntityNotFound(_0x46bf8a,_0x1090e3){return function(_0x7e8a25){if(!_0x7e8a25){_0x46bf8a['sendStatus'](0x194);}return _0x7e8a25;};}function handleError(_0x1c5c66,_0x3e4435){_0x3e4435=_0x3e4435||0x1f4;return function(_0x22f40c){logger[_0x60eb('0x23')](_0x22f40c['stack']);if(_0x22f40c[_0x60eb('0x24')]){delete _0x22f40c[_0x60eb('0x24')];}_0x1c5c66[_0x60eb('0x16')](_0x3e4435)[_0x60eb('0x25')](_0x22f40c);};}exports[_0x60eb('0x26')]=function(_0x521076,_0x5ecf54){var _0x287525={},_0x26be7b={},_0xf6ff15={'count':0x0,'rows':[]};var _0x4e2662=_[_0x60eb('0x27')](db[_0x60eb('0x28')][_0x60eb('0x29')],function(_0x34d42c){return{'name':_0x34d42c[_0x60eb('0x2a')],'type':_0x34d42c[_0x60eb('0x2b')][_0x60eb('0x2c')]};});_0x26be7b[_0x60eb('0x2d')]=_[_0x60eb('0x27')](_0x4e2662,_0x60eb('0x24'));_0x26be7b[_0x60eb('0x2e')]=_[_0x60eb('0x2f')](_0x521076[_0x60eb('0x2e')]);_0x26be7b[_0x60eb('0x30')]=_[_0x60eb('0x31')](_0x26be7b[_0x60eb('0x2d')],_0x26be7b[_0x60eb('0x2e')]);_0x287525['attributes']=_[_0x60eb('0x31')](_0x26be7b[_0x60eb('0x2d')],qs[_0x60eb('0x32')](_0x521076[_0x60eb('0x2e')][_0x60eb('0x32')]));_0x287525[_0x60eb('0x33')]=_0x287525[_0x60eb('0x33')][_0x60eb('0x34')]?_0x287525['attributes']:_0x26be7b[_0x60eb('0x2d')];if(!_0x521076[_0x60eb('0x2e')][_0x60eb('0x35')](_0x60eb('0x36'))){_0x287525[_0x60eb('0x37')]=qs[_0x60eb('0x37')](_0x521076[_0x60eb('0x2e')][_0x60eb('0x37')]);_0x287525['offset']=qs[_0x60eb('0x1a')](_0x521076['query'][_0x60eb('0x1a')]);}_0x287525[_0x60eb('0x38')]=qs[_0x60eb('0x39')](_0x521076[_0x60eb('0x2e')][_0x60eb('0x39')]);_0x287525[_0x60eb('0x3a')]=qs[_0x60eb('0x30')](_[_0x60eb('0x3b')](_0x521076[_0x60eb('0x2e')],_0x26be7b['filters']),_0x4e2662);if(_0x521076[_0x60eb('0x2e')][_0x60eb('0x3c')]){_0x287525['where']=_[_0x60eb('0x3d')](_0x287525[_0x60eb('0x3a')],{'$or':_[_0x60eb('0x27')](_0x4e2662,function(_0x5c4fa1){if(_0x5c4fa1[_0x60eb('0x2b')]!==_0x60eb('0x3e')){var _0x5f4831={};_0x5f4831[_0x5c4fa1[_0x60eb('0x24')]]={'$like':'%'+_0x521076['query'][_0x60eb('0x3c')]+'%'};return _0x5f4831;}})});}_0x287525=_[_0x60eb('0x3d')]({},_0x287525,_0x521076[_0x60eb('0x3f')]);var _0x108db0={'where':_0x287525['where']};return db['Integration']['count'](_0x108db0)[_0x60eb('0x22')](function(_0x404068){_0xf6ff15[_0x60eb('0x19')]=_0x404068;if(_0x521076[_0x60eb('0x2e')]['includeAll']){_0x287525[_0x60eb('0x40')]=[{'all':!![]}];}return db['Integration'][_0x60eb('0x41')](_0x287525);})['then'](function(_0xb76355){_0xf6ff15[_0x60eb('0x42')]=_0xb76355;return _0xf6ff15;})[_0x60eb('0x22')](respondWithFilteredResult(_0x5ecf54,_0x287525))[_0x60eb('0x43')](handleError(_0x5ecf54,null));};exports['show']=function(_0x385f05,_0x4c2823){var _0x4fbbe7={'raw':![],'where':{'id':_0x385f05[_0x60eb('0x44')]['id']}},_0x5378d5={};_0x5378d5[_0x60eb('0x2d')]=_[_0x60eb('0x2f')](db[_0x60eb('0x28')][_0x60eb('0x29')]);_0x5378d5[_0x60eb('0x2e')]=_[_0x60eb('0x2f')](_0x385f05[_0x60eb('0x2e')]);_0x5378d5['filters']=_['intersection'](_0x5378d5['model'],_0x5378d5[_0x60eb('0x2e')]);_0x4fbbe7[_0x60eb('0x33')]=_[_0x60eb('0x31')](_0x5378d5[_0x60eb('0x2d')],qs[_0x60eb('0x32')](_0x385f05['query'][_0x60eb('0x32')]));_0x4fbbe7['attributes']=_0x4fbbe7[_0x60eb('0x33')]['length']?_0x4fbbe7[_0x60eb('0x33')]:_0x5378d5[_0x60eb('0x2d')];if(_0x385f05[_0x60eb('0x2e')]['includeAll']){_0x4fbbe7[_0x60eb('0x40')]=[{'all':!![]}];}_0x4fbbe7=_[_0x60eb('0x3d')]({},_0x4fbbe7,_0x385f05[_0x60eb('0x3f')]);return db[_0x60eb('0x28')][_0x60eb('0x45')](_0x4fbbe7)[_0x60eb('0x22')](handleEntityNotFound(_0x4c2823,null))['then'](respondWithResult(_0x4c2823,null))['catch'](handleError(_0x4c2823,null));};exports[_0x60eb('0x46')]=function(_0x256b58,_0x521235){return db['Integration']['create'](_0x256b58[_0x60eb('0x47')],{})['then'](respondWithResult(_0x521235,0xc9))[_0x60eb('0x43')](handleError(_0x521235,null));};exports[_0x60eb('0x20')]=function(_0x231666,_0x5237b9){if(_0x231666['body']['id']){delete _0x231666['body']['id'];}return db['Integration'][_0x60eb('0x45')]({'where':{'id':_0x231666[_0x60eb('0x44')]['id']}})[_0x60eb('0x22')](handleEntityNotFound(_0x5237b9,null))['then'](saveUpdates(_0x231666[_0x60eb('0x47')],null))[_0x60eb('0x22')](respondWithResult(_0x5237b9,null))[_0x60eb('0x43')](handleError(_0x5237b9,null));};exports[_0x60eb('0x21')]=function(_0x498a6e,_0x3b76de){return db[_0x60eb('0x28')][_0x60eb('0x45')]({'where':{'id':_0x498a6e[_0x60eb('0x44')]['id']}})[_0x60eb('0x22')](handleEntityNotFound(_0x3b76de,null))[_0x60eb('0x22')](removeEntity(_0x3b76de,null))['catch'](handleError(_0x3b76de,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 7a08cd8..fe8cdb6 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 _0x9f0a=['rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','api','moment','bluebird','path'];(function(_0x125ced,_0x2be672){var _0x1b0090=function(_0x419ee2){while(--_0x419ee2){_0x125ced['push'](_0x125ced['shift']());}};_0x1b0090(++_0x2be672);}(_0x9f0a,0x6f));var _0xa9f0=function(_0x38931e,_0x4553fd){_0x38931e=_0x38931e-0x0;var _0x47646e=_0x9f0a[_0x38931e];return _0x47646e;};'use strict';var _=require(_0xa9f0('0x0'));var util=require(_0xa9f0('0x1'));var logger=require('../../config/logger')(_0xa9f0('0x2'));var moment=require(_0xa9f0('0x3'));var BPromise=require(_0xa9f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9f0('0x5'));var rimraf=require(_0xa9f0('0x6'));var config=require(_0xa9f0('0x7'));var attributes=require(_0xa9f0('0x8'));module[_0xa9f0('0x9')]=function(_0x4e1377,_0x5807bf){return _0x4e1377[_0xa9f0('0xa')](_0xa9f0('0xb'),attributes,{'tableName':_0xa9f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7734=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','integrations','lodash'];(function(_0x28bba7,_0x439971){var _0x36152a=function(_0x38b61b){while(--_0x38b61b){_0x28bba7['push'](_0x28bba7['shift']());}};_0x36152a(++_0x439971);}(_0x7734,0x9b));var _0x4773=function(_0x16b14e,_0x46d816){_0x16b14e=_0x16b14e-0x0;var _0xd979ab=_0x7734[_0x16b14e];return _0xd979ab;};'use strict';var _=require(_0x4773('0x0'));var util=require(_0x4773('0x1'));var logger=require(_0x4773('0x2'))(_0x4773('0x3'));var moment=require(_0x4773('0x4'));var BPromise=require(_0x4773('0x5'));var rp=require(_0x4773('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4773('0x7'));var config=require(_0x4773('0x8'));var attributes=require(_0x4773('0x9'));module[_0x4773('0xa')]=function(_0x9d0089,_0x19f594){return _0x9d0089[_0x4773('0xb')]('Integration',attributes,{'tableName':_0x4773('0xc'),'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 be8b1e1..306316f 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 _0xf50a=['info','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Integration,\x20%s,\x20%s','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xf50a,0x1b8));var _0xaf50=function(_0x5f5df5,_0x2f41c8){_0x5f5df5=_0x5f5df5-0x0;var _0x511d12=_0xf50a[_0x5f5df5];return _0x511d12;};'use strict';var _=require('lodash');var util=require(_0xaf50('0x0'));var moment=require('moment');var BPromise=require(_0xaf50('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf50('0x2'));var db=require(_0xaf50('0x3'))['db'];var utils=require(_0xaf50('0x4'));var logger=require('../../config/logger')(_0xaf50('0x5'));var config=require(_0xaf50('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xaf50('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b8805,_0x334b83,_0x1d9247){return new BPromise(function(_0x28375f,_0x5415dd){return client[_0xaf50('0x8')](_0x2b8805,_0x1d9247)[_0xaf50('0x9')](function(_0x3f433a){logger[_0xaf50('0xa')]('Integration,\x20%s,\x20%s',_0x334b83,'request\x20sent');logger['debug'](_0xaf50('0xb'),_0x334b83,_0xaf50('0xc'),JSON['stringify'](_0x3f433a));if(_0x3f433a[_0xaf50('0xd')]){if(_0x3f433a[_0xaf50('0xd')][_0xaf50('0xe')]===0x1f4){logger[_0xaf50('0xd')](_0xaf50('0xf'),_0x334b83,_0x3f433a[_0xaf50('0xd')][_0xaf50('0x10')]);return _0x5415dd(_0x3f433a['error'][_0xaf50('0x10')]);}logger[_0xaf50('0xd')](_0xaf50('0xf'),_0x334b83,_0x3f433a[_0xaf50('0xd')][_0xaf50('0x10')]);return _0x28375f(_0x3f433a['error'][_0xaf50('0x10')]);}else{logger['info'](_0xaf50('0xf'),_0x334b83,_0xaf50('0xc'));_0x28375f(_0x3f433a[_0xaf50('0x11')]['message']);}})['catch'](function(_0x1fcdb8){logger[_0xaf50('0xd')]('Integration,\x20%s,\x20%s',_0x334b83,_0x1fcdb8);_0x5415dd(_0x1fcdb8);});});} \ No newline at end of file +var _0x482d=['request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x18296d,_0x4df6a0){var _0x390757=function(_0x227873){while(--_0x227873){_0x18296d['push'](_0x18296d['shift']());}};_0x390757(++_0x4df6a0);}(_0x482d,0x16c));var _0xd482=function(_0x4a0b8f,_0x3abfeb){_0x4a0b8f=_0x4a0b8f-0x0;var _0x4452ad=_0x482d[_0x4a0b8f];return _0x4452ad;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd482('0x0'));var BPromise=require(_0xd482('0x1'));var rs=require(_0xd482('0x2'));var fs=require('fs');var Redis=require(_0xd482('0x3'));var db=require(_0xd482('0x4'))['db'];var utils=require(_0xd482('0x5'));var logger=require('../../config/logger')(_0xd482('0x6'));var config=require(_0xd482('0x7'));var jayson=require(_0xd482('0x8'));var client=jayson['client'][_0xd482('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d6b47,_0x5bfc0f,_0x478af5){return new BPromise(function(_0x144d7d,_0x74f369){return client[_0xd482('0xa')](_0x5d6b47,_0x478af5)['then'](function(_0x144d5b){logger[_0xd482('0xb')](_0xd482('0xc'),_0x5bfc0f,_0xd482('0xd'));logger[_0xd482('0xe')](_0xd482('0xf'),_0x5bfc0f,_0xd482('0xd'),JSON[_0xd482('0x10')](_0x144d5b));if(_0x144d5b['error']){if(_0x144d5b[_0xd482('0x11')][_0xd482('0x12')]===0x1f4){logger[_0xd482('0x11')](_0xd482('0xc'),_0x5bfc0f,_0x144d5b['error'][_0xd482('0x13')]);return _0x74f369(_0x144d5b[_0xd482('0x11')][_0xd482('0x13')]);}logger['error'](_0xd482('0xc'),_0x5bfc0f,_0x144d5b['error']['message']);return _0x144d7d(_0x144d5b[_0xd482('0x11')]['message']);}else{logger[_0xd482('0xb')](_0xd482('0xc'),_0x5bfc0f,'request\x20sent');_0x144d7d(_0x144d5b[_0xd482('0x14')][_0xd482('0x13')]);}})[_0xd482('0x15')](function(_0x2cc6e1){logger[_0xd482('0x11')]('Integration,\x20%s,\x20%s',_0x5bfc0f,_0x2cc6e1);_0x74f369(_0x2cc6e1);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index fc31922..e8ce13e 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 _0x24e4=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x2455fc,_0x3636da){var _0x1012d6=function(_0x145047){while(--_0x145047){_0x2455fc['push'](_0x2455fc['shift']());}};_0x1012d6(++_0x3636da);}(_0x24e4,0x10e));var _0x424e=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x24e4[_0x310504];return _0x5b36d0;};'use strict';var multer=require(_0x424e('0x0'));var util=require(_0x424e('0x1'));var path=require(_0x424e('0x2'));var timeout=require(_0x424e('0x3'));var express=require(_0x424e('0x4'));var router=express[_0x424e('0x5')]();var auth=require(_0x424e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x424e('0x7'));var controller=require(_0x424e('0x8'));router[_0x424e('0x9')]('/',auth[_0x424e('0xa')](),controller[_0x424e('0xb')]);router[_0x424e('0x9')](_0x424e('0xc'),auth[_0x424e('0xa')](),controller[_0x424e('0xd')]);router['get'](_0x424e('0xe'),auth['isAuthenticated'](),controller[_0x424e('0xf')]);router[_0x424e('0x10')]('/',auth['isAuthenticated'](),controller[_0x424e('0x11')]);router['put'](_0x424e('0xe'),auth[_0x424e('0xa')](),controller[_0x424e('0x12')]);router[_0x424e('0x13')]('/:id',auth[_0x424e('0xa')](),controller[_0x424e('0x14')]);module[_0x424e('0x15')]=router; \ No newline at end of file +var _0x7709=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x367444,_0x1b1dd8){var _0x371d48=function(_0x380019){while(--_0x380019){_0x367444['push'](_0x367444['shift']());}};_0x371d48(++_0x1b1dd8);}(_0x7709,0x175));var _0x9770=function(_0x4d0b3a,_0x1ecf04){_0x4d0b3a=_0x4d0b3a-0x0;var _0x590b05=_0x7709[_0x4d0b3a];return _0x590b05;};'use strict';var multer=require('multer');var util=require(_0x9770('0x0'));var path=require(_0x9770('0x1'));var timeout=require(_0x9770('0x2'));var express=require(_0x9770('0x3'));var router=express['Router']();var auth=require(_0x9770('0x4'));var interaction=require(_0x9770('0x5'));var config=require(_0x9770('0x6'));var controller=require('./integrationReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9770('0x7')]);router[_0x9770('0x8')](_0x9770('0x9'),auth[_0x9770('0xa')](),controller['describe']);router['get'](_0x9770('0xb'),auth[_0x9770('0xa')](),controller[_0x9770('0xc')]);router['post']('/',auth[_0x9770('0xa')](),controller[_0x9770('0xd')]);router[_0x9770('0xe')]('/:id',auth[_0x9770('0xa')](),controller[_0x9770('0xf')]);router[_0x9770('0x10')](_0x9770('0xb'),auth[_0x9770('0xa')](),controller['destroy']);module[_0x9770('0x11')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c04c1f7..1137465 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 _0xd836=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENDING','FAILED','sequelize','exports'];(function(_0x5c9fc0,_0x513be1){var _0x458efa=function(_0x42345f){while(--_0x42345f){_0x5c9fc0['push'](_0x5c9fc0['shift']());}};_0x458efa(++_0x513be1);}(_0xd836,0x1ed));var _0x6d83=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd836[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x6d83('0x0'));module[_0x6d83('0x1')]={'integration':{'type':Sequelize[_0x6d83('0x2')]},'eventChannel':{'type':Sequelize[_0x6d83('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x6d83('0x3')]},'contacts':{'type':Sequelize[_0x6d83('0x2')]},'uniqueid':{'type':Sequelize[_0x6d83('0x2')]},'calleridnum':{'type':Sequelize[_0x6d83('0x2')]},'calleridname':{'type':Sequelize[_0x6d83('0x2')]},'queue':{'type':Sequelize[_0x6d83('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6d83('0x2')]},'agentcalledAt':{'type':Sequelize[_0x6d83('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x6d83('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x6d83('0x4')]},'talktime':{'type':Sequelize[_0x6d83('0x3')]},'agentacw':{'type':Sequelize[_0x6d83('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6d83('0x3')]},'reason':{'type':Sequelize[_0x6d83('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x6d83('0x4')]},'agentdump':{'type':Sequelize[_0x6d83('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x6d83('0x4')]},'lastevent':{'type':Sequelize[_0x6d83('0x2')]},'channel':{'type':Sequelize[_0x6d83('0x2')]},'channelstate':{'type':Sequelize[_0x6d83('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x6d83('0x2')]},'connectedlinename':{'type':Sequelize[_0x6d83('0x2')]},'language':{'type':Sequelize[_0x6d83('0x2')]},'accountcode':{'type':Sequelize[_0x6d83('0x2')]},'context':{'type':Sequelize[_0x6d83('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6d83('0x2')]},'destchannel':{'type':Sequelize[_0x6d83('0x2')]},'destchannelstate':{'type':Sequelize[_0x6d83('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6d83('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6d83('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6d83('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6d83('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6d83('0x2')]},'destcontext':{'type':Sequelize[_0x6d83('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x6d83('0x2')]},'destuniqueid':{'type':Sequelize[_0x6d83('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6d83('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x6d83('0x2')]},'to':{'type':Sequelize[_0x6d83('0x2')]},'cc':{'type':Sequelize[_0x6d83('0x2')]},'attachment':{'type':Sequelize[_0x6d83('0x6')]},'html':{'type':Sequelize[_0x6d83('0x6')]},'text':{'type':Sequelize[_0x6d83('0x6')]},'status':{'type':Sequelize['ENUM']('SENT',_0x6d83('0x7'),'RECEIVED',_0x6d83('0x8'))},'url':{'type':Sequelize[_0x6d83('0x2')]},'app':{'type':Sequelize[_0x6d83('0x2')]},'appdata':{'type':Sequelize[_0x6d83('0x2')]},'projectId':{'type':Sequelize[_0x6d83('0x3')]}}; \ No newline at end of file +var _0x5034=['SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM'];(function(_0x57b1b5,_0x516015){var _0x21520e=function(_0x229d6e){while(--_0x229d6e){_0x57b1b5['push'](_0x57b1b5['shift']());}};_0x21520e(++_0x516015);}(_0x5034,0xb8));var _0x4503=function(_0x37dcd0,_0x304fa1){_0x37dcd0=_0x37dcd0-0x0;var _0x58e19f=_0x5034[_0x37dcd0];return _0x58e19f;};'use strict';var Sequelize=require(_0x4503('0x0'));module[_0x4503('0x1')]={'integration':{'type':Sequelize[_0x4503('0x2')]},'eventChannel':{'type':Sequelize[_0x4503('0x2')]},'exitStatus':{'type':Sequelize[_0x4503('0x2')]},'ticketId':{'type':Sequelize[_0x4503('0x2')]},'integrationId':{'type':Sequelize[_0x4503('0x3')]},'contacts':{'type':Sequelize[_0x4503('0x2')]},'uniqueid':{'type':Sequelize[_0x4503('0x2')]},'calleridnum':{'type':Sequelize[_0x4503('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x4503('0x2')]},'interface':{'type':Sequelize[_0x4503('0x2')]},'membername':{'type':Sequelize[_0x4503('0x2')]},'agentcalledAt':{'type':Sequelize[_0x4503('0x4')]},'agentconnectAt':{'type':Sequelize[_0x4503('0x4')]},'holdtime':{'type':Sequelize[_0x4503('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x4503('0x4')]},'talktime':{'type':Sequelize[_0x4503('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x4503('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x4503('0x4')]},'agentdump':{'type':Sequelize[_0x4503('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x4503('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4503('0x2')]},'channelstate':{'type':Sequelize[_0x4503('0x3')]},'channelstatedesc':{'type':Sequelize[_0x4503('0x2')]},'connectedlinenum':{'type':Sequelize[_0x4503('0x2')]},'connectedlinename':{'type':Sequelize[_0x4503('0x2')]},'language':{'type':Sequelize[_0x4503('0x2')]},'accountcode':{'type':Sequelize[_0x4503('0x2')]},'context':{'type':Sequelize[_0x4503('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4503('0x2')]},'destchannelstate':{'type':Sequelize[_0x4503('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x4503('0x2')]},'destcalleridnum':{'type':Sequelize[_0x4503('0x2')]},'destcalleridname':{'type':Sequelize[_0x4503('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4503('0x2')]},'destaccountcode':{'type':Sequelize[_0x4503('0x2')]},'destcontext':{'type':Sequelize[_0x4503('0x2')]},'destexten':{'type':Sequelize[_0x4503('0x2')]},'destpriority':{'type':Sequelize[_0x4503('0x2')]},'destuniqueid':{'type':Sequelize[_0x4503('0x2')]},'messageId':{'type':Sequelize[_0x4503('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x4503('0x2')]},'from':{'type':Sequelize[_0x4503('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4503('0x2')]},'attachment':{'type':Sequelize[_0x4503('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x4503('0x6')]},'status':{'type':Sequelize[_0x4503('0x7')](_0x4503('0x8'),_0x4503('0x9'),_0x4503('0xa'),_0x4503('0xb'))},'url':{'type':Sequelize[_0x4503('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x4503('0x2')]},'projectId':{'type':Sequelize[_0x4503('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 058af33..496aa16 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 _0x22f0=['jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','IntegrationReport','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x2bed54,_0x16bcc3){var _0x195cf8=function(_0xf523bd){while(--_0xf523bd){_0x2bed54['push'](_0x2bed54['shift']());}};_0x195cf8(++_0x16bcc3);}(_0x22f0,0x15a));var _0x022f=function(_0x29c261,_0x3af39a){_0x29c261=_0x29c261-0x0;var _0x1a9335=_0x22f0[_0x29c261];return _0x1a9335;};'use strict';var pdf=require(_0x022f('0x0'));var emlformat=require(_0x022f('0x1'));var rimraf=require(_0x022f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x022f('0x3'));var rp=require(_0x022f('0x4'));var moment=require(_0x022f('0x5'));var BPromise=require(_0x022f('0x6'));var Mustache=require('mustache');var util=require(_0x022f('0x7'));var path=require(_0x022f('0x8'));var sox=require('sox');var csv=require(_0x022f('0x9'));var ejs=require(_0x022f('0xa'));var fs=require('fs');var _=require(_0x022f('0xb'));var squel=require(_0x022f('0xc'));var crypto=require(_0x022f('0xd'));var jsforce=require(_0x022f('0xe'));var deskjs=require(_0x022f('0xf'));var toCsv=require(_0x022f('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x022f('0x10'));var authService=require(_0x022f('0x11'));var qs=require(_0x022f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x022f('0x13'));var utils=require('../../config/utils');var config=require(_0x022f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c08eb,_0x234d1c){_0x234d1c=_0x234d1c||0xcc;return function(_0x552867){if(_0x552867){return _0x3c08eb[_0x022f('0x15')](_0x234d1c);}return _0x3c08eb[_0x022f('0x16')](_0x234d1c)[_0x022f('0x17')]();};}function respondWithResult(_0x479bc1,_0x453e4d){_0x453e4d=_0x453e4d||0xc8;return function(_0xc022c4){if(_0xc022c4){return _0x479bc1[_0x022f('0x16')](_0x453e4d)[_0x022f('0x18')](_0xc022c4);}};}function respondWithFilteredResult(_0x2b0f11,_0x19b12a){return function(_0x3554b5){if(_0x3554b5){var _0x220d65=_0x3554b5[_0x022f('0x19')],_0x312b3e=_0x19b12a[_0x022f('0x1a')],_0x30b755=_0x19b12a['offset']+_0x19b12a['limit'],_0x3f1d1c;if(_0x30b755>=_0x220d65){_0x30b755=_0x220d65;_0x3f1d1c=0xc8;}else{_0x3f1d1c=0xce;}_0x2b0f11[_0x022f('0x16')](_0x3f1d1c);return _0x2b0f11[_0x022f('0x1b')]('Content-Range',_0x312b3e+'-'+_0x30b755+'/'+_0x220d65)[_0x022f('0x18')](_0x3554b5);}return null;};}function patchUpdates(_0x4b0535){return function(_0x3893c0){try{jsonpatch[_0x022f('0x1c')](_0x3893c0,_0x4b0535,!![]);}catch(_0x1a6082){return BPromise[_0x022f('0x1d')](_0x1a6082);}return _0x3893c0[_0x022f('0x1e')]();};}function saveUpdates(_0x3eec86,_0x556c23){return function(_0x10e8d0){if(_0x10e8d0){return _0x10e8d0[_0x022f('0x1f')](_0x3eec86)[_0x022f('0x20')](function(_0x52acdd){return _0x52acdd;});}return null;};}function removeEntity(_0x273d0c,_0x1daec4){return function(_0x5ee365){if(_0x5ee365){return _0x5ee365[_0x022f('0x21')]()[_0x022f('0x20')](function(){_0x273d0c['status'](0xcc)[_0x022f('0x17')]();});}};}function handleEntityNotFound(_0x10a08a,_0x4682bd){return function(_0x55554d){if(!_0x55554d){_0x10a08a[_0x022f('0x15')](0x194);}return _0x55554d;};}function handleError(_0x5198cb,_0x4fa3f4){_0x4fa3f4=_0x4fa3f4||0x1f4;return function(_0x36f8ca){logger[_0x022f('0x22')](_0x36f8ca[_0x022f('0x23')]);if(_0x36f8ca[_0x022f('0x24')]){delete _0x36f8ca[_0x022f('0x24')];}_0x5198cb['status'](_0x4fa3f4)[_0x022f('0x25')](_0x36f8ca);};}exports['index']=function(_0x10b1d2,_0x2996f5){var _0x1c53be={},_0x245526={},_0x32ba1f={'count':0x0,'rows':[]};var _0x2f1b38=_[_0x022f('0x26')](db[_0x022f('0x27')][_0x022f('0x28')],function(_0x2c9b15){return{'name':_0x2c9b15['fieldName'],'type':_0x2c9b15['type'][_0x022f('0x29')]};});_0x245526[_0x022f('0x2a')]=_['map'](_0x2f1b38,_0x022f('0x24'));_0x245526[_0x022f('0x2b')]=_['keys'](_0x10b1d2[_0x022f('0x2b')]);_0x245526[_0x022f('0x2c')]=_['intersection'](_0x245526[_0x022f('0x2a')],_0x245526['query']);_0x1c53be[_0x022f('0x2d')]=_[_0x022f('0x2e')](_0x245526[_0x022f('0x2a')],qs[_0x022f('0x2f')](_0x10b1d2[_0x022f('0x2b')][_0x022f('0x2f')]));_0x1c53be[_0x022f('0x2d')]=_0x1c53be['attributes'][_0x022f('0x30')]?_0x1c53be[_0x022f('0x2d')]:_0x245526[_0x022f('0x2a')];if(!_0x10b1d2[_0x022f('0x2b')][_0x022f('0x31')](_0x022f('0x32'))){_0x1c53be[_0x022f('0x33')]=qs[_0x022f('0x33')](_0x10b1d2[_0x022f('0x2b')]['limit']);_0x1c53be[_0x022f('0x1a')]=qs['offset'](_0x10b1d2[_0x022f('0x2b')][_0x022f('0x1a')]);}_0x1c53be[_0x022f('0x34')]=qs['sort'](_0x10b1d2[_0x022f('0x2b')]['sort']);_0x1c53be[_0x022f('0x35')]=qs[_0x022f('0x2c')](_[_0x022f('0x36')](_0x10b1d2[_0x022f('0x2b')],_0x245526[_0x022f('0x2c')]),_0x2f1b38);if(_0x10b1d2[_0x022f('0x2b')][_0x022f('0x37')]){_0x1c53be[_0x022f('0x35')]=_[_0x022f('0x38')](_0x1c53be[_0x022f('0x35')],{'$or':_[_0x022f('0x26')](_0x2f1b38,function(_0x5b3d79){if(_0x5b3d79[_0x022f('0x39')]!==_0x022f('0x3a')){var _0x59ddd5={};_0x59ddd5[_0x5b3d79['name']]={'$like':'%'+_0x10b1d2[_0x022f('0x2b')]['filter']+'%'};return _0x59ddd5;}})});}_0x1c53be=_[_0x022f('0x38')]({},_0x1c53be,_0x10b1d2[_0x022f('0x3b')]);var _0x1f474f={'where':_0x1c53be['where']};return db['IntegrationReport'][_0x022f('0x19')](_0x1f474f)[_0x022f('0x20')](function(_0x42c6be){_0x32ba1f[_0x022f('0x19')]=_0x42c6be;if(_0x10b1d2['query']['includeAll']){_0x1c53be[_0x022f('0x3c')]=[{'all':!![]}];}return db[_0x022f('0x27')][_0x022f('0x3d')](_0x1c53be);})[_0x022f('0x20')](function(_0x1fa882){_0x32ba1f[_0x022f('0x3e')]=_0x1fa882;return _0x32ba1f;})[_0x022f('0x20')](respondWithFilteredResult(_0x2996f5,_0x1c53be))[_0x022f('0x3f')](handleError(_0x2996f5,null));};exports[_0x022f('0x40')]=function(_0x156a0b,_0x290932){var _0x302ef2={'raw':![],'where':{'id':_0x156a0b[_0x022f('0x41')]['id']}},_0x3fd885={};_0x3fd885[_0x022f('0x2a')]=_[_0x022f('0x42')](db[_0x022f('0x27')][_0x022f('0x28')]);_0x3fd885[_0x022f('0x2b')]=_[_0x022f('0x42')](_0x156a0b[_0x022f('0x2b')]);_0x3fd885[_0x022f('0x2c')]=_['intersection'](_0x3fd885['model'],_0x3fd885[_0x022f('0x2b')]);_0x302ef2[_0x022f('0x2d')]=_[_0x022f('0x2e')](_0x3fd885[_0x022f('0x2a')],qs['fields'](_0x156a0b[_0x022f('0x2b')]['fields']));_0x302ef2[_0x022f('0x2d')]=_0x302ef2[_0x022f('0x2d')][_0x022f('0x30')]?_0x302ef2['attributes']:_0x3fd885[_0x022f('0x2a')];if(_0x156a0b[_0x022f('0x2b')][_0x022f('0x43')]){_0x302ef2[_0x022f('0x3c')]=[{'all':!![]}];}_0x302ef2=_[_0x022f('0x38')]({},_0x302ef2,_0x156a0b['options']);return db[_0x022f('0x27')][_0x022f('0x44')](_0x302ef2)['then'](handleEntityNotFound(_0x290932,null))[_0x022f('0x20')](respondWithResult(_0x290932,null))[_0x022f('0x3f')](handleError(_0x290932,null));};exports['create']=function(_0x10bc67,_0x414dc8){return db[_0x022f('0x27')][_0x022f('0x45')](_0x10bc67[_0x022f('0x46')],{})[_0x022f('0x20')](respondWithResult(_0x414dc8,0xc9))[_0x022f('0x3f')](handleError(_0x414dc8,null));};exports[_0x022f('0x1f')]=function(_0x7e5fad,_0xbfa308){if(_0x7e5fad[_0x022f('0x46')]['id']){delete _0x7e5fad[_0x022f('0x46')]['id'];}return db[_0x022f('0x27')]['find']({'where':{'id':_0x7e5fad['params']['id']}})[_0x022f('0x20')](handleEntityNotFound(_0xbfa308,null))['then'](saveUpdates(_0x7e5fad[_0x022f('0x46')],null))[_0x022f('0x20')](respondWithResult(_0xbfa308,null))['catch'](handleError(_0xbfa308,null));};exports[_0x022f('0x21')]=function(_0x17ffb1,_0x14a079){return db[_0x022f('0x27')]['find']({'where':{'id':_0x17ffb1[_0x022f('0x41')]['id']}})[_0x022f('0x20')](handleEntityNotFound(_0x14a079,null))[_0x022f('0x20')](removeEntity(_0x14a079,null))[_0x022f('0x3f')](handleError(_0x14a079,null));};exports[_0x022f('0x47')]=function(_0x2cc35c,_0x5ecc4f){return db[_0x022f('0x27')][_0x022f('0x47')]()[_0x022f('0x20')](respondWithResult(_0x5ecc4f,null))[_0x022f('0x3f')](handleError(_0x5ecc4f,null));}; \ No newline at end of file +var _0xd7ce=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x499b56,_0x308586){var _0x2910a4=function(_0x11186d){while(--_0x11186d){_0x499b56['push'](_0x499b56['shift']());}};_0x2910a4(++_0x308586);}(_0xd7ce,0x116));var _0xed7c=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0xd7ce[_0x55cc58];return _0x26062e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xed7c('0x0'));var zipdir=require(_0xed7c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed7c('0x2'));var moment=require(_0xed7c('0x3'));var BPromise=require(_0xed7c('0x4'));var Mustache=require(_0xed7c('0x5'));var util=require(_0xed7c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xed7c('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xed7c('0x8'));var squel=require(_0xed7c('0x9'));var crypto=require(_0xed7c('0xa'));var jsforce=require(_0xed7c('0xb'));var deskjs=require(_0xed7c('0xc'));var toCsv=require(_0xed7c('0x7'));var querystring=require(_0xed7c('0xd'));var Papa=require(_0xed7c('0xe'));var Redis=require(_0xed7c('0xf'));var authService=require(_0xed7c('0x10'));var qs=require(_0xed7c('0x11'));var as=require(_0xed7c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xed7c('0x13'));var utils=require(_0xed7c('0x14'));var config=require(_0xed7c('0x15'));var db=require(_0xed7c('0x16'))['db'];function respondWithStatusCode(_0xd009f2,_0x137d1c){_0x137d1c=_0x137d1c||0xcc;return function(_0x53967b){if(_0x53967b){return _0xd009f2[_0xed7c('0x17')](_0x137d1c);}return _0xd009f2[_0xed7c('0x18')](_0x137d1c)[_0xed7c('0x19')]();};}function respondWithResult(_0x4c456e,_0x32b9f3){_0x32b9f3=_0x32b9f3||0xc8;return function(_0x34415c){if(_0x34415c){return _0x4c456e[_0xed7c('0x18')](_0x32b9f3)[_0xed7c('0x1a')](_0x34415c);}};}function respondWithFilteredResult(_0x1c13fc,_0xc6384b){return function(_0x142c1d){if(_0x142c1d){var _0x58b1bd=_0x142c1d[_0xed7c('0x1b')],_0x2b540c=_0xc6384b[_0xed7c('0x1c')],_0x5ab4cb=_0xc6384b[_0xed7c('0x1c')]+_0xc6384b[_0xed7c('0x1d')],_0x35a72b;if(_0x5ab4cb>=_0x58b1bd){_0x5ab4cb=_0x58b1bd;_0x35a72b=0xc8;}else{_0x35a72b=0xce;}_0x1c13fc[_0xed7c('0x18')](_0x35a72b);return _0x1c13fc[_0xed7c('0x1e')](_0xed7c('0x1f'),_0x2b540c+'-'+_0x5ab4cb+'/'+_0x58b1bd)['json'](_0x142c1d);}return null;};}function patchUpdates(_0x22672d){return function(_0x599958){try{jsonpatch[_0xed7c('0x20')](_0x599958,_0x22672d,!![]);}catch(_0x31bc4f){return BPromise[_0xed7c('0x21')](_0x31bc4f);}return _0x599958[_0xed7c('0x22')]();};}function saveUpdates(_0xb87c9b,_0x348a87){return function(_0x21815d){if(_0x21815d){return _0x21815d[_0xed7c('0x23')](_0xb87c9b)[_0xed7c('0x24')](function(_0x59298f){return _0x59298f;});}return null;};}function removeEntity(_0x2004cb,_0x33ba29){return function(_0x8338d4){if(_0x8338d4){return _0x8338d4[_0xed7c('0x25')]()[_0xed7c('0x24')](function(){_0x2004cb[_0xed7c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44f892,_0x59e905){return function(_0x1b85e6){if(!_0x1b85e6){_0x44f892[_0xed7c('0x17')](0x194);}return _0x1b85e6;};}function handleError(_0xa255dc,_0x8cc1ec){_0x8cc1ec=_0x8cc1ec||0x1f4;return function(_0x16554b){logger['error'](_0x16554b['stack']);if(_0x16554b[_0xed7c('0x26')]){delete _0x16554b['name'];}_0xa255dc[_0xed7c('0x18')](_0x8cc1ec)[_0xed7c('0x27')](_0x16554b);};}exports[_0xed7c('0x28')]=function(_0x5691bc,_0x2f3ea9){var _0x53ca1b={},_0x567501={},_0x57ca1f={'count':0x0,'rows':[]};var _0x2cbe3c=_[_0xed7c('0x29')](db[_0xed7c('0x2a')][_0xed7c('0x2b')],function(_0x6a4326){return{'name':_0x6a4326[_0xed7c('0x2c')],'type':_0x6a4326[_0xed7c('0x2d')][_0xed7c('0x2e')]};});_0x567501[_0xed7c('0x2f')]=_[_0xed7c('0x29')](_0x2cbe3c,_0xed7c('0x26'));_0x567501[_0xed7c('0x30')]=_[_0xed7c('0x31')](_0x5691bc['query']);_0x567501[_0xed7c('0x32')]=_['intersection'](_0x567501['model'],_0x567501[_0xed7c('0x30')]);_0x53ca1b[_0xed7c('0x33')]=_[_0xed7c('0x34')](_0x567501[_0xed7c('0x2f')],qs[_0xed7c('0x35')](_0x5691bc[_0xed7c('0x30')][_0xed7c('0x35')]));_0x53ca1b[_0xed7c('0x33')]=_0x53ca1b[_0xed7c('0x33')][_0xed7c('0x36')]?_0x53ca1b[_0xed7c('0x33')]:_0x567501[_0xed7c('0x2f')];if(!_0x5691bc[_0xed7c('0x30')][_0xed7c('0x37')](_0xed7c('0x38'))){_0x53ca1b['limit']=qs[_0xed7c('0x1d')](_0x5691bc[_0xed7c('0x30')][_0xed7c('0x1d')]);_0x53ca1b['offset']=qs[_0xed7c('0x1c')](_0x5691bc[_0xed7c('0x30')][_0xed7c('0x1c')]);}_0x53ca1b[_0xed7c('0x39')]=qs[_0xed7c('0x3a')](_0x5691bc[_0xed7c('0x30')][_0xed7c('0x3a')]);_0x53ca1b[_0xed7c('0x3b')]=qs[_0xed7c('0x32')](_[_0xed7c('0x3c')](_0x5691bc[_0xed7c('0x30')],_0x567501['filters']),_0x2cbe3c);if(_0x5691bc[_0xed7c('0x30')][_0xed7c('0x3d')]){_0x53ca1b[_0xed7c('0x3b')]=_[_0xed7c('0x3e')](_0x53ca1b['where'],{'$or':_['map'](_0x2cbe3c,function(_0x2e847d){if(_0x2e847d[_0xed7c('0x2d')]!=='VIRTUAL'){var _0x61feab={};_0x61feab[_0x2e847d[_0xed7c('0x26')]]={'$like':'%'+_0x5691bc['query'][_0xed7c('0x3d')]+'%'};return _0x61feab;}})});}_0x53ca1b=_['merge']({},_0x53ca1b,_0x5691bc[_0xed7c('0x3f')]);var _0x1307bb={'where':_0x53ca1b['where']};return db[_0xed7c('0x2a')][_0xed7c('0x1b')](_0x1307bb)[_0xed7c('0x24')](function(_0x3f51b9){_0x57ca1f[_0xed7c('0x1b')]=_0x3f51b9;if(_0x5691bc[_0xed7c('0x30')][_0xed7c('0x40')]){_0x53ca1b['include']=[{'all':!![]}];}return db[_0xed7c('0x2a')][_0xed7c('0x41')](_0x53ca1b);})[_0xed7c('0x24')](function(_0xb5e01d){_0x57ca1f[_0xed7c('0x42')]=_0xb5e01d;return _0x57ca1f;})['then'](respondWithFilteredResult(_0x2f3ea9,_0x53ca1b))[_0xed7c('0x43')](handleError(_0x2f3ea9,null));};exports['show']=function(_0x4f9e45,_0x520205){var _0xe24f52={'raw':![],'where':{'id':_0x4f9e45[_0xed7c('0x44')]['id']}},_0x35fa2e={};_0x35fa2e[_0xed7c('0x2f')]=_[_0xed7c('0x31')](db[_0xed7c('0x2a')][_0xed7c('0x2b')]);_0x35fa2e['query']=_[_0xed7c('0x31')](_0x4f9e45[_0xed7c('0x30')]);_0x35fa2e[_0xed7c('0x32')]=_[_0xed7c('0x34')](_0x35fa2e['model'],_0x35fa2e[_0xed7c('0x30')]);_0xe24f52[_0xed7c('0x33')]=_[_0xed7c('0x34')](_0x35fa2e[_0xed7c('0x2f')],qs[_0xed7c('0x35')](_0x4f9e45[_0xed7c('0x30')][_0xed7c('0x35')]));_0xe24f52[_0xed7c('0x33')]=_0xe24f52[_0xed7c('0x33')]['length']?_0xe24f52[_0xed7c('0x33')]:_0x35fa2e['model'];if(_0x4f9e45['query'][_0xed7c('0x40')]){_0xe24f52['include']=[{'all':!![]}];}_0xe24f52=_[_0xed7c('0x3e')]({},_0xe24f52,_0x4f9e45[_0xed7c('0x3f')]);return db[_0xed7c('0x2a')][_0xed7c('0x45')](_0xe24f52)[_0xed7c('0x24')](handleEntityNotFound(_0x520205,null))[_0xed7c('0x24')](respondWithResult(_0x520205,null))[_0xed7c('0x43')](handleError(_0x520205,null));};exports[_0xed7c('0x46')]=function(_0x5c3f95,_0xe07e33){return db['IntegrationReport'][_0xed7c('0x46')](_0x5c3f95[_0xed7c('0x47')],{})[_0xed7c('0x24')](respondWithResult(_0xe07e33,0xc9))['catch'](handleError(_0xe07e33,null));};exports[_0xed7c('0x23')]=function(_0x4c633b,_0x4f2c02){if(_0x4c633b[_0xed7c('0x47')]['id']){delete _0x4c633b[_0xed7c('0x47')]['id'];}return db['IntegrationReport'][_0xed7c('0x45')]({'where':{'id':_0x4c633b[_0xed7c('0x44')]['id']}})[_0xed7c('0x24')](handleEntityNotFound(_0x4f2c02,null))[_0xed7c('0x24')](saveUpdates(_0x4c633b['body'],null))[_0xed7c('0x24')](respondWithResult(_0x4f2c02,null))['catch'](handleError(_0x4f2c02,null));};exports[_0xed7c('0x25')]=function(_0x12fb79,_0x183f5){return db[_0xed7c('0x2a')][_0xed7c('0x45')]({'where':{'id':_0x12fb79[_0xed7c('0x44')]['id']}})[_0xed7c('0x24')](handleEntityNotFound(_0x183f5,null))[_0xed7c('0x24')](removeEntity(_0x183f5,null))[_0xed7c('0x43')](handleError(_0x183f5,null));};exports[_0xed7c('0x48')]=function(_0x278159,_0x4ea151){return db[_0xed7c('0x2a')][_0xed7c('0x48')]()['then'](respondWithResult(_0x4ea151,null))['catch'](handleError(_0x4ea151,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 6a21756..241ec45 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 _0xf9a6=['define','IntegrationReport','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0xf9a6,0x199));var _0x6f9a=function(_0x370a3f,_0x52ea7b){_0x370a3f=_0x370a3f-0x0;var _0x31f2f1=_0xf9a6[_0x370a3f];return _0x31f2f1;};'use strict';var _=require(_0x6f9a('0x0'));var util=require(_0x6f9a('0x1'));var logger=require('../../config/logger')(_0x6f9a('0x2'));var moment=require(_0x6f9a('0x3'));var BPromise=require('bluebird');var rp=require(_0x6f9a('0x4'));var fs=require('fs');var path=require(_0x6f9a('0x5'));var rimraf=require(_0x6f9a('0x6'));var config=require(_0x6f9a('0x7'));var attributes=require(_0x6f9a('0x8'));module['exports']=function(_0x14e38f,_0x3ef688){return _0x14e38f[_0x6f9a('0x9')](_0x6f9a('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbadc=['./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0xbadc,0x19b));var _0xcbad=function(_0x49f30e,_0xf28439){_0x49f30e=_0x49f30e-0x0;var _0x2cafd5=_0xbadc[_0x49f30e];return _0x2cafd5;};'use strict';var _=require(_0xcbad('0x0'));var util=require(_0xcbad('0x1'));var logger=require(_0xcbad('0x2'))(_0xcbad('0x3'));var moment=require(_0xcbad('0x4'));var BPromise=require(_0xcbad('0x5'));var rp=require(_0xcbad('0x6'));var fs=require('fs');var path=require(_0xcbad('0x7'));var rimraf=require(_0xcbad('0x8'));var config=require('../../config/environment');var attributes=require(_0xcbad('0x9'));module[_0xcbad('0xa')]=function(_0x51fa0f,_0x52a2ce){return _0x51fa0f[_0xcbad('0xb')](_0xcbad('0xc'),attributes,{'tableName':_0xcbad('0xd'),'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 6ed27ba..da32024 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 _0x0b0e=['IntegrationReport,\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','IntegrationReport,\x20%s,\x20%s','debug'];(function(_0x5ecadc,_0x1cf9f1){var _0x565037=function(_0x22908b){while(--_0x22908b){_0x5ecadc['push'](_0x5ecadc['shift']());}};_0x565037(++_0x1cf9f1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x0b0e[_0x5f1391];return _0x50ebe3;};'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')]('IntegrationReport,\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 +var _0x757a=['request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2e983c,_0x248029){var _0x58e54f=function(_0x4bd6d4){while(--_0x4bd6d4){_0x2e983c['push'](_0x2e983c['shift']());}};_0x58e54f(++_0x248029);}(_0x757a,0xde));var _0xa757=function(_0x1cec13,_0xed7102){_0x1cec13=_0x1cec13-0x0;var _0x5ada13=_0x757a[_0x1cec13];return _0x5ada13;};'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']('IntegrationReport,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('IntegrationReport,\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);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 200e356..6f8acbf 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 _0x34e8=['./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54d20d,_0x2c085d){var _0x2f84b7=function(_0x4488ca){while(--_0x4488ca){_0x54d20d['push'](_0x54d20d['shift']());}};_0x2f84b7(++_0x2c085d);}(_0x34e8,0x12c));var _0x834e=function(_0x540d0c,_0x56bc0d){_0x540d0c=_0x540d0c-0x0;var _0x2361b8=_0x34e8[_0x540d0c];return _0x2361b8;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0xe')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);router['put'](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['update']);router[_0x834e('0x14')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller[_0x834e('0x15')]);module['exports']=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(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x55ca,0x126));var _0xa55c=function(_0x29c934,_0x3c30e2){_0x29c934=_0x29c934-0x0;var _0x4302de=_0x55ca[_0x29c934];return _0x4302de;};'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 c12c58b..e0fb825 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 _0xfb6a=['exports','STRING','sequelize'];(function(_0x577b55,_0x38a861){var _0x224c94=function(_0x51842a){while(--_0x51842a){_0x577b55['push'](_0x577b55['shift']());}};_0x224c94(++_0x38a861);}(_0xfb6a,0xe9));var _0xafb6=function(_0x3ef45e,_0xe84f33){_0x3ef45e=_0x3ef45e-0x0;var _0x69e7c=_0xfb6a[_0x3ef45e];return _0x69e7c;};'use strict';var Sequelize=require(_0xafb6('0x0'));module[_0xafb6('0x1')]={'name':{'type':Sequelize[_0xafb6('0x2')]},'description':{'type':Sequelize[_0xafb6('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x4552=['exports','STRING','sequelize'];(function(_0x504c05,_0x2fe006){var _0x31c04a=function(_0x2cfd18){while(--_0x2cfd18){_0x504c05['push'](_0x504c05['shift']());}};_0x31c04a(++_0x2fe006);}(_0x4552,0x1eb));var _0x2455=function(_0x3f7548,_0x551325){_0x3f7548=_0x3f7548-0x0;var _0x51e5fd=_0x4552[_0x3f7548];return _0x51e5fd;};'use strict';var Sequelize=require(_0x2455('0x0'));module[_0x2455('0x1')]={'name':{'type':Sequelize[_0x2455('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2455('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 efbb3af..1fd69e6 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 _0x16f6=['attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','order','getIntervals','findOne','params','bulkCreate','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/extensions/rewrite','sendStatus','status','end','offset','limit','set','apply','save','update','destroy','then','get','Intervals','UserProfileResource','stack','name','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x534ca2,_0x47f568){var _0x532552=function(_0x10e22c){while(--_0x10e22c){_0x534ca2['push'](_0x534ca2['shift']());}};_0x532552(++_0x47f568);}(_0x16f6,0x1be));var _0x616f=function(_0x181719,_0x1ff98b){_0x181719=_0x181719-0x0;var _0x4b3074=_0x16f6[_0x181719];return _0x4b3074;};'use strict';var pdf=require(_0x616f('0x0'));var emlformat=require(_0x616f('0x1'));var rimraf=require(_0x616f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x616f('0x3'));var rp=require('request-promise');var moment=require(_0x616f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x616f('0x5'));var util=require(_0x616f('0x6'));var path=require(_0x616f('0x7'));var sox=require(_0x616f('0x8'));var csv=require(_0x616f('0x9'));var ejs=require(_0x616f('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x616f('0xb'));var crypto=require(_0x616f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x616f('0x9'));var querystring=require(_0x616f('0xd'));var Papa=require(_0x616f('0xe'));var Redis=require(_0x616f('0xf'));var authService=require(_0x616f('0x10'));var qs=require(_0x616f('0x11'));var as=require(_0x616f('0x12'));var hardwareService=require(_0x616f('0x13'));var logger=require(_0x616f('0x14'))(_0x616f('0x15'));var utils=require('../../config/utils');var config=require(_0x616f('0x16'));var db=require('../../mysqldb')['db'];var extensions=require(_0x616f('0x17'));function respondWithStatusCode(_0x188c6c,_0x5f23ea){_0x5f23ea=_0x5f23ea||0xcc;return function(_0x49b610){if(_0x49b610){return _0x188c6c[_0x616f('0x18')](_0x5f23ea);}return _0x188c6c[_0x616f('0x19')](_0x5f23ea)[_0x616f('0x1a')]();};}function respondWithResult(_0x2d88fd,_0x32a2b5){_0x32a2b5=_0x32a2b5||0xc8;return function(_0x51202a){if(_0x51202a){return _0x2d88fd[_0x616f('0x19')](_0x32a2b5)['json'](_0x51202a);}};}function respondWithFilteredResult(_0x2d76aa,_0x40660b){return function(_0x4af370){if(_0x4af370){var _0x4c949d=_0x4af370['count'],_0x571b37=_0x40660b[_0x616f('0x1b')],_0x13773b=_0x40660b['offset']+_0x40660b[_0x616f('0x1c')],_0x2d2025;if(_0x13773b>=_0x4c949d){_0x13773b=_0x4c949d;_0x2d2025=0xc8;}else{_0x2d2025=0xce;}_0x2d76aa[_0x616f('0x19')](_0x2d2025);return _0x2d76aa[_0x616f('0x1d')]('Content-Range',_0x571b37+'-'+_0x13773b+'/'+_0x4c949d)['json'](_0x4af370);}return null;};}function patchUpdates(_0x14aa69){return function(_0x2aef73){try{jsonpatch[_0x616f('0x1e')](_0x2aef73,_0x14aa69,!![]);}catch(_0x22a81f){return BPromise['reject'](_0x22a81f);}return _0x2aef73[_0x616f('0x1f')]();};}function saveUpdates(_0x48aac4,_0x13791f){return function(_0x4be400){if(_0x4be400){return _0x4be400[_0x616f('0x20')](_0x48aac4)['then'](function(_0x2dd472){return _0x2dd472;});}return null;};}function removeEntity(_0x49dcb3,_0x27745a){return function(_0x4ef0fa){if(_0x4ef0fa){return _0x4ef0fa[_0x616f('0x21')]()[_0x616f('0x22')](function(){var _0x1b47ae=_0x4ef0fa[_0x616f('0x23')]({'plain':!![]});var _0x2648be=_0x616f('0x24');return db[_0x616f('0x25')]['destroy']({'where':{'type':_0x2648be,'resourceId':_0x1b47ae['id']}})['then'](function(){return _0x4ef0fa;});})[_0x616f('0x22')](function(){_0x49dcb3[_0x616f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c11ad,_0x5b82e5){return function(_0x3afd0f){if(!_0x3afd0f){_0x1c11ad[_0x616f('0x18')](0x194);}return _0x3afd0f;};}function handleError(_0x438726,_0x56e63f){_0x56e63f=_0x56e63f||0x1f4;return function(_0x564dab){logger['error'](_0x564dab[_0x616f('0x26')]);if(_0x564dab[_0x616f('0x27')]){delete _0x564dab[_0x616f('0x27')];}_0x438726[_0x616f('0x19')](_0x56e63f)['send'](_0x564dab);};}exports[_0x616f('0x28')]=function(_0x18ea7,_0x5c4d90){var _0x33a275={},_0x4d2a8f={},_0x1f7916={'count':0x0,'rows':[]};var _0x4ac2e8=_[_0x616f('0x29')](db[_0x616f('0x2a')][_0x616f('0x2b')],function(_0x1c7cca){return{'name':_0x1c7cca[_0x616f('0x2c')],'type':_0x1c7cca[_0x616f('0x2d')][_0x616f('0x2e')]};});_0x4d2a8f[_0x616f('0x2f')]=_['map'](_0x4ac2e8,_0x616f('0x27'));_0x4d2a8f[_0x616f('0x30')]=_[_0x616f('0x31')](_0x18ea7[_0x616f('0x30')]);_0x4d2a8f[_0x616f('0x32')]=_[_0x616f('0x33')](_0x4d2a8f[_0x616f('0x2f')],_0x4d2a8f[_0x616f('0x30')]);_0x33a275[_0x616f('0x34')]=_[_0x616f('0x33')](_0x4d2a8f['model'],qs[_0x616f('0x35')](_0x18ea7[_0x616f('0x30')]['fields']));_0x33a275['attributes']=_0x33a275['attributes'][_0x616f('0x36')]?_0x33a275[_0x616f('0x34')]:_0x4d2a8f[_0x616f('0x2f')];if(!_0x18ea7[_0x616f('0x30')][_0x616f('0x37')](_0x616f('0x38'))){_0x33a275[_0x616f('0x1c')]=qs[_0x616f('0x1c')](_0x18ea7[_0x616f('0x30')][_0x616f('0x1c')]);_0x33a275[_0x616f('0x1b')]=qs[_0x616f('0x1b')](_0x18ea7['query'][_0x616f('0x1b')]);}_0x33a275['order']=qs['sort'](_0x18ea7[_0x616f('0x30')][_0x616f('0x39')]);_0x33a275[_0x616f('0x3a')]=qs['filters'](_[_0x616f('0x3b')](_0x18ea7[_0x616f('0x30')],_0x4d2a8f['filters']),_0x4ac2e8);if(_0x18ea7[_0x616f('0x30')]['filter']){_0x33a275[_0x616f('0x3a')]=_[_0x616f('0x3c')](_0x33a275['where'],{'$or':_[_0x616f('0x29')](_0x4ac2e8,function(_0x701407){if(_0x701407[_0x616f('0x2d')]!==_0x616f('0x3d')){var _0x40b635={};_0x40b635[_0x701407['name']]={'$like':'%'+_0x18ea7[_0x616f('0x30')]['filter']+'%'};return _0x40b635;}})});}_0x33a275=_[_0x616f('0x3c')]({},_0x33a275,_0x18ea7[_0x616f('0x3e')]);var _0x5c3cde={'where':_0x33a275[_0x616f('0x3a')]};return db[_0x616f('0x2a')][_0x616f('0x3f')](_0x5c3cde)[_0x616f('0x22')](function(_0x11265f){_0x1f7916[_0x616f('0x3f')]=_0x11265f;if(_0x18ea7[_0x616f('0x30')][_0x616f('0x40')]){_0x33a275[_0x616f('0x41')]=[{'all':!![]}];}return db[_0x616f('0x2a')][_0x616f('0x42')](_0x33a275);})[_0x616f('0x22')](function(_0x438780){_0x1f7916[_0x616f('0x43')]=_0x438780;return _0x1f7916;})[_0x616f('0x22')](respondWithFilteredResult(_0x5c4d90,_0x33a275))[_0x616f('0x44')](handleError(_0x5c4d90,null));};exports[_0x616f('0x45')]=function(_0x13586f,_0xeaeda0){var _0x1a95e5={'raw':!![],'where':{'id':_0x13586f['params']['id']}},_0x41ac70={};_0x41ac70['model']=_[_0x616f('0x31')](db['Interval'][_0x616f('0x2b')]);_0x41ac70[_0x616f('0x30')]=_['keys'](_0x13586f[_0x616f('0x30')]);_0x41ac70[_0x616f('0x32')]=_['intersection'](_0x41ac70[_0x616f('0x2f')],_0x41ac70[_0x616f('0x30')]);_0x1a95e5[_0x616f('0x34')]=_[_0x616f('0x33')](_0x41ac70[_0x616f('0x2f')],qs[_0x616f('0x35')](_0x13586f[_0x616f('0x30')][_0x616f('0x35')]));_0x1a95e5[_0x616f('0x34')]=_0x1a95e5[_0x616f('0x34')]['length']?_0x1a95e5[_0x616f('0x34')]:_0x41ac70[_0x616f('0x2f')];if(_0x13586f[_0x616f('0x30')]['includeAll']){_0x1a95e5['include']=[{'all':!![]}];}_0x1a95e5=_['merge']({},_0x1a95e5,_0x13586f[_0x616f('0x3e')]);return db[_0x616f('0x2a')][_0x616f('0x46')](_0x1a95e5)[_0x616f('0x22')](handleEntityNotFound(_0xeaeda0,null))[_0x616f('0x22')](respondWithResult(_0xeaeda0,null))[_0x616f('0x44')](handleError(_0xeaeda0,null));};exports[_0x616f('0x47')]=function(_0x2686bb,_0x72f93a){return db[_0x616f('0x2a')][_0x616f('0x47')](_0x2686bb['body'],{})[_0x616f('0x22')](function(_0x15d250){var _0x4060ee=_0x2686bb[_0x616f('0x48')][_0x616f('0x23')]({'plain':!![]});if(!_0x4060ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4060ee[_0x616f('0x49')]===_0x616f('0x48')){var _0x53dce3=_0x15d250[_0x616f('0x23')]({'plain':!![]});var _0x11bcc8=_0x616f('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x11bcc8,'userProfileId':_0x4060ee[_0x616f('0x4a')]},'raw':!![]})[_0x616f('0x22')](function(_0x32142d){if(_0x32142d&&_0x32142d['autoAssociation']===0x0){return db[_0x616f('0x25')][_0x616f('0x47')]({'name':_0x53dce3['name'],'resourceId':_0x53dce3['id'],'type':_0x32142d[_0x616f('0x27')],'sectionId':_0x32142d['id']},{})[_0x616f('0x22')](function(){return _0x15d250;});}else{return _0x15d250;}})['catch'](function(_0x4597b0){logger['error'](_0x616f('0x4b'),_0x4597b0);throw _0x4597b0;});}return _0x15d250;})[_0x616f('0x22')](respondWithResult(_0x72f93a,0xc9))[_0x616f('0x44')](handleError(_0x72f93a,null));};exports[_0x616f('0x20')]=function(_0x4a14e3,_0x2c7a41){if(_0x4a14e3[_0x616f('0x4c')]['id']){delete _0x4a14e3[_0x616f('0x4c')]['id'];}return db['Interval'][_0x616f('0x46')]({'where':{'id':_0x4a14e3['params']['id']}})[_0x616f('0x22')](handleEntityNotFound(_0x2c7a41,null))[_0x616f('0x22')](saveUpdates(_0x4a14e3['body'],null))['then'](respondWithResult(_0x2c7a41,null))[_0x616f('0x44')](handleError(_0x2c7a41,null));};exports[_0x616f('0x21')]=function(_0x4649ff,_0x2d722b){return db[_0x616f('0x2a')][_0x616f('0x46')]({'where':{'id':_0x4649ff['params']['id']}})[_0x616f('0x22')](handleEntityNotFound(_0x2d722b,null))['then'](removeEntity(_0x2d722b,null))[_0x616f('0x44')](handleError(_0x2d722b,null));};exports['addInterval']=function(_0x4af772,_0x3e7807,_0x40ba09){if(_0x4af772[_0x616f('0x4c')]['id']){delete _0x4af772[_0x616f('0x4c')]['id'];}return db[_0x616f('0x2a')][_0x616f('0x46')]({'where':{'id':_0x4af772['params']['id']}})['then'](handleEntityNotFound(_0x3e7807,null))['then'](function(_0x35a276){if(_0x35a276){_0x4af772[_0x616f('0x4c')][_0x616f('0x4d')]=_0x35a276['id'];return db['Interval']['create'](_0x4af772['body']);}})[_0x616f('0x22')](respondWithResult(_0x3e7807,null))[_0x616f('0x44')](handleError(_0x3e7807,null));};exports['getIntervals']=function(_0x4ac8c7,_0x2d8f14,_0x4257fc){var _0x895cb9={};var _0x52e17d={};var _0x126698;var _0x48d860;return db['Interval']['findOne']({'where':{'id':_0x4ac8c7['params']['id']}})[_0x616f('0x22')](handleEntityNotFound(_0x2d8f14,null))[_0x616f('0x22')](function(_0x39b3d3){if(_0x39b3d3){_0x126698=_0x39b3d3;_0x52e17d['model']=_[_0x616f('0x31')](db[_0x616f('0x2a')][_0x616f('0x2b')]);_0x52e17d['query']=_[_0x616f('0x31')](_0x4ac8c7[_0x616f('0x30')]);_0x52e17d['filters']=_[_0x616f('0x33')](_0x52e17d[_0x616f('0x2f')],_0x52e17d['query']);_0x895cb9['attributes']=_[_0x616f('0x33')](_0x52e17d['model'],qs[_0x616f('0x35')](_0x4ac8c7[_0x616f('0x30')][_0x616f('0x35')]));_0x895cb9['attributes']=_0x895cb9[_0x616f('0x34')][_0x616f('0x36')]?_0x895cb9[_0x616f('0x34')]:_0x52e17d[_0x616f('0x2f')];_0x895cb9[_0x616f('0x4e')]=qs['sort'](_0x4ac8c7[_0x616f('0x30')][_0x616f('0x39')]);_0x895cb9['where']=qs['filters'](_[_0x616f('0x3b')](_0x4ac8c7['query'],_0x52e17d[_0x616f('0x32')]));if(_0x4ac8c7[_0x616f('0x30')]['filter']){_0x895cb9[_0x616f('0x3a')]=_[_0x616f('0x3c')](_0x895cb9[_0x616f('0x3a')],{'$or':_[_0x616f('0x29')](_0x895cb9[_0x616f('0x34')],function(_0x1b4a08){var _0xd840a7={};_0xd840a7[_0x1b4a08]={'$like':'%'+_0x4ac8c7[_0x616f('0x30')]['filter']+'%'};return _0xd840a7;})});}_0x895cb9=_['merge']({},_0x895cb9,_0x4ac8c7['options']);return _0x126698[_0x616f('0x4f')](_0x895cb9);}})[_0x616f('0x22')](function(_0x11282e){if(_0x11282e){_0x48d860=_0x11282e[_0x616f('0x36')];if(!_0x4ac8c7[_0x616f('0x30')][_0x616f('0x37')](_0x616f('0x38'))){_0x895cb9['limit']=qs[_0x616f('0x1c')](_0x4ac8c7[_0x616f('0x30')][_0x616f('0x1c')]);_0x895cb9[_0x616f('0x1b')]=qs[_0x616f('0x1b')](_0x4ac8c7['query'][_0x616f('0x1b')]);}return _0x126698['getIntervals'](_0x895cb9);}})[_0x616f('0x22')](function(_0x47bd44){if(_0x47bd44){return _0x47bd44?{'count':_0x48d860,'rows':_0x47bd44}:null;}})[_0x616f('0x22')](respondWithResult(_0x2d8f14,null))[_0x616f('0x44')](handleError(_0x2d8f14,null));};exports['addIntervals']=function(_0x37713a,_0x8e7686,_0x2b3213){return db[_0x616f('0x2a')][_0x616f('0x50')]({'where':{'id':_0x37713a[_0x616f('0x51')]['id']}})[_0x616f('0x22')](handleEntityNotFound(_0x8e7686,null))['then'](function(_0x5e21ac){if(_0x5e21ac){return db['sequelize']['transaction'](function(_0x3f55d1){return db['Interval'][_0x616f('0x21')]({'where':{'IntervalId':_0x37713a[_0x616f('0x51')]['id']},'transaction':_0x3f55d1})['then'](function(_0x339613){var _0x113610=_[_0x616f('0x29')](_0x37713a[_0x616f('0x4c')],function(_0x433bc1){delete _0x433bc1['id'];_0x433bc1[_0x616f('0x4d')]=_0x37713a[_0x616f('0x51')]['id'];return _0x433bc1;});return db[_0x616f('0x2a')][_0x616f('0x52')](_0x113610,{'transaction':_0x3f55d1});});})['then'](function(){return db[_0x616f('0x2a')][_0x616f('0x42')]({'where':{'IntervalId':_0x37713a[_0x616f('0x51')]['id']}});});}})[_0x616f('0x22')](respondWithResult(_0x8e7686,null))[_0x616f('0x44')](handleError(_0x8e7686,null));}; \ No newline at end of file +var _0xc0a3=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','update','then','destroy','Intervals','UserProfileResource','end','error','index','Interval','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','map','VIRTUAL','filter','findAll','rows','catch','params','includeAll','include','options','find','create','body','user','get','role','userProfileId','autoAssociation','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xc0a3,0x145));var _0x3c0a=function(_0x4a2160,_0x125d90){_0x4a2160=_0x4a2160-0x0;var _0x33a592=_0xc0a3[_0x4a2160];return _0x33a592;};'use strict';var pdf=require(_0x3c0a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3c0a('0x1'));var zipdir=require(_0x3c0a('0x2'));var jsonpatch=require(_0x3c0a('0x3'));var rp=require(_0x3c0a('0x4'));var moment=require(_0x3c0a('0x5'));var BPromise=require(_0x3c0a('0x6'));var Mustache=require(_0x3c0a('0x7'));var util=require('util');var path=require(_0x3c0a('0x8'));var sox=require(_0x3c0a('0x9'));var csv=require('to-csv');var ejs=require(_0x3c0a('0xa'));var fs=require('fs');var _=require(_0x3c0a('0xb'));var squel=require(_0x3c0a('0xc'));var crypto=require(_0x3c0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3c0a('0xe'));var toCsv=require(_0x3c0a('0xf'));var querystring=require(_0x3c0a('0x10'));var Papa=require(_0x3c0a('0x11'));var Redis=require(_0x3c0a('0x12'));var authService=require(_0x3c0a('0x13'));var qs=require(_0x3c0a('0x14'));var as=require(_0x3c0a('0x15'));var hardwareService=require(_0x3c0a('0x16'));var logger=require(_0x3c0a('0x17'))(_0x3c0a('0x18'));var utils=require('../../config/utils');var config=require(_0x3c0a('0x19'));var db=require(_0x3c0a('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x34e096,_0x49c7ca){_0x49c7ca=_0x49c7ca||0xcc;return function(_0x22bec9){if(_0x22bec9){return _0x34e096[_0x3c0a('0x1b')](_0x49c7ca);}return _0x34e096[_0x3c0a('0x1c')](_0x49c7ca)['end']();};}function respondWithResult(_0x4be72f,_0x46c8bf){_0x46c8bf=_0x46c8bf||0xc8;return function(_0x246389){if(_0x246389){return _0x4be72f[_0x3c0a('0x1c')](_0x46c8bf)[_0x3c0a('0x1d')](_0x246389);}};}function respondWithFilteredResult(_0x3b0529,_0x1e5d32){return function(_0x29fde2){if(_0x29fde2){var _0x2e7c11=_0x29fde2[_0x3c0a('0x1e')],_0x1b0386=_0x1e5d32[_0x3c0a('0x1f')],_0x4b172d=_0x1e5d32['offset']+_0x1e5d32['limit'],_0x256668;if(_0x4b172d>=_0x2e7c11){_0x4b172d=_0x2e7c11;_0x256668=0xc8;}else{_0x256668=0xce;}_0x3b0529[_0x3c0a('0x1c')](_0x256668);return _0x3b0529[_0x3c0a('0x20')]('Content-Range',_0x1b0386+'-'+_0x4b172d+'/'+_0x2e7c11)[_0x3c0a('0x1d')](_0x29fde2);}return null;};}function patchUpdates(_0x3883a0){return function(_0x3d437d){try{jsonpatch[_0x3c0a('0x21')](_0x3d437d,_0x3883a0,!![]);}catch(_0x3d25e4){return BPromise[_0x3c0a('0x22')](_0x3d25e4);}return _0x3d437d['save']();};}function saveUpdates(_0x38e023,_0x178922){return function(_0x1123e8){if(_0x1123e8){return _0x1123e8[_0x3c0a('0x23')](_0x38e023)[_0x3c0a('0x24')](function(_0x53d730){return _0x53d730;});}return null;};}function removeEntity(_0x1a805a,_0x491e96){return function(_0x236fda){if(_0x236fda){return _0x236fda[_0x3c0a('0x25')]()[_0x3c0a('0x24')](function(){var _0xb38ce0=_0x236fda['get']({'plain':!![]});var _0x17bd3b=_0x3c0a('0x26');return db[_0x3c0a('0x27')][_0x3c0a('0x25')]({'where':{'type':_0x17bd3b,'resourceId':_0xb38ce0['id']}})[_0x3c0a('0x24')](function(){return _0x236fda;});})[_0x3c0a('0x24')](function(){_0x1a805a[_0x3c0a('0x1c')](0xcc)[_0x3c0a('0x28')]();});}};}function handleEntityNotFound(_0x4f554a,_0x3ae2bd){return function(_0x5fbf5){if(!_0x5fbf5){_0x4f554a[_0x3c0a('0x1b')](0x194);}return _0x5fbf5;};}function handleError(_0x1930a5,_0x1e009b){_0x1e009b=_0x1e009b||0x1f4;return function(_0x37877b){logger[_0x3c0a('0x29')](_0x37877b['stack']);if(_0x37877b['name']){delete _0x37877b['name'];}_0x1930a5[_0x3c0a('0x1c')](_0x1e009b)['send'](_0x37877b);};}exports[_0x3c0a('0x2a')]=function(_0x52c293,_0x190253){var _0x14dd7b={},_0x2f8a53={},_0xcbb55={'count':0x0,'rows':[]};var _0x4af7ff=_['map'](db[_0x3c0a('0x2b')][_0x3c0a('0x2c')],function(_0x1c35bc){return{'name':_0x1c35bc[_0x3c0a('0x2d')],'type':_0x1c35bc[_0x3c0a('0x2e')]['key']};});_0x2f8a53[_0x3c0a('0x2f')]=_['map'](_0x4af7ff,_0x3c0a('0x30'));_0x2f8a53[_0x3c0a('0x31')]=_[_0x3c0a('0x32')](_0x52c293[_0x3c0a('0x31')]);_0x2f8a53[_0x3c0a('0x33')]=_[_0x3c0a('0x34')](_0x2f8a53[_0x3c0a('0x2f')],_0x2f8a53[_0x3c0a('0x31')]);_0x14dd7b[_0x3c0a('0x35')]=_[_0x3c0a('0x34')](_0x2f8a53[_0x3c0a('0x2f')],qs[_0x3c0a('0x36')](_0x52c293[_0x3c0a('0x31')]['fields']));_0x14dd7b['attributes']=_0x14dd7b['attributes'][_0x3c0a('0x37')]?_0x14dd7b[_0x3c0a('0x35')]:_0x2f8a53[_0x3c0a('0x2f')];if(!_0x52c293[_0x3c0a('0x31')][_0x3c0a('0x38')](_0x3c0a('0x39'))){_0x14dd7b[_0x3c0a('0x3a')]=qs[_0x3c0a('0x3a')](_0x52c293[_0x3c0a('0x31')][_0x3c0a('0x3a')]);_0x14dd7b[_0x3c0a('0x1f')]=qs['offset'](_0x52c293['query'][_0x3c0a('0x1f')]);}_0x14dd7b[_0x3c0a('0x3b')]=qs[_0x3c0a('0x3c')](_0x52c293[_0x3c0a('0x31')]['sort']);_0x14dd7b[_0x3c0a('0x3d')]=qs[_0x3c0a('0x33')](_['pick'](_0x52c293['query'],_0x2f8a53[_0x3c0a('0x33')]),_0x4af7ff);if(_0x52c293['query']['filter']){_0x14dd7b[_0x3c0a('0x3d')]=_[_0x3c0a('0x3e')](_0x14dd7b['where'],{'$or':_[_0x3c0a('0x3f')](_0x4af7ff,function(_0x3d2fb2){if(_0x3d2fb2[_0x3c0a('0x2e')]!==_0x3c0a('0x40')){var _0x581d88={};_0x581d88[_0x3d2fb2[_0x3c0a('0x30')]]={'$like':'%'+_0x52c293['query'][_0x3c0a('0x41')]+'%'};return _0x581d88;}})});}_0x14dd7b=_[_0x3c0a('0x3e')]({},_0x14dd7b,_0x52c293['options']);var _0x5f3df2={'where':_0x14dd7b['where']};return db[_0x3c0a('0x2b')][_0x3c0a('0x1e')](_0x5f3df2)[_0x3c0a('0x24')](function(_0x4263e6){_0xcbb55[_0x3c0a('0x1e')]=_0x4263e6;if(_0x52c293[_0x3c0a('0x31')]['includeAll']){_0x14dd7b['include']=[{'all':!![]}];}return db[_0x3c0a('0x2b')][_0x3c0a('0x42')](_0x14dd7b);})[_0x3c0a('0x24')](function(_0x271c4a){_0xcbb55[_0x3c0a('0x43')]=_0x271c4a;return _0xcbb55;})['then'](respondWithFilteredResult(_0x190253,_0x14dd7b))[_0x3c0a('0x44')](handleError(_0x190253,null));};exports['show']=function(_0x21ca0c,_0x4248c9){var _0x475a4b={'raw':!![],'where':{'id':_0x21ca0c[_0x3c0a('0x45')]['id']}},_0x52d0be={};_0x52d0be['model']=_[_0x3c0a('0x32')](db['Interval']['rawAttributes']);_0x52d0be['query']=_[_0x3c0a('0x32')](_0x21ca0c[_0x3c0a('0x31')]);_0x52d0be[_0x3c0a('0x33')]=_[_0x3c0a('0x34')](_0x52d0be[_0x3c0a('0x2f')],_0x52d0be[_0x3c0a('0x31')]);_0x475a4b['attributes']=_[_0x3c0a('0x34')](_0x52d0be[_0x3c0a('0x2f')],qs[_0x3c0a('0x36')](_0x21ca0c[_0x3c0a('0x31')][_0x3c0a('0x36')]));_0x475a4b[_0x3c0a('0x35')]=_0x475a4b['attributes'][_0x3c0a('0x37')]?_0x475a4b['attributes']:_0x52d0be['model'];if(_0x21ca0c[_0x3c0a('0x31')][_0x3c0a('0x46')]){_0x475a4b[_0x3c0a('0x47')]=[{'all':!![]}];}_0x475a4b=_[_0x3c0a('0x3e')]({},_0x475a4b,_0x21ca0c[_0x3c0a('0x48')]);return db[_0x3c0a('0x2b')][_0x3c0a('0x49')](_0x475a4b)[_0x3c0a('0x24')](handleEntityNotFound(_0x4248c9,null))[_0x3c0a('0x24')](respondWithResult(_0x4248c9,null))[_0x3c0a('0x44')](handleError(_0x4248c9,null));};exports['create']=function(_0x4cbabb,_0x13e1d1){return db['Interval'][_0x3c0a('0x4a')](_0x4cbabb[_0x3c0a('0x4b')],{})[_0x3c0a('0x24')](function(_0x3db292){var _0x451b91=_0x4cbabb[_0x3c0a('0x4c')][_0x3c0a('0x4d')]({'plain':!![]});if(!_0x451b91)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x451b91[_0x3c0a('0x4e')]===_0x3c0a('0x4c')){var _0x1bff8e=_0x3db292[_0x3c0a('0x4d')]({'plain':!![]});var _0x13420c=_0x3c0a('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x13420c,'userProfileId':_0x451b91[_0x3c0a('0x4f')]},'raw':!![]})[_0x3c0a('0x24')](function(_0xe33353){if(_0xe33353&&_0xe33353[_0x3c0a('0x50')]===0x0){return db[_0x3c0a('0x27')]['create']({'name':_0x1bff8e['name'],'resourceId':_0x1bff8e['id'],'type':_0xe33353[_0x3c0a('0x30')],'sectionId':_0xe33353['id']},{})[_0x3c0a('0x24')](function(){return _0x3db292;});}else{return _0x3db292;}})[_0x3c0a('0x44')](function(_0x4e9ddf){logger[_0x3c0a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e9ddf);throw _0x4e9ddf;});}return _0x3db292;})['then'](respondWithResult(_0x13e1d1,0xc9))[_0x3c0a('0x44')](handleError(_0x13e1d1,null));};exports[_0x3c0a('0x23')]=function(_0x5d3391,_0x441a2e){if(_0x5d3391[_0x3c0a('0x4b')]['id']){delete _0x5d3391['body']['id'];}return db[_0x3c0a('0x2b')][_0x3c0a('0x49')]({'where':{'id':_0x5d3391[_0x3c0a('0x45')]['id']}})['then'](handleEntityNotFound(_0x441a2e,null))[_0x3c0a('0x24')](saveUpdates(_0x5d3391[_0x3c0a('0x4b')],null))[_0x3c0a('0x24')](respondWithResult(_0x441a2e,null))[_0x3c0a('0x44')](handleError(_0x441a2e,null));};exports[_0x3c0a('0x25')]=function(_0x5cacb2,_0x18cf3d){return db[_0x3c0a('0x2b')][_0x3c0a('0x49')]({'where':{'id':_0x5cacb2[_0x3c0a('0x45')]['id']}})['then'](handleEntityNotFound(_0x18cf3d,null))[_0x3c0a('0x24')](removeEntity(_0x18cf3d,null))['catch'](handleError(_0x18cf3d,null));};exports[_0x3c0a('0x51')]=function(_0x4718f3,_0x1fe42d,_0x22e19b){if(_0x4718f3[_0x3c0a('0x4b')]['id']){delete _0x4718f3[_0x3c0a('0x4b')]['id'];}return db[_0x3c0a('0x2b')][_0x3c0a('0x49')]({'where':{'id':_0x4718f3['params']['id']}})[_0x3c0a('0x24')](handleEntityNotFound(_0x1fe42d,null))[_0x3c0a('0x24')](function(_0x406cac){if(_0x406cac){_0x4718f3[_0x3c0a('0x4b')][_0x3c0a('0x52')]=_0x406cac['id'];return db[_0x3c0a('0x2b')][_0x3c0a('0x4a')](_0x4718f3[_0x3c0a('0x4b')]);}})[_0x3c0a('0x24')](respondWithResult(_0x1fe42d,null))[_0x3c0a('0x44')](handleError(_0x1fe42d,null));};exports[_0x3c0a('0x53')]=function(_0x18cd7f,_0x55f92d,_0x522457){var _0x37e220={};var _0x4825cf={};var _0x31b9a8;var _0x1d793a;return db['Interval'][_0x3c0a('0x54')]({'where':{'id':_0x18cd7f[_0x3c0a('0x45')]['id']}})[_0x3c0a('0x24')](handleEntityNotFound(_0x55f92d,null))[_0x3c0a('0x24')](function(_0x574dca){if(_0x574dca){_0x31b9a8=_0x574dca;_0x4825cf[_0x3c0a('0x2f')]=_[_0x3c0a('0x32')](db[_0x3c0a('0x2b')]['rawAttributes']);_0x4825cf['query']=_[_0x3c0a('0x32')](_0x18cd7f[_0x3c0a('0x31')]);_0x4825cf[_0x3c0a('0x33')]=_[_0x3c0a('0x34')](_0x4825cf[_0x3c0a('0x2f')],_0x4825cf[_0x3c0a('0x31')]);_0x37e220[_0x3c0a('0x35')]=_[_0x3c0a('0x34')](_0x4825cf['model'],qs[_0x3c0a('0x36')](_0x18cd7f['query'][_0x3c0a('0x36')]));_0x37e220['attributes']=_0x37e220[_0x3c0a('0x35')][_0x3c0a('0x37')]?_0x37e220['attributes']:_0x4825cf[_0x3c0a('0x2f')];_0x37e220[_0x3c0a('0x3b')]=qs[_0x3c0a('0x3c')](_0x18cd7f['query'][_0x3c0a('0x3c')]);_0x37e220['where']=qs['filters'](_['pick'](_0x18cd7f[_0x3c0a('0x31')],_0x4825cf[_0x3c0a('0x33')]));if(_0x18cd7f[_0x3c0a('0x31')][_0x3c0a('0x41')]){_0x37e220[_0x3c0a('0x3d')]=_[_0x3c0a('0x3e')](_0x37e220['where'],{'$or':_[_0x3c0a('0x3f')](_0x37e220[_0x3c0a('0x35')],function(_0x232694){var _0x5109c0={};_0x5109c0[_0x232694]={'$like':'%'+_0x18cd7f[_0x3c0a('0x31')][_0x3c0a('0x41')]+'%'};return _0x5109c0;})});}_0x37e220=_[_0x3c0a('0x3e')]({},_0x37e220,_0x18cd7f[_0x3c0a('0x48')]);return _0x31b9a8['getIntervals'](_0x37e220);}})[_0x3c0a('0x24')](function(_0xd1619e){if(_0xd1619e){_0x1d793a=_0xd1619e['length'];if(!_0x18cd7f['query']['hasOwnProperty'](_0x3c0a('0x39'))){_0x37e220[_0x3c0a('0x3a')]=qs[_0x3c0a('0x3a')](_0x18cd7f[_0x3c0a('0x31')]['limit']);_0x37e220[_0x3c0a('0x1f')]=qs[_0x3c0a('0x1f')](_0x18cd7f['query']['offset']);}return _0x31b9a8[_0x3c0a('0x53')](_0x37e220);}})[_0x3c0a('0x24')](function(_0x117eb6){if(_0x117eb6){return _0x117eb6?{'count':_0x1d793a,'rows':_0x117eb6}:null;}})[_0x3c0a('0x24')](respondWithResult(_0x55f92d,null))[_0x3c0a('0x44')](handleError(_0x55f92d,null));};exports[_0x3c0a('0x55')]=function(_0x348816,_0x19b780,_0x169e3b){return db[_0x3c0a('0x2b')]['findOne']({'where':{'id':_0x348816[_0x3c0a('0x45')]['id']}})[_0x3c0a('0x24')](handleEntityNotFound(_0x19b780,null))[_0x3c0a('0x24')](function(_0x23d3dd){if(_0x23d3dd){return db[_0x3c0a('0x56')]['transaction'](function(_0x405191){return db[_0x3c0a('0x2b')][_0x3c0a('0x25')]({'where':{'IntervalId':_0x348816[_0x3c0a('0x45')]['id']},'transaction':_0x405191})[_0x3c0a('0x24')](function(_0x2521e9){var _0x4cff2d=_[_0x3c0a('0x3f')](_0x348816[_0x3c0a('0x4b')],function(_0x3a9f6b){delete _0x3a9f6b['id'];_0x3a9f6b[_0x3c0a('0x52')]=_0x348816[_0x3c0a('0x45')]['id'];return _0x3a9f6b;});return db[_0x3c0a('0x2b')]['bulkCreate'](_0x4cff2d,{'transaction':_0x405191});});})['then'](function(){return db['Interval'][_0x3c0a('0x42')]({'where':{'IntervalId':_0x348816['params']['id']}});});}})[_0x3c0a('0x24')](respondWithResult(_0x19b780,null))[_0x3c0a('0x44')](handleError(_0x19b780,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index adff7aa..20f5f45 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 _0x028d=['Interval','tools_intervals','rewrite','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define'];(function(_0x53d0ab,_0x32774c){var _0x3eae64=function(_0x4004c1){while(--_0x4004c1){_0x53d0ab['push'](_0x53d0ab['shift']());}};_0x3eae64(++_0x32774c);}(_0x028d,0xff));var _0xd028=function(_0x35d39c,_0x377d94){_0x35d39c=_0x35d39c-0x0;var _0x47e4a3=_0x028d[_0x35d39c];return _0x47e4a3;};'use strict';var _=require('lodash');var util=require(_0xd028('0x0'));var logger=require(_0xd028('0x1'))('api');var moment=require(_0xd028('0x2'));var BPromise=require(_0xd028('0x3'));var rp=require(_0xd028('0x4'));var fs=require('fs');var path=require(_0xd028('0x5'));var rimraf=require(_0xd028('0x6'));var config=require(_0xd028('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xd028('0x8'));module[_0xd028('0x9')]=function(_0x20588f,_0x35b879){return _0x20588f[_0xd028('0xa')](_0xd028('0xb'),attributes,{'tableName':_0xd028('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x487e07,_0xadea4b){extensions[_0xd028('0xd')](_0x20588f,_0x487e07);},'afterBulkCreate':function(_0xb9d983,_0x1211c6,_0x4355bf){_0x4355bf();extensions[_0xd028('0xd')](_0x20588f,_0xb9d983[0x0]);},'afterUpdate':function(_0x4ec82c,_0x3d593d){extensions[_0xd028('0xd')](_0x20588f,_0x4ec82c);},'afterDestroy':function(_0x111477,_0x17ed00){extensions[_0xd028('0xd')](_0x20588f,_0x111477);}}});}; \ No newline at end of file +var _0x9bde=['define','Interval','tools_intervals','rewrite','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x189500,_0x1fccd8){var _0x375ab9=function(_0x8fcb77){while(--_0x8fcb77){_0x189500['push'](_0x189500['shift']());}};_0x375ab9(++_0x1fccd8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x12f277,_0x20865e){_0x12f277=_0x12f277-0x0;var _0x4571bd=_0x9bde[_0x12f277];return _0x4571bd;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));var extensions=require(_0xe9bd('0x8'));module['exports']=function(_0x4763e9,_0x5f18fe){return _0x4763e9[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3ef9e3,_0x29bc2b){extensions[_0xe9bd('0xc')](_0x4763e9,_0x3ef9e3);},'afterBulkCreate':function(_0x439abc,_0x45c7ba,_0x581602){_0x581602();extensions['rewrite'](_0x4763e9,_0x439abc[0x0]);},'afterUpdate':function(_0x3c8e95,_0x145521){extensions[_0xe9bd('0xc')](_0x4763e9,_0x3c8e95);},'afterDestroy':function(_0x581ab9,_0x12c96e){extensions[_0xe9bd('0xc')](_0x4763e9,_0x581ab9);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 2093680..c7800b7 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 _0x42eb=['Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetInterval','Interval','options','raw','where','attributes','limit','include','map','model','then','ShowInterval','find','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1737b4,_0x2a3b64){var _0x1ed282=function(_0x238ba8){while(--_0x238ba8){_0x1737b4['push'](_0x1737b4['shift']());}};_0x1ed282(++_0x2a3b64);}(_0x42eb,0xc8));var _0xb42e=function(_0x2bda14,_0x4fab1b){_0x2bda14=_0x2bda14-0x0;var _0xb5dd49=_0x42eb[_0x2bda14];return _0xb5dd49;};'use strict';var _=require(_0xb42e('0x0'));var util=require('util');var moment=require(_0xb42e('0x1'));var BPromise=require(_0xb42e('0x2'));var rs=require(_0xb42e('0x3'));var fs=require('fs');var Redis=require(_0xb42e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb42e('0x5'));var logger=require(_0xb42e('0x6'))(_0xb42e('0x7'));var config=require(_0xb42e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb42e('0x9')][_0xb42e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44087b,_0x5a4803,_0x928e77){return new BPromise(function(_0x9e5c77,_0x52004c){return client[_0xb42e('0xb')](_0x44087b,_0x928e77)['then'](function(_0x249575){logger[_0xb42e('0xc')](_0xb42e('0xd'),_0x5a4803,_0xb42e('0xe'));logger[_0xb42e('0xf')](_0xb42e('0x10'),_0x5a4803,'request\x20sent',JSON[_0xb42e('0x11')](_0x249575));if(_0x249575[_0xb42e('0x12')]){if(_0x249575[_0xb42e('0x12')][_0xb42e('0x13')]===0x1f4){logger[_0xb42e('0x12')](_0xb42e('0xd'),_0x5a4803,_0x249575[_0xb42e('0x12')][_0xb42e('0x14')]);return _0x52004c(_0x249575[_0xb42e('0x12')][_0xb42e('0x14')]);}logger[_0xb42e('0x12')](_0xb42e('0xd'),_0x5a4803,_0x249575['error']['message']);return _0x9e5c77(_0x249575[_0xb42e('0x12')]['message']);}else{logger[_0xb42e('0xc')]('Interval,\x20%s,\x20%s',_0x5a4803,_0xb42e('0xe'));_0x9e5c77(_0x249575[_0xb42e('0x15')][_0xb42e('0x14')]);}})[_0xb42e('0x16')](function(_0x526354){logger[_0xb42e('0x12')](_0xb42e('0xd'),_0x5a4803,_0x526354);_0x52004c(_0x526354);});});}exports[_0xb42e('0x17')]=function(_0x170854){var _0x176c93=this;return new Promise(function(_0x4f3c98,_0x310ceb){return db[_0xb42e('0x18')]['findAll']({'raw':_0x170854[_0xb42e('0x19')]?_0x170854[_0xb42e('0x19')][_0xb42e('0x1a')]===undefined?!![]:![]:!![],'where':_0x170854[_0xb42e('0x19')]?_0x170854[_0xb42e('0x19')][_0xb42e('0x1b')]||null:null,'attributes':_0x170854[_0xb42e('0x19')]?_0x170854[_0xb42e('0x19')][_0xb42e('0x1c')]||null:null,'limit':_0x170854[_0xb42e('0x19')]?_0x170854[_0xb42e('0x19')][_0xb42e('0x1d')]||null:null,'include':_0x170854[_0xb42e('0x19')]?_0x170854[_0xb42e('0x19')][_0xb42e('0x1e')]?_[_0xb42e('0x1f')](_0x170854['options'][_0xb42e('0x1e')],function(_0x26bfc9){return{'model':db[_0x26bfc9[_0xb42e('0x20')]],'as':_0x26bfc9['as'],'attributes':_0x26bfc9[_0xb42e('0x1c')],'include':_0x26bfc9['include']?_[_0xb42e('0x1f')](_0x26bfc9[_0xb42e('0x1e')],function(_0x21dbc7){return{'model':db[_0x21dbc7[_0xb42e('0x20')]],'as':_0x21dbc7['as'],'attributes':_0x21dbc7['attributes'],'include':_0x21dbc7[_0xb42e('0x1e')]?_[_0xb42e('0x1f')](_0x21dbc7[_0xb42e('0x1e')],function(_0x159ce2){return{'model':db[_0x159ce2[_0xb42e('0x20')]],'as':_0x159ce2['as'],'attributes':_0x159ce2[_0xb42e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb42e('0x21')](function(_0x268c71){logger['info'](_0xb42e('0x17'),_0x170854);logger[_0xb42e('0xf')](_0xb42e('0x17'),_0x170854,JSON[_0xb42e('0x11')](_0x268c71));_0x4f3c98(_0x268c71);})[_0xb42e('0x16')](function(_0x515837){logger[_0xb42e('0x12')]('GetInterval',_0x515837[_0xb42e('0x14')],_0x170854);_0x310ceb(_0x176c93[_0xb42e('0x12')](0x1f4,_0x515837['message']));});});};exports[_0xb42e('0x22')]=function(_0x2c9cca){var _0x3d8ce1=this;return new Promise(function(_0x128e5e,_0x12d931){return db[_0xb42e('0x18')][_0xb42e('0x23')]({'raw':_0x2c9cca['options']?_0x2c9cca[_0xb42e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2c9cca[_0xb42e('0x19')]?_0x2c9cca[_0xb42e('0x19')][_0xb42e('0x1b')]||null:null,'attributes':_0x2c9cca[_0xb42e('0x19')]?_0x2c9cca[_0xb42e('0x19')]['attributes']||null:null,'include':_0x2c9cca[_0xb42e('0x19')]?_0x2c9cca['options'][_0xb42e('0x1e')]?_[_0xb42e('0x1f')](_0x2c9cca[_0xb42e('0x19')][_0xb42e('0x1e')],function(_0x1e4735){return{'model':db[_0x1e4735[_0xb42e('0x20')]],'as':_0x1e4735['as'],'attributes':_0x1e4735[_0xb42e('0x1c')],'include':_0x1e4735[_0xb42e('0x1e')]?_[_0xb42e('0x1f')](_0x1e4735[_0xb42e('0x1e')],function(_0x4bd71b){return{'model':db[_0x4bd71b['model']],'as':_0x4bd71b['as'],'attributes':_0x4bd71b[_0xb42e('0x1c')],'include':_0x4bd71b[_0xb42e('0x1e')]?_['map'](_0x4bd71b[_0xb42e('0x1e')],function(_0x2d4bca){return{'model':db[_0x2d4bca[_0xb42e('0x20')]],'as':_0x2d4bca['as'],'attributes':_0x2d4bca[_0xb42e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb42e('0x21')](function(_0x51671e){logger[_0xb42e('0xc')](_0xb42e('0x22'),_0x2c9cca);logger[_0xb42e('0xf')](_0xb42e('0x22'),_0x2c9cca,JSON[_0xb42e('0x11')](_0x51671e));_0x128e5e(_0x51671e);})[_0xb42e('0x16')](function(_0x3a2627){logger[_0xb42e('0x12')](_0xb42e('0x22'),_0x3a2627[_0xb42e('0x14')],_0x2c9cca);_0x12d931(_0x3d8ce1[_0xb42e('0x12')](0x1f4,_0x3a2627[_0xb42e('0x14')]));});});}; \ No newline at end of file +var _0x8064=['then','stringify','catch','ShowInterval','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','result','GetInterval','Interval','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x1f231e,_0x34c74d){var _0xc964d0=function(_0x100952){while(--_0x100952){_0x1f231e['push'](_0x1f231e['shift']());}};_0xc964d0(++_0x34c74d);}(_0x8064,0x1a9));var _0x4806=function(_0x49c4f6,_0x46c3fe){_0x49c4f6=_0x49c4f6-0x0;var _0x5092e8=_0x8064[_0x49c4f6];return _0x5092e8;};'use strict';var _=require(_0x4806('0x0'));var util=require(_0x4806('0x1'));var moment=require('moment');var BPromise=require(_0x4806('0x2'));var rs=require(_0x4806('0x3'));var fs=require('fs');var Redis=require(_0x4806('0x4'));var db=require(_0x4806('0x5'))['db'];var utils=require(_0x4806('0x6'));var logger=require(_0x4806('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4806('0x8'));var client=jayson[_0x4806('0x9')][_0x4806('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1651c6,_0x231ed5,_0x218293){return new BPromise(function(_0x187474,_0x158765){return client['request'](_0x1651c6,_0x218293)['then'](function(_0x5968d1){logger[_0x4806('0xb')](_0x4806('0xc'),_0x231ed5,_0x4806('0xd'));logger[_0x4806('0xe')](_0x4806('0xf'),_0x231ed5,_0x4806('0xd'),JSON['stringify'](_0x5968d1));if(_0x5968d1[_0x4806('0x10')]){if(_0x5968d1[_0x4806('0x10')][_0x4806('0x11')]===0x1f4){logger[_0x4806('0x10')](_0x4806('0xc'),_0x231ed5,_0x5968d1[_0x4806('0x10')][_0x4806('0x12')]);return _0x158765(_0x5968d1[_0x4806('0x10')][_0x4806('0x12')]);}logger['error']('Interval,\x20%s,\x20%s',_0x231ed5,_0x5968d1['error'][_0x4806('0x12')]);return _0x187474(_0x5968d1[_0x4806('0x10')][_0x4806('0x12')]);}else{logger['info'](_0x4806('0xc'),_0x231ed5,_0x4806('0xd'));_0x187474(_0x5968d1[_0x4806('0x13')][_0x4806('0x12')]);}})['catch'](function(_0x2e276f){logger[_0x4806('0x10')]('Interval,\x20%s,\x20%s',_0x231ed5,_0x2e276f);_0x158765(_0x2e276f);});});}exports[_0x4806('0x14')]=function(_0x34133a){var _0x2f4b85=this;return new Promise(function(_0x4e6f63,_0x12cc91){return db[_0x4806('0x15')][_0x4806('0x16')]({'raw':_0x34133a['options']?_0x34133a[_0x4806('0x17')][_0x4806('0x18')]===undefined?!![]:![]:!![],'where':_0x34133a[_0x4806('0x17')]?_0x34133a['options']['where']||null:null,'attributes':_0x34133a[_0x4806('0x17')]?_0x34133a[_0x4806('0x17')][_0x4806('0x19')]||null:null,'limit':_0x34133a[_0x4806('0x17')]?_0x34133a[_0x4806('0x17')][_0x4806('0x1a')]||null:null,'include':_0x34133a[_0x4806('0x17')]?_0x34133a[_0x4806('0x17')][_0x4806('0x1b')]?_[_0x4806('0x1c')](_0x34133a[_0x4806('0x17')][_0x4806('0x1b')],function(_0x137e7e){return{'model':db[_0x137e7e[_0x4806('0x1d')]],'as':_0x137e7e['as'],'attributes':_0x137e7e[_0x4806('0x19')],'include':_0x137e7e[_0x4806('0x1b')]?_[_0x4806('0x1c')](_0x137e7e['include'],function(_0x5efb10){return{'model':db[_0x5efb10[_0x4806('0x1d')]],'as':_0x5efb10['as'],'attributes':_0x5efb10[_0x4806('0x19')],'include':_0x5efb10[_0x4806('0x1b')]?_['map'](_0x5efb10[_0x4806('0x1b')],function(_0x585deb){return{'model':db[_0x585deb['model']],'as':_0x585deb['as'],'attributes':_0x585deb[_0x4806('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4806('0x1e')](function(_0x3dcb05){logger[_0x4806('0xb')](_0x4806('0x14'),_0x34133a);logger[_0x4806('0xe')]('GetInterval',_0x34133a,JSON[_0x4806('0x1f')](_0x3dcb05));_0x4e6f63(_0x3dcb05);})[_0x4806('0x20')](function(_0x1703a0){logger[_0x4806('0x10')](_0x4806('0x14'),_0x1703a0[_0x4806('0x12')],_0x34133a);_0x12cc91(_0x2f4b85[_0x4806('0x10')](0x1f4,_0x1703a0[_0x4806('0x12')]));});});};exports[_0x4806('0x21')]=function(_0x2d6430){var _0x2847c5=this;return new Promise(function(_0x2509c0,_0x5c7a54){return db['Interval'][_0x4806('0x22')]({'raw':_0x2d6430[_0x4806('0x17')]?_0x2d6430[_0x4806('0x17')][_0x4806('0x18')]===undefined?!![]:![]:!![],'where':_0x2d6430[_0x4806('0x17')]?_0x2d6430[_0x4806('0x17')]['where']||null:null,'attributes':_0x2d6430[_0x4806('0x17')]?_0x2d6430['options'][_0x4806('0x19')]||null:null,'include':_0x2d6430[_0x4806('0x17')]?_0x2d6430[_0x4806('0x17')][_0x4806('0x1b')]?_[_0x4806('0x1c')](_0x2d6430['options'][_0x4806('0x1b')],function(_0x4d7429){return{'model':db[_0x4d7429[_0x4806('0x1d')]],'as':_0x4d7429['as'],'attributes':_0x4d7429[_0x4806('0x19')],'include':_0x4d7429[_0x4806('0x1b')]?_['map'](_0x4d7429[_0x4806('0x1b')],function(_0x31f895){return{'model':db[_0x31f895[_0x4806('0x1d')]],'as':_0x31f895['as'],'attributes':_0x31f895[_0x4806('0x19')],'include':_0x31f895['include']?_['map'](_0x31f895[_0x4806('0x1b')],function(_0x5cd257){return{'model':db[_0x5cd257[_0x4806('0x1d')]],'as':_0x5cd257['as'],'attributes':_0x5cd257[_0x4806('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4806('0x1e')](function(_0xa8d169){logger['info'](_0x4806('0x21'),_0x2d6430);logger[_0x4806('0xe')](_0x4806('0x21'),_0x2d6430,JSON['stringify'](_0xa8d169));_0x2509c0(_0xa8d169);})[_0x4806('0x20')](function(_0x12a186){logger[_0x4806('0x10')](_0x4806('0x21'),_0x12a186[_0x4806('0x12')],_0x2d6430);_0x5c7a54(_0x2847c5['error'](0x1f4,_0x12a186[_0x4806('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index e92dec6..51134d7 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 _0x9483=['isAuthenticated','send','express','Router','./jira.controller','post'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x9483,0x12e));var _0x3948=function(_0x55d9ca,_0x28f676){_0x55d9ca=_0x55d9ca-0x0;var _0x1f06a9=_0x9483[_0x55d9ca];return _0x1f06a9;};'use strict';var express=require(_0x3948('0x0'));var router=express[_0x3948('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x3948('0x2'));router[_0x3948('0x3')]('/',auth[_0x3948('0x4')](),controller[_0x3948('0x5')]);module['exports']=router; \ No newline at end of file +var _0xb1c1=['./jira.controller','post','send','exports','express','Router','../../components/auth/service'];(function(_0x49cf85,_0xfdf2d7){var _0x24f687=function(_0x2126ae){while(--_0x2126ae){_0x49cf85['push'](_0x49cf85['shift']());}};_0x24f687(++_0xfdf2d7);}(_0xb1c1,0x1c4));var _0x1b1c=function(_0x5027c2,_0x498a70){_0x5027c2=_0x5027c2-0x0;var _0x37554d=_0xb1c1[_0x5027c2];return _0x37554d;};'use strict';var express=require(_0x1b1c('0x0'));var router=express[_0x1b1c('0x1')]();var auth=require(_0x1b1c('0x2'));var controller=require(_0x1b1c('0x3'));router[_0x1b1c('0x4')]('/',auth['isAuthenticated'](),controller[_0x1b1c('0x5')]);module[_0x1b1c('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index a5eacbe..2ec66eb 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 _0x57b8=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','headers','x-forwarded-for','remoteAddress','socket','body','bluebird','https','../../config/logger','api','support','key','summary','description','stringify','issuetype','Bug','fields','customfield_11500','oldToken','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','request','setEncoding','end','statusCode','json','parse'];(function(_0x3900db,_0x255d80){var _0xa31ad4=function(_0x43a91c){while(--_0x43a91c){_0x3900db['push'](_0x3900db['shift']());}};_0xa31ad4(++_0x255d80);}(_0x57b8,0x189));var _0x857b=function(_0x104a42,_0x25668c){_0x104a42=_0x104a42-0x0;var _0x37ae19=_0x57b8[_0x104a42];return _0x37ae19;};'use strict';var BPromise=require(_0x857b('0x0'));var https=require(_0x857b('0x1'));var logger=require(_0x857b('0x2'))(_0x857b('0x3'));var USERNAME=_0x857b('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x9179e4,_0x4355a2){var _0x20f36c={'fields':{'project':{'key':_0x9179e4[_0x857b('0x5')]||'MOTGUI'},'summary':(_0x9179e4[_0x857b('0x6')]||'Report')+'\x20from\x20'+_0x9179e4['ip'],'description':_0x9179e4[_0x857b('0x7')]||JSON[_0x857b('0x8')](_0x9179e4),'issuetype':{'name':_0x9179e4[_0x857b('0x9')]||_0x857b('0xa')}}};_0x20f36c[_0x857b('0xb')][_0x857b('0xc')]=_0x9179e4['email'];_0x20f36c[_0x857b('0xb')]['customfield_11501']=_0x9179e4[_0x857b('0xd')];_0x20f36c['fields']['customfield_11502']=_0x9179e4['newToken'];_0x20f36c['fields']['customfield_11503']=_0x9179e4['name'];_0x20f36c[_0x857b('0xb')][_0x857b('0xe')]=_0x9179e4[_0x857b('0xf')];_0x20f36c[_0x857b('0xb')][_0x857b('0x10')]=_0x9179e4['ip'];var _0x51fb23={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x857b('0x11'),'method':_0x857b('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x857b('0x13'),'Authorization':_0x857b('0x14')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x25f9b7=JSON[_0x857b('0x8')](_0x20f36c);var _0x416349=https[_0x857b('0x15')](_0x51fb23,function(_0xd7e3ea){_0xd7e3ea[_0x857b('0x16')]('utf8');var _0x1f7ede='';_0xd7e3ea['on']('data',function(_0x11833e){_0x1f7ede+=_0x11833e;});_0xd7e3ea['on'](_0x857b('0x17'),function(){if(_0x4355a2){return _0x4355a2['status'](_0xd7e3ea[_0x857b('0x18')])[_0x857b('0x19')](JSON[_0x857b('0x1a')](_0x1f7ede));}});});_0x416349['on']('error',function(_0x20f9c8){if(_0x4355a2){return _0x4355a2['status'](0x1f4)[_0x857b('0x19')]({'errors':[{'message':_0x857b('0x1b'),'type':_0x857b('0x1c')}]});}});_0x416349[_0x857b('0x1d')](_0x25f9b7);_0x416349[_0x857b('0x17')]();}exports['openIssue']=openIssue;exports['send']=function(_0x1323e0,_0xd95f98){_0x1323e0['body']['ip']=_0x1323e0[_0x857b('0x1e')][_0x857b('0x1f')]||_0x1323e0['connection'][_0x857b('0x20')]||_0x1323e0[_0x857b('0x21')]['remoteAddress']||_0x1323e0['connection'][_0x857b('0x21')][_0x857b('0x20')];return openIssue(_0x1323e0[_0x857b('0x22')],_0xd95f98);}; \ No newline at end of file +var _0x56e7=['key','MOTGUI','Report','\x20from\x20','description','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','POST','application/json','base64','request','setEncoding','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','remoteAddress','connection','socket','https','api','3eAmWpBVP0'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x56e7,0x14d));var _0x756e=function(_0x3a7db0,_0xe93c50){_0x3a7db0=_0x3a7db0-0x0;var _0x17cbba=_0x56e7[_0x3a7db0];return _0x17cbba;};'use strict';var BPromise=require('bluebird');var https=require(_0x756e('0x0'));var logger=require('../../config/logger')(_0x756e('0x1'));var USERNAME='support';var PASSWORD=_0x756e('0x2');function openIssue(_0x765dde,_0x5c6894){var _0x456846={'fields':{'project':{'key':_0x765dde[_0x756e('0x3')]||_0x756e('0x4')},'summary':(_0x765dde['summary']||_0x756e('0x5'))+_0x756e('0x6')+_0x765dde['ip'],'description':_0x765dde[_0x756e('0x7')]||JSON[_0x756e('0x8')](_0x765dde),'issuetype':{'name':_0x765dde[_0x756e('0x9')]||_0x756e('0xa')}}};_0x456846['fields']['customfield_11500']=_0x765dde[_0x756e('0xb')];_0x456846[_0x756e('0xc')][_0x756e('0xd')]=_0x765dde[_0x756e('0xe')];_0x456846['fields'][_0x756e('0xf')]=_0x765dde[_0x756e('0x10')];_0x456846[_0x756e('0xc')][_0x756e('0x11')]=_0x765dde[_0x756e('0x12')];_0x456846[_0x756e('0xc')]['customfield_11504']=_0x765dde[_0x756e('0x13')];_0x456846['fields']['customfield_10102']=_0x765dde['ip'];var _0x58913e={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x756e('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x756e('0x15'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x756e('0x16'))}};var _0x1bcf0e=JSON[_0x756e('0x8')](_0x456846);var _0x5034cf=https[_0x756e('0x17')](_0x58913e,function(_0x4b4f3a){_0x4b4f3a[_0x756e('0x18')](_0x756e('0x19'));var _0x19fd97='';_0x4b4f3a['on'](_0x756e('0x1a'),function(_0x11c62c){_0x19fd97+=_0x11c62c;});_0x4b4f3a['on'](_0x756e('0x1b'),function(){if(_0x5c6894){return _0x5c6894[_0x756e('0x1c')](_0x4b4f3a[_0x756e('0x1d')])[_0x756e('0x1e')](JSON[_0x756e('0x1f')](_0x19fd97));}});});_0x5034cf['on']('error',function(_0xb39c0e){if(_0x5c6894){return _0x5c6894[_0x756e('0x1c')](0x1f4)[_0x756e('0x1e')]({'errors':[{'message':_0x756e('0x20'),'type':_0x756e('0x21')}]});}});_0x5034cf[_0x756e('0x22')](_0x1bcf0e);_0x5034cf['end']();}exports[_0x756e('0x23')]=openIssue;exports[_0x756e('0x24')]=function(_0x494157,_0x5b7599){_0x494157[_0x756e('0x25')]['ip']=_0x494157['headers'][_0x756e('0x26')]||_0x494157['connection'][_0x756e('0x27')]||_0x494157['socket'][_0x756e('0x27')]||_0x494157[_0x756e('0x28')][_0x756e('0x29')]['remoteAddress'];return openIssue(_0x494157[_0x756e('0x25')],_0x5b7599);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 78ba203..d199c92 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 _0x0378=['/describe','/:id','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3fab56,_0x376d0b){var _0x452ba1=function(_0x1b3f3c){while(--_0x1b3f3c){_0x3fab56['push'](_0x3fab56['shift']());}};_0x452ba1(++_0x376d0b);}(_0x0378,0x66));var _0x8037=function(_0x1b0dd8,_0x315ab9){_0x1b0dd8=_0x1b0dd8-0x0;var _0x248fa2=_0x0378[_0x1b0dd8];return _0x248fa2;};'use strict';var multer=require(_0x8037('0x0'));var util=require(_0x8037('0x1'));var path=require(_0x8037('0x2'));var timeout=require(_0x8037('0x3'));var express=require(_0x8037('0x4'));var router=express[_0x8037('0x5')]();var auth=require(_0x8037('0x6'));var interaction=require(_0x8037('0x7'));var config=require(_0x8037('0x8'));var controller=require('./jscriptyAnswerReport.controller');router[_0x8037('0x9')]('/',auth[_0x8037('0xa')](),controller[_0x8037('0xb')]);router[_0x8037('0x9')](_0x8037('0xc'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x8037('0xd'),auth[_0x8037('0xa')](),controller[_0x8037('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8037('0xf')]);router['put']('/:id',auth[_0x8037('0xa')](),controller[_0x8037('0x10')]);router['delete']('/:id',auth[_0x8037('0xa')](),controller[_0x8037('0x11')]);module[_0x8037('0x12')]=router; \ No newline at end of file +var _0x84c0=['../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x84c0,0x19e));var _0x084c=function(_0x156f08,_0x467d69){_0x156f08=_0x156f08-0x0;var _0x2289d0=_0x84c0[_0x156f08];return _0x2289d0;};'use strict';var multer=require(_0x084c('0x0'));var util=require(_0x084c('0x1'));var path=require(_0x084c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x084c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x084c('0x4'));var config=require('../../config/environment');var controller=require(_0x084c('0x5'));router['get']('/',auth[_0x084c('0x6')](),controller[_0x084c('0x7')]);router[_0x084c('0x8')]('/describe',auth[_0x084c('0x6')](),controller[_0x084c('0x9')]);router[_0x084c('0x8')](_0x084c('0xa'),auth[_0x084c('0x6')](),controller[_0x084c('0xb')]);router[_0x084c('0xc')]('/',auth[_0x084c('0x6')](),controller[_0x084c('0xd')]);router[_0x084c('0xe')]('/:id',auth[_0x084c('0x6')](),controller[_0x084c('0xf')]);router[_0x084c('0x10')]('/:id',auth[_0x084c('0x6')](),controller[_0x084c('0x11')]);module[_0x084c('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index f5a6de5..9a90829 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 _0x2faf=['STRING','sequelize','TEXT','long'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2faf,0x1b1));var _0xf2fa=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2faf[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xf2fa('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xf2fa('0x1')](_0xf2fa('0x2'))},'membername':{'type':Sequelize[_0xf2fa('0x3')]},'projectname':{'type':Sequelize[_0xf2fa('0x3')]},'queue':{'type':Sequelize[_0xf2fa('0x3')]},'uniqueid':{'type':Sequelize[_0xf2fa('0x3')]},'calleridname':{'type':Sequelize[_0xf2fa('0x3')]},'calleridnum':{'type':Sequelize[_0xf2fa('0x3')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3eb3=['sequelize','exports','TEXT','long','STRING'];(function(_0x4dc8c6,_0x3fba52){var _0x69ce1d=function(_0x1a726d){while(--_0x1a726d){_0x4dc8c6['push'](_0x4dc8c6['shift']());}};_0x69ce1d(++_0x3fba52);}(_0x3eb3,0x1cc));var _0x33eb=function(_0x6a9a8,_0x430196){_0x6a9a8=_0x6a9a8-0x0;var _0xb29531=_0x3eb3[_0x6a9a8];return _0xb29531;};'use strict';var Sequelize=require(_0x33eb('0x0'));module[_0x33eb('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0x33eb('0x2')](_0x33eb('0x3'))},'membername':{'type':Sequelize[_0x33eb('0x4')]},'projectname':{'type':Sequelize[_0x33eb('0x4')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x33eb('0x4')]},'calleridname':{'type':Sequelize[_0x33eb('0x4')]},'calleridnum':{'type':Sequelize[_0x33eb('0x4')]},'questionId':{'type':Sequelize[_0x33eb('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index bc52023..22f8732 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 _0x0211=['request-promise','moment','bluebird','mustache','path','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/utils','../../config/environment','sendStatus','status','json','offset','Content-Range','apply','save','then','destroy','end','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','rimraf','zip-dir','fast-json-patch'];(function(_0x2eac49,_0x5bec4e){var _0x56eb1a=function(_0x4e1db7){while(--_0x4e1db7){_0x2eac49['push'](_0x2eac49['shift']());}};_0x56eb1a(++_0x5bec4e);}(_0x0211,0x1ad));var _0x1021=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x0211[_0x40ac5e];return _0x2839d6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1021('0x0'));var zipdir=require(_0x1021('0x1'));var jsonpatch=require(_0x1021('0x2'));var rp=require(_0x1021('0x3'));var moment=require(_0x1021('0x4'));var BPromise=require(_0x1021('0x5'));var Mustache=require(_0x1021('0x6'));var util=require('util');var path=require(_0x1021('0x7'));var sox=require(_0x1021('0x8'));var csv=require(_0x1021('0x9'));var ejs=require(_0x1021('0xa'));var fs=require('fs');var _=require(_0x1021('0xb'));var squel=require('squel');var crypto=require(_0x1021('0xc'));var jsforce=require(_0x1021('0xd'));var deskjs=require(_0x1021('0xe'));var toCsv=require(_0x1021('0x9'));var querystring=require(_0x1021('0xf'));var Papa=require(_0x1021('0x10'));var Redis=require(_0x1021('0x11'));var authService=require(_0x1021('0x12'));var qs=require(_0x1021('0x13'));var as=require(_0x1021('0x14'));var hardwareService=require(_0x1021('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1021('0x16'));var config=require(_0x1021('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22ed61,_0xa9f253){_0xa9f253=_0xa9f253||0xcc;return function(_0x5ee9ad){if(_0x5ee9ad){return _0x22ed61[_0x1021('0x18')](_0xa9f253);}return _0x22ed61['status'](_0xa9f253)['end']();};}function respondWithResult(_0x48c080,_0x43913a){_0x43913a=_0x43913a||0xc8;return function(_0x53ef13){if(_0x53ef13){return _0x48c080[_0x1021('0x19')](_0x43913a)[_0x1021('0x1a')](_0x53ef13);}};}function respondWithFilteredResult(_0x1aa884,_0x164a0e){return function(_0x19eadd){if(_0x19eadd){var _0x5349ea=_0x19eadd['count'],_0x23931b=_0x164a0e[_0x1021('0x1b')],_0x1b03df=_0x164a0e['offset']+_0x164a0e['limit'],_0x21828c;if(_0x1b03df>=_0x5349ea){_0x1b03df=_0x5349ea;_0x21828c=0xc8;}else{_0x21828c=0xce;}_0x1aa884[_0x1021('0x19')](_0x21828c);return _0x1aa884['set'](_0x1021('0x1c'),_0x23931b+'-'+_0x1b03df+'/'+_0x5349ea)[_0x1021('0x1a')](_0x19eadd);}return null;};}function patchUpdates(_0x57c0f3){return function(_0x52b2f4){try{jsonpatch[_0x1021('0x1d')](_0x52b2f4,_0x57c0f3,!![]);}catch(_0x3fab71){return BPromise['reject'](_0x3fab71);}return _0x52b2f4[_0x1021('0x1e')]();};}function saveUpdates(_0x2cf05c,_0x212db6){return function(_0x1b235f){if(_0x1b235f){return _0x1b235f['update'](_0x2cf05c)[_0x1021('0x1f')](function(_0x408389){return _0x408389;});}return null;};}function removeEntity(_0x3c5ddb,_0x463e57){return function(_0x5e2dd4){if(_0x5e2dd4){return _0x5e2dd4[_0x1021('0x20')]()[_0x1021('0x1f')](function(){_0x3c5ddb[_0x1021('0x19')](0xcc)[_0x1021('0x21')]();});}};}function handleEntityNotFound(_0x1d9275,_0x24e912){return function(_0x3056b0){if(!_0x3056b0){_0x1d9275['sendStatus'](0x194);}return _0x3056b0;};}function handleError(_0x2927d4,_0x28874c){_0x28874c=_0x28874c||0x1f4;return function(_0x768224){logger[_0x1021('0x22')](_0x768224[_0x1021('0x23')]);if(_0x768224['name']){delete _0x768224[_0x1021('0x24')];}_0x2927d4[_0x1021('0x19')](_0x28874c)['send'](_0x768224);};}exports[_0x1021('0x25')]=function(_0x20bc85,_0x54fc08){var _0x578847={},_0x4bdcb5={},_0x44c47b={'count':0x0,'rows':[]};var _0x323c24=_[_0x1021('0x26')](db[_0x1021('0x27')][_0x1021('0x28')],function(_0x14a9b7){return{'name':_0x14a9b7[_0x1021('0x29')],'type':_0x14a9b7[_0x1021('0x2a')][_0x1021('0x2b')]};});_0x4bdcb5[_0x1021('0x2c')]=_[_0x1021('0x26')](_0x323c24,_0x1021('0x24'));_0x4bdcb5[_0x1021('0x2d')]=_[_0x1021('0x2e')](_0x20bc85['query']);_0x4bdcb5[_0x1021('0x2f')]=_[_0x1021('0x30')](_0x4bdcb5['model'],_0x4bdcb5[_0x1021('0x2d')]);_0x578847['attributes']=_[_0x1021('0x30')](_0x4bdcb5['model'],qs['fields'](_0x20bc85[_0x1021('0x2d')]['fields']));_0x578847[_0x1021('0x31')]=_0x578847[_0x1021('0x31')][_0x1021('0x32')]?_0x578847[_0x1021('0x31')]:_0x4bdcb5[_0x1021('0x2c')];if(!_0x20bc85[_0x1021('0x2d')][_0x1021('0x33')](_0x1021('0x34'))){_0x578847['limit']=qs[_0x1021('0x35')](_0x20bc85[_0x1021('0x2d')][_0x1021('0x35')]);_0x578847[_0x1021('0x1b')]=qs['offset'](_0x20bc85[_0x1021('0x2d')][_0x1021('0x1b')]);}_0x578847['order']=qs[_0x1021('0x36')](_0x20bc85[_0x1021('0x2d')]['sort']);_0x578847[_0x1021('0x37')]=qs['filters'](_['pick'](_0x20bc85['query'],_0x4bdcb5[_0x1021('0x2f')]),_0x323c24);if(_0x20bc85[_0x1021('0x2d')][_0x1021('0x38')]){_0x578847['where']=_[_0x1021('0x39')](_0x578847[_0x1021('0x37')],{'$or':_[_0x1021('0x26')](_0x323c24,function(_0x18b47d){if(_0x18b47d[_0x1021('0x2a')]!==_0x1021('0x3a')){var _0xe228dc={};_0xe228dc[_0x18b47d[_0x1021('0x24')]]={'$like':'%'+_0x20bc85[_0x1021('0x2d')][_0x1021('0x38')]+'%'};return _0xe228dc;}})});}_0x578847=_[_0x1021('0x39')]({},_0x578847,_0x20bc85[_0x1021('0x3b')]);var _0x2604a7={'where':_0x578847[_0x1021('0x37')]};return db[_0x1021('0x27')][_0x1021('0x3c')](_0x2604a7)[_0x1021('0x1f')](function(_0x1d449c){_0x44c47b[_0x1021('0x3c')]=_0x1d449c;if(_0x20bc85[_0x1021('0x2d')][_0x1021('0x3d')]){_0x578847[_0x1021('0x3e')]=[{'all':!![]}];}return db[_0x1021('0x27')][_0x1021('0x3f')](_0x578847);})[_0x1021('0x1f')](function(_0x4f9dd0){_0x44c47b['rows']=_0x4f9dd0;return _0x44c47b;})[_0x1021('0x1f')](respondWithFilteredResult(_0x54fc08,_0x578847))[_0x1021('0x40')](handleError(_0x54fc08,null));};exports[_0x1021('0x41')]=function(_0x8761ba,_0x4afbcc){var _0x1534ea={'raw':!![],'where':{'id':_0x8761ba[_0x1021('0x42')]['id']}},_0x436216={};_0x436216[_0x1021('0x2c')]=_[_0x1021('0x2e')](db[_0x1021('0x27')]['rawAttributes']);_0x436216['query']=_[_0x1021('0x2e')](_0x8761ba[_0x1021('0x2d')]);_0x436216['filters']=_[_0x1021('0x30')](_0x436216[_0x1021('0x2c')],_0x436216[_0x1021('0x2d')]);_0x1534ea[_0x1021('0x31')]=_[_0x1021('0x30')](_0x436216[_0x1021('0x2c')],qs['fields'](_0x8761ba[_0x1021('0x2d')]['fields']));_0x1534ea[_0x1021('0x31')]=_0x1534ea[_0x1021('0x31')][_0x1021('0x32')]?_0x1534ea['attributes']:_0x436216[_0x1021('0x2c')];if(_0x8761ba[_0x1021('0x2d')][_0x1021('0x3d')]){_0x1534ea['include']=[{'all':!![]}];}_0x1534ea=_['merge']({},_0x1534ea,_0x8761ba[_0x1021('0x3b')]);return db['JscriptyAnswerReport'][_0x1021('0x43')](_0x1534ea)['then'](handleEntityNotFound(_0x4afbcc,null))['then'](respondWithResult(_0x4afbcc,null))['catch'](handleError(_0x4afbcc,null));};exports[_0x1021('0x44')]=function(_0x503771,_0x1db64c){return db[_0x1021('0x27')][_0x1021('0x44')](_0x503771['body'],{})[_0x1021('0x1f')](respondWithResult(_0x1db64c,0xc9))[_0x1021('0x40')](handleError(_0x1db64c,null));};exports[_0x1021('0x45')]=function(_0x4b7a50,_0x425d60){if(_0x4b7a50[_0x1021('0x46')]['id']){delete _0x4b7a50['body']['id'];}return db[_0x1021('0x27')][_0x1021('0x43')]({'where':{'id':_0x4b7a50[_0x1021('0x42')]['id']}})['then'](handleEntityNotFound(_0x425d60,null))[_0x1021('0x1f')](saveUpdates(_0x4b7a50[_0x1021('0x46')],null))[_0x1021('0x1f')](respondWithResult(_0x425d60,null))['catch'](handleError(_0x425d60,null));};exports[_0x1021('0x20')]=function(_0x5e3b6c,_0x4d9059){return db['JscriptyAnswerReport'][_0x1021('0x43')]({'where':{'id':_0x5e3b6c['params']['id']}})[_0x1021('0x1f')](handleEntityNotFound(_0x4d9059,null))[_0x1021('0x1f')](removeEntity(_0x4d9059,null))['catch'](handleError(_0x4d9059,null));};exports[_0x1021('0x47')]=function(_0x267d95,_0x2b896c){return db['JscriptyAnswerReport'][_0x1021('0x47')]()[_0x1021('0x1f')](respondWithResult(_0x2b896c,null))[_0x1021('0x40')](handleError(_0x2b896c,null));}; \ No newline at end of file +var _0xe280=['params','rawAttributes','length','find','create','body','update','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','index','map','JscriptyAnswerReport','fieldName','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xe280,0xe0));var _0x0e28=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0xe280[_0x59d89e];return _0x554e93;};'use strict';var pdf=require(_0x0e28('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0e28('0x1'));var jsonpatch=require(_0x0e28('0x2'));var rp=require(_0x0e28('0x3'));var moment=require('moment');var BPromise=require(_0x0e28('0x4'));var Mustache=require(_0x0e28('0x5'));var util=require(_0x0e28('0x6'));var path=require('path');var sox=require(_0x0e28('0x7'));var csv=require(_0x0e28('0x8'));var ejs=require(_0x0e28('0x9'));var fs=require('fs');var _=require(_0x0e28('0xa'));var squel=require(_0x0e28('0xb'));var crypto=require(_0x0e28('0xc'));var jsforce=require(_0x0e28('0xd'));var deskjs=require(_0x0e28('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0e28('0xf'));var Redis=require('ioredis');var authService=require(_0x0e28('0x10'));var qs=require(_0x0e28('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e28('0x12'));var logger=require('../../config/logger')(_0x0e28('0x13'));var utils=require(_0x0e28('0x14'));var config=require('../../config/environment');var db=require(_0x0e28('0x15'))['db'];function respondWithStatusCode(_0x4e2a21,_0x1a720b){_0x1a720b=_0x1a720b||0xcc;return function(_0x4f0441){if(_0x4f0441){return _0x4e2a21['sendStatus'](_0x1a720b);}return _0x4e2a21[_0x0e28('0x16')](_0x1a720b)[_0x0e28('0x17')]();};}function respondWithResult(_0x1bf0ba,_0x1961a8){_0x1961a8=_0x1961a8||0xc8;return function(_0x479170){if(_0x479170){return _0x1bf0ba[_0x0e28('0x16')](_0x1961a8)['json'](_0x479170);}};}function respondWithFilteredResult(_0x4a9cc5,_0x10057a){return function(_0x320e33){if(_0x320e33){var _0x44eaf8=_0x320e33[_0x0e28('0x18')],_0x2ba381=_0x10057a[_0x0e28('0x19')],_0x2c5293=_0x10057a[_0x0e28('0x19')]+_0x10057a['limit'],_0x322afe;if(_0x2c5293>=_0x44eaf8){_0x2c5293=_0x44eaf8;_0x322afe=0xc8;}else{_0x322afe=0xce;}_0x4a9cc5[_0x0e28('0x16')](_0x322afe);return _0x4a9cc5[_0x0e28('0x1a')](_0x0e28('0x1b'),_0x2ba381+'-'+_0x2c5293+'/'+_0x44eaf8)['json'](_0x320e33);}return null;};}function patchUpdates(_0x46f4f5){return function(_0x1fcecf){try{jsonpatch[_0x0e28('0x1c')](_0x1fcecf,_0x46f4f5,!![]);}catch(_0x25f541){return BPromise[_0x0e28('0x1d')](_0x25f541);}return _0x1fcecf[_0x0e28('0x1e')]();};}function saveUpdates(_0x5cf4e4,_0x552cdf){return function(_0x30dc48){if(_0x30dc48){return _0x30dc48['update'](_0x5cf4e4)[_0x0e28('0x1f')](function(_0x51faf1){return _0x51faf1;});}return null;};}function removeEntity(_0x4d7dc7,_0x5220bf){return function(_0x41345d){if(_0x41345d){return _0x41345d[_0x0e28('0x20')]()[_0x0e28('0x1f')](function(){_0x4d7dc7[_0x0e28('0x16')](0xcc)[_0x0e28('0x17')]();});}};}function handleEntityNotFound(_0x437df4,_0x365975){return function(_0x13a534){if(!_0x13a534){_0x437df4[_0x0e28('0x21')](0x194);}return _0x13a534;};}function handleError(_0x20248d,_0x374a18){_0x374a18=_0x374a18||0x1f4;return function(_0x4be21d){logger[_0x0e28('0x22')](_0x4be21d[_0x0e28('0x23')]);if(_0x4be21d['name']){delete _0x4be21d['name'];}_0x20248d[_0x0e28('0x16')](_0x374a18)['send'](_0x4be21d);};}exports[_0x0e28('0x24')]=function(_0x95defc,_0x31cc56){var _0x48583b={},_0x849ea1={},_0x3b32d7={'count':0x0,'rows':[]};var _0x134704=_[_0x0e28('0x25')](db[_0x0e28('0x26')]['rawAttributes'],function(_0x49dc72){return{'name':_0x49dc72[_0x0e28('0x27')],'type':_0x49dc72['type']['key']};});_0x849ea1[_0x0e28('0x28')]=_[_0x0e28('0x25')](_0x134704,_0x0e28('0x29'));_0x849ea1[_0x0e28('0x2a')]=_[_0x0e28('0x2b')](_0x95defc['query']);_0x849ea1[_0x0e28('0x2c')]=_[_0x0e28('0x2d')](_0x849ea1['model'],_0x849ea1['query']);_0x48583b[_0x0e28('0x2e')]=_['intersection'](_0x849ea1['model'],qs[_0x0e28('0x2f')](_0x95defc[_0x0e28('0x2a')]['fields']));_0x48583b[_0x0e28('0x2e')]=_0x48583b['attributes']['length']?_0x48583b[_0x0e28('0x2e')]:_0x849ea1[_0x0e28('0x28')];if(!_0x95defc[_0x0e28('0x2a')][_0x0e28('0x30')](_0x0e28('0x31'))){_0x48583b['limit']=qs['limit'](_0x95defc[_0x0e28('0x2a')][_0x0e28('0x32')]);_0x48583b[_0x0e28('0x19')]=qs[_0x0e28('0x19')](_0x95defc[_0x0e28('0x2a')][_0x0e28('0x19')]);}_0x48583b[_0x0e28('0x33')]=qs[_0x0e28('0x34')](_0x95defc[_0x0e28('0x2a')][_0x0e28('0x34')]);_0x48583b[_0x0e28('0x35')]=qs[_0x0e28('0x2c')](_[_0x0e28('0x36')](_0x95defc[_0x0e28('0x2a')],_0x849ea1['filters']),_0x134704);if(_0x95defc[_0x0e28('0x2a')][_0x0e28('0x37')]){_0x48583b[_0x0e28('0x35')]=_['merge'](_0x48583b['where'],{'$or':_[_0x0e28('0x25')](_0x134704,function(_0x5a6db7){if(_0x5a6db7['type']!==_0x0e28('0x38')){var _0x4a0d1e={};_0x4a0d1e[_0x5a6db7[_0x0e28('0x29')]]={'$like':'%'+_0x95defc[_0x0e28('0x2a')][_0x0e28('0x37')]+'%'};return _0x4a0d1e;}})});}_0x48583b=_[_0x0e28('0x39')]({},_0x48583b,_0x95defc['options']);var _0x231dee={'where':_0x48583b[_0x0e28('0x35')]};return db[_0x0e28('0x26')][_0x0e28('0x18')](_0x231dee)['then'](function(_0x3d40c6){_0x3b32d7[_0x0e28('0x18')]=_0x3d40c6;if(_0x95defc[_0x0e28('0x2a')][_0x0e28('0x3a')]){_0x48583b[_0x0e28('0x3b')]=[{'all':!![]}];}return db[_0x0e28('0x26')][_0x0e28('0x3c')](_0x48583b);})[_0x0e28('0x1f')](function(_0x4bbc09){_0x3b32d7[_0x0e28('0x3d')]=_0x4bbc09;return _0x3b32d7;})[_0x0e28('0x1f')](respondWithFilteredResult(_0x31cc56,_0x48583b))[_0x0e28('0x3e')](handleError(_0x31cc56,null));};exports[_0x0e28('0x3f')]=function(_0x4470a3,_0x2f8b8d){var _0x3b41a5={'raw':!![],'where':{'id':_0x4470a3[_0x0e28('0x40')]['id']}},_0x39175a={};_0x39175a[_0x0e28('0x28')]=_[_0x0e28('0x2b')](db[_0x0e28('0x26')][_0x0e28('0x41')]);_0x39175a['query']=_['keys'](_0x4470a3['query']);_0x39175a[_0x0e28('0x2c')]=_[_0x0e28('0x2d')](_0x39175a[_0x0e28('0x28')],_0x39175a[_0x0e28('0x2a')]);_0x3b41a5['attributes']=_[_0x0e28('0x2d')](_0x39175a[_0x0e28('0x28')],qs[_0x0e28('0x2f')](_0x4470a3['query']['fields']));_0x3b41a5['attributes']=_0x3b41a5[_0x0e28('0x2e')][_0x0e28('0x42')]?_0x3b41a5['attributes']:_0x39175a[_0x0e28('0x28')];if(_0x4470a3[_0x0e28('0x2a')][_0x0e28('0x3a')]){_0x3b41a5[_0x0e28('0x3b')]=[{'all':!![]}];}_0x3b41a5=_[_0x0e28('0x39')]({},_0x3b41a5,_0x4470a3['options']);return db[_0x0e28('0x26')][_0x0e28('0x43')](_0x3b41a5)[_0x0e28('0x1f')](handleEntityNotFound(_0x2f8b8d,null))['then'](respondWithResult(_0x2f8b8d,null))[_0x0e28('0x3e')](handleError(_0x2f8b8d,null));};exports[_0x0e28('0x44')]=function(_0x4ecac2,_0x5e2c09){return db[_0x0e28('0x26')]['create'](_0x4ecac2[_0x0e28('0x45')],{})['then'](respondWithResult(_0x5e2c09,0xc9))[_0x0e28('0x3e')](handleError(_0x5e2c09,null));};exports[_0x0e28('0x46')]=function(_0x37e1d3,_0x467896){if(_0x37e1d3[_0x0e28('0x45')]['id']){delete _0x37e1d3[_0x0e28('0x45')]['id'];}return db[_0x0e28('0x26')][_0x0e28('0x43')]({'where':{'id':_0x37e1d3[_0x0e28('0x40')]['id']}})['then'](handleEntityNotFound(_0x467896,null))[_0x0e28('0x1f')](saveUpdates(_0x37e1d3[_0x0e28('0x45')],null))['then'](respondWithResult(_0x467896,null))[_0x0e28('0x3e')](handleError(_0x467896,null));};exports['destroy']=function(_0x39e3a6,_0x4958b0){return db['JscriptyAnswerReport'][_0x0e28('0x43')]({'where':{'id':_0x39e3a6[_0x0e28('0x40')]['id']}})[_0x0e28('0x1f')](handleEntityNotFound(_0x4958b0,null))[_0x0e28('0x1f')](removeEntity(_0x4958b0,null))[_0x0e28('0x3e')](handleError(_0x4958b0,null));};exports[_0x0e28('0x47')]=function(_0x26b781,_0x324f8e){return db[_0x0e28('0x26')][_0x0e28('0x47')]()['then'](respondWithResult(_0x324f8e,null))['catch'](handleError(_0x324f8e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 0b64b8b..7fb22a5 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 _0x9b1a=['JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x26e727,_0x3e65be){var _0x563800=function(_0xbcf999){while(--_0xbcf999){_0x26e727['push'](_0x26e727['shift']());}};_0x563800(++_0x3e65be);}(_0x9b1a,0x12e));var _0xa9b1=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x9b1a[_0x382a62];return _0x490a25;};'use strict';var _=require(_0xa9b1('0x0'));var util=require(_0xa9b1('0x1'));var logger=require(_0xa9b1('0x2'))(_0xa9b1('0x3'));var moment=require(_0xa9b1('0x4'));var BPromise=require(_0xa9b1('0x5'));var rp=require(_0xa9b1('0x6'));var fs=require('fs');var path=require(_0xa9b1('0x7'));var rimraf=require(_0xa9b1('0x8'));var config=require(_0xa9b1('0x9'));var attributes=require(_0xa9b1('0xa'));module[_0xa9b1('0xb')]=function(_0x2466e9,_0x3e99ba){return _0x2466e9[_0xa9b1('0xc')](_0xa9b1('0xd'),attributes,{'tableName':_0xa9b1('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3fb=['moment','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','lodash','util','../../config/logger'];(function(_0x5f57d7,_0x1ddc20){var _0xce443b=function(_0x3fabd3){while(--_0x3fabd3){_0x5f57d7['push'](_0x5f57d7['shift']());}};_0xce443b(++_0x1ddc20);}(_0xc3fb,0x15d));var _0xbc3f=function(_0x40d623,_0x2a0853){_0x40d623=_0x40d623-0x0;var _0x10255f=_0xc3fb[_0x40d623];return _0x10255f;};'use strict';var _=require(_0xbc3f('0x0'));var util=require(_0xbc3f('0x1'));var logger=require(_0xbc3f('0x2'))('api');var moment=require(_0xbc3f('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc3f('0x4'));var fs=require('fs');var path=require(_0xbc3f('0x5'));var rimraf=require('rimraf');var config=require(_0xbc3f('0x6'));var attributes=require(_0xbc3f('0x7'));module[_0xbc3f('0x8')]=function(_0x4e5e77,_0x1088a6){return _0x4e5e77[_0xbc3f('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0xbc3f('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 f9a8999..e5e0c51 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 _0x0373=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','stringify','code','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result'];(function(_0x443f8,_0x400425){var _0x8378f4=function(_0xe760){while(--_0xe760){_0x443f8['push'](_0x443f8['shift']());}};_0x8378f4(++_0x400425);}(_0x0373,0x111));var _0x3037=function(_0x45735b,_0x15bf2f){_0x45735b=_0x45735b-0x0;var _0x1c7553=_0x0373[_0x45735b];return _0x1c7553;};'use strict';var _=require(_0x3037('0x0'));var util=require(_0x3037('0x1'));var moment=require(_0x3037('0x2'));var BPromise=require('bluebird');var rs=require(_0x3037('0x3'));var fs=require('fs');var Redis=require(_0x3037('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3037('0x5'));var logger=require(_0x3037('0x6'))(_0x3037('0x7'));var config=require(_0x3037('0x8'));var jayson=require(_0x3037('0x9'));var client=jayson['client'][_0x3037('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b8088,_0x3a6b17,_0x4f45c7){return new BPromise(function(_0x3ce2a7,_0x20275e){return client[_0x3037('0xb')](_0x5b8088,_0x4f45c7)['then'](function(_0x5cf123){logger[_0x3037('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3a6b17,'request\x20sent');logger[_0x3037('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x3a6b17,_0x3037('0xe'),JSON[_0x3037('0xf')](_0x5cf123));if(_0x5cf123['error']){if(_0x5cf123['error'][_0x3037('0x10')]===0x1f4){logger[_0x3037('0x11')](_0x3037('0x12'),_0x3a6b17,_0x5cf123['error'][_0x3037('0x13')]);return _0x20275e(_0x5cf123[_0x3037('0x11')][_0x3037('0x13')]);}logger[_0x3037('0x11')](_0x3037('0x12'),_0x3a6b17,_0x5cf123[_0x3037('0x11')][_0x3037('0x13')]);return _0x3ce2a7(_0x5cf123[_0x3037('0x11')][_0x3037('0x13')]);}else{logger[_0x3037('0xc')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3a6b17,_0x3037('0xe'));_0x3ce2a7(_0x5cf123[_0x3037('0x14')][_0x3037('0x13')]);}})['catch'](function(_0x3d23c7){logger[_0x3037('0x11')](_0x3037('0x12'),_0x3a6b17,_0x3d23c7);_0x20275e(_0x3d23c7);});});} \ No newline at end of file +var _0x0c3a=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util'];(function(_0x5c3cb4,_0x4f4f52){var _0x4e5241=function(_0x44fefc){while(--_0x44fefc){_0x5c3cb4['push'](_0x5c3cb4['shift']());}};_0x4e5241(++_0x4f4f52);}(_0x0c3a,0xcd));var _0xa0c3=function(_0x5b672a,_0x4ffeb6){_0x5b672a=_0x5b672a-0x0;var _0x1e4aa0=_0x0c3a[_0x5b672a];return _0x1e4aa0;};'use strict';var _=require(_0xa0c3('0x0'));var util=require(_0xa0c3('0x1'));var moment=require(_0xa0c3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0c3('0x3'));var fs=require('fs');var Redis=require(_0xa0c3('0x4'));var db=require(_0xa0c3('0x5'))['db'];var utils=require(_0xa0c3('0x6'));var logger=require(_0xa0c3('0x7'))('rpc');var config=require(_0xa0c3('0x8'));var jayson=require(_0xa0c3('0x9'));var client=jayson[_0xa0c3('0xa')][_0xa0c3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x520445,_0x5a20fa,_0x2c4ada){return new BPromise(function(_0x448399,_0x588326){return client[_0xa0c3('0xc')](_0x520445,_0x2c4ada)[_0xa0c3('0xd')](function(_0x1ffddd){logger[_0xa0c3('0xe')](_0xa0c3('0xf'),_0x5a20fa,_0xa0c3('0x10'));logger[_0xa0c3('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x5a20fa,_0xa0c3('0x10'),JSON[_0xa0c3('0x12')](_0x1ffddd));if(_0x1ffddd['error']){if(_0x1ffddd[_0xa0c3('0x13')][_0xa0c3('0x14')]===0x1f4){logger[_0xa0c3('0x13')](_0xa0c3('0xf'),_0x5a20fa,_0x1ffddd[_0xa0c3('0x13')]['message']);return _0x588326(_0x1ffddd[_0xa0c3('0x13')]['message']);}logger[_0xa0c3('0x13')](_0xa0c3('0xf'),_0x5a20fa,_0x1ffddd[_0xa0c3('0x13')][_0xa0c3('0x15')]);return _0x448399(_0x1ffddd['error'][_0xa0c3('0x15')]);}else{logger['info'](_0xa0c3('0xf'),_0x5a20fa,_0xa0c3('0x10'));_0x448399(_0x1ffddd['result']['message']);}})[_0xa0c3('0x16')](function(_0x494776){logger[_0xa0c3('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5a20fa,_0x494776);_0x588326(_0x494776);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 8ece3d7..19bc8fb 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 _0xbdc2=['update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','put'];(function(_0x15c030,_0xc64b2e){var _0x365bc8=function(_0xfd2bfb){while(--_0xfd2bfb){_0x15c030['push'](_0x15c030['shift']());}};_0x365bc8(++_0xc64b2e);}(_0xbdc2,0x148));var _0x2bdc=function(_0x6376b0,_0x52d8c1){_0x6376b0=_0x6376b0-0x0;var _0x47ac71=_0xbdc2[_0x6376b0];return _0x47ac71;};'use strict';var multer=require(_0x2bdc('0x0'));var util=require(_0x2bdc('0x1'));var path=require(_0x2bdc('0x2'));var timeout=require(_0x2bdc('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x2bdc('0x4'));var interaction=require(_0x2bdc('0x5'));var config=require('../../config/environment');var controller=require(_0x2bdc('0x6'));router[_0x2bdc('0x7')]('/',auth['isAuthenticated'](),controller[_0x2bdc('0x8')]);router['get'](_0x2bdc('0x9'),auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xb')]);router[_0x2bdc('0x7')](_0x2bdc('0xc'),auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xd')]);router[_0x2bdc('0x7')](_0x2bdc('0xe'),auth[_0x2bdc('0xa')](),controller[_0x2bdc('0xf')]);router[_0x2bdc('0x7')](_0x2bdc('0x10'),auth['isAuthenticated'](),timeout(_0x2bdc('0x11')),controller['getSummary']);router[_0x2bdc('0x12')]('/',auth[_0x2bdc('0xa')](),controller[_0x2bdc('0x13')]);router['post'](_0x2bdc('0x14'),auth['isAuthenticated'](),controller[_0x2bdc('0x15')]);router[_0x2bdc('0x16')](_0x2bdc('0x9'),auth[_0x2bdc('0xa')](),controller[_0x2bdc('0x17')]);router[_0x2bdc('0x18')](_0x2bdc('0x9'),auth['isAuthenticated'](),controller[_0x2bdc('0x19')]);module[_0x2bdc('0x1a')]=router; \ No newline at end of file +var _0xf3da=['get','getSessions','/:id/answers','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','/:id','show'];(function(_0x2a1a9c,_0xad16c0){var _0x4a5c35=function(_0x58ae1f){while(--_0x58ae1f){_0x2a1a9c['push'](_0x2a1a9c['shift']());}};_0x4a5c35(++_0xad16c0);}(_0xf3da,0x12c));var _0xaf3d=function(_0xec53e7,_0x4ba16b){_0xec53e7=_0xec53e7-0x0;var _0x323257=_0xf3da[_0xec53e7];return _0x323257;};'use strict';var multer=require(_0xaf3d('0x0'));var util=require(_0xaf3d('0x1'));var path=require(_0xaf3d('0x2'));var timeout=require(_0xaf3d('0x3'));var express=require('express');var router=express[_0xaf3d('0x4')]();var auth=require(_0xaf3d('0x5'));var interaction=require(_0xaf3d('0x6'));var config=require(_0xaf3d('0x7'));var controller=require(_0xaf3d('0x8'));router['get']('/',auth[_0xaf3d('0x9')](),controller['index']);router['get'](_0xaf3d('0xa'),auth[_0xaf3d('0x9')](),controller[_0xaf3d('0xb')]);router[_0xaf3d('0xc')]('/:id/sessions',auth[_0xaf3d('0x9')](),controller[_0xaf3d('0xd')]);router[_0xaf3d('0xc')](_0xaf3d('0xe'),auth[_0xaf3d('0x9')](),controller[_0xaf3d('0xf')]);router['get'](_0xaf3d('0x10'),auth[_0xaf3d('0x9')](),timeout(_0xaf3d('0x11')),controller['getSummary']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xaf3d('0x12')](_0xaf3d('0x13'),auth[_0xaf3d('0x9')](),controller[_0xaf3d('0x14')]);router[_0xaf3d('0x15')](_0xaf3d('0xa'),auth['isAuthenticated'](),controller[_0xaf3d('0x16')]);router['delete'](_0xaf3d('0xa'),auth[_0xaf3d('0x9')](),controller[_0xaf3d('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a122185..3ff2652 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 _0xd2e4=['exports','STRING','name','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util'];(function(_0x8dd439,_0x54a8b6){var _0x48c2b6=function(_0x5a101e){while(--_0x5a101e){_0x8dd439['push'](_0x8dd439['shift']());}};_0x48c2b6(++_0x54a8b6);}(_0xd2e4,0x151));var _0x4d2e=function(_0x33937c,_0x4b0c24){_0x33937c=_0x33937c-0x0;var _0x106c28=_0xd2e4[_0x33937c];return _0x106c28;};'use strict';var Sequelize=require(_0x4d2e('0x0'));var _=require(_0x4d2e('0x1'));var util=require(_0x4d2e('0x2'));module[_0x4d2e('0x3')]={'name':{'type':Sequelize[_0x4d2e('0x4')],'unique':_0x4d2e('0x5')},'description':{'type':Sequelize[_0x4d2e('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x4d2e('0x6')),'set':function(_0x1f62cb){if(_[_0x4d2e('0x7')](_0x1f62cb)){this[_0x4d2e('0x8')](_0x4d2e('0x9'),JSON[_0x4d2e('0xa')](_0x1f62cb));}else if(_[_0x4d2e('0xb')](_0x1f62cb)){this[_0x4d2e('0x8')](_0x4d2e('0x9'),_0x1f62cb);}else{this[_0x4d2e('0x8')](_0x4d2e('0x9'),util[_0x4d2e('0xc')](_0x4d2e('0xd'),this[_0x4d2e('0xe')](_0x4d2e('0x5'))||'',this[_0x4d2e('0xe')](_0x4d2e('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4d2e('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4d2e('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xb2ed=['stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','util','exports','STRING','TEXT','long','isObjectLike','formData'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xb2ed,0xca));var _0xdb2e=function(_0x2d6197,_0x82ebfb){_0x2d6197=_0x2d6197-0x0;var _0x4d0e75=_0xb2ed[_0x2d6197];return _0x4d0e75;};'use strict';var Sequelize=require(_0xdb2e('0x0'));var _=require('lodash');var util=require(_0xdb2e('0x1'));module[_0xdb2e('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xdb2e('0x3')]},'formData':{'type':Sequelize[_0xdb2e('0x4')](_0xdb2e('0x5')),'set':function(_0x227bd6){if(_[_0xdb2e('0x6')](_0x227bd6)){this['setDataValue'](_0xdb2e('0x7'),JSON[_0xdb2e('0x8')](_0x227bd6));}else if(_[_0xdb2e('0x9')](_0x227bd6)){this[_0xdb2e('0xa')](_0xdb2e('0x7'),_0x227bd6);}else{this[_0xdb2e('0xa')](_0xdb2e('0x7'),util[_0xdb2e('0xb')](_0xdb2e('0xc'),this[_0xdb2e('0xd')]('name')||'',this[_0xdb2e('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xdb2e('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xdb2e('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index b11f2a0..93566bf 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 _0x734f=['limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','length','attributes','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','merge','create','user','get','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getSessions','findOne','JscriptySessionReport','hasOwnProperty','nolimit','ProjectId','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','questionId','question','answer','push','now','format','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset'];(function(_0x472e35,_0x32ee94){var _0x56b383=function(_0x1832f2){while(--_0x1832f2){_0x472e35['push'](_0x472e35['shift']());}};_0x56b383(++_0x32ee94);}(_0x734f,0xc7));var _0xf734=function(_0x543670,_0x4d26b5){_0x543670=_0x543670-0x0;var _0x1e1c2d=_0x734f[_0x543670];return _0x1e1c2d;};'use strict';var pdf=require(_0xf734('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf734('0x1'));var zipdir=require(_0xf734('0x2'));var jsonpatch=require(_0xf734('0x3'));var rp=require(_0xf734('0x4'));var moment=require(_0xf734('0x5'));var BPromise=require(_0xf734('0x6'));var Mustache=require(_0xf734('0x7'));var util=require(_0xf734('0x8'));var path=require(_0xf734('0x9'));var sox=require(_0xf734('0xa'));var csv=require('to-csv');var ejs=require(_0xf734('0xb'));var fs=require('fs');var _=require(_0xf734('0xc'));var squel=require(_0xf734('0xd'));var crypto=require(_0xf734('0xe'));var jsforce=require(_0xf734('0xf'));var deskjs=require(_0xf734('0x10'));var toCsv=require(_0xf734('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf734('0x12'));var qs=require(_0xf734('0x13'));var as=require(_0xf734('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf734('0x15'))('api');var utils=require(_0xf734('0x16'));var config=require(_0xf734('0x17'));var db=require(_0xf734('0x18'))['db'];function respondWithStatusCode(_0xdf0e3f,_0xcfc42b){_0xcfc42b=_0xcfc42b||0xcc;return function(_0xf66589){if(_0xf66589){return _0xdf0e3f['sendStatus'](_0xcfc42b);}return _0xdf0e3f['status'](_0xcfc42b)['end']();};}function respondWithResult(_0x5ebc42,_0x51db82){_0x51db82=_0x51db82||0xc8;return function(_0x2a4801){if(_0x2a4801){return _0x5ebc42[_0xf734('0x19')](_0x51db82)[_0xf734('0x1a')](_0x2a4801);}};}function respondWithFilteredResult(_0x277154,_0x22b3c8){return function(_0x4246bf){if(_0x4246bf){var _0x3415f5=_0x4246bf[_0xf734('0x1b')],_0xbfc177=_0x22b3c8[_0xf734('0x1c')],_0x58ec2a=_0x22b3c8['offset']+_0x22b3c8[_0xf734('0x1d')],_0x121859;if(_0x58ec2a>=_0x3415f5){_0x58ec2a=_0x3415f5;_0x121859=0xc8;}else{_0x121859=0xce;}_0x277154[_0xf734('0x19')](_0x121859);return _0x277154[_0xf734('0x1e')](_0xf734('0x1f'),_0xbfc177+'-'+_0x58ec2a+'/'+_0x3415f5)[_0xf734('0x1a')](_0x4246bf);}return null;};}function patchUpdates(_0x40b3fe){return function(_0x56cdea){try{jsonpatch[_0xf734('0x20')](_0x56cdea,_0x40b3fe,!![]);}catch(_0x47a89e){return BPromise[_0xf734('0x21')](_0x47a89e);}return _0x56cdea[_0xf734('0x22')]();};}function saveUpdates(_0xc01021,_0x14acb9){return function(_0x59d9fe){if(_0x59d9fe){return _0x59d9fe[_0xf734('0x23')](_0xc01021)[_0xf734('0x24')](function(_0x41db2b){return _0x41db2b;});}return null;};}function removeEntity(_0x25fbee,_0xf7a56e){return function(_0x6f0027){if(_0x6f0027){return _0x6f0027[_0xf734('0x25')]()[_0xf734('0x24')](function(){var _0x485952=_0x6f0027['get']({'plain':!![]});var _0xceabdd='Projects';return db[_0xf734('0x26')][_0xf734('0x25')]({'where':{'type':_0xceabdd,'resourceId':_0x485952['id']}})[_0xf734('0x24')](function(){return _0x6f0027;});})[_0xf734('0x24')](function(){_0x25fbee[_0xf734('0x19')](0xcc)[_0xf734('0x27')]();});}};}function handleEntityNotFound(_0x8097a8,_0x3e30d6){return function(_0x23ce31){if(!_0x23ce31){_0x8097a8[_0xf734('0x28')](0x194);}return _0x23ce31;};}function handleError(_0x386d31,_0x20ef7f){_0x20ef7f=_0x20ef7f||0x1f4;return function(_0x2fe37e){logger[_0xf734('0x29')](_0x2fe37e[_0xf734('0x2a')]);if(_0x2fe37e[_0xf734('0x2b')]){delete _0x2fe37e[_0xf734('0x2b')];}_0x386d31[_0xf734('0x19')](_0x20ef7f)[_0xf734('0x2c')](_0x2fe37e);};}exports[_0xf734('0x2d')]=function(_0x30e38a,_0x34a1f9){var _0x2c570a={},_0x2016b6={},_0x2200a0={'count':0x0,'rows':[]};var _0x335ac4=_[_0xf734('0x2e')](db[_0xf734('0x2f')][_0xf734('0x30')],function(_0x2d7b6f){return{'name':_0x2d7b6f[_0xf734('0x31')],'type':_0x2d7b6f[_0xf734('0x32')]['key']};});_0x2016b6['model']=_['map'](_0x335ac4,_0xf734('0x2b'));_0x2016b6[_0xf734('0x33')]=_[_0xf734('0x34')](_0x30e38a['query']);_0x2016b6[_0xf734('0x35')]=_['intersection'](_0x2016b6[_0xf734('0x36')],_0x2016b6[_0xf734('0x33')]);_0x2c570a['attributes']=_[_0xf734('0x37')](_0x2016b6[_0xf734('0x36')],qs['fields'](_0x30e38a[_0xf734('0x33')][_0xf734('0x38')]));_0x2c570a['attributes']=_0x2c570a['attributes'][_0xf734('0x39')]?_0x2c570a[_0xf734('0x3a')]:_0x2016b6[_0xf734('0x36')];if(!_0x30e38a['query']['hasOwnProperty']('nolimit')){_0x2c570a['limit']=qs[_0xf734('0x1d')](_0x30e38a[_0xf734('0x33')]['limit']);_0x2c570a[_0xf734('0x1c')]=qs['offset'](_0x30e38a['query']['offset']);}_0x2c570a[_0xf734('0x3b')]=qs[_0xf734('0x3c')](_0x30e38a[_0xf734('0x33')][_0xf734('0x3c')]);_0x2c570a[_0xf734('0x3d')]=qs[_0xf734('0x35')](_[_0xf734('0x3e')](_0x30e38a[_0xf734('0x33')],_0x2016b6[_0xf734('0x35')]),_0x335ac4);if(_0x30e38a[_0xf734('0x33')][_0xf734('0x3f')]){_0x2c570a['where']=_['merge'](_0x2c570a[_0xf734('0x3d')],{'$or':_[_0xf734('0x2e')](_0x335ac4,function(_0x23aae1){if(_0x23aae1[_0xf734('0x32')]!==_0xf734('0x40')){var _0x59f2d1={};_0x59f2d1[_0x23aae1['name']]={'$like':'%'+_0x30e38a[_0xf734('0x33')][_0xf734('0x3f')]+'%'};return _0x59f2d1;}})});}_0x2c570a=_['merge']({},_0x2c570a,_0x30e38a[_0xf734('0x41')]);var _0x325016={'where':_0x2c570a[_0xf734('0x3d')]};return db['JscriptyProject'][_0xf734('0x1b')](_0x325016)[_0xf734('0x24')](function(_0x1ad88d){_0x2200a0[_0xf734('0x1b')]=_0x1ad88d;if(_0x30e38a[_0xf734('0x33')]['includeAll']){_0x2c570a[_0xf734('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0xf734('0x43')](_0x2c570a);})[_0xf734('0x24')](function(_0x295323){_0x2200a0[_0xf734('0x44')]=_0x295323;return _0x2200a0;})[_0xf734('0x24')](respondWithFilteredResult(_0x34a1f9,_0x2c570a))[_0xf734('0x45')](handleError(_0x34a1f9,null));};exports['show']=function(_0x2db22e,_0xbb210a){var _0x4b449a={'raw':![],'where':{'id':_0x2db22e[_0xf734('0x46')]['id']}},_0x3709a5={};_0x3709a5[_0xf734('0x36')]=_[_0xf734('0x34')](db['JscriptyProject'][_0xf734('0x30')]);_0x3709a5[_0xf734('0x33')]=_['keys'](_0x2db22e[_0xf734('0x33')]);_0x3709a5[_0xf734('0x35')]=_[_0xf734('0x37')](_0x3709a5[_0xf734('0x36')],_0x3709a5[_0xf734('0x33')]);_0x4b449a[_0xf734('0x3a')]=_['intersection'](_0x3709a5['model'],qs['fields'](_0x2db22e[_0xf734('0x33')][_0xf734('0x38')]));_0x4b449a[_0xf734('0x3a')]=_0x4b449a[_0xf734('0x3a')]['length']?_0x4b449a[_0xf734('0x3a')]:_0x3709a5['model'];if(_0x2db22e[_0xf734('0x33')][_0xf734('0x47')]){_0x4b449a['include']=[{'all':!![]}];}_0x4b449a=_[_0xf734('0x48')]({},_0x4b449a,_0x2db22e[_0xf734('0x41')]);return db['JscriptyProject']['find'](_0x4b449a)[_0xf734('0x24')](handleEntityNotFound(_0xbb210a,null))['then'](respondWithResult(_0xbb210a,null))[_0xf734('0x45')](handleError(_0xbb210a,null));};exports[_0xf734('0x49')]=function(_0x2bd271,_0x428930){return db[_0xf734('0x2f')][_0xf734('0x49')](_0x2bd271['body'],{})[_0xf734('0x24')](function(_0x3143b1){var _0x42ba3b=_0x2bd271[_0xf734('0x4a')][_0xf734('0x4b')]({'plain':!![]});if(!_0x42ba3b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x42ba3b[_0xf734('0x4c')]===_0xf734('0x4a')){var _0xbbba5c=_0x3143b1['get']({'plain':!![]});var _0x43faf0='Projects';return db[_0xf734('0x4d')][_0xf734('0x4e')]({'where':{'name':_0x43faf0,'userProfileId':_0x42ba3b[_0xf734('0x4f')]},'raw':!![]})[_0xf734('0x24')](function(_0x2b1ab6){if(_0x2b1ab6&&_0x2b1ab6['autoAssociation']===0x0){return db['UserProfileResource'][_0xf734('0x49')]({'name':_0xbbba5c[_0xf734('0x2b')],'resourceId':_0xbbba5c['id'],'type':_0x2b1ab6['name'],'sectionId':_0x2b1ab6['id']},{})['then'](function(){return _0x3143b1;});}else{return _0x3143b1;}})[_0xf734('0x45')](function(_0xd1e629){logger['error'](_0xf734('0x50'),_0xd1e629);throw _0xd1e629;});}return _0x3143b1;})[_0xf734('0x24')](respondWithResult(_0x428930,0xc9))['catch'](handleError(_0x428930,null));};exports[_0xf734('0x51')]=function(_0x195704,_0x2765a8){var _0x370539={'where':{'id':_0x195704[_0xf734('0x46')]['id']}},_0xf93488={};_0xf93488['model']=_[_0xf734('0x34')](db[_0xf734('0x2f')][_0xf734('0x30')]);_0x370539[_0xf734('0x3a')]=_[_0xf734('0x37')](_0xf93488[_0xf734('0x36')],qs[_0xf734('0x38')](_0x195704[_0xf734('0x33')][_0xf734('0x38')]));_0x370539['attributes']=_0x370539[_0xf734('0x3a')]['length']?_0x370539[_0xf734('0x3a')]:_0xf93488[_0xf734('0x36')];if(_0x195704['query']['includeAll']){_0x370539['include']=[{'all':!![]}];}_0x370539=_['merge']({},_0x370539,_0x195704['options']);return db['JscriptyProject']['find'](_0x370539)[_0xf734('0x24')](handleEntityNotFound(_0x2765a8,null))[_0xf734('0x24')](function(_0x527d32){if(_0x527d32){var _0x40ba96=_0x527d32[_0xf734('0x4b')]({'plain':!![]});_0x40ba96=qs[_0xf734('0x52')](_0x40ba96,['id',_0xf734('0x53'),_0xf734('0x54')]);_0x195704['body']=_[_0xf734('0x52')](_0x195704[_0xf734('0x55')],['id',_0xf734('0x53'),'updatedAt']);return db[_0xf734('0x2f')][_0xf734('0x49')](_[_0xf734('0x48')](_0x40ba96,_0x195704['body']),{'include':_0x195704[_0xf734('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0xf734('0x24')](function(_0x5676a1){var _0xc107ee=_0x195704[_0xf734('0x4a')][_0xf734('0x4b')]({'plain':!![]});if(!_0xc107ee)throw new Error(_0xf734('0x56'));if(_0xc107ee['role']===_0xf734('0x4a')){var _0x339bfc=_0x5676a1[_0xf734('0x4b')]({'plain':!![]});var _0x31fce1='Projects';return db[_0xf734('0x4d')][_0xf734('0x4e')]({'where':{'name':_0x31fce1,'userProfileId':_0xc107ee[_0xf734('0x4f')]},'raw':!![]})[_0xf734('0x24')](function(_0x180f7d){if(_0x180f7d&&_0x180f7d[_0xf734('0x57')]===0x0){return db[_0xf734('0x26')]['create']({'name':_0x339bfc[_0xf734('0x2b')],'resourceId':_0x339bfc['id'],'type':_0x180f7d[_0xf734('0x2b')],'sectionId':_0x180f7d['id']},{})[_0xf734('0x24')](function(){return _0x5676a1;});}else{return _0x5676a1;}})['catch'](function(_0x16966e){logger[_0xf734('0x29')](_0xf734('0x50'),_0x16966e);throw _0x16966e;});}return _0x5676a1;});}})['then'](respondWithResult(_0x2765a8,0xc9))['catch'](handleError(_0x2765a8,null));};exports[_0xf734('0x23')]=function(_0x5a3b00,_0x574707){if(_0x5a3b00[_0xf734('0x55')]['id']){delete _0x5a3b00[_0xf734('0x55')]['id'];}return db[_0xf734('0x2f')][_0xf734('0x4e')]({'where':{'id':_0x5a3b00[_0xf734('0x46')]['id']}})[_0xf734('0x24')](handleEntityNotFound(_0x574707,null))[_0xf734('0x24')](saveUpdates(_0x5a3b00[_0xf734('0x55')],null))[_0xf734('0x24')](respondWithResult(_0x574707,null))[_0xf734('0x45')](handleError(_0x574707,null));};exports[_0xf734('0x25')]=function(_0x729f80,_0x4dee0c){return db['JscriptyProject'][_0xf734('0x4e')]({'where':{'id':_0x729f80[_0xf734('0x46')]['id']}})['then'](handleEntityNotFound(_0x4dee0c,null))[_0xf734('0x24')](removeEntity(_0x4dee0c,null))[_0xf734('0x45')](handleError(_0x4dee0c,null));};exports[_0xf734('0x58')]=function(_0x2d0b0d,_0x31fb8a,_0x43e4f7){var _0x2e75a4={'raw':!![],'where':{}};var _0x54131c={};var _0x1c4abe={'count':0x0,'rows':[]};return db[_0xf734('0x2f')][_0xf734('0x59')]({'where':{'id':_0x2d0b0d[_0xf734('0x46')]['id']}})[_0xf734('0x24')](handleEntityNotFound(_0x31fb8a,null))[_0xf734('0x24')](function(_0x4deeb6){if(_0x4deeb6){_0x54131c['model']=_['keys'](db[_0xf734('0x5a')]['rawAttributes']);_0x54131c[_0xf734('0x33')]=_[_0xf734('0x34')](_0x2d0b0d[_0xf734('0x33')]);_0x54131c[_0xf734('0x35')]=_[_0xf734('0x37')](_0x54131c[_0xf734('0x36')],_0x54131c[_0xf734('0x33')]);_0x2e75a4[_0xf734('0x3a')]=_[_0xf734('0x37')](_0x54131c[_0xf734('0x36')],qs[_0xf734('0x38')](_0x2d0b0d['query'][_0xf734('0x38')]));_0x2e75a4[_0xf734('0x3a')]=_0x2e75a4[_0xf734('0x3a')]['length']?_0x2e75a4['attributes']:_0x54131c[_0xf734('0x36')];if(!_0x2d0b0d['query'][_0xf734('0x5b')](_0xf734('0x5c'))){_0x2e75a4[_0xf734('0x1d')]=qs['limit'](_0x2d0b0d['query'][_0xf734('0x1d')]);_0x2e75a4[_0xf734('0x1c')]=qs[_0xf734('0x1c')](_0x2d0b0d['query'][_0xf734('0x1c')]);}_0x2e75a4[_0xf734('0x3b')]=qs[_0xf734('0x3c')](_0x2d0b0d[_0xf734('0x33')][_0xf734('0x3c')]);_0x2e75a4[_0xf734('0x3d')]=qs[_0xf734('0x35')](_[_0xf734('0x3e')](_0x2d0b0d[_0xf734('0x33')],_0x54131c[_0xf734('0x35')]));_0x2e75a4['where'][_0xf734('0x5d')]=_0x4deeb6['id'];if(_0x2d0b0d['query'][_0xf734('0x3f')]){_0x2e75a4['where']=_[_0xf734('0x48')](_0x2e75a4['where'],{'$or':_[_0xf734('0x2e')](_0x2e75a4[_0xf734('0x3a')],function(_0x322786){var _0x449cc8={};_0x449cc8[_0x322786]={'$like':'%'+_0x2d0b0d[_0xf734('0x33')][_0xf734('0x3f')]+'%'};return _0x449cc8;})});}_0x2e75a4=_[_0xf734('0x48')]({},_0x2e75a4,_0x2d0b0d['options']);return db[_0xf734('0x5a')][_0xf734('0x1b')]({'where':_0x2e75a4['where']})['then'](function(_0x4a0a06){_0x1c4abe['count']=_0x4a0a06;if(_0x2d0b0d[_0xf734('0x33')]['includeAll']){_0x2e75a4[_0xf734('0x42')]=[{'all':!![]}];}return db[_0xf734('0x5a')][_0xf734('0x43')](_0x2e75a4);})[_0xf734('0x24')](function(_0x422892){_0x1c4abe[_0xf734('0x44')]=_0x422892;return _0x1c4abe;});}})[_0xf734('0x24')](respondWithFilteredResult(_0x31fb8a,_0x2e75a4))[_0xf734('0x45')](handleError(_0x31fb8a,null));};exports['getAnswers']=function(_0x44978b,_0x174a77,_0x20db95){var _0x2a3c71={'raw':!![],'where':{}};var _0x2f02fe={};var _0x3208d9={'count':0x0,'rows':[]};return db[_0xf734('0x2f')][_0xf734('0x59')]({'where':{'id':_0x44978b['params']['id']}})[_0xf734('0x24')](handleEntityNotFound(_0x174a77,null))[_0xf734('0x24')](function(_0x456b25){if(_0x456b25){_0x2f02fe['model']=_['keys'](db[_0xf734('0x5e')]['rawAttributes']);_0x2f02fe['query']=_[_0xf734('0x34')](_0x44978b['query']);_0x2f02fe[_0xf734('0x35')]=_[_0xf734('0x37')](_0x2f02fe[_0xf734('0x36')],_0x2f02fe[_0xf734('0x33')]);_0x2a3c71[_0xf734('0x3a')]=_[_0xf734('0x37')](_0x2f02fe[_0xf734('0x36')],qs[_0xf734('0x38')](_0x44978b[_0xf734('0x33')]['fields']));_0x2a3c71[_0xf734('0x3a')]=_0x2a3c71['attributes'][_0xf734('0x39')]?_0x2a3c71['attributes']:_0x2f02fe[_0xf734('0x36')];if(!_0x44978b[_0xf734('0x33')][_0xf734('0x5b')](_0xf734('0x5c'))){_0x2a3c71[_0xf734('0x1d')]=qs['limit'](_0x44978b[_0xf734('0x33')][_0xf734('0x1d')]);_0x2a3c71['offset']=qs[_0xf734('0x1c')](_0x44978b[_0xf734('0x33')]['offset']);}_0x2a3c71[_0xf734('0x3b')]=qs['sort'](_0x44978b[_0xf734('0x33')]['sort']);_0x2a3c71[_0xf734('0x3d')]=qs[_0xf734('0x35')](_[_0xf734('0x3e')](_0x44978b[_0xf734('0x33')],_0x2f02fe['filters']));_0x2a3c71[_0xf734('0x3d')]['ProjectId']=_0x456b25['id'];if(_0x44978b[_0xf734('0x33')]['filter']){_0x2a3c71[_0xf734('0x3d')]=_[_0xf734('0x48')](_0x2a3c71[_0xf734('0x3d')],{'$or':_['map'](_0x2a3c71['attributes'],function(_0x3a7307){var _0x4e5cf6={};_0x4e5cf6[_0x3a7307]={'$like':'%'+_0x44978b[_0xf734('0x33')][_0xf734('0x3f')]+'%'};return _0x4e5cf6;})});}_0x2a3c71=_['merge']({},_0x2a3c71,_0x44978b[_0xf734('0x41')]);return db[_0xf734('0x5e')][_0xf734('0x1b')]({'where':_0x2a3c71[_0xf734('0x3d')]})[_0xf734('0x24')](function(_0x1732a3){_0x3208d9['count']=_0x1732a3;if(_0x44978b[_0xf734('0x33')][_0xf734('0x47')]){_0x2a3c71[_0xf734('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xf734('0x43')](_0x2a3c71);})[_0xf734('0x24')](function(_0x442ebc){_0x3208d9[_0xf734('0x44')]=_0x442ebc;return _0x3208d9;});}})[_0xf734('0x24')](respondWithFilteredResult(_0x174a77,_0x2a3c71))[_0xf734('0x45')](handleError(_0x174a77,null));};function char(_0x4b3f94){return'number'===typeof _0x4b3f94?String[_0xf734('0x5f')][_0xf734('0x20')](null,arguments):_0x4b3f94;}function needsEncapsulation(_0x7efe05){return!!_0x7efe05&&(_0x7efe05[_0xf734('0x60')]()['indexOf'](char(0xd))>=0x0||_0x7efe05[_0xf734('0x60')]()[_0xf734('0x61')](char(0xa))>=0x0||_0x7efe05[_0xf734('0x60')]()[_0xf734('0x61')](char(0x2c))>=0x0||_0x7efe05[_0xf734('0x60')]()[_0xf734('0x61')](char(0x22))>=0x0);}function encapsulate(_0x25a9d7){var _0xa6ca21=char(0x22),_0x25c615='\x5c'+char(0x22),_0x1fdf6b=_0x25a9d7['toString']()[_0xf734('0x62')](new RegExp(_0xa6ca21,'g'),_0x25c615);return _0xa6ca21+_0x1fdf6b+_0xa6ca21;}exports[_0xf734('0x63')]=function(_0x543e74,_0x47ed84,_0x28ae03){var _0x5b83dc,_0x1b1887;var _0x569c1f={'where':{'ProjectId':_0x543e74[_0xf734('0x46')]['id']}};if(_0x543e74[_0xf734('0x33')][_0xf734('0x64')]){_0x569c1f[_0xf734('0x3d')]['starttime']=JSON[_0xf734('0x65')](_0x543e74['query'][_0xf734('0x64')]);}return db[_0xf734('0x5a')][_0xf734('0x43')](_0x569c1f)[_0xf734('0x24')](handleEntityNotFound(_0x47ed84,null))[_0xf734('0x24')](function(_0x5e1f17){if(_0x5e1f17){_0x5b83dc=_0x5e1f17;return db[_0xf734('0x66')][_0xf734('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x5b83dc,'id')},'ProjectId':_0x543e74[_0xf734('0x46')]['id']},'order':'-createdAt'});}})[_0xf734('0x24')](handleEntityNotFound(_0x47ed84,null))[_0xf734('0x24')](function(_0x304be3){if(_0x304be3){_0x1b1887=_0x304be3;var _0x29ec3d={};for(var _0x30979b=0x0,_0x5b72ea=_0x1b1887[_0xf734('0x39')];_0x30979b<_0x5b72ea;_0x30979b++){if(!_0x29ec3d['hasOwnProperty'](_0x1b1887[_0x30979b]['questionId'])){_0x29ec3d[_0x1b1887[_0x30979b][_0xf734('0x67')]]=needsEncapsulation(_0x1b1887[_0x30979b][_0xf734('0x68')])?encapsulate(_0x1b1887[_0x30979b][_0xf734('0x68')]):_0x1b1887[_0x30979b]['question'];}}var _0x3f1771=[],_0x1f83fd={};for(var _0x1f9db1=0x0,_0x5d0f78=_0x5b83dc[_0xf734('0x39')];_0x1f9db1<_0x5d0f78;_0x1f9db1++){_0x1f83fd={'ProjectId':_0x543e74[_0xf734('0x46')]['id'],'SessionId':_0x5b83dc[_0x1f9db1]['id'],'StartTime':moment(_0x5b83dc[_0x1f9db1]['starttime'])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x133e46=0x0,_0x8cb795=_0x1b1887[_0xf734('0x39')];_0x133e46<_0x8cb795;_0x133e46++){if(_0x1b1887[_0x133e46]['SessionId']==_0x5b83dc[_0x1f9db1]['id']&&_0x29ec3d[_0xf734('0x5b')](_0x1b1887[_0x133e46][_0xf734('0x67')])){_0x1f83fd[_0x29ec3d[_0x1b1887[_0x133e46]['questionId']]]=_0x1b1887[_0x133e46][_0xf734('0x69')];}}for(var _0x573f06 in _0x29ec3d){if(!_0x1f83fd[_0xf734('0x5b')](_0x29ec3d[_0x573f06])){_0x1f83fd[_0x29ec3d[_0x573f06]]=null;}}_0x3f1771[_0xf734('0x6a')](_0x1f83fd);}return _0x3f1771;}})[_0xf734('0x24')](function(_0x113136){if(!_['isEmpty'](_0x113136)){var _0xad6ca9=toCsv(_0x113136);var _0x2b0d64=Date[_0xf734('0x6b')]();fs['writeFileSync'](util[_0xf734('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x543e74[_0xf734('0x46')]['id'],_0x2b0d64),_0xad6ca9);_0x47ed84['setHeader'](_0xf734('0x6d'),_0xf734('0x6e')+util[_0xf734('0x6c')]('Jscripty_Project_%d_Summary_%s.csv',_0x543e74[_0xf734('0x46')]['id'],_0x2b0d64));_0x47ed84[_0xf734('0x6f')](_0xf734('0x70'),_0xf734('0x71'));return _0x47ed84['download'](util[_0xf734('0x6c')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x543e74[_0xf734('0x46')]['id'],_0x2b0d64));}else{return _0x47ed84[_0xf734('0x28')](0xcc);}})['catch'](handleError(_0x47ed84,null));}; \ No newline at end of file +var _0xf823=['lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','end','sendStatus','error','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','getSessions','findOne','JscriptySessionReport','ProjectId','rows','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','answer','isEmpty','now','writeFileSync','format','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x120283,_0x3fe3bf){var _0x37dfa3=function(_0x58ae25){while(--_0x58ae25){_0x120283['push'](_0x120283['shift']());}};_0x37dfa3(++_0x3fe3bf);}(_0xf823,0x1d2));var _0x3f82=function(_0x5c24e3,_0x995479){_0x5c24e3=_0x5c24e3-0x0;var _0x3322ee=_0xf823[_0x5c24e3];return _0x3322ee;};'use strict';var pdf=require(_0x3f82('0x0'));var emlformat=require(_0x3f82('0x1'));var rimraf=require(_0x3f82('0x2'));var zipdir=require(_0x3f82('0x3'));var jsonpatch=require(_0x3f82('0x4'));var rp=require(_0x3f82('0x5'));var moment=require(_0x3f82('0x6'));var BPromise=require(_0x3f82('0x7'));var Mustache=require(_0x3f82('0x8'));var util=require(_0x3f82('0x9'));var path=require(_0x3f82('0xa'));var sox=require(_0x3f82('0xb'));var csv=require(_0x3f82('0xc'));var ejs=require(_0x3f82('0xd'));var fs=require('fs');var _=require(_0x3f82('0xe'));var squel=require(_0x3f82('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3f82('0x10'));var toCsv=require(_0x3f82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3f82('0x11'));var authService=require(_0x3f82('0x12'));var qs=require(_0x3f82('0x13'));var as=require(_0x3f82('0x14'));var hardwareService=require(_0x3f82('0x15'));var logger=require(_0x3f82('0x16'))(_0x3f82('0x17'));var utils=require(_0x3f82('0x18'));var config=require('../../config/environment');var db=require(_0x3f82('0x19'))['db'];function respondWithStatusCode(_0xf10c21,_0x1732c7){_0x1732c7=_0x1732c7||0xcc;return function(_0x53a886){if(_0x53a886){return _0xf10c21['sendStatus'](_0x1732c7);}return _0xf10c21['status'](_0x1732c7)['end']();};}function respondWithResult(_0x42d6d3,_0x56e59a){_0x56e59a=_0x56e59a||0xc8;return function(_0x3da05d){if(_0x3da05d){return _0x42d6d3[_0x3f82('0x1a')](_0x56e59a)['json'](_0x3da05d);}};}function respondWithFilteredResult(_0x3fda48,_0x111f3e){return function(_0x3f42a0){if(_0x3f42a0){var _0x40e974=_0x3f42a0['count'],_0x25f2f6=_0x111f3e[_0x3f82('0x1b')],_0x1d7a39=_0x111f3e[_0x3f82('0x1b')]+_0x111f3e['limit'],_0x2c752d;if(_0x1d7a39>=_0x40e974){_0x1d7a39=_0x40e974;_0x2c752d=0xc8;}else{_0x2c752d=0xce;}_0x3fda48['status'](_0x2c752d);return _0x3fda48[_0x3f82('0x1c')](_0x3f82('0x1d'),_0x25f2f6+'-'+_0x1d7a39+'/'+_0x40e974)[_0x3f82('0x1e')](_0x3f42a0);}return null;};}function patchUpdates(_0x55a3d5){return function(_0x7f6c02){try{jsonpatch[_0x3f82('0x1f')](_0x7f6c02,_0x55a3d5,!![]);}catch(_0x36a74a){return BPromise[_0x3f82('0x20')](_0x36a74a);}return _0x7f6c02[_0x3f82('0x21')]();};}function saveUpdates(_0x5677b4,_0x2ea29b){return function(_0x541328){if(_0x541328){return _0x541328[_0x3f82('0x22')](_0x5677b4)[_0x3f82('0x23')](function(_0x86cc7c){return _0x86cc7c;});}return null;};}function removeEntity(_0xc00057,_0x28bfef){return function(_0x259185){if(_0x259185){return _0x259185[_0x3f82('0x24')]()['then'](function(){var _0x52ef55=_0x259185[_0x3f82('0x25')]({'plain':!![]});var _0x192eed=_0x3f82('0x26');return db[_0x3f82('0x27')][_0x3f82('0x24')]({'where':{'type':_0x192eed,'resourceId':_0x52ef55['id']}})[_0x3f82('0x23')](function(){return _0x259185;});})['then'](function(){_0xc00057[_0x3f82('0x1a')](0xcc)[_0x3f82('0x28')]();});}};}function handleEntityNotFound(_0x46734e,_0xbff944){return function(_0x3e5a79){if(!_0x3e5a79){_0x46734e[_0x3f82('0x29')](0x194);}return _0x3e5a79;};}function handleError(_0x38baa6,_0x529861){_0x529861=_0x529861||0x1f4;return function(_0x504a7d){logger[_0x3f82('0x2a')](_0x504a7d['stack']);if(_0x504a7d[_0x3f82('0x2b')]){delete _0x504a7d[_0x3f82('0x2b')];}_0x38baa6[_0x3f82('0x1a')](_0x529861)[_0x3f82('0x2c')](_0x504a7d);};}exports['index']=function(_0x29ac84,_0x39401c){var _0x265160={},_0x53d204={},_0xdf43db={'count':0x0,'rows':[]};var _0x2ffe48=_[_0x3f82('0x2d')](db[_0x3f82('0x2e')][_0x3f82('0x2f')],function(_0x9bb142){return{'name':_0x9bb142[_0x3f82('0x30')],'type':_0x9bb142[_0x3f82('0x31')][_0x3f82('0x32')]};});_0x53d204['model']=_[_0x3f82('0x2d')](_0x2ffe48,_0x3f82('0x2b'));_0x53d204['query']=_['keys'](_0x29ac84[_0x3f82('0x33')]);_0x53d204['filters']=_[_0x3f82('0x34')](_0x53d204['model'],_0x53d204['query']);_0x265160[_0x3f82('0x35')]=_['intersection'](_0x53d204[_0x3f82('0x36')],qs['fields'](_0x29ac84[_0x3f82('0x33')][_0x3f82('0x37')]));_0x265160[_0x3f82('0x35')]=_0x265160['attributes'][_0x3f82('0x38')]?_0x265160[_0x3f82('0x35')]:_0x53d204[_0x3f82('0x36')];if(!_0x29ac84[_0x3f82('0x33')][_0x3f82('0x39')](_0x3f82('0x3a'))){_0x265160[_0x3f82('0x3b')]=qs[_0x3f82('0x3b')](_0x29ac84[_0x3f82('0x33')][_0x3f82('0x3b')]);_0x265160['offset']=qs[_0x3f82('0x1b')](_0x29ac84[_0x3f82('0x33')][_0x3f82('0x1b')]);}_0x265160[_0x3f82('0x3c')]=qs[_0x3f82('0x3d')](_0x29ac84[_0x3f82('0x33')][_0x3f82('0x3d')]);_0x265160['where']=qs['filters'](_[_0x3f82('0x3e')](_0x29ac84[_0x3f82('0x33')],_0x53d204[_0x3f82('0x3f')]),_0x2ffe48);if(_0x29ac84[_0x3f82('0x33')]['filter']){_0x265160[_0x3f82('0x40')]=_[_0x3f82('0x41')](_0x265160[_0x3f82('0x40')],{'$or':_['map'](_0x2ffe48,function(_0x542555){if(_0x542555[_0x3f82('0x31')]!==_0x3f82('0x42')){var _0xd0f7ed={};_0xd0f7ed[_0x542555['name']]={'$like':'%'+_0x29ac84['query'][_0x3f82('0x43')]+'%'};return _0xd0f7ed;}})});}_0x265160=_[_0x3f82('0x41')]({},_0x265160,_0x29ac84[_0x3f82('0x44')]);var _0x34ad5b={'where':_0x265160['where']};return db[_0x3f82('0x2e')][_0x3f82('0x45')](_0x34ad5b)[_0x3f82('0x23')](function(_0x7a9ccd){_0xdf43db[_0x3f82('0x45')]=_0x7a9ccd;if(_0x29ac84[_0x3f82('0x33')][_0x3f82('0x46')]){_0x265160[_0x3f82('0x47')]=[{'all':!![]}];}return db[_0x3f82('0x2e')][_0x3f82('0x48')](_0x265160);})[_0x3f82('0x23')](function(_0x4bb6cc){_0xdf43db['rows']=_0x4bb6cc;return _0xdf43db;})[_0x3f82('0x23')](respondWithFilteredResult(_0x39401c,_0x265160))['catch'](handleError(_0x39401c,null));};exports['show']=function(_0x170e47,_0x587de7){var _0x2732c7={'raw':![],'where':{'id':_0x170e47[_0x3f82('0x49')]['id']}},_0x354241={};_0x354241['model']=_[_0x3f82('0x4a')](db['JscriptyProject'][_0x3f82('0x2f')]);_0x354241['query']=_[_0x3f82('0x4a')](_0x170e47[_0x3f82('0x33')]);_0x354241['filters']=_[_0x3f82('0x34')](_0x354241['model'],_0x354241['query']);_0x2732c7[_0x3f82('0x35')]=_[_0x3f82('0x34')](_0x354241[_0x3f82('0x36')],qs[_0x3f82('0x37')](_0x170e47['query'][_0x3f82('0x37')]));_0x2732c7[_0x3f82('0x35')]=_0x2732c7[_0x3f82('0x35')]['length']?_0x2732c7[_0x3f82('0x35')]:_0x354241[_0x3f82('0x36')];if(_0x170e47[_0x3f82('0x33')]['includeAll']){_0x2732c7['include']=[{'all':!![]}];}_0x2732c7=_[_0x3f82('0x41')]({},_0x2732c7,_0x170e47[_0x3f82('0x44')]);return db['JscriptyProject'][_0x3f82('0x4b')](_0x2732c7)['then'](handleEntityNotFound(_0x587de7,null))['then'](respondWithResult(_0x587de7,null))['catch'](handleError(_0x587de7,null));};exports['create']=function(_0x2b22c2,_0x1e4de1){return db[_0x3f82('0x2e')][_0x3f82('0x4c')](_0x2b22c2[_0x3f82('0x4d')],{})[_0x3f82('0x23')](function(_0x4ea230){var _0x23933f=_0x2b22c2[_0x3f82('0x4e')][_0x3f82('0x25')]({'plain':!![]});if(!_0x23933f)throw new Error(_0x3f82('0x4f'));if(_0x23933f[_0x3f82('0x50')]===_0x3f82('0x4e')){var _0x15814e=_0x4ea230[_0x3f82('0x25')]({'plain':!![]});var _0x433cda='Projects';return db[_0x3f82('0x51')][_0x3f82('0x4b')]({'where':{'name':_0x433cda,'userProfileId':_0x23933f['userProfileId']},'raw':!![]})[_0x3f82('0x23')](function(_0x47a475){if(_0x47a475&&_0x47a475[_0x3f82('0x52')]===0x0){return db[_0x3f82('0x27')][_0x3f82('0x4c')]({'name':_0x15814e[_0x3f82('0x2b')],'resourceId':_0x15814e['id'],'type':_0x47a475['name'],'sectionId':_0x47a475['id']},{})[_0x3f82('0x23')](function(){return _0x4ea230;});}else{return _0x4ea230;}})[_0x3f82('0x53')](function(_0x470ce1){logger[_0x3f82('0x2a')](_0x3f82('0x54'),_0x470ce1);throw _0x470ce1;});}return _0x4ea230;})[_0x3f82('0x23')](respondWithResult(_0x1e4de1,0xc9))[_0x3f82('0x53')](handleError(_0x1e4de1,null));};exports['clone']=function(_0x50c0b3,_0x2003fa){var _0x2ed813={'where':{'id':_0x50c0b3[_0x3f82('0x49')]['id']}},_0x13f29e={};_0x13f29e[_0x3f82('0x36')]=_[_0x3f82('0x4a')](db['JscriptyProject'][_0x3f82('0x2f')]);_0x2ed813[_0x3f82('0x35')]=_['intersection'](_0x13f29e['model'],qs[_0x3f82('0x37')](_0x50c0b3['query'][_0x3f82('0x37')]));_0x2ed813['attributes']=_0x2ed813['attributes'][_0x3f82('0x38')]?_0x2ed813['attributes']:_0x13f29e[_0x3f82('0x36')];if(_0x50c0b3[_0x3f82('0x33')][_0x3f82('0x46')]){_0x2ed813[_0x3f82('0x47')]=[{'all':!![]}];}_0x2ed813=_['merge']({},_0x2ed813,_0x50c0b3[_0x3f82('0x44')]);return db['JscriptyProject'][_0x3f82('0x4b')](_0x2ed813)['then'](handleEntityNotFound(_0x2003fa,null))[_0x3f82('0x23')](function(_0x2da582){if(_0x2da582){var _0x219e24=_0x2da582[_0x3f82('0x25')]({'plain':!![]});_0x219e24=qs[_0x3f82('0x55')](_0x219e24,['id','createdAt','updatedAt']);_0x50c0b3['body']=_[_0x3f82('0x55')](_0x50c0b3[_0x3f82('0x4d')],['id',_0x3f82('0x56'),_0x3f82('0x57')]);return db['JscriptyProject'][_0x3f82('0x4c')](_[_0x3f82('0x41')](_0x219e24,_0x50c0b3[_0x3f82('0x4d')]),{'include':_0x50c0b3[_0x3f82('0x33')][_0x3f82('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x44424a){var _0x10abad=_0x50c0b3[_0x3f82('0x4e')][_0x3f82('0x25')]({'plain':!![]});if(!_0x10abad)throw new Error(_0x3f82('0x4f'));if(_0x10abad['role']==='user'){var _0x5cdda3=_0x44424a[_0x3f82('0x25')]({'plain':!![]});var _0x5bfb20=_0x3f82('0x26');return db[_0x3f82('0x51')][_0x3f82('0x4b')]({'where':{'name':_0x5bfb20,'userProfileId':_0x10abad[_0x3f82('0x58')]},'raw':!![]})[_0x3f82('0x23')](function(_0x3821cf){if(_0x3821cf&&_0x3821cf[_0x3f82('0x52')]===0x0){return db[_0x3f82('0x27')]['create']({'name':_0x5cdda3[_0x3f82('0x2b')],'resourceId':_0x5cdda3['id'],'type':_0x3821cf[_0x3f82('0x2b')],'sectionId':_0x3821cf['id']},{})[_0x3f82('0x23')](function(){return _0x44424a;});}else{return _0x44424a;}})[_0x3f82('0x53')](function(_0x38c91a){logger[_0x3f82('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38c91a);throw _0x38c91a;});}return _0x44424a;});}})[_0x3f82('0x23')](respondWithResult(_0x2003fa,0xc9))[_0x3f82('0x53')](handleError(_0x2003fa,null));};exports[_0x3f82('0x22')]=function(_0x6cf6eb,_0x27ffe0){if(_0x6cf6eb['body']['id']){delete _0x6cf6eb['body']['id'];}return db[_0x3f82('0x2e')][_0x3f82('0x4b')]({'where':{'id':_0x6cf6eb[_0x3f82('0x49')]['id']}})['then'](handleEntityNotFound(_0x27ffe0,null))[_0x3f82('0x23')](saveUpdates(_0x6cf6eb[_0x3f82('0x4d')],null))['then'](respondWithResult(_0x27ffe0,null))['catch'](handleError(_0x27ffe0,null));};exports[_0x3f82('0x24')]=function(_0x31ee54,_0x453a82){return db['JscriptyProject']['find']({'where':{'id':_0x31ee54[_0x3f82('0x49')]['id']}})[_0x3f82('0x23')](handleEntityNotFound(_0x453a82,null))[_0x3f82('0x23')](removeEntity(_0x453a82,null))[_0x3f82('0x53')](handleError(_0x453a82,null));};exports[_0x3f82('0x59')]=function(_0x2387b3,_0x1e9074,_0x22550d){var _0x17db28={'raw':!![],'where':{}};var _0x5c6cc4={};var _0x269ed9={'count':0x0,'rows':[]};return db[_0x3f82('0x2e')][_0x3f82('0x5a')]({'where':{'id':_0x2387b3[_0x3f82('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e9074,null))[_0x3f82('0x23')](function(_0x48c3c8){if(_0x48c3c8){_0x5c6cc4[_0x3f82('0x36')]=_[_0x3f82('0x4a')](db[_0x3f82('0x5b')][_0x3f82('0x2f')]);_0x5c6cc4[_0x3f82('0x33')]=_[_0x3f82('0x4a')](_0x2387b3[_0x3f82('0x33')]);_0x5c6cc4[_0x3f82('0x3f')]=_[_0x3f82('0x34')](_0x5c6cc4[_0x3f82('0x36')],_0x5c6cc4['query']);_0x17db28[_0x3f82('0x35')]=_[_0x3f82('0x34')](_0x5c6cc4[_0x3f82('0x36')],qs[_0x3f82('0x37')](_0x2387b3['query']['fields']));_0x17db28[_0x3f82('0x35')]=_0x17db28['attributes'][_0x3f82('0x38')]?_0x17db28[_0x3f82('0x35')]:_0x5c6cc4[_0x3f82('0x36')];if(!_0x2387b3[_0x3f82('0x33')][_0x3f82('0x39')](_0x3f82('0x3a'))){_0x17db28['limit']=qs['limit'](_0x2387b3[_0x3f82('0x33')][_0x3f82('0x3b')]);_0x17db28['offset']=qs[_0x3f82('0x1b')](_0x2387b3[_0x3f82('0x33')][_0x3f82('0x1b')]);}_0x17db28[_0x3f82('0x3c')]=qs[_0x3f82('0x3d')](_0x2387b3[_0x3f82('0x33')]['sort']);_0x17db28[_0x3f82('0x40')]=qs[_0x3f82('0x3f')](_['pick'](_0x2387b3[_0x3f82('0x33')],_0x5c6cc4[_0x3f82('0x3f')]));_0x17db28[_0x3f82('0x40')][_0x3f82('0x5c')]=_0x48c3c8['id'];if(_0x2387b3[_0x3f82('0x33')][_0x3f82('0x43')]){_0x17db28['where']=_[_0x3f82('0x41')](_0x17db28['where'],{'$or':_[_0x3f82('0x2d')](_0x17db28['attributes'],function(_0x10b16b){var _0x3d2fbf={};_0x3d2fbf[_0x10b16b]={'$like':'%'+_0x2387b3[_0x3f82('0x33')][_0x3f82('0x43')]+'%'};return _0x3d2fbf;})});}_0x17db28=_[_0x3f82('0x41')]({},_0x17db28,_0x2387b3[_0x3f82('0x44')]);return db[_0x3f82('0x5b')]['count']({'where':_0x17db28[_0x3f82('0x40')]})['then'](function(_0x3ccc61){_0x269ed9['count']=_0x3ccc61;if(_0x2387b3['query'][_0x3f82('0x46')]){_0x17db28[_0x3f82('0x47')]=[{'all':!![]}];}return db[_0x3f82('0x5b')][_0x3f82('0x48')](_0x17db28);})[_0x3f82('0x23')](function(_0x2f9fb4){_0x269ed9[_0x3f82('0x5d')]=_0x2f9fb4;return _0x269ed9;});}})['then'](respondWithFilteredResult(_0x1e9074,_0x17db28))[_0x3f82('0x53')](handleError(_0x1e9074,null));};exports['getAnswers']=function(_0x23dbd9,_0x3b9af5,_0x1b268a){var _0x23453b={'raw':!![],'where':{}};var _0x5c753b={};var _0x585db={'count':0x0,'rows':[]};return db[_0x3f82('0x2e')]['findOne']({'where':{'id':_0x23dbd9[_0x3f82('0x49')]['id']}})['then'](handleEntityNotFound(_0x3b9af5,null))['then'](function(_0x475cc9){if(_0x475cc9){_0x5c753b['model']=_['keys'](db[_0x3f82('0x5e')][_0x3f82('0x2f')]);_0x5c753b[_0x3f82('0x33')]=_[_0x3f82('0x4a')](_0x23dbd9[_0x3f82('0x33')]);_0x5c753b['filters']=_[_0x3f82('0x34')](_0x5c753b[_0x3f82('0x36')],_0x5c753b[_0x3f82('0x33')]);_0x23453b['attributes']=_[_0x3f82('0x34')](_0x5c753b[_0x3f82('0x36')],qs['fields'](_0x23dbd9[_0x3f82('0x33')][_0x3f82('0x37')]));_0x23453b[_0x3f82('0x35')]=_0x23453b['attributes']['length']?_0x23453b['attributes']:_0x5c753b[_0x3f82('0x36')];if(!_0x23dbd9[_0x3f82('0x33')]['hasOwnProperty'](_0x3f82('0x3a'))){_0x23453b['limit']=qs[_0x3f82('0x3b')](_0x23dbd9[_0x3f82('0x33')][_0x3f82('0x3b')]);_0x23453b[_0x3f82('0x1b')]=qs[_0x3f82('0x1b')](_0x23dbd9[_0x3f82('0x33')][_0x3f82('0x1b')]);}_0x23453b[_0x3f82('0x3c')]=qs[_0x3f82('0x3d')](_0x23dbd9[_0x3f82('0x33')][_0x3f82('0x3d')]);_0x23453b[_0x3f82('0x40')]=qs[_0x3f82('0x3f')](_['pick'](_0x23dbd9[_0x3f82('0x33')],_0x5c753b[_0x3f82('0x3f')]));_0x23453b[_0x3f82('0x40')][_0x3f82('0x5c')]=_0x475cc9['id'];if(_0x23dbd9[_0x3f82('0x33')]['filter']){_0x23453b[_0x3f82('0x40')]=_[_0x3f82('0x41')](_0x23453b['where'],{'$or':_[_0x3f82('0x2d')](_0x23453b['attributes'],function(_0x3e8241){var _0x591faf={};_0x591faf[_0x3e8241]={'$like':'%'+_0x23dbd9[_0x3f82('0x33')]['filter']+'%'};return _0x591faf;})});}_0x23453b=_[_0x3f82('0x41')]({},_0x23453b,_0x23dbd9[_0x3f82('0x44')]);return db['JscriptyAnswerReport'][_0x3f82('0x45')]({'where':_0x23453b['where']})['then'](function(_0x5413e8){_0x585db[_0x3f82('0x45')]=_0x5413e8;if(_0x23dbd9[_0x3f82('0x33')]['includeAll']){_0x23453b[_0x3f82('0x47')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x3f82('0x48')](_0x23453b);})['then'](function(_0x54a8de){_0x585db[_0x3f82('0x5d')]=_0x54a8de;return _0x585db;});}})[_0x3f82('0x23')](respondWithFilteredResult(_0x3b9af5,_0x23453b))['catch'](handleError(_0x3b9af5,null));};function char(_0x2a53b8){return _0x3f82('0x5f')===typeof _0x2a53b8?String[_0x3f82('0x60')][_0x3f82('0x1f')](null,arguments):_0x2a53b8;}function needsEncapsulation(_0x17c76d){return!!_0x17c76d&&(_0x17c76d['toString']()[_0x3f82('0x61')](char(0xd))>=0x0||_0x17c76d[_0x3f82('0x62')]()['indexOf'](char(0xa))>=0x0||_0x17c76d[_0x3f82('0x62')]()[_0x3f82('0x61')](char(0x2c))>=0x0||_0x17c76d['toString']()[_0x3f82('0x61')](char(0x22))>=0x0);}function encapsulate(_0xd57c4a){var _0x5c54e0=char(0x22),_0x41794d='\x5c'+char(0x22),_0x45a5dc=_0xd57c4a[_0x3f82('0x62')]()[_0x3f82('0x63')](new RegExp(_0x5c54e0,'g'),_0x41794d);return _0x5c54e0+_0x45a5dc+_0x5c54e0;}exports[_0x3f82('0x64')]=function(_0x34a9f2,_0x42a46d,_0x30c37a){var _0x1663de,_0x2d87d1;var _0x1ad01e={'where':{'ProjectId':_0x34a9f2[_0x3f82('0x49')]['id']}};if(_0x34a9f2[_0x3f82('0x33')][_0x3f82('0x65')]){_0x1ad01e['where'][_0x3f82('0x66')]=JSON[_0x3f82('0x67')](_0x34a9f2['query'][_0x3f82('0x65')]);}return db[_0x3f82('0x5b')][_0x3f82('0x48')](_0x1ad01e)[_0x3f82('0x23')](handleEntityNotFound(_0x42a46d,null))['then'](function(_0x83f5bf){if(_0x83f5bf){_0x1663de=_0x83f5bf;return db[_0x3f82('0x68')][_0x3f82('0x48')]({'where':{'SessionId':{'$in':_[_0x3f82('0x2d')](_0x1663de,'id')},'ProjectId':_0x34a9f2[_0x3f82('0x49')]['id']},'order':_0x3f82('0x69')});}})[_0x3f82('0x23')](handleEntityNotFound(_0x42a46d,null))['then'](function(_0x501419){if(_0x501419){_0x2d87d1=_0x501419;var _0x2f645b={};for(var _0x100c61=0x0,_0x39436a=_0x2d87d1[_0x3f82('0x38')];_0x100c61<_0x39436a;_0x100c61++){if(!_0x2f645b[_0x3f82('0x39')](_0x2d87d1[_0x100c61]['questionId'])){_0x2f645b[_0x2d87d1[_0x100c61][_0x3f82('0x6a')]]=needsEncapsulation(_0x2d87d1[_0x100c61][_0x3f82('0x6b')])?encapsulate(_0x2d87d1[_0x100c61][_0x3f82('0x6b')]):_0x2d87d1[_0x100c61]['question'];}}var _0x4200f8=[],_0x3916db={};for(var _0x43bea9=0x0,_0xb8ba27=_0x1663de[_0x3f82('0x38')];_0x43bea9<_0xb8ba27;_0x43bea9++){_0x3916db={'ProjectId':_0x34a9f2[_0x3f82('0x49')]['id'],'SessionId':_0x1663de[_0x43bea9]['id'],'StartTime':moment(_0x1663de[_0x43bea9][_0x3f82('0x66')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x32cd24=0x0,_0x2aaccc=_0x2d87d1[_0x3f82('0x38')];_0x32cd24<_0x2aaccc;_0x32cd24++){if(_0x2d87d1[_0x32cd24]['SessionId']==_0x1663de[_0x43bea9]['id']&&_0x2f645b[_0x3f82('0x39')](_0x2d87d1[_0x32cd24][_0x3f82('0x6a')])){_0x3916db[_0x2f645b[_0x2d87d1[_0x32cd24][_0x3f82('0x6a')]]]=_0x2d87d1[_0x32cd24][_0x3f82('0x6c')];}}for(var _0x1d928d in _0x2f645b){if(!_0x3916db[_0x3f82('0x39')](_0x2f645b[_0x1d928d])){_0x3916db[_0x2f645b[_0x1d928d]]=null;}}_0x4200f8['push'](_0x3916db);}return _0x4200f8;}})[_0x3f82('0x23')](function(_0x26dd46){if(!_[_0x3f82('0x6d')](_0x26dd46)){var _0x3f46e0=toCsv(_0x26dd46);var _0x435c79=Date[_0x3f82('0x6e')]();fs[_0x3f82('0x6f')](util[_0x3f82('0x70')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x34a9f2[_0x3f82('0x49')]['id'],_0x435c79),_0x3f46e0);_0x42a46d['setHeader'](_0x3f82('0x71'),_0x3f82('0x72')+util[_0x3f82('0x70')](_0x3f82('0x73'),_0x34a9f2[_0x3f82('0x49')]['id'],_0x435c79));_0x42a46d['setHeader'](_0x3f82('0x74'),_0x3f82('0x75'));return _0x42a46d[_0x3f82('0x76')](util[_0x3f82('0x70')](_0x3f82('0x77'),_0x34a9f2[_0x3f82('0x49')]['id'],_0x435c79));}else{return _0x42a46d['sendStatus'](0xcc);}})[_0x3f82('0x53')](handleError(_0x42a46d,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 27fcd21..7b99afb 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 _0x0503=['rimraf','./jscriptyProject.attributes','define','JscriptyProject','lodash','util','../../config/logger','bluebird','path'];(function(_0x3555be,_0x3a2519){var _0x15d3e2=function(_0x515799){while(--_0x515799){_0x3555be['push'](_0x3555be['shift']());}};_0x15d3e2(++_0x3a2519);}(_0x0503,0x199));var _0x3050=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x0503[_0x3fba9f];return _0x192cf1;};'use strict';var _=require(_0x3050('0x0'));var util=require(_0x3050('0x1'));var logger=require(_0x3050('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3050('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3050('0x4'));var rimraf=require(_0x3050('0x5'));var config=require('../../config/environment');var attributes=require(_0x3050('0x6'));module['exports']=function(_0x4f3264,_0x164cdb){return _0x4f3264[_0x3050('0x7')](_0x3050('0x8'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc782=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','lodash','util'];(function(_0x1ad9bb,_0x2d48e5){var _0xeaafc5=function(_0x4e4795){while(--_0x4e4795){_0x1ad9bb['push'](_0x1ad9bb['shift']());}};_0xeaafc5(++_0x2d48e5);}(_0xc782,0x1b8));var _0x2c78=function(_0x2ffee8,_0x126cdd){_0x2ffee8=_0x2ffee8-0x0;var _0x432ebf=_0xc782[_0x2ffee8];return _0x432ebf;};'use strict';var _=require(_0x2c78('0x0'));var util=require(_0x2c78('0x1'));var logger=require(_0x2c78('0x2'))('api');var moment=require(_0x2c78('0x3'));var BPromise=require(_0x2c78('0x4'));var rp=require(_0x2c78('0x5'));var fs=require('fs');var path=require(_0x2c78('0x6'));var rimraf=require(_0x2c78('0x7'));var config=require(_0x2c78('0x8'));var attributes=require(_0x2c78('0x9'));module[_0x2c78('0xa')]=function(_0x452ca9,_0x1df55f){return _0x452ca9[_0x2c78('0xb')](_0x2c78('0xc'),attributes,{'tableName':'jscripty_projects','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 281152e..379ee5f 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 _0x2194=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x3888a5,_0x1e6cdc){var _0x4d555c=function(_0x15ac61){while(--_0x15ac61){_0x3888a5['push'](_0x3888a5['shift']());}};_0x4d555c(++_0x1e6cdc);}(_0x2194,0xf8));var _0x4219=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x2194[_0x99ff94];return _0x1b5bc0;};'use strict';var _=require(_0x4219('0x0'));var util=require(_0x4219('0x1'));var moment=require(_0x4219('0x2'));var BPromise=require(_0x4219('0x3'));var rs=require(_0x4219('0x4'));var fs=require('fs');var Redis=require(_0x4219('0x5'));var db=require(_0x4219('0x6'))['db'];var utils=require(_0x4219('0x7'));var logger=require(_0x4219('0x8'))(_0x4219('0x9'));var config=require(_0x4219('0xa'));var jayson=require(_0x4219('0xb'));var client=jayson[_0x4219('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2589e8,_0x521447,_0x1484ea){return new BPromise(function(_0xf96c21,_0x5ea06d){return client[_0x4219('0xd')](_0x2589e8,_0x1484ea)[_0x4219('0xe')](function(_0x3cbd00){logger[_0x4219('0xf')](_0x4219('0x10'),_0x521447,_0x4219('0x11'));logger['debug'](_0x4219('0x12'),_0x521447,_0x4219('0x11'),JSON[_0x4219('0x13')](_0x3cbd00));if(_0x3cbd00[_0x4219('0x14')]){if(_0x3cbd00[_0x4219('0x14')]['code']===0x1f4){logger[_0x4219('0x14')](_0x4219('0x10'),_0x521447,_0x3cbd00[_0x4219('0x14')][_0x4219('0x15')]);return _0x5ea06d(_0x3cbd00[_0x4219('0x14')][_0x4219('0x15')]);}logger[_0x4219('0x14')](_0x4219('0x10'),_0x521447,_0x3cbd00[_0x4219('0x14')][_0x4219('0x15')]);return _0xf96c21(_0x3cbd00['error']['message']);}else{logger[_0x4219('0xf')](_0x4219('0x10'),_0x521447,_0x4219('0x11'));_0xf96c21(_0x3cbd00[_0x4219('0x16')][_0x4219('0x15')]);}})['catch'](function(_0x346afc){logger[_0x4219('0x14')](_0x4219('0x10'),_0x521447,_0x346afc);_0x5ea06d(_0x346afc);});});} \ No newline at end of file +var _0x5c63=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3754bc,_0x137190){var _0x267b22=function(_0xe606){while(--_0xe606){_0x3754bc['push'](_0x3754bc['shift']());}};_0x267b22(++_0x137190);}(_0x5c63,0x193));var _0x35c6=function(_0x441fb1,_0x32a8f2){_0x441fb1=_0x441fb1-0x0;var _0x546d27=_0x5c63[_0x441fb1];return _0x546d27;};'use strict';var _=require('lodash');var util=require(_0x35c6('0x0'));var moment=require(_0x35c6('0x1'));var BPromise=require(_0x35c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35c6('0x3'));var db=require(_0x35c6('0x4'))['db'];var utils=require(_0x35c6('0x5'));var logger=require(_0x35c6('0x6'))(_0x35c6('0x7'));var config=require('../../config/environment');var jayson=require(_0x35c6('0x8'));var client=jayson[_0x35c6('0x9')][_0x35c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb22699,_0x25f420,_0x4e5162){return new BPromise(function(_0x488ee5,_0x5acd66){return client[_0x35c6('0xb')](_0xb22699,_0x4e5162)[_0x35c6('0xc')](function(_0x50c37d){logger['info'](_0x35c6('0xd'),_0x25f420,_0x35c6('0xe'));logger[_0x35c6('0xf')](_0x35c6('0x10'),_0x25f420,'request\x20sent',JSON[_0x35c6('0x11')](_0x50c37d));if(_0x50c37d[_0x35c6('0x12')]){if(_0x50c37d[_0x35c6('0x12')][_0x35c6('0x13')]===0x1f4){logger[_0x35c6('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x25f420,_0x50c37d[_0x35c6('0x12')]['message']);return _0x5acd66(_0x50c37d[_0x35c6('0x12')]['message']);}logger[_0x35c6('0x12')](_0x35c6('0xd'),_0x25f420,_0x50c37d[_0x35c6('0x12')][_0x35c6('0x14')]);return _0x488ee5(_0x50c37d[_0x35c6('0x12')]['message']);}else{logger[_0x35c6('0x15')](_0x35c6('0xd'),_0x25f420,_0x35c6('0xe'));_0x488ee5(_0x50c37d[_0x35c6('0x16')][_0x35c6('0x14')]);}})[_0x35c6('0x17')](function(_0x2e0a66){logger[_0x35c6('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x25f420,_0x2e0a66);_0x5acd66(_0x2e0a66);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index ef8ed6d..af268a3 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 _0xc377=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./jscriptyQuestionReport.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0xc377,0x1a3));var _0x7c37=function(_0x3e765e,_0x420cba){_0x3e765e=_0x3e765e-0x0;var _0x63c53f=_0xc377[_0x3e765e];return _0x63c53f;};'use strict';var multer=require(_0x7c37('0x0'));var util=require(_0x7c37('0x1'));var path=require(_0x7c37('0x2'));var timeout=require(_0x7c37('0x3'));var express=require(_0x7c37('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7c37('0x5'));var config=require('../../config/environment');var controller=require(_0x7c37('0x6'));router[_0x7c37('0x7')]('/',auth[_0x7c37('0x8')](),controller['index']);router['get']('/describe',auth[_0x7c37('0x8')](),controller[_0x7c37('0x9')]);router[_0x7c37('0x7')](_0x7c37('0xa'),auth[_0x7c37('0x8')](),controller[_0x7c37('0xb')]);router[_0x7c37('0xc')]('/',auth[_0x7c37('0x8')](),controller['create']);router[_0x7c37('0xd')](_0x7c37('0xa'),auth[_0x7c37('0x8')](),controller[_0x7c37('0xe')]);router[_0x7c37('0xf')](_0x7c37('0xa'),auth['isAuthenticated'](),controller[_0x7c37('0x10')]);module[_0x7c37('0x11')]=router; \ No newline at end of file +var _0x58cd=['post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x58cd,0x65));var _0xd58c=function(_0x531950,_0x3fb113){_0x531950=_0x531950-0x0;var _0x4dcd0e=_0x58cd[_0x531950];return _0x4dcd0e;};'use strict';var multer=require(_0xd58c('0x0'));var util=require(_0xd58c('0x1'));var path=require(_0xd58c('0x2'));var timeout=require(_0xd58c('0x3'));var express=require(_0xd58c('0x4'));var router=express['Router']();var auth=require(_0xd58c('0x5'));var interaction=require(_0xd58c('0x6'));var config=require(_0xd58c('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0xd58c('0x8')]('/',auth[_0xd58c('0x9')](),controller['index']);router[_0xd58c('0x8')](_0xd58c('0xa'),auth[_0xd58c('0x9')](),controller[_0xd58c('0xb')]);router[_0xd58c('0x8')]('/:id',auth[_0xd58c('0x9')](),controller[_0xd58c('0xc')]);router[_0xd58c('0xd')]('/',auth[_0xd58c('0x9')](),controller[_0xd58c('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd58c('0xf')]);router[_0xd58c('0x10')]('/:id',auth[_0xd58c('0x9')](),controller[_0xd58c('0x11')]);module[_0xd58c('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 7a94d26..453932c 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 _0xf0ad=['long','sequelize','exports','STRING','TEXT'];(function(_0x305423,_0x52c651){var _0x178b9a=function(_0x34d785){while(--_0x34d785){_0x305423['push'](_0x305423['shift']());}};_0x178b9a(++_0x52c651);}(_0xf0ad,0x1a5));var _0xdf0a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xf0ad[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require(_0xdf0a('0x0'));module[_0xdf0a('0x1')]={'question':{'type':Sequelize[_0xdf0a('0x2')]},'answer':{'type':Sequelize[_0xdf0a('0x3')](_0xdf0a('0x4'))},'membername':{'type':Sequelize[_0xdf0a('0x2')]},'projectname':{'type':Sequelize[_0xdf0a('0x2')]},'queue':{'type':Sequelize[_0xdf0a('0x2')]},'uniqueid':{'type':Sequelize[_0xdf0a('0x2')]},'calleridname':{'type':Sequelize[_0xdf0a('0x2')]},'calleridnum':{'type':Sequelize[_0xdf0a('0x2')]},'questionId':{'type':Sequelize[_0xdf0a('0x2')]}}; \ No newline at end of file +var _0x8016=['TEXT','long','sequelize','STRING'];(function(_0x72dc16,_0x4fac58){var _0x141488=function(_0x3eed38){while(--_0x3eed38){_0x72dc16['push'](_0x72dc16['shift']());}};_0x141488(++_0x4fac58);}(_0x8016,0x1e2));var _0x6801=function(_0x45ffc0,_0x4f090b){_0x45ffc0=_0x45ffc0-0x0;var _0x1f0074=_0x8016[_0x45ffc0];return _0x1f0074;};'use strict';var Sequelize=require(_0x6801('0x0'));module['exports']={'question':{'type':Sequelize[_0x6801('0x1')]},'answer':{'type':Sequelize[_0x6801('0x2')](_0x6801('0x3'))},'membername':{'type':Sequelize[_0x6801('0x1')]},'projectname':{'type':Sequelize[_0x6801('0x1')]},'queue':{'type':Sequelize[_0x6801('0x1')]},'uniqueid':{'type':Sequelize[_0x6801('0x1')]},'calleridname':{'type':Sequelize[_0x6801('0x1')]},'calleridnum':{'type':Sequelize[_0x6801('0x1')]},'questionId':{'type':Sequelize[_0x6801('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 51f3e66..980ae04 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 _0xe54b=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','find','create','body','update','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0xe54b,0x1a4));var _0xbe54=function(_0x55c15c,_0x3633e6){_0x55c15c=_0x55c15c-0x0;var _0x5323ad=_0xe54b[_0x55c15c];return _0x5323ad;};'use strict';var pdf=require(_0xbe54('0x0'));var emlformat=require(_0xbe54('0x1'));var rimraf=require(_0xbe54('0x2'));var zipdir=require(_0xbe54('0x3'));var jsonpatch=require(_0xbe54('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbe54('0x5'));var util=require(_0xbe54('0x6'));var path=require(_0xbe54('0x7'));var sox=require(_0xbe54('0x8'));var csv=require(_0xbe54('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xbe54('0xa'));var crypto=require(_0xbe54('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbe54('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe54('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe54('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbe54('0xf'));var hardwareService=require(_0xbe54('0x10'));var logger=require(_0xbe54('0x11'))(_0xbe54('0x12'));var utils=require(_0xbe54('0x13'));var config=require(_0xbe54('0x14'));var db=require(_0xbe54('0x15'))['db'];function respondWithStatusCode(_0x81b01c,_0x59be5e){_0x59be5e=_0x59be5e||0xcc;return function(_0x295c90){if(_0x295c90){return _0x81b01c[_0xbe54('0x16')](_0x59be5e);}return _0x81b01c[_0xbe54('0x17')](_0x59be5e)[_0xbe54('0x18')]();};}function respondWithResult(_0x276aee,_0x47b43c){_0x47b43c=_0x47b43c||0xc8;return function(_0x2eeeb2){if(_0x2eeeb2){return _0x276aee[_0xbe54('0x17')](_0x47b43c)[_0xbe54('0x19')](_0x2eeeb2);}};}function respondWithFilteredResult(_0x409c8a,_0x5b7bc6){return function(_0x291047){if(_0x291047){var _0x31c2f3=_0x291047['count'],_0x59f6ed=_0x5b7bc6[_0xbe54('0x1a')],_0x4fa54d=_0x5b7bc6[_0xbe54('0x1a')]+_0x5b7bc6[_0xbe54('0x1b')],_0x4483f1;if(_0x4fa54d>=_0x31c2f3){_0x4fa54d=_0x31c2f3;_0x4483f1=0xc8;}else{_0x4483f1=0xce;}_0x409c8a['status'](_0x4483f1);return _0x409c8a[_0xbe54('0x1c')](_0xbe54('0x1d'),_0x59f6ed+'-'+_0x4fa54d+'/'+_0x31c2f3)[_0xbe54('0x19')](_0x291047);}return null;};}function patchUpdates(_0x5dc32f){return function(_0xbfe467){try{jsonpatch['apply'](_0xbfe467,_0x5dc32f,!![]);}catch(_0x4025a7){return BPromise[_0xbe54('0x1e')](_0x4025a7);}return _0xbfe467[_0xbe54('0x1f')]();};}function saveUpdates(_0x1cf2c1,_0x5aa951){return function(_0x2c3ed4){if(_0x2c3ed4){return _0x2c3ed4['update'](_0x1cf2c1)[_0xbe54('0x20')](function(_0x41fd19){return _0x41fd19;});}return null;};}function removeEntity(_0x99341b,_0x397879){return function(_0x18c3de){if(_0x18c3de){return _0x18c3de[_0xbe54('0x21')]()['then'](function(){_0x99341b[_0xbe54('0x17')](0xcc)[_0xbe54('0x18')]();});}};}function handleEntityNotFound(_0x30e5b0,_0xda0c1b){return function(_0x397cba){if(!_0x397cba){_0x30e5b0[_0xbe54('0x16')](0x194);}return _0x397cba;};}function handleError(_0x4a17c5,_0x5d1402){_0x5d1402=_0x5d1402||0x1f4;return function(_0x17f629){logger[_0xbe54('0x22')](_0x17f629[_0xbe54('0x23')]);if(_0x17f629[_0xbe54('0x24')]){delete _0x17f629[_0xbe54('0x24')];}_0x4a17c5[_0xbe54('0x17')](_0x5d1402)[_0xbe54('0x25')](_0x17f629);};}exports['index']=function(_0x3bd611,_0x5c9adc){var _0x5281f4={},_0x5bcada={},_0x3971ce={'count':0x0,'rows':[]};var _0x228a27=_[_0xbe54('0x26')](db[_0xbe54('0x27')][_0xbe54('0x28')],function(_0x1fe3ae){return{'name':_0x1fe3ae['fieldName'],'type':_0x1fe3ae[_0xbe54('0x29')][_0xbe54('0x2a')]};});_0x5bcada['model']=_[_0xbe54('0x26')](_0x228a27,_0xbe54('0x24'));_0x5bcada[_0xbe54('0x2b')]=_[_0xbe54('0x2c')](_0x3bd611[_0xbe54('0x2b')]);_0x5bcada[_0xbe54('0x2d')]=_[_0xbe54('0x2e')](_0x5bcada['model'],_0x5bcada[_0xbe54('0x2b')]);_0x5281f4[_0xbe54('0x2f')]=_[_0xbe54('0x2e')](_0x5bcada['model'],qs[_0xbe54('0x30')](_0x3bd611[_0xbe54('0x2b')][_0xbe54('0x30')]));_0x5281f4[_0xbe54('0x2f')]=_0x5281f4['attributes'][_0xbe54('0x31')]?_0x5281f4[_0xbe54('0x2f')]:_0x5bcada[_0xbe54('0x32')];if(!_0x3bd611[_0xbe54('0x2b')][_0xbe54('0x33')](_0xbe54('0x34'))){_0x5281f4[_0xbe54('0x1b')]=qs['limit'](_0x3bd611['query']['limit']);_0x5281f4['offset']=qs[_0xbe54('0x1a')](_0x3bd611['query'][_0xbe54('0x1a')]);}_0x5281f4[_0xbe54('0x35')]=qs[_0xbe54('0x36')](_0x3bd611[_0xbe54('0x2b')]['sort']);_0x5281f4['where']=qs[_0xbe54('0x2d')](_[_0xbe54('0x37')](_0x3bd611[_0xbe54('0x2b')],_0x5bcada[_0xbe54('0x2d')]),_0x228a27);if(_0x3bd611[_0xbe54('0x2b')]['filter']){_0x5281f4[_0xbe54('0x38')]=_[_0xbe54('0x39')](_0x5281f4[_0xbe54('0x38')],{'$or':_['map'](_0x228a27,function(_0x4e97ca){if(_0x4e97ca[_0xbe54('0x29')]!==_0xbe54('0x3a')){var _0x250b7c={};_0x250b7c[_0x4e97ca['name']]={'$like':'%'+_0x3bd611[_0xbe54('0x2b')][_0xbe54('0x3b')]+'%'};return _0x250b7c;}})});}_0x5281f4=_[_0xbe54('0x39')]({},_0x5281f4,_0x3bd611[_0xbe54('0x3c')]);var _0x2f231e={'where':_0x5281f4['where']};return db[_0xbe54('0x27')][_0xbe54('0x3d')](_0x2f231e)[_0xbe54('0x20')](function(_0x421911){_0x3971ce['count']=_0x421911;if(_0x3bd611[_0xbe54('0x2b')][_0xbe54('0x3e')]){_0x5281f4[_0xbe54('0x3f')]=[{'all':!![]}];}return db[_0xbe54('0x27')][_0xbe54('0x40')](_0x5281f4);})[_0xbe54('0x20')](function(_0x33f277){_0x3971ce[_0xbe54('0x41')]=_0x33f277;return _0x3971ce;})['then'](respondWithFilteredResult(_0x5c9adc,_0x5281f4))['catch'](handleError(_0x5c9adc,null));};exports[_0xbe54('0x42')]=function(_0x37e3d2,_0x1c82aa){var _0x1bf92d={'raw':!![],'where':{'id':_0x37e3d2[_0xbe54('0x43')]['id']}},_0x4f4460={};_0x4f4460[_0xbe54('0x32')]=_[_0xbe54('0x2c')](db[_0xbe54('0x27')][_0xbe54('0x28')]);_0x4f4460[_0xbe54('0x2b')]=_['keys'](_0x37e3d2[_0xbe54('0x2b')]);_0x4f4460[_0xbe54('0x2d')]=_[_0xbe54('0x2e')](_0x4f4460[_0xbe54('0x32')],_0x4f4460[_0xbe54('0x2b')]);_0x1bf92d[_0xbe54('0x2f')]=_['intersection'](_0x4f4460[_0xbe54('0x32')],qs[_0xbe54('0x30')](_0x37e3d2[_0xbe54('0x2b')][_0xbe54('0x30')]));_0x1bf92d['attributes']=_0x1bf92d[_0xbe54('0x2f')]['length']?_0x1bf92d[_0xbe54('0x2f')]:_0x4f4460[_0xbe54('0x32')];if(_0x37e3d2[_0xbe54('0x2b')][_0xbe54('0x3e')]){_0x1bf92d[_0xbe54('0x3f')]=[{'all':!![]}];}_0x1bf92d=_[_0xbe54('0x39')]({},_0x1bf92d,_0x37e3d2[_0xbe54('0x3c')]);return db[_0xbe54('0x27')][_0xbe54('0x44')](_0x1bf92d)['then'](handleEntityNotFound(_0x1c82aa,null))[_0xbe54('0x20')](respondWithResult(_0x1c82aa,null))['catch'](handleError(_0x1c82aa,null));};exports[_0xbe54('0x45')]=function(_0x4744f6,_0x59b1c2){return db[_0xbe54('0x27')]['create'](_0x4744f6[_0xbe54('0x46')],{})[_0xbe54('0x20')](respondWithResult(_0x59b1c2,0xc9))['catch'](handleError(_0x59b1c2,null));};exports[_0xbe54('0x47')]=function(_0x2061c2,_0x5069c3){if(_0x2061c2[_0xbe54('0x46')]['id']){delete _0x2061c2['body']['id'];}return db[_0xbe54('0x27')][_0xbe54('0x44')]({'where':{'id':_0x2061c2[_0xbe54('0x43')]['id']}})['then'](handleEntityNotFound(_0x5069c3,null))[_0xbe54('0x20')](saveUpdates(_0x2061c2['body'],null))[_0xbe54('0x20')](respondWithResult(_0x5069c3,null))[_0xbe54('0x48')](handleError(_0x5069c3,null));};exports[_0xbe54('0x21')]=function(_0x264342,_0x2bc0a5){return db[_0xbe54('0x27')][_0xbe54('0x44')]({'where':{'id':_0x264342['params']['id']}})['then'](handleEntityNotFound(_0x2bc0a5,null))[_0xbe54('0x20')](removeEntity(_0x2bc0a5,null))[_0xbe54('0x48')](handleError(_0x2bc0a5,null));};exports['describe']=function(_0x9b6f2b,_0x561c40){return db[_0xbe54('0x27')]['describe']()[_0xbe54('0x20')](respondWithResult(_0x561c40,null))['catch'](handleError(_0x561c40,null));}; \ No newline at end of file +var _0x83c4=['create','body','describe','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','JscriptyQuestionReport','includeAll','include','findAll','catch','show','params','keys','find'];(function(_0x35ef79,_0x19108e){var _0x339341=function(_0x505bd0){while(--_0x505bd0){_0x35ef79['push'](_0x35ef79['shift']());}};_0x339341(++_0x19108e);}(_0x83c4,0x11f));var _0x483c=function(_0x5bf542,_0x50999){_0x5bf542=_0x5bf542-0x0;var _0x201bf5=_0x83c4[_0x5bf542];return _0x201bf5;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x483c('0x0'));var jsonpatch=require(_0x483c('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x483c('0x2'));var Mustache=require(_0x483c('0x3'));var util=require(_0x483c('0x4'));var path=require(_0x483c('0x5'));var sox=require('sox');var csv=require(_0x483c('0x6'));var ejs=require(_0x483c('0x7'));var fs=require('fs');var _=require(_0x483c('0x8'));var squel=require(_0x483c('0x9'));var crypto=require('crypto');var jsforce=require(_0x483c('0xa'));var deskjs=require(_0x483c('0xb'));var toCsv=require(_0x483c('0x6'));var querystring=require(_0x483c('0xc'));var Papa=require(_0x483c('0xd'));var Redis=require(_0x483c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x483c('0xf'));var hardwareService=require(_0x483c('0x10'));var logger=require('../../config/logger')(_0x483c('0x11'));var utils=require('../../config/utils');var config=require(_0x483c('0x12'));var db=require(_0x483c('0x13'))['db'];function respondWithStatusCode(_0x170dd0,_0x46b7dd){_0x46b7dd=_0x46b7dd||0xcc;return function(_0x26fab4){if(_0x26fab4){return _0x170dd0[_0x483c('0x14')](_0x46b7dd);}return _0x170dd0['status'](_0x46b7dd)[_0x483c('0x15')]();};}function respondWithResult(_0x2874c1,_0x34054d){_0x34054d=_0x34054d||0xc8;return function(_0x3f1866){if(_0x3f1866){return _0x2874c1['status'](_0x34054d)[_0x483c('0x16')](_0x3f1866);}};}function respondWithFilteredResult(_0x4f1d41,_0x20b6ba){return function(_0x4ce908){if(_0x4ce908){var _0xc9dc46=_0x4ce908[_0x483c('0x17')],_0x58aa05=_0x20b6ba['offset'],_0x3027a6=_0x20b6ba[_0x483c('0x18')]+_0x20b6ba[_0x483c('0x19')],_0x4fef08;if(_0x3027a6>=_0xc9dc46){_0x3027a6=_0xc9dc46;_0x4fef08=0xc8;}else{_0x4fef08=0xce;}_0x4f1d41[_0x483c('0x1a')](_0x4fef08);return _0x4f1d41[_0x483c('0x1b')](_0x483c('0x1c'),_0x58aa05+'-'+_0x3027a6+'/'+_0xc9dc46)['json'](_0x4ce908);}return null;};}function patchUpdates(_0x3fe93f){return function(_0x3d44cb){try{jsonpatch[_0x483c('0x1d')](_0x3d44cb,_0x3fe93f,!![]);}catch(_0x2a47f1){return BPromise[_0x483c('0x1e')](_0x2a47f1);}return _0x3d44cb[_0x483c('0x1f')]();};}function saveUpdates(_0x34d5d9,_0x53971f){return function(_0x244afa){if(_0x244afa){return _0x244afa[_0x483c('0x20')](_0x34d5d9)[_0x483c('0x21')](function(_0x1c63b6){return _0x1c63b6;});}return null;};}function removeEntity(_0x2bb318,_0x49dc1f){return function(_0x1db5ed){if(_0x1db5ed){return _0x1db5ed[_0x483c('0x22')]()[_0x483c('0x21')](function(){_0x2bb318[_0x483c('0x1a')](0xcc)[_0x483c('0x15')]();});}};}function handleEntityNotFound(_0x424cc3,_0x210c33){return function(_0x4fb5bc){if(!_0x4fb5bc){_0x424cc3[_0x483c('0x14')](0x194);}return _0x4fb5bc;};}function handleError(_0x4317e2,_0x27d09c){_0x27d09c=_0x27d09c||0x1f4;return function(_0x3ee64c){logger['error'](_0x3ee64c[_0x483c('0x23')]);if(_0x3ee64c['name']){delete _0x3ee64c[_0x483c('0x24')];}_0x4317e2[_0x483c('0x1a')](_0x27d09c)[_0x483c('0x25')](_0x3ee64c);};}exports['index']=function(_0x372aa4,_0x5bbade){var _0x5e2756={},_0x4005b2={},_0x74e355={'count':0x0,'rows':[]};var _0x28900b=_['map'](db['JscriptyQuestionReport'][_0x483c('0x26')],function(_0xea3ce0){return{'name':_0xea3ce0[_0x483c('0x27')],'type':_0xea3ce0[_0x483c('0x28')][_0x483c('0x29')]};});_0x4005b2[_0x483c('0x2a')]=_[_0x483c('0x2b')](_0x28900b,_0x483c('0x24'));_0x4005b2[_0x483c('0x2c')]=_['keys'](_0x372aa4[_0x483c('0x2c')]);_0x4005b2[_0x483c('0x2d')]=_[_0x483c('0x2e')](_0x4005b2[_0x483c('0x2a')],_0x4005b2[_0x483c('0x2c')]);_0x5e2756[_0x483c('0x2f')]=_[_0x483c('0x2e')](_0x4005b2[_0x483c('0x2a')],qs['fields'](_0x372aa4['query'][_0x483c('0x30')]));_0x5e2756[_0x483c('0x2f')]=_0x5e2756[_0x483c('0x2f')][_0x483c('0x31')]?_0x5e2756[_0x483c('0x2f')]:_0x4005b2[_0x483c('0x2a')];if(!_0x372aa4['query'][_0x483c('0x32')](_0x483c('0x33'))){_0x5e2756[_0x483c('0x19')]=qs[_0x483c('0x19')](_0x372aa4[_0x483c('0x2c')]['limit']);_0x5e2756[_0x483c('0x18')]=qs[_0x483c('0x18')](_0x372aa4['query'][_0x483c('0x18')]);}_0x5e2756[_0x483c('0x34')]=qs['sort'](_0x372aa4[_0x483c('0x2c')]['sort']);_0x5e2756['where']=qs[_0x483c('0x2d')](_[_0x483c('0x35')](_0x372aa4['query'],_0x4005b2[_0x483c('0x2d')]),_0x28900b);if(_0x372aa4[_0x483c('0x2c')][_0x483c('0x36')]){_0x5e2756[_0x483c('0x37')]=_[_0x483c('0x38')](_0x5e2756['where'],{'$or':_[_0x483c('0x2b')](_0x28900b,function(_0x319a26){if(_0x319a26[_0x483c('0x28')]!==_0x483c('0x39')){var _0x2663a0={};_0x2663a0[_0x319a26[_0x483c('0x24')]]={'$like':'%'+_0x372aa4[_0x483c('0x2c')]['filter']+'%'};return _0x2663a0;}})});}_0x5e2756=_[_0x483c('0x38')]({},_0x5e2756,_0x372aa4[_0x483c('0x3a')]);var _0x139529={'where':_0x5e2756['where']};return db[_0x483c('0x3b')]['count'](_0x139529)[_0x483c('0x21')](function(_0x28bb77){_0x74e355[_0x483c('0x17')]=_0x28bb77;if(_0x372aa4['query'][_0x483c('0x3c')]){_0x5e2756[_0x483c('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x483c('0x3e')](_0x5e2756);})['then'](function(_0x1b3fc7){_0x74e355['rows']=_0x1b3fc7;return _0x74e355;})[_0x483c('0x21')](respondWithFilteredResult(_0x5bbade,_0x5e2756))[_0x483c('0x3f')](handleError(_0x5bbade,null));};exports[_0x483c('0x40')]=function(_0x2ad43f,_0x8543e8){var _0x5c9863={'raw':!![],'where':{'id':_0x2ad43f[_0x483c('0x41')]['id']}},_0x42feee={};_0x42feee['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x42feee[_0x483c('0x2c')]=_[_0x483c('0x42')](_0x2ad43f[_0x483c('0x2c')]);_0x42feee['filters']=_[_0x483c('0x2e')](_0x42feee[_0x483c('0x2a')],_0x42feee[_0x483c('0x2c')]);_0x5c9863[_0x483c('0x2f')]=_[_0x483c('0x2e')](_0x42feee[_0x483c('0x2a')],qs[_0x483c('0x30')](_0x2ad43f['query']['fields']));_0x5c9863[_0x483c('0x2f')]=_0x5c9863[_0x483c('0x2f')][_0x483c('0x31')]?_0x5c9863['attributes']:_0x42feee['model'];if(_0x2ad43f[_0x483c('0x2c')]['includeAll']){_0x5c9863['include']=[{'all':!![]}];}_0x5c9863=_[_0x483c('0x38')]({},_0x5c9863,_0x2ad43f[_0x483c('0x3a')]);return db[_0x483c('0x3b')][_0x483c('0x43')](_0x5c9863)['then'](handleEntityNotFound(_0x8543e8,null))[_0x483c('0x21')](respondWithResult(_0x8543e8,null))[_0x483c('0x3f')](handleError(_0x8543e8,null));};exports[_0x483c('0x44')]=function(_0x53d64c,_0x4e3d11){return db['JscriptyQuestionReport'][_0x483c('0x44')](_0x53d64c[_0x483c('0x45')],{})['then'](respondWithResult(_0x4e3d11,0xc9))[_0x483c('0x3f')](handleError(_0x4e3d11,null));};exports[_0x483c('0x20')]=function(_0x284037,_0x2a5cdd){if(_0x284037[_0x483c('0x45')]['id']){delete _0x284037[_0x483c('0x45')]['id'];}return db[_0x483c('0x3b')]['find']({'where':{'id':_0x284037[_0x483c('0x41')]['id']}})[_0x483c('0x21')](handleEntityNotFound(_0x2a5cdd,null))[_0x483c('0x21')](saveUpdates(_0x284037[_0x483c('0x45')],null))[_0x483c('0x21')](respondWithResult(_0x2a5cdd,null))[_0x483c('0x3f')](handleError(_0x2a5cdd,null));};exports[_0x483c('0x22')]=function(_0xc233f6,_0x4705c2){return db['JscriptyQuestionReport'][_0x483c('0x43')]({'where':{'id':_0xc233f6[_0x483c('0x41')]['id']}})['then'](handleEntityNotFound(_0x4705c2,null))[_0x483c('0x21')](removeEntity(_0x4705c2,null))[_0x483c('0x3f')](handleError(_0x4705c2,null));};exports['describe']=function(_0x548c22,_0x41098a){return db[_0x483c('0x3b')][_0x483c('0x46')]()[_0x483c('0x21')](respondWithResult(_0x41098a,null))['catch'](handleError(_0x41098a,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 327b7e1..f2df64d 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 _0x1bb1=['path','rimraf','exports','define','report_jscripty_questions','util','../../config/logger','api','bluebird','request-promise'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1bb1,0xff));var _0x11bb=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1bb1[_0x19950b];return _0x3c6b41;};'use strict';var _=require('lodash');var util=require(_0x11bb('0x0'));var logger=require(_0x11bb('0x1'))(_0x11bb('0x2'));var moment=require('moment');var BPromise=require(_0x11bb('0x3'));var rp=require(_0x11bb('0x4'));var fs=require('fs');var path=require(_0x11bb('0x5'));var rimraf=require(_0x11bb('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0x11bb('0x7')]=function(_0x3717df,_0x73c164){return _0x3717df[_0x11bb('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x11bb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x389f=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x5ed611,_0x406032){var _0x189627=function(_0x4458ff){while(--_0x4458ff){_0x5ed611['push'](_0x5ed611['shift']());}};_0x189627(++_0x406032);}(_0x389f,0x95));var _0xf389=function(_0x47f14a,_0x56bc7f){_0x47f14a=_0x47f14a-0x0;var _0x74e231=_0x389f[_0x47f14a];return _0x74e231;};'use strict';var _=require(_0xf389('0x0'));var util=require(_0xf389('0x1'));var logger=require(_0xf389('0x2'))(_0xf389('0x3'));var moment=require(_0xf389('0x4'));var BPromise=require(_0xf389('0x5'));var rp=require(_0xf389('0x6'));var fs=require('fs');var path=require(_0xf389('0x7'));var rimraf=require(_0xf389('0x8'));var config=require(_0xf389('0x9'));var attributes=require(_0xf389('0xa'));module[_0xf389('0xb')]=function(_0x58aeee,_0x33d8c3){return _0x58aeee[_0xf389('0xc')](_0xf389('0xd'),attributes,{'tableName':_0xf389('0xe'),'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 00daf38..95cfecb 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 _0x68a4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util'];(function(_0x3c84e5,_0x412c4a){var _0x4dd2e9=function(_0x1f6ed6){while(--_0x1f6ed6){_0x3c84e5['push'](_0x3c84e5['shift']());}};_0x4dd2e9(++_0x412c4a);}(_0x68a4,0x129));var _0x468a=function(_0xee50c8,_0x1d426e){_0xee50c8=_0xee50c8-0x0;var _0x279f00=_0x68a4[_0xee50c8];return _0x279f00;};'use strict';var _=require(_0x468a('0x0'));var util=require(_0x468a('0x1'));var moment=require(_0x468a('0x2'));var BPromise=require(_0x468a('0x3'));var rs=require(_0x468a('0x4'));var fs=require('fs');var Redis=require(_0x468a('0x5'));var db=require(_0x468a('0x6'))['db'];var utils=require(_0x468a('0x7'));var logger=require(_0x468a('0x8'))('rpc');var config=require(_0x468a('0x9'));var jayson=require(_0x468a('0xa'));var client=jayson[_0x468a('0xb')][_0x468a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x536445,_0x1e3146,_0x532564){return new BPromise(function(_0x51951e,_0x22b88e){return client[_0x468a('0xd')](_0x536445,_0x532564)['then'](function(_0x5659ef){logger[_0x468a('0xe')](_0x468a('0xf'),_0x1e3146,_0x468a('0x10'));logger[_0x468a('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x1e3146,'request\x20sent',JSON[_0x468a('0x12')](_0x5659ef));if(_0x5659ef[_0x468a('0x13')]){if(_0x5659ef[_0x468a('0x13')]['code']===0x1f4){logger[_0x468a('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e3146,_0x5659ef['error'][_0x468a('0x14')]);return _0x22b88e(_0x5659ef['error'][_0x468a('0x14')]);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e3146,_0x5659ef['error'][_0x468a('0x14')]);return _0x51951e(_0x5659ef[_0x468a('0x13')]['message']);}else{logger[_0x468a('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e3146,_0x468a('0x10'));_0x51951e(_0x5659ef[_0x468a('0x15')][_0x468a('0x14')]);}})[_0x468a('0x16')](function(_0x41be30){logger[_0x468a('0x13')](_0x468a('0xf'),_0x1e3146,_0x41be30);_0x22b88e(_0x41be30);});});} \ No newline at end of file +var _0x578d=['rpc','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','info','result','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4942ea,_0x3f918a){var _0x169062=function(_0x3305a5){while(--_0x3305a5){_0x4942ea['push'](_0x4942ea['shift']());}};_0x169062(++_0x3f918a);}(_0x578d,0x9d));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd578('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd578('0x1'));var fs=require('fs');var Redis=require(_0xd578('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd578('0x3'));var logger=require(_0xd578('0x4'))(_0xd578('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd578('0x6')][_0xd578('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x20dd3a,_0x40a34e,_0x1d09dd){return new BPromise(function(_0x5565f7,_0x36dadb){return client[_0xd578('0x8')](_0x20dd3a,_0x1d09dd)[_0xd578('0x9')](function(_0x1375e1){logger['info'](_0xd578('0xa'),_0x40a34e,_0xd578('0xb'));logger[_0xd578('0xc')](_0xd578('0xd'),_0x40a34e,_0xd578('0xb'),JSON['stringify'](_0x1375e1));if(_0x1375e1[_0xd578('0xe')]){if(_0x1375e1[_0xd578('0xe')]['code']===0x1f4){logger[_0xd578('0xe')](_0xd578('0xa'),_0x40a34e,_0x1375e1['error'][_0xd578('0xf')]);return _0x36dadb(_0x1375e1[_0xd578('0xe')]['message']);}logger['error'](_0xd578('0xa'),_0x40a34e,_0x1375e1[_0xd578('0xe')][_0xd578('0xf')]);return _0x5565f7(_0x1375e1['error'][_0xd578('0xf')]);}else{logger[_0xd578('0x10')](_0xd578('0xa'),_0x40a34e,_0xd578('0xb'));_0x5565f7(_0x1375e1[_0xd578('0x11')][_0xd578('0xf')]);}})['catch'](function(_0x3b67cc){logger[_0xd578('0xe')](_0xd578('0xa'),_0x40a34e,_0x3b67cc);_0x36dadb(_0x3b67cc);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 9bbad31..1e3285b 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 _0x6f7f=['express','Router','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id','show','/:id/questions','create','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x1252d9,_0xb59816){var _0x76c018=function(_0x52e72c){while(--_0x52e72c){_0x1252d9['push'](_0x1252d9['shift']());}};_0x76c018(++_0xb59816);}(_0x6f7f,0x177));var _0xf6f7=function(_0x19191c,_0x180441){_0x19191c=_0x19191c-0x0;var _0x1138f6=_0x6f7f[_0x19191c];return _0x1138f6;};'use strict';var multer=require('multer');var util=require(_0xf6f7('0x0'));var path=require(_0xf6f7('0x1'));var timeout=require(_0xf6f7('0x2'));var express=require(_0xf6f7('0x3'));var router=express[_0xf6f7('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf6f7('0x5'));var config=require('../../config/environment');var controller=require(_0xf6f7('0x6'));router[_0xf6f7('0x7')]('/',auth[_0xf6f7('0x8')](),controller['index']);router[_0xf6f7('0x7')]('/describe',auth[_0xf6f7('0x8')](),controller[_0xf6f7('0x9')]);router[_0xf6f7('0x7')](_0xf6f7('0xa'),auth[_0xf6f7('0x8')](),controller[_0xf6f7('0xb')]);router['get'](_0xf6f7('0xc'),auth['isAuthenticated'](),controller['getQuestions']);router['post']('/',auth[_0xf6f7('0x8')](),controller[_0xf6f7('0xd')]);router[_0xf6f7('0xe')](_0xf6f7('0xa'),auth[_0xf6f7('0x8')](),controller[_0xf6f7('0xf')]);router['delete']('/:id',auth[_0xf6f7('0x8')](),controller[_0xf6f7('0x10')]);module[_0xf6f7('0x11')]=router; \ No newline at end of file +var _0x79a8=['delete','/:id','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','show','/:id/questions','getQuestions','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79a8,0x1d0));var _0x879a=function(_0x40e76b,_0x9f1a5){_0x40e76b=_0x40e76b-0x0;var _0x8b2a31=_0x79a8[_0x40e76b];return _0x8b2a31;};'use strict';var multer=require(_0x879a('0x0'));var util=require('util');var path=require(_0x879a('0x1'));var timeout=require(_0x879a('0x2'));var express=require(_0x879a('0x3'));var router=express['Router']();var auth=require(_0x879a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x879a('0x5'));var controller=require(_0x879a('0x6'));router[_0x879a('0x7')]('/',auth[_0x879a('0x8')](),controller[_0x879a('0x9')]);router[_0x879a('0x7')](_0x879a('0xa'),auth[_0x879a('0x8')](),controller['describe']);router[_0x879a('0x7')]('/:id',auth[_0x879a('0x8')](),controller[_0x879a('0xb')]);router['get'](_0x879a('0xc'),auth[_0x879a('0x8')](),controller[_0x879a('0xd')]);router['post']('/',auth[_0x879a('0x8')](),controller[_0x879a('0xe')]);router['put']('/:id',auth[_0x879a('0x8')](),controller[_0x879a('0xf')]);router[_0x879a('0x10')](_0x879a('0x11'),auth['isAuthenticated'](),controller[_0x879a('0x12')]);module[_0x879a('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 967e00c..0596a9d 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 _0x9cae=['DATE','starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9cae,0xed));var _0xe9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9cae[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xe9ca('0x0'));var Sequelize=require(_0xe9ca('0x1'));module[_0xe9ca('0x2')]={'starttime':{'type':Sequelize[_0xe9ca('0x3')],'set':function(_0x119c97){this['setDataValue'](_0xe9ca('0x4'),_0x119c97);this[_0xe9ca('0x5')]('endtime',moment()[_0xe9ca('0x6')](_0xe9ca('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xe9ca('0x8')]},'queue':{'type':Sequelize[_0xe9ca('0x8')]},'uniqueid':{'type':Sequelize[_0xe9ca('0x8')]},'calleridname':{'type':Sequelize[_0xe9ca('0x8')]},'calleridnum':{'type':Sequelize[_0xe9ca('0x8')]},'completed':{'type':Sequelize[_0xe9ca('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0xf633=['moment','sequelize','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN'];(function(_0x4d08b3,_0x815c75){var _0x1d2231=function(_0x51a9a5){while(--_0x51a9a5){_0x4d08b3['push'](_0x4d08b3['shift']());}};_0x1d2231(++_0x815c75);}(_0xf633,0x18c));var _0x3f63=function(_0x566177,_0x1e0735){_0x566177=_0x566177-0x0;var _0x2f1d44=_0xf633[_0x566177];return _0x2f1d44;};'use strict';var moment=require(_0x3f63('0x0'));var Sequelize=require(_0x3f63('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x22b37b){this['setDataValue'](_0x3f63('0x2'),_0x22b37b);this['setDataValue'](_0x3f63('0x3'),moment()[_0x3f63('0x4')](_0x3f63('0x5')));}},'endtime':{'type':Sequelize[_0x3f63('0x6')]},'membername':{'type':Sequelize[_0x3f63('0x7')]},'projectname':{'type':Sequelize[_0x3f63('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3f63('0x7')]},'calleridname':{'type':Sequelize[_0x3f63('0x7')]},'calleridnum':{'type':Sequelize[_0x3f63('0x7')]},'completed':{'type':Sequelize[_0x3f63('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index a2aa5f7..7bc4bcb 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 _0xd514=['util','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/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','create','body','destroy','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xd514,0x148));var _0x4d51=function(_0x626673,_0x30e375){_0x626673=_0x626673-0x0;var _0x4a6d1d=_0xd514[_0x626673];return _0x4a6d1d;};'use strict';var pdf=require(_0x4d51('0x0'));var emlformat=require(_0x4d51('0x1'));var rimraf=require(_0x4d51('0x2'));var zipdir=require(_0x4d51('0x3'));var jsonpatch=require(_0x4d51('0x4'));var rp=require('request-promise');var moment=require(_0x4d51('0x5'));var BPromise=require(_0x4d51('0x6'));var Mustache=require(_0x4d51('0x7'));var util=require(_0x4d51('0x8'));var path=require('path');var sox=require(_0x4d51('0x9'));var csv=require(_0x4d51('0xa'));var ejs=require(_0x4d51('0xb'));var fs=require('fs');var _=require(_0x4d51('0xc'));var squel=require(_0x4d51('0xd'));var crypto=require(_0x4d51('0xe'));var jsforce=require(_0x4d51('0xf'));var deskjs=require(_0x4d51('0x10'));var toCsv=require(_0x4d51('0xa'));var querystring=require('querystring');var Papa=require(_0x4d51('0x11'));var Redis=require(_0x4d51('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4d51('0x13'));var as=require(_0x4d51('0x14'));var hardwareService=require(_0x4d51('0x15'));var logger=require(_0x4d51('0x16'))(_0x4d51('0x17'));var utils=require(_0x4d51('0x18'));var config=require(_0x4d51('0x19'));var db=require(_0x4d51('0x1a'))['db'];function respondWithStatusCode(_0x48a1de,_0xb11df6){_0xb11df6=_0xb11df6||0xcc;return function(_0x3a9b2e){if(_0x3a9b2e){return _0x48a1de[_0x4d51('0x1b')](_0xb11df6);}return _0x48a1de[_0x4d51('0x1c')](_0xb11df6)['end']();};}function respondWithResult(_0x299935,_0x14ff6f){_0x14ff6f=_0x14ff6f||0xc8;return function(_0x1fed9e){if(_0x1fed9e){return _0x299935[_0x4d51('0x1c')](_0x14ff6f)[_0x4d51('0x1d')](_0x1fed9e);}};}function respondWithFilteredResult(_0x3a4cd6,_0x322702){return function(_0x4ef477){if(_0x4ef477){var _0x499b02=_0x4ef477[_0x4d51('0x1e')],_0x135875=_0x322702['offset'],_0x3d6cfa=_0x322702[_0x4d51('0x1f')]+_0x322702[_0x4d51('0x20')],_0x5486b3;if(_0x3d6cfa>=_0x499b02){_0x3d6cfa=_0x499b02;_0x5486b3=0xc8;}else{_0x5486b3=0xce;}_0x3a4cd6[_0x4d51('0x1c')](_0x5486b3);return _0x3a4cd6[_0x4d51('0x21')](_0x4d51('0x22'),_0x135875+'-'+_0x3d6cfa+'/'+_0x499b02)[_0x4d51('0x1d')](_0x4ef477);}return null;};}function patchUpdates(_0x86b050){return function(_0x2f4352){try{jsonpatch[_0x4d51('0x23')](_0x2f4352,_0x86b050,!![]);}catch(_0x95aa17){return BPromise['reject'](_0x95aa17);}return _0x2f4352[_0x4d51('0x24')]();};}function saveUpdates(_0x1acd32,_0x354b13){return function(_0x5d63cb){if(_0x5d63cb){return _0x5d63cb[_0x4d51('0x25')](_0x1acd32)['then'](function(_0x49332c){return _0x49332c;});}return null;};}function removeEntity(_0x5ccfad,_0x1a3075){return function(_0x31fdd3){if(_0x31fdd3){return _0x31fdd3['destroy']()[_0x4d51('0x26')](function(){_0x5ccfad[_0x4d51('0x1c')](0xcc)[_0x4d51('0x27')]();});}};}function handleEntityNotFound(_0x1ae77f,_0x10a859){return function(_0x46a1ce){if(!_0x46a1ce){_0x1ae77f[_0x4d51('0x1b')](0x194);}return _0x46a1ce;};}function handleError(_0x6dbb20,_0x49735f){_0x49735f=_0x49735f||0x1f4;return function(_0x52fd65){logger[_0x4d51('0x28')](_0x52fd65[_0x4d51('0x29')]);if(_0x52fd65['name']){delete _0x52fd65[_0x4d51('0x2a')];}_0x6dbb20['status'](_0x49735f)[_0x4d51('0x2b')](_0x52fd65);};}exports['index']=function(_0x47387d,_0xfbeff){var _0xb18c3c={},_0x193dfd={},_0x49ec62={'count':0x0,'rows':[]};var _0x46417a=_[_0x4d51('0x2c')](db[_0x4d51('0x2d')][_0x4d51('0x2e')],function(_0x189158){return{'name':_0x189158[_0x4d51('0x2f')],'type':_0x189158[_0x4d51('0x30')][_0x4d51('0x31')]};});_0x193dfd[_0x4d51('0x32')]=_[_0x4d51('0x2c')](_0x46417a,_0x4d51('0x2a'));_0x193dfd[_0x4d51('0x33')]=_[_0x4d51('0x34')](_0x47387d[_0x4d51('0x33')]);_0x193dfd['filters']=_[_0x4d51('0x35')](_0x193dfd[_0x4d51('0x32')],_0x193dfd['query']);_0xb18c3c[_0x4d51('0x36')]=_[_0x4d51('0x35')](_0x193dfd[_0x4d51('0x32')],qs[_0x4d51('0x37')](_0x47387d[_0x4d51('0x33')]['fields']));_0xb18c3c[_0x4d51('0x36')]=_0xb18c3c['attributes'][_0x4d51('0x38')]?_0xb18c3c[_0x4d51('0x36')]:_0x193dfd[_0x4d51('0x32')];if(!_0x47387d[_0x4d51('0x33')][_0x4d51('0x39')](_0x4d51('0x3a'))){_0xb18c3c[_0x4d51('0x20')]=qs[_0x4d51('0x20')](_0x47387d[_0x4d51('0x33')][_0x4d51('0x20')]);_0xb18c3c[_0x4d51('0x1f')]=qs[_0x4d51('0x1f')](_0x47387d[_0x4d51('0x33')]['offset']);}_0xb18c3c[_0x4d51('0x3b')]=qs[_0x4d51('0x3c')](_0x47387d[_0x4d51('0x33')][_0x4d51('0x3c')]);_0xb18c3c[_0x4d51('0x3d')]=qs[_0x4d51('0x3e')](_[_0x4d51('0x3f')](_0x47387d[_0x4d51('0x33')],_0x193dfd[_0x4d51('0x3e')]),_0x46417a);if(_0x47387d[_0x4d51('0x33')][_0x4d51('0x40')]){_0xb18c3c[_0x4d51('0x3d')]=_[_0x4d51('0x41')](_0xb18c3c[_0x4d51('0x3d')],{'$or':_[_0x4d51('0x2c')](_0x46417a,function(_0x20cf47){if(_0x20cf47[_0x4d51('0x30')]!==_0x4d51('0x42')){var _0x242fe8={};_0x242fe8[_0x20cf47[_0x4d51('0x2a')]]={'$like':'%'+_0x47387d['query'][_0x4d51('0x40')]+'%'};return _0x242fe8;}})});}_0xb18c3c=_['merge']({},_0xb18c3c,_0x47387d[_0x4d51('0x43')]);var _0x29de5d={'where':_0xb18c3c[_0x4d51('0x3d')]};return db[_0x4d51('0x2d')][_0x4d51('0x1e')](_0x29de5d)[_0x4d51('0x26')](function(_0x2c3870){_0x49ec62['count']=_0x2c3870;if(_0x47387d[_0x4d51('0x33')][_0x4d51('0x44')]){_0xb18c3c[_0x4d51('0x45')]=[{'all':!![]}];}return db[_0x4d51('0x2d')]['findAll'](_0xb18c3c);})[_0x4d51('0x26')](function(_0x5552f2){_0x49ec62[_0x4d51('0x46')]=_0x5552f2;return _0x49ec62;})[_0x4d51('0x26')](respondWithFilteredResult(_0xfbeff,_0xb18c3c))['catch'](handleError(_0xfbeff,null));};exports[_0x4d51('0x47')]=function(_0x15cf43,_0x2b2b0f){var _0x50a315={'raw':!![],'where':{'id':_0x15cf43[_0x4d51('0x48')]['id']}},_0x4e0c42={};_0x4e0c42[_0x4d51('0x32')]=_[_0x4d51('0x34')](db[_0x4d51('0x2d')][_0x4d51('0x2e')]);_0x4e0c42[_0x4d51('0x33')]=_[_0x4d51('0x34')](_0x15cf43['query']);_0x4e0c42[_0x4d51('0x3e')]=_[_0x4d51('0x35')](_0x4e0c42[_0x4d51('0x32')],_0x4e0c42[_0x4d51('0x33')]);_0x50a315[_0x4d51('0x36')]=_['intersection'](_0x4e0c42[_0x4d51('0x32')],qs[_0x4d51('0x37')](_0x15cf43[_0x4d51('0x33')]['fields']));_0x50a315['attributes']=_0x50a315['attributes'][_0x4d51('0x38')]?_0x50a315[_0x4d51('0x36')]:_0x4e0c42['model'];if(_0x15cf43[_0x4d51('0x33')]['includeAll']){_0x50a315['include']=[{'all':!![]}];}_0x50a315=_[_0x4d51('0x41')]({},_0x50a315,_0x15cf43[_0x4d51('0x43')]);return db['JscriptySessionReport'][_0x4d51('0x49')](_0x50a315)[_0x4d51('0x26')](handleEntityNotFound(_0x2b2b0f,null))[_0x4d51('0x26')](respondWithResult(_0x2b2b0f,null))[_0x4d51('0x4a')](handleError(_0x2b2b0f,null));};exports[_0x4d51('0x4b')]=function(_0x1c7abf,_0x26415f){return db[_0x4d51('0x2d')][_0x4d51('0x4b')](_0x1c7abf[_0x4d51('0x4c')],{})[_0x4d51('0x26')](respondWithResult(_0x26415f,0xc9))[_0x4d51('0x4a')](handleError(_0x26415f,null));};exports[_0x4d51('0x25')]=function(_0x82d60,_0x15c5b2){if(_0x82d60[_0x4d51('0x4c')]['id']){delete _0x82d60[_0x4d51('0x4c')]['id'];}return db[_0x4d51('0x2d')]['find']({'where':{'id':_0x82d60[_0x4d51('0x48')]['id']}})[_0x4d51('0x26')](handleEntityNotFound(_0x15c5b2,null))[_0x4d51('0x26')](saveUpdates(_0x82d60['body'],null))[_0x4d51('0x26')](respondWithResult(_0x15c5b2,null))['catch'](handleError(_0x15c5b2,null));};exports[_0x4d51('0x4d')]=function(_0x518063,_0xc46adb){return db['JscriptySessionReport']['find']({'where':{'id':_0x518063[_0x4d51('0x48')]['id']}})['then'](handleEntityNotFound(_0xc46adb,null))[_0x4d51('0x26')](removeEntity(_0xc46adb,null))[_0x4d51('0x4a')](handleError(_0xc46adb,null));};exports[_0x4d51('0x4e')]=function(_0x123d06,_0xab7bc5){return db[_0x4d51('0x2d')][_0x4d51('0x4e')]()[_0x4d51('0x26')](respondWithResult(_0xab7bc5,null))[_0x4d51('0x4a')](handleError(_0xab7bc5,null));};exports[_0x4d51('0x4f')]=function(_0x245d9b,_0x6556d4,_0xea2109){var _0x3379e6={'raw':!![],'where':{}};var _0x59173b={};var _0x58958c={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4d51('0x50')]({'where':{'id':_0x245d9b[_0x4d51('0x48')]['id']}})[_0x4d51('0x26')](handleEntityNotFound(_0x6556d4,null))[_0x4d51('0x26')](function(_0x387a01){if(_0x387a01){_0x59173b[_0x4d51('0x32')]=_['keys'](db['JscriptyQuestionReport'][_0x4d51('0x2e')]);_0x59173b['query']=_[_0x4d51('0x34')](_0x245d9b[_0x4d51('0x33')]);_0x59173b[_0x4d51('0x3e')]=_[_0x4d51('0x35')](_0x59173b['model'],_0x59173b[_0x4d51('0x33')]);_0x3379e6[_0x4d51('0x36')]=_[_0x4d51('0x35')](_0x59173b['model'],qs[_0x4d51('0x37')](_0x245d9b[_0x4d51('0x33')][_0x4d51('0x37')]));_0x3379e6[_0x4d51('0x36')]=_0x3379e6[_0x4d51('0x36')][_0x4d51('0x38')]?_0x3379e6[_0x4d51('0x36')]:_0x59173b[_0x4d51('0x32')];if(!_0x245d9b[_0x4d51('0x33')][_0x4d51('0x39')](_0x4d51('0x3a'))){_0x3379e6[_0x4d51('0x20')]=qs[_0x4d51('0x20')](_0x245d9b[_0x4d51('0x33')][_0x4d51('0x20')]);_0x3379e6[_0x4d51('0x1f')]=qs[_0x4d51('0x1f')](_0x245d9b[_0x4d51('0x33')][_0x4d51('0x1f')]);}_0x3379e6[_0x4d51('0x3b')]=qs['sort'](_0x245d9b[_0x4d51('0x33')]['sort']);_0x3379e6[_0x4d51('0x3d')]=qs[_0x4d51('0x3e')](_[_0x4d51('0x3f')](_0x245d9b[_0x4d51('0x33')],_0x59173b[_0x4d51('0x3e')]));_0x3379e6['where'][_0x4d51('0x51')]=_0x387a01['id'];if(_0x245d9b[_0x4d51('0x33')][_0x4d51('0x40')]){_0x3379e6[_0x4d51('0x3d')]=_[_0x4d51('0x41')](_0x3379e6[_0x4d51('0x3d')],{'$or':_[_0x4d51('0x2c')](_0x3379e6[_0x4d51('0x36')],function(_0xf1f81f){var _0x5de4eb={};_0x5de4eb[_0xf1f81f]={'$like':'%'+_0x245d9b[_0x4d51('0x33')][_0x4d51('0x40')]+'%'};return _0x5de4eb;})});}_0x3379e6=_[_0x4d51('0x41')]({},_0x3379e6,_0x245d9b[_0x4d51('0x43')]);return db[_0x4d51('0x52')]['count']({'where':_0x3379e6[_0x4d51('0x3d')]})[_0x4d51('0x26')](function(_0x176513){_0x58958c[_0x4d51('0x1e')]=_0x176513;if(_0x245d9b[_0x4d51('0x33')][_0x4d51('0x44')]){_0x3379e6[_0x4d51('0x45')]=[{'all':!![]}];}return db[_0x4d51('0x52')][_0x4d51('0x53')](_0x3379e6);})['then'](function(_0x10e79f){_0x58958c['rows']=_0x10e79f;return _0x58958c;});}})[_0x4d51('0x26')](respondWithFilteredResult(_0x6556d4,_0x3379e6))[_0x4d51('0x4a')](handleError(_0x6556d4,null));}; \ No newline at end of file +var _0x0386=['pick','VIRTUAL','merge','options','includeAll','findAll','catch','show','length','include','create','body','find','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','filter','rows','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','JscriptySessionReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0386,0x1ea));var _0x6038=function(_0x314c55,_0x2b721c){_0x314c55=_0x314c55-0x0;var _0x342bce=_0x0386[_0x314c55];return _0x342bce;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6038('0x0'));var rimraf=require(_0x6038('0x1'));var zipdir=require(_0x6038('0x2'));var jsonpatch=require(_0x6038('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6038('0x4'));var Mustache=require(_0x6038('0x5'));var util=require(_0x6038('0x6'));var path=require(_0x6038('0x7'));var sox=require(_0x6038('0x8'));var csv=require(_0x6038('0x9'));var ejs=require(_0x6038('0xa'));var fs=require('fs');var _=require(_0x6038('0xb'));var squel=require(_0x6038('0xc'));var crypto=require(_0x6038('0xd'));var jsforce=require(_0x6038('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6038('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6038('0xf'));var authService=require(_0x6038('0x10'));var qs=require(_0x6038('0x11'));var as=require(_0x6038('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6038('0x13'));var utils=require(_0x6038('0x14'));var config=require(_0x6038('0x15'));var db=require(_0x6038('0x16'))['db'];function respondWithStatusCode(_0x360903,_0x2e223b){_0x2e223b=_0x2e223b||0xcc;return function(_0x3b4878){if(_0x3b4878){return _0x360903[_0x6038('0x17')](_0x2e223b);}return _0x360903[_0x6038('0x18')](_0x2e223b)[_0x6038('0x19')]();};}function respondWithResult(_0xa87f97,_0xd70c03){_0xd70c03=_0xd70c03||0xc8;return function(_0x2299f2){if(_0x2299f2){return _0xa87f97['status'](_0xd70c03)[_0x6038('0x1a')](_0x2299f2);}};}function respondWithFilteredResult(_0x305041,_0x4fc99d){return function(_0xdd9bf8){if(_0xdd9bf8){var _0x4aa2f0=_0xdd9bf8[_0x6038('0x1b')],_0x5beb1a=_0x4fc99d[_0x6038('0x1c')],_0x8ff720=_0x4fc99d['offset']+_0x4fc99d[_0x6038('0x1d')],_0x22672b;if(_0x8ff720>=_0x4aa2f0){_0x8ff720=_0x4aa2f0;_0x22672b=0xc8;}else{_0x22672b=0xce;}_0x305041['status'](_0x22672b);return _0x305041[_0x6038('0x1e')](_0x6038('0x1f'),_0x5beb1a+'-'+_0x8ff720+'/'+_0x4aa2f0)['json'](_0xdd9bf8);}return null;};}function patchUpdates(_0x43c6e6){return function(_0x1fcddc){try{jsonpatch[_0x6038('0x20')](_0x1fcddc,_0x43c6e6,!![]);}catch(_0x48346f){return BPromise['reject'](_0x48346f);}return _0x1fcddc[_0x6038('0x21')]();};}function saveUpdates(_0x4a69cf,_0xbd58ba){return function(_0x28dd75){if(_0x28dd75){return _0x28dd75[_0x6038('0x22')](_0x4a69cf)[_0x6038('0x23')](function(_0x408a25){return _0x408a25;});}return null;};}function removeEntity(_0x385914,_0x2283ab){return function(_0x2fb20f){if(_0x2fb20f){return _0x2fb20f['destroy']()[_0x6038('0x23')](function(){_0x385914[_0x6038('0x18')](0xcc)[_0x6038('0x19')]();});}};}function handleEntityNotFound(_0x3c6973,_0x171fb1){return function(_0x4b97bd){if(!_0x4b97bd){_0x3c6973[_0x6038('0x17')](0x194);}return _0x4b97bd;};}function handleError(_0x31b50b,_0x1e9591){_0x1e9591=_0x1e9591||0x1f4;return function(_0x5b53d2){logger[_0x6038('0x24')](_0x5b53d2['stack']);if(_0x5b53d2['name']){delete _0x5b53d2[_0x6038('0x25')];}_0x31b50b[_0x6038('0x18')](_0x1e9591)[_0x6038('0x26')](_0x5b53d2);};}exports[_0x6038('0x27')]=function(_0x161ee8,_0x58c757){var _0x25457a={},_0x256d9c={},_0x595832={'count':0x0,'rows':[]};var _0x11df6d=_[_0x6038('0x28')](db[_0x6038('0x29')]['rawAttributes'],function(_0x5aee10){return{'name':_0x5aee10[_0x6038('0x2a')],'type':_0x5aee10[_0x6038('0x2b')][_0x6038('0x2c')]};});_0x256d9c[_0x6038('0x2d')]=_[_0x6038('0x28')](_0x11df6d,_0x6038('0x25'));_0x256d9c['query']=_[_0x6038('0x2e')](_0x161ee8[_0x6038('0x2f')]);_0x256d9c[_0x6038('0x30')]=_[_0x6038('0x31')](_0x256d9c[_0x6038('0x2d')],_0x256d9c[_0x6038('0x2f')]);_0x25457a['attributes']=_[_0x6038('0x31')](_0x256d9c[_0x6038('0x2d')],qs[_0x6038('0x32')](_0x161ee8[_0x6038('0x2f')][_0x6038('0x32')]));_0x25457a['attributes']=_0x25457a[_0x6038('0x33')]['length']?_0x25457a[_0x6038('0x33')]:_0x256d9c[_0x6038('0x2d')];if(!_0x161ee8[_0x6038('0x2f')][_0x6038('0x34')]('nolimit')){_0x25457a[_0x6038('0x1d')]=qs[_0x6038('0x1d')](_0x161ee8[_0x6038('0x2f')][_0x6038('0x1d')]);_0x25457a['offset']=qs[_0x6038('0x1c')](_0x161ee8['query']['offset']);}_0x25457a[_0x6038('0x35')]=qs['sort'](_0x161ee8[_0x6038('0x2f')][_0x6038('0x36')]);_0x25457a[_0x6038('0x37')]=qs[_0x6038('0x30')](_[_0x6038('0x38')](_0x161ee8[_0x6038('0x2f')],_0x256d9c[_0x6038('0x30')]),_0x11df6d);if(_0x161ee8['query']['filter']){_0x25457a[_0x6038('0x37')]=_['merge'](_0x25457a[_0x6038('0x37')],{'$or':_[_0x6038('0x28')](_0x11df6d,function(_0x122cbd){if(_0x122cbd['type']!==_0x6038('0x39')){var _0x544e75={};_0x544e75[_0x122cbd[_0x6038('0x25')]]={'$like':'%'+_0x161ee8[_0x6038('0x2f')]['filter']+'%'};return _0x544e75;}})});}_0x25457a=_[_0x6038('0x3a')]({},_0x25457a,_0x161ee8[_0x6038('0x3b')]);var _0x36145f={'where':_0x25457a[_0x6038('0x37')]};return db[_0x6038('0x29')][_0x6038('0x1b')](_0x36145f)['then'](function(_0x3aa7d4){_0x595832[_0x6038('0x1b')]=_0x3aa7d4;if(_0x161ee8[_0x6038('0x2f')][_0x6038('0x3c')]){_0x25457a['include']=[{'all':!![]}];}return db[_0x6038('0x29')][_0x6038('0x3d')](_0x25457a);})['then'](function(_0x4c1c3){_0x595832['rows']=_0x4c1c3;return _0x595832;})[_0x6038('0x23')](respondWithFilteredResult(_0x58c757,_0x25457a))[_0x6038('0x3e')](handleError(_0x58c757,null));};exports[_0x6038('0x3f')]=function(_0xceae95,_0x308777){var _0x15e232={'raw':!![],'where':{'id':_0xceae95['params']['id']}},_0x5ac62c={};_0x5ac62c['model']=_[_0x6038('0x2e')](db[_0x6038('0x29')]['rawAttributes']);_0x5ac62c['query']=_[_0x6038('0x2e')](_0xceae95['query']);_0x5ac62c[_0x6038('0x30')]=_['intersection'](_0x5ac62c[_0x6038('0x2d')],_0x5ac62c['query']);_0x15e232[_0x6038('0x33')]=_[_0x6038('0x31')](_0x5ac62c[_0x6038('0x2d')],qs[_0x6038('0x32')](_0xceae95['query'][_0x6038('0x32')]));_0x15e232['attributes']=_0x15e232[_0x6038('0x33')][_0x6038('0x40')]?_0x15e232[_0x6038('0x33')]:_0x5ac62c[_0x6038('0x2d')];if(_0xceae95[_0x6038('0x2f')]['includeAll']){_0x15e232[_0x6038('0x41')]=[{'all':!![]}];}_0x15e232=_['merge']({},_0x15e232,_0xceae95[_0x6038('0x3b')]);return db['JscriptySessionReport']['find'](_0x15e232)[_0x6038('0x23')](handleEntityNotFound(_0x308777,null))[_0x6038('0x23')](respondWithResult(_0x308777,null))[_0x6038('0x3e')](handleError(_0x308777,null));};exports[_0x6038('0x42')]=function(_0x1ea28a,_0x2a71f3){return db[_0x6038('0x29')]['create'](_0x1ea28a[_0x6038('0x43')],{})['then'](respondWithResult(_0x2a71f3,0xc9))[_0x6038('0x3e')](handleError(_0x2a71f3,null));};exports[_0x6038('0x22')]=function(_0x29ff0d,_0x4c0efd){if(_0x29ff0d[_0x6038('0x43')]['id']){delete _0x29ff0d[_0x6038('0x43')]['id'];}return db['JscriptySessionReport'][_0x6038('0x44')]({'where':{'id':_0x29ff0d[_0x6038('0x45')]['id']}})[_0x6038('0x23')](handleEntityNotFound(_0x4c0efd,null))[_0x6038('0x23')](saveUpdates(_0x29ff0d['body'],null))[_0x6038('0x23')](respondWithResult(_0x4c0efd,null))[_0x6038('0x3e')](handleError(_0x4c0efd,null));};exports[_0x6038('0x46')]=function(_0x553200,_0x26a21c){return db['JscriptySessionReport'][_0x6038('0x44')]({'where':{'id':_0x553200[_0x6038('0x45')]['id']}})['then'](handleEntityNotFound(_0x26a21c,null))[_0x6038('0x23')](removeEntity(_0x26a21c,null))[_0x6038('0x3e')](handleError(_0x26a21c,null));};exports[_0x6038('0x47')]=function(_0x370257,_0x56aca2){return db[_0x6038('0x29')][_0x6038('0x47')]()[_0x6038('0x23')](respondWithResult(_0x56aca2,null))['catch'](handleError(_0x56aca2,null));};exports[_0x6038('0x48')]=function(_0x8315e,_0x6734d1,_0x1f8f9b){var _0x5ab9fe={'raw':!![],'where':{}};var _0x30bf92={};var _0x52a022={'count':0x0,'rows':[]};return db[_0x6038('0x29')][_0x6038('0x49')]({'where':{'id':_0x8315e[_0x6038('0x45')]['id']}})[_0x6038('0x23')](handleEntityNotFound(_0x6734d1,null))[_0x6038('0x23')](function(_0x17b410){if(_0x17b410){_0x30bf92[_0x6038('0x2d')]=_['keys'](db[_0x6038('0x4a')][_0x6038('0x4b')]);_0x30bf92[_0x6038('0x2f')]=_['keys'](_0x8315e[_0x6038('0x2f')]);_0x30bf92['filters']=_[_0x6038('0x31')](_0x30bf92[_0x6038('0x2d')],_0x30bf92['query']);_0x5ab9fe[_0x6038('0x33')]=_[_0x6038('0x31')](_0x30bf92[_0x6038('0x2d')],qs['fields'](_0x8315e[_0x6038('0x2f')][_0x6038('0x32')]));_0x5ab9fe[_0x6038('0x33')]=_0x5ab9fe[_0x6038('0x33')][_0x6038('0x40')]?_0x5ab9fe[_0x6038('0x33')]:_0x30bf92[_0x6038('0x2d')];if(!_0x8315e[_0x6038('0x2f')][_0x6038('0x34')]('nolimit')){_0x5ab9fe['limit']=qs[_0x6038('0x1d')](_0x8315e[_0x6038('0x2f')][_0x6038('0x1d')]);_0x5ab9fe[_0x6038('0x1c')]=qs[_0x6038('0x1c')](_0x8315e[_0x6038('0x2f')][_0x6038('0x1c')]);}_0x5ab9fe[_0x6038('0x35')]=qs[_0x6038('0x36')](_0x8315e[_0x6038('0x2f')][_0x6038('0x36')]);_0x5ab9fe['where']=qs[_0x6038('0x30')](_['pick'](_0x8315e['query'],_0x30bf92[_0x6038('0x30')]));_0x5ab9fe[_0x6038('0x37')]['SessionId']=_0x17b410['id'];if(_0x8315e[_0x6038('0x2f')][_0x6038('0x4c')]){_0x5ab9fe[_0x6038('0x37')]=_['merge'](_0x5ab9fe[_0x6038('0x37')],{'$or':_[_0x6038('0x28')](_0x5ab9fe[_0x6038('0x33')],function(_0x2ec8e9){var _0x21650c={};_0x21650c[_0x2ec8e9]={'$like':'%'+_0x8315e[_0x6038('0x2f')][_0x6038('0x4c')]+'%'};return _0x21650c;})});}_0x5ab9fe=_[_0x6038('0x3a')]({},_0x5ab9fe,_0x8315e[_0x6038('0x3b')]);return db[_0x6038('0x4a')][_0x6038('0x1b')]({'where':_0x5ab9fe[_0x6038('0x37')]})['then'](function(_0x15831e){_0x52a022[_0x6038('0x1b')]=_0x15831e;if(_0x8315e['query'][_0x6038('0x3c')]){_0x5ab9fe[_0x6038('0x41')]=[{'all':!![]}];}return db[_0x6038('0x4a')][_0x6038('0x3d')](_0x5ab9fe);})['then'](function(_0x2a953f){_0x52a022[_0x6038('0x4d')]=_0x2a953f;return _0x52a022;});}})[_0x6038('0x23')](respondWithFilteredResult(_0x6734d1,_0x5ab9fe))[_0x6038('0x3e')](handleError(_0x6734d1,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3ecbd96..88cbbe9 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 _0x38b8=['../../config/logger','api','bluebird','rimraf','../../config/environment','JscriptySessionReport','report_jscripty_sessions','lodash'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x38b8,0x7f));var _0x838b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x38b8[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x838b('0x0'));var util=require('util');var logger=require(_0x838b('0x1'))(_0x838b('0x2'));var moment=require('moment');var BPromise=require(_0x838b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x838b('0x4'));var config=require(_0x838b('0x5'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x43fd53,_0x4299dc){return _0x43fd53['define'](_0x838b('0x6'),attributes,{'tableName':_0x838b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9fb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x4640ce,_0xaa7776){var _0x233ed4=function(_0x1c9df1){while(--_0x1c9df1){_0x4640ce['push'](_0x4640ce['shift']());}};_0x233ed4(++_0xaa7776);}(_0xd9fb,0x189));var _0xbd9f=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xd9fb[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var logger=require(_0xbd9f('0x2'))(_0xbd9f('0x3'));var moment=require(_0xbd9f('0x4'));var BPromise=require(_0xbd9f('0x5'));var rp=require(_0xbd9f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd9f('0x7'));var config=require(_0xbd9f('0x8'));var attributes=require('./jscriptySessionReport.attributes');module[_0xbd9f('0x9')]=function(_0x5b6052,_0x2e7eea){return _0x5b6052[_0xbd9f('0xa')]('JscriptySessionReport',attributes,{'tableName':_0xbd9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index e23a3e1..0f0cdc8 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 _0x8333=['lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x28e398,_0x38093f){var _0x42c9d1=function(_0x21fffe){while(--_0x21fffe){_0x28e398['push'](_0x28e398['shift']());}};_0x42c9d1(++_0x38093f);}(_0x8333,0x160));var _0x3833=function(_0x5cd46f,_0x2d5bc2){_0x5cd46f=_0x5cd46f-0x0;var _0x116a61=_0x8333[_0x5cd46f];return _0x116a61;};'use strict';var _=require(_0x3833('0x0'));var util=require(_0x3833('0x1'));var moment=require(_0x3833('0x2'));var BPromise=require(_0x3833('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3833('0x4'));var db=require(_0x3833('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3833('0x6'));var config=require(_0x3833('0x7'));var jayson=require(_0x3833('0x8'));var client=jayson[_0x3833('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9694ff,_0x51b0dd,_0x215be7){return new BPromise(function(_0x233b4a,_0x420e1c){return client['request'](_0x9694ff,_0x215be7)[_0x3833('0xa')](function(_0x53da5b){logger[_0x3833('0xb')](_0x3833('0xc'),_0x51b0dd,_0x3833('0xd'));logger[_0x3833('0xe')](_0x3833('0xf'),_0x51b0dd,_0x3833('0xd'),JSON[_0x3833('0x10')](_0x53da5b));if(_0x53da5b[_0x3833('0x11')]){if(_0x53da5b['error'][_0x3833('0x12')]===0x1f4){logger[_0x3833('0x11')](_0x3833('0xc'),_0x51b0dd,_0x53da5b[_0x3833('0x11')][_0x3833('0x13')]);return _0x420e1c(_0x53da5b['error'][_0x3833('0x13')]);}logger[_0x3833('0x11')](_0x3833('0xc'),_0x51b0dd,_0x53da5b['error']['message']);return _0x233b4a(_0x53da5b['error'][_0x3833('0x13')]);}else{logger[_0x3833('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x51b0dd,'request\x20sent');_0x233b4a(_0x53da5b[_0x3833('0x14')]['message']);}})[_0x3833('0x15')](function(_0x561a6a){logger[_0x3833('0x11')](_0x3833('0xc'),_0x51b0dd,_0x561a6a);_0x420e1c(_0x561a6a);});});} \ No newline at end of file +var _0xc35b=['error','message','result','util','moment','randomstring','../../config/logger','rpc','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4612df,_0x37a8f7){var _0x2804c6=function(_0x2b1979){while(--_0x2b1979){_0x4612df['push'](_0x4612df['shift']());}};_0x2804c6(++_0x37a8f7);}(_0xc35b,0xa3));var _0xbc35=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xc35b[_0x288f5e];return _0x476cc9;};'use strict';var _=require('lodash');var util=require(_0xbc35('0x0'));var moment=require(_0xbc35('0x1'));var BPromise=require('bluebird');var rs=require(_0xbc35('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc35('0x3'))(_0xbc35('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc35('0x5')][_0xbc35('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2db8fd,_0x75ef4d,_0x2ae7b0){return new BPromise(function(_0x51b00b,_0x478893){return client['request'](_0x2db8fd,_0x2ae7b0)[_0xbc35('0x7')](function(_0x590a33){logger[_0xbc35('0x8')](_0xbc35('0x9'),_0x75ef4d,_0xbc35('0xa'));logger['debug'](_0xbc35('0xb'),_0x75ef4d,_0xbc35('0xa'),JSON[_0xbc35('0xc')](_0x590a33));if(_0x590a33[_0xbc35('0xd')]){if(_0x590a33[_0xbc35('0xd')]['code']===0x1f4){logger[_0xbc35('0xd')](_0xbc35('0x9'),_0x75ef4d,_0x590a33[_0xbc35('0xd')]['message']);return _0x478893(_0x590a33['error'][_0xbc35('0xe')]);}logger['error'](_0xbc35('0x9'),_0x75ef4d,_0x590a33[_0xbc35('0xd')]['message']);return _0x51b00b(_0x590a33[_0xbc35('0xd')][_0xbc35('0xe')]);}else{logger[_0xbc35('0x8')](_0xbc35('0x9'),_0x75ef4d,'request\x20sent');_0x51b00b(_0x590a33[_0xbc35('0xf')][_0xbc35('0xe')]);}})['catch'](function(_0x3166f1){logger['error'](_0xbc35('0x9'),_0x75ef4d,_0x3166f1);_0x478893(_0x3166f1);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 67589a3..b528132 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 _0x1294=['isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./license.controller','get','index','put','/:id'];(function(_0x13b1d8,_0x25c4f3){var _0x2e0c45=function(_0x1b9bb1){while(--_0x1b9bb1){_0x13b1d8['push'](_0x13b1d8['shift']());}};_0x2e0c45(++_0x25c4f3);}(_0x1294,0xb9));var _0x4129=function(_0x4fd6d5,_0x5161e3){_0x4fd6d5=_0x4fd6d5-0x0;var _0x34ada6=_0x1294[_0x4fd6d5];return _0x34ada6;};'use strict';var multer=require(_0x4129('0x0'));var util=require('util');var path=require(_0x4129('0x1'));var timeout=require(_0x4129('0x2'));var express=require(_0x4129('0x3'));var router=express[_0x4129('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4129('0x5'));var config=require('../../config/environment');var controller=require(_0x4129('0x6'));router[_0x4129('0x7')]('/',controller[_0x4129('0x8')]);router[_0x4129('0x9')](_0x4129('0xa'),auth[_0x4129('0xb')](),controller[_0x4129('0xc')]);module[_0x4129('0xd')]=router; \ No newline at end of file +var _0x3bcc=['../../config/environment','./license.controller','get','index','put','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2f6dfe,_0x115dab){var _0x5e5c9c=function(_0x502840){while(--_0x502840){_0x2f6dfe['push'](_0x2f6dfe['shift']());}};_0x5e5c9c(++_0x115dab);}(_0x3bcc,0x12e));var _0xc3bc=function(_0x5c7648,_0x49d062){_0x5c7648=_0x5c7648-0x0;var _0x5acad4=_0x3bcc[_0x5c7648];return _0x5acad4;};'use strict';var multer=require('multer');var util=require(_0xc3bc('0x0'));var path=require(_0xc3bc('0x1'));var timeout=require(_0xc3bc('0x2'));var express=require(_0xc3bc('0x3'));var router=express[_0xc3bc('0x4')]();var auth=require(_0xc3bc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc3bc('0x6'));var controller=require(_0xc3bc('0x7'));router[_0xc3bc('0x8')]('/',controller[_0xc3bc('0x9')]);router[_0xc3bc('0xa')]('/:id',auth[_0xc3bc('0xb')](),controller[_0xc3bc('0xc')]);module[_0xc3bc('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 2aba85b..8f37c51 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 _0x524e=['STRING','INTEGER','TEXT'];(function(_0xfedc72,_0x292f02){var _0x2c7c78=function(_0x12fbf1){while(--_0x12fbf1){_0xfedc72['push'](_0xfedc72['shift']());}};_0x2c7c78(++_0x292f02);}(_0x524e,0x15e));var _0xe524=function(_0x782b32,_0x55dcb5){_0x782b32=_0x782b32-0x0;var _0x1ca0eb=_0x524e[_0x782b32];return _0x1ca0eb;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0xe524('0x0')]},'data1':{'type':Sequelize[_0xe524('0x1')]},'data2':{'type':Sequelize[_0xe524('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0xe524('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe14b=['exports','STRING','INTEGER','sequelize'];(function(_0x25f8d7,_0x4114f0){var _0x1e65ca=function(_0x210cc3){while(--_0x210cc3){_0x25f8d7['push'](_0x25f8d7['shift']());}};_0x1e65ca(++_0x4114f0);}(_0xe14b,0x93));var _0xbe14=function(_0x21e857,_0x180835){_0x21e857=_0x21e857-0x0;var _0x251ea9=_0xe14b[_0x21e857];return _0x251ea9;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xbe14('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index ceabe94..5f8474f 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 _0x2890=['api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','send','../../config/license/util','index','keys','License','query','filters','attributes','intersection','model','fields','length','merge','options','getLicense','catch','update','body','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x56b11b,_0x10afb8){var _0x1cbaf1=function(_0x134da3){while(--_0x134da3){_0x56b11b['push'](_0x56b11b['shift']());}};_0x1cbaf1(++_0x10afb8);}(_0x2890,0x189));var _0x0289=function(_0x4dc94b,_0x32a19d){_0x4dc94b=_0x4dc94b-0x0;var _0x29542e=_0x2890[_0x4dc94b];return _0x29542e;};'use strict';var pdf=require(_0x0289('0x0'));var emlformat=require(_0x0289('0x1'));var rimraf=require(_0x0289('0x2'));var zipdir=require(_0x0289('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0289('0x4'));var moment=require(_0x0289('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0289('0x6'));var util=require(_0x0289('0x7'));var path=require('path');var sox=require(_0x0289('0x8'));var csv=require(_0x0289('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0289('0xa'));var squel=require(_0x0289('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0289('0xc'));var toCsv=require(_0x0289('0x9'));var querystring=require(_0x0289('0xd'));var Papa=require(_0x0289('0xe'));var Redis=require(_0x0289('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0289('0x10'));var as=require(_0x0289('0x11'));var hardwareService=require(_0x0289('0x12'));var logger=require(_0x0289('0x13'))(_0x0289('0x14'));var utils=require(_0x0289('0x15'));var config=require('../../config/environment');var db=require(_0x0289('0x16'))['db'];function respondWithStatusCode(_0x49ef1f,_0x2dbca6){_0x2dbca6=_0x2dbca6||0xcc;return function(_0x13c8e7){if(_0x13c8e7){return _0x49ef1f[_0x0289('0x17')](_0x2dbca6);}return _0x49ef1f['status'](_0x2dbca6)[_0x0289('0x18')]();};}function respondWithResult(_0x1357f8,_0xce5319){_0xce5319=_0xce5319||0xc8;return function(_0x242c79){if(_0x242c79){return _0x1357f8[_0x0289('0x19')](_0xce5319)[_0x0289('0x1a')](_0x242c79);}};}function respondWithFilteredResult(_0x598974,_0x524b88){return function(_0x2a0c6c){if(_0x2a0c6c){var _0x50899f=_0x2a0c6c[_0x0289('0x1b')],_0x15f801=_0x524b88['offset'],_0x5042a3=_0x524b88[_0x0289('0x1c')]+_0x524b88[_0x0289('0x1d')],_0x1113f0;if(_0x5042a3>=_0x50899f){_0x5042a3=_0x50899f;_0x1113f0=0xc8;}else{_0x1113f0=0xce;}_0x598974['status'](_0x1113f0);return _0x598974['set'](_0x0289('0x1e'),_0x15f801+'-'+_0x5042a3+'/'+_0x50899f)['json'](_0x2a0c6c);}return null;};}function patchUpdates(_0x3239a4){return function(_0x335c4a){try{jsonpatch[_0x0289('0x1f')](_0x335c4a,_0x3239a4,!![]);}catch(_0x48d45b){return BPromise[_0x0289('0x20')](_0x48d45b);}return _0x335c4a[_0x0289('0x21')]();};}function saveUpdates(_0x138f5c,_0x5299b1){return function(_0x507e20){if(_0x507e20){return _0x507e20['update'](_0x138f5c)[_0x0289('0x22')](function(_0x3dc99f){return _0x3dc99f;});}return null;};}function removeEntity(_0x4de882,_0x413bcc){return function(_0x46ce1e){if(_0x46ce1e){return _0x46ce1e[_0x0289('0x23')]()[_0x0289('0x22')](function(){_0x4de882[_0x0289('0x19')](0xcc)[_0x0289('0x18')]();});}};}function handleEntityNotFound(_0x29dde1,_0x4022cc){return function(_0x1856c4){if(!_0x1856c4){_0x29dde1[_0x0289('0x17')](0x194);}return _0x1856c4;};}function handleError(_0x17dece,_0x2f8968){_0x2f8968=_0x2f8968||0x1f4;return function(_0x15935b){logger['error'](_0x15935b['stack']);if(_0x15935b['name']){delete _0x15935b['name'];}_0x17dece[_0x0289('0x19')](_0x2f8968)[_0x0289('0x24')](_0x15935b);};}var utilLicense=require(_0x0289('0x25'));exports[_0x0289('0x26')]=function(_0x37d4ef,_0x1399fe){var _0x41b950={'raw':!![],'where':{'id':0x1}},_0x487c7e={};_0x487c7e['model']=_[_0x0289('0x27')](db[_0x0289('0x28')]['rawAttributes']);_0x487c7e[_0x0289('0x29')]=_['keys'](_0x37d4ef[_0x0289('0x29')]);_0x487c7e[_0x0289('0x2a')]=_['intersection'](_0x487c7e['model'],_0x487c7e[_0x0289('0x29')]);_0x41b950[_0x0289('0x2b')]=_[_0x0289('0x2c')](_0x487c7e[_0x0289('0x2d')],qs[_0x0289('0x2e')](_0x37d4ef[_0x0289('0x29')]['fields']));_0x41b950['attributes']=_0x41b950[_0x0289('0x2b')][_0x0289('0x2f')]?_0x41b950[_0x0289('0x2b')]:_0x487c7e[_0x0289('0x2d')];_0x41b950=_[_0x0289('0x30')]({},_0x41b950,_0x37d4ef[_0x0289('0x31')]);return utilLicense[_0x0289('0x32')](_0x41b950)['then'](respondWithResult(_0x1399fe,null))[_0x0289('0x33')](handleError(_0x1399fe,null));};exports[_0x0289('0x34')]=function(_0x10145f,_0x34daca){if(_0x10145f[_0x0289('0x35')]['id']){delete _0x10145f[_0x0289('0x35')]['id'];}return db[_0x0289('0x28')]['find']({'where':{'id':_0x10145f[_0x0289('0x36')]['id']}})[_0x0289('0x22')](handleEntityNotFound(_0x34daca,null))[_0x0289('0x22')](function(_0x414ed7){var _0x442199=_0x414ed7[_0x0289('0x37')]({'plain':!![]});return utilLicense[_0x0289('0x38')](_0x442199,_0x10145f[_0x0289('0x35')][_0x0289('0x39')]);})[_0x0289('0x22')](function(_0x29de79){if(!_0x29de79[_0x0289('0x3a')]){return saveUpdates(_0x10145f['body'],null);}return _0x29de79;})[_0x0289('0x22')](respondWithResult(_0x34daca,null))[_0x0289('0x33')](handleError(_0x34daca,null));}; \ No newline at end of file +var _0xc6be=['update','body','find','params','get','checkLicense','key','demo','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','reject','save','destroy','then','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','getLicense','catch'];(function(_0x3d0586,_0xfa8f33){var _0x6a060e=function(_0x5541cf){while(--_0x5541cf){_0x3d0586['push'](_0x3d0586['shift']());}};_0x6a060e(++_0xfa8f33);}(_0xc6be,0x143));var _0xec6b=function(_0x48a997,_0x21f56f){_0x48a997=_0x48a997-0x0;var _0x405e25=_0xc6be[_0x48a997];return _0x405e25;};'use strict';var pdf=require(_0xec6b('0x0'));var emlformat=require(_0xec6b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xec6b('0x2'));var jsonpatch=require(_0xec6b('0x3'));var rp=require(_0xec6b('0x4'));var moment=require(_0xec6b('0x5'));var BPromise=require(_0xec6b('0x6'));var Mustache=require('mustache');var util=require(_0xec6b('0x7'));var path=require(_0xec6b('0x8'));var sox=require(_0xec6b('0x9'));var csv=require(_0xec6b('0xa'));var ejs=require(_0xec6b('0xb'));var fs=require('fs');var _=require(_0xec6b('0xc'));var squel=require(_0xec6b('0xd'));var crypto=require(_0xec6b('0xe'));var jsforce=require(_0xec6b('0xf'));var deskjs=require(_0xec6b('0x10'));var toCsv=require(_0xec6b('0xa'));var querystring=require(_0xec6b('0x11'));var Papa=require(_0xec6b('0x12'));var Redis=require(_0xec6b('0x13'));var authService=require(_0xec6b('0x14'));var qs=require(_0xec6b('0x15'));var as=require(_0xec6b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec6b('0x17'))(_0xec6b('0x18'));var utils=require(_0xec6b('0x19'));var config=require(_0xec6b('0x1a'));var db=require(_0xec6b('0x1b'))['db'];function respondWithStatusCode(_0xc28ae3,_0x1a53d5){_0x1a53d5=_0x1a53d5||0xcc;return function(_0x176120){if(_0x176120){return _0xc28ae3[_0xec6b('0x1c')](_0x1a53d5);}return _0xc28ae3[_0xec6b('0x1d')](_0x1a53d5)[_0xec6b('0x1e')]();};}function respondWithResult(_0x1c1b4d,_0xe19a77){_0xe19a77=_0xe19a77||0xc8;return function(_0xf50bb1){if(_0xf50bb1){return _0x1c1b4d[_0xec6b('0x1d')](_0xe19a77)['json'](_0xf50bb1);}};}function respondWithFilteredResult(_0x489623,_0x3b8772){return function(_0x19db7b){if(_0x19db7b){var _0x2bdfc7=_0x19db7b['count'],_0x2e9088=_0x3b8772[_0xec6b('0x1f')],_0x20c155=_0x3b8772['offset']+_0x3b8772['limit'],_0x4671bf;if(_0x20c155>=_0x2bdfc7){_0x20c155=_0x2bdfc7;_0x4671bf=0xc8;}else{_0x4671bf=0xce;}_0x489623[_0xec6b('0x1d')](_0x4671bf);return _0x489623[_0xec6b('0x20')](_0xec6b('0x21'),_0x2e9088+'-'+_0x20c155+'/'+_0x2bdfc7)['json'](_0x19db7b);}return null;};}function patchUpdates(_0x56d3bd){return function(_0x5d2eb8){try{jsonpatch['apply'](_0x5d2eb8,_0x56d3bd,!![]);}catch(_0x5714f8){return BPromise[_0xec6b('0x22')](_0x5714f8);}return _0x5d2eb8[_0xec6b('0x23')]();};}function saveUpdates(_0x39467f,_0x3eadc6){return function(_0x1f63bb){if(_0x1f63bb){return _0x1f63bb['update'](_0x39467f)['then'](function(_0x57d386){return _0x57d386;});}return null;};}function removeEntity(_0x1b9677,_0x4773e8){return function(_0x1a1484){if(_0x1a1484){return _0x1a1484[_0xec6b('0x24')]()[_0xec6b('0x25')](function(){_0x1b9677['status'](0xcc)[_0xec6b('0x1e')]();});}};}function handleEntityNotFound(_0x1dff19,_0x5d697d){return function(_0x28329e){if(!_0x28329e){_0x1dff19[_0xec6b('0x1c')](0x194);}return _0x28329e;};}function handleError(_0x57741a,_0x367f65){_0x367f65=_0x367f65||0x1f4;return function(_0x4fc216){logger['error'](_0x4fc216[_0xec6b('0x26')]);if(_0x4fc216[_0xec6b('0x27')]){delete _0x4fc216[_0xec6b('0x27')];}_0x57741a[_0xec6b('0x1d')](_0x367f65)[_0xec6b('0x28')](_0x4fc216);};}var utilLicense=require(_0xec6b('0x29'));exports[_0xec6b('0x2a')]=function(_0x277bb5,_0x228bdb){var _0x585a7f={'raw':!![],'where':{'id':0x1}},_0x357e30={};_0x357e30[_0xec6b('0x2b')]=_[_0xec6b('0x2c')](db[_0xec6b('0x2d')][_0xec6b('0x2e')]);_0x357e30['query']=_[_0xec6b('0x2c')](_0x277bb5[_0xec6b('0x2f')]);_0x357e30[_0xec6b('0x30')]=_[_0xec6b('0x31')](_0x357e30[_0xec6b('0x2b')],_0x357e30['query']);_0x585a7f[_0xec6b('0x32')]=_['intersection'](_0x357e30[_0xec6b('0x2b')],qs[_0xec6b('0x33')](_0x277bb5['query'][_0xec6b('0x33')]));_0x585a7f[_0xec6b('0x32')]=_0x585a7f['attributes'][_0xec6b('0x34')]?_0x585a7f['attributes']:_0x357e30['model'];_0x585a7f=_['merge']({},_0x585a7f,_0x277bb5['options']);return utilLicense[_0xec6b('0x35')](_0x585a7f)['then'](respondWithResult(_0x228bdb,null))[_0xec6b('0x36')](handleError(_0x228bdb,null));};exports[_0xec6b('0x37')]=function(_0x271325,_0x43bd5a){if(_0x271325[_0xec6b('0x38')]['id']){delete _0x271325['body']['id'];}return db[_0xec6b('0x2d')][_0xec6b('0x39')]({'where':{'id':_0x271325[_0xec6b('0x3a')]['id']}})[_0xec6b('0x25')](handleEntityNotFound(_0x43bd5a,null))['then'](function(_0x41130d){var _0x29bbbd=_0x41130d[_0xec6b('0x3b')]({'plain':!![]});return utilLicense[_0xec6b('0x3c')](_0x29bbbd,_0x271325['body'][_0xec6b('0x3d')]);})[_0xec6b('0x25')](function(_0xb46756){if(!_0xb46756[_0xec6b('0x3e')]){return saveUpdates(_0x271325[_0xec6b('0x38')],null);}return _0xb46756;})[_0xec6b('0x25')](respondWithResult(_0x43bd5a,null))[_0xec6b('0x36')](handleError(_0x43bd5a,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index cb866a5..f7e86e0 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 _0x5f2f=['bluebird','request-promise','path','./license.attributes','exports','define','License','lodash','util','../../config/logger','api','moment'];(function(_0x44c229,_0xf2af91){var _0x706a13=function(_0x1e9a56){while(--_0x1e9a56){_0x44c229['push'](_0x44c229['shift']());}};_0x706a13(++_0xf2af91);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4570a3,_0x4f8d6e){_0x4570a3=_0x4570a3-0x0;var _0x1ddbd3=_0x5f2f[_0x4570a3];return _0x1ddbd3;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var logger=require(_0xf5f2('0x2'))(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var BPromise=require(_0xf5f2('0x5'));var rp=require(_0xf5f2('0x6'));var fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x1e1b18,_0x5d471b){var _0x3da8f2=function(_0x51fe71){while(--_0x51fe71){_0x1e1b18['push'](_0x1e1b18['shift']());}};_0x3da8f2(++_0x5d471b);}(_0xb10b,0x12a));var _0xbb10=function(_0x20e375,_0xdc0dde){_0x20e375=_0x20e375-0x0;var _0x55ac5d=_0xb10b[_0x20e375];return _0x55ac5d;};'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 diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index a4697a2..a21480a 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 _0x263f=['client','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x456b57,_0x58691a){var _0x18f49f=function(_0x1dc195){while(--_0x1dc195){_0x456b57['push'](_0x456b57['shift']());}};_0x18f49f(++_0x58691a);}(_0x263f,0x182));var _0xf263=function(_0x1d5861,_0x133594){_0x1d5861=_0x1d5861-0x0;var _0x298332=_0x263f[_0x1d5861];return _0x298332;};'use strict';var _=require(_0xf263('0x0'));var util=require(_0xf263('0x1'));var moment=require(_0xf263('0x2'));var BPromise=require(_0xf263('0x3'));var rs=require(_0xf263('0x4'));var fs=require('fs');var Redis=require(_0xf263('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf263('0x6'));var logger=require(_0xf263('0x7'))(_0xf263('0x8'));var config=require('../../config/environment');var jayson=require(_0xf263('0x9'));var client=jayson[_0xf263('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fded6,_0xa2b1b0,_0x9644ab){return new BPromise(function(_0xa2e77e,_0x16ff53){return client['request'](_0x4fded6,_0x9644ab)[_0xf263('0xb')](function(_0x26504c){logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));logger[_0xf263('0xf')](_0xf263('0x10'),_0xa2b1b0,'request\x20sent',JSON[_0xf263('0x11')](_0x26504c));if(_0x26504c['error']){if(_0x26504c[_0xf263('0x12')]['code']===0x1f4){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);return _0x16ff53(_0x26504c[_0xf263('0x12')][_0xf263('0x13')]);}logger[_0xf263('0x12')](_0xf263('0xd'),_0xa2b1b0,_0x26504c['error'][_0xf263('0x13')]);return _0xa2e77e(_0x26504c['error'][_0xf263('0x13')]);}else{logger[_0xf263('0xc')](_0xf263('0xd'),_0xa2b1b0,_0xf263('0xe'));_0xa2e77e(_0x26504c[_0xf263('0x14')][_0xf263('0x13')]);}})[_0xf263('0x15')](function(_0x57c655){logger['error'](_0xf263('0xd'),_0xa2b1b0,_0x57c655);_0x16ff53(_0x57c655);});});} \ No newline at end of file +var _0xfb5d=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','jayson/promise'];(function(_0x2cc056,_0x12b8e9){var _0x50baad=function(_0x4911f5){while(--_0x4911f5){_0x2cc056['push'](_0x2cc056['shift']());}};_0x50baad(++_0x12b8e9);}(_0xfb5d,0x11a));var _0xdfb5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfb5d[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xdfb5('0x0'));var util=require(_0xdfb5('0x1'));var moment=require(_0xdfb5('0x2'));var BPromise=require(_0xdfb5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfb5('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(_0xdfb5('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d6086,_0x1955dd,_0x164eb2){return new BPromise(function(_0x5c410c,_0x4d2dce){return client[_0xdfb5('0x6')](_0x2d6086,_0x164eb2)[_0xdfb5('0x7')](function(_0x2589d8){logger[_0xdfb5('0x8')](_0xdfb5('0x9'),_0x1955dd,_0xdfb5('0xa'));logger[_0xdfb5('0xb')](_0xdfb5('0xc'),_0x1955dd,'request\x20sent',JSON['stringify'](_0x2589d8));if(_0x2589d8[_0xdfb5('0xd')]){if(_0x2589d8[_0xdfb5('0xd')][_0xdfb5('0xe')]===0x1f4){logger[_0xdfb5('0xd')](_0xdfb5('0x9'),_0x1955dd,_0x2589d8['error'][_0xdfb5('0xf')]);return _0x4d2dce(_0x2589d8[_0xdfb5('0xd')]['message']);}logger[_0xdfb5('0xd')](_0xdfb5('0x9'),_0x1955dd,_0x2589d8[_0xdfb5('0xd')][_0xdfb5('0xf')]);return _0x5c410c(_0x2589d8[_0xdfb5('0xd')]['message']);}else{logger['info'](_0xdfb5('0x9'),_0x1955dd,'request\x20sent');_0x5c410c(_0x2589d8[_0xdfb5('0x10')][_0xdfb5('0xf')]);}})[_0xdfb5('0x11')](function(_0x637cba){logger[_0xdfb5('0xd')](_0xdfb5('0x9'),_0x1955dd,_0x637cba);_0x4d2dce(_0x637cba);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 5a735fd..7ee15d2 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 _0x0ca8=['getAnswers','getImap','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','/:id/out_servers','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','/:id/in_servers','removeImap','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x161ec8,_0x1402e1){var _0x25459e=function(_0x1c789e){while(--_0x1c789e){_0x161ec8['push'](_0x161ec8['shift']());}};_0x25459e(++_0x1402e1);}(_0x0ca8,0x175));var _0x80ca=function(_0xdc87a,_0x146acd){_0xdc87a=_0xdc87a-0x0;var _0x4c5ab=_0x0ca8[_0xdc87a];return _0x4c5ab;};'use strict';var multer=require(_0x80ca('0x0'));var util=require(_0x80ca('0x1'));var path=require(_0x80ca('0x2'));var timeout=require(_0x80ca('0x3'));var express=require(_0x80ca('0x4'));var router=express[_0x80ca('0x5')]();var auth=require(_0x80ca('0x6'));var interaction=require(_0x80ca('0x7'));var config=require('../../config/environment');var controller=require(_0x80ca('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x80ca('0x9')]);router[_0x80ca('0xa')](_0x80ca('0xb'),auth[_0x80ca('0xc')](),controller[_0x80ca('0xd')]);router['get'](_0x80ca('0xe'),auth[_0x80ca('0xc')](),controller[_0x80ca('0xf')]);router['get'](_0x80ca('0x10'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x11')]);router[_0x80ca('0xa')](_0x80ca('0x12'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x13')]);router[_0x80ca('0xa')]('/:id/in_servers',auth[_0x80ca('0xc')](),controller[_0x80ca('0x14')]);router[_0x80ca('0xa')]('/:id/out_servers',auth['isAuthenticated'](),controller['getSmtp']);router[_0x80ca('0xa')]('/:id/interactions',auth[_0x80ca('0xc')](),controller['getInteractions']);router[_0x80ca('0xa')]('/:id/applications',auth[_0x80ca('0xc')](),controller[_0x80ca('0x15')]);router[_0x80ca('0xa')](_0x80ca('0x16'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x17')]);router[_0x80ca('0xa')](_0x80ca('0x18'),auth['isAuthenticated'](),controller[_0x80ca('0x19')]);router[_0x80ca('0xa')](_0x80ca('0x1a'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x1b')]);router[_0x80ca('0x1c')](_0x80ca('0x10'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x1d')]);router['post'](_0x80ca('0x12'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x1e')]);router[_0x80ca('0x1c')]('/',auth[_0x80ca('0xc')](),controller[_0x80ca('0x1f')]);router['post']('/:id/in_servers',auth[_0x80ca('0xc')](),controller[_0x80ca('0x20')]);router[_0x80ca('0x1c')](_0x80ca('0x21'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x22')]);router[_0x80ca('0x1c')](_0x80ca('0x23'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x24')]);router[_0x80ca('0x1c')]('/:id/applications',auth['isAuthenticated'](),controller[_0x80ca('0x25')]);router['post'](_0x80ca('0x26'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x27')]);router[_0x80ca('0x1c')](_0x80ca('0x1a'),auth['isAuthenticated'](),controller[_0x80ca('0x28')]);router[_0x80ca('0x29')](_0x80ca('0xe'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x2a')]);router[_0x80ca('0x2b')](_0x80ca('0x10'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x80ca('0x2b')](_0x80ca('0x12'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x2c')]);router[_0x80ca('0x2b')](_0x80ca('0x2d'),auth[_0x80ca('0xc')](),controller[_0x80ca('0x2e')]);router[_0x80ca('0x2b')](_0x80ca('0x21'),auth[_0x80ca('0xc')](),controller['removeSmtp']);router['delete'](_0x80ca('0xe'),auth[_0x80ca('0xc')](),controller['destroy']);router['delete']('/:id/users',auth[_0x80ca('0xc')](),controller[_0x80ca('0x2f')]);module[_0x80ca('0x30')]=router; \ No newline at end of file +var _0x226c=['addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','delete','removeAnswers','removeSmtp','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp'];(function(_0x5a4c93,_0x283aa8){var _0x421ff4=function(_0x1afb30){while(--_0x1afb30){_0x5a4c93['push'](_0x5a4c93['shift']());}};_0x421ff4(++_0x283aa8);}(_0x226c,0x14e));var _0xc226=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x226c[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xc226('0x0'));var util=require(_0xc226('0x1'));var path=require(_0xc226('0x2'));var timeout=require('connect-timeout');var express=require(_0xc226('0x3'));var router=express[_0xc226('0x4')]();var auth=require(_0xc226('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc226('0x6'));var controller=require(_0xc226('0x7'));router[_0xc226('0x8')]('/',auth[_0xc226('0x9')](),controller[_0xc226('0xa')]);router['get'](_0xc226('0xb'),auth[_0xc226('0x9')](),controller[_0xc226('0xc')]);router[_0xc226('0x8')]('/:id',auth[_0xc226('0x9')](),controller['show']);router[_0xc226('0x8')](_0xc226('0xd'),auth[_0xc226('0x9')](),controller[_0xc226('0xe')]);router[_0xc226('0x8')](_0xc226('0xf'),auth[_0xc226('0x9')](),controller[_0xc226('0x10')]);router['get'](_0xc226('0x11'),auth[_0xc226('0x9')](),controller['getImap']);router[_0xc226('0x8')](_0xc226('0x12'),auth[_0xc226('0x9')](),controller[_0xc226('0x13')]);router[_0xc226('0x8')](_0xc226('0x14'),auth[_0xc226('0x9')](),controller[_0xc226('0x15')]);router[_0xc226('0x8')](_0xc226('0x16'),auth['isAuthenticated'](),controller[_0xc226('0x17')]);router[_0xc226('0x8')]('/:id/messages',auth[_0xc226('0x9')](),controller[_0xc226('0x18')]);router[_0xc226('0x8')](_0xc226('0x19'),auth[_0xc226('0x9')](),controller['verifySmtp']);router[_0xc226('0x8')](_0xc226('0x1a'),auth[_0xc226('0x9')](),controller[_0xc226('0x1b')]);router[_0xc226('0x1c')](_0xc226('0xd'),auth['isAuthenticated'](),controller[_0xc226('0x1d')]);router[_0xc226('0x1c')](_0xc226('0xf'),auth[_0xc226('0x9')](),controller[_0xc226('0x1e')]);router[_0xc226('0x1c')]('/',auth['isAuthenticated'](),controller[_0xc226('0x1f')]);router[_0xc226('0x1c')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xc226('0x20')]);router[_0xc226('0x1c')](_0xc226('0x12'),auth['isAuthenticated'](),controller[_0xc226('0x21')]);router[_0xc226('0x1c')](_0xc226('0x14'),auth[_0xc226('0x9')](),controller[_0xc226('0x22')]);router['post']('/:id/applications',auth[_0xc226('0x9')](),controller[_0xc226('0x23')]);router[_0xc226('0x1c')](_0xc226('0x24'),auth['isAuthenticated'](),controller[_0xc226('0x25')]);router[_0xc226('0x1c')](_0xc226('0x1a'),auth[_0xc226('0x9')](),controller[_0xc226('0x26')]);router[_0xc226('0x27')](_0xc226('0x28'),auth[_0xc226('0x9')](),controller['update']);router['delete'](_0xc226('0xd'),auth[_0xc226('0x9')](),controller['removeDispositions']);router[_0xc226('0x29')](_0xc226('0xf'),auth[_0xc226('0x9')](),controller[_0xc226('0x2a')]);router[_0xc226('0x29')](_0xc226('0x11'),auth[_0xc226('0x9')](),controller['removeImap']);router['delete'](_0xc226('0x12'),auth[_0xc226('0x9')](),controller[_0xc226('0x2b')]);router[_0xc226('0x29')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xc226('0x1a'),auth[_0xc226('0x9')](),controller[_0xc226('0x2c')]);module[_0xc226('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index e98a8ba..417c053 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 _0x94e9=['TEXT','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','STRING','BOOLEAN'];(function(_0x4b3636,_0x598e0d){var _0x5cfefc=function(_0x4bd820){while(--_0x4bd820){_0x4b3636['push'](_0x4b3636['shift']());}};_0x5cfefc(++_0x598e0d);}(_0x94e9,0x1da));var _0x994e=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x94e9[_0x413b4d];return _0x8b810a;};'use strict';var Sequelize=require('sequelize');module[_0x994e('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x994e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x994e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x994e('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x994e('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x994e('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x994e('0x3')],'defaultValue':function(){return _0x994e('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x994e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x994e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x994e('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x994e('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x994e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x994e('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x994e('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3e5aa1){if(!_0x3e5aa1)this['setDataValue'](_0x994e('0x6'),null);this[_0x994e('0x7')](_0x994e('0x8'),_0x3e5aa1);}}}; \ No newline at end of file +var _0xa721=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x23f1fa,_0x5390e0){var _0x186716=function(_0x2b13fc){while(--_0x2b13fc){_0x23f1fa['push'](_0x23f1fa['shift']());}};_0x186716(++_0x5390e0);}(_0xa721,0x145));var _0x1a72=function(_0x5edd35,_0x10ebbe){_0x5edd35=_0x5edd35-0x0;var _0x170719=_0xa721[_0x5edd35];return _0x170719;};'use strict';var Sequelize=require(_0x1a72('0x0'));module[_0x1a72('0x1')]={'description':{'type':Sequelize[_0x1a72('0x2')]},'name':{'type':Sequelize[_0x1a72('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x1a72('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x1a72('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x1a72('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x1a72('0x2')],'allowNull':![],'defaultValue':_0x1a72('0x5')},'fontSize':{'type':Sequelize[_0x1a72('0x6')](0x2)[_0x1a72('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x1a72('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1a72('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1a72('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1a72('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a72('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1a72('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a72('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x1a72('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1a72('0x9'),'set':function(_0x55fca9){if(!_0x55fca9)this[_0x1a72('0xa')](_0x1a72('0xb'),null);this[_0x1a72('0xa')](_0x1a72('0xc'),_0x55fca9);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index a082130..c3fda58 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 _0x5b19=['options','removeAnswers','create','ListId','isNil','active','description','cservice','cauthentication','user','pass','cpassword','authentication','host','port','service','password','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','MailInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','transaction','MailApplication','priority','getApplications','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','DESC','from','%s\x20<%s>','email','attachments','join','root','basename','auth','secure','sendMail','List\x20not\x20found','messageId','subject','attach','out','format','Messages','verifySmtp','VerifySmtp','addAgents','omit','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','limit','Content-Range','json','apply','save','get','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','params','Pause','find','update','body','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','ids','CannedAnswer'];(function(_0x3e85eb,_0x4e4823){var _0x28817a=function(_0x344e53){while(--_0x344e53){_0x3e85eb['push'](_0x3e85eb['shift']());}};_0x28817a(++_0x4e4823);}(_0x5b19,0x1ce));var _0x95b1=function(_0x5b9fe0,_0x1419f6){_0x5b9fe0=_0x5b9fe0-0x0;var _0x555985=_0x5b19[_0x5b9fe0];return _0x555985;};'use strict';var pdf=require(_0x95b1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x95b1('0x1'));var zipdir=require(_0x95b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x95b1('0x3'));var moment=require(_0x95b1('0x4'));var BPromise=require(_0x95b1('0x5'));var Mustache=require(_0x95b1('0x6'));var util=require(_0x95b1('0x7'));var path=require(_0x95b1('0x8'));var sox=require(_0x95b1('0x9'));var csv=require('to-csv');var ejs=require(_0x95b1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x95b1('0xb'));var crypto=require(_0x95b1('0xc'));var jsforce=require(_0x95b1('0xd'));var deskjs=require(_0x95b1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x95b1('0xf'));var Papa=require(_0x95b1('0x10'));var Redis=require(_0x95b1('0x11'));var authService=require(_0x95b1('0x12'));var qs=require(_0x95b1('0x13'));var as=require(_0x95b1('0x14'));var hardwareService=require(_0x95b1('0x15'));var logger=require(_0x95b1('0x16'))(_0x95b1('0x17'));var utils=require(_0x95b1('0x18'));var config=require(_0x95b1('0x19'));var db=require(_0x95b1('0x1a'))['db'];config[_0x95b1('0x1b')]=_[_0x95b1('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x95b1('0x1d'))(new Redis(config['redis']));require(_0x95b1('0x1e'))['register'](socket);var jayson=require(_0x95b1('0x1f'));var client=jayson[_0x95b1('0x20')][_0x95b1('0x21')]({'port':0x232b});function checkPasswordPattern(_0x754a27,_0x51a1a8,_0x37e05b){if(_0x37e05b){var _0x3ddf56=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ddf56[_0x95b1('0x22')](_0x51a1a8)){return _0x754a27;}else{throw new db[(_0x95b1('0x23'))][(_0x95b1('0x24'))]('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 _0x754a27;}}function respondWithRpcPromise(_0x558d49,_0x4b59f5,_0x4647c2,_0x282da1){return new BPromise(function(_0x5921ab,_0x180835){var _0x2bcaa2=_0x282da1||client;return _0x2bcaa2[_0x95b1('0x25')](_0x558d49,_0x4647c2)[_0x95b1('0x26')](function(_0x4aa2a7){logger[_0x95b1('0x27')](_0x95b1('0x28'),_0x4b59f5,_0x95b1('0x29'));logger[_0x95b1('0x2a')](_0x95b1('0x2b'),_0x4b59f5,_0x95b1('0x29'),JSON[_0x95b1('0x2c')](_0x4aa2a7));if(_0x4aa2a7[_0x95b1('0x2d')]){if(_0x4aa2a7[_0x95b1('0x2d')][_0x95b1('0x2e')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x4b59f5,_0x4aa2a7[_0x95b1('0x2d')]['message']);return _0x180835(_0x4aa2a7[_0x95b1('0x2d')][_0x95b1('0x2f')]);}logger['error'](_0x95b1('0x28'),_0x4b59f5,_0x4aa2a7[_0x95b1('0x2d')][_0x95b1('0x2f')]);return _0x5921ab(_0x4aa2a7[_0x95b1('0x2d')][_0x95b1('0x2f')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x4b59f5,_0x95b1('0x29'));_0x5921ab(_0x4aa2a7['result'][_0x95b1('0x2f')]);}})[_0x95b1('0x30')](function(_0x58aa1c){logger['error'](_0x95b1('0x28'),_0x4b59f5,_0x58aa1c);_0x180835(_0x58aa1c);});});}function respondWithStatusCode(_0x915727,_0x52340b){_0x52340b=_0x52340b||0xcc;return function(_0x3236e1){if(_0x3236e1){return _0x915727['sendStatus'](_0x52340b);}return _0x915727[_0x95b1('0x31')](_0x52340b)['end']();};}function respondWithResult(_0x28eb5a,_0x52d1bc){_0x52d1bc=_0x52d1bc||0xc8;return function(_0x7fd4ab){if(_0x7fd4ab){return _0x28eb5a['status'](_0x52d1bc)['json'](_0x7fd4ab);}};}function respondWithFilteredResult(_0x33c8a9,_0x13c07){return function(_0x36c47d){if(_0x36c47d){var _0x1c64ea=_0x36c47d['count'],_0x5c1611=_0x13c07[_0x95b1('0x32')],_0x45d997=_0x13c07[_0x95b1('0x32')]+_0x13c07[_0x95b1('0x33')],_0x408f0d;if(_0x45d997>=_0x1c64ea){_0x45d997=_0x1c64ea;_0x408f0d=0xc8;}else{_0x408f0d=0xce;}_0x33c8a9['status'](_0x408f0d);return _0x33c8a9['set'](_0x95b1('0x34'),_0x5c1611+'-'+_0x45d997+'/'+_0x1c64ea)[_0x95b1('0x35')](_0x36c47d);}return null;};}function patchUpdates(_0x3d3df9){return function(_0x3e6482){try{jsonpatch[_0x95b1('0x36')](_0x3e6482,_0x3d3df9,!![]);}catch(_0x29006b){return BPromise['reject'](_0x29006b);}return _0x3e6482[_0x95b1('0x37')]();};}function saveUpdates(_0x776028,_0x241eda){return function(_0x997f67){if(_0x997f67){return _0x997f67['update'](_0x776028)['then'](function(_0x2e99dd){return _0x2e99dd;});}return null;};}function removeEntity(_0x298518,_0x231758){return function(_0x51cf1b){if(_0x51cf1b){return _0x51cf1b['destroy']()[_0x95b1('0x26')](function(){var _0x55102f=_0x51cf1b[_0x95b1('0x38')]({'plain':!![]});var _0x11c9fc='MailAccounts';return db[_0x95b1('0x39')][_0x95b1('0x3a')]({'where':{'type':_0x11c9fc,'resourceId':_0x55102f['id']}})[_0x95b1('0x26')](function(){return _0x51cf1b;});})[_0x95b1('0x26')](function(){_0x298518[_0x95b1('0x31')](0xcc)[_0x95b1('0x3b')]();});}};}function handleEntityNotFound(_0xef6237,_0x45f958){return function(_0x44c03f){if(!_0x44c03f){_0xef6237[_0x95b1('0x3c')](0x194);}return _0x44c03f;};}function handleError(_0x213d0a,_0x5b67ce){_0x5b67ce=_0x5b67ce||0x1f4;return function(_0x21b55a){logger[_0x95b1('0x2d')](_0x21b55a[_0x95b1('0x3d')]);if(_0x21b55a[_0x95b1('0x3e')]){delete _0x21b55a[_0x95b1('0x3e')];}_0x213d0a[_0x95b1('0x31')](_0x5b67ce)[_0x95b1('0x3f')](_0x21b55a);};}exports[_0x95b1('0x40')]=function(_0x282915,_0x4be40f){var _0x1f9806={'include':[{'model':db[_0x95b1('0x41')],'as':_0x95b1('0x42')},{'model':db[_0x95b1('0x43')],'as':_0x95b1('0x44')},{'model':db['Pause'],'as':_0x95b1('0x45')}]},_0x396171={},_0x208e7e={'count':0x0,'rows':[]};var _0x107ef1=_[_0x95b1('0x46')](db[_0x95b1('0x47')]['rawAttributes'],function(_0x16ba2a){return{'name':_0x16ba2a[_0x95b1('0x48')],'type':_0x16ba2a[_0x95b1('0x49')][_0x95b1('0x4a')]};});_0x396171[_0x95b1('0x4b')]=_[_0x95b1('0x46')](_0x107ef1,_0x95b1('0x3e'));_0x396171[_0x95b1('0x4c')]=_[_0x95b1('0x4d')](_0x282915[_0x95b1('0x4c')]);_0x396171[_0x95b1('0x4e')]=_[_0x95b1('0x4f')](_0x396171[_0x95b1('0x4b')],_0x396171[_0x95b1('0x4c')]);_0x1f9806[_0x95b1('0x50')]=_[_0x95b1('0x4f')](_0x396171[_0x95b1('0x4b')],qs[_0x95b1('0x51')](_0x282915[_0x95b1('0x4c')][_0x95b1('0x51')]));_0x1f9806[_0x95b1('0x50')]=_0x1f9806[_0x95b1('0x50')][_0x95b1('0x52')]?_0x1f9806['attributes']:_0x396171['model'];if(!_0x282915['query'][_0x95b1('0x53')](_0x95b1('0x54'))){_0x1f9806[_0x95b1('0x33')]=qs['limit'](_0x282915[_0x95b1('0x4c')][_0x95b1('0x33')]);_0x1f9806['offset']=qs['offset'](_0x282915['query'][_0x95b1('0x32')]);}_0x1f9806[_0x95b1('0x55')]=qs[_0x95b1('0x56')](_0x282915['query'][_0x95b1('0x56')]);_0x1f9806[_0x95b1('0x57')]=qs[_0x95b1('0x4e')](_[_0x95b1('0x58')](_0x282915[_0x95b1('0x4c')],_0x396171[_0x95b1('0x4e')]),_0x107ef1);if(_0x282915[_0x95b1('0x4c')][_0x95b1('0x59')]){_0x1f9806['where']=_[_0x95b1('0x5a')](_0x1f9806[_0x95b1('0x57')],{'$or':_[_0x95b1('0x46')](_0x107ef1,function(_0x4d5827){if(_0x4d5827['type']!=='VIRTUAL'){var _0x4bed70={};_0x4bed70[_0x4d5827['name']]={'$like':'%'+_0x282915[_0x95b1('0x4c')][_0x95b1('0x59')]+'%'};return _0x4bed70;}})});}_0x1f9806=_['merge']({},_0x1f9806,_0x282915['options']);var _0x52f752={'where':_0x1f9806[_0x95b1('0x57')]};return db[_0x95b1('0x47')]['count'](_0x52f752)[_0x95b1('0x26')](function(_0x5aa4ae){_0x208e7e[_0x95b1('0x5b')]=_0x5aa4ae;if(_0x282915[_0x95b1('0x4c')][_0x95b1('0x5c')]){_0x1f9806[_0x95b1('0x5d')]=[{'all':!![]}];}return db[_0x95b1('0x47')][_0x95b1('0x5e')](_0x1f9806);})['then'](function(_0xeae8aa){_0x208e7e[_0x95b1('0x5f')]=_0xeae8aa;return _0x208e7e;})[_0x95b1('0x26')](respondWithFilteredResult(_0x4be40f,_0x1f9806))['catch'](handleError(_0x4be40f,null));};exports['show']=function(_0x2421c9,_0x4502cb){var _0x1587b8={'raw':![],'where':{'id':_0x2421c9[_0x95b1('0x60')]['id']},'include':[{'model':db[_0x95b1('0x41')],'as':_0x95b1('0x42')},{'model':db[_0x95b1('0x43')],'as':'Smtp'},{'model':db[_0x95b1('0x61')],'as':_0x95b1('0x45')}]},_0x19ada8={};_0x19ada8[_0x95b1('0x4b')]=_[_0x95b1('0x4d')](db[_0x95b1('0x47')]['rawAttributes']);_0x19ada8[_0x95b1('0x4c')]=_[_0x95b1('0x4d')](_0x2421c9[_0x95b1('0x4c')]);_0x19ada8[_0x95b1('0x4e')]=_[_0x95b1('0x4f')](_0x19ada8[_0x95b1('0x4b')],_0x19ada8[_0x95b1('0x4c')]);_0x1587b8[_0x95b1('0x50')]=_[_0x95b1('0x4f')](_0x19ada8[_0x95b1('0x4b')],qs[_0x95b1('0x51')](_0x2421c9['query'][_0x95b1('0x51')]));_0x1587b8[_0x95b1('0x50')]=_0x1587b8[_0x95b1('0x50')][_0x95b1('0x52')]?_0x1587b8[_0x95b1('0x50')]:_0x19ada8['model'];if(_0x2421c9[_0x95b1('0x4c')]['includeAll']){_0x1587b8[_0x95b1('0x5d')]=[{'all':!![]}];}_0x1587b8=_[_0x95b1('0x5a')]({},_0x1587b8,_0x2421c9['options']);return db[_0x95b1('0x47')][_0x95b1('0x62')](_0x1587b8)[_0x95b1('0x26')](handleEntityNotFound(_0x4502cb,null))[_0x95b1('0x26')](respondWithResult(_0x4502cb,null))[_0x95b1('0x30')](handleError(_0x4502cb,null));};exports[_0x95b1('0x63')]=function(_0x20d8fb,_0x2b0bdb){if(_0x20d8fb[_0x95b1('0x64')]['id']){delete _0x20d8fb['body']['id'];}return db['MailAccount'][_0x95b1('0x62')]({'where':{'id':_0x20d8fb['params']['id']},'include':[{'model':db[_0x95b1('0x41')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x95b1('0x44')},{'model':db['Pause'],'as':_0x95b1('0x45')}]})['then'](handleEntityNotFound(_0x2b0bdb,null))['then'](saveUpdates(_0x20d8fb[_0x95b1('0x64')],null))['then'](function(_0x57d943){if(_0x57d943&&_0x20d8fb['body'][_0x95b1('0x42')]){return db[_0x95b1('0x41')][_0x95b1('0x63')](_0x20d8fb[_0x95b1('0x64')][_0x95b1('0x42')],{'where':{'MailAccountId':_0x57d943['id']}})[_0x95b1('0x26')](function(){return _0x57d943;});}return _0x57d943;})[_0x95b1('0x26')](function(_0x169e2c){if(_0x169e2c&&_0x20d8fb[_0x95b1('0x64')]['Smtp']){return db['MailServerOut'][_0x95b1('0x63')](_0x20d8fb[_0x95b1('0x64')]['Smtp'],{'where':{'MailAccountId':_0x169e2c['id']}})[_0x95b1('0x26')](function(){return _0x169e2c;});}return _0x169e2c;})[_0x95b1('0x26')](respondWithResult(_0x2b0bdb,null))[_0x95b1('0x30')](handleError(_0x2b0bdb,null));};exports[_0x95b1('0x65')]=function(_0x5749f8,_0x3afbf0){return db[_0x95b1('0x47')][_0x95b1('0x65')]()[_0x95b1('0x26')](respondWithResult(_0x3afbf0,null))[_0x95b1('0x30')](handleError(_0x3afbf0,null));};exports[_0x95b1('0x66')]=function(_0x56d5d7,_0xf8304c,_0x4e63f6){if(_0x56d5d7[_0x95b1('0x64')]['id']){delete _0x56d5d7['body']['id'];}return db[_0x95b1('0x47')][_0x95b1('0x62')]({'where':{'id':_0x56d5d7[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0xf8304c,null))[_0x95b1('0x26')](function(_0x3708b2){if(_0x3708b2){_0x56d5d7['body'][_0x95b1('0x67')]=_0x3708b2['id'];return db[_0x95b1('0x68')]['create'](_0x56d5d7[_0x95b1('0x64')]);}})[_0x95b1('0x26')](respondWithResult(_0xf8304c,null))['catch'](handleError(_0xf8304c,null));};exports[_0x95b1('0x69')]=function(_0x18811c,_0x4bfeba,_0x36bb04){var _0x3faced={'raw':![],'where':{}};var _0x4c2953={};var _0x502143={'count':0x0,'rows':[]};return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0x18811c[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x4bfeba,null))[_0x95b1('0x26')](function(_0x12afaf){if(_0x12afaf){_0x4c2953[_0x95b1('0x4b')]=_[_0x95b1('0x4d')](db[_0x95b1('0x68')][_0x95b1('0x6b')]);_0x4c2953[_0x95b1('0x4c')]=_['keys'](_0x18811c[_0x95b1('0x4c')]);_0x4c2953[_0x95b1('0x4e')]=_[_0x95b1('0x4f')](_0x4c2953[_0x95b1('0x4b')],_0x4c2953[_0x95b1('0x4c')]);_0x3faced['attributes']=_['intersection'](_0x4c2953[_0x95b1('0x4b')],qs[_0x95b1('0x51')](_0x18811c[_0x95b1('0x4c')][_0x95b1('0x51')]));_0x3faced[_0x95b1('0x50')]=_0x3faced['attributes']['length']?_0x3faced['attributes']:_0x4c2953[_0x95b1('0x4b')];if(!_0x18811c['query']['hasOwnProperty'](_0x95b1('0x54'))){_0x3faced[_0x95b1('0x33')]=qs[_0x95b1('0x33')](_0x18811c[_0x95b1('0x4c')][_0x95b1('0x33')]);_0x3faced[_0x95b1('0x32')]=qs['offset'](_0x18811c[_0x95b1('0x4c')][_0x95b1('0x32')]);}_0x3faced[_0x95b1('0x55')]=qs[_0x95b1('0x56')](_0x18811c[_0x95b1('0x4c')]['sort']);_0x3faced[_0x95b1('0x57')]=qs[_0x95b1('0x4e')](_[_0x95b1('0x58')](_0x18811c[_0x95b1('0x4c')],_0x4c2953[_0x95b1('0x4e')]));_0x3faced['where'][_0x95b1('0x67')]=_0x12afaf['id'];if(_0x18811c['query'][_0x95b1('0x59')]){_0x3faced[_0x95b1('0x57')]=_[_0x95b1('0x5a')](_0x3faced[_0x95b1('0x57')],{'$or':_['map'](_0x3faced['attributes'],function(_0x179575){var _0x508e8d={};_0x508e8d[_0x179575]={'$like':'%'+_0x18811c[_0x95b1('0x4c')][_0x95b1('0x59')]+'%'};return _0x508e8d;})});}_0x3faced=_[_0x95b1('0x5a')]({},_0x3faced,_0x18811c['options']);return db[_0x95b1('0x68')][_0x95b1('0x5b')]({'where':_0x3faced[_0x95b1('0x57')]})[_0x95b1('0x26')](function(_0x503e42){_0x502143[_0x95b1('0x5b')]=_0x503e42;if(_0x18811c[_0x95b1('0x4c')][_0x95b1('0x5c')]){_0x3faced['include']=[{'all':!![]}];}return db[_0x95b1('0x68')][_0x95b1('0x5e')](_0x3faced);})[_0x95b1('0x26')](function(_0x4ff0d5){_0x502143[_0x95b1('0x5f')]=_0x4ff0d5;return _0x502143;});}})[_0x95b1('0x26')](respondWithFilteredResult(_0x4bfeba,_0x3faced))[_0x95b1('0x30')](handleError(_0x4bfeba,null));};exports[_0x95b1('0x6c')]=function(_0x37efd5,_0x3b32e9,_0x1ef239){return db[_0x95b1('0x47')]['find']({'where':{'id':_0x37efd5[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x3b32e9,null))[_0x95b1('0x26')](function(_0x40ca4b){if(_0x40ca4b){return _0x40ca4b[_0x95b1('0x6c')](_0x37efd5['query'][_0x95b1('0x6d')]);}})[_0x95b1('0x26')](respondWithStatusCode(_0x3b32e9,null))['catch'](handleError(_0x3b32e9,null));};exports['addAnswer']=function(_0x127394,_0x1e4221,_0x386007){if(_0x127394[_0x95b1('0x64')]['id']){delete _0x127394[_0x95b1('0x64')]['id'];}return db[_0x95b1('0x47')][_0x95b1('0x62')]({'where':{'id':_0x127394[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x1e4221,null))[_0x95b1('0x26')](function(_0x427c8b){if(_0x427c8b){_0x127394[_0x95b1('0x64')][_0x95b1('0x67')]=_0x427c8b['id'];return db[_0x95b1('0x6e')]['create'](_0x127394[_0x95b1('0x64')]);}})[_0x95b1('0x26')](respondWithResult(_0x1e4221,null))[_0x95b1('0x30')](handleError(_0x1e4221,null));};exports['getAnswers']=function(_0x47b455,_0x510831,_0x4fef89){var _0x2f8fdf={'raw':![],'where':{}};var _0x21da89={};var _0x222134={'count':0x0,'rows':[]};return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0x47b455[_0x95b1('0x60')]['id']}})['then'](handleEntityNotFound(_0x510831,null))['then'](function(_0x23c7c9){if(_0x23c7c9){_0x21da89[_0x95b1('0x4b')]=_['keys'](db[_0x95b1('0x6e')][_0x95b1('0x6b')]);_0x21da89[_0x95b1('0x4c')]=_[_0x95b1('0x4d')](_0x47b455[_0x95b1('0x4c')]);_0x21da89['filters']=_[_0x95b1('0x4f')](_0x21da89[_0x95b1('0x4b')],_0x21da89['query']);_0x2f8fdf[_0x95b1('0x50')]=_[_0x95b1('0x4f')](_0x21da89['model'],qs[_0x95b1('0x51')](_0x47b455['query'][_0x95b1('0x51')]));_0x2f8fdf[_0x95b1('0x50')]=_0x2f8fdf[_0x95b1('0x50')][_0x95b1('0x52')]?_0x2f8fdf['attributes']:_0x21da89[_0x95b1('0x4b')];if(!_0x47b455[_0x95b1('0x4c')][_0x95b1('0x53')]('nolimit')){_0x2f8fdf[_0x95b1('0x33')]=qs[_0x95b1('0x33')](_0x47b455['query']['limit']);_0x2f8fdf['offset']=qs['offset'](_0x47b455[_0x95b1('0x4c')][_0x95b1('0x32')]);}_0x2f8fdf[_0x95b1('0x55')]=qs['sort'](_0x47b455['query'][_0x95b1('0x56')]);_0x2f8fdf[_0x95b1('0x57')]=qs[_0x95b1('0x4e')](_[_0x95b1('0x58')](_0x47b455[_0x95b1('0x4c')],_0x21da89['filters']));_0x2f8fdf[_0x95b1('0x57')][_0x95b1('0x67')]=_0x23c7c9['id'];if(_0x47b455[_0x95b1('0x4c')]['filter']){_0x2f8fdf[_0x95b1('0x57')]=_['merge'](_0x2f8fdf[_0x95b1('0x57')],{'$or':_[_0x95b1('0x46')](_0x2f8fdf[_0x95b1('0x50')],function(_0x245c44){var _0x522867={};_0x522867[_0x245c44]={'$like':'%'+_0x47b455[_0x95b1('0x4c')][_0x95b1('0x59')]+'%'};return _0x522867;})});}_0x2f8fdf=_[_0x95b1('0x5a')]({},_0x2f8fdf,_0x47b455[_0x95b1('0x6f')]);return db[_0x95b1('0x6e')]['count']({'where':_0x2f8fdf['where']})[_0x95b1('0x26')](function(_0x4db022){_0x222134[_0x95b1('0x5b')]=_0x4db022;if(_0x47b455['query']['includeAll']){_0x2f8fdf[_0x95b1('0x5d')]=[{'all':!![]}];}return db[_0x95b1('0x6e')]['findAll'](_0x2f8fdf);})[_0x95b1('0x26')](function(_0x427aeb){_0x222134[_0x95b1('0x5f')]=_0x427aeb;return _0x222134;});}})[_0x95b1('0x26')](respondWithFilteredResult(_0x510831,_0x2f8fdf))[_0x95b1('0x30')](handleError(_0x510831,null));};exports[_0x95b1('0x70')]=function(_0x5225b6,_0x362737,_0x14283f){return db[_0x95b1('0x47')][_0x95b1('0x62')]({'where':{'id':_0x5225b6[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x362737,null))[_0x95b1('0x26')](function(_0x5b1fb0){if(_0x5b1fb0){return _0x5b1fb0[_0x95b1('0x70')](_0x5225b6[_0x95b1('0x4c')]['ids']);}})[_0x95b1('0x26')](respondWithStatusCode(_0x362737,null))[_0x95b1('0x30')](handleError(_0x362737,null));};exports[_0x95b1('0x71')]=function(_0x5c3c6c,_0x33492b){var _0x547f54={'name':_0x5c3c6c['body'][_0x95b1('0x3e')],'key':_0x5c3c6c['body']['key'],'email':_0x5c3c6c[_0x95b1('0x64')]['email'],'ListId':_0x5c3c6c['body'][_0x95b1('0x72')],'active':!_[_0x95b1('0x73')](_0x5c3c6c['body'][_0x95b1('0x74')])?_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x74')]:!![],'description':_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x75')]||null,'Imap':{},'Smtp':{}};if(_[_0x95b1('0x73')](_0x5c3c6c['body'][_0x95b1('0x76')])){if(_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x77')]){_0x547f54[_0x95b1('0x42')][_0x95b1('0x78')]=_0x547f54[_0x95b1('0x44')][_0x95b1('0x78')]=_0x5c3c6c[_0x95b1('0x64')]['cuser'];_0x547f54[_0x95b1('0x42')]['password']=_0x547f54['Smtp'][_0x95b1('0x79')]=_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x7a')];}else{_0x547f54[_0x95b1('0x42')][_0x95b1('0x7b')]=_0x547f54[_0x95b1('0x44')][_0x95b1('0x7b')]=![];}_0x547f54[_0x95b1('0x42')][_0x95b1('0x7c')]=_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x42')][_0x95b1('0x7c')];_0x547f54[_0x95b1('0x42')][_0x95b1('0x7d')]=_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x42')][_0x95b1('0x7d')];_0x547f54[_0x95b1('0x44')][_0x95b1('0x7c')]=_0x5c3c6c['body'][_0x95b1('0x44')][_0x95b1('0x7c')];_0x547f54[_0x95b1('0x44')]['port']=_0x5c3c6c['body'][_0x95b1('0x44')]['port'];}else{_0x547f54[_0x95b1('0x42')][_0x95b1('0x7e')]=_0x547f54[_0x95b1('0x44')][_0x95b1('0x7e')]=_0x5c3c6c['body']['cservice'];_0x547f54['Imap']['user']=_0x547f54[_0x95b1('0x44')][_0x95b1('0x78')]=_0x5c3c6c[_0x95b1('0x64')]['cuser'];_0x547f54['Imap'][_0x95b1('0x7f')]=_0x547f54[_0x95b1('0x44')][_0x95b1('0x79')]=_0x5c3c6c[_0x95b1('0x64')][_0x95b1('0x7a')];}return db[_0x95b1('0x47')][_0x95b1('0x71')](_0x547f54,{'include':[{'model':db[_0x95b1('0x43')],'as':_0x95b1('0x44')},{'model':db[_0x95b1('0x41')],'as':_0x95b1('0x42')}]})['then'](function(_0x5c6944){var _0x567b63=_0x5c3c6c[_0x95b1('0x78')]['get']({'plain':!![]});if(!_0x567b63)throw new Error(_0x95b1('0x80'));if(_0x567b63['role']===_0x95b1('0x78')){var _0x47fc40=_0x5c6944['get']({'plain':!![]});return db[_0x95b1('0x81')][_0x95b1('0x62')]({'where':{'name':_0x95b1('0x82'),'userProfileId':_0x567b63[_0x95b1('0x83')]},'raw':!![]})[_0x95b1('0x26')](function(_0x4c9d40){if(_0x4c9d40&&_0x4c9d40[_0x95b1('0x84')]===0x0){return db['UserProfileResource'][_0x95b1('0x71')]({'name':_0x47fc40[_0x95b1('0x3e')],'resourceId':_0x47fc40['id'],'type':_0x4c9d40[_0x95b1('0x3e')],'sectionId':_0x4c9d40['id']},{})['then'](function(){return _0x5c6944;});}else{return _0x5c6944;}})[_0x95b1('0x30')](function(_0x1b7e8c){logger[_0x95b1('0x2d')](_0x95b1('0x85'),_0x1b7e8c);throw _0x1b7e8c;});}return _0x5c6944;})[_0x95b1('0x26')](respondWithResult(_0x33492b,0xc9))[_0x95b1('0x30')](handleError(_0x33492b,null));};exports[_0x95b1('0x86')]=function(_0x5d80b4,_0x6bad54,_0x5bd56b){return db[_0x95b1('0x47')]['findOne']({'where':{'id':_0x5d80b4[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x6bad54,null))[_0x95b1('0x26')](function(_0xd54ff9){if(_0xd54ff9){return _0xd54ff9[_0x95b1('0x86')]();}return null;})[_0x95b1('0x26')](respondWithResult(_0x6bad54,null))[_0x95b1('0x30')](handleError(_0x6bad54,null));};exports[_0x95b1('0x87')]=function(_0x197533,_0x170508,_0x184540){if(_0x197533[_0x95b1('0x64')]['id']){delete _0x197533['body']['id'];}return db[_0x95b1('0x47')]['find']({'where':{'id':_0x197533['params']['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x170508,null))['then'](function(_0x3c2053){if(_0x3c2053){_0x197533[_0x95b1('0x64')][_0x95b1('0x67')]=_0x3c2053['id'];return db[_0x95b1('0x41')][_0x95b1('0x71')](_0x197533[_0x95b1('0x64')]);}})[_0x95b1('0x26')](respondWithResult(_0x170508,null))['catch'](handleError(_0x170508,null));};exports[_0x95b1('0x88')]=function(_0xe1a020,_0x11213b,_0x332f3f){return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0xe1a020[_0x95b1('0x60')]['id']}})['then'](handleEntityNotFound(_0x11213b,null))[_0x95b1('0x26')](function(_0x5496b0){if(_0x5496b0){return _0x5496b0[_0x95b1('0x89')](null);}return null;})[_0x95b1('0x26')](respondWithStatusCode(_0x11213b,null))[_0x95b1('0x30')](handleError(_0x11213b,null));};exports[_0x95b1('0x8a')]=function(_0x238ee0,_0x1d5602,_0x2875d0){return db[_0x95b1('0x47')]['findOne']({'where':{'id':_0x238ee0[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x1d5602,null))[_0x95b1('0x26')](function(_0x52e18d){if(_0x52e18d){return _0x52e18d[_0x95b1('0x8a')]();}return null;})[_0x95b1('0x26')](respondWithResult(_0x1d5602,null))[_0x95b1('0x30')](handleError(_0x1d5602,null));};exports[_0x95b1('0x8b')]=function(_0x3688a3,_0x3f6559,_0x251cdb){if(_0x3688a3[_0x95b1('0x64')]['id']){delete _0x3688a3[_0x95b1('0x64')]['id'];}return db[_0x95b1('0x47')][_0x95b1('0x62')]({'where':{'id':_0x3688a3[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x3f6559,null))[_0x95b1('0x26')](function(_0x5f41a1){if(_0x5f41a1){_0x3688a3[_0x95b1('0x64')][_0x95b1('0x67')]=_0x5f41a1['id'];return db['MailServerOut'][_0x95b1('0x71')](_0x3688a3[_0x95b1('0x64')]);}})[_0x95b1('0x26')](respondWithResult(_0x3f6559,null))[_0x95b1('0x30')](handleError(_0x3f6559,null));};exports['removeSmtp']=function(_0x3e4e83,_0xc00491,_0x1a274c){return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0x3e4e83[_0x95b1('0x60')]['id']}})['then'](handleEntityNotFound(_0xc00491,null))[_0x95b1('0x26')](function(_0x49b34e){if(_0x49b34e){return _0x49b34e['setSmtp'](null);}return null;})[_0x95b1('0x26')](respondWithStatusCode(_0xc00491,null))[_0x95b1('0x30')](handleError(_0xc00491,null));};exports['addInteraction']=function(_0xbc55,_0x4ff2ad,_0x375d62){return db[_0x95b1('0x8c')]['find']({'where':{'id':_0xbc55[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x4ff2ad,null))[_0x95b1('0x26')](function(_0x346326){if(_0x346326){return _0x346326[_0x95b1('0x8d')](_0xbc55[_0x95b1('0x64')][_0x95b1('0x6d')],_['omit'](_0xbc55[_0x95b1('0x64')],['ids','id'])||{});}})[_0x95b1('0x26')](respondWithResult(_0x4ff2ad,null))[_0x95b1('0x30')](handleError(_0x4ff2ad,null));};exports[_0x95b1('0x8e')]=function(_0x362a71,_0xa42713,_0x162135){var _0x38984f={'raw':![],'where':{}};var _0x43bb6f={};var _0x10e2b9={'count':0x0,'rows':[]};return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0x362a71[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0xa42713,null))['then'](function(_0x498257){if(_0x498257){_0x43bb6f[_0x95b1('0x4b')]=_[_0x95b1('0x4d')](db[_0x95b1('0x8c')][_0x95b1('0x6b')]);_0x43bb6f[_0x95b1('0x4c')]=_[_0x95b1('0x4d')](_0x362a71[_0x95b1('0x4c')]);_0x43bb6f[_0x95b1('0x4e')]=_[_0x95b1('0x4f')](_0x43bb6f[_0x95b1('0x4b')],_0x43bb6f[_0x95b1('0x4c')]);_0x38984f[_0x95b1('0x50')]=_[_0x95b1('0x4f')](_0x43bb6f['model'],qs[_0x95b1('0x51')](_0x362a71[_0x95b1('0x4c')][_0x95b1('0x51')]));_0x38984f[_0x95b1('0x50')]=_0x38984f[_0x95b1('0x50')]['length']?_0x38984f['attributes']:_0x43bb6f['model'];if(!_0x362a71['query'][_0x95b1('0x53')](_0x95b1('0x54'))){_0x38984f[_0x95b1('0x33')]=qs['limit'](_0x362a71[_0x95b1('0x4c')][_0x95b1('0x33')]);_0x38984f[_0x95b1('0x32')]=qs['offset'](_0x362a71[_0x95b1('0x4c')][_0x95b1('0x32')]);}_0x38984f[_0x95b1('0x55')]=qs[_0x95b1('0x56')](_0x362a71[_0x95b1('0x4c')][_0x95b1('0x56')]);_0x38984f[_0x95b1('0x57')]=qs[_0x95b1('0x4e')](_[_0x95b1('0x58')](_0x362a71[_0x95b1('0x4c')],_0x43bb6f[_0x95b1('0x4e')]));_0x38984f['where']['MailAccountId']=_0x498257['id'];if(_0x362a71[_0x95b1('0x4c')]['filter']){_0x38984f[_0x95b1('0x57')]=_['merge'](_0x38984f[_0x95b1('0x57')],{'$or':_[_0x95b1('0x46')](_0x38984f['attributes'],function(_0x286b73){var _0x30ae8b={};_0x30ae8b[_0x286b73]={'$like':'%'+_0x362a71['query']['filter']+'%'};return _0x30ae8b;})});}_0x38984f=_[_0x95b1('0x5a')]({},_0x38984f,_0x362a71[_0x95b1('0x6f')]);return db['MailInteraction'][_0x95b1('0x5b')]({'where':_0x38984f[_0x95b1('0x57')]})[_0x95b1('0x26')](function(_0x55d92e){_0x10e2b9[_0x95b1('0x5b')]=_0x55d92e;if(_0x362a71[_0x95b1('0x4c')][_0x95b1('0x5c')]){_0x38984f['include']=[{'model':db[_0x95b1('0x8f')],'as':_0x95b1('0x90'),'required':![]},{'model':db[_0x95b1('0x91')],'as':_0x95b1('0x92'),'attributes':[_0x95b1('0x3e'),_0x95b1('0x93'),_0x95b1('0x94')],'required':![]},{'model':db['Tag'],'as':_0x95b1('0x95'),'attributes':['id',_0x95b1('0x3e'),_0x95b1('0x96')],'where':_0x362a71[_0x95b1('0x4c')][_0x95b1('0x97')]?{'id':_0x362a71[_0x95b1('0x4c')][_0x95b1('0x97')]}:undefined,'required':_0x362a71[_0x95b1('0x4c')][_0x95b1('0x97')]?!![]:![]}];}return db['MailInteraction'][_0x95b1('0x5e')](_0x38984f);})[_0x95b1('0x26')](function(_0x92adb8){_0x10e2b9[_0x95b1('0x5f')]=_0x92adb8;return _0x10e2b9;});}})[_0x95b1('0x26')](respondWithFilteredResult(_0xa42713,_0x38984f))[_0x95b1('0x30')](handleError(_0xa42713,null));};exports[_0x95b1('0x98')]=function(_0x42ebbf,_0x26084c,_0x5e8c95){return db['MailAccount'][_0x95b1('0x6a')]({'where':{'id':_0x42ebbf[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x26084c,null))['then'](function(_0x41a7dd){if(_0x41a7dd){return db['sequelize'][_0x95b1('0x99')](function(_0xb4f14c){return db[_0x95b1('0x9a')][_0x95b1('0x3a')]({'where':{'MailAccountId':_0x42ebbf[_0x95b1('0x60')]['id']},'transaction':_0xb4f14c})[_0x95b1('0x26')](function(_0x1f76e7){var _0x277eb5=_[_0x95b1('0x46')](_0x42ebbf[_0x95b1('0x64')],function(_0x4ecdcd){_0x4ecdcd['MailAccountId']=_0x42ebbf[_0x95b1('0x60')]['id'];return _0x4ecdcd;});return db[_0x95b1('0x9a')]['bulkCreate'](_0x277eb5,{'transaction':_0xb4f14c});});})[_0x95b1('0x26')](function(){return db[_0x95b1('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x42ebbf[_0x95b1('0x60')]['id']},'order':_0x95b1('0x9b')});});}})[_0x95b1('0x26')](respondWithResult(_0x26084c,null))[_0x95b1('0x30')](handleError(_0x26084c,null));};exports[_0x95b1('0x9c')]=function(_0x129a89,_0x38ed33,_0x1e3f25){var _0x43601c={};var _0x21c5b7={};var _0x52b564;var _0x2e4fac;return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0x129a89[_0x95b1('0x60')]['id']}})['then'](handleEntityNotFound(_0x38ed33,null))[_0x95b1('0x26')](function(_0x5a3b2c){if(_0x5a3b2c){_0x52b564=_0x5a3b2c;_0x21c5b7[_0x95b1('0x4b')]=_['keys'](db[_0x95b1('0x9a')]['rawAttributes']);_0x21c5b7['query']=_[_0x95b1('0x4d')](_0x129a89[_0x95b1('0x4c')]);_0x21c5b7[_0x95b1('0x4e')]=_[_0x95b1('0x4f')](_0x21c5b7[_0x95b1('0x4b')],_0x21c5b7[_0x95b1('0x4c')]);_0x43601c[_0x95b1('0x50')]=_['intersection'](_0x21c5b7[_0x95b1('0x4b')],qs[_0x95b1('0x51')](_0x129a89[_0x95b1('0x4c')]['fields']));_0x43601c['attributes']=_0x43601c[_0x95b1('0x50')][_0x95b1('0x52')]?_0x43601c['attributes']:_0x21c5b7['model'];_0x43601c[_0x95b1('0x55')]=qs[_0x95b1('0x56')](_0x129a89[_0x95b1('0x4c')][_0x95b1('0x56')]);_0x43601c[_0x95b1('0x57')]=qs['filters'](_['pick'](_0x129a89['query'],_0x21c5b7['filters']));if(_0x129a89[_0x95b1('0x4c')][_0x95b1('0x59')]){_0x43601c[_0x95b1('0x57')]=_[_0x95b1('0x5a')](_0x43601c[_0x95b1('0x57')],{'$or':_[_0x95b1('0x46')](_0x43601c['attributes'],function(_0x29680c){var _0x36f4df={};_0x36f4df[_0x29680c]={'$like':'%'+_0x129a89[_0x95b1('0x4c')]['filter']+'%'};return _0x36f4df;})});}_0x43601c=_[_0x95b1('0x5a')]({},_0x43601c,_0x129a89[_0x95b1('0x6f')]);return _0x52b564[_0x95b1('0x9c')](_0x43601c);}})[_0x95b1('0x26')](function(_0x40bfe3){if(_0x40bfe3){_0x2e4fac=_0x40bfe3[_0x95b1('0x52')];if(!_0x129a89[_0x95b1('0x4c')][_0x95b1('0x53')](_0x95b1('0x54'))){_0x43601c['limit']=qs[_0x95b1('0x33')](_0x129a89[_0x95b1('0x4c')]['limit']);_0x43601c[_0x95b1('0x32')]=qs[_0x95b1('0x32')](_0x129a89['query'][_0x95b1('0x32')]);}return _0x52b564[_0x95b1('0x9c')](_0x43601c);}})['then'](function(_0x210824){if(_0x210824){return _0x210824?{'count':_0x2e4fac,'rows':_0x210824}:null;}})[_0x95b1('0x26')](respondWithResult(_0x38ed33,null))[_0x95b1('0x30')](handleError(_0x38ed33,null));};exports[_0x95b1('0x9d')]=function(_0x5790d7,_0x2e42f7,_0x2dc939){var _0x586a8f={'raw':!![],'where':{}};var _0x2740aa={};var _0x18d05f={'count':0x0,'rows':[]};return db[_0x95b1('0x47')]['findOne']({'where':{'id':_0x5790d7[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x2e42f7,null))['then'](function(_0x21f365){if(_0x21f365){_0x2740aa[_0x95b1('0x4b')]=_[_0x95b1('0x4d')](db['MailMessage'][_0x95b1('0x6b')]);_0x2740aa['query']=_[_0x95b1('0x4d')](_0x5790d7['query']);_0x2740aa[_0x95b1('0x4e')]=_[_0x95b1('0x4f')](_0x2740aa[_0x95b1('0x4b')],_0x2740aa[_0x95b1('0x4c')]);_0x586a8f[_0x95b1('0x50')]=_[_0x95b1('0x4f')](_0x2740aa[_0x95b1('0x4b')],qs[_0x95b1('0x51')](_0x5790d7[_0x95b1('0x4c')]['fields']));_0x586a8f[_0x95b1('0x50')]=_0x586a8f['attributes']['length']?_0x586a8f['attributes']:_0x2740aa[_0x95b1('0x4b')];if(!_0x5790d7['query'][_0x95b1('0x53')](_0x95b1('0x54'))){_0x586a8f[_0x95b1('0x33')]=qs['limit'](_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x33')]);_0x586a8f['offset']=qs[_0x95b1('0x32')](_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x32')]);}_0x586a8f[_0x95b1('0x55')]=qs[_0x95b1('0x56')](_0x5790d7[_0x95b1('0x4c')]['sort']);_0x586a8f[_0x95b1('0x57')]=qs[_0x95b1('0x4e')](_[_0x95b1('0x58')](_0x5790d7['query'],_0x2740aa[_0x95b1('0x4e')]));_0x586a8f[_0x95b1('0x57')][_0x95b1('0x67')]=_0x21f365['id'];if(_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x59')]){_0x586a8f['where']=_['merge'](_0x586a8f[_0x95b1('0x57')],{'$or':_[_0x95b1('0x46')](_0x586a8f[_0x95b1('0x50')],function(_0x224ace){var _0x491dda={};_0x491dda[_0x224ace]={'$like':'%'+_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x59')]+'%'};return _0x491dda;})});}if(_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x9e')]){var _0x516388=_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x9e')][_0x95b1('0x9f')](',');var _0x5e3709={};_0x5e3709[_0x516388[0x0]]={'$gte':moment(_0x516388[0x1])['format'](_0x95b1('0xa0'))};_0x586a8f[_0x95b1('0x57')]=_[_0x95b1('0x5a')](_0x586a8f[_0x95b1('0x57')],_0x5e3709);}_0x586a8f=_[_0x95b1('0x5a')]({},_0x586a8f,_0x5790d7[_0x95b1('0x6f')]);return db['MailMessage']['count']({'where':_0x586a8f['where']})[_0x95b1('0x26')](function(_0x546411){_0x18d05f['count']=_0x546411;if(_0x5790d7[_0x95b1('0x4c')][_0x95b1('0x5c')]){_0x586a8f[_0x95b1('0x5d')]=[{'all':!![]}];}return db[_0x95b1('0xa1')]['findAll'](_0x586a8f);})[_0x95b1('0x26')](function(_0x51f1aa){_0x18d05f[_0x95b1('0x5f')]=_0x51f1aa;return _0x18d05f;});}})[_0x95b1('0x26')](respondWithFilteredResult(_0x2e42f7,_0x586a8f))[_0x95b1('0x30')](handleError(_0x2e42f7,null));};exports[_0x95b1('0x3f')]=function(_0x4b5e6e,_0x4bbddb,_0x1bb8bc){var _0x33b77e,_0x19cf88={},_0x42716a;if(_0x4b5e6e[_0x95b1('0x64')]['to']){_0x42716a=_0x4b5e6e[_0x95b1('0x64')]['to'][_0x95b1('0x9f')](',')[0x0];}return db[_0x95b1('0x47')]['find']({'where':{'id':_0x4b5e6e[_0x95b1('0x60')]['id']},'include':[{'model':db[_0x95b1('0xa2')],'as':_0x95b1('0xa3'),'include':[{'model':db[_0x95b1('0x8f')],'as':'Contacts','where':{'email':_0x42716a},'limit':0x1,'order':[['updatedAt',_0x95b1('0xa4')]]}]},{'model':db[_0x95b1('0x43')],'as':_0x95b1('0x44'),'raw':!![]}]})[_0x95b1('0x26')](handleEntityNotFound(_0x4bbddb,null))[_0x95b1('0x26')](function(_0x181cfa){if(_0x181cfa){_0x33b77e=_0x181cfa;if(_0x181cfa[_0x95b1('0x44')]){if(_['isNil'](_0x4b5e6e['body'][_0x95b1('0xa5')])){_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0xa5')]=util['format'](_0x95b1('0xa6'),_0x181cfa[_0x95b1('0x3e')],_0x181cfa[_0x95b1('0xa7')]||_0x181cfa[_0x95b1('0x44')][_0x95b1('0x78')]);}if(_0x4b5e6e['body'][_0x95b1('0xa8')]&&_0x4b5e6e[_0x95b1('0x64')]['attachments'][_0x95b1('0x52')]){for(var _0x16157b=0x0;_0x16157b<_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0xa8')][_0x95b1('0x52')];_0x16157b+=0x1){_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0xa8')][_0x16157b]={'filename':_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0xa8')][_0x16157b][_0x95b1('0x3e')],'path':path[_0x95b1('0xa9')](config[_0x95b1('0xaa')],'server/files/attachments',_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0xa8')][_0x16157b][_0x95b1('0xab')])};}}var _0x349fc1={'tls':{'rejectUnauthorized':![]}};if(_[_0x95b1('0x73')](_0x181cfa['Smtp']['service'])){if(_0x181cfa[_0x95b1('0x44')]['authentication']){_0x349fc1[_0x95b1('0xac')]={'user':_0x181cfa[_0x95b1('0x44')][_0x95b1('0x78')],'pass':_0x181cfa[_0x95b1('0x44')][_0x95b1('0x79')]};}_0x349fc1[_0x95b1('0x7c')]=_0x181cfa['Smtp'][_0x95b1('0x7c')];_0x349fc1[_0x95b1('0x7d')]=_0x181cfa[_0x95b1('0x44')]['port'];_0x349fc1[_0x95b1('0xad')]=_0x181cfa['Smtp']['secure'];}else{_0x349fc1[_0x95b1('0x7e')]=_0x181cfa['Smtp'][_0x95b1('0x7e')];_0x349fc1[_0x95b1('0xac')]={'user':_0x181cfa[_0x95b1('0x44')][_0x95b1('0x78')],'pass':_0x181cfa['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0x95b1('0xae'),{'account':_0x349fc1,'message':_0x4b5e6e['body']});}else{throw new Error(_0x95b1('0xaf'));}}})[_0x95b1('0x26')](function(_0x46977c){if(_0x46977c){_0x19cf88=_0x46977c;if(_0x33b77e[_0x95b1('0xa3')]){if(_0x33b77e[_0x95b1('0xa3')]['Contacts']['length']){return _0x33b77e[_0x95b1('0xa3')]['Contacts'][0x0];}else{return db[_0x95b1('0x8f')][_0x95b1('0x71')](_[_0x95b1('0x1c')](_0x4b5e6e[_0x95b1('0x64')],{'firstName':_0x4b5e6e[_0x95b1('0x64')]['to'],'email':_0x4b5e6e[_0x95b1('0x64')]['to'],'phone':_0x4b5e6e['body']['to'],'ListId':_0x33b77e[_0x95b1('0x72')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0x95b1('0x26')](function(_0x28f9f6){if(_0x28f9f6){var _0x5e3552={'UserId':_0x4b5e6e[_0x95b1('0x78')]['id'],'ContactId':_0x28f9f6['id'],'MailAccountId':_0x33b77e['id'],'inReplyTo':_0x19cf88[_0x95b1('0xb0')],'to':_0x4b5e6e['body']['from'],'cc':_0x4b5e6e['body']['cc'],'subject':_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0xb1')],'attach':_0x4b5e6e['body'][_0x95b1('0xb2')],'firstMsgDirection':_0x95b1('0xb3'),'lastMsgAt':moment()[_0x95b1('0xb4')](_0x95b1('0xa0')),'lastMsgDirection':'out','lastMsgBody':_0x4b5e6e[_0x95b1('0x64')][_0x95b1('0x64')],'Messages':[_[_0x95b1('0x5a')](_0x4b5e6e['body'],{'messageId':_0x19cf88[_0x95b1('0xb0')],'sentAt':moment()[_0x95b1('0xb4')](_0x95b1('0xa0')),'read':!![],'MailAccountId':_0x33b77e['id'],'UserId':_0x4b5e6e[_0x95b1('0x78')]['id'],'ContactId':_0x28f9f6['id']})]};if(_0x4b5e6e[_0x95b1('0x64')]['Interaction']){_0x5e3552=_[_0x95b1('0x5a')](_0x5e3552,_0x4b5e6e['body']['Interaction']);}return db[_0x95b1('0x8c')]['create'](_0x5e3552,{'include':[{'model':db['MailMessage'],'as':_0x95b1('0xb5')}]});}})['then'](respondWithResult(_0x4bbddb,null))[_0x95b1('0x30')](handleError(_0x4bbddb,null));};exports[_0x95b1('0xb6')]=function(_0x50e26a,_0x45a808,_0x45641e){return db[_0x95b1('0x47')][_0x95b1('0x62')]({'where':{'id':_0x50e26a[_0x95b1('0x60')]['id']},'include':[{'model':db[_0x95b1('0x43')],'as':_0x95b1('0x44'),'raw':!![]}]})[_0x95b1('0x26')](handleEntityNotFound(_0x45a808,null))[_0x95b1('0x26')](function(_0x23d3e5){if(_0x23d3e5&&_0x23d3e5['Smtp']){var _0x407c24={'id':_0x23d3e5['id'],'tls':{'rejectUnauthorized':![]}};if(_0x23d3e5['Smtp'][_0x95b1('0x7e')]){_0x407c24['service']=_0x23d3e5[_0x95b1('0x44')][_0x95b1('0x7e')];}else{_0x407c24[_0x95b1('0x7c')]=_0x23d3e5['Smtp']['host'];_0x407c24[_0x95b1('0x7d')]=_0x23d3e5[_0x95b1('0x44')]['port'];_0x407c24[_0x95b1('0xad')]=_0x23d3e5[_0x95b1('0x44')][_0x95b1('0xad')];}if(_0x23d3e5[_0x95b1('0x44')][_0x95b1('0x7b')]){_0x407c24[_0x95b1('0xac')]={'user':_0x23d3e5[_0x95b1('0x44')][_0x95b1('0x78')],'pass':_0x23d3e5[_0x95b1('0x44')][_0x95b1('0x79')]};}return respondWithRpcPromise(_0x95b1('0xb7'),_0x95b1('0xb6'),{'account':_0x407c24});}})[_0x95b1('0x26')](respondWithResult(_0x45a808,null))[_0x95b1('0x30')](handleError(_0x45a808,null));};exports[_0x95b1('0x3a')]=function(_0x1788a5,_0x39dc95){return db[_0x95b1('0x47')][_0x95b1('0x62')]({'where':{'id':_0x1788a5[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x39dc95,null))[_0x95b1('0x26')](function(_0x13f7a9){if(_0x13f7a9&&_0x13f7a9[_0x95b1('0x7e')]){throw new db[(_0x95b1('0x23'))][(_0x95b1('0x24'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x13f7a9;})[_0x95b1('0x26')](removeEntity(_0x39dc95,null))[_0x95b1('0x30')](handleError(_0x39dc95,null));};exports[_0x95b1('0xb8')]=function(_0x2260f4,_0x104bbd,_0x1bc4b8){return db[_0x95b1('0x47')]['find']({'where':{'id':_0x2260f4[_0x95b1('0x60')]['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x104bbd,null))[_0x95b1('0x26')](function(_0xb7e62b){if(_0xb7e62b){return _0xb7e62b[_0x95b1('0xb8')](_0x2260f4['body'][_0x95b1('0x6d')],_[_0x95b1('0xb9')](_0x2260f4[_0x95b1('0x64')],[_0x95b1('0x6d'),'id'])||{})['spread'](function(_0x287f17){for(var _0x88d6cd=0x0;_0x88d6cd<_0x2260f4['body']['ids']['length'];_0x88d6cd+=0x1){socket[_0x95b1('0xba')](_0x95b1('0xbb'),{'UserId':_0x2260f4[_0x95b1('0x64')]['ids'][_0x88d6cd],'MailAccountId':_0x2260f4[_0x95b1('0x60')]['id']});}return _0x287f17;});}})[_0x95b1('0x26')](respondWithResult(_0x104bbd,null))[_0x95b1('0x30')](handleError(_0x104bbd,null));};exports[_0x95b1('0xbc')]=function(_0x524b74,_0x173053,_0x127804){return db['MailAccount'][_0x95b1('0x62')]({'where':{'id':_0x524b74['params']['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x173053,null))[_0x95b1('0x26')](function(_0x106e76){if(_0x106e76){return _0x106e76[_0x95b1('0xbc')](_0x524b74[_0x95b1('0x4c')][_0x95b1('0x6d')])['then'](function(){if(_['isArray'](_0x524b74[_0x95b1('0x4c')][_0x95b1('0x6d')])){for(var _0x4ec07a=0x0;_0x4ec07a<_0x524b74[_0x95b1('0x4c')][_0x95b1('0x6d')]['length'];_0x4ec07a+=0x1){socket[_0x95b1('0xba')](_0x95b1('0xbd'),{'UserId':Number(_0x524b74['query'][_0x95b1('0x6d')][_0x4ec07a]),'MailAccountId':Number(_0x524b74[_0x95b1('0x60')]['id'])});}}else{socket[_0x95b1('0xba')](_0x95b1('0xbd'),{'UserId':Number(_0x524b74[_0x95b1('0x4c')][_0x95b1('0x6d')]),'MailAccountId':Number(_0x524b74[_0x95b1('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x173053,null))[_0x95b1('0x30')](handleError(_0x173053,null));};exports[_0x95b1('0xbe')]=function(_0x25589c,_0x2ba40f,_0x36493c){var _0x2f593a={};var _0x1eaf89={};var _0xa6cb5e;var _0x5f1bda;return db[_0x95b1('0x47')][_0x95b1('0x6a')]({'where':{'id':_0x25589c['params']['id']}})[_0x95b1('0x26')](handleEntityNotFound(_0x2ba40f,null))[_0x95b1('0x26')](function(_0x32ebc4){if(_0x32ebc4){_0xa6cb5e=_0x32ebc4;_0x1eaf89[_0x95b1('0x4b')]=_['keys'](db[_0x95b1('0x91')][_0x95b1('0x6b')]);_0x1eaf89[_0x95b1('0x4c')]=_['keys'](_0x25589c[_0x95b1('0x4c')]);_0x1eaf89['filters']=_[_0x95b1('0x4f')](_0x1eaf89['model'],_0x1eaf89['query']);_0x2f593a[_0x95b1('0x50')]=_['intersection'](_0x1eaf89['model'],qs[_0x95b1('0x51')](_0x25589c[_0x95b1('0x4c')]['fields']));_0x2f593a[_0x95b1('0x50')]=_0x2f593a[_0x95b1('0x50')][_0x95b1('0x52')]?_0x2f593a[_0x95b1('0x50')]:_0x1eaf89[_0x95b1('0x4b')];_0x2f593a['order']=qs[_0x95b1('0x56')](_0x25589c[_0x95b1('0x4c')][_0x95b1('0x56')]);_0x2f593a[_0x95b1('0x57')]=qs[_0x95b1('0x4e')](_[_0x95b1('0x58')](_0x25589c[_0x95b1('0x4c')],_0x1eaf89[_0x95b1('0x4e')]));if(_0x25589c[_0x95b1('0x4c')]['filter']){_0x2f593a[_0x95b1('0x57')]=_[_0x95b1('0x5a')](_0x2f593a[_0x95b1('0x57')],{'$or':_[_0x95b1('0x46')](_0x2f593a[_0x95b1('0x50')],function(_0x179fbd){var _0x3a3d2d={};_0x3a3d2d[_0x179fbd]={'$like':'%'+_0x25589c[_0x95b1('0x4c')][_0x95b1('0x59')]+'%'};return _0x3a3d2d;})});}_0x2f593a=_['merge']({},_0x2f593a,_0x25589c[_0x95b1('0x6f')]);return _0xa6cb5e[_0x95b1('0xbe')](_0x2f593a);}})[_0x95b1('0x26')](function(_0x4d7694){if(_0x4d7694){_0x5f1bda=_0x4d7694[_0x95b1('0x52')];if(!_0x25589c[_0x95b1('0x4c')][_0x95b1('0x53')](_0x95b1('0x54'))){_0x2f593a[_0x95b1('0x33')]=qs[_0x95b1('0x33')](_0x25589c[_0x95b1('0x4c')]['limit']);_0x2f593a['offset']=qs[_0x95b1('0x32')](_0x25589c[_0x95b1('0x4c')][_0x95b1('0x32')]);}return _0xa6cb5e[_0x95b1('0xbe')](_0x2f593a);}})[_0x95b1('0x26')](function(_0x6707e9){if(_0x6707e9){return _0x6707e9?{'count':_0x5f1bda,'rows':_0x6707e9}:null;}})['then'](respondWithResult(_0x2ba40f,null))['catch'](handleError(_0x2ba40f,null));}; \ No newline at end of file +var _0x9e12=['CannedAnswer','removeAnswers','ids','ListId','isNil','active','description','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','role','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','User','getAgents','html-pdf','rimraf','zip-dir','request-promise','moment','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','client','http','test','Sequelize','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','count','offset','limit','set','Content-Range','reject','update','get','destroy','end','stack','name','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','include','findAll','rows','show','includeAll','merge','options','find','body','params','Smtp','describe','addDisposition','MailAccountId','Disposition','create','findOne','filter','addAnswer'];(function(_0x566cbd,_0x12fecc){var _0x530647=function(_0x28bc1a){while(--_0x28bc1a){_0x566cbd['push'](_0x566cbd['shift']());}};_0x530647(++_0x12fecc);}(_0x9e12,0x11e));var _0x29e1=function(_0x5ed157,_0x1aab72){_0x5ed157=_0x5ed157-0x0;var _0x21aa6d=_0x9e12[_0x5ed157];return _0x21aa6d;};'use strict';var pdf=require(_0x29e1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x29e1('0x1'));var zipdir=require(_0x29e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29e1('0x3'));var moment=require(_0x29e1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29e1('0x5'));var path=require('path');var sox=require(_0x29e1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x29e1('0x7'));var squel=require(_0x29e1('0x8'));var crypto=require(_0x29e1('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x29e1('0xa'));var toCsv=require(_0x29e1('0xb'));var querystring=require(_0x29e1('0xc'));var Papa=require('papaparse');var Redis=require(_0x29e1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x29e1('0xe'));var as=require(_0x29e1('0xf'));var hardwareService=require(_0x29e1('0x10'));var logger=require(_0x29e1('0x11'))(_0x29e1('0x12'));var utils=require(_0x29e1('0x13'));var config=require(_0x29e1('0x14'));var db=require('../../mysqldb')['db'];config[_0x29e1('0x15')]=_[_0x29e1('0x16')](config[_0x29e1('0x15')],{'host':_0x29e1('0x17'),'port':0x18eb});var socket=require(_0x29e1('0x18'))(new Redis(config[_0x29e1('0x15')]));require(_0x29e1('0x19'))[_0x29e1('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x29e1('0x1b')][_0x29e1('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x19cc6e,_0x4d6def,_0x4547dd){if(_0x4547dd){var _0xc1fc55=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc1fc55[_0x29e1('0x1d')](_0x4d6def)){return _0x19cc6e;}else{throw new db[(_0x29e1('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x19cc6e;}}function respondWithRpcPromise(_0x30fd74,_0x569c8f,_0x3ac758,_0x12c01f){return new BPromise(function(_0x1c56aa,_0x3b0182){var _0x2ce875=_0x12c01f||client;return _0x2ce875['request'](_0x30fd74,_0x3ac758)[_0x29e1('0x1f')](function(_0x274b6d){logger[_0x29e1('0x20')](_0x29e1('0x21'),_0x569c8f,_0x29e1('0x22'));logger[_0x29e1('0x23')](_0x29e1('0x24'),_0x569c8f,_0x29e1('0x22'),JSON[_0x29e1('0x25')](_0x274b6d));if(_0x274b6d['error']){if(_0x274b6d[_0x29e1('0x26')][_0x29e1('0x27')]===0x1f4){logger[_0x29e1('0x26')](_0x29e1('0x21'),_0x569c8f,_0x274b6d[_0x29e1('0x26')]['message']);return _0x3b0182(_0x274b6d[_0x29e1('0x26')][_0x29e1('0x28')]);}logger[_0x29e1('0x26')](_0x29e1('0x21'),_0x569c8f,_0x274b6d['error']['message']);return _0x1c56aa(_0x274b6d['error'][_0x29e1('0x28')]);}else{logger[_0x29e1('0x20')](_0x29e1('0x21'),_0x569c8f,_0x29e1('0x22'));_0x1c56aa(_0x274b6d['result'][_0x29e1('0x28')]);}})[_0x29e1('0x29')](function(_0x46687c){logger['error'](_0x29e1('0x21'),_0x569c8f,_0x46687c);_0x3b0182(_0x46687c);});});}function respondWithStatusCode(_0x46ffbb,_0x2fa4e0){_0x2fa4e0=_0x2fa4e0||0xcc;return function(_0x5a2199){if(_0x5a2199){return _0x46ffbb[_0x29e1('0x2a')](_0x2fa4e0);}return _0x46ffbb[_0x29e1('0x2b')](_0x2fa4e0)['end']();};}function respondWithResult(_0x3fea33,_0x166a8c){_0x166a8c=_0x166a8c||0xc8;return function(_0x4c8245){if(_0x4c8245){return _0x3fea33['status'](_0x166a8c)['json'](_0x4c8245);}};}function respondWithFilteredResult(_0x1707e1,_0x275f58){return function(_0x40aacc){if(_0x40aacc){var _0x33523b=_0x40aacc[_0x29e1('0x2c')],_0x5d122d=_0x275f58[_0x29e1('0x2d')],_0x1fd438=_0x275f58[_0x29e1('0x2d')]+_0x275f58[_0x29e1('0x2e')],_0x1fd63d;if(_0x1fd438>=_0x33523b){_0x1fd438=_0x33523b;_0x1fd63d=0xc8;}else{_0x1fd63d=0xce;}_0x1707e1[_0x29e1('0x2b')](_0x1fd63d);return _0x1707e1[_0x29e1('0x2f')](_0x29e1('0x30'),_0x5d122d+'-'+_0x1fd438+'/'+_0x33523b)['json'](_0x40aacc);}return null;};}function patchUpdates(_0x57650f){return function(_0x31d686){try{jsonpatch['apply'](_0x31d686,_0x57650f,!![]);}catch(_0x24732a){return BPromise[_0x29e1('0x31')](_0x24732a);}return _0x31d686['save']();};}function saveUpdates(_0x42d2f5,_0x1aa3e0){return function(_0x431356){if(_0x431356){return _0x431356[_0x29e1('0x32')](_0x42d2f5)[_0x29e1('0x1f')](function(_0x4023af){return _0x4023af;});}return null;};}function removeEntity(_0x2e0d06,_0x1566d6){return function(_0x4b5dec){if(_0x4b5dec){return _0x4b5dec['destroy']()['then'](function(){var _0x249f78=_0x4b5dec[_0x29e1('0x33')]({'plain':!![]});var _0xfbbe6d='MailAccounts';return db['UserProfileResource'][_0x29e1('0x34')]({'where':{'type':_0xfbbe6d,'resourceId':_0x249f78['id']}})[_0x29e1('0x1f')](function(){return _0x4b5dec;});})[_0x29e1('0x1f')](function(){_0x2e0d06['status'](0xcc)[_0x29e1('0x35')]();});}};}function handleEntityNotFound(_0x4d5d95,_0x2c5d3d){return function(_0x33c27b){if(!_0x33c27b){_0x4d5d95[_0x29e1('0x2a')](0x194);}return _0x33c27b;};}function handleError(_0x2c60bc,_0x48b43d){_0x48b43d=_0x48b43d||0x1f4;return function(_0x5a9b47){logger['error'](_0x5a9b47[_0x29e1('0x36')]);if(_0x5a9b47[_0x29e1('0x37')]){delete _0x5a9b47['name'];}_0x2c60bc['status'](_0x48b43d)[_0x29e1('0x38')](_0x5a9b47);};}exports[_0x29e1('0x39')]=function(_0x153c8a,_0x2d5952){var _0x1db0cd={'include':[{'model':db[_0x29e1('0x3a')],'as':_0x29e1('0x3b')},{'model':db[_0x29e1('0x3c')],'as':'Smtp'},{'model':db[_0x29e1('0x3d')],'as':_0x29e1('0x3e')}]},_0x1e4ed0={},_0x328e97={'count':0x0,'rows':[]};var _0x1725d4=_[_0x29e1('0x3f')](db[_0x29e1('0x40')][_0x29e1('0x41')],function(_0xc0d213){return{'name':_0xc0d213['fieldName'],'type':_0xc0d213[_0x29e1('0x42')][_0x29e1('0x43')]};});_0x1e4ed0[_0x29e1('0x44')]=_['map'](_0x1725d4,_0x29e1('0x37'));_0x1e4ed0[_0x29e1('0x45')]=_[_0x29e1('0x46')](_0x153c8a[_0x29e1('0x45')]);_0x1e4ed0[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x1e4ed0[_0x29e1('0x44')],_0x1e4ed0['query']);_0x1db0cd[_0x29e1('0x49')]=_[_0x29e1('0x48')](_0x1e4ed0[_0x29e1('0x44')],qs[_0x29e1('0x4a')](_0x153c8a[_0x29e1('0x45')][_0x29e1('0x4a')]));_0x1db0cd[_0x29e1('0x49')]=_0x1db0cd[_0x29e1('0x49')][_0x29e1('0x4b')]?_0x1db0cd[_0x29e1('0x49')]:_0x1e4ed0['model'];if(!_0x153c8a['query'][_0x29e1('0x4c')](_0x29e1('0x4d'))){_0x1db0cd[_0x29e1('0x2e')]=qs[_0x29e1('0x2e')](_0x153c8a['query'][_0x29e1('0x2e')]);_0x1db0cd[_0x29e1('0x2d')]=qs[_0x29e1('0x2d')](_0x153c8a[_0x29e1('0x45')][_0x29e1('0x2d')]);}_0x1db0cd[_0x29e1('0x4e')]=qs[_0x29e1('0x4f')](_0x153c8a[_0x29e1('0x45')][_0x29e1('0x4f')]);_0x1db0cd[_0x29e1('0x50')]=qs[_0x29e1('0x47')](_[_0x29e1('0x51')](_0x153c8a[_0x29e1('0x45')],_0x1e4ed0[_0x29e1('0x47')]),_0x1725d4);if(_0x153c8a[_0x29e1('0x45')]['filter']){_0x1db0cd[_0x29e1('0x50')]=_['merge'](_0x1db0cd[_0x29e1('0x50')],{'$or':_[_0x29e1('0x3f')](_0x1725d4,function(_0x16645b){if(_0x16645b[_0x29e1('0x42')]!==_0x29e1('0x52')){var _0x3d4328={};_0x3d4328[_0x16645b[_0x29e1('0x37')]]={'$like':'%'+_0x153c8a[_0x29e1('0x45')]['filter']+'%'};return _0x3d4328;}})});}_0x1db0cd=_['merge']({},_0x1db0cd,_0x153c8a['options']);var _0x2a9380={'where':_0x1db0cd[_0x29e1('0x50')]};return db[_0x29e1('0x40')]['count'](_0x2a9380)[_0x29e1('0x1f')](function(_0x1cc4c1){_0x328e97[_0x29e1('0x2c')]=_0x1cc4c1;if(_0x153c8a['query']['includeAll']){_0x1db0cd[_0x29e1('0x53')]=[{'all':!![]}];}return db[_0x29e1('0x40')][_0x29e1('0x54')](_0x1db0cd);})['then'](function(_0x295d86){_0x328e97[_0x29e1('0x55')]=_0x295d86;return _0x328e97;})[_0x29e1('0x1f')](respondWithFilteredResult(_0x2d5952,_0x1db0cd))[_0x29e1('0x29')](handleError(_0x2d5952,null));};exports[_0x29e1('0x56')]=function(_0x28655b,_0x31613a){var _0x1800f0={'raw':![],'where':{'id':_0x28655b['params']['id']},'include':[{'model':db[_0x29e1('0x3a')],'as':_0x29e1('0x3b')},{'model':db[_0x29e1('0x3c')],'as':'Smtp'},{'model':db['Pause'],'as':_0x29e1('0x3e')}]},_0x3471c8={};_0x3471c8['model']=_[_0x29e1('0x46')](db[_0x29e1('0x40')][_0x29e1('0x41')]);_0x3471c8[_0x29e1('0x45')]=_[_0x29e1('0x46')](_0x28655b['query']);_0x3471c8[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x3471c8[_0x29e1('0x44')],_0x3471c8['query']);_0x1800f0[_0x29e1('0x49')]=_[_0x29e1('0x48')](_0x3471c8[_0x29e1('0x44')],qs[_0x29e1('0x4a')](_0x28655b[_0x29e1('0x45')][_0x29e1('0x4a')]));_0x1800f0[_0x29e1('0x49')]=_0x1800f0[_0x29e1('0x49')][_0x29e1('0x4b')]?_0x1800f0[_0x29e1('0x49')]:_0x3471c8[_0x29e1('0x44')];if(_0x28655b[_0x29e1('0x45')][_0x29e1('0x57')]){_0x1800f0['include']=[{'all':!![]}];}_0x1800f0=_[_0x29e1('0x58')]({},_0x1800f0,_0x28655b[_0x29e1('0x59')]);return db[_0x29e1('0x40')][_0x29e1('0x5a')](_0x1800f0)[_0x29e1('0x1f')](handleEntityNotFound(_0x31613a,null))[_0x29e1('0x1f')](respondWithResult(_0x31613a,null))[_0x29e1('0x29')](handleError(_0x31613a,null));};exports[_0x29e1('0x32')]=function(_0x40c53b,_0x5e0870){if(_0x40c53b[_0x29e1('0x5b')]['id']){delete _0x40c53b[_0x29e1('0x5b')]['id'];}return db['MailAccount'][_0x29e1('0x5a')]({'where':{'id':_0x40c53b[_0x29e1('0x5c')]['id']},'include':[{'model':db[_0x29e1('0x3a')],'as':_0x29e1('0x3b')},{'model':db['MailServerOut'],'as':_0x29e1('0x5d')},{'model':db[_0x29e1('0x3d')],'as':_0x29e1('0x3e')}]})[_0x29e1('0x1f')](handleEntityNotFound(_0x5e0870,null))['then'](saveUpdates(_0x40c53b[_0x29e1('0x5b')],null))['then'](function(_0x2b2ee7){if(_0x2b2ee7&&_0x40c53b['body']['Imap']){return db[_0x29e1('0x3a')][_0x29e1('0x32')](_0x40c53b['body']['Imap'],{'where':{'MailAccountId':_0x2b2ee7['id']}})[_0x29e1('0x1f')](function(){return _0x2b2ee7;});}return _0x2b2ee7;})[_0x29e1('0x1f')](function(_0x44746d){if(_0x44746d&&_0x40c53b[_0x29e1('0x5b')][_0x29e1('0x5d')]){return db[_0x29e1('0x3c')][_0x29e1('0x32')](_0x40c53b[_0x29e1('0x5b')][_0x29e1('0x5d')],{'where':{'MailAccountId':_0x44746d['id']}})['then'](function(){return _0x44746d;});}return _0x44746d;})[_0x29e1('0x1f')](respondWithResult(_0x5e0870,null))[_0x29e1('0x29')](handleError(_0x5e0870,null));};exports[_0x29e1('0x5e')]=function(_0x5a042e,_0x2969a6){return db[_0x29e1('0x40')]['describe']()[_0x29e1('0x1f')](respondWithResult(_0x2969a6,null))[_0x29e1('0x29')](handleError(_0x2969a6,null));};exports[_0x29e1('0x5f')]=function(_0x3dbd31,_0x50a9bf,_0x38beff){if(_0x3dbd31[_0x29e1('0x5b')]['id']){delete _0x3dbd31[_0x29e1('0x5b')]['id'];}return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x3dbd31['params']['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x50a9bf,null))[_0x29e1('0x1f')](function(_0x60cd37){if(_0x60cd37){_0x3dbd31[_0x29e1('0x5b')][_0x29e1('0x60')]=_0x60cd37['id'];return db[_0x29e1('0x61')][_0x29e1('0x62')](_0x3dbd31['body']);}})[_0x29e1('0x1f')](respondWithResult(_0x50a9bf,null))[_0x29e1('0x29')](handleError(_0x50a9bf,null));};exports['getDispositions']=function(_0x3fb1d2,_0x3cb448,_0x1b74b8){var _0x4fb816={'raw':![],'where':{}};var _0x54a0d9={};var _0x181878={'count':0x0,'rows':[]};return db[_0x29e1('0x40')][_0x29e1('0x63')]({'where':{'id':_0x3fb1d2[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x3cb448,null))['then'](function(_0x470af0){if(_0x470af0){_0x54a0d9['model']=_[_0x29e1('0x46')](db[_0x29e1('0x61')][_0x29e1('0x41')]);_0x54a0d9[_0x29e1('0x45')]=_[_0x29e1('0x46')](_0x3fb1d2[_0x29e1('0x45')]);_0x54a0d9[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x54a0d9['model'],_0x54a0d9[_0x29e1('0x45')]);_0x4fb816[_0x29e1('0x49')]=_['intersection'](_0x54a0d9[_0x29e1('0x44')],qs[_0x29e1('0x4a')](_0x3fb1d2[_0x29e1('0x45')]['fields']));_0x4fb816[_0x29e1('0x49')]=_0x4fb816[_0x29e1('0x49')][_0x29e1('0x4b')]?_0x4fb816[_0x29e1('0x49')]:_0x54a0d9[_0x29e1('0x44')];if(!_0x3fb1d2[_0x29e1('0x45')]['hasOwnProperty'](_0x29e1('0x4d'))){_0x4fb816[_0x29e1('0x2e')]=qs[_0x29e1('0x2e')](_0x3fb1d2['query'][_0x29e1('0x2e')]);_0x4fb816[_0x29e1('0x2d')]=qs['offset'](_0x3fb1d2[_0x29e1('0x45')][_0x29e1('0x2d')]);}_0x4fb816[_0x29e1('0x4e')]=qs[_0x29e1('0x4f')](_0x3fb1d2[_0x29e1('0x45')][_0x29e1('0x4f')]);_0x4fb816[_0x29e1('0x50')]=qs[_0x29e1('0x47')](_[_0x29e1('0x51')](_0x3fb1d2[_0x29e1('0x45')],_0x54a0d9[_0x29e1('0x47')]));_0x4fb816[_0x29e1('0x50')][_0x29e1('0x60')]=_0x470af0['id'];if(_0x3fb1d2[_0x29e1('0x45')][_0x29e1('0x64')]){_0x4fb816[_0x29e1('0x50')]=_[_0x29e1('0x58')](_0x4fb816[_0x29e1('0x50')],{'$or':_['map'](_0x4fb816[_0x29e1('0x49')],function(_0x126da1){var _0x2fcca9={};_0x2fcca9[_0x126da1]={'$like':'%'+_0x3fb1d2[_0x29e1('0x45')][_0x29e1('0x64')]+'%'};return _0x2fcca9;})});}_0x4fb816=_[_0x29e1('0x58')]({},_0x4fb816,_0x3fb1d2['options']);return db['Disposition'][_0x29e1('0x2c')]({'where':_0x4fb816[_0x29e1('0x50')]})[_0x29e1('0x1f')](function(_0x16a416){_0x181878[_0x29e1('0x2c')]=_0x16a416;if(_0x3fb1d2['query'][_0x29e1('0x57')]){_0x4fb816['include']=[{'all':!![]}];}return db[_0x29e1('0x61')][_0x29e1('0x54')](_0x4fb816);})['then'](function(_0x3b2eb9){_0x181878['rows']=_0x3b2eb9;return _0x181878;});}})[_0x29e1('0x1f')](respondWithFilteredResult(_0x3cb448,_0x4fb816))[_0x29e1('0x29')](handleError(_0x3cb448,null));};exports['removeDispositions']=function(_0x536c99,_0x3f7ad2,_0x362431){return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x536c99[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x3f7ad2,null))['then'](function(_0x546623){if(_0x546623){return _0x546623['removeDispositions'](_0x536c99[_0x29e1('0x45')]['ids']);}})[_0x29e1('0x1f')](respondWithStatusCode(_0x3f7ad2,null))[_0x29e1('0x29')](handleError(_0x3f7ad2,null));};exports[_0x29e1('0x65')]=function(_0x5bfe5c,_0x411f09,_0x253f6b){if(_0x5bfe5c[_0x29e1('0x5b')]['id']){delete _0x5bfe5c[_0x29e1('0x5b')]['id'];}return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x5bfe5c[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x411f09,null))['then'](function(_0x41c609){if(_0x41c609){_0x5bfe5c['body'][_0x29e1('0x60')]=_0x41c609['id'];return db[_0x29e1('0x66')]['create'](_0x5bfe5c[_0x29e1('0x5b')]);}})[_0x29e1('0x1f')](respondWithResult(_0x411f09,null))[_0x29e1('0x29')](handleError(_0x411f09,null));};exports['getAnswers']=function(_0x44758b,_0x39c9f0,_0x12ee93){var _0x2c7a61={'raw':![],'where':{}};var _0x2d0fac={};var _0x1e35f2={'count':0x0,'rows':[]};return db[_0x29e1('0x40')]['findOne']({'where':{'id':_0x44758b[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x39c9f0,null))[_0x29e1('0x1f')](function(_0x4bfba3){if(_0x4bfba3){_0x2d0fac[_0x29e1('0x44')]=_[_0x29e1('0x46')](db[_0x29e1('0x66')]['rawAttributes']);_0x2d0fac[_0x29e1('0x45')]=_['keys'](_0x44758b[_0x29e1('0x45')]);_0x2d0fac[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x2d0fac[_0x29e1('0x44')],_0x2d0fac['query']);_0x2c7a61['attributes']=_[_0x29e1('0x48')](_0x2d0fac[_0x29e1('0x44')],qs[_0x29e1('0x4a')](_0x44758b[_0x29e1('0x45')][_0x29e1('0x4a')]));_0x2c7a61[_0x29e1('0x49')]=_0x2c7a61[_0x29e1('0x49')]['length']?_0x2c7a61[_0x29e1('0x49')]:_0x2d0fac[_0x29e1('0x44')];if(!_0x44758b[_0x29e1('0x45')][_0x29e1('0x4c')](_0x29e1('0x4d'))){_0x2c7a61[_0x29e1('0x2e')]=qs[_0x29e1('0x2e')](_0x44758b[_0x29e1('0x45')][_0x29e1('0x2e')]);_0x2c7a61[_0x29e1('0x2d')]=qs[_0x29e1('0x2d')](_0x44758b[_0x29e1('0x45')][_0x29e1('0x2d')]);}_0x2c7a61[_0x29e1('0x4e')]=qs['sort'](_0x44758b[_0x29e1('0x45')]['sort']);_0x2c7a61['where']=qs[_0x29e1('0x47')](_['pick'](_0x44758b[_0x29e1('0x45')],_0x2d0fac[_0x29e1('0x47')]));_0x2c7a61['where'][_0x29e1('0x60')]=_0x4bfba3['id'];if(_0x44758b[_0x29e1('0x45')][_0x29e1('0x64')]){_0x2c7a61['where']=_[_0x29e1('0x58')](_0x2c7a61[_0x29e1('0x50')],{'$or':_[_0x29e1('0x3f')](_0x2c7a61['attributes'],function(_0x109d9c){var _0x3caa81={};_0x3caa81[_0x109d9c]={'$like':'%'+_0x44758b['query'][_0x29e1('0x64')]+'%'};return _0x3caa81;})});}_0x2c7a61=_['merge']({},_0x2c7a61,_0x44758b[_0x29e1('0x59')]);return db[_0x29e1('0x66')]['count']({'where':_0x2c7a61[_0x29e1('0x50')]})[_0x29e1('0x1f')](function(_0x16d536){_0x1e35f2[_0x29e1('0x2c')]=_0x16d536;if(_0x44758b[_0x29e1('0x45')][_0x29e1('0x57')]){_0x2c7a61[_0x29e1('0x53')]=[{'all':!![]}];}return db[_0x29e1('0x66')][_0x29e1('0x54')](_0x2c7a61);})[_0x29e1('0x1f')](function(_0x49dee9){_0x1e35f2[_0x29e1('0x55')]=_0x49dee9;return _0x1e35f2;});}})[_0x29e1('0x1f')](respondWithFilteredResult(_0x39c9f0,_0x2c7a61))['catch'](handleError(_0x39c9f0,null));};exports[_0x29e1('0x67')]=function(_0x2fa358,_0x17739a,_0x710366){return db['MailAccount'][_0x29e1('0x5a')]({'where':{'id':_0x2fa358['params']['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x17739a,null))['then'](function(_0x1d2995){if(_0x1d2995){return _0x1d2995[_0x29e1('0x67')](_0x2fa358[_0x29e1('0x45')][_0x29e1('0x68')]);}})['then'](respondWithStatusCode(_0x17739a,null))['catch'](handleError(_0x17739a,null));};exports[_0x29e1('0x62')]=function(_0x2734ab,_0x467a1b){var _0x4cd6af={'name':_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x37')],'key':_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x43')],'email':_0x2734ab['body']['email'],'ListId':_0x2734ab['body'][_0x29e1('0x69')],'active':!_[_0x29e1('0x6a')](_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x6b')])?_0x2734ab['body'][_0x29e1('0x6b')]:!![],'description':_0x2734ab['body'][_0x29e1('0x6c')]||null,'Imap':{},'Smtp':{}};if(_[_0x29e1('0x6a')](_0x2734ab['body']['cservice'])){if(_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x6d')]){_0x4cd6af[_0x29e1('0x3b')]['user']=_0x4cd6af[_0x29e1('0x5d')][_0x29e1('0x6e')]=_0x2734ab['body'][_0x29e1('0x6f')];_0x4cd6af[_0x29e1('0x3b')][_0x29e1('0x70')]=_0x4cd6af['Smtp'][_0x29e1('0x71')]=_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x72')];}else{_0x4cd6af[_0x29e1('0x3b')][_0x29e1('0x73')]=_0x4cd6af[_0x29e1('0x5d')][_0x29e1('0x73')]=![];}_0x4cd6af[_0x29e1('0x3b')][_0x29e1('0x74')]=_0x2734ab['body'][_0x29e1('0x3b')][_0x29e1('0x74')];_0x4cd6af[_0x29e1('0x3b')]['port']=_0x2734ab[_0x29e1('0x5b')]['Imap']['port'];_0x4cd6af[_0x29e1('0x5d')][_0x29e1('0x74')]=_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x5d')][_0x29e1('0x74')];_0x4cd6af[_0x29e1('0x5d')]['port']=_0x2734ab['body']['Smtp'][_0x29e1('0x75')];}else{_0x4cd6af[_0x29e1('0x3b')]['service']=_0x4cd6af[_0x29e1('0x5d')][_0x29e1('0x76')]=_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x77')];_0x4cd6af[_0x29e1('0x3b')][_0x29e1('0x6e')]=_0x4cd6af[_0x29e1('0x5d')]['user']=_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x6f')];_0x4cd6af[_0x29e1('0x3b')][_0x29e1('0x70')]=_0x4cd6af[_0x29e1('0x5d')]['pass']=_0x2734ab[_0x29e1('0x5b')][_0x29e1('0x72')];}return db[_0x29e1('0x40')]['create'](_0x4cd6af,{'include':[{'model':db[_0x29e1('0x3c')],'as':_0x29e1('0x5d')},{'model':db['MailServerIn'],'as':_0x29e1('0x3b')}]})['then'](function(_0x42f370){var _0x23d84b=_0x2734ab[_0x29e1('0x6e')][_0x29e1('0x33')]({'plain':!![]});if(!_0x23d84b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23d84b[_0x29e1('0x78')]===_0x29e1('0x6e')){var _0x3ec604=_0x42f370[_0x29e1('0x33')]({'plain':!![]});return db[_0x29e1('0x79')][_0x29e1('0x5a')]({'where':{'name':_0x29e1('0x7a'),'userProfileId':_0x23d84b[_0x29e1('0x7b')]},'raw':!![]})[_0x29e1('0x1f')](function(_0x43d08e){if(_0x43d08e&&_0x43d08e[_0x29e1('0x7c')]===0x0){return db[_0x29e1('0x7d')]['create']({'name':_0x3ec604['name'],'resourceId':_0x3ec604['id'],'type':_0x43d08e[_0x29e1('0x37')],'sectionId':_0x43d08e['id']},{})['then'](function(){return _0x42f370;});}else{return _0x42f370;}})[_0x29e1('0x29')](function(_0x2ff185){logger[_0x29e1('0x26')](_0x29e1('0x7e'),_0x2ff185);throw _0x2ff185;});}return _0x42f370;})['then'](respondWithResult(_0x467a1b,0xc9))[_0x29e1('0x29')](handleError(_0x467a1b,null));};exports[_0x29e1('0x7f')]=function(_0x3a0895,_0x4a0bb7,_0x46021f){return db[_0x29e1('0x40')]['findOne']({'where':{'id':_0x3a0895['params']['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x4a0bb7,null))[_0x29e1('0x1f')](function(_0x41ab3b){if(_0x41ab3b){return _0x41ab3b[_0x29e1('0x7f')]();}return null;})[_0x29e1('0x1f')](respondWithResult(_0x4a0bb7,null))[_0x29e1('0x29')](handleError(_0x4a0bb7,null));};exports[_0x29e1('0x80')]=function(_0x2254ad,_0x140a41,_0x147f95){if(_0x2254ad[_0x29e1('0x5b')]['id']){delete _0x2254ad['body']['id'];}return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x2254ad[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x140a41,null))[_0x29e1('0x1f')](function(_0x32a4f5){if(_0x32a4f5){_0x2254ad[_0x29e1('0x5b')][_0x29e1('0x60')]=_0x32a4f5['id'];return db[_0x29e1('0x3a')]['create'](_0x2254ad[_0x29e1('0x5b')]);}})[_0x29e1('0x1f')](respondWithResult(_0x140a41,null))[_0x29e1('0x29')](handleError(_0x140a41,null));};exports[_0x29e1('0x81')]=function(_0x528348,_0x1c3d4f,_0xdaebd1){return db[_0x29e1('0x40')][_0x29e1('0x63')]({'where':{'id':_0x528348[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x1c3d4f,null))[_0x29e1('0x1f')](function(_0x47ed3a){if(_0x47ed3a){return _0x47ed3a[_0x29e1('0x82')](null);}return null;})[_0x29e1('0x1f')](respondWithStatusCode(_0x1c3d4f,null))[_0x29e1('0x29')](handleError(_0x1c3d4f,null));};exports[_0x29e1('0x83')]=function(_0x392f70,_0x107452,_0x377987){return db[_0x29e1('0x40')]['findOne']({'where':{'id':_0x392f70[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x107452,null))[_0x29e1('0x1f')](function(_0x100bc1){if(_0x100bc1){return _0x100bc1[_0x29e1('0x83')]();}return null;})[_0x29e1('0x1f')](respondWithResult(_0x107452,null))[_0x29e1('0x29')](handleError(_0x107452,null));};exports[_0x29e1('0x84')]=function(_0x20c02f,_0x310ade,_0xeef0f4){if(_0x20c02f[_0x29e1('0x5b')]['id']){delete _0x20c02f[_0x29e1('0x5b')]['id'];}return db[_0x29e1('0x40')]['find']({'where':{'id':_0x20c02f[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x310ade,null))[_0x29e1('0x1f')](function(_0x5d55a4){if(_0x5d55a4){_0x20c02f['body'][_0x29e1('0x60')]=_0x5d55a4['id'];return db[_0x29e1('0x3c')][_0x29e1('0x62')](_0x20c02f[_0x29e1('0x5b')]);}})[_0x29e1('0x1f')](respondWithResult(_0x310ade,null))[_0x29e1('0x29')](handleError(_0x310ade,null));};exports[_0x29e1('0x85')]=function(_0x349780,_0x3594f3,_0x46eaba){return db[_0x29e1('0x40')][_0x29e1('0x63')]({'where':{'id':_0x349780[_0x29e1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3594f3,null))[_0x29e1('0x1f')](function(_0x5a921c){if(_0x5a921c){return _0x5a921c[_0x29e1('0x86')](null);}return null;})[_0x29e1('0x1f')](respondWithStatusCode(_0x3594f3,null))[_0x29e1('0x29')](handleError(_0x3594f3,null));};exports['addInteraction']=function(_0x4d38a5,_0x39765c,_0x296e69){return db[_0x29e1('0x87')][_0x29e1('0x5a')]({'where':{'id':_0x4d38a5['params']['id']}})['then'](handleEntityNotFound(_0x39765c,null))[_0x29e1('0x1f')](function(_0x1bb3c5){if(_0x1bb3c5){return _0x1bb3c5['addInteraction'](_0x4d38a5['body'][_0x29e1('0x68')],_[_0x29e1('0x88')](_0x4d38a5[_0x29e1('0x5b')],[_0x29e1('0x68'),'id'])||{});}})['then'](respondWithResult(_0x39765c,null))[_0x29e1('0x29')](handleError(_0x39765c,null));};exports[_0x29e1('0x89')]=function(_0xaf921,_0x373f02,_0x277a5b){var _0x33bcdc={'raw':![],'where':{}};var _0x31c15d={};var _0x207869={'count':0x0,'rows':[]};return db[_0x29e1('0x40')][_0x29e1('0x63')]({'where':{'id':_0xaf921['params']['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x373f02,null))[_0x29e1('0x1f')](function(_0x22641c){if(_0x22641c){_0x31c15d[_0x29e1('0x44')]=_['keys'](db[_0x29e1('0x87')][_0x29e1('0x41')]);_0x31c15d[_0x29e1('0x45')]=_['keys'](_0xaf921['query']);_0x31c15d[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x31c15d['model'],_0x31c15d['query']);_0x33bcdc[_0x29e1('0x49')]=_['intersection'](_0x31c15d['model'],qs[_0x29e1('0x4a')](_0xaf921[_0x29e1('0x45')][_0x29e1('0x4a')]));_0x33bcdc['attributes']=_0x33bcdc[_0x29e1('0x49')][_0x29e1('0x4b')]?_0x33bcdc[_0x29e1('0x49')]:_0x31c15d[_0x29e1('0x44')];if(!_0xaf921[_0x29e1('0x45')][_0x29e1('0x4c')](_0x29e1('0x4d'))){_0x33bcdc[_0x29e1('0x2e')]=qs[_0x29e1('0x2e')](_0xaf921[_0x29e1('0x45')][_0x29e1('0x2e')]);_0x33bcdc[_0x29e1('0x2d')]=qs[_0x29e1('0x2d')](_0xaf921['query'][_0x29e1('0x2d')]);}_0x33bcdc[_0x29e1('0x4e')]=qs[_0x29e1('0x4f')](_0xaf921[_0x29e1('0x45')]['sort']);_0x33bcdc[_0x29e1('0x50')]=qs[_0x29e1('0x47')](_['pick'](_0xaf921[_0x29e1('0x45')],_0x31c15d[_0x29e1('0x47')]));_0x33bcdc[_0x29e1('0x50')][_0x29e1('0x60')]=_0x22641c['id'];if(_0xaf921[_0x29e1('0x45')]['filter']){_0x33bcdc[_0x29e1('0x50')]=_[_0x29e1('0x58')](_0x33bcdc[_0x29e1('0x50')],{'$or':_['map'](_0x33bcdc[_0x29e1('0x49')],function(_0x5577fb){var _0x222426={};_0x222426[_0x5577fb]={'$like':'%'+_0xaf921[_0x29e1('0x45')][_0x29e1('0x64')]+'%'};return _0x222426;})});}_0x33bcdc=_['merge']({},_0x33bcdc,_0xaf921[_0x29e1('0x59')]);return db[_0x29e1('0x87')]['count']({'where':_0x33bcdc[_0x29e1('0x50')]})[_0x29e1('0x1f')](function(_0x347ee3){_0x207869['count']=_0x347ee3;if(_0xaf921['query'][_0x29e1('0x57')]){_0x33bcdc[_0x29e1('0x53')]=[{'model':db[_0x29e1('0x8a')],'as':_0x29e1('0x8b'),'required':![]},{'model':db['User'],'as':_0x29e1('0x8c'),'attributes':[_0x29e1('0x37'),_0x29e1('0x8d'),_0x29e1('0x8e')],'required':![]},{'model':db[_0x29e1('0x8f')],'as':_0x29e1('0x90'),'attributes':['id','name',_0x29e1('0x91')],'where':_0xaf921[_0x29e1('0x45')]['tag']?{'id':_0xaf921[_0x29e1('0x45')][_0x29e1('0x92')]}:undefined,'required':_0xaf921[_0x29e1('0x45')][_0x29e1('0x92')]?!![]:![]}];}return db[_0x29e1('0x87')][_0x29e1('0x54')](_0x33bcdc);})[_0x29e1('0x1f')](function(_0x2d99b6){_0x207869['rows']=_0x2d99b6;return _0x207869;});}})[_0x29e1('0x1f')](respondWithFilteredResult(_0x373f02,_0x33bcdc))[_0x29e1('0x29')](handleError(_0x373f02,null));};exports[_0x29e1('0x93')]=function(_0x496c1b,_0x354ba2,_0x205096){return db[_0x29e1('0x40')][_0x29e1('0x63')]({'where':{'id':_0x496c1b[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x354ba2,null))[_0x29e1('0x1f')](function(_0x4581d6){if(_0x4581d6){return db[_0x29e1('0x94')][_0x29e1('0x95')](function(_0x1dcc43){return db[_0x29e1('0x96')]['destroy']({'where':{'MailAccountId':_0x496c1b[_0x29e1('0x5c')]['id']},'transaction':_0x1dcc43})[_0x29e1('0x1f')](function(_0x214576){var _0x4c7193=_[_0x29e1('0x3f')](_0x496c1b[_0x29e1('0x5b')],function(_0x685ada){_0x685ada[_0x29e1('0x60')]=_0x496c1b[_0x29e1('0x5c')]['id'];return _0x685ada;});return db[_0x29e1('0x96')][_0x29e1('0x97')](_0x4c7193,{'transaction':_0x1dcc43});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x496c1b[_0x29e1('0x5c')]['id']},'order':_0x29e1('0x98')});});}})['then'](respondWithResult(_0x354ba2,null))[_0x29e1('0x29')](handleError(_0x354ba2,null));};exports[_0x29e1('0x99')]=function(_0x2e2e59,_0x6b37dd,_0x2cb147){var _0x573559={};var _0x2cbd35={};var _0xb8dbd2;var _0x59caa5;return db[_0x29e1('0x40')]['findOne']({'where':{'id':_0x2e2e59[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x6b37dd,null))[_0x29e1('0x1f')](function(_0x5dc546){if(_0x5dc546){_0xb8dbd2=_0x5dc546;_0x2cbd35['model']=_['keys'](db[_0x29e1('0x96')][_0x29e1('0x41')]);_0x2cbd35[_0x29e1('0x45')]=_[_0x29e1('0x46')](_0x2e2e59[_0x29e1('0x45')]);_0x2cbd35[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x2cbd35[_0x29e1('0x44')],_0x2cbd35['query']);_0x573559['attributes']=_[_0x29e1('0x48')](_0x2cbd35[_0x29e1('0x44')],qs[_0x29e1('0x4a')](_0x2e2e59[_0x29e1('0x45')][_0x29e1('0x4a')]));_0x573559[_0x29e1('0x49')]=_0x573559['attributes']['length']?_0x573559[_0x29e1('0x49')]:_0x2cbd35[_0x29e1('0x44')];_0x573559[_0x29e1('0x4e')]=qs[_0x29e1('0x4f')](_0x2e2e59[_0x29e1('0x45')][_0x29e1('0x4f')]);_0x573559['where']=qs[_0x29e1('0x47')](_['pick'](_0x2e2e59[_0x29e1('0x45')],_0x2cbd35[_0x29e1('0x47')]));if(_0x2e2e59[_0x29e1('0x45')]['filter']){_0x573559[_0x29e1('0x50')]=_['merge'](_0x573559[_0x29e1('0x50')],{'$or':_['map'](_0x573559[_0x29e1('0x49')],function(_0x3f29c1){var _0x2a9ef6={};_0x2a9ef6[_0x3f29c1]={'$like':'%'+_0x2e2e59[_0x29e1('0x45')][_0x29e1('0x64')]+'%'};return _0x2a9ef6;})});}_0x573559=_[_0x29e1('0x58')]({},_0x573559,_0x2e2e59[_0x29e1('0x59')]);return _0xb8dbd2[_0x29e1('0x99')](_0x573559);}})['then'](function(_0x2b6de2){if(_0x2b6de2){_0x59caa5=_0x2b6de2[_0x29e1('0x4b')];if(!_0x2e2e59['query'][_0x29e1('0x4c')](_0x29e1('0x4d'))){_0x573559[_0x29e1('0x2e')]=qs[_0x29e1('0x2e')](_0x2e2e59[_0x29e1('0x45')][_0x29e1('0x2e')]);_0x573559[_0x29e1('0x2d')]=qs['offset'](_0x2e2e59[_0x29e1('0x45')][_0x29e1('0x2d')]);}return _0xb8dbd2['getApplications'](_0x573559);}})[_0x29e1('0x1f')](function(_0x29920e){if(_0x29920e){return _0x29920e?{'count':_0x59caa5,'rows':_0x29920e}:null;}})[_0x29e1('0x1f')](respondWithResult(_0x6b37dd,null))[_0x29e1('0x29')](handleError(_0x6b37dd,null));};exports[_0x29e1('0x9a')]=function(_0x4fb48d,_0x246704,_0x29014e){var _0x8240ff={'raw':!![],'where':{}};var _0x1ff70a={};var _0x53d25e={'count':0x0,'rows':[]};return db[_0x29e1('0x40')]['findOne']({'where':{'id':_0x4fb48d[_0x29e1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x246704,null))[_0x29e1('0x1f')](function(_0x163da7){if(_0x163da7){_0x1ff70a['model']=_[_0x29e1('0x46')](db[_0x29e1('0x9b')][_0x29e1('0x41')]);_0x1ff70a['query']=_['keys'](_0x4fb48d['query']);_0x1ff70a[_0x29e1('0x47')]=_[_0x29e1('0x48')](_0x1ff70a[_0x29e1('0x44')],_0x1ff70a[_0x29e1('0x45')]);_0x8240ff['attributes']=_['intersection'](_0x1ff70a[_0x29e1('0x44')],qs[_0x29e1('0x4a')](_0x4fb48d[_0x29e1('0x45')]['fields']));_0x8240ff[_0x29e1('0x49')]=_0x8240ff[_0x29e1('0x49')][_0x29e1('0x4b')]?_0x8240ff[_0x29e1('0x49')]:_0x1ff70a[_0x29e1('0x44')];if(!_0x4fb48d['query'][_0x29e1('0x4c')](_0x29e1('0x4d'))){_0x8240ff[_0x29e1('0x2e')]=qs['limit'](_0x4fb48d[_0x29e1('0x45')][_0x29e1('0x2e')]);_0x8240ff[_0x29e1('0x2d')]=qs['offset'](_0x4fb48d[_0x29e1('0x45')][_0x29e1('0x2d')]);}_0x8240ff[_0x29e1('0x4e')]=qs[_0x29e1('0x4f')](_0x4fb48d['query'][_0x29e1('0x4f')]);_0x8240ff[_0x29e1('0x50')]=qs[_0x29e1('0x47')](_['pick'](_0x4fb48d[_0x29e1('0x45')],_0x1ff70a[_0x29e1('0x47')]));_0x8240ff[_0x29e1('0x50')][_0x29e1('0x60')]=_0x163da7['id'];if(_0x4fb48d[_0x29e1('0x45')][_0x29e1('0x64')]){_0x8240ff[_0x29e1('0x50')]=_[_0x29e1('0x58')](_0x8240ff[_0x29e1('0x50')],{'$or':_[_0x29e1('0x3f')](_0x8240ff[_0x29e1('0x49')],function(_0x56d363){var _0x124710={};_0x124710[_0x56d363]={'$like':'%'+_0x4fb48d['query'][_0x29e1('0x64')]+'%'};return _0x124710;})});}if(_0x4fb48d[_0x29e1('0x45')][_0x29e1('0x9c')]){var _0x5a20c3=_0x4fb48d[_0x29e1('0x45')]['$gte'][_0x29e1('0x9d')](',');var _0x5177ee={};_0x5177ee[_0x5a20c3[0x0]]={'$gte':moment(_0x5a20c3[0x1])[_0x29e1('0x9e')](_0x29e1('0x9f'))};_0x8240ff[_0x29e1('0x50')]=_[_0x29e1('0x58')](_0x8240ff[_0x29e1('0x50')],_0x5177ee);}_0x8240ff=_[_0x29e1('0x58')]({},_0x8240ff,_0x4fb48d[_0x29e1('0x59')]);return db[_0x29e1('0x9b')][_0x29e1('0x2c')]({'where':_0x8240ff[_0x29e1('0x50')]})[_0x29e1('0x1f')](function(_0x87e69a){_0x53d25e['count']=_0x87e69a;if(_0x4fb48d['query'][_0x29e1('0x57')]){_0x8240ff['include']=[{'all':!![]}];}return db[_0x29e1('0x9b')][_0x29e1('0x54')](_0x8240ff);})['then'](function(_0x48ecd2){_0x53d25e[_0x29e1('0x55')]=_0x48ecd2;return _0x53d25e;});}})[_0x29e1('0x1f')](respondWithFilteredResult(_0x246704,_0x8240ff))['catch'](handleError(_0x246704,null));};exports[_0x29e1('0x38')]=function(_0x40680b,_0xd11a84,_0x3eec04){var _0x37c3df,_0x476e8d={},_0x428266;if(_0x40680b[_0x29e1('0x5b')]['to']){_0x428266=_0x40680b[_0x29e1('0x5b')]['to'][_0x29e1('0x9d')](',')[0x0];}return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x40680b[_0x29e1('0x5c')]['id']},'include':[{'model':db[_0x29e1('0xa0')],'as':_0x29e1('0xa1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x428266},'limit':0x1,'order':[[_0x29e1('0xa2'),_0x29e1('0xa3')]]}]},{'model':db[_0x29e1('0x3c')],'as':_0x29e1('0x5d'),'raw':!![]}]})['then'](handleEntityNotFound(_0xd11a84,null))['then'](function(_0x2a8126){if(_0x2a8126){_0x37c3df=_0x2a8126;if(_0x2a8126[_0x29e1('0x5d')]){if(_[_0x29e1('0x6a')](_0x40680b[_0x29e1('0x5b')][_0x29e1('0xa4')])){_0x40680b['body'][_0x29e1('0xa4')]=util['format'](_0x29e1('0xa5'),_0x2a8126['name'],_0x2a8126[_0x29e1('0xa6')]||_0x2a8126['Smtp']['user']);}if(_0x40680b[_0x29e1('0x5b')][_0x29e1('0xa7')]&&_0x40680b['body']['attachments']['length']){for(var _0x170d95=0x0;_0x170d95<_0x40680b['body'][_0x29e1('0xa7')][_0x29e1('0x4b')];_0x170d95+=0x1){_0x40680b[_0x29e1('0x5b')][_0x29e1('0xa7')][_0x170d95]={'filename':_0x40680b['body'][_0x29e1('0xa7')][_0x170d95][_0x29e1('0x37')],'path':path[_0x29e1('0xa8')](config[_0x29e1('0xa9')],_0x29e1('0xaa'),_0x40680b[_0x29e1('0x5b')][_0x29e1('0xa7')][_0x170d95][_0x29e1('0xab')])};}}var _0x489acc={'tls':{'rejectUnauthorized':![]}};if(_[_0x29e1('0x6a')](_0x2a8126[_0x29e1('0x5d')][_0x29e1('0x76')])){if(_0x2a8126['Smtp'][_0x29e1('0x73')]){_0x489acc[_0x29e1('0xac')]={'user':_0x2a8126[_0x29e1('0x5d')]['user'],'pass':_0x2a8126[_0x29e1('0x5d')][_0x29e1('0x71')]};}_0x489acc[_0x29e1('0x74')]=_0x2a8126[_0x29e1('0x5d')][_0x29e1('0x74')];_0x489acc[_0x29e1('0x75')]=_0x2a8126[_0x29e1('0x5d')][_0x29e1('0x75')];_0x489acc[_0x29e1('0xad')]=_0x2a8126[_0x29e1('0x5d')][_0x29e1('0xad')];}else{_0x489acc['service']=_0x2a8126[_0x29e1('0x5d')]['service'];_0x489acc['auth']={'user':_0x2a8126[_0x29e1('0x5d')]['user'],'pass':_0x2a8126[_0x29e1('0x5d')][_0x29e1('0x71')]};}return respondWithRpcPromise(_0x29e1('0xae'),'sendMail',{'account':_0x489acc,'message':_0x40680b[_0x29e1('0x5b')]});}else{throw new Error(_0x29e1('0xaf'));}}})[_0x29e1('0x1f')](function(_0x1fdd15){if(_0x1fdd15){_0x476e8d=_0x1fdd15;if(_0x37c3df[_0x29e1('0xa1')]){if(_0x37c3df[_0x29e1('0xa1')][_0x29e1('0xb0')][_0x29e1('0x4b')]){return _0x37c3df[_0x29e1('0xa1')][_0x29e1('0xb0')][0x0];}else{return db[_0x29e1('0x8a')]['create'](_[_0x29e1('0x16')](_0x40680b[_0x29e1('0x5b')],{'firstName':_0x40680b[_0x29e1('0x5b')]['to'],'email':_0x40680b[_0x29e1('0x5b')]['to'],'phone':_0x40680b[_0x29e1('0x5b')]['to'],'ListId':_0x37c3df[_0x29e1('0x69')]}));}}else{throw new Error(_0x29e1('0xaf'));}}})[_0x29e1('0x1f')](function(_0x33f56b){if(_0x33f56b){var _0x6876bb={'UserId':_0x40680b[_0x29e1('0x6e')]['id'],'ContactId':_0x33f56b['id'],'MailAccountId':_0x37c3df['id'],'inReplyTo':_0x476e8d[_0x29e1('0xb1')],'to':_0x40680b[_0x29e1('0x5b')][_0x29e1('0xa4')],'cc':_0x40680b['body']['cc'],'subject':_0x40680b[_0x29e1('0x5b')][_0x29e1('0xb2')],'attach':_0x40680b[_0x29e1('0x5b')][_0x29e1('0xb3')],'firstMsgDirection':_0x29e1('0xb4'),'lastMsgAt':moment()['format'](_0x29e1('0x9f')),'lastMsgDirection':'out','lastMsgBody':_0x40680b[_0x29e1('0x5b')][_0x29e1('0x5b')],'Messages':[_[_0x29e1('0x58')](_0x40680b[_0x29e1('0x5b')],{'messageId':_0x476e8d[_0x29e1('0xb1')],'sentAt':moment()[_0x29e1('0x9e')](_0x29e1('0x9f')),'read':!![],'MailAccountId':_0x37c3df['id'],'UserId':_0x40680b[_0x29e1('0x6e')]['id'],'ContactId':_0x33f56b['id']})]};if(_0x40680b[_0x29e1('0x5b')]['Interaction']){_0x6876bb=_[_0x29e1('0x58')](_0x6876bb,_0x40680b[_0x29e1('0x5b')][_0x29e1('0xb5')]);}return db['MailInteraction'][_0x29e1('0x62')](_0x6876bb,{'include':[{'model':db[_0x29e1('0x9b')],'as':_0x29e1('0xb6')}]});}})[_0x29e1('0x1f')](respondWithResult(_0xd11a84,null))[_0x29e1('0x29')](handleError(_0xd11a84,null));};exports[_0x29e1('0xb7')]=function(_0x4c146f,_0x606f52,_0x394ff5){return db['MailAccount']['find']({'where':{'id':_0x4c146f[_0x29e1('0x5c')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x29e1('0x1f')](handleEntityNotFound(_0x606f52,null))['then'](function(_0x2538fd){if(_0x2538fd&&_0x2538fd['Smtp']){var _0x1381ce={'id':_0x2538fd['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2538fd[_0x29e1('0x5d')][_0x29e1('0x76')]){_0x1381ce[_0x29e1('0x76')]=_0x2538fd[_0x29e1('0x5d')]['service'];}else{_0x1381ce[_0x29e1('0x74')]=_0x2538fd[_0x29e1('0x5d')]['host'];_0x1381ce[_0x29e1('0x75')]=_0x2538fd[_0x29e1('0x5d')]['port'];_0x1381ce[_0x29e1('0xad')]=_0x2538fd['Smtp'][_0x29e1('0xad')];}if(_0x2538fd['Smtp']['authentication']){_0x1381ce['auth']={'user':_0x2538fd[_0x29e1('0x5d')][_0x29e1('0x6e')],'pass':_0x2538fd[_0x29e1('0x5d')]['pass']};}return respondWithRpcPromise(_0x29e1('0xb8'),_0x29e1('0xb7'),{'account':_0x1381ce});}})[_0x29e1('0x1f')](respondWithResult(_0x606f52,null))['catch'](handleError(_0x606f52,null));};exports[_0x29e1('0x34')]=function(_0x236be0,_0x367e17){return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x236be0[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x367e17,null))[_0x29e1('0x1f')](function(_0x336dcc){if(_0x336dcc&&_0x336dcc[_0x29e1('0x76')]){throw new db[(_0x29e1('0x1e'))]['ValidationError'](_0x29e1('0xb9'));}return _0x336dcc;})['then'](removeEntity(_0x367e17,null))['catch'](handleError(_0x367e17,null));};exports[_0x29e1('0xba')]=function(_0x40a795,_0x551c98,_0x56f67d){return db[_0x29e1('0x40')][_0x29e1('0x5a')]({'where':{'id':_0x40a795['params']['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x551c98,null))[_0x29e1('0x1f')](function(_0x1455ab){if(_0x1455ab){return _0x1455ab[_0x29e1('0xba')](_0x40a795['body'][_0x29e1('0x68')],_[_0x29e1('0x88')](_0x40a795['body'],[_0x29e1('0x68'),'id'])||{})[_0x29e1('0xbb')](function(_0x4b7844){for(var _0x171778=0x0;_0x171778<_0x40a795['body']['ids'][_0x29e1('0x4b')];_0x171778+=0x1){socket['emit'](_0x29e1('0xbc'),{'UserId':_0x40a795[_0x29e1('0x5b')]['ids'][_0x171778],'MailAccountId':_0x40a795[_0x29e1('0x5c')]['id']});}return _0x4b7844;});}})[_0x29e1('0x1f')](respondWithResult(_0x551c98,null))['catch'](handleError(_0x551c98,null));};exports[_0x29e1('0xbd')]=function(_0x208640,_0x41389f,_0x33b47a){return db['MailAccount'][_0x29e1('0x5a')]({'where':{'id':_0x208640[_0x29e1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x41389f,null))['then'](function(_0x2a98e7){if(_0x2a98e7){return _0x2a98e7[_0x29e1('0xbd')](_0x208640[_0x29e1('0x45')][_0x29e1('0x68')])[_0x29e1('0x1f')](function(){if(_[_0x29e1('0xbe')](_0x208640[_0x29e1('0x45')][_0x29e1('0x68')])){for(var _0x3892b3=0x0;_0x3892b3<_0x208640['query'][_0x29e1('0x68')][_0x29e1('0x4b')];_0x3892b3+=0x1){socket[_0x29e1('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x208640[_0x29e1('0x45')][_0x29e1('0x68')][_0x3892b3]),'MailAccountId':Number(_0x208640[_0x29e1('0x5c')]['id'])});}}else{socket[_0x29e1('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x208640[_0x29e1('0x45')][_0x29e1('0x68')]),'MailAccountId':Number(_0x208640['params']['id'])});}});}})[_0x29e1('0x1f')](respondWithStatusCode(_0x41389f,null))['catch'](handleError(_0x41389f,null));};exports['getAgents']=function(_0x4f745c,_0x1db7cc,_0x4371cf){var _0xbe3e7d={};var _0x32a0d9={};var _0x176405;var _0x26b005;return db[_0x29e1('0x40')][_0x29e1('0x63')]({'where':{'id':_0x4f745c[_0x29e1('0x5c')]['id']}})[_0x29e1('0x1f')](handleEntityNotFound(_0x1db7cc,null))[_0x29e1('0x1f')](function(_0x205712){if(_0x205712){_0x176405=_0x205712;_0x32a0d9[_0x29e1('0x44')]=_['keys'](db[_0x29e1('0xc0')]['rawAttributes']);_0x32a0d9[_0x29e1('0x45')]=_['keys'](_0x4f745c[_0x29e1('0x45')]);_0x32a0d9[_0x29e1('0x47')]=_['intersection'](_0x32a0d9['model'],_0x32a0d9['query']);_0xbe3e7d[_0x29e1('0x49')]=_[_0x29e1('0x48')](_0x32a0d9[_0x29e1('0x44')],qs['fields'](_0x4f745c[_0x29e1('0x45')][_0x29e1('0x4a')]));_0xbe3e7d[_0x29e1('0x49')]=_0xbe3e7d[_0x29e1('0x49')]['length']?_0xbe3e7d['attributes']:_0x32a0d9[_0x29e1('0x44')];_0xbe3e7d[_0x29e1('0x4e')]=qs[_0x29e1('0x4f')](_0x4f745c[_0x29e1('0x45')][_0x29e1('0x4f')]);_0xbe3e7d[_0x29e1('0x50')]=qs[_0x29e1('0x47')](_[_0x29e1('0x51')](_0x4f745c[_0x29e1('0x45')],_0x32a0d9[_0x29e1('0x47')]));if(_0x4f745c[_0x29e1('0x45')]['filter']){_0xbe3e7d['where']=_[_0x29e1('0x58')](_0xbe3e7d[_0x29e1('0x50')],{'$or':_['map'](_0xbe3e7d[_0x29e1('0x49')],function(_0x3a3dea){var _0x39560f={};_0x39560f[_0x3a3dea]={'$like':'%'+_0x4f745c['query'][_0x29e1('0x64')]+'%'};return _0x39560f;})});}_0xbe3e7d=_[_0x29e1('0x58')]({},_0xbe3e7d,_0x4f745c[_0x29e1('0x59')]);return _0x176405[_0x29e1('0xc1')](_0xbe3e7d);}})[_0x29e1('0x1f')](function(_0x3b6edd){if(_0x3b6edd){_0x26b005=_0x3b6edd[_0x29e1('0x4b')];if(!_0x4f745c[_0x29e1('0x45')][_0x29e1('0x4c')](_0x29e1('0x4d'))){_0xbe3e7d['limit']=qs[_0x29e1('0x2e')](_0x4f745c[_0x29e1('0x45')][_0x29e1('0x2e')]);_0xbe3e7d[_0x29e1('0x2d')]=qs[_0x29e1('0x2d')](_0x4f745c[_0x29e1('0x45')][_0x29e1('0x2d')]);}return _0x176405[_0x29e1('0xc1')](_0xbe3e7d);}})[_0x29e1('0x1f')](function(_0x4d5f18){if(_0x4d5f18){return _0x4d5f18?{'count':_0x26b005,'rows':_0x4d5f18}:null;}})[_0x29e1('0x1f')](respondWithResult(_0x1db7cc,null))[_0x29e1('0x29')](handleError(_0x1db7cc,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 11a5b1b..069323c 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 _0xa382=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x32238b,_0x378a44){var _0x18dd50=function(_0x4acab0){while(--_0x4acab0){_0x32238b['push'](_0x32238b['shift']());}};_0x18dd50(++_0x378a44);}(_0xa382,0x64));var _0x2a38=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa382[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0x2a38('0x0'));var MailAccount=require(_0x2a38('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2a38('0x2')](0x0);var events={'afterCreate':_0x2a38('0x3'),'afterUpdate':_0x2a38('0x4'),'afterDestroy':_0x2a38('0x5')};function emitEvent(_0x3f71d5){return function(_0xf66999,_0x456450,_0x3e683a){MailAccountEvents[_0x2a38('0x6')](_0x3f71d5+':'+_0xf66999['id'],_0xf66999);MailAccountEvents['emit'](_0x3f71d5,_0xf66999);_0x3e683a(null);};}for(var e in events){if(events[_0x2a38('0x7')](e)){var event=events[e];MailAccount[_0x2a38('0x8')](e,emitEvent(event));}}module[_0x2a38('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xafb2=['save','update','remove','emit','hasOwnProperty','hook','exports','events','MailAccount','setMaxListeners'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0xafb2,0x147));var _0x2afb=function(_0xdf6a4f,_0x3ed683){_0xdf6a4f=_0xdf6a4f-0x0;var _0x58aa05=_0xafb2[_0xdf6a4f];return _0x58aa05;};'use strict';var EventEmitter=require(_0x2afb('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x2afb('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2afb('0x2')](0x0);var events={'afterCreate':_0x2afb('0x3'),'afterUpdate':_0x2afb('0x4'),'afterDestroy':_0x2afb('0x5')};function emitEvent(_0x563798){return function(_0x51122f,_0x7af6c,_0xea97cb){MailAccountEvents[_0x2afb('0x6')](_0x563798+':'+_0x51122f['id'],_0x51122f);MailAccountEvents[_0x2afb('0x6')](_0x563798,_0x51122f);_0xea97cb(null);};}for(var e in events){if(events[_0x2afb('0x7')](e)){var event=events[e];MailAccount[_0x2afb('0x8')](e,emitEvent(event));}}module[_0x2afb('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 4e33f6a..3be72c8 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 _0x11bd=['rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x195c21,_0x332612){var _0x3576a8=function(_0xa4bde2){while(--_0xa4bde2){_0x195c21['push'](_0x195c21['shift']());}};_0x3576a8(++_0x332612);}(_0x11bd,0x125));var _0xd11b=function(_0x1a7408,_0x3ad72a){_0x1a7408=_0x1a7408-0x0;var _0x3121ad=_0x11bd[_0x1a7408];return _0x3121ad;};'use strict';var _=require(_0xd11b('0x0'));var util=require(_0xd11b('0x1'));var logger=require('../../config/logger')(_0xd11b('0x2'));var moment=require(_0xd11b('0x3'));var BPromise=require(_0xd11b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd11b('0x5'));var rimraf=require(_0xd11b('0x6'));var config=require(_0xd11b('0x7'));var attributes=require(_0xd11b('0x8'));module[_0xd11b('0x9')]=function(_0xcd7c94,_0x2140e1){return _0xcd7c94[_0xd11b('0xa')](_0xd11b('0xb'),attributes,{'tableName':_0xd11b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x454d=['bluebird','request-promise','path','rimraf','./mailAccount.attributes','define','mail_accounts','api'];(function(_0x5e596f,_0x3ff1bf){var _0x4cefe7=function(_0x51bfa0){while(--_0x51bfa0){_0x5e596f['push'](_0x5e596f['shift']());}};_0x4cefe7(++_0x3ff1bf);}(_0x454d,0x19f));var _0xd454=function(_0x58c851,_0x1f3d96){_0x58c851=_0x58c851-0x0;var _0x534d8a=_0x454d[_0x58c851];return _0x534d8a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd454('0x0'));var moment=require('moment');var BPromise=require(_0xd454('0x1'));var rp=require(_0xd454('0x2'));var fs=require('fs');var path=require(_0xd454('0x3'));var rimraf=require(_0xd454('0x4'));var config=require('../../config/environment');var attributes=require(_0xd454('0x5'));module['exports']=function(_0x4cbf0f,_0x28a053){return _0x4cbf0f[_0xd454('0x6')]('MailAccount',attributes,{'tableName':_0xd454('0x7'),'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 fb5bcf0..a3de178 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 _0x4d46=['agent','waitForTheAssignedAgent','Start','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','options','raw','where','attributes','include','map','model','debug','ShowMailAccount','NotifyMailAccount','body','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','Contacts','DESC','MailServerOut','Smtp','List','get','omit','Applications','applications','priority','asc','push','length','close','autoclose','*,*,*,*','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','attachments','originTo','Attachment','Attachments','UserId','User','name','unshift'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x4d46,0x197));var _0x64d4=function(_0x96bf55,_0x184b21){_0x96bf55=_0x96bf55-0x0;var _0x44c688=_0x4d46[_0x96bf55];return _0x44c688;};'use strict';var _=require(_0x64d4('0x0'));var util=require(_0x64d4('0x1'));var moment=require(_0x64d4('0x2'));var BPromise=require(_0x64d4('0x3'));var rs=require(_0x64d4('0x4'));var fs=require('fs');var Redis=require(_0x64d4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64d4('0x6'));var logger=require(_0x64d4('0x7'))(_0x64d4('0x8'));var config=require(_0x64d4('0x9'));var jayson=require(_0x64d4('0xa'));var client=jayson[_0x64d4('0xb')]['http']({'port':0x232c});config[_0x64d4('0xc')]=_[_0x64d4('0xd')](config['redis'],{'host':_0x64d4('0xe'),'port':0x18eb});var socket=require(_0x64d4('0xf'))(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4ce2cf,_0x56bfd2,_0x2811fc){return new BPromise(function(_0xf3d890,_0xda30b3){return client[_0x64d4('0x10')](_0x4ce2cf,_0x2811fc)[_0x64d4('0x11')](function(_0x2b3a6e){logger[_0x64d4('0x12')](_0x64d4('0x13'),_0x56bfd2,_0x64d4('0x14'));logger['debug'](_0x64d4('0x15'),_0x56bfd2,'request\x20sent',JSON[_0x64d4('0x16')](_0x2b3a6e));if(_0x2b3a6e[_0x64d4('0x17')]){if(_0x2b3a6e[_0x64d4('0x17')][_0x64d4('0x18')]===0x1f4){logger[_0x64d4('0x17')](_0x64d4('0x13'),_0x56bfd2,_0x2b3a6e['error'][_0x64d4('0x19')]);return _0xda30b3(_0x2b3a6e[_0x64d4('0x17')][_0x64d4('0x19')]);}logger[_0x64d4('0x17')](_0x64d4('0x13'),_0x56bfd2,_0x2b3a6e[_0x64d4('0x17')][_0x64d4('0x19')]);return _0xf3d890(_0x2b3a6e['error'][_0x64d4('0x19')]);}else{logger[_0x64d4('0x12')]('MailAccount,\x20%s,\x20%s',_0x56bfd2,_0x64d4('0x14'));_0xf3d890(_0x2b3a6e[_0x64d4('0x1a')][_0x64d4('0x19')]);}})[_0x64d4('0x1b')](function(_0x21455d){logger[_0x64d4('0x17')](_0x64d4('0x13'),_0x56bfd2,_0x21455d);_0xda30b3(_0x21455d);});});}exports[_0x64d4('0x1c')]=function(_0x4bbbf6){var _0x1e4870=this;return new Promise(function(_0x46e926,_0x35ee04){return db[_0x64d4('0x1d')]['findAll']({'raw':_0x4bbbf6['options']?_0x4bbbf6[_0x64d4('0x1e')][_0x64d4('0x1f')]===undefined?!![]:![]:!![],'where':_0x4bbbf6[_0x64d4('0x1e')]?_0x4bbbf6['options'][_0x64d4('0x20')]||null:null,'attributes':_0x4bbbf6[_0x64d4('0x1e')]?_0x4bbbf6[_0x64d4('0x1e')][_0x64d4('0x21')]||null:null,'limit':_0x4bbbf6[_0x64d4('0x1e')]?_0x4bbbf6[_0x64d4('0x1e')]['limit']||null:null,'include':_0x4bbbf6[_0x64d4('0x1e')]?_0x4bbbf6[_0x64d4('0x1e')][_0x64d4('0x22')]?_[_0x64d4('0x23')](_0x4bbbf6['options']['include'],function(_0x598457){return{'model':db[_0x598457[_0x64d4('0x24')]],'as':_0x598457['as'],'attributes':_0x598457['attributes'],'include':_0x598457[_0x64d4('0x22')]?_['map'](_0x598457[_0x64d4('0x22')],function(_0x44eb42){return{'model':db[_0x44eb42[_0x64d4('0x24')]],'as':_0x44eb42['as'],'attributes':_0x44eb42[_0x64d4('0x21')],'include':_0x44eb42[_0x64d4('0x22')]?_['map'](_0x44eb42['include'],function(_0x3865ef){return{'model':db[_0x3865ef[_0x64d4('0x24')]],'as':_0x3865ef['as'],'attributes':_0x3865ef[_0x64d4('0x21')]};}):[]};}):[]};}):[]:[]})[_0x64d4('0x11')](function(_0x77912e){logger[_0x64d4('0x12')](_0x64d4('0x1c'),_0x4bbbf6);logger['debug']('GetMailAccount',_0x4bbbf6,JSON[_0x64d4('0x16')](_0x77912e));_0x46e926(_0x77912e);})[_0x64d4('0x1b')](function(_0x572ce0){logger[_0x64d4('0x17')](_0x64d4('0x1c'),_0x572ce0[_0x64d4('0x19')],_0x4bbbf6);_0x35ee04(_0x1e4870[_0x64d4('0x17')](0x1f4,_0x572ce0[_0x64d4('0x19')]));});});};exports['ShowMailAccount']=function(_0x2f9523){var _0x5d1de7=this;return new Promise(function(_0x5d560e,_0x425593){return db[_0x64d4('0x1d')]['find']({'raw':_0x2f9523[_0x64d4('0x1e')]?_0x2f9523['options'][_0x64d4('0x1f')]===undefined?!![]:![]:!![],'where':_0x2f9523[_0x64d4('0x1e')]?_0x2f9523['options']['where']||null:null,'attributes':_0x2f9523[_0x64d4('0x1e')]?_0x2f9523[_0x64d4('0x1e')][_0x64d4('0x21')]||null:null,'include':_0x2f9523[_0x64d4('0x1e')]?_0x2f9523[_0x64d4('0x1e')]['include']?_[_0x64d4('0x23')](_0x2f9523[_0x64d4('0x1e')][_0x64d4('0x22')],function(_0x52a6f2){return{'model':db[_0x52a6f2['model']],'as':_0x52a6f2['as'],'attributes':_0x52a6f2[_0x64d4('0x21')],'include':_0x52a6f2[_0x64d4('0x22')]?_[_0x64d4('0x23')](_0x52a6f2[_0x64d4('0x22')],function(_0x372dc5){return{'model':db[_0x372dc5[_0x64d4('0x24')]],'as':_0x372dc5['as'],'attributes':_0x372dc5['attributes'],'include':_0x372dc5['include']?_[_0x64d4('0x23')](_0x372dc5[_0x64d4('0x22')],function(_0x4c3bea){return{'model':db[_0x4c3bea['model']],'as':_0x4c3bea['as'],'attributes':_0x4c3bea[_0x64d4('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x553f1a){logger['info']('ShowMailAccount',_0x2f9523);logger[_0x64d4('0x25')](_0x64d4('0x26'),_0x2f9523,JSON[_0x64d4('0x16')](_0x553f1a));_0x5d560e(_0x553f1a);})[_0x64d4('0x1b')](function(_0x2ca578){logger[_0x64d4('0x17')]('ShowMailAccount',_0x2ca578[_0x64d4('0x19')],_0x2f9523);_0x425593(_0x5d1de7[_0x64d4('0x17')](0x1f4,_0x2ca578[_0x64d4('0x19')]));});});};exports[_0x64d4('0x27')]=function(_0x2fd846){var _0x3fdf17=this;return new Promise(function(_0x2aeea6,_0x3c938c){var _0x57089f={'body':_0x2fd846[_0x64d4('0x28')],'channel':'mail'};var _0x14caef=_['difference'](_[_0x64d4('0x29')](db['CmContact']['rawAttributes']),[_0x64d4('0x2a'),_0x64d4('0x2b'),_0x64d4('0x2c'),_0x64d4('0x2d')]);var _0x435412=![];if(_0x2fd846[_0x64d4('0x28')]['id']){delete _0x2fd846[_0x64d4('0x28')]['id'];}if(_[_0x64d4('0x2e')](_0x2fd846[_0x64d4('0x28')]['from'])){return _0x3c938c(_0x3fdf17[_0x64d4('0x17')](0x1f4,_0x64d4('0x2f')));}if(_[_0x64d4('0x2e')](_0x2fd846[_0x64d4('0x28')]['body'])||_0x2fd846[_0x64d4('0x28')][_0x64d4('0x28')]===''){return _0x3c938c(_0x3fdf17['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x64d4('0x2e')](_0x2fd846['body'][_0x64d4('0x30')])){return _0x3c938c(_0x3fdf17['error'](0x1f4,_0x64d4('0x31')+_0x14caef));}if(!_[_0x64d4('0x32')](_0x14caef,_0x2fd846[_0x64d4('0x28')]['mapKey'])){return _0x3c938c(_0x3fdf17[_0x64d4('0x17')](0x1f4,_0x64d4('0x33')+_0x14caef));}var _0x2ec8f1={};_0x2ec8f1[_0x2fd846[_0x64d4('0x28')][_0x64d4('0x30')]]=_0x2fd846[_0x64d4('0x28')]['from'];return db[_0x64d4('0x1d')][_0x64d4('0x34')]({'where':{'id':_0x2fd846[_0x64d4('0x35')]['id']},'include':[{'model':db[_0x64d4('0x36')],'as':'List','include':[{'model':db[_0x64d4('0x37')],'as':_0x64d4('0x38'),'where':_0x2ec8f1,'limit':0x1,'order':[[_0x64d4('0x2b'),_0x64d4('0x39')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x64d4('0x3a')],'as':_0x64d4('0x3b')}]})['then'](function(_0x234e4e){if(_0x234e4e&&_0x234e4e[_0x64d4('0x3c')]){var _0x22ec28=_0x234e4e[_0x64d4('0x3d')]({'plain':!![]});_0x57089f['account']=_[_0x64d4('0x3e')](_0x22ec28,[_0x64d4('0x3f'),_0x64d4('0x3c')]);_0x57089f[_0x64d4('0x40')]=_0x22ec28[_0x64d4('0x3f')];_0x57089f['list']=_0x22ec28[_0x64d4('0x3c')];_0x57089f[_0x64d4('0x40')]=_['orderBy'](_0x57089f[_0x64d4('0x40')],[_0x64d4('0x41')],[_0x64d4('0x42')]);if(_0x57089f['account']&&_0x57089f[_0x64d4('0x35')]['autoclose']){_0x57089f[_0x64d4('0x40')][_0x64d4('0x43')]({'id':0x0,'priority':_0x57089f[_0x64d4('0x40')][_0x64d4('0x44')]+0x1,'app':_0x64d4('0x45'),'appdata':_0x64d4('0x46'),'interval':_0x64d4('0x47')});}if(_0x57089f['account']['Applications']){delete _0x57089f['account'][_0x64d4('0x3f')];}if(_0x57089f[_0x64d4('0x35')][_0x64d4('0x3c')]){delete _0x57089f[_0x64d4('0x35')][_0x64d4('0x3c')];}if(_0x22ec28[_0x64d4('0x3c')]['Contacts'][_0x64d4('0x44')]){return _0x22ec28[_0x64d4('0x3c')][_0x64d4('0x38')][0x0];}var _0x639e2c=_[_0x64d4('0xd')](_0x2fd846[_0x64d4('0x28')],{'firstName':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x48')],'ListId':_0x22ec28['ListId']});_0x639e2c[_0x2fd846[_0x64d4('0x28')][_0x64d4('0x30')]]=_0x2fd846[_0x64d4('0x28')][_0x64d4('0x48')];return db[_0x64d4('0x37')][_0x64d4('0x49')](_0x639e2c);}else{throw new Error(_0x64d4('0x4a'));}})[_0x64d4('0x11')](function(_0x260597){_0x57089f[_0x64d4('0x4b')]=_0x260597;if(_0x260597){if(!_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x4c')]){_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x4c')]=rs[_0x64d4('0x4d')]()+'\x20'+_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x48')];}var _0xf2ef5f={'ContactId':_0x260597['id'],'MailAccountId':_0x2fd846[_0x64d4('0x35')]['id'],'inReplyTo':_0x2fd846['body']['message'][_0x64d4('0x4c')],'to':_0x2fd846[_0x64d4('0x28')]['message']['from'],'cc':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')]['cc'],'subject':_0x2fd846['body'][_0x64d4('0x19')][_0x64d4('0x4e')],'attach':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x4f')],'lastMsgAt':moment()['format'](_0x64d4('0x50')),'lastMsgDirection':'in','lastMsgBody':_0x2fd846['body'][_0x64d4('0x28')]};return db[_0x64d4('0x51')][_0x64d4('0x34')]({'where':{'closed':![],'MailAccountId':_0x2fd846[_0x64d4('0x35')]['id']},'include':[{'model':db[_0x64d4('0x52')],'as':_0x64d4('0x53'),'attributes':['messageId'],'where':{'messageId':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x54')]}}]})[_0x64d4('0x11')](function(_0x586a4d){if(_0x586a4d){return[_0x586a4d,![]];}return db[_0x64d4('0x51')]['create'](_0xf2ef5f)[_0x64d4('0x11')](function(_0x47fc19){return[_0x47fc19,!![]];});});}else{throw new Error(_0x64d4('0x55'));}})[_0x64d4('0x56')](function(_0x3988a5,_0xca92f2){if(_0x3988a5){_0x435412=_0xca92f2;if(!_0xca92f2){return _0x3988a5[_0x64d4('0x57')]({'inReplyTo':_0x2fd846[_0x64d4('0x28')]['message'][_0x64d4('0x4c')],'to':_0x2fd846['body']['message'][_0x64d4('0x48')],'cc':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')]['cc'],'subject':_0x2fd846['body'][_0x64d4('0x19')][_0x64d4('0x4e')],'attach':_0x3988a5[_0x64d4('0x4f')]?_0x3988a5['attach']:_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0x64d4('0x58')](_0x64d4('0x50')),'lastMsgAt':moment()['format'](_0x64d4('0x50')),'lastMsgDirection':'in','lastMsgBody':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x28')]});}else{return _0x3988a5;}}})[_0x64d4('0x11')](function(_0x534e39){_0x57089f[_0x64d4('0x59')]=_0x534e39[_0x64d4('0x3d')]({'plain':!![]});_0x57089f[_0x64d4('0x59')]['created']=_0x435412;return db[_0x64d4('0x52')][_0x64d4('0x49')]({'body':_0x2fd846['body'][_0x64d4('0x28')],'MailAccountId':_0x2fd846[_0x64d4('0x35')]['id'],'MailInteractionId':_0x534e39['id'],'direction':'in','ContactId':_0x57089f[_0x64d4('0x4b')]['id'],'messageId':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x4c')],'from':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x48')],'to':_0x2fd846['body'][_0x64d4('0x19')]['to'],'cc':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')]['cc'],'subject':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x4e')],'attach':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')][_0x64d4('0x4f')],'Attachments':_0x2fd846['body'][_0x64d4('0x19')][_0x64d4('0x5a')],'originTo':_0x2fd846[_0x64d4('0x28')]['message'][_0x64d4('0x5b')],'originCc':_0x2fd846[_0x64d4('0x28')][_0x64d4('0x19')]['originCc'],'bcc':_0x2fd846['body'][_0x64d4('0x19')]['bcc']},{'include':[{'model':db[_0x64d4('0x5c')],'as':_0x64d4('0x5d')}]});})[_0x64d4('0x11')](function(_0x2bae1e){_0x57089f['message']=_0x2bae1e;if(_0x57089f[_0x64d4('0x59')][_0x64d4('0x5e')]){return db[_0x64d4('0x5f')][_0x64d4('0x34')]({'attributes':['id',_0x64d4('0x60')],'where':{'id':_0x57089f[_0x64d4('0x59')][_0x64d4('0x5e')]}})[_0x64d4('0x11')](function(_0x4e9e90){if(_0x4e9e90){_0x57089f[_0x64d4('0x40')][_0x64d4('0x61')]({'id':0x0,'priority':0x0,'app':_0x64d4('0x62'),'appdata':_0x4e9e90[_0x64d4('0x60')]+','+(_0x57089f[_0x64d4('0x35')][_0x64d4('0x63')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x64d4('0x64'),'startRouting',_0x57089f);});}return respondWithRpcPromise(_0x64d4('0x64'),'startRouting',_0x57089f);})[_0x64d4('0x11')](function(_0x50178d){_0x2aeea6(_0x50178d);})[_0x64d4('0x1b')](function(_0x3d4b9f){_0x3c938c(_0x3fdf17[_0x64d4('0x17')](0x1f4,_0x3d4b9f['message']));});});}; \ No newline at end of file +var _0x44d4=['options','attributes','limit','include','map','model','debug','ShowMailAccount','find','raw','where','body','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','push','autoclose','*,*,*,*','create','List\x20not\x20found','contact','generate','messageId','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','Contact\x20not\x20found','spread','attach','interaction','created','originTo','bcc','Attachment','Attachments','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetMailAccount','MailAccount','findAll'];(function(_0x446bfe,_0x28c7b6){var _0x2bcfdb=function(_0x5d7b9b){while(--_0x5d7b9b){_0x446bfe['push'](_0x446bfe['shift']());}};_0x2bcfdb(++_0x28c7b6);}(_0x44d4,0x161));var _0x444d=function(_0x3fb5eb,_0x5947a6){_0x3fb5eb=_0x3fb5eb-0x0;var _0x481291=_0x44d4[_0x3fb5eb];return _0x481291;};'use strict';var _=require(_0x444d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x444d('0x1'));var fs=require('fs');var Redis=require(_0x444d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x444d('0x3'));var config=require(_0x444d('0x4'));var jayson=require(_0x444d('0x5'));var client=jayson[_0x444d('0x6')][_0x444d('0x7')]({'port':0x232c});config[_0x444d('0x8')]=_[_0x444d('0x9')](config['redis'],{'host':_0x444d('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x444d('0x8')]));require(_0x444d('0xb'))[_0x444d('0xc')](socket);function respondWithRpcPromise(_0x3982b2,_0x26f553,_0x44cd15){return new BPromise(function(_0x2e98c9,_0x13a27c){return client[_0x444d('0xd')](_0x3982b2,_0x44cd15)[_0x444d('0xe')](function(_0x305815){logger['info'](_0x444d('0xf'),_0x26f553,_0x444d('0x10'));logger['debug'](_0x444d('0x11'),_0x26f553,_0x444d('0x10'),JSON[_0x444d('0x12')](_0x305815));if(_0x305815['error']){if(_0x305815[_0x444d('0x13')][_0x444d('0x14')]===0x1f4){logger[_0x444d('0x13')]('MailAccount,\x20%s,\x20%s',_0x26f553,_0x305815[_0x444d('0x13')]['message']);return _0x13a27c(_0x305815[_0x444d('0x13')][_0x444d('0x15')]);}logger[_0x444d('0x13')](_0x444d('0xf'),_0x26f553,_0x305815['error']['message']);return _0x2e98c9(_0x305815['error']['message']);}else{logger[_0x444d('0x16')](_0x444d('0xf'),_0x26f553,_0x444d('0x10'));_0x2e98c9(_0x305815['result']['message']);}})[_0x444d('0x17')](function(_0x144020){logger[_0x444d('0x13')](_0x444d('0xf'),_0x26f553,_0x144020);_0x13a27c(_0x144020);});});}exports[_0x444d('0x18')]=function(_0x4bbcd1){var _0x10639f=this;return new Promise(function(_0x474c65,_0x2c0e2a){return db[_0x444d('0x19')][_0x444d('0x1a')]({'raw':_0x4bbcd1[_0x444d('0x1b')]?_0x4bbcd1[_0x444d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4bbcd1['options']?_0x4bbcd1[_0x444d('0x1b')]['where']||null:null,'attributes':_0x4bbcd1['options']?_0x4bbcd1[_0x444d('0x1b')][_0x444d('0x1c')]||null:null,'limit':_0x4bbcd1[_0x444d('0x1b')]?_0x4bbcd1['options'][_0x444d('0x1d')]||null:null,'include':_0x4bbcd1[_0x444d('0x1b')]?_0x4bbcd1[_0x444d('0x1b')][_0x444d('0x1e')]?_[_0x444d('0x1f')](_0x4bbcd1[_0x444d('0x1b')][_0x444d('0x1e')],function(_0x394d06){return{'model':db[_0x394d06[_0x444d('0x20')]],'as':_0x394d06['as'],'attributes':_0x394d06['attributes'],'include':_0x394d06['include']?_[_0x444d('0x1f')](_0x394d06['include'],function(_0x58ca64){return{'model':db[_0x58ca64[_0x444d('0x20')]],'as':_0x58ca64['as'],'attributes':_0x58ca64['attributes'],'include':_0x58ca64[_0x444d('0x1e')]?_[_0x444d('0x1f')](_0x58ca64['include'],function(_0x1f6a96){return{'model':db[_0x1f6a96[_0x444d('0x20')]],'as':_0x1f6a96['as'],'attributes':_0x1f6a96[_0x444d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x444d('0xe')](function(_0x5aac3a){logger[_0x444d('0x16')]('GetMailAccount',_0x4bbcd1);logger[_0x444d('0x21')]('GetMailAccount',_0x4bbcd1,JSON[_0x444d('0x12')](_0x5aac3a));_0x474c65(_0x5aac3a);})[_0x444d('0x17')](function(_0x2dfad8){logger[_0x444d('0x13')](_0x444d('0x18'),_0x2dfad8['message'],_0x4bbcd1);_0x2c0e2a(_0x10639f[_0x444d('0x13')](0x1f4,_0x2dfad8[_0x444d('0x15')]));});});};exports[_0x444d('0x22')]=function(_0x371380){var _0x418512=this;return new Promise(function(_0x426062,_0x428155){return db[_0x444d('0x19')][_0x444d('0x23')]({'raw':_0x371380['options']?_0x371380['options'][_0x444d('0x24')]===undefined?!![]:![]:!![],'where':_0x371380[_0x444d('0x1b')]?_0x371380['options'][_0x444d('0x25')]||null:null,'attributes':_0x371380[_0x444d('0x1b')]?_0x371380[_0x444d('0x1b')][_0x444d('0x1c')]||null:null,'include':_0x371380[_0x444d('0x1b')]?_0x371380['options']['include']?_['map'](_0x371380[_0x444d('0x1b')][_0x444d('0x1e')],function(_0x5935d9){return{'model':db[_0x5935d9[_0x444d('0x20')]],'as':_0x5935d9['as'],'attributes':_0x5935d9['attributes'],'include':_0x5935d9[_0x444d('0x1e')]?_[_0x444d('0x1f')](_0x5935d9[_0x444d('0x1e')],function(_0x283451){return{'model':db[_0x283451[_0x444d('0x20')]],'as':_0x283451['as'],'attributes':_0x283451['attributes'],'include':_0x283451['include']?_[_0x444d('0x1f')](_0x283451[_0x444d('0x1e')],function(_0x42cfff){return{'model':db[_0x42cfff[_0x444d('0x20')]],'as':_0x42cfff['as'],'attributes':_0x42cfff[_0x444d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x444d('0xe')](function(_0x1a7b8a){logger['info'](_0x444d('0x22'),_0x371380);logger[_0x444d('0x21')]('ShowMailAccount',_0x371380,JSON['stringify'](_0x1a7b8a));_0x426062(_0x1a7b8a);})[_0x444d('0x17')](function(_0x428337){logger['error'](_0x444d('0x22'),_0x428337[_0x444d('0x15')],_0x371380);_0x428155(_0x418512[_0x444d('0x13')](0x1f4,_0x428337[_0x444d('0x15')]));});});};exports['NotifyMailAccount']=function(_0x4c2d45){var _0x57d0b8=this;return new Promise(function(_0x43ca2d,_0x5b127b){var _0x136056={'body':_0x4c2d45[_0x444d('0x26')],'channel':'mail'};var _0x289d8f=_[_0x444d('0x27')](_['keys'](db[_0x444d('0x28')][_0x444d('0x29')]),[_0x444d('0x2a'),_0x444d('0x2b'),_0x444d('0x2c'),_0x444d('0x2d')]);var _0x3e1aa8=![];if(_0x4c2d45[_0x444d('0x26')]['id']){delete _0x4c2d45['body']['id'];}if(_['isNil'](_0x4c2d45['body'][_0x444d('0x2e')])){return _0x5b127b(_0x57d0b8[_0x444d('0x13')](0x1f4,_0x444d('0x2f')));}if(_[_0x444d('0x30')](_0x4c2d45['body'][_0x444d('0x26')])||_0x4c2d45[_0x444d('0x26')][_0x444d('0x26')]===''){return _0x5b127b(_0x57d0b8['error'](0x1f4,_0x444d('0x31')));}if(_['isNil'](_0x4c2d45[_0x444d('0x26')][_0x444d('0x32')])){return _0x5b127b(_0x57d0b8[_0x444d('0x13')](0x1f4,_0x444d('0x33')+_0x289d8f));}if(!_['includes'](_0x289d8f,_0x4c2d45[_0x444d('0x26')][_0x444d('0x32')])){return _0x5b127b(_0x57d0b8[_0x444d('0x13')](0x1f4,_0x444d('0x34')+_0x289d8f));}var _0x13d3a9={};_0x13d3a9[_0x4c2d45[_0x444d('0x26')][_0x444d('0x32')]]=_0x4c2d45[_0x444d('0x26')][_0x444d('0x2e')];return db[_0x444d('0x19')][_0x444d('0x23')]({'where':{'id':_0x4c2d45[_0x444d('0x35')]['id']},'include':[{'model':db[_0x444d('0x36')],'as':_0x444d('0x37'),'include':[{'model':db[_0x444d('0x28')],'as':_0x444d('0x38'),'where':_0x13d3a9,'limit':0x1,'order':[[_0x444d('0x2b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x444d('0x39')},{'model':db[_0x444d('0x3a')],'as':_0x444d('0x3b')}]})['then'](function(_0x4f9c27){if(_0x4f9c27&&_0x4f9c27['List']){var _0x78ad7a=_0x4f9c27[_0x444d('0x3c')]({'plain':!![]});_0x136056[_0x444d('0x35')]=_[_0x444d('0x3d')](_0x78ad7a,[_0x444d('0x39'),_0x444d('0x37')]);_0x136056[_0x444d('0x3e')]=_0x78ad7a[_0x444d('0x39')];_0x136056[_0x444d('0x3f')]=_0x78ad7a[_0x444d('0x37')];_0x136056[_0x444d('0x3e')]=_[_0x444d('0x40')](_0x136056['applications'],[_0x444d('0x41')],['asc']);if(_0x136056[_0x444d('0x35')]&&_0x136056[_0x444d('0x35')]['autoclose']){_0x136056[_0x444d('0x3e')][_0x444d('0x42')]({'id':0x0,'priority':_0x136056[_0x444d('0x3e')]['length']+0x1,'app':'close','appdata':_0x444d('0x43'),'interval':_0x444d('0x44')});}if(_0x136056[_0x444d('0x35')]['Applications']){delete _0x136056[_0x444d('0x35')][_0x444d('0x39')];}if(_0x136056[_0x444d('0x35')][_0x444d('0x37')]){delete _0x136056[_0x444d('0x35')][_0x444d('0x37')];}if(_0x78ad7a['List'][_0x444d('0x38')]['length']){return _0x78ad7a['List'][_0x444d('0x38')][0x0];}var _0x55d2bc=_[_0x444d('0x9')](_0x4c2d45[_0x444d('0x26')],{'firstName':_0x4c2d45[_0x444d('0x26')][_0x444d('0x2e')],'ListId':_0x78ad7a['ListId']});_0x55d2bc[_0x4c2d45[_0x444d('0x26')][_0x444d('0x32')]]=_0x4c2d45[_0x444d('0x26')][_0x444d('0x2e')];return db[_0x444d('0x28')][_0x444d('0x45')](_0x55d2bc);}else{throw new Error(_0x444d('0x46'));}})['then'](function(_0x1dfa02){_0x136056[_0x444d('0x47')]=_0x1dfa02;if(_0x1dfa02){if(!_0x4c2d45['body'][_0x444d('0x15')]['messageId']){_0x4c2d45['body'][_0x444d('0x15')]['messageId']=rs[_0x444d('0x48')]()+'\x20'+_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x2e')];}var _0x4aa689={'ContactId':_0x1dfa02['id'],'MailAccountId':_0x4c2d45[_0x444d('0x35')]['id'],'inReplyTo':_0x4c2d45['body']['message'][_0x444d('0x49')],'to':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x2e')],'cc':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')]['cc'],'subject':_0x4c2d45[_0x444d('0x26')]['message'][_0x444d('0x4a')],'attach':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')]['attach'],'lastMsgAt':moment()[_0x444d('0x4b')](_0x444d('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x4c2d45[_0x444d('0x26')]['body']};return db[_0x444d('0x4d')][_0x444d('0x23')]({'where':{'closed':![],'MailAccountId':_0x4c2d45[_0x444d('0x35')]['id']},'include':[{'model':db[_0x444d('0x4e')],'as':_0x444d('0x4f'),'attributes':[_0x444d('0x49')],'where':{'messageId':_0x4c2d45[_0x444d('0x26')]['message']['inReplyTo']}}]})[_0x444d('0xe')](function(_0x220a15){if(_0x220a15){return[_0x220a15,![]];}return db[_0x444d('0x4d')][_0x444d('0x45')](_0x4aa689)['then'](function(_0x2b2e0c){return[_0x2b2e0c,!![]];});});}else{throw new Error(_0x444d('0x50'));}})[_0x444d('0x51')](function(_0x287153,_0xb18105){if(_0x287153){_0x3e1aa8=_0xb18105;if(!_0xb18105){return _0x287153['update']({'inReplyTo':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x49')],'to':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')]['from'],'cc':_0x4c2d45[_0x444d('0x26')]['message']['cc'],'subject':_0x4c2d45[_0x444d('0x26')]['message']['subject'],'attach':_0x287153['attach']?_0x287153[_0x444d('0x52')]:_0x4c2d45['body'][_0x444d('0x15')]['attach'],'substatus':null,'substatusAt':moment()[_0x444d('0x4b')](_0x444d('0x4c')),'lastMsgAt':moment()[_0x444d('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x4c2d45[_0x444d('0x26')][_0x444d('0x26')]});}else{return _0x287153;}}})[_0x444d('0xe')](function(_0x233b04){_0x136056[_0x444d('0x53')]=_0x233b04['get']({'plain':!![]});_0x136056[_0x444d('0x53')][_0x444d('0x54')]=_0x3e1aa8;return db[_0x444d('0x4e')][_0x444d('0x45')]({'body':_0x4c2d45['body'][_0x444d('0x26')],'MailAccountId':_0x4c2d45[_0x444d('0x35')]['id'],'MailInteractionId':_0x233b04['id'],'direction':'in','ContactId':_0x136056['contact']['id'],'messageId':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x49')],'from':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')]['from'],'to':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')]['to'],'cc':_0x4c2d45['body'][_0x444d('0x15')]['cc'],'subject':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x4a')],'attach':_0x4c2d45['body']['message'][_0x444d('0x52')],'Attachments':_0x4c2d45[_0x444d('0x26')]['message']['attachments'],'originTo':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x55')],'originCc':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')]['originCc'],'bcc':_0x4c2d45[_0x444d('0x26')][_0x444d('0x15')][_0x444d('0x56')]},{'include':[{'model':db[_0x444d('0x57')],'as':_0x444d('0x58')}]});})[_0x444d('0xe')](function(_0x2b53a8){_0x136056['message']=_0x2b53a8;if(_0x136056[_0x444d('0x53')]['UserId']){return db['User'][_0x444d('0x23')]({'attributes':['id',_0x444d('0x59')],'where':{'id':_0x136056[_0x444d('0x53')][_0x444d('0x5a')]}})[_0x444d('0xe')](function(_0x3362d0){if(_0x3362d0){_0x136056[_0x444d('0x3e')][_0x444d('0x5b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3362d0[_0x444d('0x59')]+','+(_0x136056[_0x444d('0x35')][_0x444d('0x5c')]||0xa),'interval':_0x444d('0x44')});}return respondWithRpcPromise(_0x444d('0x5d'),_0x444d('0x5e'),_0x136056);});}return respondWithRpcPromise(_0x444d('0x5d'),'startRouting',_0x136056);})[_0x444d('0xe')](function(_0x4979c4){_0x43ca2d(_0x4979c4);})[_0x444d('0x17')](function(_0x4f775a){_0x5b127b(_0x57d0b8[_0x444d('0x13')](0x1f4,_0x4f775a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index a07970f..6dfcf52 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 _0x9a5a=['emit','removeListener','register','length','./mailAccount.events','save','remove','update'];(function(_0x192929,_0x23f3d6){var _0x50ec8c=function(_0x499d13){while(--_0x499d13){_0x192929['push'](_0x192929['shift']());}};_0x50ec8c(++_0x23f3d6);}(_0x9a5a,0x194));var _0xa9a5=function(_0x337940,_0x8962f5){_0x337940=_0x337940-0x0;var _0x17f4da=_0x9a5a[_0x337940];return _0x17f4da;};'use strict';var MailAccountEvents=require(_0xa9a5('0x0'));var events=[_0xa9a5('0x1'),_0xa9a5('0x2'),_0xa9a5('0x3')];function createListener(_0x198d2a,_0x500287){return function(_0x28e2b3){_0x500287[_0xa9a5('0x4')](_0x198d2a,_0x28e2b3);};}function removeListener(_0x230710,_0x1080a9){return function(){MailAccountEvents[_0xa9a5('0x5')](_0x230710,_0x1080a9);};}exports[_0xa9a5('0x6')]=function(_0x4a73f4){for(var _0xb0ccd9=0x0,_0x37e93b=events[_0xa9a5('0x7')];_0xb0ccd9<_0x37e93b;_0xb0ccd9++){var _0x1eafa6=events[_0xb0ccd9];var _0x24e1bd=createListener('mailAccount:'+_0x1eafa6,_0x4a73f4);MailAccountEvents['on'](_0x1eafa6,_0x24e1bd);}}; \ No newline at end of file +var _0xdcfa=['remove','emit','removeListener','register','length','./mailAccount.events'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xdcfa,0xad));var _0xadcf=function(_0x1f6704,_0x106f36){_0x1f6704=_0x1f6704-0x0;var _0x4acab6=_0xdcfa[_0x1f6704];return _0x4acab6;};'use strict';var MailAccountEvents=require(_0xadcf('0x0'));var events=['save',_0xadcf('0x1'),'update'];function createListener(_0x14990c,_0x408141){return function(_0x3c2e2c){_0x408141[_0xadcf('0x2')](_0x14990c,_0x3c2e2c);};}function removeListener(_0x2575ce,_0x2f0c66){return function(){MailAccountEvents[_0xadcf('0x3')](_0x2575ce,_0x2f0c66);};}exports[_0xadcf('0x4')]=function(_0x706348){for(var _0x355ffd=0x0,_0x182f1c=events[_0xadcf('0x5')];_0x355ffd<_0x182f1c;_0x355ffd++){var _0x5a98ab=events[_0x355ffd];var _0x41cdbf=createListener('mailAccount:'+_0x5a98ab,_0x706348);MailAccountEvents['on'](_0x5a98ab,_0x41cdbf);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index a940e57..7a081b8 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 _0xe706=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x44c484,_0x34607f){var _0x9adcd4=function(_0x451a09){while(--_0x451a09){_0x44c484['push'](_0x44c484['shift']());}};_0x9adcd4(++_0x34607f);}(_0xe706,0xa3));var _0x6e70=function(_0x235e66,_0x4bef96){_0x235e66=_0x235e66-0x0;var _0x36019b=_0xe706[_0x235e66];return _0x36019b;};'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')](_0x6e70('0xa'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xd')](_0x6e70('0xa'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xf')](_0x6e70('0xa'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);module[_0x6e70('0x11')]=router; \ No newline at end of file +var _0x373d=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','update'];(function(_0x1eb8cb,_0x13420b){var _0x35ccaf=function(_0x2b6d71){while(--_0x2b6d71){_0x1eb8cb['push'](_0x1eb8cb['shift']());}};_0x35ccaf(++_0x13420b);}(_0x373d,0x1e2));var _0xd373=function(_0x58a058,_0x5965eb){_0x58a058=_0x58a058-0x0;var _0x347664=_0x373d[_0x58a058];return _0x347664;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require(_0xd373('0x2'));var express=require(_0xd373('0x3'));var router=express[_0xd373('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd373('0x5'));var config=require(_0xd373('0x6'));var controller=require(_0xd373('0x7'));router['get']('/:id',auth[_0xd373('0x8')](),controller[_0xd373('0x9')]);router[_0xd373('0xa')](_0xd373('0xb'),auth['isAuthenticated'](),controller[_0xd373('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd373('0xd')]);module[_0xd373('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index cc7c3e4..c010c0e 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 _0x9355=['STRING','sequelize','INTEGER','TEXT'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9355,0x85));var _0x5935=function(_0x3d8e33,_0x4cc963){_0x3d8e33=_0x3d8e33-0x0;var _0x30ef3d=_0x9355[_0x3d8e33];return _0x30ef3d;};'use strict';var Sequelize=require(_0x5935('0x0'));module['exports']={'priority':{'type':Sequelize[_0x5935('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x5935('0x2')]()},'description':{'type':Sequelize[_0x5935('0x3')]},'interval':{'type':Sequelize[_0x5935('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xee66=['TEXT','sequelize','exports','INTEGER','STRING','noop'];(function(_0x52a6e3,_0x4a73b4){var _0x8910d0=function(_0x57e5ef){while(--_0x57e5ef){_0x52a6e3['push'](_0x52a6e3['shift']());}};_0x8910d0(++_0x4a73b4);}(_0xee66,0x1ab));var _0x6ee6=function(_0x2d3c60,_0x4df458){_0x2d3c60=_0x2d3c60-0x0;var _0x560041=_0xee66[_0x2d3c60];return _0x560041;};'use strict';var Sequelize=require(_0x6ee6('0x0'));module[_0x6ee6('0x1')]={'priority':{'type':Sequelize[_0x6ee6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6ee6('0x3')],'allowNull':![],'defaultValue':_0x6ee6('0x4')},'appdata':{'type':Sequelize[_0x6ee6('0x5')]()},'description':{'type':Sequelize[_0x6ee6('0x3')]},'interval':{'type':Sequelize[_0x6ee6('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 4ef0f48..10736d0 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 _0x4e83=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','show','params','model','MailApplication','rawAttributes','query','keys','attributes','intersection','fields','length','includeAll','include','merge','options','body','catch','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x1786da,_0x57b7da){var _0xba9f3c=function(_0x5a14d9){while(--_0x5a14d9){_0x1786da['push'](_0x1786da['shift']());}};_0xba9f3c(++_0x57b7da);}(_0x4e83,0xd5));var _0x34e8=function(_0x5ab232,_0x570056){_0x5ab232=_0x5ab232-0x0;var _0x457b86=_0x4e83[_0x5ab232];return _0x457b86;};'use strict';var pdf=require(_0x34e8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34e8('0x1'));var zipdir=require(_0x34e8('0x2'));var jsonpatch=require(_0x34e8('0x3'));var rp=require(_0x34e8('0x4'));var moment=require(_0x34e8('0x5'));var BPromise=require(_0x34e8('0x6'));var Mustache=require(_0x34e8('0x7'));var util=require(_0x34e8('0x8'));var path=require(_0x34e8('0x9'));var sox=require(_0x34e8('0xa'));var csv=require(_0x34e8('0xb'));var ejs=require(_0x34e8('0xc'));var fs=require('fs');var _=require(_0x34e8('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x34e8('0xe'));var deskjs=require(_0x34e8('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x34e8('0x10'));var Redis=require(_0x34e8('0x11'));var authService=require(_0x34e8('0x12'));var qs=require(_0x34e8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x34e8('0x14'));var logger=require(_0x34e8('0x15'))(_0x34e8('0x16'));var utils=require('../../config/utils');var config=require(_0x34e8('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59f34a,_0x5f52f9){_0x5f52f9=_0x5f52f9||0xcc;return function(_0x136426){if(_0x136426){return _0x59f34a[_0x34e8('0x18')](_0x5f52f9);}return _0x59f34a['status'](_0x5f52f9)[_0x34e8('0x19')]();};}function respondWithResult(_0x2321d5,_0x2647de){_0x2647de=_0x2647de||0xc8;return function(_0x34a074){if(_0x34a074){return _0x2321d5[_0x34e8('0x1a')](_0x2647de)[_0x34e8('0x1b')](_0x34a074);}};}function respondWithFilteredResult(_0x5eccfe,_0x5b54c4){return function(_0x44a85a){if(_0x44a85a){var _0x221747=_0x44a85a['count'],_0xc752f3=_0x5b54c4[_0x34e8('0x1c')],_0x2c1068=_0x5b54c4[_0x34e8('0x1c')]+_0x5b54c4[_0x34e8('0x1d')],_0x51bf79;if(_0x2c1068>=_0x221747){_0x2c1068=_0x221747;_0x51bf79=0xc8;}else{_0x51bf79=0xce;}_0x5eccfe['status'](_0x51bf79);return _0x5eccfe[_0x34e8('0x1e')](_0x34e8('0x1f'),_0xc752f3+'-'+_0x2c1068+'/'+_0x221747)[_0x34e8('0x1b')](_0x44a85a);}return null;};}function patchUpdates(_0x5ad1d8){return function(_0x2b9325){try{jsonpatch[_0x34e8('0x20')](_0x2b9325,_0x5ad1d8,!![]);}catch(_0x20c39e){return BPromise[_0x34e8('0x21')](_0x20c39e);}return _0x2b9325[_0x34e8('0x22')]();};}function saveUpdates(_0xc48907,_0x5b9e8b){return function(_0x5c0176){if(_0x5c0176){return _0x5c0176[_0x34e8('0x23')](_0xc48907)[_0x34e8('0x24')](function(_0x393e49){return _0x393e49;});}return null;};}function removeEntity(_0x19886f,_0x497d29){return function(_0x5c9e8e){if(_0x5c9e8e){return _0x5c9e8e['destroy']()['then'](function(){_0x19886f[_0x34e8('0x1a')](0xcc)[_0x34e8('0x19')]();});}};}function handleEntityNotFound(_0x2ce025,_0x3a1084){return function(_0x65ece6){if(!_0x65ece6){_0x2ce025[_0x34e8('0x18')](0x194);}return _0x65ece6;};}function handleError(_0x1d5aa1,_0xb2e418){_0xb2e418=_0xb2e418||0x1f4;return function(_0x32bc4e){logger[_0x34e8('0x25')](_0x32bc4e[_0x34e8('0x26')]);if(_0x32bc4e['name']){delete _0x32bc4e[_0x34e8('0x27')];}_0x1d5aa1[_0x34e8('0x1a')](_0xb2e418)['send'](_0x32bc4e);};}exports[_0x34e8('0x28')]=function(_0x3ffc33,_0x3a4c13){var _0x288544={'raw':!![],'where':{'id':_0x3ffc33[_0x34e8('0x29')]['id']}},_0x30c76d={};_0x30c76d[_0x34e8('0x2a')]=_['keys'](db[_0x34e8('0x2b')][_0x34e8('0x2c')]);_0x30c76d[_0x34e8('0x2d')]=_[_0x34e8('0x2e')](_0x3ffc33['query']);_0x30c76d['filters']=_['intersection'](_0x30c76d[_0x34e8('0x2a')],_0x30c76d[_0x34e8('0x2d')]);_0x288544[_0x34e8('0x2f')]=_[_0x34e8('0x30')](_0x30c76d['model'],qs['fields'](_0x3ffc33[_0x34e8('0x2d')][_0x34e8('0x31')]));_0x288544[_0x34e8('0x2f')]=_0x288544['attributes'][_0x34e8('0x32')]?_0x288544[_0x34e8('0x2f')]:_0x30c76d[_0x34e8('0x2a')];if(_0x3ffc33[_0x34e8('0x2d')][_0x34e8('0x33')]){_0x288544[_0x34e8('0x34')]=[{'all':!![]}];}_0x288544=_[_0x34e8('0x35')]({},_0x288544,_0x3ffc33[_0x34e8('0x36')]);return db[_0x34e8('0x2b')]['find'](_0x288544)['then'](handleEntityNotFound(_0x3a4c13,null))[_0x34e8('0x24')](respondWithResult(_0x3a4c13,null))['catch'](handleError(_0x3a4c13,null));};exports['update']=function(_0x2509fc,_0x5eabfa){if(_0x2509fc[_0x34e8('0x37')]['id']){delete _0x2509fc[_0x34e8('0x37')]['id'];}return db[_0x34e8('0x2b')]['find']({'where':{'id':_0x2509fc[_0x34e8('0x29')]['id']}})[_0x34e8('0x24')](handleEntityNotFound(_0x5eabfa,null))['then'](saveUpdates(_0x2509fc[_0x34e8('0x37')],null))[_0x34e8('0x24')](respondWithResult(_0x5eabfa,null))[_0x34e8('0x38')](handleError(_0x5eabfa,null));};exports['destroy']=function(_0x54ae17,_0x1baba4){return db[_0x34e8('0x2b')][_0x34e8('0x39')]({'where':{'id':_0x54ae17['params']['id']}})[_0x34e8('0x24')](handleEntityNotFound(_0x1baba4,null))[_0x34e8('0x24')](removeEntity(_0x1baba4,null))['catch'](handleError(_0x1baba4,null));}; \ No newline at end of file +var _0xffcc=['../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','MailApplication','rawAttributes','query','intersection','attributes','fields','options','find','body','catch','eml-format','zip-dir','fast-json-patch','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x19b1c2,_0x205062){var _0x4e1ae5=function(_0x5a1cb7){while(--_0x5a1cb7){_0x19b1c2['push'](_0x19b1c2['shift']());}};_0x4e1ae5(++_0x205062);}(_0xffcc,0x112));var _0xcffc=function(_0x2d6d38,_0x1c1d85){_0x2d6d38=_0x2d6d38-0x0;var _0x3c8908=_0xffcc[_0x2d6d38];return _0x3c8908;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcffc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcffc('0x1'));var jsonpatch=require(_0xcffc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcffc('0x3'));var util=require('util');var path=require(_0xcffc('0x4'));var sox=require('sox');var csv=require(_0xcffc('0x5'));var ejs=require(_0xcffc('0x6'));var fs=require('fs');var _=require(_0xcffc('0x7'));var squel=require(_0xcffc('0x8'));var crypto=require('crypto');var jsforce=require(_0xcffc('0x9'));var deskjs=require(_0xcffc('0xa'));var toCsv=require(_0xcffc('0x5'));var querystring=require('querystring');var Papa=require(_0xcffc('0xb'));var Redis=require('ioredis');var authService=require(_0xcffc('0xc'));var qs=require(_0xcffc('0xd'));var as=require(_0xcffc('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcffc('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xcffc('0x10'));var db=require(_0xcffc('0x11'))['db'];function respondWithStatusCode(_0x375b94,_0x12e1e4){_0x12e1e4=_0x12e1e4||0xcc;return function(_0x9ba1b2){if(_0x9ba1b2){return _0x375b94[_0xcffc('0x12')](_0x12e1e4);}return _0x375b94[_0xcffc('0x13')](_0x12e1e4)[_0xcffc('0x14')]();};}function respondWithResult(_0x5139ad,_0x219272){_0x219272=_0x219272||0xc8;return function(_0x2437b0){if(_0x2437b0){return _0x5139ad[_0xcffc('0x13')](_0x219272)[_0xcffc('0x15')](_0x2437b0);}};}function respondWithFilteredResult(_0x2ce35f,_0x249da9){return function(_0x2eb456){if(_0x2eb456){var _0x5927d9=_0x2eb456[_0xcffc('0x16')],_0x2deccb=_0x249da9[_0xcffc('0x17')],_0x1cf8de=_0x249da9['offset']+_0x249da9[_0xcffc('0x18')],_0x966aba;if(_0x1cf8de>=_0x5927d9){_0x1cf8de=_0x5927d9;_0x966aba=0xc8;}else{_0x966aba=0xce;}_0x2ce35f[_0xcffc('0x13')](_0x966aba);return _0x2ce35f['set']('Content-Range',_0x2deccb+'-'+_0x1cf8de+'/'+_0x5927d9)[_0xcffc('0x15')](_0x2eb456);}return null;};}function patchUpdates(_0x13ed7b){return function(_0x23e6d0){try{jsonpatch[_0xcffc('0x19')](_0x23e6d0,_0x13ed7b,!![]);}catch(_0x1a4278){return BPromise[_0xcffc('0x1a')](_0x1a4278);}return _0x23e6d0[_0xcffc('0x1b')]();};}function saveUpdates(_0x37c99b,_0x14489a){return function(_0x2df26e){if(_0x2df26e){return _0x2df26e[_0xcffc('0x1c')](_0x37c99b)[_0xcffc('0x1d')](function(_0x3e07d1){return _0x3e07d1;});}return null;};}function removeEntity(_0x543e52,_0x1ee56c){return function(_0x57bd0b){if(_0x57bd0b){return _0x57bd0b[_0xcffc('0x1e')]()[_0xcffc('0x1d')](function(){_0x543e52[_0xcffc('0x13')](0xcc)[_0xcffc('0x14')]();});}};}function handleEntityNotFound(_0x539fc2,_0xecb7cd){return function(_0x5e8014){if(!_0x5e8014){_0x539fc2[_0xcffc('0x12')](0x194);}return _0x5e8014;};}function handleError(_0x3e1542,_0x494714){_0x494714=_0x494714||0x1f4;return function(_0xb61493){logger[_0xcffc('0x1f')](_0xb61493[_0xcffc('0x20')]);if(_0xb61493['name']){delete _0xb61493[_0xcffc('0x21')];}_0x3e1542['status'](_0x494714)['send'](_0xb61493);};}exports[_0xcffc('0x22')]=function(_0x2bcac8,_0x4a9e72){var _0xc40ae9={'raw':!![],'where':{'id':_0x2bcac8[_0xcffc('0x23')]['id']}},_0x3c95b4={};_0x3c95b4[_0xcffc('0x24')]=_[_0xcffc('0x25')](db[_0xcffc('0x26')][_0xcffc('0x27')]);_0x3c95b4[_0xcffc('0x28')]=_['keys'](_0x2bcac8['query']);_0x3c95b4['filters']=_[_0xcffc('0x29')](_0x3c95b4[_0xcffc('0x24')],_0x3c95b4[_0xcffc('0x28')]);_0xc40ae9[_0xcffc('0x2a')]=_[_0xcffc('0x29')](_0x3c95b4[_0xcffc('0x24')],qs['fields'](_0x2bcac8[_0xcffc('0x28')][_0xcffc('0x2b')]));_0xc40ae9[_0xcffc('0x2a')]=_0xc40ae9[_0xcffc('0x2a')]['length']?_0xc40ae9[_0xcffc('0x2a')]:_0x3c95b4[_0xcffc('0x24')];if(_0x2bcac8[_0xcffc('0x28')]['includeAll']){_0xc40ae9['include']=[{'all':!![]}];}_0xc40ae9=_['merge']({},_0xc40ae9,_0x2bcac8[_0xcffc('0x2c')]);return db[_0xcffc('0x26')][_0xcffc('0x2d')](_0xc40ae9)['then'](handleEntityNotFound(_0x4a9e72,null))[_0xcffc('0x1d')](respondWithResult(_0x4a9e72,null))['catch'](handleError(_0x4a9e72,null));};exports['update']=function(_0x3a1bf8,_0x407b82){if(_0x3a1bf8[_0xcffc('0x2e')]['id']){delete _0x3a1bf8[_0xcffc('0x2e')]['id'];}return db[_0xcffc('0x26')][_0xcffc('0x2d')]({'where':{'id':_0x3a1bf8[_0xcffc('0x23')]['id']}})[_0xcffc('0x1d')](handleEntityNotFound(_0x407b82,null))['then'](saveUpdates(_0x3a1bf8[_0xcffc('0x2e')],null))[_0xcffc('0x1d')](respondWithResult(_0x407b82,null))[_0xcffc('0x2f')](handleError(_0x407b82,null));};exports[_0xcffc('0x1e')]=function(_0x180473,_0x31ee5b){return db[_0xcffc('0x26')][_0xcffc('0x2d')]({'where':{'id':_0x180473[_0xcffc('0x23')]['id']}})[_0xcffc('0x1d')](handleEntityNotFound(_0x31ee5b,null))['then'](removeEntity(_0x31ee5b,null))['catch'](handleError(_0x31ee5b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 6256b91..eb683fb 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 _0x6d25=['MailApplication','mail_applications','utf8mb4_unicode_ci','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x206427,_0x5b02e7){var _0x43cca3=function(_0x421fdc){while(--_0x421fdc){_0x206427['push'](_0x206427['shift']());}};_0x43cca3(++_0x5b02e7);}(_0x6d25,0x81));var _0x56d2=function(_0x53d952,_0x252398){_0x53d952=_0x53d952-0x0;var _0x5b59e2=_0x6d25[_0x53d952];return _0x5b59e2;};'use strict';var _=require('lodash');var util=require(_0x56d2('0x0'));var logger=require('../../config/logger')(_0x56d2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x56d2('0x2'));var fs=require('fs');var path=require(_0x56d2('0x3'));var rimraf=require(_0x56d2('0x4'));var config=require(_0x56d2('0x5'));var attributes=require('./mailApplication.attributes');module['exports']=function(_0x5ac0ad,_0x5106d2){return _0x5ac0ad['define'](_0x56d2('0x6'),attributes,{'tableName':_0x56d2('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x56d2('0x8')});}; \ No newline at end of file +var _0xea19=['mail_applications','utf8mb4','lodash','util','api','moment','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0xab8207,_0x274686){var _0x50ef67=function(_0x581dfd){while(--_0x581dfd){_0xab8207['push'](_0xab8207['shift']());}};_0x50ef67(++_0x274686);}(_0xea19,0x106));var _0x9ea1=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xea19[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x9ea1('0x0'));var util=require(_0x9ea1('0x1'));var logger=require('../../config/logger')(_0x9ea1('0x2'));var moment=require(_0x9ea1('0x3'));var BPromise=require('bluebird');var rp=require(_0x9ea1('0x4'));var fs=require('fs');var path=require(_0x9ea1('0x5'));var rimraf=require('rimraf');var config=require(_0x9ea1('0x6'));var attributes=require(_0x9ea1('0x7'));module[_0x9ea1('0x8')]=function(_0x3f7aba,_0x42fee4){return _0x3f7aba[_0x9ea1('0x9')](_0x9ea1('0xa'),attributes,{'tableName':_0x9ea1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ea1('0xc'),'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 ce54671..7e56401 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 _0xeadf=['randomstring','ioredis','../../mysqldb','rpc','client','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailApplication','update','body','options','raw','where','attributes','lodash','util','moment'];(function(_0x21de13,_0x55d014){var _0x44edcc=function(_0x235249){while(--_0x235249){_0x21de13['push'](_0x21de13['shift']());}};_0x44edcc(++_0x55d014);}(_0xeadf,0x1eb));var _0xfead=function(_0x162780,_0x47f2e2){_0x162780=_0x162780-0x0;var _0x1ea2dc=_0xeadf[_0x162780];return _0x1ea2dc;};'use strict';var _=require(_0xfead('0x0'));var util=require(_0xfead('0x1'));var moment=require(_0xfead('0x2'));var BPromise=require('bluebird');var rs=require(_0xfead('0x3'));var fs=require('fs');var Redis=require(_0xfead('0x4'));var db=require(_0xfead('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfead('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfead('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25c3e0,_0x139b6b,_0x590f57){return new BPromise(function(_0x5d31d5,_0x577e81){return client[_0xfead('0x8')](_0x25c3e0,_0x590f57)[_0xfead('0x9')](function(_0x3190f5){logger[_0xfead('0xa')](_0xfead('0xb'),_0x139b6b,_0xfead('0xc'));logger[_0xfead('0xd')](_0xfead('0xe'),_0x139b6b,_0xfead('0xc'),JSON[_0xfead('0xf')](_0x3190f5));if(_0x3190f5[_0xfead('0x10')]){if(_0x3190f5[_0xfead('0x10')]['code']===0x1f4){logger[_0xfead('0x10')]('MailApplication,\x20%s,\x20%s',_0x139b6b,_0x3190f5['error']['message']);return _0x577e81(_0x3190f5[_0xfead('0x10')][_0xfead('0x11')]);}logger[_0xfead('0x10')](_0xfead('0xb'),_0x139b6b,_0x3190f5['error'][_0xfead('0x11')]);return _0x5d31d5(_0x3190f5[_0xfead('0x10')][_0xfead('0x11')]);}else{logger[_0xfead('0xa')](_0xfead('0xb'),_0x139b6b,'request\x20sent');_0x5d31d5(_0x3190f5['result'][_0xfead('0x11')]);}})[_0xfead('0x12')](function(_0x2014ab){logger[_0xfead('0x10')](_0xfead('0xb'),_0x139b6b,_0x2014ab);_0x577e81(_0x2014ab);});});}exports[_0xfead('0x13')]=function(_0x50c6e0){var _0xdbaaf9=this;return new Promise(function(_0x16b694,_0x27a8ef){return db['MailApplication'][_0xfead('0x14')](_0x50c6e0[_0xfead('0x15')],{'raw':_0x50c6e0['options']?_0x50c6e0[_0xfead('0x16')][_0xfead('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50c6e0[_0xfead('0x16')]?_0x50c6e0[_0xfead('0x16')][_0xfead('0x18')]||null:null,'attributes':_0x50c6e0[_0xfead('0x16')]?_0x50c6e0[_0xfead('0x16')][_0xfead('0x19')]||null:null,'limit':_0x50c6e0[_0xfead('0x16')]?_0x50c6e0[_0xfead('0x16')]['limit']||null:null})['then'](function(_0x15607c){logger[_0xfead('0xa')](_0xfead('0x13'),_0x50c6e0);logger[_0xfead('0xd')](_0xfead('0x13'),_0x50c6e0,JSON[_0xfead('0xf')](_0x15607c));_0x16b694(_0x15607c);})[_0xfead('0x12')](function(_0x12d6d2){logger[_0xfead('0x10')](_0xfead('0x13'),_0x12d6d2[_0xfead('0x11')],_0x50c6e0);_0x27a8ef(_0xdbaaf9[_0xfead('0x10')](0x1f4,_0x12d6d2[_0xfead('0x11')]));});});}; \ No newline at end of file +var _0xeb29=['http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','MailApplication','update','options','raw','attributes','UpdateMailApplication','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x306a89,_0x37fdd2){var _0x44fb3a=function(_0x350ec0){while(--_0x350ec0){_0x306a89['push'](_0x306a89['shift']());}};_0x44fb3a(++_0x37fdd2);}(_0xeb29,0x171));var _0x9eb2=function(_0x4b8696,_0x5ddf37){_0x4b8696=_0x4b8696-0x0;var _0x2ea065=_0xeb29[_0x4b8696];return _0x2ea065;};'use strict';var _=require(_0x9eb2('0x0'));var util=require(_0x9eb2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9eb2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9eb2('0x3'));var logger=require(_0x9eb2('0x4'))(_0x9eb2('0x5'));var config=require(_0x9eb2('0x6'));var jayson=require(_0x9eb2('0x7'));var client=jayson[_0x9eb2('0x8')][_0x9eb2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18331f,_0x5d5752,_0x499d3e){return new BPromise(function(_0x231591,_0x4abcc3){return client['request'](_0x18331f,_0x499d3e)[_0x9eb2('0xa')](function(_0x10f8b7){logger[_0x9eb2('0xb')](_0x9eb2('0xc'),_0x5d5752,_0x9eb2('0xd'));logger[_0x9eb2('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x5d5752,_0x9eb2('0xd'),JSON[_0x9eb2('0xf')](_0x10f8b7));if(_0x10f8b7['error']){if(_0x10f8b7[_0x9eb2('0x10')][_0x9eb2('0x11')]===0x1f4){logger[_0x9eb2('0x10')]('MailApplication,\x20%s,\x20%s',_0x5d5752,_0x10f8b7[_0x9eb2('0x10')]['message']);return _0x4abcc3(_0x10f8b7[_0x9eb2('0x10')]['message']);}logger[_0x9eb2('0x10')]('MailApplication,\x20%s,\x20%s',_0x5d5752,_0x10f8b7[_0x9eb2('0x10')][_0x9eb2('0x12')]);return _0x231591(_0x10f8b7['error'][_0x9eb2('0x12')]);}else{logger[_0x9eb2('0xb')]('MailApplication,\x20%s,\x20%s',_0x5d5752,_0x9eb2('0xd'));_0x231591(_0x10f8b7[_0x9eb2('0x13')][_0x9eb2('0x12')]);}})[_0x9eb2('0x14')](function(_0xed8f2b){logger[_0x9eb2('0x10')]('MailApplication,\x20%s,\x20%s',_0x5d5752,_0xed8f2b);_0x4abcc3(_0xed8f2b);});});}exports['UpdateMailApplication']=function(_0x3b93db){var _0x46ad97=this;return new Promise(function(_0x1102a2,_0x135339){return db[_0x9eb2('0x15')][_0x9eb2('0x16')](_0x3b93db['body'],{'raw':_0x3b93db[_0x9eb2('0x17')]?_0x3b93db['options'][_0x9eb2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b93db[_0x9eb2('0x17')]?_0x3b93db[_0x9eb2('0x17')]['where']||null:null,'attributes':_0x3b93db[_0x9eb2('0x17')]?_0x3b93db[_0x9eb2('0x17')][_0x9eb2('0x19')]||null:null,'limit':_0x3b93db['options']?_0x3b93db[_0x9eb2('0x17')]['limit']||null:null})[_0x9eb2('0xa')](function(_0x115c43){logger['info'](_0x9eb2('0x1a'),_0x3b93db);logger['debug'](_0x9eb2('0x1a'),_0x3b93db,JSON[_0x9eb2('0xf')](_0x115c43));_0x1102a2(_0x115c43);})[_0x9eb2('0x14')](function(_0x52a3b3){logger[_0x9eb2('0x10')](_0x9eb2('0x1a'),_0x52a3b3[_0x9eb2('0x12')],_0x3b93db);_0x135339(_0x46ad97[_0x9eb2('0x10')](0x1f4,_0x52a3b3[_0x9eb2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index afaadce..aae1f33 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 _0x5fdc=['mail','mailinteraction:addtags','put','update','delete','mailinteraction:destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','download','post','/:id/messages','addMessage','/:id/tags','tracked'];(function(_0x552c6a,_0x5bcb34){var _0x1d154d=function(_0x3a97bf){while(--_0x3a97bf){_0x552c6a['push'](_0x552c6a['shift']());}};_0x1d154d(++_0x5bcb34);}(_0x5fdc,0xcb));var _0xc5fd=function(_0x5f0993,_0x4c19a5){_0x5f0993=_0x5f0993-0x0;var _0x5ae9a8=_0x5fdc[_0x5f0993];return _0x5ae9a8;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc5fd('0x1'));var express=require(_0xc5fd('0x2'));var router=express[_0xc5fd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc5fd('0x4'));var config=require(_0xc5fd('0x5'));var controller=require(_0xc5fd('0x6'));router[_0xc5fd('0x7')]('/',auth[_0xc5fd('0x8')](),controller[_0xc5fd('0x9')]);router[_0xc5fd('0x7')](_0xc5fd('0xa'),auth[_0xc5fd('0x8')](),controller[_0xc5fd('0xb')]);router['get'](_0xc5fd('0xc'),auth['isAuthenticated'](),controller[_0xc5fd('0xd')]);router[_0xc5fd('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0xc5fd('0xe')]);router[_0xc5fd('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0xc5fd('0xf')]);router['post']('/',auth[_0xc5fd('0x8')](),controller['create']);router[_0xc5fd('0x10')](_0xc5fd('0x11'),auth[_0xc5fd('0x8')](),controller[_0xc5fd('0x12')]);router[_0xc5fd('0x10')](_0xc5fd('0x13'),auth[_0xc5fd('0x8')](),interaction[_0xc5fd('0x14')](_0xc5fd('0x15'),_0xc5fd('0x16')),controller['addTags']);router[_0xc5fd('0x17')](_0xc5fd('0xc'),auth['isAuthenticated'](),interaction['tracked']('mail','mailinteraction:update'),controller[_0xc5fd('0x18')]);router[_0xc5fd('0x19')]('/:id',auth[_0xc5fd('0x8')](),interaction[_0xc5fd('0x14')](_0xc5fd('0x15'),_0xc5fd('0x1a')),controller['destroy']);router[_0xc5fd('0x19')]('/:id/tags',auth[_0xc5fd('0x8')](),controller['removeTags']);module[_0xc5fd('0x1b')]=router; \ No newline at end of file +var _0x3e1f=['mailinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','delete'];(function(_0xe67912,_0x2d4ec9){var _0x136506=function(_0x1770a){while(--_0x1770a){_0xe67912['push'](_0xe67912['shift']());}};_0x136506(++_0x2d4ec9);}(_0x3e1f,0x18a));var _0xf3e1=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0x3e1f[_0x74895e];return _0x40bc2a;};'use strict';var multer=require('multer');var util=require(_0xf3e1('0x0'));var path=require(_0xf3e1('0x1'));var timeout=require(_0xf3e1('0x2'));var express=require('express');var router=express[_0xf3e1('0x3')]();var auth=require(_0xf3e1('0x4'));var interaction=require(_0xf3e1('0x5'));var config=require(_0xf3e1('0x6'));var controller=require(_0xf3e1('0x7'));router['get']('/',auth[_0xf3e1('0x8')](),controller[_0xf3e1('0x9')]);router[_0xf3e1('0xa')](_0xf3e1('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xf3e1('0xa')](_0xf3e1('0xc'),auth['isAuthenticated'](),controller[_0xf3e1('0xd')]);router[_0xf3e1('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf3e1('0xe')]);router['get'](_0xf3e1('0xf'),auth[_0xf3e1('0x8')](),controller[_0xf3e1('0x10')]);router[_0xf3e1('0x11')]('/',auth[_0xf3e1('0x8')](),controller['create']);router[_0xf3e1('0x11')]('/:id/messages',auth[_0xf3e1('0x8')](),controller[_0xf3e1('0x12')]);router['post'](_0xf3e1('0x13'),auth[_0xf3e1('0x8')](),interaction[_0xf3e1('0x14')](_0xf3e1('0x15'),_0xf3e1('0x16')),controller['addTags']);router[_0xf3e1('0x17')](_0xf3e1('0xc'),auth[_0xf3e1('0x8')](),interaction[_0xf3e1('0x14')](_0xf3e1('0x15'),_0xf3e1('0x18')),controller['update']);router[_0xf3e1('0x19')](_0xf3e1('0xc'),auth[_0xf3e1('0x8')](),interaction[_0xf3e1('0x14')]('mail',_0xf3e1('0x1a')),controller[_0xf3e1('0x1b')]);router[_0xf3e1('0x19')]('/:id/tags',auth[_0xf3e1('0x8')](),controller[_0xf3e1('0x1c')]);module[_0xf3e1('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 8569410..c69ac21 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 _0x0e1e=['out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM'];(function(_0x3cdd83,_0x103dd3){var _0x331c7a=function(_0x166e71){while(--_0x166e71){_0x3cdd83['push'](_0x3cdd83['shift']());}};_0x331c7a(++_0x103dd3);}(_0x0e1e,0xb5));var _0xe0e1=function(_0x30ffe6,_0x16ce7f){_0x30ffe6=_0x30ffe6-0x0;var _0x488f2=_0x0e1e[_0x30ffe6];return _0x488f2;};'use strict';var Sequelize=require(_0xe0e1('0x0'));var iconv=require(_0xe0e1('0x1'));module[_0xe0e1('0x2')]={'closed':{'type':Sequelize[_0xe0e1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe0e1('0x4')]},'disposition':{'type':Sequelize[_0xe0e1('0x5')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xe0e1('0x5')](0x1fe)},'to':{'type':Sequelize[_0xe0e1('0x5')]},'cc':{'type':Sequelize[_0xe0e1('0x6')](_0xe0e1('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0xe0e1('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xe0e1('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xe0e1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe0e1('0x8')]('in',_0xe0e1('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe0e1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xe0e1('0x8')]('in',_0xe0e1('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xe0e1('0x6')](_0xe0e1('0x7'))},'lastMsgText':{'type':Sequelize[_0xe0e1('0x6')](_0xe0e1('0x7'))}}; \ No newline at end of file +var _0xb018=['DATE','out','ENUM','sequelize','exports','BOOLEAN','STRING','TEXT','long'];(function(_0x33a685,_0x2f00ff){var _0x34a360=function(_0x26e412){while(--_0x26e412){_0x33a685['push'](_0x33a685['shift']());}};_0x34a360(++_0x2f00ff);}(_0xb018,0x162));var _0x8b01=function(_0x428303,_0x1835b3){_0x428303=_0x428303-0x0;var _0x12d0e8=_0xb018[_0x428303];return _0x12d0e8;};'use strict';var Sequelize=require(_0x8b01('0x0'));var iconv=require('iconv');module[_0x8b01('0x1')]={'closed':{'type':Sequelize[_0x8b01('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x8b01('0x3')]},'note':{'type':Sequelize[_0x8b01('0x3')]},'inReplyTo':{'type':Sequelize[_0x8b01('0x3')](0x1fe)},'to':{'type':Sequelize[_0x8b01('0x3')]},'cc':{'type':Sequelize[_0x8b01('0x4')](_0x8b01('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8b01('0x6')]},'substatus':{'type':Sequelize[_0x8b01('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x8b01('0x6')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x8b01('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8b01('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x8b01('0x8')]('in',_0x8b01('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x8b01('0x4')]('long')},'lastMsgText':{'type':Sequelize['TEXT'](_0x8b01('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 6a63e55..e4b0802 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(_0x2c2229,_0x180a4f){var _0x4c7591=function(_0x2e4aa4){while(--_0x2e4aa4){_0x2c2229['push'](_0x2c2229['shift']());}};_0x4c7591(++_0x180a4f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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(_0x46ff07,_0x2b8390){var _0x7289e8=function(_0x52cb86){while(--_0x52cb86){_0x46ff07['push'](_0x46ff07['shift']());}};_0x7289e8(++_0x2b8390);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 5bfb3b0..e5f5158 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 _0xbf4d=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x4d7a8b,_0x6a1dac){var _0xd3b9f1=function(_0x1c1d73){while(--_0x1c1d73){_0x4d7a8b['push'](_0x4d7a8b['shift']());}};_0xd3b9f1(++_0x6a1dac);}(_0xbf4d,0x1ca));var _0xdbf4=function(_0x1fb9d2,_0x57a208){_0x1fb9d2=_0x1fb9d2-0x0;var _0x4a8916=_0xbf4d[_0x1fb9d2];return _0x4a8916;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xdbf4('0x0'))['db'][_0xdbf4('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xdbf4('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xdbf4('0x3')](0x0);var events={'afterCreate':_0xdbf4('0x4'),'afterUpdate':_0xdbf4('0x5'),'afterDestroy':_0xdbf4('0x6')};function emitEvent(_0x283228){return function(_0x49a5d7,_0x2141ba,_0x13c94f){_0x49a5d7[_0xdbf4('0x7')]({'attributes':['id'],'raw':!![]})[_0xdbf4('0x8')](function(_0x369391){_0x49a5d7[_0xdbf4('0x9')](_0xdbf4('0xa'),_0x369391[_0xdbf4('0xb')](function(_0x3cf84c){return{'id':_0x3cf84c['id']};}));return MailMessage[_0xdbf4('0xc')]({'where':{'MailInteractionId':_0x49a5d7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x520dad){_0x49a5d7[_0xdbf4('0x9')](_0xdbf4('0xd'),_0x520dad[_0xdbf4('0xe')]);MailInteractionEvents[_0xdbf4('0xf')](_0x283228+':'+_0x49a5d7['id'],_0x49a5d7);MailInteractionEvents[_0xdbf4('0xf')](_0x283228,_0x49a5d7);_0x13c94f(null);})[_0xdbf4('0x10')](_0x13c94f(null));};}for(var e in events){if(events[_0xdbf4('0x11')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x3925=['then','Users','findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','MailMessage','save','update'];(function(_0x7eae6c,_0x5e0499){var _0xc9e3a9=function(_0x2076f6){while(--_0x2076f6){_0x7eae6c['push'](_0x7eae6c['shift']());}};_0xc9e3a9(++_0x5e0499);}(_0x3925,0x174));var _0x5392=function(_0xea19d5,_0x4ac565){_0xea19d5=_0xea19d5-0x0;var _0x19698e=_0x3925[_0xea19d5];return _0x19698e;};'use strict';var EventEmitter=require(_0x5392('0x0'));var MailInteraction=require(_0x5392('0x1'))['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x5392('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5392('0x3'),'afterUpdate':_0x5392('0x4'),'afterDestroy':'remove'};function emitEvent(_0x46a055){return function(_0x1d5a92,_0x3a4e67,_0x3c680a){_0x1d5a92['getUsers']({'attributes':['id'],'raw':!![]})[_0x5392('0x5')](function(_0x2e33c1){_0x1d5a92['setDataValue'](_0x5392('0x6'),_0x2e33c1['map'](function(_0x16fb3f){return{'id':_0x16fb3f['id']};}));return MailMessage[_0x5392('0x7')]({'where':{'MailInteractionId':_0x1d5a92['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5392('0x5')](function(_0x762570){_0x1d5a92['setDataValue'](_0x5392('0x8'),_0x762570[_0x5392('0x9')]);MailInteractionEvents[_0x5392('0xa')](_0x46a055+':'+_0x1d5a92['id'],_0x1d5a92);MailInteractionEvents[_0x5392('0xa')](_0x46a055,_0x1d5a92);_0x3c680a(null);})['catch'](_0x3c680a(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x5392('0xb')](e,emitEvent(event));}}module[_0x5392('0xc')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 9a51150..1b86ce8 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(_0x48fd50,_0x378887){var _0x4ff1a7=function(_0x8d2c09){while(--_0x8d2c09){_0x48fd50['push'](_0x48fd50['shift']());}};_0x4ff1a7(++_0x378887);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0xedd9=['subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','get','update','catch','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions'];(function(_0xadaf72,_0x190c5e){var _0x3c9164=function(_0x1f56fd){while(--_0x1f56fd){_0xadaf72['push'](_0xadaf72['shift']());}};_0x3c9164(++_0x190c5e);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fc141,_0x37ad5f){_0x1fc141=_0x1fc141-0x0;var _0xbe9db6=_0xedd9[_0x1fc141];return _0xbe9db6;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x9edd('0xb'),'fields':[_0x9edd('0xc'),'to'],'type':_0x9edd('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3280fd,_0x49d5e3,_0x494a24){if(_0x3280fd['substatus']){_0x3280fd[_0x9edd('0xe')]=moment()[_0x9edd('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3280fd[_0x9edd('0x10')]){_0x3280fd[_0x9edd('0x11')]=moment()['format'](_0x9edd('0x12'));}_0x494a24(null,_0x49d5e3);},'beforeUpdate':function(_0x1b73d1,_0x25e64c,_0xfd544a){if(_0x1b73d1[_0x9edd('0x13')](_0x9edd('0x14'))){_0x1b73d1[_0x9edd('0xe')]=_0x1b73d1[_0x9edd('0x14')]?moment()['format'](_0x9edd('0x12')):null;}if(_0x1b73d1[_0x9edd('0x13')](_0x9edd('0x10'))){_0x1b73d1[_0x9edd('0x11')]=moment()[_0x9edd('0xf')](_0x9edd('0x12'));_0x1b73d1[_0x9edd('0x14')]=null;_0x1b73d1[_0x9edd('0xe')]=null;}_0xfd544a(null,_0x1b73d1);},'afterUpdate':function(_0x4ea60f,_0x5f5bf4,_0x448996){var _0x449cee=_0x268f9e['models'];var _0x1b54c0=_0x4ea60f[_0x9edd('0x15')]({'plain':!![]});if(_0x1b54c0[_0x9edd('0x10')]){return _0x449cee['MailMessage'][_0x9edd('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x1b54c0['id']}})['then'](function(){_0x448996();})[_0x9edd('0x17')](function(_0x1083e4){_0x448996(_0x1083e4);});}else{_0x448996();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 8fe1a65..dd8558f 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 _0x81a5=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','client','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','request\x20sent','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','UpdateMailInteraction','MailInteraction','body','options','where','debug','catch','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags'];(function(_0x467eee,_0x416c33){var _0x553ebe=function(_0x387103){while(--_0x387103){_0x467eee['push'](_0x467eee['shift']());}};_0x553ebe(++_0x416c33);}(_0x81a5,0x1c8));var _0x581a=function(_0x57179d,_0x131e79){_0x57179d=_0x57179d-0x0;var _0x3a0b21=_0x81a5[_0x57179d];return _0x3a0b21;};'use strict';var _=require(_0x581a('0x0'));var util=require(_0x581a('0x1'));var moment=require(_0x581a('0x2'));var BPromise=require(_0x581a('0x3'));var rs=require(_0x581a('0x4'));var fs=require('fs');var Redis=require(_0x581a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x581a('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x581a('0x7')]['http']({'port':0x232a});config[_0x581a('0x8')]=_[_0x581a('0x9')](config[_0x581a('0x8')],{'host':_0x581a('0xa'),'port':0x18eb});var socket=require(_0x581a('0xb'))(new Redis(config[_0x581a('0x8')]));require(_0x581a('0xc'))[_0x581a('0xd')](socket);function respondWithRpcPromise(_0x524948,_0x1c9869,_0x493493){return new BPromise(function(_0x1541f1,_0x8e2264){return client[_0x581a('0xe')](_0x524948,_0x493493)[_0x581a('0xf')](function(_0x538d9b){logger[_0x581a('0x10')]('MailInteraction,\x20%s,\x20%s',_0x1c9869,'request\x20sent');logger['debug']('MailInteraction,\x20%s,\x20%s,\x20%s',_0x1c9869,_0x581a('0x11'),JSON[_0x581a('0x12')](_0x538d9b));if(_0x538d9b['error']){if(_0x538d9b[_0x581a('0x13')][_0x581a('0x14')]===0x1f4){logger[_0x581a('0x13')](_0x581a('0x15'),_0x1c9869,_0x538d9b[_0x581a('0x13')][_0x581a('0x16')]);return _0x8e2264(_0x538d9b[_0x581a('0x13')][_0x581a('0x16')]);}logger['error'](_0x581a('0x15'),_0x1c9869,_0x538d9b[_0x581a('0x13')]['message']);return _0x1541f1(_0x538d9b[_0x581a('0x13')][_0x581a('0x16')]);}else{logger[_0x581a('0x10')](_0x581a('0x15'),_0x1c9869,'request\x20sent');_0x1541f1(_0x538d9b[_0x581a('0x17')][_0x581a('0x16')]);}})['catch'](function(_0x4bdc1a){logger[_0x581a('0x13')](_0x581a('0x15'),_0x1c9869,_0x4bdc1a);_0x8e2264(_0x4bdc1a);});});}exports[_0x581a('0x18')]=function(_0x28036f){var _0xeef3d7=this;return new Promise(function(_0x2ad551,_0x19e468){return db[_0x581a('0x19')]['update'](_0x28036f[_0x581a('0x1a')],{'raw':_0x28036f[_0x581a('0x1b')]?_0x28036f[_0x581a('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28036f['options']?_0x28036f[_0x581a('0x1b')][_0x581a('0x1c')]||null:null,'attributes':_0x28036f[_0x581a('0x1b')]?_0x28036f[_0x581a('0x1b')]['attributes']||null:null,'limit':_0x28036f[_0x581a('0x1b')]?_0x28036f[_0x581a('0x1b')]['limit']||null:null})[_0x581a('0xf')](function(_0x3ce207){logger[_0x581a('0x10')](_0x581a('0x18'),_0x28036f);logger[_0x581a('0x1d')]('UpdateMailInteraction',_0x28036f,JSON['stringify'](_0x3ce207));_0x2ad551(_0x3ce207);})[_0x581a('0x1e')](function(_0x56262f){logger['error'](_0x581a('0x18'),_0x56262f[_0x581a('0x16')],_0x28036f);_0x19e468(_0xeef3d7[_0x581a('0x13')](0x1f4,_0x56262f['message']));});});};exports[_0x581a('0x1f')]=function(_0x4839c3){return new Promise(function(_0x111ec2,_0x2136fb){return db['MailInteraction'][_0x581a('0x20')]({'where':_0x4839c3[_0x581a('0x1b')]?_0x4839c3[_0x581a('0x1b')][_0x581a('0x1c')]||null:null})[_0x581a('0xf')](function(_0x25ee76){if(_0x25ee76){return _0x25ee76[_0x581a('0x21')](_0x4839c3[_0x581a('0x1a')][_0x581a('0x22')],_[_0x581a('0x23')](_0x4839c3['body'],[_0x581a('0x22'),'id'])||{});}})[_0x581a('0x24')](function(_0x51763c){logger[_0x581a('0x10')](_0x581a('0x25'),_0x4839c3);logger['debug'](_0x581a('0x25'),_0x4839c3,JSON[_0x581a('0x12')](_0x51763c));_0x111ec2(_0x51763c);})[_0x581a('0x1e')](function(_0x21dabb){logger[_0x581a('0x13')](_0x581a('0x25'),_0x21dabb[_0x581a('0x16')],_0x4839c3);_0x2136fb(_this[_0x581a('0x13')](0x1f4,_0x21dabb[_0x581a('0x16')]));});});}; \ No newline at end of file +var _0x6b61=['../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','request','then','info','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailInteraction,\x20%s,\x20%s','result','catch','UpdateMailInteraction','body','options','raw','where','attributes','limit','find','addTags','ids','omit','spread','debug','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x456b57,_0x58691a){var _0x18f49f=function(_0x1dc195){while(--_0x1dc195){_0x456b57['push'](_0x456b57['shift']());}};_0x18f49f(++_0x58691a);}(_0x6b61,0x16a));var _0x16b6=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x6b61[_0x49c057];return _0xd8f0e6;};'use strict';var _=require(_0x16b6('0x0'));var util=require('util');var moment=require(_0x16b6('0x1'));var BPromise=require(_0x16b6('0x2'));var rs=require(_0x16b6('0x3'));var fs=require('fs');var Redis=require(_0x16b6('0x4'));var db=require(_0x16b6('0x5'))['db'];var utils=require(_0x16b6('0x6'));var logger=require(_0x16b6('0x7'))(_0x16b6('0x8'));var config=require('../../config/environment');var jayson=require(_0x16b6('0x9'));var client=jayson[_0x16b6('0xa')]['http']({'port':0x232a});config[_0x16b6('0xb')]=_[_0x16b6('0xc')](config['redis'],{'host':_0x16b6('0xd'),'port':0x18eb});var socket=require(_0x16b6('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x282385,_0x4cdac4,_0x95f3c5){return new BPromise(function(_0x33f15f,_0xdc323d){return client[_0x16b6('0xf')](_0x282385,_0x95f3c5)[_0x16b6('0x10')](function(_0x2114e4){logger[_0x16b6('0x11')]('MailInteraction,\x20%s,\x20%s',_0x4cdac4,'request\x20sent');logger['debug'](_0x16b6('0x12'),_0x4cdac4,_0x16b6('0x13'),JSON[_0x16b6('0x14')](_0x2114e4));if(_0x2114e4[_0x16b6('0x15')]){if(_0x2114e4[_0x16b6('0x15')][_0x16b6('0x16')]===0x1f4){logger[_0x16b6('0x15')]('MailInteraction,\x20%s,\x20%s',_0x4cdac4,_0x2114e4[_0x16b6('0x15')]['message']);return _0xdc323d(_0x2114e4['error']['message']);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x4cdac4,_0x2114e4['error'][_0x16b6('0x17')]);return _0x33f15f(_0x2114e4['error']['message']);}else{logger['info'](_0x16b6('0x18'),_0x4cdac4,_0x16b6('0x13'));_0x33f15f(_0x2114e4[_0x16b6('0x19')][_0x16b6('0x17')]);}})[_0x16b6('0x1a')](function(_0x1302f3){logger[_0x16b6('0x15')](_0x16b6('0x18'),_0x4cdac4,_0x1302f3);_0xdc323d(_0x1302f3);});});}exports[_0x16b6('0x1b')]=function(_0x478ea1){var _0x3ccdfa=this;return new Promise(function(_0x4a8c64,_0x5307d1){return db['MailInteraction']['update'](_0x478ea1[_0x16b6('0x1c')],{'raw':_0x478ea1[_0x16b6('0x1d')]?_0x478ea1[_0x16b6('0x1d')][_0x16b6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x478ea1[_0x16b6('0x1d')]?_0x478ea1[_0x16b6('0x1d')][_0x16b6('0x1f')]||null:null,'attributes':_0x478ea1[_0x16b6('0x1d')]?_0x478ea1['options'][_0x16b6('0x20')]||null:null,'limit':_0x478ea1[_0x16b6('0x1d')]?_0x478ea1['options'][_0x16b6('0x21')]||null:null})[_0x16b6('0x10')](function(_0x59a461){logger[_0x16b6('0x11')](_0x16b6('0x1b'),_0x478ea1);logger['debug'](_0x16b6('0x1b'),_0x478ea1,JSON[_0x16b6('0x14')](_0x59a461));_0x4a8c64(_0x59a461);})['catch'](function(_0x4394e9){logger[_0x16b6('0x15')](_0x16b6('0x1b'),_0x4394e9[_0x16b6('0x17')],_0x478ea1);_0x5307d1(_0x3ccdfa['error'](0x1f4,_0x4394e9[_0x16b6('0x17')]));});});};exports['AddTagsToMailInteraction']=function(_0x372843){return new Promise(function(_0x48c4e2,_0x43c77a){return db['MailInteraction'][_0x16b6('0x22')]({'where':_0x372843[_0x16b6('0x1d')]?_0x372843[_0x16b6('0x1d')][_0x16b6('0x1f')]||null:null})['then'](function(_0x58aca6){if(_0x58aca6){return _0x58aca6[_0x16b6('0x23')](_0x372843[_0x16b6('0x1c')][_0x16b6('0x24')],_[_0x16b6('0x25')](_0x372843[_0x16b6('0x1c')],[_0x16b6('0x24'),'id'])||{});}})[_0x16b6('0x26')](function(_0x25840b){logger[_0x16b6('0x11')]('AddTags',_0x372843);logger[_0x16b6('0x27')](_0x16b6('0x28'),_0x372843,JSON[_0x16b6('0x14')](_0x25840b));_0x48c4e2(_0x25840b);})[_0x16b6('0x1a')](function(_0x3519cc){logger[_0x16b6('0x15')]('AddTags',_0x3519cc[_0x16b6('0x17')],_0x372843);_0x43c77a(_this[_0x16b6('0x15')](0x1f4,_0x3519cc['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 36b15f3..6ad1d22 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 _0x5023=['remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events','save'];(function(_0xd88549,_0x23b388){var _0x35c1e1=function(_0x5c8389){while(--_0x5c8389){_0xd88549['push'](_0xd88549['shift']());}};_0x35c1e1(++_0x23b388);}(_0x5023,0x6a));var _0x3502=function(_0x410da0,_0x2138e5){_0x410da0=_0x410da0-0x0;var _0x3b9106=_0x5023[_0x410da0];return _0x3b9106;};'use strict';var MailInteractionEvents=require(_0x3502('0x0'));var events=[_0x3502('0x1'),_0x3502('0x2'),_0x3502('0x3')];function createListener(_0x1773b6,_0x390464){return function(_0x45ddaa){_0x390464[_0x3502('0x4')](_0x1773b6,_0x45ddaa);};}function removeListener(_0x50a739,_0x325aa0){return function(){MailInteractionEvents[_0x3502('0x5')](_0x50a739,_0x325aa0);};}exports[_0x3502('0x6')]=function(_0x46ece2){for(var _0x5f2481=0x0,_0x5c0c82=events[_0x3502('0x7')];_0x5f2481<_0x5c0c82;_0x5f2481++){var _0x5a5897=events[_0x5f2481];var _0x1d0c53=createListener(_0x3502('0x8')+_0x5a5897,_0x46ece2);MailInteractionEvents['on'](_0x5a5897,_0x1d0c53);}}; \ No newline at end of file +var _0x208f=['save','remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x251d69,_0x2c3d00){var _0x43d387=function(_0x1da961){while(--_0x1da961){_0x251d69['push'](_0x251d69['shift']());}};_0x43d387(++_0x2c3d00);}(_0x208f,0xd7));var _0xf208=function(_0x830e7c,_0x295a4f){_0x830e7c=_0x830e7c-0x0;var _0x23cc5c=_0x208f[_0x830e7c];return _0x23cc5c;};'use strict';var MailInteractionEvents=require(_0xf208('0x0'));var events=[_0xf208('0x1'),_0xf208('0x2'),_0xf208('0x3')];function createListener(_0x2fad97,_0x430ab5){return function(_0x464931){_0x430ab5[_0xf208('0x4')](_0x2fad97,_0x464931);};}function removeListener(_0x5e6d69,_0x3374aa){return function(){MailInteractionEvents[_0xf208('0x5')](_0x5e6d69,_0x3374aa);};}exports[_0xf208('0x6')]=function(_0x1cc687){for(var _0x3a1041=0x0,_0x178414=events[_0xf208('0x7')];_0x3a1041<_0x178414;_0x3a1041++){var _0x5a668a=events[_0x3a1041];var _0x4bac63=createListener(_0xf208('0x8')+_0x5a668a,_0x1cc687);MailInteractionEvents['on'](_0x5a668a,_0x4bac63);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6f1e423..7275b16 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 _0x3e74=['path','connect-timeout','express','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','accept','/:id/reject','delete','destroy','multer'];(function(_0x33c65a,_0x2fa474){var _0x55b76e=function(_0x5e23f7){while(--_0x5e23f7){_0x33c65a['push'](_0x33c65a['shift']());}};_0x55b76e(++_0x2fa474);}(_0x3e74,0x175));var _0x43e7=function(_0x1183c9,_0x3d9fd9){_0x1183c9=_0x1183c9-0x0;var _0x527956=_0x3e74[_0x1183c9];return _0x527956;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth['isAuthenticated'](),interaction[_0x43e7('0xd')]('mail',_0x43e7('0xe')),controller[_0x43e7('0xf')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router[_0x43e7('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x43e7('0x12')]);router[_0x43e7('0x11')](_0x43e7('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x43e7('0x14')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);module['exports']=router; \ No newline at end of file +var _0x4b84=['express','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','/:id','put','accept','/:id/reject','delete','destroy','multer','util'];(function(_0x453c63,_0x1ceeff){var _0x295eb9=function(_0x5ad2c1){while(--_0x5ad2c1){_0x453c63['push'](_0x453c63['shift']());}};_0x295eb9(++_0x1ceeff);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4a45b4,_0x59804f){_0x4a45b4=_0x4a45b4-0x0;var _0x1a99c9=_0x4b84[_0x4a45b4];return _0x1a99c9;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x44b8('0x3'));var config=require(_0x44b8('0x4'));var controller=require(_0x44b8('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x44b8('0x6')]('/describe',auth[_0x44b8('0x7')](),controller['describe']);router[_0x44b8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router[_0x44b8('0x6')](_0x44b8('0x9'),auth['isAuthenticated'](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth[_0x44b8('0x7')](),interaction[_0x44b8('0xc')](_0x44b8('0xd'),_0x44b8('0xe')),controller[_0x44b8('0xf')]);router['put'](_0x44b8('0x10'),auth[_0x44b8('0x7')](),controller['update']);router[_0x44b8('0x11')]('/:id/accept',auth[_0x44b8('0x7')](),controller[_0x44b8('0x12')]);router['put'](_0x44b8('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x44b8('0x14')](_0x44b8('0x10'),auth[_0x44b8('0x7')](),controller[_0x44b8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index db86733..929b34d 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 _0x7753=['INTEGER','sequelize','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7753,0xfd));var _0x3775=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0x7753[_0x5216e0];return _0x5b3f40;};'use strict';var Sequelize=require(_0x3775('0x0'));var _=require(_0x3775('0x1'));module[_0x3775('0x2')]={'body':{'type':Sequelize[_0x3775('0x3')](_0x3775('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x3775('0x5'))},'read':{'type':Sequelize[_0x3775('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3775('0x7')]('in','out'),'defaultValue':_0x3775('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3775('0x9')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x3775('0x3')](_0x3775('0x4'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x3775('0x3')](_0x3775('0x4'))},'subject':{'type':Sequelize[_0x3775('0x3')]},'sentAt':{'type':Sequelize[_0x3775('0xa')]},'attach':{'type':Sequelize[_0x3775('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3775('0xa')]},'originTo':{'type':Sequelize[_0x3775('0x3')](_0x3775('0x4'))},'originCc':{'type':Sequelize[_0x3775('0x3')](_0x3775('0x4'))}}; \ No newline at end of file +var _0xc6d7=['out','STRING','long','INTEGER','DATE','sequelize','lodash','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x4ea16d,_0x27c8d8){var _0x207d7f=function(_0xc960ff){while(--_0xc960ff){_0x4ea16d['push'](_0x4ea16d['shift']());}};_0x207d7f(++_0x27c8d8);}(_0xc6d7,0x71));var _0x7c6d=function(_0x294365,_0x274280){_0x294365=_0x294365-0x0;var _0x33a59b=_0xc6d7[_0x294365];return _0x33a59b;};'use strict';var Sequelize=require(_0x7c6d('0x0'));var _=require(_0x7c6d('0x1'));module[_0x7c6d('0x2')]={'body':{'type':Sequelize[_0x7c6d('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x7c6d('0x4'))},'read':{'type':Sequelize[_0x7c6d('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7c6d('0x6')]('in',_0x7c6d('0x7')),'defaultValue':_0x7c6d('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7c6d('0x8')](0x1fe)},'from':{'type':Sequelize[_0x7c6d('0x8')]},'to':{'type':Sequelize[_0x7c6d('0x3')](_0x7c6d('0x9'))},'cc':{'type':Sequelize[_0x7c6d('0x3')](_0x7c6d('0x9'))},'bcc':{'type':Sequelize[_0x7c6d('0x3')](_0x7c6d('0x9'))},'subject':{'type':Sequelize[_0x7c6d('0x3')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x7c6d('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7c6d('0xb')]},'originTo':{'type':Sequelize[_0x7c6d('0x3')](_0x7c6d('0x9'))},'originCc':{'type':Sequelize[_0x7c6d('0x3')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index eb669d4..5eadf45 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 _0x0dec=['save','update','destroy','sendStatus','stack','name','send','map','MailMessage','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','length','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','MailServerOut','Smtp','isNil','service','host','secure','user','pass','auth','attachments','root','basename','CmContact','defaults','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','read','readAt','UserId','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','mail','agent','interaction','RejectMessage','rejectmessage','download','toString','server','files','tmp','join','message-%s.eml','bcc','Attachment','from','subject','headers','Bcc','Attachments','push','type','readFileSync','build','writeFileSync','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','Content-Range','apply','reject'];(function(_0x1ec9d1,_0x35ecaf){var _0x4b6bc2=function(_0x2695c6){while(--_0x2695c6){_0x1ec9d1['push'](_0x1ec9d1['shift']());}};_0x4b6bc2(++_0x35ecaf);}(_0x0dec,0x11c));var _0xc0de=function(_0x414d11,_0x515c01){_0x414d11=_0x414d11-0x0;var _0x959baf=_0x0dec[_0x414d11];return _0x959baf;};'use strict';var pdf=require(_0xc0de('0x0'));var emlformat=require(_0xc0de('0x1'));var rimraf=require(_0xc0de('0x2'));var zipdir=require(_0xc0de('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0de('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0de('0x5'));var util=require(_0xc0de('0x6'));var path=require(_0xc0de('0x7'));var sox=require(_0xc0de('0x8'));var csv=require(_0xc0de('0x9'));var ejs=require(_0xc0de('0xa'));var fs=require('fs');var _=require(_0xc0de('0xb'));var squel=require(_0xc0de('0xc'));var crypto=require(_0xc0de('0xd'));var jsforce=require(_0xc0de('0xe'));var deskjs=require(_0xc0de('0xf'));var toCsv=require(_0xc0de('0x9'));var querystring=require(_0xc0de('0x10'));var Papa=require(_0xc0de('0x11'));var Redis=require(_0xc0de('0x12'));var authService=require(_0xc0de('0x13'));var qs=require(_0xc0de('0x14'));var as=require(_0xc0de('0x15'));var hardwareService=require(_0xc0de('0x16'));var logger=require(_0xc0de('0x17'))(_0xc0de('0x18'));var utils=require(_0xc0de('0x19'));var config=require(_0xc0de('0x1a'));var db=require(_0xc0de('0x1b'))['db'];config[_0xc0de('0x1c')]=_['defaults'](config[_0xc0de('0x1c')],{'host':_0xc0de('0x1d'),'port':0x18eb});var socket=require(_0xc0de('0x1e'))(new Redis(config[_0xc0de('0x1c')]));require(_0xc0de('0x1f'))[_0xc0de('0x20')](socket);var jayson=require(_0xc0de('0x21'));var client=jayson[_0xc0de('0x22')][_0xc0de('0x23')]({'port':0x232c});var client9003=jayson[_0xc0de('0x22')][_0xc0de('0x23')]({'port':0x232b});var client9002=jayson[_0xc0de('0x22')]['http']({'port':0x232a});function checkPasswordPattern(_0x12d66c,_0x1128e9,_0x526f67){if(_0x526f67){var _0x100458=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x100458[_0xc0de('0x24')](_0x1128e9)){return _0x12d66c;}else{throw new db[(_0xc0de('0x25'))]['ValidationError'](_0xc0de('0x26'));}}else{return _0x12d66c;}}function respondWithRpcPromise(_0x4a368e,_0x446d75,_0x5ac5b1,_0x412ceb){return new BPromise(function(_0x1109d2,_0x5b6104){var _0x2849de=_0x412ceb||client;return _0x2849de[_0xc0de('0x27')](_0x4a368e,_0x5ac5b1)[_0xc0de('0x28')](function(_0x2d855e){logger[_0xc0de('0x29')](_0xc0de('0x2a'),_0x446d75,_0xc0de('0x2b'));logger[_0xc0de('0x2c')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x446d75,_0xc0de('0x2b'),JSON[_0xc0de('0x2d')](_0x2d855e));if(_0x2d855e[_0xc0de('0x2e')]){if(_0x2d855e[_0xc0de('0x2e')][_0xc0de('0x2f')]===0x1f4){logger['error'](_0xc0de('0x2a'),_0x446d75,_0x2d855e[_0xc0de('0x2e')][_0xc0de('0x30')]);return _0x5b6104(_0x2d855e[_0xc0de('0x2e')]['message']);}logger[_0xc0de('0x2e')](_0xc0de('0x2a'),_0x446d75,_0x2d855e[_0xc0de('0x2e')][_0xc0de('0x30')]);return _0x1109d2(_0x2d855e[_0xc0de('0x2e')][_0xc0de('0x30')]);}else{logger[_0xc0de('0x29')](_0xc0de('0x2a'),_0x446d75,_0xc0de('0x2b'));_0x1109d2(_0x2d855e[_0xc0de('0x31')][_0xc0de('0x30')]);}})[_0xc0de('0x32')](function(_0xece6ca){logger['error']('MailMessage,\x20%s,\x20%s',_0x446d75,_0xece6ca);_0x5b6104(_0xece6ca);});});}function respondWithStatusCode(_0x285669,_0x2d6faa){_0x2d6faa=_0x2d6faa||0xcc;return function(_0x59fed0){if(_0x59fed0){return _0x285669['sendStatus'](_0x2d6faa);}return _0x285669[_0xc0de('0x33')](_0x2d6faa)[_0xc0de('0x34')]();};}function respondWithResult(_0x4ea40c,_0x484af0){_0x484af0=_0x484af0||0xc8;return function(_0x428089){if(_0x428089){return _0x4ea40c[_0xc0de('0x33')](_0x484af0)[_0xc0de('0x35')](_0x428089);}};}function respondWithFilteredResult(_0x5f317f,_0x23ff66){return function(_0x4eb14d){if(_0x4eb14d){var _0x1d6a49=_0x4eb14d[_0xc0de('0x36')],_0x1ccf8a=_0x23ff66['offset'],_0x61c92e=_0x23ff66[_0xc0de('0x37')]+_0x23ff66[_0xc0de('0x38')],_0x526862;if(_0x61c92e>=_0x1d6a49){_0x61c92e=_0x1d6a49;_0x526862=0xc8;}else{_0x526862=0xce;}_0x5f317f[_0xc0de('0x33')](_0x526862);return _0x5f317f['set'](_0xc0de('0x39'),_0x1ccf8a+'-'+_0x61c92e+'/'+_0x1d6a49)[_0xc0de('0x35')](_0x4eb14d);}return null;};}function patchUpdates(_0x104730){return function(_0x2e317a){try{jsonpatch[_0xc0de('0x3a')](_0x2e317a,_0x104730,!![]);}catch(_0x4456cc){return BPromise[_0xc0de('0x3b')](_0x4456cc);}return _0x2e317a[_0xc0de('0x3c')]();};}function saveUpdates(_0x197807,_0xe2a4f){return function(_0x47a8b9){if(_0x47a8b9){return _0x47a8b9[_0xc0de('0x3d')](_0x197807)['then'](function(_0xaca7e7){return _0xaca7e7;});}return null;};}function removeEntity(_0x11dc25,_0x2e2899){return function(_0xab9049){if(_0xab9049){return _0xab9049[_0xc0de('0x3e')]()[_0xc0de('0x28')](function(){_0x11dc25[_0xc0de('0x33')](0xcc)[_0xc0de('0x34')]();});}};}function handleEntityNotFound(_0x4128d7,_0x270708){return function(_0x4499e6){if(!_0x4499e6){_0x4128d7[_0xc0de('0x3f')](0x194);}return _0x4499e6;};}function handleError(_0x52303d,_0x534069){_0x534069=_0x534069||0x1f4;return function(_0x199aff){logger[_0xc0de('0x2e')](_0x199aff[_0xc0de('0x40')]);if(_0x199aff[_0xc0de('0x41')]){delete _0x199aff[_0xc0de('0x41')];}_0x52303d[_0xc0de('0x33')](_0x534069)[_0xc0de('0x42')](_0x199aff);};}exports['index']=function(_0x4ce461,_0x58fb03){var _0x37a4cd={},_0x135544={},_0x172183={'count':0x0,'rows':[]};var _0x15c12f=_[_0xc0de('0x43')](db[_0xc0de('0x44')]['rawAttributes'],function(_0x44407f){return{'name':_0x44407f[_0xc0de('0x45')],'type':_0x44407f['type'][_0xc0de('0x46')]};});_0x135544['model']=_[_0xc0de('0x43')](_0x15c12f,_0xc0de('0x41'));_0x135544[_0xc0de('0x47')]=_[_0xc0de('0x48')](_0x4ce461[_0xc0de('0x47')]);_0x135544[_0xc0de('0x49')]=_[_0xc0de('0x4a')](_0x135544[_0xc0de('0x4b')],_0x135544[_0xc0de('0x47')]);_0x37a4cd[_0xc0de('0x4c')]=_[_0xc0de('0x4a')](_0x135544['model'],qs[_0xc0de('0x4d')](_0x4ce461[_0xc0de('0x47')][_0xc0de('0x4d')]));_0x37a4cd[_0xc0de('0x4c')]=_0x37a4cd[_0xc0de('0x4c')]['length']?_0x37a4cd['attributes']:_0x135544[_0xc0de('0x4b')];if(!_0x4ce461[_0xc0de('0x47')][_0xc0de('0x4e')](_0xc0de('0x4f'))){_0x37a4cd['limit']=qs['limit'](_0x4ce461['query'][_0xc0de('0x38')]);_0x37a4cd['offset']=qs[_0xc0de('0x37')](_0x4ce461[_0xc0de('0x47')][_0xc0de('0x37')]);}_0x37a4cd[_0xc0de('0x50')]=qs[_0xc0de('0x51')](_0x4ce461[_0xc0de('0x47')]['sort']);_0x37a4cd[_0xc0de('0x52')]=qs[_0xc0de('0x49')](_[_0xc0de('0x53')](_0x4ce461[_0xc0de('0x47')],_0x135544['filters']),_0x15c12f);if(_0x4ce461[_0xc0de('0x47')][_0xc0de('0x54')]){_0x37a4cd[_0xc0de('0x52')]=_['merge'](_0x37a4cd[_0xc0de('0x52')],{'$or':_[_0xc0de('0x43')](_0x15c12f,function(_0xfc9cc0){if(_0xfc9cc0['type']!==_0xc0de('0x55')){var _0x5b4247={};_0x5b4247[_0xfc9cc0[_0xc0de('0x41')]]={'$like':'%'+_0x4ce461['query'][_0xc0de('0x54')]+'%'};return _0x5b4247;}})});}_0x37a4cd=_[_0xc0de('0x56')]({},_0x37a4cd,_0x4ce461[_0xc0de('0x57')]);var _0x3814f8={'where':_0x37a4cd['where']};return db[_0xc0de('0x44')][_0xc0de('0x36')](_0x3814f8)[_0xc0de('0x28')](function(_0x3b2447){_0x172183[_0xc0de('0x36')]=_0x3b2447;if(_0x4ce461[_0xc0de('0x47')][_0xc0de('0x58')]){_0x37a4cd[_0xc0de('0x59')]=[{'all':!![]}];}return db[_0xc0de('0x44')]['findAll'](_0x37a4cd);})[_0xc0de('0x28')](function(_0x1cf513){_0x172183[_0xc0de('0x5a')]=_0x1cf513;return _0x172183;})['then'](respondWithFilteredResult(_0x58fb03,_0x37a4cd))[_0xc0de('0x32')](handleError(_0x58fb03,null));};exports[_0xc0de('0x5b')]=function(_0x21a59b,_0x54ddd4){var _0x4c6837={'raw':!![],'where':{'id':_0x21a59b[_0xc0de('0x5c')]['id']}},_0x437159={};_0x437159['model']=_['keys'](db[_0xc0de('0x44')]['rawAttributes']);_0x437159[_0xc0de('0x47')]=_[_0xc0de('0x48')](_0x21a59b['query']);_0x437159['filters']=_['intersection'](_0x437159[_0xc0de('0x4b')],_0x437159[_0xc0de('0x47')]);_0x4c6837[_0xc0de('0x4c')]=_[_0xc0de('0x4a')](_0x437159['model'],qs[_0xc0de('0x4d')](_0x21a59b[_0xc0de('0x47')][_0xc0de('0x4d')]));_0x4c6837[_0xc0de('0x4c')]=_0x4c6837[_0xc0de('0x4c')][_0xc0de('0x5d')]?_0x4c6837[_0xc0de('0x4c')]:_0x437159['model'];if(_0x21a59b[_0xc0de('0x47')][_0xc0de('0x58')]){_0x4c6837[_0xc0de('0x59')]=[{'all':!![]}];}_0x4c6837=_[_0xc0de('0x56')]({},_0x4c6837,_0x21a59b['options']);return db['MailMessage'][_0xc0de('0x5e')](_0x4c6837)[_0xc0de('0x28')](handleEntityNotFound(_0x54ddd4,null))[_0xc0de('0x28')](respondWithResult(_0x54ddd4,null))[_0xc0de('0x32')](handleError(_0x54ddd4,null));};exports[_0xc0de('0x3d')]=function(_0x13b76f,_0x18faa0){if(_0x13b76f[_0xc0de('0x5f')]['id']){delete _0x13b76f[_0xc0de('0x5f')]['id'];}return db[_0xc0de('0x44')]['find']({'where':{'id':_0x13b76f[_0xc0de('0x5c')]['id']}})[_0xc0de('0x28')](handleEntityNotFound(_0x18faa0,null))['then'](saveUpdates(_0x13b76f['body'],null))['then'](respondWithResult(_0x18faa0,null))['catch'](handleError(_0x18faa0,null));};exports[_0xc0de('0x3e')]=function(_0x15bfcb,_0x4a46a2){return db['MailMessage'][_0xc0de('0x5e')]({'where':{'id':_0x15bfcb[_0xc0de('0x5c')]['id']}})[_0xc0de('0x28')](handleEntityNotFound(_0x4a46a2,null))[_0xc0de('0x28')](removeEntity(_0x4a46a2,null))[_0xc0de('0x32')](handleError(_0x4a46a2,null));};exports[_0xc0de('0x60')]=function(_0x4e1535,_0x3e8afe){return db[_0xc0de('0x44')][_0xc0de('0x60')]()[_0xc0de('0x28')](respondWithResult(_0x3e8afe,null))[_0xc0de('0x32')](handleError(_0x3e8afe,null));};exports[_0xc0de('0x61')]=function(_0x1ca913,_0x1fe9af){return db[_0xc0de('0x44')]['create'](_0x1ca913['body'])[_0xc0de('0x28')](function(_0x3ea480){if(_0x3ea480){if(_0x3ea480[_0xc0de('0x62')]===_0xc0de('0x63')&&!_0x3ea480[_0xc0de('0x64')]){var _0x534674,_0x170621,_0x2060b2;if(_0x1ca913[_0xc0de('0x5f')]['to']){_0x170621=_0x1ca913[_0xc0de('0x5f')]['to'][_0xc0de('0x65')](',')[0x0];}return db[_0xc0de('0x66')][_0xc0de('0x67')]({'where':{'id':_0x3ea480[_0xc0de('0x68')]},'include':[{'model':db[_0xc0de('0x69')],'as':_0xc0de('0x6a'),'include':[{'model':db['CmContact'],'as':_0xc0de('0x6b'),'where':{'email':_0x170621},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xc0de('0x6c')],'as':_0xc0de('0x6d'),'raw':!![]}]})[_0xc0de('0x28')](function(_0x4f682){_0x534674=_0x4f682;if(_0x534674&&_0x534674[_0xc0de('0x6d')]){var _0x35ce50={'tls':{'rejectUnauthorized':![]}};if(_[_0xc0de('0x6e')](_0x534674[_0xc0de('0x6d')][_0xc0de('0x6f')])){_0x35ce50['host']=_0x534674[_0xc0de('0x6d')][_0xc0de('0x70')];_0x35ce50['port']=_0x534674['Smtp']['port'];_0x35ce50[_0xc0de('0x71')]=_0x534674['Smtp'][_0xc0de('0x71')];if(_0x534674['Smtp']['authentication']){_0x35ce50['auth']={'user':_0x534674[_0xc0de('0x6d')][_0xc0de('0x72')],'pass':_0x534674[_0xc0de('0x6d')][_0xc0de('0x73')]};}}else{_0x35ce50[_0xc0de('0x6f')]=_0x534674[_0xc0de('0x6d')][_0xc0de('0x6f')];_0x35ce50[_0xc0de('0x74')]={'user':_0x534674[_0xc0de('0x6d')][_0xc0de('0x72')],'pass':_0x534674[_0xc0de('0x6d')][_0xc0de('0x73')]};_0x35ce50[_0xc0de('0x71')]=_0x534674['Smtp']['secure'];}if(_0x1ca913['body'][_0xc0de('0x75')]&&_0x1ca913[_0xc0de('0x5f')][_0xc0de('0x75')][_0xc0de('0x5d')]){for(var _0x32e818=0x0;_0x32e818<_0x1ca913['body'][_0xc0de('0x75')][_0xc0de('0x5d')];_0x32e818+=0x1){_0x1ca913[_0xc0de('0x5f')][_0xc0de('0x75')][_0x32e818]={'filename':_0x1ca913['body']['attachments'][_0x32e818][_0xc0de('0x41')],'path':path['join'](config[_0xc0de('0x76')],'server/files/attachments',_0x1ca913[_0xc0de('0x5f')]['attachments'][_0x32e818][_0xc0de('0x77')])};}}_0x2060b2={'account':_0x35ce50,'message':_0x1ca913[_0xc0de('0x5f')]};return;}})[_0xc0de('0x28')](function(){if(_0x534674['List']){if(_0x534674['List'][_0xc0de('0x6b')][_0xc0de('0x5d')]){return _0x534674[_0xc0de('0x6a')][_0xc0de('0x6b')][0x0];}else{return db[_0xc0de('0x78')][_0xc0de('0x61')](_[_0xc0de('0x79')](_0x1ca913['body'],{'firstName':_0x1ca913[_0xc0de('0x5f')]['to'],'email':_0x1ca913[_0xc0de('0x5f')]['to'],'phone':_0x1ca913['body']['to'],'ListId':_0x534674[_0xc0de('0x7a')]}));}}else{throw new Error(_0xc0de('0x7b'));}})['then'](function(){if(_0x2060b2){return respondWithRpcPromise(_0xc0de('0x7c'),'sendMail',_0x2060b2,client9003)[_0xc0de('0x28')](function(_0x50168d){return _0x3ea480[_0xc0de('0x3d')]({'read':!![],'messageId':_0x50168d[_0xc0de('0x7d')],'sentAt':moment()[_0xc0de('0x7e')](_0xc0de('0x7f'))});})['catch'](function(_0x5be0ab){logger['error']('%s',JSON[_0xc0de('0x2d')](_0x5be0ab));return _0x3ea480;});}return _0x3ea480;});}return _0x3ea480;}})[_0xc0de('0x28')](respondWithResult(_0x1fe9af,0xc9))[_0xc0de('0x32')](handleError(_0x1fe9af,null));};var interaction_log=require(_0xc0de('0x17'))(_0xc0de('0x80'));exports['accept']=function(_0xdcd7e0,_0x1b6207,_0x2a719b){var _0x245df8={'channel':'mail'};if(_0xdcd7e0[_0xc0de('0x5f')]['id']){delete _0xdcd7e0[_0xc0de('0x5f')]['id'];}_0xdcd7e0['body'][_0xc0de('0x81')]=!![];_0xdcd7e0[_0xc0de('0x5f')][_0xc0de('0x82')]=moment()[_0xc0de('0x7e')](_0xc0de('0x7f'));_0xdcd7e0[_0xc0de('0x5f')]['UserId']=_0xdcd7e0[_0xc0de('0x5f')][_0xc0de('0x83')]||_0xdcd7e0[_0xc0de('0x72')]['id'];return db[_0xc0de('0x44')][_0xc0de('0x5e')]({'where':{'id':_0xdcd7e0[_0xc0de('0x5c')]['id'],'UserId':null},'include':[{'model':db[_0xc0de('0x78')],'as':'Contact'}]})[_0xc0de('0x28')](handleEntityNotFound(_0x1b6207,null))['then'](saveUpdates(_0xdcd7e0[_0xc0de('0x5f')],null))[_0xc0de('0x28')](function(_0x245824){if(_0x245824){_0x245df8[_0xc0de('0x30')]=_0x245824[_0xc0de('0x84')]({'plain':!![]});return db[_0xc0de('0x85')][_0xc0de('0x5e')]({'where':{'id':_0x245824[_0xc0de('0x86')]}});}return null;})[_0xc0de('0x28')](handleEntityNotFound(_0x1b6207,null))[_0xc0de('0x28')](function(_0x2704d2){if(_0x2704d2){return _0x2704d2[_0xc0de('0x3d')]({'UserId':_0xdcd7e0[_0xc0de('0x5f')][_0xc0de('0x83')],'read1stAt':_[_0xc0de('0x6e')](_0x2704d2[_0xc0de('0x87')])?moment()['format'](_0xc0de('0x7f')):undefined});}return null;})[_0xc0de('0x28')](function(_0x4aa9fc){if(_0x4aa9fc){_0x245df8['interaction']=_0x4aa9fc[_0xc0de('0x84')]({'plain':!![]});interaction_log[_0xc0de('0x29')](_0xc0de('0x88'),_0xdcd7e0[_0xc0de('0x72')]['id'],_0xdcd7e0[_0xc0de('0x72')][_0xc0de('0x41')],_0xdcd7e0[_0xc0de('0x72')][_0xc0de('0x89')],_0x245df8['interaction']['id'],_0xdcd7e0['body']?JSON[_0xc0de('0x2d')](_0xdcd7e0[_0xc0de('0x5f')]):'null');return respondWithRpcPromise(_0xc0de('0x8a'),_0xc0de('0x8b'),_0x245df8);}return null;})['then'](function(_0x10afda){if(_0x10afda){if(_0xdcd7e0[_0xc0de('0x5f')][_0xc0de('0x8c')]){_0x245df8[_0xc0de('0x30')][_0xc0de('0x8d')]=util['format'](_0xc0de('0x8e'),_0xdcd7e0[_0xc0de('0x72')][_0xc0de('0x41')]);_0x245df8[_0xc0de('0x30')][_0xc0de('0x8f')]=_0x245df8[_0xc0de('0x8f')];_0x245df8[_0xc0de('0x30')][_0xc0de('0x90')]='accept';return respondWithRpcPromise(_0xc0de('0x91'),'EventManager',{'event':_0xc0de('0x92'),'message':_0x245df8[_0xc0de('0x30')]},client9002)[_0xc0de('0x28')](function(){return _0x245df8;});}return _0x245df8;}return null;})[_0xc0de('0x28')](respondWithResult(_0x1b6207,null))['catch'](handleError(_0x1b6207,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0xc0de('0x3b')]=function(_0x4a6f36,_0x20e908,_0x5629fa){var _0x12e03f={'agent':{},'channel':_0xc0de('0x93')};if(_0x4a6f36[_0xc0de('0x5f')]['id']){delete _0x4a6f36[_0xc0de('0x5f')]['id'];}_0x4a6f36[_0xc0de('0x5f')][_0xc0de('0x83')]=_0x4a6f36[_0xc0de('0x5f')][_0xc0de('0x83')]||_0x4a6f36['user']['id'];_0x12e03f[_0xc0de('0x94')]['id']=_0x4a6f36[_0xc0de('0x5f')][_0xc0de('0x83')];return db['MailMessage'][_0xc0de('0x5e')]({'where':{'id':_0x4a6f36['params']['id'],'UserId':null}})[_0xc0de('0x28')](handleEntityNotFound(_0x20e908,null))[_0xc0de('0x28')](function(_0x2daff4){if(_0x2daff4){_0x12e03f[_0xc0de('0x30')]=_0x2daff4[_0xc0de('0x84')]({'plain':!![]});return db['MailInteraction'][_0xc0de('0x5e')]({'where':{'id':_0x2daff4[_0xc0de('0x86')]}});}return null;})[_0xc0de('0x28')](handleEntityNotFound(_0x20e908,null))[_0xc0de('0x28')](function(_0x1e6f94){if(_0x1e6f94){_0x12e03f[_0xc0de('0x95')]=_0x1e6f94['get']({'plain':!![]});interaction_log[_0xc0de('0x29')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4a6f36['user']['id'],_0x4a6f36[_0xc0de('0x72')]['name'],_0x4a6f36['user']['role'],_0x12e03f[_0xc0de('0x95')]['id'],_0x4a6f36[_0xc0de('0x5f')]?JSON[_0xc0de('0x2d')](_0x4a6f36[_0xc0de('0x5f')]):'null');return respondWithRpcPromise(_0xc0de('0x96'),'rejectMessage',_0x12e03f);}return null;})['then'](function(_0x15cd26){if(_0x15cd26){_0x15cd26['message'][_0xc0de('0x8d')]=util['format'](_0xc0de('0x8e'),_0x4a6f36['user'][_0xc0de('0x41')]);_0x15cd26['message'][_0xc0de('0x8f')]=_0x12e03f['channel'];_0x15cd26[_0xc0de('0x30')][_0xc0de('0x90')]=_0xc0de('0x3b');respondWithRpcPromise(_0xc0de('0x91'),_0xc0de('0x91'),{'event':_0xc0de('0x97'),'message':_0x15cd26[_0xc0de('0x30')]},client9002);return _0x12e03f;}return null;})[_0xc0de('0x28')](respondWithResult(_0x20e908,null))[_0xc0de('0x32')](handleError(_0x20e908,null));};exports[_0xc0de('0x98')]=function(_0x5c698b,_0x4dc079){var _0x54c3ab=moment()['unix']()[_0xc0de('0x99')]();var _0x4d2fbb=path['join'](config['root'],_0xc0de('0x9a'),_0xc0de('0x9b'),_0xc0de('0x9c'));var _0x1ecbe0=path[_0xc0de('0x9d')](config[_0xc0de('0x76')],_0xc0de('0x9a'),'files',_0xc0de('0x75'));var _0x5dbc1a=util[_0xc0de('0x7e')](_0xc0de('0x9e'),_0x54c3ab);return db[_0xc0de('0x44')][_0xc0de('0x5e')]({'where':{'id':_0x5c698b[_0xc0de('0x5c')]['id']},'attributes':['id','body','from','to','cc',_0xc0de('0x9f'),'subject','createdAt'],'include':_0x5c698b['query']['attachments']?[{'model':db[_0xc0de('0xa0')],'as':'Attachments'}]:undefined})[_0xc0de('0x28')](handleEntityNotFound(_0x4dc079,null))[_0xc0de('0x28')](function(_0x2c4d84){if(_0x2c4d84){var _0x413ad0=_0x2c4d84;var _0x29219={'from':_0x413ad0[_0xc0de('0xa1')],'to':_0x413ad0['to'],'subject':_0x413ad0[_0xc0de('0xa2')],'html':_0x413ad0['body'],'headers':{'Date':moment(_0x413ad0['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x2c4d84['cc']){_0x29219[_0xc0de('0xa3')]['Cc']=_0x2c4d84['cc'];}if(_0x2c4d84['bcc']){_0x29219[_0xc0de('0xa3')][_0xc0de('0xa4')]=_0x2c4d84[_0xc0de('0x9f')];}return new BPromise(function(_0x4eced4,_0x43ea84){if(_0x2c4d84['Attachments']){for(var _0xd2947f=0x0;_0xd2947f<_0x2c4d84[_0xc0de('0xa5')][_0xc0de('0x5d')];_0xd2947f++){var _0x4702ec=_0x2c4d84[_0xc0de('0xa5')][_0xd2947f];var _0x72192b=path[_0xc0de('0x9d')](_0x1ecbe0,_0x4702ec['basename']);if(fs['existsSync'](_0x72192b)){_0x29219[_0xc0de('0x75')][_0xc0de('0xa6')]({'name':_0x4702ec[_0xc0de('0x41')],'contentType':_0x4702ec[_0xc0de('0xa7')],'data':fs[_0xc0de('0xa8')](_0x72192b)});}}}emlformat[_0xc0de('0xa9')](_0x29219,function(_0x19a6de,_0x770d82){if(_0x19a6de)return _0x43ea84(_0x19a6de);fs[_0xc0de('0xaa')](path['join'](_0x4d2fbb,_0x5dbc1a),_0x770d82);return _0x4eced4(_0x770d82);});});}})[_0xc0de('0x28')](function(_0x117f44){if(_0x117f44){return _0x4dc079[_0xc0de('0x98')](path[_0xc0de('0x9d')](_0x4d2fbb,_0x5dbc1a),_0x5dbc1a,function(_0x37f8d0){if(_0x37f8d0){console['log'](_0xc0de('0xab'),_0x37f8d0);}else{fs['unlinkSync'](path[_0xc0de('0x9d')](_0x4d2fbb,_0x5dbc1a));}});}})[_0xc0de('0x32')](handleError(_0x4dc079,null));}; \ No newline at end of file +var _0xb9da=['catch','sendStatus','status','end','json','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','offset','order','sort','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','params','rawAttributes','find','body','describe','create','direction','secret','MailAccount','findOne','MailAccountId','CmList','List','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','CmContact','List\x20not\x20found','SendMail','sendMail','format','stringify','mail-interactions','accept','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','MailInteractionId','read1stAt','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','acceptmessage','mail','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','download','unix','files','tmp','message-%s.eml','from','createdAt','Attachment','Attachments','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','build','writeFileSync','log','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','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','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result'];(function(_0x22b074,_0x1aba22){var _0x28e8cb=function(_0x44e560){while(--_0x44e560){_0x22b074['push'](_0x22b074['shift']());}};_0x28e8cb(++_0x1aba22);}(_0xb9da,0x1d6));var _0xab9d=function(_0x3dd991,_0x4bef12){_0x3dd991=_0x3dd991-0x0;var _0x251609=_0xb9da[_0x3dd991];return _0x251609;};'use strict';var pdf=require(_0xab9d('0x0'));var emlformat=require(_0xab9d('0x1'));var rimraf=require(_0xab9d('0x2'));var zipdir=require(_0xab9d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab9d('0x4'));var moment=require(_0xab9d('0x5'));var BPromise=require(_0xab9d('0x6'));var Mustache=require(_0xab9d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xab9d('0x8'));var csv=require(_0xab9d('0x9'));var ejs=require(_0xab9d('0xa'));var fs=require('fs');var _=require(_0xab9d('0xb'));var squel=require(_0xab9d('0xc'));var crypto=require(_0xab9d('0xd'));var jsforce=require(_0xab9d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xab9d('0x9'));var querystring=require('querystring');var Papa=require(_0xab9d('0xf'));var Redis=require(_0xab9d('0x10'));var authService=require(_0xab9d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xab9d('0x12'));var hardwareService=require(_0xab9d('0x13'));var logger=require(_0xab9d('0x14'))(_0xab9d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xab9d('0x16'))['db'];config[_0xab9d('0x17')]=_[_0xab9d('0x18')](config[_0xab9d('0x17')],{'host':_0xab9d('0x19'),'port':0x18eb});var socket=require(_0xab9d('0x1a'))(new Redis(config[_0xab9d('0x17')]));require(_0xab9d('0x1b'))['register'](socket);var jayson=require(_0xab9d('0x1c'));var client=jayson[_0xab9d('0x1d')]['http']({'port':0x232c});var client9003=jayson[_0xab9d('0x1d')]['http']({'port':0x232b});var client9002=jayson[_0xab9d('0x1d')][_0xab9d('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x54a6ba,_0x54668f,_0x251726){if(_0x251726){var _0x3616ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3616ad[_0xab9d('0x1f')](_0x54668f)){return _0x54a6ba;}else{throw new db[(_0xab9d('0x20'))][(_0xab9d('0x21'))](_0xab9d('0x22'));}}else{return _0x54a6ba;}}function respondWithRpcPromise(_0x59250a,_0x51a404,_0x57f0af,_0x19f38f){return new BPromise(function(_0x4c7a61,_0x107572){var _0x2bc72e=_0x19f38f||client;return _0x2bc72e[_0xab9d('0x23')](_0x59250a,_0x57f0af)[_0xab9d('0x24')](function(_0x48db08){logger['info'](_0xab9d('0x25'),_0x51a404,'request\x20sent');logger[_0xab9d('0x26')](_0xab9d('0x27'),_0x51a404,_0xab9d('0x28'),JSON['stringify'](_0x48db08));if(_0x48db08['error']){if(_0x48db08[_0xab9d('0x29')][_0xab9d('0x2a')]===0x1f4){logger[_0xab9d('0x29')](_0xab9d('0x25'),_0x51a404,_0x48db08[_0xab9d('0x29')][_0xab9d('0x2b')]);return _0x107572(_0x48db08[_0xab9d('0x29')][_0xab9d('0x2b')]);}logger['error'](_0xab9d('0x25'),_0x51a404,_0x48db08[_0xab9d('0x29')]['message']);return _0x4c7a61(_0x48db08[_0xab9d('0x29')][_0xab9d('0x2b')]);}else{logger[_0xab9d('0x2c')]('MailMessage,\x20%s,\x20%s',_0x51a404,_0xab9d('0x28'));_0x4c7a61(_0x48db08[_0xab9d('0x2d')]['message']);}})[_0xab9d('0x2e')](function(_0x3e5826){logger[_0xab9d('0x29')]('MailMessage,\x20%s,\x20%s',_0x51a404,_0x3e5826);_0x107572(_0x3e5826);});});}function respondWithStatusCode(_0x5d3ca5,_0x421903){_0x421903=_0x421903||0xcc;return function(_0x2fdc2f){if(_0x2fdc2f){return _0x5d3ca5[_0xab9d('0x2f')](_0x421903);}return _0x5d3ca5[_0xab9d('0x30')](_0x421903)[_0xab9d('0x31')]();};}function respondWithResult(_0x196915,_0x1d47ea){_0x1d47ea=_0x1d47ea||0xc8;return function(_0x250d4a){if(_0x250d4a){return _0x196915['status'](_0x1d47ea)[_0xab9d('0x32')](_0x250d4a);}};}function respondWithFilteredResult(_0x48d74f,_0x17c203){return function(_0x2815d0){if(_0x2815d0){var _0x38c0a3=_0x2815d0['count'],_0xa13704=_0x17c203['offset'],_0x4f3f80=_0x17c203['offset']+_0x17c203[_0xab9d('0x33')],_0x1828f5;if(_0x4f3f80>=_0x38c0a3){_0x4f3f80=_0x38c0a3;_0x1828f5=0xc8;}else{_0x1828f5=0xce;}_0x48d74f[_0xab9d('0x30')](_0x1828f5);return _0x48d74f[_0xab9d('0x34')](_0xab9d('0x35'),_0xa13704+'-'+_0x4f3f80+'/'+_0x38c0a3)[_0xab9d('0x32')](_0x2815d0);}return null;};}function patchUpdates(_0x1a133b){return function(_0x5eaa20){try{jsonpatch[_0xab9d('0x36')](_0x5eaa20,_0x1a133b,!![]);}catch(_0x13d300){return BPromise[_0xab9d('0x37')](_0x13d300);}return _0x5eaa20[_0xab9d('0x38')]();};}function saveUpdates(_0x1ee2f9,_0x21546e){return function(_0x437122){if(_0x437122){return _0x437122[_0xab9d('0x39')](_0x1ee2f9)['then'](function(_0x3a286d){return _0x3a286d;});}return null;};}function removeEntity(_0x21694f,_0x1ea49){return function(_0x247e7b){if(_0x247e7b){return _0x247e7b[_0xab9d('0x3a')]()[_0xab9d('0x24')](function(){_0x21694f[_0xab9d('0x30')](0xcc)[_0xab9d('0x31')]();});}};}function handleEntityNotFound(_0x25858f,_0x4868b2){return function(_0x4f9d3a){if(!_0x4f9d3a){_0x25858f[_0xab9d('0x2f')](0x194);}return _0x4f9d3a;};}function handleError(_0x5ee01a,_0xab5b68){_0xab5b68=_0xab5b68||0x1f4;return function(_0x38cd54){logger['error'](_0x38cd54[_0xab9d('0x3b')]);if(_0x38cd54[_0xab9d('0x3c')]){delete _0x38cd54[_0xab9d('0x3c')];}_0x5ee01a[_0xab9d('0x30')](_0xab5b68)[_0xab9d('0x3d')](_0x38cd54);};}exports[_0xab9d('0x3e')]=function(_0x331281,_0x378054){var _0xd001f3={},_0x5904e1={},_0x174d00={'count':0x0,'rows':[]};var _0xbe7092=_[_0xab9d('0x3f')](db[_0xab9d('0x40')]['rawAttributes'],function(_0x4fe280){return{'name':_0x4fe280[_0xab9d('0x41')],'type':_0x4fe280[_0xab9d('0x42')][_0xab9d('0x43')]};});_0x5904e1[_0xab9d('0x44')]=_[_0xab9d('0x3f')](_0xbe7092,'name');_0x5904e1[_0xab9d('0x45')]=_[_0xab9d('0x46')](_0x331281[_0xab9d('0x45')]);_0x5904e1[_0xab9d('0x47')]=_[_0xab9d('0x48')](_0x5904e1[_0xab9d('0x44')],_0x5904e1['query']);_0xd001f3['attributes']=_[_0xab9d('0x48')](_0x5904e1[_0xab9d('0x44')],qs[_0xab9d('0x49')](_0x331281[_0xab9d('0x45')][_0xab9d('0x49')]));_0xd001f3[_0xab9d('0x4a')]=_0xd001f3[_0xab9d('0x4a')][_0xab9d('0x4b')]?_0xd001f3[_0xab9d('0x4a')]:_0x5904e1[_0xab9d('0x44')];if(!_0x331281[_0xab9d('0x45')]['hasOwnProperty']('nolimit')){_0xd001f3[_0xab9d('0x33')]=qs[_0xab9d('0x33')](_0x331281[_0xab9d('0x45')]['limit']);_0xd001f3[_0xab9d('0x4c')]=qs[_0xab9d('0x4c')](_0x331281[_0xab9d('0x45')][_0xab9d('0x4c')]);}_0xd001f3[_0xab9d('0x4d')]=qs[_0xab9d('0x4e')](_0x331281[_0xab9d('0x45')][_0xab9d('0x4e')]);_0xd001f3['where']=qs[_0xab9d('0x47')](_['pick'](_0x331281[_0xab9d('0x45')],_0x5904e1[_0xab9d('0x47')]),_0xbe7092);if(_0x331281['query'][_0xab9d('0x4f')]){_0xd001f3[_0xab9d('0x50')]=_[_0xab9d('0x51')](_0xd001f3[_0xab9d('0x50')],{'$or':_[_0xab9d('0x3f')](_0xbe7092,function(_0x122fa8){if(_0x122fa8[_0xab9d('0x42')]!==_0xab9d('0x52')){var _0x279ebf={};_0x279ebf[_0x122fa8['name']]={'$like':'%'+_0x331281[_0xab9d('0x45')][_0xab9d('0x4f')]+'%'};return _0x279ebf;}})});}_0xd001f3=_[_0xab9d('0x51')]({},_0xd001f3,_0x331281[_0xab9d('0x53')]);var _0x279957={'where':_0xd001f3[_0xab9d('0x50')]};return db[_0xab9d('0x40')][_0xab9d('0x54')](_0x279957)[_0xab9d('0x24')](function(_0x348184){_0x174d00['count']=_0x348184;if(_0x331281[_0xab9d('0x45')][_0xab9d('0x55')]){_0xd001f3[_0xab9d('0x56')]=[{'all':!![]}];}return db[_0xab9d('0x40')][_0xab9d('0x57')](_0xd001f3);})['then'](function(_0x4e9809){_0x174d00['rows']=_0x4e9809;return _0x174d00;})[_0xab9d('0x24')](respondWithFilteredResult(_0x378054,_0xd001f3))['catch'](handleError(_0x378054,null));};exports['show']=function(_0x55eb40,_0x700acf){var _0x2a49ef={'raw':!![],'where':{'id':_0x55eb40[_0xab9d('0x58')]['id']}},_0xa728c1={};_0xa728c1[_0xab9d('0x44')]=_[_0xab9d('0x46')](db[_0xab9d('0x40')][_0xab9d('0x59')]);_0xa728c1[_0xab9d('0x45')]=_[_0xab9d('0x46')](_0x55eb40['query']);_0xa728c1[_0xab9d('0x47')]=_[_0xab9d('0x48')](_0xa728c1['model'],_0xa728c1[_0xab9d('0x45')]);_0x2a49ef[_0xab9d('0x4a')]=_[_0xab9d('0x48')](_0xa728c1[_0xab9d('0x44')],qs[_0xab9d('0x49')](_0x55eb40[_0xab9d('0x45')]['fields']));_0x2a49ef[_0xab9d('0x4a')]=_0x2a49ef['attributes'][_0xab9d('0x4b')]?_0x2a49ef['attributes']:_0xa728c1[_0xab9d('0x44')];if(_0x55eb40[_0xab9d('0x45')][_0xab9d('0x55')]){_0x2a49ef[_0xab9d('0x56')]=[{'all':!![]}];}_0x2a49ef=_['merge']({},_0x2a49ef,_0x55eb40[_0xab9d('0x53')]);return db[_0xab9d('0x40')][_0xab9d('0x5a')](_0x2a49ef)[_0xab9d('0x24')](handleEntityNotFound(_0x700acf,null))[_0xab9d('0x24')](respondWithResult(_0x700acf,null))[_0xab9d('0x2e')](handleError(_0x700acf,null));};exports['update']=function(_0x3bf0f8,_0x4b09b6){if(_0x3bf0f8[_0xab9d('0x5b')]['id']){delete _0x3bf0f8[_0xab9d('0x5b')]['id'];}return db[_0xab9d('0x40')]['find']({'where':{'id':_0x3bf0f8[_0xab9d('0x58')]['id']}})['then'](handleEntityNotFound(_0x4b09b6,null))[_0xab9d('0x24')](saveUpdates(_0x3bf0f8['body'],null))[_0xab9d('0x24')](respondWithResult(_0x4b09b6,null))[_0xab9d('0x2e')](handleError(_0x4b09b6,null));};exports['destroy']=function(_0x2c9445,_0x411c8d){return db[_0xab9d('0x40')]['find']({'where':{'id':_0x2c9445[_0xab9d('0x58')]['id']}})['then'](handleEntityNotFound(_0x411c8d,null))[_0xab9d('0x24')](removeEntity(_0x411c8d,null))[_0xab9d('0x2e')](handleError(_0x411c8d,null));};exports[_0xab9d('0x5c')]=function(_0x261683,_0x52c7f0){return db[_0xab9d('0x40')][_0xab9d('0x5c')]()['then'](respondWithResult(_0x52c7f0,null))[_0xab9d('0x2e')](handleError(_0x52c7f0,null));};exports[_0xab9d('0x5d')]=function(_0x819d96,_0x44a311){return db['MailMessage'][_0xab9d('0x5d')](_0x819d96[_0xab9d('0x5b')])[_0xab9d('0x24')](function(_0x585ecc){if(_0x585ecc){if(_0x585ecc[_0xab9d('0x5e')]==='out'&&!_0x585ecc[_0xab9d('0x5f')]){var _0x255a4e,_0x504fa3,_0x6b6f78;if(_0x819d96[_0xab9d('0x5b')]['to']){_0x504fa3=_0x819d96[_0xab9d('0x5b')]['to']['split'](',')[0x0];}return db[_0xab9d('0x60')][_0xab9d('0x61')]({'where':{'id':_0x585ecc[_0xab9d('0x62')]},'include':[{'model':db[_0xab9d('0x63')],'as':_0xab9d('0x64'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x504fa3},'limit':0x1,'order':[[_0xab9d('0x65'),_0xab9d('0x66')]]}]},{'model':db[_0xab9d('0x67')],'as':_0xab9d('0x68'),'raw':!![]}]})[_0xab9d('0x24')](function(_0x1d09a4){_0x255a4e=_0x1d09a4;if(_0x255a4e&&_0x255a4e[_0xab9d('0x68')]){var _0x2b4ba5={'tls':{'rejectUnauthorized':![]}};if(_[_0xab9d('0x69')](_0x255a4e['Smtp'][_0xab9d('0x6a')])){_0x2b4ba5[_0xab9d('0x6b')]=_0x255a4e[_0xab9d('0x68')][_0xab9d('0x6b')];_0x2b4ba5['port']=_0x255a4e[_0xab9d('0x68')][_0xab9d('0x6c')];_0x2b4ba5[_0xab9d('0x6d')]=_0x255a4e[_0xab9d('0x68')][_0xab9d('0x6d')];if(_0x255a4e[_0xab9d('0x68')][_0xab9d('0x6e')]){_0x2b4ba5[_0xab9d('0x6f')]={'user':_0x255a4e[_0xab9d('0x68')][_0xab9d('0x70')],'pass':_0x255a4e[_0xab9d('0x68')][_0xab9d('0x71')]};}}else{_0x2b4ba5['service']=_0x255a4e[_0xab9d('0x68')][_0xab9d('0x6a')];_0x2b4ba5[_0xab9d('0x6f')]={'user':_0x255a4e[_0xab9d('0x68')][_0xab9d('0x70')],'pass':_0x255a4e['Smtp']['pass']};_0x2b4ba5[_0xab9d('0x6d')]=_0x255a4e[_0xab9d('0x68')][_0xab9d('0x6d')];}if(_0x819d96[_0xab9d('0x5b')][_0xab9d('0x72')]&&_0x819d96[_0xab9d('0x5b')][_0xab9d('0x72')]['length']){for(var _0x2a6ad4=0x0;_0x2a6ad4<_0x819d96[_0xab9d('0x5b')][_0xab9d('0x72')][_0xab9d('0x4b')];_0x2a6ad4+=0x1){_0x819d96[_0xab9d('0x5b')][_0xab9d('0x72')][_0x2a6ad4]={'filename':_0x819d96['body']['attachments'][_0x2a6ad4][_0xab9d('0x3c')],'path':path[_0xab9d('0x73')](config[_0xab9d('0x74')],_0xab9d('0x75'),_0x819d96[_0xab9d('0x5b')][_0xab9d('0x72')][_0x2a6ad4][_0xab9d('0x76')])};}}_0x6b6f78={'account':_0x2b4ba5,'message':_0x819d96[_0xab9d('0x5b')]};return;}})[_0xab9d('0x24')](function(){if(_0x255a4e[_0xab9d('0x64')]){if(_0x255a4e[_0xab9d('0x64')][_0xab9d('0x77')][_0xab9d('0x4b')]){return _0x255a4e[_0xab9d('0x64')]['Contacts'][0x0];}else{return db[_0xab9d('0x78')][_0xab9d('0x5d')](_[_0xab9d('0x18')](_0x819d96['body'],{'firstName':_0x819d96[_0xab9d('0x5b')]['to'],'email':_0x819d96[_0xab9d('0x5b')]['to'],'phone':_0x819d96['body']['to'],'ListId':_0x255a4e['ListId']}));}}else{throw new Error(_0xab9d('0x79'));}})['then'](function(){if(_0x6b6f78){return respondWithRpcPromise(_0xab9d('0x7a'),_0xab9d('0x7b'),_0x6b6f78,client9003)[_0xab9d('0x24')](function(_0x22399b){return _0x585ecc[_0xab9d('0x39')]({'read':!![],'messageId':_0x22399b['messageId'],'sentAt':moment()[_0xab9d('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xab9d('0x2e')](function(_0x3c92de){logger[_0xab9d('0x29')]('%s',JSON[_0xab9d('0x7d')](_0x3c92de));return _0x585ecc;});}return _0x585ecc;});}return _0x585ecc;}})['then'](respondWithResult(_0x44a311,0xc9))[_0xab9d('0x2e')](handleError(_0x44a311,null));};var interaction_log=require(_0xab9d('0x14'))(_0xab9d('0x7e'));exports[_0xab9d('0x7f')]=function(_0x29dfe1,_0x163d50,_0x552013){var _0x543822={'channel':'mail'};if(_0x29dfe1['body']['id']){delete _0x29dfe1[_0xab9d('0x5b')]['id'];}_0x29dfe1[_0xab9d('0x5b')]['read']=!![];_0x29dfe1[_0xab9d('0x5b')]['readAt']=moment()[_0xab9d('0x7c')](_0xab9d('0x80'));_0x29dfe1['body'][_0xab9d('0x81')]=_0x29dfe1[_0xab9d('0x5b')][_0xab9d('0x81')]||_0x29dfe1['user']['id'];return db[_0xab9d('0x40')][_0xab9d('0x5a')]({'where':{'id':_0x29dfe1['params']['id'],'UserId':null},'include':[{'model':db[_0xab9d('0x78')],'as':_0xab9d('0x82')}]})[_0xab9d('0x24')](handleEntityNotFound(_0x163d50,null))[_0xab9d('0x24')](saveUpdates(_0x29dfe1[_0xab9d('0x5b')],null))[_0xab9d('0x24')](function(_0x1ea06a){if(_0x1ea06a){_0x543822['message']=_0x1ea06a['get']({'plain':!![]});return db['MailInteraction'][_0xab9d('0x5a')]({'where':{'id':_0x1ea06a[_0xab9d('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x163d50,null))[_0xab9d('0x24')](function(_0x23411c){if(_0x23411c){return _0x23411c['update']({'UserId':_0x29dfe1[_0xab9d('0x5b')][_0xab9d('0x81')],'read1stAt':_[_0xab9d('0x69')](_0x23411c[_0xab9d('0x84')])?moment()[_0xab9d('0x7c')](_0xab9d('0x80')):undefined});}return null;})[_0xab9d('0x24')](function(_0x3c7e2e){if(_0x3c7e2e){_0x543822['interaction']=_0x3c7e2e[_0xab9d('0x85')]({'plain':!![]});interaction_log[_0xab9d('0x2c')](_0xab9d('0x86'),_0x29dfe1[_0xab9d('0x70')]['id'],_0x29dfe1[_0xab9d('0x70')][_0xab9d('0x3c')],_0x29dfe1[_0xab9d('0x70')][_0xab9d('0x87')],_0x543822[_0xab9d('0x88')]['id'],_0x29dfe1[_0xab9d('0x5b')]?JSON['stringify'](_0x29dfe1[_0xab9d('0x5b')]):_0xab9d('0x89'));return respondWithRpcPromise(_0xab9d('0x8a'),_0xab9d('0x8b'),_0x543822);}return null;})[_0xab9d('0x24')](function(_0x314d45){if(_0x314d45){if(_0x29dfe1[_0xab9d('0x5b')][_0xab9d('0x8c')]){_0x543822[_0xab9d('0x2b')][_0xab9d('0x8d')]=util[_0xab9d('0x7c')]('SIP/%s',_0x29dfe1['user'][_0xab9d('0x3c')]);_0x543822[_0xab9d('0x2b')][_0xab9d('0x8e')]=_0x543822[_0xab9d('0x8e')];_0x543822[_0xab9d('0x2b')][_0xab9d('0x8f')]=_0xab9d('0x7f');return respondWithRpcPromise(_0xab9d('0x90'),_0xab9d('0x90'),{'event':_0xab9d('0x91'),'message':_0x543822[_0xab9d('0x2b')]},client9002)[_0xab9d('0x24')](function(){return _0x543822;});}return _0x543822;}return null;})[_0xab9d('0x24')](respondWithResult(_0x163d50,null))['catch'](handleError(_0x163d50,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports['reject']=function(_0x3a319b,_0x1c1253,_0x257c8d){var _0x5ad957={'agent':{},'channel':_0xab9d('0x92')};if(_0x3a319b[_0xab9d('0x5b')]['id']){delete _0x3a319b[_0xab9d('0x5b')]['id'];}_0x3a319b[_0xab9d('0x5b')]['UserId']=_0x3a319b[_0xab9d('0x5b')][_0xab9d('0x81')]||_0x3a319b['user']['id'];_0x5ad957[_0xab9d('0x93')]['id']=_0x3a319b[_0xab9d('0x5b')][_0xab9d('0x81')];return db['MailMessage'][_0xab9d('0x5a')]({'where':{'id':_0x3a319b[_0xab9d('0x58')]['id'],'UserId':null}})[_0xab9d('0x24')](handleEntityNotFound(_0x1c1253,null))[_0xab9d('0x24')](function(_0x4a9e47){if(_0x4a9e47){_0x5ad957[_0xab9d('0x2b')]=_0x4a9e47[_0xab9d('0x85')]({'plain':!![]});return db[_0xab9d('0x94')][_0xab9d('0x5a')]({'where':{'id':_0x4a9e47[_0xab9d('0x83')]}});}return null;})[_0xab9d('0x24')](handleEntityNotFound(_0x1c1253,null))['then'](function(_0x5980d7){if(_0x5980d7){_0x5ad957[_0xab9d('0x88')]=_0x5980d7['get']({'plain':!![]});interaction_log[_0xab9d('0x2c')](_0xab9d('0x95'),_0x3a319b['user']['id'],_0x3a319b['user'][_0xab9d('0x3c')],_0x3a319b[_0xab9d('0x70')][_0xab9d('0x87')],_0x5ad957[_0xab9d('0x88')]['id'],_0x3a319b[_0xab9d('0x5b')]?JSON[_0xab9d('0x7d')](_0x3a319b[_0xab9d('0x5b')]):_0xab9d('0x89'));return respondWithRpcPromise(_0xab9d('0x96'),_0xab9d('0x97'),_0x5ad957);}return null;})[_0xab9d('0x24')](function(_0xf3e0af){if(_0xf3e0af){_0xf3e0af['message']['interface']=util['format']('SIP/%s',_0x3a319b[_0xab9d('0x70')]['name']);_0xf3e0af['message'][_0xab9d('0x8e')]=_0x5ad957['channel'];_0xf3e0af[_0xab9d('0x2b')]['event']=_0xab9d('0x37');respondWithRpcPromise('EventManager',_0xab9d('0x90'),{'event':_0xab9d('0x98'),'message':_0xf3e0af[_0xab9d('0x2b')]},client9002);return _0x5ad957;}return null;})[_0xab9d('0x24')](respondWithResult(_0x1c1253,null))[_0xab9d('0x2e')](handleError(_0x1c1253,null));};exports[_0xab9d('0x99')]=function(_0x4c96b5,_0x775cef){var _0x715bfe=moment()[_0xab9d('0x9a')]()['toString']();var _0x29edd6=path[_0xab9d('0x73')](config[_0xab9d('0x74')],'server',_0xab9d('0x9b'),_0xab9d('0x9c'));var _0x190418=path[_0xab9d('0x73')](config['root'],'server',_0xab9d('0x9b'),_0xab9d('0x72'));var _0x44497b=util[_0xab9d('0x7c')](_0xab9d('0x9d'),_0x715bfe);return db[_0xab9d('0x40')]['find']({'where':{'id':_0x4c96b5[_0xab9d('0x58')]['id']},'attributes':['id',_0xab9d('0x5b'),_0xab9d('0x9e'),'to','cc','bcc','subject',_0xab9d('0x9f')],'include':_0x4c96b5['query'][_0xab9d('0x72')]?[{'model':db[_0xab9d('0xa0')],'as':_0xab9d('0xa1')}]:undefined})['then'](handleEntityNotFound(_0x775cef,null))[_0xab9d('0x24')](function(_0x2cdc2a){if(_0x2cdc2a){var _0x2f0aba=_0x2cdc2a;var _0x10ca54={'from':_0x2f0aba[_0xab9d('0x9e')],'to':_0x2f0aba['to'],'subject':_0x2f0aba[_0xab9d('0xa2')],'html':_0x2f0aba['body'],'headers':{'Date':moment(_0x2f0aba[_0xab9d('0x9f')])[_0xab9d('0x7c')](_0xab9d('0xa3'))},'attachments':[]};if(_0x2cdc2a['cc']){_0x10ca54[_0xab9d('0xa4')]['Cc']=_0x2cdc2a['cc'];}if(_0x2cdc2a[_0xab9d('0xa5')]){_0x10ca54[_0xab9d('0xa4')][_0xab9d('0xa6')]=_0x2cdc2a[_0xab9d('0xa5')];}return new BPromise(function(_0x103c53,_0x9fba10){if(_0x2cdc2a[_0xab9d('0xa1')]){for(var _0x5d06c7=0x0;_0x5d06c7<_0x2cdc2a[_0xab9d('0xa1')][_0xab9d('0x4b')];_0x5d06c7++){var _0x196f0f=_0x2cdc2a[_0xab9d('0xa1')][_0x5d06c7];var _0x5896ac=path[_0xab9d('0x73')](_0x190418,_0x196f0f[_0xab9d('0x76')]);if(fs[_0xab9d('0xa7')](_0x5896ac)){_0x10ca54[_0xab9d('0x72')][_0xab9d('0xa8')]({'name':_0x196f0f[_0xab9d('0x3c')],'contentType':_0x196f0f['type'],'data':fs['readFileSync'](_0x5896ac)});}}}emlformat[_0xab9d('0xa9')](_0x10ca54,function(_0x709783,_0x3bc985){if(_0x709783)return _0x9fba10(_0x709783);fs[_0xab9d('0xaa')](path[_0xab9d('0x73')](_0x29edd6,_0x44497b),_0x3bc985);return _0x103c53(_0x3bc985);});});}})['then'](function(_0x468f2c){if(_0x468f2c){return _0x775cef[_0xab9d('0x99')](path[_0xab9d('0x73')](_0x29edd6,_0x44497b),_0x44497b,function(_0x185da0){if(_0x185da0){console[_0xab9d('0xab')]('err',_0x185da0);}else{fs['unlinkSync'](path['join'](_0x29edd6,_0x44497b));}});}})[_0xab9d('0x2e')](handleError(_0x775cef,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index b2c148b..48ff90d 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 _0x8e13=['update','remove','emit','hook','exports','MailMessage','setMaxListeners'];(function(_0x5085ee,_0x530877){var _0x539e60=function(_0x240320){while(--_0x240320){_0x5085ee['push'](_0x5085ee['shift']());}};_0x539e60(++_0x530877);}(_0x8e13,0x124));var _0x38e1=function(_0xc1b1c1,_0x284e93){_0xc1b1c1=_0xc1b1c1-0x0;var _0x8d262d=_0x8e13[_0xc1b1c1];return _0x8d262d;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x38e1('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x38e1('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x38e1('0x2'),'afterDestroy':_0x38e1('0x3')};function emitEvent(_0x53d323){return function(_0x320943,_0x40485b,_0x3152e3){MailMessageEvents['emit'](_0x53d323+':'+_0x320943['id'],_0x320943);MailMessageEvents[_0x38e1('0x4')](_0x53d323,_0x320943);_0x3152e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x38e1('0x5')](e,emitEvent(event));}}module[_0x38e1('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x1cf5=['save','update','remove','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x3ab7f8,_0x2720c0){var _0x59552e=function(_0x16cde7){while(--_0x16cde7){_0x3ab7f8['push'](_0x3ab7f8['shift']());}};_0x59552e(++_0x2720c0);}(_0x1cf5,0x11d));var _0x51cf=function(_0x59400c,_0x364897){_0x59400c=_0x59400c-0x0;var _0x51508d=_0x1cf5[_0x59400c];return _0x51508d;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x51cf('0x0'))['db'][_0x51cf('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x51cf('0x2')](0x0);var events={'afterCreate':_0x51cf('0x3'),'afterUpdate':_0x51cf('0x4'),'afterDestroy':_0x51cf('0x5')};function emitEvent(_0x462cfc){return function(_0x42ee29,_0x171b5e,_0x282600){MailMessageEvents['emit'](_0x462cfc+':'+_0x42ee29['id'],_0x42ee29);MailMessageEvents['emit'](_0x462cfc,_0x42ee29);_0x282600(null);};}for(var e in events){if(events[_0x51cf('0x6')](e)){var event=events[e];MailMessage[_0x51cf('0x7')](e,emitEvent(event));}}module[_0x51cf('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 2dd199c..f9c3d1a 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 _0x9608=['../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','update','createdAt','catch','error','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0x9608,0x159));var _0x8960=function(_0x249b51,_0x460803){_0x249b51=_0x249b51-0x0;var _0x1ed743=_0x9608[_0x249b51];return _0x1ed743;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8960('0x0'))(_0x8960('0x1'));var moment=require(_0x8960('0x2'));var BPromise=require(_0x8960('0x3'));var rp=require(_0x8960('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x8960('0x5'));var rimraf=require(_0x8960('0x6'));var config=require(_0x8960('0x7'));var attributes=require(_0x8960('0x8'));module['exports']=function(_0x12ded2,_0x18e700){return _0x12ded2[_0x8960('0x9')]('MailMessage',attributes,{'tableName':_0x8960('0xa'),'paranoid':![],'indexes':[{'name':_0x8960('0xb'),'fields':[_0x8960('0xb')]},{'name':_0x8960('0xc'),'fields':[_0x8960('0xd'),_0x8960('0xe')],'type':_0x8960('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8b59a2,_0xbb4ca3,_0xa9cc57){if(_0x8b59a2['body']){_0x8b59a2[_0x8960('0xd')]=htmlToText[_0x8960('0x10')](_0x8b59a2[_0x8960('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xa9cc57(null,_0xbb4ca3);},'afterCreate':function(_0x3676a4,_0xeef3f,_0x353f5c){var _0x1ba394=_0x12ded2[_0x8960('0x12')];var _0xdb5408=_0x3676a4[_0x8960('0x13')]({'plain':!![]});if(_0xdb5408['direction']['toLowerCase']()==='in'||_0xdb5408[_0x8960('0x14')][_0x8960('0x15')]()===_0x8960('0x16')&&!_0xdb5408[_0x8960('0x17')]&&!_[_0x8960('0x18')](_0xdb5408[_0x8960('0x19')])){_0x1ba394[_0x8960('0x1a')][_0x8960('0x1b')]({'where':{'id':_0xdb5408['MailInteractionId']}})['then'](function(_0xbeca8d){if(_0xbeca8d){_0xbeca8d[_0x8960('0x1c')]({'lastMsgAt':_0xdb5408[_0x8960('0x1d')],'lastMsgDirection':_0xdb5408['direction'][_0x8960('0x15')](),'lastMsgBody':_0xdb5408[_0x8960('0x11')]});}})[_0x8960('0x1e')](function(_0x322f98){console[_0x8960('0x1f')](_0x322f98);});}_0x353f5c();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4cc8=['MailInteraction','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','html-to-text','path','rimraf','exports','define','MailMessage','messageId','fti_mail_messages','body','plainBody','models','get','direction','toLowerCase','out','secret','isNil'];(function(_0x1d36a7,_0x8e6fcf){var _0x17e8f7=function(_0x5e16c9){while(--_0x5e16c9){_0x1d36a7['push'](_0x1d36a7['shift']());}};_0x17e8f7(++_0x8e6fcf);}(_0x4cc8,0x171));var _0x84cc=function(_0x43d3ff,_0x4f9e70){_0x43d3ff=_0x43d3ff-0x0;var _0x37bd3c=_0x4cc8[_0x43d3ff];return _0x37bd3c;};'use strict';var _=require(_0x84cc('0x0'));var util=require('util');var logger=require(_0x84cc('0x1'))(_0x84cc('0x2'));var moment=require('moment');var BPromise=require(_0x84cc('0x3'));var rp=require('request-promise');var htmlToText=require(_0x84cc('0x4'));var fs=require('fs');var path=require(_0x84cc('0x5'));var rimraf=require(_0x84cc('0x6'));var config=require('../../config/environment');var attributes=require('./mailMessage.attributes');module[_0x84cc('0x7')]=function(_0x4f12aa,_0x21de03){return _0x4f12aa[_0x84cc('0x8')](_0x84cc('0x9'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x84cc('0xa'),'fields':[_0x84cc('0xa')]},{'name':_0x84cc('0xb'),'fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1d5b4a,_0x5d53a8,_0x2ab3a3){if(_0x1d5b4a[_0x84cc('0xc')]){_0x1d5b4a[_0x84cc('0xd')]=htmlToText['fromString'](_0x1d5b4a['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2ab3a3(null,_0x5d53a8);},'afterCreate':function(_0x5eefc0,_0x24f5ad,_0x2ab5e5){var _0x269bf0=_0x4f12aa[_0x84cc('0xe')];var _0x5c22ff=_0x5eefc0[_0x84cc('0xf')]({'plain':!![]});if(_0x5c22ff[_0x84cc('0x10')][_0x84cc('0x11')]()==='in'||_0x5c22ff['direction'][_0x84cc('0x11')]()===_0x84cc('0x12')&&!_0x5c22ff[_0x84cc('0x13')]&&!_[_0x84cc('0x14')](_0x5c22ff['UserId'])){_0x269bf0[_0x84cc('0x15')][_0x84cc('0x16')]({'where':{'id':_0x5c22ff[_0x84cc('0x17')]}})[_0x84cc('0x18')](function(_0x40053a){if(_0x40053a){_0x40053a['update']({'lastMsgAt':_0x5c22ff[_0x84cc('0x19')],'lastMsgDirection':_0x5c22ff[_0x84cc('0x10')]['toLowerCase'](),'lastMsgBody':_0x5c22ff[_0x84cc('0xc')]});}})[_0x84cc('0x1a')](function(_0x34023b){console[_0x84cc('0x1b')](_0x34023b);});}_0x2ab5e5();}},'charset':_0x84cc('0x1c'),'collate':_0x84cc('0x1d')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bed90dc..40caead 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 _0x4af9=['http','redis','defaults','localhost','socket.io-emitter','request','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','MailMessage,\x20%s,\x20%s','result','catch','MailMessage','create','options','raw','CreateMailMessage','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x254bac,_0x76f51b){var _0xeb2b94=function(_0x3d98b0){while(--_0x3d98b0){_0x254bac['push'](_0x254bac['shift']());}};_0xeb2b94(++_0x76f51b);}(_0x4af9,0x12c));var _0x94af=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4af9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x94af('0x0'));var util=require(_0x94af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x94af('0x2'));var fs=require('fs');var Redis=require(_0x94af('0x3'));var db=require(_0x94af('0x4'))['db'];var utils=require(_0x94af('0x5'));var logger=require(_0x94af('0x6'))(_0x94af('0x7'));var config=require(_0x94af('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x94af('0x9')][_0x94af('0xa')]({'port':0x232a});config[_0x94af('0xb')]=_[_0x94af('0xc')](config['redis'],{'host':_0x94af('0xd'),'port':0x18eb});var socket=require(_0x94af('0xe'))(new Redis(config[_0x94af('0xb')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0xb778b2,_0xa3e353,_0x13cb35){return new BPromise(function(_0x3bfc17,_0x68ff71){return client[_0x94af('0xf')](_0xb778b2,_0x13cb35)['then'](function(_0x43b1da){logger[_0x94af('0x10')]('MailMessage,\x20%s,\x20%s',_0xa3e353,_0x94af('0x11'));logger[_0x94af('0x12')](_0x94af('0x13'),_0xa3e353,_0x94af('0x11'),JSON[_0x94af('0x14')](_0x43b1da));if(_0x43b1da['error']){if(_0x43b1da[_0x94af('0x15')]['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xa3e353,_0x43b1da[_0x94af('0x15')][_0x94af('0x16')]);return _0x68ff71(_0x43b1da[_0x94af('0x15')][_0x94af('0x16')]);}logger['error'](_0x94af('0x17'),_0xa3e353,_0x43b1da[_0x94af('0x15')]['message']);return _0x3bfc17(_0x43b1da[_0x94af('0x15')][_0x94af('0x16')]);}else{logger[_0x94af('0x10')](_0x94af('0x17'),_0xa3e353,_0x94af('0x11'));_0x3bfc17(_0x43b1da[_0x94af('0x18')][_0x94af('0x16')]);}})[_0x94af('0x19')](function(_0x38a2a9){logger[_0x94af('0x15')]('MailMessage,\x20%s,\x20%s',_0xa3e353,_0x38a2a9);_0x68ff71(_0x38a2a9);});});}exports['CreateMailMessage']=function(_0x4349db){var _0x186355=this;return new Promise(function(_0xee81a,_0x17bfcc){return db[_0x94af('0x1a')][_0x94af('0x1b')](_0x4349db['body'],{'raw':_0x4349db[_0x94af('0x1c')]?_0x4349db['options'][_0x94af('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xa0cf1a){logger[_0x94af('0x10')](_0x94af('0x1e'),_0x4349db);logger['debug'](_0x94af('0x1e'),_0x4349db,JSON[_0x94af('0x14')](_0xa0cf1a));_0xee81a(_0xa0cf1a);})[_0x94af('0x19')](function(_0x270f9a){logger['error'](_0x94af('0x1e'),_0x270f9a[_0x94af('0x16')],_0x4349db);_0x17bfcc(_0x186355[_0x94af('0x15')](0x1f4,_0x270f9a[_0x94af('0x16')]));});});}; \ No newline at end of file +var _0xa93e=['info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailMessage','body','raw','debug','CreateMailMessage','stringify','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then'];(function(_0x1f9493,_0x2aebd4){var _0x1d41b6=function(_0x59c800){while(--_0x59c800){_0x1f9493['push'](_0x1f9493['shift']());}};_0x1d41b6(++_0x2aebd4);}(_0xa93e,0x1df));var _0xea93=function(_0x1a9d83,_0x561856){_0x1a9d83=_0x1a9d83-0x0;var _0x5ac5ec=_0xa93e[_0x1a9d83];return _0x5ac5ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea93('0x0'));var BPromise=require(_0xea93('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea93('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xea93('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xea93('0x4'));var jayson=require(_0xea93('0x5'));var client=jayson[_0xea93('0x6')][_0xea93('0x7')]({'port':0x232a});config[_0xea93('0x8')]=_[_0xea93('0x9')](config['redis'],{'host':_0xea93('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0xea93('0xb')](socket);function respondWithRpcPromise(_0x43c7e2,_0x598546,_0x1229f9){return new BPromise(function(_0x2306b6,_0x50c822){return client[_0xea93('0xc')](_0x43c7e2,_0x1229f9)[_0xea93('0xd')](function(_0xa45e13){logger[_0xea93('0xe')](_0xea93('0xf'),_0x598546,_0xea93('0x10'));logger['debug'](_0xea93('0x11'),_0x598546,'request\x20sent',JSON['stringify'](_0xa45e13));if(_0xa45e13[_0xea93('0x12')]){if(_0xa45e13[_0xea93('0x12')][_0xea93('0x13')]===0x1f4){logger[_0xea93('0x12')](_0xea93('0xf'),_0x598546,_0xa45e13[_0xea93('0x12')]['message']);return _0x50c822(_0xa45e13[_0xea93('0x12')]['message']);}logger[_0xea93('0x12')](_0xea93('0xf'),_0x598546,_0xa45e13[_0xea93('0x12')][_0xea93('0x14')]);return _0x2306b6(_0xa45e13[_0xea93('0x12')][_0xea93('0x14')]);}else{logger[_0xea93('0xe')](_0xea93('0xf'),_0x598546,_0xea93('0x10'));_0x2306b6(_0xa45e13[_0xea93('0x15')][_0xea93('0x14')]);}})[_0xea93('0x16')](function(_0xc05867){logger['error'](_0xea93('0xf'),_0x598546,_0xc05867);_0x50c822(_0xc05867);});});}exports['CreateMailMessage']=function(_0x2a78d6){var _0x388d0f=this;return new Promise(function(_0x41193e,_0xea0f1b){return db[_0xea93('0x17')]['create'](_0x2a78d6[_0xea93('0x18')],{'raw':_0x2a78d6['options']?_0x2a78d6['options'][_0xea93('0x19')]===undefined?!![]:![]:!![]})[_0xea93('0xd')](function(_0x622e1b){logger[_0xea93('0xe')]('CreateMailMessage',_0x2a78d6);logger[_0xea93('0x1a')](_0xea93('0x1b'),_0x2a78d6,JSON[_0xea93('0x1c')](_0x622e1b));_0x41193e(_0x622e1b);})[_0xea93('0x16')](function(_0x3d3a6e){logger[_0xea93('0x12')](_0xea93('0x1b'),_0x3d3a6e['message'],_0x2a78d6);_0xea0f1b(_0x388d0f[_0xea93('0x12')](0x1f4,_0x3d3a6e['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 1c2a60b..a2c5426 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 _0xfb05=['mailMessage:','remove','update','register','length'];(function(_0x293b9d,_0x5c7dbf){var _0x12b891=function(_0x3c8987){while(--_0x3c8987){_0x293b9d['push'](_0x293b9d['shift']());}};_0x12b891(++_0x5c7dbf);}(_0xfb05,0x1b4));var _0x5fb0=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfb05[_0x12fc8d];return _0x3f9d04;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x5fb0('0x0'),_0x5fb0('0x1')];function createListener(_0x11b769,_0x3a21fc){return function(_0x234f72){_0x3a21fc['emit'](_0x11b769,_0x234f72);};}function removeListener(_0x486924,_0x3629e5){return function(){MailMessageEvents['removeListener'](_0x486924,_0x3629e5);};}exports[_0x5fb0('0x2')]=function(_0xda0469){for(var _0x2d8c25=0x0,_0x157aec=events[_0x5fb0('0x3')];_0x2d8c25<_0x157aec;_0x2d8c25++){var _0x5cad6c=events[_0x2d8c25];var _0x542463=createListener(_0x5fb0('0x4')+_0x5cad6c,_0xda0469);MailMessageEvents['on'](_0x5cad6c,_0x542463);}}; \ No newline at end of file +var _0x7e81=['update','emit','register','length','mailMessage:','./mailMessage.events','save','remove'];(function(_0x51c277,_0x45ca43){var _0x1f0cdd=function(_0xc48d7f){while(--_0xc48d7f){_0x51c277['push'](_0x51c277['shift']());}};_0x1f0cdd(++_0x45ca43);}(_0x7e81,0xc5));var _0x17e8=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x7e81[_0x6c993a];return _0x27f547;};'use strict';var MailMessageEvents=require(_0x17e8('0x0'));var events=[_0x17e8('0x1'),_0x17e8('0x2'),_0x17e8('0x3')];function createListener(_0x5272db,_0x789de0){return function(_0x150fc3){_0x789de0[_0x17e8('0x4')](_0x5272db,_0x150fc3);};}function removeListener(_0x766c9e,_0x364a73){return function(){MailMessageEvents['removeListener'](_0x766c9e,_0x364a73);};}exports[_0x17e8('0x5')]=function(_0x2b4f2f){for(var _0x382bb2=0x0,_0x176238=events[_0x17e8('0x6')];_0x382bb2<_0x176238;_0x382bb2++){var _0x574402=events[_0x382bb2];var _0x54ee7e=createListener(_0x17e8('0x7')+_0x574402,_0x2b4f2f);MailMessageEvents['on'](_0x574402,_0x54ee7e);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 484c888..c64401e 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 _0x5676=['destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','Router','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','addTeams','/:id/users','put'];(function(_0x26a515,_0x286339){var _0x314682=function(_0x501b51){while(--_0x501b51){_0x26a515['push'](_0x26a515['shift']());}};_0x314682(++_0x286339);}(_0x5676,0x1e0));var _0x6567=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5676[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x6567('0x0'));var util=require('util');var path=require(_0x6567('0x1'));var timeout=require(_0x6567('0x2'));var express=require('express');var router=express[_0x6567('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6567('0x4'));var controller=require(_0x6567('0x5'));router[_0x6567('0x6')]('/',auth[_0x6567('0x7')](),controller['index']);router['get'](_0x6567('0x8'),auth[_0x6567('0x7')](),controller[_0x6567('0x9')]);router[_0x6567('0x6')](_0x6567('0xa'),auth[_0x6567('0x7')](),controller[_0x6567('0xb')]);router[_0x6567('0x6')](_0x6567('0xc'),auth[_0x6567('0x7')](),controller[_0x6567('0xd')]);router[_0x6567('0x6')](_0x6567('0xe'),auth[_0x6567('0x7')](),controller[_0x6567('0xf')]);router['get']('/:id/users',auth[_0x6567('0x7')](),controller['getAgents']);router['post']('/',auth[_0x6567('0x7')](),controller['create']);router[_0x6567('0x10')](_0x6567('0xe'),auth[_0x6567('0x7')](),controller[_0x6567('0x11')]);router[_0x6567('0x10')](_0x6567('0x12'),auth[_0x6567('0x7')](),controller['addAgents']);router[_0x6567('0x13')](_0x6567('0xa'),auth[_0x6567('0x7')](),controller['update']);router['delete'](_0x6567('0xa'),auth['isAuthenticated'](),controller[_0x6567('0x14')]);router[_0x6567('0x15')](_0x6567('0xe'),auth[_0x6567('0x7')](),controller[_0x6567('0x16')]);router[_0x6567('0x15')]('/:id/users',auth[_0x6567('0x7')](),controller[_0x6567('0x17')]);module[_0x6567('0x18')]=router; \ No newline at end of file +var _0x04d6=['../../config/environment','./mailQueue.controller','isAuthenticated','get','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','put','delete','removeTeams','exports','util','connect-timeout','express','Router'];(function(_0x34c88d,_0x24d403){var _0x4f29a2=function(_0x13a7d8){while(--_0x13a7d8){_0x34c88d['push'](_0x34c88d['shift']());}};_0x4f29a2(++_0x24d403);}(_0x04d6,0x104));var _0x604d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x04d6[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x604d('0x0'));var path=require('path');var timeout=require(_0x604d('0x1'));var express=require(_0x604d('0x2'));var router=express[_0x604d('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x604d('0x4'));var controller=require(_0x604d('0x5'));router['get']('/',auth[_0x604d('0x6')](),controller['index']);router[_0x604d('0x7')]('/describe',auth[_0x604d('0x6')](),controller[_0x604d('0x8')]);router[_0x604d('0x7')](_0x604d('0x9'),auth['isAuthenticated'](),controller[_0x604d('0xa')]);router[_0x604d('0x7')](_0x604d('0xb'),auth[_0x604d('0x6')](),controller['getMembers']);router[_0x604d('0x7')](_0x604d('0xc'),auth[_0x604d('0x6')](),controller[_0x604d('0xd')]);router[_0x604d('0x7')](_0x604d('0xe'),auth[_0x604d('0x6')](),controller[_0x604d('0xf')]);router[_0x604d('0x10')]('/',auth[_0x604d('0x6')](),controller[_0x604d('0x11')]);router[_0x604d('0x10')](_0x604d('0xc'),auth[_0x604d('0x6')](),controller['addTeams']);router[_0x604d('0x10')]('/:id/users',auth[_0x604d('0x6')](),controller['addAgents']);router[_0x604d('0x12')](_0x604d('0x9'),auth[_0x604d('0x6')](),controller['update']);router[_0x604d('0x13')]('/:id',auth[_0x604d('0x6')](),controller['destroy']);router['delete'](_0x604d('0xc'),auth[_0x604d('0x6')](),controller[_0x604d('0x14')]);router[_0x604d('0x13')]('/:id/users',auth[_0x604d('0x6')](),controller['removeAgents']);module[_0x604d('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index fc9e0a9..e0f7d62 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 _0xc6ef=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x54a279,_0x5cebfd){var _0x28d5a6=function(_0x262159){while(--_0x262159){_0x54a279['push'](_0x54a279['shift']());}};_0x28d5a6(++_0x5cebfd);}(_0xc6ef,0x81));var _0xfc6e=function(_0x9f51cd,_0xb084cc){_0x9f51cd=_0x9f51cd-0x0;var _0x1948f8=_0xc6ef[_0x9f51cd];return _0x1948f8;};'use strict';var Sequelize=require(_0xfc6e('0x0'));module[_0xfc6e('0x1')]={'name':{'type':Sequelize[_0xfc6e('0x2')],'unique':_0xfc6e('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfc6e('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfc6e('0x5')](_0xfc6e('0x6'),_0xfc6e('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x8c7f=['sequelize','exports','STRING','name','rrmemory','beepall'];(function(_0x4dba75,_0x303431){var _0x925515=function(_0x1a23cb){while(--_0x1a23cb){_0x4dba75['push'](_0x4dba75['shift']());}};_0x925515(++_0x303431);}(_0x8c7f,0xa2));var _0xf8c7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x8c7f[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xf8c7('0x0'));module[_0xf8c7('0x1')]={'name':{'type':Sequelize[_0xf8c7('0x2')],'unique':_0xf8c7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf8c7('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf8c7('0x4'),_0xf8c7('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 0ac1b7e..e0e8516 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 _0x86e5=['filter','merge','include','rows','catch','show','params','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','MailQueueId','UserMailQueue','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','Team','getTeams','addTeams','ids','User','Agents','voicePause','flatMap','sequelize','transaction','each','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','join','clone','push','toString','SELECT','TeamId','union','compact','value','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','index','map','MailQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x228ccf,_0x5c4a09){var _0x233da0=function(_0x35aca9){while(--_0x35aca9){_0x228ccf['push'](_0x228ccf['shift']());}};_0x233da0(++_0x5c4a09);}(_0x86e5,0x14f));var _0x586e=function(_0x5a9cf0,_0x263d18){_0x5a9cf0=_0x5a9cf0-0x0;var _0x4d6b80=_0x86e5[_0x5a9cf0];return _0x4d6b80;};'use strict';var pdf=require(_0x586e('0x0'));var emlformat=require(_0x586e('0x1'));var rimraf=require(_0x586e('0x2'));var zipdir=require(_0x586e('0x3'));var jsonpatch=require(_0x586e('0x4'));var rp=require(_0x586e('0x5'));var moment=require(_0x586e('0x6'));var BPromise=require(_0x586e('0x7'));var Mustache=require(_0x586e('0x8'));var util=require(_0x586e('0x9'));var path=require(_0x586e('0xa'));var sox=require(_0x586e('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x586e('0xc'));var squel=require(_0x586e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x586e('0xe'));var querystring=require(_0x586e('0xf'));var Papa=require(_0x586e('0x10'));var Redis=require(_0x586e('0x11'));var authService=require(_0x586e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x586e('0x13'));var hardwareService=require(_0x586e('0x14'));var logger=require('../../config/logger')(_0x586e('0x15'));var utils=require('../../config/utils');var config=require(_0x586e('0x16'));var db=require(_0x586e('0x17'))['db'];config[_0x586e('0x18')]=_[_0x586e('0x19')](config[_0x586e('0x18')],{'host':_0x586e('0x1a'),'port':0x18eb});var socket=require(_0x586e('0x1b'))(new Redis(config[_0x586e('0x18')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x140e9f,_0x20c5e1){_0x20c5e1=_0x20c5e1||0xcc;return function(_0x3eed68){if(_0x3eed68){return _0x140e9f[_0x586e('0x1c')](_0x20c5e1);}return _0x140e9f[_0x586e('0x1d')](_0x20c5e1)[_0x586e('0x1e')]();};}function respondWithResult(_0x49875c,_0xf4a346){_0xf4a346=_0xf4a346||0xc8;return function(_0x52ac5a){if(_0x52ac5a){return _0x49875c['status'](_0xf4a346)[_0x586e('0x1f')](_0x52ac5a);}};}function respondWithFilteredResult(_0x25eba6,_0x87e4fc){return function(_0x5c0a47){if(_0x5c0a47){var _0x508b23=_0x5c0a47[_0x586e('0x20')],_0x5d6b0e=_0x87e4fc[_0x586e('0x21')],_0x174e1=_0x87e4fc[_0x586e('0x21')]+_0x87e4fc[_0x586e('0x22')],_0x25ecb7;if(_0x174e1>=_0x508b23){_0x174e1=_0x508b23;_0x25ecb7=0xc8;}else{_0x25ecb7=0xce;}_0x25eba6[_0x586e('0x1d')](_0x25ecb7);return _0x25eba6[_0x586e('0x23')](_0x586e('0x24'),_0x5d6b0e+'-'+_0x174e1+'/'+_0x508b23)[_0x586e('0x1f')](_0x5c0a47);}return null;};}function patchUpdates(_0xa8ae72){return function(_0x438d75){try{jsonpatch['apply'](_0x438d75,_0xa8ae72,!![]);}catch(_0x438d2d){return BPromise['reject'](_0x438d2d);}return _0x438d75['save']();};}function saveUpdates(_0x17f6ee,_0x2c593b){return function(_0x3234e7){if(_0x3234e7){return _0x3234e7[_0x586e('0x25')](_0x17f6ee)[_0x586e('0x26')](function(_0x528c4f){return _0x528c4f;});}return null;};}function removeEntity(_0x564a5a,_0x41fabe){return function(_0x55891a){if(_0x55891a){return _0x55891a[_0x586e('0x27')]()[_0x586e('0x26')](function(){var _0x4dbe0e=_0x55891a[_0x586e('0x28')]({'plain':!![]});var _0x49debf=_0x586e('0x29');return db[_0x586e('0x2a')][_0x586e('0x27')]({'where':{'type':_0x49debf,'resourceId':_0x4dbe0e['id']}})[_0x586e('0x26')](function(){return _0x55891a;});})[_0x586e('0x26')](function(){_0x564a5a[_0x586e('0x1d')](0xcc)[_0x586e('0x1e')]();});}};}function handleEntityNotFound(_0x575fe2,_0x28d364){return function(_0x7d9eaa){if(!_0x7d9eaa){_0x575fe2[_0x586e('0x1c')](0x194);}return _0x7d9eaa;};}function handleError(_0x3fa513,_0x2425f8){_0x2425f8=_0x2425f8||0x1f4;return function(_0x462955){logger[_0x586e('0x2b')](_0x462955[_0x586e('0x2c')]);if(_0x462955[_0x586e('0x2d')]){delete _0x462955['name'];}_0x3fa513['status'](_0x2425f8)['send'](_0x462955);};}exports[_0x586e('0x2e')]=function(_0x38e70c,_0x46fdfc){var _0xe5abb8={},_0xf78e4e={},_0x4843a5={'count':0x0,'rows':[]};var _0x5c45ba=_[_0x586e('0x2f')](db[_0x586e('0x30')][_0x586e('0x31')],function(_0x5e9c5e){return{'name':_0x5e9c5e[_0x586e('0x32')],'type':_0x5e9c5e[_0x586e('0x33')][_0x586e('0x34')]};});_0xf78e4e['model']=_[_0x586e('0x2f')](_0x5c45ba,_0x586e('0x2d'));_0xf78e4e[_0x586e('0x35')]=_[_0x586e('0x36')](_0x38e70c[_0x586e('0x35')]);_0xf78e4e[_0x586e('0x37')]=_[_0x586e('0x38')](_0xf78e4e[_0x586e('0x39')],_0xf78e4e[_0x586e('0x35')]);_0xe5abb8['attributes']=_[_0x586e('0x38')](_0xf78e4e[_0x586e('0x39')],qs[_0x586e('0x3a')](_0x38e70c[_0x586e('0x35')][_0x586e('0x3a')]));_0xe5abb8['attributes']=_0xe5abb8['attributes'][_0x586e('0x3b')]?_0xe5abb8[_0x586e('0x3c')]:_0xf78e4e[_0x586e('0x39')];if(!_0x38e70c[_0x586e('0x35')][_0x586e('0x3d')](_0x586e('0x3e'))){_0xe5abb8[_0x586e('0x22')]=qs['limit'](_0x38e70c['query'][_0x586e('0x22')]);_0xe5abb8[_0x586e('0x21')]=qs['offset'](_0x38e70c[_0x586e('0x35')][_0x586e('0x21')]);}_0xe5abb8[_0x586e('0x3f')]=qs['sort'](_0x38e70c[_0x586e('0x35')][_0x586e('0x40')]);_0xe5abb8[_0x586e('0x41')]=qs[_0x586e('0x37')](_[_0x586e('0x42')](_0x38e70c[_0x586e('0x35')],_0xf78e4e[_0x586e('0x37')]),_0x5c45ba);if(_0x38e70c[_0x586e('0x35')][_0x586e('0x43')]){_0xe5abb8[_0x586e('0x41')]=_[_0x586e('0x44')](_0xe5abb8[_0x586e('0x41')],{'$or':_[_0x586e('0x2f')](_0x5c45ba,function(_0x3a7137){if(_0x3a7137['type']!=='VIRTUAL'){var _0x4af655={};_0x4af655[_0x3a7137[_0x586e('0x2d')]]={'$like':'%'+_0x38e70c[_0x586e('0x35')][_0x586e('0x43')]+'%'};return _0x4af655;}})});}_0xe5abb8=_['merge']({},_0xe5abb8,_0x38e70c['options']);var _0x142966={'where':_0xe5abb8['where']};return db[_0x586e('0x30')]['count'](_0x142966)[_0x586e('0x26')](function(_0xf94bf3){_0x4843a5[_0x586e('0x20')]=_0xf94bf3;if(_0x38e70c[_0x586e('0x35')]['includeAll']){_0xe5abb8[_0x586e('0x45')]=[{'all':!![]}];}return db[_0x586e('0x30')]['findAll'](_0xe5abb8);})[_0x586e('0x26')](function(_0x5bdee8){_0x4843a5[_0x586e('0x46')]=_0x5bdee8;return _0x4843a5;})[_0x586e('0x26')](respondWithFilteredResult(_0x46fdfc,_0xe5abb8))[_0x586e('0x47')](handleError(_0x46fdfc,null));};exports[_0x586e('0x48')]=function(_0x4d0d6d,_0x46d5d9){var _0x5519a7={'raw':!![],'where':{'id':_0x4d0d6d[_0x586e('0x49')]['id']}},_0x4a81ea={};_0x4a81ea['model']=_[_0x586e('0x36')](db[_0x586e('0x30')][_0x586e('0x31')]);_0x4a81ea['query']=_[_0x586e('0x36')](_0x4d0d6d['query']);_0x4a81ea[_0x586e('0x37')]=_[_0x586e('0x38')](_0x4a81ea['model'],_0x4a81ea[_0x586e('0x35')]);_0x5519a7[_0x586e('0x3c')]=_[_0x586e('0x38')](_0x4a81ea[_0x586e('0x39')],qs['fields'](_0x4d0d6d['query'][_0x586e('0x3a')]));_0x5519a7[_0x586e('0x3c')]=_0x5519a7[_0x586e('0x3c')][_0x586e('0x3b')]?_0x5519a7['attributes']:_0x4a81ea[_0x586e('0x39')];if(_0x4d0d6d[_0x586e('0x35')][_0x586e('0x4a')]){_0x5519a7[_0x586e('0x45')]=[{'all':!![]}];}_0x5519a7=_[_0x586e('0x44')]({},_0x5519a7,_0x4d0d6d[_0x586e('0x4b')]);return db[_0x586e('0x30')][_0x586e('0x4c')](_0x5519a7)[_0x586e('0x26')](handleEntityNotFound(_0x46d5d9,null))['then'](respondWithResult(_0x46d5d9,null))[_0x586e('0x47')](handleError(_0x46d5d9,null));};exports[_0x586e('0x4d')]=function(_0x454763,_0x5012ea){return db['MailQueue'][_0x586e('0x4d')](_0x454763[_0x586e('0x4e')],{})[_0x586e('0x26')](function(_0x42b573){var _0x14f2f7=_0x454763['user'][_0x586e('0x28')]({'plain':!![]});if(!_0x14f2f7)throw new Error(_0x586e('0x4f'));if(_0x14f2f7[_0x586e('0x50')]===_0x586e('0x51')){var _0xd9098c=_0x42b573[_0x586e('0x28')]({'plain':!![]});var _0x2f3d4f=_0x586e('0x29');return db['UserProfileSection'][_0x586e('0x4c')]({'where':{'name':_0x2f3d4f,'userProfileId':_0x14f2f7[_0x586e('0x52')]},'raw':!![]})[_0x586e('0x26')](function(_0x5e8399){if(_0x5e8399&&_0x5e8399[_0x586e('0x53')]===0x0){return db[_0x586e('0x2a')][_0x586e('0x4d')]({'name':_0xd9098c[_0x586e('0x2d')],'resourceId':_0xd9098c['id'],'type':_0x5e8399[_0x586e('0x2d')],'sectionId':_0x5e8399['id']},{})[_0x586e('0x26')](function(){return _0x42b573;});}else{return _0x42b573;}})['catch'](function(_0x5f4097){logger['error'](_0x586e('0x54'),_0x5f4097);throw _0x5f4097;});}return _0x42b573;})[_0x586e('0x26')](respondWithResult(_0x5012ea,0xc9))['catch'](handleError(_0x5012ea,null));};exports[_0x586e('0x25')]=function(_0x4ce65b,_0x2009d2){if(_0x4ce65b[_0x586e('0x4e')]['id']){delete _0x4ce65b['body']['id'];}return db[_0x586e('0x30')][_0x586e('0x4c')]({'where':{'id':_0x4ce65b['params']['id']}})[_0x586e('0x26')](handleEntityNotFound(_0x2009d2,null))[_0x586e('0x26')](saveUpdates(_0x4ce65b[_0x586e('0x4e')],null))[_0x586e('0x26')](respondWithResult(_0x2009d2,null))[_0x586e('0x47')](handleError(_0x2009d2,null));};exports[_0x586e('0x27')]=function(_0x1befdf,_0x5e2f08){return db['MailQueue'][_0x586e('0x4c')]({'where':{'id':_0x1befdf[_0x586e('0x49')]['id']}})[_0x586e('0x26')](handleEntityNotFound(_0x5e2f08,null))[_0x586e('0x26')](removeEntity(_0x5e2f08,null))['catch'](handleError(_0x5e2f08,null));};exports['describe']=function(_0x47cf3f,_0x2a5c21){return db['MailQueue'][_0x586e('0x55')]()[_0x586e('0x26')](respondWithResult(_0x2a5c21,null))[_0x586e('0x47')](handleError(_0x2a5c21,null));};exports[_0x586e('0x56')]=function(_0x593eed,_0xc5c118,_0xc7634f){var _0x126714={'raw':!![],'where':{}},_0x39b4c9={},_0x2db71c;return db[_0x586e('0x30')][_0x586e('0x57')]({'where':{'id':_0x593eed[_0x586e('0x49')]['id']}})['then'](handleEntityNotFound(_0xc5c118,null))[_0x586e('0x26')](function(_0x2a93dc){if(_0x2a93dc){_0x2db71c=_0x2a93dc[_0x586e('0x28')]({'plain':!![]});_0x39b4c9['model']=_[_0x586e('0x36')](db['UserMailQueue'][_0x586e('0x31')]);_0x39b4c9[_0x586e('0x35')]=_[_0x586e('0x36')](_0x593eed[_0x586e('0x35')]);_0x39b4c9[_0x586e('0x37')]=_[_0x586e('0x38')](_0x39b4c9[_0x586e('0x39')],_0x39b4c9[_0x586e('0x35')]);_0x126714['attributes']=_[_0x586e('0x38')](_0x39b4c9[_0x586e('0x39')],qs[_0x586e('0x3a')](_0x593eed[_0x586e('0x35')][_0x586e('0x3a')]));_0x126714[_0x586e('0x3c')]=_0x126714['attributes'][_0x586e('0x3b')]?_0x126714[_0x586e('0x3c')]:_0x39b4c9[_0x586e('0x39')];if(!_0x593eed[_0x586e('0x35')][_0x586e('0x3d')](_0x586e('0x3e'))){_0x126714[_0x586e('0x22')]=qs[_0x586e('0x22')](_0x593eed['query'][_0x586e('0x22')]);_0x126714['offset']=qs[_0x586e('0x21')](_0x593eed['query'][_0x586e('0x21')]);}_0x126714[_0x586e('0x3f')]=qs['sort'](_0x593eed[_0x586e('0x35')][_0x586e('0x40')]);_0x126714['where']=qs['filters'](_[_0x586e('0x42')](_0x593eed[_0x586e('0x35')],_0x39b4c9['filters']));_0x126714[_0x586e('0x41')][_0x586e('0x58')]=_0x2a93dc['id'];if(_0x593eed[_0x586e('0x35')][_0x586e('0x43')]){_0x126714[_0x586e('0x41')]=_[_0x586e('0x44')](_0x126714[_0x586e('0x41')],{'$or':_[_0x586e('0x2f')](_0x126714[_0x586e('0x3c')],function(_0x523b38){var _0x4969ec={};_0x4969ec[_0x523b38]={'$like':'%'+_0x593eed[_0x586e('0x35')]['filter']+'%'};return _0x4969ec;})});}_0x126714=_['merge']({},_0x126714,_0x593eed['options']);return db[_0x586e('0x59')][_0x586e('0x5a')](_0x126714);}})[_0x586e('0x26')](function(_0x231214){if(_0x231214){return db['User'][_0x586e('0x5b')]({'where':{'id':_[_0x586e('0x2f')](_0x231214,_0x586e('0x5c')),'role':_0x586e('0x5d')},'attributes':['id',_0x586e('0x2d'),_0x586e('0x5e'),_0x586e('0x5f'),_0x586e('0x60')]});}})[_0x586e('0x26')](function(_0x418864){if(_0x418864){return{'count':_0x418864[_0x586e('0x20')],'rows':_[_0x586e('0x2f')](_0x418864[_0x586e('0x46')],function(_0x564547){return{'membername':_0x564547[_0x586e('0x2d')],'UserId':_0x564547['id'],'queue_name':_0x2db71c['name'],'MailQueueId':_0x2db71c['id'],'interface':util[_0x586e('0x61')]('%s/%s',_0x586e('0x62'),_0x564547[_0x586e('0x2d')]),'penalty':0x0,'paused':_0x564547['mailPause'],'createdAt':_0x564547['createdAt'],'updatedAt':_0x564547[_0x586e('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x586e('0x26')](respondWithFilteredResult(_0xc5c118,_0x126714))[_0x586e('0x47')](handleError(_0xc5c118,null));};exports['getTeams']=function(_0x4f0697,_0x2e754a,_0x3e533b){var _0x42b5c2={};var _0x4aebc4={};var _0x511473;var _0x16a060;return db['MailQueue'][_0x586e('0x57')]({'where':{'id':_0x4f0697[_0x586e('0x49')]['id']}})['then'](handleEntityNotFound(_0x2e754a,null))['then'](function(_0x24e2a6){if(_0x24e2a6){_0x511473=_0x24e2a6;_0x4aebc4[_0x586e('0x39')]=_[_0x586e('0x36')](db[_0x586e('0x63')][_0x586e('0x31')]);_0x4aebc4[_0x586e('0x35')]=_[_0x586e('0x36')](_0x4f0697[_0x586e('0x35')]);_0x4aebc4[_0x586e('0x37')]=_[_0x586e('0x38')](_0x4aebc4[_0x586e('0x39')],_0x4aebc4['query']);_0x42b5c2[_0x586e('0x3c')]=_['intersection'](_0x4aebc4[_0x586e('0x39')],qs['fields'](_0x4f0697[_0x586e('0x35')][_0x586e('0x3a')]));_0x42b5c2[_0x586e('0x3c')]=_0x42b5c2[_0x586e('0x3c')][_0x586e('0x3b')]?_0x42b5c2['attributes']:_0x4aebc4[_0x586e('0x39')];_0x42b5c2[_0x586e('0x3f')]=qs[_0x586e('0x40')](_0x4f0697[_0x586e('0x35')][_0x586e('0x40')]);_0x42b5c2[_0x586e('0x41')]=qs['filters'](_['pick'](_0x4f0697['query'],_0x4aebc4[_0x586e('0x37')]));if(_0x4f0697[_0x586e('0x35')]['filter']){_0x42b5c2[_0x586e('0x41')]=_[_0x586e('0x44')](_0x42b5c2[_0x586e('0x41')],{'$or':_[_0x586e('0x2f')](_0x42b5c2[_0x586e('0x3c')],function(_0x2d1b10){var _0x30fafc={};_0x30fafc[_0x2d1b10]={'$like':'%'+_0x4f0697[_0x586e('0x35')][_0x586e('0x43')]+'%'};return _0x30fafc;})});}_0x42b5c2=_[_0x586e('0x44')]({},_0x42b5c2,_0x4f0697[_0x586e('0x4b')]);return _0x511473[_0x586e('0x64')](_0x42b5c2);}})['then'](function(_0xf99269){if(_0xf99269){_0x16a060=_0xf99269[_0x586e('0x3b')];if(!_0x4f0697[_0x586e('0x35')]['hasOwnProperty'](_0x586e('0x3e'))){_0x42b5c2[_0x586e('0x22')]=qs['limit'](_0x4f0697[_0x586e('0x35')][_0x586e('0x22')]);_0x42b5c2[_0x586e('0x21')]=qs['offset'](_0x4f0697[_0x586e('0x35')]['offset']);}return _0x511473[_0x586e('0x64')](_0x42b5c2);}})[_0x586e('0x26')](function(_0x4dde7a){if(_0x4dde7a){return _0x4dde7a?{'count':_0x16a060,'rows':_0x4dde7a}:null;}})[_0x586e('0x26')](respondWithResult(_0x2e754a,null))[_0x586e('0x47')](handleError(_0x2e754a,null));};exports[_0x586e('0x65')]=function(_0x3f9c1e,_0x530eb9,_0x27a24b){var _0x4a4ad7=_0x3f9c1e['body'][_0x586e('0x66')];return db[_0x586e('0x63')][_0x586e('0x5a')]({'where':{'id':_0x4a4ad7},'attributes':['id'],'include':[{'model':db[_0x586e('0x67')],'as':_0x586e('0x68'),'attributes':['id',_0x586e('0x2d'),'online',_0x586e('0x69'),'interface'],'raw':!![]}]})['then'](function(_0x319eea){if(_0x319eea){var _0x22f0a9=_[_0x586e('0x6a')](_0x319eea,function(_0xb12383){var _0x53feee=_0xb12383['get']({'plain':!![]});return _0x53feee[_0x586e('0x68')];});return db[_0x586e('0x30')][_0x586e('0x4c')]({'where':{'id':_0x3f9c1e[_0x586e('0x49')]['id']}})[_0x586e('0x26')](function(_0x4064fa){return db[_0x586e('0x6b')][_0x586e('0x6c')](function(_0x3ee22f){return _0x4064fa[_0x586e('0x65')](_0x4a4ad7,{'transaction':_0x3ee22f})[_0x586e('0x26')](function(){return BPromise[_0x586e('0x6d')](_0x22f0a9,function(_0x445120){return db[_0x586e('0x59')]['findOrCreate']({'where':{'UserId':_0x445120['id'],'MailQueueId':_0x3f9c1e['params']['id']},'transaction':_0x3ee22f});});})[_0x586e('0x26')](function(){_0x22f0a9[_0x586e('0x6e')](function(_0x4a91be){socket['emit'](_0x586e('0x6f'),{'UserId':_0x4a91be['id'],'MailQueueId':_0x4064fa['id']});});});});});}})[_0x586e('0x26')](respondWithStatusCode(_0x530eb9,null))['catch'](handleError(_0x530eb9,null));};exports[_0x586e('0x70')]=function(_0x46b02d,_0x4ae8e1,_0x21659c){return db['Team'][_0x586e('0x5a')]({'where':{'id':_0x46b02d['query'][_0x586e('0x66')]},'attributes':['id'],'include':[{'model':db[_0x586e('0x67')],'as':_0x586e('0x68'),'attributes':['id'],'raw':!![]}]})[_0x586e('0x26')](handleEntityNotFound(_0x4ae8e1,null))['then'](function(_0x48ac6c){var _0x5c912e=_[_0x586e('0x2f')](_0x48ac6c,'id');var _0x215e0b=[];var _0x49b915=[];var _0x46c94e=squel[_0x586e('0x71')]();_0x46c94e[_0x586e('0x72')](_0x586e('0x73'))[_0x586e('0x74')]('team_has_mail_queues','tq')[_0x586e('0x75')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('MailQueueId\x20=\x20?',_0x46b02d['params']['id']);for(var _0x425893=0x0;_0x425893<_0x48ac6c[_0x586e('0x3b')];_0x425893+=0x1){let _0xb13a66=_0x48ac6c[_0x425893];for(var _0x336f35=0x0;_0x336f35<_0xb13a66[_0x586e('0x68')][_0x586e('0x3b')];_0x336f35+=0x1){let _0x595bdb=_0xb13a66[_0x586e('0x68')][_0x336f35];var _0x492675=_0x46c94e[_0x586e('0x76')]();_0x492675[_0x586e('0x41')]('ut.UserId\x20=\x20?',_0x595bdb['id']);_0x49b915[_0x586e('0x77')](db[_0x586e('0x6b')][_0x586e('0x35')](_0x492675[_0x586e('0x78')](),{'type':db['sequelize']['QueryTypes'][_0x586e('0x79')]})[_0x586e('0x26')](function(_0x33ea81){if(_0x33ea81[_0x586e('0x3b')]===0x1){return _0x595bdb['id'];}else{var _0x22a7d2=_['every'](_['map'](_0x33ea81,_0x586e('0x7a')),function(_0x559a13){return _['includes'](_0x5c912e,_0x559a13);});if(_0x22a7d2){return _0x595bdb['id'];}}}));}}return BPromise['all'](_0x49b915)['then'](function(_0x11346b){_0x215e0b=_(_0x215e0b)[_0x586e('0x7b')](_0x11346b)[_0x586e('0x7c')]()[_0x586e('0x7d')]();return db[_0x586e('0x30')][_0x586e('0x4c')]({'where':{'id':_0x46b02d[_0x586e('0x49')]['id']}})[_0x586e('0x26')](function(_0x19bb29){return db[_0x586e('0x6b')][_0x586e('0x6c')](function(_0x6ff693){return _0x19bb29['removeTeams'](_0x46b02d[_0x586e('0x35')][_0x586e('0x66')],{'transaction':_0x6ff693})['then'](function(){if(!_['isEmpty'](_0x215e0b)){return _0x19bb29[_0x586e('0x7e')](_0x215e0b,{'transaction':_0x6ff693});}})[_0x586e('0x26')](function(){_0x215e0b[_0x586e('0x6e')](function(_0x2054aa){socket[_0x586e('0x7f')](_0x586e('0x80'),{'UserId':_0x2054aa,'MailQueueId':_0x19bb29['id']});});});});});});})[_0x586e('0x26')](respondWithStatusCode(_0x4ae8e1,null))[_0x586e('0x47')](handleError(_0x4ae8e1,null));};exports[_0x586e('0x81')]=function(_0x1856dc,_0x13df4b,_0x565140){return db[_0x586e('0x30')][_0x586e('0x4c')]({'where':{'id':_0x1856dc[_0x586e('0x49')]['id']}})[_0x586e('0x26')](handleEntityNotFound(_0x13df4b,null))[_0x586e('0x26')](function(_0x21ac57){if(_0x21ac57){return _0x21ac57['addAgents'](_0x1856dc['body'][_0x586e('0x66')],_[_0x586e('0x82')](_0x1856dc[_0x586e('0x4e')],['ids','id'])||{})[_0x586e('0x83')](function(_0x45969b){for(var _0x14db49=0x0;_0x14db49<_0x1856dc[_0x586e('0x4e')]['ids'][_0x586e('0x3b')];_0x14db49+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x1856dc[_0x586e('0x4e')]['ids'][_0x14db49],'MailQueueId':_0x1856dc[_0x586e('0x49')]['id']});}return _0x45969b;});}})[_0x586e('0x26')](respondWithResult(_0x13df4b,null))['catch'](handleError(_0x13df4b,null));};exports[_0x586e('0x7e')]=function(_0x480a5c,_0x5277ce,_0x49e2c3){return db[_0x586e('0x30')][_0x586e('0x4c')]({'where':{'id':_0x480a5c[_0x586e('0x49')]['id']}})[_0x586e('0x26')](handleEntityNotFound(_0x5277ce,null))[_0x586e('0x26')](function(_0x1ee762){if(_0x1ee762){return _0x1ee762[_0x586e('0x7e')](_0x480a5c['query'][_0x586e('0x66')])[_0x586e('0x26')](function(){if(_[_0x586e('0x84')](_0x480a5c[_0x586e('0x35')][_0x586e('0x66')])){for(var _0x3eaec0=0x0;_0x3eaec0<_0x480a5c['query'][_0x586e('0x66')][_0x586e('0x3b')];_0x3eaec0+=0x1){socket[_0x586e('0x7f')]('userMailQueue:remove',{'UserId':Number(_0x480a5c['query']['ids'][_0x3eaec0]),'MailQueueId':Number(_0x480a5c[_0x586e('0x49')]['id'])});}}else{socket[_0x586e('0x7f')]('userMailQueue:remove',{'UserId':Number(_0x480a5c[_0x586e('0x35')][_0x586e('0x66')]),'MailQueueId':Number(_0x480a5c['params']['id'])});}});}})[_0x586e('0x26')](respondWithStatusCode(_0x5277ce,null))['catch'](handleError(_0x5277ce,null));};exports[_0x586e('0x85')]=function(_0x1851be,_0x244152,_0x55de57){var _0x275dfb={};var _0x3a2e26={};var _0x44f4b9;var _0x50624e;return db[_0x586e('0x30')][_0x586e('0x57')]({'where':{'id':_0x1851be['params']['id']}})['then'](handleEntityNotFound(_0x244152,null))[_0x586e('0x26')](function(_0x4fe99a){if(_0x4fe99a){_0x44f4b9=_0x4fe99a;_0x3a2e26[_0x586e('0x39')]=_[_0x586e('0x36')](db[_0x586e('0x67')][_0x586e('0x31')]);_0x3a2e26[_0x586e('0x35')]=_[_0x586e('0x36')](_0x1851be[_0x586e('0x35')]);_0x3a2e26[_0x586e('0x37')]=_[_0x586e('0x38')](_0x3a2e26[_0x586e('0x39')],_0x3a2e26[_0x586e('0x35')]);_0x275dfb['attributes']=_['intersection'](_0x3a2e26[_0x586e('0x39')],qs['fields'](_0x1851be[_0x586e('0x35')][_0x586e('0x3a')]));_0x275dfb[_0x586e('0x3c')]=_0x275dfb[_0x586e('0x3c')][_0x586e('0x3b')]?_0x275dfb[_0x586e('0x3c')]:_0x3a2e26[_0x586e('0x39')];_0x275dfb[_0x586e('0x3f')]=qs[_0x586e('0x40')](_0x1851be[_0x586e('0x35')]['sort']);_0x275dfb[_0x586e('0x41')]=qs[_0x586e('0x37')](_[_0x586e('0x42')](_0x1851be[_0x586e('0x35')],_0x3a2e26[_0x586e('0x37')]));if(_0x1851be[_0x586e('0x35')][_0x586e('0x43')]){_0x275dfb[_0x586e('0x41')]=_[_0x586e('0x44')](_0x275dfb[_0x586e('0x41')],{'$or':_[_0x586e('0x2f')](_0x275dfb[_0x586e('0x3c')],function(_0x15480a){var _0x25c17a={};_0x25c17a[_0x15480a]={'$like':'%'+_0x1851be[_0x586e('0x35')][_0x586e('0x43')]+'%'};return _0x25c17a;})});}_0x275dfb=_[_0x586e('0x44')]({},_0x275dfb,_0x1851be['options']);return _0x44f4b9[_0x586e('0x85')](_0x275dfb);}})[_0x586e('0x26')](function(_0x39d2db){if(_0x39d2db){_0x50624e=_0x39d2db[_0x586e('0x3b')];if(!_0x1851be[_0x586e('0x35')][_0x586e('0x3d')](_0x586e('0x3e'))){_0x275dfb['limit']=qs[_0x586e('0x22')](_0x1851be[_0x586e('0x35')][_0x586e('0x22')]);_0x275dfb[_0x586e('0x21')]=qs['offset'](_0x1851be[_0x586e('0x35')][_0x586e('0x21')]);}return _0x44f4b9[_0x586e('0x85')](_0x275dfb);}})['then'](function(_0x2b19e1){if(_0x2b19e1){return _0x2b19e1?{'count':_0x50624e,'rows':_0x2b19e1}:null;}})[_0x586e('0x26')](respondWithResult(_0x244152,null))[_0x586e('0x47')](handleError(_0x244152,null));}; \ No newline at end of file +var _0x4489=['get','UserProfileResource','sendStatus','stack','name','send','index','map','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','options','MailQueue','includeAll','include','show','rawAttributes','find','catch','create','body','user','MailQueues','userProfileId','autoAssociation','error','update','params','describe','findOne','nolimit','sort','MailQueueId','UserMailQueue','findAll','User','UserId','agent','mailPause','rows','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','path','ejs','lodash','squel','crypto','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','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','count','offset','set','Content-Range','reject','save','destroy','then'];(function(_0x1dcbcc,_0x31a0fc){var _0x38590e=function(_0xd1a9aa){while(--_0xd1a9aa){_0x1dcbcc['push'](_0x1dcbcc['shift']());}};_0x38590e(++_0x31a0fc);}(_0x4489,0x16f));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9448('0x0'));var emlformat=require(_0x9448('0x1'));var rimraf=require(_0x9448('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9448('0x3'));var rp=require(_0x9448('0x4'));var moment=require(_0x9448('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9448('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9448('0x7'));var fs=require('fs');var _=require(_0x9448('0x8'));var squel=require(_0x9448('0x9'));var crypto=require(_0x9448('0xa'));var jsforce=require(_0x9448('0xb'));var deskjs=require(_0x9448('0xc'));var toCsv=require(_0x9448('0xd'));var querystring=require(_0x9448('0xe'));var Papa=require(_0x9448('0xf'));var Redis=require('ioredis');var authService=require(_0x9448('0x10'));var qs=require(_0x9448('0x11'));var as=require(_0x9448('0x12'));var hardwareService=require(_0x9448('0x13'));var logger=require('../../config/logger')(_0x9448('0x14'));var utils=require(_0x9448('0x15'));var config=require(_0x9448('0x16'));var db=require(_0x9448('0x17'))['db'];config[_0x9448('0x18')]=_[_0x9448('0x19')](config[_0x9448('0x18')],{'host':_0x9448('0x1a'),'port':0x18eb});var socket=require(_0x9448('0x1b'))(new Redis(config[_0x9448('0x18')]));require(_0x9448('0x1c'))[_0x9448('0x1d')](socket);function respondWithStatusCode(_0x3f5d13,_0x5779cd){_0x5779cd=_0x5779cd||0xcc;return function(_0x58297e){if(_0x58297e){return _0x3f5d13['sendStatus'](_0x5779cd);}return _0x3f5d13[_0x9448('0x1e')](_0x5779cd)[_0x9448('0x1f')]();};}function respondWithResult(_0x5e6d6c,_0x2d4eb2){_0x2d4eb2=_0x2d4eb2||0xc8;return function(_0x439485){if(_0x439485){return _0x5e6d6c[_0x9448('0x1e')](_0x2d4eb2)[_0x9448('0x20')](_0x439485);}};}function respondWithFilteredResult(_0x2c874b,_0x33cb87){return function(_0x7cdfca){if(_0x7cdfca){var _0x3ba808=_0x7cdfca[_0x9448('0x21')],_0x2d3277=_0x33cb87['offset'],_0x539c99=_0x33cb87[_0x9448('0x22')]+_0x33cb87['limit'],_0x556057;if(_0x539c99>=_0x3ba808){_0x539c99=_0x3ba808;_0x556057=0xc8;}else{_0x556057=0xce;}_0x2c874b[_0x9448('0x1e')](_0x556057);return _0x2c874b[_0x9448('0x23')](_0x9448('0x24'),_0x2d3277+'-'+_0x539c99+'/'+_0x3ba808)[_0x9448('0x20')](_0x7cdfca);}return null;};}function patchUpdates(_0x5e76bd){return function(_0x53372b){try{jsonpatch['apply'](_0x53372b,_0x5e76bd,!![]);}catch(_0x26f407){return BPromise[_0x9448('0x25')](_0x26f407);}return _0x53372b[_0x9448('0x26')]();};}function saveUpdates(_0x59e30f,_0x401660){return function(_0x5b0028){if(_0x5b0028){return _0x5b0028['update'](_0x59e30f)['then'](function(_0x19224d){return _0x19224d;});}return null;};}function removeEntity(_0x20e54b,_0x279726){return function(_0x237060){if(_0x237060){return _0x237060[_0x9448('0x27')]()[_0x9448('0x28')](function(){var _0x252242=_0x237060[_0x9448('0x29')]({'plain':!![]});var _0x122367='MailQueues';return db[_0x9448('0x2a')][_0x9448('0x27')]({'where':{'type':_0x122367,'resourceId':_0x252242['id']}})[_0x9448('0x28')](function(){return _0x237060;});})[_0x9448('0x28')](function(){_0x20e54b['status'](0xcc)[_0x9448('0x1f')]();});}};}function handleEntityNotFound(_0x4b4efc,_0x1fc15e){return function(_0x5e2364){if(!_0x5e2364){_0x4b4efc[_0x9448('0x2b')](0x194);}return _0x5e2364;};}function handleError(_0x2c9812,_0x9de93f){_0x9de93f=_0x9de93f||0x1f4;return function(_0x11ddd2){logger['error'](_0x11ddd2[_0x9448('0x2c')]);if(_0x11ddd2[_0x9448('0x2d')]){delete _0x11ddd2[_0x9448('0x2d')];}_0x2c9812[_0x9448('0x1e')](_0x9de93f)[_0x9448('0x2e')](_0x11ddd2);};}exports[_0x9448('0x2f')]=function(_0x2de0ed,_0x445510){var _0x40bede={},_0x4efdd9={},_0x21b7eb={'count':0x0,'rows':[]};var _0x2c6c03=_[_0x9448('0x30')](db['MailQueue']['rawAttributes'],function(_0x21a886){return{'name':_0x21a886['fieldName'],'type':_0x21a886['type'][_0x9448('0x31')]};});_0x4efdd9['model']=_[_0x9448('0x30')](_0x2c6c03,_0x9448('0x2d'));_0x4efdd9['query']=_[_0x9448('0x32')](_0x2de0ed[_0x9448('0x33')]);_0x4efdd9[_0x9448('0x34')]=_['intersection'](_0x4efdd9['model'],_0x4efdd9[_0x9448('0x33')]);_0x40bede[_0x9448('0x35')]=_[_0x9448('0x36')](_0x4efdd9[_0x9448('0x37')],qs[_0x9448('0x38')](_0x2de0ed['query'][_0x9448('0x38')]));_0x40bede[_0x9448('0x35')]=_0x40bede[_0x9448('0x35')][_0x9448('0x39')]?_0x40bede[_0x9448('0x35')]:_0x4efdd9[_0x9448('0x37')];if(!_0x2de0ed[_0x9448('0x33')][_0x9448('0x3a')]('nolimit')){_0x40bede[_0x9448('0x3b')]=qs[_0x9448('0x3b')](_0x2de0ed[_0x9448('0x33')][_0x9448('0x3b')]);_0x40bede[_0x9448('0x22')]=qs[_0x9448('0x22')](_0x2de0ed[_0x9448('0x33')][_0x9448('0x22')]);}_0x40bede[_0x9448('0x3c')]=qs['sort'](_0x2de0ed[_0x9448('0x33')]['sort']);_0x40bede[_0x9448('0x3d')]=qs[_0x9448('0x34')](_[_0x9448('0x3e')](_0x2de0ed['query'],_0x4efdd9[_0x9448('0x34')]),_0x2c6c03);if(_0x2de0ed['query'][_0x9448('0x3f')]){_0x40bede[_0x9448('0x3d')]=_[_0x9448('0x40')](_0x40bede[_0x9448('0x3d')],{'$or':_[_0x9448('0x30')](_0x2c6c03,function(_0x58c3d9){if(_0x58c3d9['type']!==_0x9448('0x41')){var _0x27bcae={};_0x27bcae[_0x58c3d9[_0x9448('0x2d')]]={'$like':'%'+_0x2de0ed[_0x9448('0x33')][_0x9448('0x3f')]+'%'};return _0x27bcae;}})});}_0x40bede=_[_0x9448('0x40')]({},_0x40bede,_0x2de0ed[_0x9448('0x42')]);var _0x51dd57={'where':_0x40bede['where']};return db[_0x9448('0x43')]['count'](_0x51dd57)[_0x9448('0x28')](function(_0x2baf4f){_0x21b7eb[_0x9448('0x21')]=_0x2baf4f;if(_0x2de0ed[_0x9448('0x33')][_0x9448('0x44')]){_0x40bede[_0x9448('0x45')]=[{'all':!![]}];}return db[_0x9448('0x43')]['findAll'](_0x40bede);})[_0x9448('0x28')](function(_0x431d60){_0x21b7eb['rows']=_0x431d60;return _0x21b7eb;})['then'](respondWithFilteredResult(_0x445510,_0x40bede))['catch'](handleError(_0x445510,null));};exports[_0x9448('0x46')]=function(_0x5c4e41,_0x37de8c){var _0x24f4a7={'raw':!![],'where':{'id':_0x5c4e41['params']['id']}},_0x2e1fbc={};_0x2e1fbc[_0x9448('0x37')]=_['keys'](db[_0x9448('0x43')][_0x9448('0x47')]);_0x2e1fbc['query']=_[_0x9448('0x32')](_0x5c4e41[_0x9448('0x33')]);_0x2e1fbc[_0x9448('0x34')]=_[_0x9448('0x36')](_0x2e1fbc[_0x9448('0x37')],_0x2e1fbc[_0x9448('0x33')]);_0x24f4a7[_0x9448('0x35')]=_[_0x9448('0x36')](_0x2e1fbc[_0x9448('0x37')],qs[_0x9448('0x38')](_0x5c4e41[_0x9448('0x33')][_0x9448('0x38')]));_0x24f4a7[_0x9448('0x35')]=_0x24f4a7[_0x9448('0x35')]['length']?_0x24f4a7[_0x9448('0x35')]:_0x2e1fbc[_0x9448('0x37')];if(_0x5c4e41[_0x9448('0x33')][_0x9448('0x44')]){_0x24f4a7['include']=[{'all':!![]}];}_0x24f4a7=_[_0x9448('0x40')]({},_0x24f4a7,_0x5c4e41[_0x9448('0x42')]);return db[_0x9448('0x43')][_0x9448('0x48')](_0x24f4a7)['then'](handleEntityNotFound(_0x37de8c,null))[_0x9448('0x28')](respondWithResult(_0x37de8c,null))[_0x9448('0x49')](handleError(_0x37de8c,null));};exports[_0x9448('0x4a')]=function(_0x1b741b,_0x5e9f8f){return db[_0x9448('0x43')][_0x9448('0x4a')](_0x1b741b[_0x9448('0x4b')],{})['then'](function(_0x4d4b47){var _0xf114a6=_0x1b741b['user']['get']({'plain':!![]});if(!_0xf114a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf114a6['role']===_0x9448('0x4c')){var _0x26e29f=_0x4d4b47['get']({'plain':!![]});var _0x3b8ef7=_0x9448('0x4d');return db['UserProfileSection']['find']({'where':{'name':_0x3b8ef7,'userProfileId':_0xf114a6[_0x9448('0x4e')]},'raw':!![]})[_0x9448('0x28')](function(_0x5ee63a){if(_0x5ee63a&&_0x5ee63a[_0x9448('0x4f')]===0x0){return db[_0x9448('0x2a')]['create']({'name':_0x26e29f[_0x9448('0x2d')],'resourceId':_0x26e29f['id'],'type':_0x5ee63a['name'],'sectionId':_0x5ee63a['id']},{})[_0x9448('0x28')](function(){return _0x4d4b47;});}else{return _0x4d4b47;}})[_0x9448('0x49')](function(_0x4d4786){logger[_0x9448('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d4786);throw _0x4d4786;});}return _0x4d4b47;})[_0x9448('0x28')](respondWithResult(_0x5e9f8f,0xc9))[_0x9448('0x49')](handleError(_0x5e9f8f,null));};exports[_0x9448('0x51')]=function(_0x2c2243,_0x351095){if(_0x2c2243[_0x9448('0x4b')]['id']){delete _0x2c2243[_0x9448('0x4b')]['id'];}return db[_0x9448('0x43')]['find']({'where':{'id':_0x2c2243[_0x9448('0x52')]['id']}})[_0x9448('0x28')](handleEntityNotFound(_0x351095,null))[_0x9448('0x28')](saveUpdates(_0x2c2243[_0x9448('0x4b')],null))[_0x9448('0x28')](respondWithResult(_0x351095,null))['catch'](handleError(_0x351095,null));};exports[_0x9448('0x27')]=function(_0x4e9f93,_0x16d889){return db[_0x9448('0x43')]['find']({'where':{'id':_0x4e9f93[_0x9448('0x52')]['id']}})[_0x9448('0x28')](handleEntityNotFound(_0x16d889,null))['then'](removeEntity(_0x16d889,null))[_0x9448('0x49')](handleError(_0x16d889,null));};exports[_0x9448('0x53')]=function(_0xaca87,_0x3468f4){return db[_0x9448('0x43')][_0x9448('0x53')]()[_0x9448('0x28')](respondWithResult(_0x3468f4,null))[_0x9448('0x49')](handleError(_0x3468f4,null));};exports['getMembers']=function(_0x48bd93,_0x29146c,_0x637e31){var _0x1dbcc4={'raw':!![],'where':{}},_0x2ca199={},_0x96f2e7;return db[_0x9448('0x43')][_0x9448('0x54')]({'where':{'id':_0x48bd93[_0x9448('0x52')]['id']}})[_0x9448('0x28')](handleEntityNotFound(_0x29146c,null))[_0x9448('0x28')](function(_0x38deb7){if(_0x38deb7){_0x96f2e7=_0x38deb7['get']({'plain':!![]});_0x2ca199[_0x9448('0x37')]=_[_0x9448('0x32')](db['UserMailQueue']['rawAttributes']);_0x2ca199['query']=_[_0x9448('0x32')](_0x48bd93[_0x9448('0x33')]);_0x2ca199['filters']=_[_0x9448('0x36')](_0x2ca199[_0x9448('0x37')],_0x2ca199[_0x9448('0x33')]);_0x1dbcc4[_0x9448('0x35')]=_['intersection'](_0x2ca199[_0x9448('0x37')],qs[_0x9448('0x38')](_0x48bd93[_0x9448('0x33')]['fields']));_0x1dbcc4[_0x9448('0x35')]=_0x1dbcc4['attributes'][_0x9448('0x39')]?_0x1dbcc4[_0x9448('0x35')]:_0x2ca199[_0x9448('0x37')];if(!_0x48bd93[_0x9448('0x33')][_0x9448('0x3a')](_0x9448('0x55'))){_0x1dbcc4[_0x9448('0x3b')]=qs['limit'](_0x48bd93[_0x9448('0x33')][_0x9448('0x3b')]);_0x1dbcc4[_0x9448('0x22')]=qs['offset'](_0x48bd93['query'][_0x9448('0x22')]);}_0x1dbcc4[_0x9448('0x3c')]=qs[_0x9448('0x56')](_0x48bd93['query']['sort']);_0x1dbcc4[_0x9448('0x3d')]=qs[_0x9448('0x34')](_['pick'](_0x48bd93[_0x9448('0x33')],_0x2ca199[_0x9448('0x34')]));_0x1dbcc4['where'][_0x9448('0x57')]=_0x38deb7['id'];if(_0x48bd93[_0x9448('0x33')][_0x9448('0x3f')]){_0x1dbcc4[_0x9448('0x3d')]=_[_0x9448('0x40')](_0x1dbcc4[_0x9448('0x3d')],{'$or':_['map'](_0x1dbcc4[_0x9448('0x35')],function(_0x2c0e38){var _0x1d547e={};_0x1d547e[_0x2c0e38]={'$like':'%'+_0x48bd93['query'][_0x9448('0x3f')]+'%'};return _0x1d547e;})});}_0x1dbcc4=_[_0x9448('0x40')]({},_0x1dbcc4,_0x48bd93[_0x9448('0x42')]);return db[_0x9448('0x58')][_0x9448('0x59')](_0x1dbcc4);}})[_0x9448('0x28')](function(_0x2ebc97){if(_0x2ebc97){return db[_0x9448('0x5a')]['findAndCountAll']({'where':{'id':_[_0x9448('0x30')](_0x2ebc97,_0x9448('0x5b')),'role':_0x9448('0x5c')},'attributes':['id',_0x9448('0x2d'),_0x9448('0x5d'),'updatedAt','createdAt']});}})[_0x9448('0x28')](function(_0x3753ce){if(_0x3753ce){return{'count':_0x3753ce[_0x9448('0x21')],'rows':_[_0x9448('0x30')](_0x3753ce[_0x9448('0x5e')],function(_0x341ca4){return{'membername':_0x341ca4[_0x9448('0x2d')],'UserId':_0x341ca4['id'],'queue_name':_0x96f2e7[_0x9448('0x2d')],'MailQueueId':_0x96f2e7['id'],'interface':util[_0x9448('0x5f')](_0x9448('0x60'),_0x9448('0x61'),_0x341ca4[_0x9448('0x2d')]),'penalty':0x0,'paused':_0x341ca4[_0x9448('0x5d')],'createdAt':_0x341ca4[_0x9448('0x62')],'updatedAt':_0x341ca4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9448('0x28')](respondWithFilteredResult(_0x29146c,_0x1dbcc4))['catch'](handleError(_0x29146c,null));};exports[_0x9448('0x63')]=function(_0x2910f3,_0x56c9ed,_0x44fc17){var _0x42aeec={};var _0x23bf8f={};var _0x2214e8;var _0x16be48;return db[_0x9448('0x43')][_0x9448('0x54')]({'where':{'id':_0x2910f3[_0x9448('0x52')]['id']}})[_0x9448('0x28')](handleEntityNotFound(_0x56c9ed,null))['then'](function(_0x29ca7f){if(_0x29ca7f){_0x2214e8=_0x29ca7f;_0x23bf8f[_0x9448('0x37')]=_[_0x9448('0x32')](db[_0x9448('0x64')][_0x9448('0x47')]);_0x23bf8f[_0x9448('0x33')]=_['keys'](_0x2910f3['query']);_0x23bf8f[_0x9448('0x34')]=_[_0x9448('0x36')](_0x23bf8f[_0x9448('0x37')],_0x23bf8f[_0x9448('0x33')]);_0x42aeec[_0x9448('0x35')]=_[_0x9448('0x36')](_0x23bf8f[_0x9448('0x37')],qs[_0x9448('0x38')](_0x2910f3[_0x9448('0x33')][_0x9448('0x38')]));_0x42aeec[_0x9448('0x35')]=_0x42aeec[_0x9448('0x35')][_0x9448('0x39')]?_0x42aeec['attributes']:_0x23bf8f[_0x9448('0x37')];_0x42aeec[_0x9448('0x3c')]=qs['sort'](_0x2910f3['query'][_0x9448('0x56')]);_0x42aeec[_0x9448('0x3d')]=qs['filters'](_[_0x9448('0x3e')](_0x2910f3['query'],_0x23bf8f[_0x9448('0x34')]));if(_0x2910f3[_0x9448('0x33')][_0x9448('0x3f')]){_0x42aeec[_0x9448('0x3d')]=_[_0x9448('0x40')](_0x42aeec['where'],{'$or':_[_0x9448('0x30')](_0x42aeec[_0x9448('0x35')],function(_0x70d739){var _0x500cfc={};_0x500cfc[_0x70d739]={'$like':'%'+_0x2910f3[_0x9448('0x33')][_0x9448('0x3f')]+'%'};return _0x500cfc;})});}_0x42aeec=_[_0x9448('0x40')]({},_0x42aeec,_0x2910f3[_0x9448('0x42')]);return _0x2214e8[_0x9448('0x63')](_0x42aeec);}})[_0x9448('0x28')](function(_0x61410e){if(_0x61410e){_0x16be48=_0x61410e[_0x9448('0x39')];if(!_0x2910f3[_0x9448('0x33')][_0x9448('0x3a')](_0x9448('0x55'))){_0x42aeec[_0x9448('0x3b')]=qs[_0x9448('0x3b')](_0x2910f3[_0x9448('0x33')][_0x9448('0x3b')]);_0x42aeec['offset']=qs[_0x9448('0x22')](_0x2910f3[_0x9448('0x33')][_0x9448('0x22')]);}return _0x2214e8['getTeams'](_0x42aeec);}})[_0x9448('0x28')](function(_0x2d8433){if(_0x2d8433){return _0x2d8433?{'count':_0x16be48,'rows':_0x2d8433}:null;}})['then'](respondWithResult(_0x56c9ed,null))[_0x9448('0x49')](handleError(_0x56c9ed,null));};exports[_0x9448('0x65')]=function(_0xa25908,_0x464d48,_0xd1fd04){var _0x142c5b=_0xa25908['body'][_0x9448('0x66')];return db[_0x9448('0x64')][_0x9448('0x59')]({'where':{'id':_0x142c5b},'attributes':['id'],'include':[{'model':db[_0x9448('0x5a')],'as':_0x9448('0x67'),'attributes':['id',_0x9448('0x2d'),_0x9448('0x68'),_0x9448('0x69'),'interface'],'raw':!![]}]})[_0x9448('0x28')](function(_0x19e5ac){if(_0x19e5ac){var _0x5925e5=_[_0x9448('0x6a')](_0x19e5ac,function(_0x385f37){var _0x289ca4=_0x385f37[_0x9448('0x29')]({'plain':!![]});return _0x289ca4[_0x9448('0x67')];});return db[_0x9448('0x43')]['find']({'where':{'id':_0xa25908[_0x9448('0x52')]['id']}})[_0x9448('0x28')](function(_0x3e6e7a){return db[_0x9448('0x6b')]['transaction'](function(_0x1b6880){return _0x3e6e7a[_0x9448('0x65')](_0x142c5b,{'transaction':_0x1b6880})[_0x9448('0x28')](function(){return BPromise[_0x9448('0x6c')](_0x5925e5,function(_0x2e5e4a){return db['UserMailQueue'][_0x9448('0x6d')]({'where':{'UserId':_0x2e5e4a['id'],'MailQueueId':_0xa25908['params']['id']},'transaction':_0x1b6880});});})['then'](function(){_0x5925e5['forEach'](function(_0x1ed3d0){socket[_0x9448('0x6e')](_0x9448('0x6f'),{'UserId':_0x1ed3d0['id'],'MailQueueId':_0x3e6e7a['id']});});});});});}})['then'](respondWithStatusCode(_0x464d48,null))[_0x9448('0x49')](handleError(_0x464d48,null));};exports[_0x9448('0x70')]=function(_0x1f8e3d,_0x19073f,_0x3e4a8a){return db[_0x9448('0x64')]['findAll']({'where':{'id':_0x1f8e3d[_0x9448('0x33')][_0x9448('0x66')]},'attributes':['id'],'include':[{'model':db[_0x9448('0x5a')],'as':_0x9448('0x67'),'attributes':['id'],'raw':!![]}]})[_0x9448('0x28')](handleEntityNotFound(_0x19073f,null))[_0x9448('0x28')](function(_0x22607b){var _0xcce800=_[_0x9448('0x30')](_0x22607b,'id');var _0x2fc6f3=[];var _0x26ace6=[];var _0x5fa546=squel[_0x9448('0x71')]();_0x5fa546[_0x9448('0x72')](_0x9448('0x73'))['from'](_0x9448('0x74'),'tq')[_0x9448('0x75')]('user_has_teams','ut',_0x9448('0x76'))[_0x9448('0x3d')](_0x9448('0x77'),_0x1f8e3d['params']['id']);for(var _0x442752=0x0;_0x442752<_0x22607b[_0x9448('0x39')];_0x442752+=0x1){let _0x55328d=_0x22607b[_0x442752];for(var _0x4c8c2d=0x0;_0x4c8c2d<_0x55328d[_0x9448('0x67')][_0x9448('0x39')];_0x4c8c2d+=0x1){let _0x2e4578=_0x55328d['Agents'][_0x4c8c2d];var _0x13c905=_0x5fa546[_0x9448('0x78')]();_0x13c905['where'](_0x9448('0x79'),_0x2e4578['id']);_0x26ace6[_0x9448('0x7a')](db[_0x9448('0x6b')][_0x9448('0x33')](_0x13c905[_0x9448('0x7b')](),{'type':db[_0x9448('0x6b')][_0x9448('0x7c')]['SELECT']})[_0x9448('0x28')](function(_0x214587){if(_0x214587['length']===0x1){return _0x2e4578['id'];}else{var _0x57a8bb=_['every'](_[_0x9448('0x30')](_0x214587,_0x9448('0x7d')),function(_0x424f8c){return _[_0x9448('0x7e')](_0xcce800,_0x424f8c);});if(_0x57a8bb){return _0x2e4578['id'];}}}));}}return BPromise[_0x9448('0x7f')](_0x26ace6)[_0x9448('0x28')](function(_0xe95160){_0x2fc6f3=_(_0x2fc6f3)['union'](_0xe95160)['compact']()[_0x9448('0x80')]();return db[_0x9448('0x43')][_0x9448('0x48')]({'where':{'id':_0x1f8e3d[_0x9448('0x52')]['id']}})[_0x9448('0x28')](function(_0x2cead0){return db[_0x9448('0x6b')]['transaction'](function(_0x1a0433){return _0x2cead0['removeTeams'](_0x1f8e3d[_0x9448('0x33')][_0x9448('0x66')],{'transaction':_0x1a0433})['then'](function(){if(!_[_0x9448('0x81')](_0x2fc6f3)){return _0x2cead0[_0x9448('0x82')](_0x2fc6f3,{'transaction':_0x1a0433});}})[_0x9448('0x28')](function(){_0x2fc6f3['forEach'](function(_0x144fca){socket[_0x9448('0x6e')](_0x9448('0x83'),{'UserId':_0x144fca,'MailQueueId':_0x2cead0['id']});});});});});});})[_0x9448('0x28')](respondWithStatusCode(_0x19073f,null))['catch'](handleError(_0x19073f,null));};exports[_0x9448('0x84')]=function(_0x46fe82,_0x5c0a3f,_0x3071be){return db[_0x9448('0x43')][_0x9448('0x48')]({'where':{'id':_0x46fe82[_0x9448('0x52')]['id']}})['then'](handleEntityNotFound(_0x5c0a3f,null))[_0x9448('0x28')](function(_0x548032){if(_0x548032){return _0x548032[_0x9448('0x84')](_0x46fe82['body'][_0x9448('0x66')],_[_0x9448('0x85')](_0x46fe82[_0x9448('0x4b')],[_0x9448('0x66'),'id'])||{})[_0x9448('0x86')](function(_0x5bac71){for(var _0xae239b=0x0;_0xae239b<_0x46fe82[_0x9448('0x4b')][_0x9448('0x66')]['length'];_0xae239b+=0x1){socket['emit'](_0x9448('0x6f'),{'UserId':_0x46fe82[_0x9448('0x4b')][_0x9448('0x66')][_0xae239b],'MailQueueId':_0x46fe82[_0x9448('0x52')]['id']});}return _0x5bac71;});}})[_0x9448('0x28')](respondWithResult(_0x5c0a3f,null))[_0x9448('0x49')](handleError(_0x5c0a3f,null));};exports[_0x9448('0x82')]=function(_0x5c4302,_0x32fa5f,_0x56f0ff){return db[_0x9448('0x43')][_0x9448('0x48')]({'where':{'id':_0x5c4302[_0x9448('0x52')]['id']}})[_0x9448('0x28')](handleEntityNotFound(_0x32fa5f,null))[_0x9448('0x28')](function(_0x1cdaee){if(_0x1cdaee){return _0x1cdaee[_0x9448('0x82')](_0x5c4302[_0x9448('0x33')]['ids'])[_0x9448('0x28')](function(){if(_['isArray'](_0x5c4302[_0x9448('0x33')][_0x9448('0x66')])){for(var _0x342b3e=0x0;_0x342b3e<_0x5c4302[_0x9448('0x33')]['ids'][_0x9448('0x39')];_0x342b3e+=0x1){socket[_0x9448('0x6e')](_0x9448('0x83'),{'UserId':Number(_0x5c4302[_0x9448('0x33')][_0x9448('0x66')][_0x342b3e]),'MailQueueId':Number(_0x5c4302[_0x9448('0x52')]['id'])});}}else{socket[_0x9448('0x6e')](_0x9448('0x83'),{'UserId':Number(_0x5c4302[_0x9448('0x33')][_0x9448('0x66')]),'MailQueueId':Number(_0x5c4302[_0x9448('0x52')]['id'])});}});}})[_0x9448('0x28')](respondWithStatusCode(_0x32fa5f,null))['catch'](handleError(_0x32fa5f,null));};exports[_0x9448('0x87')]=function(_0x3d9b11,_0x1c809d,_0x306e93){var _0x34327d={};var _0x5a8eb4={};var _0x34bcfa;var _0x3456b3;return db[_0x9448('0x43')]['findOne']({'where':{'id':_0x3d9b11['params']['id']}})[_0x9448('0x28')](handleEntityNotFound(_0x1c809d,null))[_0x9448('0x28')](function(_0x11a829){if(_0x11a829){_0x34bcfa=_0x11a829;_0x5a8eb4['model']=_['keys'](db[_0x9448('0x5a')][_0x9448('0x47')]);_0x5a8eb4['query']=_[_0x9448('0x32')](_0x3d9b11[_0x9448('0x33')]);_0x5a8eb4[_0x9448('0x34')]=_[_0x9448('0x36')](_0x5a8eb4[_0x9448('0x37')],_0x5a8eb4[_0x9448('0x33')]);_0x34327d[_0x9448('0x35')]=_[_0x9448('0x36')](_0x5a8eb4[_0x9448('0x37')],qs[_0x9448('0x38')](_0x3d9b11['query'][_0x9448('0x38')]));_0x34327d[_0x9448('0x35')]=_0x34327d[_0x9448('0x35')][_0x9448('0x39')]?_0x34327d[_0x9448('0x35')]:_0x5a8eb4[_0x9448('0x37')];_0x34327d['order']=qs[_0x9448('0x56')](_0x3d9b11[_0x9448('0x33')][_0x9448('0x56')]);_0x34327d[_0x9448('0x3d')]=qs['filters'](_[_0x9448('0x3e')](_0x3d9b11[_0x9448('0x33')],_0x5a8eb4[_0x9448('0x34')]));if(_0x3d9b11[_0x9448('0x33')][_0x9448('0x3f')]){_0x34327d['where']=_[_0x9448('0x40')](_0x34327d['where'],{'$or':_['map'](_0x34327d['attributes'],function(_0x137d68){var _0x16e7ee={};_0x16e7ee[_0x137d68]={'$like':'%'+_0x3d9b11[_0x9448('0x33')][_0x9448('0x3f')]+'%'};return _0x16e7ee;})});}_0x34327d=_[_0x9448('0x40')]({},_0x34327d,_0x3d9b11[_0x9448('0x42')]);return _0x34bcfa[_0x9448('0x87')](_0x34327d);}})[_0x9448('0x28')](function(_0xb634fc){if(_0xb634fc){_0x3456b3=_0xb634fc[_0x9448('0x39')];if(!_0x3d9b11[_0x9448('0x33')]['hasOwnProperty'](_0x9448('0x55'))){_0x34327d[_0x9448('0x3b')]=qs[_0x9448('0x3b')](_0x3d9b11[_0x9448('0x33')][_0x9448('0x3b')]);_0x34327d[_0x9448('0x22')]=qs[_0x9448('0x22')](_0x3d9b11['query'][_0x9448('0x22')]);}return _0x34bcfa[_0x9448('0x87')](_0x34327d);}})[_0x9448('0x28')](function(_0x3495c){if(_0x3495c){return _0x3495c?{'count':_0x3456b3,'rows':_0x3495c}:null;}})[_0x9448('0x28')](respondWithResult(_0x1c809d,null))['catch'](handleError(_0x1c809d,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 79f002e..1b48754 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 _0xa6fc=['events','setMaxListeners','save','emit','hook','exports'];(function(_0x4e8d87,_0x556219){var _0x2652c0=function(_0x59edf9){while(--_0x59edf9){_0x4e8d87['push'](_0x4e8d87['shift']());}};_0x2652c0(++_0x556219);}(_0xa6fc,0xd2));var _0xca6f=function(_0x29f223,_0x1c2f6f){_0x29f223=_0x29f223-0x0;var _0x54b7d0=_0xa6fc[_0x29f223];return _0x54b7d0;};'use strict';var EventEmitter=require(_0xca6f('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xca6f('0x1')](0x0);var events={'afterCreate':_0xca6f('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5020b5){return function(_0x51072c,_0xf57773,_0x2064b3){MailQueueEvents[_0xca6f('0x3')](_0x5020b5+':'+_0x51072c['id'],_0x51072c);MailQueueEvents[_0xca6f('0x3')](_0x5020b5,_0x51072c);_0x2064b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xca6f('0x4')](e,emitEvent(event));}}module[_0xca6f('0x5')]=MailQueueEvents; \ No newline at end of file +var _0x6747=['emit','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove'];(function(_0x57a840,_0x3ecf45){var _0x56768b=function(_0x8f000e){while(--_0x8f000e){_0x57a840['push'](_0x57a840['shift']());}};_0x56768b(++_0x3ecf45);}(_0x6747,0x1e3));var _0x7674=function(_0xe406e8,_0x2dbfd8){_0xe406e8=_0xe406e8-0x0;var _0x3f8fbe=_0x6747[_0xe406e8];return _0x3f8fbe;};'use strict';var EventEmitter=require(_0x7674('0x0'));var MailQueue=require(_0x7674('0x1'))['db'][_0x7674('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x7674('0x3')](0x0);var events={'afterCreate':_0x7674('0x4'),'afterUpdate':_0x7674('0x5'),'afterDestroy':_0x7674('0x6')};function emitEvent(_0xeb25aa){return function(_0x5de66f,_0x550944,_0x37b9f1){MailQueueEvents[_0x7674('0x7')](_0xeb25aa+':'+_0x5de66f['id'],_0x5de66f);MailQueueEvents['emit'](_0xeb25aa,_0x5de66f);_0x37b9f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x7674('0x8')](e,emitEvent(event));}}module[_0x7674('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 63faef6..7abdacb 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 _0x9a98=['./mailQueue.attributes','exports','MailQueue','mail_queues','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0x1830ec,_0x3130e0){var _0xa48591=function(_0x3976dd){while(--_0x3976dd){_0x1830ec['push'](_0x1830ec['shift']());}};_0xa48591(++_0x3130e0);}(_0x9a98,0x162));var _0x89a9=function(_0x1097ad,_0x1e357b){_0x1097ad=_0x1097ad-0x0;var _0x11ffcc=_0x9a98[_0x1097ad];return _0x11ffcc;};'use strict';var _=require('lodash');var util=require(_0x89a9('0x0'));var logger=require('../../config/logger')(_0x89a9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x89a9('0x2'));var fs=require('fs');var path=require(_0x89a9('0x3'));var rimraf=require(_0x89a9('0x4'));var config=require(_0x89a9('0x5'));var attributes=require(_0x89a9('0x6'));module[_0x89a9('0x7')]=function(_0x1bdad4,_0x25c697){return _0x1bdad4['define'](_0x89a9('0x8'),attributes,{'tableName':_0x89a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa488=['./mailQueue.attributes','exports','define','mail_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xcf5fc1,_0x59eedf){var _0x3290b7=function(_0x31fc6b){while(--_0x31fc6b){_0xcf5fc1['push'](_0xcf5fc1['shift']());}};_0x3290b7(++_0x59eedf);}(_0xa488,0x1e4));var _0x8a48=function(_0x5ae268,_0x4b3d90){_0x5ae268=_0x5ae268-0x0;var _0x3fea8b=_0xa488[_0x5ae268];return _0x3fea8b;};'use strict';var _=require(_0x8a48('0x0'));var util=require(_0x8a48('0x1'));var logger=require(_0x8a48('0x2'))('api');var moment=require(_0x8a48('0x3'));var BPromise=require(_0x8a48('0x4'));var rp=require(_0x8a48('0x5'));var fs=require('fs');var path=require(_0x8a48('0x6'));var rimraf=require(_0x8a48('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a48('0x8'));module[_0x8a48('0x9')]=function(_0x41470e,_0x2bcf40){return _0x41470e[_0x8a48('0xa')]('MailQueue',attributes,{'tableName':_0x8a48('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 200c177..37c9708 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 _0x68eb=['client','redis','defaults','socket.io-emitter','./mailQueue.socket','register','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','findAll','options','where','limit','include','map','model','attributes','MailQueue','find','raw','ShowMailQueue','lodash','util','randomstring','ioredis','../../config/logger','jayson/promise'];(function(_0x27dbfe,_0x52be07){var _0x473510=function(_0x52fae1){while(--_0x52fae1){_0x27dbfe['push'](_0x27dbfe['shift']());}};_0x473510(++_0x52be07);}(_0x68eb,0xd8));var _0xb68e=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x68eb[_0x819464];return _0x49dcc0;};'use strict';var _=require(_0xb68e('0x0'));var util=require(_0xb68e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb68e('0x2'));var fs=require('fs');var Redis=require(_0xb68e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb68e('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb68e('0x5'));var client=jayson[_0xb68e('0x6')]['http']({'port':0x232a});config[_0xb68e('0x7')]=_[_0xb68e('0x8')](config[_0xb68e('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xb68e('0x9'))(new Redis(config[_0xb68e('0x7')]));require(_0xb68e('0xa'))[_0xb68e('0xb')](socket);function respondWithRpcPromise(_0x6af6de,_0x3cef5a,_0x14dc9c){return new BPromise(function(_0x25a5fb,_0x445b3c){return client['request'](_0x6af6de,_0x14dc9c)[_0xb68e('0xc')](function(_0x548ba5){logger[_0xb68e('0xd')]('MailQueue,\x20%s,\x20%s',_0x3cef5a,_0xb68e('0xe'));logger[_0xb68e('0xf')](_0xb68e('0x10'),_0x3cef5a,_0xb68e('0xe'),JSON[_0xb68e('0x11')](_0x548ba5));if(_0x548ba5['error']){if(_0x548ba5[_0xb68e('0x12')][_0xb68e('0x13')]===0x1f4){logger[_0xb68e('0x12')]('MailQueue,\x20%s,\x20%s',_0x3cef5a,_0x548ba5['error'][_0xb68e('0x14')]);return _0x445b3c(_0x548ba5['error'][_0xb68e('0x14')]);}logger[_0xb68e('0x12')]('MailQueue,\x20%s,\x20%s',_0x3cef5a,_0x548ba5['error']['message']);return _0x25a5fb(_0x548ba5[_0xb68e('0x12')][_0xb68e('0x14')]);}else{logger[_0xb68e('0xd')](_0xb68e('0x15'),_0x3cef5a,_0xb68e('0xe'));_0x25a5fb(_0x548ba5[_0xb68e('0x16')][_0xb68e('0x14')]);}})[_0xb68e('0x17')](function(_0xc4476c){logger['error'](_0xb68e('0x15'),_0x3cef5a,_0xc4476c);_0x445b3c(_0xc4476c);});});}exports[_0xb68e('0x18')]=function(_0x2e474c){var _0x1ea62b=this;return new Promise(function(_0x451611,_0x5da275){return db['MailQueue'][_0xb68e('0x19')]({'raw':_0x2e474c[_0xb68e('0x1a')]?_0x2e474c[_0xb68e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2e474c[_0xb68e('0x1a')]?_0x2e474c[_0xb68e('0x1a')][_0xb68e('0x1b')]||null:null,'attributes':_0x2e474c[_0xb68e('0x1a')]?_0x2e474c['options']['attributes']||null:null,'limit':_0x2e474c[_0xb68e('0x1a')]?_0x2e474c[_0xb68e('0x1a')][_0xb68e('0x1c')]||null:null,'include':_0x2e474c[_0xb68e('0x1a')]?_0x2e474c[_0xb68e('0x1a')][_0xb68e('0x1d')]?_[_0xb68e('0x1e')](_0x2e474c[_0xb68e('0x1a')]['include'],function(_0x466dd3){return{'model':db[_0x466dd3[_0xb68e('0x1f')]],'as':_0x466dd3['as'],'attributes':_0x466dd3[_0xb68e('0x20')],'include':_0x466dd3[_0xb68e('0x1d')]?_[_0xb68e('0x1e')](_0x466dd3[_0xb68e('0x1d')],function(_0x25a9c9){return{'model':db[_0x25a9c9['model']],'as':_0x25a9c9['as'],'attributes':_0x25a9c9[_0xb68e('0x20')],'include':_0x25a9c9[_0xb68e('0x1d')]?_['map'](_0x25a9c9[_0xb68e('0x1d')],function(_0x28f372){return{'model':db[_0x28f372[_0xb68e('0x1f')]],'as':_0x28f372['as'],'attributes':_0x28f372[_0xb68e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb68e('0xc')](function(_0x3e2055){logger[_0xb68e('0xd')]('GetMailQueue',_0x2e474c);logger[_0xb68e('0xf')](_0xb68e('0x18'),_0x2e474c,JSON[_0xb68e('0x11')](_0x3e2055));_0x451611(_0x3e2055);})['catch'](function(_0xee7939){logger[_0xb68e('0x12')](_0xb68e('0x18'),_0xee7939[_0xb68e('0x14')],_0x2e474c);_0x5da275(_0x1ea62b[_0xb68e('0x12')](0x1f4,_0xee7939[_0xb68e('0x14')]));});});};exports['ShowMailQueue']=function(_0x2d6ff1){var _0x444b6d=this;return new Promise(function(_0x7a01a5,_0x15ecc7){return db[_0xb68e('0x21')][_0xb68e('0x22')]({'raw':_0x2d6ff1['options']?_0x2d6ff1[_0xb68e('0x1a')][_0xb68e('0x23')]===undefined?!![]:![]:!![],'where':_0x2d6ff1['options']?_0x2d6ff1[_0xb68e('0x1a')][_0xb68e('0x1b')]||null:null,'attributes':_0x2d6ff1[_0xb68e('0x1a')]?_0x2d6ff1['options'][_0xb68e('0x20')]||null:null,'include':_0x2d6ff1[_0xb68e('0x1a')]?_0x2d6ff1[_0xb68e('0x1a')][_0xb68e('0x1d')]?_[_0xb68e('0x1e')](_0x2d6ff1[_0xb68e('0x1a')][_0xb68e('0x1d')],function(_0x5cf6b5){return{'model':db[_0x5cf6b5[_0xb68e('0x1f')]],'as':_0x5cf6b5['as'],'attributes':_0x5cf6b5['attributes'],'include':_0x5cf6b5[_0xb68e('0x1d')]?_[_0xb68e('0x1e')](_0x5cf6b5['include'],function(_0x483bfa){return{'model':db[_0x483bfa[_0xb68e('0x1f')]],'as':_0x483bfa['as'],'attributes':_0x483bfa[_0xb68e('0x20')],'include':_0x483bfa[_0xb68e('0x1d')]?_['map'](_0x483bfa[_0xb68e('0x1d')],function(_0x55832b){return{'model':db[_0x55832b['model']],'as':_0x55832b['as'],'attributes':_0x55832b[_0xb68e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf6d7fe){logger[_0xb68e('0xd')]('ShowMailQueue',_0x2d6ff1);logger[_0xb68e('0xf')](_0xb68e('0x24'),_0x2d6ff1,JSON[_0xb68e('0x11')](_0xf6d7fe));_0x7a01a5(_0xf6d7fe);})[_0xb68e('0x17')](function(_0x22adc6){logger[_0xb68e('0x12')]('ShowMailQueue',_0x22adc6['message'],_0x2d6ff1);_0x15ecc7(_0x444b6d['error'](0x1f4,_0x22adc6[_0xb68e('0x14')]));});});}; \ No newline at end of file +var _0x746a=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./mailQueue.socket','register','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueue,\x20%s,\x20%s','message','info','result','GetMailQueue','MailQueue','findAll','raw','options','where','attributes','include','map','model','then','catch','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x373858,_0xd24b55){var _0x375ccb=function(_0x45c49f){while(--_0x45c49f){_0x373858['push'](_0x373858['shift']());}};_0x375ccb(++_0xd24b55);}(_0x746a,0x17f));var _0xa746=function(_0x32e03f,_0x5197b9){_0x32e03f=_0x32e03f-0x0;var _0x27b65a=_0x746a[_0x32e03f];return _0x27b65a;};'use strict';var _=require(_0xa746('0x0'));var util=require(_0xa746('0x1'));var moment=require(_0xa746('0x2'));var BPromise=require(_0xa746('0x3'));var rs=require(_0xa746('0x4'));var fs=require('fs');var Redis=require(_0xa746('0x5'));var db=require(_0xa746('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa746('0x7'))(_0xa746('0x8'));var config=require(_0xa746('0x9'));var jayson=require(_0xa746('0xa'));var client=jayson['client'][_0xa746('0xb')]({'port':0x232a});config[_0xa746('0xc')]=_['defaults'](config[_0xa746('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa746('0xc')]));require(_0xa746('0xd'))[_0xa746('0xe')](socket);function respondWithRpcPromise(_0x48840,_0x4e3ec8,_0x451085){return new BPromise(function(_0x4b277c,_0x138d9f){return client['request'](_0x48840,_0x451085)['then'](function(_0x1748a6){logger['info']('MailQueue,\x20%s,\x20%s',_0x4e3ec8,'request\x20sent');logger[_0xa746('0xf')](_0xa746('0x10'),_0x4e3ec8,_0xa746('0x11'),JSON[_0xa746('0x12')](_0x1748a6));if(_0x1748a6[_0xa746('0x13')]){if(_0x1748a6['error'][_0xa746('0x14')]===0x1f4){logger[_0xa746('0x13')](_0xa746('0x15'),_0x4e3ec8,_0x1748a6[_0xa746('0x13')][_0xa746('0x16')]);return _0x138d9f(_0x1748a6['error'][_0xa746('0x16')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x4e3ec8,_0x1748a6[_0xa746('0x13')]['message']);return _0x4b277c(_0x1748a6['error'][_0xa746('0x16')]);}else{logger[_0xa746('0x17')](_0xa746('0x15'),_0x4e3ec8,'request\x20sent');_0x4b277c(_0x1748a6[_0xa746('0x18')][_0xa746('0x16')]);}})['catch'](function(_0x1d4812){logger[_0xa746('0x13')](_0xa746('0x15'),_0x4e3ec8,_0x1d4812);_0x138d9f(_0x1d4812);});});}exports[_0xa746('0x19')]=function(_0x547d55){var _0x115320=this;return new Promise(function(_0x52b5f3,_0x4ef6d3){return db[_0xa746('0x1a')][_0xa746('0x1b')]({'raw':_0x547d55['options']?_0x547d55['options'][_0xa746('0x1c')]===undefined?!![]:![]:!![],'where':_0x547d55[_0xa746('0x1d')]?_0x547d55[_0xa746('0x1d')][_0xa746('0x1e')]||null:null,'attributes':_0x547d55[_0xa746('0x1d')]?_0x547d55['options'][_0xa746('0x1f')]||null:null,'limit':_0x547d55[_0xa746('0x1d')]?_0x547d55['options']['limit']||null:null,'include':_0x547d55[_0xa746('0x1d')]?_0x547d55[_0xa746('0x1d')][_0xa746('0x20')]?_[_0xa746('0x21')](_0x547d55[_0xa746('0x1d')][_0xa746('0x20')],function(_0x3b7062){return{'model':db[_0x3b7062[_0xa746('0x22')]],'as':_0x3b7062['as'],'attributes':_0x3b7062[_0xa746('0x1f')],'include':_0x3b7062[_0xa746('0x20')]?_['map'](_0x3b7062[_0xa746('0x20')],function(_0x5de285){return{'model':db[_0x5de285[_0xa746('0x22')]],'as':_0x5de285['as'],'attributes':_0x5de285[_0xa746('0x1f')],'include':_0x5de285[_0xa746('0x20')]?_[_0xa746('0x21')](_0x5de285['include'],function(_0x1e01a3){return{'model':db[_0x1e01a3[_0xa746('0x22')]],'as':_0x1e01a3['as'],'attributes':_0x1e01a3['attributes']};}):[]};}):[]};}):[]:[]})[_0xa746('0x23')](function(_0x5a989c){logger[_0xa746('0x17')](_0xa746('0x19'),_0x547d55);logger[_0xa746('0xf')](_0xa746('0x19'),_0x547d55,JSON[_0xa746('0x12')](_0x5a989c));_0x52b5f3(_0x5a989c);})[_0xa746('0x24')](function(_0x2b07eb){logger[_0xa746('0x13')](_0xa746('0x19'),_0x2b07eb[_0xa746('0x16')],_0x547d55);_0x4ef6d3(_0x115320[_0xa746('0x13')](0x1f4,_0x2b07eb[_0xa746('0x16')]));});});};exports[_0xa746('0x25')]=function(_0x3511fc){var _0x3c5100=this;return new Promise(function(_0x1bd0e2,_0x1e9008){return db['MailQueue'][_0xa746('0x26')]({'raw':_0x3511fc[_0xa746('0x1d')]?_0x3511fc[_0xa746('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3511fc[_0xa746('0x1d')]?_0x3511fc[_0xa746('0x1d')][_0xa746('0x1e')]||null:null,'attributes':_0x3511fc[_0xa746('0x1d')]?_0x3511fc[_0xa746('0x1d')][_0xa746('0x1f')]||null:null,'include':_0x3511fc[_0xa746('0x1d')]?_0x3511fc[_0xa746('0x1d')][_0xa746('0x20')]?_[_0xa746('0x21')](_0x3511fc['options'][_0xa746('0x20')],function(_0x247265){return{'model':db[_0x247265['model']],'as':_0x247265['as'],'attributes':_0x247265[_0xa746('0x1f')],'include':_0x247265[_0xa746('0x20')]?_[_0xa746('0x21')](_0x247265[_0xa746('0x20')],function(_0x43e948){return{'model':db[_0x43e948[_0xa746('0x22')]],'as':_0x43e948['as'],'attributes':_0x43e948['attributes'],'include':_0x43e948[_0xa746('0x20')]?_['map'](_0x43e948['include'],function(_0x3e151d){return{'model':db[_0x3e151d[_0xa746('0x22')]],'as':_0x3e151d['as'],'attributes':_0x3e151d[_0xa746('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xa746('0x23')](function(_0xaa9d6c){logger[_0xa746('0x17')](_0xa746('0x25'),_0x3511fc);logger[_0xa746('0xf')](_0xa746('0x25'),_0x3511fc,JSON['stringify'](_0xaa9d6c));_0x1bd0e2(_0xaa9d6c);})[_0xa746('0x24')](function(_0x408406){logger[_0xa746('0x13')]('ShowMailQueue',_0x408406[_0xa746('0x16')],_0x3511fc);_0x1e9008(_0x3c5100['error'](0x1f4,_0x408406[_0xa746('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3b2d26f..57e6d42 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 _0x9893=['update','register','mailQueue:','./mailQueue.events','save'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9893,0xc6));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';var MailQueueEvents=require(_0x3989('0x0'));var events=[_0x3989('0x1'),'remove',_0x3989('0x2')];function createListener(_0x5d93d6,_0x5aa84a){return function(_0x51d89f){_0x5aa84a['emit'](_0x5d93d6,_0x51d89f);};}function removeListener(_0x266056,_0x55dae0){return function(){MailQueueEvents['removeListener'](_0x266056,_0x55dae0);};}exports[_0x3989('0x3')]=function(_0x2b968f){for(var _0x2a6123=0x0,_0x1e7885=events['length'];_0x2a6123<_0x1e7885;_0x2a6123++){var _0x5b1fa3=events[_0x2a6123];var _0x4c9c94=createListener(_0x3989('0x4')+_0x5b1fa3,_0x2b968f);MailQueueEvents['on'](_0x5b1fa3,_0x4c9c94);}}; \ No newline at end of file +var _0x3a2f=['save','remove','emit','removeListener','register','length','mailQueue:','./mailQueue.events'];(function(_0x4507bf,_0x331806){var _0x31e578=function(_0x5315ff){while(--_0x5315ff){_0x4507bf['push'](_0x4507bf['shift']());}};_0x31e578(++_0x331806);}(_0x3a2f,0x16f));var _0xf3a2=function(_0x4273bc,_0x728a4b){_0x4273bc=_0x4273bc-0x0;var _0x3526c5=_0x3a2f[_0x4273bc];return _0x3526c5;};'use strict';var MailQueueEvents=require(_0xf3a2('0x0'));var events=[_0xf3a2('0x1'),_0xf3a2('0x2'),'update'];function createListener(_0x84615a,_0x3bccb3){return function(_0x1bba06){_0x3bccb3[_0xf3a2('0x3')](_0x84615a,_0x1bba06);};}function removeListener(_0x306f25,_0x48f090){return function(){MailQueueEvents[_0xf3a2('0x4')](_0x306f25,_0x48f090);};}exports[_0xf3a2('0x5')]=function(_0x45b21c){for(var _0x1f37f5=0x0,_0x14f572=events[_0xf3a2('0x6')];_0x1f37f5<_0x14f572;_0x1f37f5++){var _0x340901=events[_0x1f37f5];var _0x1605c5=createListener(_0xf3a2('0x7')+_0x340901,_0x45b21c);MailQueueEvents['on'](_0x340901,_0x1605c5);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ba7aaa7..342ec59 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 _0x4a0f=['isAuthenticated','index','/describe','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueueReport.controller'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x4a0f,0x187));var _0xf4a0=function(_0x9f8606,_0x4451d0){_0x9f8606=_0x9f8606-0x0;var _0x44f240=_0x4a0f[_0x9f8606];return _0x44f240;};'use strict';var multer=require(_0xf4a0('0x0'));var util=require(_0xf4a0('0x1'));var path=require(_0xf4a0('0x2'));var timeout=require(_0xf4a0('0x3'));var express=require(_0xf4a0('0x4'));var router=express['Router']();var auth=require(_0xf4a0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf4a0('0x6'));var controller=require(_0xf4a0('0x7'));router['get']('/',auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x9')]);router['get'](_0xf4a0('0xa'),auth[_0xf4a0('0x8')](),controller['describe']);router[_0xf4a0('0xb')](_0xf4a0('0xc'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0xd')]);router[_0xf4a0('0xe')]('/',auth[_0xf4a0('0x8')](),controller[_0xf4a0('0xf')]);router[_0xf4a0('0x10')](_0xf4a0('0xc'),auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x11')]);router[_0xf4a0('0x12')]('/:id',auth[_0xf4a0('0x8')](),controller[_0xf4a0('0x13')]);module[_0xf4a0('0x14')]=router; \ No newline at end of file +var _0xfa1c=['describe','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util','express','Router','../../config/environment','get'];(function(_0xf9f7db,_0x1d6720){var _0x4a11e6=function(_0x5938cb){while(--_0x5938cb){_0xf9f7db['push'](_0xf9f7db['shift']());}};_0x4a11e6(++_0x1d6720);}(_0xfa1c,0xf9));var _0xcfa1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa1c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcfa1('0x0'));var util=require(_0xcfa1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcfa1('0x2'));var router=express[_0xcfa1('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcfa1('0x4'));var controller=require('./mailQueueReport.controller');router[_0xcfa1('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xcfa1('0x6')]);router[_0xcfa1('0x5')](_0xcfa1('0x7'),auth[_0xcfa1('0x8')](),controller[_0xcfa1('0x9')]);router[_0xcfa1('0xa')]('/',auth[_0xcfa1('0x8')](),controller[_0xcfa1('0xb')]);router[_0xcfa1('0xc')]('/:id',auth[_0xcfa1('0x8')](),controller['update']);router[_0xcfa1('0xd')](_0xcfa1('0x7'),auth[_0xcfa1('0x8')](),controller['destroy']);module[_0xcfa1('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 12c8cb7..6544563 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 _0x11a1=['exports','STRING','DATE','sequelize'];(function(_0x4145f6,_0xe5d514){var _0x38cbcf=function(_0x17866b){while(--_0x17866b){_0x4145f6['push'](_0x4145f6['shift']());}};_0x38cbcf(++_0xe5d514);}(_0x11a1,0x10b));var _0x111a=function(_0x26f1a0,_0x235ed1){_0x26f1a0=_0x26f1a0-0x0;var _0x3e22c0=_0x11a1[_0x26f1a0];return _0x3e22c0;};'use strict';var moment=require('moment');var Sequelize=require(_0x111a('0x0'));module[_0x111a('0x1')]={'uniqueid':{'type':Sequelize[_0x111a('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x111a('0x3')]},'leaveAt':{'type':Sequelize[_0x111a('0x3')]},'acceptAt':{'type':Sequelize[_0x111a('0x3')]},'exitAt':{'type':Sequelize[_0x111a('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x202b=['exports','STRING','DATE','sequelize'];(function(_0x44733d,_0x14e870){var _0x27b98d=function(_0x419c68){while(--_0x419c68){_0x44733d['push'](_0x44733d['shift']());}};_0x27b98d(++_0x14e870);}(_0x202b,0x16b));var _0xb202=function(_0x32ca2e,_0x49e777){_0x32ca2e=_0x32ca2e-0x0;var _0x446941=_0x202b[_0x32ca2e];return _0x446941;};'use strict';var moment=require('moment');var Sequelize=require(_0xb202('0x0'));module[_0xb202('0x1')]={'uniqueid':{'type':Sequelize[_0xb202('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xb202('0x2')]},'joinAt':{'type':Sequelize[_0xb202('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb202('0x3')]},'exitAt':{'type':Sequelize[_0xb202('0x3')]},'reason':{'type':Sequelize[_0xb202('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e993b2a..98a644a 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 _0x6631=['includeAll','include','findAll','rows','catch','show','params','length','create','body','find','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','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','MailQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','options'];(function(_0x342299,_0x307e1c){var _0xf1dfd2=function(_0x1be4f0){while(--_0x1be4f0){_0x342299['push'](_0x342299['shift']());}};_0xf1dfd2(++_0x307e1c);}(_0x6631,0x134));var _0x1663=function(_0x43d5d3,_0x40c53c){_0x43d5d3=_0x43d5d3-0x0;var _0x5c91fd=_0x6631[_0x43d5d3];return _0x5c91fd;};'use strict';var pdf=require(_0x1663('0x0'));var emlformat=require(_0x1663('0x1'));var rimraf=require(_0x1663('0x2'));var zipdir=require(_0x1663('0x3'));var jsonpatch=require(_0x1663('0x4'));var rp=require(_0x1663('0x5'));var moment=require('moment');var BPromise=require(_0x1663('0x6'));var Mustache=require(_0x1663('0x7'));var util=require(_0x1663('0x8'));var path=require(_0x1663('0x9'));var sox=require(_0x1663('0xa'));var csv=require(_0x1663('0xb'));var ejs=require(_0x1663('0xc'));var fs=require('fs');var _=require(_0x1663('0xd'));var squel=require(_0x1663('0xe'));var crypto=require(_0x1663('0xf'));var jsforce=require(_0x1663('0x10'));var deskjs=require(_0x1663('0x11'));var toCsv=require(_0x1663('0xb'));var querystring=require('querystring');var Papa=require(_0x1663('0x12'));var Redis=require('ioredis');var authService=require(_0x1663('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1663('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1663('0x15'))(_0x1663('0x16'));var utils=require(_0x1663('0x17'));var config=require(_0x1663('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f828a,_0x204ace){_0x204ace=_0x204ace||0xcc;return function(_0x196fa7){if(_0x196fa7){return _0x3f828a['sendStatus'](_0x204ace);}return _0x3f828a['status'](_0x204ace)[_0x1663('0x19')]();};}function respondWithResult(_0x23417f,_0x57a482){_0x57a482=_0x57a482||0xc8;return function(_0xc839b9){if(_0xc839b9){return _0x23417f[_0x1663('0x1a')](_0x57a482)[_0x1663('0x1b')](_0xc839b9);}};}function respondWithFilteredResult(_0x354e28,_0x180f82){return function(_0x202a40){if(_0x202a40){var _0x26e925=_0x202a40['count'],_0x30598b=_0x180f82[_0x1663('0x1c')],_0x4b3d58=_0x180f82['offset']+_0x180f82[_0x1663('0x1d')],_0x5103a8;if(_0x4b3d58>=_0x26e925){_0x4b3d58=_0x26e925;_0x5103a8=0xc8;}else{_0x5103a8=0xce;}_0x354e28[_0x1663('0x1a')](_0x5103a8);return _0x354e28[_0x1663('0x1e')](_0x1663('0x1f'),_0x30598b+'-'+_0x4b3d58+'/'+_0x26e925)[_0x1663('0x1b')](_0x202a40);}return null;};}function patchUpdates(_0x1f4943){return function(_0x4853b2){try{jsonpatch[_0x1663('0x20')](_0x4853b2,_0x1f4943,!![]);}catch(_0xc88e88){return BPromise[_0x1663('0x21')](_0xc88e88);}return _0x4853b2[_0x1663('0x22')]();};}function saveUpdates(_0x5b27b4,_0x13a3b6){return function(_0x2b8e2d){if(_0x2b8e2d){return _0x2b8e2d[_0x1663('0x23')](_0x5b27b4)['then'](function(_0x59bbc5){return _0x59bbc5;});}return null;};}function removeEntity(_0x238882,_0x47be55){return function(_0x397898){if(_0x397898){return _0x397898[_0x1663('0x24')]()[_0x1663('0x25')](function(){_0x238882['status'](0xcc)[_0x1663('0x19')]();});}};}function handleEntityNotFound(_0xfdf8f0,_0x47257a){return function(_0x4357cf){if(!_0x4357cf){_0xfdf8f0[_0x1663('0x26')](0x194);}return _0x4357cf;};}function handleError(_0x47121c,_0x9cab46){_0x9cab46=_0x9cab46||0x1f4;return function(_0x3980d9){logger['error'](_0x3980d9[_0x1663('0x27')]);if(_0x3980d9[_0x1663('0x28')]){delete _0x3980d9[_0x1663('0x28')];}_0x47121c[_0x1663('0x1a')](_0x9cab46)[_0x1663('0x29')](_0x3980d9);};}exports['index']=function(_0x4e3aa0,_0x470e0d){var _0x8bc641={},_0x42a5bf={},_0xe7127e={'count':0x0,'rows':[]};var _0xb81776=_[_0x1663('0x2a')](db[_0x1663('0x2b')][_0x1663('0x2c')],function(_0x5efc5d){return{'name':_0x5efc5d[_0x1663('0x2d')],'type':_0x5efc5d[_0x1663('0x2e')][_0x1663('0x2f')]};});_0x42a5bf[_0x1663('0x30')]=_[_0x1663('0x2a')](_0xb81776,_0x1663('0x28'));_0x42a5bf['query']=_[_0x1663('0x31')](_0x4e3aa0[_0x1663('0x32')]);_0x42a5bf[_0x1663('0x33')]=_['intersection'](_0x42a5bf[_0x1663('0x30')],_0x42a5bf[_0x1663('0x32')]);_0x8bc641[_0x1663('0x34')]=_[_0x1663('0x35')](_0x42a5bf[_0x1663('0x30')],qs[_0x1663('0x36')](_0x4e3aa0[_0x1663('0x32')][_0x1663('0x36')]));_0x8bc641[_0x1663('0x34')]=_0x8bc641[_0x1663('0x34')]['length']?_0x8bc641['attributes']:_0x42a5bf[_0x1663('0x30')];if(!_0x4e3aa0[_0x1663('0x32')][_0x1663('0x37')]('nolimit')){_0x8bc641['limit']=qs['limit'](_0x4e3aa0['query']['limit']);_0x8bc641[_0x1663('0x1c')]=qs[_0x1663('0x1c')](_0x4e3aa0[_0x1663('0x32')][_0x1663('0x1c')]);}_0x8bc641['order']=qs[_0x1663('0x38')](_0x4e3aa0[_0x1663('0x32')][_0x1663('0x38')]);_0x8bc641[_0x1663('0x39')]=qs[_0x1663('0x33')](_[_0x1663('0x3a')](_0x4e3aa0[_0x1663('0x32')],_0x42a5bf['filters']),_0xb81776);if(_0x4e3aa0['query'][_0x1663('0x3b')]){_0x8bc641[_0x1663('0x39')]=_[_0x1663('0x3c')](_0x8bc641[_0x1663('0x39')],{'$or':_[_0x1663('0x2a')](_0xb81776,function(_0x648ca1){if(_0x648ca1[_0x1663('0x2e')]!=='VIRTUAL'){var _0x59c935={};_0x59c935[_0x648ca1['name']]={'$like':'%'+_0x4e3aa0[_0x1663('0x32')][_0x1663('0x3b')]+'%'};return _0x59c935;}})});}_0x8bc641=_['merge']({},_0x8bc641,_0x4e3aa0[_0x1663('0x3d')]);var _0x34b52e={'where':_0x8bc641[_0x1663('0x39')]};return db[_0x1663('0x2b')]['count'](_0x34b52e)['then'](function(_0x24710b){_0xe7127e['count']=_0x24710b;if(_0x4e3aa0['query'][_0x1663('0x3e')]){_0x8bc641[_0x1663('0x3f')]=[{'all':!![]}];}return db[_0x1663('0x2b')][_0x1663('0x40')](_0x8bc641);})['then'](function(_0x4ae98b){_0xe7127e[_0x1663('0x41')]=_0x4ae98b;return _0xe7127e;})[_0x1663('0x25')](respondWithFilteredResult(_0x470e0d,_0x8bc641))[_0x1663('0x42')](handleError(_0x470e0d,null));};exports[_0x1663('0x43')]=function(_0x4674c0,_0x426717){var _0x50ed91={'raw':!![],'where':{'id':_0x4674c0[_0x1663('0x44')]['id']}},_0x304765={};_0x304765['model']=_[_0x1663('0x31')](db[_0x1663('0x2b')][_0x1663('0x2c')]);_0x304765[_0x1663('0x32')]=_[_0x1663('0x31')](_0x4674c0[_0x1663('0x32')]);_0x304765[_0x1663('0x33')]=_[_0x1663('0x35')](_0x304765[_0x1663('0x30')],_0x304765[_0x1663('0x32')]);_0x50ed91[_0x1663('0x34')]=_[_0x1663('0x35')](_0x304765[_0x1663('0x30')],qs['fields'](_0x4674c0['query'][_0x1663('0x36')]));_0x50ed91[_0x1663('0x34')]=_0x50ed91[_0x1663('0x34')][_0x1663('0x45')]?_0x50ed91[_0x1663('0x34')]:_0x304765[_0x1663('0x30')];if(_0x4674c0[_0x1663('0x32')][_0x1663('0x3e')]){_0x50ed91['include']=[{'all':!![]}];}_0x50ed91=_[_0x1663('0x3c')]({},_0x50ed91,_0x4674c0[_0x1663('0x3d')]);return db[_0x1663('0x2b')]['find'](_0x50ed91)[_0x1663('0x25')](handleEntityNotFound(_0x426717,null))[_0x1663('0x25')](respondWithResult(_0x426717,null))[_0x1663('0x42')](handleError(_0x426717,null));};exports[_0x1663('0x46')]=function(_0x3dc45c,_0x11020){return db[_0x1663('0x2b')][_0x1663('0x46')](_0x3dc45c['body'],{})['then'](respondWithResult(_0x11020,0xc9))['catch'](handleError(_0x11020,null));};exports[_0x1663('0x23')]=function(_0x16ac82,_0x1e7500){if(_0x16ac82[_0x1663('0x47')]['id']){delete _0x16ac82['body']['id'];}return db[_0x1663('0x2b')]['find']({'where':{'id':_0x16ac82['params']['id']}})[_0x1663('0x25')](handleEntityNotFound(_0x1e7500,null))['then'](saveUpdates(_0x16ac82[_0x1663('0x47')],null))['then'](respondWithResult(_0x1e7500,null))[_0x1663('0x42')](handleError(_0x1e7500,null));};exports['destroy']=function(_0x2d1381,_0x3766c5){return db['MailQueueReport'][_0x1663('0x48')]({'where':{'id':_0x2d1381[_0x1663('0x44')]['id']}})[_0x1663('0x25')](handleEntityNotFound(_0x3766c5,null))[_0x1663('0x25')](removeEntity(_0x3766c5,null))[_0x1663('0x42')](handleError(_0x3766c5,null));};exports[_0x1663('0x49')]=function(_0x165660,_0x5332cf){return db[_0x1663('0x2b')][_0x1663('0x49')]()['then'](respondWithResult(_0x5332cf,null))[_0x1663('0x42')](handleError(_0x5332cf,null));}; \ No newline at end of file +var _0x3841=['find','catch','create','body','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','path','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','count','offset','limit','Content-Range','json','save','update','then','destroy','stack','name','send','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','findAll','rows','show','params','rawAttributes','includeAll'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3841,0x1da));var _0x1384=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0x3841[_0x9cfe28];return _0x54a1d0;};'use strict';var pdf=require(_0x1384('0x0'));var emlformat=require(_0x1384('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1384('0x2'));var rp=require('request-promise');var moment=require(_0x1384('0x3'));var BPromise=require(_0x1384('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1384('0x5'));var sox=require('sox');var csv=require(_0x1384('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1384('0x7'));var crypto=require(_0x1384('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x1384('0x9'));var toCsv=require(_0x1384('0x6'));var querystring=require(_0x1384('0xa'));var Papa=require(_0x1384('0xb'));var Redis=require('ioredis');var authService=require(_0x1384('0xc'));var qs=require(_0x1384('0xd'));var as=require(_0x1384('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1384('0xf'))(_0x1384('0x10'));var utils=require(_0x1384('0x11'));var config=require(_0x1384('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x583c01,_0x39ec5a){_0x39ec5a=_0x39ec5a||0xcc;return function(_0xb7fa66){if(_0xb7fa66){return _0x583c01[_0x1384('0x13')](_0x39ec5a);}return _0x583c01['status'](_0x39ec5a)[_0x1384('0x14')]();};}function respondWithResult(_0x5cb329,_0x30f2d9){_0x30f2d9=_0x30f2d9||0xc8;return function(_0x467b62){if(_0x467b62){return _0x5cb329[_0x1384('0x15')](_0x30f2d9)['json'](_0x467b62);}};}function respondWithFilteredResult(_0x11aabe,_0x5bd7c0){return function(_0x11e914){if(_0x11e914){var _0x42e293=_0x11e914[_0x1384('0x16')],_0x5a3c3e=_0x5bd7c0[_0x1384('0x17')],_0x5d7d7d=_0x5bd7c0[_0x1384('0x17')]+_0x5bd7c0[_0x1384('0x18')],_0x568feb;if(_0x5d7d7d>=_0x42e293){_0x5d7d7d=_0x42e293;_0x568feb=0xc8;}else{_0x568feb=0xce;}_0x11aabe['status'](_0x568feb);return _0x11aabe['set'](_0x1384('0x19'),_0x5a3c3e+'-'+_0x5d7d7d+'/'+_0x42e293)[_0x1384('0x1a')](_0x11e914);}return null;};}function patchUpdates(_0x9f912d){return function(_0x5195b6){try{jsonpatch['apply'](_0x5195b6,_0x9f912d,!![]);}catch(_0xc73ba0){return BPromise['reject'](_0xc73ba0);}return _0x5195b6[_0x1384('0x1b')]();};}function saveUpdates(_0x118c6b,_0x23f4e1){return function(_0x24ffa4){if(_0x24ffa4){return _0x24ffa4[_0x1384('0x1c')](_0x118c6b)[_0x1384('0x1d')](function(_0x12a9c9){return _0x12a9c9;});}return null;};}function removeEntity(_0x1a915c,_0xf9fd06){return function(_0x327887){if(_0x327887){return _0x327887[_0x1384('0x1e')]()[_0x1384('0x1d')](function(){_0x1a915c[_0x1384('0x15')](0xcc)[_0x1384('0x14')]();});}};}function handleEntityNotFound(_0x497f51,_0x5b6ee2){return function(_0x14491b){if(!_0x14491b){_0x497f51[_0x1384('0x13')](0x194);}return _0x14491b;};}function handleError(_0x1020cb,_0x37b20e){_0x37b20e=_0x37b20e||0x1f4;return function(_0x47da02){logger['error'](_0x47da02[_0x1384('0x1f')]);if(_0x47da02[_0x1384('0x20')]){delete _0x47da02[_0x1384('0x20')];}_0x1020cb[_0x1384('0x15')](_0x37b20e)[_0x1384('0x21')](_0x47da02);};}exports['index']=function(_0x374ba4,_0x1fe024){var _0x29c2d4={},_0x24eb4f={},_0x4e51eb={'count':0x0,'rows':[]};var _0x54a007=_[_0x1384('0x22')](db['MailQueueReport']['rawAttributes'],function(_0x33c782){return{'name':_0x33c782[_0x1384('0x23')],'type':_0x33c782[_0x1384('0x24')][_0x1384('0x25')]};});_0x24eb4f[_0x1384('0x26')]=_[_0x1384('0x22')](_0x54a007,_0x1384('0x20'));_0x24eb4f['query']=_[_0x1384('0x27')](_0x374ba4[_0x1384('0x28')]);_0x24eb4f[_0x1384('0x29')]=_[_0x1384('0x2a')](_0x24eb4f[_0x1384('0x26')],_0x24eb4f['query']);_0x29c2d4[_0x1384('0x2b')]=_['intersection'](_0x24eb4f['model'],qs[_0x1384('0x2c')](_0x374ba4[_0x1384('0x28')][_0x1384('0x2c')]));_0x29c2d4[_0x1384('0x2b')]=_0x29c2d4[_0x1384('0x2b')][_0x1384('0x2d')]?_0x29c2d4['attributes']:_0x24eb4f['model'];if(!_0x374ba4[_0x1384('0x28')][_0x1384('0x2e')]('nolimit')){_0x29c2d4[_0x1384('0x18')]=qs[_0x1384('0x18')](_0x374ba4[_0x1384('0x28')][_0x1384('0x18')]);_0x29c2d4[_0x1384('0x17')]=qs['offset'](_0x374ba4[_0x1384('0x28')][_0x1384('0x17')]);}_0x29c2d4[_0x1384('0x2f')]=qs[_0x1384('0x30')](_0x374ba4[_0x1384('0x28')][_0x1384('0x30')]);_0x29c2d4[_0x1384('0x31')]=qs['filters'](_[_0x1384('0x32')](_0x374ba4[_0x1384('0x28')],_0x24eb4f[_0x1384('0x29')]),_0x54a007);if(_0x374ba4[_0x1384('0x28')][_0x1384('0x33')]){_0x29c2d4[_0x1384('0x31')]=_[_0x1384('0x34')](_0x29c2d4[_0x1384('0x31')],{'$or':_[_0x1384('0x22')](_0x54a007,function(_0x331753){if(_0x331753[_0x1384('0x24')]!==_0x1384('0x35')){var _0x200ddb={};_0x200ddb[_0x331753[_0x1384('0x20')]]={'$like':'%'+_0x374ba4[_0x1384('0x28')][_0x1384('0x33')]+'%'};return _0x200ddb;}})});}_0x29c2d4=_[_0x1384('0x34')]({},_0x29c2d4,_0x374ba4[_0x1384('0x36')]);var _0x18f89d={'where':_0x29c2d4[_0x1384('0x31')]};return db[_0x1384('0x37')][_0x1384('0x16')](_0x18f89d)[_0x1384('0x1d')](function(_0x253995){_0x4e51eb[_0x1384('0x16')]=_0x253995;if(_0x374ba4[_0x1384('0x28')]['includeAll']){_0x29c2d4['include']=[{'all':!![]}];}return db['MailQueueReport'][_0x1384('0x38')](_0x29c2d4);})[_0x1384('0x1d')](function(_0x316316){_0x4e51eb[_0x1384('0x39')]=_0x316316;return _0x4e51eb;})[_0x1384('0x1d')](respondWithFilteredResult(_0x1fe024,_0x29c2d4))['catch'](handleError(_0x1fe024,null));};exports[_0x1384('0x3a')]=function(_0x414ea9,_0x524815){var _0x2ba170={'raw':!![],'where':{'id':_0x414ea9[_0x1384('0x3b')]['id']}},_0x2b7da1={};_0x2b7da1['model']=_[_0x1384('0x27')](db[_0x1384('0x37')][_0x1384('0x3c')]);_0x2b7da1[_0x1384('0x28')]=_[_0x1384('0x27')](_0x414ea9[_0x1384('0x28')]);_0x2b7da1[_0x1384('0x29')]=_['intersection'](_0x2b7da1['model'],_0x2b7da1[_0x1384('0x28')]);_0x2ba170[_0x1384('0x2b')]=_['intersection'](_0x2b7da1[_0x1384('0x26')],qs[_0x1384('0x2c')](_0x414ea9['query']['fields']));_0x2ba170['attributes']=_0x2ba170[_0x1384('0x2b')][_0x1384('0x2d')]?_0x2ba170[_0x1384('0x2b')]:_0x2b7da1['model'];if(_0x414ea9[_0x1384('0x28')][_0x1384('0x3d')]){_0x2ba170['include']=[{'all':!![]}];}_0x2ba170=_['merge']({},_0x2ba170,_0x414ea9[_0x1384('0x36')]);return db[_0x1384('0x37')][_0x1384('0x3e')](_0x2ba170)['then'](handleEntityNotFound(_0x524815,null))[_0x1384('0x1d')](respondWithResult(_0x524815,null))[_0x1384('0x3f')](handleError(_0x524815,null));};exports[_0x1384('0x40')]=function(_0x1ba845,_0x259552){return db['MailQueueReport'][_0x1384('0x40')](_0x1ba845['body'],{})[_0x1384('0x1d')](respondWithResult(_0x259552,0xc9))['catch'](handleError(_0x259552,null));};exports[_0x1384('0x1c')]=function(_0x1a69c4,_0x44c16c){if(_0x1a69c4[_0x1384('0x41')]['id']){delete _0x1a69c4['body']['id'];}return db[_0x1384('0x37')][_0x1384('0x3e')]({'where':{'id':_0x1a69c4[_0x1384('0x3b')]['id']}})[_0x1384('0x1d')](handleEntityNotFound(_0x44c16c,null))[_0x1384('0x1d')](saveUpdates(_0x1a69c4[_0x1384('0x41')],null))[_0x1384('0x1d')](respondWithResult(_0x44c16c,null))['catch'](handleError(_0x44c16c,null));};exports[_0x1384('0x1e')]=function(_0xaa097c,_0x20cb17){return db[_0x1384('0x37')]['find']({'where':{'id':_0xaa097c[_0x1384('0x3b')]['id']}})['then'](handleEntityNotFound(_0x20cb17,null))['then'](removeEntity(_0x20cb17,null))['catch'](handleError(_0x20cb17,null));};exports[_0x1384('0x42')]=function(_0x4c2d36,_0x56d40b){return db[_0x1384('0x37')][_0x1384('0x42')]()[_0x1384('0x1d')](respondWithResult(_0x56d40b,null))[_0x1384('0x3f')](handleError(_0x56d40b,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 32a1700..b0be7d3 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 _0xbb35=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util'];(function(_0x3f100c,_0x4c6397){var _0x274271=function(_0x1d8604){while(--_0x1d8604){_0x3f100c['push'](_0x3f100c['shift']());}};_0x274271(++_0x4c6397);}(_0xbb35,0x1d3));var _0x5bb3=function(_0x263c44,_0x3c075d){_0x263c44=_0x263c44-0x0;var _0x32c684=_0xbb35[_0x263c44];return _0x32c684;};'use strict';var _=require('lodash');var util=require(_0x5bb3('0x0'));var logger=require(_0x5bb3('0x1'))(_0x5bb3('0x2'));var moment=require(_0x5bb3('0x3'));var BPromise=require(_0x5bb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5bb3('0x5'));var rimraf=require(_0x5bb3('0x6'));var config=require(_0x5bb3('0x7'));var attributes=require(_0x5bb3('0x8'));module[_0x5bb3('0x9')]=function(_0x321535,_0x46ef03){return _0x321535[_0x5bb3('0xa')](_0x5bb3('0xb'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x5bb3('0xc'),'fields':[_0x5bb3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x530f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid','util'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x530f,0x167));var _0xf530=function(_0x42c797,_0x16382b){_0x42c797=_0x42c797-0x0;var _0x320035=_0x530f[_0x42c797];return _0x320035;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf530('0x1'));var BPromise=require(_0xf530('0x2'));var rp=require(_0xf530('0x3'));var fs=require('fs');var path=require(_0xf530('0x4'));var rimraf=require(_0xf530('0x5'));var config=require(_0xf530('0x6'));var attributes=require(_0xf530('0x7'));module[_0xf530('0x8')]=function(_0x58f5f8,_0x3a0301){return _0x58f5f8[_0xf530('0x9')](_0xf530('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xf530('0xb'),'fields':[_0xf530('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 41e29b1..a9ade21 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 _0x57ca=['jayson/promise','client','http','request','info','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','MailQueueReport,\x20%s,\x20%s','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','debug','stringify','UpdateMailQueueReport','update','raw','where','attributes','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x81ac2a,_0x5ccf48){var _0x3d4e4d=function(_0x5e02f7){while(--_0x5e02f7){_0x81ac2a['push'](_0x81ac2a['shift']());}};_0x3d4e4d(++_0x5ccf48);}(_0x57ca,0x108));var _0xa57c=function(_0x5c812,_0x56d270){_0x5c812=_0x5c812-0x0;var _0x251050=_0x57ca[_0x5c812];return _0x251050;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}exports[_0xa57c('0x15')]=function(_0x3d781d){var _0x93462c=this;return new Promise(function(_0xe3d505,_0x1fd0d8){return db[_0xa57c('0x16')][_0xa57c('0x17')](_0x3d781d[_0xa57c('0x18')],{'raw':_0x3d781d['options']?_0x3d781d[_0xa57c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x418415){logger[_0xa57c('0xc')](_0xa57c('0x15'),_0x3d781d);logger[_0xa57c('0x1a')]('CreateMailQueueReport',_0x3d781d,JSON[_0xa57c('0x1b')](_0x418415));_0xe3d505(_0x418415);})[_0xa57c('0x14')](function(_0x34d1bc){logger[_0xa57c('0xf')](_0xa57c('0x15'),_0x34d1bc[_0xa57c('0x12')],_0x3d781d);_0x1fd0d8(_0x93462c[_0xa57c('0xf')](0x1f4,_0x34d1bc[_0xa57c('0x12')]));});});};exports[_0xa57c('0x1c')]=function(_0xdf65dd){var _0x382a26=this;return new Promise(function(_0x1e7f7a,_0x241dcc){return db[_0xa57c('0x16')][_0xa57c('0x1d')](_0xdf65dd['body'],{'raw':_0xdf65dd[_0xa57c('0x19')]?_0xdf65dd[_0xa57c('0x19')][_0xa57c('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdf65dd[_0xa57c('0x19')]?_0xdf65dd[_0xa57c('0x19')][_0xa57c('0x1f')]||null:null,'attributes':_0xdf65dd[_0xa57c('0x19')]?_0xdf65dd[_0xa57c('0x19')][_0xa57c('0x20')]||null:null,'limit':_0xdf65dd[_0xa57c('0x19')]?_0xdf65dd['options'][_0xa57c('0x21')]||null:null})['then'](function(_0x54a18b){logger[_0xa57c('0xc')](_0xa57c('0x1c'),_0xdf65dd);logger['debug'](_0xa57c('0x1c'),_0xdf65dd,JSON[_0xa57c('0x1b')](_0x54a18b));_0x1e7f7a(_0x54a18b);})[_0xa57c('0x14')](function(_0x57565b){logger[_0xa57c('0xf')]('UpdateMailQueueReport',_0x57565b[_0xa57c('0x12')],_0xdf65dd);_0x241dcc(_0x382a26['error'](0x1f4,_0x57565b[_0xa57c('0x12')]));});});}; \ No newline at end of file +var _0xf61e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateMailQueueReport','create','body','options','raw','then','update','where','attributes','limit','UpdateMailQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xb68772,_0x5253ac){var _0x4189bb=function(_0x1b0cf3){while(--_0x1b0cf3){_0xb68772['push'](_0xb68772['shift']());}};_0x4189bb(++_0x5253ac);}(_0xf61e,0x191));var _0xef61=function(_0x526f6b,_0x22f037){_0x526f6b=_0x526f6b-0x0;var _0x5d72f1=_0xf61e[_0x526f6b];return _0x5d72f1;};'use strict';var _=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var moment=require(_0xef61('0x2'));var BPromise=require(_0xef61('0x3'));var rs=require(_0xef61('0x4'));var fs=require('fs');var Redis=require(_0xef61('0x5'));var db=require(_0xef61('0x6'))['db'];var utils=require(_0xef61('0x7'));var logger=require(_0xef61('0x8'))(_0xef61('0x9'));var config=require(_0xef61('0xa'));var jayson=require(_0xef61('0xb'));var client=jayson['client'][_0xef61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2f79,_0x4f0cc5,_0x2242a7){return new BPromise(function(_0x277fa1,_0x106e7f){return client['request'](_0x3e2f79,_0x2242a7)['then'](function(_0x188894){logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));logger[_0xef61('0x10')](_0xef61('0x11'),_0x4f0cc5,_0xef61('0xf'),JSON[_0xef61('0x12')](_0x188894));if(_0x188894[_0xef61('0x13')]){if(_0x188894[_0xef61('0x13')][_0xef61('0x14')]===0x1f4){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')]['message']);return _0x106e7f(_0x188894[_0xef61('0x13')]['message']);}logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x188894[_0xef61('0x13')][_0xef61('0x15')]);return _0x277fa1(_0x188894['error'][_0xef61('0x15')]);}else{logger[_0xef61('0xd')](_0xef61('0xe'),_0x4f0cc5,_0xef61('0xf'));_0x277fa1(_0x188894['result'][_0xef61('0x15')]);}})[_0xef61('0x16')](function(_0x4f7a62){logger[_0xef61('0x13')](_0xef61('0xe'),_0x4f0cc5,_0x4f7a62);_0x106e7f(_0x4f7a62);});});}exports[_0xef61('0x17')]=function(_0x22dc1b){var _0xfc36d6=this;return new Promise(function(_0x28315a,_0xdd5e38){return db['MailQueueReport'][_0xef61('0x18')](_0x22dc1b[_0xef61('0x19')],{'raw':_0x22dc1b['options']?_0x22dc1b[_0xef61('0x1a')][_0xef61('0x1b')]===undefined?!![]:![]:!![]})[_0xef61('0x1c')](function(_0x26cf42){logger[_0xef61('0xd')](_0xef61('0x17'),_0x22dc1b);logger[_0xef61('0x10')]('CreateMailQueueReport',_0x22dc1b,JSON['stringify'](_0x26cf42));_0x28315a(_0x26cf42);})[_0xef61('0x16')](function(_0x58bd7d){logger[_0xef61('0x13')]('CreateMailQueueReport',_0x58bd7d['message'],_0x22dc1b);_0xdd5e38(_0xfc36d6[_0xef61('0x13')](0x1f4,_0x58bd7d['message']));});});};exports['UpdateMailQueueReport']=function(_0xfbee94){var _0x3782c6=this;return new Promise(function(_0x3ceb14,_0x111bac){return db['MailQueueReport'][_0xef61('0x1d')](_0xfbee94['body'],{'raw':_0xfbee94[_0xef61('0x1a')]?_0xfbee94[_0xef61('0x1a')][_0xef61('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfbee94[_0xef61('0x1a')]?_0xfbee94[_0xef61('0x1a')][_0xef61('0x1e')]||null:null,'attributes':_0xfbee94[_0xef61('0x1a')]?_0xfbee94[_0xef61('0x1a')][_0xef61('0x1f')]||null:null,'limit':_0xfbee94[_0xef61('0x1a')]?_0xfbee94[_0xef61('0x1a')][_0xef61('0x20')]||null:null})[_0xef61('0x1c')](function(_0x63edd4){logger[_0xef61('0xd')](_0xef61('0x21'),_0xfbee94);logger[_0xef61('0x10')](_0xef61('0x21'),_0xfbee94,JSON[_0xef61('0x12')](_0x63edd4));_0x3ceb14(_0x63edd4);})[_0xef61('0x16')](function(_0x43bc47){logger[_0xef61('0x13')]('UpdateMailQueueReport',_0x43bc47['message'],_0xfbee94);_0x111bac(_0x3782c6[_0xef61('0x13')](0x1f4,_0x43bc47[_0xef61('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 609b3e8..3291b34 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 _0x83ff=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','express'];(function(_0x31e584,_0x4d9f7f){var _0x5686d0=function(_0x1f9e99){while(--_0x1f9e99){_0x31e584['push'](_0x31e584['shift']());}};_0x5686d0(++_0x4d9f7f);}(_0x83ff,0x1ea));var _0xf83f=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x83ff[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xf83f('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf83f('0x1'));var router=express[_0xf83f('0x2')]();var auth=require(_0xf83f('0x3'));var interaction=require(_0xf83f('0x4'));var config=require('../../config/environment');module[_0xf83f('0x5')]=router; \ No newline at end of file +var _0xdb89=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xdb89,0x174));var _0x9db8=function(_0x2e2098,_0x3174be){_0x2e2098=_0x2e2098-0x0;var _0x397da9=_0xdb89[_0x2e2098];return _0x397da9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9db8('0x0'));var express=require(_0x9db8('0x1'));var router=express[_0x9db8('0x2')]();var auth=require(_0x9db8('0x3'));var interaction=require(_0x9db8('0x4'));var config=require(_0x9db8('0x5'));module[_0x9db8('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 10ae753..1537417 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 _0x0a84=['BOOLEAN','username','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x1f0a08,_0x5c55a5){var _0x516e32=function(_0x375179){while(--_0x375179){_0x1f0a08['push'](_0x1f0a08['shift']());}};_0x516e32(++_0x5c55a5);}(_0x0a84,0x66));var _0x40a8=function(_0x474b2c,_0x1c9edd){_0x474b2c=_0x474b2c-0x0;var _0x1d347b=_0x0a84[_0x474b2c];return _0x1d347b;};'use strict';var Sequelize=require(_0x40a8('0x0'));module[_0x40a8('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x40a8('0x2')]},'authentication':{'type':Sequelize[_0x40a8('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x40a8('0x2')],'unique':_0x40a8('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x40a8('0x5')]},'tls':{'type':Sequelize[_0x40a8('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x40a8('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x40a8('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x40a8('0x2')]}}; \ No newline at end of file +var _0xf246=['STRING','BOOLEAN','username','INBOX','INTEGER','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xf246,0x10d));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6f24('0x0'));module['exports']={'description':{'type':Sequelize[_0x6f24('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x6f24('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x6f24('0x1')],'unique':_0x6f24('0x3')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x6f24('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x6f24('0x1')],'defaultValue':_0x6f24('0x4')},'connTimeout':{'type':Sequelize[_0x6f24('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x6f24('0x5')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 0b93293..ff89f71 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 _0x2086=['./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1bf8f5,_0x28f62c){var _0x36a54e=function(_0x43ba61){while(--_0x43ba61){_0x1bf8f5['push'](_0x1bf8f5['shift']());}};_0x36a54e(++_0x28f62c);}(_0x2086,0x124));var _0x6208=function(_0x269e01,_0x4628f0){_0x269e01=_0x269e01-0x0;var _0x268d07=_0x2086[_0x269e01];return _0x268d07;};'use strict';var _=require(_0x6208('0x0'));var util=require(_0x6208('0x1'));var logger=require(_0x6208('0x2'))(_0x6208('0x3'));var moment=require(_0x6208('0x4'));var BPromise=require(_0x6208('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6208('0x6'));var rimraf=require(_0x6208('0x7'));var config=require('../../config/environment');var attributes=require(_0x6208('0x8'));module[_0x6208('0x9')]=function(_0x38bc4d,_0xb3cf2a){return _0x38bc4d[_0x6208('0xa')]('MailServerIn',attributes,{'tableName':_0x6208('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x018c=['../../config/logger','bluebird','path','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util'];(function(_0xbdb6d7,_0x2cf68d){var _0x22372b=function(_0x412a07){while(--_0x412a07){_0xbdb6d7['push'](_0xbdb6d7['shift']());}};_0x22372b(++_0x2cf68d);}(_0x018c,0xda));var _0xc018=function(_0x480ace,_0x434018){_0x480ace=_0x480ace-0x0;var _0x270ce3=_0x018c[_0x480ace];return _0x270ce3;};'use strict';var _=require(_0xc018('0x0'));var util=require(_0xc018('0x1'));var logger=require(_0xc018('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc018('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc018('0x4'));var rimraf=require(_0xc018('0x5'));var config=require(_0xc018('0x6'));var attributes=require(_0xc018('0x7'));module['exports']=function(_0x3785b0,_0x26e41a){return _0x3785b0[_0xc018('0x8')](_0xc018('0x9'),attributes,{'tableName':_0xc018('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 7040105..d656b25 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 _0xb082=['code','message','GetMailServerIn','findAll','options','raw','where','attributes','limit','model','include','map','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','error'];(function(_0x3fdff1,_0x1ac483){var _0x57cdab=function(_0x4dc903){while(--_0x4dc903){_0x3fdff1['push'](_0x3fdff1['shift']());}};_0x57cdab(++_0x1ac483);}(_0xb082,0x105));var _0x2b08=function(_0x4fbd6c,_0x2d6811){_0x4fbd6c=_0x4fbd6c-0x0;var _0x52b81e=_0xb082[_0x4fbd6c];return _0x52b81e;};'use strict';var _=require(_0x2b08('0x0'));var util=require(_0x2b08('0x1'));var moment=require(_0x2b08('0x2'));var BPromise=require(_0x2b08('0x3'));var rs=require(_0x2b08('0x4'));var fs=require('fs');var Redis=require(_0x2b08('0x5'));var db=require(_0x2b08('0x6'))['db'];var utils=require(_0x2b08('0x7'));var logger=require('../../config/logger')(_0x2b08('0x8'));var config=require(_0x2b08('0x9'));var jayson=require(_0x2b08('0xa'));var client=jayson['client'][_0x2b08('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x411a26,_0x43f408,_0x3bb62c){return new BPromise(function(_0x53623a,_0x1d0e5a){return client['request'](_0x411a26,_0x3bb62c)[_0x2b08('0xc')](function(_0x112358){logger[_0x2b08('0xd')](_0x2b08('0xe'),_0x43f408,'request\x20sent');logger[_0x2b08('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x43f408,_0x2b08('0x10'),JSON['stringify'](_0x112358));if(_0x112358[_0x2b08('0x11')]){if(_0x112358['error'][_0x2b08('0x12')]===0x1f4){logger[_0x2b08('0x11')]('MailServerIn,\x20%s,\x20%s',_0x43f408,_0x112358[_0x2b08('0x11')][_0x2b08('0x13')]);return _0x1d0e5a(_0x112358[_0x2b08('0x11')][_0x2b08('0x13')]);}logger[_0x2b08('0x11')](_0x2b08('0xe'),_0x43f408,_0x112358[_0x2b08('0x11')][_0x2b08('0x13')]);return _0x53623a(_0x112358[_0x2b08('0x11')][_0x2b08('0x13')]);}else{logger[_0x2b08('0xd')](_0x2b08('0xe'),_0x43f408,_0x2b08('0x10'));_0x53623a(_0x112358['result'][_0x2b08('0x13')]);}})['catch'](function(_0x232580){logger[_0x2b08('0x11')](_0x2b08('0xe'),_0x43f408,_0x232580);_0x1d0e5a(_0x232580);});});}exports[_0x2b08('0x14')]=function(_0x22c66c){var _0x325283=this;return new Promise(function(_0x334ca9,_0x15211d){return db['MailServerIn'][_0x2b08('0x15')]({'raw':_0x22c66c['options']?_0x22c66c[_0x2b08('0x16')][_0x2b08('0x17')]===undefined?!![]:![]:!![],'where':_0x22c66c[_0x2b08('0x16')]?_0x22c66c[_0x2b08('0x16')][_0x2b08('0x18')]||null:null,'attributes':_0x22c66c[_0x2b08('0x16')]?_0x22c66c['options'][_0x2b08('0x19')]||null:null,'limit':_0x22c66c['options']?_0x22c66c[_0x2b08('0x16')][_0x2b08('0x1a')]||null:null,'include':_0x22c66c['options']?_0x22c66c[_0x2b08('0x16')]['include']?_['map'](_0x22c66c[_0x2b08('0x16')]['include'],function(_0x4417f4){return{'model':db[_0x4417f4[_0x2b08('0x1b')]],'as':_0x4417f4['as'],'attributes':_0x4417f4['attributes'],'include':_0x4417f4[_0x2b08('0x1c')]?_[_0x2b08('0x1d')](_0x4417f4[_0x2b08('0x1c')],function(_0x284dbe){return{'model':db[_0x284dbe['model']],'as':_0x284dbe['as'],'attributes':_0x284dbe[_0x2b08('0x19')],'include':_0x284dbe[_0x2b08('0x1c')]?_[_0x2b08('0x1d')](_0x284dbe[_0x2b08('0x1c')],function(_0x2f315c){return{'model':db[_0x2f315c[_0x2b08('0x1b')]],'as':_0x2f315c['as'],'attributes':_0x2f315c[_0x2b08('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2b08('0xc')](function(_0xf17f2){logger[_0x2b08('0xd')]('GetMailServerIn',_0x22c66c);logger[_0x2b08('0xf')](_0x2b08('0x14'),_0x22c66c,JSON['stringify'](_0xf17f2));_0x334ca9(_0xf17f2);})[_0x2b08('0x1e')](function(_0x117210){logger[_0x2b08('0x11')](_0x2b08('0x14'),_0x117210[_0x2b08('0x13')],_0x22c66c);_0x15211d(_0x325283[_0x2b08('0x11')](0x1f4,_0x117210[_0x2b08('0x13')]));});});}; \ No newline at end of file +var _0x324f=['bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','map','include','model','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x324f,0x12b));var _0xf324=function(_0x15fd4d,_0x2a665e){_0x15fd4d=_0x15fd4d-0x0;var _0x31a652=_0x324f[_0x15fd4d];return _0x31a652;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf324('0x0'));var BPromise=require(_0xf324('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf324('0x2'));var db=require(_0xf324('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf324('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf324('0x5'));var client=jayson[_0xf324('0x6')][_0xf324('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x438f73,_0x5e99a5,_0x5295a3){return new BPromise(function(_0x50f77a,_0x17b7c3){return client[_0xf324('0x8')](_0x438f73,_0x5295a3)[_0xf324('0x9')](function(_0x54a43d){logger['info'](_0xf324('0xa'),_0x5e99a5,_0xf324('0xb'));logger[_0xf324('0xc')](_0xf324('0xd'),_0x5e99a5,_0xf324('0xb'),JSON[_0xf324('0xe')](_0x54a43d));if(_0x54a43d['error']){if(_0x54a43d[_0xf324('0xf')]['code']===0x1f4){logger[_0xf324('0xf')]('MailServerIn,\x20%s,\x20%s',_0x5e99a5,_0x54a43d[_0xf324('0xf')][_0xf324('0x10')]);return _0x17b7c3(_0x54a43d['error']['message']);}logger[_0xf324('0xf')](_0xf324('0xa'),_0x5e99a5,_0x54a43d['error'][_0xf324('0x10')]);return _0x50f77a(_0x54a43d[_0xf324('0xf')][_0xf324('0x10')]);}else{logger[_0xf324('0x11')](_0xf324('0xa'),_0x5e99a5,_0xf324('0xb'));_0x50f77a(_0x54a43d['result']['message']);}})[_0xf324('0x12')](function(_0x371f5c){logger[_0xf324('0xf')](_0xf324('0xa'),_0x5e99a5,_0x371f5c);_0x17b7c3(_0x371f5c);});});}exports[_0xf324('0x13')]=function(_0x1cbdbc){var _0x50bc4a=this;return new Promise(function(_0x355808,_0x14c228){return db[_0xf324('0x14')][_0xf324('0x15')]({'raw':_0x1cbdbc['options']?_0x1cbdbc[_0xf324('0x16')][_0xf324('0x17')]===undefined?!![]:![]:!![],'where':_0x1cbdbc[_0xf324('0x16')]?_0x1cbdbc['options'][_0xf324('0x18')]||null:null,'attributes':_0x1cbdbc[_0xf324('0x16')]?_0x1cbdbc[_0xf324('0x16')][_0xf324('0x19')]||null:null,'limit':_0x1cbdbc['options']?_0x1cbdbc[_0xf324('0x16')][_0xf324('0x1a')]||null:null,'include':_0x1cbdbc[_0xf324('0x16')]?_0x1cbdbc[_0xf324('0x16')]['include']?_[_0xf324('0x1b')](_0x1cbdbc[_0xf324('0x16')][_0xf324('0x1c')],function(_0x45d88c){return{'model':db[_0x45d88c[_0xf324('0x1d')]],'as':_0x45d88c['as'],'attributes':_0x45d88c[_0xf324('0x19')],'include':_0x45d88c[_0xf324('0x1c')]?_[_0xf324('0x1b')](_0x45d88c['include'],function(_0x5ae526){return{'model':db[_0x5ae526[_0xf324('0x1d')]],'as':_0x5ae526['as'],'attributes':_0x5ae526[_0xf324('0x19')],'include':_0x5ae526[_0xf324('0x1c')]?_[_0xf324('0x1b')](_0x5ae526[_0xf324('0x1c')],function(_0x3f900a){return{'model':db[_0x3f900a[_0xf324('0x1d')]],'as':_0x3f900a['as'],'attributes':_0x3f900a[_0xf324('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf324('0x9')](function(_0x49ee10){logger[_0xf324('0x11')](_0xf324('0x13'),_0x1cbdbc);logger[_0xf324('0xc')](_0xf324('0x13'),_0x1cbdbc,JSON[_0xf324('0xe')](_0x49ee10));_0x355808(_0x49ee10);})[_0xf324('0x12')](function(_0x246e7e){logger[_0xf324('0xf')]('GetMailServerIn',_0x246e7e[_0xf324('0x10')],_0x1cbdbc);_0x14c228(_0x50bc4a[_0xf324('0xf')](0x1f4,_0x246e7e[_0xf324('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 8484305..644a4a7 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 _0x2183=['../../components/interaction/service','./mailServerOut.controller','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x2183,0x1e7));var _0x3218=function(_0x46f709,_0x278808){_0x46f709=_0x46f709-0x0;var _0x2e955b=_0x2183[_0x46f709];return _0x2e955b;};'use strict';var multer=require(_0x3218('0x0'));var util=require(_0x3218('0x1'));var path=require(_0x3218('0x2'));var timeout=require(_0x3218('0x3'));var express=require(_0x3218('0x4'));var router=express[_0x3218('0x5')]();var auth=require(_0x3218('0x6'));var interaction=require(_0x3218('0x7'));var config=require('../../config/environment');var controller=require(_0x3218('0x8'));router['get']('/',auth[_0x3218('0x9')](),controller[_0x3218('0xa')]);router['get'](_0x3218('0xb'),auth['isAuthenticated'](),controller[_0x3218('0xc')]);router[_0x3218('0xd')]('/',auth[_0x3218('0x9')](),controller[_0x3218('0xe')]);router['put'](_0x3218('0xb'),auth[_0x3218('0x9')](),controller[_0x3218('0xf')]);router[_0x3218('0x10')](_0x3218('0xb'),auth['isAuthenticated'](),controller[_0x3218('0x11')]);module[_0x3218('0x12')]=router; \ No newline at end of file +var _0x6465=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','index','get','/:id','isAuthenticated'];(function(_0x4886d4,_0x5df20a){var _0x48a889=function(_0x1360b5){while(--_0x1360b5){_0x4886d4['push'](_0x4886d4['shift']());}};_0x48a889(++_0x5df20a);}(_0x6465,0x15a));var _0x5646=function(_0x409858,_0x25373f){_0x409858=_0x409858-0x0;var _0x35080c=_0x6465[_0x409858];return _0x35080c;};'use strict';var multer=require(_0x5646('0x0'));var util=require(_0x5646('0x1'));var path=require(_0x5646('0x2'));var timeout=require(_0x5646('0x3'));var express=require(_0x5646('0x4'));var router=express[_0x5646('0x5')]();var auth=require(_0x5646('0x6'));var interaction=require(_0x5646('0x7'));var config=require(_0x5646('0x8'));var controller=require(_0x5646('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5646('0xa')]);router[_0x5646('0xb')](_0x5646('0xc'),auth[_0x5646('0xd')](),controller['show']);router[_0x5646('0xe')]('/',auth[_0x5646('0xd')](),controller[_0x5646('0xf')]);router[_0x5646('0x10')](_0x5646('0xc'),auth[_0x5646('0xd')](),controller[_0x5646('0x11')]);router['delete'](_0x5646('0xc'),auth[_0x5646('0xd')](),controller[_0x5646('0x12')]);module[_0x5646('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index b5a69ac..0779f8c 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 _0x7dee=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7dee,0xb0));var _0xe7de=function(_0x10e68e,_0x30e4a9){_0x10e68e=_0x10e68e-0x0;var _0x3c1fcc=_0x7dee[_0x10e68e];return _0x3c1fcc;};'use strict';var Sequelize=require(_0xe7de('0x0'));module['exports']={'description':{'type':Sequelize[_0xe7de('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe7de('0x1')]},'pass':{'type':Sequelize[_0xe7de('0x1')]},'port':{'type':Sequelize[_0xe7de('0x2')]},'secure':{'type':Sequelize[_0xe7de('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe7de('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7b84=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x7b84,0x17c));var _0x47b8=function(_0x54af31,_0x4b33f6){_0x54af31=_0x54af31-0x0;var _0x183e4a=_0x7b84[_0x54af31];return _0x183e4a;};'use strict';var Sequelize=require(_0x47b8('0x0'));module[_0x47b8('0x1')]={'description':{'type':Sequelize[_0x47b8('0x2')]},'host':{'type':Sequelize[_0x47b8('0x2')]},'user':{'type':Sequelize[_0x47b8('0x2')]},'pass':{'type':Sequelize[_0x47b8('0x2')]},'port':{'type':Sequelize[_0x47b8('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x47b8('0x2')]},'authentication':{'type':Sequelize[_0x47b8('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 9ccf341..397002e 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 _0xf87d=['rows','catch','show','find','create','body','params','html-pdf','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','reject','update','then','destroy','error','name','send','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include'];(function(_0x50fc55,_0x18fac2){var _0xd95ce7=function(_0x27d730){while(--_0x27d730){_0x50fc55['push'](_0x50fc55['shift']());}};_0xd95ce7(++_0x18fac2);}(_0xf87d,0x8f));var _0xdf87=function(_0x2e9232,_0x51fcca){_0x2e9232=_0x2e9232-0x0;var _0x331172=_0xf87d[_0x2e9232];return _0x331172;};'use strict';var pdf=require(_0xdf87('0x0'));var emlformat=require(_0xdf87('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdf87('0x2'));var rp=require('request-promise');var moment=require(_0xdf87('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdf87('0x4'));var path=require(_0xdf87('0x5'));var sox=require(_0xdf87('0x6'));var csv=require(_0xdf87('0x7'));var ejs=require(_0xdf87('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdf87('0x9'));var crypto=require(_0xdf87('0xa'));var jsforce=require(_0xdf87('0xb'));var deskjs=require(_0xdf87('0xc'));var toCsv=require(_0xdf87('0x7'));var querystring=require(_0xdf87('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf87('0xe'));var authService=require(_0xdf87('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf87('0x10'));var logger=require(_0xdf87('0x11'))(_0xdf87('0x12'));var utils=require(_0xdf87('0x13'));var config=require(_0xdf87('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3dcb15,_0x295a60){_0x295a60=_0x295a60||0xcc;return function(_0x2eb7bb){if(_0x2eb7bb){return _0x3dcb15[_0xdf87('0x15')](_0x295a60);}return _0x3dcb15['status'](_0x295a60)[_0xdf87('0x16')]();};}function respondWithResult(_0x277a62,_0x2e5bba){_0x2e5bba=_0x2e5bba||0xc8;return function(_0x2a89a7){if(_0x2a89a7){return _0x277a62[_0xdf87('0x17')](_0x2e5bba)[_0xdf87('0x18')](_0x2a89a7);}};}function respondWithFilteredResult(_0x737b32,_0x1a449e){return function(_0x339393){if(_0x339393){var _0xfcb484=_0x339393[_0xdf87('0x19')],_0x466acf=_0x1a449e[_0xdf87('0x1a')],_0x318301=_0x1a449e[_0xdf87('0x1a')]+_0x1a449e[_0xdf87('0x1b')],_0xfc3674;if(_0x318301>=_0xfcb484){_0x318301=_0xfcb484;_0xfc3674=0xc8;}else{_0xfc3674=0xce;}_0x737b32['status'](_0xfc3674);return _0x737b32[_0xdf87('0x1c')]('Content-Range',_0x466acf+'-'+_0x318301+'/'+_0xfcb484)[_0xdf87('0x18')](_0x339393);}return null;};}function patchUpdates(_0x96bdbc){return function(_0xb26b75){try{jsonpatch['apply'](_0xb26b75,_0x96bdbc,!![]);}catch(_0x5133ff){return BPromise[_0xdf87('0x1d')](_0x5133ff);}return _0xb26b75['save']();};}function saveUpdates(_0x4e9cfc,_0x416d2b){return function(_0x36bc36){if(_0x36bc36){return _0x36bc36[_0xdf87('0x1e')](_0x4e9cfc)[_0xdf87('0x1f')](function(_0x5befc6){return _0x5befc6;});}return null;};}function removeEntity(_0x3a7461,_0x596fd1){return function(_0x6f737b){if(_0x6f737b){return _0x6f737b[_0xdf87('0x20')]()[_0xdf87('0x1f')](function(){_0x3a7461[_0xdf87('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d5921,_0x1368de){return function(_0x4ba7b1){if(!_0x4ba7b1){_0x1d5921['sendStatus'](0x194);}return _0x4ba7b1;};}function handleError(_0x5a2e53,_0x2e4007){_0x2e4007=_0x2e4007||0x1f4;return function(_0x3857c7){logger[_0xdf87('0x21')](_0x3857c7['stack']);if(_0x3857c7[_0xdf87('0x22')]){delete _0x3857c7['name'];}_0x5a2e53['status'](_0x2e4007)[_0xdf87('0x23')](_0x3857c7);};}exports['index']=function(_0x48faa7,_0x3fb1e3){var _0x34e9cd={},_0x5be81e={},_0x598263={'count':0x0,'rows':[]};var _0x3b615b=_[_0xdf87('0x24')](db[_0xdf87('0x25')][_0xdf87('0x26')],function(_0x233482){return{'name':_0x233482[_0xdf87('0x27')],'type':_0x233482[_0xdf87('0x28')][_0xdf87('0x29')]};});_0x5be81e[_0xdf87('0x2a')]=_['map'](_0x3b615b,_0xdf87('0x22'));_0x5be81e[_0xdf87('0x2b')]=_[_0xdf87('0x2c')](_0x48faa7[_0xdf87('0x2b')]);_0x5be81e[_0xdf87('0x2d')]=_[_0xdf87('0x2e')](_0x5be81e[_0xdf87('0x2a')],_0x5be81e['query']);_0x34e9cd[_0xdf87('0x2f')]=_['intersection'](_0x5be81e[_0xdf87('0x2a')],qs['fields'](_0x48faa7[_0xdf87('0x2b')][_0xdf87('0x30')]));_0x34e9cd[_0xdf87('0x2f')]=_0x34e9cd[_0xdf87('0x2f')][_0xdf87('0x31')]?_0x34e9cd[_0xdf87('0x2f')]:_0x5be81e['model'];if(!_0x48faa7[_0xdf87('0x2b')][_0xdf87('0x32')](_0xdf87('0x33'))){_0x34e9cd[_0xdf87('0x1b')]=qs[_0xdf87('0x1b')](_0x48faa7[_0xdf87('0x2b')][_0xdf87('0x1b')]);_0x34e9cd[_0xdf87('0x1a')]=qs[_0xdf87('0x1a')](_0x48faa7[_0xdf87('0x2b')][_0xdf87('0x1a')]);}_0x34e9cd[_0xdf87('0x34')]=qs[_0xdf87('0x35')](_0x48faa7[_0xdf87('0x2b')]['sort']);_0x34e9cd[_0xdf87('0x36')]=qs[_0xdf87('0x2d')](_[_0xdf87('0x37')](_0x48faa7[_0xdf87('0x2b')],_0x5be81e[_0xdf87('0x2d')]),_0x3b615b);if(_0x48faa7[_0xdf87('0x2b')]['filter']){_0x34e9cd[_0xdf87('0x36')]=_[_0xdf87('0x38')](_0x34e9cd[_0xdf87('0x36')],{'$or':_[_0xdf87('0x24')](_0x3b615b,function(_0x46f2ca){if(_0x46f2ca['type']!==_0xdf87('0x39')){var _0x3a5e90={};_0x3a5e90[_0x46f2ca[_0xdf87('0x22')]]={'$like':'%'+_0x48faa7[_0xdf87('0x2b')]['filter']+'%'};return _0x3a5e90;}})});}_0x34e9cd=_['merge']({},_0x34e9cd,_0x48faa7[_0xdf87('0x3a')]);var _0x5d03e6={'where':_0x34e9cd[_0xdf87('0x36')]};return db['MailServerOut'][_0xdf87('0x19')](_0x5d03e6)[_0xdf87('0x1f')](function(_0x2db717){_0x598263[_0xdf87('0x19')]=_0x2db717;if(_0x48faa7['query'][_0xdf87('0x3b')]){_0x34e9cd[_0xdf87('0x3c')]=[{'all':!![]}];}return db[_0xdf87('0x25')]['findAll'](_0x34e9cd);})[_0xdf87('0x1f')](function(_0x366cec){_0x598263[_0xdf87('0x3d')]=_0x366cec;return _0x598263;})[_0xdf87('0x1f')](respondWithFilteredResult(_0x3fb1e3,_0x34e9cd))[_0xdf87('0x3e')](handleError(_0x3fb1e3,null));};exports[_0xdf87('0x3f')]=function(_0x56df32,_0x579c14){var _0xe684da={'raw':!![],'where':{'id':_0x56df32['params']['id']}},_0x107ef4={};_0x107ef4[_0xdf87('0x2a')]=_[_0xdf87('0x2c')](db['MailServerOut'][_0xdf87('0x26')]);_0x107ef4[_0xdf87('0x2b')]=_[_0xdf87('0x2c')](_0x56df32[_0xdf87('0x2b')]);_0x107ef4[_0xdf87('0x2d')]=_['intersection'](_0x107ef4['model'],_0x107ef4[_0xdf87('0x2b')]);_0xe684da[_0xdf87('0x2f')]=_['intersection'](_0x107ef4[_0xdf87('0x2a')],qs[_0xdf87('0x30')](_0x56df32[_0xdf87('0x2b')][_0xdf87('0x30')]));_0xe684da[_0xdf87('0x2f')]=_0xe684da['attributes']['length']?_0xe684da[_0xdf87('0x2f')]:_0x107ef4[_0xdf87('0x2a')];if(_0x56df32[_0xdf87('0x2b')]['includeAll']){_0xe684da[_0xdf87('0x3c')]=[{'all':!![]}];}_0xe684da=_['merge']({},_0xe684da,_0x56df32[_0xdf87('0x3a')]);return db[_0xdf87('0x25')][_0xdf87('0x40')](_0xe684da)[_0xdf87('0x1f')](handleEntityNotFound(_0x579c14,null))[_0xdf87('0x1f')](respondWithResult(_0x579c14,null))['catch'](handleError(_0x579c14,null));};exports[_0xdf87('0x41')]=function(_0x1ad7ed,_0x380e3e){return db['MailServerOut']['create'](_0x1ad7ed[_0xdf87('0x42')],{})[_0xdf87('0x1f')](respondWithResult(_0x380e3e,0xc9))[_0xdf87('0x3e')](handleError(_0x380e3e,null));};exports[_0xdf87('0x1e')]=function(_0xfbf3a9,_0x3eca6c){if(_0xfbf3a9['body']['id']){delete _0xfbf3a9[_0xdf87('0x42')]['id'];}return db[_0xdf87('0x25')][_0xdf87('0x40')]({'where':{'id':_0xfbf3a9[_0xdf87('0x43')]['id']}})[_0xdf87('0x1f')](handleEntityNotFound(_0x3eca6c,null))[_0xdf87('0x1f')](saveUpdates(_0xfbf3a9[_0xdf87('0x42')],null))['then'](respondWithResult(_0x3eca6c,null))[_0xdf87('0x3e')](handleError(_0x3eca6c,null));};exports['destroy']=function(_0x2ea24a,_0x5bee90){return db[_0xdf87('0x25')][_0xdf87('0x40')]({'where':{'id':_0x2ea24a['params']['id']}})[_0xdf87('0x1f')](handleEntityNotFound(_0x5bee90,null))[_0xdf87('0x1f')](removeEntity(_0x5bee90,null))[_0xdf87('0x3e')](handleError(_0x5bee90,null));}; \ No newline at end of file +var _0x9204=['../../mysqldb','sendStatus','status','offset','limit','Content-Range','json','reject','save','then','end','error','name','map','MailServerOut','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','options','count','findAll','rows','catch','show','params','include','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x53a4de,_0xff041d){var _0x304c3c=function(_0x4d2f9a){while(--_0x4d2f9a){_0x53a4de['push'](_0x53a4de['shift']());}};_0x304c3c(++_0xff041d);}(_0x9204,0x6c));var _0x4920=function(_0x3a19b5,_0xb2d070){_0x3a19b5=_0x3a19b5-0x0;var _0x3618b4=_0x9204[_0x3a19b5];return _0x3618b4;};'use strict';var pdf=require(_0x4920('0x0'));var emlformat=require(_0x4920('0x1'));var rimraf=require(_0x4920('0x2'));var zipdir=require(_0x4920('0x3'));var jsonpatch=require(_0x4920('0x4'));var rp=require(_0x4920('0x5'));var moment=require('moment');var BPromise=require(_0x4920('0x6'));var Mustache=require(_0x4920('0x7'));var util=require(_0x4920('0x8'));var path=require('path');var sox=require(_0x4920('0x9'));var csv=require(_0x4920('0xa'));var ejs=require(_0x4920('0xb'));var fs=require('fs');var _=require(_0x4920('0xc'));var squel=require(_0x4920('0xd'));var crypto=require('crypto');var jsforce=require(_0x4920('0xe'));var deskjs=require(_0x4920('0xf'));var toCsv=require(_0x4920('0xa'));var querystring=require('querystring');var Papa=require(_0x4920('0x10'));var Redis=require(_0x4920('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4920('0x12'));var hardwareService=require(_0x4920('0x13'));var logger=require(_0x4920('0x14'))(_0x4920('0x15'));var utils=require(_0x4920('0x16'));var config=require(_0x4920('0x17'));var db=require(_0x4920('0x18'))['db'];function respondWithStatusCode(_0x392255,_0x391232){_0x391232=_0x391232||0xcc;return function(_0x254e22){if(_0x254e22){return _0x392255[_0x4920('0x19')](_0x391232);}return _0x392255[_0x4920('0x1a')](_0x391232)['end']();};}function respondWithResult(_0xab3b14,_0x58d72e){_0x58d72e=_0x58d72e||0xc8;return function(_0xba0c26){if(_0xba0c26){return _0xab3b14[_0x4920('0x1a')](_0x58d72e)['json'](_0xba0c26);}};}function respondWithFilteredResult(_0x2a0557,_0x89255a){return function(_0x25ca9f){if(_0x25ca9f){var _0x21e888=_0x25ca9f['count'],_0x3c3a20=_0x89255a[_0x4920('0x1b')],_0x5aefa7=_0x89255a[_0x4920('0x1b')]+_0x89255a[_0x4920('0x1c')],_0x51fba9;if(_0x5aefa7>=_0x21e888){_0x5aefa7=_0x21e888;_0x51fba9=0xc8;}else{_0x51fba9=0xce;}_0x2a0557[_0x4920('0x1a')](_0x51fba9);return _0x2a0557['set'](_0x4920('0x1d'),_0x3c3a20+'-'+_0x5aefa7+'/'+_0x21e888)[_0x4920('0x1e')](_0x25ca9f);}return null;};}function patchUpdates(_0x43b990){return function(_0x44bea0){try{jsonpatch['apply'](_0x44bea0,_0x43b990,!![]);}catch(_0x37b66f){return BPromise[_0x4920('0x1f')](_0x37b66f);}return _0x44bea0[_0x4920('0x20')]();};}function saveUpdates(_0x96fff8,_0x21d9e1){return function(_0x3d46a2){if(_0x3d46a2){return _0x3d46a2['update'](_0x96fff8)[_0x4920('0x21')](function(_0x5e3cb1){return _0x5e3cb1;});}return null;};}function removeEntity(_0x4b35a0,_0xed526a){return function(_0x3a52ef){if(_0x3a52ef){return _0x3a52ef['destroy']()[_0x4920('0x21')](function(){_0x4b35a0[_0x4920('0x1a')](0xcc)[_0x4920('0x22')]();});}};}function handleEntityNotFound(_0x15a96c,_0x4b2b34){return function(_0x52185f){if(!_0x52185f){_0x15a96c[_0x4920('0x19')](0x194);}return _0x52185f;};}function handleError(_0x3de259,_0x901d51){_0x901d51=_0x901d51||0x1f4;return function(_0x442af2){logger[_0x4920('0x23')](_0x442af2['stack']);if(_0x442af2[_0x4920('0x24')]){delete _0x442af2[_0x4920('0x24')];}_0x3de259['status'](_0x901d51)['send'](_0x442af2);};}exports['index']=function(_0x52a1ba,_0x2e260d){var _0x4e4121={},_0xa6998c={},_0x28488d={'count':0x0,'rows':[]};var _0x2e6655=_[_0x4920('0x25')](db[_0x4920('0x26')][_0x4920('0x27')],function(_0x28fd0b){return{'name':_0x28fd0b['fieldName'],'type':_0x28fd0b[_0x4920('0x28')][_0x4920('0x29')]};});_0xa6998c[_0x4920('0x2a')]=_[_0x4920('0x25')](_0x2e6655,_0x4920('0x24'));_0xa6998c['query']=_[_0x4920('0x2b')](_0x52a1ba['query']);_0xa6998c[_0x4920('0x2c')]=_[_0x4920('0x2d')](_0xa6998c[_0x4920('0x2a')],_0xa6998c[_0x4920('0x2e')]);_0x4e4121[_0x4920('0x2f')]=_[_0x4920('0x2d')](_0xa6998c[_0x4920('0x2a')],qs[_0x4920('0x30')](_0x52a1ba['query'][_0x4920('0x30')]));_0x4e4121[_0x4920('0x2f')]=_0x4e4121[_0x4920('0x2f')]['length']?_0x4e4121['attributes']:_0xa6998c[_0x4920('0x2a')];if(!_0x52a1ba['query'][_0x4920('0x31')](_0x4920('0x32'))){_0x4e4121[_0x4920('0x1c')]=qs[_0x4920('0x1c')](_0x52a1ba[_0x4920('0x2e')]['limit']);_0x4e4121[_0x4920('0x1b')]=qs[_0x4920('0x1b')](_0x52a1ba[_0x4920('0x2e')]['offset']);}_0x4e4121[_0x4920('0x33')]=qs[_0x4920('0x34')](_0x52a1ba['query'][_0x4920('0x34')]);_0x4e4121[_0x4920('0x35')]=qs[_0x4920('0x2c')](_['pick'](_0x52a1ba[_0x4920('0x2e')],_0xa6998c[_0x4920('0x2c')]),_0x2e6655);if(_0x52a1ba['query']['filter']){_0x4e4121[_0x4920('0x35')]=_['merge'](_0x4e4121[_0x4920('0x35')],{'$or':_[_0x4920('0x25')](_0x2e6655,function(_0x2f4fdb){if(_0x2f4fdb['type']!=='VIRTUAL'){var _0x298bb4={};_0x298bb4[_0x2f4fdb[_0x4920('0x24')]]={'$like':'%'+_0x52a1ba['query']['filter']+'%'};return _0x298bb4;}})});}_0x4e4121=_['merge']({},_0x4e4121,_0x52a1ba[_0x4920('0x36')]);var _0x5824ed={'where':_0x4e4121['where']};return db[_0x4920('0x26')][_0x4920('0x37')](_0x5824ed)[_0x4920('0x21')](function(_0x53ff78){_0x28488d['count']=_0x53ff78;if(_0x52a1ba[_0x4920('0x2e')]['includeAll']){_0x4e4121['include']=[{'all':!![]}];}return db[_0x4920('0x26')][_0x4920('0x38')](_0x4e4121);})[_0x4920('0x21')](function(_0x38d2db){_0x28488d[_0x4920('0x39')]=_0x38d2db;return _0x28488d;})['then'](respondWithFilteredResult(_0x2e260d,_0x4e4121))[_0x4920('0x3a')](handleError(_0x2e260d,null));};exports[_0x4920('0x3b')]=function(_0x16cd1a,_0x2fec69){var _0x1c5dc5={'raw':!![],'where':{'id':_0x16cd1a[_0x4920('0x3c')]['id']}},_0x5b42cd={};_0x5b42cd[_0x4920('0x2a')]=_[_0x4920('0x2b')](db[_0x4920('0x26')]['rawAttributes']);_0x5b42cd['query']=_[_0x4920('0x2b')](_0x16cd1a[_0x4920('0x2e')]);_0x5b42cd[_0x4920('0x2c')]=_[_0x4920('0x2d')](_0x5b42cd['model'],_0x5b42cd['query']);_0x1c5dc5['attributes']=_['intersection'](_0x5b42cd['model'],qs['fields'](_0x16cd1a[_0x4920('0x2e')][_0x4920('0x30')]));_0x1c5dc5[_0x4920('0x2f')]=_0x1c5dc5[_0x4920('0x2f')]['length']?_0x1c5dc5[_0x4920('0x2f')]:_0x5b42cd[_0x4920('0x2a')];if(_0x16cd1a[_0x4920('0x2e')]['includeAll']){_0x1c5dc5[_0x4920('0x3d')]=[{'all':!![]}];}_0x1c5dc5=_['merge']({},_0x1c5dc5,_0x16cd1a[_0x4920('0x36')]);return db[_0x4920('0x26')][_0x4920('0x3e')](_0x1c5dc5)[_0x4920('0x21')](handleEntityNotFound(_0x2fec69,null))[_0x4920('0x21')](respondWithResult(_0x2fec69,null))[_0x4920('0x3a')](handleError(_0x2fec69,null));};exports[_0x4920('0x3f')]=function(_0x405488,_0x40c666){return db[_0x4920('0x26')][_0x4920('0x3f')](_0x405488[_0x4920('0x40')],{})[_0x4920('0x21')](respondWithResult(_0x40c666,0xc9))[_0x4920('0x3a')](handleError(_0x40c666,null));};exports['update']=function(_0x4974a3,_0xc95d7d){if(_0x4974a3[_0x4920('0x40')]['id']){delete _0x4974a3['body']['id'];}return db[_0x4920('0x26')][_0x4920('0x3e')]({'where':{'id':_0x4974a3[_0x4920('0x3c')]['id']}})[_0x4920('0x21')](handleEntityNotFound(_0xc95d7d,null))[_0x4920('0x21')](saveUpdates(_0x4974a3['body'],null))[_0x4920('0x21')](respondWithResult(_0xc95d7d,null))[_0x4920('0x3a')](handleError(_0xc95d7d,null));};exports[_0x4920('0x41')]=function(_0x8e4fd5,_0x218ea1){return db['MailServerOut'][_0x4920('0x3e')]({'where':{'id':_0x8e4fd5[_0x4920('0x3c')]['id']}})[_0x4920('0x21')](handleEntityNotFound(_0x218ea1,null))[_0x4920('0x21')](removeEntity(_0x218ea1,null))[_0x4920('0x3a')](handleError(_0x218ea1,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 721aec9..9985759 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 _0x8cc2=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x8cc2,0x1df));var _0x28cc=function(_0x19b52a,_0x1abd93){_0x19b52a=_0x19b52a-0x0;var _0x14cc48=_0x8cc2[_0x19b52a];return _0x14cc48;};'use strict';var _=require(_0x28cc('0x0'));var util=require('util');var logger=require(_0x28cc('0x1'))(_0x28cc('0x2'));var moment=require(_0x28cc('0x3'));var BPromise=require('bluebird');var rp=require(_0x28cc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28cc('0x5'));var config=require(_0x28cc('0x6'));var attributes=require(_0x28cc('0x7'));module[_0x28cc('0x8')]=function(_0x66e9d7,_0x407db0){return _0x66e9d7[_0x28cc('0x9')](_0x28cc('0xa'),attributes,{'tableName':_0x28cc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca87=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out'];(function(_0x43a159,_0x32ba85){var _0x5f3d92=function(_0x3d0143){while(--_0x3d0143){_0x43a159['push'](_0x43a159['shift']());}};_0x5f3d92(++_0x32ba85);}(_0xca87,0x9c));var _0x7ca8=function(_0x29bcab,_0x53a015){_0x29bcab=_0x29bcab-0x0;var _0x2cb492=_0xca87[_0x29bcab];return _0x2cb492;};'use strict';var _=require(_0x7ca8('0x0'));var util=require(_0x7ca8('0x1'));var logger=require(_0x7ca8('0x2'))(_0x7ca8('0x3'));var moment=require(_0x7ca8('0x4'));var BPromise=require(_0x7ca8('0x5'));var rp=require(_0x7ca8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7ca8('0x7'));var attributes=require(_0x7ca8('0x8'));module['exports']=function(_0x5b35ae,_0x49a76d){return _0x5b35ae[_0x7ca8('0x9')](_0x7ca8('0xa'),attributes,{'tableName':_0x7ca8('0xb'),'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 54690fc..9201b9d 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 _0x708b=['rpc','../../config/environment','jayson/promise','http','request','then','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c223c,_0x3cef2f){var _0x141766=function(_0x5c09ed){while(--_0x5c09ed){_0x1c223c['push'](_0x1c223c['shift']());}};_0x141766(++_0x3cef2f);}(_0x708b,0x178));var _0xb708=function(_0x1e3bef,_0x1bf91c){_0x1e3bef=_0x1e3bef-0x0;var _0x12a59c=_0x708b[_0x1e3bef];return _0x12a59c;};'use strict';var _=require(_0xb708('0x0'));var util=require(_0xb708('0x1'));var moment=require(_0xb708('0x2'));var BPromise=require(_0xb708('0x3'));var rs=require(_0xb708('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb708('0x5'))['db'];var utils=require(_0xb708('0x6'));var logger=require(_0xb708('0x7'))(_0xb708('0x8'));var config=require(_0xb708('0x9'));var jayson=require(_0xb708('0xa'));var client=jayson['client'][_0xb708('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f9452,_0x21f169,_0x2b52b4){return new BPromise(function(_0xe4e344,_0x37fb27){return client[_0xb708('0xc')](_0x4f9452,_0x2b52b4)[_0xb708('0xd')](function(_0x3ae598){logger['info'](_0xb708('0xe'),_0x21f169,'request\x20sent');logger[_0xb708('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x21f169,'request\x20sent',JSON[_0xb708('0x10')](_0x3ae598));if(_0x3ae598[_0xb708('0x11')]){if(_0x3ae598['error'][_0xb708('0x12')]===0x1f4){logger[_0xb708('0x11')]('MailServerOut,\x20%s,\x20%s',_0x21f169,_0x3ae598[_0xb708('0x11')][_0xb708('0x13')]);return _0x37fb27(_0x3ae598[_0xb708('0x11')][_0xb708('0x13')]);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x21f169,_0x3ae598[_0xb708('0x11')][_0xb708('0x13')]);return _0xe4e344(_0x3ae598['error'][_0xb708('0x13')]);}else{logger[_0xb708('0x14')]('MailServerOut,\x20%s,\x20%s',_0x21f169,_0xb708('0x15'));_0xe4e344(_0x3ae598[_0xb708('0x16')]['message']);}})[_0xb708('0x17')](function(_0x2cd95f){logger['error'](_0xb708('0xe'),_0x21f169,_0x2cd95f);_0x37fb27(_0x2cd95f);});});} \ No newline at end of file +var _0xb612=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1d39f6,_0x146f4a){var _0x3dbd7a=function(_0x4486f2){while(--_0x4486f2){_0x1d39f6['push'](_0x1d39f6['shift']());}};_0x3dbd7a(++_0x146f4a);}(_0xb612,0xa7));var _0x2b61=function(_0x31fbeb,_0x51eb69){_0x31fbeb=_0x31fbeb-0x0;var _0x1845a8=_0xb612[_0x31fbeb];return _0x1845a8;};'use strict';var _=require(_0x2b61('0x0'));var util=require(_0x2b61('0x1'));var moment=require(_0x2b61('0x2'));var BPromise=require(_0x2b61('0x3'));var rs=require(_0x2b61('0x4'));var fs=require('fs');var Redis=require(_0x2b61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b61('0x6'));var logger=require(_0x2b61('0x7'))('rpc');var config=require(_0x2b61('0x8'));var jayson=require(_0x2b61('0x9'));var client=jayson[_0x2b61('0xa')][_0x2b61('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x169e9a,_0x1d34e2,_0x2fb117){return new BPromise(function(_0x51b003,_0x1a2e5f){return client[_0x2b61('0xc')](_0x169e9a,_0x2fb117)[_0x2b61('0xd')](function(_0x43456b){logger[_0x2b61('0xe')](_0x2b61('0xf'),_0x1d34e2,_0x2b61('0x10'));logger[_0x2b61('0x11')](_0x2b61('0x12'),_0x1d34e2,_0x2b61('0x10'),JSON[_0x2b61('0x13')](_0x43456b));if(_0x43456b[_0x2b61('0x14')]){if(_0x43456b['error'][_0x2b61('0x15')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x1d34e2,_0x43456b[_0x2b61('0x14')][_0x2b61('0x16')]);return _0x1a2e5f(_0x43456b[_0x2b61('0x14')]['message']);}logger[_0x2b61('0x14')](_0x2b61('0xf'),_0x1d34e2,_0x43456b[_0x2b61('0x14')][_0x2b61('0x16')]);return _0x51b003(_0x43456b[_0x2b61('0x14')]['message']);}else{logger[_0x2b61('0xe')](_0x2b61('0xf'),_0x1d34e2,'request\x20sent');_0x51b003(_0x43456b[_0x2b61('0x17')]['message']);}})['catch'](function(_0x1fd7b9){logger['error'](_0x2b61('0xf'),_0x1d34e2,_0x1fd7b9);_0x1a2e5f(_0x1fd7b9);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 409d7f1..121576d 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 _0x8ee9=['/describe','describe','/:id','show','post','put','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8ee9,0xab));var _0x98ee=function(_0x12a7b0,_0x4c6fd9){_0x12a7b0=_0x12a7b0-0x0;var _0x4a0577=_0x8ee9[_0x12a7b0];return _0x4a0577;};'use strict';var multer=require(_0x98ee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x98ee('0x1'));var express=require(_0x98ee('0x2'));var router=express['Router']();var auth=require(_0x98ee('0x3'));var interaction=require(_0x98ee('0x4'));var config=require(_0x98ee('0x5'));var controller=require('./mailSubstatus.controller');router[_0x98ee('0x6')]('/',auth[_0x98ee('0x7')](),controller[_0x98ee('0x8')]);router[_0x98ee('0x6')](_0x98ee('0x9'),auth[_0x98ee('0x7')](),controller[_0x98ee('0xa')]);router['get'](_0x98ee('0xb'),auth[_0x98ee('0x7')](),controller[_0x98ee('0xc')]);router[_0x98ee('0xd')]('/',auth[_0x98ee('0x7')](),controller['create']);router[_0x98ee('0xe')](_0x98ee('0xb'),auth[_0x98ee('0x7')](),controller[_0x98ee('0xf')]);router[_0x98ee('0x10')](_0x98ee('0xb'),auth[_0x98ee('0x7')](),controller[_0x98ee('0x11')]);module['exports']=router; \ No newline at end of file +var _0x28f1=['isAuthenticated','/describe','describe','/:id','show','post','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x28f1,0x1e9));var _0x128f=function(_0x148199,_0x340c08){_0x148199=_0x148199-0x0;var _0x4f6158=_0x28f1[_0x148199];return _0x4f6158;};'use strict';var multer=require(_0x128f('0x0'));var util=require(_0x128f('0x1'));var path=require('path');var timeout=require(_0x128f('0x2'));var express=require(_0x128f('0x3'));var router=express['Router']();var auth=require(_0x128f('0x4'));var interaction=require(_0x128f('0x5'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0x128f('0x6')]('/',auth[_0x128f('0x7')](),controller['index']);router[_0x128f('0x6')](_0x128f('0x8'),auth['isAuthenticated'](),controller[_0x128f('0x9')]);router[_0x128f('0x6')](_0x128f('0xa'),auth[_0x128f('0x7')](),controller[_0x128f('0xb')]);router[_0x128f('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x128f('0xa'),auth[_0x128f('0x7')](),controller[_0x128f('0xd')]);router[_0x128f('0xe')](_0x128f('0xa'),auth[_0x128f('0x7')](),controller['destroy']);module[_0x128f('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index a3384fe..fa6bbf4 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 _0x3e4d=['STRING','sequelize'];(function(_0x2bf888,_0x374f0b){var _0x3038d6=function(_0xe1b6d9){while(--_0xe1b6d9){_0x2bf888['push'](_0x2bf888['shift']());}};_0x3038d6(++_0x374f0b);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x325a2c,_0x1897a8){_0x325a2c=_0x325a2c-0x0;var _0x80cb3d=_0x3e4d[_0x325a2c];return _0x80cb3d;};'use strict';var Sequelize=require(_0xd3e4('0x0'));module['exports']={'name':{'type':Sequelize[_0xd3e4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6efe=['STRING','name','sequelize','exports'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x6efe,0xc6));var _0xe6ef=function(_0x554833,_0x2661a7){_0x554833=_0x554833-0x0;var _0x4aca7e=_0x6efe[_0x554833];return _0x4aca7e;};'use strict';var Sequelize=require(_0xe6ef('0x0'));module[_0xe6ef('0x1')]={'name':{'type':Sequelize[_0xe6ef('0x2')],'unique':_0xe6ef('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe6ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index ae17c22..2505254 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 _0xcae3=['rows','params','rawAttributes','length','includeAll','options','find','catch','create','body','update','destroy','describe','html-pdf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','then','error','stack','name','send','map','MailSubstatus','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','include','findAll'];(function(_0x2e3d04,_0x202fe8){var _0x449b49=function(_0x4d0a6f){while(--_0x4d0a6f){_0x2e3d04['push'](_0x2e3d04['shift']());}};_0x449b49(++_0x202fe8);}(_0xcae3,0x125));var _0x3cae=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcae3[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x3cae('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3cae('0x1'));var rp=require(_0x3cae('0x2'));var moment=require(_0x3cae('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3cae('0x4'));var util=require(_0x3cae('0x5'));var path=require(_0x3cae('0x6'));var sox=require(_0x3cae('0x7'));var csv=require(_0x3cae('0x8'));var ejs=require(_0x3cae('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3cae('0xa'));var jsforce=require(_0x3cae('0xb'));var deskjs=require(_0x3cae('0xc'));var toCsv=require(_0x3cae('0x8'));var querystring=require(_0x3cae('0xd'));var Papa=require(_0x3cae('0xe'));var Redis=require(_0x3cae('0xf'));var authService=require(_0x3cae('0x10'));var qs=require(_0x3cae('0x11'));var as=require(_0x3cae('0x12'));var hardwareService=require(_0x3cae('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3cae('0x14'));var config=require(_0x3cae('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x172c34,_0x313eec){_0x313eec=_0x313eec||0xcc;return function(_0x361f2b){if(_0x361f2b){return _0x172c34[_0x3cae('0x16')](_0x313eec);}return _0x172c34[_0x3cae('0x17')](_0x313eec)[_0x3cae('0x18')]();};}function respondWithResult(_0x2d4219,_0x5498cd){_0x5498cd=_0x5498cd||0xc8;return function(_0x54a8c5){if(_0x54a8c5){return _0x2d4219['status'](_0x5498cd)[_0x3cae('0x19')](_0x54a8c5);}};}function respondWithFilteredResult(_0x14a2d5,_0x1d4a48){return function(_0x237b73){if(_0x237b73){var _0x2821e1=_0x237b73[_0x3cae('0x1a')],_0x4244cf=_0x1d4a48[_0x3cae('0x1b')],_0x1e00cc=_0x1d4a48[_0x3cae('0x1b')]+_0x1d4a48[_0x3cae('0x1c')],_0x27ccf0;if(_0x1e00cc>=_0x2821e1){_0x1e00cc=_0x2821e1;_0x27ccf0=0xc8;}else{_0x27ccf0=0xce;}_0x14a2d5[_0x3cae('0x17')](_0x27ccf0);return _0x14a2d5['set'](_0x3cae('0x1d'),_0x4244cf+'-'+_0x1e00cc+'/'+_0x2821e1)[_0x3cae('0x19')](_0x237b73);}return null;};}function patchUpdates(_0x4d0f1c){return function(_0x3de225){try{jsonpatch[_0x3cae('0x1e')](_0x3de225,_0x4d0f1c,!![]);}catch(_0x3ee0b3){return BPromise['reject'](_0x3ee0b3);}return _0x3de225[_0x3cae('0x1f')]();};}function saveUpdates(_0x43bb93,_0x243d36){return function(_0x40f940){if(_0x40f940){return _0x40f940['update'](_0x43bb93)['then'](function(_0x1002df){return _0x1002df;});}return null;};}function removeEntity(_0x341d88,_0x1bcd49){return function(_0x4d2c97){if(_0x4d2c97){return _0x4d2c97['destroy']()[_0x3cae('0x20')](function(){_0x341d88[_0x3cae('0x17')](0xcc)[_0x3cae('0x18')]();});}};}function handleEntityNotFound(_0x34cdac,_0x1a5df0){return function(_0x5935d1){if(!_0x5935d1){_0x34cdac[_0x3cae('0x16')](0x194);}return _0x5935d1;};}function handleError(_0x274d48,_0x54532b){_0x54532b=_0x54532b||0x1f4;return function(_0x372418){logger[_0x3cae('0x21')](_0x372418[_0x3cae('0x22')]);if(_0x372418['name']){delete _0x372418[_0x3cae('0x23')];}_0x274d48[_0x3cae('0x17')](_0x54532b)[_0x3cae('0x24')](_0x372418);};}exports['index']=function(_0x3642a0,_0x11e494){var _0x46bcf2={},_0x1c31ef={},_0x18e8fd={'count':0x0,'rows':[]};var _0x3f48cc=_[_0x3cae('0x25')](db[_0x3cae('0x26')]['rawAttributes'],function(_0x4575f0){return{'name':_0x4575f0[_0x3cae('0x27')],'type':_0x4575f0[_0x3cae('0x28')][_0x3cae('0x29')]};});_0x1c31ef['model']=_[_0x3cae('0x25')](_0x3f48cc,'name');_0x1c31ef[_0x3cae('0x2a')]=_[_0x3cae('0x2b')](_0x3642a0['query']);_0x1c31ef[_0x3cae('0x2c')]=_[_0x3cae('0x2d')](_0x1c31ef[_0x3cae('0x2e')],_0x1c31ef[_0x3cae('0x2a')]);_0x46bcf2[_0x3cae('0x2f')]=_[_0x3cae('0x2d')](_0x1c31ef['model'],qs[_0x3cae('0x30')](_0x3642a0[_0x3cae('0x2a')][_0x3cae('0x30')]));_0x46bcf2['attributes']=_0x46bcf2[_0x3cae('0x2f')]['length']?_0x46bcf2[_0x3cae('0x2f')]:_0x1c31ef[_0x3cae('0x2e')];if(!_0x3642a0[_0x3cae('0x2a')]['hasOwnProperty']('nolimit')){_0x46bcf2['limit']=qs[_0x3cae('0x1c')](_0x3642a0[_0x3cae('0x2a')][_0x3cae('0x1c')]);_0x46bcf2[_0x3cae('0x1b')]=qs[_0x3cae('0x1b')](_0x3642a0[_0x3cae('0x2a')][_0x3cae('0x1b')]);}_0x46bcf2[_0x3cae('0x31')]=qs[_0x3cae('0x32')](_0x3642a0[_0x3cae('0x2a')][_0x3cae('0x32')]);_0x46bcf2[_0x3cae('0x33')]=qs[_0x3cae('0x2c')](_[_0x3cae('0x34')](_0x3642a0[_0x3cae('0x2a')],_0x1c31ef[_0x3cae('0x2c')]),_0x3f48cc);if(_0x3642a0[_0x3cae('0x2a')][_0x3cae('0x35')]){_0x46bcf2[_0x3cae('0x33')]=_[_0x3cae('0x36')](_0x46bcf2[_0x3cae('0x33')],{'$or':_['map'](_0x3f48cc,function(_0x22588f){if(_0x22588f['type']!=='VIRTUAL'){var _0x26c699={};_0x26c699[_0x22588f['name']]={'$like':'%'+_0x3642a0[_0x3cae('0x2a')][_0x3cae('0x35')]+'%'};return _0x26c699;}})});}_0x46bcf2=_[_0x3cae('0x36')]({},_0x46bcf2,_0x3642a0['options']);var _0x58bce0={'where':_0x46bcf2[_0x3cae('0x33')]};return db['MailSubstatus']['count'](_0x58bce0)[_0x3cae('0x20')](function(_0x3d3a41){_0x18e8fd[_0x3cae('0x1a')]=_0x3d3a41;if(_0x3642a0['query']['includeAll']){_0x46bcf2[_0x3cae('0x37')]=[{'all':!![]}];}return db[_0x3cae('0x26')][_0x3cae('0x38')](_0x46bcf2);})[_0x3cae('0x20')](function(_0x1d7055){_0x18e8fd[_0x3cae('0x39')]=_0x1d7055;return _0x18e8fd;})[_0x3cae('0x20')](respondWithFilteredResult(_0x11e494,_0x46bcf2))['catch'](handleError(_0x11e494,null));};exports['show']=function(_0x3a78a6,_0x17e3c3){var _0x424420={'raw':!![],'where':{'id':_0x3a78a6[_0x3cae('0x3a')]['id']}},_0x43f7f9={};_0x43f7f9[_0x3cae('0x2e')]=_[_0x3cae('0x2b')](db[_0x3cae('0x26')][_0x3cae('0x3b')]);_0x43f7f9[_0x3cae('0x2a')]=_[_0x3cae('0x2b')](_0x3a78a6[_0x3cae('0x2a')]);_0x43f7f9[_0x3cae('0x2c')]=_[_0x3cae('0x2d')](_0x43f7f9['model'],_0x43f7f9[_0x3cae('0x2a')]);_0x424420[_0x3cae('0x2f')]=_[_0x3cae('0x2d')](_0x43f7f9[_0x3cae('0x2e')],qs[_0x3cae('0x30')](_0x3a78a6[_0x3cae('0x2a')][_0x3cae('0x30')]));_0x424420[_0x3cae('0x2f')]=_0x424420['attributes'][_0x3cae('0x3c')]?_0x424420['attributes']:_0x43f7f9['model'];if(_0x3a78a6['query'][_0x3cae('0x3d')]){_0x424420[_0x3cae('0x37')]=[{'all':!![]}];}_0x424420=_[_0x3cae('0x36')]({},_0x424420,_0x3a78a6[_0x3cae('0x3e')]);return db['MailSubstatus'][_0x3cae('0x3f')](_0x424420)[_0x3cae('0x20')](handleEntityNotFound(_0x17e3c3,null))[_0x3cae('0x20')](respondWithResult(_0x17e3c3,null))[_0x3cae('0x40')](handleError(_0x17e3c3,null));};exports[_0x3cae('0x41')]=function(_0x359892,_0x393490){return db[_0x3cae('0x26')]['create'](_0x359892[_0x3cae('0x42')],{})[_0x3cae('0x20')](respondWithResult(_0x393490,0xc9))[_0x3cae('0x40')](handleError(_0x393490,null));};exports[_0x3cae('0x43')]=function(_0x219912,_0x4d0024){if(_0x219912[_0x3cae('0x42')]['id']){delete _0x219912['body']['id'];}return db[_0x3cae('0x26')][_0x3cae('0x3f')]({'where':{'id':_0x219912[_0x3cae('0x3a')]['id']}})[_0x3cae('0x20')](handleEntityNotFound(_0x4d0024,null))[_0x3cae('0x20')](saveUpdates(_0x219912[_0x3cae('0x42')],null))[_0x3cae('0x20')](respondWithResult(_0x4d0024,null))[_0x3cae('0x40')](handleError(_0x4d0024,null));};exports[_0x3cae('0x44')]=function(_0x3e2099,_0x18491b){return db[_0x3cae('0x26')][_0x3cae('0x3f')]({'where':{'id':_0x3e2099['params']['id']}})['then'](handleEntityNotFound(_0x18491b,null))[_0x3cae('0x20')](removeEntity(_0x18491b,null))[_0x3cae('0x40')](handleError(_0x18491b,null));};exports[_0x3cae('0x45')]=function(_0x2c6d9e,_0x5ba11c){return db[_0x3cae('0x26')][_0x3cae('0x45')]()[_0x3cae('0x20')](respondWithResult(_0x5ba11c,null))['catch'](handleError(_0x5ba11c,null));}; \ No newline at end of file +var _0xfbc7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','reject','update','destroy','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','merge','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x4b882b,_0x11e12b){var _0x5ab884=function(_0x36b978){while(--_0x36b978){_0x4b882b['push'](_0x4b882b['shift']());}};_0x5ab884(++_0x11e12b);}(_0xfbc7,0x8b));var _0x7fbc=function(_0x9c41a1,_0x2f74d5){_0x9c41a1=_0x9c41a1-0x0;var _0x34d7a6=_0xfbc7[_0x9c41a1];return _0x34d7a6;};'use strict';var pdf=require(_0x7fbc('0x0'));var emlformat=require(_0x7fbc('0x1'));var rimraf=require(_0x7fbc('0x2'));var zipdir=require(_0x7fbc('0x3'));var jsonpatch=require(_0x7fbc('0x4'));var rp=require(_0x7fbc('0x5'));var moment=require(_0x7fbc('0x6'));var BPromise=require(_0x7fbc('0x7'));var Mustache=require('mustache');var util=require(_0x7fbc('0x8'));var path=require(_0x7fbc('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7fbc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7fbc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7fbc('0xc'));var toCsv=require(_0x7fbc('0xd'));var querystring=require(_0x7fbc('0xe'));var Papa=require(_0x7fbc('0xf'));var Redis=require(_0x7fbc('0x10'));var authService=require(_0x7fbc('0x11'));var qs=require(_0x7fbc('0x12'));var as=require(_0x7fbc('0x13'));var hardwareService=require(_0x7fbc('0x14'));var logger=require(_0x7fbc('0x15'))(_0x7fbc('0x16'));var utils=require(_0x7fbc('0x17'));var config=require(_0x7fbc('0x18'));var db=require(_0x7fbc('0x19'))['db'];function respondWithStatusCode(_0xf853,_0x2c8a25){_0x2c8a25=_0x2c8a25||0xcc;return function(_0x5287c0){if(_0x5287c0){return _0xf853[_0x7fbc('0x1a')](_0x2c8a25);}return _0xf853[_0x7fbc('0x1b')](_0x2c8a25)['end']();};}function respondWithResult(_0x168069,_0x3f29f1){_0x3f29f1=_0x3f29f1||0xc8;return function(_0x50ff95){if(_0x50ff95){return _0x168069[_0x7fbc('0x1b')](_0x3f29f1)[_0x7fbc('0x1c')](_0x50ff95);}};}function respondWithFilteredResult(_0x46ce75,_0x468885){return function(_0x3da11a){if(_0x3da11a){var _0x13dcff=_0x3da11a[_0x7fbc('0x1d')],_0x3a76bf=_0x468885['offset'],_0x2362f4=_0x468885['offset']+_0x468885[_0x7fbc('0x1e')],_0x50f804;if(_0x2362f4>=_0x13dcff){_0x2362f4=_0x13dcff;_0x50f804=0xc8;}else{_0x50f804=0xce;}_0x46ce75[_0x7fbc('0x1b')](_0x50f804);return _0x46ce75[_0x7fbc('0x1f')](_0x7fbc('0x20'),_0x3a76bf+'-'+_0x2362f4+'/'+_0x13dcff)[_0x7fbc('0x1c')](_0x3da11a);}return null;};}function patchUpdates(_0x49a201){return function(_0x351296){try{jsonpatch['apply'](_0x351296,_0x49a201,!![]);}catch(_0xb6fd25){return BPromise[_0x7fbc('0x21')](_0xb6fd25);}return _0x351296['save']();};}function saveUpdates(_0x14ff89,_0xcf3251){return function(_0x16e23b){if(_0x16e23b){return _0x16e23b[_0x7fbc('0x22')](_0x14ff89)['then'](function(_0x5b0e79){return _0x5b0e79;});}return null;};}function removeEntity(_0x3cdbb8,_0x5e07fd){return function(_0x1bd830){if(_0x1bd830){return _0x1bd830[_0x7fbc('0x23')]()['then'](function(){_0x3cdbb8[_0x7fbc('0x1b')](0xcc)[_0x7fbc('0x24')]();});}};}function handleEntityNotFound(_0x2d2843,_0x385add){return function(_0x297256){if(!_0x297256){_0x2d2843[_0x7fbc('0x1a')](0x194);}return _0x297256;};}function handleError(_0x35a889,_0x179f9f){_0x179f9f=_0x179f9f||0x1f4;return function(_0x199767){logger[_0x7fbc('0x25')](_0x199767[_0x7fbc('0x26')]);if(_0x199767[_0x7fbc('0x27')]){delete _0x199767[_0x7fbc('0x27')];}_0x35a889[_0x7fbc('0x1b')](_0x179f9f)[_0x7fbc('0x28')](_0x199767);};}exports[_0x7fbc('0x29')]=function(_0x33c929,_0x4efd14){var _0x30c9c6={},_0x268381={},_0x562fab={'count':0x0,'rows':[]};var _0x79ef1c=_[_0x7fbc('0x2a')](db[_0x7fbc('0x2b')][_0x7fbc('0x2c')],function(_0x2d3008){return{'name':_0x2d3008[_0x7fbc('0x2d')],'type':_0x2d3008[_0x7fbc('0x2e')][_0x7fbc('0x2f')]};});_0x268381[_0x7fbc('0x30')]=_[_0x7fbc('0x2a')](_0x79ef1c,_0x7fbc('0x27'));_0x268381[_0x7fbc('0x31')]=_[_0x7fbc('0x32')](_0x33c929[_0x7fbc('0x31')]);_0x268381[_0x7fbc('0x33')]=_[_0x7fbc('0x34')](_0x268381['model'],_0x268381['query']);_0x30c9c6[_0x7fbc('0x35')]=_[_0x7fbc('0x34')](_0x268381['model'],qs[_0x7fbc('0x36')](_0x33c929['query'][_0x7fbc('0x36')]));_0x30c9c6['attributes']=_0x30c9c6[_0x7fbc('0x35')][_0x7fbc('0x37')]?_0x30c9c6['attributes']:_0x268381[_0x7fbc('0x30')];if(!_0x33c929['query'][_0x7fbc('0x38')](_0x7fbc('0x39'))){_0x30c9c6[_0x7fbc('0x1e')]=qs[_0x7fbc('0x1e')](_0x33c929[_0x7fbc('0x31')][_0x7fbc('0x1e')]);_0x30c9c6[_0x7fbc('0x3a')]=qs[_0x7fbc('0x3a')](_0x33c929[_0x7fbc('0x31')][_0x7fbc('0x3a')]);}_0x30c9c6[_0x7fbc('0x3b')]=qs[_0x7fbc('0x3c')](_0x33c929[_0x7fbc('0x31')]['sort']);_0x30c9c6[_0x7fbc('0x3d')]=qs['filters'](_[_0x7fbc('0x3e')](_0x33c929[_0x7fbc('0x31')],_0x268381['filters']),_0x79ef1c);if(_0x33c929[_0x7fbc('0x31')][_0x7fbc('0x3f')]){_0x30c9c6[_0x7fbc('0x3d')]=_['merge'](_0x30c9c6[_0x7fbc('0x3d')],{'$or':_[_0x7fbc('0x2a')](_0x79ef1c,function(_0x337c90){if(_0x337c90[_0x7fbc('0x2e')]!==_0x7fbc('0x40')){var _0xbab22f={};_0xbab22f[_0x337c90['name']]={'$like':'%'+_0x33c929[_0x7fbc('0x31')][_0x7fbc('0x3f')]+'%'};return _0xbab22f;}})});}_0x30c9c6=_['merge']({},_0x30c9c6,_0x33c929[_0x7fbc('0x41')]);var _0x1e5ca9={'where':_0x30c9c6['where']};return db['MailSubstatus']['count'](_0x1e5ca9)[_0x7fbc('0x42')](function(_0x310dcc){_0x562fab[_0x7fbc('0x1d')]=_0x310dcc;if(_0x33c929[_0x7fbc('0x31')][_0x7fbc('0x43')]){_0x30c9c6[_0x7fbc('0x44')]=[{'all':!![]}];}return db[_0x7fbc('0x2b')][_0x7fbc('0x45')](_0x30c9c6);})['then'](function(_0x4fed77){_0x562fab[_0x7fbc('0x46')]=_0x4fed77;return _0x562fab;})[_0x7fbc('0x42')](respondWithFilteredResult(_0x4efd14,_0x30c9c6))[_0x7fbc('0x47')](handleError(_0x4efd14,null));};exports['show']=function(_0x4e66d7,_0x1713ab){var _0x3cb9a5={'raw':!![],'where':{'id':_0x4e66d7[_0x7fbc('0x48')]['id']}},_0x5c07e5={};_0x5c07e5[_0x7fbc('0x30')]=_[_0x7fbc('0x32')](db[_0x7fbc('0x2b')]['rawAttributes']);_0x5c07e5['query']=_['keys'](_0x4e66d7[_0x7fbc('0x31')]);_0x5c07e5[_0x7fbc('0x33')]=_['intersection'](_0x5c07e5[_0x7fbc('0x30')],_0x5c07e5[_0x7fbc('0x31')]);_0x3cb9a5[_0x7fbc('0x35')]=_[_0x7fbc('0x34')](_0x5c07e5[_0x7fbc('0x30')],qs[_0x7fbc('0x36')](_0x4e66d7[_0x7fbc('0x31')]['fields']));_0x3cb9a5[_0x7fbc('0x35')]=_0x3cb9a5[_0x7fbc('0x35')][_0x7fbc('0x37')]?_0x3cb9a5['attributes']:_0x5c07e5['model'];if(_0x4e66d7[_0x7fbc('0x31')][_0x7fbc('0x43')]){_0x3cb9a5['include']=[{'all':!![]}];}_0x3cb9a5=_[_0x7fbc('0x49')]({},_0x3cb9a5,_0x4e66d7[_0x7fbc('0x41')]);return db[_0x7fbc('0x2b')]['find'](_0x3cb9a5)['then'](handleEntityNotFound(_0x1713ab,null))[_0x7fbc('0x42')](respondWithResult(_0x1713ab,null))['catch'](handleError(_0x1713ab,null));};exports['create']=function(_0x3048ae,_0x563023){return db['MailSubstatus'][_0x7fbc('0x4a')](_0x3048ae[_0x7fbc('0x4b')],{})[_0x7fbc('0x42')](respondWithResult(_0x563023,0xc9))[_0x7fbc('0x47')](handleError(_0x563023,null));};exports['update']=function(_0x3da37a,_0x2ee1e2){if(_0x3da37a[_0x7fbc('0x4b')]['id']){delete _0x3da37a[_0x7fbc('0x4b')]['id'];}return db[_0x7fbc('0x2b')][_0x7fbc('0x4c')]({'where':{'id':_0x3da37a['params']['id']}})[_0x7fbc('0x42')](handleEntityNotFound(_0x2ee1e2,null))[_0x7fbc('0x42')](saveUpdates(_0x3da37a[_0x7fbc('0x4b')],null))[_0x7fbc('0x42')](respondWithResult(_0x2ee1e2,null))[_0x7fbc('0x47')](handleError(_0x2ee1e2,null));};exports['destroy']=function(_0x407a5f,_0x22850d){return db[_0x7fbc('0x2b')][_0x7fbc('0x4c')]({'where':{'id':_0x407a5f['params']['id']}})[_0x7fbc('0x42')](handleEntityNotFound(_0x22850d,null))[_0x7fbc('0x42')](removeEntity(_0x22850d,null))[_0x7fbc('0x47')](handleError(_0x22850d,null));};exports[_0x7fbc('0x4d')]=function(_0x1229bf,_0x54587c){return db[_0x7fbc('0x2b')][_0x7fbc('0x4d')]()['then'](respondWithResult(_0x54587c,null))[_0x7fbc('0x47')](handleError(_0x54587c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 365ea54..7f9e0fc 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 _0x7506=['rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x15a03f,_0x14b92f){var _0x53d06b=function(_0x8477ce){while(--_0x8477ce){_0x15a03f['push'](_0x15a03f['shift']());}};_0x53d06b(++_0x14b92f);}(_0x7506,0x172));var _0x6750=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x7506[_0xaa0309];return _0x5de7ce;};'use strict';var _=require(_0x6750('0x0'));var util=require(_0x6750('0x1'));var logger=require(_0x6750('0x2'))(_0x6750('0x3'));var moment=require('moment');var BPromise=require(_0x6750('0x4'));var rp=require(_0x6750('0x5'));var fs=require('fs');var path=require(_0x6750('0x6'));var rimraf=require(_0x6750('0x7'));var config=require(_0x6750('0x8'));var attributes=require(_0x6750('0x9'));module['exports']=function(_0x33eb0c,_0x57e597){return _0x33eb0c[_0x6750('0xa')](_0x6750('0xb'),attributes,{'tableName':_0x6750('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x554c=['bluebird','request-promise','rimraf','../../config/environment','exports','define','MailSubstatus','lodash','util','../../config/logger','api','moment'];(function(_0x8e5205,_0x3b63e7){var _0x2f6d68=function(_0x236cd0){while(--_0x236cd0){_0x8e5205['push'](_0x8e5205['shift']());}};_0x2f6d68(++_0x3b63e7);}(_0x554c,0x187));var _0xc554=function(_0x411f3b,_0x4444c8){_0x411f3b=_0x411f3b-0x0;var _0x31439b=_0x554c[_0x411f3b];return _0x31439b;};'use strict';var _=require(_0xc554('0x0'));var util=require(_0xc554('0x1'));var logger=require(_0xc554('0x2'))(_0xc554('0x3'));var moment=require(_0xc554('0x4'));var BPromise=require(_0xc554('0x5'));var rp=require(_0xc554('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc554('0x7'));var config=require(_0xc554('0x8'));var attributes=require('./mailSubstatus.attributes');module[_0xc554('0x9')]=function(_0x4f9912,_0x48fbb2){return _0x4f9912[_0xc554('0xa')](_0xc554('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index d91cea4..25c66a4 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 _0xe706=['http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x418269,_0x16e305){var _0x48cccd=function(_0x192f7e){while(--_0x192f7e){_0x418269['push'](_0x418269['shift']());}};_0x48cccd(++_0x16e305);}(_0xe706,0xa3));var _0x6e70=function(_0x4d4c63,_0x33ac30){_0x4d4c63=_0x4d4c63-0x0;var _0x383b63=_0xe706[_0x4d4c63];return _0x383b63;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0x5ff3=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','MailSubstatus,\x20%s,\x20%s'];(function(_0x3d452c,_0x303cb5){var _0x427c44=function(_0x8d57a1){while(--_0x8d57a1){_0x3d452c['push'](_0x3d452c['shift']());}};_0x427c44(++_0x303cb5);}(_0x5ff3,0x17d));var _0x35ff=function(_0xbfe0b,_0x604816){_0xbfe0b=_0xbfe0b-0x0;var _0x4a82db=_0x5ff3[_0xbfe0b];return _0x4a82db;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index b840c0c..88c5338 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 _0x45a6=['Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x5623a3,_0x43cc19){var _0x1f7409=function(_0x15424c){while(--_0x15424c){_0x5623a3['push'](_0x5623a3['shift']());}};_0x1f7409(++_0x43cc19);}(_0x45a6,0xf3));var _0x645a=function(_0x41ff6e,_0x540135){_0x41ff6e=_0x41ff6e-0x0;var _0x33d458=_0x45a6[_0x41ff6e];return _0x33d458;};'use strict';var multer=require(_0x645a('0x0'));var util=require(_0x645a('0x1'));var path=require(_0x645a('0x2'));var timeout=require(_0x645a('0x3'));var express=require('express');var router=express[_0x645a('0x4')]();var auth=require(_0x645a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x645a('0x6'));var controller=require(_0x645a('0x7'));router['get']('/',auth[_0x645a('0x8')](),controller[_0x645a('0x9')]);router[_0x645a('0xa')](_0x645a('0xb'),auth[_0x645a('0x8')](),controller[_0x645a('0xc')]);router[_0x645a('0xa')](_0x645a('0xd'),auth[_0x645a('0x8')](),controller['show']);router[_0x645a('0xe')]('/',auth['isAuthenticated'](),controller[_0x645a('0xf')]);router[_0x645a('0x10')]('/:id',auth[_0x645a('0x8')](),controller[_0x645a('0x11')]);router[_0x645a('0x12')](_0x645a('0xd'),auth[_0x645a('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xe601=['delete','/:id','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','put','update'];(function(_0x28b2a2,_0x557398){var _0x51483c=function(_0x5c7cd9){while(--_0x5c7cd9){_0x28b2a2['push'](_0x28b2a2['shift']());}};_0x51483c(++_0x557398);}(_0xe601,0x168));var _0x1e60=function(_0x25ae1c,_0x516dfc){_0x25ae1c=_0x25ae1c-0x0;var _0x11af93=_0xe601[_0x25ae1c];return _0x11af93;};'use strict';var multer=require(_0x1e60('0x0'));var util=require(_0x1e60('0x1'));var path=require(_0x1e60('0x2'));var timeout=require(_0x1e60('0x3'));var express=require(_0x1e60('0x4'));var router=express['Router']();var auth=require(_0x1e60('0x5'));var interaction=require(_0x1e60('0x6'));var config=require('../../config/environment');var controller=require(_0x1e60('0x7'));router[_0x1e60('0x8')]('/',auth[_0x1e60('0x9')](),controller[_0x1e60('0xa')]);router[_0x1e60('0x8')](_0x1e60('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x1e60('0x8')]('/:id',auth[_0x1e60('0x9')](),controller['show']);router['post']('/',auth[_0x1e60('0x9')](),controller['create']);router[_0x1e60('0xc')]('/:id',auth[_0x1e60('0x9')](),controller[_0x1e60('0xd')]);router[_0x1e60('0xe')](_0x1e60('0xf'),auth[_0x1e60('0x9')](),controller[_0x1e60('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 812f75d..ec51877 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 _0x7433=['account','queue','DATE','NOW','moment','exports','STRING','ENUM'];(function(_0x38e67d,_0x12ded8){var _0x1de06d=function(_0xa67021){while(--_0xa67021){_0x38e67d['push'](_0x38e67d['shift']());}};_0x1de06d(++_0x12ded8);}(_0x7433,0x144));var _0x3743=function(_0x7b8b47,_0x274711){_0x7b8b47=_0x7b8b47-0x0;var _0x5b3c2a=_0x7433[_0x7b8b47];return _0x5b3c2a;};'use strict';var moment=require(_0x3743('0x0'));var Sequelize=require('sequelize');module[_0x3743('0x1')]={'uniqueid':{'type':Sequelize[_0x3743('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3743('0x3')](_0x3743('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0x3743('0x5')},'transferredAt':{'type':Sequelize[_0x3743('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x3743('0x7')]}}; \ No newline at end of file +var _0x4eee=['moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE','NOW'];(function(_0x35160c,_0x3c16a4){var _0x21feb2=function(_0x1efda3){while(--_0x1efda3){_0x35160c['push'](_0x35160c['shift']());}};_0x21feb2(++_0x3c16a4);}(_0x4eee,0x154));var _0xe4ee=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x4eee[_0x56138f];return _0x1acaf7;};'use strict';var moment=require(_0xe4ee('0x0'));var Sequelize=require(_0xe4ee('0x1'));module[_0xe4ee('0x2')]={'uniqueid':{'type':Sequelize[_0xe4ee('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe4ee('0x4')](_0xe4ee('0x5'),_0xe4ee('0x6'),_0xe4ee('0x7')),'allowNull':![],'defaultValue':_0xe4ee('0x7')},'transferredAt':{'type':Sequelize[_0xe4ee('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xe4ee('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 93235be..173f9b3 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 _0x50b3=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','MailTransferReport','type','key','model','query'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0x50b3,0x172));var _0x350b=function(_0x258257,_0x32042d){_0x258257=_0x258257-0x0;var _0xafb58a=_0x50b3[_0x258257];return _0xafb58a;};'use strict';var pdf=require(_0x350b('0x0'));var emlformat=require(_0x350b('0x1'));var rimraf=require(_0x350b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x350b('0x3'));var rp=require(_0x350b('0x4'));var moment=require(_0x350b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x350b('0x6'));var util=require(_0x350b('0x7'));var path=require(_0x350b('0x8'));var sox=require(_0x350b('0x9'));var csv=require(_0x350b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x350b('0xb'));var squel=require('squel');var crypto=require(_0x350b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x350b('0xd'));var toCsv=require(_0x350b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x350b('0xe'));var authService=require(_0x350b('0xf'));var qs=require(_0x350b('0x10'));var as=require(_0x350b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x350b('0x12'))('api');var utils=require(_0x350b('0x13'));var config=require(_0x350b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x598465,_0x37bc32){_0x37bc32=_0x37bc32||0xcc;return function(_0x204411){if(_0x204411){return _0x598465[_0x350b('0x15')](_0x37bc32);}return _0x598465[_0x350b('0x16')](_0x37bc32)[_0x350b('0x17')]();};}function respondWithResult(_0x54dfad,_0x4d3a8d){_0x4d3a8d=_0x4d3a8d||0xc8;return function(_0x4ec140){if(_0x4ec140){return _0x54dfad[_0x350b('0x16')](_0x4d3a8d)[_0x350b('0x18')](_0x4ec140);}};}function respondWithFilteredResult(_0x5e3002,_0x52f880){return function(_0x2f903){if(_0x2f903){var _0x381801=_0x2f903[_0x350b('0x19')],_0xc6cb13=_0x52f880[_0x350b('0x1a')],_0x357ec4=_0x52f880[_0x350b('0x1a')]+_0x52f880['limit'],_0x4e090e;if(_0x357ec4>=_0x381801){_0x357ec4=_0x381801;_0x4e090e=0xc8;}else{_0x4e090e=0xce;}_0x5e3002[_0x350b('0x16')](_0x4e090e);return _0x5e3002[_0x350b('0x1b')](_0x350b('0x1c'),_0xc6cb13+'-'+_0x357ec4+'/'+_0x381801)[_0x350b('0x18')](_0x2f903);}return null;};}function patchUpdates(_0x450507){return function(_0x987af9){try{jsonpatch[_0x350b('0x1d')](_0x987af9,_0x450507,!![]);}catch(_0x420179){return BPromise['reject'](_0x420179);}return _0x987af9[_0x350b('0x1e')]();};}function saveUpdates(_0x25b1d3,_0x59ae7c){return function(_0x9dd5bb){if(_0x9dd5bb){return _0x9dd5bb[_0x350b('0x1f')](_0x25b1d3)['then'](function(_0x499d76){return _0x499d76;});}return null;};}function removeEntity(_0x2784c7,_0x329639){return function(_0x4ae237){if(_0x4ae237){return _0x4ae237[_0x350b('0x20')]()[_0x350b('0x21')](function(){_0x2784c7[_0x350b('0x16')](0xcc)[_0x350b('0x17')]();});}};}function handleEntityNotFound(_0x1c1ae7,_0x10535c){return function(_0x2c1e9a){if(!_0x2c1e9a){_0x1c1ae7[_0x350b('0x15')](0x194);}return _0x2c1e9a;};}function handleError(_0x4d129d,_0x48c0d2){_0x48c0d2=_0x48c0d2||0x1f4;return function(_0x34c7f1){logger['error'](_0x34c7f1[_0x350b('0x22')]);if(_0x34c7f1[_0x350b('0x23')]){delete _0x34c7f1[_0x350b('0x23')];}_0x4d129d['status'](_0x48c0d2)[_0x350b('0x24')](_0x34c7f1);};}exports[_0x350b('0x25')]=function(_0x42194a,_0x2d5724){var _0x35fca1={},_0x5cfd5a={},_0x13808e={'count':0x0,'rows':[]};var _0x2e7b00=_[_0x350b('0x26')](db[_0x350b('0x27')]['rawAttributes'],function(_0x3a71bf){return{'name':_0x3a71bf['fieldName'],'type':_0x3a71bf[_0x350b('0x28')][_0x350b('0x29')]};});_0x5cfd5a[_0x350b('0x2a')]=_[_0x350b('0x26')](_0x2e7b00,'name');_0x5cfd5a[_0x350b('0x2b')]=_[_0x350b('0x2c')](_0x42194a[_0x350b('0x2b')]);_0x5cfd5a[_0x350b('0x2d')]=_[_0x350b('0x2e')](_0x5cfd5a[_0x350b('0x2a')],_0x5cfd5a[_0x350b('0x2b')]);_0x35fca1['attributes']=_[_0x350b('0x2e')](_0x5cfd5a[_0x350b('0x2a')],qs[_0x350b('0x2f')](_0x42194a[_0x350b('0x2b')][_0x350b('0x2f')]));_0x35fca1[_0x350b('0x30')]=_0x35fca1[_0x350b('0x30')][_0x350b('0x31')]?_0x35fca1['attributes']:_0x5cfd5a[_0x350b('0x2a')];if(!_0x42194a[_0x350b('0x2b')][_0x350b('0x32')]('nolimit')){_0x35fca1[_0x350b('0x33')]=qs[_0x350b('0x33')](_0x42194a[_0x350b('0x2b')]['limit']);_0x35fca1['offset']=qs[_0x350b('0x1a')](_0x42194a[_0x350b('0x2b')][_0x350b('0x1a')]);}_0x35fca1[_0x350b('0x34')]=qs[_0x350b('0x35')](_0x42194a[_0x350b('0x2b')][_0x350b('0x35')]);_0x35fca1[_0x350b('0x36')]=qs['filters'](_[_0x350b('0x37')](_0x42194a['query'],_0x5cfd5a[_0x350b('0x2d')]),_0x2e7b00);if(_0x42194a[_0x350b('0x2b')][_0x350b('0x38')]){_0x35fca1[_0x350b('0x36')]=_[_0x350b('0x39')](_0x35fca1[_0x350b('0x36')],{'$or':_[_0x350b('0x26')](_0x2e7b00,function(_0x3887c7){if(_0x3887c7[_0x350b('0x28')]!==_0x350b('0x3a')){var _0x4ecfaf={};_0x4ecfaf[_0x3887c7['name']]={'$like':'%'+_0x42194a[_0x350b('0x2b')][_0x350b('0x38')]+'%'};return _0x4ecfaf;}})});}_0x35fca1=_['merge']({},_0x35fca1,_0x42194a['options']);var _0x3f5715={'where':_0x35fca1[_0x350b('0x36')]};return db[_0x350b('0x27')][_0x350b('0x19')](_0x3f5715)[_0x350b('0x21')](function(_0x34edf0){_0x13808e[_0x350b('0x19')]=_0x34edf0;if(_0x42194a['query'][_0x350b('0x3b')]){_0x35fca1['include']=[{'all':!![]}];}return db[_0x350b('0x27')]['findAll'](_0x35fca1);})['then'](function(_0x3a45dc){_0x13808e[_0x350b('0x3c')]=_0x3a45dc;return _0x13808e;})[_0x350b('0x21')](respondWithFilteredResult(_0x2d5724,_0x35fca1))[_0x350b('0x3d')](handleError(_0x2d5724,null));};exports['show']=function(_0x3fc389,_0x3ce613){var _0x3b592d={'raw':!![],'where':{'id':_0x3fc389[_0x350b('0x3e')]['id']}},_0x2e33f8={};_0x2e33f8[_0x350b('0x2a')]=_['keys'](db[_0x350b('0x27')]['rawAttributes']);_0x2e33f8['query']=_[_0x350b('0x2c')](_0x3fc389['query']);_0x2e33f8[_0x350b('0x2d')]=_[_0x350b('0x2e')](_0x2e33f8['model'],_0x2e33f8[_0x350b('0x2b')]);_0x3b592d[_0x350b('0x30')]=_[_0x350b('0x2e')](_0x2e33f8[_0x350b('0x2a')],qs['fields'](_0x3fc389[_0x350b('0x2b')]['fields']));_0x3b592d['attributes']=_0x3b592d['attributes']['length']?_0x3b592d[_0x350b('0x30')]:_0x2e33f8[_0x350b('0x2a')];if(_0x3fc389['query']['includeAll']){_0x3b592d[_0x350b('0x3f')]=[{'all':!![]}];}_0x3b592d=_[_0x350b('0x39')]({},_0x3b592d,_0x3fc389[_0x350b('0x40')]);return db[_0x350b('0x27')][_0x350b('0x41')](_0x3b592d)[_0x350b('0x21')](handleEntityNotFound(_0x3ce613,null))[_0x350b('0x21')](respondWithResult(_0x3ce613,null))[_0x350b('0x3d')](handleError(_0x3ce613,null));};exports[_0x350b('0x42')]=function(_0x21253b,_0x56b06f){return db['MailTransferReport'][_0x350b('0x42')](_0x21253b[_0x350b('0x43')],{})[_0x350b('0x21')](respondWithResult(_0x56b06f,0xc9))['catch'](handleError(_0x56b06f,null));};exports[_0x350b('0x1f')]=function(_0x109f85,_0x57cba8){if(_0x109f85[_0x350b('0x43')]['id']){delete _0x109f85[_0x350b('0x43')]['id'];}return db[_0x350b('0x27')][_0x350b('0x41')]({'where':{'id':_0x109f85['params']['id']}})[_0x350b('0x21')](handleEntityNotFound(_0x57cba8,null))['then'](saveUpdates(_0x109f85[_0x350b('0x43')],null))[_0x350b('0x21')](respondWithResult(_0x57cba8,null))[_0x350b('0x3d')](handleError(_0x57cba8,null));};exports[_0x350b('0x20')]=function(_0x4c6c2a,_0x5e1ae5){return db['MailTransferReport']['find']({'where':{'id':_0x4c6c2a[_0x350b('0x3e')]['id']}})[_0x350b('0x21')](handleEntityNotFound(_0x5e1ae5,null))[_0x350b('0x21')](removeEntity(_0x5e1ae5,null))['catch'](handleError(_0x5e1ae5,null));};exports[_0x350b('0x44')]=function(_0x266257,_0x483d10){return db['MailTransferReport']['describe']()[_0x350b('0x21')](respondWithResult(_0x483d10,null))[_0x350b('0x3d')](handleError(_0x483d10,null));}; \ No newline at end of file +var _0x80bc=['count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailTransferReport','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','rows','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x314b71,_0x27ce15){var _0x268c23=function(_0x2662bd){while(--_0x2662bd){_0x314b71['push'](_0x314b71['shift']());}};_0x268c23(++_0x27ce15);}(_0x80bc,0x75));var _0xc80b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x80bc[_0xfae23b];return _0x200640;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc80b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc80b('0x1'));var jsonpatch=require(_0xc80b('0x2'));var rp=require(_0xc80b('0x3'));var moment=require('moment');var BPromise=require(_0xc80b('0x4'));var Mustache=require(_0xc80b('0x5'));var util=require(_0xc80b('0x6'));var path=require('path');var sox=require(_0xc80b('0x7'));var csv=require(_0xc80b('0x8'));var ejs=require(_0xc80b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc80b('0xa'));var crypto=require(_0xc80b('0xb'));var jsforce=require(_0xc80b('0xc'));var deskjs=require(_0xc80b('0xd'));var toCsv=require(_0xc80b('0x8'));var querystring=require(_0xc80b('0xe'));var Papa=require(_0xc80b('0xf'));var Redis=require(_0xc80b('0x10'));var authService=require(_0xc80b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc80b('0x12'));var hardwareService=require(_0xc80b('0x13'));var logger=require(_0xc80b('0x14'))('api');var utils=require(_0xc80b('0x15'));var config=require(_0xc80b('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fe36e,_0x1575b5){_0x1575b5=_0x1575b5||0xcc;return function(_0x11d566){if(_0x11d566){return _0x1fe36e[_0xc80b('0x17')](_0x1575b5);}return _0x1fe36e[_0xc80b('0x18')](_0x1575b5)[_0xc80b('0x19')]();};}function respondWithResult(_0x534de0,_0x501bf1){_0x501bf1=_0x501bf1||0xc8;return function(_0x1a9bd2){if(_0x1a9bd2){return _0x534de0[_0xc80b('0x18')](_0x501bf1)[_0xc80b('0x1a')](_0x1a9bd2);}};}function respondWithFilteredResult(_0x3e1cd1,_0x1f3a04){return function(_0x57a18e){if(_0x57a18e){var _0x541357=_0x57a18e[_0xc80b('0x1b')],_0x5ba5fa=_0x1f3a04['offset'],_0x3e9141=_0x1f3a04[_0xc80b('0x1c')]+_0x1f3a04[_0xc80b('0x1d')],_0x4bdc9c;if(_0x3e9141>=_0x541357){_0x3e9141=_0x541357;_0x4bdc9c=0xc8;}else{_0x4bdc9c=0xce;}_0x3e1cd1[_0xc80b('0x18')](_0x4bdc9c);return _0x3e1cd1[_0xc80b('0x1e')]('Content-Range',_0x5ba5fa+'-'+_0x3e9141+'/'+_0x541357)[_0xc80b('0x1a')](_0x57a18e);}return null;};}function patchUpdates(_0x1add62){return function(_0x517ddc){try{jsonpatch[_0xc80b('0x1f')](_0x517ddc,_0x1add62,!![]);}catch(_0xecdca6){return BPromise[_0xc80b('0x20')](_0xecdca6);}return _0x517ddc[_0xc80b('0x21')]();};}function saveUpdates(_0x458798,_0x3cbf32){return function(_0x415265){if(_0x415265){return _0x415265[_0xc80b('0x22')](_0x458798)[_0xc80b('0x23')](function(_0x334a55){return _0x334a55;});}return null;};}function removeEntity(_0x5c048e,_0x10832a){return function(_0x13767e){if(_0x13767e){return _0x13767e[_0xc80b('0x24')]()['then'](function(){_0x5c048e[_0xc80b('0x18')](0xcc)[_0xc80b('0x19')]();});}};}function handleEntityNotFound(_0x1a9191,_0x255fb3){return function(_0x50c5a8){if(!_0x50c5a8){_0x1a9191[_0xc80b('0x17')](0x194);}return _0x50c5a8;};}function handleError(_0x2b84f8,_0x246209){_0x246209=_0x246209||0x1f4;return function(_0x506fa9){logger[_0xc80b('0x25')](_0x506fa9[_0xc80b('0x26')]);if(_0x506fa9['name']){delete _0x506fa9[_0xc80b('0x27')];}_0x2b84f8[_0xc80b('0x18')](_0x246209)['send'](_0x506fa9);};}exports[_0xc80b('0x28')]=function(_0x596475,_0x243625){var _0x40a17f={},_0x43eef2={},_0x33c843={'count':0x0,'rows':[]};var _0x1fdb49=_[_0xc80b('0x29')](db[_0xc80b('0x2a')]['rawAttributes'],function(_0x488ed1){return{'name':_0x488ed1[_0xc80b('0x2b')],'type':_0x488ed1[_0xc80b('0x2c')]['key']};});_0x43eef2[_0xc80b('0x2d')]=_[_0xc80b('0x29')](_0x1fdb49,_0xc80b('0x27'));_0x43eef2[_0xc80b('0x2e')]=_[_0xc80b('0x2f')](_0x596475[_0xc80b('0x2e')]);_0x43eef2[_0xc80b('0x30')]=_['intersection'](_0x43eef2[_0xc80b('0x2d')],_0x43eef2['query']);_0x40a17f[_0xc80b('0x31')]=_[_0xc80b('0x32')](_0x43eef2[_0xc80b('0x2d')],qs[_0xc80b('0x33')](_0x596475[_0xc80b('0x2e')][_0xc80b('0x33')]));_0x40a17f[_0xc80b('0x31')]=_0x40a17f[_0xc80b('0x31')][_0xc80b('0x34')]?_0x40a17f[_0xc80b('0x31')]:_0x43eef2[_0xc80b('0x2d')];if(!_0x596475[_0xc80b('0x2e')][_0xc80b('0x35')](_0xc80b('0x36'))){_0x40a17f['limit']=qs['limit'](_0x596475[_0xc80b('0x2e')][_0xc80b('0x1d')]);_0x40a17f[_0xc80b('0x1c')]=qs[_0xc80b('0x1c')](_0x596475[_0xc80b('0x2e')][_0xc80b('0x1c')]);}_0x40a17f[_0xc80b('0x37')]=qs[_0xc80b('0x38')](_0x596475[_0xc80b('0x2e')][_0xc80b('0x38')]);_0x40a17f[_0xc80b('0x39')]=qs[_0xc80b('0x30')](_[_0xc80b('0x3a')](_0x596475[_0xc80b('0x2e')],_0x43eef2[_0xc80b('0x30')]),_0x1fdb49);if(_0x596475[_0xc80b('0x2e')][_0xc80b('0x3b')]){_0x40a17f[_0xc80b('0x39')]=_[_0xc80b('0x3c')](_0x40a17f[_0xc80b('0x39')],{'$or':_[_0xc80b('0x29')](_0x1fdb49,function(_0x2fad11){if(_0x2fad11[_0xc80b('0x2c')]!=='VIRTUAL'){var _0x3b465e={};_0x3b465e[_0x2fad11[_0xc80b('0x27')]]={'$like':'%'+_0x596475[_0xc80b('0x2e')]['filter']+'%'};return _0x3b465e;}})});}_0x40a17f=_['merge']({},_0x40a17f,_0x596475[_0xc80b('0x3d')]);var _0x155f2e={'where':_0x40a17f[_0xc80b('0x39')]};return db[_0xc80b('0x2a')]['count'](_0x155f2e)[_0xc80b('0x23')](function(_0x338baf){_0x33c843[_0xc80b('0x1b')]=_0x338baf;if(_0x596475[_0xc80b('0x2e')]['includeAll']){_0x40a17f['include']=[{'all':!![]}];}return db[_0xc80b('0x2a')]['findAll'](_0x40a17f);})[_0xc80b('0x23')](function(_0x1dfc7f){_0x33c843[_0xc80b('0x3e')]=_0x1dfc7f;return _0x33c843;})[_0xc80b('0x23')](respondWithFilteredResult(_0x243625,_0x40a17f))[_0xc80b('0x3f')](handleError(_0x243625,null));};exports[_0xc80b('0x40')]=function(_0x1b0e0d,_0x5df317){var _0x3832b3={'raw':!![],'where':{'id':_0x1b0e0d[_0xc80b('0x41')]['id']}},_0x4b21ee={};_0x4b21ee['model']=_['keys'](db[_0xc80b('0x2a')][_0xc80b('0x42')]);_0x4b21ee[_0xc80b('0x2e')]=_['keys'](_0x1b0e0d[_0xc80b('0x2e')]);_0x4b21ee[_0xc80b('0x30')]=_['intersection'](_0x4b21ee[_0xc80b('0x2d')],_0x4b21ee['query']);_0x3832b3[_0xc80b('0x31')]=_[_0xc80b('0x32')](_0x4b21ee[_0xc80b('0x2d')],qs['fields'](_0x1b0e0d[_0xc80b('0x2e')][_0xc80b('0x33')]));_0x3832b3[_0xc80b('0x31')]=_0x3832b3['attributes'][_0xc80b('0x34')]?_0x3832b3[_0xc80b('0x31')]:_0x4b21ee[_0xc80b('0x2d')];if(_0x1b0e0d[_0xc80b('0x2e')]['includeAll']){_0x3832b3[_0xc80b('0x43')]=[{'all':!![]}];}_0x3832b3=_[_0xc80b('0x3c')]({},_0x3832b3,_0x1b0e0d[_0xc80b('0x3d')]);return db[_0xc80b('0x2a')][_0xc80b('0x44')](_0x3832b3)[_0xc80b('0x23')](handleEntityNotFound(_0x5df317,null))[_0xc80b('0x23')](respondWithResult(_0x5df317,null))[_0xc80b('0x3f')](handleError(_0x5df317,null));};exports[_0xc80b('0x45')]=function(_0x437115,_0x3a2cea){return db[_0xc80b('0x2a')]['create'](_0x437115[_0xc80b('0x46')],{})[_0xc80b('0x23')](respondWithResult(_0x3a2cea,0xc9))['catch'](handleError(_0x3a2cea,null));};exports['update']=function(_0x3488a7,_0x37556f){if(_0x3488a7[_0xc80b('0x46')]['id']){delete _0x3488a7['body']['id'];}return db[_0xc80b('0x2a')][_0xc80b('0x44')]({'where':{'id':_0x3488a7[_0xc80b('0x41')]['id']}})[_0xc80b('0x23')](handleEntityNotFound(_0x37556f,null))[_0xc80b('0x23')](saveUpdates(_0x3488a7[_0xc80b('0x46')],null))[_0xc80b('0x23')](respondWithResult(_0x37556f,null))[_0xc80b('0x3f')](handleError(_0x37556f,null));};exports[_0xc80b('0x24')]=function(_0x2e8bb4,_0x9dce6d){return db['MailTransferReport'][_0xc80b('0x44')]({'where':{'id':_0x2e8bb4[_0xc80b('0x41')]['id']}})[_0xc80b('0x23')](handleEntityNotFound(_0x9dce6d,null))[_0xc80b('0x23')](removeEntity(_0x9dce6d,null))[_0xc80b('0x3f')](handleError(_0x9dce6d,null));};exports[_0xc80b('0x47')]=function(_0x1b96a0,_0x26f85f){return db['MailTransferReport'][_0xc80b('0x47')]()[_0xc80b('0x23')](respondWithResult(_0x26f85f,null))[_0xc80b('0x3f')](handleError(_0x26f85f,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index b054bff..3183a1d 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 _0xd965=['util','../../config/logger','moment','bluebird','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd965,0x87));var _0x5d96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd965[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x5d96('0x0'));var logger=require(_0x5d96('0x1'))('api');var moment=require(_0x5d96('0x2'));var BPromise=require(_0x5d96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5d96('0x4'));module[_0x5d96('0x5')]=function(_0x46a575,_0x4d644e){return _0x46a575[_0x5d96('0x6')](_0x5d96('0x7'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5d96('0x8')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf0a5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x4659a8,_0x4f69b8){var _0xb1b3f0=function(_0x4401cd){while(--_0x4401cd){_0x4659a8['push'](_0x4659a8['shift']());}};_0xb1b3f0(++_0x4f69b8);}(_0xf0a5,0x1eb));var _0x5f0a=function(_0x341a15,_0xaa08f7){_0x341a15=_0x341a15-0x0;var _0x5d1bd0=_0xf0a5[_0x341a15];return _0x5d1bd0;};'use strict';var _=require(_0x5f0a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5f0a('0x1'));var moment=require(_0x5f0a('0x2'));var BPromise=require(_0x5f0a('0x3'));var rp=require(_0x5f0a('0x4'));var fs=require('fs');var path=require(_0x5f0a('0x5'));var rimraf=require(_0x5f0a('0x6'));var config=require(_0x5f0a('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x5f0a('0x8')]=function(_0x5796de,_0xcdd9bf){return _0x5796de['define'](_0x5f0a('0x9'),attributes,{'tableName':_0x5f0a('0xa'),'paranoid':![],'indexes':[{'name':_0x5f0a('0xb'),'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 804aecb..d9ab87f 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 _0x559e=['message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x359208,_0x36a877){var _0x1adcf8=function(_0x19ccf5){while(--_0x19ccf5){_0x359208['push'](_0x359208['shift']());}};_0x1adcf8(++_0x36a877);}(_0x559e,0x82));var _0xe559=function(_0x1f300b,_0x4ee744){_0x1f300b=_0x1f300b-0x0;var _0x2a4d8b=_0x559e[_0x1f300b];return _0x2a4d8b;};'use strict';var _=require(_0xe559('0x0'));var util=require(_0xe559('0x1'));var moment=require(_0xe559('0x2'));var BPromise=require('bluebird');var rs=require(_0xe559('0x3'));var fs=require('fs');var Redis=require(_0xe559('0x4'));var db=require(_0xe559('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe559('0x6'))('rpc');var config=require(_0xe559('0x7'));var jayson=require(_0xe559('0x8'));var client=jayson[_0xe559('0x9')][_0xe559('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ba2ab,_0x4f59f5,_0x582575){return new BPromise(function(_0x2d8dbd,_0x5d6ea5){return client[_0xe559('0xb')](_0x4ba2ab,_0x582575)['then'](function(_0x468979){logger['info'](_0xe559('0xc'),_0x4f59f5,_0xe559('0xd'));logger[_0xe559('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4f59f5,_0xe559('0xd'),JSON[_0xe559('0xf')](_0x468979));if(_0x468979['error']){if(_0x468979['error']['code']===0x1f4){logger[_0xe559('0x10')](_0xe559('0xc'),_0x4f59f5,_0x468979[_0xe559('0x10')][_0xe559('0x11')]);return _0x5d6ea5(_0x468979['error'][_0xe559('0x11')]);}logger[_0xe559('0x10')](_0xe559('0xc'),_0x4f59f5,_0x468979[_0xe559('0x10')]['message']);return _0x2d8dbd(_0x468979['error'][_0xe559('0x11')]);}else{logger[_0xe559('0x12')](_0xe559('0xc'),_0x4f59f5,_0xe559('0xd'));_0x2d8dbd(_0x468979[_0xe559('0x13')]['message']);}})[_0xe559('0x14')](function(_0xfa2a0d){logger[_0xe559('0x10')](_0xe559('0xc'),_0x4f59f5,_0xfa2a0d);_0x5d6ea5(_0xfa2a0d);});});} \ No newline at end of file +var _0xf679=['then','info','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xf679,0xa4));var _0x9f67=function(_0x4c77b7,_0x36c5dc){_0x4c77b7=_0x4c77b7-0x0;var _0x52bdd7=_0xf679[_0x4c77b7];return _0x52bdd7;};'use strict';var _=require(_0x9f67('0x0'));var util=require(_0x9f67('0x1'));var moment=require(_0x9f67('0x2'));var BPromise=require('bluebird');var rs=require(_0x9f67('0x3'));var fs=require('fs');var Redis=require(_0x9f67('0x4'));var db=require(_0x9f67('0x5'))['db'];var utils=require(_0x9f67('0x6'));var logger=require(_0x9f67('0x7'))(_0x9f67('0x8'));var config=require(_0x9f67('0x9'));var jayson=require(_0x9f67('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1fdc37,_0x14f394,_0x5f461c){return new BPromise(function(_0x50b4cb,_0x488da4){return client[_0x9f67('0xb')](_0x1fdc37,_0x5f461c)[_0x9f67('0xc')](function(_0x9edd11){logger[_0x9f67('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x14f394,'request\x20sent');logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x14f394,_0x9f67('0xe'),JSON[_0x9f67('0xf')](_0x9edd11));if(_0x9edd11['error']){if(_0x9edd11[_0x9f67('0x10')][_0x9f67('0x11')]===0x1f4){logger[_0x9f67('0x10')](_0x9f67('0x12'),_0x14f394,_0x9edd11[_0x9f67('0x10')][_0x9f67('0x13')]);return _0x488da4(_0x9edd11[_0x9f67('0x10')][_0x9f67('0x13')]);}logger['error'](_0x9f67('0x12'),_0x14f394,_0x9edd11['error']['message']);return _0x50b4cb(_0x9edd11[_0x9f67('0x10')][_0x9f67('0x13')]);}else{logger[_0x9f67('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x14f394,_0x9f67('0xe'));_0x50b4cb(_0x9edd11[_0x9f67('0x14')]['message']);}})[_0x9f67('0x15')](function(_0x20361c){logger['error'](_0x9f67('0x12'),_0x14f394,_0x20361c);_0x488da4(_0x20361c);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6a74b2b..facdb47 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 _0xf983=['destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x40f7f8,_0x45b81f){var _0x552bef=function(_0x2fd838){while(--_0x2fd838){_0x40f7f8['push'](_0x40f7f8['shift']());}};_0x552bef(++_0x45b81f);}(_0xf983,0x1ca));var _0x3f98=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xf983[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x3f98('0x0'));var util=require('util');var path=require(_0x3f98('0x1'));var timeout=require(_0x3f98('0x2'));var express=require(_0x3f98('0x3'));var router=express['Router']();var auth=require(_0x3f98('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3f98('0x5'));var controller=require('./memberReport.controller');router[_0x3f98('0x6')]('/',auth[_0x3f98('0x7')](),controller[_0x3f98('0x8')]);router[_0x3f98('0x6')](_0x3f98('0x9'),auth['isAuthenticated'](),controller[_0x3f98('0xa')]);router[_0x3f98('0x6')](_0x3f98('0xb'),auth[_0x3f98('0x7')](),controller[_0x3f98('0xc')]);router[_0x3f98('0xd')]('/',auth[_0x3f98('0x7')](),controller[_0x3f98('0xe')]);router[_0x3f98('0xf')](_0x3f98('0xb'),auth[_0x3f98('0x7')](),controller['update']);router[_0x3f98('0x10')](_0x3f98('0xb'),auth['isAuthenticated'](),controller[_0x3f98('0x11')]);module[_0x3f98('0x12')]=router; \ No newline at end of file +var _0x5e28=['isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','get','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5e28,0x1d2));var _0x85e2=function(_0x3dea7d,_0x2cd4ea){_0x3dea7d=_0x3dea7d-0x0;var _0x53919a=_0x5e28[_0x3dea7d];return _0x53919a;};'use strict';var multer=require('multer');var util=require(_0x85e2('0x0'));var path=require(_0x85e2('0x1'));var timeout=require(_0x85e2('0x2'));var express=require(_0x85e2('0x3'));var router=express[_0x85e2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x85e2('0x5'));var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x85e2('0x6')]('/',auth['isAuthenticated'](),controller[_0x85e2('0x7')]);router[_0x85e2('0x6')](_0x85e2('0x8'),auth[_0x85e2('0x9')](),controller[_0x85e2('0xa')]);router[_0x85e2('0x6')]('/:id',auth[_0x85e2('0x9')](),controller['show']);router[_0x85e2('0xb')]('/',auth[_0x85e2('0x9')](),controller[_0x85e2('0xc')]);router[_0x85e2('0xd')](_0x85e2('0xe'),auth[_0x85e2('0x9')](),controller[_0x85e2('0xf')]);router[_0x85e2('0x10')]('/:id',auth[_0x85e2('0x9')](),controller[_0x85e2('0x11')]);module[_0x85e2('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 7515061..500be48 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 _0x1510=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt'];(function(_0x5c4aee,_0x450e0e){var _0x286dfc=function(_0x5e45a1){while(--_0x5e45a1){_0x5c4aee['push'](_0x5c4aee['shift']());}};_0x286dfc(++_0x450e0e);}(_0x1510,0xa0));var _0x0151=function(_0x49544e,_0x34926d){_0x49544e=_0x49544e-0x0;var _0x1fa8c7=_0x1510[_0x49544e];return _0x1fa8c7;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x0151('0x0')]={'channel':{'type':Sequelize[_0x0151('0x1')]},'membername':{'type':Sequelize[_0x0151('0x1')]},'interface':{'type':Sequelize[_0x0151('0x1')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x0151('0x2')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x0151('0x3')]},'exitAt':{'type':Sequelize[_0x0151('0x3')],'set':function(_0x56e176){var _0x5e9979=moment(_0x56e176);var _0x10a249=moment(this['getDataValue'](_0x0151('0x4')));var _0x4a9759=_0x5e9979[_0x0151('0x5')](_0x10a249,_0x0151('0x6'));this['setDataValue'](_0x0151('0x7'),_0x56e176);this[_0x0151('0x8')](_0x0151('0x9'),_0x4a9759||null);}},'data1':{'type':Sequelize[_0x0151('0x1')],'comment':_0x0151('0xa')},'data2':{'type':Sequelize['STRING'],'comment':_0x0151('0xb')},'data3':{'type':Sequelize['STRING'],'comment':_0x0151('0xc')},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x0151('0x1')],'comment':_0x0151('0xd')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x0151('0xe')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x284d=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','diff','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','STRING'];(function(_0x4e6734,_0x4f26c1){var _0x3f0aeb=function(_0x50dad5){while(--_0x50dad5){_0x4e6734['push'](_0x4e6734['shift']());}};_0x3f0aeb(++_0x4f26c1);}(_0x284d,0x1d9));var _0xd284=function(_0x2ed502,_0x3b7fab){_0x2ed502=_0x2ed502-0x0;var _0x191886=_0x284d[_0x2ed502];return _0x191886;};'use strict';var Sequelize=require(_0xd284('0x0'));var moment=require(_0xd284('0x1'));module['exports']={'channel':{'type':Sequelize[_0xd284('0x2')]},'membername':{'type':Sequelize[_0xd284('0x2')]},'interface':{'type':Sequelize[_0xd284('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xd284('0x3')},'duration':{'type':Sequelize[_0xd284('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd284('0x5')],'set':function(_0x34a06d){var _0x5269e0=moment(_0x34a06d);var _0x3b9801=moment(this['getDataValue'](_0xd284('0x6')));var _0x48f156=_0x5269e0[_0xd284('0x7')](_0x3b9801,'seconds');this['setDataValue']('exitAt',_0x34a06d);this[_0xd284('0x8')]('duration',_0x48f156||null);}},'data1':{'type':Sequelize[_0xd284('0x2')],'comment':_0xd284('0x9')},'data2':{'type':Sequelize[_0xd284('0x2')],'comment':_0xd284('0xa')},'data3':{'type':Sequelize[_0xd284('0x2')],'comment':_0xd284('0xb')},'data4':{'type':Sequelize[_0xd284('0x2')],'comment':_0xd284('0xc')},'data5':{'type':Sequelize['STRING'],'comment':_0xd284('0xd')},'role':{'type':Sequelize[_0xd284('0x2')]},'internal':{'type':Sequelize[_0xd284('0x4')]},'uniqueid':{'type':Sequelize[_0xd284('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 87e5751..0c004d3 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 _0x90da=['fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','zip-dir','request-promise','moment','bluebird','util','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','MemberReport','rawAttributes'];(function(_0x108f38,_0xae2818){var _0x2c7d7c=function(_0x23f533){while(--_0x23f533){_0x108f38['push'](_0x108f38['shift']());}};_0x2c7d7c(++_0xae2818);}(_0x90da,0xef));var _0xa90d=function(_0x2ff1d9,_0x1e91e1){_0x2ff1d9=_0x2ff1d9-0x0;var _0x284953=_0x90da[_0x2ff1d9];return _0x284953;};'use strict';var pdf=require(_0xa90d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa90d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa90d('0x2'));var moment=require(_0xa90d('0x3'));var BPromise=require(_0xa90d('0x4'));var Mustache=require('mustache');var util=require(_0xa90d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa90d('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa90d('0x7'));var squel=require(_0xa90d('0x8'));var crypto=require('crypto');var jsforce=require(_0xa90d('0x9'));var deskjs=require(_0xa90d('0xa'));var toCsv=require(_0xa90d('0x6'));var querystring=require(_0xa90d('0xb'));var Papa=require(_0xa90d('0xc'));var Redis=require(_0xa90d('0xd'));var authService=require(_0xa90d('0xe'));var qs=require(_0xa90d('0xf'));var as=require(_0xa90d('0x10'));var hardwareService=require(_0xa90d('0x11'));var logger=require('../../config/logger')(_0xa90d('0x12'));var utils=require(_0xa90d('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37f7e3,_0x338986){_0x338986=_0x338986||0xcc;return function(_0x355afa){if(_0x355afa){return _0x37f7e3[_0xa90d('0x14')](_0x338986);}return _0x37f7e3[_0xa90d('0x15')](_0x338986)[_0xa90d('0x16')]();};}function respondWithResult(_0x4165d5,_0x4052a7){_0x4052a7=_0x4052a7||0xc8;return function(_0x164e27){if(_0x164e27){return _0x4165d5[_0xa90d('0x15')](_0x4052a7)[_0xa90d('0x17')](_0x164e27);}};}function respondWithFilteredResult(_0x33f3a1,_0x361203){return function(_0x12a2d9){if(_0x12a2d9){var _0x3e2369=_0x12a2d9[_0xa90d('0x18')],_0x53f913=_0x361203[_0xa90d('0x19')],_0x54d25b=_0x361203['offset']+_0x361203[_0xa90d('0x1a')],_0x4b0575;if(_0x54d25b>=_0x3e2369){_0x54d25b=_0x3e2369;_0x4b0575=0xc8;}else{_0x4b0575=0xce;}_0x33f3a1[_0xa90d('0x15')](_0x4b0575);return _0x33f3a1[_0xa90d('0x1b')](_0xa90d('0x1c'),_0x53f913+'-'+_0x54d25b+'/'+_0x3e2369)[_0xa90d('0x17')](_0x12a2d9);}return null;};}function patchUpdates(_0x4eda09){return function(_0xbe4360){try{jsonpatch[_0xa90d('0x1d')](_0xbe4360,_0x4eda09,!![]);}catch(_0x2fee43){return BPromise['reject'](_0x2fee43);}return _0xbe4360[_0xa90d('0x1e')]();};}function saveUpdates(_0x40e983,_0x21d24d){return function(_0x42a7bd){if(_0x42a7bd){return _0x42a7bd[_0xa90d('0x1f')](_0x40e983)['then'](function(_0x2fb5a8){return _0x2fb5a8;});}return null;};}function removeEntity(_0x142fd7,_0x21c4b0){return function(_0x4ea9dd){if(_0x4ea9dd){return _0x4ea9dd[_0xa90d('0x20')]()[_0xa90d('0x21')](function(){_0x142fd7[_0xa90d('0x15')](0xcc)[_0xa90d('0x16')]();});}};}function handleEntityNotFound(_0x34afb3,_0x211529){return function(_0x215958){if(!_0x215958){_0x34afb3[_0xa90d('0x14')](0x194);}return _0x215958;};}function handleError(_0x2c2fac,_0x372866){_0x372866=_0x372866||0x1f4;return function(_0x237e14){logger[_0xa90d('0x22')](_0x237e14[_0xa90d('0x23')]);if(_0x237e14[_0xa90d('0x24')]){delete _0x237e14['name'];}_0x2c2fac[_0xa90d('0x15')](_0x372866)[_0xa90d('0x25')](_0x237e14);};}exports[_0xa90d('0x26')]=function(_0x117bb6,_0x1b67d4){var _0x480153={},_0x5dc36f={},_0x5764c4={'count':0x0,'rows':[]};var _0x3ee863=_['map'](db[_0xa90d('0x27')][_0xa90d('0x28')],function(_0xc919c1){return{'name':_0xc919c1[_0xa90d('0x29')],'type':_0xc919c1[_0xa90d('0x2a')][_0xa90d('0x2b')]};});_0x5dc36f[_0xa90d('0x2c')]=_['map'](_0x3ee863,_0xa90d('0x24'));_0x5dc36f[_0xa90d('0x2d')]=_[_0xa90d('0x2e')](_0x117bb6['query']);_0x5dc36f['filters']=_[_0xa90d('0x2f')](_0x5dc36f[_0xa90d('0x2c')],_0x5dc36f[_0xa90d('0x2d')]);_0x480153[_0xa90d('0x30')]=_[_0xa90d('0x2f')](_0x5dc36f[_0xa90d('0x2c')],qs[_0xa90d('0x31')](_0x117bb6[_0xa90d('0x2d')][_0xa90d('0x31')]));_0x480153[_0xa90d('0x30')]=_0x480153[_0xa90d('0x30')][_0xa90d('0x32')]?_0x480153[_0xa90d('0x30')]:_0x5dc36f[_0xa90d('0x2c')];if(!_0x117bb6[_0xa90d('0x2d')][_0xa90d('0x33')]('nolimit')){_0x480153['limit']=qs[_0xa90d('0x1a')](_0x117bb6[_0xa90d('0x2d')][_0xa90d('0x1a')]);_0x480153['offset']=qs[_0xa90d('0x19')](_0x117bb6['query'][_0xa90d('0x19')]);}_0x480153['order']=qs[_0xa90d('0x34')](_0x117bb6['query'][_0xa90d('0x34')]);_0x480153[_0xa90d('0x35')]=qs[_0xa90d('0x36')](_['pick'](_0x117bb6[_0xa90d('0x2d')],_0x5dc36f[_0xa90d('0x36')]),_0x3ee863);if(_0x117bb6['query'][_0xa90d('0x37')]){_0x480153[_0xa90d('0x35')]=_[_0xa90d('0x38')](_0x480153[_0xa90d('0x35')],{'$or':_[_0xa90d('0x39')](_0x3ee863,function(_0x1cc732){if(_0x1cc732['type']!=='VIRTUAL'){var _0x463229={};_0x463229[_0x1cc732['name']]={'$like':'%'+_0x117bb6[_0xa90d('0x2d')][_0xa90d('0x37')]+'%'};return _0x463229;}})});}_0x480153=_['merge']({},_0x480153,_0x117bb6[_0xa90d('0x3a')]);var _0x115263={'where':_0x480153[_0xa90d('0x35')]};return db[_0xa90d('0x27')][_0xa90d('0x18')](_0x115263)['then'](function(_0x4e76ad){_0x5764c4[_0xa90d('0x18')]=_0x4e76ad;if(_0x117bb6['query'][_0xa90d('0x3b')]){_0x480153[_0xa90d('0x3c')]=[{'all':!![]}];}return db[_0xa90d('0x27')][_0xa90d('0x3d')](_0x480153);})['then'](function(_0x4d744c){_0x5764c4[_0xa90d('0x3e')]=_0x4d744c;return _0x5764c4;})[_0xa90d('0x21')](respondWithFilteredResult(_0x1b67d4,_0x480153))[_0xa90d('0x3f')](handleError(_0x1b67d4,null));};exports[_0xa90d('0x40')]=function(_0x4f0823,_0x289727){var _0x5d82f3={'raw':!![],'where':{'id':_0x4f0823[_0xa90d('0x41')]['id']}},_0x2fc232={};_0x2fc232[_0xa90d('0x2c')]=_[_0xa90d('0x2e')](db[_0xa90d('0x27')]['rawAttributes']);_0x2fc232[_0xa90d('0x2d')]=_['keys'](_0x4f0823[_0xa90d('0x2d')]);_0x2fc232[_0xa90d('0x36')]=_[_0xa90d('0x2f')](_0x2fc232[_0xa90d('0x2c')],_0x2fc232[_0xa90d('0x2d')]);_0x5d82f3[_0xa90d('0x30')]=_[_0xa90d('0x2f')](_0x2fc232[_0xa90d('0x2c')],qs['fields'](_0x4f0823[_0xa90d('0x2d')][_0xa90d('0x31')]));_0x5d82f3[_0xa90d('0x30')]=_0x5d82f3[_0xa90d('0x30')][_0xa90d('0x32')]?_0x5d82f3[_0xa90d('0x30')]:_0x2fc232['model'];if(_0x4f0823[_0xa90d('0x2d')]['includeAll']){_0x5d82f3[_0xa90d('0x3c')]=[{'all':!![]}];}_0x5d82f3=_[_0xa90d('0x38')]({},_0x5d82f3,_0x4f0823[_0xa90d('0x3a')]);return db[_0xa90d('0x27')][_0xa90d('0x42')](_0x5d82f3)['then'](handleEntityNotFound(_0x289727,null))[_0xa90d('0x21')](respondWithResult(_0x289727,null))['catch'](handleError(_0x289727,null));};exports[_0xa90d('0x43')]=function(_0x1f62a3,_0x5911b3){return db[_0xa90d('0x27')][_0xa90d('0x43')](_0x1f62a3['body'],{})[_0xa90d('0x21')](respondWithResult(_0x5911b3,0xc9))[_0xa90d('0x3f')](handleError(_0x5911b3,null));};exports[_0xa90d('0x1f')]=function(_0x2019b5,_0x1ca74e){if(_0x2019b5[_0xa90d('0x44')]['id']){delete _0x2019b5[_0xa90d('0x44')]['id'];}return db['MemberReport']['find']({'where':{'id':_0x2019b5[_0xa90d('0x41')]['id']}})['then'](handleEntityNotFound(_0x1ca74e,null))['then'](saveUpdates(_0x2019b5[_0xa90d('0x44')],null))[_0xa90d('0x21')](respondWithResult(_0x1ca74e,null))['catch'](handleError(_0x1ca74e,null));};exports[_0xa90d('0x20')]=function(_0x4b5ba6,_0x41275e){return db[_0xa90d('0x27')]['find']({'where':{'id':_0x4b5ba6[_0xa90d('0x41')]['id']}})[_0xa90d('0x21')](handleEntityNotFound(_0x41275e,null))[_0xa90d('0x21')](removeEntity(_0x41275e,null))[_0xa90d('0x3f')](handleError(_0x41275e,null));};exports[_0xa90d('0x45')]=function(_0x16eb72,_0x3740b9){return db[_0xa90d('0x27')]['describe']()['then'](respondWithResult(_0x3740b9,null))[_0xa90d('0x3f')](handleError(_0x3740b9,null));}; \ No newline at end of file +var _0x2fb9=['where','pick','filter','merge','type','VIRTUAL','options','include','MemberReport','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../mysqldb','status','end','json','count','offset','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','key','map','keys','filters','intersection','model','attributes','fields','query','length','limit','order','sort'];(function(_0x2db32b,_0x1df493){var _0x5b6cab=function(_0x2b9d51){while(--_0x2b9d51){_0x2db32b['push'](_0x2db32b['shift']());}};_0x5b6cab(++_0x1df493);}(_0x2fb9,0x1e2));var _0x92fb=function(_0x3ce1d6,_0x5bc244){_0x3ce1d6=_0x3ce1d6-0x0;var _0x30d543=_0x2fb9[_0x3ce1d6];return _0x30d543;};'use strict';var pdf=require(_0x92fb('0x0'));var emlformat=require(_0x92fb('0x1'));var rimraf=require(_0x92fb('0x2'));var zipdir=require(_0x92fb('0x3'));var jsonpatch=require(_0x92fb('0x4'));var rp=require(_0x92fb('0x5'));var moment=require(_0x92fb('0x6'));var BPromise=require(_0x92fb('0x7'));var Mustache=require('mustache');var util=require(_0x92fb('0x8'));var path=require(_0x92fb('0x9'));var sox=require(_0x92fb('0xa'));var csv=require(_0x92fb('0xb'));var ejs=require(_0x92fb('0xc'));var fs=require('fs');var _=require(_0x92fb('0xd'));var squel=require(_0x92fb('0xe'));var crypto=require(_0x92fb('0xf'));var jsforce=require(_0x92fb('0x10'));var deskjs=require(_0x92fb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x92fb('0x12'));var Papa=require(_0x92fb('0x13'));var Redis=require(_0x92fb('0x14'));var authService=require(_0x92fb('0x15'));var qs=require(_0x92fb('0x16'));var as=require(_0x92fb('0x17'));var hardwareService=require(_0x92fb('0x18'));var logger=require(_0x92fb('0x19'))(_0x92fb('0x1a'));var utils=require(_0x92fb('0x1b'));var config=require('../../config/environment');var db=require(_0x92fb('0x1c'))['db'];function respondWithStatusCode(_0x125020,_0xcd56c){_0xcd56c=_0xcd56c||0xcc;return function(_0x5d7718){if(_0x5d7718){return _0x125020['sendStatus'](_0xcd56c);}return _0x125020[_0x92fb('0x1d')](_0xcd56c)[_0x92fb('0x1e')]();};}function respondWithResult(_0x306e7c,_0x8a1a3d){_0x8a1a3d=_0x8a1a3d||0xc8;return function(_0x36c6d9){if(_0x36c6d9){return _0x306e7c[_0x92fb('0x1d')](_0x8a1a3d)[_0x92fb('0x1f')](_0x36c6d9);}};}function respondWithFilteredResult(_0x363292,_0x28a23f){return function(_0x46335c){if(_0x46335c){var _0x5b860b=_0x46335c[_0x92fb('0x20')],_0x2f9d9a=_0x28a23f[_0x92fb('0x21')],_0x35c0df=_0x28a23f['offset']+_0x28a23f['limit'],_0x1d6c3d;if(_0x35c0df>=_0x5b860b){_0x35c0df=_0x5b860b;_0x1d6c3d=0xc8;}else{_0x1d6c3d=0xce;}_0x363292['status'](_0x1d6c3d);return _0x363292['set']('Content-Range',_0x2f9d9a+'-'+_0x35c0df+'/'+_0x5b860b)['json'](_0x46335c);}return null;};}function patchUpdates(_0x46cb01){return function(_0x1360b2){try{jsonpatch['apply'](_0x1360b2,_0x46cb01,!![]);}catch(_0x319d11){return BPromise['reject'](_0x319d11);}return _0x1360b2[_0x92fb('0x22')]();};}function saveUpdates(_0x51738b,_0x51aa89){return function(_0x8ec91d){if(_0x8ec91d){return _0x8ec91d[_0x92fb('0x23')](_0x51738b)['then'](function(_0x312045){return _0x312045;});}return null;};}function removeEntity(_0x1de38c,_0x26efb8){return function(_0x4fd1dd){if(_0x4fd1dd){return _0x4fd1dd['destroy']()[_0x92fb('0x24')](function(){_0x1de38c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa2ba0b,_0x4a9892){return function(_0x2ea39c){if(!_0x2ea39c){_0xa2ba0b['sendStatus'](0x194);}return _0x2ea39c;};}function handleError(_0x693ded,_0x49af0c){_0x49af0c=_0x49af0c||0x1f4;return function(_0x333b1d){logger[_0x92fb('0x25')](_0x333b1d[_0x92fb('0x26')]);if(_0x333b1d[_0x92fb('0x27')]){delete _0x333b1d['name'];}_0x693ded[_0x92fb('0x1d')](_0x49af0c)[_0x92fb('0x28')](_0x333b1d);};}exports[_0x92fb('0x29')]=function(_0x5c7b5c,_0x4e9b24){var _0x145793={},_0x1032b0={},_0x2fb556={'count':0x0,'rows':[]};var _0x144f06=_['map'](db['MemberReport'][_0x92fb('0x2a')],function(_0x7ec560){return{'name':_0x7ec560[_0x92fb('0x2b')],'type':_0x7ec560['type'][_0x92fb('0x2c')]};});_0x1032b0['model']=_[_0x92fb('0x2d')](_0x144f06,_0x92fb('0x27'));_0x1032b0['query']=_[_0x92fb('0x2e')](_0x5c7b5c['query']);_0x1032b0[_0x92fb('0x2f')]=_[_0x92fb('0x30')](_0x1032b0[_0x92fb('0x31')],_0x1032b0['query']);_0x145793[_0x92fb('0x32')]=_[_0x92fb('0x30')](_0x1032b0[_0x92fb('0x31')],qs[_0x92fb('0x33')](_0x5c7b5c[_0x92fb('0x34')][_0x92fb('0x33')]));_0x145793['attributes']=_0x145793[_0x92fb('0x32')][_0x92fb('0x35')]?_0x145793['attributes']:_0x1032b0[_0x92fb('0x31')];if(!_0x5c7b5c['query']['hasOwnProperty']('nolimit')){_0x145793['limit']=qs['limit'](_0x5c7b5c[_0x92fb('0x34')][_0x92fb('0x36')]);_0x145793['offset']=qs[_0x92fb('0x21')](_0x5c7b5c[_0x92fb('0x34')][_0x92fb('0x21')]);}_0x145793[_0x92fb('0x37')]=qs[_0x92fb('0x38')](_0x5c7b5c[_0x92fb('0x34')]['sort']);_0x145793[_0x92fb('0x39')]=qs['filters'](_[_0x92fb('0x3a')](_0x5c7b5c[_0x92fb('0x34')],_0x1032b0[_0x92fb('0x2f')]),_0x144f06);if(_0x5c7b5c[_0x92fb('0x34')][_0x92fb('0x3b')]){_0x145793[_0x92fb('0x39')]=_[_0x92fb('0x3c')](_0x145793[_0x92fb('0x39')],{'$or':_[_0x92fb('0x2d')](_0x144f06,function(_0x55ef2a){if(_0x55ef2a[_0x92fb('0x3d')]!==_0x92fb('0x3e')){var _0xab3e85={};_0xab3e85[_0x55ef2a[_0x92fb('0x27')]]={'$like':'%'+_0x5c7b5c[_0x92fb('0x34')][_0x92fb('0x3b')]+'%'};return _0xab3e85;}})});}_0x145793=_[_0x92fb('0x3c')]({},_0x145793,_0x5c7b5c[_0x92fb('0x3f')]);var _0x1e6757={'where':_0x145793[_0x92fb('0x39')]};return db['MemberReport'][_0x92fb('0x20')](_0x1e6757)['then'](function(_0x451ba0){_0x2fb556[_0x92fb('0x20')]=_0x451ba0;if(_0x5c7b5c[_0x92fb('0x34')]['includeAll']){_0x145793[_0x92fb('0x40')]=[{'all':!![]}];}return db[_0x92fb('0x41')][_0x92fb('0x42')](_0x145793);})[_0x92fb('0x24')](function(_0x41e0f6){_0x2fb556[_0x92fb('0x43')]=_0x41e0f6;return _0x2fb556;})[_0x92fb('0x24')](respondWithFilteredResult(_0x4e9b24,_0x145793))['catch'](handleError(_0x4e9b24,null));};exports[_0x92fb('0x44')]=function(_0xfbde32,_0x1ce140){var _0x2db469={'raw':!![],'where':{'id':_0xfbde32[_0x92fb('0x45')]['id']}},_0x1a446a={};_0x1a446a[_0x92fb('0x31')]=_[_0x92fb('0x2e')](db[_0x92fb('0x41')][_0x92fb('0x2a')]);_0x1a446a[_0x92fb('0x34')]=_[_0x92fb('0x2e')](_0xfbde32[_0x92fb('0x34')]);_0x1a446a['filters']=_[_0x92fb('0x30')](_0x1a446a['model'],_0x1a446a[_0x92fb('0x34')]);_0x2db469[_0x92fb('0x32')]=_[_0x92fb('0x30')](_0x1a446a[_0x92fb('0x31')],qs['fields'](_0xfbde32[_0x92fb('0x34')][_0x92fb('0x33')]));_0x2db469[_0x92fb('0x32')]=_0x2db469[_0x92fb('0x32')][_0x92fb('0x35')]?_0x2db469[_0x92fb('0x32')]:_0x1a446a[_0x92fb('0x31')];if(_0xfbde32['query'][_0x92fb('0x46')]){_0x2db469[_0x92fb('0x40')]=[{'all':!![]}];}_0x2db469=_[_0x92fb('0x3c')]({},_0x2db469,_0xfbde32[_0x92fb('0x3f')]);return db[_0x92fb('0x41')][_0x92fb('0x47')](_0x2db469)['then'](handleEntityNotFound(_0x1ce140,null))['then'](respondWithResult(_0x1ce140,null))[_0x92fb('0x48')](handleError(_0x1ce140,null));};exports[_0x92fb('0x49')]=function(_0x3b73ef,_0x20d6b1){return db[_0x92fb('0x41')][_0x92fb('0x49')](_0x3b73ef[_0x92fb('0x4a')],{})[_0x92fb('0x24')](respondWithResult(_0x20d6b1,0xc9))['catch'](handleError(_0x20d6b1,null));};exports['update']=function(_0x23f7fa,_0x2bcf04){if(_0x23f7fa['body']['id']){delete _0x23f7fa['body']['id'];}return db[_0x92fb('0x41')][_0x92fb('0x47')]({'where':{'id':_0x23f7fa['params']['id']}})[_0x92fb('0x24')](handleEntityNotFound(_0x2bcf04,null))[_0x92fb('0x24')](saveUpdates(_0x23f7fa[_0x92fb('0x4a')],null))[_0x92fb('0x24')](respondWithResult(_0x2bcf04,null))[_0x92fb('0x48')](handleError(_0x2bcf04,null));};exports[_0x92fb('0x4b')]=function(_0x247bc2,_0x4bbb64){return db['MemberReport']['find']({'where':{'id':_0x247bc2['params']['id']}})[_0x92fb('0x24')](handleEntityNotFound(_0x4bbb64,null))['then'](removeEntity(_0x4bbb64,null))[_0x92fb('0x48')](handleError(_0x4bbb64,null));};exports[_0x92fb('0x4c')]=function(_0x4f2bf6,_0x463687){return db['MemberReport'][_0x92fb('0x4c')]()[_0x92fb('0x24')](respondWithResult(_0x463687,null))[_0x92fb('0x48')](handleError(_0x463687,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index a9c8b93..0061a7a 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 _0x4c4e=['membername','interface','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./memberReport.attributes','define','MemberReport','report_member','membername_interface'];(function(_0x12a399,_0x188b78){var _0x38b86a=function(_0x38adf6){while(--_0x38adf6){_0x12a399['push'](_0x12a399['shift']());}};_0x38b86a(++_0x188b78);}(_0x4c4e,0x152));var _0xe4c4=function(_0x598e71,_0x868d55){_0x598e71=_0x598e71-0x0;var _0x520026=_0x4c4e[_0x598e71];return _0x520026;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var logger=require(_0xe4c4('0x1'))(_0xe4c4('0x2'));var moment=require(_0xe4c4('0x3'));var BPromise=require('bluebird');var rp=require(_0xe4c4('0x4'));var fs=require('fs');var path=require(_0xe4c4('0x5'));var rimraf=require(_0xe4c4('0x6'));var config=require('../../config/environment');var attributes=require(_0xe4c4('0x7'));module['exports']=function(_0x177732,_0x1a12a6){return _0x177732[_0xe4c4('0x8')](_0xe4c4('0x9'),attributes,{'tableName':_0xe4c4('0xa'),'paranoid':![],'indexes':[{'name':_0xe4c4('0xb'),'fields':[_0xe4c4('0xc'),_0xe4c4('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e85=['report_member','membername_interface','membername','interface','lodash','util','api','moment','rimraf','./memberReport.attributes','exports','MemberReport'];(function(_0x376106,_0x10f33e){var _0x5a1d93=function(_0x51a781){while(--_0x51a781){_0x376106['push'](_0x376106['shift']());}};_0x5a1d93(++_0x10f33e);}(_0x0e85,0x7c));var _0x50e8=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0e85[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x50e8('0x0'));var util=require(_0x50e8('0x1'));var logger=require('../../config/logger')(_0x50e8('0x2'));var moment=require(_0x50e8('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x50e8('0x4'));var config=require('../../config/environment');var attributes=require(_0x50e8('0x5'));module[_0x50e8('0x6')]=function(_0xe3151e,_0xfde42){return _0xe3151e['define'](_0x50e8('0x7'),attributes,{'tableName':_0x50e8('0x8'),'paranoid':![],'indexes':[{'name':_0x50e8('0x9'),'fields':[_0x50e8('0xa'),_0x50e8('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index c28b752..cda4b37 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 _0x2a56=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','MemberReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','create','then','UpdateMemberReport','body','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x271537,_0x8b7b3b){var _0x19dc22=function(_0x459bbf){while(--_0x459bbf){_0x271537['push'](_0x271537['shift']());}};_0x19dc22(++_0x8b7b3b);}(_0x2a56,0x8f));var _0x62a5=function(_0x16056e,_0xcfde4){_0x16056e=_0x16056e-0x0;var _0x4f3b89=_0x2a56[_0x16056e];return _0x4f3b89;};'use strict';var _=require(_0x62a5('0x0'));var util=require('util');var moment=require(_0x62a5('0x1'));var BPromise=require(_0x62a5('0x2'));var rs=require(_0x62a5('0x3'));var fs=require('fs');var Redis=require(_0x62a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x62a5('0x5'));var logger=require(_0x62a5('0x6'))(_0x62a5('0x7'));var config=require(_0x62a5('0x8'));var jayson=require(_0x62a5('0x9'));var client=jayson['client'][_0x62a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a55a7,_0x55f7a6,_0x48a5e4){return new BPromise(function(_0x17ec75,_0x447951){return client[_0x62a5('0xb')](_0x1a55a7,_0x48a5e4)['then'](function(_0x483979){logger[_0x62a5('0xc')](_0x62a5('0xd'),_0x55f7a6,'request\x20sent');logger[_0x62a5('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x55f7a6,_0x62a5('0xf'),JSON[_0x62a5('0x10')](_0x483979));if(_0x483979[_0x62a5('0x11')]){if(_0x483979[_0x62a5('0x11')][_0x62a5('0x12')]===0x1f4){logger[_0x62a5('0x11')](_0x62a5('0xd'),_0x55f7a6,_0x483979[_0x62a5('0x11')]['message']);return _0x447951(_0x483979[_0x62a5('0x11')][_0x62a5('0x13')]);}logger[_0x62a5('0x11')](_0x62a5('0xd'),_0x55f7a6,_0x483979[_0x62a5('0x11')][_0x62a5('0x13')]);return _0x17ec75(_0x483979['error']['message']);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x55f7a6,_0x62a5('0xf'));_0x17ec75(_0x483979[_0x62a5('0x14')]['message']);}})[_0x62a5('0x15')](function(_0x467119){logger['error'](_0x62a5('0xd'),_0x55f7a6,_0x467119);_0x447951(_0x467119);});});}exports[_0x62a5('0x16')]=function(_0x3851e7){var _0x559680=this;return new Promise(function(_0x273fb2,_0x24ac50){return db[_0x62a5('0x17')]['findAll']({'raw':_0x3851e7[_0x62a5('0x18')]?_0x3851e7[_0x62a5('0x18')][_0x62a5('0x19')]===undefined?!![]:![]:!![],'where':_0x3851e7[_0x62a5('0x18')]?_0x3851e7[_0x62a5('0x18')][_0x62a5('0x1a')]||null:null,'attributes':_0x3851e7['options']?_0x3851e7['options'][_0x62a5('0x1b')]||null:null,'limit':_0x3851e7['options']?_0x3851e7[_0x62a5('0x18')][_0x62a5('0x1c')]||null:null,'include':_0x3851e7[_0x62a5('0x18')]?_0x3851e7[_0x62a5('0x18')][_0x62a5('0x1d')]?_[_0x62a5('0x1e')](_0x3851e7['options'][_0x62a5('0x1d')],function(_0xe29812){return{'model':db[_0xe29812[_0x62a5('0x1f')]],'as':_0xe29812['as'],'attributes':_0xe29812[_0x62a5('0x1b')],'include':_0xe29812[_0x62a5('0x1d')]?_[_0x62a5('0x1e')](_0xe29812['include'],function(_0x114a66){return{'model':db[_0x114a66[_0x62a5('0x1f')]],'as':_0x114a66['as'],'attributes':_0x114a66[_0x62a5('0x1b')],'include':_0x114a66[_0x62a5('0x1d')]?_['map'](_0x114a66['include'],function(_0x19f9d7){return{'model':db[_0x19f9d7['model']],'as':_0x19f9d7['as'],'attributes':_0x19f9d7[_0x62a5('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10238a){logger['info'](_0x62a5('0x16'),_0x3851e7);logger[_0x62a5('0xe')](_0x62a5('0x16'),_0x3851e7,JSON[_0x62a5('0x10')](_0x10238a));_0x273fb2(_0x10238a);})[_0x62a5('0x15')](function(_0x5a660f){logger['error']('GetMemberReport',_0x5a660f[_0x62a5('0x13')],_0x3851e7);_0x24ac50(_0x559680[_0x62a5('0x11')](0x1f4,_0x5a660f[_0x62a5('0x13')]));});});};exports[_0x62a5('0x20')]=function(_0x11e9fa){var _0x420157=this;return new Promise(function(_0x4cf741,_0x20ef46){return db['MemberReport'][_0x62a5('0x21')](_0x11e9fa['body'],{'raw':_0x11e9fa['options']?_0x11e9fa['options'][_0x62a5('0x19')]===undefined?!![]:![]:!![]})[_0x62a5('0x22')](function(_0x2925ec){logger['info']('CreateMemberReport',_0x11e9fa);logger[_0x62a5('0xe')](_0x62a5('0x20'),_0x11e9fa,JSON[_0x62a5('0x10')](_0x2925ec));_0x4cf741(_0x2925ec);})[_0x62a5('0x15')](function(_0x17fc53){logger['error'](_0x62a5('0x20'),_0x17fc53[_0x62a5('0x13')],_0x11e9fa);_0x20ef46(_0x420157['error'](0x1f4,_0x17fc53[_0x62a5('0x13')]));});});};exports[_0x62a5('0x23')]=function(_0x56b455){var _0x52b395=this;return new Promise(function(_0x1e263a,_0x15a723){return db[_0x62a5('0x17')]['update'](_0x56b455[_0x62a5('0x24')],{'raw':_0x56b455[_0x62a5('0x18')]?_0x56b455['options'][_0x62a5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56b455[_0x62a5('0x18')]?_0x56b455['options']['where']||null:null,'attributes':_0x56b455['options']?_0x56b455[_0x62a5('0x18')]['attributes']||null:null,'limit':_0x56b455[_0x62a5('0x18')]?_0x56b455[_0x62a5('0x18')]['limit']||null:null})[_0x62a5('0x22')](function(_0x364144){logger[_0x62a5('0xc')](_0x62a5('0x23'),_0x56b455);logger['debug'](_0x62a5('0x23'),_0x56b455,JSON[_0x62a5('0x10')](_0x364144));_0x1e263a(_0x364144);})[_0x62a5('0x15')](function(_0x130947){logger['error'](_0x62a5('0x23'),_0x130947[_0x62a5('0x13')],_0x56b455);_0x15a723(_0x52b395[_0x62a5('0x11')](0x1f4,_0x130947['message']));});});}; \ No newline at end of file +var _0x145a=['MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','model','map','CreateMemberReport','create','body','update','UpdateMemberReport','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','request','then','info','request\x20sent','debug','error','code'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x145a,0x9c));var _0xa145=function(_0xc6fcf5,_0x1bd30a){_0xc6fcf5=_0xc6fcf5-0x0;var _0x18027c=_0x145a[_0xc6fcf5];return _0x18027c;};'use strict';var _=require('lodash');var util=require(_0xa145('0x0'));var moment=require(_0xa145('0x1'));var BPromise=require(_0xa145('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa145('0x3'));var db=require(_0xa145('0x4'))['db'];var utils=require(_0xa145('0x5'));var logger=require(_0xa145('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5959b8,_0x53a062,_0x21e764){return new BPromise(function(_0x14e21f,_0x33ea1e){return client[_0xa145('0x7')](_0x5959b8,_0x21e764)[_0xa145('0x8')](function(_0x16694e){logger[_0xa145('0x9')]('MemberReport,\x20%s,\x20%s',_0x53a062,_0xa145('0xa'));logger[_0xa145('0xb')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x53a062,_0xa145('0xa'),JSON['stringify'](_0x16694e));if(_0x16694e[_0xa145('0xc')]){if(_0x16694e[_0xa145('0xc')][_0xa145('0xd')]===0x1f4){logger[_0xa145('0xc')](_0xa145('0xe'),_0x53a062,_0x16694e[_0xa145('0xc')]['message']);return _0x33ea1e(_0x16694e[_0xa145('0xc')]['message']);}logger[_0xa145('0xc')]('MemberReport,\x20%s,\x20%s',_0x53a062,_0x16694e[_0xa145('0xc')][_0xa145('0xf')]);return _0x14e21f(_0x16694e['error'][_0xa145('0xf')]);}else{logger[_0xa145('0x9')](_0xa145('0xe'),_0x53a062,_0xa145('0xa'));_0x14e21f(_0x16694e[_0xa145('0x10')][_0xa145('0xf')]);}})[_0xa145('0x11')](function(_0x2c98f0){logger[_0xa145('0xc')](_0xa145('0xe'),_0x53a062,_0x2c98f0);_0x33ea1e(_0x2c98f0);});});}exports[_0xa145('0x12')]=function(_0x4bebdb){var _0x6bd649=this;return new Promise(function(_0x142591,_0x5d22c4){return db[_0xa145('0x13')]['findAll']({'raw':_0x4bebdb['options']?_0x4bebdb[_0xa145('0x14')][_0xa145('0x15')]===undefined?!![]:![]:!![],'where':_0x4bebdb[_0xa145('0x14')]?_0x4bebdb[_0xa145('0x14')][_0xa145('0x16')]||null:null,'attributes':_0x4bebdb[_0xa145('0x14')]?_0x4bebdb[_0xa145('0x14')][_0xa145('0x17')]||null:null,'limit':_0x4bebdb[_0xa145('0x14')]?_0x4bebdb[_0xa145('0x14')][_0xa145('0x18')]||null:null,'include':_0x4bebdb[_0xa145('0x14')]?_0x4bebdb[_0xa145('0x14')]['include']?_['map'](_0x4bebdb[_0xa145('0x14')][_0xa145('0x19')],function(_0x386d0a){return{'model':db[_0x386d0a[_0xa145('0x1a')]],'as':_0x386d0a['as'],'attributes':_0x386d0a[_0xa145('0x17')],'include':_0x386d0a[_0xa145('0x19')]?_[_0xa145('0x1b')](_0x386d0a[_0xa145('0x19')],function(_0xa1e51d){return{'model':db[_0xa1e51d[_0xa145('0x1a')]],'as':_0xa1e51d['as'],'attributes':_0xa1e51d[_0xa145('0x17')],'include':_0xa1e51d[_0xa145('0x19')]?_[_0xa145('0x1b')](_0xa1e51d[_0xa145('0x19')],function(_0x509b64){return{'model':db[_0x509b64[_0xa145('0x1a')]],'as':_0x509b64['as'],'attributes':_0x509b64[_0xa145('0x17')]};}):[]};}):[]};}):[]:[]})[_0xa145('0x8')](function(_0x287e17){logger[_0xa145('0x9')](_0xa145('0x12'),_0x4bebdb);logger[_0xa145('0xb')]('GetMemberReport',_0x4bebdb,JSON['stringify'](_0x287e17));_0x142591(_0x287e17);})[_0xa145('0x11')](function(_0x55ac5d){logger[_0xa145('0xc')]('GetMemberReport',_0x55ac5d[_0xa145('0xf')],_0x4bebdb);_0x5d22c4(_0x6bd649[_0xa145('0xc')](0x1f4,_0x55ac5d[_0xa145('0xf')]));});});};exports[_0xa145('0x1c')]=function(_0x5d58e1){var _0x3c2455=this;return new Promise(function(_0x261958,_0x53e9c2){return db[_0xa145('0x13')][_0xa145('0x1d')](_0x5d58e1[_0xa145('0x1e')],{'raw':_0x5d58e1[_0xa145('0x14')]?_0x5d58e1['options'][_0xa145('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x4e2de9){logger[_0xa145('0x9')](_0xa145('0x1c'),_0x5d58e1);logger[_0xa145('0xb')](_0xa145('0x1c'),_0x5d58e1,JSON['stringify'](_0x4e2de9));_0x261958(_0x4e2de9);})[_0xa145('0x11')](function(_0x4e8f46){logger['error'](_0xa145('0x1c'),_0x4e8f46[_0xa145('0xf')],_0x5d58e1);_0x53e9c2(_0x3c2455['error'](0x1f4,_0x4e8f46[_0xa145('0xf')]));});});};exports['UpdateMemberReport']=function(_0x5aa398){var _0xb2c41b=this;return new Promise(function(_0x3a5d26,_0x3a9873){return db[_0xa145('0x13')][_0xa145('0x1f')](_0x5aa398[_0xa145('0x1e')],{'raw':_0x5aa398[_0xa145('0x14')]?_0x5aa398['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa398[_0xa145('0x14')]?_0x5aa398['options'][_0xa145('0x16')]||null:null,'attributes':_0x5aa398[_0xa145('0x14')]?_0x5aa398[_0xa145('0x14')][_0xa145('0x17')]||null:null,'limit':_0x5aa398[_0xa145('0x14')]?_0x5aa398[_0xa145('0x14')]['limit']||null:null})[_0xa145('0x8')](function(_0x18b159){logger[_0xa145('0x9')](_0xa145('0x20'),_0x5aa398);logger['debug'](_0xa145('0x20'),_0x5aa398,JSON[_0xa145('0x21')](_0x18b159));_0x3a5d26(_0x18b159);})[_0xa145('0x11')](function(_0x4c360b){logger[_0xa145('0xc')](_0xa145('0x20'),_0x4c360b[_0xa145('0xf')],_0x5aa398);_0x3a9873(_0xb2c41b[_0xa145('0xc')](0x1f4,_0x4c360b[_0xa145('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 09a1cea..f57fa00 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 _0x13f6=['../../config/environment','./migration.controller','get','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x13f6,0x124));var _0x613f=function(_0x57c39d,_0x4857ff){_0x57c39d=_0x57c39d-0x0;var _0x59bd1d=_0x13f6[_0x57c39d];return _0x59bd1d;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var auth=require(_0x613f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x613f('0x5'));var controller=require(_0x613f('0x6'));router[_0x613f('0x7')]('/',controller['index']);module[_0x613f('0x8')]=router; \ No newline at end of file +var _0x4024=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x1bed2a,_0x420ebe){var _0x4648c5=function(_0x50daa1){while(--_0x50daa1){_0x1bed2a['push'](_0x1bed2a['shift']());}};_0x4648c5(++_0x420ebe);}(_0x4024,0x89));var _0x4402=function(_0x233024,_0x211e4f){_0x233024=_0x233024-0x0;var _0x4883dd=_0x4024[_0x233024];return _0x4883dd;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var auth=require(_0x4402('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4402('0x5'));var controller=require(_0x4402('0x6'));router['get']('/',controller['index']);module[_0x4402('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 7cc1008..11787d6 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 _0x4c7f=['exports','version','sequelize'];(function(_0x623e7,_0x1bef7d){var _0x121131=function(_0x59b734){while(--_0x59b734){_0x623e7['push'](_0x623e7['shift']());}};_0x121131(++_0x1bef7d);}(_0x4c7f,0x7d));var _0xf4c7=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0x4c7f[_0x44bcb0];return _0xfaf881;};'use strict';var Sequelize=require(_0xf4c7('0x0'));module[_0xf4c7('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xf4c7('0x2')}}; \ No newline at end of file +var _0x7e09=['version','sequelize','exports','STRING'];(function(_0x39734a,_0x249c52){var _0x29f799=function(_0x272df1){while(--_0x272df1){_0x39734a['push'](_0x39734a['shift']());}};_0x29f799(++_0x249c52);}(_0x7e09,0xe5));var _0x97e0=function(_0x45e677,_0x5ce7d9){_0x45e677=_0x45e677-0x0;var _0x4c5c4f=_0x7e09[_0x45e677];return _0x4c5c4f;};'use strict';var Sequelize=require(_0x97e0('0x0'));module[_0x97e0('0x1')]={'version':{'type':Sequelize[_0x97e0('0x2')],'unique':_0x97e0('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 8fcb8e1..4e28be2 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 _0xa9e0=['save','update','then','destroy','end','error','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','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'];(function(_0x10130a,_0x3378f5){var _0x11b3f7=function(_0x5aca56){while(--_0x5aca56){_0x10130a['push'](_0x10130a['shift']());}};_0x11b3f7(++_0x3378f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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));}; \ No newline at end of file +var _0xf4eb=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','apply','save','update','then','destroy','sendStatus','error','stack','name','Migration','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes'];(function(_0xde91e7,_0xb0fd97){var _0x4e524c=function(_0x33715e){while(--_0x33715e){_0xde91e7['push'](_0xde91e7['shift']());}};_0x4e524c(++_0xb0fd97);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3379c8,_0x86b843){_0x3379c8=_0x3379c8-0x0;var _0x5a72ab=_0xf4eb[_0x3379c8];return _0x5a72ab;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var db=require(_0xbf4e('0x12'))['db'];function respondWithStatusCode(_0x54a96e,_0x17fd01){_0x17fd01=_0x17fd01||0xcc;return function(_0x5a3035){if(_0x5a3035){return _0x54a96e['sendStatus'](_0x17fd01);}return _0x54a96e[_0xbf4e('0x13')](_0x17fd01)[_0xbf4e('0x14')]();};}function respondWithResult(_0x1e029b,_0x302841){_0x302841=_0x302841||0xc8;return function(_0x3b74bd){if(_0x3b74bd){return _0x1e029b[_0xbf4e('0x13')](_0x302841)['json'](_0x3b74bd);}};}function respondWithFilteredResult(_0x59fb15,_0x180432){return function(_0x1735ae){if(_0x1735ae){var _0x28fc6b=_0x1735ae[_0xbf4e('0x15')],_0x542909=_0x180432[_0xbf4e('0x16')],_0x14110b=_0x180432['offset']+_0x180432[_0xbf4e('0x17')],_0x2c292c;if(_0x14110b>=_0x28fc6b){_0x14110b=_0x28fc6b;_0x2c292c=0xc8;}else{_0x2c292c=0xce;}_0x59fb15['status'](_0x2c292c);return _0x59fb15['set']('Content-Range',_0x542909+'-'+_0x14110b+'/'+_0x28fc6b)['json'](_0x1735ae);}return null;};}function patchUpdates(_0x35992b){return function(_0x1ca73c){try{jsonpatch[_0xbf4e('0x18')](_0x1ca73c,_0x35992b,!![]);}catch(_0x4d9c2a){return BPromise['reject'](_0x4d9c2a);}return _0x1ca73c[_0xbf4e('0x19')]();};}function saveUpdates(_0x9a46ee,_0x3be138){return function(_0x3a875b){if(_0x3a875b){return _0x3a875b[_0xbf4e('0x1a')](_0x9a46ee)[_0xbf4e('0x1b')](function(_0x415963){return _0x415963;});}return null;};}function removeEntity(_0x3d642a,_0xd09e12){return function(_0x376832){if(_0x376832){return _0x376832[_0xbf4e('0x1c')]()['then'](function(){_0x3d642a[_0xbf4e('0x13')](0xcc)[_0xbf4e('0x14')]();});}};}function handleEntityNotFound(_0x51648c,_0x31e3f5){return function(_0x30994d){if(!_0x30994d){_0x51648c[_0xbf4e('0x1d')](0x194);}return _0x30994d;};}function handleError(_0x1bda8b,_0x3a5d72){_0x3a5d72=_0x3a5d72||0x1f4;return function(_0x4a0243){logger[_0xbf4e('0x1e')](_0x4a0243[_0xbf4e('0x1f')]);if(_0x4a0243[_0xbf4e('0x20')]){delete _0x4a0243['name'];}_0x1bda8b[_0xbf4e('0x13')](_0x3a5d72)['send'](_0x4a0243);};}exports['index']=function(_0x2bfccf,_0x5a0a9b){var _0x38c923={},_0x315df3={},_0x4021a9={'count':0x0,'rows':[]};var _0x41f918=_['map'](db[_0xbf4e('0x21')][_0xbf4e('0x22')],function(_0x43879d){return{'name':_0x43879d['fieldName'],'type':_0x43879d[_0xbf4e('0x23')]['key']};});_0x315df3[_0xbf4e('0x24')]=_[_0xbf4e('0x25')](_0x41f918,_0xbf4e('0x20'));_0x315df3['query']=_[_0xbf4e('0x26')](_0x2bfccf[_0xbf4e('0x27')]);_0x315df3[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],_0x315df3[_0xbf4e('0x27')]);_0x38c923['attributes']=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],qs['fields'](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2a')]));_0x38c923['attributes']=_0x38c923[_0xbf4e('0x2b')]['length']?_0x38c923[_0xbf4e('0x2b')]:_0x315df3['model'];if(!_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2c')](_0xbf4e('0x2d'))){_0x38c923['limit']=qs[_0xbf4e('0x17')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x17')]);_0x38c923[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x2bfccf[_0xbf4e('0x27')]['offset']);}_0x38c923[_0xbf4e('0x2e')]=qs[_0xbf4e('0x2f')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2f')]);_0x38c923[_0xbf4e('0x30')]=qs['filters'](_['pick'](_0x2bfccf['query'],_0x315df3['filters']),_0x41f918);if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]){_0x38c923[_0xbf4e('0x30')]=_[_0xbf4e('0x32')](_0x38c923[_0xbf4e('0x30')],{'$or':_[_0xbf4e('0x25')](_0x41f918,function(_0x355b42){if(_0x355b42[_0xbf4e('0x23')]!==_0xbf4e('0x33')){var _0x54527d={};_0x54527d[_0x355b42['name']]={'$like':'%'+_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]+'%'};return _0x54527d;}})});}_0x38c923=_[_0xbf4e('0x32')]({},_0x38c923,_0x2bfccf['options']);var _0x3f46f1={'where':_0x38c923['where']};return db[_0xbf4e('0x21')][_0xbf4e('0x15')](_0x3f46f1)[_0xbf4e('0x1b')](function(_0xb30f90){_0x4021a9['count']=_0xb30f90;if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x34')]){_0x38c923[_0xbf4e('0x35')]=[{'all':!![]}];}return db[_0xbf4e('0x21')]['findAll'](_0x38c923);})[_0xbf4e('0x1b')](function(_0x44e96b){_0x4021a9[_0xbf4e('0x36')]=_0x44e96b;return _0x4021a9;})[_0xbf4e('0x1b')](respondWithFilteredResult(_0x5a0a9b,_0x38c923))[_0xbf4e('0x37')](handleError(_0x5a0a9b,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 0ce911a..8cae717 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 _0xe50e=['request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','moment','bluebird'];(function(_0x4e301d,_0x437496){var _0x3ac213=function(_0x1f531f){while(--_0x1f531f){_0x4e301d['push'](_0x4e301d['shift']());}};_0x3ac213(++_0x437496);}(_0xe50e,0xf9));var _0xee50=function(_0x29e758,_0x345372){_0x29e758=_0x29e758-0x0;var _0x4e348f=_0xe50e[_0x29e758];return _0x4e348f;};'use strict';var _=require(_0xee50('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xee50('0x1'));var BPromise=require(_0xee50('0x2'));var rp=require(_0xee50('0x3'));var fs=require('fs');var path=require(_0xee50('0x4'));var rimraf=require(_0xee50('0x5'));var config=require(_0xee50('0x6'));var attributes=require(_0xee50('0x7'));module[_0xee50('0x8')]=function(_0x3fe965,_0x3b0585){return _0x3fe965[_0xee50('0x9')](_0xee50('0xa'),attributes,{'tableName':_0xee50('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0776=['./migration.attributes','exports','migrations','lodash','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x49e584,_0x2886f8){var _0x58b1be=function(_0x40397c){while(--_0x40397c){_0x49e584['push'](_0x49e584['shift']());}};_0x58b1be(++_0x2886f8);}(_0x0776,0xad));var _0x6077=function(_0x1d4e7d,_0x3ac0c6){_0x1d4e7d=_0x1d4e7d-0x0;var _0x278fd7=_0x0776[_0x1d4e7d];return _0x278fd7;};'use strict';var _=require(_0x6077('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6077('0x1'));var moment=require(_0x6077('0x2'));var BPromise=require('bluebird');var rp=require(_0x6077('0x3'));var fs=require('fs');var path=require(_0x6077('0x4'));var rimraf=require(_0x6077('0x5'));var config=require(_0x6077('0x6'));var attributes=require(_0x6077('0x7'));module[_0x6077('0x8')]=function(_0x5c16bf,_0x50a0b7){return _0x5c16bf['define']('Migration',attributes,{'tableName':_0x6077('0x9'),'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 f29bed9..e5d5d9b 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 _0x4689=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5ef9f3,_0x3d3869){var _0x47f73=function(_0x27c31f){while(--_0x27c31f){_0x5ef9f3['push'](_0x5ef9f3['shift']());}};_0x47f73(++_0x3d3869);}(_0x4689,0xf2));var _0x9468=function(_0xc9c314,_0x3ea106){_0xc9c314=_0xc9c314-0x0;var _0x544064=_0x4689[_0xc9c314];return _0x544064;};'use strict';var _=require('lodash');var util=require(_0x9468('0x0'));var moment=require(_0x9468('0x1'));var BPromise=require(_0x9468('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9468('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9468('0x4'));var logger=require(_0x9468('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9468('0x6'));var client=jayson[_0x9468('0x7')][_0x9468('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x580cd5,_0x15d9da,_0x3af302){return new BPromise(function(_0x3be103,_0x16ff0b){return client[_0x9468('0x9')](_0x580cd5,_0x3af302)[_0x9468('0xa')](function(_0x2bf1e8){logger[_0x9468('0xb')](_0x9468('0xc'),_0x15d9da,_0x9468('0xd'));logger[_0x9468('0xe')](_0x9468('0xf'),_0x15d9da,_0x9468('0xd'),JSON[_0x9468('0x10')](_0x2bf1e8));if(_0x2bf1e8[_0x9468('0x11')]){if(_0x2bf1e8[_0x9468('0x11')][_0x9468('0x12')]===0x1f4){logger[_0x9468('0x11')]('Migration,\x20%s,\x20%s',_0x15d9da,_0x2bf1e8[_0x9468('0x11')][_0x9468('0x13')]);return _0x16ff0b(_0x2bf1e8['error'][_0x9468('0x13')]);}logger[_0x9468('0x11')]('Migration,\x20%s,\x20%s',_0x15d9da,_0x2bf1e8['error'][_0x9468('0x13')]);return _0x3be103(_0x2bf1e8['error']['message']);}else{logger['info'](_0x9468('0xc'),_0x15d9da,'request\x20sent');_0x3be103(_0x2bf1e8[_0x9468('0x14')][_0x9468('0x13')]);}})[_0x9468('0x15')](function(_0x1def60){logger[_0x9468('0x11')](_0x9468('0xc'),_0x15d9da,_0x1def60);_0x16ff0b(_0x1def60);});});} \ No newline at end of file +var _0x6cac=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x251a77,_0x2f477d){var _0x5466fa=function(_0x40d488){while(--_0x40d488){_0x251a77['push'](_0x251a77['shift']());}};_0x5466fa(++_0x2f477d);}(_0x6cac,0xe7));var _0xc6ca=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6cac[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xc6ca('0x0'));var util=require('util');var moment=require(_0xc6ca('0x1'));var BPromise=require(_0xc6ca('0x2'));var rs=require(_0xc6ca('0x3'));var fs=require('fs');var Redis=require(_0xc6ca('0x4'));var db=require(_0xc6ca('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6ca('0x6'))(_0xc6ca('0x7'));var config=require(_0xc6ca('0x8'));var jayson=require(_0xc6ca('0x9'));var client=jayson[_0xc6ca('0xa')][_0xc6ca('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a3de1,_0x5709ff,_0x30b18c){return new BPromise(function(_0x14511b,_0x32051d){return client[_0xc6ca('0xc')](_0x5a3de1,_0x30b18c)['then'](function(_0x628af9){logger[_0xc6ca('0xd')](_0xc6ca('0xe'),_0x5709ff,'request\x20sent');logger[_0xc6ca('0xf')](_0xc6ca('0x10'),_0x5709ff,'request\x20sent',JSON[_0xc6ca('0x11')](_0x628af9));if(_0x628af9[_0xc6ca('0x12')]){if(_0x628af9[_0xc6ca('0x12')][_0xc6ca('0x13')]===0x1f4){logger[_0xc6ca('0x12')](_0xc6ca('0xe'),_0x5709ff,_0x628af9[_0xc6ca('0x12')][_0xc6ca('0x14')]);return _0x32051d(_0x628af9['error'][_0xc6ca('0x14')]);}logger[_0xc6ca('0x12')](_0xc6ca('0xe'),_0x5709ff,_0x628af9['error']['message']);return _0x14511b(_0x628af9[_0xc6ca('0x12')]['message']);}else{logger['info'](_0xc6ca('0xe'),_0x5709ff,_0xc6ca('0x15'));_0x14511b(_0x628af9['result'][_0xc6ca('0x14')]);}})[_0xc6ca('0x16')](function(_0xb73af){logger[_0xc6ca('0x12')](_0xc6ca('0xe'),_0x5709ff,_0xb73af);_0x32051d(_0xb73af);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 65bd422..7dc8bf7 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 _0x7fef=['/:id','show','create','update','delete','destroy','multer','path','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index'];(function(_0x32b2cf,_0x3bb3d3){var _0xdb8e9e=function(_0x4acd06){while(--_0x4acd06){_0x32b2cf['push'](_0x32b2cf['shift']());}};_0xdb8e9e(++_0x3bb3d3);}(_0x7fef,0x110));var _0xf7fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7fef[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf7fe('0x0'));var util=require('util');var path=require(_0xf7fe('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xf7fe('0x2'));var interaction=require(_0xf7fe('0x3'));var config=require('../../config/environment');var controller=require(_0xf7fe('0x4'));router[_0xf7fe('0x5')]('/',auth[_0xf7fe('0x6')](),controller[_0xf7fe('0x7')]);router['get'](_0xf7fe('0x8'),auth[_0xf7fe('0x6')](),controller[_0xf7fe('0x9')]);router['post']('/',auth[_0xf7fe('0x6')](),controller[_0xf7fe('0xa')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf7fe('0xb')]);router[_0xf7fe('0xc')](_0xf7fe('0x8'),auth[_0xf7fe('0x6')](),controller[_0xf7fe('0xd')]);module['exports']=router; \ No newline at end of file +var _0x4783=['index','get','/:id','show','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','./network.controller','isAuthenticated'];(function(_0x9d1971,_0x50b82e){var _0x203469=function(_0x2733b4){while(--_0x2733b4){_0x9d1971['push'](_0x9d1971['shift']());}};_0x203469(++_0x50b82e);}(_0x4783,0xbe));var _0x3478=function(_0xae0dcd,_0x567f58){_0xae0dcd=_0xae0dcd-0x0;var _0x13a220=_0x4783[_0xae0dcd];return _0x13a220;};'use strict';var multer=require(_0x3478('0x0'));var util=require(_0x3478('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3478('0x2'));var router=express[_0x3478('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3478('0x4'));var config=require(_0x3478('0x5'));var controller=require(_0x3478('0x6'));router['get']('/',auth[_0x3478('0x7')](),controller[_0x3478('0x8')]);router[_0x3478('0x9')](_0x3478('0xa'),auth[_0x3478('0x7')](),controller[_0x3478('0xb')]);router['post']('/',auth[_0x3478('0x7')](),controller[_0x3478('0xc')]);router[_0x3478('0xd')](_0x3478('0xa'),auth['isAuthenticated'](),controller[_0x3478('0xe')]);router[_0x3478('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3478('0x10')]);module[_0x3478('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 36af72b..dd89d0d 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(_0x4cc9ee,_0x5d7124){var _0x4f0989=function(_0x1dcfe3){while(--_0x1dcfe3){_0x4cc9ee['push'](_0x4cc9ee['shift']());}};_0x4f0989(++_0x5d7124);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x3fef5e,_0x24c25c){var _0x42cf50=function(_0x4f25e6){while(--_0x4f25e6){_0x3fef5e['push'](_0x3fef5e['shift']());}};_0x42cf50(++_0x24c25c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 993b382..962c5a8 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 _0x0076=['count','include','findAll','rows','catch','show','intersection','includeAll','find','create','sequelize','transaction','body','toUpperCase','STUN','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','TURN','Reload','res_stun_monitor.so','join','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','params','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','chan_sip.so','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','offset','limit','set','Content-Range','json','update','destroy','stack','name','index','map','Network','rawAttributes','fieldName','key','query','keys','filters','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options'];(function(_0x543eac,_0x3a39a1){var _0x16c036=function(_0x446e5d){while(--_0x446e5d){_0x543eac['push'](_0x543eac['shift']());}};_0x16c036(++_0x3a39a1);}(_0x0076,0x1e2));var _0x6007=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x0076[_0x5a9c0c];return _0x53c77d;};'use strict';var pdf=require(_0x6007('0x0'));var emlformat=require(_0x6007('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x6007('0x2'));var jsonpatch=require(_0x6007('0x3'));var rp=require(_0x6007('0x4'));var moment=require(_0x6007('0x5'));var BPromise=require(_0x6007('0x6'));var Mustache=require(_0x6007('0x7'));var util=require(_0x6007('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6007('0x9'));var ejs=require(_0x6007('0xa'));var fs=require('fs');var _=require(_0x6007('0xb'));var squel=require(_0x6007('0xc'));var crypto=require(_0x6007('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6007('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6007('0xf'));var Redis=require(_0x6007('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6007('0x11'));var as=require(_0x6007('0x12'));var hardwareService=require(_0x6007('0x13'));var logger=require(_0x6007('0x14'))(_0x6007('0x15'));var utils=require(_0x6007('0x16'));var config=require(_0x6007('0x17'));var db=require(_0x6007('0x18'))['db'];var jayson=require(_0x6007('0x19'));var client=jayson['client'][_0x6007('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x56f459,_0x41f0c4,_0x14745d){if(_0x14745d){var _0x2c3832=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c3832[_0x6007('0x1b')](_0x41f0c4)){return _0x56f459;}else{throw new db[(_0x6007('0x1c'))][(_0x6007('0x1d'))](_0x6007('0x1e'));}}else{return _0x56f459;}}function respondWithRpcPromise(_0x4b5f0c,_0x214dbf,_0x3e9cd2,_0x2188a6){return new BPromise(function(_0x270d36,_0x25050c){var _0x44a8fe=_0x2188a6||client;return _0x44a8fe[_0x6007('0x1f')](_0x4b5f0c,_0x3e9cd2)[_0x6007('0x20')](function(_0x18da24){logger[_0x6007('0x21')](_0x6007('0x22'),_0x214dbf,_0x6007('0x23'));logger['debug'](_0x6007('0x24'),_0x214dbf,'request\x20sent',JSON[_0x6007('0x25')](_0x18da24));if(_0x18da24[_0x6007('0x26')]){if(_0x18da24[_0x6007('0x26')][_0x6007('0x27')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x214dbf,_0x18da24[_0x6007('0x26')][_0x6007('0x28')]);return _0x25050c(_0x18da24[_0x6007('0x26')][_0x6007('0x28')]);}logger[_0x6007('0x26')](_0x6007('0x22'),_0x214dbf,_0x18da24['error']['message']);return _0x270d36(_0x18da24[_0x6007('0x26')][_0x6007('0x28')]);}else{logger[_0x6007('0x21')]('Network,\x20%s,\x20%s',_0x214dbf,'request\x20sent');_0x270d36(_0x18da24[_0x6007('0x29')][_0x6007('0x28')]);}})['catch'](function(_0xc796c6){logger[_0x6007('0x26')](_0x6007('0x22'),_0x214dbf,_0xc796c6);_0x25050c(_0xc796c6);});});}function respondWithStatusCode(_0x19aacc,_0x188b86){_0x188b86=_0x188b86||0xcc;return function(_0x1184bf){if(_0x1184bf){return _0x19aacc[_0x6007('0x2a')](_0x188b86);}return _0x19aacc['status'](_0x188b86)[_0x6007('0x2b')]();};}function respondWithResult(_0x4cd7d,_0x1aa709){_0x1aa709=_0x1aa709||0xc8;return function(_0x4be9b4){if(_0x4be9b4){return _0x4cd7d[_0x6007('0x2c')](_0x1aa709)['json'](_0x4be9b4);}};}function respondWithFilteredResult(_0x7eea39,_0x273e60){return function(_0xea6488){if(_0xea6488){var _0x441f83=_0xea6488['count'],_0x40e1b7=_0x273e60[_0x6007('0x2d')],_0xbc1b76=_0x273e60[_0x6007('0x2d')]+_0x273e60[_0x6007('0x2e')],_0x506393;if(_0xbc1b76>=_0x441f83){_0xbc1b76=_0x441f83;_0x506393=0xc8;}else{_0x506393=0xce;}_0x7eea39['status'](_0x506393);return _0x7eea39[_0x6007('0x2f')](_0x6007('0x30'),_0x40e1b7+'-'+_0xbc1b76+'/'+_0x441f83)[_0x6007('0x31')](_0xea6488);}return null;};}function patchUpdates(_0x5d29d3){return function(_0x298940){try{jsonpatch['apply'](_0x298940,_0x5d29d3,!![]);}catch(_0x28e3f8){return BPromise['reject'](_0x28e3f8);}return _0x298940['save']();};}function saveUpdates(_0x4981e1,_0xd8dce8){return function(_0x11f709){if(_0x11f709){return _0x11f709[_0x6007('0x32')](_0x4981e1)[_0x6007('0x20')](function(_0x373467){return _0x373467;});}return null;};}function removeEntity(_0x2974d8,_0x10c6ca){return function(_0xd01992){if(_0xd01992){return _0xd01992[_0x6007('0x33')]()['then'](function(){_0x2974d8[_0x6007('0x2c')](0xcc)[_0x6007('0x2b')]();});}};}function handleEntityNotFound(_0x306d21,_0x483cbb){return function(_0x4c196a){if(!_0x4c196a){_0x306d21[_0x6007('0x2a')](0x194);}return _0x4c196a;};}function handleError(_0x4885bc,_0x1e73b6){_0x1e73b6=_0x1e73b6||0x1f4;return function(_0x2ef81e){logger[_0x6007('0x26')](_0x2ef81e[_0x6007('0x34')]);if(_0x2ef81e[_0x6007('0x35')]){delete _0x2ef81e['name'];}_0x4885bc[_0x6007('0x2c')](_0x1e73b6)['send'](_0x2ef81e);};}exports[_0x6007('0x36')]=function(_0x18468e,_0x3ac472){var _0x15659d={},_0x343e7e={},_0x113d4a={'count':0x0,'rows':[]};var _0xc36763=_[_0x6007('0x37')](db[_0x6007('0x38')][_0x6007('0x39')],function(_0x3554f5){return{'name':_0x3554f5[_0x6007('0x3a')],'type':_0x3554f5['type'][_0x6007('0x3b')]};});_0x343e7e['model']=_[_0x6007('0x37')](_0xc36763,_0x6007('0x35'));_0x343e7e[_0x6007('0x3c')]=_[_0x6007('0x3d')](_0x18468e['query']);_0x343e7e[_0x6007('0x3e')]=_['intersection'](_0x343e7e['model'],_0x343e7e[_0x6007('0x3c')]);_0x15659d[_0x6007('0x3f')]=_['intersection'](_0x343e7e['model'],qs['fields'](_0x18468e[_0x6007('0x3c')][_0x6007('0x40')]));_0x15659d[_0x6007('0x3f')]=_0x15659d[_0x6007('0x3f')][_0x6007('0x41')]?_0x15659d[_0x6007('0x3f')]:_0x343e7e[_0x6007('0x42')];if(!_0x18468e[_0x6007('0x3c')][_0x6007('0x43')](_0x6007('0x44'))){_0x15659d[_0x6007('0x2e')]=qs['limit'](_0x18468e[_0x6007('0x3c')][_0x6007('0x2e')]);_0x15659d['offset']=qs[_0x6007('0x2d')](_0x18468e[_0x6007('0x3c')][_0x6007('0x2d')]);}_0x15659d[_0x6007('0x45')]=qs[_0x6007('0x46')](_0x18468e['query'][_0x6007('0x46')]);_0x15659d['where']=qs[_0x6007('0x3e')](_[_0x6007('0x47')](_0x18468e[_0x6007('0x3c')],_0x343e7e[_0x6007('0x3e')]),_0xc36763);if(_0x18468e['query'][_0x6007('0x48')]){_0x15659d[_0x6007('0x49')]=_['merge'](_0x15659d[_0x6007('0x49')],{'$or':_['map'](_0xc36763,function(_0x1ae959){if(_0x1ae959[_0x6007('0x4a')]!==_0x6007('0x4b')){var _0x5203f3={};_0x5203f3[_0x1ae959['name']]={'$like':'%'+_0x18468e['query'][_0x6007('0x48')]+'%'};return _0x5203f3;}})});}_0x15659d=_[_0x6007('0x4c')]({},_0x15659d,_0x18468e[_0x6007('0x4d')]);var _0x178d41={'where':_0x15659d[_0x6007('0x49')]};return db[_0x6007('0x38')][_0x6007('0x4e')](_0x178d41)['then'](function(_0x5e7dda){_0x113d4a['count']=_0x5e7dda;if(_0x18468e[_0x6007('0x3c')]['includeAll']){_0x15659d[_0x6007('0x4f')]=[{'all':!![]}];}return db[_0x6007('0x38')][_0x6007('0x50')](_0x15659d);})[_0x6007('0x20')](function(_0x37bf49){_0x113d4a[_0x6007('0x51')]=_0x37bf49;return _0x113d4a;})[_0x6007('0x20')](respondWithFilteredResult(_0x3ac472,_0x15659d))[_0x6007('0x52')](handleError(_0x3ac472,null));};exports[_0x6007('0x53')]=function(_0x19522b,_0x459de3){var _0x793eb={'raw':!![],'where':{'id':_0x19522b['params']['id']}},_0x46184e={};_0x46184e['model']=_[_0x6007('0x3d')](db[_0x6007('0x38')][_0x6007('0x39')]);_0x46184e[_0x6007('0x3c')]=_[_0x6007('0x3d')](_0x19522b[_0x6007('0x3c')]);_0x46184e['filters']=_[_0x6007('0x54')](_0x46184e[_0x6007('0x42')],_0x46184e['query']);_0x793eb[_0x6007('0x3f')]=_[_0x6007('0x54')](_0x46184e[_0x6007('0x42')],qs[_0x6007('0x40')](_0x19522b[_0x6007('0x3c')][_0x6007('0x40')]));_0x793eb['attributes']=_0x793eb[_0x6007('0x3f')]['length']?_0x793eb[_0x6007('0x3f')]:_0x46184e[_0x6007('0x42')];if(_0x19522b[_0x6007('0x3c')][_0x6007('0x55')]){_0x793eb['include']=[{'all':!![]}];}_0x793eb=_['merge']({},_0x793eb,_0x19522b[_0x6007('0x4d')]);return db[_0x6007('0x38')][_0x6007('0x56')](_0x793eb)[_0x6007('0x20')](handleEntityNotFound(_0x459de3,null))[_0x6007('0x20')](respondWithResult(_0x459de3,null))[_0x6007('0x52')](handleError(_0x459de3,null));};exports[_0x6007('0x57')]=function(_0x3a4017,_0x202afa,_0x23bfb3){var _0x58a5ef;return db[_0x6007('0x58')][_0x6007('0x59')](function(_0x27103d){return db[_0x6007('0x38')][_0x6007('0x57')](_0x3a4017[_0x6007('0x5a')],{'raw':!![]})[_0x6007('0x20')](function(_0x419512){_0x58a5ef=_0x419512;return db[_0x6007('0x38')][_0x6007('0x50')]({'where':{'type':_0x3a4017[_0x6007('0x5a')][_0x6007('0x4a')]},'raw':!![]});})[_0x6007('0x20')](function(_0xbab1f3){if(_0x58a5ef[_0x6007('0x4a')][_0x6007('0x5b')]()==_0x6007('0x5c')){var _0x14bc61=fs[_0x6007('0x5d')](path['join'](config[_0x6007('0x5e')],_0x6007('0x5f')),_0x6007('0x60'));var _0x360305=ejs[_0x6007('0x61')](_0x14bc61,{'networks':_0xbab1f3||[]});fs[_0x6007('0x62')](_0x6007('0x63'),_0x360305);return respondWithRpcPromise('Reload',_0x6007('0x57'),{'module':'res_stun_monitor.so'});}else if(_0x58a5ef[_0x6007('0x4a')][_0x6007('0x5b')]()==_0x6007('0x64')){var _0x120e60=fs[_0x6007('0x5d')](path['join'](config[_0x6007('0x5e')],'server/files/templates/turn_multiple.ejs'),_0x6007('0x60'));var _0x5a54a1=ejs[_0x6007('0x61')](_0x120e60,{'networks':_0xbab1f3||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x5a54a1);return respondWithRpcPromise(_0x6007('0x65'),'create',{'module':_0x6007('0x66')});}else{var _0x3998bc=fs[_0x6007('0x5d')](path[_0x6007('0x67')](config['root'],'server/files/templates/network.ejs'),_0x6007('0x60'));var _0x5dc121=ejs[_0x6007('0x61')](_0x3998bc,{'networks':_0xbab1f3||[]});fs[_0x6007('0x62')](util['format'](_0x6007('0x68'),_0x3a4017[_0x6007('0x5a')]['type'][_0x6007('0x69')]()),_0x5dc121);return respondWithRpcPromise('Reload',_0x6007('0x57'),{'module':'chan_sip.so'});}return null;})[_0x6007('0x20')](function(){return _0x58a5ef;});})[_0x6007('0x20')](respondWithResult(_0x202afa,0xc9))[_0x6007('0x52')](handleError(_0x202afa,null));};exports[_0x6007('0x32')]=function(_0x2e6baf,_0x1b4a24,_0x2a7670){var _0x7030ca;return db[_0x6007('0x58')]['transaction'](function(_0x412da1){return db[_0x6007('0x38')]['find']({'where':{'id':_0x2e6baf[_0x6007('0x6a')]['id']}})[_0x6007('0x20')](handleEntityNotFound(_0x1b4a24,null))[_0x6007('0x20')](saveUpdates(_0x2e6baf['body'],null))[_0x6007('0x20')](function(_0x19276f){if(_0x19276f){_0x7030ca=_0x19276f;return db['Network'][_0x6007('0x50')]({'where':{'type':_0x7030ca['type']},'raw':!![]});}return null;})[_0x6007('0x20')](function(_0x88b412){if(_0x7030ca[_0x6007('0x4a')][_0x6007('0x5b')]()==_0x6007('0x5c')){var _0xf922cd=fs[_0x6007('0x5d')](path[_0x6007('0x67')](config[_0x6007('0x5e')],_0x6007('0x5f')),_0x6007('0x60'));var _0x9b2221=ejs[_0x6007('0x61')](_0xf922cd,{'networks':_0x88b412||[]});fs[_0x6007('0x62')](_0x6007('0x63'),_0x9b2221);return respondWithRpcPromise('Reload',_0x6007('0x32'),{'module':_0x6007('0x66')});}else if(_0x7030ca[_0x6007('0x4a')][_0x6007('0x5b')]()=='TURN'){var _0x3dbd2a=fs[_0x6007('0x5d')](path[_0x6007('0x67')](config[_0x6007('0x5e')],_0x6007('0x6b')),'utf8');var _0x1371db=ejs[_0x6007('0x61')](_0x3dbd2a,{'networks':_0x88b412||[]});fs[_0x6007('0x62')](_0x6007('0x6c'),_0x1371db);return respondWithRpcPromise(_0x6007('0x65'),_0x6007('0x32'),{'module':'res_stun_monitor.so'});}else{var _0x5d64ae=fs[_0x6007('0x5d')](path['join'](config[_0x6007('0x5e')],_0x6007('0x6d')),_0x6007('0x60'));var _0x4fe7c6=ejs[_0x6007('0x61')](_0x5d64ae,{'networks':_0x88b412||[]});fs['writeFileSync'](util[_0x6007('0x6e')](_0x6007('0x68'),_0x2e6baf[_0x6007('0x5a')]['type'][_0x6007('0x69')]()),_0x4fe7c6);return respondWithRpcPromise('Reload','update',{'module':_0x6007('0x6f')});}return null;})[_0x6007('0x20')](function(_0x3e71e6){if(_0x3e71e6){return _0x7030ca;}return null;});})[_0x6007('0x20')](respondWithResult(_0x1b4a24,null))[_0x6007('0x52')](handleError(_0x1b4a24,null));};exports[_0x6007('0x33')]=function(_0x1e3b36,_0x395791,_0x334adb){var _0x4316aa;return db[_0x6007('0x38')][_0x6007('0x56')]({'where':{'id':_0x1e3b36[_0x6007('0x6a')]['id']}})['then'](function(_0x29a3e8){_0x4316aa=_0x29a3e8;return _0x29a3e8;})[_0x6007('0x20')](handleEntityNotFound(_0x395791,null))['then'](removeEntity(_0x395791,null))['then'](function(){if(_0x4316aa){return db[_0x6007('0x38')]['findAll']({'where':{'type':_0x4316aa[_0x6007('0x4a')]},'raw':!![]});}})[_0x6007('0x20')](function(_0x39969a){if(_0x4316aa[_0x6007('0x4a')][_0x6007('0x5b')]()==_0x6007('0x5c')){var _0x42e618=fs[_0x6007('0x5d')](path[_0x6007('0x67')](config[_0x6007('0x5e')],'server/files/templates/stun_multiple.ejs'),_0x6007('0x60'));var _0x59bc09=ejs['render'](_0x42e618,{'networks':_0x39969a||[]});fs[_0x6007('0x62')]('/etc/asterisk/stun_xcally.conf',_0x59bc09);return respondWithRpcPromise(_0x6007('0x65'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x4316aa['type'][_0x6007('0x5b')]()==_0x6007('0x64')){var _0x3990e6=fs[_0x6007('0x5d')](path[_0x6007('0x67')](config['root'],_0x6007('0x6b')),_0x6007('0x60'));var _0x59e27a=ejs[_0x6007('0x61')](_0x3990e6,{'networks':_0x39969a||[]});fs[_0x6007('0x62')](_0x6007('0x6c'),_0x59e27a);return respondWithRpcPromise(_0x6007('0x65'),_0x6007('0x33'),{'module':_0x6007('0x66')});}else{var _0x5771b5=fs[_0x6007('0x5d')](path[_0x6007('0x67')](config[_0x6007('0x5e')],_0x6007('0x6d')),'utf8');var _0xbbc73=ejs[_0x6007('0x61')](_0x5771b5,{'networks':_0x39969a||[]});fs[_0x6007('0x62')](util[_0x6007('0x6e')](_0x6007('0x68'),_0x1e3b36[_0x6007('0x5a')]['type'][_0x6007('0x69')]()),_0xbbc73);return respondWithRpcPromise(_0x6007('0x65'),'destroy',{'module':'chan_sip.so'});}return null;})[_0x6007('0x52')](handleError(_0x395791,null));}; \ No newline at end of file +var _0x865b=['status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','name','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','Network','findAll','rows','params','includeAll','find','sequelize','transaction','create','body','readFileSync','join','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','server/files/templates/turn_multiple.ejs','render','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','utf8','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','root','TURN','server/files/templates/stun_multiple.ejs','html-pdf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','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','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x865b,0xae));var _0xb865=function(_0x5a839d,_0x571bc8){_0x5a839d=_0x5a839d-0x0;var _0x54ca3c=_0x865b[_0x5a839d];return _0x54ca3c;};'use strict';var pdf=require(_0xb865('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb865('0x1'));var rp=require(_0xb865('0x2'));var moment=require(_0xb865('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb865('0x4'));var util=require(_0xb865('0x5'));var path=require(_0xb865('0x6'));var sox=require(_0xb865('0x7'));var csv=require(_0xb865('0x8'));var ejs=require(_0xb865('0x9'));var fs=require('fs');var _=require(_0xb865('0xa'));var squel=require(_0xb865('0xb'));var crypto=require('crypto');var jsforce=require(_0xb865('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb865('0xd'));var Papa=require(_0xb865('0xe'));var Redis=require(_0xb865('0xf'));var authService=require(_0xb865('0x10'));var qs=require(_0xb865('0x11'));var as=require(_0xb865('0x12'));var hardwareService=require(_0xb865('0x13'));var logger=require(_0xb865('0x14'))(_0xb865('0x15'));var utils=require(_0xb865('0x16'));var config=require(_0xb865('0x17'));var db=require(_0xb865('0x18'))['db'];var jayson=require(_0xb865('0x19'));var client=jayson[_0xb865('0x1a')][_0xb865('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3dd2d2,_0x1242a3,_0x20f7bf){if(_0x20f7bf){var _0x235675=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x235675[_0xb865('0x1c')](_0x1242a3)){return _0x3dd2d2;}else{throw new db[(_0xb865('0x1d'))][(_0xb865('0x1e'))](_0xb865('0x1f'));}}else{return _0x3dd2d2;}}function respondWithRpcPromise(_0x1d95da,_0x4d62b6,_0x10db0c,_0x23a697){return new BPromise(function(_0x2fa19b,_0x5b1d90){var _0x29d37f=_0x23a697||client;return _0x29d37f[_0xb865('0x20')](_0x1d95da,_0x10db0c)['then'](function(_0x155b98){logger['info'](_0xb865('0x21'),_0x4d62b6,_0xb865('0x22'));logger[_0xb865('0x23')]('Network,\x20%s,\x20%s,\x20%s',_0x4d62b6,_0xb865('0x22'),JSON[_0xb865('0x24')](_0x155b98));if(_0x155b98[_0xb865('0x25')]){if(_0x155b98['error'][_0xb865('0x26')]===0x1f4){logger[_0xb865('0x25')](_0xb865('0x21'),_0x4d62b6,_0x155b98[_0xb865('0x25')][_0xb865('0x27')]);return _0x5b1d90(_0x155b98['error'][_0xb865('0x27')]);}logger[_0xb865('0x25')](_0xb865('0x21'),_0x4d62b6,_0x155b98[_0xb865('0x25')][_0xb865('0x27')]);return _0x2fa19b(_0x155b98[_0xb865('0x25')]['message']);}else{logger['info'](_0xb865('0x21'),_0x4d62b6,_0xb865('0x22'));_0x2fa19b(_0x155b98['result'][_0xb865('0x27')]);}})[_0xb865('0x28')](function(_0xea20f3){logger['error']('Network,\x20%s,\x20%s',_0x4d62b6,_0xea20f3);_0x5b1d90(_0xea20f3);});});}function respondWithStatusCode(_0x59e69d,_0x21859b){_0x21859b=_0x21859b||0xcc;return function(_0x57ed15){if(_0x57ed15){return _0x59e69d[_0xb865('0x29')](_0x21859b);}return _0x59e69d[_0xb865('0x2a')](_0x21859b)['end']();};}function respondWithResult(_0x469954,_0x55a154){_0x55a154=_0x55a154||0xc8;return function(_0x41a677){if(_0x41a677){return _0x469954[_0xb865('0x2a')](_0x55a154)[_0xb865('0x2b')](_0x41a677);}};}function respondWithFilteredResult(_0x3fb08f,_0x4fa47e){return function(_0x37507f){if(_0x37507f){var _0x5f2e4b=_0x37507f[_0xb865('0x2c')],_0x4da8a0=_0x4fa47e['offset'],_0x366062=_0x4fa47e[_0xb865('0x2d')]+_0x4fa47e[_0xb865('0x2e')],_0x38bdfd;if(_0x366062>=_0x5f2e4b){_0x366062=_0x5f2e4b;_0x38bdfd=0xc8;}else{_0x38bdfd=0xce;}_0x3fb08f['status'](_0x38bdfd);return _0x3fb08f[_0xb865('0x2f')](_0xb865('0x30'),_0x4da8a0+'-'+_0x366062+'/'+_0x5f2e4b)[_0xb865('0x2b')](_0x37507f);}return null;};}function patchUpdates(_0x480320){return function(_0x39c6bb){try{jsonpatch['apply'](_0x39c6bb,_0x480320,!![]);}catch(_0x163d57){return BPromise[_0xb865('0x31')](_0x163d57);}return _0x39c6bb[_0xb865('0x32')]();};}function saveUpdates(_0x343274,_0x2a43a5){return function(_0x1c2fb9){if(_0x1c2fb9){return _0x1c2fb9[_0xb865('0x33')](_0x343274)[_0xb865('0x34')](function(_0x2802b5){return _0x2802b5;});}return null;};}function removeEntity(_0x29bfc0,_0x39db99){return function(_0x37368e){if(_0x37368e){return _0x37368e[_0xb865('0x35')]()['then'](function(){_0x29bfc0[_0xb865('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7d71bd,_0xd00901){return function(_0x23ab28){if(!_0x23ab28){_0x7d71bd[_0xb865('0x29')](0x194);}return _0x23ab28;};}function handleError(_0x796a71,_0x5dc963){_0x5dc963=_0x5dc963||0x1f4;return function(_0x42906b){logger['error'](_0x42906b['stack']);if(_0x42906b[_0xb865('0x36')]){delete _0x42906b[_0xb865('0x36')];}_0x796a71[_0xb865('0x2a')](_0x5dc963)['send'](_0x42906b);};}exports[_0xb865('0x37')]=function(_0x11788a,_0x271ef9){var _0x1e08f6={},_0x4099d3={},_0x737e06={'count':0x0,'rows':[]};var _0x2ad5ef=_[_0xb865('0x38')](db['Network'][_0xb865('0x39')],function(_0x19d26f){return{'name':_0x19d26f[_0xb865('0x3a')],'type':_0x19d26f[_0xb865('0x3b')]['key']};});_0x4099d3[_0xb865('0x3c')]=_[_0xb865('0x38')](_0x2ad5ef,_0xb865('0x36'));_0x4099d3['query']=_[_0xb865('0x3d')](_0x11788a[_0xb865('0x3e')]);_0x4099d3[_0xb865('0x3f')]=_[_0xb865('0x40')](_0x4099d3[_0xb865('0x3c')],_0x4099d3['query']);_0x1e08f6[_0xb865('0x41')]=_[_0xb865('0x40')](_0x4099d3['model'],qs['fields'](_0x11788a[_0xb865('0x3e')][_0xb865('0x42')]));_0x1e08f6[_0xb865('0x41')]=_0x1e08f6[_0xb865('0x41')][_0xb865('0x43')]?_0x1e08f6[_0xb865('0x41')]:_0x4099d3[_0xb865('0x3c')];if(!_0x11788a['query'][_0xb865('0x44')](_0xb865('0x45'))){_0x1e08f6[_0xb865('0x2e')]=qs[_0xb865('0x2e')](_0x11788a[_0xb865('0x3e')][_0xb865('0x2e')]);_0x1e08f6['offset']=qs['offset'](_0x11788a[_0xb865('0x3e')][_0xb865('0x2d')]);}_0x1e08f6[_0xb865('0x46')]=qs[_0xb865('0x47')](_0x11788a[_0xb865('0x3e')][_0xb865('0x47')]);_0x1e08f6[_0xb865('0x48')]=qs['filters'](_[_0xb865('0x49')](_0x11788a['query'],_0x4099d3[_0xb865('0x3f')]),_0x2ad5ef);if(_0x11788a[_0xb865('0x3e')]['filter']){_0x1e08f6[_0xb865('0x48')]=_['merge'](_0x1e08f6['where'],{'$or':_[_0xb865('0x38')](_0x2ad5ef,function(_0x453483){if(_0x453483[_0xb865('0x3b')]!==_0xb865('0x4a')){var _0x5ebdca={};_0x5ebdca[_0x453483[_0xb865('0x36')]]={'$like':'%'+_0x11788a[_0xb865('0x3e')][_0xb865('0x4b')]+'%'};return _0x5ebdca;}})});}_0x1e08f6=_[_0xb865('0x4c')]({},_0x1e08f6,_0x11788a[_0xb865('0x4d')]);var _0x26b5d7={'where':_0x1e08f6[_0xb865('0x48')]};return db['Network'][_0xb865('0x2c')](_0x26b5d7)['then'](function(_0x4d2461){_0x737e06[_0xb865('0x2c')]=_0x4d2461;if(_0x11788a['query']['includeAll']){_0x1e08f6[_0xb865('0x4e')]=[{'all':!![]}];}return db[_0xb865('0x4f')][_0xb865('0x50')](_0x1e08f6);})['then'](function(_0xdb4680){_0x737e06[_0xb865('0x51')]=_0xdb4680;return _0x737e06;})[_0xb865('0x34')](respondWithFilteredResult(_0x271ef9,_0x1e08f6))['catch'](handleError(_0x271ef9,null));};exports['show']=function(_0xb1bb45,_0x420a68){var _0x5852e4={'raw':!![],'where':{'id':_0xb1bb45[_0xb865('0x52')]['id']}},_0x3dcf25={};_0x3dcf25[_0xb865('0x3c')]=_['keys'](db[_0xb865('0x4f')][_0xb865('0x39')]);_0x3dcf25[_0xb865('0x3e')]=_[_0xb865('0x3d')](_0xb1bb45[_0xb865('0x3e')]);_0x3dcf25['filters']=_[_0xb865('0x40')](_0x3dcf25[_0xb865('0x3c')],_0x3dcf25[_0xb865('0x3e')]);_0x5852e4[_0xb865('0x41')]=_[_0xb865('0x40')](_0x3dcf25['model'],qs[_0xb865('0x42')](_0xb1bb45[_0xb865('0x3e')][_0xb865('0x42')]));_0x5852e4['attributes']=_0x5852e4[_0xb865('0x41')]['length']?_0x5852e4['attributes']:_0x3dcf25[_0xb865('0x3c')];if(_0xb1bb45['query'][_0xb865('0x53')]){_0x5852e4[_0xb865('0x4e')]=[{'all':!![]}];}_0x5852e4=_[_0xb865('0x4c')]({},_0x5852e4,_0xb1bb45[_0xb865('0x4d')]);return db['Network'][_0xb865('0x54')](_0x5852e4)[_0xb865('0x34')](handleEntityNotFound(_0x420a68,null))[_0xb865('0x34')](respondWithResult(_0x420a68,null))[_0xb865('0x28')](handleError(_0x420a68,null));};exports['create']=function(_0x3c8e1e,_0x5532c6,_0x12868d){var _0x5a8579;return db[_0xb865('0x55')][_0xb865('0x56')](function(_0x46d60f){return db['Network'][_0xb865('0x57')](_0x3c8e1e[_0xb865('0x58')],{'raw':!![]})[_0xb865('0x34')](function(_0x2157f0){_0x5a8579=_0x2157f0;return db['Network'][_0xb865('0x50')]({'where':{'type':_0x3c8e1e[_0xb865('0x58')]['type']},'raw':!![]});})[_0xb865('0x34')](function(_0x16f61b){if(_0x5a8579['type']['toUpperCase']()=='STUN'){var _0x5b757c=fs[_0xb865('0x59')](path[_0xb865('0x5a')](config['root'],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x46ffda=ejs['render'](_0x5b757c,{'networks':_0x16f61b||[]});fs['writeFileSync'](_0xb865('0x5b'),_0x46ffda);return respondWithRpcPromise(_0xb865('0x5c'),_0xb865('0x57'),{'module':_0xb865('0x5d')});}else if(_0x5a8579[_0xb865('0x3b')][_0xb865('0x5e')]()=='TURN'){var _0x55a9fb=fs['readFileSync'](path[_0xb865('0x5a')](config['root'],_0xb865('0x5f')),'utf8');var _0x15760a=ejs[_0xb865('0x60')](_0x55a9fb,{'networks':_0x16f61b||[]});fs[_0xb865('0x61')](_0xb865('0x62'),_0x15760a);return respondWithRpcPromise(_0xb865('0x5c'),_0xb865('0x57'),{'module':_0xb865('0x5d')});}else{var _0x10b827=fs[_0xb865('0x59')](path['join'](config['root'],_0xb865('0x63')),_0xb865('0x64'));var _0x1da8c4=ejs[_0xb865('0x60')](_0x10b827,{'networks':_0x16f61b||[]});fs['writeFileSync'](util[_0xb865('0x65')](_0xb865('0x66'),_0x3c8e1e[_0xb865('0x58')][_0xb865('0x3b')]['toLowerCase']()),_0x1da8c4);return respondWithRpcPromise('Reload',_0xb865('0x57'),{'module':_0xb865('0x67')});}return null;})[_0xb865('0x34')](function(){return _0x5a8579;});})[_0xb865('0x34')](respondWithResult(_0x5532c6,0xc9))[_0xb865('0x28')](handleError(_0x5532c6,null));};exports[_0xb865('0x33')]=function(_0x34dea7,_0x5d3b7b,_0x4a4025){var _0x2aab35;return db[_0xb865('0x55')][_0xb865('0x56')](function(_0x36e8fd){return db[_0xb865('0x4f')][_0xb865('0x54')]({'where':{'id':_0x34dea7['params']['id']}})['then'](handleEntityNotFound(_0x5d3b7b,null))['then'](saveUpdates(_0x34dea7[_0xb865('0x58')],null))[_0xb865('0x34')](function(_0x105501){if(_0x105501){_0x2aab35=_0x105501;return db['Network'][_0xb865('0x50')]({'where':{'type':_0x2aab35['type']},'raw':!![]});}return null;})[_0xb865('0x34')](function(_0x33aa60){if(_0x2aab35[_0xb865('0x3b')]['toUpperCase']()==_0xb865('0x68')){var _0x140376=fs[_0xb865('0x59')](path[_0xb865('0x5a')](config[_0xb865('0x69')],'server/files/templates/stun_multiple.ejs'),_0xb865('0x64'));var _0x589080=ejs[_0xb865('0x60')](_0x140376,{'networks':_0x33aa60||[]});fs[_0xb865('0x61')]('/etc/asterisk/stun_xcally.conf',_0x589080);return respondWithRpcPromise(_0xb865('0x5c'),_0xb865('0x33'),{'module':_0xb865('0x5d')});}else if(_0x2aab35['type']['toUpperCase']()==_0xb865('0x6a')){var _0x4bd698=fs['readFileSync'](path[_0xb865('0x5a')](config['root'],_0xb865('0x5f')),_0xb865('0x64'));var _0x3beb46=ejs[_0xb865('0x60')](_0x4bd698,{'networks':_0x33aa60||[]});fs['writeFileSync'](_0xb865('0x62'),_0x3beb46);return respondWithRpcPromise('Reload',_0xb865('0x33'),{'module':_0xb865('0x5d')});}else{var _0x347596=fs[_0xb865('0x59')](path[_0xb865('0x5a')](config[_0xb865('0x69')],'server/files/templates/network.ejs'),_0xb865('0x64'));var _0x372682=ejs['render'](_0x347596,{'networks':_0x33aa60||[]});fs[_0xb865('0x61')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x34dea7['body']['type']['toLowerCase']()),_0x372682);return respondWithRpcPromise('Reload',_0xb865('0x33'),{'module':_0xb865('0x67')});}return null;})[_0xb865('0x34')](function(_0x555faa){if(_0x555faa){return _0x2aab35;}return null;});})[_0xb865('0x34')](respondWithResult(_0x5d3b7b,null))[_0xb865('0x28')](handleError(_0x5d3b7b,null));};exports[_0xb865('0x35')]=function(_0x363cce,_0x5df794,_0x8e86e7){var _0x3805ef;return db[_0xb865('0x4f')][_0xb865('0x54')]({'where':{'id':_0x363cce['params']['id']}})[_0xb865('0x34')](function(_0x16fcce){_0x3805ef=_0x16fcce;return _0x16fcce;})[_0xb865('0x34')](handleEntityNotFound(_0x5df794,null))['then'](removeEntity(_0x5df794,null))[_0xb865('0x34')](function(){if(_0x3805ef){return db[_0xb865('0x4f')][_0xb865('0x50')]({'where':{'type':_0x3805ef[_0xb865('0x3b')]},'raw':!![]});}})['then'](function(_0x4dfef8){if(_0x3805ef[_0xb865('0x3b')]['toUpperCase']()==_0xb865('0x68')){var _0x2a8ea4=fs[_0xb865('0x59')](path[_0xb865('0x5a')](config['root'],_0xb865('0x6b')),_0xb865('0x64'));var _0x583c47=ejs[_0xb865('0x60')](_0x2a8ea4,{'networks':_0x4dfef8||[]});fs[_0xb865('0x61')](_0xb865('0x5b'),_0x583c47);return respondWithRpcPromise(_0xb865('0x5c'),_0xb865('0x35'),{'module':_0xb865('0x5d')});}else if(_0x3805ef[_0xb865('0x3b')][_0xb865('0x5e')]()==_0xb865('0x6a')){var _0x40f514=fs[_0xb865('0x59')](path['join'](config['root'],_0xb865('0x5f')),'utf8');var _0x47db91=ejs[_0xb865('0x60')](_0x40f514,{'networks':_0x4dfef8||[]});fs[_0xb865('0x61')]('/etc/asterisk/turn_xcally.conf',_0x47db91);return respondWithRpcPromise(_0xb865('0x5c'),_0xb865('0x35'),{'module':'res_stun_monitor.so'});}else{var _0x4c64d1=fs[_0xb865('0x59')](path[_0xb865('0x5a')](config[_0xb865('0x69')],_0xb865('0x63')),_0xb865('0x64'));var _0x797645=ejs[_0xb865('0x60')](_0x4c64d1,{'networks':_0x4dfef8||[]});fs[_0xb865('0x61')](util[_0xb865('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x363cce['body'][_0xb865('0x3b')]['toLowerCase']()),_0x797645);return respondWithRpcPromise(_0xb865('0x5c'),_0xb865('0x35'),{'module':_0xb865('0x67')});}return null;})[_0xb865('0x28')](handleError(_0x5df794,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 6545a46..4e870eb 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 _0xc874=['../../config/logger','api','request-promise','path','rimraf','./network.attributes','exports','define','Network','network','lodash'];(function(_0x4bcca7,_0x45f5e3){var _0x1b6874=function(_0x177337){while(--_0x177337){_0x4bcca7['push'](_0x4bcca7['shift']());}};_0x1b6874(++_0x45f5e3);}(_0xc874,0x154));var _0x4c87=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xc874[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var logger=require(_0x4c87('0x1'))(_0x4c87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c87('0x3'));var fs=require('fs');var path=require(_0x4c87('0x4'));var rimraf=require(_0x4c87('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c87('0x6'));module[_0x4c87('0x7')]=function(_0x5d63ae,_0x46e0f5){return _0x5d63ae[_0x4c87('0x8')](_0x4c87('0x9'),attributes,{'tableName':_0x4c87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7bae=['rimraf','../../config/environment','./network.attributes','exports','define','Network','network','../../config/logger','api','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7bae,0x13b));var _0xe7ba=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x7bae[_0x618414];return _0x21c19a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7ba('0x0'))(_0xe7ba('0x1'));var moment=require('moment');var BPromise=require(_0xe7ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ba('0x3'));var rimraf=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var attributes=require(_0xe7ba('0x6'));module[_0xe7ba('0x7')]=function(_0xfd3a22,_0x2d31df){return _0xfd3a22[_0xe7ba('0x8')](_0xe7ba('0x9'),attributes,{'tableName':_0xe7ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 01e8d46..c8317c2 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 _0x5607=['request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s'];(function(_0x33dc14,_0x5f4a10){var _0x1f1ed8=function(_0x13fe30){while(--_0x13fe30){_0x33dc14['push'](_0x33dc14['shift']());}};_0x1f1ed8(++_0x5f4a10);}(_0x5607,0x167));var _0x7560=function(_0x5e0823,_0x1efeb7){_0x5e0823=_0x5e0823-0x0;var _0x3b98d5=_0x5607[_0x5e0823];return _0x3b98d5;};'use strict';var _=require('lodash');var util=require(_0x7560('0x0'));var moment=require(_0x7560('0x1'));var BPromise=require(_0x7560('0x2'));var rs=require(_0x7560('0x3'));var fs=require('fs');var Redis=require(_0x7560('0x4'));var db=require(_0x7560('0x5'))['db'];var utils=require(_0x7560('0x6'));var logger=require(_0x7560('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7560('0x8'));var client=jayson[_0x7560('0x9')][_0x7560('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecd9d,_0x30d4c0,_0x475d3b){return new BPromise(function(_0x3597ec,_0xb18aaf){return client[_0x7560('0xb')](_0x5ecd9d,_0x475d3b)[_0x7560('0xc')](function(_0x5da0fa){logger[_0x7560('0xd')](_0x7560('0xe'),_0x30d4c0,_0x7560('0xf'));logger['debug'](_0x7560('0x10'),_0x30d4c0,_0x7560('0xf'),JSON[_0x7560('0x11')](_0x5da0fa));if(_0x5da0fa[_0x7560('0x12')]){if(_0x5da0fa[_0x7560('0x12')]['code']===0x1f4){logger[_0x7560('0x12')](_0x7560('0xe'),_0x30d4c0,_0x5da0fa['error'][_0x7560('0x13')]);return _0xb18aaf(_0x5da0fa['error'][_0x7560('0x13')]);}logger[_0x7560('0x12')](_0x7560('0xe'),_0x30d4c0,_0x5da0fa['error'][_0x7560('0x13')]);return _0x3597ec(_0x5da0fa['error'][_0x7560('0x13')]);}else{logger[_0x7560('0xd')]('Network,\x20%s,\x20%s',_0x30d4c0,'request\x20sent');_0x3597ec(_0x5da0fa[_0x7560('0x14')][_0x7560('0x13')]);}})[_0x7560('0x15')](function(_0x1866e1){logger[_0x7560('0x12')](_0x7560('0xe'),_0x30d4c0,_0x1866e1);_0xb18aaf(_0x1866e1);});});} \ No newline at end of file +var _0x8184=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x4eedf0,_0x5a1c24){var _0x1a2a36=function(_0x4a146c){while(--_0x4a146c){_0x4eedf0['push'](_0x4eedf0['shift']());}};_0x1a2a36(++_0x5a1c24);}(_0x8184,0x120));var _0x4818=function(_0x4de752,_0x48e4dc){_0x4de752=_0x4de752-0x0;var _0x56792d=_0x8184[_0x4de752];return _0x56792d;};'use strict';var _=require(_0x4818('0x0'));var util=require(_0x4818('0x1'));var moment=require('moment');var BPromise=require(_0x4818('0x2'));var rs=require(_0x4818('0x3'));var fs=require('fs');var Redis=require(_0x4818('0x4'));var db=require(_0x4818('0x5'))['db'];var utils=require(_0x4818('0x6'));var logger=require(_0x4818('0x7'))(_0x4818('0x8'));var config=require(_0x4818('0x9'));var jayson=require(_0x4818('0xa'));var client=jayson[_0x4818('0xb')][_0x4818('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4314cb,_0x58c1b3,_0x2a8f66){return new BPromise(function(_0x1d383d,_0x12f00f){return client[_0x4818('0xd')](_0x4314cb,_0x2a8f66)[_0x4818('0xe')](function(_0x1b1d88){logger[_0x4818('0xf')](_0x4818('0x10'),_0x58c1b3,_0x4818('0x11'));logger['debug'](_0x4818('0x12'),_0x58c1b3,_0x4818('0x11'),JSON['stringify'](_0x1b1d88));if(_0x1b1d88[_0x4818('0x13')]){if(_0x1b1d88[_0x4818('0x13')][_0x4818('0x14')]===0x1f4){logger['error'](_0x4818('0x10'),_0x58c1b3,_0x1b1d88['error'][_0x4818('0x15')]);return _0x12f00f(_0x1b1d88[_0x4818('0x13')]['message']);}logger[_0x4818('0x13')]('Network,\x20%s,\x20%s',_0x58c1b3,_0x1b1d88['error'][_0x4818('0x15')]);return _0x1d383d(_0x1b1d88[_0x4818('0x13')][_0x4818('0x15')]);}else{logger['info'](_0x4818('0x10'),_0x58c1b3,_0x4818('0x11'));_0x1d383d(_0x1b1d88[_0x4818('0x16')][_0x4818('0x15')]);}})[_0x4818('0x17')](function(_0x1a1ea5){logger[_0x4818('0x13')](_0x4818('0x10'),_0x58c1b3,_0x1a1ea5);_0x12f00f(_0x1a1ea5);});});} \ No newline at end of file diff --git a/server/api/notification/index.js b/server/api/notification/index.js index b8ff489..801f499 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 _0x7d95=['express','Router','../../components/auth/service','./notification.controller','post','isAuthenticated','sendNotification','exports','multer','util','path'];(function(_0xff659d,_0x2283a1){var _0x19c170=function(_0x15358e){while(--_0x15358e){_0xff659d['push'](_0xff659d['shift']());}};_0x19c170(++_0x2283a1);}(_0x7d95,0x1ec));var _0x57d9=function(_0x4de2e3,_0x7c3e2a){_0x4de2e3=_0x4de2e3-0x0;var _0x5df1c7=_0x7d95[_0x4de2e3];return _0x5df1c7;};'use strict';var multer=require(_0x57d9('0x0'));var util=require(_0x57d9('0x1'));var path=require(_0x57d9('0x2'));var timeout=require('connect-timeout');var express=require(_0x57d9('0x3'));var router=express[_0x57d9('0x4')]();var auth=require(_0x57d9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x57d9('0x6'));router[_0x57d9('0x7')]('/',auth[_0x57d9('0x8')](),controller[_0x57d9('0x9')]);module[_0x57d9('0xa')]=router; \ No newline at end of file +var _0x98fe=['../../config/environment','./notification.controller','post','isAuthenticated','sendNotification','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x98fe,0x1c2));var _0xe98f=function(_0x32cebd,_0x51e3d1){_0x32cebd=_0x32cebd-0x0;var _0x2129c8=_0x98fe[_0x32cebd];return _0x2129c8;};'use strict';var multer=require(_0xe98f('0x0'));var util=require(_0xe98f('0x1'));var path=require(_0xe98f('0x2'));var timeout=require('connect-timeout');var express=require(_0xe98f('0x3'));var router=express['Router']();var auth=require(_0xe98f('0x4'));var interaction=require(_0xe98f('0x5'));var config=require(_0xe98f('0x6'));var controller=require(_0xe98f('0x7'));router[_0xe98f('0x8')]('/',auth[_0xe98f('0x9')](),controller[_0xe98f('0xa')]);module[_0xe98f('0xb')]=router; \ No newline at end of file diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js index aabb870..362696f 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 _0x3164=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x2d93ce,_0x1a23e1){var _0x10322d=function(_0x1f0538){while(--_0x1f0538){_0x2d93ce['push'](_0x2d93ce['shift']());}};_0x10322d(++_0x1a23e1);}(_0x3164,0x191));var _0x4316=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0x3164[_0x590851];return _0x3b0115;};'use strict';var Sequelize=require(_0x4316('0x0'));module[_0x4316('0x1')]={'body':{'type':Sequelize[_0x4316('0x2')]},'senderName':{'type':Sequelize[_0x4316('0x3')]},'recipientsId':{'type':Sequelize[_0x4316('0x2')]},'recipientsDescription':{'type':Sequelize[_0x4316('0x3')]},'beep':{'type':Sequelize[_0x4316('0x4')]}}; \ No newline at end of file +var _0x1a92=['STRING','TEXT','BOOLEAN','sequelize','exports'];(function(_0x244d37,_0x12c4e2){var _0x2ec7f1=function(_0x2844a5){while(--_0x2844a5){_0x244d37['push'](_0x244d37['shift']());}};_0x2ec7f1(++_0x12c4e2);}(_0x1a92,0x134));var _0x21a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a92[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x21a9('0x0'));module[_0x21a9('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x21a9('0x2')]},'recipientsId':{'type':Sequelize[_0x21a9('0x3')]},'recipientsDescription':{'type':Sequelize[_0x21a9('0x2')]},'beep':{'type':Sequelize[_0x21a9('0x4')]}}; \ No newline at end of file diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js index 95f4c99..ae74e31 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 _0x73ea=['startCase','model','union','queue','replace','ids','push','all','flatten','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','localhost','./notification.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error','stack','name','sendNotification','hasOwnProperty','body','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Missing\x20\x27view\x27\x20parameter','parse','Sequelize','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','transaction','Notification','create','forEach','recipient','emit','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','view'];(function(_0x148f44,_0x2b8cd6){var _0x2ee5f3=function(_0x3addc9){while(--_0x3addc9){_0x148f44['push'](_0x148f44['shift']());}};_0x2ee5f3(++_0x2b8cd6);}(_0x73ea,0x6d));var _0xa73e=function(_0x13ded8,_0x116e1f){_0x13ded8=_0x13ded8-0x0;var _0x5af7de=_0x73ea[_0x13ded8];return _0x5af7de;};'use strict';var pdf=require(_0xa73e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa73e('0x1'));var zipdir=require(_0xa73e('0x2'));var jsonpatch=require(_0xa73e('0x3'));var rp=require('request-promise');var moment=require(_0xa73e('0x4'));var BPromise=require(_0xa73e('0x5'));var Mustache=require(_0xa73e('0x6'));var util=require(_0xa73e('0x7'));var path=require(_0xa73e('0x8'));var sox=require(_0xa73e('0x9'));var csv=require('to-csv');var ejs=require(_0xa73e('0xa'));var fs=require('fs');var _=require(_0xa73e('0xb'));var squel=require(_0xa73e('0xc'));var crypto=require(_0xa73e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa73e('0xe'));var toCsv=require(_0xa73e('0xf'));var querystring=require(_0xa73e('0x10'));var Papa=require(_0xa73e('0x11'));var Redis=require(_0xa73e('0x12'));var authService=require(_0xa73e('0x13'));var qs=require(_0xa73e('0x14'));var as=require(_0xa73e('0x15'));var hardwareService=require(_0xa73e('0x16'));var logger=require(_0xa73e('0x17'))(_0xa73e('0x18'));var utils=require(_0xa73e('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa73e('0x1a')]=_['defaults'](config[_0xa73e('0x1a')],{'host':_0xa73e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa73e('0x1a')]));require(_0xa73e('0x1c'))[_0xa73e('0x1d')](socket);function respondWithStatusCode(_0x4c1bad,_0x5aec23){_0x5aec23=_0x5aec23||0xcc;return function(_0xd739fe){if(_0xd739fe){return _0x4c1bad[_0xa73e('0x1e')](_0x5aec23);}return _0x4c1bad['status'](_0x5aec23)[_0xa73e('0x1f')]();};}function respondWithResult(_0xab5f87,_0x4ee2dd){_0x4ee2dd=_0x4ee2dd||0xc8;return function(_0x55e8f6){if(_0x55e8f6){return _0xab5f87[_0xa73e('0x20')](_0x4ee2dd)['json'](_0x55e8f6);}};}function respondWithFilteredResult(_0x40d3ff,_0x5ae783){return function(_0x2a6c67){if(_0x2a6c67){var _0x1211a8=_0x2a6c67[_0xa73e('0x21')],_0x235def=_0x5ae783[_0xa73e('0x22')],_0x45d23a=_0x5ae783[_0xa73e('0x22')]+_0x5ae783[_0xa73e('0x23')],_0x164ea3;if(_0x45d23a>=_0x1211a8){_0x45d23a=_0x1211a8;_0x164ea3=0xc8;}else{_0x164ea3=0xce;}_0x40d3ff[_0xa73e('0x20')](_0x164ea3);return _0x40d3ff[_0xa73e('0x24')]('Content-Range',_0x235def+'-'+_0x45d23a+'/'+_0x1211a8)[_0xa73e('0x25')](_0x2a6c67);}return null;};}function patchUpdates(_0x1e1eb5){return function(_0x48de5e){try{jsonpatch[_0xa73e('0x26')](_0x48de5e,_0x1e1eb5,!![]);}catch(_0x3358c5){return BPromise[_0xa73e('0x27')](_0x3358c5);}return _0x48de5e[_0xa73e('0x28')]();};}function saveUpdates(_0x3bcb34,_0xe21818){return function(_0x4bb377){if(_0x4bb377){return _0x4bb377[_0xa73e('0x29')](_0x3bcb34)['then'](function(_0x1040e2){return _0x1040e2;});}return null;};}function removeEntity(_0xa4533e,_0x245e8f){return function(_0x1e722b){if(_0x1e722b){return _0x1e722b[_0xa73e('0x2a')]()[_0xa73e('0x2b')](function(){_0xa4533e[_0xa73e('0x20')](0xcc)[_0xa73e('0x1f')]();});}};}function handleEntityNotFound(_0x2a3cc3,_0x1334b9){return function(_0x5e3f1e){if(!_0x5e3f1e){_0x2a3cc3['sendStatus'](0x194);}return _0x5e3f1e;};}function handleError(_0x488b38,_0x5bba72){_0x5bba72=_0x5bba72||0x1f4;return function(_0x11683c){logger[_0xa73e('0x2c')](_0x11683c[_0xa73e('0x2d')]);if(_0x11683c['name']){delete _0x11683c[_0xa73e('0x2e')];}_0x488b38[_0xa73e('0x20')](_0x5bba72)['send'](_0x11683c);};}exports[_0xa73e('0x2f')]=function(_0x45445a,_0xf553a2,_0x593b7c){if(!_0x45445a['body'][_0xa73e('0x30')]('text')&&!_0x45445a[_0xa73e('0x31')][_0xa73e('0x30')](_0xa73e('0x32'))){throw new db['Sequelize'][(_0xa73e('0x33'))](_0xa73e('0x34'));}else{if(_0x45445a['body'][_0xa73e('0x30')](_0xa73e('0x32'))&&!_0x45445a[_0xa73e('0x31')][_0xa73e('0x30')]('view')){throw new db['Sequelize'][(_0xa73e('0x33'))](_0xa73e('0x35'));}if(!_0x45445a['body']['hasOwnProperty']('recipients')){throw new db['Sequelize'][(_0xa73e('0x33'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x294c45=JSON[_0xa73e('0x36')](_0x45445a[_0xa73e('0x31')]['recipients']);}catch(_0x34499b){logger[_0xa73e('0x2c')](_0x34499b);throw new db[(_0xa73e('0x37'))]['ValidationError'](_0xa73e('0x38'));}var _0x2a4baa=[_0xa73e('0x39'),_0xa73e('0x3a'),_0xa73e('0x3b'),_0xa73e('0x3c'),_0xa73e('0x3d'),_0xa73e('0x3e'),'whatsappqueue',_0xa73e('0x3f'),_0xa73e('0x40')];if(_[_0xa73e('0x41')](_0x294c45,function(_0x2e2beb){return!_[_0xa73e('0x42')](_0x2a4baa,_0x2e2beb['model'][_0xa73e('0x43')]());})){throw new db[(_0xa73e('0x37'))][(_0xa73e('0x33'))](_0xa73e('0x44'));}}}var _0x1b6e88={};_0x1b6e88[_0xa73e('0x45')]=_0x45445a[_0xa73e('0x31')][_0xa73e('0x30')](_0xa73e('0x45'))?_0x45445a[_0xa73e('0x31')][_0xa73e('0x45')]:_0x45445a['user'][_0xa73e('0x46')];_0x1b6e88[_0xa73e('0x47')]=_[_0xa73e('0x48')](_0x45445a[_0xa73e('0x31')]['recipientsDescription'])?null:_0x45445a['body'][_0xa73e('0x47')];_0x1b6e88[_0xa73e('0x49')]=_0x45445a[_0xa73e('0x31')]['beep']||![];_0x1b6e88[_0xa73e('0x4a')]=_0x45445a['user']['id'];return getContent(_0x45445a[_0xa73e('0x31')])[_0xa73e('0x2b')](function(_0x41c09b){_0x1b6e88[_0xa73e('0x31')]=_0x41c09b;return getRecipients(_0x294c45);})[_0xa73e('0x2b')](function(_0x3b3d57){_0x1b6e88[_0xa73e('0x4b')]=_['sortBy'](_0x3b3d57)[_0xa73e('0x4c')](',');return db['sequelize'][_0xa73e('0x4d')](function(_0x8977a8){return db[_0xa73e('0x4e')][_0xa73e('0x4f')](_0x1b6e88,{'raw':!![],'transaction':_0x8977a8})[_0xa73e('0x2b')](function(_0x4d6bb7){var _0x3357a3={'sender':_0x1b6e88[_0xa73e('0x45')],'description':_0x1b6e88[_0xa73e('0x47')],'content':_0x1b6e88[_0xa73e('0x31')],'beep':_0x1b6e88[_0xa73e('0x49')]};_0x3b3d57[_0xa73e('0x50')](function(_0x4ad8a0){_0x3357a3[_0xa73e('0x51')]=_0x4ad8a0;socket[_0xa73e('0x52')]('notification:send',_0x3357a3);});return _0x4d6bb7;});});})[_0xa73e('0x2b')](respondWithResult(_0xf553a2,0xc9))[_0xa73e('0x53')](handleError(_0xf553a2,null));};function getContent(_0x3cd4dd){return new BPromise(function(_0x1ba6fe,_0x4277cd){if(_0x3cd4dd[_0xa73e('0x54')]){_0x1ba6fe(_0x3cd4dd[_0xa73e('0x54')]);return;}return db[_0xa73e('0x55')][_0xa73e('0x56')]({'attributes':[_0xa73e('0x57')],'where':{'id':_0x3cd4dd[_0xa73e('0x32')]},'raw':!![]})[_0xa73e('0x2b')](function(_0x387e2f){if(!_0x387e2f)throw new db[(_0xa73e('0x37'))][(_0xa73e('0x33'))](_0xa73e('0x58'));var _0x1e7c42=Mustache[_0xa73e('0x59')](_0x387e2f['html'],_0x3cd4dd[_0xa73e('0x5a')]);_0x1ba6fe(_0x1e7c42);})['catch'](function(_0x175df4){_0x4277cd(_0x175df4);});});}function getRecipients(_0x4109a6){return new BPromise(function(_0x18e3ef,_0x32e5e4){var _0x4db0eb=[];var _0x30f89e=[];_0x4109a6[_0xa73e('0x50')](function(_0x1b79eb){var _0x5d87b6=_[_0xa73e('0x5b')](_0x1b79eb[_0xa73e('0x5c')][_0xa73e('0x43')]());if(_0x5d87b6==='User'){_0x4db0eb=_[_0xa73e('0x5d')](_0x4db0eb,_0x1b79eb['ids']);}else{if(_[_0xa73e('0x42')](_0x5d87b6,_0xa73e('0x5e')))_0x5d87b6=_0x5d87b6[_0xa73e('0x5f')]('queue','Queue');_0x1b79eb[_0xa73e('0x60')][_0xa73e('0x50')](function(_0x1053bc){_0x30f89e[_0xa73e('0x61')](getAgents(_0x5d87b6,_0x1053bc));});}});return BPromise[_0xa73e('0x62')](_0x30f89e)[_0xa73e('0x2b')](function(_0x1ed479){_0x4db0eb=_[_0xa73e('0x5d')](_0x4db0eb,_[_0xa73e('0x63')](_0x1ed479));_0x18e3ef(_0x4db0eb);})[_0xa73e('0x53')](function(_0x3a8126){_0x32e5e4(_0x3a8126);});});}function getAgents(_0x185398,_0x39d6f1){return new BPromise(function(_0x276ad9,_0x503700){return db[_0x185398][_0xa73e('0x56')]({'where':{'id':_0x39d6f1}})[_0xa73e('0x2b')](function(_0x574ae8){return _0x574ae8['getAgents']({'attributes':['id'],'raw':!![]})[_0xa73e('0x2b')](function(_0x48c765){var _0x51e456=_['map'](_0x48c765,'id');_0x276ad9(_0x51e456);});})[_0xa73e('0x53')](function(_0x4db219){_0x503700(_0x4db219);});});} \ No newline at end of file +var _0x8208=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','sendNotification','body','hasOwnProperty','text','TemplateId','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','isEmpty','recipientsDescription','beep','recipientsId','sortBy','join','sequelize','transaction','Notification','create','emit','notification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','view','startCase','toLowerCase','User','union','ids','queue','Queue','push','getAgents','map','html-pdf'];(function(_0x43435a,_0xb9f285){var _0x470bcd=function(_0x2bfc02){while(--_0x2bfc02){_0x43435a['push'](_0x43435a['shift']());}};_0x470bcd(++_0xb9f285);}(_0x8208,0x13a));var _0x8820=function(_0x2bdcc7,_0x1b35e6){_0x2bdcc7=_0x2bdcc7-0x0;var _0x47064b=_0x8208[_0x2bdcc7];return _0x47064b;};'use strict';var pdf=require(_0x8820('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8820('0x1'));var zipdir=require(_0x8820('0x2'));var jsonpatch=require(_0x8820('0x3'));var rp=require('request-promise');var moment=require(_0x8820('0x4'));var BPromise=require(_0x8820('0x5'));var Mustache=require(_0x8820('0x6'));var util=require(_0x8820('0x7'));var path=require(_0x8820('0x8'));var sox=require('sox');var csv=require(_0x8820('0x9'));var ejs=require(_0x8820('0xa'));var fs=require('fs');var _=require(_0x8820('0xb'));var squel=require(_0x8820('0xc'));var crypto=require(_0x8820('0xd'));var jsforce=require(_0x8820('0xe'));var deskjs=require(_0x8820('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8820('0x10'));var Papa=require(_0x8820('0x11'));var Redis=require(_0x8820('0x12'));var authService=require(_0x8820('0x13'));var qs=require(_0x8820('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8820('0x15'));var logger=require(_0x8820('0x16'))(_0x8820('0x17'));var utils=require(_0x8820('0x18'));var config=require(_0x8820('0x19'));var db=require('../../mysqldb')['db'];config[_0x8820('0x1a')]=_['defaults'](config[_0x8820('0x1a')],{'host':_0x8820('0x1b'),'port':0x18eb});var socket=require(_0x8820('0x1c'))(new Redis(config[_0x8820('0x1a')]));require('./notification.socket')[_0x8820('0x1d')](socket);function respondWithStatusCode(_0x5ead49,_0x5910bd){_0x5910bd=_0x5910bd||0xcc;return function(_0x2a632f){if(_0x2a632f){return _0x5ead49[_0x8820('0x1e')](_0x5910bd);}return _0x5ead49['status'](_0x5910bd)[_0x8820('0x1f')]();};}function respondWithResult(_0x5d542f,_0x1266fb){_0x1266fb=_0x1266fb||0xc8;return function(_0x2a3b17){if(_0x2a3b17){return _0x5d542f[_0x8820('0x20')](_0x1266fb)[_0x8820('0x21')](_0x2a3b17);}};}function respondWithFilteredResult(_0x1c4af5,_0x6ece40){return function(_0x5c432b){if(_0x5c432b){var _0x181ced=_0x5c432b['count'],_0x1bdaeb=_0x6ece40[_0x8820('0x22')],_0x5a32b7=_0x6ece40[_0x8820('0x22')]+_0x6ece40[_0x8820('0x23')],_0x713028;if(_0x5a32b7>=_0x181ced){_0x5a32b7=_0x181ced;_0x713028=0xc8;}else{_0x713028=0xce;}_0x1c4af5[_0x8820('0x20')](_0x713028);return _0x1c4af5[_0x8820('0x24')](_0x8820('0x25'),_0x1bdaeb+'-'+_0x5a32b7+'/'+_0x181ced)[_0x8820('0x21')](_0x5c432b);}return null;};}function patchUpdates(_0x3a5da3){return function(_0x3c2329){try{jsonpatch[_0x8820('0x26')](_0x3c2329,_0x3a5da3,!![]);}catch(_0x571a83){return BPromise[_0x8820('0x27')](_0x571a83);}return _0x3c2329[_0x8820('0x28')]();};}function saveUpdates(_0x413662,_0x7e1a34){return function(_0x50c332){if(_0x50c332){return _0x50c332[_0x8820('0x29')](_0x413662)[_0x8820('0x2a')](function(_0x21ae44){return _0x21ae44;});}return null;};}function removeEntity(_0x406401,_0x2fab15){return function(_0x11fefb){if(_0x11fefb){return _0x11fefb[_0x8820('0x2b')]()[_0x8820('0x2a')](function(){_0x406401[_0x8820('0x20')](0xcc)[_0x8820('0x1f')]();});}};}function handleEntityNotFound(_0x5829ea,_0x2d45b6){return function(_0x3a06bd){if(!_0x3a06bd){_0x5829ea[_0x8820('0x1e')](0x194);}return _0x3a06bd;};}function handleError(_0x29db9d,_0x4ec65c){_0x4ec65c=_0x4ec65c||0x1f4;return function(_0x576cc0){logger[_0x8820('0x2c')](_0x576cc0[_0x8820('0x2d')]);if(_0x576cc0[_0x8820('0x2e')]){delete _0x576cc0[_0x8820('0x2e')];}_0x29db9d[_0x8820('0x20')](_0x4ec65c)[_0x8820('0x2f')](_0x576cc0);};}exports[_0x8820('0x30')]=function(_0x23c1e8,_0x3d889d,_0x460fbf){if(!_0x23c1e8[_0x8820('0x31')][_0x8820('0x32')](_0x8820('0x33'))&&!_0x23c1e8[_0x8820('0x31')][_0x8820('0x32')](_0x8820('0x34'))){throw new db['Sequelize']['ValidationError'](_0x8820('0x35'));}else{if(_0x23c1e8[_0x8820('0x31')][_0x8820('0x32')](_0x8820('0x34'))&&!_0x23c1e8['body'][_0x8820('0x32')]('view')){throw new db[(_0x8820('0x36'))][(_0x8820('0x37'))](_0x8820('0x38'));}if(!_0x23c1e8['body'][_0x8820('0x32')](_0x8820('0x39'))){throw new db['Sequelize']['ValidationError'](_0x8820('0x3a'));}else{try{var _0x2ebcf7=JSON[_0x8820('0x3b')](_0x23c1e8[_0x8820('0x31')][_0x8820('0x39')]);}catch(_0x3daa30){logger[_0x8820('0x2c')](_0x3daa30);throw new db[(_0x8820('0x36'))][(_0x8820('0x37'))](_0x8820('0x3c'));}var _0x2e01a7=[_0x8820('0x3d'),_0x8820('0x3e'),_0x8820('0x3f'),_0x8820('0x40'),_0x8820('0x41'),_0x8820('0x42'),_0x8820('0x43'),_0x8820('0x44'),_0x8820('0x45')];if(_[_0x8820('0x46')](_0x2ebcf7,function(_0x2a2258){return!_[_0x8820('0x47')](_0x2e01a7,_0x2a2258[_0x8820('0x48')]['toLowerCase']());})){throw new db[(_0x8820('0x36'))][(_0x8820('0x37'))](_0x8820('0x49'));}}}var _0x19a372={};_0x19a372[_0x8820('0x4a')]=_0x23c1e8[_0x8820('0x31')][_0x8820('0x32')]('senderName')?_0x23c1e8[_0x8820('0x31')][_0x8820('0x4a')]:_0x23c1e8[_0x8820('0x45')][_0x8820('0x4b')];_0x19a372['recipientsDescription']=_[_0x8820('0x4c')](_0x23c1e8[_0x8820('0x31')][_0x8820('0x4d')])?null:_0x23c1e8[_0x8820('0x31')][_0x8820('0x4d')];_0x19a372[_0x8820('0x4e')]=_0x23c1e8['body'][_0x8820('0x4e')]||![];_0x19a372['SenderId']=_0x23c1e8['user']['id'];return getContent(_0x23c1e8[_0x8820('0x31')])[_0x8820('0x2a')](function(_0x51b978){_0x19a372['body']=_0x51b978;return getRecipients(_0x2ebcf7);})['then'](function(_0x77a78){_0x19a372[_0x8820('0x4f')]=_[_0x8820('0x50')](_0x77a78)[_0x8820('0x51')](',');return db[_0x8820('0x52')][_0x8820('0x53')](function(_0x1413c3){return db[_0x8820('0x54')][_0x8820('0x55')](_0x19a372,{'raw':!![],'transaction':_0x1413c3})['then'](function(_0x26e89b){var _0x437b4c={'sender':_0x19a372[_0x8820('0x4a')],'description':_0x19a372['recipientsDescription'],'content':_0x19a372[_0x8820('0x31')],'beep':_0x19a372[_0x8820('0x4e')]};_0x77a78['forEach'](function(_0x2fa7ae){_0x437b4c['recipient']=_0x2fa7ae;socket[_0x8820('0x56')](_0x8820('0x57'),_0x437b4c);});return _0x26e89b;});});})['then'](respondWithResult(_0x3d889d,0xc9))[_0x8820('0x58')](handleError(_0x3d889d,null));};function getContent(_0x33b464){return new BPromise(function(_0x77d065,_0x58054d){if(_0x33b464['text']){_0x77d065(_0x33b464['text']);return;}return db[_0x8820('0x59')][_0x8820('0x5a')]({'attributes':['html'],'where':{'id':_0x33b464[_0x8820('0x34')]},'raw':!![]})[_0x8820('0x2a')](function(_0x567563){if(!_0x567563)throw new db[(_0x8820('0x36'))][(_0x8820('0x37'))](_0x8820('0x5b'));var _0x4b8a8e=Mustache[_0x8820('0x5c')](_0x567563[_0x8820('0x5d')],_0x33b464[_0x8820('0x5e')]);_0x77d065(_0x4b8a8e);})[_0x8820('0x58')](function(_0x12256e){_0x58054d(_0x12256e);});});}function getRecipients(_0x13003d){return new BPromise(function(_0x4ce55b,_0x59fc79){var _0x3efdcb=[];var _0x1ff6d2=[];_0x13003d['forEach'](function(_0x2495f1){var _0x5b3ccd=_[_0x8820('0x5f')](_0x2495f1[_0x8820('0x48')][_0x8820('0x60')]());if(_0x5b3ccd===_0x8820('0x61')){_0x3efdcb=_[_0x8820('0x62')](_0x3efdcb,_0x2495f1[_0x8820('0x63')]);}else{if(_[_0x8820('0x47')](_0x5b3ccd,_0x8820('0x64')))_0x5b3ccd=_0x5b3ccd['replace'](_0x8820('0x64'),_0x8820('0x65'));_0x2495f1[_0x8820('0x63')]['forEach'](function(_0x3e967c){_0x1ff6d2[_0x8820('0x66')](getAgents(_0x5b3ccd,_0x3e967c));});}});return BPromise['all'](_0x1ff6d2)[_0x8820('0x2a')](function(_0x34c852){_0x3efdcb=_['union'](_0x3efdcb,_['flatten'](_0x34c852));_0x4ce55b(_0x3efdcb);})[_0x8820('0x58')](function(_0x293d8b){_0x59fc79(_0x293d8b);});});}function getAgents(_0x30939c,_0x1aa532){return new BPromise(function(_0x3b8e8d,_0x4814c4){return db[_0x30939c][_0x8820('0x5a')]({'where':{'id':_0x1aa532}})[_0x8820('0x2a')](function(_0x7f1068){return _0x7f1068[_0x8820('0x67')]({'attributes':['id'],'raw':!![]})[_0x8820('0x2a')](function(_0x39ffcb){var _0x1d6f44=_[_0x8820('0x68')](_0x39ffcb,'id');_0x3b8e8d(_0x1d6f44);});})[_0x8820('0x58')](function(_0x1a2e1e){_0x4814c4(_0x1a2e1e);});});} \ No newline at end of file diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js index b9e1e57..9504dd6 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 _0x2032=['exports','../../mysqldb','Notification','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2032,0xd9));var _0x2203=function(_0x349886,_0x155249){_0x349886=_0x349886-0x0;var _0x44cd8d=_0x2032[_0x349886];return _0x44cd8d;};'use strict';var EventEmitter=require('events');var Notification=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){NotificationEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);NotificationEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];Notification[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=NotificationEvents; \ No newline at end of file +var _0x0b0e=['Notification','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x4264c1,_0x5d9dc0){var _0x52d805=function(_0x327b83){while(--_0x327b83){_0x4264c1['push'](_0x4264c1['shift']());}};_0x52d805(++_0x5d9dc0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3c414c,_0x399dbb){_0x3c414c=_0x3c414c-0x0;var _0x4f3062=_0x0b0e[_0x3c414c];return _0x4f3062;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var Notification=require('../../mysqldb')['db'][_0xe0b0('0x1')];var NotificationEvents=new EventEmitter();NotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){NotificationEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);NotificationEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];Notification[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=NotificationEvents; \ No newline at end of file diff --git a/server/api/notification/notification.model.js b/server/api/notification/notification.model.js index a66ed87..0f4f1d4 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 _0x6cb4=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./notification.attributes','define','Notification','notifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6cb4,0xff));var _0x46cb=function(_0x2adeec,_0x2847cd){_0x2adeec=_0x2adeec-0x0;var _0x1dff93=_0x6cb4[_0x2adeec];return _0x1dff93;};'use strict';var _=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var logger=require(_0x46cb('0x2'))(_0x46cb('0x3'));var moment=require(_0x46cb('0x4'));var BPromise=require(_0x46cb('0x5'));var rp=require(_0x46cb('0x6'));var fs=require('fs');var path=require(_0x46cb('0x7'));var rimraf=require(_0x46cb('0x8'));var config=require('../../config/environment');var attributes=require(_0x46cb('0x9'));module['exports']=function(_0x3d9d3c,_0x4d9f1d){return _0x3d9d3c[_0x46cb('0xa')](_0x46cb('0xb'),attributes,{'tableName':_0x46cb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x46cb('0xd'),'collate':_0x46cb('0xe')});}; \ No newline at end of file +var _0x1775=['request-promise','path','rimraf','../../config/environment','./notification.attributes','exports','define','Notification','notifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1775,0x1db));var _0x5177=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1775[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var logger=require(_0x5177('0x1'))(_0x5177('0x2'));var moment=require(_0x5177('0x3'));var BPromise=require(_0x5177('0x4'));var rp=require(_0x5177('0x5'));var fs=require('fs');var path=require(_0x5177('0x6'));var rimraf=require(_0x5177('0x7'));var config=require(_0x5177('0x8'));var attributes=require(_0x5177('0x9'));module[_0x5177('0xa')]=function(_0x2c5c42,_0x153c1a){return _0x2c5c42[_0x5177('0xb')](_0x5177('0xc'),attributes,{'tableName':_0x5177('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5177('0xe'),'collate':_0x5177('0xf')});}; \ No newline at end of file diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js index 8e2f34b..344be13 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 _0x67c0=['message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./notification.socket','request','info','Notification,\x20%s,\x20%s','request\x20sent','debug','Notification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x67c0,0xab));var _0x067c=function(_0x125703,_0x12dd6e){_0x125703=_0x125703-0x0;var _0x43cb71=_0x67c0[_0x125703];return _0x43cb71;};'use strict';var _=require(_0x067c('0x0'));var util=require(_0x067c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x067c('0x2'));var db=require(_0x067c('0x3'))['db'];var utils=require(_0x067c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x067c('0x5'));var jayson=require(_0x067c('0x6'));var client=jayson[_0x067c('0x7')][_0x067c('0x8')]({'port':0x232a});config[_0x067c('0x9')]=_[_0x067c('0xa')](config[_0x067c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x067c('0xb'))['register'](socket);function respondWithRpcPromise(_0x2d716e,_0x40f2b3,_0x390480){return new BPromise(function(_0x1adc50,_0x5d5d94){return client[_0x067c('0xc')](_0x2d716e,_0x390480)['then'](function(_0x27f083){logger[_0x067c('0xd')](_0x067c('0xe'),_0x40f2b3,_0x067c('0xf'));logger[_0x067c('0x10')](_0x067c('0x11'),_0x40f2b3,_0x067c('0xf'),JSON[_0x067c('0x12')](_0x27f083));if(_0x27f083[_0x067c('0x13')]){if(_0x27f083[_0x067c('0x13')][_0x067c('0x14')]===0x1f4){logger[_0x067c('0x13')]('Notification,\x20%s,\x20%s',_0x40f2b3,_0x27f083[_0x067c('0x13')][_0x067c('0x15')]);return _0x5d5d94(_0x27f083['error']['message']);}logger[_0x067c('0x13')](_0x067c('0xe'),_0x40f2b3,_0x27f083['error']['message']);return _0x1adc50(_0x27f083[_0x067c('0x13')][_0x067c('0x15')]);}else{logger[_0x067c('0xd')](_0x067c('0xe'),_0x40f2b3,'request\x20sent');_0x1adc50(_0x27f083[_0x067c('0x16')]['message']);}})[_0x067c('0x17')](function(_0x5b6aea){logger[_0x067c('0x13')](_0x067c('0xe'),_0x40f2b3,_0x5b6aea);_0x5d5d94(_0x5b6aea);});});} \ No newline at end of file +var _0x9468=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','register','request','then','Notification,\x20%s,\x20%s','request\x20sent','debug','Notification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0x9468,0x12c));var _0x8946=function(_0x4715d2,_0x3371b2){_0x4715d2=_0x4715d2-0x0;var _0x141811=_0x9468[_0x4715d2];return _0x141811;};'use strict';var _=require(_0x8946('0x0'));var util=require(_0x8946('0x1'));var moment=require(_0x8946('0x2'));var BPromise=require('bluebird');var rs=require(_0x8946('0x3'));var fs=require('fs');var Redis=require(_0x8946('0x4'));var db=require(_0x8946('0x5'))['db'];var utils=require(_0x8946('0x6'));var logger=require(_0x8946('0x7'))(_0x8946('0x8'));var config=require('../../config/environment');var jayson=require(_0x8946('0x9'));var client=jayson[_0x8946('0xa')][_0x8946('0xb')]({'port':0x232a});config['redis']=_[_0x8946('0xc')](config['redis'],{'host':_0x8946('0xd'),'port':0x18eb});var socket=require(_0x8946('0xe'))(new Redis(config[_0x8946('0xf')]));require('./notification.socket')[_0x8946('0x10')](socket);function respondWithRpcPromise(_0x3a2336,_0x2ab8c4,_0x385b27){return new BPromise(function(_0x877918,_0x41cba4){return client[_0x8946('0x11')](_0x3a2336,_0x385b27)[_0x8946('0x12')](function(_0x3189bc){logger['info'](_0x8946('0x13'),_0x2ab8c4,_0x8946('0x14'));logger[_0x8946('0x15')](_0x8946('0x16'),_0x2ab8c4,'request\x20sent',JSON[_0x8946('0x17')](_0x3189bc));if(_0x3189bc['error']){if(_0x3189bc[_0x8946('0x18')][_0x8946('0x19')]===0x1f4){logger[_0x8946('0x18')]('Notification,\x20%s,\x20%s',_0x2ab8c4,_0x3189bc[_0x8946('0x18')][_0x8946('0x1a')]);return _0x41cba4(_0x3189bc['error']['message']);}logger[_0x8946('0x18')](_0x8946('0x13'),_0x2ab8c4,_0x3189bc['error'][_0x8946('0x1a')]);return _0x877918(_0x3189bc[_0x8946('0x18')][_0x8946('0x1a')]);}else{logger[_0x8946('0x1b')]('Notification,\x20%s,\x20%s',_0x2ab8c4,'request\x20sent');_0x877918(_0x3189bc[_0x8946('0x1c')][_0x8946('0x1a')]);}})[_0x8946('0x1d')](function(_0x927c6b){logger[_0x8946('0x18')](_0x8946('0x13'),_0x2ab8c4,_0x927c6b);_0x41cba4(_0x927c6b);});});} \ No newline at end of file diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js index 4823fde..185ecad 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 _0xd211=['length','./notification.events','save','emit','removeListener','register'];(function(_0x27d340,_0x545abe){var _0x251dbf=function(_0x527775){while(--_0x527775){_0x27d340['push'](_0x27d340['shift']());}};_0x251dbf(++_0x545abe);}(_0xd211,0xeb));var _0x1d21=function(_0x4bd70f,_0x45cd34){_0x4bd70f=_0x4bd70f-0x0;var _0x12f8d2=_0xd211[_0x4bd70f];return _0x12f8d2;};'use strict';var NotificationEvents=require(_0x1d21('0x0'));var events=[_0x1d21('0x1'),'remove','update'];function createListener(_0x3b6a06,_0x48f510){return function(_0x4ef928){_0x48f510[_0x1d21('0x2')](_0x3b6a06,_0x4ef928);};}function removeListener(_0x599975,_0x4d10f9){return function(){NotificationEvents[_0x1d21('0x3')](_0x599975,_0x4d10f9);};}exports[_0x1d21('0x4')]=function(_0x23e14a){for(var _0x3e32b3=0x0,_0x211727=events[_0x1d21('0x5')];_0x3e32b3<_0x211727;_0x3e32b3++){var _0x3b3180=events[_0x3e32b3];var _0x389a4d=createListener('notification:'+_0x3b3180,_0x23e14a);NotificationEvents['on'](_0x3b3180,_0x389a4d);}}; \ No newline at end of file +var _0x68a8=['save','remove','emit','register','length','notification:','./notification.events'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0x68a8,0x19c));var _0x868a=function(_0x16e995,_0x548715){_0x16e995=_0x16e995-0x0;var _0x19e63f=_0x68a8[_0x16e995];return _0x19e63f;};'use strict';var NotificationEvents=require(_0x868a('0x0'));var events=[_0x868a('0x1'),_0x868a('0x2'),'update'];function createListener(_0x2b5e72,_0x1f6063){return function(_0xbf5a18){_0x1f6063[_0x868a('0x3')](_0x2b5e72,_0xbf5a18);};}function removeListener(_0x14d137,_0x1323b9){return function(){NotificationEvents['removeListener'](_0x14d137,_0x1323b9);};}exports[_0x868a('0x4')]=function(_0x3495c6){for(var _0x4cf9d5=0x0,_0x28182d=events[_0x868a('0x5')];_0x4cf9d5<_0x28182d;_0x4cf9d5++){var _0x564953=events[_0x4cf9d5];var _0x29c82b=createListener(_0x868a('0x6')+_0x564953,_0x3495c6);NotificationEvents['on'](_0x564953,_0x29c82b);}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index b01f29d..b3a97e8 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 _0x3177=['isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','/:id/dispositions','addAnswer','post','/:id/notify','notify','addApplications','addAgents','/:id/send','send','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','index','/describe'];(function(_0x206a69,_0x4267f8){var _0x372f0f=function(_0x1745aa){while(--_0x1745aa){_0x206a69['push'](_0x206a69['shift']());}};_0x372f0f(++_0x4267f8);}(_0x3177,0x10c));var _0x7317=function(_0xfa3cbc,_0xdf523d){_0xfa3cbc=_0xfa3cbc-0x0;var _0x445000=_0x3177[_0xfa3cbc];return _0x445000;};'use strict';var multer=require(_0x7317('0x0'));var util=require(_0x7317('0x1'));var path=require(_0x7317('0x2'));var timeout=require(_0x7317('0x3'));var express=require(_0x7317('0x4'));var router=express[_0x7317('0x5')]();var auth=require(_0x7317('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7317('0x7'));var controller=require(_0x7317('0x8'));router[_0x7317('0x9')]('/',auth['isAuthenticated'](),controller[_0x7317('0xa')]);router[_0x7317('0x9')](_0x7317('0xb'),auth[_0x7317('0xc')](),controller[_0x7317('0xd')]);router[_0x7317('0x9')](_0x7317('0xe'),auth[_0x7317('0xc')](),controller[_0x7317('0xf')]);router[_0x7317('0x9')]('/:id/dispositions',auth[_0x7317('0xc')](),controller[_0x7317('0x10')]);router['get'](_0x7317('0x11'),auth[_0x7317('0xc')](),controller[_0x7317('0x12')]);router['get'](_0x7317('0x13'),auth[_0x7317('0xc')](),controller[_0x7317('0x14')]);router[_0x7317('0x9')](_0x7317('0x15'),auth[_0x7317('0xc')](),controller[_0x7317('0x16')]);router[_0x7317('0x9')](_0x7317('0x17'),auth[_0x7317('0xc')](),controller[_0x7317('0x18')]);router['post']('/',auth[_0x7317('0xc')](),controller[_0x7317('0x19')]);router['post'](_0x7317('0x1a'),auth[_0x7317('0xc')](),controller['addDisposition']);router['post'](_0x7317('0x11'),auth['isAuthenticated'](),controller[_0x7317('0x1b')]);router[_0x7317('0x1c')](_0x7317('0x1d'),controller[_0x7317('0x1e')]);router[_0x7317('0x1c')](_0x7317('0x13'),auth['isAuthenticated'](),controller[_0x7317('0x1f')]);router['post'](_0x7317('0x17'),auth[_0x7317('0xc')](),controller[_0x7317('0x20')]);router[_0x7317('0x1c')](_0x7317('0x21'),auth['isAuthenticated'](),controller[_0x7317('0x22')]);router['put'](_0x7317('0xe'),auth[_0x7317('0xc')](),controller['update']);router[_0x7317('0x23')](_0x7317('0xe'),auth[_0x7317('0xc')](),controller[_0x7317('0x24')]);router[_0x7317('0x23')](_0x7317('0x1a'),auth[_0x7317('0xc')](),controller[_0x7317('0x25')]);router[_0x7317('0x23')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x7317('0x26')]);router['delete'](_0x7317('0x17'),auth[_0x7317('0xc')](),controller['removeAgents']);module[_0x7317('0x27')]=router; \ No newline at end of file +var _0xb943=['index','get','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeAnswers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated'];(function(_0x893aa8,_0x1ac7ed){var _0x56b6c4=function(_0xcd84a2){while(--_0xcd84a2){_0x893aa8['push'](_0x893aa8['shift']());}};_0x56b6c4(++_0x1ac7ed);}(_0xb943,0xda));var _0x3b94=function(_0xef6a97,_0x39bf2d){_0xef6a97=_0xef6a97-0x0;var _0x408cf0=_0xb943[_0xef6a97];return _0x408cf0;};'use strict';var multer=require(_0x3b94('0x0'));var util=require('util');var path=require(_0x3b94('0x1'));var timeout=require(_0x3b94('0x2'));var express=require(_0x3b94('0x3'));var router=express[_0x3b94('0x4')]();var auth=require(_0x3b94('0x5'));var interaction=require(_0x3b94('0x6'));var config=require(_0x3b94('0x7'));var controller=require(_0x3b94('0x8'));router['get']('/',auth[_0x3b94('0x9')](),controller[_0x3b94('0xa')]);router[_0x3b94('0xb')](_0x3b94('0xc'),auth['isAuthenticated'](),controller[_0x3b94('0xd')]);router[_0x3b94('0xb')](_0x3b94('0xe'),auth[_0x3b94('0x9')](),controller['show']);router[_0x3b94('0xb')]('/:id/dispositions',auth[_0x3b94('0x9')](),controller[_0x3b94('0xf')]);router[_0x3b94('0xb')](_0x3b94('0x10'),auth[_0x3b94('0x9')](),controller[_0x3b94('0x11')]);router['get'](_0x3b94('0x12'),auth[_0x3b94('0x9')](),controller['getApplications']);router[_0x3b94('0xb')](_0x3b94('0x13'),auth['isAuthenticated'](),controller[_0x3b94('0x14')]);router[_0x3b94('0xb')](_0x3b94('0x15'),auth['isAuthenticated'](),controller[_0x3b94('0x16')]);router[_0x3b94('0x17')]('/',auth['isAuthenticated'](),controller[_0x3b94('0x18')]);router['post'](_0x3b94('0x19'),auth[_0x3b94('0x9')](),controller[_0x3b94('0x1a')]);router[_0x3b94('0x17')](_0x3b94('0x10'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x3b94('0x1b'),controller[_0x3b94('0x1c')]);router['post'](_0x3b94('0x12'),auth[_0x3b94('0x9')](),controller[_0x3b94('0x1d')]);router[_0x3b94('0x17')](_0x3b94('0x15'),auth[_0x3b94('0x9')](),controller['addAgents']);router[_0x3b94('0x17')](_0x3b94('0x1e'),auth[_0x3b94('0x9')](),controller[_0x3b94('0x1f')]);router[_0x3b94('0x20')](_0x3b94('0xe'),auth[_0x3b94('0x9')](),controller[_0x3b94('0x21')]);router[_0x3b94('0x22')](_0x3b94('0xe'),auth[_0x3b94('0x9')](),controller[_0x3b94('0x23')]);router['delete']('/:id/dispositions',auth[_0x3b94('0x9')](),controller['removeDispositions']);router[_0x3b94('0x22')](_0x3b94('0x10'),auth['isAuthenticated'](),controller[_0x3b94('0x24')]);router[_0x3b94('0x22')](_0x3b94('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3b94('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 6d234cc..6077662 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 _0xf6e2=['randomstring','exports','STRING','name','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(_0x26802a,_0x2b02a5){var _0x4e5ca4=function(_0x53f3a3){while(--_0x53f3a3){_0x26802a['push'](_0x26802a['shift']());}};_0x4e5ca4(++_0x2b02a5);}(_0xf6e2,0x15d));var _0x2f6e=function(_0x78dcc7,_0x4c6f8f){_0x78dcc7=_0x78dcc7-0x0;var _0x221b64=_0xf6e2[_0x78dcc7];return _0x221b64;};'use strict';var Sequelize=require(_0x2f6e('0x0'));var rs=require(_0x2f6e('0x1'));module[_0x2f6e('0x2')]={'name':{'type':Sequelize[_0x2f6e('0x3')],'unique':_0x2f6e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x2f6e('0x3')]},'token':{'type':Sequelize[_0x2f6e('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x2f6e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2f6e('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2f6e('0x5')],'defaultValue':function(){return _0x2f6e('0x6');}},'notificationSound':{'type':Sequelize[_0x2f6e('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2f6e('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2f6e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2f6e('0x3')]},'queueTransfer':{'type':Sequelize[_0x2f6e('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2f6e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2f6e('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2f6e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2f6e('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2f6e('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2f6e('0x7')],'defaultValue':![],'comment':_0x2f6e('0xa'),'set':function(_0x10b522){if(!_0x10b522)this[_0x2f6e('0xb')](_0x2f6e('0xc'),null);this[_0x2f6e('0xb')](_0x2f6e('0xd'),_0x10b522);}}}; \ No newline at end of file +var _0x43ce=['setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x43ce,0x1ec));var _0xe43c=function(_0x301225,_0x3dad7a){_0x301225=_0x301225-0x0;var _0x352b72=_0x43ce[_0x301225];return _0x352b72;};'use strict';var Sequelize=require(_0xe43c('0x0'));var rs=require(_0xe43c('0x1'));module[_0xe43c('0x2')]={'name':{'type':Sequelize[_0xe43c('0x3')],'unique':_0xe43c('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xe43c('0x3')]},'token':{'type':Sequelize[_0xe43c('0x3')],'defaultValue':function(){return rs[_0xe43c('0x5')]();}},'replyUri':{'type':Sequelize[_0xe43c('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xe43c('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe43c('0x6')],'defaultValue':function(){return _0xe43c('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe43c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xe43c('0x3')]},'queueTransfer':{'type':Sequelize[_0xe43c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe43c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe43c('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe43c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe43c('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xe43c('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xe43c('0x9')],'defaultValue':![],'comment':_0xe43c('0xb'),'set':function(_0x12e375){if(!_0x12e375)this[_0xe43c('0xc')](_0xe43c('0xd'),null);this[_0xe43c('0xc')]('mandatoryDisposition',_0x12e375);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index c0b1d02..1c68836 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 _0xdbe5=['catch','params','attributes','find','create','body','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','OpenchannelApplication','Applications','account','list','applications','orderBy','Contacts','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','bulkCreate','priority','getApplications','pick','Contact','Owner','fullname','internal','Tag','color','addAgents','ids','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','defaults','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./openchannelAccount.socket','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~!@#$%^&-_=+[{]}.','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','json','offset','limit','status','set','Content-Range','reject','update','get','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','length','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','rows'];(function(_0x1d3943,_0x32ca85){var _0x166795=function(_0x48c26b){while(--_0x48c26b){_0x1d3943['push'](_0x1d3943['shift']());}};_0x166795(++_0x32ca85);}(_0xdbe5,0x11c));var _0x5dbe=function(_0x39e227,_0x21fa81){_0x39e227=_0x39e227-0x0;var _0x558d73=_0xdbe5[_0x39e227];return _0x558d73;};'use strict';var pdf=require(_0x5dbe('0x0'));var emlformat=require(_0x5dbe('0x1'));var rimraf=require(_0x5dbe('0x2'));var zipdir=require(_0x5dbe('0x3'));var jsonpatch=require(_0x5dbe('0x4'));var rp=require(_0x5dbe('0x5'));var moment=require(_0x5dbe('0x6'));var BPromise=require(_0x5dbe('0x7'));var Mustache=require(_0x5dbe('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5dbe('0x9'));var ejs=require(_0x5dbe('0xa'));var fs=require('fs');var _=require(_0x5dbe('0xb'));var squel=require(_0x5dbe('0xc'));var crypto=require(_0x5dbe('0xd'));var jsforce=require(_0x5dbe('0xe'));var deskjs=require(_0x5dbe('0xf'));var toCsv=require(_0x5dbe('0x9'));var querystring=require(_0x5dbe('0x10'));var Papa=require(_0x5dbe('0x11'));var Redis=require('ioredis');var authService=require(_0x5dbe('0x12'));var qs=require(_0x5dbe('0x13'));var as=require(_0x5dbe('0x14'));var hardwareService=require(_0x5dbe('0x15'));var logger=require(_0x5dbe('0x16'))(_0x5dbe('0x17'));var utils=require(_0x5dbe('0x18'));var config=require(_0x5dbe('0x19'));var db=require(_0x5dbe('0x1a'))['db'];config[_0x5dbe('0x1b')]=_['defaults'](config[_0x5dbe('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5dbe('0x1b')]));require(_0x5dbe('0x1c'))['register'](socket);var jayson=require(_0x5dbe('0x1d'));var client=jayson[_0x5dbe('0x1e')][_0x5dbe('0x1f')]({'port':0x232c});var client9002=jayson[_0x5dbe('0x1e')][_0x5dbe('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x40367c,_0x4847ce,_0x17b53c){if(_0x17b53c){var _0x3abfa7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3abfa7['test'](_0x4847ce)){return _0x40367c;}else{throw new db[(_0x5dbe('0x20'))][(_0x5dbe('0x21'))](_0x5dbe('0x22'));}}else{return _0x40367c;}}function respondWithRpcPromise(_0x2d132f,_0x5d6765,_0x1f2bba,_0x1033f9){return new BPromise(function(_0x3e5cc9,_0x41a07c){var _0x4cc8fc=_0x1033f9||client;return _0x4cc8fc['request'](_0x2d132f,_0x1f2bba)[_0x5dbe('0x23')](function(_0x570a7c){logger['info'](_0x5dbe('0x24'),_0x5d6765,_0x5dbe('0x25'));logger[_0x5dbe('0x26')](_0x5dbe('0x27'),_0x5d6765,_0x5dbe('0x25'),JSON[_0x5dbe('0x28')](_0x570a7c));if(_0x570a7c[_0x5dbe('0x29')]){if(_0x570a7c[_0x5dbe('0x29')][_0x5dbe('0x2a')]===0x1f4){logger[_0x5dbe('0x29')](_0x5dbe('0x24'),_0x5d6765,_0x570a7c[_0x5dbe('0x29')][_0x5dbe('0x2b')]);return _0x41a07c(_0x570a7c[_0x5dbe('0x29')][_0x5dbe('0x2b')]);}logger[_0x5dbe('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x5d6765,_0x570a7c[_0x5dbe('0x29')][_0x5dbe('0x2b')]);return _0x3e5cc9(_0x570a7c['error'][_0x5dbe('0x2b')]);}else{logger[_0x5dbe('0x2c')](_0x5dbe('0x24'),_0x5d6765,_0x5dbe('0x25'));_0x3e5cc9(_0x570a7c[_0x5dbe('0x2d')]['message']);}})['catch'](function(_0x154e58){logger[_0x5dbe('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x5d6765,_0x154e58);_0x41a07c(_0x154e58);});});}function respondWithStatusCode(_0x201ad4,_0x5ac1a2){_0x5ac1a2=_0x5ac1a2||0xcc;return function(_0x547f90){if(_0x547f90){return _0x201ad4[_0x5dbe('0x2e')](_0x5ac1a2);}return _0x201ad4['status'](_0x5ac1a2)[_0x5dbe('0x2f')]();};}function respondWithResult(_0x38ab1b,_0x4e783f){_0x4e783f=_0x4e783f||0xc8;return function(_0x195e75){if(_0x195e75){return _0x38ab1b['status'](_0x4e783f)[_0x5dbe('0x30')](_0x195e75);}};}function respondWithFilteredResult(_0x1c0ad2,_0x319693){return function(_0x26dbf0){if(_0x26dbf0){var _0x10c2fc=_0x26dbf0['count'],_0xdc467=_0x319693[_0x5dbe('0x31')],_0x4aeb8c=_0x319693[_0x5dbe('0x31')]+_0x319693[_0x5dbe('0x32')],_0x47a4a1;if(_0x4aeb8c>=_0x10c2fc){_0x4aeb8c=_0x10c2fc;_0x47a4a1=0xc8;}else{_0x47a4a1=0xce;}_0x1c0ad2[_0x5dbe('0x33')](_0x47a4a1);return _0x1c0ad2[_0x5dbe('0x34')](_0x5dbe('0x35'),_0xdc467+'-'+_0x4aeb8c+'/'+_0x10c2fc)[_0x5dbe('0x30')](_0x26dbf0);}return null;};}function patchUpdates(_0x182499){return function(_0x5f163d){try{jsonpatch['apply'](_0x5f163d,_0x182499,!![]);}catch(_0x3f02c7){return BPromise[_0x5dbe('0x36')](_0x3f02c7);}return _0x5f163d['save']();};}function saveUpdates(_0x53f3fa,_0x40fd80){return function(_0x1a6065){if(_0x1a6065){return _0x1a6065[_0x5dbe('0x37')](_0x53f3fa)[_0x5dbe('0x23')](function(_0x3361f6){return _0x3361f6;});}return null;};}function removeEntity(_0x3ac9d2,_0x4ad25b){return function(_0x1e3527){if(_0x1e3527){return _0x1e3527['destroy']()[_0x5dbe('0x23')](function(){var _0x5dfdc8=_0x1e3527[_0x5dbe('0x38')]({'plain':!![]});var _0x2e960e='OpenchannelAccounts';return db[_0x5dbe('0x39')]['destroy']({'where':{'type':_0x2e960e,'resourceId':_0x5dfdc8['id']}})[_0x5dbe('0x23')](function(){return _0x1e3527;});})[_0x5dbe('0x23')](function(){_0x3ac9d2['status'](0xcc)[_0x5dbe('0x2f')]();});}};}function handleEntityNotFound(_0x44a49e,_0x59c845){return function(_0x3a7cee){if(!_0x3a7cee){_0x44a49e[_0x5dbe('0x2e')](0x194);}return _0x3a7cee;};}function handleError(_0x37b6eb,_0x1a3bc2){_0x1a3bc2=_0x1a3bc2||0x1f4;return function(_0x3caead){logger[_0x5dbe('0x29')](_0x3caead[_0x5dbe('0x3a')]);if(_0x3caead[_0x5dbe('0x3b')]){delete _0x3caead['name'];}_0x37b6eb[_0x5dbe('0x33')](_0x1a3bc2)['send'](_0x3caead);};}exports['index']=function(_0x22cf6a,_0x8e9ef6){var _0x1ed603={'include':[{'model':db[_0x5dbe('0x3c')],'as':_0x5dbe('0x3d')}]},_0x4181d9={},_0x2beae3={'count':0x0,'rows':[]};var _0xba9c14=_[_0x5dbe('0x3e')](db[_0x5dbe('0x3f')][_0x5dbe('0x40')],function(_0x1d9ecb){return{'name':_0x1d9ecb[_0x5dbe('0x41')],'type':_0x1d9ecb[_0x5dbe('0x42')][_0x5dbe('0x43')]};});_0x4181d9[_0x5dbe('0x44')]=_[_0x5dbe('0x3e')](_0xba9c14,_0x5dbe('0x3b'));_0x4181d9['query']=_[_0x5dbe('0x45')](_0x22cf6a['query']);_0x4181d9[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0x4181d9[_0x5dbe('0x44')],_0x4181d9[_0x5dbe('0x48')]);_0x1ed603['attributes']=_[_0x5dbe('0x47')](_0x4181d9['model'],qs[_0x5dbe('0x49')](_0x22cf6a['query'][_0x5dbe('0x49')]));_0x1ed603['attributes']=_0x1ed603['attributes'][_0x5dbe('0x4a')]?_0x1ed603['attributes']:_0x4181d9[_0x5dbe('0x44')];if(!_0x22cf6a[_0x5dbe('0x48')]['hasOwnProperty'](_0x5dbe('0x4b'))){_0x1ed603[_0x5dbe('0x32')]=qs[_0x5dbe('0x32')](_0x22cf6a[_0x5dbe('0x48')][_0x5dbe('0x32')]);_0x1ed603[_0x5dbe('0x31')]=qs[_0x5dbe('0x31')](_0x22cf6a[_0x5dbe('0x48')][_0x5dbe('0x31')]);}_0x1ed603[_0x5dbe('0x4c')]=qs['sort'](_0x22cf6a[_0x5dbe('0x48')][_0x5dbe('0x4d')]);_0x1ed603[_0x5dbe('0x4e')]=qs[_0x5dbe('0x46')](_['pick'](_0x22cf6a['query'],_0x4181d9[_0x5dbe('0x46')]),_0xba9c14);if(_0x22cf6a[_0x5dbe('0x48')][_0x5dbe('0x4f')]){_0x1ed603[_0x5dbe('0x4e')]=_['merge'](_0x1ed603[_0x5dbe('0x4e')],{'$or':_[_0x5dbe('0x3e')](_0xba9c14,function(_0x48c82a){if(_0x48c82a[_0x5dbe('0x42')]!=='VIRTUAL'){var _0x119fb2={};_0x119fb2[_0x48c82a['name']]={'$like':'%'+_0x22cf6a[_0x5dbe('0x48')][_0x5dbe('0x4f')]+'%'};return _0x119fb2;}})});}_0x1ed603=_[_0x5dbe('0x50')]({},_0x1ed603,_0x22cf6a[_0x5dbe('0x51')]);var _0x2570f6={'where':_0x1ed603[_0x5dbe('0x4e')]};return db[_0x5dbe('0x3f')][_0x5dbe('0x52')](_0x2570f6)[_0x5dbe('0x23')](function(_0x529f2d){_0x2beae3[_0x5dbe('0x52')]=_0x529f2d;if(_0x22cf6a[_0x5dbe('0x48')][_0x5dbe('0x53')]){_0x1ed603[_0x5dbe('0x54')]=[{'all':!![]}];}return db[_0x5dbe('0x3f')]['findAll'](_0x1ed603);})[_0x5dbe('0x23')](function(_0x574733){_0x2beae3[_0x5dbe('0x55')]=_0x574733;return _0x2beae3;})[_0x5dbe('0x23')](respondWithFilteredResult(_0x8e9ef6,_0x1ed603))[_0x5dbe('0x56')](handleError(_0x8e9ef6,null));};exports['show']=function(_0x382ac5,_0x28e39a){var _0x383792={'raw':![],'where':{'id':_0x382ac5[_0x5dbe('0x57')]['id']},'include':[{'model':db[_0x5dbe('0x3c')],'as':_0x5dbe('0x3d')}]},_0xa8ab5c={};_0xa8ab5c['model']=_[_0x5dbe('0x45')](db['OpenchannelAccount'][_0x5dbe('0x40')]);_0xa8ab5c[_0x5dbe('0x48')]=_['keys'](_0x382ac5[_0x5dbe('0x48')]);_0xa8ab5c[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0xa8ab5c[_0x5dbe('0x44')],_0xa8ab5c['query']);_0x383792[_0x5dbe('0x58')]=_['intersection'](_0xa8ab5c[_0x5dbe('0x44')],qs[_0x5dbe('0x49')](_0x382ac5[_0x5dbe('0x48')][_0x5dbe('0x49')]));_0x383792[_0x5dbe('0x58')]=_0x383792['attributes'][_0x5dbe('0x4a')]?_0x383792[_0x5dbe('0x58')]:_0xa8ab5c['model'];if(_0x382ac5[_0x5dbe('0x48')][_0x5dbe('0x53')]){_0x383792[_0x5dbe('0x54')]=[{'all':!![]}];}_0x383792=_['merge']({},_0x383792,_0x382ac5[_0x5dbe('0x51')]);return db[_0x5dbe('0x3f')][_0x5dbe('0x59')](_0x383792)[_0x5dbe('0x23')](handleEntityNotFound(_0x28e39a,null))[_0x5dbe('0x23')](respondWithResult(_0x28e39a,null))[_0x5dbe('0x56')](handleError(_0x28e39a,null));};exports[_0x5dbe('0x5a')]=function(_0x181da1,_0x5abade){return db[_0x5dbe('0x3f')][_0x5dbe('0x5a')](_0x181da1[_0x5dbe('0x5b')],{})[_0x5dbe('0x23')](function(_0x42e870){var _0x4bdcbf=_0x181da1[_0x5dbe('0x5c')][_0x5dbe('0x38')]({'plain':!![]});if(!_0x4bdcbf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bdcbf['role']===_0x5dbe('0x5c')){var _0x5e74fd=_0x42e870[_0x5dbe('0x38')]({'plain':!![]});var _0x31cd0f=_0x5dbe('0x5d');return db[_0x5dbe('0x5e')][_0x5dbe('0x59')]({'where':{'name':_0x31cd0f,'userProfileId':_0x4bdcbf[_0x5dbe('0x5f')]},'raw':!![]})[_0x5dbe('0x23')](function(_0x32bcad){if(_0x32bcad&&_0x32bcad[_0x5dbe('0x60')]===0x0){return db[_0x5dbe('0x39')]['create']({'name':_0x5e74fd[_0x5dbe('0x3b')],'resourceId':_0x5e74fd['id'],'type':_0x32bcad[_0x5dbe('0x3b')],'sectionId':_0x32bcad['id']},{})[_0x5dbe('0x23')](function(){return _0x42e870;});}else{return _0x42e870;}})[_0x5dbe('0x56')](function(_0x2a9be7){logger[_0x5dbe('0x29')](_0x5dbe('0x61'),_0x2a9be7);throw _0x2a9be7;});}return _0x42e870;})[_0x5dbe('0x23')](respondWithResult(_0x5abade,0xc9))[_0x5dbe('0x56')](handleError(_0x5abade,null));};exports[_0x5dbe('0x37')]=function(_0x1f0956,_0x5e2544){if(_0x1f0956[_0x5dbe('0x5b')]['id']){delete _0x1f0956[_0x5dbe('0x5b')]['id'];}return db[_0x5dbe('0x3f')][_0x5dbe('0x59')]({'where':{'id':_0x1f0956['params']['id']},'include':[{'model':db['Pause'],'as':_0x5dbe('0x3d')}]})[_0x5dbe('0x23')](handleEntityNotFound(_0x5e2544,null))['then'](saveUpdates(_0x1f0956[_0x5dbe('0x5b')],null))[_0x5dbe('0x23')](respondWithResult(_0x5e2544,null))['catch'](handleError(_0x5e2544,null));};exports[_0x5dbe('0x62')]=function(_0x2f9a44,_0x4303b4){return db['OpenchannelAccount'][_0x5dbe('0x59')]({'where':{'id':_0x2f9a44[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x4303b4,null))[_0x5dbe('0x23')](removeEntity(_0x4303b4,null))[_0x5dbe('0x56')](handleError(_0x4303b4,null));};exports[_0x5dbe('0x63')]=function(_0x179e92,_0x2282d0){return db[_0x5dbe('0x3f')][_0x5dbe('0x63')]()[_0x5dbe('0x23')](respondWithResult(_0x2282d0,null))['catch'](handleError(_0x2282d0,null));};exports[_0x5dbe('0x64')]=function(_0x5e902d,_0x5d9d6d,_0x89aa77){if(_0x5e902d[_0x5dbe('0x5b')]['id']){delete _0x5e902d[_0x5dbe('0x5b')]['id'];}return db[_0x5dbe('0x3f')][_0x5dbe('0x59')]({'where':{'id':_0x5e902d[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x5d9d6d,null))[_0x5dbe('0x23')](function(_0x5ccaf9){if(_0x5ccaf9){_0x5e902d[_0x5dbe('0x5b')][_0x5dbe('0x65')]=_0x5ccaf9['id'];return db[_0x5dbe('0x66')][_0x5dbe('0x5a')](_0x5e902d['body']);}})[_0x5dbe('0x23')](respondWithResult(_0x5d9d6d,null))[_0x5dbe('0x56')](handleError(_0x5d9d6d,null));};exports[_0x5dbe('0x67')]=function(_0x4bd00c,_0x37c310,_0x4a770e){var _0x58446a={'raw':![],'where':{}};var _0x2a85b6={};var _0x3b3b40={'count':0x0,'rows':[]};return db[_0x5dbe('0x3f')][_0x5dbe('0x68')]({'where':{'id':_0x4bd00c[_0x5dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x37c310,null))['then'](function(_0x567594){if(_0x567594){_0x2a85b6[_0x5dbe('0x44')]=_[_0x5dbe('0x45')](db[_0x5dbe('0x66')]['rawAttributes']);_0x2a85b6[_0x5dbe('0x48')]=_[_0x5dbe('0x45')](_0x4bd00c[_0x5dbe('0x48')]);_0x2a85b6[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0x2a85b6[_0x5dbe('0x44')],_0x2a85b6['query']);_0x58446a[_0x5dbe('0x58')]=_[_0x5dbe('0x47')](_0x2a85b6['model'],qs[_0x5dbe('0x49')](_0x4bd00c[_0x5dbe('0x48')]['fields']));_0x58446a[_0x5dbe('0x58')]=_0x58446a[_0x5dbe('0x58')][_0x5dbe('0x4a')]?_0x58446a[_0x5dbe('0x58')]:_0x2a85b6[_0x5dbe('0x44')];if(!_0x4bd00c[_0x5dbe('0x48')][_0x5dbe('0x69')]('nolimit')){_0x58446a[_0x5dbe('0x32')]=qs[_0x5dbe('0x32')](_0x4bd00c[_0x5dbe('0x48')][_0x5dbe('0x32')]);_0x58446a[_0x5dbe('0x31')]=qs[_0x5dbe('0x31')](_0x4bd00c[_0x5dbe('0x48')]['offset']);}_0x58446a[_0x5dbe('0x4c')]=qs[_0x5dbe('0x4d')](_0x4bd00c['query'][_0x5dbe('0x4d')]);_0x58446a[_0x5dbe('0x4e')]=qs[_0x5dbe('0x46')](_['pick'](_0x4bd00c['query'],_0x2a85b6[_0x5dbe('0x46')]));_0x58446a[_0x5dbe('0x4e')][_0x5dbe('0x6a')]=_0x567594['id'];if(_0x4bd00c[_0x5dbe('0x48')][_0x5dbe('0x4f')]){_0x58446a[_0x5dbe('0x4e')]=_['merge'](_0x58446a[_0x5dbe('0x4e')],{'$or':_[_0x5dbe('0x3e')](_0x58446a[_0x5dbe('0x58')],function(_0x2c6a8d){var _0x1c05df={};_0x1c05df[_0x2c6a8d]={'$like':'%'+_0x4bd00c[_0x5dbe('0x48')][_0x5dbe('0x4f')]+'%'};return _0x1c05df;})});}_0x58446a=_[_0x5dbe('0x50')]({},_0x58446a,_0x4bd00c[_0x5dbe('0x51')]);return db[_0x5dbe('0x66')]['count']({'where':_0x58446a[_0x5dbe('0x4e')]})[_0x5dbe('0x23')](function(_0x2292e1){_0x3b3b40['count']=_0x2292e1;if(_0x4bd00c[_0x5dbe('0x48')][_0x5dbe('0x53')]){_0x58446a[_0x5dbe('0x54')]=[{'all':!![]}];}return db[_0x5dbe('0x66')][_0x5dbe('0x6b')](_0x58446a);})['then'](function(_0x3b6991){_0x3b3b40[_0x5dbe('0x55')]=_0x3b6991;return _0x3b3b40;});}})['then'](respondWithFilteredResult(_0x37c310,_0x58446a))['catch'](handleError(_0x37c310,null));};exports[_0x5dbe('0x6c')]=function(_0x4dc087,_0x135637,_0xa22735){return db['OpenchannelAccount']['find']({'where':{'id':_0x4dc087[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x135637,null))['then'](function(_0x21c628){if(_0x21c628){return _0x21c628[_0x5dbe('0x6c')](_0x4dc087[_0x5dbe('0x48')]['ids']);}})[_0x5dbe('0x23')](respondWithStatusCode(_0x135637,null))[_0x5dbe('0x56')](handleError(_0x135637,null));};exports[_0x5dbe('0x6d')]=function(_0x116a60,_0x3bfa75,_0x218548){if(_0x116a60['body']['id']){delete _0x116a60[_0x5dbe('0x5b')]['id'];}return db[_0x5dbe('0x3f')][_0x5dbe('0x59')]({'where':{'id':_0x116a60[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x3bfa75,null))['then'](function(_0x3db66b){if(_0x3db66b){_0x116a60[_0x5dbe('0x5b')][_0x5dbe('0x6a')]=_0x3db66b['id'];return db[_0x5dbe('0x6e')][_0x5dbe('0x5a')](_0x116a60[_0x5dbe('0x5b')]);}})[_0x5dbe('0x23')](respondWithResult(_0x3bfa75,null))['catch'](handleError(_0x3bfa75,null));};exports['getAnswers']=function(_0x133c29,_0x4eb4d8,_0x2b7725){var _0x4bec5d={'raw':![],'where':{}};var _0x1b25c9={};var _0xb94fd1={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5dbe('0x68')]({'where':{'id':_0x133c29['params']['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x4eb4d8,null))[_0x5dbe('0x23')](function(_0x586c58){if(_0x586c58){_0x1b25c9['model']=_['keys'](db[_0x5dbe('0x6e')]['rawAttributes']);_0x1b25c9['query']=_[_0x5dbe('0x45')](_0x133c29['query']);_0x1b25c9[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0x1b25c9[_0x5dbe('0x44')],_0x1b25c9[_0x5dbe('0x48')]);_0x4bec5d['attributes']=_[_0x5dbe('0x47')](_0x1b25c9[_0x5dbe('0x44')],qs[_0x5dbe('0x49')](_0x133c29[_0x5dbe('0x48')]['fields']));_0x4bec5d[_0x5dbe('0x58')]=_0x4bec5d[_0x5dbe('0x58')]['length']?_0x4bec5d[_0x5dbe('0x58')]:_0x1b25c9[_0x5dbe('0x44')];if(!_0x133c29[_0x5dbe('0x48')][_0x5dbe('0x69')]('nolimit')){_0x4bec5d[_0x5dbe('0x32')]=qs[_0x5dbe('0x32')](_0x133c29[_0x5dbe('0x48')][_0x5dbe('0x32')]);_0x4bec5d[_0x5dbe('0x31')]=qs[_0x5dbe('0x31')](_0x133c29[_0x5dbe('0x48')][_0x5dbe('0x31')]);}_0x4bec5d['order']=qs[_0x5dbe('0x4d')](_0x133c29[_0x5dbe('0x48')][_0x5dbe('0x4d')]);_0x4bec5d['where']=qs['filters'](_['pick'](_0x133c29[_0x5dbe('0x48')],_0x1b25c9[_0x5dbe('0x46')]));_0x4bec5d[_0x5dbe('0x4e')][_0x5dbe('0x6a')]=_0x586c58['id'];if(_0x133c29['query'][_0x5dbe('0x4f')]){_0x4bec5d[_0x5dbe('0x4e')]=_[_0x5dbe('0x50')](_0x4bec5d[_0x5dbe('0x4e')],{'$or':_[_0x5dbe('0x3e')](_0x4bec5d[_0x5dbe('0x58')],function(_0x2afe0d){var _0x2ee711={};_0x2ee711[_0x2afe0d]={'$like':'%'+_0x133c29[_0x5dbe('0x48')][_0x5dbe('0x4f')]+'%'};return _0x2ee711;})});}_0x4bec5d=_[_0x5dbe('0x50')]({},_0x4bec5d,_0x133c29['options']);return db['CannedAnswer'][_0x5dbe('0x52')]({'where':_0x4bec5d['where']})['then'](function(_0x1f8f6d){_0xb94fd1[_0x5dbe('0x52')]=_0x1f8f6d;if(_0x133c29['query']['includeAll']){_0x4bec5d[_0x5dbe('0x54')]=[{'all':!![]}];}return db[_0x5dbe('0x6e')][_0x5dbe('0x6b')](_0x4bec5d);})[_0x5dbe('0x23')](function(_0x5e1c0a){_0xb94fd1[_0x5dbe('0x55')]=_0x5e1c0a;return _0xb94fd1;});}})[_0x5dbe('0x23')](respondWithFilteredResult(_0x4eb4d8,_0x4bec5d))[_0x5dbe('0x56')](handleError(_0x4eb4d8,null));};exports['removeAnswers']=function(_0x3dc6f6,_0x13a40f,_0x5bb32d){return db['OpenchannelAccount'][_0x5dbe('0x59')]({'where':{'id':_0x3dc6f6[_0x5dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x13a40f,null))[_0x5dbe('0x23')](function(_0x229f91){if(_0x229f91){return _0x229f91[_0x5dbe('0x6f')](_0x3dc6f6[_0x5dbe('0x48')]['ids']);}})[_0x5dbe('0x23')](respondWithStatusCode(_0x13a40f,null))['catch'](handleError(_0x13a40f,null));};exports['notify']=function(_0x270d91,_0x1c685c,_0x1ce2f6){var _0x3531ee={'body':_0x270d91[_0x5dbe('0x5b')],'channel':'openchannel'};var _0x240e99=[];var _0x59c1b0=[];var _0x165a56={};var _0x3eb47c=![];return db[_0x5dbe('0x70')][_0x5dbe('0x63')]()[_0x5dbe('0x23')](function(_0x20de7c){if(!_0x20de7c){throw new db[(_0x5dbe('0x20'))][(_0x5dbe('0x21'))](_0x5dbe('0x71'));}_0x240e99=_['difference'](_['keys'](_0x20de7c),[_0x5dbe('0x72'),_0x5dbe('0x73')]);_0x59c1b0=_[_0x5dbe('0x74')](_['keys'](_0x20de7c),['createdAt',_0x5dbe('0x73'),_0x5dbe('0x75'),_0x5dbe('0x76')]);if(_0x270d91[_0x5dbe('0x5b')]['id']){delete _0x270d91[_0x5dbe('0x5b')]['id'];}if(_[_0x5dbe('0x77')](_0x270d91['body'][_0x5dbe('0x78')])){throw new db['Sequelize'][(_0x5dbe('0x21'))]('from\x20is\x20mandatory');}if(_[_0x5dbe('0x77')](_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x5b')])||_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x5b')]===''){throw new db[(_0x5dbe('0x20'))][(_0x5dbe('0x21'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5dbe('0x77')](_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x79')])){throw new db[(_0x5dbe('0x20'))][(_0x5dbe('0x21'))](_0x5dbe('0x7a')+_0x59c1b0);}if(!_[_0x5dbe('0x7b')](_0x59c1b0,_0x270d91[_0x5dbe('0x5b')]['mapKey'])){throw new db[(_0x5dbe('0x20'))][(_0x5dbe('0x21'))](_0x5dbe('0x7c')+_0x59c1b0);}_0x165a56[_0x270d91['body'][_0x5dbe('0x79')]]=_0x270d91[_0x5dbe('0x5b')]['from'];})['then'](function(){return db[_0x5dbe('0x3f')][_0x5dbe('0x59')]({'where':{'id':_0x270d91[_0x5dbe('0x57')]['id']},'include':[{'model':db[_0x5dbe('0x7d')],'as':_0x5dbe('0x7e'),'include':[{'model':db[_0x5dbe('0x70')],'as':'Contacts','where':_0x165a56,'limit':0x1,'order':[['updatedAt',_0x5dbe('0x7f')]]}]},{'model':db[_0x5dbe('0x80')],'as':_0x5dbe('0x81')}]});})[_0x5dbe('0x23')](handleEntityNotFound(_0x1c685c,null))[_0x5dbe('0x23')](function(_0x55bfd3){if(_0x55bfd3&&_0x55bfd3['List']){_0x3531ee[_0x5dbe('0x82')]=_0x55bfd3;_0x3531ee['applications']=_0x55bfd3[_0x5dbe('0x81')];_0x3531ee[_0x5dbe('0x83')]=_0x55bfd3[_0x5dbe('0x7e')];_0x3531ee[_0x5dbe('0x84')]=_[_0x5dbe('0x85')](_0x3531ee[_0x5dbe('0x84')],['priority'],['asc']);if(_0x3531ee['account']['Applications']){delete _0x3531ee['account'][_0x5dbe('0x81')];}if(_0x3531ee[_0x5dbe('0x82')][_0x5dbe('0x7e')]&&_0x3531ee[_0x5dbe('0x82')][_0x5dbe('0x7e')][_0x5dbe('0x86')][_0x5dbe('0x4a')]){return _0x3531ee['account'][_0x5dbe('0x7e')][_0x5dbe('0x86')][0x0];}var _0xde4c26=_['defaults'](_0x270d91['body'],{'firstName':_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x78')],'ListId':_0x55bfd3[_0x5dbe('0x76')]});_0xde4c26[_0x270d91[_0x5dbe('0x5b')]['mapKey']]=_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x78')];return db[_0x5dbe('0x70')]['create'](_0xde4c26,{'fields':_0x240e99,'raw':!![]});}})[_0x5dbe('0x23')](handleEntityNotFound(_0x1c685c,null))[_0x5dbe('0x23')](function(_0x23657c){_0x3531ee['contact']=_0x23657c;if(_0x23657c){var _0x4cae1f={'ContactId':_0x23657c['id'],'OpenchannelAccountId':_0x270d91[_0x5dbe('0x57')]['id'],'from':(_0x23657c[_0x5dbe('0x87')]||'')+'\x20'+(_0x23657c[_0x5dbe('0x88')]||'')};var _0x4110be={'OpenchannelAccountId':_0x270d91[_0x5dbe('0x57')]['id'],'closed':![]};if(_0x270d91[_0x5dbe('0x5b')]['threadId']){_0x4110be[_0x5dbe('0x89')]=_0x270d91['body'][_0x5dbe('0x89')];return db[_0x5dbe('0x8a')][_0x5dbe('0x59')]({'where':_0x4110be})[_0x5dbe('0x23')](function(_0x15e8e7){if(_0x15e8e7){return[_0x15e8e7,![]];}_0x4cae1f[_0x5dbe('0x89')]=_0x270d91['body'][_0x5dbe('0x89')];_0x4cae1f[_0x5dbe('0x8b')]=_0x270d91[_0x5dbe('0x5b')]['externalUrl'];return db['OpenchannelInteraction']['create'](_0x4cae1f)['then'](function(_0x7aa16e){return[_0x7aa16e,!![]];});});}else{_0x4110be['threadId']=null;}_0x4110be[_0x5dbe('0x8c')]=_0x23657c['id'];return db[_0x5dbe('0x8a')][_0x5dbe('0x59')]({'where':_0x4110be})['then'](function(_0x3892c6){if(_0x3892c6){return[_0x3892c6,![]];}return db['OpenchannelInteraction'][_0x5dbe('0x5a')](_0x4cae1f)[_0x5dbe('0x23')](function(_0x4953d3){return[_0x4953d3,!![]];});});}})[_0x5dbe('0x8d')](function(_0x139860,_0xa47c7c){if(_0x139860){_0x3eb47c=_0xa47c7c;if(!_0xa47c7c){var _0x16cee2={'from':(_0x3531ee[_0x5dbe('0x8e')][_0x5dbe('0x87')]||'')+'\x20'+(_0x3531ee['contact']['lastName']||'')};if(_0x270d91['body'][_0x5dbe('0x89')]&&_0x270d91[_0x5dbe('0x5b')]['messageId']&&_0x270d91['body']['threadId']!=_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x8f')]){_0x16cee2[_0x5dbe('0x89')]=_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x8f')];}return _0x139860[_0x5dbe('0x37')](_0x16cee2);}else{return _0x139860;}}})['then'](function(_0x4ade95){_0x3531ee[_0x5dbe('0x90')]=_0x4ade95[_0x5dbe('0x38')]({'plain':!![]});_0x3531ee[_0x5dbe('0x90')][_0x5dbe('0x91')]=_0x3eb47c;if(_0x3531ee[_0x5dbe('0x90')][_0x5dbe('0x91')]){if(_0x3531ee['account'][_0x5dbe('0x92')]){_0x3531ee[_0x5dbe('0x84')][_0x5dbe('0x93')]({'id':0x0,'priority':_0x3531ee[_0x5dbe('0x84')][_0x5dbe('0x4a')]+0x1,'app':_0x5dbe('0x94'),'appdata':_0x5dbe('0x95'),'interval':_0x5dbe('0x96')});}}return db[_0x5dbe('0x97')][_0x5dbe('0x5a')]({'body':_0x270d91[_0x5dbe('0x5b')][_0x5dbe('0x5b')],'OpenchannelAccountId':_0x270d91[_0x5dbe('0x57')]['id'],'OpenchannelInteractionId':_0x4ade95['id'],'direction':'in','ContactId':_0x3531ee[_0x5dbe('0x8e')]['id'],'AttachmentId':_0x270d91['body'][_0x5dbe('0x98')]});})[_0x5dbe('0x23')](function(_0x4f2d62){_0x3531ee[_0x5dbe('0x2b')]=_0x4f2d62;if(_0x3531ee[_0x5dbe('0x90')][_0x5dbe('0x99')]){return db[_0x5dbe('0x9a')]['find']({'attributes':['id',_0x5dbe('0x3b')],'where':{'id':_0x3531ee['interaction'][_0x5dbe('0x99')]}})[_0x5dbe('0x23')](function(_0x312538){if(_0x312538){_0x3531ee['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x5dbe('0x9b'),'appdata':_0x312538[_0x5dbe('0x3b')]+','+(_0x3531ee[_0x5dbe('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0x5dbe('0x96')});_0x3531ee[_0x5dbe('0x9c')]=![];}return respondWithRpcPromise(_0x5dbe('0x9d'),_0x5dbe('0x9e'),_0x3531ee);});}return respondWithRpcPromise(_0x5dbe('0x9d'),_0x5dbe('0x9e'),_0x3531ee);})[_0x5dbe('0x23')](function(_0x1b1db4){respondWithRpcPromise(_0x5dbe('0x9f'),_0x5dbe('0x9f'),{'event':'notify','message':_0x1b1db4},client9002);return _0x1b1db4;})[_0x5dbe('0x23')](respondWithResult(_0x1c685c,null))[_0x5dbe('0x56')](handleError(_0x1c685c,null));};exports['addApplications']=function(_0x305b93,_0x408866,_0x5dc736){return db[_0x5dbe('0x3f')][_0x5dbe('0x68')]({'where':{'id':_0x305b93['params']['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x408866,null))[_0x5dbe('0x23')](function(_0x56ad7a){if(_0x56ad7a){return db[_0x5dbe('0xa0')][_0x5dbe('0xa1')](function(_0x429b98){return db['OpenchannelApplication'][_0x5dbe('0x62')]({'where':{'OpenchannelAccountId':_0x305b93['params']['id']},'transaction':_0x429b98})[_0x5dbe('0x23')](function(_0x5b6b08){var _0x3a5884=_[_0x5dbe('0x3e')](_0x305b93[_0x5dbe('0x5b')],function(_0x449b16){_0x449b16[_0x5dbe('0x6a')]=_0x305b93['params']['id'];return _0x449b16;});return db[_0x5dbe('0x80')][_0x5dbe('0xa2')](_0x3a5884,{'transaction':_0x429b98});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x305b93[_0x5dbe('0x57')]['id']},'order':_0x5dbe('0xa3')});});}})[_0x5dbe('0x23')](respondWithResult(_0x408866,null))['catch'](handleError(_0x408866,null));};exports[_0x5dbe('0xa4')]=function(_0x2c9f0c,_0x2e96f5,_0x3ac1e5){var _0x59ba5f={};var _0x5487b9={};var _0x4c2864;var _0x19eed9;return db[_0x5dbe('0x3f')][_0x5dbe('0x68')]({'where':{'id':_0x2c9f0c[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x2e96f5,null))[_0x5dbe('0x23')](function(_0x37925c){if(_0x37925c){_0x4c2864=_0x37925c;_0x5487b9[_0x5dbe('0x44')]=_[_0x5dbe('0x45')](db[_0x5dbe('0x80')][_0x5dbe('0x40')]);_0x5487b9[_0x5dbe('0x48')]=_[_0x5dbe('0x45')](_0x2c9f0c[_0x5dbe('0x48')]);_0x5487b9[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0x5487b9[_0x5dbe('0x44')],_0x5487b9[_0x5dbe('0x48')]);_0x59ba5f['attributes']=_[_0x5dbe('0x47')](_0x5487b9[_0x5dbe('0x44')],qs[_0x5dbe('0x49')](_0x2c9f0c[_0x5dbe('0x48')]['fields']));_0x59ba5f[_0x5dbe('0x58')]=_0x59ba5f[_0x5dbe('0x58')][_0x5dbe('0x4a')]?_0x59ba5f[_0x5dbe('0x58')]:_0x5487b9[_0x5dbe('0x44')];_0x59ba5f['order']=qs[_0x5dbe('0x4d')](_0x2c9f0c[_0x5dbe('0x48')][_0x5dbe('0x4d')]);_0x59ba5f[_0x5dbe('0x4e')]=qs[_0x5dbe('0x46')](_['pick'](_0x2c9f0c[_0x5dbe('0x48')],_0x5487b9[_0x5dbe('0x46')]));if(_0x2c9f0c[_0x5dbe('0x48')][_0x5dbe('0x4f')]){_0x59ba5f[_0x5dbe('0x4e')]=_[_0x5dbe('0x50')](_0x59ba5f['where'],{'$or':_['map'](_0x59ba5f[_0x5dbe('0x58')],function(_0xd62895){var _0x468fb3={};_0x468fb3[_0xd62895]={'$like':'%'+_0x2c9f0c[_0x5dbe('0x48')][_0x5dbe('0x4f')]+'%'};return _0x468fb3;})});}_0x59ba5f=_['merge']({},_0x59ba5f,_0x2c9f0c[_0x5dbe('0x51')]);return _0x4c2864[_0x5dbe('0xa4')](_0x59ba5f);}})[_0x5dbe('0x23')](function(_0x29f399){if(_0x29f399){_0x19eed9=_0x29f399[_0x5dbe('0x4a')];if(!_0x2c9f0c[_0x5dbe('0x48')]['hasOwnProperty']('nolimit')){_0x59ba5f['limit']=qs[_0x5dbe('0x32')](_0x2c9f0c[_0x5dbe('0x48')][_0x5dbe('0x32')]);_0x59ba5f[_0x5dbe('0x31')]=qs[_0x5dbe('0x31')](_0x2c9f0c['query'][_0x5dbe('0x31')]);}return _0x4c2864[_0x5dbe('0xa4')](_0x59ba5f);}})['then'](function(_0x9fccea){if(_0x9fccea){return _0x9fccea?{'count':_0x19eed9,'rows':_0x9fccea}:null;}})['then'](respondWithResult(_0x2e96f5,null))['catch'](handleError(_0x2e96f5,null));};exports['getInteractions']=function(_0x2807c1,_0x18cfed,_0x22ff1b){var _0x23aed5={'raw':![],'where':{}};var _0x59f177={};var _0x3cf793={'count':0x0,'rows':[]};return db[_0x5dbe('0x3f')][_0x5dbe('0x68')]({'where':{'id':_0x2807c1[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x18cfed,null))[_0x5dbe('0x23')](function(_0x6830e0){if(_0x6830e0){_0x59f177[_0x5dbe('0x44')]=_[_0x5dbe('0x45')](db['OpenchannelInteraction']['rawAttributes']);_0x59f177[_0x5dbe('0x48')]=_[_0x5dbe('0x45')](_0x2807c1['query']);_0x59f177[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0x59f177[_0x5dbe('0x44')],_0x59f177['query']);_0x23aed5[_0x5dbe('0x58')]=_[_0x5dbe('0x47')](_0x59f177['model'],qs[_0x5dbe('0x49')](_0x2807c1[_0x5dbe('0x48')][_0x5dbe('0x49')]));_0x23aed5[_0x5dbe('0x58')]=_0x23aed5[_0x5dbe('0x58')]['length']?_0x23aed5[_0x5dbe('0x58')]:_0x59f177['model'];if(!_0x2807c1[_0x5dbe('0x48')][_0x5dbe('0x69')]('nolimit')){_0x23aed5[_0x5dbe('0x32')]=qs[_0x5dbe('0x32')](_0x2807c1[_0x5dbe('0x48')][_0x5dbe('0x32')]);_0x23aed5[_0x5dbe('0x31')]=qs[_0x5dbe('0x31')](_0x2807c1[_0x5dbe('0x48')]['offset']);}_0x23aed5[_0x5dbe('0x4c')]=qs[_0x5dbe('0x4d')](_0x2807c1[_0x5dbe('0x48')]['sort']);_0x23aed5[_0x5dbe('0x4e')]=qs[_0x5dbe('0x46')](_[_0x5dbe('0xa5')](_0x2807c1[_0x5dbe('0x48')],_0x59f177[_0x5dbe('0x46')]));_0x23aed5[_0x5dbe('0x4e')][_0x5dbe('0x6a')]=_0x6830e0['id'];if(_0x2807c1[_0x5dbe('0x48')][_0x5dbe('0x4f')]){_0x23aed5['where']=_[_0x5dbe('0x50')](_0x23aed5['where'],{'$or':_['map'](_0x23aed5[_0x5dbe('0x58')],function(_0x1e1756){var _0x2551ba={};_0x2551ba[_0x1e1756]={'$like':'%'+_0x2807c1[_0x5dbe('0x48')][_0x5dbe('0x4f')]+'%'};return _0x2551ba;})});}_0x23aed5=_[_0x5dbe('0x50')]({},_0x23aed5,_0x2807c1[_0x5dbe('0x51')]);return db[_0x5dbe('0x8a')][_0x5dbe('0x52')]({'where':_0x23aed5[_0x5dbe('0x4e')]})[_0x5dbe('0x23')](function(_0x24748e){_0x3cf793['count']=_0x24748e;if(_0x2807c1[_0x5dbe('0x48')][_0x5dbe('0x53')]){_0x23aed5[_0x5dbe('0x54')]=[{'model':db[_0x5dbe('0x70')],'as':_0x5dbe('0xa6'),'required':![]},{'model':db[_0x5dbe('0x9a')],'as':_0x5dbe('0xa7'),'attributes':[_0x5dbe('0x3b'),_0x5dbe('0xa8'),_0x5dbe('0xa9')],'required':![]},{'model':db[_0x5dbe('0xaa')],'as':'Tags','attributes':['id',_0x5dbe('0x3b'),_0x5dbe('0xab')],'where':_0x2807c1['query']['tag']?{'id':_0x2807c1['query']['tag']}:undefined,'required':_0x2807c1[_0x5dbe('0x48')]['tag']?!![]:![]}];}return db[_0x5dbe('0x8a')]['findAll'](_0x23aed5);})[_0x5dbe('0x23')](function(_0x1c7a5a){_0x3cf793[_0x5dbe('0x55')]=_0x1c7a5a;return _0x3cf793;});}})['then'](respondWithFilteredResult(_0x18cfed,_0x23aed5))['catch'](handleError(_0x18cfed,null));};exports[_0x5dbe('0xac')]=function(_0x14e715,_0x1351d0,_0x3de572){return db[_0x5dbe('0x3f')][_0x5dbe('0x59')]({'where':{'id':_0x14e715[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x1351d0,null))[_0x5dbe('0x23')](function(_0x8b9477){if(_0x8b9477){return _0x8b9477[_0x5dbe('0xac')](_0x14e715[_0x5dbe('0x5b')][_0x5dbe('0xad')],_['omit'](_0x14e715[_0x5dbe('0x5b')],[_0x5dbe('0xad'),'id'])||{})[_0x5dbe('0x8d')](function(_0x1a8f20){for(var _0x38b88d=0x0;_0x38b88d<_0x14e715['body'][_0x5dbe('0xad')][_0x5dbe('0x4a')];_0x38b88d+=0x1){socket[_0x5dbe('0xae')](_0x5dbe('0xaf'),{'UserId':_0x14e715[_0x5dbe('0x5b')][_0x5dbe('0xad')][_0x38b88d],'OpenchannelAccountId':_0x14e715['params']['id']});}return _0x1a8f20;});}})[_0x5dbe('0x23')](respondWithResult(_0x1351d0,null))[_0x5dbe('0x56')](handleError(_0x1351d0,null));};exports[_0x5dbe('0xb0')]=function(_0x4d5627,_0x354f0a,_0x5cee9a){return db[_0x5dbe('0x3f')][_0x5dbe('0x59')]({'where':{'id':_0x4d5627[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x354f0a,null))[_0x5dbe('0x23')](function(_0x231c72){if(_0x231c72){return _0x231c72[_0x5dbe('0xb0')](_0x4d5627['query'][_0x5dbe('0xad')])[_0x5dbe('0x23')](function(){if(_[_0x5dbe('0xb1')](_0x4d5627['query'][_0x5dbe('0xad')])){for(var _0x2b6e96=0x0;_0x2b6e96<_0x4d5627[_0x5dbe('0x48')][_0x5dbe('0xad')]['length'];_0x2b6e96+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4d5627[_0x5dbe('0x48')][_0x5dbe('0xad')][_0x2b6e96]),'OpenchannelAccountId':Number(_0x4d5627[_0x5dbe('0x57')]['id'])});}}else{socket[_0x5dbe('0xae')](_0x5dbe('0xb2'),{'UserId':Number(_0x4d5627['query'][_0x5dbe('0xad')]),'OpenchannelAccountId':Number(_0x4d5627[_0x5dbe('0x57')]['id'])});}});}})[_0x5dbe('0x23')](respondWithStatusCode(_0x354f0a,null))[_0x5dbe('0x56')](handleError(_0x354f0a,null));};exports['getAgents']=function(_0x32e025,_0x13aec4,_0x97a82e){var _0x3077b2={};var _0x452d21={};var _0x3df385;var _0x1b6506;return db[_0x5dbe('0x3f')][_0x5dbe('0x68')]({'where':{'id':_0x32e025[_0x5dbe('0x57')]['id']}})[_0x5dbe('0x23')](handleEntityNotFound(_0x13aec4,null))['then'](function(_0x59f501){if(_0x59f501){_0x3df385=_0x59f501;_0x452d21[_0x5dbe('0x44')]=_[_0x5dbe('0x45')](db[_0x5dbe('0x9a')]['rawAttributes']);_0x452d21[_0x5dbe('0x48')]=_[_0x5dbe('0x45')](_0x32e025[_0x5dbe('0x48')]);_0x452d21[_0x5dbe('0x46')]=_[_0x5dbe('0x47')](_0x452d21[_0x5dbe('0x44')],_0x452d21[_0x5dbe('0x48')]);_0x3077b2[_0x5dbe('0x58')]=_[_0x5dbe('0x47')](_0x452d21[_0x5dbe('0x44')],qs['fields'](_0x32e025[_0x5dbe('0x48')]['fields']));_0x3077b2[_0x5dbe('0x58')]=_0x3077b2[_0x5dbe('0x58')][_0x5dbe('0x4a')]?_0x3077b2[_0x5dbe('0x58')]:_0x452d21[_0x5dbe('0x44')];_0x3077b2['order']=qs[_0x5dbe('0x4d')](_0x32e025[_0x5dbe('0x48')][_0x5dbe('0x4d')]);_0x3077b2[_0x5dbe('0x4e')]=qs[_0x5dbe('0x46')](_['pick'](_0x32e025[_0x5dbe('0x48')],_0x452d21[_0x5dbe('0x46')]));if(_0x32e025[_0x5dbe('0x48')][_0x5dbe('0x4f')]){_0x3077b2[_0x5dbe('0x4e')]=_[_0x5dbe('0x50')](_0x3077b2[_0x5dbe('0x4e')],{'$or':_[_0x5dbe('0x3e')](_0x3077b2['attributes'],function(_0x28c6d0){var _0x252d9f={};_0x252d9f[_0x28c6d0]={'$like':'%'+_0x32e025[_0x5dbe('0x48')][_0x5dbe('0x4f')]+'%'};return _0x252d9f;})});}_0x3077b2=_[_0x5dbe('0x50')]({},_0x3077b2,_0x32e025[_0x5dbe('0x51')]);return _0x3df385[_0x5dbe('0xb3')](_0x3077b2);}})[_0x5dbe('0x23')](function(_0x260298){if(_0x260298){_0x1b6506=_0x260298[_0x5dbe('0x4a')];if(!_0x32e025[_0x5dbe('0x48')]['hasOwnProperty'](_0x5dbe('0x4b'))){_0x3077b2[_0x5dbe('0x32')]=qs[_0x5dbe('0x32')](_0x32e025[_0x5dbe('0x48')]['limit']);_0x3077b2[_0x5dbe('0x31')]=qs[_0x5dbe('0x31')](_0x32e025['query'][_0x5dbe('0x31')]);}return _0x3df385['getAgents'](_0x3077b2);}})[_0x5dbe('0x23')](function(_0x31a4e7){if(_0x31a4e7){return _0x31a4e7?{'count':_0x1b6506,'rows':_0x31a4e7}:null;}})['then'](respondWithResult(_0x13aec4,null))[_0x5dbe('0x56')](handleError(_0x13aec4,null));};exports[_0x5dbe('0xb4')]=function(_0x4055fa,_0x4985bc,_0x1339e2){var _0x2924c2,_0x4c03d5,_0x3e087c;if(_[_0x5dbe('0x77')](_0x4055fa[_0x5dbe('0x5b')][_0x5dbe('0x5b')])||_0x4055fa[_0x5dbe('0x5b')][_0x5dbe('0x5b')]===''){throw new db[(_0x5dbe('0x20'))]['ValidationError'](_0x5dbe('0xb5'));}if(_[_0x5dbe('0x77')](_0x4055fa[_0x5dbe('0x5b')]['to'])){}_0x2924c2=_0x4055fa[_0x5dbe('0x5b')]['to'];return db[_0x5dbe('0x3f')]['findOne']({'where':{'id':_0x4055fa[_0x5dbe('0x57')]['id']}})['then'](handleEntityNotFound(_0x4985bc,null))[_0x5dbe('0x23')](function(_0x48fbd1){if(_0x48fbd1){return db[_0x5dbe('0x3f')]['find']({'where':{'id':_0x48fbd1['id']},'include':[{'model':db[_0x5dbe('0x7d')],'as':_0x5dbe('0x7e'),'include':[{'model':db['CmContact'],'as':_0x5dbe('0x86'),'where':{[_0x48fbd1[_0x5dbe('0x79')]]:_0x2924c2},'limit':0x1,'order':[[_0x5dbe('0x73'),_0x5dbe('0x7f')]]}]}]})['then'](handleEntityNotFound(_0x4985bc,null))[_0x5dbe('0x23')](function(_0x1724ae){if(_0x1724ae&&_0x1724ae[_0x5dbe('0x7e')]){_0x4c03d5=_0x1724ae['get']({'plain':!![]});if(_0x4c03d5[_0x5dbe('0x7e')]&&_0x4c03d5[_0x5dbe('0x7e')]['Contacts'][_0x5dbe('0x4a')]){return _0x4c03d5[_0x5dbe('0x7e')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0x5dbe('0xb6')](_0x4055fa[_0x5dbe('0x5b')],{'firstName':_0x2924c2,[_0x1724ae[_0x5dbe('0x79')]]:_0x2924c2,'phone':_0x2924c2,'ListId':_0x4c03d5[_0x5dbe('0x76')]}));}})[_0x5dbe('0x23')](handleEntityNotFound(_0x4985bc,null))['then'](function(_0x29ceb1){if(_0x29ceb1){_0x3e087c=_0x29ceb1;return db[_0x5dbe('0x8a')][_0x5dbe('0x59')]({'where':{'ContactId':_0x3e087c['id'],'closed':![],'OpenchannelAccountId':_0x4c03d5['id']}})['then'](function(_0x2cbe94){if(_0x2cbe94){return[_0x2cbe94,![]];}return db[_0x5dbe('0x8a')][_0x5dbe('0x5a')]({'UserId':_0x4055fa[_0x5dbe('0x5c')]['id'],'ContactId':_0x3e087c['id'],'OpenchannelAccountId':_0x4c03d5['id'],'lastMsgDirection':'out','Messages':[_[_0x5dbe('0x50')](_0x4055fa[_0x5dbe('0x5b')],{'read':![],'body':_0x4055fa[_0x5dbe('0x5b')][_0x5dbe('0x5b')],'OpenchannelAccountId':_0x4c03d5['id'],'UserId':_0x4055fa[_0x5dbe('0x5c')]['id'],'ContactId':_0x3e087c['id']})]},{'include':[{'model':db[_0x5dbe('0x97')],'as':_0x5dbe('0xb7')}]})[_0x5dbe('0x23')](function(_0x2ebe7){return[_0x2ebe7,!![]];});});}})[_0x5dbe('0x8d')](function(_0x1fc257,_0x3d70ed){if(_0x3d70ed){return _0x1fc257;}return db[_0x5dbe('0x97')][_0x5dbe('0x5a')](_[_0x5dbe('0x50')](_0x4055fa[_0x5dbe('0x5b')],{'read':![],'body':_0x4055fa[_0x5dbe('0x5b')]['body'],'OpenchannelAccountId':_0x4c03d5['id'],'OpenchannelInteractionId':_0x1fc257['id'],'UserId':_0x4055fa[_0x5dbe('0x5c')]['id'],'ContactId':_0x3e087c['id']}))['then'](function(_0x551701){_0x1fc257[_0x5dbe('0xb8')][_0x5dbe('0xb7')]=[];_0x1fc257[_0x5dbe('0xb8')][_0x5dbe('0xb7')]['push'](_0x551701[_0x5dbe('0xb8')]);return _0x1fc257;});});}})[_0x5dbe('0x23')](respondWithResult(_0x4985bc,null))['catch'](handleError(_0x4985bc,null));}; \ No newline at end of file +var _0xe7ed=['Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','Pause','map','OpenchannelAccount','rawAttributes','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','mandatoryDispositionPause','keys','length','includeAll','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','addDisposition','Disposition','getDispositions','findOne','nolimit','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','notify','openchannel','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','OpenchannelApplication','Applications','account','applications','orderBy','priority','asc','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','User','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','out','dataValues'];(function(_0x37ae17,_0x12491a){var _0x24b60f=function(_0x20ae90){while(--_0x20ae90){_0x37ae17['push'](_0x37ae17['shift']());}};_0x24b60f(++_0x12491a);}(_0xe7ed,0x16b));var _0xde7e=function(_0x3d9eb0,_0x11c684){_0x3d9eb0=_0x3d9eb0-0x0;var _0xe13611=_0xe7ed[_0x3d9eb0];return _0xe13611;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde7e('0x0'));var rimraf=require(_0xde7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde7e('0x2'));var rp=require(_0xde7e('0x3'));var moment=require(_0xde7e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xde7e('0x5'));var util=require(_0xde7e('0x6'));var path=require(_0xde7e('0x7'));var sox=require(_0xde7e('0x8'));var csv=require(_0xde7e('0x9'));var ejs=require(_0xde7e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xde7e('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xde7e('0xc'));var toCsv=require(_0xde7e('0x9'));var querystring=require('querystring');var Papa=require(_0xde7e('0xd'));var Redis=require(_0xde7e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xde7e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xde7e('0x10'))(_0xde7e('0x11'));var utils=require(_0xde7e('0x12'));var config=require(_0xde7e('0x13'));var db=require(_0xde7e('0x14'))['db'];config[_0xde7e('0x15')]=_[_0xde7e('0x16')](config[_0xde7e('0x15')],{'host':_0xde7e('0x17'),'port':0x18eb});var socket=require(_0xde7e('0x18'))(new Redis(config[_0xde7e('0x15')]));require(_0xde7e('0x19'))[_0xde7e('0x1a')](socket);var jayson=require(_0xde7e('0x1b'));var client=jayson['client'][_0xde7e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xde7e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x16659a,_0x33881d,_0x584676){if(_0x584676){var _0x1aa44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1aa44c['test'](_0x33881d)){return _0x16659a;}else{throw new db['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~!@#$%^&-_=+[{]}.');}}else{return _0x16659a;}}function respondWithRpcPromise(_0x11b6ef,_0x27a76c,_0x12c8dd,_0x12dcb8){return new BPromise(function(_0x3eda68,_0x346d3){var _0x5ec8a9=_0x12dcb8||client;return _0x5ec8a9['request'](_0x11b6ef,_0x12c8dd)[_0xde7e('0x1d')](function(_0x2967a3){logger[_0xde7e('0x1e')](_0xde7e('0x1f'),_0x27a76c,'request\x20sent');logger[_0xde7e('0x20')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x27a76c,'request\x20sent',JSON[_0xde7e('0x21')](_0x2967a3));if(_0x2967a3[_0xde7e('0x22')]){if(_0x2967a3[_0xde7e('0x22')]['code']===0x1f4){logger[_0xde7e('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x27a76c,_0x2967a3[_0xde7e('0x22')][_0xde7e('0x23')]);return _0x346d3(_0x2967a3[_0xde7e('0x22')][_0xde7e('0x23')]);}logger[_0xde7e('0x22')](_0xde7e('0x1f'),_0x27a76c,_0x2967a3[_0xde7e('0x22')][_0xde7e('0x23')]);return _0x3eda68(_0x2967a3['error']['message']);}else{logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x27a76c,_0xde7e('0x24'));_0x3eda68(_0x2967a3[_0xde7e('0x25')][_0xde7e('0x23')]);}})[_0xde7e('0x26')](function(_0x163675){logger[_0xde7e('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x27a76c,_0x163675);_0x346d3(_0x163675);});});}function respondWithStatusCode(_0x860d59,_0x240850){_0x240850=_0x240850||0xcc;return function(_0x27ba55){if(_0x27ba55){return _0x860d59[_0xde7e('0x27')](_0x240850);}return _0x860d59[_0xde7e('0x28')](_0x240850)[_0xde7e('0x29')]();};}function respondWithResult(_0x1b893b,_0x189bcf){_0x189bcf=_0x189bcf||0xc8;return function(_0x4511cb){if(_0x4511cb){return _0x1b893b[_0xde7e('0x28')](_0x189bcf)[_0xde7e('0x2a')](_0x4511cb);}};}function respondWithFilteredResult(_0x1b26c4,_0x406c93){return function(_0xa244a1){if(_0xa244a1){var _0x521b11=_0xa244a1[_0xde7e('0x2b')],_0x109f38=_0x406c93[_0xde7e('0x2c')],_0x48a132=_0x406c93[_0xde7e('0x2c')]+_0x406c93[_0xde7e('0x2d')],_0x59542a;if(_0x48a132>=_0x521b11){_0x48a132=_0x521b11;_0x59542a=0xc8;}else{_0x59542a=0xce;}_0x1b26c4[_0xde7e('0x28')](_0x59542a);return _0x1b26c4[_0xde7e('0x2e')](_0xde7e('0x2f'),_0x109f38+'-'+_0x48a132+'/'+_0x521b11)['json'](_0xa244a1);}return null;};}function patchUpdates(_0x3244c9){return function(_0x1dc56d){try{jsonpatch['apply'](_0x1dc56d,_0x3244c9,!![]);}catch(_0x2416e9){return BPromise[_0xde7e('0x30')](_0x2416e9);}return _0x1dc56d[_0xde7e('0x31')]();};}function saveUpdates(_0x223106,_0x20664e){return function(_0x87bc79){if(_0x87bc79){return _0x87bc79[_0xde7e('0x32')](_0x223106)['then'](function(_0x161058){return _0x161058;});}return null;};}function removeEntity(_0x5c0830,_0x18386c){return function(_0x2c8447){if(_0x2c8447){return _0x2c8447[_0xde7e('0x33')]()[_0xde7e('0x1d')](function(){var _0x315149=_0x2c8447[_0xde7e('0x34')]({'plain':!![]});var _0x187747=_0xde7e('0x35');return db[_0xde7e('0x36')]['destroy']({'where':{'type':_0x187747,'resourceId':_0x315149['id']}})[_0xde7e('0x1d')](function(){return _0x2c8447;});})[_0xde7e('0x1d')](function(){_0x5c0830[_0xde7e('0x28')](0xcc)[_0xde7e('0x29')]();});}};}function handleEntityNotFound(_0x40871f,_0x40d9f1){return function(_0xc43f32){if(!_0xc43f32){_0x40871f[_0xde7e('0x27')](0x194);}return _0xc43f32;};}function handleError(_0x582aef,_0x4f8c0d){_0x4f8c0d=_0x4f8c0d||0x1f4;return function(_0x5c3cb3){logger[_0xde7e('0x22')](_0x5c3cb3[_0xde7e('0x37')]);if(_0x5c3cb3[_0xde7e('0x38')]){delete _0x5c3cb3[_0xde7e('0x38')];}_0x582aef['status'](_0x4f8c0d)['send'](_0x5c3cb3);};}exports['index']=function(_0x4b955b,_0x15a782){var _0x421159={'include':[{'model':db[_0xde7e('0x39')],'as':'mandatoryDispositionPause'}]},_0x4e6fdf={},_0xcf42ec={'count':0x0,'rows':[]};var _0x16df3b=_[_0xde7e('0x3a')](db[_0xde7e('0x3b')][_0xde7e('0x3c')],function(_0x5a3237){return{'name':_0x5a3237['fieldName'],'type':_0x5a3237[_0xde7e('0x3d')]['key']};});_0x4e6fdf[_0xde7e('0x3e')]=_[_0xde7e('0x3a')](_0x16df3b,_0xde7e('0x38'));_0x4e6fdf[_0xde7e('0x3f')]=_['keys'](_0x4b955b[_0xde7e('0x3f')]);_0x4e6fdf[_0xde7e('0x40')]=_['intersection'](_0x4e6fdf[_0xde7e('0x3e')],_0x4e6fdf[_0xde7e('0x3f')]);_0x421159['attributes']=_[_0xde7e('0x41')](_0x4e6fdf[_0xde7e('0x3e')],qs[_0xde7e('0x42')](_0x4b955b[_0xde7e('0x3f')][_0xde7e('0x42')]));_0x421159[_0xde7e('0x43')]=_0x421159[_0xde7e('0x43')]['length']?_0x421159[_0xde7e('0x43')]:_0x4e6fdf[_0xde7e('0x3e')];if(!_0x4b955b['query'][_0xde7e('0x44')]('nolimit')){_0x421159[_0xde7e('0x2d')]=qs[_0xde7e('0x2d')](_0x4b955b[_0xde7e('0x3f')][_0xde7e('0x2d')]);_0x421159['offset']=qs[_0xde7e('0x2c')](_0x4b955b[_0xde7e('0x3f')][_0xde7e('0x2c')]);}_0x421159['order']=qs[_0xde7e('0x45')](_0x4b955b[_0xde7e('0x3f')]['sort']);_0x421159['where']=qs[_0xde7e('0x40')](_[_0xde7e('0x46')](_0x4b955b[_0xde7e('0x3f')],_0x4e6fdf[_0xde7e('0x40')]),_0x16df3b);if(_0x4b955b[_0xde7e('0x3f')]['filter']){_0x421159[_0xde7e('0x47')]=_[_0xde7e('0x48')](_0x421159[_0xde7e('0x47')],{'$or':_[_0xde7e('0x3a')](_0x16df3b,function(_0x35c750){if(_0x35c750[_0xde7e('0x3d')]!==_0xde7e('0x49')){var _0x386bcd={};_0x386bcd[_0x35c750[_0xde7e('0x38')]]={'$like':'%'+_0x4b955b['query'][_0xde7e('0x4a')]+'%'};return _0x386bcd;}})});}_0x421159=_['merge']({},_0x421159,_0x4b955b[_0xde7e('0x4b')]);var _0x3a3c65={'where':_0x421159[_0xde7e('0x47')]};return db[_0xde7e('0x3b')]['count'](_0x3a3c65)[_0xde7e('0x1d')](function(_0x17bfb8){_0xcf42ec[_0xde7e('0x2b')]=_0x17bfb8;if(_0x4b955b[_0xde7e('0x3f')]['includeAll']){_0x421159[_0xde7e('0x4c')]=[{'all':!![]}];}return db[_0xde7e('0x3b')][_0xde7e('0x4d')](_0x421159);})[_0xde7e('0x1d')](function(_0x1d7b0f){_0xcf42ec[_0xde7e('0x4e')]=_0x1d7b0f;return _0xcf42ec;})[_0xde7e('0x1d')](respondWithFilteredResult(_0x15a782,_0x421159))[_0xde7e('0x26')](handleError(_0x15a782,null));};exports[_0xde7e('0x4f')]=function(_0x4101b5,_0x43b798){var _0x19e51={'raw':![],'where':{'id':_0x4101b5[_0xde7e('0x50')]['id']},'include':[{'model':db[_0xde7e('0x39')],'as':_0xde7e('0x51')}]},_0x47ea3e={};_0x47ea3e[_0xde7e('0x3e')]=_['keys'](db[_0xde7e('0x3b')][_0xde7e('0x3c')]);_0x47ea3e[_0xde7e('0x3f')]=_[_0xde7e('0x52')](_0x4101b5[_0xde7e('0x3f')]);_0x47ea3e[_0xde7e('0x40')]=_['intersection'](_0x47ea3e[_0xde7e('0x3e')],_0x47ea3e[_0xde7e('0x3f')]);_0x19e51[_0xde7e('0x43')]=_['intersection'](_0x47ea3e[_0xde7e('0x3e')],qs[_0xde7e('0x42')](_0x4101b5['query'][_0xde7e('0x42')]));_0x19e51[_0xde7e('0x43')]=_0x19e51[_0xde7e('0x43')][_0xde7e('0x53')]?_0x19e51[_0xde7e('0x43')]:_0x47ea3e[_0xde7e('0x3e')];if(_0x4101b5[_0xde7e('0x3f')][_0xde7e('0x54')]){_0x19e51[_0xde7e('0x4c')]=[{'all':!![]}];}_0x19e51=_[_0xde7e('0x48')]({},_0x19e51,_0x4101b5[_0xde7e('0x4b')]);return db[_0xde7e('0x3b')][_0xde7e('0x55')](_0x19e51)[_0xde7e('0x1d')](handleEntityNotFound(_0x43b798,null))[_0xde7e('0x1d')](respondWithResult(_0x43b798,null))['catch'](handleError(_0x43b798,null));};exports[_0xde7e('0x56')]=function(_0x497329,_0x43c179){return db[_0xde7e('0x3b')][_0xde7e('0x56')](_0x497329['body'],{})[_0xde7e('0x1d')](function(_0x54817c){var _0x31f01d=_0x497329[_0xde7e('0x57')]['get']({'plain':!![]});if(!_0x31f01d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31f01d[_0xde7e('0x58')]===_0xde7e('0x57')){var _0x303015=_0x54817c[_0xde7e('0x34')]({'plain':!![]});var _0x557a38=_0xde7e('0x35');return db[_0xde7e('0x59')]['find']({'where':{'name':_0x557a38,'userProfileId':_0x31f01d[_0xde7e('0x5a')]},'raw':!![]})[_0xde7e('0x1d')](function(_0x222fe0){if(_0x222fe0&&_0x222fe0[_0xde7e('0x5b')]===0x0){return db[_0xde7e('0x36')]['create']({'name':_0x303015[_0xde7e('0x38')],'resourceId':_0x303015['id'],'type':_0x222fe0[_0xde7e('0x38')],'sectionId':_0x222fe0['id']},{})[_0xde7e('0x1d')](function(){return _0x54817c;});}else{return _0x54817c;}})[_0xde7e('0x26')](function(_0x2bb68e){logger[_0xde7e('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bb68e);throw _0x2bb68e;});}return _0x54817c;})['then'](respondWithResult(_0x43c179,0xc9))[_0xde7e('0x26')](handleError(_0x43c179,null));};exports[_0xde7e('0x32')]=function(_0x20a990,_0x4a84c5){if(_0x20a990[_0xde7e('0x5c')]['id']){delete _0x20a990[_0xde7e('0x5c')]['id'];}return db[_0xde7e('0x3b')][_0xde7e('0x55')]({'where':{'id':_0x20a990[_0xde7e('0x50')]['id']},'include':[{'model':db[_0xde7e('0x39')],'as':'mandatoryDispositionPause'}]})[_0xde7e('0x1d')](handleEntityNotFound(_0x4a84c5,null))['then'](saveUpdates(_0x20a990['body'],null))[_0xde7e('0x1d')](respondWithResult(_0x4a84c5,null))['catch'](handleError(_0x4a84c5,null));};exports['destroy']=function(_0x91483,_0xb1d16b){return db['OpenchannelAccount']['find']({'where':{'id':_0x91483[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0xb1d16b,null))[_0xde7e('0x1d')](removeEntity(_0xb1d16b,null))[_0xde7e('0x26')](handleError(_0xb1d16b,null));};exports[_0xde7e('0x5d')]=function(_0x12908e,_0x116e70){return db['OpenchannelAccount'][_0xde7e('0x5d')]()[_0xde7e('0x1d')](respondWithResult(_0x116e70,null))[_0xde7e('0x26')](handleError(_0x116e70,null));};exports[_0xde7e('0x5e')]=function(_0x101d61,_0x427a3f,_0x57769a){if(_0x101d61['body']['id']){delete _0x101d61[_0xde7e('0x5c')]['id'];}return db[_0xde7e('0x3b')][_0xde7e('0x55')]({'where':{'id':_0x101d61[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x427a3f,null))[_0xde7e('0x1d')](function(_0x425e3f){if(_0x425e3f){_0x101d61[_0xde7e('0x5c')]['OpnechannelAccountId']=_0x425e3f['id'];return db[_0xde7e('0x5f')][_0xde7e('0x56')](_0x101d61['body']);}})[_0xde7e('0x1d')](respondWithResult(_0x427a3f,null))[_0xde7e('0x26')](handleError(_0x427a3f,null));};exports[_0xde7e('0x60')]=function(_0x3498c1,_0x22f7d9,_0x994ef0){var _0x23f39c={'raw':![],'where':{}};var _0x3dc109={};var _0x3f7a01={'count':0x0,'rows':[]};return db[_0xde7e('0x3b')][_0xde7e('0x61')]({'where':{'id':_0x3498c1[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x22f7d9,null))[_0xde7e('0x1d')](function(_0xb5709f){if(_0xb5709f){_0x3dc109[_0xde7e('0x3e')]=_[_0xde7e('0x52')](db['Disposition'][_0xde7e('0x3c')]);_0x3dc109[_0xde7e('0x3f')]=_[_0xde7e('0x52')](_0x3498c1[_0xde7e('0x3f')]);_0x3dc109[_0xde7e('0x40')]=_[_0xde7e('0x41')](_0x3dc109['model'],_0x3dc109[_0xde7e('0x3f')]);_0x23f39c[_0xde7e('0x43')]=_['intersection'](_0x3dc109[_0xde7e('0x3e')],qs['fields'](_0x3498c1[_0xde7e('0x3f')][_0xde7e('0x42')]));_0x23f39c[_0xde7e('0x43')]=_0x23f39c['attributes']['length']?_0x23f39c['attributes']:_0x3dc109[_0xde7e('0x3e')];if(!_0x3498c1[_0xde7e('0x3f')]['hasOwnProperty'](_0xde7e('0x62'))){_0x23f39c['limit']=qs['limit'](_0x3498c1['query'][_0xde7e('0x2d')]);_0x23f39c['offset']=qs[_0xde7e('0x2c')](_0x3498c1[_0xde7e('0x3f')][_0xde7e('0x2c')]);}_0x23f39c['order']=qs['sort'](_0x3498c1[_0xde7e('0x3f')][_0xde7e('0x45')]);_0x23f39c[_0xde7e('0x47')]=qs[_0xde7e('0x40')](_[_0xde7e('0x46')](_0x3498c1[_0xde7e('0x3f')],_0x3dc109[_0xde7e('0x40')]));_0x23f39c[_0xde7e('0x47')][_0xde7e('0x63')]=_0xb5709f['id'];if(_0x3498c1[_0xde7e('0x3f')][_0xde7e('0x4a')]){_0x23f39c[_0xde7e('0x47')]=_[_0xde7e('0x48')](_0x23f39c[_0xde7e('0x47')],{'$or':_[_0xde7e('0x3a')](_0x23f39c[_0xde7e('0x43')],function(_0x2b867b){var _0x1cecb6={};_0x1cecb6[_0x2b867b]={'$like':'%'+_0x3498c1[_0xde7e('0x3f')]['filter']+'%'};return _0x1cecb6;})});}_0x23f39c=_[_0xde7e('0x48')]({},_0x23f39c,_0x3498c1[_0xde7e('0x4b')]);return db[_0xde7e('0x5f')][_0xde7e('0x2b')]({'where':_0x23f39c['where']})['then'](function(_0x9ad4d1){_0x3f7a01[_0xde7e('0x2b')]=_0x9ad4d1;if(_0x3498c1[_0xde7e('0x3f')][_0xde7e('0x54')]){_0x23f39c[_0xde7e('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0xde7e('0x4d')](_0x23f39c);})['then'](function(_0x5e1f9b){_0x3f7a01['rows']=_0x5e1f9b;return _0x3f7a01;});}})['then'](respondWithFilteredResult(_0x22f7d9,_0x23f39c))[_0xde7e('0x26')](handleError(_0x22f7d9,null));};exports[_0xde7e('0x64')]=function(_0x25f223,_0x5437d1,_0x19b963){return db[_0xde7e('0x3b')]['find']({'where':{'id':_0x25f223[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x5437d1,null))['then'](function(_0x174987){if(_0x174987){return _0x174987[_0xde7e('0x64')](_0x25f223[_0xde7e('0x3f')][_0xde7e('0x65')]);}})[_0xde7e('0x1d')](respondWithStatusCode(_0x5437d1,null))[_0xde7e('0x26')](handleError(_0x5437d1,null));};exports['addAnswer']=function(_0x1f746,_0x245b4e,_0x435b2c){if(_0x1f746[_0xde7e('0x5c')]['id']){delete _0x1f746[_0xde7e('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x1f746[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x245b4e,null))[_0xde7e('0x1d')](function(_0x10504e){if(_0x10504e){_0x1f746[_0xde7e('0x5c')][_0xde7e('0x63')]=_0x10504e['id'];return db[_0xde7e('0x66')]['create'](_0x1f746['body']);}})[_0xde7e('0x1d')](respondWithResult(_0x245b4e,null))[_0xde7e('0x26')](handleError(_0x245b4e,null));};exports[_0xde7e('0x67')]=function(_0x4c123c,_0x18c59f,_0x5979d0){var _0x20ca96={'raw':![],'where':{}};var _0x5948d4={};var _0x1b7bb8={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xde7e('0x61')]({'where':{'id':_0x4c123c[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x18c59f,null))['then'](function(_0x25395a){if(_0x25395a){_0x5948d4['model']=_[_0xde7e('0x52')](db[_0xde7e('0x66')][_0xde7e('0x3c')]);_0x5948d4[_0xde7e('0x3f')]=_[_0xde7e('0x52')](_0x4c123c['query']);_0x5948d4['filters']=_[_0xde7e('0x41')](_0x5948d4[_0xde7e('0x3e')],_0x5948d4[_0xde7e('0x3f')]);_0x20ca96['attributes']=_[_0xde7e('0x41')](_0x5948d4['model'],qs[_0xde7e('0x42')](_0x4c123c[_0xde7e('0x3f')][_0xde7e('0x42')]));_0x20ca96['attributes']=_0x20ca96[_0xde7e('0x43')][_0xde7e('0x53')]?_0x20ca96[_0xde7e('0x43')]:_0x5948d4[_0xde7e('0x3e')];if(!_0x4c123c['query'][_0xde7e('0x44')](_0xde7e('0x62'))){_0x20ca96['limit']=qs[_0xde7e('0x2d')](_0x4c123c['query'][_0xde7e('0x2d')]);_0x20ca96[_0xde7e('0x2c')]=qs[_0xde7e('0x2c')](_0x4c123c['query'][_0xde7e('0x2c')]);}_0x20ca96[_0xde7e('0x68')]=qs[_0xde7e('0x45')](_0x4c123c[_0xde7e('0x3f')][_0xde7e('0x45')]);_0x20ca96[_0xde7e('0x47')]=qs[_0xde7e('0x40')](_['pick'](_0x4c123c['query'],_0x5948d4[_0xde7e('0x40')]));_0x20ca96[_0xde7e('0x47')]['OpenchannelAccountId']=_0x25395a['id'];if(_0x4c123c[_0xde7e('0x3f')]['filter']){_0x20ca96[_0xde7e('0x47')]=_['merge'](_0x20ca96[_0xde7e('0x47')],{'$or':_[_0xde7e('0x3a')](_0x20ca96[_0xde7e('0x43')],function(_0x2b510b){var _0x316968={};_0x316968[_0x2b510b]={'$like':'%'+_0x4c123c[_0xde7e('0x3f')][_0xde7e('0x4a')]+'%'};return _0x316968;})});}_0x20ca96=_[_0xde7e('0x48')]({},_0x20ca96,_0x4c123c[_0xde7e('0x4b')]);return db[_0xde7e('0x66')][_0xde7e('0x2b')]({'where':_0x20ca96[_0xde7e('0x47')]})[_0xde7e('0x1d')](function(_0x13ee75){_0x1b7bb8['count']=_0x13ee75;if(_0x4c123c[_0xde7e('0x3f')][_0xde7e('0x54')]){_0x20ca96['include']=[{'all':!![]}];}return db[_0xde7e('0x66')][_0xde7e('0x4d')](_0x20ca96);})['then'](function(_0x22089e){_0x1b7bb8[_0xde7e('0x4e')]=_0x22089e;return _0x1b7bb8;});}})[_0xde7e('0x1d')](respondWithFilteredResult(_0x18c59f,_0x20ca96))['catch'](handleError(_0x18c59f,null));};exports['removeAnswers']=function(_0x34d351,_0x312a7e,_0xa554f6){return db[_0xde7e('0x3b')][_0xde7e('0x55')]({'where':{'id':_0x34d351[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x312a7e,null))[_0xde7e('0x1d')](function(_0x4d4279){if(_0x4d4279){return _0x4d4279[_0xde7e('0x69')](_0x34d351['query']['ids']);}})[_0xde7e('0x1d')](respondWithStatusCode(_0x312a7e,null))[_0xde7e('0x26')](handleError(_0x312a7e,null));};exports[_0xde7e('0x6a')]=function(_0x5d4415,_0xf5f963,_0x435718){var _0x50315b={'body':_0x5d4415[_0xde7e('0x5c')],'channel':_0xde7e('0x6b')};var _0x4302b6=[];var _0x3dd6a6=[];var _0x37bb64={};var _0x3ab125=![];return db[_0xde7e('0x6c')][_0xde7e('0x5d')]()[_0xde7e('0x1d')](function(_0x506acb){if(!_0x506acb){throw new db['Sequelize'][(_0xde7e('0x6d'))]('no\x20available\x20attributes');}_0x4302b6=_[_0xde7e('0x6e')](_[_0xde7e('0x52')](_0x506acb),[_0xde7e('0x6f'),_0xde7e('0x70')]);_0x3dd6a6=_[_0xde7e('0x6e')](_['keys'](_0x506acb),[_0xde7e('0x6f'),_0xde7e('0x70'),_0xde7e('0x71'),_0xde7e('0x72')]);if(_0x5d4415['body']['id']){delete _0x5d4415['body']['id'];}if(_['isNil'](_0x5d4415['body'][_0xde7e('0x73')])){throw new db[(_0xde7e('0x74'))]['ValidationError'](_0xde7e('0x75'));}if(_[_0xde7e('0x76')](_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x5c')])||_0x5d4415['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xde7e('0x76')](_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x77')])){throw new db[(_0xde7e('0x74'))][(_0xde7e('0x6d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3dd6a6);}if(!_[_0xde7e('0x78')](_0x3dd6a6,_0x5d4415[_0xde7e('0x5c')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xde7e('0x79')+_0x3dd6a6);}_0x37bb64[_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x77')]]=_0x5d4415[_0xde7e('0x5c')]['from'];})[_0xde7e('0x1d')](function(){return db['OpenchannelAccount'][_0xde7e('0x55')]({'where':{'id':_0x5d4415[_0xde7e('0x50')]['id']},'include':[{'model':db['CmList'],'as':_0xde7e('0x7a'),'include':[{'model':db[_0xde7e('0x6c')],'as':_0xde7e('0x7b'),'where':_0x37bb64,'limit':0x1,'order':[[_0xde7e('0x70'),_0xde7e('0x7c')]]}]},{'model':db[_0xde7e('0x7d')],'as':_0xde7e('0x7e')}]});})[_0xde7e('0x1d')](handleEntityNotFound(_0xf5f963,null))[_0xde7e('0x1d')](function(_0x402e6e){if(_0x402e6e&&_0x402e6e[_0xde7e('0x7a')]){_0x50315b[_0xde7e('0x7f')]=_0x402e6e;_0x50315b[_0xde7e('0x80')]=_0x402e6e['Applications'];_0x50315b['list']=_0x402e6e[_0xde7e('0x7a')];_0x50315b[_0xde7e('0x80')]=_[_0xde7e('0x81')](_0x50315b[_0xde7e('0x80')],[_0xde7e('0x82')],[_0xde7e('0x83')]);if(_0x50315b[_0xde7e('0x7f')]['Applications']){delete _0x50315b['account'][_0xde7e('0x7e')];}if(_0x50315b[_0xde7e('0x7f')][_0xde7e('0x7a')]&&_0x50315b[_0xde7e('0x7f')][_0xde7e('0x7a')][_0xde7e('0x7b')]['length']){return _0x50315b[_0xde7e('0x7f')][_0xde7e('0x7a')]['Contacts'][0x0];}var _0x2c1967=_[_0xde7e('0x16')](_0x5d4415['body'],{'firstName':_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x73')],'ListId':_0x402e6e[_0xde7e('0x72')]});_0x2c1967[_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x77')]]=_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x73')];return db[_0xde7e('0x6c')][_0xde7e('0x56')](_0x2c1967,{'fields':_0x4302b6,'raw':!![]});}})['then'](handleEntityNotFound(_0xf5f963,null))[_0xde7e('0x1d')](function(_0x6e52ed){_0x50315b[_0xde7e('0x84')]=_0x6e52ed;if(_0x6e52ed){var _0x14edb4={'ContactId':_0x6e52ed['id'],'OpenchannelAccountId':_0x5d4415[_0xde7e('0x50')]['id'],'from':(_0x6e52ed[_0xde7e('0x85')]||'')+'\x20'+(_0x6e52ed['lastName']||'')};var _0x3dc7d5={'OpenchannelAccountId':_0x5d4415[_0xde7e('0x50')]['id'],'closed':![]};if(_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x86')]){_0x3dc7d5[_0xde7e('0x86')]=_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x86')];return db[_0xde7e('0x87')][_0xde7e('0x55')]({'where':_0x3dc7d5})[_0xde7e('0x1d')](function(_0x64cab2){if(_0x64cab2){return[_0x64cab2,![]];}_0x14edb4[_0xde7e('0x86')]=_0x5d4415[_0xde7e('0x5c')]['threadId'];_0x14edb4['externalUrl']=_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x88')];return db[_0xde7e('0x87')]['create'](_0x14edb4)[_0xde7e('0x1d')](function(_0x1b4ba2){return[_0x1b4ba2,!![]];});});}else{_0x3dc7d5[_0xde7e('0x86')]=null;}_0x3dc7d5[_0xde7e('0x89')]=_0x6e52ed['id'];return db[_0xde7e('0x87')][_0xde7e('0x55')]({'where':_0x3dc7d5})[_0xde7e('0x1d')](function(_0x2330cb){if(_0x2330cb){return[_0x2330cb,![]];}return db[_0xde7e('0x87')][_0xde7e('0x56')](_0x14edb4)[_0xde7e('0x1d')](function(_0x2ff0f1){return[_0x2ff0f1,!![]];});});}})[_0xde7e('0x8a')](function(_0x121845,_0x6a0e21){if(_0x121845){_0x3ab125=_0x6a0e21;if(!_0x6a0e21){var _0x17b826={'from':(_0x50315b['contact'][_0xde7e('0x85')]||'')+'\x20'+(_0x50315b[_0xde7e('0x84')]['lastName']||'')};if(_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x86')]&&_0x5d4415[_0xde7e('0x5c')]['messageId']&&_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x86')]!=_0x5d4415['body']['messageId']){_0x17b826[_0xde7e('0x86')]=_0x5d4415['body'][_0xde7e('0x8b')];}return _0x121845[_0xde7e('0x32')](_0x17b826);}else{return _0x121845;}}})[_0xde7e('0x1d')](function(_0x119b30){_0x50315b[_0xde7e('0x8c')]=_0x119b30[_0xde7e('0x34')]({'plain':!![]});_0x50315b['interaction'][_0xde7e('0x8d')]=_0x3ab125;if(_0x50315b['interaction'][_0xde7e('0x8d')]){if(_0x50315b[_0xde7e('0x7f')][_0xde7e('0x8e')]){_0x50315b['applications']['push']({'id':0x0,'priority':_0x50315b[_0xde7e('0x80')][_0xde7e('0x53')]+0x1,'app':_0xde7e('0x8f'),'appdata':_0xde7e('0x90'),'interval':_0xde7e('0x91')});}}return db[_0xde7e('0x92')][_0xde7e('0x56')]({'body':_0x5d4415[_0xde7e('0x5c')][_0xde7e('0x5c')],'OpenchannelAccountId':_0x5d4415[_0xde7e('0x50')]['id'],'OpenchannelInteractionId':_0x119b30['id'],'direction':'in','ContactId':_0x50315b[_0xde7e('0x84')]['id'],'AttachmentId':_0x5d4415[_0xde7e('0x5c')]['AttachmentId']});})[_0xde7e('0x1d')](function(_0x165bb9){_0x50315b[_0xde7e('0x23')]=_0x165bb9;if(_0x50315b[_0xde7e('0x8c')]['UserId']){return db[_0xde7e('0x93')]['find']({'attributes':['id',_0xde7e('0x38')],'where':{'id':_0x50315b['interaction'][_0xde7e('0x94')]}})[_0xde7e('0x1d')](function(_0x11639b){if(_0x11639b){_0x50315b[_0xde7e('0x80')][_0xde7e('0x95')]({'id':0x0,'priority':0x0,'app':_0xde7e('0x96'),'appdata':_0x11639b[_0xde7e('0x38')]+','+(_0x50315b[_0xde7e('0x7f')]['waitForTheAssignedAgent']||0xa),'interval':_0xde7e('0x91')});_0x50315b[_0xde7e('0x97')]=![];}return respondWithRpcPromise(_0xde7e('0x98'),_0xde7e('0x99'),_0x50315b);});}return respondWithRpcPromise(_0xde7e('0x98'),_0xde7e('0x99'),_0x50315b);})[_0xde7e('0x1d')](function(_0x546c1b){respondWithRpcPromise(_0xde7e('0x9a'),'EventManager',{'event':_0xde7e('0x6a'),'message':_0x546c1b},client9002);return _0x546c1b;})['then'](respondWithResult(_0xf5f963,null))[_0xde7e('0x26')](handleError(_0xf5f963,null));};exports['addApplications']=function(_0x45f706,_0x3681fc,_0x17889a){return db[_0xde7e('0x3b')][_0xde7e('0x61')]({'where':{'id':_0x45f706[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x3681fc,null))[_0xde7e('0x1d')](function(_0x55f2a0){if(_0x55f2a0){return db['sequelize']['transaction'](function(_0x449d39){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x45f706['params']['id']},'transaction':_0x449d39})[_0xde7e('0x1d')](function(_0x92af6e){var _0x23b184=_[_0xde7e('0x3a')](_0x45f706[_0xde7e('0x5c')],function(_0x19a521){_0x19a521[_0xde7e('0x63')]=_0x45f706[_0xde7e('0x50')]['id'];return _0x19a521;});return db['OpenchannelApplication'][_0xde7e('0x9b')](_0x23b184,{'transaction':_0x449d39});});})['then'](function(){return db[_0xde7e('0x7d')][_0xde7e('0x9c')]({'where':{'OpenchannelAccountId':_0x45f706[_0xde7e('0x50')]['id']},'order':_0xde7e('0x82')});});}})[_0xde7e('0x1d')](respondWithResult(_0x3681fc,null))['catch'](handleError(_0x3681fc,null));};exports[_0xde7e('0x9d')]=function(_0x3d0303,_0x1c6f70,_0x1b3c61){var _0x38ba15={};var _0x399b0d={};var _0x56981f;var _0x438429;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x3d0303[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x1c6f70,null))[_0xde7e('0x1d')](function(_0x4178e8){if(_0x4178e8){_0x56981f=_0x4178e8;_0x399b0d[_0xde7e('0x3e')]=_['keys'](db[_0xde7e('0x7d')]['rawAttributes']);_0x399b0d['query']=_['keys'](_0x3d0303['query']);_0x399b0d[_0xde7e('0x40')]=_[_0xde7e('0x41')](_0x399b0d[_0xde7e('0x3e')],_0x399b0d['query']);_0x38ba15['attributes']=_['intersection'](_0x399b0d[_0xde7e('0x3e')],qs[_0xde7e('0x42')](_0x3d0303[_0xde7e('0x3f')][_0xde7e('0x42')]));_0x38ba15['attributes']=_0x38ba15[_0xde7e('0x43')]['length']?_0x38ba15[_0xde7e('0x43')]:_0x399b0d[_0xde7e('0x3e')];_0x38ba15[_0xde7e('0x68')]=qs['sort'](_0x3d0303[_0xde7e('0x3f')][_0xde7e('0x45')]);_0x38ba15[_0xde7e('0x47')]=qs[_0xde7e('0x40')](_[_0xde7e('0x46')](_0x3d0303[_0xde7e('0x3f')],_0x399b0d['filters']));if(_0x3d0303[_0xde7e('0x3f')][_0xde7e('0x4a')]){_0x38ba15['where']=_['merge'](_0x38ba15[_0xde7e('0x47')],{'$or':_[_0xde7e('0x3a')](_0x38ba15[_0xde7e('0x43')],function(_0x73fd83){var _0x15d916={};_0x15d916[_0x73fd83]={'$like':'%'+_0x3d0303[_0xde7e('0x3f')][_0xde7e('0x4a')]+'%'};return _0x15d916;})});}_0x38ba15=_['merge']({},_0x38ba15,_0x3d0303[_0xde7e('0x4b')]);return _0x56981f[_0xde7e('0x9d')](_0x38ba15);}})[_0xde7e('0x1d')](function(_0x258fdf){if(_0x258fdf){_0x438429=_0x258fdf[_0xde7e('0x53')];if(!_0x3d0303[_0xde7e('0x3f')][_0xde7e('0x44')](_0xde7e('0x62'))){_0x38ba15[_0xde7e('0x2d')]=qs[_0xde7e('0x2d')](_0x3d0303[_0xde7e('0x3f')]['limit']);_0x38ba15[_0xde7e('0x2c')]=qs[_0xde7e('0x2c')](_0x3d0303[_0xde7e('0x3f')][_0xde7e('0x2c')]);}return _0x56981f[_0xde7e('0x9d')](_0x38ba15);}})['then'](function(_0x315572){if(_0x315572){return _0x315572?{'count':_0x438429,'rows':_0x315572}:null;}})['then'](respondWithResult(_0x1c6f70,null))[_0xde7e('0x26')](handleError(_0x1c6f70,null));};exports[_0xde7e('0x9e')]=function(_0x48f71b,_0x39b7be,_0x46b38f){var _0x2f3b79={'raw':![],'where':{}};var _0x301124={};var _0x4bad02={'count':0x0,'rows':[]};return db[_0xde7e('0x3b')][_0xde7e('0x61')]({'where':{'id':_0x48f71b[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x39b7be,null))[_0xde7e('0x1d')](function(_0x29b828){if(_0x29b828){_0x301124[_0xde7e('0x3e')]=_['keys'](db[_0xde7e('0x87')][_0xde7e('0x3c')]);_0x301124['query']=_[_0xde7e('0x52')](_0x48f71b[_0xde7e('0x3f')]);_0x301124['filters']=_['intersection'](_0x301124[_0xde7e('0x3e')],_0x301124[_0xde7e('0x3f')]);_0x2f3b79['attributes']=_[_0xde7e('0x41')](_0x301124[_0xde7e('0x3e')],qs[_0xde7e('0x42')](_0x48f71b['query'][_0xde7e('0x42')]));_0x2f3b79[_0xde7e('0x43')]=_0x2f3b79[_0xde7e('0x43')][_0xde7e('0x53')]?_0x2f3b79[_0xde7e('0x43')]:_0x301124[_0xde7e('0x3e')];if(!_0x48f71b[_0xde7e('0x3f')][_0xde7e('0x44')](_0xde7e('0x62'))){_0x2f3b79[_0xde7e('0x2d')]=qs['limit'](_0x48f71b[_0xde7e('0x3f')][_0xde7e('0x2d')]);_0x2f3b79[_0xde7e('0x2c')]=qs[_0xde7e('0x2c')](_0x48f71b[_0xde7e('0x3f')][_0xde7e('0x2c')]);}_0x2f3b79[_0xde7e('0x68')]=qs[_0xde7e('0x45')](_0x48f71b[_0xde7e('0x3f')][_0xde7e('0x45')]);_0x2f3b79[_0xde7e('0x47')]=qs[_0xde7e('0x40')](_[_0xde7e('0x46')](_0x48f71b[_0xde7e('0x3f')],_0x301124[_0xde7e('0x40')]));_0x2f3b79[_0xde7e('0x47')]['OpenchannelAccountId']=_0x29b828['id'];if(_0x48f71b[_0xde7e('0x3f')][_0xde7e('0x4a')]){_0x2f3b79[_0xde7e('0x47')]=_[_0xde7e('0x48')](_0x2f3b79['where'],{'$or':_[_0xde7e('0x3a')](_0x2f3b79['attributes'],function(_0x5de3ba){var _0x50d5b8={};_0x50d5b8[_0x5de3ba]={'$like':'%'+_0x48f71b[_0xde7e('0x3f')][_0xde7e('0x4a')]+'%'};return _0x50d5b8;})});}_0x2f3b79=_[_0xde7e('0x48')]({},_0x2f3b79,_0x48f71b['options']);return db[_0xde7e('0x87')]['count']({'where':_0x2f3b79['where']})['then'](function(_0x581ca5){_0x4bad02[_0xde7e('0x2b')]=_0x581ca5;if(_0x48f71b['query'][_0xde7e('0x54')]){_0x2f3b79[_0xde7e('0x4c')]=[{'model':db[_0xde7e('0x6c')],'as':_0xde7e('0x9f'),'required':![]},{'model':db[_0xde7e('0x93')],'as':_0xde7e('0xa0'),'attributes':['name',_0xde7e('0xa1'),_0xde7e('0xa2')],'required':![]},{'model':db[_0xde7e('0xa3')],'as':_0xde7e('0xa4'),'attributes':['id',_0xde7e('0x38'),_0xde7e('0xa5')],'where':_0x48f71b[_0xde7e('0x3f')][_0xde7e('0xa6')]?{'id':_0x48f71b[_0xde7e('0x3f')][_0xde7e('0xa6')]}:undefined,'required':_0x48f71b['query'][_0xde7e('0xa6')]?!![]:![]}];}return db[_0xde7e('0x87')]['findAll'](_0x2f3b79);})[_0xde7e('0x1d')](function(_0x449b2f){_0x4bad02[_0xde7e('0x4e')]=_0x449b2f;return _0x4bad02;});}})[_0xde7e('0x1d')](respondWithFilteredResult(_0x39b7be,_0x2f3b79))[_0xde7e('0x26')](handleError(_0x39b7be,null));};exports[_0xde7e('0xa7')]=function(_0x44311b,_0xa4eade,_0x2bbb8d){return db[_0xde7e('0x3b')][_0xde7e('0x55')]({'where':{'id':_0x44311b['params']['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0xa4eade,null))['then'](function(_0x2718df){if(_0x2718df){return _0x2718df[_0xde7e('0xa7')](_0x44311b[_0xde7e('0x5c')]['ids'],_[_0xde7e('0xa8')](_0x44311b[_0xde7e('0x5c')],[_0xde7e('0x65'),'id'])||{})['spread'](function(_0x254e40){for(var _0x44ab2a=0x0;_0x44ab2a<_0x44311b[_0xde7e('0x5c')][_0xde7e('0x65')][_0xde7e('0x53')];_0x44ab2a+=0x1){socket[_0xde7e('0xa9')](_0xde7e('0xaa'),{'UserId':_0x44311b['body'][_0xde7e('0x65')][_0x44ab2a],'OpenchannelAccountId':_0x44311b[_0xde7e('0x50')]['id']});}return _0x254e40;});}})[_0xde7e('0x1d')](respondWithResult(_0xa4eade,null))[_0xde7e('0x26')](handleError(_0xa4eade,null));};exports[_0xde7e('0xab')]=function(_0x1ef08e,_0x286449,_0x476a7d){return db['OpenchannelAccount'][_0xde7e('0x55')]({'where':{'id':_0x1ef08e[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x286449,null))['then'](function(_0x1119e1){if(_0x1119e1){return _0x1119e1[_0xde7e('0xab')](_0x1ef08e[_0xde7e('0x3f')][_0xde7e('0x65')])[_0xde7e('0x1d')](function(){if(_[_0xde7e('0xac')](_0x1ef08e[_0xde7e('0x3f')][_0xde7e('0x65')])){for(var _0x5eb827=0x0;_0x5eb827<_0x1ef08e['query']['ids']['length'];_0x5eb827+=0x1){socket[_0xde7e('0xa9')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1ef08e[_0xde7e('0x3f')][_0xde7e('0x65')][_0x5eb827]),'OpenchannelAccountId':Number(_0x1ef08e[_0xde7e('0x50')]['id'])});}}else{socket[_0xde7e('0xa9')](_0xde7e('0xad'),{'UserId':Number(_0x1ef08e[_0xde7e('0x3f')]['ids']),'OpenchannelAccountId':Number(_0x1ef08e[_0xde7e('0x50')]['id'])});}});}})[_0xde7e('0x1d')](respondWithStatusCode(_0x286449,null))[_0xde7e('0x26')](handleError(_0x286449,null));};exports[_0xde7e('0xae')]=function(_0x241688,_0x39fe91,_0x151a37){var _0x311e43={};var _0xd7a053={};var _0x1fb9d6;var _0x4416e2;return db[_0xde7e('0x3b')][_0xde7e('0x61')]({'where':{'id':_0x241688[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x39fe91,null))[_0xde7e('0x1d')](function(_0x23ae73){if(_0x23ae73){_0x1fb9d6=_0x23ae73;_0xd7a053['model']=_[_0xde7e('0x52')](db['User'][_0xde7e('0x3c')]);_0xd7a053[_0xde7e('0x3f')]=_[_0xde7e('0x52')](_0x241688[_0xde7e('0x3f')]);_0xd7a053[_0xde7e('0x40')]=_[_0xde7e('0x41')](_0xd7a053[_0xde7e('0x3e')],_0xd7a053['query']);_0x311e43[_0xde7e('0x43')]=_[_0xde7e('0x41')](_0xd7a053['model'],qs[_0xde7e('0x42')](_0x241688[_0xde7e('0x3f')][_0xde7e('0x42')]));_0x311e43[_0xde7e('0x43')]=_0x311e43[_0xde7e('0x43')]['length']?_0x311e43[_0xde7e('0x43')]:_0xd7a053[_0xde7e('0x3e')];_0x311e43[_0xde7e('0x68')]=qs['sort'](_0x241688[_0xde7e('0x3f')][_0xde7e('0x45')]);_0x311e43['where']=qs[_0xde7e('0x40')](_[_0xde7e('0x46')](_0x241688['query'],_0xd7a053[_0xde7e('0x40')]));if(_0x241688[_0xde7e('0x3f')][_0xde7e('0x4a')]){_0x311e43['where']=_[_0xde7e('0x48')](_0x311e43[_0xde7e('0x47')],{'$or':_['map'](_0x311e43['attributes'],function(_0x44cff6){var _0x2680e9={};_0x2680e9[_0x44cff6]={'$like':'%'+_0x241688[_0xde7e('0x3f')][_0xde7e('0x4a')]+'%'};return _0x2680e9;})});}_0x311e43=_[_0xde7e('0x48')]({},_0x311e43,_0x241688[_0xde7e('0x4b')]);return _0x1fb9d6[_0xde7e('0xae')](_0x311e43);}})['then'](function(_0x52249d){if(_0x52249d){_0x4416e2=_0x52249d[_0xde7e('0x53')];if(!_0x241688[_0xde7e('0x3f')]['hasOwnProperty'](_0xde7e('0x62'))){_0x311e43[_0xde7e('0x2d')]=qs[_0xde7e('0x2d')](_0x241688[_0xde7e('0x3f')][_0xde7e('0x2d')]);_0x311e43[_0xde7e('0x2c')]=qs[_0xde7e('0x2c')](_0x241688[_0xde7e('0x3f')][_0xde7e('0x2c')]);}return _0x1fb9d6[_0xde7e('0xae')](_0x311e43);}})[_0xde7e('0x1d')](function(_0x257702){if(_0x257702){return _0x257702?{'count':_0x4416e2,'rows':_0x257702}:null;}})[_0xde7e('0x1d')](respondWithResult(_0x39fe91,null))[_0xde7e('0x26')](handleError(_0x39fe91,null));};exports[_0xde7e('0xaf')]=function(_0x25384c,_0x58dff8,_0x52b829){var _0x43e53c,_0x4ef094,_0x3c4d51;if(_['isNil'](_0x25384c['body']['body'])||_0x25384c[_0xde7e('0x5c')]['body']===''){throw new db[(_0xde7e('0x74'))]['ValidationError'](_0xde7e('0xb0'));}if(_['isNil'](_0x25384c[_0xde7e('0x5c')]['to'])){}_0x43e53c=_0x25384c['body']['to'];return db[_0xde7e('0x3b')]['findOne']({'where':{'id':_0x25384c[_0xde7e('0x50')]['id']}})[_0xde7e('0x1d')](handleEntityNotFound(_0x58dff8,null))['then'](function(_0x18054b){if(_0x18054b){return db[_0xde7e('0x3b')][_0xde7e('0x55')]({'where':{'id':_0x18054b['id']},'include':[{'model':db[_0xde7e('0xb1')],'as':_0xde7e('0x7a'),'include':[{'model':db[_0xde7e('0x6c')],'as':_0xde7e('0x7b'),'where':{[_0x18054b['mapKey']]:_0x43e53c},'limit':0x1,'order':[[_0xde7e('0x70'),_0xde7e('0x7c')]]}]}]})[_0xde7e('0x1d')](handleEntityNotFound(_0x58dff8,null))[_0xde7e('0x1d')](function(_0x5b9b8c){if(_0x5b9b8c&&_0x5b9b8c[_0xde7e('0x7a')]){_0x4ef094=_0x5b9b8c[_0xde7e('0x34')]({'plain':!![]});if(_0x4ef094['List']&&_0x4ef094['List']['Contacts'][_0xde7e('0x53')]){return _0x4ef094['List'][_0xde7e('0x7b')][0x0];}return db[_0xde7e('0x6c')][_0xde7e('0x56')](_['defaults'](_0x25384c[_0xde7e('0x5c')],{'firstName':_0x43e53c,[_0x5b9b8c[_0xde7e('0x77')]]:_0x43e53c,'phone':_0x43e53c,'ListId':_0x4ef094['ListId']}));}})['then'](handleEntityNotFound(_0x58dff8,null))['then'](function(_0x4446c4){if(_0x4446c4){_0x3c4d51=_0x4446c4;return db[_0xde7e('0x87')][_0xde7e('0x55')]({'where':{'ContactId':_0x3c4d51['id'],'closed':![],'OpenchannelAccountId':_0x4ef094['id']}})[_0xde7e('0x1d')](function(_0x13afaa){if(_0x13afaa){return[_0x13afaa,![]];}return db[_0xde7e('0x87')][_0xde7e('0x56')]({'UserId':_0x25384c[_0xde7e('0x57')]['id'],'ContactId':_0x3c4d51['id'],'OpenchannelAccountId':_0x4ef094['id'],'lastMsgDirection':_0xde7e('0xb2'),'Messages':[_[_0xde7e('0x48')](_0x25384c[_0xde7e('0x5c')],{'read':![],'body':_0x25384c[_0xde7e('0x5c')]['body'],'OpenchannelAccountId':_0x4ef094['id'],'UserId':_0x25384c['user']['id'],'ContactId':_0x3c4d51['id']})]},{'include':[{'model':db[_0xde7e('0x92')],'as':'Messages'}]})[_0xde7e('0x1d')](function(_0x424519){return[_0x424519,!![]];});});}})[_0xde7e('0x8a')](function(_0x586f14,_0x276277){if(_0x276277){return _0x586f14;}return db[_0xde7e('0x92')]['create'](_[_0xde7e('0x48')](_0x25384c[_0xde7e('0x5c')],{'read':![],'body':_0x25384c[_0xde7e('0x5c')][_0xde7e('0x5c')],'OpenchannelAccountId':_0x4ef094['id'],'OpenchannelInteractionId':_0x586f14['id'],'UserId':_0x25384c['user']['id'],'ContactId':_0x3c4d51['id']}))['then'](function(_0x262208){_0x586f14[_0xde7e('0xb3')][_0xde7e('0xb4')]=[];_0x586f14[_0xde7e('0xb3')][_0xde7e('0xb4')]['push'](_0x262208[_0xde7e('0xb3')]);return _0x586f14;});});}})['then'](respondWithResult(_0x58dff8,null))[_0xde7e('0x26')](handleError(_0x58dff8,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index e0135a0..b839789 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 _0x0ef3=['save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ef3,0x86));var _0x30ef=function(_0x5f3309,_0x37871b){_0x5f3309=_0x5f3309-0x0;var _0xea65ec=_0x0ef3[_0x5f3309];return _0xea65ec;};'use strict';var EventEmitter=require(_0x30ef('0x0'));var OpenchannelAccount=require(_0x30ef('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x30ef('0x2'),'afterUpdate':_0x30ef('0x3'),'afterDestroy':_0x30ef('0x4')};function emitEvent(_0x4d446c){return function(_0x567299,_0x588f80,_0x38d356){OpenchannelAccountEvents['emit'](_0x4d446c+':'+_0x567299['id'],_0x567299);OpenchannelAccountEvents['emit'](_0x4d446c,_0x567299);_0x38d356(null);};}for(var e in events){if(events[_0x30ef('0x5')](e)){var event=events[e];OpenchannelAccount[_0x30ef('0x6')](e,emitEvent(event));}}module[_0x30ef('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xe341=['emit','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x3c1018,_0x464dcc){var _0x5bc464=function(_0x56e08e){while(--_0x56e08e){_0x3c1018['push'](_0x3c1018['shift']());}};_0x5bc464(++_0x464dcc);}(_0xe341,0x137));var _0x1e34=function(_0x40a24b,_0x5edc5e){_0x40a24b=_0x40a24b-0x0;var _0x306e3b=_0xe341[_0x40a24b];return _0x306e3b;};'use strict';var EventEmitter=require(_0x1e34('0x0'));var OpenchannelAccount=require(_0x1e34('0x1'))['db'][_0x1e34('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x1e34('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x30a38c){return function(_0x9b0229,_0x2832ca,_0xf77958){OpenchannelAccountEvents['emit'](_0x30a38c+':'+_0x9b0229['id'],_0x9b0229);OpenchannelAccountEvents[_0x1e34('0x4')](_0x30a38c,_0x9b0229);_0xf77958(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x1e34('0x5')](e,emitEvent(event));}}module[_0x1e34('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 78f1755..552d2c3 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 _0x5c91=['bluebird','request-promise','path','rimraf','./openchannelAccount.attributes','OpenchannelAccount','openchannel_accounts','lodash','util','api'];(function(_0x3c34b4,_0x250dc1){var _0x12d7de=function(_0x31d195){while(--_0x31d195){_0x3c34b4['push'](_0x3c34b4['shift']());}};_0x12d7de(++_0x250dc1);}(_0x5c91,0xed));var _0x15c9=function(_0x116ada,_0x1e58ac){_0x116ada=_0x116ada-0x0;var _0x4d52ef=_0x5c91[_0x116ada];return _0x4d52ef;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var logger=require('../../config/logger')(_0x15c9('0x2'));var moment=require('moment');var BPromise=require(_0x15c9('0x3'));var rp=require(_0x15c9('0x4'));var fs=require('fs');var path=require(_0x15c9('0x5'));var rimraf=require(_0x15c9('0x6'));var config=require('../../config/environment');var attributes=require(_0x15c9('0x7'));module['exports']=function(_0x2930cb,_0x7c2403){return _0x2930cb['define'](_0x15c9('0x8'),attributes,{'tableName':_0x15c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2dd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util'];(function(_0x870817,_0x4ed7bc){var _0x4880e4=function(_0x3df467){while(--_0x3df467){_0x870817['push'](_0x870817['shift']());}};_0x4880e4(++_0x4ed7bc);}(_0xa2dd,0x11c));var _0xda2d=function(_0x3da628,_0x136ab8){_0x3da628=_0x3da628-0x0;var _0x169270=_0xa2dd[_0x3da628];return _0x169270;};'use strict';var _=require(_0xda2d('0x0'));var util=require(_0xda2d('0x1'));var logger=require(_0xda2d('0x2'))(_0xda2d('0x3'));var moment=require(_0xda2d('0x4'));var BPromise=require(_0xda2d('0x5'));var rp=require(_0xda2d('0x6'));var fs=require('fs');var path=require(_0xda2d('0x7'));var rimraf=require(_0xda2d('0x8'));var config=require('../../config/environment');var attributes=require(_0xda2d('0x9'));module[_0xda2d('0xa')]=function(_0x1f3115,_0x579d24){return _0x1f3115[_0xda2d('0xb')](_0xda2d('0xc'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index e5b70d6..c9602d1 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 _0xfb68=['OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','then','info'];(function(_0x3fbd6a,_0x49c430){var _0x4e6f60=function(_0x49e3d5){while(--_0x49e3d5){_0x3fbd6a['push'](_0x3fbd6a['shift']());}};_0x4e6f60(++_0x49c430);}(_0xfb68,0x95));var _0x8fb6=function(_0x2f8594,_0x13e4b8){_0x2f8594=_0x2f8594-0x0;var _0x23abd2=_0xfb68[_0x2f8594];return _0x23abd2;};'use strict';var _=require(_0x8fb6('0x0'));var util=require('util');var moment=require(_0x8fb6('0x1'));var BPromise=require(_0x8fb6('0x2'));var rs=require(_0x8fb6('0x3'));var fs=require('fs');var Redis=require(_0x8fb6('0x4'));var db=require(_0x8fb6('0x5'))['db'];var utils=require(_0x8fb6('0x6'));var logger=require(_0x8fb6('0x7'))(_0x8fb6('0x8'));var config=require('../../config/environment');var jayson=require(_0x8fb6('0x9'));var client=jayson[_0x8fb6('0xa')][_0x8fb6('0xb')]({'port':0x232a});config[_0x8fb6('0xc')]=_[_0x8fb6('0xd')](config[_0x8fb6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fb6('0xe'))(new Redis(config[_0x8fb6('0xc')]));require(_0x8fb6('0xf'))[_0x8fb6('0x10')](socket);function respondWithRpcPromise(_0x2ed144,_0x5a2d46,_0x2890c4){return new BPromise(function(_0x229eca,_0x5d8bb7){return client['request'](_0x2ed144,_0x2890c4)[_0x8fb6('0x11')](function(_0x12949f){logger[_0x8fb6('0x12')](_0x8fb6('0x13'),_0x5a2d46,_0x8fb6('0x14'));logger[_0x8fb6('0x15')](_0x8fb6('0x16'),_0x5a2d46,_0x8fb6('0x14'),JSON[_0x8fb6('0x17')](_0x12949f));if(_0x12949f[_0x8fb6('0x18')]){if(_0x12949f[_0x8fb6('0x18')][_0x8fb6('0x19')]===0x1f4){logger['error'](_0x8fb6('0x13'),_0x5a2d46,_0x12949f['error'][_0x8fb6('0x1a')]);return _0x5d8bb7(_0x12949f['error'][_0x8fb6('0x1a')]);}logger[_0x8fb6('0x18')](_0x8fb6('0x13'),_0x5a2d46,_0x12949f[_0x8fb6('0x18')][_0x8fb6('0x1a')]);return _0x229eca(_0x12949f['error'][_0x8fb6('0x1a')]);}else{logger['info'](_0x8fb6('0x13'),_0x5a2d46,'request\x20sent');_0x229eca(_0x12949f['result']['message']);}})[_0x8fb6('0x1b')](function(_0x333805){logger[_0x8fb6('0x18')](_0x8fb6('0x13'),_0x5a2d46,_0x333805);_0x5d8bb7(_0x333805);});});} \ No newline at end of file +var _0x0363=['OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then'];(function(_0x5cbf02,_0x53f105){var _0x441bf4=function(_0x4afa22){while(--_0x4afa22){_0x5cbf02['push'](_0x5cbf02['shift']());}};_0x441bf4(++_0x53f105);}(_0x0363,0x78));var _0x3036=function(_0x511dd6,_0x5d294d){_0x511dd6=_0x511dd6-0x0;var _0x39f16b=_0x0363[_0x511dd6];return _0x39f16b;};'use strict';var _=require(_0x3036('0x0'));var util=require(_0x3036('0x1'));var moment=require(_0x3036('0x2'));var BPromise=require(_0x3036('0x3'));var rs=require(_0x3036('0x4'));var fs=require('fs');var Redis=require(_0x3036('0x5'));var db=require(_0x3036('0x6'))['db'];var utils=require(_0x3036('0x7'));var logger=require(_0x3036('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3036('0x9'));var client=jayson[_0x3036('0xa')][_0x3036('0xb')]({'port':0x232a});config[_0x3036('0xc')]=_[_0x3036('0xd')](config['redis'],{'host':_0x3036('0xe'),'port':0x18eb});var socket=require(_0x3036('0xf'))(new Redis(config[_0x3036('0xc')]));require(_0x3036('0x10'))[_0x3036('0x11')](socket);function respondWithRpcPromise(_0x45e0de,_0xc3e06b,_0x1ca0e4){return new BPromise(function(_0x2c0685,_0x4fe098){return client[_0x3036('0x12')](_0x45e0de,_0x1ca0e4)[_0x3036('0x13')](function(_0x9ce7ac){logger['info'](_0x3036('0x14'),_0xc3e06b,'request\x20sent');logger[_0x3036('0x15')](_0x3036('0x16'),_0xc3e06b,_0x3036('0x17'),JSON['stringify'](_0x9ce7ac));if(_0x9ce7ac[_0x3036('0x18')]){if(_0x9ce7ac[_0x3036('0x18')][_0x3036('0x19')]===0x1f4){logger[_0x3036('0x18')](_0x3036('0x14'),_0xc3e06b,_0x9ce7ac['error'][_0x3036('0x1a')]);return _0x4fe098(_0x9ce7ac['error'][_0x3036('0x1a')]);}logger[_0x3036('0x18')](_0x3036('0x14'),_0xc3e06b,_0x9ce7ac[_0x3036('0x18')][_0x3036('0x1a')]);return _0x2c0685(_0x9ce7ac[_0x3036('0x18')]['message']);}else{logger['info'](_0x3036('0x14'),_0xc3e06b,_0x3036('0x17'));_0x2c0685(_0x9ce7ac[_0x3036('0x1b')]['message']);}})['catch'](function(_0x201dc4){logger[_0x3036('0x18')](_0x3036('0x14'),_0xc3e06b,_0x201dc4);_0x4fe098(_0x201dc4);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 89a953d..6e9a85c 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 _0xef29=['removeListener','register','openchannelAccount:','./openchannelAccount.events','save','remove','update','emit'];(function(_0x4043eb,_0x110b02){var _0x30139e=function(_0x550597){while(--_0x550597){_0x4043eb['push'](_0x4043eb['shift']());}};_0x30139e(++_0x110b02);}(_0xef29,0x1b3));var _0x9ef2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xef29[_0x4565bf];return _0x5610ba;};'use strict';var OpenchannelAccountEvents=require(_0x9ef2('0x0'));var events=[_0x9ef2('0x1'),_0x9ef2('0x2'),_0x9ef2('0x3')];function createListener(_0x3065b9,_0x536e41){return function(_0x464bec){_0x536e41[_0x9ef2('0x4')](_0x3065b9,_0x464bec);};}function removeListener(_0x1528b4,_0xc66d98){return function(){OpenchannelAccountEvents[_0x9ef2('0x5')](_0x1528b4,_0xc66d98);};}exports[_0x9ef2('0x6')]=function(_0x5b70de){for(var _0x18d1b3=0x0,_0x218ad4=events['length'];_0x18d1b3<_0x218ad4;_0x18d1b3++){var _0x287726=events[_0x18d1b3];var _0x2c447c=createListener(_0x9ef2('0x7')+_0x287726,_0x5b70de);OpenchannelAccountEvents['on'](_0x287726,_0x2c447c);}}; \ No newline at end of file +var _0xff8f=['remove','update','emit','removeListener','register','length','./openchannelAccount.events','save'];(function(_0x53e398,_0x5b23d9){var _0x1690cd=function(_0x1e3dee){while(--_0x1e3dee){_0x53e398['push'](_0x53e398['shift']());}};_0x1690cd(++_0x5b23d9);}(_0xff8f,0x8e));var _0xfff8=function(_0x45b872,_0x5d3a69){_0x45b872=_0x45b872-0x0;var _0x2b4451=_0xff8f[_0x45b872];return _0x2b4451;};'use strict';var OpenchannelAccountEvents=require(_0xfff8('0x0'));var events=[_0xfff8('0x1'),_0xfff8('0x2'),_0xfff8('0x3')];function createListener(_0x302c1c,_0x3ec596){return function(_0x102c5c){_0x3ec596[_0xfff8('0x4')](_0x302c1c,_0x102c5c);};}function removeListener(_0x4c9bb8,_0xa77b3f){return function(){OpenchannelAccountEvents[_0xfff8('0x5')](_0x4c9bb8,_0xa77b3f);};}exports[_0xfff8('0x6')]=function(_0x35a668){for(var _0x453316=0x0,_0x33292e=events[_0xfff8('0x7')];_0x453316<_0x33292e;_0x453316++){var _0x1a8994=events[_0x453316];var _0x7f37dd=createListener('openchannelAccount:'+_0x1a8994,_0x35a668);OpenchannelAccountEvents['on'](_0x1a8994,_0x7f37dd);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c901f73..78d4e55 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 _0x116c=['destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','isAuthenticated','show','create','put','update','delete'];(function(_0x3c18e9,_0x29db38){var _0x377ca3=function(_0x7a6bcf){while(--_0x7a6bcf){_0x3c18e9['push'](_0x3c18e9['shift']());}};_0x377ca3(++_0x29db38);}(_0x116c,0x18e));var _0xc116=function(_0xc1e24e,_0x3867c5){_0xc1e24e=_0xc1e24e-0x0;var _0x1723b8=_0x116c[_0xc1e24e];return _0x1723b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc116('0x0'));var timeout=require(_0xc116('0x1'));var express=require(_0xc116('0x2'));var router=express[_0xc116('0x3')]();var auth=require(_0xc116('0x4'));var interaction=require(_0xc116('0x5'));var config=require(_0xc116('0x6'));var controller=require(_0xc116('0x7'));router[_0xc116('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc116('0x9'),auth[_0xc116('0xa')](),controller[_0xc116('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc116('0xc')]);router[_0xc116('0xd')](_0xc116('0x9'),auth[_0xc116('0xa')](),controller[_0xc116('0xe')]);router[_0xc116('0xf')](_0xc116('0x9'),auth['isAuthenticated'](),controller[_0xc116('0x10')]);module[_0xc116('0x11')]=router; \ No newline at end of file +var _0x66ee=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2c263d,_0x36dc1c){var _0x2f667b=function(_0x280366){while(--_0x280366){_0x2c263d['push'](_0x2c263d['shift']());}};_0x2f667b(++_0x36dc1c);}(_0x66ee,0x1e6));var _0xe66e=function(_0x59580b,_0x3bd264){_0x59580b=_0x59580b-0x0;var _0x4b1933=_0x66ee[_0x59580b];return _0x4b1933;};'use strict';var multer=require(_0xe66e('0x0'));var util=require(_0xe66e('0x1'));var path=require(_0xe66e('0x2'));var timeout=require(_0xe66e('0x3'));var express=require('express');var router=express[_0xe66e('0x4')]();var auth=require(_0xe66e('0x5'));var interaction=require(_0xe66e('0x6'));var config=require(_0xe66e('0x7'));var controller=require('./openchannelApplication.controller');router[_0xe66e('0x8')]('/',auth[_0xe66e('0x9')](),controller[_0xe66e('0xa')]);router[_0xe66e('0x8')](_0xe66e('0xb'),auth['isAuthenticated'](),controller[_0xe66e('0xc')]);router[_0xe66e('0xd')]('/',auth[_0xe66e('0x9')](),controller[_0xe66e('0xe')]);router[_0xe66e('0xf')]('/:id',auth[_0xe66e('0x9')](),controller[_0xe66e('0x10')]);router[_0xe66e('0x11')](_0xe66e('0xb'),auth[_0xe66e('0x9')](),controller[_0xe66e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c967706..cb2c3c0 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 _0xc65a=['sequelize','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x5b4acc,_0x3d714f){var _0x23a74f=function(_0x2daa5a){while(--_0x2daa5a){_0x5b4acc['push'](_0x5b4acc['shift']());}};_0x23a74f(++_0x3d714f);}(_0xc65a,0xfa));var _0xac65=function(_0x53562d,_0x495508){_0x53562d=_0x53562d-0x0;var _0x4018df=_0xc65a[_0x53562d];return _0x4018df;};'use strict';var Sequelize=require(_0xac65('0x0'));module['exports']={'priority':{'type':Sequelize[_0xac65('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xac65('0x2')]()},'description':{'type':Sequelize[_0xac65('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xac65('0x4')}}; \ No newline at end of file +var _0x37e9=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x597da3,_0x51b62b){var _0xd3cd83=function(_0x4a92df){while(--_0x4a92df){_0x597da3['push'](_0x597da3['shift']());}};_0xd3cd83(++_0x51b62b);}(_0x37e9,0x1f4));var _0x937e=function(_0x4c70c8,_0x17e81d){_0x4c70c8=_0x4c70c8-0x0;var _0x502c9a=_0x37e9[_0x4c70c8];return _0x502c9a;};'use strict';var Sequelize=require('sequelize');module[_0x937e('0x0')]={'priority':{'type':Sequelize[_0x937e('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x937e('0x2')],'allowNull':![],'defaultValue':_0x937e('0x3')},'appdata':{'type':Sequelize[_0x937e('0x4')]()},'description':{'type':Sequelize[_0x937e('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x937e('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index f826d48..346b757 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 _0x98af=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','map','VIRTUAL','count','includeAll','include','rows','catch','show','options','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','OpenchannelApplication'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98af,0x69));var _0xf98a=function(_0x3f4ba6,_0x35998a){_0x3f4ba6=_0x3f4ba6-0x0;var _0xb38f37=_0x98af[_0x3f4ba6];return _0xb38f37;};'use strict';var pdf=require(_0xf98a('0x0'));var emlformat=require(_0xf98a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf98a('0x2'));var jsonpatch=require(_0xf98a('0x3'));var rp=require('request-promise');var moment=require(_0xf98a('0x4'));var BPromise=require(_0xf98a('0x5'));var Mustache=require(_0xf98a('0x6'));var util=require(_0xf98a('0x7'));var path=require('path');var sox=require(_0xf98a('0x8'));var csv=require(_0xf98a('0x9'));var ejs=require(_0xf98a('0xa'));var fs=require('fs');var _=require(_0xf98a('0xb'));var squel=require(_0xf98a('0xc'));var crypto=require('crypto');var jsforce=require(_0xf98a('0xd'));var deskjs=require(_0xf98a('0xe'));var toCsv=require(_0xf98a('0x9'));var querystring=require(_0xf98a('0xf'));var Papa=require('papaparse');var Redis=require(_0xf98a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf98a('0x11'));var hardwareService=require(_0xf98a('0x12'));var logger=require(_0xf98a('0x13'))(_0xf98a('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf98a('0x15'))['db'];function respondWithStatusCode(_0xdb141,_0x1010bf){_0x1010bf=_0x1010bf||0xcc;return function(_0x14c068){if(_0x14c068){return _0xdb141[_0xf98a('0x16')](_0x1010bf);}return _0xdb141[_0xf98a('0x17')](_0x1010bf)['end']();};}function respondWithResult(_0x4dc9bf,_0x55e9d9){_0x55e9d9=_0x55e9d9||0xc8;return function(_0x10ec24){if(_0x10ec24){return _0x4dc9bf[_0xf98a('0x17')](_0x55e9d9)[_0xf98a('0x18')](_0x10ec24);}};}function respondWithFilteredResult(_0x39c2a2,_0x347548){return function(_0xa7b3bd){if(_0xa7b3bd){var _0x974d50=_0xa7b3bd['count'],_0x3c65f1=_0x347548[_0xf98a('0x19')],_0x2f5fb6=_0x347548[_0xf98a('0x19')]+_0x347548['limit'],_0x34a378;if(_0x2f5fb6>=_0x974d50){_0x2f5fb6=_0x974d50;_0x34a378=0xc8;}else{_0x34a378=0xce;}_0x39c2a2[_0xf98a('0x17')](_0x34a378);return _0x39c2a2[_0xf98a('0x1a')](_0xf98a('0x1b'),_0x3c65f1+'-'+_0x2f5fb6+'/'+_0x974d50)[_0xf98a('0x18')](_0xa7b3bd);}return null;};}function patchUpdates(_0x1a59ae){return function(_0x2eb65a){try{jsonpatch['apply'](_0x2eb65a,_0x1a59ae,!![]);}catch(_0x2ce178){return BPromise[_0xf98a('0x1c')](_0x2ce178);}return _0x2eb65a[_0xf98a('0x1d')]();};}function saveUpdates(_0x2aae7a,_0xd16368){return function(_0x467eb3){if(_0x467eb3){return _0x467eb3[_0xf98a('0x1e')](_0x2aae7a)[_0xf98a('0x1f')](function(_0x49a1af){return _0x49a1af;});}return null;};}function removeEntity(_0x4b74e7,_0x3e7527){return function(_0x68b966){if(_0x68b966){return _0x68b966[_0xf98a('0x20')]()[_0xf98a('0x1f')](function(){_0x4b74e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e3f2f,_0x2da4ea){return function(_0x1ba281){if(!_0x1ba281){_0x2e3f2f[_0xf98a('0x16')](0x194);}return _0x1ba281;};}function handleError(_0x5577ce,_0x3fcfe2){_0x3fcfe2=_0x3fcfe2||0x1f4;return function(_0x33892a){logger[_0xf98a('0x21')](_0x33892a[_0xf98a('0x22')]);if(_0x33892a['name']){delete _0x33892a[_0xf98a('0x23')];}_0x5577ce[_0xf98a('0x17')](_0x3fcfe2)[_0xf98a('0x24')](_0x33892a);};}exports[_0xf98a('0x25')]=function(_0x1a2ada,_0x52cbcf){var _0x5937b2={},_0x147a04={},_0x25bd20={'count':0x0,'rows':[]};var _0x5a1b76=_['map'](db[_0xf98a('0x26')][_0xf98a('0x27')],function(_0x454b9e){return{'name':_0x454b9e[_0xf98a('0x28')],'type':_0x454b9e[_0xf98a('0x29')][_0xf98a('0x2a')]};});_0x147a04[_0xf98a('0x2b')]=_['map'](_0x5a1b76,'name');_0x147a04[_0xf98a('0x2c')]=_[_0xf98a('0x2d')](_0x1a2ada['query']);_0x147a04[_0xf98a('0x2e')]=_[_0xf98a('0x2f')](_0x147a04[_0xf98a('0x2b')],_0x147a04[_0xf98a('0x2c')]);_0x5937b2['attributes']=_[_0xf98a('0x2f')](_0x147a04[_0xf98a('0x2b')],qs[_0xf98a('0x30')](_0x1a2ada[_0xf98a('0x2c')][_0xf98a('0x30')]));_0x5937b2['attributes']=_0x5937b2['attributes'][_0xf98a('0x31')]?_0x5937b2[_0xf98a('0x32')]:_0x147a04['model'];if(!_0x1a2ada[_0xf98a('0x2c')][_0xf98a('0x33')](_0xf98a('0x34'))){_0x5937b2[_0xf98a('0x35')]=qs['limit'](_0x1a2ada[_0xf98a('0x2c')]['limit']);_0x5937b2[_0xf98a('0x19')]=qs[_0xf98a('0x19')](_0x1a2ada[_0xf98a('0x2c')][_0xf98a('0x19')]);}_0x5937b2['order']=qs[_0xf98a('0x36')](_0x1a2ada[_0xf98a('0x2c')][_0xf98a('0x36')]);_0x5937b2['where']=qs[_0xf98a('0x2e')](_[_0xf98a('0x37')](_0x1a2ada[_0xf98a('0x2c')],_0x147a04['filters']),_0x5a1b76);if(_0x1a2ada[_0xf98a('0x2c')][_0xf98a('0x38')]){_0x5937b2[_0xf98a('0x39')]=_[_0xf98a('0x3a')](_0x5937b2[_0xf98a('0x39')],{'$or':_[_0xf98a('0x3b')](_0x5a1b76,function(_0x408195){if(_0x408195[_0xf98a('0x29')]!==_0xf98a('0x3c')){var _0x2989ff={};_0x2989ff[_0x408195[_0xf98a('0x23')]]={'$like':'%'+_0x1a2ada['query'][_0xf98a('0x38')]+'%'};return _0x2989ff;}})});}_0x5937b2=_[_0xf98a('0x3a')]({},_0x5937b2,_0x1a2ada['options']);var _0xb37025={'where':_0x5937b2['where']};return db['OpenchannelApplication'][_0xf98a('0x3d')](_0xb37025)['then'](function(_0x14412d){_0x25bd20[_0xf98a('0x3d')]=_0x14412d;if(_0x1a2ada[_0xf98a('0x2c')][_0xf98a('0x3e')]){_0x5937b2[_0xf98a('0x3f')]=[{'all':!![]}];}return db[_0xf98a('0x26')]['findAll'](_0x5937b2);})[_0xf98a('0x1f')](function(_0x186ff2){_0x25bd20[_0xf98a('0x40')]=_0x186ff2;return _0x25bd20;})[_0xf98a('0x1f')](respondWithFilteredResult(_0x52cbcf,_0x5937b2))[_0xf98a('0x41')](handleError(_0x52cbcf,null));};exports[_0xf98a('0x42')]=function(_0x387652,_0x44049e){var _0x58ab08={'raw':!![],'where':{'id':_0x387652['params']['id']}},_0xe7688e={};_0xe7688e[_0xf98a('0x2b')]=_[_0xf98a('0x2d')](db[_0xf98a('0x26')]['rawAttributes']);_0xe7688e['query']=_[_0xf98a('0x2d')](_0x387652[_0xf98a('0x2c')]);_0xe7688e[_0xf98a('0x2e')]=_[_0xf98a('0x2f')](_0xe7688e[_0xf98a('0x2b')],_0xe7688e['query']);_0x58ab08['attributes']=_[_0xf98a('0x2f')](_0xe7688e[_0xf98a('0x2b')],qs[_0xf98a('0x30')](_0x387652[_0xf98a('0x2c')][_0xf98a('0x30')]));_0x58ab08[_0xf98a('0x32')]=_0x58ab08[_0xf98a('0x32')]['length']?_0x58ab08['attributes']:_0xe7688e['model'];if(_0x387652[_0xf98a('0x2c')][_0xf98a('0x3e')]){_0x58ab08['include']=[{'all':!![]}];}_0x58ab08=_[_0xf98a('0x3a')]({},_0x58ab08,_0x387652[_0xf98a('0x43')]);return db[_0xf98a('0x26')][_0xf98a('0x44')](_0x58ab08)[_0xf98a('0x1f')](handleEntityNotFound(_0x44049e,null))['then'](respondWithResult(_0x44049e,null))[_0xf98a('0x41')](handleError(_0x44049e,null));};exports[_0xf98a('0x45')]=function(_0x92d257,_0x1f55dd){return db[_0xf98a('0x26')]['create'](_0x92d257[_0xf98a('0x46')],{})[_0xf98a('0x1f')](respondWithResult(_0x1f55dd,0xc9))[_0xf98a('0x41')](handleError(_0x1f55dd,null));};exports[_0xf98a('0x1e')]=function(_0x52b0d1,_0xb7dc87){if(_0x52b0d1['body']['id']){delete _0x52b0d1[_0xf98a('0x46')]['id'];}return db[_0xf98a('0x26')][_0xf98a('0x44')]({'where':{'id':_0x52b0d1[_0xf98a('0x47')]['id']}})[_0xf98a('0x1f')](handleEntityNotFound(_0xb7dc87,null))[_0xf98a('0x1f')](saveUpdates(_0x52b0d1[_0xf98a('0x46')],null))[_0xf98a('0x1f')](respondWithResult(_0xb7dc87,null))[_0xf98a('0x41')](handleError(_0xb7dc87,null));};exports[_0xf98a('0x20')]=function(_0x4451b3,_0x69e206){return db[_0xf98a('0x26')][_0xf98a('0x44')]({'where':{'id':_0x4451b3['params']['id']}})['then'](handleEntityNotFound(_0x69e206,null))[_0xf98a('0x1f')](removeEntity(_0x69e206,null))[_0xf98a('0x41')](handleError(_0x69e206,null));}; \ No newline at end of file +var _0x3bc3=['fields','length','model','hasOwnProperty','nolimit','limit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','OpenchannelApplication','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','intersection','attributes'];(function(_0x1fafd6,_0x46b419){var _0x45df97=function(_0x5a0de3){while(--_0x5a0de3){_0x1fafd6['push'](_0x1fafd6['shift']());}};_0x45df97(++_0x46b419);}(_0x3bc3,0x102));var _0x33bc=function(_0x5b78d8,_0x32d845){_0x5b78d8=_0x5b78d8-0x0;var _0x306bcb=_0x3bc3[_0x5b78d8];return _0x306bcb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x33bc('0x0'));var zipdir=require(_0x33bc('0x1'));var jsonpatch=require(_0x33bc('0x2'));var rp=require(_0x33bc('0x3'));var moment=require(_0x33bc('0x4'));var BPromise=require(_0x33bc('0x5'));var Mustache=require(_0x33bc('0x6'));var util=require(_0x33bc('0x7'));var path=require(_0x33bc('0x8'));var sox=require(_0x33bc('0x9'));var csv=require(_0x33bc('0xa'));var ejs=require(_0x33bc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x33bc('0xc'));var deskjs=require(_0x33bc('0xd'));var toCsv=require(_0x33bc('0xa'));var querystring=require('querystring');var Papa=require(_0x33bc('0xe'));var Redis=require(_0x33bc('0xf'));var authService=require(_0x33bc('0x10'));var qs=require(_0x33bc('0x11'));var as=require(_0x33bc('0x12'));var hardwareService=require(_0x33bc('0x13'));var logger=require(_0x33bc('0x14'))(_0x33bc('0x15'));var utils=require('../../config/utils');var config=require(_0x33bc('0x16'));var db=require(_0x33bc('0x17'))['db'];function respondWithStatusCode(_0x5d6f0c,_0x36d90b){_0x36d90b=_0x36d90b||0xcc;return function(_0x67b0f8){if(_0x67b0f8){return _0x5d6f0c['sendStatus'](_0x36d90b);}return _0x5d6f0c[_0x33bc('0x18')](_0x36d90b)[_0x33bc('0x19')]();};}function respondWithResult(_0x3199ad,_0x4d7a48){_0x4d7a48=_0x4d7a48||0xc8;return function(_0x10f5a0){if(_0x10f5a0){return _0x3199ad[_0x33bc('0x18')](_0x4d7a48)[_0x33bc('0x1a')](_0x10f5a0);}};}function respondWithFilteredResult(_0x4d8c77,_0x12ddc6){return function(_0x570440){if(_0x570440){var _0x4f13d8=_0x570440[_0x33bc('0x1b')],_0x1d9071=_0x12ddc6[_0x33bc('0x1c')],_0x18c809=_0x12ddc6[_0x33bc('0x1c')]+_0x12ddc6['limit'],_0x4e3564;if(_0x18c809>=_0x4f13d8){_0x18c809=_0x4f13d8;_0x4e3564=0xc8;}else{_0x4e3564=0xce;}_0x4d8c77['status'](_0x4e3564);return _0x4d8c77[_0x33bc('0x1d')](_0x33bc('0x1e'),_0x1d9071+'-'+_0x18c809+'/'+_0x4f13d8)['json'](_0x570440);}return null;};}function patchUpdates(_0x18593c){return function(_0x5b7067){try{jsonpatch[_0x33bc('0x1f')](_0x5b7067,_0x18593c,!![]);}catch(_0x9105a0){return BPromise[_0x33bc('0x20')](_0x9105a0);}return _0x5b7067[_0x33bc('0x21')]();};}function saveUpdates(_0xa907fc,_0x49ed85){return function(_0x209435){if(_0x209435){return _0x209435[_0x33bc('0x22')](_0xa907fc)[_0x33bc('0x23')](function(_0x3a9040){return _0x3a9040;});}return null;};}function removeEntity(_0x21941c,_0x59bb55){return function(_0xacf3cb){if(_0xacf3cb){return _0xacf3cb['destroy']()[_0x33bc('0x23')](function(){_0x21941c[_0x33bc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11c02e,_0x1211e8){return function(_0x214c0f){if(!_0x214c0f){_0x11c02e[_0x33bc('0x24')](0x194);}return _0x214c0f;};}function handleError(_0x1a4d1e,_0x18c15c){_0x18c15c=_0x18c15c||0x1f4;return function(_0x32070e){logger[_0x33bc('0x25')](_0x32070e[_0x33bc('0x26')]);if(_0x32070e[_0x33bc('0x27')]){delete _0x32070e['name'];}_0x1a4d1e['status'](_0x18c15c)[_0x33bc('0x28')](_0x32070e);};}exports[_0x33bc('0x29')]=function(_0x480308,_0x1f5e1d){var _0xe01e88={},_0x397441={},_0x7c62b2={'count':0x0,'rows':[]};var _0xbd57c9=_['map'](db['OpenchannelApplication'][_0x33bc('0x2a')],function(_0x5b92ac){return{'name':_0x5b92ac[_0x33bc('0x2b')],'type':_0x5b92ac['type'][_0x33bc('0x2c')]};});_0x397441['model']=_[_0x33bc('0x2d')](_0xbd57c9,_0x33bc('0x27'));_0x397441[_0x33bc('0x2e')]=_[_0x33bc('0x2f')](_0x480308['query']);_0x397441['filters']=_[_0x33bc('0x30')](_0x397441['model'],_0x397441[_0x33bc('0x2e')]);_0xe01e88[_0x33bc('0x31')]=_['intersection'](_0x397441['model'],qs[_0x33bc('0x32')](_0x480308[_0x33bc('0x2e')][_0x33bc('0x32')]));_0xe01e88[_0x33bc('0x31')]=_0xe01e88[_0x33bc('0x31')][_0x33bc('0x33')]?_0xe01e88['attributes']:_0x397441[_0x33bc('0x34')];if(!_0x480308[_0x33bc('0x2e')][_0x33bc('0x35')](_0x33bc('0x36'))){_0xe01e88[_0x33bc('0x37')]=qs['limit'](_0x480308['query'][_0x33bc('0x37')]);_0xe01e88[_0x33bc('0x1c')]=qs[_0x33bc('0x1c')](_0x480308[_0x33bc('0x2e')][_0x33bc('0x1c')]);}_0xe01e88['order']=qs[_0x33bc('0x38')](_0x480308[_0x33bc('0x2e')]['sort']);_0xe01e88['where']=qs[_0x33bc('0x39')](_[_0x33bc('0x3a')](_0x480308['query'],_0x397441[_0x33bc('0x39')]),_0xbd57c9);if(_0x480308[_0x33bc('0x2e')][_0x33bc('0x3b')]){_0xe01e88[_0x33bc('0x3c')]=_[_0x33bc('0x3d')](_0xe01e88[_0x33bc('0x3c')],{'$or':_[_0x33bc('0x2d')](_0xbd57c9,function(_0xa08d85){if(_0xa08d85[_0x33bc('0x3e')]!==_0x33bc('0x3f')){var _0x5d30db={};_0x5d30db[_0xa08d85[_0x33bc('0x27')]]={'$like':'%'+_0x480308['query'][_0x33bc('0x3b')]+'%'};return _0x5d30db;}})});}_0xe01e88=_['merge']({},_0xe01e88,_0x480308[_0x33bc('0x40')]);var _0x23798a={'where':_0xe01e88[_0x33bc('0x3c')]};return db[_0x33bc('0x41')][_0x33bc('0x1b')](_0x23798a)[_0x33bc('0x23')](function(_0x235fbc){_0x7c62b2[_0x33bc('0x1b')]=_0x235fbc;if(_0x480308['query']['includeAll']){_0xe01e88[_0x33bc('0x42')]=[{'all':!![]}];}return db[_0x33bc('0x41')][_0x33bc('0x43')](_0xe01e88);})['then'](function(_0x463855){_0x7c62b2[_0x33bc('0x44')]=_0x463855;return _0x7c62b2;})[_0x33bc('0x23')](respondWithFilteredResult(_0x1f5e1d,_0xe01e88))[_0x33bc('0x45')](handleError(_0x1f5e1d,null));};exports[_0x33bc('0x46')]=function(_0x1eb5c1,_0x268231){var _0x11a0da={'raw':!![],'where':{'id':_0x1eb5c1[_0x33bc('0x47')]['id']}},_0x4e350d={};_0x4e350d[_0x33bc('0x34')]=_[_0x33bc('0x2f')](db[_0x33bc('0x41')][_0x33bc('0x2a')]);_0x4e350d[_0x33bc('0x2e')]=_[_0x33bc('0x2f')](_0x1eb5c1[_0x33bc('0x2e')]);_0x4e350d[_0x33bc('0x39')]=_[_0x33bc('0x30')](_0x4e350d[_0x33bc('0x34')],_0x4e350d[_0x33bc('0x2e')]);_0x11a0da[_0x33bc('0x31')]=_[_0x33bc('0x30')](_0x4e350d['model'],qs[_0x33bc('0x32')](_0x1eb5c1[_0x33bc('0x2e')]['fields']));_0x11a0da[_0x33bc('0x31')]=_0x11a0da['attributes'][_0x33bc('0x33')]?_0x11a0da[_0x33bc('0x31')]:_0x4e350d['model'];if(_0x1eb5c1['query'][_0x33bc('0x48')]){_0x11a0da[_0x33bc('0x42')]=[{'all':!![]}];}_0x11a0da=_[_0x33bc('0x3d')]({},_0x11a0da,_0x1eb5c1[_0x33bc('0x40')]);return db[_0x33bc('0x41')][_0x33bc('0x49')](_0x11a0da)[_0x33bc('0x23')](handleEntityNotFound(_0x268231,null))['then'](respondWithResult(_0x268231,null))[_0x33bc('0x45')](handleError(_0x268231,null));};exports['create']=function(_0x5e211f,_0x1cdc73){return db[_0x33bc('0x41')][_0x33bc('0x4a')](_0x5e211f[_0x33bc('0x4b')],{})[_0x33bc('0x23')](respondWithResult(_0x1cdc73,0xc9))['catch'](handleError(_0x1cdc73,null));};exports[_0x33bc('0x22')]=function(_0xd26554,_0x280b94){if(_0xd26554['body']['id']){delete _0xd26554[_0x33bc('0x4b')]['id'];}return db[_0x33bc('0x41')][_0x33bc('0x49')]({'where':{'id':_0xd26554[_0x33bc('0x47')]['id']}})[_0x33bc('0x23')](handleEntityNotFound(_0x280b94,null))[_0x33bc('0x23')](saveUpdates(_0xd26554['body'],null))[_0x33bc('0x23')](respondWithResult(_0x280b94,null))[_0x33bc('0x45')](handleError(_0x280b94,null));};exports[_0x33bc('0x4c')]=function(_0x181f54,_0x33aae3){return db[_0x33bc('0x41')]['find']({'where':{'id':_0x181f54[_0x33bc('0x47')]['id']}})['then'](handleEntityNotFound(_0x33aae3,null))['then'](removeEntity(_0x33aae3,null))[_0x33bc('0x45')](handleError(_0x33aae3,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 9fbab57..2bb6074 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 _0x19b7=['util','moment','path','rimraf','../../config/environment','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x524e23,_0x1e2aa7){var _0x231413=function(_0x22ac35){while(--_0x22ac35){_0x524e23['push'](_0x524e23['shift']());}};_0x231413(++_0x1e2aa7);}(_0x19b7,0x104));var _0x719b=function(_0x454057,_0x503088){_0x454057=_0x454057-0x0;var _0x4ce245=_0x19b7[_0x454057];return _0x4ce245;};'use strict';var _=require('lodash');var util=require(_0x719b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x719b('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x719b('0x2'));var rimraf=require(_0x719b('0x3'));var config=require(_0x719b('0x4'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x1ad2af,_0x479fef){return _0x1ad2af[_0x719b('0x5')](_0x719b('0x6'),attributes,{'tableName':_0x719b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x719b('0x8'),'collate':_0x719b('0x9')});}; \ No newline at end of file +var _0x2bd1=['util','api','moment','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x51839f,_0x1b3dac){var _0x4e22e3=function(_0x34840a){while(--_0x34840a){_0x51839f['push'](_0x51839f['shift']());}};_0x4e22e3(++_0x1b3dac);}(_0x2bd1,0x143));var _0x12bd=function(_0x2bef59,_0x3c23b2){_0x2bef59=_0x2bef59-0x0;var _0x1bd8dd=_0x2bd1[_0x2bef59];return _0x1bd8dd;};'use strict';var _=require(_0x12bd('0x0'));var util=require(_0x12bd('0x1'));var logger=require('../../config/logger')(_0x12bd('0x2'));var moment=require(_0x12bd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x12bd('0x4'));var config=require(_0x12bd('0x5'));var attributes=require(_0x12bd('0x6'));module[_0x12bd('0x7')]=function(_0x22b450,_0x540fcb){return _0x22b450[_0x12bd('0x8')](_0x12bd('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x12bd('0xa'),'collate':_0x12bd('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 15fc879..b1ffd4b 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x47da5b,_0x38d881){var _0x5e938e=function(_0x2b5989){while(--_0x2b5989){_0x47da5b['push'](_0x47da5b['shift']());}};_0x5e938e(++_0x38d881);}(_0xb10b,0x12a));var _0xbb10=function(_0x50c710,_0x504134){_0x50c710=_0x50c710-0x0;var _0x2d5f79=_0xb10b[_0x50c710];return _0x2d5f79;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1ce3aa,_0x37b150){var _0x2a243d=function(_0x104fda){while(--_0x104fda){_0x1ce3aa['push'](_0x1ce3aa['shift']());}};_0x2a243d(++_0x37b150);}(_0xb10b,0x12a));var _0xbb10=function(_0x614c88,_0x184f02){_0x614c88=_0x614c88-0x0;var _0x1a768e=_0xb10b[_0x614c88];return _0x1a768e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 1f07250..be9f690 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 _0x8bc8=['delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','/describe','isAuthenticated','describe','getMessages','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy'];(function(_0xf7e58e,_0x2ab3f9){var _0x2f7103=function(_0x100363){while(--_0x100363){_0xf7e58e['push'](_0xf7e58e['shift']());}};_0x2f7103(++_0x2ab3f9);}(_0x8bc8,0x9e));var _0x88bc=function(_0x5bc4ca,_0x21f738){_0x5bc4ca=_0x5bc4ca-0x0;var _0x12bf3b=_0x8bc8[_0x5bc4ca];return _0x12bf3b;};'use strict';var multer=require('multer');var util=require(_0x88bc('0x0'));var path=require(_0x88bc('0x1'));var timeout=require(_0x88bc('0x2'));var express=require(_0x88bc('0x3'));var router=express[_0x88bc('0x4')]();var auth=require(_0x88bc('0x5'));var interaction=require(_0x88bc('0x6'));var config=require(_0x88bc('0x7'));var controller=require(_0x88bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x88bc('0x9')](_0x88bc('0xa'),auth[_0x88bc('0xb')](),controller[_0x88bc('0xc')]);router[_0x88bc('0x9')]('/:id',auth[_0x88bc('0xb')](),controller['show']);router[_0x88bc('0x9')]('/:id/messages',auth[_0x88bc('0xb')](),controller[_0x88bc('0xd')]);router[_0x88bc('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x88bc('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x88bc('0xe')](_0x88bc('0xf'),auth[_0x88bc('0xb')](),controller[_0x88bc('0x10')]);router['post'](_0x88bc('0x11'),auth[_0x88bc('0xb')](),interaction[_0x88bc('0x12')](_0x88bc('0x13'),_0x88bc('0x14')),controller[_0x88bc('0x15')]);router[_0x88bc('0x16')](_0x88bc('0x17'),auth['isAuthenticated'](),interaction[_0x88bc('0x12')](_0x88bc('0x13'),_0x88bc('0x18')),controller[_0x88bc('0x19')]);router['delete'](_0x88bc('0x17'),auth['isAuthenticated'](),interaction[_0x88bc('0x12')](_0x88bc('0x13'),_0x88bc('0x1a')),controller[_0x88bc('0x1b')]);router[_0x88bc('0x1c')](_0x88bc('0x11'),auth[_0x88bc('0xb')](),controller[_0x88bc('0x1d')]);module[_0x88bc('0x1e')]=router; \ No newline at end of file +var _0xe84f=['../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','describe','/:id','show','/:id/messages','getMessages','/:id/download','create','post','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5b13c3,_0x378e0a){var _0x3d6780=function(_0x6327a6){while(--_0x6327a6){_0x5b13c3['push'](_0x5b13c3['shift']());}};_0x3d6780(++_0x378e0a);}(_0xe84f,0x121));var _0xfe84=function(_0x575cfe,_0x202094){_0x575cfe=_0x575cfe-0x0;var _0x5e31eb=_0xe84f[_0x575cfe];return _0x5e31eb;};'use strict';var multer=require(_0xfe84('0x0'));var util=require(_0xfe84('0x1'));var path=require(_0xfe84('0x2'));var timeout=require(_0xfe84('0x3'));var express=require(_0xfe84('0x4'));var router=express[_0xfe84('0x5')]();var auth=require(_0xfe84('0x6'));var interaction=require(_0xfe84('0x7'));var config=require(_0xfe84('0x8'));var controller=require(_0xfe84('0x9'));router[_0xfe84('0xa')]('/',auth[_0xfe84('0xb')](),controller[_0xfe84('0xc')]);router[_0xfe84('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xfe84('0xd')]);router[_0xfe84('0xa')](_0xfe84('0xe'),auth[_0xfe84('0xb')](),controller[_0xfe84('0xf')]);router[_0xfe84('0xa')](_0xfe84('0x10'),auth['isAuthenticated'](),controller[_0xfe84('0x11')]);router[_0xfe84('0xa')](_0xfe84('0x12'),auth[_0xfe84('0xb')](),controller['download']);router['post']('/',auth[_0xfe84('0xb')](),controller[_0xfe84('0x13')]);router[_0xfe84('0x14')](_0xfe84('0x10'),auth['isAuthenticated'](),controller['addMessage']);router[_0xfe84('0x14')](_0xfe84('0x15'),auth['isAuthenticated'](),interaction[_0xfe84('0x16')](_0xfe84('0x17'),_0xfe84('0x18')),controller[_0xfe84('0x19')]);router[_0xfe84('0x1a')]('/:id',auth[_0xfe84('0xb')](),interaction[_0xfe84('0x16')]('openchannel',_0xfe84('0x1b')),controller[_0xfe84('0x1c')]);router[_0xfe84('0x1d')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xfe84('0x17'),_0xfe84('0x1e')),controller[_0xfe84('0x1f')]);router[_0xfe84('0x1d')]('/:id/tags',auth[_0xfe84('0xb')](),controller[_0xfe84('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 03e8ff6..f0b5799 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 _0x0d72=['DATE','STRING','ENUM','out','sequelize','BOOLEAN'];(function(_0x59e008,_0x19cd68){var _0x5c1f5e=function(_0x2a55cf){while(--_0x2a55cf){_0x59e008['push'](_0x59e008['shift']());}};_0x5c1f5e(++_0x19cd68);}(_0x0d72,0x18a));var _0x20d7=function(_0x5438e1,_0x395fdf){_0x5438e1=_0x5438e1-0x0;var _0x47b297=_0x0d72[_0x5438e1];return _0x47b297;};'use strict';var Sequelize=require(_0x20d7('0x0'));module['exports']={'closed':{'type':Sequelize[_0x20d7('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x20d7('0x2')]},'disposition':{'type':Sequelize[_0x20d7('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x20d7('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x20d7('0x3')]},'lastMsgAt':{'type':Sequelize[_0x20d7('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x20d7('0x4')]('in',_0x20d7('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd90a=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x544fc1,_0x5af746){var _0x48bf45=function(_0xeb4daf){while(--_0xeb4daf){_0x544fc1['push'](_0x544fc1['shift']());}};_0x48bf45(++_0x5af746);}(_0xd90a,0x96));var _0xad90=function(_0x3a649b,_0x4f2c32){_0x3a649b=_0x3a649b-0x0;var _0x190e2c=_0xd90a[_0x3a649b];return _0x190e2c;};'use strict';var Sequelize=require(_0xad90('0x0'));module[_0xad90('0x1')]={'closed':{'type':Sequelize[_0xad90('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xad90('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xad90('0x4')]},'read1stAt':{'type':Sequelize[_0xad90('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xad90('0x4')]},'lastMsgAt':{'type':Sequelize[_0xad90('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xad90('0x5')]('in',_0xad90('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xad90('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index e0654cd..d3964a7 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 _0xe44b=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','Users','map','Tags','TagIds','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','where','pick','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','find','ContactId','buildExpression','type','text','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','all','rows','show','includeAll','include','options','create','params','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','sort','OpenchannelInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','openchannelInteractionTags:save','download','unix','join','root','server','files','tmp','format','fullname','CmContact','firstName','attachments','Attachment','direction','secret','OpenchannelAccount','Account','Owner','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','closed','closedAt','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','basename','lastName','out','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce'];(function(_0x41bf78,_0x2d90f3){var _0x218c33=function(_0x5805d3){while(--_0x5805d3){_0x41bf78['push'](_0x41bf78['shift']());}};_0x218c33(++_0x2d90f3);}(_0xe44b,0xe9));var _0xbe44=function(_0x324271,_0x59e968){_0x324271=_0x324271-0x0;var _0x31ef5a=_0xe44b[_0x324271];return _0x31ef5a;};'use strict';var pdf=require(_0xbe44('0x0'));var emlformat=require(_0xbe44('0x1'));var rimraf=require(_0xbe44('0x2'));var zipdir=require(_0xbe44('0x3'));var jsonpatch=require(_0xbe44('0x4'));var rp=require(_0xbe44('0x5'));var moment=require(_0xbe44('0x6'));var BPromise=require(_0xbe44('0x7'));var Mustache=require(_0xbe44('0x8'));var util=require('util');var path=require(_0xbe44('0x9'));var sox=require(_0xbe44('0xa'));var csv=require(_0xbe44('0xb'));var ejs=require(_0xbe44('0xc'));var fs=require('fs');var _=require(_0xbe44('0xd'));var squel=require('squel');var crypto=require(_0xbe44('0xe'));var jsforce=require(_0xbe44('0xf'));var deskjs=require(_0xbe44('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbe44('0x11'));var Papa=require('papaparse');var Redis=require(_0xbe44('0x12'));var authService=require(_0xbe44('0x13'));var qs=require(_0xbe44('0x14'));var as=require(_0xbe44('0x15'));var hardwareService=require(_0xbe44('0x16'));var logger=require(_0xbe44('0x17'))('api');var utils=require(_0xbe44('0x18'));var config=require(_0xbe44('0x19'));var db=require(_0xbe44('0x1a'))['db'];config[_0xbe44('0x1b')]=_[_0xbe44('0x1c')](config[_0xbe44('0x1b')],{'host':_0xbe44('0x1d'),'port':0x18eb});var socket=require(_0xbe44('0x1e'))(new Redis(config[_0xbe44('0x1b')]));require(_0xbe44('0x1f'))[_0xbe44('0x20')](socket);function respondWithStatusCode(_0x49de74,_0x5a0414){_0x5a0414=_0x5a0414||0xcc;return function(_0x4c0310){if(_0x4c0310){return _0x49de74[_0xbe44('0x21')](_0x5a0414);}return _0x49de74[_0xbe44('0x22')](_0x5a0414)['end']();};}function respondWithResult(_0x2d339c,_0x4cfe85){_0x4cfe85=_0x4cfe85||0xc8;return function(_0x5e3351){if(_0x5e3351){return _0x2d339c[_0xbe44('0x22')](_0x4cfe85)[_0xbe44('0x23')](_0x5e3351);}};}function respondWithFilteredResult(_0x1810f6,_0x5e2056){return function(_0xd9fb25){if(_0xd9fb25){var _0x23ed85=_0xd9fb25[_0xbe44('0x24')],_0x1a6a9c=_0x5e2056[_0xbe44('0x25')],_0x436212=_0x5e2056['offset']+_0x5e2056[_0xbe44('0x26')],_0xf982ed;if(_0x436212>=_0x23ed85){_0x436212=_0x23ed85;_0xf982ed=0xc8;}else{_0xf982ed=0xce;}_0x1810f6[_0xbe44('0x22')](_0xf982ed);return _0x1810f6[_0xbe44('0x27')](_0xbe44('0x28'),_0x1a6a9c+'-'+_0x436212+'/'+_0x23ed85)[_0xbe44('0x23')](_0xd9fb25);}return null;};}function patchUpdates(_0x18b430){return function(_0x11e362){try{jsonpatch[_0xbe44('0x29')](_0x11e362,_0x18b430,!![]);}catch(_0x171c56){return BPromise[_0xbe44('0x2a')](_0x171c56);}return _0x11e362[_0xbe44('0x2b')]();};}function saveUpdates(_0x2fd49f,_0x2eaa28){return function(_0x3c5838){if(_0x3c5838){return _0x3c5838[_0xbe44('0x2c')](_0x2fd49f)[_0xbe44('0x2d')](function(_0x4c7fc3){return _0x4c7fc3;});}return null;};}function removeEntity(_0x4dc1e0,_0x2e9b81){return function(_0x4335d6){if(_0x4335d6){return _0x4335d6['destroy']()[_0xbe44('0x2d')](function(){_0x4dc1e0[_0xbe44('0x22')](0xcc)[_0xbe44('0x2e')]();});}};}function handleEntityNotFound(_0x383ecd,_0xcbde19){return function(_0x140d63){if(!_0x140d63){_0x383ecd[_0xbe44('0x21')](0x194);}return _0x140d63;};}function handleError(_0x272c25,_0x59551b){_0x59551b=_0x59551b||0x1f4;return function(_0x3540a3){logger[_0xbe44('0x2f')](_0x3540a3[_0xbe44('0x30')]);if(_0x3540a3[_0xbe44('0x31')]){delete _0x3540a3[_0xbe44('0x31')];}_0x272c25[_0xbe44('0x22')](_0x59551b)[_0xbe44('0x32')](_0x3540a3);};}function getInteractionUsers(_0x5a3029,_0xedfd53){return new BPromise(function(_0x464b84,_0x3304fc){try{if(_0xedfd53[_0x5a3029['id']]){_0x5a3029[_0xbe44('0x33')]=_[_0xbe44('0x34')](_0xedfd53[_0x5a3029['id']],function(_0x2ca7d6){return{'id':_0x2ca7d6['id'],'fullname':_0x2ca7d6['fullname']};});}}catch(_0x507fa5){_0x3304fc(_0x507fa5);}_0x464b84(_0x5a3029);});}function getInteractionTags(_0x15720a,_0x2d3572){return new BPromise(function(_0x52af21,_0x3abda2){try{if(_0x15720a['TagIds']){_0x15720a[_0xbe44('0x35')]=[];_0x15720a[_0xbe44('0x36')]['split'](',')[_0xbe44('0x37')](function(_0xbe145c){_0x15720a['Tags'][_0xbe44('0x38')](_0x2d3572[_0xbe145c]);});}delete _0x15720a['TagIds'];}catch(_0x51b7a8){_0x3abda2(_0x51b7a8);}_0x52af21(_0x15720a);});}function updateOpenchannelInteraction(_0x2e358f,_0x3ddfab,_0xd581b0){return new BPromise(function(_0x2cc481,_0x28462b){return getInteractionUsers(_0x2e358f,_0xd581b0)[_0xbe44('0x2d')](function(_0x7a1d97){return getInteractionTags(_0x7a1d97,_0x3ddfab);})['then'](function(_0x368169){_0x2cc481(_0x368169);})[_0xbe44('0x39')](function(_0x4f7caa){_0x28462b(_0x4f7caa);});});}exports[_0xbe44('0x3a')]=function(_0x1e034c,_0x2173b4){var _0x1cdb3d={},_0xac4c06={},_0x22d0a5={'count':0x0,'rows':[]};var _0x31f470=_['map'](db[_0xbe44('0x3b')][_0xbe44('0x3c')],function(_0x3fe49a){return{'name':_0x3fe49a[_0xbe44('0x3d')],'type':_0x3fe49a['type']['key']};});_0xac4c06[_0xbe44('0x3e')]=_['map'](_0x31f470,_0xbe44('0x31'));_0xac4c06[_0xbe44('0x3f')]=_[_0xbe44('0x40')](_0x1e034c['query']);_0xac4c06[_0xbe44('0x41')]=_[_0xbe44('0x42')](_0xac4c06[_0xbe44('0x3e')],_0xac4c06['query']);_0x1cdb3d['attributes']=_[_0xbe44('0x42')](_0xac4c06['model'],qs['fields'](_0x1e034c[_0xbe44('0x3f')]['fields']));_0x1cdb3d[_0xbe44('0x43')]=_0x1cdb3d[_0xbe44('0x43')][_0xbe44('0x44')]?_0x1cdb3d[_0xbe44('0x43')]:_0xac4c06[_0xbe44('0x3e')];if(!_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x45')](_0xbe44('0x46'))){_0x1cdb3d[_0xbe44('0x26')]=qs[_0xbe44('0x26')](_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x26')]);_0x1cdb3d[_0xbe44('0x25')]=qs['offset'](_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x25')]);}_0x1cdb3d[_0xbe44('0x47')]=qs['sort'](_0x1e034c[_0xbe44('0x3f')]['sort']);_0x1cdb3d[_0xbe44('0x48')]=qs[_0xbe44('0x41')](_[_0xbe44('0x49')](_0x1e034c[_0xbe44('0x3f')],_0xac4c06[_0xbe44('0x41')]),_0x31f470);var _0x1e2f44=[];var _0xf34482=squel[_0xbe44('0x4a')]()['field']('id')[_0xbe44('0x4b')](_0xbe44('0x31'))['field'](_0xbe44('0x4c'))[_0xbe44('0x4d')](_0xbe44('0x4e'));var _0x1be142=squel[_0xbe44('0x4a')]()[_0xbe44('0x4b')]('u.id')['field'](_0xbe44('0x4f'))[_0xbe44('0x4b')](_0xbe44('0x50'))[_0xbe44('0x4d')]('user_has_openchannel_interactions','ui')[_0xbe44('0x51')](_0xbe44('0x52'),'u',_0xbe44('0x53'));var _0x477e37=squel[_0xbe44('0x4a')]()[_0xbe44('0x4d')](_0xbe44('0x54'),'i')['left_join'](_0xbe44('0x55'),'c',_0xbe44('0x56'))[_0xbe44('0x51')](_0xbe44('0x52'),'o',_0xbe44('0x57'))[_0xbe44('0x51')]('openchannel_accounts','a',_0xbe44('0x58'))[_0xbe44('0x51')](_0xbe44('0x59'),'me',_0xbe44('0x5a'))[_0xbe44('0x51')](_0xbe44('0x5b'),'it',_0xbe44('0x5c'))[_0xbe44('0x51')](_0xbe44('0x4e'),'t',_0xbe44('0x5d'));var _0x444539=squel['expr']();var _0x5bd626=[];var _0x58ea3e=squel[_0xbe44('0x5e')]();var _0x20970f;if(_0x1e034c['query']['search']){_0x20970f=as[_0xbe44('0x5f')](_0x1e034c[_0xbe44('0x3f')]['search']);var _0x55dee6=_0x20970f[_0xbe44('0x60')];for(var _0x39c297=0x0;_0x39c297<_0x20970f[_0xbe44('0x61')]['length'];_0x39c297++){var _0x346ffb=_0x20970f[_0xbe44('0x61')][_0x39c297];var _0x1cc748='i';var _0x54fb89=_['find'](_0x31f470,[_0xbe44('0x31'),_0x346ffb['field']]);if(!_0x54fb89){switch(_0x346ffb['field']){case _0xbe44('0x62'):if(_0x346ffb[_0xbe44('0x63')]==0x1){_0x477e37[_0xbe44('0x64')]('`'+_0x346ffb[_0xbe44('0x4b')]+_0xbe44('0x65'));}else{_0x477e37[_0xbe44('0x64')]('`'+_0x346ffb[_0xbe44('0x4b')]+_0xbe44('0x66'));}break;case _0xbe44('0x67'):if(_0x346ffb[_0xbe44('0x68')]===_0xbe44('0x69')){if(_0x346ffb[_0xbe44('0x63')]['split']('\x20')[_0xbe44('0x44')]>0x1){_0x444539[_0x55dee6](_0xbe44('0x6a'),qs['getFullTextValue'](_0x346ffb[_0xbe44('0x63')]),null);}else{var _0x1b9d60='%'+_0x346ffb[_0xbe44('0x63')]+'%';_0x444539[_0x55dee6]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1b9d60,_0x1b9d60,_0x1b9d60);}}else{_0x54fb89=_[_0xbe44('0x6b')](_0x31f470,[_0xbe44('0x31'),_0xbe44('0x6c')]);_0x346ffb[_0xbe44('0x4b')]=_0xbe44('0x6c');_0x154300=as[_0xbe44('0x6d')](_0x1cc748,_0x54fb89[_0xbe44('0x6e')],_0x346ffb);_0x444539[_0x55dee6](_0x154300[_0xbe44('0x6f')],_0x154300[_0xbe44('0x63')]['start'],_0x154300[_0xbe44('0x63')][_0xbe44('0x2e')]);}break;case _0xbe44('0x70'):var _0x128c17=_0x346ffb['value'][_0xbe44('0x71')](',')['map'](function(_0x5e2414){return Number(_0x5e2414);});_0x128c17[_0xbe44('0x37')](function(_0x81f888){_0x58ea3e['or'](_0xbe44('0x72'),'%,'+_0x81f888+',%');});_0x5bd626=_[_0xbe44('0x73')](_0x5bd626,_0x128c17);break;case _0xbe44('0x74'):if(_0x346ffb[_0xbe44('0x68')]==='$substring'){_0x444539[_0x55dee6](_0xbe44('0x75'),'%'+_0x346ffb[_0xbe44('0x63')]+'%',null);}else{_0x54fb89=_[_0xbe44('0x6b')](_0x31f470,[_0xbe44('0x31'),_0xbe44('0x76')]);_0x346ffb[_0xbe44('0x4b')]=_0xbe44('0x76');_0x154300=as['buildExpression'](_0x1cc748,_0x54fb89[_0xbe44('0x6e')],_0x346ffb);_0x444539[_0x55dee6](_0x154300['text'],_0x154300[_0xbe44('0x63')][_0xbe44('0x77')],_0x154300['value'][_0xbe44('0x2e')]);}break;case _0xbe44('0x78'):_0x154300=as['buildExpression']('me',null,_0x346ffb);_0x444539[_0x55dee6](_0x154300['text'],_0x154300[_0xbe44('0x63')][_0xbe44('0x77')],_0x154300[_0xbe44('0x63')][_0xbe44('0x2e')]);break;}}else{var _0x154300=as[_0xbe44('0x6d')](_0x1cc748,_0x54fb89[_0xbe44('0x6e')],_0x346ffb);_0x444539[_0x55dee6](_0x154300[_0xbe44('0x6f')],_0x154300[_0xbe44('0x63')][_0xbe44('0x77')],_0x154300[_0xbe44('0x63')][_0xbe44('0x2e')]);}}}else{var _0x1eca6c=_(_0x1e034c[_0xbe44('0x3f')])[_0xbe44('0x40')]()[_0xbe44('0x34')](function(_0x281296){return _['some'](_0x31f470,[_0xbe44('0x31'),_0x281296])?_0x281296:undefined;})[_0xbe44('0x79')]()[_0xbe44('0x63')]();if(!_[_0xbe44('0x7a')](_0x1eca6c)){_0x1eca6c['forEach'](function(_0x5c818b){if(_0x5c818b===_0xbe44('0x7b')){_0x477e37[_0xbe44('0x48')](_0xbe44('0x7c'),[][_0xbe44('0x7d')](_0x1e034c[_0xbe44('0x3f')][_0x5c818b]));}else if(_0x5c818b===_0xbe44('0x7e')){var _0x51620d=JSON[_0xbe44('0x7f')](_0x1e034c[_0xbe44('0x3f')][_0x5c818b])['$gte'];var _0x2512df=JSON['parse'](_0x1e034c[_0xbe44('0x3f')][_0x5c818b])[_0xbe44('0x80')];_0x477e37[_0xbe44('0x48')](_0xbe44('0x81'),_0x51620d,_0x2512df);}else{if(_0x1e034c[_0xbe44('0x3f')][_0x5c818b]===_0xbe44('0x82')){_0x477e37['where']('i.'+_0x5c818b+_0xbe44('0x83'));}else{_0x477e37['where']('i.'+_0x5c818b+_0xbe44('0x84'),_0x1e034c['query'][_0x5c818b]);}}});}if(_0x1e034c['query'][_0xbe44('0x85')]){if(_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x85')]==0x1){_0x477e37['having'](_0xbe44('0x86'));}else{_0x477e37[_0xbe44('0x64')](_0xbe44('0x87'));}}if(_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x88')]){_0x5bd626=_[_0xbe44('0x89')](_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x88')])?_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x88')]:new Array(_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x88')]);_0x5bd626[_0xbe44('0x37')](function(_0x33b4f9){_0x58ea3e['or'](_0xbe44('0x72'),'%,'+_0x33b4f9+',%');});}if(_0x1e034c['query'][_0xbe44('0x8a')]){var _0x576c04=_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x8a')][_0xbe44('0x8b')]('\x5c','\x5c\x5c')[_0xbe44('0x8b')]('\x27\x27',_0xbe44('0x8c'));if(qs[_0xbe44('0x8d')](_0x576c04)){_0x444539['or'](_0xbe44('0x8e'),_0x576c04+'%');}else{_0x444539['or'](_0xbe44('0x8f'),qs[_0xbe44('0x90')](_0x576c04))['or']('i.from\x20LIKE\x20?',_0x576c04+'%')['or'](_0xbe44('0x91'),_0x576c04+'%');}}}_0x477e37[_0xbe44('0x48')](_0x444539);_0x477e37[_0xbe44('0x92')]('i.id');var _0x1e3d3d={'type':db[_0xbe44('0x93')][_0xbe44('0x94')][_0xbe44('0x95')],'raw':!![]};var _0x32df1d=_0x477e37[_0xbe44('0x96')]();_0x32df1d['field']('i.id');_0x32df1d[_0xbe44('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbe44('0x62'));if(_0x1cdb3d[_0xbe44('0x47')]){_0x1cdb3d[_0xbe44('0x47')][_0xbe44('0x37')](function(_0x41ff67){_0x477e37[_0xbe44('0x47')]('i.'+_0x41ff67[0x0],_0x41ff67[0x1]===_0xbe44('0x97')?![]:!![]);});}if(!_[_0xbe44('0x7a')](_0x5bd626)){_0x477e37[_0xbe44('0x64')](_0x58ea3e);_0x32df1d[_0xbe44('0x48')](_0xbe44('0x98'),_0x5bd626);}BPromise[_0xbe44('0x99')]()[_0xbe44('0x2d')](function(){if(!_0x20970f){if(_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x7b')]||_0x1e034c[_0xbe44('0x3f')][_0xbe44('0x9a')])return;_0x32df1d[_0xbe44('0x48')](_0xbe44('0x9b'));_0x477e37[_0xbe44('0x48')](_0xbe44('0x9b'));return;}return _0x1e034c[_0xbe44('0x9c')][_0xbe44('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ecfb9){if(_[_0xbe44('0x7a')](_0x3ecfb9)){_0x32df1d['where'](_0xbe44('0x9e'));_0x477e37[_0xbe44('0x48')](_0xbe44('0x9e'));}else{_0x32df1d['where'](_0xbe44('0x7c'),_[_0xbe44('0x34')](_0x3ecfb9,'id'));_0x477e37[_0xbe44('0x48')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xbe44('0x34')](_0x3ecfb9,'id'));}});})[_0xbe44('0x2d')](function(){db[_0xbe44('0x9f')][_0xbe44('0x3f')](_0x32df1d[_0xbe44('0xa0')](),_0x1e3d3d)[_0xbe44('0x2d')](function(_0x5d1605){_0x22d0a5[_0xbe44('0x24')]=_0x5d1605[_0xbe44('0x44')];if(_0x22d0a5[_0xbe44('0x24')]===0x0)return[];return db['sequelize']['query'](_0xf34482['toString'](),_0x1e3d3d)['then'](function(_0x3766ad){_0x1e2f44=_[_0xbe44('0xa1')](_0x3766ad,'id');_0x1e3d3d=_[_0xbe44('0xa2')](_0x1e3d3d,{'model':db[_0xbe44('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e034c[_0xbe44('0x3f')][_0xbe44('0xa3')]){_0x1cdb3d['attributes'][_0xbe44('0x37')](function(_0x523266){_0x477e37['field']('i.'+_0x523266);});}else{_0x477e37[_0xbe44('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbe44('0x62'));_0x477e37[_0xbe44('0x4b')](_0xbe44('0xa4'),_0xbe44('0xa5'));_0x477e37[_0xbe44('0x4b')](_0xbe44('0xa6'),_0xbe44('0xa7'));_0x477e37[_0xbe44('0x4b')]('i.*');_0x477e37['field'](_0xbe44('0xa8'),'Contact.firstName');_0x477e37[_0xbe44('0x4b')]('c.lastName','Contact.lastName');_0x477e37[_0xbe44('0x4b')](_0xbe44('0xa9'),_0xbe44('0xaa'));_0x477e37[_0xbe44('0x4b')](_0xbe44('0xab'),_0xbe44('0xac'));_0x477e37['field'](_0xbe44('0xad'),_0xbe44('0xae'));_0x477e37['field']('c.fax','Contact.fax');_0x477e37['field'](_0xbe44('0xaf'),_0xbe44('0xb0'));_0x477e37[_0xbe44('0x4b')](_0xbe44('0xb1'),_0xbe44('0xb2'));_0x477e37[_0xbe44('0x4b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xbe44('0x36'));}if(_0x1cdb3d['limit'])_0x477e37[_0xbe44('0x26')](_0x1cdb3d['limit']);if(_0x1cdb3d['offset'])_0x477e37[_0xbe44('0x25')](_0x1cdb3d[_0xbe44('0x25')]);return db[_0xbe44('0x9f')][_0xbe44('0x3f')](_0x477e37[_0xbe44('0xa0')](),_0x1e3d3d);})[_0xbe44('0x2d')](function(_0x3ba0bb){_0x1be142[_0xbe44('0x48')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x3ba0bb,'id'));return db['sequelize'][_0xbe44('0x3f')](_0x1be142['toString'](),_0x1e3d3d)[_0xbe44('0x2d')](function(_0x393947){var _0x41dc4d=_['groupBy'](_0x393947,'OpenchannelInteractionId');var _0x48d921=[];_0x3ba0bb[_0xbe44('0x37')](function(_0x4ab353){_0x48d921[_0xbe44('0x38')](updateOpenchannelInteraction(_0x4ab353,_0x1e2f44,_0x41dc4d));});return BPromise[_0xbe44('0xb3')](_0x48d921);});});})[_0xbe44('0x2d')](function(_0x5d35d4){_0x22d0a5[_0xbe44('0xb4')]=_0x5d35d4;return _0x22d0a5;})[_0xbe44('0x2d')](respondWithFilteredResult(_0x2173b4,_0x1cdb3d));})[_0xbe44('0x39')](handleError(_0x2173b4,null));};exports[_0xbe44('0xb5')]=function(_0x32faf7,_0x2eabf3){var _0x4630b3={'raw':![],'where':{'id':_0x32faf7['params']['id']}},_0x29a7ce={};_0x29a7ce['model']=_[_0xbe44('0x40')](db[_0xbe44('0x3b')][_0xbe44('0x3c')]);_0x29a7ce['query']=_[_0xbe44('0x40')](_0x32faf7[_0xbe44('0x3f')]);_0x29a7ce[_0xbe44('0x41')]=_[_0xbe44('0x42')](_0x29a7ce[_0xbe44('0x3e')],_0x29a7ce[_0xbe44('0x3f')]);_0x4630b3[_0xbe44('0x43')]=_[_0xbe44('0x42')](_0x29a7ce['model'],qs[_0xbe44('0xa3')](_0x32faf7[_0xbe44('0x3f')][_0xbe44('0xa3')]));_0x4630b3[_0xbe44('0x43')]=_0x4630b3['attributes'][_0xbe44('0x44')]?_0x4630b3[_0xbe44('0x43')]:_0x29a7ce[_0xbe44('0x3e')];if(_0x32faf7['query'][_0xbe44('0xb6')]){_0x4630b3[_0xbe44('0xb7')]=[{'all':!![]}];}_0x4630b3=_[_0xbe44('0xa2')]({},_0x4630b3,_0x32faf7[_0xbe44('0xb8')]);return db[_0xbe44('0x3b')][_0xbe44('0x6b')](_0x4630b3)[_0xbe44('0x2d')](handleEntityNotFound(_0x2eabf3,null))[_0xbe44('0x2d')](respondWithResult(_0x2eabf3,null))['catch'](handleError(_0x2eabf3,null));};exports[_0xbe44('0xb9')]=function(_0x563a8e,_0x463b5c){return db[_0xbe44('0x3b')][_0xbe44('0xb9')](_0x563a8e['body'],{})[_0xbe44('0x2d')](respondWithResult(_0x463b5c,0xc9))[_0xbe44('0x39')](handleError(_0x463b5c,null));};exports[_0xbe44('0x2c')]=function(_0x171ef3,_0x429e72){if(_0x171ef3[_0xbe44('0x78')]['id']){delete _0x171ef3[_0xbe44('0x78')]['id'];}return db['OpenchannelInteraction'][_0xbe44('0x6b')]({'where':{'id':_0x171ef3[_0xbe44('0xba')]['id']}})[_0xbe44('0x2d')](handleEntityNotFound(_0x429e72,null))[_0xbe44('0x2d')](saveUpdates(_0x171ef3[_0xbe44('0x78')],null))[_0xbe44('0x2d')](respondWithResult(_0x429e72,null))[_0xbe44('0x39')](handleError(_0x429e72,null));};exports['destroy']=function(_0x103506,_0x847163){return db[_0xbe44('0x3b')][_0xbe44('0x6b')]({'where':{'id':_0x103506[_0xbe44('0xba')]['id']}})[_0xbe44('0x2d')](handleEntityNotFound(_0x847163,null))['then'](removeEntity(_0x847163,null))[_0xbe44('0x39')](handleError(_0x847163,null));};exports['describe']=function(_0x11080f,_0x3552fe){return db[_0xbe44('0x3b')][_0xbe44('0xbb')]()[_0xbe44('0x2d')](respondWithResult(_0x3552fe,null))[_0xbe44('0x39')](handleError(_0x3552fe,null));};exports[_0xbe44('0xbc')]=function(_0x3d40b0,_0x24556b,_0x22b384){return db[_0xbe44('0xbd')][_0xbe44('0x6b')]({'where':{'id':_0x3d40b0[_0xbe44('0xba')]['id']}})[_0xbe44('0x2d')](handleEntityNotFound(_0x24556b,null))[_0xbe44('0x2d')](function(_0x31eaa1){if(_0x31eaa1){return _0x31eaa1[_0xbe44('0xbc')](_0x3d40b0[_0xbe44('0x78')][_0xbe44('0xbe')],_[_0xbe44('0xbf')](_0x3d40b0[_0xbe44('0x78')],['ids','id'])||{});}})['then'](respondWithResult(_0x24556b,null))[_0xbe44('0x39')](handleError(_0x24556b,null));};exports[_0xbe44('0xc0')]=function(_0x32aee4,_0x4eb83c,_0x515aee){var _0x5b1217={'raw':![],'where':{}};var _0x37d9e8={};var _0x5c396b={'count':0x0,'rows':[]};return db[_0xbe44('0x3b')][_0xbe44('0xc1')]({'where':{'id':_0x32aee4['params']['id']}})['then'](handleEntityNotFound(_0x4eb83c,null))[_0xbe44('0x2d')](function(_0x279c0c){if(_0x279c0c){_0x37d9e8[_0xbe44('0x3e')]=_[_0xbe44('0x40')](db['OpenchannelMessage'][_0xbe44('0x3c')]);_0x37d9e8[_0xbe44('0x3f')]=_[_0xbe44('0x40')](_0x32aee4[_0xbe44('0x3f')]);_0x37d9e8[_0xbe44('0x41')]=_[_0xbe44('0x42')](_0x37d9e8[_0xbe44('0x3e')],_0x37d9e8[_0xbe44('0x3f')]);_0x5b1217[_0xbe44('0x43')]=_[_0xbe44('0x42')](_0x37d9e8[_0xbe44('0x3e')],qs[_0xbe44('0xa3')](_0x32aee4['query']['fields']));_0x5b1217[_0xbe44('0x43')]=_0x5b1217[_0xbe44('0x43')][_0xbe44('0x44')]?_0x5b1217[_0xbe44('0x43')]:_0x37d9e8[_0xbe44('0x3e')];if(!_0x32aee4[_0xbe44('0x3f')][_0xbe44('0x45')](_0xbe44('0x46'))){_0x5b1217[_0xbe44('0x26')]=qs[_0xbe44('0x26')](_0x32aee4['query']['limit']);_0x5b1217[_0xbe44('0x25')]=qs[_0xbe44('0x25')](_0x32aee4['query'][_0xbe44('0x25')]);}_0x5b1217[_0xbe44('0x47')]=qs[_0xbe44('0xc2')](_0x32aee4['query']['sort']);_0x5b1217[_0xbe44('0x48')]=qs[_0xbe44('0x41')](_['pick'](_0x32aee4[_0xbe44('0x3f')],_0x37d9e8['filters']));_0x5b1217[_0xbe44('0x48')][_0xbe44('0xc3')]=_0x279c0c['id'];if(_0x32aee4[_0xbe44('0x3f')][_0xbe44('0x8a')]){_0x5b1217[_0xbe44('0x48')]=_[_0xbe44('0xa2')](_0x5b1217[_0xbe44('0x48')],{'$or':_[_0xbe44('0x34')](_0x5b1217[_0xbe44('0x43')],function(_0x53e7af){var _0x91383e={};_0x91383e[_0x53e7af]={'$like':'%'+_0x32aee4[_0xbe44('0x3f')][_0xbe44('0x8a')]+'%'};return _0x91383e;})});}if(_0x32aee4['query'][_0xbe44('0xc4')]){var _0x1ce8db=_0x32aee4[_0xbe44('0x3f')][_0xbe44('0xc4')][_0xbe44('0x71')](',');var _0xeb871a={};_0xeb871a[_0x1ce8db[0x0]]={'$gte':moment(_0x1ce8db[0x1])['format'](_0xbe44('0xc5'))};_0x5b1217[_0xbe44('0x48')]=_[_0xbe44('0xa2')](_0x5b1217[_0xbe44('0x48')],_0xeb871a);}_0x5b1217=_['merge']({},_0x5b1217,_0x32aee4[_0xbe44('0xb8')]);return db['OpenchannelMessage']['count']({'where':_0x5b1217[_0xbe44('0x48')]})['then'](function(_0x4393d3){_0x5c396b[_0xbe44('0x24')]=_0x4393d3;if(_0x32aee4[_0xbe44('0x3f')]['includeAll']){_0x5b1217['include']=[{'all':!![]}];}return db[_0xbe44('0xbd')][_0xbe44('0xc6')](_0x5b1217);})['then'](function(_0x288a9c){_0x5c396b[_0xbe44('0xb4')]=_0x288a9c;return _0x5c396b;});}})['then'](respondWithFilteredResult(_0x4eb83c,_0x5b1217))['catch'](handleError(_0x4eb83c,null));};exports['addTags']=function(_0x572f82,_0x3a0104,_0x39d8ac){return db['OpenchannelInteraction'][_0xbe44('0x6b')]({'where':{'id':_0x572f82[_0xbe44('0xba')]['id']}})[_0xbe44('0x2d')](handleEntityNotFound(_0x3a0104,null))[_0xbe44('0x2d')](function(_0x3a6618){if(_0x3a6618){return _0x3a6618[_0xbe44('0xc7')](_0x572f82[_0xbe44('0x78')]['ids'],_[_0xbe44('0xbf')](_0x572f82[_0xbe44('0x78')],[_0xbe44('0xbe'),'id'])||{})['spread'](function(){return db[_0xbe44('0x70')][_0xbe44('0xc6')]({'attributes':['id',_0xbe44('0x31'),'color'],'where':{'id':_0x572f82[_0xbe44('0x78')]['ids']}});})[_0xbe44('0x2d')](function(_0x61ba25){socket['emit'](_0xbe44('0xc8'),{'id':Number(_0x572f82[_0xbe44('0xba')]['id']),'tags':_0x61ba25||[]});return{'id':Number(_0x572f82['params']['id']),'tags':_0x61ba25||[]};});}})[_0xbe44('0x2d')](respondWithResult(_0x3a0104,null))[_0xbe44('0x39')](handleError(_0x3a0104,null));};exports['removeTags']=function(_0xc433ea,_0x656043,_0x429543){return db[_0xbe44('0x3b')][_0xbe44('0x6b')]({'where':{'id':_0xc433ea[_0xbe44('0xba')]['id']}})['then'](handleEntityNotFound(_0x656043,null))[_0xbe44('0x2d')](function(_0x284254){if(_0x284254){return _0x284254['removeTags'](_0xc433ea['query'][_0xbe44('0xbe')]);}})[_0xbe44('0x2d')](respondWithStatusCode(_0x656043,null))[_0xbe44('0x39')](handleError(_0x656043,null));};exports[_0xbe44('0xc9')]=function(_0x4ba7d2,_0x49a1c8){var _0x32f8fb=moment()[_0xbe44('0xca')]()['toString']();var _0x3483c3=path[_0xbe44('0xcb')](config[_0xbe44('0xcc')],_0xbe44('0xcd'),_0xbe44('0xce'),_0xbe44('0xcf'));var _0x4b7340=path[_0xbe44('0xcb')](config[_0xbe44('0xcc')],_0xbe44('0xcd'),_0xbe44('0xce'),'attachments');var _0x37474f=path[_0xbe44('0xcb')](_0x3483c3,_0x32f8fb);var _0x1cf52e=util[_0xbe44('0xd0')]('transcript-%d-%s.zip',_0x4ba7d2['params']['id'],_0x32f8fb);var _0x196cfd=path[_0xbe44('0xcb')](_0x3483c3,_0x1cf52e);var _0x48f2bf=[];_0x48f2bf[_0xbe44('0x38')]({'model':db['User'],'as':_0xbe44('0x74'),'attributes':['id',_0xbe44('0xd1')],'raw':!![]});_0x48f2bf[_0xbe44('0x38')]({'model':db[_0xbe44('0xd2')],'as':_0xbe44('0x67'),'attributes':['id',_0xbe44('0xd3'),'lastName'],'raw':!![]});if(_0x4ba7d2[_0xbe44('0x3f')][_0xbe44('0xd4')]){_0x48f2bf[_0xbe44('0x38')]({'model':db[_0xbe44('0xd5')],'as':_0xbe44('0xd5'),'raw':!![]});}var _0x590f08=[{'model':db[_0xbe44('0xbd')],'as':'Messages','attributes':['id',_0xbe44('0x78'),_0xbe44('0x7e'),_0xbe44('0xd6'),_0xbe44('0xd7'),_0xbe44('0x85')],'include':_0x48f2bf}];_0x590f08[_0xbe44('0x38')]({'model':db[_0xbe44('0xd8')],'as':_0xbe44('0xd9'),'attributes':['id',_0xbe44('0x31')]});_0x590f08[_0xbe44('0x38')]({'model':db['User'],'as':_0xbe44('0xda'),'attributes':['id','fullname']});return db[_0xbe44('0x3b')][_0xbe44('0x6b')]({'where':{'id':_0x4ba7d2['params']['id']},'include':_0x590f08})[_0xbe44('0x2d')](handleEntityNotFound(_0x49a1c8,null))[_0xbe44('0x2d')](function(_0x3fde26){if(_0x3fde26){var _0x26095e=_0x3fde26['get']({'plain':!![]});fs[_0xbe44('0xdb')](_0x37474f);var _0x20e54a={'format':'A4','border':_0xbe44('0xdc'),'header':{'height':_0xbe44('0xdd'),'contents':{'first':_0xbe44('0xde')}},'footer':{'height':_0xbe44('0xdf'),'contents':{'default':util[_0xbe44('0xd0')](_0xbe44('0xe0'),util[_0xbe44('0xd0')](_0xbe44('0xe1'),_0xbe44('0xe2'),_0x26095e['id']),moment()[_0xbe44('0xd0')](_0xbe44('0xe3'))['toString']())}}};var _0x5d7166={'channel':'Openchannel','account':_0x26095e['Account'][_0xbe44('0x31')],'agent':_0x26095e[_0xbe44('0xda')]?_0x26095e['Owner'][_0xbe44('0xd1')]:_0xbe44('0xe4'),'createdAt':moment(_0x26095e[_0xbe44('0x7e')])[_0xbe44('0xd0')](_0xbe44('0xc5'))['toString'](),'closedAt':_0x26095e[_0xbe44('0xe5')]?moment(_0x26095e[_0xbe44('0xe6')])[_0xbe44('0xd0')](_0xbe44('0xc5'))['toString']():'','disposition':_0x26095e['disposition'],'visibility':_0x26095e[_0xbe44('0xe7')]?_0xbe44('0xe8'):_0xbe44('0xe9'),'messages':_(_0x26095e['Messages'])[_0xbe44('0x8a')]({'secret':![]})[_0xbe44('0x34')](function(_0x4fb348){if(_0x4fb348[_0xbe44('0xd5')]){var _0x533082=path[_0xbe44('0xcb')](_0x4b7340,_0x4fb348['Attachment']['basename']);if(fs[_0xbe44('0xea')](_0x533082)){fs[_0xbe44('0xeb')](_0x533082)[_0xbe44('0xec')](fs[_0xbe44('0xed')](path[_0xbe44('0xcb')](_0x37474f,_0x4fb348[_0xbe44('0xd5')][_0xbe44('0xee')])));}}return{'date':moment(_0x4fb348[_0xbe44('0x7e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbe44('0xa0')](),'sender':_0x4fb348[_0xbe44('0xd6')]==='out'?_0x4fb348[_0xbe44('0x74')]?_0x4fb348['User'][_0xbe44('0xd1')]:'System':_0x4fb348[_0xbe44('0x67')][_0xbe44('0xd3')]+(_0x4fb348[_0xbe44('0x67')][_0xbe44('0xef')]?'\x20'+_0x4fb348['Contact'][_0xbe44('0xef')]:''),'body':_0x4fb348['Attachment']?_0x4fb348[_0xbe44('0xd5')][_0xbe44('0xee')]:_0x4fb348[_0xbe44('0x78')],'direction':_0x4fb348[_0xbe44('0xd6')]===_0xbe44('0xf0')?'A':'C','secret':_0x4fb348[_0xbe44('0xd7')],'read':_0x4fb348[_0xbe44('0x85')],'attachment':_0x4fb348['Attachment']};})[_0xbe44('0x63')]()};return ejs[_0xbe44('0xf1')](path[_0xbe44('0xcb')](config[_0xbe44('0xcc')],_0xbe44('0xcd'),'views',_0xbe44('0xf2')),{'interaction':_0x5d7166})['then'](function(_0xac0e97){return new BPromise(function(_0x536c14,_0x505635){pdf['create'](_0xac0e97,_0x20e54a)[_0xbe44('0xf3')](path[_0xbe44('0xcb')](_0x37474f,_0xbe44('0xf4')+_0x26095e['id']+'-'+_0x32f8fb+_0xbe44('0xf5')),function(_0x425ac9,_0x454202){if(_0x425ac9)return _0x505635(_0x425ac9);_0x536c14(_0x454202);});});})[_0xbe44('0x2d')](function(){return new BPromise(function(_0x1cb990,_0x527478){zipdir(_0x37474f,{'saveTo':_0x196cfd},function(_0x52218a,_0x1662a8){if(_0x52218a)return _0x527478(_0x52218a);return _0x1cb990(_0x1662a8);});})[_0xbe44('0x2d')](function(){return new BPromise(function(_0x5e00bd,_0x2d3744){rimraf(_0x37474f,function(_0x3199e8){if(_0x3199e8)_0x2d3744(_0x3199e8);return _0x5e00bd();});});})['then'](function(){return _0x49a1c8[_0xbe44('0xc9')](_0x196cfd,_0x1cf52e,function(_0x36e8c5){if(_0x36e8c5){console[_0xbe44('0xf6')](_0xbe44('0xf7'),_0x36e8c5);}else{fs[_0xbe44('0xf8')](_0x196cfd);}});});});}else{return _0x49a1c8[_0xbe44('0x21')](0xc8);}})[_0xbe44('0x39')](handleError(_0x49a1c8,null));}; \ No newline at end of file +var _0xe1bc=['toFile','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','start','body','buildExpression','some','compact','isEmpty','OpenchannelAccountId','concat','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','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','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','keyBy','unreadMessages','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','groupBy','OpenchannelInteractionId','all','rows','catch','params','includeAll','merge','options','create','destroy','describe','addMessage','ids','omit','findOne','format','include','OpenchannelMessage','setTags','spread','findAll','color','openchannelInteractionTags:save','removeTags','unix','root','tmp','join','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','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','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','closed','disposition','threadId','pipe','createWriteStream','basename','YYYY-MM-DD\x20HH:mm:ss','out','System','renderFile','server','views','downloadInteraction.html'];(function(_0x301720,_0x59454c){var _0x5f26ad=function(_0x30adce){while(--_0x30adce){_0x301720['push'](_0x301720['shift']());}};_0x5f26ad(++_0x59454c);}(_0xe1bc,0xf4));var _0xce1b=function(_0x11d0d4,_0x540b3f){_0x11d0d4=_0x11d0d4-0x0;var _0xd6478a=_0xe1bc[_0x11d0d4];return _0xd6478a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xce1b('0x0'));var rimraf=require(_0xce1b('0x1'));var zipdir=require(_0xce1b('0x2'));var jsonpatch=require(_0xce1b('0x3'));var rp=require(_0xce1b('0x4'));var moment=require(_0xce1b('0x5'));var BPromise=require(_0xce1b('0x6'));var Mustache=require(_0xce1b('0x7'));var util=require(_0xce1b('0x8'));var path=require(_0xce1b('0x9'));var sox=require(_0xce1b('0xa'));var csv=require(_0xce1b('0xb'));var ejs=require(_0xce1b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xce1b('0xd'));var jsforce=require(_0xce1b('0xe'));var deskjs=require(_0xce1b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xce1b('0x10'));var Papa=require(_0xce1b('0x11'));var Redis=require(_0xce1b('0x12'));var authService=require(_0xce1b('0x13'));var qs=require(_0xce1b('0x14'));var as=require(_0xce1b('0x15'));var hardwareService=require(_0xce1b('0x16'));var logger=require(_0xce1b('0x17'))(_0xce1b('0x18'));var utils=require(_0xce1b('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0xce1b('0x1a')](config['redis'],{'host':_0xce1b('0x1b'),'port':0x18eb});var socket=require(_0xce1b('0x1c'))(new Redis(config['redis']));require(_0xce1b('0x1d'))[_0xce1b('0x1e')](socket);function respondWithStatusCode(_0x59448f,_0x1b448b){_0x1b448b=_0x1b448b||0xcc;return function(_0x1ac5f8){if(_0x1ac5f8){return _0x59448f[_0xce1b('0x1f')](_0x1b448b);}return _0x59448f[_0xce1b('0x20')](_0x1b448b)[_0xce1b('0x21')]();};}function respondWithResult(_0x1a35d6,_0x12e1d1){_0x12e1d1=_0x12e1d1||0xc8;return function(_0x391d48){if(_0x391d48){return _0x1a35d6[_0xce1b('0x20')](_0x12e1d1)[_0xce1b('0x22')](_0x391d48);}};}function respondWithFilteredResult(_0x186ddc,_0x21bb83){return function(_0x13fe5c){if(_0x13fe5c){var _0x1a6c8f=_0x13fe5c[_0xce1b('0x23')],_0x299f80=_0x21bb83[_0xce1b('0x24')],_0x5c688e=_0x21bb83[_0xce1b('0x24')]+_0x21bb83[_0xce1b('0x25')],_0x562750;if(_0x5c688e>=_0x1a6c8f){_0x5c688e=_0x1a6c8f;_0x562750=0xc8;}else{_0x562750=0xce;}_0x186ddc[_0xce1b('0x20')](_0x562750);return _0x186ddc['set']('Content-Range',_0x299f80+'-'+_0x5c688e+'/'+_0x1a6c8f)[_0xce1b('0x22')](_0x13fe5c);}return null;};}function patchUpdates(_0x49f59f){return function(_0x3e8866){try{jsonpatch[_0xce1b('0x26')](_0x3e8866,_0x49f59f,!![]);}catch(_0x46fff9){return BPromise[_0xce1b('0x27')](_0x46fff9);}return _0x3e8866[_0xce1b('0x28')]();};}function saveUpdates(_0x1b5133,_0x13fd10){return function(_0x20467a){if(_0x20467a){return _0x20467a[_0xce1b('0x29')](_0x1b5133)[_0xce1b('0x2a')](function(_0x5a5827){return _0x5a5827;});}return null;};}function removeEntity(_0x5c2f56,_0x15944b){return function(_0x1a1ded){if(_0x1a1ded){return _0x1a1ded['destroy']()[_0xce1b('0x2a')](function(){_0x5c2f56[_0xce1b('0x20')](0xcc)[_0xce1b('0x21')]();});}};}function handleEntityNotFound(_0x39148b,_0x3ce4e9){return function(_0x268376){if(!_0x268376){_0x39148b[_0xce1b('0x1f')](0x194);}return _0x268376;};}function handleError(_0x3cbe0d,_0x2b6e03){_0x2b6e03=_0x2b6e03||0x1f4;return function(_0x36c3f9){logger['error'](_0x36c3f9[_0xce1b('0x2b')]);if(_0x36c3f9[_0xce1b('0x2c')]){delete _0x36c3f9[_0xce1b('0x2c')];}_0x3cbe0d[_0xce1b('0x20')](_0x2b6e03)[_0xce1b('0x2d')](_0x36c3f9);};}function getInteractionUsers(_0xe559af,_0x2b2bfa){return new BPromise(function(_0x19d8fd,_0x3ab84a){try{if(_0x2b2bfa[_0xe559af['id']]){_0xe559af[_0xce1b('0x2e')]=_[_0xce1b('0x2f')](_0x2b2bfa[_0xe559af['id']],function(_0x2e2be7){return{'id':_0x2e2be7['id'],'fullname':_0x2e2be7[_0xce1b('0x30')]};});}}catch(_0x4efbd3){_0x3ab84a(_0x4efbd3);}_0x19d8fd(_0xe559af);});}function getInteractionTags(_0x9157cc,_0x264d3e){return new BPromise(function(_0x3f3dfa,_0x27002b){try{if(_0x9157cc[_0xce1b('0x31')]){_0x9157cc[_0xce1b('0x32')]=[];_0x9157cc['TagIds'][_0xce1b('0x33')](',')[_0xce1b('0x34')](function(_0x4ecda9){_0x9157cc['Tags'][_0xce1b('0x35')](_0x264d3e[_0x4ecda9]);});}delete _0x9157cc[_0xce1b('0x31')];}catch(_0x4ae397){_0x27002b(_0x4ae397);}_0x3f3dfa(_0x9157cc);});}function updateOpenchannelInteraction(_0x5086e4,_0x58ca15,_0xba9a9){return new BPromise(function(_0x20af5,_0xc3b6b7){return getInteractionUsers(_0x5086e4,_0xba9a9)[_0xce1b('0x2a')](function(_0x3d2e66){return getInteractionTags(_0x3d2e66,_0x58ca15);})['then'](function(_0x56e2fc){_0x20af5(_0x56e2fc);})['catch'](function(_0x3cb125){_0xc3b6b7(_0x3cb125);});});}exports[_0xce1b('0x36')]=function(_0xd7d9e,_0x11aefb){var _0x4aa907={},_0x35a406={},_0x247ded={'count':0x0,'rows':[]};var _0x3d1915=_[_0xce1b('0x2f')](db[_0xce1b('0x37')][_0xce1b('0x38')],function(_0x5592f4){return{'name':_0x5592f4['fieldName'],'type':_0x5592f4[_0xce1b('0x39')][_0xce1b('0x3a')]};});_0x35a406[_0xce1b('0x3b')]=_['map'](_0x3d1915,'name');_0x35a406[_0xce1b('0x3c')]=_[_0xce1b('0x3d')](_0xd7d9e[_0xce1b('0x3c')]);_0x35a406[_0xce1b('0x3e')]=_[_0xce1b('0x3f')](_0x35a406[_0xce1b('0x3b')],_0x35a406[_0xce1b('0x3c')]);_0x4aa907[_0xce1b('0x40')]=_[_0xce1b('0x3f')](_0x35a406[_0xce1b('0x3b')],qs[_0xce1b('0x41')](_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x41')]));_0x4aa907[_0xce1b('0x40')]=_0x4aa907[_0xce1b('0x40')][_0xce1b('0x42')]?_0x4aa907[_0xce1b('0x40')]:_0x35a406[_0xce1b('0x3b')];if(!_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x43')](_0xce1b('0x44'))){_0x4aa907[_0xce1b('0x25')]=qs[_0xce1b('0x25')](_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x25')]);_0x4aa907[_0xce1b('0x24')]=qs['offset'](_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x24')]);}_0x4aa907[_0xce1b('0x45')]=qs[_0xce1b('0x46')](_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x46')]);_0x4aa907[_0xce1b('0x47')]=qs[_0xce1b('0x3e')](_[_0xce1b('0x48')](_0xd7d9e[_0xce1b('0x3c')],_0x35a406[_0xce1b('0x3e')]),_0x3d1915);var _0x232f79=[];var _0x419e37=squel[_0xce1b('0x49')]()[_0xce1b('0x4a')]('id')[_0xce1b('0x4a')](_0xce1b('0x2c'))[_0xce1b('0x4a')]('color')[_0xce1b('0x4b')](_0xce1b('0x4c'));var _0x477837=squel[_0xce1b('0x49')]()[_0xce1b('0x4a')]('u.id')['field'](_0xce1b('0x4d'))['field'](_0xce1b('0x4e'))[_0xce1b('0x4b')](_0xce1b('0x4f'),'ui')['left_join'](_0xce1b('0x50'),'u',_0xce1b('0x51'));var _0x107254=squel[_0xce1b('0x49')]()[_0xce1b('0x4b')]('openchannel_interactions','i')[_0xce1b('0x52')](_0xce1b('0x53'),'c',_0xce1b('0x54'))['left_join'](_0xce1b('0x50'),'o','o.id\x20=\x20i.UserId')[_0xce1b('0x52')](_0xce1b('0x55'),'a',_0xce1b('0x56'))['left_join'](_0xce1b('0x57'),'me',_0xce1b('0x58'))['left_join']('openchannel_interaction_has_tags','it',_0xce1b('0x59'))[_0xce1b('0x52')](_0xce1b('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x5b0963=squel[_0xce1b('0x5a')]();var _0x47bea9=[];var _0x33696a=squel[_0xce1b('0x5a')]();var _0x4eaff1;if(_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x5b')]){_0x4eaff1=as[_0xce1b('0x5c')](_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x5b')]);var _0x1bed47=_0x4eaff1[_0xce1b('0x5d')];for(var _0x32d6e9=0x0;_0x32d6e9<_0x4eaff1['conditions'][_0xce1b('0x42')];_0x32d6e9++){var _0x4b298e=_0x4eaff1[_0xce1b('0x5e')][_0x32d6e9];var _0x512cb5='i';var _0x280234=_[_0xce1b('0x5f')](_0x3d1915,[_0xce1b('0x2c'),_0x4b298e['field']]);if(!_0x280234){switch(_0x4b298e[_0xce1b('0x4a')]){case'unreadMessages':if(_0x4b298e[_0xce1b('0x60')]==0x1){_0x107254[_0xce1b('0x61')]('`'+_0x4b298e[_0xce1b('0x4a')]+_0xce1b('0x62'));}else{_0x107254[_0xce1b('0x61')]('`'+_0x4b298e[_0xce1b('0x4a')]+_0xce1b('0x63'));}break;case _0xce1b('0x64'):if(_0x4b298e[_0xce1b('0x65')]===_0xce1b('0x66')){if(_0x4b298e[_0xce1b('0x60')]['split']('\x20')['length']>0x1){_0x5b0963[_0x1bed47]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xce1b('0x67')](_0x4b298e[_0xce1b('0x60')]),null);}else{var _0x21a83d='%'+_0x4b298e[_0xce1b('0x60')]+'%';_0x5b0963[_0x1bed47](_0xce1b('0x68'),_0x21a83d,_0x21a83d,_0x21a83d);}}else{_0x280234=_[_0xce1b('0x5f')](_0x3d1915,['name',_0xce1b('0x69')]);_0x4b298e[_0xce1b('0x4a')]=_0xce1b('0x69');_0x27df57=as['buildExpression'](_0x512cb5,_0x280234[_0xce1b('0x39')],_0x4b298e);_0x5b0963[_0x1bed47](_0x27df57['text'],_0x27df57['value']['start'],_0x27df57[_0xce1b('0x60')][_0xce1b('0x21')]);}break;case _0xce1b('0x6a'):var _0x49375c=_0x4b298e[_0xce1b('0x60')][_0xce1b('0x33')](',')[_0xce1b('0x2f')](function(_0x13d088){return Number(_0x13d088);});_0x49375c[_0xce1b('0x34')](function(_0x1a7e9b){_0x33696a['or'](_0xce1b('0x6b'),'%,'+_0x1a7e9b+',%');});_0x47bea9=_[_0xce1b('0x6c')](_0x47bea9,_0x49375c);break;case _0xce1b('0x6d'):if(_0x4b298e[_0xce1b('0x65')]===_0xce1b('0x66')){_0x5b0963[_0x1bed47](_0xce1b('0x6e'),'%'+_0x4b298e[_0xce1b('0x60')]+'%',null);}else{_0x280234=_['find'](_0x3d1915,[_0xce1b('0x2c'),_0xce1b('0x6f')]);_0x4b298e[_0xce1b('0x4a')]=_0xce1b('0x6f');_0x27df57=as['buildExpression'](_0x512cb5,_0x280234[_0xce1b('0x39')],_0x4b298e);_0x5b0963[_0x1bed47](_0x27df57[_0xce1b('0x70')],_0x27df57['value'][_0xce1b('0x71')],_0x27df57[_0xce1b('0x60')][_0xce1b('0x21')]);}break;case _0xce1b('0x72'):_0x27df57=as[_0xce1b('0x73')]('me',null,_0x4b298e);_0x5b0963[_0x1bed47](_0x27df57[_0xce1b('0x70')],_0x27df57[_0xce1b('0x60')][_0xce1b('0x71')],_0x27df57[_0xce1b('0x60')]['end']);break;}}else{var _0x27df57=as[_0xce1b('0x73')](_0x512cb5,_0x280234[_0xce1b('0x39')],_0x4b298e);_0x5b0963[_0x1bed47](_0x27df57['text'],_0x27df57[_0xce1b('0x60')][_0xce1b('0x71')],_0x27df57[_0xce1b('0x60')][_0xce1b('0x21')]);}}}else{var _0x3128ae=_(_0xd7d9e['query'])[_0xce1b('0x3d')]()['map'](function(_0x587fae){return _[_0xce1b('0x74')](_0x3d1915,[_0xce1b('0x2c'),_0x587fae])?_0x587fae:undefined;})[_0xce1b('0x75')]()[_0xce1b('0x60')]();if(!_[_0xce1b('0x76')](_0x3128ae)){_0x3128ae['forEach'](function(_0x525072){if(_0x525072===_0xce1b('0x77')){_0x107254['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0xce1b('0x78')](_0xd7d9e[_0xce1b('0x3c')][_0x525072]));}else if(_0x525072===_0xce1b('0x79')){var _0x24b9b9=JSON[_0xce1b('0x7a')](_0xd7d9e['query'][_0x525072])[_0xce1b('0x7b')];var _0x41f1cc=JSON[_0xce1b('0x7a')](_0xd7d9e['query'][_0x525072])[_0xce1b('0x7c')];_0x107254[_0xce1b('0x47')](_0xce1b('0x7d'),_0x24b9b9,_0x41f1cc);}else{if(_0xd7d9e[_0xce1b('0x3c')][_0x525072]===_0xce1b('0x7e')){_0x107254[_0xce1b('0x47')]('i.'+_0x525072+_0xce1b('0x7f'));}else{_0x107254[_0xce1b('0x47')]('i.'+_0x525072+_0xce1b('0x80'),_0xd7d9e[_0xce1b('0x3c')][_0x525072]);}}});}if(_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x81')]){if(_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x81')]==0x1){_0x107254[_0xce1b('0x61')](_0xce1b('0x82'));}else{_0x107254['having'](_0xce1b('0x83'));}}if(_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x84')]){_0x47bea9=_[_0xce1b('0x85')](_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x84')])?_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x84')]:new Array(_0xd7d9e['query'][_0xce1b('0x84')]);_0x47bea9[_0xce1b('0x34')](function(_0x5e6f2b){_0x33696a['or'](_0xce1b('0x6b'),'%,'+_0x5e6f2b+',%');});}if(_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x86')]){var _0x1d10b1=_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x86')][_0xce1b('0x87')]('\x5c','\x5c\x5c')[_0xce1b('0x87')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x1d10b1)){_0x5b0963['or'](_0xce1b('0x88'),_0x1d10b1+'%');}else{_0x5b0963['or'](_0xce1b('0x89'),qs[_0xce1b('0x67')](_0x1d10b1))['or'](_0xce1b('0x8a'),_0x1d10b1+'%')['or'](_0xce1b('0x8b'),_0x1d10b1+'%');}}}_0x107254[_0xce1b('0x47')](_0x5b0963);_0x107254[_0xce1b('0x8c')](_0xce1b('0x8d'));var _0x617e42={'type':db[_0xce1b('0x8e')][_0xce1b('0x8f')][_0xce1b('0x90')],'raw':!![]};var _0x32846c=_0x107254[_0xce1b('0x91')]();_0x32846c[_0xce1b('0x4a')](_0xce1b('0x8d'));_0x32846c['field'](_0xce1b('0x92'),'unreadMessages');if(_0x4aa907[_0xce1b('0x45')]){_0x4aa907[_0xce1b('0x45')][_0xce1b('0x34')](function(_0x5160ef){_0x107254[_0xce1b('0x45')]('i.'+_0x5160ef[0x0],_0x5160ef[0x1]===_0xce1b('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x47bea9)){_0x107254[_0xce1b('0x61')](_0x33696a);_0x32846c[_0xce1b('0x47')](_0xce1b('0x94'),_0x47bea9);}BPromise['resolve']()[_0xce1b('0x2a')](function(){if(!_0x4eaff1){if(_0xd7d9e[_0xce1b('0x3c')]['OpenchannelAccountId']||_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x95')])return;_0x32846c[_0xce1b('0x47')](_0xce1b('0x96'));_0x107254[_0xce1b('0x47')](_0xce1b('0x96'));return;}return _0xd7d9e[_0xce1b('0x97')][_0xce1b('0x98')]({'attributes':['id'],'raw':!![]})[_0xce1b('0x2a')](function(_0x2f1aa2){if(_[_0xce1b('0x76')](_0x2f1aa2)){_0x32846c['where'](_0xce1b('0x99'));_0x107254[_0xce1b('0x47')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x32846c[_0xce1b('0x47')](_0xce1b('0x9a'),_[_0xce1b('0x2f')](_0x2f1aa2,'id'));_0x107254[_0xce1b('0x47')](_0xce1b('0x9a'),_[_0xce1b('0x2f')](_0x2f1aa2,'id'));}});})[_0xce1b('0x2a')](function(){db['sequelize'][_0xce1b('0x3c')](_0x32846c['toString'](),_0x617e42)[_0xce1b('0x2a')](function(_0x2c591b){_0x247ded[_0xce1b('0x23')]=_0x2c591b[_0xce1b('0x42')];if(_0x247ded[_0xce1b('0x23')]===0x0)return[];return db[_0xce1b('0x9b')][_0xce1b('0x3c')](_0x419e37['toString'](),_0x617e42)['then'](function(_0xeacfb7){_0x232f79=_[_0xce1b('0x9c')](_0xeacfb7,'id');_0x617e42=_['merge'](_0x617e42,{'model':db[_0xce1b('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd7d9e[_0xce1b('0x3c')][_0xce1b('0x41')]){_0x4aa907[_0xce1b('0x40')]['forEach'](function(_0x4ec996){_0x107254[_0xce1b('0x4a')]('i.'+_0x4ec996);});}else{_0x107254['field'](_0xce1b('0x92'),_0xce1b('0x9d'));_0x107254[_0xce1b('0x4a')]('a.key',_0xce1b('0x9e'));_0x107254['field']('a.mandatoryDisposition',_0xce1b('0x9f'));_0x107254[_0xce1b('0x4a')](_0xce1b('0xa0'));_0x107254[_0xce1b('0x4a')](_0xce1b('0xa1'),_0xce1b('0xa2'));_0x107254[_0xce1b('0x4a')](_0xce1b('0xa3'),'Contact.lastName');_0x107254[_0xce1b('0x4a')](_0xce1b('0xa4'),_0xce1b('0xa5'));_0x107254['field'](_0xce1b('0xa6'),_0xce1b('0xa7'));_0x107254['field'](_0xce1b('0xa8'),_0xce1b('0xa9'));_0x107254[_0xce1b('0x4a')]('c.fax',_0xce1b('0xaa'));_0x107254[_0xce1b('0x4a')]('o.fullname','Owner.fullname');_0x107254[_0xce1b('0x4a')](_0xce1b('0xab'),_0xce1b('0xac'));_0x107254[_0xce1b('0x4a')](_0xce1b('0xad'),_0xce1b('0x31'));}if(_0x4aa907[_0xce1b('0x25')])_0x107254['limit'](_0x4aa907[_0xce1b('0x25')]);if(_0x4aa907[_0xce1b('0x24')])_0x107254[_0xce1b('0x24')](_0x4aa907[_0xce1b('0x24')]);return db[_0xce1b('0x9b')]['query'](_0x107254['toString'](),_0x617e42);})[_0xce1b('0x2a')](function(_0x5cd564){_0x477837['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xce1b('0x2f')](_0x5cd564,'id'));return db[_0xce1b('0x9b')][_0xce1b('0x3c')](_0x477837[_0xce1b('0xae')](),_0x617e42)['then'](function(_0x44c995){var _0x5675e8=_[_0xce1b('0xaf')](_0x44c995,_0xce1b('0xb0'));var _0x621849=[];_0x5cd564[_0xce1b('0x34')](function(_0x3b7156){_0x621849[_0xce1b('0x35')](updateOpenchannelInteraction(_0x3b7156,_0x232f79,_0x5675e8));});return BPromise[_0xce1b('0xb1')](_0x621849);});});})['then'](function(_0x4235d6){_0x247ded[_0xce1b('0xb2')]=_0x4235d6;return _0x247ded;})['then'](respondWithFilteredResult(_0x11aefb,_0x4aa907));})[_0xce1b('0xb3')](handleError(_0x11aefb,null));};exports['show']=function(_0x41f157,_0x2f414b){var _0x550eb0={'raw':![],'where':{'id':_0x41f157[_0xce1b('0xb4')]['id']}},_0x1f8d94={};_0x1f8d94[_0xce1b('0x3b')]=_[_0xce1b('0x3d')](db['OpenchannelInteraction'][_0xce1b('0x38')]);_0x1f8d94[_0xce1b('0x3c')]=_[_0xce1b('0x3d')](_0x41f157[_0xce1b('0x3c')]);_0x1f8d94[_0xce1b('0x3e')]=_[_0xce1b('0x3f')](_0x1f8d94[_0xce1b('0x3b')],_0x1f8d94[_0xce1b('0x3c')]);_0x550eb0[_0xce1b('0x40')]=_[_0xce1b('0x3f')](_0x1f8d94[_0xce1b('0x3b')],qs['fields'](_0x41f157[_0xce1b('0x3c')][_0xce1b('0x41')]));_0x550eb0[_0xce1b('0x40')]=_0x550eb0[_0xce1b('0x40')]['length']?_0x550eb0[_0xce1b('0x40')]:_0x1f8d94['model'];if(_0x41f157[_0xce1b('0x3c')][_0xce1b('0xb5')]){_0x550eb0['include']=[{'all':!![]}];}_0x550eb0=_[_0xce1b('0xb6')]({},_0x550eb0,_0x41f157[_0xce1b('0xb7')]);return db[_0xce1b('0x37')]['find'](_0x550eb0)[_0xce1b('0x2a')](handleEntityNotFound(_0x2f414b,null))[_0xce1b('0x2a')](respondWithResult(_0x2f414b,null))[_0xce1b('0xb3')](handleError(_0x2f414b,null));};exports[_0xce1b('0xb8')]=function(_0x8a12cc,_0x52d86b){return db['OpenchannelInteraction']['create'](_0x8a12cc[_0xce1b('0x72')],{})[_0xce1b('0x2a')](respondWithResult(_0x52d86b,0xc9))[_0xce1b('0xb3')](handleError(_0x52d86b,null));};exports['update']=function(_0x3936a4,_0x4d5145){if(_0x3936a4[_0xce1b('0x72')]['id']){delete _0x3936a4[_0xce1b('0x72')]['id'];}return db[_0xce1b('0x37')]['find']({'where':{'id':_0x3936a4[_0xce1b('0xb4')]['id']}})[_0xce1b('0x2a')](handleEntityNotFound(_0x4d5145,null))[_0xce1b('0x2a')](saveUpdates(_0x3936a4[_0xce1b('0x72')],null))[_0xce1b('0x2a')](respondWithResult(_0x4d5145,null))[_0xce1b('0xb3')](handleError(_0x4d5145,null));};exports[_0xce1b('0xb9')]=function(_0x19fc0d,_0x5b094d){return db['OpenchannelInteraction'][_0xce1b('0x5f')]({'where':{'id':_0x19fc0d[_0xce1b('0xb4')]['id']}})[_0xce1b('0x2a')](handleEntityNotFound(_0x5b094d,null))[_0xce1b('0x2a')](removeEntity(_0x5b094d,null))[_0xce1b('0xb3')](handleError(_0x5b094d,null));};exports[_0xce1b('0xba')]=function(_0x29a8db,_0x5040dc){return db[_0xce1b('0x37')][_0xce1b('0xba')]()[_0xce1b('0x2a')](respondWithResult(_0x5040dc,null))[_0xce1b('0xb3')](handleError(_0x5040dc,null));};exports[_0xce1b('0xbb')]=function(_0x1786cb,_0x60d7e0,_0x12efdc){return db['OpenchannelMessage'][_0xce1b('0x5f')]({'where':{'id':_0x1786cb['params']['id']}})[_0xce1b('0x2a')](handleEntityNotFound(_0x60d7e0,null))[_0xce1b('0x2a')](function(_0x586714){if(_0x586714){return _0x586714['addMessage'](_0x1786cb[_0xce1b('0x72')][_0xce1b('0xbc')],_[_0xce1b('0xbd')](_0x1786cb['body'],[_0xce1b('0xbc'),'id'])||{});}})[_0xce1b('0x2a')](respondWithResult(_0x60d7e0,null))[_0xce1b('0xb3')](handleError(_0x60d7e0,null));};exports['getMessages']=function(_0x5dea33,_0x2868dd,_0x6400dc){var _0x2050a2={'raw':![],'where':{}};var _0x298428={};var _0x5bf4a8={'count':0x0,'rows':[]};return db[_0xce1b('0x37')][_0xce1b('0xbe')]({'where':{'id':_0x5dea33['params']['id']}})[_0xce1b('0x2a')](handleEntityNotFound(_0x2868dd,null))['then'](function(_0x1ea272){if(_0x1ea272){_0x298428[_0xce1b('0x3b')]=_['keys'](db['OpenchannelMessage'][_0xce1b('0x38')]);_0x298428[_0xce1b('0x3c')]=_[_0xce1b('0x3d')](_0x5dea33['query']);_0x298428[_0xce1b('0x3e')]=_['intersection'](_0x298428[_0xce1b('0x3b')],_0x298428[_0xce1b('0x3c')]);_0x2050a2[_0xce1b('0x40')]=_[_0xce1b('0x3f')](_0x298428[_0xce1b('0x3b')],qs['fields'](_0x5dea33[_0xce1b('0x3c')][_0xce1b('0x41')]));_0x2050a2['attributes']=_0x2050a2['attributes']['length']?_0x2050a2[_0xce1b('0x40')]:_0x298428[_0xce1b('0x3b')];if(!_0x5dea33[_0xce1b('0x3c')]['hasOwnProperty']('nolimit')){_0x2050a2[_0xce1b('0x25')]=qs[_0xce1b('0x25')](_0x5dea33[_0xce1b('0x3c')][_0xce1b('0x25')]);_0x2050a2['offset']=qs['offset'](_0x5dea33[_0xce1b('0x3c')][_0xce1b('0x24')]);}_0x2050a2[_0xce1b('0x45')]=qs[_0xce1b('0x46')](_0x5dea33[_0xce1b('0x3c')][_0xce1b('0x46')]);_0x2050a2[_0xce1b('0x47')]=qs[_0xce1b('0x3e')](_['pick'](_0x5dea33[_0xce1b('0x3c')],_0x298428[_0xce1b('0x3e')]));_0x2050a2['where'][_0xce1b('0xb0')]=_0x1ea272['id'];if(_0x5dea33['query'][_0xce1b('0x86')]){_0x2050a2['where']=_['merge'](_0x2050a2[_0xce1b('0x47')],{'$or':_[_0xce1b('0x2f')](_0x2050a2[_0xce1b('0x40')],function(_0x5acfc2){var _0xc8f375={};_0xc8f375[_0x5acfc2]={'$like':'%'+_0x5dea33['query']['filter']+'%'};return _0xc8f375;})});}if(_0x5dea33['query'][_0xce1b('0x7b')]){var _0x1a153a=_0x5dea33[_0xce1b('0x3c')][_0xce1b('0x7b')][_0xce1b('0x33')](',');var _0x2aa546={};_0x2aa546[_0x1a153a[0x0]]={'$gte':moment(_0x1a153a[0x1])[_0xce1b('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2050a2[_0xce1b('0x47')]=_[_0xce1b('0xb6')](_0x2050a2['where'],_0x2aa546);}_0x2050a2=_['merge']({},_0x2050a2,_0x5dea33[_0xce1b('0xb7')]);return db['OpenchannelMessage']['count']({'where':_0x2050a2['where']})[_0xce1b('0x2a')](function(_0x1c9d56){_0x5bf4a8[_0xce1b('0x23')]=_0x1c9d56;if(_0x5dea33['query']['includeAll']){_0x2050a2[_0xce1b('0xc0')]=[{'all':!![]}];}return db[_0xce1b('0xc1')]['findAll'](_0x2050a2);})['then'](function(_0x29e71d){_0x5bf4a8[_0xce1b('0xb2')]=_0x29e71d;return _0x5bf4a8;});}})[_0xce1b('0x2a')](respondWithFilteredResult(_0x2868dd,_0x2050a2))['catch'](handleError(_0x2868dd,null));};exports['addTags']=function(_0x571f0f,_0xc6a56b,_0x51b105){return db['OpenchannelInteraction'][_0xce1b('0x5f')]({'where':{'id':_0x571f0f[_0xce1b('0xb4')]['id']}})[_0xce1b('0x2a')](handleEntityNotFound(_0xc6a56b,null))[_0xce1b('0x2a')](function(_0x20a8fa){if(_0x20a8fa){return _0x20a8fa[_0xce1b('0xc2')](_0x571f0f['body'][_0xce1b('0xbc')],_['omit'](_0x571f0f['body'],[_0xce1b('0xbc'),'id'])||{})[_0xce1b('0xc3')](function(){return db[_0xce1b('0x6a')][_0xce1b('0xc4')]({'attributes':['id','name',_0xce1b('0xc5')],'where':{'id':_0x571f0f[_0xce1b('0x72')]['ids']}});})[_0xce1b('0x2a')](function(_0x1a5ae5){socket['emit'](_0xce1b('0xc6'),{'id':Number(_0x571f0f[_0xce1b('0xb4')]['id']),'tags':_0x1a5ae5||[]});return{'id':Number(_0x571f0f['params']['id']),'tags':_0x1a5ae5||[]};});}})[_0xce1b('0x2a')](respondWithResult(_0xc6a56b,null))[_0xce1b('0xb3')](handleError(_0xc6a56b,null));};exports['removeTags']=function(_0x5f5946,_0x53da6e,_0x236084){return db[_0xce1b('0x37')][_0xce1b('0x5f')]({'where':{'id':_0x5f5946['params']['id']}})[_0xce1b('0x2a')](handleEntityNotFound(_0x53da6e,null))[_0xce1b('0x2a')](function(_0xfe5ecd){if(_0xfe5ecd){return _0xfe5ecd[_0xce1b('0xc7')](_0x5f5946['query'][_0xce1b('0xbc')]);}})[_0xce1b('0x2a')](respondWithStatusCode(_0x53da6e,null))[_0xce1b('0xb3')](handleError(_0x53da6e,null));};exports['download']=function(_0x3ea0f1,_0x33396d){var _0xb9bb35=moment()[_0xce1b('0xc8')]()[_0xce1b('0xae')]();var _0x347124=path['join'](config[_0xce1b('0xc9')],'server','files',_0xce1b('0xca'));var _0x178e36=path['join'](config[_0xce1b('0xc9')],'server','files','attachments');var _0x2fb3a3=path[_0xce1b('0xcb')](_0x347124,_0xb9bb35);var _0x8bf969=util[_0xce1b('0xbf')](_0xce1b('0xcc'),_0x3ea0f1[_0xce1b('0xb4')]['id'],_0xb9bb35);var _0x1f3564=path[_0xce1b('0xcb')](_0x347124,_0x8bf969);var _0x17876f=[];_0x17876f[_0xce1b('0x35')]({'model':db[_0xce1b('0x6d')],'as':'User','attributes':['id',_0xce1b('0x30')],'raw':!![]});_0x17876f['push']({'model':db[_0xce1b('0xcd')],'as':'Contact','attributes':['id',_0xce1b('0xce'),_0xce1b('0xcf')],'raw':!![]});if(_0x3ea0f1[_0xce1b('0x3c')][_0xce1b('0xd0')]){_0x17876f['push']({'model':db[_0xce1b('0xd1')],'as':_0xce1b('0xd1'),'raw':!![]});}var _0x29a7e7=[{'model':db[_0xce1b('0xc1')],'as':_0xce1b('0xd2'),'attributes':['id',_0xce1b('0x72'),'createdAt',_0xce1b('0xd3'),_0xce1b('0xd4'),_0xce1b('0x81')],'include':_0x17876f}];_0x29a7e7[_0xce1b('0x35')]({'model':db['OpenchannelAccount'],'as':_0xce1b('0xd5'),'attributes':['id','name']});_0x29a7e7[_0xce1b('0x35')]({'model':db['User'],'as':_0xce1b('0xd6'),'attributes':['id','fullname']});return db[_0xce1b('0x37')][_0xce1b('0x5f')]({'where':{'id':_0x3ea0f1[_0xce1b('0xb4')]['id']},'include':_0x29a7e7})[_0xce1b('0x2a')](handleEntityNotFound(_0x33396d,null))['then'](function(_0x406784){if(_0x406784){var _0x154e61=_0x406784[_0xce1b('0xd7')]({'plain':!![]});fs['mkdirSync'](_0x2fb3a3);var _0x3ea8e2={'format':'A4','border':_0xce1b('0xd8'),'header':{'height':_0xce1b('0xd9'),'contents':{'first':_0xce1b('0xda')}},'footer':{'height':_0xce1b('0xdb'),'contents':{'default':util[_0xce1b('0xbf')](_0xce1b('0xdc'),util[_0xce1b('0xbf')]('%s\x20#%d',_0xce1b('0xdd'),_0x154e61['id']),moment()[_0xce1b('0xbf')](_0xce1b('0xde'))[_0xce1b('0xae')]())}}};var _0x264999={'channel':_0xce1b('0xdd'),'account':_0x154e61[_0xce1b('0xd5')][_0xce1b('0x2c')],'agent':_0x154e61[_0xce1b('0xd6')]?_0x154e61['Owner']['fullname']:'N.A.','createdAt':moment(_0x154e61[_0xce1b('0x79')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x154e61[_0xce1b('0xdf')]?moment(_0x154e61['closedAt'])[_0xce1b('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0xce1b('0xae')]():'','disposition':_0x154e61[_0xce1b('0xe0')],'visibility':_0x154e61[_0xce1b('0xe1')]?'Public':'Private','messages':_(_0x154e61[_0xce1b('0xd2')])[_0xce1b('0x86')]({'secret':![]})[_0xce1b('0x2f')](function(_0x717552){if(_0x717552[_0xce1b('0xd1')]){var _0x12c9d2=path[_0xce1b('0xcb')](_0x178e36,_0x717552[_0xce1b('0xd1')]['basename']);if(fs['existsSync'](_0x12c9d2)){fs['createReadStream'](_0x12c9d2)[_0xce1b('0xe2')](fs[_0xce1b('0xe3')](path[_0xce1b('0xcb')](_0x2fb3a3,_0x717552[_0xce1b('0xd1')][_0xce1b('0xe4')])));}}return{'date':moment(_0x717552['createdAt'])[_0xce1b('0xbf')](_0xce1b('0xe5'))[_0xce1b('0xae')](),'sender':_0x717552[_0xce1b('0xd3')]===_0xce1b('0xe6')?_0x717552['User']?_0x717552[_0xce1b('0x6d')][_0xce1b('0x30')]:_0xce1b('0xe7'):_0x717552[_0xce1b('0x64')]['firstName']+(_0x717552[_0xce1b('0x64')][_0xce1b('0xcf')]?'\x20'+_0x717552[_0xce1b('0x64')]['lastName']:''),'body':_0x717552[_0xce1b('0xd1')]?_0x717552[_0xce1b('0xd1')][_0xce1b('0xe4')]:_0x717552[_0xce1b('0x72')],'direction':_0x717552[_0xce1b('0xd3')]===_0xce1b('0xe6')?'A':'C','secret':_0x717552[_0xce1b('0xd4')],'read':_0x717552[_0xce1b('0x81')],'attachment':_0x717552[_0xce1b('0xd1')]};})[_0xce1b('0x60')]()};return ejs[_0xce1b('0xe8')](path['join'](config[_0xce1b('0xc9')],_0xce1b('0xe9'),_0xce1b('0xea'),_0xce1b('0xeb')),{'interaction':_0x264999})[_0xce1b('0x2a')](function(_0x48345a){return new BPromise(function(_0x54d875,_0x5d4bcb){pdf[_0xce1b('0xb8')](_0x48345a,_0x3ea8e2)[_0xce1b('0xec')](path[_0xce1b('0xcb')](_0x2fb3a3,'transcript-'+_0x154e61['id']+'-'+_0xb9bb35+_0xce1b('0xed')),function(_0x4ae8e9,_0x152562){if(_0x4ae8e9)return _0x5d4bcb(_0x4ae8e9);_0x54d875(_0x152562);});});})['then'](function(){return new BPromise(function(_0x7a6887,_0x56837b){zipdir(_0x2fb3a3,{'saveTo':_0x1f3564},function(_0x531d91,_0x59da4d){if(_0x531d91)return _0x56837b(_0x531d91);return _0x7a6887(_0x59da4d);});})['then'](function(){return new BPromise(function(_0x5e6cb5,_0xd7f742){rimraf(_0x2fb3a3,function(_0x5e004b){if(_0x5e004b)_0xd7f742(_0x5e004b);return _0x5e6cb5();});});})[_0xce1b('0x2a')](function(){return _0x33396d['download'](_0x1f3564,_0x8bf969,function(_0xe6ccab){if(_0xe6ccab){console[_0xce1b('0xee')]('err',_0xe6ccab);}else{fs[_0xce1b('0xef')](_0x1f3564);}});});});}else{return _0x33396d['sendStatus'](0xc8);}})[_0xce1b('0xb3')](handleError(_0x33396d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 7d1cc0f..8ec2e58 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 _0x59b6=['unreadMessages','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','findAll'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x59b6,0x1e5));var _0x659b=function(_0x43a59d,_0x2820e8){_0x43a59d=_0x43a59d-0x0;var _0x52b6e8=_0x59b6[_0x43a59d];return _0x52b6e8;};'use strict';var EventEmitter=require(_0x659b('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x659b('0x1'))['db'][_0x659b('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x659b('0x3')](0x0);var events={'afterCreate':_0x659b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x486d17){return function(_0x58800b,_0x14de84,_0x56112b){_0x58800b[_0x659b('0x5')]({'attributes':['id'],'raw':!![]})[_0x659b('0x6')](function(_0x1b43e3){_0x58800b[_0x659b('0x7')](_0x659b('0x8'),_0x1b43e3['map'](function(_0x9785fc){return{'id':_0x9785fc['id']};}));return OpenchannelMessage[_0x659b('0x9')]({'where':{'OpenchannelInteractionId':_0x58800b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x434752){_0x58800b[_0x659b('0x7')](_0x659b('0xa'),_0x434752['length']);OpenchannelInteractionEvents[_0x659b('0xb')](_0x486d17+':'+_0x58800b['id'],_0x58800b);OpenchannelInteractionEvents[_0x659b('0xb')](_0x486d17,_0x58800b);_0x56112b(null);})[_0x659b('0xc')](_0x56112b(null));};}for(var e in events){if(events[_0x659b('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x659b('0xe')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x2390=['emit','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','save','remove','getUsers','Users','map','findAll','setDataValue','unreadMessages'];(function(_0x301c34,_0x15701e){var _0x1a8c5a=function(_0x297b4f){while(--_0x297b4f){_0x301c34['push'](_0x301c34['shift']());}};_0x1a8c5a(++_0x15701e);}(_0x2390,0x154));var _0x0239=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x2390[_0x1d24eb];return _0x1dc576;};'use strict';var EventEmitter=require(_0x0239('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x0239('0x1')];var OpenchannelMessage=require(_0x0239('0x2'))['db'][_0x0239('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0239('0x4'),'afterUpdate':'update','afterDestroy':_0x0239('0x5')};function emitEvent(_0x442d56){return function(_0x562413,_0x28a4d9,_0x54b66d){_0x562413[_0x0239('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x214c86){_0x562413['setDataValue'](_0x0239('0x7'),_0x214c86[_0x0239('0x8')](function(_0x52a21b){return{'id':_0x52a21b['id']};}));return OpenchannelMessage[_0x0239('0x9')]({'where':{'OpenchannelInteractionId':_0x562413['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x361403){_0x562413[_0x0239('0xa')](_0x0239('0xb'),_0x361403['length']);OpenchannelInteractionEvents[_0x0239('0xc')](_0x442d56+':'+_0x562413['id'],_0x562413);OpenchannelInteractionEvents['emit'](_0x442d56,_0x562413);_0x54b66d(null);})['catch'](_0x54b66d(null));};}for(var e in events){if(events[_0x0239('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x0239('0xe')](e,emitEvent(event));}}module[_0x0239('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 158dba1..40792c4 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 _0xbbc0=['rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x27d19b,_0x288033){var _0x336e22=function(_0x379f91){while(--_0x379f91){_0x27d19b['push'](_0x27d19b['shift']());}};_0x336e22(++_0x288033);}(_0xbbc0,0x1ca));var _0x0bbc=function(_0x15165e,_0x47648c){_0x15165e=_0x15165e-0x0;var _0x3383e3=_0xbbc0[_0x15165e];return _0x3383e3;};'use strict';var _=require(_0x0bbc('0x0'));var util=require(_0x0bbc('0x1'));var logger=require(_0x0bbc('0x2'))('api');var moment=require(_0x0bbc('0x3'));var BPromise=require('bluebird');var rp=require(_0x0bbc('0x4'));var fs=require('fs');var path=require(_0x0bbc('0x5'));var rimraf=require(_0x0bbc('0x6'));var config=require(_0x0bbc('0x7'));var attributes=require(_0x0bbc('0x8'));module[_0x0bbc('0x9')]=function(_0x37d8c7,_0x5873ab){return _0x37d8c7[_0x0bbc('0xa')](_0x0bbc('0xb'),attributes,{'tableName':_0x0bbc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3028ad,_0x2bcfde,_0x3a32f4){if(_0x3028ad[_0x0bbc('0xd')]('closed')){_0x3028ad['closedAt']=moment()[_0x0bbc('0xe')](_0x0bbc('0xf'));}_0x3a32f4(null,_0x3028ad);}}});}; \ No newline at end of file +var _0xa4e9=['changed','closed','closedAt','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','openchannel_interactions'];(function(_0x176aa9,_0x323e16){var _0x4d4f64=function(_0x1a370b){while(--_0x1a370b){_0x176aa9['push'](_0x176aa9['shift']());}};_0x4d4f64(++_0x323e16);}(_0xa4e9,0x12c));var _0x9a4e=function(_0x450289,_0xa76428){_0x450289=_0x450289-0x0;var _0x41ff32=_0xa4e9[_0x450289];return _0x41ff32;};'use strict';var _=require(_0x9a4e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9a4e('0x1'));var moment=require(_0x9a4e('0x2'));var BPromise=require(_0x9a4e('0x3'));var rp=require(_0x9a4e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a4e('0x5'));var config=require(_0x9a4e('0x6'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x4ca40a,_0x3513af){return _0x4ca40a['define']('OpenchannelInteraction',attributes,{'tableName':_0x9a4e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c15b6,_0x15490d,_0x4856a9){if(_0x2c15b6[_0x9a4e('0x8')](_0x9a4e('0x9'))){_0x2c15b6[_0x9a4e('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4856a9(null,_0x2c15b6);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 90c98c0..aa020f7 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 _0x9a24=['result','catch','OpenchannelInteraction','update','body','options','where','limit','stringify','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','request','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info'];(function(_0x23ec6f,_0x4bdf25){var _0xd05a98=function(_0x5c562b){while(--_0x5c562b){_0x23ec6f['push'](_0x23ec6f['shift']());}};_0xd05a98(++_0x4bdf25);}(_0x9a24,0x102));var _0x49a2=function(_0x599b30,_0x45fca0){_0x599b30=_0x599b30-0x0;var _0xc90e76=_0x9a24[_0x599b30];return _0xc90e76;};'use strict';var _=require(_0x49a2('0x0'));var util=require('util');var moment=require(_0x49a2('0x1'));var BPromise=require(_0x49a2('0x2'));var rs=require(_0x49a2('0x3'));var fs=require('fs');var Redis=require(_0x49a2('0x4'));var db=require(_0x49a2('0x5'))['db'];var utils=require(_0x49a2('0x6'));var logger=require(_0x49a2('0x7'))('rpc');var config=require(_0x49a2('0x8'));var jayson=require(_0x49a2('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x49a2('0xa')]=_['defaults'](config[_0x49a2('0xa')],{'host':_0x49a2('0xb'),'port':0x18eb});var socket=require(_0x49a2('0xc'))(new Redis(config[_0x49a2('0xa')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x2eec4d,_0x2dc550,_0x219f8d){return new BPromise(function(_0x34360d,_0x387ba0){return client[_0x49a2('0xd')](_0x2eec4d,_0x219f8d)['then'](function(_0x4beb50){logger['info'](_0x49a2('0xe'),_0x2dc550,'request\x20sent');logger[_0x49a2('0xf')](_0x49a2('0x10'),_0x2dc550,_0x49a2('0x11'),JSON['stringify'](_0x4beb50));if(_0x4beb50[_0x49a2('0x12')]){if(_0x4beb50[_0x49a2('0x12')][_0x49a2('0x13')]===0x1f4){logger[_0x49a2('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2dc550,_0x4beb50[_0x49a2('0x12')][_0x49a2('0x14')]);return _0x387ba0(_0x4beb50[_0x49a2('0x12')][_0x49a2('0x14')]);}logger[_0x49a2('0x12')](_0x49a2('0xe'),_0x2dc550,_0x4beb50[_0x49a2('0x12')]['message']);return _0x34360d(_0x4beb50[_0x49a2('0x12')][_0x49a2('0x14')]);}else{logger[_0x49a2('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2dc550,_0x49a2('0x11'));_0x34360d(_0x4beb50[_0x49a2('0x16')][_0x49a2('0x14')]);}})[_0x49a2('0x17')](function(_0x3b2e57){logger[_0x49a2('0x12')](_0x49a2('0xe'),_0x2dc550,_0x3b2e57);_0x387ba0(_0x3b2e57);});});}exports['UpdateOpenchannelInteraction']=function(_0x1a7062){var _0x5e7f76=this;return new Promise(function(_0x2eb694,_0x236f88){return db[_0x49a2('0x18')][_0x49a2('0x19')](_0x1a7062[_0x49a2('0x1a')],{'raw':_0x1a7062['options']?_0x1a7062[_0x49a2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7062[_0x49a2('0x1b')]?_0x1a7062['options'][_0x49a2('0x1c')]||null:null,'attributes':_0x1a7062['options']?_0x1a7062[_0x49a2('0x1b')]['attributes']||null:null,'limit':_0x1a7062[_0x49a2('0x1b')]?_0x1a7062[_0x49a2('0x1b')][_0x49a2('0x1d')]||null:null})['then'](function(_0x2f123c){logger['info']('UpdateOpenchannelInteraction',_0x1a7062);logger['debug']('UpdateOpenchannelInteraction',_0x1a7062,JSON[_0x49a2('0x1e')](_0x2f123c));_0x2eb694(_0x2f123c);})[_0x49a2('0x17')](function(_0x457076){logger[_0x49a2('0x12')](_0x49a2('0x1f'),_0x457076[_0x49a2('0x14')],_0x1a7062);_0x236f88(_0x5e7f76[_0x49a2('0x12')](0x1f4,_0x457076[_0x49a2('0x14')]));});});};exports[_0x49a2('0x20')]=function(_0x34885c){return new Promise(function(_0x1e6e54,_0x5a28db){return db['OpenchannelInteraction'][_0x49a2('0x21')]({'where':_0x34885c[_0x49a2('0x1b')]?_0x34885c[_0x49a2('0x1b')]['where']||null:null})[_0x49a2('0x22')](function(_0x33bb17){if(_0x33bb17){return _0x33bb17[_0x49a2('0x23')](_0x34885c[_0x49a2('0x1a')][_0x49a2('0x24')],_[_0x49a2('0x25')](_0x34885c[_0x49a2('0x1a')],['ids','id'])||{});}})[_0x49a2('0x26')](function(_0x5f47b0){logger['info'](_0x49a2('0x27'),_0x34885c);logger['debug']('AddTags',_0x34885c,JSON[_0x49a2('0x1e')](_0x5f47b0));_0x1e6e54(_0x5f47b0);})[_0x49a2('0x17')](function(_0x1c52fa){logger['error']('AddTags',_0x1c52fa[_0x49a2('0x14')],_0x34885c);_0x5a28db(_this[_0x49a2('0x12')](0x1f4,_0x1c52fa[_0x49a2('0x14')]));});});}; \ No newline at end of file +var _0x5213=['socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','attributes','limit','stringify','catch','AddTagsToOpenchannelInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost'];(function(_0x39d39d,_0x5586bd){var _0x577ac3=function(_0x12f9f2){while(--_0x12f9f2){_0x39d39d['push'](_0x39d39d['shift']());}};_0x577ac3(++_0x5586bd);}(_0x5213,0x1e0));var _0x3521=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x5213[_0x3740fe];return _0x55492b;};'use strict';var _=require(_0x3521('0x0'));var util=require(_0x3521('0x1'));var moment=require(_0x3521('0x2'));var BPromise=require('bluebird');var rs=require(_0x3521('0x3'));var fs=require('fs');var Redis=require(_0x3521('0x4'));var db=require(_0x3521('0x5'))['db'];var utils=require(_0x3521('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3521('0x7'));var jayson=require(_0x3521('0x8'));var client=jayson['client'][_0x3521('0x9')]({'port':0x232a});config[_0x3521('0xa')]=_['defaults'](config[_0x3521('0xa')],{'host':_0x3521('0xb'),'port':0x18eb});var socket=require(_0x3521('0xc'))(new Redis(config['redis']));require(_0x3521('0xd'))[_0x3521('0xe')](socket);function respondWithRpcPromise(_0x6bfda,_0x229379,_0xd8f286){return new BPromise(function(_0x760bbe,_0x116ef7){return client[_0x3521('0xf')](_0x6bfda,_0xd8f286)[_0x3521('0x10')](function(_0x56977f){logger[_0x3521('0x11')](_0x3521('0x12'),_0x229379,_0x3521('0x13'));logger[_0x3521('0x14')](_0x3521('0x15'),_0x229379,_0x3521('0x13'),JSON['stringify'](_0x56977f));if(_0x56977f['error']){if(_0x56977f[_0x3521('0x16')][_0x3521('0x17')]===0x1f4){logger[_0x3521('0x16')](_0x3521('0x12'),_0x229379,_0x56977f[_0x3521('0x16')][_0x3521('0x18')]);return _0x116ef7(_0x56977f['error'][_0x3521('0x18')]);}logger['error'](_0x3521('0x12'),_0x229379,_0x56977f[_0x3521('0x16')][_0x3521('0x18')]);return _0x760bbe(_0x56977f[_0x3521('0x16')]['message']);}else{logger['info'](_0x3521('0x12'),_0x229379,_0x3521('0x13'));_0x760bbe(_0x56977f['result']['message']);}})['catch'](function(_0x29c69a){logger[_0x3521('0x16')](_0x3521('0x12'),_0x229379,_0x29c69a);_0x116ef7(_0x29c69a);});});}exports[_0x3521('0x19')]=function(_0x232619){var _0x1aabec=this;return new Promise(function(_0x369257,_0x18ae33){return db[_0x3521('0x1a')][_0x3521('0x1b')](_0x232619['body'],{'raw':_0x232619[_0x3521('0x1c')]?_0x232619['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x232619[_0x3521('0x1c')]?_0x232619[_0x3521('0x1c')]['where']||null:null,'attributes':_0x232619[_0x3521('0x1c')]?_0x232619[_0x3521('0x1c')][_0x3521('0x1d')]||null:null,'limit':_0x232619['options']?_0x232619['options'][_0x3521('0x1e')]||null:null})[_0x3521('0x10')](function(_0x2ed41f){logger[_0x3521('0x11')]('UpdateOpenchannelInteraction',_0x232619);logger['debug']('UpdateOpenchannelInteraction',_0x232619,JSON[_0x3521('0x1f')](_0x2ed41f));_0x369257(_0x2ed41f);})[_0x3521('0x20')](function(_0x34290f){logger[_0x3521('0x16')](_0x3521('0x19'),_0x34290f[_0x3521('0x18')],_0x232619);_0x18ae33(_0x1aabec['error'](0x1f4,_0x34290f[_0x3521('0x18')]));});});};exports[_0x3521('0x21')]=function(_0xad255c){return new Promise(function(_0x2d15b9,_0x3c9c59){return db[_0x3521('0x1a')][_0x3521('0x22')]({'where':_0xad255c['options']?_0xad255c['options'][_0x3521('0x23')]||null:null})[_0x3521('0x10')](function(_0x4c7fae){if(_0x4c7fae){return _0x4c7fae[_0x3521('0x24')](_0xad255c['body']['ids'],_[_0x3521('0x25')](_0xad255c['body'],[_0x3521('0x26'),'id'])||{});}})[_0x3521('0x27')](function(_0x4cb512){logger['info'](_0x3521('0x28'),_0xad255c);logger[_0x3521('0x14')](_0x3521('0x28'),_0xad255c,JSON[_0x3521('0x1f')](_0x4cb512));_0x2d15b9(_0x4cb512);})[_0x3521('0x20')](function(_0xb2fc49){logger[_0x3521('0x16')](_0x3521('0x28'),_0xb2fc49[_0x3521('0x18')],_0xad255c);_0x3c9c59(_this[_0x3521('0x16')](0x1f4,_0xb2fc49[_0x3521('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 81899f3..817fcb9 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 _0x6867=['removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','emit'];(function(_0x2be2cb,_0x25b13f){var _0x12c0fc=function(_0x3fd274){while(--_0x3fd274){_0x2be2cb['push'](_0x2be2cb['shift']());}};_0x12c0fc(++_0x25b13f);}(_0x6867,0x1d4));var _0x7686=function(_0x427d13,_0x337433){_0x427d13=_0x427d13-0x0;var _0x2dc7de=_0x6867[_0x427d13];return _0x2dc7de;};'use strict';var OpenchannelInteractionEvents=require(_0x7686('0x0'));var events=[_0x7686('0x1'),_0x7686('0x2'),'update'];function createListener(_0x3a9247,_0x598d09){return function(_0x21b7ba){_0x598d09[_0x7686('0x3')](_0x3a9247,_0x21b7ba);};}function removeListener(_0xacadcb,_0x4e7523){return function(){OpenchannelInteractionEvents[_0x7686('0x4')](_0xacadcb,_0x4e7523);};}exports[_0x7686('0x5')]=function(_0x3893ab){for(var _0x2c83f1=0x0,_0xe28dad=events[_0x7686('0x6')];_0x2c83f1<_0xe28dad;_0x2c83f1++){var _0x40bf2f=events[_0x2c83f1];var _0x4336b7=createListener(_0x7686('0x7')+_0x40bf2f,_0x3893ab);OpenchannelInteractionEvents['on'](_0x40bf2f,_0x4336b7);}}; \ No newline at end of file +var _0xb388=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x4e84d3,_0x1add05){var _0x1a0df6=function(_0x7c5212){while(--_0x7c5212){_0x4e84d3['push'](_0x4e84d3['shift']());}};_0x1a0df6(++_0x1add05);}(_0xb388,0x1e6));var _0x8b38=function(_0x45ff97,_0x493b75){_0x45ff97=_0x45ff97-0x0;var _0x18f1ce=_0xb388[_0x45ff97];return _0x18f1ce;};'use strict';var OpenchannelInteractionEvents=require(_0x8b38('0x0'));var events=[_0x8b38('0x1'),_0x8b38('0x2'),_0x8b38('0x3')];function createListener(_0x5aea1d,_0x1dd3e9){return function(_0x24ef19){_0x1dd3e9[_0x8b38('0x4')](_0x5aea1d,_0x24ef19);};}function removeListener(_0x10509f,_0x3a07b4){return function(){OpenchannelInteractionEvents[_0x8b38('0x5')](_0x10509f,_0x3a07b4);};}exports[_0x8b38('0x6')]=function(_0x209177){for(var _0x2fe077=0x0,_0x123efd=events[_0x8b38('0x7')];_0x2fe077<_0x123efd;_0x2fe077++){var _0x99b654=events[_0x2fe077];var _0x538e40=createListener(_0x8b38('0x8')+_0x99b654,_0x209177);OpenchannelInteractionEvents['on'](_0x99b654,_0x538e40);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index b682054..5a30dcc 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 _0x4922=['openchannel','openchannelmessage:create','create','put','/:id/accept','accept','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x6a3d18,_0x115cf4){var _0x40642a=function(_0x235941){while(--_0x235941){_0x6a3d18['push'](_0x6a3d18['shift']());}};_0x40642a(++_0x115cf4);}(_0x4922,0x9f));var _0x2492=function(_0x538af4,_0x38f152){_0x538af4=_0x538af4-0x0;var _0x28d15f=_0x4922[_0x538af4];return _0x28d15f;};'use strict';var multer=require(_0x2492('0x0'));var util=require(_0x2492('0x1'));var path=require(_0x2492('0x2'));var timeout=require(_0x2492('0x3'));var express=require(_0x2492('0x4'));var router=express[_0x2492('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2492('0x6'));var controller=require(_0x2492('0x7'));router['get']('/',auth[_0x2492('0x8')](),controller[_0x2492('0x9')]);router[_0x2492('0xa')](_0x2492('0xb'),auth[_0x2492('0x8')](),controller[_0x2492('0xc')]);router[_0x2492('0xa')](_0x2492('0xd'),auth[_0x2492('0x8')](),controller[_0x2492('0xe')]);router[_0x2492('0xf')]('/',auth[_0x2492('0x8')](),interaction['tracked'](_0x2492('0x10'),_0x2492('0x11')),controller[_0x2492('0x12')]);router[_0x2492('0x13')]('/:id',auth[_0x2492('0x8')](),controller['update']);router[_0x2492('0x13')](_0x2492('0x14'),auth[_0x2492('0x8')](),controller[_0x2492('0x15')]);router[_0x2492('0x13')]('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0x2492('0x16')](_0x2492('0xd'),auth[_0x2492('0x8')](),controller[_0x2492('0x17')]);module[_0x2492('0x18')]=router; \ No newline at end of file +var _0xf9c4=['post','tracked','openchannel','openchannelmessage:create','create','put','/:id/accept','/:id/reject','reject','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/describe','/:id','show'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf9c4,0x135));var _0x4f9c=function(_0x584bfa,_0x15fccb){_0x584bfa=_0x584bfa-0x0;var _0x3b55a6=_0xf9c4[_0x584bfa];return _0x3b55a6;};'use strict';var multer=require(_0x4f9c('0x0'));var util=require(_0x4f9c('0x1'));var path=require('path');var timeout=require(_0x4f9c('0x2'));var express=require(_0x4f9c('0x3'));var router=express['Router']();var auth=require(_0x4f9c('0x4'));var interaction=require(_0x4f9c('0x5'));var config=require(_0x4f9c('0x6'));var controller=require(_0x4f9c('0x7'));router[_0x4f9c('0x8')]('/',auth[_0x4f9c('0x9')](),controller['index']);router[_0x4f9c('0x8')](_0x4f9c('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x4f9c('0x8')](_0x4f9c('0xb'),auth[_0x4f9c('0x9')](),controller[_0x4f9c('0xc')]);router[_0x4f9c('0xd')]('/',auth[_0x4f9c('0x9')](),interaction[_0x4f9c('0xe')](_0x4f9c('0xf'),_0x4f9c('0x10')),controller[_0x4f9c('0x11')]);router[_0x4f9c('0x12')](_0x4f9c('0xb'),auth[_0x4f9c('0x9')](),controller['update']);router[_0x4f9c('0x12')](_0x4f9c('0x13'),auth[_0x4f9c('0x9')](),controller['accept']);router[_0x4f9c('0x12')](_0x4f9c('0x14'),auth[_0x4f9c('0x9')](),controller[_0x4f9c('0x15')]);router['delete'](_0x4f9c('0xb'),auth[_0x4f9c('0x9')](),controller[_0x4f9c('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 007ed64..312115c 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 _0x8ebb=['DATE','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x1d95da,_0x41da5f){var _0x520789=function(_0x464f91){while(--_0x464f91){_0x1d95da['push'](_0x1d95da['shift']());}};_0x520789(++_0x41da5f);}(_0x8ebb,0xdf));var _0xb8eb=function(_0x4882a0,_0x172794){_0x4882a0=_0x4882a0-0x0;var _0x301078=_0x8ebb[_0x4882a0];return _0x301078;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xb8eb('0x0')](_0xb8eb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb8eb('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb8eb('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb8eb('0x3')]('in',_0xb8eb('0x4')),'defaultValue':_0xb8eb('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb8eb('0x5')]}}; \ No newline at end of file +var _0x6768=['medium','BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x6768,0xed));var _0x8676=function(_0x568753,_0x1d4c4b){_0x568753=_0x568753-0x0;var _0x1def3f=_0x6768[_0x568753];return _0x1def3f;};'use strict';var Sequelize=require(_0x8676('0x0'));module[_0x8676('0x1')]={'body':{'type':Sequelize[_0x8676('0x2')](_0x8676('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x8676('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8676('0x5')]('in',_0x8676('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8676('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index d1eac1f..5442607 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 _0x32b5=['destroy','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','agent','null','RejectMessage','SIP/%s','reject','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','Sequelize','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','json','count','offset','set','Content-Range','apply','save','update','end','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','where','merge','filter','options','includeAll','findAll','rows','show','intersection','include','find','catch','create','body','params'];(function(_0x7686e9,_0x4e974c){var _0x4aa905=function(_0x22c349){while(--_0x22c349){_0x7686e9['push'](_0x7686e9['shift']());}};_0x4aa905(++_0x4e974c);}(_0x32b5,0x123));var _0x532b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x32b5[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x532b('0x0'));var emlformat=require(_0x532b('0x1'));var rimraf=require(_0x532b('0x2'));var zipdir=require(_0x532b('0x3'));var jsonpatch=require(_0x532b('0x4'));var rp=require(_0x532b('0x5'));var moment=require(_0x532b('0x6'));var BPromise=require(_0x532b('0x7'));var Mustache=require(_0x532b('0x8'));var util=require(_0x532b('0x9'));var path=require(_0x532b('0xa'));var sox=require(_0x532b('0xb'));var csv=require(_0x532b('0xc'));var ejs=require(_0x532b('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x532b('0xe'));var jsforce=require(_0x532b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x532b('0xc'));var querystring=require(_0x532b('0x10'));var Papa=require(_0x532b('0x11'));var Redis=require(_0x532b('0x12'));var authService=require(_0x532b('0x13'));var qs=require(_0x532b('0x14'));var as=require(_0x532b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x532b('0x16'))(_0x532b('0x17'));var utils=require(_0x532b('0x18'));var config=require(_0x532b('0x19'));var db=require(_0x532b('0x1a'))['db'];config[_0x532b('0x1b')]=_[_0x532b('0x1c')](config[_0x532b('0x1b')],{'host':_0x532b('0x1d'),'port':0x18eb});var socket=require(_0x532b('0x1e'))(new Redis(config[_0x532b('0x1b')]));require(_0x532b('0x1f'))[_0x532b('0x20')](socket);var jayson=require(_0x532b('0x21'));var client=jayson[_0x532b('0x22')][_0x532b('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x532b('0x23')]({'port':0x232a});function checkPasswordPattern(_0x1a966f,_0x366014,_0x551f60){if(_0x551f60){var _0x4a5948=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a5948['test'](_0x366014)){return _0x1a966f;}else{throw new db[(_0x532b('0x24'))]['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 _0x1a966f;}}function respondWithRpcPromise(_0x3bd56a,_0x17202d,_0x2535fc,_0x2e9414){return new BPromise(function(_0x1a5c0c,_0x9c510f){var _0x164e56=_0x2e9414||client;return _0x164e56[_0x532b('0x25')](_0x3bd56a,_0x2535fc)[_0x532b('0x26')](function(_0x597394){logger[_0x532b('0x27')](_0x532b('0x28'),_0x17202d,_0x532b('0x29'));logger[_0x532b('0x2a')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x17202d,_0x532b('0x29'),JSON[_0x532b('0x2b')](_0x597394));if(_0x597394[_0x532b('0x2c')]){if(_0x597394[_0x532b('0x2c')][_0x532b('0x2d')]===0x1f4){logger[_0x532b('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x17202d,_0x597394['error'][_0x532b('0x2e')]);return _0x9c510f(_0x597394[_0x532b('0x2c')]['message']);}logger['error'](_0x532b('0x28'),_0x17202d,_0x597394[_0x532b('0x2c')]['message']);return _0x1a5c0c(_0x597394['error']['message']);}else{logger[_0x532b('0x27')](_0x532b('0x28'),_0x17202d,'request\x20sent');_0x1a5c0c(_0x597394[_0x532b('0x2f')][_0x532b('0x2e')]);}})['catch'](function(_0x716064){logger[_0x532b('0x2c')](_0x532b('0x28'),_0x17202d,_0x716064);_0x9c510f(_0x716064);});});}function respondWithStatusCode(_0x430b23,_0x1ce7cf){_0x1ce7cf=_0x1ce7cf||0xcc;return function(_0x13a4e9){if(_0x13a4e9){return _0x430b23['sendStatus'](_0x1ce7cf);}return _0x430b23[_0x532b('0x30')](_0x1ce7cf)['end']();};}function respondWithResult(_0x2f8c38,_0x3a748e){_0x3a748e=_0x3a748e||0xc8;return function(_0x4988a3){if(_0x4988a3){return _0x2f8c38[_0x532b('0x30')](_0x3a748e)[_0x532b('0x31')](_0x4988a3);}};}function respondWithFilteredResult(_0x192f50,_0x3f07a9){return function(_0x5a7765){if(_0x5a7765){var _0x27346d=_0x5a7765[_0x532b('0x32')],_0x468338=_0x3f07a9[_0x532b('0x33')],_0x574d58=_0x3f07a9['offset']+_0x3f07a9['limit'],_0x2f4663;if(_0x574d58>=_0x27346d){_0x574d58=_0x27346d;_0x2f4663=0xc8;}else{_0x2f4663=0xce;}_0x192f50['status'](_0x2f4663);return _0x192f50[_0x532b('0x34')](_0x532b('0x35'),_0x468338+'-'+_0x574d58+'/'+_0x27346d)[_0x532b('0x31')](_0x5a7765);}return null;};}function patchUpdates(_0x4c32bd){return function(_0x351fa2){try{jsonpatch[_0x532b('0x36')](_0x351fa2,_0x4c32bd,!![]);}catch(_0x32dd80){return BPromise['reject'](_0x32dd80);}return _0x351fa2[_0x532b('0x37')]();};}function saveUpdates(_0x574d54,_0x44c705){return function(_0x33d3f0){if(_0x33d3f0){return _0x33d3f0[_0x532b('0x38')](_0x574d54)['then'](function(_0x10b445){return _0x10b445;});}return null;};}function removeEntity(_0x1769a2,_0x19e8ec){return function(_0x1368a2){if(_0x1368a2){return _0x1368a2['destroy']()[_0x532b('0x26')](function(){_0x1769a2[_0x532b('0x30')](0xcc)[_0x532b('0x39')]();});}};}function handleEntityNotFound(_0x66635e,_0x4cd5cc){return function(_0x37d501){if(!_0x37d501){_0x66635e[_0x532b('0x3a')](0x194);}return _0x37d501;};}function handleError(_0x4bc5ee,_0x34698a){_0x34698a=_0x34698a||0x1f4;return function(_0x125597){logger[_0x532b('0x2c')](_0x125597[_0x532b('0x3b')]);if(_0x125597[_0x532b('0x3c')]){delete _0x125597[_0x532b('0x3c')];}_0x4bc5ee[_0x532b('0x30')](_0x34698a)['send'](_0x125597);};}exports[_0x532b('0x3d')]=function(_0x4b0e96,_0x5d2d7b){var _0x231be8={},_0x1be539={},_0x26f806={'count':0x0,'rows':[]};var _0x478e10=_[_0x532b('0x3e')](db[_0x532b('0x3f')][_0x532b('0x40')],function(_0x314518){return{'name':_0x314518[_0x532b('0x41')],'type':_0x314518[_0x532b('0x42')]['key']};});_0x1be539[_0x532b('0x43')]=_[_0x532b('0x3e')](_0x478e10,'name');_0x1be539[_0x532b('0x44')]=_[_0x532b('0x45')](_0x4b0e96['query']);_0x1be539[_0x532b('0x46')]=_['intersection'](_0x1be539[_0x532b('0x43')],_0x1be539[_0x532b('0x44')]);_0x231be8[_0x532b('0x47')]=_['intersection'](_0x1be539[_0x532b('0x43')],qs[_0x532b('0x48')](_0x4b0e96[_0x532b('0x44')][_0x532b('0x48')]));_0x231be8[_0x532b('0x47')]=_0x231be8[_0x532b('0x47')][_0x532b('0x49')]?_0x231be8[_0x532b('0x47')]:_0x1be539['model'];if(!_0x4b0e96[_0x532b('0x44')][_0x532b('0x4a')]('nolimit')){_0x231be8['limit']=qs[_0x532b('0x4b')](_0x4b0e96[_0x532b('0x44')]['limit']);_0x231be8[_0x532b('0x33')]=qs['offset'](_0x4b0e96[_0x532b('0x44')][_0x532b('0x33')]);}_0x231be8[_0x532b('0x4c')]=qs[_0x532b('0x4d')](_0x4b0e96[_0x532b('0x44')][_0x532b('0x4d')]);_0x231be8[_0x532b('0x4e')]=qs[_0x532b('0x46')](_['pick'](_0x4b0e96[_0x532b('0x44')],_0x1be539[_0x532b('0x46')]),_0x478e10);if(_0x4b0e96[_0x532b('0x44')]['filter']){_0x231be8['where']=_[_0x532b('0x4f')](_0x231be8['where'],{'$or':_[_0x532b('0x3e')](_0x478e10,function(_0x253eff){if(_0x253eff['type']!=='VIRTUAL'){var _0x3caa82={};_0x3caa82[_0x253eff[_0x532b('0x3c')]]={'$like':'%'+_0x4b0e96[_0x532b('0x44')][_0x532b('0x50')]+'%'};return _0x3caa82;}})});}_0x231be8=_[_0x532b('0x4f')]({},_0x231be8,_0x4b0e96[_0x532b('0x51')]);var _0x23d0db={'where':_0x231be8['where']};return db[_0x532b('0x3f')]['count'](_0x23d0db)[_0x532b('0x26')](function(_0x28f73d){_0x26f806['count']=_0x28f73d;if(_0x4b0e96[_0x532b('0x44')][_0x532b('0x52')]){_0x231be8['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x532b('0x53')](_0x231be8);})[_0x532b('0x26')](function(_0x1738b0){_0x26f806[_0x532b('0x54')]=_0x1738b0;return _0x26f806;})[_0x532b('0x26')](respondWithFilteredResult(_0x5d2d7b,_0x231be8))['catch'](handleError(_0x5d2d7b,null));};exports[_0x532b('0x55')]=function(_0x2e33dc,_0x5e9f6d){var _0x3826ca={'raw':!![],'where':{'id':_0x2e33dc['params']['id']}},_0x330a0a={};_0x330a0a[_0x532b('0x43')]=_[_0x532b('0x45')](db['OpenchannelMessage'][_0x532b('0x40')]);_0x330a0a[_0x532b('0x44')]=_[_0x532b('0x45')](_0x2e33dc[_0x532b('0x44')]);_0x330a0a['filters']=_[_0x532b('0x56')](_0x330a0a[_0x532b('0x43')],_0x330a0a[_0x532b('0x44')]);_0x3826ca[_0x532b('0x47')]=_[_0x532b('0x56')](_0x330a0a['model'],qs['fields'](_0x2e33dc[_0x532b('0x44')]['fields']));_0x3826ca[_0x532b('0x47')]=_0x3826ca[_0x532b('0x47')]['length']?_0x3826ca[_0x532b('0x47')]:_0x330a0a[_0x532b('0x43')];if(_0x2e33dc[_0x532b('0x44')][_0x532b('0x52')]){_0x3826ca[_0x532b('0x57')]=[{'all':!![]}];}_0x3826ca=_[_0x532b('0x4f')]({},_0x3826ca,_0x2e33dc['options']);return db[_0x532b('0x3f')][_0x532b('0x58')](_0x3826ca)[_0x532b('0x26')](handleEntityNotFound(_0x5e9f6d,null))[_0x532b('0x26')](respondWithResult(_0x5e9f6d,null))[_0x532b('0x59')](handleError(_0x5e9f6d,null));};exports[_0x532b('0x5a')]=function(_0x2be29c,_0x51257a){return db[_0x532b('0x3f')][_0x532b('0x5a')](_0x2be29c[_0x532b('0x5b')],{})['then'](respondWithResult(_0x51257a,0xc9))['catch'](handleError(_0x51257a,null));};exports[_0x532b('0x38')]=function(_0x2842dd,_0x64d4a6){if(_0x2842dd['body']['id']){delete _0x2842dd[_0x532b('0x5b')]['id'];}return db[_0x532b('0x3f')][_0x532b('0x58')]({'where':{'id':_0x2842dd[_0x532b('0x5c')]['id']}})[_0x532b('0x26')](handleEntityNotFound(_0x64d4a6,null))['then'](saveUpdates(_0x2842dd['body'],null))[_0x532b('0x26')](respondWithResult(_0x64d4a6,null))[_0x532b('0x59')](handleError(_0x64d4a6,null));};exports[_0x532b('0x5d')]=function(_0x391650,_0x46f088){return db[_0x532b('0x3f')][_0x532b('0x58')]({'where':{'id':_0x391650['params']['id']}})[_0x532b('0x26')](handleEntityNotFound(_0x46f088,null))[_0x532b('0x26')](removeEntity(_0x46f088,null))[_0x532b('0x59')](handleError(_0x46f088,null));};exports[_0x532b('0x5e')]=function(_0x50ea13,_0x31d351){return db[_0x532b('0x3f')][_0x532b('0x5e')]()['then'](respondWithResult(_0x31d351,null))[_0x532b('0x59')](handleError(_0x31d351,null));};var interaction_log=require(_0x532b('0x16'))(_0x532b('0x5f'));exports['accept']=function(_0x20b70c,_0x10c162,_0x1782f3){var _0x7bacdb={'channel':_0x532b('0x60')};if(_0x20b70c['body']['id']){delete _0x20b70c['body']['id'];}_0x20b70c[_0x532b('0x5b')][_0x532b('0x61')]=!![];_0x20b70c[_0x532b('0x5b')][_0x532b('0x62')]=moment()[_0x532b('0x63')](_0x532b('0x64'));_0x20b70c['body'][_0x532b('0x65')]=_0x20b70c[_0x532b('0x5b')][_0x532b('0x65')]||_0x20b70c['user']['id'];return db[_0x532b('0x3f')][_0x532b('0x58')]({'where':{'id':_0x20b70c[_0x532b('0x5c')]['id'],'UserId':null},'include':[{'model':db[_0x532b('0x66')],'as':_0x532b('0x67')}]})['then'](handleEntityNotFound(_0x10c162,null))[_0x532b('0x26')](saveUpdates(_0x20b70c[_0x532b('0x5b')],null))[_0x532b('0x26')](function(_0x52dc88){if(_0x52dc88){_0x7bacdb[_0x532b('0x2e')]=_0x52dc88[_0x532b('0x68')]({'plain':!![]});return db[_0x532b('0x69')]['find']({'where':{'id':_0x52dc88[_0x532b('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x10c162,null))[_0x532b('0x26')](function(_0x3c786a){if(_0x3c786a){return _0x3c786a[_0x532b('0x38')]({'UserId':_0x20b70c[_0x532b('0x5b')][_0x532b('0x65')],'read1stAt':_[_0x532b('0x6b')](_0x3c786a[_0x532b('0x6c')])?moment()[_0x532b('0x63')](_0x532b('0x64')):undefined});}return null;})[_0x532b('0x26')](function(_0x33201d){if(_0x33201d){_0x7bacdb[_0x532b('0x6d')]=_0x33201d[_0x532b('0x68')]({'plain':!![]});interaction_log['info'](_0x532b('0x6e'),_0x20b70c[_0x532b('0x6f')]['id'],_0x20b70c[_0x532b('0x6f')][_0x532b('0x3c')],_0x20b70c[_0x532b('0x6f')][_0x532b('0x70')],_0x7bacdb[_0x532b('0x6d')]['id'],_0x20b70c[_0x532b('0x5b')]?JSON[_0x532b('0x2b')](_0x20b70c[_0x532b('0x5b')]):'null');return respondWithRpcPromise(_0x532b('0x71'),_0x532b('0x72'),_0x7bacdb);}return null;})[_0x532b('0x26')](function(_0x12d16e){if(_0x12d16e){if(_0x20b70c['body'][_0x532b('0x73')]){_0x7bacdb[_0x532b('0x2e')][_0x532b('0x74')]=util[_0x532b('0x63')]('SIP/%s',_0x20b70c[_0x532b('0x6f')][_0x532b('0x3c')]);_0x7bacdb[_0x532b('0x2e')][_0x532b('0x75')]=_0x7bacdb['channel'];_0x7bacdb[_0x532b('0x2e')][_0x532b('0x76')]=_0x532b('0x77');return respondWithRpcPromise(_0x532b('0x78'),_0x532b('0x78'),{'event':_0x532b('0x79'),'message':_0x7bacdb[_0x532b('0x2e')]},client9002)[_0x532b('0x26')](function(){return _0x7bacdb;});}return _0x7bacdb;}return null;})['then'](respondWithResult(_0x10c162,null))[_0x532b('0x59')](handleError(_0x10c162,null));};var interaction_log=require(_0x532b('0x16'))(_0x532b('0x5f'));exports['reject']=function(_0x3dba7b,_0x298e8b,_0xecb57c){var _0x4e8fda={'agent':{},'channel':_0x532b('0x60')};if(_0x3dba7b[_0x532b('0x5b')]['id']){delete _0x3dba7b[_0x532b('0x5b')]['id'];}_0x3dba7b[_0x532b('0x5b')][_0x532b('0x65')]=_0x3dba7b['body'][_0x532b('0x65')]||_0x3dba7b[_0x532b('0x6f')]['id'];_0x4e8fda[_0x532b('0x7a')]['id']=_0x3dba7b['body'][_0x532b('0x65')];return db[_0x532b('0x3f')][_0x532b('0x58')]({'where':{'id':_0x3dba7b['params']['id'],'UserId':null}})[_0x532b('0x26')](handleEntityNotFound(_0x298e8b,null))[_0x532b('0x26')](function(_0x29d6a8){if(_0x29d6a8){_0x4e8fda[_0x532b('0x2e')]=_0x29d6a8['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x532b('0x58')]({'where':{'id':_0x29d6a8[_0x532b('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x298e8b,null))[_0x532b('0x26')](function(_0x7555f9){if(_0x7555f9){_0x4e8fda[_0x532b('0x6d')]=_0x7555f9['get']({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3dba7b[_0x532b('0x6f')]['id'],_0x3dba7b[_0x532b('0x6f')]['name'],_0x3dba7b[_0x532b('0x6f')]['role'],_0x4e8fda[_0x532b('0x6d')]['id'],_0x3dba7b[_0x532b('0x5b')]?JSON[_0x532b('0x2b')](_0x3dba7b[_0x532b('0x5b')]):_0x532b('0x7b'));return respondWithRpcPromise(_0x532b('0x7c'),'rejectMessage',_0x4e8fda);}return null;})[_0x532b('0x26')](function(_0x5c7759){if(_0x5c7759){_0x5c7759[_0x532b('0x2e')][_0x532b('0x74')]=util[_0x532b('0x63')](_0x532b('0x7d'),_0x3dba7b['user'][_0x532b('0x3c')]);_0x5c7759[_0x532b('0x2e')][_0x532b('0x75')]=_0x4e8fda[_0x532b('0x75')];_0x5c7759[_0x532b('0x2e')][_0x532b('0x76')]=_0x532b('0x7e');respondWithRpcPromise(_0x532b('0x78'),'EventManager',{'event':_0x532b('0x7f'),'message':_0x5c7759['message']},client9002);return _0x4e8fda;}return null;})['then'](respondWithResult(_0x298e8b,null))[_0x532b('0x59')](handleError(_0x298e8b,null));}; \ No newline at end of file +var _0xf8dd=['filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','filter','options','OpenchannelMessage','count','includeAll','include','findAll','rows','show','find','create','body','update','params','describe','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','openchannel-interactions','agent','null','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','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','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','status','end','offset','set','Content-Range','json','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query'];(function(_0xdd59a8,_0x53026d){var _0x5dc7ff=function(_0x3c604a){while(--_0x3c604a){_0xdd59a8['push'](_0xdd59a8['shift']());}};_0x5dc7ff(++_0x53026d);}(_0xf8dd,0xb6));var _0xdf8d=function(_0x15b88d,_0x584b99){_0x15b88d=_0x15b88d-0x0;var _0x48d75b=_0xf8dd[_0x15b88d];return _0x48d75b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdf8d('0x0'));var rimraf=require(_0xdf8d('0x1'));var zipdir=require(_0xdf8d('0x2'));var jsonpatch=require(_0xdf8d('0x3'));var rp=require(_0xdf8d('0x4'));var moment=require(_0xdf8d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf8d('0x6'));var util=require('util');var path=require(_0xdf8d('0x7'));var sox=require(_0xdf8d('0x8'));var csv=require(_0xdf8d('0x9'));var ejs=require(_0xdf8d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdf8d('0xb'));var crypto=require(_0xdf8d('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdf8d('0x9'));var querystring=require(_0xdf8d('0xd'));var Papa=require('papaparse');var Redis=require(_0xdf8d('0xe'));var authService=require(_0xdf8d('0xf'));var qs=require(_0xdf8d('0x10'));var as=require(_0xdf8d('0x11'));var hardwareService=require(_0xdf8d('0x12'));var logger=require('../../config/logger')(_0xdf8d('0x13'));var utils=require(_0xdf8d('0x14'));var config=require(_0xdf8d('0x15'));var db=require(_0xdf8d('0x16'))['db'];config[_0xdf8d('0x17')]=_['defaults'](config[_0xdf8d('0x17')],{'host':_0xdf8d('0x18'),'port':0x18eb});var socket=require(_0xdf8d('0x19'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xdf8d('0x1a')][_0xdf8d('0x1b')]({'port':0x232c});var client9002=jayson[_0xdf8d('0x1a')][_0xdf8d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1e2805,_0x4b0d07,_0x4d1e6e){if(_0x4d1e6e){var _0x49590f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x49590f['test'](_0x4b0d07)){return _0x1e2805;}else{throw new db[(_0xdf8d('0x1c'))]['ValidationError'](_0xdf8d('0x1d'));}}else{return _0x1e2805;}}function respondWithRpcPromise(_0x523b04,_0x47c9f9,_0x48568d,_0x346688){return new BPromise(function(_0x20d611,_0x3fe80c){var _0x341b3e=_0x346688||client;return _0x341b3e[_0xdf8d('0x1e')](_0x523b04,_0x48568d)[_0xdf8d('0x1f')](function(_0x32e972){logger[_0xdf8d('0x20')](_0xdf8d('0x21'),_0x47c9f9,_0xdf8d('0x22'));logger[_0xdf8d('0x23')](_0xdf8d('0x24'),_0x47c9f9,'request\x20sent',JSON[_0xdf8d('0x25')](_0x32e972));if(_0x32e972['error']){if(_0x32e972['error'][_0xdf8d('0x26')]===0x1f4){logger['error'](_0xdf8d('0x21'),_0x47c9f9,_0x32e972[_0xdf8d('0x27')][_0xdf8d('0x28')]);return _0x3fe80c(_0x32e972['error'][_0xdf8d('0x28')]);}logger[_0xdf8d('0x27')](_0xdf8d('0x21'),_0x47c9f9,_0x32e972[_0xdf8d('0x27')][_0xdf8d('0x28')]);return _0x20d611(_0x32e972[_0xdf8d('0x27')][_0xdf8d('0x28')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x47c9f9,_0xdf8d('0x22'));_0x20d611(_0x32e972['result'][_0xdf8d('0x28')]);}})[_0xdf8d('0x29')](function(_0x29ec35){logger['error'](_0xdf8d('0x21'),_0x47c9f9,_0x29ec35);_0x3fe80c(_0x29ec35);});});}function respondWithStatusCode(_0xc21b89,_0x78ae4b){_0x78ae4b=_0x78ae4b||0xcc;return function(_0x990200){if(_0x990200){return _0xc21b89[_0xdf8d('0x2a')](_0x78ae4b);}return _0xc21b89[_0xdf8d('0x2b')](_0x78ae4b)[_0xdf8d('0x2c')]();};}function respondWithResult(_0xb25bc3,_0x46ffce){_0x46ffce=_0x46ffce||0xc8;return function(_0x3c32de){if(_0x3c32de){return _0xb25bc3[_0xdf8d('0x2b')](_0x46ffce)['json'](_0x3c32de);}};}function respondWithFilteredResult(_0x5a3fb2,_0x386873){return function(_0x3e0bdf){if(_0x3e0bdf){var _0x15b3be=_0x3e0bdf['count'],_0x27c242=_0x386873['offset'],_0x4f626c=_0x386873[_0xdf8d('0x2d')]+_0x386873['limit'],_0x55d378;if(_0x4f626c>=_0x15b3be){_0x4f626c=_0x15b3be;_0x55d378=0xc8;}else{_0x55d378=0xce;}_0x5a3fb2[_0xdf8d('0x2b')](_0x55d378);return _0x5a3fb2[_0xdf8d('0x2e')](_0xdf8d('0x2f'),_0x27c242+'-'+_0x4f626c+'/'+_0x15b3be)[_0xdf8d('0x30')](_0x3e0bdf);}return null;};}function patchUpdates(_0xe85d7d){return function(_0x34ed7f){try{jsonpatch[_0xdf8d('0x31')](_0x34ed7f,_0xe85d7d,!![]);}catch(_0x12efeb){return BPromise[_0xdf8d('0x32')](_0x12efeb);}return _0x34ed7f[_0xdf8d('0x33')]();};}function saveUpdates(_0x102327,_0x47a042){return function(_0x50126b){if(_0x50126b){return _0x50126b['update'](_0x102327)[_0xdf8d('0x1f')](function(_0x29db48){return _0x29db48;});}return null;};}function removeEntity(_0x3f634b,_0x4b1a38){return function(_0x2208d0){if(_0x2208d0){return _0x2208d0[_0xdf8d('0x34')]()[_0xdf8d('0x1f')](function(){_0x3f634b[_0xdf8d('0x2b')](0xcc)[_0xdf8d('0x2c')]();});}};}function handleEntityNotFound(_0x432971,_0x478d98){return function(_0x54ddcb){if(!_0x54ddcb){_0x432971['sendStatus'](0x194);}return _0x54ddcb;};}function handleError(_0x3b703d,_0x3ae6d2){_0x3ae6d2=_0x3ae6d2||0x1f4;return function(_0x3bb81b){logger['error'](_0x3bb81b[_0xdf8d('0x35')]);if(_0x3bb81b[_0xdf8d('0x36')]){delete _0x3bb81b['name'];}_0x3b703d[_0xdf8d('0x2b')](_0x3ae6d2)[_0xdf8d('0x37')](_0x3bb81b);};}exports[_0xdf8d('0x38')]=function(_0x780fab,_0x324da5){var _0x4a118d={},_0x48217d={},_0x305945={'count':0x0,'rows':[]};var _0x29452c=_[_0xdf8d('0x39')](db['OpenchannelMessage'][_0xdf8d('0x3a')],function(_0x1d8ca1){return{'name':_0x1d8ca1[_0xdf8d('0x3b')],'type':_0x1d8ca1[_0xdf8d('0x3c')]['key']};});_0x48217d[_0xdf8d('0x3d')]=_[_0xdf8d('0x39')](_0x29452c,_0xdf8d('0x36'));_0x48217d['query']=_[_0xdf8d('0x3e')](_0x780fab[_0xdf8d('0x3f')]);_0x48217d[_0xdf8d('0x40')]=_[_0xdf8d('0x41')](_0x48217d[_0xdf8d('0x3d')],_0x48217d[_0xdf8d('0x3f')]);_0x4a118d[_0xdf8d('0x42')]=_[_0xdf8d('0x41')](_0x48217d['model'],qs[_0xdf8d('0x43')](_0x780fab[_0xdf8d('0x3f')]['fields']));_0x4a118d[_0xdf8d('0x42')]=_0x4a118d[_0xdf8d('0x42')][_0xdf8d('0x44')]?_0x4a118d['attributes']:_0x48217d[_0xdf8d('0x3d')];if(!_0x780fab[_0xdf8d('0x3f')]['hasOwnProperty'](_0xdf8d('0x45'))){_0x4a118d[_0xdf8d('0x46')]=qs[_0xdf8d('0x46')](_0x780fab['query']['limit']);_0x4a118d['offset']=qs[_0xdf8d('0x2d')](_0x780fab[_0xdf8d('0x3f')][_0xdf8d('0x2d')]);}_0x4a118d[_0xdf8d('0x47')]=qs[_0xdf8d('0x48')](_0x780fab[_0xdf8d('0x3f')][_0xdf8d('0x48')]);_0x4a118d[_0xdf8d('0x49')]=qs[_0xdf8d('0x40')](_[_0xdf8d('0x4a')](_0x780fab[_0xdf8d('0x3f')],_0x48217d['filters']),_0x29452c);if(_0x780fab['query']['filter']){_0x4a118d[_0xdf8d('0x49')]=_[_0xdf8d('0x4b')](_0x4a118d[_0xdf8d('0x49')],{'$or':_[_0xdf8d('0x39')](_0x29452c,function(_0xcfa165){if(_0xcfa165['type']!=='VIRTUAL'){var _0xd33525={};_0xd33525[_0xcfa165['name']]={'$like':'%'+_0x780fab[_0xdf8d('0x3f')][_0xdf8d('0x4c')]+'%'};return _0xd33525;}})});}_0x4a118d=_['merge']({},_0x4a118d,_0x780fab[_0xdf8d('0x4d')]);var _0x598513={'where':_0x4a118d[_0xdf8d('0x49')]};return db[_0xdf8d('0x4e')][_0xdf8d('0x4f')](_0x598513)[_0xdf8d('0x1f')](function(_0x213289){_0x305945['count']=_0x213289;if(_0x780fab[_0xdf8d('0x3f')][_0xdf8d('0x50')]){_0x4a118d[_0xdf8d('0x51')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xdf8d('0x52')](_0x4a118d);})[_0xdf8d('0x1f')](function(_0x5c1d6b){_0x305945[_0xdf8d('0x53')]=_0x5c1d6b;return _0x305945;})[_0xdf8d('0x1f')](respondWithFilteredResult(_0x324da5,_0x4a118d))[_0xdf8d('0x29')](handleError(_0x324da5,null));};exports[_0xdf8d('0x54')]=function(_0x38c38a,_0x27001d){var _0x2b1dcd={'raw':!![],'where':{'id':_0x38c38a['params']['id']}},_0x2df998={};_0x2df998[_0xdf8d('0x3d')]=_[_0xdf8d('0x3e')](db[_0xdf8d('0x4e')][_0xdf8d('0x3a')]);_0x2df998['query']=_['keys'](_0x38c38a[_0xdf8d('0x3f')]);_0x2df998[_0xdf8d('0x40')]=_[_0xdf8d('0x41')](_0x2df998['model'],_0x2df998[_0xdf8d('0x3f')]);_0x2b1dcd[_0xdf8d('0x42')]=_[_0xdf8d('0x41')](_0x2df998[_0xdf8d('0x3d')],qs['fields'](_0x38c38a[_0xdf8d('0x3f')][_0xdf8d('0x43')]));_0x2b1dcd[_0xdf8d('0x42')]=_0x2b1dcd[_0xdf8d('0x42')][_0xdf8d('0x44')]?_0x2b1dcd[_0xdf8d('0x42')]:_0x2df998[_0xdf8d('0x3d')];if(_0x38c38a['query'][_0xdf8d('0x50')]){_0x2b1dcd[_0xdf8d('0x51')]=[{'all':!![]}];}_0x2b1dcd=_[_0xdf8d('0x4b')]({},_0x2b1dcd,_0x38c38a[_0xdf8d('0x4d')]);return db[_0xdf8d('0x4e')][_0xdf8d('0x55')](_0x2b1dcd)[_0xdf8d('0x1f')](handleEntityNotFound(_0x27001d,null))[_0xdf8d('0x1f')](respondWithResult(_0x27001d,null))['catch'](handleError(_0x27001d,null));};exports[_0xdf8d('0x56')]=function(_0xd71a09,_0x1b1fc6){return db[_0xdf8d('0x4e')]['create'](_0xd71a09[_0xdf8d('0x57')],{})['then'](respondWithResult(_0x1b1fc6,0xc9))['catch'](handleError(_0x1b1fc6,null));};exports[_0xdf8d('0x58')]=function(_0x464565,_0x3cd401){if(_0x464565[_0xdf8d('0x57')]['id']){delete _0x464565[_0xdf8d('0x57')]['id'];}return db[_0xdf8d('0x4e')]['find']({'where':{'id':_0x464565['params']['id']}})[_0xdf8d('0x1f')](handleEntityNotFound(_0x3cd401,null))[_0xdf8d('0x1f')](saveUpdates(_0x464565[_0xdf8d('0x57')],null))[_0xdf8d('0x1f')](respondWithResult(_0x3cd401,null))[_0xdf8d('0x29')](handleError(_0x3cd401,null));};exports[_0xdf8d('0x34')]=function(_0x201cbf,_0x49138b){return db[_0xdf8d('0x4e')][_0xdf8d('0x55')]({'where':{'id':_0x201cbf[_0xdf8d('0x59')]['id']}})[_0xdf8d('0x1f')](handleEntityNotFound(_0x49138b,null))[_0xdf8d('0x1f')](removeEntity(_0x49138b,null))['catch'](handleError(_0x49138b,null));};exports['describe']=function(_0xa9bf5e,_0x2ada83){return db[_0xdf8d('0x4e')][_0xdf8d('0x5a')]()[_0xdf8d('0x1f')](respondWithResult(_0x2ada83,null))[_0xdf8d('0x29')](handleError(_0x2ada83,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xdf8d('0x5b')]=function(_0x2692ed,_0x346f21,_0x3b597e){var _0x47c389={'channel':_0xdf8d('0x5c')};if(_0x2692ed[_0xdf8d('0x57')]['id']){delete _0x2692ed[_0xdf8d('0x57')]['id'];}_0x2692ed[_0xdf8d('0x57')][_0xdf8d('0x5d')]=!![];_0x2692ed[_0xdf8d('0x57')][_0xdf8d('0x5e')]=moment()[_0xdf8d('0x5f')](_0xdf8d('0x60'));_0x2692ed[_0xdf8d('0x57')][_0xdf8d('0x61')]=_0x2692ed['body'][_0xdf8d('0x61')]||_0x2692ed[_0xdf8d('0x62')]['id'];return db[_0xdf8d('0x4e')][_0xdf8d('0x55')]({'where':{'id':_0x2692ed['params']['id'],'UserId':null},'include':[{'model':db[_0xdf8d('0x63')],'as':'Contact'}]})[_0xdf8d('0x1f')](handleEntityNotFound(_0x346f21,null))['then'](saveUpdates(_0x2692ed[_0xdf8d('0x57')],null))[_0xdf8d('0x1f')](function(_0x576f2d){if(_0x576f2d){_0x47c389[_0xdf8d('0x28')]=_0x576f2d[_0xdf8d('0x64')]({'plain':!![]});return db[_0xdf8d('0x65')][_0xdf8d('0x55')]({'where':{'id':_0x576f2d[_0xdf8d('0x66')]}});}return null;})[_0xdf8d('0x1f')](handleEntityNotFound(_0x346f21,null))[_0xdf8d('0x1f')](function(_0x4e093f){if(_0x4e093f){return _0x4e093f[_0xdf8d('0x58')]({'UserId':_0x2692ed[_0xdf8d('0x57')][_0xdf8d('0x61')],'read1stAt':_[_0xdf8d('0x67')](_0x4e093f[_0xdf8d('0x68')])?moment()['format'](_0xdf8d('0x60')):undefined});}return null;})[_0xdf8d('0x1f')](function(_0x98af21){if(_0x98af21){_0x47c389['interaction']=_0x98af21[_0xdf8d('0x64')]({'plain':!![]});interaction_log[_0xdf8d('0x20')](_0xdf8d('0x69'),_0x2692ed[_0xdf8d('0x62')]['id'],_0x2692ed['user']['name'],_0x2692ed['user'][_0xdf8d('0x6a')],_0x47c389[_0xdf8d('0x6b')]['id'],_0x2692ed['body']?JSON[_0xdf8d('0x25')](_0x2692ed[_0xdf8d('0x57')]):'null');return respondWithRpcPromise('AcceptMessage',_0xdf8d('0x6c'),_0x47c389);}return null;})[_0xdf8d('0x1f')](function(_0x5f2189){if(_0x5f2189){if(_0x2692ed[_0xdf8d('0x57')][_0xdf8d('0x6d')]){_0x47c389['message'][_0xdf8d('0x6e')]=util[_0xdf8d('0x5f')](_0xdf8d('0x6f'),_0x2692ed[_0xdf8d('0x62')][_0xdf8d('0x36')]);_0x47c389['message'][_0xdf8d('0x70')]=_0x47c389[_0xdf8d('0x70')];_0x47c389[_0xdf8d('0x28')][_0xdf8d('0x71')]=_0xdf8d('0x5b');return respondWithRpcPromise('EventManager',_0xdf8d('0x72'),{'event':_0xdf8d('0x73'),'message':_0x47c389[_0xdf8d('0x28')]},client9002)[_0xdf8d('0x1f')](function(){return _0x47c389;});}return _0x47c389;}return null;})[_0xdf8d('0x1f')](respondWithResult(_0x346f21,null))[_0xdf8d('0x29')](handleError(_0x346f21,null));};var interaction_log=require(_0xdf8d('0x74'))(_0xdf8d('0x75'));exports[_0xdf8d('0x32')]=function(_0x514be6,_0x47e866,_0x4e9907){var _0x3b7638={'agent':{},'channel':_0xdf8d('0x5c')};if(_0x514be6[_0xdf8d('0x57')]['id']){delete _0x514be6['body']['id'];}_0x514be6['body'][_0xdf8d('0x61')]=_0x514be6[_0xdf8d('0x57')][_0xdf8d('0x61')]||_0x514be6[_0xdf8d('0x62')]['id'];_0x3b7638[_0xdf8d('0x76')]['id']=_0x514be6[_0xdf8d('0x57')][_0xdf8d('0x61')];return db['OpenchannelMessage']['find']({'where':{'id':_0x514be6[_0xdf8d('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x47e866,null))[_0xdf8d('0x1f')](function(_0x28dfdb){if(_0x28dfdb){_0x3b7638['message']=_0x28dfdb[_0xdf8d('0x64')]({'plain':!![]});return db[_0xdf8d('0x65')][_0xdf8d('0x55')]({'where':{'id':_0x28dfdb[_0xdf8d('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x47e866,null))[_0xdf8d('0x1f')](function(_0x5f551a){if(_0x5f551a){_0x3b7638[_0xdf8d('0x6b')]=_0x5f551a[_0xdf8d('0x64')]({'plain':!![]});interaction_log[_0xdf8d('0x20')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x514be6[_0xdf8d('0x62')]['id'],_0x514be6['user'][_0xdf8d('0x36')],_0x514be6[_0xdf8d('0x62')]['role'],_0x3b7638[_0xdf8d('0x6b')]['id'],_0x514be6[_0xdf8d('0x57')]?JSON['stringify'](_0x514be6[_0xdf8d('0x57')]):_0xdf8d('0x77'));return respondWithRpcPromise(_0xdf8d('0x78'),_0xdf8d('0x79'),_0x3b7638);}return null;})[_0xdf8d('0x1f')](function(_0x3bf057){if(_0x3bf057){_0x3bf057['message'][_0xdf8d('0x6e')]=util['format'](_0xdf8d('0x6f'),_0x514be6[_0xdf8d('0x62')]['name']);_0x3bf057['message'][_0xdf8d('0x70')]=_0x3b7638[_0xdf8d('0x70')];_0x3bf057[_0xdf8d('0x28')]['event']=_0xdf8d('0x32');respondWithRpcPromise(_0xdf8d('0x72'),_0xdf8d('0x72'),{'event':_0xdf8d('0x7a'),'message':_0x3bf057[_0xdf8d('0x28')]},client9002);return _0x3b7638;}return null;})[_0xdf8d('0x1f')](respondWithResult(_0x47e866,null))[_0xdf8d('0x29')](handleError(_0x47e866,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index c1bc324..041308d 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 _0x5eff=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0x3b662b,_0x5dab5a){var _0x1c968a=function(_0x323d92){while(--_0x323d92){_0x3b662b['push'](_0x3b662b['shift']());}};_0x1c968a(++_0x5dab5a);}(_0x5eff,0x1d8));var _0xf5ef=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5eff[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xf5ef('0x0'));var OpenchannelMessage=require(_0xf5ef('0x1'))['db'][_0xf5ef('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf5ef('0x3')](0x0);var events={'afterCreate':_0xf5ef('0x4'),'afterUpdate':'update','afterDestroy':_0xf5ef('0x5')};function emitEvent(_0x1a9b47){return function(_0x3fd0b8,_0x454182,_0x3b26ab){OpenchannelMessageEvents['emit'](_0x1a9b47+':'+_0x3fd0b8['id'],_0x3fd0b8);OpenchannelMessageEvents[_0xf5ef('0x6')](_0x1a9b47,_0x3fd0b8);_0x3b26ab(null);};}for(var e in events){if(events[_0xf5ef('0x7')](e)){var event=events[e];OpenchannelMessage[_0xf5ef('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0x718e=['hook','exports','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x120610,_0x5b42ad){var _0x3e8ef4=function(_0x4a76c3){while(--_0x4a76c3){_0x120610['push'](_0x120610['shift']());}};_0x3e8ef4(++_0x5b42ad);}(_0x718e,0x161));var _0xe718=function(_0x1c5385,_0x3aba1a){_0x1c5385=_0x1c5385-0x0;var _0x478ddb=_0x718e[_0x1c5385];return _0x478ddb;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0xe718('0x0'))['db'][_0xe718('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe718('0x2')](0x0);var events={'afterCreate':_0xe718('0x3'),'afterUpdate':'update','afterDestroy':_0xe718('0x4')};function emitEvent(_0x895618){return function(_0x35ac13,_0xfa1c18,_0x3cd868){OpenchannelMessageEvents['emit'](_0x895618+':'+_0x35ac13['id'],_0x35ac13);OpenchannelMessageEvents[_0xe718('0x5')](_0x895618,_0x35ac13);_0x3cd868(null);};}for(var e in events){if(events[_0xe718('0x6')](e)){var event=events[e];OpenchannelMessage[_0xe718('0x7')](e,emitEvent(event));}}module[_0xe718('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 1bd7f60..ddfb696 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 _0x99c9=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update','catch','error','CmContact','describe','then','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','GET','info','threadId','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x6f029b,_0x388ce5){var _0x42c618=function(_0x3b018f){while(--_0x3b018f){_0x6f029b['push'](_0x6f029b['shift']());}};_0x42c618(++_0x388ce5);}(_0x99c9,0x13c));var _0x999c=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x99c9[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x7'));var config=require(_0x999c('0x8'));var attributes=require(_0x999c('0x9'));module[_0x999c('0xa')]=function(_0x2bdd73,_0x14df32){return _0x2bdd73[_0x999c('0xb')](_0x999c('0xc'),attributes,{'tableName':_0x999c('0xd'),'paranoid':![],'indexes':[{'name':_0x999c('0xe'),'fields':[_0x999c('0xf')],'type':_0x999c('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32984f,_0x395321,_0x4dd585){var _0x1f3f8f=_0x2bdd73[_0x999c('0x11')];var _0x574ba0=_0x32984f[_0x999c('0x12')]({'plain':!![]});if(_0x574ba0[_0x999c('0x13')][_0x999c('0x14')]()==='in'||_0x574ba0[_0x999c('0x13')][_0x999c('0x14')]()===_0x999c('0x15')&&!_0x574ba0[_0x999c('0x16')]&&!_[_0x999c('0x17')](_0x574ba0[_0x999c('0x18')])){_0x1f3f8f[_0x999c('0x19')][_0x999c('0x1a')]({'where':{'id':_0x574ba0[_0x999c('0x1b')]}})['then'](function(_0x15f812){if(_0x15f812){_0x15f812[_0x999c('0x1c')]({'lastMsgAt':_0x574ba0['createdAt'],'lastMsgDirection':_0x574ba0['direction']['toLowerCase']()});}})[_0x999c('0x1d')](function(_0xb3e981){console[_0x999c('0x1e')](_0xb3e981);});}if(_0x574ba0[_0x999c('0x13')]===_0x999c('0x15')&&!_0x574ba0['secret']){var _0x226437;_0x1f3f8f[_0x999c('0x1f')][_0x999c('0x20')]()[_0x999c('0x21')](function(_0x110486){return _0x1f3f8f['OpenchannelAccount'][_0x999c('0x22')]({'where':{'id':_0x574ba0[_0x999c('0x23')]},'include':[{'model':_0x1f3f8f[_0x999c('0x19')],'as':_0x999c('0x24'),'where':{'id':_0x574ba0[_0x999c('0x1b')]},'limit':0x1,'include':[{'model':_0x1f3f8f['CmContact'],'as':_0x999c('0x25'),'attributes':_[_0x999c('0x26')](_0x110486)}]}]});})[_0x999c('0x21')](function(_0x1ec406){_0x226437=_0x1ec406[_0x999c('0x12')]({'plain':!![]});if(_0x226437&&_0x226437[_0x999c('0x27')]){logger['info'](_0x999c('0x28'),_0x999c('0x29'),util[_0x999c('0x2a')](_0x999c('0x2b'),_0x574ba0['id'],_0x226437[_0x999c('0x27')]));if(_0x226437[_0x999c('0x24')]&&_0x226437[_0x999c('0x24')][_0x999c('0x2c')]){_0x574ba0[_0x999c('0x2d')]=_[_0x999c('0x2e')](_0x226437[_0x999c('0x24')][0x0],'Contact');_0x574ba0[_0x999c('0x25')]=_0x226437[_0x999c('0x24')][0x0][_0x999c('0x25')];}var _0x395321={'method':_0x999c('0x2f'),'uri':encodeURI(_0x226437[_0x999c('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x395321['method']){case _0x999c('0x30'):_0x395321['qs']=_0x574ba0;break;case _0x999c('0x2f'):_0x395321[_0x999c('0xf')]=_0x574ba0;break;}return rp(_0x395321)['then'](function(_0x1abac6){logger[_0x999c('0x31')]('OpenchannelMessage,\x20%s,\x20%s',_0x999c('0x29'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x574ba0['id'],_0x226437[_0x999c('0x27')]));if(_0x1abac6[_0x999c('0xf')][_0x999c('0x32')]&&_0x1abac6[_0x999c('0xf')][_0x999c('0x32')]!=_0x574ba0[_0x999c('0x2d')][_0x999c('0x32')]){return _0x1f3f8f[_0x999c('0x19')][_0x999c('0x1c')]({'threadId':_0x1abac6[_0x999c('0xf')]['threadId']},{'logging':!![],'where':{'id':_0x574ba0[_0x999c('0x2d')]['id']}});}else{return;}})[_0x999c('0x21')](function(){return _0x32984f[_0x999c('0x1c')]({'read':!![]});})[_0x999c('0x1d')](function(_0x11b1e5){logger[_0x999c('0x1e')](_0x999c('0x28'),_0x999c('0x29'),util['inspect'](_0x11b1e5,{'showHidden':![],'depth':null}));_0x4dd585();});}else{_0x4dd585();}})['finally'](function(){_0x4dd585();});}else{_0x4dd585();}}},'charset':_0x999c('0x33'),'collate':_0x999c('0x34')});}; \ No newline at end of file +var _0xbbb8=['then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','keys','get','info','afterCreate','format','replyUri','length','Interaction','Contact','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbbb8,0x7d));var _0x8bbb=function(_0x4279a3,_0x28d10a){_0x4279a3=_0x4279a3-0x0;var _0x3b814f=_0xbbb8[_0x4279a3];return _0x3b814f;};'use strict';var _=require(_0x8bbb('0x0'));var util=require(_0x8bbb('0x1'));var logger=require('../../config/logger')(_0x8bbb('0x2'));var moment=require(_0x8bbb('0x3'));var BPromise=require('bluebird');var rp=require(_0x8bbb('0x4'));var fs=require('fs');var path=require(_0x8bbb('0x5'));var rimraf=require(_0x8bbb('0x6'));var config=require(_0x8bbb('0x7'));var attributes=require(_0x8bbb('0x8'));module[_0x8bbb('0x9')]=function(_0x2608b6,_0x3424eb){return _0x2608b6[_0x8bbb('0xa')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x8bbb('0xb')],'type':_0x8bbb('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x217137,_0x3a6ced,_0x95e93a){var _0x45e1bd=_0x2608b6[_0x8bbb('0xd')];var _0x3f571f=_0x217137['get']({'plain':!![]});if(_0x3f571f[_0x8bbb('0xe')][_0x8bbb('0xf')]()==='in'||_0x3f571f[_0x8bbb('0xe')]['toLowerCase']()===_0x8bbb('0x10')&&!_0x3f571f[_0x8bbb('0x11')]&&!_[_0x8bbb('0x12')](_0x3f571f['UserId'])){_0x45e1bd[_0x8bbb('0x13')][_0x8bbb('0x14')]({'where':{'id':_0x3f571f[_0x8bbb('0x15')]}})[_0x8bbb('0x16')](function(_0x5e08e4){if(_0x5e08e4){_0x5e08e4[_0x8bbb('0x17')]({'lastMsgAt':_0x3f571f[_0x8bbb('0x18')],'lastMsgDirection':_0x3f571f['direction'][_0x8bbb('0xf')]()});}})[_0x8bbb('0x19')](function(_0x3ac726){console[_0x8bbb('0x1a')](_0x3ac726);});}if(_0x3f571f[_0x8bbb('0xe')]===_0x8bbb('0x10')&&!_0x3f571f[_0x8bbb('0x11')]){var _0x15643c;_0x45e1bd[_0x8bbb('0x1b')][_0x8bbb('0x1c')]()[_0x8bbb('0x16')](function(_0x2c2cd4){return _0x45e1bd[_0x8bbb('0x1d')]['find']({'where':{'id':_0x3f571f[_0x8bbb('0x1e')]},'include':[{'model':_0x45e1bd[_0x8bbb('0x13')],'as':_0x8bbb('0x1f'),'where':{'id':_0x3f571f[_0x8bbb('0x15')]},'limit':0x1,'include':[{'model':_0x45e1bd[_0x8bbb('0x1b')],'as':'Contact','attributes':_[_0x8bbb('0x20')](_0x2c2cd4)}]}]});})['then'](function(_0x4eab60){_0x15643c=_0x4eab60[_0x8bbb('0x21')]({'plain':!![]});if(_0x15643c&&_0x15643c['replyUri']){logger[_0x8bbb('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x8bbb('0x23'),util[_0x8bbb('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x3f571f['id'],_0x15643c[_0x8bbb('0x25')]));if(_0x15643c[_0x8bbb('0x1f')]&&_0x15643c['Interactions'][_0x8bbb('0x26')]){_0x3f571f[_0x8bbb('0x27')]=_['omit'](_0x15643c[_0x8bbb('0x1f')][0x0],'Contact');_0x3f571f[_0x8bbb('0x28')]=_0x15643c[_0x8bbb('0x1f')][0x0][_0x8bbb('0x28')];}var _0x3a6ced={'method':'POST','uri':encodeURI(_0x15643c[_0x8bbb('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3a6ced['method']){case _0x8bbb('0x29'):_0x3a6ced['qs']=_0x3f571f;break;case'POST':_0x3a6ced[_0x8bbb('0xb')]=_0x3f571f;break;}return rp(_0x3a6ced)[_0x8bbb('0x16')](function(_0x1309e6){logger['info'](_0x8bbb('0x2a'),'afterCreate',util[_0x8bbb('0x24')](_0x8bbb('0x2b'),_0x3f571f['id'],_0x15643c[_0x8bbb('0x25')]));if(_0x1309e6[_0x8bbb('0xb')]['threadId']&&_0x1309e6['body'][_0x8bbb('0x2c')]!=_0x3f571f['Interaction'][_0x8bbb('0x2c')]){return _0x45e1bd[_0x8bbb('0x13')]['update']({'threadId':_0x1309e6[_0x8bbb('0xb')]['threadId']},{'logging':!![],'where':{'id':_0x3f571f[_0x8bbb('0x27')]['id']}});}else{return;}})[_0x8bbb('0x16')](function(){return _0x217137[_0x8bbb('0x17')]({'read':!![]});})[_0x8bbb('0x19')](function(_0x46eed0){logger[_0x8bbb('0x1a')](_0x8bbb('0x2a'),_0x8bbb('0x23'),util[_0x8bbb('0x2d')](_0x46eed0,{'showHidden':![],'depth':null}));_0x95e93a();});}else{_0x95e93a();}})[_0x8bbb('0x2e')](function(){_0x95e93a();});}else{_0x95e93a();}}},'charset':_0x8bbb('0x2f'),'collate':_0x8bbb('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index adf98d6..a2f8529 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 _0x0650=['CreateOpenchannelMessage','options','then','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch'];(function(_0x11789e,_0x3af92f){var _0x3a77df=function(_0x59dacc){while(--_0x59dacc){_0x11789e['push'](_0x11789e['shift']());}};_0x3a77df(++_0x3af92f);}(_0x0650,0xed));var _0x0065=function(_0x50859e,_0x2c958a){_0x50859e=_0x50859e-0x0;var _0x5847a2=_0x0650[_0x50859e];return _0x5847a2;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var moment=require(_0x0065('0x1'));var BPromise=require(_0x0065('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0065('0x4'));var logger=require(_0x0065('0x5'))(_0x0065('0x6'));var config=require('../../config/environment');var jayson=require(_0x0065('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0065('0x8')](config[_0x0065('0x9')],{'host':_0x0065('0xa'),'port':0x18eb});var socket=require(_0x0065('0xb'))(new Redis(config[_0x0065('0x9')]));require(_0x0065('0xc'))[_0x0065('0xd')](socket);function respondWithRpcPromise(_0x3e96dd,_0x409066,_0x5907e4){return new BPromise(function(_0x2850c0,_0xda5ef2){return client['request'](_0x3e96dd,_0x5907e4)['then'](function(_0x4c8f33){logger[_0x0065('0xe')](_0x0065('0xf'),_0x409066,'request\x20sent');logger[_0x0065('0x10')](_0x0065('0x11'),_0x409066,'request\x20sent',JSON[_0x0065('0x12')](_0x4c8f33));if(_0x4c8f33[_0x0065('0x13')]){if(_0x4c8f33['error']['code']===0x1f4){logger[_0x0065('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x409066,_0x4c8f33['error'][_0x0065('0x14')]);return _0xda5ef2(_0x4c8f33['error'][_0x0065('0x14')]);}logger['error'](_0x0065('0xf'),_0x409066,_0x4c8f33[_0x0065('0x13')][_0x0065('0x14')]);return _0x2850c0(_0x4c8f33[_0x0065('0x13')][_0x0065('0x14')]);}else{logger[_0x0065('0xe')](_0x0065('0xf'),_0x409066,_0x0065('0x15'));_0x2850c0(_0x4c8f33['result'][_0x0065('0x14')]);}})[_0x0065('0x16')](function(_0x49de99){logger[_0x0065('0x13')](_0x0065('0xf'),_0x409066,_0x49de99);_0xda5ef2(_0x49de99);});});}exports[_0x0065('0x17')]=function(_0x2eed20){var _0x44c2e0=this;return new Promise(function(_0x3eee18,_0x319e7a){return db['OpenchannelMessage']['create'](_0x2eed20['body'],{'raw':_0x2eed20[_0x0065('0x18')]?_0x2eed20[_0x0065('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0065('0x19')](function(_0x5f1733){logger[_0x0065('0xe')](_0x0065('0x17'),_0x2eed20);logger[_0x0065('0x10')](_0x0065('0x17'),_0x2eed20,JSON[_0x0065('0x12')](_0x5f1733));_0x3eee18(_0x5f1733);})[_0x0065('0x16')](function(_0x3503e){logger['error'](_0x0065('0x17'),_0x3503e['message'],_0x2eed20);_0x319e7a(_0x44c2e0['error'](0x1f4,_0x3503e[_0x0065('0x14')]));});});}; \ No newline at end of file +var _0x1b64=['bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost','socket.io-emitter','redis','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','CreateOpenchannelMessage','OpenchannelMessage','options','raw','stringify','catch','lodash','util'];(function(_0x531e93,_0x2cb0b0){var _0x4ec3c3=function(_0x1915a0){while(--_0x1915a0){_0x531e93['push'](_0x531e93['shift']());}};_0x4ec3c3(++_0x2cb0b0);}(_0x1b64,0x76));var _0x41b6=function(_0x570d25,_0x375387){_0x570d25=_0x570d25-0x0;var _0x5acba9=_0x1b64[_0x570d25];return _0x5acba9;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var moment=require('moment');var BPromise=require(_0x41b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x41b6('0x3'));var logger=require(_0x41b6('0x4'))(_0x41b6('0x5'));var config=require(_0x41b6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x41b6('0x7')][_0x41b6('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x41b6('0x9'),'port':0x18eb});var socket=require(_0x41b6('0xa'))(new Redis(config[_0x41b6('0xb')]));require(_0x41b6('0xc'))[_0x41b6('0xd')](socket);function respondWithRpcPromise(_0x412dca,_0x4d66c5,_0x207a2f){return new BPromise(function(_0x31b2b4,_0x274f27){return client[_0x41b6('0xe')](_0x412dca,_0x207a2f)[_0x41b6('0xf')](function(_0x42e6f9){logger[_0x41b6('0x10')](_0x41b6('0x11'),_0x4d66c5,_0x41b6('0x12'));logger[_0x41b6('0x13')](_0x41b6('0x14'),_0x4d66c5,_0x41b6('0x12'),JSON['stringify'](_0x42e6f9));if(_0x42e6f9[_0x41b6('0x15')]){if(_0x42e6f9[_0x41b6('0x15')][_0x41b6('0x16')]===0x1f4){logger[_0x41b6('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d66c5,_0x42e6f9[_0x41b6('0x15')][_0x41b6('0x17')]);return _0x274f27(_0x42e6f9[_0x41b6('0x15')][_0x41b6('0x17')]);}logger[_0x41b6('0x15')](_0x41b6('0x11'),_0x4d66c5,_0x42e6f9[_0x41b6('0x15')]['message']);return _0x31b2b4(_0x42e6f9[_0x41b6('0x15')][_0x41b6('0x17')]);}else{logger[_0x41b6('0x10')](_0x41b6('0x11'),_0x4d66c5,_0x41b6('0x12'));_0x31b2b4(_0x42e6f9['result']['message']);}})['catch'](function(_0x50ea3b){logger[_0x41b6('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x4d66c5,_0x50ea3b);_0x274f27(_0x50ea3b);});});}exports[_0x41b6('0x18')]=function(_0xbd99c5){var _0x30a168=this;return new Promise(function(_0x3da7de,_0x10c17c){return db[_0x41b6('0x19')]['create'](_0xbd99c5['body'],{'raw':_0xbd99c5[_0x41b6('0x1a')]?_0xbd99c5['options'][_0x41b6('0x1b')]===undefined?!![]:![]:!![]})[_0x41b6('0xf')](function(_0x309eba){logger[_0x41b6('0x10')](_0x41b6('0x18'),_0xbd99c5);logger[_0x41b6('0x13')](_0x41b6('0x18'),_0xbd99c5,JSON[_0x41b6('0x1c')](_0x309eba));_0x3da7de(_0x309eba);})[_0x41b6('0x1d')](function(_0x3e47bf){logger[_0x41b6('0x15')]('CreateOpenchannelMessage',_0x3e47bf[_0x41b6('0x17')],_0xbd99c5);_0x10c17c(_0x30a168[_0x41b6('0x15')](0x1f4,_0x3e47bf['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index a7cbe18..60535d7 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 _0xbdb7=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x58f57f,_0x23028c){_0x58f57f=_0x58f57f-0x0;var _0x318b7f=_0xbdb7[_0x58f57f];return _0x318b7f;};'use strict';var OpenchannelMessageEvents=require(_0x7bdb('0x0'));var events=[_0x7bdb('0x1'),_0x7bdb('0x2'),_0x7bdb('0x3')];function createListener(_0x23c326,_0x433850){return function(_0x4496ac){_0x433850[_0x7bdb('0x4')](_0x23c326,_0x4496ac);};}function removeListener(_0x46c068,_0x47aec5){return function(){OpenchannelMessageEvents[_0x7bdb('0x5')](_0x46c068,_0x47aec5);};}exports['register']=function(_0x4b5fff){for(var _0xffdc86=0x0,_0x1e23a3=events['length'];_0xffdc86<_0x1e23a3;_0xffdc86++){var _0x513cba=events[_0xffdc86];var _0x468041=createListener(_0x7bdb('0x6')+_0x513cba,_0x4b5fff);OpenchannelMessageEvents['on'](_0x513cba,_0x468041);}}; \ No newline at end of file +var _0xda3f=['openchannelMessage:','save','remove','register','length'];(function(_0x1dc6de,_0xb166b6){var _0x47b2fb=function(_0x3603a9){while(--_0x3603a9){_0x1dc6de['push'](_0x1dc6de['shift']());}};_0x47b2fb(++_0xb166b6);}(_0xda3f,0xec));var _0xfda3=function(_0x546142,_0x57c75a){_0x546142=_0x546142-0x0;var _0x483e8f=_0xda3f[_0x546142];return _0x483e8f;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xfda3('0x0'),_0xfda3('0x1'),'update'];function createListener(_0x5299b0,_0x5d7071){return function(_0x3859fe){_0x5d7071['emit'](_0x5299b0,_0x3859fe);};}function removeListener(_0x36dc71,_0x22187d){return function(){OpenchannelMessageEvents['removeListener'](_0x36dc71,_0x22187d);};}exports[_0xfda3('0x2')]=function(_0x43a010){for(var _0x47e7e2=0x0,_0x4e72d1=events[_0xfda3('0x3')];_0x47e7e2<_0x4e72d1;_0x47e7e2++){var _0x42476a=events[_0x47e7e2];var _0x125e2a=createListener(_0xfda3('0x4')+_0x42476a,_0x43a010);OpenchannelMessageEvents['on'](_0x42476a,_0x125e2a);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index a17dcd1..6e13cec 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 _0x6f7b=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/members','getMembers','/:id/teams'];(function(_0x39faf9,_0x560228){var _0x1cd6fc=function(_0x46baa5){while(--_0x46baa5){_0x39faf9['push'](_0x39faf9['shift']());}};_0x1cd6fc(++_0x560228);}(_0x6f7b,0x168));var _0xb6f7=function(_0x3940e3,_0x2052d0){_0x3940e3=_0x3940e3-0x0;var _0x1cc83b=_0x6f7b[_0x3940e3];return _0x1cc83b;};'use strict';var multer=require('multer');var util=require(_0xb6f7('0x0'));var path=require(_0xb6f7('0x1'));var timeout=require(_0xb6f7('0x2'));var express=require(_0xb6f7('0x3'));var router=express[_0xb6f7('0x4')]();var auth=require(_0xb6f7('0x5'));var interaction=require(_0xb6f7('0x6'));var config=require('../../config/environment');var controller=require(_0xb6f7('0x7'));router['get']('/',auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x9')]);router[_0xb6f7('0xa')](_0xb6f7('0xb'),auth['isAuthenticated'](),controller[_0xb6f7('0xc')]);router[_0xb6f7('0xa')](_0xb6f7('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb6f7('0xe'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0xf')]);router[_0xb6f7('0xa')](_0xb6f7('0x10'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x11')]);router[_0xb6f7('0xa')](_0xb6f7('0x12'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x13')]);router[_0xb6f7('0x14')]('/',auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x15')]);router[_0xb6f7('0x14')](_0xb6f7('0x10'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x16')]);router[_0xb6f7('0x14')](_0xb6f7('0x12'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x17')]);router[_0xb6f7('0x18')](_0xb6f7('0xd'),auth['isAuthenticated'](),controller[_0xb6f7('0x19')]);router[_0xb6f7('0x1a')](_0xb6f7('0xd'),auth[_0xb6f7('0x8')](),controller['destroy']);router[_0xb6f7('0x1a')](_0xb6f7('0x10'),auth[_0xb6f7('0x8')](),controller['removeTeams']);router[_0xb6f7('0x1a')](_0xb6f7('0x12'),auth[_0xb6f7('0x8')](),controller[_0xb6f7('0x1b')]);module[_0xb6f7('0x1c')]=router; \ No newline at end of file +var _0x9432=['put','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents'];(function(_0x52ba86,_0x21cf59){var _0x4e676e=function(_0x544e26){while(--_0x544e26){_0x52ba86['push'](_0x52ba86['shift']());}};_0x4e676e(++_0x21cf59);}(_0x9432,0x1e3));var _0x2943=function(_0x62182b,_0x5fc61a){_0x62182b=_0x62182b-0x0;var _0x385ef9=_0x9432[_0x62182b];return _0x385ef9;};'use strict';var multer=require(_0x2943('0x0'));var util=require(_0x2943('0x1'));var path=require('path');var timeout=require(_0x2943('0x2'));var express=require(_0x2943('0x3'));var router=express['Router']();var auth=require(_0x2943('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2943('0x5'));router[_0x2943('0x6')]('/',auth[_0x2943('0x7')](),controller[_0x2943('0x8')]);router[_0x2943('0x6')]('/describe',auth[_0x2943('0x7')](),controller[_0x2943('0x9')]);router[_0x2943('0x6')](_0x2943('0xa'),auth['isAuthenticated'](),controller[_0x2943('0xb')]);router[_0x2943('0x6')](_0x2943('0xc'),auth['isAuthenticated'](),controller[_0x2943('0xd')]);router['get'](_0x2943('0xe'),auth[_0x2943('0x7')](),controller[_0x2943('0xf')]);router[_0x2943('0x6')](_0x2943('0x10'),auth[_0x2943('0x7')](),controller[_0x2943('0x11')]);router[_0x2943('0x12')]('/',auth[_0x2943('0x7')](),controller[_0x2943('0x13')]);router[_0x2943('0x12')](_0x2943('0xe'),auth[_0x2943('0x7')](),controller['addTeams']);router[_0x2943('0x12')](_0x2943('0x10'),auth[_0x2943('0x7')](),controller[_0x2943('0x14')]);router[_0x2943('0x15')](_0x2943('0xa'),auth[_0x2943('0x7')](),controller['update']);router['delete'](_0x2943('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x2943('0x16')]('/:id/teams',auth[_0x2943('0x7')](),controller['removeTeams']);router[_0x2943('0x16')](_0x2943('0x10'),auth[_0x2943('0x7')](),controller['removeAgents']);module[_0x2943('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 9e0274e..91c8a18 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 _0x720f=['ENUM','beepall','exports','STRING','name','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x720f,0x80));var _0xf720=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x720f[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require('sequelize');module[_0xf720('0x0')]={'name':{'type':Sequelize[_0xf720('0x1')],'unique':_0xf720('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf720('0x1')]},'timeout':{'type':Sequelize[_0xf720('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf720('0x4')]('rrmemory',_0xf720('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x1760=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x3f0b15,_0x29a0c6){var _0x371196=function(_0x39ea4e){while(--_0x39ea4e){_0x3f0b15['push'](_0x3f0b15['shift']());}};_0x371196(++_0x29a0c6);}(_0x1760,0x11a));var _0x0176=function(_0x2f075b,_0x37d5ba){_0x2f075b=_0x2f075b-0x0;var _0x4000a1=_0x1760[_0x2f075b];return _0x4000a1;};'use strict';var Sequelize=require(_0x0176('0x0'));module['exports']={'name':{'type':Sequelize[_0x0176('0x1')],'unique':_0x0176('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0176('0x1')]},'timeout':{'type':Sequelize[_0x0176('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0176('0x4')](_0x0176('0x5'),_0x0176('0x6'),_0x0176('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index d72c495..cace66f 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 _0x6e6f=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','hasOwnProperty','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','removeTeams','field','tq.TeamId','from','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','compact','removeAgents','forEach','emit','userOpenchannelQueue:remove','addAgents','omit','spread','userOpenchannelQueue:save','isArray','getAgents','zip-dir','request-promise','moment','mustache','util','path','sox','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','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','count'];(function(_0x1b2f1c,_0x4d0dcb){var _0x220a3c=function(_0xffb3ec){while(--_0xffb3ec){_0x1b2f1c['push'](_0x1b2f1c['shift']());}};_0x220a3c(++_0x4d0dcb);}(_0x6e6f,0xf5));var _0xf6e6=function(_0x53feda,_0x8d5d13){_0x53feda=_0x53feda-0x0;var _0x2c0b4f=_0x6e6f[_0x53feda];return _0x2c0b4f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf6e6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf6e6('0x1'));var moment=require(_0xf6e6('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf6e6('0x3'));var util=require(_0xf6e6('0x4'));var path=require(_0xf6e6('0x5'));var sox=require(_0xf6e6('0x6'));var csv=require(_0xf6e6('0x7'));var ejs=require(_0xf6e6('0x8'));var fs=require('fs');var _=require(_0xf6e6('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf6e6('0xa'));var deskjs=require(_0xf6e6('0xb'));var toCsv=require(_0xf6e6('0x7'));var querystring=require(_0xf6e6('0xc'));var Papa=require(_0xf6e6('0xd'));var Redis=require(_0xf6e6('0xe'));var authService=require(_0xf6e6('0xf'));var qs=require(_0xf6e6('0x10'));var as=require(_0xf6e6('0x11'));var hardwareService=require(_0xf6e6('0x12'));var logger=require(_0xf6e6('0x13'))(_0xf6e6('0x14'));var utils=require(_0xf6e6('0x15'));var config=require(_0xf6e6('0x16'));var db=require('../../mysqldb')['db'];config[_0xf6e6('0x17')]=_[_0xf6e6('0x18')](config[_0xf6e6('0x17')],{'host':_0xf6e6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6e6('0x17')]));require(_0xf6e6('0x1a'))[_0xf6e6('0x1b')](socket);function respondWithStatusCode(_0x243ea3,_0x1ee5d5){_0x1ee5d5=_0x1ee5d5||0xcc;return function(_0x375774){if(_0x375774){return _0x243ea3[_0xf6e6('0x1c')](_0x1ee5d5);}return _0x243ea3[_0xf6e6('0x1d')](_0x1ee5d5)[_0xf6e6('0x1e')]();};}function respondWithResult(_0x4585fe,_0x256d59){_0x256d59=_0x256d59||0xc8;return function(_0x52f6e9){if(_0x52f6e9){return _0x4585fe[_0xf6e6('0x1d')](_0x256d59)[_0xf6e6('0x1f')](_0x52f6e9);}};}function respondWithFilteredResult(_0x4be672,_0x1dcb08){return function(_0x2a40ba){if(_0x2a40ba){var _0x335518=_0x2a40ba[_0xf6e6('0x20')],_0x4ad326=_0x1dcb08[_0xf6e6('0x21')],_0x4480b5=_0x1dcb08[_0xf6e6('0x21')]+_0x1dcb08[_0xf6e6('0x22')],_0x16c821;if(_0x4480b5>=_0x335518){_0x4480b5=_0x335518;_0x16c821=0xc8;}else{_0x16c821=0xce;}_0x4be672[_0xf6e6('0x1d')](_0x16c821);return _0x4be672[_0xf6e6('0x23')](_0xf6e6('0x24'),_0x4ad326+'-'+_0x4480b5+'/'+_0x335518)[_0xf6e6('0x1f')](_0x2a40ba);}return null;};}function patchUpdates(_0x257c57){return function(_0x208bc2){try{jsonpatch[_0xf6e6('0x25')](_0x208bc2,_0x257c57,!![]);}catch(_0x14581c){return BPromise[_0xf6e6('0x26')](_0x14581c);}return _0x208bc2[_0xf6e6('0x27')]();};}function saveUpdates(_0x462083,_0x39f73a){return function(_0x5748d1){if(_0x5748d1){return _0x5748d1[_0xf6e6('0x28')](_0x462083)[_0xf6e6('0x29')](function(_0x4cca06){return _0x4cca06;});}return null;};}function removeEntity(_0x63c266,_0x1d06e2){return function(_0x4f758d){if(_0x4f758d){return _0x4f758d[_0xf6e6('0x2a')]()['then'](function(){var _0x4bdf78=_0x4f758d[_0xf6e6('0x2b')]({'plain':!![]});var _0x21286e='OpenchannelQueues';return db['UserProfileResource'][_0xf6e6('0x2a')]({'where':{'type':_0x21286e,'resourceId':_0x4bdf78['id']}})[_0xf6e6('0x29')](function(){return _0x4f758d;});})[_0xf6e6('0x29')](function(){_0x63c266[_0xf6e6('0x1d')](0xcc)[_0xf6e6('0x1e')]();});}};}function handleEntityNotFound(_0x2b41e0,_0x1d6d52){return function(_0x3c16a0){if(!_0x3c16a0){_0x2b41e0['sendStatus'](0x194);}return _0x3c16a0;};}function handleError(_0x39ca78,_0xadd233){_0xadd233=_0xadd233||0x1f4;return function(_0x18baab){logger[_0xf6e6('0x2c')](_0x18baab[_0xf6e6('0x2d')]);if(_0x18baab['name']){delete _0x18baab[_0xf6e6('0x2e')];}_0x39ca78[_0xf6e6('0x1d')](_0xadd233)[_0xf6e6('0x2f')](_0x18baab);};}exports[_0xf6e6('0x30')]=function(_0x5a829f,_0x4c2778){var _0x998548={},_0x180665={},_0x3ed3f5={'count':0x0,'rows':[]};var _0x14ef28=_[_0xf6e6('0x31')](db[_0xf6e6('0x32')][_0xf6e6('0x33')],function(_0x411b1f){return{'name':_0x411b1f[_0xf6e6('0x34')],'type':_0x411b1f[_0xf6e6('0x35')][_0xf6e6('0x36')]};});_0x180665[_0xf6e6('0x37')]=_[_0xf6e6('0x31')](_0x14ef28,_0xf6e6('0x2e'));_0x180665[_0xf6e6('0x38')]=_[_0xf6e6('0x39')](_0x5a829f['query']);_0x180665[_0xf6e6('0x3a')]=_['intersection'](_0x180665[_0xf6e6('0x37')],_0x180665[_0xf6e6('0x38')]);_0x998548[_0xf6e6('0x3b')]=_[_0xf6e6('0x3c')](_0x180665[_0xf6e6('0x37')],qs[_0xf6e6('0x3d')](_0x5a829f[_0xf6e6('0x38')]['fields']));_0x998548['attributes']=_0x998548[_0xf6e6('0x3b')][_0xf6e6('0x3e')]?_0x998548[_0xf6e6('0x3b')]:_0x180665[_0xf6e6('0x37')];if(!_0x5a829f['query']['hasOwnProperty'](_0xf6e6('0x3f'))){_0x998548[_0xf6e6('0x22')]=qs[_0xf6e6('0x22')](_0x5a829f[_0xf6e6('0x38')]['limit']);_0x998548[_0xf6e6('0x21')]=qs[_0xf6e6('0x21')](_0x5a829f[_0xf6e6('0x38')][_0xf6e6('0x21')]);}_0x998548[_0xf6e6('0x40')]=qs[_0xf6e6('0x41')](_0x5a829f['query'][_0xf6e6('0x41')]);_0x998548['where']=qs['filters'](_[_0xf6e6('0x42')](_0x5a829f[_0xf6e6('0x38')],_0x180665['filters']),_0x14ef28);if(_0x5a829f[_0xf6e6('0x38')]['filter']){_0x998548[_0xf6e6('0x43')]=_[_0xf6e6('0x44')](_0x998548['where'],{'$or':_['map'](_0x14ef28,function(_0x197357){if(_0x197357[_0xf6e6('0x35')]!=='VIRTUAL'){var _0x1e6a23={};_0x1e6a23[_0x197357[_0xf6e6('0x2e')]]={'$like':'%'+_0x5a829f['query'][_0xf6e6('0x45')]+'%'};return _0x1e6a23;}})});}_0x998548=_[_0xf6e6('0x44')]({},_0x998548,_0x5a829f[_0xf6e6('0x46')]);var _0x4c50f7={'where':_0x998548['where']};return db[_0xf6e6('0x32')][_0xf6e6('0x20')](_0x4c50f7)['then'](function(_0x20b9fd){_0x3ed3f5['count']=_0x20b9fd;if(_0x5a829f['query'][_0xf6e6('0x47')]){_0x998548[_0xf6e6('0x48')]=[{'all':!![]}];}return db[_0xf6e6('0x32')][_0xf6e6('0x49')](_0x998548);})[_0xf6e6('0x29')](function(_0x15e23c){_0x3ed3f5[_0xf6e6('0x4a')]=_0x15e23c;return _0x3ed3f5;})[_0xf6e6('0x29')](respondWithFilteredResult(_0x4c2778,_0x998548))[_0xf6e6('0x4b')](handleError(_0x4c2778,null));};exports[_0xf6e6('0x4c')]=function(_0x4c1709,_0x4c7cf2){var _0x144052={'raw':!![],'where':{'id':_0x4c1709[_0xf6e6('0x4d')]['id']}},_0x3adc9a={};_0x3adc9a[_0xf6e6('0x37')]=_[_0xf6e6('0x39')](db[_0xf6e6('0x32')][_0xf6e6('0x33')]);_0x3adc9a[_0xf6e6('0x38')]=_[_0xf6e6('0x39')](_0x4c1709[_0xf6e6('0x38')]);_0x3adc9a[_0xf6e6('0x3a')]=_[_0xf6e6('0x3c')](_0x3adc9a['model'],_0x3adc9a['query']);_0x144052[_0xf6e6('0x3b')]=_[_0xf6e6('0x3c')](_0x3adc9a[_0xf6e6('0x37')],qs[_0xf6e6('0x3d')](_0x4c1709[_0xf6e6('0x38')][_0xf6e6('0x3d')]));_0x144052[_0xf6e6('0x3b')]=_0x144052[_0xf6e6('0x3b')][_0xf6e6('0x3e')]?_0x144052[_0xf6e6('0x3b')]:_0x3adc9a[_0xf6e6('0x37')];if(_0x4c1709[_0xf6e6('0x38')][_0xf6e6('0x47')]){_0x144052[_0xf6e6('0x48')]=[{'all':!![]}];}_0x144052=_['merge']({},_0x144052,_0x4c1709[_0xf6e6('0x46')]);return db[_0xf6e6('0x32')][_0xf6e6('0x4e')](_0x144052)['then'](handleEntityNotFound(_0x4c7cf2,null))[_0xf6e6('0x29')](respondWithResult(_0x4c7cf2,null))[_0xf6e6('0x4b')](handleError(_0x4c7cf2,null));};exports[_0xf6e6('0x4f')]=function(_0x277b1e,_0x4eb77d){return db[_0xf6e6('0x32')]['create'](_0x277b1e[_0xf6e6('0x50')],{})[_0xf6e6('0x29')](function(_0x161217){var _0x582ac9=_0x277b1e[_0xf6e6('0x51')]['get']({'plain':!![]});if(!_0x582ac9)throw new Error(_0xf6e6('0x52'));if(_0x582ac9[_0xf6e6('0x53')]==='user'){var _0x440236=_0x161217[_0xf6e6('0x2b')]({'plain':!![]});var _0xfb6001='OpenchannelQueues';return db['UserProfileSection'][_0xf6e6('0x4e')]({'where':{'name':_0xfb6001,'userProfileId':_0x582ac9[_0xf6e6('0x54')]},'raw':!![]})[_0xf6e6('0x29')](function(_0x368382){if(_0x368382&&_0x368382[_0xf6e6('0x55')]===0x0){return db[_0xf6e6('0x56')][_0xf6e6('0x4f')]({'name':_0x440236['name'],'resourceId':_0x440236['id'],'type':_0x368382[_0xf6e6('0x2e')],'sectionId':_0x368382['id']},{})['then'](function(){return _0x161217;});}else{return _0x161217;}})['catch'](function(_0xeea479){logger['error'](_0xf6e6('0x57'),_0xeea479);throw _0xeea479;});}return _0x161217;})[_0xf6e6('0x29')](respondWithResult(_0x4eb77d,0xc9))[_0xf6e6('0x4b')](handleError(_0x4eb77d,null));};exports['update']=function(_0x1980f1,_0x29be19){if(_0x1980f1['body']['id']){delete _0x1980f1['body']['id'];}return db[_0xf6e6('0x32')]['find']({'where':{'id':_0x1980f1['params']['id']}})[_0xf6e6('0x29')](handleEntityNotFound(_0x29be19,null))[_0xf6e6('0x29')](saveUpdates(_0x1980f1['body'],null))[_0xf6e6('0x29')](respondWithResult(_0x29be19,null))[_0xf6e6('0x4b')](handleError(_0x29be19,null));};exports[_0xf6e6('0x2a')]=function(_0x176568,_0x28614e){return db[_0xf6e6('0x32')][_0xf6e6('0x4e')]({'where':{'id':_0x176568[_0xf6e6('0x4d')]['id']}})[_0xf6e6('0x29')](handleEntityNotFound(_0x28614e,null))['then'](removeEntity(_0x28614e,null))['catch'](handleError(_0x28614e,null));};exports[_0xf6e6('0x58')]=function(_0x368967,_0x23bc84){return db[_0xf6e6('0x32')]['describe']()[_0xf6e6('0x29')](respondWithResult(_0x23bc84,null))[_0xf6e6('0x4b')](handleError(_0x23bc84,null));};exports[_0xf6e6('0x59')]=function(_0x78963a,_0x37217d,_0x2589ce){var _0x252b98={'raw':!![],'where':{}},_0x2be0e2={},_0x2e8f40;return db[_0xf6e6('0x32')][_0xf6e6('0x5a')]({'where':{'id':_0x78963a[_0xf6e6('0x4d')]['id']}})[_0xf6e6('0x29')](handleEntityNotFound(_0x37217d,null))[_0xf6e6('0x29')](function(_0x406377){if(_0x406377){_0x2e8f40=_0x406377[_0xf6e6('0x2b')]({'plain':!![]});_0x2be0e2[_0xf6e6('0x37')]=_['keys'](db[_0xf6e6('0x5b')]['rawAttributes']);_0x2be0e2[_0xf6e6('0x38')]=_[_0xf6e6('0x39')](_0x78963a['query']);_0x2be0e2[_0xf6e6('0x3a')]=_[_0xf6e6('0x3c')](_0x2be0e2[_0xf6e6('0x37')],_0x2be0e2[_0xf6e6('0x38')]);_0x252b98[_0xf6e6('0x3b')]=_[_0xf6e6('0x3c')](_0x2be0e2[_0xf6e6('0x37')],qs[_0xf6e6('0x3d')](_0x78963a[_0xf6e6('0x38')]['fields']));_0x252b98[_0xf6e6('0x3b')]=_0x252b98[_0xf6e6('0x3b')]['length']?_0x252b98[_0xf6e6('0x3b')]:_0x2be0e2['model'];if(!_0x78963a[_0xf6e6('0x38')][_0xf6e6('0x5c')]('nolimit')){_0x252b98[_0xf6e6('0x22')]=qs[_0xf6e6('0x22')](_0x78963a[_0xf6e6('0x38')][_0xf6e6('0x22')]);_0x252b98[_0xf6e6('0x21')]=qs[_0xf6e6('0x21')](_0x78963a[_0xf6e6('0x38')]['offset']);}_0x252b98[_0xf6e6('0x40')]=qs[_0xf6e6('0x41')](_0x78963a[_0xf6e6('0x38')][_0xf6e6('0x41')]);_0x252b98[_0xf6e6('0x43')]=qs['filters'](_[_0xf6e6('0x42')](_0x78963a[_0xf6e6('0x38')],_0x2be0e2['filters']));_0x252b98[_0xf6e6('0x43')]['OpenchannelQueueId']=_0x406377['id'];if(_0x78963a[_0xf6e6('0x38')]['filter']){_0x252b98[_0xf6e6('0x43')]=_[_0xf6e6('0x44')](_0x252b98[_0xf6e6('0x43')],{'$or':_[_0xf6e6('0x31')](_0x252b98[_0xf6e6('0x3b')],function(_0x1c4300){var _0x3ad265={};_0x3ad265[_0x1c4300]={'$like':'%'+_0x78963a[_0xf6e6('0x38')][_0xf6e6('0x45')]+'%'};return _0x3ad265;})});}_0x252b98=_['merge']({},_0x252b98,_0x78963a['options']);return db['UserOpenchannelQueue'][_0xf6e6('0x49')](_0x252b98);}})['then'](function(_0x3eb7d8){if(_0x3eb7d8){return db[_0xf6e6('0x5d')][_0xf6e6('0x5e')]({'where':{'id':_[_0xf6e6('0x31')](_0x3eb7d8,'UserId'),'role':_0xf6e6('0x5f')},'attributes':['id',_0xf6e6('0x2e'),_0xf6e6('0x60'),_0xf6e6('0x61'),_0xf6e6('0x62')]});}})['then'](function(_0x24ca9f){if(_0x24ca9f){return{'count':_0x24ca9f[_0xf6e6('0x20')],'rows':_[_0xf6e6('0x31')](_0x24ca9f[_0xf6e6('0x4a')],function(_0x2402a6){return{'membername':_0x2402a6[_0xf6e6('0x2e')],'UserId':_0x2402a6['id'],'queue_name':_0x2e8f40[_0xf6e6('0x2e')],'OpenchannelQueueId':_0x2e8f40['id'],'interface':util[_0xf6e6('0x63')](_0xf6e6('0x64'),_0xf6e6('0x65'),_0x2402a6[_0xf6e6('0x2e')]),'penalty':0x0,'paused':_0x2402a6[_0xf6e6('0x60')],'createdAt':_0x2402a6['createdAt'],'updatedAt':_0x2402a6[_0xf6e6('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf6e6('0x29')](respondWithFilteredResult(_0x37217d,_0x252b98))['catch'](handleError(_0x37217d,null));};exports[_0xf6e6('0x66')]=function(_0x5b181a,_0x3b9cce,_0xd77353){var _0x2c84d8={};var _0x1e9ca6={};var _0x5a8cc5;var _0x47b831;return db['OpenchannelQueue'][_0xf6e6('0x5a')]({'where':{'id':_0x5b181a[_0xf6e6('0x4d')]['id']}})[_0xf6e6('0x29')](handleEntityNotFound(_0x3b9cce,null))['then'](function(_0x4eb20c){if(_0x4eb20c){_0x5a8cc5=_0x4eb20c;_0x1e9ca6[_0xf6e6('0x37')]=_[_0xf6e6('0x39')](db[_0xf6e6('0x67')][_0xf6e6('0x33')]);_0x1e9ca6[_0xf6e6('0x38')]=_[_0xf6e6('0x39')](_0x5b181a[_0xf6e6('0x38')]);_0x1e9ca6[_0xf6e6('0x3a')]=_[_0xf6e6('0x3c')](_0x1e9ca6[_0xf6e6('0x37')],_0x1e9ca6[_0xf6e6('0x38')]);_0x2c84d8['attributes']=_[_0xf6e6('0x3c')](_0x1e9ca6[_0xf6e6('0x37')],qs['fields'](_0x5b181a[_0xf6e6('0x38')][_0xf6e6('0x3d')]));_0x2c84d8[_0xf6e6('0x3b')]=_0x2c84d8[_0xf6e6('0x3b')][_0xf6e6('0x3e')]?_0x2c84d8['attributes']:_0x1e9ca6[_0xf6e6('0x37')];_0x2c84d8[_0xf6e6('0x40')]=qs[_0xf6e6('0x41')](_0x5b181a[_0xf6e6('0x38')][_0xf6e6('0x41')]);_0x2c84d8[_0xf6e6('0x43')]=qs[_0xf6e6('0x3a')](_[_0xf6e6('0x42')](_0x5b181a['query'],_0x1e9ca6['filters']));if(_0x5b181a[_0xf6e6('0x38')][_0xf6e6('0x45')]){_0x2c84d8['where']=_['merge'](_0x2c84d8[_0xf6e6('0x43')],{'$or':_[_0xf6e6('0x31')](_0x2c84d8[_0xf6e6('0x3b')],function(_0x18729f){var _0x59a078={};_0x59a078[_0x18729f]={'$like':'%'+_0x5b181a[_0xf6e6('0x38')][_0xf6e6('0x45')]+'%'};return _0x59a078;})});}_0x2c84d8=_[_0xf6e6('0x44')]({},_0x2c84d8,_0x5b181a[_0xf6e6('0x46')]);return _0x5a8cc5[_0xf6e6('0x66')](_0x2c84d8);}})[_0xf6e6('0x29')](function(_0x2e6784){if(_0x2e6784){_0x47b831=_0x2e6784['length'];if(!_0x5b181a['query'][_0xf6e6('0x5c')](_0xf6e6('0x3f'))){_0x2c84d8['limit']=qs[_0xf6e6('0x22')](_0x5b181a[_0xf6e6('0x38')][_0xf6e6('0x22')]);_0x2c84d8[_0xf6e6('0x21')]=qs[_0xf6e6('0x21')](_0x5b181a['query'][_0xf6e6('0x21')]);}return _0x5a8cc5[_0xf6e6('0x66')](_0x2c84d8);}})[_0xf6e6('0x29')](function(_0x491f05){if(_0x491f05){return _0x491f05?{'count':_0x47b831,'rows':_0x491f05}:null;}})['then'](respondWithResult(_0x3b9cce,null))['catch'](handleError(_0x3b9cce,null));};exports[_0xf6e6('0x68')]=function(_0x220ff0,_0x280ab6,_0x3661c8){var _0x2d6143=_0x220ff0[_0xf6e6('0x50')][_0xf6e6('0x69')];return db[_0xf6e6('0x67')][_0xf6e6('0x49')]({'where':{'id':_0x2d6143},'attributes':['id'],'include':[{'model':db[_0xf6e6('0x5d')],'as':_0xf6e6('0x6a'),'attributes':['id','name',_0xf6e6('0x6b'),_0xf6e6('0x6c'),_0xf6e6('0x6d')],'raw':!![]}]})['then'](function(_0x134d71){if(_0x134d71){var _0x82484c=_['flatMap'](_0x134d71,function(_0x28d5c0){var _0x4fc85e=_0x28d5c0[_0xf6e6('0x2b')]({'plain':!![]});return _0x4fc85e[_0xf6e6('0x6a')];});return db[_0xf6e6('0x32')]['find']({'where':{'id':_0x220ff0[_0xf6e6('0x4d')]['id']}})['then'](function(_0x58b9cb){return db[_0xf6e6('0x6e')][_0xf6e6('0x6f')](function(_0x388fbd){return _0x58b9cb['addTeams'](_0x2d6143,{'transaction':_0x388fbd})[_0xf6e6('0x29')](function(){return BPromise[_0xf6e6('0x70')](_0x82484c,function(_0x23aee5){return db[_0xf6e6('0x5b')]['findOrCreate']({'where':{'UserId':_0x23aee5['id'],'OpenchannelQueueId':_0x220ff0['params']['id']},'transaction':_0x388fbd});});})[_0xf6e6('0x29')](function(){_0x82484c['forEach'](function(_0x258329){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x258329['id'],'OpenchannelQueueId':_0x58b9cb['id']});});});});});}})[_0xf6e6('0x29')](respondWithStatusCode(_0x280ab6,null))[_0xf6e6('0x4b')](handleError(_0x280ab6,null));};exports[_0xf6e6('0x71')]=function(_0x164a3a,_0xce3241,_0x210468){return db[_0xf6e6('0x67')][_0xf6e6('0x49')]({'where':{'id':_0x164a3a[_0xf6e6('0x38')][_0xf6e6('0x69')]},'attributes':['id'],'include':[{'model':db[_0xf6e6('0x5d')],'as':_0xf6e6('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xf6e6('0x29')](handleEntityNotFound(_0xce3241,null))['then'](function(_0x5295e5){var _0x411233=_[_0xf6e6('0x31')](_0x5295e5,'id');var _0x2761de=[];var _0x5540d8=[];var _0x4b760e=squel['select']();_0x4b760e[_0xf6e6('0x72')](_0xf6e6('0x73'))[_0xf6e6('0x74')]('team_has_openchannel_queues','tq')[_0xf6e6('0x75')](_0xf6e6('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf6e6('0x43')](_0xf6e6('0x77'),_0x164a3a[_0xf6e6('0x4d')]['id']);for(var _0x1a5a1c=0x0;_0x1a5a1c<_0x5295e5['length'];_0x1a5a1c+=0x1){let _0x43921b=_0x5295e5[_0x1a5a1c];for(var _0x23e807=0x0;_0x23e807<_0x43921b[_0xf6e6('0x6a')][_0xf6e6('0x3e')];_0x23e807+=0x1){let _0xcf3a83=_0x43921b['Agents'][_0x23e807];var _0x25642d=_0x4b760e[_0xf6e6('0x78')]();_0x25642d[_0xf6e6('0x43')](_0xf6e6('0x79'),_0xcf3a83['id']);_0x5540d8[_0xf6e6('0x7a')](db['sequelize'][_0xf6e6('0x38')](_0x25642d[_0xf6e6('0x7b')](),{'type':db['sequelize'][_0xf6e6('0x7c')][_0xf6e6('0x7d')]})[_0xf6e6('0x29')](function(_0x4c1ae2){if(_0x4c1ae2[_0xf6e6('0x3e')]===0x1){return _0xcf3a83['id'];}else{var _0xae6f44=_[_0xf6e6('0x7e')](_[_0xf6e6('0x31')](_0x4c1ae2,'TeamId'),function(_0x23a69e){return _[_0xf6e6('0x7f')](_0x411233,_0x23a69e);});if(_0xae6f44){return _0xcf3a83['id'];}}}));}}return BPromise['all'](_0x5540d8)[_0xf6e6('0x29')](function(_0x5c9aef){_0x2761de=_(_0x2761de)['union'](_0x5c9aef)[_0xf6e6('0x80')]()['value']();return db[_0xf6e6('0x32')][_0xf6e6('0x4e')]({'where':{'id':_0x164a3a[_0xf6e6('0x4d')]['id']}})[_0xf6e6('0x29')](function(_0x326864){return db[_0xf6e6('0x6e')][_0xf6e6('0x6f')](function(_0x2f7736){return _0x326864[_0xf6e6('0x71')](_0x164a3a[_0xf6e6('0x38')][_0xf6e6('0x69')],{'transaction':_0x2f7736})[_0xf6e6('0x29')](function(){if(!_['isEmpty'](_0x2761de)){return _0x326864[_0xf6e6('0x81')](_0x2761de,{'transaction':_0x2f7736});}})['then'](function(){_0x2761de[_0xf6e6('0x82')](function(_0x3a128e){socket[_0xf6e6('0x83')](_0xf6e6('0x84'),{'UserId':_0x3a128e,'OpenchannelQueueId':_0x326864['id']});});});});});});})[_0xf6e6('0x29')](respondWithStatusCode(_0xce3241,null))[_0xf6e6('0x4b')](handleError(_0xce3241,null));};exports[_0xf6e6('0x85')]=function(_0x6d2c87,_0x2f4230,_0x582d9b){return db[_0xf6e6('0x32')]['find']({'where':{'id':_0x6d2c87['params']['id']}})[_0xf6e6('0x29')](handleEntityNotFound(_0x2f4230,null))['then'](function(_0x182a16){if(_0x182a16){return _0x182a16['addAgents'](_0x6d2c87[_0xf6e6('0x50')][_0xf6e6('0x69')],_[_0xf6e6('0x86')](_0x6d2c87[_0xf6e6('0x50')],['ids','id'])||{})[_0xf6e6('0x87')](function(_0x4a8c8f){for(var _0x5a6a95=0x0;_0x5a6a95<_0x6d2c87[_0xf6e6('0x50')][_0xf6e6('0x69')][_0xf6e6('0x3e')];_0x5a6a95+=0x1){socket[_0xf6e6('0x83')](_0xf6e6('0x88'),{'UserId':_0x6d2c87[_0xf6e6('0x50')][_0xf6e6('0x69')][_0x5a6a95],'OpenchannelQueueId':_0x6d2c87[_0xf6e6('0x4d')]['id']});}return _0x4a8c8f;});}})[_0xf6e6('0x29')](respondWithResult(_0x2f4230,null))[_0xf6e6('0x4b')](handleError(_0x2f4230,null));};exports['removeAgents']=function(_0x9d7e51,_0x4e20ec,_0x2e1362){return db[_0xf6e6('0x32')][_0xf6e6('0x4e')]({'where':{'id':_0x9d7e51[_0xf6e6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e20ec,null))[_0xf6e6('0x29')](function(_0x6a976f){if(_0x6a976f){return _0x6a976f[_0xf6e6('0x81')](_0x9d7e51[_0xf6e6('0x38')]['ids'])[_0xf6e6('0x29')](function(){if(_[_0xf6e6('0x89')](_0x9d7e51['query'][_0xf6e6('0x69')])){for(var _0x5d111f=0x0;_0x5d111f<_0x9d7e51[_0xf6e6('0x38')][_0xf6e6('0x69')]['length'];_0x5d111f+=0x1){socket[_0xf6e6('0x83')](_0xf6e6('0x84'),{'UserId':Number(_0x9d7e51[_0xf6e6('0x38')]['ids'][_0x5d111f]),'OpenchannelQueueId':Number(_0x9d7e51[_0xf6e6('0x4d')]['id'])});}}else{socket[_0xf6e6('0x83')](_0xf6e6('0x84'),{'UserId':Number(_0x9d7e51[_0xf6e6('0x38')][_0xf6e6('0x69')]),'OpenchannelQueueId':Number(_0x9d7e51[_0xf6e6('0x4d')]['id'])});}});}})[_0xf6e6('0x29')](respondWithStatusCode(_0x4e20ec,null))[_0xf6e6('0x4b')](handleError(_0x4e20ec,null));};exports[_0xf6e6('0x8a')]=function(_0x2dd515,_0x48e114,_0xf517c){var _0x1cc447={};var _0x149a98={};var _0x1e7d42;var _0x2323d1;return db[_0xf6e6('0x32')][_0xf6e6('0x5a')]({'where':{'id':_0x2dd515[_0xf6e6('0x4d')]['id']}})[_0xf6e6('0x29')](handleEntityNotFound(_0x48e114,null))[_0xf6e6('0x29')](function(_0x234ca3){if(_0x234ca3){_0x1e7d42=_0x234ca3;_0x149a98[_0xf6e6('0x37')]=_['keys'](db[_0xf6e6('0x5d')][_0xf6e6('0x33')]);_0x149a98[_0xf6e6('0x38')]=_[_0xf6e6('0x39')](_0x2dd515[_0xf6e6('0x38')]);_0x149a98[_0xf6e6('0x3a')]=_[_0xf6e6('0x3c')](_0x149a98[_0xf6e6('0x37')],_0x149a98[_0xf6e6('0x38')]);_0x1cc447[_0xf6e6('0x3b')]=_[_0xf6e6('0x3c')](_0x149a98[_0xf6e6('0x37')],qs[_0xf6e6('0x3d')](_0x2dd515['query'][_0xf6e6('0x3d')]));_0x1cc447[_0xf6e6('0x3b')]=_0x1cc447['attributes'][_0xf6e6('0x3e')]?_0x1cc447['attributes']:_0x149a98[_0xf6e6('0x37')];_0x1cc447[_0xf6e6('0x40')]=qs[_0xf6e6('0x41')](_0x2dd515[_0xf6e6('0x38')][_0xf6e6('0x41')]);_0x1cc447[_0xf6e6('0x43')]=qs['filters'](_[_0xf6e6('0x42')](_0x2dd515[_0xf6e6('0x38')],_0x149a98['filters']));if(_0x2dd515[_0xf6e6('0x38')]['filter']){_0x1cc447['where']=_[_0xf6e6('0x44')](_0x1cc447[_0xf6e6('0x43')],{'$or':_[_0xf6e6('0x31')](_0x1cc447[_0xf6e6('0x3b')],function(_0x170ae8){var _0x1c2941={};_0x1c2941[_0x170ae8]={'$like':'%'+_0x2dd515[_0xf6e6('0x38')]['filter']+'%'};return _0x1c2941;})});}_0x1cc447=_[_0xf6e6('0x44')]({},_0x1cc447,_0x2dd515['options']);return _0x1e7d42['getAgents'](_0x1cc447);}})[_0xf6e6('0x29')](function(_0x2a6661){if(_0x2a6661){_0x2323d1=_0x2a6661[_0xf6e6('0x3e')];if(!_0x2dd515[_0xf6e6('0x38')][_0xf6e6('0x5c')](_0xf6e6('0x3f'))){_0x1cc447[_0xf6e6('0x22')]=qs[_0xf6e6('0x22')](_0x2dd515[_0xf6e6('0x38')][_0xf6e6('0x22')]);_0x1cc447[_0xf6e6('0x21')]=qs['offset'](_0x2dd515[_0xf6e6('0x38')][_0xf6e6('0x21')]);}return _0x1e7d42['getAgents'](_0x1cc447);}})[_0xf6e6('0x29')](function(_0x3dafaf){if(_0x3dafaf){return _0x3dafaf?{'count':_0x2323d1,'rows':_0x3dafaf}:null;}})[_0xf6e6('0x29')](respondWithResult(_0x48e114,null))['catch'](handleError(_0x48e114,null));}; \ No newline at end of file +var _0xd394=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','OpenchannelQueues','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','keys','query','filters','intersection','fields','attributes','length','order','sort','where','filter','VIRTUAL','merge','options','OpenchannelQueue','include','catch','show','params','includeAll','create','body','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserOpenchannelQueue','nolimit','pick','OpenchannelQueueId','findAll','User','UserId','agent','rows','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','ids','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','getAgents','hasOwnProperty','html-pdf','eml-format'];(function(_0x394272,_0x55d232){var _0x1df26a=function(_0xe916eb){while(--_0xe916eb){_0x394272['push'](_0x394272['shift']());}};_0x1df26a(++_0x55d232);}(_0xd394,0x118));var _0x4d39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd394[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x4d39('0x0'));var emlformat=require(_0x4d39('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4d39('0x2'));var jsonpatch=require(_0x4d39('0x3'));var rp=require(_0x4d39('0x4'));var moment=require(_0x4d39('0x5'));var BPromise=require(_0x4d39('0x6'));var Mustache=require(_0x4d39('0x7'));var util=require(_0x4d39('0x8'));var path=require(_0x4d39('0x9'));var sox=require(_0x4d39('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x4d39('0xb'));var squel=require('squel');var crypto=require(_0x4d39('0xc'));var jsforce=require(_0x4d39('0xd'));var deskjs=require(_0x4d39('0xe'));var toCsv=require(_0x4d39('0xf'));var querystring=require('querystring');var Papa=require(_0x4d39('0x10'));var Redis=require(_0x4d39('0x11'));var authService=require(_0x4d39('0x12'));var qs=require(_0x4d39('0x13'));var as=require(_0x4d39('0x14'));var hardwareService=require(_0x4d39('0x15'));var logger=require(_0x4d39('0x16'))('api');var utils=require(_0x4d39('0x17'));var config=require(_0x4d39('0x18'));var db=require(_0x4d39('0x19'))['db'];config[_0x4d39('0x1a')]=_[_0x4d39('0x1b')](config[_0x4d39('0x1a')],{'host':_0x4d39('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d39('0x1a')]));require(_0x4d39('0x1d'))[_0x4d39('0x1e')](socket);function respondWithStatusCode(_0x2119c5,_0x15abe3){_0x15abe3=_0x15abe3||0xcc;return function(_0x1f1e06){if(_0x1f1e06){return _0x2119c5[_0x4d39('0x1f')](_0x15abe3);}return _0x2119c5[_0x4d39('0x20')](_0x15abe3)[_0x4d39('0x21')]();};}function respondWithResult(_0x1aa4b8,_0x2c6018){_0x2c6018=_0x2c6018||0xc8;return function(_0x35edaf){if(_0x35edaf){return _0x1aa4b8[_0x4d39('0x20')](_0x2c6018)[_0x4d39('0x22')](_0x35edaf);}};}function respondWithFilteredResult(_0x3caa19,_0x4551f0){return function(_0xa101b7){if(_0xa101b7){var _0x578776=_0xa101b7[_0x4d39('0x23')],_0x10e718=_0x4551f0[_0x4d39('0x24')],_0x5f3e61=_0x4551f0[_0x4d39('0x24')]+_0x4551f0[_0x4d39('0x25')],_0x5aa9f3;if(_0x5f3e61>=_0x578776){_0x5f3e61=_0x578776;_0x5aa9f3=0xc8;}else{_0x5aa9f3=0xce;}_0x3caa19[_0x4d39('0x20')](_0x5aa9f3);return _0x3caa19['set'](_0x4d39('0x26'),_0x10e718+'-'+_0x5f3e61+'/'+_0x578776)[_0x4d39('0x22')](_0xa101b7);}return null;};}function patchUpdates(_0x3c769c){return function(_0x465ba){try{jsonpatch[_0x4d39('0x27')](_0x465ba,_0x3c769c,!![]);}catch(_0x36226a){return BPromise['reject'](_0x36226a);}return _0x465ba[_0x4d39('0x28')]();};}function saveUpdates(_0x38f2cb,_0x1620d3){return function(_0x4d18d2){if(_0x4d18d2){return _0x4d18d2[_0x4d39('0x29')](_0x38f2cb)[_0x4d39('0x2a')](function(_0xf12086){return _0xf12086;});}return null;};}function removeEntity(_0x271357,_0x3db14a){return function(_0x3dfc49){if(_0x3dfc49){return _0x3dfc49[_0x4d39('0x2b')]()[_0x4d39('0x2a')](function(){var _0x470a84=_0x3dfc49[_0x4d39('0x2c')]({'plain':!![]});var _0x34a0e3=_0x4d39('0x2d');return db[_0x4d39('0x2e')][_0x4d39('0x2b')]({'where':{'type':_0x34a0e3,'resourceId':_0x470a84['id']}})['then'](function(){return _0x3dfc49;});})[_0x4d39('0x2a')](function(){_0x271357['status'](0xcc)[_0x4d39('0x21')]();});}};}function handleEntityNotFound(_0xc17d41,_0x521bb3){return function(_0x570e4e){if(!_0x570e4e){_0xc17d41[_0x4d39('0x1f')](0x194);}return _0x570e4e;};}function handleError(_0x36d8c6,_0x1ef403){_0x1ef403=_0x1ef403||0x1f4;return function(_0x694a4d){logger['error'](_0x694a4d[_0x4d39('0x2f')]);if(_0x694a4d['name']){delete _0x694a4d['name'];}_0x36d8c6['status'](_0x1ef403)[_0x4d39('0x30')](_0x694a4d);};}exports[_0x4d39('0x31')]=function(_0x276c9b,_0x471f16){var _0xc66e93={},_0x1c46dc={},_0x3e0c16={'count':0x0,'rows':[]};var _0x59028e=_['map'](db['OpenchannelQueue'][_0x4d39('0x32')],function(_0x5af27a){return{'name':_0x5af27a[_0x4d39('0x33')],'type':_0x5af27a[_0x4d39('0x34')]['key']};});_0x1c46dc[_0x4d39('0x35')]=_[_0x4d39('0x36')](_0x59028e,_0x4d39('0x37'));_0x1c46dc['query']=_[_0x4d39('0x38')](_0x276c9b[_0x4d39('0x39')]);_0x1c46dc[_0x4d39('0x3a')]=_[_0x4d39('0x3b')](_0x1c46dc[_0x4d39('0x35')],_0x1c46dc[_0x4d39('0x39')]);_0xc66e93['attributes']=_[_0x4d39('0x3b')](_0x1c46dc[_0x4d39('0x35')],qs[_0x4d39('0x3c')](_0x276c9b[_0x4d39('0x39')][_0x4d39('0x3c')]));_0xc66e93['attributes']=_0xc66e93[_0x4d39('0x3d')][_0x4d39('0x3e')]?_0xc66e93[_0x4d39('0x3d')]:_0x1c46dc[_0x4d39('0x35')];if(!_0x276c9b['query']['hasOwnProperty']('nolimit')){_0xc66e93[_0x4d39('0x25')]=qs[_0x4d39('0x25')](_0x276c9b[_0x4d39('0x39')][_0x4d39('0x25')]);_0xc66e93[_0x4d39('0x24')]=qs['offset'](_0x276c9b['query'][_0x4d39('0x24')]);}_0xc66e93[_0x4d39('0x3f')]=qs['sort'](_0x276c9b['query'][_0x4d39('0x40')]);_0xc66e93[_0x4d39('0x41')]=qs['filters'](_['pick'](_0x276c9b[_0x4d39('0x39')],_0x1c46dc['filters']),_0x59028e);if(_0x276c9b[_0x4d39('0x39')][_0x4d39('0x42')]){_0xc66e93[_0x4d39('0x41')]=_['merge'](_0xc66e93[_0x4d39('0x41')],{'$or':_[_0x4d39('0x36')](_0x59028e,function(_0x5cd7a2){if(_0x5cd7a2[_0x4d39('0x34')]!==_0x4d39('0x43')){var _0x365d94={};_0x365d94[_0x5cd7a2[_0x4d39('0x37')]]={'$like':'%'+_0x276c9b['query'][_0x4d39('0x42')]+'%'};return _0x365d94;}})});}_0xc66e93=_[_0x4d39('0x44')]({},_0xc66e93,_0x276c9b[_0x4d39('0x45')]);var _0xc7f7f4={'where':_0xc66e93['where']};return db[_0x4d39('0x46')][_0x4d39('0x23')](_0xc7f7f4)['then'](function(_0x4f4676){_0x3e0c16['count']=_0x4f4676;if(_0x276c9b['query']['includeAll']){_0xc66e93[_0x4d39('0x47')]=[{'all':!![]}];}return db[_0x4d39('0x46')]['findAll'](_0xc66e93);})['then'](function(_0xb9a45a){_0x3e0c16['rows']=_0xb9a45a;return _0x3e0c16;})[_0x4d39('0x2a')](respondWithFilteredResult(_0x471f16,_0xc66e93))[_0x4d39('0x48')](handleError(_0x471f16,null));};exports[_0x4d39('0x49')]=function(_0x1e35c7,_0x43b2cc){var _0x174250={'raw':!![],'where':{'id':_0x1e35c7[_0x4d39('0x4a')]['id']}},_0x2535c8={};_0x2535c8[_0x4d39('0x35')]=_[_0x4d39('0x38')](db[_0x4d39('0x46')][_0x4d39('0x32')]);_0x2535c8[_0x4d39('0x39')]=_['keys'](_0x1e35c7[_0x4d39('0x39')]);_0x2535c8[_0x4d39('0x3a')]=_[_0x4d39('0x3b')](_0x2535c8[_0x4d39('0x35')],_0x2535c8[_0x4d39('0x39')]);_0x174250[_0x4d39('0x3d')]=_[_0x4d39('0x3b')](_0x2535c8[_0x4d39('0x35')],qs['fields'](_0x1e35c7['query'][_0x4d39('0x3c')]));_0x174250['attributes']=_0x174250[_0x4d39('0x3d')][_0x4d39('0x3e')]?_0x174250['attributes']:_0x2535c8[_0x4d39('0x35')];if(_0x1e35c7[_0x4d39('0x39')][_0x4d39('0x4b')]){_0x174250[_0x4d39('0x47')]=[{'all':!![]}];}_0x174250=_[_0x4d39('0x44')]({},_0x174250,_0x1e35c7['options']);return db[_0x4d39('0x46')]['find'](_0x174250)[_0x4d39('0x2a')](handleEntityNotFound(_0x43b2cc,null))['then'](respondWithResult(_0x43b2cc,null))[_0x4d39('0x48')](handleError(_0x43b2cc,null));};exports['create']=function(_0x3af465,_0x1232a7){return db[_0x4d39('0x46')][_0x4d39('0x4c')](_0x3af465[_0x4d39('0x4d')],{})[_0x4d39('0x2a')](function(_0x44169a){var _0x3bd4b3=_0x3af465['user'][_0x4d39('0x2c')]({'plain':!![]});if(!_0x3bd4b3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bd4b3[_0x4d39('0x4e')]==='user'){var _0x121ae0=_0x44169a[_0x4d39('0x2c')]({'plain':!![]});var _0x22bfb9=_0x4d39('0x2d');return db[_0x4d39('0x4f')][_0x4d39('0x50')]({'where':{'name':_0x22bfb9,'userProfileId':_0x3bd4b3[_0x4d39('0x51')]},'raw':!![]})[_0x4d39('0x2a')](function(_0x4c03de){if(_0x4c03de&&_0x4c03de['autoAssociation']===0x0){return db[_0x4d39('0x2e')]['create']({'name':_0x121ae0[_0x4d39('0x37')],'resourceId':_0x121ae0['id'],'type':_0x4c03de[_0x4d39('0x37')],'sectionId':_0x4c03de['id']},{})[_0x4d39('0x2a')](function(){return _0x44169a;});}else{return _0x44169a;}})[_0x4d39('0x48')](function(_0x350b8a){logger['error'](_0x4d39('0x52'),_0x350b8a);throw _0x350b8a;});}return _0x44169a;})[_0x4d39('0x2a')](respondWithResult(_0x1232a7,0xc9))[_0x4d39('0x48')](handleError(_0x1232a7,null));};exports[_0x4d39('0x29')]=function(_0x250390,_0x2d443){if(_0x250390['body']['id']){delete _0x250390[_0x4d39('0x4d')]['id'];}return db[_0x4d39('0x46')][_0x4d39('0x50')]({'where':{'id':_0x250390[_0x4d39('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2d443,null))[_0x4d39('0x2a')](saveUpdates(_0x250390['body'],null))[_0x4d39('0x2a')](respondWithResult(_0x2d443,null))[_0x4d39('0x48')](handleError(_0x2d443,null));};exports['destroy']=function(_0x48fa97,_0x3541fa){return db[_0x4d39('0x46')][_0x4d39('0x50')]({'where':{'id':_0x48fa97['params']['id']}})[_0x4d39('0x2a')](handleEntityNotFound(_0x3541fa,null))[_0x4d39('0x2a')](removeEntity(_0x3541fa,null))[_0x4d39('0x48')](handleError(_0x3541fa,null));};exports[_0x4d39('0x53')]=function(_0x17714a,_0x4b9172){return db['OpenchannelQueue'][_0x4d39('0x53')]()[_0x4d39('0x2a')](respondWithResult(_0x4b9172,null))[_0x4d39('0x48')](handleError(_0x4b9172,null));};exports[_0x4d39('0x54')]=function(_0x231284,_0x512a41,_0x1d2f82){var _0x5902f3={'raw':!![],'where':{}},_0x1d3b90={},_0x19ac96;return db[_0x4d39('0x46')]['findOne']({'where':{'id':_0x231284[_0x4d39('0x4a')]['id']}})[_0x4d39('0x2a')](handleEntityNotFound(_0x512a41,null))[_0x4d39('0x2a')](function(_0x4267b0){if(_0x4267b0){_0x19ac96=_0x4267b0[_0x4d39('0x2c')]({'plain':!![]});_0x1d3b90['model']=_[_0x4d39('0x38')](db[_0x4d39('0x55')][_0x4d39('0x32')]);_0x1d3b90['query']=_[_0x4d39('0x38')](_0x231284['query']);_0x1d3b90['filters']=_[_0x4d39('0x3b')](_0x1d3b90[_0x4d39('0x35')],_0x1d3b90['query']);_0x5902f3[_0x4d39('0x3d')]=_['intersection'](_0x1d3b90[_0x4d39('0x35')],qs['fields'](_0x231284[_0x4d39('0x39')][_0x4d39('0x3c')]));_0x5902f3[_0x4d39('0x3d')]=_0x5902f3[_0x4d39('0x3d')]['length']?_0x5902f3[_0x4d39('0x3d')]:_0x1d3b90['model'];if(!_0x231284[_0x4d39('0x39')]['hasOwnProperty'](_0x4d39('0x56'))){_0x5902f3[_0x4d39('0x25')]=qs[_0x4d39('0x25')](_0x231284[_0x4d39('0x39')]['limit']);_0x5902f3[_0x4d39('0x24')]=qs['offset'](_0x231284[_0x4d39('0x39')]['offset']);}_0x5902f3[_0x4d39('0x3f')]=qs[_0x4d39('0x40')](_0x231284[_0x4d39('0x39')]['sort']);_0x5902f3[_0x4d39('0x41')]=qs[_0x4d39('0x3a')](_[_0x4d39('0x57')](_0x231284[_0x4d39('0x39')],_0x1d3b90[_0x4d39('0x3a')]));_0x5902f3[_0x4d39('0x41')][_0x4d39('0x58')]=_0x4267b0['id'];if(_0x231284[_0x4d39('0x39')][_0x4d39('0x42')]){_0x5902f3['where']=_[_0x4d39('0x44')](_0x5902f3['where'],{'$or':_['map'](_0x5902f3[_0x4d39('0x3d')],function(_0x1c34ad){var _0x499f68={};_0x499f68[_0x1c34ad]={'$like':'%'+_0x231284[_0x4d39('0x39')][_0x4d39('0x42')]+'%'};return _0x499f68;})});}_0x5902f3=_[_0x4d39('0x44')]({},_0x5902f3,_0x231284['options']);return db['UserOpenchannelQueue'][_0x4d39('0x59')](_0x5902f3);}})[_0x4d39('0x2a')](function(_0x3fcecb){if(_0x3fcecb){return db[_0x4d39('0x5a')]['findAndCountAll']({'where':{'id':_[_0x4d39('0x36')](_0x3fcecb,_0x4d39('0x5b')),'role':_0x4d39('0x5c')},'attributes':['id',_0x4d39('0x37'),'openchannelPause','updatedAt','createdAt']});}})[_0x4d39('0x2a')](function(_0x18470b){if(_0x18470b){return{'count':_0x18470b[_0x4d39('0x23')],'rows':_[_0x4d39('0x36')](_0x18470b[_0x4d39('0x5d')],function(_0xac5c14){return{'membername':_0xac5c14['name'],'UserId':_0xac5c14['id'],'queue_name':_0x19ac96['name'],'OpenchannelQueueId':_0x19ac96['id'],'interface':util[_0x4d39('0x5e')](_0x4d39('0x5f'),_0x4d39('0x60'),_0xac5c14[_0x4d39('0x37')]),'penalty':0x0,'paused':_0xac5c14['openchannelPause'],'createdAt':_0xac5c14['createdAt'],'updatedAt':_0xac5c14['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x512a41,_0x5902f3))[_0x4d39('0x48')](handleError(_0x512a41,null));};exports[_0x4d39('0x61')]=function(_0x2dde58,_0x50272d,_0x56073e){var _0x4ede0a={};var _0x45d1a4={};var _0x43d2a0;var _0x3c78cb;return db[_0x4d39('0x46')][_0x4d39('0x62')]({'where':{'id':_0x2dde58[_0x4d39('0x4a')]['id']}})['then'](handleEntityNotFound(_0x50272d,null))['then'](function(_0x395809){if(_0x395809){_0x43d2a0=_0x395809;_0x45d1a4['model']=_[_0x4d39('0x38')](db[_0x4d39('0x63')][_0x4d39('0x32')]);_0x45d1a4[_0x4d39('0x39')]=_[_0x4d39('0x38')](_0x2dde58[_0x4d39('0x39')]);_0x45d1a4[_0x4d39('0x3a')]=_[_0x4d39('0x3b')](_0x45d1a4[_0x4d39('0x35')],_0x45d1a4['query']);_0x4ede0a['attributes']=_[_0x4d39('0x3b')](_0x45d1a4['model'],qs['fields'](_0x2dde58['query'][_0x4d39('0x3c')]));_0x4ede0a[_0x4d39('0x3d')]=_0x4ede0a[_0x4d39('0x3d')][_0x4d39('0x3e')]?_0x4ede0a[_0x4d39('0x3d')]:_0x45d1a4[_0x4d39('0x35')];_0x4ede0a[_0x4d39('0x3f')]=qs[_0x4d39('0x40')](_0x2dde58[_0x4d39('0x39')]['sort']);_0x4ede0a[_0x4d39('0x41')]=qs[_0x4d39('0x3a')](_[_0x4d39('0x57')](_0x2dde58[_0x4d39('0x39')],_0x45d1a4[_0x4d39('0x3a')]));if(_0x2dde58[_0x4d39('0x39')]['filter']){_0x4ede0a['where']=_['merge'](_0x4ede0a[_0x4d39('0x41')],{'$or':_[_0x4d39('0x36')](_0x4ede0a['attributes'],function(_0x241396){var _0x173ada={};_0x173ada[_0x241396]={'$like':'%'+_0x2dde58[_0x4d39('0x39')][_0x4d39('0x42')]+'%'};return _0x173ada;})});}_0x4ede0a=_['merge']({},_0x4ede0a,_0x2dde58[_0x4d39('0x45')]);return _0x43d2a0[_0x4d39('0x61')](_0x4ede0a);}})[_0x4d39('0x2a')](function(_0x3b53ef){if(_0x3b53ef){_0x3c78cb=_0x3b53ef[_0x4d39('0x3e')];if(!_0x2dde58[_0x4d39('0x39')]['hasOwnProperty'](_0x4d39('0x56'))){_0x4ede0a[_0x4d39('0x25')]=qs[_0x4d39('0x25')](_0x2dde58[_0x4d39('0x39')][_0x4d39('0x25')]);_0x4ede0a['offset']=qs[_0x4d39('0x24')](_0x2dde58['query'][_0x4d39('0x24')]);}return _0x43d2a0[_0x4d39('0x61')](_0x4ede0a);}})['then'](function(_0x460325){if(_0x460325){return _0x460325?{'count':_0x3c78cb,'rows':_0x460325}:null;}})['then'](respondWithResult(_0x50272d,null))[_0x4d39('0x48')](handleError(_0x50272d,null));};exports[_0x4d39('0x64')]=function(_0x219071,_0x34d292,_0x332389){var _0x52232f=_0x219071['body']['ids'];return db['Team'][_0x4d39('0x59')]({'where':{'id':_0x52232f},'attributes':['id'],'include':[{'model':db[_0x4d39('0x5a')],'as':_0x4d39('0x65'),'attributes':['id',_0x4d39('0x37'),_0x4d39('0x66'),_0x4d39('0x67'),_0x4d39('0x68')],'raw':!![]}]})['then'](function(_0x3a41b8){if(_0x3a41b8){var _0x1f17fb=_['flatMap'](_0x3a41b8,function(_0x57d656){var _0x58a4c3=_0x57d656[_0x4d39('0x2c')]({'plain':!![]});return _0x58a4c3[_0x4d39('0x65')];});return db['OpenchannelQueue'][_0x4d39('0x50')]({'where':{'id':_0x219071[_0x4d39('0x4a')]['id']}})[_0x4d39('0x2a')](function(_0x226c01){return db['sequelize'][_0x4d39('0x69')](function(_0x180653){return _0x226c01['addTeams'](_0x52232f,{'transaction':_0x180653})[_0x4d39('0x2a')](function(){return BPromise[_0x4d39('0x6a')](_0x1f17fb,function(_0x5adbde){return db['UserOpenchannelQueue'][_0x4d39('0x6b')]({'where':{'UserId':_0x5adbde['id'],'OpenchannelQueueId':_0x219071[_0x4d39('0x4a')]['id']},'transaction':_0x180653});});})[_0x4d39('0x2a')](function(){_0x1f17fb[_0x4d39('0x6c')](function(_0x566975){socket['emit']('userOpenchannelQueue:save',{'UserId':_0x566975['id'],'OpenchannelQueueId':_0x226c01['id']});});});});});}})[_0x4d39('0x2a')](respondWithStatusCode(_0x34d292,null))[_0x4d39('0x48')](handleError(_0x34d292,null));};exports[_0x4d39('0x6d')]=function(_0x2dc6ce,_0x37d63b,_0x358bb7){return db[_0x4d39('0x63')][_0x4d39('0x59')]({'where':{'id':_0x2dc6ce[_0x4d39('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4d39('0x5a')],'as':_0x4d39('0x65'),'attributes':['id'],'raw':!![]}]})[_0x4d39('0x2a')](handleEntityNotFound(_0x37d63b,null))[_0x4d39('0x2a')](function(_0x37174d){var _0x3418b9=_[_0x4d39('0x36')](_0x37174d,'id');var _0x446345=[];var _0x19335e=[];var _0x35f8ce=squel[_0x4d39('0x6e')]();_0x35f8ce[_0x4d39('0x6f')](_0x4d39('0x70'))[_0x4d39('0x71')](_0x4d39('0x72'),'tq')[_0x4d39('0x73')](_0x4d39('0x74'),'ut',_0x4d39('0x75'))['where'](_0x4d39('0x76'),_0x2dc6ce['params']['id']);for(var _0x246db0=0x0;_0x246db0<_0x37174d[_0x4d39('0x3e')];_0x246db0+=0x1){let _0x30e079=_0x37174d[_0x246db0];for(var _0x59bafa=0x0;_0x59bafa<_0x30e079[_0x4d39('0x65')]['length'];_0x59bafa+=0x1){let _0xedd7ae=_0x30e079[_0x4d39('0x65')][_0x59bafa];var _0xaea925=_0x35f8ce[_0x4d39('0x77')]();_0xaea925['where'](_0x4d39('0x78'),_0xedd7ae['id']);_0x19335e[_0x4d39('0x79')](db[_0x4d39('0x7a')][_0x4d39('0x39')](_0xaea925[_0x4d39('0x7b')](),{'type':db['sequelize'][_0x4d39('0x7c')][_0x4d39('0x7d')]})[_0x4d39('0x2a')](function(_0x17472b){if(_0x17472b['length']===0x1){return _0xedd7ae['id'];}else{var _0x1e732b=_['every'](_['map'](_0x17472b,_0x4d39('0x7e')),function(_0x554593){return _[_0x4d39('0x7f')](_0x3418b9,_0x554593);});if(_0x1e732b){return _0xedd7ae['id'];}}}));}}return BPromise['all'](_0x19335e)[_0x4d39('0x2a')](function(_0x269b8d){_0x446345=_(_0x446345)[_0x4d39('0x80')](_0x269b8d)[_0x4d39('0x81')]()[_0x4d39('0x82')]();return db[_0x4d39('0x46')][_0x4d39('0x50')]({'where':{'id':_0x2dc6ce[_0x4d39('0x4a')]['id']}})[_0x4d39('0x2a')](function(_0x2e6946){return db[_0x4d39('0x7a')][_0x4d39('0x69')](function(_0x5adc8b){return _0x2e6946['removeTeams'](_0x2dc6ce[_0x4d39('0x39')][_0x4d39('0x83')],{'transaction':_0x5adc8b})[_0x4d39('0x2a')](function(){if(!_[_0x4d39('0x84')](_0x446345)){return _0x2e6946[_0x4d39('0x85')](_0x446345,{'transaction':_0x5adc8b});}})[_0x4d39('0x2a')](function(){_0x446345[_0x4d39('0x6c')](function(_0x56713b){socket[_0x4d39('0x86')](_0x4d39('0x87'),{'UserId':_0x56713b,'OpenchannelQueueId':_0x2e6946['id']});});});});});});})[_0x4d39('0x2a')](respondWithStatusCode(_0x37d63b,null))[_0x4d39('0x48')](handleError(_0x37d63b,null));};exports[_0x4d39('0x88')]=function(_0x218759,_0x108e31,_0x3c46ae){return db['OpenchannelQueue'][_0x4d39('0x50')]({'where':{'id':_0x218759[_0x4d39('0x4a')]['id']}})['then'](handleEntityNotFound(_0x108e31,null))['then'](function(_0x91a31e){if(_0x91a31e){return _0x91a31e[_0x4d39('0x88')](_0x218759[_0x4d39('0x4d')][_0x4d39('0x83')],_[_0x4d39('0x89')](_0x218759[_0x4d39('0x4d')],[_0x4d39('0x83'),'id'])||{})['spread'](function(_0x130ed1){for(var _0x4fb3bf=0x0;_0x4fb3bf<_0x218759[_0x4d39('0x4d')][_0x4d39('0x83')][_0x4d39('0x3e')];_0x4fb3bf+=0x1){socket['emit'](_0x4d39('0x8a'),{'UserId':_0x218759[_0x4d39('0x4d')]['ids'][_0x4fb3bf],'OpenchannelQueueId':_0x218759[_0x4d39('0x4a')]['id']});}return _0x130ed1;});}})['then'](respondWithResult(_0x108e31,null))[_0x4d39('0x48')](handleError(_0x108e31,null));};exports['removeAgents']=function(_0x399543,_0x1f5e31,_0x4ecb83){return db[_0x4d39('0x46')][_0x4d39('0x50')]({'where':{'id':_0x399543[_0x4d39('0x4a')]['id']}})[_0x4d39('0x2a')](handleEntityNotFound(_0x1f5e31,null))[_0x4d39('0x2a')](function(_0xe5acc4){if(_0xe5acc4){return _0xe5acc4[_0x4d39('0x85')](_0x399543[_0x4d39('0x39')]['ids'])['then'](function(){if(_['isArray'](_0x399543[_0x4d39('0x39')][_0x4d39('0x83')])){for(var _0x3eb021=0x0;_0x3eb021<_0x399543[_0x4d39('0x39')][_0x4d39('0x83')]['length'];_0x3eb021+=0x1){socket[_0x4d39('0x86')]('userOpenchannelQueue:remove',{'UserId':Number(_0x399543[_0x4d39('0x39')][_0x4d39('0x83')][_0x3eb021]),'OpenchannelQueueId':Number(_0x399543[_0x4d39('0x4a')]['id'])});}}else{socket['emit'](_0x4d39('0x87'),{'UserId':Number(_0x399543[_0x4d39('0x39')]['ids']),'OpenchannelQueueId':Number(_0x399543['params']['id'])});}});}})[_0x4d39('0x2a')](respondWithStatusCode(_0x1f5e31,null))['catch'](handleError(_0x1f5e31,null));};exports[_0x4d39('0x8b')]=function(_0x5144bd,_0x11978c,_0x2faa36){var _0x1d2dc8={};var _0x331be0={};var _0x36b54c;var _0x1c3d95;return db[_0x4d39('0x46')][_0x4d39('0x62')]({'where':{'id':_0x5144bd['params']['id']}})[_0x4d39('0x2a')](handleEntityNotFound(_0x11978c,null))[_0x4d39('0x2a')](function(_0x1d8d9e){if(_0x1d8d9e){_0x36b54c=_0x1d8d9e;_0x331be0[_0x4d39('0x35')]=_['keys'](db[_0x4d39('0x5a')]['rawAttributes']);_0x331be0[_0x4d39('0x39')]=_[_0x4d39('0x38')](_0x5144bd[_0x4d39('0x39')]);_0x331be0[_0x4d39('0x3a')]=_[_0x4d39('0x3b')](_0x331be0[_0x4d39('0x35')],_0x331be0[_0x4d39('0x39')]);_0x1d2dc8[_0x4d39('0x3d')]=_[_0x4d39('0x3b')](_0x331be0[_0x4d39('0x35')],qs[_0x4d39('0x3c')](_0x5144bd['query'][_0x4d39('0x3c')]));_0x1d2dc8[_0x4d39('0x3d')]=_0x1d2dc8[_0x4d39('0x3d')]['length']?_0x1d2dc8[_0x4d39('0x3d')]:_0x331be0[_0x4d39('0x35')];_0x1d2dc8[_0x4d39('0x3f')]=qs[_0x4d39('0x40')](_0x5144bd['query'][_0x4d39('0x40')]);_0x1d2dc8[_0x4d39('0x41')]=qs[_0x4d39('0x3a')](_['pick'](_0x5144bd[_0x4d39('0x39')],_0x331be0[_0x4d39('0x3a')]));if(_0x5144bd[_0x4d39('0x39')]['filter']){_0x1d2dc8[_0x4d39('0x41')]=_[_0x4d39('0x44')](_0x1d2dc8[_0x4d39('0x41')],{'$or':_[_0x4d39('0x36')](_0x1d2dc8[_0x4d39('0x3d')],function(_0x5e5e79){var _0x64f3ec={};_0x64f3ec[_0x5e5e79]={'$like':'%'+_0x5144bd[_0x4d39('0x39')]['filter']+'%'};return _0x64f3ec;})});}_0x1d2dc8=_[_0x4d39('0x44')]({},_0x1d2dc8,_0x5144bd[_0x4d39('0x45')]);return _0x36b54c[_0x4d39('0x8b')](_0x1d2dc8);}})[_0x4d39('0x2a')](function(_0x39f896){if(_0x39f896){_0x1c3d95=_0x39f896[_0x4d39('0x3e')];if(!_0x5144bd['query'][_0x4d39('0x8c')](_0x4d39('0x56'))){_0x1d2dc8[_0x4d39('0x25')]=qs['limit'](_0x5144bd[_0x4d39('0x39')][_0x4d39('0x25')]);_0x1d2dc8[_0x4d39('0x24')]=qs[_0x4d39('0x24')](_0x5144bd['query']['offset']);}return _0x36b54c[_0x4d39('0x8b')](_0x1d2dc8);}})['then'](function(_0x2a5cb5){if(_0x2a5cb5){return _0x2a5cb5?{'count':_0x1c3d95,'rows':_0x2a5cb5}:null;}})['then'](respondWithResult(_0x11978c,null))[_0x4d39('0x48')](handleError(_0x11978c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index a01e022..ffa211b 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 _0xf7fc=['hook','exports','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xf7fc,0x12a));var _0xcf7f=function(_0x5159d7,_0x24afba){_0x5159d7=_0x5159d7-0x0;var _0xf5cec1=_0xf7fc[_0x5159d7];return _0xf5cec1;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0xcf7f('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xcf7f('0x1')](0x0);var events={'afterCreate':_0xcf7f('0x2'),'afterUpdate':'update','afterDestroy':_0xcf7f('0x3')};function emitEvent(_0x31b0b8){return function(_0x3836a5,_0x56c9a0,_0x370913){OpenchannelQueueEvents[_0xcf7f('0x4')](_0x31b0b8+':'+_0x3836a5['id'],_0x3836a5);OpenchannelQueueEvents[_0xcf7f('0x4')](_0x31b0b8,_0x3836a5);_0x370913(null);};}for(var e in events){if(events[_0xcf7f('0x5')](e)){var event=events[e];OpenchannelQueue[_0xcf7f('0x6')](e,emitEvent(event));}}module[_0xcf7f('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xc753=['emit','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove'];(function(_0x2b13ab,_0x3e916f){var _0x1c96ce=function(_0x17e515){while(--_0x17e515){_0x2b13ab['push'](_0x2b13ab['shift']());}};_0x1c96ce(++_0x3e916f);}(_0xc753,0xd5));var _0x3c75=function(_0x35ace4,_0x3e2a5a){_0x35ace4=_0x35ace4-0x0;var _0x1dd6a0=_0xc753[_0x35ace4];return _0x1dd6a0;};'use strict';var EventEmitter=require(_0x3c75('0x0'));var OpenchannelQueue=require(_0x3c75('0x1'))['db'][_0x3c75('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3c75('0x3')](0x0);var events={'afterCreate':_0x3c75('0x4'),'afterUpdate':_0x3c75('0x5'),'afterDestroy':_0x3c75('0x6')};function emitEvent(_0x4c7933){return function(_0x41ecf1,_0x34ce4d,_0x5d2228){OpenchannelQueueEvents[_0x3c75('0x7')](_0x4c7933+':'+_0x41ecf1['id'],_0x41ecf1);OpenchannelQueueEvents[_0x3c75('0x7')](_0x4c7933,_0x41ecf1);_0x5d2228(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x3c75('0x8')](e,emitEvent(event));}}module[_0x3c75('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 4a2dff4..26886a8 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 _0x53dd=['path','rimraf','../../config/environment','exports','define','OpenchannelQueue','openchannel_queues','api','moment','bluebird','request-promise'];(function(_0x4a28e5,_0x478883){var _0x37b10f=function(_0x42f33f){while(--_0x42f33f){_0x4a28e5['push'](_0x4a28e5['shift']());}};_0x37b10f(++_0x478883);}(_0x53dd,0x10f));var _0xd53d=function(_0x1e86bb,_0x38220f){_0x1e86bb=_0x1e86bb-0x0;var _0x2d781e=_0x53dd[_0x1e86bb];return _0x2d781e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd53d('0x0'));var moment=require(_0xd53d('0x1'));var BPromise=require(_0xd53d('0x2'));var rp=require(_0xd53d('0x3'));var fs=require('fs');var path=require(_0xd53d('0x4'));var rimraf=require(_0xd53d('0x5'));var config=require(_0xd53d('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0xd53d('0x7')]=function(_0x2c247e,_0x2fdcdb){return _0x2c247e[_0xd53d('0x8')](_0xd53d('0x9'),attributes,{'tableName':_0xd53d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7709=['../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','util','../../config/logger','bluebird','rimraf'];(function(_0x3d8995,_0x5f4f4b){var _0x5dd8ed=function(_0x55e159){while(--_0x55e159){_0x3d8995['push'](_0x3d8995['shift']());}};_0x5dd8ed(++_0x5f4f4b);}(_0x7709,0xb0));var _0x9770=function(_0x243f09,_0x3b37a2){_0x243f09=_0x243f09-0x0;var _0x1fb8f3=_0x7709[_0x243f09];return _0x1fb8f3;};'use strict';var _=require('lodash');var util=require(_0x9770('0x0'));var logger=require(_0x9770('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9770('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9770('0x3'));var config=require(_0x9770('0x4'));var attributes=require(_0x9770('0x5'));module['exports']=function(_0x480b83,_0x4098dd){return _0x480b83[_0x9770('0x6')](_0x9770('0x7'),attributes,{'tableName':_0x9770('0x8'),'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 8932b46..352e142 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 _0xabb4=['localhost','./openchannelQueue.socket','register','request','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueue,\x20%s,\x20%s','catch','GetOpenchannelQueue','findAll','options','where','attributes','limit','include','map','model','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x4ce85b,_0x48a3a8){var _0x113d86=function(_0x2c8d42){while(--_0x2c8d42){_0x4ce85b['push'](_0x4ce85b['shift']());}};_0x113d86(++_0x48a3a8);}(_0xabb4,0xff));var _0x4abb=function(_0x6e8ac2,_0x2be4a7){_0x6e8ac2=_0x6e8ac2-0x0;var _0x33bf19=_0xabb4[_0x6e8ac2];return _0x33bf19;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4abb('0x0'));var BPromise=require(_0x4abb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4abb('0x2'));var db=require(_0x4abb('0x3'))['db'];var utils=require(_0x4abb('0x4'));var logger=require('../../config/logger')(_0x4abb('0x5'));var config=require(_0x4abb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4abb('0x7')][_0x4abb('0x8')]({'port':0x232a});config['redis']=_[_0x4abb('0x9')](config[_0x4abb('0xa')],{'host':_0x4abb('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4abb('0xa')]));require(_0x4abb('0xc'))[_0x4abb('0xd')](socket);function respondWithRpcPromise(_0x5b2708,_0x426c4b,_0x1a0f1d){return new BPromise(function(_0x1eeae7,_0x1b8398){return client[_0x4abb('0xe')](_0x5b2708,_0x1a0f1d)[_0x4abb('0xf')](function(_0x14fcc2){logger[_0x4abb('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x426c4b,_0x4abb('0x11'));logger[_0x4abb('0x12')](_0x4abb('0x13'),_0x426c4b,'request\x20sent',JSON['stringify'](_0x14fcc2));if(_0x14fcc2[_0x4abb('0x14')]){if(_0x14fcc2[_0x4abb('0x14')][_0x4abb('0x15')]===0x1f4){logger[_0x4abb('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x426c4b,_0x14fcc2[_0x4abb('0x14')][_0x4abb('0x16')]);return _0x1b8398(_0x14fcc2['error'][_0x4abb('0x16')]);}logger['error'](_0x4abb('0x17'),_0x426c4b,_0x14fcc2[_0x4abb('0x14')][_0x4abb('0x16')]);return _0x1eeae7(_0x14fcc2[_0x4abb('0x14')][_0x4abb('0x16')]);}else{logger[_0x4abb('0x10')](_0x4abb('0x17'),_0x426c4b,_0x4abb('0x11'));_0x1eeae7(_0x14fcc2['result'][_0x4abb('0x16')]);}})[_0x4abb('0x18')](function(_0x39f5d0){logger[_0x4abb('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x426c4b,_0x39f5d0);_0x1b8398(_0x39f5d0);});});}exports[_0x4abb('0x19')]=function(_0x49f199){var _0x3d2c8f=this;return new Promise(function(_0x3a769c,_0x1e7c49){return db['OpenchannelQueue'][_0x4abb('0x1a')]({'raw':_0x49f199[_0x4abb('0x1b')]?_0x49f199['options']['raw']===undefined?!![]:![]:!![],'where':_0x49f199[_0x4abb('0x1b')]?_0x49f199[_0x4abb('0x1b')][_0x4abb('0x1c')]||null:null,'attributes':_0x49f199['options']?_0x49f199[_0x4abb('0x1b')][_0x4abb('0x1d')]||null:null,'limit':_0x49f199[_0x4abb('0x1b')]?_0x49f199['options'][_0x4abb('0x1e')]||null:null,'include':_0x49f199[_0x4abb('0x1b')]?_0x49f199[_0x4abb('0x1b')][_0x4abb('0x1f')]?_[_0x4abb('0x20')](_0x49f199[_0x4abb('0x1b')][_0x4abb('0x1f')],function(_0x1b1790){return{'model':db[_0x1b1790[_0x4abb('0x21')]],'as':_0x1b1790['as'],'attributes':_0x1b1790['attributes'],'include':_0x1b1790[_0x4abb('0x1f')]?_[_0x4abb('0x20')](_0x1b1790[_0x4abb('0x1f')],function(_0x36d843){return{'model':db[_0x36d843[_0x4abb('0x21')]],'as':_0x36d843['as'],'attributes':_0x36d843[_0x4abb('0x1d')],'include':_0x36d843[_0x4abb('0x1f')]?_[_0x4abb('0x20')](_0x36d843['include'],function(_0x5e3427){return{'model':db[_0x5e3427[_0x4abb('0x21')]],'as':_0x5e3427['as'],'attributes':_0x5e3427[_0x4abb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4abb('0xf')](function(_0x5b19fe){logger['info'](_0x4abb('0x19'),_0x49f199);logger['debug'](_0x4abb('0x19'),_0x49f199,JSON[_0x4abb('0x22')](_0x5b19fe));_0x3a769c(_0x5b19fe);})[_0x4abb('0x18')](function(_0x26e939){logger[_0x4abb('0x14')](_0x4abb('0x19'),_0x26e939[_0x4abb('0x16')],_0x49f199);_0x1e7c49(_0x3d2c8f[_0x4abb('0x14')](0x1f4,_0x26e939['message']));});});};exports[_0x4abb('0x23')]=function(_0x3e6fae){var _0x472dcc=this;return new Promise(function(_0x3e2135,_0x51ba56){return db[_0x4abb('0x24')][_0x4abb('0x25')]({'raw':_0x3e6fae[_0x4abb('0x1b')]?_0x3e6fae[_0x4abb('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3e6fae['options']?_0x3e6fae[_0x4abb('0x1b')]['where']||null:null,'attributes':_0x3e6fae[_0x4abb('0x1b')]?_0x3e6fae['options'][_0x4abb('0x1d')]||null:null,'include':_0x3e6fae[_0x4abb('0x1b')]?_0x3e6fae[_0x4abb('0x1b')][_0x4abb('0x1f')]?_[_0x4abb('0x20')](_0x3e6fae['options']['include'],function(_0x1aa256){return{'model':db[_0x1aa256[_0x4abb('0x21')]],'as':_0x1aa256['as'],'attributes':_0x1aa256[_0x4abb('0x1d')],'include':_0x1aa256[_0x4abb('0x1f')]?_['map'](_0x1aa256['include'],function(_0x2d9132){return{'model':db[_0x2d9132[_0x4abb('0x21')]],'as':_0x2d9132['as'],'attributes':_0x2d9132[_0x4abb('0x1d')],'include':_0x2d9132['include']?_[_0x4abb('0x20')](_0x2d9132['include'],function(_0x133116){return{'model':db[_0x133116[_0x4abb('0x21')]],'as':_0x133116['as'],'attributes':_0x133116[_0x4abb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4abb('0xf')](function(_0x5920b5){logger['info'](_0x4abb('0x23'),_0x3e6fae);logger[_0x4abb('0x12')](_0x4abb('0x23'),_0x3e6fae,JSON[_0x4abb('0x22')](_0x5920b5));_0x3e2135(_0x5920b5);})[_0x4abb('0x18')](function(_0x6bec66){logger[_0x4abb('0x14')](_0x4abb('0x23'),_0x6bec66[_0x4abb('0x16')],_0x3e6fae);_0x51ba56(_0x472dcc[_0x4abb('0x14')](0x1f4,_0x6bec66[_0x4abb('0x16')]));});});}; \ No newline at end of file +var _0x2ff1=['http','redis','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','limit','include','map','model','attributes','where','ShowOpenchannelQueue','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ff1,0x13b));var _0x12ff=function(_0x399f3f,_0x520a9e){_0x399f3f=_0x399f3f-0x0;var _0x48d8c5=_0x2ff1[_0x399f3f];return _0x48d8c5;};'use strict';var _=require(_0x12ff('0x0'));var util=require(_0x12ff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12ff('0x2'));var db=require(_0x12ff('0x3'))['db'];var utils=require(_0x12ff('0x4'));var logger=require(_0x12ff('0x5'))(_0x12ff('0x6'));var config=require(_0x12ff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x12ff('0x8')][_0x12ff('0x9')]({'port':0x232a});config[_0x12ff('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x12ff('0xb')](socket);function respondWithRpcPromise(_0x9a5a42,_0x4648ad,_0x4f61ec){return new BPromise(function(_0x4005b8,_0xd0c714){return client[_0x12ff('0xc')](_0x9a5a42,_0x4f61ec)[_0x12ff('0xd')](function(_0xe089c2){logger[_0x12ff('0xe')](_0x12ff('0xf'),_0x4648ad,_0x12ff('0x10'));logger[_0x12ff('0x11')](_0x12ff('0x12'),_0x4648ad,_0x12ff('0x10'),JSON[_0x12ff('0x13')](_0xe089c2));if(_0xe089c2[_0x12ff('0x14')]){if(_0xe089c2[_0x12ff('0x14')]['code']===0x1f4){logger[_0x12ff('0x14')](_0x12ff('0xf'),_0x4648ad,_0xe089c2[_0x12ff('0x14')][_0x12ff('0x15')]);return _0xd0c714(_0xe089c2[_0x12ff('0x14')][_0x12ff('0x15')]);}logger[_0x12ff('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x4648ad,_0xe089c2[_0x12ff('0x14')][_0x12ff('0x15')]);return _0x4005b8(_0xe089c2[_0x12ff('0x14')][_0x12ff('0x15')]);}else{logger[_0x12ff('0xe')](_0x12ff('0xf'),_0x4648ad,'request\x20sent');_0x4005b8(_0xe089c2[_0x12ff('0x16')]['message']);}})[_0x12ff('0x17')](function(_0x4c160e){logger[_0x12ff('0x14')](_0x12ff('0xf'),_0x4648ad,_0x4c160e);_0xd0c714(_0x4c160e);});});}exports[_0x12ff('0x18')]=function(_0x1bef99){var _0xde7b3=this;return new Promise(function(_0xf859d5,_0x13ae88){return db[_0x12ff('0x19')][_0x12ff('0x1a')]({'raw':_0x1bef99[_0x12ff('0x1b')]?_0x1bef99['options'][_0x12ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x1bef99[_0x12ff('0x1b')]?_0x1bef99[_0x12ff('0x1b')]['where']||null:null,'attributes':_0x1bef99[_0x12ff('0x1b')]?_0x1bef99[_0x12ff('0x1b')]['attributes']||null:null,'limit':_0x1bef99['options']?_0x1bef99[_0x12ff('0x1b')][_0x12ff('0x1d')]||null:null,'include':_0x1bef99['options']?_0x1bef99['options'][_0x12ff('0x1e')]?_[_0x12ff('0x1f')](_0x1bef99['options'][_0x12ff('0x1e')],function(_0x162628){return{'model':db[_0x162628[_0x12ff('0x20')]],'as':_0x162628['as'],'attributes':_0x162628['attributes'],'include':_0x162628[_0x12ff('0x1e')]?_[_0x12ff('0x1f')](_0x162628[_0x12ff('0x1e')],function(_0x44b62c){return{'model':db[_0x44b62c['model']],'as':_0x44b62c['as'],'attributes':_0x44b62c[_0x12ff('0x21')],'include':_0x44b62c[_0x12ff('0x1e')]?_[_0x12ff('0x1f')](_0x44b62c['include'],function(_0x568158){return{'model':db[_0x568158[_0x12ff('0x20')]],'as':_0x568158['as'],'attributes':_0x568158['attributes']};}):[]};}):[]};}):[]:[]})[_0x12ff('0xd')](function(_0x26fccf){logger[_0x12ff('0xe')](_0x12ff('0x18'),_0x1bef99);logger[_0x12ff('0x11')](_0x12ff('0x18'),_0x1bef99,JSON['stringify'](_0x26fccf));_0xf859d5(_0x26fccf);})[_0x12ff('0x17')](function(_0x351483){logger[_0x12ff('0x14')](_0x12ff('0x18'),_0x351483[_0x12ff('0x15')],_0x1bef99);_0x13ae88(_0xde7b3['error'](0x1f4,_0x351483['message']));});});};exports['ShowOpenchannelQueue']=function(_0x5665b6){var _0x5ddb74=this;return new Promise(function(_0x385cea,_0x1699ee){return db['OpenchannelQueue']['find']({'raw':_0x5665b6['options']?_0x5665b6[_0x12ff('0x1b')][_0x12ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5665b6['options']?_0x5665b6[_0x12ff('0x1b')][_0x12ff('0x22')]||null:null,'attributes':_0x5665b6[_0x12ff('0x1b')]?_0x5665b6[_0x12ff('0x1b')]['attributes']||null:null,'include':_0x5665b6['options']?_0x5665b6[_0x12ff('0x1b')][_0x12ff('0x1e')]?_['map'](_0x5665b6[_0x12ff('0x1b')]['include'],function(_0x127e1f){return{'model':db[_0x127e1f[_0x12ff('0x20')]],'as':_0x127e1f['as'],'attributes':_0x127e1f[_0x12ff('0x21')],'include':_0x127e1f[_0x12ff('0x1e')]?_[_0x12ff('0x1f')](_0x127e1f['include'],function(_0xb55b08){return{'model':db[_0xb55b08['model']],'as':_0xb55b08['as'],'attributes':_0xb55b08[_0x12ff('0x21')],'include':_0xb55b08[_0x12ff('0x1e')]?_[_0x12ff('0x1f')](_0xb55b08['include'],function(_0x32ae7a){return{'model':db[_0x32ae7a[_0x12ff('0x20')]],'as':_0x32ae7a['as'],'attributes':_0x32ae7a[_0x12ff('0x21')]};}):[]};}):[]};}):[]:[]})[_0x12ff('0xd')](function(_0x2a304d){logger[_0x12ff('0xe')](_0x12ff('0x23'),_0x5665b6);logger[_0x12ff('0x11')](_0x12ff('0x23'),_0x5665b6,JSON[_0x12ff('0x13')](_0x2a304d));_0x385cea(_0x2a304d);})[_0x12ff('0x17')](function(_0x1676ab){logger[_0x12ff('0x14')](_0x12ff('0x23'),_0x1676ab[_0x12ff('0x15')],_0x5665b6);_0x1699ee(_0x5ddb74[_0x12ff('0x14')](0x1f4,_0x1676ab['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index f9122d2..ff22a04 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 _0x7bb8=['emit','removeListener','length','openchannelQueue:','remove','update'];(function(_0x3120ba,_0x9a48e0){var _0x2a0794=function(_0x4cc433){while(--_0x4cc433){_0x3120ba['push'](_0x3120ba['shift']());}};_0x2a0794(++_0x9a48e0);}(_0x7bb8,0xb8));var _0x87bb=function(_0x4c7ee9,_0x2d459d){_0x4c7ee9=_0x4c7ee9-0x0;var _0x40b2e9=_0x7bb8[_0x4c7ee9];return _0x40b2e9;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x87bb('0x0'),_0x87bb('0x1')];function createListener(_0x5279f4,_0x58ed9f){return function(_0x46f9f5){_0x58ed9f[_0x87bb('0x2')](_0x5279f4,_0x46f9f5);};}function removeListener(_0x36f44a,_0x4feae8){return function(){OpenchannelQueueEvents[_0x87bb('0x3')](_0x36f44a,_0x4feae8);};}exports['register']=function(_0x824003){for(var _0xef5c35=0x0,_0x645e7c=events[_0x87bb('0x4')];_0xef5c35<_0x645e7c;_0xef5c35++){var _0x1c8648=events[_0xef5c35];var _0x1c0502=createListener(_0x87bb('0x5')+_0x1c8648,_0x824003);OpenchannelQueueEvents['on'](_0x1c8648,_0x1c0502);}}; \ No newline at end of file +var _0x33ca=['length','save','update','removeListener'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x33ca,0x14d));var _0xa33c=function(_0x51ed47,_0x22857b){_0x51ed47=_0x51ed47-0x0;var _0xa77fb=_0x33ca[_0x51ed47];return _0xa77fb;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xa33c('0x0'),'remove',_0xa33c('0x1')];function createListener(_0x161e26,_0x3fc9c0){return function(_0x1551d8){_0x3fc9c0['emit'](_0x161e26,_0x1551d8);};}function removeListener(_0x1c2711,_0x2527d2){return function(){OpenchannelQueueEvents[_0xa33c('0x2')](_0x1c2711,_0x2527d2);};}exports['register']=function(_0x5d3df6){for(var _0x158eb5=0x0,_0x232543=events[_0xa33c('0x3')];_0x158eb5<_0x232543;_0x158eb5++){var _0x489963=events[_0x158eb5];var _0x30a135=createListener('openchannelQueue:'+_0x489963,_0x5d3df6);OpenchannelQueueEvents['on'](_0x489963,_0x30a135);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 562a455..fb4fde6 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 _0x3c6b=['update','multer','path','Router','../../components/auth/service','./openchannelQueueReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put'];(function(_0x11c9d7,_0x29c9f0){var _0x31bcbb=function(_0x21a706){while(--_0x21a706){_0x11c9d7['push'](_0x11c9d7['shift']());}};_0x31bcbb(++_0x29c9f0);}(_0x3c6b,0x191));var _0xb3c6=function(_0xbf6bb2,_0x55ce47){_0xbf6bb2=_0xbf6bb2-0x0;var _0x54e71f=_0x3c6b[_0xbf6bb2];return _0x54e71f;};'use strict';var multer=require(_0xb3c6('0x0'));var util=require('util');var path=require(_0xb3c6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb3c6('0x2')]();var auth=require(_0xb3c6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb3c6('0x4'));router['get']('/',auth[_0xb3c6('0x5')](),controller[_0xb3c6('0x6')]);router['get'](_0xb3c6('0x7'),auth['isAuthenticated'](),controller[_0xb3c6('0x8')]);router[_0xb3c6('0x9')](_0xb3c6('0xa'),auth[_0xb3c6('0x5')](),controller[_0xb3c6('0xb')]);router[_0xb3c6('0xc')]('/',auth[_0xb3c6('0x5')](),controller[_0xb3c6('0xd')]);router[_0xb3c6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb3c6('0xf')]);router['delete'](_0xb3c6('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2099=['create','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4e37de,_0x2ce895){var _0xf148e8=function(_0x42f66d){while(--_0x42f66d){_0x4e37de['push'](_0x4e37de['shift']());}};_0xf148e8(++_0x2ce895);}(_0x2099,0x1a8));var _0x9209=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2099[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x9209('0x0'));var util=require(_0x9209('0x1'));var path=require(_0x9209('0x2'));var timeout=require(_0x9209('0x3'));var express=require(_0x9209('0x4'));var router=express['Router']();var auth=require(_0x9209('0x5'));var interaction=require(_0x9209('0x6'));var config=require(_0x9209('0x7'));var controller=require(_0x9209('0x8'));router[_0x9209('0x9')]('/',auth[_0x9209('0xa')](),controller[_0x9209('0xb')]);router[_0x9209('0x9')](_0x9209('0xc'),auth[_0x9209('0xa')](),controller[_0x9209('0xd')]);router['get'](_0x9209('0xe'),auth[_0x9209('0xa')](),controller[_0x9209('0xf')]);router['post']('/',auth[_0x9209('0xa')](),controller[_0x9209('0x10')]);router[_0x9209('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9209('0x12')]);router['delete'](_0x9209('0xe'),auth[_0x9209('0xa')](),controller['destroy']);module[_0x9209('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a0b2993..a4e2c02 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 _0xcba6=['sequelize','exports','STRING','DATE'];(function(_0x52e9fa,_0x584b69){var _0x175185=function(_0xdb3228){while(--_0xdb3228){_0x52e9fa['push'](_0x52e9fa['shift']());}};_0x175185(++_0x584b69);}(_0xcba6,0x15c));var _0x6cba=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcba6[_0x17d9e3];return _0x14192d;};'use strict';var moment=require('moment');var Sequelize=require(_0x6cba('0x0'));module[_0x6cba('0x1')]={'uniqueid':{'type':Sequelize[_0x6cba('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6cba('0x2')]},'joinAt':{'type':Sequelize[_0x6cba('0x3')]},'leaveAt':{'type':Sequelize[_0x6cba('0x3')]},'acceptAt':{'type':Sequelize[_0x6cba('0x3')]},'exitAt':{'type':Sequelize[_0x6cba('0x3')]},'reason':{'type':Sequelize[_0x6cba('0x2')]}}; \ No newline at end of file +var _0x026e=['exports','STRING','DATE','moment'];(function(_0x2808d0,_0x221a9f){var _0x3aef7c=function(_0x331dc1){while(--_0x331dc1){_0x2808d0['push'](_0x2808d0['shift']());}};_0x3aef7c(++_0x221a9f);}(_0x026e,0x197));var _0xe026=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x026e[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xe026('0x0'));var Sequelize=require('sequelize');module[_0xe026('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe026('0x2')]},'joinAt':{'type':Sequelize[_0xe026('0x3')]},'leaveAt':{'type':Sequelize[_0xe026('0x3')]},'acceptAt':{'type':Sequelize[_0xe026('0x3')]},'exitAt':{'type':Sequelize[_0xe026('0x3')]},'reason':{'type':Sequelize[_0xe026('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 79a6890..6c8a262 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 _0x2c27=['create','body','params','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','error','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','include','options','find'];(function(_0x1673af,_0x4a64c1){var _0x4c1990=function(_0x3eb780){while(--_0x3eb780){_0x1673af['push'](_0x1673af['shift']());}};_0x4c1990(++_0x4a64c1);}(_0x2c27,0x9f));var _0x72c2=function(_0x48654d,_0x1960dd){_0x48654d=_0x48654d-0x0;var _0x1cc79d=_0x2c27[_0x48654d];return _0x1cc79d;};'use strict';var pdf=require(_0x72c2('0x0'));var emlformat=require(_0x72c2('0x1'));var rimraf=require(_0x72c2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x72c2('0x3'));var rp=require(_0x72c2('0x4'));var moment=require('moment');var BPromise=require(_0x72c2('0x5'));var Mustache=require(_0x72c2('0x6'));var util=require(_0x72c2('0x7'));var path=require(_0x72c2('0x8'));var sox=require(_0x72c2('0x9'));var csv=require(_0x72c2('0xa'));var ejs=require(_0x72c2('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x72c2('0xc'));var crypto=require(_0x72c2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x72c2('0xe'));var toCsv=require(_0x72c2('0xa'));var querystring=require(_0x72c2('0xf'));var Papa=require(_0x72c2('0x10'));var Redis=require(_0x72c2('0x11'));var authService=require(_0x72c2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x72c2('0x13'));var hardwareService=require(_0x72c2('0x14'));var logger=require(_0x72c2('0x15'))(_0x72c2('0x16'));var utils=require(_0x72c2('0x17'));var config=require(_0x72c2('0x18'));var db=require(_0x72c2('0x19'))['db'];function respondWithStatusCode(_0x503e3c,_0x28a604){_0x28a604=_0x28a604||0xcc;return function(_0xe4da48){if(_0xe4da48){return _0x503e3c[_0x72c2('0x1a')](_0x28a604);}return _0x503e3c[_0x72c2('0x1b')](_0x28a604)[_0x72c2('0x1c')]();};}function respondWithResult(_0x2b89af,_0x505cf5){_0x505cf5=_0x505cf5||0xc8;return function(_0x36f881){if(_0x36f881){return _0x2b89af['status'](_0x505cf5)[_0x72c2('0x1d')](_0x36f881);}};}function respondWithFilteredResult(_0x583e28,_0x2a4078){return function(_0x50d82f){if(_0x50d82f){var _0x586e8d=_0x50d82f[_0x72c2('0x1e')],_0x70c9e1=_0x2a4078[_0x72c2('0x1f')],_0x23d63f=_0x2a4078[_0x72c2('0x1f')]+_0x2a4078['limit'],_0x51648a;if(_0x23d63f>=_0x586e8d){_0x23d63f=_0x586e8d;_0x51648a=0xc8;}else{_0x51648a=0xce;}_0x583e28[_0x72c2('0x1b')](_0x51648a);return _0x583e28[_0x72c2('0x20')](_0x72c2('0x21'),_0x70c9e1+'-'+_0x23d63f+'/'+_0x586e8d)[_0x72c2('0x1d')](_0x50d82f);}return null;};}function patchUpdates(_0x283956){return function(_0x66c543){try{jsonpatch['apply'](_0x66c543,_0x283956,!![]);}catch(_0x5d4f77){return BPromise[_0x72c2('0x22')](_0x5d4f77);}return _0x66c543['save']();};}function saveUpdates(_0x5ffd18,_0x5509d9){return function(_0x2453be){if(_0x2453be){return _0x2453be[_0x72c2('0x23')](_0x5ffd18)[_0x72c2('0x24')](function(_0x2cdd1b){return _0x2cdd1b;});}return null;};}function removeEntity(_0x18129d,_0x3c1789){return function(_0x3d449d){if(_0x3d449d){return _0x3d449d['destroy']()[_0x72c2('0x24')](function(){_0x18129d[_0x72c2('0x1b')](0xcc)[_0x72c2('0x1c')]();});}};}function handleEntityNotFound(_0x5f070f,_0x1ddf16){return function(_0x4851ee){if(!_0x4851ee){_0x5f070f[_0x72c2('0x1a')](0x194);}return _0x4851ee;};}function handleError(_0x260523,_0xf2b3e2){_0xf2b3e2=_0xf2b3e2||0x1f4;return function(_0x4fa67f){logger[_0x72c2('0x25')](_0x4fa67f['stack']);if(_0x4fa67f[_0x72c2('0x26')]){delete _0x4fa67f[_0x72c2('0x26')];}_0x260523[_0x72c2('0x1b')](_0xf2b3e2)[_0x72c2('0x27')](_0x4fa67f);};}exports[_0x72c2('0x28')]=function(_0x589039,_0x2b87a1){var _0x94495={},_0x1e414a={},_0x45e80a={'count':0x0,'rows':[]};var _0x573898=_[_0x72c2('0x29')](db[_0x72c2('0x2a')][_0x72c2('0x2b')],function(_0x477be6){return{'name':_0x477be6[_0x72c2('0x2c')],'type':_0x477be6['type'][_0x72c2('0x2d')]};});_0x1e414a[_0x72c2('0x2e')]=_[_0x72c2('0x29')](_0x573898,_0x72c2('0x26'));_0x1e414a['query']=_[_0x72c2('0x2f')](_0x589039[_0x72c2('0x30')]);_0x1e414a[_0x72c2('0x31')]=_['intersection'](_0x1e414a[_0x72c2('0x2e')],_0x1e414a[_0x72c2('0x30')]);_0x94495[_0x72c2('0x32')]=_[_0x72c2('0x33')](_0x1e414a[_0x72c2('0x2e')],qs[_0x72c2('0x34')](_0x589039['query'][_0x72c2('0x34')]));_0x94495['attributes']=_0x94495['attributes'][_0x72c2('0x35')]?_0x94495['attributes']:_0x1e414a[_0x72c2('0x2e')];if(!_0x589039[_0x72c2('0x30')][_0x72c2('0x36')](_0x72c2('0x37'))){_0x94495[_0x72c2('0x38')]=qs[_0x72c2('0x38')](_0x589039['query'][_0x72c2('0x38')]);_0x94495[_0x72c2('0x1f')]=qs[_0x72c2('0x1f')](_0x589039[_0x72c2('0x30')][_0x72c2('0x1f')]);}_0x94495[_0x72c2('0x39')]=qs[_0x72c2('0x3a')](_0x589039[_0x72c2('0x30')][_0x72c2('0x3a')]);_0x94495[_0x72c2('0x3b')]=qs[_0x72c2('0x31')](_[_0x72c2('0x3c')](_0x589039[_0x72c2('0x30')],_0x1e414a['filters']),_0x573898);if(_0x589039['query'][_0x72c2('0x3d')]){_0x94495['where']=_[_0x72c2('0x3e')](_0x94495[_0x72c2('0x3b')],{'$or':_['map'](_0x573898,function(_0x1a2711){if(_0x1a2711[_0x72c2('0x3f')]!==_0x72c2('0x40')){var _0x5f5bd3={};_0x5f5bd3[_0x1a2711[_0x72c2('0x26')]]={'$like':'%'+_0x589039[_0x72c2('0x30')][_0x72c2('0x3d')]+'%'};return _0x5f5bd3;}})});}_0x94495=_[_0x72c2('0x3e')]({},_0x94495,_0x589039['options']);var _0x8fde71={'where':_0x94495['where']};return db['OpenchannelQueueReport'][_0x72c2('0x1e')](_0x8fde71)[_0x72c2('0x24')](function(_0x553cda){_0x45e80a[_0x72c2('0x1e')]=_0x553cda;if(_0x589039['query'][_0x72c2('0x41')]){_0x94495['include']=[{'all':!![]}];}return db[_0x72c2('0x2a')][_0x72c2('0x42')](_0x94495);})[_0x72c2('0x24')](function(_0x40e8d2){_0x45e80a[_0x72c2('0x43')]=_0x40e8d2;return _0x45e80a;})['then'](respondWithFilteredResult(_0x2b87a1,_0x94495))[_0x72c2('0x44')](handleError(_0x2b87a1,null));};exports['show']=function(_0x223891,_0x378de6){var _0xec7fb8={'raw':!![],'where':{'id':_0x223891['params']['id']}},_0x58cd94={};_0x58cd94['model']=_[_0x72c2('0x2f')](db['OpenchannelQueueReport']['rawAttributes']);_0x58cd94[_0x72c2('0x30')]=_[_0x72c2('0x2f')](_0x223891[_0x72c2('0x30')]);_0x58cd94[_0x72c2('0x31')]=_['intersection'](_0x58cd94['model'],_0x58cd94[_0x72c2('0x30')]);_0xec7fb8[_0x72c2('0x32')]=_['intersection'](_0x58cd94['model'],qs[_0x72c2('0x34')](_0x223891[_0x72c2('0x30')][_0x72c2('0x34')]));_0xec7fb8[_0x72c2('0x32')]=_0xec7fb8[_0x72c2('0x32')][_0x72c2('0x35')]?_0xec7fb8['attributes']:_0x58cd94[_0x72c2('0x2e')];if(_0x223891[_0x72c2('0x30')][_0x72c2('0x41')]){_0xec7fb8[_0x72c2('0x45')]=[{'all':!![]}];}_0xec7fb8=_[_0x72c2('0x3e')]({},_0xec7fb8,_0x223891[_0x72c2('0x46')]);return db[_0x72c2('0x2a')][_0x72c2('0x47')](_0xec7fb8)[_0x72c2('0x24')](handleEntityNotFound(_0x378de6,null))[_0x72c2('0x24')](respondWithResult(_0x378de6,null))[_0x72c2('0x44')](handleError(_0x378de6,null));};exports[_0x72c2('0x48')]=function(_0x2b28b8,_0x53ea6c){return db[_0x72c2('0x2a')][_0x72c2('0x48')](_0x2b28b8[_0x72c2('0x49')],{})[_0x72c2('0x24')](respondWithResult(_0x53ea6c,0xc9))[_0x72c2('0x44')](handleError(_0x53ea6c,null));};exports['update']=function(_0x405d74,_0x1ef966){if(_0x405d74[_0x72c2('0x49')]['id']){delete _0x405d74[_0x72c2('0x49')]['id'];}return db['OpenchannelQueueReport'][_0x72c2('0x47')]({'where':{'id':_0x405d74[_0x72c2('0x4a')]['id']}})[_0x72c2('0x24')](handleEntityNotFound(_0x1ef966,null))[_0x72c2('0x24')](saveUpdates(_0x405d74[_0x72c2('0x49')],null))['then'](respondWithResult(_0x1ef966,null))[_0x72c2('0x44')](handleError(_0x1ef966,null));};exports[_0x72c2('0x4b')]=function(_0x20ff56,_0x4b9d00){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x20ff56[_0x72c2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4b9d00,null))[_0x72c2('0x24')](removeEntity(_0x4b9d00,null))[_0x72c2('0x44')](handleError(_0x4b9d00,null));};exports[_0x72c2('0x4c')]=function(_0x1c2146,_0x517200){return db['OpenchannelQueueReport'][_0x72c2('0x4c')]()[_0x72c2('0x24')](respondWithResult(_0x517200,null))[_0x72c2('0x44')](handleError(_0x517200,null));}; \ No newline at end of file +var _0x7f3b=['fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','map','OpenchannelQueueReport','rawAttributes'];(function(_0x67d81c,_0x3cd587){var _0x3a7dc5=function(_0x54b8a3){while(--_0x54b8a3){_0x67d81c['push'](_0x67d81c['shift']());}};_0x3a7dc5(++_0x3cd587);}(_0x7f3b,0x13e));var _0xb7f3=function(_0x4a7d94,_0x11be7b){_0x4a7d94=_0x4a7d94-0x0;var _0x5c3e9b=_0x7f3b[_0x4a7d94];return _0x5c3e9b;};'use strict';var pdf=require(_0xb7f3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb7f3('0x1'));var zipdir=require(_0xb7f3('0x2'));var jsonpatch=require(_0xb7f3('0x3'));var rp=require(_0xb7f3('0x4'));var moment=require(_0xb7f3('0x5'));var BPromise=require(_0xb7f3('0x6'));var Mustache=require(_0xb7f3('0x7'));var util=require(_0xb7f3('0x8'));var path=require(_0xb7f3('0x9'));var sox=require(_0xb7f3('0xa'));var csv=require('to-csv');var ejs=require(_0xb7f3('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb7f3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb7f3('0xd'));var toCsv=require(_0xb7f3('0xe'));var querystring=require(_0xb7f3('0xf'));var Papa=require(_0xb7f3('0x10'));var Redis=require('ioredis');var authService=require(_0xb7f3('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb7f3('0x12'));var logger=require(_0xb7f3('0x13'))('api');var utils=require(_0xb7f3('0x14'));var config=require(_0xb7f3('0x15'));var db=require(_0xb7f3('0x16'))['db'];function respondWithStatusCode(_0x5480dd,_0x4a3e4d){_0x4a3e4d=_0x4a3e4d||0xcc;return function(_0x4db774){if(_0x4db774){return _0x5480dd[_0xb7f3('0x17')](_0x4a3e4d);}return _0x5480dd[_0xb7f3('0x18')](_0x4a3e4d)[_0xb7f3('0x19')]();};}function respondWithResult(_0x4e1436,_0x15bc04){_0x15bc04=_0x15bc04||0xc8;return function(_0xe294fa){if(_0xe294fa){return _0x4e1436[_0xb7f3('0x18')](_0x15bc04)[_0xb7f3('0x1a')](_0xe294fa);}};}function respondWithFilteredResult(_0xda9e9,_0x3cff25){return function(_0x242150){if(_0x242150){var _0x1a951a=_0x242150[_0xb7f3('0x1b')],_0x5c083e=_0x3cff25[_0xb7f3('0x1c')],_0xe3246f=_0x3cff25[_0xb7f3('0x1c')]+_0x3cff25['limit'],_0x2b8c5c;if(_0xe3246f>=_0x1a951a){_0xe3246f=_0x1a951a;_0x2b8c5c=0xc8;}else{_0x2b8c5c=0xce;}_0xda9e9['status'](_0x2b8c5c);return _0xda9e9[_0xb7f3('0x1d')]('Content-Range',_0x5c083e+'-'+_0xe3246f+'/'+_0x1a951a)[_0xb7f3('0x1a')](_0x242150);}return null;};}function patchUpdates(_0x28a9ec){return function(_0x27c3aa){try{jsonpatch[_0xb7f3('0x1e')](_0x27c3aa,_0x28a9ec,!![]);}catch(_0x3cb233){return BPromise[_0xb7f3('0x1f')](_0x3cb233);}return _0x27c3aa[_0xb7f3('0x20')]();};}function saveUpdates(_0x404514,_0x11c85e){return function(_0x4493f5){if(_0x4493f5){return _0x4493f5[_0xb7f3('0x21')](_0x404514)[_0xb7f3('0x22')](function(_0x50aa3c){return _0x50aa3c;});}return null;};}function removeEntity(_0x5876d9,_0x16c383){return function(_0x247319){if(_0x247319){return _0x247319[_0xb7f3('0x23')]()[_0xb7f3('0x22')](function(){_0x5876d9['status'](0xcc)[_0xb7f3('0x19')]();});}};}function handleEntityNotFound(_0x245fdc,_0x41e80e){return function(_0x1f0e7b){if(!_0x1f0e7b){_0x245fdc[_0xb7f3('0x17')](0x194);}return _0x1f0e7b;};}function handleError(_0x128c24,_0x4ce465){_0x4ce465=_0x4ce465||0x1f4;return function(_0x2c2e11){logger[_0xb7f3('0x24')](_0x2c2e11[_0xb7f3('0x25')]);if(_0x2c2e11[_0xb7f3('0x26')]){delete _0x2c2e11[_0xb7f3('0x26')];}_0x128c24[_0xb7f3('0x18')](_0x4ce465)['send'](_0x2c2e11);};}exports['index']=function(_0x37090e,_0x525cc7){var _0x31e9dc={},_0x2a58b2={},_0x93602d={'count':0x0,'rows':[]};var _0x1bf983=_[_0xb7f3('0x27')](db[_0xb7f3('0x28')][_0xb7f3('0x29')],function(_0x50622d){return{'name':_0x50622d[_0xb7f3('0x2a')],'type':_0x50622d[_0xb7f3('0x2b')][_0xb7f3('0x2c')]};});_0x2a58b2['model']=_[_0xb7f3('0x27')](_0x1bf983,_0xb7f3('0x26'));_0x2a58b2[_0xb7f3('0x2d')]=_[_0xb7f3('0x2e')](_0x37090e[_0xb7f3('0x2d')]);_0x2a58b2[_0xb7f3('0x2f')]=_['intersection'](_0x2a58b2[_0xb7f3('0x30')],_0x2a58b2[_0xb7f3('0x2d')]);_0x31e9dc[_0xb7f3('0x31')]=_[_0xb7f3('0x32')](_0x2a58b2[_0xb7f3('0x30')],qs[_0xb7f3('0x33')](_0x37090e[_0xb7f3('0x2d')][_0xb7f3('0x33')]));_0x31e9dc[_0xb7f3('0x31')]=_0x31e9dc[_0xb7f3('0x31')][_0xb7f3('0x34')]?_0x31e9dc[_0xb7f3('0x31')]:_0x2a58b2[_0xb7f3('0x30')];if(!_0x37090e[_0xb7f3('0x2d')]['hasOwnProperty'](_0xb7f3('0x35'))){_0x31e9dc['limit']=qs[_0xb7f3('0x36')](_0x37090e['query']['limit']);_0x31e9dc[_0xb7f3('0x1c')]=qs[_0xb7f3('0x1c')](_0x37090e[_0xb7f3('0x2d')][_0xb7f3('0x1c')]);}_0x31e9dc['order']=qs[_0xb7f3('0x37')](_0x37090e['query'][_0xb7f3('0x37')]);_0x31e9dc[_0xb7f3('0x38')]=qs[_0xb7f3('0x2f')](_['pick'](_0x37090e[_0xb7f3('0x2d')],_0x2a58b2[_0xb7f3('0x2f')]),_0x1bf983);if(_0x37090e['query'][_0xb7f3('0x39')]){_0x31e9dc[_0xb7f3('0x38')]=_[_0xb7f3('0x3a')](_0x31e9dc[_0xb7f3('0x38')],{'$or':_[_0xb7f3('0x27')](_0x1bf983,function(_0x3b1c7b){if(_0x3b1c7b['type']!==_0xb7f3('0x3b')){var _0x52083f={};_0x52083f[_0x3b1c7b[_0xb7f3('0x26')]]={'$like':'%'+_0x37090e[_0xb7f3('0x2d')][_0xb7f3('0x39')]+'%'};return _0x52083f;}})});}_0x31e9dc=_[_0xb7f3('0x3a')]({},_0x31e9dc,_0x37090e['options']);var _0xf2934d={'where':_0x31e9dc[_0xb7f3('0x38')]};return db['OpenchannelQueueReport'][_0xb7f3('0x1b')](_0xf2934d)['then'](function(_0x33abef){_0x93602d[_0xb7f3('0x1b')]=_0x33abef;if(_0x37090e[_0xb7f3('0x2d')][_0xb7f3('0x3c')]){_0x31e9dc[_0xb7f3('0x3d')]=[{'all':!![]}];}return db[_0xb7f3('0x28')][_0xb7f3('0x3e')](_0x31e9dc);})[_0xb7f3('0x22')](function(_0x2750fd){_0x93602d[_0xb7f3('0x3f')]=_0x2750fd;return _0x93602d;})['then'](respondWithFilteredResult(_0x525cc7,_0x31e9dc))[_0xb7f3('0x40')](handleError(_0x525cc7,null));};exports[_0xb7f3('0x41')]=function(_0x4c5a4f,_0x4ddb60){var _0x148e46={'raw':!![],'where':{'id':_0x4c5a4f[_0xb7f3('0x42')]['id']}},_0x3bd865={};_0x3bd865[_0xb7f3('0x30')]=_['keys'](db['OpenchannelQueueReport'][_0xb7f3('0x29')]);_0x3bd865[_0xb7f3('0x2d')]=_[_0xb7f3('0x2e')](_0x4c5a4f[_0xb7f3('0x2d')]);_0x3bd865[_0xb7f3('0x2f')]=_[_0xb7f3('0x32')](_0x3bd865[_0xb7f3('0x30')],_0x3bd865[_0xb7f3('0x2d')]);_0x148e46[_0xb7f3('0x31')]=_[_0xb7f3('0x32')](_0x3bd865[_0xb7f3('0x30')],qs[_0xb7f3('0x33')](_0x4c5a4f[_0xb7f3('0x2d')][_0xb7f3('0x33')]));_0x148e46[_0xb7f3('0x31')]=_0x148e46[_0xb7f3('0x31')][_0xb7f3('0x34')]?_0x148e46[_0xb7f3('0x31')]:_0x3bd865['model'];if(_0x4c5a4f[_0xb7f3('0x2d')][_0xb7f3('0x3c')]){_0x148e46['include']=[{'all':!![]}];}_0x148e46=_[_0xb7f3('0x3a')]({},_0x148e46,_0x4c5a4f[_0xb7f3('0x43')]);return db[_0xb7f3('0x28')][_0xb7f3('0x44')](_0x148e46)[_0xb7f3('0x22')](handleEntityNotFound(_0x4ddb60,null))[_0xb7f3('0x22')](respondWithResult(_0x4ddb60,null))[_0xb7f3('0x40')](handleError(_0x4ddb60,null));};exports[_0xb7f3('0x45')]=function(_0x868504,_0x5772f6){return db[_0xb7f3('0x28')]['create'](_0x868504[_0xb7f3('0x46')],{})['then'](respondWithResult(_0x5772f6,0xc9))[_0xb7f3('0x40')](handleError(_0x5772f6,null));};exports['update']=function(_0x1e917d,_0x27150e){if(_0x1e917d[_0xb7f3('0x46')]['id']){delete _0x1e917d[_0xb7f3('0x46')]['id'];}return db['OpenchannelQueueReport'][_0xb7f3('0x44')]({'where':{'id':_0x1e917d[_0xb7f3('0x42')]['id']}})[_0xb7f3('0x22')](handleEntityNotFound(_0x27150e,null))[_0xb7f3('0x22')](saveUpdates(_0x1e917d['body'],null))[_0xb7f3('0x22')](respondWithResult(_0x27150e,null))['catch'](handleError(_0x27150e,null));};exports['destroy']=function(_0x10230a,_0x58f1d9){return db[_0xb7f3('0x28')]['find']({'where':{'id':_0x10230a[_0xb7f3('0x42')]['id']}})[_0xb7f3('0x22')](handleEntityNotFound(_0x58f1d9,null))[_0xb7f3('0x22')](removeEntity(_0x58f1d9,null))[_0xb7f3('0x40')](handleError(_0x58f1d9,null));};exports[_0xb7f3('0x47')]=function(_0x5abc2e,_0x4c8f8c){return db['OpenchannelQueueReport']['describe']()['then'](respondWithResult(_0x4c8f8c,null))['catch'](handleError(_0x4c8f8c,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 1f0d7f4..6d64217 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 _0x2ae2=['api','moment','bluebird','request-promise','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','util','../../config/logger'];(function(_0x40ff4d,_0x72c2dd){var _0xc6b831=function(_0x22cec6){while(--_0x22cec6){_0x40ff4d['push'](_0x40ff4d['shift']());}};_0xc6b831(++_0x72c2dd);}(_0x2ae2,0x73));var _0x22ae=function(_0x5a5ad8,_0x34911c){_0x5a5ad8=_0x5a5ad8-0x0;var _0x5512e5=_0x2ae2[_0x5a5ad8];return _0x5512e5;};'use strict';var _=require('lodash');var util=require(_0x22ae('0x0'));var logger=require(_0x22ae('0x1'))(_0x22ae('0x2'));var moment=require(_0x22ae('0x3'));var BPromise=require(_0x22ae('0x4'));var rp=require(_0x22ae('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x22ae('0x6'));var attributes=require(_0x22ae('0x7'));module[_0x22ae('0x8')]=function(_0x29a16a,_0x4e3854){return _0x29a16a[_0x22ae('0x9')](_0x22ae('0xa'),attributes,{'tableName':_0x22ae('0xb'),'paranoid':![],'indexes':[{'name':_0x22ae('0xc'),'fields':[_0x22ae('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdfd7=['api','bluebird','request-promise','path','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','util'];(function(_0x5c086a,_0x5e49ad){var _0x416f7b=function(_0x3af942){while(--_0x3af942){_0x5c086a['push'](_0x5c086a['shift']());}};_0x416f7b(++_0x5e49ad);}(_0xdfd7,0x1dc));var _0x7dfd=function(_0x4d9cd0,_0x112ac2){_0x4d9cd0=_0x4d9cd0-0x0;var _0x4636e9=_0xdfd7[_0x4d9cd0];return _0x4636e9;};'use strict';var _=require('lodash');var util=require(_0x7dfd('0x0'));var logger=require('../../config/logger')(_0x7dfd('0x1'));var moment=require('moment');var BPromise=require(_0x7dfd('0x2'));var rp=require(_0x7dfd('0x3'));var fs=require('fs');var path=require(_0x7dfd('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0x56541c,_0x1f0c59){return _0x56541c[_0x7dfd('0x5')](_0x7dfd('0x6'),attributes,{'tableName':_0x7dfd('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x7dfd('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 90b23db..4f37c38 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 _0x33af=['raw','attributes','limit','UpdateOpenchannelQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options'];(function(_0x2c6cb6,_0x281fa6){var _0x4ef9b4=function(_0x5bde2f){while(--_0x5bde2f){_0x2c6cb6['push'](_0x2c6cb6['shift']());}};_0x4ef9b4(++_0x281fa6);}(_0x33af,0xec));var _0xf33a=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x33af[_0x58175c];return _0x55b88f;};'use strict';var _=require('lodash');var util=require(_0xf33a('0x0'));var moment=require('moment');var BPromise=require(_0xf33a('0x1'));var rs=require(_0xf33a('0x2'));var fs=require('fs');var Redis=require(_0xf33a('0x3'));var db=require(_0xf33a('0x4'))['db'];var utils=require(_0xf33a('0x5'));var logger=require(_0xf33a('0x6'))('rpc');var config=require(_0xf33a('0x7'));var jayson=require(_0xf33a('0x8'));var client=jayson['client'][_0xf33a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x384b14,_0x1b2b01,_0x2f3730){return new BPromise(function(_0x2baabb,_0x2cb169){return client['request'](_0x384b14,_0x2f3730)[_0xf33a('0xa')](function(_0x14eb0e){logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,_0xf33a('0xd'));logger[_0xf33a('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x1b2b01,'request\x20sent',JSON[_0xf33a('0xf')](_0x14eb0e));if(_0x14eb0e[_0xf33a('0x10')]){if(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x11')]===0x1f4){logger[_0xf33a('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2cb169(_0x14eb0e['error']['message']);}logger[_0xf33a('0x10')](_0xf33a('0xc'),_0x1b2b01,_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);return _0x2baabb(_0x14eb0e[_0xf33a('0x10')][_0xf33a('0x12')]);}else{logger[_0xf33a('0xb')](_0xf33a('0xc'),_0x1b2b01,'request\x20sent');_0x2baabb(_0x14eb0e[_0xf33a('0x13')]['message']);}})[_0xf33a('0x14')](function(_0x229389){logger['error'](_0xf33a('0xc'),_0x1b2b01,_0x229389);_0x2cb169(_0x229389);});});}exports[_0xf33a('0x15')]=function(_0x524109){var _0x2946ef=this;return new Promise(function(_0x23d9e2,_0x38d69a){return db[_0xf33a('0x16')]['create'](_0x524109[_0xf33a('0x17')],{'raw':_0x524109[_0xf33a('0x18')]?_0x524109[_0xf33a('0x18')][_0xf33a('0x19')]===undefined?!![]:![]:!![]})[_0xf33a('0xa')](function(_0x6cdf7b){logger[_0xf33a('0xb')](_0xf33a('0x15'),_0x524109);logger[_0xf33a('0xe')](_0xf33a('0x15'),_0x524109,JSON['stringify'](_0x6cdf7b));_0x23d9e2(_0x6cdf7b);})[_0xf33a('0x14')](function(_0x272e60){logger[_0xf33a('0x10')](_0xf33a('0x15'),_0x272e60[_0xf33a('0x12')],_0x524109);_0x38d69a(_0x2946ef['error'](0x1f4,_0x272e60[_0xf33a('0x12')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x492986){var _0x3f9ef7=this;return new Promise(function(_0x394468,_0x17b12d){return db[_0xf33a('0x16')]['update'](_0x492986[_0xf33a('0x17')],{'raw':_0x492986[_0xf33a('0x18')]?_0x492986['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x492986[_0xf33a('0x18')]?_0x492986['options']['where']||null:null,'attributes':_0x492986[_0xf33a('0x18')]?_0x492986['options'][_0xf33a('0x1a')]||null:null,'limit':_0x492986['options']?_0x492986[_0xf33a('0x18')][_0xf33a('0x1b')]||null:null})[_0xf33a('0xa')](function(_0x729fca){logger[_0xf33a('0xb')](_0xf33a('0x1c'),_0x492986);logger[_0xf33a('0xe')](_0xf33a('0x1c'),_0x492986,JSON[_0xf33a('0xf')](_0x729fca));_0x394468(_0x729fca);})[_0xf33a('0x14')](function(_0x77b7c1){logger[_0xf33a('0x10')](_0xf33a('0x1c'),_0x77b7c1[_0xf33a('0x12')],_0x492986);_0x17b12d(_0x3f9ef7[_0xf33a('0x10')](0x1f4,_0x77b7c1['message']));});});}; \ No newline at end of file +var _0xef0f=['OpenchannelQueueReport','create','options','raw','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef0f,0x168));var _0xfef0=function(_0x2b8d32,_0x4fb31a){_0x2b8d32=_0x2b8d32-0x0;var _0x30f2eb=_0xef0f[_0x2b8d32];return _0x30f2eb;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad43e,_0x11dfd7,_0x5130bd){return new BPromise(function(_0x41ec94,_0x58cf6d){return client[_0xfef0('0xb')](_0xad43e,_0x5130bd)[_0xfef0('0xc')](function(_0x3a81cc){logger[_0xfef0('0xd')](_0xfef0('0xe'),_0x11dfd7,_0xfef0('0xf'));logger[_0xfef0('0x10')](_0xfef0('0x11'),_0x11dfd7,_0xfef0('0xf'),JSON[_0xfef0('0x12')](_0x3a81cc));if(_0x3a81cc[_0xfef0('0x13')]){if(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x14')]===0x1f4){logger[_0xfef0('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x11dfd7,_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);return _0x58cf6d(_0x3a81cc[_0xfef0('0x13')][_0xfef0('0x15')]);}logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x3a81cc[_0xfef0('0x13')]['message']);return _0x41ec94(_0x3a81cc[_0xfef0('0x13')]['message']);}else{logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x11dfd7,_0xfef0('0xf'));_0x41ec94(_0x3a81cc[_0xfef0('0x16')][_0xfef0('0x15')]);}})[_0xfef0('0x17')](function(_0x2a96d9){logger[_0xfef0('0x13')](_0xfef0('0xe'),_0x11dfd7,_0x2a96d9);_0x58cf6d(_0x2a96d9);});});}exports[_0xfef0('0x18')]=function(_0x581459){var _0xd60678=this;return new Promise(function(_0x1642cd,_0x1577fa){return db[_0xfef0('0x19')][_0xfef0('0x1a')](_0x581459['body'],{'raw':_0x581459[_0xfef0('0x1b')]?_0x581459['options'][_0xfef0('0x1c')]===undefined?!![]:![]:!![]})[_0xfef0('0xc')](function(_0x28dee1){logger['info'](_0xfef0('0x18'),_0x581459);logger['debug'](_0xfef0('0x18'),_0x581459,JSON[_0xfef0('0x12')](_0x28dee1));_0x1642cd(_0x28dee1);})['catch'](function(_0x4897af){logger['error'](_0xfef0('0x18'),_0x4897af['message'],_0x581459);_0x1577fa(_0xd60678[_0xfef0('0x13')](0x1f4,_0x4897af[_0xfef0('0x15')]));});});};exports[_0xfef0('0x1d')]=function(_0x4483f2){var _0x249fe4=this;return new Promise(function(_0xd687ed,_0x5c9085){return db['OpenchannelQueueReport'][_0xfef0('0x1e')](_0x4483f2[_0xfef0('0x1f')],{'raw':_0x4483f2[_0xfef0('0x1b')]?_0x4483f2[_0xfef0('0x1b')][_0xfef0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4483f2[_0xfef0('0x1b')]?_0x4483f2[_0xfef0('0x1b')][_0xfef0('0x20')]||null:null,'attributes':_0x4483f2[_0xfef0('0x1b')]?_0x4483f2['options'][_0xfef0('0x21')]||null:null,'limit':_0x4483f2[_0xfef0('0x1b')]?_0x4483f2[_0xfef0('0x1b')][_0xfef0('0x22')]||null:null})[_0xfef0('0xc')](function(_0x1ac4a3){logger[_0xfef0('0xd')](_0xfef0('0x1d'),_0x4483f2);logger[_0xfef0('0x10')](_0xfef0('0x1d'),_0x4483f2,JSON[_0xfef0('0x12')](_0x1ac4a3));_0xd687ed(_0x1ac4a3);})[_0xfef0('0x17')](function(_0x51af0f){logger[_0xfef0('0x13')]('UpdateOpenchannelQueueReport',_0x51af0f['message'],_0x4483f2);_0x5c9085(_0x249fe4[_0xfef0('0x13')](0x1f4,_0x51af0f[_0xfef0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index afd0401..b2b96d6 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(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x33c637,_0x597c26){var _0x14aa20=function(_0x32a8b5){while(--_0x32a8b5){_0x33c637['push'](_0x33c637['shift']());}};_0x14aa20(++_0x597c26);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'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 c559827..99c0554 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 _0x8b9b=['agent','queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x467a05,_0x23c7d3){var _0x149d54=function(_0x16e8ab){while(--_0x16e8ab){_0x467a05['push'](_0x467a05['shift']());}};_0x149d54(++_0x23c7d3);}(_0x8b9b,0x144));var _0xb8b9=function(_0x5cc3b6,_0x249e4f){_0x5cc3b6=_0x5cc3b6-0x0;var _0x3ea2e0=_0x8b9b[_0x5cc3b6];return _0x3ea2e0;};'use strict';var moment=require(_0xb8b9('0x0'));var Sequelize=require(_0xb8b9('0x1'));module[_0xb8b9('0x2')]={'uniqueid':{'type':Sequelize[_0xb8b9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb8b9('0x4')](_0xb8b9('0x5'),_0xb8b9('0x6'),_0xb8b9('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb8b9('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xb8b9('0x9')]}}; \ No newline at end of file +var _0xec4e=['account','agent','queue','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xec4e,0x9e));var _0xeec4=function(_0x24fa12,_0x4ae5bf){_0x24fa12=_0x24fa12-0x0;var _0x2ae0b5=_0xec4e[_0x24fa12];return _0x2ae0b5;};'use strict';var moment=require('moment');var Sequelize=require(_0xeec4('0x0'));module[_0xeec4('0x1')]={'uniqueid':{'type':Sequelize[_0xeec4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeec4('0x3')](_0xeec4('0x4'),_0xeec4('0x5'),_0xeec4('0x6')),'allowNull':![],'defaultValue':_0xeec4('0x6')},'transferredAt':{'type':Sequelize[_0xeec4('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xeec4('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 0c1d8f3..b86321a 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 _0xcfe5=['describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','update','destroy','then','error','name','send','map','OpenchannelTransferReport','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','includeAll','rows','show','params','include','options','find','catch','create','body'];(function(_0x5dfb47,_0x25bef7){var _0x2d42a6=function(_0x47cc28){while(--_0x47cc28){_0x5dfb47['push'](_0x5dfb47['shift']());}};_0x2d42a6(++_0x25bef7);}(_0xcfe5,0x1f2));var _0x5cfe=function(_0x14bd60,_0x73b2f9){_0x14bd60=_0x14bd60-0x0;var _0x4b0a31=_0xcfe5[_0x14bd60];return _0x4b0a31;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5cfe('0x0'));var rimraf=require(_0x5cfe('0x1'));var zipdir=require(_0x5cfe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5cfe('0x3'));var moment=require('moment');var BPromise=require(_0x5cfe('0x4'));var Mustache=require('mustache');var util=require(_0x5cfe('0x5'));var path=require(_0x5cfe('0x6'));var sox=require(_0x5cfe('0x7'));var csv=require(_0x5cfe('0x8'));var ejs=require(_0x5cfe('0x9'));var fs=require('fs');var _=require(_0x5cfe('0xa'));var squel=require(_0x5cfe('0xb'));var crypto=require(_0x5cfe('0xc'));var jsforce=require(_0x5cfe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5cfe('0x8'));var querystring=require(_0x5cfe('0xe'));var Papa=require(_0x5cfe('0xf'));var Redis=require(_0x5cfe('0x10'));var authService=require(_0x5cfe('0x11'));var qs=require(_0x5cfe('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cfe('0x13'));var logger=require(_0x5cfe('0x14'))(_0x5cfe('0x15'));var utils=require(_0x5cfe('0x16'));var config=require(_0x5cfe('0x17'));var db=require(_0x5cfe('0x18'))['db'];function respondWithStatusCode(_0x56d960,_0xebef56){_0xebef56=_0xebef56||0xcc;return function(_0x5c8b1e){if(_0x5c8b1e){return _0x56d960[_0x5cfe('0x19')](_0xebef56);}return _0x56d960[_0x5cfe('0x1a')](_0xebef56)[_0x5cfe('0x1b')]();};}function respondWithResult(_0x209342,_0x42431a){_0x42431a=_0x42431a||0xc8;return function(_0x329f52){if(_0x329f52){return _0x209342[_0x5cfe('0x1a')](_0x42431a)[_0x5cfe('0x1c')](_0x329f52);}};}function respondWithFilteredResult(_0x47f52e,_0x5db3da){return function(_0x2a19af){if(_0x2a19af){var _0x424b98=_0x2a19af[_0x5cfe('0x1d')],_0x279636=_0x5db3da[_0x5cfe('0x1e')],_0x5c615d=_0x5db3da[_0x5cfe('0x1e')]+_0x5db3da[_0x5cfe('0x1f')],_0x415716;if(_0x5c615d>=_0x424b98){_0x5c615d=_0x424b98;_0x415716=0xc8;}else{_0x415716=0xce;}_0x47f52e['status'](_0x415716);return _0x47f52e[_0x5cfe('0x20')](_0x5cfe('0x21'),_0x279636+'-'+_0x5c615d+'/'+_0x424b98)[_0x5cfe('0x1c')](_0x2a19af);}return null;};}function patchUpdates(_0x268f68){return function(_0x5840de){try{jsonpatch['apply'](_0x5840de,_0x268f68,!![]);}catch(_0x13a095){return BPromise['reject'](_0x13a095);}return _0x5840de['save']();};}function saveUpdates(_0xee2bbd,_0x51b3b4){return function(_0x7a51ba){if(_0x7a51ba){return _0x7a51ba[_0x5cfe('0x22')](_0xee2bbd)['then'](function(_0x130f7e){return _0x130f7e;});}return null;};}function removeEntity(_0x33f75b,_0x3a38c3){return function(_0x4bb23a){if(_0x4bb23a){return _0x4bb23a[_0x5cfe('0x23')]()[_0x5cfe('0x24')](function(){_0x33f75b['status'](0xcc)[_0x5cfe('0x1b')]();});}};}function handleEntityNotFound(_0x2e9982,_0x2ef75f){return function(_0x292d94){if(!_0x292d94){_0x2e9982[_0x5cfe('0x19')](0x194);}return _0x292d94;};}function handleError(_0xaa258b,_0xaf5735){_0xaf5735=_0xaf5735||0x1f4;return function(_0x1f5189){logger[_0x5cfe('0x25')](_0x1f5189['stack']);if(_0x1f5189[_0x5cfe('0x26')]){delete _0x1f5189[_0x5cfe('0x26')];}_0xaa258b['status'](_0xaf5735)[_0x5cfe('0x27')](_0x1f5189);};}exports['index']=function(_0x43d65b,_0x524f0f){var _0x4940f4={},_0x161f9b={},_0x32a5b7={'count':0x0,'rows':[]};var _0x3cc406=_[_0x5cfe('0x28')](db[_0x5cfe('0x29')][_0x5cfe('0x2a')],function(_0x575313){return{'name':_0x575313['fieldName'],'type':_0x575313[_0x5cfe('0x2b')]['key']};});_0x161f9b[_0x5cfe('0x2c')]=_[_0x5cfe('0x28')](_0x3cc406,_0x5cfe('0x26'));_0x161f9b['query']=_[_0x5cfe('0x2d')](_0x43d65b[_0x5cfe('0x2e')]);_0x161f9b[_0x5cfe('0x2f')]=_[_0x5cfe('0x30')](_0x161f9b['model'],_0x161f9b[_0x5cfe('0x2e')]);_0x4940f4[_0x5cfe('0x31')]=_['intersection'](_0x161f9b[_0x5cfe('0x2c')],qs[_0x5cfe('0x32')](_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x32')]));_0x4940f4[_0x5cfe('0x31')]=_0x4940f4['attributes'][_0x5cfe('0x33')]?_0x4940f4['attributes']:_0x161f9b[_0x5cfe('0x2c')];if(!_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x34')](_0x5cfe('0x35'))){_0x4940f4['limit']=qs[_0x5cfe('0x1f')](_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x1f')]);_0x4940f4[_0x5cfe('0x1e')]=qs[_0x5cfe('0x1e')](_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x1e')]);}_0x4940f4[_0x5cfe('0x36')]=qs[_0x5cfe('0x37')](_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x37')]);_0x4940f4['where']=qs[_0x5cfe('0x2f')](_['pick'](_0x43d65b[_0x5cfe('0x2e')],_0x161f9b[_0x5cfe('0x2f')]),_0x3cc406);if(_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x38')]){_0x4940f4['where']=_[_0x5cfe('0x39')](_0x4940f4[_0x5cfe('0x3a')],{'$or':_[_0x5cfe('0x28')](_0x3cc406,function(_0x54c580){if(_0x54c580[_0x5cfe('0x2b')]!==_0x5cfe('0x3b')){var _0x378cbb={};_0x378cbb[_0x54c580[_0x5cfe('0x26')]]={'$like':'%'+_0x43d65b['query'][_0x5cfe('0x38')]+'%'};return _0x378cbb;}})});}_0x4940f4=_['merge']({},_0x4940f4,_0x43d65b['options']);var _0x5ac0ed={'where':_0x4940f4[_0x5cfe('0x3a')]};return db[_0x5cfe('0x29')]['count'](_0x5ac0ed)[_0x5cfe('0x24')](function(_0x5dae23){_0x32a5b7[_0x5cfe('0x1d')]=_0x5dae23;if(_0x43d65b[_0x5cfe('0x2e')][_0x5cfe('0x3c')]){_0x4940f4['include']=[{'all':!![]}];}return db[_0x5cfe('0x29')]['findAll'](_0x4940f4);})[_0x5cfe('0x24')](function(_0x1019bf){_0x32a5b7[_0x5cfe('0x3d')]=_0x1019bf;return _0x32a5b7;})[_0x5cfe('0x24')](respondWithFilteredResult(_0x524f0f,_0x4940f4))['catch'](handleError(_0x524f0f,null));};exports[_0x5cfe('0x3e')]=function(_0x465107,_0x5aa7d4){var _0x4adc7b={'raw':!![],'where':{'id':_0x465107[_0x5cfe('0x3f')]['id']}},_0x11646b={};_0x11646b[_0x5cfe('0x2c')]=_[_0x5cfe('0x2d')](db[_0x5cfe('0x29')][_0x5cfe('0x2a')]);_0x11646b[_0x5cfe('0x2e')]=_['keys'](_0x465107[_0x5cfe('0x2e')]);_0x11646b[_0x5cfe('0x2f')]=_[_0x5cfe('0x30')](_0x11646b[_0x5cfe('0x2c')],_0x11646b[_0x5cfe('0x2e')]);_0x4adc7b['attributes']=_[_0x5cfe('0x30')](_0x11646b[_0x5cfe('0x2c')],qs[_0x5cfe('0x32')](_0x465107[_0x5cfe('0x2e')][_0x5cfe('0x32')]));_0x4adc7b[_0x5cfe('0x31')]=_0x4adc7b[_0x5cfe('0x31')][_0x5cfe('0x33')]?_0x4adc7b[_0x5cfe('0x31')]:_0x11646b[_0x5cfe('0x2c')];if(_0x465107[_0x5cfe('0x2e')][_0x5cfe('0x3c')]){_0x4adc7b[_0x5cfe('0x40')]=[{'all':!![]}];}_0x4adc7b=_['merge']({},_0x4adc7b,_0x465107[_0x5cfe('0x41')]);return db[_0x5cfe('0x29')][_0x5cfe('0x42')](_0x4adc7b)['then'](handleEntityNotFound(_0x5aa7d4,null))['then'](respondWithResult(_0x5aa7d4,null))[_0x5cfe('0x43')](handleError(_0x5aa7d4,null));};exports[_0x5cfe('0x44')]=function(_0x2c0c46,_0x13999c){return db['OpenchannelTransferReport'][_0x5cfe('0x44')](_0x2c0c46[_0x5cfe('0x45')],{})[_0x5cfe('0x24')](respondWithResult(_0x13999c,0xc9))['catch'](handleError(_0x13999c,null));};exports[_0x5cfe('0x22')]=function(_0x3ca258,_0x181061){if(_0x3ca258['body']['id']){delete _0x3ca258[_0x5cfe('0x45')]['id'];}return db[_0x5cfe('0x29')][_0x5cfe('0x42')]({'where':{'id':_0x3ca258[_0x5cfe('0x3f')]['id']}})[_0x5cfe('0x24')](handleEntityNotFound(_0x181061,null))[_0x5cfe('0x24')](saveUpdates(_0x3ca258[_0x5cfe('0x45')],null))[_0x5cfe('0x24')](respondWithResult(_0x181061,null))[_0x5cfe('0x43')](handleError(_0x181061,null));};exports[_0x5cfe('0x23')]=function(_0x266c38,_0x485860){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x266c38[_0x5cfe('0x3f')]['id']}})[_0x5cfe('0x24')](handleEntityNotFound(_0x485860,null))[_0x5cfe('0x24')](removeEntity(_0x485860,null))[_0x5cfe('0x43')](handleError(_0x485860,null));};exports[_0x5cfe('0x46')]=function(_0x54e8a4,_0x393dc8){return db[_0x5cfe('0x29')][_0x5cfe('0x46')]()[_0x5cfe('0x24')](respondWithResult(_0x393dc8,null))[_0x5cfe('0x43')](handleError(_0x393dc8,null));}; \ No newline at end of file +var _0x3810=['find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','offset','limit','set','reject','save','update','then','destroy','error','name','index','OpenchannelTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','count','catch','params','includeAll'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x3810,0x1a2));var _0x0381=function(_0x310504,_0x26ad95){_0x310504=_0x310504-0x0;var _0x5b36d0=_0x3810[_0x310504];return _0x5b36d0;};'use strict';var pdf=require(_0x0381('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0381('0x1'));var zipdir=require(_0x0381('0x2'));var jsonpatch=require(_0x0381('0x3'));var rp=require(_0x0381('0x4'));var moment=require(_0x0381('0x5'));var BPromise=require(_0x0381('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0381('0x7'));var sox=require(_0x0381('0x8'));var csv=require(_0x0381('0x9'));var ejs=require(_0x0381('0xa'));var fs=require('fs');var _=require(_0x0381('0xb'));var squel=require(_0x0381('0xc'));var crypto=require(_0x0381('0xd'));var jsforce=require(_0x0381('0xe'));var deskjs=require(_0x0381('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0381('0x10'));var Papa=require(_0x0381('0x11'));var Redis=require(_0x0381('0x12'));var authService=require(_0x0381('0x13'));var qs=require(_0x0381('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0381('0x15'));var logger=require(_0x0381('0x16'))(_0x0381('0x17'));var utils=require('../../config/utils');var config=require(_0x0381('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3322f7,_0x2685da){_0x2685da=_0x2685da||0xcc;return function(_0x49b1a0){if(_0x49b1a0){return _0x3322f7[_0x0381('0x19')](_0x2685da);}return _0x3322f7[_0x0381('0x1a')](_0x2685da)[_0x0381('0x1b')]();};}function respondWithResult(_0x379954,_0x5e9dfa){_0x5e9dfa=_0x5e9dfa||0xc8;return function(_0x4603c2){if(_0x4603c2){return _0x379954[_0x0381('0x1a')](_0x5e9dfa)['json'](_0x4603c2);}};}function respondWithFilteredResult(_0x14ac3d,_0x43adad){return function(_0x2b3424){if(_0x2b3424){var _0x17a981=_0x2b3424['count'],_0x4f6a73=_0x43adad[_0x0381('0x1c')],_0x69d970=_0x43adad[_0x0381('0x1c')]+_0x43adad[_0x0381('0x1d')],_0x3a2423;if(_0x69d970>=_0x17a981){_0x69d970=_0x17a981;_0x3a2423=0xc8;}else{_0x3a2423=0xce;}_0x14ac3d['status'](_0x3a2423);return _0x14ac3d[_0x0381('0x1e')]('Content-Range',_0x4f6a73+'-'+_0x69d970+'/'+_0x17a981)['json'](_0x2b3424);}return null;};}function patchUpdates(_0x172281){return function(_0x7befb1){try{jsonpatch['apply'](_0x7befb1,_0x172281,!![]);}catch(_0x169ccf){return BPromise[_0x0381('0x1f')](_0x169ccf);}return _0x7befb1[_0x0381('0x20')]();};}function saveUpdates(_0x1c30d8,_0x531b0a){return function(_0xdb8390){if(_0xdb8390){return _0xdb8390[_0x0381('0x21')](_0x1c30d8)[_0x0381('0x22')](function(_0x276f7a){return _0x276f7a;});}return null;};}function removeEntity(_0x50d321,_0x1a7a61){return function(_0xc17913){if(_0xc17913){return _0xc17913[_0x0381('0x23')]()[_0x0381('0x22')](function(){_0x50d321['status'](0xcc)[_0x0381('0x1b')]();});}};}function handleEntityNotFound(_0x2ee69a,_0x46dd53){return function(_0x12efc1){if(!_0x12efc1){_0x2ee69a['sendStatus'](0x194);}return _0x12efc1;};}function handleError(_0x20b4a7,_0x10af8b){_0x10af8b=_0x10af8b||0x1f4;return function(_0x25c5f6){logger[_0x0381('0x24')](_0x25c5f6['stack']);if(_0x25c5f6[_0x0381('0x25')]){delete _0x25c5f6[_0x0381('0x25')];}_0x20b4a7['status'](_0x10af8b)['send'](_0x25c5f6);};}exports[_0x0381('0x26')]=function(_0x1410b8,_0x181c0d){var _0x55d6a1={},_0x1c89d8={},_0x3586b3={'count':0x0,'rows':[]};var _0x250271=_['map'](db[_0x0381('0x27')][_0x0381('0x28')],function(_0x3c85d3){return{'name':_0x3c85d3[_0x0381('0x29')],'type':_0x3c85d3['type'][_0x0381('0x2a')]};});_0x1c89d8[_0x0381('0x2b')]=_[_0x0381('0x2c')](_0x250271,_0x0381('0x25'));_0x1c89d8[_0x0381('0x2d')]=_[_0x0381('0x2e')](_0x1410b8['query']);_0x1c89d8[_0x0381('0x2f')]=_['intersection'](_0x1c89d8[_0x0381('0x2b')],_0x1c89d8[_0x0381('0x2d')]);_0x55d6a1[_0x0381('0x30')]=_[_0x0381('0x31')](_0x1c89d8[_0x0381('0x2b')],qs[_0x0381('0x32')](_0x1410b8['query']['fields']));_0x55d6a1[_0x0381('0x30')]=_0x55d6a1[_0x0381('0x30')][_0x0381('0x33')]?_0x55d6a1[_0x0381('0x30')]:_0x1c89d8['model'];if(!_0x1410b8[_0x0381('0x2d')][_0x0381('0x34')](_0x0381('0x35'))){_0x55d6a1['limit']=qs[_0x0381('0x1d')](_0x1410b8[_0x0381('0x2d')][_0x0381('0x1d')]);_0x55d6a1['offset']=qs[_0x0381('0x1c')](_0x1410b8[_0x0381('0x2d')][_0x0381('0x1c')]);}_0x55d6a1[_0x0381('0x36')]=qs[_0x0381('0x37')](_0x1410b8[_0x0381('0x2d')][_0x0381('0x37')]);_0x55d6a1[_0x0381('0x38')]=qs['filters'](_[_0x0381('0x39')](_0x1410b8[_0x0381('0x2d')],_0x1c89d8[_0x0381('0x2f')]),_0x250271);if(_0x1410b8[_0x0381('0x2d')]['filter']){_0x55d6a1[_0x0381('0x38')]=_[_0x0381('0x3a')](_0x55d6a1[_0x0381('0x38')],{'$or':_[_0x0381('0x2c')](_0x250271,function(_0x278bab){if(_0x278bab['type']!=='VIRTUAL'){var _0x184432={};_0x184432[_0x278bab[_0x0381('0x25')]]={'$like':'%'+_0x1410b8[_0x0381('0x2d')][_0x0381('0x3b')]+'%'};return _0x184432;}})});}_0x55d6a1=_[_0x0381('0x3a')]({},_0x55d6a1,_0x1410b8[_0x0381('0x3c')]);var _0x3641e6={'where':_0x55d6a1[_0x0381('0x38')]};return db['OpenchannelTransferReport'][_0x0381('0x3d')](_0x3641e6)[_0x0381('0x22')](function(_0xb19f85){_0x3586b3[_0x0381('0x3d')]=_0xb19f85;if(_0x1410b8[_0x0381('0x2d')]['includeAll']){_0x55d6a1['include']=[{'all':!![]}];}return db[_0x0381('0x27')]['findAll'](_0x55d6a1);})['then'](function(_0x152703){_0x3586b3['rows']=_0x152703;return _0x3586b3;})[_0x0381('0x22')](respondWithFilteredResult(_0x181c0d,_0x55d6a1))[_0x0381('0x3e')](handleError(_0x181c0d,null));};exports['show']=function(_0x32f45a,_0x2e1e60){var _0x32a9ea={'raw':!![],'where':{'id':_0x32f45a[_0x0381('0x3f')]['id']}},_0x1f0d2d={};_0x1f0d2d['model']=_[_0x0381('0x2e')](db[_0x0381('0x27')][_0x0381('0x28')]);_0x1f0d2d[_0x0381('0x2d')]=_[_0x0381('0x2e')](_0x32f45a[_0x0381('0x2d')]);_0x1f0d2d[_0x0381('0x2f')]=_[_0x0381('0x31')](_0x1f0d2d[_0x0381('0x2b')],_0x1f0d2d[_0x0381('0x2d')]);_0x32a9ea[_0x0381('0x30')]=_[_0x0381('0x31')](_0x1f0d2d[_0x0381('0x2b')],qs[_0x0381('0x32')](_0x32f45a[_0x0381('0x2d')]['fields']));_0x32a9ea['attributes']=_0x32a9ea['attributes'][_0x0381('0x33')]?_0x32a9ea['attributes']:_0x1f0d2d[_0x0381('0x2b')];if(_0x32f45a[_0x0381('0x2d')][_0x0381('0x40')]){_0x32a9ea['include']=[{'all':!![]}];}_0x32a9ea=_['merge']({},_0x32a9ea,_0x32f45a[_0x0381('0x3c')]);return db[_0x0381('0x27')][_0x0381('0x41')](_0x32a9ea)[_0x0381('0x22')](handleEntityNotFound(_0x2e1e60,null))[_0x0381('0x22')](respondWithResult(_0x2e1e60,null))[_0x0381('0x3e')](handleError(_0x2e1e60,null));};exports[_0x0381('0x42')]=function(_0x567e0a,_0x513949){return db['OpenchannelTransferReport'][_0x0381('0x42')](_0x567e0a[_0x0381('0x43')],{})['then'](respondWithResult(_0x513949,0xc9))[_0x0381('0x3e')](handleError(_0x513949,null));};exports[_0x0381('0x21')]=function(_0x53b567,_0x3cfc67){if(_0x53b567['body']['id']){delete _0x53b567['body']['id'];}return db[_0x0381('0x27')][_0x0381('0x41')]({'where':{'id':_0x53b567[_0x0381('0x3f')]['id']}})[_0x0381('0x22')](handleEntityNotFound(_0x3cfc67,null))[_0x0381('0x22')](saveUpdates(_0x53b567['body'],null))[_0x0381('0x22')](respondWithResult(_0x3cfc67,null))[_0x0381('0x3e')](handleError(_0x3cfc67,null));};exports[_0x0381('0x23')]=function(_0x6b9e49,_0x262f79){return db[_0x0381('0x27')][_0x0381('0x41')]({'where':{'id':_0x6b9e49[_0x0381('0x3f')]['id']}})[_0x0381('0x22')](handleEntityNotFound(_0x262f79,null))[_0x0381('0x22')](removeEntity(_0x262f79,null))[_0x0381('0x3e')](handleError(_0x262f79,null));};exports[_0x0381('0x44')]=function(_0x577e61,_0x15f68d){return db[_0x0381('0x27')][_0x0381('0x44')]()[_0x0381('0x22')](respondWithResult(_0x15f68d,null))['catch'](handleError(_0x15f68d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 08a4822..0a520e4 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 _0xfdcd=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xdfdc('0x0'));var logger=require(_0xdfdc('0x1'))(_0xdfdc('0x2'));var moment=require('moment');var BPromise=require(_0xdfdc('0x3'));var rp=require(_0xdfdc('0x4'));var fs=require('fs');var path=require(_0xdfdc('0x5'));var rimraf=require(_0xdfdc('0x6'));var config=require(_0xdfdc('0x7'));var attributes=require(_0xdfdc('0x8'));module[_0xdfdc('0x9')]=function(_0x31b119,_0x1984bf){return _0x31b119[_0xdfdc('0xa')](_0xdfdc('0xb'),attributes,{'tableName':_0xdfdc('0xc'),'paranoid':![],'indexes':[{'name':_0xdfdc('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b47=['lodash','util','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','uniqueid'];(function(_0x515e2b,_0xb4a2b5){var _0xc74bef=function(_0x43d02b){while(--_0x43d02b){_0x515e2b['push'](_0x515e2b['shift']());}};_0xc74bef(++_0xb4a2b5);}(_0x5b47,0x120));var _0x75b4=function(_0x243945,_0x17705d){_0x243945=_0x243945-0x0;var _0x3034d2=_0x5b47[_0x243945];return _0x3034d2;};'use strict';var _=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));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(_0x75b4('0x2'));var rimraf=require(_0x75b4('0x3'));var config=require(_0x75b4('0x4'));var attributes=require(_0x75b4('0x5'));module[_0x75b4('0x6')]=function(_0x5f544a,_0x5ee223){return _0x5f544a['define'](_0x75b4('0x7'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x75b4('0x8'),'fields':[_0x75b4('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9211304..408ccf3 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 _0x27e3=['error','code','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3c769d,_0x215272){var _0x1c19e2=function(_0x3ddc0d){while(--_0x3ddc0d){_0x3c769d['push'](_0x3c769d['shift']());}};_0x1c19e2(++_0x215272);}(_0x27e3,0x15d));var _0x327e=function(_0x5104bc,_0x257a07){_0x5104bc=_0x5104bc-0x0;var _0xf32f36=_0x27e3[_0x5104bc];return _0xf32f36;};'use strict';var _=require('lodash');var util=require(_0x327e('0x0'));var moment=require(_0x327e('0x1'));var BPromise=require(_0x327e('0x2'));var rs=require(_0x327e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x327e('0x4'))['db'];var utils=require(_0x327e('0x5'));var logger=require(_0x327e('0x6'))(_0x327e('0x7'));var config=require(_0x327e('0x8'));var jayson=require(_0x327e('0x9'));var client=jayson[_0x327e('0xa')][_0x327e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d72d2,_0x3b56e9,_0x47b4a4){return new BPromise(function(_0x561ba9,_0x5e8aa3){return client[_0x327e('0xc')](_0x2d72d2,_0x47b4a4)[_0x327e('0xd')](function(_0x4cfd1d){logger[_0x327e('0xe')](_0x327e('0xf'),_0x3b56e9,_0x327e('0x10'));logger[_0x327e('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x3b56e9,_0x327e('0x10'),JSON[_0x327e('0x12')](_0x4cfd1d));if(_0x4cfd1d[_0x327e('0x13')]){if(_0x4cfd1d[_0x327e('0x13')][_0x327e('0x14')]===0x1f4){logger[_0x327e('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3b56e9,_0x4cfd1d[_0x327e('0x13')][_0x327e('0x15')]);return _0x5e8aa3(_0x4cfd1d[_0x327e('0x13')][_0x327e('0x15')]);}logger[_0x327e('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3b56e9,_0x4cfd1d[_0x327e('0x13')]['message']);return _0x561ba9(_0x4cfd1d[_0x327e('0x13')][_0x327e('0x15')]);}else{logger[_0x327e('0xe')](_0x327e('0xf'),_0x3b56e9,_0x327e('0x10'));_0x561ba9(_0x4cfd1d[_0x327e('0x16')][_0x327e('0x15')]);}})['catch'](function(_0x567423){logger['error'](_0x327e('0xf'),_0x3b56e9,_0x567423);_0x5e8aa3(_0x567423);});});} \ No newline at end of file +var _0x4d1b=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x29ebf4,_0x38489d){var _0x18f197=function(_0x4449c3){while(--_0x4449c3){_0x29ebf4['push'](_0x29ebf4['shift']());}};_0x18f197(++_0x38489d);}(_0x4d1b,0x128));var _0xb4d1=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0x4d1b[_0x364b32];return _0x3f3ea0;};'use strict';var _=require(_0xb4d1('0x0'));var util=require(_0xb4d1('0x1'));var moment=require('moment');var BPromise=require(_0xb4d1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4d1('0x3'));var db=require(_0xb4d1('0x4'))['db'];var utils=require(_0xb4d1('0x5'));var logger=require(_0xb4d1('0x6'))(_0xb4d1('0x7'));var config=require(_0xb4d1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb4d1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c02c7,_0x52f371,_0x102ced){return new BPromise(function(_0x4cab1d,_0x301b90){return client[_0xb4d1('0xa')](_0x5c02c7,_0x102ced)['then'](function(_0x953c59){logger['info'](_0xb4d1('0xb'),_0x52f371,_0xb4d1('0xc'));logger[_0xb4d1('0xd')](_0xb4d1('0xe'),_0x52f371,_0xb4d1('0xc'),JSON['stringify'](_0x953c59));if(_0x953c59[_0xb4d1('0xf')]){if(_0x953c59['error'][_0xb4d1('0x10')]===0x1f4){logger[_0xb4d1('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x52f371,_0x953c59['error'][_0xb4d1('0x11')]);return _0x301b90(_0x953c59[_0xb4d1('0xf')][_0xb4d1('0x11')]);}logger[_0xb4d1('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x52f371,_0x953c59[_0xb4d1('0xf')][_0xb4d1('0x11')]);return _0x4cab1d(_0x953c59[_0xb4d1('0xf')]['message']);}else{logger[_0xb4d1('0x12')](_0xb4d1('0xb'),_0x52f371,'request\x20sent');_0x4cab1d(_0x953c59[_0xb4d1('0x13')][_0xb4d1('0x11')]);}})[_0xb4d1('0x14')](function(_0x52c24b){logger[_0xb4d1('0xf')](_0xb4d1('0xb'),_0x52f371,_0x52c24b);_0x301b90(_0x52c24b);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 014c17f..cf34947 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 _0xe475=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x348e4b,_0x1785d0){var _0x1b6669=function(_0x484c2e){while(--_0x484c2e){_0x348e4b['push'](_0x348e4b['shift']());}};_0x1b6669(++_0x1785d0);}(_0xe475,0x117));var _0x5e47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe475[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5e47('0x0'));var path=require(_0x5e47('0x1'));var timeout=require(_0x5e47('0x2'));var express=require('express');var router=express[_0x5e47('0x3')]();var auth=require(_0x5e47('0x4'));var interaction=require(_0x5e47('0x5'));var config=require(_0x5e47('0x6'));var controller=require(_0x5e47('0x7'));router[_0x5e47('0x8')]('/',auth[_0x5e47('0x9')](),controller[_0x5e47('0xa')]);router[_0x5e47('0x8')](_0x5e47('0xb'),auth[_0x5e47('0x9')](),controller[_0x5e47('0xc')]);router[_0x5e47('0xd')]('/',auth[_0x5e47('0x9')](),controller[_0x5e47('0xe')]);router[_0x5e47('0xf')]('/:id',auth[_0x5e47('0x9')](),controller[_0x5e47('0x10')]);router[_0x5e47('0x11')](_0x5e47('0xb'),auth['isAuthenticated'](),controller[_0x5e47('0x12')]);module[_0x5e47('0x13')]=router; \ No newline at end of file +var _0xa3b8=['../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x3d1203,_0xdca475){var _0x56166e=function(_0x4d51cd){while(--_0x4d51cd){_0x3d1203['push'](_0x3d1203['shift']());}};_0x56166e(++_0xdca475);}(_0xa3b8,0x19c));var _0x8a3b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa3b8[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x8a3b('0x0'));var util=require(_0x8a3b('0x1'));var path=require(_0x8a3b('0x2'));var timeout=require('connect-timeout');var express=require(_0x8a3b('0x3'));var router=express[_0x8a3b('0x4')]();var auth=require(_0x8a3b('0x5'));var interaction=require(_0x8a3b('0x6'));var config=require(_0x8a3b('0x7'));var controller=require(_0x8a3b('0x8'));router[_0x8a3b('0x9')]('/',auth['isAuthenticated'](),controller[_0x8a3b('0xa')]);router['get'](_0x8a3b('0xb'),auth[_0x8a3b('0xc')](),controller['show']);router[_0x8a3b('0xd')]('/',auth[_0x8a3b('0xc')](),controller[_0x8a3b('0xe')]);router['put'](_0x8a3b('0xb'),auth[_0x8a3b('0xc')](),controller[_0x8a3b('0xf')]);router[_0x8a3b('0x10')](_0x8a3b('0xb'),auth[_0x8a3b('0xc')](),controller[_0x8a3b('0x11')]);module[_0x8a3b('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index ca080d8..435a47d 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 _0x0262=['exports','STRING','name','sequelize'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0x0262,0x19b));var _0x2026=function(_0x29fb28,_0x5177d5){_0x29fb28=_0x29fb28-0x0;var _0x1d488f=_0x0262[_0x29fb28];return _0x1d488f;};'use strict';var Sequelize=require(_0x2026('0x0'));module[_0x2026('0x1')]={'name':{'type':Sequelize[_0x2026('0x2')],'unique':_0x2026('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2026('0x2')]}}; \ No newline at end of file +var _0x08e4=['name','STRING','sequelize','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x08e4,0x1de));var _0x408e=function(_0x520a87,_0x2f84d0){_0x520a87=_0x520a87-0x0;var _0x5e10b0=_0x08e4[_0x520a87];return _0x5e10b0;};'use strict';var Sequelize=require(_0x408e('0x0'));module[_0x408e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x408e('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x408e('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 2eb73c3..5a09dda 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 _0x2d1c=['to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','Pause','count','includeAll','include','rows','catch','show','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','crypto','desk.js'];(function(_0xecbbdb,_0x42f39c){var _0x360ded=function(_0x1ec20b){while(--_0x1ec20b){_0xecbbdb['push'](_0xecbbdb['shift']());}};_0x360ded(++_0x42f39c);}(_0x2d1c,0x1d4));var _0xc2d1=function(_0x1680ab,_0x36558f){_0x1680ab=_0x1680ab-0x0;var _0x1fc2d2=_0x2d1c[_0x1680ab];return _0x1fc2d2;};'use strict';var pdf=require(_0xc2d1('0x0'));var emlformat=require(_0xc2d1('0x1'));var rimraf=require(_0xc2d1('0x2'));var zipdir=require(_0xc2d1('0x3'));var jsonpatch=require(_0xc2d1('0x4'));var rp=require(_0xc2d1('0x5'));var moment=require('moment');var BPromise=require(_0xc2d1('0x6'));var Mustache=require('mustache');var util=require(_0xc2d1('0x7'));var path=require(_0xc2d1('0x8'));var sox=require(_0xc2d1('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc2d1('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc2d1('0xb'));var toCsv=require(_0xc2d1('0xc'));var querystring=require(_0xc2d1('0xd'));var Papa=require(_0xc2d1('0xe'));var Redis=require(_0xc2d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc2d1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc2d1('0x11'));var utils=require(_0xc2d1('0x12'));var config=require(_0xc2d1('0x13'));var db=require(_0xc2d1('0x14'))['db'];function respondWithStatusCode(_0x1c4bfa,_0x54b3ee){_0x54b3ee=_0x54b3ee||0xcc;return function(_0x4c01fc){if(_0x4c01fc){return _0x1c4bfa[_0xc2d1('0x15')](_0x54b3ee);}return _0x1c4bfa[_0xc2d1('0x16')](_0x54b3ee)[_0xc2d1('0x17')]();};}function respondWithResult(_0x4bae8c,_0x4a3f6){_0x4a3f6=_0x4a3f6||0xc8;return function(_0x18bdaa){if(_0x18bdaa){return _0x4bae8c['status'](_0x4a3f6)[_0xc2d1('0x18')](_0x18bdaa);}};}function respondWithFilteredResult(_0x345549,_0x501730){return function(_0x273f94){if(_0x273f94){var _0x386b0f=_0x273f94['count'],_0x5cf597=_0x501730[_0xc2d1('0x19')],_0x45ae20=_0x501730[_0xc2d1('0x19')]+_0x501730[_0xc2d1('0x1a')],_0x5695d6;if(_0x45ae20>=_0x386b0f){_0x45ae20=_0x386b0f;_0x5695d6=0xc8;}else{_0x5695d6=0xce;}_0x345549[_0xc2d1('0x16')](_0x5695d6);return _0x345549[_0xc2d1('0x1b')](_0xc2d1('0x1c'),_0x5cf597+'-'+_0x45ae20+'/'+_0x386b0f)[_0xc2d1('0x18')](_0x273f94);}return null;};}function patchUpdates(_0x30f6a8){return function(_0x433bab){try{jsonpatch['apply'](_0x433bab,_0x30f6a8,!![]);}catch(_0x33ad5b){return BPromise[_0xc2d1('0x1d')](_0x33ad5b);}return _0x433bab[_0xc2d1('0x1e')]();};}function saveUpdates(_0x1caf4b,_0x4bb415){return function(_0x9970f8){if(_0x9970f8){return _0x9970f8[_0xc2d1('0x1f')](_0x1caf4b)[_0xc2d1('0x20')](function(_0x5c0630){return _0x5c0630;});}return null;};}function removeEntity(_0x3dc505,_0x405b39){return function(_0x314063){if(_0x314063){return _0x314063[_0xc2d1('0x21')]()['then'](function(){var _0x576068=_0x314063[_0xc2d1('0x22')]({'plain':!![]});var _0x4a420d=_0xc2d1('0x23');return db[_0xc2d1('0x24')]['destroy']({'where':{'type':_0x4a420d,'resourceId':_0x576068['id']}})[_0xc2d1('0x20')](function(){return _0x314063;});})[_0xc2d1('0x20')](function(){_0x3dc505[_0xc2d1('0x16')](0xcc)[_0xc2d1('0x17')]();});}};}function handleEntityNotFound(_0x375941,_0x245c17){return function(_0x2a5fe5){if(!_0x2a5fe5){_0x375941[_0xc2d1('0x15')](0x194);}return _0x2a5fe5;};}function handleError(_0x2199c2,_0x3ecc9b){_0x3ecc9b=_0x3ecc9b||0x1f4;return function(_0x12fe22){logger[_0xc2d1('0x25')](_0x12fe22[_0xc2d1('0x26')]);if(_0x12fe22[_0xc2d1('0x27')]){delete _0x12fe22[_0xc2d1('0x27')];}_0x2199c2[_0xc2d1('0x16')](_0x3ecc9b)['send'](_0x12fe22);};}exports[_0xc2d1('0x28')]=function(_0xc03b1c,_0x3b1393){var _0xebee9d={},_0xd053f1={},_0x1c95bd={'count':0x0,'rows':[]};var _0x2dc63c=_[_0xc2d1('0x29')](db['Pause'][_0xc2d1('0x2a')],function(_0x4cf2e8){return{'name':_0x4cf2e8[_0xc2d1('0x2b')],'type':_0x4cf2e8[_0xc2d1('0x2c')][_0xc2d1('0x2d')]};});_0xd053f1[_0xc2d1('0x2e')]=_[_0xc2d1('0x29')](_0x2dc63c,_0xc2d1('0x27'));_0xd053f1[_0xc2d1('0x2f')]=_[_0xc2d1('0x30')](_0xc03b1c[_0xc2d1('0x2f')]);_0xd053f1[_0xc2d1('0x31')]=_[_0xc2d1('0x32')](_0xd053f1[_0xc2d1('0x2e')],_0xd053f1[_0xc2d1('0x2f')]);_0xebee9d['attributes']=_[_0xc2d1('0x32')](_0xd053f1[_0xc2d1('0x2e')],qs[_0xc2d1('0x33')](_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x33')]));_0xebee9d[_0xc2d1('0x34')]=_0xebee9d['attributes']['length']?_0xebee9d[_0xc2d1('0x34')]:_0xd053f1[_0xc2d1('0x2e')];if(!_0xc03b1c[_0xc2d1('0x2f')]['hasOwnProperty'](_0xc2d1('0x35'))){_0xebee9d[_0xc2d1('0x1a')]=qs[_0xc2d1('0x1a')](_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x1a')]);_0xebee9d[_0xc2d1('0x19')]=qs[_0xc2d1('0x19')](_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x19')]);}_0xebee9d[_0xc2d1('0x36')]=qs[_0xc2d1('0x37')](_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x37')]);_0xebee9d['where']=qs[_0xc2d1('0x31')](_[_0xc2d1('0x38')](_0xc03b1c[_0xc2d1('0x2f')],_0xd053f1[_0xc2d1('0x31')]),_0x2dc63c);if(_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x39')]){_0xebee9d['where']=_[_0xc2d1('0x3a')](_0xebee9d['where'],{'$or':_[_0xc2d1('0x29')](_0x2dc63c,function(_0x40fdea){if(_0x40fdea[_0xc2d1('0x2c')]!==_0xc2d1('0x3b')){var _0x214c7d={};_0x214c7d[_0x40fdea[_0xc2d1('0x27')]]={'$like':'%'+_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x39')]+'%'};return _0x214c7d;}})});}_0xebee9d=_[_0xc2d1('0x3a')]({},_0xebee9d,_0xc03b1c[_0xc2d1('0x3c')]);var _0x1dced8={'where':_0xebee9d[_0xc2d1('0x3d')]};return db[_0xc2d1('0x3e')][_0xc2d1('0x3f')](_0x1dced8)['then'](function(_0x165e01){_0x1c95bd['count']=_0x165e01;if(_0xc03b1c[_0xc2d1('0x2f')][_0xc2d1('0x40')]){_0xebee9d[_0xc2d1('0x41')]=[{'all':!![]}];}return db[_0xc2d1('0x3e')]['findAll'](_0xebee9d);})[_0xc2d1('0x20')](function(_0x402b71){_0x1c95bd[_0xc2d1('0x42')]=_0x402b71;return _0x1c95bd;})[_0xc2d1('0x20')](respondWithFilteredResult(_0x3b1393,_0xebee9d))[_0xc2d1('0x43')](handleError(_0x3b1393,null));};exports[_0xc2d1('0x44')]=function(_0x481761,_0x40e2b4){var _0x581e9d={'raw':!![],'where':{'id':_0x481761['params']['id']}},_0x53ca75={};_0x53ca75[_0xc2d1('0x2e')]=_[_0xc2d1('0x30')](db['Pause'][_0xc2d1('0x2a')]);_0x53ca75[_0xc2d1('0x2f')]=_[_0xc2d1('0x30')](_0x481761[_0xc2d1('0x2f')]);_0x53ca75[_0xc2d1('0x31')]=_[_0xc2d1('0x32')](_0x53ca75[_0xc2d1('0x2e')],_0x53ca75[_0xc2d1('0x2f')]);_0x581e9d[_0xc2d1('0x34')]=_[_0xc2d1('0x32')](_0x53ca75[_0xc2d1('0x2e')],qs[_0xc2d1('0x33')](_0x481761[_0xc2d1('0x2f')]['fields']));_0x581e9d[_0xc2d1('0x34')]=_0x581e9d['attributes'][_0xc2d1('0x45')]?_0x581e9d[_0xc2d1('0x34')]:_0x53ca75[_0xc2d1('0x2e')];if(_0x481761[_0xc2d1('0x2f')][_0xc2d1('0x40')]){_0x581e9d[_0xc2d1('0x41')]=[{'all':!![]}];}_0x581e9d=_[_0xc2d1('0x3a')]({},_0x581e9d,_0x481761[_0xc2d1('0x3c')]);return db[_0xc2d1('0x3e')][_0xc2d1('0x46')](_0x581e9d)[_0xc2d1('0x20')](handleEntityNotFound(_0x40e2b4,null))[_0xc2d1('0x20')](respondWithResult(_0x40e2b4,null))['catch'](handleError(_0x40e2b4,null));};exports[_0xc2d1('0x47')]=function(_0x457ad2,_0x41887b){return db[_0xc2d1('0x3e')][_0xc2d1('0x47')](_0x457ad2[_0xc2d1('0x48')],{})[_0xc2d1('0x20')](function(_0x3d2d87){var _0x57ac51=_0x457ad2['user'][_0xc2d1('0x22')]({'plain':!![]});if(!_0x57ac51)throw new Error(_0xc2d1('0x49'));if(_0x57ac51[_0xc2d1('0x4a')]===_0xc2d1('0x4b')){var _0x3e46ca=_0x3d2d87[_0xc2d1('0x22')]({'plain':!![]});var _0x11021e=_0xc2d1('0x23');return db[_0xc2d1('0x4c')][_0xc2d1('0x46')]({'where':{'name':_0x11021e,'userProfileId':_0x57ac51[_0xc2d1('0x4d')]},'raw':!![]})[_0xc2d1('0x20')](function(_0x200c1a){if(_0x200c1a&&_0x200c1a[_0xc2d1('0x4e')]===0x0){return db[_0xc2d1('0x24')][_0xc2d1('0x47')]({'name':_0x3e46ca[_0xc2d1('0x27')],'resourceId':_0x3e46ca['id'],'type':_0x200c1a[_0xc2d1('0x27')],'sectionId':_0x200c1a['id']},{})[_0xc2d1('0x20')](function(){return _0x3d2d87;});}else{return _0x3d2d87;}})['catch'](function(_0x154da0){logger[_0xc2d1('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x154da0);throw _0x154da0;});}return _0x3d2d87;})[_0xc2d1('0x20')](respondWithResult(_0x41887b,0xc9))[_0xc2d1('0x43')](handleError(_0x41887b,null));};exports[_0xc2d1('0x1f')]=function(_0x5aeb24,_0xd76d96){if(_0x5aeb24[_0xc2d1('0x48')]['id']){delete _0x5aeb24[_0xc2d1('0x48')]['id'];}return db[_0xc2d1('0x3e')]['find']({'where':{'id':_0x5aeb24[_0xc2d1('0x4f')]['id']}})[_0xc2d1('0x20')](handleEntityNotFound(_0xd76d96,null))[_0xc2d1('0x20')](saveUpdates(_0x5aeb24[_0xc2d1('0x48')],null))['then'](respondWithResult(_0xd76d96,null))['catch'](handleError(_0xd76d96,null));};exports[_0xc2d1('0x21')]=function(_0x4bed59,_0x2dd115){return db[_0xc2d1('0x3e')][_0xc2d1('0x46')]({'where':{'id':_0x4bed59[_0xc2d1('0x4f')]['id']}})[_0xc2d1('0x20')](handleEntityNotFound(_0x2dd115,null))[_0xc2d1('0x20')](removeEntity(_0x2dd115,null))[_0xc2d1('0x43')](handleError(_0x2dd115,null));}; \ No newline at end of file +var _0x6602=['rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','stack','name','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','findAll'];(function(_0x56b97a,_0x225e30){var _0x2fc140=function(_0x314fcb){while(--_0x314fcb){_0x56b97a['push'](_0x56b97a['shift']());}};_0x2fc140(++_0x225e30);}(_0x6602,0x194));var _0x2660=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x6602[_0x476bf4];return _0x788ffe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2660('0x0'));var zipdir=require(_0x2660('0x1'));var jsonpatch=require(_0x2660('0x2'));var rp=require('request-promise');var moment=require(_0x2660('0x3'));var BPromise=require(_0x2660('0x4'));var Mustache=require('mustache');var util=require(_0x2660('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2660('0x6'));var fs=require('fs');var _=require(_0x2660('0x7'));var squel=require(_0x2660('0x8'));var crypto=require('crypto');var jsforce=require(_0x2660('0x9'));var deskjs=require(_0x2660('0xa'));var toCsv=require(_0x2660('0xb'));var querystring=require(_0x2660('0xc'));var Papa=require('papaparse');var Redis=require(_0x2660('0xd'));var authService=require(_0x2660('0xe'));var qs=require(_0x2660('0xf'));var as=require(_0x2660('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2660('0x11'));var utils=require(_0x2660('0x12'));var config=require('../../config/environment');var db=require(_0x2660('0x13'))['db'];function respondWithStatusCode(_0x443239,_0x98a9ad){_0x98a9ad=_0x98a9ad||0xcc;return function(_0x3d4b06){if(_0x3d4b06){return _0x443239[_0x2660('0x14')](_0x98a9ad);}return _0x443239[_0x2660('0x15')](_0x98a9ad)[_0x2660('0x16')]();};}function respondWithResult(_0xd872a,_0xcd0d83){_0xcd0d83=_0xcd0d83||0xc8;return function(_0x5acff7){if(_0x5acff7){return _0xd872a['status'](_0xcd0d83)[_0x2660('0x17')](_0x5acff7);}};}function respondWithFilteredResult(_0x1ae55a,_0x3b3521){return function(_0x3c0bbf){if(_0x3c0bbf){var _0x36a102=_0x3c0bbf['count'],_0x6979dd=_0x3b3521[_0x2660('0x18')],_0x30cf42=_0x3b3521['offset']+_0x3b3521[_0x2660('0x19')],_0x245e17;if(_0x30cf42>=_0x36a102){_0x30cf42=_0x36a102;_0x245e17=0xc8;}else{_0x245e17=0xce;}_0x1ae55a['status'](_0x245e17);return _0x1ae55a[_0x2660('0x1a')](_0x2660('0x1b'),_0x6979dd+'-'+_0x30cf42+'/'+_0x36a102)[_0x2660('0x17')](_0x3c0bbf);}return null;};}function patchUpdates(_0xb19b6f){return function(_0x1f9a3f){try{jsonpatch[_0x2660('0x1c')](_0x1f9a3f,_0xb19b6f,!![]);}catch(_0x397c20){return BPromise['reject'](_0x397c20);}return _0x1f9a3f[_0x2660('0x1d')]();};}function saveUpdates(_0x59aaf3,_0x3676f2){return function(_0x2bd211){if(_0x2bd211){return _0x2bd211[_0x2660('0x1e')](_0x59aaf3)[_0x2660('0x1f')](function(_0x472a57){return _0x472a57;});}return null;};}function removeEntity(_0xd2f2d6,_0x542f10){return function(_0x22db03){if(_0x22db03){return _0x22db03[_0x2660('0x20')]()['then'](function(){var _0x5a1e8b=_0x22db03[_0x2660('0x21')]({'plain':!![]});var _0x2a5b3a=_0x2660('0x22');return db[_0x2660('0x23')][_0x2660('0x20')]({'where':{'type':_0x2a5b3a,'resourceId':_0x5a1e8b['id']}})[_0x2660('0x1f')](function(){return _0x22db03;});})[_0x2660('0x1f')](function(){_0xd2f2d6['status'](0xcc)[_0x2660('0x16')]();});}};}function handleEntityNotFound(_0x3014b8,_0x30234d){return function(_0x3bed06){if(!_0x3bed06){_0x3014b8[_0x2660('0x14')](0x194);}return _0x3bed06;};}function handleError(_0x558ddb,_0x192d38){_0x192d38=_0x192d38||0x1f4;return function(_0x83ed8b){logger['error'](_0x83ed8b[_0x2660('0x24')]);if(_0x83ed8b[_0x2660('0x25')]){delete _0x83ed8b[_0x2660('0x25')];}_0x558ddb['status'](_0x192d38)['send'](_0x83ed8b);};}exports[_0x2660('0x26')]=function(_0x159ba5,_0x4e58b0){var _0x43d98b={},_0x33b4c8={},_0x509eeb={'count':0x0,'rows':[]};var _0x1078d7=_['map'](db[_0x2660('0x27')][_0x2660('0x28')],function(_0x2713b2){return{'name':_0x2713b2[_0x2660('0x29')],'type':_0x2713b2[_0x2660('0x2a')][_0x2660('0x2b')]};});_0x33b4c8[_0x2660('0x2c')]=_[_0x2660('0x2d')](_0x1078d7,_0x2660('0x25'));_0x33b4c8[_0x2660('0x2e')]=_[_0x2660('0x2f')](_0x159ba5['query']);_0x33b4c8[_0x2660('0x30')]=_[_0x2660('0x31')](_0x33b4c8[_0x2660('0x2c')],_0x33b4c8[_0x2660('0x2e')]);_0x43d98b[_0x2660('0x32')]=_[_0x2660('0x31')](_0x33b4c8[_0x2660('0x2c')],qs[_0x2660('0x33')](_0x159ba5[_0x2660('0x2e')]['fields']));_0x43d98b[_0x2660('0x32')]=_0x43d98b[_0x2660('0x32')][_0x2660('0x34')]?_0x43d98b[_0x2660('0x32')]:_0x33b4c8[_0x2660('0x2c')];if(!_0x159ba5['query'][_0x2660('0x35')](_0x2660('0x36'))){_0x43d98b[_0x2660('0x19')]=qs[_0x2660('0x19')](_0x159ba5[_0x2660('0x2e')][_0x2660('0x19')]);_0x43d98b['offset']=qs[_0x2660('0x18')](_0x159ba5[_0x2660('0x2e')][_0x2660('0x18')]);}_0x43d98b[_0x2660('0x37')]=qs[_0x2660('0x38')](_0x159ba5[_0x2660('0x2e')]['sort']);_0x43d98b[_0x2660('0x39')]=qs[_0x2660('0x30')](_[_0x2660('0x3a')](_0x159ba5[_0x2660('0x2e')],_0x33b4c8[_0x2660('0x30')]),_0x1078d7);if(_0x159ba5[_0x2660('0x2e')][_0x2660('0x3b')]){_0x43d98b[_0x2660('0x39')]=_[_0x2660('0x3c')](_0x43d98b[_0x2660('0x39')],{'$or':_[_0x2660('0x2d')](_0x1078d7,function(_0x4dc0bd){if(_0x4dc0bd[_0x2660('0x2a')]!=='VIRTUAL'){var _0x175688={};_0x175688[_0x4dc0bd[_0x2660('0x25')]]={'$like':'%'+_0x159ba5[_0x2660('0x2e')][_0x2660('0x3b')]+'%'};return _0x175688;}})});}_0x43d98b=_[_0x2660('0x3c')]({},_0x43d98b,_0x159ba5['options']);var _0x553dcd={'where':_0x43d98b[_0x2660('0x39')]};return db[_0x2660('0x27')][_0x2660('0x3d')](_0x553dcd)['then'](function(_0xe452a0){_0x509eeb[_0x2660('0x3d')]=_0xe452a0;if(_0x159ba5['query']['includeAll']){_0x43d98b[_0x2660('0x3e')]=[{'all':!![]}];}return db['Pause'][_0x2660('0x3f')](_0x43d98b);})['then'](function(_0x197326){_0x509eeb[_0x2660('0x40')]=_0x197326;return _0x509eeb;})[_0x2660('0x1f')](respondWithFilteredResult(_0x4e58b0,_0x43d98b))[_0x2660('0x41')](handleError(_0x4e58b0,null));};exports[_0x2660('0x42')]=function(_0x3251cb,_0xc1db87){var _0x41b424={'raw':!![],'where':{'id':_0x3251cb[_0x2660('0x43')]['id']}},_0x304e97={};_0x304e97[_0x2660('0x2c')]=_['keys'](db['Pause']['rawAttributes']);_0x304e97['query']=_[_0x2660('0x2f')](_0x3251cb[_0x2660('0x2e')]);_0x304e97[_0x2660('0x30')]=_['intersection'](_0x304e97['model'],_0x304e97[_0x2660('0x2e')]);_0x41b424[_0x2660('0x32')]=_[_0x2660('0x31')](_0x304e97['model'],qs[_0x2660('0x33')](_0x3251cb[_0x2660('0x2e')][_0x2660('0x33')]));_0x41b424[_0x2660('0x32')]=_0x41b424[_0x2660('0x32')]['length']?_0x41b424[_0x2660('0x32')]:_0x304e97['model'];if(_0x3251cb[_0x2660('0x2e')][_0x2660('0x44')]){_0x41b424[_0x2660('0x3e')]=[{'all':!![]}];}_0x41b424=_[_0x2660('0x3c')]({},_0x41b424,_0x3251cb['options']);return db['Pause'][_0x2660('0x45')](_0x41b424)[_0x2660('0x1f')](handleEntityNotFound(_0xc1db87,null))[_0x2660('0x1f')](respondWithResult(_0xc1db87,null))[_0x2660('0x41')](handleError(_0xc1db87,null));};exports[_0x2660('0x46')]=function(_0x4e8cd8,_0x55358f){return db[_0x2660('0x27')][_0x2660('0x46')](_0x4e8cd8['body'],{})[_0x2660('0x1f')](function(_0x4d7fc8){var _0x4d681c=_0x4e8cd8[_0x2660('0x47')]['get']({'plain':!![]});if(!_0x4d681c)throw new Error(_0x2660('0x48'));if(_0x4d681c[_0x2660('0x49')]==='user'){var _0x3d9488=_0x4d7fc8[_0x2660('0x21')]({'plain':!![]});var _0x158ff7=_0x2660('0x22');return db['UserProfileSection'][_0x2660('0x45')]({'where':{'name':_0x158ff7,'userProfileId':_0x4d681c[_0x2660('0x4a')]},'raw':!![]})['then'](function(_0x255478){if(_0x255478&&_0x255478[_0x2660('0x4b')]===0x0){return db[_0x2660('0x23')]['create']({'name':_0x3d9488['name'],'resourceId':_0x3d9488['id'],'type':_0x255478[_0x2660('0x25')],'sectionId':_0x255478['id']},{})[_0x2660('0x1f')](function(){return _0x4d7fc8;});}else{return _0x4d7fc8;}})[_0x2660('0x41')](function(_0x472dbc){logger[_0x2660('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x472dbc);throw _0x472dbc;});}return _0x4d7fc8;})['then'](respondWithResult(_0x55358f,0xc9))[_0x2660('0x41')](handleError(_0x55358f,null));};exports[_0x2660('0x1e')]=function(_0x11801d,_0x3b0c33){if(_0x11801d[_0x2660('0x4d')]['id']){delete _0x11801d['body']['id'];}return db[_0x2660('0x27')][_0x2660('0x45')]({'where':{'id':_0x11801d[_0x2660('0x43')]['id']}})[_0x2660('0x1f')](handleEntityNotFound(_0x3b0c33,null))[_0x2660('0x1f')](saveUpdates(_0x11801d[_0x2660('0x4d')],null))['then'](respondWithResult(_0x3b0c33,null))['catch'](handleError(_0x3b0c33,null));};exports['destroy']=function(_0x501a1e,_0x426822){return db[_0x2660('0x27')]['find']({'where':{'id':_0x501a1e['params']['id']}})[_0x2660('0x1f')](handleEntityNotFound(_0x426822,null))[_0x2660('0x1f')](removeEntity(_0x426822,null))[_0x2660('0x41')](handleError(_0x426822,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index b71d3a4..a3e2547 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 _0x0594=['../../config/logger','api','request-promise','path','../../config/environment','./pause.attributes','exports','define','Pause','lodash'];(function(_0x4a28a1,_0x1ff5bf){var _0x653ce8=function(_0x41514c){while(--_0x41514c){_0x4a28a1['push'](_0x4a28a1['shift']());}};_0x653ce8(++_0x1ff5bf);}(_0x0594,0x6d));var _0x4059=function(_0x5ea61b,_0x330993){_0x5ea61b=_0x5ea61b-0x0;var _0x273395=_0x0594[_0x5ea61b];return _0x273395;};'use strict';var _=require(_0x4059('0x0'));var util=require('util');var logger=require(_0x4059('0x1'))(_0x4059('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4059('0x3'));var fs=require('fs');var path=require(_0x4059('0x4'));var rimraf=require('rimraf');var config=require(_0x4059('0x5'));var attributes=require(_0x4059('0x6'));module[_0x4059('0x7')]=function(_0x86c07f,_0x594491){return _0x86c07f[_0x4059('0x8')](_0x4059('0x9'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ea2=['Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x21d16e,_0x42b9dc){var _0x22141b=function(_0xbdecac){while(--_0xbdecac){_0x21d16e['push'](_0x21d16e['shift']());}};_0x22141b(++_0x42b9dc);}(_0x1ea2,0x169));var _0x21ea=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x1ea2[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x21ea('0x0'));var util=require(_0x21ea('0x1'));var logger=require(_0x21ea('0x2'))(_0x21ea('0x3'));var moment=require('moment');var BPromise=require(_0x21ea('0x4'));var rp=require(_0x21ea('0x5'));var fs=require('fs');var path=require(_0x21ea('0x6'));var rimraf=require(_0x21ea('0x7'));var config=require(_0x21ea('0x8'));var attributes=require(_0x21ea('0x9'));module[_0x21ea('0xa')]=function(_0x5ca06c,_0x361158){return _0x5ca06c['define'](_0x21ea('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index eedfc12..21fd86e 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 _0x90a8=['model','ShowPause','stringify','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Pause,\x20%s,\x20%s','message','result','catch','Pause','find','options','attributes','include','map'];(function(_0x38f1ca,_0x23dacf){var _0x4a8dc0=function(_0x53b626){while(--_0x53b626){_0x38f1ca['push'](_0x38f1ca['shift']());}};_0x4a8dc0(++_0x23dacf);}(_0x90a8,0x11a));var _0x890a=function(_0x40eedb,_0x4fb12c){_0x40eedb=_0x40eedb-0x0;var _0x56818d=_0x90a8[_0x40eedb];return _0x56818d;};'use strict';var _=require('lodash');var util=require(_0x890a('0x0'));var moment=require(_0x890a('0x1'));var BPromise=require('bluebird');var rs=require(_0x890a('0x2'));var fs=require('fs');var Redis=require(_0x890a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x890a('0x4'));var logger=require(_0x890a('0x5'))(_0x890a('0x6'));var config=require(_0x890a('0x7'));var jayson=require(_0x890a('0x8'));var client=jayson[_0x890a('0x9')][_0x890a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x128bbd,_0x314201,_0x5b6fae){return new BPromise(function(_0xedc955,_0x1c7b49){return client[_0x890a('0xb')](_0x128bbd,_0x5b6fae)[_0x890a('0xc')](function(_0x46165a){logger[_0x890a('0xd')]('Pause,\x20%s,\x20%s',_0x314201,'request\x20sent');logger['debug'](_0x890a('0xe'),_0x314201,_0x890a('0xf'),JSON['stringify'](_0x46165a));if(_0x46165a[_0x890a('0x10')]){if(_0x46165a[_0x890a('0x10')][_0x890a('0x11')]===0x1f4){logger[_0x890a('0x10')](_0x890a('0x12'),_0x314201,_0x46165a['error'][_0x890a('0x13')]);return _0x1c7b49(_0x46165a['error'][_0x890a('0x13')]);}logger[_0x890a('0x10')]('Pause,\x20%s,\x20%s',_0x314201,_0x46165a['error'][_0x890a('0x13')]);return _0xedc955(_0x46165a[_0x890a('0x10')][_0x890a('0x13')]);}else{logger[_0x890a('0xd')](_0x890a('0x12'),_0x314201,'request\x20sent');_0xedc955(_0x46165a[_0x890a('0x14')][_0x890a('0x13')]);}})[_0x890a('0x15')](function(_0x34f6de){logger[_0x890a('0x10')](_0x890a('0x12'),_0x314201,_0x34f6de);_0x1c7b49(_0x34f6de);});});}exports['ShowPause']=function(_0x5ab6bc){var _0x578e4c=this;return new Promise(function(_0x1317ef,_0x382b62){return db[_0x890a('0x16')][_0x890a('0x17')]({'raw':_0x5ab6bc['options']?_0x5ab6bc[_0x890a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5ab6bc['options']?_0x5ab6bc[_0x890a('0x18')]['where']||null:null,'attributes':_0x5ab6bc[_0x890a('0x18')]?_0x5ab6bc[_0x890a('0x18')][_0x890a('0x19')]||null:null,'include':_0x5ab6bc[_0x890a('0x18')]?_0x5ab6bc[_0x890a('0x18')][_0x890a('0x1a')]?_['map'](_0x5ab6bc[_0x890a('0x18')][_0x890a('0x1a')],function(_0x43b794){return{'model':db[_0x43b794['model']],'as':_0x43b794['as'],'attributes':_0x43b794['attributes'],'include':_0x43b794['include']?_[_0x890a('0x1b')](_0x43b794[_0x890a('0x1a')],function(_0x380e8b){return{'model':db[_0x380e8b[_0x890a('0x1c')]],'as':_0x380e8b['as'],'attributes':_0x380e8b[_0x890a('0x19')],'include':_0x380e8b[_0x890a('0x1a')]?_[_0x890a('0x1b')](_0x380e8b['include'],function(_0x2d3d20){return{'model':db[_0x2d3d20[_0x890a('0x1c')]],'as':_0x2d3d20['as'],'attributes':_0x2d3d20['attributes']};}):[]};}):[]};}):[]:[]})[_0x890a('0xc')](function(_0x497663){logger['info']('ShowPause',_0x5ab6bc);logger['debug'](_0x890a('0x1d'),_0x5ab6bc,JSON[_0x890a('0x1e')](_0x497663));_0x1317ef(_0x497663);})['catch'](function(_0x5461b1){logger[_0x890a('0x10')](_0x890a('0x1d'),_0x5461b1[_0x890a('0x13')],_0x5ab6bc);_0x382b62(_0x578e4c[_0x890a('0x10')](0x1f4,_0x5461b1[_0x890a('0x13')]));});});}; \ No newline at end of file +var _0xf930=['debug','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','ShowPause','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Pause,\x20%s,\x20%s'];(function(_0x125d3e,_0x434e96){var _0x1e59fe=function(_0x1b814){while(--_0x1b814){_0x125d3e['push'](_0x125d3e['shift']());}};_0x1e59fe(++_0x434e96);}(_0xf930,0x15b));var _0x0f93=function(_0x75cb0b,_0x18f240){_0x75cb0b=_0x75cb0b-0x0;var _0x8e5bff=_0xf930[_0x75cb0b];return _0x8e5bff;};'use strict';var _=require(_0x0f93('0x0'));var util=require(_0x0f93('0x1'));var moment=require(_0x0f93('0x2'));var BPromise=require(_0x0f93('0x3'));var rs=require(_0x0f93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f93('0x5'))['db'];var utils=require(_0x0f93('0x6'));var logger=require(_0x0f93('0x7'))(_0x0f93('0x8'));var config=require(_0x0f93('0x9'));var jayson=require(_0x0f93('0xa'));var client=jayson[_0x0f93('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbf422,_0x3730fe,_0x38d0b0){return new BPromise(function(_0x471056,_0x3122e9){return client[_0x0f93('0xc')](_0xbf422,_0x38d0b0)[_0x0f93('0xd')](function(_0x1385fc){logger[_0x0f93('0xe')](_0x0f93('0xf'),_0x3730fe,'request\x20sent');logger[_0x0f93('0x10')](_0x0f93('0x11'),_0x3730fe,_0x0f93('0x12'),JSON[_0x0f93('0x13')](_0x1385fc));if(_0x1385fc['error']){if(_0x1385fc['error'][_0x0f93('0x14')]===0x1f4){logger[_0x0f93('0x15')](_0x0f93('0xf'),_0x3730fe,_0x1385fc[_0x0f93('0x15')][_0x0f93('0x16')]);return _0x3122e9(_0x1385fc[_0x0f93('0x15')][_0x0f93('0x16')]);}logger['error'](_0x0f93('0xf'),_0x3730fe,_0x1385fc[_0x0f93('0x15')][_0x0f93('0x16')]);return _0x471056(_0x1385fc[_0x0f93('0x15')][_0x0f93('0x16')]);}else{logger['info'](_0x0f93('0xf'),_0x3730fe,'request\x20sent');_0x471056(_0x1385fc[_0x0f93('0x17')][_0x0f93('0x16')]);}})[_0x0f93('0x18')](function(_0x288ceb){logger[_0x0f93('0x15')](_0x0f93('0xf'),_0x3730fe,_0x288ceb);_0x3122e9(_0x288ceb);});});}exports[_0x0f93('0x19')]=function(_0x29580b){var _0x4d3b8e=this;return new Promise(function(_0x529f66,_0xd65b18){return db['Pause']['find']({'raw':_0x29580b[_0x0f93('0x1a')]?_0x29580b[_0x0f93('0x1a')][_0x0f93('0x1b')]===undefined?!![]:![]:!![],'where':_0x29580b[_0x0f93('0x1a')]?_0x29580b[_0x0f93('0x1a')][_0x0f93('0x1c')]||null:null,'attributes':_0x29580b[_0x0f93('0x1a')]?_0x29580b['options'][_0x0f93('0x1d')]||null:null,'include':_0x29580b[_0x0f93('0x1a')]?_0x29580b[_0x0f93('0x1a')][_0x0f93('0x1e')]?_[_0x0f93('0x1f')](_0x29580b[_0x0f93('0x1a')]['include'],function(_0x57f2bf){return{'model':db[_0x57f2bf[_0x0f93('0x20')]],'as':_0x57f2bf['as'],'attributes':_0x57f2bf[_0x0f93('0x1d')],'include':_0x57f2bf[_0x0f93('0x1e')]?_[_0x0f93('0x1f')](_0x57f2bf[_0x0f93('0x1e')],function(_0x4723b0){return{'model':db[_0x4723b0[_0x0f93('0x20')]],'as':_0x4723b0['as'],'attributes':_0x4723b0[_0x0f93('0x1d')],'include':_0x4723b0[_0x0f93('0x1e')]?_[_0x0f93('0x1f')](_0x4723b0[_0x0f93('0x1e')],function(_0x3e685d){return{'model':db[_0x3e685d[_0x0f93('0x20')]],'as':_0x3e685d['as'],'attributes':_0x3e685d[_0x0f93('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0f93('0xd')](function(_0x4ab066){logger[_0x0f93('0xe')]('ShowPause',_0x29580b);logger['debug'](_0x0f93('0x19'),_0x29580b,JSON[_0x0f93('0x13')](_0x4ab066));_0x529f66(_0x4ab066);})[_0x0f93('0x18')](function(_0x2a8a38){logger[_0x0f93('0x15')](_0x0f93('0x19'),_0x2a8a38[_0x0f93('0x16')],_0x29580b);_0xd65b18(_0x4d3b8e['error'](0x1f4,_0x2a8a38['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 6341b86..79e289e 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 _0x4383=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./plugin.controller','get','webhookGet','isAuthenticated','show','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','now','single','upload','post','/webhook','webhookPost','put','/:id','update','delete'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x4383,0xa6));var _0x3438=function(_0x15f608,_0x23b508){_0x15f608=_0x15f608-0x0;var _0x185022=_0x4383[_0x15f608];return _0x185022;};'use strict';var multer=require(_0x3438('0x0'));var util=require('util');var path=require(_0x3438('0x1'));var timeout=require(_0x3438('0x2'));var express=require(_0x3438('0x3'));var router=express[_0x3438('0x4')]();var auth=require(_0x3438('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3438('0x6'));var controller=require(_0x3438('0x7'));router[_0x3438('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3438('0x8')]('/webhook',controller[_0x3438('0x9')]);router['get']('/:id',auth[_0x3438('0xa')](),controller[_0x3438('0xb')]);router[_0x3438('0x8')]('/:id/download',auth[_0x3438('0xa')](),controller[_0x3438('0xc')]);var upload=multer({'storage':multer[_0x3438('0xd')]({'destination':function(_0x59512a,_0x4b3e5e,_0x5c83c6){_0x5c83c6(null,path[_0x3438('0xe')](config[_0x3438('0xf')],_0x3438('0x10')));},'filename':function(_0x2b630d,_0x2431e2,_0x20f094){_0x2431e2[_0x3438('0x11')]=_0x2431e2[_0x3438('0x11')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20f094(null,util[_0x3438('0x12')](_0x3438('0x13'),path[_0x3438('0x14')](_0x2431e2[_0x3438('0x11')],path[_0x3438('0x15')](_0x2431e2[_0x3438('0x11')])),Date[_0x3438('0x16')](),path[_0x3438('0x15')](_0x2431e2['originalname'])));}})});router['post']('/',upload[_0x3438('0x17')]('file'),controller[_0x3438('0x18')]);router[_0x3438('0x19')](_0x3438('0x1a'),controller[_0x3438('0x1b')]);router[_0x3438('0x1c')](_0x3438('0x1d'),auth[_0x3438('0xa')](),controller[_0x3438('0x1e')]);router[_0x3438('0x1f')](_0x3438('0x1d'),auth['isAuthenticated'](),controller[_0x3438('0x1f')]);module[_0x3438('0x20')]=router; \ No newline at end of file +var _0x248e=['../../components/auth/service','./plugin.controller','index','get','webhookGet','/:id','isAuthenticated','show','/:id/download','download','join','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','file','upload','/webhook','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x4590f0,_0x1be3ff){var _0x37ef00=function(_0x2245f3){while(--_0x2245f3){_0x4590f0['push'](_0x4590f0['shift']());}};_0x37ef00(++_0x1be3ff);}(_0x248e,0x8e));var _0xe248=function(_0x3bffc0,_0xe8affa){_0x3bffc0=_0x3bffc0-0x0;var _0x44a082=_0x248e[_0x3bffc0];return _0x44a082;};'use strict';var multer=require(_0xe248('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe248('0x1'));var express=require('express');var router=express[_0xe248('0x2')]();var auth=require(_0xe248('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe248('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xe248('0x5')]);router[_0xe248('0x6')]('/webhook',controller[_0xe248('0x7')]);router['get'](_0xe248('0x8'),auth[_0xe248('0x9')](),controller[_0xe248('0xa')]);router[_0xe248('0x6')](_0xe248('0xb'),auth[_0xe248('0x9')](),controller[_0xe248('0xc')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b7bbf,_0x497481,_0x6327a4){_0x6327a4(null,path[_0xe248('0xd')](config['root'],_0xe248('0xe')));},'filename':function(_0x25892a,_0x4d8b89,_0x1e136d){_0x4d8b89[_0xe248('0xf')]=_0x4d8b89[_0xe248('0xf')][_0xe248('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e136d(null,util['format'](_0xe248('0x11'),path[_0xe248('0x12')](_0x4d8b89[_0xe248('0xf')],path[_0xe248('0x13')](_0x4d8b89[_0xe248('0xf')])),Date[_0xe248('0x14')](),path[_0xe248('0x13')](_0x4d8b89[_0xe248('0xf')])));}})});router[_0xe248('0x15')]('/',upload['single'](_0xe248('0x16')),controller[_0xe248('0x17')]);router[_0xe248('0x15')](_0xe248('0x18'),controller['webhookPost']);router[_0xe248('0x19')](_0xe248('0x8'),auth[_0xe248('0x9')](),controller[_0xe248('0x1a')]);router[_0xe248('0x1b')]('/:id',auth[_0xe248('0x9')](),controller[_0xe248('0x1b')]);module[_0xe248('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 77a0e91..9b4e44b 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 _0xb493=['STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xb493,0x99));var _0x3b49=function(_0x4dbd3b,_0x38069b){_0x4dbd3b=_0x4dbd3b-0x0;var _0x5a1c0d=_0xb493[_0x4dbd3b];return _0x5a1c0d;};'use strict';var Sequelize=require(_0x3b49('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b49('0x1')]},'type':{'type':Sequelize['ENUM'](_0x3b49('0x2'),_0x3b49('0x3'))},'description':{'type':Sequelize[_0x3b49('0x4')]},'version':{'type':Sequelize[_0x3b49('0x4')]},'path':{'type':Sequelize[_0x3b49('0x1')],'comment':_0x3b49('0x5')},'active':{'type':Sequelize[_0x3b49('0x6')],'defaultValue':0x0,'comment':_0x3b49('0x7')},'sidebar':{'type':Sequelize[_0x3b49('0x8')](_0x3b49('0x9'),_0x3b49('0xa'),_0x3b49('0xb'),_0x3b49('0xc')),'defaultValue':_0x3b49('0xb'),'comment':_0x3b49('0xd')},'icon':{'type':Sequelize[_0x3b49('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x3b49('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x3b49('0x1')]}}; \ No newline at end of file +var _0x1ac5=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x1ac5,0x1a8));var _0x51ac=function(_0x4c9892,_0x2bd93b){_0x4c9892=_0x4c9892-0x0;var _0x580006=_0x1ac5[_0x4c9892];return _0x580006;};'use strict';var Sequelize=require('sequelize');module[_0x51ac('0x0')]={'name':{'type':Sequelize[_0x51ac('0x1')]},'type':{'type':Sequelize[_0x51ac('0x2')](_0x51ac('0x3'),_0x51ac('0x4'))},'description':{'type':Sequelize[_0x51ac('0x5')]},'version':{'type':Sequelize[_0x51ac('0x5')]},'path':{'type':Sequelize[_0x51ac('0x1')],'comment':_0x51ac('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x51ac('0x7')},'sidebar':{'type':Sequelize[_0x51ac('0x2')]('adminOnly','agentOnly','always',_0x51ac('0x8')),'defaultValue':_0x51ac('0x9'),'comment':_0x51ac('0xa')},'icon':{'type':Sequelize[_0x51ac('0x1')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x51ac('0x1')]},'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 195c73f..7ceaed7 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 _0xf23b=['end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','index','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','map','VIRTUAL','name','merge','includeAll','include','Plugin','findAll','rows','catch','show','rawAttributes','options','find','download','params','path','join','root','server/files/plugins','%s.zip','warning','code','ENOENT','Sequelize','Error','pipe','dirname','basename','close','existsSync','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','info','Temporary\x20file\x20removed','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','unlinkSync','Zip\x20archive\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','statusCode','webhookPost','resolve','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./plugin.socket','sendStatus','status'];(function(_0x397cf6,_0x91543f){var _0x47f0d8=function(_0x5e1515){while(--_0x5e1515){_0x397cf6['push'](_0x397cf6['shift']());}};_0x47f0d8(++_0x91543f);}(_0xf23b,0x1d6));var _0xbf23=function(_0x181f3a,_0x43d2e6){_0x181f3a=_0x181f3a-0x0;var _0x87fd32=_0xf23b[_0x181f3a];return _0x87fd32;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbf23('0x0'));var rimraf=require(_0xbf23('0x1'));var zipdir=require(_0xbf23('0x2'));var jsonpatch=require(_0xbf23('0x3'));var rp=require(_0xbf23('0x4'));var moment=require(_0xbf23('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf23('0x6'));var path=require('path');var sox=require(_0xbf23('0x7'));var csv=require(_0xbf23('0x8'));var ejs=require(_0xbf23('0x9'));var fs=require('fs');var _=require(_0xbf23('0xa'));var squel=require(_0xbf23('0xb'));var crypto=require(_0xbf23('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbf23('0xd'));var toCsv=require(_0xbf23('0x8'));var querystring=require(_0xbf23('0xe'));var Papa=require('papaparse');var extract=require(_0xbf23('0xf'));var rimraf=require(_0xbf23('0x1'));var archiver=require(_0xbf23('0x10'));var Redis=require(_0xbf23('0x11'));var authService=require(_0xbf23('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbf23('0x13'));var hardwareService=require(_0xbf23('0x14'));var logger=require('../../config/logger')(_0xbf23('0x15'));var utils=require(_0xbf23('0x16'));var config=require(_0xbf23('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbf23('0x18')](config[_0xbf23('0x19')],{'host':_0xbf23('0x1a'),'port':0x18eb});var socket=require(_0xbf23('0x1b'))(new Redis(config[_0xbf23('0x19')]));require(_0xbf23('0x1c'))['register'](socket);function respondWithStatusCode(_0x59ace3,_0x3d998a){_0x3d998a=_0x3d998a||0xcc;return function(_0xf5cc85){if(_0xf5cc85){return _0x59ace3[_0xbf23('0x1d')](_0x3d998a);}return _0x59ace3[_0xbf23('0x1e')](_0x3d998a)[_0xbf23('0x1f')]();};}function respondWithResult(_0xa92cd7,_0x3cb163){_0x3cb163=_0x3cb163||0xc8;return function(_0x496fd6){if(_0x496fd6){return _0xa92cd7[_0xbf23('0x1e')](_0x3cb163)[_0xbf23('0x20')](_0x496fd6);}};}function respondWithFilteredResult(_0x6d51ab,_0x476999){return function(_0x2336db){if(_0x2336db){var _0x5dd2b6=_0x2336db[_0xbf23('0x21')],_0x4b18b4=_0x476999['offset'],_0x476fe5=_0x476999[_0xbf23('0x22')]+_0x476999[_0xbf23('0x23')],_0x579515;if(_0x476fe5>=_0x5dd2b6){_0x476fe5=_0x5dd2b6;_0x579515=0xc8;}else{_0x579515=0xce;}_0x6d51ab['status'](_0x579515);return _0x6d51ab['set'](_0xbf23('0x24'),_0x4b18b4+'-'+_0x476fe5+'/'+_0x5dd2b6)[_0xbf23('0x20')](_0x2336db);}return null;};}function patchUpdates(_0x26fde4){return function(_0x325976){try{jsonpatch[_0xbf23('0x25')](_0x325976,_0x26fde4,!![]);}catch(_0x3ee7b4){return BPromise[_0xbf23('0x26')](_0x3ee7b4);}return _0x325976[_0xbf23('0x27')]();};}function saveUpdates(_0x48d461,_0x451e4a){return function(_0x4d4e3b){if(_0x4d4e3b){return _0x4d4e3b[_0xbf23('0x28')](_0x48d461)[_0xbf23('0x29')](function(_0x456ac1){return _0x456ac1;});}return null;};}function removeEntity(_0x5ce2e4,_0x489e8c){return function(_0x151a29){if(_0x151a29){return _0x151a29['destroy']()['then'](function(){var _0x25caa2=_0x151a29[_0xbf23('0x2a')]({'plain':!![]});var _0x3ed099='Plugins';return db[_0xbf23('0x2b')][_0xbf23('0x2c')]({'where':{'type':_0x3ed099,'resourceId':_0x25caa2['id']}})[_0xbf23('0x29')](function(){return _0x151a29;});})[_0xbf23('0x29')](function(){_0x5ce2e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46ee8f,_0x4fc06d){return function(_0x50c850){if(!_0x50c850){_0x46ee8f[_0xbf23('0x1d')](0x194);}return _0x50c850;};}function handleError(_0x2b82f3,_0x1c6767){_0x1c6767=_0x1c6767||0x1f4;return function(_0x33b3eb){logger[_0xbf23('0x2d')](_0x33b3eb[_0xbf23('0x2e')]);if(_0x33b3eb['name']){delete _0x33b3eb['name'];}_0x2b82f3[_0xbf23('0x1e')](_0x1c6767)['send'](_0x33b3eb);};}exports[_0xbf23('0x2f')]=function(_0x4ecfec,_0x4fe1bc){var _0x461da8={},_0x542e77={},_0x4c4eb5={'count':0x0,'rows':[]};var _0x1bb018=_['map'](db['Plugin']['rawAttributes'],function(_0xbbace){return{'name':_0xbbace[_0xbf23('0x30')],'type':_0xbbace[_0xbf23('0x31')][_0xbf23('0x32')]};});_0x542e77[_0xbf23('0x33')]=_['map'](_0x1bb018,'name');_0x542e77['query']=_[_0xbf23('0x34')](_0x4ecfec['query']);_0x542e77[_0xbf23('0x35')]=_[_0xbf23('0x36')](_0x542e77[_0xbf23('0x33')],_0x542e77[_0xbf23('0x37')]);_0x461da8[_0xbf23('0x38')]=_[_0xbf23('0x36')](_0x542e77[_0xbf23('0x33')],qs[_0xbf23('0x39')](_0x4ecfec[_0xbf23('0x37')][_0xbf23('0x39')]));_0x461da8[_0xbf23('0x38')]=_0x461da8[_0xbf23('0x38')][_0xbf23('0x3a')]?_0x461da8[_0xbf23('0x38')]:_0x542e77[_0xbf23('0x33')];if(!_0x4ecfec[_0xbf23('0x37')]['hasOwnProperty'](_0xbf23('0x3b'))){_0x461da8[_0xbf23('0x23')]=qs[_0xbf23('0x23')](_0x4ecfec[_0xbf23('0x37')][_0xbf23('0x23')]);_0x461da8[_0xbf23('0x22')]=qs[_0xbf23('0x22')](_0x4ecfec[_0xbf23('0x37')][_0xbf23('0x22')]);}_0x461da8[_0xbf23('0x3c')]=qs[_0xbf23('0x3d')](_0x4ecfec[_0xbf23('0x37')][_0xbf23('0x3d')]);_0x461da8[_0xbf23('0x3e')]=qs[_0xbf23('0x35')](_[_0xbf23('0x3f')](_0x4ecfec['query'],_0x542e77[_0xbf23('0x35')]),_0x1bb018);if(_0x4ecfec[_0xbf23('0x37')][_0xbf23('0x40')]){_0x461da8['where']=_['merge'](_0x461da8['where'],{'$or':_[_0xbf23('0x41')](_0x1bb018,function(_0x32f63e){if(_0x32f63e[_0xbf23('0x31')]!==_0xbf23('0x42')){var _0x1de28c={};_0x1de28c[_0x32f63e[_0xbf23('0x43')]]={'$like':'%'+_0x4ecfec[_0xbf23('0x37')]['filter']+'%'};return _0x1de28c;}})});}_0x461da8=_[_0xbf23('0x44')]({},_0x461da8,_0x4ecfec['options']);var _0x2cf282={'where':_0x461da8[_0xbf23('0x3e')]};return db['Plugin']['count'](_0x2cf282)[_0xbf23('0x29')](function(_0x2059d5){_0x4c4eb5[_0xbf23('0x21')]=_0x2059d5;if(_0x4ecfec[_0xbf23('0x37')][_0xbf23('0x45')]){_0x461da8[_0xbf23('0x46')]=[{'all':!![]}];}return db[_0xbf23('0x47')][_0xbf23('0x48')](_0x461da8);})['then'](function(_0x1627b0){_0x4c4eb5[_0xbf23('0x49')]=_0x1627b0;return _0x4c4eb5;})[_0xbf23('0x29')](respondWithFilteredResult(_0x4fe1bc,_0x461da8))[_0xbf23('0x4a')](handleError(_0x4fe1bc,null));};exports[_0xbf23('0x4b')]=function(_0x691c62,_0x48b215){var _0x4d209d={'raw':!![],'where':{'id':_0x691c62['params']['id']}},_0x16086d={};_0x16086d[_0xbf23('0x33')]=_[_0xbf23('0x34')](db[_0xbf23('0x47')][_0xbf23('0x4c')]);_0x16086d['query']=_['keys'](_0x691c62['query']);_0x16086d['filters']=_[_0xbf23('0x36')](_0x16086d[_0xbf23('0x33')],_0x16086d[_0xbf23('0x37')]);_0x4d209d[_0xbf23('0x38')]=_[_0xbf23('0x36')](_0x16086d['model'],qs[_0xbf23('0x39')](_0x691c62[_0xbf23('0x37')][_0xbf23('0x39')]));_0x4d209d[_0xbf23('0x38')]=_0x4d209d['attributes'][_0xbf23('0x3a')]?_0x4d209d[_0xbf23('0x38')]:_0x16086d[_0xbf23('0x33')];if(_0x691c62['query'][_0xbf23('0x45')]){_0x4d209d[_0xbf23('0x46')]=[{'all':!![]}];}_0x4d209d=_[_0xbf23('0x44')]({},_0x4d209d,_0x691c62[_0xbf23('0x4d')]);return db[_0xbf23('0x47')][_0xbf23('0x4e')](_0x4d209d)[_0xbf23('0x29')](handleEntityNotFound(_0x48b215,null))[_0xbf23('0x29')](respondWithResult(_0x48b215,null))[_0xbf23('0x4a')](handleError(_0x48b215,null));};exports[_0xbf23('0x4f')]=function(_0x4d2a6c,_0x5651c2,_0x24637a){return db[_0xbf23('0x47')]['find']({'where':{'id':_0x4d2a6c[_0xbf23('0x50')]['id']},'attributes':['name',_0xbf23('0x51')],'raw':!![]})[_0xbf23('0x29')](handleEntityNotFound(_0x5651c2,null))[_0xbf23('0x29')](function(_0x2b2dd8){if(_0x2b2dd8){var _0x4591de=path[_0xbf23('0x52')](config[_0xbf23('0x53')],_0xbf23('0x54'),util['format'](_0xbf23('0x55'),path['basename'](_0x2b2dd8[_0xbf23('0x51')])));var _0x5b1c85=fs['createWriteStream'](_0x4591de);var _0xc92b6b=archiver('zip',{'zlib':{'level':0x9}});_0xc92b6b['on'](_0xbf23('0x56'),function(_0x51eda1){if(_0x51eda1[_0xbf23('0x57')]===_0xbf23('0x58')){logger['error'](_0x51eda1);}else{throw new db[(_0xbf23('0x59'))][(_0xbf23('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0xc92b6b['on'](_0xbf23('0x2d'),function(_0x12bd52){throw new db[(_0xbf23('0x59'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0xc92b6b[_0xbf23('0x5b')](_0x5b1c85);_0xc92b6b['glob']('**/*',{'cwd':path[_0xbf23('0x52')](config['root'],_0xbf23('0x54'),path[_0xbf23('0x5c')](_0x2b2dd8['path'])),'ignore':[path[_0xbf23('0x52')](path[_0xbf23('0x5d')](_0x2b2dd8[_0xbf23('0x51')]),'node_modules/**/*'),path[_0xbf23('0x52')](path[_0xbf23('0x5d')](_0x2b2dd8[_0xbf23('0x51')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x5b1c85['on'](_0xbf23('0x5e'),function(){if(!fs[_0xbf23('0x5f')](_0x4591de)){throw new db['Sequelize'][(_0xbf23('0x5a'))](_0xbf23('0x60'));}return _0x5651c2['download'](_0x4591de,util[_0xbf23('0x61')]('%s.zip',path[_0xbf23('0x5d')](_0x2b2dd8[_0xbf23('0x51')])),function(_0x2e3c2){if(_0x2e3c2){throw new db[(_0xbf23('0x59'))][(_0xbf23('0x5a'))](_0xbf23('0x62'));}fs['unlinkSync'](_0x4591de);logger[_0xbf23('0x63')]('Download\x20completed');logger[_0xbf23('0x63')](_0xbf23('0x64'));});});}return null;})[_0xbf23('0x4a')](handleError(_0x5651c2,null));};exports['upload']=function(_0x4a4048,_0x13e120,_0x52df3d){var _0x541250=path[_0xbf23('0x5d')](_0x4a4048[_0xbf23('0x65')]['filename'],path[_0xbf23('0x66')](_0x4a4048[_0xbf23('0x65')]['filename']));var _0x1fa116=path[_0xbf23('0x52')](config['root'],_0xbf23('0x54'),_0x4a4048[_0xbf23('0x65')][_0xbf23('0x67')]);var _0x37ade8=path[_0xbf23('0x52')](config[_0xbf23('0x53')],_0xbf23('0x54'),_0x541250);logger[_0xbf23('0x63')](_0xbf23('0x68'),_0x1fa116);logger[_0xbf23('0x63')](_0xbf23('0x69'),_0x37ade8);try{fs[_0xbf23('0x6a')](_0x1fa116,parseInt(_0xbf23('0x6b'),0x8));extract(_0x1fa116,{'dir':_0x37ade8},function(_0x2b6dce){if(_0x2b6dce){logger[_0xbf23('0x2d')](_0x2b6dce);handleError(_0x2b6dce,!![]);};var _0x1c182f=fs[_0xbf23('0x6c')](_0x37ade8);if(_0x1c182f[_0xbf23('0x3a')]>0x1){removeReferences(_0x1fa116,_0x37ade8);logger[_0xbf23('0x2d')]('Invalid\x20plugin\x20structure');return _0x52df3d(new Error(_0xbf23('0x6d')));}var _0x25308a=fs[_0xbf23('0x6e')](path[_0xbf23('0x52')](_0x37ade8,_0x1c182f[0x0]));if(_0x25308a[_0xbf23('0x6f')]()){removeReferences(_0x1fa116,_0x37ade8);logger['error']('Invalid\x20plugin\x20structure');return _0x52df3d(new Error('Invalid\x20plugin\x20structure'));}if(_0x25308a[_0xbf23('0x70')]()){var _0x5e1508=fs[_0xbf23('0x6c')](path[_0xbf23('0x52')](_0x37ade8,_0x1c182f[0x0]));if(_0x5e1508[_0xbf23('0x3a')]===0x0){removeReferences(_0x1fa116,_0x37ade8);logger[_0xbf23('0x2d')](_0xbf23('0x6d'));return _0x52df3d(new Error(_0xbf23('0x6d')));}var _0x1a39b6=_0x5e1508[_0xbf23('0x71')](function(_0x1387f3){return _0x1387f3===_0xbf23('0x72');});if(!_0x1a39b6){return _0x52df3d(new Error('Plugin\x20manifest\x20missing'));}var _0x4b7f7a=fs[_0xbf23('0x73')](path[_0xbf23('0x52')](_0x37ade8,_0x1c182f[0x0],_0xbf23('0x72')));var _0x2e4170=JSON[_0xbf23('0x74')](_0x4b7f7a);if(_0xbf23('0x75')==typeof _0x2e4170['name']){return _0x52df3d(new Error(_0xbf23('0x76')));}if(_0xbf23('0x75')==typeof _0x2e4170[_0xbf23('0x31')]){return _0x52df3d(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xbf23('0x75')==typeof _0x2e4170[_0xbf23('0x77')]){return _0x52df3d(new Error(_0xbf23('0x78')));}if(_0xbf23('0x75')==typeof _0x2e4170[_0xbf23('0x79')]){return _0x52df3d(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x2e4170['type']===_0xbf23('0x7a')){if('undefined'==typeof _0x2e4170[_0xbf23('0x79')][_0xbf23('0x7b')]){return _0x52df3d(new Error(_0xbf23('0x7c')));}if('undefined'==typeof _0x2e4170['parameters'][_0xbf23('0x7b')][_0xbf23('0x7d')]&&_0xbf23('0x75')==typeof _0x2e4170[_0xbf23('0x79')][_0xbf23('0x7b')][_0xbf23('0x7e')]){return _0x52df3d(new Error(_0xbf23('0x7f')));}}else if(_0x2e4170[_0xbf23('0x31')]===_0xbf23('0x80')){if('undefined'==typeof _0x2e4170[_0xbf23('0x79')]['scriptName']){return _0x52df3d(new Error(_0xbf23('0x81')));}if(_0xbf23('0x75')==typeof _0x2e4170[_0xbf23('0x79')][_0xbf23('0x82')]){return _0x52df3d(new Error(_0xbf23('0x83')));}}else{return _0x52df3d(new Error(_0xbf23('0x84')));}var _0x2a93ae=_0x2e4170[_0xbf23('0x43')];var _0x4d5218=_0x2e4170[_0xbf23('0x85')];var _0x705553=_0x2e4170['type'];var _0x1c8a89=_0x2e4170['sidebar']?_0x2e4170['sidebar']:'always';var _0x4c822f=_0x2e4170[_0xbf23('0x86')]?_0x2e4170[_0xbf23('0x86')]:_0xbf23('0x87');var _0x5b73d3='';var _0x48d547='';var _0x1fedeb='';var _0x45b9a8='';var _0x34d73a=_0x2e4170['version'];if(_0x705553===_0xbf23('0x7a')){if(_0xbf23('0x75')!=typeof _0x2e4170[_0xbf23('0x79')][_0xbf23('0x7b')]['admin']){var _0x28074e=_0x2e4170[_0xbf23('0x79')][_0xbf23('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xbf23('0x88')](_0x28074e)){_0x5b73d3=path[_0xbf23('0x52')](_0xbf23('0x89'),_0x541250,_0x1c182f[0x0],_0x28074e);}else{_0x5b73d3=_0x28074e;}}else{logger[_0xbf23('0x63')](_0xbf23('0x8a'));}if('undefined'!=typeof _0x2e4170[_0xbf23('0x79')][_0xbf23('0x7b')][_0xbf23('0x7e')]){var _0x25200d=_0x2e4170[_0xbf23('0x79')]['views'][_0xbf23('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0xbf23('0x88')](_0x25200d)){_0x48d547=path[_0xbf23('0x52')](_0xbf23('0x89'),_0x541250,_0x1c182f[0x0],_0x25200d);}else{_0x48d547=_0x25200d;}}else{logger[_0xbf23('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x705553==='script'){_0x1fedeb=_0x2e4170[_0xbf23('0x79')]['scriptName'];_0x45b9a8=_0x2e4170['parameters'][_0xbf23('0x82')];if('undefined'!=typeof _0x2e4170['parameters'][_0xbf23('0x7b')]){if(_0xbf23('0x75')!=typeof _0x2e4170['parameters'][_0xbf23('0x7b')][_0xbf23('0x7d')]){var _0x28074e=_0x2e4170[_0xbf23('0x79')][_0xbf23('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xbf23('0x88')](_0x28074e)){_0x5b73d3=path[_0xbf23('0x52')]('plugins',_0x541250,_0x1c182f[0x0],_0x28074e);}else{_0x5b73d3=_0x28074e;}}if(_0xbf23('0x75')!=typeof _0x2e4170[_0xbf23('0x79')]['views'][_0xbf23('0x7e')]){var _0x25200d=_0x2e4170['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0x25200d)){_0x48d547=path[_0xbf23('0x52')]('plugins',_0x541250,_0x1c182f[0x0],_0x25200d);}else{_0x48d547=_0x25200d;}}}}var _0x5b6ab1={'name':_0x2a93ae,'description':_0x4d5218,'path':path[_0xbf23('0x52')](_0x541250,_0x1c182f[0x0]),'type':_0x705553,'sidebar':_0x1c8a89,'icon':_0x4c822f,'adminUrl':_0x5b73d3,'agentUrl':_0x48d547,'scriptName':_0x1fedeb,'scriptPath':_0x45b9a8,'version':_0x34d73a};removeReferences(_0x1fa116,null);return db['Plugin']['create'](_0x5b6ab1)[_0xbf23('0x29')](function(_0x42f529){var _0x3446c0={'role':_0x4a4048['body'][_0xbf23('0x8b')],'userProfileId':_0x4a4048[_0xbf23('0x8c')][_0xbf23('0x8d')]};if(!_0x3446c0)throw new Error(_0xbf23('0x8e'));if(_0x3446c0['role']===_0xbf23('0x8f')){var _0x185277=_0x42f529[_0xbf23('0x2a')]({'plain':!![]});return db['UserProfileSection'][_0xbf23('0x4e')]({'where':{'name':_0xbf23('0x90'),'userProfileId':_0x3446c0[_0xbf23('0x8d')]},'raw':!![]})[_0xbf23('0x29')](function(_0x17b99d){if(_0x17b99d&&_0x17b99d[_0xbf23('0x91')]===0x0){return db[_0xbf23('0x2b')]['create']({'name':_0x185277['name'],'resourceId':_0x185277['id'],'type':_0x17b99d[_0xbf23('0x43')],'sectionId':_0x17b99d['id']},{})[_0xbf23('0x29')](function(){return _0x42f529;});}else{return _0x42f529;}})[_0xbf23('0x4a')](function(_0x21d429){logger[_0xbf23('0x2d')](_0xbf23('0x92'),_0x21d429);throw _0x21d429;});}return _0x42f529;})[_0xbf23('0x29')](respondWithResult(_0x13e120,null))[_0xbf23('0x4a')](handleError(_0x13e120,null));}});}catch(_0x4a8d33){_0x13e120['status'](0x1f4)[_0xbf23('0x93')](_0x4a8d33);}};function removeReferences(_0x4864a6,_0x4181d5){try{if(_0x4864a6){fs[_0xbf23('0x94')](_0x4864a6);logger[_0xbf23('0x63')](_0xbf23('0x95'));}if(_0x4181d5){rimraf(_0x4181d5,function(){});logger[_0xbf23('0x63')]('Extracted\x20folder\x20removed');}}catch(_0x32ebf4){logger['error'](_0x32ebf4);}}exports['update']=function(_0x34fcee,_0x44f251,_0x5318b4){return db[_0xbf23('0x47')][_0xbf23('0x4e')]({'where':{'id':_0x34fcee[_0xbf23('0x50')]['id']}})[_0xbf23('0x29')](handleEntityNotFound(_0x44f251,null))['then'](saveUpdates(_0x34fcee[_0xbf23('0x8c')],null))[_0xbf23('0x29')](respondWithResult(_0x44f251,null))[_0xbf23('0x4a')](handleError(_0x44f251,null));};exports[_0xbf23('0x96')]=function(_0x58111a,_0x31ef01,_0x4e71c5){return db[_0xbf23('0x47')][_0xbf23('0x4e')]({'where':{'id':_0x58111a[_0xbf23('0x50')]['id']}})[_0xbf23('0x29')](function(_0x491db3){if(_0x491db3){return _0x491db3[_0xbf23('0x2c')]();}})[_0xbf23('0x29')](function(_0x173b7e){rimraf(path[_0xbf23('0x52')](config[_0xbf23('0x53')],_0xbf23('0x54'),path[_0xbf23('0x5c')](_0x173b7e[_0xbf23('0x51')])),function(){});return _0x173b7e;})[_0xbf23('0x29')](handleEntityNotFound(_0x31ef01,null))['then'](respondWithStatusCode(_0x31ef01,null))[_0xbf23('0x4a')](handleError(_0x31ef01,null));};exports[_0xbf23('0x97')]=function(_0x2f6908,_0x483f10,_0x409411){return BPromise['resolve']()[_0xbf23('0x29')](function(){if(!_0x2f6908['query'][_0xbf23('0x51')]){throw new Error(_0xbf23('0x98'));}if(!_0x2f6908[_0xbf23('0x37')]['port']){throw new Error(_0xbf23('0x99'));}var _0x1f6656=_0x2f6908[_0xbf23('0x37')][_0xbf23('0x9a')]?_0x2f6908['query'][_0xbf23('0x9a')]+':'+_0x2f6908['query'][_0xbf23('0x9b')]:_0xbf23('0x9c')+_0x2f6908[_0xbf23('0x37')][_0xbf23('0x9b')];var _0x4aaa9e=_0x2f6908[_0xbf23('0x37')]['json']?_0x2f6908[_0xbf23('0x37')][_0xbf23('0x20')]:!![];var _0x2259bf=_0x2f6908[_0xbf23('0x37')][_0xbf23('0x9d')]?_0x2f6908[_0xbf23('0x37')][_0xbf23('0x9d')]:null;var _0x4b69ea={'method':_0x2f6908[_0xbf23('0x9e')],'uri':util[_0xbf23('0x61')](_0xbf23('0x9f'),_0x1f6656,_0x2f6908['query']['path']),'json':_0x4aaa9e,'resolveWithFullResponse':!![],'encoding':_0x2259bf,'qs':_0x2f6908[_0xbf23('0x37')]};if(_0x2f6908['headers']){_0x4b69ea[_0xbf23('0xa0')]=_0x2f6908[_0xbf23('0xa0')];if(_0x4b69ea[_0xbf23('0xa0')][_0xbf23('0xa1')]){delete _0x4b69ea['headers']['content-length'];}}if(_0x4b69ea[_0xbf23('0xa0')]['content-type']){delete _0x4b69ea[_0xbf23('0xa0')][_0xbf23('0xa2')];}return rp(_0x4b69ea);})[_0xbf23('0x29')](function(_0x244f6a){if(_0x244f6a){_0x483f10[_0xbf23('0xa3')](_0x244f6a[_0xbf23('0xa0')]);logger[_0xbf23('0x63')](_0x244f6a[_0xbf23('0x8c')]);if(_['endsWith'](_0x2f6908[_0xbf23('0x37')][_0xbf23('0x51')],_0xbf23('0x4f'))&&_0x244f6a[_0xbf23('0xa4')]==0x1f4){return _0x483f10[_0xbf23('0x1d')](_0x244f6a[_0xbf23('0xa4')]);}else{return _0x483f10['status'](_0x244f6a['statusCode'])[_0xbf23('0x93')](_0x244f6a[_0xbf23('0x8c')]);}}else{return _0x483f10['sendStatus'](0xc8);}})[_0xbf23('0x4a')](handleError(_0x483f10,null));};exports[_0xbf23('0xa5')]=function(_0x4a9375,_0x4f623e,_0x44955f){return BPromise[_0xbf23('0xa6')]()[_0xbf23('0x29')](function(){if(!_0x4a9375['query'][_0xbf23('0x51')]){throw new Error(_0xbf23('0x98'));}if(!_0x4a9375['query'][_0xbf23('0x9b')]){throw new Error(_0xbf23('0x99'));}var _0x2126c0=_0x4a9375[_0xbf23('0x37')][_0xbf23('0x9a')]?_0x4a9375[_0xbf23('0x37')][_0xbf23('0x9a')]+':'+_0x4a9375[_0xbf23('0x37')][_0xbf23('0x9b')]:_0xbf23('0x9c')+_0x4a9375[_0xbf23('0x37')][_0xbf23('0x9b')];var _0x4237e4=_0x4a9375['query'][_0xbf23('0x20')]?_0x4a9375[_0xbf23('0x37')]['json']:!![];var _0x4e13ee=_0x4a9375['query']['encoding']?_0x4a9375[_0xbf23('0x37')][_0xbf23('0x9d')]:null;var _0x2f1e37={'method':_0x4a9375['method'],'uri':util[_0xbf23('0x61')](_0xbf23('0x9f'),_0x2126c0,_0x4a9375[_0xbf23('0x37')][_0xbf23('0x51')]),'json':_0x4237e4,'resolveWithFullResponse':!![],'encoding':_0x4e13ee,'body':_0x4a9375[_0xbf23('0x8c')]};if(_0x4a9375[_0xbf23('0xa0')]){_0x2f1e37['headers']=_0x4a9375['headers'];if(_0x2f1e37['headers'][_0xbf23('0xa1')]){delete _0x2f1e37[_0xbf23('0xa0')][_0xbf23('0xa1')];}}if(_0x2f1e37[_0xbf23('0xa0')][_0xbf23('0xa2')]){delete _0x2f1e37['headers'][_0xbf23('0xa2')];}return rp(_0x2f1e37);})[_0xbf23('0x29')](function(_0x40e65d){if(_0x40e65d){_0x4f623e[_0xbf23('0xa3')](_0x40e65d[_0xbf23('0xa0')]);logger['info'](_0x40e65d[_0xbf23('0x8c')]);return _0x4f623e['status'](_0x40e65d[_0xbf23('0xa4')])[_0xbf23('0x93')](_0x40e65d[_0xbf23('0x8c')]);}else{return _0x4f623e[_0xbf23('0x1d')](0xc8);}})[_0xbf23('0x4a')](handleError(_0x4f623e,null));}; \ No newline at end of file +var _0x1ad0=['encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','end','error','name','send','index','map','Plugin','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','length','options','find','download','params','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','join','root','dirname','node_modules/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','info','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','Invalid\x20plugin\x20structure','isFile','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','delete','resolve','port','hostname','http://localhost:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ad0,0xb4));var _0x01ad=function(_0x6b8291,_0x13f1e8){_0x6b8291=_0x6b8291-0x0;var _0x4c41fe=_0x1ad0[_0x6b8291];return _0x4c41fe;};'use strict';var pdf=require(_0x01ad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x01ad('0x1'));var zipdir=require(_0x01ad('0x2'));var jsonpatch=require(_0x01ad('0x3'));var rp=require('request-promise');var moment=require(_0x01ad('0x4'));var BPromise=require(_0x01ad('0x5'));var Mustache=require(_0x01ad('0x6'));var util=require(_0x01ad('0x7'));var path=require(_0x01ad('0x8'));var sox=require(_0x01ad('0x9'));var csv=require(_0x01ad('0xa'));var ejs=require(_0x01ad('0xb'));var fs=require('fs');var _=require(_0x01ad('0xc'));var squel=require(_0x01ad('0xd'));var crypto=require(_0x01ad('0xe'));var jsforce=require(_0x01ad('0xf'));var deskjs=require(_0x01ad('0x10'));var toCsv=require(_0x01ad('0xa'));var querystring=require('querystring');var Papa=require(_0x01ad('0x11'));var extract=require(_0x01ad('0x12'));var rimraf=require('rimraf');var archiver=require(_0x01ad('0x13'));var Redis=require('ioredis');var authService=require(_0x01ad('0x14'));var qs=require(_0x01ad('0x15'));var as=require(_0x01ad('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x01ad('0x17'));var utils=require(_0x01ad('0x18'));var config=require('../../config/environment');var db=require(_0x01ad('0x19'))['db'];config[_0x01ad('0x1a')]=_[_0x01ad('0x1b')](config[_0x01ad('0x1a')],{'host':_0x01ad('0x1c'),'port':0x18eb});var socket=require(_0x01ad('0x1d'))(new Redis(config[_0x01ad('0x1a')]));require(_0x01ad('0x1e'))[_0x01ad('0x1f')](socket);function respondWithStatusCode(_0xbd17fd,_0x199817){_0x199817=_0x199817||0xcc;return function(_0x5458c3){if(_0x5458c3){return _0xbd17fd[_0x01ad('0x20')](_0x199817);}return _0xbd17fd[_0x01ad('0x21')](_0x199817)['end']();};}function respondWithResult(_0xaedac1,_0x1f7b7d){_0x1f7b7d=_0x1f7b7d||0xc8;return function(_0x590be0){if(_0x590be0){return _0xaedac1[_0x01ad('0x21')](_0x1f7b7d)[_0x01ad('0x22')](_0x590be0);}};}function respondWithFilteredResult(_0x2e055d,_0x3febe5){return function(_0x2896c0){if(_0x2896c0){var _0xc4fafe=_0x2896c0[_0x01ad('0x23')],_0x4f3747=_0x3febe5[_0x01ad('0x24')],_0x43f4ba=_0x3febe5[_0x01ad('0x24')]+_0x3febe5[_0x01ad('0x25')],_0x161bce;if(_0x43f4ba>=_0xc4fafe){_0x43f4ba=_0xc4fafe;_0x161bce=0xc8;}else{_0x161bce=0xce;}_0x2e055d[_0x01ad('0x21')](_0x161bce);return _0x2e055d[_0x01ad('0x26')](_0x01ad('0x27'),_0x4f3747+'-'+_0x43f4ba+'/'+_0xc4fafe)[_0x01ad('0x22')](_0x2896c0);}return null;};}function patchUpdates(_0x1c0129){return function(_0x155acc){try{jsonpatch[_0x01ad('0x28')](_0x155acc,_0x1c0129,!![]);}catch(_0x367e1f){return BPromise[_0x01ad('0x29')](_0x367e1f);}return _0x155acc[_0x01ad('0x2a')]();};}function saveUpdates(_0x4bddbd,_0x5112e9){return function(_0x296f44){if(_0x296f44){return _0x296f44[_0x01ad('0x2b')](_0x4bddbd)[_0x01ad('0x2c')](function(_0x50dc15){return _0x50dc15;});}return null;};}function removeEntity(_0x72979f,_0x49b136){return function(_0xbe1a36){if(_0xbe1a36){return _0xbe1a36[_0x01ad('0x2d')]()[_0x01ad('0x2c')](function(){var _0x441bed=_0xbe1a36[_0x01ad('0x2e')]({'plain':!![]});var _0x27f1ae=_0x01ad('0x2f');return db[_0x01ad('0x30')][_0x01ad('0x2d')]({'where':{'type':_0x27f1ae,'resourceId':_0x441bed['id']}})[_0x01ad('0x2c')](function(){return _0xbe1a36;});})[_0x01ad('0x2c')](function(){_0x72979f[_0x01ad('0x21')](0xcc)[_0x01ad('0x31')]();});}};}function handleEntityNotFound(_0x345d8b,_0x391e97){return function(_0x13dbb9){if(!_0x13dbb9){_0x345d8b[_0x01ad('0x20')](0x194);}return _0x13dbb9;};}function handleError(_0x2ae88b,_0x2dad83){_0x2dad83=_0x2dad83||0x1f4;return function(_0x5e0c36){logger[_0x01ad('0x32')](_0x5e0c36['stack']);if(_0x5e0c36[_0x01ad('0x33')]){delete _0x5e0c36[_0x01ad('0x33')];}_0x2ae88b[_0x01ad('0x21')](_0x2dad83)[_0x01ad('0x34')](_0x5e0c36);};}exports[_0x01ad('0x35')]=function(_0x15e0b7,_0x45ae85){var _0x3f3a8c={},_0x1ec70c={},_0x55cd68={'count':0x0,'rows':[]};var _0x446b57=_[_0x01ad('0x36')](db[_0x01ad('0x37')][_0x01ad('0x38')],function(_0x2eda1c){return{'name':_0x2eda1c['fieldName'],'type':_0x2eda1c[_0x01ad('0x39')][_0x01ad('0x3a')]};});_0x1ec70c[_0x01ad('0x3b')]=_[_0x01ad('0x36')](_0x446b57,'name');_0x1ec70c[_0x01ad('0x3c')]=_[_0x01ad('0x3d')](_0x15e0b7['query']);_0x1ec70c[_0x01ad('0x3e')]=_[_0x01ad('0x3f')](_0x1ec70c[_0x01ad('0x3b')],_0x1ec70c['query']);_0x3f3a8c[_0x01ad('0x40')]=_[_0x01ad('0x3f')](_0x1ec70c[_0x01ad('0x3b')],qs[_0x01ad('0x41')](_0x15e0b7[_0x01ad('0x3c')][_0x01ad('0x41')]));_0x3f3a8c['attributes']=_0x3f3a8c['attributes']['length']?_0x3f3a8c[_0x01ad('0x40')]:_0x1ec70c[_0x01ad('0x3b')];if(!_0x15e0b7[_0x01ad('0x3c')][_0x01ad('0x42')](_0x01ad('0x43'))){_0x3f3a8c[_0x01ad('0x25')]=qs[_0x01ad('0x25')](_0x15e0b7[_0x01ad('0x3c')]['limit']);_0x3f3a8c['offset']=qs[_0x01ad('0x24')](_0x15e0b7[_0x01ad('0x3c')][_0x01ad('0x24')]);}_0x3f3a8c[_0x01ad('0x44')]=qs[_0x01ad('0x45')](_0x15e0b7[_0x01ad('0x3c')][_0x01ad('0x45')]);_0x3f3a8c[_0x01ad('0x46')]=qs[_0x01ad('0x3e')](_[_0x01ad('0x47')](_0x15e0b7[_0x01ad('0x3c')],_0x1ec70c[_0x01ad('0x3e')]),_0x446b57);if(_0x15e0b7[_0x01ad('0x3c')][_0x01ad('0x48')]){_0x3f3a8c[_0x01ad('0x46')]=_[_0x01ad('0x49')](_0x3f3a8c[_0x01ad('0x46')],{'$or':_[_0x01ad('0x36')](_0x446b57,function(_0x3ee205){if(_0x3ee205[_0x01ad('0x39')]!==_0x01ad('0x4a')){var _0x52e951={};_0x52e951[_0x3ee205[_0x01ad('0x33')]]={'$like':'%'+_0x15e0b7[_0x01ad('0x3c')]['filter']+'%'};return _0x52e951;}})});}_0x3f3a8c=_['merge']({},_0x3f3a8c,_0x15e0b7['options']);var _0x3950c8={'where':_0x3f3a8c[_0x01ad('0x46')]};return db['Plugin']['count'](_0x3950c8)['then'](function(_0x3373a5){_0x55cd68['count']=_0x3373a5;if(_0x15e0b7[_0x01ad('0x3c')][_0x01ad('0x4b')]){_0x3f3a8c[_0x01ad('0x4c')]=[{'all':!![]}];}return db['Plugin'][_0x01ad('0x4d')](_0x3f3a8c);})['then'](function(_0x379903){_0x55cd68[_0x01ad('0x4e')]=_0x379903;return _0x55cd68;})['then'](respondWithFilteredResult(_0x45ae85,_0x3f3a8c))[_0x01ad('0x4f')](handleError(_0x45ae85,null));};exports['show']=function(_0xddfcce,_0x344e6f){var _0x43f0d7={'raw':!![],'where':{'id':_0xddfcce['params']['id']}},_0x357c03={};_0x357c03[_0x01ad('0x3b')]=_['keys'](db[_0x01ad('0x37')][_0x01ad('0x38')]);_0x357c03['query']=_[_0x01ad('0x3d')](_0xddfcce[_0x01ad('0x3c')]);_0x357c03[_0x01ad('0x3e')]=_[_0x01ad('0x3f')](_0x357c03[_0x01ad('0x3b')],_0x357c03['query']);_0x43f0d7['attributes']=_[_0x01ad('0x3f')](_0x357c03['model'],qs[_0x01ad('0x41')](_0xddfcce[_0x01ad('0x3c')][_0x01ad('0x41')]));_0x43f0d7[_0x01ad('0x40')]=_0x43f0d7['attributes'][_0x01ad('0x50')]?_0x43f0d7[_0x01ad('0x40')]:_0x357c03[_0x01ad('0x3b')];if(_0xddfcce['query'][_0x01ad('0x4b')]){_0x43f0d7[_0x01ad('0x4c')]=[{'all':!![]}];}_0x43f0d7=_['merge']({},_0x43f0d7,_0xddfcce[_0x01ad('0x51')]);return db[_0x01ad('0x37')][_0x01ad('0x52')](_0x43f0d7)[_0x01ad('0x2c')](handleEntityNotFound(_0x344e6f,null))['then'](respondWithResult(_0x344e6f,null))[_0x01ad('0x4f')](handleError(_0x344e6f,null));};exports[_0x01ad('0x53')]=function(_0x33ebf1,_0x1699e4,_0x5d8401){return db['Plugin'][_0x01ad('0x52')]({'where':{'id':_0x33ebf1[_0x01ad('0x54')]['id']},'attributes':['name',_0x01ad('0x8')],'raw':!![]})[_0x01ad('0x2c')](handleEntityNotFound(_0x1699e4,null))['then'](function(_0x2474b9){if(_0x2474b9){var _0x407d34=path['join'](config['root'],_0x01ad('0x55'),util[_0x01ad('0x56')](_0x01ad('0x57'),path[_0x01ad('0x58')](_0x2474b9[_0x01ad('0x8')])));var _0x116415=fs[_0x01ad('0x59')](_0x407d34);var _0x583b96=archiver(_0x01ad('0x5a'),{'zlib':{'level':0x9}});_0x583b96['on'](_0x01ad('0x5b'),function(_0x2da772){if(_0x2da772[_0x01ad('0x5c')]==='ENOENT'){logger[_0x01ad('0x32')](_0x2da772);}else{throw new db[(_0x01ad('0x5d'))][(_0x01ad('0x5e'))](_0x01ad('0x5f'));}});_0x583b96['on'](_0x01ad('0x32'),function(_0x3bd3d0){throw new db[(_0x01ad('0x5d'))][(_0x01ad('0x5e'))](_0x01ad('0x5f'));});_0x583b96[_0x01ad('0x60')](_0x116415);_0x583b96[_0x01ad('0x61')]('**/*',{'cwd':path[_0x01ad('0x62')](config[_0x01ad('0x63')],_0x01ad('0x55'),path[_0x01ad('0x64')](_0x2474b9[_0x01ad('0x8')])),'ignore':[path[_0x01ad('0x62')](path[_0x01ad('0x58')](_0x2474b9[_0x01ad('0x8')]),_0x01ad('0x65')),path[_0x01ad('0x62')](path[_0x01ad('0x58')](_0x2474b9[_0x01ad('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x01ad('0x66')]();_0x116415['on'](_0x01ad('0x67'),function(){if(!fs['existsSync'](_0x407d34)){throw new db[(_0x01ad('0x5d'))][(_0x01ad('0x5e'))](_0x01ad('0x68'));}return _0x1699e4[_0x01ad('0x53')](_0x407d34,util['format'](_0x01ad('0x57'),path[_0x01ad('0x58')](_0x2474b9[_0x01ad('0x8')])),function(_0x23828f){if(_0x23828f){throw new db[(_0x01ad('0x5d'))]['Error'](_0x01ad('0x69'));}fs[_0x01ad('0x6a')](_0x407d34);logger['info'](_0x01ad('0x6b'));logger['info'](_0x01ad('0x6c'));});});}return null;})[_0x01ad('0x4f')](handleError(_0x1699e4,null));};exports['upload']=function(_0x184288,_0x5daaf6,_0x1add58){var _0x323ca9=path[_0x01ad('0x58')](_0x184288[_0x01ad('0x6d')][_0x01ad('0x6e')],path[_0x01ad('0x6f')](_0x184288[_0x01ad('0x6d')]['filename']));var _0x88f3d0=path[_0x01ad('0x62')](config[_0x01ad('0x63')],_0x01ad('0x55'),_0x184288['file'][_0x01ad('0x6e')]);var _0x25a5a7=path[_0x01ad('0x62')](config[_0x01ad('0x63')],'server/files/plugins',_0x323ca9);logger[_0x01ad('0x70')](_0x01ad('0x71'),_0x88f3d0);logger[_0x01ad('0x70')](_0x01ad('0x72'),_0x25a5a7);try{fs['chmodSync'](_0x88f3d0,parseInt('0777',0x8));extract(_0x88f3d0,{'dir':_0x25a5a7},function(_0x9e06d7){if(_0x9e06d7){logger['error'](_0x9e06d7);handleError(_0x9e06d7,!![]);};var _0x4dfe7d=fs['readdirSync'](_0x25a5a7);if(_0x4dfe7d[_0x01ad('0x50')]>0x1){removeReferences(_0x88f3d0,_0x25a5a7);logger[_0x01ad('0x32')](_0x01ad('0x73'));return _0x1add58(new Error(_0x01ad('0x73')));}var _0x44509f=fs['lstatSync'](path[_0x01ad('0x62')](_0x25a5a7,_0x4dfe7d[0x0]));if(_0x44509f[_0x01ad('0x74')]()){removeReferences(_0x88f3d0,_0x25a5a7);logger[_0x01ad('0x32')](_0x01ad('0x73'));return _0x1add58(new Error(_0x01ad('0x73')));}if(_0x44509f['isDirectory']()){var _0x559f89=fs[_0x01ad('0x75')](path[_0x01ad('0x62')](_0x25a5a7,_0x4dfe7d[0x0]));if(_0x559f89['length']===0x0){removeReferences(_0x88f3d0,_0x25a5a7);logger[_0x01ad('0x32')](_0x01ad('0x73'));return _0x1add58(new Error(_0x01ad('0x73')));}var _0x1a8797=_0x559f89[_0x01ad('0x76')](function(_0x3c1927){return _0x3c1927===_0x01ad('0x77');});if(!_0x1a8797){return _0x1add58(new Error(_0x01ad('0x78')));}var _0x3714c5=fs[_0x01ad('0x79')](path[_0x01ad('0x62')](_0x25a5a7,_0x4dfe7d[0x0],_0x01ad('0x77')));var _0x56987a=JSON['parse'](_0x3714c5);if('undefined'==typeof _0x56987a['name']){return _0x1add58(new Error(_0x01ad('0x7a')));}if(_0x01ad('0x7b')==typeof _0x56987a['type']){return _0x1add58(new Error(_0x01ad('0x7c')));}if(_0x01ad('0x7b')==typeof _0x56987a[_0x01ad('0x7d')]){return _0x1add58(new Error(_0x01ad('0x7e')));}if(_0x01ad('0x7b')==typeof _0x56987a[_0x01ad('0x7f')]){return _0x1add58(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x56987a[_0x01ad('0x39')]===_0x01ad('0x80')){if(_0x01ad('0x7b')==typeof _0x56987a['parameters'][_0x01ad('0x81')]){return _0x1add58(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x01ad('0x7b')==typeof _0x56987a[_0x01ad('0x7f')][_0x01ad('0x81')]['admin']&&_0x01ad('0x7b')==typeof _0x56987a[_0x01ad('0x7f')]['views']['agent']){return _0x1add58(new Error(_0x01ad('0x82')));}}else if(_0x56987a[_0x01ad('0x39')]==='script'){if(_0x01ad('0x7b')==typeof _0x56987a['parameters'][_0x01ad('0x83')]){return _0x1add58(new Error(_0x01ad('0x84')));}if(_0x01ad('0x7b')==typeof _0x56987a[_0x01ad('0x7f')][_0x01ad('0x85')]){return _0x1add58(new Error(_0x01ad('0x86')));}}else{return _0x1add58(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x2cb816=_0x56987a[_0x01ad('0x33')];var _0x60804f=_0x56987a[_0x01ad('0x87')];var _0x2f4c63=_0x56987a[_0x01ad('0x39')];var _0x30c744=_0x56987a['sidebar']?_0x56987a[_0x01ad('0x88')]:_0x01ad('0x89');var _0x4a7580=_0x56987a[_0x01ad('0x8a')]?_0x56987a[_0x01ad('0x8a')]:_0x01ad('0x8b');var _0x13b54a='';var _0x489107='';var _0x47f7c1='';var _0x45bc9c='';var _0x294418=_0x56987a[_0x01ad('0x7d')];if(_0x2f4c63===_0x01ad('0x80')){if(_0x01ad('0x7b')!=typeof _0x56987a['parameters'][_0x01ad('0x81')][_0x01ad('0x8c')]){var _0x30a948=_0x56987a[_0x01ad('0x7f')]['views'][_0x01ad('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x01ad('0x8d')](_0x30a948)){_0x13b54a=path[_0x01ad('0x62')](_0x01ad('0x8e'),_0x323ca9,_0x4dfe7d[0x0],_0x30a948);}else{_0x13b54a=_0x30a948;}}else{logger[_0x01ad('0x70')](_0x01ad('0x8f'));}if('undefined'!=typeof _0x56987a['parameters'][_0x01ad('0x81')][_0x01ad('0x90')]){var _0x3222c0=_0x56987a[_0x01ad('0x7f')][_0x01ad('0x81')][_0x01ad('0x90')];if(!/^(f|ht)tps?:\/\//i[_0x01ad('0x8d')](_0x3222c0)){_0x489107=path[_0x01ad('0x62')]('plugins',_0x323ca9,_0x4dfe7d[0x0],_0x3222c0);}else{_0x489107=_0x3222c0;}}else{logger[_0x01ad('0x70')](_0x01ad('0x91'));}}else if(_0x2f4c63===_0x01ad('0x92')){_0x47f7c1=_0x56987a[_0x01ad('0x7f')][_0x01ad('0x83')];_0x45bc9c=_0x56987a[_0x01ad('0x7f')][_0x01ad('0x85')];if(_0x01ad('0x7b')!=typeof _0x56987a['parameters'][_0x01ad('0x81')]){if(_0x01ad('0x7b')!=typeof _0x56987a['parameters'][_0x01ad('0x81')][_0x01ad('0x8c')]){var _0x30a948=_0x56987a[_0x01ad('0x7f')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x01ad('0x8d')](_0x30a948)){_0x13b54a=path['join'](_0x01ad('0x8e'),_0x323ca9,_0x4dfe7d[0x0],_0x30a948);}else{_0x13b54a=_0x30a948;}}if(_0x01ad('0x7b')!=typeof _0x56987a[_0x01ad('0x7f')][_0x01ad('0x81')][_0x01ad('0x90')]){var _0x3222c0=_0x56987a[_0x01ad('0x7f')][_0x01ad('0x81')][_0x01ad('0x90')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3222c0)){_0x489107=path[_0x01ad('0x62')](_0x01ad('0x8e'),_0x323ca9,_0x4dfe7d[0x0],_0x3222c0);}else{_0x489107=_0x3222c0;}}}}var _0x32af16={'name':_0x2cb816,'description':_0x60804f,'path':path['join'](_0x323ca9,_0x4dfe7d[0x0]),'type':_0x2f4c63,'sidebar':_0x30c744,'icon':_0x4a7580,'adminUrl':_0x13b54a,'agentUrl':_0x489107,'scriptName':_0x47f7c1,'scriptPath':_0x45bc9c,'version':_0x294418};removeReferences(_0x88f3d0,null);return db[_0x01ad('0x37')][_0x01ad('0x93')](_0x32af16)['then'](function(_0x3b8aa4){var _0x14843e={'role':_0x184288[_0x01ad('0x94')]['role'],'userProfileId':_0x184288[_0x01ad('0x94')]['userProfileId']};if(!_0x14843e)throw new Error(_0x01ad('0x95'));if(_0x14843e['role']==='user'){var _0x4bbfaf=_0x3b8aa4[_0x01ad('0x2e')]({'plain':!![]});return db[_0x01ad('0x96')]['find']({'where':{'name':_0x01ad('0x2f'),'userProfileId':_0x14843e[_0x01ad('0x97')]},'raw':!![]})[_0x01ad('0x2c')](function(_0x44acbe){if(_0x44acbe&&_0x44acbe[_0x01ad('0x98')]===0x0){return db[_0x01ad('0x30')][_0x01ad('0x93')]({'name':_0x4bbfaf['name'],'resourceId':_0x4bbfaf['id'],'type':_0x44acbe['name'],'sectionId':_0x44acbe['id']},{})[_0x01ad('0x2c')](function(){return _0x3b8aa4;});}else{return _0x3b8aa4;}})[_0x01ad('0x4f')](function(_0x42d135){logger[_0x01ad('0x32')](_0x01ad('0x99'),_0x42d135);throw _0x42d135;});}return _0x3b8aa4;})['then'](respondWithResult(_0x5daaf6,null))[_0x01ad('0x4f')](handleError(_0x5daaf6,null));}});}catch(_0x3b7208){_0x5daaf6[_0x01ad('0x21')](0x1f4)[_0x01ad('0x34')](_0x3b7208);}};function removeReferences(_0xef06dc,_0x51b6d8){try{if(_0xef06dc){fs['unlinkSync'](_0xef06dc);logger['info'](_0x01ad('0x9a'));}if(_0x51b6d8){rimraf(_0x51b6d8,function(){});logger[_0x01ad('0x70')]('Extracted\x20folder\x20removed');}}catch(_0x41a909){logger[_0x01ad('0x32')](_0x41a909);}}exports[_0x01ad('0x2b')]=function(_0x249bf3,_0x553fa8,_0x2a362e){return db[_0x01ad('0x37')]['find']({'where':{'id':_0x249bf3[_0x01ad('0x54')]['id']}})[_0x01ad('0x2c')](handleEntityNotFound(_0x553fa8,null))[_0x01ad('0x2c')](saveUpdates(_0x249bf3[_0x01ad('0x94')],null))[_0x01ad('0x2c')](respondWithResult(_0x553fa8,null))[_0x01ad('0x4f')](handleError(_0x553fa8,null));};exports[_0x01ad('0x9b')]=function(_0x5b3da8,_0x5bd7a6,_0x2d287a){return db[_0x01ad('0x37')]['find']({'where':{'id':_0x5b3da8['params']['id']}})[_0x01ad('0x2c')](function(_0x2aa8aa){if(_0x2aa8aa){return _0x2aa8aa[_0x01ad('0x2d')]();}})[_0x01ad('0x2c')](function(_0x28253e){rimraf(path[_0x01ad('0x62')](config[_0x01ad('0x63')],_0x01ad('0x55'),path[_0x01ad('0x64')](_0x28253e[_0x01ad('0x8')])),function(){});return _0x28253e;})[_0x01ad('0x2c')](handleEntityNotFound(_0x5bd7a6,null))[_0x01ad('0x2c')](respondWithStatusCode(_0x5bd7a6,null))[_0x01ad('0x4f')](handleError(_0x5bd7a6,null));};exports['webhookGet']=function(_0x1420e7,_0x4dd87a,_0x152ec1){return BPromise[_0x01ad('0x9c')]()['then'](function(){if(!_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x9d')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x706c33=_0x1420e7['query'][_0x01ad('0x9e')]?_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x9e')]+':'+_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x9d')]:_0x01ad('0x9f')+_0x1420e7[_0x01ad('0x3c')]['port'];var _0x4d5551=_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x22')]?_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x22')]:!![];var _0x52aa6a=_0x1420e7[_0x01ad('0x3c')][_0x01ad('0xa0')]?_0x1420e7[_0x01ad('0x3c')]['encoding']:null;var _0x2adb85={'method':_0x1420e7[_0x01ad('0xa1')],'uri':util[_0x01ad('0x56')](_0x01ad('0xa2'),_0x706c33,_0x1420e7['query'][_0x01ad('0x8')]),'json':_0x4d5551,'resolveWithFullResponse':!![],'encoding':_0x52aa6a,'qs':_0x1420e7[_0x01ad('0x3c')]};if(_0x1420e7[_0x01ad('0xa3')]){_0x2adb85[_0x01ad('0xa3')]=_0x1420e7[_0x01ad('0xa3')];if(_0x2adb85[_0x01ad('0xa3')][_0x01ad('0xa4')]){delete _0x2adb85[_0x01ad('0xa3')][_0x01ad('0xa4')];}}if(_0x2adb85['headers']['content-type']){delete _0x2adb85[_0x01ad('0xa3')][_0x01ad('0xa5')];}return rp(_0x2adb85);})[_0x01ad('0x2c')](function(_0x15995c){if(_0x15995c){_0x4dd87a['set'](_0x15995c[_0x01ad('0xa3')]);logger[_0x01ad('0x70')](_0x15995c['body']);if(_[_0x01ad('0xa6')](_0x1420e7[_0x01ad('0x3c')][_0x01ad('0x8')],'download')&&_0x15995c[_0x01ad('0xa7')]==0x1f4){return _0x4dd87a[_0x01ad('0x20')](_0x15995c[_0x01ad('0xa7')]);}else{return _0x4dd87a[_0x01ad('0x21')](_0x15995c[_0x01ad('0xa7')])[_0x01ad('0x34')](_0x15995c[_0x01ad('0x94')]);}}else{return _0x4dd87a[_0x01ad('0x20')](0xc8);}})[_0x01ad('0x4f')](handleError(_0x4dd87a,null));};exports[_0x01ad('0xa8')]=function(_0x1bad66,_0x268a4c,_0x54b349){return BPromise[_0x01ad('0x9c')]()[_0x01ad('0x2c')](function(){if(!_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x8')]){throw new Error(_0x01ad('0xa9'));}if(!_0x1bad66[_0x01ad('0x3c')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2a67ca=_0x1bad66['query'][_0x01ad('0x9e')]?_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x9e')]+':'+_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x9d')]:'http://localhost:'+_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x9d')];var _0x4a1362=_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x22')]?_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x22')]:!![];var _0x15e326=_0x1bad66[_0x01ad('0x3c')][_0x01ad('0xa0')]?_0x1bad66['query']['encoding']:null;var _0x33e098={'method':_0x1bad66[_0x01ad('0xa1')],'uri':util[_0x01ad('0x56')]('%s%s',_0x2a67ca,_0x1bad66[_0x01ad('0x3c')][_0x01ad('0x8')]),'json':_0x4a1362,'resolveWithFullResponse':!![],'encoding':_0x15e326,'body':_0x1bad66['body']};if(_0x1bad66['headers']){_0x33e098[_0x01ad('0xa3')]=_0x1bad66['headers'];if(_0x33e098['headers'][_0x01ad('0xa4')]){delete _0x33e098[_0x01ad('0xa3')][_0x01ad('0xa4')];}}if(_0x33e098[_0x01ad('0xa3')][_0x01ad('0xa5')]){delete _0x33e098[_0x01ad('0xa3')]['content-type'];}return rp(_0x33e098);})[_0x01ad('0x2c')](function(_0x51ab90){if(_0x51ab90){_0x268a4c[_0x01ad('0x26')](_0x51ab90[_0x01ad('0xa3')]);logger[_0x01ad('0x70')](_0x51ab90[_0x01ad('0x94')]);return _0x268a4c[_0x01ad('0x21')](_0x51ab90[_0x01ad('0xa7')])['send'](_0x51ab90[_0x01ad('0x94')]);}else{return _0x268a4c[_0x01ad('0x20')](0xc8);}})['catch'](handleError(_0x268a4c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 94a6c41..3b88866 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 _0xb145=['exports','../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3c4feb,_0x2d82b2){var _0x77a197=function(_0x5c26a4){while(--_0x5c26a4){_0x3c4feb['push'](_0x3c4feb['shift']());}};_0x77a197(++_0x2d82b2);}(_0xb145,0xa3));var _0x5b14=function(_0x4809fc,_0x311ece){_0x4809fc=_0x4809fc-0x0;var _0x5925ce=_0xb145[_0x4809fc];return _0x5925ce;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5b14('0x0'))['db'][_0x5b14('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5b14('0x2')](0x0);var events={'afterCreate':_0x5b14('0x3'),'afterUpdate':_0x5b14('0x4'),'afterDestroy':_0x5b14('0x5')};function emitEvent(_0x31f6f0){return function(_0x34b4cd,_0x5111cd,_0x1e0b5b){PluginEvents[_0x5b14('0x6')](_0x31f6f0+':'+_0x34b4cd['id'],_0x34b4cd);PluginEvents[_0x5b14('0x6')](_0x31f6f0,_0x34b4cd);_0x1e0b5b(null);};}for(var e in events){if(events[_0x5b14('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5b14('0x8')]=PluginEvents; \ No newline at end of file +var _0xd7d1=['update','remove','emit','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x17dc86,_0xa76797){_0x17dc86=_0x17dc86-0x0;var _0x9bdc27=_0xd7d1[_0x17dc86];return _0x9bdc27;};'use strict';var EventEmitter=require(_0x1d7d('0x0'));var Plugin=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x1d7d('0x3')](0x0);var events={'afterCreate':_0x1d7d('0x4'),'afterUpdate':_0x1d7d('0x5'),'afterDestroy':_0x1d7d('0x6')};function emitEvent(_0x27b5d8){return function(_0x1ac097,_0x1adb6b,_0x3c0839){PluginEvents[_0x1d7d('0x7')](_0x27b5d8+':'+_0x1ac097['id'],_0x1ac097);PluginEvents[_0x1d7d('0x7')](_0x27b5d8,_0x1ac097);_0x3c0839(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x1d7d('0x8')](e,emitEvent(event));}}module[_0x1d7d('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index bc76831..71d572b 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 _0x8fd6=['../../config/logger','api','bluebird','request-promise','path','rimraf','./plugin.attributes','exports','define','plugins','lodash','util'];(function(_0x28d657,_0x28279e){var _0x3057e9=function(_0x452fbc){while(--_0x452fbc){_0x28d657['push'](_0x28d657['shift']());}};_0x3057e9(++_0x28279e);}(_0x8fd6,0x1ae));var _0x68fd=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0x8fd6[_0x50aea5];return _0x4657f1;};'use strict';var _=require(_0x68fd('0x0'));var util=require(_0x68fd('0x1'));var logger=require(_0x68fd('0x2'))(_0x68fd('0x3'));var moment=require('moment');var BPromise=require(_0x68fd('0x4'));var rp=require(_0x68fd('0x5'));var fs=require('fs');var path=require(_0x68fd('0x6'));var rimraf=require(_0x68fd('0x7'));var config=require('../../config/environment');var attributes=require(_0x68fd('0x8'));module[_0x68fd('0x9')]=function(_0x40447d,_0x2524ea){return _0x40447d[_0x68fd('0xa')]('Plugin',attributes,{'tableName':_0x68fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe43=['util','../../config/logger','api','moment','bluebird','request-promise','path','./plugin.attributes','exports','define','Plugin','plugins','lodash'];(function(_0x3c0569,_0x11da9f){var _0x142524=function(_0x59a41e){while(--_0x59a41e){_0x3c0569['push'](_0x3c0569['shift']());}};_0x142524(++_0x11da9f);}(_0xbe43,0xf6));var _0x3be4=function(_0x1f3cb0,_0x279c68){_0x1f3cb0=_0x1f3cb0-0x0;var _0x2bfd4a=_0xbe43[_0x1f3cb0];return _0x2bfd4a;};'use strict';var _=require(_0x3be4('0x0'));var util=require(_0x3be4('0x1'));var logger=require(_0x3be4('0x2'))(_0x3be4('0x3'));var moment=require(_0x3be4('0x4'));var BPromise=require(_0x3be4('0x5'));var rp=require(_0x3be4('0x6'));var fs=require('fs');var path=require(_0x3be4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3be4('0x8'));module[_0x3be4('0x9')]=function(_0x94f830,_0x52fe40){return _0x94f830[_0x3be4('0xa')](_0x3be4('0xb'),attributes,{'tableName':_0x3be4('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 adda8c0..7c6e051 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 _0xc5b5=['info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','request','then'];(function(_0x5641d9,_0x1de53b){var _0x1b1f89=function(_0x27b5b3){while(--_0x27b5b3){_0x5641d9['push'](_0x5641d9['shift']());}};_0x1b1f89(++_0x1de53b);}(_0xc5b5,0x15a));var _0x5c5b=function(_0xf64500,_0x410815){_0xf64500=_0xf64500-0x0;var _0x58a6e0=_0xc5b5[_0xf64500];return _0x58a6e0;};'use strict';var _=require(_0x5c5b('0x0'));var util=require(_0x5c5b('0x1'));var moment=require(_0x5c5b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c5b('0x3'));var db=require(_0x5c5b('0x4'))['db'];var utils=require(_0x5c5b('0x5'));var logger=require(_0x5c5b('0x6'))(_0x5c5b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5c5b('0x8')][_0x5c5b('0x9')]({'port':0x232a});config[_0x5c5b('0xa')]=_[_0x5c5b('0xb')](config[_0x5c5b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5c5b('0xc'))(new Redis(config[_0x5c5b('0xa')]));require(_0x5c5b('0xd'))[_0x5c5b('0xe')](socket);function respondWithRpcPromise(_0x553b4c,_0x1db9e4,_0x2e5780){return new BPromise(function(_0x52c4eb,_0x47a3db){return client[_0x5c5b('0xf')](_0x553b4c,_0x2e5780)[_0x5c5b('0x10')](function(_0x337fb8){logger[_0x5c5b('0x11')](_0x5c5b('0x12'),_0x1db9e4,_0x5c5b('0x13'));logger[_0x5c5b('0x14')](_0x5c5b('0x15'),_0x1db9e4,'request\x20sent',JSON[_0x5c5b('0x16')](_0x337fb8));if(_0x337fb8[_0x5c5b('0x17')]){if(_0x337fb8[_0x5c5b('0x17')][_0x5c5b('0x18')]===0x1f4){logger[_0x5c5b('0x17')]('Plugin,\x20%s,\x20%s',_0x1db9e4,_0x337fb8[_0x5c5b('0x17')][_0x5c5b('0x19')]);return _0x47a3db(_0x337fb8[_0x5c5b('0x17')][_0x5c5b('0x19')]);}logger[_0x5c5b('0x17')](_0x5c5b('0x12'),_0x1db9e4,_0x337fb8[_0x5c5b('0x17')][_0x5c5b('0x19')]);return _0x52c4eb(_0x337fb8[_0x5c5b('0x17')][_0x5c5b('0x19')]);}else{logger[_0x5c5b('0x11')](_0x5c5b('0x12'),_0x1db9e4,'request\x20sent');_0x52c4eb(_0x337fb8[_0x5c5b('0x1a')][_0x5c5b('0x19')]);}})[_0x5c5b('0x1b')](function(_0x39267b){logger['error']('Plugin,\x20%s,\x20%s',_0x1db9e4,_0x39267b);_0x47a3db(_0x39267b);});});}exports[_0x5c5b('0x1c')]=function(_0x5eb15c){var _0x5b8e00=this;return new Promise(function(_0x58729c,_0x48db72){return db[_0x5c5b('0x1d')][_0x5c5b('0x1e')](_0x5eb15c[_0x5c5b('0x1f')],{'raw':_0x5eb15c['options']?_0x5eb15c['options'][_0x5c5b('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x193d6e){logger['info'](_0x5c5b('0x1c'),_0x5eb15c);logger[_0x5c5b('0x14')]('CreatePlugin',_0x5eb15c,JSON[_0x5c5b('0x16')](_0x193d6e));_0x58729c(_0x193d6e);})[_0x5c5b('0x1b')](function(_0x994063){logger['error']('CreatePlugin',_0x994063[_0x5c5b('0x19')],_0x5eb15c);_0x48db72(_0x5b8e00['error'](0x1f4,_0x994063['message']));});});}; \ No newline at end of file +var _0xbc70=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreatePlugin','body','options','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbc70,0x1d3));var _0x0bc7=function(_0x3b27be,_0x62bc4d){_0x3b27be=_0x3b27be-0x0;var _0x44a01a=_0xbc70[_0x3b27be];return _0x44a01a;};'use strict';var _=require(_0x0bc7('0x0'));var util=require('util');var moment=require(_0x0bc7('0x1'));var BPromise=require(_0x0bc7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0bc7('0x3'));var db=require(_0x0bc7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0bc7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0bc7('0x6'));var client=jayson['client'][_0x0bc7('0x7')]({'port':0x232a});config[_0x0bc7('0x8')]=_[_0x0bc7('0x9')](config[_0x0bc7('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x0bc7('0xa'))(new Redis(config[_0x0bc7('0x8')]));require(_0x0bc7('0xb'))['register'](socket);function respondWithRpcPromise(_0x3a2746,_0x48dd74,_0x13ca32){return new BPromise(function(_0x8b370b,_0x58a564){return client[_0x0bc7('0xc')](_0x3a2746,_0x13ca32)[_0x0bc7('0xd')](function(_0x3184a9){logger['info'](_0x0bc7('0xe'),_0x48dd74,_0x0bc7('0xf'));logger[_0x0bc7('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x48dd74,'request\x20sent',JSON[_0x0bc7('0x11')](_0x3184a9));if(_0x3184a9['error']){if(_0x3184a9[_0x0bc7('0x12')][_0x0bc7('0x13')]===0x1f4){logger[_0x0bc7('0x12')]('Plugin,\x20%s,\x20%s',_0x48dd74,_0x3184a9[_0x0bc7('0x12')][_0x0bc7('0x14')]);return _0x58a564(_0x3184a9['error'][_0x0bc7('0x14')]);}logger[_0x0bc7('0x12')](_0x0bc7('0xe'),_0x48dd74,_0x3184a9['error'][_0x0bc7('0x14')]);return _0x8b370b(_0x3184a9['error'][_0x0bc7('0x14')]);}else{logger[_0x0bc7('0x15')](_0x0bc7('0xe'),_0x48dd74,_0x0bc7('0xf'));_0x8b370b(_0x3184a9[_0x0bc7('0x16')]['message']);}})['catch'](function(_0x43ed63){logger['error'](_0x0bc7('0xe'),_0x48dd74,_0x43ed63);_0x58a564(_0x43ed63);});});}exports[_0x0bc7('0x17')]=function(_0x4ece43){var _0xf257b3=this;return new Promise(function(_0x398c0e,_0x479ccb){return db['Plugin']['create'](_0x4ece43[_0x0bc7('0x18')],{'raw':_0x4ece43[_0x0bc7('0x19')]?_0x4ece43[_0x0bc7('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x0bc7('0xd')](function(_0x5d7c0b){logger[_0x0bc7('0x15')](_0x0bc7('0x17'),_0x4ece43);logger[_0x0bc7('0x10')](_0x0bc7('0x17'),_0x4ece43,JSON[_0x0bc7('0x11')](_0x5d7c0b));_0x398c0e(_0x5d7c0b);})['catch'](function(_0x3beb94){logger[_0x0bc7('0x12')](_0x0bc7('0x17'),_0x3beb94['message'],_0x4ece43);_0x479ccb(_0xf257b3[_0x0bc7('0x12')](0x1f4,_0x3beb94['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 49474c6..c670cee 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 _0x72f6=['remove','emit','removeListener','register','length','./plugin.events','save'];(function(_0x33b5bc,_0x46d509){var _0x382e39=function(_0x120736){while(--_0x120736){_0x33b5bc['push'](_0x33b5bc['shift']());}};_0x382e39(++_0x46d509);}(_0x72f6,0x1a9));var _0x672f=function(_0x4c9560,_0x372552){_0x4c9560=_0x4c9560-0x0;var _0x43e323=_0x72f6[_0x4c9560];return _0x43e323;};'use strict';var PluginEvents=require(_0x672f('0x0'));var events=[_0x672f('0x1'),_0x672f('0x2'),'update'];function createListener(_0x2628a9,_0x3c453b){return function(_0x17ae6c){_0x3c453b[_0x672f('0x3')](_0x2628a9,_0x17ae6c);};}function removeListener(_0x4c4261,_0x403bf0){return function(){PluginEvents[_0x672f('0x4')](_0x4c4261,_0x403bf0);};}exports[_0x672f('0x5')]=function(_0x56d5c8){for(var _0x5cdec=0x0,_0x2b7630=events[_0x672f('0x6')];_0x5cdec<_0x2b7630;_0x5cdec++){var _0xdea452=events[_0x5cdec];var _0x19c0d2=createListener('plugin:'+_0xdea452,_0x56d5c8);PluginEvents['on'](_0xdea452,_0x19c0d2);}}; \ No newline at end of file +var _0x32bb=['emit','removeListener','length','save','remove','update'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x32bb,0x87));var _0xb32b=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0x32bb[_0x15a634];return _0xf4f7a0;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xb32b('0x0'),_0xb32b('0x1'),_0xb32b('0x2')];function createListener(_0x4f92b7,_0x40a42b){return function(_0x20d2bd){_0x40a42b[_0xb32b('0x3')](_0x4f92b7,_0x20d2bd);};}function removeListener(_0x3d6cf4,_0x3fd14e){return function(){PluginEvents[_0xb32b('0x4')](_0x3d6cf4,_0x3fd14e);};}exports['register']=function(_0x33e1f5){for(var _0x42788b=0x0,_0x15951c=events[_0xb32b('0x5')];_0x42788b<_0x15951c;_0x42788b++){var _0x3eefae=events[_0x42788b];var _0x4ff2c5=createListener('plugin:'+_0x3eefae,_0x33e1f5);PluginEvents['on'](_0x3eefae,_0x4ff2c5);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 18f8475..43be9c4 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 _0x5945=['create','put','update','delete','destroy','exports','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0x5945,0x110));var _0x5594=function(_0x37ad1c,_0x247bd6){_0x37ad1c=_0x37ad1c-0x0;var _0xedeefb=_0x5945[_0x37ad1c];return _0xedeefb;};'use strict';var express=require(_0x5594('0x0'));var router=express[_0x5594('0x1')]();var auth=require(_0x5594('0x2'));var controller=require('./pm2.controller');router[_0x5594('0x3')]('/',auth[_0x5594('0x4')](),controller[_0x5594('0x5')]);router[_0x5594('0x3')](_0x5594('0x6'),auth[_0x5594('0x4')](),controller[_0x5594('0x7')]);router['post']('/',auth[_0x5594('0x4')](),controller[_0x5594('0x8')]);router[_0x5594('0x9')]('/:id',auth[_0x5594('0x4')](),controller[_0x5594('0xa')]);router[_0x5594('0xb')](_0x5594('0x6'),auth[_0x5594('0x4')](),controller[_0x5594('0xc')]);module[_0x5594('0xd')]=router; \ No newline at end of file +var _0xb430=['/:id','show','post','create','put','update','delete','express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated','index'];(function(_0x1415ef,_0x5c219e){var _0x234acc=function(_0x2dbfca){while(--_0x2dbfca){_0x1415ef['push'](_0x1415ef['shift']());}};_0x234acc(++_0x5c219e);}(_0xb430,0xf5));var _0x0b43=function(_0x5c4f6b,_0x2cdfce){_0x5c4f6b=_0x5c4f6b-0x0;var _0x104c4e=_0xb430[_0x5c4f6b];return _0x104c4e;};'use strict';var express=require(_0x0b43('0x0'));var router=express[_0x0b43('0x1')]();var auth=require(_0x0b43('0x2'));var controller=require(_0x0b43('0x3'));router[_0x0b43('0x4')]('/',auth[_0x0b43('0x5')](),controller[_0x0b43('0x6')]);router['get'](_0x0b43('0x7'),auth['isAuthenticated'](),controller[_0x0b43('0x8')]);router[_0x0b43('0x9')]('/',auth[_0x0b43('0x5')](),controller[_0x0b43('0xa')]);router[_0x0b43('0xb')]('/:id',auth[_0x0b43('0x5')](),controller[_0x0b43('0xc')]);router[_0x0b43('0xd')](_0x0b43('0x7'),auth[_0x0b43('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 0b54c27..f58fef3 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 _0x85dc=['bluebird','sendStatus','status','error','name','send','npm\x20install','info','index','list','then','reject','express','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','hasOwnProperty','Unknown\x20status','destroy','params','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x85dc,0x18a));var _0xc85d=function(_0x488b2e,_0x418f06){_0x488b2e=_0x488b2e-0x0;var _0x247710=_0x85dc[_0x488b2e];return _0x247710;};'use strict';var _=require(_0xc85d('0x0'));var pm2=require(_0xc85d('0x1'));var logger=require(_0xc85d('0x2'))(_0xc85d('0x3'));var path=require(_0xc85d('0x4'));var exec=require(_0xc85d('0x5'))['exec'];var BPromise=require(_0xc85d('0x6'));function handleEntityNotFound(_0x1c93e8,_0x2c76d5){return function(_0xf78d7f){if(!_0xf78d7f){_0x1c93e8[_0xc85d('0x7')](0x194);;}return _0xf78d7f;};}function respondWithResult(_0x5d0f5b,_0xbc6507){_0xbc6507=_0xbc6507||0xc8;return function(_0x4e60d2){if(_0x4e60d2){return _0x5d0f5b[_0xc85d('0x8')](_0xbc6507)['json'](_0x4e60d2);}return null;};}function handleError(_0x1dadc6,_0x195f20){_0x195f20=_0x195f20||0x1f4;return function(_0xda6df4){logger[_0xc85d('0x9')](_0xda6df4['stack']);if(_0xda6df4['name']){delete _0xda6df4[_0xc85d('0xa')];}_0x1dadc6[_0xc85d('0x8')](_0x195f20)[_0xc85d('0xb')](_0xda6df4);};}function execChildProcess(){return new BPromise(function(_0x4c238a,_0x42a0df){exec(_0xc85d('0xc'),function(_0x5d56db,_0x31ae37,_0x339ff7){logger[_0xc85d('0xd')](_0x31ae37);logger[_0xc85d('0xd')](_0x339ff7);if(_0x5d56db){logger[_0xc85d('0x9')](_0x5d56db);return _0x42a0df(_0x5d56db);}return _0x4c238a(_0x31ae37);});});}exports[_0xc85d('0xe')]=function(_0x2c496a,_0x5bf6b1){return pm2[_0xc85d('0xf')]()[_0xc85d('0x10')](function(_0x4eb366){if(_0x4eb366){var _0x23debb=_[_0xc85d('0x11')](_0x4eb366,function(_0x162315){return _0x162315[_0xc85d('0xa')]===_0xc85d('0x12')||_0x162315[_0xc85d('0xa')]==='motion2';});return{'rows':_0x23debb,'count':_0x23debb[_0xc85d('0x13')]};}return null;})[_0xc85d('0x10')](respondWithResult(_0x5bf6b1,null))[_0xc85d('0x14')](handleError(_0x5bf6b1,null));};exports[_0xc85d('0x15')]=function(_0x47f015,_0x304862){return pm2[_0xc85d('0x16')](_0x47f015['params']['id'])[_0xc85d('0x10')](respondWithResult(_0x304862,null))[_0xc85d('0x10')](handleEntityNotFound(_0x304862,null))[_0xc85d('0x14')](handleError(_0x304862,null));};exports[_0xc85d('0x17')]=function(_0x6d29ef,_0x4b8401){if(_0x6d29ef[_0xc85d('0x18')][_0xc85d('0xa')]&&_0x6d29ef[_0xc85d('0x18')][_0xc85d('0x19')]){var _0x1a93c5=path[_0xc85d('0x1a')](__dirname,_0xc85d('0x1b'),_0x6d29ef['body'][_0xc85d('0x19')]);var _0x33c9ba=process[_0xc85d('0x1c')]();process[_0xc85d('0x1d')](path[_0xc85d('0x1e')](_0x1a93c5));return execChildProcess()[_0xc85d('0x10')](function(_0x19f77d){process[_0xc85d('0x1d')](_0x33c9ba);return pm2[_0xc85d('0x1f')]({'name':_0x6d29ef[_0xc85d('0x18')][_0xc85d('0xa')],'script':_0x1a93c5});})['then'](function(_0x9b8784){pm2[_0xc85d('0x20')]();return _0x9b8784[0x0];})[_0xc85d('0x10')](respondWithResult(_0x4b8401,0xc9))[_0xc85d('0x14')](handleError(_0x4b8401,null));}else{return _0x4b8401[_0xc85d('0x8')](0x1f4)[_0xc85d('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xc85d('0x21')]=function(_0x407a31,_0x4fa0d1){if(_0x407a31[_0xc85d('0x18')]['id']){delete _0x407a31[_0xc85d('0x18')]['id'];}var _0x5e9344={'online':'restart','stopped':'stop'};if(_0x5e9344[_0xc85d('0x22')](_0x407a31[_0xc85d('0x18')][_0xc85d('0x8')])){return pm2[_0x5e9344[_0x407a31[_0xc85d('0x18')]['status']]](_0x407a31['params']['id'])['then'](respondWithResult(_0x4fa0d1,0xc8))[_0xc85d('0x14')](handleError(_0x4fa0d1,null));}else{return _0x4fa0d1[_0xc85d('0x8')](0x1f4)[_0xc85d('0xb')]({'message':_0xc85d('0x23')});}};exports[_0xc85d('0x24')]=function(_0x769f21,_0x1e64d8){if(_0x769f21[_0xc85d('0x18')]['id']){delete _0x769f21['body']['id'];}if(_0x769f21[_0xc85d('0x25')]['id']){return pm2[_0xc85d('0x26')](_0x769f21[_0xc85d('0x25')]['id'])['then'](function(_0x7a4dfd){pm2[_0xc85d('0x20')]();return _0x7a4dfd[0x0];})[_0xc85d('0x10')](respondWithResult(_0x1e64d8,null))['catch'](handleError(_0x1e64d8,null));}else{return _0x1e64d8['status'](0x1f4)[_0xc85d('0xb')]({'message':_0xc85d('0x27')});}}; \ No newline at end of file +var _0x6993=['send','npm\x20install','info','list','then','reject','express','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','cwd','chdir','start','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','error','name','status'];(function(_0x540f80,_0xd1fe20){var _0xd1227a=function(_0x59e089){while(--_0x59e089){_0x540f80['push'](_0x540f80['shift']());}};_0xd1227a(++_0xd1fe20);}(_0x6993,0xb4));var _0x3699=function(_0x11de96,_0x3b172b){_0x11de96=_0x11de96-0x0;var _0x26d213=_0x6993[_0x11de96];return _0x26d213;};'use strict';var _=require(_0x3699('0x0'));var pm2=require(_0x3699('0x1'));var logger=require('../../config/logger')(_0x3699('0x2'));var path=require(_0x3699('0x3'));var exec=require(_0x3699('0x4'))[_0x3699('0x5')];var BPromise=require(_0x3699('0x6'));function handleEntityNotFound(_0xec0db5,_0x5290ab){return function(_0x34a496){if(!_0x34a496){_0xec0db5['sendStatus'](0x194);;}return _0x34a496;};}function respondWithResult(_0x41c21d,_0x2cf73b){_0x2cf73b=_0x2cf73b||0xc8;return function(_0xe6d52e){if(_0xe6d52e){return _0x41c21d['status'](_0x2cf73b)['json'](_0xe6d52e);}return null;};}function handleError(_0x10db71,_0x24d876){_0x24d876=_0x24d876||0x1f4;return function(_0x3dc1c3){logger[_0x3699('0x7')](_0x3dc1c3['stack']);if(_0x3dc1c3[_0x3699('0x8')]){delete _0x3dc1c3[_0x3699('0x8')];}_0x10db71[_0x3699('0x9')](_0x24d876)[_0x3699('0xa')](_0x3dc1c3);};}function execChildProcess(){return new BPromise(function(_0x3253b0,_0x1c8087){exec(_0x3699('0xb'),function(_0x456308,_0xbeebe5,_0x151203){logger[_0x3699('0xc')](_0xbeebe5);logger['info'](_0x151203);if(_0x456308){logger[_0x3699('0x7')](_0x456308);return _0x1c8087(_0x456308);}return _0x3253b0(_0xbeebe5);});});}exports['index']=function(_0x5599b5,_0x1eb9ff){return pm2[_0x3699('0xd')]()[_0x3699('0xe')](function(_0x2b999c){if(_0x2b999c){var _0x3fc741=_[_0x3699('0xf')](_0x2b999c,function(_0x7c01fe){return _0x7c01fe[_0x3699('0x8')]===_0x3699('0x10')||_0x7c01fe['name']===_0x3699('0x11');});return{'rows':_0x3fc741,'count':_0x3fc741['length']};}return null;})[_0x3699('0xe')](respondWithResult(_0x1eb9ff,null))[_0x3699('0x12')](handleError(_0x1eb9ff,null));};exports[_0x3699('0x13')]=function(_0x1dbe9e,_0x22630e){return pm2[_0x3699('0x14')](_0x1dbe9e[_0x3699('0x15')]['id'])[_0x3699('0xe')](respondWithResult(_0x22630e,null))[_0x3699('0xe')](handleEntityNotFound(_0x22630e,null))['catch'](handleError(_0x22630e,null));};exports[_0x3699('0x16')]=function(_0x2aa808,_0x2a3b56){if(_0x2aa808[_0x3699('0x17')][_0x3699('0x8')]&&_0x2aa808['body'][_0x3699('0x18')]){var _0x1f7edb=path[_0x3699('0x19')](__dirname,_0x3699('0x1a'),_0x2aa808[_0x3699('0x17')]['script']);var _0xfcfc3b=process[_0x3699('0x1b')]();process[_0x3699('0x1c')](path['dirname'](_0x1f7edb));return execChildProcess()['then'](function(_0x268401){process[_0x3699('0x1c')](_0xfcfc3b);return pm2[_0x3699('0x1d')]({'name':_0x2aa808[_0x3699('0x17')][_0x3699('0x8')],'script':_0x1f7edb});})[_0x3699('0xe')](function(_0x2ce02b){pm2['dump']();return _0x2ce02b[0x0];})[_0x3699('0xe')](respondWithResult(_0x2a3b56,0xc9))['catch'](handleError(_0x2a3b56,null));}else{return _0x2a3b56[_0x3699('0x9')](0x1f4)[_0x3699('0xa')]({'message':_0x3699('0x1e')});}};exports[_0x3699('0x1f')]=function(_0x23c773,_0x539b15){if(_0x23c773[_0x3699('0x17')]['id']){delete _0x23c773[_0x3699('0x17')]['id'];}var _0x30f36a={'online':_0x3699('0x20'),'stopped':'stop'};if(_0x30f36a[_0x3699('0x21')](_0x23c773[_0x3699('0x17')][_0x3699('0x9')])){return pm2[_0x30f36a[_0x23c773['body'][_0x3699('0x9')]]](_0x23c773[_0x3699('0x15')]['id'])['then'](respondWithResult(_0x539b15,0xc8))['catch'](handleError(_0x539b15,null));}else{return _0x539b15[_0x3699('0x9')](0x1f4)[_0x3699('0xa')]({'message':_0x3699('0x22')});}};exports['destroy']=function(_0x5cc2bb,_0x239e57){if(_0x5cc2bb[_0x3699('0x17')]['id']){delete _0x5cc2bb[_0x3699('0x17')]['id'];}if(_0x5cc2bb[_0x3699('0x15')]['id']){return pm2[_0x3699('0x23')](_0x5cc2bb[_0x3699('0x15')]['id'])[_0x3699('0xe')](function(_0xc0173d){pm2[_0x3699('0x24')]();return _0xc0173d[0x0];})[_0x3699('0xe')](respondWithResult(_0x239e57,null))[_0x3699('0x12')](handleError(_0x239e57,null));}else{return _0x239e57[_0x3699('0x9')](0x1f4)[_0x3699('0xa')]({'message':_0x3699('0x25')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6bfb99e..5f1ad35 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 _0x1dea=['exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x2a03d5,_0x318ac3){var _0x4204e5=function(_0x53a977){while(--_0x53a977){_0x2a03d5['push'](_0x2a03d5['shift']());}};_0x4204e5(++_0x318ac3);}(_0x1dea,0x19e));var _0xa1de=function(_0x2b8362,_0x40a6d6){_0x2b8362=_0x2b8362-0x0;var _0x51c46a=_0x1dea[_0x2b8362];return _0x51c46a;};'use strict';var multer=require(_0xa1de('0x0'));var util=require(_0xa1de('0x1'));var path=require(_0xa1de('0x2'));var timeout=require('connect-timeout');var express=require(_0xa1de('0x3'));var router=express[_0xa1de('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa1de('0x5'));var config=require('../../config/environment');module[_0xa1de('0x6')]=router; \ No newline at end of file +var _0x1bc5=['Router','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express'];(function(_0x4ab95b,_0x396a6b){var _0x461dba=function(_0x49d1f3){while(--_0x49d1f3){_0x4ab95b['push'](_0x4ab95b['shift']());}};_0x461dba(++_0x396a6b);}(_0x1bc5,0xcc));var _0x51bc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x1bc5[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x51bc('0x0'));var util=require(_0x51bc('0x1'));var path=require('path');var timeout=require(_0x51bc('0x2'));var express=require(_0x51bc('0x3'));var router=express[_0x51bc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x51bc('0x5'));var config=require(_0x51bc('0x6'));module[_0x51bc('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 87477f4..0bfca87 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 _0x3490=['sequelize','INTEGER','STRING','DATE'];(function(_0x4a58b8,_0x556e21){var _0x5ebfac=function(_0x5f0b4a){while(--_0x5f0b4a){_0x4a58b8['push'](_0x4a58b8['shift']());}};_0x5ebfac(++_0x556e21);}(_0x3490,0x9c));var _0x0349=function(_0x1ddf0b,_0x19661f){_0x1ddf0b=_0x1ddf0b-0x0;var _0x80f5e0=_0x3490[_0x1ddf0b];return _0x80f5e0;};'use strict';var Sequelize=require(_0x0349('0x0'));module['exports']={'state':{'type':Sequelize[_0x0349('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0349('0x2')]},'scheduledat':{'type':Sequelize[_0x0349('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x0349('0x3')]},'responsetime':{'type':Sequelize[_0x0349('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0349('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0349('0x2')]}}; \ No newline at end of file +var _0x623f=['exports','INTEGER','DATE','STRING','sequelize'];(function(_0x492164,_0x5449e9){var _0x33e1c6=function(_0x501036){while(--_0x501036){_0x492164['push'](_0x492164['shift']());}};_0x33e1c6(++_0x5449e9);}(_0x623f,0x135));var _0xf623=function(_0x37866f,_0x593b19){_0x37866f=_0x37866f-0x0;var _0x15e13a=_0x623f[_0x37866f];return _0x15e13a;};'use strict';var Sequelize=require(_0xf623('0x0'));module[_0xf623('0x1')]={'state':{'type':Sequelize[_0xf623('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf623('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xf623('0x3')]},'responsetime':{'type':Sequelize[_0xf623('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xf623('0x4')]},'campaigntype':{'type':Sequelize[_0xf623('0x4')]},'membername':{'type':Sequelize[_0xf623('0x4')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 295fac0..edbd718 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 _0x11fb=['rimraf','../../config/environment','exports','define','ReportAgentPreview','../../config/logger','api','moment','request-promise','path'];(function(_0x184e76,_0x23ffe4){var _0x437e9b=function(_0x501b8c){while(--_0x501b8c){_0x184e76['push'](_0x184e76['shift']());}};_0x437e9b(++_0x23ffe4);}(_0x11fb,0x18b));var _0xb11f=function(_0x4a15ac,_0x4fe70d){_0x4a15ac=_0x4a15ac-0x0;var _0x3f5847=_0x11fb[_0x4a15ac];return _0x3f5847;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb11f('0x0'))(_0xb11f('0x1'));var moment=require(_0xb11f('0x2'));var BPromise=require('bluebird');var rp=require(_0xb11f('0x3'));var fs=require('fs');var path=require(_0xb11f('0x4'));var rimraf=require(_0xb11f('0x5'));var config=require(_0xb11f('0x6'));var attributes=require('./reportAgentPreview.attributes');module[_0xb11f('0x7')]=function(_0x2b4215,_0x44e3c4){return _0x2b4215[_0xb11f('0x8')](_0xb11f('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05d7=['moment','bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','define','report_agent_preview','lodash','util','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x05d7,0xb8));var _0x705d=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x05d7[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x705d('0x0'));var util=require(_0x705d('0x1'));var logger=require(_0x705d('0x2'))('api');var moment=require(_0x705d('0x3'));var BPromise=require(_0x705d('0x4'));var rp=require(_0x705d('0x5'));var fs=require('fs');var path=require(_0x705d('0x6'));var rimraf=require(_0x705d('0x7'));var config=require('../../config/environment');var attributes=require(_0x705d('0x8'));module['exports']=function(_0x4312a0,_0x2d0569){return _0x4312a0[_0x705d('0x9')]('ReportAgentPreview',attributes,{'tableName':_0x705d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index b8893b7..0639341 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 _0x9488=['client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ReportAgentPreview','options','raw','CreateReportAgentPreview','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3199ac,_0x320f59){var _0x33504b=function(_0x2daa48){while(--_0x2daa48){_0x3199ac['push'](_0x3199ac['shift']());}};_0x33504b(++_0x320f59);}(_0x9488,0x130));var _0x8948=function(_0x309dd7,_0x24adc3){_0x309dd7=_0x309dd7-0x0;var _0x40431e=_0x9488[_0x309dd7];return _0x40431e;};'use strict';var _=require(_0x8948('0x0'));var util=require(_0x8948('0x1'));var moment=require(_0x8948('0x2'));var BPromise=require(_0x8948('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8948('0x4'));var logger=require(_0x8948('0x5'))(_0x8948('0x6'));var config=require('../../config/environment');var jayson=require(_0x8948('0x7'));var client=jayson[_0x8948('0x8')][_0x8948('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28e8c3,_0x4d274c,_0x4d6e45){return new BPromise(function(_0x205fa6,_0x517d70){return client[_0x8948('0xa')](_0x28e8c3,_0x4d6e45)[_0x8948('0xb')](function(_0xe4cedc){logger[_0x8948('0xc')](_0x8948('0xd'),_0x4d274c,_0x8948('0xe'));logger[_0x8948('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x4d274c,_0x8948('0xe'),JSON['stringify'](_0xe4cedc));if(_0xe4cedc['error']){if(_0xe4cedc[_0x8948('0x10')][_0x8948('0x11')]===0x1f4){logger['error'](_0x8948('0xd'),_0x4d274c,_0xe4cedc[_0x8948('0x10')][_0x8948('0x12')]);return _0x517d70(_0xe4cedc['error'][_0x8948('0x12')]);}logger[_0x8948('0x10')](_0x8948('0xd'),_0x4d274c,_0xe4cedc[_0x8948('0x10')]['message']);return _0x205fa6(_0xe4cedc[_0x8948('0x10')][_0x8948('0x12')]);}else{logger[_0x8948('0xc')](_0x8948('0xd'),_0x4d274c,'request\x20sent');_0x205fa6(_0xe4cedc[_0x8948('0x13')][_0x8948('0x12')]);}})[_0x8948('0x14')](function(_0x327f4b){logger['error'](_0x8948('0xd'),_0x4d274c,_0x327f4b);_0x517d70(_0x327f4b);});});}exports['CreateReportAgentPreview']=function(_0x367b2d){var _0x2261ed=this;return new Promise(function(_0x134571,_0x569e40){return db[_0x8948('0x15')]['create'](_0x367b2d['body'],{'raw':_0x367b2d[_0x8948('0x16')]?_0x367b2d[_0x8948('0x16')][_0x8948('0x17')]===undefined?!![]:![]:!![]})[_0x8948('0xb')](function(_0x4caacc){logger[_0x8948('0xc')](_0x8948('0x18'),_0x367b2d);logger[_0x8948('0xf')](_0x8948('0x18'),_0x367b2d,JSON[_0x8948('0x19')](_0x4caacc));_0x134571(_0x4caacc);})[_0x8948('0x14')](function(_0x1c964a){logger[_0x8948('0x10')](_0x8948('0x18'),_0x1c964a[_0x8948('0x12')],_0x367b2d);_0x569e40(_0x2261ed['error'](0x1f4,_0x1c964a[_0x8948('0x12')]));});});}; \ No newline at end of file +var _0x92e9=['client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','options','raw','CreateReportAgentPreview','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4c8232,_0x4e0dea){var _0x3cc8e5=function(_0x248561){while(--_0x248561){_0x4c8232['push'](_0x4c8232['shift']());}};_0x3cc8e5(++_0x4e0dea);}(_0x92e9,0x16f));var _0x992e=function(_0x38e1ed,_0x5d2063){_0x38e1ed=_0x38e1ed-0x0;var _0x3cc657=_0x92e9[_0x38e1ed];return _0x3cc657;};'use strict';var _=require(_0x992e('0x0'));var util=require(_0x992e('0x1'));var moment=require('moment');var BPromise=require(_0x992e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x992e('0x3'))['db'];var utils=require(_0x992e('0x4'));var logger=require('../../config/logger')(_0x992e('0x5'));var config=require(_0x992e('0x6'));var jayson=require(_0x992e('0x7'));var client=jayson[_0x992e('0x8')][_0x992e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5da51a,_0x3b3df7,_0x210b28){return new BPromise(function(_0x27d5bc,_0x4aa6a6){return client[_0x992e('0xa')](_0x5da51a,_0x210b28)[_0x992e('0xb')](function(_0x3ad99f){logger['info'](_0x992e('0xc'),_0x3b3df7,'request\x20sent');logger[_0x992e('0xd')](_0x992e('0xe'),_0x3b3df7,_0x992e('0xf'),JSON[_0x992e('0x10')](_0x3ad99f));if(_0x3ad99f[_0x992e('0x11')]){if(_0x3ad99f[_0x992e('0x11')]['code']===0x1f4){logger[_0x992e('0x11')](_0x992e('0xc'),_0x3b3df7,_0x3ad99f[_0x992e('0x11')][_0x992e('0x12')]);return _0x4aa6a6(_0x3ad99f['error'][_0x992e('0x12')]);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3b3df7,_0x3ad99f[_0x992e('0x11')][_0x992e('0x12')]);return _0x27d5bc(_0x3ad99f[_0x992e('0x11')][_0x992e('0x12')]);}else{logger[_0x992e('0x13')](_0x992e('0xc'),_0x3b3df7,_0x992e('0xf'));_0x27d5bc(_0x3ad99f[_0x992e('0x14')]['message']);}})[_0x992e('0x15')](function(_0x3ac447){logger[_0x992e('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3b3df7,_0x3ac447);_0x4aa6a6(_0x3ac447);});});}exports['CreateReportAgentPreview']=function(_0x5f1a34){var _0x56136c=this;return new Promise(function(_0x2d4270,_0x96ed40){return db['ReportAgentPreview']['create'](_0x5f1a34['body'],{'raw':_0x5f1a34[_0x992e('0x16')]?_0x5f1a34['options'][_0x992e('0x17')]===undefined?!![]:![]:!![]})[_0x992e('0xb')](function(_0x2b02b5){logger[_0x992e('0x13')](_0x992e('0x18'),_0x5f1a34);logger[_0x992e('0xd')]('CreateReportAgentPreview',_0x5f1a34,JSON[_0x992e('0x10')](_0x2b02b5));_0x2d4270(_0x2b02b5);})[_0x992e('0x15')](function(_0x14453b){logger['error'](_0x992e('0x18'),_0x14453b[_0x992e('0x12')],_0x5f1a34);_0x96ed40(_0x56136c['error'](0x1f4,_0x14453b[_0x992e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 697e97c..6304a1e 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 _0xb302=['/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','chatQueues','/mail/queues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelRedirect','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xb302,0x106));var _0x2b30=function(_0x3d8067,_0x3ec5e5){_0x3d8067=_0x3d8067-0x0;var _0x14f92c=_0xb302[_0x3d8067];return _0x14f92c;};'use strict';var multer=require(_0x2b30('0x0'));var util=require(_0x2b30('0x1'));var path=require(_0x2b30('0x2'));var express=require(_0x2b30('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x2b30('0x4')](_0x2b30('0x5'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x7')]);router[_0x2b30('0x4')](_0x2b30('0x8'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x9')]);router[_0x2b30('0x4')](_0x2b30('0xa'),auth['isAuthenticated'](),controller[_0x2b30('0xb')]);router[_0x2b30('0x4')](_0x2b30('0xc'),auth['isAuthenticated'](),controller['voiceQueues']);router[_0x2b30('0x4')]('/chat/queues',auth['isAuthenticated'](),controller[_0x2b30('0xd')]);router['get'](_0x2b30('0xe'),auth[_0x2b30('0x6')](),controller['mailQueues']);router[_0x2b30('0x4')](_0x2b30('0xf'),auth[_0x2b30('0x6')](),controller['mailAccounts']);router[_0x2b30('0x4')]('/openchannel/queues',auth[_0x2b30('0x6')](),controller[_0x2b30('0x10')]);router[_0x2b30('0x4')](_0x2b30('0x11'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x12')]);router['get']('/whatsapp/queues',auth[_0x2b30('0x6')](),controller[_0x2b30('0x13')]);router[_0x2b30('0x4')](_0x2b30('0x14'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x15')]);router[_0x2b30('0x4')]('/voice/queues/preview/:id',auth['isAuthenticated'](),controller[_0x2b30('0x16')]);router[_0x2b30('0x4')](_0x2b30('0x17'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x18')]);router[_0x2b30('0x4')](_0x2b30('0x19'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x1a')]);router[_0x2b30('0x4')](_0x2b30('0x1b'),auth[_0x2b30('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x2b30('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x2b30('0x6')](),controller[_0x2b30('0x1c')]);router['get']('/voice/queues/:id',auth[_0x2b30('0x6')](),controller[_0x2b30('0x1d')]);router[_0x2b30('0x4')](_0x2b30('0x1e'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x1f')]);router[_0x2b30('0x4')]('/outbound/channels',auth['isAuthenticated'](),controller[_0x2b30('0x20')]);router[_0x2b30('0x4')](_0x2b30('0x21'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x22')]);router['put'](_0x2b30('0x23'),auth[_0x2b30('0x6')](),controller['agentCapacity']);router[_0x2b30('0x4')](_0x2b30('0x24'),auth['isAuthenticated'](),controller['telephones']);router[_0x2b30('0x4')](_0x2b30('0x25'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x26')]);router[_0x2b30('0x4')](_0x2b30('0x27'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x28')]);router[_0x2b30('0x4')](_0x2b30('0x29'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x2a')]);router[_0x2b30('0x4')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x2b30('0x2b')]);router[_0x2b30('0x4')]('/mail/queues/waitinginteractions',auth[_0x2b30('0x6')](),controller[_0x2b30('0x2c')]);router[_0x2b30('0x4')](_0x2b30('0x2d'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x2e')]);router[_0x2b30('0x4')](_0x2b30('0x2f'),auth[_0x2b30('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x2b30('0x4')](_0x2b30('0x30'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x31')]);router[_0x2b30('0x4')](_0x2b30('0x32'),auth['isAuthenticated'](),controller[_0x2b30('0x33')]);router[_0x2b30('0x34')]('/mail/queues/:id/notify',auth[_0x2b30('0x6')](),controller[_0x2b30('0x35')](_0x2b30('0x36')));router[_0x2b30('0x4')](_0x2b30('0x37'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x38')]);router[_0x2b30('0x34')](_0x2b30('0x39'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x35')](_0x2b30('0x3a')));router[_0x2b30('0x4')](_0x2b30('0x3b'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x3c')]);router['post'](_0x2b30('0x3d'),auth['isAuthenticated'](),controller['queueNotify'](_0x2b30('0x3e')));router[_0x2b30('0x4')](_0x2b30('0x3f'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x40')]);router[_0x2b30('0x34')](_0x2b30('0x41'),auth['isAuthenticated'](),controller[_0x2b30('0x35')](_0x2b30('0x42')));router[_0x2b30('0x4')](_0x2b30('0x43'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x44')]);router[_0x2b30('0x34')](_0x2b30('0x45'),auth['isAuthenticated'](),controller[_0x2b30('0x35')]('sms'));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x2b30('0x35')](_0x2b30('0x46')));router[_0x2b30('0x4')](_0x2b30('0x47'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x48')]);router[_0x2b30('0x4')](_0x2b30('0x49'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x4a')]);router[_0x2b30('0x34')](_0x2b30('0x4b'),auth[_0x2b30('0x6')](),controller[_0x2b30('0x4c')]);module[_0x2b30('0x4d')]=router; \ No newline at end of file +var _0x6c56=['/sms/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/outbound','outbound','/outbound/channels','/agents','agents','put','agentCapacity','telephones','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','util','path','Router','../../components/auth/service','./rpc.controller','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0x6c56,0xc6));var _0x66c5=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x6c56[_0x3c0dcc];return _0x1a224c;};'use strict';var multer=require(_0x66c5('0x0'));var util=require(_0x66c5('0x1'));var path=require(_0x66c5('0x2'));var express=require('express');var router=express[_0x66c5('0x3')]();var auth=require(_0x66c5('0x4'));var controller=require(_0x66c5('0x5'));router['get']('/voice/channels',auth['isAuthenticated'](),controller[_0x66c5('0x6')]);router[_0x66c5('0x7')](_0x66c5('0x8'),auth[_0x66c5('0x9')](),controller[_0x66c5('0xa')]);router[_0x66c5('0x7')](_0x66c5('0xb'),auth[_0x66c5('0x9')](),controller[_0x66c5('0xc')]);router['get'](_0x66c5('0xd'),auth[_0x66c5('0x9')](),controller[_0x66c5('0xe')]);router['get'](_0x66c5('0xf'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x10')]);router[_0x66c5('0x7')]('/mail/queues',auth[_0x66c5('0x9')](),controller[_0x66c5('0x11')]);router[_0x66c5('0x7')]('/mail/accounts',auth[_0x66c5('0x9')](),controller[_0x66c5('0x12')]);router[_0x66c5('0x7')](_0x66c5('0x13'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x14')]);router['get'](_0x66c5('0x15'),auth[_0x66c5('0x9')](),controller['smsQueues']);router['get']('/whatsapp/queues',auth[_0x66c5('0x9')](),controller[_0x66c5('0x16')]);router['get'](_0x66c5('0x17'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x18')]);router[_0x66c5('0x7')](_0x66c5('0x19'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x1a')]);router['get'](_0x66c5('0x1b'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x1c')]);router[_0x66c5('0x7')](_0x66c5('0x1d'),auth[_0x66c5('0x9')](),controller['voiceQueuesChannel']);router[_0x66c5('0x7')](_0x66c5('0x1e'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x1f')]);router['get']('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0x66c5('0x7')]('/voice/queues/:id',auth[_0x66c5('0x9')](),controller['showVoiceQueues']);router[_0x66c5('0x7')](_0x66c5('0x20'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x21')]);router[_0x66c5('0x7')](_0x66c5('0x22'),auth['isAuthenticated'](),controller['outboundChannels']);router[_0x66c5('0x7')](_0x66c5('0x23'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x24')]);router[_0x66c5('0x25')]('/agents/:id/capacity',auth[_0x66c5('0x9')](),controller[_0x66c5('0x26')]);router[_0x66c5('0x7')]('/telephones',auth[_0x66c5('0x9')](),controller[_0x66c5('0x27')]);router[_0x66c5('0x7')]('/trunks',auth['isAuthenticated'](),controller['trunks']);router[_0x66c5('0x7')](_0x66c5('0x28'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x29')]);router[_0x66c5('0x7')](_0x66c5('0x2a'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x2b')]);router[_0x66c5('0x7')](_0x66c5('0x2c'),auth['isAuthenticated'](),controller['chatQueuesWaitingInteractions']);router[_0x66c5('0x7')](_0x66c5('0x2d'),auth['isAuthenticated'](),controller[_0x66c5('0x2e')]);router[_0x66c5('0x7')](_0x66c5('0x2f'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x30')]);router[_0x66c5('0x7')]('/sms/queues/waitinginteractions',auth[_0x66c5('0x9')](),controller[_0x66c5('0x31')]);router[_0x66c5('0x7')](_0x66c5('0x32'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x33')]);router[_0x66c5('0x7')](_0x66c5('0x34'),auth[_0x66c5('0x9')](),controller['faxQueuesWaitingInteractions']);router[_0x66c5('0x35')](_0x66c5('0x36'),auth['isAuthenticated'](),controller[_0x66c5('0x37')](_0x66c5('0x38')));router['get'](_0x66c5('0x39'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x3a')]);router['post'](_0x66c5('0x3b'),auth[_0x66c5('0x9')](),controller['queueNotify'](_0x66c5('0x3c')));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller[_0x66c5('0x3d')]);router[_0x66c5('0x35')]('/fax/queues/:id/notify',auth[_0x66c5('0x9')](),controller[_0x66c5('0x37')]('fax'));router[_0x66c5('0x7')](_0x66c5('0x3e'),auth['isAuthenticated'](),controller[_0x66c5('0x3f')]);router[_0x66c5('0x35')](_0x66c5('0x40'),auth[_0x66c5('0x9')](),controller['queueNotify'](_0x66c5('0x41')));router[_0x66c5('0x7')](_0x66c5('0x42'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x43')]);router['post'](_0x66c5('0x44'),auth['isAuthenticated'](),controller[_0x66c5('0x37')]('sms'));router[_0x66c5('0x35')]('/whatsapp/queues/:id/notify',auth[_0x66c5('0x9')](),controller[_0x66c5('0x37')]('whatsapp'));router[_0x66c5('0x7')]('/sms/queues/:id',auth[_0x66c5('0x9')](),controller['showSmsQueues']);router[_0x66c5('0x7')](_0x66c5('0x45'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x66c5('0x35')](_0x66c5('0x46'),auth[_0x66c5('0x9')](),controller[_0x66c5('0x47')]);module[_0x66c5('0x48')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 6c0e18e..3d8f312 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 _0x6988=['TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','agentTransferTimeout','bluebird','moment','lodash','util','api','jayson/promise','client','http','request','then','error','code','message','catch','json','sendStatus','name','status','isNil','rows','find','VoiceChannels','query','voiceChannelMixMonitor','params','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','agent','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','findOne','\x20Queue\x20not\x20found','Message','update','Interaction','queue','MessageId','InteractionId'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6988,0x81));var _0x8698=function(_0x406e26,_0x445384){_0x406e26=_0x406e26-0x0;var _0x53bdd7=_0x6988[_0x406e26];return _0x53bdd7;};'use strict';var BPromise=require(_0x8698('0x0'));var moment=require(_0x8698('0x1'));var _=require(_0x8698('0x2'));var util=require(_0x8698('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0x8698('0x4'));var jayson=require(_0x8698('0x5'));var amiClient=jayson[_0x8698('0x6')][_0x8698('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x8698('0x7')]({'port':0x232b});var routingClient=jayson['client'][_0x8698('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x465d39,_0x2a137f,_0x170630){return new BPromise(function(_0x29af84,_0x2511c0){var _0x4bb810=_0x170630?_0x170630:amiClient;return _0x4bb810[_0x8698('0x8')](_0x465d39,_0x2a137f)[_0x8698('0x9')](function(_0x269797){if(_0x269797[_0x8698('0xa')]){if(_0x269797[_0x8698('0xa')][_0x8698('0xb')]===0x1f4){return _0x2511c0(_0x269797['error'][_0x8698('0xc')]);}return _0x29af84(_0x269797[_0x8698('0xa')][_0x8698('0xc')]);}else{_0x29af84(_0x269797['result']);}})[_0x8698('0xd')](function(_0x5abee8){_0x2511c0(_0x5abee8);});});}function respondWithResult(_0x5ba336,_0x28587c){_0x28587c=_0x28587c||0xc8;return function(_0x510f8b){if(_0x510f8b){return _0x5ba336['status'](_0x28587c)[_0x8698('0xe')](_0x510f8b);}return _0x5ba336[_0x8698('0xf')](0x194);};}function handleError(_0x246d98,_0x2b0c5f){_0x2b0c5f=_0x2b0c5f||0x1f4;return function(_0x21037d){logger['error'](_0x21037d['stack']);if(_0x21037d['name']){delete _0x21037d[_0x8698('0x10')];}_0x246d98[_0x8698('0x11')](_0x2b0c5f)['send'](_0x21037d);};}function findById(_0x48de87){return function(_0x7040fe){if(!_[_0x8698('0x12')](_0x48de87)&&!_[_0x8698('0x12')](_0x7040fe)&&!_['isNil'](_0x7040fe[_0x8698('0x13')])){return _[_0x8698('0x14')](_0x7040fe[_0x8698('0x13')],function(_0x4a1da8){return _0x4a1da8['id']==_0x48de87;});}return null;};}exports['voiceChannels']=function(_0x40a2fb,_0x4cb18e){return respondWithRpcPromise(_0x8698('0x15'),_0x40a2fb[_0x8698('0x16')])[_0x8698('0x9')](respondWithResult(_0x4cb18e,null))['catch'](handleError(_0x4cb18e,null));};exports[_0x8698('0x17')]=function(_0x20b2c7,_0x3fdc69){return respondWithRpcPromise('VoiceChannelMixMonitor',_['merge'](_0x20b2c7[_0x8698('0x16')],_0x20b2c7[_0x8698('0x18')]))[_0x8698('0x9')](respondWithResult(_0x3fdc69,null))[_0x8698('0xd')](handleError(_0x3fdc69,null));};exports['voiceChannelStopMixMonitor']=function(_0x4cff8a,_0x19f93f){return respondWithRpcPromise(_0x8698('0x19'),_[_0x8698('0x1a')](_0x4cff8a[_0x8698('0x16')],_0x4cff8a[_0x8698('0x18')]))['then'](respondWithResult(_0x19f93f,null))[_0x8698('0xd')](handleError(_0x19f93f,null));};exports[_0x8698('0x1b')]=function(_0xa7c78c,_0x5d8766){return respondWithRpcPromise(_0x8698('0x1c'),_0xa7c78c['query'])[_0x8698('0x9')](respondWithResult(_0x5d8766,null))['catch'](handleError(_0x5d8766,null));};exports['showVoiceQueues']=function(_0x168dd0,_0x2fda49){return respondWithRpcPromise(_0x8698('0x1c'),_0x168dd0[_0x8698('0x16')])[_0x8698('0x9')](findById(_0x168dd0['params']['id']))[_0x8698('0x9')](respondWithResult(_0x2fda49,null))['catch'](handleError(_0x2fda49,null));};exports[_0x8698('0x1d')]=function(_0x42c5c4,_0x275c9e){return respondWithRpcPromise(_0x8698('0x1e'),_[_0x8698('0x1a')](_0x42c5c4['query'],_0x42c5c4['params']))[_0x8698('0x9')](respondWithResult(_0x275c9e,null))['catch'](handleError(_0x275c9e,null));};exports[_0x8698('0x1f')]=function(_0x4d3bf4,_0x3d26ec){return respondWithRpcPromise(_0x8698('0x20'),_0x4d3bf4[_0x8698('0x16')])[_0x8698('0x9')](respondWithResult(_0x3d26ec,null))['catch'](handleError(_0x3d26ec,null));};exports[_0x8698('0x21')]=function(_0x54a294,_0x1995b1){return respondWithRpcPromise(_0x8698('0x22'),_[_0x8698('0x1a')](_0x54a294[_0x8698('0x16')],_0x54a294[_0x8698('0x18')]))[_0x8698('0x9')](respondWithResult(_0x1995b1,null))[_0x8698('0xd')](handleError(_0x1995b1,null));};exports[_0x8698('0x23')]=function(_0x1f82eb,_0x47f9ad){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x8698('0x1a')](_0x1f82eb[_0x8698('0x16')],_0x1f82eb[_0x8698('0x18')]))['then'](respondWithResult(_0x47f9ad,null))['catch'](handleError(_0x47f9ad,null));};exports['voiceQueuesChannelRedirect']=function(_0x15ee30,_0x4f050f){return respondWithRpcPromise(_0x8698('0x24'),_[_0x8698('0x1a')](_0x15ee30['query'],_0x15ee30[_0x8698('0x18')]))['then'](respondWithResult(_0x4f050f,null))[_0x8698('0xd')](handleError(_0x4f050f,null));};exports['outbound']=function(_0x5b54ca,_0x2bfbad){return respondWithRpcPromise(_0x8698('0x25'),_0x5b54ca[_0x8698('0x16')])[_0x8698('0x9')](respondWithResult(_0x2bfbad,null))[_0x8698('0xd')](handleError(_0x2bfbad,null));};exports['outboundChannels']=function(_0x398fac,_0x4dcab2){return respondWithRpcPromise(_0x8698('0x26'),_0x398fac[_0x8698('0x16')])['then'](respondWithResult(_0x4dcab2,null))[_0x8698('0xd')](handleError(_0x4dcab2,null));};exports[_0x8698('0x27')]=function(_0x379c55,_0x5bba45){var _0x29cdd3;return respondWithRpcPromise(_0x8698('0x28'),_0x379c55[_0x8698('0x16')])['then'](function(_0x291e5a){_0x29cdd3=_0x291e5a;return respondWithRpcPromise(_0x8698('0x28'),_0x379c55['query'],routingClient);})[_0x8698('0x9')](function(_0x17a9f0){return _[_0x8698('0x1a')]({},_0x17a9f0,_0x29cdd3);})[_0x8698('0x9')](respondWithResult(_0x5bba45,null))[_0x8698('0xd')](handleError(_0x5bba45,null));};exports['agentCapacity']=function(_0x163b44,_0x42e8b9){if(_0x163b44[_0x8698('0x29')]&&_0x163b44[_0x8698('0x29')][_0x8698('0x2a')]&&_0x163b44[_0x8698('0x2b')]&&_0x163b44['user'][_0x8698('0x10')]){for(var _0x258900 in _0x163b44['body']['interaction']){if(_0x163b44[_0x8698('0x29')]['interaction'][_0x8698('0x2c')](_0x258900)){db[_0x8698('0x2d')][_0x8698('0x2e')]({'where':{'channel':_0x258900,'membername':_0x163b44[_0x8698('0x2b')][_0x8698('0x10')],'type':_0x8698('0x2f'),'exitAt':null,'uniqueid':_0x163b44[_0x8698('0x29')][_0x8698('0x2a')][_0x258900]&&_0x163b44[_0x8698('0x29')]['interaction'][_0x258900]['length']?{'$notIn':_0x163b44[_0x8698('0x29')][_0x8698('0x2a')][_0x258900]}:{'$ne':null}}})[_0x8698('0x9')](function(_0x5ce065){var _0x26200b=moment()[_0x8698('0x30')](_0x8698('0x31'));for(var _0x2bf43d=0x0,_0x217885=_0x5ce065[_0x8698('0x32')];_0x2bf43d<_0x217885;_0x2bf43d+=0x1){_0x5ce065[_0x2bf43d][_0x8698('0x33')]({'exitAt':_0x26200b});}});for(var _0xfc1c52=0x0;_0xfc1c52<_0x163b44['body'][_0x8698('0x2a')][_0x258900][_0x8698('0x32')];_0xfc1c52+=0x1){db[_0x8698('0x2d')][_0x8698('0x34')]({'where':{'channel':_0x258900,'membername':_0x163b44[_0x8698('0x2b')][_0x8698('0x10')],'type':_0x8698('0x2f'),'uniqueid':_0x163b44[_0x8698('0x29')][_0x8698('0x2a')][_0x258900][_0xfc1c52],'exitAt':null},'defaults':{'channel':_0x258900,'membername':_0x163b44[_0x8698('0x2b')][_0x8698('0x10')],'interface':_[_0x8698('0x12')](_0x163b44[_0x8698('0x2b')][_0x8698('0x35')])?util[_0x8698('0x30')](_0x8698('0x36'),_0x163b44['user']['name']):_0x163b44[_0x8698('0x2b')][_0x8698('0x35')],'type':_0x8698('0x2f'),'enterAt':moment()['format'](_0x8698('0x31')),'role':_0x8698('0x37'),'internal':_0x163b44[_0x8698('0x2b')]['internal'],'uniqueid':_0x163b44[_0x8698('0x29')][_0x8698('0x2a')][_0x258900][_0xfc1c52]}});}}}}return respondWithRpcPromise(_0x8698('0x38'),{'id':_0x163b44['params']['id'],'capacity':_0x163b44[_0x8698('0x29')][_0x8698('0x39')]},routingClient)[_0x8698('0x9')](respondWithResult(_0x42e8b9,null))[_0x8698('0xd')](handleError(_0x42e8b9,null));};exports[_0x8698('0x3a')]=function(_0x1c4ebc,_0x47cc85){return respondWithRpcPromise(_0x8698('0x3b'),_0x1c4ebc[_0x8698('0x16')])[_0x8698('0x9')](respondWithResult(_0x47cc85,null))['catch'](handleError(_0x47cc85,null));};exports[_0x8698('0x3c')]=function(_0x3a60f5,_0x4e3a90){return respondWithRpcPromise('Trunks',_0x3a60f5[_0x8698('0x16')])[_0x8698('0x9')](respondWithResult(_0x4e3a90,null))[_0x8698('0xd')](handleError(_0x4e3a90,null));};exports[_0x8698('0x3d')]=function(_0x1f2fd3,_0x3183e5){return respondWithRpcPromise(_0x8698('0x3e'),_0x1f2fd3[_0x8698('0x16')])['then'](respondWithResult(_0x3183e5,null))[_0x8698('0xd')](handleError(_0x3183e5,null));};exports[_0x8698('0x3f')]=function(_0x5bc8fe,_0x276f67){return respondWithRpcPromise('ChatQueues',_0x5bc8fe[_0x8698('0x16')],routingClient)[_0x8698('0x9')](respondWithResult(_0x276f67,null))[_0x8698('0xd')](handleError(_0x276f67,null));};exports[_0x8698('0x40')]=function(_0x13e95c,_0x208a42){return respondWithRpcPromise(_0x8698('0x41'),_0x13e95c[_0x8698('0x16')],routingClient)['then'](findById(_0x13e95c['params']['id']))['then'](respondWithResult(_0x208a42,null))[_0x8698('0xd')](handleError(_0x208a42,null));};exports[_0x8698('0x42')]=function(_0x52f56a,_0x2babc6){return respondWithRpcPromise(_0x8698('0x43'),_0x52f56a[_0x8698('0x16')],routingClient)[_0x8698('0x9')](respondWithResult(_0x2babc6,null))[_0x8698('0xd')](handleError(_0x2babc6,null));};exports['showMailQueues']=function(_0x592985,_0x4ea16f){return respondWithRpcPromise('MailQueues',_0x592985[_0x8698('0x16')],routingClient)[_0x8698('0x9')](findById(_0x592985[_0x8698('0x18')]['id']))[_0x8698('0x9')](respondWithResult(_0x4ea16f,null))[_0x8698('0xd')](handleError(_0x4ea16f,null));};exports['mailAccounts']=function(_0x5cabf2,_0xc7a5a8){return respondWithRpcPromise(_0x8698('0x44'),_0x5cabf2[_0x8698('0x16')],mailClient)[_0x8698('0x9')](respondWithResult(_0xc7a5a8,null))[_0x8698('0xd')](handleError(_0xc7a5a8,null));};exports[_0x8698('0x45')]=function(_0x123fce,_0x5ca14c){return respondWithRpcPromise(_0x8698('0x46'),_0x123fce[_0x8698('0x16')],routingClient)[_0x8698('0x9')](respondWithResult(_0x5ca14c,null))[_0x8698('0xd')](handleError(_0x5ca14c,null));};exports['showOpenchannelQueues']=function(_0x5237b2,_0x544232){return respondWithRpcPromise('OpenchannelQueues',_0x5237b2[_0x8698('0x16')],routingClient)[_0x8698('0x9')](findById(_0x5237b2['params']['id']))[_0x8698('0x9')](respondWithResult(_0x544232,null))[_0x8698('0xd')](handleError(_0x544232,null));};exports[_0x8698('0x47')]=function(_0x9171dd,_0x2a5159){return respondWithRpcPromise(_0x8698('0x48'),_0x9171dd['query'],routingClient)[_0x8698('0x9')](respondWithResult(_0x2a5159,null))[_0x8698('0xd')](handleError(_0x2a5159,null));};exports[_0x8698('0x49')]=function(_0xadfff4,_0x2d8111){return respondWithRpcPromise('SmsQueues',_0xadfff4['query'],routingClient)[_0x8698('0x9')](findById(_0xadfff4['params']['id']))[_0x8698('0x9')](respondWithResult(_0x2d8111,null))['catch'](handleError(_0x2d8111,null));};exports['whatsappQueues']=function(_0x3db2bb,_0x56e009){return respondWithRpcPromise('WhatsappQueues',_0x3db2bb[_0x8698('0x16')],routingClient)[_0x8698('0x9')](respondWithResult(_0x56e009,null))[_0x8698('0xd')](handleError(_0x56e009,null));};exports[_0x8698('0x4a')]=function(_0x2fbc86,_0x31795f){return respondWithRpcPromise(_0x8698('0x4b'),_0x2fbc86[_0x8698('0x16')],routingClient)['then'](findById(_0x2fbc86[_0x8698('0x18')]['id']))[_0x8698('0x9')](respondWithResult(_0x31795f,null))[_0x8698('0xd')](handleError(_0x31795f,null));};exports[_0x8698('0x4c')]=function(_0x301e89,_0x5da344){return respondWithRpcPromise(_0x8698('0x4d'),_0x301e89[_0x8698('0x16')],routingClient)['then'](respondWithResult(_0x5da344,null))['catch'](handleError(_0x5da344,null));};exports['showFaxQueues']=function(_0x546f39,_0xf4f511){return respondWithRpcPromise(_0x8698('0x4d'),_0x546f39[_0x8698('0x16')],routingClient)[_0x8698('0x9')](findById(_0x546f39[_0x8698('0x18')]['id']))['then'](respondWithResult(_0xf4f511,null))[_0x8698('0xd')](handleError(_0xf4f511,null));};exports[_0x8698('0x4e')]=function(_0x577bbd,_0x396896){return respondWithRpcPromise(_0x8698('0x4f'),_0x577bbd[_0x8698('0x16')])[_0x8698('0x9')](respondWithResult(_0x396896,null))[_0x8698('0xd')](handleError(_0x396896,null));};exports[_0x8698('0x50')]=function(_0x5777f5,_0x2928ae){return respondWithRpcPromise(_0x8698('0x51'),_0x5777f5['query'],routingClient)[_0x8698('0x9')](respondWithResult(_0x2928ae,null))[_0x8698('0xd')](handleError(_0x2928ae,null));};exports[_0x8698('0x52')]=function(_0x1a9008,_0x2997f0){return respondWithRpcPromise(_0x8698('0x53'),_0x1a9008[_0x8698('0x16')],routingClient)[_0x8698('0x9')](respondWithResult(_0x2997f0,null))[_0x8698('0xd')](handleError(_0x2997f0,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x25cd8d,_0x2b4ca1){return respondWithRpcPromise(_0x8698('0x54'),_0x25cd8d[_0x8698('0x16')],routingClient)[_0x8698('0x9')](respondWithResult(_0x2b4ca1,null))[_0x8698('0xd')](handleError(_0x2b4ca1,null));};exports[_0x8698('0x55')]=function(_0x2f4906,_0x1af35e){return respondWithRpcPromise(_0x8698('0x56'),_0x2f4906['query'],routingClient)[_0x8698('0x9')](respondWithResult(_0x1af35e,null))[_0x8698('0xd')](handleError(_0x1af35e,null));};exports[_0x8698('0x57')]=function(_0x17e5ed,_0x175274){return respondWithRpcPromise(_0x8698('0x58'),_0x17e5ed[_0x8698('0x16')],routingClient)['then'](respondWithResult(_0x175274,null))[_0x8698('0xd')](handleError(_0x175274,null));};exports[_0x8698('0x59')]=function(_0xe48cc1,_0x4a84ad){return respondWithRpcPromise(_0x8698('0x5a'),_0xe48cc1['query'],routingClient)[_0x8698('0x9')](respondWithResult(_0x4a84ad,null))[_0x8698('0xd')](handleError(_0x4a84ad,null));};exports[_0x8698('0x5b')]=function(_0x5345fd){return function(_0xe4a874,_0x38735b){var _0x1bcf00,_0x18acc7;var _0x1dcb9a=_[_0x8698('0x5c')](_0x5345fd);var _0x4f1194=_0x5345fd==='chat'?_0x8698('0x5d'):_0x8698('0x5e');return db[_0x1dcb9a+'Queue'][_0x8698('0x5f')]({'raw':!![],'where':{'id':_0xe4a874[_0x8698('0x18')]['id']}})['then'](function(_0x3d538b){if(_['isNil'](_0x3d538b)){throw new Error(_0x1dcb9a+_0x8698('0x60'));}_0x1bcf00=_0x3d538b;return db[_0x1dcb9a+_0x8698('0x61')][_0x8698('0x5f')]({'where':{'id':_0xe4a874['body']['messageId']},'include':[{'model':db[_0x1dcb9a+'Interaction'],'as':'Interaction'},{'model':db[_0x1dcb9a+_0x4f1194],'as':'Account'}]});})[_0x8698('0x9')](function(_0x4b6ca2){if(_['isNil'](_0x4b6ca2)){throw new Error(_0x1dcb9a+'\x20Message\x20not\x20found');}_0x18acc7=_0x4b6ca2;return _0x4b6ca2[_0x8698('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8698('0x9')](function(){var _0x579463={'uniqueid':_0x5345fd+'.'+_0x18acc7['id']+'.'+_0x18acc7[_0x8698('0x63')]['id'],'FromUserId':_0xe4a874[_0x8698('0x2b')]['id'],'type':_0x8698('0x64')};_0x579463[_0x1dcb9a+_0x8698('0x65')]=_0x18acc7['id'];_0x579463[_0x1dcb9a+_0x8698('0x66')]=_0x18acc7[_0x8698('0x63')]['id'];_0x579463['From'+_0x1dcb9a+_0x4f1194+'Id']=_0x18acc7[_0x8698('0x5e')]['id'];_0x579463['To'+_0x1dcb9a+'QueueId']=_0x1bcf00['id'];return db[_0x1dcb9a+_0x8698('0x67')]['create'](_0x579463);})['then'](function(){return respondWithRpcPromise(_0x8698('0x68'),{'channel':_0x5345fd,'interaction':_0x18acc7[_0x8698('0x63')],'message':_0x18acc7,'account':_0x18acc7[_0x8698('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8698('0x64'),'appdata':_0x1bcf00['name']+','+(_0x18acc7['Account'][_0x8698('0x69')]||0x12c),'interval':_0x8698('0x6a')}]},routingClient);})[_0x8698('0x9')](respondWithResult(_0x38735b,null))[_0x8698('0xd')](handleError(_0x38735b,null));};};exports[_0x8698('0x6b')]=function(_0x4bb35f,_0x5b2e0b){var _0x3df9b0,_0x5c65e2;if(_[_0x8698('0x12')](_0x4bb35f[_0x8698('0x29')][_0x8698('0x6c')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x303a29=_0x4bb35f[_0x8698('0x29')]['channel'];var _0x2e5fd6=_[_0x8698('0x5c')](_0x303a29);var _0x33f24e=_0x303a29==='chat'?_0x8698('0x5d'):_0x8698('0x5e');return db[_0x8698('0x6d')][_0x8698('0x5f')]({'raw':!![],'where':{'id':_0x4bb35f[_0x8698('0x18')]['id'],'role':_0x8698('0x37')}})[_0x8698('0x9')](function(_0x32963e){if(_['isNil'](_0x32963e)){throw new Error(_0x8698('0x6e'));}_0x3df9b0=_0x32963e;return db[_0x2e5fd6+_0x8698('0x61')][_0x8698('0x5f')]({'where':{'id':_0x4bb35f[_0x8698('0x29')][_0x8698('0x6f')]},'include':[{'model':db[_0x2e5fd6+'Interaction'],'as':_0x8698('0x63')},{'model':db[_0x2e5fd6+_0x33f24e],'as':_0x8698('0x5e')}]});})[_0x8698('0x9')](function(_0xcb7d71){if(_[_0x8698('0x12')](_0xcb7d71)){throw new Error(_0x2e5fd6+_0x8698('0x70'));}_0x5c65e2=_0xcb7d71;return _0xcb7d71[_0x8698('0x62')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x23f40c={'uniqueid':_0x303a29+'.'+_0x5c65e2['id']+'.'+_0x5c65e2[_0x8698('0x63')]['id'],'FromUserId':_0x4bb35f[_0x8698('0x2b')]['id'],'type':'queue','ToUserId':_0x3df9b0['id']};_0x23f40c[_0x2e5fd6+_0x8698('0x65')]=_0x5c65e2['id'];_0x23f40c[_0x2e5fd6+_0x8698('0x66')]=_0x5c65e2[_0x8698('0x63')]['id'];_0x23f40c[_0x8698('0x71')+_0x2e5fd6+_0x33f24e+'Id']=_0x5c65e2[_0x8698('0x5e')]['id'];return db[_0x2e5fd6+'TransferReport'][_0x8698('0x72')](_0x23f40c);})[_0x8698('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x303a29,'interaction':_0x5c65e2[_0x8698('0x63')],'message':_0x5c65e2,'account':_0x5c65e2[_0x8698('0x5e')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3df9b0['name']+','+(_0x5c65e2['Account'][_0x8698('0x73')]||0x12c),'interval':_0x8698('0x6a')}]},routingClient);})[_0x8698('0x9')](respondWithResult(_0x5b2e0b,null))[_0x8698('0xd')](handleError(_0x5b2e0b,null));}; \ No newline at end of file +var _0x5692=['json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','showChatQueues','ChatQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','chat','Website','Account','Queue','findOne','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','capitalize','From','agentTransferTimeout','bluebird','lodash','../../mysqldb','jayson/promise','client','http','request','error','message','result','catch','status'];(function(_0x215638,_0x4125c6){var _0x4eb0eb=function(_0x403c8){while(--_0x403c8){_0x215638['push'](_0x215638['shift']());}};_0x4eb0eb(++_0x4125c6);}(_0x5692,0x144));var _0x2569=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x5692[_0x501510];return _0x1e6ee5;};'use strict';var BPromise=require(_0x2569('0x0'));var moment=require('moment');var _=require(_0x2569('0x1'));var util=require('util');var db=require(_0x2569('0x2'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0x2569('0x3'));var amiClient=jayson[_0x2569('0x4')][_0x2569('0x5')]({'port':0x232a});var mailClient=jayson[_0x2569('0x4')][_0x2569('0x5')]({'port':0x232b});var routingClient=jayson[_0x2569('0x4')][_0x2569('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xa91af0,_0x4d7563,_0x461b1a){return new BPromise(function(_0x24b6f2,_0x5a865b){var _0x31cd5f=_0x461b1a?_0x461b1a:amiClient;return _0x31cd5f[_0x2569('0x6')](_0xa91af0,_0x4d7563)['then'](function(_0xca38c){if(_0xca38c[_0x2569('0x7')]){if(_0xca38c['error']['code']===0x1f4){return _0x5a865b(_0xca38c[_0x2569('0x7')][_0x2569('0x8')]);}return _0x24b6f2(_0xca38c[_0x2569('0x7')]['message']);}else{_0x24b6f2(_0xca38c[_0x2569('0x9')]);}})[_0x2569('0xa')](function(_0x11cfad){_0x5a865b(_0x11cfad);});});}function respondWithResult(_0x4f83fb,_0x10641a){_0x10641a=_0x10641a||0xc8;return function(_0x367810){if(_0x367810){return _0x4f83fb[_0x2569('0xb')](_0x10641a)[_0x2569('0xc')](_0x367810);}return _0x4f83fb[_0x2569('0xd')](0x194);};}function handleError(_0x567c88,_0x4713e0){_0x4713e0=_0x4713e0||0x1f4;return function(_0x4ca8ee){logger[_0x2569('0x7')](_0x4ca8ee['stack']);if(_0x4ca8ee[_0x2569('0xe')]){delete _0x4ca8ee[_0x2569('0xe')];}_0x567c88[_0x2569('0xb')](_0x4713e0)[_0x2569('0xf')](_0x4ca8ee);};}function findById(_0x4b54c){return function(_0x28b916){if(!_[_0x2569('0x10')](_0x4b54c)&&!_[_0x2569('0x10')](_0x28b916)&&!_[_0x2569('0x10')](_0x28b916[_0x2569('0x11')])){return _[_0x2569('0x12')](_0x28b916[_0x2569('0x11')],function(_0x81a00e){return _0x81a00e['id']==_0x4b54c;});}return null;};}exports[_0x2569('0x13')]=function(_0x23d239,_0x124f22){return respondWithRpcPromise(_0x2569('0x14'),_0x23d239[_0x2569('0x15')])[_0x2569('0x16')](respondWithResult(_0x124f22,null))[_0x2569('0xa')](handleError(_0x124f22,null));};exports[_0x2569('0x17')]=function(_0x2ad760,_0x140499){return respondWithRpcPromise(_0x2569('0x18'),_[_0x2569('0x19')](_0x2ad760[_0x2569('0x15')],_0x2ad760[_0x2569('0x1a')]))['then'](respondWithResult(_0x140499,null))[_0x2569('0xa')](handleError(_0x140499,null));};exports[_0x2569('0x1b')]=function(_0x29437a,_0x14b651){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x2569('0x19')](_0x29437a[_0x2569('0x15')],_0x29437a[_0x2569('0x1a')]))['then'](respondWithResult(_0x14b651,null))[_0x2569('0xa')](handleError(_0x14b651,null));};exports[_0x2569('0x1c')]=function(_0x47a6e1,_0x486ed0){return respondWithRpcPromise('VoiceQueues',_0x47a6e1['query'])['then'](respondWithResult(_0x486ed0,null))['catch'](handleError(_0x486ed0,null));};exports[_0x2569('0x1d')]=function(_0x15b742,_0x37bdae){return respondWithRpcPromise(_0x2569('0x1e'),_0x15b742[_0x2569('0x15')])[_0x2569('0x16')](findById(_0x15b742['params']['id']))[_0x2569('0x16')](respondWithResult(_0x37bdae,null))[_0x2569('0xa')](handleError(_0x37bdae,null));};exports['voiceQueuesPreview']=function(_0x546511,_0x33959a){return respondWithRpcPromise(_0x2569('0x1f'),_[_0x2569('0x19')](_0x546511['query'],_0x546511[_0x2569('0x1a')]))[_0x2569('0x16')](respondWithResult(_0x33959a,null))[_0x2569('0xa')](handleError(_0x33959a,null));};exports[_0x2569('0x20')]=function(_0x1af540,_0x42792a){return respondWithRpcPromise(_0x2569('0x21'),_0x1af540[_0x2569('0x15')])[_0x2569('0x16')](respondWithResult(_0x42792a,null))['catch'](handleError(_0x42792a,null));};exports['voiceQueuesChannel']=function(_0x23462d,_0x5465da){return respondWithRpcPromise(_0x2569('0x22'),_['merge'](_0x23462d[_0x2569('0x15')],_0x23462d['params']))[_0x2569('0x16')](respondWithResult(_0x5465da,null))[_0x2569('0xa')](handleError(_0x5465da,null));};exports[_0x2569('0x23')]=function(_0x330dce,_0xd78b01){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x2569('0x19')](_0x330dce[_0x2569('0x15')],_0x330dce['params']))[_0x2569('0x16')](respondWithResult(_0xd78b01,null))['catch'](handleError(_0xd78b01,null));};exports[_0x2569('0x24')]=function(_0x2f62b8,_0x3253ad){return respondWithRpcPromise(_0x2569('0x25'),_[_0x2569('0x19')](_0x2f62b8['query'],_0x2f62b8[_0x2569('0x1a')]))[_0x2569('0x16')](respondWithResult(_0x3253ad,null))['catch'](handleError(_0x3253ad,null));};exports[_0x2569('0x26')]=function(_0x1f7de0,_0x22e96e){return respondWithRpcPromise(_0x2569('0x27'),_0x1f7de0['query'])[_0x2569('0x16')](respondWithResult(_0x22e96e,null))['catch'](handleError(_0x22e96e,null));};exports[_0x2569('0x28')]=function(_0xd5f4f5,_0x40f7f1){return respondWithRpcPromise('OutboundChannels',_0xd5f4f5['query'])[_0x2569('0x16')](respondWithResult(_0x40f7f1,null))[_0x2569('0xa')](handleError(_0x40f7f1,null));};exports[_0x2569('0x29')]=function(_0x53848b,_0x1d75ed){var _0x1ddf3c;return respondWithRpcPromise(_0x2569('0x2a'),_0x53848b[_0x2569('0x15')])[_0x2569('0x16')](function(_0x414fb4){_0x1ddf3c=_0x414fb4;return respondWithRpcPromise(_0x2569('0x2a'),_0x53848b['query'],routingClient);})[_0x2569('0x16')](function(_0x3cad5d){return _[_0x2569('0x19')]({},_0x3cad5d,_0x1ddf3c);})['then'](respondWithResult(_0x1d75ed,null))[_0x2569('0xa')](handleError(_0x1d75ed,null));};exports[_0x2569('0x2b')]=function(_0x1035d1,_0x3431ad){if(_0x1035d1[_0x2569('0x2c')]&&_0x1035d1[_0x2569('0x2c')][_0x2569('0x2d')]&&_0x1035d1[_0x2569('0x2e')]&&_0x1035d1['user']['name']){for(var _0x179399 in _0x1035d1['body'][_0x2569('0x2d')]){if(_0x1035d1[_0x2569('0x2c')][_0x2569('0x2d')][_0x2569('0x2f')](_0x179399)){db[_0x2569('0x30')][_0x2569('0x31')]({'where':{'channel':_0x179399,'membername':_0x1035d1[_0x2569('0x2e')][_0x2569('0xe')],'type':_0x2569('0x32'),'exitAt':null,'uniqueid':_0x1035d1[_0x2569('0x2c')]['interaction'][_0x179399]&&_0x1035d1[_0x2569('0x2c')][_0x2569('0x2d')][_0x179399]['length']?{'$notIn':_0x1035d1['body'][_0x2569('0x2d')][_0x179399]}:{'$ne':null}}})[_0x2569('0x16')](function(_0x1ba59d){var _0x386ee5=moment()[_0x2569('0x33')](_0x2569('0x34'));for(var _0x3a52b4=0x0,_0x5dea67=_0x1ba59d[_0x2569('0x35')];_0x3a52b4<_0x5dea67;_0x3a52b4+=0x1){_0x1ba59d[_0x3a52b4][_0x2569('0x36')]({'exitAt':_0x386ee5});}});for(var _0x1274d8=0x0;_0x1274d8<_0x1035d1[_0x2569('0x2c')][_0x2569('0x2d')][_0x179399][_0x2569('0x35')];_0x1274d8+=0x1){db[_0x2569('0x30')][_0x2569('0x37')]({'where':{'channel':_0x179399,'membername':_0x1035d1[_0x2569('0x2e')][_0x2569('0xe')],'type':'INTERACTION','uniqueid':_0x1035d1['body'][_0x2569('0x2d')][_0x179399][_0x1274d8],'exitAt':null},'defaults':{'channel':_0x179399,'membername':_0x1035d1[_0x2569('0x2e')][_0x2569('0xe')],'interface':_[_0x2569('0x10')](_0x1035d1[_0x2569('0x2e')][_0x2569('0x38')])?util[_0x2569('0x33')]('SIP/%s',_0x1035d1['user'][_0x2569('0xe')]):_0x1035d1['user'][_0x2569('0x38')],'type':_0x2569('0x32'),'enterAt':moment()['format'](_0x2569('0x34')),'role':_0x2569('0x39'),'internal':_0x1035d1[_0x2569('0x2e')][_0x2569('0x3a')],'uniqueid':_0x1035d1[_0x2569('0x2c')][_0x2569('0x2d')][_0x179399][_0x1274d8]}});}}}}return respondWithRpcPromise(_0x2569('0x3b'),{'id':_0x1035d1['params']['id'],'capacity':_0x1035d1['body'][_0x2569('0x3c')]},routingClient)[_0x2569('0x16')](respondWithResult(_0x3431ad,null))[_0x2569('0xa')](handleError(_0x3431ad,null));};exports[_0x2569('0x3d')]=function(_0xdd398a,_0x23ca7e){return respondWithRpcPromise(_0x2569('0x3e'),_0xdd398a[_0x2569('0x15')])[_0x2569('0x16')](respondWithResult(_0x23ca7e,null))[_0x2569('0xa')](handleError(_0x23ca7e,null));};exports['trunks']=function(_0x21ca81,_0x3d3209){return respondWithRpcPromise(_0x2569('0x3f'),_0x21ca81['query'])['then'](respondWithResult(_0x3d3209,null))[_0x2569('0xa')](handleError(_0x3d3209,null));};exports[_0x2569('0x40')]=function(_0x4e0509,_0x50ef55){return respondWithRpcPromise('Campaigns',_0x4e0509[_0x2569('0x15')])[_0x2569('0x16')](respondWithResult(_0x50ef55,null))[_0x2569('0xa')](handleError(_0x50ef55,null));};exports['chatQueues']=function(_0x530338,_0x1e841e){return respondWithRpcPromise('ChatQueues',_0x530338[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x1e841e,null))[_0x2569('0xa')](handleError(_0x1e841e,null));};exports[_0x2569('0x41')]=function(_0x377cb4,_0xcaa959){return respondWithRpcPromise(_0x2569('0x42'),_0x377cb4[_0x2569('0x15')],routingClient)['then'](findById(_0x377cb4['params']['id']))['then'](respondWithResult(_0xcaa959,null))['catch'](handleError(_0xcaa959,null));};exports['mailQueues']=function(_0x1efca4,_0x2eaeec){return respondWithRpcPromise('MailQueues',_0x1efca4[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x2eaeec,null))[_0x2569('0xa')](handleError(_0x2eaeec,null));};exports[_0x2569('0x43')]=function(_0x46a45e,_0x5bb597){return respondWithRpcPromise(_0x2569('0x44'),_0x46a45e['query'],routingClient)[_0x2569('0x16')](findById(_0x46a45e[_0x2569('0x1a')]['id']))[_0x2569('0x16')](respondWithResult(_0x5bb597,null))['catch'](handleError(_0x5bb597,null));};exports[_0x2569('0x45')]=function(_0x22de6f,_0x43440b){return respondWithRpcPromise(_0x2569('0x46'),_0x22de6f['query'],mailClient)[_0x2569('0x16')](respondWithResult(_0x43440b,null))['catch'](handleError(_0x43440b,null));};exports[_0x2569('0x47')]=function(_0x16b0ab,_0x5cb60f){return respondWithRpcPromise(_0x2569('0x48'),_0x16b0ab[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x5cb60f,null))[_0x2569('0xa')](handleError(_0x5cb60f,null));};exports['showOpenchannelQueues']=function(_0x59fc44,_0x1da1ba){return respondWithRpcPromise('OpenchannelQueues',_0x59fc44[_0x2569('0x15')],routingClient)[_0x2569('0x16')](findById(_0x59fc44[_0x2569('0x1a')]['id']))[_0x2569('0x16')](respondWithResult(_0x1da1ba,null))[_0x2569('0xa')](handleError(_0x1da1ba,null));};exports['smsQueues']=function(_0x2d8612,_0x5a209a){return respondWithRpcPromise(_0x2569('0x49'),_0x2d8612[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x5a209a,null))['catch'](handleError(_0x5a209a,null));};exports['showSmsQueues']=function(_0x2491e1,_0x3e3cd2){return respondWithRpcPromise(_0x2569('0x49'),_0x2491e1[_0x2569('0x15')],routingClient)['then'](findById(_0x2491e1['params']['id']))[_0x2569('0x16')](respondWithResult(_0x3e3cd2,null))['catch'](handleError(_0x3e3cd2,null));};exports[_0x2569('0x4a')]=function(_0x5862df,_0x3bc8c1){return respondWithRpcPromise(_0x2569('0x4b'),_0x5862df[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x3bc8c1,null))[_0x2569('0xa')](handleError(_0x3bc8c1,null));};exports[_0x2569('0x4c')]=function(_0xc492ad,_0x8bb04b){return respondWithRpcPromise(_0x2569('0x4b'),_0xc492ad[_0x2569('0x15')],routingClient)['then'](findById(_0xc492ad[_0x2569('0x1a')]['id']))[_0x2569('0x16')](respondWithResult(_0x8bb04b,null))[_0x2569('0xa')](handleError(_0x8bb04b,null));};exports[_0x2569('0x4d')]=function(_0x29a381,_0x541c90){return respondWithRpcPromise(_0x2569('0x4e'),_0x29a381[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x541c90,null))[_0x2569('0xa')](handleError(_0x541c90,null));};exports[_0x2569('0x4f')]=function(_0x4a20fe,_0x4bc93c){return respondWithRpcPromise(_0x2569('0x4e'),_0x4a20fe['query'],routingClient)[_0x2569('0x16')](findById(_0x4a20fe[_0x2569('0x1a')]['id']))[_0x2569('0x16')](respondWithResult(_0x4bc93c,null))[_0x2569('0xa')](handleError(_0x4bc93c,null));};exports['faxAccounts']=function(_0x291f5f,_0xb06f29){return respondWithRpcPromise(_0x2569('0x50'),_0x291f5f[_0x2569('0x15')])[_0x2569('0x16')](respondWithResult(_0xb06f29,null))[_0x2569('0xa')](handleError(_0xb06f29,null));};exports[_0x2569('0x51')]=function(_0x311847,_0x1d07b7){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x311847[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x1d07b7,null))[_0x2569('0xa')](handleError(_0x1d07b7,null));};exports[_0x2569('0x52')]=function(_0x5864e6,_0x40c03e){return respondWithRpcPromise(_0x2569('0x53'),_0x5864e6[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x40c03e,null))[_0x2569('0xa')](handleError(_0x40c03e,null));};exports[_0x2569('0x54')]=function(_0x4c306b,_0x473b7b){return respondWithRpcPromise(_0x2569('0x55'),_0x4c306b[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x473b7b,null))[_0x2569('0xa')](handleError(_0x473b7b,null));};exports[_0x2569('0x56')]=function(_0x58363f,_0x536f4f){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x58363f['query'],routingClient)['then'](respondWithResult(_0x536f4f,null))[_0x2569('0xa')](handleError(_0x536f4f,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x226b79,_0x10fa70){return respondWithRpcPromise(_0x2569('0x57'),_0x226b79[_0x2569('0x15')],routingClient)['then'](respondWithResult(_0x10fa70,null))[_0x2569('0xa')](handleError(_0x10fa70,null));};exports[_0x2569('0x58')]=function(_0x586d84,_0x5af58a){return respondWithRpcPromise(_0x2569('0x59'),_0x586d84[_0x2569('0x15')],routingClient)[_0x2569('0x16')](respondWithResult(_0x5af58a,null))[_0x2569('0xa')](handleError(_0x5af58a,null));};exports[_0x2569('0x5a')]=function(_0x1512f2){return function(_0x3d6fad,_0x16ae66){var _0x2bbae2,_0x5cc408;var _0xc74f92=_['capitalize'](_0x1512f2);var _0x3c75db=_0x1512f2===_0x2569('0x5b')?_0x2569('0x5c'):_0x2569('0x5d');return db[_0xc74f92+_0x2569('0x5e')][_0x2569('0x5f')]({'raw':!![],'where':{'id':_0x3d6fad['params']['id']}})[_0x2569('0x16')](function(_0x340692){if(_['isNil'](_0x340692)){throw new Error(_0xc74f92+'\x20Queue\x20not\x20found');}_0x2bbae2=_0x340692;return db[_0xc74f92+_0x2569('0x60')][_0x2569('0x5f')]({'where':{'id':_0x3d6fad[_0x2569('0x2c')]['messageId']},'include':[{'model':db[_0xc74f92+_0x2569('0x61')],'as':_0x2569('0x61')},{'model':db[_0xc74f92+_0x3c75db],'as':_0x2569('0x5d')}]});})[_0x2569('0x16')](function(_0x42db2e){if(_[_0x2569('0x10')](_0x42db2e)){throw new Error(_0xc74f92+_0x2569('0x62'));}_0x5cc408=_0x42db2e;return _0x42db2e[_0x2569('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2569('0x16')](function(){var _0x16adaa={'uniqueid':_0x1512f2+'.'+_0x5cc408['id']+'.'+_0x5cc408[_0x2569('0x61')]['id'],'FromUserId':_0x3d6fad[_0x2569('0x2e')]['id'],'type':_0x2569('0x64')};_0x16adaa[_0xc74f92+_0x2569('0x65')]=_0x5cc408['id'];_0x16adaa[_0xc74f92+'InteractionId']=_0x5cc408['Interaction']['id'];_0x16adaa['From'+_0xc74f92+_0x3c75db+'Id']=_0x5cc408[_0x2569('0x5d')]['id'];_0x16adaa['To'+_0xc74f92+'QueueId']=_0x2bbae2['id'];return db[_0xc74f92+_0x2569('0x66')]['create'](_0x16adaa);})[_0x2569('0x16')](function(){return respondWithRpcPromise(_0x2569('0x67'),{'channel':_0x1512f2,'interaction':_0x5cc408[_0x2569('0x61')],'message':_0x5cc408,'account':_0x5cc408['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x2569('0x64'),'appdata':_0x2bbae2[_0x2569('0xe')]+','+(_0x5cc408[_0x2569('0x5d')][_0x2569('0x68')]||0x12c),'interval':_0x2569('0x69')}]},routingClient);})['then'](respondWithResult(_0x16ae66,null))[_0x2569('0xa')](handleError(_0x16ae66,null));};};exports[_0x2569('0x6a')]=function(_0xbe81cd,_0x241aed){var _0xdefb4e,_0x5a9aa9;if(_[_0x2569('0x10')](_0xbe81cd['body'][_0x2569('0x6b')])){throw new Error(_0x2569('0x6c'));}var _0x4762ee=_0xbe81cd['body']['channel'];var _0x1558ab=_[_0x2569('0x6d')](_0x4762ee);var _0x192401=_0x4762ee==='chat'?_0x2569('0x5c'):'Account';return db['User'][_0x2569('0x5f')]({'raw':!![],'where':{'id':_0xbe81cd[_0x2569('0x1a')]['id'],'role':_0x2569('0x39')}})['then'](function(_0x400d8f){if(_[_0x2569('0x10')](_0x400d8f)){throw new Error('Agent\x20not\x20found');}_0xdefb4e=_0x400d8f;return db[_0x1558ab+'Message'][_0x2569('0x5f')]({'where':{'id':_0xbe81cd['body']['messageId']},'include':[{'model':db[_0x1558ab+_0x2569('0x61')],'as':'Interaction'},{'model':db[_0x1558ab+_0x192401],'as':'Account'}]});})[_0x2569('0x16')](function(_0x17acda){if(_[_0x2569('0x10')](_0x17acda)){throw new Error(_0x1558ab+_0x2569('0x62'));}_0x5a9aa9=_0x17acda;return _0x17acda['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x2569('0x16')](function(){var _0x450bcc={'uniqueid':_0x4762ee+'.'+_0x5a9aa9['id']+'.'+_0x5a9aa9[_0x2569('0x61')]['id'],'FromUserId':_0xbe81cd[_0x2569('0x2e')]['id'],'type':_0x2569('0x64'),'ToUserId':_0xdefb4e['id']};_0x450bcc[_0x1558ab+_0x2569('0x65')]=_0x5a9aa9['id'];_0x450bcc[_0x1558ab+'InteractionId']=_0x5a9aa9[_0x2569('0x61')]['id'];_0x450bcc[_0x2569('0x6e')+_0x1558ab+_0x192401+'Id']=_0x5a9aa9['Account']['id'];return db[_0x1558ab+_0x2569('0x66')]['create'](_0x450bcc);})[_0x2569('0x16')](function(){return respondWithRpcPromise(_0x2569('0x67'),{'channel':_0x4762ee,'interaction':_0x5a9aa9['Interaction'],'message':_0x5a9aa9,'account':_0x5a9aa9[_0x2569('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2569('0x39'),'appdata':_0xdefb4e['name']+','+(_0x5a9aa9[_0x2569('0x5d')][_0x2569('0x6f')]||0x12c),'interval':_0x2569('0x69')}]},routingClient);})[_0x2569('0x16')](respondWithResult(_0x241aed,null))[_0x2569('0xa')](handleError(_0x241aed,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 759ef24..34ef388 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 _0x51ae=['../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','run','post','/:id','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0x319fe0,_0xdaeae6){var _0x52d6ca=function(_0x388304){while(--_0x388304){_0x319fe0['push'](_0x319fe0['shift']());}};_0x52d6ca(++_0xdaeae6);}(_0x51ae,0x8b));var _0xe51a=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x51ae[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0xe51a('0x0'));var util=require(_0xe51a('0x1'));var path=require('path');var timeout=require(_0xe51a('0x2'));var express=require('express');var router=express[_0xe51a('0x3')]();var auth=require(_0xe51a('0x4'));var interaction=require(_0xe51a('0x5'));var config=require(_0xe51a('0x6'));var controller=require(_0xe51a('0x7'));router[_0xe51a('0x8')]('/',auth[_0xe51a('0x9')](),controller[_0xe51a('0xa')]);router['get']('/:id',auth[_0xe51a('0x9')](),controller[_0xe51a('0xb')]);router[_0xe51a('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0xe51a('0xc')]);router[_0xe51a('0xd')]('/',auth[_0xe51a('0x9')](),controller['create']);router['put'](_0xe51a('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xe51a('0xf')](_0xe51a('0xe'),auth['isAuthenticated'](),controller[_0xe51a('0x10')]);module[_0xe51a('0x11')]=router; \ No newline at end of file +var _0x2ea1=['get','isAuthenticated','/:id','show','/:id/run','run','post','create','put','update','destroy','util','Router','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x2ea1,0x6b));var _0x12ea=function(_0x2624df,_0x2ee33c){_0x2624df=_0x2624df-0x0;var _0x47fc43=_0x2ea1[_0x2624df];return _0x47fc43;};'use strict';var multer=require('multer');var util=require(_0x12ea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x12ea('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x12ea('0x2'));var config=require(_0x12ea('0x3'));var controller=require(_0x12ea('0x4'));router[_0x12ea('0x5')]('/',auth[_0x12ea('0x6')](),controller['index']);router['get'](_0x12ea('0x7'),auth[_0x12ea('0x6')](),controller[_0x12ea('0x8')]);router['get'](_0x12ea('0x9'),auth['isAuthenticated'](),controller[_0x12ea('0xa')]);router[_0x12ea('0xb')]('/',auth[_0x12ea('0x6')](),controller[_0x12ea('0xc')]);router[_0x12ea('0xd')](_0x12ea('0x7'),auth[_0x12ea('0x6')](),controller[_0x12ea('0xe')]);router['delete'](_0x12ea('0x7'),auth[_0x12ea('0x6')](),controller[_0x12ea('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index b9d8103..653f194 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 _0x9f02=['BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks','days','csv','pdf','xlsx','custom','TEXT','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9f02,0x68));var _0x29f0=function(_0x56a98b,_0x13d95f){_0x56a98b=_0x56a98b-0x0;var _0x59cc4c=_0x9f02[_0x56a98b];return _0x59cc4c;};'use strict';var Sequelize=require(_0x29f0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x29f0('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x29f0('0x2')],'allowNull':![],'defaultValue':_0x29f0('0x3')},'startAt':{'type':Sequelize[_0x29f0('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x29f0('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x29f0('0x5')]('years',_0x29f0('0x6'),_0x29f0('0x7'),_0x29f0('0x8'),'days','hours','minutes'),'allowNull':![],'defaultValue':_0x29f0('0x9')},'output':{'type':Sequelize['ENUM'](_0x29f0('0xa'),_0x29f0('0xb'),_0x29f0('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x29f0('0xd'),'default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x29f0('0xe')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x29f0('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0xf446=['xlsx','csv','custom','default','BOOLEAN','TEXT','sequelize','STRING','DATE','ENUM','weeks','hours','pdf'];(function(_0x88a132,_0x165669){var _0x31c2d9=function(_0x32d217){while(--_0x32d217){_0x88a132['push'](_0x88a132['shift']());}};_0x31c2d9(++_0x165669);}(_0xf446,0x1c0));var _0x6f44=function(_0x1778ff,_0x25bdf1){_0x1778ff=_0x1778ff-0x0;var _0x50d3=_0xf446[_0x1778ff];return _0x50d3;};'use strict';var Sequelize=require(_0x6f44('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f44('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x6f44('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6f44('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x6f44('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6f44('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6f44('0x3')]('years','quarters','months',_0x6f44('0x4'),'days',_0x6f44('0x5'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x6f44('0x3')]('csv',_0x6f44('0x6'),_0x6f44('0x7')),'allowNull':![],'defaultValue':_0x6f44('0x8')},'type':{'type':Sequelize[_0x6f44('0x3')](_0x6f44('0x9'),_0x6f44('0xa')),'allowNull':![],'defaultValue':_0x6f44('0x9')},'sendMail':{'type':Sequelize[_0x6f44('0xb')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6f44('0xc')]},'bcc':{'type':Sequelize[_0x6f44('0xc')]},'sendIfEmpty':{'type':Sequelize[_0x6f44('0xb')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8a5452f..c87e1d6 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 _0x3d8d=['send','map','Schedule','rawAttributes','type','query','keys','model','attributes','intersection','fields','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','length','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','Scheduler','error','name'];(function(_0x27db60,_0x50f9df){var _0x15ff66=function(_0x508fe4){while(--_0x508fe4){_0x27db60['push'](_0x27db60['shift']());}};_0x15ff66(++_0x50f9df);}(_0x3d8d,0xca));var _0xd3d8=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x3d8d[_0x3a3758];return _0x1a9234;};'use strict';var pdf=require(_0xd3d8('0x0'));var emlformat=require(_0xd3d8('0x1'));var rimraf=require(_0xd3d8('0x2'));var zipdir=require(_0xd3d8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd3d8('0x4'));var moment=require(_0xd3d8('0x5'));var BPromise=require(_0xd3d8('0x6'));var Mustache=require('mustache');var util=require(_0xd3d8('0x7'));var path=require('path');var sox=require(_0xd3d8('0x8'));var csv=require(_0xd3d8('0x9'));var ejs=require(_0xd3d8('0xa'));var fs=require('fs');var _=require(_0xd3d8('0xb'));var squel=require('squel');var crypto=require(_0xd3d8('0xc'));var jsforce=require(_0xd3d8('0xd'));var deskjs=require(_0xd3d8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd3d8('0xf'));var Papa=require('papaparse');var Redis=require(_0xd3d8('0x10'));var authService=require(_0xd3d8('0x11'));var qs=require(_0xd3d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd3d8('0x13'));var logger=require(_0xd3d8('0x14'))(_0xd3d8('0x15'));var utils=require(_0xd3d8('0x16'));var config=require('../../config/environment');var db=require(_0xd3d8('0x17'))['db'];function respondWithStatusCode(_0x51d6e5,_0x1efd36){_0x1efd36=_0x1efd36||0xcc;return function(_0x58a5e0){if(_0x58a5e0){return _0x51d6e5[_0xd3d8('0x18')](_0x1efd36);}return _0x51d6e5[_0xd3d8('0x19')](_0x1efd36)[_0xd3d8('0x1a')]();};}function respondWithResult(_0x151d8c,_0x584f62){_0x584f62=_0x584f62||0xc8;return function(_0x1c9b06){if(_0x1c9b06){return _0x151d8c[_0xd3d8('0x19')](_0x584f62)[_0xd3d8('0x1b')](_0x1c9b06);}};}function respondWithFilteredResult(_0x1a952c,_0x127d89){return function(_0xef46e7){if(_0xef46e7){var _0x3bc02d=_0xef46e7['count'],_0x2efd09=_0x127d89['offset'],_0x1703b9=_0x127d89[_0xd3d8('0x1c')]+_0x127d89[_0xd3d8('0x1d')],_0x275660;if(_0x1703b9>=_0x3bc02d){_0x1703b9=_0x3bc02d;_0x275660=0xc8;}else{_0x275660=0xce;}_0x1a952c[_0xd3d8('0x19')](_0x275660);return _0x1a952c[_0xd3d8('0x1e')](_0xd3d8('0x1f'),_0x2efd09+'-'+_0x1703b9+'/'+_0x3bc02d)[_0xd3d8('0x1b')](_0xef46e7);}return null;};}function patchUpdates(_0xb4d192){return function(_0x4a81ed){try{jsonpatch[_0xd3d8('0x20')](_0x4a81ed,_0xb4d192,!![]);}catch(_0x14d3b1){return BPromise[_0xd3d8('0x21')](_0x14d3b1);}return _0x4a81ed['save']();};}function saveUpdates(_0x55215c,_0x1679b8){return function(_0x9ea94){if(_0x9ea94){return _0x9ea94[_0xd3d8('0x22')](_0x55215c)['then'](function(_0x429abd){return _0x429abd;});}return null;};}function removeEntity(_0x3804d6,_0x79f37f){return function(_0x1ec71f){if(_0x1ec71f){return _0x1ec71f[_0xd3d8('0x23')]()[_0xd3d8('0x24')](function(){var _0x11eb36=_0x1ec71f[_0xd3d8('0x25')]({'plain':!![]});var _0x21ee00=_0xd3d8('0x26');return db['UserProfileResource'][_0xd3d8('0x23')]({'where':{'type':_0x21ee00,'resourceId':_0x11eb36['id']}})[_0xd3d8('0x24')](function(){return _0x1ec71f;});})[_0xd3d8('0x24')](function(){_0x3804d6[_0xd3d8('0x19')](0xcc)[_0xd3d8('0x1a')]();});}};}function handleEntityNotFound(_0x2ce69a,_0x200e88){return function(_0x1b69ef){if(!_0x1b69ef){_0x2ce69a[_0xd3d8('0x18')](0x194);}return _0x1b69ef;};}function handleError(_0x93a188,_0x492a93){_0x492a93=_0x492a93||0x1f4;return function(_0x485a90){logger[_0xd3d8('0x27')](_0x485a90['stack']);if(_0x485a90[_0xd3d8('0x28')]){delete _0x485a90[_0xd3d8('0x28')];}_0x93a188[_0xd3d8('0x19')](_0x492a93)[_0xd3d8('0x29')](_0x485a90);};}exports['index']=function(_0x577933,_0x13e288){var _0x2c09ab={},_0x27d9a0={},_0x3123b8={'count':0x0,'rows':[]};var _0x451b3d=_[_0xd3d8('0x2a')](db[_0xd3d8('0x2b')][_0xd3d8('0x2c')],function(_0x186697){return{'name':_0x186697['fieldName'],'type':_0x186697[_0xd3d8('0x2d')]['key']};});_0x27d9a0['model']=_[_0xd3d8('0x2a')](_0x451b3d,_0xd3d8('0x28'));_0x27d9a0[_0xd3d8('0x2e')]=_[_0xd3d8('0x2f')](_0x577933[_0xd3d8('0x2e')]);_0x27d9a0['filters']=_['intersection'](_0x27d9a0[_0xd3d8('0x30')],_0x27d9a0[_0xd3d8('0x2e')]);_0x2c09ab[_0xd3d8('0x31')]=_[_0xd3d8('0x32')](_0x27d9a0['model'],qs[_0xd3d8('0x33')](_0x577933[_0xd3d8('0x2e')][_0xd3d8('0x33')]));_0x2c09ab[_0xd3d8('0x31')]=_0x2c09ab[_0xd3d8('0x31')]['length']?_0x2c09ab[_0xd3d8('0x31')]:_0x27d9a0[_0xd3d8('0x30')];if(!_0x577933['query']['hasOwnProperty'](_0xd3d8('0x34'))){_0x2c09ab[_0xd3d8('0x1d')]=qs[_0xd3d8('0x1d')](_0x577933[_0xd3d8('0x2e')][_0xd3d8('0x1d')]);_0x2c09ab[_0xd3d8('0x1c')]=qs[_0xd3d8('0x1c')](_0x577933['query'][_0xd3d8('0x1c')]);}_0x2c09ab[_0xd3d8('0x35')]=qs[_0xd3d8('0x36')](_0x577933['query'][_0xd3d8('0x36')]);_0x2c09ab['where']=qs[_0xd3d8('0x37')](_['pick'](_0x577933['query'],_0x27d9a0[_0xd3d8('0x37')]),_0x451b3d);if(_0x577933['query'][_0xd3d8('0x38')]){_0x2c09ab[_0xd3d8('0x39')]=_[_0xd3d8('0x3a')](_0x2c09ab[_0xd3d8('0x39')],{'$or':_['map'](_0x451b3d,function(_0x2fabfc){if(_0x2fabfc[_0xd3d8('0x2d')]!==_0xd3d8('0x3b')){var _0x4be801={};_0x4be801[_0x2fabfc[_0xd3d8('0x28')]]={'$like':'%'+_0x577933[_0xd3d8('0x2e')][_0xd3d8('0x38')]+'%'};return _0x4be801;}})});}_0x2c09ab=_[_0xd3d8('0x3a')]({},_0x2c09ab,_0x577933[_0xd3d8('0x3c')]);var _0x20c3f0={'where':_0x2c09ab[_0xd3d8('0x39')]};return db['Schedule'][_0xd3d8('0x3d')](_0x20c3f0)[_0xd3d8('0x24')](function(_0x5adaae){_0x3123b8[_0xd3d8('0x3d')]=_0x5adaae;if(_0x577933[_0xd3d8('0x2e')][_0xd3d8('0x3e')]){_0x2c09ab['include']=[{'all':!![]}];}return db['Schedule'][_0xd3d8('0x3f')](_0x2c09ab);})[_0xd3d8('0x24')](function(_0x409abb){_0x3123b8[_0xd3d8('0x40')]=_0x409abb;return _0x3123b8;})['then'](respondWithFilteredResult(_0x13e288,_0x2c09ab))[_0xd3d8('0x41')](handleError(_0x13e288,null));};exports['show']=function(_0x389645,_0x309da8){var _0x3c23b3={'raw':![],'where':{'id':_0x389645['params']['id']}},_0xb806fa={};_0xb806fa[_0xd3d8('0x30')]=_[_0xd3d8('0x2f')](db[_0xd3d8('0x2b')]['rawAttributes']);_0xb806fa[_0xd3d8('0x2e')]=_[_0xd3d8('0x2f')](_0x389645[_0xd3d8('0x2e')]);_0xb806fa[_0xd3d8('0x37')]=_[_0xd3d8('0x32')](_0xb806fa[_0xd3d8('0x30')],_0xb806fa['query']);_0x3c23b3['attributes']=_['intersection'](_0xb806fa[_0xd3d8('0x30')],qs[_0xd3d8('0x33')](_0x389645[_0xd3d8('0x2e')][_0xd3d8('0x33')]));_0x3c23b3[_0xd3d8('0x31')]=_0x3c23b3[_0xd3d8('0x31')][_0xd3d8('0x42')]?_0x3c23b3['attributes']:_0xb806fa[_0xd3d8('0x30')];if(_0x389645[_0xd3d8('0x2e')][_0xd3d8('0x3e')]){_0x3c23b3[_0xd3d8('0x43')]=[{'all':!![]}];}_0x3c23b3=_[_0xd3d8('0x3a')]({},_0x3c23b3,_0x389645[_0xd3d8('0x3c')]);return db[_0xd3d8('0x2b')]['find'](_0x3c23b3)[_0xd3d8('0x24')](handleEntityNotFound(_0x309da8,null))[_0xd3d8('0x24')](respondWithResult(_0x309da8,null))[_0xd3d8('0x41')](handleError(_0x309da8,null));};exports['create']=function(_0x2a4eea,_0x5e7422){return db[_0xd3d8('0x2b')][_0xd3d8('0x44')](_0x2a4eea[_0xd3d8('0x45')],{})['then'](function(_0x56c626){var _0x29ea1a=_0x2a4eea['user'][_0xd3d8('0x25')]({'plain':!![]});if(!_0x29ea1a)throw new Error(_0xd3d8('0x46'));if(_0x29ea1a[_0xd3d8('0x47')]===_0xd3d8('0x48')){var _0x449902=_0x56c626[_0xd3d8('0x25')]({'plain':!![]});var _0x482e9a=_0xd3d8('0x26');return db['UserProfileSection'][_0xd3d8('0x49')]({'where':{'name':_0x482e9a,'userProfileId':_0x29ea1a[_0xd3d8('0x4a')]},'raw':!![]})['then'](function(_0x384fee){if(_0x384fee&&_0x384fee[_0xd3d8('0x4b')]===0x0){return db[_0xd3d8('0x4c')][_0xd3d8('0x44')]({'name':_0x449902[_0xd3d8('0x28')],'resourceId':_0x449902['id'],'type':_0x384fee['name'],'sectionId':_0x384fee['id']},{})[_0xd3d8('0x24')](function(){return _0x56c626;});}else{return _0x56c626;}})[_0xd3d8('0x41')](function(_0x3f1746){logger[_0xd3d8('0x27')](_0xd3d8('0x4d'),_0x3f1746);throw _0x3f1746;});}return _0x56c626;})[_0xd3d8('0x24')](respondWithResult(_0x5e7422,0xc9))[_0xd3d8('0x41')](handleError(_0x5e7422,null));};exports[_0xd3d8('0x22')]=function(_0x2a491c,_0x5bca64){if(_0x2a491c[_0xd3d8('0x45')]['id']){delete _0x2a491c[_0xd3d8('0x45')]['id'];}return db[_0xd3d8('0x2b')][_0xd3d8('0x49')]({'where':{'id':_0x2a491c[_0xd3d8('0x4e')]['id']}})[_0xd3d8('0x24')](handleEntityNotFound(_0x5bca64,null))[_0xd3d8('0x24')](saveUpdates(_0x2a491c['body'],null))['then'](respondWithResult(_0x5bca64,null))[_0xd3d8('0x41')](handleError(_0x5bca64,null));};exports['destroy']=function(_0x5214a0,_0xdeb88d){return db['Schedule'][_0xd3d8('0x49')]({'where':{'id':_0x5214a0[_0xd3d8('0x4e')]['id']}})[_0xd3d8('0x24')](handleEntityNotFound(_0xdeb88d,null))[_0xd3d8('0x24')](removeEntity(_0xdeb88d,null))['catch'](handleError(_0xdeb88d,null));};exports[_0xd3d8('0x4f')]=function(_0x45e495,_0x4b3712,_0x583826){var _0x36c9fd=require(_0xd3d8('0x50'));return db[_0xd3d8('0x2b')][_0xd3d8('0x49')]({'where':{'id':_0x45e495['params']['id']},'raw':!![]})[_0xd3d8('0x24')](handleEntityNotFound(_0x4b3712,null))[_0xd3d8('0x24')](function(){_0x36c9fd['run'](_0x45e495[_0xd3d8('0x4e')]['id']);})[_0xd3d8('0x24')](respondWithStatusCode(_0x4b3712,null))[_0xd3d8('0x41')](handleError(_0x4b3712,null));}; \ No newline at end of file +var _0x08e1=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','name','filter','options','count','include','findAll','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','../../config/schedule','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save','destroy','then','Scheduler','UserProfileResource','error','send','index','map','Schedule','rawAttributes','type','key'];(function(_0x1f26c1,_0x3ce23e){var _0x4141cd=function(_0x177085){while(--_0x177085){_0x1f26c1['push'](_0x1f26c1['shift']());}};_0x4141cd(++_0x3ce23e);}(_0x08e1,0x1b4));var _0x108e=function(_0x15f3c0,_0x165a64){_0x15f3c0=_0x15f3c0-0x0;var _0x1adfe0=_0x08e1[_0x15f3c0];return _0x1adfe0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x108e('0x0'));var jsonpatch=require(_0x108e('0x1'));var rp=require('request-promise');var moment=require(_0x108e('0x2'));var BPromise=require(_0x108e('0x3'));var Mustache=require('mustache');var util=require(_0x108e('0x4'));var path=require(_0x108e('0x5'));var sox=require(_0x108e('0x6'));var csv=require(_0x108e('0x7'));var ejs=require(_0x108e('0x8'));var fs=require('fs');var _=require(_0x108e('0x9'));var squel=require(_0x108e('0xa'));var crypto=require(_0x108e('0xb'));var jsforce=require(_0x108e('0xc'));var deskjs=require(_0x108e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x108e('0xe'));var Papa=require(_0x108e('0xf'));var Redis=require('ioredis');var authService=require(_0x108e('0x10'));var qs=require(_0x108e('0x11'));var as=require(_0x108e('0x12'));var hardwareService=require(_0x108e('0x13'));var logger=require(_0x108e('0x14'))(_0x108e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x108e('0x16'))['db'];function respondWithStatusCode(_0x4b7b18,_0xc06a3e){_0xc06a3e=_0xc06a3e||0xcc;return function(_0x5366fd){if(_0x5366fd){return _0x4b7b18[_0x108e('0x17')](_0xc06a3e);}return _0x4b7b18[_0x108e('0x18')](_0xc06a3e)[_0x108e('0x19')]();};}function respondWithResult(_0x547888,_0x263f04){_0x263f04=_0x263f04||0xc8;return function(_0x1bfa48){if(_0x1bfa48){return _0x547888[_0x108e('0x18')](_0x263f04)[_0x108e('0x1a')](_0x1bfa48);}};}function respondWithFilteredResult(_0x24e0d9,_0x482dfe){return function(_0x112cab){if(_0x112cab){var _0x238a11=_0x112cab['count'],_0x1e3284=_0x482dfe[_0x108e('0x1b')],_0x1bc748=_0x482dfe[_0x108e('0x1b')]+_0x482dfe[_0x108e('0x1c')],_0x2eec6e;if(_0x1bc748>=_0x238a11){_0x1bc748=_0x238a11;_0x2eec6e=0xc8;}else{_0x2eec6e=0xce;}_0x24e0d9[_0x108e('0x18')](_0x2eec6e);return _0x24e0d9[_0x108e('0x1d')](_0x108e('0x1e'),_0x1e3284+'-'+_0x1bc748+'/'+_0x238a11)['json'](_0x112cab);}return null;};}function patchUpdates(_0x2a21ab){return function(_0x233073){try{jsonpatch['apply'](_0x233073,_0x2a21ab,!![]);}catch(_0x4d6f20){return BPromise['reject'](_0x4d6f20);}return _0x233073[_0x108e('0x1f')]();};}function saveUpdates(_0x50f311,_0x11e629){return function(_0xc51c60){if(_0xc51c60){return _0xc51c60['update'](_0x50f311)['then'](function(_0x15ca07){return _0x15ca07;});}return null;};}function removeEntity(_0x2af5d3,_0x3b81d3){return function(_0x266404){if(_0x266404){return _0x266404[_0x108e('0x20')]()[_0x108e('0x21')](function(){var _0x3a0f25=_0x266404['get']({'plain':!![]});var _0x43479c=_0x108e('0x22');return db[_0x108e('0x23')][_0x108e('0x20')]({'where':{'type':_0x43479c,'resourceId':_0x3a0f25['id']}})[_0x108e('0x21')](function(){return _0x266404;});})[_0x108e('0x21')](function(){_0x2af5d3[_0x108e('0x18')](0xcc)[_0x108e('0x19')]();});}};}function handleEntityNotFound(_0x46fefa,_0x4a35e0){return function(_0x5a8b07){if(!_0x5a8b07){_0x46fefa[_0x108e('0x17')](0x194);}return _0x5a8b07;};}function handleError(_0x584d94,_0x565954){_0x565954=_0x565954||0x1f4;return function(_0x331c4b){logger[_0x108e('0x24')](_0x331c4b['stack']);if(_0x331c4b['name']){delete _0x331c4b['name'];}_0x584d94[_0x108e('0x18')](_0x565954)[_0x108e('0x25')](_0x331c4b);};}exports[_0x108e('0x26')]=function(_0x5aadc9,_0x2b1232){var _0x4af043={},_0x503177={},_0x2ca347={'count':0x0,'rows':[]};var _0xa33885=_[_0x108e('0x27')](db[_0x108e('0x28')][_0x108e('0x29')],function(_0x216267){return{'name':_0x216267['fieldName'],'type':_0x216267[_0x108e('0x2a')][_0x108e('0x2b')]};});_0x503177[_0x108e('0x2c')]=_[_0x108e('0x27')](_0xa33885,'name');_0x503177['query']=_[_0x108e('0x2d')](_0x5aadc9[_0x108e('0x2e')]);_0x503177['filters']=_[_0x108e('0x2f')](_0x503177[_0x108e('0x2c')],_0x503177[_0x108e('0x2e')]);_0x4af043[_0x108e('0x30')]=_['intersection'](_0x503177[_0x108e('0x2c')],qs['fields'](_0x5aadc9[_0x108e('0x2e')][_0x108e('0x31')]));_0x4af043['attributes']=_0x4af043[_0x108e('0x30')][_0x108e('0x32')]?_0x4af043[_0x108e('0x30')]:_0x503177['model'];if(!_0x5aadc9[_0x108e('0x2e')][_0x108e('0x33')](_0x108e('0x34'))){_0x4af043[_0x108e('0x1c')]=qs[_0x108e('0x1c')](_0x5aadc9['query'][_0x108e('0x1c')]);_0x4af043['offset']=qs['offset'](_0x5aadc9[_0x108e('0x2e')]['offset']);}_0x4af043[_0x108e('0x35')]=qs['sort'](_0x5aadc9['query']['sort']);_0x4af043[_0x108e('0x36')]=qs[_0x108e('0x37')](_['pick'](_0x5aadc9['query'],_0x503177[_0x108e('0x37')]),_0xa33885);if(_0x5aadc9['query']['filter']){_0x4af043['where']=_[_0x108e('0x38')](_0x4af043[_0x108e('0x36')],{'$or':_[_0x108e('0x27')](_0xa33885,function(_0x207276){if(_0x207276[_0x108e('0x2a')]!==_0x108e('0x39')){var _0x513fd1={};_0x513fd1[_0x207276[_0x108e('0x3a')]]={'$like':'%'+_0x5aadc9[_0x108e('0x2e')][_0x108e('0x3b')]+'%'};return _0x513fd1;}})});}_0x4af043=_['merge']({},_0x4af043,_0x5aadc9[_0x108e('0x3c')]);var _0x4afc21={'where':_0x4af043['where']};return db[_0x108e('0x28')][_0x108e('0x3d')](_0x4afc21)[_0x108e('0x21')](function(_0x442f1e){_0x2ca347[_0x108e('0x3d')]=_0x442f1e;if(_0x5aadc9['query']['includeAll']){_0x4af043[_0x108e('0x3e')]=[{'all':!![]}];}return db[_0x108e('0x28')][_0x108e('0x3f')](_0x4af043);})[_0x108e('0x21')](function(_0x428c1d){_0x2ca347[_0x108e('0x40')]=_0x428c1d;return _0x2ca347;})[_0x108e('0x21')](respondWithFilteredResult(_0x2b1232,_0x4af043))[_0x108e('0x41')](handleError(_0x2b1232,null));};exports['show']=function(_0xd98645,_0x4feb5b){var _0x127784={'raw':![],'where':{'id':_0xd98645[_0x108e('0x42')]['id']}},_0x2ee810={};_0x2ee810[_0x108e('0x2c')]=_['keys'](db['Schedule'][_0x108e('0x29')]);_0x2ee810[_0x108e('0x2e')]=_[_0x108e('0x2d')](_0xd98645[_0x108e('0x2e')]);_0x2ee810[_0x108e('0x37')]=_['intersection'](_0x2ee810[_0x108e('0x2c')],_0x2ee810[_0x108e('0x2e')]);_0x127784['attributes']=_[_0x108e('0x2f')](_0x2ee810[_0x108e('0x2c')],qs[_0x108e('0x31')](_0xd98645[_0x108e('0x2e')][_0x108e('0x31')]));_0x127784['attributes']=_0x127784[_0x108e('0x30')][_0x108e('0x32')]?_0x127784[_0x108e('0x30')]:_0x2ee810[_0x108e('0x2c')];if(_0xd98645[_0x108e('0x2e')]['includeAll']){_0x127784[_0x108e('0x3e')]=[{'all':!![]}];}_0x127784=_['merge']({},_0x127784,_0xd98645[_0x108e('0x3c')]);return db[_0x108e('0x28')][_0x108e('0x43')](_0x127784)[_0x108e('0x21')](handleEntityNotFound(_0x4feb5b,null))[_0x108e('0x21')](respondWithResult(_0x4feb5b,null))[_0x108e('0x41')](handleError(_0x4feb5b,null));};exports[_0x108e('0x44')]=function(_0x35edd,_0x2ffb92){return db[_0x108e('0x28')][_0x108e('0x44')](_0x35edd['body'],{})[_0x108e('0x21')](function(_0x55fb56){var _0x588519=_0x35edd['user']['get']({'plain':!![]});if(!_0x588519)throw new Error(_0x108e('0x45'));if(_0x588519[_0x108e('0x46')]===_0x108e('0x47')){var _0x24b49b=_0x55fb56[_0x108e('0x48')]({'plain':!![]});var _0x58fa64='Scheduler';return db[_0x108e('0x49')][_0x108e('0x43')]({'where':{'name':_0x58fa64,'userProfileId':_0x588519[_0x108e('0x4a')]},'raw':!![]})[_0x108e('0x21')](function(_0x26ce13){if(_0x26ce13&&_0x26ce13['autoAssociation']===0x0){return db[_0x108e('0x23')][_0x108e('0x44')]({'name':_0x24b49b[_0x108e('0x3a')],'resourceId':_0x24b49b['id'],'type':_0x26ce13[_0x108e('0x3a')],'sectionId':_0x26ce13['id']},{})[_0x108e('0x21')](function(){return _0x55fb56;});}else{return _0x55fb56;}})['catch'](function(_0x5a2a45){logger['error'](_0x108e('0x4b'),_0x5a2a45);throw _0x5a2a45;});}return _0x55fb56;})[_0x108e('0x21')](respondWithResult(_0x2ffb92,0xc9))[_0x108e('0x41')](handleError(_0x2ffb92,null));};exports[_0x108e('0x4c')]=function(_0x232545,_0x474ad6){if(_0x232545[_0x108e('0x4d')]['id']){delete _0x232545[_0x108e('0x4d')]['id'];}return db[_0x108e('0x28')][_0x108e('0x43')]({'where':{'id':_0x232545[_0x108e('0x42')]['id']}})[_0x108e('0x21')](handleEntityNotFound(_0x474ad6,null))[_0x108e('0x21')](saveUpdates(_0x232545[_0x108e('0x4d')],null))[_0x108e('0x21')](respondWithResult(_0x474ad6,null))['catch'](handleError(_0x474ad6,null));};exports[_0x108e('0x20')]=function(_0x3f5217,_0x50aeba){return db[_0x108e('0x28')]['find']({'where':{'id':_0x3f5217[_0x108e('0x42')]['id']}})[_0x108e('0x21')](handleEntityNotFound(_0x50aeba,null))[_0x108e('0x21')](removeEntity(_0x50aeba,null))[_0x108e('0x41')](handleError(_0x50aeba,null));};exports[_0x108e('0x4e')]=function(_0x1d549b,_0x544e00,_0x5244e5){var _0x5065e2=require(_0x108e('0x4f'));return db[_0x108e('0x28')][_0x108e('0x43')]({'where':{'id':_0x1d549b[_0x108e('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x544e00,null))[_0x108e('0x21')](function(){_0x5065e2[_0x108e('0x4e')](_0x1d549b[_0x108e('0x42')]['id']);})['then'](respondWithStatusCode(_0x544e00,null))[_0x108e('0x41')](handleError(_0x544e00,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8935930..1d8940e 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 _0xe9e9=['../../config/logger','api','moment','bluebird','rimraf','./schedule.attributes','exports','define','Schedule','lodash'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xe9e9,0x199));var _0x9e9e=function(_0xe19e8c,_0x6b4066){_0xe19e8c=_0xe19e8c-0x0;var _0x4bb6d7=_0xe9e9[_0xe19e8c];return _0x4bb6d7;};'use strict';var _=require(_0x9e9e('0x0'));var util=require('util');var logger=require(_0x9e9e('0x1'))(_0x9e9e('0x2'));var moment=require(_0x9e9e('0x3'));var BPromise=require(_0x9e9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9e9e('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e9e('0x6'));module[_0x9e9e('0x7')]=function(_0x1a0405,_0x16df2f){return _0x1a0405[_0x9e9e('0x8')](_0x9e9e('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc84=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','api'];(function(_0x18051c,_0x1b29e5){var _0x9700c9=function(_0x29a9c8){while(--_0x29a9c8){_0x18051c['push'](_0x18051c['shift']());}};_0x9700c9(++_0x1b29e5);}(_0xdc84,0x1ad));var _0x4dc8=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xdc84[_0x4843f9];return _0x193c6a;};'use strict';var _=require(_0x4dc8('0x0'));var util=require('util');var logger=require(_0x4dc8('0x1'))(_0x4dc8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4dc8('0x3'));var fs=require('fs');var path=require(_0x4dc8('0x4'));var rimraf=require(_0x4dc8('0x5'));var config=require(_0x4dc8('0x6'));var attributes=require(_0x4dc8('0x7'));module[_0x4dc8('0x8')]=function(_0x2c75c9,_0x28f242){return _0x2c75c9[_0x4dc8('0x9')](_0x4dc8('0xa'),attributes,{'tableName':_0x4dc8('0xb'),'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 b3abbea..c76be57 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 _0x0052=['jayson/promise','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x147bae,_0x355fd6){var _0x55d8c0=function(_0xc37649){while(--_0xc37649){_0x147bae['push'](_0x147bae['shift']());}};_0x55d8c0(++_0x355fd6);}(_0x0052,0x1b1));var _0x2005=function(_0xd80fd6,_0x122523){_0xd80fd6=_0xd80fd6-0x0;var _0x5243a6=_0x0052[_0xd80fd6];return _0x5243a6;};'use strict';var _=require('lodash');var util=require(_0x2005('0x0'));var moment=require('moment');var BPromise=require(_0x2005('0x1'));var rs=require(_0x2005('0x2'));var fs=require('fs');var Redis=require(_0x2005('0x3'));var db=require(_0x2005('0x4'))['db'];var utils=require(_0x2005('0x5'));var logger=require('../../config/logger')(_0x2005('0x6'));var config=require(_0x2005('0x7'));var jayson=require(_0x2005('0x8'));var client=jayson['client'][_0x2005('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a4748,_0x333218,_0x526082){return new BPromise(function(_0x51a55d,_0x45f9eb){return client['request'](_0x1a4748,_0x526082)[_0x2005('0xa')](function(_0x2cc909){logger[_0x2005('0xb')](_0x2005('0xc'),_0x333218,_0x2005('0xd'));logger[_0x2005('0xe')](_0x2005('0xf'),_0x333218,_0x2005('0xd'),JSON[_0x2005('0x10')](_0x2cc909));if(_0x2cc909[_0x2005('0x11')]){if(_0x2cc909[_0x2005('0x11')][_0x2005('0x12')]===0x1f4){logger[_0x2005('0x11')](_0x2005('0xc'),_0x333218,_0x2cc909[_0x2005('0x11')][_0x2005('0x13')]);return _0x45f9eb(_0x2cc909[_0x2005('0x11')][_0x2005('0x13')]);}logger[_0x2005('0x11')](_0x2005('0xc'),_0x333218,_0x2cc909['error']['message']);return _0x51a55d(_0x2cc909[_0x2005('0x11')][_0x2005('0x13')]);}else{logger[_0x2005('0xb')](_0x2005('0xc'),_0x333218,_0x2005('0xd'));_0x51a55d(_0x2cc909['result'][_0x2005('0x13')]);}})[_0x2005('0x14')](function(_0x21505f){logger[_0x2005('0x11')](_0x2005('0xc'),_0x333218,_0x21505f);_0x45f9eb(_0x21505f);});});} \ No newline at end of file +var _0xfb37=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x273c7e,_0x46034f){var _0x320ad9=function(_0x1695e7){while(--_0x1695e7){_0x273c7e['push'](_0x273c7e['shift']());}};_0x320ad9(++_0x46034f);}(_0xfb37,0xa6));var _0x7fb3=function(_0x208bc9,_0x4f36f6){_0x208bc9=_0x208bc9-0x0;var _0x2675a8=_0xfb37[_0x208bc9];return _0x2675a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7fb3('0x0'));var BPromise=require(_0x7fb3('0x1'));var rs=require(_0x7fb3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7fb3('0x3'))['db'];var utils=require(_0x7fb3('0x4'));var logger=require(_0x7fb3('0x5'))(_0x7fb3('0x6'));var config=require(_0x7fb3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7fb3('0x8')][_0x7fb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49825c,_0x4ec9e5,_0x2f4418){return new BPromise(function(_0x4b59a1,_0x27c4b5){return client[_0x7fb3('0xa')](_0x49825c,_0x2f4418)[_0x7fb3('0xb')](function(_0x594f0a){logger[_0x7fb3('0xc')](_0x7fb3('0xd'),_0x4ec9e5,_0x7fb3('0xe'));logger['debug'](_0x7fb3('0xf'),_0x4ec9e5,_0x7fb3('0xe'),JSON[_0x7fb3('0x10')](_0x594f0a));if(_0x594f0a[_0x7fb3('0x11')]){if(_0x594f0a['error'][_0x7fb3('0x12')]===0x1f4){logger[_0x7fb3('0x11')]('Schedule,\x20%s,\x20%s',_0x4ec9e5,_0x594f0a[_0x7fb3('0x11')][_0x7fb3('0x13')]);return _0x27c4b5(_0x594f0a['error'][_0x7fb3('0x13')]);}logger[_0x7fb3('0x11')](_0x7fb3('0xd'),_0x4ec9e5,_0x594f0a[_0x7fb3('0x11')][_0x7fb3('0x13')]);return _0x4b59a1(_0x594f0a[_0x7fb3('0x11')][_0x7fb3('0x13')]);}else{logger[_0x7fb3('0xc')](_0x7fb3('0xd'),_0x4ec9e5,_0x7fb3('0xe'));_0x4b59a1(_0x594f0a[_0x7fb3('0x14')][_0x7fb3('0x13')]);}})[_0x7fb3('0x15')](function(_0xb5bf4a){logger['error'](_0x7fb3('0xd'),_0x4ec9e5,_0xb5bf4a);_0x27c4b5(_0xb5bf4a);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 8d8d4bb..52d1512 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 _0x1d65=['isAuthenticated','index','describe','/:id','show','download','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./screenRecording.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1d65,0x162));var _0x51d6=function(_0x3b97cc,_0x451983){_0x3b97cc=_0x3b97cc-0x0;var _0x599f04=_0x1d65[_0x3b97cc];return _0x599f04;};'use strict';var multer=require('multer');var util=require(_0x51d6('0x0'));var path=require('path');var timeout=require(_0x51d6('0x1'));var express=require(_0x51d6('0x2'));var router=express[_0x51d6('0x3')]();var auth=require(_0x51d6('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x51d6('0x5'));router[_0x51d6('0x6')]('/',auth[_0x51d6('0x7')](),controller[_0x51d6('0x8')]);router[_0x51d6('0x6')]('/describe',auth[_0x51d6('0x7')](),controller[_0x51d6('0x9')]);router[_0x51d6('0x6')](_0x51d6('0xa'),auth[_0x51d6('0x7')](),controller[_0x51d6('0xb')]);router[_0x51d6('0x6')]('/:id/download',auth[_0x51d6('0x7')](),controller[_0x51d6('0xc')]);router['post']('/',auth[_0x51d6('0x7')](),controller[_0x51d6('0xd')]);router[_0x51d6('0xe')](_0x51d6('0xa'),auth[_0x51d6('0x7')](),controller[_0x51d6('0xf')]);router[_0x51d6('0x10')](_0x51d6('0xa'),auth['isAuthenticated'](),controller[_0x51d6('0x11')]);module[_0x51d6('0x12')]=router; \ No newline at end of file +var _0x573c=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','put','update'];(function(_0x5cffe5,_0x2bc865){var _0xf5501c=function(_0x1f582d){while(--_0x1f582d){_0x5cffe5['push'](_0x5cffe5['shift']());}};_0xf5501c(++_0x2bc865);}(_0x573c,0xaa));var _0xc573=function(_0x5315bf,_0x140a59){_0x5315bf=_0x5315bf-0x0;var _0x30aa1f=_0x573c[_0x5315bf];return _0x30aa1f;};'use strict';var multer=require(_0xc573('0x0'));var util=require(_0xc573('0x1'));var path=require(_0xc573('0x2'));var timeout=require(_0xc573('0x3'));var express=require(_0xc573('0x4'));var router=express[_0xc573('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc573('0x6'));var config=require(_0xc573('0x7'));var controller=require(_0xc573('0x8'));router[_0xc573('0x9')]('/',auth[_0xc573('0xa')](),controller[_0xc573('0xb')]);router[_0xc573('0x9')](_0xc573('0xc'),auth[_0xc573('0xa')](),controller['describe']);router['get'](_0xc573('0xd'),auth[_0xc573('0xa')](),controller['show']);router[_0xc573('0x9')](_0xc573('0xe'),auth[_0xc573('0xa')](),controller[_0xc573('0xf')]);router[_0xc573('0x10')]('/',auth[_0xc573('0xa')](),controller['create']);router[_0xc573('0x11')](_0xc573('0xd'),auth[_0xc573('0xa')](),controller[_0xc573('0x12')]);router[_0xc573('0x13')](_0xc573('0xd'),auth[_0xc573('0xa')](),controller['destroy']);module[_0xc573('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index e2ccdf9..9e4dde4 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 _0x425d=['exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','path','../../config/environment'];(function(_0x5ca22d,_0x67e266){var _0x4dd3d8=function(_0x22590a){while(--_0x22590a){_0x5ca22d['push'](_0x5ca22d['shift']());}};_0x4dd3d8(++_0x67e266);}(_0x425d,0x1e0));var _0xd425=function(_0x513254,_0x1305ca){_0x513254=_0x513254-0x0;var _0x384c92=_0x425d[_0x513254];return _0x384c92;};'use strict';var Sequelize=require(_0xd425('0x0'));var moment=require('moment');var path=require(_0xd425('0x1'));var config=require(_0xd425('0x2'));module[_0xd425('0x3')]={'format':{'type':Sequelize[_0xd425('0x4')],'get':function(){return this[_0xd425('0x5')](_0xd425('0x6'))?path[_0xd425('0x7')](this['getDataValue'](_0xd425('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xd425('0x8')]},'channel':{'type':Sequelize[_0xd425('0x8')]},'value':{'type':Sequelize[_0xd425('0x8')],'set':function(_0x1d97d9){var _0x1d2ed0=_0x1d97d9['replace'](/\\/g,'/');this[_0xd425('0x9')](_0xd425('0x6'),_0x1d2ed0);}},'rating':{'type':Sequelize[_0xd425('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xd425('0xa')],'set':function(_0x2db9da){this[_0xd425('0x9')](_0xd425('0xb'),moment()[_0xd425('0xc')](_0x2db9da,'ms'));this[_0xd425('0x9')](_0xd425('0xd'),moment());this[_0xd425('0x9')](_0xd425('0xe'),_0x2db9da);}},'startedAt':{'type':Sequelize[_0xd425('0xf')],'get':function(){return moment(this[_0xd425('0x5')](_0xd425('0xb')))[_0xd425('0x10')](_0xd425('0x11'))[_0xd425('0x12')]();}},'closedAt':{'type':Sequelize[_0xd425('0xf')],'get':function(){return moment(this[_0xd425('0x5')]('closedAt'))[_0xd425('0x10')](_0xd425('0x11'))[_0xd425('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd425('0x5')](_0xd425('0x13')))[_0xd425('0x10')](_0xd425('0x11'))[_0xd425('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xd425('0x5')](_0xd425('0x14')))[_0xd425('0x10')](_0xd425('0x11'))['toString']();}}}; \ No newline at end of file +var _0xa630=['sequelize','moment','exports','getDataValue','extname','value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt'];(function(_0x5c3452,_0x2f737c){var _0x3bae84=function(_0x4f1eff){while(--_0x4f1eff){_0x5c3452['push'](_0x5c3452['shift']());}};_0x3bae84(++_0x2f737c);}(_0xa630,0xbe));var _0x0a63=function(_0x41b4db,_0x121cd0){_0x41b4db=_0x41b4db-0x0;var _0x4aa7a1=_0xa630[_0x41b4db];return _0x4aa7a1;};'use strict';var Sequelize=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var path=require('path');var config=require('../../config/environment');module[_0x0a63('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a63('0x3')]('value')?path[_0x0a63('0x4')](this[_0x0a63('0x3')](_0x0a63('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x0a63('0x6')]},'channel':{'type':Sequelize[_0x0a63('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x2760b0){var _0x3d5f0b=_0x2760b0[_0x0a63('0x7')](/\\/g,'/');this[_0x0a63('0x8')](_0x0a63('0x5'),_0x3d5f0b);}},'rating':{'type':Sequelize[_0x0a63('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x688acd){this[_0x0a63('0x8')](_0x0a63('0xa'),moment()[_0x0a63('0xb')](_0x688acd,'ms'));this[_0x0a63('0x8')](_0x0a63('0xc'),moment());this[_0x0a63('0x8')](_0x0a63('0xd'),_0x688acd);}},'startedAt':{'type':Sequelize[_0x0a63('0xe')],'get':function(){return moment(this[_0x0a63('0x3')]('startedAt'))[_0x0a63('0xf')](_0x0a63('0x10'))[_0x0a63('0x11')]();}},'closedAt':{'type':Sequelize[_0x0a63('0xe')],'get':function(){return moment(this['getDataValue'](_0x0a63('0xc')))['format'](_0x0a63('0x10'))[_0x0a63('0x11')]();}},'createdAt':{'type':Sequelize[_0x0a63('0xe')],'get':function(){return moment(this[_0x0a63('0x3')](_0x0a63('0x12')))[_0x0a63('0xf')](_0x0a63('0x10'))[_0x0a63('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a63('0x3')]('updatedAt'))[_0x0a63('0xf')](_0x0a63('0x10'))[_0x0a63('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9a4ab4c..780b835 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 _0xb338=['secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','ScreenRecording','then','includeAll','include','findAll','rows','catch','show','find','body','update','duration','createdAt','value','describe','download','uniqueid','params','join','root','server/files/screen_recordings','format','decryptFile'];(function(_0x5a6150,_0x5df91f){var _0x4cd8f2=function(_0x26f6aa){while(--_0x26f6aa){_0x5a6150['push'](_0x5a6150['shift']());}};_0x4cd8f2(++_0x5df91f);}(_0xb338,0x130));var _0x8b33=function(_0x28e655,_0xb50ac){_0x28e655=_0x28e655-0x0;var _0x267f07=_0xb338[_0x28e655];return _0x267f07;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b33('0x0'));var rimraf=require(_0x8b33('0x1'));var zipdir=require(_0x8b33('0x2'));var jsonpatch=require(_0x8b33('0x3'));var rp=require('request-promise');var moment=require(_0x8b33('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8b33('0x5'));var path=require(_0x8b33('0x6'));var sox=require(_0x8b33('0x7'));var csv=require(_0x8b33('0x8'));var ejs=require(_0x8b33('0x9'));var fs=require('fs');var _=require(_0x8b33('0xa'));var squel=require(_0x8b33('0xb'));var crypto=require(_0x8b33('0xc'));var jsforce=require(_0x8b33('0xd'));var deskjs=require(_0x8b33('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b33('0xf'));var qs=require(_0x8b33('0x10'));var as=require(_0x8b33('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b33('0x12'))(_0x8b33('0x13'));var utils=require('../../config/utils');var config=require(_0x8b33('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155724,_0x1e1538){_0x1e1538=_0x1e1538||0xcc;return function(_0x459397){if(_0x459397){return _0x155724[_0x8b33('0x15')](_0x1e1538);}return _0x155724[_0x8b33('0x16')](_0x1e1538)[_0x8b33('0x17')]();};}function respondWithResult(_0x56d6bb,_0x21e0a5){_0x21e0a5=_0x21e0a5||0xc8;return function(_0x5dfe5e){if(_0x5dfe5e){return _0x56d6bb[_0x8b33('0x16')](_0x21e0a5)['json'](_0x5dfe5e);}};}function respondWithFilteredResult(_0x70815f,_0x569d91){return function(_0x18557f){if(_0x18557f){var _0x2f6e2d=_0x18557f[_0x8b33('0x18')],_0x1ac263=_0x569d91[_0x8b33('0x19')],_0x706124=_0x569d91['offset']+_0x569d91[_0x8b33('0x1a')],_0x4be20c;if(_0x706124>=_0x2f6e2d){_0x706124=_0x2f6e2d;_0x4be20c=0xc8;}else{_0x4be20c=0xce;}_0x70815f[_0x8b33('0x16')](_0x4be20c);return _0x70815f[_0x8b33('0x1b')](_0x8b33('0x1c'),_0x1ac263+'-'+_0x706124+'/'+_0x2f6e2d)['json'](_0x18557f);}return null;};}function patchUpdates(_0x5ad69d){return function(_0x239a65){try{jsonpatch[_0x8b33('0x1d')](_0x239a65,_0x5ad69d,!![]);}catch(_0x239c6b){return BPromise['reject'](_0x239c6b);}return _0x239a65[_0x8b33('0x1e')]();};}function saveUpdates(_0xe7e4ba,_0x513989){return function(_0x598801){if(_0x598801){return _0x598801['update'](_0xe7e4ba)['then'](function(_0x36129d){return _0x36129d;});}return null;};}function removeEntity(_0x537f79,_0x256a0c){return function(_0x1fd150){if(_0x1fd150){return _0x1fd150[_0x8b33('0x1f')]()['then'](function(){_0x537f79[_0x8b33('0x16')](0xcc)[_0x8b33('0x17')]();});}};}function handleEntityNotFound(_0x41b5e1,_0x31ac86){return function(_0x18b892){if(!_0x18b892){_0x41b5e1['sendStatus'](0x194);}return _0x18b892;};}function handleError(_0x461e09,_0x3ab759){_0x3ab759=_0x3ab759||0x1f4;return function(_0x1a1f4b){logger[_0x8b33('0x20')](_0x1a1f4b[_0x8b33('0x21')]);if(_0x1a1f4b[_0x8b33('0x22')]){delete _0x1a1f4b[_0x8b33('0x22')];}_0x461e09['status'](_0x3ab759)[_0x8b33('0x23')](_0x1a1f4b);};}exports[_0x8b33('0x24')]=function(_0x5a8d7a,_0x572de7){var _0x1c996f={},_0x47c84e={},_0x54027e={'count':0x0,'rows':[]};var _0x1273dc=_[_0x8b33('0x25')](db['ScreenRecording'][_0x8b33('0x26')],function(_0x31539b){return{'name':_0x31539b['fieldName'],'type':_0x31539b['type'][_0x8b33('0x27')]};});_0x47c84e[_0x8b33('0x28')]=_['differenceBy'](_[_0x8b33('0x25')](_0x1273dc,_0x8b33('0x22')),['format']);_0x47c84e[_0x8b33('0x29')]=_[_0x8b33('0x2a')](_0x5a8d7a[_0x8b33('0x29')]);_0x47c84e[_0x8b33('0x2b')]=_[_0x8b33('0x2c')](_0x47c84e['model'],_0x47c84e[_0x8b33('0x29')]);_0x1c996f['attributes']=_[_0x8b33('0x2c')](_0x47c84e[_0x8b33('0x28')],qs[_0x8b33('0x2d')](_0x5a8d7a['query'][_0x8b33('0x2d')]));_0x1c996f[_0x8b33('0x2e')]=_0x1c996f[_0x8b33('0x2e')][_0x8b33('0x2f')]?_0x1c996f['attributes']:_0x47c84e['model'];if(!_0x5a8d7a[_0x8b33('0x29')]['hasOwnProperty'](_0x8b33('0x30'))){_0x1c996f[_0x8b33('0x1a')]=qs[_0x8b33('0x1a')](_0x5a8d7a['query']['limit']);_0x1c996f[_0x8b33('0x19')]=qs[_0x8b33('0x19')](_0x5a8d7a[_0x8b33('0x29')][_0x8b33('0x19')]);}_0x1c996f[_0x8b33('0x31')]=qs['sort'](_0x5a8d7a[_0x8b33('0x29')][_0x8b33('0x32')]);_0x1c996f[_0x8b33('0x33')]=qs[_0x8b33('0x2b')](_['pick'](_0x5a8d7a[_0x8b33('0x29')],_0x47c84e['filters']),_0x1273dc);if(_0x5a8d7a[_0x8b33('0x29')][_0x8b33('0x34')]){_0x1c996f['where']=_[_0x8b33('0x35')](_0x1c996f[_0x8b33('0x33')],{'$or':_[_0x8b33('0x25')](_0x1273dc,function(_0x5c3a6a){if(_0x5c3a6a[_0x8b33('0x36')]!==_0x8b33('0x37')){var _0x1674c0={};_0x1674c0[_0x5c3a6a[_0x8b33('0x22')]]={'$like':'%'+_0x5a8d7a[_0x8b33('0x29')]['filter']+'%'};return _0x1674c0;}})});}_0x1c996f=_['merge']({},_0x1c996f,_0x5a8d7a[_0x8b33('0x38')]);var _0x216b5d={'where':_0x1c996f[_0x8b33('0x33')]};return db[_0x8b33('0x39')][_0x8b33('0x18')](_0x216b5d)[_0x8b33('0x3a')](function(_0x4b050f){_0x54027e[_0x8b33('0x18')]=_0x4b050f;if(_0x5a8d7a[_0x8b33('0x29')][_0x8b33('0x3b')]){_0x1c996f[_0x8b33('0x3c')]=[{'all':!![]}];}return db[_0x8b33('0x39')][_0x8b33('0x3d')](_0x1c996f);})[_0x8b33('0x3a')](function(_0x32c663){_0x54027e[_0x8b33('0x3e')]=_0x32c663;return _0x54027e;})[_0x8b33('0x3a')](respondWithFilteredResult(_0x572de7,_0x1c996f))[_0x8b33('0x3f')](handleError(_0x572de7,null));};exports[_0x8b33('0x40')]=function(_0x26809b,_0x2db812){var _0x403fa6={'raw':![],'where':{'id':_0x26809b['params']['id']}},_0x5e1693={};_0x5e1693[_0x8b33('0x28')]=_[_0x8b33('0x2a')](db[_0x8b33('0x39')]['rawAttributes']);_0x5e1693[_0x8b33('0x29')]=_[_0x8b33('0x2a')](_0x26809b[_0x8b33('0x29')]);_0x5e1693[_0x8b33('0x2b')]=_['intersection'](_0x5e1693[_0x8b33('0x28')],_0x5e1693[_0x8b33('0x29')]);_0x403fa6[_0x8b33('0x2e')]=_['intersection'](_0x5e1693[_0x8b33('0x28')],qs['fields'](_0x26809b[_0x8b33('0x29')][_0x8b33('0x2d')]));_0x403fa6[_0x8b33('0x2e')]=_0x403fa6[_0x8b33('0x2e')][_0x8b33('0x2f')]?_0x403fa6[_0x8b33('0x2e')]:_0x5e1693[_0x8b33('0x28')];if(_0x26809b[_0x8b33('0x29')]['includeAll']){_0x403fa6[_0x8b33('0x3c')]=[{'all':!![]}];}_0x403fa6=_[_0x8b33('0x35')]({},_0x403fa6,_0x26809b[_0x8b33('0x38')]);return db[_0x8b33('0x39')][_0x8b33('0x41')](_0x403fa6)[_0x8b33('0x3a')](handleEntityNotFound(_0x2db812,null))['then'](respondWithResult(_0x2db812,null))[_0x8b33('0x3f')](handleError(_0x2db812,null));};exports['create']=function(_0x2e098a,_0x18e337){return db[_0x8b33('0x39')]['create'](_0x2e098a[_0x8b33('0x42')],{})[_0x8b33('0x3a')](respondWithResult(_0x18e337,0xc9))[_0x8b33('0x3f')](handleError(_0x18e337,null));};exports[_0x8b33('0x43')]=function(_0x6f2bfa,_0x3a1501){if(_0x6f2bfa[_0x8b33('0x42')]['id']){delete _0x6f2bfa[_0x8b33('0x42')]['id'];}delete _0x6f2bfa['body'][_0x8b33('0x44')];delete _0x6f2bfa['body'][_0x8b33('0x45')];delete _0x6f2bfa[_0x8b33('0x42')]['closedAt'];delete _0x6f2bfa[_0x8b33('0x42')][_0x8b33('0x46')];return db[_0x8b33('0x39')][_0x8b33('0x41')]({'where':{'id':_0x6f2bfa['params']['id']}})['then'](handleEntityNotFound(_0x3a1501,null))[_0x8b33('0x3a')](saveUpdates(_0x6f2bfa['body'],null))[_0x8b33('0x3a')](respondWithResult(_0x3a1501,null))[_0x8b33('0x3f')](handleError(_0x3a1501,null));};exports[_0x8b33('0x47')]=function(_0x5c345d,_0x12c9ae){return db['ScreenRecording'][_0x8b33('0x47')]()[_0x8b33('0x3a')](respondWithResult(_0x12c9ae,null))[_0x8b33('0x3f')](handleError(_0x12c9ae,null));};exports[_0x8b33('0x48')]=function(_0x2cb569,_0x580ab6,_0x104a1e){var _0x1ed47c=require('../../components/encryptor');var _0x4c0ef2=![];var _0x5a1763={};if(_0x2cb569[_0x8b33('0x29')]['type']&&_0x2cb569[_0x8b33('0x29')][_0x8b33('0x36')]==='uniqueid'){_0x5a1763[_0x8b33('0x49')]=_0x2cb569[_0x8b33('0x4a')]['id'];}else{_0x5a1763['id']=_0x2cb569[_0x8b33('0x4a')]['id'];}return db['ScreenRecording']['find']({'where':_0x5a1763,'attributes':['id',_0x8b33('0x46')],'raw':!![]})[_0x8b33('0x3a')](handleEntityNotFound(_0x580ab6,null))[_0x8b33('0x3a')](function(_0x11b894){if(_0x11b894){var _0x1443ae=path[_0x8b33('0x4b')](config[_0x8b33('0x4c')],_0x8b33('0x4d'),_0x11b894[_0x8b33('0x46')]);var _0x39e909=util[_0x8b33('0x4e')]('%s.cypher',_0x1443ae);if(fs['existsSync'](_0x39e909)){_0x4c0ef2=!![];return _0x1ed47c[_0x8b33('0x4f')](_0x39e909,_0x1443ae,config[_0x8b33('0x50')][_0x8b33('0x51')])[_0x8b33('0x3a')](function(){return _0x11b894;});}return _0x11b894;}})['then'](function(_0x14063e){if(_0x14063e){var _0x5b5b53=path['join'](config[_0x8b33('0x4c')],'server/files/screen_recordings',_0x14063e[_0x8b33('0x46')]);if(!fs[_0x8b33('0x52')](_0x5b5b53)){throw new db[(_0x8b33('0x53'))][(_0x8b33('0x54'))]('ScreenRecording\x20not\x20found');}if(_0x14063e[_0x8b33('0x55')]){return _0x580ab6[_0x8b33('0x48')](_0x5b5b53,_0x14063e[_0x8b33('0x55')]+path[_0x8b33('0x56')](_0x5b5b53),function(){if(_0x4c0ef2){fs[_0x8b33('0x57')](_0x5b5b53);}});}else{return _0x580ab6['download'](_0x5b5b53,function(_0x1146d7){if(_0x4c0ef2){fs['unlink'](_0x5b5b53);}});}}})[_0x8b33('0x3f')](function(_0x1e0206){if(_0x1e0206[_0x8b33('0x58')]==='ScreenRecording\x20not\x20found'){_0x580ab6[_0x8b33('0x16')](0x194)['send'](_0x8b33('0x59'));}else{return handleError(_0x580ab6,null);}});};exports['destroy']=function(_0x566279,_0x713b7e){return db['ScreenRecording'][_0x8b33('0x41')]({'where':{'id':_0x566279['params']['id']}})['then'](function(_0x2fed0f){if(!_0x2fed0f)throw new ReferenceError('Entity\x20not\x20found');return _0x2fed0f;})['then'](function(_0x344e6c){var _0x6b519=path[_0x8b33('0x4b')](config[_0x8b33('0x4c')],_0x8b33('0x4d'),_0x344e6c[_0x8b33('0x46')]);logger[_0x8b33('0x5a')](_0x8b33('0x5b'),_0x6b519);if(!_[_0x8b33('0x5c')](_0x344e6c[_0x8b33('0x46')])&&fs[_0x8b33('0x52')](_0x6b519)){logger[_0x8b33('0x5a')]('File:\x20\x22'+_0x6b519+_0x8b33('0x5d'));fs[_0x8b33('0x5e')](_0x6b519);}_0x6b519=_0x6b519+'.cypher';if(!_['isNil'](_0x344e6c[_0x8b33('0x46')])&&fs[_0x8b33('0x52')](_0x6b519)){logger[_0x8b33('0x5a')](_0x8b33('0x5f')+_0x6b519+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8b33('0x5e')](_0x6b519);}return _0x344e6c;})[_0x8b33('0x3a')](function(_0x42d144){if(!_0x42d144)throw new InternalError();return _0x42d144[_0x8b33('0x1f')]();})['then'](function(){_0x713b7e[_0x8b33('0x16')](0xcc)[_0x8b33('0x17')]();})[_0x8b33('0x3f')](handleError(_0x713b7e,null));}; \ No newline at end of file +var _0x3b6e=['rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','count','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','duration','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','File:\x20\x22','unlinkSync','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','to-csv','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','Content-Range','json','apply','save','update','destroy','then','end','stack','name','send','index','map','ScreenRecording'];(function(_0xcf4260,_0xe48af6){var _0x5ad781=function(_0x4ab8c9){while(--_0x4ab8c9){_0xcf4260['push'](_0xcf4260['shift']());}};_0x5ad781(++_0xe48af6);}(_0x3b6e,0xfe));var _0xe3b6=function(_0x2cb02d,_0x3e40e0){_0x2cb02d=_0x2cb02d-0x0;var _0x4501df=_0x3b6e[_0x2cb02d];return _0x4501df;};'use strict';var pdf=require(_0xe3b6('0x0'));var emlformat=require(_0xe3b6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe3b6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe3b6('0x3'));var BPromise=require(_0xe3b6('0x4'));var Mustache=require('mustache');var util=require(_0xe3b6('0x5'));var path=require(_0xe3b6('0x6'));var sox=require('sox');var csv=require(_0xe3b6('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe3b6('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe3b6('0x7'));var querystring=require(_0xe3b6('0x9'));var Papa=require(_0xe3b6('0xa'));var Redis=require(_0xe3b6('0xb'));var authService=require(_0xe3b6('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xe3b6('0xd'));var hardwareService=require(_0xe3b6('0xe'));var logger=require(_0xe3b6('0xf'))('api');var utils=require(_0xe3b6('0x10'));var config=require(_0xe3b6('0x11'));var db=require(_0xe3b6('0x12'))['db'];function respondWithStatusCode(_0x1391d0,_0x581ee7){_0x581ee7=_0x581ee7||0xcc;return function(_0x51eaad){if(_0x51eaad){return _0x1391d0[_0xe3b6('0x13')](_0x581ee7);}return _0x1391d0['status'](_0x581ee7)['end']();};}function respondWithResult(_0x1c63ec,_0x503c6c){_0x503c6c=_0x503c6c||0xc8;return function(_0x3b23af){if(_0x3b23af){return _0x1c63ec[_0xe3b6('0x14')](_0x503c6c)['json'](_0x3b23af);}};}function respondWithFilteredResult(_0x544bf4,_0x3f726e){return function(_0x163cd8){if(_0x163cd8){var _0x496c27=_0x163cd8['count'],_0x261657=_0x3f726e[_0xe3b6('0x15')],_0x476ab9=_0x3f726e[_0xe3b6('0x15')]+_0x3f726e[_0xe3b6('0x16')],_0x50bec1;if(_0x476ab9>=_0x496c27){_0x476ab9=_0x496c27;_0x50bec1=0xc8;}else{_0x50bec1=0xce;}_0x544bf4[_0xe3b6('0x14')](_0x50bec1);return _0x544bf4['set'](_0xe3b6('0x17'),_0x261657+'-'+_0x476ab9+'/'+_0x496c27)[_0xe3b6('0x18')](_0x163cd8);}return null;};}function patchUpdates(_0x461f5f){return function(_0x59200d){try{jsonpatch[_0xe3b6('0x19')](_0x59200d,_0x461f5f,!![]);}catch(_0x5ddae5){return BPromise['reject'](_0x5ddae5);}return _0x59200d[_0xe3b6('0x1a')]();};}function saveUpdates(_0x566e38,_0x4240ef){return function(_0x17c7bc){if(_0x17c7bc){return _0x17c7bc[_0xe3b6('0x1b')](_0x566e38)['then'](function(_0x4de236){return _0x4de236;});}return null;};}function removeEntity(_0x326837,_0xc03490){return function(_0x44a3b8){if(_0x44a3b8){return _0x44a3b8[_0xe3b6('0x1c')]()[_0xe3b6('0x1d')](function(){_0x326837[_0xe3b6('0x14')](0xcc)[_0xe3b6('0x1e')]();});}};}function handleEntityNotFound(_0x1fcb04,_0x21da2e){return function(_0x145383){if(!_0x145383){_0x1fcb04[_0xe3b6('0x13')](0x194);}return _0x145383;};}function handleError(_0x373dbf,_0x264f02){_0x264f02=_0x264f02||0x1f4;return function(_0x290f5c){logger['error'](_0x290f5c[_0xe3b6('0x1f')]);if(_0x290f5c['name']){delete _0x290f5c[_0xe3b6('0x20')];}_0x373dbf[_0xe3b6('0x14')](_0x264f02)[_0xe3b6('0x21')](_0x290f5c);};}exports[_0xe3b6('0x22')]=function(_0x5ab61f,_0x237dc7){var _0x5b6720={},_0x2853d5={},_0x3e22c1={'count':0x0,'rows':[]};var _0x296f6f=_[_0xe3b6('0x23')](db[_0xe3b6('0x24')][_0xe3b6('0x25')],function(_0x5960c4){return{'name':_0x5960c4[_0xe3b6('0x26')],'type':_0x5960c4[_0xe3b6('0x27')][_0xe3b6('0x28')]};});_0x2853d5[_0xe3b6('0x29')]=_[_0xe3b6('0x2a')](_[_0xe3b6('0x23')](_0x296f6f,_0xe3b6('0x20')),[_0xe3b6('0x2b')]);_0x2853d5[_0xe3b6('0x2c')]=_[_0xe3b6('0x2d')](_0x5ab61f[_0xe3b6('0x2c')]);_0x2853d5['filters']=_['intersection'](_0x2853d5[_0xe3b6('0x29')],_0x2853d5[_0xe3b6('0x2c')]);_0x5b6720['attributes']=_[_0xe3b6('0x2e')](_0x2853d5[_0xe3b6('0x29')],qs['fields'](_0x5ab61f[_0xe3b6('0x2c')][_0xe3b6('0x2f')]));_0x5b6720[_0xe3b6('0x30')]=_0x5b6720[_0xe3b6('0x30')][_0xe3b6('0x31')]?_0x5b6720['attributes']:_0x2853d5['model'];if(!_0x5ab61f[_0xe3b6('0x2c')]['hasOwnProperty'](_0xe3b6('0x32'))){_0x5b6720[_0xe3b6('0x16')]=qs['limit'](_0x5ab61f[_0xe3b6('0x2c')]['limit']);_0x5b6720[_0xe3b6('0x15')]=qs[_0xe3b6('0x15')](_0x5ab61f[_0xe3b6('0x2c')][_0xe3b6('0x15')]);}_0x5b6720[_0xe3b6('0x33')]=qs[_0xe3b6('0x34')](_0x5ab61f[_0xe3b6('0x2c')][_0xe3b6('0x34')]);_0x5b6720[_0xe3b6('0x35')]=qs[_0xe3b6('0x36')](_[_0xe3b6('0x37')](_0x5ab61f[_0xe3b6('0x2c')],_0x2853d5[_0xe3b6('0x36')]),_0x296f6f);if(_0x5ab61f[_0xe3b6('0x2c')][_0xe3b6('0x38')]){_0x5b6720['where']=_[_0xe3b6('0x39')](_0x5b6720['where'],{'$or':_[_0xe3b6('0x23')](_0x296f6f,function(_0x51666c){if(_0x51666c[_0xe3b6('0x27')]!=='VIRTUAL'){var _0x1e6bc4={};_0x1e6bc4[_0x51666c['name']]={'$like':'%'+_0x5ab61f[_0xe3b6('0x2c')]['filter']+'%'};return _0x1e6bc4;}})});}_0x5b6720=_[_0xe3b6('0x39')]({},_0x5b6720,_0x5ab61f['options']);var _0x3e440c={'where':_0x5b6720[_0xe3b6('0x35')]};return db[_0xe3b6('0x24')][_0xe3b6('0x3a')](_0x3e440c)['then'](function(_0x5c78ea){_0x3e22c1[_0xe3b6('0x3a')]=_0x5c78ea;if(_0x5ab61f[_0xe3b6('0x2c')]['includeAll']){_0x5b6720[_0xe3b6('0x3b')]=[{'all':!![]}];}return db[_0xe3b6('0x24')][_0xe3b6('0x3c')](_0x5b6720);})[_0xe3b6('0x1d')](function(_0x323968){_0x3e22c1[_0xe3b6('0x3d')]=_0x323968;return _0x3e22c1;})['then'](respondWithFilteredResult(_0x237dc7,_0x5b6720))[_0xe3b6('0x3e')](handleError(_0x237dc7,null));};exports[_0xe3b6('0x3f')]=function(_0x30f8ab,_0x8b70c7){var _0x52b73c={'raw':![],'where':{'id':_0x30f8ab[_0xe3b6('0x40')]['id']}},_0x4512a0={};_0x4512a0['model']=_['keys'](db[_0xe3b6('0x24')]['rawAttributes']);_0x4512a0['query']=_['keys'](_0x30f8ab['query']);_0x4512a0[_0xe3b6('0x36')]=_[_0xe3b6('0x2e')](_0x4512a0[_0xe3b6('0x29')],_0x4512a0['query']);_0x52b73c[_0xe3b6('0x30')]=_[_0xe3b6('0x2e')](_0x4512a0[_0xe3b6('0x29')],qs[_0xe3b6('0x2f')](_0x30f8ab[_0xe3b6('0x2c')][_0xe3b6('0x2f')]));_0x52b73c[_0xe3b6('0x30')]=_0x52b73c['attributes'][_0xe3b6('0x31')]?_0x52b73c[_0xe3b6('0x30')]:_0x4512a0['model'];if(_0x30f8ab['query'][_0xe3b6('0x41')]){_0x52b73c[_0xe3b6('0x3b')]=[{'all':!![]}];}_0x52b73c=_[_0xe3b6('0x39')]({},_0x52b73c,_0x30f8ab[_0xe3b6('0x42')]);return db[_0xe3b6('0x24')][_0xe3b6('0x43')](_0x52b73c)['then'](handleEntityNotFound(_0x8b70c7,null))['then'](respondWithResult(_0x8b70c7,null))[_0xe3b6('0x3e')](handleError(_0x8b70c7,null));};exports[_0xe3b6('0x44')]=function(_0x4a8050,_0x5cf81c){return db[_0xe3b6('0x24')][_0xe3b6('0x44')](_0x4a8050['body'],{})[_0xe3b6('0x1d')](respondWithResult(_0x5cf81c,0xc9))[_0xe3b6('0x3e')](handleError(_0x5cf81c,null));};exports['update']=function(_0x434932,_0x10b782){if(_0x434932[_0xe3b6('0x45')]['id']){delete _0x434932['body']['id'];}delete _0x434932[_0xe3b6('0x45')][_0xe3b6('0x46')];delete _0x434932[_0xe3b6('0x45')]['createdAt'];delete _0x434932[_0xe3b6('0x45')]['closedAt'];delete _0x434932[_0xe3b6('0x45')]['value'];return db[_0xe3b6('0x24')][_0xe3b6('0x43')]({'where':{'id':_0x434932[_0xe3b6('0x40')]['id']}})['then'](handleEntityNotFound(_0x10b782,null))[_0xe3b6('0x1d')](saveUpdates(_0x434932['body'],null))[_0xe3b6('0x1d')](respondWithResult(_0x10b782,null))[_0xe3b6('0x3e')](handleError(_0x10b782,null));};exports[_0xe3b6('0x47')]=function(_0x273e19,_0x45402c){return db[_0xe3b6('0x24')][_0xe3b6('0x47')]()[_0xe3b6('0x1d')](respondWithResult(_0x45402c,null))[_0xe3b6('0x3e')](handleError(_0x45402c,null));};exports[_0xe3b6('0x48')]=function(_0x474ccf,_0x4bc7ec,_0x11bc24){var _0x3df018=require('../../components/encryptor');var _0x2c4eed=![];var _0x581a13={};if(_0x474ccf[_0xe3b6('0x2c')][_0xe3b6('0x27')]&&_0x474ccf['query'][_0xe3b6('0x27')]===_0xe3b6('0x49')){_0x581a13[_0xe3b6('0x49')]=_0x474ccf['params']['id'];}else{_0x581a13['id']=_0x474ccf[_0xe3b6('0x40')]['id'];}return db[_0xe3b6('0x24')][_0xe3b6('0x43')]({'where':_0x581a13,'attributes':['id',_0xe3b6('0x4a')],'raw':!![]})[_0xe3b6('0x1d')](handleEntityNotFound(_0x4bc7ec,null))[_0xe3b6('0x1d')](function(_0x4041fb){if(_0x4041fb){var _0x2cdef7=path[_0xe3b6('0x4b')](config[_0xe3b6('0x4c')],_0xe3b6('0x4d'),_0x4041fb[_0xe3b6('0x4a')]);var _0x53b2fc=util[_0xe3b6('0x2b')](_0xe3b6('0x4e'),_0x2cdef7);if(fs[_0xe3b6('0x4f')](_0x53b2fc)){_0x2c4eed=!![];return _0x3df018[_0xe3b6('0x50')](_0x53b2fc,_0x2cdef7,config[_0xe3b6('0x51')][_0xe3b6('0x52')])[_0xe3b6('0x1d')](function(){return _0x4041fb;});}return _0x4041fb;}})['then'](function(_0x18a63e){if(_0x18a63e){var _0x34f70b=path['join'](config[_0xe3b6('0x4c')],_0xe3b6('0x4d'),_0x18a63e[_0xe3b6('0x4a')]);if(!fs['existsSync'](_0x34f70b)){throw new db['Sequelize'][(_0xe3b6('0x53'))]('ScreenRecording\x20not\x20found');}if(_0x18a63e[_0xe3b6('0x54')]){return _0x4bc7ec['download'](_0x34f70b,_0x18a63e['filename']+path[_0xe3b6('0x55')](_0x34f70b),function(){if(_0x2c4eed){fs[_0xe3b6('0x56')](_0x34f70b);}});}else{return _0x4bc7ec[_0xe3b6('0x48')](_0x34f70b,function(_0x569f40){if(_0x2c4eed){fs['unlink'](_0x34f70b);}});}}})[_0xe3b6('0x3e')](function(_0x26aacf){if(_0x26aacf[_0xe3b6('0x57')]===_0xe3b6('0x58')){_0x4bc7ec[_0xe3b6('0x14')](0x194)[_0xe3b6('0x21')](_0xe3b6('0x59'));}else{return handleError(_0x4bc7ec,null);}});};exports[_0xe3b6('0x1c')]=function(_0xa72bb1,_0x53ca2b){return db[_0xe3b6('0x24')][_0xe3b6('0x43')]({'where':{'id':_0xa72bb1['params']['id']}})[_0xe3b6('0x1d')](function(_0x222b6c){if(!_0x222b6c)throw new ReferenceError(_0xe3b6('0x5a'));return _0x222b6c;})[_0xe3b6('0x1d')](function(_0x226ec8){var _0xba1a29=path[_0xe3b6('0x4b')](config[_0xe3b6('0x4c')],_0xe3b6('0x4d'),_0x226ec8[_0xe3b6('0x4a')]);logger[_0xe3b6('0x5b')](_0xe3b6('0x5c'),_0xba1a29);if(!_[_0xe3b6('0x5d')](_0x226ec8[_0xe3b6('0x4a')])&&fs[_0xe3b6('0x4f')](_0xba1a29)){logger[_0xe3b6('0x5b')]('File:\x20\x22'+_0xba1a29+_0xe3b6('0x5e'));fs['unlinkSync'](_0xba1a29);}_0xba1a29=_0xba1a29+'.cypher';if(!_['isNil'](_0x226ec8['value'])&&fs[_0xe3b6('0x4f')](_0xba1a29)){logger['info'](_0xe3b6('0x5f')+_0xba1a29+_0xe3b6('0x5e'));fs[_0xe3b6('0x60')](_0xba1a29);}return _0x226ec8;})[_0xe3b6('0x1d')](function(_0x381185){if(!_0x381185)throw new InternalError();return _0x381185[_0xe3b6('0x1c')]();})['then'](function(){_0x53ca2b[_0xe3b6('0x14')](0xcc)[_0xe3b6('0x1e')]();})['catch'](handleError(_0x53ca2b,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e17606a..e02e5f0 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 _0xb337=['exports','screen_recordings','interactionid','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0xb337,0x175));var _0x7b33=function(_0x143e88,_0x55e4ae){_0x143e88=_0x143e88-0x0;var _0x7509af=_0xb337[_0x143e88];return _0x7509af;};'use strict';var _=require(_0x7b33('0x0'));var util=require(_0x7b33('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x7b33('0x2'));var BPromise=require(_0x7b33('0x3'));var rp=require(_0x7b33('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b33('0x5'));var config=require(_0x7b33('0x6'));var attributes=require('./screenRecording.attributes');module[_0x7b33('0x7')]=function(_0x470fb0,_0x5b1ff9){return _0x470fb0['define']('ScreenRecording',attributes,{'tableName':_0x7b33('0x8'),'paranoid':![],'indexes':[{'name':_0x7b33('0x9'),'fields':[_0x7b33('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xee30=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x18f45b,_0x64b4f8){var _0xe5bc88=function(_0x175807){while(--_0x175807){_0x18f45b['push'](_0x18f45b['shift']());}};_0xe5bc88(++_0x64b4f8);}(_0xee30,0x159));var _0x0ee3=function(_0x59a272,_0x54e02d){_0x59a272=_0x59a272-0x0;var _0x5ec9a1=_0xee30[_0x59a272];return _0x5ec9a1;};'use strict';var _=require(_0x0ee3('0x0'));var util=require(_0x0ee3('0x1'));var logger=require(_0x0ee3('0x2'))(_0x0ee3('0x3'));var moment=require(_0x0ee3('0x4'));var BPromise=require(_0x0ee3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ee3('0x6'));var rimraf=require(_0x0ee3('0x7'));var config=require(_0x0ee3('0x8'));var attributes=require(_0x0ee3('0x9'));module[_0x0ee3('0xa')]=function(_0xc9dc91,_0x289ea3){return _0xc9dc91[_0x0ee3('0xb')](_0x0ee3('0xc'),attributes,{'tableName':_0x0ee3('0xd'),'paranoid':![],'indexes':[{'name':_0x0ee3('0xe'),'fields':[_0x0ee3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 8132f77..98f889d 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(_0x4491d9,_0x23fdc2){var _0x350fd1=function(_0x518d27){while(--_0x518d27){_0x4491d9['push'](_0x4491d9['shift']());}};_0x350fd1(++_0x23fdc2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0x2dfe8e,_0x20784f){var _0x591e69=function(_0xd92696){while(--_0xd92696){_0x2dfe8e['push'](_0x2dfe8e['shift']());}};_0x591e69(++_0x20784f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 8eb97e9..ca6d473 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 _0xd499=['getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','single','file','addLogo','server/files/images/logos/','logologin','post','addLogoLogin','favicon','addFavicon','put','update','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','getLogo','/:id/logo_login'];(function(_0xfaf333,_0x28ced4){var _0x445deb=function(_0xf48ae0){while(--_0xf48ae0){_0xfaf333['push'](_0xfaf333['shift']());}};_0x445deb(++_0x28ced4);}(_0xd499,0xc3));var _0x9d49=function(_0x594e11,_0x28f652){_0x594e11=_0x594e11-0x0;var _0x5418ad=_0xd499[_0x594e11];return _0x5418ad;};'use strict';var multer=require(_0x9d49('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9d49('0x1'));var express=require('express');var router=express[_0x9d49('0x2')]();var auth=require(_0x9d49('0x3'));var interaction=require(_0x9d49('0x4'));var config=require(_0x9d49('0x5'));var controller=require(_0x9d49('0x6'));router[_0x9d49('0x7')]('/',auth[_0x9d49('0x8')](),controller[_0x9d49('0x9')]);router['get'](_0x9d49('0xa'),controller[_0x9d49('0xb')]);router[_0x9d49('0x7')](_0x9d49('0xc'),controller[_0x9d49('0xd')]);router[_0x9d49('0x7')](_0x9d49('0xe'),controller[_0x9d49('0xf')]);router[_0x9d49('0x7')](_0x9d49('0x10'),controller[_0x9d49('0x11')]);router['get'](_0x9d49('0x12'),controller[_0x9d49('0x13')]);router[_0x9d49('0x7')](_0x9d49('0x14'),controller[_0x9d49('0x15')]);var upload=multer({'storage':multer[_0x9d49('0x16')]({'destination':function(_0x2d64ca,_0x1a9982,_0x590fd3){_0x590fd3(null,path[_0x9d49('0x17')](config[_0x9d49('0x18')],'server/files/images/logos/'));},'filename':function(_0x322087,_0x4d637b,_0x27192e){_0x27192e(null,util[_0x9d49('0x19')](_0x9d49('0x1a'),_0x9d49('0x1b'),path[_0x9d49('0x1c')](_0x4d637b[_0x9d49('0x1d')])));}})});router['post'](_0x9d49('0xc'),upload[_0x9d49('0x1e')](_0x9d49('0x1f')),controller[_0x9d49('0x20')]);var upload=multer({'storage':multer[_0x9d49('0x16')]({'destination':function(_0x60f2fb,_0x160c22,_0x2ed4dd){_0x2ed4dd(null,path['join'](config[_0x9d49('0x18')],_0x9d49('0x21')));},'filename':function(_0x3c67b0,_0x358ea0,_0x5026c0){_0x5026c0(null,util[_0x9d49('0x19')](_0x9d49('0x1a'),_0x9d49('0x22'),path[_0x9d49('0x1c')](_0x358ea0['originalname'])));}})});router[_0x9d49('0x23')]('/:id/logo_login',upload[_0x9d49('0x1e')](_0x9d49('0x1f')),controller[_0x9d49('0x24')]);var upload=multer({'storage':multer[_0x9d49('0x16')]({'destination':function(_0x3b2879,_0x76b25c,_0x416ffc){_0x416ffc(null,path[_0x9d49('0x17')](config['root'],'server/files/images/logos/'));},'filename':function(_0x34161d,_0xa4c49c,_0x39c5a4){_0x39c5a4(null,util[_0x9d49('0x19')](_0x9d49('0x1a'),'preferred',path[_0x9d49('0x1c')](_0xa4c49c[_0x9d49('0x1d')])));}})});router[_0x9d49('0x23')](_0x9d49('0x12'),upload['single'](_0x9d49('0x1f')),controller['addPreferred']);var upload=multer({'storage':multer[_0x9d49('0x16')]({'destination':function(_0x1c1602,_0xd980b6,_0x491c1){_0x491c1(null,path[_0x9d49('0x17')](config[_0x9d49('0x18')],'server/files/images/logos/'));},'filename':function(_0x372ed2,_0x2bcacd,_0x3e9b19){_0x3e9b19(null,util[_0x9d49('0x19')](_0x9d49('0x1a'),_0x9d49('0x25'),path[_0x9d49('0x1c')](_0x2bcacd['originalname'])));}})});router[_0x9d49('0x23')](_0x9d49('0x14'),upload[_0x9d49('0x1e')](_0x9d49('0x1f')),controller[_0x9d49('0x26')]);router[_0x9d49('0x27')](_0x9d49('0xa'),auth['isAuthenticated'](),controller[_0x9d49('0x28')]);module[_0x9d49('0x29')]=router; \ No newline at end of file +var _0xbdf3=['single','file','addLogo','diskStorage','originalname','preferred','addFavicon','put','update','exports','multer','util','path','Router','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','logo','extname','post'];(function(_0x53daae,_0x51a400){var _0x12be55=function(_0x312d46){while(--_0x312d46){_0x53daae['push'](_0x53daae['shift']());}};_0x12be55(++_0x51a400);}(_0xbdf3,0x1de));var _0x3bdf=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0xbdf3[_0x2c1e7a];return _0xcacb4f;};'use strict';var multer=require(_0x3bdf('0x0'));var util=require(_0x3bdf('0x1'));var path=require(_0x3bdf('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3bdf('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3bdf('0x4'));var controller=require(_0x3bdf('0x5'));router[_0x3bdf('0x6')]('/',auth[_0x3bdf('0x7')](),controller[_0x3bdf('0x8')]);router[_0x3bdf('0x6')](_0x3bdf('0x9'),controller[_0x3bdf('0xa')]);router[_0x3bdf('0x6')](_0x3bdf('0xb'),controller['getLogo']);router['get'](_0x3bdf('0xc'),controller[_0x3bdf('0xd')]);router['get'](_0x3bdf('0xe'),controller['gdpr']);router[_0x3bdf('0x6')](_0x3bdf('0xf'),controller['getPreferred']);router[_0x3bdf('0x6')](_0x3bdf('0x10'),controller[_0x3bdf('0x11')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c9b9b,_0xe9e8f4,_0x3ddbf9){_0x3ddbf9(null,path[_0x3bdf('0x12')](config[_0x3bdf('0x13')],_0x3bdf('0x14')));},'filename':function(_0x5aadca,_0x1f234b,_0x175a15){_0x175a15(null,util[_0x3bdf('0x15')](_0x3bdf('0x16'),_0x3bdf('0x17'),path[_0x3bdf('0x18')](_0x1f234b['originalname'])));}})});router[_0x3bdf('0x19')](_0x3bdf('0xb'),upload[_0x3bdf('0x1a')](_0x3bdf('0x1b')),controller[_0x3bdf('0x1c')]);var upload=multer({'storage':multer[_0x3bdf('0x1d')]({'destination':function(_0x3f1f46,_0x5dcb1,_0xa9aa9b){_0xa9aa9b(null,path['join'](config[_0x3bdf('0x13')],_0x3bdf('0x14')));},'filename':function(_0xda8f0c,_0x5c2212,_0xcb8781){_0xcb8781(null,util['format'](_0x3bdf('0x16'),'logologin',path[_0x3bdf('0x18')](_0x5c2212[_0x3bdf('0x1e')])));}})});router[_0x3bdf('0x19')](_0x3bdf('0xc'),upload[_0x3bdf('0x1a')](_0x3bdf('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x3bdf('0x1d')]({'destination':function(_0x17b925,_0x502d7a,_0x5c51cc){_0x5c51cc(null,path[_0x3bdf('0x12')](config[_0x3bdf('0x13')],_0x3bdf('0x14')));},'filename':function(_0x51275d,_0x2742df,_0x182f7b){_0x182f7b(null,util['format']('%s%s',_0x3bdf('0x1f'),path[_0x3bdf('0x18')](_0x2742df[_0x3bdf('0x1e')])));}})});router['post'](_0x3bdf('0xf'),upload[_0x3bdf('0x1a')](_0x3bdf('0x1b')),controller['addPreferred']);var upload=multer({'storage':multer[_0x3bdf('0x1d')]({'destination':function(_0x109b98,_0x816bb,_0x5326dc){_0x5326dc(null,path[_0x3bdf('0x12')](config['root'],_0x3bdf('0x14')));},'filename':function(_0x41eae3,_0x491c5f,_0x5a56bb){_0x5a56bb(null,util['format']('%s%s','favicon',path[_0x3bdf('0x18')](_0x491c5f[_0x3bdf('0x1e')])));}})});router['post']('/:id/favicon',upload['single'](_0x3bdf('0x1b')),controller[_0x3bdf('0x20')]);router[_0x3bdf('0x21')]('/:id',auth[_0x3bdf('0x7')](),controller[_0x3bdf('0x22')]);module[_0x3bdf('0x23')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index dbc0263..78dd3a3 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 _0x5ad9=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5ad9,0x158));var _0x95ad=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5ad9[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x95ad('0x0'));module[_0x95ad('0x1')]={'min_internal':{'type':Sequelize[_0x95ad('0x2')](0xb),'unique':_0x95ad('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x95ad('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x95ad('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x95ad('0x5')]},'defaultLogo':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x95ad('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x95ad('0x5')]},'turnaddr':{'type':Sequelize[_0x95ad('0x5')]},'turnusername':{'type':Sequelize[_0x95ad('0x5')]},'turnpassword':{'type':Sequelize[_0x95ad('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x95ad('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x95ad('0x5')],'defaultValue':_0x95ad('0x7')},'enableEmailPreview':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x95ad('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x95ad('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x95ad('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x95ad('0x5')]},'defaultFavicon':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x95ad('0x5')]},'sentiment':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x95ad('0x2')]},'sentimentRegion':{'type':Sequelize[_0x95ad('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x95ad('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x95ad('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xeaa2=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml'];(function(_0x4218a8,_0x2cb39d){var _0x3f0b53=function(_0x203c04){while(--_0x203c04){_0x4218a8['push'](_0x4218a8['shift']());}};_0x3f0b53(++_0x2cb39d);}(_0xeaa2,0x171));var _0x2eaa=function(_0x4662e3,_0x3c9e27){_0x4662e3=_0x4662e3-0x0;var _0x3ab0e7=_0xeaa2[_0x4662e3];return _0x3ab0e7;};'use strict';var Sequelize=require(_0x2eaa('0x0'));module[_0x2eaa('0x1')]={'min_internal':{'type':Sequelize[_0x2eaa('0x2')](0xb),'unique':_0x2eaa('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2eaa('0x2')](0xb),'unique':_0x2eaa('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x2eaa('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2eaa('0x5')],'defaultValue':_0x2eaa('0x6')},'logo':{'type':Sequelize[_0x2eaa('0x5')]},'defaultLogo':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2eaa('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x2eaa('0x5')]},'turnaddr':{'type':Sequelize[_0x2eaa('0x5')]},'turnusername':{'type':Sequelize[_0x2eaa('0x5')]},'turnpassword':{'type':Sequelize[_0x2eaa('0x5')]},'pageTitle':{'type':Sequelize[_0x2eaa('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x2eaa('0x5')],'defaultValue':_0x2eaa('0x8')},'enableEmailPreview':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2eaa('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2eaa('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize[_0x2eaa('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x2eaa('0x5')]},'defaultFavicon':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x2eaa('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x2eaa('0x2')]},'transcribeRegion':{'type':Sequelize[_0x2eaa('0x5')]},'sentiment':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0x2eaa('0x5')]},'language':{'type':Sequelize[_0x2eaa('0x5')]},'bucket':{'type':Sequelize[_0x2eaa('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x2eaa('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 5dc2c63..7806264 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 _0x89b1=['filter','options','Setting','includeAll','findAll','rows','show','params','keys','find','body','addLogo','file','logo','addLogoLogin','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','\x20not\x20found','download','getLogoLogin','defaultFavicon','default_loginLogo.svg','securePassword','addPreferred','default_preferred.png','addFavicon','html-pdf','rimraf','request-promise','mustache','util','path','sox','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','rawAttributes','type','map','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x20e2e8,_0x17e10e){var _0x54f9a4=function(_0x53d1b5){while(--_0x53d1b5){_0x20e2e8['push'](_0x20e2e8['shift']());}};_0x54f9a4(++_0x17e10e);}(_0x89b1,0x18a));var _0x189b=function(_0x29b585,_0x512952){_0x29b585=_0x29b585-0x0;var _0x3d26c1=_0x89b1[_0x29b585];return _0x3d26c1;};'use strict';var pdf=require(_0x189b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x189b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x189b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x189b('0x3'));var util=require(_0x189b('0x4'));var path=require(_0x189b('0x5'));var sox=require(_0x189b('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x189b('0x7'));var jsforce=require(_0x189b('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x189b('0x9'));var Papa=require('papaparse');var Redis=require(_0x189b('0xa'));var authService=require(_0x189b('0xb'));var qs=require(_0x189b('0xc'));var as=require(_0x189b('0xd'));var hardwareService=require(_0x189b('0xe'));var logger=require(_0x189b('0xf'))(_0x189b('0x10'));var utils=require(_0x189b('0x11'));var config=require(_0x189b('0x12'));var db=require(_0x189b('0x13'))['db'];var jayson=require(_0x189b('0x14'));var client=jayson[_0x189b('0x15')][_0x189b('0x16')]({'port':0x232a});function checkPasswordPattern(_0x4ca076,_0x1fd74c,_0x58bc4a){if(_0x58bc4a){var _0x2dbc3a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2dbc3a[_0x189b('0x17')](_0x1fd74c)){return _0x4ca076;}else{throw new db[(_0x189b('0x18'))][(_0x189b('0x19'))](_0x189b('0x1a'));}}else{return _0x4ca076;}}function respondWithRpcPromise(_0x41d408,_0x4b9ddc,_0x4f9b0b,_0x48e459){return new BPromise(function(_0x564060,_0x21a89c){var _0x23df00=_0x48e459||client;return _0x23df00['request'](_0x41d408,_0x4f9b0b)[_0x189b('0x1b')](function(_0x373bee){logger[_0x189b('0x1c')](_0x189b('0x1d'),_0x4b9ddc,_0x189b('0x1e'));logger[_0x189b('0x1f')](_0x189b('0x20'),_0x4b9ddc,'request\x20sent',JSON[_0x189b('0x21')](_0x373bee));if(_0x373bee[_0x189b('0x22')]){if(_0x373bee[_0x189b('0x22')][_0x189b('0x23')]===0x1f4){logger[_0x189b('0x22')](_0x189b('0x1d'),_0x4b9ddc,_0x373bee[_0x189b('0x22')][_0x189b('0x24')]);return _0x21a89c(_0x373bee[_0x189b('0x22')][_0x189b('0x24')]);}logger['error']('Setting,\x20%s,\x20%s',_0x4b9ddc,_0x373bee[_0x189b('0x22')]['message']);return _0x564060(_0x373bee[_0x189b('0x22')][_0x189b('0x24')]);}else{logger[_0x189b('0x1c')](_0x189b('0x1d'),_0x4b9ddc,'request\x20sent');_0x564060(_0x373bee[_0x189b('0x25')][_0x189b('0x24')]);}})[_0x189b('0x26')](function(_0x346834){logger['error'](_0x189b('0x1d'),_0x4b9ddc,_0x346834);_0x21a89c(_0x346834);});});}function respondWithStatusCode(_0x2a17dd,_0x530580){_0x530580=_0x530580||0xcc;return function(_0x2b12db){if(_0x2b12db){return _0x2a17dd[_0x189b('0x27')](_0x530580);}return _0x2a17dd[_0x189b('0x28')](_0x530580)[_0x189b('0x29')]();};}function respondWithResult(_0x508bf7,_0xb2d7ca){_0xb2d7ca=_0xb2d7ca||0xc8;return function(_0x1a1ec0){if(_0x1a1ec0){return _0x508bf7[_0x189b('0x28')](_0xb2d7ca)[_0x189b('0x2a')](_0x1a1ec0);}};}function respondWithFilteredResult(_0x43450e,_0x4cdd07){return function(_0x1cfff3){if(_0x1cfff3){var _0x21b4db=_0x1cfff3[_0x189b('0x2b')],_0x4fb9f5=_0x4cdd07[_0x189b('0x2c')],_0x371825=_0x4cdd07[_0x189b('0x2c')]+_0x4cdd07[_0x189b('0x2d')],_0x3f376a;if(_0x371825>=_0x21b4db){_0x371825=_0x21b4db;_0x3f376a=0xc8;}else{_0x3f376a=0xce;}_0x43450e[_0x189b('0x28')](_0x3f376a);return _0x43450e[_0x189b('0x2e')](_0x189b('0x2f'),_0x4fb9f5+'-'+_0x371825+'/'+_0x21b4db)['json'](_0x1cfff3);}return null;};}function patchUpdates(_0x3041a2){return function(_0x1b259f){try{jsonpatch[_0x189b('0x30')](_0x1b259f,_0x3041a2,!![]);}catch(_0x4eb579){return BPromise[_0x189b('0x31')](_0x4eb579);}return _0x1b259f[_0x189b('0x32')]();};}function saveUpdates(_0x4e5a1f,_0x424fa5){return function(_0x4296be){if(_0x4296be){return _0x4296be[_0x189b('0x33')](_0x4e5a1f)['then'](function(_0x229451){return _0x229451;});}return null;};}function removeEntity(_0x30dc92,_0x127206){return function(_0x17aa85){if(_0x17aa85){return _0x17aa85[_0x189b('0x34')]()[_0x189b('0x1b')](function(){_0x30dc92[_0x189b('0x28')](0xcc)[_0x189b('0x29')]();});}};}function handleEntityNotFound(_0x1050c4,_0x3f4023){return function(_0x23eebe){if(!_0x23eebe){_0x1050c4[_0x189b('0x27')](0x194);}return _0x23eebe;};}function handleError(_0x1e698d,_0x9792f2){_0x9792f2=_0x9792f2||0x1f4;return function(_0x1dc5d1){logger['error'](_0x1dc5d1[_0x189b('0x35')]);if(_0x1dc5d1[_0x189b('0x36')]){delete _0x1dc5d1[_0x189b('0x36')];}_0x1e698d['status'](_0x9792f2)[_0x189b('0x37')](_0x1dc5d1);};}exports['index']=function(_0x5de340,_0x43202a){var _0x3f0c0f={},_0xc36c3e={},_0x55f875={'count':0x0,'rows':[]};var _0x961808=_['map'](db['Setting'][_0x189b('0x38')],function(_0x5f5db3){return{'name':_0x5f5db3['fieldName'],'type':_0x5f5db3[_0x189b('0x39')]['key']};});_0xc36c3e['model']=_[_0x189b('0x3a')](_0x961808,'name');_0xc36c3e['query']=_['keys'](_0x5de340['query']);_0xc36c3e[_0x189b('0x3b')]=_[_0x189b('0x3c')](_0xc36c3e[_0x189b('0x3d')],_0xc36c3e[_0x189b('0x3e')]);_0x3f0c0f['attributes']=_[_0x189b('0x3c')](_0xc36c3e[_0x189b('0x3d')],qs[_0x189b('0x3f')](_0x5de340[_0x189b('0x3e')][_0x189b('0x3f')]));_0x3f0c0f[_0x189b('0x40')]=_0x3f0c0f[_0x189b('0x40')][_0x189b('0x41')]?_0x3f0c0f[_0x189b('0x40')]:_0xc36c3e[_0x189b('0x3d')];if(!_0x5de340[_0x189b('0x3e')][_0x189b('0x42')](_0x189b('0x43'))){_0x3f0c0f[_0x189b('0x2d')]=qs[_0x189b('0x2d')](_0x5de340[_0x189b('0x3e')][_0x189b('0x2d')]);_0x3f0c0f[_0x189b('0x2c')]=qs['offset'](_0x5de340['query']['offset']);}_0x3f0c0f[_0x189b('0x44')]=qs[_0x189b('0x45')](_0x5de340['query'][_0x189b('0x45')]);_0x3f0c0f[_0x189b('0x46')]=qs[_0x189b('0x3b')](_[_0x189b('0x47')](_0x5de340['query'],_0xc36c3e['filters']),_0x961808);if(_0x5de340[_0x189b('0x3e')]['filter']){_0x3f0c0f[_0x189b('0x46')]=_[_0x189b('0x48')](_0x3f0c0f[_0x189b('0x46')],{'$or':_[_0x189b('0x3a')](_0x961808,function(_0x546682){if(_0x546682[_0x189b('0x39')]!==_0x189b('0x49')){var _0x19eca3={};_0x19eca3[_0x546682[_0x189b('0x36')]]={'$like':'%'+_0x5de340[_0x189b('0x3e')][_0x189b('0x4a')]+'%'};return _0x19eca3;}})});}_0x3f0c0f=_['merge']({},_0x3f0c0f,_0x5de340[_0x189b('0x4b')]);var _0x5a886e={'where':_0x3f0c0f[_0x189b('0x46')]};return db[_0x189b('0x4c')][_0x189b('0x2b')](_0x5a886e)[_0x189b('0x1b')](function(_0x3bb403){_0x55f875['count']=_0x3bb403;if(_0x5de340[_0x189b('0x3e')][_0x189b('0x4d')]){_0x3f0c0f['include']=[{'all':!![]}];}return db[_0x189b('0x4c')][_0x189b('0x4e')](_0x3f0c0f);})['then'](function(_0x4cf399){_0x55f875[_0x189b('0x4f')]=_0x4cf399;return _0x55f875;})[_0x189b('0x1b')](respondWithFilteredResult(_0x43202a,_0x3f0c0f))[_0x189b('0x26')](handleError(_0x43202a,null));};exports[_0x189b('0x50')]=function(_0x1f66eb,_0xc3273b){var _0x500472={'raw':![],'where':{'id':_0x1f66eb[_0x189b('0x51')]['id']}},_0x188e34={};_0x188e34[_0x189b('0x3d')]=_[_0x189b('0x52')](db[_0x189b('0x4c')]['rawAttributes']);_0x188e34[_0x189b('0x3e')]=_['keys'](_0x1f66eb[_0x189b('0x3e')]);_0x188e34[_0x189b('0x3b')]=_['intersection'](_0x188e34[_0x189b('0x3d')],_0x188e34[_0x189b('0x3e')]);_0x500472['attributes']=_[_0x189b('0x3c')](_0x188e34[_0x189b('0x3d')],qs['fields'](_0x1f66eb[_0x189b('0x3e')]['fields']));_0x500472[_0x189b('0x40')]=_0x500472['attributes'][_0x189b('0x41')]?_0x500472['attributes']:_0x188e34[_0x189b('0x3d')];if(_0x1f66eb[_0x189b('0x3e')][_0x189b('0x4d')]){_0x500472['include']=[{'all':!![]}];}_0x500472=_[_0x189b('0x48')]({},_0x500472,_0x1f66eb[_0x189b('0x4b')]);return db[_0x189b('0x4c')][_0x189b('0x53')](_0x500472)['then'](handleEntityNotFound(_0xc3273b,null))[_0x189b('0x1b')](respondWithResult(_0xc3273b,null))[_0x189b('0x26')](handleError(_0xc3273b,null));};exports['update']=function(_0x7c1c3e,_0x4d6327){if(_0x7c1c3e[_0x189b('0x54')]['id']){delete _0x7c1c3e[_0x189b('0x54')]['id'];}return db['Setting'][_0x189b('0x53')]({'where':{'id':_0x7c1c3e[_0x189b('0x51')]['id']}})['then'](handleEntityNotFound(_0x4d6327,null))[_0x189b('0x1b')](saveUpdates(_0x7c1c3e[_0x189b('0x54')],null))[_0x189b('0x1b')](respondWithResult(_0x4d6327,null))[_0x189b('0x26')](handleError(_0x4d6327,null));};exports[_0x189b('0x55')]=function(_0x7c6348,_0x54cf3e,_0x1060af){if(_0x7c6348[_0x189b('0x56')]&&_0x7c6348[_0x189b('0x56')]['filename']){_0x7c6348['body'][_0x189b('0x57')]=_0x7c6348[_0x189b('0x56')]['filename'];}return db[_0x189b('0x4c')][_0x189b('0x53')]({'where':{'id':_0x7c6348[_0x189b('0x51')]['id']}})[_0x189b('0x1b')](handleEntityNotFound(_0x54cf3e,null))[_0x189b('0x1b')](saveUpdates(_0x7c6348[_0x189b('0x54')],null))['then'](respondWithResult(_0x54cf3e,null))[_0x189b('0x26')](handleError(_0x54cf3e,null));};exports[_0x189b('0x58')]=function(_0x316a04,_0x11c872,_0x213709){if(_0x316a04['file']&&_0x316a04['file'][_0x189b('0x59')]){_0x316a04[_0x189b('0x54')][_0x189b('0x5a')]=_0x316a04[_0x189b('0x56')][_0x189b('0x59')];}return db[_0x189b('0x4c')][_0x189b('0x53')]({'where':{'id':_0x316a04[_0x189b('0x51')]['id']}})[_0x189b('0x1b')](handleEntityNotFound(_0x11c872,null))[_0x189b('0x1b')](saveUpdates(_0x316a04[_0x189b('0x54')],null))[_0x189b('0x1b')](respondWithResult(_0x11c872,null))[_0x189b('0x26')](handleError(_0x11c872,null));};var utilLicense=require(_0x189b('0x5b'));exports[_0x189b('0x5c')]=function(_0x1e300e,_0x167df2,_0x43de0a){var _0x3cda77=_0x189b('0x5d');var _0x1e797c={'custom':![]};return utilLicense[_0x189b('0x5e')]()[_0x189b('0x1b')](function(_0x1c77b9){if(_0x1c77b9){_0x1e797c=_0x1c77b9;}return db[_0x189b('0x4c')]['find']({'where':{'id':_0x1e300e[_0x189b('0x51')]['id']},'attributes':[_0x189b('0x57'),_0x189b('0x5a'),_0x189b('0x5f'),_0x189b('0x60'),_0x189b('0x61'),_0x189b('0x62'),_0x189b('0x63'),'defaultFavicon'],'raw':!![]});})[_0x189b('0x1b')](handleEntityNotFound(_0x167df2,null))[_0x189b('0x1b')](function(_0x307a92){if(_0x307a92){var _0x3051d0=_0x307a92[_0x189b('0x57')]&&fs[_0x189b('0x64')](path[_0x189b('0x65')](config[_0x189b('0x66')],_0x3cda77,_[_0x189b('0x67')](_0x307a92['logo'])))?path['join'](config[_0x189b('0x66')],_0x3cda77,_['toLower'](_0x307a92['logo'])):path['join'](config[_0x189b('0x66')],_0x3cda77,_[_0x189b('0x67')](_0x189b('0x68')));var _0x4171d3=_0x189b('0x69')+_[_0x189b('0x6a')](_0x189b('0x57'));if(_0x307a92[_0x4171d3]||!_0x1e797c[_0x189b('0x6b')]){_0x3051d0=path[_0x189b('0x65')](config[_0x189b('0x66')],_0x3cda77,_[_0x189b('0x67')](_0x189b('0x68')));}if(!fs[_0x189b('0x64')](_0x3051d0)){throw new db['Sequelize'][(_0x189b('0x19'))](_['upperFirst'](_0x189b('0x57'))+_0x189b('0x6c'));}return _0x167df2[_0x189b('0x6d')](_0x3051d0);}})['catch'](handleError(_0x167df2,null));};var utilLicense=require(_0x189b('0x5b'));exports[_0x189b('0x6e')]=function(_0x5067a8,_0x466695,_0x392b67){var _0x5c9872=_0x189b('0x5d');var _0x538723={'custom':![]};return utilLicense[_0x189b('0x5e')]()[_0x189b('0x1b')](function(_0x4c7d7f){if(_0x4c7d7f){_0x538723=_0x4c7d7f;}return db[_0x189b('0x4c')]['find']({'where':{'id':_0x5067a8[_0x189b('0x51')]['id']},'attributes':[_0x189b('0x57'),_0x189b('0x5a'),_0x189b('0x5f'),_0x189b('0x60'),_0x189b('0x61'),_0x189b('0x62'),_0x189b('0x63'),_0x189b('0x6f')],'raw':!![]});})[_0x189b('0x1b')](handleEntityNotFound(_0x466695,null))[_0x189b('0x1b')](function(_0x4c4018){if(_0x4c4018){var _0x413b10=_0x4c4018['loginLogo']&&fs[_0x189b('0x64')](path[_0x189b('0x65')](config['root'],_0x5c9872,_[_0x189b('0x67')](_0x4c4018['loginLogo'])))?path['join'](config['root'],_0x5c9872,_[_0x189b('0x67')](_0x4c4018[_0x189b('0x5a')])):path[_0x189b('0x65')](config[_0x189b('0x66')],_0x5c9872,_[_0x189b('0x67')]('default_loginLogo.svg'));var _0x4cbe59=_0x189b('0x69')+_['upperFirst'](_0x189b('0x5a'));if(_0x4c4018[_0x4cbe59]||!_0x538723[_0x189b('0x6b')]){_0x413b10=path[_0x189b('0x65')](config[_0x189b('0x66')],_0x5c9872,_[_0x189b('0x67')](_0x189b('0x70')));}if(!fs[_0x189b('0x64')](_0x413b10)){throw new db[(_0x189b('0x18'))][(_0x189b('0x19'))](_[_0x189b('0x6a')](_0x189b('0x5a'))+_0x189b('0x6c'));}return _0x466695['download'](_0x413b10);}})[_0x189b('0x26')](handleError(_0x466695,null));};exports['gdpr']=function(_0x528918,_0x2038ef){return db[_0x189b('0x4c')][_0x189b('0x53')]({'where':{'id':_0x528918[_0x189b('0x51')]['id']},'attributes':[_0x189b('0x71')]})[_0x189b('0x1b')](respondWithResult(_0x2038ef,null))['catch'](handleError(_0x2038ef,null));};exports[_0x189b('0x72')]=function(_0x518f9c,_0x20fe0c,_0x3a381f){if(_0x518f9c[_0x189b('0x56')]&&_0x518f9c[_0x189b('0x56')][_0x189b('0x59')]){_0x518f9c[_0x189b('0x54')][_0x189b('0x5f')]=_0x518f9c['file'][_0x189b('0x59')];}return db[_0x189b('0x4c')][_0x189b('0x53')]({'where':{'id':_0x518f9c[_0x189b('0x51')]['id']}})[_0x189b('0x1b')](handleEntityNotFound(_0x20fe0c,null))[_0x189b('0x1b')](saveUpdates(_0x518f9c['body'],null))[_0x189b('0x1b')](respondWithResult(_0x20fe0c,null))['catch'](handleError(_0x20fe0c,null));};var utilLicense=require(_0x189b('0x5b'));exports['getPreferred']=function(_0x5c43b4,_0x125562,_0x40788b){var _0x434722='server/files/images/logos';var _0x362508={'custom':![]};return utilLicense[_0x189b('0x5e')]()['then'](function(_0x546610){if(_0x546610){_0x362508=_0x546610;}return db[_0x189b('0x4c')]['find']({'where':{'id':_0x5c43b4[_0x189b('0x51')]['id']},'attributes':[_0x189b('0x57'),_0x189b('0x5a'),'preferred',_0x189b('0x60'),_0x189b('0x61'),_0x189b('0x62'),'defaultPreferred',_0x189b('0x6f')],'raw':!![]});})[_0x189b('0x1b')](handleEntityNotFound(_0x125562,null))['then'](function(_0x5ebd69){if(_0x5ebd69){var _0x1fa33c=_0x5ebd69[_0x189b('0x5f')]&&fs['existsSync'](path['join'](config[_0x189b('0x66')],_0x434722,_[_0x189b('0x67')](_0x5ebd69[_0x189b('0x5f')])))?path['join'](config[_0x189b('0x66')],_0x434722,_[_0x189b('0x67')](_0x5ebd69[_0x189b('0x5f')])):path[_0x189b('0x65')](config[_0x189b('0x66')],_0x434722,_[_0x189b('0x67')]('default_preferred.png'));var _0x3bc194=_0x189b('0x69')+_['upperFirst'](_0x189b('0x5f'));if(_0x5ebd69[_0x3bc194]||!_0x362508[_0x189b('0x6b')]||!_0x362508['preferred']){_0x1fa33c=path['join'](config[_0x189b('0x66')],_0x434722,_['toLower'](_0x189b('0x73')));}if(!fs[_0x189b('0x64')](_0x1fa33c)){throw new db[(_0x189b('0x18'))][(_0x189b('0x19'))](_['upperFirst'](_0x189b('0x5f'))+_0x189b('0x6c'));}return _0x125562['download'](_0x1fa33c);}})[_0x189b('0x26')](handleError(_0x125562,null));};exports[_0x189b('0x74')]=function(_0x5b0046,_0x400cc4,_0x3070ce){if(_0x5b0046[_0x189b('0x56')]&&_0x5b0046[_0x189b('0x56')]['filename']){_0x5b0046[_0x189b('0x54')]['favicon']=_0x5b0046[_0x189b('0x56')]['filename'];}return db['Setting']['find']({'where':{'id':_0x5b0046[_0x189b('0x51')]['id']}})['then'](handleEntityNotFound(_0x400cc4,null))['then'](saveUpdates(_0x5b0046[_0x189b('0x54')],null))[_0x189b('0x1b')](respondWithResult(_0x400cc4,null))[_0x189b('0x26')](handleError(_0x400cc4,null));};var utilLicense=require(_0x189b('0x5b'));exports['getFavicon']=function(_0xb25278,_0x3b9b6c,_0xde8a6c){var _0x58875c=_0x189b('0x5d');var _0x399166={'custom':![]};return utilLicense[_0x189b('0x5e')]()[_0x189b('0x1b')](function(_0x41aada){if(_0x41aada){_0x399166=_0x41aada;}return db[_0x189b('0x4c')][_0x189b('0x53')]({'where':{'id':_0xb25278['params']['id']},'attributes':[_0x189b('0x57'),'loginLogo',_0x189b('0x5f'),_0x189b('0x60'),_0x189b('0x61'),_0x189b('0x62'),_0x189b('0x63'),_0x189b('0x6f')],'raw':!![]});})['then'](handleEntityNotFound(_0x3b9b6c,null))[_0x189b('0x1b')](function(_0x48daf8){if(_0x48daf8){var _0x18a040=_0x48daf8[_0x189b('0x60')]&&fs[_0x189b('0x64')](path[_0x189b('0x65')](config[_0x189b('0x66')],_0x58875c,_['toLower'](_0x48daf8['favicon'])))?path[_0x189b('0x65')](config[_0x189b('0x66')],_0x58875c,_['toLower'](_0x48daf8['favicon'])):path[_0x189b('0x65')](config[_0x189b('0x66')],_0x58875c,_[_0x189b('0x67')]('default_favicon.ico'));var _0x197010=_0x189b('0x69')+_[_0x189b('0x6a')](_0x189b('0x60'));if(_0x48daf8[_0x197010]||!_0x399166[_0x189b('0x6b')]){_0x18a040=path[_0x189b('0x65')](config[_0x189b('0x66')],_0x58875c,_[_0x189b('0x67')]('default_favicon.ico'));}if(!fs[_0x189b('0x64')](_0x18a040)){throw new db[(_0x189b('0x18'))][(_0x189b('0x19'))](_[_0x189b('0x6a')](_0x189b('0x60'))+_0x189b('0x6c'));}return _0x3b9b6c[_0x189b('0x6d')](_0x18a040);}})[_0x189b('0x26')](handleError(_0x3b9b6c,null));}; \ No newline at end of file +var _0xe335=['params','include','find','update','body','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLicense','logo','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','getLogoLogin','server/files/images/logos','preferred','defaultLoginLogo','default_loginLogo.svg','download','gdpr','securePassword','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','ValidationError','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','offset','limit','set','Content-Range','apply','reject','end','sendStatus','stack','name','send','index','map','Setting','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','options','count','rows','show'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0xe335,0x10e));var _0x5e33=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe335[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x5e33('0x0'));var emlformat=require(_0x5e33('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5e33('0x2'));var jsonpatch=require(_0x5e33('0x3'));var rp=require(_0x5e33('0x4'));var moment=require(_0x5e33('0x5'));var BPromise=require(_0x5e33('0x6'));var Mustache=require(_0x5e33('0x7'));var util=require(_0x5e33('0x8'));var path=require(_0x5e33('0x9'));var sox=require(_0x5e33('0xa'));var csv=require('to-csv');var ejs=require(_0x5e33('0xb'));var fs=require('fs');var _=require(_0x5e33('0xc'));var squel=require(_0x5e33('0xd'));var crypto=require(_0x5e33('0xe'));var jsforce=require(_0x5e33('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5e33('0x10'));var querystring=require(_0x5e33('0x11'));var Papa=require(_0x5e33('0x12'));var Redis=require(_0x5e33('0x13'));var authService=require(_0x5e33('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e33('0x15'));var logger=require(_0x5e33('0x16'))(_0x5e33('0x17'));var utils=require(_0x5e33('0x18'));var config=require(_0x5e33('0x19'));var db=require(_0x5e33('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x5e33('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x29e717,_0x49a8cb,_0x403937){if(_0x403937){var _0x4a49e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a49e8['test'](_0x49a8cb)){return _0x29e717;}else{throw new db['Sequelize'][(_0x5e33('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 _0x29e717;}}function respondWithRpcPromise(_0x10f1b9,_0x125f23,_0x39420b,_0x3baa5e){return new BPromise(function(_0x300059,_0x92fd44){var _0x2170b9=_0x3baa5e||client;return _0x2170b9['request'](_0x10f1b9,_0x39420b)[_0x5e33('0x1d')](function(_0x50dd04){logger[_0x5e33('0x1e')](_0x5e33('0x1f'),_0x125f23,_0x5e33('0x20'));logger['debug'](_0x5e33('0x21'),_0x125f23,_0x5e33('0x20'),JSON['stringify'](_0x50dd04));if(_0x50dd04[_0x5e33('0x22')]){if(_0x50dd04[_0x5e33('0x22')][_0x5e33('0x23')]===0x1f4){logger[_0x5e33('0x22')](_0x5e33('0x1f'),_0x125f23,_0x50dd04[_0x5e33('0x22')]['message']);return _0x92fd44(_0x50dd04[_0x5e33('0x22')][_0x5e33('0x24')]);}logger['error'](_0x5e33('0x1f'),_0x125f23,_0x50dd04[_0x5e33('0x22')][_0x5e33('0x24')]);return _0x300059(_0x50dd04[_0x5e33('0x22')][_0x5e33('0x24')]);}else{logger[_0x5e33('0x1e')](_0x5e33('0x1f'),_0x125f23,_0x5e33('0x20'));_0x300059(_0x50dd04[_0x5e33('0x25')][_0x5e33('0x24')]);}})[_0x5e33('0x26')](function(_0x35905c){logger['error'](_0x5e33('0x1f'),_0x125f23,_0x35905c);_0x92fd44(_0x35905c);});});}function respondWithStatusCode(_0x35130c,_0x4a41b8){_0x4a41b8=_0x4a41b8||0xcc;return function(_0x24ee6d){if(_0x24ee6d){return _0x35130c['sendStatus'](_0x4a41b8);}return _0x35130c[_0x5e33('0x27')](_0x4a41b8)['end']();};}function respondWithResult(_0x3ca5b5,_0x5467f8){_0x5467f8=_0x5467f8||0xc8;return function(_0x29ac51){if(_0x29ac51){return _0x3ca5b5[_0x5e33('0x27')](_0x5467f8)['json'](_0x29ac51);}};}function respondWithFilteredResult(_0x31f68a,_0x4ccfd2){return function(_0x29107c){if(_0x29107c){var _0x462e41=_0x29107c['count'],_0x362d16=_0x4ccfd2['offset'],_0x4373e9=_0x4ccfd2[_0x5e33('0x28')]+_0x4ccfd2[_0x5e33('0x29')],_0x147bbe;if(_0x4373e9>=_0x462e41){_0x4373e9=_0x462e41;_0x147bbe=0xc8;}else{_0x147bbe=0xce;}_0x31f68a['status'](_0x147bbe);return _0x31f68a[_0x5e33('0x2a')](_0x5e33('0x2b'),_0x362d16+'-'+_0x4373e9+'/'+_0x462e41)['json'](_0x29107c);}return null;};}function patchUpdates(_0x519b10){return function(_0x17bf69){try{jsonpatch[_0x5e33('0x2c')](_0x17bf69,_0x519b10,!![]);}catch(_0x32da59){return BPromise[_0x5e33('0x2d')](_0x32da59);}return _0x17bf69['save']();};}function saveUpdates(_0x124cab,_0x5daaf6){return function(_0x55cf3e){if(_0x55cf3e){return _0x55cf3e['update'](_0x124cab)[_0x5e33('0x1d')](function(_0x323189){return _0x323189;});}return null;};}function removeEntity(_0x2d9572,_0x15fea1){return function(_0x4b803f){if(_0x4b803f){return _0x4b803f['destroy']()[_0x5e33('0x1d')](function(){_0x2d9572[_0x5e33('0x27')](0xcc)[_0x5e33('0x2e')]();});}};}function handleEntityNotFound(_0x1d2e76,_0x434717){return function(_0x467d54){if(!_0x467d54){_0x1d2e76[_0x5e33('0x2f')](0x194);}return _0x467d54;};}function handleError(_0x154af1,_0x739d8f){_0x739d8f=_0x739d8f||0x1f4;return function(_0x401a64){logger[_0x5e33('0x22')](_0x401a64[_0x5e33('0x30')]);if(_0x401a64[_0x5e33('0x31')]){delete _0x401a64[_0x5e33('0x31')];}_0x154af1['status'](_0x739d8f)[_0x5e33('0x32')](_0x401a64);};}exports[_0x5e33('0x33')]=function(_0x23965d,_0x228d96){var _0x173780={},_0x34dde7={},_0x5c3e3b={'count':0x0,'rows':[]};var _0x42821b=_[_0x5e33('0x34')](db[_0x5e33('0x35')][_0x5e33('0x36')],function(_0x128df3){return{'name':_0x128df3['fieldName'],'type':_0x128df3[_0x5e33('0x37')][_0x5e33('0x38')]};});_0x34dde7[_0x5e33('0x39')]=_['map'](_0x42821b,_0x5e33('0x31'));_0x34dde7[_0x5e33('0x3a')]=_[_0x5e33('0x3b')](_0x23965d[_0x5e33('0x3a')]);_0x34dde7['filters']=_[_0x5e33('0x3c')](_0x34dde7[_0x5e33('0x39')],_0x34dde7['query']);_0x173780[_0x5e33('0x3d')]=_[_0x5e33('0x3c')](_0x34dde7['model'],qs['fields'](_0x23965d[_0x5e33('0x3a')][_0x5e33('0x3e')]));_0x173780[_0x5e33('0x3d')]=_0x173780['attributes'][_0x5e33('0x3f')]?_0x173780[_0x5e33('0x3d')]:_0x34dde7['model'];if(!_0x23965d[_0x5e33('0x3a')][_0x5e33('0x40')]('nolimit')){_0x173780[_0x5e33('0x29')]=qs[_0x5e33('0x29')](_0x23965d['query'][_0x5e33('0x29')]);_0x173780[_0x5e33('0x28')]=qs['offset'](_0x23965d[_0x5e33('0x3a')][_0x5e33('0x28')]);}_0x173780['order']=qs[_0x5e33('0x41')](_0x23965d[_0x5e33('0x3a')][_0x5e33('0x41')]);_0x173780[_0x5e33('0x42')]=qs['filters'](_[_0x5e33('0x43')](_0x23965d[_0x5e33('0x3a')],_0x34dde7[_0x5e33('0x44')]),_0x42821b);if(_0x23965d[_0x5e33('0x3a')][_0x5e33('0x45')]){_0x173780['where']=_[_0x5e33('0x46')](_0x173780[_0x5e33('0x42')],{'$or':_[_0x5e33('0x34')](_0x42821b,function(_0x4edcc7){if(_0x4edcc7[_0x5e33('0x37')]!=='VIRTUAL'){var _0x268fc5={};_0x268fc5[_0x4edcc7[_0x5e33('0x31')]]={'$like':'%'+_0x23965d[_0x5e33('0x3a')]['filter']+'%'};return _0x268fc5;}})});}_0x173780=_[_0x5e33('0x46')]({},_0x173780,_0x23965d[_0x5e33('0x47')]);var _0x135f65={'where':_0x173780['where']};return db[_0x5e33('0x35')][_0x5e33('0x48')](_0x135f65)[_0x5e33('0x1d')](function(_0x133fac){_0x5c3e3b['count']=_0x133fac;if(_0x23965d['query']['includeAll']){_0x173780['include']=[{'all':!![]}];}return db[_0x5e33('0x35')]['findAll'](_0x173780);})[_0x5e33('0x1d')](function(_0x18b0f7){_0x5c3e3b[_0x5e33('0x49')]=_0x18b0f7;return _0x5c3e3b;})[_0x5e33('0x1d')](respondWithFilteredResult(_0x228d96,_0x173780))[_0x5e33('0x26')](handleError(_0x228d96,null));};exports[_0x5e33('0x4a')]=function(_0xa5e192,_0x116414){var _0x13bb3b={'raw':![],'where':{'id':_0xa5e192[_0x5e33('0x4b')]['id']}},_0x11e5f4={};_0x11e5f4['model']=_[_0x5e33('0x3b')](db['Setting'][_0x5e33('0x36')]);_0x11e5f4[_0x5e33('0x3a')]=_[_0x5e33('0x3b')](_0xa5e192['query']);_0x11e5f4[_0x5e33('0x44')]=_[_0x5e33('0x3c')](_0x11e5f4['model'],_0x11e5f4[_0x5e33('0x3a')]);_0x13bb3b['attributes']=_[_0x5e33('0x3c')](_0x11e5f4[_0x5e33('0x39')],qs[_0x5e33('0x3e')](_0xa5e192[_0x5e33('0x3a')][_0x5e33('0x3e')]));_0x13bb3b['attributes']=_0x13bb3b['attributes'][_0x5e33('0x3f')]?_0x13bb3b[_0x5e33('0x3d')]:_0x11e5f4[_0x5e33('0x39')];if(_0xa5e192[_0x5e33('0x3a')]['includeAll']){_0x13bb3b[_0x5e33('0x4c')]=[{'all':!![]}];}_0x13bb3b=_['merge']({},_0x13bb3b,_0xa5e192[_0x5e33('0x47')]);return db[_0x5e33('0x35')][_0x5e33('0x4d')](_0x13bb3b)['then'](handleEntityNotFound(_0x116414,null))[_0x5e33('0x1d')](respondWithResult(_0x116414,null))[_0x5e33('0x26')](handleError(_0x116414,null));};exports[_0x5e33('0x4e')]=function(_0x279292,_0x97f5d7){if(_0x279292[_0x5e33('0x4f')]['id']){delete _0x279292[_0x5e33('0x4f')]['id'];}return db[_0x5e33('0x35')]['find']({'where':{'id':_0x279292[_0x5e33('0x4b')]['id']}})[_0x5e33('0x1d')](handleEntityNotFound(_0x97f5d7,null))[_0x5e33('0x1d')](saveUpdates(_0x279292[_0x5e33('0x4f')],null))[_0x5e33('0x1d')](respondWithResult(_0x97f5d7,null))[_0x5e33('0x26')](handleError(_0x97f5d7,null));};exports[_0x5e33('0x50')]=function(_0x17b217,_0x13cc87,_0x559137){if(_0x17b217['file']&&_0x17b217[_0x5e33('0x51')]['filename']){_0x17b217['body']['logo']=_0x17b217[_0x5e33('0x51')][_0x5e33('0x52')];}return db[_0x5e33('0x35')][_0x5e33('0x4d')]({'where':{'id':_0x17b217['params']['id']}})[_0x5e33('0x1d')](handleEntityNotFound(_0x13cc87,null))['then'](saveUpdates(_0x17b217['body'],null))[_0x5e33('0x1d')](respondWithResult(_0x13cc87,null))[_0x5e33('0x26')](handleError(_0x13cc87,null));};exports[_0x5e33('0x53')]=function(_0x11f601,_0x4bd4bf,_0x26a761){if(_0x11f601['file']&&_0x11f601[_0x5e33('0x51')][_0x5e33('0x52')]){_0x11f601['body'][_0x5e33('0x54')]=_0x11f601[_0x5e33('0x51')]['filename'];}return db['Setting']['find']({'where':{'id':_0x11f601[_0x5e33('0x4b')]['id']}})[_0x5e33('0x1d')](handleEntityNotFound(_0x4bd4bf,null))[_0x5e33('0x1d')](saveUpdates(_0x11f601[_0x5e33('0x4f')],null))[_0x5e33('0x1d')](respondWithResult(_0x4bd4bf,null))[_0x5e33('0x26')](handleError(_0x4bd4bf,null));};var utilLicense=require(_0x5e33('0x55'));exports['getLogo']=function(_0x5c00d3,_0x57502f,_0x4d8862){var _0xf9584b='server/files/images/logos';var _0x4ebdfe={'custom':![]};return utilLicense[_0x5e33('0x56')]()[_0x5e33('0x1d')](function(_0x41c6d7){if(_0x41c6d7){_0x4ebdfe=_0x41c6d7;}return db['Setting'][_0x5e33('0x4d')]({'where':{'id':_0x5c00d3[_0x5e33('0x4b')]['id']},'attributes':[_0x5e33('0x57'),_0x5e33('0x54'),'preferred',_0x5e33('0x58'),_0x5e33('0x59'),'defaultLoginLogo',_0x5e33('0x5a'),_0x5e33('0x5b')],'raw':!![]});})[_0x5e33('0x1d')](handleEntityNotFound(_0x57502f,null))[_0x5e33('0x1d')](function(_0x1a8359){if(_0x1a8359){var _0x2a435f=_0x1a8359['logo']&&fs[_0x5e33('0x5c')](path['join'](config['root'],_0xf9584b,_['toLower'](_0x1a8359[_0x5e33('0x57')])))?path['join'](config[_0x5e33('0x5d')],_0xf9584b,_[_0x5e33('0x5e')](_0x1a8359[_0x5e33('0x57')])):path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0xf9584b,_['toLower'](_0x5e33('0x60')));var _0x49272e=_0x5e33('0x61')+_[_0x5e33('0x62')](_0x5e33('0x57'));if(_0x1a8359[_0x49272e]||!_0x4ebdfe[_0x5e33('0x63')]){_0x2a435f=path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0xf9584b,_['toLower'](_0x5e33('0x60')));}if(!fs[_0x5e33('0x5c')](_0x2a435f)){throw new db[(_0x5e33('0x64'))][(_0x5e33('0x1c'))](_[_0x5e33('0x62')](_0x5e33('0x57'))+_0x5e33('0x65'));}return _0x57502f['download'](_0x2a435f);}})[_0x5e33('0x26')](handleError(_0x57502f,null));};var utilLicense=require('../../config/license/util');exports[_0x5e33('0x66')]=function(_0x559b8b,_0xc7c0e7,_0x4e74e5){var _0x2b4213=_0x5e33('0x67');var _0x593669={'custom':![]};return utilLicense[_0x5e33('0x56')]()['then'](function(_0x115d27){if(_0x115d27){_0x593669=_0x115d27;}return db[_0x5e33('0x35')][_0x5e33('0x4d')]({'where':{'id':_0x559b8b['params']['id']},'attributes':[_0x5e33('0x57'),_0x5e33('0x54'),_0x5e33('0x68'),_0x5e33('0x58'),_0x5e33('0x59'),_0x5e33('0x69'),'defaultPreferred',_0x5e33('0x5b')],'raw':!![]});})[_0x5e33('0x1d')](handleEntityNotFound(_0xc7c0e7,null))[_0x5e33('0x1d')](function(_0x5cd56e){if(_0x5cd56e){var _0x564bb9=_0x5cd56e[_0x5e33('0x54')]&&fs[_0x5e33('0x5c')](path[_0x5e33('0x5f')](config['root'],_0x2b4213,_[_0x5e33('0x5e')](_0x5cd56e[_0x5e33('0x54')])))?path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x2b4213,_[_0x5e33('0x5e')](_0x5cd56e[_0x5e33('0x54')])):path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x2b4213,_[_0x5e33('0x5e')](_0x5e33('0x6a')));var _0x261c19=_0x5e33('0x61')+_[_0x5e33('0x62')]('loginLogo');if(_0x5cd56e[_0x261c19]||!_0x593669[_0x5e33('0x63')]){_0x564bb9=path['join'](config[_0x5e33('0x5d')],_0x2b4213,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x5e33('0x5c')](_0x564bb9)){throw new db['Sequelize'][(_0x5e33('0x1c'))](_[_0x5e33('0x62')](_0x5e33('0x54'))+_0x5e33('0x65'));}return _0xc7c0e7[_0x5e33('0x6b')](_0x564bb9);}})['catch'](handleError(_0xc7c0e7,null));};exports[_0x5e33('0x6c')]=function(_0x1aa19c,_0x38b2a5){return db[_0x5e33('0x35')][_0x5e33('0x4d')]({'where':{'id':_0x1aa19c['params']['id']},'attributes':[_0x5e33('0x6d')]})[_0x5e33('0x1d')](respondWithResult(_0x38b2a5,null))[_0x5e33('0x26')](handleError(_0x38b2a5,null));};exports['addPreferred']=function(_0x4c28a4,_0x1d8fee,_0x1fdc65){if(_0x4c28a4[_0x5e33('0x51')]&&_0x4c28a4['file'][_0x5e33('0x52')]){_0x4c28a4[_0x5e33('0x4f')][_0x5e33('0x68')]=_0x4c28a4[_0x5e33('0x51')]['filename'];}return db[_0x5e33('0x35')][_0x5e33('0x4d')]({'where':{'id':_0x4c28a4[_0x5e33('0x4b')]['id']}})[_0x5e33('0x1d')](handleEntityNotFound(_0x1d8fee,null))[_0x5e33('0x1d')](saveUpdates(_0x4c28a4[_0x5e33('0x4f')],null))[_0x5e33('0x1d')](respondWithResult(_0x1d8fee,null))[_0x5e33('0x26')](handleError(_0x1d8fee,null));};var utilLicense=require(_0x5e33('0x55'));exports[_0x5e33('0x6e')]=function(_0x1c6ca6,_0x56829c,_0x5c850c){var _0x5c029d=_0x5e33('0x67');var _0x7e06a0={'custom':![]};return utilLicense['getLicense']()[_0x5e33('0x1d')](function(_0x1a3a11){if(_0x1a3a11){_0x7e06a0=_0x1a3a11;}return db[_0x5e33('0x35')][_0x5e33('0x4d')]({'where':{'id':_0x1c6ca6['params']['id']},'attributes':[_0x5e33('0x57'),_0x5e33('0x54'),_0x5e33('0x68'),'favicon','defaultLogo',_0x5e33('0x69'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x56829c,null))[_0x5e33('0x1d')](function(_0x3fb785){if(_0x3fb785){var _0x43f02e=_0x3fb785[_0x5e33('0x68')]&&fs[_0x5e33('0x5c')](path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x5c029d,_['toLower'](_0x3fb785['preferred'])))?path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x5c029d,_[_0x5e33('0x5e')](_0x3fb785['preferred'])):path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x5c029d,_['toLower'](_0x5e33('0x6f')));var _0x2256c7=_0x5e33('0x61')+_[_0x5e33('0x62')](_0x5e33('0x68'));if(_0x3fb785[_0x2256c7]||!_0x7e06a0[_0x5e33('0x63')]||!_0x7e06a0[_0x5e33('0x68')]){_0x43f02e=path['join'](config['root'],_0x5c029d,_[_0x5e33('0x5e')](_0x5e33('0x6f')));}if(!fs[_0x5e33('0x5c')](_0x43f02e)){throw new db[(_0x5e33('0x64'))][(_0x5e33('0x1c'))](_[_0x5e33('0x62')](_0x5e33('0x68'))+'\x20not\x20found');}return _0x56829c[_0x5e33('0x6b')](_0x43f02e);}})['catch'](handleError(_0x56829c,null));};exports[_0x5e33('0x70')]=function(_0x366961,_0x55a057,_0x4bfbe0){if(_0x366961[_0x5e33('0x51')]&&_0x366961[_0x5e33('0x51')][_0x5e33('0x52')]){_0x366961[_0x5e33('0x4f')]['favicon']=_0x366961[_0x5e33('0x51')][_0x5e33('0x52')];}return db[_0x5e33('0x35')][_0x5e33('0x4d')]({'where':{'id':_0x366961[_0x5e33('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55a057,null))[_0x5e33('0x1d')](saveUpdates(_0x366961[_0x5e33('0x4f')],null))[_0x5e33('0x1d')](respondWithResult(_0x55a057,null))['catch'](handleError(_0x55a057,null));};var utilLicense=require(_0x5e33('0x55'));exports[_0x5e33('0x71')]=function(_0x5690ef,_0x229afd,_0x390c21){var _0x57657e='server/files/images/logos';var _0xfb2827={'custom':![]};return utilLicense[_0x5e33('0x56')]()['then'](function(_0x2defb6){if(_0x2defb6){_0xfb2827=_0x2defb6;}return db['Setting'][_0x5e33('0x4d')]({'where':{'id':_0x5690ef[_0x5e33('0x4b')]['id']},'attributes':['logo','loginLogo',_0x5e33('0x68'),_0x5e33('0x58'),_0x5e33('0x59'),_0x5e33('0x69'),'defaultPreferred',_0x5e33('0x5b')],'raw':!![]});})[_0x5e33('0x1d')](handleEntityNotFound(_0x229afd,null))[_0x5e33('0x1d')](function(_0x4134bb){if(_0x4134bb){var _0x5c5620=_0x4134bb[_0x5e33('0x58')]&&fs[_0x5e33('0x5c')](path['join'](config[_0x5e33('0x5d')],_0x57657e,_[_0x5e33('0x5e')](_0x4134bb[_0x5e33('0x58')])))?path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x57657e,_[_0x5e33('0x5e')](_0x4134bb[_0x5e33('0x58')])):path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x57657e,_[_0x5e33('0x5e')](_0x5e33('0x72')));var _0x1d1902='default'+_[_0x5e33('0x62')](_0x5e33('0x58'));if(_0x4134bb[_0x1d1902]||!_0xfb2827[_0x5e33('0x63')]){_0x5c5620=path[_0x5e33('0x5f')](config[_0x5e33('0x5d')],_0x57657e,_[_0x5e33('0x5e')](_0x5e33('0x72')));}if(!fs[_0x5e33('0x5c')](_0x5c5620)){throw new db['Sequelize'][(_0x5e33('0x1c'))](_['upperFirst'](_0x5e33('0x58'))+'\x20not\x20found');}return _0x229afd[_0x5e33('0x6b')](_0x5c5620);}})['catch'](handleError(_0x229afd,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index c6f91d0..c4089af 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 _0xe66e=['moment','bluebird','path','rimraf','../../config/environment','exports','define','settings','lodash','../../config/logger'];(function(_0xc75d5b,_0x3e3907){var _0x46cbdd=function(_0x32cb77){while(--_0x32cb77){_0xc75d5b['push'](_0xc75d5b['shift']());}};_0x46cbdd(++_0x3e3907);}(_0xe66e,0x1b6));var _0xee66=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe66e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xee66('0x0'));var util=require('util');var logger=require(_0xee66('0x1'))('api');var moment=require(_0xee66('0x2'));var BPromise=require(_0xee66('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee66('0x4'));var rimraf=require(_0xee66('0x5'));var config=require(_0xee66('0x6'));var attributes=require('./setting.attributes');module[_0xee66('0x7')]=function(_0x3c4457,_0x291180){return _0x3c4457[_0xee66('0x8')]('Setting',attributes,{'tableName':_0xee66('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6c69=['../../config/logger','api','moment','rimraf','../../config/environment','./setting.attributes','exports','Setting','settings','lodash'];(function(_0x23d72e,_0x128a4f){var _0xb0aa78=function(_0x18df60){while(--_0x18df60){_0x23d72e['push'](_0x23d72e['shift']());}};_0xb0aa78(++_0x128a4f);}(_0x6c69,0x117));var _0x96c6=function(_0x2b5062,_0x12b234){_0x2b5062=_0x2b5062-0x0;var _0x15b1e1=_0x6c69[_0x2b5062];return _0x15b1e1;};'use strict';var _=require(_0x96c6('0x0'));var util=require('util');var logger=require(_0x96c6('0x1'))(_0x96c6('0x2'));var moment=require(_0x96c6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x96c6('0x4'));var config=require(_0x96c6('0x5'));var attributes=require(_0x96c6('0x6'));module[_0x96c6('0x7')]=function(_0x282d78,_0x1ddd05){return _0x282d78['define'](_0x96c6('0x8'),attributes,{'tableName':_0x96c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index b842f40..37bed41 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 _0xd5b8=['Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x5d8fe7,_0xd030b0){var _0x52687c=function(_0x5e4449){while(--_0x5e4449){_0x5d8fe7['push'](_0x5d8fe7['shift']());}};_0x52687c(++_0xd030b0);}(_0xd5b8,0x171));var _0x8d5b=function(_0x227299,_0x3bf26b){_0x227299=_0x227299-0x0;var _0x4ff857=_0xd5b8[_0x227299];return _0x4ff857;};'use strict';var _=require(_0x8d5b('0x0'));var util=require(_0x8d5b('0x1'));var moment=require('moment');var BPromise=require(_0x8d5b('0x2'));var rs=require(_0x8d5b('0x3'));var fs=require('fs');var Redis=require(_0x8d5b('0x4'));var db=require(_0x8d5b('0x5'))['db'];var utils=require(_0x8d5b('0x6'));var logger=require(_0x8d5b('0x7'))(_0x8d5b('0x8'));var config=require(_0x8d5b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8d5b('0xa')][_0x8d5b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28de7a,_0x5332cc,_0x5df107){return new BPromise(function(_0x406488,_0x11d6e0){return client[_0x8d5b('0xc')](_0x28de7a,_0x5df107)[_0x8d5b('0xd')](function(_0xa78ea){logger[_0x8d5b('0xe')](_0x8d5b('0xf'),_0x5332cc,'request\x20sent');logger[_0x8d5b('0x10')](_0x8d5b('0x11'),_0x5332cc,_0x8d5b('0x12'),JSON[_0x8d5b('0x13')](_0xa78ea));if(_0xa78ea[_0x8d5b('0x14')]){if(_0xa78ea[_0x8d5b('0x14')]['code']===0x1f4){logger[_0x8d5b('0x14')]('Setting,\x20%s,\x20%s',_0x5332cc,_0xa78ea[_0x8d5b('0x14')][_0x8d5b('0x15')]);return _0x11d6e0(_0xa78ea[_0x8d5b('0x14')][_0x8d5b('0x15')]);}logger[_0x8d5b('0x14')]('Setting,\x20%s,\x20%s',_0x5332cc,_0xa78ea['error'][_0x8d5b('0x15')]);return _0x406488(_0xa78ea[_0x8d5b('0x14')]['message']);}else{logger[_0x8d5b('0xe')]('Setting,\x20%s,\x20%s',_0x5332cc,'request\x20sent');_0x406488(_0xa78ea[_0x8d5b('0x16')][_0x8d5b('0x15')]);}})[_0x8d5b('0x17')](function(_0x4a68d2){logger[_0x8d5b('0x14')](_0x8d5b('0xf'),_0x5332cc,_0x4a68d2);_0x11d6e0(_0x4a68d2);});});} \ No newline at end of file +var _0x46b7=['stringify','error','Setting,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x46b7,0x1bd));var _0x746b=function(_0xedc36e,_0x2918c6){_0xedc36e=_0xedc36e-0x0;var _0x4e365e=_0x46b7[_0xedc36e];return _0x4e365e;};'use strict';var _=require(_0x746b('0x0'));var util=require(_0x746b('0x1'));var moment=require(_0x746b('0x2'));var BPromise=require(_0x746b('0x3'));var rs=require(_0x746b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x746b('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x746b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x746b('0x7')][_0x746b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc648df,_0x412af7,_0xb17e36){return new BPromise(function(_0x55bec8,_0x4d801d){return client[_0x746b('0x9')](_0xc648df,_0xb17e36)[_0x746b('0xa')](function(_0x557b31){logger[_0x746b('0xb')]('Setting,\x20%s,\x20%s',_0x412af7,_0x746b('0xc'));logger[_0x746b('0xd')](_0x746b('0xe'),_0x412af7,'request\x20sent',JSON[_0x746b('0xf')](_0x557b31));if(_0x557b31[_0x746b('0x10')]){if(_0x557b31[_0x746b('0x10')]['code']===0x1f4){logger['error'](_0x746b('0x11'),_0x412af7,_0x557b31[_0x746b('0x10')]['message']);return _0x4d801d(_0x557b31['error'][_0x746b('0x12')]);}logger[_0x746b('0x10')](_0x746b('0x11'),_0x412af7,_0x557b31['error'][_0x746b('0x12')]);return _0x55bec8(_0x557b31['error']['message']);}else{logger[_0x746b('0xb')]('Setting,\x20%s,\x20%s',_0x412af7,'request\x20sent');_0x55bec8(_0x557b31['result'][_0x746b('0x12')]);}})[_0x746b('0x13')](function(_0xbdca7d){logger[_0x746b('0x10')]('Setting,\x20%s,\x20%s',_0x412af7,_0xbdca7d);_0x4d801d(_0xbdca7d);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 2771490..864884f 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 _0x3051=['/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','/:id/notify','addApplications','send','addAgents','put','update','destroy','removeDispositions','delete','removeAnswers','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x3051,0x85));var _0x1305=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3051[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1305('0x0'));var express=require(_0x1305('0x1'));var router=express[_0x1305('0x2')]();var auth=require(_0x1305('0x3'));var interaction=require(_0x1305('0x4'));var config=require('../../config/environment');var controller=require(_0x1305('0x5'));router[_0x1305('0x6')]('/',auth[_0x1305('0x7')](),controller[_0x1305('0x8')]);router[_0x1305('0x6')](_0x1305('0x9'),auth[_0x1305('0x7')](),controller[_0x1305('0xa')]);router[_0x1305('0x6')](_0x1305('0xb'),auth[_0x1305('0x7')](),controller[_0x1305('0xc')]);router['get'](_0x1305('0xd'),auth[_0x1305('0x7')](),controller[_0x1305('0xe')]);router[_0x1305('0x6')]('/:id/canned_answers',auth[_0x1305('0x7')](),controller[_0x1305('0xf')]);router['get'](_0x1305('0x10'),auth[_0x1305('0x7')](),controller['getApplications']);router[_0x1305('0x6')](_0x1305('0x11'),auth[_0x1305('0x7')](),controller[_0x1305('0x12')]);router[_0x1305('0x6')](_0x1305('0x13'),controller[_0x1305('0x14')]);router[_0x1305('0x6')](_0x1305('0x15'),auth[_0x1305('0x7')](),controller[_0x1305('0x16')]);router[_0x1305('0x17')]('/',auth[_0x1305('0x7')](),controller[_0x1305('0x18')]);router[_0x1305('0x17')](_0x1305('0xd'),auth[_0x1305('0x7')](),controller[_0x1305('0x19')]);router[_0x1305('0x17')](_0x1305('0x1a'),auth[_0x1305('0x7')](),controller['addAnswer']);router[_0x1305('0x17')](_0x1305('0x1b'),controller['notify']);router[_0x1305('0x17')](_0x1305('0x10'),auth['isAuthenticated'](),controller[_0x1305('0x1c')]);router[_0x1305('0x17')]('/:id/send',auth[_0x1305('0x7')](),controller[_0x1305('0x1d')]);router[_0x1305('0x17')](_0x1305('0x13'),controller['status']);router[_0x1305('0x17')]('/:id/users',auth[_0x1305('0x7')](),controller[_0x1305('0x1e')]);router[_0x1305('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x1305('0x20')]);router['delete'](_0x1305('0xb'),auth['isAuthenticated'](),controller[_0x1305('0x21')]);router['delete']('/:id/dispositions',auth[_0x1305('0x7')](),controller[_0x1305('0x22')]);router[_0x1305('0x23')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x1305('0x24')]);router['delete'](_0x1305('0x15'),auth[_0x1305('0x7')](),controller['removeAgents']);module[_0x1305('0x25')]=router; \ No newline at end of file +var _0x8d8a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','notify','/:id/applications','addApplications','put','update','delete','removeDispositions','removeAnswers','multer','util','express'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x8d8a,0x189));var _0xa8d8=function(_0x483a38,_0x2bf2c6){_0x483a38=_0x483a38-0x0;var _0x5239d2=_0x8d8a[_0x483a38];return _0x5239d2;};'use strict';var multer=require(_0xa8d8('0x0'));var util=require(_0xa8d8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa8d8('0x2'));var router=express[_0xa8d8('0x3')]();var auth=require(_0xa8d8('0x4'));var interaction=require(_0xa8d8('0x5'));var config=require(_0xa8d8('0x6'));var controller=require(_0xa8d8('0x7'));router[_0xa8d8('0x8')]('/',auth[_0xa8d8('0x9')](),controller[_0xa8d8('0xa')]);router['get'](_0xa8d8('0xb'),auth['isAuthenticated'](),controller[_0xa8d8('0xc')]);router[_0xa8d8('0x8')](_0xa8d8('0xd'),auth[_0xa8d8('0x9')](),controller[_0xa8d8('0xe')]);router['get'](_0xa8d8('0xf'),auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x10')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa8d8('0x11')]);router[_0xa8d8('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0xa8d8('0x12')]);router[_0xa8d8('0x8')](_0xa8d8('0x13'),auth[_0xa8d8('0x9')](),controller['getInteractions']);router['get'](_0xa8d8('0x14'),controller[_0xa8d8('0x15')]);router[_0xa8d8('0x8')](_0xa8d8('0x16'),auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x17')]);router[_0xa8d8('0x18')]('/',auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x19')]);router[_0xa8d8('0x18')](_0xa8d8('0xf'),auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x1a')]);router[_0xa8d8('0x18')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xa8d8('0x1b')]);router[_0xa8d8('0x18')]('/:id/notify',controller[_0xa8d8('0x1c')]);router[_0xa8d8('0x18')](_0xa8d8('0x1d'),auth['isAuthenticated'](),controller[_0xa8d8('0x1e')]);router[_0xa8d8('0x18')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0xa8d8('0x18')](_0xa8d8('0x14'),controller['status']);router[_0xa8d8('0x18')](_0xa8d8('0x16'),auth[_0xa8d8('0x9')](),controller['addAgents']);router[_0xa8d8('0x1f')](_0xa8d8('0xd'),auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x20')]);router[_0xa8d8('0x21')](_0xa8d8('0xd'),auth[_0xa8d8('0x9')](),controller['destroy']);router[_0xa8d8('0x21')](_0xa8d8('0xf'),auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x22')]);router[_0xa8d8('0x21')]('/:id/canned_answers',auth[_0xa8d8('0x9')](),controller[_0xa8d8('0x23')]);router[_0xa8d8('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);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 5e39c35..4aca38f 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 _0x5f39=['intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','clickatell','infobip'];(function(_0x1176bd,_0x28190b){var _0x4b82d0=function(_0x1d5c14){while(--_0x1d5c14){_0x1176bd['push'](_0x1176bd['shift']());}};_0x4b82d0(++_0x28190b);}(_0x5f39,0x9b));var _0x95f3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5f39[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x95f3('0x0'));var rs=require(_0x95f3('0x1'));module[_0x95f3('0x2')]={'name':{'type':Sequelize[_0x95f3('0x3')],'unique':_0x95f3('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x95f3('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x95f3('0x5')]();}},'phone':{'type':Sequelize[_0x95f3('0x3')]},'type':{'type':Sequelize[_0x95f3('0x6')](_0x95f3('0x7'),_0x95f3('0x8'),_0x95f3('0x9'),_0x95f3('0xa'),'plivo',_0x95f3('0xb'),'csc',_0x95f3('0xc'),_0x95f3('0xd'))},'accountSid':{'type':Sequelize[_0x95f3('0x3')]},'authId':{'type':Sequelize[_0x95f3('0x3')]},'authToken':{'type':Sequelize[_0x95f3('0x3')]},'smsMethod':{'type':Sequelize[_0x95f3('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x95f3('0x3')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x95f3('0x3')]},'deliveryReport':{'type':Sequelize[_0x95f3('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x95f3('0x3')]},'notificationTemplate':{'type':Sequelize[_0x95f3('0xf')],'defaultValue':function(){return _0x95f3('0x10');}},'notificationSound':{'type':Sequelize[_0x95f3('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x95f3('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x95f3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x95f3('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x95f3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x95f3('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x95f3('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x95f3('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x95f3('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x95f3('0xe')],'defaultValue':![],'comment':_0x95f3('0x12'),'set':function(_0x55bbdc){if(!_0x55bbdc)this[_0x95f3('0x13')](_0x95f3('0x14'),null);this[_0x95f3('0x13')]('mandatoryDisposition',_0x55bbdc);}}}; \ No newline at end of file +var _0x5362=['infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','csc'];(function(_0x426395,_0x140fa0){var _0x6f3597=function(_0x3c0611){while(--_0x3c0611){_0x426395['push'](_0x426395['shift']());}};_0x6f3597(++_0x140fa0);}(_0x5362,0x16d));var _0x2536=function(_0x26d667,_0x18234c){_0x26d667=_0x26d667-0x0;var _0x260928=_0x5362[_0x26d667];return _0x260928;};'use strict';var Sequelize=require(_0x2536('0x0'));var rs=require(_0x2536('0x1'));module[_0x2536('0x2')]={'name':{'type':Sequelize[_0x2536('0x3')],'unique':_0x2536('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x2536('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x2536('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2536('0x3')],'defaultValue':function(){return rs[_0x2536('0x5')]();}},'phone':{'type':Sequelize[_0x2536('0x3')]},'type':{'type':Sequelize[_0x2536('0x6')](_0x2536('0x7'),_0x2536('0x8'),'connectel',_0x2536('0x9'),_0x2536('0xa'),_0x2536('0xb'),_0x2536('0xc'),_0x2536('0xd'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x2536('0x3')]},'authToken':{'type':Sequelize[_0x2536('0x3')]},'smsMethod':{'type':Sequelize[_0x2536('0x6')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x2536('0x3')]},'apiKey':{'type':Sequelize[_0x2536('0x3')]},'senderString':{'type':Sequelize[_0x2536('0x3')]},'deliveryReport':{'type':Sequelize[_0x2536('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x2536('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2536('0xf')],'defaultValue':function(){return _0x2536('0x10');}},'notificationSound':{'type':Sequelize[_0x2536('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2536('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2536('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2536('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2536('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2536('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x2536('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x2536('0xe')],'defaultValue':![],'comment':_0x2536('0x13'),'set':function(_0x893b55){if(!_0x893b55)this[_0x2536('0x14')]('mandatoryDispositionPauseId',null);this[_0x2536('0x14')]('mandatoryDisposition',_0x893b55);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index be1d37c..0292317 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(_0x50ef6a,_0x1407e7){var _0x155d0b=function(_0x2d59b8){while(--_0x2d59b8){_0x50ef6a['push'](_0x50ef6a['shift']());}};_0x155d0b(++_0x1407e7);}(_0x7a54,0x106));var _0x47a5=function(_0x45dfac,_0x498178){_0x45dfac=_0x45dfac-0x0;var _0x59509a=_0x7a54[_0x45dfac];return _0x59509a;};'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(_0x19b386,_0x5b5238){var _0xcf2e1e=function(_0x1ae29f){while(--_0x1ae29f){_0x19b386['push'](_0x19b386['shift']());}};_0xcf2e1e(++_0x5b5238);}(_0x7a54,0x106));var _0x47a5=function(_0x5d5a70,_0x4b0998){_0x5d5a70=_0x5d5a70-0x0;var _0x36f23a=_0x7a54[_0x5d5a70];return _0x36f23a;};'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 912dce4..9211376 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 _0x9e6e=['exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x44a582,_0x2f9173){var _0x26312c=function(_0x55befc){while(--_0x55befc){_0x44a582['push'](_0x44a582['shift']());}};_0x26312c(++_0x2f9173);}(_0x9e6e,0x160));var _0xe9e6=function(_0x57909e,_0x26084f){_0x57909e=_0x57909e-0x0;var _0x21d6cc=_0x9e6e[_0x57909e];return _0x21d6cc;};'use strict';var EventEmitter=require(_0xe9e6('0x0'));var SmsAccount=require(_0xe9e6('0x1'))['db'][_0xe9e6('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe9e6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9e6('0x4'),'afterDestroy':_0xe9e6('0x5')};function emitEvent(_0x446455){return function(_0x4a2f13,_0x13e652,_0x40b467){SmsAccountEvents['emit'](_0x446455+':'+_0x4a2f13['id'],_0x4a2f13);SmsAccountEvents[_0xe9e6('0x6')](_0x446455,_0x4a2f13);_0x40b467(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe9e6('0x7')](e,emitEvent(event));}}module[_0xe9e6('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x9af5=['../../mysqldb','SmsAccount','save','remove','emit','hook','exports','events'];(function(_0x34b5ca,_0x594010){var _0x2d72c0=function(_0x4ae1d3){while(--_0x4ae1d3){_0x34b5ca['push'](_0x34b5ca['shift']());}};_0x2d72c0(++_0x594010);}(_0x9af5,0xa7));var _0x59af=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9af5[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x59af('0x0'));var SmsAccount=require(_0x59af('0x1'))['db'][_0x59af('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x59af('0x3'),'afterUpdate':'update','afterDestroy':_0x59af('0x4')};function emitEvent(_0x73937c){return function(_0x406a3b,_0x21d625,_0x162a86){SmsAccountEvents[_0x59af('0x5')](_0x73937c+':'+_0x406a3b['id'],_0x406a3b);SmsAccountEvents[_0x59af('0x5')](_0x73937c,_0x406a3b);_0x162a86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x59af('0x6')](e,emitEvent(event));}}module[_0x59af('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index fa3f9c7..749c264 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(_0x57b061,_0x210910){var _0x558991=function(_0x225ed9){while(--_0x225ed9){_0x57b061['push'](_0x57b061['shift']());}};_0x558991(++_0x210910);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x3e7eee,_0x476514){var _0xa4485=function(_0x3d3825){while(--_0x3d3825){_0x3e7eee['push'](_0x3e7eee['shift']());}};_0xa4485(++_0x476514);}(_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 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 8cbedff..13c56ed 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 _0xa8cc=['include','map','model','ShowSmsAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsAccount.socket','register','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','SmsAccount,\x20%s,\x20%s','result','catch','find','options','raw','where','attributes'];(function(_0x7acb86,_0x2c146a){var _0x15fa39=function(_0x138d41){while(--_0x138d41){_0x7acb86['push'](_0x7acb86['shift']());}};_0x15fa39(++_0x2c146a);}(_0xa8cc,0x1f2));var _0xca8c=function(_0x46d8ba,_0x36da80){_0x46d8ba=_0x46d8ba-0x0;var _0x3fb559=_0xa8cc[_0x46d8ba];return _0x3fb559;};'use strict';var _=require(_0xca8c('0x0'));var util=require(_0xca8c('0x1'));var moment=require('moment');var BPromise=require(_0xca8c('0x2'));var rs=require(_0xca8c('0x3'));var fs=require('fs');var Redis=require(_0xca8c('0x4'));var db=require(_0xca8c('0x5'))['db'];var utils=require(_0xca8c('0x6'));var logger=require(_0xca8c('0x7'))(_0xca8c('0x8'));var config=require(_0xca8c('0x9'));var jayson=require(_0xca8c('0xa'));var client=jayson[_0xca8c('0xb')][_0xca8c('0xc')]({'port':0x232a});config[_0xca8c('0xd')]=_[_0xca8c('0xe')](config['redis'],{'host':_0xca8c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xca8c('0x10'))[_0xca8c('0x11')](socket);function respondWithRpcPromise(_0x582491,_0x494421,_0x20485c){return new BPromise(function(_0x3c3128,_0x4d0e9e){return client['request'](_0x582491,_0x20485c)[_0xca8c('0x12')](function(_0x3709ce){logger['info']('SmsAccount,\x20%s,\x20%s',_0x494421,_0xca8c('0x13'));logger[_0xca8c('0x14')](_0xca8c('0x15'),_0x494421,_0xca8c('0x13'),JSON[_0xca8c('0x16')](_0x3709ce));if(_0x3709ce[_0xca8c('0x17')]){if(_0x3709ce['error']['code']===0x1f4){logger[_0xca8c('0x17')]('SmsAccount,\x20%s,\x20%s',_0x494421,_0x3709ce[_0xca8c('0x17')][_0xca8c('0x18')]);return _0x4d0e9e(_0x3709ce[_0xca8c('0x17')]['message']);}logger[_0xca8c('0x17')]('SmsAccount,\x20%s,\x20%s',_0x494421,_0x3709ce[_0xca8c('0x17')][_0xca8c('0x18')]);return _0x3c3128(_0x3709ce[_0xca8c('0x17')][_0xca8c('0x18')]);}else{logger[_0xca8c('0x19')](_0xca8c('0x1a'),_0x494421,_0xca8c('0x13'));_0x3c3128(_0x3709ce[_0xca8c('0x1b')][_0xca8c('0x18')]);}})[_0xca8c('0x1c')](function(_0x352755){logger[_0xca8c('0x17')](_0xca8c('0x1a'),_0x494421,_0x352755);_0x4d0e9e(_0x352755);});});}exports['ShowSmsAccount']=function(_0x358c44){var _0x49f3c8=this;return new Promise(function(_0x45c8ae,_0x2509ce){return db['SmsAccount'][_0xca8c('0x1d')]({'raw':_0x358c44[_0xca8c('0x1e')]?_0x358c44['options'][_0xca8c('0x1f')]===undefined?!![]:![]:!![],'where':_0x358c44['options']?_0x358c44['options'][_0xca8c('0x20')]||null:null,'attributes':_0x358c44[_0xca8c('0x1e')]?_0x358c44[_0xca8c('0x1e')][_0xca8c('0x21')]||null:null,'include':_0x358c44['options']?_0x358c44[_0xca8c('0x1e')][_0xca8c('0x22')]?_[_0xca8c('0x23')](_0x358c44[_0xca8c('0x1e')][_0xca8c('0x22')],function(_0x59b5b2){return{'model':db[_0x59b5b2[_0xca8c('0x24')]],'as':_0x59b5b2['as'],'attributes':_0x59b5b2['attributes'],'include':_0x59b5b2['include']?_[_0xca8c('0x23')](_0x59b5b2[_0xca8c('0x22')],function(_0xf4b828){return{'model':db[_0xf4b828[_0xca8c('0x24')]],'as':_0xf4b828['as'],'attributes':_0xf4b828[_0xca8c('0x21')],'include':_0xf4b828[_0xca8c('0x22')]?_[_0xca8c('0x23')](_0xf4b828['include'],function(_0x5b9344){return{'model':db[_0x5b9344[_0xca8c('0x24')]],'as':_0x5b9344['as'],'attributes':_0x5b9344['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ef037){logger[_0xca8c('0x19')](_0xca8c('0x25'),_0x358c44);logger[_0xca8c('0x14')](_0xca8c('0x25'),_0x358c44,JSON[_0xca8c('0x16')](_0x5ef037));_0x45c8ae(_0x5ef037);})[_0xca8c('0x1c')](function(_0x1dd3b2){logger[_0xca8c('0x17')](_0xca8c('0x25'),_0x1dd3b2[_0xca8c('0x18')],_0x358c44);_0x2509ce(_0x49f3c8[_0xca8c('0x17')](0x1f4,_0x1dd3b2[_0xca8c('0x18')]));});});}; \ No newline at end of file +var _0xbc54=['info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','ShowSmsAccount','SmsAccount','options','where','attributes','include','map','model','lodash','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register'];(function(_0x274222,_0x20bb9a){var _0x34a71f=function(_0xd185ee){while(--_0xd185ee){_0x274222['push'](_0x274222['shift']());}};_0x34a71f(++_0x20bb9a);}(_0xbc54,0x79));var _0x4bc5=function(_0x3d8c9b,_0x49e6ea){_0x3d8c9b=_0x3d8c9b-0x0;var _0xc31fc0=_0xbc54[_0x3d8c9b];return _0xc31fc0;};'use strict';var _=require(_0x4bc5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4bc5('0x1'));var rs=require(_0x4bc5('0x2'));var fs=require('fs');var Redis=require(_0x4bc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4bc5('0x4'))(_0x4bc5('0x5'));var config=require('../../config/environment');var jayson=require(_0x4bc5('0x6'));var client=jayson[_0x4bc5('0x7')][_0x4bc5('0x8')]({'port':0x232a});config['redis']=_[_0x4bc5('0x9')](config[_0x4bc5('0xa')],{'host':_0x4bc5('0xb'),'port':0x18eb});var socket=require(_0x4bc5('0xc'))(new Redis(config[_0x4bc5('0xa')]));require(_0x4bc5('0xd'))[_0x4bc5('0xe')](socket);function respondWithRpcPromise(_0x490448,_0x25aa91,_0x1bed49){return new BPromise(function(_0x493106,_0x3c5d2a){return client['request'](_0x490448,_0x1bed49)['then'](function(_0x8d25a7){logger[_0x4bc5('0xf')]('SmsAccount,\x20%s,\x20%s',_0x25aa91,_0x4bc5('0x10'));logger[_0x4bc5('0x11')](_0x4bc5('0x12'),_0x25aa91,_0x4bc5('0x10'),JSON[_0x4bc5('0x13')](_0x8d25a7));if(_0x8d25a7[_0x4bc5('0x14')]){if(_0x8d25a7[_0x4bc5('0x14')][_0x4bc5('0x15')]===0x1f4){logger[_0x4bc5('0x14')](_0x4bc5('0x16'),_0x25aa91,_0x8d25a7[_0x4bc5('0x14')]['message']);return _0x3c5d2a(_0x8d25a7[_0x4bc5('0x14')][_0x4bc5('0x17')]);}logger[_0x4bc5('0x14')](_0x4bc5('0x16'),_0x25aa91,_0x8d25a7[_0x4bc5('0x14')]['message']);return _0x493106(_0x8d25a7['error'][_0x4bc5('0x17')]);}else{logger[_0x4bc5('0xf')](_0x4bc5('0x16'),_0x25aa91,_0x4bc5('0x10'));_0x493106(_0x8d25a7[_0x4bc5('0x18')][_0x4bc5('0x17')]);}})[_0x4bc5('0x19')](function(_0x18fc3d){logger[_0x4bc5('0x14')](_0x4bc5('0x16'),_0x25aa91,_0x18fc3d);_0x3c5d2a(_0x18fc3d);});});}exports[_0x4bc5('0x1a')]=function(_0x44516a){var _0x3194e8=this;return new Promise(function(_0x411454,_0x3c6b7d){return db[_0x4bc5('0x1b')]['find']({'raw':_0x44516a[_0x4bc5('0x1c')]?_0x44516a[_0x4bc5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x44516a[_0x4bc5('0x1c')]?_0x44516a[_0x4bc5('0x1c')][_0x4bc5('0x1d')]||null:null,'attributes':_0x44516a['options']?_0x44516a['options'][_0x4bc5('0x1e')]||null:null,'include':_0x44516a[_0x4bc5('0x1c')]?_0x44516a[_0x4bc5('0x1c')][_0x4bc5('0x1f')]?_[_0x4bc5('0x20')](_0x44516a[_0x4bc5('0x1c')][_0x4bc5('0x1f')],function(_0x210bbf){return{'model':db[_0x210bbf[_0x4bc5('0x21')]],'as':_0x210bbf['as'],'attributes':_0x210bbf['attributes'],'include':_0x210bbf[_0x4bc5('0x1f')]?_['map'](_0x210bbf[_0x4bc5('0x1f')],function(_0x9c4c6d){return{'model':db[_0x9c4c6d[_0x4bc5('0x21')]],'as':_0x9c4c6d['as'],'attributes':_0x9c4c6d[_0x4bc5('0x1e')],'include':_0x9c4c6d['include']?_['map'](_0x9c4c6d[_0x4bc5('0x1f')],function(_0x1398a6){return{'model':db[_0x1398a6['model']],'as':_0x1398a6['as'],'attributes':_0x1398a6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5436f7){logger[_0x4bc5('0xf')](_0x4bc5('0x1a'),_0x44516a);logger[_0x4bc5('0x11')](_0x4bc5('0x1a'),_0x44516a,JSON[_0x4bc5('0x13')](_0x5436f7));_0x411454(_0x5436f7);})[_0x4bc5('0x19')](function(_0x4a7d9f){logger[_0x4bc5('0x14')]('ShowSmsAccount',_0x4a7d9f[_0x4bc5('0x17')],_0x44516a);_0x3c6b7d(_0x3194e8[_0x4bc5('0x14')](0x1f4,_0x4a7d9f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 96d921a..f1b12ac 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 _0x95e0=['remove','emit','removeListener','register','smsAccount:'];(function(_0x20f6bd,_0x5388a2){var _0x2bac41=function(_0x3398fa){while(--_0x3398fa){_0x20f6bd['push'](_0x20f6bd['shift']());}};_0x2bac41(++_0x5388a2);}(_0x95e0,0x163));var _0x095e=function(_0x2f5fea,_0x1d30b1){_0x2f5fea=_0x2f5fea-0x0;var _0x388020=_0x95e0[_0x2f5fea];return _0x388020;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=['save',_0x095e('0x0'),'update'];function createListener(_0x135f18,_0x37b611){return function(_0xf14bad){_0x37b611[_0x095e('0x1')](_0x135f18,_0xf14bad);};}function removeListener(_0x5668ff,_0x2ac786){return function(){SmsAccountEvents[_0x095e('0x2')](_0x5668ff,_0x2ac786);};}exports[_0x095e('0x3')]=function(_0x22a8c8){for(var _0x11f256=0x0,_0x56039e=events['length'];_0x11f256<_0x56039e;_0x11f256++){var _0x5b39e1=events[_0x11f256];var _0x50975c=createListener(_0x095e('0x4')+_0x5b39e1,_0x22a8c8);SmsAccountEvents['on'](_0x5b39e1,_0x50975c);}}; \ No newline at end of file +var _0x0d01=['save','remove','update','emit','removeListener','register','length','./smsAccount.events'];(function(_0x17c8cc,_0x5e5647){var _0x3db4eb=function(_0x2082db){while(--_0x2082db){_0x17c8cc['push'](_0x17c8cc['shift']());}};_0x3db4eb(++_0x5e5647);}(_0x0d01,0x9f));var _0x10d0=function(_0x2177ee,_0x18436c){_0x2177ee=_0x2177ee-0x0;var _0x447615=_0x0d01[_0x2177ee];return _0x447615;};'use strict';var SmsAccountEvents=require(_0x10d0('0x0'));var events=[_0x10d0('0x1'),_0x10d0('0x2'),_0x10d0('0x3')];function createListener(_0x5e3b51,_0x1c1a43){return function(_0x24594b){_0x1c1a43[_0x10d0('0x4')](_0x5e3b51,_0x24594b);};}function removeListener(_0x4e08e3,_0x4f66f5){return function(){SmsAccountEvents[_0x10d0('0x5')](_0x4e08e3,_0x4f66f5);};}exports[_0x10d0('0x6')]=function(_0x4a5e6d){for(var _0x458cca=0x0,_0x3c6343=events[_0x10d0('0x7')];_0x458cca<_0x3c6343;_0x458cca++){var _0x8bed1=events[_0x458cca];var _0x303b53=createListener('smsAccount:'+_0x8bed1,_0x4a5e6d);SmsAccountEvents['on'](_0x8bed1,_0x303b53);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index adc8f3a..a0820b8 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 _0x0323=['./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x452ed3,_0x8a2e28){var _0x170774=function(_0x5581c5){while(--_0x5581c5){_0x452ed3['push'](_0x452ed3['shift']());}};_0x170774(++_0x8a2e28);}(_0x0323,0x99));var _0x3032=function(_0x35c1db,_0xd75c15){_0x35c1db=_0x35c1db-0x0;var _0x4173ff=_0x0323[_0x35c1db];return _0x4173ff;};'use strict';var multer=require(_0x3032('0x0'));var util=require(_0x3032('0x1'));var path=require(_0x3032('0x2'));var timeout=require(_0x3032('0x3'));var express=require(_0x3032('0x4'));var router=express['Router']();var auth=require(_0x3032('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3032('0x6'));var controller=require(_0x3032('0x7'));router[_0x3032('0x8')]('/',auth[_0x3032('0x9')](),controller[_0x3032('0xa')]);router[_0x3032('0x8')](_0x3032('0xb'),auth[_0x3032('0x9')](),controller[_0x3032('0xc')]);router[_0x3032('0xd')]('/',auth[_0x3032('0x9')](),controller[_0x3032('0xe')]);router[_0x3032('0xf')](_0x3032('0xb'),auth[_0x3032('0x9')](),controller[_0x3032('0x10')]);router[_0x3032('0x11')](_0x3032('0xb'),auth['isAuthenticated'](),controller[_0x3032('0x12')]);module[_0x3032('0x13')]=router; \ No newline at end of file +var _0xf53d=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x3544c8,_0x3449b1){var _0x306613=function(_0x45059f){while(--_0x45059f){_0x3544c8['push'](_0x3544c8['shift']());}};_0x306613(++_0x3449b1);}(_0xf53d,0x178));var _0xdf53=function(_0x5c16b8,_0x3b9c70){_0x5c16b8=_0x5c16b8-0x0;var _0x34a8de=_0xf53d[_0x5c16b8];return _0x34a8de;};'use strict';var multer=require(_0xdf53('0x0'));var util=require(_0xdf53('0x1'));var path=require(_0xdf53('0x2'));var timeout=require(_0xdf53('0x3'));var express=require(_0xdf53('0x4'));var router=express[_0xdf53('0x5')]();var auth=require(_0xdf53('0x6'));var interaction=require(_0xdf53('0x7'));var config=require(_0xdf53('0x8'));var controller=require('./smsApplication.controller');router[_0xdf53('0x9')]('/',auth[_0xdf53('0xa')](),controller[_0xdf53('0xb')]);router[_0xdf53('0x9')](_0xdf53('0xc'),auth[_0xdf53('0xa')](),controller[_0xdf53('0xd')]);router[_0xdf53('0xe')]('/',auth['isAuthenticated'](),controller[_0xdf53('0xf')]);router[_0xdf53('0x10')](_0xdf53('0xc'),auth[_0xdf53('0xa')](),controller[_0xdf53('0x11')]);router[_0xdf53('0x12')]('/:id',auth[_0xdf53('0xa')](),controller[_0xdf53('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index b870659..8236d1a 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 _0xe080=['sequelize','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4d5d3c,_0x3ebac3){var _0x376188=function(_0x3b4200){while(--_0x3b4200){_0x4d5d3c['push'](_0x4d5d3c['shift']());}};_0x376188(++_0x3ebac3);}(_0xe080,0x90));var _0x0e08=function(_0x30491c,_0x33035f){_0x30491c=_0x30491c-0x0;var _0x15b19c=_0xe080[_0x30491c];return _0x15b19c;};'use strict';var Sequelize=require(_0x0e08('0x0'));module['exports']={'priority':{'type':Sequelize[_0x0e08('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0e08('0x2')},'appdata':{'type':Sequelize[_0x0e08('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0e08('0x4')],'defaultValue':_0x0e08('0x5')}}; \ No newline at end of file +var _0x5b7b=['STRING','noop','TEXT','*,*,*,*','INTEGER'];(function(_0x3e1a10,_0x6aeaf2){var _0x2fb8ee=function(_0x473aa3){while(--_0x473aa3){_0x3e1a10['push'](_0x3e1a10['shift']());}};_0x2fb8ee(++_0x6aeaf2);}(_0x5b7b,0x1d0));var _0xb5b7=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0x5b7b[_0x58ee19];return _0x49af25;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xb5b7('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xb5b7('0x1')],'allowNull':![],'defaultValue':_0xb5b7('0x2')},'appdata':{'type':Sequelize[_0xb5b7('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb5b7('0x1')],'defaultValue':_0xb5b7('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index de435af..2ad35b1 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 _0xaebd=['VIRTUAL','merge','SmsApplication','includeAll','findAll','rows','catch','include','options','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2c1eb8,_0x14d162){var _0x321103=function(_0x59e7ea){while(--_0x59e7ea){_0x2c1eb8['push'](_0x2c1eb8['shift']());}};_0x321103(++_0x14d162);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x4200e3,_0xb34e23){_0x4200e3=_0x4200e3-0x0;var _0x26ac37=_0xaebd[_0x4200e3];return _0x26ac37;};'use strict';var pdf=require(_0xdaeb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdaeb('0x1'));var zipdir=require(_0xdaeb('0x2'));var jsonpatch=require(_0xdaeb('0x3'));var rp=require(_0xdaeb('0x4'));var moment=require(_0xdaeb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdaeb('0x6'));var util=require(_0xdaeb('0x7'));var path=require(_0xdaeb('0x8'));var sox=require(_0xdaeb('0x9'));var csv=require(_0xdaeb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdaeb('0xb'));var squel=require(_0xdaeb('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdaeb('0xd'));var toCsv=require(_0xdaeb('0xa'));var querystring=require(_0xdaeb('0xe'));var Papa=require('papaparse');var Redis=require(_0xdaeb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdaeb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdaeb('0x11'));var logger=require('../../config/logger')(_0xdaeb('0x12'));var utils=require(_0xdaeb('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29a4bd,_0x5aedaa){_0x5aedaa=_0x5aedaa||0xcc;return function(_0x4ee3cc){if(_0x4ee3cc){return _0x29a4bd[_0xdaeb('0x14')](_0x5aedaa);}return _0x29a4bd[_0xdaeb('0x15')](_0x5aedaa)[_0xdaeb('0x16')]();};}function respondWithResult(_0x1ca86d,_0x1f31be){_0x1f31be=_0x1f31be||0xc8;return function(_0xc6c611){if(_0xc6c611){return _0x1ca86d['status'](_0x1f31be)['json'](_0xc6c611);}};}function respondWithFilteredResult(_0x96371f,_0x306bdb){return function(_0x34b2fe){if(_0x34b2fe){var _0x18ec4e=_0x34b2fe['count'],_0x538a25=_0x306bdb['offset'],_0x4c3bf3=_0x306bdb[_0xdaeb('0x17')]+_0x306bdb[_0xdaeb('0x18')],_0x24b898;if(_0x4c3bf3>=_0x18ec4e){_0x4c3bf3=_0x18ec4e;_0x24b898=0xc8;}else{_0x24b898=0xce;}_0x96371f[_0xdaeb('0x15')](_0x24b898);return _0x96371f[_0xdaeb('0x19')](_0xdaeb('0x1a'),_0x538a25+'-'+_0x4c3bf3+'/'+_0x18ec4e)[_0xdaeb('0x1b')](_0x34b2fe);}return null;};}function patchUpdates(_0x501f77){return function(_0x22089c){try{jsonpatch['apply'](_0x22089c,_0x501f77,!![]);}catch(_0x16d5e3){return BPromise[_0xdaeb('0x1c')](_0x16d5e3);}return _0x22089c[_0xdaeb('0x1d')]();};}function saveUpdates(_0x5360ce,_0x4e97e0){return function(_0x13563c){if(_0x13563c){return _0x13563c[_0xdaeb('0x1e')](_0x5360ce)[_0xdaeb('0x1f')](function(_0x236ccb){return _0x236ccb;});}return null;};}function removeEntity(_0xc274f8,_0x536aae){return function(_0x597bb7){if(_0x597bb7){return _0x597bb7[_0xdaeb('0x20')]()[_0xdaeb('0x1f')](function(){_0xc274f8[_0xdaeb('0x15')](0xcc)[_0xdaeb('0x16')]();});}};}function handleEntityNotFound(_0x39dfae,_0x55c825){return function(_0x254c3b){if(!_0x254c3b){_0x39dfae['sendStatus'](0x194);}return _0x254c3b;};}function handleError(_0x130c35,_0x398616){_0x398616=_0x398616||0x1f4;return function(_0x451101){logger[_0xdaeb('0x21')](_0x451101[_0xdaeb('0x22')]);if(_0x451101['name']){delete _0x451101[_0xdaeb('0x23')];}_0x130c35[_0xdaeb('0x15')](_0x398616)[_0xdaeb('0x24')](_0x451101);};}exports['index']=function(_0x57c2c4,_0x43095f){var _0x4e7f44={},_0x5045f8={},_0x16cee7={'count':0x0,'rows':[]};var _0x1ff9af=_[_0xdaeb('0x25')](db['SmsApplication']['rawAttributes'],function(_0x32966f){return{'name':_0x32966f[_0xdaeb('0x26')],'type':_0x32966f[_0xdaeb('0x27')]['key']};});_0x5045f8[_0xdaeb('0x28')]=_['map'](_0x1ff9af,'name');_0x5045f8[_0xdaeb('0x29')]=_[_0xdaeb('0x2a')](_0x57c2c4[_0xdaeb('0x29')]);_0x5045f8[_0xdaeb('0x2b')]=_[_0xdaeb('0x2c')](_0x5045f8[_0xdaeb('0x28')],_0x5045f8[_0xdaeb('0x29')]);_0x4e7f44['attributes']=_[_0xdaeb('0x2c')](_0x5045f8[_0xdaeb('0x28')],qs[_0xdaeb('0x2d')](_0x57c2c4[_0xdaeb('0x29')][_0xdaeb('0x2d')]));_0x4e7f44['attributes']=_0x4e7f44[_0xdaeb('0x2e')][_0xdaeb('0x2f')]?_0x4e7f44['attributes']:_0x5045f8[_0xdaeb('0x28')];if(!_0x57c2c4[_0xdaeb('0x29')][_0xdaeb('0x30')](_0xdaeb('0x31'))){_0x4e7f44[_0xdaeb('0x18')]=qs[_0xdaeb('0x18')](_0x57c2c4[_0xdaeb('0x29')][_0xdaeb('0x18')]);_0x4e7f44[_0xdaeb('0x17')]=qs[_0xdaeb('0x17')](_0x57c2c4['query']['offset']);}_0x4e7f44[_0xdaeb('0x32')]=qs['sort'](_0x57c2c4[_0xdaeb('0x29')][_0xdaeb('0x33')]);_0x4e7f44[_0xdaeb('0x34')]=qs[_0xdaeb('0x2b')](_[_0xdaeb('0x35')](_0x57c2c4[_0xdaeb('0x29')],_0x5045f8['filters']),_0x1ff9af);if(_0x57c2c4[_0xdaeb('0x29')][_0xdaeb('0x36')]){_0x4e7f44[_0xdaeb('0x34')]=_['merge'](_0x4e7f44[_0xdaeb('0x34')],{'$or':_[_0xdaeb('0x25')](_0x1ff9af,function(_0x30080b){if(_0x30080b[_0xdaeb('0x27')]!==_0xdaeb('0x37')){var _0x168bd5={};_0x168bd5[_0x30080b[_0xdaeb('0x23')]]={'$like':'%'+_0x57c2c4['query'][_0xdaeb('0x36')]+'%'};return _0x168bd5;}})});}_0x4e7f44=_[_0xdaeb('0x38')]({},_0x4e7f44,_0x57c2c4['options']);var _0x50c6db={'where':_0x4e7f44[_0xdaeb('0x34')]};return db[_0xdaeb('0x39')]['count'](_0x50c6db)[_0xdaeb('0x1f')](function(_0x2e46fb){_0x16cee7['count']=_0x2e46fb;if(_0x57c2c4[_0xdaeb('0x29')][_0xdaeb('0x3a')]){_0x4e7f44['include']=[{'all':!![]}];}return db['SmsApplication'][_0xdaeb('0x3b')](_0x4e7f44);})[_0xdaeb('0x1f')](function(_0x157c06){_0x16cee7[_0xdaeb('0x3c')]=_0x157c06;return _0x16cee7;})[_0xdaeb('0x1f')](respondWithFilteredResult(_0x43095f,_0x4e7f44))[_0xdaeb('0x3d')](handleError(_0x43095f,null));};exports['show']=function(_0x2091b1,_0x4f5745){var _0x46aa44={'raw':!![],'where':{'id':_0x2091b1['params']['id']}},_0x5c0817={};_0x5c0817[_0xdaeb('0x28')]=_['keys'](db[_0xdaeb('0x39')]['rawAttributes']);_0x5c0817[_0xdaeb('0x29')]=_[_0xdaeb('0x2a')](_0x2091b1[_0xdaeb('0x29')]);_0x5c0817[_0xdaeb('0x2b')]=_['intersection'](_0x5c0817[_0xdaeb('0x28')],_0x5c0817['query']);_0x46aa44[_0xdaeb('0x2e')]=_[_0xdaeb('0x2c')](_0x5c0817[_0xdaeb('0x28')],qs['fields'](_0x2091b1[_0xdaeb('0x29')][_0xdaeb('0x2d')]));_0x46aa44[_0xdaeb('0x2e')]=_0x46aa44[_0xdaeb('0x2e')][_0xdaeb('0x2f')]?_0x46aa44[_0xdaeb('0x2e')]:_0x5c0817[_0xdaeb('0x28')];if(_0x2091b1[_0xdaeb('0x29')][_0xdaeb('0x3a')]){_0x46aa44[_0xdaeb('0x3e')]=[{'all':!![]}];}_0x46aa44=_[_0xdaeb('0x38')]({},_0x46aa44,_0x2091b1[_0xdaeb('0x3f')]);return db['SmsApplication'][_0xdaeb('0x40')](_0x46aa44)[_0xdaeb('0x1f')](handleEntityNotFound(_0x4f5745,null))['then'](respondWithResult(_0x4f5745,null))['catch'](handleError(_0x4f5745,null));};exports[_0xdaeb('0x41')]=function(_0x2b4a3e,_0x3fa2fe){return db['SmsApplication'][_0xdaeb('0x41')](_0x2b4a3e[_0xdaeb('0x42')],{})[_0xdaeb('0x1f')](respondWithResult(_0x3fa2fe,0xc9))[_0xdaeb('0x3d')](handleError(_0x3fa2fe,null));};exports[_0xdaeb('0x1e')]=function(_0x45344b,_0x27870b){if(_0x45344b[_0xdaeb('0x42')]['id']){delete _0x45344b['body']['id'];}return db[_0xdaeb('0x39')][_0xdaeb('0x40')]({'where':{'id':_0x45344b['params']['id']}})[_0xdaeb('0x1f')](handleEntityNotFound(_0x27870b,null))['then'](saveUpdates(_0x45344b[_0xdaeb('0x42')],null))[_0xdaeb('0x1f')](respondWithResult(_0x27870b,null))[_0xdaeb('0x3d')](handleError(_0x27870b,null));};exports[_0xdaeb('0x20')]=function(_0x5df403,_0x449f64){return db[_0xdaeb('0x39')][_0xdaeb('0x40')]({'where':{'id':_0x5df403[_0xdaeb('0x43')]['id']}})['then'](handleEntityNotFound(_0x449f64,null))['then'](removeEntity(_0x449f64,null))[_0xdaeb('0x3d')](handleError(_0x449f64,null));}; \ No newline at end of file +var _0x373d=['to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x37ac17,_0x1a440c){var _0x15f938=function(_0x456153){while(--_0x456153){_0x37ac17['push'](_0x37ac17['shift']());}};_0x15f938(++_0x1a440c);}(_0x373d,0x1e2));var _0xd373=function(_0xf937d7,_0x59d955){_0xf937d7=_0xf937d7-0x0;var _0x39edc8=_0x373d[_0xf937d7];return _0x39edc8;};'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'];function respondWithStatusCode(_0x53ec4d,_0x4c7f91){_0x4c7f91=_0x4c7f91||0xcc;return function(_0x5ab89c){if(_0x5ab89c){return _0x53ec4d[_0xd373('0x15')](_0x4c7f91);}return _0x53ec4d[_0xd373('0x16')](_0x4c7f91)['end']();};}function respondWithResult(_0x32e0e4,_0x129475){_0x129475=_0x129475||0xc8;return function(_0x27c161){if(_0x27c161){return _0x32e0e4[_0xd373('0x16')](_0x129475)[_0xd373('0x17')](_0x27c161);}};}function respondWithFilteredResult(_0x1a9df9,_0x20aca5){return function(_0x2eacb1){if(_0x2eacb1){var _0x5a286a=_0x2eacb1[_0xd373('0x18')],_0x2c5854=_0x20aca5['offset'],_0x3a5316=_0x20aca5[_0xd373('0x19')]+_0x20aca5['limit'],_0x263ae3;if(_0x3a5316>=_0x5a286a){_0x3a5316=_0x5a286a;_0x263ae3=0xc8;}else{_0x263ae3=0xce;}_0x1a9df9[_0xd373('0x16')](_0x263ae3);return _0x1a9df9[_0xd373('0x1a')]('Content-Range',_0x2c5854+'-'+_0x3a5316+'/'+_0x5a286a)[_0xd373('0x17')](_0x2eacb1);}return null;};}function patchUpdates(_0x4f5366){return function(_0x4d7d72){try{jsonpatch[_0xd373('0x1b')](_0x4d7d72,_0x4f5366,!![]);}catch(_0x186fdd){return BPromise[_0xd373('0x1c')](_0x186fdd);}return _0x4d7d72[_0xd373('0x1d')]();};}function saveUpdates(_0x16b147,_0x181eb2){return function(_0x4ba510){if(_0x4ba510){return _0x4ba510[_0xd373('0x1e')](_0x16b147)[_0xd373('0x1f')](function(_0x1378a0){return _0x1378a0;});}return null;};}function removeEntity(_0x3a4d15,_0x165e21){return function(_0x3aa1c5){if(_0x3aa1c5){return _0x3aa1c5['destroy']()[_0xd373('0x1f')](function(){_0x3a4d15[_0xd373('0x16')](0xcc)[_0xd373('0x20')]();});}};}function handleEntityNotFound(_0x209ca7,_0x217ee7){return function(_0x238ffd){if(!_0x238ffd){_0x209ca7[_0xd373('0x15')](0x194);}return _0x238ffd;};}function handleError(_0x109e4c,_0x1ab540){_0x1ab540=_0x1ab540||0x1f4;return function(_0x1bf642){logger[_0xd373('0x21')](_0x1bf642[_0xd373('0x22')]);if(_0x1bf642[_0xd373('0x23')]){delete _0x1bf642[_0xd373('0x23')];}_0x109e4c[_0xd373('0x16')](_0x1ab540)[_0xd373('0x24')](_0x1bf642);};}exports[_0xd373('0x25')]=function(_0x13a012,_0x3e657b){var _0x470612={},_0x45ee58={},_0x3ad8c={'count':0x0,'rows':[]};var _0x71c5c=_[_0xd373('0x26')](db[_0xd373('0x27')][_0xd373('0x28')],function(_0x158825){return{'name':_0x158825[_0xd373('0x29')],'type':_0x158825[_0xd373('0x2a')][_0xd373('0x2b')]};});_0x45ee58['model']=_[_0xd373('0x26')](_0x71c5c,'name');_0x45ee58['query']=_[_0xd373('0x2c')](_0x13a012[_0xd373('0x2d')]);_0x45ee58[_0xd373('0x2e')]=_[_0xd373('0x2f')](_0x45ee58[_0xd373('0x30')],_0x45ee58['query']);_0x470612[_0xd373('0x31')]=_[_0xd373('0x2f')](_0x45ee58['model'],qs[_0xd373('0x32')](_0x13a012[_0xd373('0x2d')][_0xd373('0x32')]));_0x470612[_0xd373('0x31')]=_0x470612[_0xd373('0x31')][_0xd373('0x33')]?_0x470612[_0xd373('0x31')]:_0x45ee58[_0xd373('0x30')];if(!_0x13a012[_0xd373('0x2d')]['hasOwnProperty'](_0xd373('0x34'))){_0x470612[_0xd373('0x35')]=qs[_0xd373('0x35')](_0x13a012[_0xd373('0x2d')][_0xd373('0x35')]);_0x470612[_0xd373('0x19')]=qs[_0xd373('0x19')](_0x13a012[_0xd373('0x2d')][_0xd373('0x19')]);}_0x470612[_0xd373('0x36')]=qs[_0xd373('0x37')](_0x13a012[_0xd373('0x2d')][_0xd373('0x37')]);_0x470612[_0xd373('0x38')]=qs[_0xd373('0x2e')](_['pick'](_0x13a012[_0xd373('0x2d')],_0x45ee58[_0xd373('0x2e')]),_0x71c5c);if(_0x13a012[_0xd373('0x2d')][_0xd373('0x39')]){_0x470612['where']=_[_0xd373('0x3a')](_0x470612[_0xd373('0x38')],{'$or':_[_0xd373('0x26')](_0x71c5c,function(_0x3af9f7){if(_0x3af9f7[_0xd373('0x2a')]!==_0xd373('0x3b')){var _0x4aab80={};_0x4aab80[_0x3af9f7['name']]={'$like':'%'+_0x13a012[_0xd373('0x2d')]['filter']+'%'};return _0x4aab80;}})});}_0x470612=_[_0xd373('0x3a')]({},_0x470612,_0x13a012[_0xd373('0x3c')]);var _0x1d9b7a={'where':_0x470612['where']};return db[_0xd373('0x27')][_0xd373('0x18')](_0x1d9b7a)[_0xd373('0x1f')](function(_0x2a691a){_0x3ad8c['count']=_0x2a691a;if(_0x13a012['query']['includeAll']){_0x470612[_0xd373('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0xd373('0x3e')](_0x470612);})[_0xd373('0x1f')](function(_0x4e5e80){_0x3ad8c['rows']=_0x4e5e80;return _0x3ad8c;})['then'](respondWithFilteredResult(_0x3e657b,_0x470612))[_0xd373('0x3f')](handleError(_0x3e657b,null));};exports[_0xd373('0x40')]=function(_0x107e2f,_0x501f8b){var _0x5c3b22={'raw':!![],'where':{'id':_0x107e2f[_0xd373('0x41')]['id']}},_0xb87e16={};_0xb87e16['model']=_[_0xd373('0x2c')](db[_0xd373('0x27')][_0xd373('0x28')]);_0xb87e16[_0xd373('0x2d')]=_[_0xd373('0x2c')](_0x107e2f['query']);_0xb87e16['filters']=_[_0xd373('0x2f')](_0xb87e16[_0xd373('0x30')],_0xb87e16[_0xd373('0x2d')]);_0x5c3b22[_0xd373('0x31')]=_['intersection'](_0xb87e16[_0xd373('0x30')],qs['fields'](_0x107e2f[_0xd373('0x2d')][_0xd373('0x32')]));_0x5c3b22[_0xd373('0x31')]=_0x5c3b22[_0xd373('0x31')][_0xd373('0x33')]?_0x5c3b22['attributes']:_0xb87e16[_0xd373('0x30')];if(_0x107e2f[_0xd373('0x2d')]['includeAll']){_0x5c3b22[_0xd373('0x3d')]=[{'all':!![]}];}_0x5c3b22=_[_0xd373('0x3a')]({},_0x5c3b22,_0x107e2f[_0xd373('0x3c')]);return db[_0xd373('0x27')][_0xd373('0x42')](_0x5c3b22)[_0xd373('0x1f')](handleEntityNotFound(_0x501f8b,null))[_0xd373('0x1f')](respondWithResult(_0x501f8b,null))[_0xd373('0x3f')](handleError(_0x501f8b,null));};exports[_0xd373('0x43')]=function(_0xfcedb3,_0x5d759f){return db['SmsApplication'][_0xd373('0x43')](_0xfcedb3['body'],{})[_0xd373('0x1f')](respondWithResult(_0x5d759f,0xc9))['catch'](handleError(_0x5d759f,null));};exports['update']=function(_0x5cbc16,_0x280598){if(_0x5cbc16[_0xd373('0x44')]['id']){delete _0x5cbc16[_0xd373('0x44')]['id'];}return db[_0xd373('0x27')][_0xd373('0x42')]({'where':{'id':_0x5cbc16[_0xd373('0x41')]['id']}})[_0xd373('0x1f')](handleEntityNotFound(_0x280598,null))['then'](saveUpdates(_0x5cbc16[_0xd373('0x44')],null))['then'](respondWithResult(_0x280598,null))[_0xd373('0x3f')](handleError(_0x280598,null));};exports[_0xd373('0x45')]=function(_0x5502e5,_0x4517ab){return db['SmsApplication'][_0xd373('0x42')]({'where':{'id':_0x5502e5[_0xd373('0x41')]['id']}})[_0xd373('0x1f')](handleEntityNotFound(_0x4517ab,null))[_0xd373('0x1f')](removeEntity(_0x4517ab,null))[_0xd373('0x3f')](handleError(_0x4517ab,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2b62e85..0320dbe 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 _0xfd6c=['lodash','util','api','bluebird','request-promise','path','rimraf','./smsApplication.attributes','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1bb889,_0x49c4b5){var _0xd8b76d=function(_0x1df471){while(--_0x1df471){_0x1bb889['push'](_0x1bb889['shift']());}};_0xd8b76d(++_0x49c4b5);}(_0xfd6c,0x1e0));var _0xcfd6=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xfd6c[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0xcfd6('0x0'));var util=require(_0xcfd6('0x1'));var logger=require('../../config/logger')(_0xcfd6('0x2'));var moment=require('moment');var BPromise=require(_0xcfd6('0x3'));var rp=require(_0xcfd6('0x4'));var fs=require('fs');var path=require(_0xcfd6('0x5'));var rimraf=require(_0xcfd6('0x6'));var config=require('../../config/environment');var attributes=require(_0xcfd6('0x7'));module['exports']=function(_0x500993,_0x2c85e4){return _0x500993[_0xcfd6('0x8')](_0xcfd6('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcfd6('0xa'),'collate':_0xcfd6('0xb')});}; \ No newline at end of file +var _0x651f=['lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','exports','SmsApplication','sms_applications','utf8mb4'];(function(_0xf44627,_0x3a000e){var _0x1e95b3=function(_0x5579e2){while(--_0x5579e2){_0xf44627['push'](_0xf44627['shift']());}};_0x1e95b3(++_0x3a000e);}(_0x651f,0x8f));var _0xf651=function(_0x17be9f,_0x9d0264){_0x17be9f=_0x17be9f-0x0;var _0x5795db=_0x651f[_0x17be9f];return _0x5795db;};'use strict';var _=require(_0xf651('0x0'));var util=require(_0xf651('0x1'));var logger=require(_0xf651('0x2'))(_0xf651('0x3'));var moment=require(_0xf651('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf651('0x5'));var config=require(_0xf651('0x6'));var attributes=require('./smsApplication.attributes');module[_0xf651('0x7')]=function(_0x136726,_0x31d40e){return _0x136726['define'](_0xf651('0x8'),attributes,{'tableName':_0xf651('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf651('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 82c6a43..44be0c8 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 _0xfdb3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','bluebird','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdb3,0x10c));var _0x3fdb=function(_0xd9b743,_0x56a449){_0xd9b743=_0xd9b743-0x0;var _0x4aa02b=_0xfdb3[_0xd9b743];return _0x4aa02b;};'use strict';var _=require(_0x3fdb('0x0'));var util=require(_0x3fdb('0x1'));var moment=require('moment');var BPromise=require(_0x3fdb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3fdb('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fdb('0x4'))(_0x3fdb('0x5'));var config=require(_0x3fdb('0x6'));var jayson=require(_0x3fdb('0x7'));var client=jayson[_0x3fdb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3433d8,_0x4fe9c,_0x102a21){return new BPromise(function(_0x53f026,_0x262e8a){return client['request'](_0x3433d8,_0x102a21)[_0x3fdb('0x9')](function(_0x23346f){logger[_0x3fdb('0xa')](_0x3fdb('0xb'),_0x4fe9c,_0x3fdb('0xc'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x4fe9c,'request\x20sent',JSON['stringify'](_0x23346f));if(_0x23346f[_0x3fdb('0xd')]){if(_0x23346f[_0x3fdb('0xd')][_0x3fdb('0xe')]===0x1f4){logger[_0x3fdb('0xd')](_0x3fdb('0xb'),_0x4fe9c,_0x23346f[_0x3fdb('0xd')][_0x3fdb('0xf')]);return _0x262e8a(_0x23346f[_0x3fdb('0xd')][_0x3fdb('0xf')]);}logger[_0x3fdb('0xd')]('SmsApplication,\x20%s,\x20%s',_0x4fe9c,_0x23346f[_0x3fdb('0xd')][_0x3fdb('0xf')]);return _0x53f026(_0x23346f['error'][_0x3fdb('0xf')]);}else{logger[_0x3fdb('0xa')](_0x3fdb('0xb'),_0x4fe9c,_0x3fdb('0xc'));_0x53f026(_0x23346f['result']['message']);}})['catch'](function(_0x193aed){logger[_0x3fdb('0xd')](_0x3fdb('0xb'),_0x4fe9c,_0x193aed);_0x262e8a(_0x193aed);});});} \ No newline at end of file +var _0x3663=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','SmsApplication,\x20%s,\x20%s','message','result'];(function(_0x84fce1,_0x33fcc4){var _0x170dbf=function(_0x32b70b){while(--_0x32b70b){_0x84fce1['push'](_0x84fce1['shift']());}};_0x170dbf(++_0x33fcc4);}(_0x3663,0x1cf));var _0x3366=function(_0x310926,_0x226e01){_0x310926=_0x310926-0x0;var _0x205927=_0x3663[_0x310926];return _0x205927;};'use strict';var _=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var moment=require(_0x3366('0x2'));var BPromise=require('bluebird');var rs=require(_0x3366('0x3'));var fs=require('fs');var Redis=require(_0x3366('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3366('0x5'));var logger=require(_0x3366('0x6'))(_0x3366('0x7'));var config=require(_0x3366('0x8'));var jayson=require(_0x3366('0x9'));var client=jayson['client'][_0x3366('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348f53,_0x4c734f,_0x5c10c1){return new BPromise(function(_0x1d802b,_0x304f68){return client['request'](_0x348f53,_0x5c10c1)[_0x3366('0xb')](function(_0x2a681e){logger[_0x3366('0xc')]('SmsApplication,\x20%s,\x20%s',_0x4c734f,_0x3366('0xd'));logger[_0x3366('0xe')](_0x3366('0xf'),_0x4c734f,_0x3366('0xd'),JSON[_0x3366('0x10')](_0x2a681e));if(_0x2a681e[_0x3366('0x11')]){if(_0x2a681e[_0x3366('0x11')]['code']===0x1f4){logger['error'](_0x3366('0x12'),_0x4c734f,_0x2a681e[_0x3366('0x11')][_0x3366('0x13')]);return _0x304f68(_0x2a681e[_0x3366('0x11')][_0x3366('0x13')]);}logger[_0x3366('0x11')]('SmsApplication,\x20%s,\x20%s',_0x4c734f,_0x2a681e['error'][_0x3366('0x13')]);return _0x1d802b(_0x2a681e['error'][_0x3366('0x13')]);}else{logger[_0x3366('0xc')](_0x3366('0x12'),_0x4c734f,_0x3366('0xd'));_0x1d802b(_0x2a681e[_0x3366('0x14')]['message']);}})[_0x3366('0x15')](function(_0x14139a){logger[_0x3366('0x11')](_0x3366('0x12'),_0x4c734f,_0x14139a);_0x304f68(_0x14139a);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index e5770f3..b1f5f40 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 _0x5ed9=['Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','download','post','create','addMessage','tracked','sms','smsinteraction:addtags','put','update','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','connect-timeout','express'];(function(_0x101ccf,_0x37e172){var _0x99b0f1=function(_0x4111c8){while(--_0x4111c8){_0x101ccf['push'](_0x101ccf['shift']());}};_0x99b0f1(++_0x37e172);}(_0x5ed9,0x1e9));var _0x95ed=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5ed9[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var path=require('path');var timeout=require(_0x95ed('0x2'));var express=require(_0x95ed('0x3'));var router=express[_0x95ed('0x4')]();var auth=require(_0x95ed('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x95ed('0x6'));var controller=require(_0x95ed('0x7'));router[_0x95ed('0x8')]('/',auth['isAuthenticated'](),controller[_0x95ed('0x9')]);router['get'](_0x95ed('0xa'),auth[_0x95ed('0xb')](),controller[_0x95ed('0xc')]);router[_0x95ed('0x8')](_0x95ed('0xd'),auth[_0x95ed('0xb')](),controller['show']);router[_0x95ed('0x8')](_0x95ed('0xe'),auth[_0x95ed('0xb')](),controller['getMessages']);router[_0x95ed('0x8')]('/:id/download',auth[_0x95ed('0xb')](),controller[_0x95ed('0xf')]);router[_0x95ed('0x10')]('/',auth[_0x95ed('0xb')](),controller[_0x95ed('0x11')]);router['post']('/:id/messages',auth[_0x95ed('0xb')](),controller[_0x95ed('0x12')]);router['post']('/:id/tags',auth[_0x95ed('0xb')](),interaction[_0x95ed('0x13')](_0x95ed('0x14'),_0x95ed('0x15')),controller['addTags']);router[_0x95ed('0x16')](_0x95ed('0xd'),auth[_0x95ed('0xb')](),interaction[_0x95ed('0x13')](_0x95ed('0x14'),'smsinteraction:update'),controller[_0x95ed('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x95ed('0x13')]('sms',_0x95ed('0x18')),controller[_0x95ed('0x19')]);router['delete'](_0x95ed('0x1a'),auth[_0x95ed('0xb')](),controller[_0x95ed('0x1b')]);module[_0x95ed('0x1c')]=router; \ No newline at end of file +var _0xb016=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','describe','show','/:id/messages','getMessages','download','post','create','/:id/tags','tracked','put','sms','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','express'];(function(_0x2ced3b,_0xe131cf){var _0xed9aed=function(_0x5db1d0){while(--_0x5db1d0){_0x2ced3b['push'](_0x2ced3b['shift']());}};_0xed9aed(++_0xe131cf);}(_0xb016,0x159));var _0x6b01=function(_0x379041,_0x3d3d35){_0x379041=_0x379041-0x0;var _0x1e9e28=_0xb016[_0x379041];return _0x1e9e28;};'use strict';var multer=require(_0x6b01('0x0'));var util=require(_0x6b01('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6b01('0x2'));var router=express['Router']();var auth=require(_0x6b01('0x3'));var interaction=require(_0x6b01('0x4'));var config=require(_0x6b01('0x5'));var controller=require(_0x6b01('0x6'));router['get']('/',auth[_0x6b01('0x7')](),controller[_0x6b01('0x8')]);router[_0x6b01('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6b01('0xa')]);router[_0x6b01('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6b01('0xb')]);router[_0x6b01('0x9')](_0x6b01('0xc'),auth[_0x6b01('0x7')](),controller[_0x6b01('0xd')]);router['get']('/:id/download',auth[_0x6b01('0x7')](),controller[_0x6b01('0xe')]);router[_0x6b01('0xf')]('/',auth['isAuthenticated'](),controller[_0x6b01('0x10')]);router['post']('/:id/messages',auth[_0x6b01('0x7')](),controller['addMessage']);router[_0x6b01('0xf')](_0x6b01('0x11'),auth['isAuthenticated'](),interaction[_0x6b01('0x12')]('sms','smsinteraction:addtags'),controller['addTags']);router[_0x6b01('0x13')]('/:id',auth['isAuthenticated'](),interaction[_0x6b01('0x12')](_0x6b01('0x14'),_0x6b01('0x15')),controller[_0x6b01('0x16')]);router[_0x6b01('0x17')](_0x6b01('0x18'),auth[_0x6b01('0x7')](),interaction[_0x6b01('0x12')](_0x6b01('0x14'),_0x6b01('0x19')),controller[_0x6b01('0x1a')]);router['delete'](_0x6b01('0x11'),auth[_0x6b01('0x7')](),controller[_0x6b01('0x1b')]);module[_0x6b01('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 988776c..c60e631 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 _0xb10b=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x28e5e4,_0x410bce){var _0x1df612=function(_0x5e20bf){while(--_0x5e20bf){_0x28e5e4['push'](_0x28e5e4['shift']());}};_0x1df612(++_0x410bce);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f06e0,_0x2e1c2a){_0x2f06e0=_0x2f06e0-0x0;var _0xf2711b=_0xb10b[_0x2f06e0];return _0xf2711b;};'use strict';var Sequelize=require(_0xbb10('0x0'));var moment=require('moment');module[_0xbb10('0x1')]={'closed':{'type':Sequelize[_0xbb10('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbb10('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbb10('0x4')]},'phone':{'type':Sequelize[_0xbb10('0x4')]},'read1stAt':{'type':Sequelize[_0xbb10('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbb10('0x5')]('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbb10('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbb10('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x54a5cb,_0x4e5f16){var _0x168e1c=function(_0x3c97a9){while(--_0x3c97a9){_0x54a5cb['push'](_0x54a5cb['shift']());}};_0x168e1c(++_0x4e5f16);}(_0x757a,0xde));var _0xa757=function(_0x4916c6,_0x33dc6d){_0x4916c6=_0x4916c6-0x0;var _0x257b9=_0x757a[_0x4916c6];return _0x257b9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa757('0x0'));module[_0xa757('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa757('0x2')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'read1stAt':{'type':Sequelize[_0xa757('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa757('0x4')]('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa757('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 654599f..7b83987 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 _0x5db8=['fullname','Tags','TagIds','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','hasOwnProperty','nolimit','sort','where','field','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','SmsAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','attributes','a.key','Account.mandatoryDisposition','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','catch','params','includeAll','options','create','update','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','pick','YYYY-MM-DD\x20HH:mm:ss','include','addTags','setTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','unix','join','server','tmp','root','attachments','User','CmContact','firstName','lastName','Messages','direction','secret','Account','Owner','get','40px','30px','format','\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','Sms','YYYY-MM-DD','N.A.','closed','closedAt','disposition','out','System','renderFile','downloadInteraction.html','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','Users','map'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x5db8,0xbb));var _0x85db=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x5db8[_0x1f44e4];return _0x591989;};'use strict';var pdf=require(_0x85db('0x0'));var emlformat=require(_0x85db('0x1'));var rimraf=require(_0x85db('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85db('0x3'));var rp=require(_0x85db('0x4'));var moment=require(_0x85db('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x85db('0x6'));var path=require(_0x85db('0x7'));var sox=require(_0x85db('0x8'));var csv=require(_0x85db('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x85db('0xa'));var crypto=require(_0x85db('0xb'));var jsforce=require(_0x85db('0xc'));var deskjs=require(_0x85db('0xd'));var toCsv=require('to-csv');var querystring=require(_0x85db('0xe'));var Papa=require('papaparse');var Redis=require(_0x85db('0xf'));var authService=require(_0x85db('0x10'));var qs=require(_0x85db('0x11'));var as=require(_0x85db('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x85db('0x13'));var config=require(_0x85db('0x14'));var db=require('../../mysqldb')['db'];config[_0x85db('0x15')]=_['defaults'](config[_0x85db('0x15')],{'host':_0x85db('0x16'),'port':0x18eb});var socket=require(_0x85db('0x17'))(new Redis(config[_0x85db('0x15')]));require(_0x85db('0x18'))[_0x85db('0x19')](socket);function respondWithStatusCode(_0x2b7507,_0x25ec64){_0x25ec64=_0x25ec64||0xcc;return function(_0x3ca181){if(_0x3ca181){return _0x2b7507[_0x85db('0x1a')](_0x25ec64);}return _0x2b7507[_0x85db('0x1b')](_0x25ec64)[_0x85db('0x1c')]();};}function respondWithResult(_0x2be61d,_0x5ccfef){_0x5ccfef=_0x5ccfef||0xc8;return function(_0x27bd65){if(_0x27bd65){return _0x2be61d[_0x85db('0x1b')](_0x5ccfef)[_0x85db('0x1d')](_0x27bd65);}};}function respondWithFilteredResult(_0xc8fec5,_0x2ecd71){return function(_0x396afa){if(_0x396afa){var _0x3209b3=_0x396afa[_0x85db('0x1e')],_0x56d3b2=_0x2ecd71[_0x85db('0x1f')],_0x37ac04=_0x2ecd71[_0x85db('0x1f')]+_0x2ecd71[_0x85db('0x20')],_0xf89937;if(_0x37ac04>=_0x3209b3){_0x37ac04=_0x3209b3;_0xf89937=0xc8;}else{_0xf89937=0xce;}_0xc8fec5[_0x85db('0x1b')](_0xf89937);return _0xc8fec5[_0x85db('0x21')](_0x85db('0x22'),_0x56d3b2+'-'+_0x37ac04+'/'+_0x3209b3)[_0x85db('0x1d')](_0x396afa);}return null;};}function patchUpdates(_0x5c37d7){return function(_0x36a2af){try{jsonpatch[_0x85db('0x23')](_0x36a2af,_0x5c37d7,!![]);}catch(_0xc812d2){return BPromise[_0x85db('0x24')](_0xc812d2);}return _0x36a2af[_0x85db('0x25')]();};}function saveUpdates(_0x3842d7,_0x3a7148){return function(_0x3ba348){if(_0x3ba348){return _0x3ba348['update'](_0x3842d7)[_0x85db('0x26')](function(_0x2534bc){return _0x2534bc;});}return null;};}function removeEntity(_0x57fe5b,_0x3381ec){return function(_0x28f493){if(_0x28f493){return _0x28f493[_0x85db('0x27')]()['then'](function(){_0x57fe5b[_0x85db('0x1b')](0xcc)[_0x85db('0x1c')]();});}};}function handleEntityNotFound(_0x1b1980,_0x54ba03){return function(_0x5467ad){if(!_0x5467ad){_0x1b1980['sendStatus'](0x194);}return _0x5467ad;};}function handleError(_0x1e4ddb,_0x105bb9){_0x105bb9=_0x105bb9||0x1f4;return function(_0x33448e){logger['error'](_0x33448e[_0x85db('0x28')]);if(_0x33448e[_0x85db('0x29')]){delete _0x33448e[_0x85db('0x29')];}_0x1e4ddb['status'](_0x105bb9)['send'](_0x33448e);};}function getInteractionUsers(_0x299013,_0x137e42){return new BPromise(function(_0x18963a,_0x226540){try{if(_0x137e42[_0x299013['id']]){_0x299013[_0x85db('0x2a')]=_[_0x85db('0x2b')](_0x137e42[_0x299013['id']],function(_0x8af4a4){return{'id':_0x8af4a4['id'],'fullname':_0x8af4a4[_0x85db('0x2c')]};});}}catch(_0x6ee161){_0x226540(_0x6ee161);}_0x18963a(_0x299013);});}function getInteractionTags(_0x1edc8d,_0x580e90){return new BPromise(function(_0x4a15b9,_0x13ad98){try{if(_0x1edc8d['TagIds']){_0x1edc8d[_0x85db('0x2d')]=[];_0x1edc8d[_0x85db('0x2e')]['split'](',')[_0x85db('0x2f')](function(_0x26ca6f){_0x1edc8d[_0x85db('0x2d')][_0x85db('0x30')](_0x580e90[_0x26ca6f]);});}delete _0x1edc8d['TagIds'];}catch(_0x3079fc){_0x13ad98(_0x3079fc);}_0x4a15b9(_0x1edc8d);});}function updateSmsInteraction(_0x25f20f,_0x21a077,_0x41fe15){return new BPromise(function(_0x2ec392,_0x4808a4){return getInteractionUsers(_0x25f20f,_0x41fe15)[_0x85db('0x26')](function(_0x1b7325){return getInteractionTags(_0x1b7325,_0x21a077);})[_0x85db('0x26')](function(_0xd0d27){_0x2ec392(_0xd0d27);})['catch'](function(_0xfe3cd9){_0x4808a4(_0xfe3cd9);});});}exports[_0x85db('0x31')]=function(_0x2a07ee,_0x536398){var _0x550194={},_0x11d5b7={},_0x3639bc={'count':0x0,'rows':[]};var _0x4980b7=_[_0x85db('0x2b')](db[_0x85db('0x32')][_0x85db('0x33')],function(_0x240325){return{'name':_0x240325[_0x85db('0x34')],'type':_0x240325[_0x85db('0x35')][_0x85db('0x36')]};});_0x11d5b7[_0x85db('0x37')]=_[_0x85db('0x2b')](_0x4980b7,_0x85db('0x29'));_0x11d5b7[_0x85db('0x38')]=_[_0x85db('0x39')](_0x2a07ee['query']);_0x11d5b7[_0x85db('0x3a')]=_[_0x85db('0x3b')](_0x11d5b7[_0x85db('0x37')],_0x11d5b7[_0x85db('0x38')]);_0x550194['attributes']=_[_0x85db('0x3b')](_0x11d5b7[_0x85db('0x37')],qs[_0x85db('0x3c')](_0x2a07ee[_0x85db('0x38')]['fields']));_0x550194['attributes']=_0x550194['attributes']['length']?_0x550194['attributes']:_0x11d5b7[_0x85db('0x37')];if(!_0x2a07ee[_0x85db('0x38')][_0x85db('0x3d')](_0x85db('0x3e'))){_0x550194[_0x85db('0x20')]=qs['limit'](_0x2a07ee['query'][_0x85db('0x20')]);_0x550194['offset']=qs[_0x85db('0x1f')](_0x2a07ee[_0x85db('0x38')]['offset']);}_0x550194['order']=qs[_0x85db('0x3f')](_0x2a07ee[_0x85db('0x38')][_0x85db('0x3f')]);_0x550194[_0x85db('0x40')]=qs[_0x85db('0x3a')](_['pick'](_0x2a07ee[_0x85db('0x38')],_0x11d5b7[_0x85db('0x3a')]),_0x4980b7);var _0x115720=[];var _0x5be721=squel['select']()['field']('id')[_0x85db('0x41')](_0x85db('0x29'))[_0x85db('0x41')]('color')['from'](_0x85db('0x42'));var _0x48f3ae=squel[_0x85db('0x43')]()[_0x85db('0x41')](_0x85db('0x44'))['field'](_0x85db('0x45'))[_0x85db('0x41')](_0x85db('0x46'))[_0x85db('0x47')](_0x85db('0x48'),'ui')[_0x85db('0x49')](_0x85db('0x4a'),'u',_0x85db('0x4b'));var _0x15e79a=squel['select']()[_0x85db('0x47')](_0x85db('0x4c'),'i')[_0x85db('0x49')](_0x85db('0x4d'),'c',_0x85db('0x4e'))[_0x85db('0x49')]('users','o',_0x85db('0x4f'))[_0x85db('0x49')](_0x85db('0x50'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0x85db('0x51'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x85db('0x49')](_0x85db('0x52'),'it',_0x85db('0x53'))[_0x85db('0x49')](_0x85db('0x42'),'t','t.id\x20=\x20it.TagId');var _0x5d44ef=squel[_0x85db('0x54')]();var _0x8a2d42=[];var _0x8d01f=squel[_0x85db('0x54')]();var _0x1b6157;if(_0x2a07ee[_0x85db('0x38')][_0x85db('0x55')]){_0x1b6157=as[_0x85db('0x56')](_0x2a07ee[_0x85db('0x38')][_0x85db('0x55')]);var _0x5e0f2b=_0x1b6157[_0x85db('0x57')];for(var _0x2c4ae4=0x0;_0x2c4ae4<_0x1b6157['conditions']['length'];_0x2c4ae4++){var _0x8697f5=_0x1b6157[_0x85db('0x58')][_0x2c4ae4];var _0x47f8c2='i';var _0x58f674=_[_0x85db('0x59')](_0x4980b7,[_0x85db('0x29'),_0x8697f5['field']]);if(!_0x58f674){switch(_0x8697f5[_0x85db('0x41')]){case _0x85db('0x5a'):if(_0x8697f5[_0x85db('0x5b')]==0x1){_0x15e79a[_0x85db('0x5c')]('`'+_0x8697f5[_0x85db('0x41')]+_0x85db('0x5d'));}else{_0x15e79a[_0x85db('0x5c')]('`'+_0x8697f5[_0x85db('0x41')]+_0x85db('0x5e'));}break;case _0x85db('0x5f'):if(_0x8697f5['operator']==='$substring'){if(_0x8697f5[_0x85db('0x5b')][_0x85db('0x60')]('\x20')[_0x85db('0x61')]>0x1){_0x5d44ef[_0x5e0f2b](_0x85db('0x62'),qs[_0x85db('0x63')](_0x8697f5[_0x85db('0x5b')]),null);}else{var _0x745266='%'+_0x8697f5[_0x85db('0x5b')]+'%';_0x5d44ef[_0x5e0f2b](_0x85db('0x64'),_0x745266,_0x745266,_0x745266);}}else{_0x58f674=_[_0x85db('0x59')](_0x4980b7,[_0x85db('0x29'),_0x85db('0x65')]);_0x8697f5[_0x85db('0x41')]=_0x85db('0x65');_0x427250=as['buildExpression'](_0x47f8c2,_0x58f674[_0x85db('0x35')],_0x8697f5);_0x5d44ef[_0x5e0f2b](_0x427250[_0x85db('0x66')],_0x427250['value'][_0x85db('0x67')],_0x427250[_0x85db('0x5b')][_0x85db('0x1c')]);}break;case _0x85db('0x68'):var _0x992a63=_0x8697f5[_0x85db('0x5b')][_0x85db('0x60')](',')['map'](function(_0x35760e){return Number(_0x35760e);});_0x992a63[_0x85db('0x2f')](function(_0x4d7e50){_0x8d01f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4d7e50+',%');});_0x8a2d42=_[_0x85db('0x69')](_0x8a2d42,_0x992a63);break;case'User':if(_0x8697f5[_0x85db('0x6a')]===_0x85db('0x6b')){_0x5d44ef[_0x5e0f2b](_0x85db('0x6c'),'%'+_0x8697f5[_0x85db('0x5b')]+'%',null);}else{_0x58f674=_['find'](_0x4980b7,[_0x85db('0x29'),'UserId']);_0x8697f5['field']='UserId';_0x427250=as[_0x85db('0x6d')](_0x47f8c2,_0x58f674[_0x85db('0x35')],_0x8697f5);_0x5d44ef[_0x5e0f2b](_0x427250['text'],_0x427250[_0x85db('0x5b')][_0x85db('0x67')],_0x427250['value'][_0x85db('0x1c')]);}break;case _0x85db('0x6e'):_0x427250=as[_0x85db('0x6d')]('me',null,_0x8697f5);_0x5d44ef[_0x5e0f2b](_0x427250[_0x85db('0x66')],_0x427250[_0x85db('0x5b')][_0x85db('0x67')],_0x427250['value'][_0x85db('0x1c')]);break;}}else{var _0x427250=as[_0x85db('0x6d')](_0x47f8c2,_0x58f674[_0x85db('0x35')],_0x8697f5);_0x5d44ef[_0x5e0f2b](_0x427250[_0x85db('0x66')],_0x427250[_0x85db('0x5b')][_0x85db('0x67')],_0x427250[_0x85db('0x5b')]['end']);}}}else{var _0x4bf237=_(_0x2a07ee['query'])['keys']()[_0x85db('0x2b')](function(_0x38f37f){return _[_0x85db('0x6f')](_0x4980b7,[_0x85db('0x29'),_0x38f37f])?_0x38f37f:undefined;})[_0x85db('0x70')]()[_0x85db('0x5b')]();if(!_['isEmpty'](_0x4bf237)){_0x4bf237[_0x85db('0x2f')](function(_0x6e3240){if(_0x6e3240===_0x85db('0x71')){_0x15e79a[_0x85db('0x40')]('i.SmsAccountId\x20IN\x20?',[][_0x85db('0x72')](_0x2a07ee[_0x85db('0x38')][_0x6e3240]));}else if(_0x6e3240===_0x85db('0x73')){var _0x1aa93a=JSON[_0x85db('0x74')](_0x2a07ee[_0x85db('0x38')][_0x6e3240])[_0x85db('0x75')];var _0x2af26e=JSON[_0x85db('0x74')](_0x2a07ee[_0x85db('0x38')][_0x6e3240])['$lte'];_0x15e79a[_0x85db('0x40')](_0x85db('0x76'),_0x1aa93a,_0x2af26e);}else{if(_0x2a07ee[_0x85db('0x38')][_0x6e3240]===_0x85db('0x77')){_0x15e79a[_0x85db('0x40')]('i.'+_0x6e3240+'\x20IS\x20NULL');}else{_0x15e79a[_0x85db('0x40')]('i.'+_0x6e3240+_0x85db('0x78'),_0x2a07ee[_0x85db('0x38')][_0x6e3240]);}}});}if(_0x2a07ee[_0x85db('0x38')][_0x85db('0x79')]){if(_0x2a07ee['query'][_0x85db('0x79')]==0x1){_0x15e79a[_0x85db('0x5c')](_0x85db('0x7a'));}else{_0x15e79a['having'](_0x85db('0x7b'));}}if(_0x2a07ee[_0x85db('0x38')][_0x85db('0x7c')]){_0x8a2d42=_['isArray'](_0x2a07ee[_0x85db('0x38')][_0x85db('0x7c')])?_0x2a07ee['query'][_0x85db('0x7c')]:new Array(_0x2a07ee[_0x85db('0x38')][_0x85db('0x7c')]);_0x8a2d42[_0x85db('0x2f')](function(_0x1ee2eb){_0x8d01f['or'](_0x85db('0x7d'),'%,'+_0x1ee2eb+',%');});}if(_0x2a07ee[_0x85db('0x38')][_0x85db('0x7e')]){var _0x22a37a=_0x2a07ee[_0x85db('0x38')][_0x85db('0x7e')][_0x85db('0x7f')]('\x5c','\x5c\x5c')[_0x85db('0x7f')]('\x27\x27',_0x85db('0x80'));if(qs[_0x85db('0x81')](_0x22a37a)){_0x5d44ef['or']('i.id\x20LIKE\x20?',_0x22a37a+'%')['or'](_0x85db('0x82'),_0x22a37a+'%');}else{_0x5d44ef['or'](_0x85db('0x83'),qs[_0x85db('0x63')](_0x22a37a))['or'](_0x85db('0x84'),_0x22a37a+'%');}}}_0x15e79a['where'](_0x5d44ef);_0x15e79a['group'](_0x85db('0x85'));var _0x522a4a={'type':db[_0x85db('0x86')][_0x85db('0x87')][_0x85db('0x88')],'raw':!![]};var _0x59bca4=_0x15e79a[_0x85db('0x89')]();_0x59bca4[_0x85db('0x41')](_0x85db('0x85'));_0x59bca4[_0x85db('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x85db('0x5a'));if(_0x550194['order']){_0x550194[_0x85db('0x8a')][_0x85db('0x2f')](function(_0x78a07c){_0x15e79a[_0x85db('0x8a')]('i.'+_0x78a07c[0x0],_0x78a07c[0x1]===_0x85db('0x8b')?![]:!![]);});}if(!_[_0x85db('0x8c')](_0x8a2d42)){_0x15e79a[_0x85db('0x5c')](_0x8d01f);_0x59bca4[_0x85db('0x40')](_0x85db('0x8d'),_0x8a2d42);}BPromise[_0x85db('0x8e')]()[_0x85db('0x26')](function(){if(!_0x1b6157){if(_0x2a07ee[_0x85db('0x38')][_0x85db('0x71')]||_0x2a07ee['query'][_0x85db('0x8f')])return;_0x59bca4['where'](_0x85db('0x90'));_0x15e79a[_0x85db('0x40')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}return _0x2a07ee[_0x85db('0x91')][_0x85db('0x92')]({'attributes':['id'],'raw':!![]})[_0x85db('0x26')](function(_0x502300){if(_[_0x85db('0x8c')](_0x502300)){_0x59bca4['where'](_0x85db('0x93'));_0x15e79a['where'](_0x85db('0x93'));}else{_0x59bca4[_0x85db('0x40')]('i.SmsAccountId\x20IN\x20?',_[_0x85db('0x2b')](_0x502300,'id'));_0x15e79a[_0x85db('0x40')](_0x85db('0x94'),_[_0x85db('0x2b')](_0x502300,'id'));}});})[_0x85db('0x26')](function(){db[_0x85db('0x95')]['query'](_0x59bca4[_0x85db('0x96')](),_0x522a4a)[_0x85db('0x26')](function(_0x3eb52c){_0x3639bc['count']=_0x3eb52c[_0x85db('0x61')];if(_0x3639bc[_0x85db('0x1e')]===0x0)return[];return db[_0x85db('0x95')][_0x85db('0x38')](_0x5be721[_0x85db('0x96')](),_0x522a4a)[_0x85db('0x26')](function(_0x13fd5){_0x115720=_[_0x85db('0x97')](_0x13fd5,'id');_0x522a4a=_[_0x85db('0x98')](_0x522a4a,{'model':db[_0x85db('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a07ee[_0x85db('0x38')]['fields']){_0x550194[_0x85db('0x99')][_0x85db('0x2f')](function(_0xdcb072){_0x15e79a['field']('i.'+_0xdcb072);});}else{_0x15e79a[_0x85db('0x41')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x85db('0x5a'));_0x15e79a['field'](_0x85db('0x9a'),'Account.key');_0x15e79a[_0x85db('0x41')]('a.mandatoryDisposition',_0x85db('0x9b'));_0x15e79a[_0x85db('0x41')]('i.*');_0x15e79a[_0x85db('0x41')]('c.firstName','Contact.firstName');_0x15e79a[_0x85db('0x41')](_0x85db('0x9c'),_0x85db('0x9d'));_0x15e79a[_0x85db('0x41')](_0x85db('0x9e'),_0x85db('0x9f'));_0x15e79a['field'](_0x85db('0xa0'),_0x85db('0xa1'));_0x15e79a[_0x85db('0x41')](_0x85db('0xa2'),_0x85db('0xa3'));_0x15e79a['field'](_0x85db('0xa4'),'Contact.fax');_0x15e79a[_0x85db('0x41')](_0x85db('0xa5'),_0x85db('0xa6'));_0x15e79a['field']('o.internal',_0x85db('0xa7'));_0x15e79a['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x550194[_0x85db('0x20')])_0x15e79a[_0x85db('0x20')](_0x550194[_0x85db('0x20')]);if(_0x550194[_0x85db('0x1f')])_0x15e79a[_0x85db('0x1f')](_0x550194[_0x85db('0x1f')]);return db[_0x85db('0x95')]['query'](_0x15e79a[_0x85db('0x96')](),_0x522a4a);})[_0x85db('0x26')](function(_0x43d786){_0x48f3ae[_0x85db('0x40')](_0x85db('0xa8'),_[_0x85db('0x2b')](_0x43d786,'id'));return db['sequelize'][_0x85db('0x38')](_0x48f3ae['toString'](),_0x522a4a)['then'](function(_0x15c530){var _0x332cab=_[_0x85db('0xa9')](_0x15c530,_0x85db('0xaa'));var _0x198415=[];_0x43d786[_0x85db('0x2f')](function(_0x8566c3){_0x198415[_0x85db('0x30')](updateSmsInteraction(_0x8566c3,_0x115720,_0x332cab));});return BPromise['all'](_0x198415);});});})[_0x85db('0x26')](function(_0x1d97b9){_0x3639bc[_0x85db('0xab')]=_0x1d97b9;return _0x3639bc;})[_0x85db('0x26')](respondWithFilteredResult(_0x536398,_0x550194));})[_0x85db('0xac')](handleError(_0x536398,null));};exports['show']=function(_0xf6fbf0,_0x392253){var _0x283c67={'raw':![],'where':{'id':_0xf6fbf0[_0x85db('0xad')]['id']}},_0x393ec2={};_0x393ec2['model']=_[_0x85db('0x39')](db[_0x85db('0x32')]['rawAttributes']);_0x393ec2[_0x85db('0x38')]=_[_0x85db('0x39')](_0xf6fbf0[_0x85db('0x38')]);_0x393ec2[_0x85db('0x3a')]=_['intersection'](_0x393ec2[_0x85db('0x37')],_0x393ec2['query']);_0x283c67[_0x85db('0x99')]=_[_0x85db('0x3b')](_0x393ec2[_0x85db('0x37')],qs['fields'](_0xf6fbf0[_0x85db('0x38')][_0x85db('0x3c')]));_0x283c67[_0x85db('0x99')]=_0x283c67[_0x85db('0x99')]['length']?_0x283c67[_0x85db('0x99')]:_0x393ec2['model'];if(_0xf6fbf0[_0x85db('0x38')][_0x85db('0xae')]){_0x283c67['include']=[{'all':!![]}];}_0x283c67=_['merge']({},_0x283c67,_0xf6fbf0[_0x85db('0xaf')]);return db['SmsInteraction'][_0x85db('0x59')](_0x283c67)[_0x85db('0x26')](handleEntityNotFound(_0x392253,null))['then'](respondWithResult(_0x392253,null))[_0x85db('0xac')](handleError(_0x392253,null));};exports[_0x85db('0xb0')]=function(_0xe6ec04,_0x593907){return db['SmsInteraction']['create'](_0xe6ec04[_0x85db('0x6e')],{})[_0x85db('0x26')](respondWithResult(_0x593907,0xc9))[_0x85db('0xac')](handleError(_0x593907,null));};exports[_0x85db('0xb1')]=function(_0x2750a7,_0x4177c9){if(_0x2750a7[_0x85db('0x6e')]['id']){delete _0x2750a7[_0x85db('0x6e')]['id'];}return db[_0x85db('0x32')][_0x85db('0x59')]({'where':{'id':_0x2750a7['params']['id']}})[_0x85db('0x26')](handleEntityNotFound(_0x4177c9,null))[_0x85db('0x26')](saveUpdates(_0x2750a7[_0x85db('0x6e')],null))[_0x85db('0x26')](respondWithResult(_0x4177c9,null))[_0x85db('0xac')](handleError(_0x4177c9,null));};exports[_0x85db('0x27')]=function(_0x3598b7,_0x13aeed){return db['SmsInteraction'][_0x85db('0x59')]({'where':{'id':_0x3598b7[_0x85db('0xad')]['id']}})[_0x85db('0x26')](handleEntityNotFound(_0x13aeed,null))[_0x85db('0x26')](removeEntity(_0x13aeed,null))[_0x85db('0xac')](handleError(_0x13aeed,null));};exports[_0x85db('0xb2')]=function(_0x4ae8c4,_0x836a34){return db[_0x85db('0x32')]['describe']()['then'](respondWithResult(_0x836a34,null))[_0x85db('0xac')](handleError(_0x836a34,null));};exports[_0x85db('0xb3')]=function(_0x19cfa9,_0x4f9d67,_0xb3a075){return db['SmsMessage'][_0x85db('0x59')]({'where':{'id':_0x19cfa9['params']['id']}})[_0x85db('0x26')](handleEntityNotFound(_0x4f9d67,null))[_0x85db('0x26')](function(_0x37314a){if(_0x37314a){return _0x37314a[_0x85db('0xb3')](_0x19cfa9[_0x85db('0x6e')][_0x85db('0xb4')],_[_0x85db('0xb5')](_0x19cfa9[_0x85db('0x6e')],[_0x85db('0xb4'),'id'])||{});}})['then'](respondWithResult(_0x4f9d67,null))[_0x85db('0xac')](handleError(_0x4f9d67,null));};exports[_0x85db('0xb6')]=function(_0x16cd11,_0x5532b0,_0x59ea88){var _0x409f9e={'raw':![],'where':{}};var _0x3c8346={};var _0x106542={'count':0x0,'rows':[]};return db[_0x85db('0x32')][_0x85db('0xb7')]({'where':{'id':_0x16cd11['params']['id']}})[_0x85db('0x26')](handleEntityNotFound(_0x5532b0,null))[_0x85db('0x26')](function(_0x51385c){if(_0x51385c){_0x3c8346[_0x85db('0x37')]=_[_0x85db('0x39')](db[_0x85db('0xb8')][_0x85db('0x33')]);_0x3c8346[_0x85db('0x38')]=_[_0x85db('0x39')](_0x16cd11['query']);_0x3c8346['filters']=_[_0x85db('0x3b')](_0x3c8346[_0x85db('0x37')],_0x3c8346[_0x85db('0x38')]);_0x409f9e[_0x85db('0x99')]=_[_0x85db('0x3b')](_0x3c8346[_0x85db('0x37')],qs[_0x85db('0x3c')](_0x16cd11[_0x85db('0x38')]['fields']));_0x409f9e[_0x85db('0x99')]=_0x409f9e['attributes']['length']?_0x409f9e['attributes']:_0x3c8346['model'];if(!_0x16cd11[_0x85db('0x38')][_0x85db('0x3d')](_0x85db('0x3e'))){_0x409f9e['limit']=qs['limit'](_0x16cd11[_0x85db('0x38')][_0x85db('0x20')]);_0x409f9e[_0x85db('0x1f')]=qs['offset'](_0x16cd11[_0x85db('0x38')][_0x85db('0x1f')]);}_0x409f9e[_0x85db('0x8a')]=qs[_0x85db('0x3f')](_0x16cd11['query'][_0x85db('0x3f')]);_0x409f9e[_0x85db('0x40')]=qs['filters'](_[_0x85db('0xb9')](_0x16cd11[_0x85db('0x38')],_0x3c8346[_0x85db('0x3a')]));_0x409f9e[_0x85db('0x40')]['SmsInteractionId']=_0x51385c['id'];if(_0x16cd11[_0x85db('0x38')][_0x85db('0x7e')]){_0x409f9e[_0x85db('0x40')]=_[_0x85db('0x98')](_0x409f9e['where'],{'$or':_['map'](_0x409f9e['attributes'],function(_0x3f5cd2){var _0xa8f3c6={};_0xa8f3c6[_0x3f5cd2]={'$like':'%'+_0x16cd11[_0x85db('0x38')][_0x85db('0x7e')]+'%'};return _0xa8f3c6;})});}if(_0x16cd11[_0x85db('0x38')][_0x85db('0x75')]){var _0x164cdc=_0x16cd11[_0x85db('0x38')][_0x85db('0x75')]['split'](',');var _0xb82b7f={};_0xb82b7f[_0x164cdc[0x0]]={'$gte':moment(_0x164cdc[0x1])['format'](_0x85db('0xba'))};_0x409f9e[_0x85db('0x40')]=_[_0x85db('0x98')](_0x409f9e[_0x85db('0x40')],_0xb82b7f);}_0x409f9e=_[_0x85db('0x98')]({},_0x409f9e,_0x16cd11[_0x85db('0xaf')]);return db[_0x85db('0xb8')][_0x85db('0x1e')]({'where':_0x409f9e[_0x85db('0x40')]})[_0x85db('0x26')](function(_0x132f92){_0x106542['count']=_0x132f92;if(_0x16cd11['query'][_0x85db('0xae')]){_0x409f9e[_0x85db('0xbb')]=[{'all':!![]}];}return db[_0x85db('0xb8')]['findAll'](_0x409f9e);})[_0x85db('0x26')](function(_0x30e51c){_0x106542[_0x85db('0xab')]=_0x30e51c;return _0x106542;});}})[_0x85db('0x26')](respondWithFilteredResult(_0x5532b0,_0x409f9e))[_0x85db('0xac')](handleError(_0x5532b0,null));};exports[_0x85db('0xbc')]=function(_0x2472f0,_0x1b20a1,_0x2d1739){return db['SmsInteraction'][_0x85db('0x59')]({'where':{'id':_0x2472f0[_0x85db('0xad')]['id']}})[_0x85db('0x26')](handleEntityNotFound(_0x1b20a1,null))[_0x85db('0x26')](function(_0x3fdecd){if(_0x3fdecd){return _0x3fdecd[_0x85db('0xbd')](_0x2472f0[_0x85db('0x6e')]['ids'],_[_0x85db('0xb5')](_0x2472f0[_0x85db('0x6e')],[_0x85db('0xb4'),'id'])||{})[_0x85db('0xbe')](function(){return db['Tag'][_0x85db('0xbf')]({'attributes':['id',_0x85db('0x29'),_0x85db('0xc0')],'where':{'id':_0x2472f0[_0x85db('0x6e')][_0x85db('0xb4')]}});})[_0x85db('0x26')](function(_0x45b430){socket[_0x85db('0xc1')](_0x85db('0xc2'),{'id':Number(_0x2472f0[_0x85db('0xad')]['id']),'tags':_0x45b430||[]});return{'id':Number(_0x2472f0['params']['id']),'tags':_0x45b430||[]};});}})[_0x85db('0x26')](respondWithResult(_0x1b20a1,null))[_0x85db('0xac')](handleError(_0x1b20a1,null));};exports['removeTags']=function(_0x125f6c,_0x91ce6c,_0x13a5a2){return db[_0x85db('0x32')][_0x85db('0x59')]({'where':{'id':_0x125f6c[_0x85db('0xad')]['id']}})[_0x85db('0x26')](handleEntityNotFound(_0x91ce6c,null))[_0x85db('0x26')](function(_0x585bbe){if(_0x585bbe){return _0x585bbe[_0x85db('0xc3')](_0x125f6c[_0x85db('0x38')]['ids']);}})[_0x85db('0x26')](respondWithStatusCode(_0x91ce6c,null))['catch'](handleError(_0x91ce6c,null));};exports['download']=function(_0x45b004,_0x1b1018){var _0x2bd580=moment()[_0x85db('0xc4')]()[_0x85db('0x96')]();var _0x328e4c=path[_0x85db('0xc5')](config['root'],_0x85db('0xc6'),'files',_0x85db('0xc7'));var _0x723186=path[_0x85db('0xc5')](config[_0x85db('0xc8')],_0x85db('0xc6'),'files',_0x85db('0xc9'));var _0x467df0=path['join'](_0x328e4c,_0x2bd580);var _0x21e516=util['format']('transcript-%d-%s.zip',_0x45b004[_0x85db('0xad')]['id'],_0x2bd580);var _0x43c521=path['join'](_0x328e4c,_0x21e516);var _0x3c1c48=[];_0x3c1c48[_0x85db('0x30')]({'model':db[_0x85db('0xca')],'as':'User','attributes':['id',_0x85db('0x2c')],'raw':!![]});_0x3c1c48[_0x85db('0x30')]({'model':db[_0x85db('0xcb')],'as':'Contact','attributes':['id',_0x85db('0xcc'),_0x85db('0xcd')],'raw':!![]});var _0x8121ad=[{'model':db[_0x85db('0xb8')],'as':_0x85db('0xce'),'attributes':['id',_0x85db('0x6e'),_0x85db('0x73'),_0x85db('0xcf'),_0x85db('0xd0'),_0x85db('0x79')],'include':_0x3c1c48}];_0x8121ad[_0x85db('0x30')]({'model':db['SmsAccount'],'as':_0x85db('0xd1'),'attributes':['id','name']});_0x8121ad[_0x85db('0x30')]({'model':db['User'],'as':_0x85db('0xd2'),'attributes':['id',_0x85db('0x2c')]});return db[_0x85db('0x32')][_0x85db('0x59')]({'where':{'id':_0x45b004[_0x85db('0xad')]['id']},'include':_0x8121ad})[_0x85db('0x26')](handleEntityNotFound(_0x1b1018,null))[_0x85db('0x26')](function(_0x1c8b7b){if(_0x1c8b7b){var _0x5cf9f4=_0x1c8b7b[_0x85db('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x467df0);var _0xe94a7a={'format':'A4','border':'10px','header':{'height':_0x85db('0xd4'),'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':_0x85db('0xd5'),'contents':{'default':util[_0x85db('0xd6')](_0x85db('0xd7'),util[_0x85db('0xd6')]('%s\x20#%d',_0x85db('0xd8'),_0x5cf9f4['id']),moment()[_0x85db('0xd6')](_0x85db('0xd9'))[_0x85db('0x96')]())}}};var _0x51c81e={'channel':_0x85db('0xd8'),'account':_0x5cf9f4[_0x85db('0xd1')][_0x85db('0x29')],'agent':_0x5cf9f4[_0x85db('0xd2')]?_0x5cf9f4[_0x85db('0xd2')][_0x85db('0x2c')]:_0x85db('0xda'),'createdAt':moment(_0x5cf9f4[_0x85db('0x73')])['format'](_0x85db('0xba'))['toString'](),'closedAt':_0x5cf9f4[_0x85db('0xdb')]?moment(_0x5cf9f4[_0x85db('0xdc')])['format'](_0x85db('0xba'))[_0x85db('0x96')]():'','disposition':_0x5cf9f4[_0x85db('0xdd')],'messages':_(_0x5cf9f4[_0x85db('0xce')])[_0x85db('0x7e')]({'secret':![]})['map'](function(_0x729d78){return{'date':moment(_0x729d78[_0x85db('0x73')])['format'](_0x85db('0xba'))[_0x85db('0x96')](),'sender':_0x729d78[_0x85db('0xcf')]===_0x85db('0xde')?_0x729d78[_0x85db('0xca')]?_0x729d78[_0x85db('0xca')][_0x85db('0x2c')]:_0x85db('0xdf'):_0x729d78[_0x85db('0x5f')][_0x85db('0xcc')]+(_0x729d78[_0x85db('0x5f')][_0x85db('0xcd')]?'\x20'+_0x729d78[_0x85db('0x5f')][_0x85db('0xcd')]:''),'body':_0x729d78[_0x85db('0x6e')],'direction':_0x729d78[_0x85db('0xcf')]===_0x85db('0xde')?'A':'C','secret':_0x729d78['secret'],'read':_0x729d78['read']};})[_0x85db('0x5b')]()};return ejs[_0x85db('0xe0')](path['join'](config[_0x85db('0xc8')],_0x85db('0xc6'),'views',_0x85db('0xe1')),{'interaction':_0x51c81e})[_0x85db('0x26')](function(_0x478fba){return new BPromise(function(_0x4d08e6,_0x2d604f){pdf[_0x85db('0xb0')](_0x478fba,_0xe94a7a)['toFile'](path['join'](_0x467df0,_0x85db('0xe2')+_0x5cf9f4['id']+'-'+_0x2bd580+_0x85db('0xe3')),function(_0x2e0d08,_0x33d5f9){if(_0x2e0d08)return _0x2d604f(_0x2e0d08);_0x4d08e6(_0x33d5f9);});});})[_0x85db('0x26')](function(){return new BPromise(function(_0x227852,_0x454a34){zipdir(_0x467df0,{'saveTo':_0x43c521},function(_0x46dce1,_0x7fb59e){if(_0x46dce1)return _0x454a34(_0x46dce1);return _0x227852(_0x7fb59e);});})[_0x85db('0x26')](function(){return new BPromise(function(_0x1d3c49,_0x289dc9){rimraf(_0x467df0,function(_0x516d35){if(_0x516d35)_0x289dc9(_0x516d35);return _0x1d3c49();});});})['then'](function(){return _0x1b1018['download'](_0x43c521,_0x21e516,function(_0x57b26a){if(_0x57b26a){console[_0x85db('0xe4')](_0x85db('0xe5'),_0x57b26a);}else{fs[_0x85db('0xe6')](_0x43c521);}});});});}else{return _0x1b1018[_0x85db('0x1a')](0xc8);}})[_0x85db('0xac')](handleError(_0x1b1018,null));}; \ No newline at end of file +var _0x2e54=['Account','Owner','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','Sms','N.A.','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','out','System','firstName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','limit','Content-Range','apply','reject','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','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','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','push','all','rows','catch','show','params','rawAttributes','includeAll','include','create','body','describe','SmsMessage','addMessage','ids','getMessages','findOne','format','options','findAll','addTags','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','transcript-%d-%s.zip','CmContact','lastName','direction','secret','SmsAccount'];(function(_0x5f2239,_0x4a49bb){var _0x526a9d=function(_0x4c6cc6){while(--_0x4c6cc6){_0x5f2239['push'](_0x5f2239['shift']());}};_0x526a9d(++_0x4a49bb);}(_0x2e54,0x1dd));var _0x42e5=function(_0x299d49,_0x1527fa){_0x299d49=_0x299d49-0x0;var _0x4b1a35=_0x2e54[_0x299d49];return _0x4b1a35;};'use strict';var pdf=require(_0x42e5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x42e5('0x1'));var jsonpatch=require(_0x42e5('0x2'));var rp=require(_0x42e5('0x3'));var moment=require(_0x42e5('0x4'));var BPromise=require(_0x42e5('0x5'));var Mustache=require(_0x42e5('0x6'));var util=require(_0x42e5('0x7'));var path=require('path');var sox=require(_0x42e5('0x8'));var csv=require(_0x42e5('0x9'));var ejs=require(_0x42e5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x9'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var db=require('../../mysqldb')['db'];config[_0x42e5('0x17')]=_[_0x42e5('0x18')](config[_0x42e5('0x17')],{'host':_0x42e5('0x19'),'port':0x18eb});var socket=require(_0x42e5('0x1a'))(new Redis(config[_0x42e5('0x17')]));require(_0x42e5('0x1b'))[_0x42e5('0x1c')](socket);function respondWithStatusCode(_0x447648,_0x23957f){_0x23957f=_0x23957f||0xcc;return function(_0x51b2f4){if(_0x51b2f4){return _0x447648[_0x42e5('0x1d')](_0x23957f);}return _0x447648[_0x42e5('0x1e')](_0x23957f)[_0x42e5('0x1f')]();};}function respondWithResult(_0x388300,_0x2f4999){_0x2f4999=_0x2f4999||0xc8;return function(_0x263a3d){if(_0x263a3d){return _0x388300[_0x42e5('0x1e')](_0x2f4999)[_0x42e5('0x20')](_0x263a3d);}};}function respondWithFilteredResult(_0x16c753,_0x3c7b79){return function(_0x22655f){if(_0x22655f){var _0x38282d=_0x22655f[_0x42e5('0x21')],_0x11550e=_0x3c7b79['offset'],_0x23fe09=_0x3c7b79['offset']+_0x3c7b79[_0x42e5('0x22')],_0x54fcfc;if(_0x23fe09>=_0x38282d){_0x23fe09=_0x38282d;_0x54fcfc=0xc8;}else{_0x54fcfc=0xce;}_0x16c753[_0x42e5('0x1e')](_0x54fcfc);return _0x16c753['set'](_0x42e5('0x23'),_0x11550e+'-'+_0x23fe09+'/'+_0x38282d)[_0x42e5('0x20')](_0x22655f);}return null;};}function patchUpdates(_0x1c2169){return function(_0x3fde76){try{jsonpatch[_0x42e5('0x24')](_0x3fde76,_0x1c2169,!![]);}catch(_0xa6825e){return BPromise[_0x42e5('0x25')](_0xa6825e);}return _0x3fde76['save']();};}function saveUpdates(_0x4da508,_0x283d44){return function(_0x52d319){if(_0x52d319){return _0x52d319[_0x42e5('0x26')](_0x4da508)[_0x42e5('0x27')](function(_0x37d10e){return _0x37d10e;});}return null;};}function removeEntity(_0x49490f,_0x32380f){return function(_0x5d6b24){if(_0x5d6b24){return _0x5d6b24[_0x42e5('0x28')]()[_0x42e5('0x27')](function(){_0x49490f[_0x42e5('0x1e')](0xcc)[_0x42e5('0x1f')]();});}};}function handleEntityNotFound(_0x4638bc,_0x4f52b2){return function(_0x4fb147){if(!_0x4fb147){_0x4638bc[_0x42e5('0x1d')](0x194);}return _0x4fb147;};}function handleError(_0x534a26,_0x56f812){_0x56f812=_0x56f812||0x1f4;return function(_0x1b60be){logger['error'](_0x1b60be[_0x42e5('0x29')]);if(_0x1b60be[_0x42e5('0x2a')]){delete _0x1b60be[_0x42e5('0x2a')];}_0x534a26[_0x42e5('0x1e')](_0x56f812)[_0x42e5('0x2b')](_0x1b60be);};}function getInteractionUsers(_0x2f1edc,_0x59a46b){return new BPromise(function(_0x3e2ea5,_0x201d9e){try{if(_0x59a46b[_0x2f1edc['id']]){_0x2f1edc[_0x42e5('0x2c')]=_[_0x42e5('0x2d')](_0x59a46b[_0x2f1edc['id']],function(_0x1d22ba){return{'id':_0x1d22ba['id'],'fullname':_0x1d22ba[_0x42e5('0x2e')]};});}}catch(_0x383e97){_0x201d9e(_0x383e97);}_0x3e2ea5(_0x2f1edc);});}function getInteractionTags(_0x282cbf,_0x5a4930){return new BPromise(function(_0x2ba9ef,_0x2c7542){try{if(_0x282cbf[_0x42e5('0x2f')]){_0x282cbf[_0x42e5('0x30')]=[];_0x282cbf['TagIds'][_0x42e5('0x31')](',')[_0x42e5('0x32')](function(_0x14c8fd){_0x282cbf[_0x42e5('0x30')]['push'](_0x5a4930[_0x14c8fd]);});}delete _0x282cbf['TagIds'];}catch(_0x21d933){_0x2c7542(_0x21d933);}_0x2ba9ef(_0x282cbf);});}function updateSmsInteraction(_0x59f8d6,_0x45f402,_0x4988a2){return new BPromise(function(_0x472600,_0x188d9d){return getInteractionUsers(_0x59f8d6,_0x4988a2)[_0x42e5('0x27')](function(_0x49a22e){return getInteractionTags(_0x49a22e,_0x45f402);})[_0x42e5('0x27')](function(_0x3a8d1c){_0x472600(_0x3a8d1c);})['catch'](function(_0x1ae59c){_0x188d9d(_0x1ae59c);});});}exports['index']=function(_0x470ac5,_0x1cfc1d){var _0x25a040={},_0x2a1d23={},_0x3c12c6={'count':0x0,'rows':[]};var _0x41f891=_[_0x42e5('0x2d')](db['SmsInteraction']['rawAttributes'],function(_0xba86e2){return{'name':_0xba86e2[_0x42e5('0x33')],'type':_0xba86e2[_0x42e5('0x34')]['key']};});_0x2a1d23['model']=_['map'](_0x41f891,'name');_0x2a1d23[_0x42e5('0x35')]=_[_0x42e5('0x36')](_0x470ac5[_0x42e5('0x35')]);_0x2a1d23[_0x42e5('0x37')]=_[_0x42e5('0x38')](_0x2a1d23[_0x42e5('0x39')],_0x2a1d23[_0x42e5('0x35')]);_0x25a040[_0x42e5('0x3a')]=_['intersection'](_0x2a1d23[_0x42e5('0x39')],qs['fields'](_0x470ac5[_0x42e5('0x35')][_0x42e5('0x3b')]));_0x25a040[_0x42e5('0x3a')]=_0x25a040[_0x42e5('0x3a')][_0x42e5('0x3c')]?_0x25a040[_0x42e5('0x3a')]:_0x2a1d23[_0x42e5('0x39')];if(!_0x470ac5['query'][_0x42e5('0x3d')](_0x42e5('0x3e'))){_0x25a040['limit']=qs[_0x42e5('0x22')](_0x470ac5['query']['limit']);_0x25a040['offset']=qs[_0x42e5('0x3f')](_0x470ac5[_0x42e5('0x35')][_0x42e5('0x3f')]);}_0x25a040[_0x42e5('0x40')]=qs[_0x42e5('0x41')](_0x470ac5[_0x42e5('0x35')][_0x42e5('0x41')]);_0x25a040['where']=qs[_0x42e5('0x37')](_[_0x42e5('0x42')](_0x470ac5['query'],_0x2a1d23[_0x42e5('0x37')]),_0x41f891);var _0x1c697a=[];var _0x5db771=squel[_0x42e5('0x43')]()[_0x42e5('0x44')]('id')[_0x42e5('0x44')](_0x42e5('0x2a'))[_0x42e5('0x44')]('color')[_0x42e5('0x45')](_0x42e5('0x46'));var _0x19f684=squel[_0x42e5('0x43')]()['field'](_0x42e5('0x47'))[_0x42e5('0x44')](_0x42e5('0x48'))[_0x42e5('0x44')](_0x42e5('0x49'))[_0x42e5('0x45')](_0x42e5('0x4a'),'ui')[_0x42e5('0x4b')]('users','u',_0x42e5('0x4c'));var _0x5b27f6=squel['select']()[_0x42e5('0x45')](_0x42e5('0x4d'),'i')[_0x42e5('0x4b')](_0x42e5('0x4e'),'c',_0x42e5('0x4f'))[_0x42e5('0x4b')](_0x42e5('0x50'),'o','o.id\x20=\x20i.UserId')[_0x42e5('0x4b')](_0x42e5('0x51'),'a',_0x42e5('0x52'))[_0x42e5('0x4b')](_0x42e5('0x53'),'me',_0x42e5('0x54'))[_0x42e5('0x4b')](_0x42e5('0x55'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x42e5('0x4b')](_0x42e5('0x46'),'t',_0x42e5('0x56'));var _0x48757e=squel[_0x42e5('0x57')]();var _0x1ddc39=[];var _0xffc1e2=squel[_0x42e5('0x57')]();var _0x2586b0;if(_0x470ac5['query'][_0x42e5('0x58')]){_0x2586b0=as['parseSearch'](_0x470ac5[_0x42e5('0x35')][_0x42e5('0x58')]);var _0x326086=_0x2586b0['sqlOperator'];for(var _0x50f59c=0x0;_0x50f59c<_0x2586b0['conditions'][_0x42e5('0x3c')];_0x50f59c++){var _0x2601c6=_0x2586b0[_0x42e5('0x59')][_0x50f59c];var _0x148d2c='i';var _0x53edc8=_[_0x42e5('0x5a')](_0x41f891,[_0x42e5('0x2a'),_0x2601c6[_0x42e5('0x44')]]);if(!_0x53edc8){switch(_0x2601c6['field']){case _0x42e5('0x5b'):if(_0x2601c6['value']==0x1){_0x5b27f6[_0x42e5('0x5c')]('`'+_0x2601c6[_0x42e5('0x44')]+'`\x20=\x200');}else{_0x5b27f6[_0x42e5('0x5c')]('`'+_0x2601c6[_0x42e5('0x44')]+_0x42e5('0x5d'));}break;case _0x42e5('0x5e'):if(_0x2601c6[_0x42e5('0x5f')]===_0x42e5('0x60')){if(_0x2601c6[_0x42e5('0x61')][_0x42e5('0x31')]('\x20')[_0x42e5('0x3c')]>0x1){_0x48757e[_0x326086](_0x42e5('0x62'),qs['getFullTextValue'](_0x2601c6[_0x42e5('0x61')]),null);}else{var _0x384057='%'+_0x2601c6[_0x42e5('0x61')]+'%';_0x48757e[_0x326086](_0x42e5('0x63'),_0x384057,_0x384057,_0x384057);}}else{_0x53edc8=_[_0x42e5('0x5a')](_0x41f891,['name',_0x42e5('0x64')]);_0x2601c6[_0x42e5('0x44')]=_0x42e5('0x64');_0x304891=as[_0x42e5('0x65')](_0x148d2c,_0x53edc8['type'],_0x2601c6);_0x48757e[_0x326086](_0x304891['text'],_0x304891['value'][_0x42e5('0x66')],_0x304891[_0x42e5('0x61')]['end']);}break;case _0x42e5('0x67'):var _0xb73aa8=_0x2601c6[_0x42e5('0x61')][_0x42e5('0x31')](',')[_0x42e5('0x2d')](function(_0x4361cb){return Number(_0x4361cb);});_0xb73aa8[_0x42e5('0x32')](function(_0x2c76e0){_0xffc1e2['or'](_0x42e5('0x68'),'%,'+_0x2c76e0+',%');});_0x1ddc39=_['union'](_0x1ddc39,_0xb73aa8);break;case _0x42e5('0x69'):if(_0x2601c6['operator']===_0x42e5('0x60')){_0x48757e[_0x326086](_0x42e5('0x6a'),'%'+_0x2601c6[_0x42e5('0x61')]+'%',null);}else{_0x53edc8=_[_0x42e5('0x5a')](_0x41f891,[_0x42e5('0x2a'),_0x42e5('0x6b')]);_0x2601c6[_0x42e5('0x44')]=_0x42e5('0x6b');_0x304891=as[_0x42e5('0x65')](_0x148d2c,_0x53edc8[_0x42e5('0x34')],_0x2601c6);_0x48757e[_0x326086](_0x304891[_0x42e5('0x6c')],_0x304891['value'][_0x42e5('0x66')],_0x304891['value'][_0x42e5('0x1f')]);}break;case'body':_0x304891=as[_0x42e5('0x65')]('me',null,_0x2601c6);_0x48757e[_0x326086](_0x304891[_0x42e5('0x6c')],_0x304891['value'][_0x42e5('0x66')],_0x304891[_0x42e5('0x61')]['end']);break;}}else{var _0x304891=as[_0x42e5('0x65')](_0x148d2c,_0x53edc8['type'],_0x2601c6);_0x48757e[_0x326086](_0x304891[_0x42e5('0x6c')],_0x304891[_0x42e5('0x61')][_0x42e5('0x66')],_0x304891['value'][_0x42e5('0x1f')]);}}}else{var _0x3cdc61=_(_0x470ac5[_0x42e5('0x35')])[_0x42e5('0x36')]()['map'](function(_0x42db50){return _['some'](_0x41f891,[_0x42e5('0x2a'),_0x42db50])?_0x42db50:undefined;})[_0x42e5('0x6d')]()[_0x42e5('0x61')]();if(!_[_0x42e5('0x6e')](_0x3cdc61)){_0x3cdc61[_0x42e5('0x32')](function(_0x3c6914){if(_0x3c6914===_0x42e5('0x6f')){_0x5b27f6['where'](_0x42e5('0x70'),[][_0x42e5('0x71')](_0x470ac5[_0x42e5('0x35')][_0x3c6914]));}else if(_0x3c6914===_0x42e5('0x72')){var _0x21a8aa=JSON[_0x42e5('0x73')](_0x470ac5[_0x42e5('0x35')][_0x3c6914])[_0x42e5('0x74')];var _0x292249=JSON['parse'](_0x470ac5[_0x42e5('0x35')][_0x3c6914])[_0x42e5('0x75')];_0x5b27f6[_0x42e5('0x76')](_0x42e5('0x77'),_0x21a8aa,_0x292249);}else{if(_0x470ac5['query'][_0x3c6914]===_0x42e5('0x78')){_0x5b27f6[_0x42e5('0x76')]('i.'+_0x3c6914+_0x42e5('0x79'));}else{_0x5b27f6[_0x42e5('0x76')]('i.'+_0x3c6914+'\x20=\x20?',_0x470ac5['query'][_0x3c6914]);}}});}if(_0x470ac5['query'][_0x42e5('0x7a')]){if(_0x470ac5[_0x42e5('0x35')][_0x42e5('0x7a')]==0x1){_0x5b27f6[_0x42e5('0x5c')](_0x42e5('0x7b'));}else{_0x5b27f6[_0x42e5('0x5c')](_0x42e5('0x7c'));}}if(_0x470ac5[_0x42e5('0x35')][_0x42e5('0x7d')]){_0x1ddc39=_['isArray'](_0x470ac5[_0x42e5('0x35')][_0x42e5('0x7d')])?_0x470ac5[_0x42e5('0x35')][_0x42e5('0x7d')]:new Array(_0x470ac5[_0x42e5('0x35')][_0x42e5('0x7d')]);_0x1ddc39[_0x42e5('0x32')](function(_0x147613){_0xffc1e2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x147613+',%');});}if(_0x470ac5['query'][_0x42e5('0x7e')]){var _0x201650=_0x470ac5['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x42e5('0x7f')]('\x27\x27',_0x42e5('0x80'));if(qs['isNumeric'](_0x201650)){_0x48757e['or'](_0x42e5('0x81'),_0x201650+'%')['or'](_0x42e5('0x82'),_0x201650+'%');}else{_0x48757e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x42e5('0x83')](_0x201650))['or'](_0x42e5('0x84'),_0x201650+'%');}}}_0x5b27f6['where'](_0x48757e);_0x5b27f6[_0x42e5('0x85')]('i.id');var _0x49945e={'type':db['Sequelize']['QueryTypes'][_0x42e5('0x86')],'raw':!![]};var _0x234e29=_0x5b27f6['clone']();_0x234e29[_0x42e5('0x44')](_0x42e5('0x87'));_0x234e29[_0x42e5('0x44')](_0x42e5('0x88'),_0x42e5('0x5b'));if(_0x25a040[_0x42e5('0x40')]){_0x25a040['order'][_0x42e5('0x32')](function(_0xe0f6ab){_0x5b27f6['order']('i.'+_0xe0f6ab[0x0],_0xe0f6ab[0x1]==='DESC'?![]:!![]);});}if(!_[_0x42e5('0x6e')](_0x1ddc39)){_0x5b27f6[_0x42e5('0x5c')](_0xffc1e2);_0x234e29[_0x42e5('0x76')](_0x42e5('0x89'),_0x1ddc39);}BPromise[_0x42e5('0x8a')]()[_0x42e5('0x27')](function(){if(!_0x2586b0){if(_0x470ac5[_0x42e5('0x35')]['SmsAccountId']||_0x470ac5['query']['journey'])return;_0x234e29['where'](_0x42e5('0x8b'));_0x5b27f6[_0x42e5('0x76')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}return _0x470ac5[_0x42e5('0x8c')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x42e5('0x27')](function(_0x2982a2){if(_[_0x42e5('0x6e')](_0x2982a2)){_0x234e29[_0x42e5('0x76')](_0x42e5('0x8d'));_0x5b27f6[_0x42e5('0x76')](_0x42e5('0x8d'));}else{_0x234e29[_0x42e5('0x76')](_0x42e5('0x70'),_[_0x42e5('0x2d')](_0x2982a2,'id'));_0x5b27f6[_0x42e5('0x76')](_0x42e5('0x70'),_[_0x42e5('0x2d')](_0x2982a2,'id'));}});})[_0x42e5('0x27')](function(){db[_0x42e5('0x8e')][_0x42e5('0x35')](_0x234e29[_0x42e5('0x8f')](),_0x49945e)[_0x42e5('0x27')](function(_0x511e71){_0x3c12c6[_0x42e5('0x21')]=_0x511e71[_0x42e5('0x3c')];if(_0x3c12c6[_0x42e5('0x21')]===0x0)return[];return db[_0x42e5('0x8e')][_0x42e5('0x35')](_0x5db771[_0x42e5('0x8f')](),_0x49945e)[_0x42e5('0x27')](function(_0x103338){_0x1c697a=_['keyBy'](_0x103338,'id');_0x49945e=_[_0x42e5('0x90')](_0x49945e,{'model':db[_0x42e5('0x91')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x470ac5[_0x42e5('0x35')][_0x42e5('0x3b')]){_0x25a040[_0x42e5('0x3a')]['forEach'](function(_0x590cc8){_0x5b27f6[_0x42e5('0x44')]('i.'+_0x590cc8);});}else{_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x88'),_0x42e5('0x5b'));_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x92'),_0x42e5('0x93'));_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x94'),'Account.mandatoryDisposition');_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x95'));_0x5b27f6['field'](_0x42e5('0x96'),_0x42e5('0x97'));_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x98'),'Contact.lastName');_0x5b27f6['field']('c.email',_0x42e5('0x99'));_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x9a'),_0x42e5('0x9b'));_0x5b27f6[_0x42e5('0x44')](_0x42e5('0x9c'),_0x42e5('0x9d'));_0x5b27f6['field'](_0x42e5('0x9e'),_0x42e5('0x9f'));_0x5b27f6[_0x42e5('0x44')]('o.fullname',_0x42e5('0xa0'));_0x5b27f6['field']('o.internal',_0x42e5('0xa1'));_0x5b27f6[_0x42e5('0x44')](_0x42e5('0xa2'),'TagIds');}if(_0x25a040['limit'])_0x5b27f6[_0x42e5('0x22')](_0x25a040['limit']);if(_0x25a040['offset'])_0x5b27f6[_0x42e5('0x3f')](_0x25a040[_0x42e5('0x3f')]);return db['sequelize'][_0x42e5('0x35')](_0x5b27f6[_0x42e5('0x8f')](),_0x49945e);})[_0x42e5('0x27')](function(_0x161f3d){_0x19f684[_0x42e5('0x76')](_0x42e5('0xa3'),_['map'](_0x161f3d,'id'));return db[_0x42e5('0x8e')][_0x42e5('0x35')](_0x19f684[_0x42e5('0x8f')](),_0x49945e)['then'](function(_0x27ee6e){var _0x13c9fd=_['groupBy'](_0x27ee6e,_0x42e5('0xa4'));var _0x3aa7be=[];_0x161f3d[_0x42e5('0x32')](function(_0x4a1bb8){_0x3aa7be[_0x42e5('0xa5')](updateSmsInteraction(_0x4a1bb8,_0x1c697a,_0x13c9fd));});return BPromise[_0x42e5('0xa6')](_0x3aa7be);});});})['then'](function(_0x4fcc38){_0x3c12c6[_0x42e5('0xa7')]=_0x4fcc38;return _0x3c12c6;})['then'](respondWithFilteredResult(_0x1cfc1d,_0x25a040));})[_0x42e5('0xa8')](handleError(_0x1cfc1d,null));};exports[_0x42e5('0xa9')]=function(_0x7e8361,_0x1d3c01){var _0x1ece99={'raw':![],'where':{'id':_0x7e8361[_0x42e5('0xaa')]['id']}},_0x5cf7e1={};_0x5cf7e1[_0x42e5('0x39')]=_[_0x42e5('0x36')](db['SmsInteraction'][_0x42e5('0xab')]);_0x5cf7e1[_0x42e5('0x35')]=_[_0x42e5('0x36')](_0x7e8361[_0x42e5('0x35')]);_0x5cf7e1['filters']=_[_0x42e5('0x38')](_0x5cf7e1['model'],_0x5cf7e1['query']);_0x1ece99[_0x42e5('0x3a')]=_[_0x42e5('0x38')](_0x5cf7e1[_0x42e5('0x39')],qs[_0x42e5('0x3b')](_0x7e8361[_0x42e5('0x35')]['fields']));_0x1ece99[_0x42e5('0x3a')]=_0x1ece99[_0x42e5('0x3a')][_0x42e5('0x3c')]?_0x1ece99[_0x42e5('0x3a')]:_0x5cf7e1[_0x42e5('0x39')];if(_0x7e8361[_0x42e5('0x35')][_0x42e5('0xac')]){_0x1ece99[_0x42e5('0xad')]=[{'all':!![]}];}_0x1ece99=_[_0x42e5('0x90')]({},_0x1ece99,_0x7e8361['options']);return db[_0x42e5('0x91')][_0x42e5('0x5a')](_0x1ece99)[_0x42e5('0x27')](handleEntityNotFound(_0x1d3c01,null))[_0x42e5('0x27')](respondWithResult(_0x1d3c01,null))[_0x42e5('0xa8')](handleError(_0x1d3c01,null));};exports[_0x42e5('0xae')]=function(_0x39c46,_0x432105){return db[_0x42e5('0x91')][_0x42e5('0xae')](_0x39c46['body'],{})['then'](respondWithResult(_0x432105,0xc9))['catch'](handleError(_0x432105,null));};exports[_0x42e5('0x26')]=function(_0x2b6553,_0x4b284a){if(_0x2b6553[_0x42e5('0xaf')]['id']){delete _0x2b6553['body']['id'];}return db[_0x42e5('0x91')]['find']({'where':{'id':_0x2b6553['params']['id']}})['then'](handleEntityNotFound(_0x4b284a,null))[_0x42e5('0x27')](saveUpdates(_0x2b6553[_0x42e5('0xaf')],null))[_0x42e5('0x27')](respondWithResult(_0x4b284a,null))[_0x42e5('0xa8')](handleError(_0x4b284a,null));};exports[_0x42e5('0x28')]=function(_0x5398c3,_0x4b5500){return db[_0x42e5('0x91')][_0x42e5('0x5a')]({'where':{'id':_0x5398c3[_0x42e5('0xaa')]['id']}})[_0x42e5('0x27')](handleEntityNotFound(_0x4b5500,null))[_0x42e5('0x27')](removeEntity(_0x4b5500,null))['catch'](handleError(_0x4b5500,null));};exports[_0x42e5('0xb0')]=function(_0x3d3b01,_0x3ec86e){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0x3ec86e,null))[_0x42e5('0xa8')](handleError(_0x3ec86e,null));};exports['addMessage']=function(_0x164146,_0x333376,_0x4fb2fd){return db[_0x42e5('0xb1')][_0x42e5('0x5a')]({'where':{'id':_0x164146[_0x42e5('0xaa')]['id']}})['then'](handleEntityNotFound(_0x333376,null))[_0x42e5('0x27')](function(_0xa1efc){if(_0xa1efc){return _0xa1efc[_0x42e5('0xb2')](_0x164146[_0x42e5('0xaf')][_0x42e5('0xb3')],_['omit'](_0x164146[_0x42e5('0xaf')],[_0x42e5('0xb3'),'id'])||{});}})[_0x42e5('0x27')](respondWithResult(_0x333376,null))[_0x42e5('0xa8')](handleError(_0x333376,null));};exports[_0x42e5('0xb4')]=function(_0x59a32e,_0x1b74eb,_0x3d7d9c){var _0x4ca710={'raw':![],'where':{}};var _0x2cf42b={};var _0x11b2b8={'count':0x0,'rows':[]};return db[_0x42e5('0x91')][_0x42e5('0xb5')]({'where':{'id':_0x59a32e[_0x42e5('0xaa')]['id']}})[_0x42e5('0x27')](handleEntityNotFound(_0x1b74eb,null))[_0x42e5('0x27')](function(_0x279dea){if(_0x279dea){_0x2cf42b['model']=_[_0x42e5('0x36')](db[_0x42e5('0xb1')][_0x42e5('0xab')]);_0x2cf42b[_0x42e5('0x35')]=_[_0x42e5('0x36')](_0x59a32e['query']);_0x2cf42b[_0x42e5('0x37')]=_[_0x42e5('0x38')](_0x2cf42b[_0x42e5('0x39')],_0x2cf42b[_0x42e5('0x35')]);_0x4ca710['attributes']=_[_0x42e5('0x38')](_0x2cf42b[_0x42e5('0x39')],qs[_0x42e5('0x3b')](_0x59a32e[_0x42e5('0x35')][_0x42e5('0x3b')]));_0x4ca710[_0x42e5('0x3a')]=_0x4ca710[_0x42e5('0x3a')][_0x42e5('0x3c')]?_0x4ca710[_0x42e5('0x3a')]:_0x2cf42b[_0x42e5('0x39')];if(!_0x59a32e['query'][_0x42e5('0x3d')]('nolimit')){_0x4ca710[_0x42e5('0x22')]=qs['limit'](_0x59a32e['query'][_0x42e5('0x22')]);_0x4ca710[_0x42e5('0x3f')]=qs[_0x42e5('0x3f')](_0x59a32e[_0x42e5('0x35')][_0x42e5('0x3f')]);}_0x4ca710[_0x42e5('0x40')]=qs[_0x42e5('0x41')](_0x59a32e[_0x42e5('0x35')][_0x42e5('0x41')]);_0x4ca710[_0x42e5('0x76')]=qs[_0x42e5('0x37')](_[_0x42e5('0x42')](_0x59a32e[_0x42e5('0x35')],_0x2cf42b[_0x42e5('0x37')]));_0x4ca710['where'][_0x42e5('0xa4')]=_0x279dea['id'];if(_0x59a32e[_0x42e5('0x35')][_0x42e5('0x7e')]){_0x4ca710['where']=_[_0x42e5('0x90')](_0x4ca710['where'],{'$or':_['map'](_0x4ca710[_0x42e5('0x3a')],function(_0x1ad5ee){var _0x51ca3b={};_0x51ca3b[_0x1ad5ee]={'$like':'%'+_0x59a32e[_0x42e5('0x35')][_0x42e5('0x7e')]+'%'};return _0x51ca3b;})});}if(_0x59a32e[_0x42e5('0x35')]['$gte']){var _0x38653a=_0x59a32e[_0x42e5('0x35')][_0x42e5('0x74')]['split'](',');var _0x1f173f={};_0x1f173f[_0x38653a[0x0]]={'$gte':moment(_0x38653a[0x1])[_0x42e5('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ca710[_0x42e5('0x76')]=_[_0x42e5('0x90')](_0x4ca710[_0x42e5('0x76')],_0x1f173f);}_0x4ca710=_['merge']({},_0x4ca710,_0x59a32e[_0x42e5('0xb7')]);return db[_0x42e5('0xb1')]['count']({'where':_0x4ca710[_0x42e5('0x76')]})['then'](function(_0x3ceac8){_0x11b2b8[_0x42e5('0x21')]=_0x3ceac8;if(_0x59a32e['query'][_0x42e5('0xac')]){_0x4ca710[_0x42e5('0xad')]=[{'all':!![]}];}return db[_0x42e5('0xb1')][_0x42e5('0xb8')](_0x4ca710);})[_0x42e5('0x27')](function(_0x3ebfd5){_0x11b2b8[_0x42e5('0xa7')]=_0x3ebfd5;return _0x11b2b8;});}})[_0x42e5('0x27')](respondWithFilteredResult(_0x1b74eb,_0x4ca710))[_0x42e5('0xa8')](handleError(_0x1b74eb,null));};exports[_0x42e5('0xb9')]=function(_0xe589e5,_0x44daee,_0x1d99b2){return db['SmsInteraction']['find']({'where':{'id':_0xe589e5[_0x42e5('0xaa')]['id']}})[_0x42e5('0x27')](handleEntityNotFound(_0x44daee,null))[_0x42e5('0x27')](function(_0x315f86){if(_0x315f86){return _0x315f86[_0x42e5('0xba')](_0xe589e5[_0x42e5('0xaf')][_0x42e5('0xb3')],_['omit'](_0xe589e5[_0x42e5('0xaf')],[_0x42e5('0xb3'),'id'])||{})[_0x42e5('0xbb')](function(){return db[_0x42e5('0x67')][_0x42e5('0xb8')]({'attributes':['id',_0x42e5('0x2a'),'color'],'where':{'id':_0xe589e5[_0x42e5('0xaf')][_0x42e5('0xb3')]}});})['then'](function(_0x2c18bd){socket[_0x42e5('0xbc')](_0x42e5('0xbd'),{'id':Number(_0xe589e5['params']['id']),'tags':_0x2c18bd||[]});return{'id':Number(_0xe589e5[_0x42e5('0xaa')]['id']),'tags':_0x2c18bd||[]};});}})['then'](respondWithResult(_0x44daee,null))[_0x42e5('0xa8')](handleError(_0x44daee,null));};exports[_0x42e5('0xbe')]=function(_0xa14584,_0x4a816b,_0x29d879){return db[_0x42e5('0x91')][_0x42e5('0x5a')]({'where':{'id':_0xa14584[_0x42e5('0xaa')]['id']}})[_0x42e5('0x27')](handleEntityNotFound(_0x4a816b,null))[_0x42e5('0x27')](function(_0x35f5f2){if(_0x35f5f2){return _0x35f5f2['removeTags'](_0xa14584[_0x42e5('0x35')][_0x42e5('0xb3')]);}})[_0x42e5('0x27')](respondWithStatusCode(_0x4a816b,null))[_0x42e5('0xa8')](handleError(_0x4a816b,null));};exports[_0x42e5('0xbf')]=function(_0x584da4,_0x359fe2){var _0x25ca2c=moment()[_0x42e5('0xc0')]()['toString']();var _0x4f35a4=path[_0x42e5('0xc1')](config['root'],_0x42e5('0xc2'),'files',_0x42e5('0xc3'));var _0x5f0e8e=path['join'](config[_0x42e5('0xc4')],_0x42e5('0xc2'),_0x42e5('0xc5'),'attachments');var _0x33f870=path[_0x42e5('0xc1')](_0x4f35a4,_0x25ca2c);var _0x7d3bd2=util['format'](_0x42e5('0xc6'),_0x584da4[_0x42e5('0xaa')]['id'],_0x25ca2c);var _0x22c7dd=path[_0x42e5('0xc1')](_0x4f35a4,_0x7d3bd2);var _0x5b0001=[];_0x5b0001['push']({'model':db[_0x42e5('0x69')],'as':_0x42e5('0x69'),'attributes':['id',_0x42e5('0x2e')],'raw':!![]});_0x5b0001[_0x42e5('0xa5')]({'model':db[_0x42e5('0xc7')],'as':_0x42e5('0x5e'),'attributes':['id','firstName',_0x42e5('0xc8')],'raw':!![]});var _0x147fc3=[{'model':db[_0x42e5('0xb1')],'as':'Messages','attributes':['id',_0x42e5('0xaf'),_0x42e5('0x72'),_0x42e5('0xc9'),_0x42e5('0xca'),_0x42e5('0x7a')],'include':_0x5b0001}];_0x147fc3[_0x42e5('0xa5')]({'model':db[_0x42e5('0xcb')],'as':_0x42e5('0xcc'),'attributes':['id','name']});_0x147fc3['push']({'model':db['User'],'as':_0x42e5('0xcd'),'attributes':['id',_0x42e5('0x2e')]});return db[_0x42e5('0x91')]['find']({'where':{'id':_0x584da4[_0x42e5('0xaa')]['id']},'include':_0x147fc3})[_0x42e5('0x27')](handleEntityNotFound(_0x359fe2,null))['then'](function(_0x1442a2){if(_0x1442a2){var _0x566515=_0x1442a2['get']({'plain':!![]});fs[_0x42e5('0xce')](_0x33f870);var _0x2ec7c6={'format':'A4','border':'10px','header':{'height':_0x42e5('0xcf'),'contents':{'first':_0x42e5('0xd0')}},'footer':{'height':_0x42e5('0xd1'),'contents':{'default':util[_0x42e5('0xb6')](_0x42e5('0xd2'),util[_0x42e5('0xb6')](_0x42e5('0xd3'),'Sms',_0x566515['id']),moment()[_0x42e5('0xb6')]('YYYY-MM-DD')['toString']())}}};var _0x347698={'channel':_0x42e5('0xd4'),'account':_0x566515['Account']['name'],'agent':_0x566515['Owner']?_0x566515['Owner']['fullname']:_0x42e5('0xd5'),'createdAt':moment(_0x566515[_0x42e5('0x72')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x566515[_0x42e5('0xd6')]?moment(_0x566515[_0x42e5('0xd7')])[_0x42e5('0xb6')](_0x42e5('0xd8'))['toString']():'','disposition':_0x566515[_0x42e5('0xd9')],'messages':_(_0x566515['Messages'])[_0x42e5('0x7e')]({'secret':![]})[_0x42e5('0x2d')](function(_0x4070c2){return{'date':moment(_0x4070c2[_0x42e5('0x72')])[_0x42e5('0xb6')](_0x42e5('0xd8'))[_0x42e5('0x8f')](),'sender':_0x4070c2[_0x42e5('0xc9')]===_0x42e5('0xda')?_0x4070c2[_0x42e5('0x69')]?_0x4070c2['User'][_0x42e5('0x2e')]:_0x42e5('0xdb'):_0x4070c2[_0x42e5('0x5e')][_0x42e5('0xdc')]+(_0x4070c2[_0x42e5('0x5e')][_0x42e5('0xc8')]?'\x20'+_0x4070c2[_0x42e5('0x5e')][_0x42e5('0xc8')]:''),'body':_0x4070c2['body'],'direction':_0x4070c2[_0x42e5('0xc9')]===_0x42e5('0xda')?'A':'C','secret':_0x4070c2[_0x42e5('0xca')],'read':_0x4070c2[_0x42e5('0x7a')]};})['value']()};return ejs[_0x42e5('0xdd')](path[_0x42e5('0xc1')](config[_0x42e5('0xc4')],_0x42e5('0xc2'),_0x42e5('0xde'),_0x42e5('0xdf')),{'interaction':_0x347698})['then'](function(_0x5d6ba1){return new BPromise(function(_0x42249f,_0x27dc39){pdf['create'](_0x5d6ba1,_0x2ec7c6)[_0x42e5('0xe0')](path[_0x42e5('0xc1')](_0x33f870,_0x42e5('0xe1')+_0x566515['id']+'-'+_0x25ca2c+_0x42e5('0xe2')),function(_0x223402,_0x5e14e7){if(_0x223402)return _0x27dc39(_0x223402);_0x42249f(_0x5e14e7);});});})[_0x42e5('0x27')](function(){return new BPromise(function(_0x4a9099,_0x397dbb){zipdir(_0x33f870,{'saveTo':_0x22c7dd},function(_0x40cc1a,_0x12d54c){if(_0x40cc1a)return _0x397dbb(_0x40cc1a);return _0x4a9099(_0x12d54c);});})[_0x42e5('0x27')](function(){return new BPromise(function(_0x3f9c68,_0x2e9459){rimraf(_0x33f870,function(_0x3cdc8c){if(_0x3cdc8c)_0x2e9459(_0x3cdc8c);return _0x3f9c68();});});})[_0x42e5('0x27')](function(){return _0x359fe2[_0x42e5('0xbf')](_0x22c7dd,_0x7d3bd2,function(_0x495bca){if(_0x495bca){console['log']('err',_0x495bca);}else{fs['unlinkSync'](_0x22c7dd);}});});});}else{return _0x359fe2['sendStatus'](0xc8);}})['catch'](handleError(_0x359fe2,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 64022a1..3aaf100 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 _0x0309=['setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','SmsMessage'];(function(_0x166886,_0x382754){var _0x29b31f=function(_0x21fa1f){while(--_0x21fa1f){_0x166886['push'](_0x166886['shift']());}};_0x29b31f(++_0x382754);}(_0x0309,0x165));var _0x9030=function(_0x3706a6,_0x5f040c){_0x3706a6=_0x3706a6-0x0;var _0x3203ba=_0x0309[_0x3706a6];return _0x3203ba;};'use strict';var EventEmitter=require(_0x9030('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x9030('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x9030('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x9030('0x3')](0x0);var events={'afterCreate':_0x9030('0x4'),'afterUpdate':_0x9030('0x5'),'afterDestroy':_0x9030('0x6')};function emitEvent(_0x2e6276){return function(_0xcbbe57,_0x482786,_0x5a3334){_0xcbbe57[_0x9030('0x7')]({'attributes':['id'],'raw':!![]})[_0x9030('0x8')](function(_0x4f2d84){_0xcbbe57[_0x9030('0x9')]('Users',_0x4f2d84[_0x9030('0xa')](function(_0x32d47d){return{'id':_0x32d47d['id']};}));return SmsMessage[_0x9030('0xb')]({'where':{'SmsInteractionId':_0xcbbe57['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xe2c28b){_0xcbbe57[_0x9030('0x9')](_0x9030('0xc'),_0xe2c28b['length']);SmsInteractionEvents[_0x9030('0xd')](_0x2e6276+':'+_0xcbbe57['id'],_0xcbbe57);SmsInteractionEvents[_0x9030('0xd')](_0x2e6276,_0xcbbe57);_0x5a3334(null);})[_0x9030('0xe')](_0x5a3334(null));};}for(var e in events){if(events[_0x9030('0xf')](e)){var event=events[e];SmsInteraction[_0x9030('0x10')](e,emitEvent(event));}}module[_0x9030('0x11')]=SmsInteractionEvents; \ No newline at end of file +var _0x4006=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','../../mysqldb','SmsInteraction','SmsMessage','update','then','setDataValue','Users'];(function(_0x338f73,_0x1945c8){var _0x163fdf=function(_0x4cd033){while(--_0x4cd033){_0x338f73['push'](_0x338f73['shift']());}};_0x163fdf(++_0x1945c8);}(_0x4006,0x1c7));var _0x6400=function(_0x59a075,_0x10b566){_0x59a075=_0x59a075-0x0;var _0xdc68cd=_0x4006[_0x59a075];return _0xdc68cd;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x6400('0x0'))['db'][_0x6400('0x1')];var SmsMessage=require(_0x6400('0x0'))['db'][_0x6400('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6400('0x3'),'afterDestroy':'remove'};function emitEvent(_0xd858df){return function(_0x59fba5,_0x4a0d3f,_0x2dbd03){_0x59fba5['getUsers']({'attributes':['id'],'raw':!![]})[_0x6400('0x4')](function(_0x2d365b){_0x59fba5[_0x6400('0x5')](_0x6400('0x6'),_0x2d365b['map'](function(_0x31cc99){return{'id':_0x31cc99['id']};}));return SmsMessage[_0x6400('0x7')]({'where':{'SmsInteractionId':_0x59fba5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6400('0x4')](function(_0x356982){_0x59fba5[_0x6400('0x5')](_0x6400('0x8'),_0x356982[_0x6400('0x9')]);SmsInteractionEvents[_0x6400('0xa')](_0xd858df+':'+_0x59fba5['id'],_0x59fba5);SmsInteractionEvents[_0x6400('0xa')](_0xd858df,_0x59fba5);_0x2dbd03(null);})[_0x6400('0xb')](_0x2dbd03(null));};}for(var e in events){if(events[_0x6400('0xc')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x6400('0xd')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index ca466b7..e2d9c4a 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 _0x997d=['./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x188d1b,_0x10d96d){var _0x3c7d67=function(_0x238ee5){while(--_0x238ee5){_0x188d1b['push'](_0x188d1b['shift']());}};_0x3c7d67(++_0x10d96d);}(_0x997d,0x181));var _0xd997=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x997d[_0x2eec1f];return _0x543075;};'use strict';var _=require(_0xd997('0x0'));var util=require(_0xd997('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd997('0x2'));var BPromise=require(_0xd997('0x3'));var rp=require(_0xd997('0x4'));var fs=require('fs');var path=require(_0xd997('0x5'));var rimraf=require('rimraf');var config=require(_0xd997('0x6'));var attributes=require(_0xd997('0x7'));module[_0xd997('0x8')]=function(_0xcb443c,_0xcedc23){return _0xcb443c[_0xd997('0x9')](_0xd997('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1000ad,_0x34dcb3,_0x223e5d){if(_0x1000ad[_0xd997('0xb')](_0xd997('0xc'))){_0x1000ad['closedAt']=moment()['format'](_0xd997('0xd'));}_0x223e5d(null,_0x1000ad);}}});}; \ No newline at end of file +var _0x1f4f=['path','exports','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird'];(function(_0x573d04,_0x476145){var _0x3fdf14=function(_0x22bba3){while(--_0x22bba3){_0x573d04['push'](_0x573d04['shift']());}};_0x3fdf14(++_0x476145);}(_0x1f4f,0x1a8));var _0xf1f4=function(_0x58b62a,_0x1205a6){_0x58b62a=_0x58b62a-0x0;var _0x5c86be=_0x1f4f[_0x58b62a];return _0x5c86be;};'use strict';var _=require(_0xf1f4('0x0'));var util=require(_0xf1f4('0x1'));var logger=require(_0xf1f4('0x2'))('api');var moment=require(_0xf1f4('0x3'));var BPromise=require(_0xf1f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1f4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0xf1f4('0x6')]=function(_0xbc11df,_0x526d25){return _0xbc11df['define'](_0xf1f4('0x7'),attributes,{'tableName':_0xf1f4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52c79a,_0x268637,_0x5c976d){if(_0x52c79a[_0xf1f4('0x9')]('closed')){_0x52c79a[_0xf1f4('0xa')]=moment()[_0xf1f4('0xb')](_0xf1f4('0xc'));}_0x5c976d(null,_0x52c79a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index a8d06fa..4b8b534 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 _0x86be=['catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1f03e6,_0xea8efa){var _0x125621=function(_0x5424b8){while(--_0x5424b8){_0x1f03e6['push'](_0x1f03e6['shift']());}};_0x125621(++_0xea8efa);}(_0x86be,0x13f));var _0xe86b=function(_0x3b0dbc,_0x2661bd){_0x3b0dbc=_0x3b0dbc-0x0;var _0x527897=_0x86be[_0x3b0dbc];return _0x527897;};'use strict';var _=require('lodash');var util=require(_0xe86b('0x0'));var moment=require('moment');var BPromise=require(_0xe86b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe86b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe86b('0x3'));var logger=require(_0xe86b('0x4'))(_0xe86b('0x5'));var config=require(_0xe86b('0x6'));var jayson=require(_0xe86b('0x7'));var client=jayson[_0xe86b('0x8')][_0xe86b('0x9')]({'port':0x232a});config[_0xe86b('0xa')]=_['defaults'](config[_0xe86b('0xa')],{'host':_0xe86b('0xb'),'port':0x18eb});var socket=require(_0xe86b('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0xe86b('0xd')](socket);function respondWithRpcPromise(_0x231a3e,_0x1181bd,_0x3e97ea){return new BPromise(function(_0x75e020,_0x3ff1f2){return client[_0xe86b('0xe')](_0x231a3e,_0x3e97ea)['then'](function(_0x512cf0){logger[_0xe86b('0xf')](_0xe86b('0x10'),_0x1181bd,_0xe86b('0x11'));logger[_0xe86b('0x12')](_0xe86b('0x13'),_0x1181bd,_0xe86b('0x11'),JSON[_0xe86b('0x14')](_0x512cf0));if(_0x512cf0[_0xe86b('0x15')]){if(_0x512cf0[_0xe86b('0x15')][_0xe86b('0x16')]===0x1f4){logger[_0xe86b('0x15')](_0xe86b('0x10'),_0x1181bd,_0x512cf0[_0xe86b('0x15')][_0xe86b('0x17')]);return _0x3ff1f2(_0x512cf0['error'][_0xe86b('0x17')]);}logger['error'](_0xe86b('0x10'),_0x1181bd,_0x512cf0['error'][_0xe86b('0x17')]);return _0x75e020(_0x512cf0[_0xe86b('0x15')][_0xe86b('0x17')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1181bd,_0xe86b('0x11'));_0x75e020(_0x512cf0[_0xe86b('0x18')][_0xe86b('0x17')]);}})[_0xe86b('0x19')](function(_0x14f252){logger[_0xe86b('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x1181bd,_0x14f252);_0x3ff1f2(_0x14f252);});});}exports[_0xe86b('0x1a')]=function(_0x575b2b){var _0x4a98c9=this;return new Promise(function(_0x292c7d,_0x594173){return db[_0xe86b('0x1b')][_0xe86b('0x1c')](_0x575b2b[_0xe86b('0x1d')],{'raw':_0x575b2b[_0xe86b('0x1e')]?_0x575b2b[_0xe86b('0x1e')][_0xe86b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x575b2b[_0xe86b('0x1e')]?_0x575b2b['options'][_0xe86b('0x20')]||null:null,'attributes':_0x575b2b[_0xe86b('0x1e')]?_0x575b2b['options'][_0xe86b('0x21')]||null:null,'limit':_0x575b2b[_0xe86b('0x1e')]?_0x575b2b[_0xe86b('0x1e')][_0xe86b('0x22')]||null:null})[_0xe86b('0x23')](function(_0x56f394){logger[_0xe86b('0xf')](_0xe86b('0x1a'),_0x575b2b);logger[_0xe86b('0x12')](_0xe86b('0x1a'),_0x575b2b,JSON[_0xe86b('0x14')](_0x56f394));_0x292c7d(_0x56f394);})[_0xe86b('0x19')](function(_0x5148aa){logger[_0xe86b('0x15')](_0xe86b('0x1a'),_0x5148aa['message'],_0x575b2b);_0x594173(_0x4a98c9[_0xe86b('0x15')](0x1f4,_0x5148aa[_0xe86b('0x17')]));});});};exports[_0xe86b('0x24')]=function(_0x38e902){return new Promise(function(_0x34d68b,_0x35640a){return db[_0xe86b('0x1b')][_0xe86b('0x25')]({'where':_0x38e902[_0xe86b('0x1e')]?_0x38e902['options'][_0xe86b('0x20')]||null:null})[_0xe86b('0x23')](function(_0x250882){if(_0x250882){return _0x250882[_0xe86b('0x26')](_0x38e902[_0xe86b('0x1d')][_0xe86b('0x27')],_[_0xe86b('0x28')](_0x38e902[_0xe86b('0x1d')],[_0xe86b('0x27'),'id'])||{});}})[_0xe86b('0x29')](function(_0x43e094){logger[_0xe86b('0xf')](_0xe86b('0x2a'),_0x38e902);logger[_0xe86b('0x12')]('AddTags',_0x38e902,JSON[_0xe86b('0x14')](_0x43e094));_0x34d68b(_0x43e094);})[_0xe86b('0x19')](function(_0x2e974f){logger[_0xe86b('0x15')](_0xe86b('0x2a'),_0x2e974f[_0xe86b('0x17')],_0x38e902);_0x35640a(_this['error'](0x1f4,_0x2e974f[_0xe86b('0x17')]));});});}; \ No newline at end of file +var _0x62e4=['./smsInteraction.socket','register','request','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','SmsInteraction','update','options','raw','where','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x53c0d0,_0x5cadac){var _0x249c79=function(_0x4e5d1e){while(--_0x4e5d1e){_0x53c0d0['push'](_0x53c0d0['shift']());}};_0x249c79(++_0x5cadac);}(_0x62e4,0x7a));var _0x462e=function(_0x122c7f,_0x4ce495){_0x122c7f=_0x122c7f-0x0;var _0x3598ec=_0x62e4[_0x122c7f];return _0x3598ec;};'use strict';var _=require(_0x462e('0x0'));var util=require(_0x462e('0x1'));var moment=require('moment');var BPromise=require(_0x462e('0x2'));var rs=require(_0x462e('0x3'));var fs=require('fs');var Redis=require(_0x462e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x462e('0x5'));var logger=require(_0x462e('0x6'))(_0x462e('0x7'));var config=require(_0x462e('0x8'));var jayson=require(_0x462e('0x9'));var client=jayson[_0x462e('0xa')][_0x462e('0xb')]({'port':0x232a});config[_0x462e('0xc')]=_[_0x462e('0xd')](config[_0x462e('0xc')],{'host':_0x462e('0xe'),'port':0x18eb});var socket=require(_0x462e('0xf'))(new Redis(config[_0x462e('0xc')]));require(_0x462e('0x10'))[_0x462e('0x11')](socket);function respondWithRpcPromise(_0x6fdab8,_0x2ad6b6,_0x77edbd){return new BPromise(function(_0x1f9614,_0x2ae427){return client[_0x462e('0x12')](_0x6fdab8,_0x77edbd)[_0x462e('0x13')](function(_0x599407){logger[_0x462e('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2ad6b6,_0x462e('0x15'));logger[_0x462e('0x16')](_0x462e('0x17'),_0x2ad6b6,_0x462e('0x15'),JSON[_0x462e('0x18')](_0x599407));if(_0x599407[_0x462e('0x19')]){if(_0x599407['error'][_0x462e('0x1a')]===0x1f4){logger[_0x462e('0x19')](_0x462e('0x1b'),_0x2ad6b6,_0x599407[_0x462e('0x19')][_0x462e('0x1c')]);return _0x2ae427(_0x599407[_0x462e('0x19')][_0x462e('0x1c')]);}logger['error'](_0x462e('0x1b'),_0x2ad6b6,_0x599407['error'][_0x462e('0x1c')]);return _0x1f9614(_0x599407[_0x462e('0x19')][_0x462e('0x1c')]);}else{logger[_0x462e('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x2ad6b6,_0x462e('0x15'));_0x1f9614(_0x599407[_0x462e('0x1d')]['message']);}})[_0x462e('0x1e')](function(_0x3d106c){logger['error'](_0x462e('0x1b'),_0x2ad6b6,_0x3d106c);_0x2ae427(_0x3d106c);});});}exports['UpdateSmsInteraction']=function(_0x36bc59){var _0x181a91=this;return new Promise(function(_0x441256,_0x45bf38){return db[_0x462e('0x1f')][_0x462e('0x20')](_0x36bc59['body'],{'raw':_0x36bc59[_0x462e('0x21')]?_0x36bc59[_0x462e('0x21')][_0x462e('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36bc59[_0x462e('0x21')]?_0x36bc59[_0x462e('0x21')][_0x462e('0x23')]||null:null,'attributes':_0x36bc59[_0x462e('0x21')]?_0x36bc59['options']['attributes']||null:null,'limit':_0x36bc59[_0x462e('0x21')]?_0x36bc59[_0x462e('0x21')][_0x462e('0x24')]||null:null})['then'](function(_0x2fb649){logger[_0x462e('0x14')](_0x462e('0x25'),_0x36bc59);logger[_0x462e('0x16')](_0x462e('0x25'),_0x36bc59,JSON['stringify'](_0x2fb649));_0x441256(_0x2fb649);})[_0x462e('0x1e')](function(_0x5d17ca){logger['error'](_0x462e('0x25'),_0x5d17ca[_0x462e('0x1c')],_0x36bc59);_0x45bf38(_0x181a91[_0x462e('0x19')](0x1f4,_0x5d17ca[_0x462e('0x1c')]));});});};exports[_0x462e('0x26')]=function(_0x26e3b5){return new Promise(function(_0x3c12b4,_0x3a3c1b){return db[_0x462e('0x1f')][_0x462e('0x27')]({'where':_0x26e3b5[_0x462e('0x21')]?_0x26e3b5[_0x462e('0x21')]['where']||null:null})[_0x462e('0x13')](function(_0x15f164){if(_0x15f164){return _0x15f164[_0x462e('0x28')](_0x26e3b5[_0x462e('0x29')][_0x462e('0x2a')],_[_0x462e('0x2b')](_0x26e3b5[_0x462e('0x29')],['ids','id'])||{});}})[_0x462e('0x2c')](function(_0x202462){logger[_0x462e('0x14')](_0x462e('0x2d'),_0x26e3b5);logger[_0x462e('0x16')](_0x462e('0x2d'),_0x26e3b5,JSON['stringify'](_0x202462));_0x3c12b4(_0x202462);})[_0x462e('0x1e')](function(_0x40b954){logger[_0x462e('0x19')](_0x462e('0x2d'),_0x40b954[_0x462e('0x1c')],_0x26e3b5);_0x3a3c1b(_this[_0x462e('0x19')](0x1f4,_0x40b954[_0x462e('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index dcb1fea..bcb08e2 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x396882,_0x361617){var _0x55efc7=function(_0x42549e){while(--_0x42549e){_0x396882['push'](_0x396882['shift']());}};_0x55efc7(++_0x361617);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file +var _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x51b3b8,_0x56b752){var _0x22f32f=function(_0x1bde37){while(--_0x1bde37){_0x51b3b8['push'](_0x51b3b8['shift']());}};_0x22f32f(++_0x56b752);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'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 a657cc8..ebe5384 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 _0x513f=['smsmessage:create','/:id/status','put','update','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','sms'];(function(_0x5a7569,_0x4eaefe){var _0x27ca44=function(_0x59d492){while(--_0x59d492){_0x5a7569['push'](_0x5a7569['shift']());}};_0x27ca44(++_0x4eaefe);}(_0x513f,0xe9));var _0xf513=function(_0x428ef1,_0x178844){_0x428ef1=_0x428ef1-0x0;var _0x2f89b4=_0x513f[_0x428ef1];return _0x2f89b4;};'use strict';var multer=require(_0xf513('0x0'));var util=require(_0xf513('0x1'));var path=require(_0xf513('0x2'));var timeout=require('connect-timeout');var express=require(_0xf513('0x3'));var router=express[_0xf513('0x4')]();var auth=require(_0xf513('0x5'));var interaction=require(_0xf513('0x6'));var config=require('../../config/environment');var controller=require(_0xf513('0x7'));router[_0xf513('0x8')]('/',auth['isAuthenticated'](),controller[_0xf513('0x9')]);router[_0xf513('0x8')](_0xf513('0xa'),auth[_0xf513('0xb')](),controller[_0xf513('0xc')]);router[_0xf513('0x8')](_0xf513('0xd'),auth[_0xf513('0xb')](),controller[_0xf513('0xe')]);router[_0xf513('0xf')]('/',auth['isAuthenticated'](),interaction['tracked'](_0xf513('0x10'),_0xf513('0x11')),controller['create']);router[_0xf513('0xf')](_0xf513('0x12'),controller['status']);router[_0xf513('0x13')](_0xf513('0xd'),auth[_0xf513('0xb')](),controller[_0xf513('0x14')]);router[_0xf513('0x13')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0xf513('0x13')](_0xf513('0x15'),auth['isAuthenticated'](),controller[_0xf513('0x16')]);router['delete'](_0xf513('0xd'),auth[_0xf513('0xb')](),controller[_0xf513('0x17')]);module[_0xf513('0x18')]=router; \ No newline at end of file +var _0xb656=['create','/:id/status','status','put','update','/:id/accept','/:id/reject','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','describe','/:id','show','post','tracked','sms','smsmessage:create'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb656,0x190));var _0x6b65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb656[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6b65('0x0'));var path=require('path');var timeout=require(_0x6b65('0x1'));var express=require('express');var router=express[_0x6b65('0x2')]();var auth=require(_0x6b65('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6b65('0x4'));var controller=require(_0x6b65('0x5'));router[_0x6b65('0x6')]('/',auth[_0x6b65('0x7')](),controller[_0x6b65('0x8')]);router['get']('/describe',auth[_0x6b65('0x7')](),controller[_0x6b65('0x9')]);router[_0x6b65('0x6')](_0x6b65('0xa'),auth['isAuthenticated'](),controller[_0x6b65('0xb')]);router[_0x6b65('0xc')]('/',auth[_0x6b65('0x7')](),interaction[_0x6b65('0xd')](_0x6b65('0xe'),_0x6b65('0xf')),controller[_0x6b65('0x10')]);router[_0x6b65('0xc')](_0x6b65('0x11'),controller[_0x6b65('0x12')]);router[_0x6b65('0x13')]('/:id',auth[_0x6b65('0x7')](),controller[_0x6b65('0x14')]);router['put'](_0x6b65('0x15'),auth[_0x6b65('0x7')](),controller['accept']);router[_0x6b65('0x13')](_0x6b65('0x16'),auth[_0x6b65('0x7')](),controller['reject']);router[_0x6b65('0x17')]('/:id',auth[_0x6b65('0x7')](),controller[_0x6b65('0x18')]);module[_0x6b65('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 1282b90..ec528fd 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 _0xcdd0=['ENUM','out','STRING','sequelize','exports','medium','BOOLEAN'];(function(_0x33b233,_0xd8107e){var _0x206d11=function(_0x3ebdb1){while(--_0x3ebdb1){_0x33b233['push'](_0x33b233['shift']());}};_0x206d11(++_0xd8107e);}(_0xcdd0,0x184));var _0x0cdd=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xcdd0[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x0cdd('0x0'));module[_0x0cdd('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0cdd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0cdd('0x4')]('in',_0x0cdd('0x5')),'defaultValue':_0x0cdd('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x0cdd('0x6')](0xbe)},'phone':{'type':Sequelize[_0x0cdd('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x0cdd('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xa937=['out','STRING','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0xa01dc9,_0x4203df){var _0x54d089=function(_0x34d716){while(--_0x34d716){_0xa01dc9['push'](_0xa01dc9['shift']());}};_0x54d089(++_0x4203df);}(_0xa937,0x163));var _0x7a93=function(_0x306d86,_0xa5e212){_0x306d86=_0x306d86-0x0;var _0x14666e=_0xa937[_0x306d86];return _0x14666e;};'use strict';var Sequelize=require(_0x7a93('0x0'));module['exports']={'body':{'type':Sequelize[_0x7a93('0x1')](_0x7a93('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7a93('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7a93('0x4')]('in','out'),'defaultValue':_0x7a93('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7a93('0x6')](0xbe)},'phone':{'type':Sequelize[_0x7a93('0x6')]},'readAt':{'type':Sequelize[_0x7a93('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b54284e..b248524 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 _0x2a41=['MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','DELIVERED','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','localhost','./smsMessage.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','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','count','offset','status','Content-Range','apply','save','destroy','stack','name','send','index','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','SmsMessage','include','rows','catch','params','rawAttributes','includeAll','create','body','update','find','describe','sms-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','SmsInteraction','SmsInteractionId','isNil','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','manual','interface','channel','event','EventManager','acceptmessage','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2a41,0x126));var _0x12a4=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0x2a41[_0x28509b];return _0x1e0b6;};'use strict';var pdf=require(_0x12a4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x12a4('0x1'));var zipdir=require(_0x12a4('0x2'));var jsonpatch=require(_0x12a4('0x3'));var rp=require(_0x12a4('0x4'));var moment=require(_0x12a4('0x5'));var BPromise=require(_0x12a4('0x6'));var Mustache=require(_0x12a4('0x7'));var util=require(_0x12a4('0x8'));var path=require(_0x12a4('0x9'));var sox=require('sox');var csv=require(_0x12a4('0xa'));var ejs=require(_0x12a4('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x12a4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12a4('0xd'));var toCsv=require(_0x12a4('0xa'));var querystring=require(_0x12a4('0xe'));var Papa=require(_0x12a4('0xf'));var Redis=require(_0x12a4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x12a4('0x11'));var as=require(_0x12a4('0x12'));var hardwareService=require(_0x12a4('0x13'));var logger=require(_0x12a4('0x14'))(_0x12a4('0x15'));var utils=require(_0x12a4('0x16'));var config=require(_0x12a4('0x17'));var db=require(_0x12a4('0x18'))['db'];config[_0x12a4('0x19')]=_[_0x12a4('0x1a')](config[_0x12a4('0x19')],{'host':_0x12a4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x12a4('0x19')]));require(_0x12a4('0x1c'))[_0x12a4('0x1d')](socket);var jayson=require(_0x12a4('0x1e'));var client=jayson[_0x12a4('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0x12a4('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2ccfce,_0x2428ba,_0x1cce66){if(_0x1cce66){var _0x5f5d38=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f5d38[_0x12a4('0x21')](_0x2428ba)){return _0x2ccfce;}else{throw new db[(_0x12a4('0x22'))][(_0x12a4('0x23'))](_0x12a4('0x24'));}}else{return _0x2ccfce;}}function respondWithRpcPromise(_0x3023b6,_0xe274e1,_0x4d7c49,_0x1a6bbe){return new BPromise(function(_0x3a783c,_0x3a3328){var _0x5db6a2=_0x1a6bbe||client;return _0x5db6a2['request'](_0x3023b6,_0x4d7c49)[_0x12a4('0x25')](function(_0x68998e){logger[_0x12a4('0x26')](_0x12a4('0x27'),_0xe274e1,_0x12a4('0x28'));logger['debug'](_0x12a4('0x29'),_0xe274e1,'request\x20sent',JSON[_0x12a4('0x2a')](_0x68998e));if(_0x68998e[_0x12a4('0x2b')]){if(_0x68998e[_0x12a4('0x2b')][_0x12a4('0x2c')]===0x1f4){logger[_0x12a4('0x2b')]('SmsMessage,\x20%s,\x20%s',_0xe274e1,_0x68998e[_0x12a4('0x2b')][_0x12a4('0x2d')]);return _0x3a3328(_0x68998e[_0x12a4('0x2b')][_0x12a4('0x2d')]);}logger['error'](_0x12a4('0x27'),_0xe274e1,_0x68998e[_0x12a4('0x2b')][_0x12a4('0x2d')]);return _0x3a783c(_0x68998e['error'][_0x12a4('0x2d')]);}else{logger[_0x12a4('0x26')]('SmsMessage,\x20%s,\x20%s',_0xe274e1,_0x12a4('0x28'));_0x3a783c(_0x68998e[_0x12a4('0x2e')]['message']);}})['catch'](function(_0x5e4616){logger[_0x12a4('0x2b')](_0x12a4('0x27'),_0xe274e1,_0x5e4616);_0x3a3328(_0x5e4616);});});}function respondWithStatusCode(_0x3314da,_0x1c34df){_0x1c34df=_0x1c34df||0xcc;return function(_0x4843f8){if(_0x4843f8){return _0x3314da[_0x12a4('0x2f')](_0x1c34df);}return _0x3314da['status'](_0x1c34df)[_0x12a4('0x30')]();};}function respondWithResult(_0x3c5584,_0x377466){_0x377466=_0x377466||0xc8;return function(_0x15adb7){if(_0x15adb7){return _0x3c5584['status'](_0x377466)[_0x12a4('0x31')](_0x15adb7);}};}function respondWithFilteredResult(_0x35f941,_0x4e38f7){return function(_0x283668){if(_0x283668){var _0x4cff97=_0x283668[_0x12a4('0x32')],_0x36edf3=_0x4e38f7[_0x12a4('0x33')],_0x2de4d5=_0x4e38f7[_0x12a4('0x33')]+_0x4e38f7['limit'],_0x534ab5;if(_0x2de4d5>=_0x4cff97){_0x2de4d5=_0x4cff97;_0x534ab5=0xc8;}else{_0x534ab5=0xce;}_0x35f941[_0x12a4('0x34')](_0x534ab5);return _0x35f941['set'](_0x12a4('0x35'),_0x36edf3+'-'+_0x2de4d5+'/'+_0x4cff97)[_0x12a4('0x31')](_0x283668);}return null;};}function patchUpdates(_0x3b4d75){return function(_0x37994a){try{jsonpatch[_0x12a4('0x36')](_0x37994a,_0x3b4d75,!![]);}catch(_0x38f86d){return BPromise['reject'](_0x38f86d);}return _0x37994a[_0x12a4('0x37')]();};}function saveUpdates(_0x473ce8,_0x3080e3){return function(_0x5ebeb1){if(_0x5ebeb1){return _0x5ebeb1['update'](_0x473ce8)[_0x12a4('0x25')](function(_0x499c20){return _0x499c20;});}return null;};}function removeEntity(_0x41696b,_0x3b8f1a){return function(_0x54bd3e){if(_0x54bd3e){return _0x54bd3e[_0x12a4('0x38')]()[_0x12a4('0x25')](function(){_0x41696b[_0x12a4('0x34')](0xcc)[_0x12a4('0x30')]();});}};}function handleEntityNotFound(_0x57850b,_0x728b01){return function(_0xf4b016){if(!_0xf4b016){_0x57850b[_0x12a4('0x2f')](0x194);}return _0xf4b016;};}function handleError(_0xa1a00e,_0x3c6476){_0x3c6476=_0x3c6476||0x1f4;return function(_0x4e7598){logger['error'](_0x4e7598[_0x12a4('0x39')]);if(_0x4e7598['name']){delete _0x4e7598[_0x12a4('0x3a')];}_0xa1a00e[_0x12a4('0x34')](_0x3c6476)[_0x12a4('0x3b')](_0x4e7598);};}exports[_0x12a4('0x3c')]=function(_0x2323cc,_0xc9d539){var _0x4427d1={},_0x18923c={},_0x445af7={'count':0x0,'rows':[]};var _0x31e9bb=_['map'](db['SmsMessage']['rawAttributes'],function(_0x174241){return{'name':_0x174241[_0x12a4('0x3d')],'type':_0x174241['type'][_0x12a4('0x3e')]};});_0x18923c[_0x12a4('0x3f')]=_[_0x12a4('0x40')](_0x31e9bb,_0x12a4('0x3a'));_0x18923c[_0x12a4('0x41')]=_[_0x12a4('0x42')](_0x2323cc[_0x12a4('0x41')]);_0x18923c[_0x12a4('0x43')]=_[_0x12a4('0x44')](_0x18923c['model'],_0x18923c[_0x12a4('0x41')]);_0x4427d1['attributes']=_[_0x12a4('0x44')](_0x18923c[_0x12a4('0x3f')],qs[_0x12a4('0x45')](_0x2323cc[_0x12a4('0x41')][_0x12a4('0x45')]));_0x4427d1['attributes']=_0x4427d1[_0x12a4('0x46')][_0x12a4('0x47')]?_0x4427d1[_0x12a4('0x46')]:_0x18923c[_0x12a4('0x3f')];if(!_0x2323cc[_0x12a4('0x41')][_0x12a4('0x48')](_0x12a4('0x49'))){_0x4427d1['limit']=qs[_0x12a4('0x4a')](_0x2323cc[_0x12a4('0x41')][_0x12a4('0x4a')]);_0x4427d1[_0x12a4('0x33')]=qs[_0x12a4('0x33')](_0x2323cc[_0x12a4('0x41')][_0x12a4('0x33')]);}_0x4427d1[_0x12a4('0x4b')]=qs[_0x12a4('0x4c')](_0x2323cc[_0x12a4('0x41')][_0x12a4('0x4c')]);_0x4427d1['where']=qs[_0x12a4('0x43')](_[_0x12a4('0x4d')](_0x2323cc[_0x12a4('0x41')],_0x18923c['filters']),_0x31e9bb);if(_0x2323cc['query'][_0x12a4('0x4e')]){_0x4427d1[_0x12a4('0x4f')]=_[_0x12a4('0x50')](_0x4427d1['where'],{'$or':_[_0x12a4('0x40')](_0x31e9bb,function(_0x2f4e47){if(_0x2f4e47[_0x12a4('0x51')]!==_0x12a4('0x52')){var _0x520cff={};_0x520cff[_0x2f4e47['name']]={'$like':'%'+_0x2323cc['query']['filter']+'%'};return _0x520cff;}})});}_0x4427d1=_[_0x12a4('0x50')]({},_0x4427d1,_0x2323cc[_0x12a4('0x53')]);var _0x213f0f={'where':_0x4427d1[_0x12a4('0x4f')]};return db[_0x12a4('0x54')]['count'](_0x213f0f)[_0x12a4('0x25')](function(_0x2342d6){_0x445af7[_0x12a4('0x32')]=_0x2342d6;if(_0x2323cc['query']['includeAll']){_0x4427d1[_0x12a4('0x55')]=[{'all':!![]}];}return db[_0x12a4('0x54')]['findAll'](_0x4427d1);})['then'](function(_0x586915){_0x445af7[_0x12a4('0x56')]=_0x586915;return _0x445af7;})[_0x12a4('0x25')](respondWithFilteredResult(_0xc9d539,_0x4427d1))[_0x12a4('0x57')](handleError(_0xc9d539,null));};exports['show']=function(_0x403d90,_0x270fbb){var _0x5b428b={'raw':!![],'where':{'id':_0x403d90[_0x12a4('0x58')]['id']}},_0x18e925={};_0x18e925[_0x12a4('0x3f')]=_[_0x12a4('0x42')](db[_0x12a4('0x54')][_0x12a4('0x59')]);_0x18e925['query']=_[_0x12a4('0x42')](_0x403d90['query']);_0x18e925[_0x12a4('0x43')]=_[_0x12a4('0x44')](_0x18e925[_0x12a4('0x3f')],_0x18e925[_0x12a4('0x41')]);_0x5b428b[_0x12a4('0x46')]=_[_0x12a4('0x44')](_0x18e925[_0x12a4('0x3f')],qs['fields'](_0x403d90[_0x12a4('0x41')][_0x12a4('0x45')]));_0x5b428b[_0x12a4('0x46')]=_0x5b428b[_0x12a4('0x46')][_0x12a4('0x47')]?_0x5b428b[_0x12a4('0x46')]:_0x18e925[_0x12a4('0x3f')];if(_0x403d90[_0x12a4('0x41')][_0x12a4('0x5a')]){_0x5b428b[_0x12a4('0x55')]=[{'all':!![]}];}_0x5b428b=_[_0x12a4('0x50')]({},_0x5b428b,_0x403d90[_0x12a4('0x53')]);return db[_0x12a4('0x54')]['find'](_0x5b428b)[_0x12a4('0x25')](handleEntityNotFound(_0x270fbb,null))[_0x12a4('0x25')](respondWithResult(_0x270fbb,null))[_0x12a4('0x57')](handleError(_0x270fbb,null));};exports[_0x12a4('0x5b')]=function(_0x5c5bcc,_0x2c95a8){return db['SmsMessage'][_0x12a4('0x5b')](_0x5c5bcc[_0x12a4('0x5c')],{})[_0x12a4('0x25')](respondWithResult(_0x2c95a8,0xc9))[_0x12a4('0x57')](handleError(_0x2c95a8,null));};exports[_0x12a4('0x5d')]=function(_0x21bc35,_0x43cb38){if(_0x21bc35[_0x12a4('0x5c')]['id']){delete _0x21bc35['body']['id'];}return db[_0x12a4('0x54')]['find']({'where':{'id':_0x21bc35[_0x12a4('0x58')]['id']}})[_0x12a4('0x25')](handleEntityNotFound(_0x43cb38,null))[_0x12a4('0x25')](saveUpdates(_0x21bc35[_0x12a4('0x5c')],null))[_0x12a4('0x25')](respondWithResult(_0x43cb38,null))[_0x12a4('0x57')](handleError(_0x43cb38,null));};exports[_0x12a4('0x38')]=function(_0x48bbc7,_0xcc63bd){return db[_0x12a4('0x54')][_0x12a4('0x5e')]({'where':{'id':_0x48bbc7[_0x12a4('0x58')]['id']}})[_0x12a4('0x25')](handleEntityNotFound(_0xcc63bd,null))[_0x12a4('0x25')](removeEntity(_0xcc63bd,null))['catch'](handleError(_0xcc63bd,null));};exports[_0x12a4('0x5f')]=function(_0x48fd04,_0x5f038a){return db[_0x12a4('0x54')][_0x12a4('0x5f')]()[_0x12a4('0x25')](respondWithResult(_0x5f038a,null))[_0x12a4('0x57')](handleError(_0x5f038a,null));};var interaction_log=require('../../config/logger')(_0x12a4('0x60'));exports[_0x12a4('0x61')]=function(_0x5e4ce0,_0x108c1a,_0x17f1fd){var _0x4bbe35={'channel':'sms'};if(_0x5e4ce0[_0x12a4('0x5c')]['id']){delete _0x5e4ce0['body']['id'];}_0x5e4ce0[_0x12a4('0x5c')][_0x12a4('0x62')]=!![];_0x5e4ce0['body'][_0x12a4('0x63')]=moment()['format'](_0x12a4('0x64'));_0x5e4ce0['body'][_0x12a4('0x65')]=_0x5e4ce0[_0x12a4('0x5c')][_0x12a4('0x65')]||_0x5e4ce0['user']['id'];return db[_0x12a4('0x54')]['find']({'where':{'id':_0x5e4ce0[_0x12a4('0x58')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x12a4('0x66')}]})['then'](handleEntityNotFound(_0x108c1a,null))[_0x12a4('0x25')](saveUpdates(_0x5e4ce0['body'],null))[_0x12a4('0x25')](function(_0x43e2c0){if(_0x43e2c0){_0x4bbe35[_0x12a4('0x2d')]=_0x43e2c0[_0x12a4('0x67')]({'plain':!![]});return db[_0x12a4('0x68')]['find']({'where':{'id':_0x43e2c0[_0x12a4('0x69')]}});}return null;})[_0x12a4('0x25')](handleEntityNotFound(_0x108c1a,null))[_0x12a4('0x25')](function(_0x94b874){if(_0x94b874){return _0x94b874[_0x12a4('0x5d')]({'UserId':_0x5e4ce0['body'][_0x12a4('0x65')],'read1stAt':_[_0x12a4('0x6a')](_0x94b874['read1stAt'])?moment()[_0x12a4('0x6b')](_0x12a4('0x64')):undefined});}return null;})[_0x12a4('0x25')](function(_0x4072ab){if(_0x4072ab){_0x4bbe35[_0x12a4('0x6c')]=_0x4072ab[_0x12a4('0x67')]({'plain':!![]});interaction_log['info'](_0x12a4('0x6d'),_0x5e4ce0[_0x12a4('0x6e')]['id'],_0x5e4ce0[_0x12a4('0x6e')][_0x12a4('0x3a')],_0x5e4ce0[_0x12a4('0x6e')]['role'],_0x4bbe35[_0x12a4('0x6c')]['id'],_0x5e4ce0['body']?JSON[_0x12a4('0x2a')](_0x5e4ce0[_0x12a4('0x5c')]):_0x12a4('0x6f'));return respondWithRpcPromise(_0x12a4('0x70'),'acceptMessage',_0x4bbe35);}return null;})[_0x12a4('0x25')](function(_0x64fb8d){if(_0x64fb8d){if(_0x5e4ce0[_0x12a4('0x5c')][_0x12a4('0x71')]){_0x4bbe35[_0x12a4('0x2d')][_0x12a4('0x72')]=util[_0x12a4('0x6b')]('SIP/%s',_0x5e4ce0[_0x12a4('0x6e')][_0x12a4('0x3a')]);_0x4bbe35[_0x12a4('0x2d')][_0x12a4('0x73')]=_0x4bbe35[_0x12a4('0x73')];_0x4bbe35[_0x12a4('0x2d')][_0x12a4('0x74')]=_0x12a4('0x61');return respondWithRpcPromise(_0x12a4('0x75'),_0x12a4('0x75'),{'event':_0x12a4('0x76'),'message':_0x4bbe35[_0x12a4('0x2d')]},client9002)[_0x12a4('0x25')](function(){return _0x4bbe35;});}return _0x4bbe35;}return null;})[_0x12a4('0x25')](respondWithResult(_0x108c1a,null))['catch'](handleError(_0x108c1a,null));};var interaction_log=require(_0x12a4('0x14'))(_0x12a4('0x60'));exports[_0x12a4('0x77')]=function(_0x28c3ad,_0x47dd26,_0x49894a){var _0x5ce731={'agent':{},'channel':'sms'};if(_0x28c3ad[_0x12a4('0x5c')]['id']){delete _0x28c3ad['body']['id'];}_0x28c3ad[_0x12a4('0x5c')][_0x12a4('0x65')]=_0x28c3ad['body']['UserId']||_0x28c3ad[_0x12a4('0x6e')]['id'];_0x5ce731[_0x12a4('0x78')]['id']=_0x28c3ad['body'][_0x12a4('0x65')];return db['SmsMessage'][_0x12a4('0x5e')]({'where':{'id':_0x28c3ad[_0x12a4('0x58')]['id'],'UserId':null}})[_0x12a4('0x25')](handleEntityNotFound(_0x47dd26,null))[_0x12a4('0x25')](function(_0x494c59){if(_0x494c59){_0x5ce731['message']=_0x494c59[_0x12a4('0x67')]({'plain':!![]});return db['SmsInteraction'][_0x12a4('0x5e')]({'where':{'id':_0x494c59[_0x12a4('0x69')]}});}return null;})[_0x12a4('0x25')](handleEntityNotFound(_0x47dd26,null))[_0x12a4('0x25')](function(_0x1dd515){if(_0x1dd515){_0x5ce731[_0x12a4('0x6c')]=_0x1dd515[_0x12a4('0x67')]({'plain':!![]});interaction_log[_0x12a4('0x26')](_0x12a4('0x79'),_0x28c3ad[_0x12a4('0x6e')]['id'],_0x28c3ad[_0x12a4('0x6e')][_0x12a4('0x3a')],_0x28c3ad[_0x12a4('0x6e')][_0x12a4('0x7a')],_0x5ce731['interaction']['id'],_0x28c3ad[_0x12a4('0x5c')]?JSON[_0x12a4('0x2a')](_0x28c3ad[_0x12a4('0x5c')]):_0x12a4('0x6f'));return respondWithRpcPromise(_0x12a4('0x7b'),_0x12a4('0x7c'),_0x5ce731);}return null;})[_0x12a4('0x25')](function(_0x295032){if(_0x295032){_0x295032[_0x12a4('0x2d')][_0x12a4('0x72')]=util[_0x12a4('0x6b')]('SIP/%s',_0x28c3ad[_0x12a4('0x6e')][_0x12a4('0x3a')]);_0x295032[_0x12a4('0x2d')][_0x12a4('0x73')]=_0x5ce731[_0x12a4('0x73')];_0x295032[_0x12a4('0x2d')]['event']=_0x12a4('0x77');respondWithRpcPromise(_0x12a4('0x75'),_0x12a4('0x75'),{'event':'rejectmessage','message':_0x295032['message']},client9002);return _0x5ce731;}return null;})['then'](respondWithResult(_0x47dd26,null))['catch'](handleError(_0x47dd26,null));};exports['status']=function(_0x4bb953,_0x310623,_0xa2e1fc){if(_0x4bb953[_0x12a4('0x5c')]['id']){delete _0x4bb953[_0x12a4('0x5c')]['id'];}var _0x3e3afe;return db[_0x12a4('0x54')][_0x12a4('0x5e')]({'where':{'id':_0x4bb953[_0x12a4('0x58')]['id']}})[_0x12a4('0x25')](handleEntityNotFound(_0x310623,null))[_0x12a4('0x25')](function(_0x1afd81){if(_0x1afd81){_0x3e3afe=_0x1afd81;return db[_0x12a4('0x7d')][_0x12a4('0x5e')]({'where':{'id':_0x1afd81[_0x12a4('0x7e')]}});}})[_0x12a4('0x25')](handleEntityNotFound(_0x310623,null))[_0x12a4('0x25')](function(_0x3ecceb){if(_0x3ecceb){logger[_0x12a4('0x7f')](_0x12a4('0x29'),'status',_0x12a4('0x80'),_0x3ecceb[_0x12a4('0x51')],util[_0x12a4('0x81')](_0x4bb953[_0x12a4('0x5c')],{'showHidden':![],'depth':null}));switch(_0x3ecceb[_0x12a4('0x51')]){case _0x12a4('0x82'):if(_0x4bb953[_0x12a4('0x5c')][_0x12a4('0x83')]&&_0x4bb953[_0x12a4('0x5c')][_0x12a4('0x83')]===_0x3e3afe[_0x12a4('0x84')]){return _0x3e3afe['update']({'read':!![]});}else{logger[_0x12a4('0x2b')](_0x12a4('0x85'),'status',_0x12a4('0x82'),util[_0x12a4('0x81')](_0x4bb953[_0x12a4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x12a4('0x86'):if(_0x4bb953[_0x12a4('0x5c')][_0x12a4('0x87')]&&_0x4bb953['body']['MessageUUID']===_0x3e3afe[_0x12a4('0x84')]&&_[_0x12a4('0x88')]([_0x12a4('0x89'),_0x12a4('0x8a')],_0x4bb953['body'][_0x12a4('0x8b')])>=0x0){return _0x3e3afe[_0x12a4('0x5d')]({'read':!![]});}else{logger['error'](_0x12a4('0x85'),'status',_0x12a4('0x8c'),util[_0x12a4('0x81')](_0x4bb953[_0x12a4('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x12a4('0x8d'):var _0xbfa3ee=_0x4bb953[_0x12a4('0x5c')]['results'][0x0];if(_0xbfa3ee[_0x12a4('0x34')]['groupName']===_0x12a4('0x8e')){return _0x3e3afe[_0x12a4('0x5d')]({'read':!![]});}else{logger[_0x12a4('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x12a4('0x34'),'infobip',util['inspect'](_0x4bb953[_0x12a4('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x3e3afe;}})[_0x12a4('0x25')](respondWithResult(_0x310623,null))[_0x12a4('0x57')](handleError(_0x310623,null));}; \ No newline at end of file +var _0x0f88=['read1stAt','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','interface','channel','EventManager','acceptmessage','sms-interactions','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','SmsAccount','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','redis','defaults','socket.io-emitter','./smsMessage.socket','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','info','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','options','find','create','body','describe','accept','sms','read','UserId','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0x0f88,0x1d9));var _0x80f8=function(_0x3a376f,_0x4694fb){_0x3a376f=_0x3a376f-0x0;var _0x2cc9ae=_0x0f88[_0x3a376f];return _0x2cc9ae;};'use strict';var pdf=require(_0x80f8('0x0'));var emlformat=require(_0x80f8('0x1'));var rimraf=require(_0x80f8('0x2'));var zipdir=require(_0x80f8('0x3'));var jsonpatch=require(_0x80f8('0x4'));var rp=require(_0x80f8('0x5'));var moment=require(_0x80f8('0x6'));var BPromise=require(_0x80f8('0x7'));var Mustache=require('mustache');var util=require(_0x80f8('0x8'));var path=require('path');var sox=require(_0x80f8('0x9'));var csv=require(_0x80f8('0xa'));var ejs=require(_0x80f8('0xb'));var fs=require('fs');var _=require(_0x80f8('0xc'));var squel=require(_0x80f8('0xd'));var crypto=require(_0x80f8('0xe'));var jsforce=require(_0x80f8('0xf'));var deskjs=require(_0x80f8('0x10'));var toCsv=require(_0x80f8('0xa'));var querystring=require(_0x80f8('0x11'));var Papa=require(_0x80f8('0x12'));var Redis=require(_0x80f8('0x13'));var authService=require(_0x80f8('0x14'));var qs=require(_0x80f8('0x15'));var as=require(_0x80f8('0x16'));var hardwareService=require(_0x80f8('0x17'));var logger=require(_0x80f8('0x18'))(_0x80f8('0x19'));var utils=require(_0x80f8('0x1a'));var config=require(_0x80f8('0x1b'));var db=require('../../mysqldb')['db'];config[_0x80f8('0x1c')]=_[_0x80f8('0x1d')](config[_0x80f8('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x80f8('0x1e'))(new Redis(config[_0x80f8('0x1c')]));require(_0x80f8('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x80f8('0x20')]['http']({'port':0x232a});function checkPasswordPattern(_0x2c9b94,_0x25c36b,_0x381355){if(_0x381355){var _0x3817be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3817be[_0x80f8('0x21')](_0x25c36b)){return _0x2c9b94;}else{throw new db[(_0x80f8('0x22'))][(_0x80f8('0x23'))](_0x80f8('0x24'));}}else{return _0x2c9b94;}}function respondWithRpcPromise(_0x375f42,_0xeff401,_0x581196,_0x450b77){return new BPromise(function(_0x981e13,_0x1fe500){var _0x1e2ae6=_0x450b77||client;return _0x1e2ae6[_0x80f8('0x25')](_0x375f42,_0x581196)['then'](function(_0x1c8bb7){logger[_0x80f8('0x26')]('SmsMessage,\x20%s,\x20%s',_0xeff401,_0x80f8('0x27'));logger[_0x80f8('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xeff401,_0x80f8('0x27'),JSON[_0x80f8('0x29')](_0x1c8bb7));if(_0x1c8bb7[_0x80f8('0x2a')]){if(_0x1c8bb7[_0x80f8('0x2a')][_0x80f8('0x2b')]===0x1f4){logger[_0x80f8('0x2a')](_0x80f8('0x2c'),_0xeff401,_0x1c8bb7[_0x80f8('0x2a')]['message']);return _0x1fe500(_0x1c8bb7[_0x80f8('0x2a')]['message']);}logger[_0x80f8('0x2a')]('SmsMessage,\x20%s,\x20%s',_0xeff401,_0x1c8bb7[_0x80f8('0x2a')]['message']);return _0x981e13(_0x1c8bb7[_0x80f8('0x2a')][_0x80f8('0x2d')]);}else{logger[_0x80f8('0x26')]('SmsMessage,\x20%s,\x20%s',_0xeff401,'request\x20sent');_0x981e13(_0x1c8bb7[_0x80f8('0x2e')][_0x80f8('0x2d')]);}})['catch'](function(_0x40ed3e){logger['error'](_0x80f8('0x2c'),_0xeff401,_0x40ed3e);_0x1fe500(_0x40ed3e);});});}function respondWithStatusCode(_0x4fc1f6,_0x25bf6e){_0x25bf6e=_0x25bf6e||0xcc;return function(_0x5f3f44){if(_0x5f3f44){return _0x4fc1f6[_0x80f8('0x2f')](_0x25bf6e);}return _0x4fc1f6[_0x80f8('0x30')](_0x25bf6e)[_0x80f8('0x31')]();};}function respondWithResult(_0x46d379,_0x42e871){_0x42e871=_0x42e871||0xc8;return function(_0x14fcce){if(_0x14fcce){return _0x46d379[_0x80f8('0x30')](_0x42e871)[_0x80f8('0x32')](_0x14fcce);}};}function respondWithFilteredResult(_0xb37fff,_0x13cb3a){return function(_0x5ca948){if(_0x5ca948){var _0x545f3c=_0x5ca948[_0x80f8('0x33')],_0x2955f9=_0x13cb3a['offset'],_0xe2e619=_0x13cb3a[_0x80f8('0x34')]+_0x13cb3a[_0x80f8('0x35')],_0x266be7;if(_0xe2e619>=_0x545f3c){_0xe2e619=_0x545f3c;_0x266be7=0xc8;}else{_0x266be7=0xce;}_0xb37fff['status'](_0x266be7);return _0xb37fff[_0x80f8('0x36')]('Content-Range',_0x2955f9+'-'+_0xe2e619+'/'+_0x545f3c)[_0x80f8('0x32')](_0x5ca948);}return null;};}function patchUpdates(_0x5d7644){return function(_0x387a28){try{jsonpatch[_0x80f8('0x37')](_0x387a28,_0x5d7644,!![]);}catch(_0x48984c){return BPromise['reject'](_0x48984c);}return _0x387a28[_0x80f8('0x38')]();};}function saveUpdates(_0x26ac72,_0x2898cc){return function(_0x42e93a){if(_0x42e93a){return _0x42e93a[_0x80f8('0x39')](_0x26ac72)[_0x80f8('0x3a')](function(_0x449d26){return _0x449d26;});}return null;};}function removeEntity(_0x515f45,_0x2c0c74){return function(_0x234f8d){if(_0x234f8d){return _0x234f8d[_0x80f8('0x3b')]()[_0x80f8('0x3a')](function(){_0x515f45['status'](0xcc)[_0x80f8('0x31')]();});}};}function handleEntityNotFound(_0x935fc7,_0x2ded8e){return function(_0x21eb28){if(!_0x21eb28){_0x935fc7['sendStatus'](0x194);}return _0x21eb28;};}function handleError(_0x132868,_0x4a4cec){_0x4a4cec=_0x4a4cec||0x1f4;return function(_0x496ce3){logger[_0x80f8('0x2a')](_0x496ce3[_0x80f8('0x3c')]);if(_0x496ce3[_0x80f8('0x3d')]){delete _0x496ce3[_0x80f8('0x3d')];}_0x132868['status'](_0x4a4cec)[_0x80f8('0x3e')](_0x496ce3);};}exports[_0x80f8('0x3f')]=function(_0x15773d,_0xce3c19){var _0x43c7b7={},_0x1d932d={},_0x2e1692={'count':0x0,'rows':[]};var _0x1f9e3e=_[_0x80f8('0x40')](db[_0x80f8('0x41')][_0x80f8('0x42')],function(_0x592de){return{'name':_0x592de[_0x80f8('0x43')],'type':_0x592de[_0x80f8('0x44')][_0x80f8('0x45')]};});_0x1d932d[_0x80f8('0x46')]=_[_0x80f8('0x40')](_0x1f9e3e,_0x80f8('0x3d'));_0x1d932d[_0x80f8('0x47')]=_['keys'](_0x15773d[_0x80f8('0x47')]);_0x1d932d[_0x80f8('0x48')]=_[_0x80f8('0x49')](_0x1d932d['model'],_0x1d932d['query']);_0x43c7b7['attributes']=_['intersection'](_0x1d932d[_0x80f8('0x46')],qs[_0x80f8('0x4a')](_0x15773d[_0x80f8('0x47')][_0x80f8('0x4a')]));_0x43c7b7[_0x80f8('0x4b')]=_0x43c7b7[_0x80f8('0x4b')]['length']?_0x43c7b7['attributes']:_0x1d932d[_0x80f8('0x46')];if(!_0x15773d[_0x80f8('0x47')][_0x80f8('0x4c')](_0x80f8('0x4d'))){_0x43c7b7[_0x80f8('0x35')]=qs['limit'](_0x15773d[_0x80f8('0x47')][_0x80f8('0x35')]);_0x43c7b7[_0x80f8('0x34')]=qs[_0x80f8('0x34')](_0x15773d[_0x80f8('0x47')][_0x80f8('0x34')]);}_0x43c7b7[_0x80f8('0x4e')]=qs[_0x80f8('0x4f')](_0x15773d[_0x80f8('0x47')][_0x80f8('0x4f')]);_0x43c7b7[_0x80f8('0x50')]=qs[_0x80f8('0x48')](_[_0x80f8('0x51')](_0x15773d[_0x80f8('0x47')],_0x1d932d[_0x80f8('0x48')]),_0x1f9e3e);if(_0x15773d[_0x80f8('0x47')][_0x80f8('0x52')]){_0x43c7b7['where']=_[_0x80f8('0x53')](_0x43c7b7[_0x80f8('0x50')],{'$or':_['map'](_0x1f9e3e,function(_0x52b016){if(_0x52b016[_0x80f8('0x44')]!==_0x80f8('0x54')){var _0x22f506={};_0x22f506[_0x52b016[_0x80f8('0x3d')]]={'$like':'%'+_0x15773d['query'][_0x80f8('0x52')]+'%'};return _0x22f506;}})});}_0x43c7b7=_[_0x80f8('0x53')]({},_0x43c7b7,_0x15773d['options']);var _0x8f4e26={'where':_0x43c7b7[_0x80f8('0x50')]};return db['SmsMessage'][_0x80f8('0x33')](_0x8f4e26)[_0x80f8('0x3a')](function(_0x4aa81e){_0x2e1692[_0x80f8('0x33')]=_0x4aa81e;if(_0x15773d['query'][_0x80f8('0x55')]){_0x43c7b7['include']=[{'all':!![]}];}return db[_0x80f8('0x41')][_0x80f8('0x56')](_0x43c7b7);})[_0x80f8('0x3a')](function(_0x1bfd5a){_0x2e1692[_0x80f8('0x57')]=_0x1bfd5a;return _0x2e1692;})[_0x80f8('0x3a')](respondWithFilteredResult(_0xce3c19,_0x43c7b7))[_0x80f8('0x58')](handleError(_0xce3c19,null));};exports[_0x80f8('0x59')]=function(_0x50e19c,_0x3dc2f2){var _0x5d783a={'raw':!![],'where':{'id':_0x50e19c[_0x80f8('0x5a')]['id']}},_0x21ff26={};_0x21ff26[_0x80f8('0x46')]=_[_0x80f8('0x5b')](db[_0x80f8('0x41')][_0x80f8('0x42')]);_0x21ff26[_0x80f8('0x47')]=_[_0x80f8('0x5b')](_0x50e19c[_0x80f8('0x47')]);_0x21ff26[_0x80f8('0x48')]=_[_0x80f8('0x49')](_0x21ff26[_0x80f8('0x46')],_0x21ff26[_0x80f8('0x47')]);_0x5d783a[_0x80f8('0x4b')]=_[_0x80f8('0x49')](_0x21ff26[_0x80f8('0x46')],qs[_0x80f8('0x4a')](_0x50e19c[_0x80f8('0x47')][_0x80f8('0x4a')]));_0x5d783a['attributes']=_0x5d783a[_0x80f8('0x4b')]['length']?_0x5d783a[_0x80f8('0x4b')]:_0x21ff26[_0x80f8('0x46')];if(_0x50e19c[_0x80f8('0x47')]['includeAll']){_0x5d783a['include']=[{'all':!![]}];}_0x5d783a=_['merge']({},_0x5d783a,_0x50e19c[_0x80f8('0x5c')]);return db[_0x80f8('0x41')][_0x80f8('0x5d')](_0x5d783a)[_0x80f8('0x3a')](handleEntityNotFound(_0x3dc2f2,null))[_0x80f8('0x3a')](respondWithResult(_0x3dc2f2,null))[_0x80f8('0x58')](handleError(_0x3dc2f2,null));};exports[_0x80f8('0x5e')]=function(_0x4e23c7,_0x3a85c2){return db[_0x80f8('0x41')][_0x80f8('0x5e')](_0x4e23c7[_0x80f8('0x5f')],{})['then'](respondWithResult(_0x3a85c2,0xc9))[_0x80f8('0x58')](handleError(_0x3a85c2,null));};exports['update']=function(_0x3e6523,_0x350ac4){if(_0x3e6523['body']['id']){delete _0x3e6523[_0x80f8('0x5f')]['id'];}return db[_0x80f8('0x41')][_0x80f8('0x5d')]({'where':{'id':_0x3e6523['params']['id']}})[_0x80f8('0x3a')](handleEntityNotFound(_0x350ac4,null))['then'](saveUpdates(_0x3e6523[_0x80f8('0x5f')],null))[_0x80f8('0x3a')](respondWithResult(_0x350ac4,null))['catch'](handleError(_0x350ac4,null));};exports[_0x80f8('0x3b')]=function(_0x41e210,_0x2f95bf){return db[_0x80f8('0x41')]['find']({'where':{'id':_0x41e210[_0x80f8('0x5a')]['id']}})[_0x80f8('0x3a')](handleEntityNotFound(_0x2f95bf,null))[_0x80f8('0x3a')](removeEntity(_0x2f95bf,null))[_0x80f8('0x58')](handleError(_0x2f95bf,null));};exports[_0x80f8('0x60')]=function(_0x2e6264,_0x29a598){return db[_0x80f8('0x41')][_0x80f8('0x60')]()[_0x80f8('0x3a')](respondWithResult(_0x29a598,null))[_0x80f8('0x58')](handleError(_0x29a598,null));};var interaction_log=require(_0x80f8('0x18'))('sms-interactions');exports[_0x80f8('0x61')]=function(_0xfdf3ac,_0x29affa,_0x1bf5be){var _0x432e67={'channel':_0x80f8('0x62')};if(_0xfdf3ac[_0x80f8('0x5f')]['id']){delete _0xfdf3ac[_0x80f8('0x5f')]['id'];}_0xfdf3ac[_0x80f8('0x5f')][_0x80f8('0x63')]=!![];_0xfdf3ac[_0x80f8('0x5f')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xfdf3ac[_0x80f8('0x5f')][_0x80f8('0x64')]=_0xfdf3ac['body'][_0x80f8('0x64')]||_0xfdf3ac['user']['id'];return db[_0x80f8('0x41')][_0x80f8('0x5d')]({'where':{'id':_0xfdf3ac['params']['id'],'UserId':null},'include':[{'model':db[_0x80f8('0x65')],'as':_0x80f8('0x66')}]})[_0x80f8('0x3a')](handleEntityNotFound(_0x29affa,null))[_0x80f8('0x3a')](saveUpdates(_0xfdf3ac[_0x80f8('0x5f')],null))[_0x80f8('0x3a')](function(_0x34561d){if(_0x34561d){_0x432e67['message']=_0x34561d[_0x80f8('0x67')]({'plain':!![]});return db[_0x80f8('0x68')][_0x80f8('0x5d')]({'where':{'id':_0x34561d[_0x80f8('0x69')]}});}return null;})[_0x80f8('0x3a')](handleEntityNotFound(_0x29affa,null))[_0x80f8('0x3a')](function(_0x18e707){if(_0x18e707){return _0x18e707['update']({'UserId':_0xfdf3ac[_0x80f8('0x5f')][_0x80f8('0x64')],'read1stAt':_[_0x80f8('0x6a')](_0x18e707[_0x80f8('0x6b')])?moment()[_0x80f8('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x80f8('0x3a')](function(_0x385945){if(_0x385945){_0x432e67[_0x80f8('0x6d')]=_0x385945[_0x80f8('0x67')]({'plain':!![]});interaction_log[_0x80f8('0x26')](_0x80f8('0x6e'),_0xfdf3ac[_0x80f8('0x6f')]['id'],_0xfdf3ac[_0x80f8('0x6f')][_0x80f8('0x3d')],_0xfdf3ac['user'][_0x80f8('0x70')],_0x432e67[_0x80f8('0x6d')]['id'],_0xfdf3ac[_0x80f8('0x5f')]?JSON[_0x80f8('0x29')](_0xfdf3ac[_0x80f8('0x5f')]):_0x80f8('0x71'));return respondWithRpcPromise(_0x80f8('0x72'),_0x80f8('0x73'),_0x432e67);}return null;})['then'](function(_0x503798){if(_0x503798){if(_0xfdf3ac[_0x80f8('0x5f')]['manual']){_0x432e67[_0x80f8('0x2d')][_0x80f8('0x74')]=util[_0x80f8('0x6c')]('SIP/%s',_0xfdf3ac[_0x80f8('0x6f')][_0x80f8('0x3d')]);_0x432e67[_0x80f8('0x2d')]['channel']=_0x432e67[_0x80f8('0x75')];_0x432e67[_0x80f8('0x2d')]['event']='accept';return respondWithRpcPromise(_0x80f8('0x76'),_0x80f8('0x76'),{'event':_0x80f8('0x77'),'message':_0x432e67['message']},client9002)['then'](function(){return _0x432e67;});}return _0x432e67;}return null;})[_0x80f8('0x3a')](respondWithResult(_0x29affa,null))[_0x80f8('0x58')](handleError(_0x29affa,null));};var interaction_log=require(_0x80f8('0x18'))(_0x80f8('0x78'));exports[_0x80f8('0x79')]=function(_0x5b3463,_0x55334c,_0x59c667){var _0x44b670={'agent':{},'channel':'sms'};if(_0x5b3463[_0x80f8('0x5f')]['id']){delete _0x5b3463[_0x80f8('0x5f')]['id'];}_0x5b3463['body'][_0x80f8('0x64')]=_0x5b3463[_0x80f8('0x5f')][_0x80f8('0x64')]||_0x5b3463[_0x80f8('0x6f')]['id'];_0x44b670[_0x80f8('0x7a')]['id']=_0x5b3463[_0x80f8('0x5f')][_0x80f8('0x64')];return db[_0x80f8('0x41')][_0x80f8('0x5d')]({'where':{'id':_0x5b3463[_0x80f8('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x55334c,null))[_0x80f8('0x3a')](function(_0x1dc52a){if(_0x1dc52a){_0x44b670[_0x80f8('0x2d')]=_0x1dc52a[_0x80f8('0x67')]({'plain':!![]});return db[_0x80f8('0x68')][_0x80f8('0x5d')]({'where':{'id':_0x1dc52a[_0x80f8('0x69')]}});}return null;})[_0x80f8('0x3a')](handleEntityNotFound(_0x55334c,null))[_0x80f8('0x3a')](function(_0x4d26b1){if(_0x4d26b1){_0x44b670[_0x80f8('0x6d')]=_0x4d26b1[_0x80f8('0x67')]({'plain':!![]});interaction_log[_0x80f8('0x26')](_0x80f8('0x7b'),_0x5b3463[_0x80f8('0x6f')]['id'],_0x5b3463[_0x80f8('0x6f')][_0x80f8('0x3d')],_0x5b3463[_0x80f8('0x6f')][_0x80f8('0x70')],_0x44b670[_0x80f8('0x6d')]['id'],_0x5b3463[_0x80f8('0x5f')]?JSON[_0x80f8('0x29')](_0x5b3463['body']):_0x80f8('0x71'));return respondWithRpcPromise(_0x80f8('0x7c'),_0x80f8('0x7d'),_0x44b670);}return null;})[_0x80f8('0x3a')](function(_0x109b4e){if(_0x109b4e){_0x109b4e[_0x80f8('0x2d')]['interface']=util['format'](_0x80f8('0x7e'),_0x5b3463[_0x80f8('0x6f')][_0x80f8('0x3d')]);_0x109b4e[_0x80f8('0x2d')][_0x80f8('0x75')]=_0x44b670[_0x80f8('0x75')];_0x109b4e[_0x80f8('0x2d')][_0x80f8('0x7f')]=_0x80f8('0x79');respondWithRpcPromise(_0x80f8('0x76'),_0x80f8('0x76'),{'event':_0x80f8('0x80'),'message':_0x109b4e['message']},client9002);return _0x44b670;}return null;})[_0x80f8('0x3a')](respondWithResult(_0x55334c,null))[_0x80f8('0x58')](handleError(_0x55334c,null));};exports[_0x80f8('0x30')]=function(_0x1d4aea,_0x4de65f,_0x319e9b){if(_0x1d4aea[_0x80f8('0x5f')]['id']){delete _0x1d4aea[_0x80f8('0x5f')]['id'];}var _0x5d5d8c;return db[_0x80f8('0x41')][_0x80f8('0x5d')]({'where':{'id':_0x1d4aea[_0x80f8('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4de65f,null))[_0x80f8('0x3a')](function(_0x57a4fd){if(_0x57a4fd){_0x5d5d8c=_0x57a4fd;return db[_0x80f8('0x81')][_0x80f8('0x5d')]({'where':{'id':_0x57a4fd[_0x80f8('0x82')]}});}})[_0x80f8('0x3a')](handleEntityNotFound(_0x4de65f,null))[_0x80f8('0x3a')](function(_0x3fa600){if(_0x3fa600){logger['debug'](_0x80f8('0x83'),_0x80f8('0x30'),_0x80f8('0x84'),_0x3fa600[_0x80f8('0x44')],util[_0x80f8('0x85')](_0x1d4aea[_0x80f8('0x5f')],{'showHidden':![],'depth':null}));switch(_0x3fa600[_0x80f8('0x44')]){case _0x80f8('0x86'):if(_0x1d4aea[_0x80f8('0x5f')][_0x80f8('0x87')]&&_0x1d4aea['body']['MessageSid']===_0x5d5d8c[_0x80f8('0x88')]){return _0x5d5d8c[_0x80f8('0x39')]({'read':!![]});}else{logger[_0x80f8('0x2a')](_0x80f8('0x89'),_0x80f8('0x30'),_0x80f8('0x86'),util[_0x80f8('0x85')](_0x1d4aea[_0x80f8('0x5f')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1d4aea[_0x80f8('0x5f')][_0x80f8('0x8a')]&&_0x1d4aea['body'][_0x80f8('0x8a')]===_0x5d5d8c[_0x80f8('0x88')]&&_[_0x80f8('0x8b')](['sent','delivered'],_0x1d4aea[_0x80f8('0x5f')]['Status'])>=0x0){return _0x5d5d8c[_0x80f8('0x39')]({'read':!![]});}else{logger[_0x80f8('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x80f8('0x30'),_0x80f8('0x8c'),util['inspect'](_0x1d4aea[_0x80f8('0x5f')],{'showHidden':![],'depth':null}));}break;case _0x80f8('0x8d'):var _0x3a46fc=_0x1d4aea[_0x80f8('0x5f')][_0x80f8('0x8e')][0x0];if(_0x3a46fc[_0x80f8('0x30')][_0x80f8('0x8f')]===_0x80f8('0x90')){return _0x5d5d8c[_0x80f8('0x39')]({'read':!![]});}else{logger[_0x80f8('0x2a')](_0x80f8('0x89'),_0x80f8('0x30'),_0x80f8('0x8d'),util[_0x80f8('0x85')](_0x1d4aea['body'],{'showHidden':![],'depth':null}));}break;}return _0x5d5d8c;}})[_0x80f8('0x3a')](respondWithResult(_0x4de65f,null))[_0x80f8('0x58')](handleError(_0x4de65f,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 453ec76..10e33df 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 _0x376e=['hasOwnProperty','exports','SmsMessage','setMaxListeners','save','remove','emit'];(function(_0xbf9376,_0x2787bf){var _0x4721ed=function(_0x582b1e){while(--_0x582b1e){_0xbf9376['push'](_0xbf9376['shift']());}};_0x4721ed(++_0x2787bf);}(_0x376e,0x160));var _0xe376=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x376e[_0x5ddaac];return _0x2a9c58;};'use strict';var EventEmitter=require('events');var SmsMessage=require('../../mysqldb')['db'][_0xe376('0x0')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xe376('0x1')](0x0);var events={'afterCreate':_0xe376('0x2'),'afterUpdate':'update','afterDestroy':_0xe376('0x3')};function emitEvent(_0x2b7ce6){return function(_0x31d3ef,_0x4887ac,_0x5672e9){SmsMessageEvents[_0xe376('0x4')](_0x2b7ce6+':'+_0x31d3ef['id'],_0x31d3ef);SmsMessageEvents[_0xe376('0x4')](_0x2b7ce6,_0x31d3ef);_0x5672e9(null);};}for(var e in events){if(events[_0xe376('0x5')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xe376('0x6')]=SmsMessageEvents; \ No newline at end of file +var _0x2261=['save','update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x5b1981,_0x310935){var _0x59b3e3=function(_0x2a6f9d){while(--_0x2a6f9d){_0x5b1981['push'](_0x5b1981['shift']());}};_0x59b3e3(++_0x310935);}(_0x2261,0x113));var _0x1226=function(_0x46993a,_0x5e582c){_0x46993a=_0x46993a-0x0;var _0x51e95a=_0x2261[_0x46993a];return _0x51e95a;};'use strict';var EventEmitter=require(_0x1226('0x0'));var SmsMessage=require(_0x1226('0x1'))['db'][_0x1226('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x1226('0x3')](0x0);var events={'afterCreate':_0x1226('0x4'),'afterUpdate':_0x1226('0x5'),'afterDestroy':_0x1226('0x6')};function emitEvent(_0x4a459b){return function(_0x1be0e0,_0x19e541,_0x172b41){SmsMessageEvents[_0x1226('0x7')](_0x4a459b+':'+_0x1be0e0['id'],_0x1be0e0);SmsMessageEvents[_0x1226('0x7')](_0x4a459b,_0x1be0e0);_0x172b41(null);};}for(var e in events){if(events[_0x1226('0x8')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 9757df3..f1e9390 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 _0x75ed=['../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','body','models','get','direction','toLowerCase','out','secret','isNil','findOne','SmsInteractionId','update','catch','error','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','clicksend','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','queued_count','head','data','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','crypto','apiKey','login','text','sort','length','createHash','md5','digest','signature=','GET','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','intelepeer','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x75ed,0xdb));var _0xd75e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x75ed[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd75e('0x0'));var util=require(_0xd75e('0x1'));var logger=require(_0xd75e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd75e('0x3'));var fs=require('fs');var path=require(_0xd75e('0x4'));var rimraf=require('rimraf');var config=require(_0xd75e('0x5'));var attributes=require(_0xd75e('0x6'));module[_0xd75e('0x7')]=function(_0x1034a9,_0x1e7de3){return _0x1034a9['define'](_0xd75e('0x8'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xd75e('0x9'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xd75e('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5386ad,_0x352579,_0x5f5787){var _0x543fc6=_0x1034a9[_0xd75e('0xb')];var _0x1ff790=_0x5386ad[_0xd75e('0xc')]({'plain':!![]});if(_0x1ff790[_0xd75e('0xd')][_0xd75e('0xe')]()==='in'||_0x1ff790['direction'][_0xd75e('0xe')]()===_0xd75e('0xf')&&!_0x1ff790[_0xd75e('0x10')]&&!_[_0xd75e('0x11')](_0x1ff790['UserId'])){_0x543fc6['SmsInteraction'][_0xd75e('0x12')]({'where':{'id':_0x1ff790[_0xd75e('0x13')]}})['then'](function(_0x1ba2d8){if(_0x1ba2d8){_0x1ba2d8[_0xd75e('0x14')]({'lastMsgAt':_0x1ff790['createdAt'],'lastMsgDirection':_0x1ff790[_0xd75e('0xd')][_0xd75e('0xe')]()});}})[_0xd75e('0x15')](function(_0xa5d00d){console[_0xd75e('0x16')](_0xa5d00d);});}if(_0x1ff790[_0xd75e('0xd')]==='out'&&!_0x1ff790[_0xd75e('0x10')]){var _0x4ee446;_0x543fc6['SmsAccount'][_0xd75e('0x17')]({'where':{'id':_0x1ff790[_0xd75e('0x18')]},'raw':!![]})[_0xd75e('0x19')](function(_0x48abcc){_0x4ee446=_0x48abcc;if(_0x4ee446&&_0x4ee446[_0xd75e('0x1a')]){switch(_0x4ee446[_0xd75e('0x1a')]){case _0xd75e('0x1b'):var _0x5475e6=require(_0xd75e('0x1b'));if(_0x4ee446[_0xd75e('0x1c')]&&_0x4ee446[_0xd75e('0x1d')]&&_0x4ee446[_0xd75e('0x1e')]){var _0x272e81=new _0x5475e6(_0x4ee446['accountSid'],_0x4ee446[_0xd75e('0x1d')]);_0x272e81[_0xd75e('0x1f')][_0xd75e('0x20')]({'body':_0x1ff790[_0xd75e('0xa')],'to':_0x1ff790['phone'],'from':_0x4ee446[_0xd75e('0x1e')],'statusCallback':_0x4ee446[_0xd75e('0x21')]+_0xd75e('0x22')+_0x1ff790['id']+_0xd75e('0x23')+_0x4ee446[_0xd75e('0x24')]})[_0xd75e('0x19')](function(_0x3e6b69){if(_0x3e6b69[_0xd75e('0x25')]){return _0x5386ad['update']({'messageId':_0x3e6b69['sid']});}})[_0xd75e('0x15')](function(_0x183d9d){logger['error'](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x1b'),util[_0xd75e('0x28')](_0x183d9d,{'showHidden':![],'depth':null}));});}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),'afterCreate',_0xd75e('0x1b'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case'skebby':var _0x50bdc3=_0xd75e('0x29');if(_0x4ee446['username']&&_0x4ee446[_0xd75e('0x2a')]){var _0x31e75b={'recipient':[_0x1ff790[_0xd75e('0x1e')]],'message':_0x1ff790['body'],'message_type':_0x4ee446[_0xd75e('0x2b')]};if(_0x4ee446[_0xd75e('0x2b')]&&_0x4ee446[_0xd75e('0x2b')]!=='SI'){_0x31e75b[_0xd75e('0x2c')]=_0x4ee446['phone'];}var _0xa2e8be={'url':_0x50bdc3+_0xd75e('0x2d')+_0x4ee446[_0xd75e('0x2e')]+'&password='+_0x4ee446[_0xd75e('0x2a')],'method':'GET'};rp(_0xa2e8be)['then'](function(_0x72dbe){var _0x36d8ad=_0x72dbe['split'](';');var _0x1fd85f={'user_key':_0x36d8ad[0x0],'session_key':_0x36d8ad[0x1]};_0xa2e8be={'url':_0x50bdc3+_0xd75e('0x2f'),'method':_0xd75e('0x30'),'headers':{'user_key':_0x1fd85f[_0xd75e('0x31')],'Session_key':_0x1fd85f[_0xd75e('0x32')]},'json':!![],'body':_0x31e75b};return rp(_0xa2e8be);})[_0xd75e('0x19')](function(_0x355e84){if(_0x355e84[_0xd75e('0x33')]>=0x1){var _0x379192={'messageId':_0x355e84[_0xd75e('0x34')]};if(_0x4ee446[_0xd75e('0x2b')]!=='GP'||!_0x4ee446[_0xd75e('0x35')]){_0x379192[_0xd75e('0x36')]=!![];}return _0x5386ad['update'](_0x379192);}else{return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x37'),util[_0xd75e('0x28')](_0x355e84,{'showHidden':![],'depth':null}));}})[_0xd75e('0x15')](function(_0x44f18f){return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x37'),util[_0xd75e('0x28')](_0x44f18f,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x37'),_0xd75e('0x38'));}break;case _0xd75e('0x39'):if(_0x4ee446[_0xd75e('0x1d')]){var _0x190f8d={'recipient':_0x1ff790[_0xd75e('0x1e')],'message':_0x1ff790[_0xd75e('0xa')],'sender':_0x4ee446['senderString']||_0x4ee446['phone'],'authorization':_0x4ee446[_0xd75e('0x1d')]};var _0x352579={'method':_0xd75e('0x30'),'uri':_0xd75e('0x3a'),'body':_0x190f8d,'json':!![]};rp(_0x352579)['then'](function(_0x3983d2){var _0x1871a0={'messageId':_0x3983d2[_0xd75e('0x3b')]};if(!_0x4ee446['deliveryReport']){_0x1871a0[_0xd75e('0x36')]=!![];}return _0x5386ad[_0xd75e('0x14')](_0x1871a0);})[_0xd75e('0x15')](function(_0x463049){logger[_0xd75e('0x16')](_0xd75e('0x26'),'afterCreate',_0xd75e('0x39'),util['inspect'](_0x463049,{'showHidden':![],'depth':null}));});}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),'afterCreate','connectel','Missing\x20parameters:\x20authToken');}break;case _0xd75e('0x3c'):if(_0x4ee446[_0xd75e('0x2e')]&&_0x4ee446['password']){var _0x190f8d={'messages':[{'source':'xCALLY\x20Motion','to':_0x1ff790[_0xd75e('0x1e')],'body':_0x1ff790[_0xd75e('0xa')],'from':_0x4ee446[_0xd75e('0x3d')]||_0x4ee446[_0xd75e('0x1e')]}]};var _0xf5bfaf=util[_0xd75e('0x3e')](_0xd75e('0x3f'),_0x4ee446[_0xd75e('0x2e')],_0x4ee446[_0xd75e('0x2a')]);var _0x352579={'method':'POST','uri':_0xd75e('0x40'),'body':_0x190f8d,'headers':{'Authorization':util['format'](_0xd75e('0x41'),new Buffer(_0xf5bfaf)[_0xd75e('0x42')](_0xd75e('0x43')))},'json':!![]};rp(_0x352579)['then'](function(_0x24144a){if(_0x24144a['http_code']>=0xc8&&_0x24144a[_0xd75e('0x44')]<=0xce){if(_0x24144a['data']&&_0x24144a['data'][_0xd75e('0x45')]>0x0){var _0x2483d6=_[_0xd75e('0x46')](_0x24144a[_0xd75e('0x47')][_0xd75e('0x1f')]);var _0x5c2de9={'messageId':_0x2483d6['message_id']};if(!_0x4ee446[_0xd75e('0x35')]){_0x5c2de9[_0xd75e('0x36')]=!![];}return _0x5386ad[_0xd75e('0x14')](_0x5c2de9);}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),'clickSend',util[_0xd75e('0x28')](_0x24144a,{'showHidden':![],'depth':null}));}}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x48'),util[_0xd75e('0x28')](_0x24144a,{'showHidden':![],'depth':null}));}})[_0xd75e('0x15')](function(_0x157910){logger[_0xd75e('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd75e('0x27'),_0xd75e('0x48'),util[_0xd75e('0x28')](_0x157910,{'showHidden':![],'depth':null}));});}else{logger[_0xd75e('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd75e('0x27'),_0xd75e('0x48'),_0xd75e('0x38'));}break;case _0xd75e('0x49'):if(_0x4ee446[_0xd75e('0x4a')]&&_0x4ee446[_0xd75e('0x1d')]){var _0x190f8d={'dst':_0x1ff790[_0xd75e('0x1e')],'text':_0x1ff790[_0xd75e('0xa')],'src':_0x4ee446[_0xd75e('0x3d')]||_0x4ee446['phone'],'url':_0x4ee446[_0xd75e('0x21')]+_0xd75e('0x22')+_0x1ff790['id']+'/status?token='+_0x4ee446['token']};var _0xf5bfaf=util[_0xd75e('0x3e')](_0xd75e('0x3f'),_0x4ee446[_0xd75e('0x4a')],_0x4ee446[_0xd75e('0x1d')]);var _0x352579={'method':_0xd75e('0x30'),'uri':util[_0xd75e('0x3e')](_0xd75e('0x4b'),_0x4ee446[_0xd75e('0x4a')]),'body':_0x190f8d,'headers':{'Authorization':util[_0xd75e('0x3e')](_0xd75e('0x41'),new Buffer(_0xf5bfaf)['toString'](_0xd75e('0x43')))},'json':!![]};rp(_0x352579)[_0xd75e('0x19')](function(_0x4c4c8c){var _0x368d1c={'messageId':_0x4c4c8c['message_uuid'][0x0]};return _0x5386ad['update'](_0x368d1c);})[_0xd75e('0x15')](function(_0x13ff86){logger[_0xd75e('0x16')](_0xd75e('0x26'),'afterCreate',_0xd75e('0x49'),util[_0xd75e('0x28')](_0x13ff86,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd75e('0x27'),_0xd75e('0x49'),_0xd75e('0x4c'));}break;case _0xd75e('0x4d'):if(_0x4ee446[_0xd75e('0x2e')]&&_0x4ee446[_0xd75e('0x2a')]){if(_0x4ee446[_0xd75e('0x4e')]){var _0x41aeb6={'method':_0xd75e('0x30'),'uri':_0x4ee446[_0xd75e('0x4e')]+_0xd75e('0x4f'),'body':{'username':_0x4ee446[_0xd75e('0x2e')],'password':_0x4ee446['password']},'json':!![]};return rp(_0x41aeb6)[_0xd75e('0x19')](function(_0x513597){var _0x4ca955={'method':_0xd75e('0x30'),'uri':_0x4ee446[_0xd75e('0x4e')]+_0xd75e('0x50'),'body':{'messages':[{'from':_0x4ee446[_0xd75e('0x1e')],'destinations':[{'to':_0x1ff790['phone']}],'text':_0x1ff790[_0xd75e('0xa')],'notifyUrl':_0x4ee446['remote']+'/api/sms/messages/'+_0x1ff790['id']+_0xd75e('0x23')+_0x4ee446['token'],'notifyContentType':_0xd75e('0x51'),'callbackData':_0x4ee446[_0xd75e('0x1e')]+';'+_0x1ff790['body']}]},'headers':{'Authorization':_0xd75e('0x52')+_0x513597[_0xd75e('0x24')]},'json':!![]};return rp(_0x4ca955)[_0xd75e('0x19')](function(_0x8fdf29){if(_0x8fdf29['messages']){var _0x3a6ef1={'messageId':_0x8fdf29['messages'][0x0][_0xd75e('0x9')]};if(!_0x4ee446[_0xd75e('0x35')]){_0x3a6ef1['read']=!![];}return _0x5386ad['update'](_0x3a6ef1);}else{return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x4d'),util[_0xd75e('0x28')](_0x8fdf29,{'showHidden':![],'depth':null}));}});})[_0xd75e('0x15')](function(_0x5e65cb){return logger[_0xd75e('0x16')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xd75e('0x27'),_0xd75e('0x4d'),util[_0xd75e('0x28')](_0x5e65cb,{'showHidden':![],'depth':null}));});}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case'csc':var _0x257696=require(_0xd75e('0x53'));if(_0x4ee446[_0xd75e('0x54')]){var _0x4360f4={};_0x4360f4[_0xd75e('0x55')]=_0x4ee446[_0xd75e('0x2e')];_0x4360f4[_0xd75e('0x1e')]=_0x1ff790['phone'];_0x4360f4[_0xd75e('0x2c')]=_0x4ee446['phone'];_0x4360f4[_0xd75e('0x56')]=_0x1ff790[_0xd75e('0xa')];_0x4360f4['timestamp']=+new Date();var _0x5af277='';var _0x2092b8='';var _0x507a56=Object['keys'](_0x4360f4);_0x507a56[_0xd75e('0x57')]();for(var _0x419d89=0x0;_0x419d89<_0x507a56[_0xd75e('0x58')];_0x419d89++){if(_0x5af277!=''){_0x5af277+='&';}_0x5af277+=_0x507a56[_0x419d89]+'='+encodeURIComponent(_0x4360f4[_0x507a56[_0x419d89]]);_0x2092b8+=_0x4360f4[_0x507a56[_0x419d89]];}_0x2092b8+=_0x4ee446['apiKey'];_0x2092b8=_0x257696[_0xd75e('0x59')](_0xd75e('0x5a'))[_0xd75e('0x14')](_0x2092b8)[_0xd75e('0x5b')]('hex');if(_0x5af277!==''){_0x5af277+='&';}_0x5af277+=_0xd75e('0x5c')+_0x2092b8;var _0xa2e8be={'method':_0xd75e('0x5d'),'uri':_0x4ee446['baseUrl']+_0xd75e('0x5e')+_0x5af277,'json':!![]};return rp(_0xa2e8be)[_0xd75e('0x19')](function(_0x8fa20f){var _0x1241c7=Object['keys'](_0x8fa20f);if(_0x8fa20f[_0x1241c7[0x0]][_0xd75e('0x16')]&&parseInt(_0x8fa20f[_0x1241c7[0x0]]['error'])===0x0){var _0x355dea={'messageId':_0x8fa20f[_0x1241c7[0x0]][_0xd75e('0x5f')]};if(!_0x4ee446['deliveryReport']){_0x355dea[_0xd75e('0x36')]=!![];}return _0x5386ad[_0xd75e('0x14')](_0x355dea);}else{return logger['error'](_0xd75e('0x26'),_0xd75e('0x27'),'csc',util[_0xd75e('0x28')](_0x8fa20f[_0xd75e('0x16')],{'showHidden':![],'depth':null}));}})[_0xd75e('0x15')](function(_0x549d12){return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x60'),util['inspect'](_0x549d12,{'showHidden':![],'depth':null}));});}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x60'),_0xd75e('0x61'));}break;case _0xd75e('0x62'):if(_0x4ee446[_0xd75e('0x54')]){var _0x35e847={'method':_0xd75e('0x30'),'uri':_0xd75e('0x63'),'headers':{'Authorization':_0x4ee446[_0xd75e('0x54')]},'body':{'content':_0x1ff790[_0xd75e('0xa')],'to':[_0x1ff790[_0xd75e('0x1e')]],'from':_0x4ee446['phone'],'binary':![],'clientMessageId':_0xd75e('0x64'),'charset':_0xd75e('0x65')},'json':!![]};rp(_0x35e847)[_0xd75e('0x19')](function(_0x209272){if(!_0x209272[_0xd75e('0x16')]){var _0x88fefa={'messageId':_0x209272['messages'][0x0]['apiMessageId']};if(!_0x4ee446[_0xd75e('0x35')]){_0x88fefa[_0xd75e('0x36')]=!![];}return _0x5386ad[_0xd75e('0x14')](_0x88fefa);}else{return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x62'),util[_0xd75e('0x28')](_0x209272['error'],{'showHidden':![],'depth':null}));}})[_0xd75e('0x15')](function(_0x3ffba2){return logger['error'](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x62'),util[_0xd75e('0x28')](_0x3ffba2,{'showHidden':![],'depth':null}));});}else{logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),'clickatell',_0xd75e('0x61'));}break;case _0xd75e('0x66'):if(_0x4ee446[_0xd75e('0x54')]){var _0x4476f1={};var _0xa2e8be={'method':_0xd75e('0x30'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xd75e('0x67')+_0x4ee446[_0xd75e('0x54')],'Content-Type':_0xd75e('0x51')},'body':{'from':_0x4ee446[_0xd75e('0x1e')],'to':_0x1ff790[_0xd75e('0x1e')],'text':_0x1ff790[_0xd75e('0xa')]},'json':!![]};return rp(_0xa2e8be)[_0xd75e('0x19')](function(_0x5eafaf){if(_0x5eafaf['code']==0xca){_0x4476f1[_0xd75e('0x68')]=_0x5eafaf;var _0x139fc8={'method':'POST','uri':_0xd75e('0x69'),'headers':{'Authorization':_0xd75e('0x67')+_0x4ee446[_0xd75e('0x54')],'Content-Type':'application/json'},'body':{'refid':_0x4476f1[_0xd75e('0x68')]['refid']},'json':!![]};return rp(_0x139fc8)['then'](function(_0x100009){_0x4476f1[_0xd75e('0x6a')]=_0x100009;var _0x6ff170={'messageId':_0x4476f1[_0xd75e('0x68')][_0xd75e('0x6b')],'read':!![]};return _0x5386ad['update'](_0x6ff170);});}else{return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x66'),util['inspect'](_0x5eafaf,{'showHidden':![],'depth':null}));}})[_0xd75e('0x15')](function(_0x47db1b){return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x66'),util[_0xd75e('0x28')](_0x47db1b,{'showHidden':![],'depth':null}));});}else{return logger[_0xd75e('0x16')](_0xd75e('0x26'),_0xd75e('0x27'),_0xd75e('0x66'),_0xd75e('0x6c'));}break;}}})[_0xd75e('0x6d')](function(){_0x5f5787();});}else{_0x5f5787();}}},'charset':_0xd75e('0x6e'),'collate':_0xd75e('0x6f')});}; \ No newline at end of file +var _0xca6f=['authToken','accountSid','messages','create','phone','/api/sms/messages/','/status?token=','token','sid','catch','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','crypto','apiKey','text','timestamp','keys','sort','length','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','refid','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','SmsAccount','find','SmsAccountId','type','twilio'];(function(_0x5a946a,_0x100701){var _0x27530f=function(_0x42b2f9){while(--_0x42b2f9){_0x5a946a['push'](_0x5a946a['shift']());}};_0x27530f(++_0x100701);}(_0xca6f,0xcf));var _0xfca6=function(_0x5ab26d,_0x1a6cad){_0x5ab26d=_0x5ab26d-0x0;var _0x1fa998=_0xca6f[_0x5ab26d];return _0x1fa998;};'use strict';var _=require(_0xfca6('0x0'));var util=require(_0xfca6('0x1'));var logger=require(_0xfca6('0x2'))(_0xfca6('0x3'));var moment=require(_0xfca6('0x4'));var BPromise=require(_0xfca6('0x5'));var rp=require(_0xfca6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfca6('0x7'));var config=require(_0xfca6('0x8'));var attributes=require(_0xfca6('0x9'));module[_0xfca6('0xa')]=function(_0x11c162,_0x17e091){return _0x11c162[_0xfca6('0xb')](_0xfca6('0xc'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xfca6('0xd'),'fields':['messageId']},{'name':_0xfca6('0xe'),'fields':[_0xfca6('0xf')],'type':_0xfca6('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b55b4,_0x121bb1,_0x4635bd){var _0x47fb48=_0x11c162['models'];var _0xa9654e=_0x5b55b4[_0xfca6('0x11')]({'plain':!![]});if(_0xa9654e[_0xfca6('0x12')][_0xfca6('0x13')]()==='in'||_0xa9654e[_0xfca6('0x12')][_0xfca6('0x13')]()===_0xfca6('0x14')&&!_0xa9654e[_0xfca6('0x15')]&&!_[_0xfca6('0x16')](_0xa9654e[_0xfca6('0x17')])){_0x47fb48['SmsInteraction'][_0xfca6('0x18')]({'where':{'id':_0xa9654e['SmsInteractionId']}})[_0xfca6('0x19')](function(_0xac2448){if(_0xac2448){_0xac2448[_0xfca6('0x1a')]({'lastMsgAt':_0xa9654e[_0xfca6('0x1b')],'lastMsgDirection':_0xa9654e[_0xfca6('0x12')]['toLowerCase']()});}})['catch'](function(_0xf8d0db){console['error'](_0xf8d0db);});}if(_0xa9654e[_0xfca6('0x12')]==='out'&&!_0xa9654e[_0xfca6('0x15')]){var _0x3337c3;_0x47fb48[_0xfca6('0x1c')][_0xfca6('0x1d')]({'where':{'id':_0xa9654e[_0xfca6('0x1e')]},'raw':!![]})[_0xfca6('0x19')](function(_0x1c5b32){_0x3337c3=_0x1c5b32;if(_0x3337c3&&_0x3337c3[_0xfca6('0x1f')]){switch(_0x3337c3[_0xfca6('0x1f')]){case _0xfca6('0x20'):var _0x135de8=require(_0xfca6('0x20'));if(_0x3337c3['accountSid']&&_0x3337c3[_0xfca6('0x21')]&&_0x3337c3['phone']){var _0x49093d=new _0x135de8(_0x3337c3[_0xfca6('0x22')],_0x3337c3['authToken']);_0x49093d[_0xfca6('0x23')][_0xfca6('0x24')]({'body':_0xa9654e[_0xfca6('0xf')],'to':_0xa9654e[_0xfca6('0x25')],'from':_0x3337c3['phone'],'statusCallback':_0x3337c3['remote']+_0xfca6('0x26')+_0xa9654e['id']+_0xfca6('0x27')+_0x3337c3[_0xfca6('0x28')]})[_0xfca6('0x19')](function(_0x1dc88e){if(_0x1dc88e[_0xfca6('0x29')]){return _0x5b55b4['update']({'messageId':_0x1dc88e[_0xfca6('0x29')]});}})[_0xfca6('0x2a')](function(_0x272938){logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x20'),util[_0xfca6('0x2e')](_0x272938,{'showHidden':![],'depth':null}));});}else{logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),'twilio',_0xfca6('0x2f'));}break;case _0xfca6('0x30'):var _0x32f3d6=_0xfca6('0x31');if(_0x3337c3[_0xfca6('0x32')]&&_0x3337c3[_0xfca6('0x33')]){var _0x387523={'recipient':[_0xa9654e[_0xfca6('0x25')]],'message':_0xa9654e[_0xfca6('0xf')],'message_type':_0x3337c3[_0xfca6('0x34')]};if(_0x3337c3['smsMethod']&&_0x3337c3['smsMethod']!=='SI'){_0x387523[_0xfca6('0x35')]=_0x3337c3['phone'];}var _0x12f82a={'url':_0x32f3d6+_0xfca6('0x36')+_0x3337c3[_0xfca6('0x32')]+_0xfca6('0x37')+_0x3337c3['password'],'method':_0xfca6('0x38')};rp(_0x12f82a)[_0xfca6('0x19')](function(_0x1264a1){var _0x2e3bb0=_0x1264a1[_0xfca6('0x39')](';');var _0x3b74ce={'user_key':_0x2e3bb0[0x0],'session_key':_0x2e3bb0[0x1]};_0x12f82a={'url':_0x32f3d6+_0xfca6('0x3a'),'method':_0xfca6('0x3b'),'headers':{'user_key':_0x3b74ce[_0xfca6('0x3c')],'Session_key':_0x3b74ce[_0xfca6('0x3d')]},'json':!![],'body':_0x387523};return rp(_0x12f82a);})[_0xfca6('0x19')](function(_0x5a95d3){if(_0x5a95d3['total_sent']>=0x1){var _0x419508={'messageId':_0x5a95d3['internal_order_id']};if(_0x3337c3[_0xfca6('0x34')]!=='GP'||!_0x3337c3[_0xfca6('0x3e')]){_0x419508[_0xfca6('0x3f')]=!![];}return _0x5b55b4['update'](_0x419508);}else{return logger['error'](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x30'),util[_0xfca6('0x2e')](_0x5a95d3,{'showHidden':![],'depth':null}));}})[_0xfca6('0x2a')](function(_0x574b66){return logger['error'](_0xfca6('0x2c'),'afterCreate',_0xfca6('0x30'),util[_0xfca6('0x2e')](_0x574b66,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),_0xfca6('0x30'),_0xfca6('0x40'));}break;case'connectel':if(_0x3337c3[_0xfca6('0x21')]){var _0x97b33a={'recipient':_0xa9654e[_0xfca6('0x25')],'message':_0xa9654e['body'],'sender':_0x3337c3['senderString']||_0x3337c3[_0xfca6('0x25')],'authorization':_0x3337c3[_0xfca6('0x21')]};var _0x121bb1={'method':_0xfca6('0x3b'),'uri':_0xfca6('0x41'),'body':_0x97b33a,'json':!![]};rp(_0x121bb1)[_0xfca6('0x19')](function(_0x818446){var _0x2a207b={'messageId':_0x818446[_0xfca6('0x42')]};if(!_0x3337c3[_0xfca6('0x3e')]){_0x2a207b['read']=!![];}return _0x5b55b4[_0xfca6('0x1a')](_0x2a207b);})[_0xfca6('0x2a')](function(_0x1c76a3){logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x43'),util[_0xfca6('0x2e')](_0x1c76a3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x43'),_0xfca6('0x44'));}break;case _0xfca6('0x45'):if(_0x3337c3['username']&&_0x3337c3['password']){var _0x97b33a={'messages':[{'source':_0xfca6('0x46'),'to':_0xa9654e['phone'],'body':_0xa9654e[_0xfca6('0xf')],'from':_0x3337c3[_0xfca6('0x47')]||_0x3337c3[_0xfca6('0x25')]}]};var _0x5b020b=util[_0xfca6('0x48')](_0xfca6('0x49'),_0x3337c3['username'],_0x3337c3['password']);var _0x121bb1={'method':_0xfca6('0x3b'),'uri':_0xfca6('0x4a'),'body':_0x97b33a,'headers':{'Authorization':util[_0xfca6('0x48')]('Basic\x20%s',new Buffer(_0x5b020b)[_0xfca6('0x4b')](_0xfca6('0x4c')))},'json':!![]};rp(_0x121bb1)[_0xfca6('0x19')](function(_0x37df9a){if(_0x37df9a[_0xfca6('0x4d')]>=0xc8&&_0x37df9a[_0xfca6('0x4d')]<=0xce){if(_0x37df9a[_0xfca6('0x4e')]&&_0x37df9a[_0xfca6('0x4e')][_0xfca6('0x4f')]>0x0){var _0x21dd21=_['head'](_0x37df9a['data'][_0xfca6('0x23')]);var _0x3a414b={'messageId':_0x21dd21['message_id']};if(!_0x3337c3[_0xfca6('0x3e')]){_0x3a414b[_0xfca6('0x3f')]=!![];}return _0x5b55b4[_0xfca6('0x1a')](_0x3a414b);}else{logger['error'](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x50'),util[_0xfca6('0x2e')](_0x37df9a,{'showHidden':![],'depth':null}));}}else{logger['error'](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x50'),util[_0xfca6('0x2e')](_0x37df9a,{'showHidden':![],'depth':null}));}})[_0xfca6('0x2a')](function(_0x1aa5f2){logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x50'),util[_0xfca6('0x2e')](_0x1aa5f2,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),_0xfca6('0x50'),_0xfca6('0x40'));}break;case _0xfca6('0x51'):if(_0x3337c3[_0xfca6('0x52')]&&_0x3337c3[_0xfca6('0x21')]){var _0x97b33a={'dst':_0xa9654e[_0xfca6('0x25')],'text':_0xa9654e[_0xfca6('0xf')],'src':_0x3337c3[_0xfca6('0x47')]||_0x3337c3[_0xfca6('0x25')],'url':_0x3337c3[_0xfca6('0x53')]+_0xfca6('0x26')+_0xa9654e['id']+_0xfca6('0x27')+_0x3337c3[_0xfca6('0x28')]};var _0x5b020b=util[_0xfca6('0x48')](_0xfca6('0x49'),_0x3337c3['authId'],_0x3337c3[_0xfca6('0x21')]);var _0x121bb1={'method':_0xfca6('0x3b'),'uri':util[_0xfca6('0x48')](_0xfca6('0x54'),_0x3337c3[_0xfca6('0x52')]),'body':_0x97b33a,'headers':{'Authorization':util[_0xfca6('0x48')]('Basic\x20%s',new Buffer(_0x5b020b)[_0xfca6('0x4b')](_0xfca6('0x4c')))},'json':!![]};rp(_0x121bb1)[_0xfca6('0x19')](function(_0x40a8e0){var _0xc21666={'messageId':_0x40a8e0[_0xfca6('0x55')][0x0]};return _0x5b55b4['update'](_0xc21666);})[_0xfca6('0x2a')](function(_0x2cec28){logger[_0xfca6('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),'plivo',util[_0xfca6('0x2e')](_0x2cec28,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),'plivo',_0xfca6('0x56'));}break;case _0xfca6('0x57'):if(_0x3337c3['username']&&_0x3337c3[_0xfca6('0x33')]){if(_0x3337c3['baseUrl']){var _0x3fe980={'method':_0xfca6('0x3b'),'uri':_0x3337c3[_0xfca6('0x58')]+_0xfca6('0x59'),'body':{'username':_0x3337c3['username'],'password':_0x3337c3['password']},'json':!![]};return rp(_0x3fe980)[_0xfca6('0x19')](function(_0x3d7834){var _0x297bb5={'method':_0xfca6('0x3b'),'uri':_0x3337c3[_0xfca6('0x58')]+_0xfca6('0x5a'),'body':{'messages':[{'from':_0x3337c3['phone'],'destinations':[{'to':_0xa9654e[_0xfca6('0x25')]}],'text':_0xa9654e[_0xfca6('0xf')],'notifyUrl':_0x3337c3['remote']+_0xfca6('0x26')+_0xa9654e['id']+_0xfca6('0x27')+_0x3337c3[_0xfca6('0x28')],'notifyContentType':_0xfca6('0x5b'),'callbackData':_0x3337c3[_0xfca6('0x25')]+';'+_0xa9654e[_0xfca6('0xf')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x3d7834[_0xfca6('0x28')]},'json':!![]};return rp(_0x297bb5)[_0xfca6('0x19')](function(_0x2b9002){if(_0x2b9002[_0xfca6('0x23')]){var _0x55c5af={'messageId':_0x2b9002[_0xfca6('0x23')][0x0][_0xfca6('0xd')]};if(!_0x3337c3['deliveryReport']){_0x55c5af[_0xfca6('0x3f')]=!![];}return _0x5b55b4[_0xfca6('0x1a')](_0x55c5af);}else{return logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x57'),util[_0xfca6('0x2e')](_0x2b9002,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1b26be){return logger[_0xfca6('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),_0xfca6('0x57'),util['inspect'](_0x1b26be,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xfca6('0x2c'),'afterCreate','infobip',_0xfca6('0x5c'));}}else{logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x57'),_0xfca6('0x40'));}break;case'csc':var _0x2ee7ce=require(_0xfca6('0x5d'));if(_0x3337c3[_0xfca6('0x5e')]){var _0x196cbe={};_0x196cbe['login']=_0x3337c3[_0xfca6('0x32')];_0x196cbe[_0xfca6('0x25')]=_0xa9654e[_0xfca6('0x25')];_0x196cbe[_0xfca6('0x35')]=_0x3337c3['phone'];_0x196cbe[_0xfca6('0x5f')]=_0xa9654e['body'];_0x196cbe[_0xfca6('0x60')]=+new Date();var _0x169174='';var _0x3cabbf='';var _0x399cb7=Object[_0xfca6('0x61')](_0x196cbe);_0x399cb7[_0xfca6('0x62')]();for(var _0x4c5be9=0x0;_0x4c5be9<_0x399cb7[_0xfca6('0x63')];_0x4c5be9++){if(_0x169174!=''){_0x169174+='&';}_0x169174+=_0x399cb7[_0x4c5be9]+'='+encodeURIComponent(_0x196cbe[_0x399cb7[_0x4c5be9]]);_0x3cabbf+=_0x196cbe[_0x399cb7[_0x4c5be9]];}_0x3cabbf+=_0x3337c3[_0xfca6('0x5e')];_0x3cabbf=_0x2ee7ce[_0xfca6('0x64')](_0xfca6('0x65'))[_0xfca6('0x1a')](_0x3cabbf)['digest'](_0xfca6('0x66'));if(_0x169174!==''){_0x169174+='&';}_0x169174+=_0xfca6('0x67')+_0x3cabbf;var _0x12f82a={'method':_0xfca6('0x38'),'uri':_0x3337c3[_0xfca6('0x58')]+_0xfca6('0x68')+_0x169174,'json':!![]};return rp(_0x12f82a)[_0xfca6('0x19')](function(_0x2d3e2e){var _0x1f7822=Object[_0xfca6('0x61')](_0x2d3e2e);if(_0x2d3e2e[_0x1f7822[0x0]]['error']&&parseInt(_0x2d3e2e[_0x1f7822[0x0]][_0xfca6('0x2b')])===0x0){var _0x57716f={'messageId':_0x2d3e2e[_0x1f7822[0x0]][_0xfca6('0x69')]};if(!_0x3337c3[_0xfca6('0x3e')]){_0x57716f[_0xfca6('0x3f')]=!![];}return _0x5b55b4[_0xfca6('0x1a')](_0x57716f);}else{return logger[_0xfca6('0x2b')](_0xfca6('0x2c'),'afterCreate','csc',util[_0xfca6('0x2e')](_0x2d3e2e['error'],{'showHidden':![],'depth':null}));}})[_0xfca6('0x2a')](function(_0x5803fd){return logger['error'](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x6a'),util[_0xfca6('0x2e')](_0x5803fd,{'showHidden':![],'depth':null}));});}else{logger[_0xfca6('0x2b')](_0xfca6('0x2c'),'afterCreate',_0xfca6('0x6a'),_0xfca6('0x6b'));}break;case _0xfca6('0x6c'):if(_0x3337c3[_0xfca6('0x5e')]){var _0x20d709={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3337c3['apiKey']},'body':{'content':_0xa9654e[_0xfca6('0xf')],'to':[_0xa9654e[_0xfca6('0x25')]],'from':_0x3337c3[_0xfca6('0x25')],'binary':![],'clientMessageId':_0xfca6('0x6d'),'charset':_0xfca6('0x6e')},'json':!![]};rp(_0x20d709)['then'](function(_0x5b462e){if(!_0x5b462e[_0xfca6('0x2b')]){var _0x39965c={'messageId':_0x5b462e[_0xfca6('0x23')][0x0][_0xfca6('0x6f')]};if(!_0x3337c3['deliveryReport']){_0x39965c[_0xfca6('0x3f')]=!![];}return _0x5b55b4[_0xfca6('0x1a')](_0x39965c);}else{return logger[_0xfca6('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),_0xfca6('0x6c'),util['inspect'](_0x5b462e['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1159b9){return logger[_0xfca6('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),_0xfca6('0x6c'),util[_0xfca6('0x2e')](_0x1159b9,{'showHidden':![],'depth':null}));});}else{logger[_0xfca6('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xfca6('0x2d'),_0xfca6('0x6c'),_0xfca6('0x6b'));}break;case _0xfca6('0x70'):if(_0x3337c3[_0xfca6('0x5e')]){var _0x3bac5b={};var _0x12f82a={'method':_0xfca6('0x3b'),'uri':_0xfca6('0x71'),'headers':{'Authorization':_0xfca6('0x72')+_0x3337c3[_0xfca6('0x5e')],'Content-Type':_0xfca6('0x5b')},'body':{'from':_0x3337c3[_0xfca6('0x25')],'to':_0xa9654e[_0xfca6('0x25')],'text':_0xa9654e['body']},'json':!![]};return rp(_0x12f82a)[_0xfca6('0x19')](function(_0x4ebb98){if(_0x4ebb98[_0xfca6('0x73')]==0xca){_0x3bac5b[_0xfca6('0x74')]=_0x4ebb98;var _0x11c475={'method':_0xfca6('0x3b'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xfca6('0x72')+_0x3337c3[_0xfca6('0x5e')],'Content-Type':'application/json'},'body':{'refid':_0x3bac5b[_0xfca6('0x74')][_0xfca6('0x75')]},'json':!![]};return rp(_0x11c475)[_0xfca6('0x19')](function(_0x1e98c7){_0x3bac5b['status']=_0x1e98c7;var _0x19b68f={'messageId':_0x3bac5b[_0xfca6('0x74')][_0xfca6('0x75')],'read':!![]};return _0x5b55b4[_0xfca6('0x1a')](_0x19b68f);});}else{return logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),'intelepeer',util[_0xfca6('0x2e')](_0x4ebb98,{'showHidden':![],'depth':null}));}})[_0xfca6('0x2a')](function(_0x5e2921){return logger['error'](_0xfca6('0x2c'),_0xfca6('0x2d'),_0xfca6('0x70'),util[_0xfca6('0x2e')](_0x5e2921,{'showHidden':![],'depth':null}));});}else{return logger[_0xfca6('0x2b')](_0xfca6('0x2c'),_0xfca6('0x2d'),'intelepeer','Token\x20not\x20received');}break;}}})['finally'](function(){_0x4635bd();});}else{_0x4635bd();}}},'charset':_0xfca6('0x76'),'collate':_0xfca6('0x77')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index dccef11..56bc3d7 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 _0xdb28=['then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0xdb28,0x106));var _0x8db2=function(_0x18cf35,_0x5c9058){_0x18cf35=_0x18cf35-0x0;var _0x2f44ec=_0xdb28[_0x18cf35];return _0x2f44ec;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('SmsMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateSmsMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateSmsMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x757a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','info','catch','CreateSmsMessage','SmsMessage','create','body','raw','debug','stringify','util','moment'];(function(_0x332c32,_0x4c9ffb){var _0x2e4f35=function(_0x1ab3a9){while(--_0x1ab3a9){_0x332c32['push'](_0x332c32['shift']());}};_0x2e4f35(++_0x4c9ffb);}(_0x757a,0xde));var _0xa757=function(_0x4dfc58,_0x90aad8){_0x4dfc58=_0x4dfc58-0x0;var _0xb5c320=_0x757a[_0x4dfc58];return _0xb5c320;};'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});config[_0xa757('0x9')]=_['defaults'](config[_0xa757('0x9')],{'host':_0xa757('0xa'),'port':0x18eb});var socket=require(_0xa757('0xb'))(new Redis(config[_0xa757('0x9')]));require(_0xa757('0xc'))['register'](socket);function respondWithRpcPromise(_0x89c630,_0x2ca96f,_0x32f0ec){return new BPromise(function(_0x3e2c9a,_0xb7610b){return client[_0xa757('0xd')](_0x89c630,_0x32f0ec)[_0xa757('0xe')](function(_0x483d77){logger['info']('SmsMessage,\x20%s,\x20%s',_0x2ca96f,'request\x20sent');logger['debug'](_0xa757('0xf'),_0x2ca96f,'request\x20sent',JSON['stringify'](_0x483d77));if(_0x483d77[_0xa757('0x10')]){if(_0x483d77['error']['code']===0x1f4){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0xb7610b(_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);}logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x483d77[_0xa757('0x10')][_0xa757('0x12')]);return _0x3e2c9a(_0x483d77['error'][_0xa757('0x12')]);}else{logger[_0xa757('0x13')](_0xa757('0x11'),_0x2ca96f,'request\x20sent');_0x3e2c9a(_0x483d77['result'][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x1bd14c){logger[_0xa757('0x10')](_0xa757('0x11'),_0x2ca96f,_0x1bd14c);_0xb7610b(_0x1bd14c);});});}exports[_0xa757('0x15')]=function(_0x4bd137){var _0x58954=this;return new Promise(function(_0x4fec52,_0x32c2a1){return db[_0xa757('0x16')][_0xa757('0x17')](_0x4bd137[_0xa757('0x18')],{'raw':_0x4bd137['options']?_0x4bd137['options'][_0xa757('0x19')]===undefined?!![]:![]:!![]})[_0xa757('0xe')](function(_0x2ba923){logger[_0xa757('0x13')](_0xa757('0x15'),_0x4bd137);logger[_0xa757('0x1a')](_0xa757('0x15'),_0x4bd137,JSON[_0xa757('0x1b')](_0x2ba923));_0x4fec52(_0x2ba923);})[_0xa757('0x14')](function(_0x59fae6){logger[_0xa757('0x10')]('CreateSmsMessage',_0x59fae6[_0xa757('0x12')],_0x4bd137);_0x32c2a1(_0x58954['error'](0x1f4,_0x59fae6[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d74ed7e..4898c16 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 _0x3861=['removeListener','smsMessage:','./smsMessage.events','remove','emit'];(function(_0x343a9b,_0x5aa0c0){var _0x1521a9=function(_0x3efc15){while(--_0x3efc15){_0x343a9b['push'](_0x343a9b['shift']());}};_0x1521a9(++_0x5aa0c0);}(_0x3861,0x1ec));var _0x1386=function(_0x3c349f,_0x366b88){_0x3c349f=_0x3c349f-0x0;var _0x3870cd=_0x3861[_0x3c349f];return _0x3870cd;};'use strict';var SmsMessageEvents=require(_0x1386('0x0'));var events=['save',_0x1386('0x1'),'update'];function createListener(_0x6d137a,_0x37db6e){return function(_0x3fbb73){_0x37db6e[_0x1386('0x2')](_0x6d137a,_0x3fbb73);};}function removeListener(_0x5e487c,_0x2fefc1){return function(){SmsMessageEvents[_0x1386('0x3')](_0x5e487c,_0x2fefc1);};}exports['register']=function(_0x5d705f){for(var _0x391bd0=0x0,_0x322921=events['length'];_0x391bd0<_0x322921;_0x391bd0++){var _0x254e5f=events[_0x391bd0];var _0x1d76f6=createListener(_0x1386('0x4')+_0x254e5f,_0x5d705f);SmsMessageEvents['on'](_0x254e5f,_0x1d76f6);}}; \ No newline at end of file +var _0x3682=['register','length','smsMessage:','./smsMessage.events','save','update'];(function(_0x435f71,_0x2ff13d){var _0x6811ae=function(_0x13bdf4){while(--_0x13bdf4){_0x435f71['push'](_0x435f71['shift']());}};_0x6811ae(++_0x2ff13d);}(_0x3682,0xb1));var _0x2368=function(_0x20412f,_0x32b502){_0x20412f=_0x20412f-0x0;var _0x16d840=_0x3682[_0x20412f];return _0x16d840;};'use strict';var SmsMessageEvents=require(_0x2368('0x0'));var events=[_0x2368('0x1'),'remove',_0x2368('0x2')];function createListener(_0x23cc56,_0x9c8f3){return function(_0x176fd0){_0x9c8f3['emit'](_0x23cc56,_0x176fd0);};}function removeListener(_0x3050f8,_0x4a2b1f){return function(){SmsMessageEvents['removeListener'](_0x3050f8,_0x4a2b1f);};}exports[_0x2368('0x3')]=function(_0x4c793e){for(var _0x994b55=0x0,_0x12444b=events[_0x2368('0x4')];_0x994b55<_0x12444b;_0x994b55++){var _0x45f2a0=events[_0x994b55];var _0x47d852=createListener(_0x2368('0x5')+_0x45f2a0,_0x4c793e);SmsMessageEvents['on'](_0x45f2a0,_0x47d852);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 44112eb..4ae34e2 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 _0xdc86=['/:id/users','getAgents','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams'];(function(_0x45e302,_0xbe25c7){var _0x593680=function(_0x172b83){while(--_0x172b83){_0x45e302['push'](_0x45e302['shift']());}};_0x593680(++_0xbe25c7);}(_0xdc86,0x118));var _0x6dc8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xdc86[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require('multer');var util=require(_0x6dc8('0x0'));var path=require('path');var timeout=require(_0x6dc8('0x1'));var express=require('express');var router=express[_0x6dc8('0x2')]();var auth=require(_0x6dc8('0x3'));var interaction=require(_0x6dc8('0x4'));var config=require(_0x6dc8('0x5'));var controller=require(_0x6dc8('0x6'));router['get']('/',auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x8')]);router[_0x6dc8('0x9')](_0x6dc8('0xa'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0xb')]);router[_0x6dc8('0x9')](_0x6dc8('0xc'),auth['isAuthenticated'](),controller[_0x6dc8('0xd')]);router['get'](_0x6dc8('0xe'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0xf')]);router[_0x6dc8('0x9')]('/:id/teams',auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x10')]);router[_0x6dc8('0x9')](_0x6dc8('0x11'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x12')]);router['post']('/',auth[_0x6dc8('0x7')](),controller['create']);router['post'](_0x6dc8('0x13'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x14')]);router['post'](_0x6dc8('0x11'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x15')]);router[_0x6dc8('0x16')](_0x6dc8('0xc'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x17')]);router[_0x6dc8('0x18')](_0x6dc8('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x6dc8('0x18')](_0x6dc8('0x13'),auth[_0x6dc8('0x7')](),controller[_0x6dc8('0x19')]);router[_0x6dc8('0x18')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x6dc8('0x1a')]=router; \ No newline at end of file +var _0x9829=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports'];(function(_0x1ff645,_0x3d461a){var _0x569648=function(_0x41a5d3){while(--_0x41a5d3){_0x1ff645['push'](_0x1ff645['shift']());}};_0x569648(++_0x3d461a);}(_0x9829,0xc4));var _0x9982=function(_0x46efd7,_0x43f84d){_0x46efd7=_0x46efd7-0x0;var _0x5637e4=_0x9829[_0x46efd7];return _0x5637e4;};'use strict';var multer=require(_0x9982('0x0'));var util=require(_0x9982('0x1'));var path=require(_0x9982('0x2'));var timeout=require(_0x9982('0x3'));var express=require(_0x9982('0x4'));var router=express['Router']();var auth=require(_0x9982('0x5'));var interaction=require(_0x9982('0x6'));var config=require(_0x9982('0x7'));var controller=require('./smsQueue.controller');router[_0x9982('0x8')]('/',auth[_0x9982('0x9')](),controller['index']);router['get'](_0x9982('0xa'),auth[_0x9982('0x9')](),controller['describe']);router[_0x9982('0x8')](_0x9982('0xb'),auth[_0x9982('0x9')](),controller[_0x9982('0xc')]);router[_0x9982('0x8')](_0x9982('0xd'),auth[_0x9982('0x9')](),controller[_0x9982('0xe')]);router[_0x9982('0x8')](_0x9982('0xf'),auth[_0x9982('0x9')](),controller[_0x9982('0x10')]);router[_0x9982('0x8')](_0x9982('0x11'),auth[_0x9982('0x9')](),controller[_0x9982('0x12')]);router[_0x9982('0x13')]('/',auth[_0x9982('0x9')](),controller['create']);router[_0x9982('0x13')](_0x9982('0xf'),auth['isAuthenticated'](),controller[_0x9982('0x14')]);router['post'](_0x9982('0x11'),auth[_0x9982('0x9')](),controller[_0x9982('0x15')]);router[_0x9982('0x16')](_0x9982('0xb'),auth[_0x9982('0x9')](),controller[_0x9982('0x17')]);router[_0x9982('0x18')](_0x9982('0xb'),auth['isAuthenticated'](),controller[_0x9982('0x19')]);router['delete'](_0x9982('0xf'),auth[_0x9982('0x9')](),controller['removeTeams']);router[_0x9982('0x18')](_0x9982('0x11'),auth[_0x9982('0x9')](),controller[_0x9982('0x1a')]);module[_0x9982('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 374c436..dca822b 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 _0x3f43=['sequelize','exports','STRING','INTEGER','rrmemory','roundrobin'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0x3f43,0x1e6));var _0x33f4=function(_0x486504,_0xedeea3){_0x486504=_0x486504-0x0;var _0x397b0f=_0x3f43[_0x486504];return _0x397b0f;};'use strict';var Sequelize=require(_0x33f4('0x0'));module[_0x33f4('0x1')]={'name':{'type':Sequelize[_0x33f4('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x33f4('0x2')]},'timeout':{'type':Sequelize[_0x33f4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x33f4('0x4'),'beepall',_0x33f4('0x5'))}}; \ No newline at end of file +var _0x258a=['STRING','name','rrmemory','roundrobin','sequelize','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x258a,0xd6));var _0xa258=function(_0x4f5248,_0x1eeba7){_0x4f5248=_0x4f5248-0x0;var _0x7b9d33=_0x258a[_0x4f5248];return _0x7b9d33;};'use strict';var Sequelize=require(_0xa258('0x0'));module[_0xa258('0x1')]={'name':{'type':Sequelize[_0xa258('0x2')],'unique':_0xa258('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa258('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa258('0x4'),'beepall',_0xa258('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8bc572e..bb97c3e 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 _0x1e3a=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','localhost','redis','./smsQueue.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','count','findAll','rows','catch','show','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','params','length','nolimit','UserSmsQueue','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','getTeams','Team','sort','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','value','removeTeams','emit','addAgents','omit','userSmsQueue:save','removeAgents','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0x229532,_0x1c0e67){var _0x598c8a=function(_0x3e25ac){while(--_0x3e25ac){_0x229532['push'](_0x229532['shift']());}};_0x598c8a(++_0x1c0e67);}(_0x1e3a,0x10a));var _0xa1e3=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x1e3a[_0x32f9ca];return _0x52e083;};'use strict';var pdf=require(_0xa1e3('0x0'));var emlformat=require(_0xa1e3('0x1'));var rimraf=require(_0xa1e3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1e3('0x3'));var rp=require(_0xa1e3('0x4'));var moment=require(_0xa1e3('0x5'));var BPromise=require(_0xa1e3('0x6'));var Mustache=require(_0xa1e3('0x7'));var util=require('util');var path=require(_0xa1e3('0x8'));var sox=require(_0xa1e3('0x9'));var csv=require(_0xa1e3('0xa'));var ejs=require(_0xa1e3('0xb'));var fs=require('fs');var _=require(_0xa1e3('0xc'));var squel=require(_0xa1e3('0xd'));var crypto=require(_0xa1e3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa1e3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa1e3('0x10'));var Papa=require(_0xa1e3('0x11'));var Redis=require('ioredis');var authService=require(_0xa1e3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa1e3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa1e3('0x14'))(_0xa1e3('0x15'));var utils=require('../../config/utils');var config=require(_0xa1e3('0x16'));var db=require(_0xa1e3('0x17'))['db'];config['redis']=_[_0xa1e3('0x18')](config['redis'],{'host':_0xa1e3('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa1e3('0x1a')]));require(_0xa1e3('0x1b'))['register'](socket);function respondWithStatusCode(_0x8efd4f,_0x35a350){_0x35a350=_0x35a350||0xcc;return function(_0xe6ab65){if(_0xe6ab65){return _0x8efd4f[_0xa1e3('0x1c')](_0x35a350);}return _0x8efd4f[_0xa1e3('0x1d')](_0x35a350)[_0xa1e3('0x1e')]();};}function respondWithResult(_0x16c28a,_0x480541){_0x480541=_0x480541||0xc8;return function(_0x3b1eb8){if(_0x3b1eb8){return _0x16c28a[_0xa1e3('0x1d')](_0x480541)[_0xa1e3('0x1f')](_0x3b1eb8);}};}function respondWithFilteredResult(_0x35aa23,_0x589682){return function(_0x4e6ee1){if(_0x4e6ee1){var _0x36c4cd=_0x4e6ee1['count'],_0x49b9c1=_0x589682['offset'],_0xacce3d=_0x589682[_0xa1e3('0x20')]+_0x589682[_0xa1e3('0x21')],_0x523969;if(_0xacce3d>=_0x36c4cd){_0xacce3d=_0x36c4cd;_0x523969=0xc8;}else{_0x523969=0xce;}_0x35aa23[_0xa1e3('0x1d')](_0x523969);return _0x35aa23[_0xa1e3('0x22')](_0xa1e3('0x23'),_0x49b9c1+'-'+_0xacce3d+'/'+_0x36c4cd)[_0xa1e3('0x1f')](_0x4e6ee1);}return null;};}function patchUpdates(_0xb92fcc){return function(_0x376a4d){try{jsonpatch['apply'](_0x376a4d,_0xb92fcc,!![]);}catch(_0x5ba33b){return BPromise[_0xa1e3('0x24')](_0x5ba33b);}return _0x376a4d[_0xa1e3('0x25')]();};}function saveUpdates(_0x996d95,_0x304d4d){return function(_0x4186f8){if(_0x4186f8){return _0x4186f8[_0xa1e3('0x26')](_0x996d95)[_0xa1e3('0x27')](function(_0x1daec4){return _0x1daec4;});}return null;};}function removeEntity(_0x34bea7,_0x55950d){return function(_0x119618){if(_0x119618){return _0x119618[_0xa1e3('0x28')]()[_0xa1e3('0x27')](function(){var _0x8bd669=_0x119618[_0xa1e3('0x29')]({'plain':!![]});var _0x15273a='SmsQueues';return db[_0xa1e3('0x2a')][_0xa1e3('0x28')]({'where':{'type':_0x15273a,'resourceId':_0x8bd669['id']}})[_0xa1e3('0x27')](function(){return _0x119618;});})[_0xa1e3('0x27')](function(){_0x34bea7[_0xa1e3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2beedf,_0x2314f9){return function(_0x1ab284){if(!_0x1ab284){_0x2beedf['sendStatus'](0x194);}return _0x1ab284;};}function handleError(_0x4cd214,_0x1025c5){_0x1025c5=_0x1025c5||0x1f4;return function(_0x3b8583){logger[_0xa1e3('0x2b')](_0x3b8583[_0xa1e3('0x2c')]);if(_0x3b8583[_0xa1e3('0x2d')]){delete _0x3b8583[_0xa1e3('0x2d')];}_0x4cd214[_0xa1e3('0x1d')](_0x1025c5)[_0xa1e3('0x2e')](_0x3b8583);};}exports[_0xa1e3('0x2f')]=function(_0x1d98bb,_0x1fefd8){var _0x56175c={},_0x1da712={},_0x57a2ea={'count':0x0,'rows':[]};var _0x5b3bb6=_[_0xa1e3('0x30')](db[_0xa1e3('0x31')][_0xa1e3('0x32')],function(_0x59af4b){return{'name':_0x59af4b[_0xa1e3('0x33')],'type':_0x59af4b[_0xa1e3('0x34')][_0xa1e3('0x35')]};});_0x1da712[_0xa1e3('0x36')]=_[_0xa1e3('0x30')](_0x5b3bb6,_0xa1e3('0x2d'));_0x1da712[_0xa1e3('0x37')]=_[_0xa1e3('0x38')](_0x1d98bb[_0xa1e3('0x37')]);_0x1da712[_0xa1e3('0x39')]=_[_0xa1e3('0x3a')](_0x1da712[_0xa1e3('0x36')],_0x1da712[_0xa1e3('0x37')]);_0x56175c[_0xa1e3('0x3b')]=_[_0xa1e3('0x3a')](_0x1da712['model'],qs['fields'](_0x1d98bb['query'][_0xa1e3('0x3c')]));_0x56175c[_0xa1e3('0x3b')]=_0x56175c['attributes']['length']?_0x56175c[_0xa1e3('0x3b')]:_0x1da712['model'];if(!_0x1d98bb['query'][_0xa1e3('0x3d')]('nolimit')){_0x56175c[_0xa1e3('0x21')]=qs[_0xa1e3('0x21')](_0x1d98bb[_0xa1e3('0x37')][_0xa1e3('0x21')]);_0x56175c[_0xa1e3('0x20')]=qs['offset'](_0x1d98bb[_0xa1e3('0x37')][_0xa1e3('0x20')]);}_0x56175c[_0xa1e3('0x3e')]=qs['sort'](_0x1d98bb[_0xa1e3('0x37')]['sort']);_0x56175c[_0xa1e3('0x3f')]=qs[_0xa1e3('0x39')](_[_0xa1e3('0x40')](_0x1d98bb[_0xa1e3('0x37')],_0x1da712[_0xa1e3('0x39')]),_0x5b3bb6);if(_0x1d98bb[_0xa1e3('0x37')][_0xa1e3('0x41')]){_0x56175c['where']=_[_0xa1e3('0x42')](_0x56175c[_0xa1e3('0x3f')],{'$or':_[_0xa1e3('0x30')](_0x5b3bb6,function(_0x53bd18){if(_0x53bd18[_0xa1e3('0x34')]!==_0xa1e3('0x43')){var _0x1a19d3={};_0x1a19d3[_0x53bd18[_0xa1e3('0x2d')]]={'$like':'%'+_0x1d98bb['query'][_0xa1e3('0x41')]+'%'};return _0x1a19d3;}})});}_0x56175c=_[_0xa1e3('0x42')]({},_0x56175c,_0x1d98bb['options']);var _0x18c5ee={'where':_0x56175c['where']};return db[_0xa1e3('0x31')]['count'](_0x18c5ee)[_0xa1e3('0x27')](function(_0x5de425){_0x57a2ea[_0xa1e3('0x44')]=_0x5de425;if(_0x1d98bb['query']['includeAll']){_0x56175c['include']=[{'all':!![]}];}return db[_0xa1e3('0x31')][_0xa1e3('0x45')](_0x56175c);})['then'](function(_0x3328a1){_0x57a2ea[_0xa1e3('0x46')]=_0x3328a1;return _0x57a2ea;})['then'](respondWithFilteredResult(_0x1fefd8,_0x56175c))[_0xa1e3('0x47')](handleError(_0x1fefd8,null));};exports[_0xa1e3('0x48')]=function(_0xeca170,_0x4df734){var _0x555d8a={'raw':!![],'where':{'id':_0xeca170['params']['id']}},_0x19e746={};_0x19e746[_0xa1e3('0x36')]=_['keys'](db['SmsQueue'][_0xa1e3('0x32')]);_0x19e746[_0xa1e3('0x37')]=_[_0xa1e3('0x38')](_0xeca170[_0xa1e3('0x37')]);_0x19e746[_0xa1e3('0x39')]=_[_0xa1e3('0x3a')](_0x19e746['model'],_0x19e746[_0xa1e3('0x37')]);_0x555d8a['attributes']=_['intersection'](_0x19e746[_0xa1e3('0x36')],qs[_0xa1e3('0x3c')](_0xeca170[_0xa1e3('0x37')][_0xa1e3('0x3c')]));_0x555d8a[_0xa1e3('0x3b')]=_0x555d8a[_0xa1e3('0x3b')]['length']?_0x555d8a[_0xa1e3('0x3b')]:_0x19e746[_0xa1e3('0x36')];if(_0xeca170[_0xa1e3('0x37')][_0xa1e3('0x49')]){_0x555d8a['include']=[{'all':!![]}];}_0x555d8a=_[_0xa1e3('0x42')]({},_0x555d8a,_0xeca170[_0xa1e3('0x4a')]);return db[_0xa1e3('0x31')][_0xa1e3('0x4b')](_0x555d8a)[_0xa1e3('0x27')](handleEntityNotFound(_0x4df734,null))[_0xa1e3('0x27')](respondWithResult(_0x4df734,null))['catch'](handleError(_0x4df734,null));};exports[_0xa1e3('0x4c')]=function(_0x5dcf38,_0x6e4b12){return db['SmsQueue']['create'](_0x5dcf38['body'],{})[_0xa1e3('0x27')](function(_0x2e518f){var _0x272fb6=_0x5dcf38[_0xa1e3('0x4d')][_0xa1e3('0x29')]({'plain':!![]});if(!_0x272fb6)throw new Error(_0xa1e3('0x4e'));if(_0x272fb6[_0xa1e3('0x4f')]==='user'){var _0x30fb4a=_0x2e518f[_0xa1e3('0x29')]({'plain':!![]});var _0x35d346=_0xa1e3('0x50');return db[_0xa1e3('0x51')][_0xa1e3('0x4b')]({'where':{'name':_0x35d346,'userProfileId':_0x272fb6['userProfileId']},'raw':!![]})[_0xa1e3('0x27')](function(_0x990c82){if(_0x990c82&&_0x990c82[_0xa1e3('0x52')]===0x0){return db[_0xa1e3('0x2a')][_0xa1e3('0x4c')]({'name':_0x30fb4a[_0xa1e3('0x2d')],'resourceId':_0x30fb4a['id'],'type':_0x990c82[_0xa1e3('0x2d')],'sectionId':_0x990c82['id']},{})[_0xa1e3('0x27')](function(){return _0x2e518f;});}else{return _0x2e518f;}})['catch'](function(_0x332ac8){logger['error'](_0xa1e3('0x53'),_0x332ac8);throw _0x332ac8;});}return _0x2e518f;})['then'](respondWithResult(_0x6e4b12,0xc9))['catch'](handleError(_0x6e4b12,null));};exports[_0xa1e3('0x26')]=function(_0x20da2c,_0x173d2c){if(_0x20da2c[_0xa1e3('0x54')]['id']){delete _0x20da2c[_0xa1e3('0x54')]['id'];}return db[_0xa1e3('0x31')][_0xa1e3('0x4b')]({'where':{'id':_0x20da2c['params']['id']}})[_0xa1e3('0x27')](handleEntityNotFound(_0x173d2c,null))['then'](saveUpdates(_0x20da2c[_0xa1e3('0x54')],null))[_0xa1e3('0x27')](respondWithResult(_0x173d2c,null))[_0xa1e3('0x47')](handleError(_0x173d2c,null));};exports[_0xa1e3('0x28')]=function(_0x3f83f3,_0x590915){return db[_0xa1e3('0x31')]['find']({'where':{'id':_0x3f83f3['params']['id']}})[_0xa1e3('0x27')](handleEntityNotFound(_0x590915,null))[_0xa1e3('0x27')](removeEntity(_0x590915,null))[_0xa1e3('0x47')](handleError(_0x590915,null));};exports[_0xa1e3('0x55')]=function(_0x1018cc,_0x4787af){return db[_0xa1e3('0x31')][_0xa1e3('0x55')]()[_0xa1e3('0x27')](respondWithResult(_0x4787af,null))['catch'](handleError(_0x4787af,null));};exports[_0xa1e3('0x56')]=function(_0x19ea2b,_0x3750c2,_0x30bac7){var _0x3a4a12={'raw':!![],'where':{}},_0x8d829b={},_0x14338c;return db[_0xa1e3('0x31')][_0xa1e3('0x57')]({'where':{'id':_0x19ea2b[_0xa1e3('0x58')]['id']}})[_0xa1e3('0x27')](handleEntityNotFound(_0x3750c2,null))[_0xa1e3('0x27')](function(_0x32e5c2){if(_0x32e5c2){_0x14338c=_0x32e5c2[_0xa1e3('0x29')]({'plain':!![]});_0x8d829b['model']=_['keys'](db['UserSmsQueue'][_0xa1e3('0x32')]);_0x8d829b[_0xa1e3('0x37')]=_['keys'](_0x19ea2b[_0xa1e3('0x37')]);_0x8d829b[_0xa1e3('0x39')]=_[_0xa1e3('0x3a')](_0x8d829b[_0xa1e3('0x36')],_0x8d829b[_0xa1e3('0x37')]);_0x3a4a12['attributes']=_[_0xa1e3('0x3a')](_0x8d829b[_0xa1e3('0x36')],qs[_0xa1e3('0x3c')](_0x19ea2b[_0xa1e3('0x37')][_0xa1e3('0x3c')]));_0x3a4a12[_0xa1e3('0x3b')]=_0x3a4a12[_0xa1e3('0x3b')][_0xa1e3('0x59')]?_0x3a4a12['attributes']:_0x8d829b[_0xa1e3('0x36')];if(!_0x19ea2b['query']['hasOwnProperty'](_0xa1e3('0x5a'))){_0x3a4a12[_0xa1e3('0x21')]=qs[_0xa1e3('0x21')](_0x19ea2b[_0xa1e3('0x37')][_0xa1e3('0x21')]);_0x3a4a12[_0xa1e3('0x20')]=qs[_0xa1e3('0x20')](_0x19ea2b[_0xa1e3('0x37')][_0xa1e3('0x20')]);}_0x3a4a12[_0xa1e3('0x3e')]=qs['sort'](_0x19ea2b[_0xa1e3('0x37')]['sort']);_0x3a4a12[_0xa1e3('0x3f')]=qs[_0xa1e3('0x39')](_[_0xa1e3('0x40')](_0x19ea2b[_0xa1e3('0x37')],_0x8d829b['filters']));_0x3a4a12['where']['SmsQueueId']=_0x32e5c2['id'];if(_0x19ea2b['query'][_0xa1e3('0x41')]){_0x3a4a12[_0xa1e3('0x3f')]=_[_0xa1e3('0x42')](_0x3a4a12[_0xa1e3('0x3f')],{'$or':_['map'](_0x3a4a12[_0xa1e3('0x3b')],function(_0x17ff3c){var _0x1bf3b5={};_0x1bf3b5[_0x17ff3c]={'$like':'%'+_0x19ea2b[_0xa1e3('0x37')][_0xa1e3('0x41')]+'%'};return _0x1bf3b5;})});}_0x3a4a12=_[_0xa1e3('0x42')]({},_0x3a4a12,_0x19ea2b['options']);return db[_0xa1e3('0x5b')]['findAll'](_0x3a4a12);}})[_0xa1e3('0x27')](function(_0x429d1b){if(_0x429d1b){return db['User'][_0xa1e3('0x5c')]({'where':{'id':_[_0xa1e3('0x30')](_0x429d1b,_0xa1e3('0x5d')),'role':_0xa1e3('0x5e')},'attributes':['id',_0xa1e3('0x2d'),_0xa1e3('0x5f'),_0xa1e3('0x60'),_0xa1e3('0x61')]});}})[_0xa1e3('0x27')](function(_0x43dab0){if(_0x43dab0){return{'count':_0x43dab0[_0xa1e3('0x44')],'rows':_[_0xa1e3('0x30')](_0x43dab0[_0xa1e3('0x46')],function(_0x4a7bd2){return{'membername':_0x4a7bd2[_0xa1e3('0x2d')],'UserId':_0x4a7bd2['id'],'queue_name':_0x14338c[_0xa1e3('0x2d')],'SmsQueueId':_0x14338c['id'],'interface':util['format'](_0xa1e3('0x62'),'SIP',_0x4a7bd2['name']),'penalty':0x0,'paused':_0x4a7bd2[_0xa1e3('0x5f')],'createdAt':_0x4a7bd2[_0xa1e3('0x61')],'updatedAt':_0x4a7bd2[_0xa1e3('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3750c2,_0x3a4a12))['catch'](handleError(_0x3750c2,null));};exports[_0xa1e3('0x63')]=function(_0x234b68,_0xe6c5e2,_0x3ba01b){var _0x4c214f={};var _0x145a72={};var _0x2fef43;var _0x33318a;return db[_0xa1e3('0x31')][_0xa1e3('0x57')]({'where':{'id':_0x234b68[_0xa1e3('0x58')]['id']}})['then'](handleEntityNotFound(_0xe6c5e2,null))[_0xa1e3('0x27')](function(_0x56de13){if(_0x56de13){_0x2fef43=_0x56de13;_0x145a72['model']=_[_0xa1e3('0x38')](db[_0xa1e3('0x64')]['rawAttributes']);_0x145a72['query']=_[_0xa1e3('0x38')](_0x234b68['query']);_0x145a72[_0xa1e3('0x39')]=_[_0xa1e3('0x3a')](_0x145a72['model'],_0x145a72[_0xa1e3('0x37')]);_0x4c214f[_0xa1e3('0x3b')]=_[_0xa1e3('0x3a')](_0x145a72[_0xa1e3('0x36')],qs[_0xa1e3('0x3c')](_0x234b68[_0xa1e3('0x37')][_0xa1e3('0x3c')]));_0x4c214f[_0xa1e3('0x3b')]=_0x4c214f[_0xa1e3('0x3b')][_0xa1e3('0x59')]?_0x4c214f[_0xa1e3('0x3b')]:_0x145a72[_0xa1e3('0x36')];_0x4c214f[_0xa1e3('0x3e')]=qs[_0xa1e3('0x65')](_0x234b68[_0xa1e3('0x37')][_0xa1e3('0x65')]);_0x4c214f['where']=qs[_0xa1e3('0x39')](_['pick'](_0x234b68['query'],_0x145a72[_0xa1e3('0x39')]));if(_0x234b68[_0xa1e3('0x37')][_0xa1e3('0x41')]){_0x4c214f[_0xa1e3('0x3f')]=_[_0xa1e3('0x42')](_0x4c214f[_0xa1e3('0x3f')],{'$or':_[_0xa1e3('0x30')](_0x4c214f[_0xa1e3('0x3b')],function(_0x3a727){var _0x2e92aa={};_0x2e92aa[_0x3a727]={'$like':'%'+_0x234b68[_0xa1e3('0x37')][_0xa1e3('0x41')]+'%'};return _0x2e92aa;})});}_0x4c214f=_['merge']({},_0x4c214f,_0x234b68[_0xa1e3('0x4a')]);return _0x2fef43['getTeams'](_0x4c214f);}})[_0xa1e3('0x27')](function(_0x28e7b2){if(_0x28e7b2){_0x33318a=_0x28e7b2[_0xa1e3('0x59')];if(!_0x234b68[_0xa1e3('0x37')][_0xa1e3('0x3d')](_0xa1e3('0x5a'))){_0x4c214f['limit']=qs['limit'](_0x234b68[_0xa1e3('0x37')][_0xa1e3('0x21')]);_0x4c214f['offset']=qs[_0xa1e3('0x20')](_0x234b68[_0xa1e3('0x37')]['offset']);}return _0x2fef43[_0xa1e3('0x63')](_0x4c214f);}})[_0xa1e3('0x27')](function(_0x22d37c){if(_0x22d37c){return _0x22d37c?{'count':_0x33318a,'rows':_0x22d37c}:null;}})['then'](respondWithResult(_0xe6c5e2,null))['catch'](handleError(_0xe6c5e2,null));};exports[_0xa1e3('0x66')]=function(_0x3bbe6e,_0x1bfe0a,_0x2a4111){var _0x2545f0=_0x3bbe6e[_0xa1e3('0x54')][_0xa1e3('0x67')];return db['Team'][_0xa1e3('0x45')]({'where':{'id':_0x2545f0},'attributes':['id'],'include':[{'model':db[_0xa1e3('0x68')],'as':_0xa1e3('0x69'),'attributes':['id',_0xa1e3('0x2d'),_0xa1e3('0x6a'),_0xa1e3('0x6b'),_0xa1e3('0x6c')],'raw':!![]}]})[_0xa1e3('0x27')](function(_0x54fb0b){if(_0x54fb0b){var _0x4ff891=_[_0xa1e3('0x6d')](_0x54fb0b,function(_0x57f300){var _0x2212eb=_0x57f300['get']({'plain':!![]});return _0x2212eb[_0xa1e3('0x69')];});return db[_0xa1e3('0x31')][_0xa1e3('0x4b')]({'where':{'id':_0x3bbe6e[_0xa1e3('0x58')]['id']}})[_0xa1e3('0x27')](function(_0x165cc4){return db[_0xa1e3('0x6e')][_0xa1e3('0x6f')](function(_0x43d8de){return _0x165cc4[_0xa1e3('0x66')](_0x2545f0,{'transaction':_0x43d8de})[_0xa1e3('0x27')](function(){return BPromise[_0xa1e3('0x70')](_0x4ff891,function(_0x1711bc){return db[_0xa1e3('0x5b')]['findOrCreate']({'where':{'UserId':_0x1711bc['id'],'SmsQueueId':_0x3bbe6e[_0xa1e3('0x58')]['id']},'transaction':_0x43d8de});});})['then'](function(){_0x4ff891[_0xa1e3('0x71')](function(_0x17ea19){socket['emit']('userSmsQueue:save',{'UserId':_0x17ea19['id'],'SmsQueueId':_0x165cc4['id']});});});});});}})[_0xa1e3('0x27')](respondWithStatusCode(_0x1bfe0a,null))[_0xa1e3('0x47')](handleError(_0x1bfe0a,null));};exports['removeTeams']=function(_0xa5d05a,_0x4710aa,_0x278af4){return db[_0xa1e3('0x64')][_0xa1e3('0x45')]({'where':{'id':_0xa5d05a['query'][_0xa1e3('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa1e3('0x69'),'attributes':['id'],'raw':!![]}]})[_0xa1e3('0x27')](handleEntityNotFound(_0x4710aa,null))['then'](function(_0x510014){var _0x46a383=_['map'](_0x510014,'id');var _0x487b43=[];var _0x33fc9d=[];var _0x139e57=squel[_0xa1e3('0x72')]();_0x139e57[_0xa1e3('0x73')](_0xa1e3('0x74'))[_0xa1e3('0x75')](_0xa1e3('0x76'),'tq')[_0xa1e3('0x77')](_0xa1e3('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1e3('0x3f')](_0xa1e3('0x79'),_0xa5d05a[_0xa1e3('0x58')]['id']);for(var _0x3b7314=0x0;_0x3b7314<_0x510014[_0xa1e3('0x59')];_0x3b7314+=0x1){let _0x13e95b=_0x510014[_0x3b7314];for(var _0x10822d=0x0;_0x10822d<_0x13e95b['Agents']['length'];_0x10822d+=0x1){let _0x414364=_0x13e95b[_0xa1e3('0x69')][_0x10822d];var _0x24a885=_0x139e57[_0xa1e3('0x7a')]();_0x24a885['where'](_0xa1e3('0x7b'),_0x414364['id']);_0x33fc9d[_0xa1e3('0x7c')](db[_0xa1e3('0x6e')][_0xa1e3('0x37')](_0x24a885[_0xa1e3('0x7d')](),{'type':db[_0xa1e3('0x6e')]['QueryTypes'][_0xa1e3('0x7e')]})[_0xa1e3('0x27')](function(_0x1c8ca8){if(_0x1c8ca8[_0xa1e3('0x59')]===0x1){return _0x414364['id'];}else{var _0x382a63=_[_0xa1e3('0x7f')](_[_0xa1e3('0x30')](_0x1c8ca8,_0xa1e3('0x80')),function(_0x480279){return _[_0xa1e3('0x81')](_0x46a383,_0x480279);});if(_0x382a63){return _0x414364['id'];}}}));}}return BPromise[_0xa1e3('0x82')](_0x33fc9d)['then'](function(_0x2c3973){_0x487b43=_(_0x487b43)[_0xa1e3('0x83')](_0x2c3973)['compact']()[_0xa1e3('0x84')]();return db[_0xa1e3('0x31')][_0xa1e3('0x4b')]({'where':{'id':_0xa5d05a[_0xa1e3('0x58')]['id']}})[_0xa1e3('0x27')](function(_0x31ff4e){return db[_0xa1e3('0x6e')][_0xa1e3('0x6f')](function(_0x191ed8){return _0x31ff4e[_0xa1e3('0x85')](_0xa5d05a[_0xa1e3('0x37')][_0xa1e3('0x67')],{'transaction':_0x191ed8})[_0xa1e3('0x27')](function(){if(!_['isEmpty'](_0x487b43)){return _0x31ff4e['removeAgents'](_0x487b43,{'transaction':_0x191ed8});}})[_0xa1e3('0x27')](function(){_0x487b43[_0xa1e3('0x71')](function(_0x1d22e9){socket[_0xa1e3('0x86')]('userSmsQueue:remove',{'UserId':_0x1d22e9,'SmsQueueId':_0x31ff4e['id']});});});});});});})[_0xa1e3('0x27')](respondWithStatusCode(_0x4710aa,null))['catch'](handleError(_0x4710aa,null));};exports[_0xa1e3('0x87')]=function(_0x576f77,_0xaf8174,_0x3b8ded){return db[_0xa1e3('0x31')][_0xa1e3('0x4b')]({'where':{'id':_0x576f77['params']['id']}})[_0xa1e3('0x27')](handleEntityNotFound(_0xaf8174,null))[_0xa1e3('0x27')](function(_0x8739f4){if(_0x8739f4){return _0x8739f4['addAgents'](_0x576f77['body'][_0xa1e3('0x67')],_[_0xa1e3('0x88')](_0x576f77[_0xa1e3('0x54')],['ids','id'])||{})['spread'](function(_0x354945){for(var _0x272246=0x0;_0x272246<_0x576f77['body'][_0xa1e3('0x67')]['length'];_0x272246+=0x1){socket[_0xa1e3('0x86')](_0xa1e3('0x89'),{'UserId':_0x576f77[_0xa1e3('0x54')][_0xa1e3('0x67')][_0x272246],'SmsQueueId':_0x576f77[_0xa1e3('0x58')]['id']});}return _0x354945;});}})[_0xa1e3('0x27')](respondWithResult(_0xaf8174,null))['catch'](handleError(_0xaf8174,null));};exports[_0xa1e3('0x8a')]=function(_0x277d10,_0xb9f429,_0x44586a){return db[_0xa1e3('0x31')]['find']({'where':{'id':_0x277d10[_0xa1e3('0x58')]['id']}})[_0xa1e3('0x27')](handleEntityNotFound(_0xb9f429,null))['then'](function(_0x2ab839){if(_0x2ab839){return _0x2ab839[_0xa1e3('0x8a')](_0x277d10['query'][_0xa1e3('0x67')])[_0xa1e3('0x27')](function(){if(_[_0xa1e3('0x8b')](_0x277d10[_0xa1e3('0x37')][_0xa1e3('0x67')])){for(var _0x30b6fc=0x0;_0x30b6fc<_0x277d10['query'][_0xa1e3('0x67')][_0xa1e3('0x59')];_0x30b6fc+=0x1){socket[_0xa1e3('0x86')](_0xa1e3('0x8c'),{'UserId':Number(_0x277d10[_0xa1e3('0x37')][_0xa1e3('0x67')][_0x30b6fc]),'SmsQueueId':Number(_0x277d10[_0xa1e3('0x58')]['id'])});}}else{socket[_0xa1e3('0x86')]('userSmsQueue:remove',{'UserId':Number(_0x277d10[_0xa1e3('0x37')][_0xa1e3('0x67')]),'SmsQueueId':Number(_0x277d10[_0xa1e3('0x58')]['id'])});}});}})[_0xa1e3('0x27')](respondWithStatusCode(_0xb9f429,null))[_0xa1e3('0x47')](handleError(_0xb9f429,null));};exports[_0xa1e3('0x8d')]=function(_0x57a454,_0x5a8403,_0x1771ac){var _0x42e0ca={};var _0x5886c2={};var _0xcbf37e;var _0x9148f0;return db[_0xa1e3('0x31')][_0xa1e3('0x57')]({'where':{'id':_0x57a454[_0xa1e3('0x58')]['id']}})[_0xa1e3('0x27')](handleEntityNotFound(_0x5a8403,null))[_0xa1e3('0x27')](function(_0x30fab7){if(_0x30fab7){_0xcbf37e=_0x30fab7;_0x5886c2[_0xa1e3('0x36')]=_['keys'](db['User'][_0xa1e3('0x32')]);_0x5886c2[_0xa1e3('0x37')]=_['keys'](_0x57a454[_0xa1e3('0x37')]);_0x5886c2[_0xa1e3('0x39')]=_[_0xa1e3('0x3a')](_0x5886c2[_0xa1e3('0x36')],_0x5886c2['query']);_0x42e0ca[_0xa1e3('0x3b')]=_[_0xa1e3('0x3a')](_0x5886c2[_0xa1e3('0x36')],qs[_0xa1e3('0x3c')](_0x57a454[_0xa1e3('0x37')][_0xa1e3('0x3c')]));_0x42e0ca[_0xa1e3('0x3b')]=_0x42e0ca[_0xa1e3('0x3b')]['length']?_0x42e0ca['attributes']:_0x5886c2[_0xa1e3('0x36')];_0x42e0ca[_0xa1e3('0x3e')]=qs['sort'](_0x57a454[_0xa1e3('0x37')]['sort']);_0x42e0ca[_0xa1e3('0x3f')]=qs[_0xa1e3('0x39')](_[_0xa1e3('0x40')](_0x57a454[_0xa1e3('0x37')],_0x5886c2[_0xa1e3('0x39')]));if(_0x57a454[_0xa1e3('0x37')]['filter']){_0x42e0ca[_0xa1e3('0x3f')]=_['merge'](_0x42e0ca['where'],{'$or':_[_0xa1e3('0x30')](_0x42e0ca[_0xa1e3('0x3b')],function(_0x1ecb0a){var _0x4425c7={};_0x4425c7[_0x1ecb0a]={'$like':'%'+_0x57a454[_0xa1e3('0x37')][_0xa1e3('0x41')]+'%'};return _0x4425c7;})});}_0x42e0ca=_['merge']({},_0x42e0ca,_0x57a454[_0xa1e3('0x4a')]);return _0xcbf37e[_0xa1e3('0x8d')](_0x42e0ca);}})[_0xa1e3('0x27')](function(_0x1a3093){if(_0x1a3093){_0x9148f0=_0x1a3093['length'];if(!_0x57a454['query'][_0xa1e3('0x3d')](_0xa1e3('0x5a'))){_0x42e0ca[_0xa1e3('0x21')]=qs[_0xa1e3('0x21')](_0x57a454[_0xa1e3('0x37')][_0xa1e3('0x21')]);_0x42e0ca[_0xa1e3('0x20')]=qs[_0xa1e3('0x20')](_0x57a454[_0xa1e3('0x37')][_0xa1e3('0x20')]);}return _0xcbf37e['getAgents'](_0x42e0ca);}})['then'](function(_0x205aa5){if(_0x205aa5){return _0x205aa5?{'count':_0x9148f0,'rows':_0x205aa5}:null;}})['then'](respondWithResult(_0x5a8403,null))[_0xa1e3('0x47')](handleError(_0x5a8403,null));}; \ No newline at end of file +var _0x87f0=['VIRTUAL','includeAll','catch','show','params','keys','rawAttributes','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','nolimit','SmsQueueId','UserSmsQueue','findAll','UserId','agent','smsPause','createdAt','rows','format','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','TeamId','includes','all','union','value','isEmpty','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','isArray','findOne','getAgents','html-pdf','rimraf','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsQueue.socket','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','error','name','send','index','map','SmsQueue','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge'];(function(_0x3d3a8a,_0x1a8661){var _0x248e3e=function(_0x41df27){while(--_0x41df27){_0x3d3a8a['push'](_0x3d3a8a['shift']());}};_0x248e3e(++_0x1a8661);}(_0x87f0,0x1dc));var _0x087f=function(_0x5df2b1,_0x320cfd){_0x5df2b1=_0x5df2b1-0x0;var _0x9a0042=_0x87f0[_0x5df2b1];return _0x9a0042;};'use strict';var pdf=require(_0x087f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x087f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x087f('0x2'));var BPromise=require(_0x087f('0x3'));var Mustache=require(_0x087f('0x4'));var util=require(_0x087f('0x5'));var path=require(_0x087f('0x6'));var sox=require(_0x087f('0x7'));var csv=require('to-csv');var ejs=require(_0x087f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x087f('0x9'));var crypto=require(_0x087f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x087f('0xb'));var Papa=require(_0x087f('0xc'));var Redis=require(_0x087f('0xd'));var authService=require(_0x087f('0xe'));var qs=require(_0x087f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x087f('0x10'));var logger=require(_0x087f('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x087f('0x12'));var db=require(_0x087f('0x13'))['db'];config[_0x087f('0x14')]=_[_0x087f('0x15')](config[_0x087f('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x087f('0x16'))(new Redis(config[_0x087f('0x14')]));require(_0x087f('0x17'))['register'](socket);function respondWithStatusCode(_0x29f539,_0x4c415c){_0x4c415c=_0x4c415c||0xcc;return function(_0x502b77){if(_0x502b77){return _0x29f539[_0x087f('0x18')](_0x4c415c);}return _0x29f539['status'](_0x4c415c)[_0x087f('0x19')]();};}function respondWithResult(_0x4a3cc1,_0x1187e0){_0x1187e0=_0x1187e0||0xc8;return function(_0x5ce501){if(_0x5ce501){return _0x4a3cc1[_0x087f('0x1a')](_0x1187e0)[_0x087f('0x1b')](_0x5ce501);}};}function respondWithFilteredResult(_0x2a310d,_0x2c111f){return function(_0x13b174){if(_0x13b174){var _0x56d473=_0x13b174[_0x087f('0x1c')],_0x99a99e=_0x2c111f[_0x087f('0x1d')],_0x1f85ad=_0x2c111f[_0x087f('0x1d')]+_0x2c111f[_0x087f('0x1e')],_0x3d4860;if(_0x1f85ad>=_0x56d473){_0x1f85ad=_0x56d473;_0x3d4860=0xc8;}else{_0x3d4860=0xce;}_0x2a310d['status'](_0x3d4860);return _0x2a310d[_0x087f('0x1f')]('Content-Range',_0x99a99e+'-'+_0x1f85ad+'/'+_0x56d473)[_0x087f('0x1b')](_0x13b174);}return null;};}function patchUpdates(_0x10dadb){return function(_0x2afb4b){try{jsonpatch[_0x087f('0x20')](_0x2afb4b,_0x10dadb,!![]);}catch(_0x543a6b){return BPromise['reject'](_0x543a6b);}return _0x2afb4b[_0x087f('0x21')]();};}function saveUpdates(_0x47cabd,_0x2c40d3){return function(_0x456be1){if(_0x456be1){return _0x456be1[_0x087f('0x22')](_0x47cabd)[_0x087f('0x23')](function(_0x511149){return _0x511149;});}return null;};}function removeEntity(_0x4908be,_0x44354f){return function(_0x4a5992){if(_0x4a5992){return _0x4a5992[_0x087f('0x24')]()[_0x087f('0x23')](function(){var _0x29d8fc=_0x4a5992[_0x087f('0x25')]({'plain':!![]});var _0x30bd4a='SmsQueues';return db[_0x087f('0x26')][_0x087f('0x24')]({'where':{'type':_0x30bd4a,'resourceId':_0x29d8fc['id']}})[_0x087f('0x23')](function(){return _0x4a5992;});})['then'](function(){_0x4908be['status'](0xcc)[_0x087f('0x19')]();});}};}function handleEntityNotFound(_0x3e1994,_0x40a882){return function(_0x3906d3){if(!_0x3906d3){_0x3e1994[_0x087f('0x18')](0x194);}return _0x3906d3;};}function handleError(_0x5b5f1b,_0x3bf47e){_0x3bf47e=_0x3bf47e||0x1f4;return function(_0x3003b9){logger[_0x087f('0x27')](_0x3003b9['stack']);if(_0x3003b9[_0x087f('0x28')]){delete _0x3003b9[_0x087f('0x28')];}_0x5b5f1b[_0x087f('0x1a')](_0x3bf47e)[_0x087f('0x29')](_0x3003b9);};}exports[_0x087f('0x2a')]=function(_0x3335a2,_0x179061){var _0x536050={},_0x5c9abc={},_0x46eebf={'count':0x0,'rows':[]};var _0x59e6cf=_[_0x087f('0x2b')](db[_0x087f('0x2c')]['rawAttributes'],function(_0x2e028b){return{'name':_0x2e028b['fieldName'],'type':_0x2e028b['type'][_0x087f('0x2d')]};});_0x5c9abc['model']=_[_0x087f('0x2b')](_0x59e6cf,_0x087f('0x28'));_0x5c9abc[_0x087f('0x2e')]=_['keys'](_0x3335a2[_0x087f('0x2e')]);_0x5c9abc[_0x087f('0x2f')]=_[_0x087f('0x30')](_0x5c9abc['model'],_0x5c9abc[_0x087f('0x2e')]);_0x536050[_0x087f('0x31')]=_[_0x087f('0x30')](_0x5c9abc[_0x087f('0x32')],qs[_0x087f('0x33')](_0x3335a2[_0x087f('0x2e')][_0x087f('0x33')]));_0x536050[_0x087f('0x31')]=_0x536050[_0x087f('0x31')][_0x087f('0x34')]?_0x536050['attributes']:_0x5c9abc[_0x087f('0x32')];if(!_0x3335a2[_0x087f('0x2e')][_0x087f('0x35')]('nolimit')){_0x536050[_0x087f('0x1e')]=qs[_0x087f('0x1e')](_0x3335a2['query'][_0x087f('0x1e')]);_0x536050[_0x087f('0x1d')]=qs[_0x087f('0x1d')](_0x3335a2[_0x087f('0x2e')][_0x087f('0x1d')]);}_0x536050[_0x087f('0x36')]=qs[_0x087f('0x37')](_0x3335a2['query'][_0x087f('0x37')]);_0x536050['where']=qs['filters'](_[_0x087f('0x38')](_0x3335a2['query'],_0x5c9abc['filters']),_0x59e6cf);if(_0x3335a2[_0x087f('0x2e')][_0x087f('0x39')]){_0x536050[_0x087f('0x3a')]=_[_0x087f('0x3b')](_0x536050[_0x087f('0x3a')],{'$or':_[_0x087f('0x2b')](_0x59e6cf,function(_0x15765b){if(_0x15765b['type']!==_0x087f('0x3c')){var _0x12d794={};_0x12d794[_0x15765b['name']]={'$like':'%'+_0x3335a2[_0x087f('0x2e')][_0x087f('0x39')]+'%'};return _0x12d794;}})});}_0x536050=_[_0x087f('0x3b')]({},_0x536050,_0x3335a2['options']);var _0x32b56b={'where':_0x536050['where']};return db[_0x087f('0x2c')][_0x087f('0x1c')](_0x32b56b)['then'](function(_0x5e35a7){_0x46eebf[_0x087f('0x1c')]=_0x5e35a7;if(_0x3335a2[_0x087f('0x2e')][_0x087f('0x3d')]){_0x536050['include']=[{'all':!![]}];}return db[_0x087f('0x2c')]['findAll'](_0x536050);})[_0x087f('0x23')](function(_0x289d4e){_0x46eebf['rows']=_0x289d4e;return _0x46eebf;})[_0x087f('0x23')](respondWithFilteredResult(_0x179061,_0x536050))[_0x087f('0x3e')](handleError(_0x179061,null));};exports[_0x087f('0x3f')]=function(_0x4bca1b,_0x25107e){var _0x29e987={'raw':!![],'where':{'id':_0x4bca1b[_0x087f('0x40')]['id']}},_0x380428={};_0x380428[_0x087f('0x32')]=_[_0x087f('0x41')](db[_0x087f('0x2c')][_0x087f('0x42')]);_0x380428[_0x087f('0x2e')]=_[_0x087f('0x41')](_0x4bca1b[_0x087f('0x2e')]);_0x380428[_0x087f('0x2f')]=_[_0x087f('0x30')](_0x380428['model'],_0x380428['query']);_0x29e987[_0x087f('0x31')]=_[_0x087f('0x30')](_0x380428[_0x087f('0x32')],qs[_0x087f('0x33')](_0x4bca1b[_0x087f('0x2e')][_0x087f('0x33')]));_0x29e987[_0x087f('0x31')]=_0x29e987[_0x087f('0x31')][_0x087f('0x34')]?_0x29e987[_0x087f('0x31')]:_0x380428[_0x087f('0x32')];if(_0x4bca1b['query'][_0x087f('0x3d')]){_0x29e987[_0x087f('0x43')]=[{'all':!![]}];}_0x29e987=_[_0x087f('0x3b')]({},_0x29e987,_0x4bca1b[_0x087f('0x44')]);return db['SmsQueue'][_0x087f('0x45')](_0x29e987)['then'](handleEntityNotFound(_0x25107e,null))[_0x087f('0x23')](respondWithResult(_0x25107e,null))[_0x087f('0x3e')](handleError(_0x25107e,null));};exports[_0x087f('0x46')]=function(_0x586cb7,_0x3d3c0e){return db[_0x087f('0x2c')]['create'](_0x586cb7[_0x087f('0x47')],{})['then'](function(_0xdc22c4){var _0x2a5e64=_0x586cb7['user'][_0x087f('0x25')]({'plain':!![]});if(!_0x2a5e64)throw new Error(_0x087f('0x48'));if(_0x2a5e64[_0x087f('0x49')]===_0x087f('0x4a')){var _0x24b9d0=_0xdc22c4[_0x087f('0x25')]({'plain':!![]});var _0x33850f=_0x087f('0x4b');return db[_0x087f('0x4c')][_0x087f('0x45')]({'where':{'name':_0x33850f,'userProfileId':_0x2a5e64['userProfileId']},'raw':!![]})['then'](function(_0x23598f){if(_0x23598f&&_0x23598f[_0x087f('0x4d')]===0x0){return db[_0x087f('0x26')][_0x087f('0x46')]({'name':_0x24b9d0[_0x087f('0x28')],'resourceId':_0x24b9d0['id'],'type':_0x23598f[_0x087f('0x28')],'sectionId':_0x23598f['id']},{})['then'](function(){return _0xdc22c4;});}else{return _0xdc22c4;}})['catch'](function(_0x2db26f){logger[_0x087f('0x27')](_0x087f('0x4e'),_0x2db26f);throw _0x2db26f;});}return _0xdc22c4;})['then'](respondWithResult(_0x3d3c0e,0xc9))[_0x087f('0x3e')](handleError(_0x3d3c0e,null));};exports[_0x087f('0x22')]=function(_0x23baec,_0xf88e6b){if(_0x23baec[_0x087f('0x47')]['id']){delete _0x23baec[_0x087f('0x47')]['id'];}return db['SmsQueue'][_0x087f('0x45')]({'where':{'id':_0x23baec['params']['id']}})['then'](handleEntityNotFound(_0xf88e6b,null))[_0x087f('0x23')](saveUpdates(_0x23baec[_0x087f('0x47')],null))[_0x087f('0x23')](respondWithResult(_0xf88e6b,null))['catch'](handleError(_0xf88e6b,null));};exports[_0x087f('0x24')]=function(_0x194860,_0x5b8855){return db['SmsQueue'][_0x087f('0x45')]({'where':{'id':_0x194860[_0x087f('0x40')]['id']}})[_0x087f('0x23')](handleEntityNotFound(_0x5b8855,null))['then'](removeEntity(_0x5b8855,null))[_0x087f('0x3e')](handleError(_0x5b8855,null));};exports[_0x087f('0x4f')]=function(_0x11ad50,_0xf64563){return db[_0x087f('0x2c')][_0x087f('0x4f')]()[_0x087f('0x23')](respondWithResult(_0xf64563,null))[_0x087f('0x3e')](handleError(_0xf64563,null));};exports['getMembers']=function(_0x283e31,_0x180644,_0x3d4dd2){var _0x4fa1a8={'raw':!![],'where':{}},_0x1c66a3={},_0x54f999;return db[_0x087f('0x2c')]['findOne']({'where':{'id':_0x283e31[_0x087f('0x40')]['id']}})['then'](handleEntityNotFound(_0x180644,null))[_0x087f('0x23')](function(_0x3f9840){if(_0x3f9840){_0x54f999=_0x3f9840[_0x087f('0x25')]({'plain':!![]});_0x1c66a3['model']=_[_0x087f('0x41')](db['UserSmsQueue'][_0x087f('0x42')]);_0x1c66a3[_0x087f('0x2e')]=_[_0x087f('0x41')](_0x283e31['query']);_0x1c66a3[_0x087f('0x2f')]=_[_0x087f('0x30')](_0x1c66a3[_0x087f('0x32')],_0x1c66a3[_0x087f('0x2e')]);_0x4fa1a8['attributes']=_['intersection'](_0x1c66a3['model'],qs[_0x087f('0x33')](_0x283e31['query'][_0x087f('0x33')]));_0x4fa1a8[_0x087f('0x31')]=_0x4fa1a8[_0x087f('0x31')][_0x087f('0x34')]?_0x4fa1a8['attributes']:_0x1c66a3[_0x087f('0x32')];if(!_0x283e31[_0x087f('0x2e')][_0x087f('0x35')](_0x087f('0x50'))){_0x4fa1a8[_0x087f('0x1e')]=qs[_0x087f('0x1e')](_0x283e31['query'][_0x087f('0x1e')]);_0x4fa1a8[_0x087f('0x1d')]=qs[_0x087f('0x1d')](_0x283e31[_0x087f('0x2e')][_0x087f('0x1d')]);}_0x4fa1a8[_0x087f('0x36')]=qs[_0x087f('0x37')](_0x283e31['query'][_0x087f('0x37')]);_0x4fa1a8[_0x087f('0x3a')]=qs[_0x087f('0x2f')](_[_0x087f('0x38')](_0x283e31[_0x087f('0x2e')],_0x1c66a3[_0x087f('0x2f')]));_0x4fa1a8[_0x087f('0x3a')][_0x087f('0x51')]=_0x3f9840['id'];if(_0x283e31[_0x087f('0x2e')][_0x087f('0x39')]){_0x4fa1a8['where']=_[_0x087f('0x3b')](_0x4fa1a8[_0x087f('0x3a')],{'$or':_[_0x087f('0x2b')](_0x4fa1a8[_0x087f('0x31')],function(_0x5f4eb5){var _0x238788={};_0x238788[_0x5f4eb5]={'$like':'%'+_0x283e31['query'][_0x087f('0x39')]+'%'};return _0x238788;})});}_0x4fa1a8=_[_0x087f('0x3b')]({},_0x4fa1a8,_0x283e31['options']);return db[_0x087f('0x52')][_0x087f('0x53')](_0x4fa1a8);}})[_0x087f('0x23')](function(_0x3acdd4){if(_0x3acdd4){return db['User']['findAndCountAll']({'where':{'id':_[_0x087f('0x2b')](_0x3acdd4,_0x087f('0x54')),'role':_0x087f('0x55')},'attributes':['id',_0x087f('0x28'),_0x087f('0x56'),'updatedAt',_0x087f('0x57')]});}})[_0x087f('0x23')](function(_0x515f00){if(_0x515f00){return{'count':_0x515f00['count'],'rows':_[_0x087f('0x2b')](_0x515f00[_0x087f('0x58')],function(_0x2aa722){return{'membername':_0x2aa722[_0x087f('0x28')],'UserId':_0x2aa722['id'],'queue_name':_0x54f999[_0x087f('0x28')],'SmsQueueId':_0x54f999['id'],'interface':util[_0x087f('0x59')]('%s/%s','SIP',_0x2aa722[_0x087f('0x28')]),'penalty':0x0,'paused':_0x2aa722['smsPause'],'createdAt':_0x2aa722[_0x087f('0x57')],'updatedAt':_0x2aa722[_0x087f('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x180644,_0x4fa1a8))[_0x087f('0x3e')](handleError(_0x180644,null));};exports['getTeams']=function(_0x4a371c,_0x27d959,_0xc20c45){var _0x595872={};var _0x1743e0={};var _0x282d29;var _0x325dea;return db[_0x087f('0x2c')]['findOne']({'where':{'id':_0x4a371c[_0x087f('0x40')]['id']}})['then'](handleEntityNotFound(_0x27d959,null))[_0x087f('0x23')](function(_0x41eb42){if(_0x41eb42){_0x282d29=_0x41eb42;_0x1743e0[_0x087f('0x32')]=_[_0x087f('0x41')](db[_0x087f('0x5b')][_0x087f('0x42')]);_0x1743e0[_0x087f('0x2e')]=_[_0x087f('0x41')](_0x4a371c[_0x087f('0x2e')]);_0x1743e0[_0x087f('0x2f')]=_['intersection'](_0x1743e0['model'],_0x1743e0['query']);_0x595872['attributes']=_['intersection'](_0x1743e0['model'],qs[_0x087f('0x33')](_0x4a371c['query']['fields']));_0x595872[_0x087f('0x31')]=_0x595872[_0x087f('0x31')]['length']?_0x595872[_0x087f('0x31')]:_0x1743e0[_0x087f('0x32')];_0x595872['order']=qs['sort'](_0x4a371c['query'][_0x087f('0x37')]);_0x595872[_0x087f('0x3a')]=qs[_0x087f('0x2f')](_['pick'](_0x4a371c['query'],_0x1743e0[_0x087f('0x2f')]));if(_0x4a371c[_0x087f('0x2e')]['filter']){_0x595872[_0x087f('0x3a')]=_[_0x087f('0x3b')](_0x595872[_0x087f('0x3a')],{'$or':_[_0x087f('0x2b')](_0x595872[_0x087f('0x31')],function(_0x39b3dc){var _0x452c68={};_0x452c68[_0x39b3dc]={'$like':'%'+_0x4a371c[_0x087f('0x2e')][_0x087f('0x39')]+'%'};return _0x452c68;})});}_0x595872=_[_0x087f('0x3b')]({},_0x595872,_0x4a371c[_0x087f('0x44')]);return _0x282d29[_0x087f('0x5c')](_0x595872);}})['then'](function(_0x31f86a){if(_0x31f86a){_0x325dea=_0x31f86a[_0x087f('0x34')];if(!_0x4a371c[_0x087f('0x2e')][_0x087f('0x35')](_0x087f('0x50'))){_0x595872[_0x087f('0x1e')]=qs[_0x087f('0x1e')](_0x4a371c['query']['limit']);_0x595872[_0x087f('0x1d')]=qs['offset'](_0x4a371c[_0x087f('0x2e')][_0x087f('0x1d')]);}return _0x282d29[_0x087f('0x5c')](_0x595872);}})[_0x087f('0x23')](function(_0x12432f){if(_0x12432f){return _0x12432f?{'count':_0x325dea,'rows':_0x12432f}:null;}})[_0x087f('0x23')](respondWithResult(_0x27d959,null))[_0x087f('0x3e')](handleError(_0x27d959,null));};exports[_0x087f('0x5d')]=function(_0x947140,_0x1ae272,_0x3265f7){var _0x3dd03e=_0x947140[_0x087f('0x47')][_0x087f('0x5e')];return db['Team'][_0x087f('0x53')]({'where':{'id':_0x3dd03e},'attributes':['id'],'include':[{'model':db[_0x087f('0x5f')],'as':_0x087f('0x60'),'attributes':['id',_0x087f('0x28'),_0x087f('0x61'),'voicePause',_0x087f('0x62')],'raw':!![]}]})[_0x087f('0x23')](function(_0x2cfa43){if(_0x2cfa43){var _0x4158a2=_[_0x087f('0x63')](_0x2cfa43,function(_0x52625b){var _0x1e3643=_0x52625b[_0x087f('0x25')]({'plain':!![]});return _0x1e3643[_0x087f('0x60')];});return db[_0x087f('0x2c')]['find']({'where':{'id':_0x947140[_0x087f('0x40')]['id']}})[_0x087f('0x23')](function(_0x214bbc){return db[_0x087f('0x64')][_0x087f('0x65')](function(_0x53b58a){return _0x214bbc[_0x087f('0x5d')](_0x3dd03e,{'transaction':_0x53b58a})[_0x087f('0x23')](function(){return BPromise[_0x087f('0x66')](_0x4158a2,function(_0x3f4801){return db[_0x087f('0x52')][_0x087f('0x67')]({'where':{'UserId':_0x3f4801['id'],'SmsQueueId':_0x947140['params']['id']},'transaction':_0x53b58a});});})[_0x087f('0x23')](function(){_0x4158a2['forEach'](function(_0x13867c){socket[_0x087f('0x68')](_0x087f('0x69'),{'UserId':_0x13867c['id'],'SmsQueueId':_0x214bbc['id']});});});});});}})['then'](respondWithStatusCode(_0x1ae272,null))[_0x087f('0x3e')](handleError(_0x1ae272,null));};exports[_0x087f('0x6a')]=function(_0x37387f,_0x16f4c2,_0x51f66c){return db['Team']['findAll']({'where':{'id':_0x37387f['query'][_0x087f('0x5e')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x087f('0x23')](handleEntityNotFound(_0x16f4c2,null))[_0x087f('0x23')](function(_0x1a9cbe){var _0x2ca234=_[_0x087f('0x2b')](_0x1a9cbe,'id');var _0x3bf1dd=[];var _0x281157=[];var _0xfbe64=squel[_0x087f('0x6b')]();_0xfbe64[_0x087f('0x6c')](_0x087f('0x6d'))['from'](_0x087f('0x6e'),'tq')[_0x087f('0x6f')](_0x087f('0x70'),'ut',_0x087f('0x71'))[_0x087f('0x3a')](_0x087f('0x72'),_0x37387f[_0x087f('0x40')]['id']);for(var _0x520693=0x0;_0x520693<_0x1a9cbe[_0x087f('0x34')];_0x520693+=0x1){let _0xb4bfed=_0x1a9cbe[_0x520693];for(var _0x4e17a4=0x0;_0x4e17a4<_0xb4bfed[_0x087f('0x60')]['length'];_0x4e17a4+=0x1){let _0x2fb541=_0xb4bfed[_0x087f('0x60')][_0x4e17a4];var _0x1cfb21=_0xfbe64[_0x087f('0x73')]();_0x1cfb21[_0x087f('0x3a')](_0x087f('0x74'),_0x2fb541['id']);_0x281157[_0x087f('0x75')](db[_0x087f('0x64')][_0x087f('0x2e')](_0x1cfb21[_0x087f('0x76')](),{'type':db['sequelize']['QueryTypes'][_0x087f('0x77')]})[_0x087f('0x23')](function(_0xdd04af){if(_0xdd04af[_0x087f('0x34')]===0x1){return _0x2fb541['id'];}else{var _0x5774ab=_['every'](_[_0x087f('0x2b')](_0xdd04af,_0x087f('0x78')),function(_0x3f57b9){return _[_0x087f('0x79')](_0x2ca234,_0x3f57b9);});if(_0x5774ab){return _0x2fb541['id'];}}}));}}return BPromise[_0x087f('0x7a')](_0x281157)[_0x087f('0x23')](function(_0x137d57){_0x3bf1dd=_(_0x3bf1dd)[_0x087f('0x7b')](_0x137d57)['compact']()[_0x087f('0x7c')]();return db[_0x087f('0x2c')]['find']({'where':{'id':_0x37387f[_0x087f('0x40')]['id']}})[_0x087f('0x23')](function(_0x28c2ab){return db[_0x087f('0x64')]['transaction'](function(_0x54ab6f){return _0x28c2ab[_0x087f('0x6a')](_0x37387f[_0x087f('0x2e')]['ids'],{'transaction':_0x54ab6f})[_0x087f('0x23')](function(){if(!_[_0x087f('0x7d')](_0x3bf1dd)){return _0x28c2ab[_0x087f('0x7e')](_0x3bf1dd,{'transaction':_0x54ab6f});}})[_0x087f('0x23')](function(){_0x3bf1dd[_0x087f('0x7f')](function(_0x5b758c){socket['emit'](_0x087f('0x80'),{'UserId':_0x5b758c,'SmsQueueId':_0x28c2ab['id']});});});});});});})[_0x087f('0x23')](respondWithStatusCode(_0x16f4c2,null))[_0x087f('0x3e')](handleError(_0x16f4c2,null));};exports[_0x087f('0x81')]=function(_0x1812ea,_0x7a4f90,_0x57c2de){return db[_0x087f('0x2c')]['find']({'where':{'id':_0x1812ea[_0x087f('0x40')]['id']}})[_0x087f('0x23')](handleEntityNotFound(_0x7a4f90,null))[_0x087f('0x23')](function(_0xfd55a7){if(_0xfd55a7){return _0xfd55a7['addAgents'](_0x1812ea[_0x087f('0x47')]['ids'],_[_0x087f('0x82')](_0x1812ea['body'],[_0x087f('0x5e'),'id'])||{})['spread'](function(_0x235c9f){for(var _0xb1603c=0x0;_0xb1603c<_0x1812ea[_0x087f('0x47')]['ids'][_0x087f('0x34')];_0xb1603c+=0x1){socket['emit'](_0x087f('0x69'),{'UserId':_0x1812ea[_0x087f('0x47')][_0x087f('0x5e')][_0xb1603c],'SmsQueueId':_0x1812ea[_0x087f('0x40')]['id']});}return _0x235c9f;});}})[_0x087f('0x23')](respondWithResult(_0x7a4f90,null))[_0x087f('0x3e')](handleError(_0x7a4f90,null));};exports[_0x087f('0x7e')]=function(_0x2e1969,_0x39fe2b,_0x559afc){return db['SmsQueue'][_0x087f('0x45')]({'where':{'id':_0x2e1969[_0x087f('0x40')]['id']}})[_0x087f('0x23')](handleEntityNotFound(_0x39fe2b,null))['then'](function(_0x14f33e){if(_0x14f33e){return _0x14f33e[_0x087f('0x7e')](_0x2e1969[_0x087f('0x2e')][_0x087f('0x5e')])[_0x087f('0x23')](function(){if(_[_0x087f('0x83')](_0x2e1969[_0x087f('0x2e')]['ids'])){for(var _0x1faa77=0x0;_0x1faa77<_0x2e1969[_0x087f('0x2e')][_0x087f('0x5e')][_0x087f('0x34')];_0x1faa77+=0x1){socket[_0x087f('0x68')](_0x087f('0x80'),{'UserId':Number(_0x2e1969[_0x087f('0x2e')][_0x087f('0x5e')][_0x1faa77]),'SmsQueueId':Number(_0x2e1969[_0x087f('0x40')]['id'])});}}else{socket[_0x087f('0x68')](_0x087f('0x80'),{'UserId':Number(_0x2e1969[_0x087f('0x2e')][_0x087f('0x5e')]),'SmsQueueId':Number(_0x2e1969[_0x087f('0x40')]['id'])});}});}})[_0x087f('0x23')](respondWithStatusCode(_0x39fe2b,null))[_0x087f('0x3e')](handleError(_0x39fe2b,null));};exports['getAgents']=function(_0x546d3a,_0x332001,_0x2370a2){var _0x71f8cb={};var _0x651846={};var _0x4f3c4d;var _0x2e067d;return db['SmsQueue'][_0x087f('0x84')]({'where':{'id':_0x546d3a[_0x087f('0x40')]['id']}})[_0x087f('0x23')](handleEntityNotFound(_0x332001,null))[_0x087f('0x23')](function(_0x40bda9){if(_0x40bda9){_0x4f3c4d=_0x40bda9;_0x651846['model']=_[_0x087f('0x41')](db[_0x087f('0x5f')][_0x087f('0x42')]);_0x651846[_0x087f('0x2e')]=_[_0x087f('0x41')](_0x546d3a[_0x087f('0x2e')]);_0x651846[_0x087f('0x2f')]=_[_0x087f('0x30')](_0x651846[_0x087f('0x32')],_0x651846[_0x087f('0x2e')]);_0x71f8cb[_0x087f('0x31')]=_[_0x087f('0x30')](_0x651846['model'],qs[_0x087f('0x33')](_0x546d3a[_0x087f('0x2e')][_0x087f('0x33')]));_0x71f8cb[_0x087f('0x31')]=_0x71f8cb[_0x087f('0x31')][_0x087f('0x34')]?_0x71f8cb[_0x087f('0x31')]:_0x651846[_0x087f('0x32')];_0x71f8cb[_0x087f('0x36')]=qs[_0x087f('0x37')](_0x546d3a[_0x087f('0x2e')][_0x087f('0x37')]);_0x71f8cb[_0x087f('0x3a')]=qs[_0x087f('0x2f')](_[_0x087f('0x38')](_0x546d3a['query'],_0x651846[_0x087f('0x2f')]));if(_0x546d3a[_0x087f('0x2e')][_0x087f('0x39')]){_0x71f8cb['where']=_['merge'](_0x71f8cb[_0x087f('0x3a')],{'$or':_[_0x087f('0x2b')](_0x71f8cb[_0x087f('0x31')],function(_0x5cbbb7){var _0x10ded0={};_0x10ded0[_0x5cbbb7]={'$like':'%'+_0x546d3a[_0x087f('0x2e')][_0x087f('0x39')]+'%'};return _0x10ded0;})});}_0x71f8cb=_[_0x087f('0x3b')]({},_0x71f8cb,_0x546d3a[_0x087f('0x44')]);return _0x4f3c4d[_0x087f('0x85')](_0x71f8cb);}})['then'](function(_0x31ee33){if(_0x31ee33){_0x2e067d=_0x31ee33['length'];if(!_0x546d3a[_0x087f('0x2e')]['hasOwnProperty'](_0x087f('0x50'))){_0x71f8cb[_0x087f('0x1e')]=qs['limit'](_0x546d3a[_0x087f('0x2e')][_0x087f('0x1e')]);_0x71f8cb[_0x087f('0x1d')]=qs[_0x087f('0x1d')](_0x546d3a[_0x087f('0x2e')][_0x087f('0x1d')]);}return _0x4f3c4d[_0x087f('0x85')](_0x71f8cb);}})['then'](function(_0x20ec46){if(_0x20ec46){return _0x20ec46?{'count':_0x2e067d,'rows':_0x20ec46}:null;}})[_0x087f('0x23')](respondWithResult(_0x332001,null))['catch'](handleError(_0x332001,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 371f80d..7a1b5b6 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 _0xe36f=['exports','events','../../mysqldb','setMaxListeners','update','emit','hook'];(function(_0x5b57fd,_0x1df2b3){var _0x1a0b50=function(_0x3b2252){while(--_0x3b2252){_0x5b57fd['push'](_0x5b57fd['shift']());}};_0x1a0b50(++_0x1df2b3);}(_0xe36f,0x189));var _0xfe36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe36f[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xfe36('0x0'));var SmsQueue=require(_0xfe36('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfe36('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe36('0x3'),'afterDestroy':'remove'};function emitEvent(_0x44adf0){return function(_0x52a70f,_0xaf0692,_0x10a708){SmsQueueEvents[_0xfe36('0x4')](_0x44adf0+':'+_0x52a70f['id'],_0x52a70f);SmsQueueEvents['emit'](_0x44adf0,_0x52a70f);_0x10a708(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xfe36('0x5')](e,emitEvent(event));}}module[_0xfe36('0x6')]=SmsQueueEvents; \ No newline at end of file +var _0x06a0=['exports','events','SmsQueue','update','remove','emit','hasOwnProperty','hook'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0x06a0,0x1e1));var _0x006a=function(_0x3e2435,_0xc531a1){_0x3e2435=_0x3e2435-0x0;var _0x5d49e7=_0x06a0[_0x3e2435];return _0x5d49e7;};'use strict';var EventEmitter=require(_0x006a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x006a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x006a('0x2'),'afterDestroy':_0x006a('0x3')};function emitEvent(_0x31c7e5){return function(_0x5f1afd,_0x4d2c1a,_0x3bb2a1){SmsQueueEvents[_0x006a('0x4')](_0x31c7e5+':'+_0x5f1afd['id'],_0x5f1afd);SmsQueueEvents[_0x006a('0x4')](_0x31c7e5,_0x5f1afd);_0x3bb2a1(null);};}for(var e in events){if(events[_0x006a('0x5')](e)){var event=events[e];SmsQueue[_0x006a('0x6')](e,emitEvent(event));}}module[_0x006a('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 3dbc164..0eb5ce3 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 _0x98d3=['SmsQueue','sms_queues','lodash','util','api','bluebird','path','rimraf','exports'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x98d3,0x173));var _0x398d=function(_0x1534e2,_0x7246da){_0x1534e2=_0x1534e2-0x0;var _0x15899c=_0x98d3[_0x1534e2];return _0x15899c;};'use strict';var _=require(_0x398d('0x0'));var util=require(_0x398d('0x1'));var logger=require('../../config/logger')(_0x398d('0x2'));var moment=require('moment');var BPromise=require(_0x398d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x398d('0x4'));var rimraf=require(_0x398d('0x5'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x398d('0x6')]=function(_0x25d38f,_0x2c3c4c){return _0x25d38f['define'](_0x398d('0x7'),attributes,{'tableName':_0x398d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb377=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x5c0cf4,_0x265aa9){var _0x3d9f50=function(_0x10f73d){while(--_0x10f73d){_0x5c0cf4['push'](_0x5c0cf4['shift']());}};_0x3d9f50(++_0x265aa9);}(_0xb377,0x1b6));var _0x7b37=function(_0x20ce02,_0x302a4b){_0x20ce02=_0x20ce02-0x0;var _0x2b78af=_0xb377[_0x20ce02];return _0x2b78af;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var logger=require(_0x7b37('0x2'))(_0x7b37('0x3'));var moment=require(_0x7b37('0x4'));var BPromise=require(_0x7b37('0x5'));var rp=require(_0x7b37('0x6'));var fs=require('fs');var path=require(_0x7b37('0x7'));var rimraf=require(_0x7b37('0x8'));var config=require(_0x7b37('0x9'));var attributes=require(_0x7b37('0xa'));module[_0x7b37('0xb')]=function(_0x58edf9,_0x516b62){return _0x58edf9[_0x7b37('0xc')]('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index f9a9937..422407b 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 _0xd073=['map','debug','find','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit','include','model'];(function(_0x8cc01e,_0xf8befa){var _0x53f8a0=function(_0xa8b4e){while(--_0xa8b4e){_0x8cc01e['push'](_0x8cc01e['shift']());}};_0x53f8a0(++_0xf8befa);}(_0xd073,0xcc));var _0x3d07=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd073[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3d07('0x0'));var util=require(_0x3d07('0x1'));var moment=require(_0x3d07('0x2'));var BPromise=require(_0x3d07('0x3'));var rs=require(_0x3d07('0x4'));var fs=require('fs');var Redis=require(_0x3d07('0x5'));var db=require(_0x3d07('0x6'))['db'];var utils=require(_0x3d07('0x7'));var logger=require(_0x3d07('0x8'))(_0x3d07('0x9'));var config=require('../../config/environment');var jayson=require(_0x3d07('0xa'));var client=jayson[_0x3d07('0xb')][_0x3d07('0xc')]({'port':0x232a});config[_0x3d07('0xd')]=_['defaults'](config[_0x3d07('0xd')],{'host':_0x3d07('0xe'),'port':0x18eb});var socket=require(_0x3d07('0xf'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x3d07('0x10')](socket);function respondWithRpcPromise(_0xe851a0,_0x3bec71,_0x5dad42){return new BPromise(function(_0x5c50a4,_0x1c2863){return client['request'](_0xe851a0,_0x5dad42)[_0x3d07('0x11')](function(_0x47907a){logger['info'](_0x3d07('0x12'),_0x3bec71,_0x3d07('0x13'));logger['debug'](_0x3d07('0x14'),_0x3bec71,'request\x20sent',JSON[_0x3d07('0x15')](_0x47907a));if(_0x47907a[_0x3d07('0x16')]){if(_0x47907a[_0x3d07('0x16')]['code']===0x1f4){logger['error'](_0x3d07('0x12'),_0x3bec71,_0x47907a[_0x3d07('0x16')]['message']);return _0x1c2863(_0x47907a['error'][_0x3d07('0x17')]);}logger[_0x3d07('0x16')](_0x3d07('0x12'),_0x3bec71,_0x47907a[_0x3d07('0x16')][_0x3d07('0x17')]);return _0x5c50a4(_0x47907a['error'][_0x3d07('0x17')]);}else{logger[_0x3d07('0x18')](_0x3d07('0x12'),_0x3bec71,_0x3d07('0x13'));_0x5c50a4(_0x47907a['result'][_0x3d07('0x17')]);}})[_0x3d07('0x19')](function(_0x4f6dd6){logger[_0x3d07('0x16')]('SmsQueue,\x20%s,\x20%s',_0x3bec71,_0x4f6dd6);_0x1c2863(_0x4f6dd6);});});}exports[_0x3d07('0x1a')]=function(_0x1786c7){var _0x349f87=this;return new Promise(function(_0x2006d4,_0x405fa5){return db[_0x3d07('0x1b')][_0x3d07('0x1c')]({'raw':_0x1786c7[_0x3d07('0x1d')]?_0x1786c7[_0x3d07('0x1d')][_0x3d07('0x1e')]===undefined?!![]:![]:!![],'where':_0x1786c7[_0x3d07('0x1d')]?_0x1786c7[_0x3d07('0x1d')][_0x3d07('0x1f')]||null:null,'attributes':_0x1786c7[_0x3d07('0x1d')]?_0x1786c7[_0x3d07('0x1d')][_0x3d07('0x20')]||null:null,'limit':_0x1786c7[_0x3d07('0x1d')]?_0x1786c7[_0x3d07('0x1d')][_0x3d07('0x21')]||null:null,'include':_0x1786c7[_0x3d07('0x1d')]?_0x1786c7[_0x3d07('0x1d')][_0x3d07('0x22')]?_['map'](_0x1786c7['options']['include'],function(_0x1d16bd){return{'model':db[_0x1d16bd[_0x3d07('0x23')]],'as':_0x1d16bd['as'],'attributes':_0x1d16bd[_0x3d07('0x20')],'include':_0x1d16bd[_0x3d07('0x22')]?_[_0x3d07('0x24')](_0x1d16bd[_0x3d07('0x22')],function(_0x564ac6){return{'model':db[_0x564ac6['model']],'as':_0x564ac6['as'],'attributes':_0x564ac6[_0x3d07('0x20')],'include':_0x564ac6[_0x3d07('0x22')]?_['map'](_0x564ac6['include'],function(_0x61091b){return{'model':db[_0x61091b[_0x3d07('0x23')]],'as':_0x61091b['as'],'attributes':_0x61091b[_0x3d07('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3d07('0x11')](function(_0x2c2972){logger['info'](_0x3d07('0x1a'),_0x1786c7);logger[_0x3d07('0x25')](_0x3d07('0x1a'),_0x1786c7,JSON[_0x3d07('0x15')](_0x2c2972));_0x2006d4(_0x2c2972);})[_0x3d07('0x19')](function(_0x3d7381){logger[_0x3d07('0x16')](_0x3d07('0x1a'),_0x3d7381[_0x3d07('0x17')],_0x1786c7);_0x405fa5(_0x349f87[_0x3d07('0x16')](0x1f4,_0x3d7381[_0x3d07('0x17')]));});});};exports['ShowSmsQueue']=function(_0x3eaf72){var _0x86720a=this;return new Promise(function(_0x506eb1,_0x206b88){return db[_0x3d07('0x1b')][_0x3d07('0x26')]({'raw':_0x3eaf72[_0x3d07('0x1d')]?_0x3eaf72[_0x3d07('0x1d')][_0x3d07('0x1e')]===undefined?!![]:![]:!![],'where':_0x3eaf72[_0x3d07('0x1d')]?_0x3eaf72[_0x3d07('0x1d')][_0x3d07('0x1f')]||null:null,'attributes':_0x3eaf72['options']?_0x3eaf72[_0x3d07('0x1d')]['attributes']||null:null,'include':_0x3eaf72[_0x3d07('0x1d')]?_0x3eaf72['options'][_0x3d07('0x22')]?_[_0x3d07('0x24')](_0x3eaf72['options'][_0x3d07('0x22')],function(_0x48eb13){return{'model':db[_0x48eb13[_0x3d07('0x23')]],'as':_0x48eb13['as'],'attributes':_0x48eb13[_0x3d07('0x20')],'include':_0x48eb13['include']?_[_0x3d07('0x24')](_0x48eb13[_0x3d07('0x22')],function(_0x525fae){return{'model':db[_0x525fae[_0x3d07('0x23')]],'as':_0x525fae['as'],'attributes':_0x525fae['attributes'],'include':_0x525fae[_0x3d07('0x22')]?_[_0x3d07('0x24')](_0x525fae['include'],function(_0x594bdf){return{'model':db[_0x594bdf['model']],'as':_0x594bdf['as'],'attributes':_0x594bdf[_0x3d07('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3d07('0x11')](function(_0x15e863){logger[_0x3d07('0x18')](_0x3d07('0x27'),_0x3eaf72);logger[_0x3d07('0x25')](_0x3d07('0x27'),_0x3eaf72,JSON[_0x3d07('0x15')](_0x15e863));_0x506eb1(_0x15e863);})[_0x3d07('0x19')](function(_0x366fb9){logger[_0x3d07('0x16')](_0x3d07('0x27'),_0x366fb9[_0x3d07('0x17')],_0x3eaf72);_0x206b88(_0x86720a[_0x3d07('0x16')](0x1f4,_0x366fb9[_0x3d07('0x17')]));});});}; \ No newline at end of file +var _0x97a3=['attributes','stringify','ShowSmsQueue','find','raw','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','GetSmsQueue','findAll','options','where','limit','map','include','model'];(function(_0x525534,_0x5eccfe){var _0x55e231=function(_0x2ae8fb){while(--_0x2ae8fb){_0x525534['push'](_0x525534['shift']());}};_0x55e231(++_0x5eccfe);}(_0x97a3,0x1be));var _0x397a=function(_0x324700,_0x4bccb9){_0x324700=_0x324700-0x0;var _0x35ad72=_0x97a3[_0x324700];return _0x35ad72;};'use strict';var _=require(_0x397a('0x0'));var util=require('util');var moment=require(_0x397a('0x1'));var BPromise=require('bluebird');var rs=require(_0x397a('0x2'));var fs=require('fs');var Redis=require(_0x397a('0x3'));var db=require(_0x397a('0x4'))['db'];var utils=require(_0x397a('0x5'));var logger=require('../../config/logger')(_0x397a('0x6'));var config=require(_0x397a('0x7'));var jayson=require(_0x397a('0x8'));var client=jayson[_0x397a('0x9')][_0x397a('0xa')]({'port':0x232a});config[_0x397a('0xb')]=_['defaults'](config[_0x397a('0xb')],{'host':_0x397a('0xc'),'port':0x18eb});var socket=require(_0x397a('0xd'))(new Redis(config[_0x397a('0xb')]));require(_0x397a('0xe'))[_0x397a('0xf')](socket);function respondWithRpcPromise(_0x5f4c5f,_0x57c4de,_0x1eef32){return new BPromise(function(_0x425835,_0x2595ee){return client[_0x397a('0x10')](_0x5f4c5f,_0x1eef32)[_0x397a('0x11')](function(_0x4a3c39){logger['info'](_0x397a('0x12'),_0x57c4de,_0x397a('0x13'));logger[_0x397a('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x57c4de,_0x397a('0x13'),JSON['stringify'](_0x4a3c39));if(_0x4a3c39['error']){if(_0x4a3c39[_0x397a('0x15')][_0x397a('0x16')]===0x1f4){logger['error'](_0x397a('0x12'),_0x57c4de,_0x4a3c39[_0x397a('0x15')][_0x397a('0x17')]);return _0x2595ee(_0x4a3c39[_0x397a('0x15')][_0x397a('0x17')]);}logger[_0x397a('0x15')](_0x397a('0x12'),_0x57c4de,_0x4a3c39['error'][_0x397a('0x17')]);return _0x425835(_0x4a3c39[_0x397a('0x15')][_0x397a('0x17')]);}else{logger[_0x397a('0x18')](_0x397a('0x12'),_0x57c4de,'request\x20sent');_0x425835(_0x4a3c39[_0x397a('0x19')][_0x397a('0x17')]);}})['catch'](function(_0x474e44){logger[_0x397a('0x15')](_0x397a('0x12'),_0x57c4de,_0x474e44);_0x2595ee(_0x474e44);});});}exports[_0x397a('0x1a')]=function(_0x42a855){var _0x170399=this;return new Promise(function(_0x10d4bf,_0x12aa04){return db['SmsQueue'][_0x397a('0x1b')]({'raw':_0x42a855['options']?_0x42a855['options']['raw']===undefined?!![]:![]:!![],'where':_0x42a855[_0x397a('0x1c')]?_0x42a855[_0x397a('0x1c')][_0x397a('0x1d')]||null:null,'attributes':_0x42a855[_0x397a('0x1c')]?_0x42a855[_0x397a('0x1c')]['attributes']||null:null,'limit':_0x42a855[_0x397a('0x1c')]?_0x42a855['options'][_0x397a('0x1e')]||null:null,'include':_0x42a855[_0x397a('0x1c')]?_0x42a855[_0x397a('0x1c')]['include']?_[_0x397a('0x1f')](_0x42a855[_0x397a('0x1c')][_0x397a('0x20')],function(_0x52c9d2){return{'model':db[_0x52c9d2[_0x397a('0x21')]],'as':_0x52c9d2['as'],'attributes':_0x52c9d2[_0x397a('0x22')],'include':_0x52c9d2[_0x397a('0x20')]?_[_0x397a('0x1f')](_0x52c9d2[_0x397a('0x20')],function(_0x53ce6a){return{'model':db[_0x53ce6a['model']],'as':_0x53ce6a['as'],'attributes':_0x53ce6a[_0x397a('0x22')],'include':_0x53ce6a[_0x397a('0x20')]?_[_0x397a('0x1f')](_0x53ce6a[_0x397a('0x20')],function(_0x54f42d){return{'model':db[_0x54f42d[_0x397a('0x21')]],'as':_0x54f42d['as'],'attributes':_0x54f42d[_0x397a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x397a('0x11')](function(_0x20f048){logger[_0x397a('0x18')](_0x397a('0x1a'),_0x42a855);logger[_0x397a('0x14')](_0x397a('0x1a'),_0x42a855,JSON[_0x397a('0x23')](_0x20f048));_0x10d4bf(_0x20f048);})['catch'](function(_0x2e5eeb){logger['error'](_0x397a('0x1a'),_0x2e5eeb[_0x397a('0x17')],_0x42a855);_0x12aa04(_0x170399[_0x397a('0x15')](0x1f4,_0x2e5eeb[_0x397a('0x17')]));});});};exports[_0x397a('0x24')]=function(_0x18a1e7){var _0xe694b8=this;return new Promise(function(_0x2cff13,_0x194cc1){return db['SmsQueue'][_0x397a('0x25')]({'raw':_0x18a1e7[_0x397a('0x1c')]?_0x18a1e7[_0x397a('0x1c')][_0x397a('0x26')]===undefined?!![]:![]:!![],'where':_0x18a1e7['options']?_0x18a1e7['options'][_0x397a('0x1d')]||null:null,'attributes':_0x18a1e7[_0x397a('0x1c')]?_0x18a1e7[_0x397a('0x1c')][_0x397a('0x22')]||null:null,'include':_0x18a1e7['options']?_0x18a1e7[_0x397a('0x1c')][_0x397a('0x20')]?_['map'](_0x18a1e7[_0x397a('0x1c')]['include'],function(_0x53193f){return{'model':db[_0x53193f[_0x397a('0x21')]],'as':_0x53193f['as'],'attributes':_0x53193f[_0x397a('0x22')],'include':_0x53193f[_0x397a('0x20')]?_['map'](_0x53193f[_0x397a('0x20')],function(_0x2db7a0){return{'model':db[_0x2db7a0['model']],'as':_0x2db7a0['as'],'attributes':_0x2db7a0[_0x397a('0x22')],'include':_0x2db7a0['include']?_['map'](_0x2db7a0[_0x397a('0x20')],function(_0x2ef4ed){return{'model':db[_0x2ef4ed[_0x397a('0x21')]],'as':_0x2ef4ed['as'],'attributes':_0x2ef4ed[_0x397a('0x22')]};}):[]};}):[]};}):[]:[]})[_0x397a('0x11')](function(_0x34d1e6){logger[_0x397a('0x18')](_0x397a('0x24'),_0x18a1e7);logger[_0x397a('0x14')](_0x397a('0x24'),_0x18a1e7,JSON[_0x397a('0x23')](_0x34d1e6));_0x2cff13(_0x34d1e6);})[_0x397a('0x27')](function(_0x51acad){logger['error'](_0x397a('0x24'),_0x51acad[_0x397a('0x17')],_0x18a1e7);_0x194cc1(_0xe694b8[_0x397a('0x15')](0x1f4,_0x51acad[_0x397a('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 68faef9..8005509 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 _0x01dc=['remove','update','emit','removeListener','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x1673fa,_0x4a9399){var _0x369782=function(_0x3eff9a){while(--_0x3eff9a){_0x1673fa['push'](_0x1673fa['shift']());}};_0x369782(++_0x4a9399);}(_0x01dc,0xd6));var _0xc01d=function(_0x2327dd,_0x18e1c7){_0x2327dd=_0x2327dd-0x0;var _0x36b8af=_0x01dc[_0x2327dd];return _0x36b8af;};'use strict';var SmsQueueEvents=require(_0xc01d('0x0'));var events=[_0xc01d('0x1'),_0xc01d('0x2'),_0xc01d('0x3')];function createListener(_0xc05920,_0x431b95){return function(_0x2c6d35){_0x431b95[_0xc01d('0x4')](_0xc05920,_0x2c6d35);};}function removeListener(_0x3c4ced,_0x38e596){return function(){SmsQueueEvents[_0xc01d('0x5')](_0x3c4ced,_0x38e596);};}exports[_0xc01d('0x6')]=function(_0x196262){for(var _0x17ed10=0x0,_0x2b9a09=events[_0xc01d('0x7')];_0x17ed10<_0x2b9a09;_0x17ed10++){var _0x1d21eb=events[_0x17ed10];var _0x3ca84b=createListener(_0xc01d('0x8')+_0x1d21eb,_0x196262);SmsQueueEvents['on'](_0x1d21eb,_0x3ca84b);}}; \ No newline at end of file +var _0xc6b2=['update','emit','removeListener','register','smsQueue:','./smsQueue.events','save','remove'];(function(_0x17f85f,_0x5c6ff9){var _0x38100a=function(_0x1dca1f){while(--_0x1dca1f){_0x17f85f['push'](_0x17f85f['shift']());}};_0x38100a(++_0x5c6ff9);}(_0xc6b2,0x10d));var _0x2c6b=function(_0x3edc24,_0x35775a){_0x3edc24=_0x3edc24-0x0;var _0x253a3b=_0xc6b2[_0x3edc24];return _0x253a3b;};'use strict';var SmsQueueEvents=require(_0x2c6b('0x0'));var events=[_0x2c6b('0x1'),_0x2c6b('0x2'),_0x2c6b('0x3')];function createListener(_0xafa45c,_0x44af63){return function(_0x51eb14){_0x44af63[_0x2c6b('0x4')](_0xafa45c,_0x51eb14);};}function removeListener(_0x3f65aa,_0x28af4f){return function(){SmsQueueEvents[_0x2c6b('0x5')](_0x3f65aa,_0x28af4f);};}exports[_0x2c6b('0x6')]=function(_0x3aa3a6){for(var _0x564118=0x0,_0x255914=events['length'];_0x564118<_0x255914;_0x564118++){var _0x3d06cb=events[_0x564118];var _0x5005a1=createListener(_0x2c6b('0x7')+_0x3d06cb,_0x3aa3a6);SmsQueueEvents['on'](_0x3d06cb,_0x5005a1);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 58944fc..5b3143c 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 _0x9fdf=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update'];(function(_0x146295,_0x537d9c){var _0x4ce9bd=function(_0x480c88){while(--_0x480c88){_0x146295['push'](_0x146295['shift']());}};_0x4ce9bd(++_0x537d9c);}(_0x9fdf,0x157));var _0xf9fd=function(_0x14b888,_0x18999b){_0x14b888=_0x14b888-0x0;var _0x2bbe6f=_0x9fdf[_0x14b888];return _0x2bbe6f;};'use strict';var multer=require('multer');var util=require(_0xf9fd('0x0'));var path=require(_0xf9fd('0x1'));var timeout=require(_0xf9fd('0x2'));var express=require(_0xf9fd('0x3'));var router=express['Router']();var auth=require(_0xf9fd('0x4'));var interaction=require(_0xf9fd('0x5'));var config=require(_0xf9fd('0x6'));var controller=require(_0xf9fd('0x7'));router[_0xf9fd('0x8')]('/',auth[_0xf9fd('0x9')](),controller[_0xf9fd('0xa')]);router['get']('/describe',auth[_0xf9fd('0x9')](),controller[_0xf9fd('0xb')]);router['get'](_0xf9fd('0xc'),auth[_0xf9fd('0x9')](),controller['show']);router[_0xf9fd('0xd')]('/',auth[_0xf9fd('0x9')](),controller[_0xf9fd('0xe')]);router[_0xf9fd('0xf')](_0xf9fd('0xc'),auth[_0xf9fd('0x9')](),controller[_0xf9fd('0x10')]);router[_0xf9fd('0x11')](_0xf9fd('0xc'),auth['isAuthenticated'](),controller[_0xf9fd('0x12')]);module[_0xf9fd('0x13')]=router; \ No newline at end of file +var _0x7002=['exports','multer','util','path','express','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','/describe','isAuthenticated','describe','show','put','/:id','update'];(function(_0x4df1f5,_0x39c6d2){var _0x56585b=function(_0x287b6e){while(--_0x287b6e){_0x4df1f5['push'](_0x4df1f5['shift']());}};_0x56585b(++_0x39c6d2);}(_0x7002,0x121));var _0x2700=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x7002[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0x2700('0x0'));var util=require(_0x2700('0x1'));var path=require(_0x2700('0x2'));var timeout=require('connect-timeout');var express=require(_0x2700('0x3'));var router=express['Router']();var auth=require(_0x2700('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2700('0x5'));var controller=require(_0x2700('0x6'));router[_0x2700('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2700('0x7')](_0x2700('0x8'),auth[_0x2700('0x9')](),controller[_0x2700('0xa')]);router[_0x2700('0x7')]('/:id',auth[_0x2700('0x9')](),controller[_0x2700('0xb')]);router['post']('/',auth[_0x2700('0x9')](),controller['create']);router[_0x2700('0xc')](_0x2700('0xd'),auth[_0x2700('0x9')](),controller[_0x2700('0xe')]);router['delete'](_0x2700('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x2700('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b2731fd..1eb6b68 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 _0xb009=['STRING','DATE','moment','sequelize'];(function(_0x35515f,_0x9f5a2c){var _0x2f9807=function(_0x3a43ae){while(--_0x3a43ae){_0x35515f['push'](_0x35515f['shift']());}};_0x2f9807(++_0x9f5a2c);}(_0xb009,0x11a));var _0x9b00=function(_0x402d00,_0x46761f){_0x402d00=_0x402d00-0x0;var _0x23df42=_0xb009[_0x402d00];return _0x23df42;};'use strict';var moment=require(_0x9b00('0x0'));var Sequelize=require(_0x9b00('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9b00('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9b00('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9b00('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9b00('0x3')]},'reason':{'type':Sequelize[_0x9b00('0x2')]}}; \ No newline at end of file +var _0x4f41=['moment','sequelize','STRING','DATE'];(function(_0xdc8af2,_0x513455){var _0x1e2c15=function(_0x4f8397){while(--_0x4f8397){_0xdc8af2['push'](_0xdc8af2['shift']());}};_0x1e2c15(++_0x513455);}(_0x4f41,0x1c8));var _0x14f4=function(_0x26297c,_0x25e593){_0x26297c=_0x26297c-0x0;var _0x47c4c1=_0x4f41[_0x26297c];return _0x47c4c1;};'use strict';var moment=require(_0x14f4('0x0'));var Sequelize=require(_0x14f4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x14f4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x14f4('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x14f4('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x14f4('0x3')]},'reason':{'type':Sequelize[_0x14f4('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 5f02fa2..56e0424 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 _0x3e74=['save','update','then','destroy','stack','name','send','index','map','SmsQueueReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','limit','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','count','offset','status','set','Content-Range','json','apply','reject'];(function(_0x560b54,_0x3fec6f){var _0x578669=function(_0x58a1c3){while(--_0x58a1c3){_0x560b54['push'](_0x560b54['shift']());}};_0x578669(++_0x3fec6f);}(_0x3e74,0x175));var _0x43e7=function(_0x4423db,_0x205589){_0x4423db=_0x4423db-0x0;var _0x5b5a4f=_0x3e74[_0x4423db];return _0x5b5a4f;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb206,_0xc960ea){_0xc960ea=_0xc960ea||0xcc;return function(_0x2718d3){if(_0x2718d3){return _0x3eb206[_0x43e7('0x14')](_0xc960ea);}return _0x3eb206['status'](_0xc960ea)['end']();};}function respondWithResult(_0x2fcb36,_0x21fdd3){_0x21fdd3=_0x21fdd3||0xc8;return function(_0x44b0bd){if(_0x44b0bd){return _0x2fcb36['status'](_0x21fdd3)['json'](_0x44b0bd);}};}function respondWithFilteredResult(_0x16849c,_0x14c146){return function(_0x203378){if(_0x203378){var _0x328445=_0x203378[_0x43e7('0x15')],_0x4de324=_0x14c146[_0x43e7('0x16')],_0x5c4eaa=_0x14c146['offset']+_0x14c146['limit'],_0xdf16c;if(_0x5c4eaa>=_0x328445){_0x5c4eaa=_0x328445;_0xdf16c=0xc8;}else{_0xdf16c=0xce;}_0x16849c[_0x43e7('0x17')](_0xdf16c);return _0x16849c[_0x43e7('0x18')](_0x43e7('0x19'),_0x4de324+'-'+_0x5c4eaa+'/'+_0x328445)[_0x43e7('0x1a')](_0x203378);}return null;};}function patchUpdates(_0x3776f5){return function(_0x1f24fb){try{jsonpatch[_0x43e7('0x1b')](_0x1f24fb,_0x3776f5,!![]);}catch(_0x1441ef){return BPromise[_0x43e7('0x1c')](_0x1441ef);}return _0x1f24fb[_0x43e7('0x1d')]();};}function saveUpdates(_0x191dd5,_0x177ee1){return function(_0x4b5d64){if(_0x4b5d64){return _0x4b5d64[_0x43e7('0x1e')](_0x191dd5)[_0x43e7('0x1f')](function(_0x4b386b){return _0x4b386b;});}return null;};}function removeEntity(_0x2898b5,_0x3e281e){return function(_0x3945bb){if(_0x3945bb){return _0x3945bb[_0x43e7('0x20')]()[_0x43e7('0x1f')](function(){_0x2898b5[_0x43e7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454359,_0x4eea52){return function(_0x4c9df3){if(!_0x4c9df3){_0x454359[_0x43e7('0x14')](0x194);}return _0x4c9df3;};}function handleError(_0x43f4ff,_0x4b2b9f){_0x4b2b9f=_0x4b2b9f||0x1f4;return function(_0x1f0673){logger['error'](_0x1f0673[_0x43e7('0x21')]);if(_0x1f0673['name']){delete _0x1f0673[_0x43e7('0x22')];}_0x43f4ff[_0x43e7('0x17')](_0x4b2b9f)[_0x43e7('0x23')](_0x1f0673);};}exports[_0x43e7('0x24')]=function(_0x51f4d7,_0x52b7b3){var _0x805b54={},_0x501551={},_0x2dd5f={'count':0x0,'rows':[]};var _0x40dc8f=_[_0x43e7('0x25')](db[_0x43e7('0x26')]['rawAttributes'],function(_0x33a1a5){return{'name':_0x33a1a5[_0x43e7('0x27')],'type':_0x33a1a5[_0x43e7('0x28')][_0x43e7('0x29')]};});_0x501551[_0x43e7('0x2a')]=_[_0x43e7('0x25')](_0x40dc8f,_0x43e7('0x22'));_0x501551[_0x43e7('0x2b')]=_[_0x43e7('0x2c')](_0x51f4d7[_0x43e7('0x2b')]);_0x501551[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_0x501551[_0x43e7('0x2a')],_0x501551[_0x43e7('0x2b')]);_0x805b54['attributes']=_[_0x43e7('0x2e')](_0x501551[_0x43e7('0x2a')],qs[_0x43e7('0x2f')](_0x51f4d7[_0x43e7('0x2b')][_0x43e7('0x2f')]));_0x805b54['attributes']=_0x805b54[_0x43e7('0x30')][_0x43e7('0x31')]?_0x805b54[_0x43e7('0x30')]:_0x501551[_0x43e7('0x2a')];if(!_0x51f4d7['query']['hasOwnProperty']('nolimit')){_0x805b54[_0x43e7('0x32')]=qs[_0x43e7('0x32')](_0x51f4d7[_0x43e7('0x2b')][_0x43e7('0x32')]);_0x805b54[_0x43e7('0x16')]=qs[_0x43e7('0x16')](_0x51f4d7['query']['offset']);}_0x805b54['order']=qs['sort'](_0x51f4d7['query']['sort']);_0x805b54['where']=qs[_0x43e7('0x2d')](_['pick'](_0x51f4d7[_0x43e7('0x2b')],_0x501551[_0x43e7('0x2d')]),_0x40dc8f);if(_0x51f4d7[_0x43e7('0x2b')][_0x43e7('0x33')]){_0x805b54[_0x43e7('0x34')]=_[_0x43e7('0x35')](_0x805b54[_0x43e7('0x34')],{'$or':_['map'](_0x40dc8f,function(_0x5332d9){if(_0x5332d9['type']!==_0x43e7('0x36')){var _0xfe70e9={};_0xfe70e9[_0x5332d9[_0x43e7('0x22')]]={'$like':'%'+_0x51f4d7[_0x43e7('0x2b')][_0x43e7('0x33')]+'%'};return _0xfe70e9;}})});}_0x805b54=_[_0x43e7('0x35')]({},_0x805b54,_0x51f4d7[_0x43e7('0x37')]);var _0x2ffd43={'where':_0x805b54['where']};return db[_0x43e7('0x26')][_0x43e7('0x15')](_0x2ffd43)['then'](function(_0x2d54c1){_0x2dd5f['count']=_0x2d54c1;if(_0x51f4d7[_0x43e7('0x2b')][_0x43e7('0x38')]){_0x805b54[_0x43e7('0x39')]=[{'all':!![]}];}return db[_0x43e7('0x26')][_0x43e7('0x3a')](_0x805b54);})[_0x43e7('0x1f')](function(_0x5e731b){_0x2dd5f['rows']=_0x5e731b;return _0x2dd5f;})[_0x43e7('0x1f')](respondWithFilteredResult(_0x52b7b3,_0x805b54))[_0x43e7('0x3b')](handleError(_0x52b7b3,null));};exports[_0x43e7('0x3c')]=function(_0xc8ffa5,_0x127d77){var _0x4a4a85={'raw':!![],'where':{'id':_0xc8ffa5[_0x43e7('0x3d')]['id']}},_0x32a451={};_0x32a451['model']=_[_0x43e7('0x2c')](db['SmsQueueReport'][_0x43e7('0x3e')]);_0x32a451['query']=_[_0x43e7('0x2c')](_0xc8ffa5[_0x43e7('0x2b')]);_0x32a451[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](_0x32a451['model'],_0x32a451['query']);_0x4a4a85[_0x43e7('0x30')]=_[_0x43e7('0x2e')](_0x32a451[_0x43e7('0x2a')],qs[_0x43e7('0x2f')](_0xc8ffa5['query']['fields']));_0x4a4a85['attributes']=_0x4a4a85[_0x43e7('0x30')]['length']?_0x4a4a85[_0x43e7('0x30')]:_0x32a451['model'];if(_0xc8ffa5['query'][_0x43e7('0x38')]){_0x4a4a85['include']=[{'all':!![]}];}_0x4a4a85=_[_0x43e7('0x35')]({},_0x4a4a85,_0xc8ffa5[_0x43e7('0x37')]);return db[_0x43e7('0x26')][_0x43e7('0x3f')](_0x4a4a85)['then'](handleEntityNotFound(_0x127d77,null))[_0x43e7('0x1f')](respondWithResult(_0x127d77,null))[_0x43e7('0x3b')](handleError(_0x127d77,null));};exports[_0x43e7('0x40')]=function(_0x1fd277,_0x296dc8){return db[_0x43e7('0x26')]['create'](_0x1fd277['body'],{})[_0x43e7('0x1f')](respondWithResult(_0x296dc8,0xc9))[_0x43e7('0x3b')](handleError(_0x296dc8,null));};exports[_0x43e7('0x1e')]=function(_0x4c00a8,_0x5c1c18){if(_0x4c00a8['body']['id']){delete _0x4c00a8[_0x43e7('0x41')]['id'];}return db[_0x43e7('0x26')]['find']({'where':{'id':_0x4c00a8[_0x43e7('0x3d')]['id']}})[_0x43e7('0x1f')](handleEntityNotFound(_0x5c1c18,null))[_0x43e7('0x1f')](saveUpdates(_0x4c00a8['body'],null))['then'](respondWithResult(_0x5c1c18,null))['catch'](handleError(_0x5c1c18,null));};exports['destroy']=function(_0x214e7e,_0xe955fc){return db['SmsQueueReport'][_0x43e7('0x3f')]({'where':{'id':_0x214e7e[_0x43e7('0x3d')]['id']}})[_0x43e7('0x1f')](handleEntityNotFound(_0xe955fc,null))[_0x43e7('0x1f')](removeEntity(_0xe955fc,null))['catch'](handleError(_0xe955fc,null));};exports[_0x43e7('0x42')]=function(_0x483f20,_0x4bebd4){return db[_0x43e7('0x26')][_0x43e7('0x42')]()[_0x43e7('0x1f')](respondWithResult(_0x4bebd4,null))[_0x43e7('0x3b')](handleError(_0x4bebd4,null));}; \ No newline at end of file +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(_0x10aebb,_0x2fd10a){var _0x1b1b8f=function(_0x1161be){while(--_0x1161be){_0x10aebb['push'](_0x10aebb['shift']());}};_0x1b1b8f(++_0x2fd10a);}(_0x814b,0x1a2));var _0xb814=function(_0x80bea0,_0x4c30f4){_0x80bea0=_0x80bea0-0x0;var _0x50fb90=_0x814b[_0x80bea0];return _0x50fb90;};'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 diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9355c82..9fc8793 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 _0xf960=['util','api','moment','bluebird','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','lodash'];(function(_0x379efe,_0x16a136){var _0x44c0c2=function(_0x1b3c4f){while(--_0x1b3c4f){_0x379efe['push'](_0x379efe['shift']());}};_0x44c0c2(++_0x16a136);}(_0xf960,0x1eb));var _0x0f96=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xf960[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x0f96('0x0'));var util=require(_0x0f96('0x1'));var logger=require('../../config/logger')(_0x0f96('0x2'));var moment=require(_0x0f96('0x3'));var BPromise=require(_0x0f96('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0f96('0x5'));var config=require(_0x0f96('0x6'));var attributes=require(_0x0f96('0x7'));module[_0x0f96('0x8')]=function(_0x34800a,_0x570431){return _0x34800a[_0x0f96('0x9')]('SmsQueueReport',attributes,{'tableName':_0x0f96('0xa'),'paranoid':![],'indexes':[{'name':_0x0f96('0xb'),'fields':[_0x0f96('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa298=['util','../../config/logger','api','request-promise','path','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','uniqueid','lodash'];(function(_0x3da697,_0x9c1500){var _0x452bb3=function(_0xc8d790){while(--_0xc8d790){_0x3da697['push'](_0x3da697['shift']());}};_0x452bb3(++_0x9c1500);}(_0xa298,0xbf));var _0x8a29=function(_0x44e14f,_0x16a878){_0x44e14f=_0x44e14f-0x0;var _0x17a9c6=_0xa298[_0x44e14f];return _0x17a9c6;};'use strict';var _=require(_0x8a29('0x0'));var util=require(_0x8a29('0x1'));var logger=require(_0x8a29('0x2'))(_0x8a29('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8a29('0x4'));var fs=require('fs');var path=require(_0x8a29('0x5'));var rimraf=require('rimraf');var config=require(_0x8a29('0x6'));var attributes=require(_0x8a29('0x7'));module[_0x8a29('0x8')]=function(_0x4f0e02,_0x11bf13){return _0x4f0e02[_0x8a29('0x9')](_0x8a29('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x8a29('0xb'),'fields':[_0x8a29('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index db8458d..08b80c5 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 _0xc37f=['message','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../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','SmsQueueReport,\x20%s,\x20%s'];(function(_0x90f654,_0x4afa04){var _0x3111fb=function(_0x1ee482){while(--_0x1ee482){_0x90f654['push'](_0x90f654['shift']());}};_0x3111fb(++_0x4afa04);}(_0xc37f,0x9d));var _0xfc37=function(_0x3ab479,_0x3ad39a){_0x3ab479=_0x3ab479-0x0;var _0x57241b=_0xc37f[_0x3ab479];return _0x57241b;};'use strict';var _=require(_0xfc37('0x0'));var util=require(_0xfc37('0x1'));var moment=require(_0xfc37('0x2'));var BPromise=require(_0xfc37('0x3'));var rs=require(_0xfc37('0x4'));var fs=require('fs');var Redis=require(_0xfc37('0x5'));var db=require(_0xfc37('0x6'))['db'];var utils=require(_0xfc37('0x7'));var logger=require(_0xfc37('0x8'))(_0xfc37('0x9'));var config=require(_0xfc37('0xa'));var jayson=require(_0xfc37('0xb'));var client=jayson[_0xfc37('0xc')][_0xfc37('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c56a8,_0x301587,_0x2d3821){return new BPromise(function(_0x510175,_0x53b663){return client[_0xfc37('0xe')](_0x3c56a8,_0x2d3821)[_0xfc37('0xf')](function(_0x2cb229){logger[_0xfc37('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x301587,'request\x20sent');logger[_0xfc37('0x11')](_0xfc37('0x12'),_0x301587,'request\x20sent',JSON[_0xfc37('0x13')](_0x2cb229));if(_0x2cb229[_0xfc37('0x14')]){if(_0x2cb229[_0xfc37('0x14')][_0xfc37('0x15')]===0x1f4){logger['error'](_0xfc37('0x16'),_0x301587,_0x2cb229[_0xfc37('0x14')]['message']);return _0x53b663(_0x2cb229['error'][_0xfc37('0x17')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x301587,_0x2cb229[_0xfc37('0x14')][_0xfc37('0x17')]);return _0x510175(_0x2cb229[_0xfc37('0x14')][_0xfc37('0x17')]);}else{logger[_0xfc37('0x10')](_0xfc37('0x16'),_0x301587,_0xfc37('0x18'));_0x510175(_0x2cb229[_0xfc37('0x19')]['message']);}})[_0xfc37('0x1a')](function(_0x5265b4){logger[_0xfc37('0x14')](_0xfc37('0x16'),_0x301587,_0x5265b4);_0x53b663(_0x5265b4);});});}exports[_0xfc37('0x1b')]=function(_0x1d1da7){var _0x154aef=this;return new Promise(function(_0x5a69e0,_0x1432b0){return db[_0xfc37('0x1c')][_0xfc37('0x1d')](_0x1d1da7[_0xfc37('0x1e')],{'raw':_0x1d1da7[_0xfc37('0x1f')]?_0x1d1da7[_0xfc37('0x1f')][_0xfc37('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x4d8f79){logger['info'](_0xfc37('0x1b'),_0x1d1da7);logger[_0xfc37('0x11')](_0xfc37('0x1b'),_0x1d1da7,JSON[_0xfc37('0x13')](_0x4d8f79));_0x5a69e0(_0x4d8f79);})[_0xfc37('0x1a')](function(_0x128f9f){logger[_0xfc37('0x14')](_0xfc37('0x1b'),_0x128f9f[_0xfc37('0x17')],_0x1d1da7);_0x1432b0(_0x154aef[_0xfc37('0x14')](0x1f4,_0x128f9f[_0xfc37('0x17')]));});});};exports[_0xfc37('0x21')]=function(_0x56ff03){var _0x1eb1fb=this;return new Promise(function(_0x4c2eab,_0x5361a0){return db[_0xfc37('0x1c')][_0xfc37('0x22')](_0x56ff03[_0xfc37('0x1e')],{'raw':_0x56ff03[_0xfc37('0x1f')]?_0x56ff03[_0xfc37('0x1f')][_0xfc37('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56ff03[_0xfc37('0x1f')]?_0x56ff03['options'][_0xfc37('0x23')]||null:null,'attributes':_0x56ff03[_0xfc37('0x1f')]?_0x56ff03[_0xfc37('0x1f')]['attributes']||null:null,'limit':_0x56ff03[_0xfc37('0x1f')]?_0x56ff03['options']['limit']||null:null})[_0xfc37('0xf')](function(_0x11a511){logger[_0xfc37('0x10')](_0xfc37('0x21'),_0x56ff03);logger[_0xfc37('0x11')]('UpdateSmsQueueReport',_0x56ff03,JSON['stringify'](_0x11a511));_0x4c2eab(_0x11a511);})[_0xfc37('0x1a')](function(_0x462c11){logger[_0xfc37('0x14')](_0xfc37('0x21'),_0x462c11[_0xfc37('0x17')],_0x56ff03);_0x5361a0(_0x1eb1fb[_0xfc37('0x14')](0x1f4,_0x462c11['message']));});});}; \ No newline at end of file +var _0x5cb5=['UpdateSmsQueueReport','SmsQueueReport','body','where','attributes','limit','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','CreateSmsQueueReport','create','options','raw','info','debug','stringify','catch'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x5cb5,0x1c8));var _0x55cb=function(_0x470168,_0x39b014){_0x470168=_0x470168-0x0;var _0x565b93=_0x5cb5[_0x470168];return _0x565b93;};'use strict';var _=require('lodash');var util=require(_0x55cb('0x0'));var moment=require(_0x55cb('0x1'));var BPromise=require(_0x55cb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55cb('0x3'));var db=require(_0x55cb('0x4'))['db'];var utils=require(_0x55cb('0x5'));var logger=require(_0x55cb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x55cb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15ec61,_0x4e1a72,_0x36caac){return new BPromise(function(_0x5dab82,_0x2308d9){return client[_0x55cb('0x8')](_0x15ec61,_0x36caac)[_0x55cb('0x9')](function(_0x1ee860){logger['info'](_0x55cb('0xa'),_0x4e1a72,_0x55cb('0xb'));logger['debug'](_0x55cb('0xc'),_0x4e1a72,_0x55cb('0xb'),JSON['stringify'](_0x1ee860));if(_0x1ee860['error']){if(_0x1ee860[_0x55cb('0xd')][_0x55cb('0xe')]===0x1f4){logger[_0x55cb('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x4e1a72,_0x1ee860[_0x55cb('0xd')]['message']);return _0x2308d9(_0x1ee860[_0x55cb('0xd')][_0x55cb('0xf')]);}logger[_0x55cb('0xd')](_0x55cb('0xa'),_0x4e1a72,_0x1ee860[_0x55cb('0xd')][_0x55cb('0xf')]);return _0x5dab82(_0x1ee860[_0x55cb('0xd')]['message']);}else{logger['info'](_0x55cb('0xa'),_0x4e1a72,'request\x20sent');_0x5dab82(_0x1ee860['result'][_0x55cb('0xf')]);}})['catch'](function(_0x555a39){logger['error'](_0x55cb('0xa'),_0x4e1a72,_0x555a39);_0x2308d9(_0x555a39);});});}exports[_0x55cb('0x10')]=function(_0x43c5d0){var _0x36bb=this;return new Promise(function(_0x258a6d,_0x31810c){return db['SmsQueueReport'][_0x55cb('0x11')](_0x43c5d0['body'],{'raw':_0x43c5d0[_0x55cb('0x12')]?_0x43c5d0[_0x55cb('0x12')][_0x55cb('0x13')]===undefined?!![]:![]:!![]})[_0x55cb('0x9')](function(_0x30c1a8){logger[_0x55cb('0x14')](_0x55cb('0x10'),_0x43c5d0);logger[_0x55cb('0x15')]('CreateSmsQueueReport',_0x43c5d0,JSON[_0x55cb('0x16')](_0x30c1a8));_0x258a6d(_0x30c1a8);})[_0x55cb('0x17')](function(_0x1f3711){logger[_0x55cb('0xd')](_0x55cb('0x10'),_0x1f3711['message'],_0x43c5d0);_0x31810c(_0x36bb['error'](0x1f4,_0x1f3711['message']));});});};exports[_0x55cb('0x18')]=function(_0x2d5b2c){var _0x43b0fd=this;return new Promise(function(_0x4dd406,_0x53c183){return db[_0x55cb('0x19')]['update'](_0x2d5b2c[_0x55cb('0x1a')],{'raw':_0x2d5b2c[_0x55cb('0x12')]?_0x2d5b2c[_0x55cb('0x12')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d5b2c['options']?_0x2d5b2c[_0x55cb('0x12')][_0x55cb('0x1b')]||null:null,'attributes':_0x2d5b2c['options']?_0x2d5b2c[_0x55cb('0x12')][_0x55cb('0x1c')]||null:null,'limit':_0x2d5b2c[_0x55cb('0x12')]?_0x2d5b2c['options'][_0x55cb('0x1d')]||null:null})[_0x55cb('0x9')](function(_0x1ebbbb){logger[_0x55cb('0x14')](_0x55cb('0x18'),_0x2d5b2c);logger[_0x55cb('0x15')](_0x55cb('0x18'),_0x2d5b2c,JSON[_0x55cb('0x16')](_0x1ebbbb));_0x4dd406(_0x1ebbbb);})[_0x55cb('0x17')](function(_0x2d1e62){logger[_0x55cb('0xd')](_0x55cb('0x18'),_0x2d1e62[_0x55cb('0xf')],_0x2d5b2c);_0x53c183(_0x43b0fd[_0x55cb('0xd')](0x1f4,_0x2d1e62[_0x55cb('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 26c577d..57e2084 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 _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x13f6=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x2e0763,_0x37e6e4){var _0x189643=function(_0x20802b){while(--_0x20802b){_0x2e0763['push'](_0x2e0763['shift']());}};_0x189643(++_0x37e6e4);}(_0x13f6,0x124));var _0x613f=function(_0x21e6d0,_0x15fa42){_0x21e6d0=_0x21e6d0-0x0;var _0x3422b6=_0x13f6[_0x21e6d0];return _0x3422b6;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var auth=require(_0x613f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x613f('0x5'));var controller=require(_0x613f('0x6'));router[_0x613f('0x7')]('/',auth['isAuthenticated'](),controller[_0x613f('0x8')]);router[_0x613f('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x613f('0x9'),auth[_0x613f('0xa')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/',auth['isAuthenticated'](),controller[_0x613f('0xd')]);router[_0x613f('0xe')](_0x613f('0x9'),auth['isAuthenticated'](),controller[_0x613f('0xf')]);router[_0x613f('0x10')](_0x613f('0x9'),auth['isAuthenticated'](),controller[_0x613f('0x11')]);module[_0x613f('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 646478e..a6f85aa 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 _0x97aa=['agent','queue','DATE','NOW','moment','sequelize','STRING','ENUM'];(function(_0x720d1d,_0x1df43e){var _0xfed4ba=function(_0x2b5596){while(--_0x2b5596){_0x720d1d['push'](_0x720d1d['shift']());}};_0xfed4ba(++_0x1df43e);}(_0x97aa,0x134));var _0xa97a=function(_0xc5708,_0x3d620e){_0xc5708=_0xc5708-0x0;var _0x44d6cc=_0x97aa[_0xc5708];return _0x44d6cc;};'use strict';var moment=require(_0xa97a('0x0'));var Sequelize=require(_0xa97a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa97a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa97a('0x3')]('account',_0xa97a('0x4'),_0xa97a('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xa97a('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xa97a('0x7')]}}; \ No newline at end of file +var _0x471e=['ENUM','agent','queue','DATE','exports'];(function(_0x5db1a7,_0x5853d0){var _0x16fc33=function(_0x951905){while(--_0x951905){_0x5db1a7['push'](_0x5db1a7['shift']());}};_0x16fc33(++_0x5853d0);}(_0x471e,0x1bc));var _0xe471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x471e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe471('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe471('0x1')]('account',_0xe471('0x2'),_0xe471('0x3')),'allowNull':![],'defaultValue':_0xe471('0x3')},'transferredAt':{'type':Sequelize[_0xe471('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 9cdebdb..2da9c46 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 _0xcb91=['options','includeAll','include','findAll','params','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','SmsTransferReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge'];(function(_0x5159dd,_0x29a8f6){var _0x3eaa82=function(_0x1bf1ec){while(--_0x1bf1ec){_0x5159dd['push'](_0x5159dd['shift']());}};_0x3eaa82(++_0x29a8f6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0xcb91[_0xb301d4];return _0x3b5bde;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['index']=function(_0xd6891c,_0x21effa){var _0x41a9a0={},_0x1804fd={},_0x406821={'count':0x0,'rows':[]};var _0x21d6f5=_[_0x1cb9('0x26')](db[_0x1cb9('0x27')][_0x1cb9('0x28')],function(_0x9de64b){return{'name':_0x9de64b['fieldName'],'type':_0x9de64b[_0x1cb9('0x29')]['key']};});_0x1804fd[_0x1cb9('0x2a')]=_['map'](_0x21d6f5,_0x1cb9('0x24'));_0x1804fd[_0x1cb9('0x2b')]=_[_0x1cb9('0x2c')](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2d')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x1804fd['model'],qs[_0x1cb9('0x2f')](_0xd6891c['query'][_0x1cb9('0x2f')]));_0x41a9a0['attributes']=_0x41a9a0[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x41a9a0[_0x1cb9('0x2e')]:_0x1804fd[_0x1cb9('0x2a')];if(!_0xd6891c['query'][_0x1cb9('0x31')](_0x1cb9('0x32'))){_0x41a9a0[_0x1cb9('0x1b')]=qs[_0x1cb9('0x1b')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1b')]);_0x41a9a0[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1a')]);}_0x41a9a0[_0x1cb9('0x33')]=qs[_0x1cb9('0x34')](_0xd6891c[_0x1cb9('0x2b')]['sort']);_0x41a9a0['where']=qs[_0x1cb9('0x35')](_[_0x1cb9('0x36')](_0xd6891c[_0x1cb9('0x2b')],_0x1804fd[_0x1cb9('0x35')]),_0x21d6f5);if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x37')]){_0x41a9a0[_0x1cb9('0x38')]=_[_0x1cb9('0x39')](_0x41a9a0['where'],{'$or':_[_0x1cb9('0x26')](_0x21d6f5,function(_0x1482c4){if(_0x1482c4[_0x1cb9('0x29')]!=='VIRTUAL'){var _0x2a5aac={};_0x2a5aac[_0x1482c4['name']]={'$like':'%'+_0xd6891c[_0x1cb9('0x2b')]['filter']+'%'};return _0x2a5aac;}})});}_0x41a9a0=_[_0x1cb9('0x39')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x3a')]);var _0x289b73={'where':_0x41a9a0[_0x1cb9('0x38')]};return db[_0x1cb9('0x27')][_0x1cb9('0x19')](_0x289b73)[_0x1cb9('0x1f')](function(_0x4a4788){_0x406821['count']=_0x4a4788;if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x41a9a0[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')][_0x1cb9('0x3d')](_0x41a9a0);})[_0x1cb9('0x1f')](function(_0x32130b){_0x406821['rows']=_0x32130b;return _0x406821;})[_0x1cb9('0x1f')](respondWithFilteredResult(_0x21effa,_0x41a9a0))['catch'](handleError(_0x21effa,null));};exports['show']=function(_0x4c6c75,_0x409c62){var _0x397ff9={'raw':!![],'where':{'id':_0x4c6c75[_0x1cb9('0x3e')]['id']}},_0x1bf51c={};_0x1bf51c[_0x1cb9('0x2a')]=_['keys'](db[_0x1cb9('0x27')]['rawAttributes']);_0x1bf51c[_0x1cb9('0x2b')]=_[_0x1cb9('0x2c')](_0x4c6c75[_0x1cb9('0x2b')]);_0x1bf51c['filters']=_[_0x1cb9('0x2d')](_0x1bf51c['model'],_0x1bf51c[_0x1cb9('0x2b')]);_0x397ff9[_0x1cb9('0x2e')]=_['intersection'](_0x1bf51c['model'],qs[_0x1cb9('0x2f')](_0x4c6c75[_0x1cb9('0x2b')][_0x1cb9('0x2f')]));_0x397ff9[_0x1cb9('0x2e')]=_0x397ff9[_0x1cb9('0x2e')]['length']?_0x397ff9[_0x1cb9('0x2e')]:_0x1bf51c['model'];if(_0x4c6c75['query']['includeAll']){_0x397ff9[_0x1cb9('0x3c')]=[{'all':!![]}];}_0x397ff9=_[_0x1cb9('0x39')]({},_0x397ff9,_0x4c6c75[_0x1cb9('0x3a')]);return db[_0x1cb9('0x27')][_0x1cb9('0x3f')](_0x397ff9)[_0x1cb9('0x1f')](handleEntityNotFound(_0x409c62,null))[_0x1cb9('0x1f')](respondWithResult(_0x409c62,null))[_0x1cb9('0x40')](handleError(_0x409c62,null));};exports[_0x1cb9('0x41')]=function(_0x148a01,_0x3ea88c){return db['SmsTransferReport'][_0x1cb9('0x41')](_0x148a01[_0x1cb9('0x42')],{})[_0x1cb9('0x1f')](respondWithResult(_0x3ea88c,0xc9))['catch'](handleError(_0x3ea88c,null));};exports[_0x1cb9('0x43')]=function(_0x57251,_0x3c6044){if(_0x57251[_0x1cb9('0x42')]['id']){delete _0x57251[_0x1cb9('0x42')]['id'];}return db['SmsTransferReport'][_0x1cb9('0x3f')]({'where':{'id':_0x57251['params']['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x3c6044,null))['then'](saveUpdates(_0x57251[_0x1cb9('0x42')],null))[_0x1cb9('0x1f')](respondWithResult(_0x3c6044,null))[_0x1cb9('0x40')](handleError(_0x3c6044,null));};exports[_0x1cb9('0x20')]=function(_0x56d0c5,_0x298475){return db[_0x1cb9('0x27')][_0x1cb9('0x3f')]({'where':{'id':_0x56d0c5[_0x1cb9('0x3e')]['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x298475,null))[_0x1cb9('0x1f')](removeEntity(_0x298475,null))[_0x1cb9('0x40')](handleError(_0x298475,null));};exports[_0x1cb9('0x44')]=function(_0xbb500e,_0x17f10e){return db['SmsTransferReport']['describe']()[_0x1cb9('0x1f')](respondWithResult(_0x17f10e,null))[_0x1cb9('0x40')](handleError(_0x17f10e,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(_0x5a66e2,_0x217ae8){var _0x1a23b8=function(_0x32727b){while(--_0x32727b){_0x5a66e2['push'](_0x5a66e2['shift']());}};_0x1a23b8(++_0x217ae8);}(_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 4baa2fa..3186dc1 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 _0xce53=['../../config/logger','api','moment','request-promise','path','rimraf','./smsTransferReport.attributes','exports','SmsTransferReport','lodash','util'];(function(_0x4fcad2,_0x469f0a){var _0xf91dbc=function(_0x5d0812){while(--_0x5d0812){_0x4fcad2['push'](_0x4fcad2['shift']());}};_0xf91dbc(++_0x469f0a);}(_0xce53,0x106));var _0x3ce5=function(_0x34be3d,_0x3c6ba1){_0x34be3d=_0x34be3d-0x0;var _0xe9fe2d=_0xce53[_0x34be3d];return _0xe9fe2d;};'use strict';var _=require(_0x3ce5('0x0'));var util=require(_0x3ce5('0x1'));var logger=require(_0x3ce5('0x2'))(_0x3ce5('0x3'));var moment=require(_0x3ce5('0x4'));var BPromise=require('bluebird');var rp=require(_0x3ce5('0x5'));var fs=require('fs');var path=require(_0x3ce5('0x6'));var rimraf=require(_0x3ce5('0x7'));var config=require('../../config/environment');var attributes=require(_0x3ce5('0x8'));module[_0x3ce5('0x9')]=function(_0x372e76,_0x23fa1e){return _0x372e76['define'](_0x3ce5('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe8fe=['bluebird','path','rimraf','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','moment'];(function(_0x13e9d4,_0x25483d){var _0x2c62b8=function(_0x4c5ffb){while(--_0x4c5ffb){_0x13e9d4['push'](_0x13e9d4['shift']());}};_0x2c62b8(++_0x25483d);}(_0xe8fe,0xee));var _0xee8f=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0xe8fe[_0xe0b81f];return _0x290e5e;};'use strict';var _=require(_0xee8f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xee8f('0x1'));var BPromise=require(_0xee8f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee8f('0x3'));var rimraf=require(_0xee8f('0x4'));var config=require('../../config/environment');var attributes=require(_0xee8f('0x5'));module['exports']=function(_0x598433,_0x56b247){return _0x598433[_0xee8f('0x6')](_0xee8f('0x7'),attributes,{'tableName':_0xee8f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xee8f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 8a847e3..9140440 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 _0x5fc1=['info','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','SmsTransferReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http'];(function(_0xd1998b,_0x3a699c){var _0x5cd3f0=function(_0x1233b0){while(--_0x1233b0){_0xd1998b['push'](_0xd1998b['shift']());}};_0x5cd3f0(++_0x3a699c);}(_0x5fc1,0x14a));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x15fc('0x0'));var util=require(_0x15fc('0x1'));var moment=require(_0x15fc('0x2'));var BPromise=require(_0x15fc('0x3'));var rs=require(_0x15fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x15fc('0x6'))(_0x15fc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15fc('0x8')][_0x15fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a7874,_0xc32ae2,_0x6e2105){return new BPromise(function(_0x955acd,_0x4466ac){return client['request'](_0x3a7874,_0x6e2105)['then'](function(_0x5517fd){logger[_0x15fc('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0xc32ae2,'request\x20sent');logger[_0x15fc('0xb')](_0x15fc('0xc'),_0xc32ae2,_0x15fc('0xd'),JSON[_0x15fc('0xe')](_0x5517fd));if(_0x5517fd['error']){if(_0x5517fd['error'][_0x15fc('0xf')]===0x1f4){logger[_0x15fc('0x10')](_0x15fc('0x11'),_0xc32ae2,_0x5517fd[_0x15fc('0x10')][_0x15fc('0x12')]);return _0x4466ac(_0x5517fd[_0x15fc('0x10')][_0x15fc('0x12')]);}logger[_0x15fc('0x10')](_0x15fc('0x11'),_0xc32ae2,_0x5517fd[_0x15fc('0x10')][_0x15fc('0x12')]);return _0x955acd(_0x5517fd[_0x15fc('0x10')]['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0xc32ae2,_0x15fc('0xd'));_0x955acd(_0x5517fd[_0x15fc('0x13')]['message']);}})['catch'](function(_0xe635ce){logger['error'](_0x15fc('0x11'),_0xc32ae2,_0xe635ce);_0x4466ac(_0xe635ce);});});} \ No newline at end of file +var _0xd648=['SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0xd648,0x149));var _0x8d64=function(_0x535617,_0x4ab728){_0x535617=_0x535617-0x0;var _0x4bf3c5=_0xd648[_0x535617];return _0x4bf3c5;};'use strict';var _=require(_0x8d64('0x0'));var util=require(_0x8d64('0x1'));var moment=require('moment');var BPromise=require(_0x8d64('0x2'));var rs=require(_0x8d64('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d64('0x4'))['db'];var utils=require(_0x8d64('0x5'));var logger=require(_0x8d64('0x6'))(_0x8d64('0x7'));var config=require(_0x8d64('0x8'));var jayson=require(_0x8d64('0x9'));var client=jayson['client'][_0x8d64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x178548,_0x1604a6,_0x242370){return new BPromise(function(_0x535c52,_0xe54dcd){return client[_0x8d64('0xb')](_0x178548,_0x242370)[_0x8d64('0xc')](function(_0x1ab523){logger[_0x8d64('0xd')](_0x8d64('0xe'),_0x1604a6,_0x8d64('0xf'));logger['debug'](_0x8d64('0x10'),_0x1604a6,'request\x20sent',JSON[_0x8d64('0x11')](_0x1ab523));if(_0x1ab523[_0x8d64('0x12')]){if(_0x1ab523[_0x8d64('0x12')][_0x8d64('0x13')]===0x1f4){logger[_0x8d64('0x12')](_0x8d64('0xe'),_0x1604a6,_0x1ab523[_0x8d64('0x12')]['message']);return _0xe54dcd(_0x1ab523['error'][_0x8d64('0x14')]);}logger[_0x8d64('0x12')](_0x8d64('0xe'),_0x1604a6,_0x1ab523[_0x8d64('0x12')]['message']);return _0x535c52(_0x1ab523[_0x8d64('0x12')][_0x8d64('0x14')]);}else{logger[_0x8d64('0xd')](_0x8d64('0xe'),_0x1604a6,_0x8d64('0xf'));_0x535c52(_0x1ab523[_0x8d64('0x15')]['message']);}})[_0x8d64('0x16')](function(_0x185cca){logger[_0x8d64('0x12')](_0x8d64('0xe'),_0x1604a6,_0x185cca);_0xe54dcd(_0x185cca);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index f46b668..0a81e9a 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 _0x561d=['diskStorage','join','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','now','extname','post','single','file','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','/:id','isAuthenticated','show','get','/:id/download','download'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x561d,0x127));var _0xd561=function(_0x185e2e,_0x26bc2c){_0x185e2e=_0x185e2e-0x0;var _0x5a4715=_0x561d[_0x185e2e];return _0x5a4715;};'use strict';var multer=require(_0xd561('0x0'));var util=require(_0xd561('0x1'));var path=require(_0xd561('0x2'));var timeout=require(_0xd561('0x3'));var express=require(_0xd561('0x4'));var router=express[_0xd561('0x5')]();var auth=require(_0xd561('0x6'));var interaction=require(_0xd561('0x7'));var config=require('../../config/environment');var controller=require(_0xd561('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd561('0x9'),auth[_0xd561('0xa')](),controller[_0xd561('0xb')]);router[_0xd561('0xc')](_0xd561('0xd'),auth[_0xd561('0xa')](),controller[_0xd561('0xe')]);var upload=multer({'storage':multer[_0xd561('0xf')]({'destination':function(_0x282c73,_0x53f21a,_0x199f90){_0x199f90(null,path[_0xd561('0x10')](config[_0xd561('0x11')],_0xd561('0x12')));},'filename':function(_0x6db9c0,_0x39092c,_0x239165){_0x39092c[_0xd561('0x13')]=_0x39092c[_0xd561('0x13')][_0xd561('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x239165(null,util['format'](_0xd561('0x15'),path[_0xd561('0x16')](_0x39092c[_0xd561('0x13')],path['extname'](_0x39092c[_0xd561('0x13')])),Date[_0xd561('0x17')](),path[_0xd561('0x18')](_0x39092c[_0xd561('0x13')])));}})});router[_0xd561('0x19')]('/',upload[_0xd561('0x1a')](_0xd561('0x1b')),controller['create']);router[_0xd561('0x1c')](_0xd561('0x9'),auth['isAuthenticated'](),controller[_0xd561('0x1d')]);router[_0xd561('0x1e')](_0xd561('0x9'),auth[_0xd561('0xa')](),controller[_0xd561('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x7f46=['now','post','single','file','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','download','diskStorage','join','root','originalname','replace','%s-%s%s','basename','extname'];(function(_0x238d71,_0x16cf3b){var _0x22491a=function(_0x3b3ce3){while(--_0x3b3ce3){_0x238d71['push'](_0x238d71['shift']());}};_0x22491a(++_0x16cf3b);}(_0x7f46,0xd3));var _0x67f4=function(_0x372915,_0x2dbd58){_0x372915=_0x372915-0x0;var _0x42ea51=_0x7f46[_0x372915];return _0x42ea51;};'use strict';var multer=require('multer');var util=require(_0x67f4('0x0'));var path=require(_0x67f4('0x1'));var timeout=require(_0x67f4('0x2'));var express=require(_0x67f4('0x3'));var router=express[_0x67f4('0x4')]();var auth=require(_0x67f4('0x5'));var interaction=require(_0x67f4('0x6'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x67f4('0x7')]('/',auth[_0x67f4('0x8')](),controller[_0x67f4('0x9')]);router[_0x67f4('0x7')](_0x67f4('0xa'),auth['isAuthenticated'](),controller[_0x67f4('0xb')]);router[_0x67f4('0x7')]('/:id/download',auth[_0x67f4('0x8')](),controller[_0x67f4('0xc')]);var upload=multer({'storage':multer[_0x67f4('0xd')]({'destination':function(_0x4eb775,_0x474029,_0x57a942){_0x57a942(null,path[_0x67f4('0xe')](config[_0x67f4('0xf')],'server/files/sounds/original/'));},'filename':function(_0x2dd405,_0x21a177,_0x6c39e7){_0x21a177[_0x67f4('0x10')]=_0x21a177[_0x67f4('0x10')][_0x67f4('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6c39e7(null,util['format'](_0x67f4('0x12'),path[_0x67f4('0x13')](_0x21a177[_0x67f4('0x10')],path[_0x67f4('0x14')](_0x21a177[_0x67f4('0x10')])),Date[_0x67f4('0x15')](),path[_0x67f4('0x14')](_0x21a177['originalname'])));}})});router[_0x67f4('0x16')]('/',upload[_0x67f4('0x17')](_0x67f4('0x18')),controller['create']);router[_0x67f4('0x19')]('/:id',auth[_0x67f4('0x8')](),controller[_0x67f4('0x1a')]);router[_0x67f4('0x1b')](_0x67f4('0xa'),auth[_0x67f4('0x8')](),controller[_0x67f4('0x1b')]);module[_0x67f4('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 364fc86..8d45667 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 _0x6175=['sequelize','exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0x3b5bc7,_0x1bb500){var _0x1c86c9=function(_0x2597cd){while(--_0x2597cd){_0x3b5bc7['push'](_0x3b5bc7['shift']());}};_0x1c86c9(++_0x1bb500);}(_0x6175,0x134));var _0x5617=function(_0xf738be,_0x22b790){_0xf738be=_0xf738be-0x0;var _0x3fcfd5=_0x6175[_0xf738be];return _0x3fcfd5;};'use strict';var Sequelize=require(_0x5617('0x0'));module[_0x5617('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x5617('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x5617('0x3')]},'original_format':{'type':Sequelize[_0x5617('0x3')]},'original_duration':{'type':Sequelize[_0x5617('0x4')]},'original_sampleCount':{'type':Sequelize[_0x5617('0x5')]},'original_channelCount':{'type':Sequelize[_0x5617('0x6')]},'original_bitRate':{'type':Sequelize[_0x5617('0x5')]},'original_sampleRate':{'type':Sequelize[_0x5617('0x6')]},'converted_format':{'type':Sequelize[_0x5617('0x3')]},'converted_duration':{'type':Sequelize[_0x5617('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x5617('0x5')]},'converted_channelCount':{'type':Sequelize[_0x5617('0x6')]},'converted_bitRate':{'type':Sequelize[_0x5617('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x5617('0x6')]}}; \ No newline at end of file +var _0x2ba4=['exports','STRING','FLOAT','INTEGER','BIGINT'];(function(_0x4c8be8,_0x513efa){var _0x12ea7c=function(_0x11f43f){while(--_0x11f43f){_0x4c8be8['push'](_0x4c8be8['shift']());}};_0x12ea7c(++_0x513efa);}(_0x2ba4,0x91));var _0x42ba=function(_0x271db5,_0x3d62c8){_0x271db5=_0x271db5-0x0;var _0x5363a8=_0x2ba4[_0x271db5];return _0x5363a8;};'use strict';var Sequelize=require('sequelize');module[_0x42ba('0x0')]={'name':{'type':Sequelize[_0x42ba('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x42ba('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x42ba('0x1')]},'original_duration':{'type':Sequelize[_0x42ba('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x42ba('0x3')]},'original_bitRate':{'type':Sequelize[_0x42ba('0x4')]},'original_sampleRate':{'type':Sequelize[_0x42ba('0x3')]},'converted_format':{'type':Sequelize[_0x42ba('0x1')]},'converted_duration':{'type':Sequelize[_0x42ba('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x42ba('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x42ba('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x42ba('0x3')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 479e3a0..1755e5e 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 _0xd030=['converted_channelCount','converted_sampleRate','end','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Sounds','stack','name','send','index','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','Sound','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','download','converted_format','join','server/files/sounds/converted','save_name','ValidationError','format','%s.%s','basename','file','originalname','filename','extname','substring','wav','root','server/files/sounds/original','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount'];(function(_0x43aedf,_0x5a6d8a){var _0x3fe5af=function(_0x1f3da9){while(--_0x1f3da9){_0x43aedf['push'](_0x43aedf['shift']());}};_0x3fe5af(++_0x5a6d8a);}(_0xd030,0x16c));var _0x0d03=function(_0x13de9d,_0x4e8d4a){_0x13de9d=_0x13de9d-0x0;var _0x52097d=_0xd030[_0x13de9d];return _0x52097d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d03('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d03('0x1'));var jsonpatch=require(_0x0d03('0x2'));var rp=require(_0x0d03('0x3'));var moment=require(_0x0d03('0x4'));var BPromise=require(_0x0d03('0x5'));var Mustache=require(_0x0d03('0x6'));var util=require(_0x0d03('0x7'));var path=require(_0x0d03('0x8'));var sox=require('sox');var csv=require(_0x0d03('0x9'));var ejs=require(_0x0d03('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0d03('0xb'));var crypto=require('crypto');var jsforce=require(_0x0d03('0xc'));var deskjs=require(_0x0d03('0xd'));var toCsv=require(_0x0d03('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0d03('0xe'));var qs=require(_0x0d03('0xf'));var as=require(_0x0d03('0x10'));var hardwareService=require(_0x0d03('0x11'));var logger=require(_0x0d03('0x12'))(_0x0d03('0x13'));var utils=require(_0x0d03('0x14'));var config=require(_0x0d03('0x15'));var db=require(_0x0d03('0x16'))['db'];function respondWithStatusCode(_0x390c4d,_0x59adf5){_0x59adf5=_0x59adf5||0xcc;return function(_0x2ccbb4){if(_0x2ccbb4){return _0x390c4d[_0x0d03('0x17')](_0x59adf5);}return _0x390c4d[_0x0d03('0x18')](_0x59adf5)['end']();};}function respondWithResult(_0x292863,_0x426f52){_0x426f52=_0x426f52||0xc8;return function(_0x24b53e){if(_0x24b53e){return _0x292863['status'](_0x426f52)[_0x0d03('0x19')](_0x24b53e);}};}function respondWithFilteredResult(_0x438466,_0x3d2050){return function(_0x35c7f2){if(_0x35c7f2){var _0x57dc67=_0x35c7f2['count'],_0x40ec9b=_0x3d2050[_0x0d03('0x1a')],_0x196e09=_0x3d2050[_0x0d03('0x1a')]+_0x3d2050[_0x0d03('0x1b')],_0x1e4a8b;if(_0x196e09>=_0x57dc67){_0x196e09=_0x57dc67;_0x1e4a8b=0xc8;}else{_0x1e4a8b=0xce;}_0x438466[_0x0d03('0x18')](_0x1e4a8b);return _0x438466[_0x0d03('0x1c')](_0x0d03('0x1d'),_0x40ec9b+'-'+_0x196e09+'/'+_0x57dc67)[_0x0d03('0x19')](_0x35c7f2);}return null;};}function patchUpdates(_0x46378f){return function(_0x3719f6){try{jsonpatch['apply'](_0x3719f6,_0x46378f,!![]);}catch(_0x36b8ab){return BPromise[_0x0d03('0x1e')](_0x36b8ab);}return _0x3719f6[_0x0d03('0x1f')]();};}function saveUpdates(_0x52174d,_0x406968){return function(_0x5debae){if(_0x5debae){return _0x5debae[_0x0d03('0x20')](_0x52174d)[_0x0d03('0x21')](function(_0x8e0457){return _0x8e0457;});}return null;};}function removeEntity(_0x11e41e,_0xb0bc9b){return function(_0x34b8d9){if(_0x34b8d9){return _0x34b8d9[_0x0d03('0x22')]()[_0x0d03('0x21')](function(){var _0x26d8b7=_0x34b8d9[_0x0d03('0x23')]({'plain':!![]});var _0x5a67d0=_0x0d03('0x24');return db['UserProfileResource'][_0x0d03('0x22')]({'where':{'type':_0x5a67d0,'resourceId':_0x26d8b7['id']}})['then'](function(){return _0x34b8d9;});})[_0x0d03('0x21')](function(){_0x11e41e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xacdace,_0x4e0a20){return function(_0xe67bb2){if(!_0xe67bb2){_0xacdace[_0x0d03('0x17')](0x194);}return _0xe67bb2;};}function handleError(_0x51fe7e,_0x2d9376){_0x2d9376=_0x2d9376||0x1f4;return function(_0x262a12){logger['error'](_0x262a12[_0x0d03('0x25')]);if(_0x262a12[_0x0d03('0x26')]){delete _0x262a12[_0x0d03('0x26')];}_0x51fe7e[_0x0d03('0x18')](_0x2d9376)[_0x0d03('0x27')](_0x262a12);};}exports[_0x0d03('0x28')]=function(_0x4ebc9c,_0x467fd3){var _0x2b8827={},_0x228d00={},_0x1e71ae={'count':0x0,'rows':[]};var _0x40eb8b=_['map'](db['Sound']['rawAttributes'],function(_0x8ce938){return{'name':_0x8ce938[_0x0d03('0x29')],'type':_0x8ce938[_0x0d03('0x2a')][_0x0d03('0x2b')]};});_0x228d00['model']=_[_0x0d03('0x2c')](_0x40eb8b,'name');_0x228d00[_0x0d03('0x2d')]=_[_0x0d03('0x2e')](_0x4ebc9c['query']);_0x228d00[_0x0d03('0x2f')]=_[_0x0d03('0x30')](_0x228d00['model'],_0x228d00['query']);_0x2b8827[_0x0d03('0x31')]=_[_0x0d03('0x30')](_0x228d00[_0x0d03('0x32')],qs['fields'](_0x4ebc9c['query'][_0x0d03('0x33')]));_0x2b8827[_0x0d03('0x31')]=_0x2b8827['attributes']['length']?_0x2b8827[_0x0d03('0x31')]:_0x228d00[_0x0d03('0x32')];if(!_0x4ebc9c[_0x0d03('0x2d')][_0x0d03('0x34')]('nolimit')){_0x2b8827[_0x0d03('0x1b')]=qs[_0x0d03('0x1b')](_0x4ebc9c['query'][_0x0d03('0x1b')]);_0x2b8827[_0x0d03('0x1a')]=qs[_0x0d03('0x1a')](_0x4ebc9c[_0x0d03('0x2d')][_0x0d03('0x1a')]);}_0x2b8827[_0x0d03('0x35')]=qs[_0x0d03('0x36')](_0x4ebc9c['query'][_0x0d03('0x36')]);_0x2b8827[_0x0d03('0x37')]=qs[_0x0d03('0x2f')](_[_0x0d03('0x38')](_0x4ebc9c[_0x0d03('0x2d')],_0x228d00['filters']),_0x40eb8b);if(_0x4ebc9c[_0x0d03('0x2d')]['filter']){_0x2b8827['where']=_['merge'](_0x2b8827[_0x0d03('0x37')],{'$or':_['map'](_0x40eb8b,function(_0x3052a2){if(_0x3052a2['type']!==_0x0d03('0x39')){var _0x223e69={};_0x223e69[_0x3052a2['name']]={'$like':'%'+_0x4ebc9c[_0x0d03('0x2d')]['filter']+'%'};return _0x223e69;}})});}_0x2b8827=_[_0x0d03('0x3a')]({},_0x2b8827,_0x4ebc9c[_0x0d03('0x3b')]);var _0x5a2db9={'where':_0x2b8827[_0x0d03('0x37')]};return db[_0x0d03('0x3c')][_0x0d03('0x3d')](_0x5a2db9)[_0x0d03('0x21')](function(_0x2f786c){_0x1e71ae[_0x0d03('0x3d')]=_0x2f786c;if(_0x4ebc9c['query'][_0x0d03('0x3e')]){_0x2b8827[_0x0d03('0x3f')]=[{'all':!![]}];}return db[_0x0d03('0x3c')][_0x0d03('0x40')](_0x2b8827);})[_0x0d03('0x21')](function(_0x1922e3){_0x1e71ae[_0x0d03('0x41')]=_0x1922e3;return _0x1e71ae;})['then'](respondWithFilteredResult(_0x467fd3,_0x2b8827))[_0x0d03('0x42')](handleError(_0x467fd3,null));};exports[_0x0d03('0x43')]=function(_0x1f7d99,_0x2806eb){var _0x4f6a67={'raw':!![],'where':{'id':_0x1f7d99[_0x0d03('0x44')]['id']}},_0x57a139={};_0x57a139[_0x0d03('0x32')]=_['keys'](db[_0x0d03('0x3c')][_0x0d03('0x45')]);_0x57a139[_0x0d03('0x2d')]=_[_0x0d03('0x2e')](_0x1f7d99[_0x0d03('0x2d')]);_0x57a139[_0x0d03('0x2f')]=_[_0x0d03('0x30')](_0x57a139[_0x0d03('0x32')],_0x57a139[_0x0d03('0x2d')]);_0x4f6a67[_0x0d03('0x31')]=_[_0x0d03('0x30')](_0x57a139[_0x0d03('0x32')],qs[_0x0d03('0x33')](_0x1f7d99[_0x0d03('0x2d')][_0x0d03('0x33')]));_0x4f6a67[_0x0d03('0x31')]=_0x4f6a67['attributes'][_0x0d03('0x46')]?_0x4f6a67[_0x0d03('0x31')]:_0x57a139[_0x0d03('0x32')];if(_0x1f7d99['query']['includeAll']){_0x4f6a67[_0x0d03('0x3f')]=[{'all':!![]}];}_0x4f6a67=_[_0x0d03('0x3a')]({},_0x4f6a67,_0x1f7d99[_0x0d03('0x3b')]);return db['Sound'][_0x0d03('0x47')](_0x4f6a67)[_0x0d03('0x21')](handleEntityNotFound(_0x2806eb,null))[_0x0d03('0x21')](respondWithResult(_0x2806eb,null))[_0x0d03('0x42')](handleError(_0x2806eb,null));};exports[_0x0d03('0x48')]=function(_0x1b8606,_0x19a595,_0x38df6e){return db[_0x0d03('0x3c')][_0x0d03('0x47')]({'where':{'id':_0x1b8606[_0x0d03('0x44')]['id']},'attributes':[_0x0d03('0x26'),'save_name',_0x0d03('0x49')],'raw':!![]})[_0x0d03('0x21')](handleEntityNotFound(_0x19a595,null))[_0x0d03('0x21')](function(_0x2cd7e1){if(_0x2cd7e1){if(!fs['existsSync'](path[_0x0d03('0x4a')](config['root'],_0x0d03('0x4b'),_0x2cd7e1[_0x0d03('0x4c')]+'.'+_0x2cd7e1[_0x0d03('0x49')]))){throw new db['Sequelize'][(_0x0d03('0x4d'))]('Sound\x20not\x20found');}return _0x19a595[_0x0d03('0x48')](path[_0x0d03('0x4a')](config['root'],_0x0d03('0x4b'),util[_0x0d03('0x4e')](_0x0d03('0x4f'),_0x2cd7e1[_0x0d03('0x4c')],_0x2cd7e1['converted_format'])),util[_0x0d03('0x4e')](_0x0d03('0x4f'),_0x2cd7e1[_0x0d03('0x26')],_0x2cd7e1[_0x0d03('0x49')]));}return null;})[_0x0d03('0x42')](handleError(_0x19a595,null));};exports['create']=function(_0x1a2d5a,_0x33be8e,_0x1d689e){var _0x568639={'name':path[_0x0d03('0x50')](_0x1a2d5a[_0x0d03('0x51')][_0x0d03('0x52')],path['extname'](_0x1a2d5a[_0x0d03('0x51')][_0x0d03('0x52')])),'save_name':path[_0x0d03('0x50')](_0x1a2d5a[_0x0d03('0x51')][_0x0d03('0x53')],path['extname'](_0x1a2d5a['file'][_0x0d03('0x53')])),'original_format':path[_0x0d03('0x54')](_0x1a2d5a['file']['originalname'])[_0x0d03('0x55')](0x1),'converted_format':_0x0d03('0x56')};var _0x377279=path[_0x0d03('0x4a')](config[_0x0d03('0x57')],_0x0d03('0x58'),_0x1a2d5a[_0x0d03('0x51')][_0x0d03('0x53')]);var _0x10cc50=path[_0x0d03('0x4a')](config[_0x0d03('0x57')],_0x0d03('0x4b'),util[_0x0d03('0x4e')](_0x0d03('0x4f'),path[_0x0d03('0x50')](_0x1a2d5a['file'][_0x0d03('0x53')],path[_0x0d03('0x54')](_0x1a2d5a[_0x0d03('0x51')][_0x0d03('0x53')])),_0x568639[_0x0d03('0x49')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x377279);logger['info'](_0x0d03('0x59'),_0x10cc50);try{fs[_0x0d03('0x5a')](_0x377279,parseInt(_0x0d03('0x5b'),0x8));var _0x8de93e=sox[_0x0d03('0x5c')](_0x377279,_0x10cc50,{'sampleRate':0x1f40,'format':_0x0d03('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x8de93e['on']('error',function(_0x289e6a){fs[_0x0d03('0x5d')](_0x377279);_0x33be8e[_0x0d03('0x18')](0x1f4)['send'](_0x289e6a);});_0x8de93e['on']('src',function(_0x11db4e){_0x568639['original_duration']=isNaN(_0x11db4e[_0x0d03('0x5e')])?null:_0x11db4e[_0x0d03('0x5e')]*0x3e8;_0x568639[_0x0d03('0x5f')]=isNaN(_0x11db4e[_0x0d03('0x60')])?null:_0x11db4e['sampleCount'];_0x568639[_0x0d03('0x61')]=isNaN(_0x11db4e[_0x0d03('0x62')])?null:_0x11db4e['channelCount'];_0x568639['original_bitRate']=isNaN(_0x11db4e[_0x0d03('0x63')])?null:_0x11db4e[_0x0d03('0x63')];_0x568639[_0x0d03('0x64')]=isNaN(_0x11db4e[_0x0d03('0x65')])?null:_0x11db4e[_0x0d03('0x65')];});_0x8de93e['on'](_0x0d03('0x66'),function(_0x7f601){_0x568639['converted_duration']=isNaN(_0x7f601['duration'])?null:_0x7f601[_0x0d03('0x5e')]*0x3e8;_0x568639[_0x0d03('0x67')]=isNaN(_0x7f601['sampleCount'])?null:_0x7f601[_0x0d03('0x60')];_0x568639[_0x0d03('0x68')]=isNaN(_0x7f601['channelCount'])?null:_0x7f601[_0x0d03('0x62')];_0x568639['converted_bitRate']=isNaN(_0x7f601[_0x0d03('0x63')])?null:_0x7f601[_0x0d03('0x63')];_0x568639[_0x0d03('0x69')]=isNaN(_0x7f601['sampleRate'])?null:_0x7f601[_0x0d03('0x65')];});_0x8de93e['on'](_0x0d03('0x6a'),function(){fs[_0x0d03('0x5a')](_0x10cc50,parseInt(_0x0d03('0x5b'),0x8));return db[_0x0d03('0x3c')][_0x0d03('0x6b')](_0x568639)[_0x0d03('0x21')](function(_0x77181f){var _0x48af7a={'role':_0x1a2d5a[_0x0d03('0x6c')][_0x0d03('0x6d')],'userProfileId':_0x1a2d5a['body']['userProfileId']};if(!_0x48af7a)throw new Error(_0x0d03('0x6e'));if(_0x48af7a['role']===_0x0d03('0x6f')){var _0x4e6be0=_0x77181f[_0x0d03('0x23')]({'plain':!![]});return db[_0x0d03('0x70')][_0x0d03('0x47')]({'where':{'name':'Sounds','userProfileId':_0x48af7a['userProfileId']},'raw':!![]})[_0x0d03('0x21')](function(_0x304bc4){if(_0x304bc4&&_0x304bc4['autoAssociation']===0x0){return db['UserProfileResource'][_0x0d03('0x6b')]({'name':_0x4e6be0[_0x0d03('0x26')],'resourceId':_0x4e6be0['id'],'type':_0x304bc4['name'],'sectionId':_0x304bc4['id']},{})[_0x0d03('0x21')](function(){return _0x77181f;});}else{return _0x77181f;}})[_0x0d03('0x42')](function(_0x48e647){logger['error'](_0x0d03('0x71'),_0x48e647);throw _0x48e647;});}return _0x77181f;})['then'](respondWithResult(_0x33be8e,null))[_0x0d03('0x42')](handleError(_0x33be8e,null));});_0x8de93e[_0x0d03('0x72')]();}catch(_0x5e0f61){_0x33be8e[_0x0d03('0x18')](0x1f4)['send'](_0x5e0f61);}};exports['update']=function(_0x162887,_0x3a5226,_0x5b7bdb){return db['Sound'][_0x0d03('0x47')]({'where':{'id':_0x162887[_0x0d03('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a5226,null))['then'](saveUpdates(_[_0x0d03('0x38')](_0x162887[_0x0d03('0x6c')],[_0x0d03('0x26'),_0x0d03('0x73')]),null))[_0x0d03('0x21')](respondWithResult(_0x3a5226,null))['catch'](handleError(_0x3a5226,null));};exports[_0x0d03('0x74')]=function(_0xa9db8c,_0x574c4b,_0x12ad24){return db['Sound']['find']({'where':{'id':_0xa9db8c[_0x0d03('0x44')]['id']}})[_0x0d03('0x21')](function(_0x273aa0){if(_0x273aa0){return _0x273aa0['destroy']();}})[_0x0d03('0x21')](function(_0x37e626){var _0x1c2011=path[_0x0d03('0x4a')](config['root'],'server/files/sounds/original',util[_0x0d03('0x4e')](_0x0d03('0x4f'),_0x37e626['save_name'],_0x37e626['original_format']));var _0xb213d3=path[_0x0d03('0x4a')](config[_0x0d03('0x57')],'server/files/sounds/converted',util[_0x0d03('0x4e')](_0x0d03('0x4f'),_0x37e626['save_name'],_0x37e626[_0x0d03('0x49')]));fs[_0x0d03('0x5d')](_0x1c2011);fs[_0x0d03('0x5d')](_0xb213d3);return _0x37e626;})['then'](function(_0x3cd0cb){if(_0x3cd0cb){return _0x574c4b[_0x0d03('0x18')](0xcc)[_0x0d03('0x6a')]();}})[_0x0d03('0x21')](handleEntityNotFound(_0x574c4b,null))[_0x0d03('0x42')](handleError(_0x574c4b,null));}; \ No newline at end of file +var _0xdf72=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','Sound','fieldName','type','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','rawAttributes','keys','find','params','converted_format','join','save_name','Sequelize','ValidationError','Sound\x20not\x20found','download','root','server/files/sounds/converted','format','create','basename','file','originalname','filename','extname','server/files/sounds/original','%s.%s','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','delete','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','crypto','jsforce'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0xdf72,0x155));var _0x2df7=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xdf72[_0x38c652];return _0x218a37;};'use strict';var pdf=require(_0x2df7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2df7('0x1'));var zipdir=require(_0x2df7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2df7('0x3'));var moment=require(_0x2df7('0x4'));var BPromise=require(_0x2df7('0x5'));var Mustache=require(_0x2df7('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2df7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2df7('0x8'));var jsforce=require(_0x2df7('0x9'));var deskjs=require(_0x2df7('0xa'));var toCsv=require(_0x2df7('0x7'));var querystring=require(_0x2df7('0xb'));var Papa=require(_0x2df7('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2df7('0xd'));var as=require(_0x2df7('0xe'));var hardwareService=require(_0x2df7('0xf'));var logger=require(_0x2df7('0x10'))(_0x2df7('0x11'));var utils=require(_0x2df7('0x12'));var config=require(_0x2df7('0x13'));var db=require(_0x2df7('0x14'))['db'];function respondWithStatusCode(_0x4bd23a,_0x55cb12){_0x55cb12=_0x55cb12||0xcc;return function(_0x1f03ea){if(_0x1f03ea){return _0x4bd23a[_0x2df7('0x15')](_0x55cb12);}return _0x4bd23a['status'](_0x55cb12)['end']();};}function respondWithResult(_0x20f593,_0x57f2ce){_0x57f2ce=_0x57f2ce||0xc8;return function(_0x4b36d0){if(_0x4b36d0){return _0x20f593[_0x2df7('0x16')](_0x57f2ce)[_0x2df7('0x17')](_0x4b36d0);}};}function respondWithFilteredResult(_0x13cc45,_0x2607f3){return function(_0x3e4bce){if(_0x3e4bce){var _0x4fa453=_0x3e4bce['count'],_0x1322ca=_0x2607f3[_0x2df7('0x18')],_0x4bae65=_0x2607f3[_0x2df7('0x18')]+_0x2607f3[_0x2df7('0x19')],_0x4777bb;if(_0x4bae65>=_0x4fa453){_0x4bae65=_0x4fa453;_0x4777bb=0xc8;}else{_0x4777bb=0xce;}_0x13cc45['status'](_0x4777bb);return _0x13cc45[_0x2df7('0x1a')](_0x2df7('0x1b'),_0x1322ca+'-'+_0x4bae65+'/'+_0x4fa453)[_0x2df7('0x17')](_0x3e4bce);}return null;};}function patchUpdates(_0x465959){return function(_0xd8c44e){try{jsonpatch[_0x2df7('0x1c')](_0xd8c44e,_0x465959,!![]);}catch(_0x5b71b3){return BPromise['reject'](_0x5b71b3);}return _0xd8c44e['save']();};}function saveUpdates(_0x12b3ea,_0x236ff9){return function(_0x2a446c){if(_0x2a446c){return _0x2a446c['update'](_0x12b3ea)[_0x2df7('0x1d')](function(_0x1805bf){return _0x1805bf;});}return null;};}function removeEntity(_0x89212e,_0xcf3337){return function(_0x32d936){if(_0x32d936){return _0x32d936['destroy']()[_0x2df7('0x1d')](function(){var _0x234a2c=_0x32d936[_0x2df7('0x1e')]({'plain':!![]});var _0x5e421f='Sounds';return db[_0x2df7('0x1f')][_0x2df7('0x20')]({'where':{'type':_0x5e421f,'resourceId':_0x234a2c['id']}})[_0x2df7('0x1d')](function(){return _0x32d936;});})[_0x2df7('0x1d')](function(){_0x89212e[_0x2df7('0x16')](0xcc)[_0x2df7('0x21')]();});}};}function handleEntityNotFound(_0x5a207a,_0x33bbfa){return function(_0x4cc73d){if(!_0x4cc73d){_0x5a207a['sendStatus'](0x194);}return _0x4cc73d;};}function handleError(_0x5bebb9,_0x18a558){_0x18a558=_0x18a558||0x1f4;return function(_0x58d36b){logger[_0x2df7('0x22')](_0x58d36b[_0x2df7('0x23')]);if(_0x58d36b[_0x2df7('0x24')]){delete _0x58d36b[_0x2df7('0x24')];}_0x5bebb9[_0x2df7('0x16')](_0x18a558)[_0x2df7('0x25')](_0x58d36b);};}exports[_0x2df7('0x26')]=function(_0xa12041,_0x2eae65){var _0x244083={},_0x17296d={},_0x54c5c4={'count':0x0,'rows':[]};var _0x43e051=_[_0x2df7('0x27')](db[_0x2df7('0x28')]['rawAttributes'],function(_0x1d3b62){return{'name':_0x1d3b62[_0x2df7('0x29')],'type':_0x1d3b62[_0x2df7('0x2a')]['key']};});_0x17296d['model']=_[_0x2df7('0x27')](_0x43e051,_0x2df7('0x24'));_0x17296d['query']=_['keys'](_0xa12041['query']);_0x17296d[_0x2df7('0x2b')]=_['intersection'](_0x17296d[_0x2df7('0x2c')],_0x17296d[_0x2df7('0x2d')]);_0x244083[_0x2df7('0x2e')]=_[_0x2df7('0x2f')](_0x17296d[_0x2df7('0x2c')],qs[_0x2df7('0x30')](_0xa12041[_0x2df7('0x2d')][_0x2df7('0x30')]));_0x244083['attributes']=_0x244083[_0x2df7('0x2e')][_0x2df7('0x31')]?_0x244083[_0x2df7('0x2e')]:_0x17296d[_0x2df7('0x2c')];if(!_0xa12041[_0x2df7('0x2d')][_0x2df7('0x32')]('nolimit')){_0x244083['limit']=qs['limit'](_0xa12041[_0x2df7('0x2d')][_0x2df7('0x19')]);_0x244083[_0x2df7('0x18')]=qs[_0x2df7('0x18')](_0xa12041['query'][_0x2df7('0x18')]);}_0x244083[_0x2df7('0x33')]=qs[_0x2df7('0x34')](_0xa12041[_0x2df7('0x2d')]['sort']);_0x244083[_0x2df7('0x35')]=qs['filters'](_[_0x2df7('0x36')](_0xa12041[_0x2df7('0x2d')],_0x17296d[_0x2df7('0x2b')]),_0x43e051);if(_0xa12041[_0x2df7('0x2d')][_0x2df7('0x37')]){_0x244083[_0x2df7('0x35')]=_[_0x2df7('0x38')](_0x244083[_0x2df7('0x35')],{'$or':_['map'](_0x43e051,function(_0x234301){if(_0x234301['type']!==_0x2df7('0x39')){var _0xe3372a={};_0xe3372a[_0x234301[_0x2df7('0x24')]]={'$like':'%'+_0xa12041[_0x2df7('0x2d')]['filter']+'%'};return _0xe3372a;}})});}_0x244083=_[_0x2df7('0x38')]({},_0x244083,_0xa12041[_0x2df7('0x3a')]);var _0x4b0e4f={'where':_0x244083['where']};return db[_0x2df7('0x28')][_0x2df7('0x3b')](_0x4b0e4f)[_0x2df7('0x1d')](function(_0x48517b){_0x54c5c4[_0x2df7('0x3b')]=_0x48517b;if(_0xa12041[_0x2df7('0x2d')][_0x2df7('0x3c')]){_0x244083[_0x2df7('0x3d')]=[{'all':!![]}];}return db['Sound']['findAll'](_0x244083);})[_0x2df7('0x1d')](function(_0x4d888d){_0x54c5c4['rows']=_0x4d888d;return _0x54c5c4;})[_0x2df7('0x1d')](respondWithFilteredResult(_0x2eae65,_0x244083))[_0x2df7('0x3e')](handleError(_0x2eae65,null));};exports[_0x2df7('0x3f')]=function(_0xae7331,_0x2fb727){var _0x267878={'raw':!![],'where':{'id':_0xae7331['params']['id']}},_0x512fe4={};_0x512fe4[_0x2df7('0x2c')]=_['keys'](db[_0x2df7('0x28')][_0x2df7('0x40')]);_0x512fe4['query']=_[_0x2df7('0x41')](_0xae7331[_0x2df7('0x2d')]);_0x512fe4[_0x2df7('0x2b')]=_[_0x2df7('0x2f')](_0x512fe4[_0x2df7('0x2c')],_0x512fe4[_0x2df7('0x2d')]);_0x267878[_0x2df7('0x2e')]=_[_0x2df7('0x2f')](_0x512fe4[_0x2df7('0x2c')],qs[_0x2df7('0x30')](_0xae7331['query'][_0x2df7('0x30')]));_0x267878[_0x2df7('0x2e')]=_0x267878[_0x2df7('0x2e')]['length']?_0x267878['attributes']:_0x512fe4[_0x2df7('0x2c')];if(_0xae7331['query'][_0x2df7('0x3c')]){_0x267878['include']=[{'all':!![]}];}_0x267878=_[_0x2df7('0x38')]({},_0x267878,_0xae7331['options']);return db[_0x2df7('0x28')][_0x2df7('0x42')](_0x267878)[_0x2df7('0x1d')](handleEntityNotFound(_0x2fb727,null))[_0x2df7('0x1d')](respondWithResult(_0x2fb727,null))[_0x2df7('0x3e')](handleError(_0x2fb727,null));};exports['download']=function(_0x3de01f,_0x3b1cfa,_0x21d358){return db[_0x2df7('0x28')]['find']({'where':{'id':_0x3de01f[_0x2df7('0x43')]['id']},'attributes':[_0x2df7('0x24'),'save_name',_0x2df7('0x44')],'raw':!![]})[_0x2df7('0x1d')](handleEntityNotFound(_0x3b1cfa,null))[_0x2df7('0x1d')](function(_0x69e59e){if(_0x69e59e){if(!fs['existsSync'](path[_0x2df7('0x45')](config['root'],'server/files/sounds/converted',_0x69e59e[_0x2df7('0x46')]+'.'+_0x69e59e[_0x2df7('0x44')]))){throw new db[(_0x2df7('0x47'))][(_0x2df7('0x48'))](_0x2df7('0x49'));}return _0x3b1cfa[_0x2df7('0x4a')](path[_0x2df7('0x45')](config[_0x2df7('0x4b')],_0x2df7('0x4c'),util[_0x2df7('0x4d')]('%s.%s',_0x69e59e[_0x2df7('0x46')],_0x69e59e[_0x2df7('0x44')])),util['format']('%s.%s',_0x69e59e[_0x2df7('0x24')],_0x69e59e[_0x2df7('0x44')]));}return null;})[_0x2df7('0x3e')](handleError(_0x3b1cfa,null));};exports[_0x2df7('0x4e')]=function(_0x2cc641,_0x5ee59f,_0x521837){var _0x15b45d={'name':path[_0x2df7('0x4f')](_0x2cc641[_0x2df7('0x50')][_0x2df7('0x51')],path['extname'](_0x2cc641['file']['originalname'])),'save_name':path[_0x2df7('0x4f')](_0x2cc641[_0x2df7('0x50')][_0x2df7('0x52')],path['extname'](_0x2cc641[_0x2df7('0x50')][_0x2df7('0x52')])),'original_format':path[_0x2df7('0x53')](_0x2cc641[_0x2df7('0x50')][_0x2df7('0x51')])['substring'](0x1),'converted_format':'wav'};var _0x449a3e=path[_0x2df7('0x45')](config[_0x2df7('0x4b')],_0x2df7('0x54'),_0x2cc641[_0x2df7('0x50')][_0x2df7('0x52')]);var _0x3a493e=path[_0x2df7('0x45')](config[_0x2df7('0x4b')],_0x2df7('0x4c'),util[_0x2df7('0x4d')](_0x2df7('0x55'),path[_0x2df7('0x4f')](_0x2cc641[_0x2df7('0x50')]['filename'],path['extname'](_0x2cc641[_0x2df7('0x50')][_0x2df7('0x52')])),_0x15b45d['converted_format']));logger['info'](_0x2df7('0x56'),_0x449a3e);logger[_0x2df7('0x57')](_0x2df7('0x58'),_0x3a493e);try{fs['chmodSync'](_0x449a3e,parseInt(_0x2df7('0x59'),0x8));var _0x54d12b=sox[_0x2df7('0x5a')](_0x449a3e,_0x3a493e,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x54d12b['on'](_0x2df7('0x22'),function(_0x37f5bf){fs[_0x2df7('0x5b')](_0x449a3e);_0x5ee59f['status'](0x1f4)[_0x2df7('0x25')](_0x37f5bf);});_0x54d12b['on'](_0x2df7('0x5c'),function(_0x1e200b){_0x15b45d[_0x2df7('0x5d')]=isNaN(_0x1e200b[_0x2df7('0x5e')])?null:_0x1e200b[_0x2df7('0x5e')]*0x3e8;_0x15b45d[_0x2df7('0x5f')]=isNaN(_0x1e200b[_0x2df7('0x60')])?null:_0x1e200b[_0x2df7('0x60')];_0x15b45d[_0x2df7('0x61')]=isNaN(_0x1e200b[_0x2df7('0x62')])?null:_0x1e200b[_0x2df7('0x62')];_0x15b45d['original_bitRate']=isNaN(_0x1e200b['bitRate'])?null:_0x1e200b['bitRate'];_0x15b45d[_0x2df7('0x63')]=isNaN(_0x1e200b['sampleRate'])?null:_0x1e200b[_0x2df7('0x64')];});_0x54d12b['on'](_0x2df7('0x65'),function(_0x577ebc){_0x15b45d[_0x2df7('0x66')]=isNaN(_0x577ebc[_0x2df7('0x5e')])?null:_0x577ebc[_0x2df7('0x5e')]*0x3e8;_0x15b45d[_0x2df7('0x67')]=isNaN(_0x577ebc[_0x2df7('0x60')])?null:_0x577ebc[_0x2df7('0x60')];_0x15b45d['converted_channelCount']=isNaN(_0x577ebc['channelCount'])?null:_0x577ebc[_0x2df7('0x62')];_0x15b45d['converted_bitRate']=isNaN(_0x577ebc[_0x2df7('0x68')])?null:_0x577ebc[_0x2df7('0x68')];_0x15b45d[_0x2df7('0x69')]=isNaN(_0x577ebc[_0x2df7('0x64')])?null:_0x577ebc['sampleRate'];});_0x54d12b['on'](_0x2df7('0x21'),function(){fs['chmodSync'](_0x3a493e,parseInt('0777',0x8));return db['Sound'][_0x2df7('0x4e')](_0x15b45d)['then'](function(_0x4739a2){var _0x188b87={'role':_0x2cc641[_0x2df7('0x6a')][_0x2df7('0x6b')],'userProfileId':_0x2cc641[_0x2df7('0x6a')][_0x2df7('0x6c')]};if(!_0x188b87)throw new Error(_0x2df7('0x6d'));if(_0x188b87[_0x2df7('0x6b')]===_0x2df7('0x6e')){var _0x33f5a8=_0x4739a2[_0x2df7('0x1e')]({'plain':!![]});return db[_0x2df7('0x6f')][_0x2df7('0x42')]({'where':{'name':_0x2df7('0x70'),'userProfileId':_0x188b87['userProfileId']},'raw':!![]})[_0x2df7('0x1d')](function(_0xec40b){if(_0xec40b&&_0xec40b[_0x2df7('0x71')]===0x0){return db[_0x2df7('0x1f')]['create']({'name':_0x33f5a8[_0x2df7('0x24')],'resourceId':_0x33f5a8['id'],'type':_0xec40b['name'],'sectionId':_0xec40b['id']},{})[_0x2df7('0x1d')](function(){return _0x4739a2;});}else{return _0x4739a2;}})['catch'](function(_0x3a0de5){logger['error'](_0x2df7('0x72'),_0x3a0de5);throw _0x3a0de5;});}return _0x4739a2;})[_0x2df7('0x1d')](respondWithResult(_0x5ee59f,null))[_0x2df7('0x3e')](handleError(_0x5ee59f,null));});_0x54d12b['start']();}catch(_0x466e08){_0x5ee59f['status'](0x1f4)[_0x2df7('0x25')](_0x466e08);}};exports[_0x2df7('0x73')]=function(_0x42e811,_0x37c3aa,_0x5ee957){return db['Sound'][_0x2df7('0x42')]({'where':{'id':_0x42e811[_0x2df7('0x43')]['id']}})['then'](handleEntityNotFound(_0x37c3aa,null))['then'](saveUpdates(_[_0x2df7('0x36')](_0x42e811[_0x2df7('0x6a')],[_0x2df7('0x24'),'description']),null))[_0x2df7('0x1d')](respondWithResult(_0x37c3aa,null))[_0x2df7('0x3e')](handleError(_0x37c3aa,null));};exports[_0x2df7('0x74')]=function(_0x172e33,_0x4ae0f8,_0x215121){return db['Sound'][_0x2df7('0x42')]({'where':{'id':_0x172e33[_0x2df7('0x43')]['id']}})[_0x2df7('0x1d')](function(_0x16d1fa){if(_0x16d1fa){return _0x16d1fa[_0x2df7('0x20')]();}})[_0x2df7('0x1d')](function(_0x4223b2){var _0x2efa16=path[_0x2df7('0x45')](config[_0x2df7('0x4b')],_0x2df7('0x54'),util[_0x2df7('0x4d')](_0x2df7('0x55'),_0x4223b2['save_name'],_0x4223b2['original_format']));var _0x58b080=path[_0x2df7('0x45')](config[_0x2df7('0x4b')],_0x2df7('0x4c'),util[_0x2df7('0x4d')]('%s.%s',_0x4223b2['save_name'],_0x4223b2[_0x2df7('0x44')]));fs['unlinkSync'](_0x2efa16);fs['unlinkSync'](_0x58b080);return _0x4223b2;})[_0x2df7('0x1d')](function(_0x5e7b54){if(_0x5e7b54){return _0x4ae0f8['status'](0xcc)['end']();}})['then'](handleEntityNotFound(_0x4ae0f8,null))[_0x2df7('0x3e')](handleError(_0x4ae0f8,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 72c254c..253e864 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 _0x7a02=['Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird','path','rimraf','exports','define'];(function(_0x404b24,_0xa0381e){var _0x3aa8fc=function(_0x31f567){while(--_0x31f567){_0x404b24['push'](_0x404b24['shift']());}};_0x3aa8fc(++_0xa0381e);}(_0x7a02,0x120));var _0x27a0=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x7a02[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x27a0('0x0'));var util=require(_0x27a0('0x1'));var logger=require(_0x27a0('0x2'))('api');var moment=require(_0x27a0('0x3'));var BPromise=require(_0x27a0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27a0('0x5'));var rimraf=require(_0x27a0('0x6'));var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x27a0('0x7')]=function(_0xc4508c,_0x444671){return _0xc4508c[_0x27a0('0x8')](_0x27a0('0x9'),attributes,{'tableName':_0x27a0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0597=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','../../config/logger'];(function(_0x576d5b,_0x1b8b7b){var _0x5b1f5e=function(_0xc8aa04){while(--_0xc8aa04){_0x576d5b['push'](_0x576d5b['shift']());}};_0x5b1f5e(++_0x1b8b7b);}(_0x0597,0xd7));var _0x7059=function(_0x1a4904,_0x2ad4c7){_0x1a4904=_0x1a4904-0x0;var _0x365663=_0x0597[_0x1a4904];return _0x365663;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7059('0x0'))(_0x7059('0x1'));var moment=require(_0x7059('0x2'));var BPromise=require(_0x7059('0x3'));var rp=require(_0x7059('0x4'));var fs=require('fs');var path=require(_0x7059('0x5'));var rimraf=require(_0x7059('0x6'));var config=require(_0x7059('0x7'));var attributes=require(_0x7059('0x8'));module[_0x7059('0x9')]=function(_0x1d95c0,_0x5d415e){return _0x1d95c0[_0x7059('0xa')](_0x7059('0xb'),attributes,{'tableName':'tools_sounds','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 c4ed147..bee9ebb 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 _0xe41d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','Sound,\x20%s,\x20%s','find','options','where','attributes','include','map','model','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x441f45,_0x16130c){var _0x2bc267=function(_0x44f8a4){while(--_0x44f8a4){_0x441f45['push'](_0x441f45['shift']());}};_0x2bc267(++_0x16130c);}(_0xe41d,0xef));var _0xde41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe41d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xde41('0x0'));var util=require(_0xde41('0x1'));var moment=require(_0xde41('0x2'));var BPromise=require(_0xde41('0x3'));var rs=require(_0xde41('0x4'));var fs=require('fs');var Redis=require(_0xde41('0x5'));var db=require(_0xde41('0x6'))['db'];var utils=require(_0xde41('0x7'));var logger=require(_0xde41('0x8'))(_0xde41('0x9'));var config=require(_0xde41('0xa'));var jayson=require(_0xde41('0xb'));var client=jayson[_0xde41('0xc')][_0xde41('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3c0e47,_0x1bbeda,_0x342304){return new BPromise(function(_0x2a3141,_0x305ae6){return client[_0xde41('0xe')](_0x3c0e47,_0x342304)[_0xde41('0xf')](function(_0x1c354f){logger[_0xde41('0x10')]('Sound,\x20%s,\x20%s',_0x1bbeda,'request\x20sent');logger[_0xde41('0x11')](_0xde41('0x12'),_0x1bbeda,_0xde41('0x13'),JSON[_0xde41('0x14')](_0x1c354f));if(_0x1c354f['error']){if(_0x1c354f['error'][_0xde41('0x15')]===0x1f4){logger[_0xde41('0x16')]('Sound,\x20%s,\x20%s',_0x1bbeda,_0x1c354f[_0xde41('0x16')][_0xde41('0x17')]);return _0x305ae6(_0x1c354f[_0xde41('0x16')][_0xde41('0x17')]);}logger[_0xde41('0x16')]('Sound,\x20%s,\x20%s',_0x1bbeda,_0x1c354f[_0xde41('0x16')][_0xde41('0x17')]);return _0x2a3141(_0x1c354f[_0xde41('0x16')][_0xde41('0x17')]);}else{logger[_0xde41('0x10')]('Sound,\x20%s,\x20%s',_0x1bbeda,_0xde41('0x13'));_0x2a3141(_0x1c354f[_0xde41('0x18')][_0xde41('0x17')]);}})[_0xde41('0x19')](function(_0x43cd49){logger[_0xde41('0x16')](_0xde41('0x1a'),_0x1bbeda,_0x43cd49);_0x305ae6(_0x43cd49);});});}exports['ShowSound']=function(_0xc6b4d){var _0x52aed2=this;return new Promise(function(_0x37fe31,_0x5d94f1){return db['Sound'][_0xde41('0x1b')]({'raw':_0xc6b4d[_0xde41('0x1c')]?_0xc6b4d[_0xde41('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xc6b4d[_0xde41('0x1c')]?_0xc6b4d[_0xde41('0x1c')][_0xde41('0x1d')]||null:null,'attributes':_0xc6b4d['options']?_0xc6b4d[_0xde41('0x1c')][_0xde41('0x1e')]||null:null,'include':_0xc6b4d['options']?_0xc6b4d['options'][_0xde41('0x1f')]?_[_0xde41('0x20')](_0xc6b4d['options']['include'],function(_0xb066b9){return{'model':db[_0xb066b9[_0xde41('0x21')]],'as':_0xb066b9['as'],'attributes':_0xb066b9['attributes'],'include':_0xb066b9[_0xde41('0x1f')]?_[_0xde41('0x20')](_0xb066b9['include'],function(_0x3ad175){return{'model':db[_0x3ad175[_0xde41('0x21')]],'as':_0x3ad175['as'],'attributes':_0x3ad175['attributes'],'include':_0x3ad175[_0xde41('0x1f')]?_[_0xde41('0x20')](_0x3ad175[_0xde41('0x1f')],function(_0x5b0547){return{'model':db[_0x5b0547[_0xde41('0x21')]],'as':_0x5b0547['as'],'attributes':_0x5b0547[_0xde41('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xde41('0xf')](function(_0x3f6e69){logger[_0xde41('0x10')](_0xde41('0x22'),_0xc6b4d);logger[_0xde41('0x11')]('ShowSound',_0xc6b4d,JSON[_0xde41('0x14')](_0x3f6e69));_0x37fe31(_0x3f6e69);})[_0xde41('0x19')](function(_0x1e8434){logger['error'](_0xde41('0x22'),_0x1e8434[_0xde41('0x17')],_0xc6b4d);_0x5d94f1(_0x52aed2[_0xde41('0x16')](0x1f4,_0x1e8434[_0xde41('0x17')]));});});}; \ No newline at end of file +var _0x951d=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','Sound,\x20%s,\x20%s','result','catch','ShowSound','find','options','raw','where','attributes','map','include','model','util'];(function(_0x3d4e74,_0x21b4e5){var _0x57613d=function(_0x2fa3b3){while(--_0x2fa3b3){_0x3d4e74['push'](_0x3d4e74['shift']());}};_0x57613d(++_0x21b4e5);}(_0x951d,0xe7));var _0xd951=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0x951d[_0x26d6d9];return _0x1b4875;};'use strict';var _=require('lodash');var util=require(_0xd951('0x0'));var moment=require(_0xd951('0x1'));var BPromise=require('bluebird');var rs=require(_0xd951('0x2'));var fs=require('fs');var Redis=require(_0xd951('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd951('0x4'));var logger=require(_0xd951('0x5'))(_0xd951('0x6'));var config=require(_0xd951('0x7'));var jayson=require(_0xd951('0x8'));var client=jayson['client'][_0xd951('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d34fa,_0x3a7e05,_0x44250e){return new BPromise(function(_0x4a29a1,_0x28fff6){return client['request'](_0x3d34fa,_0x44250e)['then'](function(_0x543e21){logger[_0xd951('0xa')]('Sound,\x20%s,\x20%s',_0x3a7e05,_0xd951('0xb'));logger[_0xd951('0xc')](_0xd951('0xd'),_0x3a7e05,_0xd951('0xb'),JSON[_0xd951('0xe')](_0x543e21));if(_0x543e21[_0xd951('0xf')]){if(_0x543e21[_0xd951('0xf')]['code']===0x1f4){logger[_0xd951('0xf')]('Sound,\x20%s,\x20%s',_0x3a7e05,_0x543e21[_0xd951('0xf')][_0xd951('0x10')]);return _0x28fff6(_0x543e21[_0xd951('0xf')]['message']);}logger['error'](_0xd951('0x11'),_0x3a7e05,_0x543e21[_0xd951('0xf')]['message']);return _0x4a29a1(_0x543e21[_0xd951('0xf')][_0xd951('0x10')]);}else{logger[_0xd951('0xa')](_0xd951('0x11'),_0x3a7e05,_0xd951('0xb'));_0x4a29a1(_0x543e21[_0xd951('0x12')][_0xd951('0x10')]);}})[_0xd951('0x13')](function(_0x1cc04d){logger['error'](_0xd951('0x11'),_0x3a7e05,_0x1cc04d);_0x28fff6(_0x1cc04d);});});}exports[_0xd951('0x14')]=function(_0x5a402c){var _0x4cb79f=this;return new Promise(function(_0x57141d,_0x2df2fb){return db['Sound'][_0xd951('0x15')]({'raw':_0x5a402c[_0xd951('0x16')]?_0x5a402c[_0xd951('0x16')][_0xd951('0x17')]===undefined?!![]:![]:!![],'where':_0x5a402c[_0xd951('0x16')]?_0x5a402c['options'][_0xd951('0x18')]||null:null,'attributes':_0x5a402c[_0xd951('0x16')]?_0x5a402c[_0xd951('0x16')][_0xd951('0x19')]||null:null,'include':_0x5a402c[_0xd951('0x16')]?_0x5a402c['options']['include']?_[_0xd951('0x1a')](_0x5a402c['options'][_0xd951('0x1b')],function(_0x4eef28){return{'model':db[_0x4eef28['model']],'as':_0x4eef28['as'],'attributes':_0x4eef28['attributes'],'include':_0x4eef28['include']?_[_0xd951('0x1a')](_0x4eef28[_0xd951('0x1b')],function(_0x105a63){return{'model':db[_0x105a63[_0xd951('0x1c')]],'as':_0x105a63['as'],'attributes':_0x105a63['attributes'],'include':_0x105a63[_0xd951('0x1b')]?_['map'](_0x105a63['include'],function(_0x39d321){return{'model':db[_0x39d321[_0xd951('0x1c')]],'as':_0x39d321['as'],'attributes':_0x39d321[_0xd951('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4876a2){logger[_0xd951('0xa')](_0xd951('0x14'),_0x5a402c);logger[_0xd951('0xc')](_0xd951('0x14'),_0x5a402c,JSON['stringify'](_0x4876a2));_0x57141d(_0x4876a2);})[_0xd951('0x13')](function(_0x29e5cb){logger[_0xd951('0xf')](_0xd951('0x14'),_0x29e5cb[_0xd951('0x10')],_0x5a402c);_0x2df2fb(_0x4cb79f[_0xd951('0xf')](0x1f4,_0x29e5cb['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 298212e..f1d6ea9 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 _0xf7e8=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0xeddcc1,_0x4fcde1){var _0x515ed8=function(_0xcf42f1){while(--_0xcf42f1){_0xeddcc1['push'](_0xeddcc1['shift']());}};_0x515ed8(++_0x4fcde1);}(_0xf7e8,0x144));var _0x8f7e=function(_0x339540,_0x14b5b4){_0x339540=_0x339540-0x0;var _0x53096f=_0xf7e8[_0x339540];return _0x53096f;};'use strict';var multer=require(_0x8f7e('0x0'));var util=require(_0x8f7e('0x1'));var path=require(_0x8f7e('0x2'));var timeout=require(_0x8f7e('0x3'));var express=require('express');var router=express[_0x8f7e('0x4')]();var auth=require(_0x8f7e('0x5'));var interaction=require(_0x8f7e('0x6'));var config=require('../../config/environment');var controller=require(_0x8f7e('0x7'));router[_0x8f7e('0x8')]('/',auth[_0x8f7e('0x9')](),controller[_0x8f7e('0xa')]);router[_0x8f7e('0x8')](_0x8f7e('0xb'),auth[_0x8f7e('0x9')](),controller[_0x8f7e('0xc')]);router[_0x8f7e('0xd')]('/',auth['isAuthenticated'](),controller[_0x8f7e('0xe')]);router[_0x8f7e('0xf')]('/:id',auth[_0x8f7e('0x9')](),controller[_0x8f7e('0x10')]);router[_0x8f7e('0x11')](_0x8f7e('0xb'),auth[_0x8f7e('0x9')](),controller[_0x8f7e('0x12')]);module[_0x8f7e('0x13')]=router; \ No newline at end of file +var _0xb37e=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','util'];(function(_0x419e67,_0x31e145){var _0x5f0945=function(_0x27ffcd){while(--_0x27ffcd){_0x419e67['push'](_0x419e67['shift']());}};_0x5f0945(++_0x31e145);}(_0xb37e,0x167));var _0xeb37=function(_0x1fc5f0,_0x3b1425){_0x1fc5f0=_0x1fc5f0-0x0;var _0x3fff72=_0xb37e[_0x1fc5f0];return _0x3fff72;};'use strict';var multer=require('multer');var util=require(_0xeb37('0x0'));var path=require(_0xeb37('0x1'));var timeout=require(_0xeb37('0x2'));var express=require(_0xeb37('0x3'));var router=express[_0xeb37('0x4')]();var auth=require(_0xeb37('0x5'));var interaction=require(_0xeb37('0x6'));var config=require(_0xeb37('0x7'));var controller=require(_0xeb37('0x8'));router['get']('/',auth[_0xeb37('0x9')](),controller[_0xeb37('0xa')]);router[_0xeb37('0xb')](_0xeb37('0xc'),auth[_0xeb37('0x9')](),controller[_0xeb37('0xd')]);router['post']('/',auth[_0xeb37('0x9')](),controller[_0xeb37('0xe')]);router[_0xeb37('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xeb37('0x10')]);router[_0xeb37('0x11')]('/:id',auth[_0xeb37('0x9')](),controller[_0xeb37('0x12')]);module[_0xeb37('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 1f4d48a..d5d5a09 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 _0x6be0=['exports','STRING','TEXT','medium','out'];(function(_0xd006e7,_0x329238){var _0x3d01aa=function(_0x30c005){while(--_0x30c005){_0xd006e7['push'](_0xd006e7['shift']());}};_0x3d01aa(++_0x329238);}(_0x6be0,0xf0));var _0x06be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x06be('0x0')]={'uniqueid':{'type':Sequelize[_0x06be('0x1')]},'body':{'type':Sequelize[_0x06be('0x2')](_0x06be('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x06be('0x4')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file +var _0x4aaa=['TEXT','sequelize','exports','STRING'];(function(_0x4236da,_0x1dce55){var _0x3b5b84=function(_0x309d64){while(--_0x309d64){_0x4236da['push'](_0x4236da['shift']());}};_0x3b5b84(++_0x1dce55);}(_0x4aaa,0x16d));var _0xa4aa=function(_0x490615,_0x162c9c){_0x490615=_0x490615-0x0;var _0x35a774=_0x4aaa[_0x490615];return _0x35a774;};'use strict';var Sequelize=require(_0xa4aa('0x0'));module[_0xa4aa('0x1')]={'uniqueid':{'type':Sequelize[_0xa4aa('0x2')]},'body':{'type':Sequelize[_0xa4aa('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index d0f58ba..4578ffe 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 _0x0406=['rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','params','find','create','catch','update','body','html-pdf','eml-format'];(function(_0x2df0e1,_0x39a652){var _0x286574=function(_0x7fb39b){while(--_0x7fb39b){_0x2df0e1['push'](_0x2df0e1['shift']());}};_0x286574(++_0x39a652);}(_0x0406,0x1e8));var _0x6040=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0406[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x6040('0x0'));var emlformat=require(_0x6040('0x1'));var rimraf=require(_0x6040('0x2'));var zipdir=require(_0x6040('0x3'));var jsonpatch=require(_0x6040('0x4'));var rp=require(_0x6040('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6040('0x6'));var path=require(_0x6040('0x7'));var sox=require(_0x6040('0x8'));var csv=require(_0x6040('0x9'));var ejs=require(_0x6040('0xa'));var fs=require('fs');var _=require(_0x6040('0xb'));var squel=require('squel');var crypto=require(_0x6040('0xc'));var jsforce=require(_0x6040('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6040('0x9'));var querystring=require(_0x6040('0xe'));var Papa=require('papaparse');var Redis=require(_0x6040('0xf'));var authService=require(_0x6040('0x10'));var qs=require(_0x6040('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6040('0x12'))('api');var utils=require(_0x6040('0x13'));var config=require(_0x6040('0x14'));var db=require(_0x6040('0x15'))['db'];function respondWithStatusCode(_0x2fcbb3,_0xc4fa23){_0xc4fa23=_0xc4fa23||0xcc;return function(_0x25ac79){if(_0x25ac79){return _0x2fcbb3[_0x6040('0x16')](_0xc4fa23);}return _0x2fcbb3['status'](_0xc4fa23)[_0x6040('0x17')]();};}function respondWithResult(_0x877e46,_0x302662){_0x302662=_0x302662||0xc8;return function(_0x4245bd){if(_0x4245bd){return _0x877e46[_0x6040('0x18')](_0x302662)[_0x6040('0x19')](_0x4245bd);}};}function respondWithFilteredResult(_0x49c765,_0xafb1f3){return function(_0x18d912){if(_0x18d912){var _0x40505d=_0x18d912[_0x6040('0x1a')],_0x28314c=_0xafb1f3['offset'],_0xd11874=_0xafb1f3[_0x6040('0x1b')]+_0xafb1f3[_0x6040('0x1c')],_0x35fbc3;if(_0xd11874>=_0x40505d){_0xd11874=_0x40505d;_0x35fbc3=0xc8;}else{_0x35fbc3=0xce;}_0x49c765[_0x6040('0x18')](_0x35fbc3);return _0x49c765[_0x6040('0x1d')](_0x6040('0x1e'),_0x28314c+'-'+_0xd11874+'/'+_0x40505d)['json'](_0x18d912);}return null;};}function patchUpdates(_0x162f4c){return function(_0x407574){try{jsonpatch['apply'](_0x407574,_0x162f4c,!![]);}catch(_0x4d2667){return BPromise[_0x6040('0x1f')](_0x4d2667);}return _0x407574[_0x6040('0x20')]();};}function saveUpdates(_0x1b15e9,_0x298252){return function(_0x70ca2c){if(_0x70ca2c){return _0x70ca2c['update'](_0x1b15e9)[_0x6040('0x21')](function(_0x4929f0){return _0x4929f0;});}return null;};}function removeEntity(_0x1cad36,_0x2dea37){return function(_0x1b5adb){if(_0x1b5adb){return _0x1b5adb[_0x6040('0x22')]()[_0x6040('0x21')](function(){_0x1cad36[_0x6040('0x18')](0xcc)[_0x6040('0x17')]();});}};}function handleEntityNotFound(_0x1451ee,_0x6ab6e8){return function(_0xb2d265){if(!_0xb2d265){_0x1451ee['sendStatus'](0x194);}return _0xb2d265;};}function handleError(_0x3be48c,_0x131fa8){_0x131fa8=_0x131fa8||0x1f4;return function(_0x424a89){logger[_0x6040('0x23')](_0x424a89['stack']);if(_0x424a89[_0x6040('0x24')]){delete _0x424a89[_0x6040('0x24')];}_0x3be48c['status'](_0x131fa8)[_0x6040('0x25')](_0x424a89);};}exports['index']=function(_0x3f462d,_0x48a4af){var _0x420cd2={},_0x3fbc16={},_0x3aaa03={'count':0x0,'rows':[]};var _0x25c002=_[_0x6040('0x26')](db[_0x6040('0x27')][_0x6040('0x28')],function(_0x3bfb6b){return{'name':_0x3bfb6b[_0x6040('0x29')],'type':_0x3bfb6b[_0x6040('0x2a')][_0x6040('0x2b')]};});_0x3fbc16[_0x6040('0x2c')]=_[_0x6040('0x26')](_0x25c002,'name');_0x3fbc16[_0x6040('0x2d')]=_[_0x6040('0x2e')](_0x3f462d['query']);_0x3fbc16[_0x6040('0x2f')]=_[_0x6040('0x30')](_0x3fbc16[_0x6040('0x2c')],_0x3fbc16[_0x6040('0x2d')]);_0x420cd2['attributes']=_[_0x6040('0x30')](_0x3fbc16['model'],qs[_0x6040('0x31')](_0x3f462d['query'][_0x6040('0x31')]));_0x420cd2[_0x6040('0x32')]=_0x420cd2[_0x6040('0x32')][_0x6040('0x33')]?_0x420cd2[_0x6040('0x32')]:_0x3fbc16[_0x6040('0x2c')];if(!_0x3f462d[_0x6040('0x2d')][_0x6040('0x34')](_0x6040('0x35'))){_0x420cd2[_0x6040('0x1c')]=qs[_0x6040('0x1c')](_0x3f462d[_0x6040('0x2d')][_0x6040('0x1c')]);_0x420cd2['offset']=qs[_0x6040('0x1b')](_0x3f462d['query'][_0x6040('0x1b')]);}_0x420cd2[_0x6040('0x36')]=qs[_0x6040('0x37')](_0x3f462d['query'][_0x6040('0x37')]);_0x420cd2[_0x6040('0x38')]=qs[_0x6040('0x2f')](_[_0x6040('0x39')](_0x3f462d[_0x6040('0x2d')],_0x3fbc16['filters']),_0x25c002);if(_0x3f462d['query'][_0x6040('0x3a')]){_0x420cd2[_0x6040('0x38')]=_['merge'](_0x420cd2[_0x6040('0x38')],{'$or':_[_0x6040('0x26')](_0x25c002,function(_0xef2ecc){if(_0xef2ecc[_0x6040('0x2a')]!==_0x6040('0x3b')){var _0x22325f={};_0x22325f[_0xef2ecc[_0x6040('0x24')]]={'$like':'%'+_0x3f462d['query']['filter']+'%'};return _0x22325f;}})});}_0x420cd2=_[_0x6040('0x3c')]({},_0x420cd2,_0x3f462d[_0x6040('0x3d')]);var _0x4c924c={'where':_0x420cd2['where']};return db['SquareMessage'][_0x6040('0x1a')](_0x4c924c)[_0x6040('0x21')](function(_0xd1126e){_0x3aaa03[_0x6040('0x1a')]=_0xd1126e;if(_0x3f462d[_0x6040('0x2d')]['includeAll']){_0x420cd2[_0x6040('0x3e')]=[{'all':!![]}];}return db[_0x6040('0x27')][_0x6040('0x3f')](_0x420cd2);})[_0x6040('0x21')](function(_0x5ced06){_0x3aaa03['rows']=_0x5ced06;return _0x3aaa03;})[_0x6040('0x21')](respondWithFilteredResult(_0x48a4af,_0x420cd2))['catch'](handleError(_0x48a4af,null));};exports['show']=function(_0x1df924,_0x526c16){var _0xe93e3={'raw':!![],'where':{'id':_0x1df924[_0x6040('0x40')]['id']}},_0x2ed3e8={};_0x2ed3e8['model']=_[_0x6040('0x2e')](db['SquareMessage']['rawAttributes']);_0x2ed3e8[_0x6040('0x2d')]=_[_0x6040('0x2e')](_0x1df924[_0x6040('0x2d')]);_0x2ed3e8[_0x6040('0x2f')]=_[_0x6040('0x30')](_0x2ed3e8[_0x6040('0x2c')],_0x2ed3e8[_0x6040('0x2d')]);_0xe93e3['attributes']=_[_0x6040('0x30')](_0x2ed3e8[_0x6040('0x2c')],qs['fields'](_0x1df924[_0x6040('0x2d')][_0x6040('0x31')]));_0xe93e3['attributes']=_0xe93e3[_0x6040('0x32')][_0x6040('0x33')]?_0xe93e3['attributes']:_0x2ed3e8['model'];if(_0x1df924['query']['includeAll']){_0xe93e3[_0x6040('0x3e')]=[{'all':!![]}];}_0xe93e3=_[_0x6040('0x3c')]({},_0xe93e3,_0x1df924[_0x6040('0x3d')]);return db['SquareMessage'][_0x6040('0x41')](_0xe93e3)[_0x6040('0x21')](handleEntityNotFound(_0x526c16,null))[_0x6040('0x21')](respondWithResult(_0x526c16,null))['catch'](handleError(_0x526c16,null));};exports[_0x6040('0x42')]=function(_0x5f1995,_0x403e5c){return db['SquareMessage'][_0x6040('0x42')](_0x5f1995['body'],{})[_0x6040('0x21')](respondWithResult(_0x403e5c,0xc9))[_0x6040('0x43')](handleError(_0x403e5c,null));};exports[_0x6040('0x44')]=function(_0x12f71d,_0x586db5){if(_0x12f71d[_0x6040('0x45')]['id']){delete _0x12f71d[_0x6040('0x45')]['id'];}return db[_0x6040('0x27')][_0x6040('0x41')]({'where':{'id':_0x12f71d[_0x6040('0x40')]['id']}})['then'](handleEntityNotFound(_0x586db5,null))['then'](saveUpdates(_0x12f71d[_0x6040('0x45')],null))[_0x6040('0x21')](respondWithResult(_0x586db5,null))['catch'](handleError(_0x586db5,null));};exports[_0x6040('0x22')]=function(_0x3f48d0,_0x301722){return db['SquareMessage']['find']({'where':{'id':_0x3f48d0[_0x6040('0x40')]['id']}})[_0x6040('0x21')](handleEntityNotFound(_0x301722,null))[_0x6040('0x21')](removeEntity(_0x301722,null))[_0x6040('0x43')](handleError(_0x301722,null));}; \ No newline at end of file +var _0x277e=['Content-Range','apply','save','update','destroy','error','stack','name','send','index','map','SquareMessage','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','create','body','find','html-pdf','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','set'];(function(_0x4896cd,_0x5d5055){var _0x339b5c=function(_0x4994c2){while(--_0x4994c2){_0x4896cd['push'](_0x4896cd['shift']());}};_0x339b5c(++_0x5d5055);}(_0x277e,0xc0));var _0xe277=function(_0x5f5317,_0x225861){_0x5f5317=_0x5f5317-0x0;var _0x485022=_0x277e[_0x5f5317];return _0x485022;};'use strict';var pdf=require(_0xe277('0x0'));var emlformat=require(_0xe277('0x1'));var rimraf=require(_0xe277('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe277('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe277('0x4'));var util=require(_0xe277('0x5'));var path=require(_0xe277('0x6'));var sox=require(_0xe277('0x7'));var csv=require(_0xe277('0x8'));var ejs=require(_0xe277('0x9'));var fs=require('fs');var _=require(_0xe277('0xa'));var squel=require(_0xe277('0xb'));var crypto=require(_0xe277('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe277('0xd'));var toCsv=require(_0xe277('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe277('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe277('0xf'));var hardwareService=require(_0xe277('0x10'));var logger=require(_0xe277('0x11'))(_0xe277('0x12'));var utils=require(_0xe277('0x13'));var config=require(_0xe277('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x80f901,_0xa3c9db){_0xa3c9db=_0xa3c9db||0xcc;return function(_0x6a76d4){if(_0x6a76d4){return _0x80f901[_0xe277('0x15')](_0xa3c9db);}return _0x80f901[_0xe277('0x16')](_0xa3c9db)[_0xe277('0x17')]();};}function respondWithResult(_0x27dc55,_0x2f1d2b){_0x2f1d2b=_0x2f1d2b||0xc8;return function(_0x467004){if(_0x467004){return _0x27dc55['status'](_0x2f1d2b)[_0xe277('0x18')](_0x467004);}};}function respondWithFilteredResult(_0x25c70a,_0x347412){return function(_0x1e621a){if(_0x1e621a){var _0x26c891=_0x1e621a[_0xe277('0x19')],_0x3829b2=_0x347412['offset'],_0x386304=_0x347412['offset']+_0x347412['limit'],_0xb329ca;if(_0x386304>=_0x26c891){_0x386304=_0x26c891;_0xb329ca=0xc8;}else{_0xb329ca=0xce;}_0x25c70a[_0xe277('0x16')](_0xb329ca);return _0x25c70a[_0xe277('0x1a')](_0xe277('0x1b'),_0x3829b2+'-'+_0x386304+'/'+_0x26c891)['json'](_0x1e621a);}return null;};}function patchUpdates(_0x3212e6){return function(_0x296aff){try{jsonpatch[_0xe277('0x1c')](_0x296aff,_0x3212e6,!![]);}catch(_0x337ab1){return BPromise['reject'](_0x337ab1);}return _0x296aff[_0xe277('0x1d')]();};}function saveUpdates(_0x16776a,_0x33d385){return function(_0x3fb837){if(_0x3fb837){return _0x3fb837[_0xe277('0x1e')](_0x16776a)['then'](function(_0x532461){return _0x532461;});}return null;};}function removeEntity(_0x291611,_0x197a06){return function(_0x4413d6){if(_0x4413d6){return _0x4413d6[_0xe277('0x1f')]()['then'](function(){_0x291611[_0xe277('0x16')](0xcc)[_0xe277('0x17')]();});}};}function handleEntityNotFound(_0xde73e9,_0x516b09){return function(_0xe61701){if(!_0xe61701){_0xde73e9[_0xe277('0x15')](0x194);}return _0xe61701;};}function handleError(_0x472c9f,_0x35512c){_0x35512c=_0x35512c||0x1f4;return function(_0x196d23){logger[_0xe277('0x20')](_0x196d23[_0xe277('0x21')]);if(_0x196d23[_0xe277('0x22')]){delete _0x196d23[_0xe277('0x22')];}_0x472c9f['status'](_0x35512c)[_0xe277('0x23')](_0x196d23);};}exports[_0xe277('0x24')]=function(_0x4f2028,_0x5ec978){var _0x232efa={},_0x2377cc={},_0x837080={'count':0x0,'rows':[]};var _0x1f617c=_[_0xe277('0x25')](db[_0xe277('0x26')]['rawAttributes'],function(_0x396640){return{'name':_0x396640[_0xe277('0x27')],'type':_0x396640['type'][_0xe277('0x28')]};});_0x2377cc[_0xe277('0x29')]=_[_0xe277('0x25')](_0x1f617c,'name');_0x2377cc[_0xe277('0x2a')]=_[_0xe277('0x2b')](_0x4f2028[_0xe277('0x2a')]);_0x2377cc[_0xe277('0x2c')]=_[_0xe277('0x2d')](_0x2377cc[_0xe277('0x29')],_0x2377cc['query']);_0x232efa['attributes']=_['intersection'](_0x2377cc['model'],qs[_0xe277('0x2e')](_0x4f2028[_0xe277('0x2a')][_0xe277('0x2e')]));_0x232efa[_0xe277('0x2f')]=_0x232efa[_0xe277('0x2f')][_0xe277('0x30')]?_0x232efa[_0xe277('0x2f')]:_0x2377cc[_0xe277('0x29')];if(!_0x4f2028[_0xe277('0x2a')][_0xe277('0x31')](_0xe277('0x32'))){_0x232efa['limit']=qs[_0xe277('0x33')](_0x4f2028[_0xe277('0x2a')]['limit']);_0x232efa[_0xe277('0x34')]=qs[_0xe277('0x34')](_0x4f2028[_0xe277('0x2a')][_0xe277('0x34')]);}_0x232efa[_0xe277('0x35')]=qs[_0xe277('0x36')](_0x4f2028[_0xe277('0x2a')][_0xe277('0x36')]);_0x232efa[_0xe277('0x37')]=qs['filters'](_[_0xe277('0x38')](_0x4f2028[_0xe277('0x2a')],_0x2377cc[_0xe277('0x2c')]),_0x1f617c);if(_0x4f2028['query'][_0xe277('0x39')]){_0x232efa[_0xe277('0x37')]=_[_0xe277('0x3a')](_0x232efa[_0xe277('0x37')],{'$or':_[_0xe277('0x25')](_0x1f617c,function(_0xe266aa){if(_0xe266aa[_0xe277('0x3b')]!==_0xe277('0x3c')){var _0x190e7d={};_0x190e7d[_0xe266aa['name']]={'$like':'%'+_0x4f2028['query'][_0xe277('0x39')]+'%'};return _0x190e7d;}})});}_0x232efa=_['merge']({},_0x232efa,_0x4f2028[_0xe277('0x3d')]);var _0x2e575e={'where':_0x232efa[_0xe277('0x37')]};return db[_0xe277('0x26')][_0xe277('0x19')](_0x2e575e)[_0xe277('0x3e')](function(_0x31598d){_0x837080[_0xe277('0x19')]=_0x31598d;if(_0x4f2028[_0xe277('0x2a')][_0xe277('0x3f')]){_0x232efa[_0xe277('0x40')]=[{'all':!![]}];}return db[_0xe277('0x26')][_0xe277('0x41')](_0x232efa);})[_0xe277('0x3e')](function(_0x29075b){_0x837080[_0xe277('0x42')]=_0x29075b;return _0x837080;})[_0xe277('0x3e')](respondWithFilteredResult(_0x5ec978,_0x232efa))[_0xe277('0x43')](handleError(_0x5ec978,null));};exports[_0xe277('0x44')]=function(_0x2e2256,_0x126fa2){var _0x36a8e2={'raw':!![],'where':{'id':_0x2e2256[_0xe277('0x45')]['id']}},_0x8bc858={};_0x8bc858[_0xe277('0x29')]=_[_0xe277('0x2b')](db[_0xe277('0x26')]['rawAttributes']);_0x8bc858[_0xe277('0x2a')]=_[_0xe277('0x2b')](_0x2e2256[_0xe277('0x2a')]);_0x8bc858[_0xe277('0x2c')]=_['intersection'](_0x8bc858['model'],_0x8bc858[_0xe277('0x2a')]);_0x36a8e2['attributes']=_[_0xe277('0x2d')](_0x8bc858[_0xe277('0x29')],qs[_0xe277('0x2e')](_0x2e2256[_0xe277('0x2a')][_0xe277('0x2e')]));_0x36a8e2['attributes']=_0x36a8e2[_0xe277('0x2f')]['length']?_0x36a8e2[_0xe277('0x2f')]:_0x8bc858[_0xe277('0x29')];if(_0x2e2256[_0xe277('0x2a')][_0xe277('0x3f')]){_0x36a8e2[_0xe277('0x40')]=[{'all':!![]}];}_0x36a8e2=_[_0xe277('0x3a')]({},_0x36a8e2,_0x2e2256[_0xe277('0x3d')]);return db[_0xe277('0x26')]['find'](_0x36a8e2)[_0xe277('0x3e')](handleEntityNotFound(_0x126fa2,null))[_0xe277('0x3e')](respondWithResult(_0x126fa2,null))[_0xe277('0x43')](handleError(_0x126fa2,null));};exports[_0xe277('0x46')]=function(_0x979349,_0x4584d6){return db[_0xe277('0x26')][_0xe277('0x46')](_0x979349[_0xe277('0x47')],{})[_0xe277('0x3e')](respondWithResult(_0x4584d6,0xc9))[_0xe277('0x43')](handleError(_0x4584d6,null));};exports['update']=function(_0x5b2214,_0x289c92){if(_0x5b2214[_0xe277('0x47')]['id']){delete _0x5b2214['body']['id'];}return db[_0xe277('0x26')][_0xe277('0x48')]({'where':{'id':_0x5b2214[_0xe277('0x45')]['id']}})[_0xe277('0x3e')](handleEntityNotFound(_0x289c92,null))[_0xe277('0x3e')](saveUpdates(_0x5b2214[_0xe277('0x47')],null))[_0xe277('0x3e')](respondWithResult(_0x289c92,null))['catch'](handleError(_0x289c92,null));};exports[_0xe277('0x1f')]=function(_0x20ad72,_0x1fedbd){return db[_0xe277('0x26')]['find']({'where':{'id':_0x20ad72['params']['id']}})[_0xe277('0x3e')](handleEntityNotFound(_0x1fedbd,null))[_0xe277('0x3e')](removeEntity(_0x1fedbd,null))[_0xe277('0x43')](handleError(_0x1fedbd,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index fb171f4..07872f2 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 _0x814b=['define','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareMessage.attributes','exports'];(function(_0x23e8c5,_0x166081){var _0x1b9922=function(_0x539bec){while(--_0x539bec){_0x23e8c5['push'](_0x23e8c5['shift']());}};_0x1b9922(++_0x166081);}(_0x814b,0x1a2));var _0xb814=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x814b[_0x2431d6];return _0x4d0f9b;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['square_messages','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage'];(function(_0x1dbf06,_0x59141d){var _0x35c421=function(_0x1160b7){while(--_0x1160b7){_0x1dbf06['push'](_0x1dbf06['shift']());}};_0x35c421(++_0x59141d);}(_0x326f,0xd1));var _0xf326=function(_0x45e451,_0x520167){_0x45e451=_0x45e451-0x0;var _0xf9fa37=_0x326f[_0x45e451];return _0xf9fa37;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 0fc9f27..625cd44 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 _0xffd6=['SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareMessage','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x2059df,_0x367401){var _0xdd848b=function(_0x13055b){while(--_0x13055b){_0x2059df['push'](_0x2059df['shift']());}};_0xdd848b(++_0x367401);}(_0xffd6,0x97));var _0x6ffd=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xffd6[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('SquareMessage,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}exports[_0x6ffd('0x16')]=function(_0x889a4b){var _0x545576=this;return new Promise(function(_0x11a609,_0x56c541){return db['SquareMessage'][_0x6ffd('0x17')](_0x889a4b[_0x6ffd('0x18')],{'raw':_0x889a4b['options']?_0x889a4b[_0x6ffd('0x19')][_0x6ffd('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x564a11){logger[_0x6ffd('0x13')](_0x6ffd('0x16'),_0x889a4b);logger['debug'](_0x6ffd('0x16'),_0x889a4b,JSON[_0x6ffd('0xf')](_0x564a11));_0x11a609(_0x564a11);})[_0x6ffd('0x15')](function(_0x53128a){logger[_0x6ffd('0x10')](_0x6ffd('0x16'),_0x53128a['message'],_0x889a4b);_0x56c541(_0x545576[_0x6ffd('0x10')](0x1f4,_0x53128a[_0x6ffd('0x12')]));});});}; \ No newline at end of file +var _0x7eff=['../../config/logger','jayson/promise','client','http','then','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','CreateSquareMessage','SquareMessage','body','options','raw','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5ee5fb,_0x32031b){var _0x19cb60=function(_0x448bcf){while(--_0x448bcf){_0x5ee5fb['push'](_0x5ee5fb['shift']());}};_0x19cb60(++_0x32031b);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf7ef('0x0'));var moment=require(_0xf7ef('0x1'));var BPromise=require(_0xf7ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7ef('0x3'));var db=require(_0xf7ef('0x4'))['db'];var utils=require(_0xf7ef('0x5'));var logger=require(_0xf7ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7ef('0x7'));var client=jayson[_0xf7ef('0x8')][_0xf7ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21eb16,_0x4f08b0,_0xcf20c7){return new BPromise(function(_0x1022af,_0xd8bc8d){return client['request'](_0x21eb16,_0xcf20c7)[_0xf7ef('0xa')](function(_0x116448){logger['info'](_0xf7ef('0xb'),_0x4f08b0,'request\x20sent');logger['debug'](_0xf7ef('0xc'),_0x4f08b0,'request\x20sent',JSON[_0xf7ef('0xd')](_0x116448));if(_0x116448['error']){if(_0x116448['error']['code']===0x1f4){logger[_0xf7ef('0xe')]('SquareMessage,\x20%s,\x20%s',_0x4f08b0,_0x116448['error']['message']);return _0xd8bc8d(_0x116448[_0xf7ef('0xe')][_0xf7ef('0xf')]);}logger[_0xf7ef('0xe')](_0xf7ef('0xb'),_0x4f08b0,_0x116448['error'][_0xf7ef('0xf')]);return _0x1022af(_0x116448['error'][_0xf7ef('0xf')]);}else{logger[_0xf7ef('0x10')]('SquareMessage,\x20%s,\x20%s',_0x4f08b0,_0xf7ef('0x11'));_0x1022af(_0x116448['result'][_0xf7ef('0xf')]);}})[_0xf7ef('0x12')](function(_0x1695c1){logger[_0xf7ef('0xe')](_0xf7ef('0xb'),_0x4f08b0,_0x1695c1);_0xd8bc8d(_0x1695c1);});});}exports[_0xf7ef('0x13')]=function(_0x466612){var _0x514e73=this;return new Promise(function(_0x4fa0c6,_0x4bc8ff){return db[_0xf7ef('0x14')]['create'](_0x466612[_0xf7ef('0x15')],{'raw':_0x466612[_0xf7ef('0x16')]?_0x466612[_0xf7ef('0x16')][_0xf7ef('0x17')]===undefined?!![]:![]:!![]})[_0xf7ef('0xa')](function(_0x29cbf1){logger['info']('CreateSquareMessage',_0x466612);logger['debug'](_0xf7ef('0x13'),_0x466612,JSON[_0xf7ef('0xd')](_0x29cbf1));_0x4fa0c6(_0x29cbf1);})[_0xf7ef('0x12')](function(_0x20c27b){logger['error']('CreateSquareMessage',_0x20c27b[_0xf7ef('0xf')],_0x466612);_0x4bc8ff(_0x514e73[_0xf7ef('0xe')](0x1f4,_0x20c27b[_0xf7ef('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 80c686b..08c7223 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 _0x5fdd=['index','/:id','show','/:id/test','15s','create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x2f39b9,_0x3d3156){var _0x337a30=function(_0x596914){while(--_0x596914){_0x2f39b9['push'](_0x2f39b9['shift']());}};_0x337a30(++_0x3d3156);}(_0x5fdd,0x16f));var _0xd5fd=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x5fdd[_0x95942];return _0x6d7f81;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd5fd('0x0'));var timeout=require(_0xd5fd('0x1'));var express=require('express');var router=express[_0xd5fd('0x2')]();var auth=require(_0xd5fd('0x3'));var interaction=require(_0xd5fd('0x4'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xd5fd('0x5')]('/',auth[_0xd5fd('0x6')](),controller[_0xd5fd('0x7')]);router['get'](_0xd5fd('0x8'),auth[_0xd5fd('0x6')](),controller[_0xd5fd('0x9')]);router[_0xd5fd('0x5')](_0xd5fd('0xa'),auth['isAuthenticated'](),timeout(_0xd5fd('0xb')),controller['test']);router['post']('/',auth['isAuthenticated'](),controller[_0xd5fd('0xc')]);router[_0xd5fd('0xd')](_0xd5fd('0x8'),auth[_0xd5fd('0x6')](),controller[_0xd5fd('0xe')]);router[_0xd5fd('0xf')](_0xd5fd('0x8'),auth[_0xd5fd('0x6')](),controller[_0xd5fd('0x10')]);module['exports']=router; \ No newline at end of file +var _0xda73=['get','/:id','isAuthenticated','show','15s','post','create','update','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller'];(function(_0x540518,_0x358aee){var _0x2f1224=function(_0x427191){while(--_0x427191){_0x540518['push'](_0x540518['shift']());}};_0x2f1224(++_0x358aee);}(_0xda73,0x160));var _0x3da7=function(_0x1e1064,_0x1dbc3b){_0x1e1064=_0x1e1064-0x0;var _0x253ec4=_0xda73[_0x1e1064];return _0x253ec4;};'use strict';var multer=require(_0x3da7('0x0'));var util=require(_0x3da7('0x1'));var path=require(_0x3da7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3da7('0x3')]();var auth=require(_0x3da7('0x4'));var interaction=require(_0x3da7('0x5'));var config=require(_0x3da7('0x6'));var controller=require(_0x3da7('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3da7('0x8')](_0x3da7('0x9'),auth[_0x3da7('0xa')](),controller[_0x3da7('0xb')]);router[_0x3da7('0x8')]('/:id/test',auth[_0x3da7('0xa')](),timeout(_0x3da7('0xc')),controller['test']);router[_0x3da7('0xd')]('/',auth[_0x3da7('0xa')](),controller[_0x3da7('0xe')]);router['put'](_0x3da7('0x9'),auth[_0x3da7('0xa')](),controller[_0x3da7('0xf')]);router[_0x3da7('0x10')](_0x3da7('0x9'),auth[_0x3da7('0xa')](),controller[_0x3da7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e0069ff..6998f3d 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 _0xd72d=['name','STRING'];(function(_0x53f9e1,_0x59ca58){var _0x3f7e10=function(_0x1e0912){while(--_0x1e0912){_0x53f9e1['push'](_0x53f9e1['shift']());}};_0x3f7e10(++_0x59ca58);}(_0xd72d,0x17d));var _0xdd72=function(_0x3410bf,_0xdb1f12){_0x3410bf=_0x3410bf-0x0;var _0x353df2=_0xd72d[_0x3410bf];return _0x353df2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdd72('0x0')],'unique':_0xdd72('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xdd72('0x0')]},'description':{'type':Sequelize[_0xdd72('0x0')]}}; \ No newline at end of file +var _0x4ea3=['exports','STRING','sequelize'];(function(_0x3dbc79,_0x426f83){var _0x10db9d=function(_0xa90d0a){while(--_0xa90d0a){_0x3dbc79['push'](_0x3dbc79['shift']());}};_0x10db9d(++_0x426f83);}(_0x4ea3,0x158));var _0x34ea=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x4ea3[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x34ea('0x0'));module[_0x34ea('0x1')]={'name':{'type':Sequelize[_0x34ea('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x34ea('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 1bfdc1d..12363bc 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 _0xcf2f=['keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','VIRTUAL','where','includeAll','include','findAll','rows','catch','show','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','get','ODBC','error','name','send','index','SquareOdbc','rawAttributes','fieldName','type','key','map','query'];(function(_0x1763bb,_0x151749){var _0x44c732=function(_0x99d070){while(--_0x99d070){_0x1763bb['push'](_0x1763bb['shift']());}};_0x44c732(++_0x151749);}(_0xcf2f,0xdd));var _0xfcf2=function(_0x2cb6f0,_0x52bf32){_0x2cb6f0=_0x2cb6f0-0x0;var _0x3211b4=_0xcf2f[_0x2cb6f0];return _0x3211b4;};'use strict';var pdf=require(_0xfcf2('0x0'));var emlformat=require(_0xfcf2('0x1'));var rimraf=require(_0xfcf2('0x2'));var zipdir=require(_0xfcf2('0x3'));var jsonpatch=require(_0xfcf2('0x4'));var rp=require(_0xfcf2('0x5'));var moment=require(_0xfcf2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xfcf2('0x7'));var util=require(_0xfcf2('0x8'));var path=require(_0xfcf2('0x9'));var sox=require(_0xfcf2('0xa'));var csv=require(_0xfcf2('0xb'));var ejs=require(_0xfcf2('0xc'));var fs=require('fs');var _=require(_0xfcf2('0xd'));var squel=require('squel');var crypto=require(_0xfcf2('0xe'));var jsforce=require(_0xfcf2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfcf2('0x10'));var Papa=require(_0xfcf2('0x11'));var Redis=require(_0xfcf2('0x12'));var authService=require(_0xfcf2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfcf2('0x14'));var hardwareService=require(_0xfcf2('0x15'));var logger=require(_0xfcf2('0x16'))('api');var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var db=require(_0xfcf2('0x18'))['db'];function respondWithStatusCode(_0x2dff67,_0x247d65){_0x247d65=_0x247d65||0xcc;return function(_0x4106e2){if(_0x4106e2){return _0x2dff67[_0xfcf2('0x19')](_0x247d65);}return _0x2dff67[_0xfcf2('0x1a')](_0x247d65)[_0xfcf2('0x1b')]();};}function respondWithResult(_0x1db6ce,_0xfb972e){_0xfb972e=_0xfb972e||0xc8;return function(_0x43569e){if(_0x43569e){return _0x1db6ce[_0xfcf2('0x1a')](_0xfb972e)[_0xfcf2('0x1c')](_0x43569e);}};}function respondWithFilteredResult(_0x5d5bcb,_0xb8911f){return function(_0x36d8b3){if(_0x36d8b3){var _0x21ffe4=_0x36d8b3[_0xfcf2('0x1d')],_0x4b68ce=_0xb8911f[_0xfcf2('0x1e')],_0x120401=_0xb8911f[_0xfcf2('0x1e')]+_0xb8911f['limit'],_0x47a38b;if(_0x120401>=_0x21ffe4){_0x120401=_0x21ffe4;_0x47a38b=0xc8;}else{_0x47a38b=0xce;}_0x5d5bcb[_0xfcf2('0x1a')](_0x47a38b);return _0x5d5bcb[_0xfcf2('0x1f')](_0xfcf2('0x20'),_0x4b68ce+'-'+_0x120401+'/'+_0x21ffe4)[_0xfcf2('0x1c')](_0x36d8b3);}return null;};}function patchUpdates(_0x19475f){return function(_0xd04030){try{jsonpatch['apply'](_0xd04030,_0x19475f,!![]);}catch(_0x4b60f4){return BPromise[_0xfcf2('0x21')](_0x4b60f4);}return _0xd04030['save']();};}function saveUpdates(_0x219b3b,_0x7eba71){return function(_0x8a5761){if(_0x8a5761){return _0x8a5761[_0xfcf2('0x22')](_0x219b3b)[_0xfcf2('0x23')](function(_0x44821e){return _0x44821e;});}return null;};}function removeEntity(_0x287076,_0x2aface){return function(_0x48108e){if(_0x48108e){return _0x48108e['destroy']()[_0xfcf2('0x23')](function(){var _0x2346a6=_0x48108e[_0xfcf2('0x24')]({'plain':!![]});var _0x197b29=_0xfcf2('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x197b29,'resourceId':_0x2346a6['id']}})[_0xfcf2('0x23')](function(){return _0x48108e;});})[_0xfcf2('0x23')](function(){_0x287076[_0xfcf2('0x1a')](0xcc)[_0xfcf2('0x1b')]();});}};}function handleEntityNotFound(_0x2786c6,_0x31c6c6){return function(_0x17514){if(!_0x17514){_0x2786c6['sendStatus'](0x194);}return _0x17514;};}function handleError(_0x2c2bc9,_0x524ec8){_0x524ec8=_0x524ec8||0x1f4;return function(_0x3d0c0e){logger[_0xfcf2('0x26')](_0x3d0c0e['stack']);if(_0x3d0c0e[_0xfcf2('0x27')]){delete _0x3d0c0e[_0xfcf2('0x27')];}_0x2c2bc9[_0xfcf2('0x1a')](_0x524ec8)[_0xfcf2('0x28')](_0x3d0c0e);};}exports[_0xfcf2('0x29')]=function(_0x330a83,_0x191b20){var _0x3b6d20={},_0x1438de={},_0x584d43={'count':0x0,'rows':[]};var _0x40a145=_['map'](db[_0xfcf2('0x2a')][_0xfcf2('0x2b')],function(_0x5c9057){return{'name':_0x5c9057[_0xfcf2('0x2c')],'type':_0x5c9057[_0xfcf2('0x2d')][_0xfcf2('0x2e')]};});_0x1438de['model']=_[_0xfcf2('0x2f')](_0x40a145,_0xfcf2('0x27'));_0x1438de[_0xfcf2('0x30')]=_[_0xfcf2('0x31')](_0x330a83['query']);_0x1438de['filters']=_['intersection'](_0x1438de[_0xfcf2('0x32')],_0x1438de[_0xfcf2('0x30')]);_0x3b6d20[_0xfcf2('0x33')]=_[_0xfcf2('0x34')](_0x1438de[_0xfcf2('0x32')],qs[_0xfcf2('0x35')](_0x330a83['query'][_0xfcf2('0x35')]));_0x3b6d20[_0xfcf2('0x33')]=_0x3b6d20[_0xfcf2('0x33')][_0xfcf2('0x36')]?_0x3b6d20[_0xfcf2('0x33')]:_0x1438de[_0xfcf2('0x32')];if(!_0x330a83['query'][_0xfcf2('0x37')](_0xfcf2('0x38'))){_0x3b6d20[_0xfcf2('0x39')]=qs['limit'](_0x330a83[_0xfcf2('0x30')][_0xfcf2('0x39')]);_0x3b6d20['offset']=qs[_0xfcf2('0x1e')](_0x330a83[_0xfcf2('0x30')][_0xfcf2('0x1e')]);}_0x3b6d20[_0xfcf2('0x3a')]=qs[_0xfcf2('0x3b')](_0x330a83[_0xfcf2('0x30')]['sort']);_0x3b6d20['where']=qs[_0xfcf2('0x3c')](_[_0xfcf2('0x3d')](_0x330a83[_0xfcf2('0x30')],_0x1438de[_0xfcf2('0x3c')]),_0x40a145);if(_0x330a83[_0xfcf2('0x30')][_0xfcf2('0x3e')]){_0x3b6d20['where']=_[_0xfcf2('0x3f')](_0x3b6d20['where'],{'$or':_[_0xfcf2('0x2f')](_0x40a145,function(_0x41150f){if(_0x41150f[_0xfcf2('0x2d')]!==_0xfcf2('0x40')){var _0x4ffce7={};_0x4ffce7[_0x41150f[_0xfcf2('0x27')]]={'$like':'%'+_0x330a83[_0xfcf2('0x30')][_0xfcf2('0x3e')]+'%'};return _0x4ffce7;}})});}_0x3b6d20=_[_0xfcf2('0x3f')]({},_0x3b6d20,_0x330a83['options']);var _0x278b54={'where':_0x3b6d20[_0xfcf2('0x41')]};return db['SquareOdbc'][_0xfcf2('0x1d')](_0x278b54)['then'](function(_0x4ef82e){_0x584d43['count']=_0x4ef82e;if(_0x330a83['query'][_0xfcf2('0x42')]){_0x3b6d20[_0xfcf2('0x43')]=[{'all':!![]}];}return db[_0xfcf2('0x2a')][_0xfcf2('0x44')](_0x3b6d20);})[_0xfcf2('0x23')](function(_0x89ca51){_0x584d43[_0xfcf2('0x45')]=_0x89ca51;return _0x584d43;})[_0xfcf2('0x23')](respondWithFilteredResult(_0x191b20,_0x3b6d20))[_0xfcf2('0x46')](handleError(_0x191b20,null));};exports[_0xfcf2('0x47')]=function(_0x5b04cc,_0x36024d){var _0x501d5c={'raw':!![],'where':{'id':_0x5b04cc['params']['id']}},_0x57c332={};_0x57c332[_0xfcf2('0x32')]=_[_0xfcf2('0x31')](db['SquareOdbc']['rawAttributes']);_0x57c332[_0xfcf2('0x30')]=_[_0xfcf2('0x31')](_0x5b04cc['query']);_0x57c332[_0xfcf2('0x3c')]=_[_0xfcf2('0x34')](_0x57c332[_0xfcf2('0x32')],_0x57c332[_0xfcf2('0x30')]);_0x501d5c[_0xfcf2('0x33')]=_['intersection'](_0x57c332[_0xfcf2('0x32')],qs[_0xfcf2('0x35')](_0x5b04cc[_0xfcf2('0x30')][_0xfcf2('0x35')]));_0x501d5c[_0xfcf2('0x33')]=_0x501d5c[_0xfcf2('0x33')][_0xfcf2('0x36')]?_0x501d5c[_0xfcf2('0x33')]:_0x57c332[_0xfcf2('0x32')];if(_0x5b04cc[_0xfcf2('0x30')][_0xfcf2('0x42')]){_0x501d5c['include']=[{'all':!![]}];}_0x501d5c=_['merge']({},_0x501d5c,_0x5b04cc[_0xfcf2('0x48')]);return db[_0xfcf2('0x2a')][_0xfcf2('0x49')](_0x501d5c)[_0xfcf2('0x23')](handleEntityNotFound(_0x36024d,null))[_0xfcf2('0x23')](respondWithResult(_0x36024d,null))[_0xfcf2('0x46')](handleError(_0x36024d,null));};exports[_0xfcf2('0x4a')]=function(_0x410dc9,_0x362cae){return db[_0xfcf2('0x2a')][_0xfcf2('0x4a')](_0x410dc9['body'],{})['then'](function(_0x47e74b){var _0x3f481d=_0x410dc9[_0xfcf2('0x4b')][_0xfcf2('0x24')]({'plain':!![]});if(!_0x3f481d)throw new Error(_0xfcf2('0x4c'));if(_0x3f481d[_0xfcf2('0x4d')]===_0xfcf2('0x4b')){var _0x1fd219=_0x47e74b['get']({'plain':!![]});var _0x5bf21a=_0xfcf2('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x5bf21a,'userProfileId':_0x3f481d[_0xfcf2('0x4e')]},'raw':!![]})[_0xfcf2('0x23')](function(_0x367388){if(_0x367388&&_0x367388[_0xfcf2('0x4f')]===0x0){return db[_0xfcf2('0x50')][_0xfcf2('0x4a')]({'name':_0x1fd219[_0xfcf2('0x27')],'resourceId':_0x1fd219['id'],'type':_0x367388[_0xfcf2('0x27')],'sectionId':_0x367388['id']},{})[_0xfcf2('0x23')](function(){return _0x47e74b;});}else{return _0x47e74b;}})[_0xfcf2('0x46')](function(_0x3cb128){logger[_0xfcf2('0x26')](_0xfcf2('0x51'),_0x3cb128);throw _0x3cb128;});}return _0x47e74b;})[_0xfcf2('0x23')](respondWithResult(_0x362cae,0xc9))[_0xfcf2('0x46')](handleError(_0x362cae,null));};exports[_0xfcf2('0x22')]=function(_0x2bdb39,_0x467809){if(_0x2bdb39[_0xfcf2('0x52')]['id']){delete _0x2bdb39[_0xfcf2('0x52')]['id'];}return db[_0xfcf2('0x2a')]['find']({'where':{'id':_0x2bdb39[_0xfcf2('0x53')]['id']}})['then'](handleEntityNotFound(_0x467809,null))[_0xfcf2('0x23')](saveUpdates(_0x2bdb39['body'],null))[_0xfcf2('0x23')](respondWithResult(_0x467809,null))['catch'](handleError(_0x467809,null));};exports[_0xfcf2('0x54')]=function(_0x8e8295,_0x3e2e7a){return db[_0xfcf2('0x2a')][_0xfcf2('0x49')]({'where':{'id':_0x8e8295[_0xfcf2('0x53')]['id']}})[_0xfcf2('0x23')](handleEntityNotFound(_0x3e2e7a,null))[_0xfcf2('0x23')](removeEntity(_0x3e2e7a,null))[_0xfcf2('0x46')](handleError(_0x3e2e7a,null));};exports[_0xfcf2('0x55')]=function(_0x274d2c,_0x1d4779,_0x4c9246){var _0x4596ce;return db[_0xfcf2('0x2a')][_0xfcf2('0x49')]({'where':{'id':_0x274d2c[_0xfcf2('0x53')]['id']},'attributes':['id',_0xfcf2('0x56')]})[_0xfcf2('0x23')](handleEntityNotFound(_0x1d4779,null))[_0xfcf2('0x23')](function(_0x439e82){if(_0x439e82){var _0x1f1179=require(_0xfcf2('0x57'))();_0x1f1179[_0xfcf2('0x58')](_0x439e82[_0xfcf2('0x56')]);_0x1f1179[_0xfcf2('0x59')]();return _0x439e82;}})['then'](respondWithResult(_0x1d4779,null))[_0xfcf2('0x46')](handleError(_0x1d4779,null));}; \ No newline at end of file +var _0xda7d=['query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ODBC','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','name'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0xda7d,0xca));var _0xdda7=function(_0x5a4b5a,_0x16af6e){_0x5a4b5a=_0x5a4b5a-0x0;var _0x2f57bf=_0xda7d[_0x5a4b5a];return _0x2f57bf;};'use strict';var pdf=require(_0xdda7('0x0'));var emlformat=require(_0xdda7('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xdda7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdda7('0x3'));var Mustache=require(_0xdda7('0x4'));var util=require(_0xdda7('0x5'));var path=require('path');var sox=require(_0xdda7('0x6'));var csv=require(_0xdda7('0x7'));var ejs=require(_0xdda7('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdda7('0x9'));var crypto=require(_0xdda7('0xa'));var jsforce=require(_0xdda7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdda7('0x7'));var querystring=require('querystring');var Papa=require(_0xdda7('0xc'));var Redis=require('ioredis');var authService=require(_0xdda7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xdda7('0xe'));var hardwareService=require(_0xdda7('0xf'));var logger=require(_0xdda7('0x10'))(_0xdda7('0x11'));var utils=require(_0xdda7('0x12'));var config=require('../../config/environment');var db=require(_0xdda7('0x13'))['db'];function respondWithStatusCode(_0x30e441,_0x2f9ca9){_0x2f9ca9=_0x2f9ca9||0xcc;return function(_0x51aa0c){if(_0x51aa0c){return _0x30e441[_0xdda7('0x14')](_0x2f9ca9);}return _0x30e441[_0xdda7('0x15')](_0x2f9ca9)['end']();};}function respondWithResult(_0x4c3436,_0x5ca58e){_0x5ca58e=_0x5ca58e||0xc8;return function(_0x5e925e){if(_0x5e925e){return _0x4c3436[_0xdda7('0x15')](_0x5ca58e)[_0xdda7('0x16')](_0x5e925e);}};}function respondWithFilteredResult(_0x4c5b0f,_0x15ffe3){return function(_0x5260a3){if(_0x5260a3){var _0x127f28=_0x5260a3[_0xdda7('0x17')],_0x37d5ce=_0x15ffe3[_0xdda7('0x18')],_0x4a5fef=_0x15ffe3['offset']+_0x15ffe3[_0xdda7('0x19')],_0x3245f5;if(_0x4a5fef>=_0x127f28){_0x4a5fef=_0x127f28;_0x3245f5=0xc8;}else{_0x3245f5=0xce;}_0x4c5b0f['status'](_0x3245f5);return _0x4c5b0f[_0xdda7('0x1a')](_0xdda7('0x1b'),_0x37d5ce+'-'+_0x4a5fef+'/'+_0x127f28)[_0xdda7('0x16')](_0x5260a3);}return null;};}function patchUpdates(_0xf363a0){return function(_0x217d34){try{jsonpatch[_0xdda7('0x1c')](_0x217d34,_0xf363a0,!![]);}catch(_0x3a3d9f){return BPromise[_0xdda7('0x1d')](_0x3a3d9f);}return _0x217d34['save']();};}function saveUpdates(_0xe05a40,_0xdf14d){return function(_0x397944){if(_0x397944){return _0x397944[_0xdda7('0x1e')](_0xe05a40)[_0xdda7('0x1f')](function(_0x1b3a95){return _0x1b3a95;});}return null;};}function removeEntity(_0x5ebfb8,_0x163cd6){return function(_0x24961b){if(_0x24961b){return _0x24961b[_0xdda7('0x20')]()[_0xdda7('0x1f')](function(){var _0x31060e=_0x24961b[_0xdda7('0x21')]({'plain':!![]});var _0x237334='ODBC';return db[_0xdda7('0x22')][_0xdda7('0x20')]({'where':{'type':_0x237334,'resourceId':_0x31060e['id']}})[_0xdda7('0x1f')](function(){return _0x24961b;});})[_0xdda7('0x1f')](function(){_0x5ebfb8['status'](0xcc)[_0xdda7('0x23')]();});}};}function handleEntityNotFound(_0x44f33e,_0x3b9380){return function(_0x2c6091){if(!_0x2c6091){_0x44f33e['sendStatus'](0x194);}return _0x2c6091;};}function handleError(_0x335534,_0x35ef88){_0x35ef88=_0x35ef88||0x1f4;return function(_0x7007e8){logger[_0xdda7('0x24')](_0x7007e8[_0xdda7('0x25')]);if(_0x7007e8['name']){delete _0x7007e8['name'];}_0x335534[_0xdda7('0x15')](_0x35ef88)[_0xdda7('0x26')](_0x7007e8);};}exports[_0xdda7('0x27')]=function(_0x32adc5,_0x4607d0){var _0x248176={},_0x3e8cb6={},_0x216631={'count':0x0,'rows':[]};var _0x143b99=_[_0xdda7('0x28')](db[_0xdda7('0x29')][_0xdda7('0x2a')],function(_0x214712){return{'name':_0x214712[_0xdda7('0x2b')],'type':_0x214712['type'][_0xdda7('0x2c')]};});_0x3e8cb6[_0xdda7('0x2d')]=_['map'](_0x143b99,_0xdda7('0x2e'));_0x3e8cb6[_0xdda7('0x2f')]=_[_0xdda7('0x30')](_0x32adc5[_0xdda7('0x2f')]);_0x3e8cb6['filters']=_['intersection'](_0x3e8cb6[_0xdda7('0x2d')],_0x3e8cb6[_0xdda7('0x2f')]);_0x248176[_0xdda7('0x31')]=_[_0xdda7('0x32')](_0x3e8cb6[_0xdda7('0x2d')],qs[_0xdda7('0x33')](_0x32adc5['query'][_0xdda7('0x33')]));_0x248176[_0xdda7('0x31')]=_0x248176['attributes'][_0xdda7('0x34')]?_0x248176['attributes']:_0x3e8cb6['model'];if(!_0x32adc5[_0xdda7('0x2f')][_0xdda7('0x35')]('nolimit')){_0x248176[_0xdda7('0x19')]=qs[_0xdda7('0x19')](_0x32adc5['query']['limit']);_0x248176['offset']=qs[_0xdda7('0x18')](_0x32adc5[_0xdda7('0x2f')][_0xdda7('0x18')]);}_0x248176[_0xdda7('0x36')]=qs['sort'](_0x32adc5[_0xdda7('0x2f')][_0xdda7('0x37')]);_0x248176[_0xdda7('0x38')]=qs[_0xdda7('0x39')](_[_0xdda7('0x3a')](_0x32adc5['query'],_0x3e8cb6['filters']),_0x143b99);if(_0x32adc5[_0xdda7('0x2f')][_0xdda7('0x3b')]){_0x248176[_0xdda7('0x38')]=_['merge'](_0x248176['where'],{'$or':_[_0xdda7('0x28')](_0x143b99,function(_0x1a0d91){if(_0x1a0d91[_0xdda7('0x3c')]!==_0xdda7('0x3d')){var _0x5e26cc={};_0x5e26cc[_0x1a0d91[_0xdda7('0x2e')]]={'$like':'%'+_0x32adc5[_0xdda7('0x2f')][_0xdda7('0x3b')]+'%'};return _0x5e26cc;}})});}_0x248176=_[_0xdda7('0x3e')]({},_0x248176,_0x32adc5[_0xdda7('0x3f')]);var _0x187730={'where':_0x248176[_0xdda7('0x38')]};return db[_0xdda7('0x29')][_0xdda7('0x17')](_0x187730)[_0xdda7('0x1f')](function(_0xe9b307){_0x216631[_0xdda7('0x17')]=_0xe9b307;if(_0x32adc5[_0xdda7('0x2f')][_0xdda7('0x40')]){_0x248176[_0xdda7('0x41')]=[{'all':!![]}];}return db[_0xdda7('0x29')][_0xdda7('0x42')](_0x248176);})[_0xdda7('0x1f')](function(_0x49eb3b){_0x216631[_0xdda7('0x43')]=_0x49eb3b;return _0x216631;})['then'](respondWithFilteredResult(_0x4607d0,_0x248176))[_0xdda7('0x44')](handleError(_0x4607d0,null));};exports[_0xdda7('0x45')]=function(_0x171cc5,_0x3391bb){var _0x440d03={'raw':!![],'where':{'id':_0x171cc5['params']['id']}},_0x2a18f6={};_0x2a18f6[_0xdda7('0x2d')]=_[_0xdda7('0x30')](db[_0xdda7('0x29')][_0xdda7('0x2a')]);_0x2a18f6[_0xdda7('0x2f')]=_[_0xdda7('0x30')](_0x171cc5[_0xdda7('0x2f')]);_0x2a18f6[_0xdda7('0x39')]=_[_0xdda7('0x32')](_0x2a18f6[_0xdda7('0x2d')],_0x2a18f6['query']);_0x440d03[_0xdda7('0x31')]=_['intersection'](_0x2a18f6['model'],qs[_0xdda7('0x33')](_0x171cc5['query']['fields']));_0x440d03[_0xdda7('0x31')]=_0x440d03[_0xdda7('0x31')][_0xdda7('0x34')]?_0x440d03['attributes']:_0x2a18f6['model'];if(_0x171cc5[_0xdda7('0x2f')][_0xdda7('0x40')]){_0x440d03[_0xdda7('0x41')]=[{'all':!![]}];}_0x440d03=_[_0xdda7('0x3e')]({},_0x440d03,_0x171cc5[_0xdda7('0x3f')]);return db[_0xdda7('0x29')][_0xdda7('0x46')](_0x440d03)[_0xdda7('0x1f')](handleEntityNotFound(_0x3391bb,null))[_0xdda7('0x1f')](respondWithResult(_0x3391bb,null))[_0xdda7('0x44')](handleError(_0x3391bb,null));};exports[_0xdda7('0x47')]=function(_0x5f221d,_0x1216aa){return db[_0xdda7('0x29')][_0xdda7('0x47')](_0x5f221d['body'],{})['then'](function(_0x40d3cf){var _0x3f94e8=_0x5f221d['user'][_0xdda7('0x21')]({'plain':!![]});if(!_0x3f94e8)throw new Error(_0xdda7('0x48'));if(_0x3f94e8[_0xdda7('0x49')]===_0xdda7('0x4a')){var _0x241196=_0x40d3cf[_0xdda7('0x21')]({'plain':!![]});var _0x22c2e3=_0xdda7('0x4b');return db[_0xdda7('0x4c')][_0xdda7('0x46')]({'where':{'name':_0x22c2e3,'userProfileId':_0x3f94e8['userProfileId']},'raw':!![]})['then'](function(_0x16cde1){if(_0x16cde1&&_0x16cde1['autoAssociation']===0x0){return db[_0xdda7('0x22')]['create']({'name':_0x241196[_0xdda7('0x2e')],'resourceId':_0x241196['id'],'type':_0x16cde1[_0xdda7('0x2e')],'sectionId':_0x16cde1['id']},{})['then'](function(){return _0x40d3cf;});}else{return _0x40d3cf;}})[_0xdda7('0x44')](function(_0x266522){logger['error'](_0xdda7('0x4d'),_0x266522);throw _0x266522;});}return _0x40d3cf;})[_0xdda7('0x1f')](respondWithResult(_0x1216aa,0xc9))['catch'](handleError(_0x1216aa,null));};exports[_0xdda7('0x1e')]=function(_0x1228f6,_0x381422){if(_0x1228f6['body']['id']){delete _0x1228f6[_0xdda7('0x4e')]['id'];}return db[_0xdda7('0x29')][_0xdda7('0x46')]({'where':{'id':_0x1228f6[_0xdda7('0x4f')]['id']}})[_0xdda7('0x1f')](handleEntityNotFound(_0x381422,null))['then'](saveUpdates(_0x1228f6[_0xdda7('0x4e')],null))[_0xdda7('0x1f')](respondWithResult(_0x381422,null))[_0xdda7('0x44')](handleError(_0x381422,null));};exports[_0xdda7('0x20')]=function(_0x9174f7,_0x48d140){return db[_0xdda7('0x29')][_0xdda7('0x46')]({'where':{'id':_0x9174f7[_0xdda7('0x4f')]['id']}})[_0xdda7('0x1f')](handleEntityNotFound(_0x48d140,null))[_0xdda7('0x1f')](removeEntity(_0x48d140,null))[_0xdda7('0x44')](handleError(_0x48d140,null));};exports[_0xdda7('0x50')]=function(_0x222c14,_0x5c9bc4,_0x4c4ec0){var _0x1ed627;return db['SquareOdbc'][_0xdda7('0x46')]({'where':{'id':_0x222c14[_0xdda7('0x4f')]['id']},'attributes':['id',_0xdda7('0x51')]})[_0xdda7('0x1f')](handleEntityNotFound(_0x5c9bc4,null))['then'](function(_0x17c836){if(_0x17c836){var _0x249686=require(_0xdda7('0x52'))();_0x249686['openSync'](_0x17c836[_0xdda7('0x51')]);_0x249686['closeSync']();return _0x17c836;}})[_0xdda7('0x1f')](respondWithResult(_0x5c9bc4,null))[_0xdda7('0x44')](handleError(_0x5c9bc4,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 43151e6..63c0c3a 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 _0x3785=['define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareOdbc.attributes','exports'];(function(_0x1c310f,_0x588155){var _0x101c94=function(_0x49aa67){while(--_0x49aa67){_0x1c310f['push'](_0x1c310f['shift']());}};_0x101c94(++_0x588155);}(_0x3785,0x92));var _0x5378=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x3785[_0x292f93];return _0x5a94b1;};'use strict';var _=require(_0x5378('0x0'));var util=require(_0x5378('0x1'));var logger=require(_0x5378('0x2'))(_0x5378('0x3'));var moment=require(_0x5378('0x4'));var BPromise=require(_0x5378('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5378('0x6'));var rimraf=require(_0x5378('0x7'));var config=require('../../config/environment');var attributes=require(_0x5378('0x8'));module[_0x5378('0x9')]=function(_0x40478f,_0x3fbf27){return _0x40478f[_0x5378('0xa')](_0x5378('0xb'),attributes,{'tableName':_0x5378('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd71d=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xd71d,0xbf));var _0xdd71=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xd71d[_0x32b542];return _0x554d54;};'use strict';var _=require(_0xdd71('0x0'));var util=require(_0xdd71('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd71('0x2'));var BPromise=require(_0xdd71('0x3'));var rp=require(_0xdd71('0x4'));var fs=require('fs');var path=require(_0xdd71('0x5'));var rimraf=require(_0xdd71('0x6'));var config=require(_0xdd71('0x7'));var attributes=require(_0xdd71('0x8'));module[_0xdd71('0x9')]=function(_0x368778,_0x35530c){return _0x368778[_0xdd71('0xa')](_0xdd71('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index 35ca1bb..fcd898f 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x1116ac,_0xcbe059){var _0x3e806b=function(_0x33b585){while(--_0x33b585){_0x1116ac['push'](_0x1116ac['shift']());}};_0x3e806b(++_0xcbe059);}(_0xe14b,0x93));var _0xbe14=function(_0x43e479,_0x5ccbf5){_0x43e479=_0x43e479-0x0;var _0x4ae64f=_0xe14b[_0x43e479];return _0x4ae64f;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x55ca,0x126));var _0xa55c=function(_0x26a74d,_0x37ecfc){_0x26a74d=_0x26a74d-0x0;var _0xcbb1a3=_0x55ca[_0x26a74d];return _0xcbb1a3;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3ca4858..49b2a9f 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 _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','show','post','create','/:id/users','addUsers','/:id','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x5eb8,0xb0));var _0x85eb=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0x5eb8[_0x32a81f];return _0x5b67a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0x8')]('/:id/users',auth[_0x85eb('0x9')](),controller['getUsers']);router[_0x85eb('0xc')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xd')]);router[_0x85eb('0xc')](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router['put'](_0x85eb('0x10'),auth[_0x85eb('0x9')](),controller['update']);router[_0x85eb('0x11')](_0x85eb('0x10'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x12')]);router['delete']('/:id/users',auth[_0x85eb('0x9')](),controller['removeUsers']);module[_0x85eb('0x13')]=router; \ No newline at end of file +var _0x4b17=['exports','multer','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b17,0x10f));var _0x74b1=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x4b17[_0x4d40dd];return _0x1c51f2;};'use strict';var multer=require(_0x74b1('0x0'));var util=require('util');var path=require(_0x74b1('0x1'));var timeout=require('connect-timeout');var express=require(_0x74b1('0x2'));var router=express[_0x74b1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x74b1('0x4'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x74b1('0x5')]('/',auth[_0x74b1('0x6')](),controller[_0x74b1('0x7')]);router[_0x74b1('0x5')](_0x74b1('0x8'),auth[_0x74b1('0x6')](),controller[_0x74b1('0x9')]);router['get'](_0x74b1('0xa'),auth[_0x74b1('0x6')](),controller[_0x74b1('0xb')]);router[_0x74b1('0xc')]('/',auth[_0x74b1('0x6')](),controller['create']);router[_0x74b1('0xc')](_0x74b1('0xa'),auth['isAuthenticated'](),controller[_0x74b1('0xd')]);router[_0x74b1('0xe')](_0x74b1('0x8'),auth[_0x74b1('0x6')](),controller['update']);router[_0x74b1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x74b1('0x10')]);router[_0x74b1('0xf')]('/:id/users',auth['isAuthenticated'](),controller['removeUsers']);module[_0x74b1('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 9687eea..2971d88 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 _0xb342=['long','preproduction','getDataValue','BLOB','production','toString','utf8','exports','STRING','name','TEXT'];(function(_0x2f715d,_0x55e850){var _0x39045c=function(_0x4192f4){while(--_0x4192f4){_0x2f715d['push'](_0x2f715d['shift']());}};_0x39045c(++_0x55e850);}(_0xb342,0x146));var _0x2b34=function(_0xbf3f20,_0x5bf459){_0xbf3f20=_0xbf3f20-0x0;var _0x4b8870=_0xb342[_0xbf3f20];return _0x4b8870;};'use strict';var Sequelize=require('sequelize');module[_0x2b34('0x0')]={'name':{'type':Sequelize[_0x2b34('0x1')],'unique':_0x2b34('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x2b34('0x1')]},'notes':{'type':Sequelize[_0x2b34('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0x2b34('0x4')),'get':function(){if(this['getDataValue'](_0x2b34('0x5'))){return this[_0x2b34('0x6')](_0x2b34('0x5'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x2b34('0x7')](_0x2b34('0x4')),'get':function(){if(this[_0x2b34('0x6')](_0x2b34('0x8'))){return this[_0x2b34('0x6')](_0x2b34('0x8'))[_0x2b34('0x9')](_0x2b34('0xa'));}}}}; \ No newline at end of file +var _0x85cf=['STRING','name','TEXT','BLOB','getDataValue','toString','utf8','production'];(function(_0x38f3a5,_0x56f869){var _0x446bbc=function(_0x1190df){while(--_0x1190df){_0x38f3a5['push'](_0x38f3a5['shift']());}};_0x446bbc(++_0x56f869);}(_0x85cf,0x70));var _0xf85c=function(_0xf548e8,_0x3591e8){_0xf548e8=_0xf548e8-0x0;var _0x39827b=_0x85cf[_0xf548e8];return _0x39827b;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf85c('0x0')],'unique':_0xf85c('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xf85c('0x0')]},'notes':{'type':Sequelize[_0xf85c('0x2')]},'preproduction':{'type':Sequelize[_0xf85c('0x3')]('long'),'get':function(){if(this['getDataValue']('preproduction')){return this[_0xf85c('0x4')]('preproduction')[_0xf85c('0x5')](_0xf85c('0x6'));}}},'production':{'type':Sequelize[_0xf85c('0x3')]('long'),'get':function(){if(this['getDataValue'](_0xf85c('0x7'))){return this['getDataValue'](_0xf85c('0x7'))[_0xf85c('0x5')]('utf8');}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 40f238f..1586594 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 _0x24d1=['where','merge','type','VIRTUAL','filter','options','includeAll','include','catch','params','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SquareProjects','find','userProfileId','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','then','get','destroy','error','stack','name','index','map','SquareProject','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','limit','order','sort','pick'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x24d1,0x1df));var _0x124d=function(_0x21517f,_0x368c7c){_0x21517f=_0x21517f-0x0;var _0x25f1e4=_0x24d1[_0x21517f];return _0x25f1e4;};'use strict';var pdf=require(_0x124d('0x0'));var emlformat=require(_0x124d('0x1'));var rimraf=require(_0x124d('0x2'));var zipdir=require(_0x124d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x124d('0x4'));var BPromise=require(_0x124d('0x5'));var Mustache=require(_0x124d('0x6'));var util=require(_0x124d('0x7'));var path=require(_0x124d('0x8'));var sox=require('sox');var csv=require(_0x124d('0x9'));var ejs=require(_0x124d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x124d('0xb'));var crypto=require(_0x124d('0xc'));var jsforce=require(_0x124d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x124d('0x9'));var querystring=require(_0x124d('0xe'));var Papa=require(_0x124d('0xf'));var Redis=require(_0x124d('0x10'));var authService=require(_0x124d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x124d('0x12'));var hardwareService=require(_0x124d('0x13'));var logger=require(_0x124d('0x14'))(_0x124d('0x15'));var utils=require('../../config/utils');var config=require(_0x124d('0x16'));var db=require(_0x124d('0x17'))['db'];config[_0x124d('0x18')]=_['defaults'](config[_0x124d('0x18')],{'host':_0x124d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x124d('0x18')]));require('./squareProject.socket')[_0x124d('0x1a')](socket);function respondWithStatusCode(_0x12dd83,_0x470d0a){_0x470d0a=_0x470d0a||0xcc;return function(_0x3854fe){if(_0x3854fe){return _0x12dd83[_0x124d('0x1b')](_0x470d0a);}return _0x12dd83['status'](_0x470d0a)[_0x124d('0x1c')]();};}function respondWithResult(_0x204eb8,_0x24172f){_0x24172f=_0x24172f||0xc8;return function(_0x4b554b){if(_0x4b554b){return _0x204eb8['status'](_0x24172f)[_0x124d('0x1d')](_0x4b554b);}};}function respondWithFilteredResult(_0x50549f,_0x334337){return function(_0x377e00){if(_0x377e00){var _0xc2fcab=_0x377e00[_0x124d('0x1e')],_0x13d0b3=_0x334337[_0x124d('0x1f')],_0x369b01=_0x334337[_0x124d('0x1f')]+_0x334337['limit'],_0x31c309;if(_0x369b01>=_0xc2fcab){_0x369b01=_0xc2fcab;_0x31c309=0xc8;}else{_0x31c309=0xce;}_0x50549f[_0x124d('0x20')](_0x31c309);return _0x50549f[_0x124d('0x21')](_0x124d('0x22'),_0x13d0b3+'-'+_0x369b01+'/'+_0xc2fcab)[_0x124d('0x1d')](_0x377e00);}return null;};}function patchUpdates(_0x3bb56c){return function(_0x116b2d){try{jsonpatch[_0x124d('0x23')](_0x116b2d,_0x3bb56c,!![]);}catch(_0x49496b){return BPromise[_0x124d('0x24')](_0x49496b);}return _0x116b2d[_0x124d('0x25')]();};}function saveUpdates(_0x5097d7,_0xc2ef06){return function(_0x1cd11d){if(_0x1cd11d){return _0x1cd11d['update'](_0x5097d7)['then'](function(_0x114c41){return _0x114c41;});}return null;};}function removeEntity(_0x468d33,_0x1bb0d5){return function(_0x2f93e7){if(_0x2f93e7){return _0x2f93e7['destroy']()[_0x124d('0x26')](function(){var _0x5de937=_0x2f93e7[_0x124d('0x27')]({'plain':!![]});var _0x20dfee='SquareProjects';return db['UserProfileResource'][_0x124d('0x28')]({'where':{'type':_0x20dfee,'resourceId':_0x5de937['id']}})[_0x124d('0x26')](function(){return _0x2f93e7;});})[_0x124d('0x26')](function(){_0x468d33[_0x124d('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19e0e6,_0x1b366c){return function(_0x1f89f1){if(!_0x1f89f1){_0x19e0e6[_0x124d('0x1b')](0x194);}return _0x1f89f1;};}function handleError(_0x5816e9,_0x44eded){_0x44eded=_0x44eded||0x1f4;return function(_0x1062e2){logger[_0x124d('0x29')](_0x1062e2[_0x124d('0x2a')]);if(_0x1062e2[_0x124d('0x2b')]){delete _0x1062e2[_0x124d('0x2b')];}_0x5816e9[_0x124d('0x20')](_0x44eded)['send'](_0x1062e2);};}exports[_0x124d('0x2c')]=function(_0x28404e,_0x4dfda7){var _0x485d5c={},_0x55fbc9={},_0x756bfe={'count':0x0,'rows':[]};var _0x4cc061=_[_0x124d('0x2d')](db[_0x124d('0x2e')][_0x124d('0x2f')],function(_0x339178){return{'name':_0x339178['fieldName'],'type':_0x339178['type'][_0x124d('0x30')]};});_0x55fbc9[_0x124d('0x31')]=_[_0x124d('0x2d')](_0x4cc061,_0x124d('0x2b'));_0x55fbc9[_0x124d('0x32')]=_[_0x124d('0x33')](_0x28404e[_0x124d('0x32')]);_0x55fbc9[_0x124d('0x34')]=_[_0x124d('0x35')](_0x55fbc9[_0x124d('0x31')],_0x55fbc9[_0x124d('0x32')]);_0x485d5c['attributes']=_['intersection'](_0x55fbc9[_0x124d('0x31')],qs[_0x124d('0x36')](_0x28404e[_0x124d('0x32')]['fields']));_0x485d5c[_0x124d('0x37')]=_0x485d5c[_0x124d('0x37')][_0x124d('0x38')]?_0x485d5c[_0x124d('0x37')]:_0x55fbc9[_0x124d('0x31')];if(!_0x28404e[_0x124d('0x32')]['hasOwnProperty']('nolimit')){_0x485d5c[_0x124d('0x39')]=qs[_0x124d('0x39')](_0x28404e[_0x124d('0x32')]['limit']);_0x485d5c[_0x124d('0x1f')]=qs[_0x124d('0x1f')](_0x28404e[_0x124d('0x32')][_0x124d('0x1f')]);}_0x485d5c[_0x124d('0x3a')]=qs[_0x124d('0x3b')](_0x28404e[_0x124d('0x32')][_0x124d('0x3b')]);_0x485d5c['where']=qs[_0x124d('0x34')](_[_0x124d('0x3c')](_0x28404e[_0x124d('0x32')],_0x55fbc9[_0x124d('0x34')]),_0x4cc061);if(_0x28404e[_0x124d('0x32')]['filter']){_0x485d5c[_0x124d('0x3d')]=_[_0x124d('0x3e')](_0x485d5c[_0x124d('0x3d')],{'$or':_[_0x124d('0x2d')](_0x4cc061,function(_0x4e772c){if(_0x4e772c[_0x124d('0x3f')]!==_0x124d('0x40')){var _0x355f1e={};_0x355f1e[_0x4e772c[_0x124d('0x2b')]]={'$like':'%'+_0x28404e['query'][_0x124d('0x41')]+'%'};return _0x355f1e;}})});}_0x485d5c=_['merge']({},_0x485d5c,_0x28404e[_0x124d('0x42')]);var _0x403810={'where':_0x485d5c[_0x124d('0x3d')]};return db[_0x124d('0x2e')][_0x124d('0x1e')](_0x403810)['then'](function(_0x5400ff){_0x756bfe['count']=_0x5400ff;if(_0x28404e[_0x124d('0x32')][_0x124d('0x43')]){_0x485d5c[_0x124d('0x44')]=[{'all':!![]}];}return db[_0x124d('0x2e')]['findAll'](_0x485d5c);})['then'](function(_0x6cde02){_0x756bfe['rows']=_0x6cde02;return _0x756bfe;})[_0x124d('0x26')](respondWithFilteredResult(_0x4dfda7,_0x485d5c))[_0x124d('0x45')](handleError(_0x4dfda7,null));};exports['show']=function(_0x30da52,_0x802d18){var _0x59ebeb={'raw':![],'where':{'id':_0x30da52[_0x124d('0x46')]['id']}},_0x10e7dc={};_0x10e7dc[_0x124d('0x31')]=_['keys'](db[_0x124d('0x2e')][_0x124d('0x2f')]);_0x10e7dc[_0x124d('0x32')]=_[_0x124d('0x33')](_0x30da52[_0x124d('0x32')]);_0x10e7dc['filters']=_[_0x124d('0x35')](_0x10e7dc[_0x124d('0x31')],_0x10e7dc[_0x124d('0x32')]);_0x59ebeb['attributes']=_['intersection'](_0x10e7dc[_0x124d('0x31')],qs['fields'](_0x30da52[_0x124d('0x32')][_0x124d('0x36')]));_0x59ebeb['attributes']=_0x59ebeb['attributes'][_0x124d('0x38')]?_0x59ebeb[_0x124d('0x37')]:_0x10e7dc[_0x124d('0x31')];if(_0x30da52[_0x124d('0x32')][_0x124d('0x43')]){_0x59ebeb['include']=[{'all':!![]}];}_0x59ebeb=_[_0x124d('0x3e')]({},_0x59ebeb,_0x30da52[_0x124d('0x42')]);return db['SquareProject']['find'](_0x59ebeb)['then'](handleEntityNotFound(_0x802d18,null))[_0x124d('0x26')](respondWithResult(_0x802d18,null))[_0x124d('0x45')](handleError(_0x802d18,null));};exports['create']=function(_0x144531,_0x33eb24){return db[_0x124d('0x2e')]['create'](_0x144531['body'],{})[_0x124d('0x26')](function(_0xc839ab){var _0x30d3d5=_0x144531[_0x124d('0x47')][_0x124d('0x27')]({'plain':!![]});if(!_0x30d3d5)throw new Error(_0x124d('0x48'));if(_0x30d3d5['role']===_0x124d('0x47')){var _0x482531=_0xc839ab[_0x124d('0x27')]({'plain':!![]});var _0x3a6d71=_0x124d('0x49');return db['UserProfileSection'][_0x124d('0x4a')]({'where':{'name':_0x3a6d71,'userProfileId':_0x30d3d5[_0x124d('0x4b')]},'raw':!![]})['then'](function(_0x12dc53){if(_0x12dc53&&_0x12dc53['autoAssociation']===0x0){return db[_0x124d('0x4c')][_0x124d('0x4d')]({'name':_0x482531[_0x124d('0x2b')],'resourceId':_0x482531['id'],'type':_0x12dc53['name'],'sectionId':_0x12dc53['id']},{})[_0x124d('0x26')](function(){return _0xc839ab;});}else{return _0xc839ab;}})[_0x124d('0x45')](function(_0x4b022a){logger[_0x124d('0x29')](_0x124d('0x4e'),_0x4b022a);throw _0x4b022a;});}return _0xc839ab;})[_0x124d('0x26')](respondWithResult(_0x33eb24,0xc9))[_0x124d('0x45')](handleError(_0x33eb24,null));};exports[_0x124d('0x4f')]=function(_0x4237fb,_0x5e0cfd){if(_0x4237fb[_0x124d('0x50')]['id']){delete _0x4237fb[_0x124d('0x50')]['id'];}return db[_0x124d('0x2e')][_0x124d('0x4a')]({'where':{'id':_0x4237fb['params']['id']}})['then'](handleEntityNotFound(_0x5e0cfd,null))[_0x124d('0x26')](saveUpdates(_0x4237fb['body'],null))['then'](respondWithResult(_0x5e0cfd,null))['catch'](handleError(_0x5e0cfd,null));};exports[_0x124d('0x28')]=function(_0x1d7e60,_0x239b65){return db[_0x124d('0x2e')]['find']({'where':{'id':_0x1d7e60[_0x124d('0x46')]['id']}})[_0x124d('0x26')](handleEntityNotFound(_0x239b65,null))[_0x124d('0x26')](removeEntity(_0x239b65,null))['catch'](handleError(_0x239b65,null));};exports[_0x124d('0x51')]=function(_0x357e1c,_0x339d7a,_0x371285){return db['SquareProject'][_0x124d('0x4a')]({'where':{'id':_0x357e1c[_0x124d('0x46')]['id']}})[_0x124d('0x26')](handleEntityNotFound(_0x339d7a,null))[_0x124d('0x26')](function(_0x4b568c){if(_0x4b568c){return _0x4b568c[_0x124d('0x51')](_0x357e1c[_0x124d('0x50')]['ids'],_[_0x124d('0x52')](_0x357e1c[_0x124d('0x50')],[_0x124d('0x53'),'id'])||{});}})[_0x124d('0x26')](respondWithResult(_0x339d7a,null))[_0x124d('0x45')](handleError(_0x339d7a,null));};exports[_0x124d('0x54')]=function(_0x7ce1a1,_0x4117ee,_0x3e17a9){return db[_0x124d('0x2e')][_0x124d('0x4a')]({'where':{'id':_0x7ce1a1[_0x124d('0x46')]['id']}})[_0x124d('0x26')](handleEntityNotFound(_0x4117ee,null))[_0x124d('0x26')](function(_0x523d06){if(_0x523d06){return _0x523d06['removeUsers'](_0x7ce1a1['query']['ids'])[_0x124d('0x26')](function(){if(_[_0x124d('0x55')](_0x7ce1a1[_0x124d('0x32')]['ids'])){for(var _0x4faa0f=0x0;_0x4faa0f<_0x7ce1a1['query'][_0x124d('0x53')][_0x124d('0x38')];_0x4faa0f+=0x1){socket[_0x124d('0x56')](_0x124d('0x57'),{'UserId':Number(_0x7ce1a1[_0x124d('0x32')]['ids'][_0x4faa0f]),'SquareProjectId':Number(_0x7ce1a1[_0x124d('0x46')]['id'])});}}else{socket[_0x124d('0x56')](_0x124d('0x57'),{'UserId':Number(_0x7ce1a1[_0x124d('0x32')]['ids']),'SquareProjectId':Number(_0x7ce1a1['params']['id'])});}});}})[_0x124d('0x26')](respondWithStatusCode(_0x4117ee,null))[_0x124d('0x45')](handleError(_0x4117ee,null));};exports[_0x124d('0x58')]=function(_0x249d81,_0x24211e,_0x3f130f){var _0x52cf47={};var _0x1396fc={};var _0x25e7fb;var _0x3c901d;return db[_0x124d('0x2e')]['findOne']({'where':{'id':_0x249d81['params']['id']}})[_0x124d('0x26')](handleEntityNotFound(_0x24211e,null))[_0x124d('0x26')](function(_0x435d71){if(_0x435d71){_0x25e7fb=_0x435d71;_0x1396fc['model']=_[_0x124d('0x33')](db['User'][_0x124d('0x2f')]);_0x1396fc[_0x124d('0x32')]=_[_0x124d('0x33')](_0x249d81[_0x124d('0x32')]);_0x1396fc[_0x124d('0x34')]=_['intersection'](_0x1396fc['model'],_0x1396fc['query']);_0x52cf47[_0x124d('0x37')]=_['intersection'](_0x1396fc[_0x124d('0x31')],qs[_0x124d('0x36')](_0x249d81[_0x124d('0x32')][_0x124d('0x36')]));_0x52cf47['attributes']=_0x52cf47[_0x124d('0x37')]['length']?_0x52cf47[_0x124d('0x37')]:_0x1396fc[_0x124d('0x31')];_0x52cf47[_0x124d('0x3a')]=qs[_0x124d('0x3b')](_0x249d81[_0x124d('0x32')][_0x124d('0x3b')]);_0x52cf47['where']=qs[_0x124d('0x34')](_[_0x124d('0x3c')](_0x249d81[_0x124d('0x32')],_0x1396fc[_0x124d('0x34')]));if(_0x249d81[_0x124d('0x32')][_0x124d('0x41')]){_0x52cf47[_0x124d('0x3d')]=_['merge'](_0x52cf47[_0x124d('0x3d')],{'$or':_[_0x124d('0x2d')](_0x52cf47[_0x124d('0x37')],function(_0x5d8ea5){var _0x3d4095={};_0x3d4095[_0x5d8ea5]={'$like':'%'+_0x249d81[_0x124d('0x32')][_0x124d('0x41')]+'%'};return _0x3d4095;})});}_0x52cf47=_[_0x124d('0x3e')]({},_0x52cf47,_0x249d81['options']);return _0x25e7fb['getUsers'](_0x52cf47);}})['then'](function(_0x486edc){if(_0x486edc){_0x3c901d=_0x486edc[_0x124d('0x38')];if(!_0x249d81['query'][_0x124d('0x59')]('nolimit')){_0x52cf47[_0x124d('0x39')]=qs['limit'](_0x249d81['query']['limit']);_0x52cf47[_0x124d('0x1f')]=qs['offset'](_0x249d81['query']['offset']);}return _0x25e7fb['getUsers'](_0x52cf47);}})[_0x124d('0x26')](function(_0x318f04){if(_0x318f04){return _0x318f04?{'count':_0x3c901d,'rows':_0x318f04}:null;}})[_0x124d('0x26')](respondWithResult(_0x24211e,null))[_0x124d('0x45')](handleError(_0x24211e,null));}; \ No newline at end of file +var _0x8c61=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','findOne','User','order','getUsers','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','SquareProjects','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','SquareProject','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge','options','include','findAll','rows','show','params','create','body'];(function(_0x4a599b,_0x1d2125){var _0x2d53d3=function(_0x5e7982){while(--_0x5e7982){_0x4a599b['push'](_0x4a599b['shift']());}};_0x2d53d3(++_0x1d2125);}(_0x8c61,0x7a));var _0x18c6=function(_0x22d62d,_0x33b816){_0x22d62d=_0x22d62d-0x0;var _0x20ef48=_0x8c61[_0x22d62d];return _0x20ef48;};'use strict';var pdf=require(_0x18c6('0x0'));var emlformat=require(_0x18c6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x18c6('0x2'));var jsonpatch=require(_0x18c6('0x3'));var rp=require(_0x18c6('0x4'));var moment=require(_0x18c6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x18c6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x18c6('0x7'));var csv=require(_0x18c6('0x8'));var ejs=require(_0x18c6('0x9'));var fs=require('fs');var _=require(_0x18c6('0xa'));var squel=require(_0x18c6('0xb'));var crypto=require(_0x18c6('0xc'));var jsforce=require(_0x18c6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x18c6('0x8'));var querystring=require(_0x18c6('0xe'));var Papa=require(_0x18c6('0xf'));var Redis=require(_0x18c6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x18c6('0x11'));var as=require(_0x18c6('0x12'));var hardwareService=require(_0x18c6('0x13'));var logger=require(_0x18c6('0x14'))(_0x18c6('0x15'));var utils=require(_0x18c6('0x16'));var config=require(_0x18c6('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x18c6('0x18')],{'host':_0x18c6('0x19'),'port':0x18eb});var socket=require(_0x18c6('0x1a'))(new Redis(config[_0x18c6('0x18')]));require(_0x18c6('0x1b'))[_0x18c6('0x1c')](socket);function respondWithStatusCode(_0xfd0278,_0x5e4db6){_0x5e4db6=_0x5e4db6||0xcc;return function(_0x23fd06){if(_0x23fd06){return _0xfd0278['sendStatus'](_0x5e4db6);}return _0xfd0278[_0x18c6('0x1d')](_0x5e4db6)[_0x18c6('0x1e')]();};}function respondWithResult(_0x35829f,_0x15641c){_0x15641c=_0x15641c||0xc8;return function(_0x20f8ff){if(_0x20f8ff){return _0x35829f[_0x18c6('0x1d')](_0x15641c)[_0x18c6('0x1f')](_0x20f8ff);}};}function respondWithFilteredResult(_0x27a130,_0x54fa45){return function(_0x335bb6){if(_0x335bb6){var _0x2aece5=_0x335bb6[_0x18c6('0x20')],_0x16c848=_0x54fa45[_0x18c6('0x21')],_0x4e18c2=_0x54fa45[_0x18c6('0x21')]+_0x54fa45[_0x18c6('0x22')],_0x3db0ee;if(_0x4e18c2>=_0x2aece5){_0x4e18c2=_0x2aece5;_0x3db0ee=0xc8;}else{_0x3db0ee=0xce;}_0x27a130[_0x18c6('0x1d')](_0x3db0ee);return _0x27a130[_0x18c6('0x23')](_0x18c6('0x24'),_0x16c848+'-'+_0x4e18c2+'/'+_0x2aece5)[_0x18c6('0x1f')](_0x335bb6);}return null;};}function patchUpdates(_0x3e634e){return function(_0x5b72dd){try{jsonpatch[_0x18c6('0x25')](_0x5b72dd,_0x3e634e,!![]);}catch(_0x227676){return BPromise[_0x18c6('0x26')](_0x227676);}return _0x5b72dd[_0x18c6('0x27')]();};}function saveUpdates(_0x17f902,_0x1d1067){return function(_0x4d3bf4){if(_0x4d3bf4){return _0x4d3bf4['update'](_0x17f902)[_0x18c6('0x28')](function(_0x1d9df8){return _0x1d9df8;});}return null;};}function removeEntity(_0x27cbd0,_0x3c96b2){return function(_0x5adac7){if(_0x5adac7){return _0x5adac7['destroy']()['then'](function(){var _0x28d54f=_0x5adac7[_0x18c6('0x29')]({'plain':!![]});var _0x1e1489=_0x18c6('0x2a');return db[_0x18c6('0x2b')][_0x18c6('0x2c')]({'where':{'type':_0x1e1489,'resourceId':_0x28d54f['id']}})['then'](function(){return _0x5adac7;});})[_0x18c6('0x28')](function(){_0x27cbd0[_0x18c6('0x1d')](0xcc)[_0x18c6('0x1e')]();});}};}function handleEntityNotFound(_0x2c0d53,_0x314b64){return function(_0x169395){if(!_0x169395){_0x2c0d53[_0x18c6('0x2d')](0x194);}return _0x169395;};}function handleError(_0x202bf3,_0x5bf3ec){_0x5bf3ec=_0x5bf3ec||0x1f4;return function(_0x3fcaca){logger[_0x18c6('0x2e')](_0x3fcaca[_0x18c6('0x2f')]);if(_0x3fcaca[_0x18c6('0x30')]){delete _0x3fcaca[_0x18c6('0x30')];}_0x202bf3[_0x18c6('0x1d')](_0x5bf3ec)[_0x18c6('0x31')](_0x3fcaca);};}exports[_0x18c6('0x32')]=function(_0x39fcf3,_0x1f00e1){var _0x1f2596={},_0x531a15={},_0x4fbff2={'count':0x0,'rows':[]};var _0x22ed87=_['map'](db[_0x18c6('0x33')][_0x18c6('0x34')],function(_0x1c7898){return{'name':_0x1c7898[_0x18c6('0x35')],'type':_0x1c7898[_0x18c6('0x36')][_0x18c6('0x37')]};});_0x531a15['model']=_['map'](_0x22ed87,_0x18c6('0x30'));_0x531a15[_0x18c6('0x38')]=_[_0x18c6('0x39')](_0x39fcf3[_0x18c6('0x38')]);_0x531a15[_0x18c6('0x3a')]=_[_0x18c6('0x3b')](_0x531a15[_0x18c6('0x3c')],_0x531a15[_0x18c6('0x38')]);_0x1f2596[_0x18c6('0x3d')]=_[_0x18c6('0x3b')](_0x531a15[_0x18c6('0x3c')],qs['fields'](_0x39fcf3[_0x18c6('0x38')][_0x18c6('0x3e')]));_0x1f2596[_0x18c6('0x3d')]=_0x1f2596[_0x18c6('0x3d')][_0x18c6('0x3f')]?_0x1f2596['attributes']:_0x531a15['model'];if(!_0x39fcf3[_0x18c6('0x38')][_0x18c6('0x40')]('nolimit')){_0x1f2596[_0x18c6('0x22')]=qs[_0x18c6('0x22')](_0x39fcf3[_0x18c6('0x38')][_0x18c6('0x22')]);_0x1f2596[_0x18c6('0x21')]=qs['offset'](_0x39fcf3[_0x18c6('0x38')][_0x18c6('0x21')]);}_0x1f2596['order']=qs['sort'](_0x39fcf3[_0x18c6('0x38')][_0x18c6('0x41')]);_0x1f2596[_0x18c6('0x42')]=qs['filters'](_[_0x18c6('0x43')](_0x39fcf3[_0x18c6('0x38')],_0x531a15['filters']),_0x22ed87);if(_0x39fcf3['query'][_0x18c6('0x44')]){_0x1f2596[_0x18c6('0x42')]=_['merge'](_0x1f2596[_0x18c6('0x42')],{'$or':_[_0x18c6('0x45')](_0x22ed87,function(_0x5e19fd){if(_0x5e19fd[_0x18c6('0x36')]!==_0x18c6('0x46')){var _0x1e5d96={};_0x1e5d96[_0x5e19fd[_0x18c6('0x30')]]={'$like':'%'+_0x39fcf3[_0x18c6('0x38')][_0x18c6('0x44')]+'%'};return _0x1e5d96;}})});}_0x1f2596=_[_0x18c6('0x47')]({},_0x1f2596,_0x39fcf3[_0x18c6('0x48')]);var _0x13b8e4={'where':_0x1f2596['where']};return db[_0x18c6('0x33')][_0x18c6('0x20')](_0x13b8e4)[_0x18c6('0x28')](function(_0x565997){_0x4fbff2[_0x18c6('0x20')]=_0x565997;if(_0x39fcf3[_0x18c6('0x38')]['includeAll']){_0x1f2596[_0x18c6('0x49')]=[{'all':!![]}];}return db[_0x18c6('0x33')][_0x18c6('0x4a')](_0x1f2596);})[_0x18c6('0x28')](function(_0x4f1d7d){_0x4fbff2[_0x18c6('0x4b')]=_0x4f1d7d;return _0x4fbff2;})[_0x18c6('0x28')](respondWithFilteredResult(_0x1f00e1,_0x1f2596))['catch'](handleError(_0x1f00e1,null));};exports[_0x18c6('0x4c')]=function(_0x36e620,_0x31d9c5){var _0x1f8020={'raw':![],'where':{'id':_0x36e620[_0x18c6('0x4d')]['id']}},_0x3df5a2={};_0x3df5a2['model']=_[_0x18c6('0x39')](db[_0x18c6('0x33')][_0x18c6('0x34')]);_0x3df5a2[_0x18c6('0x38')]=_[_0x18c6('0x39')](_0x36e620[_0x18c6('0x38')]);_0x3df5a2[_0x18c6('0x3a')]=_[_0x18c6('0x3b')](_0x3df5a2[_0x18c6('0x3c')],_0x3df5a2['query']);_0x1f8020[_0x18c6('0x3d')]=_[_0x18c6('0x3b')](_0x3df5a2[_0x18c6('0x3c')],qs[_0x18c6('0x3e')](_0x36e620['query']['fields']));_0x1f8020[_0x18c6('0x3d')]=_0x1f8020[_0x18c6('0x3d')][_0x18c6('0x3f')]?_0x1f8020['attributes']:_0x3df5a2['model'];if(_0x36e620[_0x18c6('0x38')]['includeAll']){_0x1f8020['include']=[{'all':!![]}];}_0x1f8020=_[_0x18c6('0x47')]({},_0x1f8020,_0x36e620[_0x18c6('0x48')]);return db[_0x18c6('0x33')]['find'](_0x1f8020)['then'](handleEntityNotFound(_0x31d9c5,null))[_0x18c6('0x28')](respondWithResult(_0x31d9c5,null))['catch'](handleError(_0x31d9c5,null));};exports[_0x18c6('0x4e')]=function(_0x39ad38,_0x37e405){return db['SquareProject'][_0x18c6('0x4e')](_0x39ad38[_0x18c6('0x4f')],{})['then'](function(_0x360436){var _0x1e72a6=_0x39ad38['user'][_0x18c6('0x29')]({'plain':!![]});if(!_0x1e72a6)throw new Error(_0x18c6('0x50'));if(_0x1e72a6[_0x18c6('0x51')]===_0x18c6('0x52')){var _0x4f2d8d=_0x360436[_0x18c6('0x29')]({'plain':!![]});var _0x59632a=_0x18c6('0x2a');return db[_0x18c6('0x53')][_0x18c6('0x54')]({'where':{'name':_0x59632a,'userProfileId':_0x1e72a6[_0x18c6('0x55')]},'raw':!![]})[_0x18c6('0x28')](function(_0x2632d9){if(_0x2632d9&&_0x2632d9['autoAssociation']===0x0){return db['UserProfileResource'][_0x18c6('0x4e')]({'name':_0x4f2d8d[_0x18c6('0x30')],'resourceId':_0x4f2d8d['id'],'type':_0x2632d9[_0x18c6('0x30')],'sectionId':_0x2632d9['id']},{})['then'](function(){return _0x360436;});}else{return _0x360436;}})[_0x18c6('0x56')](function(_0x33e285){logger[_0x18c6('0x2e')](_0x18c6('0x57'),_0x33e285);throw _0x33e285;});}return _0x360436;})[_0x18c6('0x28')](respondWithResult(_0x37e405,0xc9))['catch'](handleError(_0x37e405,null));};exports[_0x18c6('0x58')]=function(_0x30fd90,_0x23f3dc){if(_0x30fd90[_0x18c6('0x4f')]['id']){delete _0x30fd90[_0x18c6('0x4f')]['id'];}return db[_0x18c6('0x33')][_0x18c6('0x54')]({'where':{'id':_0x30fd90['params']['id']}})[_0x18c6('0x28')](handleEntityNotFound(_0x23f3dc,null))[_0x18c6('0x28')](saveUpdates(_0x30fd90[_0x18c6('0x4f')],null))[_0x18c6('0x28')](respondWithResult(_0x23f3dc,null))[_0x18c6('0x56')](handleError(_0x23f3dc,null));};exports[_0x18c6('0x2c')]=function(_0xe7ab4a,_0x3cf745){return db[_0x18c6('0x33')][_0x18c6('0x54')]({'where':{'id':_0xe7ab4a[_0x18c6('0x4d')]['id']}})[_0x18c6('0x28')](handleEntityNotFound(_0x3cf745,null))[_0x18c6('0x28')](removeEntity(_0x3cf745,null))[_0x18c6('0x56')](handleError(_0x3cf745,null));};exports['addUsers']=function(_0x171b8a,_0x2c82a6,_0x391ae3){return db[_0x18c6('0x33')][_0x18c6('0x54')]({'where':{'id':_0x171b8a[_0x18c6('0x4d')]['id']}})[_0x18c6('0x28')](handleEntityNotFound(_0x2c82a6,null))[_0x18c6('0x28')](function(_0x5f1f8b){if(_0x5f1f8b){return _0x5f1f8b[_0x18c6('0x59')](_0x171b8a[_0x18c6('0x4f')][_0x18c6('0x5a')],_[_0x18c6('0x5b')](_0x171b8a['body'],[_0x18c6('0x5a'),'id'])||{});}})[_0x18c6('0x28')](respondWithResult(_0x2c82a6,null))[_0x18c6('0x56')](handleError(_0x2c82a6,null));};exports[_0x18c6('0x5c')]=function(_0x2d20f6,_0x5499b7,_0x5b86aa){return db[_0x18c6('0x33')][_0x18c6('0x54')]({'where':{'id':_0x2d20f6[_0x18c6('0x4d')]['id']}})[_0x18c6('0x28')](handleEntityNotFound(_0x5499b7,null))[_0x18c6('0x28')](function(_0x31f5b1){if(_0x31f5b1){return _0x31f5b1[_0x18c6('0x5c')](_0x2d20f6[_0x18c6('0x38')][_0x18c6('0x5a')])[_0x18c6('0x28')](function(){if(_[_0x18c6('0x5d')](_0x2d20f6[_0x18c6('0x38')][_0x18c6('0x5a')])){for(var _0xe0a490=0x0;_0xe0a490<_0x2d20f6['query'][_0x18c6('0x5a')][_0x18c6('0x3f')];_0xe0a490+=0x1){socket['emit'](_0x18c6('0x5e'),{'UserId':Number(_0x2d20f6['query'][_0x18c6('0x5a')][_0xe0a490]),'SquareProjectId':Number(_0x2d20f6[_0x18c6('0x4d')]['id'])});}}else{socket[_0x18c6('0x5f')](_0x18c6('0x5e'),{'UserId':Number(_0x2d20f6[_0x18c6('0x38')]['ids']),'SquareProjectId':Number(_0x2d20f6[_0x18c6('0x4d')]['id'])});}});}})[_0x18c6('0x28')](respondWithStatusCode(_0x5499b7,null))[_0x18c6('0x56')](handleError(_0x5499b7,null));};exports['getUsers']=function(_0x37ba5e,_0x5a5616,_0x4f2927){var _0x33c7f4={};var _0xbbd3af={};var _0x27b972;var _0x2866aa;return db[_0x18c6('0x33')][_0x18c6('0x60')]({'where':{'id':_0x37ba5e[_0x18c6('0x4d')]['id']}})[_0x18c6('0x28')](handleEntityNotFound(_0x5a5616,null))['then'](function(_0x5814eb){if(_0x5814eb){_0x27b972=_0x5814eb;_0xbbd3af[_0x18c6('0x3c')]=_[_0x18c6('0x39')](db[_0x18c6('0x61')][_0x18c6('0x34')]);_0xbbd3af[_0x18c6('0x38')]=_[_0x18c6('0x39')](_0x37ba5e[_0x18c6('0x38')]);_0xbbd3af[_0x18c6('0x3a')]=_['intersection'](_0xbbd3af[_0x18c6('0x3c')],_0xbbd3af[_0x18c6('0x38')]);_0x33c7f4[_0x18c6('0x3d')]=_[_0x18c6('0x3b')](_0xbbd3af[_0x18c6('0x3c')],qs[_0x18c6('0x3e')](_0x37ba5e[_0x18c6('0x38')]['fields']));_0x33c7f4['attributes']=_0x33c7f4[_0x18c6('0x3d')][_0x18c6('0x3f')]?_0x33c7f4['attributes']:_0xbbd3af[_0x18c6('0x3c')];_0x33c7f4[_0x18c6('0x62')]=qs[_0x18c6('0x41')](_0x37ba5e['query']['sort']);_0x33c7f4[_0x18c6('0x42')]=qs['filters'](_[_0x18c6('0x43')](_0x37ba5e[_0x18c6('0x38')],_0xbbd3af['filters']));if(_0x37ba5e['query'][_0x18c6('0x44')]){_0x33c7f4[_0x18c6('0x42')]=_[_0x18c6('0x47')](_0x33c7f4[_0x18c6('0x42')],{'$or':_[_0x18c6('0x45')](_0x33c7f4[_0x18c6('0x3d')],function(_0x165522){var _0x65742f={};_0x65742f[_0x165522]={'$like':'%'+_0x37ba5e[_0x18c6('0x38')][_0x18c6('0x44')]+'%'};return _0x65742f;})});}_0x33c7f4=_[_0x18c6('0x47')]({},_0x33c7f4,_0x37ba5e['options']);return _0x27b972[_0x18c6('0x63')](_0x33c7f4);}})[_0x18c6('0x28')](function(_0x2d3a10){if(_0x2d3a10){_0x2866aa=_0x2d3a10[_0x18c6('0x3f')];if(!_0x37ba5e[_0x18c6('0x38')][_0x18c6('0x40')](_0x18c6('0x64'))){_0x33c7f4[_0x18c6('0x22')]=qs['limit'](_0x37ba5e[_0x18c6('0x38')][_0x18c6('0x22')]);_0x33c7f4[_0x18c6('0x21')]=qs[_0x18c6('0x21')](_0x37ba5e[_0x18c6('0x38')]['offset']);}return _0x27b972[_0x18c6('0x63')](_0x33c7f4);}})[_0x18c6('0x28')](function(_0x360f5d){if(_0x360f5d){return _0x360f5d?{'count':_0x2866aa,'rows':_0x360f5d}:null;}})['then'](respondWithResult(_0x5a5616,null))[_0x18c6('0x56')](handleError(_0x5a5616,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 3e5b270..8bad8ea 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 _0x7846=['../../mysqldb','SquareProject','save','emit','hasOwnProperty','hook','exports','events'];(function(_0x4d0b45,_0x567a20){var _0x3610c9=function(_0x125c77){while(--_0x125c77){_0x4d0b45['push'](_0x4d0b45['shift']());}};_0x3610c9(++_0x567a20);}(_0x7846,0xbf));var _0x6784=function(_0x43371b,_0x1cb4cf){_0x43371b=_0x43371b-0x0;var _0x19cd26=_0x7846[_0x43371b];return _0x19cd26;};'use strict';var EventEmitter=require(_0x6784('0x0'));var SquareProject=require(_0x6784('0x1'))['db'][_0x6784('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6784('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x17c971){return function(_0x419f3d,_0x5a59d1,_0x38eee3){SquareProjectEvents[_0x6784('0x4')](_0x17c971+':'+_0x419f3d['id'],_0x419f3d);SquareProjectEvents[_0x6784('0x4')](_0x17c971,_0x419f3d);_0x38eee3(null);};}for(var e in events){if(events[_0x6784('0x5')](e)){var event=events[e];SquareProject[_0x6784('0x6')](e,emitEvent(event));}}module[_0x6784('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x374f=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x431a28,_0x1854ca){var _0x3885b7=function(_0x482f7f){while(--_0x482f7f){_0x431a28['push'](_0x431a28['shift']());}};_0x3885b7(++_0x1854ca);}(_0x374f,0x13f));var _0xf374=function(_0x5579ae,_0xf83ee){_0x5579ae=_0x5579ae-0x0;var _0x6490f0=_0x374f[_0x5579ae];return _0x6490f0;};'use strict';var EventEmitter=require(_0xf374('0x0'));var SquareProject=require(_0xf374('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xf374('0x2')](0x0);var events={'afterCreate':_0xf374('0x3'),'afterUpdate':_0xf374('0x4'),'afterDestroy':_0xf374('0x5')};function emitEvent(_0x3a54de){return function(_0x344992,_0x391918,_0x148e4a){SquareProjectEvents[_0xf374('0x6')](_0x3a54de+':'+_0x344992['id'],_0x344992);SquareProjectEvents[_0xf374('0x6')](_0x3a54de,_0x344992);_0x148e4a(null);};}for(var e in events){if(events[_0xf374('0x7')](e)){var event=events[e];SquareProject[_0xf374('0x8')](e,emitEvent(event));}}module[_0xf374('0x9')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 9ee16f8..4962bbf 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 _0x1967=['path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4cae38,_0x1f7372){var _0x4fc0d6=function(_0x105335){while(--_0x105335){_0x4cae38['push'](_0x4cae38['shift']());}};_0x4fc0d6(++_0x1f7372);}(_0x1967,0x173));var _0x7196=function(_0x2aba91,_0x22ebc9){_0x2aba91=_0x2aba91-0x0;var _0x120433=_0x1967[_0x2aba91];return _0x120433;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['exports','define','SquareProject','square_projects','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./squareProject.attributes'];(function(_0x29f9d6,_0x5e232b){var _0xb9d84c=function(_0x1807c2){while(--_0x1807c2){_0x29f9d6['push'](_0x29f9d6['shift']());}};_0xb9d84c(++_0x5e232b);}(_0x2ef3,0xba));var _0x32ef=function(_0x19195c,_0x4118e6){_0x19195c=_0x19195c-0x0;var _0x35a85d=_0x2ef3[_0x19195c];return _0x35a85d;};'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/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 4087df6..6aae1b4 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 _0x581d=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','SquareProject,\x20%s,\x20%s','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ShowSquareProject','find','options','attributes','include','map','model','debug','catch','lodash','moment','randomstring'];(function(_0x9ce58e,_0x44e4f3){var _0x554be0=function(_0x3895aa){while(--_0x3895aa){_0x9ce58e['push'](_0x9ce58e['shift']());}};_0x554be0(++_0x44e4f3);}(_0x581d,0xc9));var _0xd581=function(_0x27f04a,_0x44725b){_0x27f04a=_0x27f04a-0x0;var _0x5049de=_0x581d[_0x27f04a];return _0x5049de;};'use strict';var _=require(_0xd581('0x0'));var util=require('util');var moment=require(_0xd581('0x1'));var BPromise=require('bluebird');var rs=require(_0xd581('0x2'));var fs=require('fs');var Redis=require(_0xd581('0x3'));var db=require(_0xd581('0x4'))['db'];var utils=require(_0xd581('0x5'));var logger=require(_0xd581('0x6'))('rpc');var config=require(_0xd581('0x7'));var jayson=require(_0xd581('0x8'));var client=jayson[_0xd581('0x9')][_0xd581('0xa')]({'port':0x232a});config['redis']=_[_0xd581('0xb')](config[_0xd581('0xc')],{'host':_0xd581('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd581('0xc')]));require('./squareProject.socket')[_0xd581('0xe')](socket);function respondWithRpcPromise(_0x5b106e,_0x504c36,_0x5b832f){return new BPromise(function(_0x5ec6ee,_0x399431){return client[_0xd581('0xf')](_0x5b106e,_0x5b832f)[_0xd581('0x10')](function(_0x3c5371){logger[_0xd581('0x11')](_0xd581('0x12'),_0x504c36,'request\x20sent');logger['debug'](_0xd581('0x13'),_0x504c36,_0xd581('0x14'),JSON['stringify'](_0x3c5371));if(_0x3c5371['error']){if(_0x3c5371[_0xd581('0x15')][_0xd581('0x16')]===0x1f4){logger[_0xd581('0x15')]('SquareProject,\x20%s,\x20%s',_0x504c36,_0x3c5371[_0xd581('0x15')][_0xd581('0x17')]);return _0x399431(_0x3c5371[_0xd581('0x15')][_0xd581('0x17')]);}logger['error'](_0xd581('0x12'),_0x504c36,_0x3c5371[_0xd581('0x15')][_0xd581('0x17')]);return _0x5ec6ee(_0x3c5371[_0xd581('0x15')][_0xd581('0x17')]);}else{logger[_0xd581('0x11')](_0xd581('0x12'),_0x504c36,'request\x20sent');_0x5ec6ee(_0x3c5371[_0xd581('0x18')][_0xd581('0x17')]);}})['catch'](function(_0x2bf54c){logger[_0xd581('0x15')]('SquareProject,\x20%s,\x20%s',_0x504c36,_0x2bf54c);_0x399431(_0x2bf54c);});});}exports[_0xd581('0x19')]=function(_0x181186){var _0x537543=this;return new Promise(function(_0x2279e4,_0x1958ce){return db['SquareProject'][_0xd581('0x1a')]({'raw':_0x181186[_0xd581('0x1b')]?_0x181186[_0xd581('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x181186[_0xd581('0x1b')]?_0x181186[_0xd581('0x1b')]['where']||null:null,'attributes':_0x181186['options']?_0x181186['options'][_0xd581('0x1c')]||null:null,'include':_0x181186['options']?_0x181186[_0xd581('0x1b')][_0xd581('0x1d')]?_[_0xd581('0x1e')](_0x181186[_0xd581('0x1b')][_0xd581('0x1d')],function(_0x2442ff){return{'model':db[_0x2442ff['model']],'as':_0x2442ff['as'],'attributes':_0x2442ff['attributes'],'include':_0x2442ff['include']?_[_0xd581('0x1e')](_0x2442ff[_0xd581('0x1d')],function(_0x5763fc){return{'model':db[_0x5763fc['model']],'as':_0x5763fc['as'],'attributes':_0x5763fc[_0xd581('0x1c')],'include':_0x5763fc[_0xd581('0x1d')]?_[_0xd581('0x1e')](_0x5763fc['include'],function(_0x199452){return{'model':db[_0x199452[_0xd581('0x1f')]],'as':_0x199452['as'],'attributes':_0x199452[_0xd581('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd581('0x10')](function(_0x33faca){logger[_0xd581('0x11')]('ShowSquareProject',_0x181186);logger[_0xd581('0x20')](_0xd581('0x19'),_0x181186,JSON['stringify'](_0x33faca));_0x2279e4(_0x33faca);})[_0xd581('0x21')](function(_0x3888dd){logger[_0xd581('0x15')](_0xd581('0x19'),_0x3888dd[_0xd581('0x17')],_0x181186);_0x1958ce(_0x537543[_0xd581('0x15')](0x1f4,_0x3888dd[_0xd581('0x17')]));});});}; \ No newline at end of file +var _0x49b6=['where','attributes','include','map','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','ShowSquareProject','find','options'];(function(_0x1f797e,_0x2c40a0){var _0x32ee44=function(_0x74bb8d){while(--_0x74bb8d){_0x1f797e['push'](_0x1f797e['shift']());}};_0x32ee44(++_0x2c40a0);}(_0x49b6,0x11d));var _0x649b=function(_0x4b6f5c,_0x56f7ce){_0x4b6f5c=_0x4b6f5c-0x0;var _0x55548b=_0x49b6[_0x4b6f5c];return _0x55548b;};'use strict';var _=require('lodash');var util=require(_0x649b('0x0'));var moment=require(_0x649b('0x1'));var BPromise=require(_0x649b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x649b('0x3'));var db=require(_0x649b('0x4'))['db'];var utils=require(_0x649b('0x5'));var logger=require(_0x649b('0x6'))(_0x649b('0x7'));var config=require(_0x649b('0x8'));var jayson=require(_0x649b('0x9'));var client=jayson[_0x649b('0xa')]['http']({'port':0x232a});config[_0x649b('0xb')]=_[_0x649b('0xc')](config[_0x649b('0xb')],{'host':_0x649b('0xd'),'port':0x18eb});var socket=require(_0x649b('0xe'))(new Redis(config[_0x649b('0xb')]));require('./squareProject.socket')[_0x649b('0xf')](socket);function respondWithRpcPromise(_0x250328,_0x77b3fa,_0x5cc099){return new BPromise(function(_0x56ca9c,_0x56b0f5){return client['request'](_0x250328,_0x5cc099)[_0x649b('0x10')](function(_0x51a0fc){logger['info'](_0x649b('0x11'),_0x77b3fa,_0x649b('0x12'));logger[_0x649b('0x13')](_0x649b('0x14'),_0x77b3fa,_0x649b('0x12'),JSON[_0x649b('0x15')](_0x51a0fc));if(_0x51a0fc[_0x649b('0x16')]){if(_0x51a0fc[_0x649b('0x16')]['code']===0x1f4){logger[_0x649b('0x16')](_0x649b('0x11'),_0x77b3fa,_0x51a0fc['error'][_0x649b('0x17')]);return _0x56b0f5(_0x51a0fc[_0x649b('0x16')][_0x649b('0x17')]);}logger['error'](_0x649b('0x11'),_0x77b3fa,_0x51a0fc['error'][_0x649b('0x17')]);return _0x56ca9c(_0x51a0fc[_0x649b('0x16')]['message']);}else{logger[_0x649b('0x18')](_0x649b('0x11'),_0x77b3fa,_0x649b('0x12'));_0x56ca9c(_0x51a0fc[_0x649b('0x19')][_0x649b('0x17')]);}})[_0x649b('0x1a')](function(_0x14e1f9){logger[_0x649b('0x16')]('SquareProject,\x20%s,\x20%s',_0x77b3fa,_0x14e1f9);_0x56b0f5(_0x14e1f9);});});}exports[_0x649b('0x1b')]=function(_0x5c89ee){var _0x1d7267=this;return new Promise(function(_0x1881b6,_0x459717){return db['SquareProject'][_0x649b('0x1c')]({'raw':_0x5c89ee[_0x649b('0x1d')]?_0x5c89ee[_0x649b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5c89ee[_0x649b('0x1d')]?_0x5c89ee[_0x649b('0x1d')][_0x649b('0x1e')]||null:null,'attributes':_0x5c89ee['options']?_0x5c89ee['options'][_0x649b('0x1f')]||null:null,'include':_0x5c89ee[_0x649b('0x1d')]?_0x5c89ee['options'][_0x649b('0x20')]?_[_0x649b('0x21')](_0x5c89ee[_0x649b('0x1d')]['include'],function(_0x346f36){return{'model':db[_0x346f36['model']],'as':_0x346f36['as'],'attributes':_0x346f36[_0x649b('0x1f')],'include':_0x346f36[_0x649b('0x20')]?_[_0x649b('0x21')](_0x346f36['include'],function(_0x112871){return{'model':db[_0x112871['model']],'as':_0x112871['as'],'attributes':_0x112871[_0x649b('0x1f')],'include':_0x112871[_0x649b('0x20')]?_[_0x649b('0x21')](_0x112871['include'],function(_0x4261b9){return{'model':db[_0x4261b9[_0x649b('0x22')]],'as':_0x4261b9['as'],'attributes':_0x4261b9['attributes']};}):[]};}):[]};}):[]:[]})[_0x649b('0x10')](function(_0x3c91a5){logger[_0x649b('0x18')](_0x649b('0x1b'),_0x5c89ee);logger[_0x649b('0x13')](_0x649b('0x1b'),_0x5c89ee,JSON[_0x649b('0x15')](_0x3c91a5));_0x1881b6(_0x3c91a5);})[_0x649b('0x1a')](function(_0x538fb4){logger['error']('ShowSquareProject',_0x538fb4[_0x649b('0x17')],_0x5c89ee);_0x459717(_0x1d7267[_0x649b('0x16')](0x1f4,_0x538fb4['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index dc1bf81..e18e029 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 _0x4975=['length','./squareProject.events','remove','update','emit','removeListener','register'];(function(_0x3c7625,_0x541c20){var _0x187951=function(_0x28197b){while(--_0x28197b){_0x3c7625['push'](_0x3c7625['shift']());}};_0x187951(++_0x541c20);}(_0x4975,0x86));var _0x5497=function(_0x3fc310,_0x1b505f){_0x3fc310=_0x3fc310-0x0;var _0x110a55=_0x4975[_0x3fc310];return _0x110a55;};'use strict';var SquareProjectEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){SquareProjectEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('squareProject:'+_0x674a2a,_0x539a27);SquareProjectEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0x5d17=['./squareProject.events','save','removeListener','register','length','squareProject:'];(function(_0x4d20ae,_0x5123e2){var _0x5c04a0=function(_0x537049){while(--_0x537049){_0x4d20ae['push'](_0x4d20ae['shift']());}};_0x5c04a0(++_0x5123e2);}(_0x5d17,0x114));var _0x75d1=function(_0xb03c1c,_0x2f98ed){_0xb03c1c=_0xb03c1c-0x0;var _0x507e93=_0x5d17[_0xb03c1c];return _0x507e93;};'use strict';var SquareProjectEvents=require(_0x75d1('0x0'));var events=[_0x75d1('0x1'),'remove','update'];function createListener(_0x39c0ec,_0x426717){return function(_0x1c9ba6){_0x426717['emit'](_0x39c0ec,_0x1c9ba6);};}function removeListener(_0x177460,_0x45d03a){return function(){SquareProjectEvents[_0x75d1('0x2')](_0x177460,_0x45d03a);};}exports[_0x75d1('0x3')]=function(_0x56ac0a){for(var _0x458681=0x0,_0x116a51=events[_0x75d1('0x4')];_0x458681<_0x116a51;_0x458681++){var _0x1ee61b=events[_0x458681];var _0x3a9d5e=createListener(_0x75d1('0x5')+_0x1ee61b,_0x56ac0a);SquareProjectEvents['on'](_0x1ee61b,_0x3a9d5e);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 0a5e73a..953230d 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 _0xc241=['update','/:id/delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','/:id','isAuthenticated','show','/:id/download','create','put'];(function(_0x103afb,_0x47dae6){var _0x1a88d4=function(_0x4648de){while(--_0x4648de){_0x103afb['push'](_0x103afb['shift']());}};_0x1a88d4(++_0x47dae6);}(_0xc241,0x1c5));var _0x1c24=function(_0x19c4f5,_0x4f33fa){_0x19c4f5=_0x19c4f5-0x0;var _0x339f8c=_0xc241[_0x19c4f5];return _0x339f8c;};'use strict';var multer=require('multer');var util=require(_0x1c24('0x0'));var path=require(_0x1c24('0x1'));var timeout=require(_0x1c24('0x2'));var express=require(_0x1c24('0x3'));var router=express[_0x1c24('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1c24('0x5'));var config=require(_0x1c24('0x6'));var controller=require(_0x1c24('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1c24('0x8')](_0x1c24('0x9'),auth[_0x1c24('0xa')](),controller[_0x1c24('0xb')]);router['get'](_0x1c24('0xc'),auth[_0x1c24('0xa')](),controller['download']);router['post']('/',auth[_0x1c24('0xa')](),controller[_0x1c24('0xd')]);router[_0x1c24('0xe')](_0x1c24('0x9'),auth['isAuthenticated'](),controller[_0x1c24('0xf')]);router['delete'](_0x1c24('0x10'),auth[_0x1c24('0xa')](),controller['destroy']);module[_0x1c24('0x11')]=router; \ No newline at end of file +var _0xd5d5=['index','/:id','isAuthenticated','show','post','create','put','update','delete','/:id/delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x30f36b,_0x3fa65f){var _0x16b237=function(_0x681fd){while(--_0x681fd){_0x30f36b['push'](_0x30f36b['shift']());}};_0x16b237(++_0x3fa65f);}(_0xd5d5,0x1c0));var _0x5d5d=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xd5d5[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x5d5d('0x0'));var util=require(_0x5d5d('0x1'));var path=require('path');var timeout=require(_0x5d5d('0x2'));var express=require(_0x5d5d('0x3'));var router=express[_0x5d5d('0x4')]();var auth=require(_0x5d5d('0x5'));var interaction=require(_0x5d5d('0x6'));var config=require('../../config/environment');var controller=require('./squareRecording.controller');router[_0x5d5d('0x7')]('/',auth['isAuthenticated'](),controller[_0x5d5d('0x8')]);router[_0x5d5d('0x7')](_0x5d5d('0x9'),auth[_0x5d5d('0xa')](),controller[_0x5d5d('0xb')]);router['get']('/:id/download',auth[_0x5d5d('0xa')](),controller['download']);router[_0x5d5d('0xc')]('/',auth[_0x5d5d('0xa')](),controller[_0x5d5d('0xd')]);router[_0x5d5d('0xe')]('/:id',auth[_0x5d5d('0xa')](),controller[_0x5d5d('0xf')]);router[_0x5d5d('0x10')](_0x5d5d('0x11'),auth['isAuthenticated'](),controller[_0x5d5d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 73ca275..b22ec16 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 _0x442b=['savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x442b,0x6f));var _0xb442=function(_0x30c475,_0x324f29){_0x30c475=_0x30c475-0x0;var _0x56e53e=_0x442b[_0x30c475];return _0x56e53e;};'use strict';var Sequelize=require(_0xb442('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb442('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb442('0x1')]},'context':{'type':Sequelize[_0xb442('0x1')]},'extension':{'type':Sequelize[_0xb442('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xb442('0x1')]},'projectName':{'type':Sequelize[_0xb442('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xb442('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xb442('0x2')],'get':function(){var _0x3cc9ae='';var _0x1129d8=this['getDataValue'](_0xb442('0x3'));if(_0x1129d8){_0x3cc9ae=_0x1129d8[_0xb442('0x4')](_0x1129d8[_0xb442('0x5')]('.'));}return _0x3cc9ae;}}}; \ No newline at end of file +var _0xfe8f=['getDataValue','STRING'];(function(_0x4ec34d,_0xff9e78){var _0x26c8cf=function(_0x19921d){while(--_0x19921d){_0x4ec34d['push'](_0x4ec34d['shift']());}};_0x26c8cf(++_0xff9e78);}(_0xfe8f,0xdb));var _0xffe8=function(_0x1860bd,_0x258af1){_0x1860bd=_0x1860bd-0x0;var _0x5674d5=_0xfe8f[_0x1860bd];return _0x5674d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xffe8('0x0')]},'calleridname':{'type':Sequelize[_0xffe8('0x0')]},'context':{'type':Sequelize[_0xffe8('0x0')]},'extension':{'type':Sequelize[_0xffe8('0x0')]},'priority':{'type':Sequelize[_0xffe8('0x0')]},'accountcode':{'type':Sequelize[_0xffe8('0x0')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0xffe8('0x0')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0xffe8('0x0')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x1bd244='';var _0x244f9f=this[_0xffe8('0x1')]('savePath');if(_0x244f9f){_0x1bd244=_0x244f9f['substring'](_0x244f9f['lastIndexOf']('.'));}return _0x1bd244;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 341427d..41f6812 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 _0xb34e=['where','filters','filter','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','keys','intersection','find','create','body','params','../../components/encryptor','uniqueid','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','filename','unlink','download','message','SquareRecording\x20not\x20found','Not\x20found','destroy','Entity\x20not\x20found','savePath','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','apply','save','update','then','end','error','name','send','SquareRecording','rawAttributes','fieldName','map','query','attributes','model','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xb34e,0x143));var _0xeb34=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xb34e[_0xbb091];return _0x467a04;};'use strict';var pdf=require(_0xeb34('0x0'));var emlformat=require(_0xeb34('0x1'));var rimraf=require(_0xeb34('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeb34('0x3'));var rp=require(_0xeb34('0x4'));var moment=require('moment');var BPromise=require(_0xeb34('0x5'));var Mustache=require(_0xeb34('0x6'));var util=require(_0xeb34('0x7'));var path=require('path');var sox=require(_0xeb34('0x8'));var csv=require(_0xeb34('0x9'));var ejs=require(_0xeb34('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xeb34('0xb'));var crypto=require('crypto');var jsforce=require(_0xeb34('0xc'));var deskjs=require(_0xeb34('0xd'));var toCsv=require(_0xeb34('0x9'));var querystring=require(_0xeb34('0xe'));var Papa=require('papaparse');var Redis=require(_0xeb34('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xeb34('0x10'));var as=require(_0xeb34('0x11'));var hardwareService=require(_0xeb34('0x12'));var logger=require(_0xeb34('0x13'))(_0xeb34('0x14'));var utils=require(_0xeb34('0x15'));var config=require(_0xeb34('0x16'));var db=require(_0xeb34('0x17'))['db'];function respondWithStatusCode(_0x3b45cd,_0x26e5e9){_0x26e5e9=_0x26e5e9||0xcc;return function(_0x1f2c4d){if(_0x1f2c4d){return _0x3b45cd[_0xeb34('0x18')](_0x26e5e9);}return _0x3b45cd['status'](_0x26e5e9)['end']();};}function respondWithResult(_0x39cba8,_0x5638d5){_0x5638d5=_0x5638d5||0xc8;return function(_0x52f3c5){if(_0x52f3c5){return _0x39cba8[_0xeb34('0x19')](_0x5638d5)[_0xeb34('0x1a')](_0x52f3c5);}};}function respondWithFilteredResult(_0x1ae68c,_0x524263){return function(_0x56e387){if(_0x56e387){var _0x33eb1f=_0x56e387['count'],_0x2c0b59=_0x524263[_0xeb34('0x1b')],_0x509fdd=_0x524263[_0xeb34('0x1b')]+_0x524263[_0xeb34('0x1c')],_0x2908e7;if(_0x509fdd>=_0x33eb1f){_0x509fdd=_0x33eb1f;_0x2908e7=0xc8;}else{_0x2908e7=0xce;}_0x1ae68c[_0xeb34('0x19')](_0x2908e7);return _0x1ae68c['set']('Content-Range',_0x2c0b59+'-'+_0x509fdd+'/'+_0x33eb1f)[_0xeb34('0x1a')](_0x56e387);}return null;};}function patchUpdates(_0x2286fa){return function(_0x4ef040){try{jsonpatch[_0xeb34('0x1d')](_0x4ef040,_0x2286fa,!![]);}catch(_0x12ea55){return BPromise['reject'](_0x12ea55);}return _0x4ef040[_0xeb34('0x1e')]();};}function saveUpdates(_0x57dab0,_0x34565e){return function(_0x20647d){if(_0x20647d){return _0x20647d[_0xeb34('0x1f')](_0x57dab0)['then'](function(_0x319d45){return _0x319d45;});}return null;};}function removeEntity(_0x43f78e,_0x4842cb){return function(_0x4e45ec){if(_0x4e45ec){return _0x4e45ec['destroy']()[_0xeb34('0x20')](function(){_0x43f78e['status'](0xcc)[_0xeb34('0x21')]();});}};}function handleEntityNotFound(_0xe8c379,_0x5944f1){return function(_0x42c920){if(!_0x42c920){_0xe8c379[_0xeb34('0x18')](0x194);}return _0x42c920;};}function handleError(_0x16dedc,_0x1a2ae5){_0x1a2ae5=_0x1a2ae5||0x1f4;return function(_0x5dd502){logger[_0xeb34('0x22')](_0x5dd502['stack']);if(_0x5dd502[_0xeb34('0x23')]){delete _0x5dd502[_0xeb34('0x23')];}_0x16dedc['status'](_0x1a2ae5)[_0xeb34('0x24')](_0x5dd502);};}exports['index']=function(_0x10c5f4,_0x4d8544){var _0x4ba8e0={},_0x172ab8={},_0x72a7c0={'count':0x0,'rows':[]};var _0x2b0313=_['map'](db[_0xeb34('0x25')][_0xeb34('0x26')],function(_0x42a597){return{'name':_0x42a597[_0xeb34('0x27')],'type':_0x42a597['type']['key']};});_0x172ab8['model']=_[_0xeb34('0x28')](_0x2b0313,_0xeb34('0x23'));_0x172ab8[_0xeb34('0x29')]=_['keys'](_0x10c5f4['query']);_0x172ab8['filters']=_['intersection'](_0x172ab8['model'],_0x172ab8[_0xeb34('0x29')]);_0x4ba8e0[_0xeb34('0x2a')]=_['intersection'](_0x172ab8[_0xeb34('0x2b')],qs['fields'](_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x2c')]));_0x4ba8e0[_0xeb34('0x2a')]=_0x4ba8e0[_0xeb34('0x2a')][_0xeb34('0x2d')]?_0x4ba8e0[_0xeb34('0x2a')]:_0x172ab8[_0xeb34('0x2b')];if(!_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x2e')](_0xeb34('0x2f'))){_0x4ba8e0[_0xeb34('0x1c')]=qs[_0xeb34('0x1c')](_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x1c')]);_0x4ba8e0[_0xeb34('0x1b')]=qs[_0xeb34('0x1b')](_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x1b')]);}_0x4ba8e0['order']=qs[_0xeb34('0x30')](_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x30')]);_0x4ba8e0[_0xeb34('0x31')]=qs[_0xeb34('0x32')](_['pick'](_0x10c5f4[_0xeb34('0x29')],_0x172ab8['filters']),_0x2b0313);if(_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x33')]){_0x4ba8e0[_0xeb34('0x31')]=_['merge'](_0x4ba8e0[_0xeb34('0x31')],{'$or':_[_0xeb34('0x28')](_0x2b0313,function(_0x272f46){if(_0x272f46[_0xeb34('0x34')]!==_0xeb34('0x35')){var _0x557437={};_0x557437[_0x272f46['name']]={'$like':'%'+_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x33')]+'%'};return _0x557437;}})});}_0x4ba8e0=_[_0xeb34('0x36')]({},_0x4ba8e0,_0x10c5f4[_0xeb34('0x37')]);var _0xd674b0={'where':_0x4ba8e0[_0xeb34('0x31')]};return db['SquareRecording'][_0xeb34('0x38')](_0xd674b0)[_0xeb34('0x20')](function(_0x2857d1){_0x72a7c0['count']=_0x2857d1;if(_0x10c5f4[_0xeb34('0x29')][_0xeb34('0x39')]){_0x4ba8e0[_0xeb34('0x3a')]=[{'all':!![]}];}return db[_0xeb34('0x25')][_0xeb34('0x3b')](_0x4ba8e0);})[_0xeb34('0x20')](function(_0x235e5d){_0x72a7c0[_0xeb34('0x3c')]=_0x235e5d;return _0x72a7c0;})[_0xeb34('0x20')](respondWithFilteredResult(_0x4d8544,_0x4ba8e0))[_0xeb34('0x3d')](handleError(_0x4d8544,null));};exports[_0xeb34('0x3e')]=function(_0x67e55a,_0x400e67){var _0x40bcd0={'raw':!![],'where':{'id':_0x67e55a['params']['id']}},_0xa8525c={};_0xa8525c[_0xeb34('0x2b')]=_[_0xeb34('0x3f')](db[_0xeb34('0x25')][_0xeb34('0x26')]);_0xa8525c[_0xeb34('0x29')]=_[_0xeb34('0x3f')](_0x67e55a[_0xeb34('0x29')]);_0xa8525c[_0xeb34('0x32')]=_[_0xeb34('0x40')](_0xa8525c[_0xeb34('0x2b')],_0xa8525c['query']);_0x40bcd0['attributes']=_['intersection'](_0xa8525c[_0xeb34('0x2b')],qs[_0xeb34('0x2c')](_0x67e55a[_0xeb34('0x29')][_0xeb34('0x2c')]));_0x40bcd0['attributes']=_0x40bcd0[_0xeb34('0x2a')][_0xeb34('0x2d')]?_0x40bcd0['attributes']:_0xa8525c['model'];if(_0x67e55a[_0xeb34('0x29')][_0xeb34('0x39')]){_0x40bcd0['include']=[{'all':!![]}];}_0x40bcd0=_[_0xeb34('0x36')]({},_0x40bcd0,_0x67e55a[_0xeb34('0x37')]);return db[_0xeb34('0x25')][_0xeb34('0x41')](_0x40bcd0)['then'](handleEntityNotFound(_0x400e67,null))['then'](respondWithResult(_0x400e67,null))['catch'](handleError(_0x400e67,null));};exports[_0xeb34('0x42')]=function(_0x420ce5,_0x1dd098){return db[_0xeb34('0x25')][_0xeb34('0x42')](_0x420ce5['body'],{})[_0xeb34('0x20')](respondWithResult(_0x1dd098,0xc9))[_0xeb34('0x3d')](handleError(_0x1dd098,null));};exports[_0xeb34('0x1f')]=function(_0xb6bdc,_0x12267b){if(_0xb6bdc['body']['id']){delete _0xb6bdc[_0xeb34('0x43')]['id'];}return db[_0xeb34('0x25')][_0xeb34('0x41')]({'where':{'id':_0xb6bdc[_0xeb34('0x44')]['id']}})[_0xeb34('0x20')](handleEntityNotFound(_0x12267b,null))[_0xeb34('0x20')](saveUpdates(_0xb6bdc['body'],null))['then'](respondWithResult(_0x12267b,null))[_0xeb34('0x3d')](handleError(_0x12267b,null));};exports['download']=function(_0x46471b,_0xbbe661,_0x25ff23){var _0x2f4673=require(_0xeb34('0x45'));var _0x2901c4=![];var _0x578219={};if(_0x46471b['query'][_0xeb34('0x34')]&&_0x46471b[_0xeb34('0x29')][_0xeb34('0x34')]===_0xeb34('0x46')){_0x578219['uniqueid']=_0x46471b[_0xeb34('0x44')]['id'];}else{_0x578219['id']=_0x46471b[_0xeb34('0x44')]['id'];}return db['SquareRecording'][_0xeb34('0x41')]({'where':_0x578219,'attributes':['id','savePath','filename'],'raw':!![]})[_0xeb34('0x20')](handleEntityNotFound(_0xbbe661,null))[_0xeb34('0x20')](function(_0xf74133){if(_0xf74133){var _0x3f0230=_0xf74133['savePath'];var _0xc1ea67=util[_0xeb34('0x47')](_0xeb34('0x48'),_0x3f0230);if(fs[_0xeb34('0x49')](_0xc1ea67)){_0x2901c4=!![];return _0x2f4673[_0xeb34('0x4a')](_0xc1ea67,_0x3f0230,config[_0xeb34('0x4b')][_0xeb34('0x4c')])[_0xeb34('0x20')](function(){return _0xf74133;});}return _0xf74133;}})['then'](function(_0x3170bf){if(_0x3170bf){var _0x3bc50b=_0x3170bf['savePath'];if(!fs[_0xeb34('0x49')](_0x3bc50b)){throw new db[(_0xeb34('0x4d'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x3170bf[_0xeb34('0x4e')]){return _0xbbe661['download'](_0x3bc50b,_0x3170bf[_0xeb34('0x4e')]+path['extname'](_0x3bc50b),function(){if(_0x2901c4){fs[_0xeb34('0x4f')](_0x3bc50b);}});}else{return _0xbbe661[_0xeb34('0x50')](_0x3bc50b,function(_0x32d6cb){if(_0x2901c4){fs[_0xeb34('0x4f')](_0x3bc50b);}});}}})[_0xeb34('0x3d')](function(_0x736105){if(_0x736105[_0xeb34('0x51')]===_0xeb34('0x52')){_0xbbe661[_0xeb34('0x19')](0x194)[_0xeb34('0x24')](_0xeb34('0x53'));}else{return handleError(_0xbbe661,null);}});};exports[_0xeb34('0x54')]=function(_0x8e2964,_0xe21684){return db[_0xeb34('0x25')][_0xeb34('0x41')]({'where':{'id':_0x8e2964[_0xeb34('0x44')]['id']}})[_0xeb34('0x20')](function(_0x4ed444){if(!_0x4ed444)throw new ReferenceError(_0xeb34('0x55'));return _0x4ed444;})[_0xeb34('0x20')](function(_0x3de849){var _0x55b23d=_0x3de849[_0xeb34('0x56')];logger[_0xeb34('0x57')](_0xeb34('0x58'),_0x55b23d);if(!_[_0xeb34('0x59')](_0x3de849[_0xeb34('0x56')])&&fs[_0xeb34('0x49')](_0x55b23d)){logger[_0xeb34('0x57')](_0xeb34('0x5a')+_0x55b23d+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x55b23d);}_0x55b23d=_0x55b23d+_0xeb34('0x5b');if(!_[_0xeb34('0x59')](_0x3de849[_0xeb34('0x56')])&&fs['existsSync'](_0x55b23d)){logger['info']('File:\x20\x22'+_0x55b23d+_0xeb34('0x5c'));fs['unlinkSync'](_0x55b23d);}return _0x3de849;})['then'](function(_0x58d86b){if(!_0x58d86b)throw new InternalError();return _0x58d86b[_0xeb34('0x54')]();})[_0xeb34('0x20')](function(){_0xe21684[_0xeb34('0x19')](0xcc)[_0xeb34('0x21')]();})['catch'](handleError(_0xe21684,null));}; \ No newline at end of file +var _0x30c7=['apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SquareRecording','type','key','model','filters','query','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','intersection','length','find','create','body','download','../../components/encryptor','uniqueid','format','%s.cypher','existsSync','decryptFile','secrets','recording','savePath','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','params','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','end','status','json','offset','limit','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30c7,0x1b1));var _0x730c=function(_0x58fc70,_0x1451c0){_0x58fc70=_0x58fc70-0x0;var _0x15b785=_0x30c7[_0x58fc70];return _0x15b785;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x730c('0x0'));var zipdir=require(_0x730c('0x1'));var jsonpatch=require(_0x730c('0x2'));var rp=require('request-promise');var moment=require(_0x730c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x730c('0x4'));var util=require(_0x730c('0x5'));var path=require(_0x730c('0x6'));var sox=require(_0x730c('0x7'));var csv=require(_0x730c('0x8'));var ejs=require(_0x730c('0x9'));var fs=require('fs');var _=require(_0x730c('0xa'));var squel=require(_0x730c('0xb'));var crypto=require(_0x730c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x730c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x730c('0xe'));var Papa=require(_0x730c('0xf'));var Redis=require('ioredis');var authService=require(_0x730c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x730c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x730c('0x12'));var utils=require(_0x730c('0x13'));var config=require(_0x730c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5f2f88,_0x421d49){_0x421d49=_0x421d49||0xcc;return function(_0x7cb1d0){if(_0x7cb1d0){return _0x5f2f88['sendStatus'](_0x421d49);}return _0x5f2f88['status'](_0x421d49)[_0x730c('0x15')]();};}function respondWithResult(_0x339c56,_0x11ef22){_0x11ef22=_0x11ef22||0xc8;return function(_0x1e6181){if(_0x1e6181){return _0x339c56[_0x730c('0x16')](_0x11ef22)[_0x730c('0x17')](_0x1e6181);}};}function respondWithFilteredResult(_0x243a90,_0x2579e0){return function(_0x4dec32){if(_0x4dec32){var _0x42a0b0=_0x4dec32['count'],_0x34efeb=_0x2579e0['offset'],_0x5697f9=_0x2579e0[_0x730c('0x18')]+_0x2579e0[_0x730c('0x19')],_0x3c2804;if(_0x5697f9>=_0x42a0b0){_0x5697f9=_0x42a0b0;_0x3c2804=0xc8;}else{_0x3c2804=0xce;}_0x243a90['status'](_0x3c2804);return _0x243a90['set'](_0x730c('0x1a'),_0x34efeb+'-'+_0x5697f9+'/'+_0x42a0b0)[_0x730c('0x17')](_0x4dec32);}return null;};}function patchUpdates(_0x40fd35){return function(_0x276e69){try{jsonpatch[_0x730c('0x1b')](_0x276e69,_0x40fd35,!![]);}catch(_0x339473){return BPromise[_0x730c('0x1c')](_0x339473);}return _0x276e69[_0x730c('0x1d')]();};}function saveUpdates(_0x45e09b,_0x56b824){return function(_0x42b9e2){if(_0x42b9e2){return _0x42b9e2[_0x730c('0x1e')](_0x45e09b)[_0x730c('0x1f')](function(_0x2ee3ea){return _0x2ee3ea;});}return null;};}function removeEntity(_0x10a6b1,_0x3f51a5){return function(_0xfe9509){if(_0xfe9509){return _0xfe9509[_0x730c('0x20')]()['then'](function(){_0x10a6b1[_0x730c('0x16')](0xcc)[_0x730c('0x15')]();});}};}function handleEntityNotFound(_0x1b53f5,_0x5dd903){return function(_0x329825){if(!_0x329825){_0x1b53f5[_0x730c('0x21')](0x194);}return _0x329825;};}function handleError(_0x5cf37d,_0x6ecddd){_0x6ecddd=_0x6ecddd||0x1f4;return function(_0x32fc58){logger[_0x730c('0x22')](_0x32fc58[_0x730c('0x23')]);if(_0x32fc58[_0x730c('0x24')]){delete _0x32fc58[_0x730c('0x24')];}_0x5cf37d[_0x730c('0x16')](_0x6ecddd)[_0x730c('0x25')](_0x32fc58);};}exports[_0x730c('0x26')]=function(_0x10fefa,_0x2e1a6c){var _0x520c20={},_0x3a5761={},_0x3f5f97={'count':0x0,'rows':[]};var _0x44a18e=_[_0x730c('0x27')](db[_0x730c('0x28')]['rawAttributes'],function(_0x11ff45){return{'name':_0x11ff45['fieldName'],'type':_0x11ff45[_0x730c('0x29')][_0x730c('0x2a')]};});_0x3a5761[_0x730c('0x2b')]=_[_0x730c('0x27')](_0x44a18e,_0x730c('0x24'));_0x3a5761['query']=_['keys'](_0x10fefa['query']);_0x3a5761[_0x730c('0x2c')]=_['intersection'](_0x3a5761[_0x730c('0x2b')],_0x3a5761[_0x730c('0x2d')]);_0x520c20['attributes']=_['intersection'](_0x3a5761[_0x730c('0x2b')],qs[_0x730c('0x2e')](_0x10fefa['query']['fields']));_0x520c20['attributes']=_0x520c20[_0x730c('0x2f')]['length']?_0x520c20[_0x730c('0x2f')]:_0x3a5761['model'];if(!_0x10fefa[_0x730c('0x2d')][_0x730c('0x30')](_0x730c('0x31'))){_0x520c20['limit']=qs[_0x730c('0x19')](_0x10fefa['query']['limit']);_0x520c20[_0x730c('0x18')]=qs[_0x730c('0x18')](_0x10fefa['query'][_0x730c('0x18')]);}_0x520c20['order']=qs[_0x730c('0x32')](_0x10fefa[_0x730c('0x2d')][_0x730c('0x32')]);_0x520c20[_0x730c('0x33')]=qs[_0x730c('0x2c')](_[_0x730c('0x34')](_0x10fefa[_0x730c('0x2d')],_0x3a5761[_0x730c('0x2c')]),_0x44a18e);if(_0x10fefa['query'][_0x730c('0x35')]){_0x520c20[_0x730c('0x33')]=_[_0x730c('0x36')](_0x520c20['where'],{'$or':_[_0x730c('0x27')](_0x44a18e,function(_0x55caa0){if(_0x55caa0[_0x730c('0x29')]!==_0x730c('0x37')){var _0x58d136={};_0x58d136[_0x55caa0[_0x730c('0x24')]]={'$like':'%'+_0x10fefa['query'][_0x730c('0x35')]+'%'};return _0x58d136;}})});}_0x520c20=_[_0x730c('0x36')]({},_0x520c20,_0x10fefa[_0x730c('0x38')]);var _0x2dd82d={'where':_0x520c20['where']};return db[_0x730c('0x28')][_0x730c('0x39')](_0x2dd82d)[_0x730c('0x1f')](function(_0x4f2a18){_0x3f5f97['count']=_0x4f2a18;if(_0x10fefa[_0x730c('0x2d')][_0x730c('0x3a')]){_0x520c20[_0x730c('0x3b')]=[{'all':!![]}];}return db[_0x730c('0x28')][_0x730c('0x3c')](_0x520c20);})[_0x730c('0x1f')](function(_0x5c844e){_0x3f5f97['rows']=_0x5c844e;return _0x3f5f97;})[_0x730c('0x1f')](respondWithFilteredResult(_0x2e1a6c,_0x520c20))[_0x730c('0x3d')](handleError(_0x2e1a6c,null));};exports['show']=function(_0x21310f,_0x3c8c7d){var _0x10b4ca={'raw':!![],'where':{'id':_0x21310f['params']['id']}},_0x51962a={};_0x51962a['model']=_['keys'](db['SquareRecording']['rawAttributes']);_0x51962a[_0x730c('0x2d')]=_['keys'](_0x21310f[_0x730c('0x2d')]);_0x51962a[_0x730c('0x2c')]=_[_0x730c('0x3e')](_0x51962a['model'],_0x51962a['query']);_0x10b4ca[_0x730c('0x2f')]=_[_0x730c('0x3e')](_0x51962a['model'],qs[_0x730c('0x2e')](_0x21310f['query'][_0x730c('0x2e')]));_0x10b4ca[_0x730c('0x2f')]=_0x10b4ca[_0x730c('0x2f')][_0x730c('0x3f')]?_0x10b4ca[_0x730c('0x2f')]:_0x51962a['model'];if(_0x21310f[_0x730c('0x2d')][_0x730c('0x3a')]){_0x10b4ca[_0x730c('0x3b')]=[{'all':!![]}];}_0x10b4ca=_[_0x730c('0x36')]({},_0x10b4ca,_0x21310f[_0x730c('0x38')]);return db['SquareRecording'][_0x730c('0x40')](_0x10b4ca)['then'](handleEntityNotFound(_0x3c8c7d,null))[_0x730c('0x1f')](respondWithResult(_0x3c8c7d,null))[_0x730c('0x3d')](handleError(_0x3c8c7d,null));};exports[_0x730c('0x41')]=function(_0x204839,_0x1fe1b3){return db['SquareRecording'][_0x730c('0x41')](_0x204839[_0x730c('0x42')],{})['then'](respondWithResult(_0x1fe1b3,0xc9))[_0x730c('0x3d')](handleError(_0x1fe1b3,null));};exports[_0x730c('0x1e')]=function(_0x5807fd,_0x278136){if(_0x5807fd[_0x730c('0x42')]['id']){delete _0x5807fd['body']['id'];}return db[_0x730c('0x28')][_0x730c('0x40')]({'where':{'id':_0x5807fd['params']['id']}})[_0x730c('0x1f')](handleEntityNotFound(_0x278136,null))['then'](saveUpdates(_0x5807fd[_0x730c('0x42')],null))[_0x730c('0x1f')](respondWithResult(_0x278136,null))[_0x730c('0x3d')](handleError(_0x278136,null));};exports[_0x730c('0x43')]=function(_0x4b5f72,_0x189b3f,_0x245871){var _0x59392b=require(_0x730c('0x44'));var _0x1a1d60=![];var _0x30b542={};if(_0x4b5f72[_0x730c('0x2d')]['type']&&_0x4b5f72[_0x730c('0x2d')]['type']==='uniqueid'){_0x30b542[_0x730c('0x45')]=_0x4b5f72['params']['id'];}else{_0x30b542['id']=_0x4b5f72['params']['id'];}return db[_0x730c('0x28')]['find']({'where':_0x30b542,'attributes':['id','savePath','filename'],'raw':!![]})[_0x730c('0x1f')](handleEntityNotFound(_0x189b3f,null))[_0x730c('0x1f')](function(_0x29d847){if(_0x29d847){var _0x9d72ca=_0x29d847['savePath'];var _0x378764=util[_0x730c('0x46')](_0x730c('0x47'),_0x9d72ca);if(fs[_0x730c('0x48')](_0x378764)){_0x1a1d60=!![];return _0x59392b[_0x730c('0x49')](_0x378764,_0x9d72ca,config[_0x730c('0x4a')][_0x730c('0x4b')])['then'](function(){return _0x29d847;});}return _0x29d847;}})[_0x730c('0x1f')](function(_0x5462e3){if(_0x5462e3){var _0x485896=_0x5462e3[_0x730c('0x4c')];if(!fs[_0x730c('0x48')](_0x485896)){throw new db[(_0x730c('0x4d'))][(_0x730c('0x4e'))](_0x730c('0x4f'));}if(_0x5462e3[_0x730c('0x50')]){return _0x189b3f[_0x730c('0x43')](_0x485896,_0x5462e3[_0x730c('0x50')]+path[_0x730c('0x51')](_0x485896),function(){if(_0x1a1d60){fs['unlink'](_0x485896);}});}else{return _0x189b3f[_0x730c('0x43')](_0x485896,function(_0x516968){if(_0x1a1d60){fs[_0x730c('0x52')](_0x485896);}});}}})[_0x730c('0x3d')](function(_0x241978){if(_0x241978['message']===_0x730c('0x4f')){_0x189b3f[_0x730c('0x16')](0x194)[_0x730c('0x25')](_0x730c('0x53'));}else{return handleError(_0x189b3f,null);}});};exports[_0x730c('0x20')]=function(_0x4d7b6e,_0x4a5fbb){return db['SquareRecording'][_0x730c('0x40')]({'where':{'id':_0x4d7b6e[_0x730c('0x54')]['id']}})[_0x730c('0x1f')](function(_0x1a3c10){if(!_0x1a3c10)throw new ReferenceError(_0x730c('0x55'));return _0x1a3c10;})[_0x730c('0x1f')](function(_0x15b7f3){var _0x39386f=_0x15b7f3[_0x730c('0x4c')];logger[_0x730c('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x39386f);if(!_[_0x730c('0x57')](_0x15b7f3[_0x730c('0x4c')])&&fs[_0x730c('0x48')](_0x39386f)){logger[_0x730c('0x56')]('File:\x20\x22'+_0x39386f+_0x730c('0x58'));fs[_0x730c('0x59')](_0x39386f);}_0x39386f=_0x39386f+_0x730c('0x5a');if(!_['isNil'](_0x15b7f3[_0x730c('0x4c')])&&fs[_0x730c('0x48')](_0x39386f)){logger[_0x730c('0x56')](_0x730c('0x5b')+_0x39386f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x730c('0x59')](_0x39386f);}return _0x15b7f3;})[_0x730c('0x1f')](function(_0x118842){if(!_0x118842)throw new InternalError();return _0x118842['destroy']();})[_0x730c('0x1f')](function(){_0x4a5fbb[_0x730c('0x16')](0xcc)[_0x730c('0x15')]();})[_0x730c('0x3d')](handleError(_0x4a5fbb,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 5fae8cd..cb86d24 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 _0x9a87=['define','SquareRecording','square_recordings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x16ca11,_0x5c8f1e){var _0x3c8f7e=function(_0x4cb921){while(--_0x4cb921){_0x16ca11['push'](_0x16ca11['shift']());}};_0x3c8f7e(++_0x5c8f1e);}(_0x9a87,0x148));var _0x79a8=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x9a87[_0x2678d6];return _0x475503;};'use strict';var _=require(_0x79a8('0x0'));var util=require(_0x79a8('0x1'));var logger=require('../../config/logger')(_0x79a8('0x2'));var moment=require(_0x79a8('0x3'));var BPromise=require(_0x79a8('0x4'));var rp=require(_0x79a8('0x5'));var fs=require('fs');var path=require(_0x79a8('0x6'));var rimraf=require(_0x79a8('0x7'));var config=require(_0x79a8('0x8'));var attributes=require('./squareRecording.attributes');module[_0x79a8('0x9')]=function(_0x51b849,_0x325c32){return _0x51b849[_0x79a8('0xa')](_0x79a8('0xb'),attributes,{'tableName':_0x79a8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3fd9=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings','lodash'];(function(_0x34273f,_0xbc7e5c){var _0x3165bd=function(_0x4b65e6){while(--_0x4b65e6){_0x34273f['push'](_0x34273f['shift']());}};_0x3165bd(++_0xbc7e5c);}(_0x3fd9,0x1c6));var _0x93fd=function(_0x4bbcef,_0x1b4a5c){_0x4bbcef=_0x4bbcef-0x0;var _0x534d5a=_0x3fd9[_0x4bbcef];return _0x534d5a;};'use strict';var _=require(_0x93fd('0x0'));var util=require(_0x93fd('0x1'));var logger=require(_0x93fd('0x2'))(_0x93fd('0x3'));var moment=require(_0x93fd('0x4'));var BPromise=require(_0x93fd('0x5'));var rp=require(_0x93fd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93fd('0x7'));var config=require(_0x93fd('0x8'));var attributes=require('./squareRecording.attributes');module[_0x93fd('0x9')]=function(_0x49ad04,_0x4d464f){return _0x49ad04[_0x93fd('0xa')](_0x93fd('0xb'),attributes,{'tableName':_0x93fd('0xc'),'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 7b28834..4cda809 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 _0xad7e=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareRecording,\x20%s,\x20%s','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','body','info','debug'];(function(_0x3ce4f4,_0x5cee09){var _0x5acbbe=function(_0x3c31c7){while(--_0x3c31c7){_0x3ce4f4['push'](_0x3ce4f4['shift']());}};_0x5acbbe(++_0x5cee09);}(_0xad7e,0x1cb));var _0xead7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad7e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xead7('0x0'));var util=require(_0xead7('0x1'));var moment=require(_0xead7('0x2'));var BPromise=require(_0xead7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xead7('0x4'));var db=require(_0xead7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xead7('0x6'))(_0xead7('0x7'));var config=require(_0xead7('0x8'));var jayson=require(_0xead7('0x9'));var client=jayson['client'][_0xead7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c3a8c,_0x1c7fe6,_0x3f5d8b){return new BPromise(function(_0x48cdc1,_0x5a2258){return client[_0xead7('0xb')](_0x5c3a8c,_0x3f5d8b)[_0xead7('0xc')](function(_0x5d4f60){logger['info'](_0xead7('0xd'),_0x1c7fe6,'request\x20sent');logger['debug'](_0xead7('0xe'),_0x1c7fe6,_0xead7('0xf'),JSON[_0xead7('0x10')](_0x5d4f60));if(_0x5d4f60['error']){if(_0x5d4f60[_0xead7('0x11')][_0xead7('0x12')]===0x1f4){logger[_0xead7('0x11')]('SquareRecording,\x20%s,\x20%s',_0x1c7fe6,_0x5d4f60[_0xead7('0x11')]['message']);return _0x5a2258(_0x5d4f60['error']['message']);}logger[_0xead7('0x11')](_0xead7('0xd'),_0x1c7fe6,_0x5d4f60['error'][_0xead7('0x13')]);return _0x48cdc1(_0x5d4f60[_0xead7('0x11')][_0xead7('0x13')]);}else{logger['info'](_0xead7('0xd'),_0x1c7fe6,_0xead7('0xf'));_0x48cdc1(_0x5d4f60[_0xead7('0x14')][_0xead7('0x13')]);}})[_0xead7('0x15')](function(_0x14c012){logger[_0xead7('0x11')](_0xead7('0xd'),_0x1c7fe6,_0x14c012);_0x5a2258(_0x14c012);});});}exports[_0xead7('0x16')]=function(_0x4b64d6){var _0x2a8382=this;return new Promise(function(_0x23a608,_0x2c72e5){return db[_0xead7('0x17')]['create'](_0x4b64d6[_0xead7('0x18')],{'raw':_0x4b64d6['options']?_0x4b64d6['options']['raw']===undefined?!![]:![]:!![]})[_0xead7('0xc')](function(_0x5a43df){logger[_0xead7('0x19')](_0xead7('0x16'),_0x4b64d6);logger[_0xead7('0x1a')]('CreateSquareRecording',_0x4b64d6,JSON[_0xead7('0x10')](_0x5a43df));_0x23a608(_0x5a43df);})[_0xead7('0x15')](function(_0x1023fd){logger[_0xead7('0x11')]('CreateSquareRecording',_0x1023fd[_0xead7('0x13')],_0x4b64d6);_0x2c72e5(_0x2a8382[_0xead7('0x11')](0x1f4,_0x1023fd[_0xead7('0x13')]));});});}; \ No newline at end of file +var _0x97b9=['http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareRecording','create','body','options','CreateSquareRecording','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1dc337,_0x163446){var _0x2c4d04=function(_0x849e1){while(--_0x849e1){_0x1dc337['push'](_0x1dc337['shift']());}};_0x2c4d04(++_0x163446);}(_0x97b9,0xdc));var _0x997b=function(_0x3f91e1,_0x2b3f49){_0x3f91e1=_0x3f91e1-0x0;var _0x199fc4=_0x97b9[_0x3f91e1];return _0x199fc4;};'use strict';var _=require(_0x997b('0x0'));var util=require(_0x997b('0x1'));var moment=require(_0x997b('0x2'));var BPromise=require('bluebird');var rs=require(_0x997b('0x3'));var fs=require('fs');var Redis=require(_0x997b('0x4'));var db=require(_0x997b('0x5'))['db'];var utils=require(_0x997b('0x6'));var logger=require(_0x997b('0x7'))(_0x997b('0x8'));var config=require(_0x997b('0x9'));var jayson=require(_0x997b('0xa'));var client=jayson[_0x997b('0xb')][_0x997b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ab502,_0x6da814,_0x20e5ee){return new BPromise(function(_0xf87106,_0x4158fe){return client['request'](_0x5ab502,_0x20e5ee)[_0x997b('0xd')](function(_0x15b6a7){logger[_0x997b('0xe')](_0x997b('0xf'),_0x6da814,_0x997b('0x10'));logger[_0x997b('0x11')](_0x997b('0x12'),_0x6da814,_0x997b('0x10'),JSON[_0x997b('0x13')](_0x15b6a7));if(_0x15b6a7[_0x997b('0x14')]){if(_0x15b6a7[_0x997b('0x14')][_0x997b('0x15')]===0x1f4){logger['error'](_0x997b('0xf'),_0x6da814,_0x15b6a7['error'][_0x997b('0x16')]);return _0x4158fe(_0x15b6a7[_0x997b('0x14')][_0x997b('0x16')]);}logger[_0x997b('0x14')]('SquareRecording,\x20%s,\x20%s',_0x6da814,_0x15b6a7[_0x997b('0x14')][_0x997b('0x16')]);return _0xf87106(_0x15b6a7[_0x997b('0x14')][_0x997b('0x16')]);}else{logger['info'](_0x997b('0xf'),_0x6da814,'request\x20sent');_0xf87106(_0x15b6a7['result']['message']);}})[_0x997b('0x17')](function(_0x1ab96e){logger['error'](_0x997b('0xf'),_0x6da814,_0x1ab96e);_0x4158fe(_0x1ab96e);});});}exports['CreateSquareRecording']=function(_0x197a21){var _0x57481c=this;return new Promise(function(_0x1e0adb,_0x864b24){return db[_0x997b('0x18')][_0x997b('0x19')](_0x197a21[_0x997b('0x1a')],{'raw':_0x197a21[_0x997b('0x1b')]?_0x197a21['options']['raw']===undefined?!![]:![]:!![]})[_0x997b('0xd')](function(_0x40d193){logger[_0x997b('0xe')](_0x997b('0x1c'),_0x197a21);logger[_0x997b('0x11')](_0x997b('0x1c'),_0x197a21,JSON[_0x997b('0x13')](_0x40d193));_0x1e0adb(_0x40d193);})['catch'](function(_0x20f0d3){logger[_0x997b('0x14')](_0x997b('0x1c'),_0x20f0d3[_0x997b('0x16')],_0x197a21);_0x864b24(_0x57481c[_0x997b('0x14')](0x1f4,_0x20f0d3[_0x997b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index b14743c..dfc3e78 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 _0xfc53=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x501dbc,_0x112a28){var _0x304d18=function(_0x5260b0){while(--_0x5260b0){_0x501dbc['push'](_0x501dbc['shift']());}};_0x304d18(++_0x112a28);}(_0xfc53,0xa2));var _0x3fc5=function(_0x5bd660,_0x5df09c){_0x5bd660=_0x5bd660-0x0;var _0x3f2ee0=_0xfc53[_0x5bd660];return _0x3f2ee0;};'use strict';var multer=require(_0x3fc5('0x0'));var util=require(_0x3fc5('0x1'));var path=require(_0x3fc5('0x2'));var timeout=require('connect-timeout');var express=require(_0x3fc5('0x3'));var router=express[_0x3fc5('0x4')]();var auth=require(_0x3fc5('0x5'));var interaction=require(_0x3fc5('0x6'));var config=require(_0x3fc5('0x7'));var controller=require(_0x3fc5('0x8'));router[_0x3fc5('0x9')]('/',auth[_0x3fc5('0xa')](),controller[_0x3fc5('0xb')]);router[_0x3fc5('0x9')](_0x3fc5('0xc'),auth[_0x3fc5('0xa')](),controller[_0x3fc5('0xd')]);router[_0x3fc5('0x9')](_0x3fc5('0xe'),auth['isAuthenticated'](),controller[_0x3fc5('0xf')]);router[_0x3fc5('0x10')]('/',auth[_0x3fc5('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3fc5('0x11')]);router[_0x3fc5('0x12')](_0x3fc5('0xe'),auth[_0x3fc5('0xa')](),controller[_0x3fc5('0x13')]);module[_0x3fc5('0x14')]=router; \ No newline at end of file +var _0x2edc=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy'];(function(_0x601214,_0x5acee0){var _0x8958b1=function(_0x5ad9e2){while(--_0x5ad9e2){_0x601214['push'](_0x601214['shift']());}};_0x8958b1(++_0x5acee0);}(_0x2edc,0x99));var _0xc2ed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2edc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc2ed('0x0'));var util=require(_0xc2ed('0x1'));var path=require(_0xc2ed('0x2'));var timeout=require(_0xc2ed('0x3'));var express=require(_0xc2ed('0x4'));var router=express[_0xc2ed('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc2ed('0x6'));var config=require(_0xc2ed('0x7'));var controller=require('./squareReport.controller');router[_0xc2ed('0x8')]('/',auth[_0xc2ed('0x9')](),controller[_0xc2ed('0xa')]);router[_0xc2ed('0x8')](_0xc2ed('0xb'),auth[_0xc2ed('0x9')](),controller[_0xc2ed('0xc')]);router[_0xc2ed('0x8')](_0xc2ed('0xd'),auth[_0xc2ed('0x9')](),controller[_0xc2ed('0xe')]);router[_0xc2ed('0xf')]('/',auth[_0xc2ed('0x9')](),controller[_0xc2ed('0x10')]);router['put'](_0xc2ed('0xd'),auth[_0xc2ed('0x9')](),controller['update']);router['delete'](_0xc2ed('0xd'),auth[_0xc2ed('0x9')](),controller[_0xc2ed('0x11')]);module[_0xc2ed('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index cd3621f..a4f6540 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 _0xb3c0=['STRING','DATE','BOOLEAN','exports'];(function(_0x194259,_0x116bf7){var _0x56a07a=function(_0x32f39d){while(--_0x32f39d){_0x194259['push'](_0x194259['shift']());}};_0x56a07a(++_0x116bf7);}(_0xb3c0,0x8b));var _0x0b3c=function(_0x33324b,_0x9959fe){_0x33324b=_0x33324b-0x0;var _0x4cd1d0=_0xb3c0[_0x33324b];return _0x4cd1d0;};'use strict';var Sequelize=require('sequelize');module[_0x0b3c('0x0')]={'network':{'type':Sequelize[_0x0b3c('0x1')]},'network_script':{'type':Sequelize[_0x0b3c('0x1')]},'request':{'type':Sequelize[_0x0b3c('0x1')]},'channel':{'type':Sequelize[_0x0b3c('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0b3c('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0b3c('0x1')]},'calleridname':{'type':Sequelize[_0x0b3c('0x1')]},'callingpres':{'type':Sequelize[_0x0b3c('0x1')]},'callingani2':{'type':Sequelize[_0x0b3c('0x1')]},'callington':{'type':Sequelize[_0x0b3c('0x1')]},'callingtns':{'type':Sequelize[_0x0b3c('0x1')]},'dnid':{'type':Sequelize[_0x0b3c('0x1')]},'rdnis':{'type':Sequelize[_0x0b3c('0x1')]},'context':{'type':Sequelize[_0x0b3c('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x0b3c('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0b3c('0x1')]},'joinAt':{'type':Sequelize[_0x0b3c('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x0b3c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xecfc=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xecfc,0x157));var _0xcecf=function(_0x20b06b,_0x4f9b70){_0x20b06b=_0x20b06b-0x0;var _0xc36e99=_0xecfc[_0x20b06b];return _0xc36e99;};'use strict';var Sequelize=require(_0xcecf('0x0'));module['exports']={'network':{'type':Sequelize[_0xcecf('0x1')]},'network_script':{'type':Sequelize[_0xcecf('0x1')]},'request':{'type':Sequelize[_0xcecf('0x1')]},'channel':{'type':Sequelize[_0xcecf('0x1')]},'language':{'type':Sequelize[_0xcecf('0x1')]},'type':{'type':Sequelize[_0xcecf('0x1')]},'uniqueid':{'type':Sequelize[_0xcecf('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcecf('0x1')]},'calleridname':{'type':Sequelize[_0xcecf('0x1')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xcecf('0x1')]},'callingtns':{'type':Sequelize[_0xcecf('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xcecf('0x1')]},'extension':{'type':Sequelize[_0xcecf('0x1')]},'priority':{'type':Sequelize[_0xcecf('0x1')]},'enhanced':{'type':Sequelize[_0xcecf('0x1')]},'accountcode':{'type':Sequelize[_0xcecf('0x1')]},'threadid':{'type':Sequelize[_0xcecf('0x1')]},'project_name':{'type':Sequelize[_0xcecf('0x1')]},'joinAt':{'type':Sequelize[_0xcecf('0x2')]},'leaveAt':{'type':Sequelize[_0xcecf('0x2')]},'bot':{'type':Sequelize[_0xcecf('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 09285da..c4ccdde 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 _0xe712=['bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','SquareReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','options','includeAll','include','show','keys','length','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x30eab3,_0x5abc1c){var _0x1ef923=function(_0x21967c){while(--_0x21967c){_0x30eab3['push'](_0x30eab3['shift']());}};_0x1ef923(++_0x5abc1c);}(_0xe712,0x1aa));var _0x2e71=function(_0x328b16,_0x3e4f61){_0x328b16=_0x328b16-0x0;var _0x888fc1=_0xe712[_0x328b16];return _0x888fc1;};'use strict';var pdf=require(_0x2e71('0x0'));var emlformat=require(_0x2e71('0x1'));var rimraf=require(_0x2e71('0x2'));var zipdir=require(_0x2e71('0x3'));var jsonpatch=require(_0x2e71('0x4'));var rp=require('request-promise');var moment=require(_0x2e71('0x5'));var BPromise=require(_0x2e71('0x6'));var Mustache=require(_0x2e71('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2e71('0x8'));var csv=require(_0x2e71('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e71('0xa'));var squel=require('squel');var crypto=require(_0x2e71('0xb'));var jsforce=require(_0x2e71('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2e71('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2e71('0xd'));var authService=require(_0x2e71('0xe'));var qs=require(_0x2e71('0xf'));var as=require(_0x2e71('0x10'));var hardwareService=require(_0x2e71('0x11'));var logger=require(_0x2e71('0x12'))(_0x2e71('0x13'));var utils=require(_0x2e71('0x14'));var config=require(_0x2e71('0x15'));var db=require(_0x2e71('0x16'))['db'];function respondWithStatusCode(_0x26da59,_0x2ca04b){_0x2ca04b=_0x2ca04b||0xcc;return function(_0x3ae351){if(_0x3ae351){return _0x26da59['sendStatus'](_0x2ca04b);}return _0x26da59[_0x2e71('0x17')](_0x2ca04b)[_0x2e71('0x18')]();};}function respondWithResult(_0x146076,_0x44a372){_0x44a372=_0x44a372||0xc8;return function(_0x39569a){if(_0x39569a){return _0x146076[_0x2e71('0x17')](_0x44a372)[_0x2e71('0x19')](_0x39569a);}};}function respondWithFilteredResult(_0x3fec7a,_0xe2d292){return function(_0x219362){if(_0x219362){var _0x24b9f3=_0x219362[_0x2e71('0x1a')],_0x1f0c14=_0xe2d292[_0x2e71('0x1b')],_0x5b01b4=_0xe2d292[_0x2e71('0x1b')]+_0xe2d292['limit'],_0x4da8dd;if(_0x5b01b4>=_0x24b9f3){_0x5b01b4=_0x24b9f3;_0x4da8dd=0xc8;}else{_0x4da8dd=0xce;}_0x3fec7a[_0x2e71('0x17')](_0x4da8dd);return _0x3fec7a[_0x2e71('0x1c')]('Content-Range',_0x1f0c14+'-'+_0x5b01b4+'/'+_0x24b9f3)[_0x2e71('0x19')](_0x219362);}return null;};}function patchUpdates(_0x180bdf){return function(_0x2b0a53){try{jsonpatch[_0x2e71('0x1d')](_0x2b0a53,_0x180bdf,!![]);}catch(_0x1cb5aa){return BPromise[_0x2e71('0x1e')](_0x1cb5aa);}return _0x2b0a53[_0x2e71('0x1f')]();};}function saveUpdates(_0x114cb5,_0x5bf2dd){return function(_0x487cb4){if(_0x487cb4){return _0x487cb4[_0x2e71('0x20')](_0x114cb5)[_0x2e71('0x21')](function(_0x5663d6){return _0x5663d6;});}return null;};}function removeEntity(_0x5c9f91,_0x379351){return function(_0x4fe6db){if(_0x4fe6db){return _0x4fe6db[_0x2e71('0x22')]()['then'](function(){_0x5c9f91['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x109e27,_0x408ef0){return function(_0x108b89){if(!_0x108b89){_0x109e27[_0x2e71('0x23')](0x194);}return _0x108b89;};}function handleError(_0x50d0fb,_0x1ea86e){_0x1ea86e=_0x1ea86e||0x1f4;return function(_0x5e33cd){logger['error'](_0x5e33cd[_0x2e71('0x24')]);if(_0x5e33cd[_0x2e71('0x25')]){delete _0x5e33cd[_0x2e71('0x25')];}_0x50d0fb[_0x2e71('0x17')](_0x1ea86e)[_0x2e71('0x26')](_0x5e33cd);};}exports['index']=function(_0x2eb684,_0x2f0a3e){var _0x3041e7={},_0x509474={},_0x4a6fdb={'count':0x0,'rows':[]};var _0x79620d=_[_0x2e71('0x27')](db[_0x2e71('0x28')][_0x2e71('0x29')],function(_0x33176d){return{'name':_0x33176d[_0x2e71('0x2a')],'type':_0x33176d['type'][_0x2e71('0x2b')]};});_0x509474[_0x2e71('0x2c')]=_['map'](_0x79620d,_0x2e71('0x25'));_0x509474[_0x2e71('0x2d')]=_['keys'](_0x2eb684[_0x2e71('0x2d')]);_0x509474['filters']=_[_0x2e71('0x2e')](_0x509474[_0x2e71('0x2c')],_0x509474[_0x2e71('0x2d')]);_0x3041e7[_0x2e71('0x2f')]=_[_0x2e71('0x2e')](_0x509474[_0x2e71('0x2c')],qs[_0x2e71('0x30')](_0x2eb684[_0x2e71('0x2d')][_0x2e71('0x30')]));_0x3041e7[_0x2e71('0x2f')]=_0x3041e7['attributes']['length']?_0x3041e7['attributes']:_0x509474['model'];if(!_0x2eb684[_0x2e71('0x2d')][_0x2e71('0x31')](_0x2e71('0x32'))){_0x3041e7[_0x2e71('0x33')]=qs[_0x2e71('0x33')](_0x2eb684[_0x2e71('0x2d')]['limit']);_0x3041e7[_0x2e71('0x1b')]=qs[_0x2e71('0x1b')](_0x2eb684['query'][_0x2e71('0x1b')]);}_0x3041e7[_0x2e71('0x34')]=qs[_0x2e71('0x35')](_0x2eb684['query']['sort']);_0x3041e7[_0x2e71('0x36')]=qs['filters'](_[_0x2e71('0x37')](_0x2eb684['query'],_0x509474[_0x2e71('0x38')]),_0x79620d);if(_0x2eb684[_0x2e71('0x2d')][_0x2e71('0x39')]){_0x3041e7['where']=_[_0x2e71('0x3a')](_0x3041e7['where'],{'$or':_[_0x2e71('0x27')](_0x79620d,function(_0x4e122c){if(_0x4e122c[_0x2e71('0x3b')]!=='VIRTUAL'){var _0x5f1ae2={};_0x5f1ae2[_0x4e122c[_0x2e71('0x25')]]={'$like':'%'+_0x2eb684[_0x2e71('0x2d')]['filter']+'%'};return _0x5f1ae2;}})});}_0x3041e7=_['merge']({},_0x3041e7,_0x2eb684[_0x2e71('0x3c')]);var _0x2032f8={'where':_0x3041e7[_0x2e71('0x36')]};return db['SquareReport']['count'](_0x2032f8)[_0x2e71('0x21')](function(_0x135739){_0x4a6fdb[_0x2e71('0x1a')]=_0x135739;if(_0x2eb684[_0x2e71('0x2d')][_0x2e71('0x3d')]){_0x3041e7[_0x2e71('0x3e')]=[{'all':!![]}];}return db[_0x2e71('0x28')]['findAll'](_0x3041e7);})[_0x2e71('0x21')](function(_0x238d9e){_0x4a6fdb['rows']=_0x238d9e;return _0x4a6fdb;})[_0x2e71('0x21')](respondWithFilteredResult(_0x2f0a3e,_0x3041e7))['catch'](handleError(_0x2f0a3e,null));};exports[_0x2e71('0x3f')]=function(_0x362d8f,_0x49f75e){var _0x477ecb={'raw':!![],'where':{'id':_0x362d8f['params']['id']}},_0x24ccc2={};_0x24ccc2[_0x2e71('0x2c')]=_[_0x2e71('0x40')](db[_0x2e71('0x28')][_0x2e71('0x29')]);_0x24ccc2[_0x2e71('0x2d')]=_[_0x2e71('0x40')](_0x362d8f[_0x2e71('0x2d')]);_0x24ccc2[_0x2e71('0x38')]=_[_0x2e71('0x2e')](_0x24ccc2['model'],_0x24ccc2['query']);_0x477ecb[_0x2e71('0x2f')]=_[_0x2e71('0x2e')](_0x24ccc2['model'],qs[_0x2e71('0x30')](_0x362d8f[_0x2e71('0x2d')][_0x2e71('0x30')]));_0x477ecb[_0x2e71('0x2f')]=_0x477ecb[_0x2e71('0x2f')][_0x2e71('0x41')]?_0x477ecb['attributes']:_0x24ccc2[_0x2e71('0x2c')];if(_0x362d8f[_0x2e71('0x2d')][_0x2e71('0x3d')]){_0x477ecb[_0x2e71('0x3e')]=[{'all':!![]}];}_0x477ecb=_[_0x2e71('0x3a')]({},_0x477ecb,_0x362d8f[_0x2e71('0x3c')]);return db[_0x2e71('0x28')][_0x2e71('0x42')](_0x477ecb)[_0x2e71('0x21')](handleEntityNotFound(_0x49f75e,null))[_0x2e71('0x21')](respondWithResult(_0x49f75e,null))[_0x2e71('0x43')](handleError(_0x49f75e,null));};exports[_0x2e71('0x44')]=function(_0x72bc3f,_0x4b0542){return db[_0x2e71('0x28')][_0x2e71('0x44')](_0x72bc3f[_0x2e71('0x45')],{})[_0x2e71('0x21')](respondWithResult(_0x4b0542,0xc9))[_0x2e71('0x43')](handleError(_0x4b0542,null));};exports[_0x2e71('0x20')]=function(_0x2a2d8e,_0x316c28){if(_0x2a2d8e[_0x2e71('0x45')]['id']){delete _0x2a2d8e[_0x2e71('0x45')]['id'];}return db[_0x2e71('0x28')][_0x2e71('0x42')]({'where':{'id':_0x2a2d8e[_0x2e71('0x46')]['id']}})['then'](handleEntityNotFound(_0x316c28,null))[_0x2e71('0x21')](saveUpdates(_0x2a2d8e['body'],null))[_0x2e71('0x21')](respondWithResult(_0x316c28,null))['catch'](handleError(_0x316c28,null));};exports[_0x2e71('0x22')]=function(_0x34fa55,_0x4f3a6a){return db['SquareReport'][_0x2e71('0x42')]({'where':{'id':_0x34fa55[_0x2e71('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f3a6a,null))[_0x2e71('0x21')](removeEntity(_0x4f3a6a,null))[_0x2e71('0x43')](handleError(_0x4f3a6a,null));};exports[_0x2e71('0x47')]=function(_0x11da5c,_0x519cde){return db[_0x2e71('0x28')]['describe']()[_0x2e71('0x21')](respondWithResult(_0x519cde,null))[_0x2e71('0x43')](handleError(_0x519cde,null));}; \ No newline at end of file +var _0xe867=['body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SquareReport','rawAttributes','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','include','findAll','rows','catch','show','params','includeAll','create'];(function(_0x53780f,_0x509fec){var _0x398575=function(_0x458271){while(--_0x458271){_0x53780f['push'](_0x53780f['shift']());}};_0x398575(++_0x509fec);}(_0xe867,0x176));var _0x7e86=function(_0x4d284c,_0x5e4620){_0x4d284c=_0x4d284c-0x0;var _0x5bfb77=_0xe867[_0x4d284c];return _0x5bfb77;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7e86('0x0'));var zipdir=require(_0x7e86('0x1'));var jsonpatch=require(_0x7e86('0x2'));var rp=require(_0x7e86('0x3'));var moment=require('moment');var BPromise=require(_0x7e86('0x4'));var Mustache=require(_0x7e86('0x5'));var util=require(_0x7e86('0x6'));var path=require('path');var sox=require(_0x7e86('0x7'));var csv=require(_0x7e86('0x8'));var ejs=require(_0x7e86('0x9'));var fs=require('fs');var _=require(_0x7e86('0xa'));var squel=require('squel');var crypto=require(_0x7e86('0xb'));var jsforce=require(_0x7e86('0xc'));var deskjs=require(_0x7e86('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7e86('0xe'));var Papa=require(_0x7e86('0xf'));var Redis=require(_0x7e86('0x10'));var authService=require(_0x7e86('0x11'));var qs=require(_0x7e86('0x12'));var as=require(_0x7e86('0x13'));var hardwareService=require(_0x7e86('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7e86('0x15'));var config=require(_0x7e86('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x517a2e,_0x5f1406){_0x5f1406=_0x5f1406||0xcc;return function(_0x1ae411){if(_0x1ae411){return _0x517a2e[_0x7e86('0x17')](_0x5f1406);}return _0x517a2e[_0x7e86('0x18')](_0x5f1406)[_0x7e86('0x19')]();};}function respondWithResult(_0x2ddb61,_0x2cad61){_0x2cad61=_0x2cad61||0xc8;return function(_0x4f2504){if(_0x4f2504){return _0x2ddb61[_0x7e86('0x18')](_0x2cad61)[_0x7e86('0x1a')](_0x4f2504);}};}function respondWithFilteredResult(_0x8ee039,_0x3f49cf){return function(_0x7c1199){if(_0x7c1199){var _0x8c8973=_0x7c1199['count'],_0x250d37=_0x3f49cf[_0x7e86('0x1b')],_0x173b83=_0x3f49cf[_0x7e86('0x1b')]+_0x3f49cf[_0x7e86('0x1c')],_0x4b44d1;if(_0x173b83>=_0x8c8973){_0x173b83=_0x8c8973;_0x4b44d1=0xc8;}else{_0x4b44d1=0xce;}_0x8ee039[_0x7e86('0x18')](_0x4b44d1);return _0x8ee039['set'](_0x7e86('0x1d'),_0x250d37+'-'+_0x173b83+'/'+_0x8c8973)['json'](_0x7c1199);}return null;};}function patchUpdates(_0xa1a2e8){return function(_0x22f702){try{jsonpatch[_0x7e86('0x1e')](_0x22f702,_0xa1a2e8,!![]);}catch(_0x3cc7a8){return BPromise[_0x7e86('0x1f')](_0x3cc7a8);}return _0x22f702[_0x7e86('0x20')]();};}function saveUpdates(_0x367db4,_0x13e519){return function(_0x204b3e){if(_0x204b3e){return _0x204b3e[_0x7e86('0x21')](_0x367db4)[_0x7e86('0x22')](function(_0x54d2fe){return _0x54d2fe;});}return null;};}function removeEntity(_0x27cfde,_0x33db0a){return function(_0x364cd3){if(_0x364cd3){return _0x364cd3['destroy']()[_0x7e86('0x22')](function(){_0x27cfde['status'](0xcc)[_0x7e86('0x19')]();});}};}function handleEntityNotFound(_0x3e528d,_0x596dc8){return function(_0x14dc6e){if(!_0x14dc6e){_0x3e528d[_0x7e86('0x17')](0x194);}return _0x14dc6e;};}function handleError(_0x1317b8,_0x397580){_0x397580=_0x397580||0x1f4;return function(_0xd6104){logger[_0x7e86('0x23')](_0xd6104[_0x7e86('0x24')]);if(_0xd6104[_0x7e86('0x25')]){delete _0xd6104[_0x7e86('0x25')];}_0x1317b8[_0x7e86('0x18')](_0x397580)[_0x7e86('0x26')](_0xd6104);};}exports['index']=function(_0x5271b3,_0x390602){var _0x43f125={},_0x57ebc1={},_0x24b74b={'count':0x0,'rows':[]};var _0x53b2f6=_[_0x7e86('0x27')](db[_0x7e86('0x28')][_0x7e86('0x29')],function(_0x1c1edd){return{'name':_0x1c1edd['fieldName'],'type':_0x1c1edd[_0x7e86('0x2a')][_0x7e86('0x2b')]};});_0x57ebc1[_0x7e86('0x2c')]=_[_0x7e86('0x27')](_0x53b2f6,'name');_0x57ebc1['query']=_[_0x7e86('0x2d')](_0x5271b3['query']);_0x57ebc1['filters']=_[_0x7e86('0x2e')](_0x57ebc1['model'],_0x57ebc1[_0x7e86('0x2f')]);_0x43f125[_0x7e86('0x30')]=_[_0x7e86('0x2e')](_0x57ebc1[_0x7e86('0x2c')],qs['fields'](_0x5271b3[_0x7e86('0x2f')][_0x7e86('0x31')]));_0x43f125['attributes']=_0x43f125['attributes'][_0x7e86('0x32')]?_0x43f125['attributes']:_0x57ebc1[_0x7e86('0x2c')];if(!_0x5271b3[_0x7e86('0x2f')][_0x7e86('0x33')](_0x7e86('0x34'))){_0x43f125['limit']=qs['limit'](_0x5271b3['query'][_0x7e86('0x1c')]);_0x43f125[_0x7e86('0x1b')]=qs['offset'](_0x5271b3[_0x7e86('0x2f')][_0x7e86('0x1b')]);}_0x43f125[_0x7e86('0x35')]=qs[_0x7e86('0x36')](_0x5271b3[_0x7e86('0x2f')]['sort']);_0x43f125[_0x7e86('0x37')]=qs[_0x7e86('0x38')](_[_0x7e86('0x39')](_0x5271b3[_0x7e86('0x2f')],_0x57ebc1['filters']),_0x53b2f6);if(_0x5271b3[_0x7e86('0x2f')]['filter']){_0x43f125[_0x7e86('0x37')]=_[_0x7e86('0x3a')](_0x43f125[_0x7e86('0x37')],{'$or':_[_0x7e86('0x27')](_0x53b2f6,function(_0x5b2559){if(_0x5b2559[_0x7e86('0x2a')]!==_0x7e86('0x3b')){var _0x2e5e24={};_0x2e5e24[_0x5b2559[_0x7e86('0x25')]]={'$like':'%'+_0x5271b3[_0x7e86('0x2f')][_0x7e86('0x3c')]+'%'};return _0x2e5e24;}})});}_0x43f125=_[_0x7e86('0x3a')]({},_0x43f125,_0x5271b3['options']);var _0x5f3635={'where':_0x43f125[_0x7e86('0x37')]};return db[_0x7e86('0x28')][_0x7e86('0x3d')](_0x5f3635)[_0x7e86('0x22')](function(_0x958a2a){_0x24b74b[_0x7e86('0x3d')]=_0x958a2a;if(_0x5271b3[_0x7e86('0x2f')]['includeAll']){_0x43f125[_0x7e86('0x3e')]=[{'all':!![]}];}return db[_0x7e86('0x28')][_0x7e86('0x3f')](_0x43f125);})['then'](function(_0x43432e){_0x24b74b[_0x7e86('0x40')]=_0x43432e;return _0x24b74b;})[_0x7e86('0x22')](respondWithFilteredResult(_0x390602,_0x43f125))[_0x7e86('0x41')](handleError(_0x390602,null));};exports[_0x7e86('0x42')]=function(_0xf070b2,_0x5f56f3){var _0x574309={'raw':!![],'where':{'id':_0xf070b2[_0x7e86('0x43')]['id']}},_0x490a58={};_0x490a58[_0x7e86('0x2c')]=_[_0x7e86('0x2d')](db[_0x7e86('0x28')][_0x7e86('0x29')]);_0x490a58[_0x7e86('0x2f')]=_[_0x7e86('0x2d')](_0xf070b2['query']);_0x490a58[_0x7e86('0x38')]=_['intersection'](_0x490a58['model'],_0x490a58[_0x7e86('0x2f')]);_0x574309['attributes']=_[_0x7e86('0x2e')](_0x490a58[_0x7e86('0x2c')],qs[_0x7e86('0x31')](_0xf070b2[_0x7e86('0x2f')]['fields']));_0x574309[_0x7e86('0x30')]=_0x574309[_0x7e86('0x30')]['length']?_0x574309[_0x7e86('0x30')]:_0x490a58[_0x7e86('0x2c')];if(_0xf070b2[_0x7e86('0x2f')][_0x7e86('0x44')]){_0x574309['include']=[{'all':!![]}];}_0x574309=_[_0x7e86('0x3a')]({},_0x574309,_0xf070b2['options']);return db[_0x7e86('0x28')]['find'](_0x574309)[_0x7e86('0x22')](handleEntityNotFound(_0x5f56f3,null))['then'](respondWithResult(_0x5f56f3,null))[_0x7e86('0x41')](handleError(_0x5f56f3,null));};exports[_0x7e86('0x45')]=function(_0xd73bf,_0x4352f2){return db['SquareReport'][_0x7e86('0x45')](_0xd73bf[_0x7e86('0x46')],{})[_0x7e86('0x22')](respondWithResult(_0x4352f2,0xc9))[_0x7e86('0x41')](handleError(_0x4352f2,null));};exports[_0x7e86('0x21')]=function(_0x476514,_0x3464e6){if(_0x476514[_0x7e86('0x46')]['id']){delete _0x476514[_0x7e86('0x46')]['id'];}return db[_0x7e86('0x28')][_0x7e86('0x47')]({'where':{'id':_0x476514['params']['id']}})['then'](handleEntityNotFound(_0x3464e6,null))['then'](saveUpdates(_0x476514[_0x7e86('0x46')],null))[_0x7e86('0x22')](respondWithResult(_0x3464e6,null))[_0x7e86('0x41')](handleError(_0x3464e6,null));};exports[_0x7e86('0x48')]=function(_0x422052,_0x27576e){return db['SquareReport'][_0x7e86('0x47')]({'where':{'id':_0x422052['params']['id']}})[_0x7e86('0x22')](handleEntityNotFound(_0x27576e,null))[_0x7e86('0x22')](removeEntity(_0x27576e,null))[_0x7e86('0x41')](handleError(_0x27576e,null));};exports[_0x7e86('0x49')]=function(_0x55682a,_0x366aed){return db[_0x7e86('0x28')]['describe']()['then'](respondWithResult(_0x366aed,null))[_0x7e86('0x41')](handleError(_0x366aed,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 44cab9f..a6cf268 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 _0xcde4=['bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','report_square','uniqueid','project_name','leaveAt','lodash','../../config/logger','api','moment'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xcde4,0xdd));var _0x4cde=function(_0x22eb96,_0x3c2d8d){_0x22eb96=_0x22eb96-0x0;var _0x5e1adf=_0xcde4[_0x22eb96];return _0x5e1adf;};'use strict';var _=require(_0x4cde('0x0'));var util=require('util');var logger=require(_0x4cde('0x1'))(_0x4cde('0x2'));var moment=require(_0x4cde('0x3'));var BPromise=require(_0x4cde('0x4'));var rp=require(_0x4cde('0x5'));var fs=require('fs');var path=require(_0x4cde('0x6'));var rimraf=require(_0x4cde('0x7'));var config=require('../../config/environment');var attributes=require(_0x4cde('0x8'));module[_0x4cde('0x9')]=function(_0x1c5438,_0x16ca9a){return _0x1c5438[_0x4cde('0xa')]('SquareReport',attributes,{'tableName':_0x4cde('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x4cde('0xc'),_0x4cde('0xd')]},{'name':_0x4cde('0xe'),'fields':[_0x4cde('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9b2e=['project_name','leaveAt','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid'];(function(_0x291754,_0x5e565b){var _0x40a674=function(_0x55ef13){while(--_0x55ef13){_0x291754['push'](_0x291754['shift']());}};_0x40a674(++_0x5e565b);}(_0x9b2e,0x6e));var _0xe9b2=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9b2e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe9b2('0x0'));var util=require('util');var logger=require(_0xe9b2('0x1'))(_0xe9b2('0x2'));var moment=require(_0xe9b2('0x3'));var BPromise=require(_0xe9b2('0x4'));var rp=require(_0xe9b2('0x5'));var fs=require('fs');var path=require(_0xe9b2('0x6'));var rimraf=require(_0xe9b2('0x7'));var config=require(_0xe9b2('0x8'));var attributes=require(_0xe9b2('0x9'));module[_0xe9b2('0xa')]=function(_0x3c72d8,_0x463483){return _0x3c72d8[_0xe9b2('0xb')](_0xe9b2('0xc'),attributes,{'tableName':_0xe9b2('0xd'),'paranoid':![],'indexes':[{'name':_0xe9b2('0xe'),'fields':[_0xe9b2('0xf'),_0xe9b2('0x10')]},{'name':'leaveAt','fields':[_0xe9b2('0x11')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 86d3160..a678fc5 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 _0x4659=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport','where','attributes','limit','lodash','util'];(function(_0x4d275c,_0x522396){var _0x55b75f=function(_0x47e6d3){while(--_0x47e6d3){_0x4d275c['push'](_0x4d275c['shift']());}};_0x55b75f(++_0x522396);}(_0x4659,0x1e8));var _0x9465=function(_0x234ec3,_0x21bf1f){_0x234ec3=_0x234ec3-0x0;var _0x54fae=_0x4659[_0x234ec3];return _0x54fae;};'use strict';var _=require(_0x9465('0x0'));var util=require(_0x9465('0x1'));var moment=require(_0x9465('0x2'));var BPromise=require(_0x9465('0x3'));var rs=require(_0x9465('0x4'));var fs=require('fs');var Redis=require(_0x9465('0x5'));var db=require(_0x9465('0x6'))['db'];var utils=require(_0x9465('0x7'));var logger=require('../../config/logger')(_0x9465('0x8'));var config=require(_0x9465('0x9'));var jayson=require(_0x9465('0xa'));var client=jayson[_0x9465('0xb')][_0x9465('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3c4fa1,_0x265ea1,_0x1eb0e1){return new BPromise(function(_0x291a2b,_0x3febf1){return client[_0x9465('0xd')](_0x3c4fa1,_0x1eb0e1)[_0x9465('0xe')](function(_0xffe197){logger[_0x9465('0xf')]('SquareReport,\x20%s,\x20%s',_0x265ea1,'request\x20sent');logger[_0x9465('0x10')](_0x9465('0x11'),_0x265ea1,'request\x20sent',JSON[_0x9465('0x12')](_0xffe197));if(_0xffe197[_0x9465('0x13')]){if(_0xffe197['error'][_0x9465('0x14')]===0x1f4){logger[_0x9465('0x13')](_0x9465('0x15'),_0x265ea1,_0xffe197[_0x9465('0x13')][_0x9465('0x16')]);return _0x3febf1(_0xffe197[_0x9465('0x13')]['message']);}logger['error'](_0x9465('0x15'),_0x265ea1,_0xffe197[_0x9465('0x13')]['message']);return _0x291a2b(_0xffe197[_0x9465('0x13')][_0x9465('0x16')]);}else{logger[_0x9465('0xf')]('SquareReport,\x20%s,\x20%s',_0x265ea1,'request\x20sent');_0x291a2b(_0xffe197[_0x9465('0x17')][_0x9465('0x16')]);}})[_0x9465('0x18')](function(_0x35e5a4){logger[_0x9465('0x13')](_0x9465('0x15'),_0x265ea1,_0x35e5a4);_0x3febf1(_0x35e5a4);});});}exports['CreateSquareReport']=function(_0x1ad57a){var _0x582545=this;return new Promise(function(_0x95f6ee,_0x38d344){return db[_0x9465('0x19')][_0x9465('0x1a')](_0x1ad57a[_0x9465('0x1b')],{'raw':_0x1ad57a['options']?_0x1ad57a[_0x9465('0x1c')][_0x9465('0x1d')]===undefined?!![]:![]:!![]})[_0x9465('0xe')](function(_0x3fd4de){logger['info'](_0x9465('0x1e'),_0x1ad57a);logger[_0x9465('0x10')](_0x9465('0x1e'),_0x1ad57a,JSON[_0x9465('0x12')](_0x3fd4de));_0x95f6ee(_0x3fd4de);})['catch'](function(_0x21df77){logger[_0x9465('0x13')](_0x9465('0x1e'),_0x21df77['message'],_0x1ad57a);_0x38d344(_0x582545[_0x9465('0x13')](0x1f4,_0x21df77[_0x9465('0x16')]));});});};exports[_0x9465('0x1f')]=function(_0x4d235d){var _0x256170=this;return new Promise(function(_0x31b9eb,_0x2b8599){return db[_0x9465('0x19')]['update'](_0x4d235d['body'],{'raw':_0x4d235d[_0x9465('0x1c')]?_0x4d235d['options'][_0x9465('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d235d[_0x9465('0x1c')]?_0x4d235d[_0x9465('0x1c')][_0x9465('0x20')]||null:null,'attributes':_0x4d235d['options']?_0x4d235d[_0x9465('0x1c')][_0x9465('0x21')]||null:null,'limit':_0x4d235d[_0x9465('0x1c')]?_0x4d235d[_0x9465('0x1c')][_0x9465('0x22')]||null:null})[_0x9465('0xe')](function(_0x5d4be1){logger[_0x9465('0xf')](_0x9465('0x1f'),_0x4d235d);logger[_0x9465('0x10')](_0x9465('0x1f'),_0x4d235d,JSON['stringify'](_0x5d4be1));_0x31b9eb(_0x5d4be1);})[_0x9465('0x18')](function(_0x3da9d9){logger['error'](_0x9465('0x1f'),_0x3da9d9[_0x9465('0x16')],_0x4d235d);_0x2b8599(_0x256170['error'](0x1f4,_0x3da9d9[_0x9465('0x16')]));});});}; \ No newline at end of file +var _0x8207=['UpdateSquareReport','update','body','raw','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','CreateSquareReport','create','options','debug','catch'];(function(_0x292507,_0x296175){var _0x56c975=function(_0x20f6c3){while(--_0x20f6c3){_0x292507['push'](_0x292507['shift']());}};_0x56c975(++_0x296175);}(_0x8207,0x82));var _0x7820=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8207[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7820('0x0'));var util=require(_0x7820('0x1'));var moment=require('moment');var BPromise=require(_0x7820('0x2'));var rs=require(_0x7820('0x3'));var fs=require('fs');var Redis=require(_0x7820('0x4'));var db=require(_0x7820('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7820('0x6'))(_0x7820('0x7'));var config=require(_0x7820('0x8'));var jayson=require(_0x7820('0x9'));var client=jayson['client'][_0x7820('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c49a1,_0x368f0d,_0x16d656){return new BPromise(function(_0xe262c1,_0x2cae28){return client['request'](_0x2c49a1,_0x16d656)[_0x7820('0xb')](function(_0x4e3923){logger[_0x7820('0xc')]('SquareReport,\x20%s,\x20%s',_0x368f0d,_0x7820('0xd'));logger['debug'](_0x7820('0xe'),_0x368f0d,_0x7820('0xd'),JSON[_0x7820('0xf')](_0x4e3923));if(_0x4e3923[_0x7820('0x10')]){if(_0x4e3923[_0x7820('0x10')][_0x7820('0x11')]===0x1f4){logger[_0x7820('0x10')](_0x7820('0x12'),_0x368f0d,_0x4e3923[_0x7820('0x10')][_0x7820('0x13')]);return _0x2cae28(_0x4e3923[_0x7820('0x10')][_0x7820('0x13')]);}logger[_0x7820('0x10')]('SquareReport,\x20%s,\x20%s',_0x368f0d,_0x4e3923[_0x7820('0x10')]['message']);return _0xe262c1(_0x4e3923[_0x7820('0x10')][_0x7820('0x13')]);}else{logger[_0x7820('0xc')](_0x7820('0x12'),_0x368f0d,_0x7820('0xd'));_0xe262c1(_0x4e3923['result']['message']);}})['catch'](function(_0x3a931f){logger[_0x7820('0x10')](_0x7820('0x12'),_0x368f0d,_0x3a931f);_0x2cae28(_0x3a931f);});});}exports[_0x7820('0x14')]=function(_0x543738){var _0x12ba8d=this;return new Promise(function(_0x4b6def,_0x4de1cb){return db['SquareReport'][_0x7820('0x15')](_0x543738['body'],{'raw':_0x543738[_0x7820('0x16')]?_0x543738['options']['raw']===undefined?!![]:![]:!![]})[_0x7820('0xb')](function(_0x25aa17){logger[_0x7820('0xc')](_0x7820('0x14'),_0x543738);logger[_0x7820('0x17')]('CreateSquareReport',_0x543738,JSON['stringify'](_0x25aa17));_0x4b6def(_0x25aa17);})[_0x7820('0x18')](function(_0x418e40){logger[_0x7820('0x10')](_0x7820('0x14'),_0x418e40[_0x7820('0x13')],_0x543738);_0x4de1cb(_0x12ba8d[_0x7820('0x10')](0x1f4,_0x418e40[_0x7820('0x13')]));});});};exports[_0x7820('0x19')]=function(_0xeba28c){var _0x484a7f=this;return new Promise(function(_0x53ae29,_0x426367){return db['SquareReport'][_0x7820('0x1a')](_0xeba28c[_0x7820('0x1b')],{'raw':_0xeba28c[_0x7820('0x16')]?_0xeba28c[_0x7820('0x16')][_0x7820('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeba28c[_0x7820('0x16')]?_0xeba28c[_0x7820('0x16')]['where']||null:null,'attributes':_0xeba28c['options']?_0xeba28c[_0x7820('0x16')][_0x7820('0x1d')]||null:null,'limit':_0xeba28c[_0x7820('0x16')]?_0xeba28c[_0x7820('0x16')][_0x7820('0x1e')]||null:null})[_0x7820('0xb')](function(_0x3133ef){logger['info'](_0x7820('0x19'),_0xeba28c);logger[_0x7820('0x17')](_0x7820('0x19'),_0xeba28c,JSON[_0x7820('0xf')](_0x3133ef));_0x53ae29(_0x3133ef);})[_0x7820('0x18')](function(_0x5754bc){logger[_0x7820('0x10')](_0x7820('0x19'),_0x5754bc['message'],_0xeba28c);_0x426367(_0x484a7f[_0x7820('0x10')](0x1f4,_0x5754bc['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b16ffdd..745e8e0 100644 --- a/server/api/squareReportDetail/index.js +++ b/server/api/squareReportDetail/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x7132da,_0x5225ca){var _0x215082=function(_0x89824b){while(--_0x89824b){_0x7132da['push'](_0x7132da['shift']());}};_0x215082(++_0x5225ca);}(_0x7a54,0x106));var _0x47a5=function(_0x424c91,_0x11aa20){_0x424c91=_0x424c91-0x0;var _0x4736bd=_0x7a54[_0x424c91];return _0x4736bd;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x7a54,0x106));var _0x47a5=function(_0x4e3906,_0xa02830){_0x4e3906=_0x4e3906-0x0;var _0x478563=_0x7a54[_0x4e3906];return _0x478563;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index d743b69..99dd019 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 _0x77d8=['TEXT','sequelize','exports','STRING'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x77d8,0xad));var _0x877d=function(_0x25c92b,_0x41b368){_0x25c92b=_0x25c92b-0x0;var _0xc59d85=_0x77d8[_0x25c92b];return _0xc59d85;};'use strict';var Sequelize=require(_0x877d('0x0'));module[_0x877d('0x1')]={'uniqueid':{'type':Sequelize[_0x877d('0x2')]},'node':{'type':Sequelize[_0x877d('0x2')]},'application':{'type':Sequelize[_0x877d('0x2')]},'data':{'type':Sequelize[_0x877d('0x3')]},'project_name':{'type':Sequelize[_0x877d('0x2')]},'callerid':{'type':Sequelize[_0x877d('0x2')]}}; \ No newline at end of file +var _0x1b9a=['TEXT','sequelize','STRING'];(function(_0x3575e7,_0x4414e2){var _0x1fe1c6=function(_0x38afda){while(--_0x38afda){_0x3575e7['push'](_0x3575e7['shift']());}};_0x1fe1c6(++_0x4414e2);}(_0x1b9a,0x10c));var _0xa1b9=function(_0x14ee95,_0x239f70){_0x14ee95=_0x14ee95-0x0;var _0x470402=_0x1b9a[_0x14ee95];return _0x470402;};'use strict';var Sequelize=require(_0xa1b9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa1b9('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xa1b9('0x1')]},'data':{'type':Sequelize[_0xa1b9('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index bdd30b1..48651a1 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 _0x78b6=['send','map','SquareDetailsReport','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','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','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name'];(function(_0x55ff21,_0x1540f0){var _0x4baf37=function(_0x51128b){while(--_0x51128b){_0x55ff21['push'](_0x55ff21['shift']());}};_0x4baf37(++_0x1540f0);}(_0x78b6,0x14e));var _0x678b=function(_0xeea5ca,_0x2d569b){_0xeea5ca=_0xeea5ca-0x0;var _0x1fdf07=_0x78b6[_0xeea5ca];return _0x1fdf07;};'use strict';var pdf=require(_0x678b('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x678b('0x1'));var jsonpatch=require(_0x678b('0x2'));var rp=require(_0x678b('0x3'));var moment=require('moment');var BPromise=require(_0x678b('0x4'));var Mustache=require('mustache');var util=require(_0x678b('0x5'));var path=require('path');var sox=require(_0x678b('0x6'));var csv=require(_0x678b('0x7'));var ejs=require(_0x678b('0x8'));var fs=require('fs');var _=require(_0x678b('0x9'));var squel=require(_0x678b('0xa'));var crypto=require(_0x678b('0xb'));var jsforce=require(_0x678b('0xc'));var deskjs=require(_0x678b('0xd'));var toCsv=require(_0x678b('0x7'));var querystring=require(_0x678b('0xe'));var Papa=require(_0x678b('0xf'));var Redis=require(_0x678b('0x10'));var authService=require(_0x678b('0x11'));var qs=require(_0x678b('0x12'));var as=require(_0x678b('0x13'));var hardwareService=require(_0x678b('0x14'));var logger=require(_0x678b('0x15'))(_0x678b('0x16'));var utils=require(_0x678b('0x17'));var config=require('../../config/environment');var db=require(_0x678b('0x18'))['db'];function respondWithStatusCode(_0x4e0633,_0x34eb9c){_0x34eb9c=_0x34eb9c||0xcc;return function(_0x52926f){if(_0x52926f){return _0x4e0633[_0x678b('0x19')](_0x34eb9c);}return _0x4e0633[_0x678b('0x1a')](_0x34eb9c)[_0x678b('0x1b')]();};}function respondWithResult(_0x42b348,_0x10f863){_0x10f863=_0x10f863||0xc8;return function(_0x379030){if(_0x379030){return _0x42b348[_0x678b('0x1a')](_0x10f863)[_0x678b('0x1c')](_0x379030);}};}function respondWithFilteredResult(_0x29ba07,_0x54174a){return function(_0x2f016b){if(_0x2f016b){var _0x1f5fd5=_0x2f016b['count'],_0xa75baa=_0x54174a[_0x678b('0x1d')],_0x3d1ddb=_0x54174a[_0x678b('0x1d')]+_0x54174a[_0x678b('0x1e')],_0x5dd3f9;if(_0x3d1ddb>=_0x1f5fd5){_0x3d1ddb=_0x1f5fd5;_0x5dd3f9=0xc8;}else{_0x5dd3f9=0xce;}_0x29ba07[_0x678b('0x1a')](_0x5dd3f9);return _0x29ba07[_0x678b('0x1f')](_0x678b('0x20'),_0xa75baa+'-'+_0x3d1ddb+'/'+_0x1f5fd5)[_0x678b('0x1c')](_0x2f016b);}return null;};}function patchUpdates(_0x22b709){return function(_0x123f53){try{jsonpatch[_0x678b('0x21')](_0x123f53,_0x22b709,!![]);}catch(_0x492c12){return BPromise[_0x678b('0x22')](_0x492c12);}return _0x123f53[_0x678b('0x23')]();};}function saveUpdates(_0x2fa30,_0x33a069){return function(_0x1043ea){if(_0x1043ea){return _0x1043ea[_0x678b('0x24')](_0x2fa30)[_0x678b('0x25')](function(_0x4a47a3){return _0x4a47a3;});}return null;};}function removeEntity(_0x30e20d,_0x4228c7){return function(_0x2c1a5c){if(_0x2c1a5c){return _0x2c1a5c[_0x678b('0x26')]()[_0x678b('0x25')](function(){_0x30e20d[_0x678b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b3760,_0x270060){return function(_0x53634a){if(!_0x53634a){_0x5b3760['sendStatus'](0x194);}return _0x53634a;};}function handleError(_0x414580,_0x530281){_0x530281=_0x530281||0x1f4;return function(_0x2c412e){logger[_0x678b('0x27')](_0x2c412e['stack']);if(_0x2c412e[_0x678b('0x28')]){delete _0x2c412e[_0x678b('0x28')];}_0x414580[_0x678b('0x1a')](_0x530281)[_0x678b('0x29')](_0x2c412e);};}exports['index']=function(_0x3df816,_0x41f927){var _0x4c2bbc={},_0x294df5={},_0x41bdb2={'count':0x0,'rows':[]};var _0x292826=_[_0x678b('0x2a')](db[_0x678b('0x2b')]['rawAttributes'],function(_0x2796ae){return{'name':_0x2796ae['fieldName'],'type':_0x2796ae[_0x678b('0x2c')][_0x678b('0x2d')]};});_0x294df5['model']=_[_0x678b('0x2a')](_0x292826,_0x678b('0x28'));_0x294df5[_0x678b('0x2e')]=_[_0x678b('0x2f')](_0x3df816[_0x678b('0x2e')]);_0x294df5[_0x678b('0x30')]=_[_0x678b('0x31')](_0x294df5[_0x678b('0x32')],_0x294df5[_0x678b('0x2e')]);_0x4c2bbc[_0x678b('0x33')]=_[_0x678b('0x31')](_0x294df5['model'],qs[_0x678b('0x34')](_0x3df816[_0x678b('0x2e')]['fields']));_0x4c2bbc[_0x678b('0x33')]=_0x4c2bbc[_0x678b('0x33')][_0x678b('0x35')]?_0x4c2bbc[_0x678b('0x33')]:_0x294df5[_0x678b('0x32')];if(!_0x3df816[_0x678b('0x2e')]['hasOwnProperty'](_0x678b('0x36'))){_0x4c2bbc['limit']=qs[_0x678b('0x1e')](_0x3df816['query']['limit']);_0x4c2bbc[_0x678b('0x1d')]=qs[_0x678b('0x1d')](_0x3df816[_0x678b('0x2e')][_0x678b('0x1d')]);}_0x4c2bbc[_0x678b('0x37')]=qs[_0x678b('0x38')](_0x3df816[_0x678b('0x2e')][_0x678b('0x38')]);_0x4c2bbc[_0x678b('0x39')]=qs[_0x678b('0x30')](_[_0x678b('0x3a')](_0x3df816['query'],_0x294df5['filters']),_0x292826);if(_0x3df816['query'][_0x678b('0x3b')]){_0x4c2bbc[_0x678b('0x39')]=_[_0x678b('0x3c')](_0x4c2bbc['where'],{'$or':_['map'](_0x292826,function(_0x3154b3){if(_0x3154b3[_0x678b('0x2c')]!==_0x678b('0x3d')){var _0x283ac9={};_0x283ac9[_0x3154b3['name']]={'$like':'%'+_0x3df816[_0x678b('0x2e')]['filter']+'%'};return _0x283ac9;}})});}_0x4c2bbc=_['merge']({},_0x4c2bbc,_0x3df816[_0x678b('0x3e')]);var _0x10c317={'where':_0x4c2bbc[_0x678b('0x39')]};return db[_0x678b('0x2b')][_0x678b('0x3f')](_0x10c317)['then'](function(_0x6e9630){_0x41bdb2[_0x678b('0x3f')]=_0x6e9630;if(_0x3df816[_0x678b('0x2e')]['includeAll']){_0x4c2bbc[_0x678b('0x40')]=[{'all':!![]}];}return db[_0x678b('0x2b')][_0x678b('0x41')](_0x4c2bbc);})[_0x678b('0x25')](function(_0x21d96c){_0x41bdb2[_0x678b('0x42')]=_0x21d96c;return _0x41bdb2;})['then'](respondWithFilteredResult(_0x41f927,_0x4c2bbc))[_0x678b('0x43')](handleError(_0x41f927,null));};exports[_0x678b('0x44')]=function(_0x1874fa,_0x3020f0){var _0x22eb90={'raw':!![],'where':{'id':_0x1874fa[_0x678b('0x45')]['id']}},_0xe5fc08={};_0xe5fc08[_0x678b('0x32')]=_['keys'](db['SquareDetailsReport'][_0x678b('0x46')]);_0xe5fc08[_0x678b('0x2e')]=_['keys'](_0x1874fa[_0x678b('0x2e')]);_0xe5fc08['filters']=_[_0x678b('0x31')](_0xe5fc08['model'],_0xe5fc08[_0x678b('0x2e')]);_0x22eb90[_0x678b('0x33')]=_[_0x678b('0x31')](_0xe5fc08[_0x678b('0x32')],qs[_0x678b('0x34')](_0x1874fa[_0x678b('0x2e')]['fields']));_0x22eb90[_0x678b('0x33')]=_0x22eb90[_0x678b('0x33')]['length']?_0x22eb90[_0x678b('0x33')]:_0xe5fc08[_0x678b('0x32')];if(_0x1874fa['query']['includeAll']){_0x22eb90[_0x678b('0x40')]=[{'all':!![]}];}_0x22eb90=_[_0x678b('0x3c')]({},_0x22eb90,_0x1874fa['options']);return db['SquareDetailsReport'][_0x678b('0x47')](_0x22eb90)[_0x678b('0x25')](handleEntityNotFound(_0x3020f0,null))[_0x678b('0x25')](respondWithResult(_0x3020f0,null))[_0x678b('0x43')](handleError(_0x3020f0,null));};exports[_0x678b('0x48')]=function(_0x4b7cad,_0x4aea22){return db[_0x678b('0x2b')][_0x678b('0x48')](_0x4b7cad[_0x678b('0x49')],{})[_0x678b('0x25')](respondWithResult(_0x4aea22,0xc9))[_0x678b('0x43')](handleError(_0x4aea22,null));};exports['update']=function(_0x56e4a5,_0x1d61d9){if(_0x56e4a5['body']['id']){delete _0x56e4a5[_0x678b('0x49')]['id'];}return db[_0x678b('0x2b')][_0x678b('0x47')]({'where':{'id':_0x56e4a5[_0x678b('0x45')]['id']}})[_0x678b('0x25')](handleEntityNotFound(_0x1d61d9,null))[_0x678b('0x25')](saveUpdates(_0x56e4a5['body'],null))[_0x678b('0x25')](respondWithResult(_0x1d61d9,null))[_0x678b('0x43')](handleError(_0x1d61d9,null));};exports['destroy']=function(_0x1db146,_0x465645){return db['SquareDetailsReport'][_0x678b('0x47')]({'where':{'id':_0x1db146['params']['id']}})[_0x678b('0x25')](handleEntityNotFound(_0x465645,null))[_0x678b('0x25')](removeEntity(_0x465645,null))[_0x678b('0x43')](handleError(_0x465645,null));};exports[_0x678b('0x4a')]=function(_0x305c30,_0xd136d1){return db[_0x678b('0x2b')][_0x678b('0x4a')]()[_0x678b('0x25')](respondWithResult(_0xd136d1,null))['catch'](handleError(_0xd136d1,null));}; \ No newline at end of file +var _0xd6d2=['crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','send','index','map','SquareDetailsReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','name','options','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','lodash'];(function(_0x4b952f,_0x50afd4){var _0x15b0b5=function(_0x4f02b9){while(--_0x4f02b9){_0x4b952f['push'](_0x4b952f['shift']());}};_0x15b0b5(++_0x50afd4);}(_0xd6d2,0x10a));var _0x2d6d=function(_0x46800e,_0x52b992){_0x46800e=_0x46800e-0x0;var _0x4d00f9=_0xd6d2[_0x46800e];return _0x4d00f9;};'use strict';var pdf=require(_0x2d6d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2d6d('0x1'));var zipdir=require(_0x2d6d('0x2'));var jsonpatch=require(_0x2d6d('0x3'));var rp=require('request-promise');var moment=require(_0x2d6d('0x4'));var BPromise=require(_0x2d6d('0x5'));var Mustache=require(_0x2d6d('0x6'));var util=require('util');var path=require(_0x2d6d('0x7'));var sox=require(_0x2d6d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x2d6d('0x9'));var squel=require('squel');var crypto=require(_0x2d6d('0xa'));var jsforce=require(_0x2d6d('0xb'));var deskjs=require(_0x2d6d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2d6d('0xd'));var Redis=require('ioredis');var authService=require(_0x2d6d('0xe'));var qs=require(_0x2d6d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2d6d('0x10'))(_0x2d6d('0x11'));var utils=require(_0x2d6d('0x12'));var config=require(_0x2d6d('0x13'));var db=require(_0x2d6d('0x14'))['db'];function respondWithStatusCode(_0x306ce2,_0x8f30cc){_0x8f30cc=_0x8f30cc||0xcc;return function(_0x6e4cba){if(_0x6e4cba){return _0x306ce2[_0x2d6d('0x15')](_0x8f30cc);}return _0x306ce2[_0x2d6d('0x16')](_0x8f30cc)[_0x2d6d('0x17')]();};}function respondWithResult(_0xafb63f,_0x2a1a6b){_0x2a1a6b=_0x2a1a6b||0xc8;return function(_0x256432){if(_0x256432){return _0xafb63f[_0x2d6d('0x16')](_0x2a1a6b)[_0x2d6d('0x18')](_0x256432);}};}function respondWithFilteredResult(_0x4b44f7,_0x4c2642){return function(_0x6242df){if(_0x6242df){var _0x4def5a=_0x6242df[_0x2d6d('0x19')],_0x183eb7=_0x4c2642[_0x2d6d('0x1a')],_0x143303=_0x4c2642[_0x2d6d('0x1a')]+_0x4c2642['limit'],_0x1465d8;if(_0x143303>=_0x4def5a){_0x143303=_0x4def5a;_0x1465d8=0xc8;}else{_0x1465d8=0xce;}_0x4b44f7['status'](_0x1465d8);return _0x4b44f7[_0x2d6d('0x1b')](_0x2d6d('0x1c'),_0x183eb7+'-'+_0x143303+'/'+_0x4def5a)[_0x2d6d('0x18')](_0x6242df);}return null;};}function patchUpdates(_0x4a7632){return function(_0x258ce0){try{jsonpatch['apply'](_0x258ce0,_0x4a7632,!![]);}catch(_0x157977){return BPromise[_0x2d6d('0x1d')](_0x157977);}return _0x258ce0[_0x2d6d('0x1e')]();};}function saveUpdates(_0x44407e,_0x20ca2b){return function(_0x48465b){if(_0x48465b){return _0x48465b[_0x2d6d('0x1f')](_0x44407e)['then'](function(_0x54bcf7){return _0x54bcf7;});}return null;};}function removeEntity(_0x3ca23b,_0x5edadc){return function(_0x728fb4){if(_0x728fb4){return _0x728fb4[_0x2d6d('0x20')]()[_0x2d6d('0x21')](function(){_0x3ca23b[_0x2d6d('0x16')](0xcc)[_0x2d6d('0x17')]();});}};}function handleEntityNotFound(_0xaed2fc,_0x4e5bd0){return function(_0x556cc4){if(!_0x556cc4){_0xaed2fc[_0x2d6d('0x15')](0x194);}return _0x556cc4;};}function handleError(_0x12593c,_0x28ea76){_0x28ea76=_0x28ea76||0x1f4;return function(_0x2a40f3){logger[_0x2d6d('0x22')](_0x2a40f3[_0x2d6d('0x23')]);if(_0x2a40f3['name']){delete _0x2a40f3['name'];}_0x12593c[_0x2d6d('0x16')](_0x28ea76)[_0x2d6d('0x24')](_0x2a40f3);};}exports[_0x2d6d('0x25')]=function(_0x8d5f6e,_0x46e159){var _0x3622a0={},_0x14868c={},_0x3c5c13={'count':0x0,'rows':[]};var _0x5a70b1=_[_0x2d6d('0x26')](db[_0x2d6d('0x27')][_0x2d6d('0x28')],function(_0x52fafa){return{'name':_0x52fafa['fieldName'],'type':_0x52fafa[_0x2d6d('0x29')]['key']};});_0x14868c[_0x2d6d('0x2a')]=_[_0x2d6d('0x26')](_0x5a70b1,'name');_0x14868c[_0x2d6d('0x2b')]=_[_0x2d6d('0x2c')](_0x8d5f6e[_0x2d6d('0x2b')]);_0x14868c[_0x2d6d('0x2d')]=_[_0x2d6d('0x2e')](_0x14868c[_0x2d6d('0x2a')],_0x14868c['query']);_0x3622a0[_0x2d6d('0x2f')]=_['intersection'](_0x14868c[_0x2d6d('0x2a')],qs['fields'](_0x8d5f6e[_0x2d6d('0x2b')][_0x2d6d('0x30')]));_0x3622a0[_0x2d6d('0x2f')]=_0x3622a0[_0x2d6d('0x2f')][_0x2d6d('0x31')]?_0x3622a0[_0x2d6d('0x2f')]:_0x14868c[_0x2d6d('0x2a')];if(!_0x8d5f6e[_0x2d6d('0x2b')]['hasOwnProperty'](_0x2d6d('0x32'))){_0x3622a0[_0x2d6d('0x33')]=qs[_0x2d6d('0x33')](_0x8d5f6e[_0x2d6d('0x2b')][_0x2d6d('0x33')]);_0x3622a0[_0x2d6d('0x1a')]=qs[_0x2d6d('0x1a')](_0x8d5f6e['query'][_0x2d6d('0x1a')]);}_0x3622a0['order']=qs[_0x2d6d('0x34')](_0x8d5f6e[_0x2d6d('0x2b')][_0x2d6d('0x34')]);_0x3622a0[_0x2d6d('0x35')]=qs[_0x2d6d('0x2d')](_['pick'](_0x8d5f6e[_0x2d6d('0x2b')],_0x14868c[_0x2d6d('0x2d')]),_0x5a70b1);if(_0x8d5f6e[_0x2d6d('0x2b')][_0x2d6d('0x36')]){_0x3622a0['where']=_[_0x2d6d('0x37')](_0x3622a0[_0x2d6d('0x35')],{'$or':_[_0x2d6d('0x26')](_0x5a70b1,function(_0x254b02){if(_0x254b02[_0x2d6d('0x29')]!==_0x2d6d('0x38')){var _0x265c28={};_0x265c28[_0x254b02[_0x2d6d('0x39')]]={'$like':'%'+_0x8d5f6e['query']['filter']+'%'};return _0x265c28;}})});}_0x3622a0=_[_0x2d6d('0x37')]({},_0x3622a0,_0x8d5f6e[_0x2d6d('0x3a')]);var _0x2780cb={'where':_0x3622a0[_0x2d6d('0x35')]};return db[_0x2d6d('0x27')]['count'](_0x2780cb)[_0x2d6d('0x21')](function(_0x59550e){_0x3c5c13[_0x2d6d('0x19')]=_0x59550e;if(_0x8d5f6e['query']['includeAll']){_0x3622a0[_0x2d6d('0x3b')]=[{'all':!![]}];}return db[_0x2d6d('0x27')][_0x2d6d('0x3c')](_0x3622a0);})['then'](function(_0x1f4d1b){_0x3c5c13[_0x2d6d('0x3d')]=_0x1f4d1b;return _0x3c5c13;})[_0x2d6d('0x21')](respondWithFilteredResult(_0x46e159,_0x3622a0))[_0x2d6d('0x3e')](handleError(_0x46e159,null));};exports[_0x2d6d('0x3f')]=function(_0x2cf7be,_0x2e7c7c){var _0x18c50b={'raw':!![],'where':{'id':_0x2cf7be[_0x2d6d('0x40')]['id']}},_0x489c36={};_0x489c36[_0x2d6d('0x2a')]=_[_0x2d6d('0x2c')](db['SquareDetailsReport']['rawAttributes']);_0x489c36[_0x2d6d('0x2b')]=_[_0x2d6d('0x2c')](_0x2cf7be[_0x2d6d('0x2b')]);_0x489c36[_0x2d6d('0x2d')]=_[_0x2d6d('0x2e')](_0x489c36['model'],_0x489c36['query']);_0x18c50b[_0x2d6d('0x2f')]=_[_0x2d6d('0x2e')](_0x489c36[_0x2d6d('0x2a')],qs[_0x2d6d('0x30')](_0x2cf7be[_0x2d6d('0x2b')]['fields']));_0x18c50b[_0x2d6d('0x2f')]=_0x18c50b[_0x2d6d('0x2f')]['length']?_0x18c50b['attributes']:_0x489c36[_0x2d6d('0x2a')];if(_0x2cf7be['query']['includeAll']){_0x18c50b[_0x2d6d('0x3b')]=[{'all':!![]}];}_0x18c50b=_[_0x2d6d('0x37')]({},_0x18c50b,_0x2cf7be[_0x2d6d('0x3a')]);return db[_0x2d6d('0x27')][_0x2d6d('0x41')](_0x18c50b)[_0x2d6d('0x21')](handleEntityNotFound(_0x2e7c7c,null))['then'](respondWithResult(_0x2e7c7c,null))[_0x2d6d('0x3e')](handleError(_0x2e7c7c,null));};exports[_0x2d6d('0x42')]=function(_0x502fe3,_0x23ba8a){return db['SquareDetailsReport'][_0x2d6d('0x42')](_0x502fe3[_0x2d6d('0x43')],{})[_0x2d6d('0x21')](respondWithResult(_0x23ba8a,0xc9))[_0x2d6d('0x3e')](handleError(_0x23ba8a,null));};exports[_0x2d6d('0x1f')]=function(_0x23ae60,_0x4c21df){if(_0x23ae60[_0x2d6d('0x43')]['id']){delete _0x23ae60[_0x2d6d('0x43')]['id'];}return db[_0x2d6d('0x27')][_0x2d6d('0x41')]({'where':{'id':_0x23ae60[_0x2d6d('0x40')]['id']}})[_0x2d6d('0x21')](handleEntityNotFound(_0x4c21df,null))['then'](saveUpdates(_0x23ae60['body'],null))[_0x2d6d('0x21')](respondWithResult(_0x4c21df,null))[_0x2d6d('0x3e')](handleError(_0x4c21df,null));};exports[_0x2d6d('0x20')]=function(_0x244caf,_0x2b58a9){return db[_0x2d6d('0x27')][_0x2d6d('0x41')]({'where':{'id':_0x244caf[_0x2d6d('0x40')]['id']}})[_0x2d6d('0x21')](handleEntityNotFound(_0x2b58a9,null))[_0x2d6d('0x21')](removeEntity(_0x2b58a9,null))[_0x2d6d('0x3e')](handleError(_0x2b58a9,null));};exports[_0x2d6d('0x44')]=function(_0x1ddec0,_0x55438e){return db[_0x2d6d('0x27')][_0x2d6d('0x44')]()[_0x2d6d('0x21')](respondWithResult(_0x55438e,null))[_0x2d6d('0x3e')](handleError(_0x55438e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 3339b83..db0db3a 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 _0x8e4c=['define','SquareDetailsReport','report_square_details','lodash','moment','bluebird','request-promise','path','rimraf','./squareReportDetail.attributes'];(function(_0x73872a,_0x4a073e){var _0x1a8ddf=function(_0x2a9dd2){while(--_0x2a9dd2){_0x73872a['push'](_0x73872a['shift']());}};_0x1a8ddf(++_0x4a073e);}(_0x8e4c,0x17f));var _0xc8e4=function(_0x27a1e0,_0x3ff2cb){_0x27a1e0=_0x27a1e0-0x0;var _0x1ca624=_0x8e4c[_0x27a1e0];return _0x1ca624;};'use strict';var _=require(_0xc8e4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc8e4('0x1'));var BPromise=require(_0xc8e4('0x2'));var rp=require(_0xc8e4('0x3'));var fs=require('fs');var path=require(_0xc8e4('0x4'));var rimraf=require(_0xc8e4('0x5'));var config=require('../../config/environment');var attributes=require(_0xc8e4('0x6'));module['exports']=function(_0x2634c4,_0x30daab){return _0x2634c4[_0xc8e4('0x7')](_0xc8e4('0x8'),attributes,{'tableName':_0xc8e4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb67b=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x6c6dd2,_0x4ff66d){var _0x4f6595=function(_0x57ba9e){while(--_0x57ba9e){_0x6c6dd2['push'](_0x6c6dd2['shift']());}};_0x4f6595(++_0x4ff66d);}(_0xb67b,0x91));var _0xbb67=function(_0x4e707e,_0x208eb5){_0x4e707e=_0x4e707e-0x0;var _0x3d346e=_0xb67b[_0x4e707e];return _0x3d346e;};'use strict';var _=require(_0xbb67('0x0'));var util=require(_0xbb67('0x1'));var logger=require(_0xbb67('0x2'))(_0xbb67('0x3'));var moment=require(_0xbb67('0x4'));var BPromise=require(_0xbb67('0x5'));var rp=require(_0xbb67('0x6'));var fs=require('fs');var path=require(_0xbb67('0x7'));var rimraf=require(_0xbb67('0x8'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xbb67('0x9')]=function(_0xd6326f,_0xe5a41b){return _0xd6326f[_0xbb67('0xa')](_0xbb67('0xb'),attributes,{'tableName':_0xbb67('0xc'),'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 e79f756..3903302 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 _0xc88e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','stringify','lodash'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0xc88e,0x14f));var _0xec88=function(_0x4a3f5e,_0x2ed7d7){_0x4a3f5e=_0x4a3f5e-0x0;var _0x4f448f=_0xc88e[_0x4a3f5e];return _0x4f448f;};'use strict';var _=require(_0xec88('0x0'));var util=require(_0xec88('0x1'));var moment=require(_0xec88('0x2'));var BPromise=require(_0xec88('0x3'));var rs=require(_0xec88('0x4'));var fs=require('fs');var Redis=require(_0xec88('0x5'));var db=require(_0xec88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xec88('0x7'))(_0xec88('0x8'));var config=require('../../config/environment');var jayson=require(_0xec88('0x9'));var client=jayson['client'][_0xec88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cdf23,_0x554576,_0x2caf51){return new BPromise(function(_0x13cbc1,_0x54901f){return client[_0xec88('0xb')](_0x4cdf23,_0x2caf51)[_0xec88('0xc')](function(_0x2608d7){logger['info'](_0xec88('0xd'),_0x554576,_0xec88('0xe'));logger[_0xec88('0xf')](_0xec88('0x10'),_0x554576,_0xec88('0xe'),JSON['stringify'](_0x2608d7));if(_0x2608d7[_0xec88('0x11')]){if(_0x2608d7[_0xec88('0x11')][_0xec88('0x12')]===0x1f4){logger['error'](_0xec88('0xd'),_0x554576,_0x2608d7[_0xec88('0x11')][_0xec88('0x13')]);return _0x54901f(_0x2608d7[_0xec88('0x11')][_0xec88('0x13')]);}logger['error'](_0xec88('0xd'),_0x554576,_0x2608d7[_0xec88('0x11')][_0xec88('0x13')]);return _0x13cbc1(_0x2608d7[_0xec88('0x11')][_0xec88('0x13')]);}else{logger[_0xec88('0x14')](_0xec88('0xd'),_0x554576,_0xec88('0xe'));_0x13cbc1(_0x2608d7['result'][_0xec88('0x13')]);}})[_0xec88('0x15')](function(_0xdc1d9b){logger[_0xec88('0x11')](_0xec88('0xd'),_0x554576,_0xdc1d9b);_0x54901f(_0xdc1d9b);});});}exports[_0xec88('0x16')]=function(_0x420e45){var _0x2e875e=this;return new Promise(function(_0x2481d8,_0x22091a){return db[_0xec88('0x17')][_0xec88('0x18')](_0x420e45[_0xec88('0x19')],{'raw':_0x420e45[_0xec88('0x1a')]?_0x420e45[_0xec88('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xec88('0xc')](function(_0x1010a1){logger[_0xec88('0x14')](_0xec88('0x16'),_0x420e45);logger['debug'](_0xec88('0x16'),_0x420e45,JSON[_0xec88('0x1b')](_0x1010a1));_0x2481d8(_0x1010a1);})[_0xec88('0x15')](function(_0x1606b0){logger['error'](_0xec88('0x16'),_0x1606b0[_0xec88('0x13')],_0x420e45);_0x22091a(_0x2e875e['error'](0x1f4,_0x1606b0[_0xec88('0x13')]));});});}; \ No newline at end of file +var _0x41b6=['rpc','../../config/environment','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x365143,_0x46fd86){var _0x45bb49=function(_0x20bb4b){while(--_0x20bb4b){_0x365143['push'](_0x365143['shift']());}};_0x45bb49(++_0x46fd86);}(_0x41b6,0x110));var _0x641b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41b6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x641b('0x0'));var util=require(_0x641b('0x1'));var moment=require(_0x641b('0x2'));var BPromise=require(_0x641b('0x3'));var rs=require(_0x641b('0x4'));var fs=require('fs');var Redis=require(_0x641b('0x5'));var db=require(_0x641b('0x6'))['db'];var utils=require(_0x641b('0x7'));var logger=require('../../config/logger')(_0x641b('0x8'));var config=require(_0x641b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x641b('0xa')][_0x641b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1dd8fc,_0x1d52b3,_0x4c637e){return new BPromise(function(_0x47bb10,_0x2ecb2f){return client[_0x641b('0xc')](_0x1dd8fc,_0x4c637e)[_0x641b('0xd')](function(_0x5e601f){logger[_0x641b('0xe')](_0x641b('0xf'),_0x1d52b3,_0x641b('0x10'));logger[_0x641b('0x11')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x1d52b3,_0x641b('0x10'),JSON[_0x641b('0x12')](_0x5e601f));if(_0x5e601f['error']){if(_0x5e601f[_0x641b('0x13')]['code']===0x1f4){logger[_0x641b('0x13')](_0x641b('0xf'),_0x1d52b3,_0x5e601f[_0x641b('0x13')]['message']);return _0x2ecb2f(_0x5e601f[_0x641b('0x13')][_0x641b('0x14')]);}logger[_0x641b('0x13')](_0x641b('0xf'),_0x1d52b3,_0x5e601f[_0x641b('0x13')][_0x641b('0x14')]);return _0x47bb10(_0x5e601f[_0x641b('0x13')][_0x641b('0x14')]);}else{logger[_0x641b('0xe')](_0x641b('0xf'),_0x1d52b3,_0x641b('0x10'));_0x47bb10(_0x5e601f[_0x641b('0x15')]['message']);}})[_0x641b('0x16')](function(_0x27b216){logger[_0x641b('0x13')](_0x641b('0xf'),_0x1d52b3,_0x27b216);_0x2ecb2f(_0x27b216);});});}exports[_0x641b('0x17')]=function(_0x4f6cd2){var _0x341fbf=this;return new Promise(function(_0x657c13,_0x53d3a2){return db['SquareDetailsReport'][_0x641b('0x18')](_0x4f6cd2[_0x641b('0x19')],{'raw':_0x4f6cd2[_0x641b('0x1a')]?_0x4f6cd2[_0x641b('0x1a')][_0x641b('0x1b')]===undefined?!![]:![]:!![]})[_0x641b('0xd')](function(_0x20d1f7){logger[_0x641b('0xe')]('CreateSquareDetailsReport',_0x4f6cd2);logger[_0x641b('0x11')]('CreateSquareDetailsReport',_0x4f6cd2,JSON[_0x641b('0x12')](_0x20d1f7));_0x657c13(_0x20d1f7);})[_0x641b('0x16')](function(_0x106776){logger['error']('CreateSquareDetailsReport',_0x106776['message'],_0x4f6cd2);_0x53d3a2(_0x341fbf['error'](0x1f4,_0x106776[_0x641b('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 6e11a14..5ebae5c 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 _0x708d=['exports','express','Router','../../components/auth/service','isAuthenticated','index','get','/process/:pid/kill','killProcess'];(function(_0x21d31d,_0x387b5e){var _0x2c5682=function(_0x10ca2f){while(--_0x10ca2f){_0x21d31d['push'](_0x21d31d['shift']());}};_0x2c5682(++_0x387b5e);}(_0x708d,0x145));var _0xd708=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0x708d[_0x28578d];return _0x524826;};'use strict';var express=require(_0xd708('0x0'));var router=express[_0xd708('0x1')]();var auth=require(_0xd708('0x2'));var controller=require('./system.controller');router['get']('/',auth[_0xd708('0x3')](),controller[_0xd708('0x4')]);router[_0xd708('0x5')](_0xd708('0x6'),auth[_0xd708('0x3')](),controller[_0xd708('0x7')]);module[_0xd708('0x8')]=router; \ No newline at end of file +var _0xdb2e=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x519d90,_0x4abb16){var _0x16a830=function(_0x20a442){while(--_0x20a442){_0x519d90['push'](_0x519d90['shift']());}};_0x16a830(++_0x4abb16);}(_0xdb2e,0x14e));var _0xedb2=function(_0x149cf0,_0x55c9a1){_0x149cf0=_0x149cf0-0x0;var _0x350d0d=_0xdb2e[_0x149cf0];return _0x350d0d;};'use strict';var express=require(_0xedb2('0x0'));var router=express[_0xedb2('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xedb2('0x2'));router[_0xedb2('0x3')]('/',auth[_0xedb2('0x4')](),controller['index']);router[_0xedb2('0x3')](_0xedb2('0x5'),auth[_0xedb2('0x4')](),controller[_0xedb2('0x6')]);module[_0xedb2('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 b8110a6..96b62dc 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 _0xfed1=['then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','../../config/logger','api','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData'];(function(_0x522b99,_0x483967){var _0x3533ff=function(_0x4844c6){while(--_0x4844c6){_0x522b99['push'](_0x522b99['shift']());}};_0x3533ff(++_0x483967);}(_0xfed1,0x1ae));var _0x1fed=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfed1[_0x40a045];return _0x1a687c;};'use strict';var info=require('systeminformation');var exec=require(_0x1fed('0x0'))['exec'];var logger=require(_0x1fed('0x1'))(_0x1fed('0x2'));var util=require('util');var BPromise=require(_0x1fed('0x3'));var _=require('lodash');function handleError(_0x56a2b3,_0x313b07,_0xbbcb9c){_0x313b07=_0x313b07||0x1f4;return function(_0x238179){logger[_0x1fed('0x4')](_0x1fed('0x5'),_0xbbcb9c,_0x313b07,util[_0x1fed('0x6')](_0x238179,{'showHidden':![],'depth':null}));delete _0x238179[_0x1fed('0x7')];_0x56a2b3[_0x1fed('0x8')](_0x313b07)[_0x1fed('0x9')](_0x238179);};}exports[_0x1fed('0xa')]=function(_0x5b04f1,_0x52d3d0){return info[_0x1fed('0xb')]()[_0x1fed('0xc')](function(_0x5a4be4){return _0x52d3d0['status'](0xc8)[_0x1fed('0xd')](_0x5a4be4);})[_0x1fed('0xe')](function(_0x6e2320){return _0x52d3d0['status'](0x1f4)[_0x1fed('0xd')](_0x6e2320);});};exports[_0x1fed('0xf')]=function(_0xd04a09,_0x27d944){var _0x5135f2=[_0x1fed('0x10')];return new BPromise(function(_0x2a3a1d,_0x4719e8){return exec(util[_0x1fed('0x11')](_0x1fed('0x12'),_0xd04a09[_0x1fed('0x13')][_0x1fed('0x14')]),function(_0x56f64d,_0x283849,_0x45a2d7){if(_0x56f64d){return _0x4719e8(_0x56f64d);}return _0x2a3a1d(_0x283849);});})[_0x1fed('0xc')](function(_0x5947e5){var _0x31bbd6=![];var _0x652e12=_0x5947e5[_0x1fed('0x15')](/\n/);for(var _0x104713=0x0,_0x13ceb0=_0x5135f2[_0x1fed('0x16')];_0x104713<_0x13ceb0,_0x31bbd6===![];_0x104713+=0x1){if(_0x5947e5[_0x1fed('0x17')](_0x5135f2[_0x104713])>=0x0){_0x31bbd6=!![];}}if(!_0x31bbd6){throw new Error(util[_0x1fed('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0xd04a09[_0x1fed('0x13')]['pid']));}process[_0x1fed('0x18')](_0xd04a09[_0x1fed('0x13')]['pid'],'SIGINT');return _0x27d944[_0x1fed('0x8')](0xc8)['json']({'message':util[_0x1fed('0x11')](_0x1fed('0x19'),_0xd04a09[_0x1fed('0x13')]['pid'])});})[_0x1fed('0xe')](handleError(_0x27d944,null,_0x1fed('0xf')));}; \ No newline at end of file +var _0x96dd=['split','format','Process\x20with\x20pid\x20%s\x20not\x20found!','params','pid','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','index','status','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','then'];(function(_0x39ce57,_0x2d7808){var _0x387775=function(_0x10c5c5){while(--_0x10c5c5){_0x39ce57['push'](_0x39ce57['shift']());}};_0x387775(++_0x2d7808);}(_0x96dd,0x73));var _0xd96d=function(_0x1fdd69,_0x2ee434){_0x1fdd69=_0x1fdd69-0x0;var _0x46db20=_0x96dd[_0x1fdd69];return _0x46db20;};'use strict';var info=require(_0xd96d('0x0'));var exec=require(_0xd96d('0x1'))[_0xd96d('0x2')];var logger=require(_0xd96d('0x3'))(_0xd96d('0x4'));var util=require(_0xd96d('0x5'));var BPromise=require(_0xd96d('0x6'));var _=require(_0xd96d('0x7'));function handleError(_0x1a5a8f,_0x359252,_0xd5cb20){_0x359252=_0x359252||0x1f4;return function(_0x631e54){logger[_0xd96d('0x8')](_0xd96d('0x9'),_0xd5cb20,_0x359252,util[_0xd96d('0xa')](_0x631e54,{'showHidden':![],'depth':null}));delete _0x631e54[_0xd96d('0xb')];_0x1a5a8f['status'](_0x359252)['send'](_0x631e54);};}exports[_0xd96d('0xc')]=function(_0x541ad0,_0x563e13){return info['getAllData']()['then'](function(_0x4395b2){return _0x563e13[_0xd96d('0xd')](0xc8)[_0xd96d('0xe')](_0x4395b2);})[_0xd96d('0xf')](function(_0xd380ea){return _0x563e13[_0xd96d('0xd')](0x1f4)[_0xd96d('0xe')](_0xd380ea);});};exports[_0xd96d('0x10')]=function(_0x3160c1,_0x1e2ab0){var _0x54e819=[_0xd96d('0x11')];return new BPromise(function(_0x49e5f8,_0x442685){return exec(util['format'](_0xd96d('0x12'),_0x3160c1['params']['pid']),function(_0xed0c54,_0x434c33,_0x5384cb){if(_0xed0c54){return _0x442685(_0xed0c54);}return _0x49e5f8(_0x434c33);});})[_0xd96d('0x13')](function(_0x402a9c){var _0x5e21e6=![];var _0x1df6b5=_0x402a9c[_0xd96d('0x14')](/\n/);for(var _0x2fecdc=0x0,_0x4e086=_0x54e819['length'];_0x2fecdc<_0x4e086,_0x5e21e6===![];_0x2fecdc+=0x1){if(_0x402a9c['indexOf'](_0x54e819[_0x2fecdc])>=0x0){_0x5e21e6=!![];}}if(!_0x5e21e6){throw new Error(util[_0xd96d('0x15')](_0xd96d('0x16'),_0x3160c1[_0xd96d('0x17')][_0xd96d('0x18')]));}process[_0xd96d('0x19')](_0x3160c1[_0xd96d('0x17')][_0xd96d('0x18')],'SIGINT');return _0x1e2ab0[_0xd96d('0xd')](0xc8)[_0xd96d('0xe')]({'message':util['format'](_0xd96d('0x1a'),_0x3160c1[_0xd96d('0x17')][_0xd96d('0x18')])});})[_0xd96d('0xf')](handleError(_0x1e2ab0,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index d56b6fb..98fb246 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 _0xf3cd=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','delete','destroy','exports','multer'];(function(_0x1195d6,_0x273e49){var _0x2c0787=function(_0x4953f0){while(--_0x4953f0){_0x1195d6['push'](_0x1195d6['shift']());}};_0x2c0787(++_0x273e49);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4b095c,_0x266c55){_0x4b095c=_0x4b095c-0x0;var _0x4495e2=_0xf3cd[_0x4b095c];return _0x4495e2;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdf3c('0x6'));var config=require(_0xdf3c('0x7'));var controller=require(_0xdf3c('0x8'));router['get']('/',auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xa')]);router[_0xdf3c('0xb')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xd')]);router['post']('/',auth[_0xdf3c('0x9')](),controller['create']);router['put'](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller['update']);router[_0xdf3c('0xe')](_0xdf3c('0xc'),auth[_0xdf3c('0x9')](),controller[_0xdf3c('0xf')]);module[_0xdf3c('0x10')]=router; \ No newline at end of file +var _0x6f0d=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0x3cf445,_0x2de8d2){var _0x3ddef5=function(_0x3ec942){while(--_0x3ec942){_0x3cf445['push'](_0x3cf445['shift']());}};_0x3ddef5(++_0x2de8d2);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x32bbf2,_0x73f155){_0x32bbf2=_0x32bbf2-0x0;var _0x9277db=_0x6f0d[_0x32bbf2];return _0x9277db;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var auth=require(_0xd6f0('0x4'));var interaction=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var controller=require(_0xd6f0('0x7'));router[_0xd6f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f0('0x9')]);router['get'](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd6f0('0xe')](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xf')]);router[_0xd6f0('0x10')]('/:id',auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x11')]);module[_0xd6f0('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 53048c3..21e9bea 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 _0xda3f=['exports','STRING'];(function(_0x31ddbb,_0x23b827){var _0x502c6f=function(_0x3ec78f){while(--_0x3ec78f){_0x31ddbb['push'](_0x31ddbb['shift']());}};_0x502c6f(++_0x23b827);}(_0xda3f,0xec));var _0xfda3=function(_0x4e058f,_0x2bd1a1){_0x4e058f=_0x4e058f-0x0;var _0x247a08=_0xda3f[_0x4e058f];return _0x247a08;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'name':{'type':Sequelize[_0xfda3('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xfda3('0x1')]}}; \ No newline at end of file +var _0xdd4f=['sequelize','STRING','#0091EA'];(function(_0x5745e6,_0x5e54fc){var _0x199886=function(_0x311dfc){while(--_0x311dfc){_0x5745e6['push'](_0x5745e6['shift']());}};_0x199886(++_0x5e54fc);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0xba6b11,_0x419838){_0xba6b11=_0xba6b11-0x0;var _0x42b69d=_0xdd4f[_0xba6b11];return _0x42b69d;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':_0xfdd4('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 38a258f..05ba1b5 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 _0x0fd5=['model','fields','length','nolimit','order','sort','where','pick','merge','filter','include','catch','show','keys','intersection','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Tags','stack','name','send','map','Tag','rawAttributes','type','key','query','filters','attributes'];(function(_0x3ccebb,_0x80f121){var _0x2c5c99=function(_0x315766){while(--_0x315766){_0x3ccebb['push'](_0x3ccebb['shift']());}};_0x2c5c99(++_0x80f121);}(_0x0fd5,0x1a9));var _0x50fd=function(_0x4e0fd6,_0x16bc28){_0x4e0fd6=_0x4e0fd6-0x0;var _0x50a6ef=_0x0fd5[_0x4e0fd6];return _0x50a6ef;};'use strict';var pdf=require(_0x50fd('0x0'));var emlformat=require(_0x50fd('0x1'));var rimraf=require(_0x50fd('0x2'));var zipdir=require(_0x50fd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x50fd('0x4'));var Mustache=require('mustache');var util=require(_0x50fd('0x5'));var path=require(_0x50fd('0x6'));var sox=require(_0x50fd('0x7'));var csv=require(_0x50fd('0x8'));var ejs=require(_0x50fd('0x9'));var fs=require('fs');var _=require(_0x50fd('0xa'));var squel=require(_0x50fd('0xb'));var crypto=require('crypto');var jsforce=require(_0x50fd('0xc'));var deskjs=require(_0x50fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x50fd('0xe'));var Papa=require(_0x50fd('0xf'));var Redis=require(_0x50fd('0x10'));var authService=require(_0x50fd('0x11'));var qs=require(_0x50fd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x50fd('0x13'));var utils=require(_0x50fd('0x14'));var config=require(_0x50fd('0x15'));var db=require(_0x50fd('0x16'))['db'];function respondWithStatusCode(_0x20cae5,_0x3da142){_0x3da142=_0x3da142||0xcc;return function(_0x3d5f73){if(_0x3d5f73){return _0x20cae5[_0x50fd('0x17')](_0x3da142);}return _0x20cae5[_0x50fd('0x18')](_0x3da142)['end']();};}function respondWithResult(_0x496e75,_0x2f2f17){_0x2f2f17=_0x2f2f17||0xc8;return function(_0x45dc2d){if(_0x45dc2d){return _0x496e75[_0x50fd('0x18')](_0x2f2f17)['json'](_0x45dc2d);}};}function respondWithFilteredResult(_0x48caff,_0x1cd999){return function(_0x31562b){if(_0x31562b){var _0x594b31=_0x31562b[_0x50fd('0x19')],_0x9417ce=_0x1cd999[_0x50fd('0x1a')],_0x1a2f4e=_0x1cd999[_0x50fd('0x1a')]+_0x1cd999[_0x50fd('0x1b')],_0x30f9f9;if(_0x1a2f4e>=_0x594b31){_0x1a2f4e=_0x594b31;_0x30f9f9=0xc8;}else{_0x30f9f9=0xce;}_0x48caff[_0x50fd('0x18')](_0x30f9f9);return _0x48caff['set'](_0x50fd('0x1c'),_0x9417ce+'-'+_0x1a2f4e+'/'+_0x594b31)[_0x50fd('0x1d')](_0x31562b);}return null;};}function patchUpdates(_0x373d0a){return function(_0x36b919){try{jsonpatch[_0x50fd('0x1e')](_0x36b919,_0x373d0a,!![]);}catch(_0x4500ce){return BPromise[_0x50fd('0x1f')](_0x4500ce);}return _0x36b919[_0x50fd('0x20')]();};}function saveUpdates(_0x161b24,_0x488100){return function(_0x10a3eb){if(_0x10a3eb){return _0x10a3eb[_0x50fd('0x21')](_0x161b24)[_0x50fd('0x22')](function(_0x139524){return _0x139524;});}return null;};}function removeEntity(_0x505067,_0x1e650b){return function(_0x48826a){if(_0x48826a){return _0x48826a[_0x50fd('0x23')]()[_0x50fd('0x22')](function(){var _0x468246=_0x48826a[_0x50fd('0x24')]({'plain':!![]});var _0x1846ec=_0x50fd('0x25');return db['UserProfileResource'][_0x50fd('0x23')]({'where':{'type':_0x1846ec,'resourceId':_0x468246['id']}})[_0x50fd('0x22')](function(){return _0x48826a;});})[_0x50fd('0x22')](function(){_0x505067[_0x50fd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501b20,_0x20e230){return function(_0x2c71fc){if(!_0x2c71fc){_0x501b20['sendStatus'](0x194);}return _0x2c71fc;};}function handleError(_0x205baa,_0x3b5646){_0x3b5646=_0x3b5646||0x1f4;return function(_0x512139){logger['error'](_0x512139[_0x50fd('0x26')]);if(_0x512139[_0x50fd('0x27')]){delete _0x512139[_0x50fd('0x27')];}_0x205baa['status'](_0x3b5646)[_0x50fd('0x28')](_0x512139);};}exports['index']=function(_0x16c76f,_0xe455b2){var _0x59855c={},_0x386dfe={},_0x5df0bb={'count':0x0,'rows':[]};var _0x10e0cc=_[_0x50fd('0x29')](db[_0x50fd('0x2a')][_0x50fd('0x2b')],function(_0x515ae5){return{'name':_0x515ae5['fieldName'],'type':_0x515ae5[_0x50fd('0x2c')][_0x50fd('0x2d')]};});_0x386dfe['model']=_['map'](_0x10e0cc,_0x50fd('0x27'));_0x386dfe['query']=_['keys'](_0x16c76f[_0x50fd('0x2e')]);_0x386dfe[_0x50fd('0x2f')]=_['intersection'](_0x386dfe['model'],_0x386dfe['query']);_0x59855c[_0x50fd('0x30')]=_['intersection'](_0x386dfe[_0x50fd('0x31')],qs[_0x50fd('0x32')](_0x16c76f['query']['fields']));_0x59855c['attributes']=_0x59855c[_0x50fd('0x30')][_0x50fd('0x33')]?_0x59855c[_0x50fd('0x30')]:_0x386dfe['model'];if(!_0x16c76f[_0x50fd('0x2e')]['hasOwnProperty'](_0x50fd('0x34'))){_0x59855c[_0x50fd('0x1b')]=qs[_0x50fd('0x1b')](_0x16c76f[_0x50fd('0x2e')]['limit']);_0x59855c[_0x50fd('0x1a')]=qs['offset'](_0x16c76f[_0x50fd('0x2e')][_0x50fd('0x1a')]);}_0x59855c[_0x50fd('0x35')]=qs[_0x50fd('0x36')](_0x16c76f['query'][_0x50fd('0x36')]);_0x59855c[_0x50fd('0x37')]=qs[_0x50fd('0x2f')](_[_0x50fd('0x38')](_0x16c76f['query'],_0x386dfe[_0x50fd('0x2f')]),_0x10e0cc);if(_0x16c76f[_0x50fd('0x2e')]['filter']){_0x59855c[_0x50fd('0x37')]=_[_0x50fd('0x39')](_0x59855c[_0x50fd('0x37')],{'$or':_[_0x50fd('0x29')](_0x10e0cc,function(_0x52d4d8){if(_0x52d4d8[_0x50fd('0x2c')]!=='VIRTUAL'){var _0x596b32={};_0x596b32[_0x52d4d8['name']]={'$like':'%'+_0x16c76f[_0x50fd('0x2e')][_0x50fd('0x3a')]+'%'};return _0x596b32;}})});}_0x59855c=_['merge']({},_0x59855c,_0x16c76f['options']);var _0x4d8402={'where':_0x59855c['where']};return db[_0x50fd('0x2a')][_0x50fd('0x19')](_0x4d8402)['then'](function(_0x569b8f){_0x5df0bb[_0x50fd('0x19')]=_0x569b8f;if(_0x16c76f['query']['includeAll']){_0x59855c[_0x50fd('0x3b')]=[{'all':!![]}];}return db[_0x50fd('0x2a')]['findAll'](_0x59855c);})[_0x50fd('0x22')](function(_0x988159){_0x5df0bb['rows']=_0x988159;return _0x5df0bb;})['then'](respondWithFilteredResult(_0xe455b2,_0x59855c))[_0x50fd('0x3c')](handleError(_0xe455b2,null));};exports[_0x50fd('0x3d')]=function(_0x58d088,_0x47d466){var _0x2ad3fc={'raw':!![],'where':{'id':_0x58d088['params']['id']}},_0x4feba7={};_0x4feba7[_0x50fd('0x31')]=_[_0x50fd('0x3e')](db[_0x50fd('0x2a')][_0x50fd('0x2b')]);_0x4feba7['query']=_[_0x50fd('0x3e')](_0x58d088[_0x50fd('0x2e')]);_0x4feba7[_0x50fd('0x2f')]=_['intersection'](_0x4feba7[_0x50fd('0x31')],_0x4feba7['query']);_0x2ad3fc[_0x50fd('0x30')]=_[_0x50fd('0x3f')](_0x4feba7[_0x50fd('0x31')],qs[_0x50fd('0x32')](_0x58d088[_0x50fd('0x2e')][_0x50fd('0x32')]));_0x2ad3fc[_0x50fd('0x30')]=_0x2ad3fc[_0x50fd('0x30')][_0x50fd('0x33')]?_0x2ad3fc[_0x50fd('0x30')]:_0x4feba7[_0x50fd('0x31')];if(_0x58d088['query'][_0x50fd('0x40')]){_0x2ad3fc[_0x50fd('0x3b')]=[{'all':!![]}];}_0x2ad3fc=_[_0x50fd('0x39')]({},_0x2ad3fc,_0x58d088[_0x50fd('0x41')]);return db[_0x50fd('0x2a')]['find'](_0x2ad3fc)['then'](handleEntityNotFound(_0x47d466,null))[_0x50fd('0x22')](respondWithResult(_0x47d466,null))[_0x50fd('0x3c')](handleError(_0x47d466,null));};exports[_0x50fd('0x42')]=function(_0x325966,_0x278f9a){return db[_0x50fd('0x2a')][_0x50fd('0x42')](_0x325966[_0x50fd('0x43')],{})['then'](function(_0x534190){var _0x1334a9=_0x325966[_0x50fd('0x44')][_0x50fd('0x24')]({'plain':!![]});if(!_0x1334a9)throw new Error(_0x50fd('0x45'));if(_0x1334a9[_0x50fd('0x46')]===_0x50fd('0x44')){var _0x5ca4f8=_0x534190[_0x50fd('0x24')]({'plain':!![]});var _0x48def3=_0x50fd('0x25');return db[_0x50fd('0x47')][_0x50fd('0x48')]({'where':{'name':_0x48def3,'userProfileId':_0x1334a9[_0x50fd('0x49')]},'raw':!![]})[_0x50fd('0x22')](function(_0xd8104b){if(_0xd8104b&&_0xd8104b[_0x50fd('0x4a')]===0x0){return db[_0x50fd('0x4b')][_0x50fd('0x42')]({'name':_0x5ca4f8[_0x50fd('0x27')],'resourceId':_0x5ca4f8['id'],'type':_0xd8104b[_0x50fd('0x27')],'sectionId':_0xd8104b['id']},{})[_0x50fd('0x22')](function(){return _0x534190;});}else{return _0x534190;}})[_0x50fd('0x3c')](function(_0x3101c3){logger[_0x50fd('0x4c')](_0x50fd('0x4d'),_0x3101c3);throw _0x3101c3;});}return _0x534190;})[_0x50fd('0x22')](respondWithResult(_0x278f9a,0xc9))[_0x50fd('0x3c')](handleError(_0x278f9a,null));};exports['update']=function(_0x181a4e,_0x2e0e0d){if(_0x181a4e[_0x50fd('0x43')]['id']){delete _0x181a4e['body']['id'];}return db[_0x50fd('0x2a')][_0x50fd('0x48')]({'where':{'id':_0x181a4e['params']['id']}})['then'](handleEntityNotFound(_0x2e0e0d,null))[_0x50fd('0x22')](saveUpdates(_0x181a4e[_0x50fd('0x43')],null))[_0x50fd('0x22')](respondWithResult(_0x2e0e0d,null))[_0x50fd('0x3c')](handleError(_0x2e0e0d,null));};exports[_0x50fd('0x23')]=function(_0x3d9100,_0x264989){return db[_0x50fd('0x2a')][_0x50fd('0x48')]({'where':{'id':_0x3d9100[_0x50fd('0x4e')]['id']}})[_0x50fd('0x22')](handleEntityNotFound(_0x264989,null))[_0x50fd('0x22')](removeEntity(_0x264989,null))[_0x50fd('0x3c')](handleError(_0x264989,null));}; \ No newline at end of file +var _0xe2f3=['get','Tags','UserProfileResource','error','stack','name','send','map','Tag','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','Content-Range','json','apply','update','destroy','then'];(function(_0x3e5325,_0x55af33){var _0x5a1c63=function(_0x545694){while(--_0x545694){_0x3e5325['push'](_0x3e5325['shift']());}};_0x5a1c63(++_0x55af33);}(_0xe2f3,0x1c2));var _0x3e2f=function(_0x97d4b6,_0x1b8eab){_0x97d4b6=_0x97d4b6-0x0;var _0x364238=_0xe2f3[_0x97d4b6];return _0x364238;};'use strict';var pdf=require(_0x3e2f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3e2f('0x1'));var zipdir=require(_0x3e2f('0x2'));var jsonpatch=require(_0x3e2f('0x3'));var rp=require('request-promise');var moment=require(_0x3e2f('0x4'));var BPromise=require(_0x3e2f('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3e2f('0x6'));var sox=require(_0x3e2f('0x7'));var csv=require(_0x3e2f('0x8'));var ejs=require(_0x3e2f('0x9'));var fs=require('fs');var _=require(_0x3e2f('0xa'));var squel=require(_0x3e2f('0xb'));var crypto=require(_0x3e2f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3e2f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e2f('0xe'));var Papa=require(_0x3e2f('0xf'));var Redis=require(_0x3e2f('0x10'));var authService=require(_0x3e2f('0x11'));var qs=require(_0x3e2f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e2f('0x13'));var logger=require(_0x3e2f('0x14'))(_0x3e2f('0x15'));var utils=require(_0x3e2f('0x16'));var config=require(_0x3e2f('0x17'));var db=require(_0x3e2f('0x18'))['db'];function respondWithStatusCode(_0x252df3,_0x2eff51){_0x2eff51=_0x2eff51||0xcc;return function(_0x19b1ef){if(_0x19b1ef){return _0x252df3[_0x3e2f('0x19')](_0x2eff51);}return _0x252df3['status'](_0x2eff51)[_0x3e2f('0x1a')]();};}function respondWithResult(_0x261f9b,_0x27bfbd){_0x27bfbd=_0x27bfbd||0xc8;return function(_0x1b216b){if(_0x1b216b){return _0x261f9b[_0x3e2f('0x1b')](_0x27bfbd)['json'](_0x1b216b);}};}function respondWithFilteredResult(_0x3b34f0,_0x27e54f){return function(_0x4c68ea){if(_0x4c68ea){var _0x2a6cdd=_0x4c68ea[_0x3e2f('0x1c')],_0x5c544a=_0x27e54f[_0x3e2f('0x1d')],_0xdee0be=_0x27e54f[_0x3e2f('0x1d')]+_0x27e54f['limit'],_0x8ed5e5;if(_0xdee0be>=_0x2a6cdd){_0xdee0be=_0x2a6cdd;_0x8ed5e5=0xc8;}else{_0x8ed5e5=0xce;}_0x3b34f0[_0x3e2f('0x1b')](_0x8ed5e5);return _0x3b34f0['set'](_0x3e2f('0x1e'),_0x5c544a+'-'+_0xdee0be+'/'+_0x2a6cdd)[_0x3e2f('0x1f')](_0x4c68ea);}return null;};}function patchUpdates(_0x26fb3e){return function(_0x7b7a2){try{jsonpatch[_0x3e2f('0x20')](_0x7b7a2,_0x26fb3e,!![]);}catch(_0x398601){return BPromise['reject'](_0x398601);}return _0x7b7a2['save']();};}function saveUpdates(_0x3a5519,_0xc9eed8){return function(_0x42bf2f){if(_0x42bf2f){return _0x42bf2f[_0x3e2f('0x21')](_0x3a5519)['then'](function(_0x3edefd){return _0x3edefd;});}return null;};}function removeEntity(_0x2ffd8a,_0x1c4fc5){return function(_0x4a2cdf){if(_0x4a2cdf){return _0x4a2cdf[_0x3e2f('0x22')]()[_0x3e2f('0x23')](function(){var _0x2e6af9=_0x4a2cdf[_0x3e2f('0x24')]({'plain':!![]});var _0x38de4b=_0x3e2f('0x25');return db[_0x3e2f('0x26')][_0x3e2f('0x22')]({'where':{'type':_0x38de4b,'resourceId':_0x2e6af9['id']}})[_0x3e2f('0x23')](function(){return _0x4a2cdf;});})['then'](function(){_0x2ffd8a[_0x3e2f('0x1b')](0xcc)[_0x3e2f('0x1a')]();});}};}function handleEntityNotFound(_0x586fd6,_0x5d2139){return function(_0x1242bd){if(!_0x1242bd){_0x586fd6[_0x3e2f('0x19')](0x194);}return _0x1242bd;};}function handleError(_0x28ed0b,_0x19f924){_0x19f924=_0x19f924||0x1f4;return function(_0x395211){logger[_0x3e2f('0x27')](_0x395211[_0x3e2f('0x28')]);if(_0x395211['name']){delete _0x395211[_0x3e2f('0x29')];}_0x28ed0b[_0x3e2f('0x1b')](_0x19f924)[_0x3e2f('0x2a')](_0x395211);};}exports['index']=function(_0xf5f6c7,_0x652159){var _0x142db9={},_0x342554={},_0x704996={'count':0x0,'rows':[]};var _0x182e44=_[_0x3e2f('0x2b')](db[_0x3e2f('0x2c')]['rawAttributes'],function(_0x2ae8e2){return{'name':_0x2ae8e2['fieldName'],'type':_0x2ae8e2[_0x3e2f('0x2d')][_0x3e2f('0x2e')]};});_0x342554[_0x3e2f('0x2f')]=_[_0x3e2f('0x2b')](_0x182e44,_0x3e2f('0x29'));_0x342554[_0x3e2f('0x30')]=_[_0x3e2f('0x31')](_0xf5f6c7[_0x3e2f('0x30')]);_0x342554[_0x3e2f('0x32')]=_['intersection'](_0x342554[_0x3e2f('0x2f')],_0x342554[_0x3e2f('0x30')]);_0x142db9[_0x3e2f('0x33')]=_[_0x3e2f('0x34')](_0x342554['model'],qs[_0x3e2f('0x35')](_0xf5f6c7[_0x3e2f('0x30')][_0x3e2f('0x35')]));_0x142db9['attributes']=_0x142db9[_0x3e2f('0x33')]['length']?_0x142db9[_0x3e2f('0x33')]:_0x342554[_0x3e2f('0x2f')];if(!_0xf5f6c7[_0x3e2f('0x30')][_0x3e2f('0x36')](_0x3e2f('0x37'))){_0x142db9['limit']=qs[_0x3e2f('0x38')](_0xf5f6c7['query'][_0x3e2f('0x38')]);_0x142db9['offset']=qs[_0x3e2f('0x1d')](_0xf5f6c7[_0x3e2f('0x30')]['offset']);}_0x142db9[_0x3e2f('0x39')]=qs[_0x3e2f('0x3a')](_0xf5f6c7[_0x3e2f('0x30')][_0x3e2f('0x3a')]);_0x142db9[_0x3e2f('0x3b')]=qs[_0x3e2f('0x32')](_[_0x3e2f('0x3c')](_0xf5f6c7['query'],_0x342554[_0x3e2f('0x32')]),_0x182e44);if(_0xf5f6c7[_0x3e2f('0x30')][_0x3e2f('0x3d')]){_0x142db9[_0x3e2f('0x3b')]=_[_0x3e2f('0x3e')](_0x142db9[_0x3e2f('0x3b')],{'$or':_[_0x3e2f('0x2b')](_0x182e44,function(_0x52e2da){if(_0x52e2da[_0x3e2f('0x2d')]!==_0x3e2f('0x3f')){var _0x30a603={};_0x30a603[_0x52e2da['name']]={'$like':'%'+_0xf5f6c7['query']['filter']+'%'};return _0x30a603;}})});}_0x142db9=_[_0x3e2f('0x3e')]({},_0x142db9,_0xf5f6c7[_0x3e2f('0x40')]);var _0x58bd74={'where':_0x142db9['where']};return db['Tag'][_0x3e2f('0x1c')](_0x58bd74)['then'](function(_0x428964){_0x704996[_0x3e2f('0x1c')]=_0x428964;if(_0xf5f6c7[_0x3e2f('0x30')][_0x3e2f('0x41')]){_0x142db9[_0x3e2f('0x42')]=[{'all':!![]}];}return db[_0x3e2f('0x2c')][_0x3e2f('0x43')](_0x142db9);})[_0x3e2f('0x23')](function(_0x57850a){_0x704996[_0x3e2f('0x44')]=_0x57850a;return _0x704996;})[_0x3e2f('0x23')](respondWithFilteredResult(_0x652159,_0x142db9))['catch'](handleError(_0x652159,null));};exports[_0x3e2f('0x45')]=function(_0x12a23e,_0x1cb7e5){var _0x5e1452={'raw':!![],'where':{'id':_0x12a23e[_0x3e2f('0x46')]['id']}},_0xf9012b={};_0xf9012b['model']=_[_0x3e2f('0x31')](db[_0x3e2f('0x2c')]['rawAttributes']);_0xf9012b['query']=_[_0x3e2f('0x31')](_0x12a23e[_0x3e2f('0x30')]);_0xf9012b[_0x3e2f('0x32')]=_['intersection'](_0xf9012b[_0x3e2f('0x2f')],_0xf9012b[_0x3e2f('0x30')]);_0x5e1452[_0x3e2f('0x33')]=_[_0x3e2f('0x34')](_0xf9012b['model'],qs[_0x3e2f('0x35')](_0x12a23e[_0x3e2f('0x30')][_0x3e2f('0x35')]));_0x5e1452['attributes']=_0x5e1452[_0x3e2f('0x33')][_0x3e2f('0x47')]?_0x5e1452[_0x3e2f('0x33')]:_0xf9012b['model'];if(_0x12a23e[_0x3e2f('0x30')][_0x3e2f('0x41')]){_0x5e1452[_0x3e2f('0x42')]=[{'all':!![]}];}_0x5e1452=_[_0x3e2f('0x3e')]({},_0x5e1452,_0x12a23e[_0x3e2f('0x40')]);return db[_0x3e2f('0x2c')][_0x3e2f('0x48')](_0x5e1452)[_0x3e2f('0x23')](handleEntityNotFound(_0x1cb7e5,null))[_0x3e2f('0x23')](respondWithResult(_0x1cb7e5,null))[_0x3e2f('0x49')](handleError(_0x1cb7e5,null));};exports[_0x3e2f('0x4a')]=function(_0x2c3175,_0x42bdbc){return db[_0x3e2f('0x2c')]['create'](_0x2c3175['body'],{})['then'](function(_0x46f9a2){var _0x42c9f7=_0x2c3175[_0x3e2f('0x4b')][_0x3e2f('0x24')]({'plain':!![]});if(!_0x42c9f7)throw new Error(_0x3e2f('0x4c'));if(_0x42c9f7[_0x3e2f('0x4d')]==='user'){var _0x29aa97=_0x46f9a2[_0x3e2f('0x24')]({'plain':!![]});var _0x5e3cdf=_0x3e2f('0x25');return db[_0x3e2f('0x4e')][_0x3e2f('0x48')]({'where':{'name':_0x5e3cdf,'userProfileId':_0x42c9f7[_0x3e2f('0x4f')]},'raw':!![]})[_0x3e2f('0x23')](function(_0x57438f){if(_0x57438f&&_0x57438f['autoAssociation']===0x0){return db['UserProfileResource'][_0x3e2f('0x4a')]({'name':_0x29aa97[_0x3e2f('0x29')],'resourceId':_0x29aa97['id'],'type':_0x57438f[_0x3e2f('0x29')],'sectionId':_0x57438f['id']},{})[_0x3e2f('0x23')](function(){return _0x46f9a2;});}else{return _0x46f9a2;}})['catch'](function(_0x40f23b){logger[_0x3e2f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x40f23b);throw _0x40f23b;});}return _0x46f9a2;})[_0x3e2f('0x23')](respondWithResult(_0x42bdbc,0xc9))[_0x3e2f('0x49')](handleError(_0x42bdbc,null));};exports[_0x3e2f('0x21')]=function(_0x3af376,_0x219e4d){if(_0x3af376[_0x3e2f('0x50')]['id']){delete _0x3af376[_0x3e2f('0x50')]['id'];}return db[_0x3e2f('0x2c')]['find']({'where':{'id':_0x3af376[_0x3e2f('0x46')]['id']}})['then'](handleEntityNotFound(_0x219e4d,null))[_0x3e2f('0x23')](saveUpdates(_0x3af376[_0x3e2f('0x50')],null))[_0x3e2f('0x23')](respondWithResult(_0x219e4d,null))[_0x3e2f('0x49')](handleError(_0x219e4d,null));};exports[_0x3e2f('0x22')]=function(_0x815ca5,_0x1997ec){return db[_0x3e2f('0x2c')][_0x3e2f('0x48')]({'where':{'id':_0x815ca5[_0x3e2f('0x46')]['id']}})[_0x3e2f('0x23')](handleEntityNotFound(_0x1997ec,null))[_0x3e2f('0x23')](removeEntity(_0x1997ec,null))[_0x3e2f('0x49')](handleError(_0x1997ec,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 377eddc..68869ee 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 _0x4b17=['lodash','util','../../config/logger','bluebird','request-promise','./tag.attributes','define','tools_tags'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x4b17,0xf0));var _0x74b1=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x4b17[_0x1477ef];return _0x164acd;};'use strict';var _=require(_0x74b1('0x0'));var util=require(_0x74b1('0x1'));var logger=require(_0x74b1('0x2'))('api');var moment=require('moment');var BPromise=require(_0x74b1('0x3'));var rp=require(_0x74b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x74b1('0x5'));module['exports']=function(_0x563ebf,_0x31bdcc){return _0x563ebf[_0x74b1('0x6')]('Tag',attributes,{'tableName':_0x74b1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3b71=['moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','../../config/logger','api'];(function(_0x57506a,_0x3ff153){var _0xac0866=function(_0x2ecc02){while(--_0x2ecc02){_0x57506a['push'](_0x57506a['shift']());}};_0xac0866(++_0x3ff153);}(_0x3b71,0x1ea));var _0x13b7=function(_0x4751f9,_0x1b572b){_0x4751f9=_0x4751f9-0x0;var _0x5ba16b=_0x3b71[_0x4751f9];return _0x5ba16b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x13b7('0x0'))(_0x13b7('0x1'));var moment=require(_0x13b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x13b7('0x3'));var fs=require('fs');var path=require(_0x13b7('0x4'));var rimraf=require(_0x13b7('0x5'));var config=require(_0x13b7('0x6'));var attributes=require(_0x13b7('0x7'));module[_0x13b7('0x8')]=function(_0x55df74,_0x434b77){return _0x55df74[_0x13b7('0x9')](_0x13b7('0xa'),attributes,{'tableName':_0x13b7('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 4716327..578bfd0 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 _0x4483=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s'];(function(_0x2a3abf,_0xabfc69){var _0x5d0b81=function(_0x1c4824){while(--_0x1c4824){_0x2a3abf['push'](_0x2a3abf['shift']());}};_0x5d0b81(++_0xabfc69);}(_0x4483,0x1a3));var _0x3448=function(_0xcecfe9,_0x228c7f){_0xcecfe9=_0xcecfe9-0x0;var _0x56e925=_0x4483[_0xcecfe9];return _0x56e925;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('Tag,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});} \ No newline at end of file +var _0xf4eb=['Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x256851,_0x50f1a3){var _0x1db300=function(_0x322d11){while(--_0x322d11){_0x256851['push'](_0x256851['shift']());}};_0x1db300(++_0x50f1a3);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3cfaa2,_0xd3814d){_0x3cfaa2=_0x3cfaa2-0x0;var _0x241ffb=_0xf4eb[_0x3cfaa2];return _0x241ffb;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('Tag,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7105fcc..7484f2f 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 _0x1667=['../../config/environment','get','isAuthenticated','index','/:id','/:id/queues','/:id/users','getAgents','post','addAgents','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x36cbd0,_0x2d6f30){var _0x2bfb09=function(_0x1c9c74){while(--_0x1c9c74){_0x36cbd0['push'](_0x36cbd0['shift']());}};_0x2bfb09(++_0x2d6f30);}(_0x1667,0x18a));var _0x7166=function(_0x190ff6,_0x515cfd){_0x190ff6=_0x190ff6-0x0;var _0x5356d2=_0x1667[_0x190ff6];return _0x5356d2;};'use strict';var multer=require(_0x7166('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7166('0x1'));var express=require(_0x7166('0x2'));var router=express[_0x7166('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7166('0x4'));var config=require(_0x7166('0x5'));var controller=require('./team.controller');router[_0x7166('0x6')]('/',auth[_0x7166('0x7')](),controller[_0x7166('0x8')]);router[_0x7166('0x6')](_0x7166('0x9'),auth[_0x7166('0x7')](),controller['show']);router[_0x7166('0x6')](_0x7166('0xa'),auth['isAuthenticated'](),controller['getQueues']);router['get'](_0x7166('0xb'),auth[_0x7166('0x7')](),controller[_0x7166('0xc')]);router[_0x7166('0xd')]('/',auth[_0x7166('0x7')](),controller['create']);router[_0x7166('0xd')](_0x7166('0xa'),auth[_0x7166('0x7')](),controller['addQueues']);router['post'](_0x7166('0xb'),auth[_0x7166('0x7')](),controller[_0x7166('0xe')]);router[_0x7166('0xf')](_0x7166('0x9'),auth['isAuthenticated'](),controller[_0x7166('0x10')]);router['delete'](_0x7166('0x9'),auth[_0x7166('0x7')](),controller[_0x7166('0x11')]);router['delete'](_0x7166('0xa'),auth[_0x7166('0x7')](),controller['removeQueues']);router['delete'](_0x7166('0xb'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7166('0x12')]=router; \ No newline at end of file +var _0xcd61=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','/:id','isAuthenticated','show','/:id/queues','getQueues','/:id/users','post','addQueues','update','delete','destroy','removeQueues','removeAgents','exports'];(function(_0x10852d,_0x4cdcc6){var _0x13a8d6=function(_0x2ece16){while(--_0x2ece16){_0x10852d['push'](_0x10852d['shift']());}};_0x13a8d6(++_0x4cdcc6);}(_0xcd61,0x198));var _0x1cd6=function(_0x2cf199,_0x464d56){_0x2cf199=_0x2cf199-0x0;var _0x3fdf8d=_0xcd61[_0x2cf199];return _0x3fdf8d;};'use strict';var multer=require(_0x1cd6('0x0'));var util=require(_0x1cd6('0x1'));var path=require(_0x1cd6('0x2'));var timeout=require(_0x1cd6('0x3'));var express=require(_0x1cd6('0x4'));var router=express['Router']();var auth=require(_0x1cd6('0x5'));var interaction=require(_0x1cd6('0x6'));var config=require(_0x1cd6('0x7'));var controller=require(_0x1cd6('0x8'));router[_0x1cd6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x1cd6('0xa'),auth[_0x1cd6('0xb')](),controller[_0x1cd6('0xc')]);router[_0x1cd6('0x9')](_0x1cd6('0xd'),auth['isAuthenticated'](),controller[_0x1cd6('0xe')]);router[_0x1cd6('0x9')](_0x1cd6('0xf'),auth[_0x1cd6('0xb')](),controller['getAgents']);router[_0x1cd6('0x10')]('/',auth[_0x1cd6('0xb')](),controller['create']);router[_0x1cd6('0x10')]('/:id/queues',auth['isAuthenticated'](),controller[_0x1cd6('0x11')]);router[_0x1cd6('0x10')](_0x1cd6('0xf'),auth[_0x1cd6('0xb')](),controller['addAgents']);router['put'](_0x1cd6('0xa'),auth[_0x1cd6('0xb')](),controller[_0x1cd6('0x12')]);router[_0x1cd6('0x13')](_0x1cd6('0xa'),auth[_0x1cd6('0xb')](),controller[_0x1cd6('0x14')]);router[_0x1cd6('0x13')]('/:id/queues',auth[_0x1cd6('0xb')](),controller[_0x1cd6('0x15')]);router[_0x1cd6('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x1cd6('0x16')]);module[_0x1cd6('0x17')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 41d14dc..b0644d7 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 _0x97c1=['STRING','name','sequelize','exports'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x97c1,0xae));var _0x197c=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x97c1[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x197c('0x0'));module[_0x197c('0x1')]={'name':{'type':Sequelize[_0x197c('0x2')],'allowNull':![],'unique':_0x197c('0x3')},'description':{'type':Sequelize[_0x197c('0x2')]}}; \ No newline at end of file +var _0x47ff=['name','exports','STRING'];(function(_0x5b4daa,_0xc385e4){var _0x9b569c=function(_0x76fdb6){while(--_0x76fdb6){_0x5b4daa['push'](_0x5b4daa['shift']());}};_0x9b569c(++_0xc385e4);}(_0x47ff,0xbb));var _0xf47f=function(_0x465147,_0x240ccd){_0x465147=_0x465147-0x0;var _0x5449b5=_0x47ff[_0x465147];return _0x5449b5;};'use strict';var Sequelize=require('sequelize');module[_0xf47f('0x0')]={'name':{'type':Sequelize[_0xf47f('0x1')],'allowNull':![],'unique':_0xf47f('0x2')},'description':{'type':Sequelize[_0xf47f('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 92f6721..ccdd221 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 _0x8de8=['Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','ValidationError','add','ids','removeQueues','addAgents','Voice','Mail','Fax','Openchannel','Whatsapp','each','User','findAll','online','voicePause','format','interface','omit','userTeam:save','voice','chat','mail','openchannel','removeAgents','UserVoiceQueueRt','isArray','emit','userTeam:remove','getAgents','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','Teams','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','body','getQueues','findOne','isValidChannel','channel','Sequelize'];(function(_0x52c9f2,_0x202a11){var _0x535949=function(_0x2d77e2){while(--_0x2d77e2){_0x52c9f2['push'](_0x52c9f2['shift']());}};_0x535949(++_0x202a11);}(_0x8de8,0x19d));var _0x88de=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8de8[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x88de('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x88de('0x1'));var zipdir=require(_0x88de('0x2'));var jsonpatch=require(_0x88de('0x3'));var rp=require('request-promise');var moment=require(_0x88de('0x4'));var BPromise=require(_0x88de('0x5'));var Mustache=require(_0x88de('0x6'));var util=require(_0x88de('0x7'));var path=require(_0x88de('0x8'));var sox=require(_0x88de('0x9'));var csv=require('to-csv');var ejs=require(_0x88de('0xa'));var fs=require('fs');var _=require(_0x88de('0xb'));var squel=require('squel');var crypto=require(_0x88de('0xc'));var jsforce=require(_0x88de('0xd'));var deskjs=require(_0x88de('0xe'));var toCsv=require('to-csv');var querystring=require(_0x88de('0xf'));var Papa=require('papaparse');var Redis=require(_0x88de('0x10'));var authService=require(_0x88de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x88de('0x12'));var hardwareService=require(_0x88de('0x13'));var logger=require(_0x88de('0x14'))(_0x88de('0x15'));var utils=require(_0x88de('0x16'));var config=require(_0x88de('0x17'));var db=require(_0x88de('0x18'))['db'];config[_0x88de('0x19')]=_[_0x88de('0x1a')](config[_0x88de('0x19')],{'host':_0x88de('0x1b'),'port':0x18eb});var socket=require(_0x88de('0x1c'))(new Redis(config[_0x88de('0x19')]));require(_0x88de('0x1d'))[_0x88de('0x1e')](socket);function respondWithStatusCode(_0x16465f,_0x3ec5e4){_0x3ec5e4=_0x3ec5e4||0xcc;return function(_0x22228b){if(_0x22228b){return _0x16465f['sendStatus'](_0x3ec5e4);}return _0x16465f[_0x88de('0x1f')](_0x3ec5e4)[_0x88de('0x20')]();};}function respondWithResult(_0x466a93,_0x140783){_0x140783=_0x140783||0xc8;return function(_0x124c6e){if(_0x124c6e){return _0x466a93[_0x88de('0x1f')](_0x140783)[_0x88de('0x21')](_0x124c6e);}};}function respondWithFilteredResult(_0x2dd26c,_0x4ff159){return function(_0x3611d0){if(_0x3611d0){var _0x24a23c=_0x3611d0[_0x88de('0x22')],_0x4deccf=_0x4ff159[_0x88de('0x23')],_0x12a02d=_0x4ff159[_0x88de('0x23')]+_0x4ff159[_0x88de('0x24')],_0x17628c;if(_0x12a02d>=_0x24a23c){_0x12a02d=_0x24a23c;_0x17628c=0xc8;}else{_0x17628c=0xce;}_0x2dd26c[_0x88de('0x1f')](_0x17628c);return _0x2dd26c[_0x88de('0x25')]('Content-Range',_0x4deccf+'-'+_0x12a02d+'/'+_0x24a23c)[_0x88de('0x21')](_0x3611d0);}return null;};}function patchUpdates(_0x390837){return function(_0x178ac6){try{jsonpatch[_0x88de('0x26')](_0x178ac6,_0x390837,!![]);}catch(_0x4c2240){return BPromise[_0x88de('0x27')](_0x4c2240);}return _0x178ac6['save']();};}function saveUpdates(_0x45f986,_0xce9744){return function(_0x220800){if(_0x220800){return _0x220800[_0x88de('0x28')](_0x45f986)[_0x88de('0x29')](function(_0x39fb5a){return _0x39fb5a;});}return null;};}function removeEntity(_0x1a850b,_0x2020c4){return function(_0x1d031e){if(_0x1d031e){return _0x1d031e[_0x88de('0x2a')]()[_0x88de('0x29')](function(){var _0x10b032=_0x1d031e[_0x88de('0x2b')]({'plain':!![]});var _0x5c5511=_0x88de('0x2c');return db['UserProfileResource'][_0x88de('0x2a')]({'where':{'type':_0x5c5511,'resourceId':_0x10b032['id']}})[_0x88de('0x29')](function(){return _0x1d031e;});})['then'](function(){_0x1a850b[_0x88de('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x255e3f,_0x575399){return function(_0xf271f3){if(!_0xf271f3){_0x255e3f['sendStatus'](0x194);}return _0xf271f3;};}function handleError(_0x151269,_0x1def88){_0x1def88=_0x1def88||0x1f4;return function(_0x5c86f4){logger[_0x88de('0x2d')](_0x5c86f4[_0x88de('0x2e')]);if(_0x5c86f4[_0x88de('0x2f')]){delete _0x5c86f4['name'];}_0x151269['status'](_0x1def88)[_0x88de('0x30')](_0x5c86f4);};}exports[_0x88de('0x31')]=function(_0x260201,_0xbb5c88){var _0x142a9={},_0x3782ea={},_0x2f65d0={'count':0x0,'rows':[]};var _0x498b78=_[_0x88de('0x32')](db[_0x88de('0x33')][_0x88de('0x34')],function(_0xbc31c7){return{'name':_0xbc31c7[_0x88de('0x35')],'type':_0xbc31c7[_0x88de('0x36')][_0x88de('0x37')]};});_0x3782ea[_0x88de('0x38')]=_['map'](_0x498b78,_0x88de('0x2f'));_0x3782ea[_0x88de('0x39')]=_[_0x88de('0x3a')](_0x260201[_0x88de('0x39')]);_0x3782ea['filters']=_[_0x88de('0x3b')](_0x3782ea[_0x88de('0x38')],_0x3782ea['query']);_0x142a9[_0x88de('0x3c')]=_[_0x88de('0x3b')](_0x3782ea[_0x88de('0x38')],qs[_0x88de('0x3d')](_0x260201[_0x88de('0x39')]['fields']));_0x142a9[_0x88de('0x3c')]=_0x142a9[_0x88de('0x3c')][_0x88de('0x3e')]?_0x142a9['attributes']:_0x3782ea[_0x88de('0x38')];if(!_0x260201[_0x88de('0x39')]['hasOwnProperty']('nolimit')){_0x142a9[_0x88de('0x24')]=qs[_0x88de('0x24')](_0x260201[_0x88de('0x39')][_0x88de('0x24')]);_0x142a9[_0x88de('0x23')]=qs[_0x88de('0x23')](_0x260201[_0x88de('0x39')]['offset']);}_0x142a9[_0x88de('0x3f')]=qs[_0x88de('0x40')](_0x260201[_0x88de('0x39')][_0x88de('0x40')]);_0x142a9[_0x88de('0x41')]=qs[_0x88de('0x42')](_[_0x88de('0x43')](_0x260201['query'],_0x3782ea[_0x88de('0x42')]),_0x498b78);if(_0x260201[_0x88de('0x39')][_0x88de('0x44')]){_0x142a9[_0x88de('0x41')]=_['merge'](_0x142a9[_0x88de('0x41')],{'$or':_[_0x88de('0x32')](_0x498b78,function(_0x4f1155){if(_0x4f1155[_0x88de('0x36')]!==_0x88de('0x45')){var _0x5d5b09={};_0x5d5b09[_0x4f1155[_0x88de('0x2f')]]={'$like':'%'+_0x260201['query']['filter']+'%'};return _0x5d5b09;}})});}_0x142a9=_[_0x88de('0x46')]({},_0x142a9,_0x260201[_0x88de('0x47')]);var _0x29dda8={'where':_0x142a9[_0x88de('0x41')]};return db['Team']['count'](_0x29dda8)[_0x88de('0x29')](function(_0x5bbe40){_0x2f65d0['count']=_0x5bbe40;if(_0x260201[_0x88de('0x39')][_0x88de('0x48')]){_0x142a9[_0x88de('0x49')]=[{'all':!![]}];}return db[_0x88de('0x33')]['findAll'](_0x142a9);})[_0x88de('0x29')](function(_0x56adda){_0x2f65d0[_0x88de('0x4a')]=_0x56adda;return _0x2f65d0;})[_0x88de('0x29')](respondWithFilteredResult(_0xbb5c88,_0x142a9))[_0x88de('0x4b')](handleError(_0xbb5c88,null));};exports['show']=function(_0x458238,_0x5bead5){var _0x256c56={'raw':![],'where':{'id':_0x458238[_0x88de('0x4c')]['id']}},_0xa8179f={};_0xa8179f[_0x88de('0x38')]=_[_0x88de('0x3a')](db[_0x88de('0x33')][_0x88de('0x34')]);_0xa8179f[_0x88de('0x39')]=_[_0x88de('0x3a')](_0x458238['query']);_0xa8179f[_0x88de('0x42')]=_[_0x88de('0x3b')](_0xa8179f[_0x88de('0x38')],_0xa8179f[_0x88de('0x39')]);_0x256c56[_0x88de('0x3c')]=_['intersection'](_0xa8179f[_0x88de('0x38')],qs[_0x88de('0x3d')](_0x458238['query'][_0x88de('0x3d')]));_0x256c56['attributes']=_0x256c56['attributes'][_0x88de('0x3e')]?_0x256c56[_0x88de('0x3c')]:_0xa8179f[_0x88de('0x38')];if(_0x458238[_0x88de('0x39')]['includeAll']){_0x256c56['include']=[{'all':!![]}];}_0x256c56=_['merge']({},_0x256c56,_0x458238[_0x88de('0x47')]);return db[_0x88de('0x33')][_0x88de('0x4d')](_0x256c56)['then'](handleEntityNotFound(_0x5bead5,null))[_0x88de('0x29')](respondWithResult(_0x5bead5,null))['catch'](handleError(_0x5bead5,null));};exports[_0x88de('0x4e')]=function(_0xbb7042,_0x1a0a3d){return db[_0x88de('0x33')][_0x88de('0x4e')](_0xbb7042['body'],{})[_0x88de('0x29')](function(_0x24a3df){var _0x591263=_0xbb7042['user'][_0x88de('0x2b')]({'plain':!![]});if(!_0x591263)throw new Error(_0x88de('0x4f'));if(_0x591263[_0x88de('0x50')]===_0x88de('0x51')){var _0x974fb4=_0x24a3df['get']({'plain':!![]});var _0x138542=_0x88de('0x2c');return db[_0x88de('0x52')][_0x88de('0x4d')]({'where':{'name':_0x138542,'userProfileId':_0x591263['userProfileId']},'raw':!![]})[_0x88de('0x29')](function(_0x2afc9e){if(_0x2afc9e&&_0x2afc9e[_0x88de('0x53')]===0x0){return db[_0x88de('0x54')]['create']({'name':_0x974fb4['name'],'resourceId':_0x974fb4['id'],'type':_0x2afc9e[_0x88de('0x2f')],'sectionId':_0x2afc9e['id']},{})[_0x88de('0x29')](function(){return _0x24a3df;});}else{return _0x24a3df;}})[_0x88de('0x4b')](function(_0x2862b8){logger[_0x88de('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2862b8);throw _0x2862b8;});}return _0x24a3df;})[_0x88de('0x29')](respondWithResult(_0x1a0a3d,0xc9))[_0x88de('0x4b')](handleError(_0x1a0a3d,null));};exports[_0x88de('0x28')]=function(_0x1ee9a5,_0x4a64af){if(_0x1ee9a5[_0x88de('0x55')]['id']){delete _0x1ee9a5['body']['id'];}return db['Team'][_0x88de('0x4d')]({'where':{'id':_0x1ee9a5[_0x88de('0x4c')]['id']}})[_0x88de('0x29')](handleEntityNotFound(_0x4a64af,null))['then'](saveUpdates(_0x1ee9a5[_0x88de('0x55')],null))['then'](respondWithResult(_0x4a64af,null))[_0x88de('0x4b')](handleError(_0x4a64af,null));};exports[_0x88de('0x2a')]=function(_0xe78463,_0x5a5f0c){return db[_0x88de('0x33')][_0x88de('0x4d')]({'where':{'id':_0xe78463[_0x88de('0x4c')]['id']}})[_0x88de('0x29')](handleEntityNotFound(_0x5a5f0c,null))[_0x88de('0x29')](removeEntity(_0x5a5f0c,null))[_0x88de('0x4b')](handleError(_0x5a5f0c,null));};exports[_0x88de('0x56')]=function(_0x3ea9f9,_0x4ec0c4,_0x35e626){return db['Team'][_0x88de('0x57')]({'where':{'id':_0x3ea9f9['params']['id']}})[_0x88de('0x29')](handleEntityNotFound(_0x4ec0c4,null))['then'](function(_0x81dce3){if(!_0x3ea9f9[_0x88de('0x39')]['channel']||!utils[_0x88de('0x58')](_0x3ea9f9[_0x88de('0x39')][_0x88de('0x59')])){throw new db[(_0x88de('0x5a'))]['ValidationError'](_0x88de('0x5b'));}var _0x335c50={};var _0x442759={};_0x442759[_0x88de('0x38')]=_['keys'](db[_[_0x88de('0x5c')](_0x3ea9f9['query'][_0x88de('0x59')][_0x88de('0x5d')]())+'Queue'][_0x88de('0x34')]);_0x442759[_0x88de('0x39')]=_[_0x88de('0x3a')](_0x3ea9f9[_0x88de('0x39')]);_0x442759[_0x88de('0x42')]=_[_0x88de('0x3b')](_0x442759[_0x88de('0x38')],_0x442759[_0x88de('0x39')]);_0x335c50[_0x88de('0x3c')]=_['intersection'](_0x442759[_0x88de('0x38')],qs[_0x88de('0x3d')](_0x3ea9f9['query'][_0x88de('0x3d')]));_0x335c50['attributes']=_0x335c50[_0x88de('0x3c')][_0x88de('0x3e')]?_0x335c50[_0x88de('0x3c')]:_0x442759[_0x88de('0x38')];_0x335c50[_0x88de('0x24')]=qs[_0x88de('0x24')](_0x3ea9f9[_0x88de('0x39')][_0x88de('0x24')]);_0x335c50['offset']=qs['offset'](_0x3ea9f9[_0x88de('0x39')][_0x88de('0x23')]);_0x335c50[_0x88de('0x3f')]=qs[_0x88de('0x40')](_0x3ea9f9[_0x88de('0x39')][_0x88de('0x40')]);_0x335c50[_0x88de('0x41')]=qs[_0x88de('0x42')](_['pick'](_0x3ea9f9[_0x88de('0x39')],_0x442759[_0x88de('0x42')]));_0x335c50=_[_0x88de('0x46')]({},_0x335c50,_0x3ea9f9[_0x88de('0x47')]);return _0x81dce3[_0x88de('0x2b')+_[_0x88de('0x5c')](_0x3ea9f9['query']['channel']['toLowerCase']())+_0x88de('0x5e')](_0x335c50);})['then'](respondWithResult(_0x4ec0c4,null))[_0x88de('0x4b')](handleError(_0x4ec0c4,null));};exports[_0x88de('0x5f')]=function(_0x5cfe91,_0x2250d9,_0x18f146){return db[_0x88de('0x33')]['findOne']({'where':{'id':_0x5cfe91[_0x88de('0x4c')]['id']}})[_0x88de('0x29')](function(_0x4f7f6f){if(_0x4f7f6f){if(!_0x5cfe91[_0x88de('0x55')][_0x88de('0x59')]||!utils[_0x88de('0x58')](_0x5cfe91[_0x88de('0x55')][_0x88de('0x59')])){throw new db[(_0x88de('0x5a'))][(_0x88de('0x60'))](_0x88de('0x5b'));}return _0x4f7f6f[_0x88de('0x61')+_[_0x88de('0x5c')](_0x5cfe91[_0x88de('0x55')][_0x88de('0x59')][_0x88de('0x5d')]())+_0x88de('0x5e')](_0x5cfe91['body'][_0x88de('0x62')]);}return null;})[_0x88de('0x29')](handleEntityNotFound(_0x2250d9,null))[_0x88de('0x29')](respondWithStatusCode(_0x2250d9,null))[_0x88de('0x4b')](handleError(_0x2250d9,null));};exports[_0x88de('0x63')]=function(_0x3a1136,_0x3f228d,_0x4d8641){return db[_0x88de('0x33')][_0x88de('0x57')]({'where':{'id':_0x3a1136[_0x88de('0x4c')]['id']}})[_0x88de('0x29')](function(_0x1a12de){if(_0x1a12de){if(!_0x3a1136[_0x88de('0x39')]['channel']||!utils['isValidChannel'](_0x3a1136['query']['channel'])){throw new db['Sequelize']['ValidationError'](_0x88de('0x5b'));}return _0x1a12de['remove'+_[_0x88de('0x5c')](_0x3a1136['query'][_0x88de('0x59')]['toLowerCase']())+_0x88de('0x5e')](_0x3a1136[_0x88de('0x39')][_0x88de('0x62')]);}return null;})[_0x88de('0x29')](handleEntityNotFound(_0x3f228d,null))[_0x88de('0x29')](respondWithStatusCode(_0x3f228d,null))[_0x88de('0x4b')](handleError(_0x3f228d,null));};exports[_0x88de('0x64')]=function(_0x389a3f,_0x49dd3c,_0x47a4e7){return db[_0x88de('0x33')]['find']({'where':{'id':_0x389a3f[_0x88de('0x4c')]['id']}})[_0x88de('0x29')](handleEntityNotFound(_0x49dd3c,null))[_0x88de('0x29')](function(_0x439bfa){if(_0x439bfa){var _0x1432e6=[_0x88de('0x65'),'Chat',_0x88de('0x66'),'Sms',_0x88de('0x67'),_0x88de('0x68'),_0x88de('0x69')];return BPromise[_0x88de('0x6a')](_0x1432e6,function(_0x4ea124){return _0x439bfa[_0x88de('0x2b')+_0x4ea124+_0x88de('0x5e')]({'attributes':['id',_0x88de('0x2f')]})['then'](function(_0x49e051){return BPromise['each'](_0x49e051,function(_0x58d16e){return _0x58d16e['addAgents'](_0x389a3f[_0x88de('0x55')][_0x88de('0x62')])[_0x88de('0x29')](function(){if(_0x4ea124===_0x88de('0x65')){return db[_0x88de('0x6b')][_0x88de('0x6c')]({'where':{'id':_0x389a3f['body'][_0x88de('0x62')]},'attributes':['id',_0x88de('0x2f'),_0x88de('0x6d'),_0x88de('0x6e'),'interface'],'raw':!![]})['then'](function(_0x271e60){return BPromise['each'](_[_0x88de('0x44')](_0x271e60,{'online':0x1}),function(_0x10491c){return db['UserVoiceQueueRt']['upsert']({'membername':_0x10491c['name'],'UserId':_0x10491c['id'],'queue_name':_0x58d16e[_0x88de('0x2f')],'VoiceQueueId':_0x58d16e['id'],'interface':_['isNil'](_0x10491c['interface'])?util[_0x88de('0x6f')]('SIP/%s',_0x10491c[_0x88de('0x2f')]):_0x10491c[_0x88de('0x70')],'paused':_0x10491c[_0x88de('0x6e')]||![],'penalty':0x0});});});}});});})[_0x88de('0x29')](function(){return _0x439bfa;});})[_0x88de('0x29')](function(){return _0x439bfa;});}})[_0x88de('0x29')](function(_0x14769f){if(_0x14769f){return _0x14769f[_0x88de('0x64')](_0x389a3f[_0x88de('0x55')]['ids'],_[_0x88de('0x71')](_0x389a3f[_0x88de('0x55')],[_0x88de('0x62'),'id'])||{})['spread'](function(_0x212766){for(var _0x4c5cfd=0x0;_0x4c5cfd<_0x389a3f[_0x88de('0x55')][_0x88de('0x62')]['length'];_0x4c5cfd+=0x1){socket['emit'](_0x88de('0x72'),{'UserId':_0x389a3f[_0x88de('0x55')]['ids'][_0x4c5cfd],'TeamId':_0x389a3f[_0x88de('0x4c')]['id']});}return _0x212766;});}})['then'](respondWithResult(_0x49dd3c,null))[_0x88de('0x4b')](handleError(_0x49dd3c,null));};exports['removeAgents']=function(_0x5ea882,_0x416c1a,_0xe7e730){return db[_0x88de('0x33')][_0x88de('0x4d')]({'where':{'id':_0x5ea882['params']['id']}})[_0x88de('0x29')](handleEntityNotFound(_0x416c1a,null))[_0x88de('0x29')](function(_0x4258ab){if(_0x4258ab){return BPromise[_0x88de('0x6a')]([_0x88de('0x73'),_0x88de('0x74'),_0x88de('0x75'),'sms','fax',_0x88de('0x76'),'whatsapp'],function(_0x52ad11){return _0x4258ab['get'+_['capitalize'](_0x52ad11)+'Queues']({'attributes':['id',_0x88de('0x2f')]})[_0x88de('0x29')](function(_0x528a78){return BPromise[_0x88de('0x6a')](_0x528a78,function(_0x1ec47e){return _0x1ec47e[_0x88de('0x77')](_0x5ea882[_0x88de('0x39')][_0x88de('0x62')])[_0x88de('0x29')](function(){if(_0x52ad11===_0x88de('0x73')){return db[_0x88de('0x78')][_0x88de('0x2a')]({'where':{'VoiceQueueId':_0x1ec47e['id'],'UserId':_0x5ea882['query'][_0x88de('0x62')]}});}});});})['then'](function(){return _0x4258ab;});})[_0x88de('0x29')](function(){return _0x4258ab;});}})[_0x88de('0x29')](function(_0x813922){if(_0x813922){return _0x813922[_0x88de('0x77')](_0x5ea882[_0x88de('0x39')][_0x88de('0x62')])[_0x88de('0x29')](function(){if(_[_0x88de('0x79')](_0x5ea882[_0x88de('0x39')]['ids'])){for(var _0x4e9388=0x0;_0x4e9388<_0x5ea882[_0x88de('0x39')]['ids'][_0x88de('0x3e')];_0x4e9388+=0x1){socket[_0x88de('0x7a')](_0x88de('0x7b'),{'UserId':Number(_0x5ea882[_0x88de('0x39')][_0x88de('0x62')][_0x4e9388]),'TeamId':Number(_0x5ea882[_0x88de('0x4c')]['id'])});}}else{socket[_0x88de('0x7a')]('userTeam:remove',{'UserId':Number(_0x5ea882[_0x88de('0x39')][_0x88de('0x62')]),'TeamId':Number(_0x5ea882[_0x88de('0x4c')]['id'])});}});}})[_0x88de('0x29')](respondWithStatusCode(_0x416c1a,null))[_0x88de('0x4b')](handleError(_0x416c1a,null));};exports[_0x88de('0x7c')]=function(_0x4e4505,_0x46c2e5,_0x1bd0f5){var _0x4fbd4c={};var _0x497e1f={};var _0x3886fb;var _0x1e4831;return db['Team'][_0x88de('0x57')]({'where':{'id':_0x4e4505[_0x88de('0x4c')]['id']}})[_0x88de('0x29')](handleEntityNotFound(_0x46c2e5,null))[_0x88de('0x29')](function(_0x14d582){if(_0x14d582){_0x3886fb=_0x14d582;_0x497e1f[_0x88de('0x38')]=_[_0x88de('0x3a')](db[_0x88de('0x6b')]['rawAttributes']);_0x497e1f['query']=_['keys'](_0x4e4505[_0x88de('0x39')]);_0x497e1f[_0x88de('0x42')]=_[_0x88de('0x3b')](_0x497e1f[_0x88de('0x38')],_0x497e1f['query']);_0x4fbd4c[_0x88de('0x3c')]=_['intersection'](_0x497e1f[_0x88de('0x38')],qs[_0x88de('0x3d')](_0x4e4505['query'][_0x88de('0x3d')]));_0x4fbd4c[_0x88de('0x3c')]=_0x4fbd4c[_0x88de('0x3c')][_0x88de('0x3e')]?_0x4fbd4c[_0x88de('0x3c')]:_0x497e1f['model'];_0x4fbd4c[_0x88de('0x3f')]=qs[_0x88de('0x40')](_0x4e4505['query'][_0x88de('0x40')]);_0x4fbd4c[_0x88de('0x41')]=qs['filters'](_[_0x88de('0x43')](_0x4e4505[_0x88de('0x39')],_0x497e1f[_0x88de('0x42')]));if(_0x4e4505[_0x88de('0x39')][_0x88de('0x44')]){_0x4fbd4c[_0x88de('0x41')]=_[_0x88de('0x46')](_0x4fbd4c[_0x88de('0x41')],{'$or':_[_0x88de('0x32')](_0x4fbd4c[_0x88de('0x3c')],function(_0x2f5be3){var _0x41450e={};_0x41450e[_0x2f5be3]={'$like':'%'+_0x4e4505['query'][_0x88de('0x44')]+'%'};return _0x41450e;})});}_0x4fbd4c=_[_0x88de('0x46')]({},_0x4fbd4c,_0x4e4505[_0x88de('0x47')]);return _0x3886fb['getAgents'](_0x4fbd4c);}})['then'](function(_0x476313){if(_0x476313){_0x1e4831=_0x476313[_0x88de('0x3e')];if(!_0x4e4505[_0x88de('0x39')]['hasOwnProperty'](_0x88de('0x7d'))){_0x4fbd4c[_0x88de('0x24')]=qs[_0x88de('0x24')](_0x4e4505[_0x88de('0x39')][_0x88de('0x24')]);_0x4fbd4c[_0x88de('0x23')]=qs[_0x88de('0x23')](_0x4e4505[_0x88de('0x39')][_0x88de('0x23')]);}return _0x3886fb[_0x88de('0x7c')](_0x4fbd4c);}})[_0x88de('0x29')](function(_0x461cb2){if(_0x461cb2){return _0x461cb2?{'count':_0x1e4831,'rows':_0x461cb2}:null;}})[_0x88de('0x29')](respondWithResult(_0x46c2e5,null))[_0x88de('0x4b')](handleError(_0x46c2e5,null));}; \ No newline at end of file +var _0x5d74=['query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','Team','findAll','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getQueues','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','order','Queues','addQueues','add','removeQueues','ValidationError','ids','addAgents','Chat','Mail','Sms','Fax','Whatsapp','Voice','User','online','voicePause','interface','UserVoiceQueueRt','isNil','format','spread','emit','userTeam:save','removeAgents','each','voice','chat','mail','sms','fax','openchannel','isArray','userTeam:remove','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','status','offset','limit','Content-Range','json','reject','save','then','get','UserProfileResource','destroy','end','error','name','send','index','map','rawAttributes','type','model'];(function(_0x4e2a3f,_0x4e28b7){var _0x328a5e=function(_0x1bca76){while(--_0x1bca76){_0x4e2a3f['push'](_0x4e2a3f['shift']());}};_0x328a5e(++_0x4e28b7);}(_0x5d74,0x14a));var _0x45d7=function(_0x4f7caa,_0x4b7b60){_0x4f7caa=_0x4f7caa-0x0;var _0x57671e=_0x5d74[_0x4f7caa];return _0x57671e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x45d7('0x0'));var zipdir=require(_0x45d7('0x1'));var jsonpatch=require(_0x45d7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x45d7('0x3'));var Mustache=require(_0x45d7('0x4'));var util=require(_0x45d7('0x5'));var path=require(_0x45d7('0x6'));var sox=require(_0x45d7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x45d7('0x8'));var squel=require(_0x45d7('0x9'));var crypto=require(_0x45d7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x45d7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x45d7('0xc'));var Papa=require(_0x45d7('0xd'));var Redis=require(_0x45d7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x45d7('0xf'));var as=require(_0x45d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x45d7('0x11'))(_0x45d7('0x12'));var utils=require(_0x45d7('0x13'));var config=require(_0x45d7('0x14'));var db=require(_0x45d7('0x15'))['db'];config[_0x45d7('0x16')]=_[_0x45d7('0x17')](config['redis'],{'host':_0x45d7('0x18'),'port':0x18eb});var socket=require(_0x45d7('0x19'))(new Redis(config['redis']));require(_0x45d7('0x1a'))['register'](socket);function respondWithStatusCode(_0x2ad630,_0x1ddf75){_0x1ddf75=_0x1ddf75||0xcc;return function(_0x4d0d49){if(_0x4d0d49){return _0x2ad630[_0x45d7('0x1b')](_0x1ddf75);}return _0x2ad630['status'](_0x1ddf75)['end']();};}function respondWithResult(_0x13101b,_0x1be6ef){_0x1be6ef=_0x1be6ef||0xc8;return function(_0x3e6996){if(_0x3e6996){return _0x13101b[_0x45d7('0x1c')](_0x1be6ef)['json'](_0x3e6996);}};}function respondWithFilteredResult(_0x4efb41,_0x62560a){return function(_0x25a123){if(_0x25a123){var _0xa65483=_0x25a123['count'],_0x516083=_0x62560a['offset'],_0x4e983e=_0x62560a[_0x45d7('0x1d')]+_0x62560a[_0x45d7('0x1e')],_0xe3bfa8;if(_0x4e983e>=_0xa65483){_0x4e983e=_0xa65483;_0xe3bfa8=0xc8;}else{_0xe3bfa8=0xce;}_0x4efb41[_0x45d7('0x1c')](_0xe3bfa8);return _0x4efb41['set'](_0x45d7('0x1f'),_0x516083+'-'+_0x4e983e+'/'+_0xa65483)[_0x45d7('0x20')](_0x25a123);}return null;};}function patchUpdates(_0x927b5c){return function(_0x525b8a){try{jsonpatch['apply'](_0x525b8a,_0x927b5c,!![]);}catch(_0x1cda59){return BPromise[_0x45d7('0x21')](_0x1cda59);}return _0x525b8a[_0x45d7('0x22')]();};}function saveUpdates(_0x553667,_0x17b118){return function(_0x55339d){if(_0x55339d){return _0x55339d['update'](_0x553667)[_0x45d7('0x23')](function(_0x740dba){return _0x740dba;});}return null;};}function removeEntity(_0x413a31,_0x57d3a9){return function(_0x5e8211){if(_0x5e8211){return _0x5e8211['destroy']()[_0x45d7('0x23')](function(){var _0x229507=_0x5e8211[_0x45d7('0x24')]({'plain':!![]});var _0x10d2dc='Teams';return db[_0x45d7('0x25')][_0x45d7('0x26')]({'where':{'type':_0x10d2dc,'resourceId':_0x229507['id']}})[_0x45d7('0x23')](function(){return _0x5e8211;});})[_0x45d7('0x23')](function(){_0x413a31[_0x45d7('0x1c')](0xcc)[_0x45d7('0x27')]();});}};}function handleEntityNotFound(_0x32a615,_0x4d8bd3){return function(_0x37c143){if(!_0x37c143){_0x32a615[_0x45d7('0x1b')](0x194);}return _0x37c143;};}function handleError(_0x565d2d,_0x141740){_0x141740=_0x141740||0x1f4;return function(_0x255ec6){logger[_0x45d7('0x28')](_0x255ec6['stack']);if(_0x255ec6[_0x45d7('0x29')]){delete _0x255ec6[_0x45d7('0x29')];}_0x565d2d[_0x45d7('0x1c')](_0x141740)[_0x45d7('0x2a')](_0x255ec6);};}exports[_0x45d7('0x2b')]=function(_0x31ec24,_0xc2fc7a){var _0x262caf={},_0xeea323={},_0xbbd081={'count':0x0,'rows':[]};var _0xa07b82=_[_0x45d7('0x2c')](db['Team'][_0x45d7('0x2d')],function(_0x3cc5e1){return{'name':_0x3cc5e1['fieldName'],'type':_0x3cc5e1[_0x45d7('0x2e')]['key']};});_0xeea323[_0x45d7('0x2f')]=_[_0x45d7('0x2c')](_0xa07b82,_0x45d7('0x29'));_0xeea323[_0x45d7('0x30')]=_[_0x45d7('0x31')](_0x31ec24[_0x45d7('0x30')]);_0xeea323[_0x45d7('0x32')]=_['intersection'](_0xeea323[_0x45d7('0x2f')],_0xeea323[_0x45d7('0x30')]);_0x262caf[_0x45d7('0x33')]=_[_0x45d7('0x34')](_0xeea323['model'],qs['fields'](_0x31ec24[_0x45d7('0x30')][_0x45d7('0x35')]));_0x262caf[_0x45d7('0x33')]=_0x262caf[_0x45d7('0x33')]['length']?_0x262caf[_0x45d7('0x33')]:_0xeea323[_0x45d7('0x2f')];if(!_0x31ec24[_0x45d7('0x30')][_0x45d7('0x36')]('nolimit')){_0x262caf['limit']=qs['limit'](_0x31ec24[_0x45d7('0x30')]['limit']);_0x262caf[_0x45d7('0x1d')]=qs['offset'](_0x31ec24['query'][_0x45d7('0x1d')]);}_0x262caf['order']=qs[_0x45d7('0x37')](_0x31ec24[_0x45d7('0x30')][_0x45d7('0x37')]);_0x262caf[_0x45d7('0x38')]=qs[_0x45d7('0x32')](_[_0x45d7('0x39')](_0x31ec24[_0x45d7('0x30')],_0xeea323[_0x45d7('0x32')]),_0xa07b82);if(_0x31ec24[_0x45d7('0x30')][_0x45d7('0x3a')]){_0x262caf[_0x45d7('0x38')]=_[_0x45d7('0x3b')](_0x262caf[_0x45d7('0x38')],{'$or':_['map'](_0xa07b82,function(_0x57ee00){if(_0x57ee00[_0x45d7('0x2e')]!==_0x45d7('0x3c')){var _0x107698={};_0x107698[_0x57ee00[_0x45d7('0x29')]]={'$like':'%'+_0x31ec24['query'][_0x45d7('0x3a')]+'%'};return _0x107698;}})});}_0x262caf=_['merge']({},_0x262caf,_0x31ec24[_0x45d7('0x3d')]);var _0x1ae4c5={'where':_0x262caf[_0x45d7('0x38')]};return db['Team']['count'](_0x1ae4c5)['then'](function(_0x35f75d){_0xbbd081[_0x45d7('0x3e')]=_0x35f75d;if(_0x31ec24[_0x45d7('0x30')][_0x45d7('0x3f')]){_0x262caf[_0x45d7('0x40')]=[{'all':!![]}];}return db[_0x45d7('0x41')][_0x45d7('0x42')](_0x262caf);})[_0x45d7('0x23')](function(_0x4fb6f1){_0xbbd081[_0x45d7('0x43')]=_0x4fb6f1;return _0xbbd081;})[_0x45d7('0x23')](respondWithFilteredResult(_0xc2fc7a,_0x262caf))[_0x45d7('0x44')](handleError(_0xc2fc7a,null));};exports['show']=function(_0x5446ec,_0x9f55d3){var _0x3cf8fc={'raw':![],'where':{'id':_0x5446ec['params']['id']}},_0x2193b2={};_0x2193b2[_0x45d7('0x2f')]=_[_0x45d7('0x31')](db[_0x45d7('0x41')][_0x45d7('0x2d')]);_0x2193b2['query']=_[_0x45d7('0x31')](_0x5446ec[_0x45d7('0x30')]);_0x2193b2[_0x45d7('0x32')]=_['intersection'](_0x2193b2[_0x45d7('0x2f')],_0x2193b2[_0x45d7('0x30')]);_0x3cf8fc[_0x45d7('0x33')]=_[_0x45d7('0x34')](_0x2193b2[_0x45d7('0x2f')],qs[_0x45d7('0x35')](_0x5446ec[_0x45d7('0x30')][_0x45d7('0x35')]));_0x3cf8fc[_0x45d7('0x33')]=_0x3cf8fc['attributes'][_0x45d7('0x45')]?_0x3cf8fc['attributes']:_0x2193b2[_0x45d7('0x2f')];if(_0x5446ec[_0x45d7('0x30')][_0x45d7('0x3f')]){_0x3cf8fc[_0x45d7('0x40')]=[{'all':!![]}];}_0x3cf8fc=_[_0x45d7('0x3b')]({},_0x3cf8fc,_0x5446ec[_0x45d7('0x3d')]);return db[_0x45d7('0x41')][_0x45d7('0x46')](_0x3cf8fc)[_0x45d7('0x23')](handleEntityNotFound(_0x9f55d3,null))[_0x45d7('0x23')](respondWithResult(_0x9f55d3,null))['catch'](handleError(_0x9f55d3,null));};exports[_0x45d7('0x47')]=function(_0x9e1601,_0x140e9b){return db[_0x45d7('0x41')][_0x45d7('0x47')](_0x9e1601[_0x45d7('0x48')],{})['then'](function(_0xeb96a7){var _0x5b0065=_0x9e1601[_0x45d7('0x49')][_0x45d7('0x24')]({'plain':!![]});if(!_0x5b0065)throw new Error(_0x45d7('0x4a'));if(_0x5b0065[_0x45d7('0x4b')]==='user'){var _0x4b8b9d=_0xeb96a7[_0x45d7('0x24')]({'plain':!![]});var _0x14f85c=_0x45d7('0x4c');return db[_0x45d7('0x4d')][_0x45d7('0x46')]({'where':{'name':_0x14f85c,'userProfileId':_0x5b0065[_0x45d7('0x4e')]},'raw':!![]})['then'](function(_0x539116){if(_0x539116&&_0x539116[_0x45d7('0x4f')]===0x0){return db[_0x45d7('0x25')][_0x45d7('0x47')]({'name':_0x4b8b9d[_0x45d7('0x29')],'resourceId':_0x4b8b9d['id'],'type':_0x539116[_0x45d7('0x29')],'sectionId':_0x539116['id']},{})[_0x45d7('0x23')](function(){return _0xeb96a7;});}else{return _0xeb96a7;}})[_0x45d7('0x44')](function(_0x3d0781){logger[_0x45d7('0x28')](_0x45d7('0x50'),_0x3d0781);throw _0x3d0781;});}return _0xeb96a7;})[_0x45d7('0x23')](respondWithResult(_0x140e9b,0xc9))[_0x45d7('0x44')](handleError(_0x140e9b,null));};exports[_0x45d7('0x51')]=function(_0x24aa1a,_0x5e8962){if(_0x24aa1a['body']['id']){delete _0x24aa1a[_0x45d7('0x48')]['id'];}return db[_0x45d7('0x41')][_0x45d7('0x46')]({'where':{'id':_0x24aa1a[_0x45d7('0x52')]['id']}})['then'](handleEntityNotFound(_0x5e8962,null))['then'](saveUpdates(_0x24aa1a[_0x45d7('0x48')],null))[_0x45d7('0x23')](respondWithResult(_0x5e8962,null))[_0x45d7('0x44')](handleError(_0x5e8962,null));};exports[_0x45d7('0x26')]=function(_0x213bea,_0x46fb5e){return db['Team'][_0x45d7('0x46')]({'where':{'id':_0x213bea[_0x45d7('0x52')]['id']}})[_0x45d7('0x23')](handleEntityNotFound(_0x46fb5e,null))[_0x45d7('0x23')](removeEntity(_0x46fb5e,null))[_0x45d7('0x44')](handleError(_0x46fb5e,null));};exports[_0x45d7('0x53')]=function(_0x4a56ed,_0x6126ba,_0x4a2e28){return db['Team'][_0x45d7('0x54')]({'where':{'id':_0x4a56ed[_0x45d7('0x52')]['id']}})[_0x45d7('0x23')](handleEntityNotFound(_0x6126ba,null))[_0x45d7('0x23')](function(_0x39787e){if(!_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x55')]||!utils[_0x45d7('0x56')](_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x55')])){throw new db[(_0x45d7('0x57'))]['ValidationError'](_0x45d7('0x58'));}var _0x12d31b={};var _0x2dd927={};_0x2dd927[_0x45d7('0x2f')]=_[_0x45d7('0x31')](db[_[_0x45d7('0x59')](_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x55')][_0x45d7('0x5a')]())+'Queue'][_0x45d7('0x2d')]);_0x2dd927[_0x45d7('0x30')]=_['keys'](_0x4a56ed[_0x45d7('0x30')]);_0x2dd927['filters']=_[_0x45d7('0x34')](_0x2dd927[_0x45d7('0x2f')],_0x2dd927['query']);_0x12d31b[_0x45d7('0x33')]=_[_0x45d7('0x34')](_0x2dd927[_0x45d7('0x2f')],qs[_0x45d7('0x35')](_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x35')]));_0x12d31b[_0x45d7('0x33')]=_0x12d31b[_0x45d7('0x33')]['length']?_0x12d31b[_0x45d7('0x33')]:_0x2dd927[_0x45d7('0x2f')];_0x12d31b[_0x45d7('0x1e')]=qs[_0x45d7('0x1e')](_0x4a56ed[_0x45d7('0x30')]['limit']);_0x12d31b[_0x45d7('0x1d')]=qs[_0x45d7('0x1d')](_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x1d')]);_0x12d31b[_0x45d7('0x5b')]=qs[_0x45d7('0x37')](_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x37')]);_0x12d31b[_0x45d7('0x38')]=qs['filters'](_[_0x45d7('0x39')](_0x4a56ed['query'],_0x2dd927[_0x45d7('0x32')]));_0x12d31b=_[_0x45d7('0x3b')]({},_0x12d31b,_0x4a56ed[_0x45d7('0x3d')]);return _0x39787e['get'+_['capitalize'](_0x4a56ed[_0x45d7('0x30')][_0x45d7('0x55')][_0x45d7('0x5a')]())+_0x45d7('0x5c')](_0x12d31b);})[_0x45d7('0x23')](respondWithResult(_0x6126ba,null))['catch'](handleError(_0x6126ba,null));};exports[_0x45d7('0x5d')]=function(_0x58a5c3,_0x2c105f,_0x1470f9){return db[_0x45d7('0x41')][_0x45d7('0x54')]({'where':{'id':_0x58a5c3['params']['id']}})[_0x45d7('0x23')](function(_0x938fd1){if(_0x938fd1){if(!_0x58a5c3[_0x45d7('0x48')][_0x45d7('0x55')]||!utils[_0x45d7('0x56')](_0x58a5c3[_0x45d7('0x48')][_0x45d7('0x55')])){throw new db[(_0x45d7('0x57'))]['ValidationError'](_0x45d7('0x58'));}return _0x938fd1[_0x45d7('0x5e')+_[_0x45d7('0x59')](_0x58a5c3[_0x45d7('0x48')]['channel'][_0x45d7('0x5a')]())+_0x45d7('0x5c')](_0x58a5c3[_0x45d7('0x48')]['ids']);}return null;})[_0x45d7('0x23')](handleEntityNotFound(_0x2c105f,null))[_0x45d7('0x23')](respondWithStatusCode(_0x2c105f,null))['catch'](handleError(_0x2c105f,null));};exports[_0x45d7('0x5f')]=function(_0x378d10,_0x1aef3b,_0x1b6158){return db[_0x45d7('0x41')][_0x45d7('0x54')]({'where':{'id':_0x378d10[_0x45d7('0x52')]['id']}})[_0x45d7('0x23')](function(_0x4e055b){if(_0x4e055b){if(!_0x378d10[_0x45d7('0x30')][_0x45d7('0x55')]||!utils[_0x45d7('0x56')](_0x378d10['query']['channel'])){throw new db[(_0x45d7('0x57'))][(_0x45d7('0x60'))](_0x45d7('0x58'));}return _0x4e055b['remove'+_[_0x45d7('0x59')](_0x378d10[_0x45d7('0x30')]['channel'][_0x45d7('0x5a')]())+_0x45d7('0x5c')](_0x378d10[_0x45d7('0x30')][_0x45d7('0x61')]);}return null;})[_0x45d7('0x23')](handleEntityNotFound(_0x1aef3b,null))[_0x45d7('0x23')](respondWithStatusCode(_0x1aef3b,null))['catch'](handleError(_0x1aef3b,null));};exports[_0x45d7('0x62')]=function(_0x3d8c34,_0x5dc95e,_0x39fab3){return db['Team']['find']({'where':{'id':_0x3d8c34['params']['id']}})[_0x45d7('0x23')](handleEntityNotFound(_0x5dc95e,null))[_0x45d7('0x23')](function(_0x20d5cb){if(_0x20d5cb){var _0x27af03=['Voice',_0x45d7('0x63'),_0x45d7('0x64'),_0x45d7('0x65'),_0x45d7('0x66'),'Openchannel',_0x45d7('0x67')];return BPromise['each'](_0x27af03,function(_0x224865){return _0x20d5cb[_0x45d7('0x24')+_0x224865+_0x45d7('0x5c')]({'attributes':['id','name']})[_0x45d7('0x23')](function(_0x18d1b9){return BPromise['each'](_0x18d1b9,function(_0x4002aa){return _0x4002aa['addAgents'](_0x3d8c34[_0x45d7('0x48')][_0x45d7('0x61')])['then'](function(){if(_0x224865===_0x45d7('0x68')){return db[_0x45d7('0x69')][_0x45d7('0x42')]({'where':{'id':_0x3d8c34[_0x45d7('0x48')][_0x45d7('0x61')]},'attributes':['id','name',_0x45d7('0x6a'),_0x45d7('0x6b'),_0x45d7('0x6c')],'raw':!![]})[_0x45d7('0x23')](function(_0x2d40be){return BPromise['each'](_[_0x45d7('0x3a')](_0x2d40be,{'online':0x1}),function(_0x2b982b){return db[_0x45d7('0x6d')]['upsert']({'membername':_0x2b982b[_0x45d7('0x29')],'UserId':_0x2b982b['id'],'queue_name':_0x4002aa['name'],'VoiceQueueId':_0x4002aa['id'],'interface':_[_0x45d7('0x6e')](_0x2b982b[_0x45d7('0x6c')])?util[_0x45d7('0x6f')]('SIP/%s',_0x2b982b[_0x45d7('0x29')]):_0x2b982b[_0x45d7('0x6c')],'paused':_0x2b982b[_0x45d7('0x6b')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0x20d5cb;});})['then'](function(){return _0x20d5cb;});}})[_0x45d7('0x23')](function(_0x44c650){if(_0x44c650){return _0x44c650[_0x45d7('0x62')](_0x3d8c34['body'][_0x45d7('0x61')],_['omit'](_0x3d8c34[_0x45d7('0x48')],[_0x45d7('0x61'),'id'])||{})[_0x45d7('0x70')](function(_0xa3e17a){for(var _0x13e83f=0x0;_0x13e83f<_0x3d8c34['body'][_0x45d7('0x61')]['length'];_0x13e83f+=0x1){socket[_0x45d7('0x71')](_0x45d7('0x72'),{'UserId':_0x3d8c34[_0x45d7('0x48')][_0x45d7('0x61')][_0x13e83f],'TeamId':_0x3d8c34[_0x45d7('0x52')]['id']});}return _0xa3e17a;});}})[_0x45d7('0x23')](respondWithResult(_0x5dc95e,null))['catch'](handleError(_0x5dc95e,null));};exports[_0x45d7('0x73')]=function(_0x25f67a,_0x546d5d,_0x17b85c){return db[_0x45d7('0x41')][_0x45d7('0x46')]({'where':{'id':_0x25f67a[_0x45d7('0x52')]['id']}})[_0x45d7('0x23')](handleEntityNotFound(_0x546d5d,null))[_0x45d7('0x23')](function(_0x49a8e0){if(_0x49a8e0){return BPromise[_0x45d7('0x74')]([_0x45d7('0x75'),_0x45d7('0x76'),_0x45d7('0x77'),_0x45d7('0x78'),_0x45d7('0x79'),_0x45d7('0x7a'),'whatsapp'],function(_0x54076f){return _0x49a8e0[_0x45d7('0x24')+_[_0x45d7('0x59')](_0x54076f)+_0x45d7('0x5c')]({'attributes':['id',_0x45d7('0x29')]})[_0x45d7('0x23')](function(_0x27d35a){return BPromise['each'](_0x27d35a,function(_0x3a6a46){return _0x3a6a46['removeAgents'](_0x25f67a['query'][_0x45d7('0x61')])[_0x45d7('0x23')](function(){if(_0x54076f===_0x45d7('0x75')){return db[_0x45d7('0x6d')][_0x45d7('0x26')]({'where':{'VoiceQueueId':_0x3a6a46['id'],'UserId':_0x25f67a[_0x45d7('0x30')][_0x45d7('0x61')]}});}});});})[_0x45d7('0x23')](function(){return _0x49a8e0;});})['then'](function(){return _0x49a8e0;});}})[_0x45d7('0x23')](function(_0x38b032){if(_0x38b032){return _0x38b032[_0x45d7('0x73')](_0x25f67a[_0x45d7('0x30')][_0x45d7('0x61')])[_0x45d7('0x23')](function(){if(_[_0x45d7('0x7b')](_0x25f67a['query']['ids'])){for(var _0x1cdc06=0x0;_0x1cdc06<_0x25f67a[_0x45d7('0x30')][_0x45d7('0x61')][_0x45d7('0x45')];_0x1cdc06+=0x1){socket[_0x45d7('0x71')](_0x45d7('0x7c'),{'UserId':Number(_0x25f67a['query'][_0x45d7('0x61')][_0x1cdc06]),'TeamId':Number(_0x25f67a[_0x45d7('0x52')]['id'])});}}else{socket[_0x45d7('0x71')](_0x45d7('0x7c'),{'UserId':Number(_0x25f67a[_0x45d7('0x30')][_0x45d7('0x61')]),'TeamId':Number(_0x25f67a[_0x45d7('0x52')]['id'])});}});}})[_0x45d7('0x23')](respondWithStatusCode(_0x546d5d,null))[_0x45d7('0x44')](handleError(_0x546d5d,null));};exports[_0x45d7('0x7d')]=function(_0x18e5f8,_0x24dab5,_0x46371e){var _0x5d4a54={};var _0x3e92d3={};var _0x384b67;var _0x30bfd7;return db[_0x45d7('0x41')][_0x45d7('0x54')]({'where':{'id':_0x18e5f8['params']['id']}})[_0x45d7('0x23')](handleEntityNotFound(_0x24dab5,null))[_0x45d7('0x23')](function(_0x10d8b0){if(_0x10d8b0){_0x384b67=_0x10d8b0;_0x3e92d3[_0x45d7('0x2f')]=_['keys'](db[_0x45d7('0x69')][_0x45d7('0x2d')]);_0x3e92d3['query']=_[_0x45d7('0x31')](_0x18e5f8['query']);_0x3e92d3[_0x45d7('0x32')]=_[_0x45d7('0x34')](_0x3e92d3[_0x45d7('0x2f')],_0x3e92d3[_0x45d7('0x30')]);_0x5d4a54['attributes']=_[_0x45d7('0x34')](_0x3e92d3[_0x45d7('0x2f')],qs[_0x45d7('0x35')](_0x18e5f8[_0x45d7('0x30')][_0x45d7('0x35')]));_0x5d4a54[_0x45d7('0x33')]=_0x5d4a54[_0x45d7('0x33')][_0x45d7('0x45')]?_0x5d4a54[_0x45d7('0x33')]:_0x3e92d3[_0x45d7('0x2f')];_0x5d4a54[_0x45d7('0x5b')]=qs[_0x45d7('0x37')](_0x18e5f8[_0x45d7('0x30')]['sort']);_0x5d4a54['where']=qs[_0x45d7('0x32')](_[_0x45d7('0x39')](_0x18e5f8[_0x45d7('0x30')],_0x3e92d3[_0x45d7('0x32')]));if(_0x18e5f8['query'][_0x45d7('0x3a')]){_0x5d4a54[_0x45d7('0x38')]=_['merge'](_0x5d4a54['where'],{'$or':_[_0x45d7('0x2c')](_0x5d4a54[_0x45d7('0x33')],function(_0x417b5b){var _0x1ae0cc={};_0x1ae0cc[_0x417b5b]={'$like':'%'+_0x18e5f8['query'][_0x45d7('0x3a')]+'%'};return _0x1ae0cc;})});}_0x5d4a54=_[_0x45d7('0x3b')]({},_0x5d4a54,_0x18e5f8[_0x45d7('0x3d')]);return _0x384b67['getAgents'](_0x5d4a54);}})['then'](function(_0x5255fd){if(_0x5255fd){_0x30bfd7=_0x5255fd['length'];if(!_0x18e5f8[_0x45d7('0x30')][_0x45d7('0x36')]('nolimit')){_0x5d4a54[_0x45d7('0x1e')]=qs[_0x45d7('0x1e')](_0x18e5f8[_0x45d7('0x30')][_0x45d7('0x1e')]);_0x5d4a54[_0x45d7('0x1d')]=qs[_0x45d7('0x1d')](_0x18e5f8[_0x45d7('0x30')]['offset']);}return _0x384b67[_0x45d7('0x7d')](_0x5d4a54);}})[_0x45d7('0x23')](function(_0x5e1bda){if(_0x5e1bda){return _0x5e1bda?{'count':_0x30bfd7,'rows':_0x5e1bda}:null;}})[_0x45d7('0x23')](respondWithResult(_0x24dab5,null))[_0x45d7('0x44')](handleError(_0x24dab5,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 5352665..d3d64e8 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 _0x7f6e=['events','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x190b51,_0x5b3786){var _0x91beb9=function(_0x35400e){while(--_0x35400e){_0x190b51['push'](_0x190b51['shift']());}};_0x91beb9(++_0x5b3786);}(_0x7f6e,0xb4));var _0xe7f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7f6e[_0x31e29a];return _0x32d892;};'use strict';var EventEmitter=require(_0xe7f6('0x0'));var Team=require('../../mysqldb')['db'][_0xe7f6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe7f6('0x2')](0x0);var events={'afterCreate':_0xe7f6('0x3'),'afterUpdate':_0xe7f6('0x4'),'afterDestroy':_0xe7f6('0x5')};function emitEvent(_0x27cb5b){return function(_0x2838fd,_0x148926,_0x145365){TeamEvents[_0xe7f6('0x6')](_0x27cb5b+':'+_0x2838fd['id'],_0x2838fd);TeamEvents['emit'](_0x27cb5b,_0x2838fd);_0x145365(null);};}for(var e in events){if(events[_0xe7f6('0x7')](e)){var event=events[e];Team[_0xe7f6('0x8')](e,emitEvent(event));}}module[_0xe7f6('0x9')]=TeamEvents; \ No newline at end of file +var _0x299e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb','Team'];(function(_0x18d595,_0x214a96){var _0x58135c=function(_0x48db8e){while(--_0x48db8e){_0x18d595['push'](_0x18d595['shift']());}};_0x58135c(++_0x214a96);}(_0x299e,0x1b6));var _0xe299=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x299e[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require('events');var Team=require(_0xe299('0x0'))['db'][_0xe299('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xe299('0x2')](0x0);var events={'afterCreate':_0xe299('0x3'),'afterUpdate':_0xe299('0x4'),'afterDestroy':_0xe299('0x5')};function emitEvent(_0x8dd780){return function(_0x271514,_0x1ea47a,_0x410228){TeamEvents[_0xe299('0x6')](_0x8dd780+':'+_0x271514['id'],_0x271514);TeamEvents[_0xe299('0x6')](_0x8dd780,_0x271514);_0x410228(null);};}for(var e in events){if(events[_0xe299('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 45067c5..31146c8 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 _0xc2a2=['request-promise','path','rimraf','../../config/environment','exports','Team','lodash','api','moment','bluebird'];(function(_0x4c16cf,_0x311772){var _0x1ac4ae=function(_0x22d19a){while(--_0x22d19a){_0x4c16cf['push'](_0x4c16cf['shift']());}};_0x1ac4ae(++_0x311772);}(_0xc2a2,0x100));var _0x2c2a=function(_0x13d337,_0x51bee4){_0x13d337=_0x13d337-0x0;var _0x26ecbb=_0xc2a2[_0x13d337];return _0x26ecbb;};'use strict';var _=require(_0x2c2a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2c2a('0x1'));var moment=require(_0x2c2a('0x2'));var BPromise=require(_0x2c2a('0x3'));var rp=require(_0x2c2a('0x4'));var fs=require('fs');var path=require(_0x2c2a('0x5'));var rimraf=require(_0x2c2a('0x6'));var config=require(_0x2c2a('0x7'));var attributes=require('./team.attributes');module[_0x2c2a('0x8')]=function(_0x34ae0b,_0x47c92e){return _0x34ae0b['define'](_0x2c2a('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ca9=['lodash','util','../../config/logger','api','moment','exports','define'];(function(_0x5ba858,_0x1e42e2){var _0xc702fb=function(_0x3d2e9e){while(--_0x3d2e9e){_0x5ba858['push'](_0x5ba858['shift']());}};_0xc702fb(++_0x1e42e2);}(_0x3ca9,0x9a));var _0x93ca=function(_0x1f4fa1,_0x40ba30){_0x1f4fa1=_0x1f4fa1-0x0;var _0x5a606e=_0x3ca9[_0x1f4fa1];return _0x5a606e;};'use strict';var _=require(_0x93ca('0x0'));var util=require(_0x93ca('0x1'));var logger=require(_0x93ca('0x2'))(_0x93ca('0x3'));var moment=require(_0x93ca('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('../../config/environment');var attributes=require('./team.attributes');module[_0x93ca('0x5')]=function(_0x1e67d1,_0x2eb5ce){return _0x1e67d1[_0x93ca('0x6')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index de48b2f..5819daa 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 _0x5d8a=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x21b232,_0x1b9b77){var _0x54a541=function(_0x466d43){while(--_0x466d43){_0x21b232['push'](_0x21b232['shift']());}};_0x54a541(++_0x1b9b77);}(_0x5d8a,0x16e));var _0xa5d8=function(_0x318c16,_0x18f27b){_0x318c16=_0x318c16-0x0;var _0x3a72d7=_0x5d8a[_0x318c16];return _0x3a72d7;};'use strict';var _=require(_0xa5d8('0x0'));var util=require('util');var moment=require(_0xa5d8('0x1'));var BPromise=require('bluebird');var rs=require(_0xa5d8('0x2'));var fs=require('fs');var Redis=require(_0xa5d8('0x3'));var db=require(_0xa5d8('0x4'))['db'];var utils=require(_0xa5d8('0x5'));var logger=require(_0xa5d8('0x6'))(_0xa5d8('0x7'));var config=require(_0xa5d8('0x8'));var jayson=require(_0xa5d8('0x9'));var client=jayson[_0xa5d8('0xa')][_0xa5d8('0xb')]({'port':0x232a});config[_0xa5d8('0xc')]=_[_0xa5d8('0xd')](config[_0xa5d8('0xc')],{'host':_0xa5d8('0xe'),'port':0x18eb});var socket=require(_0xa5d8('0xf'))(new Redis(config[_0xa5d8('0xc')]));require(_0xa5d8('0x10'))[_0xa5d8('0x11')](socket);function respondWithRpcPromise(_0x484b3d,_0x4210da,_0xfc7306){return new BPromise(function(_0x567087,_0x35c47e){return client['request'](_0x484b3d,_0xfc7306)[_0xa5d8('0x12')](function(_0x4e7eae){logger[_0xa5d8('0x13')](_0xa5d8('0x14'),_0x4210da,_0xa5d8('0x15'));logger[_0xa5d8('0x16')]('Team,\x20%s,\x20%s,\x20%s',_0x4210da,_0xa5d8('0x15'),JSON['stringify'](_0x4e7eae));if(_0x4e7eae['error']){if(_0x4e7eae[_0xa5d8('0x17')][_0xa5d8('0x18')]===0x1f4){logger[_0xa5d8('0x17')](_0xa5d8('0x14'),_0x4210da,_0x4e7eae[_0xa5d8('0x17')][_0xa5d8('0x19')]);return _0x35c47e(_0x4e7eae['error']['message']);}logger[_0xa5d8('0x17')](_0xa5d8('0x14'),_0x4210da,_0x4e7eae['error'][_0xa5d8('0x19')]);return _0x567087(_0x4e7eae['error']['message']);}else{logger[_0xa5d8('0x13')](_0xa5d8('0x14'),_0x4210da,'request\x20sent');_0x567087(_0x4e7eae[_0xa5d8('0x1a')]['message']);}})[_0xa5d8('0x1b')](function(_0x23d4f6){logger[_0xa5d8('0x17')]('Team,\x20%s,\x20%s',_0x4210da,_0x23d4f6);_0x35c47e(_0x23d4f6);});});} \ No newline at end of file +var _0xbaad=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x38cc1f,_0x5bea2b){var _0x3f2909=function(_0x35de4e){while(--_0x35de4e){_0x38cc1f['push'](_0x38cc1f['shift']());}};_0x3f2909(++_0x5bea2b);}(_0xbaad,0x15f));var _0xdbaa=function(_0x5ae723,_0x10eedb){_0x5ae723=_0x5ae723-0x0;var _0x351542=_0xbaad[_0x5ae723];return _0x351542;};'use strict';var _=require(_0xdbaa('0x0'));var util=require('util');var moment=require(_0xdbaa('0x1'));var BPromise=require(_0xdbaa('0x2'));var rs=require(_0xdbaa('0x3'));var fs=require('fs');var Redis=require(_0xdbaa('0x4'));var db=require(_0xdbaa('0x5'))['db'];var utils=require(_0xdbaa('0x6'));var logger=require(_0xdbaa('0x7'))('rpc');var config=require(_0xdbaa('0x8'));var jayson=require(_0xdbaa('0x9'));var client=jayson[_0xdbaa('0xa')]['http']({'port':0x232a});config[_0xdbaa('0xb')]=_[_0xdbaa('0xc')](config[_0xdbaa('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xdbaa('0xd'))(new Redis(config['redis']));require('./team.socket')[_0xdbaa('0xe')](socket);function respondWithRpcPromise(_0x41a8bf,_0x38712f,_0x51aafa){return new BPromise(function(_0xb2617a,_0x45f616){return client[_0xdbaa('0xf')](_0x41a8bf,_0x51aafa)[_0xdbaa('0x10')](function(_0x784083){logger['info'](_0xdbaa('0x11'),_0x38712f,_0xdbaa('0x12'));logger[_0xdbaa('0x13')](_0xdbaa('0x14'),_0x38712f,'request\x20sent',JSON['stringify'](_0x784083));if(_0x784083[_0xdbaa('0x15')]){if(_0x784083[_0xdbaa('0x15')][_0xdbaa('0x16')]===0x1f4){logger[_0xdbaa('0x15')](_0xdbaa('0x11'),_0x38712f,_0x784083[_0xdbaa('0x15')][_0xdbaa('0x17')]);return _0x45f616(_0x784083['error']['message']);}logger[_0xdbaa('0x15')](_0xdbaa('0x11'),_0x38712f,_0x784083[_0xdbaa('0x15')][_0xdbaa('0x17')]);return _0xb2617a(_0x784083[_0xdbaa('0x15')]['message']);}else{logger[_0xdbaa('0x18')](_0xdbaa('0x11'),_0x38712f,'request\x20sent');_0xb2617a(_0x784083[_0xdbaa('0x19')][_0xdbaa('0x17')]);}})[_0xdbaa('0x1a')](function(_0x5ad12d){logger[_0xdbaa('0x15')]('Team,\x20%s,\x20%s',_0x38712f,_0x5ad12d);_0x45f616(_0x5ad12d);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index d8fd8db..d016f15 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 _0xd1f1=['register','length','./team.events','save','update','emit'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x46e3aa,_0x39d0f4){_0x46e3aa=_0x46e3aa-0x0;var _0x1558d1=_0xd1f1[_0x46e3aa];return _0x1558d1;};'use strict';var TeamEvents=require(_0x1d1f('0x0'));var events=[_0x1d1f('0x1'),'remove',_0x1d1f('0x2')];function createListener(_0x28750f,_0x346c36){return function(_0x42f3a0){_0x346c36[_0x1d1f('0x3')](_0x28750f,_0x42f3a0);};}function removeListener(_0x210e7f,_0x2a2bb4){return function(){TeamEvents['removeListener'](_0x210e7f,_0x2a2bb4);};}exports[_0x1d1f('0x4')]=function(_0x246882){for(var _0x68d881=0x0,_0x188cc3=events[_0x1d1f('0x5')];_0x68d881<_0x188cc3;_0x68d881++){var _0x5228f4=events[_0x68d881];var _0x4836b3=createListener('team:'+_0x5228f4,_0x246882);TeamEvents['on'](_0x5228f4,_0x4836b3);}}; \ No newline at end of file +var _0xcddb=['emit','removeListener','length','team:','./team.events','save','remove'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x33d861,_0x301101){_0x33d861=_0x33d861-0x0;var _0x1f1bbe=_0xcddb[_0x33d861];return _0x1f1bbe;};'use strict';var TeamEvents=require(_0xbcdd('0x0'));var events=[_0xbcdd('0x1'),_0xbcdd('0x2'),'update'];function createListener(_0x49d70b,_0x2a6202){return function(_0x5e7cff){_0x2a6202[_0xbcdd('0x3')](_0x49d70b,_0x5e7cff);};}function removeListener(_0x38c955,_0x1119ba){return function(){TeamEvents[_0xbcdd('0x4')](_0x38c955,_0x1119ba);};}exports['register']=function(_0x1ee9da){for(var _0x5d9553=0x0,_0x1d00d4=events[_0xbcdd('0x5')];_0x5d9553<_0x1d00d4;_0x5d9553++){var _0x586e64=events[_0x5d9553];var _0x46f26c=createListener(_0xbcdd('0x6')+_0x586e64,_0x1ee9da);TeamEvents['on'](_0x586e64,_0x46f26c);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 95fb1cc..786c3df 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 _0xdc6e=['show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./template.controller','get','isAuthenticated','index','/:id'];(function(_0x1f7a00,_0x341591){var _0x4b151c=function(_0x51fceb){while(--_0x51fceb){_0x1f7a00['push'](_0x1f7a00['shift']());}};_0x4b151c(++_0x341591);}(_0xdc6e,0x137));var _0xedc6=function(_0x22743d,_0x1cee11){_0x22743d=_0x22743d-0x0;var _0x3d51f0=_0xdc6e[_0x22743d];return _0x3d51f0;};'use strict';var multer=require(_0xedc6('0x0'));var util=require(_0xedc6('0x1'));var path=require(_0xedc6('0x2'));var timeout=require(_0xedc6('0x3'));var express=require(_0xedc6('0x4'));var router=express[_0xedc6('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xedc6('0x6'));var controller=require(_0xedc6('0x7'));router[_0xedc6('0x8')]('/',auth[_0xedc6('0x9')](),controller[_0xedc6('0xa')]);router[_0xedc6('0x8')](_0xedc6('0xb'),auth['isAuthenticated'](),controller[_0xedc6('0xc')]);router[_0xedc6('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xedc6('0xe')](_0xedc6('0xb'),auth['isAuthenticated'](),controller[_0xedc6('0xf')]);router[_0xedc6('0x10')](_0xedc6('0xb'),auth[_0xedc6('0x9')](),controller[_0xedc6('0x11')]);module[_0xedc6('0x12')]=router; \ No newline at end of file +var _0x77cc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','delete','destroy','exports','multer','path','express'];(function(_0x28d7c4,_0x197dfc){var _0x2f51cf=function(_0x4ea249){while(--_0x4ea249){_0x28d7c4['push'](_0x28d7c4['shift']());}};_0x2f51cf(++_0x197dfc);}(_0x77cc,0x1ed));var _0xc77c=function(_0x32a89b,_0xc3b8e2){_0x32a89b=_0x32a89b-0x0;var _0x119ba5=_0x77cc[_0x32a89b];return _0x119ba5;};'use strict';var multer=require(_0xc77c('0x0'));var util=require('util');var path=require(_0xc77c('0x1'));var timeout=require('connect-timeout');var express=require(_0xc77c('0x2'));var router=express[_0xc77c('0x3')]();var auth=require(_0xc77c('0x4'));var interaction=require(_0xc77c('0x5'));var config=require(_0xc77c('0x6'));var controller=require('./template.controller');router['get']('/',auth[_0xc77c('0x7')](),controller[_0xc77c('0x8')]);router[_0xc77c('0x9')](_0xc77c('0xa'),auth[_0xc77c('0x7')](),controller[_0xc77c('0xb')]);router[_0xc77c('0xc')]('/',auth[_0xc77c('0x7')](),controller['create']);router['put']('/:id',auth[_0xc77c('0x7')](),controller['update']);router[_0xc77c('0xd')](_0xc77c('0xa'),auth[_0xc77c('0x7')](),controller[_0xc77c('0xe')]);module[_0xc77c('0xf')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 94277ed..86cae97 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 _0x96a0=['exports','STRING','sequelize'];(function(_0x494f7f,_0x34a09b){var _0x18ebe4=function(_0x178e2e){while(--_0x178e2e){_0x494f7f['push'](_0x494f7f['shift']());}};_0x18ebe4(++_0x34a09b);}(_0x96a0,0x1c1));var _0x096a=function(_0x30576c,_0xee6119){_0x30576c=_0x30576c-0x0;var _0x5d1bbd=_0x96a0[_0x30576c];return _0x5d1bbd;};'use strict';var Sequelize=require(_0x096a('0x0'));module[_0x096a('0x1')]={'name':{'type':Sequelize[_0x096a('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xcc78=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc78,0xdb));var _0x8cc7=function(_0x59790c,_0x3f21a9){_0x59790c=_0x59790c-0x0;var _0x58ae3a=_0xcc78[_0x59790c];return _0x58ae3a;};'use strict';var Sequelize=require(_0x8cc7('0x0'));module[_0x8cc7('0x1')]={'name':{'type':Sequelize[_0x8cc7('0x2')]},'description':{'type':Sequelize[_0x8cc7('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 133b826..737f631 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 _0xd083=['update','then','destroy','Templates','stack','name','index','map','Template','fieldName','type','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','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/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','save'];(function(_0x3fb061,_0x2fe233){var _0x5c1384=function(_0x5509b1){while(--_0x5509b1){_0x3fb061['push'](_0x3fb061['shift']());}};_0x5c1384(++_0x2fe233);}(_0xd083,0x1b1));var _0x3d08=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xd083[_0x2e4cbf];return _0x52840f;};'use strict';var pdf=require(_0x3d08('0x0'));var emlformat=require(_0x3d08('0x1'));var rimraf=require(_0x3d08('0x2'));var zipdir=require(_0x3d08('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d08('0x4'));var moment=require('moment');var BPromise=require(_0x3d08('0x5'));var Mustache=require(_0x3d08('0x6'));var util=require(_0x3d08('0x7'));var path=require('path');var sox=require(_0x3d08('0x8'));var csv=require(_0x3d08('0x9'));var ejs=require(_0x3d08('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d08('0xb'));var crypto=require(_0x3d08('0xc'));var jsforce=require(_0x3d08('0xd'));var deskjs=require(_0x3d08('0xe'));var toCsv=require(_0x3d08('0x9'));var querystring=require(_0x3d08('0xf'));var Papa=require(_0x3d08('0x10'));var Redis=require(_0x3d08('0x11'));var authService=require(_0x3d08('0x12'));var qs=require(_0x3d08('0x13'));var as=require(_0x3d08('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d08('0x15'))(_0x3d08('0x16'));var utils=require(_0x3d08('0x17'));var config=require(_0x3d08('0x18'));var db=require(_0x3d08('0x19'))['db'];function respondWithStatusCode(_0x35b8df,_0x583764){_0x583764=_0x583764||0xcc;return function(_0x3672d2){if(_0x3672d2){return _0x35b8df[_0x3d08('0x1a')](_0x583764);}return _0x35b8df[_0x3d08('0x1b')](_0x583764)[_0x3d08('0x1c')]();};}function respondWithResult(_0x303228,_0x5a39e4){_0x5a39e4=_0x5a39e4||0xc8;return function(_0x257bde){if(_0x257bde){return _0x303228[_0x3d08('0x1b')](_0x5a39e4)[_0x3d08('0x1d')](_0x257bde);}};}function respondWithFilteredResult(_0x3a0bf8,_0x3ef748){return function(_0x8b438c){if(_0x8b438c){var _0x23db8c=_0x8b438c['count'],_0x292a98=_0x3ef748[_0x3d08('0x1e')],_0xd6d4bc=_0x3ef748[_0x3d08('0x1e')]+_0x3ef748[_0x3d08('0x1f')],_0x371445;if(_0xd6d4bc>=_0x23db8c){_0xd6d4bc=_0x23db8c;_0x371445=0xc8;}else{_0x371445=0xce;}_0x3a0bf8[_0x3d08('0x1b')](_0x371445);return _0x3a0bf8[_0x3d08('0x20')](_0x3d08('0x21'),_0x292a98+'-'+_0xd6d4bc+'/'+_0x23db8c)[_0x3d08('0x1d')](_0x8b438c);}return null;};}function patchUpdates(_0x1965d7){return function(_0x99d694){try{jsonpatch['apply'](_0x99d694,_0x1965d7,!![]);}catch(_0x3d286a){return BPromise['reject'](_0x3d286a);}return _0x99d694[_0x3d08('0x22')]();};}function saveUpdates(_0x58715c,_0x12d58a){return function(_0x33a449){if(_0x33a449){return _0x33a449[_0x3d08('0x23')](_0x58715c)[_0x3d08('0x24')](function(_0x3d3ef2){return _0x3d3ef2;});}return null;};}function removeEntity(_0x2c5905,_0x146b2a){return function(_0x38b686){if(_0x38b686){return _0x38b686[_0x3d08('0x25')]()['then'](function(){var _0x4ef592=_0x38b686['get']({'plain':!![]});var _0x2dd6f0=_0x3d08('0x26');return db['UserProfileResource'][_0x3d08('0x25')]({'where':{'type':_0x2dd6f0,'resourceId':_0x4ef592['id']}})[_0x3d08('0x24')](function(){return _0x38b686;});})[_0x3d08('0x24')](function(){_0x2c5905[_0x3d08('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38559d,_0x5dafaa){return function(_0x19d885){if(!_0x19d885){_0x38559d[_0x3d08('0x1a')](0x194);}return _0x19d885;};}function handleError(_0x5b43af,_0x3ba87f){_0x3ba87f=_0x3ba87f||0x1f4;return function(_0x1a6a00){logger['error'](_0x1a6a00[_0x3d08('0x27')]);if(_0x1a6a00[_0x3d08('0x28')]){delete _0x1a6a00[_0x3d08('0x28')];}_0x5b43af[_0x3d08('0x1b')](_0x3ba87f)['send'](_0x1a6a00);};}exports[_0x3d08('0x29')]=function(_0x320343,_0x54f8a1){var _0x57fca4={},_0x460cd6={},_0x5b91a7={'count':0x0,'rows':[]};var _0x5a441d=_[_0x3d08('0x2a')](db[_0x3d08('0x2b')]['rawAttributes'],function(_0x4b9b57){return{'name':_0x4b9b57[_0x3d08('0x2c')],'type':_0x4b9b57[_0x3d08('0x2d')]['key']};});_0x460cd6[_0x3d08('0x2e')]=_[_0x3d08('0x2a')](_0x5a441d,_0x3d08('0x28'));_0x460cd6[_0x3d08('0x2f')]=_['keys'](_0x320343['query']);_0x460cd6[_0x3d08('0x30')]=_['intersection'](_0x460cd6['model'],_0x460cd6[_0x3d08('0x2f')]);_0x57fca4[_0x3d08('0x31')]=_[_0x3d08('0x32')](_0x460cd6[_0x3d08('0x2e')],qs[_0x3d08('0x33')](_0x320343[_0x3d08('0x2f')][_0x3d08('0x33')]));_0x57fca4['attributes']=_0x57fca4['attributes'][_0x3d08('0x34')]?_0x57fca4['attributes']:_0x460cd6[_0x3d08('0x2e')];if(!_0x320343[_0x3d08('0x2f')]['hasOwnProperty'](_0x3d08('0x35'))){_0x57fca4[_0x3d08('0x1f')]=qs['limit'](_0x320343[_0x3d08('0x2f')]['limit']);_0x57fca4[_0x3d08('0x1e')]=qs[_0x3d08('0x1e')](_0x320343[_0x3d08('0x2f')][_0x3d08('0x1e')]);}_0x57fca4[_0x3d08('0x36')]=qs[_0x3d08('0x37')](_0x320343[_0x3d08('0x2f')][_0x3d08('0x37')]);_0x57fca4[_0x3d08('0x38')]=qs[_0x3d08('0x30')](_[_0x3d08('0x39')](_0x320343['query'],_0x460cd6['filters']),_0x5a441d);if(_0x320343[_0x3d08('0x2f')][_0x3d08('0x3a')]){_0x57fca4['where']=_['merge'](_0x57fca4[_0x3d08('0x38')],{'$or':_[_0x3d08('0x2a')](_0x5a441d,function(_0x4bf94a){if(_0x4bf94a[_0x3d08('0x2d')]!==_0x3d08('0x3b')){var _0x355cf8={};_0x355cf8[_0x4bf94a['name']]={'$like':'%'+_0x320343[_0x3d08('0x2f')][_0x3d08('0x3a')]+'%'};return _0x355cf8;}})});}_0x57fca4=_[_0x3d08('0x3c')]({},_0x57fca4,_0x320343[_0x3d08('0x3d')]);var _0x48a278={'where':_0x57fca4[_0x3d08('0x38')]};return db['Template'][_0x3d08('0x3e')](_0x48a278)[_0x3d08('0x24')](function(_0x58a793){_0x5b91a7['count']=_0x58a793;if(_0x320343[_0x3d08('0x2f')][_0x3d08('0x3f')]){_0x57fca4[_0x3d08('0x40')]=[{'all':!![]}];}return db[_0x3d08('0x2b')]['findAll'](_0x57fca4);})[_0x3d08('0x24')](function(_0x1cb3d2){_0x5b91a7[_0x3d08('0x41')]=_0x1cb3d2;return _0x5b91a7;})[_0x3d08('0x24')](respondWithFilteredResult(_0x54f8a1,_0x57fca4))[_0x3d08('0x42')](handleError(_0x54f8a1,null));};exports[_0x3d08('0x43')]=function(_0x5b86ad,_0x19d467){var _0x264108={'raw':!![],'where':{'id':_0x5b86ad['params']['id']}},_0x70ce67={};_0x70ce67[_0x3d08('0x2e')]=_[_0x3d08('0x44')](db[_0x3d08('0x2b')][_0x3d08('0x45')]);_0x70ce67[_0x3d08('0x2f')]=_[_0x3d08('0x44')](_0x5b86ad[_0x3d08('0x2f')]);_0x70ce67[_0x3d08('0x30')]=_['intersection'](_0x70ce67['model'],_0x70ce67['query']);_0x264108[_0x3d08('0x31')]=_['intersection'](_0x70ce67[_0x3d08('0x2e')],qs['fields'](_0x5b86ad['query'][_0x3d08('0x33')]));_0x264108[_0x3d08('0x31')]=_0x264108[_0x3d08('0x31')]['length']?_0x264108[_0x3d08('0x31')]:_0x70ce67['model'];if(_0x5b86ad[_0x3d08('0x2f')][_0x3d08('0x3f')]){_0x264108[_0x3d08('0x40')]=[{'all':!![]}];}_0x264108=_['merge']({},_0x264108,_0x5b86ad[_0x3d08('0x3d')]);return db[_0x3d08('0x2b')][_0x3d08('0x46')](_0x264108)['then'](handleEntityNotFound(_0x19d467,null))[_0x3d08('0x24')](respondWithResult(_0x19d467,null))[_0x3d08('0x42')](handleError(_0x19d467,null));};exports[_0x3d08('0x47')]=function(_0x49d8de,_0x4012bf){return db['Template']['create'](_0x49d8de['body'],{})['then'](function(_0x2fe309){var _0xcdb666=_0x49d8de['user'][_0x3d08('0x48')]({'plain':!![]});if(!_0xcdb666)throw new Error(_0x3d08('0x49'));if(_0xcdb666['role']==='user'){var _0x758c71=_0x2fe309[_0x3d08('0x48')]({'plain':!![]});var _0x31a976=_0x3d08('0x26');return db[_0x3d08('0x4a')][_0x3d08('0x46')]({'where':{'name':_0x31a976,'userProfileId':_0xcdb666['userProfileId']},'raw':!![]})['then'](function(_0x54c94e){if(_0x54c94e&&_0x54c94e['autoAssociation']===0x0){return db['UserProfileResource'][_0x3d08('0x47')]({'name':_0x758c71[_0x3d08('0x28')],'resourceId':_0x758c71['id'],'type':_0x54c94e[_0x3d08('0x28')],'sectionId':_0x54c94e['id']},{})[_0x3d08('0x24')](function(){return _0x2fe309;});}else{return _0x2fe309;}})['catch'](function(_0x16d25e){logger[_0x3d08('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16d25e);throw _0x16d25e;});}return _0x2fe309;})[_0x3d08('0x24')](respondWithResult(_0x4012bf,0xc9))[_0x3d08('0x42')](handleError(_0x4012bf,null));};exports[_0x3d08('0x23')]=function(_0x18b54d,_0x5d924c){if(_0x18b54d['body']['id']){delete _0x18b54d[_0x3d08('0x4c')]['id'];}return db[_0x3d08('0x2b')][_0x3d08('0x46')]({'where':{'id':_0x18b54d[_0x3d08('0x4d')]['id']}})[_0x3d08('0x24')](handleEntityNotFound(_0x5d924c,null))[_0x3d08('0x24')](saveUpdates(_0x18b54d[_0x3d08('0x4c')],null))[_0x3d08('0x24')](respondWithResult(_0x5d924c,null))[_0x3d08('0x42')](handleError(_0x5d924c,null));};exports[_0x3d08('0x25')]=function(_0x4bacda,_0x43106d){return db['Template'][_0x3d08('0x46')]({'where':{'id':_0x4bacda['params']['id']}})['then'](handleEntityNotFound(_0x43106d,null))[_0x3d08('0x24')](removeEntity(_0x43106d,null))[_0x3d08('0x42')](handleError(_0x43106d,null));}; \ No newline at end of file +var _0xead1=['show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','Templates','UserProfileResource','end','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch'];(function(_0x10d020,_0x594e14){var _0x3c5ae7=function(_0x58c23b){while(--_0x58c23b){_0x10d020['push'](_0x10d020['shift']());}};_0x3c5ae7(++_0x594e14);}(_0xead1,0xff));var _0x1ead=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xead1[_0x481bf7];return _0x461787;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1ead('0x0'));var zipdir=require(_0x1ead('0x1'));var jsonpatch=require(_0x1ead('0x2'));var rp=require(_0x1ead('0x3'));var moment=require(_0x1ead('0x4'));var BPromise=require(_0x1ead('0x5'));var Mustache=require('mustache');var util=require(_0x1ead('0x6'));var path=require('path');var sox=require(_0x1ead('0x7'));var csv=require(_0x1ead('0x8'));var ejs=require(_0x1ead('0x9'));var fs=require('fs');var _=require(_0x1ead('0xa'));var squel=require('squel');var crypto=require(_0x1ead('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1ead('0xc'));var toCsv=require(_0x1ead('0x8'));var querystring=require(_0x1ead('0xd'));var Papa=require(_0x1ead('0xe'));var Redis=require('ioredis');var authService=require(_0x1ead('0xf'));var qs=require(_0x1ead('0x10'));var as=require(_0x1ead('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ead('0x12'))('api');var utils=require(_0x1ead('0x13'));var config=require(_0x1ead('0x14'));var db=require(_0x1ead('0x15'))['db'];function respondWithStatusCode(_0x4ebcd2,_0x4568fd){_0x4568fd=_0x4568fd||0xcc;return function(_0x333306){if(_0x333306){return _0x4ebcd2[_0x1ead('0x16')](_0x4568fd);}return _0x4ebcd2[_0x1ead('0x17')](_0x4568fd)['end']();};}function respondWithResult(_0x34785e,_0x26137e){_0x26137e=_0x26137e||0xc8;return function(_0x739ac1){if(_0x739ac1){return _0x34785e['status'](_0x26137e)[_0x1ead('0x18')](_0x739ac1);}};}function respondWithFilteredResult(_0x196995,_0x4dadad){return function(_0x4344b3){if(_0x4344b3){var _0x510b48=_0x4344b3[_0x1ead('0x19')],_0x32b3b6=_0x4dadad[_0x1ead('0x1a')],_0x42dbb0=_0x4dadad[_0x1ead('0x1a')]+_0x4dadad[_0x1ead('0x1b')],_0x4e6b06;if(_0x42dbb0>=_0x510b48){_0x42dbb0=_0x510b48;_0x4e6b06=0xc8;}else{_0x4e6b06=0xce;}_0x196995['status'](_0x4e6b06);return _0x196995['set'](_0x1ead('0x1c'),_0x32b3b6+'-'+_0x42dbb0+'/'+_0x510b48)[_0x1ead('0x18')](_0x4344b3);}return null;};}function patchUpdates(_0x41724b){return function(_0x31a744){try{jsonpatch[_0x1ead('0x1d')](_0x31a744,_0x41724b,!![]);}catch(_0x350685){return BPromise[_0x1ead('0x1e')](_0x350685);}return _0x31a744['save']();};}function saveUpdates(_0x290e9f,_0x44b4da){return function(_0x33241b){if(_0x33241b){return _0x33241b[_0x1ead('0x1f')](_0x290e9f)['then'](function(_0x4f616b){return _0x4f616b;});}return null;};}function removeEntity(_0xd074c5,_0x2ba15c){return function(_0x5161cf){if(_0x5161cf){return _0x5161cf[_0x1ead('0x20')]()[_0x1ead('0x21')](function(){var _0x2706ee=_0x5161cf['get']({'plain':!![]});var _0x489069=_0x1ead('0x22');return db[_0x1ead('0x23')]['destroy']({'where':{'type':_0x489069,'resourceId':_0x2706ee['id']}})[_0x1ead('0x21')](function(){return _0x5161cf;});})[_0x1ead('0x21')](function(){_0xd074c5['status'](0xcc)[_0x1ead('0x24')]();});}};}function handleEntityNotFound(_0x5779a7,_0xd80b26){return function(_0x39375f){if(!_0x39375f){_0x5779a7[_0x1ead('0x16')](0x194);}return _0x39375f;};}function handleError(_0x12166b,_0x32e01d){_0x32e01d=_0x32e01d||0x1f4;return function(_0x4a9e00){logger[_0x1ead('0x25')](_0x4a9e00[_0x1ead('0x26')]);if(_0x4a9e00[_0x1ead('0x27')]){delete _0x4a9e00[_0x1ead('0x27')];}_0x12166b[_0x1ead('0x17')](_0x32e01d)[_0x1ead('0x28')](_0x4a9e00);};}exports[_0x1ead('0x29')]=function(_0x76fed4,_0x2dbe1c){var _0x4b79da={},_0x4f154f={},_0x25020d={'count':0x0,'rows':[]};var _0xeaabed=_[_0x1ead('0x2a')](db[_0x1ead('0x2b')][_0x1ead('0x2c')],function(_0x1a7e87){return{'name':_0x1a7e87[_0x1ead('0x2d')],'type':_0x1a7e87[_0x1ead('0x2e')][_0x1ead('0x2f')]};});_0x4f154f[_0x1ead('0x30')]=_[_0x1ead('0x2a')](_0xeaabed,_0x1ead('0x27'));_0x4f154f[_0x1ead('0x31')]=_[_0x1ead('0x32')](_0x76fed4[_0x1ead('0x31')]);_0x4f154f[_0x1ead('0x33')]=_['intersection'](_0x4f154f[_0x1ead('0x30')],_0x4f154f['query']);_0x4b79da[_0x1ead('0x34')]=_[_0x1ead('0x35')](_0x4f154f[_0x1ead('0x30')],qs['fields'](_0x76fed4['query'][_0x1ead('0x36')]));_0x4b79da[_0x1ead('0x34')]=_0x4b79da[_0x1ead('0x34')][_0x1ead('0x37')]?_0x4b79da[_0x1ead('0x34')]:_0x4f154f[_0x1ead('0x30')];if(!_0x76fed4['query'][_0x1ead('0x38')](_0x1ead('0x39'))){_0x4b79da[_0x1ead('0x1b')]=qs[_0x1ead('0x1b')](_0x76fed4[_0x1ead('0x31')][_0x1ead('0x1b')]);_0x4b79da['offset']=qs[_0x1ead('0x1a')](_0x76fed4[_0x1ead('0x31')][_0x1ead('0x1a')]);}_0x4b79da[_0x1ead('0x3a')]=qs['sort'](_0x76fed4[_0x1ead('0x31')][_0x1ead('0x3b')]);_0x4b79da[_0x1ead('0x3c')]=qs[_0x1ead('0x33')](_[_0x1ead('0x3d')](_0x76fed4['query'],_0x4f154f[_0x1ead('0x33')]),_0xeaabed);if(_0x76fed4['query'][_0x1ead('0x3e')]){_0x4b79da['where']=_[_0x1ead('0x3f')](_0x4b79da[_0x1ead('0x3c')],{'$or':_[_0x1ead('0x2a')](_0xeaabed,function(_0x2c421b){if(_0x2c421b[_0x1ead('0x2e')]!==_0x1ead('0x40')){var _0x1a8652={};_0x1a8652[_0x2c421b[_0x1ead('0x27')]]={'$like':'%'+_0x76fed4['query'][_0x1ead('0x3e')]+'%'};return _0x1a8652;}})});}_0x4b79da=_[_0x1ead('0x3f')]({},_0x4b79da,_0x76fed4[_0x1ead('0x41')]);var _0x1a809={'where':_0x4b79da[_0x1ead('0x3c')]};return db[_0x1ead('0x2b')][_0x1ead('0x19')](_0x1a809)['then'](function(_0x1a215e){_0x25020d[_0x1ead('0x19')]=_0x1a215e;if(_0x76fed4[_0x1ead('0x31')][_0x1ead('0x42')]){_0x4b79da[_0x1ead('0x43')]=[{'all':!![]}];}return db[_0x1ead('0x2b')]['findAll'](_0x4b79da);})[_0x1ead('0x21')](function(_0x2541a1){_0x25020d['rows']=_0x2541a1;return _0x25020d;})[_0x1ead('0x21')](respondWithFilteredResult(_0x2dbe1c,_0x4b79da))[_0x1ead('0x44')](handleError(_0x2dbe1c,null));};exports[_0x1ead('0x45')]=function(_0x16d51d,_0x33ccf4){var _0x1b1d20={'raw':!![],'where':{'id':_0x16d51d[_0x1ead('0x46')]['id']}},_0x38e51d={};_0x38e51d['model']=_[_0x1ead('0x32')](db[_0x1ead('0x2b')][_0x1ead('0x2c')]);_0x38e51d[_0x1ead('0x31')]=_['keys'](_0x16d51d['query']);_0x38e51d['filters']=_[_0x1ead('0x35')](_0x38e51d['model'],_0x38e51d[_0x1ead('0x31')]);_0x1b1d20['attributes']=_[_0x1ead('0x35')](_0x38e51d[_0x1ead('0x30')],qs[_0x1ead('0x36')](_0x16d51d[_0x1ead('0x31')][_0x1ead('0x36')]));_0x1b1d20[_0x1ead('0x34')]=_0x1b1d20[_0x1ead('0x34')][_0x1ead('0x37')]?_0x1b1d20['attributes']:_0x38e51d[_0x1ead('0x30')];if(_0x16d51d[_0x1ead('0x31')][_0x1ead('0x42')]){_0x1b1d20[_0x1ead('0x43')]=[{'all':!![]}];}_0x1b1d20=_[_0x1ead('0x3f')]({},_0x1b1d20,_0x16d51d['options']);return db['Template'][_0x1ead('0x47')](_0x1b1d20)['then'](handleEntityNotFound(_0x33ccf4,null))[_0x1ead('0x21')](respondWithResult(_0x33ccf4,null))[_0x1ead('0x44')](handleError(_0x33ccf4,null));};exports['create']=function(_0x3cda08,_0x48b1ac){return db[_0x1ead('0x2b')][_0x1ead('0x48')](_0x3cda08[_0x1ead('0x49')],{})[_0x1ead('0x21')](function(_0x86a2c0){var _0x3feb73=_0x3cda08['user']['get']({'plain':!![]});if(!_0x3feb73)throw new Error(_0x1ead('0x4a'));if(_0x3feb73[_0x1ead('0x4b')]===_0x1ead('0x4c')){var _0x3d5599=_0x86a2c0[_0x1ead('0x4d')]({'plain':!![]});var _0x5a8d0d=_0x1ead('0x22');return db[_0x1ead('0x4e')][_0x1ead('0x47')]({'where':{'name':_0x5a8d0d,'userProfileId':_0x3feb73['userProfileId']},'raw':!![]})[_0x1ead('0x21')](function(_0x4df846){if(_0x4df846&&_0x4df846[_0x1ead('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3d5599[_0x1ead('0x27')],'resourceId':_0x3d5599['id'],'type':_0x4df846[_0x1ead('0x27')],'sectionId':_0x4df846['id']},{})[_0x1ead('0x21')](function(){return _0x86a2c0;});}else{return _0x86a2c0;}})[_0x1ead('0x44')](function(_0x4e241f){logger[_0x1ead('0x25')](_0x1ead('0x50'),_0x4e241f);throw _0x4e241f;});}return _0x86a2c0;})[_0x1ead('0x21')](respondWithResult(_0x48b1ac,0xc9))[_0x1ead('0x44')](handleError(_0x48b1ac,null));};exports[_0x1ead('0x1f')]=function(_0x54f4a6,_0x2ee42a){if(_0x54f4a6[_0x1ead('0x49')]['id']){delete _0x54f4a6[_0x1ead('0x49')]['id'];}return db['Template'][_0x1ead('0x47')]({'where':{'id':_0x54f4a6[_0x1ead('0x46')]['id']}})[_0x1ead('0x21')](handleEntityNotFound(_0x2ee42a,null))['then'](saveUpdates(_0x54f4a6[_0x1ead('0x49')],null))[_0x1ead('0x21')](respondWithResult(_0x2ee42a,null))[_0x1ead('0x44')](handleError(_0x2ee42a,null));};exports[_0x1ead('0x20')]=function(_0x217f08,_0x1a8526){return db[_0x1ead('0x2b')][_0x1ead('0x47')]({'where':{'id':_0x217f08[_0x1ead('0x46')]['id']}})['then'](handleEntityNotFound(_0x1a8526,null))[_0x1ead('0x21')](removeEntity(_0x1a8526,null))['catch'](handleError(_0x1a8526,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 5de8bbb..0e39595 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 _0x32ec=['bluebird','request-promise','Template','tools_templates','util','../../config/logger','api'];(function(_0x23bd00,_0x198ccf){var _0x1c7d0c=function(_0x4cba00){while(--_0x4cba00){_0x23bd00['push'](_0x23bd00['shift']());}};_0x1c7d0c(++_0x198ccf);}(_0x32ec,0xba));var _0xc32e=function(_0x27b37e,_0x34301b){_0x27b37e=_0x27b37e-0x0;var _0x3bc3eb=_0x32ec[_0x27b37e];return _0x3bc3eb;};'use strict';var _=require('lodash');var util=require(_0xc32e('0x0'));var logger=require(_0xc32e('0x1'))(_0xc32e('0x2'));var moment=require('moment');var BPromise=require(_0xc32e('0x3'));var rp=require(_0xc32e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./template.attributes');module['exports']=function(_0x37ab62,_0x3fedef){return _0x37ab62['define'](_0xc32e('0x5'),attributes,{'tableName':_0xc32e('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10e7=['rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x27773e,_0x1fb5bd){var _0x24895c=function(_0x2c240d){while(--_0x2c240d){_0x27773e['push'](_0x27773e['shift']());}};_0x24895c(++_0x1fb5bd);}(_0x10e7,0x6f));var _0x710e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x10e7[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x710e('0x0'));var util=require(_0x710e('0x1'));var logger=require(_0x710e('0x2'))(_0x710e('0x3'));var moment=require(_0x710e('0x4'));var BPromise=require(_0x710e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x710e('0x6'));var config=require(_0x710e('0x7'));var attributes=require(_0x710e('0x8'));module[_0x710e('0x9')]=function(_0x5bf7cb,_0x378caa){return _0x5bf7cb[_0x710e('0xa')](_0x710e('0xb'),attributes,{'tableName':_0x710e('0xc'),'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 0820321..a558785 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 _0x0db2=['util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetTemplate','Template','findAll','options','where','attributes','limit','include','model','map','debug','lodash'];(function(_0x1cd29c,_0x331a03){var _0x440f42=function(_0x20d67a){while(--_0x20d67a){_0x1cd29c['push'](_0x1cd29c['shift']());}};_0x440f42(++_0x331a03);}(_0x0db2,0x116));var _0x20db=function(_0x4c40ff,_0x358e89){_0x4c40ff=_0x4c40ff-0x0;var _0x552ec9=_0x0db2[_0x4c40ff];return _0x552ec9;};'use strict';var _=require(_0x20db('0x0'));var util=require(_0x20db('0x1'));var moment=require('moment');var BPromise=require(_0x20db('0x2'));var rs=require(_0x20db('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x20db('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x20db('0x5'))(_0x20db('0x6'));var config=require(_0x20db('0x7'));var jayson=require(_0x20db('0x8'));var client=jayson[_0x20db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a734,_0x37b2c5,_0x10826e){return new BPromise(function(_0x441967,_0x474de2){return client['request'](_0x30a734,_0x10826e)[_0x20db('0xa')](function(_0x1edaf2){logger[_0x20db('0xb')](_0x20db('0xc'),_0x37b2c5,_0x20db('0xd'));logger['debug'](_0x20db('0xe'),_0x37b2c5,_0x20db('0xd'),JSON[_0x20db('0xf')](_0x1edaf2));if(_0x1edaf2[_0x20db('0x10')]){if(_0x1edaf2[_0x20db('0x10')]['code']===0x1f4){logger[_0x20db('0x10')](_0x20db('0xc'),_0x37b2c5,_0x1edaf2[_0x20db('0x10')][_0x20db('0x11')]);return _0x474de2(_0x1edaf2['error'][_0x20db('0x11')]);}logger[_0x20db('0x10')]('Template,\x20%s,\x20%s',_0x37b2c5,_0x1edaf2[_0x20db('0x10')][_0x20db('0x11')]);return _0x441967(_0x1edaf2[_0x20db('0x10')][_0x20db('0x11')]);}else{logger[_0x20db('0xb')](_0x20db('0xc'),_0x37b2c5,'request\x20sent');_0x441967(_0x1edaf2[_0x20db('0x12')][_0x20db('0x11')]);}})[_0x20db('0x13')](function(_0x3e5c17){logger[_0x20db('0x10')](_0x20db('0xc'),_0x37b2c5,_0x3e5c17);_0x474de2(_0x3e5c17);});});}exports[_0x20db('0x14')]=function(_0x22541b){var _0x342e2a=this;return new Promise(function(_0xd82b2f,_0x4da9ab){return db[_0x20db('0x15')][_0x20db('0x16')]({'raw':_0x22541b[_0x20db('0x17')]?_0x22541b[_0x20db('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x22541b[_0x20db('0x17')]?_0x22541b[_0x20db('0x17')][_0x20db('0x18')]||null:null,'attributes':_0x22541b[_0x20db('0x17')]?_0x22541b[_0x20db('0x17')][_0x20db('0x19')]||null:null,'limit':_0x22541b[_0x20db('0x17')]?_0x22541b['options'][_0x20db('0x1a')]||null:null,'include':_0x22541b[_0x20db('0x17')]?_0x22541b[_0x20db('0x17')][_0x20db('0x1b')]?_['map'](_0x22541b['options'][_0x20db('0x1b')],function(_0x1ceab6){return{'model':db[_0x1ceab6[_0x20db('0x1c')]],'as':_0x1ceab6['as'],'attributes':_0x1ceab6[_0x20db('0x19')],'include':_0x1ceab6['include']?_[_0x20db('0x1d')](_0x1ceab6['include'],function(_0x1eeea4){return{'model':db[_0x1eeea4[_0x20db('0x1c')]],'as':_0x1eeea4['as'],'attributes':_0x1eeea4[_0x20db('0x19')],'include':_0x1eeea4[_0x20db('0x1b')]?_[_0x20db('0x1d')](_0x1eeea4[_0x20db('0x1b')],function(_0x27c20b){return{'model':db[_0x27c20b[_0x20db('0x1c')]],'as':_0x27c20b['as'],'attributes':_0x27c20b[_0x20db('0x19')]};}):[]};}):[]};}):[]:[]})[_0x20db('0xa')](function(_0x3a60a6){logger[_0x20db('0xb')](_0x20db('0x14'),_0x22541b);logger[_0x20db('0x1e')](_0x20db('0x14'),_0x22541b,JSON[_0x20db('0xf')](_0x3a60a6));_0xd82b2f(_0x3a60a6);})[_0x20db('0x13')](function(_0x4593e5){logger[_0x20db('0x10')](_0x20db('0x14'),_0x4593e5[_0x20db('0x11')],_0x22541b);_0x4da9ab(_0x342e2a[_0x20db('0x10')](0x1f4,_0x4593e5['message']));});});}; \ No newline at end of file +var _0x5550=['limit','include','map','model','attributes','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','findAll','options','raw','where'];(function(_0x1bc750,_0x23f442){var _0xcd51da=function(_0x323854){while(--_0x323854){_0x1bc750['push'](_0x1bc750['shift']());}};_0xcd51da(++_0x23f442);}(_0x5550,0x179));var _0x0555=function(_0x1cbb99,_0x33d4e0){_0x1cbb99=_0x1cbb99-0x0;var _0x1ee9c1=_0x5550[_0x1cbb99];return _0x1ee9c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0555('0x0'));var rs=require(_0x0555('0x1'));var fs=require('fs');var Redis=require(_0x0555('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0555('0x3'))(_0x0555('0x4'));var config=require(_0x0555('0x5'));var jayson=require(_0x0555('0x6'));var client=jayson[_0x0555('0x7')][_0x0555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa5cf01,_0x4c38a4,_0x57c2db){return new BPromise(function(_0x11486a,_0x5be5e1){return client[_0x0555('0x9')](_0xa5cf01,_0x57c2db)[_0x0555('0xa')](function(_0x533f2e){logger[_0x0555('0xb')]('Template,\x20%s,\x20%s',_0x4c38a4,_0x0555('0xc'));logger[_0x0555('0xd')](_0x0555('0xe'),_0x4c38a4,_0x0555('0xc'),JSON['stringify'](_0x533f2e));if(_0x533f2e[_0x0555('0xf')]){if(_0x533f2e['error'][_0x0555('0x10')]===0x1f4){logger['error'](_0x0555('0x11'),_0x4c38a4,_0x533f2e[_0x0555('0xf')][_0x0555('0x12')]);return _0x5be5e1(_0x533f2e[_0x0555('0xf')]['message']);}logger[_0x0555('0xf')]('Template,\x20%s,\x20%s',_0x4c38a4,_0x533f2e[_0x0555('0xf')]['message']);return _0x11486a(_0x533f2e[_0x0555('0xf')][_0x0555('0x12')]);}else{logger['info'](_0x0555('0x11'),_0x4c38a4,_0x0555('0xc'));_0x11486a(_0x533f2e['result'][_0x0555('0x12')]);}})[_0x0555('0x13')](function(_0x589047){logger[_0x0555('0xf')]('Template,\x20%s,\x20%s',_0x4c38a4,_0x589047);_0x5be5e1(_0x589047);});});}exports[_0x0555('0x14')]=function(_0x11719c){var _0x10cd46=this;return new Promise(function(_0x161b71,_0x21df75){return db[_0x0555('0x15')][_0x0555('0x16')]({'raw':_0x11719c[_0x0555('0x17')]?_0x11719c['options'][_0x0555('0x18')]===undefined?!![]:![]:!![],'where':_0x11719c[_0x0555('0x17')]?_0x11719c[_0x0555('0x17')][_0x0555('0x19')]||null:null,'attributes':_0x11719c['options']?_0x11719c['options']['attributes']||null:null,'limit':_0x11719c[_0x0555('0x17')]?_0x11719c[_0x0555('0x17')][_0x0555('0x1a')]||null:null,'include':_0x11719c[_0x0555('0x17')]?_0x11719c[_0x0555('0x17')][_0x0555('0x1b')]?_[_0x0555('0x1c')](_0x11719c[_0x0555('0x17')][_0x0555('0x1b')],function(_0x26babf){return{'model':db[_0x26babf[_0x0555('0x1d')]],'as':_0x26babf['as'],'attributes':_0x26babf['attributes'],'include':_0x26babf['include']?_['map'](_0x26babf[_0x0555('0x1b')],function(_0x5163ab){return{'model':db[_0x5163ab[_0x0555('0x1d')]],'as':_0x5163ab['as'],'attributes':_0x5163ab[_0x0555('0x1e')],'include':_0x5163ab['include']?_[_0x0555('0x1c')](_0x5163ab[_0x0555('0x1b')],function(_0xbd6eb){return{'model':db[_0xbd6eb['model']],'as':_0xbd6eb['as'],'attributes':_0xbd6eb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56fa7d){logger[_0x0555('0xb')](_0x0555('0x14'),_0x11719c);logger[_0x0555('0xd')](_0x0555('0x14'),_0x11719c,JSON['stringify'](_0x56fa7d));_0x161b71(_0x56fa7d);})[_0x0555('0x13')](function(_0x2668de){logger[_0x0555('0xf')](_0x0555('0x14'),_0x2668de[_0x0555('0x12')],_0x11719c);_0x21df75(_0x10cd46[_0x0555('0xf')](0x1f4,_0x2668de[_0x0555('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index fe9ee58..63b881d 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 _0x85d8=['get','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','index'];(function(_0x522950,_0x589122){var _0x4d6b68=function(_0x51abff){while(--_0x51abff){_0x522950['push'](_0x522950['shift']());}};_0x4d6b68(++_0x589122);}(_0x85d8,0x1b0));var _0x885d=function(_0xe9bd5b,_0x51545f){_0xe9bd5b=_0xe9bd5b-0x0;var _0x1ca402=_0x85d8[_0xe9bd5b];return _0x1ca402;};'use strict';var multer=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var path=require(_0x885d('0x2'));var timeout=require(_0x885d('0x3'));var express=require(_0x885d('0x4'));var router=express['Router']();var auth=require(_0x885d('0x5'));var interaction=require(_0x885d('0x6'));var config=require(_0x885d('0x7'));var controller=require(_0x885d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x885d('0x9')]);router[_0x885d('0xa')](_0x885d('0xb'),auth[_0x885d('0xc')](),controller[_0x885d('0xd')]);router[_0x885d('0xa')](_0x885d('0xe'),auth[_0x885d('0xc')](),controller[_0x885d('0xf')]);router[_0x885d('0xa')](_0x885d('0x10'),auth[_0x885d('0xc')](),controller[_0x885d('0x11')]);router[_0x885d('0xa')](_0x885d('0x12'),auth[_0x885d('0xc')](),controller[_0x885d('0x13')]);router[_0x885d('0x14')]('/',auth[_0x885d('0xc')](),controller['create']);router['post'](_0x885d('0xe'),auth[_0x885d('0xc')](),controller['addAllCondition']);router[_0x885d('0x14')](_0x885d('0x10'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0x885d('0x14')](_0x885d('0x12'),auth[_0x885d('0xc')](),controller[_0x885d('0x15')]);router[_0x885d('0x16')](_0x885d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x885d('0x17')](_0x885d('0xb'),auth[_0x885d('0xc')](),controller[_0x885d('0x18')]);module[_0x885d('0x19')]=router; \ No newline at end of file +var _0x0c7d=['Router','../../components/interaction/service','get','isAuthenticated','index','show','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAction','put','/:id','update','delete','destroy','exports','util','path','express'];(function(_0x42aba3,_0x4ef48f){var _0x33b03c=function(_0x424739){while(--_0x424739){_0x42aba3['push'](_0x42aba3['shift']());}};_0x33b03c(++_0x4ef48f);}(_0x0c7d,0x1e0));var _0xd0c7=function(_0x102b48,_0x1ffa36){_0x102b48=_0x102b48-0x0;var _0x1819c4=_0x0c7d[_0x102b48];return _0x1819c4;};'use strict';var multer=require('multer');var util=require(_0xd0c7('0x0'));var path=require(_0xd0c7('0x1'));var timeout=require('connect-timeout');var express=require(_0xd0c7('0x2'));var router=express[_0xd0c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd0c7('0x4'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xd0c7('0x5')]('/',auth[_0xd0c7('0x6')](),controller[_0xd0c7('0x7')]);router[_0xd0c7('0x5')]('/:id',auth[_0xd0c7('0x6')](),controller[_0xd0c7('0x8')]);router['get'](_0xd0c7('0x9'),auth[_0xd0c7('0x6')](),controller['getAllConditions']);router['get'](_0xd0c7('0xa'),auth['isAuthenticated'](),controller[_0xd0c7('0xb')]);router[_0xd0c7('0x5')](_0xd0c7('0xc'),auth['isAuthenticated'](),controller['getActions']);router[_0xd0c7('0xd')]('/',auth[_0xd0c7('0x6')](),controller[_0xd0c7('0xe')]);router[_0xd0c7('0xd')](_0xd0c7('0x9'),auth[_0xd0c7('0x6')](),controller[_0xd0c7('0xf')]);router['post'](_0xd0c7('0xa'),auth[_0xd0c7('0x6')](),controller['addAnyCondition']);router['post'](_0xd0c7('0xc'),auth[_0xd0c7('0x6')](),controller[_0xd0c7('0x10')]);router[_0xd0c7('0x11')](_0xd0c7('0x12'),auth[_0xd0c7('0x6')](),controller[_0xd0c7('0x13')]);router[_0xd0c7('0x14')](_0xd0c7('0x12'),auth['isAuthenticated'](),controller[_0xd0c7('0x15')]);module[_0xd0c7('0x16')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ac64aa1..d73c9fd 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 _0x4879=['STRING','BOOLEAN','sequelize'];(function(_0x23f810,_0x3b03b3){var _0x2fa9dd=function(_0x358512){while(--_0x358512){_0x23f810['push'](_0x23f810['shift']());}};_0x2fa9dd(++_0x3b03b3);}(_0x4879,0x158));var _0x9487=function(_0x495b0d,_0x1c6aef){_0x495b0d=_0x495b0d-0x0;var _0x1ac214=_0x4879[_0x495b0d];return _0x1ac214;};'use strict';var Sequelize=require(_0x9487('0x0'));module['exports']={'name':{'type':Sequelize[_0x9487('0x1')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9487('0x1')]},'status':{'type':Sequelize[_0x9487('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3a56=['STRING','sequelize','exports'];(function(_0x29edb5,_0x5bdc4f){var _0x3218ee=function(_0x52e3dd){while(--_0x52e3dd){_0x29edb5['push'](_0x29edb5['shift']());}};_0x3218ee(++_0x5bdc4f);}(_0x3a56,0x160));var _0x63a5=function(_0xf93076,_0x1acb30){_0xf93076=_0xf93076-0x0;var _0x33d1da=_0x3a56[_0xf93076];return _0x33d1da;};'use strict';var Sequelize=require(_0x63a5('0x0'));module[_0x63a5('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x63a5('0x2')]},'description':{'type':Sequelize[_0x63a5('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 770f2ad..627c02c 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 _0xff1d=['findOne','getAnyConditions','TriggerId','Action','getActions','html-pdf','eml-format','request-promise','moment','bluebird','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','update','destroy','then','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','TriggerAnyId','getAllConditions'];(function(_0x31f6d4,_0x35b3c7){var _0x5e93fd=function(_0x5174a3){while(--_0x5174a3){_0x31f6d4['push'](_0x31f6d4['shift']());}};_0x5e93fd(++_0x35b3c7);}(_0xff1d,0x10d));var _0xdff1=function(_0x4e3122,_0x3a33d9){_0x4e3122=_0x4e3122-0x0;var _0x339912=_0xff1d[_0x4e3122];return _0x339912;};'use strict';var pdf=require(_0xdff1('0x0'));var emlformat=require(_0xdff1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdff1('0x2'));var moment=require(_0xdff1('0x3'));var BPromise=require(_0xdff1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdff1('0x5'));var sox=require('sox');var csv=require(_0xdff1('0x6'));var ejs=require(_0xdff1('0x7'));var fs=require('fs');var _=require(_0xdff1('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdff1('0x9'));var deskjs=require(_0xdff1('0xa'));var toCsv=require('to-csv');var querystring=require(_0xdff1('0xb'));var Papa=require('papaparse');var Redis=require(_0xdff1('0xc'));var authService=require(_0xdff1('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdff1('0xe'))(_0xdff1('0xf'));var utils=require(_0xdff1('0x10'));var config=require(_0xdff1('0x11'));var db=require(_0xdff1('0x12'))['db'];function respondWithStatusCode(_0x4fd3db,_0x4ef69f){_0x4ef69f=_0x4ef69f||0xcc;return function(_0x14c9df){if(_0x14c9df){return _0x4fd3db[_0xdff1('0x13')](_0x4ef69f);}return _0x4fd3db[_0xdff1('0x14')](_0x4ef69f)[_0xdff1('0x15')]();};}function respondWithResult(_0x5e6b6a,_0x159181){_0x159181=_0x159181||0xc8;return function(_0xd26e68){if(_0xd26e68){return _0x5e6b6a[_0xdff1('0x14')](_0x159181)[_0xdff1('0x16')](_0xd26e68);}};}function respondWithFilteredResult(_0x17a37d,_0x7db59c){return function(_0x279b13){if(_0x279b13){var _0x41f432=_0x279b13[_0xdff1('0x17')],_0x17c777=_0x7db59c[_0xdff1('0x18')],_0x7e0d4=_0x7db59c[_0xdff1('0x18')]+_0x7db59c['limit'],_0x957d5b;if(_0x7e0d4>=_0x41f432){_0x7e0d4=_0x41f432;_0x957d5b=0xc8;}else{_0x957d5b=0xce;}_0x17a37d[_0xdff1('0x14')](_0x957d5b);return _0x17a37d[_0xdff1('0x19')]('Content-Range',_0x17c777+'-'+_0x7e0d4+'/'+_0x41f432)[_0xdff1('0x16')](_0x279b13);}return null;};}function patchUpdates(_0x27c381){return function(_0x5c9105){try{jsonpatch[_0xdff1('0x1a')](_0x5c9105,_0x27c381,!![]);}catch(_0x3d886a){return BPromise[_0xdff1('0x1b')](_0x3d886a);}return _0x5c9105['save']();};}function saveUpdates(_0x5b515c,_0x550e8e){return function(_0x56f7b0){if(_0x56f7b0){return _0x56f7b0[_0xdff1('0x1c')](_0x5b515c)['then'](function(_0xab5434){return _0xab5434;});}return null;};}function removeEntity(_0x255df3,_0x3db6c5){return function(_0x575cce){if(_0x575cce){return _0x575cce[_0xdff1('0x1d')]()[_0xdff1('0x1e')](function(){var _0x279135=_0x575cce['get']({'plain':!![]});var _0xfe9e1b=_0xdff1('0x1f');return db[_0xdff1('0x20')][_0xdff1('0x1d')]({'where':{'type':_0xfe9e1b,'resourceId':_0x279135['id']}})['then'](function(){return _0x575cce;});})[_0xdff1('0x1e')](function(){_0x255df3['status'](0xcc)[_0xdff1('0x15')]();});}};}function handleEntityNotFound(_0x2f3fdd,_0x459cdd){return function(_0x4b57bb){if(!_0x4b57bb){_0x2f3fdd[_0xdff1('0x13')](0x194);}return _0x4b57bb;};}function handleError(_0x1c482b,_0x26dbaf){_0x26dbaf=_0x26dbaf||0x1f4;return function(_0x46310e){logger[_0xdff1('0x21')](_0x46310e[_0xdff1('0x22')]);if(_0x46310e[_0xdff1('0x23')]){delete _0x46310e[_0xdff1('0x23')];}_0x1c482b[_0xdff1('0x14')](_0x26dbaf)[_0xdff1('0x24')](_0x46310e);};}exports[_0xdff1('0x25')]=function(_0x12f1f5,_0x4d8def){var _0x3dabad={},_0x692445={},_0x43a347={'count':0x0,'rows':[]};var _0x3e74af=_[_0xdff1('0x26')](db[_0xdff1('0x27')][_0xdff1('0x28')],function(_0x273ace){return{'name':_0x273ace[_0xdff1('0x29')],'type':_0x273ace[_0xdff1('0x2a')][_0xdff1('0x2b')]};});_0x692445[_0xdff1('0x2c')]=_[_0xdff1('0x26')](_0x3e74af,'name');_0x692445[_0xdff1('0x2d')]=_['keys'](_0x12f1f5[_0xdff1('0x2d')]);_0x692445[_0xdff1('0x2e')]=_[_0xdff1('0x2f')](_0x692445[_0xdff1('0x2c')],_0x692445[_0xdff1('0x2d')]);_0x3dabad[_0xdff1('0x30')]=_['intersection'](_0x692445[_0xdff1('0x2c')],qs[_0xdff1('0x31')](_0x12f1f5[_0xdff1('0x2d')]['fields']));_0x3dabad[_0xdff1('0x30')]=_0x3dabad[_0xdff1('0x30')][_0xdff1('0x32')]?_0x3dabad[_0xdff1('0x30')]:_0x692445[_0xdff1('0x2c')];if(!_0x12f1f5[_0xdff1('0x2d')][_0xdff1('0x33')](_0xdff1('0x34'))){_0x3dabad[_0xdff1('0x35')]=qs['limit'](_0x12f1f5[_0xdff1('0x2d')][_0xdff1('0x35')]);_0x3dabad[_0xdff1('0x18')]=qs[_0xdff1('0x18')](_0x12f1f5[_0xdff1('0x2d')][_0xdff1('0x18')]);}_0x3dabad[_0xdff1('0x36')]=qs['sort'](_0x12f1f5[_0xdff1('0x2d')][_0xdff1('0x37')]);_0x3dabad['where']=qs[_0xdff1('0x2e')](_[_0xdff1('0x38')](_0x12f1f5[_0xdff1('0x2d')],_0x692445[_0xdff1('0x2e')]),_0x3e74af);if(_0x12f1f5['query'][_0xdff1('0x39')]){_0x3dabad[_0xdff1('0x3a')]=_['merge'](_0x3dabad[_0xdff1('0x3a')],{'$or':_[_0xdff1('0x26')](_0x3e74af,function(_0x3e4231){if(_0x3e4231[_0xdff1('0x2a')]!=='VIRTUAL'){var _0x382ed1={};_0x382ed1[_0x3e4231[_0xdff1('0x23')]]={'$like':'%'+_0x12f1f5[_0xdff1('0x2d')][_0xdff1('0x39')]+'%'};return _0x382ed1;}})});}_0x3dabad=_[_0xdff1('0x3b')]({},_0x3dabad,_0x12f1f5['options']);var _0x5ea3e9={'where':_0x3dabad[_0xdff1('0x3a')]};return db[_0xdff1('0x27')][_0xdff1('0x17')](_0x5ea3e9)[_0xdff1('0x1e')](function(_0x301af7){_0x43a347[_0xdff1('0x17')]=_0x301af7;if(_0x12f1f5[_0xdff1('0x2d')][_0xdff1('0x3c')]){_0x3dabad[_0xdff1('0x3d')]=[{'all':!![]}];}return db[_0xdff1('0x27')][_0xdff1('0x3e')](_0x3dabad);})[_0xdff1('0x1e')](function(_0xa8d368){_0x43a347[_0xdff1('0x3f')]=_0xa8d368;return _0x43a347;})[_0xdff1('0x1e')](respondWithFilteredResult(_0x4d8def,_0x3dabad))[_0xdff1('0x40')](handleError(_0x4d8def,null));};exports[_0xdff1('0x41')]=function(_0x3ace5c,_0x2ca26f){var _0x42cec2={'raw':![],'where':{'id':_0x3ace5c[_0xdff1('0x42')]['id']}},_0x2360e8={};_0x2360e8['model']=_[_0xdff1('0x43')](db[_0xdff1('0x27')][_0xdff1('0x28')]);_0x2360e8[_0xdff1('0x2d')]=_['keys'](_0x3ace5c[_0xdff1('0x2d')]);_0x2360e8[_0xdff1('0x2e')]=_[_0xdff1('0x2f')](_0x2360e8[_0xdff1('0x2c')],_0x2360e8['query']);_0x42cec2['attributes']=_[_0xdff1('0x2f')](_0x2360e8[_0xdff1('0x2c')],qs[_0xdff1('0x31')](_0x3ace5c[_0xdff1('0x2d')][_0xdff1('0x31')]));_0x42cec2[_0xdff1('0x30')]=_0x42cec2['attributes']['length']?_0x42cec2['attributes']:_0x2360e8[_0xdff1('0x2c')];if(_0x3ace5c[_0xdff1('0x2d')]['includeAll']){_0x42cec2[_0xdff1('0x3d')]=[{'all':!![]}];}_0x42cec2=_[_0xdff1('0x3b')]({},_0x42cec2,_0x3ace5c[_0xdff1('0x44')]);return db['Trigger'][_0xdff1('0x45')](_0x42cec2)[_0xdff1('0x1e')](handleEntityNotFound(_0x2ca26f,null))[_0xdff1('0x1e')](respondWithResult(_0x2ca26f,null))[_0xdff1('0x40')](handleError(_0x2ca26f,null));};exports[_0xdff1('0x46')]=function(_0x30b9ed,_0x541420){return db[_0xdff1('0x27')][_0xdff1('0x46')](_0x30b9ed[_0xdff1('0x47')],{})[_0xdff1('0x1e')](function(_0x3b287c){var _0x2753b3=_0x30b9ed[_0xdff1('0x48')][_0xdff1('0x49')]({'plain':!![]});if(!_0x2753b3)throw new Error(_0xdff1('0x4a'));if(_0x2753b3[_0xdff1('0x4b')]===_0xdff1('0x48')){var _0x5932e7=_0x3b287c[_0xdff1('0x49')]({'plain':!![]});var _0x1b582d=_0xdff1('0x1f');return db[_0xdff1('0x4c')][_0xdff1('0x45')]({'where':{'name':_0x1b582d,'userProfileId':_0x2753b3[_0xdff1('0x4d')]},'raw':!![]})[_0xdff1('0x1e')](function(_0x144df3){if(_0x144df3&&_0x144df3[_0xdff1('0x4e')]===0x0){return db[_0xdff1('0x20')][_0xdff1('0x46')]({'name':_0x5932e7[_0xdff1('0x23')],'resourceId':_0x5932e7['id'],'type':_0x144df3['name'],'sectionId':_0x144df3['id']},{})['then'](function(){return _0x3b287c;});}else{return _0x3b287c;}})['catch'](function(_0x16de1b){logger[_0xdff1('0x21')](_0xdff1('0x4f'),_0x16de1b);throw _0x16de1b;});}return _0x3b287c;})[_0xdff1('0x1e')](respondWithResult(_0x541420,0xc9))[_0xdff1('0x40')](handleError(_0x541420,null));};exports['update']=function(_0x1d60ce,_0x4b55e4){if(_0x1d60ce[_0xdff1('0x47')]['id']){delete _0x1d60ce[_0xdff1('0x47')]['id'];}return db[_0xdff1('0x27')][_0xdff1('0x45')]({'where':{'id':_0x1d60ce[_0xdff1('0x42')]['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x4b55e4,null))[_0xdff1('0x1e')](saveUpdates(_0x1d60ce[_0xdff1('0x47')],null))[_0xdff1('0x1e')](respondWithResult(_0x4b55e4,null))[_0xdff1('0x40')](handleError(_0x4b55e4,null));};exports['destroy']=function(_0x2f4ecf,_0x4c2e64){return db[_0xdff1('0x27')][_0xdff1('0x45')]({'where':{'id':_0x2f4ecf[_0xdff1('0x42')]['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x4c2e64,null))[_0xdff1('0x1e')](removeEntity(_0x4c2e64,null))[_0xdff1('0x40')](handleError(_0x4c2e64,null));};exports['addAllCondition']=function(_0xf87600,_0x49c89c,_0x550b01){if(_0xf87600[_0xdff1('0x47')]['id']){delete _0xf87600['body']['id'];}return db[_0xdff1('0x27')][_0xdff1('0x45')]({'where':{'id':_0xf87600[_0xdff1('0x42')]['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x49c89c,null))[_0xdff1('0x1e')](function(_0x10c026){if(_0x10c026){_0xf87600[_0xdff1('0x47')]['TriggerAllId']=_0x10c026['id'];return db[_0xdff1('0x50')][_0xdff1('0x46')](_0xf87600[_0xdff1('0x47')]);}})[_0xdff1('0x1e')](respondWithResult(_0x49c89c,null))[_0xdff1('0x40')](handleError(_0x49c89c,null));};exports['addAnyCondition']=function(_0x1ceebc,_0x3c48f5,_0x9491bd){if(_0x1ceebc[_0xdff1('0x47')]['id']){delete _0x1ceebc['body']['id'];}return db[_0xdff1('0x27')][_0xdff1('0x45')]({'where':{'id':_0x1ceebc[_0xdff1('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c48f5,null))[_0xdff1('0x1e')](function(_0x2dd190){if(_0x2dd190){_0x1ceebc['body'][_0xdff1('0x51')]=_0x2dd190['id'];return db['Condition'][_0xdff1('0x46')](_0x1ceebc['body']);}})['then'](respondWithResult(_0x3c48f5,null))[_0xdff1('0x40')](handleError(_0x3c48f5,null));};exports[_0xdff1('0x52')]=function(_0x15e1e4,_0x44232d,_0x27717f){var _0x4a1ac3={};var _0x277ec4={};var _0x2c25f9;var _0x5618a6;return db[_0xdff1('0x27')][_0xdff1('0x53')]({'where':{'id':_0x15e1e4[_0xdff1('0x42')]['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x44232d,null))[_0xdff1('0x1e')](function(_0x14ee30){if(_0x14ee30){_0x2c25f9=_0x14ee30;_0x277ec4[_0xdff1('0x2c')]=_[_0xdff1('0x43')](db[_0xdff1('0x50')][_0xdff1('0x28')]);_0x277ec4['query']=_[_0xdff1('0x43')](_0x15e1e4[_0xdff1('0x2d')]);_0x277ec4[_0xdff1('0x2e')]=_[_0xdff1('0x2f')](_0x277ec4[_0xdff1('0x2c')],_0x277ec4[_0xdff1('0x2d')]);_0x4a1ac3[_0xdff1('0x30')]=_['intersection'](_0x277ec4[_0xdff1('0x2c')],qs[_0xdff1('0x31')](_0x15e1e4[_0xdff1('0x2d')][_0xdff1('0x31')]));_0x4a1ac3[_0xdff1('0x30')]=_0x4a1ac3[_0xdff1('0x30')][_0xdff1('0x32')]?_0x4a1ac3[_0xdff1('0x30')]:_0x277ec4[_0xdff1('0x2c')];_0x4a1ac3[_0xdff1('0x36')]=qs[_0xdff1('0x37')](_0x15e1e4[_0xdff1('0x2d')]['sort']);_0x4a1ac3[_0xdff1('0x3a')]=qs['filters'](_[_0xdff1('0x38')](_0x15e1e4[_0xdff1('0x2d')],_0x277ec4['filters']));if(_0x15e1e4[_0xdff1('0x2d')][_0xdff1('0x39')]){_0x4a1ac3[_0xdff1('0x3a')]=_[_0xdff1('0x3b')](_0x4a1ac3[_0xdff1('0x3a')],{'$or':_[_0xdff1('0x26')](_0x4a1ac3['attributes'],function(_0x3ef6e1){var _0x37421d={};_0x37421d[_0x3ef6e1]={'$like':'%'+_0x15e1e4['query'][_0xdff1('0x39')]+'%'};return _0x37421d;})});}_0x4a1ac3=_['merge']({},_0x4a1ac3,_0x15e1e4[_0xdff1('0x44')]);return _0x2c25f9[_0xdff1('0x52')](_0x4a1ac3);}})[_0xdff1('0x1e')](function(_0x5deb21){if(_0x5deb21){_0x5618a6=_0x5deb21[_0xdff1('0x32')];if(!_0x15e1e4[_0xdff1('0x2d')][_0xdff1('0x33')](_0xdff1('0x34'))){_0x4a1ac3[_0xdff1('0x35')]=qs[_0xdff1('0x35')](_0x15e1e4['query'][_0xdff1('0x35')]);_0x4a1ac3[_0xdff1('0x18')]=qs[_0xdff1('0x18')](_0x15e1e4[_0xdff1('0x2d')][_0xdff1('0x18')]);}return _0x2c25f9[_0xdff1('0x52')](_0x4a1ac3);}})[_0xdff1('0x1e')](function(_0x42b8cf){if(_0x42b8cf){return _0x42b8cf?{'count':_0x5618a6,'rows':_0x42b8cf}:null;}})['then'](respondWithResult(_0x44232d,null))[_0xdff1('0x40')](handleError(_0x44232d,null));};exports[_0xdff1('0x54')]=function(_0x7092d3,_0x2c9615,_0x2ecf45){var _0x59a8c3={};var _0x1f9f1b={};var _0xa4e4e3;var _0x2b5999;return db[_0xdff1('0x27')]['findOne']({'where':{'id':_0x7092d3['params']['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x2c9615,null))[_0xdff1('0x1e')](function(_0x5a7e05){if(_0x5a7e05){_0xa4e4e3=_0x5a7e05;_0x1f9f1b['model']=_[_0xdff1('0x43')](db[_0xdff1('0x50')][_0xdff1('0x28')]);_0x1f9f1b['query']=_[_0xdff1('0x43')](_0x7092d3[_0xdff1('0x2d')]);_0x1f9f1b[_0xdff1('0x2e')]=_['intersection'](_0x1f9f1b['model'],_0x1f9f1b[_0xdff1('0x2d')]);_0x59a8c3[_0xdff1('0x30')]=_[_0xdff1('0x2f')](_0x1f9f1b['model'],qs[_0xdff1('0x31')](_0x7092d3[_0xdff1('0x2d')][_0xdff1('0x31')]));_0x59a8c3[_0xdff1('0x30')]=_0x59a8c3[_0xdff1('0x30')][_0xdff1('0x32')]?_0x59a8c3[_0xdff1('0x30')]:_0x1f9f1b['model'];_0x59a8c3[_0xdff1('0x36')]=qs[_0xdff1('0x37')](_0x7092d3[_0xdff1('0x2d')][_0xdff1('0x37')]);_0x59a8c3[_0xdff1('0x3a')]=qs[_0xdff1('0x2e')](_[_0xdff1('0x38')](_0x7092d3[_0xdff1('0x2d')],_0x1f9f1b[_0xdff1('0x2e')]));if(_0x7092d3['query'][_0xdff1('0x39')]){_0x59a8c3[_0xdff1('0x3a')]=_['merge'](_0x59a8c3[_0xdff1('0x3a')],{'$or':_[_0xdff1('0x26')](_0x59a8c3[_0xdff1('0x30')],function(_0x4c36d2){var _0x3da5c3={};_0x3da5c3[_0x4c36d2]={'$like':'%'+_0x7092d3[_0xdff1('0x2d')][_0xdff1('0x39')]+'%'};return _0x3da5c3;})});}_0x59a8c3=_['merge']({},_0x59a8c3,_0x7092d3[_0xdff1('0x44')]);return _0xa4e4e3['getAnyConditions'](_0x59a8c3);}})['then'](function(_0x57de6a){if(_0x57de6a){_0x2b5999=_0x57de6a[_0xdff1('0x32')];if(!_0x7092d3[_0xdff1('0x2d')][_0xdff1('0x33')]('nolimit')){_0x59a8c3['limit']=qs[_0xdff1('0x35')](_0x7092d3[_0xdff1('0x2d')]['limit']);_0x59a8c3[_0xdff1('0x18')]=qs['offset'](_0x7092d3[_0xdff1('0x2d')][_0xdff1('0x18')]);}return _0xa4e4e3['getAnyConditions'](_0x59a8c3);}})[_0xdff1('0x1e')](function(_0x30691d){if(_0x30691d){return _0x30691d?{'count':_0x2b5999,'rows':_0x30691d}:null;}})[_0xdff1('0x1e')](respondWithResult(_0x2c9615,null))['catch'](handleError(_0x2c9615,null));};exports['addAction']=function(_0x2dc35d,_0x2f9a96,_0x50b4ce){if(_0x2dc35d[_0xdff1('0x47')]['id']){delete _0x2dc35d[_0xdff1('0x47')]['id'];}return db[_0xdff1('0x27')]['find']({'where':{'id':_0x2dc35d[_0xdff1('0x42')]['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x2f9a96,null))['then'](function(_0x43d1f1){if(_0x43d1f1){_0x2dc35d[_0xdff1('0x47')][_0xdff1('0x55')]=_0x43d1f1['id'];return db[_0xdff1('0x56')]['create'](_0x2dc35d[_0xdff1('0x47')]);}})['then'](respondWithResult(_0x2f9a96,null))[_0xdff1('0x40')](handleError(_0x2f9a96,null));};exports[_0xdff1('0x57')]=function(_0x16df6f,_0x3421d0,_0x2d61a6){var _0x562320={};var _0xd0086a={};var _0x7dd79b;var _0x7ba490;return db[_0xdff1('0x27')][_0xdff1('0x53')]({'where':{'id':_0x16df6f[_0xdff1('0x42')]['id']}})[_0xdff1('0x1e')](handleEntityNotFound(_0x3421d0,null))[_0xdff1('0x1e')](function(_0x5e86d5){if(_0x5e86d5){_0x7dd79b=_0x5e86d5;_0xd0086a[_0xdff1('0x2c')]=_['keys'](db[_0xdff1('0x56')][_0xdff1('0x28')]);_0xd0086a['query']=_['keys'](_0x16df6f[_0xdff1('0x2d')]);_0xd0086a[_0xdff1('0x2e')]=_[_0xdff1('0x2f')](_0xd0086a[_0xdff1('0x2c')],_0xd0086a[_0xdff1('0x2d')]);_0x562320['attributes']=_[_0xdff1('0x2f')](_0xd0086a[_0xdff1('0x2c')],qs[_0xdff1('0x31')](_0x16df6f['query'][_0xdff1('0x31')]));_0x562320[_0xdff1('0x30')]=_0x562320['attributes'][_0xdff1('0x32')]?_0x562320[_0xdff1('0x30')]:_0xd0086a[_0xdff1('0x2c')];_0x562320[_0xdff1('0x36')]=qs[_0xdff1('0x37')](_0x16df6f[_0xdff1('0x2d')][_0xdff1('0x37')]);_0x562320[_0xdff1('0x3a')]=qs[_0xdff1('0x2e')](_[_0xdff1('0x38')](_0x16df6f['query'],_0xd0086a[_0xdff1('0x2e')]));if(_0x16df6f[_0xdff1('0x2d')][_0xdff1('0x39')]){_0x562320[_0xdff1('0x3a')]=_[_0xdff1('0x3b')](_0x562320[_0xdff1('0x3a')],{'$or':_[_0xdff1('0x26')](_0x562320['attributes'],function(_0x4ba05b){var _0x56f37a={};_0x56f37a[_0x4ba05b]={'$like':'%'+_0x16df6f[_0xdff1('0x2d')]['filter']+'%'};return _0x56f37a;})});}_0x562320=_[_0xdff1('0x3b')]({},_0x562320,_0x16df6f['options']);return _0x7dd79b[_0xdff1('0x57')](_0x562320);}})[_0xdff1('0x1e')](function(_0x68bcba){if(_0x68bcba){_0x7ba490=_0x68bcba['length'];if(!_0x16df6f[_0xdff1('0x2d')][_0xdff1('0x33')](_0xdff1('0x34'))){_0x562320['limit']=qs[_0xdff1('0x35')](_0x16df6f[_0xdff1('0x2d')][_0xdff1('0x35')]);_0x562320[_0xdff1('0x18')]=qs[_0xdff1('0x18')](_0x16df6f[_0xdff1('0x2d')][_0xdff1('0x18')]);}return _0x7dd79b[_0xdff1('0x57')](_0x562320);}})['then'](function(_0x1d65fb){if(_0x1d65fb){return _0x1d65fb?{'count':_0x7ba490,'rows':_0x1d65fb}:null;}})[_0xdff1('0x1e')](respondWithResult(_0x3421d0,null))[_0xdff1('0x40')](handleError(_0x3421d0,null));}; \ No newline at end of file +var _0x99fc=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','error','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Trigger','include','rows','catch','show','params','includeAll','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource'];(function(_0x2e15c0,_0x1d4e79){var _0x385d1b=function(_0x1cc592){while(--_0x1cc592){_0x2e15c0['push'](_0x2e15c0['shift']());}};_0x385d1b(++_0x1d4e79);}(_0x99fc,0x1ed));var _0xc99f=function(_0x350b69,_0x41fc00){_0x350b69=_0x350b69-0x0;var _0x2872aa=_0x99fc[_0x350b69];return _0x2872aa;};'use strict';var pdf=require(_0xc99f('0x0'));var emlformat=require(_0xc99f('0x1'));var rimraf=require(_0xc99f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc99f('0x3'));var rp=require(_0xc99f('0x4'));var moment=require(_0xc99f('0x5'));var BPromise=require(_0xc99f('0x6'));var Mustache=require(_0xc99f('0x7'));var util=require(_0xc99f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc99f('0x9'));var ejs=require(_0xc99f('0xa'));var fs=require('fs');var _=require(_0xc99f('0xb'));var squel=require(_0xc99f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc99f('0xd'));var toCsv=require(_0xc99f('0x9'));var querystring=require(_0xc99f('0xe'));var Papa=require('papaparse');var Redis=require(_0xc99f('0xf'));var authService=require(_0xc99f('0x10'));var qs=require(_0xc99f('0x11'));var as=require(_0xc99f('0x12'));var hardwareService=require(_0xc99f('0x13'));var logger=require(_0xc99f('0x14'))(_0xc99f('0x15'));var utils=require(_0xc99f('0x16'));var config=require('../../config/environment');var db=require(_0xc99f('0x17'))['db'];function respondWithStatusCode(_0x5bf460,_0xef636c){_0xef636c=_0xef636c||0xcc;return function(_0x454e10){if(_0x454e10){return _0x5bf460[_0xc99f('0x18')](_0xef636c);}return _0x5bf460[_0xc99f('0x19')](_0xef636c)[_0xc99f('0x1a')]();};}function respondWithResult(_0x8cacd6,_0x43229e){_0x43229e=_0x43229e||0xc8;return function(_0x349d5e){if(_0x349d5e){return _0x8cacd6['status'](_0x43229e)[_0xc99f('0x1b')](_0x349d5e);}};}function respondWithFilteredResult(_0x354f7d,_0x338cd7){return function(_0x7f1b0c){if(_0x7f1b0c){var _0x18dbaa=_0x7f1b0c[_0xc99f('0x1c')],_0x1edaae=_0x338cd7[_0xc99f('0x1d')],_0x50e1bf=_0x338cd7[_0xc99f('0x1d')]+_0x338cd7[_0xc99f('0x1e')],_0x45ad96;if(_0x50e1bf>=_0x18dbaa){_0x50e1bf=_0x18dbaa;_0x45ad96=0xc8;}else{_0x45ad96=0xce;}_0x354f7d[_0xc99f('0x19')](_0x45ad96);return _0x354f7d[_0xc99f('0x1f')](_0xc99f('0x20'),_0x1edaae+'-'+_0x50e1bf+'/'+_0x18dbaa)[_0xc99f('0x1b')](_0x7f1b0c);}return null;};}function patchUpdates(_0x34e2b8){return function(_0x3f5997){try{jsonpatch[_0xc99f('0x21')](_0x3f5997,_0x34e2b8,!![]);}catch(_0x3d46a6){return BPromise[_0xc99f('0x22')](_0x3d46a6);}return _0x3f5997[_0xc99f('0x23')]();};}function saveUpdates(_0x44707f,_0x22542a){return function(_0x4045d4){if(_0x4045d4){return _0x4045d4[_0xc99f('0x24')](_0x44707f)[_0xc99f('0x25')](function(_0x611c39){return _0x611c39;});}return null;};}function removeEntity(_0x1c95a5,_0x41ba4e){return function(_0x5cdf30){if(_0x5cdf30){return _0x5cdf30[_0xc99f('0x26')]()[_0xc99f('0x25')](function(){var _0x3dbc16=_0x5cdf30[_0xc99f('0x27')]({'plain':!![]});var _0x247932=_0xc99f('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x247932,'resourceId':_0x3dbc16['id']}})[_0xc99f('0x25')](function(){return _0x5cdf30;});})[_0xc99f('0x25')](function(){_0x1c95a5[_0xc99f('0x19')](0xcc)[_0xc99f('0x1a')]();});}};}function handleEntityNotFound(_0x4ad609,_0x2c86c2){return function(_0x397f4a){if(!_0x397f4a){_0x4ad609['sendStatus'](0x194);}return _0x397f4a;};}function handleError(_0x3f065d,_0x49d62e){_0x49d62e=_0x49d62e||0x1f4;return function(_0x51eadc){logger[_0xc99f('0x29')](_0x51eadc['stack']);if(_0x51eadc[_0xc99f('0x2a')]){delete _0x51eadc['name'];}_0x3f065d['status'](_0x49d62e)[_0xc99f('0x2b')](_0x51eadc);};}exports[_0xc99f('0x2c')]=function(_0x150cef,_0x2023f5){var _0x27be32={},_0x436612={},_0x354212={'count':0x0,'rows':[]};var _0x3d9529=_[_0xc99f('0x2d')](db['Trigger'][_0xc99f('0x2e')],function(_0xdafc45){return{'name':_0xdafc45[_0xc99f('0x2f')],'type':_0xdafc45['type']['key']};});_0x436612[_0xc99f('0x30')]=_[_0xc99f('0x2d')](_0x3d9529,_0xc99f('0x2a'));_0x436612[_0xc99f('0x31')]=_[_0xc99f('0x32')](_0x150cef['query']);_0x436612[_0xc99f('0x33')]=_[_0xc99f('0x34')](_0x436612[_0xc99f('0x30')],_0x436612['query']);_0x27be32['attributes']=_[_0xc99f('0x34')](_0x436612[_0xc99f('0x30')],qs[_0xc99f('0x35')](_0x150cef[_0xc99f('0x31')][_0xc99f('0x35')]));_0x27be32['attributes']=_0x27be32[_0xc99f('0x36')][_0xc99f('0x37')]?_0x27be32[_0xc99f('0x36')]:_0x436612[_0xc99f('0x30')];if(!_0x150cef[_0xc99f('0x31')][_0xc99f('0x38')](_0xc99f('0x39'))){_0x27be32['limit']=qs[_0xc99f('0x1e')](_0x150cef[_0xc99f('0x31')][_0xc99f('0x1e')]);_0x27be32[_0xc99f('0x1d')]=qs[_0xc99f('0x1d')](_0x150cef[_0xc99f('0x31')]['offset']);}_0x27be32[_0xc99f('0x3a')]=qs[_0xc99f('0x3b')](_0x150cef['query'][_0xc99f('0x3b')]);_0x27be32[_0xc99f('0x3c')]=qs['filters'](_[_0xc99f('0x3d')](_0x150cef[_0xc99f('0x31')],_0x436612[_0xc99f('0x33')]),_0x3d9529);if(_0x150cef['query'][_0xc99f('0x3e')]){_0x27be32[_0xc99f('0x3c')]=_[_0xc99f('0x3f')](_0x27be32['where'],{'$or':_['map'](_0x3d9529,function(_0xef0b4d){if(_0xef0b4d[_0xc99f('0x40')]!==_0xc99f('0x41')){var _0x5d5bc7={};_0x5d5bc7[_0xef0b4d['name']]={'$like':'%'+_0x150cef[_0xc99f('0x31')][_0xc99f('0x3e')]+'%'};return _0x5d5bc7;}})});}_0x27be32=_[_0xc99f('0x3f')]({},_0x27be32,_0x150cef[_0xc99f('0x42')]);var _0xfd3d53={'where':_0x27be32[_0xc99f('0x3c')]};return db[_0xc99f('0x43')][_0xc99f('0x1c')](_0xfd3d53)[_0xc99f('0x25')](function(_0x51417e){_0x354212[_0xc99f('0x1c')]=_0x51417e;if(_0x150cef[_0xc99f('0x31')]['includeAll']){_0x27be32[_0xc99f('0x44')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x27be32);})[_0xc99f('0x25')](function(_0xdd4d25){_0x354212[_0xc99f('0x45')]=_0xdd4d25;return _0x354212;})[_0xc99f('0x25')](respondWithFilteredResult(_0x2023f5,_0x27be32))[_0xc99f('0x46')](handleError(_0x2023f5,null));};exports[_0xc99f('0x47')]=function(_0x17f233,_0x3c55d6){var _0x1be791={'raw':![],'where':{'id':_0x17f233[_0xc99f('0x48')]['id']}},_0x5775e7={};_0x5775e7['model']=_[_0xc99f('0x32')](db[_0xc99f('0x43')][_0xc99f('0x2e')]);_0x5775e7[_0xc99f('0x31')]=_['keys'](_0x17f233['query']);_0x5775e7['filters']=_[_0xc99f('0x34')](_0x5775e7[_0xc99f('0x30')],_0x5775e7[_0xc99f('0x31')]);_0x1be791[_0xc99f('0x36')]=_[_0xc99f('0x34')](_0x5775e7[_0xc99f('0x30')],qs[_0xc99f('0x35')](_0x17f233[_0xc99f('0x31')][_0xc99f('0x35')]));_0x1be791[_0xc99f('0x36')]=_0x1be791[_0xc99f('0x36')][_0xc99f('0x37')]?_0x1be791[_0xc99f('0x36')]:_0x5775e7[_0xc99f('0x30')];if(_0x17f233[_0xc99f('0x31')][_0xc99f('0x49')]){_0x1be791[_0xc99f('0x44')]=[{'all':!![]}];}_0x1be791=_['merge']({},_0x1be791,_0x17f233[_0xc99f('0x42')]);return db[_0xc99f('0x43')]['find'](_0x1be791)[_0xc99f('0x25')](handleEntityNotFound(_0x3c55d6,null))[_0xc99f('0x25')](respondWithResult(_0x3c55d6,null))[_0xc99f('0x46')](handleError(_0x3c55d6,null));};exports[_0xc99f('0x4a')]=function(_0x2885ad,_0x594b2d){return db[_0xc99f('0x43')][_0xc99f('0x4a')](_0x2885ad[_0xc99f('0x4b')],{})[_0xc99f('0x25')](function(_0x42e48c){var _0x4153f8=_0x2885ad[_0xc99f('0x4c')][_0xc99f('0x27')]({'plain':!![]});if(!_0x4153f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4153f8[_0xc99f('0x4d')]===_0xc99f('0x4c')){var _0x4935a3=_0x42e48c['get']({'plain':!![]});var _0x2d4b22='Triggers';return db[_0xc99f('0x4e')][_0xc99f('0x4f')]({'where':{'name':_0x2d4b22,'userProfileId':_0x4153f8[_0xc99f('0x50')]},'raw':!![]})[_0xc99f('0x25')](function(_0x4a1ea2){if(_0x4a1ea2&&_0x4a1ea2[_0xc99f('0x51')]===0x0){return db[_0xc99f('0x52')][_0xc99f('0x4a')]({'name':_0x4935a3['name'],'resourceId':_0x4935a3['id'],'type':_0x4a1ea2['name'],'sectionId':_0x4a1ea2['id']},{})[_0xc99f('0x25')](function(){return _0x42e48c;});}else{return _0x42e48c;}})[_0xc99f('0x46')](function(_0x1610e9){logger[_0xc99f('0x29')](_0xc99f('0x53'),_0x1610e9);throw _0x1610e9;});}return _0x42e48c;})[_0xc99f('0x25')](respondWithResult(_0x594b2d,0xc9))[_0xc99f('0x46')](handleError(_0x594b2d,null));};exports[_0xc99f('0x24')]=function(_0x1d0533,_0x44b9ad){if(_0x1d0533['body']['id']){delete _0x1d0533[_0xc99f('0x4b')]['id'];}return db[_0xc99f('0x43')][_0xc99f('0x4f')]({'where':{'id':_0x1d0533[_0xc99f('0x48')]['id']}})[_0xc99f('0x25')](handleEntityNotFound(_0x44b9ad,null))[_0xc99f('0x25')](saveUpdates(_0x1d0533['body'],null))[_0xc99f('0x25')](respondWithResult(_0x44b9ad,null))['catch'](handleError(_0x44b9ad,null));};exports[_0xc99f('0x26')]=function(_0x13eee6,_0x577bcc){return db[_0xc99f('0x43')][_0xc99f('0x4f')]({'where':{'id':_0x13eee6['params']['id']}})[_0xc99f('0x25')](handleEntityNotFound(_0x577bcc,null))['then'](removeEntity(_0x577bcc,null))[_0xc99f('0x46')](handleError(_0x577bcc,null));};exports[_0xc99f('0x54')]=function(_0x1d48c4,_0x3d105a,_0x42850a){if(_0x1d48c4[_0xc99f('0x4b')]['id']){delete _0x1d48c4[_0xc99f('0x4b')]['id'];}return db[_0xc99f('0x43')][_0xc99f('0x4f')]({'where':{'id':_0x1d48c4[_0xc99f('0x48')]['id']}})[_0xc99f('0x25')](handleEntityNotFound(_0x3d105a,null))[_0xc99f('0x25')](function(_0x9c699d){if(_0x9c699d){_0x1d48c4[_0xc99f('0x4b')][_0xc99f('0x55')]=_0x9c699d['id'];return db[_0xc99f('0x56')][_0xc99f('0x4a')](_0x1d48c4[_0xc99f('0x4b')]);}})['then'](respondWithResult(_0x3d105a,null))[_0xc99f('0x46')](handleError(_0x3d105a,null));};exports[_0xc99f('0x57')]=function(_0x3d22fc,_0xe27c5c,_0x4ae578){if(_0x3d22fc['body']['id']){delete _0x3d22fc['body']['id'];}return db['Trigger'][_0xc99f('0x4f')]({'where':{'id':_0x3d22fc['params']['id']}})[_0xc99f('0x25')](handleEntityNotFound(_0xe27c5c,null))[_0xc99f('0x25')](function(_0x1efb5f){if(_0x1efb5f){_0x3d22fc[_0xc99f('0x4b')][_0xc99f('0x58')]=_0x1efb5f['id'];return db[_0xc99f('0x56')][_0xc99f('0x4a')](_0x3d22fc[_0xc99f('0x4b')]);}})[_0xc99f('0x25')](respondWithResult(_0xe27c5c,null))['catch'](handleError(_0xe27c5c,null));};exports[_0xc99f('0x59')]=function(_0xb85eec,_0x51eb01,_0x7948a4){var _0x17ca15={};var _0x93ec86={};var _0x12fc1d;var _0x1f8fac;return db[_0xc99f('0x43')][_0xc99f('0x5a')]({'where':{'id':_0xb85eec[_0xc99f('0x48')]['id']}})['then'](handleEntityNotFound(_0x51eb01,null))[_0xc99f('0x25')](function(_0x2d1d92){if(_0x2d1d92){_0x12fc1d=_0x2d1d92;_0x93ec86[_0xc99f('0x30')]=_[_0xc99f('0x32')](db[_0xc99f('0x56')][_0xc99f('0x2e')]);_0x93ec86[_0xc99f('0x31')]=_['keys'](_0xb85eec[_0xc99f('0x31')]);_0x93ec86[_0xc99f('0x33')]=_[_0xc99f('0x34')](_0x93ec86[_0xc99f('0x30')],_0x93ec86[_0xc99f('0x31')]);_0x17ca15['attributes']=_[_0xc99f('0x34')](_0x93ec86[_0xc99f('0x30')],qs[_0xc99f('0x35')](_0xb85eec[_0xc99f('0x31')]['fields']));_0x17ca15[_0xc99f('0x36')]=_0x17ca15[_0xc99f('0x36')][_0xc99f('0x37')]?_0x17ca15[_0xc99f('0x36')]:_0x93ec86[_0xc99f('0x30')];_0x17ca15[_0xc99f('0x3a')]=qs['sort'](_0xb85eec[_0xc99f('0x31')][_0xc99f('0x3b')]);_0x17ca15[_0xc99f('0x3c')]=qs[_0xc99f('0x33')](_[_0xc99f('0x3d')](_0xb85eec[_0xc99f('0x31')],_0x93ec86['filters']));if(_0xb85eec[_0xc99f('0x31')][_0xc99f('0x3e')]){_0x17ca15['where']=_[_0xc99f('0x3f')](_0x17ca15[_0xc99f('0x3c')],{'$or':_[_0xc99f('0x2d')](_0x17ca15[_0xc99f('0x36')],function(_0x17d53d){var _0x13989e={};_0x13989e[_0x17d53d]={'$like':'%'+_0xb85eec[_0xc99f('0x31')][_0xc99f('0x3e')]+'%'};return _0x13989e;})});}_0x17ca15=_[_0xc99f('0x3f')]({},_0x17ca15,_0xb85eec[_0xc99f('0x42')]);return _0x12fc1d[_0xc99f('0x59')](_0x17ca15);}})[_0xc99f('0x25')](function(_0x425c07){if(_0x425c07){_0x1f8fac=_0x425c07[_0xc99f('0x37')];if(!_0xb85eec[_0xc99f('0x31')][_0xc99f('0x38')]('nolimit')){_0x17ca15[_0xc99f('0x1e')]=qs[_0xc99f('0x1e')](_0xb85eec[_0xc99f('0x31')][_0xc99f('0x1e')]);_0x17ca15['offset']=qs['offset'](_0xb85eec[_0xc99f('0x31')][_0xc99f('0x1d')]);}return _0x12fc1d[_0xc99f('0x59')](_0x17ca15);}})[_0xc99f('0x25')](function(_0x66aed3){if(_0x66aed3){return _0x66aed3?{'count':_0x1f8fac,'rows':_0x66aed3}:null;}})[_0xc99f('0x25')](respondWithResult(_0x51eb01,null))[_0xc99f('0x46')](handleError(_0x51eb01,null));};exports[_0xc99f('0x5b')]=function(_0x4f75d3,_0x44d584,_0x12c6c2){var _0x95df3c={};var _0x2ece36={};var _0x53f5e8;var _0x55c13a;return db[_0xc99f('0x43')][_0xc99f('0x5a')]({'where':{'id':_0x4f75d3[_0xc99f('0x48')]['id']}})[_0xc99f('0x25')](handleEntityNotFound(_0x44d584,null))[_0xc99f('0x25')](function(_0x3572db){if(_0x3572db){_0x53f5e8=_0x3572db;_0x2ece36[_0xc99f('0x30')]=_[_0xc99f('0x32')](db['Condition']['rawAttributes']);_0x2ece36[_0xc99f('0x31')]=_[_0xc99f('0x32')](_0x4f75d3[_0xc99f('0x31')]);_0x2ece36[_0xc99f('0x33')]=_[_0xc99f('0x34')](_0x2ece36[_0xc99f('0x30')],_0x2ece36['query']);_0x95df3c[_0xc99f('0x36')]=_['intersection'](_0x2ece36[_0xc99f('0x30')],qs[_0xc99f('0x35')](_0x4f75d3[_0xc99f('0x31')][_0xc99f('0x35')]));_0x95df3c[_0xc99f('0x36')]=_0x95df3c['attributes'][_0xc99f('0x37')]?_0x95df3c[_0xc99f('0x36')]:_0x2ece36['model'];_0x95df3c[_0xc99f('0x3a')]=qs[_0xc99f('0x3b')](_0x4f75d3[_0xc99f('0x31')][_0xc99f('0x3b')]);_0x95df3c['where']=qs[_0xc99f('0x33')](_[_0xc99f('0x3d')](_0x4f75d3[_0xc99f('0x31')],_0x2ece36[_0xc99f('0x33')]));if(_0x4f75d3[_0xc99f('0x31')][_0xc99f('0x3e')]){_0x95df3c[_0xc99f('0x3c')]=_[_0xc99f('0x3f')](_0x95df3c[_0xc99f('0x3c')],{'$or':_['map'](_0x95df3c[_0xc99f('0x36')],function(_0x2707b8){var _0x109749={};_0x109749[_0x2707b8]={'$like':'%'+_0x4f75d3[_0xc99f('0x31')]['filter']+'%'};return _0x109749;})});}_0x95df3c=_[_0xc99f('0x3f')]({},_0x95df3c,_0x4f75d3['options']);return _0x53f5e8[_0xc99f('0x5b')](_0x95df3c);}})[_0xc99f('0x25')](function(_0x464a4c){if(_0x464a4c){_0x55c13a=_0x464a4c['length'];if(!_0x4f75d3['query'][_0xc99f('0x38')](_0xc99f('0x39'))){_0x95df3c[_0xc99f('0x1e')]=qs[_0xc99f('0x1e')](_0x4f75d3['query'][_0xc99f('0x1e')]);_0x95df3c[_0xc99f('0x1d')]=qs[_0xc99f('0x1d')](_0x4f75d3[_0xc99f('0x31')][_0xc99f('0x1d')]);}return _0x53f5e8['getAnyConditions'](_0x95df3c);}})[_0xc99f('0x25')](function(_0x6c1bd3){if(_0x6c1bd3){return _0x6c1bd3?{'count':_0x55c13a,'rows':_0x6c1bd3}:null;}})[_0xc99f('0x25')](respondWithResult(_0x44d584,null))[_0xc99f('0x46')](handleError(_0x44d584,null));};exports[_0xc99f('0x5c')]=function(_0x407647,_0x6af2ee,_0x5e11ab){if(_0x407647[_0xc99f('0x4b')]['id']){delete _0x407647[_0xc99f('0x4b')]['id'];}return db[_0xc99f('0x43')]['find']({'where':{'id':_0x407647['params']['id']}})['then'](handleEntityNotFound(_0x6af2ee,null))['then'](function(_0x2d7033){if(_0x2d7033){_0x407647[_0xc99f('0x4b')][_0xc99f('0x5d')]=_0x2d7033['id'];return db[_0xc99f('0x5e')]['create'](_0x407647[_0xc99f('0x4b')]);}})[_0xc99f('0x25')](respondWithResult(_0x6af2ee,null))[_0xc99f('0x46')](handleError(_0x6af2ee,null));};exports[_0xc99f('0x5f')]=function(_0x3ac34b,_0x21b3e3,_0x552bb9){var _0x1b7ef2={};var _0x3dce40={};var _0x48981d;var _0x5679fc;return db[_0xc99f('0x43')]['findOne']({'where':{'id':_0x3ac34b['params']['id']}})['then'](handleEntityNotFound(_0x21b3e3,null))[_0xc99f('0x25')](function(_0x554d04){if(_0x554d04){_0x48981d=_0x554d04;_0x3dce40['model']=_[_0xc99f('0x32')](db[_0xc99f('0x5e')][_0xc99f('0x2e')]);_0x3dce40[_0xc99f('0x31')]=_[_0xc99f('0x32')](_0x3ac34b[_0xc99f('0x31')]);_0x3dce40[_0xc99f('0x33')]=_[_0xc99f('0x34')](_0x3dce40['model'],_0x3dce40[_0xc99f('0x31')]);_0x1b7ef2[_0xc99f('0x36')]=_[_0xc99f('0x34')](_0x3dce40[_0xc99f('0x30')],qs[_0xc99f('0x35')](_0x3ac34b[_0xc99f('0x31')][_0xc99f('0x35')]));_0x1b7ef2['attributes']=_0x1b7ef2['attributes']['length']?_0x1b7ef2[_0xc99f('0x36')]:_0x3dce40[_0xc99f('0x30')];_0x1b7ef2[_0xc99f('0x3a')]=qs[_0xc99f('0x3b')](_0x3ac34b[_0xc99f('0x31')][_0xc99f('0x3b')]);_0x1b7ef2['where']=qs[_0xc99f('0x33')](_[_0xc99f('0x3d')](_0x3ac34b['query'],_0x3dce40['filters']));if(_0x3ac34b[_0xc99f('0x31')]['filter']){_0x1b7ef2[_0xc99f('0x3c')]=_[_0xc99f('0x3f')](_0x1b7ef2[_0xc99f('0x3c')],{'$or':_[_0xc99f('0x2d')](_0x1b7ef2[_0xc99f('0x36')],function(_0x4ea8f6){var _0x24571a={};_0x24571a[_0x4ea8f6]={'$like':'%'+_0x3ac34b[_0xc99f('0x31')][_0xc99f('0x3e')]+'%'};return _0x24571a;})});}_0x1b7ef2=_[_0xc99f('0x3f')]({},_0x1b7ef2,_0x3ac34b[_0xc99f('0x42')]);return _0x48981d[_0xc99f('0x5f')](_0x1b7ef2);}})[_0xc99f('0x25')](function(_0x8ea206){if(_0x8ea206){_0x5679fc=_0x8ea206[_0xc99f('0x37')];if(!_0x3ac34b[_0xc99f('0x31')]['hasOwnProperty'](_0xc99f('0x39'))){_0x1b7ef2[_0xc99f('0x1e')]=qs[_0xc99f('0x1e')](_0x3ac34b[_0xc99f('0x31')][_0xc99f('0x1e')]);_0x1b7ef2[_0xc99f('0x1d')]=qs['offset'](_0x3ac34b['query'][_0xc99f('0x1d')]);}return _0x48981d[_0xc99f('0x5f')](_0x1b7ef2);}})[_0xc99f('0x25')](function(_0x3a30ae){if(_0x3a30ae){return _0x3a30ae?{'count':_0x5679fc,'rows':_0x3a30ae}:null;}})['then'](respondWithResult(_0x21b3e3,null))[_0xc99f('0x46')](handleError(_0x21b3e3,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index efbcc22..aab7874 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 _0xdb28=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','Trigger','tools_triggers','lodash','util'];(function(_0x3007b3,_0x226813){var _0x940f4b=function(_0x254d13){while(--_0x254d13){_0x3007b3['push'](_0x3007b3['shift']());}};_0x940f4b(++_0x226813);}(_0xdb28,0x106));var _0x8db2=function(_0x1a56ad,_0x297578){_0x1a56ad=_0x1a56ad-0x0;var _0x3bd899=_0xdb28[_0x1a56ad];return _0x3bd899;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./trigger.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('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(_0x1f705f,_0x5cddc8){var _0x4d815a=function(_0x363686){while(--_0x363686){_0x1f705f['push'](_0x1f705f['shift']());}};_0x4d815a(++_0x5cddc8);}(_0x2ef3,0xba));var _0x32ef=function(_0x3de20d,_0x542c76){_0x3de20d=_0x3de20d-0x0;var _0x240710=_0x2ef3[_0x3de20d];return _0x240710;};'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 abfe65a..8a39cae 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 _0xfcbb=['info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrigger','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0x337d97,_0x19c381){var _0x53aa89=function(_0x1ee5eb){while(--_0x1ee5eb){_0x337d97['push'](_0x337d97['shift']());}};_0x53aa89(++_0x19c381);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x114545,_0x2de1c1){_0x114545=_0x114545-0x0;var _0x293c1a=_0xfcbb[_0x114545];return _0x293c1a;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('Trigger,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')]({'raw':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1a')]===undefined?!![]:![]:!![],'where':_0xba1d6['options']?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1b')]||null:null,'attributes':_0xba1d6['options']?_0xba1d6['options'][_0xbfcb('0x1c')]||null:null,'limit':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1d')]||null:null,'include':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6['options'][_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0xba1d6[_0xbfcb('0x19')][_0xbfcb('0x1e')],function(_0x1651e5){return{'model':db[_0x1651e5[_0xbfcb('0x20')]],'as':_0x1651e5['as'],'attributes':_0x1651e5[_0xbfcb('0x1c')],'include':_0x1651e5[_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x1651e5[_0xbfcb('0x1e')],function(_0x1ca8c3){return{'model':db[_0x1ca8c3[_0xbfcb('0x20')]],'as':_0x1ca8c3['as'],'attributes':_0x1ca8c3[_0xbfcb('0x1c')],'include':_0x1ca8c3[_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x1ca8c3[_0xbfcb('0x1e')],function(_0x5cd703){return{'model':db[_0x5cd703[_0xbfcb('0x20')]],'as':_0x5cd703['as'],'attributes':_0x5cd703[_0xbfcb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x64a69){logger[_0xbfcb('0xb')](_0xbfcb('0x16'),_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x64a69));_0x3404aa(_0x64a69);})[_0xbfcb('0x15')](function(_0x1a5db2){logger[_0xbfcb('0x10')](_0xbfcb('0x16'),_0x1a5db2['message'],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1a5db2[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x21')]=function(_0x43de3c){var _0x1f45fc=this;return new Promise(function(_0x14f6f5,_0x286fb7){return db[_0xbfcb('0x17')][_0xbfcb('0x22')]({'raw':_0x43de3c['options']?_0x43de3c[_0xbfcb('0x19')][_0xbfcb('0x1a')]===undefined?!![]:![]:!![],'where':_0x43de3c[_0xbfcb('0x19')]?_0x43de3c[_0xbfcb('0x19')]['where']||null:null,'attributes':_0x43de3c['options']?_0x43de3c[_0xbfcb('0x19')][_0xbfcb('0x1c')]||null:null,'include':_0x43de3c[_0xbfcb('0x19')]?_0x43de3c[_0xbfcb('0x19')][_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x43de3c[_0xbfcb('0x19')]['include'],function(_0x504d81){return{'model':db[_0x504d81['model']],'as':_0x504d81['as'],'attributes':_0x504d81[_0xbfcb('0x1c')],'include':_0x504d81['include']?_[_0xbfcb('0x1f')](_0x504d81[_0xbfcb('0x1e')],function(_0x505b0d){return{'model':db[_0x505b0d['model']],'as':_0x505b0d['as'],'attributes':_0x505b0d[_0xbfcb('0x1c')],'include':_0x505b0d[_0xbfcb('0x1e')]?_[_0xbfcb('0x1f')](_0x505b0d[_0xbfcb('0x1e')],function(_0x530208){return{'model':db[_0x530208[_0xbfcb('0x20')]],'as':_0x530208['as'],'attributes':_0x530208[_0xbfcb('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47ac13){logger[_0xbfcb('0xb')]('ShowTrigger',_0x43de3c);logger['debug'](_0xbfcb('0x21'),_0x43de3c,JSON[_0xbfcb('0xf')](_0x47ac13));_0x14f6f5(_0x47ac13);})[_0xbfcb('0x15')](function(_0x42ad5d){logger['error'](_0xbfcb('0x21'),_0x42ad5d[_0xbfcb('0x13')],_0x43de3c);_0x286fb7(_0x1f45fc[_0xbfcb('0x10')](0x1f4,_0x42ad5d[_0xbfcb('0x13')]));});});}; \ No newline at end of file +var _0xb7e7=['request','then','info','Trigger,\x20%s,\x20%s','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','ShowTrigger','find','where','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http'];(function(_0x27b83a,_0x3410b6){var _0x30b185=function(_0x2a39eb){while(--_0x2a39eb){_0x27b83a['push'](_0x27b83a['shift']());}};_0x30b185(++_0x3410b6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xb7e7[_0x5f0089];return _0x193892;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Trigger,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}exports[_0x7b7e('0x14')]=function(_0x242368){var _0x200ef7=this;return new Promise(function(_0x2acb8c,_0x429a0e){return db[_0x7b7e('0x15')][_0x7b7e('0x16')]({'raw':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')]['where']||null:null,'attributes':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x19')]||null:null,'limit':_0x242368['options']?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1a')]||null:null,'include':_0x242368[_0x7b7e('0x17')]?_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x242368[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x53bbb3){return{'model':db[_0x53bbb3['model']],'as':_0x53bbb3['as'],'attributes':_0x53bbb3['attributes'],'include':_0x53bbb3[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x53bbb3[_0x7b7e('0x1b')],function(_0x483c6f){return{'model':db[_0x483c6f['model']],'as':_0x483c6f['as'],'attributes':_0x483c6f['attributes'],'include':_0x483c6f[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x483c6f[_0x7b7e('0x1b')],function(_0x7aa71){return{'model':db[_0x7aa71[_0x7b7e('0x1d')]],'as':_0x7aa71['as'],'attributes':_0x7aa71['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x21a15){logger['info']('GetTrigger',_0x242368);logger['debug'](_0x7b7e('0x14'),_0x242368,JSON[_0x7b7e('0xf')](_0x21a15));_0x2acb8c(_0x21a15);})['catch'](function(_0x3db8c4){logger['error'](_0x7b7e('0x14'),_0x3db8c4[_0x7b7e('0x12')],_0x242368);_0x429a0e(_0x200ef7[_0x7b7e('0x10')](0x1f4,_0x3db8c4['message']));});});};exports[_0x7b7e('0x1e')]=function(_0xe31336){var _0x35602a=this;return new Promise(function(_0x326dd2,_0x33f9a1){return db['Trigger'][_0x7b7e('0x1f')]({'raw':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x18')]===undefined?!![]:![]:!![],'where':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x20')]||null:null,'attributes':_0xe31336[_0x7b7e('0x17')]?_0xe31336[_0x7b7e('0x17')]['attributes']||null:null,'include':_0xe31336['options']?_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')]?_['map'](_0xe31336[_0x7b7e('0x17')][_0x7b7e('0x1b')],function(_0x2ca366){return{'model':db[_0x2ca366['model']],'as':_0x2ca366['as'],'attributes':_0x2ca366[_0x7b7e('0x19')],'include':_0x2ca366[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x2ca366[_0x7b7e('0x1b')],function(_0x31043a){return{'model':db[_0x31043a[_0x7b7e('0x1d')]],'as':_0x31043a['as'],'attributes':_0x31043a[_0x7b7e('0x19')],'include':_0x31043a[_0x7b7e('0x1b')]?_[_0x7b7e('0x1c')](_0x31043a[_0x7b7e('0x1b')],function(_0xd5a64d){return{'model':db[_0xd5a64d[_0x7b7e('0x1d')]],'as':_0xd5a64d['as'],'attributes':_0xd5a64d[_0x7b7e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7b7e('0x9')](function(_0x116563){logger[_0x7b7e('0xa')]('ShowTrigger',_0xe31336);logger[_0x7b7e('0xc')](_0x7b7e('0x1e'),_0xe31336,JSON[_0x7b7e('0xf')](_0x116563));_0x326dd2(_0x116563);})[_0x7b7e('0x13')](function(_0x36abfc){logger[_0x7b7e('0x10')](_0x7b7e('0x1e'),_0x36abfc[_0x7b7e('0x12')],_0xe31336);_0x33f9a1(_0x35602a[_0x7b7e('0x10')](0x1f4,_0x36abfc[_0x7b7e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index b2b300c..dfe7d48 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 _0x00bb=['../../components/auth/service','../../components/interaction/service','./trunk.controller','get','/:id','isAuthenticated','show','post','/:id/clone','create','put','delete','exports','multer','util','path','express'];(function(_0x4b6a87,_0x27d4c7){var _0x4d27f9=function(_0x50839c){while(--_0x50839c){_0x4b6a87['push'](_0x4b6a87['shift']());}};_0x4d27f9(++_0x27d4c7);}(_0x00bb,0x1d8));var _0xb00b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x00bb[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0xb')](_0xb00b('0xc'),auth[_0xb00b('0x9')](),controller['clone']);router['post']('/',auth[_0xb00b('0x9')](),controller[_0xb00b('0xd')]);router[_0xb00b('0xe')](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller['update']);router[_0xb00b('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb00b('0x10')]=router; \ No newline at end of file +var _0x032e=['post','/:id/clone','clone','create','update','delete','destroy','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5aff53,_0x58a06c){var _0xe495e1=function(_0x16d3fc){while(--_0x16d3fc){_0x5aff53['push'](_0x5aff53['shift']());}};_0xe495e1(++_0x58a06c);}(_0x032e,0x124));var _0xe032=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x032e[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xe032('0x3'));var interaction=require(_0xe032('0x4'));var config=require(_0xe032('0x5'));var controller=require(_0xe032('0x6'));router[_0xe032('0x7')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0x9')]);router[_0xe032('0x7')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')](_0xe032('0xd'),auth[_0xe032('0x8')](),controller[_0xe032('0xe')]);router[_0xe032('0xc')]('/',auth[_0xe032('0x8')](),controller[_0xe032('0xf')]);router['put'](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0x10')]);router[_0xe032('0x11')](_0xe032('0xa'),auth[_0xe032('0x8')](),controller[_0xe032('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index b6c5ef2..41e8c05 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 _0x613d=['split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','nonat','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','certificate','active','passive','BOOLEAN','exports','STRING','ENUM','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','getDataValue','transport'];(function(_0x19290b,_0x7b512f){var _0x2f6c60=function(_0x137abc){while(--_0x137abc){_0x19290b['push'](_0x19290b['shift']());}};_0x2f6c60(++_0x7b512f);}(_0x613d,0xd9));var _0xd613=function(_0x2c094f,_0xe5a1b0){_0x2c094f=_0x2c094f-0x0;var _0x2f7176=_0x613d[_0x2c094f];return _0x2f7176;};'use strict';var Sequelize=require('sequelize');module[_0xd613('0x0')]={'name':{'type':Sequelize[_0xd613('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x3'),_0xd613('0x4'),'peer'),'allowNull':![],'defaultValue':_0xd613('0x3')},'context':{'type':Sequelize[_0xd613('0x1')],'allowNull':![],'defaultValue':_0xd613('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xd613('0x6'),_0xd613('0x7'),_0xd613('0x8'),_0xd613('0x9'),_0xd613('0xa'),_0xd613('0xb'),_0xd613('0xc'),_0xd613('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xd613('0x1')]},'md5secret':{'type':Sequelize[_0xd613('0x1')]},'remotesecret':{'type':Sequelize[_0xd613('0x1')]},'transport':{'type':Sequelize[_0xd613('0x1')],'defaultValue':_0xd613('0xe'),'set':function(_0xf60fb9){this['setDataValue']('transport',_0xf60fb9?_0xf60fb9[_0xd613('0xf')](','):null);},'get':function(){return this[_0xd613('0x10')](_0xd613('0x11'))?this['getDataValue']('transport')[_0xd613('0x12')](','):null;},'comment':_0xd613('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xd613('0x14'),'info','shortinfo',_0xd613('0x15'),'auto'),'defaultValue':_0xd613('0x14')},'directmedia':{'type':Sequelize[_0xd613('0x2')]('yes','no',_0xd613('0x16'),_0xd613('0x17'),_0xd613('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd613('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd613('0x1')]},'directmediadeny':{'type':Sequelize[_0xd613('0x1')]},'nat':{'type':Sequelize[_0xd613('0x1')],'defaultValue':_0xd613('0x19'),'set':function(_0x3dfbe0){this[_0xd613('0x1a')](_0xd613('0x1b'),_0x3dfbe0?_0x3dfbe0[_0xd613('0xf')](','):null);},'get':function(){return this[_0xd613('0x10')](_0xd613('0x1b'))?this['getDataValue'](_0xd613('0x1b'))[_0xd613('0x12')](','):null;},'comment':_0xd613('0x1c')},'callgroup':{'type':Sequelize[_0xd613('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xd613('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xd613('0x1')]},'language':{'type':Sequelize[_0xd613('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd613('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd613('0x1')],'defaultValue':_0xd613('0x1d')},'allow':{'type':Sequelize[_0xd613('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xcbed4f){this['setDataValue']('allow',_0xcbed4f?_0xcbed4f[_0xd613('0xf')](';'):_0xd613('0x1e'));},'get':function(){return this[_0xd613('0x10')]('allow')?this['getDataValue']('allow')[_0xd613('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'insecure':{'type':Sequelize[_0xd613('0x1')],'defaultValue':'port,invite','set':function(_0x463666){this[_0xd613('0x1a')](_0xd613('0x20'),_0x463666?_0x463666[_0xd613('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xd613('0x20'))?this[_0xd613('0x10')](_0xd613('0x20'))[_0xd613('0x12')](','):null;},'comment':_0xd613('0x21')},'trustrpid':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd613('0x2')]('yes','no',_0xd613('0x22'))},'promiscredir':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no')},'useclientcode':{'type':Sequelize[_0xd613('0x2')]('yes','no')},'accountcode':{'type':Sequelize[_0xd613('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd613('0x24')},'amaflags':{'type':Sequelize[_0xd613('0x1')]},'callcounter':{'type':Sequelize[_0xd613('0x2')]('yes','no'),'defaultValue':_0xd613('0x1f')},'busylevel':{'type':Sequelize[_0xd613('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'allowsubscribe':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no')},'subscribecontext':{'type':Sequelize[_0xd613('0x1')]},'template':{'type':Sequelize[_0xd613('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no',_0xd613('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x26'),'refuse',_0xd613('0x27'))},'session_expires':{'type':Sequelize[_0xd613('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xd613('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x28'),_0xd613('0x29')),'defaultValue':_0xd613('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0xd613('0x1')]},'regexten':{'type':Sequelize[_0xd613('0x1')]},'fromdomain':{'type':Sequelize[_0xd613('0x1')]},'fromuser':{'type':Sequelize[_0xd613('0x1')]},'port':{'type':Sequelize[_0xd613('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xd613('0x23')](0xb)},'defaultip':{'type':Sequelize[_0xd613('0x1')]},'defaultuser':{'type':Sequelize[_0xd613('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd613('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no',_0xd613('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd613('0x1')]},'callbackextension':{'type':Sequelize[_0xd613('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0xd613('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xd613('0x1')]},'contactdeny':{'type':Sequelize[_0xd613('0x1')]},'contactacl':{'type':Sequelize[_0xd613('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xd613('0x1')]},'use_q850_reason':{'type':Sequelize[_0xd613('0x1')]},'maxforwards':{'type':Sequelize[_0xd613('0x23')](0xb)},'encryption':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'force_avp':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no')},'dtlsenable':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'dtlsverify':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no','fingerprint',_0xd613('0x2b'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xd613('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xd613('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xd613('0x1')]},'dtlscapath':{'type':Sequelize[_0xd613('0x1')]},'dtlssetup':{'type':Sequelize['ENUM'](_0xd613('0x2c'),_0xd613('0x2d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd613('0x1')]},'usereqphone':{'type':Sequelize[_0xd613('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd613('0x1')]},'recordofffeature':{'type':Sequelize[_0xd613('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xd613('0x1f'),'no')},'subscribemwi':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xd613('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd613('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xd613('0x2')](_0xd613('0x1f'),'no','nonat',_0xd613('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xd613('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd613('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x9202=['actpass','update,nonat','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','refuse','originate','uac','uas','pai','certificate','active','passive'];(function(_0x3fe420,_0xd54a21){var _0xcffb06=function(_0x17f8b6){while(--_0x17f8b6){_0x3fe420['push'](_0x3fe420['shift']());}};_0xcffb06(++_0xd54a21);}(_0x9202,0x10b));var _0x2920=function(_0x504b2d,_0x34db64){_0x504b2d=_0x504b2d-0x0;var _0x35d0aa=_0x9202[_0x504b2d];return _0x35d0aa;};'use strict';var Sequelize=require(_0x2920('0x0'));module[_0x2920('0x1')]={'name':{'type':Sequelize[_0x2920('0x2')],'allowNull':![],'unique':_0x2920('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2920('0x4')]('friend',_0x2920('0x5'),_0x2920('0x6')),'allowNull':![],'defaultValue':_0x2920('0x7')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2920('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0x2920('0x9'),_0x2920('0xa'),_0x2920('0xb'),_0x2920('0xc'),_0x2920('0xd'),_0x2920('0xe'),_0x2920('0xf'),_0x2920('0x10'))},'deny':{'type':Sequelize[_0x2920('0x2')]},'permit':{'type':Sequelize[_0x2920('0x2')]},'secret':{'type':Sequelize[_0x2920('0x2')]},'md5secret':{'type':Sequelize[_0x2920('0x2')]},'remotesecret':{'type':Sequelize[_0x2920('0x2')]},'transport':{'type':Sequelize[_0x2920('0x2')],'defaultValue':'udp','set':function(_0x3a7ecb){this[_0x2920('0x11')](_0x2920('0x12'),_0x3a7ecb?_0x3a7ecb[_0x2920('0x13')](','):null);},'get':function(){return this[_0x2920('0x14')](_0x2920('0x12'))?this[_0x2920('0x14')](_0x2920('0x12'))[_0x2920('0x15')](','):null;},'comment':_0x2920('0x16')},'dtmfmode':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x17'),'info','shortinfo',_0x2920('0x18'),_0x2920('0x19')),'defaultValue':_0x2920('0x17')},'directmedia':{'type':Sequelize['ENUM'](_0x2920('0x1a'),'no',_0x2920('0x1b'),_0x2920('0x1c'),_0x2920('0x1d')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2920('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2920('0x2')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x2920('0x2')],'defaultValue':_0x2920('0x1e'),'set':function(_0x5a723f){this[_0x2920('0x11')](_0x2920('0x1f'),_0x5a723f?_0x5a723f['join'](','):null);},'get':function(){return this['getDataValue'](_0x2920('0x1f'))?this[_0x2920('0x14')](_0x2920('0x1f'))[_0x2920('0x15')](','):null;},'comment':_0x2920('0x20')},'callgroup':{'type':Sequelize[_0x2920('0x2')]},'namedcallgroup':{'type':Sequelize[_0x2920('0x2')]},'pickupgroup':{'type':Sequelize[_0x2920('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x2920('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2920('0x2')],'defaultValue':_0x2920('0x21')},'allow':{'type':Sequelize[_0x2920('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3fc581){this['setDataValue'](_0x2920('0x22'),_0x3fc581?_0x3fc581[_0x2920('0x13')](';'):_0x2920('0x23'));},'get':function(){return this[_0x2920('0x14')](_0x2920('0x22'))?this[_0x2920('0x14')](_0x2920('0x22'))[_0x2920('0x15')](';'):null;},'comment':_0x2920('0x24')},'autoframing':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'insecure':{'type':Sequelize[_0x2920('0x2')],'defaultValue':_0x2920('0x25'),'set':function(_0x4bf05c){this[_0x2920('0x11')](_0x2920('0x26'),_0x4bf05c?_0x4bf05c[_0x2920('0x13')](','):null);},'get':function(){return this[_0x2920('0x14')](_0x2920('0x26'))?this[_0x2920('0x14')]('insecure')['split'](','):null;},'comment':_0x2920('0x27')},'trustrpid':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2920('0x4')]('yes','no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0x2920('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x2920('0x28')](0xb)},'setvar':{'type':Sequelize[_0x2920('0x2')]},'callerid':{'type':Sequelize[_0x2920('0x2')],'defaultValue':_0x2920('0x29')},'amaflags':{'type':Sequelize[_0x2920('0x2')]},'callcounter':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no'),'defaultValue':_0x2920('0x1a')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x2920('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x2920('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x2920('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x2920('0x1a'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize['ENUM'](_0x2920('0x2a'),_0x2920('0x2b'),_0x2920('0x2c'))},'session_expires':{'type':Sequelize[_0x2920('0x28')](0xb)},'session_minse':{'type':Sequelize[_0x2920('0x28')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2920('0x2d'),_0x2920('0x2e')),'defaultValue':_0x2920('0x2e')},'t38pt_usertpsource':{'type':Sequelize[_0x2920('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x2920('0x2')]},'port':{'type':Sequelize[_0x2920('0x28')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x2920('0x1a')},'keepalive':{'type':Sequelize[_0x2920('0x28')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x2920('0x2')]},'rtptimeout':{'type':Sequelize[_0x2920('0x28')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2920('0x28')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x2920('0x28')](0xb)},'sendrpid':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no',_0x2920('0x2f')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2920('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x2920('0x28')](0xb)},'timerb':{'type':Sequelize[_0x2920('0x28')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2920('0x28')](0xb)},'contactpermit':{'type':Sequelize[_0x2920('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2920('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2920('0x2')]},'use_q850_reason':{'type':Sequelize[_0x2920('0x2')]},'maxforwards':{'type':Sequelize[_0x2920('0x28')](0xb)},'encryption':{'type':Sequelize[_0x2920('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x2920('0x1a'),'no')},'force_avp':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'icesupport':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'dtlsverify':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no','fingerprint',_0x2920('0x30'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x2920('0x2')]},'dtlscipher':{'type':Sequelize[_0x2920('0x2')]},'dtlscafile':{'type':Sequelize[_0x2920('0x2')]},'dtlscapath':{'type':Sequelize[_0x2920('0x2')]},'dtlssetup':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x31'),_0x2920('0x32'),_0x2920('0x33')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2920('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x2920('0x28')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0x2920('0x4')](_0x2920('0x1a'),'no')},'vmexten':{'type':Sequelize[_0x2920('0x2')]},'mohinterpret':{'type':Sequelize[_0x2920('0x2')]},'mohsuggest':{'type':Sequelize[_0x2920('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x2920('0x4')]('yes','no',_0x2920('0x1b'),_0x2920('0x1c'),_0x2920('0x34')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x2920('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2920('0x2')],'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 4498367..2a46c34 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 _0x803f=['squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../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~!@#$%^&-_=+[{]}.','request','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','Trunks','UserProfileResource','end','name','send','index','map','Trunk','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','keys','include','find','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','params','findAll','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x803f,0x64));var _0xf803=function(_0x43d4ef,_0xa5eaff){_0x43d4ef=_0x43d4ef-0x0;var _0x3369f2=_0x803f[_0x43d4ef];return _0x3369f2;};'use strict';var pdf=require(_0xf803('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf803('0x1'));var zipdir=require(_0xf803('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf803('0x3'));var moment=require(_0xf803('0x4'));var BPromise=require(_0xf803('0x5'));var Mustache=require(_0xf803('0x6'));var util=require(_0xf803('0x7'));var path=require('path');var sox=require(_0xf803('0x8'));var csv=require(_0xf803('0x9'));var ejs=require(_0xf803('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf803('0xb'));var crypto=require(_0xf803('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf803('0xd'));var toCsv=require(_0xf803('0x9'));var querystring=require(_0xf803('0xe'));var Papa=require('papaparse');var Redis=require(_0xf803('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf803('0x10'));var as=require(_0xf803('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf803('0x12'))(_0xf803('0x13'));var utils=require(_0xf803('0x14'));var config=require(_0xf803('0x15'));var db=require(_0xf803('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf803('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2a6ed9,_0x508df0,_0x30fc8a){if(_0x30fc8a){var _0x48fc69=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x48fc69[_0xf803('0x18')](_0x508df0)){return _0x2a6ed9;}else{throw new db[(_0xf803('0x19'))][(_0xf803('0x1a'))](_0xf803('0x1b'));}}else{return _0x2a6ed9;}}function respondWithRpcPromise(_0x58a80b,_0xf08041,_0x135230,_0x3d07ca){return new BPromise(function(_0x11373e,_0x2aaef6){var _0xd170bc=_0x3d07ca||client;return _0xd170bc[_0xf803('0x1c')](_0x58a80b,_0x135230)['then'](function(_0x50a67c){logger[_0xf803('0x1d')](_0xf803('0x1e'),_0xf08041,_0xf803('0x1f'));logger[_0xf803('0x20')](_0xf803('0x21'),_0xf08041,_0xf803('0x1f'),JSON[_0xf803('0x22')](_0x50a67c));if(_0x50a67c[_0xf803('0x23')]){if(_0x50a67c[_0xf803('0x23')][_0xf803('0x24')]===0x1f4){logger['error'](_0xf803('0x1e'),_0xf08041,_0x50a67c[_0xf803('0x23')][_0xf803('0x25')]);return _0x2aaef6(_0x50a67c[_0xf803('0x23')][_0xf803('0x25')]);}logger['error'](_0xf803('0x1e'),_0xf08041,_0x50a67c[_0xf803('0x23')]['message']);return _0x11373e(_0x50a67c[_0xf803('0x23')][_0xf803('0x25')]);}else{logger[_0xf803('0x1d')](_0xf803('0x1e'),_0xf08041,_0xf803('0x1f'));_0x11373e(_0x50a67c[_0xf803('0x26')][_0xf803('0x25')]);}})[_0xf803('0x27')](function(_0x393d0c){logger[_0xf803('0x23')](_0xf803('0x1e'),_0xf08041,_0x393d0c);_0x2aaef6(_0x393d0c);});});}function respondWithStatusCode(_0x57eaab,_0x1c91c2){_0x1c91c2=_0x1c91c2||0xcc;return function(_0x38bf79){if(_0x38bf79){return _0x57eaab[_0xf803('0x28')](_0x1c91c2);}return _0x57eaab[_0xf803('0x29')](_0x1c91c2)['end']();};}function respondWithResult(_0x483890,_0x17a57a){_0x17a57a=_0x17a57a||0xc8;return function(_0xa5d34){if(_0xa5d34){return _0x483890[_0xf803('0x29')](_0x17a57a)['json'](_0xa5d34);}};}function respondWithFilteredResult(_0x8a1ab,_0x1bf56a){return function(_0x4994e9){if(_0x4994e9){var _0x572558=_0x4994e9[_0xf803('0x2a')],_0x2b8727=_0x1bf56a[_0xf803('0x2b')],_0x2e5152=_0x1bf56a[_0xf803('0x2b')]+_0x1bf56a['limit'],_0x5757c9;if(_0x2e5152>=_0x572558){_0x2e5152=_0x572558;_0x5757c9=0xc8;}else{_0x5757c9=0xce;}_0x8a1ab[_0xf803('0x29')](_0x5757c9);return _0x8a1ab[_0xf803('0x2c')](_0xf803('0x2d'),_0x2b8727+'-'+_0x2e5152+'/'+_0x572558)[_0xf803('0x2e')](_0x4994e9);}return null;};}function patchUpdates(_0x42a35c){return function(_0xd1545){try{jsonpatch[_0xf803('0x2f')](_0xd1545,_0x42a35c,!![]);}catch(_0x2ebd22){return BPromise[_0xf803('0x30')](_0x2ebd22);}return _0xd1545[_0xf803('0x31')]();};}function saveUpdates(_0x50185b,_0x46a3f8){return function(_0x5bc426){if(_0x5bc426){return _0x5bc426[_0xf803('0x32')](_0x50185b)['then'](function(_0xc6d4e8){return _0xc6d4e8;});}return null;};}function removeEntity(_0x112430,_0x466e41){return function(_0x31a071){if(_0x31a071){return _0x31a071[_0xf803('0x33')]()[_0xf803('0x34')](function(){var _0x1436d7=_0x31a071['get']({'plain':!![]});var _0x2a4daa=_0xf803('0x35');return db[_0xf803('0x36')][_0xf803('0x33')]({'where':{'type':_0x2a4daa,'resourceId':_0x1436d7['id']}})[_0xf803('0x34')](function(){return _0x31a071;});})[_0xf803('0x34')](function(){_0x112430[_0xf803('0x29')](0xcc)[_0xf803('0x37')]();});}};}function handleEntityNotFound(_0x356242,_0x3879d7){return function(_0x55dccd){if(!_0x55dccd){_0x356242['sendStatus'](0x194);}return _0x55dccd;};}function handleError(_0x3e8399,_0x5b2f05){_0x5b2f05=_0x5b2f05||0x1f4;return function(_0x51887c){logger[_0xf803('0x23')](_0x51887c['stack']);if(_0x51887c[_0xf803('0x38')]){delete _0x51887c[_0xf803('0x38')];}_0x3e8399[_0xf803('0x29')](_0x5b2f05)[_0xf803('0x39')](_0x51887c);};}exports[_0xf803('0x3a')]=function(_0x1225d1,_0x2030cc){var _0xc08c3c={},_0x450be6={},_0xc6a3c7={'count':0x0,'rows':[]};var _0x479289=_[_0xf803('0x3b')](db[_0xf803('0x3c')][_0xf803('0x3d')],function(_0xc1569c){return{'name':_0xc1569c[_0xf803('0x3e')],'type':_0xc1569c['type'][_0xf803('0x3f')]};});_0x450be6[_0xf803('0x40')]=_[_0xf803('0x3b')](_0x479289,'name');_0x450be6['query']=_['keys'](_0x1225d1[_0xf803('0x41')]);_0x450be6[_0xf803('0x42')]=_['intersection'](_0x450be6[_0xf803('0x40')],_0x450be6['query']);_0xc08c3c[_0xf803('0x43')]=_[_0xf803('0x44')](_0x450be6[_0xf803('0x40')],qs[_0xf803('0x45')](_0x1225d1[_0xf803('0x41')][_0xf803('0x45')]));_0xc08c3c[_0xf803('0x43')]=_0xc08c3c[_0xf803('0x43')][_0xf803('0x46')]?_0xc08c3c['attributes']:_0x450be6[_0xf803('0x40')];if(!_0x1225d1['query'][_0xf803('0x47')](_0xf803('0x48'))){_0xc08c3c[_0xf803('0x49')]=qs['limit'](_0x1225d1[_0xf803('0x41')]['limit']);_0xc08c3c[_0xf803('0x2b')]=qs['offset'](_0x1225d1[_0xf803('0x41')][_0xf803('0x2b')]);}_0xc08c3c['order']=qs[_0xf803('0x4a')](_0x1225d1[_0xf803('0x41')][_0xf803('0x4a')]);_0xc08c3c[_0xf803('0x4b')]=qs[_0xf803('0x42')](_[_0xf803('0x4c')](_0x1225d1[_0xf803('0x41')],_0x450be6[_0xf803('0x42')]),_0x479289);if(_0x1225d1[_0xf803('0x41')][_0xf803('0x4d')]){_0xc08c3c[_0xf803('0x4b')]=_[_0xf803('0x4e')](_0xc08c3c[_0xf803('0x4b')],{'$or':_['map'](_0x479289,function(_0x3c97c0){if(_0x3c97c0['type']!==_0xf803('0x4f')){var _0x3b3cac={};_0x3b3cac[_0x3c97c0['name']]={'$like':'%'+_0x1225d1[_0xf803('0x41')]['filter']+'%'};return _0x3b3cac;}})});}_0xc08c3c=_[_0xf803('0x4e')]({},_0xc08c3c,_0x1225d1[_0xf803('0x50')]);var _0x47b8c1={'where':_0xc08c3c[_0xf803('0x4b')]};return db[_0xf803('0x3c')][_0xf803('0x2a')](_0x47b8c1)[_0xf803('0x34')](function(_0xc529aa){_0xc6a3c7[_0xf803('0x2a')]=_0xc529aa;if(_0x1225d1[_0xf803('0x41')][_0xf803('0x51')]){_0xc08c3c['include']=[{'all':!![]}];}return db[_0xf803('0x3c')]['findAll'](_0xc08c3c);})[_0xf803('0x34')](function(_0x482fb6){_0xc6a3c7['rows']=_0x482fb6;return _0xc6a3c7;})['then'](respondWithFilteredResult(_0x2030cc,_0xc08c3c))[_0xf803('0x27')](handleError(_0x2030cc,null));};exports['show']=function(_0x10dc65,_0x4035de){var _0x3b96a2={'raw':![],'where':{'id':_0x10dc65['params']['id']}},_0x40674f={};_0x40674f[_0xf803('0x40')]=_[_0xf803('0x52')](db[_0xf803('0x3c')][_0xf803('0x3d')]);_0x40674f[_0xf803('0x41')]=_[_0xf803('0x52')](_0x10dc65[_0xf803('0x41')]);_0x40674f['filters']=_['intersection'](_0x40674f[_0xf803('0x40')],_0x40674f[_0xf803('0x41')]);_0x3b96a2['attributes']=_['intersection'](_0x40674f[_0xf803('0x40')],qs[_0xf803('0x45')](_0x10dc65[_0xf803('0x41')]['fields']));_0x3b96a2['attributes']=_0x3b96a2[_0xf803('0x43')][_0xf803('0x46')]?_0x3b96a2['attributes']:_0x40674f['model'];if(_0x10dc65[_0xf803('0x41')]['includeAll']){_0x3b96a2[_0xf803('0x53')]=[{'all':!![]}];}_0x3b96a2=_['merge']({},_0x3b96a2,_0x10dc65[_0xf803('0x50')]);return db[_0xf803('0x3c')][_0xf803('0x54')](_0x3b96a2)[_0xf803('0x34')](handleEntityNotFound(_0x4035de,null))[_0xf803('0x34')](respondWithResult(_0x4035de,null))[_0xf803('0x27')](handleError(_0x4035de,null));};exports['clone']=function(_0xd413ac,_0x2cd431){var _0x4362aa={'where':{'id':_0xd413ac['params']['id']}},_0x4989b9={};_0x4989b9[_0xf803('0x40')]=_[_0xf803('0x52')](db[_0xf803('0x3c')][_0xf803('0x3d')]);_0x4362aa[_0xf803('0x43')]=_[_0xf803('0x44')](_0x4989b9[_0xf803('0x40')],qs['fields'](_0xd413ac[_0xf803('0x41')][_0xf803('0x45')]));_0x4362aa[_0xf803('0x43')]=_0x4362aa[_0xf803('0x43')][_0xf803('0x46')]?_0x4362aa['attributes']:_0x4989b9[_0xf803('0x40')];if(_0xd413ac[_0xf803('0x41')][_0xf803('0x51')]){_0x4362aa[_0xf803('0x53')]=[{'all':!![]}];}_0x4362aa=_[_0xf803('0x4e')]({},_0x4362aa,_0xd413ac['options']);return db[_0xf803('0x3c')][_0xf803('0x54')](_0x4362aa)['then'](handleEntityNotFound(_0x2cd431,null))[_0xf803('0x34')](function(_0x211a7b){if(_0x211a7b){var _0x17f8c8=_0x211a7b[_0xf803('0x55')]({'plain':!![]});_0x17f8c8=qs[_0xf803('0x56')](_0x17f8c8,['id',_0xf803('0x57'),_0xf803('0x58')]);_0xd413ac[_0xf803('0x59')]=_[_0xf803('0x56')](_0xd413ac[_0xf803('0x59')],['id',_0xf803('0x57'),_0xf803('0x58')]);return db[_0xf803('0x3c')][_0xf803('0x5a')](_['merge'](_0x17f8c8,_0xd413ac[_0xf803('0x59')]),{'include':_0xd413ac['query'][_0xf803('0x51')]?[{'all':!![]}]:undefined})[_0xf803('0x34')](function(_0x41a70f){var _0x47164a=_0xd413ac['user']['get']({'plain':!![]});if(!_0x47164a)throw new Error(_0xf803('0x5b'));if(_0x47164a[_0xf803('0x5c')]===_0xf803('0x5d')){var _0x50046d=_0x41a70f[_0xf803('0x55')]({'plain':!![]});var _0x4b1542=_0xf803('0x35');return db[_0xf803('0x5e')][_0xf803('0x54')]({'where':{'name':_0x4b1542,'userProfileId':_0x47164a[_0xf803('0x5f')]},'raw':!![]})[_0xf803('0x34')](function(_0x28080d){if(_0x28080d&&_0x28080d[_0xf803('0x60')]===0x0){return db[_0xf803('0x36')]['create']({'name':_0x50046d[_0xf803('0x38')],'resourceId':_0x50046d['id'],'type':_0x28080d['name'],'sectionId':_0x28080d['id']},{})['then'](function(){return _0x41a70f;});}else{return _0x41a70f;}})['catch'](function(_0x56db6a){logger[_0xf803('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56db6a);throw _0x56db6a;});}return _0x41a70f;});}})[_0xf803('0x34')](respondWithResult(_0x2cd431,0xc9))[_0xf803('0x27')](handleError(_0x2cd431,null));};exports[_0xf803('0x5a')]=function(_0x23b58c,_0x571fb4,_0x188192){var _0x5958cd;return db[_0xf803('0x3c')][_0xf803('0x5a')](_0x23b58c[_0xf803('0x59')],{'raw':!![]})[_0xf803('0x34')](function(_0x357d0e){_0x5958cd=_0x357d0e;return db[_0xf803('0x3c')]['findAll']({'raw':!![]});})[_0xf803('0x34')](function(_0x1b1e05){var _0x547aa4=fs[_0xf803('0x61')](path[_0xf803('0x62')](config[_0xf803('0x63')],_0xf803('0x64')),_0xf803('0x65'));var _0x1280c2=fs[_0xf803('0x61')](path[_0xf803('0x62')](config[_0xf803('0x63')],_0xf803('0x66')),_0xf803('0x65'));var _0x228691=ejs['render'](_0x547aa4,{'trunks':_0x1b1e05||[]});fs[_0xf803('0x67')](_0xf803('0x68'),_0x228691);if(_0x5958cd['registry']){var _0x5bbc69=ejs[_0xf803('0x69')](_0x1280c2,{'trunks':_0x1b1e05||[]});fs[_0xf803('0x67')](_0xf803('0x6a'),_0x5bbc69);}})['then'](function(){return respondWithRpcPromise(_0xf803('0x6b'),_0xf803('0x5a'),{'module':_0xf803('0x6c')});})[_0xf803('0x34')](function(){var _0x2ee23f=_0x23b58c[_0xf803('0x5d')][_0xf803('0x55')]({'plain':!![]});if(!_0x2ee23f)throw new Error(_0xf803('0x5b'));if(_0x2ee23f['role']===_0xf803('0x5d')){var _0x5467bf=_0x5958cd['get']({'plain':!![]});return db[_0xf803('0x5e')][_0xf803('0x54')]({'where':{'name':_0xf803('0x35'),'userProfileId':_0x2ee23f[_0xf803('0x5f')]},'raw':!![]})[_0xf803('0x34')](function(_0x402ed6){if(_0x402ed6&&_0x402ed6[_0xf803('0x60')]===0x0){return db[_0xf803('0x36')][_0xf803('0x5a')]({'name':_0x5467bf[_0xf803('0x38')],'resourceId':_0x5467bf['id'],'type':_0x402ed6[_0xf803('0x38')],'sectionId':_0x402ed6['id']},{})[_0xf803('0x34')](function(){return _0x5958cd;});}else{return _0x5958cd;}})[_0xf803('0x27')](function(_0x3fbaa4){logger[_0xf803('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fbaa4);throw _0x3fbaa4;});}return _0x5958cd;})['then'](respondWithResult(_0x571fb4,0xc9))[_0xf803('0x27')](handleError(_0x571fb4,null));};exports['update']=function(_0x1649fa,_0x5f2f74,_0x24241b){var _0x1490be;return db[_0xf803('0x3c')][_0xf803('0x54')]({'where':{'id':_0x1649fa[_0xf803('0x6d')]['id']}})['then'](handleEntityNotFound(_0x5f2f74,null))['then'](saveUpdates(_0x1649fa[_0xf803('0x59')],null))[_0xf803('0x34')](function(_0x304a55){if(_0x304a55){_0x1490be=_0x304a55;return db[_0xf803('0x3c')][_0xf803('0x6e')]({'raw':!![]});}})[_0xf803('0x34')](function(_0x432318){if(_0x432318){var _0x14e26e=fs[_0xf803('0x61')](path[_0xf803('0x62')](config[_0xf803('0x63')],_0xf803('0x64')),_0xf803('0x65'));var _0x439f14=fs[_0xf803('0x61')](path[_0xf803('0x62')](config['root'],_0xf803('0x66')),'utf8');var _0x3c2bd8=ejs[_0xf803('0x69')](_0x14e26e,{'trunks':_0x432318||[]});fs[_0xf803('0x67')](_0xf803('0x68'),_0x3c2bd8);var _0x554631=ejs[_0xf803('0x69')](_0x439f14,{'trunks':_0x432318||[]});fs[_0xf803('0x67')](_0xf803('0x6a'),_0x554631);return respondWithRpcPromise(_0xf803('0x6b'),_0xf803('0x32'),{'module':_0xf803('0x6c')});}return null;})[_0xf803('0x34')](function(_0xa2b37){if(_0xa2b37){return _0x1490be;}})[_0xf803('0x34')](respondWithResult(_0x5f2f74,null))['catch'](handleError(_0x5f2f74,null));};exports[_0xf803('0x33')]=function(_0x411db1,_0x3e08db,_0x243f03){var _0x34d414;return db[_0xf803('0x3c')]['find']({'where':{'id':_0x411db1[_0xf803('0x6d')]['id']}})[_0xf803('0x34')](handleEntityNotFound(_0x3e08db,null))[_0xf803('0x34')](removeEntity(_0x3e08db,null))['then'](function(){return db[_0xf803('0x3c')]['findAll']({'raw':!![]});})[_0xf803('0x34')](function(_0xd9a688){var _0x11b7b2=fs[_0xf803('0x61')](path[_0xf803('0x62')](config[_0xf803('0x63')],_0xf803('0x64')),'utf8');var _0x3330f5=fs[_0xf803('0x61')](path[_0xf803('0x62')](config['root'],_0xf803('0x66')),_0xf803('0x65'));var _0x15428f=ejs[_0xf803('0x69')](_0x11b7b2,{'trunks':_0xd9a688});var _0xc6742=ejs['render'](_0x3330f5,{'trunks':_0xd9a688});fs[_0xf803('0x67')](_0xf803('0x68'),_0x15428f);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xc6742);return respondWithRpcPromise(_0xf803('0x6b'),_0xf803('0x33'),{'module':_0xf803('0x6c')});})[_0xf803('0x27')](handleError(_0x3e08db,null));}; \ No newline at end of file +var _0x4f7b=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','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','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','set','save','update','destroy','Trunks','UserProfileResource','stack','name','index','Trunk','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','options','include','show','params','find','clone','get','updatedAt','body','createdAt','includeAll','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','findAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce'];(function(_0x5ad3d3,_0x2d400c){var _0x4344e7=function(_0x557356){while(--_0x557356){_0x5ad3d3['push'](_0x5ad3d3['shift']());}};_0x4344e7(++_0x2d400c);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x2ab495,_0x6abed5){_0x2ab495=_0x2ab495-0x0;var _0x503f92=_0x4f7b[_0x2ab495];return _0x503f92;};'use strict';var pdf=require(_0xb4f7('0x0'));var emlformat=require(_0xb4f7('0x1'));var rimraf=require(_0xb4f7('0x2'));var zipdir=require(_0xb4f7('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4f7('0x4'));var moment=require(_0xb4f7('0x5'));var BPromise=require(_0xb4f7('0x6'));var Mustache=require(_0xb4f7('0x7'));var util=require(_0xb4f7('0x8'));var path=require(_0xb4f7('0x9'));var sox=require(_0xb4f7('0xa'));var csv=require(_0xb4f7('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb4f7('0xc'));var squel=require('squel');var crypto=require(_0xb4f7('0xd'));var jsforce=require(_0xb4f7('0xe'));var deskjs=require(_0xb4f7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb4f7('0x10'));var Papa=require('papaparse');var Redis=require(_0xb4f7('0x11'));var authService=require(_0xb4f7('0x12'));var qs=require(_0xb4f7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb4f7('0x14'));var logger=require(_0xb4f7('0x15'))(_0xb4f7('0x16'));var utils=require(_0xb4f7('0x17'));var config=require(_0xb4f7('0x18'));var db=require(_0xb4f7('0x19'))['db'];var jayson=require(_0xb4f7('0x1a'));var client=jayson[_0xb4f7('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x28f487,_0x226994,_0x43e112){if(_0x43e112){var _0x989c29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x989c29[_0xb4f7('0x1c')](_0x226994)){return _0x28f487;}else{throw new db[(_0xb4f7('0x1d'))]['ValidationError'](_0xb4f7('0x1e'));}}else{return _0x28f487;}}function respondWithRpcPromise(_0x58939f,_0x3db926,_0x2f4a91,_0x8bd17c){return new BPromise(function(_0x2c304b,_0x33e473){var _0x35ce44=_0x8bd17c||client;return _0x35ce44[_0xb4f7('0x1f')](_0x58939f,_0x2f4a91)[_0xb4f7('0x20')](function(_0x12ea5d){logger['info'](_0xb4f7('0x21'),_0x3db926,_0xb4f7('0x22'));logger[_0xb4f7('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3db926,_0xb4f7('0x22'),JSON[_0xb4f7('0x24')](_0x12ea5d));if(_0x12ea5d[_0xb4f7('0x25')]){if(_0x12ea5d['error']['code']===0x1f4){logger[_0xb4f7('0x25')](_0xb4f7('0x21'),_0x3db926,_0x12ea5d['error'][_0xb4f7('0x26')]);return _0x33e473(_0x12ea5d[_0xb4f7('0x25')][_0xb4f7('0x26')]);}logger[_0xb4f7('0x25')]('Trunk,\x20%s,\x20%s',_0x3db926,_0x12ea5d[_0xb4f7('0x25')]['message']);return _0x2c304b(_0x12ea5d[_0xb4f7('0x25')][_0xb4f7('0x26')]);}else{logger[_0xb4f7('0x27')](_0xb4f7('0x21'),_0x3db926,_0xb4f7('0x22'));_0x2c304b(_0x12ea5d[_0xb4f7('0x28')]['message']);}})[_0xb4f7('0x29')](function(_0x291166){logger[_0xb4f7('0x25')](_0xb4f7('0x21'),_0x3db926,_0x291166);_0x33e473(_0x291166);});});}function respondWithStatusCode(_0x2ec8d4,_0x2705e3){_0x2705e3=_0x2705e3||0xcc;return function(_0x57cf99){if(_0x57cf99){return _0x2ec8d4[_0xb4f7('0x2a')](_0x2705e3);}return _0x2ec8d4[_0xb4f7('0x2b')](_0x2705e3)[_0xb4f7('0x2c')]();};}function respondWithResult(_0x1f385d,_0x255199){_0x255199=_0x255199||0xc8;return function(_0x594c04){if(_0x594c04){return _0x1f385d[_0xb4f7('0x2b')](_0x255199)[_0xb4f7('0x2d')](_0x594c04);}};}function respondWithFilteredResult(_0x52922c,_0x18b1f3){return function(_0x467541){if(_0x467541){var _0x99a8bb=_0x467541[_0xb4f7('0x2e')],_0x35582a=_0x18b1f3[_0xb4f7('0x2f')],_0x47ba78=_0x18b1f3[_0xb4f7('0x2f')]+_0x18b1f3['limit'],_0x2cb1b3;if(_0x47ba78>=_0x99a8bb){_0x47ba78=_0x99a8bb;_0x2cb1b3=0xc8;}else{_0x2cb1b3=0xce;}_0x52922c['status'](_0x2cb1b3);return _0x52922c[_0xb4f7('0x30')]('Content-Range',_0x35582a+'-'+_0x47ba78+'/'+_0x99a8bb)[_0xb4f7('0x2d')](_0x467541);}return null;};}function patchUpdates(_0x2d61f0){return function(_0x4d21a1){try{jsonpatch['apply'](_0x4d21a1,_0x2d61f0,!![]);}catch(_0x1d6625){return BPromise['reject'](_0x1d6625);}return _0x4d21a1[_0xb4f7('0x31')]();};}function saveUpdates(_0x268449,_0x365b54){return function(_0x20d2ba){if(_0x20d2ba){return _0x20d2ba[_0xb4f7('0x32')](_0x268449)[_0xb4f7('0x20')](function(_0x6db48c){return _0x6db48c;});}return null;};}function removeEntity(_0x4824f5,_0x554f69){return function(_0x2d51c2){if(_0x2d51c2){return _0x2d51c2[_0xb4f7('0x33')]()['then'](function(){var _0x1dcd2b=_0x2d51c2['get']({'plain':!![]});var _0x107940=_0xb4f7('0x34');return db[_0xb4f7('0x35')][_0xb4f7('0x33')]({'where':{'type':_0x107940,'resourceId':_0x1dcd2b['id']}})[_0xb4f7('0x20')](function(){return _0x2d51c2;});})[_0xb4f7('0x20')](function(){_0x4824f5[_0xb4f7('0x2b')](0xcc)[_0xb4f7('0x2c')]();});}};}function handleEntityNotFound(_0x231f41,_0x13c36e){return function(_0x4a0b1b){if(!_0x4a0b1b){_0x231f41[_0xb4f7('0x2a')](0x194);}return _0x4a0b1b;};}function handleError(_0x13e7e5,_0x171a35){_0x171a35=_0x171a35||0x1f4;return function(_0x467203){logger[_0xb4f7('0x25')](_0x467203[_0xb4f7('0x36')]);if(_0x467203[_0xb4f7('0x37')]){delete _0x467203[_0xb4f7('0x37')];}_0x13e7e5[_0xb4f7('0x2b')](_0x171a35)['send'](_0x467203);};}exports[_0xb4f7('0x38')]=function(_0x8ccfef,_0x52304){var _0x16eb19={},_0x19999d={},_0x539858={'count':0x0,'rows':[]};var _0x4b8fbf=_['map'](db[_0xb4f7('0x39')][_0xb4f7('0x3a')],function(_0x5c59a0){return{'name':_0x5c59a0[_0xb4f7('0x3b')],'type':_0x5c59a0[_0xb4f7('0x3c')][_0xb4f7('0x3d')]};});_0x19999d[_0xb4f7('0x3e')]=_['map'](_0x4b8fbf,_0xb4f7('0x37'));_0x19999d[_0xb4f7('0x3f')]=_[_0xb4f7('0x40')](_0x8ccfef[_0xb4f7('0x3f')]);_0x19999d['filters']=_[_0xb4f7('0x41')](_0x19999d[_0xb4f7('0x3e')],_0x19999d[_0xb4f7('0x3f')]);_0x16eb19[_0xb4f7('0x42')]=_[_0xb4f7('0x41')](_0x19999d[_0xb4f7('0x3e')],qs[_0xb4f7('0x43')](_0x8ccfef[_0xb4f7('0x3f')][_0xb4f7('0x43')]));_0x16eb19[_0xb4f7('0x42')]=_0x16eb19[_0xb4f7('0x42')][_0xb4f7('0x44')]?_0x16eb19[_0xb4f7('0x42')]:_0x19999d[_0xb4f7('0x3e')];if(!_0x8ccfef[_0xb4f7('0x3f')][_0xb4f7('0x45')](_0xb4f7('0x46'))){_0x16eb19[_0xb4f7('0x47')]=qs[_0xb4f7('0x47')](_0x8ccfef[_0xb4f7('0x3f')][_0xb4f7('0x47')]);_0x16eb19[_0xb4f7('0x2f')]=qs[_0xb4f7('0x2f')](_0x8ccfef[_0xb4f7('0x3f')]['offset']);}_0x16eb19[_0xb4f7('0x48')]=qs['sort'](_0x8ccfef[_0xb4f7('0x3f')][_0xb4f7('0x49')]);_0x16eb19[_0xb4f7('0x4a')]=qs[_0xb4f7('0x4b')](_[_0xb4f7('0x4c')](_0x8ccfef[_0xb4f7('0x3f')],_0x19999d[_0xb4f7('0x4b')]),_0x4b8fbf);if(_0x8ccfef[_0xb4f7('0x3f')][_0xb4f7('0x4d')]){_0x16eb19[_0xb4f7('0x4a')]=_['merge'](_0x16eb19[_0xb4f7('0x4a')],{'$or':_['map'](_0x4b8fbf,function(_0x18e809){if(_0x18e809[_0xb4f7('0x3c')]!=='VIRTUAL'){var _0x2173df={};_0x2173df[_0x18e809[_0xb4f7('0x37')]]={'$like':'%'+_0x8ccfef[_0xb4f7('0x3f')][_0xb4f7('0x4d')]+'%'};return _0x2173df;}})});}_0x16eb19=_[_0xb4f7('0x4e')]({},_0x16eb19,_0x8ccfef[_0xb4f7('0x4f')]);var _0x5a9622={'where':_0x16eb19[_0xb4f7('0x4a')]};return db[_0xb4f7('0x39')][_0xb4f7('0x2e')](_0x5a9622)[_0xb4f7('0x20')](function(_0x35576b){_0x539858[_0xb4f7('0x2e')]=_0x35576b;if(_0x8ccfef['query']['includeAll']){_0x16eb19[_0xb4f7('0x50')]=[{'all':!![]}];}return db[_0xb4f7('0x39')]['findAll'](_0x16eb19);})[_0xb4f7('0x20')](function(_0xe24cb7){_0x539858['rows']=_0xe24cb7;return _0x539858;})['then'](respondWithFilteredResult(_0x52304,_0x16eb19))[_0xb4f7('0x29')](handleError(_0x52304,null));};exports[_0xb4f7('0x51')]=function(_0x4f6811,_0x396893){var _0x2dffc6={'raw':![],'where':{'id':_0x4f6811[_0xb4f7('0x52')]['id']}},_0xad9da7={};_0xad9da7[_0xb4f7('0x3e')]=_['keys'](db[_0xb4f7('0x39')]['rawAttributes']);_0xad9da7['query']=_[_0xb4f7('0x40')](_0x4f6811[_0xb4f7('0x3f')]);_0xad9da7[_0xb4f7('0x4b')]=_['intersection'](_0xad9da7[_0xb4f7('0x3e')],_0xad9da7[_0xb4f7('0x3f')]);_0x2dffc6['attributes']=_[_0xb4f7('0x41')](_0xad9da7[_0xb4f7('0x3e')],qs[_0xb4f7('0x43')](_0x4f6811[_0xb4f7('0x3f')][_0xb4f7('0x43')]));_0x2dffc6[_0xb4f7('0x42')]=_0x2dffc6[_0xb4f7('0x42')][_0xb4f7('0x44')]?_0x2dffc6['attributes']:_0xad9da7[_0xb4f7('0x3e')];if(_0x4f6811[_0xb4f7('0x3f')]['includeAll']){_0x2dffc6[_0xb4f7('0x50')]=[{'all':!![]}];}_0x2dffc6=_[_0xb4f7('0x4e')]({},_0x2dffc6,_0x4f6811['options']);return db['Trunk'][_0xb4f7('0x53')](_0x2dffc6)[_0xb4f7('0x20')](handleEntityNotFound(_0x396893,null))[_0xb4f7('0x20')](respondWithResult(_0x396893,null))[_0xb4f7('0x29')](handleError(_0x396893,null));};exports[_0xb4f7('0x54')]=function(_0x20dfdc,_0x42eed7){var _0x386b87={'where':{'id':_0x20dfdc['params']['id']}},_0x3132db={};_0x3132db[_0xb4f7('0x3e')]=_[_0xb4f7('0x40')](db[_0xb4f7('0x39')][_0xb4f7('0x3a')]);_0x386b87[_0xb4f7('0x42')]=_['intersection'](_0x3132db[_0xb4f7('0x3e')],qs['fields'](_0x20dfdc[_0xb4f7('0x3f')]['fields']));_0x386b87[_0xb4f7('0x42')]=_0x386b87[_0xb4f7('0x42')][_0xb4f7('0x44')]?_0x386b87[_0xb4f7('0x42')]:_0x3132db[_0xb4f7('0x3e')];if(_0x20dfdc[_0xb4f7('0x3f')]['includeAll']){_0x386b87[_0xb4f7('0x50')]=[{'all':!![]}];}_0x386b87=_[_0xb4f7('0x4e')]({},_0x386b87,_0x20dfdc[_0xb4f7('0x4f')]);return db['Trunk'][_0xb4f7('0x53')](_0x386b87)[_0xb4f7('0x20')](handleEntityNotFound(_0x42eed7,null))[_0xb4f7('0x20')](function(_0x59e068){if(_0x59e068){var _0x45f6d1=_0x59e068[_0xb4f7('0x55')]({'plain':!![]});_0x45f6d1=qs['omit'](_0x45f6d1,['id','createdAt',_0xb4f7('0x56')]);_0x20dfdc['body']=_['omit'](_0x20dfdc[_0xb4f7('0x57')],['id',_0xb4f7('0x58'),'updatedAt']);return db[_0xb4f7('0x39')]['create'](_[_0xb4f7('0x4e')](_0x45f6d1,_0x20dfdc[_0xb4f7('0x57')]),{'include':_0x20dfdc[_0xb4f7('0x3f')][_0xb4f7('0x59')]?[{'all':!![]}]:undefined})['then'](function(_0x59bf54){var _0x19634e=_0x20dfdc[_0xb4f7('0x5a')][_0xb4f7('0x55')]({'plain':!![]});if(!_0x19634e)throw new Error(_0xb4f7('0x5b'));if(_0x19634e[_0xb4f7('0x5c')]==='user'){var _0x350125=_0x59bf54[_0xb4f7('0x55')]({'plain':!![]});var _0x1a727f=_0xb4f7('0x34');return db[_0xb4f7('0x5d')][_0xb4f7('0x53')]({'where':{'name':_0x1a727f,'userProfileId':_0x19634e['userProfileId']},'raw':!![]})['then'](function(_0x210003){if(_0x210003&&_0x210003['autoAssociation']===0x0){return db[_0xb4f7('0x35')][_0xb4f7('0x5e')]({'name':_0x350125['name'],'resourceId':_0x350125['id'],'type':_0x210003['name'],'sectionId':_0x210003['id']},{})['then'](function(){return _0x59bf54;});}else{return _0x59bf54;}})['catch'](function(_0x30976f){logger[_0xb4f7('0x25')](_0xb4f7('0x5f'),_0x30976f);throw _0x30976f;});}return _0x59bf54;});}})[_0xb4f7('0x20')](respondWithResult(_0x42eed7,0xc9))[_0xb4f7('0x29')](handleError(_0x42eed7,null));};exports[_0xb4f7('0x5e')]=function(_0x19d98f,_0x4e54b9,_0x4f0057){var _0x151ad9;return db[_0xb4f7('0x39')]['create'](_0x19d98f['body'],{'raw':!![]})[_0xb4f7('0x20')](function(_0xcc6213){_0x151ad9=_0xcc6213;return db[_0xb4f7('0x39')]['findAll']({'raw':!![]});})[_0xb4f7('0x20')](function(_0x483ae3){var _0x30dfcb=fs['readFileSync'](path[_0xb4f7('0x60')](config[_0xb4f7('0x61')],_0xb4f7('0x62')),'utf8');var _0x5e5d53=fs[_0xb4f7('0x63')](path[_0xb4f7('0x60')](config[_0xb4f7('0x61')],_0xb4f7('0x64')),_0xb4f7('0x65'));var _0x20e5ec=ejs[_0xb4f7('0x66')](_0x30dfcb,{'trunks':_0x483ae3||[]});fs['writeFileSync'](_0xb4f7('0x67'),_0x20e5ec);if(_0x151ad9['registry']){var _0x202801=ejs[_0xb4f7('0x66')](_0x5e5d53,{'trunks':_0x483ae3||[]});fs[_0xb4f7('0x68')](_0xb4f7('0x69'),_0x202801);}})['then'](function(){return respondWithRpcPromise(_0xb4f7('0x6a'),_0xb4f7('0x5e'),{'module':_0xb4f7('0x6b')});})[_0xb4f7('0x20')](function(){var _0x50f537=_0x19d98f[_0xb4f7('0x5a')][_0xb4f7('0x55')]({'plain':!![]});if(!_0x50f537)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50f537[_0xb4f7('0x5c')]===_0xb4f7('0x5a')){var _0xf537ea=_0x151ad9[_0xb4f7('0x55')]({'plain':!![]});return db[_0xb4f7('0x5d')][_0xb4f7('0x53')]({'where':{'name':_0xb4f7('0x34'),'userProfileId':_0x50f537[_0xb4f7('0x6c')]},'raw':!![]})['then'](function(_0x51e8fe){if(_0x51e8fe&&_0x51e8fe[_0xb4f7('0x6d')]===0x0){return db[_0xb4f7('0x35')][_0xb4f7('0x5e')]({'name':_0xf537ea[_0xb4f7('0x37')],'resourceId':_0xf537ea['id'],'type':_0x51e8fe[_0xb4f7('0x37')],'sectionId':_0x51e8fe['id']},{})[_0xb4f7('0x20')](function(){return _0x151ad9;});}else{return _0x151ad9;}})['catch'](function(_0x1d6cd9){logger['error'](_0xb4f7('0x5f'),_0x1d6cd9);throw _0x1d6cd9;});}return _0x151ad9;})[_0xb4f7('0x20')](respondWithResult(_0x4e54b9,0xc9))[_0xb4f7('0x29')](handleError(_0x4e54b9,null));};exports['update']=function(_0x2c116d,_0x463ddb,_0x5b3ef9){var _0x8909ac;return db['Trunk'][_0xb4f7('0x53')]({'where':{'id':_0x2c116d[_0xb4f7('0x52')]['id']}})[_0xb4f7('0x20')](handleEntityNotFound(_0x463ddb,null))[_0xb4f7('0x20')](saveUpdates(_0x2c116d[_0xb4f7('0x57')],null))['then'](function(_0x290b4d){if(_0x290b4d){_0x8909ac=_0x290b4d;return db[_0xb4f7('0x39')][_0xb4f7('0x6e')]({'raw':!![]});}})[_0xb4f7('0x20')](function(_0xe70236){if(_0xe70236){var _0x591b90=fs['readFileSync'](path['join'](config[_0xb4f7('0x61')],_0xb4f7('0x62')),_0xb4f7('0x65'));var _0x30e4ac=fs[_0xb4f7('0x63')](path[_0xb4f7('0x60')](config[_0xb4f7('0x61')],_0xb4f7('0x64')),_0xb4f7('0x65'));var _0x42f970=ejs['render'](_0x591b90,{'trunks':_0xe70236||[]});fs[_0xb4f7('0x68')](_0xb4f7('0x67'),_0x42f970);var _0x360421=ejs[_0xb4f7('0x66')](_0x30e4ac,{'trunks':_0xe70236||[]});fs[_0xb4f7('0x68')](_0xb4f7('0x69'),_0x360421);return respondWithRpcPromise('Reload',_0xb4f7('0x32'),{'module':_0xb4f7('0x6b')});}return null;})[_0xb4f7('0x20')](function(_0x13dde4){if(_0x13dde4){return _0x8909ac;}})[_0xb4f7('0x20')](respondWithResult(_0x463ddb,null))['catch'](handleError(_0x463ddb,null));};exports['destroy']=function(_0x52c20b,_0x2afe68,_0x327b8d){var _0x16773e;return db[_0xb4f7('0x39')][_0xb4f7('0x53')]({'where':{'id':_0x52c20b[_0xb4f7('0x52')]['id']}})[_0xb4f7('0x20')](handleEntityNotFound(_0x2afe68,null))[_0xb4f7('0x20')](removeEntity(_0x2afe68,null))[_0xb4f7('0x20')](function(){return db[_0xb4f7('0x39')][_0xb4f7('0x6e')]({'raw':!![]});})[_0xb4f7('0x20')](function(_0x2cab72){var _0x145db3=fs['readFileSync'](path[_0xb4f7('0x60')](config[_0xb4f7('0x61')],_0xb4f7('0x62')),'utf8');var _0x53e68e=fs[_0xb4f7('0x63')](path[_0xb4f7('0x60')](config['root'],_0xb4f7('0x64')),_0xb4f7('0x65'));var _0xf3017d=ejs[_0xb4f7('0x66')](_0x145db3,{'trunks':_0x2cab72});var _0x5de40b=ejs[_0xb4f7('0x66')](_0x53e68e,{'trunks':_0x2cab72});fs[_0xb4f7('0x68')](_0xb4f7('0x67'),_0xf3017d);fs[_0xb4f7('0x68')](_0xb4f7('0x69'),_0x5de40b);return respondWithRpcPromise(_0xb4f7('0x6a'),_0xb4f7('0x33'),{'module':'chan_sip.so'});})[_0xb4f7('0x29')](handleError(_0x2afe68,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 3cb5297..378ae27 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 _0x2c79=['path','../../config/environment','./trunk.attributes','define','Trunk','lodash','../../config/logger','api','bluebird'];(function(_0x20dc31,_0x5d3146){var _0x536e02=function(_0x11f9ff){while(--_0x11f9ff){_0x20dc31['push'](_0x20dc31['shift']());}};_0x536e02(++_0x5d3146);}(_0x2c79,0x164));var _0x92c7=function(_0x562f9f,_0x4ceb13){_0x562f9f=_0x562f9f-0x0;var _0x1ae471=_0x2c79[_0x562f9f];return _0x1ae471;};'use strict';var _=require(_0x92c7('0x0'));var util=require('util');var logger=require(_0x92c7('0x1'))(_0x92c7('0x2'));var moment=require('moment');var BPromise=require(_0x92c7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x92c7('0x4'));var rimraf=require('rimraf');var config=require(_0x92c7('0x5'));var attributes=require(_0x92c7('0x6'));module['exports']=function(_0x42a70d,_0x4d2d3a){return _0x42a70d[_0x92c7('0x7')](_0x92c7('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8886=['./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0xccfd84,_0x56e25f){var _0x5be6af=function(_0x222539){while(--_0x222539){_0xccfd84['push'](_0xccfd84['shift']());}};_0x5be6af(++_0x56e25f);}(_0x8886,0xa9));var _0x6888=function(_0x7d5244,_0x50b321){_0x7d5244=_0x7d5244-0x0;var _0x229b01=_0x8886[_0x7d5244];return _0x229b01;};'use strict';var _=require(_0x6888('0x0'));var util=require(_0x6888('0x1'));var logger=require(_0x6888('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6888('0x3'));var rp=require(_0x6888('0x4'));var fs=require('fs');var path=require(_0x6888('0x5'));var rimraf=require(_0x6888('0x6'));var config=require('../../config/environment');var attributes=require(_0x6888('0x7'));module[_0x6888('0x8')]=function(_0x42a46a,_0x2355f4){return _0x42a46a[_0x6888('0x9')]('Trunk',attributes,{'tableName':_0x6888('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 3a35b10..51184d2 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 _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(_0xa8bb71,_0x4c5824){var _0xef39e6=function(_0x2fa339){while(--_0x2fa339){_0xa8bb71['push'](_0xa8bb71['shift']());}};_0xef39e6(++_0x4c5824);}(_0x757a,0xde));var _0xa757=function(_0x5795d3,_0x31cee4){_0x5795d3=_0x5795d3-0x0;var _0xac295d=_0x757a[_0x5795d3];return _0xac295d;};'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 +var _0x2032=['error','code','message','info','result','catch','GetTrunk','Trunk','options','raw','where','map','model','attributes','include','stringify','ShowTrunk','find','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46f448,_0x36d0b8){var _0x413c11=function(_0x4f8e40){while(--_0x4f8e40){_0x46f448['push'](_0x46f448['shift']());}};_0x413c11(++_0x36d0b8);}(_0x2032,0xd9));var _0x2203=function(_0x3301d1,_0x5d74bd){_0x3301d1=_0x3301d1-0x0;var _0x1a0f9d=_0x2032[_0x3301d1];return _0x1a0f9d;};'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')]('Trunk,\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')]('Trunk,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('Trunk,\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);});});}exports[_0x2203('0x14')]=function(_0x4893ff){var _0x3f9ef6=this;return new Promise(function(_0x8906e1,_0x4aeb9f){return db[_0x2203('0x15')]['findAll']({'raw':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')][_0x2203('0x17')]===undefined?!![]:![]:!![],'where':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')][_0x2203('0x18')]||null:null,'attributes':_0x4893ff['options']?_0x4893ff[_0x2203('0x16')]['attributes']||null:null,'limit':_0x4893ff['options']?_0x4893ff[_0x2203('0x16')]['limit']||null:null,'include':_0x4893ff[_0x2203('0x16')]?_0x4893ff[_0x2203('0x16')]['include']?_[_0x2203('0x19')](_0x4893ff['options']['include'],function(_0x226374){return{'model':db[_0x226374[_0x2203('0x1a')]],'as':_0x226374['as'],'attributes':_0x226374[_0x2203('0x1b')],'include':_0x226374[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x226374[_0x2203('0x1c')],function(_0x49c12){return{'model':db[_0x49c12[_0x2203('0x1a')]],'as':_0x49c12['as'],'attributes':_0x49c12['attributes'],'include':_0x49c12[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x49c12[_0x2203('0x1c')],function(_0x5f11bf){return{'model':db[_0x5f11bf[_0x2203('0x1a')]],'as':_0x5f11bf['as'],'attributes':_0x5f11bf[_0x2203('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6e109){logger[_0x2203('0x11')](_0x2203('0x14'),_0x4893ff);logger[_0x2203('0xd')](_0x2203('0x14'),_0x4893ff,JSON[_0x2203('0x1d')](_0xd6e109));_0x8906e1(_0xd6e109);})[_0x2203('0x13')](function(_0x5a95c1){logger[_0x2203('0xe')](_0x2203('0x14'),_0x5a95c1[_0x2203('0x10')],_0x4893ff);_0x4aeb9f(_0x3f9ef6[_0x2203('0xe')](0x1f4,_0x5a95c1['message']));});});};exports[_0x2203('0x1e')]=function(_0x21ff0d){var _0x287c95=this;return new Promise(function(_0xf59954,_0x520602){return db[_0x2203('0x15')][_0x2203('0x1f')]({'raw':_0x21ff0d['options']?_0x21ff0d['options'][_0x2203('0x17')]===undefined?!![]:![]:!![],'where':_0x21ff0d['options']?_0x21ff0d['options'][_0x2203('0x18')]||null:null,'attributes':_0x21ff0d[_0x2203('0x16')]?_0x21ff0d[_0x2203('0x16')][_0x2203('0x1b')]||null:null,'include':_0x21ff0d[_0x2203('0x16')]?_0x21ff0d['options'][_0x2203('0x1c')]?_[_0x2203('0x19')](_0x21ff0d['options'][_0x2203('0x1c')],function(_0x20fbe1){return{'model':db[_0x20fbe1[_0x2203('0x1a')]],'as':_0x20fbe1['as'],'attributes':_0x20fbe1[_0x2203('0x1b')],'include':_0x20fbe1[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x20fbe1[_0x2203('0x1c')],function(_0x44228e){return{'model':db[_0x44228e[_0x2203('0x1a')]],'as':_0x44228e['as'],'attributes':_0x44228e['attributes'],'include':_0x44228e[_0x2203('0x1c')]?_[_0x2203('0x19')](_0x44228e['include'],function(_0x54b90b){return{'model':db[_0x54b90b[_0x2203('0x1a')]],'as':_0x54b90b['as'],'attributes':_0x54b90b['attributes']};}):[]};}):[]};}):[]:[]})[_0x2203('0x20')](function(_0x3b1eeb){logger[_0x2203('0x11')]('ShowTrunk',_0x21ff0d);logger['debug'](_0x2203('0x1e'),_0x21ff0d,JSON['stringify'](_0x3b1eeb));_0xf59954(_0x3b1eeb);})[_0x2203('0x13')](function(_0x5cfe5e){logger[_0x2203('0xe')]('ShowTrunk',_0x5cfe5e[_0x2203('0x10')],_0x21ff0d);_0x520602(_0x287c95[_0x2203('0xe')](0x1f4,_0x5cfe5e[_0x2203('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 83150e8..2247188 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 _0x0135=['getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','addQueues','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','logout','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeWhatsappAccounts','/:id/square_projects','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','/whoami','whoami','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts'];(function(_0x3b40a4,_0x285500){var _0x2dd280=function(_0x2ecf0b){while(--_0x2ecf0b){_0x3b40a4['push'](_0x3b40a4['shift']());}};_0x2dd280(++_0x285500);}(_0x0135,0x191));var _0x5013=function(_0x376251,_0xd358cb){_0x376251=_0x376251-0x0;var _0x4920d6=_0x0135[_0x376251];return _0x4920d6;};'use strict';var multer=require(_0x5013('0x0'));var util=require(_0x5013('0x1'));var path=require(_0x5013('0x2'));var timeout=require('connect-timeout');var express=require(_0x5013('0x3'));var router=express[_0x5013('0x4')]();var auth=require(_0x5013('0x5'));var interaction=require(_0x5013('0x6'));var config=require(_0x5013('0x7'));var controller=require(_0x5013('0x8'));router[_0x5013('0x9')]('/',auth[_0x5013('0xa')](),controller[_0x5013('0xb')]);router[_0x5013('0x9')](_0x5013('0xc'),auth[_0x5013('0xa')](),controller['describe']);router[_0x5013('0x9')](_0x5013('0xd'),auth[_0x5013('0xa')](),controller[_0x5013('0xe')]);router[_0x5013('0x9')](_0x5013('0xf'),auth[_0x5013('0xa')](),controller[_0x5013('0x10')]);router[_0x5013('0x9')](_0x5013('0x11'),controller[_0x5013('0x12')]);router['get'](_0x5013('0x13'),auth[_0x5013('0xa')](),controller[_0x5013('0x14')]);router[_0x5013('0x9')](_0x5013('0x15'),auth['isAuthenticated'](),controller['getQueues']);router['get'](_0x5013('0x16'),auth[_0x5013('0xa')](),controller[_0x5013('0x17')]);router[_0x5013('0x9')](_0x5013('0x18'),auth[_0x5013('0xa')](),controller[_0x5013('0x19')]);router[_0x5013('0x9')](_0x5013('0x1a'),auth[_0x5013('0xa')](),controller[_0x5013('0x1b')]);router[_0x5013('0x9')](_0x5013('0x1c'),auth[_0x5013('0xa')](),controller[_0x5013('0x1d')]);router[_0x5013('0x9')](_0x5013('0x1e'),auth[_0x5013('0xa')](),controller['getChatInteractions']);router[_0x5013('0x9')]('/:id/openchannel/interactions',auth[_0x5013('0xa')](),controller[_0x5013('0x1f')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller[_0x5013('0x20')]);router[_0x5013('0x9')](_0x5013('0x21'),auth[_0x5013('0xa')](),controller[_0x5013('0x22')]);router[_0x5013('0x9')]('/:id/fax/interactions',auth[_0x5013('0xa')](),controller[_0x5013('0x23')]);router[_0x5013('0x9')](_0x5013('0x24'),auth[_0x5013('0xa')](),controller[_0x5013('0x25')]);router['get'](_0x5013('0x26'),auth[_0x5013('0xa')](),controller[_0x5013('0x27')]);router[_0x5013('0x9')](_0x5013('0x28'),auth[_0x5013('0xa')](),controller['getLists']);router['get'](_0x5013('0x29'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5013('0x9')](_0x5013('0x2a'),auth[_0x5013('0xa')](),controller[_0x5013('0x2b')]);router[_0x5013('0x9')](_0x5013('0x2c'),auth[_0x5013('0xa')](),controller[_0x5013('0x2d')]);router[_0x5013('0x9')](_0x5013('0x2e'),auth[_0x5013('0xa')](),controller[_0x5013('0x2f')]);router[_0x5013('0x9')](_0x5013('0x30'),auth[_0x5013('0xa')](),controller[_0x5013('0x31')]);router[_0x5013('0x9')](_0x5013('0x32'),auth[_0x5013('0xa')](),controller[_0x5013('0x33')]);router[_0x5013('0x9')](_0x5013('0x34'),auth[_0x5013('0xa')](),controller[_0x5013('0x35')]);router[_0x5013('0x9')](_0x5013('0x36'),auth[_0x5013('0xa')](),controller[_0x5013('0x37')]);router[_0x5013('0x9')]('/:id/square_projects',auth[_0x5013('0xa')](),controller['getSquareProjects']);router[_0x5013('0x9')](_0x5013('0x38'),auth[_0x5013('0xa')](),controller[_0x5013('0x39')]);router[_0x5013('0x9')](_0x5013('0x3a'),auth[_0x5013('0xa')](),controller[_0x5013('0x3b')]);router[_0x5013('0x3c')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0x5013('0x3c')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x5013('0x3d')]);router[_0x5013('0x3c')]('/',auth[_0x5013('0xa')](),controller['create']);router[_0x5013('0x3c')](_0x5013('0x15'),auth[_0x5013('0xa')](),controller[_0x5013('0x3e')]);var upload=multer({'storage':multer[_0x5013('0x3f')]({'destination':function(_0x1809a6,_0x5c29d8,_0x1500a9){_0x1500a9(null,path[_0x5013('0x40')](config[_0x5013('0x41')],'server/files/images/'));},'filename':function(_0x275aa2,_0x10d3e4,_0x958789){_0x958789(null,util[_0x5013('0x42')](_0x5013('0x43'),Date[_0x5013('0x44')](),_0x10d3e4[_0x5013('0x45')]));}})});router[_0x5013('0x3c')](_0x5013('0x11'),upload[_0x5013('0x46')](_0x5013('0x47')),controller[_0x5013('0x48')]);router[_0x5013('0x3c')](_0x5013('0x49'),auth[_0x5013('0xa')](),controller[_0x5013('0x4a')]);router[_0x5013('0x3c')]('/:id/logout',auth[_0x5013('0xa')](),controller[_0x5013('0x4b')]);router[_0x5013('0x3c')]('/:id/pause',auth['isAuthenticated'](),controller[_0x5013('0x4c')]);router[_0x5013('0x3c')](_0x5013('0x4d'),auth[_0x5013('0xa')](),controller[_0x5013('0x4e')]);router[_0x5013('0x3c')](_0x5013('0x26'),auth[_0x5013('0xa')](),controller[_0x5013('0x4f')]);router['post']('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x5013('0x50')]);router[_0x5013('0x3c')](_0x5013('0x51'),auth['isAuthenticated'](),controller[_0x5013('0x52')]);router['post'](_0x5013('0x53'),auth[_0x5013('0xa')](),controller[_0x5013('0x54')]);router[_0x5013('0x3c')](_0x5013('0x55'),auth['isAuthenticated'](),controller[_0x5013('0x56')]);router['post']('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x5013('0x57')]);router['post'](_0x5013('0x58'),auth[_0x5013('0xa')](),controller['addWhatsappInteractions']);router['post'](_0x5013('0x2c'),auth[_0x5013('0xa')](),controller['addFaxAccounts']);router['post'](_0x5013('0x2e'),auth[_0x5013('0xa')](),controller[_0x5013('0x59')]);router[_0x5013('0x3c')](_0x5013('0x30'),auth[_0x5013('0xa')](),controller[_0x5013('0x5a')]);router[_0x5013('0x3c')](_0x5013('0x32'),auth['isAuthenticated'](),controller[_0x5013('0x5b')]);router[_0x5013('0x3c')](_0x5013('0x34'),auth[_0x5013('0xa')](),controller['addChatWebsites']);router[_0x5013('0x3c')](_0x5013('0x36'),auth[_0x5013('0xa')](),controller[_0x5013('0x5c')]);router['post']('/:id/square_projects',auth['isAuthenticated'](),controller['addSquareProjects']);router[_0x5013('0x3c')](_0x5013('0x3a'),auth[_0x5013('0xa')](),controller['createApiKey']);router[_0x5013('0x5d')]('/:id',auth[_0x5013('0xa')](),controller['update']);router[_0x5013('0x5d')](_0x5013('0x5e'),auth[_0x5013('0xa')](),controller[_0x5013('0x5f')]);router[_0x5013('0x60')](_0x5013('0x15'),auth[_0x5013('0xa')](),controller[_0x5013('0x61')]);router[_0x5013('0x60')](_0x5013('0x26'),auth[_0x5013('0xa')](),controller[_0x5013('0x62')]);router[_0x5013('0x60')]('/:id',auth['isAuthenticated'](),controller[_0x5013('0x63')]);router['delete'](_0x5013('0x64'),auth['isAuthenticated'](),controller[_0x5013('0x65')]);router[_0x5013('0x60')](_0x5013('0x51'),auth[_0x5013('0xa')](),controller[_0x5013('0x66')]);router['delete'](_0x5013('0x53'),auth[_0x5013('0xa')](),controller[_0x5013('0x67')]);router[_0x5013('0x60')](_0x5013('0x55'),auth[_0x5013('0xa')](),controller[_0x5013('0x68')]);router[_0x5013('0x60')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0x5013('0x69')]);router[_0x5013('0x60')](_0x5013('0x58'),auth[_0x5013('0xa')](),controller['removeWhatsappInteractions']);router[_0x5013('0x60')](_0x5013('0x2c'),auth[_0x5013('0xa')](),controller[_0x5013('0x6a')]);router[_0x5013('0x60')](_0x5013('0x2e'),auth[_0x5013('0xa')](),controller[_0x5013('0x6b')]);router[_0x5013('0x60')](_0x5013('0x30'),auth[_0x5013('0xa')](),controller['removeOpenchannelAccounts']);router['delete'](_0x5013('0x32'),auth[_0x5013('0xa')](),controller[_0x5013('0x6c')]);router[_0x5013('0x60')](_0x5013('0x34'),auth[_0x5013('0xa')](),controller['removeChatWebsites']);router[_0x5013('0x60')](_0x5013('0x36'),auth[_0x5013('0xa')](),controller[_0x5013('0x6d')]);router[_0x5013('0x60')](_0x5013('0x6e'),auth[_0x5013('0xa')](),controller['removeSquareProjects']);router[_0x5013('0x60')](_0x5013('0x3a'),auth[_0x5013('0xa')](),controller['removeApiKey']);module[_0x5013('0x6f')]=router; \ No newline at end of file +var _0x3d14=['/describe','describe','get','/whoami','whoami','/:id','/:id/avatar','getAvatar','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','getTeams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','/:id/contacts','addContacts','/:id/queues','diskStorage','server/files/images/','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','unpause','addTeams','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x3d14,0x65));var _0x43d1=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x3d14[_0x33c9f8];return _0x2d7004;};'use strict';var multer=require(_0x43d1('0x0'));var util=require(_0x43d1('0x1'));var path=require(_0x43d1('0x2'));var timeout=require('connect-timeout');var express=require(_0x43d1('0x3'));var router=express['Router']();var auth=require(_0x43d1('0x4'));var interaction=require(_0x43d1('0x5'));var config=require(_0x43d1('0x6'));var controller=require(_0x43d1('0x7'));router['get']('/',auth[_0x43d1('0x8')](),controller[_0x43d1('0x9')]);router['get'](_0x43d1('0xa'),auth[_0x43d1('0x8')](),controller[_0x43d1('0xb')]);router[_0x43d1('0xc')](_0x43d1('0xd'),auth[_0x43d1('0x8')](),controller[_0x43d1('0xe')]);router[_0x43d1('0xc')](_0x43d1('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x43d1('0xc')](_0x43d1('0x10'),controller[_0x43d1('0x11')]);router[_0x43d1('0xc')]('/:id/contacts',auth[_0x43d1('0x8')](),controller[_0x43d1('0x12')]);router['get']('/:id/queues',auth[_0x43d1('0x8')](),controller[_0x43d1('0x13')]);router[_0x43d1('0xc')]('/:id/queues_rt',auth[_0x43d1('0x8')](),controller[_0x43d1('0x14')]);router[_0x43d1('0xc')](_0x43d1('0x15'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x16')]);router['get'](_0x43d1('0x17'),auth['isAuthenticated'](),controller[_0x43d1('0x18')]);router['get']('/:id/screen_recordings',auth[_0x43d1('0x8')](),controller[_0x43d1('0x19')]);router[_0x43d1('0xc')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x43d1('0x1a')]);router['get'](_0x43d1('0x1b'),auth['isAuthenticated'](),controller[_0x43d1('0x1c')]);router[_0x43d1('0xc')](_0x43d1('0x1d'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x1e')]);router[_0x43d1('0xc')](_0x43d1('0x1f'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x20')]);router[_0x43d1('0xc')](_0x43d1('0x21'),auth['isAuthenticated'](),controller[_0x43d1('0x22')]);router['get'](_0x43d1('0x23'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x24')]);router[_0x43d1('0xc')]('/:id/teams',auth[_0x43d1('0x8')](),controller[_0x43d1('0x25')]);router[_0x43d1('0xc')](_0x43d1('0x26'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x27')]);router['get']('/:id/agents',auth[_0x43d1('0x8')](),controller[_0x43d1('0x28')]);router[_0x43d1('0xc')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x43d1('0x29')]);router[_0x43d1('0xc')](_0x43d1('0x2a'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x2b')]);router[_0x43d1('0xc')](_0x43d1('0x2c'),auth['isAuthenticated'](),controller[_0x43d1('0x2d')]);router[_0x43d1('0xc')]('/:id/openchannel_accounts',auth[_0x43d1('0x8')](),controller[_0x43d1('0x2e')]);router['get'](_0x43d1('0x2f'),auth['isAuthenticated'](),controller[_0x43d1('0x30')]);router[_0x43d1('0xc')](_0x43d1('0x31'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x43d1('0xc')](_0x43d1('0x32'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x33')]);router['get'](_0x43d1('0x34'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x35')]);router[_0x43d1('0xc')](_0x43d1('0x36'),auth['isAuthenticated'](),controller[_0x43d1('0x37')]);router[_0x43d1('0xc')](_0x43d1('0x38'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x39')]);router[_0x43d1('0x3a')](_0x43d1('0x3b'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x3c')]);router['post'](_0x43d1('0x3d'),auth['isAuthenticated'](),controller[_0x43d1('0x3e')]);router['post']('/',auth[_0x43d1('0x8')](),controller['create']);router[_0x43d1('0x3a')](_0x43d1('0x3f'),auth[_0x43d1('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0x43d1('0x40')]({'destination':function(_0x5be5cf,_0x511313,_0x3ec8b5){_0x3ec8b5(null,path['join'](config['root'],_0x43d1('0x41')));},'filename':function(_0xdee096,_0x571afe,_0x1d571c){_0x1d571c(null,util['format']('%s-%s',Date['now'](),_0x571afe[_0x43d1('0x42')]));}})});router['post']('/:id/avatar',upload[_0x43d1('0x43')](_0x43d1('0x44')),controller[_0x43d1('0x45')]);router['post'](_0x43d1('0x46'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x47')]);router[_0x43d1('0x3a')](_0x43d1('0x48'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x49')]);router[_0x43d1('0x3a')](_0x43d1('0x4a'),auth[_0x43d1('0x8')](),controller['pause']);router['post']('/:id/unpause',auth[_0x43d1('0x8')](),controller[_0x43d1('0x4b')]);router[_0x43d1('0x3a')]('/:id/teams',auth[_0x43d1('0x8')](),controller[_0x43d1('0x4c')]);router[_0x43d1('0x3a')]('/:id/chat_interactions',auth[_0x43d1('0x8')](),controller[_0x43d1('0x4d')]);router['post']('/:id/mail_interactions',auth[_0x43d1('0x8')](),controller[_0x43d1('0x4e')]);router['post']('/:id/fax_interactions',auth[_0x43d1('0x8')](),controller[_0x43d1('0x4f')]);router[_0x43d1('0x3a')](_0x43d1('0x50'),auth[_0x43d1('0x8')](),controller['addSmsInteractions']);router[_0x43d1('0x3a')](_0x43d1('0x51'),auth['isAuthenticated'](),controller[_0x43d1('0x52')]);router['post'](_0x43d1('0x53'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x54')]);router['post'](_0x43d1('0x2a'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x55')]);router[_0x43d1('0x3a')](_0x43d1('0x2c'),auth[_0x43d1('0x8')](),controller['addMailAccounts']);router[_0x43d1('0x3a')](_0x43d1('0x56'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x57')]);router[_0x43d1('0x3a')]('/:id/sms_accounts',auth[_0x43d1('0x8')](),controller[_0x43d1('0x58')]);router[_0x43d1('0x3a')](_0x43d1('0x31'),auth[_0x43d1('0x8')](),controller['addChatWebsites']);router[_0x43d1('0x3a')](_0x43d1('0x32'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x59')]);router['post'](_0x43d1('0x34'),auth['isAuthenticated'](),controller[_0x43d1('0x5a')]);router[_0x43d1('0x3a')]('/:id/api_key',auth[_0x43d1('0x8')](),controller[_0x43d1('0x5b')]);router[_0x43d1('0x5c')](_0x43d1('0xf'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x5d')]);router[_0x43d1('0x5c')]('/:id/password',auth[_0x43d1('0x8')](),controller[_0x43d1('0x5e')]);router[_0x43d1('0x5f')](_0x43d1('0x3f'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x60')]);router[_0x43d1('0x5f')]('/:id/teams',auth[_0x43d1('0x8')](),controller['removeTeams']);router['delete']('/:id',auth[_0x43d1('0x8')](),controller['destroy']);router[_0x43d1('0x5f')](_0x43d1('0x61'),auth['isAuthenticated'](),controller[_0x43d1('0x62')]);router[_0x43d1('0x5f')](_0x43d1('0x63'),auth[_0x43d1('0x8')](),controller['removeMailInteractions']);router[_0x43d1('0x5f')](_0x43d1('0x64'),auth[_0x43d1('0x8')](),controller['removeFaxInteractions']);router[_0x43d1('0x5f')](_0x43d1('0x50'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x65')]);router[_0x43d1('0x5f')](_0x43d1('0x51'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x66')]);router[_0x43d1('0x5f')](_0x43d1('0x53'),auth['isAuthenticated'](),controller['removeWhatsappInteractions']);router['delete'](_0x43d1('0x2a'),auth['isAuthenticated'](),controller[_0x43d1('0x67')]);router[_0x43d1('0x5f')](_0x43d1('0x2c'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x68')]);router[_0x43d1('0x5f')](_0x43d1('0x56'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x69')]);router['delete'](_0x43d1('0x2f'),auth['isAuthenticated'](),controller[_0x43d1('0x6a')]);router['delete'](_0x43d1('0x31'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x6b')]);router[_0x43d1('0x5f')](_0x43d1('0x32'),auth[_0x43d1('0x8')](),controller['removeWhatsappAccounts']);router[_0x43d1('0x5f')](_0x43d1('0x34'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x6c')]);router[_0x43d1('0x5f')](_0x43d1('0x38'),auth[_0x43d1('0x8')](),controller[_0x43d1('0x6d')]);module[_0x43d1('0x6e')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index dfea459..c11f7c3 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 _0xf7cd=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','originate','uac','uas','active','passive','actpass','showWebBar','get','isArray','wss','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','dtlsverify','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','loginAttempts','blockedAt','sequelize','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','\x22%s\x22\x20<%s>','internal','STRING','email','toLowerCase','ENUM','admin','user','agent','telephone','local','accountcode','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','from-sip'];(function(_0x10492f,_0x158608){var _0x517002=function(_0x2ae8e8){while(--_0x2ae8e8){_0x10492f['push'](_0x10492f['shift']());}};_0x517002(++_0x158608);}(_0xf7cd,0x98));var _0xdf7c=function(_0x20fefe,_0x1d4744){_0x20fefe=_0x20fefe-0x0;var _0xa92414=_0xf7cd[_0x20fefe];return _0xa92414;};'use strict';var Sequelize=require(_0xdf7c('0x0'));var moment=require('moment');var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdf7c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1f88bc){this[_0xdf7c('0x2')](_0xdf7c('0x1'),_0x1f88bc);this[_0xdf7c('0x2')](_0xdf7c('0x3'),_0x1f88bc);},'comment':_0xdf7c('0x4')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x13cc8a){this[_0xdf7c('0x2')]('fullname',_0x13cc8a);this['setDataValue'](_0xdf7c('0x5'),util['format'](_0xdf7c('0x6'),_0x13cc8a,this['getDataValue'](_0xdf7c('0x7'))));}},'alias':{'type':Sequelize[_0xdf7c('0x8')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdf7c('0x9'),'validate':{'isEmail':!![]},'set':function(_0x37616f){if(_0x37616f){this[_0xdf7c('0x2')](_0xdf7c('0x9'),_0x37616f[_0xdf7c('0xa')]());}}},'role':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0xc'),_0xdf7c('0xd'),_0xdf7c('0xe'),_0xdf7c('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xdf7c('0x8')],'defaultValue':_0xdf7c('0x10')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xdf7c('0x7'),'set':function(_0x234c56){this[_0xdf7c('0x2')]('internal',_0x234c56);this['setDataValue'](_0xdf7c('0x11'),_0x234c56);this[_0xdf7c('0x2')](_0xdf7c('0x5'),util[_0xdf7c('0x12')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0xdf7c('0x13')),_0x234c56));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xdf7c('0x8')]},'mobile':{'type':Sequelize[_0xdf7c('0x8')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xdf7c('0x8')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xdf7c('0x8')]},'online':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdf7c('0x15')]},'voicePause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xdf7c('0x8')],'defaultValue':_0xdf7c('0x16')},'lastPauseAt':{'type':Sequelize[_0xdf7c('0x15')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xdf7c('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xdf7c('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xdf7c('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdf7c('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xdf7c('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xdf7c('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'host':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![],'defaultValue':_0xdf7c('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xdf7c('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x19'),_0xdf7c('0xd'),_0xdf7c('0x1a')),'allowNull':!![],'defaultValue':_0xdf7c('0x19')},'context':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![],'defaultValue':_0xdf7c('0x1b')},'callingpres':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x1c'),_0xdf7c('0x1d'),'ALLOWED_FAILED_SCREEN',_0xdf7c('0x1e'),_0xdf7c('0x1f'),_0xdf7c('0x20'),_0xdf7c('0x21'),_0xdf7c('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'permit':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'transport':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![],'defaultValue':_0xdf7c('0x23'),'set':function(_0xb3ff89){this[_0xdf7c('0x2')](_0xdf7c('0x24'),_0xb3ff89?_0xb3ff89[_0xdf7c('0x25')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xdf7c('0x26')]('transport')[_0xdf7c('0x27')](','):null;},'comment':_0xdf7c('0x28')},'dtmfmode':{'type':Sequelize['ENUM'](_0xdf7c('0x29'),_0xdf7c('0x2a'),'shortinfo',_0xdf7c('0x2b'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no',_0xdf7c('0x2d'),_0xdf7c('0x2e'),_0xdf7c('0x2f')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x4e1c20){this['setDataValue'](_0xdf7c('0x30'),_0x4e1c20?_0x4e1c20[_0xdf7c('0x25')](','):null);},'get':function(){return this[_0xdf7c('0x26')](_0xdf7c('0x30'))?this[_0xdf7c('0x26')](_0xdf7c('0x30'))[_0xdf7c('0x27')](','):null;},'comment':_0xdf7c('0x31')},'callgroup':{'type':Sequelize[_0xdf7c('0x8')]},'namedcallgroup':{'type':Sequelize[_0xdf7c('0x8')]},'pickupgroup':{'type':Sequelize[_0xdf7c('0x8')]},'namedpickupgroup':{'type':Sequelize[_0xdf7c('0x8')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdf7c('0x8')]},'disallow':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':![],'defaultValue':_0xdf7c('0x32')},'allow':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':![],'defaultValue':_0xdf7c('0x33'),'set':function(_0xd52c25){this['setDataValue'](_0xdf7c('0x34'),_0xd52c25?_0xd52c25[_0xdf7c('0x25')](';'):_0xdf7c('0x33'));},'get':function(){return this[_0xdf7c('0x26')](_0xdf7c('0x34'))?this[_0xdf7c('0x26')](_0xdf7c('0x34'))[_0xdf7c('0x27')](';'):null;},'comment':_0xdf7c('0x35')},'autoframing':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0xaca905){this[_0xdf7c('0x2')](_0xdf7c('0x36'),_0xaca905?_0xaca905[_0xdf7c('0x25')](','):null);},'get':function(){return this[_0xdf7c('0x26')](_0xdf7c('0x36'))?this['getDataValue'](_0xdf7c('0x36'))[_0xdf7c('0x27')](','):null;},'comment':_0xdf7c('0x37')},'trustrpid':{'type':Sequelize[_0xdf7c('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xdf7c('0x2c'),'no',_0xdf7c('0x38')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xdf7c('0x2c')},'busylevel':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdf7c('0xb')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'template':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no',_0xdf7c('0x39')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x3a'),'refuse',_0xdf7c('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x3c'),_0xdf7c('0x3d')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![],'defaultValue':_0xdf7c('0x2c')},'keepalive':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'timert1':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x3e'),_0xdf7c('0x3f'),_0xdf7c('0x40')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdf7c('0xb')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xdf7c('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xdf7c('0xb')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xdf7c('0xb')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no','nonat',_0xdf7c('0x2e'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xdf7c('0x15')]},'showWebBar':{'type':Sequelize[_0xdf7c('0x17')],'defaultValue':0x0,'set':function(_0x2e5454){this[_0xdf7c('0x2')](_0xdf7c('0x41'),_0x2e5454);var _0x22d0c7=this[_0xdf7c('0x42')]({'plain':!![]});switch(_0x2e5454){case 0x0:case 0x1:var _0x397fdc=_0x22d0c7[_0xdf7c('0x24')]?_[_0xdf7c('0x43')](_0x22d0c7['transport'])?_0x22d0c7['transport'][_0xdf7c('0x25')]():_0x22d0c7[_0xdf7c('0x24')]:_0xdf7c('0x23');if(_0x397fdc===_0xdf7c('0x44')){_0x397fdc='udp';}this[_0xdf7c('0x2')](_0xdf7c('0x24'),_0x397fdc);this['setDataValue']('encryption','no');this['setDataValue'](_0xdf7c('0x45'),null);this[_0xdf7c('0x2')](_0xdf7c('0x46'),null);this[_0xdf7c('0x2')](_0xdf7c('0x47'),null);this[_0xdf7c('0x2')](_0xdf7c('0x48'),null);this[_0xdf7c('0x2')]('dtlsverify',null);this[_0xdf7c('0x2')](_0xdf7c('0x49'),null);this[_0xdf7c('0x2')]('dtlscertfile',null);this['setDataValue'](_0xdf7c('0x4a'),null);this['setDataValue'](_0xdf7c('0x4b'),'no');break;case 0x2:this[_0xdf7c('0x2')](_0xdf7c('0x24'),_0xdf7c('0x44'));this[_0xdf7c('0x2')](_0xdf7c('0x4c'),_0xdf7c('0x2c'));this[_0xdf7c('0x2')](_0xdf7c('0x45'),_0xdf7c('0x2c'));this[_0xdf7c('0x2')](_0xdf7c('0x46'),_0xdf7c('0x2c'));this[_0xdf7c('0x2')](_0xdf7c('0x47'),_0xdf7c('0x2c'));this['setDataValue']('dtlsenable',_0xdf7c('0x2c'));this[_0xdf7c('0x2')](_0xdf7c('0x4d'),'no');this[_0xdf7c('0x2')](_0xdf7c('0x49'),_0xdf7c('0x40'));this[_0xdf7c('0x2')]('dtlscertfile',_0x22d0c7[_0xdf7c('0x4e')]||_0xdf7c('0x4f'));this[_0xdf7c('0x2')](_0xdf7c('0x4a'),_0x22d0c7[_0xdf7c('0x4a')]||_0xdf7c('0x50'));this['setDataValue']('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1e12c7){this[_0xdf7c('0x2')](_0xdf7c('0x51'),_0x1e12c7?_0x1e12c7[_0xdf7c('0x25')](','):[]);},'get':function(){return this[_0xdf7c('0x26')](_0xdf7c('0x51'))?_[_0xdf7c('0x52')](this[_0xdf7c('0x26')](_0xdf7c('0x51'))['split'](','),function(_0x159434){return parseInt(_0x159434,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdf7c('0x8')]},'phoneBarBusyNumber':{'type':Sequelize[_0xdf7c('0x8')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xdf7c('0x8')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xdf7c('0xb')](_0xdf7c('0x2c'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xdf7c('0x8')]},'passwordResetAt':{'type':Sequelize[_0xdf7c('0x15')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xdf7c('0x53')],'get':function(){return this[_0xdf7c('0x26')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0xdf7c('0x54')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xdf7c('0x8')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![],'set':function(_0x1272bc){if(typeof _0x1272bc==='string'){var _0xf2a971=_0x1272bc==='1'?!![]:_0x1272bc==='0'?![]:_0x1272bc==='true'?!![]:_0x1272bc===_0xdf7c('0x55')?![]:![];this[_0xdf7c('0x2')](_0xdf7c('0x56'),_0xf2a971);}else{this['setDataValue'](_0xdf7c('0x56'),_0x1272bc);}}},'blocked':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![],'set':function(_0x2d4116){this[_0xdf7c('0x2')](_0xdf7c('0x57'),_0x2d4116);if(_0x2d4116===!![]){this['setDataValue']('blockedAt',moment());this[_0xdf7c('0x2')](_0xdf7c('0x58'),0x0);}else{this[_0xdf7c('0x2')](_0xdf7c('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xdf7c('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xdf7c('0x14')],'defaultValue':![]}}; \ No newline at end of file +var _0x3942=['agent','telephone','local','accountcode','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','yes','nonat','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','originate','uac','uas','fingerprint','certificate','passive','actpass','update','update,nonat','showWebBar','get','isArray','wss','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','loginAttempts','moment','util','lodash','exports','STRING','name','setDataValue','defaultuser','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','admin','user'];(function(_0x3a7bdf,_0x58bdd8){var _0x35a9a8=function(_0x21da98){while(--_0x21da98){_0x3a7bdf['push'](_0x3a7bdf['shift']());}};_0x35a9a8(++_0x58bdd8);}(_0x3942,0xab));var _0x2394=function(_0x2a3170,_0xf53053){_0x2a3170=_0x2a3170-0x0;var _0x2f63ac=_0x3942[_0x2a3170];return _0x2f63ac;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2394('0x0'));var util=require(_0x2394('0x1'));var _=require(_0x2394('0x2'));module[_0x2394('0x3')]={'name':{'type':Sequelize[_0x2394('0x4')],'allowNull':![],'unique':_0x2394('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1e987b){this['setDataValue'](_0x2394('0x5'),_0x1e987b);this[_0x2394('0x6')](_0x2394('0x7'),_0x1e987b);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x43adca){this[_0x2394('0x6')]('fullname',_0x43adca);this['setDataValue'](_0x2394('0x8'),util[_0x2394('0x9')](_0x2394('0xa'),_0x43adca,this[_0x2394('0xb')](_0x2394('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2394('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2ffb8d){if(_0x2ffb8d){this[_0x2394('0x6')](_0x2394('0xd'),_0x2ffb8d['toLowerCase']());}}},'role':{'type':Sequelize[_0x2394('0xe')](_0x2394('0xf'),_0x2394('0x10'),_0x2394('0x11'),_0x2394('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x2394('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x2394('0x4')],'defaultValue':_0x2394('0x13')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x208de8){this['setDataValue']('internal',_0x208de8);this[_0x2394('0x6')](_0x2394('0x14'),_0x208de8);this[_0x2394('0x6')](_0x2394('0x8'),util['format'](_0x2394('0xa'),this['getDataValue'](_0x2394('0x15')),_0x208de8));}},'salt':{'type':Sequelize[_0x2394('0x4')]},'phone':{'type':Sequelize[_0x2394('0x4')]},'mobile':{'type':Sequelize[_0x2394('0x4')]},'address':{'type':Sequelize[_0x2394('0x4')]},'zipcode':{'type':Sequelize[_0x2394('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2394('0x4')]},'country':{'type':Sequelize[_0x2394('0x4')]},'online':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x2394('0x17')]},'voicePause':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x2394('0x4')],'defaultValue':_0x2394('0x18')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x2394('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x2394('0x19')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x2394('0x19')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x2394('0x19')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0x2394('0x1a')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![],'defaultValue':_0x2394('0x1b')},'callingpres':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x1c'),'ALLOWED_PASSED_SCREEN',_0x2394('0x1d'),_0x2394('0x1e'),_0x2394('0x1f'),_0x2394('0x20'),_0x2394('0x21'),_0x2394('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![],'defaultValue':_0x2394('0x23'),'set':function(_0xdec99c){this[_0x2394('0x6')](_0x2394('0x24'),_0xdec99c?_0xdec99c['join'](','):null);},'get':function(){return this[_0x2394('0xb')](_0x2394('0x24'))?this[_0x2394('0xb')](_0x2394('0x24'))[_0x2394('0x25')](','):null;},'comment':_0x2394('0x26')},'dtmfmode':{'type':Sequelize['ENUM'](_0x2394('0x27'),_0x2394('0x28'),'shortinfo',_0x2394('0x29'),'auto'),'allowNull':!![],'defaultValue':_0x2394('0x27')},'directmedia':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no',_0x2394('0x2b'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![],'defaultValue':_0x2394('0x2c'),'set':function(_0x220857){this['setDataValue'](_0x2394('0x2d'),_0x220857?_0x220857[_0x2394('0x2e')](','):null);},'get':function(){return this[_0x2394('0xb')](_0x2394('0x2d'))?this[_0x2394('0xb')](_0x2394('0x2d'))[_0x2394('0x25')](','):null;},'comment':_0x2394('0x2f')},'callgroup':{'type':Sequelize[_0x2394('0x4')]},'namedcallgroup':{'type':Sequelize[_0x2394('0x4')]},'pickupgroup':{'type':Sequelize[_0x2394('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x2394('0x4')]},'language':{'type':Sequelize[_0x2394('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2394('0x4')]},'disallow':{'type':Sequelize[_0x2394('0x4')],'allowNull':![],'defaultValue':_0x2394('0x30')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2394('0x31'),'set':function(_0x45a698){this['setDataValue'](_0x2394('0x32'),_0x45a698?_0x45a698[_0x2394('0x2e')](';'):_0x2394('0x31'));},'get':function(){return this[_0x2394('0xb')](_0x2394('0x32'))?this['getDataValue'](_0x2394('0x32'))[_0x2394('0x25')](';'):null;},'comment':_0x2394('0x33')},'autoframing':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![],'set':function(_0xbb2d2){this['setDataValue']('insecure',_0xbb2d2?_0xbb2d2[_0x2394('0x2e')](','):null);},'get':function(){return this[_0x2394('0xb')](_0x2394('0x34'))?this[_0x2394('0xb')]('insecure')['split'](','):null;},'comment':_0x2394('0x35')},'trustrpid':{'type':Sequelize[_0x2394('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2394('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no',_0x2394('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x2394('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![],'defaultValue':_0x2394('0x37')},'amaflags':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x2394('0x2a')},'busylevel':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x2394('0xe')]('yes','no',_0x2394('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x2394('0xe')]('accept','refuse',_0x2394('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x3a'),_0x2394('0x3b')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x2394('0x2a')},'keepalive':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x2394('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x2394('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x2394('0xe')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no',_0x2394('0x3c'),_0x2394('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x2394('0x19')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x2394('0xe')]('active',_0x2394('0x3e'),_0x2394('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x2394('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no','nonat',_0x2394('0x40'),_0x2394('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x2394('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x611ffe){this[_0x2394('0x6')](_0x2394('0x42'),_0x611ffe);var _0x4c0b1e=this[_0x2394('0x43')]({'plain':!![]});switch(_0x611ffe){case 0x0:case 0x1:var _0x1c41a1=_0x4c0b1e['transport']?_[_0x2394('0x44')](_0x4c0b1e[_0x2394('0x24')])?_0x4c0b1e[_0x2394('0x24')][_0x2394('0x2e')]():_0x4c0b1e['transport']:_0x2394('0x23');if(_0x1c41a1===_0x2394('0x45')){_0x1c41a1=_0x2394('0x23');}this['setDataValue']('transport',_0x1c41a1);this[_0x2394('0x6')](_0x2394('0x46'),'no');this[_0x2394('0x6')](_0x2394('0x47'),null);this[_0x2394('0x6')]('force_avp',null);this['setDataValue'](_0x2394('0x48'),null);this[_0x2394('0x6')](_0x2394('0x49'),null);this[_0x2394('0x6')](_0x2394('0x4a'),null);this[_0x2394('0x6')](_0x2394('0x4b'),null);this['setDataValue'](_0x2394('0x4c'),null);this['setDataValue'](_0x2394('0x4d'),null);this['setDataValue'](_0x2394('0x4e'),'no');break;case 0x2:this[_0x2394('0x6')](_0x2394('0x24'),'wss');this['setDataValue'](_0x2394('0x46'),_0x2394('0x2a'));this[_0x2394('0x6')](_0x2394('0x47'),_0x2394('0x2a'));this[_0x2394('0x6')](_0x2394('0x4f'),_0x2394('0x2a'));this[_0x2394('0x6')](_0x2394('0x48'),'yes');this[_0x2394('0x6')]('dtlsenable',_0x2394('0x2a'));this['setDataValue'](_0x2394('0x4a'),'no');this[_0x2394('0x6')](_0x2394('0x4b'),'actpass');this[_0x2394('0x6')](_0x2394('0x4c'),_0x4c0b1e[_0x2394('0x4c')]||_0x2394('0x50'));this[_0x2394('0x6')](_0x2394('0x4d'),_0x4c0b1e[_0x2394('0x4d')]||_0x2394('0x51'));this[_0x2394('0x6')]('rtcp_mux',_0x2394('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x2394('0x52')],'set':function(_0xe9a1c3){this[_0x2394('0x6')]('permissions',_0xe9a1c3?_0xe9a1c3[_0x2394('0x2e')](','):[]);},'get':function(){return this[_0x2394('0xb')](_0x2394('0x53'))?_[_0x2394('0x54')](this[_0x2394('0xb')]('permissions')['split'](','),function(_0x96273d){return parseInt(_0x96273d,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x2394('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x2394('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x2394('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x2394('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x2394('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x2394('0xe')](_0x2394('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x2394('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x2394('0x4')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x2394('0x55')],'get':function(){return this[_0x2394('0xb')](_0x2394('0x56'))?this[_0x2394('0xb')](_0x2394('0x56')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x2394('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x2394('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x2394('0x16')],'defaultValue':![],'set':function(_0x52bfd2){if(typeof _0x52bfd2===_0x2394('0x57')){var _0x508d20=_0x52bfd2==='1'?!![]:_0x52bfd2==='0'?![]:_0x52bfd2===_0x2394('0x58')?!![]:_0x52bfd2===_0x2394('0x59')?![]:![];this[_0x2394('0x6')](_0x2394('0x5a'),_0x508d20);}else{this[_0x2394('0x6')]('screenrecording',_0x52bfd2);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x320aec){this[_0x2394('0x6')](_0x2394('0x5b'),_0x320aec);if(_0x320aec===!![]){this[_0x2394('0x6')](_0x2394('0x5c'),moment());this[_0x2394('0x6')](_0x2394('0x5d'),0x0);}else{this[_0x2394('0x6')](_0x2394('0x5c'),null);}}},'blockedAt':{'type':Sequelize[_0x2394('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x2394('0x19')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x2394('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 7b6a8f0..8d761b0 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 _0x93c7=['removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','firstName','lastName','phone','dialActive','VoiceQueue','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','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','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','get','user','agent','Telephones','telephone','ignore','map','value','find','role','name','destroy','send','User','rawAttributes','fieldName','type','key','password','salt','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','sequelize','lower','col','options','includeAll','include','findAll','rows','params','differenceBy','bulkCreate','body','describe','addContacts','ids','omit','agent\x20role','admin','getLicense','telephones','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','Setting','findById','securePassword','min_internal','max','internal','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','from','voicemail','mailbox','fullname','email','permissions','102','103','113','104','105','106','108','109','100','VoiceMail','Agents','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','changePassword','findOne','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','spread','QueueId','emit','Queue:save','voice','push','SIP/%s','each','UserVoiceQueueRt','removeQueues','Unknown\x20channel','Queue:remove','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','join','getContacts','CmContact','CmList','List','color','tag','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','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','getVoiceQueues','UserVoiceQueue.penalty','upsert','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','PAUSE','LOGININPAUSE','MemberReport','concat','isMiddleware','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','whatsapppause','pauseType','manual','mail','chat','fax','sms','whatsapp','openchannel','%s%s','Pause','Team','getTeams','addTeams','Voice','getChatQueues','setDataValue','Chat','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','getOpenchannelQueues','transaction','addAgent','getDataValue','penalty','removeTeams','getMailQueues','Openchannel','flatten','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions'];(function(_0x5bfc50,_0x316a43){var _0x486fad=function(_0x314898){while(--_0x314898){_0x5bfc50['push'](_0x5bfc50['shift']());}};_0x486fad(++_0x316a43);}(_0x93c7,0x1c9));var _0x793c=function(_0x10db6c,_0x15c10d){_0x10db6c=_0x10db6c-0x0;var _0x2c7db1=_0x93c7[_0x10db6c];return _0x2c7db1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x793c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x793c('0x1'));var jsonpatch=require(_0x793c('0x2'));var rp=require(_0x793c('0x3'));var moment=require('moment');var BPromise=require(_0x793c('0x4'));var Mustache=require(_0x793c('0x5'));var util=require(_0x793c('0x6'));var path=require(_0x793c('0x7'));var sox=require(_0x793c('0x8'));var csv=require(_0x793c('0x9'));var ejs=require(_0x793c('0xa'));var fs=require('fs');var _=require(_0x793c('0xb'));var squel=require(_0x793c('0xc'));var crypto=require(_0x793c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x793c('0xe'));var toCsv=require(_0x793c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x793c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x793c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x793c('0x11'))('api');var utils=require(_0x793c('0x12'));var config=require(_0x793c('0x13'));var db=require(_0x793c('0x14'))['db'];config[_0x793c('0x15')]=_[_0x793c('0x16')](config[_0x793c('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x793c('0x17'))(new Redis(config['redis']));require('./user.socket')[_0x793c('0x18')](socket);var jayson=require(_0x793c('0x19'));var client=jayson[_0x793c('0x1a')][_0x793c('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2c2d5f,_0x318b5e,_0x4c142b){if(_0x4c142b){var _0x2f8124=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f8124['test'](_0x318b5e)){return _0x2c2d5f;}else{throw new db[(_0x793c('0x1c'))]['ValidationError'](_0x793c('0x1d'));}}else{return _0x2c2d5f;}}function respondWithRpcPromise(_0x11a14e,_0x269311,_0x472336,_0x201be1){return new BPromise(function(_0x563a34,_0x5a1d5a){var _0x5ada0b=_0x201be1||client;return _0x5ada0b[_0x793c('0x1e')](_0x11a14e,_0x472336)[_0x793c('0x1f')](function(_0x37269c){logger[_0x793c('0x20')]('User,\x20%s,\x20%s',_0x269311,_0x793c('0x21'));logger[_0x793c('0x22')](_0x793c('0x23'),_0x269311,_0x793c('0x21'),JSON[_0x793c('0x24')](_0x37269c));if(_0x37269c[_0x793c('0x25')]){if(_0x37269c[_0x793c('0x25')][_0x793c('0x26')]===0x1f4){logger[_0x793c('0x25')](_0x793c('0x27'),_0x269311,_0x37269c[_0x793c('0x25')][_0x793c('0x28')]);return _0x5a1d5a(_0x37269c['error'][_0x793c('0x28')]);}logger[_0x793c('0x25')](_0x793c('0x27'),_0x269311,_0x37269c[_0x793c('0x25')][_0x793c('0x28')]);return _0x563a34(_0x37269c[_0x793c('0x25')]['message']);}else{logger[_0x793c('0x20')](_0x793c('0x27'),_0x269311,_0x793c('0x21'));_0x563a34(_0x37269c[_0x793c('0x29')][_0x793c('0x28')]);}})[_0x793c('0x2a')](function(_0x325a2e){logger[_0x793c('0x25')](_0x793c('0x27'),_0x269311,_0x325a2e);_0x5a1d5a(_0x325a2e);});});}function respondWithStatusCode(_0x4a6e3f,_0x51a5b2){_0x51a5b2=_0x51a5b2||0xcc;return function(_0x110584){if(_0x110584){return _0x4a6e3f[_0x793c('0x2b')](_0x51a5b2);}return _0x4a6e3f[_0x793c('0x2c')](_0x51a5b2)[_0x793c('0x2d')]();};}function respondWithResult(_0x3f673c,_0x173cac){_0x173cac=_0x173cac||0xc8;return function(_0x18a8a8){if(_0x18a8a8){return _0x3f673c[_0x793c('0x2c')](_0x173cac)['json'](_0x18a8a8);}};}function respondWithFilteredResult(_0x7adbea,_0x2e7139){return function(_0x1e80b4){if(_0x1e80b4){var _0x53635a=_0x1e80b4[_0x793c('0x2e')],_0x473419=_0x2e7139[_0x793c('0x2f')],_0x2dfe6e=_0x2e7139[_0x793c('0x2f')]+_0x2e7139[_0x793c('0x30')],_0x107431;if(_0x2dfe6e>=_0x53635a){_0x2dfe6e=_0x53635a;_0x107431=0xc8;}else{_0x107431=0xce;}_0x7adbea[_0x793c('0x2c')](_0x107431);return _0x7adbea[_0x793c('0x31')](_0x793c('0x32'),_0x473419+'-'+_0x2dfe6e+'/'+_0x53635a)[_0x793c('0x33')](_0x1e80b4);}return null;};}function patchUpdates(_0x5a9f07){return function(_0x50ddbb){try{jsonpatch[_0x793c('0x34')](_0x50ddbb,_0x5a9f07,!![]);}catch(_0x5468cf){return BPromise[_0x793c('0x35')](_0x5468cf);}return _0x50ddbb[_0x793c('0x36')]();};}function saveUpdates(_0x43adaf,_0x4dffa5){return function(_0x490a2c){if(_0x490a2c){return _0x490a2c[_0x793c('0x37')](_0x43adaf)[_0x793c('0x1f')](function(_0x1bf1e4){return _0x1bf1e4;});}return null;};}function removeEntity(_0x2a4834,_0x57bda2){return function(_0x36705d){if(_0x36705d){return _0x36705d['destroy']()[_0x793c('0x1f')](function(){var _0x537142=_0x36705d[_0x793c('0x38')]({'plain':!![]});var _0x14cc7d=[{'name':'Users','value':_0x793c('0x39'),'ignore':!![]},{'name':'Agents','value':_0x793c('0x3a'),'ignore':![]},{'name':_0x793c('0x3b'),'value':_0x793c('0x3c'),'ignore':![]}];var _0x41dcfa=_(_0x14cc7d)['filter'](_0x793c('0x3d'))[_0x793c('0x3e')](_0x793c('0x3f'))[_0x793c('0x3f')]();if(_['includes'](_0x41dcfa,_0x537142['role'])){return;}var _0x196523=_[_0x793c('0x40')](_0x14cc7d,['value',_0x537142[_0x793c('0x41')]])[_0x793c('0x42')];return db['UserProfileResource'][_0x793c('0x43')]({'where':{'type':_0x196523,'resourceId':_0x537142['id']}})[_0x793c('0x1f')](function(){return _0x36705d;});})['then'](function(){_0x2a4834['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b8a5c,_0x6c52ac){return function(_0x3b5c7c){if(!_0x3b5c7c){_0x1b8a5c[_0x793c('0x2b')](0x194);}return _0x3b5c7c;};}function handleError(_0x20912a,_0x593633){_0x593633=_0x593633||0x1f4;return function(_0x5dd47d){logger[_0x793c('0x25')](_0x5dd47d['stack']);if(_0x5dd47d['name']){delete _0x5dd47d[_0x793c('0x42')];}_0x20912a[_0x793c('0x2c')](_0x593633)[_0x793c('0x44')](_0x5dd47d);};}exports['index']=function(_0x58a604,_0x51447e){var _0x31e378={},_0x25128f={},_0x32a62b={'count':0x0,'rows':[]};var _0x533856=_['map'](db[_0x793c('0x45')][_0x793c('0x46')],function(_0x2ced6e){return{'name':_0x2ced6e[_0x793c('0x47')],'type':_0x2ced6e[_0x793c('0x48')][_0x793c('0x49')]};});_0x25128f['model']=_['differenceBy'](_[_0x793c('0x3e')](_0x533856,_0x793c('0x42')),[_0x793c('0x4a'),_0x793c('0x4b')]);_0x25128f['query']=_[_0x793c('0x4c')](_0x58a604[_0x793c('0x4d')]);_0x25128f[_0x793c('0x4e')]=_['intersection'](_0x25128f['model'],_0x25128f[_0x793c('0x4d')]);_0x31e378[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x25128f[_0x793c('0x51')],qs[_0x793c('0x52')](_0x58a604['query'][_0x793c('0x52')]));_0x31e378[_0x793c('0x4f')]=_0x31e378['attributes'][_0x793c('0x53')]?_0x31e378['attributes']:_0x25128f[_0x793c('0x51')];if(!_0x58a604['query'][_0x793c('0x54')](_0x793c('0x55'))){_0x31e378[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x58a604[_0x793c('0x4d')][_0x793c('0x30')]);_0x31e378[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x58a604[_0x793c('0x4d')][_0x793c('0x2f')]);}_0x31e378[_0x793c('0x56')]=qs['sort'](_0x58a604[_0x793c('0x4d')][_0x793c('0x57')]);_0x31e378[_0x793c('0x58')]=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x58a604[_0x793c('0x4d')],_0x25128f['filters']),_0x533856);if(_0x58a604[_0x793c('0x4d')][_0x793c('0x5a')]){_0x31e378[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x31e378[_0x793c('0x58')],{'$or':_['map'](_0x533856,function(_0x4c8aac){if(_0x4c8aac[_0x793c('0x48')]!==_0x793c('0x5c')){return db[_0x793c('0x5d')]['where'](db['sequelize']['fn'](_0x793c('0x5e'),db[_0x793c('0x5d')][_0x793c('0x5f')](_0x4c8aac[_0x793c('0x42')])),{'$like':db['sequelize']['fn']('lower','%'+_0x58a604['query'][_0x793c('0x5a')]+'%')});}})});}_0x31e378=_[_0x793c('0x5b')]({},_0x31e378,_0x58a604[_0x793c('0x60')]);var _0x4c5cf1={'where':_0x31e378[_0x793c('0x58')]};return db[_0x793c('0x45')]['count'](_0x4c5cf1)[_0x793c('0x1f')](function(_0x39ea06){_0x32a62b[_0x793c('0x2e')]=_0x39ea06;if(_0x58a604[_0x793c('0x4d')][_0x793c('0x61')]){_0x31e378[_0x793c('0x62')]=[{'all':!![]}];}return db['User'][_0x793c('0x63')](_0x31e378);})[_0x793c('0x1f')](function(_0x1e9d40){_0x32a62b[_0x793c('0x64')]=_0x1e9d40;return _0x32a62b;})[_0x793c('0x1f')](respondWithFilteredResult(_0x51447e,_0x31e378))[_0x793c('0x2a')](handleError(_0x51447e,null));};exports['show']=function(_0x2988a5,_0x4bbdaa){var _0x3afc6d={'raw':![],'where':{'id':_0x2988a5[_0x793c('0x65')]['id']}},_0x432e8e={};_0x432e8e['model']=_[_0x793c('0x66')](_[_0x793c('0x4c')](db[_0x793c('0x45')][_0x793c('0x46')]),['password',_0x793c('0x4b')]);_0x432e8e[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x2988a5[_0x793c('0x4d')]);_0x432e8e['filters']=_[_0x793c('0x50')](_0x432e8e['model'],_0x432e8e['query']);_0x3afc6d['attributes']=_[_0x793c('0x50')](_0x432e8e['model'],qs[_0x793c('0x52')](_0x2988a5['query']['fields']));_0x3afc6d[_0x793c('0x4f')]=_0x3afc6d[_0x793c('0x4f')][_0x793c('0x53')]?_0x3afc6d[_0x793c('0x4f')]:_0x432e8e[_0x793c('0x51')];if(_0x2988a5['query'][_0x793c('0x61')]){_0x3afc6d[_0x793c('0x62')]=[{'all':!![]}];}_0x3afc6d=_[_0x793c('0x5b')]({},_0x3afc6d,_0x2988a5[_0x793c('0x60')]);return db[_0x793c('0x45')][_0x793c('0x40')](_0x3afc6d)[_0x793c('0x1f')](handleEntityNotFound(_0x4bbdaa,null))[_0x793c('0x1f')](respondWithResult(_0x4bbdaa,null))[_0x793c('0x2a')](handleError(_0x4bbdaa,null));};exports[_0x793c('0x67')]=function(_0x2faa77,_0x5088e9){return db[_0x793c('0x45')]['bulkCreate'](_0x2faa77[_0x793c('0x68')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x5088e9,0xc9))[_0x793c('0x2a')](handleError(_0x5088e9,null));};exports[_0x793c('0x37')]=function(_0x40ebb0,_0xee95ce){if(_0x40ebb0[_0x793c('0x68')]['id']){delete _0x40ebb0[_0x793c('0x68')]['id'];}delete _0x40ebb0[_0x793c('0x68')][_0x793c('0x41')];return db[_0x793c('0x45')][_0x793c('0x40')]({'where':{'id':_0x40ebb0[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0xee95ce,null))[_0x793c('0x1f')](saveUpdates(_0x40ebb0['body'],null))[_0x793c('0x1f')](respondWithResult(_0xee95ce,null))[_0x793c('0x2a')](handleError(_0xee95ce,null));};exports[_0x793c('0x69')]=function(_0x4a93e8,_0xa246da){return db[_0x793c('0x45')]['describe']()[_0x793c('0x1f')](respondWithResult(_0xa246da,null))[_0x793c('0x2a')](handleError(_0xa246da,null));};exports[_0x793c('0x6a')]=function(_0x514e6a,_0x1444fd,_0x1fde8e){return db[_0x793c('0x45')][_0x793c('0x40')]({'where':{'id':_0x514e6a[_0x793c('0x65')]['id']}})['then'](handleEntityNotFound(_0x1444fd,null))['then'](function(_0x317164){if(_0x317164){return _0x317164['addContacts'](_0x514e6a['body'][_0x793c('0x6b')],_[_0x793c('0x6c')](_0x514e6a[_0x793c('0x68')],[_0x793c('0x6b'),'id'])||{});}})[_0x793c('0x1f')](respondWithResult(_0x1444fd,null))[_0x793c('0x2a')](handleError(_0x1444fd,null));};var getLicense=function(_0x5dcfa4){return new BPromise(function(_0x3a6236,_0x328961){var _0x58d4d1=0x0;_0x5dcfa4['body'][_0x793c('0x41')]===_0x793c('0x3a')&&_0x3a6236(_0x793c('0x6d'));return db[_0x793c('0x45')][_0x793c('0x2e')]({'where':{'$or':[{'role':_0x5dcfa4['body'][_0x793c('0x41')]===_0x793c('0x3c')?_0x793c('0x3c'):[_0x793c('0x6e'),_0x793c('0x39')]}]}})[_0x793c('0x1f')](function(_0x57747e){_0x58d4d1=_0x57747e;return require('../../config/license/util')[_0x793c('0x6f')]();})['then'](function(_0x286af3){var _0x4e1b40=_0x5dcfa4[_0x793c('0x68')]['role']===_0x793c('0x3c')?_0x793c('0x70'):'users';if(!_[_0x793c('0x71')](_0x286af3[_0x4e1b40])&&_0x58d4d1>=_0x286af3[_0x4e1b40]){return _0x328961({'message':_0x793c('0x72')});}return _0x3a6236(util[_0x793c('0x73')](_0x793c('0x74'),_0x4e1b40,_0x58d4d1));})[_0x793c('0x2a')](function(_0x303606){return _0x328961(_0x303606);});});};exports[_0x793c('0x75')]=function(_0x40bf58,_0x58b301){return getLicense(_0x40bf58)['then'](function(_0x5e490c){if(!_0x40bf58[_0x793c('0x68')]['internal']){var _0x1f0350;return db[_0x793c('0x76')][_0x793c('0x77')](0x1)['then'](function(_0x840bc8){return checkPasswordPattern(_0x840bc8,_0x40bf58['body'][_0x793c('0x4a')],_0x840bc8[_0x793c('0x78')]);})[_0x793c('0x1f')](function(_0x336f01){_0x1f0350=_0x336f01[_0x793c('0x79')];return db[_0x793c('0x45')][_0x793c('0x7a')]('internal');})[_0x793c('0x1f')](function(_0x7cb878){if(_[_0x793c('0x71')](_0x7cb878)){if(_0x1f0350){_0x40bf58['body'][_0x793c('0x7b')]=_0x1f0350;}else{_0x40bf58['body'][_0x793c('0x7b')]=0x1;}}else{if(_[_0x793c('0x71')](_0x1f0350)||_0x1f0350==_0x7cb878){_0x40bf58[_0x793c('0x68')][_0x793c('0x7b')]=_0x7cb878+0x1;}else if(_0x1f0350>_0x7cb878){_0x40bf58[_0x793c('0x68')]['internal']=_0x1f0350;}else{return db[_0x793c('0x5d')][_0x793c('0x4d')](_0x793c('0x7c'),{'type':db['sequelize']['QueryTypes'][_0x793c('0x7d')]})[_0x793c('0x1f')](function(_0xf35f76){if(_0xf35f76&&_0xf35f76[_0x793c('0x53')]){for(var _0x2755e3=0x0,_0x91d26=_0xf35f76[_0x793c('0x53')];_0x2755e3<_0x91d26&&_['isNil'](_0x40bf58[_0x793c('0x68')][_0x793c('0x7b')]);_0x2755e3++){if(_0x1f0350<=_0xf35f76[_0x2755e3][_0x793c('0x7e')]){_0x40bf58['body'][_0x793c('0x7b')]=_0xf35f76[_0x2755e3][_0x793c('0x7e')];}else if(_0x1f0350>_0xf35f76[_0x2755e3][_0x793c('0x7e')]&&_0x1f0350<=_0xf35f76[_0x2755e3]['to']){_0x40bf58[_0x793c('0x68')]['internal']=_0x1f0350;}}}if(_[_0x793c('0x71')](_0x40bf58[_0x793c('0x68')]['internal'])){_0x40bf58[_0x793c('0x68')][_0x793c('0x7b')]=_0x7cb878+0x1;}});}}});}})[_0x793c('0x1f')](function(){if(_0x40bf58['body'][_0x793c('0x7f')]){_0x40bf58[_0x793c('0x68')][_0x793c('0x80')]=_0x40bf58[_0x793c('0x68')][_0x793c('0x7b')];_0x40bf58[_0x793c('0x68')]['VoiceMail']={'mailbox':_0x40bf58['body'][_0x793c('0x7b')],'password':_0x40bf58[_0x793c('0x68')][_0x793c('0x4a')],'fullname':_0x40bf58[_0x793c('0x68')][_0x793c('0x81')],'email':_0x40bf58[_0x793c('0x68')][_0x793c('0x82')]};}if(_0x40bf58[_0x793c('0x68')]&&_0x40bf58[_0x793c('0x68')][_0x793c('0x41')]===_0x793c('0x3a')){if(!_0x40bf58[_0x793c('0x68')][_0x793c('0x83')]){_0x40bf58[_0x793c('0x68')][_0x793c('0x83')]=['101',_0x793c('0x84'),_0x793c('0x85'),_0x793c('0x86'),'110',_0x793c('0x87'),_0x793c('0x88'),_0x793c('0x89'),'107',_0x793c('0x8a'),_0x793c('0x8b'),_0x793c('0x8c'),'111','114'];}}return db[_0x793c('0x45')]['create'](_0x40bf58[_0x793c('0x68')],{'include':[{'model':db[_0x793c('0x8d')],'as':_0x793c('0x8d')}]});})['then'](function(_0x42bd42){if(_0x40bf58[_0x793c('0x68')][_0x793c('0x41')]===_0x793c('0x39'))return _0x42bd42;var _0x1b6b83=_0x40bf58['user'][_0x793c('0x38')]({'plain':!![]});if(!_0x1b6b83)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b6b83[_0x793c('0x41')]===_0x793c('0x39')){var _0x51a14a=_0x42bd42[_0x793c('0x38')]({'plain':!![]});var _0x4b08f9=[{'name':_0x793c('0x8e'),'value':_0x793c('0x3a')},{'name':_0x793c('0x3b'),'value':_0x793c('0x3c')}];var _0x2e32e3=_['find'](_0x4b08f9,[_0x793c('0x3f'),_0x51a14a[_0x793c('0x41')]])[_0x793c('0x42')];return db[_0x793c('0x8f')][_0x793c('0x40')]({'where':{'name':_0x2e32e3,'userProfileId':_0x1b6b83[_0x793c('0x90')]},'raw':!![]})[_0x793c('0x1f')](function(_0x265e16){if(_0x265e16&&_0x265e16[_0x793c('0x91')]===0x0){return db[_0x793c('0x92')][_0x793c('0x75')]({'name':_0x51a14a[_0x793c('0x42')],'resourceId':_0x51a14a['id'],'type':_0x265e16[_0x793c('0x42')],'sectionId':_0x265e16['id']},{})[_0x793c('0x1f')](function(){return _0x42bd42;});}else{return _0x42bd42;}})[_0x793c('0x2a')](function(_0x17b4b3){logger[_0x793c('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17b4b3);throw _0x17b4b3;});}return _0x42bd42;})[_0x793c('0x1f')](respondWithResult(_0x58b301,0xc9))[_0x793c('0x2a')](handleError(_0x58b301,null));};exports[_0x793c('0x93')]=function(_0x17381f,_0x4908b0,_0x515953){var _0xd23bc5=![];if(_0x17381f[_0x793c('0x68')]['id']){delete _0x17381f[_0x793c('0x68')]['id'];}return db[_0x793c('0x76')][_0x793c('0x94')]({'attributes':['id','securePassword']})[_0x793c('0x1f')](function(_0x1de90a){_0xd23bc5=_0x1de90a[_0x793c('0x78')];return db[_0x793c('0x45')]['find']({'where':{'id':_0x17381f[_0x793c('0x65')]['id']}});})[_0x793c('0x1f')](function(_0x18f0fa){if(_0x18f0fa){if(_0x18f0fa['id']==_0x17381f[_0x793c('0x39')]['id']){if(!_0x17381f['body'][_0x793c('0x95')]||!_0x17381f['body'][_0x793c('0x96')]){throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))](_0x793c('0x98'));}if(!_0x18f0fa[_0x793c('0x99')](_0x17381f[_0x793c('0x68')][_0x793c('0x95')])){throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))](_0x793c('0x9a'));}if(_0x17381f[_0x793c('0x68')][_0x793c('0x95')]==_0x17381f[_0x793c('0x68')][_0x793c('0x96')]){throw new db['Sequelize'][(_0x793c('0x97'))](_0x793c('0x9b'));}return _0x18f0fa;}else if(_0x17381f[_0x793c('0x39')][_0x793c('0x41')]=='admin'){if(!_0x17381f['body'][_0x793c('0x96')]){throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))](_0x793c('0x9c'));}return _0x18f0fa;}else if(_0x17381f['user'][_0x793c('0x41')]==_0x793c('0x39')){if(!_0x17381f[_0x793c('0x68')][_0x793c('0x96')]){throw new db[(_0x793c('0x1c'))]['ValidationError'](_0x793c('0x9c'));}if(_0x18f0fa[_0x793c('0x41')]!='agent'){throw new db['Sequelize']['ValidationError'](_0x793c('0x9d'));}return _0x18f0fa;}else{throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))](_0x793c('0x9d'));}}return null;})['then'](handleEntityNotFound(_0x4908b0,null))[_0x793c('0x1f')](function(_0x39fa34){return checkPasswordPattern(_0x39fa34,_0x17381f[_0x793c('0x68')][_0x793c('0x96')],_0xd23bc5);})[_0x793c('0x1f')](saveUpdates({'password':_0x17381f[_0x793c('0x68')][_0x793c('0x96')],'passwordResetAt':_0x17381f[_0x793c('0x39')]['id']==_0x17381f[_0x793c('0x65')]['id']?moment():null},null))[_0x793c('0x1f')](respondWithResult(_0x4908b0,null))[_0x793c('0x2a')](handleError(_0x4908b0,null));};exports['addQueues']=function(_0x1571ab,_0x95d04a,_0x5601c0){var _0x589967=_0x1571ab[_0x793c('0x68')][_0x793c('0x9e')];return db['User'][_0x793c('0x40')]({'where':{'id':_0x1571ab[_0x793c('0x65')]['id']},'attributes':['id','name',_0x793c('0x41'),_0x793c('0x9f'),_0x793c('0xa0'),_0x793c('0xa1'),_0x793c('0xa2')]})[_0x793c('0x1f')](handleEntityNotFound(_0x95d04a,null))[_0x793c('0x1f')](function(_0xe2b342){if(_0xe2b342){if(!utils[_0x793c('0xa3')](_0x589967)){throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))]('Unknown\x20channel');}return _0xe2b342['add'+_[_0x793c('0xa4')](_0x589967[_0x793c('0xa5')]())+_0x793c('0xa6')](_0x1571ab[_0x793c('0x68')]['ids'],{'penalty':_0x1571ab[_0x793c('0x68')]['penalty']||0x0})[_0x793c('0xa7')](function(_0xbaaab8){for(var _0x1c099f=0x0;_0x1c099f<_0x1571ab['body'][_0x793c('0x6b')][_0x793c('0x53')];_0x1c099f+=0x1){var _0x1c5c6c={'UserId':_0x1571ab[_0x793c('0x65')]['id']};_0x1c5c6c[_[_0x793c('0xa4')](_0x589967[_0x793c('0xa5')]())+_0x793c('0xa8')]=_0x1571ab[_0x793c('0x68')]['ids'][_0x1c099f];socket[_0x793c('0xa9')](_0x793c('0x39')+_['capitalize'](_0x589967[_0x793c('0xa5')]())+_0x793c('0xaa'),_0x1c5c6c);}return _0xbaaab8;})['then'](function(){if(_0x589967===_0x793c('0xab')){return db['VoiceQueue'][_0x793c('0x63')]({'where':{'id':_0x1571ab['body'][_0x793c('0x6b')]||[]},'raw':!![],'attributes':['id',_0x793c('0x42')]});}})[_0x793c('0x1f')](function(_0x4a568d){var _0x16eb43=_0xe2b342[_0x793c('0x38')]({'plain':!![]});var _0x2dd717=[];if(_0x589967===_0x793c('0xab')&&_0x16eb43[_0x793c('0x41')]===_0x793c('0x3a')&&_0x16eb43[_0x793c('0x9f')]){for(var _0x1433e1=0x0;_0x1433e1<_0x4a568d[_0x793c('0x53')];_0x1433e1+=0x1){_0x2dd717[_0x793c('0xac')]({'membername':_0x16eb43[_0x793c('0x42')],'UserId':_0x16eb43['id'],'queue_name':_0x4a568d[_0x1433e1][_0x793c('0x42')],'VoiceQueueId':_0x4a568d[_0x1433e1]['id'],'interface':_[_0x793c('0x71')](_0x16eb43[_0x793c('0xa2')])?util[_0x793c('0x73')](_0x793c('0xad'),_0x16eb43[_0x793c('0x42')]):_0x16eb43[_0x793c('0xa2')],'paused':_0x16eb43['voicePause']||![],'penalty':_0x1571ab[_0x793c('0x68')]['penalty']||0x0});}return BPromise[_0x793c('0xae')](_0x2dd717,function(_0x4bac3e){return db[_0x793c('0xaf')]['upsert'](_0x4bac3e);});}return _0xe2b342;});}})['then'](respondWithStatusCode(_0x95d04a,null))[_0x793c('0x2a')](handleError(_0x95d04a,null));};exports[_0x793c('0xb0')]=function(_0x55bfc1,_0x24329c,_0x5ae5ee){var _0x1e61c2;return db[_0x793c('0x45')]['find']({'where':{'id':_0x55bfc1[_0x793c('0x65')]['id']},'attributes':['id',_0x793c('0x42'),_0x793c('0x41')]})['then'](handleEntityNotFound(_0x24329c,null))[_0x793c('0x1f')](function(_0x50be27){if(_0x50be27){_0x1e61c2=_0x50be27;if(!_0x55bfc1['query'][_0x793c('0x9e')]||!utils[_0x793c('0xa3')](_0x55bfc1['query']['channel'])){throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))](_0x793c('0xb1'));}return _0x50be27['remove'+_[_0x793c('0xa4')](_0x55bfc1[_0x793c('0x4d')][_0x793c('0x9e')][_0x793c('0xa5')]())+_0x793c('0xa6')](_0x55bfc1['query'][_0x793c('0x6b')]);}})[_0x793c('0x1f')](function(_0xa4b833){for(var _0x37a256=0x0;_0x37a256<_0x55bfc1[_0x793c('0x4d')][_0x793c('0x6b')]['length'];_0x37a256+=0x1){var _0x273198={'UserId':_0x55bfc1['params']['id']};_0x273198[_[_0x793c('0xa4')](_0x55bfc1['query']['channel']['toLowerCase']())+_0x793c('0xa8')]=_0x55bfc1[_0x793c('0x4d')][_0x793c('0x6b')][_0x37a256];socket[_0x793c('0xa9')]('user'+_[_0x793c('0xa4')](_0x55bfc1[_0x793c('0x4d')][_0x793c('0x9e')][_0x793c('0xa5')]())+_0x793c('0xb2'),_0x273198);}return _0xa4b833;})['then'](function(){if(_0x55bfc1[_0x793c('0x4d')]['channel']===_0x793c('0xab')){return db['UserVoiceQueueRt'][_0x793c('0x43')]({'where':{'UserId':_0x55bfc1[_0x793c('0x65')]['id'],'VoiceQueueId':_0x55bfc1['query'][_0x793c('0x6b')]},'individualHooks':!![]})[_0x793c('0x1f')](function(){return _0x1e61c2;});}return _0x1e61c2;})[_0x793c('0x1f')](respondWithStatusCode(_0x24329c,null))[_0x793c('0x2a')](handleError(_0x24329c,null));};exports['addAvatar']=function(_0x415b0a,_0x3a9aa9,_0x2bce60){_0x415b0a[_0x793c('0x68')][_0x793c('0xb3')]=_0x415b0a[_0x793c('0xb4')][_0x793c('0xb5')];return db[_0x793c('0x45')][_0x793c('0x40')]({'where':{'id':_0x415b0a[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x3a9aa9,null))[_0x793c('0x1f')](saveUpdates(_0x415b0a[_0x793c('0x68')],null))[_0x793c('0x1f')](respondWithResult(_0x3a9aa9,null))['catch'](handleError(_0x3a9aa9,null));};exports[_0x793c('0xb6')]=function(_0xee6885,_0x4baa76,_0x161dcb){var _0x2dcc12=path['join'](config[_0x793c('0xb7')],_0x793c('0xb8'));return db[_0x793c('0x45')][_0x793c('0x40')]({'where':{'id':_0xee6885['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x793c('0x1f')](handleEntityNotFound(_0x4baa76,null))['then'](function(_0x434c6a){if(_0x434c6a){if(_['isNil'](_0x434c6a['userpic'])){return _0x4baa76[_0x793c('0xb9')](_0x2dcc12);}else{if(!fs[_0x793c('0xba')](path['join'](config[_0x793c('0xb7')],_0x793c('0xbb'),_0x434c6a[_0x793c('0xb3')]))){return _0x4baa76[_0x793c('0xb9')](_0x2dcc12);}return _0x4baa76[_0x793c('0xb9')](path[_0x793c('0xbc')](config[_0x793c('0xb7')],_0x793c('0xbb'),_0x434c6a[_0x793c('0xb3')]));}}})['catch'](handleError(_0x4baa76,null));};exports[_0x793c('0xbd')]=function(_0x854750,_0x2b7a58,_0x26c531){var _0x462116={};var _0xfaa83f={};var _0x41c2c8;var _0x35c96f;return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0x854750[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x2b7a58,null))[_0x793c('0x1f')](function(_0x54dd27){if(_0x54dd27){_0x41c2c8=_0x54dd27;_0xfaa83f[_0x793c('0x51')]=_[_0x793c('0x4c')](db[_0x793c('0xbe')][_0x793c('0x46')]);_0xfaa83f['query']=_['keys'](_0x854750[_0x793c('0x4d')]);_0xfaa83f[_0x793c('0x4e')]=_[_0x793c('0x50')](_0xfaa83f['model'],_0xfaa83f[_0x793c('0x4d')]);_0x462116['attributes']=_[_0x793c('0x50')](_0xfaa83f[_0x793c('0x51')],qs['fields'](_0x854750[_0x793c('0x4d')][_0x793c('0x52')]));_0x462116['attributes']=_0x462116['attributes']['length']?_0x462116['attributes']:_0xfaa83f[_0x793c('0x51')];_0x462116[_0x793c('0x56')]=qs['sort'](_0x854750[_0x793c('0x4d')]['sort']);_0x462116[_0x793c('0x58')]=qs['filters'](_['pick'](_0x854750[_0x793c('0x4d')],_0xfaa83f[_0x793c('0x4e')]));if(_0x854750['query'][_0x793c('0x5a')]){_0x462116[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x462116[_0x793c('0x58')],{'$or':_['map'](_0x462116['attributes'],function(_0x3c49c0){var _0x5c4c0c={};_0x5c4c0c[_0x3c49c0]={'$like':'%'+_0x854750[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x5c4c0c;})});}_0x462116=_['merge']({},_0x462116,_0x854750['options']);return _0x41c2c8[_0x793c('0xbd')](_0x462116);}})[_0x793c('0x1f')](function(_0x414dd1){if(_0x414dd1){_0x35c96f=_0x414dd1[_0x793c('0x53')];if(_0x854750['query'][_0x793c('0x54')](_0x793c('0x61'))){_0x462116[_0x793c('0x62')]=[{'model':db[_0x793c('0xbf')],'as':_0x793c('0xc0'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x793c('0x42'),_0x793c('0xc1')],'where':_0x854750['query']['tag']?{'id':_0x854750[_0x793c('0x4d')][_0x793c('0xc2')]}:undefined,'required':_0x854750[_0x793c('0x4d')][_0x793c('0xc2')]?!![]:![]}];}if(!_0x854750[_0x793c('0x4d')][_0x793c('0x54')]('nolimit')){_0x462116[_0x793c('0x30')]=qs['limit'](_0x854750[_0x793c('0x4d')][_0x793c('0x30')]);_0x462116['offset']=qs[_0x793c('0x2f')](_0x854750[_0x793c('0x4d')][_0x793c('0x2f')]);}return _0x41c2c8[_0x793c('0xbd')](_0x462116);}})['then'](function(_0x464a50){if(_0x464a50){return _0x464a50?{'count':_0x35c96f,'rows':_0x464a50}:null;}})[_0x793c('0x1f')](respondWithResult(_0x2b7a58,null))[_0x793c('0x2a')](handleError(_0x2b7a58,null));};exports[_0x793c('0xc3')]=function(_0x4d36c4,_0xfc88af,_0xeacccb){var _0x5123bb;var _0x233b30;var _0x3d4d75={};var _0x7f245a;return db[_0x793c('0x45')]['findOne']({'where':{'id':_0x4d36c4[_0x793c('0x65')]['id']},'attributes':['id','name',_0x793c('0x41')]})[_0x793c('0x1f')](handleEntityNotFound(_0xfc88af,null))[_0x793c('0x1f')](function(_0x362ac6){if(!utils[_0x793c('0xa3')](_0x4d36c4['query'][_0x793c('0x9e')])){throw new db[(_0x793c('0x1c'))]['ValidationError'](_0x793c('0xb1'));}_0x5123bb=_0x362ac6;var _0x1b7da1={};_0x1b7da1[_0x793c('0x51')]=_[_0x793c('0x4c')](db[_['capitalize'](_0x4d36c4[_0x793c('0x4d')][_0x793c('0x9e')])+'Queue'][_0x793c('0x46')]);_0x1b7da1[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x4d36c4[_0x793c('0x4d')]);_0x1b7da1[_0x793c('0x4e')]=_[_0x793c('0x50')](_0x1b7da1['model'],_0x1b7da1[_0x793c('0x4d')]);_0x3d4d75[_0x793c('0x4f')]=_['intersection'](_0x1b7da1['model'],qs[_0x793c('0x52')](_0x4d36c4['query']['fields']));_0x3d4d75[_0x793c('0x4f')]=_0x3d4d75[_0x793c('0x4f')][_0x793c('0x53')]?_0x3d4d75[_0x793c('0x4f')]:_0x1b7da1['model'];_0x3d4d75['order']=qs[_0x793c('0x57')](_0x4d36c4[_0x793c('0x4d')][_0x793c('0x57')]);_0x3d4d75[_0x793c('0x58')]=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x4d36c4[_0x793c('0x4d')],_0x1b7da1[_0x793c('0x4e')]));if(_0x4d36c4[_0x793c('0x4d')][_0x793c('0x5a')]){_0x3d4d75['where']=_[_0x793c('0x5b')](_0x3d4d75[_0x793c('0x58')],{'$or':_[_0x793c('0x3e')](_0x3d4d75[_0x793c('0x4f')],function(_0x2ae7e7){var _0x53280b={};_0x53280b[_0x2ae7e7]={'$like':'%'+_0x4d36c4[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x53280b;})});}_0x3d4d75=_[_0x793c('0x5b')]({},_0x3d4d75,_0x4d36c4[_0x793c('0x60')]);switch(_0x5123bb[_0x793c('0x41')]){case _0x793c('0x6e'):return db[_[_0x793c('0xa4')](_0x4d36c4[_0x793c('0x4d')][_0x793c('0x9e')])+_0x793c('0xc4')][_0x793c('0x63')](_0x3d4d75);case _0x793c('0x39'):case _0x793c('0x3a'):return _0x5123bb[_0x793c('0x38')+_[_0x793c('0xa4')](_0x4d36c4[_0x793c('0x4d')][_0x793c('0x9e')])+_0x793c('0xa6')](_0x3d4d75);default:throw new db[(_0x793c('0x1c'))]['ValidationError'](_0x793c('0xc5'));}})['then'](function(_0x7aad93){_0x7f245a=_0x7aad93['length'];if(!_0x4d36c4[_0x793c('0x4d')][_0x793c('0x54')](_0x793c('0x55'))){_0x3d4d75[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x4d36c4['query']['limit']);_0x3d4d75[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x4d36c4[_0x793c('0x4d')][_0x793c('0x2f')]);}switch(_0x5123bb['role']){case _0x793c('0x6e'):return db[_[_0x793c('0xa4')](_0x4d36c4[_0x793c('0x4d')][_0x793c('0x9e')])+_0x793c('0xc4')][_0x793c('0x63')](_0x3d4d75);case'user':case _0x793c('0x3a'):return _0x5123bb[_0x793c('0x38')+_[_0x793c('0xa4')](_0x4d36c4['query'][_0x793c('0x9e')])+_0x793c('0xa6')](_0x3d4d75);}})[_0x793c('0x1f')](function(_0x3f7448){return{'count':_0x7f245a,'rows':_0x3f7448};})[_0x793c('0x1f')](respondWithResult(_0xfc88af,null))[_0x793c('0x2a')](handleError(_0xfc88af,null));};exports[_0x793c('0xc6')]=function(_0x2ea118,_0x35c334,_0xb848e0){var _0x39d643={};var _0x509457={};var _0x58c742;var _0x869e7;return db['User'][_0x793c('0x94')]({'where':{'id':_0x2ea118[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x35c334,null))[_0x793c('0x1f')](function(_0x32c3a4){if(_0x32c3a4){_0x58c742=_0x32c3a4;_0x509457[_0x793c('0x51')]=_['keys'](db['UserVoiceQueueRt'][_0x793c('0x46')]);_0x509457[_0x793c('0x4d')]=_['keys'](_0x2ea118[_0x793c('0x4d')]);_0x509457[_0x793c('0x4e')]=_[_0x793c('0x50')](_0x509457['model'],_0x509457['query']);_0x39d643[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x509457['model'],qs['fields'](_0x2ea118[_0x793c('0x4d')][_0x793c('0x52')]));_0x39d643[_0x793c('0x4f')]=_0x39d643[_0x793c('0x4f')]['length']?_0x39d643['attributes']:_0x509457[_0x793c('0x51')];_0x39d643['order']=qs[_0x793c('0x57')](_0x2ea118['query']['sort']);_0x39d643['where']=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x2ea118[_0x793c('0x4d')],_0x509457['filters']));if(_0x2ea118[_0x793c('0x4d')][_0x793c('0x5a')]){_0x39d643['where']=_[_0x793c('0x5b')](_0x39d643['where'],{'$or':_['map'](_0x39d643[_0x793c('0x4f')],function(_0x29bf57){var _0x52cd0b={};_0x52cd0b[_0x29bf57]={'$like':'%'+_0x2ea118['query']['filter']+'%'};return _0x52cd0b;})});}_0x39d643=_[_0x793c('0x5b')]({},_0x39d643,_0x2ea118['options']);return _0x58c742[_0x793c('0xc6')](_0x39d643);}})['then'](function(_0x169c48){if(_0x169c48){_0x869e7=_0x169c48[_0x793c('0x53')];if(!_0x2ea118[_0x793c('0x4d')]['hasOwnProperty'](_0x793c('0x55'))){_0x39d643[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x2ea118[_0x793c('0x4d')][_0x793c('0x30')]);_0x39d643[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x2ea118[_0x793c('0x4d')][_0x793c('0x2f')]);}return _0x58c742[_0x793c('0xc6')](_0x39d643);}})[_0x793c('0x1f')](function(_0x5b9220){if(_0x5b9220){return _0x5b9220?{'count':_0x869e7,'rows':_0x5b9220}:null;}})[_0x793c('0x1f')](respondWithResult(_0x35c334,null))[_0x793c('0x2a')](handleError(_0x35c334,null));};exports[_0x793c('0xc7')]=function(_0x34d2ba,_0x26423b,_0x57bf45){var _0x5b722d={};var _0x1a26ee={};var _0x29a8fd;var _0xc001d2;return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0x34d2ba[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x26423b,null))[_0x793c('0x1f')](function(_0x19052e){if(_0x19052e){_0x29a8fd=_0x19052e;_0x1a26ee['model']=_['keys'](db['ChatGroup']['rawAttributes']);_0x1a26ee[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x34d2ba[_0x793c('0x4d')]);_0x1a26ee[_0x793c('0x4e')]=_[_0x793c('0x50')](_0x1a26ee[_0x793c('0x51')],_0x1a26ee[_0x793c('0x4d')]);_0x5b722d[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x1a26ee[_0x793c('0x51')],qs[_0x793c('0x52')](_0x34d2ba[_0x793c('0x4d')]['fields']));_0x5b722d[_0x793c('0x4f')]=_0x5b722d[_0x793c('0x4f')][_0x793c('0x53')]?_0x5b722d[_0x793c('0x4f')]:_0x1a26ee['model'];_0x5b722d[_0x793c('0x56')]=qs[_0x793c('0x57')](_0x34d2ba[_0x793c('0x4d')]['sort']);_0x5b722d[_0x793c('0x58')]=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x34d2ba[_0x793c('0x4d')],_0x1a26ee[_0x793c('0x4e')]));if(_0x34d2ba['query']['filter']){_0x5b722d[_0x793c('0x58')]=_['merge'](_0x5b722d[_0x793c('0x58')],{'$or':_[_0x793c('0x3e')](_0x5b722d['attributes'],function(_0x3de4c4){var _0x55b757={};_0x55b757[_0x3de4c4]={'$like':'%'+_0x34d2ba[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x55b757;})});}_0x5b722d=_[_0x793c('0x5b')]({},_0x5b722d,_0x34d2ba['options']);return _0x29a8fd[_0x793c('0xc7')](_0x5b722d);}})[_0x793c('0x1f')](function(_0x59f43f){if(_0x59f43f){_0xc001d2=_0x59f43f['length'];if(!_0x34d2ba[_0x793c('0x4d')][_0x793c('0x54')](_0x793c('0x55'))){_0x5b722d[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x34d2ba[_0x793c('0x4d')][_0x793c('0x30')]);_0x5b722d[_0x793c('0x2f')]=qs['offset'](_0x34d2ba['query'][_0x793c('0x2f')]);}return _0x29a8fd[_0x793c('0xc7')](_0x5b722d);}})[_0x793c('0x1f')](function(_0x1682ad){if(_0x1682ad){return _0x1682ad?{'count':_0xc001d2,'rows':_0x1682ad}:null;}})['then'](respondWithResult(_0x26423b,null))[_0x793c('0x2a')](handleError(_0x26423b,null));};exports[_0x793c('0xc8')]=function(_0x3397b2,_0x548e6c,_0x57f6e9){var _0x56b664={'raw':!![],'where':{}};var _0x1c7558={};var _0x349b30={'count':0x0,'rows':[]};return db['User'][_0x793c('0x94')]({'where':{'id':_0x3397b2['params']['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x548e6c,null))[_0x793c('0x1f')](function(_0x2ff84c){if(_0x2ff84c){_0x1c7558[_0x793c('0x51')]=_['keys'](db[_0x793c('0xc9')]['rawAttributes']);_0x1c7558[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x3397b2[_0x793c('0x4d')]);_0x1c7558[_0x793c('0x4e')]=_['intersection'](_0x1c7558['model'],_0x1c7558[_0x793c('0x4d')]);_0x56b664[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x1c7558[_0x793c('0x51')],qs[_0x793c('0x52')](_0x3397b2[_0x793c('0x4d')][_0x793c('0x52')]));_0x56b664[_0x793c('0x4f')]=_0x56b664[_0x793c('0x4f')]['length']?_0x56b664['attributes']:_0x1c7558[_0x793c('0x51')];if(!_0x3397b2[_0x793c('0x4d')][_0x793c('0x54')](_0x793c('0x55'))){_0x56b664['limit']=qs['limit'](_0x3397b2[_0x793c('0x4d')]['limit']);_0x56b664[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x3397b2[_0x793c('0x4d')]['offset']);}_0x56b664[_0x793c('0x56')]=qs['sort'](_0x3397b2[_0x793c('0x4d')][_0x793c('0x57')]);_0x56b664[_0x793c('0x58')]=qs['filters'](_['pick'](_0x3397b2['query'],_0x1c7558[_0x793c('0x4e')]));_0x56b664[_0x793c('0x58')][_0x793c('0xca')]=_0x2ff84c['id'];if(_0x3397b2[_0x793c('0x4d')][_0x793c('0x5a')]){_0x56b664[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x56b664[_0x793c('0x58')],{'$or':_[_0x793c('0x3e')](_0x56b664['attributes'],function(_0x1972b6){var _0x51be35={};_0x51be35[_0x1972b6]={'$like':'%'+_0x3397b2[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x51be35;})});}_0x56b664=_['merge']({},_0x56b664,_0x3397b2[_0x793c('0x60')]);return db['VoiceRecording'][_0x793c('0x2e')]({'where':_0x56b664[_0x793c('0x58')]})[_0x793c('0x1f')](function(_0x356121){_0x349b30[_0x793c('0x2e')]=_0x356121;if(_0x3397b2['query'][_0x793c('0x61')]){_0x56b664[_0x793c('0x62')]=[{'all':!![]}];}return db[_0x793c('0xc9')][_0x793c('0x63')](_0x56b664);})[_0x793c('0x1f')](function(_0x431f82){_0x349b30[_0x793c('0x64')]=_0x431f82;return _0x349b30;});}})[_0x793c('0x1f')](respondWithFilteredResult(_0x548e6c,_0x56b664))[_0x793c('0x2a')](handleError(_0x548e6c,null));};exports[_0x793c('0xcb')]=function(_0x42a50f,_0x3cd952,_0x107df2){var _0x5482f1={'raw':!![],'where':{}};var _0x44508b={};var _0x549fe7={'count':0x0,'rows':[]};return db[_0x793c('0x45')]['findOne']({'where':{'id':_0x42a50f[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x3cd952,null))[_0x793c('0x1f')](function(_0x53f80c){if(_0x53f80c){_0x44508b[_0x793c('0x51')]=_['keys'](db[_0x793c('0xcc')][_0x793c('0x46')]);_0x44508b['query']=_[_0x793c('0x4c')](_0x42a50f[_0x793c('0x4d')]);_0x44508b[_0x793c('0x4e')]=_[_0x793c('0x50')](_0x44508b[_0x793c('0x51')],_0x44508b[_0x793c('0x4d')]);_0x5482f1['attributes']=_['intersection'](_0x44508b[_0x793c('0x51')],qs[_0x793c('0x52')](_0x42a50f[_0x793c('0x4d')][_0x793c('0x52')]));_0x5482f1[_0x793c('0x4f')]=_0x5482f1[_0x793c('0x4f')][_0x793c('0x53')]?_0x5482f1[_0x793c('0x4f')]:_0x44508b[_0x793c('0x51')];if(!_0x42a50f[_0x793c('0x4d')]['hasOwnProperty']('nolimit')){_0x5482f1[_0x793c('0x30')]=qs['limit'](_0x42a50f['query'][_0x793c('0x30')]);_0x5482f1['offset']=qs[_0x793c('0x2f')](_0x42a50f[_0x793c('0x4d')][_0x793c('0x2f')]);}_0x5482f1[_0x793c('0x56')]=qs[_0x793c('0x57')](_0x42a50f[_0x793c('0x4d')][_0x793c('0x57')]);_0x5482f1['where']=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x42a50f[_0x793c('0x4d')],_0x44508b[_0x793c('0x4e')]));_0x5482f1[_0x793c('0x58')]['UserId']=_0x53f80c['id'];if(_0x42a50f[_0x793c('0x4d')][_0x793c('0x5a')]){_0x5482f1[_0x793c('0x58')]=_['merge'](_0x5482f1['where'],{'$or':_['map'](_0x5482f1[_0x793c('0x4f')],function(_0x2cee9b){var _0x23a530={};_0x23a530[_0x2cee9b]={'$like':'%'+_0x42a50f[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x23a530;})});}_0x5482f1=_['merge']({},_0x5482f1,_0x42a50f['options']);return db[_0x793c('0xcc')][_0x793c('0x2e')]({'where':_0x5482f1[_0x793c('0x58')]})[_0x793c('0x1f')](function(_0x37fc2b){_0x549fe7[_0x793c('0x2e')]=_0x37fc2b;if(_0x42a50f['query'][_0x793c('0x61')]){_0x5482f1[_0x793c('0x62')]=[{'all':!![]}];}return db[_0x793c('0xcc')][_0x793c('0x63')](_0x5482f1);})['then'](function(_0x9c261c){_0x549fe7[_0x793c('0x64')]=_0x9c261c;return _0x549fe7;});}})['then'](respondWithFilteredResult(_0x3cd952,_0x5482f1))['catch'](handleError(_0x3cd952,null));};exports['getChatInteractions']=function(_0x373433,_0x3eaf1a,_0x55280c){var _0x14aee6={};var _0x1355cf={};var _0x2349a1;var _0x4865a1;return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0x373433['params']['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x3eaf1a,null))[_0x793c('0x1f')](function(_0x1b8ee5){if(_0x1b8ee5){_0x2349a1=_0x1b8ee5;_0x1355cf[_0x793c('0x51')]=_['keys'](db[_0x793c('0xcd')][_0x793c('0x46')]);_0x1355cf[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x373433[_0x793c('0x4d')]);_0x1355cf[_0x793c('0x4e')]=_['intersection'](_0x1355cf[_0x793c('0x51')],_0x1355cf[_0x793c('0x4d')]);_0x14aee6[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x1355cf[_0x793c('0x51')],qs[_0x793c('0x52')](_0x373433[_0x793c('0x4d')][_0x793c('0x52')]));_0x14aee6[_0x793c('0x4f')]=_0x14aee6[_0x793c('0x4f')][_0x793c('0x53')]?_0x14aee6[_0x793c('0x4f')]:_0x1355cf[_0x793c('0x51')];_0x14aee6[_0x793c('0x56')]=qs[_0x793c('0x57')](_0x373433[_0x793c('0x4d')][_0x793c('0x57')]);_0x14aee6['where']=qs[_0x793c('0x4e')](_['pick'](_0x373433[_0x793c('0x4d')],_0x1355cf[_0x793c('0x4e')]));if(_0x373433[_0x793c('0x4d')]['filter']){_0x14aee6[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x14aee6[_0x793c('0x58')],{'$or':_[_0x793c('0x3e')](_0x14aee6['attributes'],function(_0x36733c){var _0x293b39={};_0x293b39[_0x36733c]={'$like':'%'+_0x373433[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x293b39;})});}_0x14aee6=_[_0x793c('0x5b')]({},_0x14aee6,_0x373433[_0x793c('0x60')]);return _0x2349a1[_0x793c('0xce')](_0x14aee6);}})[_0x793c('0x1f')](function(_0x27d69c){if(_0x27d69c){_0x4865a1=_0x27d69c[_0x793c('0x53')];if(!_0x373433['query']['hasOwnProperty'](_0x793c('0x55'))){_0x14aee6[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x373433[_0x793c('0x4d')][_0x793c('0x30')]);_0x14aee6[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x373433[_0x793c('0x4d')][_0x793c('0x2f')]);}return _0x2349a1['getChatInteractions'](_0x14aee6);}})[_0x793c('0x1f')](function(_0x5f370f){if(_0x5f370f){return _0x5f370f?{'count':_0x4865a1,'rows':_0x5f370f}:null;}})[_0x793c('0x1f')](respondWithResult(_0x3eaf1a,null))['catch'](handleError(_0x3eaf1a,null));};exports[_0x793c('0xcf')]=function(_0x548ed4,_0x5e7b03,_0x4a5ea0){var _0x47671f={};var _0x3faf06={};var _0x48c015;var _0x33fead;return db['User']['findOne']({'where':{'id':_0x548ed4[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x5e7b03,null))['then'](function(_0x34ae99){if(_0x34ae99){_0x48c015=_0x34ae99;_0x3faf06[_0x793c('0x51')]=_['keys'](db['OpenchannelInteraction'][_0x793c('0x46')]);_0x3faf06[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x548ed4[_0x793c('0x4d')]);_0x3faf06[_0x793c('0x4e')]=_[_0x793c('0x50')](_0x3faf06['model'],_0x3faf06[_0x793c('0x4d')]);_0x47671f[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x3faf06[_0x793c('0x51')],qs[_0x793c('0x52')](_0x548ed4[_0x793c('0x4d')][_0x793c('0x52')]));_0x47671f[_0x793c('0x4f')]=_0x47671f[_0x793c('0x4f')][_0x793c('0x53')]?_0x47671f[_0x793c('0x4f')]:_0x3faf06[_0x793c('0x51')];_0x47671f['order']=qs[_0x793c('0x57')](_0x548ed4[_0x793c('0x4d')][_0x793c('0x57')]);_0x47671f[_0x793c('0x58')]=qs[_0x793c('0x4e')](_['pick'](_0x548ed4[_0x793c('0x4d')],_0x3faf06[_0x793c('0x4e')]));if(_0x548ed4[_0x793c('0x4d')]['filter']){_0x47671f[_0x793c('0x58')]=_['merge'](_0x47671f['where'],{'$or':_[_0x793c('0x3e')](_0x47671f[_0x793c('0x4f')],function(_0x111674){var _0x4ca440={};_0x4ca440[_0x111674]={'$like':'%'+_0x548ed4[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x4ca440;})});}_0x47671f=_[_0x793c('0x5b')]({},_0x47671f,_0x548ed4[_0x793c('0x60')]);return _0x48c015[_0x793c('0xcf')](_0x47671f);}})[_0x793c('0x1f')](function(_0x3b2da9){if(_0x3b2da9){_0x33fead=_0x3b2da9[_0x793c('0x53')];if(!_0x548ed4['query'][_0x793c('0x54')](_0x793c('0x55'))){_0x47671f[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x548ed4[_0x793c('0x4d')][_0x793c('0x30')]);_0x47671f[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x548ed4['query'][_0x793c('0x2f')]);}return _0x48c015[_0x793c('0xcf')](_0x47671f);}})['then'](function(_0x8d8b9){if(_0x8d8b9){return _0x8d8b9?{'count':_0x33fead,'rows':_0x8d8b9}:null;}})[_0x793c('0x1f')](respondWithResult(_0x5e7b03,null))['catch'](handleError(_0x5e7b03,null));};exports[_0x793c('0xd0')]=function(_0x40e124,_0x3e747c,_0x58179d){var _0x1849f0={'raw':!![],'where':{}};var _0x4120e1={};var _0x2b7968={'count':0x0,'rows':[]};return db['User'][_0x793c('0x94')]({'where':{'id':_0x40e124[_0x793c('0x65')]['id']}})['then'](handleEntityNotFound(_0x3e747c,null))[_0x793c('0x1f')](function(_0x431a6d){if(_0x431a6d){_0x4120e1[_0x793c('0x51')]=_[_0x793c('0x4c')](db[_0x793c('0xd1')]['rawAttributes']);_0x4120e1[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x40e124['query']);_0x4120e1['filters']=_[_0x793c('0x50')](_0x4120e1[_0x793c('0x51')],_0x4120e1['query']);_0x1849f0[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x4120e1['model'],qs['fields'](_0x40e124[_0x793c('0x4d')][_0x793c('0x52')]));_0x1849f0[_0x793c('0x4f')]=_0x1849f0[_0x793c('0x4f')][_0x793c('0x53')]?_0x1849f0[_0x793c('0x4f')]:_0x4120e1['model'];if(!_0x40e124['query'][_0x793c('0x54')](_0x793c('0x55'))){_0x1849f0[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x40e124[_0x793c('0x4d')][_0x793c('0x30')]);_0x1849f0[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x40e124[_0x793c('0x4d')][_0x793c('0x2f')]);}_0x1849f0['order']=qs[_0x793c('0x57')](_0x40e124[_0x793c('0x4d')][_0x793c('0x57')]);_0x1849f0[_0x793c('0x58')]=qs[_0x793c('0x4e')](_['pick'](_0x40e124[_0x793c('0x4d')],_0x4120e1[_0x793c('0x4e')]));_0x1849f0[_0x793c('0x58')][_0x793c('0xca')]=_0x431a6d['id'];if(_0x40e124[_0x793c('0x4d')]['filter']){_0x1849f0[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x1849f0['where'],{'$or':_[_0x793c('0x3e')](_0x1849f0[_0x793c('0x4f')],function(_0x2bb098){var _0x582d4d={};_0x582d4d[_0x2bb098]={'$like':'%'+_0x40e124['query'][_0x793c('0x5a')]+'%'};return _0x582d4d;})});}_0x1849f0=_['merge']({},_0x1849f0,_0x40e124[_0x793c('0x60')]);return db[_0x793c('0xd1')][_0x793c('0x2e')]({'where':_0x1849f0[_0x793c('0x58')]})[_0x793c('0x1f')](function(_0x357f2f){_0x2b7968[_0x793c('0x2e')]=_0x357f2f;if(_0x40e124[_0x793c('0x4d')]['includeAll']){_0x1849f0[_0x793c('0x62')]=[{'all':!![]}];}return db['MailInteraction'][_0x793c('0x63')](_0x1849f0);})[_0x793c('0x1f')](function(_0x1b09e5){_0x2b7968[_0x793c('0x64')]=_0x1b09e5;return _0x2b7968;});}})[_0x793c('0x1f')](respondWithFilteredResult(_0x3e747c,_0x1849f0))['catch'](handleError(_0x3e747c,null));};exports['getSmsInteractions']=function(_0x5b105b,_0x2a297e,_0x328ad0){var _0x4c5b93={};var _0x28f9a7={};var _0x1a0ad2;var _0x3c26aa;return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0x5b105b[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x2a297e,null))['then'](function(_0x3b5324){if(_0x3b5324){_0x1a0ad2=_0x3b5324;_0x28f9a7[_0x793c('0x51')]=_[_0x793c('0x4c')](db['SmsInteraction'][_0x793c('0x46')]);_0x28f9a7['query']=_[_0x793c('0x4c')](_0x5b105b['query']);_0x28f9a7[_0x793c('0x4e')]=_['intersection'](_0x28f9a7[_0x793c('0x51')],_0x28f9a7[_0x793c('0x4d')]);_0x4c5b93[_0x793c('0x4f')]=_['intersection'](_0x28f9a7[_0x793c('0x51')],qs[_0x793c('0x52')](_0x5b105b[_0x793c('0x4d')][_0x793c('0x52')]));_0x4c5b93[_0x793c('0x4f')]=_0x4c5b93[_0x793c('0x4f')][_0x793c('0x53')]?_0x4c5b93[_0x793c('0x4f')]:_0x28f9a7['model'];_0x4c5b93[_0x793c('0x56')]=qs[_0x793c('0x57')](_0x5b105b[_0x793c('0x4d')][_0x793c('0x57')]);_0x4c5b93['where']=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x5b105b['query'],_0x28f9a7[_0x793c('0x4e')]));if(_0x5b105b[_0x793c('0x4d')]['filter']){_0x4c5b93['where']=_['merge'](_0x4c5b93['where'],{'$or':_[_0x793c('0x3e')](_0x4c5b93['attributes'],function(_0x6e5433){var _0x23a545={};_0x23a545[_0x6e5433]={'$like':'%'+_0x5b105b[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x23a545;})});}_0x4c5b93=_[_0x793c('0x5b')]({},_0x4c5b93,_0x5b105b[_0x793c('0x60')]);return _0x1a0ad2['getSmsInteractions'](_0x4c5b93);}})[_0x793c('0x1f')](function(_0x40ceb1){if(_0x40ceb1){_0x3c26aa=_0x40ceb1[_0x793c('0x53')];if(!_0x5b105b['query'][_0x793c('0x54')](_0x793c('0x55'))){_0x4c5b93['limit']=qs[_0x793c('0x30')](_0x5b105b[_0x793c('0x4d')][_0x793c('0x30')]);_0x4c5b93[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x5b105b[_0x793c('0x4d')]['offset']);}return _0x1a0ad2[_0x793c('0xd2')](_0x4c5b93);}})[_0x793c('0x1f')](function(_0xe1a140){if(_0xe1a140){return _0xe1a140?{'count':_0x3c26aa,'rows':_0xe1a140}:null;}})[_0x793c('0x1f')](respondWithResult(_0x2a297e,null))[_0x793c('0x2a')](handleError(_0x2a297e,null));};exports['getFaxInteractions']=function(_0x453265,_0x4a5356,_0x6a169b){var _0x56ce5c={};var _0x110135={};var _0x56c184;var _0x5ae1a5;return db['User'][_0x793c('0x94')]({'where':{'id':_0x453265['params']['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x4a5356,null))['then'](function(_0x120952){if(_0x120952){_0x56c184=_0x120952;_0x110135['model']=_[_0x793c('0x4c')](db[_0x793c('0xd3')]['rawAttributes']);_0x110135['query']=_[_0x793c('0x4c')](_0x453265['query']);_0x110135[_0x793c('0x4e')]=_['intersection'](_0x110135[_0x793c('0x51')],_0x110135[_0x793c('0x4d')]);_0x56ce5c['attributes']=_[_0x793c('0x50')](_0x110135[_0x793c('0x51')],qs[_0x793c('0x52')](_0x453265[_0x793c('0x4d')][_0x793c('0x52')]));_0x56ce5c[_0x793c('0x4f')]=_0x56ce5c[_0x793c('0x4f')][_0x793c('0x53')]?_0x56ce5c[_0x793c('0x4f')]:_0x110135['model'];_0x56ce5c[_0x793c('0x56')]=qs[_0x793c('0x57')](_0x453265['query']['sort']);_0x56ce5c[_0x793c('0x58')]=qs['filters'](_[_0x793c('0x59')](_0x453265['query'],_0x110135['filters']));if(_0x453265['query'][_0x793c('0x5a')]){_0x56ce5c[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x56ce5c[_0x793c('0x58')],{'$or':_['map'](_0x56ce5c[_0x793c('0x4f')],function(_0x5dd3d2){var _0x38c41d={};_0x38c41d[_0x5dd3d2]={'$like':'%'+_0x453265[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x38c41d;})});}_0x56ce5c=_['merge']({},_0x56ce5c,_0x453265['options']);return _0x56c184[_0x793c('0xd4')](_0x56ce5c);}})['then'](function(_0x4266aa){if(_0x4266aa){_0x5ae1a5=_0x4266aa[_0x793c('0x53')];if(!_0x453265['query'][_0x793c('0x54')](_0x793c('0x55'))){_0x56ce5c[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x453265[_0x793c('0x4d')]['limit']);_0x56ce5c[_0x793c('0x2f')]=qs['offset'](_0x453265[_0x793c('0x4d')]['offset']);}return _0x56c184[_0x793c('0xd4')](_0x56ce5c);}})[_0x793c('0x1f')](function(_0x234ad1){if(_0x234ad1){return _0x234ad1?{'count':_0x5ae1a5,'rows':_0x234ad1}:null;}})[_0x793c('0x1f')](respondWithResult(_0x4a5356,null))['catch'](handleError(_0x4a5356,null));};exports[_0x793c('0xd5')]=function(_0x208469,_0x520a17,_0x23a400){var _0x3ff10b={};var _0x555540={};var _0x188c39;var _0x3b1a3a;return db['User'][_0x793c('0x94')]({'where':{'id':_0x208469[_0x793c('0x65')]['id']}})['then'](handleEntityNotFound(_0x520a17,null))['then'](function(_0x5e1b23){if(_0x5e1b23){_0x188c39=_0x5e1b23;_0x555540[_0x793c('0x51')]=_[_0x793c('0x4c')](db[_0x793c('0xd6')][_0x793c('0x46')]);_0x555540[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x208469[_0x793c('0x4d')]);_0x555540['filters']=_[_0x793c('0x50')](_0x555540[_0x793c('0x51')],_0x555540[_0x793c('0x4d')]);_0x3ff10b[_0x793c('0x4f')]=_['intersection'](_0x555540[_0x793c('0x51')],qs[_0x793c('0x52')](_0x208469[_0x793c('0x4d')][_0x793c('0x52')]));_0x3ff10b['attributes']=_0x3ff10b[_0x793c('0x4f')][_0x793c('0x53')]?_0x3ff10b[_0x793c('0x4f')]:_0x555540[_0x793c('0x51')];_0x3ff10b[_0x793c('0x56')]=qs[_0x793c('0x57')](_0x208469[_0x793c('0x4d')][_0x793c('0x57')]);_0x3ff10b[_0x793c('0x58')]=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x208469['query'],_0x555540['filters']));if(_0x208469[_0x793c('0x4d')][_0x793c('0x5a')]){_0x3ff10b[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x3ff10b['where'],{'$or':_[_0x793c('0x3e')](_0x3ff10b['attributes'],function(_0x1242e5){var _0x216c97={};_0x216c97[_0x1242e5]={'$like':'%'+_0x208469[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x216c97;})});}_0x3ff10b=_['merge']({},_0x3ff10b,_0x208469['options']);return _0x188c39[_0x793c('0xd5')](_0x3ff10b);}})['then'](function(_0x330c65){if(_0x330c65){_0x3b1a3a=_0x330c65['length'];if(!_0x208469[_0x793c('0x4d')][_0x793c('0x54')](_0x793c('0x55'))){_0x3ff10b[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x208469[_0x793c('0x4d')][_0x793c('0x30')]);_0x3ff10b[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x208469[_0x793c('0x4d')][_0x793c('0x2f')]);}return _0x188c39[_0x793c('0xd5')](_0x3ff10b);}})['then'](function(_0x254987){if(_0x254987){return _0x254987?{'count':_0x3b1a3a,'rows':_0x254987}:null;}})[_0x793c('0x1f')](respondWithResult(_0x520a17,null))[_0x793c('0x2a')](handleError(_0x520a17,null));};exports[_0x793c('0xd7')]=function(_0x4ba203,_0x4cc09a,_0x4fe066){var _0x1672e3;var _0x9dac09;var _0x40e1ac;var _0x49fd85=!_[_0x793c('0x71')](_0x4ba203[_0x793c('0x65')]['id'])?_0x4ba203[_0x793c('0x65')]['id']:!_['isNil'](_0x4ba203['user']['id'])?_0x4ba203[_0x793c('0x39')]['id']:null;return db['User'][_0x793c('0x40')]({'where':{'id':_0x49fd85,'role':{'$or':[_0x793c('0x6e'),'user',_0x793c('0x3a')]}},'attributes':['id',_0x793c('0x42'),'phone',_0x793c('0xd8'),'role','internal',_0x793c('0xa0')]})[_0x793c('0x1f')](function(_0x17cc8c){if(_0x17cc8c){if(_0x17cc8c[_0x793c('0x41')]===_0x793c('0x3a')){_0x1672e3=_0x17cc8c;if(_0x4ba203[_0x793c('0x68')][_0x793c('0xa2')]){_0x40e1ac=util[_0x793c('0x73')](_0x793c('0xd9'),_0x1672e3[_0x4ba203[_0x793c('0x68')][_0x793c('0xa2')]]);}else if(_0x4ba203['body'][_0x793c('0xda')]){_0x40e1ac=util['format'](_0x793c('0xad'),_0x4ba203[_0x793c('0x68')]['intrf']);}else{_0x40e1ac=util[_0x793c('0x73')](_0x793c('0xad'),_0x1672e3['name']);}socket['to'](util[_0x793c('0x73')](_0x793c('0xdb'),_0x1672e3[_0x793c('0x42')]))[_0x793c('0xa9')](_0x793c('0xdc'),{'ip':_0x4ba203[_0x793c('0xdd')][_0x793c('0xde')]||_0x4ba203[_0x793c('0xdf')][_0x793c('0xe0')]||_0x4ba203[_0x793c('0xe1')]['remoteAddress']||_0x4ba203[_0x793c('0xdf')][_0x793c('0xe1')][_0x793c('0xe0')]});return db[_0x793c('0xaf')]['destroy']({'where':{'membername':_0x1672e3['name']},'individualHooks':!![]});}}else{throw new db[(_0x793c('0x1c'))][(_0x793c('0x97'))](_0x793c('0xe2'));}})[_0x793c('0x1f')](function(){if(_0x1672e3){return _0x1672e3[_0x793c('0xe3')]({'raw':!![]});}})[_0x793c('0x1f')](function(_0x1e6c2a){if(_0x1672e3){var _0x4a574c=[];if(_0x1e6c2a){_0x9dac09=_0x1e6c2a;if(_0x9dac09[_0x793c('0x53')]){for(var _0x25eff0=0x0;_0x25eff0<_0x9dac09['length'];_0x25eff0++){_0x4a574c['push']({'membername':_0x1672e3['name'],'UserId':_0x1672e3['id'],'queue_name':_0x9dac09[_0x25eff0]['name'],'VoiceQueueId':_0x9dac09[_0x25eff0]['id'],'interface':_0x40e1ac,'paused':_0x1672e3['loginInPause']||![],'penalty':_0x9dac09[_0x25eff0][_0x793c('0xe4')]||0x0});}return BPromise[_0x793c('0xae')](_0x4a574c,function(_0x304615){return db[_0x793c('0xaf')][_0x793c('0xe5')](_0x304615);});}}}})['then'](function(){if(_0x1672e3){return db['MemberReport'][_0x793c('0x63')]({'where':{'membername':_0x1672e3[_0x793c('0x42')],'exitAt':null}});}})[_0x793c('0x1f')](function(_0x395512){if(_0x1672e3){var _0x2c7d3c=[];_0x395512[_0x793c('0xe6')](function(_0x4fc8a7){_0x2c7d3c[_0x793c('0xac')](_0x4fc8a7[_0x793c('0x37')]({'exitAt':moment()['format'](_0x793c('0xe7'))}));});return BPromise[_0x793c('0xe8')](_0x2c7d3c);}})[_0x793c('0x1f')](function(){if(_0x1672e3){var _0x59ad2b=[];var _0x62fa8e=[];var _0x46489c=utils[_0x793c('0xe9')]();var _0x1bced7={'membername':_0x1672e3['name'],'interface':_0x40e1ac,'enterAt':moment()[_0x793c('0x73')](_0x793c('0xe7')),'role':_0x1672e3[_0x793c('0x41')],'internal':_0x1672e3['internal']};_0x46489c[_0x793c('0xe6')](function(_0x1add02){_0x59ad2b[_0x793c('0xac')](_['merge']({'channel':_0x1add02,'type':_0x793c('0xea'),'data1':_0x4ba203[_0x793c('0x68')]['device'],'data2':_0x40e1ac},_0x1bced7));if(_0x1672e3['loginInPause']){_0x62fa8e[_0x793c('0xac')](_[_0x793c('0x5b')]({'channel':_0x1add02,'type':_0x793c('0xeb'),'data1':_0x793c('0xec')},_0x1bced7));}});return db[_0x793c('0xed')][_0x793c('0x67')](_0x59ad2b[_0x793c('0xee')](_0x62fa8e),{'individualHooks':!![]});}})[_0x793c('0x1f')](function(){if(_0x1672e3){return _0x1672e3[_0x793c('0x37')]({'online':!![],'lastLoginAt':moment()[_0x793c('0x73')](_0x793c('0xe7')),'voicePause':_0x1672e3[_0x793c('0xa0')]||![],'mailPause':_0x1672e3[_0x793c('0xa0')]||![],'chatPause':_0x1672e3[_0x793c('0xa0')]||![],'faxPause':_0x1672e3[_0x793c('0xa0')]||![],'smsPause':_0x1672e3[_0x793c('0xa0')]||![],'openchannelPause':_0x1672e3[_0x793c('0xa0')]||![],'whatsappPause':_0x1672e3[_0x793c('0xa0')]||![],'pauseType':_0x1672e3['loginInPause']?_0x793c('0xec'):null,'interface':_0x40e1ac,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x793c('0x1f')](function(_0x536b20){if(_0x4ba203[_0x793c('0xef')]){return _0x4fe066();}else{return BPromise['resolve'](_0x536b20)['then'](respondWithResult(_0x4cc09a,null));}})['catch'](handleError(_0x4cc09a,null));};exports[_0x793c('0xf0')]=function(_0x31e5ab,_0x25fd3a,_0x19a22e){var _0x2642e0;return db['User'][_0x793c('0x40')]({'where':{'id':_0x31e5ab[_0x793c('0x65')]['id'],'role':_0x793c('0x3a')},'attributes':['id',_0x793c('0x42'),_0x793c('0x41')]})[_0x793c('0x1f')](handleEntityNotFound(_0x25fd3a,null))[_0x793c('0x1f')](function(_0x725c23){if(_0x725c23){_0x2642e0=_0x725c23;return db[_0x793c('0xaf')]['destroy']({'where':{'membername':_0x2642e0[_0x793c('0x42')]},'individualHooks':!![]});}})[_0x793c('0x1f')](function(){return db[_0x793c('0xed')][_0x793c('0x63')]({'where':{'membername':_0x2642e0['name'],'exitAt':null}});})[_0x793c('0x1f')](function(_0x480be5){var _0x515e99=[];_0x480be5[_0x793c('0xe6')](function(_0x1793ba){_0x515e99['push'](_0x1793ba[_0x793c('0x37')]({'exitAt':moment()[_0x793c('0x73')](_0x793c('0xe7'))}));});return BPromise['all'](_0x515e99);})['then'](function(){return _0x2642e0['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x793c('0x1f')](respondWithResult(_0x25fd3a,null))['catch'](handleError(_0x25fd3a,null));};exports[_0x793c('0xf1')]=function(_0x5c4292,_0x5127fc,_0x183f23){var _0xd4c366;return db[_0x793c('0xaf')][_0x793c('0x37')]({'paused':0x1},{'where':{'UserId':_0x5c4292[_0x793c('0x65')]['id']},'individualHooks':!![]})[_0x793c('0x1f')](function(){return db[_0x793c('0x45')][_0x793c('0x40')]({'where':{'id':_0x5c4292[_0x793c('0x65')]['id'],'role':_0x793c('0x3a')},'attributes':['id',_0x793c('0x42'),_0x793c('0x41'),_0x793c('0x7b'),_0x793c('0xa2')]});})['then'](handleEntityNotFound(_0x5127fc,null))[_0x793c('0x1f')](function(_0x59ba5c){if(_0x59ba5c){_0xd4c366=_0x59ba5c;return respondWithRpcPromise(_0x793c('0xf2'),'pause',{'id':_0xd4c366['id'],'name':_0xd4c366[_0x793c('0x42')],'pause':!![]});}})['then'](function(){if(_0xd4c366){return db['MemberReport']['findAll']({'where':{'membername':_0xd4c366[_0x793c('0x42')],'type':'PAUSE','exitAt':null}});}})[_0x793c('0x1f')](function(_0x1cf43b){if(_0x1cf43b['length']){var _0x50bc31=moment()[_0x793c('0x73')](_0x793c('0xe7'));for(var _0x105113=0x0,_0x4d36ba=_0x1cf43b['length'];_0x105113<_0x4d36ba;_0x105113++){_0x1cf43b[_0x105113]['updateAttributes']({'exitAt':_0x50bc31});}}})[_0x793c('0x1f')](function(){var _0x339164=[];var _0x11cc7f=utils[_0x793c('0xe9')]();_0x11cc7f['forEach'](function(_0x17fa1d){_0x339164[_0x793c('0xac')]({'channel':_0x17fa1d,'membername':_0xd4c366[_0x793c('0x42')],'interface':_[_0x793c('0x71')](_0xd4c366[_0x793c('0xa2')])?util[_0x793c('0x73')](_0x793c('0xad'),_0xd4c366['name']):_0xd4c366[_0x793c('0xa2')],'type':_0x793c('0xeb'),'enterAt':moment()[_0x793c('0x73')](_0x793c('0xe7')),'data1':_0x5c4292[_0x793c('0x68')][_0x793c('0x48')]||_0x793c('0xf3'),'role':_0xd4c366[_0x793c('0x41')],'internal':_0xd4c366[_0x793c('0x7b')]});});return db[_0x793c('0xed')][_0x793c('0x67')](_0x339164,{'individualHooks':!![]});})['then'](function(){return _0xd4c366[_0x793c('0x37')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5c4292[_0x793c('0x68')][_0x793c('0x48')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x793c('0x73')](_0x793c('0xe7'))});})['then'](respondWithResult(_0x5127fc,null))[_0x793c('0x2a')](handleError(_0x5127fc,null));};exports[_0x793c('0xf4')]=function(_0x2fb9fc,_0x94c652,_0x47ec45){var _0x2408e8;return db['User'][_0x793c('0x40')]({'where':{'id':_0x2fb9fc[_0x793c('0x65')]['id']},'attributes':['id',_0x793c('0x42'),_0x793c('0x41'),_0x793c('0xa1'),_0x793c('0xf5'),_0x793c('0xf6'),'faxPause',_0x793c('0xf7'),_0x793c('0xf8'),_0x793c('0xf9'),_0x793c('0xfa'),'lastPauseAt']})['then'](handleEntityNotFound(_0x94c652,null))[_0x793c('0x1f')](function(_0x3fa41f){if(_0x3fa41f){_0x2408e8=_0x3fa41f;if(_0x2fb9fc[_0x793c('0x68')][_0x793c('0x9e')]&&!utils[_0x793c('0xa3')](_0x2fb9fc['body']['channel'])){throw new db['Sequelize'][(_0x793c('0x97'))](_0x793c('0xb1'));}switch(_0x2fb9fc[_0x793c('0x68')][_0x793c('0x9e')]){case _0x793c('0xab'):return respondWithRpcPromise(_0x793c('0xf2'),'unpause',{'id':_0x2408e8['id'],'name':_0x2408e8['name'],'pause':![]})[_0x793c('0x1f')](function(){return db[_0x793c('0xaf')]['update']({'paused':0x0},{'where':{'UserId':_0x2408e8['id']},'individualHooks':!![]});})[_0x793c('0x1f')](function(){return db['MemberReport'][_0x793c('0x40')]({'where':{'channel':_0x2fb9fc[_0x793c('0x68')]['channel'],'membername':_0x2408e8[_0x793c('0x42')],'type':_0x793c('0xeb'),'exitAt':null}});})['then'](function(_0x12d764){if(_0x12d764){return _0x12d764[_0x793c('0x37')]({'exitAt':moment()['format'](_0x793c('0xe7')),'data2':_0x793c('0xfb')},{'individualHooks':!![]});}return null;})[_0x793c('0x1f')](function(){return _0x2408e8['update']({'voicePause':![]});});case _0x793c('0xfc'):case _0x793c('0xfd'):case _0x793c('0xfe'):case _0x793c('0xff'):case _0x793c('0x100'):case _0x793c('0x101'):return db[_0x793c('0xed')]['find']({'where':{'channel':_0x2fb9fc[_0x793c('0x68')][_0x793c('0x9e')],'membername':_0x2408e8[_0x793c('0x42')],'type':_0x793c('0xeb'),'exitAt':null}})[_0x793c('0x1f')](function(_0x506b1f){if(_0x506b1f){return _0x506b1f[_0x793c('0x37')]({'exitAt':moment()[_0x793c('0x73')](_0x793c('0xe7')),'data2':_0x793c('0xfb')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x164857={};_[_0x793c('0x31')](_0x164857,util[_0x793c('0x73')](_0x793c('0x102'),_0x2fb9fc[_0x793c('0x68')][_0x793c('0x9e')],_0x793c('0x103')),![]);return _0x2408e8[_0x793c('0x37')](_0x164857);});default:return respondWithRpcPromise('QueuePause',_0x793c('0xf4'),{'id':_0x2408e8['id'],'name':_0x2408e8[_0x793c('0x42')],'pause':![]})[_0x793c('0x1f')](function(){return db['UserVoiceQueueRt'][_0x793c('0x37')]({'paused':0x0},{'where':{'UserId':_0x2408e8['id']}});})['then'](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x2408e8[_0x793c('0x42')],'type':'PAUSE','exitAt':null}});})[_0x793c('0x1f')](function(_0x67d066){var _0x331eb8=[];_0x67d066[_0x793c('0xe6')](function(_0x43a7){_0x331eb8[_0x793c('0xac')](_0x43a7[_0x793c('0x37')]({'exitAt':moment()[_0x793c('0x73')](_0x793c('0xe7')),'data2':_0x793c('0xfb')}));});return BPromise[_0x793c('0xe8')](_0x331eb8);})[_0x793c('0x1f')](function(){return _0x2408e8[_0x793c('0x37')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x793c('0x1f')](respondWithResult(_0x94c652,null))[_0x793c('0x2a')](handleError(_0x94c652,null));};exports['getTeams']=function(_0x5ae21a,_0x440831,_0x51acdc){var _0xb36e27={};var _0x34e76c={};var _0x41c8e0;var _0x1c4e86;return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0x5ae21a[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x440831,null))[_0x793c('0x1f')](function(_0x17afc6){if(_0x17afc6){_0x41c8e0=_0x17afc6;_0x34e76c[_0x793c('0x51')]=_[_0x793c('0x4c')](db[_0x793c('0x104')][_0x793c('0x46')]);_0x34e76c[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0x5ae21a[_0x793c('0x4d')]);_0x34e76c[_0x793c('0x4e')]=_['intersection'](_0x34e76c[_0x793c('0x51')],_0x34e76c[_0x793c('0x4d')]);_0xb36e27[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x34e76c[_0x793c('0x51')],qs[_0x793c('0x52')](_0x5ae21a[_0x793c('0x4d')][_0x793c('0x52')]));_0xb36e27['attributes']=_0xb36e27['attributes'][_0x793c('0x53')]?_0xb36e27['attributes']:_0x34e76c[_0x793c('0x51')];_0xb36e27[_0x793c('0x56')]=qs['sort'](_0x5ae21a['query'][_0x793c('0x57')]);_0xb36e27['where']=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0x5ae21a[_0x793c('0x4d')],_0x34e76c['filters']));if(_0x5ae21a[_0x793c('0x4d')][_0x793c('0x5a')]){_0xb36e27[_0x793c('0x58')]=_[_0x793c('0x5b')](_0xb36e27['where'],{'$or':_[_0x793c('0x3e')](_0xb36e27[_0x793c('0x4f')],function(_0x3fbcac){var _0x2f6a95={};_0x2f6a95[_0x3fbcac]={'$like':'%'+_0x5ae21a[_0x793c('0x4d')]['filter']+'%'};return _0x2f6a95;})});}_0xb36e27=_['merge']({},_0xb36e27,_0x5ae21a[_0x793c('0x60')]);return _0x41c8e0[_0x793c('0x105')](_0xb36e27);}})[_0x793c('0x1f')](function(_0x3589b0){if(_0x3589b0){_0x1c4e86=_0x3589b0[_0x793c('0x53')];if(!_0x5ae21a[_0x793c('0x4d')][_0x793c('0x54')]('nolimit')){_0xb36e27['limit']=qs['limit'](_0x5ae21a['query'][_0x793c('0x30')]);_0xb36e27[_0x793c('0x2f')]=qs[_0x793c('0x2f')](_0x5ae21a[_0x793c('0x4d')]['offset']);}return _0x41c8e0[_0x793c('0x105')](_0xb36e27);}})[_0x793c('0x1f')](function(_0x5c350d){if(_0x5c350d){return _0x5c350d?{'count':_0x1c4e86,'rows':_0x5c350d}:null;}})[_0x793c('0x1f')](respondWithResult(_0x440831,null))[_0x793c('0x2a')](handleError(_0x440831,null));};exports[_0x793c('0x106')]=function(_0x137017,_0x13cd61){return db[_0x793c('0x45')][_0x793c('0x40')]({'where':{'id':_0x137017[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x13cd61,null))['then'](function(_0xe99367){if(_0xe99367){var _0x13c9a4=_0xe99367[_0x793c('0x38')]({'plain':!![]});return _0xe99367[_0x793c('0x106')](_0x137017[_0x793c('0x68')][_0x793c('0x6b')],_[_0x793c('0x6c')](_0x137017['body'],[_0x793c('0x6b'),'id'])||{})[_0x793c('0x1f')](function(){for(var _0x567aaf=0x0;_0x567aaf<_0x137017[_0x793c('0x68')][_0x793c('0x6b')][_0x793c('0x53')];_0x567aaf++){var _0x3cce34=[];db[_0x793c('0x104')]['findOne']({'where':{'id':_0x137017[_0x793c('0x68')][_0x793c('0x6b')][_0x567aaf]}})[_0x793c('0x1f')](function(_0x3b6784){_0x3cce34['push'](_0x3b6784[_0x793c('0xe3')]()[_0x793c('0x1f')](function(_0x370e42){for(var _0x16f27a=0x0;_0x16f27a<_0x370e42[_0x793c('0x53')];_0x16f27a++){_0x370e42[_0x16f27a]['setDataValue'](_0x793c('0x9e'),_0x793c('0x107'));}return _0x370e42;}));_0x3cce34[_0x793c('0xac')](_0x3b6784[_0x793c('0x108')]()[_0x793c('0x1f')](function(_0x4425ad){for(var _0x49177e=0x0;_0x49177e<_0x4425ad[_0x793c('0x53')];_0x49177e++){_0x4425ad[_0x49177e][_0x793c('0x109')]('channel',_0x793c('0x10a'));}return _0x4425ad;}));_0x3cce34[_0x793c('0xac')](_0x3b6784['getMailQueues']()[_0x793c('0x1f')](function(_0x25f914){for(var _0x41ab6d=0x0;_0x41ab6d<_0x25f914[_0x793c('0x53')];_0x41ab6d++){_0x25f914[_0x41ab6d][_0x793c('0x109')](_0x793c('0x9e'),_0x793c('0x10b'));}return _0x25f914;}));_0x3cce34[_0x793c('0xac')](_0x3b6784['getSmsQueues']()[_0x793c('0x1f')](function(_0x2b023c){for(var _0x163cd3=0x0;_0x163cd3<_0x2b023c['length'];_0x163cd3++){_0x2b023c[_0x163cd3][_0x793c('0x109')]('channel',_0x793c('0x10c'));}return _0x2b023c;}));_0x3cce34[_0x793c('0xac')](_0x3b6784[_0x793c('0x10d')]()[_0x793c('0x1f')](function(_0x3ce129){for(var _0x4c0fc0=0x0;_0x4c0fc0<_0x3ce129[_0x793c('0x53')];_0x4c0fc0++){_0x3ce129[_0x4c0fc0][_0x793c('0x109')](_0x793c('0x9e'),_0x793c('0x10e'));}return _0x3ce129;}));_0x3cce34[_0x793c('0xac')](_0x3b6784[_0x793c('0x10f')]()[_0x793c('0x1f')](function(_0x57485d){for(var _0x1fbe17=0x0;_0x1fbe17<_0x57485d[_0x793c('0x53')];_0x1fbe17++){_0x57485d[_0x1fbe17][_0x793c('0x109')](_0x793c('0x9e'),'Fax');}return _0x57485d;}));_0x3cce34[_0x793c('0xac')](_0x3b6784[_0x793c('0x110')]()[_0x793c('0x1f')](function(_0x15aa56){for(var _0x3f7443=0x0;_0x3f7443<_0x15aa56[_0x793c('0x53')];_0x3f7443++){_0x15aa56[_0x3f7443][_0x793c('0x109')](_0x793c('0x9e'),'Openchannel');}return _0x15aa56;}));return BPromise[_0x793c('0xe8')](_0x3cce34);})[_0x793c('0x1f')](function(_0x2b5c8b){var _0x296f92=_['flatten'](_0x2b5c8b);_0x3cce34=[];return db[_0x793c('0x5d')][_0x793c('0x111')](function(_0x9c47f9){for(var _0x39cc3c=0x0;_0x39cc3c<_0x296f92['length'];_0x39cc3c++){_0x3cce34[_0x793c('0xac')](_0x296f92[_0x39cc3c][_0x793c('0x112')](_0x13c9a4['id']),{'transaction':_0x9c47f9});}return BPromise[_0x793c('0xe8')](_0x3cce34)[_0x793c('0x1f')](function(){if(_0x13c9a4[_0x793c('0x9f')]){return BPromise[_0x793c('0xae')](_['filter'](_0x296f92,function(_0x581ed0){return _0x581ed0[_0x793c('0x113')]('channel')==='Voice';}),function(_0x7b3cb4){return db[_0x793c('0xaf')]['upsert']({'membername':_0x13c9a4[_0x793c('0x42')],'UserId':_0x13c9a4['id'],'queue_name':_0x7b3cb4['name'],'VoiceQueueId':_0x7b3cb4['id'],'interface':_['isNil'](_0x13c9a4['interface'])?util[_0x793c('0x73')](_0x793c('0xad'),_0x13c9a4[_0x793c('0x42')]):_0x13c9a4[_0x793c('0xa2')],'paused':_0x13c9a4['voicePause']||![],'penalty':_0x13c9a4[_0x793c('0x114')]},{'transaction':_0x9c47f9});});}else{return;}})[_0x793c('0x1f')](function(){for(var _0x2eb01b=0x0;_0x2eb01b<_0x296f92[_0x793c('0x53')];_0x2eb01b++){var _0x5ac02d=_0x296f92[_0x2eb01b][_0x793c('0x113')](_0x793c('0x9e'));var _0x46fca8=_0x5ac02d+_0x793c('0xa8');socket[_0x793c('0xa9')](_0x793c('0x39')+_0x5ac02d+_0x793c('0xaa'),{'UserId':_0x13c9a4['id'],['queueField']:_0x296f92[_0x2eb01b]['id']});}});});});}});}})[_0x793c('0x1f')](respondWithStatusCode(_0x13cd61,null))[_0x793c('0x2a')](handleError(_0x13cd61,null));};exports[_0x793c('0x115')]=function(_0x534685,_0x33b67c){return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0x534685[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x33b67c,null))[_0x793c('0x1f')](function(_0x462bac){if(_0x462bac){var _0xbae0e1=_0x462bac[_0x793c('0x38')]({'plain':!![]});var _0x36082a=_0x534685[_0x793c('0x4d')][_0x793c('0x6b')];return _0x462bac[_0x793c('0x115')](_0x36082a)[_0x793c('0x1f')](function(){for(var _0xb0747b=0x0;_0xb0747b<_0x36082a[_0x793c('0x53')];_0xb0747b++){var _0x4a6a2e=[];db[_0x793c('0x104')][_0x793c('0x94')]({'where':{'id':_0x36082a[_0xb0747b]}})['then'](function(_0x28c701){_0x4a6a2e['push'](_0x28c701[_0x793c('0xe3')]()['then'](function(_0x57cb31){for(var _0x3de79f=0x0;_0x3de79f<_0x57cb31['length'];_0x3de79f++){_0x57cb31[_0x3de79f][_0x793c('0x109')](_0x793c('0x9e'),_0x793c('0x107'));}return _0x57cb31;}));_0x4a6a2e['push'](_0x28c701[_0x793c('0x108')]()[_0x793c('0x1f')](function(_0x1ce689){for(var _0x302764=0x0;_0x302764<_0x1ce689['length'];_0x302764++){_0x1ce689[_0x302764][_0x793c('0x109')](_0x793c('0x9e'),'Chat');}return _0x1ce689;}));_0x4a6a2e[_0x793c('0xac')](_0x28c701[_0x793c('0x116')]()[_0x793c('0x1f')](function(_0x25b749){for(var _0x2168fd=0x0;_0x2168fd<_0x25b749['length'];_0x2168fd++){_0x25b749[_0x2168fd][_0x793c('0x109')](_0x793c('0x9e'),_0x793c('0x10b'));}return _0x25b749;}));_0x4a6a2e[_0x793c('0xac')](_0x28c701['getSmsQueues']()[_0x793c('0x1f')](function(_0x3132a7){for(var _0x37c1e6=0x0;_0x37c1e6<_0x3132a7[_0x793c('0x53')];_0x37c1e6++){_0x3132a7[_0x37c1e6][_0x793c('0x109')](_0x793c('0x9e'),_0x793c('0x10c'));}return _0x3132a7;}));_0x4a6a2e[_0x793c('0xac')](_0x28c701[_0x793c('0x10d')]()[_0x793c('0x1f')](function(_0x143d18){for(var _0x44218f=0x0;_0x44218f<_0x143d18[_0x793c('0x53')];_0x44218f++){_0x143d18[_0x44218f]['setDataValue'](_0x793c('0x9e'),_0x793c('0x10e'));}return _0x143d18;}));_0x4a6a2e[_0x793c('0xac')](_0x28c701[_0x793c('0x10f')]()[_0x793c('0x1f')](function(_0x2fb4c8){for(var _0x53589c=0x0;_0x53589c<_0x2fb4c8['length'];_0x53589c++){_0x2fb4c8[_0x53589c][_0x793c('0x109')](_0x793c('0x9e'),'Fax');}return _0x2fb4c8;}));_0x4a6a2e[_0x793c('0xac')](_0x28c701[_0x793c('0x110')]()[_0x793c('0x1f')](function(_0x29b8f3){for(var _0x398631=0x0;_0x398631<_0x29b8f3['length'];_0x398631++){_0x29b8f3[_0x398631]['setDataValue'](_0x793c('0x9e'),_0x793c('0x117'));}return _0x29b8f3;}));return BPromise['all'](_0x4a6a2e);})[_0x793c('0x1f')](function(_0x221cb2){var _0x3fcd7e=_[_0x793c('0x118')](_0x221cb2);_0x4a6a2e=[];return db['sequelize']['transaction'](function(_0x5472a8){for(var _0x29e42b=0x0;_0x29e42b<_0x3fcd7e['length'];_0x29e42b++){_0x4a6a2e[_0x793c('0xac')](_0x3fcd7e[_0x29e42b]['removeAgent'](_0xbae0e1['id']),{'transaction':_0x5472a8});}return BPromise['all'](_0x4a6a2e)[_0x793c('0x1f')](function(){if(_0xbae0e1[_0x793c('0x9f')]){return BPromise[_0x793c('0xae')](_[_0x793c('0x5a')](_0x3fcd7e,function(_0x2d3feb){return _0x2d3feb[_0x793c('0x113')](_0x793c('0x9e'))===_0x793c('0x107');}),function(_0x5c639e){return db[_0x793c('0xaf')][_0x793c('0x43')]({'where':{'VoiceQueueId':_0x5c639e['id'],'UserId':_0xbae0e1['id']},'transaction':_0x5472a8});});}else{return;}})[_0x793c('0x1f')](function(){for(var _0x2eb13d=0x0;_0x2eb13d<_0x3fcd7e[_0x793c('0x53')];_0x2eb13d++){var _0x1eb5b1=_0x3fcd7e[_0x2eb13d][_0x793c('0x113')](_0x793c('0x9e'));var _0x3b8ca0=_0x1eb5b1+_0x793c('0xa8');socket[_0x793c('0xa9')]('user'+_0x1eb5b1+_0x793c('0xb2'),{'UserId':_0xbae0e1['id'],['queueField']:_0x3fcd7e[_0x2eb13d]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x33b67c,null))[_0x793c('0x2a')](handleError(_0x33b67c,null));};exports['getLists']=function(_0x5818e6,_0x213f7f,_0xfb7ca){var _0x1fee36={};var _0x44c71b={};var _0x5ce23d;var _0xb7beeb;return db['User'][_0x793c('0x94')]({'where':{'id':_0x5818e6[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x213f7f,null))[_0x793c('0x1f')](function(_0x48f6fa){if(_0x48f6fa){_0x5ce23d=_0x48f6fa;_0x44c71b[_0x793c('0x51')]=_['keys'](db[_0x793c('0xbf')][_0x793c('0x46')]);_0x44c71b[_0x793c('0x4d')]=_['keys'](_0x5818e6['query']);_0x44c71b['filters']=_[_0x793c('0x50')](_0x44c71b['model'],_0x44c71b['query']);_0x1fee36[_0x793c('0x4f')]=_[_0x793c('0x50')](_0x44c71b[_0x793c('0x51')],qs[_0x793c('0x52')](_0x5818e6[_0x793c('0x4d')]['fields']));_0x1fee36[_0x793c('0x4f')]=_0x1fee36[_0x793c('0x4f')][_0x793c('0x53')]?_0x1fee36[_0x793c('0x4f')]:_0x44c71b['model'];_0x1fee36[_0x793c('0x56')]=qs['sort'](_0x5818e6[_0x793c('0x4d')][_0x793c('0x57')]);_0x1fee36[_0x793c('0x58')]=qs[_0x793c('0x4e')](_['pick'](_0x5818e6[_0x793c('0x4d')],_0x44c71b[_0x793c('0x4e')]));if(_0x5818e6[_0x793c('0x4d')][_0x793c('0x5a')]){_0x1fee36[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x1fee36[_0x793c('0x58')],{'$or':_['map'](_0x1fee36[_0x793c('0x4f')],function(_0x20cd26){var _0x44956d={};_0x44956d[_0x20cd26]={'$like':'%'+_0x5818e6['query'][_0x793c('0x5a')]+'%'};return _0x44956d;})});}_0x1fee36=_[_0x793c('0x5b')]({},_0x1fee36,_0x5818e6['options']);return _0x5ce23d[_0x793c('0x119')](_0x1fee36);}})['then'](function(_0x5396c1){if(_0x5396c1){_0xb7beeb=_0x5396c1[_0x793c('0x53')];if(!_0x5818e6[_0x793c('0x4d')][_0x793c('0x54')](_0x793c('0x55'))){_0x1fee36[_0x793c('0x30')]=qs[_0x793c('0x30')](_0x5818e6[_0x793c('0x4d')][_0x793c('0x30')]);_0x1fee36[_0x793c('0x2f')]=qs['offset'](_0x5818e6[_0x793c('0x4d')]['offset']);}return _0x5ce23d[_0x793c('0x119')](_0x1fee36);}})[_0x793c('0x1f')](function(_0x1093cf){if(_0x1093cf){return _0x1093cf?{'count':_0xb7beeb,'rows':_0x1093cf}:null;}})[_0x793c('0x1f')](respondWithResult(_0x213f7f,null))[_0x793c('0x2a')](handleError(_0x213f7f,null));};exports[_0x793c('0x11a')]=function(_0xb5a87e,_0x58a71a,_0x18a163){var _0x184be1={};var _0x38c37d={};var _0xd432be;var _0x557d84;return db[_0x793c('0x45')][_0x793c('0x94')]({'where':{'id':_0xb5a87e[_0x793c('0x65')]['id']}})[_0x793c('0x1f')](handleEntityNotFound(_0x58a71a,null))[_0x793c('0x1f')](function(_0x182296){if(_0x182296){_0xd432be=_0x182296;_0x38c37d['model']=_[_0x793c('0x4c')](db[_0x793c('0x45')]['rawAttributes']);_0x38c37d[_0x793c('0x4d')]=_[_0x793c('0x4c')](_0xb5a87e[_0x793c('0x4d')]);_0x38c37d[_0x793c('0x4e')]=_['intersection'](_0x38c37d[_0x793c('0x51')],_0x38c37d[_0x793c('0x4d')]);_0x184be1['attributes']=_[_0x793c('0x50')](_0x38c37d[_0x793c('0x51')],qs['fields'](_0xb5a87e[_0x793c('0x4d')]['fields']));_0x184be1[_0x793c('0x4f')]=_0x184be1[_0x793c('0x4f')][_0x793c('0x53')]?_0x184be1['attributes']:_0x38c37d['model'];_0x184be1[_0x793c('0x56')]=qs[_0x793c('0x57')](_0xb5a87e[_0x793c('0x4d')]['sort']);_0x184be1['where']=qs[_0x793c('0x4e')](_[_0x793c('0x59')](_0xb5a87e[_0x793c('0x4d')],_0x38c37d['filters']));if(_0xb5a87e[_0x793c('0x4d')][_0x793c('0x5a')]){_0x184be1[_0x793c('0x58')]=_[_0x793c('0x5b')](_0x184be1['where'],{'$or':_[_0x793c('0x3e')](_0x184be1[_0x793c('0x4f')],function(_0x8178a8){var _0x1a2b3d={};_0x1a2b3d[_0x8178a8]={'$like':'%'+_0xb5a87e[_0x793c('0x4d')][_0x793c('0x5a')]+'%'};return _0x1a2b3d;})});}_0x184be1['model']=db[_0x793c('0x45')];_0x184be1['as']=_0x793c('0x8e');_0x184be1=_[_0x793c('0x5b')]({},_0x184be1,_0xb5a87e[_0x793c('0x60')]);return _0xd432be[_0x793c('0xe3')]({'include':[_0x184be1]});}})[_0x793c('0x1f')](function(_0x3bb8a6){if(_0x3bb8a6){var _0x548f3b={},_0x6e6576=[],_0x594ed5=0x0;for(var _0x18408f=0x0;_0x18408f<_0x3bb8a6[_0x793c('0x53')];_0x18408f+=0x1){for(var _0x49f97a=0x0,_0x50a8c4;_0x49f97a<_0x3bb8a6[_0x18408f][_0x793c('0x8e')][_0x793c('0x53')];_0x49f97a+=0x1){_0x50a8c4=_0x3bb8a6[_0x18408f]['Agents'][_0x49f97a][_0x793c('0x38')]({'plain':!![]});_0x548f3b[_0x50a8c4['id']]=_0x50a8c4;}}_0x548f3b=_['values'](_0x548f3b);for(var _0x655985=qs['offset'](_0xb5a87e[_0x793c('0x4d')][_0x793c('0x2f')]);_0x655985<_0x548f3b['length']&&_0x6e6576[_0x793c('0x53')]=_0x4d4506){_0x4ac80e=_0x4d4506;_0x2acf11=0xc8;}else{_0x2acf11=0xce;}_0x56a4f1[_0x359b('0x2e')](_0x2acf11);return _0x56a4f1[_0x359b('0x34')]('Content-Range',_0x410d33+'-'+_0x4ac80e+'/'+_0x4d4506)['json'](_0x5a4ae5);}return null;};}function patchUpdates(_0x498620){return function(_0x257eb0){try{jsonpatch[_0x359b('0x35')](_0x257eb0,_0x498620,!![]);}catch(_0x35ed2b){return BPromise[_0x359b('0x36')](_0x35ed2b);}return _0x257eb0['save']();};}function saveUpdates(_0x1ba9b0,_0x2ef79b){return function(_0xf0f463){if(_0xf0f463){return _0xf0f463['update'](_0x1ba9b0)[_0x359b('0x22')](function(_0x4b3966){return _0x4b3966;});}return null;};}function removeEntity(_0x3795d1,_0x45c2e2){return function(_0xcee6e9){if(_0xcee6e9){return _0xcee6e9[_0x359b('0x37')]()[_0x359b('0x22')](function(){var _0xc89186=_0xcee6e9[_0x359b('0x38')]({'plain':!![]});var _0x42e666=[{'name':_0x359b('0x39'),'value':_0x359b('0x3a'),'ignore':!![]},{'name':'Agents','value':'agent','ignore':![]},{'name':_0x359b('0x3b'),'value':_0x359b('0x3c'),'ignore':![]}];var _0x3621f3=_(_0x42e666)[_0x359b('0x3d')](_0x359b('0x3e'))[_0x359b('0x3f')](_0x359b('0x40'))[_0x359b('0x40')]();if(_[_0x359b('0x41')](_0x3621f3,_0xc89186[_0x359b('0x42')])){return;}var _0x2e8507=_[_0x359b('0x43')](_0x42e666,[_0x359b('0x40'),_0xc89186['role']])[_0x359b('0x44')];return db[_0x359b('0x45')]['destroy']({'where':{'type':_0x2e8507,'resourceId':_0xc89186['id']}})[_0x359b('0x22')](function(){return _0xcee6e9;});})[_0x359b('0x22')](function(){_0x3795d1[_0x359b('0x2e')](0xcc)[_0x359b('0x2f')]();});}};}function handleEntityNotFound(_0x354a02,_0x467057){return function(_0x5a3e71){if(!_0x5a3e71){_0x354a02['sendStatus'](0x194);}return _0x5a3e71;};}function handleError(_0x39cb39,_0x28ccc4){_0x28ccc4=_0x28ccc4||0x1f4;return function(_0x293972){logger[_0x359b('0x28')](_0x293972[_0x359b('0x46')]);if(_0x293972[_0x359b('0x44')]){delete _0x293972[_0x359b('0x44')];}_0x39cb39[_0x359b('0x2e')](_0x28ccc4)['send'](_0x293972);};}exports[_0x359b('0x47')]=function(_0x40c483,_0xfbf7bf){var _0x4c418c={},_0x1914a3={},_0x741c38={'count':0x0,'rows':[]};var _0x3d1a5d=_['map'](db[_0x359b('0x48')][_0x359b('0x49')],function(_0x2cb296){return{'name':_0x2cb296[_0x359b('0x4a')],'type':_0x2cb296[_0x359b('0x4b')][_0x359b('0x4c')]};});_0x1914a3[_0x359b('0x4d')]=_[_0x359b('0x4e')](_[_0x359b('0x3f')](_0x3d1a5d,'name'),[_0x359b('0x4f'),'salt']);_0x1914a3[_0x359b('0x50')]=_['keys'](_0x40c483[_0x359b('0x50')]);_0x1914a3[_0x359b('0x51')]=_[_0x359b('0x52')](_0x1914a3[_0x359b('0x4d')],_0x1914a3['query']);_0x4c418c[_0x359b('0x53')]=_['intersection'](_0x1914a3['model'],qs[_0x359b('0x54')](_0x40c483[_0x359b('0x50')]['fields']));_0x4c418c[_0x359b('0x53')]=_0x4c418c[_0x359b('0x53')]['length']?_0x4c418c[_0x359b('0x53')]:_0x1914a3['model'];if(!_0x40c483[_0x359b('0x50')][_0x359b('0x55')](_0x359b('0x56'))){_0x4c418c[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x40c483[_0x359b('0x50')][_0x359b('0x33')]);_0x4c418c['offset']=qs['offset'](_0x40c483[_0x359b('0x50')][_0x359b('0x32')]);}_0x4c418c[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x40c483[_0x359b('0x50')]['sort']);_0x4c418c[_0x359b('0x59')]=qs[_0x359b('0x51')](_['pick'](_0x40c483['query'],_0x1914a3[_0x359b('0x51')]),_0x3d1a5d);if(_0x40c483[_0x359b('0x50')]['filter']){_0x4c418c[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x4c418c[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x3d1a5d,function(_0x2be14f){if(_0x2be14f[_0x359b('0x4b')]!=='VIRTUAL'){return db[_0x359b('0x5b')][_0x359b('0x59')](db[_0x359b('0x5b')]['fn']('lower',db['sequelize'][_0x359b('0x5c')](_0x2be14f[_0x359b('0x44')])),{'$like':db[_0x359b('0x5b')]['fn'](_0x359b('0x5d'),'%'+_0x40c483[_0x359b('0x50')][_0x359b('0x3d')]+'%')});}})});}_0x4c418c=_['merge']({},_0x4c418c,_0x40c483[_0x359b('0x5e')]);var _0x286f7d={'where':_0x4c418c[_0x359b('0x59')]};return db['User'][_0x359b('0x31')](_0x286f7d)[_0x359b('0x22')](function(_0x7c48e4){_0x741c38['count']=_0x7c48e4;if(_0x40c483[_0x359b('0x50')][_0x359b('0x5f')]){_0x4c418c[_0x359b('0x60')]=[{'all':!![]}];}return db[_0x359b('0x48')]['findAll'](_0x4c418c);})[_0x359b('0x22')](function(_0x3a73cd){_0x741c38[_0x359b('0x61')]=_0x3a73cd;return _0x741c38;})[_0x359b('0x22')](respondWithFilteredResult(_0xfbf7bf,_0x4c418c))['catch'](handleError(_0xfbf7bf,null));};exports[_0x359b('0x62')]=function(_0x438244,_0x4eef2e){var _0x10dca3={'raw':![],'where':{'id':_0x438244[_0x359b('0x63')]['id']}},_0x1e5b27={};_0x1e5b27[_0x359b('0x4d')]=_[_0x359b('0x4e')](_[_0x359b('0x64')](db[_0x359b('0x48')][_0x359b('0x49')]),['password',_0x359b('0x65')]);_0x1e5b27[_0x359b('0x50')]=_[_0x359b('0x64')](_0x438244['query']);_0x1e5b27[_0x359b('0x51')]=_[_0x359b('0x52')](_0x1e5b27['model'],_0x1e5b27[_0x359b('0x50')]);_0x10dca3['attributes']=_[_0x359b('0x52')](_0x1e5b27[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x438244[_0x359b('0x50')][_0x359b('0x54')]));_0x10dca3[_0x359b('0x53')]=_0x10dca3[_0x359b('0x53')][_0x359b('0x66')]?_0x10dca3[_0x359b('0x53')]:_0x1e5b27[_0x359b('0x4d')];if(_0x438244['query']['includeAll']){_0x10dca3[_0x359b('0x60')]=[{'all':!![]}];}_0x10dca3=_[_0x359b('0x5a')]({},_0x10dca3,_0x438244[_0x359b('0x5e')]);return db['User'][_0x359b('0x43')](_0x10dca3)['then'](handleEntityNotFound(_0x4eef2e,null))[_0x359b('0x22')](respondWithResult(_0x4eef2e,null))['catch'](handleError(_0x4eef2e,null));};exports[_0x359b('0x67')]=function(_0x251b76,_0x540d12){return db[_0x359b('0x48')][_0x359b('0x67')](_0x251b76[_0x359b('0x68')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x540d12,0xc9))[_0x359b('0x2c')](handleError(_0x540d12,null));};exports['update']=function(_0x358412,_0x48ccb5){if(_0x358412['body']['id']){delete _0x358412[_0x359b('0x68')]['id'];}delete _0x358412[_0x359b('0x68')][_0x359b('0x42')];return db[_0x359b('0x48')][_0x359b('0x43')]({'where':{'id':_0x358412['params']['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x48ccb5,null))['then'](saveUpdates(_0x358412[_0x359b('0x68')],null))[_0x359b('0x22')](respondWithResult(_0x48ccb5,null))['catch'](handleError(_0x48ccb5,null));};exports[_0x359b('0x69')]=function(_0x4eb675,_0x1ccaa9){return db[_0x359b('0x48')][_0x359b('0x69')]()[_0x359b('0x22')](respondWithResult(_0x1ccaa9,null))[_0x359b('0x2c')](handleError(_0x1ccaa9,null));};exports[_0x359b('0x6a')]=function(_0x410029,_0x4d2a9f,_0x34d3a3){return db['User'][_0x359b('0x43')]({'where':{'id':_0x410029[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x4d2a9f,null))[_0x359b('0x22')](function(_0xc898cc){if(_0xc898cc){return _0xc898cc[_0x359b('0x6a')](_0x410029[_0x359b('0x68')][_0x359b('0x6b')],_['omit'](_0x410029['body'],[_0x359b('0x6b'),'id'])||{});}})[_0x359b('0x22')](respondWithResult(_0x4d2a9f,null))['catch'](handleError(_0x4d2a9f,null));};var getLicense=function(_0x22b64a){return new BPromise(function(_0x179081,_0x4aa978){var _0x2e9551=0x0;_0x22b64a[_0x359b('0x68')][_0x359b('0x42')]===_0x359b('0x6c')&&_0x179081('agent\x20role');return db[_0x359b('0x48')]['count']({'where':{'$or':[{'role':_0x22b64a[_0x359b('0x68')][_0x359b('0x42')]==='telephone'?'telephone':[_0x359b('0x6d'),'user']}]}})[_0x359b('0x22')](function(_0x5b272f){_0x2e9551=_0x5b272f;return require('../../config/license/util')['getLicense']();})[_0x359b('0x22')](function(_0x41db0e){var _0x2b1bf7=_0x22b64a[_0x359b('0x68')]['role']==='telephone'?'telephones':_0x359b('0x6e');if(!_['isNil'](_0x41db0e[_0x2b1bf7])&&_0x2e9551>=_0x41db0e[_0x2b1bf7]){return _0x4aa978({'message':'License\x20limit\x20reached'});}return _0x179081(util[_0x359b('0x6f')](_0x359b('0x70'),_0x2b1bf7,_0x2e9551));})[_0x359b('0x2c')](function(_0x1dfc9e){return _0x4aa978(_0x1dfc9e);});});};exports['create']=function(_0x3e6faa,_0x15b93b){return getLicense(_0x3e6faa)['then'](function(_0x419acf){if(!_0x3e6faa['body'][_0x359b('0x71')]){var _0xac0a7c;return db[_0x359b('0x72')][_0x359b('0x73')](0x1)[_0x359b('0x22')](function(_0x547b36){return checkPasswordPattern(_0x547b36,_0x3e6faa['body'][_0x359b('0x4f')],_0x547b36[_0x359b('0x74')]);})['then'](function(_0x5b83dd){_0xac0a7c=_0x5b83dd[_0x359b('0x75')];return db[_0x359b('0x48')][_0x359b('0x76')](_0x359b('0x71'));})[_0x359b('0x22')](function(_0x5726e1){if(_[_0x359b('0x77')](_0x5726e1)){if(_0xac0a7c){_0x3e6faa['body'][_0x359b('0x71')]=_0xac0a7c;}else{_0x3e6faa[_0x359b('0x68')][_0x359b('0x71')]=0x1;}}else{if(_[_0x359b('0x77')](_0xac0a7c)||_0xac0a7c==_0x5726e1){_0x3e6faa['body'][_0x359b('0x71')]=_0x5726e1+0x1;}else if(_0xac0a7c>_0x5726e1){_0x3e6faa[_0x359b('0x68')]['internal']=_0xac0a7c;}else{return db['sequelize'][_0x359b('0x50')](_0x359b('0x78'),{'type':db[_0x359b('0x5b')][_0x359b('0x79')][_0x359b('0x7a')]})[_0x359b('0x22')](function(_0x3a4145){if(_0x3a4145&&_0x3a4145[_0x359b('0x66')]){for(var _0x34b9ef=0x0,_0x5c254a=_0x3a4145[_0x359b('0x66')];_0x34b9ef<_0x5c254a&&_[_0x359b('0x77')](_0x3e6faa['body'][_0x359b('0x71')]);_0x34b9ef++){if(_0xac0a7c<=_0x3a4145[_0x34b9ef][_0x359b('0x7b')]){_0x3e6faa[_0x359b('0x68')][_0x359b('0x71')]=_0x3a4145[_0x34b9ef][_0x359b('0x7b')];}else if(_0xac0a7c>_0x3a4145[_0x34b9ef]['from']&&_0xac0a7c<=_0x3a4145[_0x34b9ef]['to']){_0x3e6faa['body'][_0x359b('0x71')]=_0xac0a7c;}}}if(_[_0x359b('0x77')](_0x3e6faa[_0x359b('0x68')][_0x359b('0x71')])){_0x3e6faa[_0x359b('0x68')][_0x359b('0x71')]=_0x5726e1+0x1;}});}}});}})[_0x359b('0x22')](function(){if(_0x3e6faa[_0x359b('0x68')][_0x359b('0x7c')]){_0x3e6faa[_0x359b('0x68')]['mailbox']=_0x3e6faa[_0x359b('0x68')]['internal'];_0x3e6faa[_0x359b('0x68')][_0x359b('0x7d')]={'mailbox':_0x3e6faa[_0x359b('0x68')][_0x359b('0x71')],'password':_0x3e6faa[_0x359b('0x68')][_0x359b('0x4f')],'fullname':_0x3e6faa[_0x359b('0x68')][_0x359b('0x7e')],'email':_0x3e6faa[_0x359b('0x68')]['email']};}if(_0x3e6faa[_0x359b('0x68')]&&_0x3e6faa[_0x359b('0x68')][_0x359b('0x42')]===_0x359b('0x6c')){if(!_0x3e6faa[_0x359b('0x68')][_0x359b('0x7f')]){_0x3e6faa[_0x359b('0x68')][_0x359b('0x7f')]=['101',_0x359b('0x80'),_0x359b('0x81'),_0x359b('0x82'),_0x359b('0x83'),'104','105',_0x359b('0x84'),_0x359b('0x85'),_0x359b('0x86'),_0x359b('0x87'),_0x359b('0x88'),_0x359b('0x89'),_0x359b('0x8a')];}}return db[_0x359b('0x48')][_0x359b('0x8b')](_0x3e6faa['body'],{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})['then'](function(_0x3406b8){if(_0x3e6faa[_0x359b('0x68')][_0x359b('0x42')]==='user')return _0x3406b8;var _0x107a05=_0x3e6faa[_0x359b('0x3a')][_0x359b('0x38')]({'plain':!![]});if(!_0x107a05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x107a05[_0x359b('0x42')]===_0x359b('0x3a')){var _0x1c08ff=_0x3406b8[_0x359b('0x38')]({'plain':!![]});var _0x5ae132=[{'name':_0x359b('0x8c'),'value':_0x359b('0x6c')},{'name':_0x359b('0x3b'),'value':_0x359b('0x3c')}];var _0x41b0b1=_[_0x359b('0x43')](_0x5ae132,[_0x359b('0x40'),_0x1c08ff[_0x359b('0x42')]])[_0x359b('0x44')];return db['UserProfileSection'][_0x359b('0x43')]({'where':{'name':_0x41b0b1,'userProfileId':_0x107a05[_0x359b('0x8d')]},'raw':!![]})[_0x359b('0x22')](function(_0x436744){if(_0x436744&&_0x436744[_0x359b('0x8e')]===0x0){return db[_0x359b('0x45')]['create']({'name':_0x1c08ff[_0x359b('0x44')],'resourceId':_0x1c08ff['id'],'type':_0x436744[_0x359b('0x44')],'sectionId':_0x436744['id']},{})[_0x359b('0x22')](function(){return _0x3406b8;});}else{return _0x3406b8;}})[_0x359b('0x2c')](function(_0x4ff89b){logger['error'](_0x359b('0x8f'),_0x4ff89b);throw _0x4ff89b;});}return _0x3406b8;})['then'](respondWithResult(_0x15b93b,0xc9))[_0x359b('0x2c')](handleError(_0x15b93b,null));};exports['changePassword']=function(_0x350bf7,_0x7a2eff,_0x1d2d76){var _0x3bc3cd=![];if(_0x350bf7[_0x359b('0x68')]['id']){delete _0x350bf7[_0x359b('0x68')]['id'];}return db[_0x359b('0x72')]['findOne']({'attributes':['id','securePassword']})[_0x359b('0x22')](function(_0x28c72b){_0x3bc3cd=_0x28c72b['securePassword'];return db['User'][_0x359b('0x43')]({'where':{'id':_0x350bf7[_0x359b('0x63')]['id']}});})['then'](function(_0x3ea702){if(_0x3ea702){if(_0x3ea702['id']==_0x350bf7[_0x359b('0x3a')]['id']){if(!_0x350bf7[_0x359b('0x68')][_0x359b('0x90')]||!_0x350bf7[_0x359b('0x68')][_0x359b('0x91')]){throw new db[(_0x359b('0x1e'))][(_0x359b('0x1f'))](_0x359b('0x92'));}if(!_0x3ea702[_0x359b('0x93')](_0x350bf7[_0x359b('0x68')]['oldPassword'])){throw new db[(_0x359b('0x1e'))]['ValidationError']('Wrong\x20credentials');}if(_0x350bf7[_0x359b('0x68')][_0x359b('0x90')]==_0x350bf7[_0x359b('0x68')][_0x359b('0x91')]){throw new db['Sequelize'][(_0x359b('0x1f'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}return _0x3ea702;}else if(_0x350bf7['user'][_0x359b('0x42')]==_0x359b('0x6d')){if(!_0x350bf7[_0x359b('0x68')][_0x359b('0x91')]){throw new db[(_0x359b('0x1e'))][(_0x359b('0x1f'))](_0x359b('0x94'));}return _0x3ea702;}else if(_0x350bf7[_0x359b('0x3a')][_0x359b('0x42')]==_0x359b('0x3a')){if(!_0x350bf7[_0x359b('0x68')][_0x359b('0x91')]){throw new db[(_0x359b('0x1e'))][(_0x359b('0x1f'))](_0x359b('0x94'));}if(_0x3ea702[_0x359b('0x42')]!=_0x359b('0x6c')){throw new db[(_0x359b('0x1e'))]['ValidationError']('Unauthorized');}return _0x3ea702;}else{throw new db[(_0x359b('0x1e'))][(_0x359b('0x1f'))](_0x359b('0x95'));}}return null;})[_0x359b('0x22')](handleEntityNotFound(_0x7a2eff,null))[_0x359b('0x22')](function(_0x4766dd){return checkPasswordPattern(_0x4766dd,_0x350bf7[_0x359b('0x68')]['newPassword'],_0x3bc3cd);})[_0x359b('0x22')](saveUpdates({'password':_0x350bf7[_0x359b('0x68')]['newPassword'],'passwordResetAt':_0x350bf7[_0x359b('0x3a')]['id']==_0x350bf7[_0x359b('0x63')]['id']?moment():null},null))['then'](respondWithResult(_0x7a2eff,null))[_0x359b('0x2c')](handleError(_0x7a2eff,null));};exports['addQueues']=function(_0x41fd8a,_0x20388d,_0x457726){var _0x2c066f=_0x41fd8a[_0x359b('0x68')][_0x359b('0x96')];return db[_0x359b('0x48')][_0x359b('0x43')]({'where':{'id':_0x41fd8a[_0x359b('0x63')]['id']},'attributes':['id',_0x359b('0x44'),_0x359b('0x42'),_0x359b('0x97'),_0x359b('0x98'),_0x359b('0x99'),'interface']})['then'](handleEntityNotFound(_0x20388d,null))['then'](function(_0x2c1664){if(_0x2c1664){if(!utils[_0x359b('0x9a')](_0x2c066f)){throw new db['Sequelize'][(_0x359b('0x1f'))](_0x359b('0x9b'));}return _0x2c1664[_0x359b('0x9c')+_[_0x359b('0x9d')](_0x2c066f['toLowerCase']())+'Queues'](_0x41fd8a[_0x359b('0x68')][_0x359b('0x6b')],{'penalty':_0x41fd8a['body'][_0x359b('0x9e')]||0x0})[_0x359b('0x9f')](function(_0x22f8da){for(var _0x47bc99=0x0;_0x47bc99<_0x41fd8a[_0x359b('0x68')][_0x359b('0x6b')][_0x359b('0x66')];_0x47bc99+=0x1){var _0x370545={'UserId':_0x41fd8a[_0x359b('0x63')]['id']};_0x370545[_[_0x359b('0x9d')](_0x2c066f[_0x359b('0xa0')]())+'QueueId']=_0x41fd8a[_0x359b('0x68')][_0x359b('0x6b')][_0x47bc99];socket[_0x359b('0xa1')](_0x359b('0x3a')+_[_0x359b('0x9d')](_0x2c066f[_0x359b('0xa0')]())+_0x359b('0xa2'),_0x370545);}return _0x22f8da;})['then'](function(){if(_0x2c066f==='voice'){return db['VoiceQueue'][_0x359b('0xa3')]({'where':{'id':_0x41fd8a[_0x359b('0x68')][_0x359b('0x6b')]||[]},'raw':!![],'attributes':['id',_0x359b('0x44')]});}})[_0x359b('0x22')](function(_0x195636){var _0x437dcb=_0x2c1664['get']({'plain':!![]});var _0x4d09ca=[];if(_0x2c066f===_0x359b('0xa4')&&_0x437dcb[_0x359b('0x42')]===_0x359b('0x6c')&&_0x437dcb[_0x359b('0x97')]){for(var _0x5a78c8=0x0;_0x5a78c8<_0x195636[_0x359b('0x66')];_0x5a78c8+=0x1){_0x4d09ca['push']({'membername':_0x437dcb[_0x359b('0x44')],'UserId':_0x437dcb['id'],'queue_name':_0x195636[_0x5a78c8][_0x359b('0x44')],'VoiceQueueId':_0x195636[_0x5a78c8]['id'],'interface':_[_0x359b('0x77')](_0x437dcb['interface'])?util[_0x359b('0x6f')](_0x359b('0xa5'),_0x437dcb[_0x359b('0x44')]):_0x437dcb[_0x359b('0xa6')],'paused':_0x437dcb[_0x359b('0x99')]||![],'penalty':_0x41fd8a['body'][_0x359b('0x9e')]||0x0});}return BPromise[_0x359b('0xa7')](_0x4d09ca,function(_0x5f18da){return db['UserVoiceQueueRt']['upsert'](_0x5f18da);});}return _0x2c1664;});}})['then'](respondWithStatusCode(_0x20388d,null))['catch'](handleError(_0x20388d,null));};exports['removeQueues']=function(_0x5a5d00,_0x1c7a20,_0x1b787b){var _0xd030a;return db[_0x359b('0x48')]['find']({'where':{'id':_0x5a5d00['params']['id']},'attributes':['id',_0x359b('0x44'),'role']})[_0x359b('0x22')](handleEntityNotFound(_0x1c7a20,null))[_0x359b('0x22')](function(_0x3ca62f){if(_0x3ca62f){_0xd030a=_0x3ca62f;if(!_0x5a5d00[_0x359b('0x50')][_0x359b('0x96')]||!utils['isValidChannel'](_0x5a5d00['query']['channel'])){throw new db[(_0x359b('0x1e'))][(_0x359b('0x1f'))](_0x359b('0x9b'));}return _0x3ca62f[_0x359b('0xa8')+_[_0x359b('0x9d')](_0x5a5d00[_0x359b('0x50')][_0x359b('0x96')][_0x359b('0xa0')]())+_0x359b('0xa9')](_0x5a5d00[_0x359b('0x50')][_0x359b('0x6b')]);}})[_0x359b('0x22')](function(_0x3890f9){for(var _0x1d7924=0x0;_0x1d7924<_0x5a5d00['query'][_0x359b('0x6b')][_0x359b('0x66')];_0x1d7924+=0x1){var _0x499ade={'UserId':_0x5a5d00['params']['id']};_0x499ade[_['capitalize'](_0x5a5d00[_0x359b('0x50')]['channel']['toLowerCase']())+_0x359b('0xaa')]=_0x5a5d00[_0x359b('0x50')][_0x359b('0x6b')][_0x1d7924];socket['emit'](_0x359b('0x3a')+_[_0x359b('0x9d')](_0x5a5d00[_0x359b('0x50')][_0x359b('0x96')]['toLowerCase']())+'Queue:remove',_0x499ade);}return _0x3890f9;})[_0x359b('0x22')](function(){if(_0x5a5d00[_0x359b('0x50')][_0x359b('0x96')]===_0x359b('0xa4')){return db[_0x359b('0xab')]['destroy']({'where':{'UserId':_0x5a5d00['params']['id'],'VoiceQueueId':_0x5a5d00[_0x359b('0x50')][_0x359b('0x6b')]},'individualHooks':!![]})[_0x359b('0x22')](function(){return _0xd030a;});}return _0xd030a;})[_0x359b('0x22')](respondWithStatusCode(_0x1c7a20,null))[_0x359b('0x2c')](handleError(_0x1c7a20,null));};exports[_0x359b('0xac')]=function(_0x19ce91,_0x10606c,_0x446594){_0x19ce91[_0x359b('0x68')]['userpic']=_0x19ce91[_0x359b('0xad')][_0x359b('0xae')];return db[_0x359b('0x48')][_0x359b('0x43')]({'where':{'id':_0x19ce91[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x10606c,null))['then'](saveUpdates(_0x19ce91[_0x359b('0x68')],null))['then'](respondWithResult(_0x10606c,null))['catch'](handleError(_0x10606c,null));};exports['getAvatar']=function(_0x29377b,_0x2f79c7,_0x3f7b6e){var _0x125d5c=path[_0x359b('0xaf')](config[_0x359b('0xb0')],_0x359b('0xb1'));return db['User']['find']({'where':{'id':_0x29377b['params']['id']},'attributes':['id',_0x359b('0xb2')],'raw':!![]})[_0x359b('0x22')](handleEntityNotFound(_0x2f79c7,null))[_0x359b('0x22')](function(_0x7e9837){if(_0x7e9837){if(_[_0x359b('0x77')](_0x7e9837[_0x359b('0xb2')])){return _0x2f79c7[_0x359b('0xb3')](_0x125d5c);}else{if(!fs[_0x359b('0xb4')](path['join'](config[_0x359b('0xb0')],_0x359b('0xb5'),_0x7e9837['userpic']))){return _0x2f79c7['download'](_0x125d5c);}return _0x2f79c7['download'](path['join'](config[_0x359b('0xb0')],'server/files/images/',_0x7e9837[_0x359b('0xb2')]));}}})['catch'](handleError(_0x2f79c7,null));};exports[_0x359b('0xb6')]=function(_0x2154a3,_0x37eddb,_0x5cc817){var _0x1394cb={};var _0x1a3d51={};var _0x401db2;var _0x1459f0;return db['User'][_0x359b('0xb7')]({'where':{'id':_0x2154a3[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x37eddb,null))['then'](function(_0x19595e){if(_0x19595e){_0x401db2=_0x19595e;_0x1a3d51[_0x359b('0x4d')]=_['keys'](db[_0x359b('0xb8')][_0x359b('0x49')]);_0x1a3d51[_0x359b('0x50')]=_[_0x359b('0x64')](_0x2154a3[_0x359b('0x50')]);_0x1a3d51[_0x359b('0x51')]=_[_0x359b('0x52')](_0x1a3d51['model'],_0x1a3d51[_0x359b('0x50')]);_0x1394cb['attributes']=_['intersection'](_0x1a3d51[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x2154a3[_0x359b('0x50')]['fields']));_0x1394cb[_0x359b('0x53')]=_0x1394cb[_0x359b('0x53')][_0x359b('0x66')]?_0x1394cb[_0x359b('0x53')]:_0x1a3d51['model'];_0x1394cb[_0x359b('0x57')]=qs['sort'](_0x2154a3[_0x359b('0x50')][_0x359b('0x58')]);_0x1394cb[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x2154a3[_0x359b('0x50')],_0x1a3d51[_0x359b('0x51')]));if(_0x2154a3[_0x359b('0x50')][_0x359b('0x3d')]){_0x1394cb[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x1394cb['where'],{'$or':_[_0x359b('0x3f')](_0x1394cb['attributes'],function(_0x21afcd){var _0x3ecdf8={};_0x3ecdf8[_0x21afcd]={'$like':'%'+_0x2154a3['query'][_0x359b('0x3d')]+'%'};return _0x3ecdf8;})});}_0x1394cb=_['merge']({},_0x1394cb,_0x2154a3['options']);return _0x401db2['getContacts'](_0x1394cb);}})[_0x359b('0x22')](function(_0x41db78){if(_0x41db78){_0x1459f0=_0x41db78[_0x359b('0x66')];if(_0x2154a3['query'][_0x359b('0x55')]('includeAll')){_0x1394cb[_0x359b('0x60')]=[{'model':db['CmList'],'as':_0x359b('0xba'),'required':![]},{'model':db[_0x359b('0xbb')],'as':_0x359b('0xbc'),'attributes':['id',_0x359b('0x44'),'color'],'where':_0x2154a3['query'][_0x359b('0xbd')]?{'id':_0x2154a3[_0x359b('0x50')][_0x359b('0xbd')]}:undefined,'required':_0x2154a3[_0x359b('0x50')][_0x359b('0xbd')]?!![]:![]}];}if(!_0x2154a3[_0x359b('0x50')][_0x359b('0x55')](_0x359b('0x56'))){_0x1394cb['limit']=qs[_0x359b('0x33')](_0x2154a3[_0x359b('0x50')]['limit']);_0x1394cb['offset']=qs[_0x359b('0x32')](_0x2154a3[_0x359b('0x50')][_0x359b('0x32')]);}return _0x401db2['getContacts'](_0x1394cb);}})[_0x359b('0x22')](function(_0x3fed19){if(_0x3fed19){return _0x3fed19?{'count':_0x1459f0,'rows':_0x3fed19}:null;}})['then'](respondWithResult(_0x37eddb,null))[_0x359b('0x2c')](handleError(_0x37eddb,null));};exports['getQueues']=function(_0x3b329d,_0x46c7c8,_0x28805f){var _0x161b6c;var _0x5331d1;var _0x34b11c={};var _0x5a6f9c;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x3b329d[_0x359b('0x63')]['id']},'attributes':['id','name',_0x359b('0x42')]})[_0x359b('0x22')](handleEntityNotFound(_0x46c7c8,null))[_0x359b('0x22')](function(_0x3129a5){if(!utils['isValidChannel'](_0x3b329d[_0x359b('0x50')][_0x359b('0x96')])){throw new db[(_0x359b('0x1e'))][(_0x359b('0x1f'))](_0x359b('0x9b'));}_0x161b6c=_0x3129a5;var _0x198b8b={};_0x198b8b[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_['capitalize'](_0x3b329d[_0x359b('0x50')]['channel'])+_0x359b('0xbe')]['rawAttributes']);_0x198b8b[_0x359b('0x50')]=_[_0x359b('0x64')](_0x3b329d[_0x359b('0x50')]);_0x198b8b[_0x359b('0x51')]=_[_0x359b('0x52')](_0x198b8b['model'],_0x198b8b[_0x359b('0x50')]);_0x34b11c[_0x359b('0x53')]=_['intersection'](_0x198b8b[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x3b329d[_0x359b('0x50')]['fields']));_0x34b11c[_0x359b('0x53')]=_0x34b11c[_0x359b('0x53')][_0x359b('0x66')]?_0x34b11c[_0x359b('0x53')]:_0x198b8b[_0x359b('0x4d')];_0x34b11c[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x3b329d[_0x359b('0x50')]['sort']);_0x34b11c[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x3b329d[_0x359b('0x50')],_0x198b8b[_0x359b('0x51')]));if(_0x3b329d['query'][_0x359b('0x3d')]){_0x34b11c[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x34b11c[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x34b11c[_0x359b('0x53')],function(_0x5dbf0c){var _0x28e8fe={};_0x28e8fe[_0x5dbf0c]={'$like':'%'+_0x3b329d[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x28e8fe;})});}_0x34b11c=_[_0x359b('0x5a')]({},_0x34b11c,_0x3b329d[_0x359b('0x5e')]);switch(_0x161b6c[_0x359b('0x42')]){case _0x359b('0x6d'):return db[_[_0x359b('0x9d')](_0x3b329d[_0x359b('0x50')][_0x359b('0x96')])+_0x359b('0xbe')][_0x359b('0xa3')](_0x34b11c);case _0x359b('0x3a'):case _0x359b('0x6c'):return _0x161b6c[_0x359b('0x38')+_[_0x359b('0x9d')](_0x3b329d[_0x359b('0x50')][_0x359b('0x96')])+_0x359b('0xa9')](_0x34b11c);default:throw new db['Sequelize'][(_0x359b('0x1f'))](_0x359b('0xbf'));}})[_0x359b('0x22')](function(_0x2b9845){_0x5a6f9c=_0x2b9845[_0x359b('0x66')];if(!_0x3b329d[_0x359b('0x50')][_0x359b('0x55')]('nolimit')){_0x34b11c[_0x359b('0x33')]=qs['limit'](_0x3b329d['query'][_0x359b('0x33')]);_0x34b11c['offset']=qs[_0x359b('0x32')](_0x3b329d[_0x359b('0x50')]['offset']);}switch(_0x161b6c[_0x359b('0x42')]){case'admin':return db[_[_0x359b('0x9d')](_0x3b329d[_0x359b('0x50')][_0x359b('0x96')])+'Queue']['findAll'](_0x34b11c);case _0x359b('0x3a'):case _0x359b('0x6c'):return _0x161b6c['get'+_[_0x359b('0x9d')](_0x3b329d[_0x359b('0x50')]['channel'])+_0x359b('0xa9')](_0x34b11c);}})[_0x359b('0x22')](function(_0x1770fd){return{'count':_0x5a6f9c,'rows':_0x1770fd};})[_0x359b('0x22')](respondWithResult(_0x46c7c8,null))[_0x359b('0x2c')](handleError(_0x46c7c8,null));};exports[_0x359b('0xc0')]=function(_0x653f,_0x26f657,_0x1575e0){var _0x4666e7={};var _0x212c03={};var _0x199e79;var _0x3e4832;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x653f[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x26f657,null))[_0x359b('0x22')](function(_0x4befb9){if(_0x4befb9){_0x199e79=_0x4befb9;_0x212c03[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_0x359b('0xab')][_0x359b('0x49')]);_0x212c03['query']=_[_0x359b('0x64')](_0x653f[_0x359b('0x50')]);_0x212c03[_0x359b('0x51')]=_[_0x359b('0x52')](_0x212c03[_0x359b('0x4d')],_0x212c03[_0x359b('0x50')]);_0x4666e7[_0x359b('0x53')]=_[_0x359b('0x52')](_0x212c03[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x653f[_0x359b('0x50')][_0x359b('0x54')]));_0x4666e7[_0x359b('0x53')]=_0x4666e7[_0x359b('0x53')]['length']?_0x4666e7[_0x359b('0x53')]:_0x212c03[_0x359b('0x4d')];_0x4666e7['order']=qs[_0x359b('0x58')](_0x653f[_0x359b('0x50')][_0x359b('0x58')]);_0x4666e7[_0x359b('0x59')]=qs[_0x359b('0x51')](_['pick'](_0x653f[_0x359b('0x50')],_0x212c03[_0x359b('0x51')]));if(_0x653f[_0x359b('0x50')][_0x359b('0x3d')]){_0x4666e7[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x4666e7['where'],{'$or':_[_0x359b('0x3f')](_0x4666e7[_0x359b('0x53')],function(_0x48bff5){var _0x3ec62c={};_0x3ec62c[_0x48bff5]={'$like':'%'+_0x653f[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x3ec62c;})});}_0x4666e7=_[_0x359b('0x5a')]({},_0x4666e7,_0x653f[_0x359b('0x5e')]);return _0x199e79['getVoiceQueuesRt'](_0x4666e7);}})['then'](function(_0x14bb76){if(_0x14bb76){_0x3e4832=_0x14bb76[_0x359b('0x66')];if(!_0x653f[_0x359b('0x50')]['hasOwnProperty'](_0x359b('0x56'))){_0x4666e7[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x653f['query'][_0x359b('0x33')]);_0x4666e7['offset']=qs[_0x359b('0x32')](_0x653f[_0x359b('0x50')]['offset']);}return _0x199e79[_0x359b('0xc0')](_0x4666e7);}})[_0x359b('0x22')](function(_0x1c7b66){if(_0x1c7b66){return _0x1c7b66?{'count':_0x3e4832,'rows':_0x1c7b66}:null;}})[_0x359b('0x22')](respondWithResult(_0x26f657,null))[_0x359b('0x2c')](handleError(_0x26f657,null));};exports[_0x359b('0xc1')]=function(_0x51a1e3,_0x3601b8,_0x89ea85){var _0xb75479={};var _0x40261e={};var _0x38c82d;var _0x36b7bb;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x51a1e3[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x3601b8,null))[_0x359b('0x22')](function(_0x5d79b9){if(_0x5d79b9){_0x38c82d=_0x5d79b9;_0x40261e[_0x359b('0x4d')]=_['keys'](db[_0x359b('0xc2')]['rawAttributes']);_0x40261e[_0x359b('0x50')]=_[_0x359b('0x64')](_0x51a1e3[_0x359b('0x50')]);_0x40261e['filters']=_[_0x359b('0x52')](_0x40261e[_0x359b('0x4d')],_0x40261e[_0x359b('0x50')]);_0xb75479[_0x359b('0x53')]=_['intersection'](_0x40261e['model'],qs[_0x359b('0x54')](_0x51a1e3['query']['fields']));_0xb75479[_0x359b('0x53')]=_0xb75479['attributes'][_0x359b('0x66')]?_0xb75479[_0x359b('0x53')]:_0x40261e[_0x359b('0x4d')];_0xb75479[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x51a1e3[_0x359b('0x50')][_0x359b('0x58')]);_0xb75479[_0x359b('0x59')]=qs['filters'](_[_0x359b('0xb9')](_0x51a1e3[_0x359b('0x50')],_0x40261e['filters']));if(_0x51a1e3[_0x359b('0x50')][_0x359b('0x3d')]){_0xb75479[_0x359b('0x59')]=_[_0x359b('0x5a')](_0xb75479[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0xb75479[_0x359b('0x53')],function(_0x2715d2){var _0x37a7c5={};_0x37a7c5[_0x2715d2]={'$like':'%'+_0x51a1e3[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x37a7c5;})});}_0xb75479=_[_0x359b('0x5a')]({},_0xb75479,_0x51a1e3[_0x359b('0x5e')]);return _0x38c82d['getGroups'](_0xb75479);}})[_0x359b('0x22')](function(_0x1489e7){if(_0x1489e7){_0x36b7bb=_0x1489e7[_0x359b('0x66')];if(!_0x51a1e3[_0x359b('0x50')]['hasOwnProperty'](_0x359b('0x56'))){_0xb75479[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x51a1e3[_0x359b('0x50')][_0x359b('0x33')]);_0xb75479['offset']=qs[_0x359b('0x32')](_0x51a1e3[_0x359b('0x50')][_0x359b('0x32')]);}return _0x38c82d['getGroups'](_0xb75479);}})[_0x359b('0x22')](function(_0x5e5cb7){if(_0x5e5cb7){return _0x5e5cb7?{'count':_0x36b7bb,'rows':_0x5e5cb7}:null;}})['then'](respondWithResult(_0x3601b8,null))[_0x359b('0x2c')](handleError(_0x3601b8,null));};exports[_0x359b('0xc3')]=function(_0x4f63d7,_0x182745,_0x2b66cf){var _0x570948={'raw':!![],'where':{}};var _0x587f2e={};var _0x332ece={'count':0x0,'rows':[]};return db[_0x359b('0x48')]['findOne']({'where':{'id':_0x4f63d7[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x182745,null))[_0x359b('0x22')](function(_0x143a7c){if(_0x143a7c){_0x587f2e[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_0x359b('0xc4')]['rawAttributes']);_0x587f2e[_0x359b('0x50')]=_[_0x359b('0x64')](_0x4f63d7[_0x359b('0x50')]);_0x587f2e['filters']=_['intersection'](_0x587f2e['model'],_0x587f2e[_0x359b('0x50')]);_0x570948[_0x359b('0x53')]=_['intersection'](_0x587f2e['model'],qs[_0x359b('0x54')](_0x4f63d7[_0x359b('0x50')][_0x359b('0x54')]));_0x570948[_0x359b('0x53')]=_0x570948[_0x359b('0x53')][_0x359b('0x66')]?_0x570948['attributes']:_0x587f2e[_0x359b('0x4d')];if(!_0x4f63d7[_0x359b('0x50')][_0x359b('0x55')]('nolimit')){_0x570948[_0x359b('0x33')]=qs['limit'](_0x4f63d7[_0x359b('0x50')][_0x359b('0x33')]);_0x570948[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x4f63d7[_0x359b('0x50')]['offset']);}_0x570948[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x4f63d7[_0x359b('0x50')]['sort']);_0x570948[_0x359b('0x59')]=qs[_0x359b('0x51')](_['pick'](_0x4f63d7[_0x359b('0x50')],_0x587f2e[_0x359b('0x51')]));_0x570948[_0x359b('0x59')]['UserId']=_0x143a7c['id'];if(_0x4f63d7[_0x359b('0x50')][_0x359b('0x3d')]){_0x570948[_0x359b('0x59')]=_['merge'](_0x570948[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x570948[_0x359b('0x53')],function(_0x45bf61){var _0x32ffa7={};_0x32ffa7[_0x45bf61]={'$like':'%'+_0x4f63d7[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x32ffa7;})});}_0x570948=_[_0x359b('0x5a')]({},_0x570948,_0x4f63d7[_0x359b('0x5e')]);return db[_0x359b('0xc4')][_0x359b('0x31')]({'where':_0x570948[_0x359b('0x59')]})['then'](function(_0x542e67){_0x332ece[_0x359b('0x31')]=_0x542e67;if(_0x4f63d7[_0x359b('0x50')][_0x359b('0x5f')]){_0x570948['include']=[{'all':!![]}];}return db[_0x359b('0xc4')][_0x359b('0xa3')](_0x570948);})[_0x359b('0x22')](function(_0x1952b1){_0x332ece['rows']=_0x1952b1;return _0x332ece;});}})['then'](respondWithFilteredResult(_0x182745,_0x570948))[_0x359b('0x2c')](handleError(_0x182745,null));};exports['getScreenRecordings']=function(_0x4cf02c,_0x2911fb,_0x1f084c){var _0x1f81e6={'raw':!![],'where':{}};var _0x2871b9={};var _0x1d6dfa={'count':0x0,'rows':[]};return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x4cf02c[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x2911fb,null))['then'](function(_0x355786){if(_0x355786){_0x2871b9['model']=_['keys'](db['ScreenRecording'][_0x359b('0x49')]);_0x2871b9[_0x359b('0x50')]=_[_0x359b('0x64')](_0x4cf02c[_0x359b('0x50')]);_0x2871b9[_0x359b('0x51')]=_[_0x359b('0x52')](_0x2871b9[_0x359b('0x4d')],_0x2871b9['query']);_0x1f81e6[_0x359b('0x53')]=_[_0x359b('0x52')](_0x2871b9[_0x359b('0x4d')],qs['fields'](_0x4cf02c[_0x359b('0x50')]['fields']));_0x1f81e6[_0x359b('0x53')]=_0x1f81e6[_0x359b('0x53')]['length']?_0x1f81e6['attributes']:_0x2871b9[_0x359b('0x4d')];if(!_0x4cf02c['query'][_0x359b('0x55')](_0x359b('0x56'))){_0x1f81e6[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x4cf02c[_0x359b('0x50')][_0x359b('0x33')]);_0x1f81e6[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x4cf02c[_0x359b('0x50')][_0x359b('0x32')]);}_0x1f81e6['order']=qs[_0x359b('0x58')](_0x4cf02c[_0x359b('0x50')][_0x359b('0x58')]);_0x1f81e6[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x4cf02c['query'],_0x2871b9[_0x359b('0x51')]));_0x1f81e6[_0x359b('0x59')][_0x359b('0xc5')]=_0x355786['id'];if(_0x4cf02c['query'][_0x359b('0x3d')]){_0x1f81e6[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x1f81e6['where'],{'$or':_[_0x359b('0x3f')](_0x1f81e6[_0x359b('0x53')],function(_0x1c835a){var _0x5a688c={};_0x5a688c[_0x1c835a]={'$like':'%'+_0x4cf02c[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x5a688c;})});}_0x1f81e6=_[_0x359b('0x5a')]({},_0x1f81e6,_0x4cf02c[_0x359b('0x5e')]);return db['ScreenRecording'][_0x359b('0x31')]({'where':_0x1f81e6[_0x359b('0x59')]})[_0x359b('0x22')](function(_0x486207){_0x1d6dfa['count']=_0x486207;if(_0x4cf02c[_0x359b('0x50')][_0x359b('0x5f')]){_0x1f81e6[_0x359b('0x60')]=[{'all':!![]}];}return db[_0x359b('0xc6')]['findAll'](_0x1f81e6);})[_0x359b('0x22')](function(_0xbaab08){_0x1d6dfa[_0x359b('0x61')]=_0xbaab08;return _0x1d6dfa;});}})[_0x359b('0x22')](respondWithFilteredResult(_0x2911fb,_0x1f81e6))[_0x359b('0x2c')](handleError(_0x2911fb,null));};exports['getChatInteractions']=function(_0x48a4f9,_0x40a651,_0x515077){var _0x806371={};var _0x988740={};var _0x109907;var _0x14bff9;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x48a4f9[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x40a651,null))[_0x359b('0x22')](function(_0x56436b){if(_0x56436b){_0x109907=_0x56436b;_0x988740[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_0x359b('0xc7')][_0x359b('0x49')]);_0x988740[_0x359b('0x50')]=_['keys'](_0x48a4f9[_0x359b('0x50')]);_0x988740[_0x359b('0x51')]=_[_0x359b('0x52')](_0x988740[_0x359b('0x4d')],_0x988740['query']);_0x806371[_0x359b('0x53')]=_['intersection'](_0x988740['model'],qs[_0x359b('0x54')](_0x48a4f9['query'][_0x359b('0x54')]));_0x806371[_0x359b('0x53')]=_0x806371['attributes']['length']?_0x806371['attributes']:_0x988740[_0x359b('0x4d')];_0x806371[_0x359b('0x57')]=qs['sort'](_0x48a4f9['query'][_0x359b('0x58')]);_0x806371['where']=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x48a4f9[_0x359b('0x50')],_0x988740[_0x359b('0x51')]));if(_0x48a4f9['query'][_0x359b('0x3d')]){_0x806371['where']=_[_0x359b('0x5a')](_0x806371[_0x359b('0x59')],{'$or':_['map'](_0x806371[_0x359b('0x53')],function(_0x20fc4b){var _0x4d19fe={};_0x4d19fe[_0x20fc4b]={'$like':'%'+_0x48a4f9[_0x359b('0x50')]['filter']+'%'};return _0x4d19fe;})});}_0x806371=_[_0x359b('0x5a')]({},_0x806371,_0x48a4f9[_0x359b('0x5e')]);return _0x109907[_0x359b('0xc8')](_0x806371);}})[_0x359b('0x22')](function(_0x1989b2){if(_0x1989b2){_0x14bff9=_0x1989b2[_0x359b('0x66')];if(!_0x48a4f9['query'][_0x359b('0x55')](_0x359b('0x56'))){_0x806371['limit']=qs[_0x359b('0x33')](_0x48a4f9[_0x359b('0x50')][_0x359b('0x33')]);_0x806371[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x48a4f9['query'][_0x359b('0x32')]);}return _0x109907[_0x359b('0xc8')](_0x806371);}})[_0x359b('0x22')](function(_0x3067b1){if(_0x3067b1){return _0x3067b1?{'count':_0x14bff9,'rows':_0x3067b1}:null;}})[_0x359b('0x22')](respondWithResult(_0x40a651,null))[_0x359b('0x2c')](handleError(_0x40a651,null));};exports[_0x359b('0xc9')]=function(_0x46537b,_0x4c81f8,_0x502b71){var _0x236593={};var _0x463133={};var _0x318807;var _0x122222;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x46537b[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x4c81f8,null))[_0x359b('0x22')](function(_0xb7623f){if(_0xb7623f){_0x318807=_0xb7623f;_0x463133[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_0x359b('0xca')][_0x359b('0x49')]);_0x463133[_0x359b('0x50')]=_[_0x359b('0x64')](_0x46537b[_0x359b('0x50')]);_0x463133['filters']=_[_0x359b('0x52')](_0x463133[_0x359b('0x4d')],_0x463133['query']);_0x236593[_0x359b('0x53')]=_[_0x359b('0x52')](_0x463133[_0x359b('0x4d')],qs['fields'](_0x46537b[_0x359b('0x50')][_0x359b('0x54')]));_0x236593['attributes']=_0x236593['attributes'][_0x359b('0x66')]?_0x236593['attributes']:_0x463133[_0x359b('0x4d')];_0x236593[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x46537b[_0x359b('0x50')]['sort']);_0x236593[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x46537b['query'],_0x463133[_0x359b('0x51')]));if(_0x46537b[_0x359b('0x50')][_0x359b('0x3d')]){_0x236593[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x236593[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x236593[_0x359b('0x53')],function(_0x1bd43d){var _0x6eee78={};_0x6eee78[_0x1bd43d]={'$like':'%'+_0x46537b[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x6eee78;})});}_0x236593=_[_0x359b('0x5a')]({},_0x236593,_0x46537b[_0x359b('0x5e')]);return _0x318807[_0x359b('0xc9')](_0x236593);}})[_0x359b('0x22')](function(_0xd2e9bc){if(_0xd2e9bc){_0x122222=_0xd2e9bc[_0x359b('0x66')];if(!_0x46537b[_0x359b('0x50')][_0x359b('0x55')](_0x359b('0x56'))){_0x236593[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x46537b[_0x359b('0x50')][_0x359b('0x33')]);_0x236593[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x46537b['query'][_0x359b('0x32')]);}return _0x318807[_0x359b('0xc9')](_0x236593);}})['then'](function(_0x3bea97){if(_0x3bea97){return _0x3bea97?{'count':_0x122222,'rows':_0x3bea97}:null;}})[_0x359b('0x22')](respondWithResult(_0x4c81f8,null))['catch'](handleError(_0x4c81f8,null));};exports[_0x359b('0xcb')]=function(_0x193bb3,_0x580728,_0x12d5d8){var _0xc4c8e0={'raw':!![],'where':{}};var _0x5388d7={};var _0x5dabfb={'count':0x0,'rows':[]};return db[_0x359b('0x48')]['findOne']({'where':{'id':_0x193bb3[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x580728,null))[_0x359b('0x22')](function(_0x538746){if(_0x538746){_0x5388d7[_0x359b('0x4d')]=_[_0x359b('0x64')](db['MailInteraction'][_0x359b('0x49')]);_0x5388d7['query']=_[_0x359b('0x64')](_0x193bb3[_0x359b('0x50')]);_0x5388d7[_0x359b('0x51')]=_['intersection'](_0x5388d7[_0x359b('0x4d')],_0x5388d7[_0x359b('0x50')]);_0xc4c8e0[_0x359b('0x53')]=_['intersection'](_0x5388d7['model'],qs[_0x359b('0x54')](_0x193bb3['query'][_0x359b('0x54')]));_0xc4c8e0[_0x359b('0x53')]=_0xc4c8e0[_0x359b('0x53')][_0x359b('0x66')]?_0xc4c8e0[_0x359b('0x53')]:_0x5388d7[_0x359b('0x4d')];if(!_0x193bb3[_0x359b('0x50')]['hasOwnProperty'](_0x359b('0x56'))){_0xc4c8e0[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x193bb3['query'][_0x359b('0x33')]);_0xc4c8e0['offset']=qs[_0x359b('0x32')](_0x193bb3[_0x359b('0x50')]['offset']);}_0xc4c8e0[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x193bb3['query']['sort']);_0xc4c8e0[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x193bb3[_0x359b('0x50')],_0x5388d7[_0x359b('0x51')]));_0xc4c8e0[_0x359b('0x59')]['UserId']=_0x538746['id'];if(_0x193bb3[_0x359b('0x50')][_0x359b('0x3d')]){_0xc4c8e0[_0x359b('0x59')]=_[_0x359b('0x5a')](_0xc4c8e0[_0x359b('0x59')],{'$or':_['map'](_0xc4c8e0[_0x359b('0x53')],function(_0x38bd09){var _0x414150={};_0x414150[_0x38bd09]={'$like':'%'+_0x193bb3[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x414150;})});}_0xc4c8e0=_['merge']({},_0xc4c8e0,_0x193bb3[_0x359b('0x5e')]);return db[_0x359b('0xcc')]['count']({'where':_0xc4c8e0[_0x359b('0x59')]})[_0x359b('0x22')](function(_0x51e365){_0x5dabfb['count']=_0x51e365;if(_0x193bb3[_0x359b('0x50')][_0x359b('0x5f')]){_0xc4c8e0['include']=[{'all':!![]}];}return db[_0x359b('0xcc')][_0x359b('0xa3')](_0xc4c8e0);})[_0x359b('0x22')](function(_0x375f00){_0x5dabfb[_0x359b('0x61')]=_0x375f00;return _0x5dabfb;});}})[_0x359b('0x22')](respondWithFilteredResult(_0x580728,_0xc4c8e0))[_0x359b('0x2c')](handleError(_0x580728,null));};exports['getSmsInteractions']=function(_0x43974c,_0x34bacc,_0x5ead08){var _0x3234bc={};var _0x2c9af4={};var _0x3452a6;var _0x5a9a1e;return db[_0x359b('0x48')]['findOne']({'where':{'id':_0x43974c['params']['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x34bacc,null))[_0x359b('0x22')](function(_0x4721e5){if(_0x4721e5){_0x3452a6=_0x4721e5;_0x2c9af4[_0x359b('0x4d')]=_[_0x359b('0x64')](db['SmsInteraction']['rawAttributes']);_0x2c9af4['query']=_[_0x359b('0x64')](_0x43974c[_0x359b('0x50')]);_0x2c9af4['filters']=_[_0x359b('0x52')](_0x2c9af4[_0x359b('0x4d')],_0x2c9af4[_0x359b('0x50')]);_0x3234bc[_0x359b('0x53')]=_['intersection'](_0x2c9af4[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x43974c[_0x359b('0x50')]['fields']));_0x3234bc[_0x359b('0x53')]=_0x3234bc['attributes'][_0x359b('0x66')]?_0x3234bc[_0x359b('0x53')]:_0x2c9af4[_0x359b('0x4d')];_0x3234bc[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x43974c['query'][_0x359b('0x58')]);_0x3234bc[_0x359b('0x59')]=qs[_0x359b('0x51')](_['pick'](_0x43974c['query'],_0x2c9af4[_0x359b('0x51')]));if(_0x43974c[_0x359b('0x50')][_0x359b('0x3d')]){_0x3234bc[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x3234bc['where'],{'$or':_[_0x359b('0x3f')](_0x3234bc[_0x359b('0x53')],function(_0x20b8dc){var _0x218854={};_0x218854[_0x20b8dc]={'$like':'%'+_0x43974c[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x218854;})});}_0x3234bc=_[_0x359b('0x5a')]({},_0x3234bc,_0x43974c[_0x359b('0x5e')]);return _0x3452a6[_0x359b('0xcd')](_0x3234bc);}})[_0x359b('0x22')](function(_0x583a62){if(_0x583a62){_0x5a9a1e=_0x583a62[_0x359b('0x66')];if(!_0x43974c['query'][_0x359b('0x55')]('nolimit')){_0x3234bc[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x43974c[_0x359b('0x50')]['limit']);_0x3234bc[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x43974c[_0x359b('0x50')][_0x359b('0x32')]);}return _0x3452a6['getSmsInteractions'](_0x3234bc);}})['then'](function(_0x137ed0){if(_0x137ed0){return _0x137ed0?{'count':_0x5a9a1e,'rows':_0x137ed0}:null;}})[_0x359b('0x22')](respondWithResult(_0x34bacc,null))['catch'](handleError(_0x34bacc,null));};exports[_0x359b('0xce')]=function(_0x5c038e,_0x7dd696,_0x1025ee){var _0x330e5c={};var _0x4b1338={};var _0x52d754;var _0x341613;return db[_0x359b('0x48')]['findOne']({'where':{'id':_0x5c038e[_0x359b('0x63')]['id']}})['then'](handleEntityNotFound(_0x7dd696,null))[_0x359b('0x22')](function(_0x15def4){if(_0x15def4){_0x52d754=_0x15def4;_0x4b1338[_0x359b('0x4d')]=_['keys'](db[_0x359b('0xcf')][_0x359b('0x49')]);_0x4b1338['query']=_[_0x359b('0x64')](_0x5c038e[_0x359b('0x50')]);_0x4b1338[_0x359b('0x51')]=_[_0x359b('0x52')](_0x4b1338[_0x359b('0x4d')],_0x4b1338[_0x359b('0x50')]);_0x330e5c[_0x359b('0x53')]=_[_0x359b('0x52')](_0x4b1338[_0x359b('0x4d')],qs['fields'](_0x5c038e[_0x359b('0x50')][_0x359b('0x54')]));_0x330e5c['attributes']=_0x330e5c['attributes'][_0x359b('0x66')]?_0x330e5c[_0x359b('0x53')]:_0x4b1338['model'];_0x330e5c[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x5c038e['query'][_0x359b('0x58')]);_0x330e5c['where']=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x5c038e[_0x359b('0x50')],_0x4b1338[_0x359b('0x51')]));if(_0x5c038e[_0x359b('0x50')][_0x359b('0x3d')]){_0x330e5c[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x330e5c[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x330e5c['attributes'],function(_0xe7fc69){var _0x240d67={};_0x240d67[_0xe7fc69]={'$like':'%'+_0x5c038e['query'][_0x359b('0x3d')]+'%'};return _0x240d67;})});}_0x330e5c=_[_0x359b('0x5a')]({},_0x330e5c,_0x5c038e[_0x359b('0x5e')]);return _0x52d754[_0x359b('0xce')](_0x330e5c);}})['then'](function(_0x24d1c9){if(_0x24d1c9){_0x341613=_0x24d1c9[_0x359b('0x66')];if(!_0x5c038e['query']['hasOwnProperty']('nolimit')){_0x330e5c['limit']=qs[_0x359b('0x33')](_0x5c038e[_0x359b('0x50')][_0x359b('0x33')]);_0x330e5c[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x5c038e[_0x359b('0x50')][_0x359b('0x32')]);}return _0x52d754[_0x359b('0xce')](_0x330e5c);}})[_0x359b('0x22')](function(_0x4d7c8a){if(_0x4d7c8a){return _0x4d7c8a?{'count':_0x341613,'rows':_0x4d7c8a}:null;}})[_0x359b('0x22')](respondWithResult(_0x7dd696,null))['catch'](handleError(_0x7dd696,null));};exports[_0x359b('0xd0')]=function(_0x1af573,_0x18674e,_0x21e82f){var _0x52ed39={};var _0xa6ca65={};var _0x3942fa;var _0x120dc;return db['User'][_0x359b('0xb7')]({'where':{'id':_0x1af573['params']['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x18674e,null))['then'](function(_0x2ffabd){if(_0x2ffabd){_0x3942fa=_0x2ffabd;_0xa6ca65[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_0x359b('0xd1')][_0x359b('0x49')]);_0xa6ca65[_0x359b('0x50')]=_[_0x359b('0x64')](_0x1af573[_0x359b('0x50')]);_0xa6ca65[_0x359b('0x51')]=_[_0x359b('0x52')](_0xa6ca65[_0x359b('0x4d')],_0xa6ca65[_0x359b('0x50')]);_0x52ed39['attributes']=_[_0x359b('0x52')](_0xa6ca65[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x1af573[_0x359b('0x50')][_0x359b('0x54')]));_0x52ed39[_0x359b('0x53')]=_0x52ed39['attributes'][_0x359b('0x66')]?_0x52ed39['attributes']:_0xa6ca65['model'];_0x52ed39[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x1af573[_0x359b('0x50')][_0x359b('0x58')]);_0x52ed39[_0x359b('0x59')]=qs['filters'](_[_0x359b('0xb9')](_0x1af573[_0x359b('0x50')],_0xa6ca65[_0x359b('0x51')]));if(_0x1af573[_0x359b('0x50')][_0x359b('0x3d')]){_0x52ed39['where']=_[_0x359b('0x5a')](_0x52ed39[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x52ed39[_0x359b('0x53')],function(_0x6b2bbf){var _0x3729bc={};_0x3729bc[_0x6b2bbf]={'$like':'%'+_0x1af573[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x3729bc;})});}_0x52ed39=_['merge']({},_0x52ed39,_0x1af573[_0x359b('0x5e')]);return _0x3942fa[_0x359b('0xd0')](_0x52ed39);}})['then'](function(_0x1bbe04){if(_0x1bbe04){_0x120dc=_0x1bbe04[_0x359b('0x66')];if(!_0x1af573['query'][_0x359b('0x55')](_0x359b('0x56'))){_0x52ed39['limit']=qs[_0x359b('0x33')](_0x1af573[_0x359b('0x50')][_0x359b('0x33')]);_0x52ed39[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x1af573['query'][_0x359b('0x32')]);}return _0x3942fa['getWhatsappInteractions'](_0x52ed39);}})['then'](function(_0x34fa39){if(_0x34fa39){return _0x34fa39?{'count':_0x120dc,'rows':_0x34fa39}:null;}})[_0x359b('0x22')](respondWithResult(_0x18674e,null))[_0x359b('0x2c')](handleError(_0x18674e,null));};exports[_0x359b('0xd2')]=function(_0x58ebd1,_0x130d7f,_0x2b2a6d){var _0x519387;var _0x46fff8;var _0x3a98ee;var _0x1f6efb=!_[_0x359b('0x77')](_0x58ebd1[_0x359b('0x63')]['id'])?_0x58ebd1[_0x359b('0x63')]['id']:!_[_0x359b('0x77')](_0x58ebd1[_0x359b('0x3a')]['id'])?_0x58ebd1[_0x359b('0x3a')]['id']:null;return db[_0x359b('0x48')][_0x359b('0x43')]({'where':{'id':_0x1f6efb,'role':{'$or':['admin','user',_0x359b('0x6c')]}},'attributes':['id',_0x359b('0x44'),_0x359b('0xd3'),'mobile','role','internal','loginInPause']})['then'](function(_0x209b67){if(_0x209b67){if(_0x209b67[_0x359b('0x42')]==='agent'){_0x519387=_0x209b67;if(_0x58ebd1[_0x359b('0x68')]['interface']){_0x3a98ee=util[_0x359b('0x6f')](_0x359b('0xd4'),_0x519387[_0x58ebd1[_0x359b('0x68')][_0x359b('0xa6')]]);}else if(_0x58ebd1[_0x359b('0x68')][_0x359b('0xd5')]){_0x3a98ee=util[_0x359b('0x6f')](_0x359b('0xa5'),_0x58ebd1[_0x359b('0x68')]['intrf']);}else{_0x3a98ee=util[_0x359b('0x6f')](_0x359b('0xa5'),_0x519387[_0x359b('0x44')]);}socket['to'](util[_0x359b('0x6f')](_0x359b('0xd6'),_0x519387[_0x359b('0x44')]))[_0x359b('0xa1')](_0x359b('0xd7'),{'ip':_0x58ebd1[_0x359b('0xd8')][_0x359b('0xd9')]||_0x58ebd1[_0x359b('0xda')][_0x359b('0xdb')]||_0x58ebd1[_0x359b('0xdc')][_0x359b('0xdb')]||_0x58ebd1[_0x359b('0xda')][_0x359b('0xdc')][_0x359b('0xdb')]});return db['UserVoiceQueueRt'][_0x359b('0x37')]({'where':{'membername':_0x519387['name']},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x359b('0x1f'))](_0x359b('0xdd'));}})[_0x359b('0x22')](function(){if(_0x519387){return _0x519387['getVoiceQueues']({'raw':!![]});}})['then'](function(_0xdcf3e3){if(_0x519387){var _0x337c79=[];if(_0xdcf3e3){_0x46fff8=_0xdcf3e3;if(_0x46fff8[_0x359b('0x66')]){for(var _0x101162=0x0;_0x101162<_0x46fff8['length'];_0x101162++){_0x337c79[_0x359b('0xde')]({'membername':_0x519387[_0x359b('0x44')],'UserId':_0x519387['id'],'queue_name':_0x46fff8[_0x101162]['name'],'VoiceQueueId':_0x46fff8[_0x101162]['id'],'interface':_0x3a98ee,'paused':_0x519387[_0x359b('0x98')]||![],'penalty':_0x46fff8[_0x101162]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x337c79,function(_0x714249){return db[_0x359b('0xab')]['upsert'](_0x714249);});}}}})[_0x359b('0x22')](function(){if(_0x519387){return db[_0x359b('0xdf')][_0x359b('0xa3')]({'where':{'membername':_0x519387[_0x359b('0x44')],'exitAt':null}});}})[_0x359b('0x22')](function(_0x30e943){if(_0x519387){var _0x9da148=[];_0x30e943[_0x359b('0xe0')](function(_0x1b6cc0){_0x9da148[_0x359b('0xde')](_0x1b6cc0['update']({'exitAt':moment()[_0x359b('0x6f')](_0x359b('0xe1'))}));});return BPromise['all'](_0x9da148);}})['then'](function(){if(_0x519387){var _0x245e6b=[];var _0x1870f1=[];var _0x296c2f=utils[_0x359b('0xe2')]();var _0xc6be73={'membername':_0x519387['name'],'interface':_0x3a98ee,'enterAt':moment()['format'](_0x359b('0xe1')),'role':_0x519387[_0x359b('0x42')],'internal':_0x519387[_0x359b('0x71')]};_0x296c2f['forEach'](function(_0x3b0198){_0x245e6b[_0x359b('0xde')](_['merge']({'channel':_0x3b0198,'type':_0x359b('0xe3'),'data1':_0x58ebd1[_0x359b('0x68')]['device'],'data2':_0x3a98ee},_0xc6be73));if(_0x519387['loginInPause']){_0x1870f1[_0x359b('0xde')](_[_0x359b('0x5a')]({'channel':_0x3b0198,'type':_0x359b('0xe4'),'data1':_0x359b('0xe5')},_0xc6be73));}});return db[_0x359b('0xdf')][_0x359b('0x67')](_0x245e6b[_0x359b('0xe6')](_0x1870f1),{'individualHooks':!![]});}})['then'](function(){if(_0x519387){return _0x519387[_0x359b('0xe7')]({'online':!![],'lastLoginAt':moment()[_0x359b('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x519387[_0x359b('0x98')]||![],'mailPause':_0x519387[_0x359b('0x98')]||![],'chatPause':_0x519387[_0x359b('0x98')]||![],'faxPause':_0x519387[_0x359b('0x98')]||![],'smsPause':_0x519387[_0x359b('0x98')]||![],'openchannelPause':_0x519387['loginInPause']||![],'whatsappPause':_0x519387['loginInPause']||![],'pauseType':_0x519387[_0x359b('0x98')]?'LOGININPAUSE':null,'interface':_0x3a98ee,'lastPauseAt':moment()[_0x359b('0x6f')](_0x359b('0xe1'))});}})[_0x359b('0x22')](function(_0x48acd5){if(_0x58ebd1[_0x359b('0xe8')]){return _0x2b2a6d();}else{return BPromise[_0x359b('0xe9')](_0x48acd5)[_0x359b('0x22')](respondWithResult(_0x130d7f,null));}})[_0x359b('0x2c')](handleError(_0x130d7f,null));};exports[_0x359b('0xea')]=function(_0x3c1101,_0x3d178f,_0x1edaae){var _0x16a4c5;return db[_0x359b('0x48')]['find']({'where':{'id':_0x3c1101['params']['id'],'role':_0x359b('0x6c')},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x3d178f,null))[_0x359b('0x22')](function(_0x2a3121){if(_0x2a3121){_0x16a4c5=_0x2a3121;return db[_0x359b('0xab')][_0x359b('0x37')]({'where':{'membername':_0x16a4c5['name']},'individualHooks':!![]});}})[_0x359b('0x22')](function(){return db[_0x359b('0xdf')][_0x359b('0xa3')]({'where':{'membername':_0x16a4c5['name'],'exitAt':null}});})[_0x359b('0x22')](function(_0x1cadbc){var _0x2d28c8=[];_0x1cadbc[_0x359b('0xe0')](function(_0x2f94d1){_0x2d28c8[_0x359b('0xde')](_0x2f94d1[_0x359b('0xe7')]({'exitAt':moment()[_0x359b('0x6f')](_0x359b('0xe1'))}));});return BPromise[_0x359b('0xeb')](_0x2d28c8);})[_0x359b('0x22')](function(){return _0x16a4c5[_0x359b('0xe7')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3d178f,null))[_0x359b('0x2c')](handleError(_0x3d178f,null));};exports[_0x359b('0xec')]=function(_0x53016b,_0xf5e774,_0x3a37d1){var _0x1dc8f3;return db[_0x359b('0xab')]['update']({'paused':0x1},{'where':{'UserId':_0x53016b[_0x359b('0x63')]['id']},'individualHooks':!![]})[_0x359b('0x22')](function(){return db['User'][_0x359b('0x43')]({'where':{'id':_0x53016b[_0x359b('0x63')]['id'],'role':'agent'},'attributes':['id','name',_0x359b('0x42'),'internal','interface']});})[_0x359b('0x22')](handleEntityNotFound(_0xf5e774,null))[_0x359b('0x22')](function(_0x4967fd){if(_0x4967fd){_0x1dc8f3=_0x4967fd;return respondWithRpcPromise(_0x359b('0xed'),'pause',{'id':_0x1dc8f3['id'],'name':_0x1dc8f3[_0x359b('0x44')],'pause':!![]});}})['then'](function(){if(_0x1dc8f3){return db[_0x359b('0xdf')][_0x359b('0xa3')]({'where':{'membername':_0x1dc8f3[_0x359b('0x44')],'type':_0x359b('0xe4'),'exitAt':null}});}})['then'](function(_0x3e4d8e){if(_0x3e4d8e[_0x359b('0x66')]){var _0x1dce8a=moment()['format'](_0x359b('0xe1'));for(var _0x2115ad=0x0,_0x4d6c94=_0x3e4d8e[_0x359b('0x66')];_0x2115ad<_0x4d6c94;_0x2115ad++){_0x3e4d8e[_0x2115ad][_0x359b('0xee')]({'exitAt':_0x1dce8a});}}})['then'](function(){var _0x1dbbd5=[];var _0xb4ab1=utils['getChannels']();_0xb4ab1[_0x359b('0xe0')](function(_0x369caa){_0x1dbbd5[_0x359b('0xde')]({'channel':_0x369caa,'membername':_0x1dc8f3[_0x359b('0x44')],'interface':_[_0x359b('0x77')](_0x1dc8f3[_0x359b('0xa6')])?util['format'](_0x359b('0xa5'),_0x1dc8f3[_0x359b('0x44')]):_0x1dc8f3[_0x359b('0xa6')],'type':_0x359b('0xe4'),'enterAt':moment()[_0x359b('0x6f')](_0x359b('0xe1')),'data1':_0x53016b[_0x359b('0x68')][_0x359b('0x4b')]||_0x359b('0xef'),'role':_0x1dc8f3[_0x359b('0x42')],'internal':_0x1dc8f3[_0x359b('0x71')]});});return db['MemberReport'][_0x359b('0x67')](_0x1dbbd5,{'individualHooks':!![]});})[_0x359b('0x22')](function(){return _0x1dc8f3['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x53016b[_0x359b('0x68')][_0x359b('0x4b')]||_0x359b('0xef'),'lastPauseAt':moment()[_0x359b('0x6f')](_0x359b('0xe1'))});})[_0x359b('0x22')](respondWithResult(_0xf5e774,null))[_0x359b('0x2c')](handleError(_0xf5e774,null));};exports[_0x359b('0xf0')]=function(_0x12f879,_0x3a00cd,_0x4b7793){var _0x3ec7e8;return db[_0x359b('0x48')][_0x359b('0x43')]({'where':{'id':_0x12f879[_0x359b('0x63')]['id']},'attributes':['id',_0x359b('0x44'),'role',_0x359b('0x99'),_0x359b('0xf1'),_0x359b('0xf2'),'faxPause','openchannelPause',_0x359b('0xf3'),_0x359b('0xf4'),_0x359b('0xf5'),_0x359b('0xf6')]})[_0x359b('0x22')](handleEntityNotFound(_0x3a00cd,null))['then'](function(_0x5b4732){if(_0x5b4732){_0x3ec7e8=_0x5b4732;if(_0x12f879[_0x359b('0x68')][_0x359b('0x96')]&&!utils['isValidChannel'](_0x12f879[_0x359b('0x68')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x359b('0x9b'));}switch(_0x12f879[_0x359b('0x68')][_0x359b('0x96')]){case _0x359b('0xa4'):return respondWithRpcPromise('QueuePause',_0x359b('0xf0'),{'id':_0x3ec7e8['id'],'name':_0x3ec7e8[_0x359b('0x44')],'pause':![]})[_0x359b('0x22')](function(){return db[_0x359b('0xab')][_0x359b('0xe7')]({'paused':0x0},{'where':{'UserId':_0x3ec7e8['id']},'individualHooks':!![]});})[_0x359b('0x22')](function(){return db[_0x359b('0xdf')][_0x359b('0x43')]({'where':{'channel':_0x12f879['body'][_0x359b('0x96')],'membername':_0x3ec7e8['name'],'type':'PAUSE','exitAt':null}});})['then'](function(_0x495f1a){if(_0x495f1a){return _0x495f1a[_0x359b('0xe7')]({'exitAt':moment()['format'](_0x359b('0xe1')),'data2':_0x359b('0xf7')},{'individualHooks':!![]});}return null;})[_0x359b('0x22')](function(){return _0x3ec7e8['update']({'voicePause':![]});});case _0x359b('0xf8'):case'chat':case _0x359b('0xf9'):case _0x359b('0xfa'):case _0x359b('0xfb'):case _0x359b('0xfc'):return db[_0x359b('0xdf')][_0x359b('0x43')]({'where':{'channel':_0x12f879[_0x359b('0x68')][_0x359b('0x96')],'membername':_0x3ec7e8[_0x359b('0x44')],'type':_0x359b('0xe4'),'exitAt':null}})[_0x359b('0x22')](function(_0x31f7fd){if(_0x31f7fd){return _0x31f7fd[_0x359b('0xe7')]({'exitAt':moment()[_0x359b('0x6f')](_0x359b('0xe1')),'data2':_0x359b('0xf7')},{'individualHooks':!![]});}return null;})[_0x359b('0x22')](function(){var _0x1fec66={};_[_0x359b('0x34')](_0x1fec66,util[_0x359b('0x6f')](_0x359b('0xfd'),_0x12f879['body']['channel'],'Pause'),![]);return _0x3ec7e8[_0x359b('0xe7')](_0x1fec66);});default:return respondWithRpcPromise('QueuePause',_0x359b('0xf0'),{'id':_0x3ec7e8['id'],'name':_0x3ec7e8[_0x359b('0x44')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x359b('0xe7')]({'paused':0x0},{'where':{'UserId':_0x3ec7e8['id']}});})['then'](function(){return db[_0x359b('0xdf')]['findAll']({'where':{'membername':_0x3ec7e8[_0x359b('0x44')],'type':_0x359b('0xe4'),'exitAt':null}});})['then'](function(_0x50bdc8){var _0x4e759b=[];_0x50bdc8[_0x359b('0xe0')](function(_0x450ac0){_0x4e759b[_0x359b('0xde')](_0x450ac0[_0x359b('0xe7')]({'exitAt':moment()[_0x359b('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x359b('0xf7')}));});return BPromise[_0x359b('0xeb')](_0x4e759b);})[_0x359b('0x22')](function(){return _0x3ec7e8[_0x359b('0xe7')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x359b('0x22')](respondWithResult(_0x3a00cd,null))[_0x359b('0x2c')](handleError(_0x3a00cd,null));};exports[_0x359b('0xfe')]=function(_0x255ade,_0x4236fd,_0x16dc8a){var _0x2f7c11={};var _0x570e32={};var _0x1d8a68;var _0xf25a35;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x255ade[_0x359b('0x63')]['id']}})['then'](handleEntityNotFound(_0x4236fd,null))[_0x359b('0x22')](function(_0x5678dd){if(_0x5678dd){_0x1d8a68=_0x5678dd;_0x570e32[_0x359b('0x4d')]=_[_0x359b('0x64')](db['Team'][_0x359b('0x49')]);_0x570e32['query']=_[_0x359b('0x64')](_0x255ade[_0x359b('0x50')]);_0x570e32['filters']=_[_0x359b('0x52')](_0x570e32[_0x359b('0x4d')],_0x570e32[_0x359b('0x50')]);_0x2f7c11[_0x359b('0x53')]=_[_0x359b('0x52')](_0x570e32['model'],qs[_0x359b('0x54')](_0x255ade[_0x359b('0x50')][_0x359b('0x54')]));_0x2f7c11[_0x359b('0x53')]=_0x2f7c11[_0x359b('0x53')][_0x359b('0x66')]?_0x2f7c11[_0x359b('0x53')]:_0x570e32[_0x359b('0x4d')];_0x2f7c11[_0x359b('0x57')]=qs[_0x359b('0x58')](_0x255ade[_0x359b('0x50')][_0x359b('0x58')]);_0x2f7c11[_0x359b('0x59')]=qs['filters'](_['pick'](_0x255ade[_0x359b('0x50')],_0x570e32[_0x359b('0x51')]));if(_0x255ade[_0x359b('0x50')][_0x359b('0x3d')]){_0x2f7c11[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x2f7c11[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x2f7c11[_0x359b('0x53')],function(_0xdf4128){var _0x1724b2={};_0x1724b2[_0xdf4128]={'$like':'%'+_0x255ade[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x1724b2;})});}_0x2f7c11=_[_0x359b('0x5a')]({},_0x2f7c11,_0x255ade[_0x359b('0x5e')]);return _0x1d8a68[_0x359b('0xfe')](_0x2f7c11);}})[_0x359b('0x22')](function(_0x5f4f85){if(_0x5f4f85){_0xf25a35=_0x5f4f85[_0x359b('0x66')];if(!_0x255ade[_0x359b('0x50')]['hasOwnProperty'](_0x359b('0x56'))){_0x2f7c11[_0x359b('0x33')]=qs[_0x359b('0x33')](_0x255ade[_0x359b('0x50')]['limit']);_0x2f7c11['offset']=qs['offset'](_0x255ade[_0x359b('0x50')]['offset']);}return _0x1d8a68[_0x359b('0xfe')](_0x2f7c11);}})[_0x359b('0x22')](function(_0x31d8a6){if(_0x31d8a6){return _0x31d8a6?{'count':_0xf25a35,'rows':_0x31d8a6}:null;}})[_0x359b('0x22')](respondWithResult(_0x4236fd,null))['catch'](handleError(_0x4236fd,null));};exports[_0x359b('0xff')]=function(_0x53e941,_0x39da40){return db['User'][_0x359b('0x43')]({'where':{'id':_0x53e941[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x39da40,null))[_0x359b('0x22')](function(_0x6e8c1b){if(_0x6e8c1b){var _0x45e517=_0x6e8c1b[_0x359b('0x38')]({'plain':!![]});return _0x6e8c1b[_0x359b('0xff')](_0x53e941['body']['ids'],_['omit'](_0x53e941['body'],['ids','id'])||{})[_0x359b('0x22')](function(){for(var _0xb4a895=0x0;_0xb4a895<_0x53e941[_0x359b('0x68')][_0x359b('0x6b')][_0x359b('0x66')];_0xb4a895++){var _0x38ab8e=[];db[_0x359b('0x100')][_0x359b('0xb7')]({'where':{'id':_0x53e941[_0x359b('0x68')][_0x359b('0x6b')][_0xb4a895]}})[_0x359b('0x22')](function(_0x30c9aa){_0x38ab8e['push'](_0x30c9aa[_0x359b('0x101')]()[_0x359b('0x22')](function(_0x55df21){for(var _0x3f8698=0x0;_0x3f8698<_0x55df21['length'];_0x3f8698++){_0x55df21[_0x3f8698][_0x359b('0x102')](_0x359b('0x96'),_0x359b('0x103'));}return _0x55df21;}));_0x38ab8e[_0x359b('0xde')](_0x30c9aa[_0x359b('0x104')]()['then'](function(_0x120840){for(var _0x570986=0x0;_0x570986<_0x120840['length'];_0x570986++){_0x120840[_0x570986][_0x359b('0x102')]('channel',_0x359b('0x105'));}return _0x120840;}));_0x38ab8e[_0x359b('0xde')](_0x30c9aa['getMailQueues']()[_0x359b('0x22')](function(_0x1a6dd7){for(var _0x265174=0x0;_0x265174<_0x1a6dd7[_0x359b('0x66')];_0x265174++){_0x1a6dd7[_0x265174][_0x359b('0x102')](_0x359b('0x96'),_0x359b('0x106'));}return _0x1a6dd7;}));_0x38ab8e['push'](_0x30c9aa[_0x359b('0x107')]()['then'](function(_0x10b607){for(var _0x4b9ea4=0x0;_0x4b9ea4<_0x10b607[_0x359b('0x66')];_0x4b9ea4++){_0x10b607[_0x4b9ea4][_0x359b('0x102')](_0x359b('0x96'),'Sms');}return _0x10b607;}));_0x38ab8e[_0x359b('0xde')](_0x30c9aa[_0x359b('0x108')]()['then'](function(_0x2b9478){for(var _0x485c1d=0x0;_0x485c1d<_0x2b9478[_0x359b('0x66')];_0x485c1d++){_0x2b9478[_0x485c1d]['setDataValue'](_0x359b('0x96'),_0x359b('0x109'));}return _0x2b9478;}));_0x38ab8e[_0x359b('0xde')](_0x30c9aa['getFaxQueues']()[_0x359b('0x22')](function(_0xf897f7){for(var _0x582289=0x0;_0x582289<_0xf897f7[_0x359b('0x66')];_0x582289++){_0xf897f7[_0x582289]['setDataValue'](_0x359b('0x96'),'Fax');}return _0xf897f7;}));_0x38ab8e[_0x359b('0xde')](_0x30c9aa['getOpenchannelQueues']()[_0x359b('0x22')](function(_0x500b9e){for(var _0x1027bb=0x0;_0x1027bb<_0x500b9e['length'];_0x1027bb++){_0x500b9e[_0x1027bb][_0x359b('0x102')](_0x359b('0x96'),'Openchannel');}return _0x500b9e;}));return BPromise[_0x359b('0xeb')](_0x38ab8e);})[_0x359b('0x22')](function(_0x3ffb4b){var _0x4cd4f1=_[_0x359b('0x10a')](_0x3ffb4b);_0x38ab8e=[];return db[_0x359b('0x5b')]['transaction'](function(_0x5cce4b){for(var _0x3eb4f5=0x0;_0x3eb4f5<_0x4cd4f1[_0x359b('0x66')];_0x3eb4f5++){_0x38ab8e['push'](_0x4cd4f1[_0x3eb4f5][_0x359b('0x10b')](_0x45e517['id']),{'transaction':_0x5cce4b});}return BPromise[_0x359b('0xeb')](_0x38ab8e)[_0x359b('0x22')](function(){if(_0x45e517[_0x359b('0x97')]){return BPromise['each'](_['filter'](_0x4cd4f1,function(_0x5afae0){return _0x5afae0['getDataValue'](_0x359b('0x96'))===_0x359b('0x103');}),function(_0x2da3c6){return db[_0x359b('0xab')][_0x359b('0x10c')]({'membername':_0x45e517['name'],'UserId':_0x45e517['id'],'queue_name':_0x2da3c6['name'],'VoiceQueueId':_0x2da3c6['id'],'interface':_[_0x359b('0x77')](_0x45e517[_0x359b('0xa6')])?util[_0x359b('0x6f')](_0x359b('0xa5'),_0x45e517['name']):_0x45e517[_0x359b('0xa6')],'paused':_0x45e517[_0x359b('0x99')]||![],'penalty':_0x45e517[_0x359b('0x9e')]},{'transaction':_0x5cce4b});});}else{return;}})[_0x359b('0x22')](function(){for(var _0x26b072=0x0;_0x26b072<_0x4cd4f1[_0x359b('0x66')];_0x26b072++){var _0x58fc1e=_0x4cd4f1[_0x26b072]['getDataValue'](_0x359b('0x96'));var _0x4ea670=_0x58fc1e+'QueueId';socket[_0x359b('0xa1')](_0x359b('0x3a')+_0x58fc1e+_0x359b('0xa2'),{'UserId':_0x45e517['id'],['queueField']:_0x4cd4f1[_0x26b072]['id']});}});});});}});}})[_0x359b('0x22')](respondWithStatusCode(_0x39da40,null))[_0x359b('0x2c')](handleError(_0x39da40,null));};exports['removeTeams']=function(_0x22a75b,_0x2d6c70){return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x22a75b[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x2d6c70,null))[_0x359b('0x22')](function(_0x4acde3){if(_0x4acde3){var _0x1035fd=_0x4acde3[_0x359b('0x38')]({'plain':!![]});var _0x3c1a17=_0x22a75b[_0x359b('0x50')][_0x359b('0x6b')];return _0x4acde3[_0x359b('0x10d')](_0x3c1a17)[_0x359b('0x22')](function(){for(var _0x305799=0x0;_0x305799<_0x3c1a17[_0x359b('0x66')];_0x305799++){var _0x35f4af=[];db[_0x359b('0x100')]['findOne']({'where':{'id':_0x3c1a17[_0x305799]}})['then'](function(_0x5e4739){_0x35f4af[_0x359b('0xde')](_0x5e4739['getVoiceQueues']()[_0x359b('0x22')](function(_0x3b7747){for(var _0x4ecddd=0x0;_0x4ecddd<_0x3b7747[_0x359b('0x66')];_0x4ecddd++){_0x3b7747[_0x4ecddd][_0x359b('0x102')](_0x359b('0x96'),_0x359b('0x103'));}return _0x3b7747;}));_0x35f4af[_0x359b('0xde')](_0x5e4739[_0x359b('0x104')]()['then'](function(_0x4fdf3e){for(var _0x5939d0=0x0;_0x5939d0<_0x4fdf3e[_0x359b('0x66')];_0x5939d0++){_0x4fdf3e[_0x5939d0][_0x359b('0x102')]('channel','Chat');}return _0x4fdf3e;}));_0x35f4af[_0x359b('0xde')](_0x5e4739[_0x359b('0x10e')]()[_0x359b('0x22')](function(_0x5d1078){for(var _0x3ba6a4=0x0;_0x3ba6a4<_0x5d1078['length'];_0x3ba6a4++){_0x5d1078[_0x3ba6a4]['setDataValue'](_0x359b('0x96'),_0x359b('0x106'));}return _0x5d1078;}));_0x35f4af[_0x359b('0xde')](_0x5e4739[_0x359b('0x107')]()['then'](function(_0x4a40b5){for(var _0x1ea52d=0x0;_0x1ea52d<_0x4a40b5[_0x359b('0x66')];_0x1ea52d++){_0x4a40b5[_0x1ea52d]['setDataValue'](_0x359b('0x96'),_0x359b('0x10f'));}return _0x4a40b5;}));_0x35f4af[_0x359b('0xde')](_0x5e4739[_0x359b('0x108')]()[_0x359b('0x22')](function(_0x4eacb3){for(var _0x5c9979=0x0;_0x5c9979<_0x4eacb3[_0x359b('0x66')];_0x5c9979++){_0x4eacb3[_0x5c9979][_0x359b('0x102')](_0x359b('0x96'),'Whatsapp');}return _0x4eacb3;}));_0x35f4af[_0x359b('0xde')](_0x5e4739[_0x359b('0x110')]()[_0x359b('0x22')](function(_0x589484){for(var _0x2ff386=0x0;_0x2ff386<_0x589484['length'];_0x2ff386++){_0x589484[_0x2ff386][_0x359b('0x102')](_0x359b('0x96'),_0x359b('0x111'));}return _0x589484;}));_0x35f4af[_0x359b('0xde')](_0x5e4739[_0x359b('0x112')]()[_0x359b('0x22')](function(_0x39c0f6){for(var _0x383808=0x0;_0x383808<_0x39c0f6[_0x359b('0x66')];_0x383808++){_0x39c0f6[_0x383808][_0x359b('0x102')](_0x359b('0x96'),_0x359b('0x113'));}return _0x39c0f6;}));return BPromise['all'](_0x35f4af);})['then'](function(_0x331cb0){var _0x1ce98b=_[_0x359b('0x10a')](_0x331cb0);_0x35f4af=[];return db['sequelize'][_0x359b('0x114')](function(_0x733959){for(var _0x12e619=0x0;_0x12e619<_0x1ce98b[_0x359b('0x66')];_0x12e619++){_0x35f4af['push'](_0x1ce98b[_0x12e619][_0x359b('0x115')](_0x1035fd['id']),{'transaction':_0x733959});}return BPromise['all'](_0x35f4af)[_0x359b('0x22')](function(){if(_0x1035fd[_0x359b('0x97')]){return BPromise['each'](_[_0x359b('0x3d')](_0x1ce98b,function(_0x53f15a){return _0x53f15a[_0x359b('0x116')](_0x359b('0x96'))==='Voice';}),function(_0x378bc8){return db[_0x359b('0xab')][_0x359b('0x37')]({'where':{'VoiceQueueId':_0x378bc8['id'],'UserId':_0x1035fd['id']},'transaction':_0x733959});});}else{return;}})[_0x359b('0x22')](function(){for(var _0x47ceb9=0x0;_0x47ceb9<_0x1ce98b[_0x359b('0x66')];_0x47ceb9++){var _0x44e7f6=_0x1ce98b[_0x47ceb9][_0x359b('0x116')](_0x359b('0x96'));var _0x49ed15=_0x44e7f6+_0x359b('0xaa');socket[_0x359b('0xa1')](_0x359b('0x3a')+_0x44e7f6+_0x359b('0x117'),{'UserId':_0x1035fd['id'],['queueField']:_0x1ce98b[_0x47ceb9]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x2d6c70,null))['catch'](handleError(_0x2d6c70,null));};exports[_0x359b('0x118')]=function(_0x4254fd,_0x1ca289,_0x200e40){var _0x10a69f={};var _0x5705b6={};var _0x75faf6;var _0x5d9e6c;return db[_0x359b('0x48')][_0x359b('0xb7')]({'where':{'id':_0x4254fd[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x1ca289,null))[_0x359b('0x22')](function(_0xb9b80f){if(_0xb9b80f){_0x75faf6=_0xb9b80f;_0x5705b6[_0x359b('0x4d')]=_['keys'](db[_0x359b('0x119')][_0x359b('0x49')]);_0x5705b6['query']=_['keys'](_0x4254fd['query']);_0x5705b6[_0x359b('0x51')]=_['intersection'](_0x5705b6[_0x359b('0x4d')],_0x5705b6['query']);_0x10a69f[_0x359b('0x53')]=_[_0x359b('0x52')](_0x5705b6[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x4254fd[_0x359b('0x50')]['fields']));_0x10a69f[_0x359b('0x53')]=_0x10a69f[_0x359b('0x53')][_0x359b('0x66')]?_0x10a69f['attributes']:_0x5705b6[_0x359b('0x4d')];_0x10a69f['order']=qs['sort'](_0x4254fd[_0x359b('0x50')][_0x359b('0x58')]);_0x10a69f[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x4254fd[_0x359b('0x50')],_0x5705b6[_0x359b('0x51')]));if(_0x4254fd[_0x359b('0x50')][_0x359b('0x3d')]){_0x10a69f[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x10a69f['where'],{'$or':_[_0x359b('0x3f')](_0x10a69f[_0x359b('0x53')],function(_0x307574){var _0x1deeb4={};_0x1deeb4[_0x307574]={'$like':'%'+_0x4254fd[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x1deeb4;})});}_0x10a69f=_['merge']({},_0x10a69f,_0x4254fd['options']);return _0x75faf6[_0x359b('0x118')](_0x10a69f);}})[_0x359b('0x22')](function(_0x4e80cb){if(_0x4e80cb){_0x5d9e6c=_0x4e80cb[_0x359b('0x66')];if(!_0x4254fd['query'][_0x359b('0x55')]('nolimit')){_0x10a69f['limit']=qs[_0x359b('0x33')](_0x4254fd['query'][_0x359b('0x33')]);_0x10a69f[_0x359b('0x32')]=qs[_0x359b('0x32')](_0x4254fd[_0x359b('0x50')][_0x359b('0x32')]);}return _0x75faf6[_0x359b('0x118')](_0x10a69f);}})[_0x359b('0x22')](function(_0x5c3a09){if(_0x5c3a09){return _0x5c3a09?{'count':_0x5d9e6c,'rows':_0x5c3a09}:null;}})[_0x359b('0x22')](respondWithResult(_0x1ca289,null))['catch'](handleError(_0x1ca289,null));};exports[_0x359b('0x11a')]=function(_0x287bc9,_0x5d8c83,_0x49cb73){var _0x13f0f2={};var _0x1fda53={};var _0x4433c7;var _0x336966;return db['User'][_0x359b('0xb7')]({'where':{'id':_0x287bc9[_0x359b('0x63')]['id']}})[_0x359b('0x22')](handleEntityNotFound(_0x5d8c83,null))['then'](function(_0xff8a54){if(_0xff8a54){_0x4433c7=_0xff8a54;_0x1fda53[_0x359b('0x4d')]=_[_0x359b('0x64')](db[_0x359b('0x48')][_0x359b('0x49')]);_0x1fda53[_0x359b('0x50')]=_[_0x359b('0x64')](_0x287bc9[_0x359b('0x50')]);_0x1fda53['filters']=_[_0x359b('0x52')](_0x1fda53['model'],_0x1fda53[_0x359b('0x50')]);_0x13f0f2[_0x359b('0x53')]=_[_0x359b('0x52')](_0x1fda53[_0x359b('0x4d')],qs[_0x359b('0x54')](_0x287bc9[_0x359b('0x50')][_0x359b('0x54')]));_0x13f0f2[_0x359b('0x53')]=_0x13f0f2['attributes'][_0x359b('0x66')]?_0x13f0f2['attributes']:_0x1fda53[_0x359b('0x4d')];_0x13f0f2['order']=qs[_0x359b('0x58')](_0x287bc9[_0x359b('0x50')][_0x359b('0x58')]);_0x13f0f2[_0x359b('0x59')]=qs[_0x359b('0x51')](_[_0x359b('0xb9')](_0x287bc9[_0x359b('0x50')],_0x1fda53['filters']));if(_0x287bc9[_0x359b('0x50')][_0x359b('0x3d')]){_0x13f0f2[_0x359b('0x59')]=_[_0x359b('0x5a')](_0x13f0f2[_0x359b('0x59')],{'$or':_[_0x359b('0x3f')](_0x13f0f2[_0x359b('0x53')],function(_0x4feeca){var _0x4c28d3={};_0x4c28d3[_0x4feeca]={'$like':'%'+_0x287bc9[_0x359b('0x50')][_0x359b('0x3d')]+'%'};return _0x4c28d3;})});}_0x13f0f2[_0x359b('0x4d')]=db[_0x359b('0x48')];_0x13f0f2['as']=_0x359b('0x8c');_0x13f0f2=_[_0x359b('0x5a')]({},_0x13f0f2,_0x287bc9[_0x359b('0x5e')]);return _0x4433c7[_0x359b('0x101')]({'include':[_0x13f0f2]});}})[_0x359b('0x22')](function(_0x28629a){if(_0x28629a){var _0xecc4ef={},_0x126deb=[],_0x24d050=0x0;for(var _0x4f90c2=0x0;_0x4f90c2<_0x28629a[_0x359b('0x66')];_0x4f90c2+=0x1){for(var _0x195dfa=0x0,_0x4772ea;_0x195dfa<_0x28629a[_0x4f90c2][_0x359b('0x8c')][_0x359b('0x66')];_0x195dfa+=0x1){_0x4772ea=_0x28629a[_0x4f90c2][_0x359b('0x8c')][_0x195dfa][_0x359b('0x38')]({'plain':!![]});_0xecc4ef[_0x4772ea['id']]=_0x4772ea;}}_0xecc4ef=_[_0x359b('0x11b')](_0xecc4ef);for(var _0x3602fd=qs[_0x359b('0x32')](_0x287bc9[_0x359b('0x50')]['offset']);_0x3602fd<_0xecc4ef[_0x359b('0x66')]&&_0x126deb[_0x359b('0x66')]=_0xe2259d[_0xa930('0x51')]){throw new Error(_0xa930('0x52'));}})['then'](function(){if(_0x480d7e){return db[_0xa930('0x2c')]['destroy']({'where':{'membername':_0x480d7e[_0xa930('0x28')]},'individualHooks':!![]});}})[_0xa930('0x10')](function(){if(_0x480d7e){return _0x480d7e[_0xa930('0x53')]({'raw':!![]});}})[_0xa930('0x10')](function(_0x2027df){if(_0x480d7e){if(_0x2027df){var _0xb73daf=[];_0x5f3e24=_0x2027df;if(_0x5f3e24['length']){for(var _0x11495d=0x0;_0x11495d<_0x5f3e24[_0xa930('0x4a')];_0x11495d++){_0xb73daf[_0xa930('0x33')](db[_0xa930('0x2c')][_0xa930('0x54')]({'membername':_0x480d7e[_0xa930('0x28')],'UserId':_0x480d7e['id'],'queue_name':_0x5f3e24[_0x11495d]['name'],'VoiceQueueId':_0x5f3e24[_0x11495d]['id'],'interface':_0x2ba686,'paused':_0x480d7e[_0xa930('0x4f')]||![],'penalty':_0x5f3e24[_0x11495d]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0xb73daf);}}}})[_0xa930('0x10')](function(){if(_0x480d7e){return db[_0xa930('0x2e')][_0xa930('0x46')]({'where':{'membername':_0x480d7e[_0xa930('0x28')],'exitAt':null}});}})['then'](function(_0xeeb54e){if(_0x480d7e){if(_0xeeb54e&&_0xeeb54e['length']){var _0x27525f=[];_0xeeb54e['forEach'](function(_0x440dd0){_0x27525f[_0xa930('0x33')](_0x440dd0[_0xa930('0x2d')]({'exitAt':moment()[_0xa930('0x30')](_0xa930('0x31'))}));});return BPromise[_0xa930('0x47')](_0x27525f);}}})[_0xa930('0x10')](function(_0x3f014b){if(_0x480d7e){var _0x207748=[];var _0x5e9ba3=[];var _0x23193a=utils['getChannels']();var _0x5b810f={'membername':_0x480d7e[_0xa930('0x28')],'interface':_0x2ba686,'enterAt':moment()[_0xa930('0x30')](_0xa930('0x31')),'role':_0x480d7e[_0xa930('0x29')],'internal':_0x480d7e['internal']};_0x23193a[_0xa930('0x4b')](function(_0x2a354f){_0x207748['push'](_[_0xa930('0x55')]({'channel':_0x2a354f,'type':'LOGIN','data1':_0xa930('0x56'),'data2':_0x2ba686},_0x5b810f));if(_0x480d7e['loginInPause']){_0x5e9ba3['push'](_[_0xa930('0x55')]({'channel':_0x2a354f,'type':_0xa930('0x2f'),'data1':_0xa930('0x57')},_0x5b810f));}});return db[_0xa930('0x2e')][_0xa930('0x38')](_0x207748['concat'](_0x5e9ba3),{'individualHooks':!![]});}})['then'](function(){if(_0x480d7e){return _0x480d7e[_0xa930('0x2d')]({'online':!![],'lastLoginAt':moment()[_0xa930('0x30')](_0xa930('0x31')),'voicePause':_0x480d7e[_0xa930('0x4f')]||![],'mailPause':_0x480d7e[_0xa930('0x4f')]||![],'chatPause':_0x480d7e['loginInPause']||![],'faxPause':_0x480d7e[_0xa930('0x4f')]||![],'smsPause':_0x480d7e[_0xa930('0x4f')]||![],'openchannelPause':_0x480d7e[_0xa930('0x4f')]||![],'pauseType':_0x480d7e[_0xa930('0x4f')]?_0xa930('0x57'):null,'lastPauseAt':moment()[_0xa930('0x30')](_0xa930('0x31')),'interface':_0x2ba686});}})[_0xa930('0x10')](function(_0x2291af){_0x20ccba(_0x2291af);})[_0xa930('0x18')](function(_0x1988cd){_0x5d3bda(_0x5b3381['error'](0x1f4,_0x1988cd[_0xa930('0x16')]));});});}; \ No newline at end of file +var _0x3e26=['agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','bulkCreate','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetUser','User','findAll','options','raw','where','attributes','include','model','map','ShowUser','find','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','format','YYYY-MM-DD\x20HH:mm:ss','length','forEach','push','isNil','SIP/%s','PAUSE','body','type','DEFAULT\x20PAUSE','uniqueid','findOne','channel','Unknown\x20channel','voice','mail','fax','sms','openchannel','set','%s%s','Pause','system','all','destroy','LoginUser','mobile','phone','loginInPause','count'];(function(_0x10bbf8,_0x3fbe8c){var _0x3b38c3=function(_0x4c57ff){while(--_0x4c57ff){_0x10bbf8['push'](_0x10bbf8['shift']());}};_0x3b38c3(++_0x3fbe8c);}(_0x3e26,0x174));var _0x63e2=function(_0x3ae5fa,_0x1647b8){_0x3ae5fa=_0x3ae5fa-0x0;var _0x5a30e5=_0x3e26[_0x3ae5fa];return _0x5a30e5;};'use strict';var _=require('lodash');var util=require(_0x63e2('0x0'));var moment=require(_0x63e2('0x1'));var BPromise=require(_0x63e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x63e2('0x3'));var db=require(_0x63e2('0x4'))['db'];var utils=require(_0x63e2('0x5'));var logger=require(_0x63e2('0x6'))(_0x63e2('0x7'));var config=require(_0x63e2('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x63e2('0x9')]({'port':0x232a});config[_0x63e2('0xa')]=_[_0x63e2('0xb')](config['redis'],{'host':_0x63e2('0xc'),'port':0x18eb});var socket=require(_0x63e2('0xd'))(new Redis(config[_0x63e2('0xa')]));require(_0x63e2('0xe'))[_0x63e2('0xf')](socket);function respondWithRpcPromise(_0x50b76c,_0x559bcf,_0x539274){return new BPromise(function(_0x35dd23,_0x5a8097){return client[_0x63e2('0x10')](_0x50b76c,_0x539274)[_0x63e2('0x11')](function(_0x24fc07){logger[_0x63e2('0x12')](_0x63e2('0x13'),_0x559bcf,_0x63e2('0x14'));logger[_0x63e2('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x559bcf,_0x63e2('0x14'),JSON[_0x63e2('0x16')](_0x24fc07));if(_0x24fc07['error']){if(_0x24fc07[_0x63e2('0x17')][_0x63e2('0x18')]===0x1f4){logger[_0x63e2('0x17')](_0x63e2('0x13'),_0x559bcf,_0x24fc07[_0x63e2('0x17')]['message']);return _0x5a8097(_0x24fc07['error'][_0x63e2('0x19')]);}logger['error'](_0x63e2('0x13'),_0x559bcf,_0x24fc07[_0x63e2('0x17')]['message']);return _0x35dd23(_0x24fc07[_0x63e2('0x17')][_0x63e2('0x19')]);}else{logger[_0x63e2('0x12')](_0x63e2('0x13'),_0x559bcf,_0x63e2('0x14'));_0x35dd23(_0x24fc07[_0x63e2('0x1a')][_0x63e2('0x19')]);}})[_0x63e2('0x1b')](function(_0x54f4e4){logger[_0x63e2('0x17')]('User,\x20%s,\x20%s',_0x559bcf,_0x54f4e4);_0x5a8097(_0x54f4e4);});});}exports[_0x63e2('0x1c')]=function(_0x1bc419){var _0x3e175c=this;return new Promise(function(_0x4f3015,_0x4c5f3e){return db[_0x63e2('0x1d')][_0x63e2('0x1e')]({'raw':_0x1bc419['options']?_0x1bc419[_0x63e2('0x1f')][_0x63e2('0x20')]===undefined?!![]:![]:!![],'where':_0x1bc419[_0x63e2('0x1f')]?_0x1bc419[_0x63e2('0x1f')][_0x63e2('0x21')]||null:null,'attributes':_0x1bc419[_0x63e2('0x1f')]?_0x1bc419['options'][_0x63e2('0x22')]||null:null,'limit':_0x1bc419[_0x63e2('0x1f')]?_0x1bc419[_0x63e2('0x1f')]['limit']||null:null,'include':_0x1bc419[_0x63e2('0x1f')]?_0x1bc419['options'][_0x63e2('0x23')]?_['map'](_0x1bc419['options'][_0x63e2('0x23')],function(_0x4206bb){return{'model':db[_0x4206bb[_0x63e2('0x24')]],'as':_0x4206bb['as'],'attributes':_0x4206bb['attributes'],'include':_0x4206bb[_0x63e2('0x23')]?_['map'](_0x4206bb['include'],function(_0x59cb9e){return{'model':db[_0x59cb9e['model']],'as':_0x59cb9e['as'],'attributes':_0x59cb9e[_0x63e2('0x22')],'include':_0x59cb9e[_0x63e2('0x23')]?_[_0x63e2('0x25')](_0x59cb9e['include'],function(_0x4fd6dc){return{'model':db[_0x4fd6dc[_0x63e2('0x24')]],'as':_0x4fd6dc['as'],'attributes':_0x4fd6dc[_0x63e2('0x22')]};}):[]};}):[]};}):[]:[]})[_0x63e2('0x11')](function(_0x25c6dd){logger['info']('GetUser',_0x1bc419);logger[_0x63e2('0x15')](_0x63e2('0x1c'),_0x1bc419,JSON[_0x63e2('0x16')](_0x25c6dd));_0x4f3015(_0x25c6dd);})[_0x63e2('0x1b')](function(_0x4c5592){logger['error'](_0x63e2('0x1c'),_0x4c5592[_0x63e2('0x19')],_0x1bc419);_0x4c5f3e(_0x3e175c[_0x63e2('0x17')](0x1f4,_0x4c5592[_0x63e2('0x19')]));});});};exports[_0x63e2('0x26')]=function(_0x47be41){var _0x100639=this;return new Promise(function(_0x45c8ab,_0xd6a875){return db[_0x63e2('0x1d')][_0x63e2('0x27')]({'raw':_0x47be41['options']?_0x47be41['options'][_0x63e2('0x20')]===undefined?!![]:![]:!![],'where':_0x47be41[_0x63e2('0x1f')]?_0x47be41[_0x63e2('0x1f')][_0x63e2('0x21')]||null:null,'attributes':_0x47be41[_0x63e2('0x1f')]?_0x47be41[_0x63e2('0x1f')]['attributes']||null:null,'include':_0x47be41[_0x63e2('0x1f')]?_0x47be41[_0x63e2('0x1f')][_0x63e2('0x23')]?_['map'](_0x47be41['options']['include'],function(_0x2d6671){return{'model':db[_0x2d6671[_0x63e2('0x24')]],'as':_0x2d6671['as'],'attributes':_0x2d6671[_0x63e2('0x22')],'include':_0x2d6671['include']?_[_0x63e2('0x25')](_0x2d6671[_0x63e2('0x23')],function(_0x159d0c){return{'model':db[_0x159d0c['model']],'as':_0x159d0c['as'],'attributes':_0x159d0c[_0x63e2('0x22')],'include':_0x159d0c[_0x63e2('0x23')]?_['map'](_0x159d0c['include'],function(_0x235cba){return{'model':db[_0x235cba[_0x63e2('0x24')]],'as':_0x235cba['as'],'attributes':_0x235cba[_0x63e2('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d2508){logger[_0x63e2('0x12')]('ShowUser',_0x47be41);logger[_0x63e2('0x15')](_0x63e2('0x26'),_0x47be41,JSON[_0x63e2('0x16')](_0x4d2508));_0x45c8ab(_0x4d2508);})[_0x63e2('0x1b')](function(_0x5965f0){logger[_0x63e2('0x17')]('ShowUser',_0x5965f0[_0x63e2('0x19')],_0x47be41);_0xd6a875(_0x100639['error'](0x1f4,_0x5965f0[_0x63e2('0x19')]));});});};exports['PauseUser']=function(_0x23f20a){var _0x3f25ac=this;return new Promise(function(_0x488b39,_0x1d7884){var _0x40f143;return db[_0x63e2('0x1d')]['find']({'where':_0x23f20a[_0x63e2('0x1f')][_0x63e2('0x21')]||{},'attributes':['id',_0x63e2('0x28'),_0x63e2('0x29'),_0x63e2('0x2a'),_0x63e2('0x2b')]})['then'](function(_0x4e5b21){if(_0x4e5b21){_0x40f143=_0x4e5b21;return db[_0x63e2('0x2c')][_0x63e2('0x2d')]({'paused':0x1},{'where':{'UserId':_0x40f143['id']},'individualHooks':!![]});}})[_0x63e2('0x11')](function(){if(_0x40f143){return db[_0x63e2('0x2e')][_0x63e2('0x1e')]({'where':{'membername':_0x40f143[_0x63e2('0x28')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x1ee23d){if(_0x40f143){if(_0x1ee23d&&_0x1ee23d['length']){var _0x5895fb=moment()[_0x63e2('0x2f')](_0x63e2('0x30'));for(var _0xff76f7=0x0,_0xcfd299=_0x1ee23d[_0x63e2('0x31')];_0xff76f7<_0xcfd299;_0xff76f7++){_0x1ee23d[_0xff76f7]['updateAttributes']({'exitAt':_0x5895fb});}}}})[_0x63e2('0x11')](function(){if(_0x40f143){var _0x195740=[];var _0x17f586=utils['getChannels']();_0x17f586[_0x63e2('0x32')](function(_0x3f0d45){_0x195740[_0x63e2('0x33')]({'channel':_0x3f0d45,'membername':_0x40f143[_0x63e2('0x28')],'interface':_[_0x63e2('0x34')](_0x40f143[_0x63e2('0x2b')])?util['format'](_0x63e2('0x35'),_0x40f143[_0x63e2('0x28')]):_0x40f143['interface'],'type':_0x63e2('0x36'),'enterAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30')),'data1':_0x23f20a[_0x63e2('0x37')][_0x63e2('0x38')]||_0x63e2('0x39'),'role':_0x40f143[_0x63e2('0x29')],'internal':_0x40f143[_0x63e2('0x2a')],'uniqueid':_0x23f20a['body'][_0x63e2('0x3a')]||null});});return db[_0x63e2('0x2e')]['bulkCreate'](_0x195740,{'individualHooks':!![]});}})['then'](function(){if(_0x40f143){return _0x40f143[_0x63e2('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x23f20a[_0x63e2('0x37')][_0x63e2('0x38')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30'))});}})['then'](function(_0x5e9850){_0x488b39(_0x5e9850);})['catch'](function(_0x46f006){_0x1d7884(_0x3f25ac['error'](0x1f4,_0x46f006[_0x63e2('0x19')]));});});};exports['UnpauseUser']=function(_0x414c50){var _0x379f1f=this;return new Promise(function(_0x596e87,_0x1d0aaf){var _0x2db06f;return db[_0x63e2('0x1d')][_0x63e2('0x3b')]({'where':_0x414c50[_0x63e2('0x1f')][_0x63e2('0x21')]||{},'attributes':['id','name']})[_0x63e2('0x11')](function(_0x2b63dd){if(_0x2b63dd){_0x2db06f=_0x2b63dd;if(_0x414c50[_0x63e2('0x37')][_0x63e2('0x3c')]&&!utils['isValidChannel'](_0x414c50[_0x63e2('0x37')][_0x63e2('0x3c')])){throw new Error(_0x63e2('0x3d'));}switch(_0x414c50[_0x63e2('0x37')][_0x63e2('0x3c')]){case _0x63e2('0x3e'):return db[_0x63e2('0x2c')][_0x63e2('0x2d')]({'paused':0x0},{'where':{'UserId':_0x2db06f['id']}})[_0x63e2('0x11')](function(){return db[_0x63e2('0x2e')][_0x63e2('0x27')]({'where':{'channel':_0x414c50['body'][_0x63e2('0x3c')],'membername':_0x2db06f[_0x63e2('0x28')],'type':_0x63e2('0x36'),'exitAt':null}});})[_0x63e2('0x11')](function(_0x5368e9){if(_0x5368e9){return _0x5368e9[_0x63e2('0x2d')]({'exitAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30')),'data2':'system'},{'individualHooks':!![]});}return null;})['then'](function(){return _0x2db06f[_0x63e2('0x2d')]({'voicePause':![]});});case _0x63e2('0x3f'):case'chat':case _0x63e2('0x40'):case _0x63e2('0x41'):case _0x63e2('0x42'):return db[_0x63e2('0x2e')][_0x63e2('0x27')]({'where':{'channel':_0x414c50[_0x63e2('0x37')][_0x63e2('0x3c')],'membername':_0x2db06f['name'],'type':'PAUSE','exitAt':null}})[_0x63e2('0x11')](function(_0x988942){return _0x988942[_0x63e2('0x2d')]({'exitAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30')),'data2':'system'},{'individualHooks':!![]});})[_0x63e2('0x11')](function(){var _0x27759d={};_[_0x63e2('0x43')](_0x27759d,util[_0x63e2('0x2f')](_0x63e2('0x44'),_0x414c50['body'][_0x63e2('0x3c')],_0x63e2('0x45')),![]);return _0x2db06f[_0x63e2('0x2d')](_0x27759d);});default:return db['UserVoiceQueueRt'][_0x63e2('0x2d')]({'paused':0x0},{'where':{'UserId':_0x2db06f['id']}})[_0x63e2('0x11')](function(){return db['MemberReport'][_0x63e2('0x1e')]({'where':{'membername':_0x2db06f[_0x63e2('0x28')],'type':_0x63e2('0x36'),'exitAt':null}});})[_0x63e2('0x11')](function(_0x5eac01){var _0xd19483=[];_0x5eac01['forEach'](function(_0x2e13ab){_0xd19483[_0x63e2('0x33')](_0x2e13ab[_0x63e2('0x2d')]({'exitAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30')),'data2':_0x63e2('0x46')}));});return BPromise[_0x63e2('0x47')](_0xd19483);})[_0x63e2('0x11')](function(){return _0x2db06f[_0x63e2('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x63e2('0x11')](function(_0x2dc5b7){_0x596e87(_0x2dc5b7);})[_0x63e2('0x1b')](function(_0x20628d){_0x1d0aaf(_0x379f1f['error'](0x1f4,_0x20628d['message']));});});};exports['LogoutUser']=function(_0x298ac9){var _0x24d98e=this;return new Promise(function(_0x565766,_0x284fab){var _0x113ca9;return db[_0x63e2('0x1d')][_0x63e2('0x3b')]({'where':_0x298ac9[_0x63e2('0x1f')]['where']||{},'attributes':['id','name']})[_0x63e2('0x11')](function(_0x595a27){if(_0x595a27){_0x113ca9=_0x595a27;return db['UserVoiceQueueRt'][_0x63e2('0x48')]({'where':{'membername':_0x113ca9[_0x63e2('0x28')]},'individualHooks':!![]});}})[_0x63e2('0x11')](function(){if(_0x113ca9){return db[_0x63e2('0x2e')]['findAll']({'where':{'membername':_0x113ca9[_0x63e2('0x28')],'exitAt':null}});}})[_0x63e2('0x11')](function(_0xfcb8d3){if(_0x113ca9){if(_0xfcb8d3&&_0xfcb8d3['length']){var _0x2cc24e=[];_0xfcb8d3[_0x63e2('0x32')](function(_0x59c4b0){_0x2cc24e[_0x63e2('0x33')](_0x59c4b0[_0x63e2('0x2d')]({'exitAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30'))}));});return BPromise[_0x63e2('0x47')](_0x2cc24e);}}})[_0x63e2('0x11')](function(){if(_0x113ca9){return _0x113ca9[_0x63e2('0x2d')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x63e2('0x11')](function(_0x34b43a){_0x565766(_0x34b43a);})['catch'](function(_0x1f7f0f){_0x284fab(_0x24d98e[_0x63e2('0x17')](0x1f4,_0x1f7f0f[_0x63e2('0x19')]));});});};exports[_0x63e2('0x49')]=function(_0x5cd3a0){var _0x30e4e3=this;return new Promise(function(_0x52b36a,_0x3d8e1f){var _0x21a95a;var _0x447767;var _0x1e1915;var _0x58002a;return db[_0x63e2('0x1d')][_0x63e2('0x3b')]({'where':_0x5cd3a0['options'][_0x63e2('0x21')]||{},'attributes':['id',_0x63e2('0x28'),'role',_0x63e2('0x4a'),_0x63e2('0x4b'),_0x63e2('0x2a'),_0x63e2('0x4c'),_0x63e2('0x2b')]})[_0x63e2('0x11')](function(_0x33f564){if(_0x33f564){_0x21a95a=_0x33f564;_0x58002a=_0x5cd3a0[_0x63e2('0x37')][_0x63e2('0x2b')]?_0x5cd3a0[_0x63e2('0x37')]['interface']:util['format'](_0x63e2('0x35'),_0x21a95a['name']);return db[_0x63e2('0x1d')][_0x63e2('0x4d')]({'where':{'role':_0x63e2('0x4e'),'online':!![],'id':{'$ne':_0x21a95a['id']}}});}})[_0x63e2('0x11')](function(_0x431244){if(_0x431244){_0x1e1915=_0x431244;return require(_0x63e2('0x4f'))['getLicense']();}})[_0x63e2('0x11')](function(_0x301dab){if(_0x301dab&&_0x301dab['agents']&&_0x1e1915>=_0x301dab[_0x63e2('0x50')]){throw new Error(_0x63e2('0x51'));}})[_0x63e2('0x11')](function(){if(_0x21a95a){return db[_0x63e2('0x2c')][_0x63e2('0x48')]({'where':{'membername':_0x21a95a['name']},'individualHooks':!![]});}})['then'](function(){if(_0x21a95a){return _0x21a95a[_0x63e2('0x52')]({'raw':!![]});}})[_0x63e2('0x11')](function(_0x212630){if(_0x21a95a){if(_0x212630){var _0x594907=[];_0x447767=_0x212630;if(_0x447767['length']){for(var _0x3704f8=0x0;_0x3704f8<_0x447767[_0x63e2('0x31')];_0x3704f8++){_0x594907['push'](db['UserVoiceQueueRt'][_0x63e2('0x53')]({'membername':_0x21a95a[_0x63e2('0x28')],'UserId':_0x21a95a['id'],'queue_name':_0x447767[_0x3704f8]['name'],'VoiceQueueId':_0x447767[_0x3704f8]['id'],'interface':_0x58002a,'paused':_0x21a95a[_0x63e2('0x4c')]||![],'penalty':_0x447767[_0x3704f8][_0x63e2('0x54')]||0x0}));}return BPromise['all'](_0x594907);}}}})[_0x63e2('0x11')](function(){if(_0x21a95a){return db[_0x63e2('0x2e')][_0x63e2('0x1e')]({'where':{'membername':_0x21a95a[_0x63e2('0x28')],'exitAt':null}});}})[_0x63e2('0x11')](function(_0x210406){if(_0x21a95a){if(_0x210406&&_0x210406[_0x63e2('0x31')]){var _0x75b06d=[];_0x210406['forEach'](function(_0x5075df){_0x75b06d[_0x63e2('0x33')](_0x5075df[_0x63e2('0x2d')]({'exitAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30'))}));});return BPromise[_0x63e2('0x47')](_0x75b06d);}}})[_0x63e2('0x11')](function(_0x29d75e){if(_0x21a95a){var _0x573ce0=[];var _0x29329c=[];var _0x570d22=utils[_0x63e2('0x55')]();var _0x5770a7={'membername':_0x21a95a[_0x63e2('0x28')],'interface':_0x58002a,'enterAt':moment()[_0x63e2('0x2f')](_0x63e2('0x30')),'role':_0x21a95a['role'],'internal':_0x21a95a[_0x63e2('0x2a')]};_0x570d22['forEach'](function(_0x4d7679){_0x573ce0[_0x63e2('0x33')](_[_0x63e2('0x56')]({'channel':_0x4d7679,'type':_0x63e2('0x57'),'data1':_0x63e2('0x58'),'data2':_0x58002a},_0x5770a7));if(_0x21a95a[_0x63e2('0x4c')]){_0x29329c[_0x63e2('0x33')](_[_0x63e2('0x56')]({'channel':_0x4d7679,'type':_0x63e2('0x36'),'data1':'LOGININPAUSE'},_0x5770a7));}});return db[_0x63e2('0x2e')][_0x63e2('0x59')](_0x573ce0['concat'](_0x29329c),{'individualHooks':!![]});}})['then'](function(){if(_0x21a95a){return _0x21a95a[_0x63e2('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x63e2('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x21a95a[_0x63e2('0x4c')]||![],'mailPause':_0x21a95a[_0x63e2('0x4c')]||![],'chatPause':_0x21a95a[_0x63e2('0x4c')]||![],'faxPause':_0x21a95a[_0x63e2('0x4c')]||![],'smsPause':_0x21a95a[_0x63e2('0x4c')]||![],'openchannelPause':_0x21a95a[_0x63e2('0x4c')]||![],'pauseType':_0x21a95a[_0x63e2('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x63e2('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x58002a});}})[_0x63e2('0x11')](function(_0x4c58b0){_0x52b36a(_0x4c58b0);})['catch'](function(_0x1df86a){_0x3d8e1f(_0x30e4e3['error'](0x1f4,_0x1df86a[_0x63e2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 83e8db7..ebf4778 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 _0x284a=['remove','update','emit','register','length','user:','./user.events','save'];(function(_0x3f154a,_0x1b907f){var _0x5bda54=function(_0x3de669){while(--_0x3de669){_0x3f154a['push'](_0x3f154a['shift']());}};_0x5bda54(++_0x1b907f);}(_0x284a,0xd6));var _0xa284=function(_0x2dd49d,_0x3e77e6){_0x2dd49d=_0x2dd49d-0x0;var _0x325430=_0x284a[_0x2dd49d];return _0x325430;};'use strict';var UserEvents=require(_0xa284('0x0'));var events=[_0xa284('0x1'),_0xa284('0x2'),_0xa284('0x3')];function createListener(_0x5a8bbc,_0x1f2bea){return function(_0x27c6fb){_0x1f2bea[_0xa284('0x4')](_0x5a8bbc,_0x27c6fb);};}function removeListener(_0x143847,_0x1e8564){return function(){UserEvents['removeListener'](_0x143847,_0x1e8564);};}exports[_0xa284('0x5')]=function(_0x330220){for(var _0x56a82c=0x0,_0x2b764f=events[_0xa284('0x6')];_0x56a82c<_0x2b764f;_0x56a82c++){var _0x4a8e54=events[_0x56a82c];var _0x120af9=createListener(_0xa284('0x7')+_0x4a8e54,_0x330220);UserEvents['on'](_0x4a8e54,_0x120af9);}}; \ No newline at end of file +var _0x7349=['emit','removeListener','register','length','user:','./user.events','save','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7349,0x195));var _0x9734=function(_0x1cc598,_0x44db52){_0x1cc598=_0x1cc598-0x0;var _0x43f41b=_0x7349[_0x1cc598];return _0x43f41b;};'use strict';var UserEvents=require(_0x9734('0x0'));var events=[_0x9734('0x1'),'remove',_0x9734('0x2')];function createListener(_0xa9729c,_0x4a06e5){return function(_0x54a235){_0x4a06e5[_0x9734('0x3')](_0xa9729c,_0x54a235);};}function removeListener(_0x4efcf7,_0x118568){return function(){UserEvents[_0x9734('0x4')](_0x4efcf7,_0x118568);};}exports[_0x9734('0x5')]=function(_0x31c090){for(var _0x2980aa=0x0,_0x369c99=events[_0x9734('0x6')];_0x2980aa<_0x369c99;_0x2980aa++){var _0x5e9dbc=events[_0x2980aa];var _0x5e5b45=createListener(_0x9734('0x7')+_0x5e9dbc,_0x31c090);UserEvents['on'](_0x5e9dbc,_0x5e5b45);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 33d7046..c3ee662 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 _0xd88d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd88d,0xb6));var _0xdd88=function(_0x17b1b8,_0x50ccdc){_0x17b1b8=_0x17b1b8-0x0;var _0x5a0d50=_0xd88d[_0x17b1b8];return _0x5a0d50;};'use strict';var multer=require(_0xdd88('0x0'));var util=require('util');var path=require(_0xdd88('0x1'));var timeout=require(_0xdd88('0x2'));var express=require(_0xdd88('0x3'));var router=express[_0xdd88('0x4')]();var auth=require(_0xdd88('0x5'));var interaction=require(_0xdd88('0x6'));var config=require('../../config/environment');module[_0xdd88('0x7')]=router; \ No newline at end of file +var _0xac39=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1cfe0c,_0x53eaf4){var _0x34534f=function(_0x115bf2){while(--_0x115bf2){_0x1cfe0c['push'](_0x1cfe0c['shift']());}};_0x34534f(++_0x53eaf4);}(_0xac39,0x11c));var _0x9ac3=function(_0x326e56,_0x43a54c){_0x326e56=_0x326e56-0x0;var _0x4d04f3=_0xac39[_0x326e56];return _0x4d04f3;};'use strict';var multer=require(_0x9ac3('0x0'));var util=require(_0x9ac3('0x1'));var path=require(_0x9ac3('0x2'));var timeout=require(_0x9ac3('0x3'));var express=require(_0x9ac3('0x4'));var router=express[_0x9ac3('0x5')]();var auth=require(_0x9ac3('0x6'));var interaction=require(_0x9ac3('0x7'));var config=require(_0x9ac3('0x8'));module[_0x9ac3('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 6bd82f8..a90dd77 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x406fe7,_0xa3f94b){var _0x4882cd=function(_0xbf748d){while(--_0xbf748d){_0x406fe7['push'](_0x406fe7['shift']());}};_0x4882cd(++_0xa3f94b);}(_0xe706,0xa3));var _0x6e70=function(_0x1633a0,_0x3cdfc1){_0x1633a0=_0x1633a0-0x0;var _0x523846=_0xe706[_0x1633a0];return _0x523846;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x52f480,_0x48789b){var _0x53ba45=function(_0xd8e51){while(--_0xd8e51){_0x52f480['push'](_0x52f480['shift']());}};_0x53ba45(++_0x48789b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 4fe1bb3..2c59b4a 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 _0xdbc3=['./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4e58f9,_0x2e60fa){var _0x4445f5=function(_0x89abb0){while(--_0x89abb0){_0x4e58f9['push'](_0x4e58f9['shift']());}};_0x4445f5(++_0x2e60fa);}(_0xdbc3,0x112));var _0x3dbc=function(_0x23a1f4,_0x349300){_0x23a1f4=_0x23a1f4-0x0;var _0x36cc29=_0xdbc3[_0x23a1f4];return _0x36cc29;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3dbc('0x0'))(_0x3dbc('0x1'));var moment=require('moment');var BPromise=require(_0x3dbc('0x2'));var rp=require(_0x3dbc('0x3'));var fs=require('fs');var path=require(_0x3dbc('0x4'));var rimraf=require(_0x3dbc('0x5'));var config=require('../../config/environment');var attributes=require(_0x3dbc('0x6'));module['exports']=function(_0x1c9d75,_0x5545a5){return _0x1c9d75[_0x3dbc('0x7')](_0x3dbc('0x8'),attributes,{'tableName':_0x3dbc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83ea=['path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5540fd,_0x1d00d9){var _0x56906c=function(_0x492dd4){while(--_0x492dd4){_0x5540fd['push'](_0x5540fd['shift']());}};_0x56906c(++_0x1d00d9);}(_0x83ea,0x166));var _0xa83e=function(_0x538ae5,_0x2e7a44){_0x538ae5=_0x538ae5-0x0;var _0x2bcece=_0x83ea[_0x538ae5];return _0x2bcece;};'use strict';var _=require(_0xa83e('0x0'));var util=require(_0xa83e('0x1'));var logger=require('../../config/logger')(_0xa83e('0x2'));var moment=require(_0xa83e('0x3'));var BPromise=require(_0xa83e('0x4'));var rp=require(_0xa83e('0x5'));var fs=require('fs');var path=require(_0xa83e('0x6'));var rimraf=require(_0xa83e('0x7'));var config=require(_0xa83e('0x8'));var attributes=require(_0xa83e('0x9'));module[_0xa83e('0xa')]=function(_0xccb53c,_0x335d3a){return _0xccb53c[_0xa83e('0xb')](_0xa83e('0xc'),attributes,{'tableName':_0xa83e('0xd'),'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 eccbbd7..7c9bb6f 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 _0x1c99=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash'];(function(_0x1c2517,_0x10e32f){var _0x556787=function(_0x4c9465){while(--_0x4c9465){_0x1c2517['push'](_0x1c2517['shift']());}};_0x556787(++_0x10e32f);}(_0x1c99,0x19f));var _0x91c9=function(_0x506d2f,_0x5ab76e){_0x506d2f=_0x506d2f-0x0;var _0x101255=_0x1c99[_0x506d2f];return _0x101255;};'use strict';var _=require(_0x91c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x91c9('0x1'));var rs=require(_0x91c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91c9('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x91c9('0x4'))(_0x91c9('0x5'));var config=require('../../config/environment');var jayson=require(_0x91c9('0x6'));var client=jayson[_0x91c9('0x7')][_0x91c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40479b,_0x54dc4c,_0x304f5e){return new BPromise(function(_0x39d280,_0x35fb74){return client['request'](_0x40479b,_0x304f5e)['then'](function(_0x52b6b7){logger[_0x91c9('0x9')](_0x91c9('0xa'),_0x54dc4c,_0x91c9('0xb'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x54dc4c,'request\x20sent',JSON['stringify'](_0x52b6b7));if(_0x52b6b7[_0x91c9('0xc')]){if(_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xd')]===0x1f4){logger[_0x91c9('0xc')](_0x91c9('0xa'),_0x54dc4c,_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xe')]);return _0x35fb74(_0x52b6b7[_0x91c9('0xc')]['message']);}logger[_0x91c9('0xc')](_0x91c9('0xa'),_0x54dc4c,_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xe')]);return _0x39d280(_0x52b6b7[_0x91c9('0xc')][_0x91c9('0xe')]);}else{logger[_0x91c9('0x9')]('UserChatQueue,\x20%s,\x20%s',_0x54dc4c,_0x91c9('0xb'));_0x39d280(_0x52b6b7['result'][_0x91c9('0xe')]);}})[_0x91c9('0xf')](function(_0x528067){logger[_0x91c9('0xc')](_0x91c9('0xa'),_0x54dc4c,_0x528067);_0x35fb74(_0x528067);});});} \ No newline at end of file +var _0xcd31=['catch','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','UserChatQueue,\x20%s,\x20%s','message','result'];(function(_0x3815e1,_0x2095c4){var _0x14293a=function(_0x3b005e){while(--_0x3b005e){_0x3815e1['push'](_0x3815e1['shift']());}};_0x14293a(++_0x2095c4);}(_0xcd31,0xdd));var _0x1cd3=function(_0x336275,_0xd26bb5){_0x336275=_0x336275-0x0;var _0x12ab42=_0xcd31[_0x336275];return _0x12ab42;};'use strict';var _=require('lodash');var util=require(_0x1cd3('0x0'));var moment=require(_0x1cd3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cd3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cd3('0x3'));var logger=require(_0x1cd3('0x4'))('rpc');var config=require(_0x1cd3('0x5'));var jayson=require(_0x1cd3('0x6'));var client=jayson[_0x1cd3('0x7')][_0x1cd3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ed38b,_0x57401f,_0x461260){return new BPromise(function(_0x29918c,_0x3ded37){return client[_0x1cd3('0x9')](_0x3ed38b,_0x461260)[_0x1cd3('0xa')](function(_0x626661){logger[_0x1cd3('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x57401f,_0x1cd3('0xc'));logger[_0x1cd3('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x57401f,_0x1cd3('0xc'),JSON[_0x1cd3('0xe')](_0x626661));if(_0x626661[_0x1cd3('0xf')]){if(_0x626661['error']['code']===0x1f4){logger[_0x1cd3('0xf')](_0x1cd3('0x10'),_0x57401f,_0x626661[_0x1cd3('0xf')][_0x1cd3('0x11')]);return _0x3ded37(_0x626661[_0x1cd3('0xf')]['message']);}logger[_0x1cd3('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x57401f,_0x626661[_0x1cd3('0xf')]['message']);return _0x29918c(_0x626661[_0x1cd3('0xf')][_0x1cd3('0x11')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x57401f,_0x1cd3('0xc'));_0x29918c(_0x626661[_0x1cd3('0x12')]['message']);}})[_0x1cd3('0x13')](function(_0x105860){logger[_0x1cd3('0xf')](_0x1cd3('0x10'),_0x57401f,_0x105860);_0x3ded37(_0x105860);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c9839d1..bfe2370 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 _0x0687=['path','connect-timeout','express','../../components/interaction/service','exports','multer','util'];(function(_0x527914,_0x53a670){var _0x4a9b4e=function(_0x55e371){while(--_0x55e371){_0x527914['push'](_0x527914['shift']());}};_0x4a9b4e(++_0x53a670);}(_0x0687,0x101));var _0x7068=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0687[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7068('0x0'));var util=require(_0x7068('0x1'));var path=require(_0x7068('0x2'));var timeout=require(_0x7068('0x3'));var express=require(_0x7068('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7068('0x5'));var config=require('../../config/environment');module[_0x7068('0x6')]=router; \ No newline at end of file +var _0xcd69=['../../components/interaction/service','../../config/environment','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0xcd69,0x16b));var _0x9cd6=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xcd69[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9cd6('0x0'));var timeout=require(_0x9cd6('0x1'));var express=require(_0x9cd6('0x2'));var router=express[_0x9cd6('0x3')]();var auth=require(_0x9cd6('0x4'));var interaction=require(_0x9cd6('0x5'));var config=require(_0x9cd6('0x6'));module[_0x9cd6('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f95bdba..1341fe2 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 _0xda2d=['exports','INTEGER','STRING'];(function(_0x3d2c55,_0x2a31a0){var _0x41e741=function(_0x30f772){while(--_0x30f772){_0x3d2c55['push'](_0x3d2c55['shift']());}};_0x41e741(++_0x2a31a0);}(_0xda2d,0x102));var _0xdda2=function(_0x394a6e,_0x41ee56){_0x394a6e=_0x394a6e-0x0;var _0x391a68=_0xda2d[_0x394a6e];return _0x391a68;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'penalty':{'type':Sequelize[_0xdda2('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdda2('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdda2('0x2')]}}; \ No newline at end of file +var _0xdd4f=['sequelize','STRING'];(function(_0x2a9796,_0x33a67b){var _0x5eddc9=function(_0x1a58fa){while(--_0x1a58fa){_0x2a9796['push'](_0x2a9796['shift']());}};_0x5eddc9(++_0x33a67b);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x29b67d,_0x1c0c14){_0x29b67d=_0x29b67d-0x0;var _0x53fa60=_0xdd4f[_0x29b67d];return _0x53fa60;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfdd4('0x1')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7648dc2..62c3d0a 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(_0x4fbaf9,_0x3b8190){var _0x1d89a0=function(_0x3b650b){while(--_0x3b650b){_0x4fbaf9['push'](_0x4fbaf9['shift']());}};_0x1d89a0(++_0x3b8190);}(_0xb10b,0x12a));var _0xbb10=function(_0x36ca7f,_0x337025){_0x36ca7f=_0x36ca7f-0x0;var _0x1dedcd=_0xb10b[_0x36ca7f];return _0x1dedcd;};'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(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0xb10b,0x12a));var _0xbb10=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xb10b[_0x1b4b23];return _0x2a325b;};'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 8d35c4d..69f35ce 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 _0x82d6=['http','then','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','UserFaxQueue,\x20%s,\x20%s','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x48eb60,_0x45ccd1){var _0x1b8656=function(_0x2e51e8){while(--_0x2e51e8){_0x48eb60['push'](_0x48eb60['shift']());}};_0x1b8656(++_0x45ccd1);}(_0x82d6,0x9e));var _0x682d=function(_0x33e4c5,_0x18c7cc){_0x33e4c5=_0x33e4c5-0x0;var _0x262c23=_0x82d6[_0x33e4c5];return _0x262c23;};'use strict';var _=require(_0x682d('0x0'));var util=require(_0x682d('0x1'));var moment=require('moment');var BPromise=require(_0x682d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x682d('0x3'))['db'];var utils=require(_0x682d('0x4'));var logger=require(_0x682d('0x5'))(_0x682d('0x6'));var config=require(_0x682d('0x7'));var jayson=require(_0x682d('0x8'));var client=jayson[_0x682d('0x9')][_0x682d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x135dd0,_0x3da4c3,_0x21f1fd){return new BPromise(function(_0x3da7c0,_0x150f30){return client['request'](_0x135dd0,_0x21f1fd)[_0x682d('0xb')](function(_0x4fc8a8){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x3da4c3,_0x682d('0xc'));logger[_0x682d('0xd')](_0x682d('0xe'),_0x3da4c3,_0x682d('0xc'),JSON['stringify'](_0x4fc8a8));if(_0x4fc8a8[_0x682d('0xf')]){if(_0x4fc8a8[_0x682d('0xf')][_0x682d('0x10')]===0x1f4){logger[_0x682d('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0x3da4c3,_0x4fc8a8[_0x682d('0xf')]['message']);return _0x150f30(_0x4fc8a8[_0x682d('0xf')][_0x682d('0x11')]);}logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x3da4c3,_0x4fc8a8[_0x682d('0xf')][_0x682d('0x11')]);return _0x3da7c0(_0x4fc8a8[_0x682d('0xf')][_0x682d('0x11')]);}else{logger[_0x682d('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x3da4c3,_0x682d('0xc'));_0x3da7c0(_0x4fc8a8[_0x682d('0x13')][_0x682d('0x11')]);}})['catch'](function(_0xe09656){logger['error'](_0x682d('0x14'),_0x3da4c3,_0xe09656);_0x150f30(_0xe09656);});});} \ No newline at end of file +var _0xea92=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0xea92,0x1bb));var _0x2ea9=function(_0x2e49a5,_0x42e9a1){_0x2e49a5=_0x2e49a5-0x0;var _0x18bcf5=_0xea92[_0x2e49a5];return _0x18bcf5;};'use strict';var _=require(_0x2ea9('0x0'));var util=require(_0x2ea9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2ea9('0x2'));var fs=require('fs');var Redis=require(_0x2ea9('0x3'));var db=require(_0x2ea9('0x4'))['db'];var utils=require(_0x2ea9('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ea9('0x6'));var jayson=require(_0x2ea9('0x7'));var client=jayson[_0x2ea9('0x8')][_0x2ea9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b81d1,_0x4d46da,_0xfad6f3){return new BPromise(function(_0x163e91,_0x1efbc1){return client['request'](_0x2b81d1,_0xfad6f3)[_0x2ea9('0xa')](function(_0x4e8692){logger[_0x2ea9('0xb')](_0x2ea9('0xc'),_0x4d46da,'request\x20sent');logger['debug'](_0x2ea9('0xd'),_0x4d46da,_0x2ea9('0xe'),JSON[_0x2ea9('0xf')](_0x4e8692));if(_0x4e8692[_0x2ea9('0x10')]){if(_0x4e8692[_0x2ea9('0x10')]['code']===0x1f4){logger[_0x2ea9('0x10')](_0x2ea9('0xc'),_0x4d46da,_0x4e8692[_0x2ea9('0x10')]['message']);return _0x1efbc1(_0x4e8692[_0x2ea9('0x10')][_0x2ea9('0x11')]);}logger[_0x2ea9('0x10')](_0x2ea9('0xc'),_0x4d46da,_0x4e8692[_0x2ea9('0x10')][_0x2ea9('0x11')]);return _0x163e91(_0x4e8692['error'][_0x2ea9('0x11')]);}else{logger['info']('UserFaxQueue,\x20%s,\x20%s',_0x4d46da,_0x2ea9('0xe'));_0x163e91(_0x4e8692[_0x2ea9('0x12')][_0x2ea9('0x11')]);}})[_0x2ea9('0x13')](function(_0x4db65c){logger[_0x2ea9('0x10')](_0x2ea9('0xc'),_0x4d46da,_0x4db65c);_0x1efbc1(_0x4db65c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 432cea0..fe7ff2d 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 _0x0e2f=['Router','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0xd03ca,_0x103f44){var _0x26e9f2=function(_0x3d8a1c){while(--_0x3d8a1c){_0xd03ca['push'](_0xd03ca['shift']());}};_0x26e9f2(++_0x103f44);}(_0x0e2f,0xcb));var _0xf0e2=function(_0x5a4efd,_0x325bad){_0x5a4efd=_0x5a4efd-0x0;var _0x3ae398=_0x0e2f[_0x5a4efd];return _0x3ae398;};'use strict';var multer=require(_0xf0e2('0x0'));var util=require(_0xf0e2('0x1'));var path=require(_0xf0e2('0x2'));var timeout=require(_0xf0e2('0x3'));var express=require(_0xf0e2('0x4'));var router=express[_0xf0e2('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf0e2('0x6'));module[_0xf0e2('0x7')]=router; \ No newline at end of file +var _0x9800=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fc97e,_0x33aa22){var _0x189547=function(_0x11e15c){while(--_0x11e15c){_0x1fc97e['push'](_0x1fc97e['shift']());}};_0x189547(++_0x33aa22);}(_0x9800,0xf6));var _0x0980=function(_0x75d36f,_0x54af9e){_0x75d36f=_0x75d36f-0x0;var _0x2b0bab=_0x9800[_0x75d36f];return _0x2b0bab;};'use strict';var multer=require(_0x0980('0x0'));var util=require(_0x0980('0x1'));var path=require(_0x0980('0x2'));var timeout=require(_0x0980('0x3'));var express=require(_0x0980('0x4'));var router=express[_0x0980('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0980('0x6'));var config=require(_0x0980('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 bffeb86..01f73c2 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 _0xd8b0=['exports','sequelize'];(function(_0xad57c9,_0x4472df){var _0x455ddc=function(_0x9a99dc){while(--_0x9a99dc){_0xad57c9['push'](_0xad57c9['shift']());}};_0x455ddc(++_0x4472df);}(_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 _0xd8b0=['exports','sequelize'];(function(_0x281305,_0x2998d6){var _0x56ffbe=function(_0x270b4c){while(--_0x270b4c){_0x281305['push'](_0x281305['shift']());}};_0x56ffbe(++_0x2998d6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 7e6635b..ec84246 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(_0x1b6b96,_0x4c2910){var _0x55111a=function(_0x263c7b){while(--_0x263c7b){_0x1b6b96['push'](_0x1b6b96['shift']());}};_0x55111a(++_0x4c2910);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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(_0x2dbb9e,_0x41ae7a){var _0x394282=function(_0x5d5f8f){while(--_0x5d5f8f){_0x2dbb9e['push'](_0x2dbb9e['shift']());}};_0x394282(++_0x41ae7a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 b5c78a1..d75ce1a 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 _0x4e06=['stringify','error','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x4e06,0x1d2));var _0x64e0=function(_0x1ed78f,_0x5ab61b){_0x1ed78f=_0x1ed78f-0x0;var _0x46f620=_0x4e06[_0x1ed78f];return _0x46f620;};'use strict';var _=require(_0x64e0('0x0'));var util=require(_0x64e0('0x1'));var moment=require(_0x64e0('0x2'));var BPromise=require(_0x64e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64e0('0x4'));var db=require(_0x64e0('0x5'))['db'];var utils=require(_0x64e0('0x6'));var logger=require(_0x64e0('0x7'))(_0x64e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x64e0('0x9'));var client=jayson[_0x64e0('0xa')][_0x64e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x63dbec,_0x32b867,_0x12cd81){return new BPromise(function(_0x1f197b,_0x191e5d){return client[_0x64e0('0xc')](_0x63dbec,_0x12cd81)[_0x64e0('0xd')](function(_0xc6ad41){logger[_0x64e0('0xe')](_0x64e0('0xf'),_0x32b867,_0x64e0('0x10'));logger[_0x64e0('0x11')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x32b867,_0x64e0('0x10'),JSON[_0x64e0('0x12')](_0xc6ad41));if(_0xc6ad41[_0x64e0('0x13')]){if(_0xc6ad41[_0x64e0('0x13')]['code']===0x1f4){logger[_0x64e0('0x13')](_0x64e0('0xf'),_0x32b867,_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);return _0x191e5d(_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);}logger['error']('UserMailQueue,\x20%s,\x20%s',_0x32b867,_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);return _0x1f197b(_0xc6ad41[_0x64e0('0x13')][_0x64e0('0x14')]);}else{logger[_0x64e0('0xe')](_0x64e0('0xf'),_0x32b867,'request\x20sent');_0x1f197b(_0xc6ad41['result'][_0x64e0('0x14')]);}})[_0x64e0('0x15')](function(_0x176693){logger[_0x64e0('0x13')](_0x64e0('0xf'),_0x32b867,_0x176693);_0x191e5d(_0x176693);});});} \ No newline at end of file +var _0x6e64=['moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util'];(function(_0xaec935,_0x5f3d12){var _0x28a8e1=function(_0x4ca7a1){while(--_0x4ca7a1){_0xaec935['push'](_0xaec935['shift']());}};_0x28a8e1(++_0x5f3d12);}(_0x6e64,0x10f));var _0x46e6=function(_0x412ed6,_0x5ac827){_0x412ed6=_0x412ed6-0x0;var _0x3883d2=_0x6e64[_0x412ed6];return _0x3883d2;};'use strict';var _=require(_0x46e6('0x0'));var util=require(_0x46e6('0x1'));var moment=require(_0x46e6('0x2'));var BPromise=require(_0x46e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x46e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x46e6('0x5'));var logger=require('../../config/logger')(_0x46e6('0x6'));var config=require(_0x46e6('0x7'));var jayson=require(_0x46e6('0x8'));var client=jayson[_0x46e6('0x9')][_0x46e6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420d3d,_0x5c7310,_0x1184c5){return new BPromise(function(_0x254590,_0x1af29f){return client[_0x46e6('0xb')](_0x420d3d,_0x1184c5)[_0x46e6('0xc')](function(_0x369de7){logger[_0x46e6('0xd')](_0x46e6('0xe'),_0x5c7310,_0x46e6('0xf'));logger[_0x46e6('0x10')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x5c7310,_0x46e6('0xf'),JSON['stringify'](_0x369de7));if(_0x369de7['error']){if(_0x369de7[_0x46e6('0x11')][_0x46e6('0x12')]===0x1f4){logger[_0x46e6('0x11')](_0x46e6('0xe'),_0x5c7310,_0x369de7['error']['message']);return _0x1af29f(_0x369de7[_0x46e6('0x11')][_0x46e6('0x13')]);}logger[_0x46e6('0x11')](_0x46e6('0xe'),_0x5c7310,_0x369de7[_0x46e6('0x11')][_0x46e6('0x13')]);return _0x254590(_0x369de7[_0x46e6('0x11')]['message']);}else{logger[_0x46e6('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x5c7310,_0x46e6('0xf'));_0x254590(_0x369de7[_0x46e6('0x14')]['message']);}})['catch'](function(_0x1f9e4f){logger[_0x46e6('0x11')](_0x46e6('0xe'),_0x5c7310,_0x1f9e4f);_0x1af29f(_0x1f9e4f);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index a4e6071..887a9ac 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 _0xc947=['../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path','connect-timeout','Router'];(function(_0x57ffd3,_0x52b589){var _0x48fc51=function(_0x530f99){while(--_0x530f99){_0x57ffd3['push'](_0x57ffd3['shift']());}};_0x48fc51(++_0x52b589);}(_0xc947,0x6b));var _0x7c94=function(_0x592f9a,_0x2888cc){_0x592f9a=_0x592f9a-0x0;var _0x2386d5=_0xc947[_0x592f9a];return _0x2386d5;};'use strict';var multer=require(_0x7c94('0x0'));var util=require(_0x7c94('0x1'));var path=require(_0x7c94('0x2'));var timeout=require(_0x7c94('0x3'));var express=require('express');var router=express[_0x7c94('0x4')]();var auth=require(_0x7c94('0x5'));var interaction=require(_0x7c94('0x6'));var config=require(_0x7c94('0x7'));module['exports']=router; \ No newline at end of file +var _0xfd8b=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path'];(function(_0x8f7d2b,_0x1bebaf){var _0x13c298=function(_0x54717e){while(--_0x54717e){_0x8f7d2b['push'](_0x8f7d2b['shift']());}};_0x13c298(++_0x1bebaf);}(_0xfd8b,0xae));var _0xbfd8=function(_0x2ad2d1,_0x5886a5){_0x2ad2d1=_0x2ad2d1-0x0;var _0x235ef0=_0xfd8b[_0x2ad2d1];return _0x235ef0;};'use strict';var multer=require('multer');var util=require(_0xbfd8('0x0'));var path=require(_0xbfd8('0x1'));var timeout=require(_0xbfd8('0x2'));var express=require(_0xbfd8('0x3'));var router=express['Router']();var auth=require(_0xbfd8('0x4'));var interaction=require(_0xbfd8('0x5'));var config=require(_0xbfd8('0x6'));module[_0xbfd8('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index a4b4f8d..f545bbd 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(_0x35db81,_0x5f1ecd){var _0x4ecb42=function(_0x3a34b3){while(--_0x3a34b3){_0x35db81['push'](_0x35db81['shift']());}};_0x4ecb42(++_0x5f1ecd);}(_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(_0x1966f3,_0x210ea3){var _0x17575f=function(_0x7b18fb){while(--_0x7b18fb){_0x1966f3['push'](_0x1966f3['shift']());}};_0x17575f(++_0x210ea3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'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 4746365..490e8b3 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 _0xe1f8=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4b8205,_0x40737c){var _0x201ce7=function(_0x43af44){while(--_0x43af44){_0x4b8205['push'](_0x4b8205['shift']());}};_0x201ce7(++_0x40737c);}(_0xe1f8,0x65));var _0x8e1f=function(_0x765dcf,_0x1fe960){_0x765dcf=_0x765dcf-0x0;var _0x3ed00d=_0xe1f8[_0x765dcf];return _0x3ed00d;};'use strict';var _=require(_0x8e1f('0x0'));var util=require(_0x8e1f('0x1'));var logger=require(_0x8e1f('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8e1f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e1f('0x4'));var rimraf=require(_0x8e1f('0x5'));var config=require(_0x8e1f('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x8e1f('0x7')]=function(_0x16022b,_0x120d58){return _0x16022b[_0x8e1f('0x8')](_0x8e1f('0x9'),attributes,{'tableName':_0x8e1f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14f5=['moment','bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','UserOpenchannelQueue','user_has_openchannel_queues','lodash','api'];(function(_0x1de950,_0x325139){var _0x12dc31=function(_0x57409b){while(--_0x57409b){_0x1de950['push'](_0x1de950['shift']());}};_0x12dc31(++_0x325139);}(_0x14f5,0xbc));var _0x514f=function(_0x2f1089,_0x42d03d){_0x2f1089=_0x2f1089-0x0;var _0x1af573=_0x14f5[_0x2f1089];return _0x1af573;};'use strict';var _=require(_0x514f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x514f('0x1'));var moment=require(_0x514f('0x2'));var BPromise=require(_0x514f('0x3'));var rp=require(_0x514f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x514f('0x5'));var config=require(_0x514f('0x6'));var attributes=require(_0x514f('0x7'));module['exports']=function(_0x1b782c,_0x273f54){return _0x1b782c['define'](_0x514f('0x8'),attributes,{'tableName':_0x514f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 7cbd1b7..e627db7 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 _0x3848=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5ba703,_0x42de86){var _0x95d6f=function(_0x339694){while(--_0x339694){_0x5ba703['push'](_0x5ba703['shift']());}};_0x95d6f(++_0x42de86);}(_0x3848,0xd2));var _0x8384=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x3848[_0x57b236];return _0x4feb29;};'use strict';var _=require(_0x8384('0x0'));var util=require(_0x8384('0x1'));var moment=require(_0x8384('0x2'));var BPromise=require(_0x8384('0x3'));var rs=require(_0x8384('0x4'));var fs=require('fs');var Redis=require(_0x8384('0x5'));var db=require(_0x8384('0x6'))['db'];var utils=require(_0x8384('0x7'));var logger=require(_0x8384('0x8'))('rpc');var config=require(_0x8384('0x9'));var jayson=require(_0x8384('0xa'));var client=jayson[_0x8384('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3674e6,_0x338248,_0x39221e){return new BPromise(function(_0x19f54c,_0x21e953){return client[_0x8384('0xc')](_0x3674e6,_0x39221e)[_0x8384('0xd')](function(_0x612da8){logger[_0x8384('0xe')](_0x8384('0xf'),_0x338248,_0x8384('0x10'));logger[_0x8384('0x11')](_0x8384('0x12'),_0x338248,'request\x20sent',JSON['stringify'](_0x612da8));if(_0x612da8[_0x8384('0x13')]){if(_0x612da8[_0x8384('0x13')][_0x8384('0x14')]===0x1f4){logger['error'](_0x8384('0xf'),_0x338248,_0x612da8[_0x8384('0x13')][_0x8384('0x15')]);return _0x21e953(_0x612da8[_0x8384('0x13')][_0x8384('0x15')]);}logger[_0x8384('0x13')](_0x8384('0xf'),_0x338248,_0x612da8[_0x8384('0x13')][_0x8384('0x15')]);return _0x19f54c(_0x612da8['error'][_0x8384('0x15')]);}else{logger[_0x8384('0xe')](_0x8384('0xf'),_0x338248,_0x8384('0x10'));_0x19f54c(_0x612da8[_0x8384('0x16')][_0x8384('0x15')]);}})[_0x8384('0x17')](function(_0x5817e4){logger[_0x8384('0x13')](_0x8384('0xf'),_0x338248,_0x5817e4);_0x21e953(_0x5817e4);});});} \ No newline at end of file +var _0x63ff=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment'];(function(_0x2b9aaf,_0x2e6714){var _0x5d167d=function(_0x174a3f){while(--_0x174a3f){_0x2b9aaf['push'](_0x2b9aaf['shift']());}};_0x5d167d(++_0x2e6714);}(_0x63ff,0x16d));var _0xf63f=function(_0x24cfd6,_0x1ac0df){_0x24cfd6=_0x24cfd6-0x0;var _0x4234cb=_0x63ff[_0x24cfd6];return _0x4234cb;};'use strict';var _=require(_0xf63f('0x0'));var util=require(_0xf63f('0x1'));var moment=require(_0xf63f('0x2'));var BPromise=require('bluebird');var rs=require(_0xf63f('0x3'));var fs=require('fs');var Redis=require(_0xf63f('0x4'));var db=require(_0xf63f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf63f('0x6'))(_0xf63f('0x7'));var config=require(_0xf63f('0x8'));var jayson=require(_0xf63f('0x9'));var client=jayson[_0xf63f('0xa')][_0xf63f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cfc87,_0x225775,_0x54179a){return new BPromise(function(_0x2a7999,_0x2da9c9){return client['request'](_0x4cfc87,_0x54179a)[_0xf63f('0xc')](function(_0x3a0096){logger['info'](_0xf63f('0xd'),_0x225775,'request\x20sent');logger[_0xf63f('0xe')](_0xf63f('0xf'),_0x225775,_0xf63f('0x10'),JSON[_0xf63f('0x11')](_0x3a0096));if(_0x3a0096[_0xf63f('0x12')]){if(_0x3a0096['error'][_0xf63f('0x13')]===0x1f4){logger[_0xf63f('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x225775,_0x3a0096[_0xf63f('0x12')]['message']);return _0x2da9c9(_0x3a0096[_0xf63f('0x12')][_0xf63f('0x14')]);}logger[_0xf63f('0x12')](_0xf63f('0xd'),_0x225775,_0x3a0096[_0xf63f('0x12')][_0xf63f('0x14')]);return _0x2a7999(_0x3a0096[_0xf63f('0x12')][_0xf63f('0x14')]);}else{logger[_0xf63f('0x15')](_0xf63f('0xd'),_0x225775,'request\x20sent');_0x2a7999(_0x3a0096['result'][_0xf63f('0x14')]);}})[_0xf63f('0x16')](function(_0x5e63ec){logger[_0xf63f('0x12')](_0xf63f('0xd'),_0x225775,_0x5e63ec);_0x2da9c9(_0x5e63ec);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 824f3d2..7405184 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 _0xc803=['post','/:id/clone','clone','/:id/sections','addSections','put','update','delete','destroy','removeSections','removeResources','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','getSections','/:id/resources','getResources'];(function(_0x5dd15b,_0x26ce73){var _0x4a4b0b=function(_0x3e0938){while(--_0x3e0938){_0x5dd15b['push'](_0x5dd15b['shift']());}};_0x4a4b0b(++_0x26ce73);}(_0xc803,0x11a));var _0x3c80=function(_0x36b753,_0x5075a8){_0x36b753=_0x36b753-0x0;var _0x2a643e=_0xc803[_0x36b753];return _0x2a643e;};'use strict';var multer=require(_0x3c80('0x0'));var util=require('util');var path=require(_0x3c80('0x1'));var timeout=require(_0x3c80('0x2'));var express=require(_0x3c80('0x3'));var router=express['Router']();var auth=require(_0x3c80('0x4'));var interaction=require(_0x3c80('0x5'));var config=require('../../config/environment');var controller=require(_0x3c80('0x6'));router[_0x3c80('0x7')]('/',auth[_0x3c80('0x8')](),controller['index']);router['get'](_0x3c80('0x9'),auth[_0x3c80('0x8')](),controller[_0x3c80('0xa')]);router[_0x3c80('0x7')](_0x3c80('0xb'),auth[_0x3c80('0x8')](),controller['show']);router[_0x3c80('0x7')]('/:id/sections',auth[_0x3c80('0x8')](),controller[_0x3c80('0xc')]);router['get'](_0x3c80('0xd'),auth[_0x3c80('0x8')](),controller[_0x3c80('0xe')]);router[_0x3c80('0xf')]('/',auth[_0x3c80('0x8')](),controller['create']);router['post'](_0x3c80('0x10'),auth['isAuthenticated'](),controller[_0x3c80('0x11')]);router['post'](_0x3c80('0x12'),auth[_0x3c80('0x8')](),controller[_0x3c80('0x13')]);router[_0x3c80('0xf')](_0x3c80('0xd'),auth['isAuthenticated'](),controller['addResources']);router[_0x3c80('0x14')](_0x3c80('0xb'),auth['isAuthenticated'](),controller[_0x3c80('0x15')]);router[_0x3c80('0x16')](_0x3c80('0xb'),auth[_0x3c80('0x8')](),controller[_0x3c80('0x17')]);router['delete'](_0x3c80('0x12'),auth[_0x3c80('0x8')](),controller[_0x3c80('0x18')]);router[_0x3c80('0x16')](_0x3c80('0xd'),auth['isAuthenticated'](),controller[_0x3c80('0x19')]);module[_0x3c80('0x1a')]=router; \ No newline at end of file +var _0x25b2=['/:id/sections','getResources','post','create','/:id/clone','addSections','/:id/resources','put','delete','destroy','removeResources','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x4f12b1,_0x3ed71d){var _0x54d002=function(_0x289678){while(--_0x289678){_0x4f12b1['push'](_0x4f12b1['shift']());}};_0x54d002(++_0x3ed71d);}(_0x25b2,0x1ee));var _0x225b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x25b2[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0x225b('0x0'));var path=require(_0x225b('0x1'));var timeout=require(_0x225b('0x2'));var express=require('express');var router=express[_0x225b('0x3')]();var auth=require(_0x225b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x225b('0x5'));var controller=require('./userProfile.controller');router[_0x225b('0x6')]('/',auth['isAuthenticated'](),controller[_0x225b('0x7')]);router[_0x225b('0x6')](_0x225b('0x8'),auth['isAuthenticated'](),controller[_0x225b('0x9')]);router[_0x225b('0x6')](_0x225b('0xa'),auth[_0x225b('0xb')](),controller['show']);router[_0x225b('0x6')](_0x225b('0xc'),auth[_0x225b('0xb')](),controller['getSections']);router[_0x225b('0x6')]('/:id/resources',auth['isAuthenticated'](),controller[_0x225b('0xd')]);router[_0x225b('0xe')]('/',auth['isAuthenticated'](),controller[_0x225b('0xf')]);router[_0x225b('0xe')](_0x225b('0x10'),auth['isAuthenticated'](),controller['clone']);router[_0x225b('0xe')](_0x225b('0xc'),auth['isAuthenticated'](),controller[_0x225b('0x11')]);router[_0x225b('0xe')](_0x225b('0x12'),auth[_0x225b('0xb')](),controller['addResources']);router[_0x225b('0x13')]('/:id',auth[_0x225b('0xb')](),controller['update']);router[_0x225b('0x14')](_0x225b('0xa'),auth[_0x225b('0xb')](),controller[_0x225b('0x15')]);router['delete'](_0x225b('0xc'),auth[_0x225b('0xb')](),controller['removeSections']);router[_0x225b('0x14')]('/:id/resources',auth['isAuthenticated'](),controller[_0x225b('0x16')]);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 e795d6a..893aa9c 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 _0x38fd=['exports','STRING','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x475d44,_0x4988e9){var _0x45ceac=function(_0x590037){while(--_0x590037){_0x475d44['push'](_0x475d44['shift']());}};_0x45ceac(++_0x4988e9);}(_0x38fd,0x117));var _0xd38f=function(_0x22741c,_0x1b5982){_0x22741c=_0x22741c-0x0;var _0x2d274c=_0x38fd[_0x22741c];return _0x2d274c;};'use strict';var Sequelize=require(_0xd38f('0x0'));module[_0xd38f('0x1')]={'name':{'type':Sequelize[_0xd38f('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd38f('0x2')],'set':function(_0x297ef7){this[_0xd38f('0x3')](_0xd38f('0x4'),_0x297ef7?_0x297ef7['join'](''):[]);},'get':function(){return this['getDataValue'](_0xd38f('0x4'))?this[_0xd38f('0x5')]('crudPermissions')[_0xd38f('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd38f('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2136=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','name'];(function(_0x33608b,_0xff5330){var _0x51ac76=function(_0x3dd5ed){while(--_0x3dd5ed){_0x33608b['push'](_0x33608b['shift']());}};_0x51ac76(++_0xff5330);}(_0x2136,0x1eb));var _0x6213=function(_0x5c6968,_0x35f27a){_0x5c6968=_0x5c6968-0x0;var _0x243611=_0x2136[_0x5c6968];return _0x243611;};'use strict';var Sequelize=require(_0x6213('0x0'));module[_0x6213('0x1')]={'name':{'type':Sequelize[_0x6213('0x2')],'allowNull':![],'unique':_0x6213('0x3')},'crudPermissions':{'type':Sequelize[_0x6213('0x2')],'set':function(_0x31746c){this[_0x6213('0x4')](_0x6213('0x5'),_0x31746c?_0x31746c[_0x6213('0x6')](''):[]);},'get':function(){return this[_0x6213('0x7')]('crudPermissions')?this[_0x6213('0x7')](_0x6213('0x5'))[_0x6213('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 3f8d0fc..92b85a3 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 _0x3cba=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','body','catch','clone','find','createdAt','updatedAt','omit','transaction','create','get','each','autoAssociation','UserProfileResource','userProfileId','Resources','UserProfileSection','describe','addSections','sequelize','removeSections','ids','getSections','enabled','includes','sectionId','isEmpty','subsections','push','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','undefined','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','findOne','ignore','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','DefaultReports','CustomReports','Tag','Tags','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projects','JscriptyProject','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','queue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','users','Users','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','customdashboards','intervals','scheduler','Schedule','sounds','Sound','templates','Template','Trigger','trunks','Trunk','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0x344bfa,_0x138105){var _0x1436bf=function(_0xdd81cc){while(--_0xdd81cc){_0x344bfa['push'](_0x344bfa['shift']());}};_0x1436bf(++_0x138105);}(_0x3cba,0xda));var _0xa3cb=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0x3cba[_0x1098db];return _0x14f090;};'use strict';var pdf=require(_0xa3cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa3cb('0x1'));var zipdir=require(_0xa3cb('0x2'));var jsonpatch=require(_0xa3cb('0x3'));var rp=require(_0xa3cb('0x4'));var moment=require('moment');var BPromise=require(_0xa3cb('0x5'));var Mustache=require('mustache');var util=require(_0xa3cb('0x6'));var path=require('path');var sox=require(_0xa3cb('0x7'));var csv=require(_0xa3cb('0x8'));var ejs=require(_0xa3cb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa3cb('0xa'));var crypto=require(_0xa3cb('0xb'));var jsforce=require(_0xa3cb('0xc'));var deskjs=require(_0xa3cb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa3cb('0xe'));var Papa=require(_0xa3cb('0xf'));var Redis=require('ioredis');var authService=require(_0xa3cb('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa3cb('0x11'));var hardwareService=require(_0xa3cb('0x12'));var logger=require(_0xa3cb('0x13'))('api');var utils=require(_0xa3cb('0x14'));var config=require(_0xa3cb('0x15'));var db=require(_0xa3cb('0x16'))['db'];config[_0xa3cb('0x17')]=_[_0xa3cb('0x18')](config[_0xa3cb('0x17')],{'host':_0xa3cb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3cb('0x17')]));require(_0xa3cb('0x1a'))[_0xa3cb('0x1b')](socket);function respondWithStatusCode(_0x4c88ed,_0x3a972b){_0x3a972b=_0x3a972b||0xcc;return function(_0x19a2ab){if(_0x19a2ab){return _0x4c88ed[_0xa3cb('0x1c')](_0x3a972b);}return _0x4c88ed[_0xa3cb('0x1d')](_0x3a972b)[_0xa3cb('0x1e')]();};}function respondWithResult(_0x5368a6,_0xc864c6){_0xc864c6=_0xc864c6||0xc8;return function(_0x1705ba){if(_0x1705ba){return _0x5368a6[_0xa3cb('0x1d')](_0xc864c6)[_0xa3cb('0x1f')](_0x1705ba);}};}function respondWithFilteredResult(_0x4b9bdf,_0x2875f1){return function(_0x3e0002){if(_0x3e0002){var _0x317763=_0x3e0002[_0xa3cb('0x20')],_0x2cc6a6=_0x2875f1[_0xa3cb('0x21')],_0x20b38c=_0x2875f1[_0xa3cb('0x21')]+_0x2875f1[_0xa3cb('0x22')],_0x156eb7;if(_0x20b38c>=_0x317763){_0x20b38c=_0x317763;_0x156eb7=0xc8;}else{_0x156eb7=0xce;}_0x4b9bdf[_0xa3cb('0x1d')](_0x156eb7);return _0x4b9bdf['set'](_0xa3cb('0x23'),_0x2cc6a6+'-'+_0x20b38c+'/'+_0x317763)[_0xa3cb('0x1f')](_0x3e0002);}return null;};}function patchUpdates(_0x595c8e){return function(_0x1c30e5){try{jsonpatch[_0xa3cb('0x24')](_0x1c30e5,_0x595c8e,!![]);}catch(_0x449f72){return BPromise[_0xa3cb('0x25')](_0x449f72);}return _0x1c30e5[_0xa3cb('0x26')]();};}function saveUpdates(_0x22c6a7,_0x2a4269){return function(_0x39e5fa){if(_0x39e5fa){return _0x39e5fa['update'](_0x22c6a7)[_0xa3cb('0x27')](function(_0x2ffa94){return _0x2ffa94;});}return null;};}function removeEntity(_0x114e4d,_0xa61dc7){return function(_0x2cc890){if(_0x2cc890){return _0x2cc890[_0xa3cb('0x28')]()[_0xa3cb('0x27')](function(){_0x114e4d[_0xa3cb('0x1d')](0xcc)[_0xa3cb('0x1e')]();});}};}function handleEntityNotFound(_0x19ceb1,_0xc78265){return function(_0x59a36b){if(!_0x59a36b){_0x19ceb1[_0xa3cb('0x1c')](0x194);}return _0x59a36b;};}function handleError(_0xb5f795,_0x59c94d){_0x59c94d=_0x59c94d||0x1f4;return function(_0x57de10){logger[_0xa3cb('0x29')](_0x57de10[_0xa3cb('0x2a')]);if(_0x57de10[_0xa3cb('0x2b')]){delete _0x57de10[_0xa3cb('0x2b')];}_0xb5f795[_0xa3cb('0x1d')](_0x59c94d)[_0xa3cb('0x2c')](_0x57de10);};}exports['index']=function(_0x451cd6,_0x311f4a){var _0x340ceb={},_0x6550ab={},_0x31040d={'count':0x0,'rows':[]};var _0xe5df1a=_['map'](db[_0xa3cb('0x2d')][_0xa3cb('0x2e')],function(_0x1045c7){return{'name':_0x1045c7[_0xa3cb('0x2f')],'type':_0x1045c7[_0xa3cb('0x30')][_0xa3cb('0x31')]};});_0x6550ab[_0xa3cb('0x32')]=_[_0xa3cb('0x33')](_0xe5df1a,_0xa3cb('0x2b'));_0x6550ab[_0xa3cb('0x34')]=_[_0xa3cb('0x35')](_0x451cd6[_0xa3cb('0x34')]);_0x6550ab[_0xa3cb('0x36')]=_['intersection'](_0x6550ab[_0xa3cb('0x32')],_0x6550ab[_0xa3cb('0x34')]);_0x340ceb[_0xa3cb('0x37')]=_[_0xa3cb('0x38')](_0x6550ab[_0xa3cb('0x32')],qs[_0xa3cb('0x39')](_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x39')]));_0x340ceb[_0xa3cb('0x37')]=_0x340ceb[_0xa3cb('0x37')][_0xa3cb('0x3a')]?_0x340ceb[_0xa3cb('0x37')]:_0x6550ab['model'];if(!_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x3b')](_0xa3cb('0x3c'))){_0x340ceb[_0xa3cb('0x22')]=qs[_0xa3cb('0x22')](_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x22')]);_0x340ceb[_0xa3cb('0x21')]=qs[_0xa3cb('0x21')](_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x21')]);}_0x340ceb[_0xa3cb('0x3d')]=qs[_0xa3cb('0x3e')](_0x451cd6['query'][_0xa3cb('0x3e')]);_0x340ceb[_0xa3cb('0x3f')]=qs[_0xa3cb('0x36')](_[_0xa3cb('0x40')](_0x451cd6[_0xa3cb('0x34')],_0x6550ab[_0xa3cb('0x36')]),_0xe5df1a);if(_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x41')]){_0x340ceb[_0xa3cb('0x3f')]=_[_0xa3cb('0x42')](_0x340ceb[_0xa3cb('0x3f')],{'$or':_[_0xa3cb('0x33')](_0xe5df1a,function(_0x29b3ed){if(_0x29b3ed[_0xa3cb('0x30')]!==_0xa3cb('0x43')){var _0x33c588={};_0x33c588[_0x29b3ed['name']]={'$like':'%'+_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x41')]+'%'};return _0x33c588;}})});}_0x340ceb=_[_0xa3cb('0x42')]({},_0x340ceb,_0x451cd6[_0xa3cb('0x44')]);var _0x110860={'where':_0x340ceb[_0xa3cb('0x3f')]};return db[_0xa3cb('0x2d')][_0xa3cb('0x20')](_0x110860)[_0xa3cb('0x27')](function(_0x5883b1){_0x31040d[_0xa3cb('0x20')]=_0x5883b1;if(_0x451cd6[_0xa3cb('0x34')][_0xa3cb('0x45')]){_0x340ceb[_0xa3cb('0x46')]=[{'all':!![]}];}return db['UserProfile'][_0xa3cb('0x47')](_0x340ceb);})[_0xa3cb('0x27')](function(_0x19e7d1){_0x31040d[_0xa3cb('0x48')]=_0x19e7d1;return _0x31040d;})[_0xa3cb('0x27')](respondWithFilteredResult(_0x311f4a,_0x340ceb))['catch'](handleError(_0x311f4a,null));};exports[_0xa3cb('0x49')]=function(_0x47dd58,_0x878272){var _0x27e290={'raw':![],'where':{'id':_0x47dd58[_0xa3cb('0x4a')]['id']}},_0x3215e6={};_0x3215e6[_0xa3cb('0x32')]=_[_0xa3cb('0x35')](db['UserProfile']['rawAttributes']);_0x3215e6[_0xa3cb('0x34')]=_['keys'](_0x47dd58['query']);_0x3215e6['filters']=_['intersection'](_0x3215e6[_0xa3cb('0x32')],_0x3215e6['query']);_0x27e290[_0xa3cb('0x37')]=_['intersection'](_0x3215e6[_0xa3cb('0x32')],qs[_0xa3cb('0x39')](_0x47dd58[_0xa3cb('0x34')][_0xa3cb('0x39')]));_0x27e290[_0xa3cb('0x37')]=_0x27e290[_0xa3cb('0x37')][_0xa3cb('0x3a')]?_0x27e290['attributes']:_0x3215e6[_0xa3cb('0x32')];if(_0x47dd58[_0xa3cb('0x34')]['includeAll']){_0x27e290['include']=[{'all':!![]}];}_0x27e290=_[_0xa3cb('0x42')]({},_0x27e290,_0x47dd58[_0xa3cb('0x44')]);return db[_0xa3cb('0x2d')]['find'](_0x27e290)[_0xa3cb('0x27')](handleEntityNotFound(_0x878272,null))[_0xa3cb('0x27')](respondWithResult(_0x878272,null))['catch'](handleError(_0x878272,null));};exports['create']=function(_0x3b9ce3,_0x4437e9){return db[_0xa3cb('0x2d')]['create'](_0x3b9ce3[_0xa3cb('0x4b')],{})[_0xa3cb('0x27')](respondWithResult(_0x4437e9,0xc9))[_0xa3cb('0x4c')](handleError(_0x4437e9,null));};exports[_0xa3cb('0x4d')]=function(_0x1f8868,_0x467828){var _0x1360dc={'where':{'id':_0x1f8868[_0xa3cb('0x4a')]['id']}},_0x13fadc={};_0x13fadc['model']=_['keys'](db['UserProfile'][_0xa3cb('0x2e')]);_0x1360dc[_0xa3cb('0x37')]=_['intersection'](_0x13fadc[_0xa3cb('0x32')],qs['fields'](_0x1f8868[_0xa3cb('0x34')]['fields']));_0x1360dc['attributes']=_0x1360dc['attributes']['length']?_0x1360dc[_0xa3cb('0x37')]:_0x13fadc[_0xa3cb('0x32')];if(_0x1f8868[_0xa3cb('0x34')][_0xa3cb('0x45')]){_0x1360dc[_0xa3cb('0x46')]=[{'all':!![]}];}_0x1360dc=_[_0xa3cb('0x42')]({},_0x1360dc,_0x1f8868[_0xa3cb('0x44')]);return db[_0xa3cb('0x2d')][_0xa3cb('0x4e')](_0x1360dc)['then'](handleEntityNotFound(_0x467828,null))[_0xa3cb('0x27')](function(_0x28affa){if(_0x28affa){var _0x24231e=_0x28affa['get']({'plain':!![]});_0x24231e=qs['omit'](_0x24231e,['id',_0xa3cb('0x4f'),_0xa3cb('0x50'),'crudPermissions']);_0x1f8868[_0xa3cb('0x4b')]=_[_0xa3cb('0x51')](_0x1f8868[_0xa3cb('0x4b')],['id',_0xa3cb('0x4f'),_0xa3cb('0x50')]);return db['sequelize'][_0xa3cb('0x52')](function(_0x4d1c34){return db[_0xa3cb('0x2d')][_0xa3cb('0x53')](_[_0xa3cb('0x42')](_0x24231e,_0x1f8868[_0xa3cb('0x4b')]),{'include':_0x1f8868[_0xa3cb('0x34')][_0xa3cb('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x4d1c34})['then'](function(_0x13876a){var _0x1f4c87=_0x13876a[_0xa3cb('0x54')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x1f8868['params']['id']},'raw':!![]})[_0xa3cb('0x27')](function(_0x29e131){if(_0x29e131){return BPromise[_0xa3cb('0x55')](_0x29e131,function(_0x1b045c){return new BPromise(function(_0x2a12f6,_0x4fabfc){if(_0x1b045c[_0xa3cb('0x56')]===null||_0x1b045c[_0xa3cb('0x56')]===0x1)_0x2a12f6(null);return db[_0xa3cb('0x57')][_0xa3cb('0x47')]({'where':{'sectionId':_0x1b045c['id']},'raw':!![]})[_0xa3cb('0x27')](function(_0x508030){var _0x3fabe7=_[_0xa3cb('0x33')](_0x508030,function(_0x466e0e){return qs[_0xa3cb('0x51')](_0x466e0e,['id','createdAt',_0xa3cb('0x50'),'sectionId']);});_0x2a12f6(_0x3fabe7);})[_0xa3cb('0x4c')](function(_0x120d8c){_0x4fabfc(_0x120d8c);});})[_0xa3cb('0x27')](function(_0x5dec38){var _0x2e633b=qs['omit'](_0x1b045c,['id',_0xa3cb('0x4f'),_0xa3cb('0x50')]);_0x2e633b[_0xa3cb('0x58')]=_0x1f4c87['id'];if(_0x5dec38)_0x2e633b[_0xa3cb('0x59')]=_0x5dec38;return _0x2e633b;})[_0xa3cb('0x27')](function(_0x2822dc){return db[_0xa3cb('0x5a')][_0xa3cb('0x53')](_0x2822dc,{'include':[{'model':db[_0xa3cb('0x57')],'as':_0xa3cb('0x59')}],'raw':!![],'transaction':_0x4d1c34});});})['then'](function(){return _0x1f4c87;});}});});});}})[_0xa3cb('0x27')](respondWithResult(_0x467828,0xc9))[_0xa3cb('0x4c')](handleError(_0x467828,null));};exports['update']=function(_0x83666d,_0xcafc63){if(_0x83666d[_0xa3cb('0x4b')]['id']){delete _0x83666d['body']['id'];}return db[_0xa3cb('0x2d')][_0xa3cb('0x4e')]({'where':{'id':_0x83666d[_0xa3cb('0x4a')]['id']}})[_0xa3cb('0x27')](handleEntityNotFound(_0xcafc63,null))[_0xa3cb('0x27')](saveUpdates(_0x83666d[_0xa3cb('0x4b')],null))[_0xa3cb('0x27')](respondWithResult(_0xcafc63,null))['catch'](handleError(_0xcafc63,null));};exports[_0xa3cb('0x28')]=function(_0x14e7ae,_0xc1cd24){return db[_0xa3cb('0x2d')]['find']({'where':{'id':_0x14e7ae[_0xa3cb('0x4a')]['id']}})[_0xa3cb('0x27')](handleEntityNotFound(_0xc1cd24,null))[_0xa3cb('0x27')](removeEntity(_0xc1cd24,null))['catch'](handleError(_0xc1cd24,null));};exports[_0xa3cb('0x5b')]=function(_0x251e02,_0x29fe46){return db[_0xa3cb('0x2d')]['describe']()[_0xa3cb('0x27')](respondWithResult(_0x29fe46,null))['catch'](handleError(_0x29fe46,null));};exports[_0xa3cb('0x5c')]=function(_0x5446ac,_0x57b382){var _0xcce627=_0x5446ac[_0xa3cb('0x4b')];return db['UserProfile'][_0xa3cb('0x4e')]({'where':{'id':_0x5446ac[_0xa3cb('0x4a')]['id']}})[_0xa3cb('0x27')](handleEntityNotFound(_0x57b382,null))[_0xa3cb('0x27')](function(_0x348900){if(_0x348900){return db[_0xa3cb('0x5d')][_0xa3cb('0x52')](function(_0x48e4b0){return db[_0xa3cb('0x5a')]['destroy']({'where':{'userProfileId':_0x5446ac['params']['id'],'sectionId':_[_0xa3cb('0x33')](_0xcce627,function(_0x510b4f){return _0x510b4f['sectionId'];})},'transaction':_0x48e4b0})[_0xa3cb('0x27')](function(){var _0x4c79c6=_[_0xa3cb('0x33')](_0xcce627,function(_0x2fc7e1){_0x2fc7e1[_0xa3cb('0x58')]=_0x5446ac[_0xa3cb('0x4a')]['id'];return _0x2fc7e1;});var _0x1c4544=[];return BPromise[_0xa3cb('0x55')](_0x4c79c6,function(_0x33dff0){return db[_0xa3cb('0x5a')][_0xa3cb('0x53')](_0x33dff0,{'include':[{'model':db[_0xa3cb('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x48e4b0})[_0xa3cb('0x27')](function(_0x497ab2){_0x1c4544['push'](_0x497ab2[_0xa3cb('0x54')]({'plain':!![]}));});})[_0xa3cb('0x27')](function(){return _0x1c4544;});});});}})[_0xa3cb('0x27')](function(_0x4344bf){return _0x4344bf;})[_0xa3cb('0x27')](respondWithResult(_0x57b382,null))[_0xa3cb('0x4c')](handleError(_0x57b382,null));};exports[_0xa3cb('0x5e')]=function(_0x14960a,_0x56bd3d){var _0x336f4a;return db[_0xa3cb('0x2d')][_0xa3cb('0x4e')]({'where':{'id':_0x14960a[_0xa3cb('0x4a')]['id']},'attributes':['id',_0xa3cb('0x2b')]})[_0xa3cb('0x27')](handleEntityNotFound(_0x56bd3d,null))[_0xa3cb('0x27')](function(_0x1e0e2d){if(_0x1e0e2d){_0x336f4a=_0x1e0e2d;return db[_0xa3cb('0x5a')][_0xa3cb('0x28')]({'where':{'userProfileId':_0x14960a[_0xa3cb('0x4a')]['id'],'sectionId':_0x14960a[_0xa3cb('0x34')][_0xa3cb('0x5f')]}});}})[_0xa3cb('0x27')](function(){return _0x336f4a;})[_0xa3cb('0x27')](respondWithStatusCode(_0x56bd3d,null))[_0xa3cb('0x4c')](handleError(_0x56bd3d,null));};exports[_0xa3cb('0x60')]=function(_0x48249e,_0x45fd0e){var _0x15dca2=[];var _0x2532d4=[];return db['UserProfileSection'][_0xa3cb('0x47')]({'where':{'userProfileId':_0x48249e[_0xa3cb('0x4a')]['id']},'raw':!![]})[_0xa3cb('0x27')](function(_0x242b5b){_0x15dca2=_[_0xa3cb('0x41')](_0x242b5b,function(_0x2f4899){return _0x2f4899[_0xa3cb('0x61')]===0x1||_[_0xa3cb('0x62')]([0x3eb,0x709],_0x2f4899[_0xa3cb('0x63')]);});if(!_[_0xa3cb('0x64')](_0x15dca2)){return _['map'](_0x15dca2,function(_0x2c0d2d){return _0x2c0d2d[_0xa3cb('0x63')];});}else{return;}})['then'](function(_0x5439d3){if(_0x5439d3)_0x2532d4=_0x5439d3;if(_[_0xa3cb('0x62')](_0x2532d4,0x64)){var _0x1b46e9=_['find'](_0x15dca2,{'sectionId':0x64});return hasDefaultDashboard(_0x1b46e9)[_0xa3cb('0x27')](function(_0x1a033f){return _[_0xa3cb('0x33')](_0x15dca2,function(_0x69fcc){if(_0x69fcc[_0xa3cb('0x63')]===0x64){_0x69fcc[_0xa3cb('0x65')]=_0x1a033f;}return _0x69fcc;});});}else{return;}})[_0xa3cb('0x27')](function(_0x54f2b3){if(_0x54f2b3)_0x15dca2=_0x54f2b3;if(_[_0xa3cb('0x62')](_0x2532d4,0x3eb)){var _0xe0f3f3=_[_0xa3cb('0x4e')](_0x15dca2,{'sectionId':0x3eb});return getCustomDashboards(_0xe0f3f3)[_0xa3cb('0x27')](function(_0x28f9cb){return _['map'](_0x15dca2,function(_0x11ec29){if(_0xe0f3f3[_0xa3cb('0x61')]){if(_0x11ec29[_0xa3cb('0x63')]===0x3eb){_0x11ec29[_0xa3cb('0x65')]=_0x28f9cb;}}else{if(_0x11ec29[_0xa3cb('0x63')]===0x64){_0x11ec29[_0xa3cb('0x65')]=_0x28f9cb;}}return _0x11ec29;});});}else{return;}})['then'](function(_0x4d1b47){if(_0x4d1b47)_0x15dca2=_0x4d1b47;if(_[_0xa3cb('0x62')](_0x2532d4,0x709)){var _0x29624b=_[_0xa3cb('0x4e')](_0x15dca2,{'sectionId':0x709});return getPlugins(_0x29624b)[_0xa3cb('0x27')](function(_0x394895){if(_0x29624b[_0xa3cb('0x61')]){return _[_0xa3cb('0x33')](_0x15dca2,function(_0x3d71c2){if(_0x3d71c2['sectionId']===0x709){_0x3d71c2['subsections']=_0x394895;}return _0x3d71c2;});}else{var _0x235e67={'sectionId':0x76c,'enabled':0x1,'subsections':_0x394895};var _0x182192=_[_0xa3cb('0x33')](_0x15dca2);_0x182192[_0xa3cb('0x66')](_0x235e67);return _0x182192;}});}else{return;}})[_0xa3cb('0x27')](function(_0x2bd60d){if(_0x2bd60d)_0x15dca2=_0x2bd60d;return _[_0xa3cb('0x41')](_0x15dca2,['enabled',0x1]);})[_0xa3cb('0x27')](respondWithResult(_0x45fd0e,null))[_0xa3cb('0x4c')](handleError(_0x45fd0e,null));};function hasDefaultDashboard(_0x5eae0b){var _0x276fe7=[0x65];return new BPromise(function(_0x1a11b5,_0x5bd746){try{if(_0x5eae0b['autoAssociation']){_0x1a11b5(_0x276fe7);}else{return db[_0xa3cb('0x57')]['findOne']({'where':{'sectionId':_0x5eae0b['id']},'raw':!![]})['then'](function(_0x267fda){_0x267fda?_0x1a11b5(_0x276fe7):_0x1a11b5();});}}catch(_0x21ef56){_0x5bd746(_0x21ef56);}});}function getCustomDashboards(_0x4a04fa){var _0x5b695b=[];return new BPromise(function(_0x4ac0a7,_0x4d85ae){try{if(_0x4a04fa[_0xa3cb('0x56')]){return db[_0xa3cb('0x67')][_0xa3cb('0x47')]({'raw':!![]})[_0xa3cb('0x27')](function(_0x11e9d0){_0x11e9d0[_0xa3cb('0x68')](function(_0x535cb4){_0x5b695b[_0xa3cb('0x66')](_0x535cb4['id']+0x1869f);});_0x4ac0a7(_0x5b695b);});}else{return db[_0xa3cb('0x57')][_0xa3cb('0x47')]({'where':{'sectionId':_0x4a04fa['id']},'raw':!![]})[_0xa3cb('0x27')](function(_0x240478){_0x240478[_0xa3cb('0x68')](function(_0x597a3e){_0x5b695b[_0xa3cb('0x66')](_0x597a3e[_0xa3cb('0x69')]+0x1869f);});_0x4ac0a7(_0x5b695b);});}}catch(_0x3f9a1c){_0x4d85ae(_0x3f9a1c);}});}function getPlugins(_0x39b38f){var _0x4fc82d=[];return new BPromise(function(_0x19ce2f,_0x2f3c7f){try{if(_0x39b38f[_0xa3cb('0x56')]){return db[_0xa3cb('0x6a')][_0xa3cb('0x47')]({'raw':!![]})[_0xa3cb('0x27')](function(_0x46ce19){_0x46ce19[_0xa3cb('0x68')](function(_0xfac1ce){_0x4fc82d[_0xa3cb('0x66')](_0xfac1ce['id']+0x15b38);});_0x19ce2f(_0x4fc82d);});}else{return db[_0xa3cb('0x57')]['findAll']({'where':{'sectionId':_0x39b38f['id']},'raw':!![]})[_0xa3cb('0x27')](function(_0x47c3b9){_0x47c3b9[_0xa3cb('0x68')](function(_0x5c7057){_0x4fc82d[_0xa3cb('0x66')](_0x5c7057[_0xa3cb('0x69')]+0x15b38);});_0x19ce2f(_0x4fc82d);});}}catch(_0xedd493){_0x2f3c7f(_0xedd493);}});}exports[_0xa3cb('0x6b')]=function(_0x5b47ee,_0x1fc31e){return db[_0xa3cb('0x2d')][_0xa3cb('0x4e')]({'where':{'id':_0x5b47ee[_0xa3cb('0x4a')]['id']}})[_0xa3cb('0x27')](handleEntityNotFound(_0x1fc31e,null))[_0xa3cb('0x27')](function(_0x520136){if(_0x520136){return db['sequelize'][_0xa3cb('0x52')](function(_0xd2c73d){return db[_0xa3cb('0x5a')][_0xa3cb('0x47')]({'where':{'userProfileId':_0x5b47ee[_0xa3cb('0x4a')]['id']},'attributes':['id'],'raw':!![]})[_0xa3cb('0x27')](function(_0x22c75b){if(_0x22c75b){return db[_0xa3cb('0x5a')]['destroy']({'where':{'userProfileId':_0x5b47ee['params']['id'],'id':_[_0xa3cb('0x33')](_0x22c75b,function(_0x50f489){return _0x50f489['id'];})},'transaction':_0xd2c73d});}})['then'](function(_0x1335f9){var _0x3deefb=_[_0xa3cb('0x33')](_0x5b47ee['body'],function(_0xa10682){_0xa10682[_0xa3cb('0x58')]=_0x5b47ee[_0xa3cb('0x4a')]['id'];return _0xa10682;});return db[_0xa3cb('0x5a')][_0xa3cb('0x6c')](_0x3deefb,{'raw':!![],'transaction':_0xd2c73d});})[_0xa3cb('0x27')](function(_0x52aa46){var _0x393fb0=_['filter'](_['map'](_0x52aa46,function(_0x231045){return _0x231045['get']({'plain':!![]});}),{'includeAll':![]});if(_0x393fb0){return db[_0xa3cb('0x5a')][_0xa3cb('0x47')]({'where':{'userProfileId':_0x5b47ee['params']['id'],'sectionId':_[_0xa3cb('0x33')](_0x393fb0,function(_0x166f25){return _0x166f25[_0xa3cb('0x63')];})},'attributes':['id',_0xa3cb('0x63')],'raw':!![]})[_0xa3cb('0x27')](function(_0x5a4952){var _0x14f6de=_['map'](_0x5b47ee[_0xa3cb('0x4b')],function(_0x318210){_0x318210[_0xa3cb('0x58')]=_0x5b47ee[_0xa3cb('0x4a')]['id'];return _0x318210;});return db[_0xa3cb('0x57')][_0xa3cb('0x6c')](_0x14f6de,{'raw':!![],'transaction':_0xd2c73d});});}})['catch'](handleError(_0x1fc31e,null));});}})['then'](function(_0x362364){var _0x3398d8=_['map'](_0x362364,function(_0x594ddd){return _0x594ddd[_0xa3cb('0x54')]({'plain':!![]});});})['then'](respondWithResult(_0x1fc31e,null))[_0xa3cb('0x4c')](handleError(_0x1fc31e,null));};exports[_0xa3cb('0x6d')]=function(_0x192c00,_0x385098,_0x17bef8){return db[_0xa3cb('0x2d')]['find']({'where':{'id':_0x192c00[_0xa3cb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x385098,null))[_0xa3cb('0x27')](function(_0x331138){if(_0x331138){return _0x331138[_0xa3cb('0x6d')](_0x192c00['query'][_0xa3cb('0x5f')]);}})[_0xa3cb('0x27')](respondWithStatusCode(_0x385098,null))['catch'](handleError(_0x385098,null));};exports[_0xa3cb('0x6e')]=function(_0x212aef,_0x53fdfe){var _0xa6922d={'raw':![],'where':{}};var _0x2f2ad8={};var _0x562de8={'count':0x0,'rows':[]};var _0x2ebeb9=_0x212aef['query'][_0xa3cb('0x6f')];if(typeof _0x2ebeb9===_0xa3cb('0x70')){throw new db['Sequelize'][(_0xa3cb('0x71'))](_0xa3cb('0x72'));}var _0x53c569=_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x73')]||![];var _0x47c7e3=getQueryModels(_0x2ebeb9,_0x53c569);if(typeof _0x47c7e3[_0xa3cb('0x74')]===_0xa3cb('0x70')){throw new db['Sequelize'][(_0xa3cb('0x71'))](_0xa3cb('0x75')+_0x2ebeb9+'\x27');}var _0x19cf8d=[];if(!_['isEmpty'](_0x47c7e3[_0xa3cb('0x76')])){_0x19cf8d=_0x47c7e3[_0xa3cb('0x76')];}else{_0x19cf8d=[{'name':_0x2ebeb9}];}return db[_0xa3cb('0x2d')][_0xa3cb('0x77')]({'where':{'id':_0x212aef[_0xa3cb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53fdfe,null))[_0xa3cb('0x27')](function(_0x25585b){if(_0x25585b){var _0x3b1cfa=[];for(var _0xbbf5af=0x0;_0xbbf5af<_0x19cf8d[_0xa3cb('0x3a')];_0xbbf5af++){_0x3b1cfa['push'](db[_0xa3cb('0x5a')][_0xa3cb('0x77')]({'where':{'userProfileId':_0x25585b['id'],'name':_0x19cf8d[_0xbbf5af]['name']},'raw':!![]}));}return BPromise['all'](_0x3b1cfa);}})[_0xa3cb('0x27')](function(_0x5ef7c4){var _0x128c68=_[_0xa3cb('0x41')](_0x5ef7c4,function(_0x1edfc6){return _0x1edfc6?_0x1edfc6:undefined;});var _0xe592d5=_[_0xa3cb('0x41')](_0x19cf8d,[_0xa3cb('0x78'),!![]]);var _0xaf3f6e=_[_0xa3cb('0x64')](_0x128c68)&&_[_0xa3cb('0x64')](_0xe592d5)?null:_['union'](_0xe592d5,_0x128c68);if(_0xaf3f6e){var _0x5c6461=[];for(var _0x3b7fa0=0x0;_0x3b7fa0<_0xaf3f6e[_0xa3cb('0x3a')];_0x3b7fa0++){var _0x482074=_[_0xa3cb('0x4e')](_0x19cf8d,function(_0x412704){return _0xaf3f6e[_0x3b7fa0]?_0x412704[_0xa3cb('0x2b')]===_0xaf3f6e[_0x3b7fa0][_0xa3cb('0x2b')]:null;});if(_0x482074){if(_0xaf3f6e[_0x3b7fa0][_0xa3cb('0x78')]){_0x5c6461[_0xa3cb('0x66')](getAllResources(_0x47c7e3[_0xa3cb('0x74')],_0xaf3f6e[_0x3b7fa0]));}else{if(!_0xaf3f6e[_0x3b7fa0]['autoAssociation']){_0x5c6461['push'](getAllowedResources(_0x482074,_0xaf3f6e[_0x3b7fa0],_0x47c7e3[_0xa3cb('0x74')]));}else{if(_0x482074[_0xa3cb('0x32')]){_0x5c6461[_0xa3cb('0x66')](getAllFilteredResources(_0x482074,_0xaf3f6e[_0x3b7fa0]));}}}}}return BPromise['all'](_0x5c6461);}else{return null;}})['then'](function(_0x4d8be5){var _0x56b0c1=_0x4d8be5;var _0x395f3d=null;if(_0x56b0c1){_0x395f3d=_0x56b0c1['length']===0x1?_0x56b0c1[0x0]:null;}if(_0x395f3d||_0x56b0c1){var _0x583461=db[_0x47c7e3[_0xa3cb('0x74')]][_0xa3cb('0x2e')];_0x2f2ad8[_0xa3cb('0x32')]=_[_0xa3cb('0x35')](_0x583461);_0x2f2ad8[_0xa3cb('0x34')]=_[_0xa3cb('0x35')](_0x212aef['query']);_0x2f2ad8['filters']=_[_0xa3cb('0x38')](_0x2f2ad8[_0xa3cb('0x32')],_0x2f2ad8[_0xa3cb('0x34')]);_0xa6922d[_0xa3cb('0x37')]=_[_0xa3cb('0x38')](_0x2f2ad8[_0xa3cb('0x32')],qs[_0xa3cb('0x39')](_0x212aef['query'][_0xa3cb('0x39')]));_0xa6922d[_0xa3cb('0x37')]=_0xa6922d['attributes'][_0xa3cb('0x3a')]?_0xa6922d[_0xa3cb('0x37')]:_0x2f2ad8[_0xa3cb('0x32')];if(!_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x3b')](_0xa3cb('0x3c'))){_0xa6922d[_0xa3cb('0x22')]=qs[_0xa3cb('0x22')](_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x22')]);_0xa6922d[_0xa3cb('0x21')]=qs[_0xa3cb('0x21')](_0x212aef[_0xa3cb('0x34')]['offset']);}_0xa6922d[_0xa3cb('0x3d')]=qs[_0xa3cb('0x3e')](_0x212aef['query'][_0xa3cb('0x3e')]);_0xa6922d[_0xa3cb('0x3f')]=qs['filters'](_['pick'](_0x212aef[_0xa3cb('0x34')],_0x2f2ad8[_0xa3cb('0x36')]));if(_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x41')]){_0xa6922d[_0xa3cb('0x3f')]=_[_0xa3cb('0x42')](_0xa6922d[_0xa3cb('0x3f')],{'$or':_[_0xa3cb('0x33')](_0x583461,function(_0xeea7bd){if(_0xeea7bd[_0xa3cb('0x30')][_0xa3cb('0x31')]!==_0xa3cb('0x43')){var _0x1ce29d={};_0x1ce29d[_0xeea7bd['field']]={'$like':'%'+_0x212aef['query'][_0xa3cb('0x41')]+'%'};return _0x1ce29d;}})});}var _0x25449c=[];if(_0x395f3d){var _0x1ca9f4=_[_0xa3cb('0x4e')](_0x19cf8d,[_0xa3cb('0x2b'),_0x395f3d[_0xa3cb('0x2b')]]);if(_0x1ca9f4[_0xa3cb('0x79')]){var _0x3add47={};if(_0x47c7e3[_0xa3cb('0x74')]===_0xa3cb('0x7a')){_0x3add47[_0x1ca9f4[_0xa3cb('0x7b')]]=_[_0xa3cb('0x33')](_0x395f3d[_0xa3cb('0x7c')],'id');}else{_0x3add47[_0x1ca9f4[_0xa3cb('0x7b')]]=_0x395f3d['associatedResources'];}_0x25449c[_0xa3cb('0x66')](_0x3add47);}else{_0xa6922d[_0xa3cb('0x3f')]['id']=_0x395f3d[_0xa3cb('0x7c')];}}else{for(var _0x38244c=0x0;_0x38244c<_0x56b0c1[_0xa3cb('0x3a')];_0x38244c++){var _0x1ca9f4=_[_0xa3cb('0x4e')](_0x19cf8d,['name',_0x56b0c1[_0x38244c]['name']]);if(_0x1ca9f4[_0xa3cb('0x79')]){var _0x3add47={};_0x3add47[_0x1ca9f4[_0xa3cb('0x7b')]]=_0x56b0c1[_0x38244c][_0xa3cb('0x7c')];_0x25449c['push'](_0x3add47);}else{if(!_0xa6922d['where']['id'])_0xa6922d[_0xa3cb('0x3f')]['id']=[];_0x56b0c1[_0x38244c][_0xa3cb('0x7c')][_0xa3cb('0x68')](function(_0x38f1ef){_0xa6922d[_0xa3cb('0x3f')]['id'][_0xa3cb('0x66')](_0x38f1ef);});}}}if(!_[_0xa3cb('0x64')](_0x25449c)){_0xa6922d[_0xa3cb('0x3f')]=_[_0xa3cb('0x42')](_0xa6922d[_0xa3cb('0x3f')],{'$and':{'$or':_0x25449c}});}_0xa6922d=_['merge']({},_0xa6922d,_0x212aef[_0xa3cb('0x44')]);if(_0x395f3d&&!_0x395f3d[_0xa3cb('0x56')]&&_0x47c7e3[_0xa3cb('0x74')]===_0xa3cb('0x7a')){if(_0x212aef['query'][_0xa3cb('0x45')]){_0xa6922d[_0xa3cb('0x46')]=[{'all':!![]}];}return db[_0x47c7e3[_0xa3cb('0x74')]][_0xa3cb('0x47')](_0xa6922d)[_0xa3cb('0x27')](function(_0x595f2c){var _0x58ce33=[];_0x595f2c[_0xa3cb('0x68')](function(_0x225352){var _0x576acc;switch(_0x225352[_0xa3cb('0x7d')]){case _0xa3cb('0x7e'):_0x576acc=_[_0xa3cb('0x4e')](_0x395f3d[_0xa3cb('0x7c')],function(_0x4e71d4){return _0x4e71d4['id']===_0x225352[_0xa3cb('0x7f')]&&_0x4e71d4[_0xa3cb('0x30')]===_0xa3cb('0x80');});break;case'custom':_0x576acc=_[_0xa3cb('0x4e')](_0x395f3d[_0xa3cb('0x7c')],function(_0x109468){return _0x109468['id']===_0x225352[_0xa3cb('0x7f')]&&_0x109468[_0xa3cb('0x30')]===_0xa3cb('0x81');});break;}if(_0x576acc)_0x58ce33['push'](_0x225352);});_0x562de8[_0xa3cb('0x20')]=_0x58ce33[_0xa3cb('0x3a')];_0x562de8[_0xa3cb('0x48')]=_0x58ce33;return _0x562de8;});}else{return db[_0x47c7e3['childModel']][_0xa3cb('0x20')]({'where':_0xa6922d[_0xa3cb('0x3f')]})[_0xa3cb('0x27')](function(_0x992a44){_0x562de8[_0xa3cb('0x20')]=_0x992a44;if(_0x212aef['query'][_0xa3cb('0x45')]){if(_0x47c7e3[_0xa3cb('0x74')]==='CmContact'){_0xa6922d[_0xa3cb('0x46')]=[{'model':db[_0xa3cb('0x82')],'as':_0xa3cb('0x83'),'attributes':['id',_0xa3cb('0x2b'),'color'],'required':_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x84')]?!![]:![]},{'model':db[_0xa3cb('0x82')],'as':_0xa3cb('0x85'),'attributes':['id',_0xa3cb('0x2b'),'color'],'through':_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x84')]?{'attributes':[],'where':{'TagId':_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x84')]||undefined}}:{},'required':_0x212aef[_0xa3cb('0x34')][_0xa3cb('0x84')]?!![]:![]}];}else{_0xa6922d[_0xa3cb('0x46')]=[{'all':!![]}];}}return db[_0x47c7e3['childModel']][_0xa3cb('0x47')](_0xa6922d);})[_0xa3cb('0x27')](function(_0x1ea04f){_0x562de8[_0xa3cb('0x48')]=_0x1ea04f;return _0x562de8;});}}else{return _0x562de8;}})[_0xa3cb('0x27')](respondWithFilteredResult(_0x53fdfe,_0xa6922d))[_0xa3cb('0x4c')](handleError(_0x53fdfe,null));};function getAllResources(_0x222eca,_0x187c19){return new BPromise(function(_0x1eed98,_0x2dead7){if(_0x187c19){var _0x2d0a26=_0x187c19[_0xa3cb('0x41')]?{[_0x187c19[_0xa3cb('0x41')][_0xa3cb('0x79')]]:_0x187c19[_0xa3cb('0x41')][_0xa3cb('0x86')]}:undefined;return db[_0x222eca]['findAll']({'where':_0x2d0a26,'raw':!![]})[_0xa3cb('0x27')](function(_0x4df2b0){_0x187c19[_0xa3cb('0x7c')]=_['map'](_0x4df2b0,'id');_0x1eed98(_0x187c19);})[_0xa3cb('0x4c')](function(_0x2f0a05){_0x2dead7(_0x2f0a05);});}else{_0x1eed98(null);}});}function getAllFilteredResources(_0x568c24,_0x5520c4){return new BPromise(function(_0x15a54f,_0x26ff38){var _0x3846bf=_0x568c24['filter']?{[_0x568c24[_0xa3cb('0x41')][_0xa3cb('0x79')]]:_0x568c24[_0xa3cb('0x41')][_0xa3cb('0x86')]}:undefined;return db[_0x568c24[_0xa3cb('0x32')]][_0xa3cb('0x47')]({'where':_0x3846bf,'raw':!![]})[_0xa3cb('0x27')](function(_0x8b37d0){_0x5520c4[_0xa3cb('0x7c')]=_[_0xa3cb('0x33')](_0x8b37d0,function(_0x537542){return _0x537542['name'];});_0x15a54f(_0x5520c4);})[_0xa3cb('0x4c')](function(_0x264e70){_0x26ff38(_0x264e70);});});}function getAllowedResources(_0x2fd95b,_0x1697e7,_0x2b7828){return new BPromise(function(_0xe45db4,_0x5a7ba8){if(_0x1697e7){return db[_0xa3cb('0x57')]['findAll']({'where':{'sectionId':_0x1697e7['id']},'raw':!![]})[_0xa3cb('0x27')](function(_0x91bb7){if(_0x2fd95b['field']&&_0x2fd95b[_0xa3cb('0x79')]!=='id'){_0x1697e7[_0xa3cb('0x7c')]=_[_0xa3cb('0x33')](_0x91bb7,function(_0x34bb44){return _0x34bb44[_0x2fd95b['field']];});}else{if(_0x2b7828===_0xa3cb('0x7a')){_0x1697e7[_0xa3cb('0x7c')]=_['map'](_0x91bb7,function(_0x5e152a){return{'id':_0x5e152a[_0xa3cb('0x69')],'type':_0x5e152a[_0xa3cb('0x30')]};});}else{_0x1697e7['associatedResources']=_[_0xa3cb('0x33')](_0x91bb7,function(_0x18e959){return _0x18e959[_0xa3cb('0x69')];});}}_0xe45db4(_0x1697e7);})[_0xa3cb('0x4c')](function(_0x4aea18){_0x5a7ba8(_0x4aea18);});}else{_0xe45db4(null);}});}function getQueryModels(_0x1b2795,_0xe35e17){var _0x35eb14=_0x1b2795[_0xa3cb('0x87')]();var _0x295551={'childModel':undefined,'parentSections':[]};switch(_0x35eb14){case _0xa3cb('0x88'):_0x295551['childModel']=_0xa3cb('0x89');break;case _0xa3cb('0x8a'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x8b');break;case'squarerecordings':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x8c');_0x295551[_0xa3cb('0x76')]=[{'name':_0xa3cb('0x8d'),'field':_0xa3cb('0x2b'),'foreignKey':'projectName'}];break;case _0xa3cb('0x8e'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x8f');break;case'contacts':_0x295551['childModel']=_0xa3cb('0x90');_0x295551[_0xa3cb('0x76')]=[{'name':_0xa3cb('0x91'),'field':'id','foreignKey':_0xa3cb('0x92')}];break;case _0xa3cb('0x93'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x94');break;case _0xa3cb('0x95'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x96');break;case _0xa3cb('0x97'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x98');break;case _0xa3cb('0x99'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x9a');break;case _0xa3cb('0x9b'):_0x295551[_0xa3cb('0x74')]='ChatWebsite';break;case _0xa3cb('0x9c'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x9d');break;case _0xa3cb('0x9e'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x9f');break;case _0xa3cb('0xa0'):case _0xa3cb('0xa1'):case'outboundroutes':_0x295551[_0xa3cb('0x74')]='VoiceExtension';break;case _0xa3cb('0xa2'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xa3');break;case _0xa3cb('0xa4'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xa5');break;case _0xa3cb('0xa6'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xa7');_0x295551[_0xa3cb('0x76')]=[{'name':_0xa3cb('0xa8'),'field':_0xa3cb('0x2b'),'foreignKey':'membername','model':_0xa3cb('0xa9'),'filter':{'field':_0xa3cb('0xaa'),'value':[_0xa3cb('0xab')]}},{'name':_0xa3cb('0xac'),'field':'name','foreignKey':_0xa3cb('0xad'),'model':'User','filter':{'field':_0xa3cb('0xaa'),'value':[_0xa3cb('0xae')]}},{'name':_0xa3cb('0xaf'),'field':'name','foreignKey':'queue','model':_0xa3cb('0xb0'),'filter':{'field':'type','value':[_0xa3cb('0xb1')]}},{'name':_0xa3cb('0xb2'),'field':_0xa3cb('0x2b'),'foreignKey':_0xa3cb('0xb3'),'model':_0xa3cb('0xb0'),'filter':{'field':'type','value':['outbound']}}];break;case _0xa3cb('0xb4'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xb5');break;case _0xa3cb('0xb6'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xb7');break;case _0xa3cb('0xb8'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xb9');break;case'ivrcampaigns':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xba');break;case'mailqueues':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xbb');break;case _0xa3cb('0xbc'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xbd');break;case _0xa3cb('0xbe'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xbf');break;case _0xa3cb('0xc0'):_0x295551['childModel']=_0xa3cb('0xc1');break;case _0xa3cb('0xc2'):_0x295551[_0xa3cb('0x74')]='OpenchannelAccount';break;case _0xa3cb('0xc3'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xc4');break;case'smsaccounts':_0x295551[_0xa3cb('0x74')]='SmsAccount';break;case _0xa3cb('0xc5'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xc6');break;case _0xa3cb('0xc7'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xc8');break;case _0xa3cb('0xc9'):_0x295551['childModel']='Team';break;case _0xa3cb('0xca'):case'queuecampaigns':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xb0');if(_0xe35e17){_0x295551[_0xa3cb('0x76')]=[{'name':_0xa3cb('0xaf')},{'name':'QueueCampaigns'}];}break;case _0xa3cb('0xcb'):case'agents':case'telephones':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xa9');if(_0xe35e17){_0x295551['parentSections']=[{'name':_0xa3cb('0xcc'),'filter':{'field':'role','value':[_0xa3cb('0xcd'),_0xa3cb('0xce')]},'ignore':!![]},{'name':_0xa3cb('0xa8')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x295551['childModel']=_0xa3cb('0xcf');break;case'salesforceaccounts':_0x295551['childModel']=_0xa3cb('0xd0');break;case _0xa3cb('0xd1'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xd2');break;case _0xa3cb('0xd3'):_0x295551['childModel']=_0xa3cb('0xd4');break;case _0xa3cb('0xd5'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xd6');break;case _0xa3cb('0xd7'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xd8');break;case'vtigeraccounts':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xa9');break;case _0xa3cb('0xd9'):_0x295551['childModel']=_0xa3cb('0xda');break;case'dispositions':_0x295551['childModel']='Disposition';break;case _0xa3cb('0xdb'):_0x295551[_0xa3cb('0x74')]='Dashboard';break;case _0xa3cb('0xdc'):_0x295551['childModel']='Interval';break;case'pauses':_0x295551[_0xa3cb('0x74')]='Pause';break;case _0xa3cb('0xdd'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xde');break;case _0xa3cb('0xdf'):_0x295551['childModel']=_0xa3cb('0xe0');break;case'tags':_0x295551[_0xa3cb('0x74')]='Tag';break;case _0xa3cb('0xe1'):_0x295551['childModel']=_0xa3cb('0xe2');break;case'triggers':_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xe3');break;case _0xa3cb('0xe4'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xe5');break;case'variables':_0x295551[_0xa3cb('0x74')]='Variable';break;case _0xa3cb('0xe6'):_0x295551['childModel']=_0xa3cb('0x6a');break;case _0xa3cb('0xe7'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0x7a');_0x295551[_0xa3cb('0x76')]=[{'name':_0xa3cb('0xe8'),'field':'id','foreignKey':'reportId'}];break;case _0xa3cb('0xe9'):_0x295551[_0xa3cb('0x74')]=_0xa3cb('0xea');break;case _0xa3cb('0xc7'):_0x295551['childModel']='WhatsappAccount';break;default:return _0x295551;}return _0x295551;} \ No newline at end of file +var _0x4cc6=['sounds','Sound','tags','triggers','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','metrics','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','count','catch','show','params','includeAll','include','options','create','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','push','removeSections','findAll','enabled','isEmpty','includes','subsections','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','Invalid\x20section\x20\x27','parentSections','findOne','all','ignore','union','childModel','nolimit','field','AnalyticExtractedReport','associatedResources','reportType','reportId','DefaultReports','custom','CustomReports','rows','CmContact','Tags','color','tag','Tag','ThroughTags','value','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','queuecampaigns','users','telephones','Users','user','Telephones','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','cannedanswers','dispositions','Disposition','intervals','Interval','Pause','scheduler','Schedule'];(function(_0x1a897b,_0x33c762){var _0x54da75=function(_0x45054e){while(--_0x45054e){_0x1a897b['push'](_0x1a897b['shift']());}};_0x54da75(++_0x33c762);}(_0x4cc6,0x1ea));var _0x64cc=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x4cc6[_0x20fdc1];return _0x25397c;};'use strict';var pdf=require(_0x64cc('0x0'));var emlformat=require(_0x64cc('0x1'));var rimraf=require(_0x64cc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x64cc('0x3'));var rp=require(_0x64cc('0x4'));var moment=require(_0x64cc('0x5'));var BPromise=require(_0x64cc('0x6'));var Mustache=require('mustache');var util=require(_0x64cc('0x7'));var path=require(_0x64cc('0x8'));var sox=require(_0x64cc('0x9'));var csv=require(_0x64cc('0xa'));var ejs=require(_0x64cc('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x64cc('0xc'));var crypto=require(_0x64cc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x64cc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x64cc('0xf'));var Papa=require(_0x64cc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x64cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64cc('0x12'));var logger=require(_0x64cc('0x13'))('api');var utils=require(_0x64cc('0x14'));var config=require(_0x64cc('0x15'));var db=require('../../mysqldb')['db'];config[_0x64cc('0x16')]=_[_0x64cc('0x17')](config[_0x64cc('0x16')],{'host':_0x64cc('0x18'),'port':0x18eb});var socket=require(_0x64cc('0x19'))(new Redis(config['redis']));require(_0x64cc('0x1a'))[_0x64cc('0x1b')](socket);function respondWithStatusCode(_0xecfd4b,_0x78bd3e){_0x78bd3e=_0x78bd3e||0xcc;return function(_0x431cd){if(_0x431cd){return _0xecfd4b['sendStatus'](_0x78bd3e);}return _0xecfd4b[_0x64cc('0x1c')](_0x78bd3e)[_0x64cc('0x1d')]();};}function respondWithResult(_0x2a2e19,_0x5ee86f){_0x5ee86f=_0x5ee86f||0xc8;return function(_0x2d0762){if(_0x2d0762){return _0x2a2e19['status'](_0x5ee86f)[_0x64cc('0x1e')](_0x2d0762);}};}function respondWithFilteredResult(_0xf3ce21,_0x5dd22){return function(_0x2ff02a){if(_0x2ff02a){var _0x3b4b6f=_0x2ff02a['count'],_0x8a28e1=_0x5dd22[_0x64cc('0x1f')],_0x590f85=_0x5dd22[_0x64cc('0x1f')]+_0x5dd22[_0x64cc('0x20')],_0x1d6c5f;if(_0x590f85>=_0x3b4b6f){_0x590f85=_0x3b4b6f;_0x1d6c5f=0xc8;}else{_0x1d6c5f=0xce;}_0xf3ce21[_0x64cc('0x1c')](_0x1d6c5f);return _0xf3ce21[_0x64cc('0x21')](_0x64cc('0x22'),_0x8a28e1+'-'+_0x590f85+'/'+_0x3b4b6f)['json'](_0x2ff02a);}return null;};}function patchUpdates(_0x562e3e){return function(_0x188ee6){try{jsonpatch['apply'](_0x188ee6,_0x562e3e,!![]);}catch(_0x521ca9){return BPromise[_0x64cc('0x23')](_0x521ca9);}return _0x188ee6[_0x64cc('0x24')]();};}function saveUpdates(_0x212bc9,_0xc8474e){return function(_0xac937a){if(_0xac937a){return _0xac937a[_0x64cc('0x25')](_0x212bc9)[_0x64cc('0x26')](function(_0x3820ce){return _0x3820ce;});}return null;};}function removeEntity(_0x459809,_0x124bf8){return function(_0x29503a){if(_0x29503a){return _0x29503a[_0x64cc('0x27')]()['then'](function(){_0x459809[_0x64cc('0x1c')](0xcc)[_0x64cc('0x1d')]();});}};}function handleEntityNotFound(_0x3cd537,_0x17779a){return function(_0x5969a2){if(!_0x5969a2){_0x3cd537[_0x64cc('0x28')](0x194);}return _0x5969a2;};}function handleError(_0x3848ec,_0x2bede8){_0x2bede8=_0x2bede8||0x1f4;return function(_0xa16e6c){logger['error'](_0xa16e6c[_0x64cc('0x29')]);if(_0xa16e6c[_0x64cc('0x2a')]){delete _0xa16e6c[_0x64cc('0x2a')];}_0x3848ec['status'](_0x2bede8)[_0x64cc('0x2b')](_0xa16e6c);};}exports['index']=function(_0xd6e99c,_0x436cbf){var _0x4fe251={},_0x3096a2={},_0x2b9e39={'count':0x0,'rows':[]};var _0x58d76c=_[_0x64cc('0x2c')](db[_0x64cc('0x2d')][_0x64cc('0x2e')],function(_0xc1d0b6){return{'name':_0xc1d0b6[_0x64cc('0x2f')],'type':_0xc1d0b6[_0x64cc('0x30')][_0x64cc('0x31')]};});_0x3096a2[_0x64cc('0x32')]=_['map'](_0x58d76c,_0x64cc('0x2a'));_0x3096a2[_0x64cc('0x33')]=_[_0x64cc('0x34')](_0xd6e99c[_0x64cc('0x33')]);_0x3096a2[_0x64cc('0x35')]=_[_0x64cc('0x36')](_0x3096a2[_0x64cc('0x32')],_0x3096a2[_0x64cc('0x33')]);_0x4fe251[_0x64cc('0x37')]=_[_0x64cc('0x36')](_0x3096a2[_0x64cc('0x32')],qs[_0x64cc('0x38')](_0xd6e99c['query'][_0x64cc('0x38')]));_0x4fe251[_0x64cc('0x37')]=_0x4fe251['attributes'][_0x64cc('0x39')]?_0x4fe251[_0x64cc('0x37')]:_0x3096a2[_0x64cc('0x32')];if(!_0xd6e99c[_0x64cc('0x33')][_0x64cc('0x3a')]('nolimit')){_0x4fe251[_0x64cc('0x20')]=qs[_0x64cc('0x20')](_0xd6e99c[_0x64cc('0x33')][_0x64cc('0x20')]);_0x4fe251[_0x64cc('0x1f')]=qs[_0x64cc('0x1f')](_0xd6e99c[_0x64cc('0x33')][_0x64cc('0x1f')]);}_0x4fe251[_0x64cc('0x3b')]=qs[_0x64cc('0x3c')](_0xd6e99c[_0x64cc('0x33')][_0x64cc('0x3c')]);_0x4fe251[_0x64cc('0x3d')]=qs[_0x64cc('0x35')](_[_0x64cc('0x3e')](_0xd6e99c[_0x64cc('0x33')],_0x3096a2[_0x64cc('0x35')]),_0x58d76c);if(_0xd6e99c[_0x64cc('0x33')][_0x64cc('0x3f')]){_0x4fe251[_0x64cc('0x3d')]=_[_0x64cc('0x40')](_0x4fe251[_0x64cc('0x3d')],{'$or':_['map'](_0x58d76c,function(_0x48d278){if(_0x48d278[_0x64cc('0x30')]!==_0x64cc('0x41')){var _0x45654e={};_0x45654e[_0x48d278[_0x64cc('0x2a')]]={'$like':'%'+_0xd6e99c[_0x64cc('0x33')][_0x64cc('0x3f')]+'%'};return _0x45654e;}})});}_0x4fe251=_[_0x64cc('0x40')]({},_0x4fe251,_0xd6e99c['options']);var _0x3a1ea6={'where':_0x4fe251[_0x64cc('0x3d')]};return db[_0x64cc('0x2d')][_0x64cc('0x42')](_0x3a1ea6)[_0x64cc('0x26')](function(_0x3587ea){_0x2b9e39[_0x64cc('0x42')]=_0x3587ea;if(_0xd6e99c[_0x64cc('0x33')]['includeAll']){_0x4fe251['include']=[{'all':!![]}];}return db[_0x64cc('0x2d')]['findAll'](_0x4fe251);})[_0x64cc('0x26')](function(_0x4ed4d8){_0x2b9e39['rows']=_0x4ed4d8;return _0x2b9e39;})[_0x64cc('0x26')](respondWithFilteredResult(_0x436cbf,_0x4fe251))[_0x64cc('0x43')](handleError(_0x436cbf,null));};exports[_0x64cc('0x44')]=function(_0x35201f,_0x443e3c){var _0x5cb004={'raw':![],'where':{'id':_0x35201f[_0x64cc('0x45')]['id']}},_0x30d7bc={};_0x30d7bc['model']=_[_0x64cc('0x34')](db[_0x64cc('0x2d')][_0x64cc('0x2e')]);_0x30d7bc[_0x64cc('0x33')]=_[_0x64cc('0x34')](_0x35201f[_0x64cc('0x33')]);_0x30d7bc['filters']=_['intersection'](_0x30d7bc['model'],_0x30d7bc['query']);_0x5cb004[_0x64cc('0x37')]=_[_0x64cc('0x36')](_0x30d7bc['model'],qs[_0x64cc('0x38')](_0x35201f[_0x64cc('0x33')][_0x64cc('0x38')]));_0x5cb004[_0x64cc('0x37')]=_0x5cb004[_0x64cc('0x37')][_0x64cc('0x39')]?_0x5cb004[_0x64cc('0x37')]:_0x30d7bc[_0x64cc('0x32')];if(_0x35201f[_0x64cc('0x33')][_0x64cc('0x46')]){_0x5cb004[_0x64cc('0x47')]=[{'all':!![]}];}_0x5cb004=_[_0x64cc('0x40')]({},_0x5cb004,_0x35201f[_0x64cc('0x48')]);return db['UserProfile']['find'](_0x5cb004)[_0x64cc('0x26')](handleEntityNotFound(_0x443e3c,null))[_0x64cc('0x26')](respondWithResult(_0x443e3c,null))[_0x64cc('0x43')](handleError(_0x443e3c,null));};exports[_0x64cc('0x49')]=function(_0x13f0ac,_0x1ede6c){return db['UserProfile']['create'](_0x13f0ac[_0x64cc('0x4a')],{})[_0x64cc('0x26')](respondWithResult(_0x1ede6c,0xc9))[_0x64cc('0x43')](handleError(_0x1ede6c,null));};exports[_0x64cc('0x4b')]=function(_0x10cf47,_0x4b8d4f){var _0x395832={'where':{'id':_0x10cf47[_0x64cc('0x45')]['id']}},_0x2c337e={};_0x2c337e[_0x64cc('0x32')]=_['keys'](db['UserProfile'][_0x64cc('0x2e')]);_0x395832[_0x64cc('0x37')]=_[_0x64cc('0x36')](_0x2c337e[_0x64cc('0x32')],qs['fields'](_0x10cf47['query'][_0x64cc('0x38')]));_0x395832[_0x64cc('0x37')]=_0x395832[_0x64cc('0x37')][_0x64cc('0x39')]?_0x395832[_0x64cc('0x37')]:_0x2c337e[_0x64cc('0x32')];if(_0x10cf47[_0x64cc('0x33')][_0x64cc('0x46')]){_0x395832[_0x64cc('0x47')]=[{'all':!![]}];}_0x395832=_[_0x64cc('0x40')]({},_0x395832,_0x10cf47[_0x64cc('0x48')]);return db[_0x64cc('0x2d')][_0x64cc('0x4c')](_0x395832)[_0x64cc('0x26')](handleEntityNotFound(_0x4b8d4f,null))[_0x64cc('0x26')](function(_0x3d1c61){if(_0x3d1c61){var _0x1256c8=_0x3d1c61[_0x64cc('0x4d')]({'plain':!![]});_0x1256c8=qs[_0x64cc('0x4e')](_0x1256c8,['id',_0x64cc('0x4f'),_0x64cc('0x50'),_0x64cc('0x51')]);_0x10cf47[_0x64cc('0x4a')]=_[_0x64cc('0x4e')](_0x10cf47[_0x64cc('0x4a')],['id',_0x64cc('0x4f'),_0x64cc('0x50')]);return db[_0x64cc('0x52')][_0x64cc('0x53')](function(_0x282f0b){return db[_0x64cc('0x2d')][_0x64cc('0x49')](_[_0x64cc('0x40')](_0x1256c8,_0x10cf47[_0x64cc('0x4a')]),{'include':_0x10cf47[_0x64cc('0x33')][_0x64cc('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x282f0b})[_0x64cc('0x26')](function(_0x58e312){var _0x483b8d=_0x58e312['get']({'plain':!![]});return db[_0x64cc('0x54')]['findAll']({'where':{'userProfileId':_0x10cf47[_0x64cc('0x45')]['id']},'raw':!![]})[_0x64cc('0x26')](function(_0x4a1a53){if(_0x4a1a53){return BPromise[_0x64cc('0x55')](_0x4a1a53,function(_0x61350b){return new BPromise(function(_0x412bb2,_0x44340b){if(_0x61350b[_0x64cc('0x56')]===null||_0x61350b['autoAssociation']===0x1)_0x412bb2(null);return db[_0x64cc('0x57')]['findAll']({'where':{'sectionId':_0x61350b['id']},'raw':!![]})[_0x64cc('0x26')](function(_0x31711e){var _0x270dd2=_['map'](_0x31711e,function(_0x1fbef4){return qs['omit'](_0x1fbef4,['id',_0x64cc('0x4f'),_0x64cc('0x50'),_0x64cc('0x58')]);});_0x412bb2(_0x270dd2);})['catch'](function(_0x29ad76){_0x44340b(_0x29ad76);});})[_0x64cc('0x26')](function(_0x7ef4b0){var _0x413ba0=qs['omit'](_0x61350b,['id',_0x64cc('0x4f'),_0x64cc('0x50')]);_0x413ba0[_0x64cc('0x59')]=_0x483b8d['id'];if(_0x7ef4b0)_0x413ba0[_0x64cc('0x5a')]=_0x7ef4b0;return _0x413ba0;})[_0x64cc('0x26')](function(_0xe60f5c){return db['UserProfileSection']['create'](_0xe60f5c,{'include':[{'model':db['UserProfileResource'],'as':_0x64cc('0x5a')}],'raw':!![],'transaction':_0x282f0b});});})[_0x64cc('0x26')](function(){return _0x483b8d;});}});});});}})[_0x64cc('0x26')](respondWithResult(_0x4b8d4f,0xc9))[_0x64cc('0x43')](handleError(_0x4b8d4f,null));};exports[_0x64cc('0x25')]=function(_0x3f3984,_0x2717cf){if(_0x3f3984[_0x64cc('0x4a')]['id']){delete _0x3f3984[_0x64cc('0x4a')]['id'];}return db[_0x64cc('0x2d')]['find']({'where':{'id':_0x3f3984[_0x64cc('0x45')]['id']}})[_0x64cc('0x26')](handleEntityNotFound(_0x2717cf,null))[_0x64cc('0x26')](saveUpdates(_0x3f3984[_0x64cc('0x4a')],null))['then'](respondWithResult(_0x2717cf,null))[_0x64cc('0x43')](handleError(_0x2717cf,null));};exports['destroy']=function(_0x5bf22f,_0x15d9e7){return db[_0x64cc('0x2d')][_0x64cc('0x4c')]({'where':{'id':_0x5bf22f[_0x64cc('0x45')]['id']}})['then'](handleEntityNotFound(_0x15d9e7,null))[_0x64cc('0x26')](removeEntity(_0x15d9e7,null))[_0x64cc('0x43')](handleError(_0x15d9e7,null));};exports[_0x64cc('0x5b')]=function(_0x5126f7,_0x25952c){return db[_0x64cc('0x2d')]['describe']()[_0x64cc('0x26')](respondWithResult(_0x25952c,null))['catch'](handleError(_0x25952c,null));};exports['addSections']=function(_0x2a232a,_0x1357fd){var _0x4dd31b=_0x2a232a[_0x64cc('0x4a')];return db[_0x64cc('0x2d')]['find']({'where':{'id':_0x2a232a[_0x64cc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1357fd,null))[_0x64cc('0x26')](function(_0x52677b){if(_0x52677b){return db[_0x64cc('0x52')]['transaction'](function(_0x6b13d0){return db[_0x64cc('0x54')][_0x64cc('0x27')]({'where':{'userProfileId':_0x2a232a[_0x64cc('0x45')]['id'],'sectionId':_[_0x64cc('0x2c')](_0x4dd31b,function(_0x87def7){return _0x87def7[_0x64cc('0x58')];})},'transaction':_0x6b13d0})[_0x64cc('0x26')](function(){var _0x272bfb=_[_0x64cc('0x2c')](_0x4dd31b,function(_0x1ffbe9){_0x1ffbe9[_0x64cc('0x59')]=_0x2a232a['params']['id'];return _0x1ffbe9;});var _0xdf47d4=[];return BPromise['each'](_0x272bfb,function(_0x62b47f){return db[_0x64cc('0x54')][_0x64cc('0x49')](_0x62b47f,{'include':[{'model':db[_0x64cc('0x57')],'as':_0x64cc('0x5a')}],'raw':!![],'transaction':_0x6b13d0})['then'](function(_0xbc254){_0xdf47d4[_0x64cc('0x5c')](_0xbc254[_0x64cc('0x4d')]({'plain':!![]}));});})[_0x64cc('0x26')](function(){return _0xdf47d4;});});});}})[_0x64cc('0x26')](function(_0x211b52){return _0x211b52;})['then'](respondWithResult(_0x1357fd,null))[_0x64cc('0x43')](handleError(_0x1357fd,null));};exports[_0x64cc('0x5d')]=function(_0x3a0ea9,_0x2491ff){var _0x49f324;return db[_0x64cc('0x2d')][_0x64cc('0x4c')]({'where':{'id':_0x3a0ea9['params']['id']},'attributes':['id',_0x64cc('0x2a')]})[_0x64cc('0x26')](handleEntityNotFound(_0x2491ff,null))[_0x64cc('0x26')](function(_0x3797f4){if(_0x3797f4){_0x49f324=_0x3797f4;return db['UserProfileSection'][_0x64cc('0x27')]({'where':{'userProfileId':_0x3a0ea9[_0x64cc('0x45')]['id'],'sectionId':_0x3a0ea9[_0x64cc('0x33')]['ids']}});}})['then'](function(){return _0x49f324;})[_0x64cc('0x26')](respondWithStatusCode(_0x2491ff,null))[_0x64cc('0x43')](handleError(_0x2491ff,null));};exports['getSections']=function(_0x3d916e,_0x5abaf2){var _0x369666=[];var _0x3ab8e3=[];return db['UserProfileSection'][_0x64cc('0x5e')]({'where':{'userProfileId':_0x3d916e[_0x64cc('0x45')]['id']},'raw':!![]})[_0x64cc('0x26')](function(_0x3e5cbf){_0x369666=_[_0x64cc('0x3f')](_0x3e5cbf,function(_0x2e59b2){return _0x2e59b2[_0x64cc('0x5f')]===0x1||_['includes']([0x3eb,0x709],_0x2e59b2[_0x64cc('0x58')]);});if(!_[_0x64cc('0x60')](_0x369666)){return _[_0x64cc('0x2c')](_0x369666,function(_0x1f8a2d){return _0x1f8a2d['sectionId'];});}else{return;}})[_0x64cc('0x26')](function(_0x2d5afe){if(_0x2d5afe)_0x3ab8e3=_0x2d5afe;if(_[_0x64cc('0x61')](_0x3ab8e3,0x64)){var _0x41e45b=_[_0x64cc('0x4c')](_0x369666,{'sectionId':0x64});return hasDefaultDashboard(_0x41e45b)[_0x64cc('0x26')](function(_0xa6a1a3){return _[_0x64cc('0x2c')](_0x369666,function(_0x27f223){if(_0x27f223[_0x64cc('0x58')]===0x64){_0x27f223[_0x64cc('0x62')]=_0xa6a1a3;}return _0x27f223;});});}else{return;}})['then'](function(_0x35dde7){if(_0x35dde7)_0x369666=_0x35dde7;if(_[_0x64cc('0x61')](_0x3ab8e3,0x3eb)){var _0x55c22f=_['find'](_0x369666,{'sectionId':0x3eb});return getCustomDashboards(_0x55c22f)['then'](function(_0x1061b1){return _[_0x64cc('0x2c')](_0x369666,function(_0x2073e7){if(_0x55c22f[_0x64cc('0x5f')]){if(_0x2073e7[_0x64cc('0x58')]===0x3eb){_0x2073e7[_0x64cc('0x62')]=_0x1061b1;}}else{if(_0x2073e7[_0x64cc('0x58')]===0x64){_0x2073e7['subsections']=_0x1061b1;}}return _0x2073e7;});});}else{return;}})[_0x64cc('0x26')](function(_0xd43a88){if(_0xd43a88)_0x369666=_0xd43a88;if(_[_0x64cc('0x61')](_0x3ab8e3,0x709)){var _0x3f9d89=_['find'](_0x369666,{'sectionId':0x709});return getPlugins(_0x3f9d89)['then'](function(_0x3e7c0){if(_0x3f9d89[_0x64cc('0x5f')]){return _[_0x64cc('0x2c')](_0x369666,function(_0x29bf30){if(_0x29bf30[_0x64cc('0x58')]===0x709){_0x29bf30[_0x64cc('0x62')]=_0x3e7c0;}return _0x29bf30;});}else{var _0x35cce4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3e7c0};var _0x55a6cb=_[_0x64cc('0x2c')](_0x369666);_0x55a6cb['push'](_0x35cce4);return _0x55a6cb;}});}else{return;}})[_0x64cc('0x26')](function(_0x31d761){if(_0x31d761)_0x369666=_0x31d761;return _[_0x64cc('0x3f')](_0x369666,[_0x64cc('0x5f'),0x1]);})['then'](respondWithResult(_0x5abaf2,null))['catch'](handleError(_0x5abaf2,null));};function hasDefaultDashboard(_0x5d70a6){var _0x532cfa=[0x65];return new BPromise(function(_0x5f3efb,_0x38c9cf){try{if(_0x5d70a6['autoAssociation']){_0x5f3efb(_0x532cfa);}else{return db[_0x64cc('0x57')]['findOne']({'where':{'sectionId':_0x5d70a6['id']},'raw':!![]})[_0x64cc('0x26')](function(_0x21479){_0x21479?_0x5f3efb(_0x532cfa):_0x5f3efb();});}}catch(_0x242c14){_0x38c9cf(_0x242c14);}});}function getCustomDashboards(_0x3b06f8){var _0x1a0b06=[];return new BPromise(function(_0x3f9d2d,_0x71e95a){try{if(_0x3b06f8[_0x64cc('0x56')]){return db[_0x64cc('0x63')][_0x64cc('0x5e')]({'raw':!![]})[_0x64cc('0x26')](function(_0xac3ea1){_0xac3ea1[_0x64cc('0x64')](function(_0x31081b){_0x1a0b06[_0x64cc('0x5c')](_0x31081b['id']+0x1869f);});_0x3f9d2d(_0x1a0b06);});}else{return db[_0x64cc('0x57')][_0x64cc('0x5e')]({'where':{'sectionId':_0x3b06f8['id']},'raw':!![]})[_0x64cc('0x26')](function(_0x165c42){_0x165c42[_0x64cc('0x64')](function(_0x1ec2a3){_0x1a0b06['push'](_0x1ec2a3[_0x64cc('0x65')]+0x1869f);});_0x3f9d2d(_0x1a0b06);});}}catch(_0x134073){_0x71e95a(_0x134073);}});}function getPlugins(_0x3288d2){var _0x474101=[];return new BPromise(function(_0x1158d2,_0x51b0b1){try{if(_0x3288d2[_0x64cc('0x56')]){return db[_0x64cc('0x66')]['findAll']({'raw':!![]})[_0x64cc('0x26')](function(_0x5305c1){_0x5305c1['forEach'](function(_0x34700f){_0x474101[_0x64cc('0x5c')](_0x34700f['id']+0x15b38);});_0x1158d2(_0x474101);});}else{return db[_0x64cc('0x57')][_0x64cc('0x5e')]({'where':{'sectionId':_0x3288d2['id']},'raw':!![]})['then'](function(_0xcf0dc5){_0xcf0dc5[_0x64cc('0x64')](function(_0x57fe8b){_0x474101[_0x64cc('0x5c')](_0x57fe8b[_0x64cc('0x65')]+0x15b38);});_0x1158d2(_0x474101);});}}catch(_0x598671){_0x51b0b1(_0x598671);}});}exports[_0x64cc('0x67')]=function(_0x66d960,_0x35b03c){return db['UserProfile'][_0x64cc('0x4c')]({'where':{'id':_0x66d960[_0x64cc('0x45')]['id']}})[_0x64cc('0x26')](handleEntityNotFound(_0x35b03c,null))[_0x64cc('0x26')](function(_0x650ab1){if(_0x650ab1){return db[_0x64cc('0x52')][_0x64cc('0x53')](function(_0x292d15){return db[_0x64cc('0x54')][_0x64cc('0x5e')]({'where':{'userProfileId':_0x66d960[_0x64cc('0x45')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x5e4e8d){if(_0x5e4e8d){return db[_0x64cc('0x54')]['destroy']({'where':{'userProfileId':_0x66d960[_0x64cc('0x45')]['id'],'id':_[_0x64cc('0x2c')](_0x5e4e8d,function(_0x46988b){return _0x46988b['id'];})},'transaction':_0x292d15});}})[_0x64cc('0x26')](function(_0x1c60e4){var _0x5685d5=_[_0x64cc('0x2c')](_0x66d960['body'],function(_0x233acf){_0x233acf['userProfileId']=_0x66d960[_0x64cc('0x45')]['id'];return _0x233acf;});return db[_0x64cc('0x54')]['bulkCreate'](_0x5685d5,{'raw':!![],'transaction':_0x292d15});})[_0x64cc('0x26')](function(_0xcd6ff2){var _0x25b5a6=_[_0x64cc('0x3f')](_[_0x64cc('0x2c')](_0xcd6ff2,function(_0x39d158){return _0x39d158['get']({'plain':!![]});}),{'includeAll':![]});if(_0x25b5a6){return db[_0x64cc('0x54')][_0x64cc('0x5e')]({'where':{'userProfileId':_0x66d960['params']['id'],'sectionId':_[_0x64cc('0x2c')](_0x25b5a6,function(_0x555adc){return _0x555adc[_0x64cc('0x58')];})},'attributes':['id',_0x64cc('0x58')],'raw':!![]})[_0x64cc('0x26')](function(_0x1e84e8){var _0x2a53bc=_[_0x64cc('0x2c')](_0x66d960[_0x64cc('0x4a')],function(_0x3ab4bb){_0x3ab4bb['userProfileId']=_0x66d960[_0x64cc('0x45')]['id'];return _0x3ab4bb;});return db['UserProfileResource'][_0x64cc('0x68')](_0x2a53bc,{'raw':!![],'transaction':_0x292d15});});}})[_0x64cc('0x43')](handleError(_0x35b03c,null));});}})['then'](function(_0x25e484){var _0x282c5e=_[_0x64cc('0x2c')](_0x25e484,function(_0x44635e){return _0x44635e[_0x64cc('0x4d')]({'plain':!![]});});})[_0x64cc('0x26')](respondWithResult(_0x35b03c,null))[_0x64cc('0x43')](handleError(_0x35b03c,null));};exports['removeResources']=function(_0x1ee8fe,_0xbe43bc,_0x217fbf){return db[_0x64cc('0x2d')][_0x64cc('0x4c')]({'where':{'id':_0x1ee8fe['params']['id']}})[_0x64cc('0x26')](handleEntityNotFound(_0xbe43bc,null))[_0x64cc('0x26')](function(_0x2d10b7){if(_0x2d10b7){return _0x2d10b7[_0x64cc('0x69')](_0x1ee8fe['query'][_0x64cc('0x6a')]);}})[_0x64cc('0x26')](respondWithStatusCode(_0xbe43bc,null))[_0x64cc('0x43')](handleError(_0xbe43bc,null));};exports[_0x64cc('0x6b')]=function(_0x2d8cb9,_0xb42859){var _0x44bcf2={'raw':![],'where':{}};var _0x334c66={};var _0x19c462={'count':0x0,'rows':[]};var _0x11579e=_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x6c')];if(typeof _0x11579e===_0x64cc('0x6d')){throw new db[(_0x64cc('0x6e'))][(_0x64cc('0x6f'))](_0x64cc('0x70'));}var _0x1fb46b=_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x71')]||![];var _0x391be2=getQueryModels(_0x11579e,_0x1fb46b);if(typeof _0x391be2['childModel']===_0x64cc('0x6d')){throw new db[(_0x64cc('0x6e'))][(_0x64cc('0x6f'))](_0x64cc('0x72')+_0x11579e+'\x27');}var _0x1314fc=[];if(!_[_0x64cc('0x60')](_0x391be2[_0x64cc('0x73')])){_0x1314fc=_0x391be2[_0x64cc('0x73')];}else{_0x1314fc=[{'name':_0x11579e}];}return db[_0x64cc('0x2d')][_0x64cc('0x74')]({'where':{'id':_0x2d8cb9[_0x64cc('0x45')]['id']}})[_0x64cc('0x26')](handleEntityNotFound(_0xb42859,null))[_0x64cc('0x26')](function(_0x411e38){if(_0x411e38){var _0x54f794=[];for(var _0x2891dd=0x0;_0x2891dd<_0x1314fc[_0x64cc('0x39')];_0x2891dd++){_0x54f794[_0x64cc('0x5c')](db[_0x64cc('0x54')]['findOne']({'where':{'userProfileId':_0x411e38['id'],'name':_0x1314fc[_0x2891dd]['name']},'raw':!![]}));}return BPromise[_0x64cc('0x75')](_0x54f794);}})['then'](function(_0x51c64b){var _0x50b91c=_[_0x64cc('0x3f')](_0x51c64b,function(_0x505def){return _0x505def?_0x505def:undefined;});var _0x14549f=_[_0x64cc('0x3f')](_0x1314fc,[_0x64cc('0x76'),!![]]);var _0x27e51d=_[_0x64cc('0x60')](_0x50b91c)&&_['isEmpty'](_0x14549f)?null:_[_0x64cc('0x77')](_0x14549f,_0x50b91c);if(_0x27e51d){var _0x293584=[];for(var _0x24fdff=0x0;_0x24fdff<_0x27e51d[_0x64cc('0x39')];_0x24fdff++){var _0x4b5e4e=_['find'](_0x1314fc,function(_0x11b8e3){return _0x27e51d[_0x24fdff]?_0x11b8e3[_0x64cc('0x2a')]===_0x27e51d[_0x24fdff][_0x64cc('0x2a')]:null;});if(_0x4b5e4e){if(_0x27e51d[_0x24fdff][_0x64cc('0x76')]){_0x293584[_0x64cc('0x5c')](getAllResources(_0x391be2[_0x64cc('0x78')],_0x27e51d[_0x24fdff]));}else{if(!_0x27e51d[_0x24fdff][_0x64cc('0x56')]){_0x293584[_0x64cc('0x5c')](getAllowedResources(_0x4b5e4e,_0x27e51d[_0x24fdff],_0x391be2[_0x64cc('0x78')]));}else{if(_0x4b5e4e[_0x64cc('0x32')]){_0x293584['push'](getAllFilteredResources(_0x4b5e4e,_0x27e51d[_0x24fdff]));}}}}}return BPromise[_0x64cc('0x75')](_0x293584);}else{return null;}})[_0x64cc('0x26')](function(_0x11351f){var _0x1bd1c7=_0x11351f;var _0x269d01=null;if(_0x1bd1c7){_0x269d01=_0x1bd1c7[_0x64cc('0x39')]===0x1?_0x1bd1c7[0x0]:null;}if(_0x269d01||_0x1bd1c7){var _0x214361=db[_0x391be2[_0x64cc('0x78')]]['rawAttributes'];_0x334c66['model']=_['keys'](_0x214361);_0x334c66[_0x64cc('0x33')]=_[_0x64cc('0x34')](_0x2d8cb9[_0x64cc('0x33')]);_0x334c66[_0x64cc('0x35')]=_[_0x64cc('0x36')](_0x334c66['model'],_0x334c66[_0x64cc('0x33')]);_0x44bcf2[_0x64cc('0x37')]=_[_0x64cc('0x36')](_0x334c66[_0x64cc('0x32')],qs[_0x64cc('0x38')](_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x38')]));_0x44bcf2[_0x64cc('0x37')]=_0x44bcf2[_0x64cc('0x37')]['length']?_0x44bcf2[_0x64cc('0x37')]:_0x334c66[_0x64cc('0x32')];if(!_0x2d8cb9['query']['hasOwnProperty'](_0x64cc('0x79'))){_0x44bcf2[_0x64cc('0x20')]=qs['limit'](_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x20')]);_0x44bcf2[_0x64cc('0x1f')]=qs[_0x64cc('0x1f')](_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x1f')]);}_0x44bcf2[_0x64cc('0x3b')]=qs[_0x64cc('0x3c')](_0x2d8cb9[_0x64cc('0x33')]['sort']);_0x44bcf2[_0x64cc('0x3d')]=qs[_0x64cc('0x35')](_[_0x64cc('0x3e')](_0x2d8cb9[_0x64cc('0x33')],_0x334c66['filters']));if(_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x3f')]){_0x44bcf2['where']=_[_0x64cc('0x40')](_0x44bcf2[_0x64cc('0x3d')],{'$or':_[_0x64cc('0x2c')](_0x214361,function(_0x49cd21){if(_0x49cd21[_0x64cc('0x30')][_0x64cc('0x31')]!==_0x64cc('0x41')){var _0x21803b={};_0x21803b[_0x49cd21[_0x64cc('0x7a')]]={'$like':'%'+_0x2d8cb9['query'][_0x64cc('0x3f')]+'%'};return _0x21803b;}})});}var _0x416b74=[];if(_0x269d01){var _0x32a9b5=_[_0x64cc('0x4c')](_0x1314fc,['name',_0x269d01[_0x64cc('0x2a')]]);if(_0x32a9b5[_0x64cc('0x7a')]){var _0x3e183e={};if(_0x391be2[_0x64cc('0x78')]===_0x64cc('0x7b')){_0x3e183e[_0x32a9b5['foreignKey']]=_['map'](_0x269d01[_0x64cc('0x7c')],'id');}else{_0x3e183e[_0x32a9b5['foreignKey']]=_0x269d01[_0x64cc('0x7c')];}_0x416b74[_0x64cc('0x5c')](_0x3e183e);}else{_0x44bcf2[_0x64cc('0x3d')]['id']=_0x269d01[_0x64cc('0x7c')];}}else{for(var _0x30511f=0x0;_0x30511f<_0x1bd1c7['length'];_0x30511f++){var _0x32a9b5=_[_0x64cc('0x4c')](_0x1314fc,['name',_0x1bd1c7[_0x30511f][_0x64cc('0x2a')]]);if(_0x32a9b5[_0x64cc('0x7a')]){var _0x3e183e={};_0x3e183e[_0x32a9b5['foreignKey']]=_0x1bd1c7[_0x30511f][_0x64cc('0x7c')];_0x416b74[_0x64cc('0x5c')](_0x3e183e);}else{if(!_0x44bcf2[_0x64cc('0x3d')]['id'])_0x44bcf2[_0x64cc('0x3d')]['id']=[];_0x1bd1c7[_0x30511f][_0x64cc('0x7c')][_0x64cc('0x64')](function(_0x4df78a){_0x44bcf2[_0x64cc('0x3d')]['id'][_0x64cc('0x5c')](_0x4df78a);});}}}if(!_[_0x64cc('0x60')](_0x416b74)){_0x44bcf2[_0x64cc('0x3d')]=_['merge'](_0x44bcf2[_0x64cc('0x3d')],{'$and':{'$or':_0x416b74}});}_0x44bcf2=_['merge']({},_0x44bcf2,_0x2d8cb9[_0x64cc('0x48')]);if(_0x269d01&&!_0x269d01['autoAssociation']&&_0x391be2[_0x64cc('0x78')]===_0x64cc('0x7b')){if(_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x46')]){_0x44bcf2['include']=[{'all':!![]}];}return db[_0x391be2[_0x64cc('0x78')]]['findAll'](_0x44bcf2)[_0x64cc('0x26')](function(_0x20fa9a){var _0x241e0d=[];_0x20fa9a[_0x64cc('0x64')](function(_0x22d0b2){var _0x129af2;switch(_0x22d0b2[_0x64cc('0x7d')]){case'default':_0x129af2=_[_0x64cc('0x4c')](_0x269d01[_0x64cc('0x7c')],function(_0x38692f){return _0x38692f['id']===_0x22d0b2[_0x64cc('0x7e')]&&_0x38692f[_0x64cc('0x30')]===_0x64cc('0x7f');});break;case _0x64cc('0x80'):_0x129af2=_[_0x64cc('0x4c')](_0x269d01[_0x64cc('0x7c')],function(_0x3585ad){return _0x3585ad['id']===_0x22d0b2[_0x64cc('0x7e')]&&_0x3585ad[_0x64cc('0x30')]===_0x64cc('0x81');});break;}if(_0x129af2)_0x241e0d['push'](_0x22d0b2);});_0x19c462[_0x64cc('0x42')]=_0x241e0d[_0x64cc('0x39')];_0x19c462[_0x64cc('0x82')]=_0x241e0d;return _0x19c462;});}else{return db[_0x391be2[_0x64cc('0x78')]][_0x64cc('0x42')]({'where':_0x44bcf2[_0x64cc('0x3d')]})['then'](function(_0x5526a0){_0x19c462[_0x64cc('0x42')]=_0x5526a0;if(_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x46')]){if(_0x391be2['childModel']===_0x64cc('0x83')){_0x44bcf2[_0x64cc('0x47')]=[{'model':db['Tag'],'as':_0x64cc('0x84'),'attributes':['id',_0x64cc('0x2a'),_0x64cc('0x85')],'required':_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x86')]?!![]:![]},{'model':db[_0x64cc('0x87')],'as':_0x64cc('0x88'),'attributes':['id',_0x64cc('0x2a'),_0x64cc('0x85')],'through':_0x2d8cb9['query']['tag']?{'attributes':[],'where':{'TagId':_0x2d8cb9['query']['tag']||undefined}}:{},'required':_0x2d8cb9[_0x64cc('0x33')][_0x64cc('0x86')]?!![]:![]}];}else{_0x44bcf2[_0x64cc('0x47')]=[{'all':!![]}];}}return db[_0x391be2[_0x64cc('0x78')]][_0x64cc('0x5e')](_0x44bcf2);})[_0x64cc('0x26')](function(_0xe9cc70){_0x19c462['rows']=_0xe9cc70;return _0x19c462;});}}else{return _0x19c462;}})[_0x64cc('0x26')](respondWithFilteredResult(_0xb42859,_0x44bcf2))['catch'](handleError(_0xb42859,null));};function getAllResources(_0x200267,_0xcb78db){return new BPromise(function(_0x46d9ce,_0x111a63){if(_0xcb78db){var _0x188d48=_0xcb78db[_0x64cc('0x3f')]?{[_0xcb78db[_0x64cc('0x3f')][_0x64cc('0x7a')]]:_0xcb78db['filter'][_0x64cc('0x89')]}:undefined;return db[_0x200267][_0x64cc('0x5e')]({'where':_0x188d48,'raw':!![]})['then'](function(_0x3c1c31){_0xcb78db['associatedResources']=_[_0x64cc('0x2c')](_0x3c1c31,'id');_0x46d9ce(_0xcb78db);})[_0x64cc('0x43')](function(_0x518a79){_0x111a63(_0x518a79);});}else{_0x46d9ce(null);}});}function getAllFilteredResources(_0x3e3fbf,_0x2fdbce){return new BPromise(function(_0x570260,_0x130ab3){var _0x36a970=_0x3e3fbf[_0x64cc('0x3f')]?{[_0x3e3fbf[_0x64cc('0x3f')]['field']]:_0x3e3fbf[_0x64cc('0x3f')][_0x64cc('0x89')]}:undefined;return db[_0x3e3fbf[_0x64cc('0x32')]][_0x64cc('0x5e')]({'where':_0x36a970,'raw':!![]})[_0x64cc('0x26')](function(_0x8f60df){_0x2fdbce[_0x64cc('0x7c')]=_[_0x64cc('0x2c')](_0x8f60df,function(_0x110373){return _0x110373['name'];});_0x570260(_0x2fdbce);})['catch'](function(_0x2375c8){_0x130ab3(_0x2375c8);});});}function getAllowedResources(_0x251221,_0x41eae9,_0x2c22c5){return new BPromise(function(_0x581b36,_0x4a38fc){if(_0x41eae9){return db[_0x64cc('0x57')][_0x64cc('0x5e')]({'where':{'sectionId':_0x41eae9['id']},'raw':!![]})['then'](function(_0x4f9804){if(_0x251221[_0x64cc('0x7a')]&&_0x251221[_0x64cc('0x7a')]!=='id'){_0x41eae9[_0x64cc('0x7c')]=_[_0x64cc('0x2c')](_0x4f9804,function(_0x23e136){return _0x23e136[_0x251221[_0x64cc('0x7a')]];});}else{if(_0x2c22c5==='AnalyticExtractedReport'){_0x41eae9[_0x64cc('0x7c')]=_[_0x64cc('0x2c')](_0x4f9804,function(_0x3abbda){return{'id':_0x3abbda['resourceId'],'type':_0x3abbda[_0x64cc('0x30')]};});}else{_0x41eae9[_0x64cc('0x7c')]=_[_0x64cc('0x2c')](_0x4f9804,function(_0x50dfe2){return _0x50dfe2[_0x64cc('0x65')];});}}_0x581b36(_0x41eae9);})['catch'](function(_0x3544af){_0x4a38fc(_0x3544af);});}else{_0x581b36(null);}});}function getQueryModels(_0x5f0316,_0x5679b5){var _0x4d2023=_0x5f0316[_0x64cc('0x8a')]();var _0x52e078={'childModel':undefined,'parentSections':[]};switch(_0x4d2023){case'squareprojects':_0x52e078[_0x64cc('0x78')]=_0x64cc('0x8b');break;case _0x64cc('0x8c'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x8d');break;case _0x64cc('0x8e'):_0x52e078['childModel']=_0x64cc('0x8f');_0x52e078[_0x64cc('0x73')]=[{'name':_0x64cc('0x90'),'field':_0x64cc('0x2a'),'foreignKey':_0x64cc('0x91')}];break;case _0x64cc('0x92'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x93');break;case _0x64cc('0x94'):_0x52e078['childModel']=_0x64cc('0x83');_0x52e078[_0x64cc('0x73')]=[{'name':'Lists','field':'id','foreignKey':_0x64cc('0x95')}];break;case _0x64cc('0x96'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x97');break;case _0x64cc('0x98'):_0x52e078['childModel']='CmCompany';break;case _0x64cc('0x99'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x9a');break;case _0x64cc('0x9b'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x9c');break;case _0x64cc('0x9d'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x9e');break;case _0x64cc('0x9f'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xa0');break;case _0x64cc('0xa1'):_0x52e078[_0x64cc('0x78')]='FaxAccount';break;case'inboundroutes':case'internalroutes':case _0x64cc('0xa2'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xa3');break;case _0x64cc('0xa4'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xa5');break;case _0x64cc('0xa6'):_0x52e078['childModel']=_0x64cc('0xa7');break;case _0x64cc('0xa8'):_0x52e078['childModel']=_0x64cc('0xa9');_0x52e078[_0x64cc('0x73')]=[{'name':_0x64cc('0xaa'),'field':'name','foreignKey':_0x64cc('0xab'),'model':_0x64cc('0xac'),'filter':{'field':_0x64cc('0xad'),'value':[_0x64cc('0xae')]}},{'name':'Telephones','field':'name','foreignKey':_0x64cc('0xab'),'model':'User','filter':{'field':'role','value':['telephone']}},{'name':_0x64cc('0xaf'),'field':'name','foreignKey':_0x64cc('0xb0'),'model':_0x64cc('0xb1'),'filter':{'field':_0x64cc('0x30'),'value':[_0x64cc('0xb2')]}},{'name':_0x64cc('0xb3'),'field':_0x64cc('0x2a'),'foreignKey':_0x64cc('0xb0'),'model':_0x64cc('0xb1'),'filter':{'field':_0x64cc('0x30'),'value':[_0x64cc('0xb4')]}}];break;case'musiconholds':_0x52e078['childModel']=_0x64cc('0xb5');break;case _0x64cc('0xb6'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xb7');break;case _0x64cc('0xb8'):_0x52e078['childModel']=_0x64cc('0xb9');break;case _0x64cc('0xba'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xbb');break;case _0x64cc('0xbc'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xbd');break;case _0x64cc('0xbe'):_0x52e078['childModel']='MailAccount';break;case _0x64cc('0xbf'):_0x52e078[_0x64cc('0x78')]='MailSubstatus';break;case _0x64cc('0xc0'):_0x52e078['childModel']=_0x64cc('0xc1');break;case _0x64cc('0xc2'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xc3');break;case _0x64cc('0xc4'):_0x52e078['childModel']=_0x64cc('0xc5');break;case _0x64cc('0xc6'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xc7');break;case _0x64cc('0xc8'):_0x52e078['childModel']=_0x64cc('0xc9');break;case _0x64cc('0xca'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xcb');break;case'teams':_0x52e078[_0x64cc('0x78')]=_0x64cc('0xcc');break;case'voicequeues':case _0x64cc('0xcd'):_0x52e078[_0x64cc('0x78')]='VoiceQueue';if(_0x5679b5){_0x52e078[_0x64cc('0x73')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x64cc('0xce'):case'agents':case _0x64cc('0xcf'):_0x52e078['childModel']='User';if(_0x5679b5){_0x52e078[_0x64cc('0x73')]=[{'name':_0x64cc('0xd0'),'filter':{'field':'role','value':['admin',_0x64cc('0xd1')]},'ignore':!![]},{'name':_0x64cc('0xaa')},{'name':_0x64cc('0xd2')}];}break;case'zendeskaccounts':_0x52e078['childModel']='ZendeskAccount';break;case _0x64cc('0xd3'):_0x52e078['childModel']=_0x64cc('0xd4');break;case'freshdeskaccounts':_0x52e078[_0x64cc('0x78')]=_0x64cc('0xd5');break;case _0x64cc('0xd6'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xd7');break;case _0x64cc('0xd8'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xd9');break;case _0x64cc('0xda'):_0x52e078[_0x64cc('0x78')]='ZohoAccount';break;case'vtigeraccounts':_0x52e078[_0x64cc('0x78')]=_0x64cc('0xac');break;case _0x64cc('0xdb'):_0x52e078[_0x64cc('0x78')]='CannedAnswer';break;case _0x64cc('0xdc'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xdd');break;case'customdashboards':_0x52e078[_0x64cc('0x78')]=_0x64cc('0x63');break;case _0x64cc('0xde'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xdf');break;case'pauses':_0x52e078['childModel']=_0x64cc('0xe0');break;case _0x64cc('0xe1'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xe2');break;case _0x64cc('0xe3'):_0x52e078['childModel']=_0x64cc('0xe4');break;case _0x64cc('0xe5'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x87');break;case'templates':_0x52e078[_0x64cc('0x78')]='Template';break;case _0x64cc('0xe6'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xe7');break;case _0x64cc('0xe8'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0xe9');break;case _0x64cc('0xea'):_0x52e078['childModel']=_0x64cc('0xeb');break;case'plugins':_0x52e078[_0x64cc('0x78')]=_0x64cc('0x66');break;case _0x64cc('0xec'):_0x52e078[_0x64cc('0x78')]=_0x64cc('0x7b');_0x52e078[_0x64cc('0x73')]=[{'name':_0x64cc('0xed'),'field':'id','foreignKey':'reportId'}];break;case _0x64cc('0xee'):_0x52e078[_0x64cc('0x78')]='AnalyticMetric';break;case _0x64cc('0xca'):_0x52e078['childModel']=_0x64cc('0xcb');break;default:return _0x52e078;}return _0x52e078;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 1440073..8c98220 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 _0xb116=['exports','events','../../mysqldb','setMaxListeners','emit','hook'];(function(_0x5de9c0,_0x235f62){var _0x585f94=function(_0x59b61d){while(--_0x59b61d){_0x5de9c0['push'](_0x5de9c0['shift']());}};_0x585f94(++_0x235f62);}(_0xb116,0x10f));var _0x6b11=function(_0x55ff79,_0x3d45e7){_0x55ff79=_0x55ff79-0x0;var _0x579067=_0xb116[_0x55ff79];return _0x579067;};'use strict';var EventEmitter=require(_0x6b11('0x0'));var UserProfile=require(_0x6b11('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6b11('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xfae283){return function(_0x4f7318,_0x3b5359,_0x4d9129){UserProfileEvents[_0x6b11('0x3')](_0xfae283+':'+_0x4f7318['id'],_0x4f7318);UserProfileEvents[_0x6b11('0x3')](_0xfae283,_0x4f7318);_0x4d9129(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x6b11('0x4')](e,emitEvent(event));}}module[_0x6b11('0x5')]=UserProfileEvents; \ No newline at end of file +var _0xf786=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xf786,0x136));var _0x6f78=function(_0x46b13a,_0x451458){_0x46b13a=_0x46b13a-0x0;var _0x1d260b=_0xf786[_0x46b13a];return _0x1d260b;};'use strict';var EventEmitter=require(_0x6f78('0x0'));var UserProfile=require(_0x6f78('0x1'))['db'][_0x6f78('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6f78('0x3')](0x0);var events={'afterCreate':_0x6f78('0x4'),'afterUpdate':_0x6f78('0x5'),'afterDestroy':_0x6f78('0x6')};function emitEvent(_0x528d30){return function(_0xba8f8,_0x3a2145,_0x38ff73){UserProfileEvents[_0x6f78('0x7')](_0x528d30+':'+_0xba8f8['id'],_0xba8f8);UserProfileEvents['emit'](_0x528d30,_0xba8f8);_0x38ff73(null);};}for(var e in events){if(events[_0x6f78('0x8')](e)){var event=events[e];UserProfile[_0x6f78('0x9')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 7b712dd..e075929 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 _0x124e=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','lodash','util','api','moment'];(function(_0x5ae9e1,_0x477092){var _0x449e95=function(_0x420682){while(--_0x420682){_0x5ae9e1['push'](_0x5ae9e1['shift']());}};_0x449e95(++_0x477092);}(_0x124e,0x1d0));var _0xe124=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x124e[_0x616290];return _0x453879;};'use strict';var _=require(_0xe124('0x0'));var util=require(_0xe124('0x1'));var logger=require('../../config/logger')(_0xe124('0x2'));var moment=require(_0xe124('0x3'));var BPromise=require(_0xe124('0x4'));var rp=require(_0xe124('0x5'));var fs=require('fs');var path=require(_0xe124('0x6'));var rimraf=require(_0xe124('0x7'));var config=require(_0xe124('0x8'));var attributes=require(_0xe124('0x9'));module[_0xe124('0xa')]=function(_0x55560e,_0x212eda){return _0x55560e[_0xe124('0xb')](_0xe124('0xc'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9a5=['user_profiles','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userProfile.attributes','exports','define','UserProfile'];(function(_0x6e3003,_0x229342){var _0x324720=function(_0x4784a5){while(--_0x4784a5){_0x6e3003['push'](_0x6e3003['shift']());}};_0x324720(++_0x229342);}(_0xd9a5,0x135));var _0x5d9a=function(_0x5b4010,_0x212403){_0x5b4010=_0x5b4010-0x0;var _0x447c77=_0xd9a5[_0x5b4010];return _0x447c77;};'use strict';var _=require(_0x5d9a('0x0'));var util=require(_0x5d9a('0x1'));var logger=require(_0x5d9a('0x2'))(_0x5d9a('0x3'));var moment=require(_0x5d9a('0x4'));var BPromise=require(_0x5d9a('0x5'));var rp=require(_0x5d9a('0x6'));var fs=require('fs');var path=require(_0x5d9a('0x7'));var rimraf=require(_0x5d9a('0x8'));var config=require('../../config/environment');var attributes=require(_0x5d9a('0x9'));module[_0x5d9a('0xa')]=function(_0xfc074e,_0x8fee7a){return _0xfc074e[_0x5d9a('0xb')](_0x5d9a('0xc'),attributes,{'tableName':_0x5d9a('0xd'),'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 d822efd..7a918c3 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xabce,0x103));var _0xeabc=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0xabce[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});config[_0xeabc('0x9')]=_['defaults'](config[_0xeabc('0x9')],{'host':_0xeabc('0xa'),'port':0x18eb});var socket=require(_0xeabc('0xb'))(new Redis(config['redis']));require(_0xeabc('0xc'))[_0xeabc('0xd')](socket);function respondWithRpcPromise(_0x2f73e9,_0x1b4d1b,_0x4301e4){return new BPromise(function(_0x283cdf,_0x111aaf){return client[_0xeabc('0xe')](_0x2f73e9,_0x4301e4)[_0xeabc('0xf')](function(_0xf0d9c0){logger[_0xeabc('0x10')](_0xeabc('0x11'),_0x1b4d1b,_0xeabc('0x12'));logger[_0xeabc('0x13')](_0xeabc('0x14'),_0x1b4d1b,_0xeabc('0x12'),JSON['stringify'](_0xf0d9c0));if(_0xf0d9c0[_0xeabc('0x15')]){if(_0xf0d9c0[_0xeabc('0x15')][_0xeabc('0x16')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x1b4d1b,_0xf0d9c0[_0xeabc('0x15')][_0xeabc('0x17')]);return _0x111aaf(_0xf0d9c0[_0xeabc('0x15')]['message']);}logger[_0xeabc('0x15')](_0xeabc('0x11'),_0x1b4d1b,_0xf0d9c0['error']['message']);return _0x283cdf(_0xf0d9c0[_0xeabc('0x15')]['message']);}else{logger[_0xeabc('0x10')](_0xeabc('0x11'),_0x1b4d1b,_0xeabc('0x12'));_0x283cdf(_0xf0d9c0[_0xeabc('0x18')][_0xeabc('0x17')]);}})[_0xeabc('0x19')](function(_0x384be5){logger[_0xeabc('0x15')]('UserProfile,\x20%s,\x20%s',_0x1b4d1b,_0x384be5);_0x111aaf(_0x384be5);});});} \ No newline at end of file +var _0x038b=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x2a7ab0,_0x586593){var _0x2d87c7=function(_0x363db0){while(--_0x363db0){_0x2a7ab0['push'](_0x2a7ab0['shift']());}};_0x2d87c7(++_0x586593);}(_0x038b,0x114));var _0xb038=function(_0x51cabe,_0x4af37a){_0x51cabe=_0x51cabe-0x0;var _0x1927d8=_0x038b[_0x51cabe];return _0x1927d8;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var moment=require(_0xb038('0x1'));var BPromise=require(_0xb038('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb038('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb038('0x4'));var logger=require(_0xb038('0x5'))('rpc');var config=require(_0xb038('0x6'));var jayson=require(_0xb038('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xb038('0x8')]=_[_0xb038('0x9')](config[_0xb038('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb038('0x8')]));require(_0xb038('0xa'))['register'](socket);function respondWithRpcPromise(_0x53bcc0,_0xe3d046,_0x2d1ae5){return new BPromise(function(_0x5c96b5,_0x2ede0b){return client[_0xb038('0xb')](_0x53bcc0,_0x2d1ae5)[_0xb038('0xc')](function(_0x3368c1){logger[_0xb038('0xd')](_0xb038('0xe'),_0xe3d046,_0xb038('0xf'));logger[_0xb038('0x10')](_0xb038('0x11'),_0xe3d046,_0xb038('0xf'),JSON[_0xb038('0x12')](_0x3368c1));if(_0x3368c1[_0xb038('0x13')]){if(_0x3368c1[_0xb038('0x13')][_0xb038('0x14')]===0x1f4){logger[_0xb038('0x13')](_0xb038('0xe'),_0xe3d046,_0x3368c1[_0xb038('0x13')]['message']);return _0x2ede0b(_0x3368c1[_0xb038('0x13')][_0xb038('0x15')]);}logger[_0xb038('0x13')](_0xb038('0xe'),_0xe3d046,_0x3368c1[_0xb038('0x13')][_0xb038('0x15')]);return _0x5c96b5(_0x3368c1['error'][_0xb038('0x15')]);}else{logger[_0xb038('0xd')](_0xb038('0xe'),_0xe3d046,_0xb038('0xf'));_0x5c96b5(_0x3368c1['result']['message']);}})[_0xb038('0x16')](function(_0x3f48e6){logger[_0xb038('0x13')](_0xb038('0xe'),_0xe3d046,_0x3f48e6);_0x2ede0b(_0x3f48e6);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 95005be..9f1452b 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 _0x18a5=['remove','update','emit','removeListener','register','userProfile:','save'];(function(_0x175b2e,_0x57e971){var _0x23c877=function(_0xa536b5){while(--_0xa536b5){_0x175b2e['push'](_0x175b2e['shift']());}};_0x23c877(++_0x57e971);}(_0x18a5,0x1aa));var _0x518a=function(_0x35bed5,_0x33444f){_0x35bed5=_0x35bed5-0x0;var _0x2ac1b6=_0x18a5[_0x35bed5];return _0x2ac1b6;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x518a('0x0'),_0x518a('0x1'),_0x518a('0x2')];function createListener(_0x1b0f9e,_0xed79a7){return function(_0x3af818){_0xed79a7[_0x518a('0x3')](_0x1b0f9e,_0x3af818);};}function removeListener(_0x4230b6,_0x2ae040){return function(){UserProfileEvents[_0x518a('0x4')](_0x4230b6,_0x2ae040);};}exports[_0x518a('0x5')]=function(_0x40742a){for(var _0xff2d3a=0x0,_0x139390=events['length'];_0xff2d3a<_0x139390;_0xff2d3a++){var _0xe20f51=events[_0xff2d3a];var _0x13c26d=createListener(_0x518a('0x6')+_0xe20f51,_0x40742a);UserProfileEvents['on'](_0xe20f51,_0x13c26d);}}; \ No newline at end of file +var _0xc0ad=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register','length'];(function(_0x53ab8b,_0x21c10f){var _0xd8be=function(_0xba0668){while(--_0xba0668){_0x53ab8b['push'](_0x53ab8b['shift']());}};_0xd8be(++_0x21c10f);}(_0xc0ad,0x121));var _0xdc0a=function(_0x2f3064,_0x23a256){_0x2f3064=_0x2f3064-0x0;var _0x473bf4=_0xc0ad[_0x2f3064];return _0x473bf4;};'use strict';var UserProfileEvents=require(_0xdc0a('0x0'));var events=[_0xdc0a('0x1'),_0xdc0a('0x2'),_0xdc0a('0x3')];function createListener(_0xaedb08,_0x24eee8){return function(_0xa81aea){_0x24eee8[_0xdc0a('0x4')](_0xaedb08,_0xa81aea);};}function removeListener(_0x4408b5,_0x28cb72){return function(){UserProfileEvents[_0xdc0a('0x5')](_0x4408b5,_0x28cb72);};}exports[_0xdc0a('0x6')]=function(_0x25cd4d){for(var _0x2aec6f=0x0,_0x59a902=events[_0xdc0a('0x7')];_0x2aec6f<_0x59a902;_0x2aec6f++){var _0x255094=events[_0x2aec6f];var _0x156fed=createListener(_0xdc0a('0x8')+_0x255094,_0x25cd4d);UserProfileEvents['on'](_0x255094,_0x156fed);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index e983862..08bc69b 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 _0x85ed=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','delete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x85ed,0x66));var _0xd85e=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x85ed[_0x324012];return _0x435cf2;};'use strict';var multer=require(_0xd85e('0x0'));var util=require(_0xd85e('0x1'));var path=require(_0xd85e('0x2'));var timeout=require(_0xd85e('0x3'));var express=require(_0xd85e('0x4'));var router=express[_0xd85e('0x5')]();var auth=require(_0xd85e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd85e('0x7'));var controller=require(_0xd85e('0x8'));router[_0xd85e('0x9')]('/',auth[_0xd85e('0xa')](),controller['index']);router[_0xd85e('0x9')](_0xd85e('0xb'),auth['isAuthenticated'](),controller[_0xd85e('0xc')]);router[_0xd85e('0x9')](_0xd85e('0xd'),auth[_0xd85e('0xa')](),controller['show']);router[_0xd85e('0xe')]('/',auth[_0xd85e('0xa')](),controller[_0xd85e('0xf')]);router[_0xd85e('0x10')](_0xd85e('0xd'),auth[_0xd85e('0xa')](),controller['update']);router[_0xd85e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd85e('0x12')]);module[_0xd85e('0x13')]=router; \ No newline at end of file +var _0xa846=['isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller'];(function(_0x539898,_0x1bb48a){var _0x5d6856=function(_0x214583){while(--_0x214583){_0x539898['push'](_0x539898['shift']());}};_0x5d6856(++_0x1bb48a);}(_0xa846,0x70));var _0x6a84=function(_0x55fdf1,_0x133350){_0x55fdf1=_0x55fdf1-0x0;var _0x18857d=_0xa846[_0x55fdf1];return _0x18857d;};'use strict';var multer=require('multer');var util=require(_0x6a84('0x0'));var path=require(_0x6a84('0x1'));var timeout=require(_0x6a84('0x2'));var express=require(_0x6a84('0x3'));var router=express[_0x6a84('0x4')]();var auth=require(_0x6a84('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6a84('0x6'));var controller=require(_0x6a84('0x7'));router['get']('/',auth[_0x6a84('0x8')](),controller[_0x6a84('0x9')]);router[_0x6a84('0xa')](_0x6a84('0xb'),auth['isAuthenticated'](),controller[_0x6a84('0xc')]);router['get'](_0x6a84('0xd'),auth['isAuthenticated'](),controller[_0x6a84('0xe')]);router['post']('/',auth[_0x6a84('0x8')](),controller[_0x6a84('0xf')]);router[_0x6a84('0x10')](_0x6a84('0xd'),auth[_0x6a84('0x8')](),controller[_0x6a84('0x11')]);router[_0x6a84('0x12')]('/:id',auth[_0x6a84('0x8')](),controller[_0x6a84('0x13')]);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 c57a3aa..5e838b6 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 _0x6340=['sequelize','INTEGER','STRING'];(function(_0x3fdc99,_0x5c124e){var _0x4b4a13=function(_0x340362){while(--_0x340362){_0x3fdc99['push'](_0x3fdc99['shift']());}};_0x4b4a13(++_0x5c124e);}(_0x6340,0x19e));var _0x0634=function(_0x3daf63,_0x25528a){_0x3daf63=_0x3daf63-0x0;var _0x558174=_0x6340[_0x3daf63];return _0x558174;};'use strict';var Sequelize=require(_0x0634('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0634('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0634('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x85a8=['INTEGER','exports','STRING'];(function(_0x14b3a6,_0x95a918){var _0x245603=function(_0x571a46){while(--_0x571a46){_0x14b3a6['push'](_0x14b3a6['shift']());}};_0x245603(++_0x95a918);}(_0x85a8,0xd3));var _0x885a=function(_0x45fbc3,_0x5d5c98){_0x45fbc3=_0x45fbc3-0x0;var _0x4a599b=_0x85a8[_0x45fbc3];return _0x4a599b;};'use strict';var Sequelize=require('sequelize');module[_0x885a('0x0')]={'name':{'type':Sequelize[_0x885a('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x885a('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index da6efff..3e9d63b 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 _0x9b67=['type','key','model','map','keys','query','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','name','send','UserProfileResource','rawAttributes','fieldName'];(function(_0x393bd1,_0x45433a){var _0x1a8526=function(_0x25b431){while(--_0x25b431){_0x393bd1['push'](_0x393bd1['shift']());}};_0x1a8526(++_0x45433a);}(_0x9b67,0xf6));var _0x79b6=function(_0xa9a175,_0x4e691d){_0xa9a175=_0xa9a175-0x0;var _0x177538=_0x9b67[_0xa9a175];return _0x177538;};'use strict';var pdf=require(_0x79b6('0x0'));var emlformat=require(_0x79b6('0x1'));var rimraf=require(_0x79b6('0x2'));var zipdir=require(_0x79b6('0x3'));var jsonpatch=require(_0x79b6('0x4'));var rp=require('request-promise');var moment=require(_0x79b6('0x5'));var BPromise=require(_0x79b6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79b6('0x7'));var sox=require(_0x79b6('0x8'));var csv=require(_0x79b6('0x9'));var ejs=require(_0x79b6('0xa'));var fs=require('fs');var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x9'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var db=require(_0x79b6('0x17'))['db'];function respondWithStatusCode(_0x303cfb,_0x526727){_0x526727=_0x526727||0xcc;return function(_0xc05a77){if(_0xc05a77){return _0x303cfb[_0x79b6('0x18')](_0x526727);}return _0x303cfb[_0x79b6('0x19')](_0x526727)[_0x79b6('0x1a')]();};}function respondWithResult(_0x3b0721,_0x40478d){_0x40478d=_0x40478d||0xc8;return function(_0x19d5b2){if(_0x19d5b2){return _0x3b0721[_0x79b6('0x19')](_0x40478d)[_0x79b6('0x1b')](_0x19d5b2);}};}function respondWithFilteredResult(_0x114d8c,_0x2ac966){return function(_0x3563cc){if(_0x3563cc){var _0x1e8bf1=_0x3563cc[_0x79b6('0x1c')],_0x4cf491=_0x2ac966[_0x79b6('0x1d')],_0x207bcc=_0x2ac966[_0x79b6('0x1d')]+_0x2ac966[_0x79b6('0x1e')],_0x2a75d5;if(_0x207bcc>=_0x1e8bf1){_0x207bcc=_0x1e8bf1;_0x2a75d5=0xc8;}else{_0x2a75d5=0xce;}_0x114d8c[_0x79b6('0x19')](_0x2a75d5);return _0x114d8c[_0x79b6('0x1f')](_0x79b6('0x20'),_0x4cf491+'-'+_0x207bcc+'/'+_0x1e8bf1)[_0x79b6('0x1b')](_0x3563cc);}return null;};}function patchUpdates(_0x323376){return function(_0xa1a29a){try{jsonpatch[_0x79b6('0x21')](_0xa1a29a,_0x323376,!![]);}catch(_0x52a70f){return BPromise[_0x79b6('0x22')](_0x52a70f);}return _0xa1a29a['save']();};}function saveUpdates(_0x22a9eb,_0x532e65){return function(_0x28b9c2){if(_0x28b9c2){return _0x28b9c2[_0x79b6('0x23')](_0x22a9eb)[_0x79b6('0x24')](function(_0x56ebf4){return _0x56ebf4;});}return null;};}function removeEntity(_0x46304b,_0x30dc0b){return function(_0x53208a){if(_0x53208a){return _0x53208a['destroy']()[_0x79b6('0x24')](function(){_0x46304b[_0x79b6('0x19')](0xcc)[_0x79b6('0x1a')]();});}};}function handleEntityNotFound(_0x268826,_0x3b2a2a){return function(_0x488102){if(!_0x488102){_0x268826[_0x79b6('0x18')](0x194);}return _0x488102;};}function handleError(_0x280e04,_0x17eff4){_0x17eff4=_0x17eff4||0x1f4;return function(_0x26dd86){logger['error'](_0x26dd86['stack']);if(_0x26dd86[_0x79b6('0x25')]){delete _0x26dd86[_0x79b6('0x25')];}_0x280e04[_0x79b6('0x19')](_0x17eff4)[_0x79b6('0x26')](_0x26dd86);};}exports['index']=function(_0x6f6ca1,_0x52574b){var _0x400542={},_0x2fd9b5={},_0x302596={'count':0x0,'rows':[]};var _0xe03d2=_['map'](db[_0x79b6('0x27')][_0x79b6('0x28')],function(_0x53b463){return{'name':_0x53b463[_0x79b6('0x29')],'type':_0x53b463[_0x79b6('0x2a')][_0x79b6('0x2b')]};});_0x2fd9b5[_0x79b6('0x2c')]=_[_0x79b6('0x2d')](_0xe03d2,_0x79b6('0x25'));_0x2fd9b5['query']=_[_0x79b6('0x2e')](_0x6f6ca1[_0x79b6('0x2f')]);_0x2fd9b5[_0x79b6('0x30')]=_[_0x79b6('0x31')](_0x2fd9b5[_0x79b6('0x2c')],_0x2fd9b5[_0x79b6('0x2f')]);_0x400542['attributes']=_[_0x79b6('0x31')](_0x2fd9b5[_0x79b6('0x2c')],qs[_0x79b6('0x32')](_0x6f6ca1['query']['fields']));_0x400542[_0x79b6('0x33')]=_0x400542[_0x79b6('0x33')][_0x79b6('0x34')]?_0x400542[_0x79b6('0x33')]:_0x2fd9b5[_0x79b6('0x2c')];if(!_0x6f6ca1[_0x79b6('0x2f')]['hasOwnProperty']('nolimit')){_0x400542[_0x79b6('0x1e')]=qs['limit'](_0x6f6ca1[_0x79b6('0x2f')]['limit']);_0x400542[_0x79b6('0x1d')]=qs[_0x79b6('0x1d')](_0x6f6ca1['query'][_0x79b6('0x1d')]);}_0x400542[_0x79b6('0x35')]=qs['sort'](_0x6f6ca1[_0x79b6('0x2f')]['sort']);_0x400542[_0x79b6('0x36')]=qs[_0x79b6('0x30')](_[_0x79b6('0x37')](_0x6f6ca1[_0x79b6('0x2f')],_0x2fd9b5[_0x79b6('0x30')]),_0xe03d2);if(_0x6f6ca1[_0x79b6('0x2f')][_0x79b6('0x38')]){_0x400542[_0x79b6('0x36')]=_[_0x79b6('0x39')](_0x400542[_0x79b6('0x36')],{'$or':_['map'](_0xe03d2,function(_0x5179ec){if(_0x5179ec['type']!==_0x79b6('0x3a')){var _0x324a04={};_0x324a04[_0x5179ec['name']]={'$like':'%'+_0x6f6ca1[_0x79b6('0x2f')]['filter']+'%'};return _0x324a04;}})});}_0x400542=_[_0x79b6('0x39')]({},_0x400542,_0x6f6ca1[_0x79b6('0x3b')]);var _0x26abad={'where':_0x400542['where']};return db[_0x79b6('0x27')]['count'](_0x26abad)[_0x79b6('0x24')](function(_0x1bba0d){_0x302596[_0x79b6('0x1c')]=_0x1bba0d;if(_0x6f6ca1[_0x79b6('0x2f')][_0x79b6('0x3c')]){_0x400542['include']=[{'all':!![]}];}return db['UserProfileResource'][_0x79b6('0x3d')](_0x400542);})['then'](function(_0x4037c8){_0x302596[_0x79b6('0x3e')]=_0x4037c8;return _0x302596;})[_0x79b6('0x24')](respondWithFilteredResult(_0x52574b,_0x400542))[_0x79b6('0x3f')](handleError(_0x52574b,null));};exports[_0x79b6('0x40')]=function(_0x376eb2,_0x475c8c){var _0x4a7f90={'raw':![],'where':{'id':_0x376eb2[_0x79b6('0x41')]['id']}},_0x109514={};_0x109514[_0x79b6('0x2c')]=_[_0x79b6('0x2e')](db['UserProfileResource'][_0x79b6('0x28')]);_0x109514['query']=_['keys'](_0x376eb2[_0x79b6('0x2f')]);_0x109514[_0x79b6('0x30')]=_[_0x79b6('0x31')](_0x109514[_0x79b6('0x2c')],_0x109514[_0x79b6('0x2f')]);_0x4a7f90[_0x79b6('0x33')]=_[_0x79b6('0x31')](_0x109514[_0x79b6('0x2c')],qs['fields'](_0x376eb2[_0x79b6('0x2f')]['fields']));_0x4a7f90['attributes']=_0x4a7f90[_0x79b6('0x33')][_0x79b6('0x34')]?_0x4a7f90[_0x79b6('0x33')]:_0x109514[_0x79b6('0x2c')];if(_0x376eb2[_0x79b6('0x2f')][_0x79b6('0x3c')]){_0x4a7f90[_0x79b6('0x42')]=[{'all':!![]}];}_0x4a7f90=_[_0x79b6('0x39')]({},_0x4a7f90,_0x376eb2[_0x79b6('0x3b')]);return db['UserProfileResource'][_0x79b6('0x43')](_0x4a7f90)[_0x79b6('0x24')](handleEntityNotFound(_0x475c8c,null))[_0x79b6('0x24')](respondWithResult(_0x475c8c,null))[_0x79b6('0x3f')](handleError(_0x475c8c,null));};exports[_0x79b6('0x44')]=function(_0x4f1344,_0x3e335e){return db[_0x79b6('0x27')]['create'](_0x4f1344['body'],{})[_0x79b6('0x24')](respondWithResult(_0x3e335e,0xc9))[_0x79b6('0x3f')](handleError(_0x3e335e,null));};exports[_0x79b6('0x23')]=function(_0xa0c396,_0x37f4b1){if(_0xa0c396[_0x79b6('0x45')]['id']){delete _0xa0c396[_0x79b6('0x45')]['id'];}return db[_0x79b6('0x27')][_0x79b6('0x43')]({'where':{'id':_0xa0c396[_0x79b6('0x41')]['id']}})[_0x79b6('0x24')](handleEntityNotFound(_0x37f4b1,null))[_0x79b6('0x24')](saveUpdates(_0xa0c396[_0x79b6('0x45')],null))[_0x79b6('0x24')](respondWithResult(_0x37f4b1,null))[_0x79b6('0x3f')](handleError(_0x37f4b1,null));};exports[_0x79b6('0x46')]=function(_0x26ab29,_0x14fa5c){return db[_0x79b6('0x27')]['find']({'where':{'id':_0x26ab29['params']['id']}})['then'](handleEntityNotFound(_0x14fa5c,null))['then'](removeEntity(_0x14fa5c,null))['catch'](handleError(_0x14fa5c,null));};exports[_0x79b6('0x47')]=function(_0xdaef8c,_0x23d4eb){return db[_0x79b6('0x27')][_0x79b6('0x47')]()[_0x79b6('0x24')](respondWithResult(_0x23d4eb,null))['catch'](handleError(_0x23d4eb,null));}; \ No newline at end of file +var _0x31f0=['index','map','UserProfileResource','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','merge','type','VIRTUAL','filter','options','where','includeAll','include','findAll','catch','show','find','create','body','params','destroy','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x31f0,0xb7));var _0x031f=function(_0x3420b3,_0x5a31c3){_0x3420b3=_0x3420b3-0x0;var _0x4a7c0a=_0x31f0[_0x3420b3];return _0x4a7c0a;};'use strict';var pdf=require(_0x031f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x031f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x031f('0x2'));var rp=require(_0x031f('0x3'));var moment=require(_0x031f('0x4'));var BPromise=require(_0x031f('0x5'));var Mustache=require('mustache');var util=require(_0x031f('0x6'));var path=require(_0x031f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var db=require(_0x031f('0x16'))['db'];function respondWithStatusCode(_0x28da6e,_0x351052){_0x351052=_0x351052||0xcc;return function(_0x3819bb){if(_0x3819bb){return _0x28da6e[_0x031f('0x17')](_0x351052);}return _0x28da6e[_0x031f('0x18')](_0x351052)['end']();};}function respondWithResult(_0x1614d6,_0x23b40c){_0x23b40c=_0x23b40c||0xc8;return function(_0x17a699){if(_0x17a699){return _0x1614d6[_0x031f('0x18')](_0x23b40c)[_0x031f('0x19')](_0x17a699);}};}function respondWithFilteredResult(_0x57f9c0,_0x4b7011){return function(_0x1f08db){if(_0x1f08db){var _0x3a10aa=_0x1f08db[_0x031f('0x1a')],_0xe4fc1d=_0x4b7011[_0x031f('0x1b')],_0x286177=_0x4b7011['offset']+_0x4b7011[_0x031f('0x1c')],_0x5196b1;if(_0x286177>=_0x3a10aa){_0x286177=_0x3a10aa;_0x5196b1=0xc8;}else{_0x5196b1=0xce;}_0x57f9c0['status'](_0x5196b1);return _0x57f9c0[_0x031f('0x1d')](_0x031f('0x1e'),_0xe4fc1d+'-'+_0x286177+'/'+_0x3a10aa)[_0x031f('0x19')](_0x1f08db);}return null;};}function patchUpdates(_0xaa155){return function(_0x1ceddc){try{jsonpatch[_0x031f('0x1f')](_0x1ceddc,_0xaa155,!![]);}catch(_0x1b76d6){return BPromise[_0x031f('0x20')](_0x1b76d6);}return _0x1ceddc[_0x031f('0x21')]();};}function saveUpdates(_0x345bde,_0x29dd6e){return function(_0x48a76e){if(_0x48a76e){return _0x48a76e[_0x031f('0x22')](_0x345bde)[_0x031f('0x23')](function(_0x451328){return _0x451328;});}return null;};}function removeEntity(_0x4d6706,_0x5c4184){return function(_0xa11a2b){if(_0xa11a2b){return _0xa11a2b['destroy']()[_0x031f('0x23')](function(){_0x4d6706['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47d639,_0x971691){return function(_0x12c406){if(!_0x12c406){_0x47d639[_0x031f('0x17')](0x194);}return _0x12c406;};}function handleError(_0x4c8126,_0x494568){_0x494568=_0x494568||0x1f4;return function(_0x374b65){logger['error'](_0x374b65[_0x031f('0x24')]);if(_0x374b65[_0x031f('0x25')]){delete _0x374b65[_0x031f('0x25')];}_0x4c8126['status'](_0x494568)[_0x031f('0x26')](_0x374b65);};}exports[_0x031f('0x27')]=function(_0x54b44e,_0x3847b2){var _0x28a617={},_0x2403e9={},_0x5395ea={'count':0x0,'rows':[]};var _0xa308b=_[_0x031f('0x28')](db[_0x031f('0x29')][_0x031f('0x2a')],function(_0xfaa36){return{'name':_0xfaa36[_0x031f('0x2b')],'type':_0xfaa36['type'][_0x031f('0x2c')]};});_0x2403e9[_0x031f('0x2d')]=_[_0x031f('0x28')](_0xa308b,_0x031f('0x25'));_0x2403e9[_0x031f('0x2e')]=_[_0x031f('0x2f')](_0x54b44e[_0x031f('0x2e')]);_0x2403e9[_0x031f('0x30')]=_[_0x031f('0x31')](_0x2403e9[_0x031f('0x2d')],_0x2403e9[_0x031f('0x2e')]);_0x28a617['attributes']=_[_0x031f('0x31')](_0x2403e9[_0x031f('0x2d')],qs[_0x031f('0x32')](_0x54b44e[_0x031f('0x2e')][_0x031f('0x32')]));_0x28a617[_0x031f('0x33')]=_0x28a617[_0x031f('0x33')][_0x031f('0x34')]?_0x28a617[_0x031f('0x33')]:_0x2403e9[_0x031f('0x2d')];if(!_0x54b44e[_0x031f('0x2e')][_0x031f('0x35')](_0x031f('0x36'))){_0x28a617['limit']=qs[_0x031f('0x1c')](_0x54b44e[_0x031f('0x2e')]['limit']);_0x28a617[_0x031f('0x1b')]=qs[_0x031f('0x1b')](_0x54b44e['query'][_0x031f('0x1b')]);}_0x28a617[_0x031f('0x37')]=qs[_0x031f('0x38')](_0x54b44e[_0x031f('0x2e')]['sort']);_0x28a617['where']=qs[_0x031f('0x30')](_['pick'](_0x54b44e[_0x031f('0x2e')],_0x2403e9[_0x031f('0x30')]),_0xa308b);if(_0x54b44e[_0x031f('0x2e')]['filter']){_0x28a617['where']=_[_0x031f('0x39')](_0x28a617['where'],{'$or':_['map'](_0xa308b,function(_0x2d489a){if(_0x2d489a[_0x031f('0x3a')]!==_0x031f('0x3b')){var _0x1a44df={};_0x1a44df[_0x2d489a[_0x031f('0x25')]]={'$like':'%'+_0x54b44e[_0x031f('0x2e')][_0x031f('0x3c')]+'%'};return _0x1a44df;}})});}_0x28a617=_['merge']({},_0x28a617,_0x54b44e[_0x031f('0x3d')]);var _0x2e580f={'where':_0x28a617[_0x031f('0x3e')]};return db[_0x031f('0x29')]['count'](_0x2e580f)[_0x031f('0x23')](function(_0x10f590){_0x5395ea[_0x031f('0x1a')]=_0x10f590;if(_0x54b44e['query'][_0x031f('0x3f')]){_0x28a617[_0x031f('0x40')]=[{'all':!![]}];}return db['UserProfileResource'][_0x031f('0x41')](_0x28a617);})[_0x031f('0x23')](function(_0x56a8f3){_0x5395ea['rows']=_0x56a8f3;return _0x5395ea;})[_0x031f('0x23')](respondWithFilteredResult(_0x3847b2,_0x28a617))[_0x031f('0x42')](handleError(_0x3847b2,null));};exports[_0x031f('0x43')]=function(_0x46885f,_0x2691b7){var _0xf0fb95={'raw':![],'where':{'id':_0x46885f['params']['id']}},_0xe07087={};_0xe07087[_0x031f('0x2d')]=_[_0x031f('0x2f')](db['UserProfileResource'][_0x031f('0x2a')]);_0xe07087['query']=_[_0x031f('0x2f')](_0x46885f[_0x031f('0x2e')]);_0xe07087['filters']=_[_0x031f('0x31')](_0xe07087[_0x031f('0x2d')],_0xe07087[_0x031f('0x2e')]);_0xf0fb95['attributes']=_[_0x031f('0x31')](_0xe07087[_0x031f('0x2d')],qs[_0x031f('0x32')](_0x46885f[_0x031f('0x2e')][_0x031f('0x32')]));_0xf0fb95[_0x031f('0x33')]=_0xf0fb95[_0x031f('0x33')][_0x031f('0x34')]?_0xf0fb95[_0x031f('0x33')]:_0xe07087['model'];if(_0x46885f[_0x031f('0x2e')][_0x031f('0x3f')]){_0xf0fb95[_0x031f('0x40')]=[{'all':!![]}];}_0xf0fb95=_[_0x031f('0x39')]({},_0xf0fb95,_0x46885f[_0x031f('0x3d')]);return db[_0x031f('0x29')][_0x031f('0x44')](_0xf0fb95)[_0x031f('0x23')](handleEntityNotFound(_0x2691b7,null))[_0x031f('0x23')](respondWithResult(_0x2691b7,null))['catch'](handleError(_0x2691b7,null));};exports[_0x031f('0x45')]=function(_0x5ec593,_0x512937){return db[_0x031f('0x29')][_0x031f('0x45')](_0x5ec593[_0x031f('0x46')],{})[_0x031f('0x23')](respondWithResult(_0x512937,0xc9))[_0x031f('0x42')](handleError(_0x512937,null));};exports['update']=function(_0x309642,_0x365f8c){if(_0x309642[_0x031f('0x46')]['id']){delete _0x309642['body']['id'];}return db[_0x031f('0x29')][_0x031f('0x44')]({'where':{'id':_0x309642[_0x031f('0x47')]['id']}})[_0x031f('0x23')](handleEntityNotFound(_0x365f8c,null))[_0x031f('0x23')](saveUpdates(_0x309642[_0x031f('0x46')],null))['then'](respondWithResult(_0x365f8c,null))['catch'](handleError(_0x365f8c,null));};exports[_0x031f('0x48')]=function(_0x579b17,_0x3b8c04){return db[_0x031f('0x29')]['find']({'where':{'id':_0x579b17[_0x031f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b8c04,null))['then'](removeEntity(_0x3b8c04,null))[_0x031f('0x42')](handleError(_0x3b8c04,null));};exports['describe']=function(_0x16bade,_0x57e9dc){return db[_0x031f('0x29')][_0x031f('0x49')]()['then'](respondWithResult(_0x57e9dc,null))[_0x031f('0x42')](handleError(_0x57e9dc,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index bd17250..0d9a338 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 _0xcb91=['exports','define','user_profile_has_resources','compositeIndex','sectionId','../../config/logger','api','moment','bluebird','path','rimraf','./userProfileResource.attributes'];(function(_0x102db9,_0x478d36){var _0x59ee79=function(_0x917112){while(--_0x917112){_0x102db9['push'](_0x102db9['shift']());}};_0x59ee79(++_0x478d36);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3452a8,_0x4bfaa4){_0x3452a8=_0x3452a8-0x0;var _0x233814=_0xcb91[_0x3452a8];return _0x233814;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('UserProfileResource',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['resourceId',_0x1cb9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x702d=['exports','define','UserProfileResource','compositeIndex','sectionId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x578eb2,_0x1a7547){var _0x91a5e=function(_0x44eb39){while(--_0x44eb39){_0x578eb2['push'](_0x578eb2['shift']());}};_0x91a5e(++_0x1a7547);}(_0x702d,0x147));var _0xd702=function(_0x3902e1,_0x2675c8){_0x3902e1=_0x3902e1-0x0;var _0xcfb71a=_0x702d[_0x3902e1];return _0xcfb71a;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./userProfileResource.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xd702('0xc'),'fields':['resourceId',_0xd702('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 20dc00c..faf9253 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 _0x968a=['request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info'];(function(_0x1f4811,_0x5aa94d){var _0x5cbfc6=function(_0x57a4cb){while(--_0x57a4cb){_0x1f4811['push'](_0x1f4811['shift']());}};_0x5cbfc6(++_0x5aa94d);}(_0x968a,0xe5));var _0xa968=function(_0x5530d0,_0x56bac6){_0x5530d0=_0x5530d0-0x0;var _0x4b4285=_0x968a[_0x5530d0];return _0x4b4285;};'use strict';var _=require('lodash');var util=require(_0xa968('0x0'));var moment=require(_0xa968('0x1'));var BPromise=require(_0xa968('0x2'));var rs=require(_0xa968('0x3'));var fs=require('fs');var Redis=require(_0xa968('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa968('0x5'));var logger=require(_0xa968('0x6'))(_0xa968('0x7'));var config=require(_0xa968('0x8'));var jayson=require(_0xa968('0x9'));var client=jayson[_0xa968('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cb41f,_0x48e1b0,_0x349c0f){return new BPromise(function(_0x34885d,_0x5cf002){return client[_0xa968('0xb')](_0x4cb41f,_0x349c0f)['then'](function(_0x16b61){logger[_0xa968('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x48e1b0,_0xa968('0xd'));logger[_0xa968('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x48e1b0,'request\x20sent',JSON[_0xa968('0xf')](_0x16b61));if(_0x16b61[_0xa968('0x10')]){if(_0x16b61[_0xa968('0x10')][_0xa968('0x11')]===0x1f4){logger[_0xa968('0x10')](_0xa968('0x12'),_0x48e1b0,_0x16b61[_0xa968('0x10')]['message']);return _0x5cf002(_0x16b61['error'][_0xa968('0x13')]);}logger[_0xa968('0x10')](_0xa968('0x12'),_0x48e1b0,_0x16b61['error'][_0xa968('0x13')]);return _0x34885d(_0x16b61[_0xa968('0x10')][_0xa968('0x13')]);}else{logger[_0xa968('0xc')](_0xa968('0x12'),_0x48e1b0,_0xa968('0xd'));_0x34885d(_0x16b61[_0xa968('0x14')]['message']);}})[_0xa968('0x15')](function(_0x3cf9ef){logger['error'](_0xa968('0x12'),_0x48e1b0,_0x3cf9ef);_0x5cf002(_0x3cf9ef);});});} \ No newline at end of file +var _0x455f=['UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x467ce3,_0xa1102f){var _0xd0fe10=function(_0x42bf1f){while(--_0x42bf1f){_0x467ce3['push'](_0x467ce3['shift']());}};_0xd0fe10(++_0xa1102f);}(_0x455f,0x134));var _0xf455=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x455f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf455('0x0'));var BPromise=require(_0xf455('0x1'));var rs=require(_0xf455('0x2'));var fs=require('fs');var Redis=require(_0xf455('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf455('0x4'));var logger=require(_0xf455('0x5'))(_0xf455('0x6'));var config=require(_0xf455('0x7'));var jayson=require(_0xf455('0x8'));var client=jayson[_0xf455('0x9')][_0xf455('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4906fe,_0x4ff0fa,_0x219bc8){return new BPromise(function(_0x524373,_0x5be45b){return client[_0xf455('0xb')](_0x4906fe,_0x219bc8)[_0xf455('0xc')](function(_0x2a27c7){logger[_0xf455('0xd')](_0xf455('0xe'),_0x4ff0fa,_0xf455('0xf'));logger[_0xf455('0x10')](_0xf455('0x11'),_0x4ff0fa,'request\x20sent',JSON[_0xf455('0x12')](_0x2a27c7));if(_0x2a27c7[_0xf455('0x13')]){if(_0x2a27c7[_0xf455('0x13')][_0xf455('0x14')]===0x1f4){logger[_0xf455('0x13')](_0xf455('0xe'),_0x4ff0fa,_0x2a27c7[_0xf455('0x13')][_0xf455('0x15')]);return _0x5be45b(_0x2a27c7[_0xf455('0x13')][_0xf455('0x15')]);}logger[_0xf455('0x13')](_0xf455('0xe'),_0x4ff0fa,_0x2a27c7[_0xf455('0x13')][_0xf455('0x15')]);return _0x524373(_0x2a27c7[_0xf455('0x13')][_0xf455('0x15')]);}else{logger[_0xf455('0xd')](_0xf455('0xe'),_0x4ff0fa,_0xf455('0xf'));_0x524373(_0x2a27c7[_0xf455('0x16')][_0xf455('0x15')]);}})['catch'](function(_0x322b21){logger[_0xf455('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x4ff0fa,_0x322b21);_0x5be45b(_0x322b21);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index ce94970..afdb8db 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 _0x073d=['show','create','put','delete','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x1ce4f3,_0x32c45a){var _0x5e834f=function(_0x365bcb){while(--_0x365bcb){_0x1ce4f3['push'](_0x1ce4f3['shift']());}};_0x5e834f(++_0x32c45a);}(_0x073d,0x103));var _0xd073=function(_0x49088a,_0xa2b35c){_0x49088a=_0x49088a-0x0;var _0x3a522d=_0x073d[_0x49088a];return _0x3a522d;};'use strict';var multer=require(_0xd073('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd073('0x1'));var express=require(_0xd073('0x2'));var router=express[_0xd073('0x3')]();var auth=require(_0xd073('0x4'));var interaction=require(_0xd073('0x5'));var config=require('../../config/environment');var controller=require(_0xd073('0x6'));router['get']('/',auth[_0xd073('0x7')](),controller[_0xd073('0x8')]);router[_0xd073('0x9')](_0xd073('0xa'),auth[_0xd073('0x7')](),controller[_0xd073('0xb')]);router[_0xd073('0x9')](_0xd073('0xc'),auth[_0xd073('0x7')](),controller[_0xd073('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd073('0xe')]);router[_0xd073('0xf')](_0xd073('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd073('0x10')](_0xd073('0xc'),auth[_0xd073('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb150=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3ea125,_0x46c6de){var _0x56838f=function(_0x43fef9){while(--_0x43fef9){_0x3ea125['push'](_0x3ea125['shift']());}};_0x56838f(++_0x46c6de);}(_0xb150,0x18e));var _0x0b15=function(_0x2d25b4,_0x35bca7){_0x2d25b4=_0x2d25b4-0x0;var _0x33defe=_0xb150[_0x2d25b4];return _0x33defe;};'use strict';var multer=require(_0x0b15('0x0'));var util=require(_0x0b15('0x1'));var path=require(_0x0b15('0x2'));var timeout=require(_0x0b15('0x3'));var express=require(_0x0b15('0x4'));var router=express[_0x0b15('0x5')]();var auth=require(_0x0b15('0x6'));var interaction=require(_0x0b15('0x7'));var config=require(_0x0b15('0x8'));var controller=require('./userProfileSection.controller');router[_0x0b15('0x9')]('/',auth[_0x0b15('0xa')](),controller[_0x0b15('0xb')]);router[_0x0b15('0x9')](_0x0b15('0xc'),auth[_0x0b15('0xa')](),controller[_0x0b15('0xd')]);router[_0x0b15('0x9')](_0x0b15('0xe'),auth['isAuthenticated'](),controller[_0x0b15('0xf')]);router[_0x0b15('0x10')]('/',auth[_0x0b15('0xa')](),controller[_0x0b15('0x11')]);router[_0x0b15('0x12')](_0x0b15('0xe'),auth[_0x0b15('0xa')](),controller[_0x0b15('0x13')]);router[_0x0b15('0x14')]('/:id',auth[_0x0b15('0xa')](),controller[_0x0b15('0x15')]);module[_0x0b15('0x16')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index a2455ed..d87d0ab 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 _0xdefc=['crudPermissions','join','getDataValue','sequelize','exports','STRING','BOOLEAN','setDataValue'];(function(_0x468039,_0x15d693){var _0x52f100=function(_0x39f55b){while(--_0x39f55b){_0x468039['push'](_0x468039['shift']());}};_0x52f100(++_0x15d693);}(_0xdefc,0x1b3));var _0xcdef=function(_0x5820df,_0x24240a){_0x5820df=_0x5820df-0x0;var _0x7a47f1=_0xdefc[_0x5820df];return _0x7a47f1;};'use strict';var Sequelize=require(_0xcdef('0x0'));module[_0xcdef('0x1')]={'name':{'type':Sequelize[_0xcdef('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xcdef('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xcdef('0x2')],'set':function(_0x2418f0){this[_0xcdef('0x4')](_0xcdef('0x5'),_0x2418f0?_0x2418f0[_0xcdef('0x6')](''):[]);},'get':function(){return this[_0xcdef('0x7')](_0xcdef('0x5'))?this['getDataValue'](_0xcdef('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x6873=['crudPermissions','join','getDataValue','split','STRING','INTEGER','BOOLEAN'];(function(_0x39b4f3,_0xa9a5e3){var _0x40dcb0=function(_0x426258){while(--_0x426258){_0x39b4f3['push'](_0x39b4f3['shift']());}};_0x40dcb0(++_0xa9a5e3);}(_0x6873,0xac));var _0x3687=function(_0x36d703,_0x55b354){_0x36d703=_0x36d703-0x0;var _0x12c909=_0x6873[_0x36d703];return _0x12c909;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3687('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x3687('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3687('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3687('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3687('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x247d96){this['setDataValue'](_0x3687('0x3'),_0x247d96?_0x247d96[_0x3687('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x3687('0x3'))?this[_0x3687('0x5')](_0x3687('0x3'))[_0x3687('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e2aaf08..4bac397 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 _0x50fe=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','end','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','status','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x2fe23e,_0x5afd8a){var _0x4a0b0e=function(_0xbd4b97){while(--_0xbd4b97){_0x2fe23e['push'](_0x2fe23e['shift']());}};_0x4a0b0e(++_0x5afd8a);}(_0x50fe,0x12a));var _0xe50f=function(_0x1b6ca1,_0x24349d){_0x1b6ca1=_0x1b6ca1-0x0;var _0x49d973=_0x50fe[_0x1b6ca1];return _0x49d973;};'use strict';var pdf=require(_0xe50f('0x0'));var emlformat=require(_0xe50f('0x1'));var rimraf=require(_0xe50f('0x2'));var zipdir=require(_0xe50f('0x3'));var jsonpatch=require(_0xe50f('0x4'));var rp=require(_0xe50f('0x5'));var moment=require(_0xe50f('0x6'));var BPromise=require(_0xe50f('0x7'));var Mustache=require(_0xe50f('0x8'));var util=require(_0xe50f('0x9'));var path=require(_0xe50f('0xa'));var sox=require(_0xe50f('0xb'));var csv=require(_0xe50f('0xc'));var ejs=require(_0xe50f('0xd'));var fs=require('fs');var _=require(_0xe50f('0xe'));var squel=require(_0xe50f('0xf'));var crypto=require('crypto');var jsforce=require(_0xe50f('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe50f('0xc'));var querystring=require('querystring');var Papa=require(_0xe50f('0x11'));var Redis=require(_0xe50f('0x12'));var authService=require(_0xe50f('0x13'));var qs=require(_0xe50f('0x14'));var as=require(_0xe50f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe50f('0x16'))(_0xe50f('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe50f('0x18'))['db'];function respondWithStatusCode(_0x2d7162,_0x247433){_0x247433=_0x247433||0xcc;return function(_0xd5464e){if(_0xd5464e){return _0x2d7162[_0xe50f('0x19')](_0x247433);}return _0x2d7162['status'](_0x247433)[_0xe50f('0x1a')]();};}function respondWithResult(_0x7de50e,_0x1be77b){_0x1be77b=_0x1be77b||0xc8;return function(_0x31728b){if(_0x31728b){return _0x7de50e['status'](_0x1be77b)[_0xe50f('0x1b')](_0x31728b);}};}function respondWithFilteredResult(_0x3aed23,_0x5b5ab0){return function(_0x34899b){if(_0x34899b){var _0x402666=_0x34899b[_0xe50f('0x1c')],_0x27e240=_0x5b5ab0[_0xe50f('0x1d')],_0xee24d3=_0x5b5ab0[_0xe50f('0x1d')]+_0x5b5ab0[_0xe50f('0x1e')],_0x291598;if(_0xee24d3>=_0x402666){_0xee24d3=_0x402666;_0x291598=0xc8;}else{_0x291598=0xce;}_0x3aed23['status'](_0x291598);return _0x3aed23['set'](_0xe50f('0x1f'),_0x27e240+'-'+_0xee24d3+'/'+_0x402666)[_0xe50f('0x1b')](_0x34899b);}return null;};}function patchUpdates(_0x598fef){return function(_0x408637){try{jsonpatch['apply'](_0x408637,_0x598fef,!![]);}catch(_0x5777b1){return BPromise[_0xe50f('0x20')](_0x5777b1);}return _0x408637[_0xe50f('0x21')]();};}function saveUpdates(_0x95e631,_0x40be7a){return function(_0x8c94c9){if(_0x8c94c9){return _0x8c94c9[_0xe50f('0x22')](_0x95e631)['then'](function(_0x28e180){return _0x28e180;});}return null;};}function removeEntity(_0x4beaca,_0x41b00e){return function(_0x36e678){if(_0x36e678){return _0x36e678[_0xe50f('0x23')]()[_0xe50f('0x24')](function(){_0x4beaca[_0xe50f('0x25')](0xcc)[_0xe50f('0x1a')]();});}};}function handleEntityNotFound(_0x331fd9,_0x4d9f15){return function(_0xa01752){if(!_0xa01752){_0x331fd9[_0xe50f('0x19')](0x194);}return _0xa01752;};}function handleError(_0x29ef64,_0x1aaf6b){_0x1aaf6b=_0x1aaf6b||0x1f4;return function(_0x11a45d){logger[_0xe50f('0x26')](_0x11a45d[_0xe50f('0x27')]);if(_0x11a45d[_0xe50f('0x28')]){delete _0x11a45d['name'];}_0x29ef64['status'](_0x1aaf6b)['send'](_0x11a45d);};}exports[_0xe50f('0x29')]=function(_0x5e9d55,_0x3ff6b2){var _0x15de08={},_0x151be4={},_0x5ad769={'count':0x0,'rows':[]};var _0x565e6e=_[_0xe50f('0x2a')](db[_0xe50f('0x2b')][_0xe50f('0x2c')],function(_0x2abbb6){return{'name':_0x2abbb6[_0xe50f('0x2d')],'type':_0x2abbb6['type'][_0xe50f('0x2e')]};});_0x151be4[_0xe50f('0x2f')]=_[_0xe50f('0x2a')](_0x565e6e,_0xe50f('0x28'));_0x151be4['query']=_[_0xe50f('0x30')](_0x5e9d55[_0xe50f('0x31')]);_0x151be4[_0xe50f('0x32')]=_[_0xe50f('0x33')](_0x151be4[_0xe50f('0x2f')],_0x151be4[_0xe50f('0x31')]);_0x15de08[_0xe50f('0x34')]=_['intersection'](_0x151be4['model'],qs[_0xe50f('0x35')](_0x5e9d55[_0xe50f('0x31')]['fields']));_0x15de08[_0xe50f('0x34')]=_0x15de08[_0xe50f('0x34')][_0xe50f('0x36')]?_0x15de08['attributes']:_0x151be4[_0xe50f('0x2f')];if(!_0x5e9d55['query'][_0xe50f('0x37')](_0xe50f('0x38'))){_0x15de08['limit']=qs[_0xe50f('0x1e')](_0x5e9d55[_0xe50f('0x31')][_0xe50f('0x1e')]);_0x15de08[_0xe50f('0x1d')]=qs[_0xe50f('0x1d')](_0x5e9d55[_0xe50f('0x31')][_0xe50f('0x1d')]);}_0x15de08[_0xe50f('0x39')]=qs['sort'](_0x5e9d55['query'][_0xe50f('0x3a')]);_0x15de08[_0xe50f('0x3b')]=qs[_0xe50f('0x32')](_[_0xe50f('0x3c')](_0x5e9d55['query'],_0x151be4[_0xe50f('0x32')]),_0x565e6e);if(_0x5e9d55[_0xe50f('0x31')][_0xe50f('0x3d')]){_0x15de08[_0xe50f('0x3b')]=_['merge'](_0x15de08[_0xe50f('0x3b')],{'$or':_['map'](_0x565e6e,function(_0x2cda6a){if(_0x2cda6a[_0xe50f('0x3e')]!==_0xe50f('0x3f')){var _0x5a66f8={};_0x5a66f8[_0x2cda6a[_0xe50f('0x28')]]={'$like':'%'+_0x5e9d55[_0xe50f('0x31')]['filter']+'%'};return _0x5a66f8;}})});}_0x15de08=_['merge']({},_0x15de08,_0x5e9d55['options']);var _0x31ac7f={'where':_0x15de08[_0xe50f('0x3b')]};return db[_0xe50f('0x2b')][_0xe50f('0x1c')](_0x31ac7f)[_0xe50f('0x24')](function(_0xce9a43){_0x5ad769[_0xe50f('0x1c')]=_0xce9a43;if(_0x5e9d55[_0xe50f('0x31')][_0xe50f('0x40')]){_0x15de08[_0xe50f('0x41')]=[{'all':!![]}];}return db[_0xe50f('0x2b')][_0xe50f('0x42')](_0x15de08);})[_0xe50f('0x24')](function(_0x1a649c){_0x5ad769[_0xe50f('0x43')]=_0x1a649c;return _0x5ad769;})[_0xe50f('0x24')](respondWithFilteredResult(_0x3ff6b2,_0x15de08))[_0xe50f('0x44')](handleError(_0x3ff6b2,null));};exports[_0xe50f('0x45')]=function(_0x386ed0,_0x51689d){var _0x3acd2f={'raw':![],'where':{'id':_0x386ed0[_0xe50f('0x46')]['id']}},_0x5de02b={};_0x5de02b[_0xe50f('0x2f')]=_[_0xe50f('0x30')](db[_0xe50f('0x2b')][_0xe50f('0x2c')]);_0x5de02b['query']=_['keys'](_0x386ed0[_0xe50f('0x31')]);_0x5de02b[_0xe50f('0x32')]=_[_0xe50f('0x33')](_0x5de02b[_0xe50f('0x2f')],_0x5de02b[_0xe50f('0x31')]);_0x3acd2f[_0xe50f('0x34')]=_['intersection'](_0x5de02b['model'],qs[_0xe50f('0x35')](_0x386ed0[_0xe50f('0x31')][_0xe50f('0x35')]));_0x3acd2f[_0xe50f('0x34')]=_0x3acd2f['attributes'][_0xe50f('0x36')]?_0x3acd2f[_0xe50f('0x34')]:_0x5de02b[_0xe50f('0x2f')];if(_0x386ed0[_0xe50f('0x31')]['includeAll']){_0x3acd2f[_0xe50f('0x41')]=[{'all':!![]}];}_0x3acd2f=_[_0xe50f('0x47')]({},_0x3acd2f,_0x386ed0['options']);return db[_0xe50f('0x2b')][_0xe50f('0x48')](_0x3acd2f)[_0xe50f('0x24')](handleEntityNotFound(_0x51689d,null))['then'](respondWithResult(_0x51689d,null))[_0xe50f('0x44')](handleError(_0x51689d,null));};exports[_0xe50f('0x49')]=function(_0x18fb83,_0x255795){return db['UserProfileSection'][_0xe50f('0x49')](_0x18fb83[_0xe50f('0x4a')],{})['then'](respondWithResult(_0x255795,0xc9))['catch'](handleError(_0x255795,null));};exports[_0xe50f('0x22')]=function(_0x2a9f54,_0xc9a633){if(_0x2a9f54[_0xe50f('0x4a')]['id']){delete _0x2a9f54[_0xe50f('0x4a')]['id'];}return db[_0xe50f('0x2b')][_0xe50f('0x48')]({'where':{'id':_0x2a9f54[_0xe50f('0x46')]['id']}})[_0xe50f('0x24')](handleEntityNotFound(_0xc9a633,null))[_0xe50f('0x24')](saveUpdates(_0x2a9f54['body'],null))[_0xe50f('0x24')](respondWithResult(_0xc9a633,null))['catch'](handleError(_0xc9a633,null));};exports[_0xe50f('0x23')]=function(_0x5a10dd,_0x177669){return db[_0xe50f('0x2b')][_0xe50f('0x48')]({'where':{'id':_0x5a10dd['params']['id']}})['then'](handleEntityNotFound(_0x177669,null))[_0xe50f('0x24')](removeEntity(_0x177669,null))['catch'](handleError(_0x177669,null));};exports['describe']=function(_0x23f22e,_0x4374e7){return db[_0xe50f('0x2b')][_0xe50f('0x4b')]()[_0xe50f('0x24')](respondWithResult(_0x4374e7,null))[_0xe50f('0x44')](handleError(_0x4374e7,null));}; \ No newline at end of file +var _0xd200=['../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','destroy','then','error','stack','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xae9024,_0x17f58e){var _0x23e7d3=function(_0x5911fb){while(--_0x5911fb){_0xae9024['push'](_0xae9024['shift']());}};_0x23e7d3(++_0x17f58e);}(_0xd200,0x7d));var _0x0d20=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xd200[_0x2d7f0e];return _0x110b07;};'use strict';var pdf=require(_0x0d20('0x0'));var emlformat=require(_0x0d20('0x1'));var rimraf=require(_0x0d20('0x2'));var zipdir=require(_0x0d20('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d20('0x4'));var moment=require(_0x0d20('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0d20('0x6'));var util=require('util');var path=require(_0x0d20('0x7'));var sox=require(_0x0d20('0x8'));var csv=require(_0x0d20('0x9'));var ejs=require(_0x0d20('0xa'));var fs=require('fs');var _=require(_0x0d20('0xb'));var squel=require(_0x0d20('0xc'));var crypto=require('crypto');var jsforce=require(_0x0d20('0xd'));var deskjs=require(_0x0d20('0xe'));var toCsv=require(_0x0d20('0x9'));var querystring=require(_0x0d20('0xf'));var Papa=require(_0x0d20('0x10'));var Redis=require(_0x0d20('0x11'));var authService=require(_0x0d20('0x12'));var qs=require(_0x0d20('0x13'));var as=require(_0x0d20('0x14'));var hardwareService=require(_0x0d20('0x15'));var logger=require(_0x0d20('0x16'))(_0x0d20('0x17'));var utils=require(_0x0d20('0x18'));var config=require(_0x0d20('0x19'));var db=require(_0x0d20('0x1a'))['db'];function respondWithStatusCode(_0x294b9c,_0xfccf55){_0xfccf55=_0xfccf55||0xcc;return function(_0x3c45c4){if(_0x3c45c4){return _0x294b9c[_0x0d20('0x1b')](_0xfccf55);}return _0x294b9c[_0x0d20('0x1c')](_0xfccf55)[_0x0d20('0x1d')]();};}function respondWithResult(_0xf41aae,_0x597447){_0x597447=_0x597447||0xc8;return function(_0x28076c){if(_0x28076c){return _0xf41aae['status'](_0x597447)[_0x0d20('0x1e')](_0x28076c);}};}function respondWithFilteredResult(_0x467e2a,_0x54e1f4){return function(_0x4e4127){if(_0x4e4127){var _0x35fdaf=_0x4e4127[_0x0d20('0x1f')],_0x579b0d=_0x54e1f4[_0x0d20('0x20')],_0x33bbd1=_0x54e1f4[_0x0d20('0x20')]+_0x54e1f4['limit'],_0x45da8d;if(_0x33bbd1>=_0x35fdaf){_0x33bbd1=_0x35fdaf;_0x45da8d=0xc8;}else{_0x45da8d=0xce;}_0x467e2a['status'](_0x45da8d);return _0x467e2a[_0x0d20('0x21')]('Content-Range',_0x579b0d+'-'+_0x33bbd1+'/'+_0x35fdaf)['json'](_0x4e4127);}return null;};}function patchUpdates(_0x542aeb){return function(_0x2dd718){try{jsonpatch[_0x0d20('0x22')](_0x2dd718,_0x542aeb,!![]);}catch(_0x55c4ba){return BPromise['reject'](_0x55c4ba);}return _0x2dd718['save']();};}function saveUpdates(_0x326ce2,_0x33e8f5){return function(_0x5e1bf5){if(_0x5e1bf5){return _0x5e1bf5['update'](_0x326ce2)['then'](function(_0x5e73bf){return _0x5e73bf;});}return null;};}function removeEntity(_0x29eb1a,_0x194842){return function(_0x38f1c4){if(_0x38f1c4){return _0x38f1c4[_0x0d20('0x23')]()[_0x0d20('0x24')](function(){_0x29eb1a[_0x0d20('0x1c')](0xcc)[_0x0d20('0x1d')]();});}};}function handleEntityNotFound(_0x4c673a,_0x522b46){return function(_0xe4c24b){if(!_0xe4c24b){_0x4c673a[_0x0d20('0x1b')](0x194);}return _0xe4c24b;};}function handleError(_0xc45c08,_0x11f524){_0x11f524=_0x11f524||0x1f4;return function(_0x4e5562){logger[_0x0d20('0x25')](_0x4e5562[_0x0d20('0x26')]);if(_0x4e5562[_0x0d20('0x27')]){delete _0x4e5562['name'];}_0xc45c08[_0x0d20('0x1c')](_0x11f524)['send'](_0x4e5562);};}exports[_0x0d20('0x28')]=function(_0x565ec3,_0x2a9cc9){var _0x570add={},_0x257e88={},_0xc822e0={'count':0x0,'rows':[]};var _0xa55046=_[_0x0d20('0x29')](db[_0x0d20('0x2a')][_0x0d20('0x2b')],function(_0x1d9138){return{'name':_0x1d9138[_0x0d20('0x2c')],'type':_0x1d9138[_0x0d20('0x2d')][_0x0d20('0x2e')]};});_0x257e88[_0x0d20('0x2f')]=_['map'](_0xa55046,_0x0d20('0x27'));_0x257e88[_0x0d20('0x30')]=_[_0x0d20('0x31')](_0x565ec3[_0x0d20('0x30')]);_0x257e88['filters']=_[_0x0d20('0x32')](_0x257e88['model'],_0x257e88[_0x0d20('0x30')]);_0x570add[_0x0d20('0x33')]=_[_0x0d20('0x32')](_0x257e88[_0x0d20('0x2f')],qs[_0x0d20('0x34')](_0x565ec3['query'][_0x0d20('0x34')]));_0x570add[_0x0d20('0x33')]=_0x570add[_0x0d20('0x33')][_0x0d20('0x35')]?_0x570add[_0x0d20('0x33')]:_0x257e88[_0x0d20('0x2f')];if(!_0x565ec3[_0x0d20('0x30')][_0x0d20('0x36')](_0x0d20('0x37'))){_0x570add[_0x0d20('0x38')]=qs[_0x0d20('0x38')](_0x565ec3[_0x0d20('0x30')]['limit']);_0x570add['offset']=qs[_0x0d20('0x20')](_0x565ec3[_0x0d20('0x30')][_0x0d20('0x20')]);}_0x570add['order']=qs['sort'](_0x565ec3['query']['sort']);_0x570add['where']=qs[_0x0d20('0x39')](_['pick'](_0x565ec3['query'],_0x257e88[_0x0d20('0x39')]),_0xa55046);if(_0x565ec3[_0x0d20('0x30')][_0x0d20('0x3a')]){_0x570add[_0x0d20('0x3b')]=_[_0x0d20('0x3c')](_0x570add[_0x0d20('0x3b')],{'$or':_['map'](_0xa55046,function(_0x51c662){if(_0x51c662[_0x0d20('0x2d')]!==_0x0d20('0x3d')){var _0x3a5c25={};_0x3a5c25[_0x51c662['name']]={'$like':'%'+_0x565ec3[_0x0d20('0x30')][_0x0d20('0x3a')]+'%'};return _0x3a5c25;}})});}_0x570add=_[_0x0d20('0x3c')]({},_0x570add,_0x565ec3[_0x0d20('0x3e')]);var _0x409571={'where':_0x570add['where']};return db[_0x0d20('0x2a')][_0x0d20('0x1f')](_0x409571)[_0x0d20('0x24')](function(_0x5f5280){_0xc822e0[_0x0d20('0x1f')]=_0x5f5280;if(_0x565ec3['query'][_0x0d20('0x3f')]){_0x570add[_0x0d20('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0x0d20('0x41')](_0x570add);})['then'](function(_0x4a159a){_0xc822e0[_0x0d20('0x42')]=_0x4a159a;return _0xc822e0;})['then'](respondWithFilteredResult(_0x2a9cc9,_0x570add))[_0x0d20('0x43')](handleError(_0x2a9cc9,null));};exports[_0x0d20('0x44')]=function(_0x5c9cb7,_0x222c6c){var _0x10fea6={'raw':![],'where':{'id':_0x5c9cb7[_0x0d20('0x45')]['id']}},_0x4f3dc5={};_0x4f3dc5[_0x0d20('0x2f')]=_[_0x0d20('0x31')](db['UserProfileSection'][_0x0d20('0x2b')]);_0x4f3dc5[_0x0d20('0x30')]=_[_0x0d20('0x31')](_0x5c9cb7[_0x0d20('0x30')]);_0x4f3dc5[_0x0d20('0x39')]=_[_0x0d20('0x32')](_0x4f3dc5[_0x0d20('0x2f')],_0x4f3dc5[_0x0d20('0x30')]);_0x10fea6[_0x0d20('0x33')]=_['intersection'](_0x4f3dc5[_0x0d20('0x2f')],qs[_0x0d20('0x34')](_0x5c9cb7['query'][_0x0d20('0x34')]));_0x10fea6['attributes']=_0x10fea6[_0x0d20('0x33')][_0x0d20('0x35')]?_0x10fea6[_0x0d20('0x33')]:_0x4f3dc5['model'];if(_0x5c9cb7[_0x0d20('0x30')][_0x0d20('0x3f')]){_0x10fea6['include']=[{'all':!![]}];}_0x10fea6=_[_0x0d20('0x3c')]({},_0x10fea6,_0x5c9cb7[_0x0d20('0x3e')]);return db[_0x0d20('0x2a')][_0x0d20('0x46')](_0x10fea6)[_0x0d20('0x24')](handleEntityNotFound(_0x222c6c,null))['then'](respondWithResult(_0x222c6c,null))[_0x0d20('0x43')](handleError(_0x222c6c,null));};exports[_0x0d20('0x47')]=function(_0xe37d6b,_0x24a80c){return db[_0x0d20('0x2a')][_0x0d20('0x47')](_0xe37d6b[_0x0d20('0x48')],{})[_0x0d20('0x24')](respondWithResult(_0x24a80c,0xc9))[_0x0d20('0x43')](handleError(_0x24a80c,null));};exports[_0x0d20('0x49')]=function(_0x105936,_0x4fd697){if(_0x105936['body']['id']){delete _0x105936[_0x0d20('0x48')]['id'];}return db[_0x0d20('0x2a')][_0x0d20('0x46')]({'where':{'id':_0x105936[_0x0d20('0x45')]['id']}})[_0x0d20('0x24')](handleEntityNotFound(_0x4fd697,null))['then'](saveUpdates(_0x105936[_0x0d20('0x48')],null))['then'](respondWithResult(_0x4fd697,null))[_0x0d20('0x43')](handleError(_0x4fd697,null));};exports[_0x0d20('0x23')]=function(_0x519d3e,_0x3c6f6a){return db[_0x0d20('0x2a')]['find']({'where':{'id':_0x519d3e[_0x0d20('0x45')]['id']}})[_0x0d20('0x24')](handleEntityNotFound(_0x3c6f6a,null))[_0x0d20('0x24')](removeEntity(_0x3c6f6a,null))[_0x0d20('0x43')](handleError(_0x3c6f6a,null));};exports[_0x0d20('0x4a')]=function(_0x14c8a2,_0x458328){return db['UserProfileSection'][_0x0d20('0x4a')]()['then'](respondWithResult(_0x458328,null))[_0x0d20('0x43')](handleError(_0x458328,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ad88778..ed4a235 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 _0x4248=['api','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util'];(function(_0x317144,_0x3eece0){var _0x49c923=function(_0x1e254b){while(--_0x1e254b){_0x317144['push'](_0x317144['shift']());}};_0x49c923(++_0x3eece0);}(_0x4248,0x76));var _0x8424=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x4248[_0x2e0ffa];return _0x24d627;};'use strict';var _=require(_0x8424('0x0'));var util=require(_0x8424('0x1'));var logger=require('../../config/logger')(_0x8424('0x2'));var moment=require(_0x8424('0x3'));var BPromise=require(_0x8424('0x4'));var rp=require(_0x8424('0x5'));var fs=require('fs');var path=require(_0x8424('0x6'));var rimraf=require(_0x8424('0x7'));var config=require('../../config/environment');var attributes=require(_0x8424('0x8'));module[_0x8424('0x9')]=function(_0x45d378,_0x92f7e0){return _0x45d378[_0x8424('0xa')]('UserProfileSection',attributes,{'tableName':_0x8424('0xb'),'paranoid':![],'indexes':[{'name':_0x8424('0xc'),'fields':[_0x8424('0xd'),_0x8424('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f30=['moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','util','../../config/logger'];(function(_0x16adf0,_0x393b27){var _0xa14ae4=function(_0x5b1aa0){while(--_0x5b1aa0){_0x16adf0['push'](_0x16adf0['shift']());}};_0xa14ae4(++_0x393b27);}(_0x5f30,0x1eb));var _0x05f3=function(_0x59dcb6,_0x5ce72e){_0x59dcb6=_0x59dcb6-0x0;var _0x47d643=_0x5f30[_0x59dcb6];return _0x47d643;};'use strict';var _=require(_0x05f3('0x0'));var util=require(_0x05f3('0x1'));var logger=require(_0x05f3('0x2'))('api');var moment=require(_0x05f3('0x3'));var BPromise=require(_0x05f3('0x4'));var rp=require(_0x05f3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x05f3('0x6'));var config=require(_0x05f3('0x7'));var attributes=require(_0x05f3('0x8'));module['exports']=function(_0x324e03,_0x544cf2){return _0x324e03['define'](_0x05f3('0x9'),attributes,{'tableName':_0x05f3('0xa'),'paranoid':![],'indexes':[{'name':_0x05f3('0xb'),'fields':['sectionId',_0x05f3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index cc07c10..c34f553 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 _0xcf8d=['request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xcf8d,0x6b));var _0xdcf8=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xcf8d[_0xe15270];return _0x1e813b;};'use strict';var _=require(_0xdcf8('0x0'));var util=require(_0xdcf8('0x1'));var moment=require(_0xdcf8('0x2'));var BPromise=require(_0xdcf8('0x3'));var rs=require(_0xdcf8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcf8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdcf8('0x6'));var config=require('../../config/environment');var jayson=require(_0xdcf8('0x7'));var client=jayson[_0xdcf8('0x8')][_0xdcf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x512f0d,_0x416d8d,_0x54e5dc){return new BPromise(function(_0x45de7a,_0x4bf6db){return client[_0xdcf8('0xa')](_0x512f0d,_0x54e5dc)['then'](function(_0x5b39b0){logger[_0xdcf8('0xb')](_0xdcf8('0xc'),_0x416d8d,_0xdcf8('0xd'));logger[_0xdcf8('0xe')](_0xdcf8('0xf'),_0x416d8d,_0xdcf8('0xd'),JSON['stringify'](_0x5b39b0));if(_0x5b39b0[_0xdcf8('0x10')]){if(_0x5b39b0['error']['code']===0x1f4){logger[_0xdcf8('0x10')](_0xdcf8('0xc'),_0x416d8d,_0x5b39b0[_0xdcf8('0x10')]['message']);return _0x4bf6db(_0x5b39b0[_0xdcf8('0x10')][_0xdcf8('0x11')]);}logger['error'](_0xdcf8('0xc'),_0x416d8d,_0x5b39b0[_0xdcf8('0x10')]['message']);return _0x45de7a(_0x5b39b0[_0xdcf8('0x10')][_0xdcf8('0x11')]);}else{logger[_0xdcf8('0xb')](_0xdcf8('0xc'),_0x416d8d,'request\x20sent');_0x45de7a(_0x5b39b0[_0xdcf8('0x12')][_0xdcf8('0x11')]);}})[_0xdcf8('0x13')](function(_0x298750){logger[_0xdcf8('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x416d8d,_0x298750);_0x4bf6db(_0x298750);});});} \ No newline at end of file +var _0xd8f3=['debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0xd8f3,0xc4));var _0x3d8f=function(_0xb18520,_0x86cc57){_0xb18520=_0xb18520-0x0;var _0x260f4d=_0xd8f3[_0xb18520];return _0x260f4d;};'use strict';var _=require(_0x3d8f('0x0'));var util=require(_0x3d8f('0x1'));var moment=require(_0x3d8f('0x2'));var BPromise=require(_0x3d8f('0x3'));var rs=require(_0x3d8f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d8f('0x5'));var logger=require(_0x3d8f('0x6'))(_0x3d8f('0x7'));var config=require(_0x3d8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3d8f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bd6b2,_0x567bc6,_0x2c98a0){return new BPromise(function(_0x2be605,_0x157b64){return client['request'](_0x1bd6b2,_0x2c98a0)[_0x3d8f('0xa')](function(_0x1e4c32){logger[_0x3d8f('0xb')](_0x3d8f('0xc'),_0x567bc6,_0x3d8f('0xd'));logger[_0x3d8f('0xe')](_0x3d8f('0xf'),_0x567bc6,'request\x20sent',JSON[_0x3d8f('0x10')](_0x1e4c32));if(_0x1e4c32[_0x3d8f('0x11')]){if(_0x1e4c32['error']['code']===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x567bc6,_0x1e4c32[_0x3d8f('0x11')]['message']);return _0x157b64(_0x1e4c32[_0x3d8f('0x11')][_0x3d8f('0x12')]);}logger[_0x3d8f('0x11')](_0x3d8f('0xc'),_0x567bc6,_0x1e4c32[_0x3d8f('0x11')][_0x3d8f('0x12')]);return _0x2be605(_0x1e4c32[_0x3d8f('0x11')]['message']);}else{logger[_0x3d8f('0xb')]('UserProfileSection,\x20%s,\x20%s',_0x567bc6,_0x3d8f('0xd'));_0x2be605(_0x1e4c32[_0x3d8f('0x13')][_0x3d8f('0x12')]);}})[_0x3d8f('0x14')](function(_0x28e7e6){logger[_0x3d8f('0x11')](_0x3d8f('0xc'),_0x567bc6,_0x28e7e6);_0x157b64(_0x28e7e6);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0a63965..13c4e0b 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 _0x14ae=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1c4ded,_0x3e3087){var _0x11bada=function(_0x4d3679){while(--_0x4d3679){_0x1c4ded['push'](_0x1c4ded['shift']());}};_0x11bada(++_0x3e3087);}(_0x14ae,0x1b0));var _0xe14a=function(_0x1ebed1,_0x14d027){_0x1ebed1=_0x1ebed1-0x0;var _0x39bfc9=_0x14ae[_0x1ebed1];return _0x39bfc9;};'use strict';var multer=require(_0xe14a('0x0'));var util=require(_0xe14a('0x1'));var path=require('path');var timeout=require(_0xe14a('0x2'));var express=require(_0xe14a('0x3'));var router=express[_0xe14a('0x4')]();var auth=require(_0xe14a('0x5'));var interaction=require(_0xe14a('0x6'));var config=require('../../config/environment');module[_0xe14a('0x7')]=router; \ No newline at end of file +var _0xbffc=['../../config/environment','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3a804e,_0x108e9b){var _0x335529=function(_0xebf6d1){while(--_0xebf6d1){_0x3a804e['push'](_0x3a804e['shift']());}};_0x335529(++_0x108e9b);}(_0xbffc,0x172));var _0xcbff=function(_0xfa2f9b,_0x230c4f){_0xfa2f9b=_0xfa2f9b-0x0;var _0x2d007c=_0xbffc[_0xfa2f9b];return _0x2d007c;};'use strict';var multer=require('multer');var util=require(_0xcbff('0x0'));var path=require(_0xcbff('0x1'));var timeout=require(_0xcbff('0x2'));var express=require(_0xcbff('0x3'));var router=express[_0xcbff('0x4')]();var auth=require(_0xcbff('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcbff('0x6'));module[_0xcbff('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 bb1767b..d3f034e 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x1ddd1a,_0x4e71ca){var _0x19e246=function(_0x58cc2f){while(--_0x58cc2f){_0x1ddd1a['push'](_0x1ddd1a['shift']());}};_0x19e246(++_0x4e71ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_0x406948,_0xad6754){var _0x506eb5=function(_0xfbfa9a){while(--_0xfbfa9a){_0x406948['push'](_0x406948['shift']());}};_0x506eb5(++_0xad6754);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 12e65c6..ff8df2a 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 _0x7117=['api','bluebird','request-promise','rimraf','./userSmsQueue.attributes','exports','lodash','util','../../config/logger'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0x7117,0x1ec));var _0x7711=function(_0x171cb0,_0x169596){_0x171cb0=_0x171cb0-0x0;var _0x121a84=_0x7117[_0x171cb0];return _0x121a84;};'use strict';var _=require(_0x7711('0x0'));var util=require(_0x7711('0x1'));var logger=require(_0x7711('0x2'))(_0x7711('0x3'));var moment=require('moment');var BPromise=require(_0x7711('0x4'));var rp=require(_0x7711('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7711('0x6'));var config=require('../../config/environment');var attributes=require(_0x7711('0x7'));module[_0x7711('0x8')]=function(_0x414dcc,_0x5ca3dc){return _0x414dcc['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc961=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x20b741,_0xf30bc5){var _0x2f75bd=function(_0x5963cc){while(--_0x5963cc){_0x20b741['push'](_0x20b741['shift']());}};_0x2f75bd(++_0xf30bc5);}(_0xc961,0x17a));var _0x1c96=function(_0x494fa2,_0x84b5d8){_0x494fa2=_0x494fa2-0x0;var _0xf013c7=_0xc961[_0x494fa2];return _0xf013c7;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var logger=require(_0x1c96('0x2'))(_0x1c96('0x3'));var moment=require(_0x1c96('0x4'));var BPromise=require(_0x1c96('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1c96('0x6'));var attributes=require('./userSmsQueue.attributes');module[_0x1c96('0x7')]=function(_0x5594ee,_0x19d78b){return _0x5594ee[_0x1c96('0x8')](_0x1c96('0x9'),attributes,{'tableName':_0x1c96('0xa'),'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 8ebf4be..c3fa241 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 _0x16bc=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x303c30,_0x16edcb){var _0x43161b=function(_0x3330ff){while(--_0x3330ff){_0x303c30['push'](_0x303c30['shift']());}};_0x43161b(++_0x16edcb);}(_0x16bc,0x19c));var _0xc16b=function(_0x2c54d9,_0x1dd408){_0x2c54d9=_0x2c54d9-0x0;var _0x44035b=_0x16bc[_0x2c54d9];return _0x44035b;};'use strict';var _=require(_0xc16b('0x0'));var util=require(_0xc16b('0x1'));var moment=require(_0xc16b('0x2'));var BPromise=require(_0xc16b('0x3'));var rs=require(_0xc16b('0x4'));var fs=require('fs');var Redis=require(_0xc16b('0x5'));var db=require(_0xc16b('0x6'))['db'];var utils=require(_0xc16b('0x7'));var logger=require(_0xc16b('0x8'))('rpc');var config=require(_0xc16b('0x9'));var jayson=require(_0xc16b('0xa'));var client=jayson[_0xc16b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x69c892,_0x10b625,_0x2cf615){return new BPromise(function(_0x2ec940,_0x4d9542){return client['request'](_0x69c892,_0x2cf615)[_0xc16b('0xc')](function(_0x59c281){logger['info'](_0xc16b('0xd'),_0x10b625,_0xc16b('0xe'));logger[_0xc16b('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x10b625,_0xc16b('0xe'),JSON[_0xc16b('0x10')](_0x59c281));if(_0x59c281['error']){if(_0x59c281[_0xc16b('0x11')][_0xc16b('0x12')]===0x1f4){logger['error'](_0xc16b('0xd'),_0x10b625,_0x59c281[_0xc16b('0x11')][_0xc16b('0x13')]);return _0x4d9542(_0x59c281['error'][_0xc16b('0x13')]);}logger[_0xc16b('0x11')](_0xc16b('0xd'),_0x10b625,_0x59c281[_0xc16b('0x11')][_0xc16b('0x13')]);return _0x2ec940(_0x59c281[_0xc16b('0x11')][_0xc16b('0x13')]);}else{logger[_0xc16b('0x14')](_0xc16b('0xd'),_0x10b625,_0xc16b('0xe'));_0x2ec940(_0x59c281[_0xc16b('0x15')][_0xc16b('0x13')]);}})[_0xc16b('0x16')](function(_0x3a634d){logger[_0xc16b('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x10b625,_0x3a634d);_0x4d9542(_0x3a634d);});});} \ No newline at end of file +var _0x373b=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x355775,_0x125dc7){var _0x28b602=function(_0x3faf49){while(--_0x3faf49){_0x355775['push'](_0x355775['shift']());}};_0x28b602(++_0x125dc7);}(_0x373b,0x1e5));var _0xb373=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x373b[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xb373('0x0'));var util=require(_0xb373('0x1'));var moment=require(_0xb373('0x2'));var BPromise=require(_0xb373('0x3'));var rs=require(_0xb373('0x4'));var fs=require('fs');var Redis=require(_0xb373('0x5'));var db=require(_0xb373('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb373('0x7'))(_0xb373('0x8'));var config=require(_0xb373('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb373('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4628c7,_0x48f5e5,_0xf4c680){return new BPromise(function(_0x56478f,_0xd5de5b){return client['request'](_0x4628c7,_0xf4c680)[_0xb373('0xb')](function(_0x1df541){logger[_0xb373('0xc')](_0xb373('0xd'),_0x48f5e5,_0xb373('0xe'));logger[_0xb373('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x48f5e5,_0xb373('0xe'),JSON['stringify'](_0x1df541));if(_0x1df541[_0xb373('0x10')]){if(_0x1df541['error'][_0xb373('0x11')]===0x1f4){logger['error'](_0xb373('0xd'),_0x48f5e5,_0x1df541[_0xb373('0x10')]['message']);return _0xd5de5b(_0x1df541['error']['message']);}logger[_0xb373('0x10')](_0xb373('0xd'),_0x48f5e5,_0x1df541[_0xb373('0x10')][_0xb373('0x12')]);return _0x56478f(_0x1df541[_0xb373('0x10')]['message']);}else{logger[_0xb373('0xc')](_0xb373('0xd'),_0x48f5e5,_0xb373('0xe'));_0x56478f(_0x1df541[_0xb373('0x13')][_0xb373('0x12')]);}})[_0xb373('0x14')](function(_0x58d770){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x48f5e5,_0x58d770);_0xd5de5b(_0x58d770);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 5a623c1..eb7951b 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 _0xd968=['util','../../components/auth/service','../../config/environment','exports'];(function(_0x13b5e4,_0x321d09){var _0x9f4d36=function(_0x105309){while(--_0x105309){_0x13b5e4['push'](_0x13b5e4['shift']());}};_0x9f4d36(++_0x321d09);}(_0xd968,0xfc));var _0x8d96=function(_0x23a5e3,_0x2f5d99){_0x23a5e3=_0x23a5e3-0x0;var _0x30851c=_0xd968[_0x23a5e3];return _0x30851c;};'use strict';var multer=require('multer');var util=require(_0x8d96('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x8d96('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x8d96('0x2'));module[_0x8d96('0x3')]=router; \ No newline at end of file +var _0x6560=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util','path'];(function(_0xb5b7f4,_0x590772){var _0x123237=function(_0x1b8718){while(--_0x1b8718){_0xb5b7f4['push'](_0xb5b7f4['shift']());}};_0x123237(++_0x590772);}(_0x6560,0x162));var _0x0656=function(_0x3e98b7,_0x3f93e0){_0x3e98b7=_0x3e98b7-0x0;var _0x2fbd43=_0x6560[_0x3e98b7];return _0x2fbd43;};'use strict';var multer=require(_0x0656('0x0'));var util=require(_0x0656('0x1'));var path=require(_0x0656('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0656('0x3')]();var auth=require(_0x0656('0x4'));var interaction=require(_0x0656('0x5'));var config=require(_0x0656('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d67d93d..4dcf942 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x53c08e,_0x3f4c07){var _0x3d73ac=function(_0x1aa020){while(--_0x1aa020){_0x53c08e['push'](_0x53c08e['shift']());}};_0x3d73ac(++_0x3f4c07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x137f1a,_0x2887df){var _0x439923=function(_0x3d3075){while(--_0x3d3075){_0x137f1a['push'](_0x137f1a['shift']());}};_0x439923(++_0x2887df);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 3db4231..994f62e 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 _0x6275=['exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0x6275,0x10c));var _0x5627=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x6275[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x5627('0x0'));var util=require(_0x5627('0x1'));var logger=require('../../config/logger')(_0x5627('0x2'));var moment=require('moment');var BPromise=require(_0x5627('0x3'));var rp=require(_0x5627('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5627('0x5'));var config=require(_0x5627('0x6'));var attributes=require(_0x5627('0x7'));module[_0x5627('0x8')]=function(_0x904f6e,_0x11c014){return _0x904f6e[_0x5627('0x9')](_0x5627('0xa'),attributes,{'tableName':_0x5627('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57b9=['moment','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api'];(function(_0x2d6944,_0x332a0f){var _0x51b198=function(_0x14ad2f){while(--_0x14ad2f){_0x2d6944['push'](_0x2d6944['shift']());}};_0x51b198(++_0x332a0f);}(_0x57b9,0x15b));var _0x957b=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x57b9[_0x172747];return _0x509692;};'use strict';var _=require(_0x957b('0x0'));var util=require(_0x957b('0x1'));var logger=require(_0x957b('0x2'))(_0x957b('0x3'));var moment=require(_0x957b('0x4'));var BPromise=require('bluebird');var rp=require(_0x957b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x957b('0x6'));var config=require(_0x957b('0x7'));var attributes=require(_0x957b('0x8'));module[_0x957b('0x9')]=function(_0x3f4149,_0x18ee57){return _0x3f4149[_0x957b('0xa')](_0x957b('0xb'),attributes,{'tableName':_0x957b('0xc'),'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 d7f683c..7502bc1 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 _0xa997=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util'];(function(_0xfd30fc,_0x5e2dc9){var _0x12089a=function(_0x5a0c38){while(--_0x5a0c38){_0xfd30fc['push'](_0xfd30fc['shift']());}};_0x12089a(++_0x5e2dc9);}(_0xa997,0x166));var _0x7a99=function(_0x30121e,_0x240c86){_0x30121e=_0x30121e-0x0;var _0x4ba328=_0xa997[_0x30121e];return _0x4ba328;};'use strict';var _=require(_0x7a99('0x0'));var util=require(_0x7a99('0x1'));var moment=require(_0x7a99('0x2'));var BPromise=require(_0x7a99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a99('0x4'));var db=require(_0x7a99('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a99('0x6'))(_0x7a99('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a99('0x8')][_0x7a99('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x148618,_0x142ccb,_0x2d77db){return new BPromise(function(_0x11b82a,_0xf42e0f){return client[_0x7a99('0xa')](_0x148618,_0x2d77db)[_0x7a99('0xb')](function(_0x4de298){logger[_0x7a99('0xc')](_0x7a99('0xd'),_0x142ccb,_0x7a99('0xe'));logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x142ccb,_0x7a99('0xe'),JSON[_0x7a99('0xf')](_0x4de298));if(_0x4de298[_0x7a99('0x10')]){if(_0x4de298[_0x7a99('0x10')][_0x7a99('0x11')]===0x1f4){logger[_0x7a99('0x10')](_0x7a99('0xd'),_0x142ccb,_0x4de298[_0x7a99('0x10')][_0x7a99('0x12')]);return _0xf42e0f(_0x4de298[_0x7a99('0x10')]['message']);}logger[_0x7a99('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x142ccb,_0x4de298[_0x7a99('0x10')][_0x7a99('0x12')]);return _0x11b82a(_0x4de298[_0x7a99('0x10')][_0x7a99('0x12')]);}else{logger[_0x7a99('0xc')](_0x7a99('0xd'),_0x142ccb,_0x7a99('0xe'));_0x11b82a(_0x4de298['result']['message']);}})[_0x7a99('0x13')](function(_0x297f7d){logger[_0x7a99('0x10')](_0x7a99('0xd'),_0x142ccb,_0x297f7d);_0xf42e0f(_0x297f7d);});});} \ No newline at end of file +var _0x9da6=['stringify','error','message','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1abd7d,_0x17e2d8){var _0x5923c6=function(_0x3df741){while(--_0x3df741){_0x1abd7d['push'](_0x1abd7d['shift']());}};_0x5923c6(++_0x17e2d8);}(_0x9da6,0xa6));var _0x69da=function(_0x59146b,_0x22b05c){_0x59146b=_0x59146b-0x0;var _0x5b1af8=_0x9da6[_0x59146b];return _0x5b1af8;};'use strict';var _=require('lodash');var util=require(_0x69da('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69da('0x1'))['db'];var utils=require(_0x69da('0x2'));var logger=require(_0x69da('0x3'))(_0x69da('0x4'));var config=require('../../config/environment');var jayson=require(_0x69da('0x5'));var client=jayson[_0x69da('0x6')][_0x69da('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x126d33,_0x22d1fb,_0x5b2325){return new BPromise(function(_0xd27f05,_0x405163){return client['request'](_0x126d33,_0x5b2325)[_0x69da('0x8')](function(_0x4365da){logger[_0x69da('0x9')](_0x69da('0xa'),_0x22d1fb,_0x69da('0xb'));logger[_0x69da('0xc')](_0x69da('0xd'),_0x22d1fb,'request\x20sent',JSON[_0x69da('0xe')](_0x4365da));if(_0x4365da['error']){if(_0x4365da['error']['code']===0x1f4){logger[_0x69da('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x22d1fb,_0x4365da[_0x69da('0xf')][_0x69da('0x10')]);return _0x405163(_0x4365da[_0x69da('0xf')][_0x69da('0x10')]);}logger[_0x69da('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0x22d1fb,_0x4365da[_0x69da('0xf')]['message']);return _0xd27f05(_0x4365da['error']['message']);}else{logger[_0x69da('0x9')](_0x69da('0xa'),_0x22d1fb,'request\x20sent');_0xd27f05(_0x4365da['result'][_0x69da('0x10')]);}})[_0x69da('0x11')](function(_0x339823){logger[_0x69da('0xf')](_0x69da('0xa'),_0x22d1fb,_0x339823);_0x405163(_0x339823);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3b69718..e3b11fe 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 _0xeb2f=['../../components/interaction/service','../../config/environment','exports','multer','connect-timeout','express','../../components/auth/service'];(function(_0x3ac4f2,_0x57c011){var _0x4d22fd=function(_0x5baab3){while(--_0x5baab3){_0x3ac4f2['push'](_0x3ac4f2['shift']());}};_0x4d22fd(++_0x57c011);}(_0xeb2f,0x1d8));var _0xfeb2=function(_0xac12b,_0x3f0dfa){_0xac12b=_0xac12b-0x0;var _0x5d1fd3=_0xeb2f[_0xac12b];return _0x5d1fd3;};'use strict';var multer=require(_0xfeb2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfeb2('0x1'));var express=require(_0xfeb2('0x2'));var router=express['Router']();var auth=require(_0xfeb2('0x3'));var interaction=require(_0xfeb2('0x4'));var config=require(_0xfeb2('0x5'));module[_0xfeb2('0x6')]=router; \ No newline at end of file +var _0x56ab=['../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x56ab,0x174));var _0xb56a=function(_0x577ce4,_0x4964b3){_0x577ce4=_0x577ce4-0x0;var _0x1eac2a=_0x56ab[_0x577ce4];return _0x1eac2a;};'use strict';var multer=require('multer');var util=require(_0xb56a('0x0'));var path=require(_0xb56a('0x1'));var timeout=require(_0xb56a('0x2'));var express=require(_0xb56a('0x3'));var router=express[_0xb56a('0x4')]();var auth=require(_0xb56a('0x5'));var interaction=require(_0xb56a('0x6'));var config=require(_0xb56a('0x7'));module[_0xb56a('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 7522cc9..2015940 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 _0xe117=['INTEGER','sequelize','exports','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x173938,_0xdb4f41){var _0x301ca1=function(_0x14df68){while(--_0x14df68){_0x173938['push'](_0x173938['shift']());}};_0x301ca1(++_0xdb4f41);}(_0xe117,0xf1));var _0x7e11=function(_0x433914,_0x53e9b0){_0x433914=_0x433914-0x0;var _0x5b6c42=_0xe117[_0x433914];return _0x5b6c42;};'use strict';var Sequelize=require(_0x7e11('0x0'));module[_0x7e11('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x7e11('0x2')},'membername':{'type':Sequelize[_0x7e11('0x3')],'allowNull':![],'comment':_0x7e11('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7e11('0x3')],'allowNull':![],'unique':_0x7e11('0x4'),'comment':_0x7e11('0x2')},'VoiceQueueId':{'type':Sequelize[_0x7e11('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0x7e11('0x3')],'allowNull':![],'unique':_0x7e11('0x4'),'comment':_0x7e11('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x7e11('0x2')},'paused':{'type':Sequelize[_0x7e11('0x5')](0xb),'defaultValue':0x0,'comment':_0x7e11('0x2')}}; \ No newline at end of file +var _0x32a4=['STRING','Required\x20by\x20Asterisk','INTEGER','queue_interface','sequelize','exports'];(function(_0x3399e5,_0x41b40b){var _0x468821=function(_0x497aa8){while(--_0x497aa8){_0x3399e5['push'](_0x3399e5['shift']());}};_0x468821(++_0x41b40b);}(_0x32a4,0x142));var _0x432a=function(_0x327c69,_0x27e755){_0x327c69=_0x327c69-0x0;var _0x49c1af=_0x32a4[_0x327c69];return _0x49c1af;};'use strict';var Sequelize=require(_0x432a('0x0'));module[_0x432a('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x432a('0x2')],'allowNull':![],'comment':_0x432a('0x3')},'UserId':{'type':Sequelize[_0x432a('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x432a('0x2')],'allowNull':![],'unique':_0x432a('0x5'),'comment':_0x432a('0x3')},'VoiceQueueId':{'type':Sequelize[_0x432a('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x432a('0x2')],'allowNull':![],'unique':_0x432a('0x5'),'comment':_0x432a('0x3')},'penalty':{'type':Sequelize[_0x432a('0x4')](0xb),'defaultValue':0x0,'comment':_0x432a('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index f32de80..3920ec1 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 _0x45ac=['hook','exports','events','UserVoiceQueueRt','save','update','remove','emit','hasOwnProperty'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0x45ac,0x6e));var _0xc45a=function(_0xdd27d1,_0xb6f0da){_0xdd27d1=_0xdd27d1-0x0;var _0x58220e=_0x45ac[_0xdd27d1];return _0x58220e;};'use strict';var EventEmitter=require(_0xc45a('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xc45a('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc45a('0x2'),'afterUpdate':_0xc45a('0x3'),'afterDestroy':_0xc45a('0x4')};function emitEvent(_0x1e5f25){return function(_0x184982,_0x2adcd0,_0xa30e8d){UserVoiceQueueRtEvents[_0xc45a('0x5')](_0x1e5f25+':'+_0x184982['id'],_0x184982);UserVoiceQueueRtEvents['emit'](_0x1e5f25,_0x184982);_0xa30e8d(null);};}for(var e in events){if(events[_0xc45a('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xc45a('0x7')](e,emitEvent(event));}}module[_0xc45a('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xefd5=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x58b169,_0x20dceb){var _0x21c8c1=function(_0x17fb49){while(--_0x17fb49){_0x58b169['push'](_0x58b169['shift']());}};_0x21c8c1(++_0x20dceb);}(_0xefd5,0x11f));var _0x5efd=function(_0x5f1a55,_0x23438b){_0x5f1a55=_0x5f1a55-0x0;var _0x3fc268=_0xefd5[_0x5f1a55];return _0x3fc268;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x5efd('0x0'))['db'][_0x5efd('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5efd('0x2')](0x0);var events={'afterCreate':_0x5efd('0x3'),'afterUpdate':_0x5efd('0x4'),'afterDestroy':_0x5efd('0x5')};function emitEvent(_0xf9b77b){return function(_0x43b5ae,_0x6ed724,_0x1e00bc){UserVoiceQueueRtEvents[_0x5efd('0x6')](_0xf9b77b+':'+_0x43b5ae['id'],_0x43b5ae);UserVoiceQueueRtEvents[_0x5efd('0x6')](_0xf9b77b,_0x43b5ae);_0x1e00bc(null);};}for(var e in events){if(events[_0x5efd('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0x5efd('0x8')](e,emitEvent(event));}}module[_0x5efd('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 8e35491..ca025ae 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 _0x8b98=['define','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1f27cc,_0x26744c){var _0x247aba=function(_0x3bce70){while(--_0x3bce70){_0x1f27cc['push'](_0x1f27cc['shift']());}};_0x247aba(++_0x26744c);}(_0x8b98,0xc8));var _0x88b9=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x8b98[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x88b9('0x0'));var util=require(_0x88b9('0x1'));var logger=require(_0x88b9('0x2'))(_0x88b9('0x3'));var moment=require(_0x88b9('0x4'));var BPromise=require(_0x88b9('0x5'));var rp=require(_0x88b9('0x6'));var fs=require('fs');var path=require(_0x88b9('0x7'));var rimraf=require('rimraf');var config=require(_0x88b9('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x2f3323,_0xd1b5e6){return _0x2f3323[_0x88b9('0x9')](_0x88b9('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6130=['../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x2e282b,_0x385fb9){var _0x280de3=function(_0x198264){while(--_0x198264){_0x2e282b['push'](_0x2e282b['shift']());}};_0x280de3(++_0x385fb9);}(_0x6130,0x65));var _0x0613=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x6130[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x0613('0x0'));var util=require(_0x0613('0x1'));var logger=require(_0x0613('0x2'))('api');var moment=require(_0x0613('0x3'));var BPromise=require(_0x0613('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0613('0x5'));var rimraf=require(_0x0613('0x6'));var config=require(_0x0613('0x7'));var attributes=require(_0x0613('0x8'));module[_0x0613('0x9')]=function(_0x4d7549,_0x1007c0){return _0x4d7549[_0x0613('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x0613('0xb'),'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 ca7262c..8abca08 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 _0x3a69=['raw','COUNT','sequelize','outboundQueuePauses','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options'];(function(_0x62b463,_0x246300){var _0x33dd22=function(_0x4581ea){while(--_0x4581ea){_0x62b463['push'](_0x62b463['shift']());}};_0x33dd22(++_0x246300);}(_0x3a69,0x12c));var _0x93a6=function(_0x47d5c0,_0x5123f6){_0x47d5c0=_0x47d5c0-0x0;var _0x469704=_0x3a69[_0x47d5c0];return _0x469704;};'use strict';var _=require('lodash');var util=require(_0x93a6('0x0'));var moment=require(_0x93a6('0x1'));var BPromise=require(_0x93a6('0x2'));var rs=require(_0x93a6('0x3'));var fs=require('fs');var Redis=require(_0x93a6('0x4'));var db=require(_0x93a6('0x5'))['db'];var utils=require(_0x93a6('0x6'));var logger=require(_0x93a6('0x7'))(_0x93a6('0x8'));var config=require(_0x93a6('0x9'));var jayson=require(_0x93a6('0xa'));var client=jayson[_0x93a6('0xb')][_0x93a6('0xc')]({'port':0x232a});config[_0x93a6('0xd')]=_[_0x93a6('0xe')](config[_0x93a6('0xd')],{'host':_0x93a6('0xf'),'port':0x18eb});var socket=require(_0x93a6('0x10'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x93a6('0x11')](socket);function respondWithRpcPromise(_0x3cecb8,_0x25393a,_0x58c8b0){return new BPromise(function(_0x1c4854,_0x52a337){return client[_0x93a6('0x12')](_0x3cecb8,_0x58c8b0)[_0x93a6('0x13')](function(_0x53b140){logger[_0x93a6('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x25393a,_0x93a6('0x15'));logger[_0x93a6('0x16')](_0x93a6('0x17'),_0x25393a,'request\x20sent',JSON['stringify'](_0x53b140));if(_0x53b140[_0x93a6('0x18')]){if(_0x53b140['error'][_0x93a6('0x19')]===0x1f4){logger[_0x93a6('0x18')](_0x93a6('0x1a'),_0x25393a,_0x53b140[_0x93a6('0x18')][_0x93a6('0x1b')]);return _0x52a337(_0x53b140[_0x93a6('0x18')][_0x93a6('0x1b')]);}logger[_0x93a6('0x18')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x25393a,_0x53b140['error'][_0x93a6('0x1b')]);return _0x1c4854(_0x53b140[_0x93a6('0x18')][_0x93a6('0x1b')]);}else{logger[_0x93a6('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x25393a,_0x93a6('0x15'));_0x1c4854(_0x53b140[_0x93a6('0x1c')][_0x93a6('0x1b')]);}})[_0x93a6('0x1d')](function(_0xee868f){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x25393a,_0xee868f);_0x52a337(_0xee868f);});});}exports[_0x93a6('0x1e')]=function(_0x437082){var _0x2a913a=this;return new Promise(function(_0x1132e7,_0x58ba99){return db[_0x93a6('0x1f')]['findAll']({'raw':_0x437082[_0x93a6('0x20')]?_0x437082[_0x93a6('0x20')][_0x93a6('0x21')]===undefined?!![]:![]:!![],'where':_0x437082[_0x93a6('0x20')]?_0x437082[_0x93a6('0x20')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x93a6('0x22'),db['sequelize']['fn']('IF',db[_0x93a6('0x23')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x93a6('0x24')]]})[_0x93a6('0x13')](function(_0x37946b){logger[_0x93a6('0x14')]('GetVoiceQueueRtPauses',_0x437082);logger['debug']('GetVoiceQueueRtPauses',_0x437082,JSON['stringify'](_0x37946b));_0x1132e7(_0x37946b);})['catch'](function(_0x5a39c3){logger[_0x93a6('0x18')](_0x93a6('0x1e'),_0x5a39c3[_0x93a6('0x1b')],_0x437082);_0x58ba99(_0x2a913a[_0x93a6('0x18')](0x1f4,_0x5a39c3[_0x93a6('0x1b')]));});});}; \ No newline at end of file +var _0x56f0=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','randomstring'];(function(_0x4cd685,_0x472697){var _0x37743e=function(_0x238ec8){while(--_0x238ec8){_0x4cd685['push'](_0x4cd685['shift']());}};_0x37743e(++_0x472697);}(_0x56f0,0x1f4));var _0x056f=function(_0x501695,_0xda9d02){_0x501695=_0x501695-0x0;var _0xca4b6c=_0x56f0[_0x501695];return _0xca4b6c;};'use strict';var _=require(_0x056f('0x0'));var util=require(_0x056f('0x1'));var moment=require(_0x056f('0x2'));var BPromise=require('bluebird');var rs=require(_0x056f('0x3'));var fs=require('fs');var Redis=require(_0x056f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x056f('0x5'));var logger=require(_0x056f('0x6'))(_0x056f('0x7'));var config=require('../../config/environment');var jayson=require(_0x056f('0x8'));var client=jayson[_0x056f('0x9')][_0x056f('0xa')]({'port':0x232a});config[_0x056f('0xb')]=_[_0x056f('0xc')](config[_0x056f('0xb')],{'host':_0x056f('0xd'),'port':0x18eb});var socket=require(_0x056f('0xe'))(new Redis(config[_0x056f('0xb')]));require('./userVoiceQueueRt.socket')[_0x056f('0xf')](socket);function respondWithRpcPromise(_0x5d25ae,_0x3ff501,_0x3c4883){return new BPromise(function(_0xe9e7db,_0x5ee3b3){return client['request'](_0x5d25ae,_0x3c4883)[_0x056f('0x10')](function(_0x19257e){logger[_0x056f('0x11')](_0x056f('0x12'),_0x3ff501,_0x056f('0x13'));logger[_0x056f('0x14')](_0x056f('0x15'),_0x3ff501,_0x056f('0x13'),JSON[_0x056f('0x16')](_0x19257e));if(_0x19257e[_0x056f('0x17')]){if(_0x19257e['error']['code']===0x1f4){logger[_0x056f('0x17')](_0x056f('0x12'),_0x3ff501,_0x19257e[_0x056f('0x17')][_0x056f('0x18')]);return _0x5ee3b3(_0x19257e[_0x056f('0x17')][_0x056f('0x18')]);}logger[_0x056f('0x17')](_0x056f('0x12'),_0x3ff501,_0x19257e[_0x056f('0x17')]['message']);return _0xe9e7db(_0x19257e['error'][_0x056f('0x18')]);}else{logger[_0x056f('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ff501,_0x056f('0x13'));_0xe9e7db(_0x19257e[_0x056f('0x19')]['message']);}})['catch'](function(_0x124dfb){logger[_0x056f('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ff501,_0x124dfb);_0x5ee3b3(_0x124dfb);});});}exports[_0x056f('0x1a')]=function(_0x2db333){var _0x4c44b1=this;return new Promise(function(_0x45320e,_0x8ce0d0){return db['UserVoiceQueueRt'][_0x056f('0x1b')]({'raw':_0x2db333[_0x056f('0x1c')]?_0x2db333['options'][_0x056f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2db333['options']?_0x2db333['options'][_0x056f('0x1e')]||null:null,'attributes':[[db[_0x056f('0x1f')]['fn'](_0x056f('0x20'),db[_0x056f('0x1f')]['fn']('IF',db[_0x056f('0x1f')]['literal'](_0x056f('0x21')))),_0x056f('0x22')]]})[_0x056f('0x10')](function(_0x52d600){logger['info'](_0x056f('0x1a'),_0x2db333);logger['debug'](_0x056f('0x1a'),_0x2db333,JSON[_0x056f('0x16')](_0x52d600));_0x45320e(_0x52d600);})[_0x056f('0x23')](function(_0x38fdfb){logger[_0x056f('0x17')](_0x056f('0x1a'),_0x38fdfb[_0x056f('0x18')],_0x2db333);_0x8ce0d0(_0x4c44b1[_0x056f('0x17')](0x1f4,_0x38fdfb['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 029a599..8d87e99 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 _0xf43f=['register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit','removeListener'];(function(_0xa82131,_0x5c57a9){var _0xaf0d12=function(_0x5b044a){while(--_0x5b044a){_0xa82131['push'](_0xa82131['shift']());}};_0xaf0d12(++_0x5c57a9);}(_0xf43f,0x8e));var _0xff43=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf43f[_0x3dd15e];return _0x231fd0;};'use strict';var UserVoiceQueueRtEvents=require(_0xff43('0x0'));var events=[_0xff43('0x1'),_0xff43('0x2'),'update'];function createListener(_0x531768,_0x5a882a){return function(_0x1745c9){_0x5a882a[_0xff43('0x3')](_0x531768,_0x1745c9);};}function removeListener(_0x13abe1,_0xe919bd){return function(){UserVoiceQueueRtEvents[_0xff43('0x4')](_0x13abe1,_0xe919bd);};}exports[_0xff43('0x5')]=function(_0x3ec43a){for(var _0x3cc317=0x0,_0xa94630=events['length'];_0x3cc317<_0xa94630;_0x3cc317++){var _0x1aa795=events[_0x3cc317];var _0x4016fd=createListener(_0xff43('0x6')+_0x1aa795,_0x3ec43a);UserVoiceQueueRtEvents['on'](_0x1aa795,_0x4016fd);}}; \ No newline at end of file +var _0xa1cb=['register','userVoiceQueueRt:','./userVoiceQueueRt.events','emit','removeListener'];(function(_0x392306,_0x539ca2){var _0x2343ec=function(_0x5e1dd4){while(--_0x5e1dd4){_0x392306['push'](_0x392306['shift']());}};_0x2343ec(++_0x539ca2);}(_0xa1cb,0x89));var _0xba1c=function(_0x514b3a,_0x20b75d){_0x514b3a=_0x514b3a-0x0;var _0x36939d=_0xa1cb[_0x514b3a];return _0x36939d;};'use strict';var UserVoiceQueueRtEvents=require(_0xba1c('0x0'));var events=['save','remove','update'];function createListener(_0x3befb9,_0x217c67){return function(_0x38cdfd){_0x217c67[_0xba1c('0x1')](_0x3befb9,_0x38cdfd);};}function removeListener(_0x4326c2,_0x2f72fe){return function(){UserVoiceQueueRtEvents[_0xba1c('0x2')](_0x4326c2,_0x2f72fe);};}exports[_0xba1c('0x3')]=function(_0x4f9970){for(var _0x2a07a2=0x0,_0x1216ff=events['length'];_0x2a07a2<_0x1216ff;_0x2a07a2++){var _0x570b2f=events[_0x2a07a2];var _0x72ed0d=createListener(_0xba1c('0x4')+_0x570b2f,_0x4f9970);UserVoiceQueueRtEvents['on'](_0x570b2f,_0x72ed0d);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 6f596a5..c8f0143 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 _0x285b=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0xc07d2b,_0x1e71e){var _0x31b1ec=function(_0x4331f0){while(--_0x4331f0){_0xc07d2b['push'](_0xc07d2b['shift']());}};_0x31b1ec(++_0x1e71e);}(_0x285b,0xa5));var _0xb285=function(_0x249fa3,_0xdd0af9){_0x249fa3=_0x249fa3-0x0;var _0x5eb304=_0x285b[_0x249fa3];return _0x5eb304;};'use strict';var multer=require(_0xb285('0x0'));var util=require(_0xb285('0x1'));var path=require(_0xb285('0x2'));var timeout=require(_0xb285('0x3'));var express=require(_0xb285('0x4'));var router=express['Router']();var auth=require(_0xb285('0x5'));var interaction=require(_0xb285('0x6'));var config=require(_0xb285('0x7'));module[_0xb285('0x8')]=router; \ No newline at end of file +var _0xbe49=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xbe49,0x1c1));var _0x9be4=function(_0x358d63,_0x21d7c6){_0x358d63=_0x358d63-0x0;var _0x4ef21b=_0xbe49[_0x358d63];return _0x4ef21b;};'use strict';var multer=require('multer');var util=require(_0x9be4('0x0'));var path=require(_0x9be4('0x1'));var timeout=require(_0x9be4('0x2'));var express=require('express');var router=express[_0x9be4('0x3')]();var auth=require(_0x9be4('0x4'));var interaction=require(_0x9be4('0x5'));var config=require(_0x9be4('0x6'));module[_0x9be4('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 2298b1e..bb941b3 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x456e19,_0x56b700){var _0x297a29=function(_0xbe6a66){while(--_0xbe6a66){_0x456e19['push'](_0x456e19['shift']());}};_0x297a29(++_0x56b700);}(_0xe706,0xa3));var _0x6e70=function(_0x495c52,_0x53c0cc){_0x495c52=_0x495c52-0x0;var _0x2b4bb2=_0xe706[_0x495c52];return _0x2b4bb2;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x268a20,_0x33b621){var _0x3bc3eb=function(_0x35def0){while(--_0x35def0){_0x268a20['push'](_0x268a20['shift']());}};_0x3bc3eb(++_0x33b621);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'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 3002907..f3652ce 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 _0x065e=['util','../../config/logger','moment','bluebird','path','rimraf','./userWhatsappQueue.attributes','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x340975,_0x23e15d){var _0x1d0747=function(_0x3072d7){while(--_0x3072d7){_0x340975['push'](_0x340975['shift']());}};_0x1d0747(++_0x23e15d);}(_0x065e,0x1e3));var _0xe065=function(_0x18d168,_0x557b6f){_0x18d168=_0x18d168-0x0;var _0x395a4d=_0x065e[_0x18d168];return _0x395a4d;};'use strict';var _=require(_0xe065('0x0'));var util=require(_0xe065('0x1'));var logger=require(_0xe065('0x2'))('api');var moment=require(_0xe065('0x3'));var BPromise=require(_0xe065('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe065('0x5'));var rimraf=require(_0xe065('0x6'));var config=require('../../config/environment');var attributes=require(_0xe065('0x7'));module['exports']=function(_0x181659,_0x38bfc5){return _0x181659[_0xe065('0x8')](_0xe065('0x9'),attributes,{'tableName':_0xe065('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x935c=['rimraf','../../config/environment','exports','define','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise'];(function(_0xb56fb6,_0x49f7d7){var _0x4e3959=function(_0x3ec629){while(--_0x3ec629){_0xb56fb6['push'](_0xb56fb6['shift']());}};_0x4e3959(++_0x49f7d7);}(_0x935c,0x195));var _0xc935=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x935c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xc935('0x0'));var util=require(_0xc935('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc935('0x2'));var BPromise=require(_0xc935('0x3'));var rp=require(_0xc935('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc935('0x5'));var config=require(_0xc935('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0xc935('0x7')]=function(_0x1a75b3,_0x42ea4c){return _0x1a75b3[_0xc935('0x8')]('UserWhatsappQueue',attributes,{'tableName':_0xc935('0x9'),'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 54b0724..c05a8ea 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(_0xb501aa,_0x261ade){var _0x5140db=function(_0x33a21b){while(--_0x33a21b){_0xb501aa['push'](_0xb501aa['shift']());}};_0x5140db(++_0x261ade);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x16bbea,_0x52f0da){var _0x87dd5f=function(_0x282bf4){while(--_0x282bf4){_0x16bbea['push'](_0x16bbea['shift']());}};_0x87dd5f(++_0x52f0da);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 1e5aedf..4b83218 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 _0xb901=['get','/:id','show','post','create','put','update','delete','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','index'];(function(_0x7d76ba,_0x324abe){var _0x3c8da2=function(_0x5d52ae){while(--_0x5d52ae){_0x7d76ba['push'](_0x7d76ba['shift']());}};_0x3c8da2(++_0x324abe);}(_0xb901,0x168));var _0x1b90=function(_0x5c107d,_0x155dbe){_0x5c107d=_0x5c107d-0x0;var _0x3eaf06=_0xb901[_0x5c107d];return _0x3eaf06;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1b90('0x0'));var express=require(_0x1b90('0x1'));var router=express['Router']();var auth=require(_0x1b90('0x2'));var interaction=require(_0x1b90('0x3'));var config=require(_0x1b90('0x4'));var controller=require(_0x1b90('0x5'));router['get']('/',auth[_0x1b90('0x6')](),controller[_0x1b90('0x7')]);router[_0x1b90('0x8')](_0x1b90('0x9'),auth[_0x1b90('0x6')](),controller[_0x1b90('0xa')]);router[_0x1b90('0xb')]('/',auth[_0x1b90('0x6')](),controller[_0x1b90('0xc')]);router[_0x1b90('0xd')](_0x1b90('0x9'),auth[_0x1b90('0x6')](),controller[_0x1b90('0xe')]);router[_0x1b90('0xf')](_0x1b90('0x9'),auth[_0x1b90('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4565=['../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','create','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5820b5,_0x5b92e2){var _0x3dffcb=function(_0x2854be){while(--_0x2854be){_0x5820b5['push'](_0x5820b5['shift']());}};_0x3dffcb(++_0x5b92e2);}(_0x4565,0x11b));var _0x5456=function(_0x43be21,_0x1a1140){_0x43be21=_0x43be21-0x0;var _0x535370=_0x4565[_0x43be21];return _0x535370;};'use strict';var multer=require(_0x5456('0x0'));var util=require(_0x5456('0x1'));var path=require(_0x5456('0x2'));var timeout=require(_0x5456('0x3'));var express=require(_0x5456('0x4'));var router=express[_0x5456('0x5')]();var auth=require(_0x5456('0x6'));var interaction=require(_0x5456('0x7'));var config=require(_0x5456('0x8'));var controller=require(_0x5456('0x9'));router[_0x5456('0xa')]('/',auth[_0x5456('0xb')](),controller['index']);router[_0x5456('0xa')](_0x5456('0xc'),auth[_0x5456('0xb')](),controller[_0x5456('0xd')]);router['post']('/',auth[_0x5456('0xb')](),controller[_0x5456('0xe')]);router['put']('/:id',auth[_0x5456('0xb')](),controller['update']);router[_0x5456('0xf')](_0x5456('0xc'),auth[_0x5456('0xb')](),controller[_0x5456('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index e73dc83..c48677e 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 _0x52bf=['STRING','sequelize'];(function(_0x2b659b,_0x3d2253){var _0x2075c8=function(_0x28c229){while(--_0x28c229){_0x2b659b['push'](_0x2b659b['shift']());}};_0x2075c8(++_0x3d2253);}(_0x52bf,0xe9));var _0xf52b=function(_0x413019,_0x2bc96b){_0x413019=_0x413019-0x0;var _0xb5490b=_0x52bf[_0x413019];return _0xb5490b;};'use strict';var Sequelize=require(_0xf52b('0x0'));module['exports']={'name':{'type':Sequelize[_0xf52b('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf52b('0x1')]}}; \ No newline at end of file +var _0xde3b=['STRING','name','exports'];(function(_0x3ec9b1,_0x33f663){var _0x5231a4=function(_0x5ccfa7){while(--_0x5ccfa7){_0x3ec9b1['push'](_0x3ec9b1['shift']());}};_0x5231a4(++_0x33f663);}(_0xde3b,0x9e));var _0xbde3=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0xde3b[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require('sequelize');module[_0xbde3('0x0')]={'name':{'type':Sequelize[_0xbde3('0x1')],'unique':_0xbde3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 3de80b5..38e628c 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 _0x3b1b=['sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','then','Variables','UserProfileResource','destroy','stack','name','send','index','map','fieldName','type','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','merge','options','Variable','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x431c26,_0x4b8f47){var _0x3092fd=function(_0x4dca59){while(--_0x4dca59){_0x431c26['push'](_0x431c26['shift']());}};_0x3092fd(++_0x4b8f47);}(_0x3b1b,0x8a));var _0xb3b1=function(_0x2ca05f,_0x2294ec){_0x2ca05f=_0x2ca05f-0x0;var _0xeb4591=_0x3b1b[_0x2ca05f];return _0xeb4591;};'use strict';var pdf=require(_0xb3b1('0x0'));var emlformat=require(_0xb3b1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb3b1('0x2'));var jsonpatch=require(_0xb3b1('0x3'));var rp=require('request-promise');var moment=require(_0xb3b1('0x4'));var BPromise=require(_0xb3b1('0x5'));var Mustache=require('mustache');var util=require(_0xb3b1('0x6'));var path=require(_0xb3b1('0x7'));var sox=require('sox');var csv=require(_0xb3b1('0x8'));var ejs=require(_0xb3b1('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb3b1('0xa'));var crypto=require(_0xb3b1('0xb'));var jsforce=require(_0xb3b1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb3b1('0x8'));var querystring=require(_0xb3b1('0xd'));var Papa=require(_0xb3b1('0xe'));var Redis=require(_0xb3b1('0xf'));var authService=require(_0xb3b1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb3b1('0x11'));var hardwareService=require(_0xb3b1('0x12'));var logger=require(_0xb3b1('0x13'))(_0xb3b1('0x14'));var utils=require(_0xb3b1('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363528,_0x4c434e){_0x4c434e=_0x4c434e||0xcc;return function(_0x2c7024){if(_0x2c7024){return _0x363528[_0xb3b1('0x16')](_0x4c434e);}return _0x363528[_0xb3b1('0x17')](_0x4c434e)[_0xb3b1('0x18')]();};}function respondWithResult(_0x5ab48e,_0x5ca2a2){_0x5ca2a2=_0x5ca2a2||0xc8;return function(_0x19ac73){if(_0x19ac73){return _0x5ab48e[_0xb3b1('0x17')](_0x5ca2a2)['json'](_0x19ac73);}};}function respondWithFilteredResult(_0x57759b,_0x35d25f){return function(_0x557b86){if(_0x557b86){var _0x37bd34=_0x557b86[_0xb3b1('0x19')],_0x5b321a=_0x35d25f[_0xb3b1('0x1a')],_0x375d47=_0x35d25f[_0xb3b1('0x1a')]+_0x35d25f[_0xb3b1('0x1b')],_0xfba4c9;if(_0x375d47>=_0x37bd34){_0x375d47=_0x37bd34;_0xfba4c9=0xc8;}else{_0xfba4c9=0xce;}_0x57759b[_0xb3b1('0x17')](_0xfba4c9);return _0x57759b[_0xb3b1('0x1c')]('Content-Range',_0x5b321a+'-'+_0x375d47+'/'+_0x37bd34)[_0xb3b1('0x1d')](_0x557b86);}return null;};}function patchUpdates(_0x10f174){return function(_0x1817ca){try{jsonpatch[_0xb3b1('0x1e')](_0x1817ca,_0x10f174,!![]);}catch(_0x297829){return BPromise[_0xb3b1('0x1f')](_0x297829);}return _0x1817ca[_0xb3b1('0x20')]();};}function saveUpdates(_0x3b63b4,_0x206732){return function(_0x52a7a9){if(_0x52a7a9){return _0x52a7a9['update'](_0x3b63b4)[_0xb3b1('0x21')](function(_0x4627f8){return _0x4627f8;});}return null;};}function removeEntity(_0x2696e6,_0x277c59){return function(_0x1ae29c){if(_0x1ae29c){return _0x1ae29c['destroy']()[_0xb3b1('0x21')](function(){var _0xc4b91a=_0x1ae29c['get']({'plain':!![]});var _0x22a3b9=_0xb3b1('0x22');return db[_0xb3b1('0x23')][_0xb3b1('0x24')]({'where':{'type':_0x22a3b9,'resourceId':_0xc4b91a['id']}})['then'](function(){return _0x1ae29c;});})[_0xb3b1('0x21')](function(){_0x2696e6[_0xb3b1('0x17')](0xcc)[_0xb3b1('0x18')]();});}};}function handleEntityNotFound(_0x177981,_0x56b936){return function(_0x236adb){if(!_0x236adb){_0x177981[_0xb3b1('0x16')](0x194);}return _0x236adb;};}function handleError(_0x231f3f,_0x3b613a){_0x3b613a=_0x3b613a||0x1f4;return function(_0x4f109a){logger['error'](_0x4f109a[_0xb3b1('0x25')]);if(_0x4f109a[_0xb3b1('0x26')]){delete _0x4f109a[_0xb3b1('0x26')];}_0x231f3f[_0xb3b1('0x17')](_0x3b613a)[_0xb3b1('0x27')](_0x4f109a);};}exports[_0xb3b1('0x28')]=function(_0x4470ee,_0xc1a229){var _0x2cbac1={},_0x4a67d2={},_0x2be37d={'count':0x0,'rows':[]};var _0x487d6e=_[_0xb3b1('0x29')](db['Variable']['rawAttributes'],function(_0x5a2b66){return{'name':_0x5a2b66[_0xb3b1('0x2a')],'type':_0x5a2b66[_0xb3b1('0x2b')]['key']};});_0x4a67d2['model']=_[_0xb3b1('0x29')](_0x487d6e,_0xb3b1('0x26'));_0x4a67d2[_0xb3b1('0x2c')]=_['keys'](_0x4470ee[_0xb3b1('0x2c')]);_0x4a67d2[_0xb3b1('0x2d')]=_['intersection'](_0x4a67d2[_0xb3b1('0x2e')],_0x4a67d2['query']);_0x2cbac1[_0xb3b1('0x2f')]=_[_0xb3b1('0x30')](_0x4a67d2[_0xb3b1('0x2e')],qs['fields'](_0x4470ee[_0xb3b1('0x2c')][_0xb3b1('0x31')]));_0x2cbac1[_0xb3b1('0x2f')]=_0x2cbac1[_0xb3b1('0x2f')][_0xb3b1('0x32')]?_0x2cbac1[_0xb3b1('0x2f')]:_0x4a67d2[_0xb3b1('0x2e')];if(!_0x4470ee['query'][_0xb3b1('0x33')]('nolimit')){_0x2cbac1[_0xb3b1('0x1b')]=qs[_0xb3b1('0x1b')](_0x4470ee[_0xb3b1('0x2c')][_0xb3b1('0x1b')]);_0x2cbac1[_0xb3b1('0x1a')]=qs[_0xb3b1('0x1a')](_0x4470ee['query'][_0xb3b1('0x1a')]);}_0x2cbac1[_0xb3b1('0x34')]=qs[_0xb3b1('0x35')](_0x4470ee[_0xb3b1('0x2c')][_0xb3b1('0x35')]);_0x2cbac1['where']=qs[_0xb3b1('0x2d')](_[_0xb3b1('0x36')](_0x4470ee['query'],_0x4a67d2[_0xb3b1('0x2d')]),_0x487d6e);if(_0x4470ee[_0xb3b1('0x2c')]['filter']){_0x2cbac1[_0xb3b1('0x37')]=_['merge'](_0x2cbac1[_0xb3b1('0x37')],{'$or':_[_0xb3b1('0x29')](_0x487d6e,function(_0x5a2f95){if(_0x5a2f95[_0xb3b1('0x2b')]!==_0xb3b1('0x38')){var _0x524f14={};_0x524f14[_0x5a2f95[_0xb3b1('0x26')]]={'$like':'%'+_0x4470ee[_0xb3b1('0x2c')]['filter']+'%'};return _0x524f14;}})});}_0x2cbac1=_[_0xb3b1('0x39')]({},_0x2cbac1,_0x4470ee[_0xb3b1('0x3a')]);var _0x185634={'where':_0x2cbac1[_0xb3b1('0x37')]};return db[_0xb3b1('0x3b')][_0xb3b1('0x19')](_0x185634)[_0xb3b1('0x21')](function(_0x2505aa){_0x2be37d['count']=_0x2505aa;if(_0x4470ee[_0xb3b1('0x2c')][_0xb3b1('0x3c')]){_0x2cbac1[_0xb3b1('0x3d')]=[{'all':!![]}];}return db[_0xb3b1('0x3b')][_0xb3b1('0x3e')](_0x2cbac1);})[_0xb3b1('0x21')](function(_0x41022e){_0x2be37d[_0xb3b1('0x3f')]=_0x41022e;return _0x2be37d;})[_0xb3b1('0x21')](respondWithFilteredResult(_0xc1a229,_0x2cbac1))[_0xb3b1('0x40')](handleError(_0xc1a229,null));};exports[_0xb3b1('0x41')]=function(_0x2867eb,_0x29fdbc){var _0x4b861c={'raw':!![],'where':{'id':_0x2867eb['params']['id']}},_0x12fb31={};_0x12fb31['model']=_[_0xb3b1('0x42')](db[_0xb3b1('0x3b')][_0xb3b1('0x43')]);_0x12fb31[_0xb3b1('0x2c')]=_[_0xb3b1('0x42')](_0x2867eb[_0xb3b1('0x2c')]);_0x12fb31['filters']=_[_0xb3b1('0x30')](_0x12fb31['model'],_0x12fb31[_0xb3b1('0x2c')]);_0x4b861c[_0xb3b1('0x2f')]=_[_0xb3b1('0x30')](_0x12fb31[_0xb3b1('0x2e')],qs[_0xb3b1('0x31')](_0x2867eb[_0xb3b1('0x2c')][_0xb3b1('0x31')]));_0x4b861c[_0xb3b1('0x2f')]=_0x4b861c['attributes']['length']?_0x4b861c[_0xb3b1('0x2f')]:_0x12fb31[_0xb3b1('0x2e')];if(_0x2867eb['query'][_0xb3b1('0x3c')]){_0x4b861c[_0xb3b1('0x3d')]=[{'all':!![]}];}_0x4b861c=_[_0xb3b1('0x39')]({},_0x4b861c,_0x2867eb[_0xb3b1('0x3a')]);return db['Variable'][_0xb3b1('0x44')](_0x4b861c)['then'](handleEntityNotFound(_0x29fdbc,null))[_0xb3b1('0x21')](respondWithResult(_0x29fdbc,null))[_0xb3b1('0x40')](handleError(_0x29fdbc,null));};exports['create']=function(_0x3b456e,_0x4f619f){return db[_0xb3b1('0x3b')]['create'](_0x3b456e[_0xb3b1('0x45')],{})[_0xb3b1('0x21')](function(_0x5014eb){var _0x88930b=_0x3b456e[_0xb3b1('0x46')]['get']({'plain':!![]});if(!_0x88930b)throw new Error(_0xb3b1('0x47'));if(_0x88930b['role']===_0xb3b1('0x46')){var _0x4cdb2c=_0x5014eb[_0xb3b1('0x48')]({'plain':!![]});var _0x26aba6='Variables';return db['UserProfileSection'][_0xb3b1('0x44')]({'where':{'name':_0x26aba6,'userProfileId':_0x88930b[_0xb3b1('0x49')]},'raw':!![]})['then'](function(_0x3021e0){if(_0x3021e0&&_0x3021e0[_0xb3b1('0x4a')]===0x0){return db['UserProfileResource'][_0xb3b1('0x4b')]({'name':_0x4cdb2c['name'],'resourceId':_0x4cdb2c['id'],'type':_0x3021e0[_0xb3b1('0x26')],'sectionId':_0x3021e0['id']},{})[_0xb3b1('0x21')](function(){return _0x5014eb;});}else{return _0x5014eb;}})[_0xb3b1('0x40')](function(_0x80e1e4){logger[_0xb3b1('0x4c')](_0xb3b1('0x4d'),_0x80e1e4);throw _0x80e1e4;});}return _0x5014eb;})['then'](respondWithResult(_0x4f619f,0xc9))['catch'](handleError(_0x4f619f,null));};exports[_0xb3b1('0x4e')]=function(_0x2c86b3,_0x144164){if(_0x2c86b3[_0xb3b1('0x45')]['id']){delete _0x2c86b3[_0xb3b1('0x45')]['id'];}return db[_0xb3b1('0x3b')][_0xb3b1('0x44')]({'where':{'id':_0x2c86b3[_0xb3b1('0x4f')]['id']}})[_0xb3b1('0x21')](handleEntityNotFound(_0x144164,null))[_0xb3b1('0x21')](saveUpdates(_0x2c86b3[_0xb3b1('0x45')],null))[_0xb3b1('0x21')](respondWithResult(_0x144164,null))[_0xb3b1('0x40')](handleError(_0x144164,null));};exports[_0xb3b1('0x24')]=function(_0x5ab693,_0x517f62){return db[_0xb3b1('0x3b')][_0xb3b1('0x44')]({'where':{'id':_0x5ab693['params']['id']}})[_0xb3b1('0x21')](handleEntityNotFound(_0x517f62,null))[_0xb3b1('0x21')](removeEntity(_0x517f62,null))[_0xb3b1('0x40')](handleError(_0x517f62,null));}; \ No newline at end of file +var _0x4441=['end','json','offset','limit','apply','reject','update','destroy','then','Variables','UserProfileResource','error','stack','name','send','Variable','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','count','findAll','rows','catch','show','params','length','includeAll','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status'];(function(_0x1b9825,_0x425af5){var _0x5297a3=function(_0x14a02e){while(--_0x14a02e){_0x1b9825['push'](_0x1b9825['shift']());}};_0x5297a3(++_0x425af5);}(_0x4441,0xd4));var _0x1444=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4441[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x1444('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1444('0x1'));var zipdir=require(_0x1444('0x2'));var jsonpatch=require(_0x1444('0x3'));var rp=require(_0x1444('0x4'));var moment=require(_0x1444('0x5'));var BPromise=require(_0x1444('0x6'));var Mustache=require(_0x1444('0x7'));var util=require(_0x1444('0x8'));var path=require(_0x1444('0x9'));var sox=require(_0x1444('0xa'));var csv=require(_0x1444('0xb'));var ejs=require(_0x1444('0xc'));var fs=require('fs');var _=require(_0x1444('0xd'));var squel=require(_0x1444('0xe'));var crypto=require(_0x1444('0xf'));var jsforce=require(_0x1444('0x10'));var deskjs=require(_0x1444('0x11'));var toCsv=require(_0x1444('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1444('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1444('0x13'))(_0x1444('0x14'));var utils=require(_0x1444('0x15'));var config=require(_0x1444('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1277c4,_0x3777d2){_0x3777d2=_0x3777d2||0xcc;return function(_0x512483){if(_0x512483){return _0x1277c4[_0x1444('0x17')](_0x3777d2);}return _0x1277c4[_0x1444('0x18')](_0x3777d2)[_0x1444('0x19')]();};}function respondWithResult(_0x49e7f2,_0x562c3d){_0x562c3d=_0x562c3d||0xc8;return function(_0x1c7a3f){if(_0x1c7a3f){return _0x49e7f2['status'](_0x562c3d)[_0x1444('0x1a')](_0x1c7a3f);}};}function respondWithFilteredResult(_0x22c577,_0x1c750b){return function(_0x22f78d){if(_0x22f78d){var _0xd9d26f=_0x22f78d['count'],_0x5ae944=_0x1c750b[_0x1444('0x1b')],_0x1cd988=_0x1c750b[_0x1444('0x1b')]+_0x1c750b[_0x1444('0x1c')],_0x15f775;if(_0x1cd988>=_0xd9d26f){_0x1cd988=_0xd9d26f;_0x15f775=0xc8;}else{_0x15f775=0xce;}_0x22c577[_0x1444('0x18')](_0x15f775);return _0x22c577['set']('Content-Range',_0x5ae944+'-'+_0x1cd988+'/'+_0xd9d26f)[_0x1444('0x1a')](_0x22f78d);}return null;};}function patchUpdates(_0x2fda4c){return function(_0x5e4ef0){try{jsonpatch[_0x1444('0x1d')](_0x5e4ef0,_0x2fda4c,!![]);}catch(_0x3a443f){return BPromise[_0x1444('0x1e')](_0x3a443f);}return _0x5e4ef0['save']();};}function saveUpdates(_0x1941f9,_0x5e4009){return function(_0x154a36){if(_0x154a36){return _0x154a36[_0x1444('0x1f')](_0x1941f9)['then'](function(_0x54768a){return _0x54768a;});}return null;};}function removeEntity(_0x30de1d,_0x1c67d6){return function(_0xb2f9fe){if(_0xb2f9fe){return _0xb2f9fe[_0x1444('0x20')]()[_0x1444('0x21')](function(){var _0x5e5d12=_0xb2f9fe['get']({'plain':!![]});var _0x2dd643=_0x1444('0x22');return db[_0x1444('0x23')]['destroy']({'where':{'type':_0x2dd643,'resourceId':_0x5e5d12['id']}})[_0x1444('0x21')](function(){return _0xb2f9fe;});})[_0x1444('0x21')](function(){_0x30de1d[_0x1444('0x18')](0xcc)[_0x1444('0x19')]();});}};}function handleEntityNotFound(_0x1479fe,_0x34a632){return function(_0x3075fc){if(!_0x3075fc){_0x1479fe[_0x1444('0x17')](0x194);}return _0x3075fc;};}function handleError(_0x893e3a,_0x56cbd7){_0x56cbd7=_0x56cbd7||0x1f4;return function(_0x4737a9){logger[_0x1444('0x24')](_0x4737a9[_0x1444('0x25')]);if(_0x4737a9[_0x1444('0x26')]){delete _0x4737a9[_0x1444('0x26')];}_0x893e3a[_0x1444('0x18')](_0x56cbd7)[_0x1444('0x27')](_0x4737a9);};}exports['index']=function(_0x3d58ec,_0x236509){var _0x223d21={},_0x289d52={},_0x2e2f8d={'count':0x0,'rows':[]};var _0x1b075b=_['map'](db[_0x1444('0x28')][_0x1444('0x29')],function(_0x262aa1){return{'name':_0x262aa1['fieldName'],'type':_0x262aa1[_0x1444('0x2a')][_0x1444('0x2b')]};});_0x289d52[_0x1444('0x2c')]=_[_0x1444('0x2d')](_0x1b075b,_0x1444('0x26'));_0x289d52[_0x1444('0x2e')]=_[_0x1444('0x2f')](_0x3d58ec[_0x1444('0x2e')]);_0x289d52[_0x1444('0x30')]=_[_0x1444('0x31')](_0x289d52[_0x1444('0x2c')],_0x289d52[_0x1444('0x2e')]);_0x223d21[_0x1444('0x32')]=_[_0x1444('0x31')](_0x289d52[_0x1444('0x2c')],qs[_0x1444('0x33')](_0x3d58ec[_0x1444('0x2e')]['fields']));_0x223d21[_0x1444('0x32')]=_0x223d21[_0x1444('0x32')]['length']?_0x223d21[_0x1444('0x32')]:_0x289d52['model'];if(!_0x3d58ec['query'][_0x1444('0x34')]('nolimit')){_0x223d21[_0x1444('0x1c')]=qs['limit'](_0x3d58ec[_0x1444('0x2e')][_0x1444('0x1c')]);_0x223d21[_0x1444('0x1b')]=qs[_0x1444('0x1b')](_0x3d58ec[_0x1444('0x2e')]['offset']);}_0x223d21[_0x1444('0x35')]=qs['sort'](_0x3d58ec[_0x1444('0x2e')][_0x1444('0x36')]);_0x223d21[_0x1444('0x37')]=qs['filters'](_['pick'](_0x3d58ec[_0x1444('0x2e')],_0x289d52[_0x1444('0x30')]),_0x1b075b);if(_0x3d58ec[_0x1444('0x2e')][_0x1444('0x38')]){_0x223d21['where']=_['merge'](_0x223d21[_0x1444('0x37')],{'$or':_[_0x1444('0x2d')](_0x1b075b,function(_0x46b204){if(_0x46b204[_0x1444('0x2a')]!==_0x1444('0x39')){var _0x3f4458={};_0x3f4458[_0x46b204[_0x1444('0x26')]]={'$like':'%'+_0x3d58ec['query'][_0x1444('0x38')]+'%'};return _0x3f4458;}})});}_0x223d21=_[_0x1444('0x3a')]({},_0x223d21,_0x3d58ec[_0x1444('0x3b')]);var _0x32fc51={'where':_0x223d21[_0x1444('0x37')]};return db[_0x1444('0x28')][_0x1444('0x3c')](_0x32fc51)['then'](function(_0x12bdec){_0x2e2f8d['count']=_0x12bdec;if(_0x3d58ec[_0x1444('0x2e')]['includeAll']){_0x223d21['include']=[{'all':!![]}];}return db[_0x1444('0x28')][_0x1444('0x3d')](_0x223d21);})[_0x1444('0x21')](function(_0x2aba70){_0x2e2f8d[_0x1444('0x3e')]=_0x2aba70;return _0x2e2f8d;})[_0x1444('0x21')](respondWithFilteredResult(_0x236509,_0x223d21))[_0x1444('0x3f')](handleError(_0x236509,null));};exports[_0x1444('0x40')]=function(_0x545ac7,_0x262f7e){var _0x649ccb={'raw':!![],'where':{'id':_0x545ac7[_0x1444('0x41')]['id']}},_0x42c8c8={};_0x42c8c8['model']=_[_0x1444('0x2f')](db[_0x1444('0x28')][_0x1444('0x29')]);_0x42c8c8[_0x1444('0x2e')]=_[_0x1444('0x2f')](_0x545ac7['query']);_0x42c8c8['filters']=_[_0x1444('0x31')](_0x42c8c8[_0x1444('0x2c')],_0x42c8c8['query']);_0x649ccb[_0x1444('0x32')]=_[_0x1444('0x31')](_0x42c8c8[_0x1444('0x2c')],qs[_0x1444('0x33')](_0x545ac7['query']['fields']));_0x649ccb[_0x1444('0x32')]=_0x649ccb['attributes'][_0x1444('0x42')]?_0x649ccb['attributes']:_0x42c8c8['model'];if(_0x545ac7['query'][_0x1444('0x43')]){_0x649ccb[_0x1444('0x44')]=[{'all':!![]}];}_0x649ccb=_[_0x1444('0x3a')]({},_0x649ccb,_0x545ac7[_0x1444('0x3b')]);return db[_0x1444('0x28')][_0x1444('0x45')](_0x649ccb)['then'](handleEntityNotFound(_0x262f7e,null))[_0x1444('0x21')](respondWithResult(_0x262f7e,null))[_0x1444('0x3f')](handleError(_0x262f7e,null));};exports[_0x1444('0x46')]=function(_0x138f54,_0x1ba7df){return db[_0x1444('0x28')][_0x1444('0x46')](_0x138f54[_0x1444('0x47')],{})[_0x1444('0x21')](function(_0x5dc63a){var _0x3022e8=_0x138f54[_0x1444('0x48')][_0x1444('0x49')]({'plain':!![]});if(!_0x3022e8)throw new Error(_0x1444('0x4a'));if(_0x3022e8[_0x1444('0x4b')]===_0x1444('0x48')){var _0x11c440=_0x5dc63a[_0x1444('0x49')]({'plain':!![]});var _0x1ba9e9=_0x1444('0x22');return db[_0x1444('0x4c')][_0x1444('0x45')]({'where':{'name':_0x1ba9e9,'userProfileId':_0x3022e8['userProfileId']},'raw':!![]})[_0x1444('0x21')](function(_0x235de9){if(_0x235de9&&_0x235de9[_0x1444('0x4d')]===0x0){return db[_0x1444('0x23')]['create']({'name':_0x11c440[_0x1444('0x26')],'resourceId':_0x11c440['id'],'type':_0x235de9['name'],'sectionId':_0x235de9['id']},{})[_0x1444('0x21')](function(){return _0x5dc63a;});}else{return _0x5dc63a;}})[_0x1444('0x3f')](function(_0xf2aea4){logger[_0x1444('0x24')](_0x1444('0x4e'),_0xf2aea4);throw _0xf2aea4;});}return _0x5dc63a;})[_0x1444('0x21')](respondWithResult(_0x1ba7df,0xc9))[_0x1444('0x3f')](handleError(_0x1ba7df,null));};exports[_0x1444('0x1f')]=function(_0x305627,_0xfad8ce){if(_0x305627[_0x1444('0x47')]['id']){delete _0x305627['body']['id'];}return db[_0x1444('0x28')][_0x1444('0x45')]({'where':{'id':_0x305627[_0x1444('0x41')]['id']}})[_0x1444('0x21')](handleEntityNotFound(_0xfad8ce,null))['then'](saveUpdates(_0x305627[_0x1444('0x47')],null))[_0x1444('0x21')](respondWithResult(_0xfad8ce,null))[_0x1444('0x3f')](handleError(_0xfad8ce,null));};exports[_0x1444('0x20')]=function(_0x1f8482,_0xf3af9c){return db[_0x1444('0x28')][_0x1444('0x45')]({'where':{'id':_0x1f8482[_0x1444('0x41')]['id']}})[_0x1444('0x21')](handleEntityNotFound(_0xf3af9c,null))['then'](removeEntity(_0xf3af9c,null))[_0x1444('0x3f')](handleError(_0xf3af9c,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 4c65dfb..8ecd5d1 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 _0xb9ba=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','Variable','tools_variables','lodash','util'];(function(_0x357702,_0x203968){var _0x4dd94a=function(_0x11bc16){while(--_0x11bc16){_0x357702['push'](_0x357702['shift']());}};_0x4dd94a(++_0x203968);}(_0xb9ba,0x136));var _0xab9b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb9ba[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xab9b('0x0'));var util=require(_0xab9b('0x1'));var logger=require(_0xab9b('0x2'))(_0xab9b('0x3'));var moment=require(_0xab9b('0x4'));var BPromise=require(_0xab9b('0x5'));var rp=require(_0xab9b('0x6'));var fs=require('fs');var path=require(_0xab9b('0x7'));var rimraf=require(_0xab9b('0x8'));var config=require('../../config/environment');var attributes=require(_0xab9b('0x9'));module[_0xab9b('0xa')]=function(_0x74c312,_0x1c6fdc){return _0x74c312['define'](_0xab9b('0xb'),attributes,{'tableName':_0xab9b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0081=['../../config/environment','define','tools_variables','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x3489ee,_0x145bca){var _0x2c7dbc=function(_0x36222c){while(--_0x36222c){_0x3489ee['push'](_0x3489ee['shift']());}};_0x2c7dbc(++_0x145bca);}(_0x0081,0xa3));var _0x1008=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x0081[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x1008('0x0'));var util=require('util');var logger=require(_0x1008('0x1'))(_0x1008('0x2'));var moment=require('moment');var BPromise=require(_0x1008('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1008('0x4'));var config=require(_0x1008('0x5'));var attributes=require('./variable.attributes');module['exports']=function(_0x210207,_0x2aca13){return _0x210207[_0x1008('0x6')]('Variable',attributes,{'tableName':_0x1008('0x7'),'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 145a81a..d89fe40 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 _0x4ef2=['attributes','map','include','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4ef2,0x67));var _0x24ef=function(_0x45f6f2,_0x282bbb){_0x45f6f2=_0x45f6f2-0x0;var _0x57dec5=_0x4ef2[_0x45f6f2];return _0x57dec5;};'use strict';var _=require(_0x24ef('0x0'));var util=require('util');var moment=require(_0x24ef('0x1'));var BPromise=require(_0x24ef('0x2'));var rs=require(_0x24ef('0x3'));var fs=require('fs');var Redis=require(_0x24ef('0x4'));var db=require(_0x24ef('0x5'))['db'];var utils=require(_0x24ef('0x6'));var logger=require(_0x24ef('0x7'))(_0x24ef('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x24ef('0x9')][_0x24ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c1938,_0x1607d8,_0x183d86){return new BPromise(function(_0x2c5aca,_0x2fdf5){return client[_0x24ef('0xb')](_0x1c1938,_0x183d86)[_0x24ef('0xc')](function(_0x2fc3e5){logger[_0x24ef('0xd')](_0x24ef('0xe'),_0x1607d8,_0x24ef('0xf'));logger[_0x24ef('0x10')]('Variable,\x20%s,\x20%s,\x20%s',_0x1607d8,'request\x20sent',JSON[_0x24ef('0x11')](_0x2fc3e5));if(_0x2fc3e5[_0x24ef('0x12')]){if(_0x2fc3e5[_0x24ef('0x12')][_0x24ef('0x13')]===0x1f4){logger[_0x24ef('0x12')](_0x24ef('0xe'),_0x1607d8,_0x2fc3e5[_0x24ef('0x12')][_0x24ef('0x14')]);return _0x2fdf5(_0x2fc3e5[_0x24ef('0x12')][_0x24ef('0x14')]);}logger[_0x24ef('0x12')](_0x24ef('0xe'),_0x1607d8,_0x2fc3e5[_0x24ef('0x12')][_0x24ef('0x14')]);return _0x2c5aca(_0x2fc3e5[_0x24ef('0x12')][_0x24ef('0x14')]);}else{logger[_0x24ef('0xd')](_0x24ef('0xe'),_0x1607d8,_0x24ef('0xf'));_0x2c5aca(_0x2fc3e5[_0x24ef('0x15')][_0x24ef('0x14')]);}})[_0x24ef('0x16')](function(_0x5e7ee1){logger['error'](_0x24ef('0xe'),_0x1607d8,_0x5e7ee1);_0x2fdf5(_0x5e7ee1);});});}exports[_0x24ef('0x17')]=function(_0x1817d8){var _0x533194=this;return new Promise(function(_0xf74ba5,_0x57a553){return db[_0x24ef('0x18')][_0x24ef('0x19')]({'raw':_0x1817d8['options']?_0x1817d8[_0x24ef('0x1a')][_0x24ef('0x1b')]===undefined?!![]:![]:!![],'where':_0x1817d8['options']?_0x1817d8[_0x24ef('0x1a')][_0x24ef('0x1c')]||null:null,'attributes':_0x1817d8[_0x24ef('0x1a')]?_0x1817d8[_0x24ef('0x1a')][_0x24ef('0x1d')]||null:null,'include':_0x1817d8[_0x24ef('0x1a')]?_0x1817d8[_0x24ef('0x1a')]['include']?_[_0x24ef('0x1e')](_0x1817d8[_0x24ef('0x1a')][_0x24ef('0x1f')],function(_0x530822){return{'model':db[_0x530822[_0x24ef('0x20')]],'as':_0x530822['as'],'attributes':_0x530822[_0x24ef('0x1d')],'include':_0x530822[_0x24ef('0x1f')]?_[_0x24ef('0x1e')](_0x530822[_0x24ef('0x1f')],function(_0x1d2623){return{'model':db[_0x1d2623[_0x24ef('0x20')]],'as':_0x1d2623['as'],'attributes':_0x1d2623[_0x24ef('0x1d')],'include':_0x1d2623[_0x24ef('0x1f')]?_[_0x24ef('0x1e')](_0x1d2623['include'],function(_0x4ae145){return{'model':db[_0x4ae145[_0x24ef('0x20')]],'as':_0x4ae145['as'],'attributes':_0x4ae145['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f5066){logger[_0x24ef('0xd')](_0x24ef('0x17'),_0x1817d8);logger[_0x24ef('0x10')](_0x24ef('0x17'),_0x1817d8,JSON[_0x24ef('0x11')](_0x3f5066));_0xf74ba5(_0x3f5066);})[_0x24ef('0x16')](function(_0x3b27d3){logger[_0x24ef('0x12')](_0x24ef('0x17'),_0x3b27d3['message'],_0x1817d8);_0x57a553(_0x533194[_0x24ef('0x12')](0x1f4,_0x3b27d3[_0x24ef('0x14')]));});});}; \ No newline at end of file +var _0xab35=['Variable,\x20%s,\x20%s,\x20%s','stringify','error','Variable,\x20%s,\x20%s','message','catch','Variable','find','options','attributes','include','map','model','ShowVariable','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug'];(function(_0xdafaf2,_0x5100e7){var _0x3c8496=function(_0x106b2e){while(--_0x106b2e){_0xdafaf2['push'](_0xdafaf2['shift']());}};_0x3c8496(++_0x5100e7);}(_0xab35,0xfe));var _0x5ab3=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0xab35[_0x10dbf6];return _0x452147;};'use strict';var _=require(_0x5ab3('0x0'));var util=require(_0x5ab3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5ab3('0x2'));var fs=require('fs');var Redis=require(_0x5ab3('0x3'));var db=require(_0x5ab3('0x4'))['db'];var utils=require(_0x5ab3('0x5'));var logger=require(_0x5ab3('0x6'))(_0x5ab3('0x7'));var config=require(_0x5ab3('0x8'));var jayson=require(_0x5ab3('0x9'));var client=jayson[_0x5ab3('0xa')][_0x5ab3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd80ae3,_0x2b0f93,_0x35bd51){return new BPromise(function(_0x267c16,_0x5de4a6){return client[_0x5ab3('0xc')](_0xd80ae3,_0x35bd51)[_0x5ab3('0xd')](function(_0x12f1b4){logger[_0x5ab3('0xe')]('Variable,\x20%s,\x20%s',_0x2b0f93,'request\x20sent');logger[_0x5ab3('0xf')](_0x5ab3('0x10'),_0x2b0f93,'request\x20sent',JSON[_0x5ab3('0x11')](_0x12f1b4));if(_0x12f1b4[_0x5ab3('0x12')]){if(_0x12f1b4['error']['code']===0x1f4){logger[_0x5ab3('0x12')](_0x5ab3('0x13'),_0x2b0f93,_0x12f1b4['error'][_0x5ab3('0x14')]);return _0x5de4a6(_0x12f1b4[_0x5ab3('0x12')][_0x5ab3('0x14')]);}logger['error'](_0x5ab3('0x13'),_0x2b0f93,_0x12f1b4[_0x5ab3('0x12')]['message']);return _0x267c16(_0x12f1b4[_0x5ab3('0x12')][_0x5ab3('0x14')]);}else{logger[_0x5ab3('0xe')]('Variable,\x20%s,\x20%s',_0x2b0f93,'request\x20sent');_0x267c16(_0x12f1b4['result'][_0x5ab3('0x14')]);}})[_0x5ab3('0x15')](function(_0x452184){logger[_0x5ab3('0x12')](_0x5ab3('0x13'),_0x2b0f93,_0x452184);_0x5de4a6(_0x452184);});});}exports['ShowVariable']=function(_0x1da252){var _0xd08125=this;return new Promise(function(_0x577ed1,_0x41b354){return db[_0x5ab3('0x16')][_0x5ab3('0x17')]({'raw':_0x1da252[_0x5ab3('0x18')]?_0x1da252[_0x5ab3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1da252[_0x5ab3('0x18')]?_0x1da252['options']['where']||null:null,'attributes':_0x1da252[_0x5ab3('0x18')]?_0x1da252['options'][_0x5ab3('0x19')]||null:null,'include':_0x1da252[_0x5ab3('0x18')]?_0x1da252[_0x5ab3('0x18')][_0x5ab3('0x1a')]?_[_0x5ab3('0x1b')](_0x1da252[_0x5ab3('0x18')]['include'],function(_0x239894){return{'model':db[_0x239894[_0x5ab3('0x1c')]],'as':_0x239894['as'],'attributes':_0x239894[_0x5ab3('0x19')],'include':_0x239894[_0x5ab3('0x1a')]?_[_0x5ab3('0x1b')](_0x239894[_0x5ab3('0x1a')],function(_0x1d2ccd){return{'model':db[_0x1d2ccd[_0x5ab3('0x1c')]],'as':_0x1d2ccd['as'],'attributes':_0x1d2ccd['attributes'],'include':_0x1d2ccd[_0x5ab3('0x1a')]?_[_0x5ab3('0x1b')](_0x1d2ccd[_0x5ab3('0x1a')],function(_0x39b284){return{'model':db[_0x39b284[_0x5ab3('0x1c')]],'as':_0x39b284['as'],'attributes':_0x39b284['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14dce6){logger[_0x5ab3('0xe')](_0x5ab3('0x1d'),_0x1da252);logger[_0x5ab3('0xf')](_0x5ab3('0x1d'),_0x1da252,JSON['stringify'](_0x14dce6));_0x577ed1(_0x14dce6);})[_0x5ab3('0x15')](function(_0x41674c){logger['error'](_0x5ab3('0x1d'),_0x41674c[_0x5ab3('0x14')],_0x1da252);_0x41b354(_0xd08125['error'](0x1f4,_0x41674c[_0x5ab3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 632e946..501af39 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 _0x06c4=['exports','express','../../components/auth/service','get','index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/restart','restart','/migrations','migrations'];(function(_0x4c06d6,_0x5d3bf7){var _0x59a049=function(_0x417c1c){while(--_0x417c1c){_0x4c06d6['push'](_0x4c06d6['shift']());}};_0x59a049(++_0x5d3bf7);}(_0x06c4,0x122));var _0x406c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06c4[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x406c('0x0'));var router=express['Router']();var auth=require(_0x406c('0x1'));var controller=require('./version.controller');router[_0x406c('0x2')]('/',controller[_0x406c('0x3')]);router[_0x406c('0x2')](_0x406c('0x4'),auth[_0x406c('0x5')](),auth['canUpdate'](),controller[_0x406c('0x6')]);router[_0x406c('0x2')](_0x406c('0x7'),auth['isAuthenticated'](),auth[_0x406c('0x8')](),controller[_0x406c('0x9')]);router[_0x406c('0x2')](_0x406c('0xa'),auth[_0x406c('0x5')](),auth['canUpdate'](),controller[_0x406c('0xb')]);router[_0x406c('0x2')](_0x406c('0xc'),auth[_0x406c('0x5')](),controller[_0x406c('0xd')]);router['get'](_0x406c('0xe'),controller[_0x406c('0xf')]);module[_0x406c('0x10')]=router; \ No newline at end of file +var _0x1521=['index','/fetch','canUpdate','/reset','isAuthenticated','reset','/pull','pull','/restart','/migrations','migrations','exports','Router','../../components/auth/service','./version.controller','get'];(function(_0x476c5a,_0x822288){var _0x88a8b3=function(_0xad820e){while(--_0xad820e){_0x476c5a['push'](_0x476c5a['shift']());}};_0x88a8b3(++_0x822288);}(_0x1521,0x11c));var _0x1152=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x1521[_0xbd08b4];return _0x314f1e;};'use strict';var express=require('express');var router=express[_0x1152('0x0')]();var auth=require(_0x1152('0x1'));var controller=require(_0x1152('0x2'));router[_0x1152('0x3')]('/',controller[_0x1152('0x4')]);router[_0x1152('0x3')](_0x1152('0x5'),auth['isAuthenticated'](),auth[_0x1152('0x6')](),controller['fetch']);router[_0x1152('0x3')](_0x1152('0x7'),auth[_0x1152('0x8')](),auth['canUpdate'](),controller[_0x1152('0x9')]);router[_0x1152('0x3')](_0x1152('0xa'),auth['isAuthenticated'](),auth[_0x1152('0x6')](),controller[_0x1152('0xb')]);router[_0x1152('0x3')](_0x1152('0xc'),auth[_0x1152('0x8')](),controller['restart']);router[_0x1152('0x3')](_0x1152('0xd'),controller[_0x1152('0xe')]);module[_0x1152('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 2bf6b9f..f4c12a3 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 _0xc177=['info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','index','exports','query','latest','fetch','2.0.0','status','json','master','error'];(function(_0x23b9e0,_0x46e057){var _0x237b2a=function(_0x539335){while(--_0x539335){_0x23b9e0['push'](_0x23b9e0['shift']());}};_0x237b2a(++_0x46e057);}(_0xc177,0x1b2));var _0x7c17=function(_0x2c3172,_0x100310){_0x2c3172=_0x2c3172-0x0;var _0x16f8ce=_0xc177[_0x2c3172];return _0x16f8ce;};'use strict';var Umzug=require(_0x7c17('0x0'));var path=require(_0x7c17('0x1'));var fs=require('fs');var _=require(_0x7c17('0x2'));var pkginfo=require(_0x7c17('0x3'))(module,_0x7c17('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x7c17('0x5'))[_0x7c17('0x6')];var db=require(_0x7c17('0x7'))['db'];var config=require(_0x7c17('0x8'));var pm2=require('../../config/pm2');var logger=require(_0x7c17('0x9'))(_0x7c17('0xa'));var git=require(_0x7c17('0xb'))(config['root']);exports[_0x7c17('0xc')]=function(_0x3aa79e,_0x33dd1e){var _0x3854dd={'current':module[_0x7c17('0xd')][_0x7c17('0x4')],'phonebar':0x2};if(_0x3aa79e[_0x7c17('0xe')]&&_0x3aa79e[_0x7c17('0xe')][_0x7c17('0xf')]){return git[_0x7c17('0x10')]()['tags'](function(_0x5ec150,_0x566cff){_0x3854dd[_0x7c17('0xf')]=(_0x5ec150?module[_0x7c17('0xd')][_0x7c17('0x4')]:_0x566cff['latest'])||_0x7c17('0x11');return _0x33dd1e[_0x7c17('0x12')](0xc8)[_0x7c17('0x13')](_0x3854dd);});}else{return _0x33dd1e['status'](0xc8)['json'](_0x3854dd);}};exports[_0x7c17('0x10')]=function(_0x1220a8,_0x55e7f0){return git[_0x7c17('0x10')](['origin',_0x7c17('0x14')],function(_0x5714b6){if(_0x5714b6){logger[_0x7c17('0x15')](_0x5714b6);return _0x55e7f0[_0x7c17('0x12')](0x1f4)[_0x7c17('0x13')](_0x5714b6);}logger[_0x7c17('0x16')](_0x7c17('0x17'));return _0x55e7f0[_0x7c17('0x12')](0xc8)[_0x7c17('0x13')]({'output':_0x7c17('0x18')});});};exports[_0x7c17('0x19')]=function(_0x2ed3d3,_0x24a25d){return git[_0x7c17('0x19')]([_0x7c17('0x1a'),_0x7c17('0x1b')],function(_0x59ef3d){if(_0x59ef3d){logger[_0x7c17('0x15')](_0x59ef3d);return _0x24a25d[_0x7c17('0x12')](0x1f4)['json'](_0x59ef3d);}logger[_0x7c17('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x24a25d['status'](0xc8)[_0x7c17('0x13')]({'output':_0x7c17('0x1c')});});};exports[_0x7c17('0x1d')]=function(_0x5d5b75,_0x28a24d){exec(_0x7c17('0x1e'),function(_0x59c085,_0x3ad6b9,_0x3d69f6){logger[_0x7c17('0x16')](_0x3ad6b9);logger['info'](_0x3d69f6);if(_0x59c085){logger[_0x7c17('0x15')](_0x59c085);return _0x28a24d[_0x7c17('0x12')](0x1f4)[_0x7c17('0x13')](_0x59c085);}return _0x28a24d['status'](0xc8)[_0x7c17('0x13')]({'output':_0x3ad6b9});});};exports[_0x7c17('0x1f')]=function(_0x50b041,_0x565e05){return pm2[_0x7c17('0x1f')](_0x7c17('0x20'))[_0x7c17('0x21')](function(_0x36b5ed){logger[_0x7c17('0x16')](_0x7c17('0x22'),_0x36b5ed);return _0x565e05['status'](0xc8)[_0x7c17('0x13')]({'output':_0x7c17('0x23')});})[_0x7c17('0x24')](function(_0xf2c46c){logger[_0x7c17('0x15')](_0xf2c46c);return _0x565e05[_0x7c17('0x12')](0x1f4)[_0x7c17('0x13')](_0xf2c46c);});};exports[_0x7c17('0x25')]=function(_0x3a4a58,_0x3a2e61){var _0x4776cc=fs[_0x7c17('0x26')](path[_0x7c17('0x27')](config[_0x7c17('0x28')],_0x7c17('0x29'),_0x7c17('0x25')));var _0x4ea072=[];for(var _0x1378e7=0x0;_0x1378e7<_0x4776cc[_0x7c17('0x2a')];_0x1378e7++){var _0x4dd018=_0x4776cc[_0x1378e7][_0x7c17('0x2b')](_0x7c17('0x2c'),'');if(compareVersions(module[_0x7c17('0xd')]['version'],_0x4dd018)===-0x1){_0x4ea072[_0x7c17('0x2d')](_0x4dd018);}}if(_0x4ea072['length']){var _0x2e0c44=_0x4ea072[_0x7c17('0x2e')](compareVersions);var _0x1a1d70=new Umzug({'storage':_0x7c17('0x2f'),'storageOptions':{'model':db['Migration'],'modelName':_0x7c17('0x30'),'columnName':_0x7c17('0x4')},'migrations':{'params':[db[_0x7c17('0x2f')][_0x7c17('0x31')](),db[_0x7c17('0x2f')][_0x7c17('0x32')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x7c17('0x27')](config[_0x7c17('0x28')],'server',_0x7c17('0x25')),'pattern':/\.js$/}});_0x1a1d70['up']({'migrations':_[_0x7c17('0x33')](_0x2e0c44,function(_0x571c39){return _0x571c39+_0x7c17('0x2c');})})['then'](function(){return _0x3a2e61[_0x7c17('0x12')](0xc8)[_0x7c17('0x13')]({'output':_0x7c17('0x34')+module['exports'][_0x7c17('0x4')]+_0x7c17('0x35')+_[_0x7c17('0x36')](_0x2e0c44),'migrations':_['join'](_0x2e0c44)});})['catch'](function(_0x2f0afb){if(_0x2f0afb instanceof db['sequelize'][_0x7c17('0x37')]){return _0x3a2e61[_0x7c17('0x12')](0xc8)[_0x7c17('0x13')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x3a2e61[_0x7c17('0x12')](0x1f4)[_0x7c17('0x13')](_0x2f0afb);}});}else{return _0x3a2e61[_0x7c17('0x12')](0xc8)[_0x7c17('0x13')]({'output':_0x7c17('0x38')});}}; \ No newline at end of file +var _0x8a21=['../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','.js','push','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','pkginfo','version','compare-versions','../../mysqldb'];(function(_0x449d1f,_0x8b9e56){var _0x4998af=function(_0x1365f3){while(--_0x1365f3){_0x449d1f['push'](_0x449d1f['shift']());}};_0x4998af(++_0x8b9e56);}(_0x8a21,0x1d8));var _0x18a2=function(_0x29d932,_0x97f2a7){_0x29d932=_0x29d932-0x0;var _0x5cd611=_0x8a21[_0x29d932];return _0x5cd611;};'use strict';var Umzug=require(_0x18a2('0x0'));var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x18a2('0x1'))(module,_0x18a2('0x2'));var compareVersions=require(_0x18a2('0x3'));var exec=require('child_process')['exec'];var db=require(_0x18a2('0x4'))['db'];var config=require(_0x18a2('0x5'));var pm2=require(_0x18a2('0x6'));var logger=require(_0x18a2('0x7'))(_0x18a2('0x8'));var git=require(_0x18a2('0x9'))(config[_0x18a2('0xa')]);exports[_0x18a2('0xb')]=function(_0x5d030e,_0x40d23c){var _0x2ed80f={'current':module[_0x18a2('0xc')]['version'],'phonebar':0x2};if(_0x5d030e[_0x18a2('0xd')]&&_0x5d030e[_0x18a2('0xd')][_0x18a2('0xe')]){return git[_0x18a2('0xf')]()[_0x18a2('0x10')](function(_0x54ce08,_0x44c60c){_0x2ed80f[_0x18a2('0xe')]=(_0x54ce08?module['exports'][_0x18a2('0x2')]:_0x44c60c[_0x18a2('0xe')])||'2.0.0';return _0x40d23c[_0x18a2('0x11')](0xc8)[_0x18a2('0x12')](_0x2ed80f);});}else{return _0x40d23c['status'](0xc8)[_0x18a2('0x12')](_0x2ed80f);}};exports[_0x18a2('0xf')]=function(_0xab519a,_0x2d03c0){return git['fetch'](['origin',_0x18a2('0x13')],function(_0x537943){if(_0x537943){logger[_0x18a2('0x14')](_0x537943);return _0x2d03c0['status'](0x1f4)[_0x18a2('0x12')](_0x537943);}logger[_0x18a2('0x15')](_0x18a2('0x16'));return _0x2d03c0['status'](0xc8)[_0x18a2('0x12')]({'output':_0x18a2('0x17')});});};exports[_0x18a2('0x18')]=function(_0xa5894d,_0x22296a){return git['reset']([_0x18a2('0x19'),'FETCH_HEAD'],function(_0x922c0e){if(_0x922c0e){logger['error'](_0x922c0e);return _0x22296a[_0x18a2('0x11')](0x1f4)[_0x18a2('0x12')](_0x922c0e);}logger[_0x18a2('0x15')](_0x18a2('0x1a'));return _0x22296a[_0x18a2('0x11')](0xc8)[_0x18a2('0x12')]({'output':_0x18a2('0x1b')});});};exports[_0x18a2('0x1c')]=function(_0x5f3252,_0x2ac173){exec(_0x18a2('0x1d'),function(_0x3a063a,_0x5c5164,_0x1ed01f){logger[_0x18a2('0x15')](_0x5c5164);logger[_0x18a2('0x15')](_0x1ed01f);if(_0x3a063a){logger[_0x18a2('0x14')](_0x3a063a);return _0x2ac173[_0x18a2('0x11')](0x1f4)['json'](_0x3a063a);}return _0x2ac173['status'](0xc8)['json']({'output':_0x5c5164});});};exports[_0x18a2('0x1e')]=function(_0x1c0da1,_0x55f10c){return pm2[_0x18a2('0x1e')](_0x18a2('0x1f'))['then'](function(_0x4e7003){logger[_0x18a2('0x15')](_0x18a2('0x20'),_0x4e7003);return _0x55f10c[_0x18a2('0x11')](0xc8)[_0x18a2('0x12')]({'output':_0x18a2('0x21')});})[_0x18a2('0x22')](function(_0x3e9543){logger[_0x18a2('0x14')](_0x3e9543);return _0x55f10c[_0x18a2('0x11')](0x1f4)[_0x18a2('0x12')](_0x3e9543);});};exports['migrations']=function(_0x43a4f8,_0x2df574){var _0x490410=fs[_0x18a2('0x23')](path[_0x18a2('0x24')](config[_0x18a2('0xa')],_0x18a2('0x25'),_0x18a2('0x26')));var _0x56b765=[];for(var _0x2bad4c=0x0;_0x2bad4c<_0x490410[_0x18a2('0x27')];_0x2bad4c++){var _0x368fd4=_0x490410[_0x2bad4c][_0x18a2('0x28')](_0x18a2('0x29'),'');if(compareVersions(module['exports'][_0x18a2('0x2')],_0x368fd4)===-0x1){_0x56b765[_0x18a2('0x2a')](_0x368fd4);}}if(_0x56b765[_0x18a2('0x27')]){var _0x11a086=_0x56b765['sort'](compareVersions);var _0x31c583=new Umzug({'storage':_0x18a2('0x2b'),'storageOptions':{'model':db[_0x18a2('0x2c')],'modelName':_0x18a2('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x18a2('0x2b')][_0x18a2('0x2d')](),db[_0x18a2('0x2b')][_0x18a2('0x2e')],function(){throw new Error(_0x18a2('0x2f'));}],'path':path[_0x18a2('0x24')](config['root'],_0x18a2('0x25'),_0x18a2('0x26')),'pattern':/\.js$/}});_0x31c583['up']({'migrations':_[_0x18a2('0x30')](_0x11a086,function(_0x24cd88){return _0x24cd88+_0x18a2('0x29');})})['then'](function(){return _0x2df574[_0x18a2('0x11')](0xc8)['json']({'output':_0x18a2('0x31')+module[_0x18a2('0xc')][_0x18a2('0x2')]+_0x18a2('0x32')+_['last'](_0x11a086),'migrations':_[_0x18a2('0x24')](_0x11a086)});})[_0x18a2('0x22')](function(_0x52ef03){if(_0x52ef03 instanceof db[_0x18a2('0x2b')][_0x18a2('0x33')]){return _0x2df574[_0x18a2('0x11')](0xc8)[_0x18a2('0x12')]({'output':_0x18a2('0x34')});}else{return _0x2df574['status'](0x1f4)[_0x18a2('0x12')](_0x52ef03);}});}else{return _0x2df574[_0x18a2('0x11')](0xc8)[_0x18a2('0x12')]({'output':_0x18a2('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index e642db8..70ec50c 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 _0xc094=['put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create'];(function(_0x4a6045,_0x37294e){var _0x58c2cd=function(_0x3bcd93){while(--_0x3bcd93){_0x4a6045['push'](_0x4a6045['shift']());}};_0x58c2cd(++_0x37294e);}(_0xc094,0x116));var _0x4c09=function(_0xcb8f53,_0x2c310a){_0xcb8f53=_0xcb8f53-0x0;var _0x4ac019=_0xc094[_0xcb8f53];return _0x4ac019;};'use strict';var multer=require('multer');var util=require(_0x4c09('0x0'));var path=require(_0x4c09('0x1'));var timeout=require(_0x4c09('0x2'));var express=require(_0x4c09('0x3'));var router=express[_0x4c09('0x4')]();var auth=require(_0x4c09('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4c09('0x6'));var controller=require(_0x4c09('0x7'));router[_0x4c09('0x8')]('/',auth['isAuthenticated'](),controller[_0x4c09('0x9')]);router['get']('/describe',auth[_0x4c09('0xa')](),controller[_0x4c09('0xb')]);router[_0x4c09('0x8')](_0x4c09('0xc'),auth['isAuthenticated'](),controller[_0x4c09('0xd')]);router[_0x4c09('0xe')]('/',auth[_0x4c09('0xa')](),controller[_0x4c09('0xf')]);router[_0x4c09('0x10')](_0x4c09('0xc'),auth['isAuthenticated'](),controller[_0x4c09('0x11')]);router[_0x4c09('0x12')](_0x4c09('0xc'),auth[_0x4c09('0xa')](),controller[_0x4c09('0x13')]);module[_0x4c09('0x14')]=router; \ No newline at end of file +var _0x7120=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','create','put','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4286ad,_0x5a99ed){var _0x4382d3=function(_0xdc43a8){while(--_0xdc43a8){_0x4286ad['push'](_0x4286ad['shift']());}};_0x4382d3(++_0x5a99ed);}(_0x7120,0x1ce));var _0x0712=function(_0x4b645e,_0x1a09f1){_0x4b645e=_0x4b645e-0x0;var _0x444da3=_0x7120[_0x4b645e];return _0x444da3;};'use strict';var multer=require(_0x0712('0x0'));var util=require(_0x0712('0x1'));var path=require(_0x0712('0x2'));var timeout=require(_0x0712('0x3'));var express=require(_0x0712('0x4'));var router=express[_0x0712('0x5')]();var auth=require(_0x0712('0x6'));var interaction=require(_0x0712('0x7'));var config=require(_0x0712('0x8'));var controller=require('./voiceAgentReport.controller');router[_0x0712('0x9')]('/',auth[_0x0712('0xa')](),controller[_0x0712('0xb')]);router[_0x0712('0x9')]('/describe',auth[_0x0712('0xa')](),controller[_0x0712('0xc')]);router[_0x0712('0x9')](_0x0712('0xd'),auth[_0x0712('0xa')](),controller['show']);router[_0x0712('0xe')]('/',auth[_0x0712('0xa')](),controller[_0x0712('0xf')]);router[_0x0712('0x10')]('/:id',auth[_0x0712('0xa')](),controller['update']);router['delete'](_0x0712('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x0712('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 4ee0b48..390097f 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 _0xeff8=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x3675b3,_0x3b805d){var _0x553b1b=function(_0x524537){while(--_0x524537){_0x3675b3['push'](_0x3675b3['shift']());}};_0x553b1b(++_0x3b805d);}(_0xeff8,0x186));var _0x8eff=function(_0x4bb581,_0x6f7037){_0x4bb581=_0x4bb581-0x0;var _0x316bf5=_0xeff8[_0x4bb581];return _0x316bf5;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8eff('0x2')]},'calleridnum':{'type':Sequelize[_0x8eff('0x2')]},'calleridname':{'type':Sequelize[_0x8eff('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x8eff('0x2')]},'membername':{'type':Sequelize[_0x8eff('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8eff('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8eff('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8eff('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8eff('0x3')]},'holdtime':{'type':Sequelize[_0x8eff('0x4')]},'agentcomplete':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8eff('0x4')]},'agentacw':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8eff('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8eff('0x2')]},'channelstate':{'type':Sequelize[_0x8eff('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8eff('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8eff('0x2')]},'language':{'type':Sequelize[_0x8eff('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8eff('0x2')]},'exten':{'type':Sequelize[_0x8eff('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x8eff('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8eff('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8eff('0x2')]},'destcalleridname':{'type':Sequelize[_0x8eff('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8eff('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8eff('0x2')]},'destaccountcode':{'type':Sequelize[_0x8eff('0x2')]},'destcontext':{'type':Sequelize[_0x8eff('0x2')]},'destexten':{'type':Sequelize[_0x8eff('0x2')]},'destpriority':{'type':Sequelize[_0x8eff('0x2')]},'destuniqueid':{'type':Sequelize[_0x8eff('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8eff('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x8eff('0x2')]},'transfer':{'type':Sequelize[_0x8eff('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8eff('0x2')],'comment':_0x8eff('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8eff('0x2')]},'agententerreason':{'type':Sequelize[_0x8eff('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xda19=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE'];(function(_0xfd3370,_0x200773){var _0x231cc8=function(_0x12b220){while(--_0x12b220){_0xfd3370['push'](_0xfd3370['shift']());}};_0x231cc8(++_0x200773);}(_0xda19,0xd5));var _0x9da1=function(_0x1de5b9,_0xc54801){_0x1de5b9=_0x1de5b9-0x0;var _0x53a4ab=_0xda19[_0x1de5b9];return _0x53a4ab;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'type':{'type':Sequelize[_0x9da1('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9da1('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x9da1('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9da1('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9da1('0x2')]},'agentconnectAt':{'type':Sequelize[_0x9da1('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x9da1('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x9da1('0x2')]},'agentdumpAt':{'type':Sequelize[_0x9da1('0x2')]},'holdtime':{'type':Sequelize[_0x9da1('0x3')]},'agentcomplete':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9da1('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9da1('0x1')]},'channelstate':{'type':Sequelize[_0x9da1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x9da1('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9da1('0x1')]},'connectedlinename':{'type':Sequelize[_0x9da1('0x1')]},'language':{'type':Sequelize[_0x9da1('0x1')]},'accountcode':{'type':Sequelize[_0x9da1('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9da1('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x9da1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x9da1('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9da1('0x1')]},'destcalleridname':{'type':Sequelize[_0x9da1('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x9da1('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x9da1('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9da1('0x1')]},'destuniqueid':{'type':Sequelize[_0x9da1('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x9da1('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x9da1('0x1')]},'transfer':{'type':Sequelize[_0x9da1('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9da1('0x5')},'transferexten':{'type':Sequelize[_0x9da1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9da1('0x1')]},'agententerreason':{'type':Sequelize[_0x9da1('0x3')],'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 1f3646d..2acaa16 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 _0x5b10=['attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','VoiceAgentReport','findAll','rows','catch','show','params','keys','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','rawAttributes','type','key','query','filters','intersection'];(function(_0x1895cb,_0x248c9f){var _0x4ff1a2=function(_0x3e6574){while(--_0x3e6574){_0x1895cb['push'](_0x1895cb['shift']());}};_0x4ff1a2(++_0x248c9f);}(_0x5b10,0xb4));var _0x05b1=function(_0x462458,_0x1d51ff){_0x462458=_0x462458-0x0;var _0x439bb4=_0x5b10[_0x462458];return _0x439bb4;};'use strict';var pdf=require(_0x05b1('0x0'));var emlformat=require(_0x05b1('0x1'));var rimraf=require(_0x05b1('0x2'));var zipdir=require(_0x05b1('0x3'));var jsonpatch=require(_0x05b1('0x4'));var rp=require(_0x05b1('0x5'));var moment=require('moment');var BPromise=require(_0x05b1('0x6'));var Mustache=require(_0x05b1('0x7'));var util=require('util');var path=require(_0x05b1('0x8'));var sox=require(_0x05b1('0x9'));var csv=require(_0x05b1('0xa'));var ejs=require(_0x05b1('0xb'));var fs=require('fs');var _=require(_0x05b1('0xc'));var squel=require(_0x05b1('0xd'));var crypto=require(_0x05b1('0xe'));var jsforce=require(_0x05b1('0xf'));var deskjs=require(_0x05b1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x05b1('0x11'));var Papa=require('papaparse');var Redis=require(_0x05b1('0x12'));var authService=require(_0x05b1('0x13'));var qs=require(_0x05b1('0x14'));var as=require(_0x05b1('0x15'));var hardwareService=require(_0x05b1('0x16'));var logger=require(_0x05b1('0x17'))(_0x05b1('0x18'));var utils=require(_0x05b1('0x19'));var config=require(_0x05b1('0x1a'));var db=require(_0x05b1('0x1b'))['db'];function respondWithStatusCode(_0xd0b624,_0x22ffe3){_0x22ffe3=_0x22ffe3||0xcc;return function(_0x25c1a8){if(_0x25c1a8){return _0xd0b624['sendStatus'](_0x22ffe3);}return _0xd0b624[_0x05b1('0x1c')](_0x22ffe3)[_0x05b1('0x1d')]();};}function respondWithResult(_0x351115,_0x55ebb4){_0x55ebb4=_0x55ebb4||0xc8;return function(_0x4c60d0){if(_0x4c60d0){return _0x351115[_0x05b1('0x1c')](_0x55ebb4)[_0x05b1('0x1e')](_0x4c60d0);}};}function respondWithFilteredResult(_0x5d743c,_0xb7928e){return function(_0x7c6b3c){if(_0x7c6b3c){var _0x5916cf=_0x7c6b3c[_0x05b1('0x1f')],_0xa11365=_0xb7928e[_0x05b1('0x20')],_0x4584e1=_0xb7928e[_0x05b1('0x20')]+_0xb7928e[_0x05b1('0x21')],_0xd81f46;if(_0x4584e1>=_0x5916cf){_0x4584e1=_0x5916cf;_0xd81f46=0xc8;}else{_0xd81f46=0xce;}_0x5d743c['status'](_0xd81f46);return _0x5d743c[_0x05b1('0x22')](_0x05b1('0x23'),_0xa11365+'-'+_0x4584e1+'/'+_0x5916cf)['json'](_0x7c6b3c);}return null;};}function patchUpdates(_0x5cb95a){return function(_0x56d2f5){try{jsonpatch[_0x05b1('0x24')](_0x56d2f5,_0x5cb95a,!![]);}catch(_0x4256b6){return BPromise[_0x05b1('0x25')](_0x4256b6);}return _0x56d2f5[_0x05b1('0x26')]();};}function saveUpdates(_0x2f2e33,_0x5bec9e){return function(_0x52f39e){if(_0x52f39e){return _0x52f39e[_0x05b1('0x27')](_0x2f2e33)[_0x05b1('0x28')](function(_0x4b18f8){return _0x4b18f8;});}return null;};}function removeEntity(_0x2b85f7,_0x42adc4){return function(_0x40891c){if(_0x40891c){return _0x40891c['destroy']()[_0x05b1('0x28')](function(){_0x2b85f7[_0x05b1('0x1c')](0xcc)[_0x05b1('0x1d')]();});}};}function handleEntityNotFound(_0x1464b6,_0x4d9353){return function(_0x337fdd){if(!_0x337fdd){_0x1464b6['sendStatus'](0x194);}return _0x337fdd;};}function handleError(_0x44d47c,_0xa7698e){_0xa7698e=_0xa7698e||0x1f4;return function(_0x538a91){logger[_0x05b1('0x29')](_0x538a91[_0x05b1('0x2a')]);if(_0x538a91[_0x05b1('0x2b')]){delete _0x538a91[_0x05b1('0x2b')];}_0x44d47c['status'](_0xa7698e)['send'](_0x538a91);};}exports['index']=function(_0x4cfb70,_0x3f6220){var _0x1df3d5={},_0x469461={},_0xb2a99c={'count':0x0,'rows':[]};var _0x50a871=_[_0x05b1('0x2c')](db['VoiceAgentReport'][_0x05b1('0x2d')],function(_0x54ff54){return{'name':_0x54ff54['fieldName'],'type':_0x54ff54[_0x05b1('0x2e')][_0x05b1('0x2f')]};});_0x469461['model']=_['map'](_0x50a871,_0x05b1('0x2b'));_0x469461[_0x05b1('0x30')]=_['keys'](_0x4cfb70[_0x05b1('0x30')]);_0x469461[_0x05b1('0x31')]=_[_0x05b1('0x32')](_0x469461['model'],_0x469461[_0x05b1('0x30')]);_0x1df3d5[_0x05b1('0x33')]=_[_0x05b1('0x32')](_0x469461[_0x05b1('0x34')],qs[_0x05b1('0x35')](_0x4cfb70['query'][_0x05b1('0x35')]));_0x1df3d5[_0x05b1('0x33')]=_0x1df3d5[_0x05b1('0x33')][_0x05b1('0x36')]?_0x1df3d5[_0x05b1('0x33')]:_0x469461[_0x05b1('0x34')];if(!_0x4cfb70['query'][_0x05b1('0x37')](_0x05b1('0x38'))){_0x1df3d5[_0x05b1('0x21')]=qs[_0x05b1('0x21')](_0x4cfb70[_0x05b1('0x30')][_0x05b1('0x21')]);_0x1df3d5[_0x05b1('0x20')]=qs['offset'](_0x4cfb70[_0x05b1('0x30')]['offset']);}_0x1df3d5['order']=qs[_0x05b1('0x39')](_0x4cfb70[_0x05b1('0x30')][_0x05b1('0x39')]);_0x1df3d5[_0x05b1('0x3a')]=qs['filters'](_[_0x05b1('0x3b')](_0x4cfb70[_0x05b1('0x30')],_0x469461[_0x05b1('0x31')]),_0x50a871);if(_0x4cfb70[_0x05b1('0x30')]['filter']){_0x1df3d5['where']=_[_0x05b1('0x3c')](_0x1df3d5['where'],{'$or':_[_0x05b1('0x2c')](_0x50a871,function(_0x4ad8b8){if(_0x4ad8b8[_0x05b1('0x2e')]!==_0x05b1('0x3d')){var _0x1ac792={};_0x1ac792[_0x4ad8b8['name']]={'$like':'%'+_0x4cfb70['query']['filter']+'%'};return _0x1ac792;}})});}_0x1df3d5=_[_0x05b1('0x3c')]({},_0x1df3d5,_0x4cfb70[_0x05b1('0x3e')]);var _0x367e20={'where':_0x1df3d5[_0x05b1('0x3a')]};return db['VoiceAgentReport'][_0x05b1('0x1f')](_0x367e20)[_0x05b1('0x28')](function(_0x348396){_0xb2a99c[_0x05b1('0x1f')]=_0x348396;if(_0x4cfb70[_0x05b1('0x30')][_0x05b1('0x3f')]){_0x1df3d5['include']=[{'all':!![]}];}return db[_0x05b1('0x40')][_0x05b1('0x41')](_0x1df3d5);})['then'](function(_0x3e1b69){_0xb2a99c[_0x05b1('0x42')]=_0x3e1b69;return _0xb2a99c;})[_0x05b1('0x28')](respondWithFilteredResult(_0x3f6220,_0x1df3d5))[_0x05b1('0x43')](handleError(_0x3f6220,null));};exports[_0x05b1('0x44')]=function(_0x2c3ddb,_0x1a64ea){var _0x3ad369={'raw':![],'where':{'id':_0x2c3ddb[_0x05b1('0x45')]['id']}},_0xf95515={};_0xf95515[_0x05b1('0x34')]=_[_0x05b1('0x46')](db[_0x05b1('0x40')][_0x05b1('0x2d')]);_0xf95515[_0x05b1('0x30')]=_[_0x05b1('0x46')](_0x2c3ddb[_0x05b1('0x30')]);_0xf95515[_0x05b1('0x31')]=_[_0x05b1('0x32')](_0xf95515['model'],_0xf95515['query']);_0x3ad369[_0x05b1('0x33')]=_['intersection'](_0xf95515['model'],qs[_0x05b1('0x35')](_0x2c3ddb[_0x05b1('0x30')]['fields']));_0x3ad369[_0x05b1('0x33')]=_0x3ad369[_0x05b1('0x33')][_0x05b1('0x36')]?_0x3ad369[_0x05b1('0x33')]:_0xf95515[_0x05b1('0x34')];if(_0x2c3ddb[_0x05b1('0x30')][_0x05b1('0x3f')]){_0x3ad369[_0x05b1('0x47')]=[{'all':!![]}];}_0x3ad369=_[_0x05b1('0x3c')]({},_0x3ad369,_0x2c3ddb[_0x05b1('0x3e')]);return db['VoiceAgentReport'][_0x05b1('0x48')](_0x3ad369)[_0x05b1('0x28')](handleEntityNotFound(_0x1a64ea,null))[_0x05b1('0x28')](respondWithResult(_0x1a64ea,null))[_0x05b1('0x43')](handleError(_0x1a64ea,null));};exports[_0x05b1('0x49')]=function(_0x4fbdf4,_0x3a17ac){return db['VoiceAgentReport'][_0x05b1('0x49')](_0x4fbdf4['body'],{})[_0x05b1('0x28')](respondWithResult(_0x3a17ac,0xc9))[_0x05b1('0x43')](handleError(_0x3a17ac,null));};exports[_0x05b1('0x27')]=function(_0x1fcb69,_0x1999d3){if(_0x1fcb69[_0x05b1('0x4a')]['id']){delete _0x1fcb69[_0x05b1('0x4a')]['id'];}return db[_0x05b1('0x40')]['find']({'where':{'id':_0x1fcb69[_0x05b1('0x45')]['id']}})[_0x05b1('0x28')](handleEntityNotFound(_0x1999d3,null))[_0x05b1('0x28')](saveUpdates(_0x1fcb69['body'],null))[_0x05b1('0x28')](respondWithResult(_0x1999d3,null))[_0x05b1('0x43')](handleError(_0x1999d3,null));};exports[_0x05b1('0x4b')]=function(_0x4e40be,_0x76b476){return db[_0x05b1('0x40')]['find']({'where':{'id':_0x4e40be[_0x05b1('0x45')]['id']}})['then'](handleEntityNotFound(_0x76b476,null))[_0x05b1('0x28')](removeEntity(_0x76b476,null))[_0x05b1('0x43')](handleError(_0x76b476,null));};exports[_0x05b1('0x4c')]=function(_0x11f3f0,_0x1e2153){return db[_0x05b1('0x40')][_0x05b1('0x4c')]()[_0x05b1('0x28')](respondWithResult(_0x1e2153,null))[_0x05b1('0x43')](handleError(_0x1e2153,null));}; \ No newline at end of file +var _0x4292=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','VIRTUAL','filter','merge','options','VoiceAgentReport','includeAll','include','rows','catch','show','find','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x20355f,_0x42f61d){var _0x4372a5=function(_0x3df89e){while(--_0x3df89e){_0x20355f['push'](_0x20355f['shift']());}};_0x4372a5(++_0x42f61d);}(_0x4292,0x1b1));var _0x2429=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0x4292[_0x552fce];return _0x3e27a2;};'use strict';var pdf=require(_0x2429('0x0'));var emlformat=require(_0x2429('0x1'));var rimraf=require(_0x2429('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2429('0x3'));var rp=require(_0x2429('0x4'));var moment=require(_0x2429('0x5'));var BPromise=require(_0x2429('0x6'));var Mustache=require(_0x2429('0x7'));var util=require(_0x2429('0x8'));var path=require(_0x2429('0x9'));var sox=require(_0x2429('0xa'));var csv=require(_0x2429('0xb'));var ejs=require(_0x2429('0xc'));var fs=require('fs');var _=require(_0x2429('0xd'));var squel=require(_0x2429('0xe'));var crypto=require(_0x2429('0xf'));var jsforce=require(_0x2429('0x10'));var deskjs=require(_0x2429('0x11'));var toCsv=require(_0x2429('0xb'));var querystring=require('querystring');var Papa=require(_0x2429('0x12'));var Redis=require(_0x2429('0x13'));var authService=require(_0x2429('0x14'));var qs=require(_0x2429('0x15'));var as=require(_0x2429('0x16'));var hardwareService=require(_0x2429('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x2429('0x18'));var config=require(_0x2429('0x19'));var db=require(_0x2429('0x1a'))['db'];function respondWithStatusCode(_0x2ed4df,_0x879685){_0x879685=_0x879685||0xcc;return function(_0x456988){if(_0x456988){return _0x2ed4df[_0x2429('0x1b')](_0x879685);}return _0x2ed4df[_0x2429('0x1c')](_0x879685)[_0x2429('0x1d')]();};}function respondWithResult(_0x253939,_0x146f69){_0x146f69=_0x146f69||0xc8;return function(_0x3cb437){if(_0x3cb437){return _0x253939['status'](_0x146f69)[_0x2429('0x1e')](_0x3cb437);}};}function respondWithFilteredResult(_0x32ed55,_0x2db614){return function(_0x2075f2){if(_0x2075f2){var _0x420b55=_0x2075f2[_0x2429('0x1f')],_0x5343c2=_0x2db614[_0x2429('0x20')],_0xfcc5c3=_0x2db614[_0x2429('0x20')]+_0x2db614[_0x2429('0x21')],_0x15e3cd;if(_0xfcc5c3>=_0x420b55){_0xfcc5c3=_0x420b55;_0x15e3cd=0xc8;}else{_0x15e3cd=0xce;}_0x32ed55[_0x2429('0x1c')](_0x15e3cd);return _0x32ed55['set'](_0x2429('0x22'),_0x5343c2+'-'+_0xfcc5c3+'/'+_0x420b55)[_0x2429('0x1e')](_0x2075f2);}return null;};}function patchUpdates(_0x324f55){return function(_0x576de1){try{jsonpatch[_0x2429('0x23')](_0x576de1,_0x324f55,!![]);}catch(_0x422008){return BPromise[_0x2429('0x24')](_0x422008);}return _0x576de1[_0x2429('0x25')]();};}function saveUpdates(_0x56335a,_0x398385){return function(_0x46add4){if(_0x46add4){return _0x46add4[_0x2429('0x26')](_0x56335a)[_0x2429('0x27')](function(_0x1b5ee3){return _0x1b5ee3;});}return null;};}function removeEntity(_0x2edda7,_0x3a8066){return function(_0x3db81f){if(_0x3db81f){return _0x3db81f[_0x2429('0x28')]()[_0x2429('0x27')](function(){_0x2edda7[_0x2429('0x1c')](0xcc)[_0x2429('0x1d')]();});}};}function handleEntityNotFound(_0x3c5377,_0x34a33d){return function(_0x3bdec2){if(!_0x3bdec2){_0x3c5377[_0x2429('0x1b')](0x194);}return _0x3bdec2;};}function handleError(_0x4acc81,_0xe990d6){_0xe990d6=_0xe990d6||0x1f4;return function(_0x4e0b45){logger[_0x2429('0x29')](_0x4e0b45['stack']);if(_0x4e0b45[_0x2429('0x2a')]){delete _0x4e0b45[_0x2429('0x2a')];}_0x4acc81[_0x2429('0x1c')](_0xe990d6)[_0x2429('0x2b')](_0x4e0b45);};}exports['index']=function(_0x17109b,_0x183aba){var _0x103379={},_0x5e8281={},_0x11b282={'count':0x0,'rows':[]};var _0x57f664=_['map'](db['VoiceAgentReport'][_0x2429('0x2c')],function(_0x201dd0){return{'name':_0x201dd0[_0x2429('0x2d')],'type':_0x201dd0[_0x2429('0x2e')]['key']};});_0x5e8281[_0x2429('0x2f')]=_[_0x2429('0x30')](_0x57f664,_0x2429('0x2a'));_0x5e8281[_0x2429('0x31')]=_[_0x2429('0x32')](_0x17109b[_0x2429('0x31')]);_0x5e8281['filters']=_[_0x2429('0x33')](_0x5e8281[_0x2429('0x2f')],_0x5e8281['query']);_0x103379[_0x2429('0x34')]=_['intersection'](_0x5e8281[_0x2429('0x2f')],qs[_0x2429('0x35')](_0x17109b[_0x2429('0x31')]['fields']));_0x103379[_0x2429('0x34')]=_0x103379[_0x2429('0x34')][_0x2429('0x36')]?_0x103379[_0x2429('0x34')]:_0x5e8281[_0x2429('0x2f')];if(!_0x17109b[_0x2429('0x31')][_0x2429('0x37')](_0x2429('0x38'))){_0x103379[_0x2429('0x21')]=qs[_0x2429('0x21')](_0x17109b[_0x2429('0x31')]['limit']);_0x103379[_0x2429('0x20')]=qs[_0x2429('0x20')](_0x17109b[_0x2429('0x31')]['offset']);}_0x103379[_0x2429('0x39')]=qs['sort'](_0x17109b[_0x2429('0x31')][_0x2429('0x3a')]);_0x103379[_0x2429('0x3b')]=qs[_0x2429('0x3c')](_['pick'](_0x17109b['query'],_0x5e8281[_0x2429('0x3c')]),_0x57f664);if(_0x17109b[_0x2429('0x31')]['filter']){_0x103379[_0x2429('0x3b')]=_['merge'](_0x103379[_0x2429('0x3b')],{'$or':_[_0x2429('0x30')](_0x57f664,function(_0x392c15){if(_0x392c15[_0x2429('0x2e')]!==_0x2429('0x3d')){var _0x589e91={};_0x589e91[_0x392c15['name']]={'$like':'%'+_0x17109b[_0x2429('0x31')][_0x2429('0x3e')]+'%'};return _0x589e91;}})});}_0x103379=_[_0x2429('0x3f')]({},_0x103379,_0x17109b[_0x2429('0x40')]);var _0x13cec6={'where':_0x103379[_0x2429('0x3b')]};return db[_0x2429('0x41')][_0x2429('0x1f')](_0x13cec6)['then'](function(_0x2e2f0a){_0x11b282[_0x2429('0x1f')]=_0x2e2f0a;if(_0x17109b[_0x2429('0x31')][_0x2429('0x42')]){_0x103379[_0x2429('0x43')]=[{'all':!![]}];}return db[_0x2429('0x41')]['findAll'](_0x103379);})[_0x2429('0x27')](function(_0x376968){_0x11b282[_0x2429('0x44')]=_0x376968;return _0x11b282;})[_0x2429('0x27')](respondWithFilteredResult(_0x183aba,_0x103379))[_0x2429('0x45')](handleError(_0x183aba,null));};exports[_0x2429('0x46')]=function(_0x27959d,_0x470ef3){var _0x6d967b={'raw':![],'where':{'id':_0x27959d['params']['id']}},_0x46ecc2={};_0x46ecc2[_0x2429('0x2f')]=_[_0x2429('0x32')](db[_0x2429('0x41')][_0x2429('0x2c')]);_0x46ecc2['query']=_[_0x2429('0x32')](_0x27959d[_0x2429('0x31')]);_0x46ecc2[_0x2429('0x3c')]=_[_0x2429('0x33')](_0x46ecc2[_0x2429('0x2f')],_0x46ecc2[_0x2429('0x31')]);_0x6d967b['attributes']=_['intersection'](_0x46ecc2['model'],qs['fields'](_0x27959d[_0x2429('0x31')][_0x2429('0x35')]));_0x6d967b[_0x2429('0x34')]=_0x6d967b[_0x2429('0x34')][_0x2429('0x36')]?_0x6d967b[_0x2429('0x34')]:_0x46ecc2['model'];if(_0x27959d['query'][_0x2429('0x42')]){_0x6d967b[_0x2429('0x43')]=[{'all':!![]}];}_0x6d967b=_['merge']({},_0x6d967b,_0x27959d[_0x2429('0x40')]);return db[_0x2429('0x41')][_0x2429('0x47')](_0x6d967b)[_0x2429('0x27')](handleEntityNotFound(_0x470ef3,null))[_0x2429('0x27')](respondWithResult(_0x470ef3,null))[_0x2429('0x45')](handleError(_0x470ef3,null));};exports['create']=function(_0x5cfce8,_0x4f35b8){return db[_0x2429('0x41')]['create'](_0x5cfce8['body'],{})[_0x2429('0x27')](respondWithResult(_0x4f35b8,0xc9))[_0x2429('0x45')](handleError(_0x4f35b8,null));};exports[_0x2429('0x26')]=function(_0x5ea70c,_0x168bbb){if(_0x5ea70c[_0x2429('0x48')]['id']){delete _0x5ea70c['body']['id'];}return db[_0x2429('0x41')][_0x2429('0x47')]({'where':{'id':_0x5ea70c[_0x2429('0x49')]['id']}})['then'](handleEntityNotFound(_0x168bbb,null))[_0x2429('0x27')](saveUpdates(_0x5ea70c[_0x2429('0x48')],null))[_0x2429('0x27')](respondWithResult(_0x168bbb,null))['catch'](handleError(_0x168bbb,null));};exports[_0x2429('0x28')]=function(_0x181d50,_0x1b8a7e){return db['VoiceAgentReport']['find']({'where':{'id':_0x181d50['params']['id']}})[_0x2429('0x27')](handleEntityNotFound(_0x1b8a7e,null))[_0x2429('0x27')](removeEntity(_0x1b8a7e,null))[_0x2429('0x45')](handleError(_0x1b8a7e,null));};exports['describe']=function(_0x1eb1c8,_0x216371){return db[_0x2429('0x41')]['describe']()[_0x2429('0x27')](respondWithResult(_0x216371,null))[_0x2429('0x45')](handleError(_0x216371,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index eaf5331..e964958 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 _0xcb91=['path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x54c528,_0x2bb900){var _0x5c64ec=function(_0x53d7dc){while(--_0x53d7dc){_0x54c528['push'](_0x54c528['shift']());}};_0x5c64ec(++_0x2bb900);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xcb91[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1cb9('0xa'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['report_agent','destuniqueid','../../config/logger','api','moment','bluebird','request-promise','path','./voiceAgentReport.attributes','define','VoiceAgentReport'];(function(_0x37e8c0,_0x5ccede){var _0xb098e4=function(_0x5a682a){while(--_0x5a682a){_0x37e8c0['push'](_0x37e8c0['shift']());}};_0xb098e4(++_0x5ccede);}(_0x9c44,0x178));var _0x49c4=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x9c44[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x49c4('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index a49a890..be78f52 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 _0xac22=['update','body','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceAgentReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','VoiceAgentReport','create','options','raw','then','CreateVoiceAgentReport','UpdateVoiceAgentReport'];(function(_0x2d0077,_0x5c7505){var _0x1b23d4=function(_0x3a38b3){while(--_0x3a38b3){_0x2d0077['push'](_0x2d0077['shift']());}};_0x1b23d4(++_0x5c7505);}(_0xac22,0x158));var _0x2ac2=function(_0x209c9d,_0x32ed56){_0x209c9d=_0x209c9d-0x0;var _0x652a78=_0xac22[_0x209c9d];return _0x652a78;};'use strict';var _=require(_0x2ac2('0x0'));var util=require(_0x2ac2('0x1'));var moment=require('moment');var BPromise=require(_0x2ac2('0x2'));var rs=require(_0x2ac2('0x3'));var fs=require('fs');var Redis=require(_0x2ac2('0x4'));var db=require(_0x2ac2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ac2('0x6'))(_0x2ac2('0x7'));var config=require(_0x2ac2('0x8'));var jayson=require(_0x2ac2('0x9'));var client=jayson[_0x2ac2('0xa')][_0x2ac2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x56e6a2,_0x26ebc0,_0x9f58e2){return new BPromise(function(_0x445848,_0x43a589){return client[_0x2ac2('0xc')](_0x56e6a2,_0x9f58e2)['then'](function(_0x39f836){logger['info'](_0x2ac2('0xd'),_0x26ebc0,'request\x20sent');logger[_0x2ac2('0xe')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x26ebc0,_0x2ac2('0xf'),JSON[_0x2ac2('0x10')](_0x39f836));if(_0x39f836[_0x2ac2('0x11')]){if(_0x39f836[_0x2ac2('0x11')][_0x2ac2('0x12')]===0x1f4){logger[_0x2ac2('0x11')](_0x2ac2('0xd'),_0x26ebc0,_0x39f836[_0x2ac2('0x11')][_0x2ac2('0x13')]);return _0x43a589(_0x39f836[_0x2ac2('0x11')][_0x2ac2('0x13')]);}logger[_0x2ac2('0x11')](_0x2ac2('0xd'),_0x26ebc0,_0x39f836[_0x2ac2('0x11')]['message']);return _0x445848(_0x39f836[_0x2ac2('0x11')][_0x2ac2('0x13')]);}else{logger[_0x2ac2('0x14')](_0x2ac2('0xd'),_0x26ebc0,_0x2ac2('0xf'));_0x445848(_0x39f836[_0x2ac2('0x15')][_0x2ac2('0x13')]);}})[_0x2ac2('0x16')](function(_0x5beaf0){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x26ebc0,_0x5beaf0);_0x43a589(_0x5beaf0);});});}exports['CreateVoiceAgentReport']=function(_0x433e98){var _0x2370d4=this;return new Promise(function(_0x1ee4c7,_0x5e8a4d){return db[_0x2ac2('0x17')][_0x2ac2('0x18')](_0x433e98['body'],{'raw':_0x433e98[_0x2ac2('0x19')]?_0x433e98[_0x2ac2('0x19')][_0x2ac2('0x1a')]===undefined?!![]:![]:!![]})[_0x2ac2('0x1b')](function(_0x18e2d0){logger[_0x2ac2('0x14')]('CreateVoiceAgentReport',_0x433e98);logger['debug']('CreateVoiceAgentReport',_0x433e98,JSON[_0x2ac2('0x10')](_0x18e2d0));_0x1ee4c7(_0x18e2d0);})[_0x2ac2('0x16')](function(_0x5330c1){logger[_0x2ac2('0x11')](_0x2ac2('0x1c'),_0x5330c1[_0x2ac2('0x13')],_0x433e98);_0x5e8a4d(_0x2370d4['error'](0x1f4,_0x5330c1[_0x2ac2('0x13')]));});});};exports[_0x2ac2('0x1d')]=function(_0xcdd0cc){var _0x205cb8=this;return new Promise(function(_0x16dd29,_0x26e912){return db[_0x2ac2('0x17')][_0x2ac2('0x1e')](_0xcdd0cc[_0x2ac2('0x1f')],{'raw':_0xcdd0cc[_0x2ac2('0x19')]?_0xcdd0cc[_0x2ac2('0x19')][_0x2ac2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcdd0cc['options']?_0xcdd0cc[_0x2ac2('0x19')]['where']||null:null,'attributes':_0xcdd0cc[_0x2ac2('0x19')]?_0xcdd0cc[_0x2ac2('0x19')][_0x2ac2('0x20')]||null:null,'limit':_0xcdd0cc['options']?_0xcdd0cc[_0x2ac2('0x19')][_0x2ac2('0x21')]||null:null})['then'](function(_0x146511){logger[_0x2ac2('0x14')](_0x2ac2('0x1d'),_0xcdd0cc);logger[_0x2ac2('0xe')](_0x2ac2('0x1d'),_0xcdd0cc,JSON[_0x2ac2('0x10')](_0x146511));_0x16dd29(_0x146511);})['catch'](function(_0x1f609f){logger[_0x2ac2('0x11')]('UpdateVoiceAgentReport',_0x1f609f['message'],_0xcdd0cc);_0x26e912(_0x205cb8['error'](0x1f4,_0x1f609f[_0x2ac2('0x13')]));});});}; \ No newline at end of file +var _0xe17f=['UpdateVoiceAgentReport','update','body','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw'];(function(_0x49f836,_0x4f1d95){var _0x3a74db=function(_0x8c46c2){while(--_0x8c46c2){_0x49f836['push'](_0x49f836['shift']());}};_0x3a74db(++_0x4f1d95);}(_0xe17f,0x1ce));var _0xfe17=function(_0x24a86a,_0x3a9dfd){_0x24a86a=_0x24a86a-0x0;var _0x30bbef=_0xe17f[_0x24a86a];return _0x30bbef;};'use strict';var _=require(_0xfe17('0x0'));var util=require(_0xfe17('0x1'));var moment=require(_0xfe17('0x2'));var BPromise=require(_0xfe17('0x3'));var rs=require(_0xfe17('0x4'));var fs=require('fs');var Redis=require(_0xfe17('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe17('0x6'));var logger=require(_0xfe17('0x7'))(_0xfe17('0x8'));var config=require('../../config/environment');var jayson=require(_0xfe17('0x9'));var client=jayson[_0xfe17('0xa')][_0xfe17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb9de,_0x139942,_0xd0e777){return new BPromise(function(_0x2ba31b,_0x34d02f){return client[_0xfe17('0xc')](_0x1eb9de,_0xd0e777)['then'](function(_0x3304ba){logger[_0xfe17('0xd')](_0xfe17('0xe'),_0x139942,_0xfe17('0xf'));logger[_0xfe17('0x10')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x139942,_0xfe17('0xf'),JSON[_0xfe17('0x11')](_0x3304ba));if(_0x3304ba[_0xfe17('0x12')]){if(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x13')]===0x1f4){logger[_0xfe17('0x12')](_0xfe17('0xe'),_0x139942,_0x3304ba['error'][_0xfe17('0x14')]);return _0x34d02f(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x14')]);}logger['error'](_0xfe17('0xe'),_0x139942,_0x3304ba[_0xfe17('0x12')]['message']);return _0x2ba31b(_0x3304ba[_0xfe17('0x12')][_0xfe17('0x14')]);}else{logger[_0xfe17('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x139942,_0xfe17('0xf'));_0x2ba31b(_0x3304ba[_0xfe17('0x15')][_0xfe17('0x14')]);}})[_0xfe17('0x16')](function(_0x2a4b05){logger[_0xfe17('0x12')](_0xfe17('0xe'),_0x139942,_0x2a4b05);_0x34d02f(_0x2a4b05);});});}exports[_0xfe17('0x17')]=function(_0x513298){var _0x2c79ea=this;return new Promise(function(_0x2232ee,_0x3fa329){return db[_0xfe17('0x18')][_0xfe17('0x19')](_0x513298['body'],{'raw':_0x513298[_0xfe17('0x1a')]?_0x513298[_0xfe17('0x1a')][_0xfe17('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x307904){logger['info'](_0xfe17('0x17'),_0x513298);logger[_0xfe17('0x10')]('CreateVoiceAgentReport',_0x513298,JSON[_0xfe17('0x11')](_0x307904));_0x2232ee(_0x307904);})[_0xfe17('0x16')](function(_0x2bcf29){logger[_0xfe17('0x12')](_0xfe17('0x17'),_0x2bcf29[_0xfe17('0x14')],_0x513298);_0x3fa329(_0x2c79ea[_0xfe17('0x12')](0x1f4,_0x2bcf29[_0xfe17('0x14')]));});});};exports[_0xfe17('0x1c')]=function(_0xb699f8){var _0xafb033=this;return new Promise(function(_0x24ab00,_0x290129){return db[_0xfe17('0x18')][_0xfe17('0x1d')](_0xb699f8[_0xfe17('0x1e')],{'raw':_0xb699f8[_0xfe17('0x1a')]?_0xb699f8['options'][_0xfe17('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb699f8['options']?_0xb699f8[_0xfe17('0x1a')][_0xfe17('0x1f')]||null:null,'attributes':_0xb699f8['options']?_0xb699f8[_0xfe17('0x1a')][_0xfe17('0x20')]||null:null,'limit':_0xb699f8[_0xfe17('0x1a')]?_0xb699f8[_0xfe17('0x1a')][_0xfe17('0x21')]||null:null})[_0xfe17('0x22')](function(_0x2bb31d){logger[_0xfe17('0xd')]('UpdateVoiceAgentReport',_0xb699f8);logger['debug']('UpdateVoiceAgentReport',_0xb699f8,JSON[_0xfe17('0x11')](_0x2bb31d));_0x24ab00(_0x2bb31d);})['catch'](function(_0x515496){logger[_0xfe17('0x12')](_0xfe17('0x1c'),_0x515496[_0xfe17('0x14')],_0xb699f8);_0x290129(_0xafb033[_0xfe17('0x12')](0x1f4,_0x515496[_0xfe17('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 19fb934..7306c8e 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 _0xd98c=['multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete','exports'];(function(_0x1ef4b6,_0x4755ae){var _0x3617db=function(_0x22c0aa){while(--_0x22c0aa){_0x1ef4b6['push'](_0x1ef4b6['shift']());}};_0x3617db(++_0x4755ae);}(_0xd98c,0x168));var _0xcd98=function(_0xd1146e,_0x2e738b){_0xd1146e=_0xd1146e-0x0;var _0x3454aa=_0xd98c[_0xd1146e];return _0x3454aa;};'use strict';var multer=require(_0xcd98('0x0'));var util=require(_0xcd98('0x1'));var path=require(_0xcd98('0x2'));var timeout=require(_0xcd98('0x3'));var express=require(_0xcd98('0x4'));var router=express[_0xcd98('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcd98('0x6'));var controller=require(_0xcd98('0x7'));router[_0xcd98('0x8')]('/',auth[_0xcd98('0x9')](),controller[_0xcd98('0xa')]);router[_0xcd98('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xcd98('0xb')]);router['get'](_0xcd98('0xc'),auth['isAuthenticated'](),controller[_0xcd98('0xd')]);router[_0xcd98('0xe')]('/',auth['isAuthenticated'](),controller[_0xcd98('0xf')]);router[_0xcd98('0x10')](_0xcd98('0xc'),auth[_0xcd98('0x9')](),controller[_0xcd98('0x11')]);router[_0xcd98('0x12')](_0xcd98('0xc'),auth[_0xcd98('0x9')](),controller['destroy']);module[_0xcd98('0x13')]=router; \ No newline at end of file +var _0xe196=['/:id','destroy','exports','path','express','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','get','describe','post','create','put'];(function(_0xc587ed,_0x11cbc2){var _0x41d137=function(_0x2d288f){while(--_0x2d288f){_0xc587ed['push'](_0xc587ed['shift']());}};_0x41d137(++_0x11cbc2);}(_0xe196,0x137));var _0x6e19=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe196[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6e19('0x0'));var timeout=require('connect-timeout');var express=require(_0x6e19('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6e19('0x2'));var config=require(_0x6e19('0x3'));var controller=require(_0x6e19('0x4'));router['get']('/',auth[_0x6e19('0x5')](),controller['index']);router[_0x6e19('0x6')]('/describe',auth[_0x6e19('0x5')](),controller[_0x6e19('0x7')]);router[_0x6e19('0x6')]('/:id',auth[_0x6e19('0x5')](),controller['show']);router[_0x6e19('0x8')]('/',auth[_0x6e19('0x5')](),controller[_0x6e19('0x9')]);router[_0x6e19('0xa')](_0x6e19('0xb'),auth[_0x6e19('0x5')](),controller['update']);router['delete'](_0x6e19('0xb'),auth[_0x6e19('0x5')](),controller[_0x6e19('0xc')]);module[_0x6e19('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index ec620dd..4bf711d 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(_0x1c046f,_0x149425){var _0x1616ed=function(_0x3ae5c0){while(--_0x3ae5c0){_0x1c046f['push'](_0x1c046f['shift']());}};_0x1616ed(++_0x149425);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(_0x28ac4a,_0x40172f){var _0x407f92=function(_0xef99ae){while(--_0xef99ae){_0x28ac4a['push'](_0x28ac4a['shift']());}};_0x407f92(++_0x40172f);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 1617bb8..9192839 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 _0x628b=['name','send','map','VoiceCallReport','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','fullname','alias','User','rows','params','keys','find','create','catch','destroy','describe','update','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','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','status','json','offset','limit','Content-Range','apply','save','then','sendStatus','stack'];(function(_0x294a6b,_0x389e06){var _0x5d4163=function(_0x2378f2){while(--_0x2378f2){_0x294a6b['push'](_0x294a6b['shift']());}};_0x5d4163(++_0x389e06);}(_0x628b,0x110));var _0xb628=function(_0x55d3a5,_0xa419c1){_0x55d3a5=_0x55d3a5-0x0;var _0x3ae4d6=_0x628b[_0x55d3a5];return _0x3ae4d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb628('0x0'));var rimraf=require(_0xb628('0x1'));var zipdir=require(_0xb628('0x2'));var jsonpatch=require(_0xb628('0x3'));var rp=require('request-promise');var moment=require(_0xb628('0x4'));var BPromise=require(_0xb628('0x5'));var Mustache=require('mustache');var util=require(_0xb628('0x6'));var path=require(_0xb628('0x7'));var sox=require(_0xb628('0x8'));var csv=require(_0xb628('0x9'));var ejs=require(_0xb628('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb628('0xb'));var crypto=require(_0xb628('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb628('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb628('0xe'));var Papa=require(_0xb628('0xf'));var Redis=require(_0xb628('0x10'));var authService=require(_0xb628('0x11'));var qs=require(_0xb628('0x12'));var as=require(_0xb628('0x13'));var hardwareService=require(_0xb628('0x14'));var logger=require(_0xb628('0x15'))(_0xb628('0x16'));var utils=require(_0xb628('0x17'));var config=require(_0xb628('0x18'));var db=require(_0xb628('0x19'))['db'];function respondWithStatusCode(_0x3a8b3a,_0xbb6f4a){_0xbb6f4a=_0xbb6f4a||0xcc;return function(_0x441a29){if(_0x441a29){return _0x3a8b3a['sendStatus'](_0xbb6f4a);}return _0x3a8b3a[_0xb628('0x1a')](_0xbb6f4a)['end']();};}function respondWithResult(_0x35f10d,_0x57caad){_0x57caad=_0x57caad||0xc8;return function(_0x57cfc1){if(_0x57cfc1){return _0x35f10d[_0xb628('0x1a')](_0x57caad)[_0xb628('0x1b')](_0x57cfc1);}};}function respondWithFilteredResult(_0x344646,_0x2e084f){return function(_0x14aea5){if(_0x14aea5){var _0x543769=_0x14aea5['count'],_0x291952=_0x2e084f['offset'],_0x41aec8=_0x2e084f[_0xb628('0x1c')]+_0x2e084f[_0xb628('0x1d')],_0xf575ee;if(_0x41aec8>=_0x543769){_0x41aec8=_0x543769;_0xf575ee=0xc8;}else{_0xf575ee=0xce;}_0x344646[_0xb628('0x1a')](_0xf575ee);return _0x344646['set'](_0xb628('0x1e'),_0x291952+'-'+_0x41aec8+'/'+_0x543769)[_0xb628('0x1b')](_0x14aea5);}return null;};}function patchUpdates(_0x227788){return function(_0x5a0963){try{jsonpatch[_0xb628('0x1f')](_0x5a0963,_0x227788,!![]);}catch(_0x2b8b8d){return BPromise['reject'](_0x2b8b8d);}return _0x5a0963[_0xb628('0x20')]();};}function saveUpdates(_0x507022,_0x16e068){return function(_0x2c54ca){if(_0x2c54ca){return _0x2c54ca['update'](_0x507022)[_0xb628('0x21')](function(_0x30b9d2){return _0x30b9d2;});}return null;};}function removeEntity(_0x592062,_0xbceb23){return function(_0x417094){if(_0x417094){return _0x417094['destroy']()[_0xb628('0x21')](function(){_0x592062['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4129ec,_0x53b98c){return function(_0x4978cf){if(!_0x4978cf){_0x4129ec[_0xb628('0x22')](0x194);}return _0x4978cf;};}function handleError(_0x1f3828,_0x363b64){_0x363b64=_0x363b64||0x1f4;return function(_0x5c527d){logger['error'](_0x5c527d[_0xb628('0x23')]);if(_0x5c527d[_0xb628('0x24')]){delete _0x5c527d['name'];}_0x1f3828[_0xb628('0x1a')](_0x363b64)[_0xb628('0x25')](_0x5c527d);};}exports['index']=function(_0xa2bde3,_0x5569fb){var _0x4cd380={},_0x2c9797={},_0x2ad7f1={'count':0x0,'rows':[]};var _0x55e7f8=_[_0xb628('0x26')](db[_0xb628('0x27')][_0xb628('0x28')],function(_0x59f427){return{'name':_0x59f427['fieldName'],'type':_0x59f427[_0xb628('0x29')][_0xb628('0x2a')]};});_0x2c9797[_0xb628('0x2b')]=_[_0xb628('0x26')](_0x55e7f8,_0xb628('0x24'));_0x2c9797['query']=_['keys'](_0xa2bde3[_0xb628('0x2c')]);_0x2c9797[_0xb628('0x2d')]=_[_0xb628('0x2e')](_0x2c9797[_0xb628('0x2b')],_0x2c9797[_0xb628('0x2c')]);_0x4cd380['attributes']=_[_0xb628('0x2e')](_0x2c9797[_0xb628('0x2b')],qs[_0xb628('0x2f')](_0xa2bde3['query']['fields']));_0x4cd380['attributes']=_0x4cd380[_0xb628('0x30')][_0xb628('0x31')]?_0x4cd380[_0xb628('0x30')]:_0x2c9797[_0xb628('0x2b')];if(!_0xa2bde3[_0xb628('0x2c')][_0xb628('0x32')](_0xb628('0x33'))){_0x4cd380[_0xb628('0x1d')]=qs[_0xb628('0x1d')](_0xa2bde3[_0xb628('0x2c')][_0xb628('0x1d')]);_0x4cd380['offset']=qs['offset'](_0xa2bde3[_0xb628('0x2c')][_0xb628('0x1c')]);}_0x4cd380[_0xb628('0x34')]=qs[_0xb628('0x35')](_0xa2bde3[_0xb628('0x2c')][_0xb628('0x35')]);_0x4cd380[_0xb628('0x36')]=qs[_0xb628('0x2d')](_[_0xb628('0x37')](_0xa2bde3[_0xb628('0x2c')],_0x2c9797[_0xb628('0x2d')]),_0x55e7f8);if(_0xa2bde3[_0xb628('0x2c')][_0xb628('0x38')]){_0x4cd380[_0xb628('0x36')]=_['merge'](_0x4cd380['where'],{'$or':_[_0xb628('0x26')](_0x55e7f8,function(_0x300bad){if(_0x300bad[_0xb628('0x29')]!==_0xb628('0x39')){var _0x34db07={};_0x34db07[_0x300bad['name']]={'$like':'%'+_0xa2bde3[_0xb628('0x2c')]['filter']+'%'};return _0x34db07;}})});}_0x4cd380=_[_0xb628('0x3a')]({},_0x4cd380,_0xa2bde3['options']);var _0x401779={'where':_0x4cd380[_0xb628('0x36')]};return db[_0xb628('0x27')]['count'](_0x401779)[_0xb628('0x21')](function(_0x2f113b){_0x2ad7f1[_0xb628('0x3b')]=_0x2f113b;if(_0xa2bde3[_0xb628('0x2c')][_0xb628('0x3c')]){_0x4cd380[_0xb628('0x3d')]=[{'attributes':['id',_0xb628('0x24'),_0xb628('0x3e'),_0xb628('0x3f')],'model':db[_0xb628('0x40')],'as':_0xb628('0x40')}];}return db[_0xb628('0x27')]['findAll'](_0x4cd380);})[_0xb628('0x21')](function(_0x1a9a6e){_0x2ad7f1[_0xb628('0x41')]=_0x1a9a6e;return _0x2ad7f1;})[_0xb628('0x21')](respondWithFilteredResult(_0x5569fb,_0x4cd380))['catch'](handleError(_0x5569fb,null));};exports['show']=function(_0x17b3e8,_0x3a7fbd){var _0x3c5391={'raw':!![],'where':{'id':_0x17b3e8[_0xb628('0x42')]['id']}},_0x56ae26={};_0x56ae26['model']=_[_0xb628('0x43')](db['VoiceCallReport'][_0xb628('0x28')]);_0x56ae26[_0xb628('0x2c')]=_[_0xb628('0x43')](_0x17b3e8[_0xb628('0x2c')]);_0x56ae26[_0xb628('0x2d')]=_[_0xb628('0x2e')](_0x56ae26[_0xb628('0x2b')],_0x56ae26['query']);_0x3c5391[_0xb628('0x30')]=_['intersection'](_0x56ae26[_0xb628('0x2b')],qs['fields'](_0x17b3e8[_0xb628('0x2c')][_0xb628('0x2f')]));_0x3c5391[_0xb628('0x30')]=_0x3c5391['attributes'][_0xb628('0x31')]?_0x3c5391[_0xb628('0x30')]:_0x56ae26[_0xb628('0x2b')];if(_0x17b3e8[_0xb628('0x2c')]['includeAll']){_0x3c5391['include']=[{'all':!![]}];}_0x3c5391=_[_0xb628('0x3a')]({},_0x3c5391,_0x17b3e8['options']);return db[_0xb628('0x27')][_0xb628('0x44')](_0x3c5391)['then'](handleEntityNotFound(_0x3a7fbd,null))['then'](respondWithResult(_0x3a7fbd,null))['catch'](handleError(_0x3a7fbd,null));};exports[_0xb628('0x45')]=function(_0x16cd1f,_0x49b6c7){return db[_0xb628('0x27')]['create'](_0x16cd1f['body'],{})[_0xb628('0x21')](respondWithResult(_0x49b6c7,0xc9))[_0xb628('0x46')](handleError(_0x49b6c7,null));};exports[_0xb628('0x47')]=function(_0x4c4d8a,_0x3d3903){return db['VoiceCallReport'][_0xb628('0x44')]({'where':{'id':_0x4c4d8a['params']['id']}})[_0xb628('0x21')](handleEntityNotFound(_0x3d3903,null))['then'](removeEntity(_0x3d3903,null))[_0xb628('0x46')](handleError(_0x3d3903,null));};exports[_0xb628('0x48')]=function(_0x4594a6,_0x522c5b){return db[_0xb628('0x27')]['describe']()[_0xb628('0x21')](respondWithResult(_0x522c5b,null))['catch'](handleError(_0x522c5b,null));};exports[_0xb628('0x49')]=function(_0x3111c2,_0x223e28){if(_0x3111c2[_0xb628('0x4a')][_0xb628('0x4b')]){delete _0x3111c2[_0xb628('0x4a')]['uniqueid'];}return db[_0xb628('0x27')][_0xb628('0x44')]({'where':{'uniqueid':_0x3111c2[_0xb628('0x42')]['id'],'UserId':{'$or':[null,_0x3111c2[_0xb628('0x4c')]['id']]}}})['then'](handleEntityNotFound(_0x223e28,null))[_0xb628('0x21')](saveUpdates(_0x3111c2[_0xb628('0x4a')],null))[_0xb628('0x21')](respondWithResult(_0x223e28,null))[_0xb628('0x46')](handleError(_0x223e28,null));}; \ No newline at end of file +var _0xc697=['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','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','VoiceCallReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','where','pick','filter','merge','VIRTUAL','options','include','fullname','User','findAll','rows','show','params','includeAll','find','catch','create','uniqueid','body','user','rimraf','zip-dir'];(function(_0xb4df7d,_0xd352df){var _0x43bdc0=function(_0x1acafc){while(--_0x1acafc){_0xb4df7d['push'](_0xb4df7d['shift']());}};_0x43bdc0(++_0xd352df);}(_0xc697,0x126));var _0x7c69=function(_0x502372,_0x304dd9){_0x502372=_0x502372-0x0;var _0xf99629=_0xc697[_0x502372];return _0xf99629;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x7c69('0x0'));var zipdir=require(_0x7c69('0x1'));var jsonpatch=require(_0x7c69('0x2'));var rp=require(_0x7c69('0x3'));var moment=require(_0x7c69('0x4'));var BPromise=require(_0x7c69('0x5'));var Mustache=require(_0x7c69('0x6'));var util=require(_0x7c69('0x7'));var path=require(_0x7c69('0x8'));var sox=require(_0x7c69('0x9'));var csv=require(_0x7c69('0xa'));var ejs=require(_0x7c69('0xb'));var fs=require('fs');var _=require(_0x7c69('0xc'));var squel=require(_0x7c69('0xd'));var crypto=require(_0x7c69('0xe'));var jsforce=require(_0x7c69('0xf'));var deskjs=require(_0x7c69('0x10'));var toCsv=require(_0x7c69('0xa'));var querystring=require(_0x7c69('0x11'));var Papa=require(_0x7c69('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7c69('0x13'));var as=require(_0x7c69('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c69('0x15'))('api');var utils=require(_0x7c69('0x16'));var config=require('../../config/environment');var db=require(_0x7c69('0x17'))['db'];function respondWithStatusCode(_0x25c9ea,_0x2015c8){_0x2015c8=_0x2015c8||0xcc;return function(_0x876673){if(_0x876673){return _0x25c9ea[_0x7c69('0x18')](_0x2015c8);}return _0x25c9ea[_0x7c69('0x19')](_0x2015c8)['end']();};}function respondWithResult(_0x5568af,_0x22f9f8){_0x22f9f8=_0x22f9f8||0xc8;return function(_0x40006e){if(_0x40006e){return _0x5568af[_0x7c69('0x19')](_0x22f9f8)[_0x7c69('0x1a')](_0x40006e);}};}function respondWithFilteredResult(_0x128222,_0x3941ce){return function(_0x25a6ae){if(_0x25a6ae){var _0x5d220a=_0x25a6ae[_0x7c69('0x1b')],_0x2a5874=_0x3941ce[_0x7c69('0x1c')],_0x37fa54=_0x3941ce[_0x7c69('0x1c')]+_0x3941ce[_0x7c69('0x1d')],_0x3a3e67;if(_0x37fa54>=_0x5d220a){_0x37fa54=_0x5d220a;_0x3a3e67=0xc8;}else{_0x3a3e67=0xce;}_0x128222[_0x7c69('0x19')](_0x3a3e67);return _0x128222['set'](_0x7c69('0x1e'),_0x2a5874+'-'+_0x37fa54+'/'+_0x5d220a)[_0x7c69('0x1a')](_0x25a6ae);}return null;};}function patchUpdates(_0x596218){return function(_0x431c78){try{jsonpatch['apply'](_0x431c78,_0x596218,!![]);}catch(_0x2d50a5){return BPromise[_0x7c69('0x1f')](_0x2d50a5);}return _0x431c78[_0x7c69('0x20')]();};}function saveUpdates(_0x5a73be,_0x50b6f8){return function(_0x526b35){if(_0x526b35){return _0x526b35[_0x7c69('0x21')](_0x5a73be)[_0x7c69('0x22')](function(_0x14256e){return _0x14256e;});}return null;};}function removeEntity(_0x2ac228,_0x1a2677){return function(_0xa39474){if(_0xa39474){return _0xa39474[_0x7c69('0x23')]()[_0x7c69('0x22')](function(){_0x2ac228[_0x7c69('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fb06c,_0x1d8070){return function(_0x29ab71){if(!_0x29ab71){_0x3fb06c[_0x7c69('0x18')](0x194);}return _0x29ab71;};}function handleError(_0x13ac8e,_0x256f62){_0x256f62=_0x256f62||0x1f4;return function(_0xf96ef3){logger['error'](_0xf96ef3[_0x7c69('0x24')]);if(_0xf96ef3[_0x7c69('0x25')]){delete _0xf96ef3[_0x7c69('0x25')];}_0x13ac8e[_0x7c69('0x19')](_0x256f62)[_0x7c69('0x26')](_0xf96ef3);};}exports[_0x7c69('0x27')]=function(_0x183425,_0x246314){var _0x1b6fdc={},_0x31f4df={},_0x3a66ee={'count':0x0,'rows':[]};var _0x3e0c85=_[_0x7c69('0x28')](db[_0x7c69('0x29')][_0x7c69('0x2a')],function(_0x1fb1bd){return{'name':_0x1fb1bd['fieldName'],'type':_0x1fb1bd[_0x7c69('0x2b')][_0x7c69('0x2c')]};});_0x31f4df[_0x7c69('0x2d')]=_[_0x7c69('0x28')](_0x3e0c85,_0x7c69('0x25'));_0x31f4df[_0x7c69('0x2e')]=_[_0x7c69('0x2f')](_0x183425['query']);_0x31f4df[_0x7c69('0x30')]=_[_0x7c69('0x31')](_0x31f4df[_0x7c69('0x2d')],_0x31f4df[_0x7c69('0x2e')]);_0x1b6fdc[_0x7c69('0x32')]=_[_0x7c69('0x31')](_0x31f4df['model'],qs[_0x7c69('0x33')](_0x183425[_0x7c69('0x2e')][_0x7c69('0x33')]));_0x1b6fdc[_0x7c69('0x32')]=_0x1b6fdc[_0x7c69('0x32')][_0x7c69('0x34')]?_0x1b6fdc[_0x7c69('0x32')]:_0x31f4df[_0x7c69('0x2d')];if(!_0x183425[_0x7c69('0x2e')]['hasOwnProperty'](_0x7c69('0x35'))){_0x1b6fdc[_0x7c69('0x1d')]=qs['limit'](_0x183425[_0x7c69('0x2e')][_0x7c69('0x1d')]);_0x1b6fdc['offset']=qs[_0x7c69('0x1c')](_0x183425[_0x7c69('0x2e')][_0x7c69('0x1c')]);}_0x1b6fdc['order']=qs['sort'](_0x183425[_0x7c69('0x2e')]['sort']);_0x1b6fdc[_0x7c69('0x36')]=qs[_0x7c69('0x30')](_[_0x7c69('0x37')](_0x183425[_0x7c69('0x2e')],_0x31f4df[_0x7c69('0x30')]),_0x3e0c85);if(_0x183425['query'][_0x7c69('0x38')]){_0x1b6fdc[_0x7c69('0x36')]=_[_0x7c69('0x39')](_0x1b6fdc[_0x7c69('0x36')],{'$or':_[_0x7c69('0x28')](_0x3e0c85,function(_0x5caac0){if(_0x5caac0[_0x7c69('0x2b')]!==_0x7c69('0x3a')){var _0x2a1dab={};_0x2a1dab[_0x5caac0[_0x7c69('0x25')]]={'$like':'%'+_0x183425[_0x7c69('0x2e')][_0x7c69('0x38')]+'%'};return _0x2a1dab;}})});}_0x1b6fdc=_[_0x7c69('0x39')]({},_0x1b6fdc,_0x183425[_0x7c69('0x3b')]);var _0x2024ba={'where':_0x1b6fdc[_0x7c69('0x36')]};return db[_0x7c69('0x29')][_0x7c69('0x1b')](_0x2024ba)[_0x7c69('0x22')](function(_0x2f747b){_0x3a66ee['count']=_0x2f747b;if(_0x183425[_0x7c69('0x2e')]['includeAll']){_0x1b6fdc[_0x7c69('0x3c')]=[{'attributes':['id','name',_0x7c69('0x3d'),'alias'],'model':db[_0x7c69('0x3e')],'as':_0x7c69('0x3e')}];}return db[_0x7c69('0x29')][_0x7c69('0x3f')](_0x1b6fdc);})['then'](function(_0x7a04b){_0x3a66ee[_0x7c69('0x40')]=_0x7a04b;return _0x3a66ee;})[_0x7c69('0x22')](respondWithFilteredResult(_0x246314,_0x1b6fdc))['catch'](handleError(_0x246314,null));};exports[_0x7c69('0x41')]=function(_0x53ff67,_0x170678){var _0xa81a00={'raw':!![],'where':{'id':_0x53ff67[_0x7c69('0x42')]['id']}},_0x5381c8={};_0x5381c8[_0x7c69('0x2d')]=_[_0x7c69('0x2f')](db[_0x7c69('0x29')]['rawAttributes']);_0x5381c8['query']=_['keys'](_0x53ff67[_0x7c69('0x2e')]);_0x5381c8[_0x7c69('0x30')]=_[_0x7c69('0x31')](_0x5381c8[_0x7c69('0x2d')],_0x5381c8[_0x7c69('0x2e')]);_0xa81a00[_0x7c69('0x32')]=_['intersection'](_0x5381c8[_0x7c69('0x2d')],qs[_0x7c69('0x33')](_0x53ff67['query']['fields']));_0xa81a00[_0x7c69('0x32')]=_0xa81a00[_0x7c69('0x32')][_0x7c69('0x34')]?_0xa81a00[_0x7c69('0x32')]:_0x5381c8[_0x7c69('0x2d')];if(_0x53ff67[_0x7c69('0x2e')][_0x7c69('0x43')]){_0xa81a00[_0x7c69('0x3c')]=[{'all':!![]}];}_0xa81a00=_[_0x7c69('0x39')]({},_0xa81a00,_0x53ff67[_0x7c69('0x3b')]);return db[_0x7c69('0x29')][_0x7c69('0x44')](_0xa81a00)[_0x7c69('0x22')](handleEntityNotFound(_0x170678,null))[_0x7c69('0x22')](respondWithResult(_0x170678,null))[_0x7c69('0x45')](handleError(_0x170678,null));};exports[_0x7c69('0x46')]=function(_0x5958b5,_0x23eb78){return db[_0x7c69('0x29')]['create'](_0x5958b5['body'],{})[_0x7c69('0x22')](respondWithResult(_0x23eb78,0xc9))[_0x7c69('0x45')](handleError(_0x23eb78,null));};exports['destroy']=function(_0x22004b,_0x1dd89b){return db[_0x7c69('0x29')][_0x7c69('0x44')]({'where':{'id':_0x22004b['params']['id']}})[_0x7c69('0x22')](handleEntityNotFound(_0x1dd89b,null))[_0x7c69('0x22')](removeEntity(_0x1dd89b,null))[_0x7c69('0x45')](handleError(_0x1dd89b,null));};exports['describe']=function(_0x1f7135,_0x4dc841){return db['VoiceCallReport']['describe']()[_0x7c69('0x22')](respondWithResult(_0x4dc841,null))[_0x7c69('0x45')](handleError(_0x4dc841,null));};exports[_0x7c69('0x21')]=function(_0x40114c,_0x2d5190){if(_0x40114c['body'][_0x7c69('0x47')]){delete _0x40114c[_0x7c69('0x48')][_0x7c69('0x47')];}return db[_0x7c69('0x29')][_0x7c69('0x44')]({'where':{'uniqueid':_0x40114c[_0x7c69('0x42')]['id'],'UserId':{'$or':[null,_0x40114c[_0x7c69('0x49')]['id']]}}})[_0x7c69('0x22')](handleEntityNotFound(_0x2d5190,null))['then'](saveUpdates(_0x40114c['body'],null))[_0x7c69('0x22')](respondWithResult(_0x2d5190,null))[_0x7c69('0x45')](handleError(_0x2d5190,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index e5092ba..37398db 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 _0x59fa=['path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','moment','bluebird','request-promise'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x59fa,0x1d0));var _0xa59f=function(_0x37210e,_0x5264c0){_0x37210e=_0x37210e-0x0;var _0x79d0e7=_0x59fa[_0x37210e];return _0x79d0e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa59f('0x0'))('api');var moment=require(_0xa59f('0x1'));var BPromise=require(_0xa59f('0x2'));var rp=require(_0xa59f('0x3'));var fs=require('fs');var path=require(_0xa59f('0x4'));var rimraf=require(_0xa59f('0x5'));var config=require(_0xa59f('0x6'));var attributes=require(_0xa59f('0x7'));module[_0xa59f('0x8')]=function(_0x4e4148,_0x5a7c2c){return _0x4e4148[_0xa59f('0x9')](_0xa59f('0xa'),attributes,{'tableName':_0xa59f('0xb'),'paranoid':![],'indexes':[{'fields':[_0xa59f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9845=['bluebird','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','lodash','moment'];(function(_0x3d6935,_0x15ef2c){var _0x38fd9f=function(_0x42b580){while(--_0x42b580){_0x3d6935['push'](_0x3d6935['shift']());}};_0x38fd9f(++_0x15ef2c);}(_0x9845,0x142));var _0x5984=function(_0x499185,_0x9342ce){_0x499185=_0x499185-0x0;var _0x232a15=_0x9845[_0x499185];return _0x232a15;};'use strict';var _=require(_0x5984('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5984('0x1'));var BPromise=require(_0x5984('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5984('0x3'));var config=require(_0x5984('0x4'));var attributes=require(_0x5984('0x5'));module[_0x5984('0x6')]=function(_0x3f3b4a,_0xcf0d91){return _0x3f3b4a[_0x5984('0x7')](_0x5984('0x8'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 5bc21e0..86e9a65 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 _0x85dd=['stringify','catch','CreateVoiceCallReport','create','body','update','limit','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','map','include','model'];(function(_0x163673,_0x5bebb9){var _0x150465=function(_0x125a0a){while(--_0x125a0a){_0x163673['push'](_0x163673['shift']());}};_0x150465(++_0x5bebb9);}(_0x85dd,0x1e8));var _0xd85d=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x85dd[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0xd85d('0x0'));var util=require(_0xd85d('0x1'));var moment=require('moment');var BPromise=require(_0xd85d('0x2'));var rs=require(_0xd85d('0x3'));var fs=require('fs');var Redis=require(_0xd85d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd85d('0x5'));var logger=require(_0xd85d('0x6'))(_0xd85d('0x7'));var config=require(_0xd85d('0x8'));var jayson=require(_0xd85d('0x9'));var client=jayson[_0xd85d('0xa')][_0xd85d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ab8be,_0x3b9aec,_0x4e775e){return new BPromise(function(_0x145a95,_0x191aef){return client[_0xd85d('0xc')](_0x1ab8be,_0x4e775e)[_0xd85d('0xd')](function(_0x2af4c6){logger[_0xd85d('0xe')](_0xd85d('0xf'),_0x3b9aec,'request\x20sent');logger[_0xd85d('0x10')](_0xd85d('0x11'),_0x3b9aec,'request\x20sent',JSON['stringify'](_0x2af4c6));if(_0x2af4c6['error']){if(_0x2af4c6['error']['code']===0x1f4){logger[_0xd85d('0x12')](_0xd85d('0xf'),_0x3b9aec,_0x2af4c6[_0xd85d('0x12')][_0xd85d('0x13')]);return _0x191aef(_0x2af4c6['error'][_0xd85d('0x13')]);}logger[_0xd85d('0x12')](_0xd85d('0xf'),_0x3b9aec,_0x2af4c6[_0xd85d('0x12')]['message']);return _0x145a95(_0x2af4c6['error']['message']);}else{logger['info'](_0xd85d('0xf'),_0x3b9aec,_0xd85d('0x14'));_0x145a95(_0x2af4c6[_0xd85d('0x15')][_0xd85d('0x13')]);}})['catch'](function(_0x5d1f18){logger[_0xd85d('0x12')](_0xd85d('0xf'),_0x3b9aec,_0x5d1f18);_0x191aef(_0x5d1f18);});});}exports[_0xd85d('0x16')]=function(_0x3c8ff5){var _0x4dbb33=this;return new Promise(function(_0x11bdbf,_0x130e5c){return db[_0xd85d('0x17')][_0xd85d('0x18')]({'raw':_0x3c8ff5[_0xd85d('0x19')]?_0x3c8ff5[_0xd85d('0x19')][_0xd85d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c8ff5[_0xd85d('0x19')]?_0x3c8ff5['options'][_0xd85d('0x1b')]||null:null,'attributes':_0x3c8ff5['options']?_0x3c8ff5[_0xd85d('0x19')][_0xd85d('0x1c')]||null:null,'limit':_0x3c8ff5[_0xd85d('0x19')]?_0x3c8ff5[_0xd85d('0x19')]['limit']||null:null,'include':_0x3c8ff5[_0xd85d('0x19')]?_0x3c8ff5[_0xd85d('0x19')]['include']?_[_0xd85d('0x1d')](_0x3c8ff5[_0xd85d('0x19')][_0xd85d('0x1e')],function(_0x294eb7){return{'model':db[_0x294eb7['model']],'as':_0x294eb7['as'],'attributes':_0x294eb7[_0xd85d('0x1c')],'include':_0x294eb7[_0xd85d('0x1e')]?_[_0xd85d('0x1d')](_0x294eb7[_0xd85d('0x1e')],function(_0x230ec2){return{'model':db[_0x230ec2[_0xd85d('0x1f')]],'as':_0x230ec2['as'],'attributes':_0x230ec2[_0xd85d('0x1c')],'include':_0x230ec2[_0xd85d('0x1e')]?_[_0xd85d('0x1d')](_0x230ec2[_0xd85d('0x1e')],function(_0x3ee6c8){return{'model':db[_0x3ee6c8[_0xd85d('0x1f')]],'as':_0x3ee6c8['as'],'attributes':_0x3ee6c8[_0xd85d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd85d('0xd')](function(_0x4971eb){logger['info']('GetVoiceCallReport',_0x3c8ff5);logger[_0xd85d('0x10')](_0xd85d('0x16'),_0x3c8ff5,JSON[_0xd85d('0x20')](_0x4971eb));_0x11bdbf(_0x4971eb);})[_0xd85d('0x21')](function(_0x2a418f){logger[_0xd85d('0x12')]('GetVoiceCallReport',_0x2a418f[_0xd85d('0x13')],_0x3c8ff5);_0x130e5c(_0x4dbb33[_0xd85d('0x12')](0x1f4,_0x2a418f[_0xd85d('0x13')]));});});};exports[_0xd85d('0x22')]=function(_0x59e09f){var _0xffc56a=this;return new Promise(function(_0x5802d4,_0x50ed8d){return db[_0xd85d('0x17')][_0xd85d('0x23')](_0x59e09f[_0xd85d('0x24')],{'raw':_0x59e09f[_0xd85d('0x19')]?_0x59e09f[_0xd85d('0x19')][_0xd85d('0x1a')]===undefined?!![]:![]:!![]})[_0xd85d('0xd')](function(_0xc3acfc){logger['info']('CreateVoiceCallReport',_0x59e09f);logger['debug'](_0xd85d('0x22'),_0x59e09f,JSON[_0xd85d('0x20')](_0xc3acfc));_0x5802d4(_0xc3acfc);})[_0xd85d('0x21')](function(_0x199113){logger['error'](_0xd85d('0x22'),_0x199113[_0xd85d('0x13')],_0x59e09f);_0x50ed8d(_0xffc56a[_0xd85d('0x12')](0x1f4,_0x199113['message']));});});};exports['UpdateVoiceCallReport']=function(_0x9e157f){var _0xb978a2=this;return new Promise(function(_0x28935c,_0x2f19fb){return db[_0xd85d('0x17')][_0xd85d('0x25')](_0x9e157f[_0xd85d('0x24')],{'raw':_0x9e157f[_0xd85d('0x19')]?_0x9e157f['options'][_0xd85d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9e157f[_0xd85d('0x19')]?_0x9e157f['options'][_0xd85d('0x1b')]||null:null,'attributes':_0x9e157f['options']?_0x9e157f[_0xd85d('0x19')]['attributes']||null:null,'limit':_0x9e157f[_0xd85d('0x19')]?_0x9e157f['options'][_0xd85d('0x26')]||null:null})[_0xd85d('0xd')](function(_0x878cf){logger[_0xd85d('0xe')](_0xd85d('0x27'),_0x9e157f);logger[_0xd85d('0x10')](_0xd85d('0x27'),_0x9e157f,JSON[_0xd85d('0x20')](_0x878cf));_0x28935c(_0x878cf);})[_0xd85d('0x21')](function(_0x4f5575){logger[_0xd85d('0x12')](_0xd85d('0x27'),_0x4f5575[_0xd85d('0x13')],_0x9e157f);_0x2f19fb(_0xb978a2['error'](0x1f4,_0x4f5575['message']));});});}; \ No newline at end of file +var _0x028c=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','VoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x22085a,_0x589318){var _0x528c36=function(_0x4bcd66){while(--_0x4bcd66){_0x22085a['push'](_0x22085a['shift']());}};_0x528c36(++_0x589318);}(_0x028c,0x92));var _0xc028=function(_0x21d1eb,_0x56f664){_0x21d1eb=_0x21d1eb-0x0;var _0x4cb8cd=_0x028c[_0x21d1eb];return _0x4cb8cd;};'use strict';var _=require(_0xc028('0x0'));var util=require(_0xc028('0x1'));var moment=require(_0xc028('0x2'));var BPromise=require(_0xc028('0x3'));var rs=require(_0xc028('0x4'));var fs=require('fs');var Redis=require(_0xc028('0x5'));var db=require(_0xc028('0x6'))['db'];var utils=require(_0xc028('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xc028('0x8'));var jayson=require(_0xc028('0x9'));var client=jayson[_0xc028('0xa')][_0xc028('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55c6e4,_0x29673c,_0x50e9bd){return new BPromise(function(_0x156906,_0x2ac6c2){return client['request'](_0x55c6e4,_0x50e9bd)[_0xc028('0xc')](function(_0x40767d){logger[_0xc028('0xd')](_0xc028('0xe'),_0x29673c,_0xc028('0xf'));logger[_0xc028('0x10')](_0xc028('0x11'),_0x29673c,_0xc028('0xf'),JSON[_0xc028('0x12')](_0x40767d));if(_0x40767d[_0xc028('0x13')]){if(_0x40767d[_0xc028('0x13')]['code']===0x1f4){logger[_0xc028('0x13')](_0xc028('0xe'),_0x29673c,_0x40767d[_0xc028('0x13')][_0xc028('0x14')]);return _0x2ac6c2(_0x40767d['error'][_0xc028('0x14')]);}logger['error'](_0xc028('0xe'),_0x29673c,_0x40767d['error'][_0xc028('0x14')]);return _0x156906(_0x40767d[_0xc028('0x13')][_0xc028('0x14')]);}else{logger['info'](_0xc028('0xe'),_0x29673c,_0xc028('0xf'));_0x156906(_0x40767d['result']['message']);}})[_0xc028('0x15')](function(_0x22f005){logger[_0xc028('0x13')](_0xc028('0xe'),_0x29673c,_0x22f005);_0x2ac6c2(_0x22f005);});});}exports[_0xc028('0x16')]=function(_0x1f921c){var _0x108f9d=this;return new Promise(function(_0x352c31,_0x2f4f71){return db['VoiceCallReport'][_0xc028('0x17')]({'raw':_0x1f921c[_0xc028('0x18')]?_0x1f921c[_0xc028('0x18')][_0xc028('0x19')]===undefined?!![]:![]:!![],'where':_0x1f921c[_0xc028('0x18')]?_0x1f921c[_0xc028('0x18')][_0xc028('0x1a')]||null:null,'attributes':_0x1f921c[_0xc028('0x18')]?_0x1f921c[_0xc028('0x18')][_0xc028('0x1b')]||null:null,'limit':_0x1f921c[_0xc028('0x18')]?_0x1f921c[_0xc028('0x18')][_0xc028('0x1c')]||null:null,'include':_0x1f921c[_0xc028('0x18')]?_0x1f921c[_0xc028('0x18')][_0xc028('0x1d')]?_[_0xc028('0x1e')](_0x1f921c['options'][_0xc028('0x1d')],function(_0x2b2aa9){return{'model':db[_0x2b2aa9[_0xc028('0x1f')]],'as':_0x2b2aa9['as'],'attributes':_0x2b2aa9[_0xc028('0x1b')],'include':_0x2b2aa9[_0xc028('0x1d')]?_[_0xc028('0x1e')](_0x2b2aa9[_0xc028('0x1d')],function(_0xea94e8){return{'model':db[_0xea94e8[_0xc028('0x1f')]],'as':_0xea94e8['as'],'attributes':_0xea94e8[_0xc028('0x1b')],'include':_0xea94e8[_0xc028('0x1d')]?_[_0xc028('0x1e')](_0xea94e8[_0xc028('0x1d')],function(_0x268b5a){return{'model':db[_0x268b5a['model']],'as':_0x268b5a['as'],'attributes':_0x268b5a[_0xc028('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc028('0xc')](function(_0x560f09){logger[_0xc028('0xd')](_0xc028('0x16'),_0x1f921c);logger['debug'](_0xc028('0x16'),_0x1f921c,JSON[_0xc028('0x12')](_0x560f09));_0x352c31(_0x560f09);})[_0xc028('0x15')](function(_0x304127){logger['error']('GetVoiceCallReport',_0x304127[_0xc028('0x14')],_0x1f921c);_0x2f4f71(_0x108f9d[_0xc028('0x13')](0x1f4,_0x304127[_0xc028('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x154c82){var _0x19155d=this;return new Promise(function(_0x346ea5,_0x48dc69){return db['VoiceCallReport'][_0xc028('0x20')](_0x154c82[_0xc028('0x21')],{'raw':_0x154c82['options']?_0x154c82[_0xc028('0x18')][_0xc028('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x57a845){logger[_0xc028('0xd')](_0xc028('0x22'),_0x154c82);logger[_0xc028('0x10')]('CreateVoiceCallReport',_0x154c82,JSON[_0xc028('0x12')](_0x57a845));_0x346ea5(_0x57a845);})[_0xc028('0x15')](function(_0x55bdda){logger[_0xc028('0x13')](_0xc028('0x22'),_0x55bdda[_0xc028('0x14')],_0x154c82);_0x48dc69(_0x19155d['error'](0x1f4,_0x55bdda[_0xc028('0x14')]));});});};exports[_0xc028('0x23')]=function(_0x3a56e2){var _0x298d3e=this;return new Promise(function(_0x16f2ae,_0x22d7e2){return db[_0xc028('0x24')][_0xc028('0x25')](_0x3a56e2[_0xc028('0x21')],{'raw':_0x3a56e2[_0xc028('0x18')]?_0x3a56e2[_0xc028('0x18')][_0xc028('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a56e2['options']?_0x3a56e2[_0xc028('0x18')]['where']||null:null,'attributes':_0x3a56e2[_0xc028('0x18')]?_0x3a56e2['options']['attributes']||null:null,'limit':_0x3a56e2[_0xc028('0x18')]?_0x3a56e2['options']['limit']||null:null})[_0xc028('0xc')](function(_0x23b1af){logger['info'](_0xc028('0x23'),_0x3a56e2);logger['debug'](_0xc028('0x23'),_0x3a56e2,JSON[_0xc028('0x12')](_0x23b1af));_0x16f2ae(_0x23b1af);})[_0xc028('0x15')](function(_0x55ba56){logger[_0xc028('0x13')](_0xc028('0x23'),_0x55ba56[_0xc028('0x14')],_0x3a56e2);_0x22d7e2(_0x298d3e['error'](0x1f4,_0x55ba56[_0xc028('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index e9cb306..4b2694d 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 _0x7f59=['destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id','isAuthenticated','show','post','create','delete'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x7f59,0x156));var _0x97f5=function(_0x4e4088,_0x14df21){_0x4e4088=_0x4e4088-0x0;var _0x573fd9=_0x7f59[_0x4e4088];return _0x573fd9;};'use strict';var multer=require('multer');var util=require(_0x97f5('0x0'));var path=require('path');var timeout=require(_0x97f5('0x1'));var express=require(_0x97f5('0x2'));var router=express[_0x97f5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x97f5('0x4'));var config=require(_0x97f5('0x5'));var controller=require(_0x97f5('0x6'));router[_0x97f5('0x7')]('/',auth['isAuthenticated'](),controller[_0x97f5('0x8')]);router['get'](_0x97f5('0x9'),auth[_0x97f5('0xa')](),controller[_0x97f5('0xb')]);router[_0x97f5('0xc')]('/',auth['isAuthenticated'](),controller[_0x97f5('0xd')]);router['put']('/:id',auth[_0x97f5('0xa')](),controller['update']);router[_0x97f5('0xe')](_0x97f5('0x9'),auth[_0x97f5('0xa')](),controller[_0x97f5('0xf')]);module[_0x97f5('0x10')]=router; \ No newline at end of file +var _0xb957=['../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','create','put','destroy','path','express','Router'];(function(_0x1e8f40,_0x154ac7){var _0x466638=function(_0x1ee019){while(--_0x1ee019){_0x1e8f40['push'](_0x1e8f40['shift']());}};_0x466638(++_0x154ac7);}(_0xb957,0x6d));var _0x7b95=function(_0x190764,_0x96731f){_0x190764=_0x190764-0x0;var _0x5c676c=_0xb957[_0x190764];return _0x5c676c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7b95('0x0'));var timeout=require('connect-timeout');var express=require(_0x7b95('0x1'));var router=express[_0x7b95('0x2')]();var auth=require(_0x7b95('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b95('0x4'));var controller=require(_0x7b95('0x5'));router[_0x7b95('0x6')]('/',auth[_0x7b95('0x7')](),controller[_0x7b95('0x8')]);router['get'](_0x7b95('0x9'),auth[_0x7b95('0x7')](),controller[_0x7b95('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b95('0xb')]);router[_0x7b95('0xc')](_0x7b95('0x9'),auth[_0x7b95('0x7')](),controller['update']);router['delete']('/:id',auth[_0x7b95('0x7')](),controller[_0x7b95('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index ff95efd..023d43c 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 _0xf138=['getDataValue','options','split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join'];(function(_0x54e698,_0x4c6d5c){var _0x1eb4a6=function(_0x210a7d){while(--_0x210a7d){_0x54e698['push'](_0x54e698['shift']());}};_0x1eb4a6(++_0x4c6d5c);}(_0xf138,0x176));var _0x8f13=function(_0x3bb083,_0x2b7bba){_0x3bb083=_0x3bb083-0x0;var _0x376962=_0xf138[_0x3bb083];return _0x376962;};'use strict';var Sequelize=require(_0x8f13('0x0'));module[_0x8f13('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8f13('0x2')],'unique':_0x8f13('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x8f13('0x2')],'set':function(_0x1f4397){this[_0x8f13('0x4')]('options',_0x1f4397?_0x1f4397[_0x8f13('0x5')](''):[]);},'get':function(){return this[_0x8f13('0x6')](_0x8f13('0x7'))?this[_0x8f13('0x6')]('options')[_0x8f13('0x8')](''):[];}},'auth':{'type':Sequelize[_0x8f13('0x9')],'defaultValue':![]},'password':{'type':Sequelize[_0x8f13('0x2')]},'record':{'type':Sequelize[_0x8f13('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x8f13('0x2')]},'description':{'type':Sequelize[_0x8f13('0x2')]}}; \ No newline at end of file +var _0x696a=['STRING','name','options','join','getDataValue','split','BOOLEAN','sequelize','exports'];(function(_0x2d0b84,_0x34682d){var _0x8d0088=function(_0x25a584){while(--_0x25a584){_0x2d0b84['push'](_0x2d0b84['shift']());}};_0x8d0088(++_0x34682d);}(_0x696a,0x1b7));var _0xa696=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0x696a[_0x2a5099];return _0x2802f1;};'use strict';var Sequelize=require(_0xa696('0x0'));module[_0xa696('0x1')]={'name':{'type':Sequelize[_0xa696('0x2')]},'prefix':{'type':Sequelize[_0xa696('0x2')],'unique':_0xa696('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x850a1f){this['setDataValue'](_0xa696('0x4'),_0x850a1f?_0x850a1f[_0xa696('0x5')](''):[]);},'get':function(){return this[_0xa696('0x6')](_0xa696('0x4'))?this['getDataValue'](_0xa696('0x4'))[_0xa696('0x7')](''):[];}},'auth':{'type':Sequelize[_0xa696('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xa696('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index bec92bc..2ea1a2a 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 _0x33a6=['rows','params','keys','find','catch','create','user','error','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','set','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','map','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x33a6,0x1dd));var _0x633a=function(_0x59b2c2,_0x4194dc){_0x59b2c2=_0x59b2c2-0x0;var _0x2a40fc=_0x33a6[_0x59b2c2];return _0x2a40fc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x633a('0x0'));var rimraf=require(_0x633a('0x1'));var zipdir=require(_0x633a('0x2'));var jsonpatch=require(_0x633a('0x3'));var rp=require('request-promise');var moment=require(_0x633a('0x4'));var BPromise=require(_0x633a('0x5'));var Mustache=require(_0x633a('0x6'));var util=require(_0x633a('0x7'));var path=require(_0x633a('0x8'));var sox=require(_0x633a('0x9'));var csv=require(_0x633a('0xa'));var ejs=require(_0x633a('0xb'));var fs=require('fs');var _=require(_0x633a('0xc'));var squel=require('squel');var crypto=require(_0x633a('0xd'));var jsforce=require(_0x633a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x633a('0xa'));var querystring=require(_0x633a('0xf'));var Papa=require('papaparse');var Redis=require(_0x633a('0x10'));var authService=require(_0x633a('0x11'));var qs=require(_0x633a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x633a('0x13'));var logger=require(_0x633a('0x14'))(_0x633a('0x15'));var utils=require(_0x633a('0x16'));var config=require(_0x633a('0x17'));var db=require(_0x633a('0x18'))['db'];function respondWithStatusCode(_0x11c123,_0xc21ab9){_0xc21ab9=_0xc21ab9||0xcc;return function(_0x1d7954){if(_0x1d7954){return _0x11c123[_0x633a('0x19')](_0xc21ab9);}return _0x11c123[_0x633a('0x1a')](_0xc21ab9)['end']();};}function respondWithResult(_0x2f1bcb,_0x6db26b){_0x6db26b=_0x6db26b||0xc8;return function(_0x2889ff){if(_0x2889ff){return _0x2f1bcb[_0x633a('0x1a')](_0x6db26b)[_0x633a('0x1b')](_0x2889ff);}};}function respondWithFilteredResult(_0x31e198,_0x49c3c2){return function(_0x2ba900){if(_0x2ba900){var _0x1ea4cb=_0x2ba900[_0x633a('0x1c')],_0x51e9b6=_0x49c3c2['offset'],_0x32cb6e=_0x49c3c2[_0x633a('0x1d')]+_0x49c3c2[_0x633a('0x1e')],_0x132bea;if(_0x32cb6e>=_0x1ea4cb){_0x32cb6e=_0x1ea4cb;_0x132bea=0xc8;}else{_0x132bea=0xce;}_0x31e198[_0x633a('0x1a')](_0x132bea);return _0x31e198[_0x633a('0x1f')]('Content-Range',_0x51e9b6+'-'+_0x32cb6e+'/'+_0x1ea4cb)[_0x633a('0x1b')](_0x2ba900);}return null;};}function patchUpdates(_0x14ed7e){return function(_0x2166f7){try{jsonpatch[_0x633a('0x20')](_0x2166f7,_0x14ed7e,!![]);}catch(_0x25bee1){return BPromise[_0x633a('0x21')](_0x25bee1);}return _0x2166f7[_0x633a('0x22')]();};}function saveUpdates(_0x159a3e,_0x15d97d){return function(_0x1d2c43){if(_0x1d2c43){return _0x1d2c43[_0x633a('0x23')](_0x159a3e)[_0x633a('0x24')](function(_0xb86427){return _0xb86427;});}return null;};}function removeEntity(_0x21a71a,_0x3affa9){return function(_0x5d46ce){if(_0x5d46ce){return _0x5d46ce[_0x633a('0x25')]()['then'](function(){var _0x2398b5=_0x5d46ce[_0x633a('0x26')]({'plain':!![]});var _0x3a5353='ChanSpies';return db[_0x633a('0x27')][_0x633a('0x25')]({'where':{'type':_0x3a5353,'resourceId':_0x2398b5['id']}})['then'](function(){return _0x5d46ce;});})['then'](function(){_0x21a71a[_0x633a('0x1a')](0xcc)[_0x633a('0x28')]();});}};}function handleEntityNotFound(_0x30dcbd,_0x1c8def){return function(_0x5959e4){if(!_0x5959e4){_0x30dcbd[_0x633a('0x19')](0x194);}return _0x5959e4;};}function handleError(_0x50d361,_0x3cf035){_0x3cf035=_0x3cf035||0x1f4;return function(_0x1a05ee){logger['error'](_0x1a05ee[_0x633a('0x29')]);if(_0x1a05ee[_0x633a('0x2a')]){delete _0x1a05ee[_0x633a('0x2a')];}_0x50d361[_0x633a('0x1a')](_0x3cf035)[_0x633a('0x2b')](_0x1a05ee);};}exports[_0x633a('0x2c')]=function(_0x1b6d6b,_0x316eea){var _0x5d6339={},_0x4020a6={},_0x373aad={'count':0x0,'rows':[]};var _0x4b8421=_['map'](db[_0x633a('0x2d')][_0x633a('0x2e')],function(_0x90dc84){return{'name':_0x90dc84[_0x633a('0x2f')],'type':_0x90dc84['type']['key']};});_0x4020a6['model']=_[_0x633a('0x30')](_0x4b8421,'name');_0x4020a6[_0x633a('0x31')]=_['keys'](_0x1b6d6b[_0x633a('0x31')]);_0x4020a6[_0x633a('0x32')]=_[_0x633a('0x33')](_0x4020a6[_0x633a('0x34')],_0x4020a6[_0x633a('0x31')]);_0x5d6339[_0x633a('0x35')]=_['intersection'](_0x4020a6[_0x633a('0x34')],qs[_0x633a('0x36')](_0x1b6d6b[_0x633a('0x31')][_0x633a('0x36')]));_0x5d6339[_0x633a('0x35')]=_0x5d6339['attributes'][_0x633a('0x37')]?_0x5d6339[_0x633a('0x35')]:_0x4020a6['model'];if(!_0x1b6d6b[_0x633a('0x31')]['hasOwnProperty'](_0x633a('0x38'))){_0x5d6339[_0x633a('0x1e')]=qs[_0x633a('0x1e')](_0x1b6d6b[_0x633a('0x31')][_0x633a('0x1e')]);_0x5d6339[_0x633a('0x1d')]=qs[_0x633a('0x1d')](_0x1b6d6b[_0x633a('0x31')][_0x633a('0x1d')]);}_0x5d6339[_0x633a('0x39')]=qs['sort'](_0x1b6d6b['query'][_0x633a('0x3a')]);_0x5d6339[_0x633a('0x3b')]=qs[_0x633a('0x32')](_[_0x633a('0x3c')](_0x1b6d6b['query'],_0x4020a6['filters']),_0x4b8421);if(_0x1b6d6b['query'][_0x633a('0x3d')]){_0x5d6339['where']=_[_0x633a('0x3e')](_0x5d6339[_0x633a('0x3b')],{'$or':_[_0x633a('0x30')](_0x4b8421,function(_0x4f341c){if(_0x4f341c[_0x633a('0x3f')]!==_0x633a('0x40')){var _0x8e0979={};_0x8e0979[_0x4f341c[_0x633a('0x2a')]]={'$like':'%'+_0x1b6d6b[_0x633a('0x31')][_0x633a('0x3d')]+'%'};return _0x8e0979;}})});}_0x5d6339=_['merge']({},_0x5d6339,_0x1b6d6b[_0x633a('0x41')]);var _0x46272f={'where':_0x5d6339[_0x633a('0x3b')]};return db[_0x633a('0x2d')]['count'](_0x46272f)[_0x633a('0x24')](function(_0x3ffed8){_0x373aad[_0x633a('0x1c')]=_0x3ffed8;if(_0x1b6d6b[_0x633a('0x31')][_0x633a('0x42')]){_0x5d6339[_0x633a('0x43')]=[{'all':!![]}];}return db[_0x633a('0x2d')][_0x633a('0x44')](_0x5d6339);})[_0x633a('0x24')](function(_0x3d5656){_0x373aad[_0x633a('0x45')]=_0x3d5656;return _0x373aad;})[_0x633a('0x24')](respondWithFilteredResult(_0x316eea,_0x5d6339))['catch'](handleError(_0x316eea,null));};exports['show']=function(_0x234ee9,_0x295d56){var _0x4b2106={'raw':![],'where':{'id':_0x234ee9[_0x633a('0x46')]['id']}},_0x3c54e3={};_0x3c54e3[_0x633a('0x34')]=_[_0x633a('0x47')](db[_0x633a('0x2d')]['rawAttributes']);_0x3c54e3['query']=_[_0x633a('0x47')](_0x234ee9[_0x633a('0x31')]);_0x3c54e3[_0x633a('0x32')]=_[_0x633a('0x33')](_0x3c54e3[_0x633a('0x34')],_0x3c54e3['query']);_0x4b2106[_0x633a('0x35')]=_[_0x633a('0x33')](_0x3c54e3[_0x633a('0x34')],qs[_0x633a('0x36')](_0x234ee9['query'][_0x633a('0x36')]));_0x4b2106[_0x633a('0x35')]=_0x4b2106['attributes'][_0x633a('0x37')]?_0x4b2106[_0x633a('0x35')]:_0x3c54e3[_0x633a('0x34')];if(_0x234ee9[_0x633a('0x31')][_0x633a('0x42')]){_0x4b2106[_0x633a('0x43')]=[{'all':!![]}];}_0x4b2106=_[_0x633a('0x3e')]({},_0x4b2106,_0x234ee9[_0x633a('0x41')]);return db[_0x633a('0x2d')][_0x633a('0x48')](_0x4b2106)[_0x633a('0x24')](handleEntityNotFound(_0x295d56,null))[_0x633a('0x24')](respondWithResult(_0x295d56,null))[_0x633a('0x49')](handleError(_0x295d56,null));};exports[_0x633a('0x4a')]=function(_0x301948,_0x1ab6b6){return db['VoiceChanSpy'][_0x633a('0x4a')](_0x301948['body'],{})[_0x633a('0x24')](function(_0x5b96d2){var _0xe52c7f=_0x301948[_0x633a('0x4b')][_0x633a('0x26')]({'plain':!![]});if(!_0xe52c7f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe52c7f['role']===_0x633a('0x4b')){var _0x2b1bf6=_0x5b96d2[_0x633a('0x26')]({'plain':!![]});var _0x25bd6a='ChanSpies';return db['UserProfileSection'][_0x633a('0x48')]({'where':{'name':_0x25bd6a,'userProfileId':_0xe52c7f['userProfileId']},'raw':!![]})[_0x633a('0x24')](function(_0xc856d2){if(_0xc856d2&&_0xc856d2['autoAssociation']===0x0){return db['UserProfileResource'][_0x633a('0x4a')]({'name':_0x2b1bf6[_0x633a('0x2a')],'resourceId':_0x2b1bf6['id'],'type':_0xc856d2['name'],'sectionId':_0xc856d2['id']},{})[_0x633a('0x24')](function(){return _0x5b96d2;});}else{return _0x5b96d2;}})[_0x633a('0x49')](function(_0x3e1283){logger[_0x633a('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e1283);throw _0x3e1283;});}return _0x5b96d2;})[_0x633a('0x24')](respondWithResult(_0x1ab6b6,0xc9))[_0x633a('0x49')](handleError(_0x1ab6b6,null));};exports['update']=function(_0x404da8,_0x1f449b){if(_0x404da8[_0x633a('0x4d')]['id']){delete _0x404da8[_0x633a('0x4d')]['id'];}return db[_0x633a('0x2d')][_0x633a('0x48')]({'where':{'id':_0x404da8[_0x633a('0x46')]['id']}})[_0x633a('0x24')](handleEntityNotFound(_0x1f449b,null))['then'](saveUpdates(_0x404da8[_0x633a('0x4d')],null))[_0x633a('0x24')](respondWithResult(_0x1f449b,null))[_0x633a('0x49')](handleError(_0x1f449b,null));};exports[_0x633a('0x25')]=function(_0x243278,_0x3ddfcc){return db[_0x633a('0x2d')][_0x633a('0x48')]({'where':{'id':_0x243278['params']['id']}})['then'](handleEntityNotFound(_0x3ddfcc,null))[_0x633a('0x24')](removeEntity(_0x3ddfcc,null))['catch'](handleError(_0x3ddfcc,null));}; \ No newline at end of file +var _0x5c29=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','userProfileId','autoAssociation','error','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','end','stack','name','index','map','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','VoiceChanSpy','findAll','rows','show','rawAttributes','options','find','catch'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x5c29,0x18e));var _0x95c2=function(_0x3c44b5,_0x130004){_0x3c44b5=_0x3c44b5-0x0;var _0x514e86=_0x5c29[_0x3c44b5];return _0x514e86;};'use strict';var pdf=require(_0x95c2('0x0'));var emlformat=require(_0x95c2('0x1'));var rimraf=require(_0x95c2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95c2('0x3'));var rp=require(_0x95c2('0x4'));var moment=require(_0x95c2('0x5'));var BPromise=require(_0x95c2('0x6'));var Mustache=require(_0x95c2('0x7'));var util=require(_0x95c2('0x8'));var path=require(_0x95c2('0x9'));var sox=require(_0x95c2('0xa'));var csv=require(_0x95c2('0xb'));var ejs=require(_0x95c2('0xc'));var fs=require('fs');var _=require(_0x95c2('0xd'));var squel=require(_0x95c2('0xe'));var crypto=require(_0x95c2('0xf'));var jsforce=require(_0x95c2('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x95c2('0x11'));var Papa=require(_0x95c2('0x12'));var Redis=require(_0x95c2('0x13'));var authService=require(_0x95c2('0x14'));var qs=require(_0x95c2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x95c2('0x16'));var utils=require(_0x95c2('0x17'));var config=require('../../config/environment');var db=require(_0x95c2('0x18'))['db'];function respondWithStatusCode(_0x37b0b0,_0x151cc7){_0x151cc7=_0x151cc7||0xcc;return function(_0x440a8e){if(_0x440a8e){return _0x37b0b0['sendStatus'](_0x151cc7);}return _0x37b0b0[_0x95c2('0x19')](_0x151cc7)['end']();};}function respondWithResult(_0x4f1155,_0x5cfb28){_0x5cfb28=_0x5cfb28||0xc8;return function(_0x5f3e7d){if(_0x5f3e7d){return _0x4f1155[_0x95c2('0x19')](_0x5cfb28)[_0x95c2('0x1a')](_0x5f3e7d);}};}function respondWithFilteredResult(_0xabda4e,_0x25ff65){return function(_0x340154){if(_0x340154){var _0x110f39=_0x340154[_0x95c2('0x1b')],_0x12cd25=_0x25ff65['offset'],_0x36dfda=_0x25ff65[_0x95c2('0x1c')]+_0x25ff65[_0x95c2('0x1d')],_0x23ad8b;if(_0x36dfda>=_0x110f39){_0x36dfda=_0x110f39;_0x23ad8b=0xc8;}else{_0x23ad8b=0xce;}_0xabda4e[_0x95c2('0x19')](_0x23ad8b);return _0xabda4e['set'](_0x95c2('0x1e'),_0x12cd25+'-'+_0x36dfda+'/'+_0x110f39)[_0x95c2('0x1a')](_0x340154);}return null;};}function patchUpdates(_0x1ee282){return function(_0x264a6b){try{jsonpatch[_0x95c2('0x1f')](_0x264a6b,_0x1ee282,!![]);}catch(_0x4edcf7){return BPromise[_0x95c2('0x20')](_0x4edcf7);}return _0x264a6b['save']();};}function saveUpdates(_0x2766c6,_0x5d5399){return function(_0x3e1283){if(_0x3e1283){return _0x3e1283[_0x95c2('0x21')](_0x2766c6)[_0x95c2('0x22')](function(_0x221117){return _0x221117;});}return null;};}function removeEntity(_0x174fcd,_0x2556fa){return function(_0x3b387b){if(_0x3b387b){return _0x3b387b[_0x95c2('0x23')]()[_0x95c2('0x22')](function(){var _0x4f1f3c=_0x3b387b['get']({'plain':!![]});var _0x251676='ChanSpies';return db['UserProfileResource'][_0x95c2('0x23')]({'where':{'type':_0x251676,'resourceId':_0x4f1f3c['id']}})['then'](function(){return _0x3b387b;});})[_0x95c2('0x22')](function(){_0x174fcd['status'](0xcc)[_0x95c2('0x24')]();});}};}function handleEntityNotFound(_0x43d37b,_0x5d6402){return function(_0x8524f0){if(!_0x8524f0){_0x43d37b['sendStatus'](0x194);}return _0x8524f0;};}function handleError(_0x4396b5,_0x6b1858){_0x6b1858=_0x6b1858||0x1f4;return function(_0x50d63d){logger['error'](_0x50d63d[_0x95c2('0x25')]);if(_0x50d63d[_0x95c2('0x26')]){delete _0x50d63d[_0x95c2('0x26')];}_0x4396b5[_0x95c2('0x19')](_0x6b1858)['send'](_0x50d63d);};}exports[_0x95c2('0x27')]=function(_0x26f55a,_0x935c9e){var _0x450d4a={},_0xa8c54f={},_0x5cfa8a={'count':0x0,'rows':[]};var _0x1bbe4f=_[_0x95c2('0x28')](db['VoiceChanSpy']['rawAttributes'],function(_0x4476b8){return{'name':_0x4476b8[_0x95c2('0x29')],'type':_0x4476b8[_0x95c2('0x2a')]['key']};});_0xa8c54f[_0x95c2('0x2b')]=_[_0x95c2('0x28')](_0x1bbe4f,_0x95c2('0x26'));_0xa8c54f['query']=_[_0x95c2('0x2c')](_0x26f55a[_0x95c2('0x2d')]);_0xa8c54f[_0x95c2('0x2e')]=_[_0x95c2('0x2f')](_0xa8c54f[_0x95c2('0x2b')],_0xa8c54f[_0x95c2('0x2d')]);_0x450d4a[_0x95c2('0x30')]=_['intersection'](_0xa8c54f[_0x95c2('0x2b')],qs['fields'](_0x26f55a[_0x95c2('0x2d')][_0x95c2('0x31')]));_0x450d4a[_0x95c2('0x30')]=_0x450d4a['attributes'][_0x95c2('0x32')]?_0x450d4a[_0x95c2('0x30')]:_0xa8c54f['model'];if(!_0x26f55a[_0x95c2('0x2d')][_0x95c2('0x33')](_0x95c2('0x34'))){_0x450d4a[_0x95c2('0x1d')]=qs[_0x95c2('0x1d')](_0x26f55a[_0x95c2('0x2d')]['limit']);_0x450d4a[_0x95c2('0x1c')]=qs[_0x95c2('0x1c')](_0x26f55a['query'][_0x95c2('0x1c')]);}_0x450d4a[_0x95c2('0x35')]=qs[_0x95c2('0x36')](_0x26f55a['query'][_0x95c2('0x36')]);_0x450d4a[_0x95c2('0x37')]=qs[_0x95c2('0x2e')](_[_0x95c2('0x38')](_0x26f55a['query'],_0xa8c54f[_0x95c2('0x2e')]),_0x1bbe4f);if(_0x26f55a['query'][_0x95c2('0x39')]){_0x450d4a[_0x95c2('0x37')]=_['merge'](_0x450d4a[_0x95c2('0x37')],{'$or':_[_0x95c2('0x28')](_0x1bbe4f,function(_0x3c6239){if(_0x3c6239['type']!==_0x95c2('0x3a')){var _0x17eacc={};_0x17eacc[_0x3c6239['name']]={'$like':'%'+_0x26f55a[_0x95c2('0x2d')]['filter']+'%'};return _0x17eacc;}})});}_0x450d4a=_[_0x95c2('0x3b')]({},_0x450d4a,_0x26f55a['options']);var _0x33a0d7={'where':_0x450d4a[_0x95c2('0x37')]};return db['VoiceChanSpy'][_0x95c2('0x1b')](_0x33a0d7)[_0x95c2('0x22')](function(_0x4035be){_0x5cfa8a[_0x95c2('0x1b')]=_0x4035be;if(_0x26f55a[_0x95c2('0x2d')][_0x95c2('0x3c')]){_0x450d4a[_0x95c2('0x3d')]=[{'all':!![]}];}return db[_0x95c2('0x3e')][_0x95c2('0x3f')](_0x450d4a);})['then'](function(_0x529211){_0x5cfa8a[_0x95c2('0x40')]=_0x529211;return _0x5cfa8a;})[_0x95c2('0x22')](respondWithFilteredResult(_0x935c9e,_0x450d4a))['catch'](handleError(_0x935c9e,null));};exports[_0x95c2('0x41')]=function(_0x427b31,_0x1acbcb){var _0x20e516={'raw':![],'where':{'id':_0x427b31['params']['id']}},_0x2c1581={};_0x2c1581[_0x95c2('0x2b')]=_['keys'](db[_0x95c2('0x3e')][_0x95c2('0x42')]);_0x2c1581['query']=_[_0x95c2('0x2c')](_0x427b31[_0x95c2('0x2d')]);_0x2c1581[_0x95c2('0x2e')]=_[_0x95c2('0x2f')](_0x2c1581['model'],_0x2c1581[_0x95c2('0x2d')]);_0x20e516[_0x95c2('0x30')]=_['intersection'](_0x2c1581[_0x95c2('0x2b')],qs[_0x95c2('0x31')](_0x427b31['query']['fields']));_0x20e516[_0x95c2('0x30')]=_0x20e516['attributes'][_0x95c2('0x32')]?_0x20e516[_0x95c2('0x30')]:_0x2c1581[_0x95c2('0x2b')];if(_0x427b31[_0x95c2('0x2d')]['includeAll']){_0x20e516[_0x95c2('0x3d')]=[{'all':!![]}];}_0x20e516=_['merge']({},_0x20e516,_0x427b31[_0x95c2('0x43')]);return db[_0x95c2('0x3e')][_0x95c2('0x44')](_0x20e516)['then'](handleEntityNotFound(_0x1acbcb,null))[_0x95c2('0x22')](respondWithResult(_0x1acbcb,null))[_0x95c2('0x45')](handleError(_0x1acbcb,null));};exports['create']=function(_0x5044eb,_0x2f2d80){return db[_0x95c2('0x3e')][_0x95c2('0x46')](_0x5044eb[_0x95c2('0x47')],{})['then'](function(_0x442be4){var _0x1b6f8d=_0x5044eb['user']['get']({'plain':!![]});if(!_0x1b6f8d)throw new Error(_0x95c2('0x48'));if(_0x1b6f8d['role']===_0x95c2('0x49')){var _0x6e226d=_0x442be4[_0x95c2('0x4a')]({'plain':!![]});var _0x2588f9='ChanSpies';return db['UserProfileSection']['find']({'where':{'name':_0x2588f9,'userProfileId':_0x1b6f8d[_0x95c2('0x4b')]},'raw':!![]})[_0x95c2('0x22')](function(_0xccdace){if(_0xccdace&&_0xccdace[_0x95c2('0x4c')]===0x0){return db['UserProfileResource'][_0x95c2('0x46')]({'name':_0x6e226d[_0x95c2('0x26')],'resourceId':_0x6e226d['id'],'type':_0xccdace[_0x95c2('0x26')],'sectionId':_0xccdace['id']},{})[_0x95c2('0x22')](function(){return _0x442be4;});}else{return _0x442be4;}})[_0x95c2('0x45')](function(_0x13701f){logger[_0x95c2('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13701f);throw _0x13701f;});}return _0x442be4;})[_0x95c2('0x22')](respondWithResult(_0x2f2d80,0xc9))[_0x95c2('0x45')](handleError(_0x2f2d80,null));};exports[_0x95c2('0x21')]=function(_0x306f92,_0x5a8391){if(_0x306f92[_0x95c2('0x47')]['id']){delete _0x306f92[_0x95c2('0x47')]['id'];}return db[_0x95c2('0x3e')][_0x95c2('0x44')]({'where':{'id':_0x306f92['params']['id']}})[_0x95c2('0x22')](handleEntityNotFound(_0x5a8391,null))[_0x95c2('0x22')](saveUpdates(_0x306f92[_0x95c2('0x47')],null))['then'](respondWithResult(_0x5a8391,null))[_0x95c2('0x45')](handleError(_0x5a8391,null));};exports[_0x95c2('0x23')]=function(_0x473ac3,_0x23bd20){return db[_0x95c2('0x3e')]['find']({'where':{'id':_0x473ac3['params']['id']}})['then'](handleEntityNotFound(_0x23bd20,null))['then'](removeEntity(_0x23bd20,null))[_0x95c2('0x45')](handleError(_0x23bd20,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 770c8fd..0c4a1b6 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 _0x4517=['length','concat','internal','User','findAll','agent','then','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','catch','destroy','bulkCreate','util','bluebird','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','password','ChanSpy','name','options','join','StopMixMonitor'];(function(_0x1e487b,_0xd6ae88){var _0x140e87=function(_0x3b6f9d){while(--_0x3b6f9d){_0x1e487b['push'](_0x1e487b['shift']());}};_0x140e87(++_0xd6ae88);}(_0x4517,0x112));var _0x7451=function(_0x55ebb2,_0x15a899){_0x55ebb2=_0x55ebb2-0x0;var _0x29c39c=_0x4517[_0x55ebb2];return _0x29c39c;};'use strict';var _=require('lodash');var util=require(_0x7451('0x0'));var BPromise=require(_0x7451('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x121fa7,_0xd66e4,_0x24505e){var _0x286bf4=0x1;var _0x355fbd=[];var _0x21b34c={'context':_0xd66e4[_0x7451('0x2')]||_0x7451('0x3'),'exten':util[_0x7451('0x4')](_0x7451('0x5'),_0x121fa7[_0x7451('0x6')],_0x24505e),'type':_0x7451('0x7'),'isApp':![],'ChanSpyId':_0x121fa7['id'],'UserId':_0xd66e4['id']};_0x355fbd[_0x7451('0x8')](_[_0x7451('0x9')]({'app':_0x7451('0xa'),'appdata':util[_0x7451('0x4')](_0x7451('0xb'),'chanspy'),'priority':_0x286bf4++},_0x21b34c));if(_0x121fa7[_0x7451('0xc')]){_0x355fbd[_0x7451('0x8')](_[_0x7451('0x9')]({'app':_0x7451('0xd'),'appdata':util[_0x7451('0x4')](_0x7451('0xe'),_0x121fa7[_0x7451('0xf')]),'priority':_0x286bf4++},_0x21b34c));}if(_0x121fa7['auth']){_0x355fbd['push'](_[_0x7451('0x9')]({'app':'Authenticate','appdata':_0x121fa7[_0x7451('0x10')],'priority':_0x286bf4++},_0x21b34c));}_0x355fbd[_0x7451('0x8')](_['merge']({'app':_0x7451('0x11'),'appdata':util[_0x7451('0x4')]('SIP/%s,%s',_0xd66e4[_0x7451('0x12')],_0x121fa7[_0x7451('0x13')]?_0x121fa7[_0x7451('0x13')][_0x7451('0x14')](''):''),'priority':_0x286bf4++},_0x21b34c));if(_0x121fa7['record']){_0x355fbd[_0x7451('0x8')](_[_0x7451('0x9')]({'app':_0x7451('0x15'),'priority':_0x286bf4++},_0x21b34c));}return _0x355fbd;};var getChanSpyApplications=function(_0x58c0cd,_0x4c9e54){var _0xfa4258=[];for(var _0x1db688=0x0,_0x508229=0x1;_0x1db688<_0x4c9e54[_0x7451('0x16')];_0x1db688++,_0x508229=0x1){_0xfa4258=_0xfa4258[_0x7451('0x17')](getUserApplications(_0x58c0cd,_0x4c9e54[_0x1db688],_0x4c9e54[_0x1db688][_0x7451('0x18')]));if(_0x4c9e54[_0x1db688][_0x7451('0x18')]!=_0x4c9e54[_0x1db688][_0x7451('0x12')]){_0xfa4258=_0xfa4258[_0x7451('0x17')](getUserApplications(_0x58c0cd,_0x4c9e54[_0x1db688],_0x4c9e54[_0x1db688]['name']));}}return _0xfa4258;};var getChanSpyPromise=function(_0x40dc78,_0x32e250){return new BPromise(function(_0x19c952,_0x59e07e){return _0x40dc78[_0x7451('0x19')][_0x7451('0x1a')]({'attributes':['id',_0x7451('0x12'),_0x7451('0x18')],'where':{'role':_0x7451('0x1b'),'chanspy':!![]},'raw':!![]})[_0x7451('0x1c')](function(_0x29f0bd){if(_0x29f0bd){return _0x19c952(getChanSpyApplications(_0x32e250,_0x29f0bd));}return _0x19c952([]);})['catch'](function(_0x3a0c1e){_0x59e07e(_0x3a0c1e);});});};module[_0x7451('0x1d')]=function(_0x561e12,_0x406b03){var _0x15c59b=_0x561e12[_0x7451('0x1e')];return _0x561e12['define'](_0x7451('0x1f'),attributes,{'tableName':_0x7451('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x21cc22,_0x1fc076,_0x37bc47){return getChanSpyPromise(_0x15c59b,_0x21cc22)[_0x7451('0x1c')](function(_0x3c56f1){if(_0x3c56f1&&_0x3c56f1[_0x7451('0x16')]){return _0x15c59b[_0x7451('0x21')]['bulkCreate'](_0x3c56f1);}})[_0x7451('0x1c')](function(){_0x37bc47();})[_0x7451('0x22')](function(_0x5df311){_0x37bc47(_0x5df311);});},'afterUpdate':function(_0x54bef8,_0xcc793e,_0x1edcf2){return _0x15c59b[_0x7451('0x21')][_0x7451('0x23')]({'where':{'ChanSpyId':_0x54bef8['id']}})[_0x7451('0x1c')](function(){return getChanSpyPromise(_0x15c59b,_0x54bef8);})[_0x7451('0x1c')](function(_0x4b5b26){if(_0x4b5b26&&_0x4b5b26[_0x7451('0x16')]){return _0x15c59b['VoiceExtension'][_0x7451('0x24')](_0x4b5b26);}})[_0x7451('0x1c')](function(){_0x1edcf2();})['catch'](function(_0x7da05a){_0x1edcf2(_0x7da05a);});},'afterDestroy':function(_0x4323b7,_0x40b6c3,_0x3a397e){return _0x15c59b[_0x7451('0x21')]['destroy']({'where':{'ChanSpyId':_0x4323b7['id']}})[_0x7451('0x1c')](function(){_0x3a397e();})[_0x7451('0x22')](function(_0x24ed91){_0x3a397e(_0x24ed91);});}}});}; \ No newline at end of file +var _0x1c42=['name','options','join','length','concat','internal','User','agent','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','then','catch','destroy','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','merge','CDR(type)=%s','chanspy','record','push','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','SIP/%s,%s'];(function(_0x410f95,_0x5d20d7){var _0x443b77=function(_0xca1ce6){while(--_0xca1ce6){_0x410f95['push'](_0x410f95['shift']());}};_0x443b77(++_0x5d20d7);}(_0x1c42,0x13a));var _0x21c4=function(_0x5485df,_0x1d114c){_0x5485df=_0x5485df-0x0;var _0x9592d7=_0x1c42[_0x5485df];return _0x9592d7;};'use strict';var _=require('lodash');var util=require(_0x21c4('0x0'));var BPromise=require(_0x21c4('0x1'));var attributes=require(_0x21c4('0x2'));var getUserApplications=function(_0x558257,_0x27cb4a,_0x40bc3e){var _0x1512d2=0x1;var _0xd7340=[];var _0x435179={'context':_0x27cb4a[_0x21c4('0x3')]||_0x21c4('0x4'),'exten':util[_0x21c4('0x5')]('%s%s',_0x558257[_0x21c4('0x6')],_0x40bc3e),'type':_0x21c4('0x7'),'isApp':![],'ChanSpyId':_0x558257['id'],'UserId':_0x27cb4a['id']};_0xd7340['push'](_[_0x21c4('0x8')]({'app':'Set','appdata':util[_0x21c4('0x5')](_0x21c4('0x9'),_0x21c4('0xa')),'priority':_0x1512d2++},_0x435179));if(_0x558257[_0x21c4('0xb')]){_0xd7340[_0x21c4('0xc')](_[_0x21c4('0x8')]({'app':_0x21c4('0xd'),'appdata':util[_0x21c4('0x5')](_0x21c4('0xe'),_0x558257['recordingFormat']),'priority':_0x1512d2++},_0x435179));}if(_0x558257[_0x21c4('0xf')]){_0xd7340['push'](_[_0x21c4('0x8')]({'app':'Authenticate','appdata':_0x558257[_0x21c4('0x10')],'priority':_0x1512d2++},_0x435179));}_0xd7340[_0x21c4('0xc')](_[_0x21c4('0x8')]({'app':_0x21c4('0x11'),'appdata':util[_0x21c4('0x5')](_0x21c4('0x12'),_0x27cb4a[_0x21c4('0x13')],_0x558257[_0x21c4('0x14')]?_0x558257[_0x21c4('0x14')][_0x21c4('0x15')](''):''),'priority':_0x1512d2++},_0x435179));if(_0x558257[_0x21c4('0xb')]){_0xd7340[_0x21c4('0xc')](_[_0x21c4('0x8')]({'app':'StopMixMonitor','priority':_0x1512d2++},_0x435179));}return _0xd7340;};var getChanSpyApplications=function(_0x50b3fd,_0x1ffed2){var _0x16d659=[];for(var _0x230dce=0x0,_0x3d5a51=0x1;_0x230dce<_0x1ffed2[_0x21c4('0x16')];_0x230dce++,_0x3d5a51=0x1){_0x16d659=_0x16d659[_0x21c4('0x17')](getUserApplications(_0x50b3fd,_0x1ffed2[_0x230dce],_0x1ffed2[_0x230dce][_0x21c4('0x18')]));if(_0x1ffed2[_0x230dce][_0x21c4('0x18')]!=_0x1ffed2[_0x230dce][_0x21c4('0x13')]){_0x16d659=_0x16d659[_0x21c4('0x17')](getUserApplications(_0x50b3fd,_0x1ffed2[_0x230dce],_0x1ffed2[_0x230dce][_0x21c4('0x13')]));}}return _0x16d659;};var getChanSpyPromise=function(_0x122cf3,_0x2b627a){return new BPromise(function(_0x3564da,_0x2d0bf4){return _0x122cf3[_0x21c4('0x19')]['findAll']({'attributes':['id','name',_0x21c4('0x18')],'where':{'role':_0x21c4('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x3fab03){if(_0x3fab03){return _0x3564da(getChanSpyApplications(_0x2b627a,_0x3fab03));}return _0x3564da([]);})['catch'](function(_0x2a58c0){_0x2d0bf4(_0x2a58c0);});});};module[_0x21c4('0x1b')]=function(_0x42091a,_0x20e4c5){var _0x2f9e3b=_0x42091a[_0x21c4('0x1c')];return _0x42091a[_0x21c4('0x1d')](_0x21c4('0x1e'),attributes,{'tableName':_0x21c4('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x58c25f,_0x48abbc,_0x159fb0){return getChanSpyPromise(_0x2f9e3b,_0x58c25f)['then'](function(_0x59af96){if(_0x59af96&&_0x59af96[_0x21c4('0x16')]){return _0x2f9e3b[_0x21c4('0x20')][_0x21c4('0x21')](_0x59af96);}})[_0x21c4('0x22')](function(){_0x159fb0();})[_0x21c4('0x23')](function(_0x4923c4){_0x159fb0(_0x4923c4);});},'afterUpdate':function(_0x29e678,_0x3ef9b4,_0x5013d2){return _0x2f9e3b[_0x21c4('0x20')][_0x21c4('0x24')]({'where':{'ChanSpyId':_0x29e678['id']}})[_0x21c4('0x22')](function(){return getChanSpyPromise(_0x2f9e3b,_0x29e678);})['then'](function(_0x4c143d){if(_0x4c143d&&_0x4c143d[_0x21c4('0x16')]){return _0x2f9e3b[_0x21c4('0x20')][_0x21c4('0x21')](_0x4c143d);}})[_0x21c4('0x22')](function(){_0x5013d2();})[_0x21c4('0x23')](function(_0x5c7760){_0x5013d2(_0x5c7760);});},'afterDestroy':function(_0x5c6b55,_0x5017ac,_0x5151b2){return _0x2f9e3b[_0x21c4('0x20')]['destroy']({'where':{'ChanSpyId':_0x5c6b55['id']}})['then'](function(){_0x5151b2();})['catch'](function(_0xf9ec39){_0x5151b2(_0xf9ec39);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 399cc96..b004785 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 _0x926a=['../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x531fdc,_0x4f2cdd){var _0x53f2db=function(_0x2056c7){while(--_0x2056c7){_0x531fdc['push'](_0x531fdc['shift']());}};_0x53f2db(++_0x4f2cdd);}(_0x926a,0x120));var _0xa926=function(_0x1c80b2,_0x3985bf){_0x1c80b2=_0x1c80b2-0x0;var _0x5b5cf2=_0x926a[_0x1c80b2];return _0x5b5cf2;};'use strict';var _=require(_0xa926('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa926('0x1'));var rs=require(_0xa926('0x2'));var fs=require('fs');var Redis=require(_0xa926('0x3'));var db=require(_0xa926('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa926('0x5'));var config=require(_0xa926('0x6'));var jayson=require(_0xa926('0x7'));var client=jayson[_0xa926('0x8')][_0xa926('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2760e0,_0x548d1e,_0x195a92){return new BPromise(function(_0x48b2a5,_0x5cecad){return client['request'](_0x2760e0,_0x195a92)[_0xa926('0xa')](function(_0x488cb2){logger[_0xa926('0xb')](_0xa926('0xc'),_0x548d1e,_0xa926('0xd'));logger[_0xa926('0xe')](_0xa926('0xf'),_0x548d1e,_0xa926('0xd'),JSON['stringify'](_0x488cb2));if(_0x488cb2[_0xa926('0x10')]){if(_0x488cb2['error'][_0xa926('0x11')]===0x1f4){logger[_0xa926('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x548d1e,_0x488cb2['error']['message']);return _0x5cecad(_0x488cb2[_0xa926('0x10')][_0xa926('0x12')]);}logger['error'](_0xa926('0xc'),_0x548d1e,_0x488cb2['error'][_0xa926('0x12')]);return _0x48b2a5(_0x488cb2[_0xa926('0x10')][_0xa926('0x12')]);}else{logger[_0xa926('0xb')](_0xa926('0xc'),_0x548d1e,_0xa926('0xd'));_0x48b2a5(_0x488cb2[_0xa926('0x13')][_0xa926('0x12')]);}})[_0xa926('0x14')](function(_0x4708aa){logger['error'](_0xa926('0xc'),_0x548d1e,_0x4708aa);_0x5cecad(_0x4708aa);});});} \ No newline at end of file +var _0x847a=['error','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1e34ee,_0x38c254){var _0x5486ff=function(_0x203a7c){while(--_0x203a7c){_0x1e34ee['push'](_0x1e34ee['shift']());}};_0x5486ff(++_0x38c254);}(_0x847a,0xae));var _0xa847=function(_0x4e894f,_0x16389e){_0x4e894f=_0x4e894f-0x0;var _0x926a8e=_0x847a[_0x4e894f];return _0x926a8e;};'use strict';var _=require(_0xa847('0x0'));var util=require('util');var moment=require(_0xa847('0x1'));var BPromise=require(_0xa847('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa847('0x3'));var db=require(_0xa847('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa847('0x5'))(_0xa847('0x6'));var config=require(_0xa847('0x7'));var jayson=require(_0xa847('0x8'));var client=jayson[_0xa847('0x9')][_0xa847('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17302b,_0x3dbdf5,_0x19abaf){return new BPromise(function(_0x237796,_0x154852){return client['request'](_0x17302b,_0x19abaf)[_0xa847('0xb')](function(_0x116c1b){logger[_0xa847('0xc')](_0xa847('0xd'),_0x3dbdf5,_0xa847('0xe'));logger[_0xa847('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x3dbdf5,'request\x20sent',JSON['stringify'](_0x116c1b));if(_0x116c1b[_0xa847('0x10')]){if(_0x116c1b['error']['code']===0x1f4){logger[_0xa847('0x10')](_0xa847('0xd'),_0x3dbdf5,_0x116c1b[_0xa847('0x10')][_0xa847('0x11')]);return _0x154852(_0x116c1b[_0xa847('0x10')]['message']);}logger[_0xa847('0x10')](_0xa847('0xd'),_0x3dbdf5,_0x116c1b[_0xa847('0x10')][_0xa847('0x11')]);return _0x237796(_0x116c1b[_0xa847('0x10')][_0xa847('0x11')]);}else{logger[_0xa847('0xc')](_0xa847('0xd'),_0x3dbdf5,_0xa847('0xe'));_0x237796(_0x116c1b[_0xa847('0x12')][_0xa847('0x11')]);}})['catch'](function(_0x2e7c4a){logger['error'](_0xa847('0xd'),_0x3dbdf5,_0x2e7c4a);_0x154852(_0x2e7c4a);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 8eaee61..5b91d34 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 _0x193d=['/:id','update','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','show','create','put'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x193d,0x125));var _0xd193=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x193d[_0x59d89e];return _0x554e93;};'use strict';var multer=require('multer');var util=require(_0xd193('0x0'));var path=require(_0xd193('0x1'));var timeout=require('connect-timeout');var express=require(_0xd193('0x2'));var router=express[_0xd193('0x3')]();var auth=require(_0xd193('0x4'));var interaction=require(_0xd193('0x5'));var config=require(_0xd193('0x6'));var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xd193('0x7')]);router[_0xd193('0x8')]('/:id',auth[_0xd193('0x9')](),controller[_0xd193('0xa')]);router['post']('/',auth[_0xd193('0x9')](),controller[_0xd193('0xb')]);router[_0xd193('0xc')](_0xd193('0xd'),auth[_0xd193('0x9')](),controller[_0xd193('0xe')]);router['delete'](_0xd193('0xd'),auth[_0xd193('0x9')](),controller[_0xd193('0xf')]);module[_0xd193('0x10')]=router; \ No newline at end of file +var _0xef95=['./voiceContext.controller','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2f8b44,_0x5b7cc9){var _0x494cc5=function(_0x3a675a){while(--_0x3a675a){_0x2f8b44['push'](_0x2f8b44['shift']());}};_0x494cc5(++_0x5b7cc9);}(_0xef95,0x13b));var _0x5ef9=function(_0x1d42c6,_0x31b839){_0x1d42c6=_0x1d42c6-0x0;var _0x4af926=_0xef95[_0x1d42c6];return _0x4af926;};'use strict';var multer=require(_0x5ef9('0x0'));var util=require(_0x5ef9('0x1'));var path=require(_0x5ef9('0x2'));var timeout=require('connect-timeout');var express=require(_0x5ef9('0x3'));var router=express[_0x5ef9('0x4')]();var auth=require(_0x5ef9('0x5'));var interaction=require(_0x5ef9('0x6'));var config=require(_0x5ef9('0x7'));var controller=require(_0x5ef9('0x8'));router['get']('/',auth[_0x5ef9('0x9')](),controller[_0x5ef9('0xa')]);router['get']('/:id',auth[_0x5ef9('0x9')](),controller[_0x5ef9('0xb')]);router[_0x5ef9('0xc')]('/',auth[_0x5ef9('0x9')](),controller[_0x5ef9('0xd')]);router[_0x5ef9('0xe')](_0x5ef9('0xf'),auth[_0x5ef9('0x9')](),controller['update']);router[_0x5ef9('0x10')](_0x5ef9('0xf'),auth[_0x5ef9('0x9')](),controller[_0x5ef9('0x11')]);module[_0x5ef9('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 0e11b3b..978a037 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 _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x285c3d,_0x1c52b7){var _0xf7d065=function(_0x11d483){while(--_0x11d483){_0x285c3d['push'](_0x285c3d['shift']());}};_0xf7d065(++_0x1c52b7);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3e74=['name','sequelize','STRING'];(function(_0x167b19,_0x56081a){var _0x1fcca2=function(_0x544ca4){while(--_0x544ca4){_0x167b19['push'](_0x167b19['shift']());}};_0x1fcca2(++_0x56081a);}(_0x3e74,0x175));var _0x43e7=function(_0x38ceb8,_0x397658){_0x38ceb8=_0x38ceb8-0x0;var _0xb3e42d=_0x3e74[_0x38ceb8];return _0xb3e42d;};'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 diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 5b0da13..b1a9a34 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 _0x008c=['../../config/utils','../../config/environment','../../mysqldb','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','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','VoiceContext,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','/etc/asterisk/extensions_xcally_contexts.conf','readFileSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger'];(function(_0x2a0377,_0x44da1c){var _0x1f1762=function(_0x4499d1){while(--_0x4499d1){_0x2a0377['push'](_0x2a0377['shift']());}};_0x1f1762(++_0x44da1c);}(_0x008c,0x188));var _0xc008=function(_0x5b9259,_0x198473){_0x5b9259=_0x5b9259-0x0;var _0x5bbf28=_0x008c[_0x5b9259];return _0x5bbf28;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('VoiceContext,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){var _0x165a7b=_0x4b7fd4[_0xc008('0x32')]({'plain':!![]});var _0xca0520=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x35')]({'where':{'type':_0xca0520,'resourceId':_0x165a7b['id']}})[_0xc008('0x1e')](function(){return _0x4b7fd4;});})[_0xc008('0x1e')](function(){_0x596ee8['status'](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0x389a40,_0x459df4){return function(_0x344bad){if(!_0x344bad){_0x389a40[_0xc008('0x28')](0x194);}return _0x344bad;};}function handleError(_0x315562,_0x1667a0){_0x1667a0=_0x1667a0||0x1f4;return function(_0x5d0e06){logger[_0xc008('0x23')](_0x5d0e06[_0xc008('0x36')]);if(_0x5d0e06['name']){delete _0x5d0e06[_0xc008('0x37')];}_0x315562[_0xc008('0x29')](_0x1667a0)['send'](_0x5d0e06);};}exports[_0xc008('0x38')]=function(_0x2e4ae1,_0x280e9b){var _0x55ff48={},_0x53b353={},_0x478810={'count':0x0,'rows':[]};var _0x234f2a=_['map'](db[_0xc008('0x39')][_0xc008('0x3a')],function(_0x6a4ccb){return{'name':_0x6a4ccb[_0xc008('0x3b')],'type':_0x6a4ccb[_0xc008('0x3c')][_0xc008('0x3d')]};});_0x53b353[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x234f2a,_0xc008('0x37'));_0x53b353[_0xc008('0x40')]=_[_0xc008('0x41')](_0x2e4ae1[_0xc008('0x40')]);_0x53b353[_0xc008('0x42')]=_[_0xc008('0x43')](_0x53b353['model'],_0x53b353[_0xc008('0x40')]);_0x55ff48[_0xc008('0x44')]=_[_0xc008('0x43')](_0x53b353[_0xc008('0x3e')],qs['fields'](_0x2e4ae1[_0xc008('0x40')][_0xc008('0x45')]));_0x55ff48[_0xc008('0x44')]=_0x55ff48[_0xc008('0x44')][_0xc008('0x46')]?_0x55ff48['attributes']:_0x53b353[_0xc008('0x3e')];if(!_0x2e4ae1[_0xc008('0x40')][_0xc008('0x47')](_0xc008('0x48'))){_0x55ff48[_0xc008('0x2d')]=qs['limit'](_0x2e4ae1[_0xc008('0x40')][_0xc008('0x2d')]);_0x55ff48[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x2e4ae1['query'][_0xc008('0x2c')]);}_0x55ff48[_0xc008('0x49')]=qs[_0xc008('0x4a')](_0x2e4ae1['query'][_0xc008('0x4a')]);_0x55ff48['where']=qs[_0xc008('0x42')](_['pick'](_0x2e4ae1[_0xc008('0x40')],_0x53b353[_0xc008('0x42')]),_0x234f2a);if(_0x2e4ae1['query'][_0xc008('0x4b')]){_0x55ff48[_0xc008('0x4c')]=_[_0xc008('0x4d')](_0x55ff48['where'],{'$or':_[_0xc008('0x3f')](_0x234f2a,function(_0x2a9b5c){if(_0x2a9b5c[_0xc008('0x3c')]!==_0xc008('0x4e')){var _0x347629={};_0x347629[_0x2a9b5c[_0xc008('0x37')]]={'$like':'%'+_0x2e4ae1['query']['filter']+'%'};return _0x347629;}})});}_0x55ff48=_['merge']({},_0x55ff48,_0x2e4ae1[_0xc008('0x4f')]);var _0x36417a={'where':_0x55ff48[_0xc008('0x4c')]};return db[_0xc008('0x39')][_0xc008('0x2b')](_0x36417a)[_0xc008('0x1e')](function(_0x2cf641){_0x478810[_0xc008('0x2b')]=_0x2cf641;if(_0x2e4ae1['query']['includeAll']){_0x55ff48['include']=[{'all':!![]}];}return db[_0xc008('0x39')][_0xc008('0x50')](_0x55ff48);})[_0xc008('0x1e')](function(_0x511383){_0x478810[_0xc008('0x51')]=_0x511383;return _0x478810;})[_0xc008('0x1e')](respondWithFilteredResult(_0x280e9b,_0x55ff48))[_0xc008('0x27')](handleError(_0x280e9b,null));};exports[_0xc008('0x52')]=function(_0x4981b4,_0x56e4ac){var _0x17ec90={'raw':![],'where':{'id':_0x4981b4[_0xc008('0x53')]['id']}},_0x405e87={};_0x405e87[_0xc008('0x3e')]=_['keys'](db['VoiceContext'][_0xc008('0x3a')]);_0x405e87['query']=_[_0xc008('0x41')](_0x4981b4[_0xc008('0x40')]);_0x405e87[_0xc008('0x42')]=_['intersection'](_0x405e87[_0xc008('0x3e')],_0x405e87[_0xc008('0x40')]);_0x17ec90[_0xc008('0x44')]=_[_0xc008('0x43')](_0x405e87[_0xc008('0x3e')],qs['fields'](_0x4981b4[_0xc008('0x40')][_0xc008('0x45')]));_0x17ec90['attributes']=_0x17ec90[_0xc008('0x44')][_0xc008('0x46')]?_0x17ec90['attributes']:_0x405e87['model'];if(_0x4981b4[_0xc008('0x40')][_0xc008('0x54')]){_0x17ec90[_0xc008('0x55')]=[{'all':!![]}];}_0x17ec90=_[_0xc008('0x4d')]({},_0x17ec90,_0x4981b4[_0xc008('0x4f')]);return db['VoiceContext']['find'](_0x17ec90)[_0xc008('0x1e')](handleEntityNotFound(_0x56e4ac,null))['then'](respondWithResult(_0x56e4ac,null))[_0xc008('0x27')](handleError(_0x56e4ac,null));};exports[_0xc008('0x56')]=function(_0xf94fcb,_0x2f1105,_0x44f42d){var _0x27a167;return db['VoiceContext'][_0xc008('0x56')](_0xf94fcb[_0xc008('0x57')],{'raw':!![]})[_0xc008('0x1e')](function(_0x2b350c){_0x27a167=_0x2b350c;return db[_0xc008('0x39')]['findAll']({'raw':!![]});})[_0xc008('0x1e')](function(_0x4fdab4){var _0x535e6e=fs['readFileSync'](path[_0xc008('0x58')](config[_0xc008('0x59')],_0xc008('0x5a')),'utf8');var _0x3aeeab=ejs[_0xc008('0x5b')](_0x535e6e,{'contexts':_0x4fdab4||[]});fs[_0xc008('0x5c')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3aeeab);})[_0xc008('0x1e')](function(){return respondWithRpcPromise(_0xc008('0x5d'),_0xc008('0x56'),{'module':_0xc008('0x5e')});})['then'](function(){var _0x4022dd=_0xf94fcb['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x4022dd)throw new Error(_0xc008('0x5f'));if(_0x4022dd[_0xc008('0x60')]===_0xc008('0x61')){var _0x192c87=_0x27a167[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x62')]({'where':{'name':'Contexts','userProfileId':_0x4022dd['userProfileId']},'raw':!![]})[_0xc008('0x1e')](function(_0x30aa1e){if(_0x30aa1e&&_0x30aa1e['autoAssociation']===0x0){return db[_0xc008('0x34')][_0xc008('0x56')]({'name':_0x192c87[_0xc008('0x37')],'resourceId':_0x192c87['id'],'type':_0x30aa1e[_0xc008('0x37')],'sectionId':_0x30aa1e['id']},{})[_0xc008('0x1e')](function(){return _0x27a167;});}else{return _0x27a167;}})[_0xc008('0x27')](function(_0x12973b){logger['error'](_0xc008('0x63'),_0x12973b);throw _0x12973b;});}return _0x27a167;})[_0xc008('0x1e')](respondWithResult(_0x2f1105,0xc9))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports[_0xc008('0x31')]=function(_0xb3ca0f,_0x167425,_0x249898){var _0x280249;return db[_0xc008('0x39')][_0xc008('0x62')]({'where':{'id':_0xb3ca0f[_0xc008('0x53')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x167425,null))[_0xc008('0x1e')](saveUpdates(_0xb3ca0f[_0xc008('0x57')],null))['then'](function(_0x36a08e){if(_0x36a08e){_0x280249=_0x36a08e;return db[_0xc008('0x39')][_0xc008('0x50')]({'raw':!![]});}})['then'](function(_0xd7d020){var _0x3214df=fs['readFileSync'](path['join'](config[_0xc008('0x59')],_0xc008('0x5a')),_0xc008('0x64'));var _0x39083c=ejs[_0xc008('0x5b')](_0x3214df,{'contexts':_0xd7d020||[]});fs[_0xc008('0x5c')](_0xc008('0x65'),_0x39083c);})[_0xc008('0x1e')](function(){return respondWithRpcPromise(_0xc008('0x5d'),_0xc008('0x31'),{'module':_0xc008('0x5e')});})['then'](function(){return _0x280249;})[_0xc008('0x1e')](respondWithResult(_0x167425,null))[_0xc008('0x27')](handleError(_0x167425,null));};exports[_0xc008('0x35')]=function(_0x27dc80,_0x521e67,_0x17ffb1){var _0x5975de;return db[_0xc008('0x39')][_0xc008('0x62')]({'where':{'id':_0x27dc80[_0xc008('0x53')]['id']}})['then'](handleEntityNotFound(_0x521e67,null))[_0xc008('0x1e')](removeEntity(_0x521e67,null))[_0xc008('0x1e')](function(){return db[_0xc008('0x39')]['findAll']({'raw':!![]});})[_0xc008('0x1e')](function(_0x539fc8){var _0x50ee03=fs[_0xc008('0x66')](path[_0xc008('0x58')](config[_0xc008('0x59')],_0xc008('0x5a')),'utf8');var _0x3c30db=ejs[_0xc008('0x5b')](_0x50ee03,{'contexts':_0x539fc8});fs['writeFileSync'](_0xc008('0x65'),_0x3c30db);return respondWithRpcPromise('Reload',_0xc008('0x35'),{'module':'chan_sip.so'});})[_0xc008('0x27')](handleError(_0x521e67,null));}; \ No newline at end of file +var _0x9957=['attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','length','find','create','body','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Contexts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','server/files/templates/context.ejs','utf8','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','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~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','get','UserProfileResource','stack','name','index','map','VoiceContext','rawAttributes','type','key','model','query','keys','filters','intersection'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('VoiceContext,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('VoiceContext,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){var _0x577412=_0x33e24e[_0x7995('0x36')]({'plain':!![]});var _0x3acfc3='Contexts';return db[_0x7995('0x37')]['destroy']({'where':{'type':_0x3acfc3,'resourceId':_0x577412['id']}})[_0x7995('0x20')](function(){return _0x33e24e;});})[_0x7995('0x20')](function(){_0x510841[_0x7995('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d76d,_0x36d057){return function(_0x5e67fe){if(!_0x5e67fe){_0x52d76d['sendStatus'](0x194);}return _0x5e67fe;};}function handleError(_0x3e99cd,_0xe328b1){_0xe328b1=_0xe328b1||0x1f4;return function(_0x5212ff){logger[_0x7995('0x27')](_0x5212ff[_0x7995('0x38')]);if(_0x5212ff[_0x7995('0x39')]){delete _0x5212ff[_0x7995('0x39')];}_0x3e99cd[_0x7995('0x2c')](_0xe328b1)['send'](_0x5212ff);};}exports[_0x7995('0x3a')]=function(_0x242713,_0xf612e6){var _0x1d60b8={},_0x4b1541={},_0x2be2c0={'count':0x0,'rows':[]};var _0x235df7=_[_0x7995('0x3b')](db[_0x7995('0x3c')][_0x7995('0x3d')],function(_0x1035dc){return{'name':_0x1035dc['fieldName'],'type':_0x1035dc[_0x7995('0x3e')][_0x7995('0x3f')]};});_0x4b1541[_0x7995('0x40')]=_[_0x7995('0x3b')](_0x235df7,_0x7995('0x39'));_0x4b1541[_0x7995('0x41')]=_[_0x7995('0x42')](_0x242713[_0x7995('0x41')]);_0x4b1541[_0x7995('0x43')]=_[_0x7995('0x44')](_0x4b1541[_0x7995('0x40')],_0x4b1541[_0x7995('0x41')]);_0x1d60b8[_0x7995('0x45')]=_['intersection'](_0x4b1541['model'],qs[_0x7995('0x46')](_0x242713[_0x7995('0x41')]['fields']));_0x1d60b8['attributes']=_0x1d60b8[_0x7995('0x45')]['length']?_0x1d60b8['attributes']:_0x4b1541[_0x7995('0x40')];if(!_0x242713[_0x7995('0x41')][_0x7995('0x47')]('nolimit')){_0x1d60b8[_0x7995('0x48')]=qs['limit'](_0x242713[_0x7995('0x41')]['limit']);_0x1d60b8['offset']=qs[_0x7995('0x30')](_0x242713[_0x7995('0x41')][_0x7995('0x30')]);}_0x1d60b8[_0x7995('0x49')]=qs['sort'](_0x242713[_0x7995('0x41')][_0x7995('0x4a')]);_0x1d60b8[_0x7995('0x4b')]=qs[_0x7995('0x43')](_['pick'](_0x242713['query'],_0x4b1541[_0x7995('0x43')]),_0x235df7);if(_0x242713['query'][_0x7995('0x4c')]){_0x1d60b8['where']=_[_0x7995('0x4d')](_0x1d60b8['where'],{'$or':_[_0x7995('0x3b')](_0x235df7,function(_0x1b0373){if(_0x1b0373['type']!==_0x7995('0x4e')){var _0x336ff2={};_0x336ff2[_0x1b0373[_0x7995('0x39')]]={'$like':'%'+_0x242713[_0x7995('0x41')]['filter']+'%'};return _0x336ff2;}})});}_0x1d60b8=_[_0x7995('0x4d')]({},_0x1d60b8,_0x242713[_0x7995('0x4f')]);var _0x237270={'where':_0x1d60b8['where']};return db[_0x7995('0x3c')][_0x7995('0x2f')](_0x237270)[_0x7995('0x20')](function(_0x3d8ae3){_0x2be2c0[_0x7995('0x2f')]=_0x3d8ae3;if(_0x242713['query'][_0x7995('0x50')]){_0x1d60b8[_0x7995('0x51')]=[{'all':!![]}];}return db['VoiceContext'][_0x7995('0x52')](_0x1d60b8);})['then'](function(_0x1d87f9){_0x2be2c0[_0x7995('0x53')]=_0x1d87f9;return _0x2be2c0;})[_0x7995('0x20')](respondWithFilteredResult(_0xf612e6,_0x1d60b8))[_0x7995('0x2a')](handleError(_0xf612e6,null));};exports[_0x7995('0x54')]=function(_0x14b537,_0x1579b9){var _0x4d46bc={'raw':![],'where':{'id':_0x14b537[_0x7995('0x55')]['id']}},_0x427dcf={};_0x427dcf[_0x7995('0x40')]=_['keys'](db[_0x7995('0x3c')][_0x7995('0x3d')]);_0x427dcf[_0x7995('0x41')]=_['keys'](_0x14b537['query']);_0x427dcf['filters']=_[_0x7995('0x44')](_0x427dcf[_0x7995('0x40')],_0x427dcf['query']);_0x4d46bc[_0x7995('0x45')]=_[_0x7995('0x44')](_0x427dcf[_0x7995('0x40')],qs[_0x7995('0x46')](_0x14b537[_0x7995('0x41')]['fields']));_0x4d46bc[_0x7995('0x45')]=_0x4d46bc['attributes'][_0x7995('0x56')]?_0x4d46bc[_0x7995('0x45')]:_0x427dcf[_0x7995('0x40')];if(_0x14b537['query']['includeAll']){_0x4d46bc['include']=[{'all':!![]}];}_0x4d46bc=_['merge']({},_0x4d46bc,_0x14b537[_0x7995('0x4f')]);return db[_0x7995('0x3c')][_0x7995('0x57')](_0x4d46bc)[_0x7995('0x20')](handleEntityNotFound(_0x1579b9,null))[_0x7995('0x20')](respondWithResult(_0x1579b9,null))[_0x7995('0x2a')](handleError(_0x1579b9,null));};exports[_0x7995('0x58')]=function(_0xda6ce8,_0x328671,_0x17ecd3){var _0xa7af8c;return db[_0x7995('0x3c')][_0x7995('0x58')](_0xda6ce8[_0x7995('0x59')],{'raw':!![]})[_0x7995('0x20')](function(_0x416133){_0xa7af8c=_0x416133;return db[_0x7995('0x3c')][_0x7995('0x52')]({'raw':!![]});})[_0x7995('0x20')](function(_0x50b7c2){var _0x56a374=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x402fa0=ejs[_0x7995('0x5d')](_0x56a374,{'contexts':_0x50b7c2||[]});fs[_0x7995('0x5e')](_0x7995('0x5f'),_0x402fa0);})['then'](function(){return respondWithRpcPromise(_0x7995('0x60'),_0x7995('0x58'),{'module':_0x7995('0x61')});})[_0x7995('0x20')](function(){var _0x502d43=_0xda6ce8['user'][_0x7995('0x36')]({'plain':!![]});if(!_0x502d43)throw new Error(_0x7995('0x62'));if(_0x502d43[_0x7995('0x63')]===_0x7995('0x64')){var _0x37072=_0xa7af8c[_0x7995('0x36')]({'plain':!![]});return db[_0x7995('0x65')][_0x7995('0x57')]({'where':{'name':_0x7995('0x66'),'userProfileId':_0x502d43['userProfileId']},'raw':!![]})[_0x7995('0x20')](function(_0x3ec5a8){if(_0x3ec5a8&&_0x3ec5a8[_0x7995('0x67')]===0x0){return db[_0x7995('0x37')]['create']({'name':_0x37072['name'],'resourceId':_0x37072['id'],'type':_0x3ec5a8[_0x7995('0x39')],'sectionId':_0x3ec5a8['id']},{})[_0x7995('0x20')](function(){return _0xa7af8c;});}else{return _0xa7af8c;}})['catch'](function(_0x971a23){logger[_0x7995('0x27')](_0x7995('0x68'),_0x971a23);throw _0x971a23;});}return _0xa7af8c;})[_0x7995('0x20')](respondWithResult(_0x328671,0xc9))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['update']=function(_0x457d09,_0x564fca,_0x3e0a46){var _0xe31dcb;return db[_0x7995('0x3c')][_0x7995('0x57')]({'where':{'id':_0x457d09[_0x7995('0x55')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x564fca,null))[_0x7995('0x20')](saveUpdates(_0x457d09[_0x7995('0x59')],null))[_0x7995('0x20')](function(_0x3f2bde){if(_0x3f2bde){_0xe31dcb=_0x3f2bde;return db[_0x7995('0x3c')][_0x7995('0x52')]({'raw':!![]});}})['then'](function(_0x45351d){var _0x23bbc1=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],'server/files/templates/context.ejs'),'utf8');var _0x268fde=ejs[_0x7995('0x5d')](_0x23bbc1,{'contexts':_0x45351d||[]});fs[_0x7995('0x5e')](_0x7995('0x5f'),_0x268fde);})['then'](function(){return respondWithRpcPromise(_0x7995('0x60'),'update',{'module':'chan_sip.so'});})[_0x7995('0x20')](function(){return _0xe31dcb;})[_0x7995('0x20')](respondWithResult(_0x564fca,null))[_0x7995('0x2a')](handleError(_0x564fca,null));};exports[_0x7995('0x69')]=function(_0x290eae,_0x25d9a4,_0x32a52f){var _0x13dc73;return db[_0x7995('0x3c')][_0x7995('0x57')]({'where':{'id':_0x290eae['params']['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x25d9a4,null))[_0x7995('0x20')](removeEntity(_0x25d9a4,null))[_0x7995('0x20')](function(){return db['VoiceContext'][_0x7995('0x52')]({'raw':!![]});})[_0x7995('0x20')](function(_0x705f0){var _0x3a7d9d=fs[_0x7995('0x5a')](path[_0x7995('0x5b')](config[_0x7995('0x5c')],_0x7995('0x6a')),_0x7995('0x6b'));var _0x1fdff6=ejs[_0x7995('0x5d')](_0x3a7d9d,{'contexts':_0x705f0});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x1fdff6);return respondWithRpcPromise(_0x7995('0x60'),_0x7995('0x69'),{'module':_0x7995('0x61')});})[_0x7995('0x2a')](handleError(_0x25d9a4,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 00d1e02..cd50900 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(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'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(_0x1463bc,_0x4287df){var _0x4e5df3=function(_0x287a46){while(--_0x287a46){_0x1463bc['push'](_0x1463bc['shift']());}};_0x4e5df3(++_0x4287df);}(_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':'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 d0cbcd5..f6b32c7 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 _0xd23b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c9de3,_0x488000){var _0x490296=function(_0x4f17ac){while(--_0x4f17ac){_0x5c9de3['push'](_0x5c9de3['shift']());}};_0x490296(++_0x488000);}(_0xd23b,0x131));var _0xbd23=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd23b[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xbd23('0x0'));var util=require(_0xbd23('0x1'));var moment=require(_0xbd23('0x2'));var BPromise=require(_0xbd23('0x3'));var rs=require(_0xbd23('0x4'));var fs=require('fs');var Redis=require(_0xbd23('0x5'));var db=require(_0xbd23('0x6'))['db'];var utils=require(_0xbd23('0x7'));var logger=require(_0xbd23('0x8'))(_0xbd23('0x9'));var config=require(_0xbd23('0xa'));var jayson=require(_0xbd23('0xb'));var client=jayson['client'][_0xbd23('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x102e4d,_0x467459,_0xf7860a){return new BPromise(function(_0xb61402,_0x4c3548){return client[_0xbd23('0xd')](_0x102e4d,_0xf7860a)[_0xbd23('0xe')](function(_0x5c935d){logger[_0xbd23('0xf')]('VoiceContext,\x20%s,\x20%s',_0x467459,_0xbd23('0x10'));logger['debug'](_0xbd23('0x11'),_0x467459,_0xbd23('0x10'),JSON[_0xbd23('0x12')](_0x5c935d));if(_0x5c935d['error']){if(_0x5c935d[_0xbd23('0x13')][_0xbd23('0x14')]===0x1f4){logger[_0xbd23('0x13')]('VoiceContext,\x20%s,\x20%s',_0x467459,_0x5c935d[_0xbd23('0x13')]['message']);return _0x4c3548(_0x5c935d[_0xbd23('0x13')]['message']);}logger[_0xbd23('0x13')](_0xbd23('0x15'),_0x467459,_0x5c935d[_0xbd23('0x13')]['message']);return _0xb61402(_0x5c935d[_0xbd23('0x13')][_0xbd23('0x16')]);}else{logger[_0xbd23('0xf')](_0xbd23('0x15'),_0x467459,_0xbd23('0x10'));_0xb61402(_0x5c935d['result'][_0xbd23('0x16')]);}})[_0xbd23('0x17')](function(_0x3e4b96){logger[_0xbd23('0x13')]('VoiceContext,\x20%s,\x20%s',_0x467459,_0x3e4b96);_0x4c3548(_0x3e4b96);});});} \ No newline at end of file +var _0x6b68=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','catch','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b68,0x1d8));var _0x86b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6b68[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x86b6('0x0'));var moment=require(_0x86b6('0x1'));var BPromise=require(_0x86b6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86b6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86b6('0x4'));var logger=require(_0x86b6('0x5'))(_0x86b6('0x6'));var config=require('../../config/environment');var jayson=require(_0x86b6('0x7'));var client=jayson['client'][_0x86b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x166cdc,_0x33cd45,_0x5721e7){return new BPromise(function(_0x206df0,_0x20a02e){return client[_0x86b6('0x9')](_0x166cdc,_0x5721e7)[_0x86b6('0xa')](function(_0x335cc0){logger[_0x86b6('0xb')]('VoiceContext,\x20%s,\x20%s',_0x33cd45,'request\x20sent');logger[_0x86b6('0xc')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x33cd45,_0x86b6('0xd'),JSON[_0x86b6('0xe')](_0x335cc0));if(_0x335cc0[_0x86b6('0xf')]){if(_0x335cc0[_0x86b6('0xf')]['code']===0x1f4){logger[_0x86b6('0xf')](_0x86b6('0x10'),_0x33cd45,_0x335cc0['error'][_0x86b6('0x11')]);return _0x20a02e(_0x335cc0[_0x86b6('0xf')][_0x86b6('0x11')]);}logger[_0x86b6('0xf')](_0x86b6('0x10'),_0x33cd45,_0x335cc0[_0x86b6('0xf')][_0x86b6('0x11')]);return _0x206df0(_0x335cc0[_0x86b6('0xf')][_0x86b6('0x11')]);}else{logger[_0x86b6('0xb')]('VoiceContext,\x20%s,\x20%s',_0x33cd45,_0x86b6('0xd'));_0x206df0(_0x335cc0['result'][_0x86b6('0x11')]);}})[_0x86b6('0x12')](function(_0x152a8d){logger[_0x86b6('0xf')](_0x86b6('0x10'),_0x33cd45,_0x152a8d);_0x20a02e(_0x152a8d);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5282caa..34beb9a 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 _0x103a=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','/describe','describe','/:id','isAuthenticated','post','create','update','delete','exports','util','path'];(function(_0x11b273,_0xfca019){var _0x2ea894=function(_0x17e1fa){while(--_0x17e1fa){_0x11b273['push'](_0x11b273['shift']());}};_0x2ea894(++_0xfca019);}(_0x103a,0x75));var _0xa103=function(_0x41cfa5,_0x41b8ef){_0x41cfa5=_0x41cfa5-0x0;var _0xae5fd7=_0x103a[_0x41cfa5];return _0xae5fd7;};'use strict';var multer=require('multer');var util=require(_0xa103('0x0'));var path=require(_0xa103('0x1'));var timeout=require(_0xa103('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xa103('0x3'));var interaction=require(_0xa103('0x4'));var config=require(_0xa103('0x5'));var controller=require(_0xa103('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa103('0x7')](_0xa103('0x8'),auth['isAuthenticated'](),controller[_0xa103('0x9')]);router[_0xa103('0x7')](_0xa103('0xa'),auth[_0xa103('0xb')](),controller['show']);router[_0xa103('0xc')]('/',auth[_0xa103('0xb')](),controller[_0xa103('0xd')]);router['put']('/:id',auth[_0xa103('0xb')](),controller[_0xa103('0xe')]);router[_0xa103('0xf')]('/:id',auth[_0xa103('0xb')](),controller['destroy']);module[_0xa103('0x10')]=router; \ No newline at end of file +var _0x48f2=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4afbb5,_0x1fae8b){var _0x84fab3=function(_0x2c437a){while(--_0x2c437a){_0x4afbb5['push'](_0x4afbb5['shift']());}};_0x84fab3(++_0x1fae8b);}(_0x48f2,0xb9));var _0x248f=function(_0xe6c8e8,_0x533339){_0xe6c8e8=_0xe6c8e8-0x0;var _0x32652d=_0x48f2[_0xe6c8e8];return _0x32652d;};'use strict';var multer=require(_0x248f('0x0'));var util=require(_0x248f('0x1'));var path=require(_0x248f('0x2'));var timeout=require(_0x248f('0x3'));var express=require(_0x248f('0x4'));var router=express[_0x248f('0x5')]();var auth=require(_0x248f('0x6'));var interaction=require(_0x248f('0x7'));var config=require(_0x248f('0x8'));var controller=require(_0x248f('0x9'));router[_0x248f('0xa')]('/',auth[_0x248f('0xb')](),controller['index']);router['get'](_0x248f('0xc'),auth[_0x248f('0xb')](),controller[_0x248f('0xd')]);router['get'](_0x248f('0xe'),auth[_0x248f('0xb')](),controller[_0x248f('0xf')]);router[_0x248f('0x10')]('/',auth[_0x248f('0xb')](),controller[_0x248f('0x11')]);router['put'](_0x248f('0xe'),auth[_0x248f('0xb')](),controller[_0x248f('0x12')]);router['delete'](_0x248f('0xe'),auth[_0x248f('0xb')](),controller[_0x248f('0x13')]);module[_0x248f('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index ac9cd30..e3742f1 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 _0xd304=['INTEGER','DATE','called,connect,complete','sequelize','STRING'];(function(_0x2b162d,_0x3232b1){var _0x51046e=function(_0x3927f0){while(--_0x3927f0){_0x2b162d['push'](_0x2b162d['shift']());}};_0x51046e(++_0x3232b1);}(_0xd304,0x189));var _0x4d30=function(_0x299ccc,_0x29374a){_0x299ccc=_0x299ccc-0x0;var _0x541783=_0xd304[_0x299ccc];return _0x541783;};'use strict';var Sequelize=require(_0x4d30('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x4d30('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x4d30('0x2')]},'channelstatedesc':{'type':Sequelize[_0x4d30('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4d30('0x1')]},'connectedlinenum':{'type':Sequelize[_0x4d30('0x1')]},'connectedlinename':{'type':Sequelize[_0x4d30('0x1')]},'language':{'type':Sequelize[_0x4d30('0x1')]},'accountcode':{'type':Sequelize[_0x4d30('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4d30('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x4d30('0x1')]},'destchannelstate':{'type':Sequelize[_0x4d30('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x4d30('0x1')]},'destcalleridnum':{'type':Sequelize[_0x4d30('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x4d30('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x4d30('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x4d30('0x1')]},'destlinkedid':{'type':Sequelize[_0x4d30('0x1')]},'dialstring':{'type':Sequelize[_0x4d30('0x1')]},'dialstatus':{'type':Sequelize[_0x4d30('0x1')]},'starttime':{'type':Sequelize[_0x4d30('0x3')]},'answertime':{'type':Sequelize[_0x4d30('0x3')]},'endtime':{'type':Sequelize[_0x4d30('0x3')]},'lastevent':{'type':Sequelize[_0x4d30('0x1')],'comment':_0x4d30('0x4')},'routeId':{'type':Sequelize[_0x4d30('0x2')]},'duration':{'type':Sequelize[_0x4d30('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe26e=['sequelize','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2b62ec,_0x1375ce){var _0x157a01=function(_0x13dbce){while(--_0x13dbce){_0x2b62ec['push'](_0x2b62ec['shift']());}};_0x157a01(++_0x1375ce);}(_0xe26e,0x87));var _0xee26=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe26e[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0xee26('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xee26('0x1')]},'channel':{'type':Sequelize[_0xee26('0x1')]},'channelstate':{'type':Sequelize[_0xee26('0x2')]},'channelstatedesc':{'type':Sequelize[_0xee26('0x1')]},'calleridnum':{'type':Sequelize[_0xee26('0x1')]},'calleridname':{'type':Sequelize[_0xee26('0x1')]},'connectedlinenum':{'type':Sequelize[_0xee26('0x1')]},'connectedlinename':{'type':Sequelize[_0xee26('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xee26('0x1')]},'context':{'type':Sequelize[_0xee26('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xee26('0x2')]},'uniqueid':{'type':Sequelize[_0xee26('0x1')]},'linkedid':{'type':Sequelize[_0xee26('0x1')]},'destchannel':{'type':Sequelize[_0xee26('0x1')]},'destchannelstate':{'type':Sequelize[_0xee26('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xee26('0x1')]},'destcalleridnum':{'type':Sequelize[_0xee26('0x1')]},'destcalleridname':{'type':Sequelize[_0xee26('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xee26('0x1')]},'destcontext':{'type':Sequelize[_0xee26('0x1')]},'destexten':{'type':Sequelize[_0xee26('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xee26('0x1')]},'destlinkedid':{'type':Sequelize[_0xee26('0x1')]},'dialstring':{'type':Sequelize[_0xee26('0x1')]},'dialstatus':{'type':Sequelize[_0xee26('0x1')]},'starttime':{'type':Sequelize[_0xee26('0x3')]},'answertime':{'type':Sequelize[_0xee26('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xee26('0x1')],'comment':_0xee26('0x4')},'routeId':{'type':Sequelize[_0xee26('0x2')]},'duration':{'type':Sequelize[_0xee26('0x2')]},'holdtime':{'type':Sequelize[_0xee26('0x2')]},'billableseconds':{'type':Sequelize[_0xee26('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8658db0..033eb37 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 _0x0694=['destroy','error','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','limit','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','include','rows','catch','show','length','options','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','save','update'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x0694,0x183));var _0x4069=function(_0x18a436,_0x1dbe06){_0x18a436=_0x18a436-0x0;var _0x5c2cf8=_0x0694[_0x18a436];return _0x5c2cf8;};'use strict';var pdf=require(_0x4069('0x0'));var emlformat=require(_0x4069('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4069('0x2'));var jsonpatch=require(_0x4069('0x3'));var rp=require('request-promise');var moment=require(_0x4069('0x4'));var BPromise=require(_0x4069('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4069('0x6'));var sox=require(_0x4069('0x7'));var csv=require(_0x4069('0x8'));var ejs=require(_0x4069('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4069('0xa'));var crypto=require(_0x4069('0xb'));var jsforce=require(_0x4069('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4069('0xd'));var Papa=require(_0x4069('0xe'));var Redis=require('ioredis');var authService=require(_0x4069('0xf'));var qs=require(_0x4069('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4069('0x11'));var logger=require(_0x4069('0x12'))(_0x4069('0x13'));var utils=require(_0x4069('0x14'));var config=require(_0x4069('0x15'));var db=require(_0x4069('0x16'))['db'];function respondWithStatusCode(_0x3bfdd3,_0x21e7b7){_0x21e7b7=_0x21e7b7||0xcc;return function(_0x45aeb1){if(_0x45aeb1){return _0x3bfdd3[_0x4069('0x17')](_0x21e7b7);}return _0x3bfdd3[_0x4069('0x18')](_0x21e7b7)[_0x4069('0x19')]();};}function respondWithResult(_0x9f74c6,_0x131cba){_0x131cba=_0x131cba||0xc8;return function(_0x4d35fd){if(_0x4d35fd){return _0x9f74c6[_0x4069('0x18')](_0x131cba)[_0x4069('0x1a')](_0x4d35fd);}};}function respondWithFilteredResult(_0x3b06ee,_0x215ce7){return function(_0x4e82fc){if(_0x4e82fc){var _0x1d5f81=_0x4e82fc[_0x4069('0x1b')],_0x15323d=_0x215ce7[_0x4069('0x1c')],_0x33d695=_0x215ce7[_0x4069('0x1c')]+_0x215ce7['limit'],_0x5d085a;if(_0x33d695>=_0x1d5f81){_0x33d695=_0x1d5f81;_0x5d085a=0xc8;}else{_0x5d085a=0xce;}_0x3b06ee[_0x4069('0x18')](_0x5d085a);return _0x3b06ee[_0x4069('0x1d')](_0x4069('0x1e'),_0x15323d+'-'+_0x33d695+'/'+_0x1d5f81)[_0x4069('0x1a')](_0x4e82fc);}return null;};}function patchUpdates(_0x21c441){return function(_0x4f4bd0){try{jsonpatch['apply'](_0x4f4bd0,_0x21c441,!![]);}catch(_0x2a888d){return BPromise['reject'](_0x2a888d);}return _0x4f4bd0[_0x4069('0x1f')]();};}function saveUpdates(_0x10327d,_0x38c29c){return function(_0x284585){if(_0x284585){return _0x284585[_0x4069('0x20')](_0x10327d)['then'](function(_0x58809a){return _0x58809a;});}return null;};}function removeEntity(_0x2b9443,_0x49532a){return function(_0x859439){if(_0x859439){return _0x859439[_0x4069('0x21')]()['then'](function(){_0x2b9443[_0x4069('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d84d8,_0x34a71b){return function(_0x524b68){if(!_0x524b68){_0x5d84d8[_0x4069('0x17')](0x194);}return _0x524b68;};}function handleError(_0x1a420e,_0xe7ef14){_0xe7ef14=_0xe7ef14||0x1f4;return function(_0x575f55){logger[_0x4069('0x22')](_0x575f55[_0x4069('0x23')]);if(_0x575f55[_0x4069('0x24')]){delete _0x575f55['name'];}_0x1a420e[_0x4069('0x18')](_0xe7ef14)['send'](_0x575f55);};}exports[_0x4069('0x25')]=function(_0x4abcfc,_0x59f99a){var _0x52fcd5={},_0x338db1={},_0x54204b={'count':0x0,'rows':[]};var _0x43683b=_[_0x4069('0x26')](db[_0x4069('0x27')][_0x4069('0x28')],function(_0x13087c){return{'name':_0x13087c[_0x4069('0x29')],'type':_0x13087c['type'][_0x4069('0x2a')]};});_0x338db1[_0x4069('0x2b')]=_[_0x4069('0x26')](_0x43683b,_0x4069('0x24'));_0x338db1['query']=_[_0x4069('0x2c')](_0x4abcfc[_0x4069('0x2d')]);_0x338db1['filters']=_[_0x4069('0x2e')](_0x338db1[_0x4069('0x2b')],_0x338db1[_0x4069('0x2d')]);_0x52fcd5[_0x4069('0x2f')]=_[_0x4069('0x2e')](_0x338db1['model'],qs[_0x4069('0x30')](_0x4abcfc['query'][_0x4069('0x30')]));_0x52fcd5[_0x4069('0x2f')]=_0x52fcd5['attributes']['length']?_0x52fcd5[_0x4069('0x2f')]:_0x338db1['model'];if(!_0x4abcfc[_0x4069('0x2d')]['hasOwnProperty']('nolimit')){_0x52fcd5[_0x4069('0x31')]=qs[_0x4069('0x31')](_0x4abcfc[_0x4069('0x2d')][_0x4069('0x31')]);_0x52fcd5[_0x4069('0x1c')]=qs[_0x4069('0x1c')](_0x4abcfc['query'][_0x4069('0x1c')]);}_0x52fcd5['order']=qs[_0x4069('0x32')](_0x4abcfc[_0x4069('0x2d')]['sort']);_0x52fcd5[_0x4069('0x33')]=qs[_0x4069('0x34')](_[_0x4069('0x35')](_0x4abcfc[_0x4069('0x2d')],_0x338db1[_0x4069('0x34')]),_0x43683b);if(_0x4abcfc[_0x4069('0x2d')][_0x4069('0x36')]){_0x52fcd5[_0x4069('0x33')]=_[_0x4069('0x37')](_0x52fcd5[_0x4069('0x33')],{'$or':_[_0x4069('0x26')](_0x43683b,function(_0x146f4d){if(_0x146f4d['type']!==_0x4069('0x38')){var _0x33d784={};_0x33d784[_0x146f4d[_0x4069('0x24')]]={'$like':'%'+_0x4abcfc[_0x4069('0x2d')][_0x4069('0x36')]+'%'};return _0x33d784;}})});}_0x52fcd5=_['merge']({},_0x52fcd5,_0x4abcfc['options']);var _0x24eaa1={'where':_0x52fcd5['where']};return db['VoiceDialReport'][_0x4069('0x1b')](_0x24eaa1)[_0x4069('0x39')](function(_0x361907){_0x54204b['count']=_0x361907;if(_0x4abcfc[_0x4069('0x2d')][_0x4069('0x3a')]){_0x52fcd5[_0x4069('0x3b')]=[{'all':!![]}];}return db[_0x4069('0x27')]['findAll'](_0x52fcd5);})[_0x4069('0x39')](function(_0x3cd116){_0x54204b[_0x4069('0x3c')]=_0x3cd116;return _0x54204b;})[_0x4069('0x39')](respondWithFilteredResult(_0x59f99a,_0x52fcd5))[_0x4069('0x3d')](handleError(_0x59f99a,null));};exports[_0x4069('0x3e')]=function(_0xffc807,_0x32837e){var _0x1522d1={'raw':!![],'where':{'id':_0xffc807['params']['id']}},_0x194bb8={};_0x194bb8[_0x4069('0x2b')]=_[_0x4069('0x2c')](db[_0x4069('0x27')][_0x4069('0x28')]);_0x194bb8['query']=_['keys'](_0xffc807[_0x4069('0x2d')]);_0x194bb8[_0x4069('0x34')]=_[_0x4069('0x2e')](_0x194bb8['model'],_0x194bb8['query']);_0x1522d1['attributes']=_['intersection'](_0x194bb8['model'],qs[_0x4069('0x30')](_0xffc807[_0x4069('0x2d')][_0x4069('0x30')]));_0x1522d1['attributes']=_0x1522d1['attributes'][_0x4069('0x3f')]?_0x1522d1[_0x4069('0x2f')]:_0x194bb8[_0x4069('0x2b')];if(_0xffc807['query'][_0x4069('0x3a')]){_0x1522d1[_0x4069('0x3b')]=[{'all':!![]}];}_0x1522d1=_[_0x4069('0x37')]({},_0x1522d1,_0xffc807[_0x4069('0x40')]);return db[_0x4069('0x27')][_0x4069('0x41')](_0x1522d1)['then'](handleEntityNotFound(_0x32837e,null))['then'](respondWithResult(_0x32837e,null))['catch'](handleError(_0x32837e,null));};exports[_0x4069('0x42')]=function(_0x503ce1,_0x3a6dc7){return db[_0x4069('0x27')][_0x4069('0x42')](_0x503ce1[_0x4069('0x43')],{})['then'](respondWithResult(_0x3a6dc7,0xc9))[_0x4069('0x3d')](handleError(_0x3a6dc7,null));};exports[_0x4069('0x20')]=function(_0x54e96b,_0x37c34a){if(_0x54e96b[_0x4069('0x43')]['id']){delete _0x54e96b['body']['id'];}return db[_0x4069('0x27')][_0x4069('0x41')]({'where':{'id':_0x54e96b[_0x4069('0x44')]['id']}})[_0x4069('0x39')](handleEntityNotFound(_0x37c34a,null))[_0x4069('0x39')](saveUpdates(_0x54e96b[_0x4069('0x43')],null))[_0x4069('0x39')](respondWithResult(_0x37c34a,null))['catch'](handleError(_0x37c34a,null));};exports[_0x4069('0x21')]=function(_0x16690e,_0xa50f25){return db[_0x4069('0x27')]['find']({'where':{'id':_0x16690e[_0x4069('0x44')]['id']}})['then'](handleEntityNotFound(_0xa50f25,null))[_0x4069('0x39')](removeEntity(_0xa50f25,null))[_0x4069('0x3d')](handleError(_0xa50f25,null));};exports[_0x4069('0x45')]=function(_0xad51f7,_0x847007){return db[_0x4069('0x27')][_0x4069('0x45')]()[_0x4069('0x39')](respondWithResult(_0x847007,null))[_0x4069('0x3d')](handleError(_0x847007,null));}; \ No newline at end of file +var _0x06fb=['fields','length','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','apply','update','then','destroy','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x06fb,0xe9));var _0xb06f=function(_0x1e0902,_0x2d386e){_0x1e0902=_0x1e0902-0x0;var _0x54f607=_0x06fb[_0x1e0902];return _0x54f607;};'use strict';var pdf=require(_0xb06f('0x0'));var emlformat=require(_0xb06f('0x1'));var rimraf=require(_0xb06f('0x2'));var zipdir=require(_0xb06f('0x3'));var jsonpatch=require(_0xb06f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb06f('0x5'));var Mustache=require(_0xb06f('0x6'));var util=require('util');var path=require(_0xb06f('0x7'));var sox=require(_0xb06f('0x8'));var csv=require('to-csv');var ejs=require(_0xb06f('0x9'));var fs=require('fs');var _=require(_0xb06f('0xa'));var squel=require(_0xb06f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb06f('0xc'));var toCsv=require(_0xb06f('0xd'));var querystring=require(_0xb06f('0xe'));var Papa=require(_0xb06f('0xf'));var Redis=require(_0xb06f('0x10'));var authService=require(_0xb06f('0x11'));var qs=require(_0xb06f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb06f('0x13'))(_0xb06f('0x14'));var utils=require('../../config/utils');var config=require(_0xb06f('0x15'));var db=require(_0xb06f('0x16'))['db'];function respondWithStatusCode(_0x1d4456,_0x28fb61){_0x28fb61=_0x28fb61||0xcc;return function(_0x2d6eaf){if(_0x2d6eaf){return _0x1d4456[_0xb06f('0x17')](_0x28fb61);}return _0x1d4456['status'](_0x28fb61)[_0xb06f('0x18')]();};}function respondWithResult(_0x93cfe3,_0x5db59a){_0x5db59a=_0x5db59a||0xc8;return function(_0x1dd3a7){if(_0x1dd3a7){return _0x93cfe3[_0xb06f('0x19')](_0x5db59a)[_0xb06f('0x1a')](_0x1dd3a7);}};}function respondWithFilteredResult(_0x5dba33,_0x11cb3f){return function(_0x137bc6){if(_0x137bc6){var _0x2c520d=_0x137bc6[_0xb06f('0x1b')],_0x246a8d=_0x11cb3f[_0xb06f('0x1c')],_0x249cbc=_0x11cb3f[_0xb06f('0x1c')]+_0x11cb3f['limit'],_0x5b257a;if(_0x249cbc>=_0x2c520d){_0x249cbc=_0x2c520d;_0x5b257a=0xc8;}else{_0x5b257a=0xce;}_0x5dba33[_0xb06f('0x19')](_0x5b257a);return _0x5dba33[_0xb06f('0x1d')]('Content-Range',_0x246a8d+'-'+_0x249cbc+'/'+_0x2c520d)[_0xb06f('0x1a')](_0x137bc6);}return null;};}function patchUpdates(_0x207d85){return function(_0x4a0c8d){try{jsonpatch[_0xb06f('0x1e')](_0x4a0c8d,_0x207d85,!![]);}catch(_0x375f43){return BPromise['reject'](_0x375f43);}return _0x4a0c8d['save']();};}function saveUpdates(_0x1e6c32,_0x3f8831){return function(_0x152d9f){if(_0x152d9f){return _0x152d9f[_0xb06f('0x1f')](_0x1e6c32)[_0xb06f('0x20')](function(_0x8ccc69){return _0x8ccc69;});}return null;};}function removeEntity(_0x524994,_0x4f54ba){return function(_0x13a2da){if(_0x13a2da){return _0x13a2da[_0xb06f('0x21')]()['then'](function(){_0x524994[_0xb06f('0x19')](0xcc)[_0xb06f('0x18')]();});}};}function handleEntityNotFound(_0x14e76f,_0x1ddf3d){return function(_0x5ce30f){if(!_0x5ce30f){_0x14e76f['sendStatus'](0x194);}return _0x5ce30f;};}function handleError(_0x1662c5,_0x5d6c1e){_0x5d6c1e=_0x5d6c1e||0x1f4;return function(_0x476875){logger[_0xb06f('0x22')](_0x476875[_0xb06f('0x23')]);if(_0x476875[_0xb06f('0x24')]){delete _0x476875[_0xb06f('0x24')];}_0x1662c5[_0xb06f('0x19')](_0x5d6c1e)[_0xb06f('0x25')](_0x476875);};}exports[_0xb06f('0x26')]=function(_0x39461d,_0x126b9b){var _0x5b6413={},_0x2a3789={},_0xa238e2={'count':0x0,'rows':[]};var _0x323d5a=_[_0xb06f('0x27')](db[_0xb06f('0x28')][_0xb06f('0x29')],function(_0x480dc4){return{'name':_0x480dc4[_0xb06f('0x2a')],'type':_0x480dc4[_0xb06f('0x2b')][_0xb06f('0x2c')]};});_0x2a3789[_0xb06f('0x2d')]=_[_0xb06f('0x27')](_0x323d5a,'name');_0x2a3789[_0xb06f('0x2e')]=_[_0xb06f('0x2f')](_0x39461d[_0xb06f('0x2e')]);_0x2a3789[_0xb06f('0x30')]=_[_0xb06f('0x31')](_0x2a3789['model'],_0x2a3789[_0xb06f('0x2e')]);_0x5b6413[_0xb06f('0x32')]=_[_0xb06f('0x31')](_0x2a3789[_0xb06f('0x2d')],qs[_0xb06f('0x33')](_0x39461d[_0xb06f('0x2e')][_0xb06f('0x33')]));_0x5b6413[_0xb06f('0x32')]=_0x5b6413['attributes'][_0xb06f('0x34')]?_0x5b6413[_0xb06f('0x32')]:_0x2a3789[_0xb06f('0x2d')];if(!_0x39461d[_0xb06f('0x2e')]['hasOwnProperty']('nolimit')){_0x5b6413['limit']=qs[_0xb06f('0x35')](_0x39461d['query'][_0xb06f('0x35')]);_0x5b6413['offset']=qs['offset'](_0x39461d[_0xb06f('0x2e')]['offset']);}_0x5b6413[_0xb06f('0x36')]=qs[_0xb06f('0x37')](_0x39461d[_0xb06f('0x2e')][_0xb06f('0x37')]);_0x5b6413[_0xb06f('0x38')]=qs['filters'](_[_0xb06f('0x39')](_0x39461d[_0xb06f('0x2e')],_0x2a3789['filters']),_0x323d5a);if(_0x39461d[_0xb06f('0x2e')][_0xb06f('0x3a')]){_0x5b6413[_0xb06f('0x38')]=_[_0xb06f('0x3b')](_0x5b6413[_0xb06f('0x38')],{'$or':_[_0xb06f('0x27')](_0x323d5a,function(_0x10feb2){if(_0x10feb2['type']!=='VIRTUAL'){var _0xca0063={};_0xca0063[_0x10feb2[_0xb06f('0x24')]]={'$like':'%'+_0x39461d[_0xb06f('0x2e')][_0xb06f('0x3a')]+'%'};return _0xca0063;}})});}_0x5b6413=_[_0xb06f('0x3b')]({},_0x5b6413,_0x39461d[_0xb06f('0x3c')]);var _0xe066b5={'where':_0x5b6413[_0xb06f('0x38')]};return db['VoiceDialReport'][_0xb06f('0x1b')](_0xe066b5)[_0xb06f('0x20')](function(_0x37fb73){_0xa238e2[_0xb06f('0x1b')]=_0x37fb73;if(_0x39461d[_0xb06f('0x2e')][_0xb06f('0x3d')]){_0x5b6413[_0xb06f('0x3e')]=[{'all':!![]}];}return db[_0xb06f('0x28')][_0xb06f('0x3f')](_0x5b6413);})[_0xb06f('0x20')](function(_0xff3d26){_0xa238e2[_0xb06f('0x40')]=_0xff3d26;return _0xa238e2;})[_0xb06f('0x20')](respondWithFilteredResult(_0x126b9b,_0x5b6413))['catch'](handleError(_0x126b9b,null));};exports['show']=function(_0x4d6c57,_0x4c79fd){var _0x48d617={'raw':!![],'where':{'id':_0x4d6c57['params']['id']}},_0x568cb={};_0x568cb[_0xb06f('0x2d')]=_[_0xb06f('0x2f')](db[_0xb06f('0x28')]['rawAttributes']);_0x568cb[_0xb06f('0x2e')]=_[_0xb06f('0x2f')](_0x4d6c57[_0xb06f('0x2e')]);_0x568cb['filters']=_[_0xb06f('0x31')](_0x568cb['model'],_0x568cb[_0xb06f('0x2e')]);_0x48d617[_0xb06f('0x32')]=_[_0xb06f('0x31')](_0x568cb[_0xb06f('0x2d')],qs['fields'](_0x4d6c57['query'][_0xb06f('0x33')]));_0x48d617[_0xb06f('0x32')]=_0x48d617[_0xb06f('0x32')]['length']?_0x48d617[_0xb06f('0x32')]:_0x568cb['model'];if(_0x4d6c57[_0xb06f('0x2e')][_0xb06f('0x3d')]){_0x48d617['include']=[{'all':!![]}];}_0x48d617=_[_0xb06f('0x3b')]({},_0x48d617,_0x4d6c57['options']);return db[_0xb06f('0x28')][_0xb06f('0x41')](_0x48d617)[_0xb06f('0x20')](handleEntityNotFound(_0x4c79fd,null))[_0xb06f('0x20')](respondWithResult(_0x4c79fd,null))[_0xb06f('0x42')](handleError(_0x4c79fd,null));};exports[_0xb06f('0x43')]=function(_0x275012,_0x1e6de7){return db[_0xb06f('0x28')][_0xb06f('0x43')](_0x275012[_0xb06f('0x44')],{})[_0xb06f('0x20')](respondWithResult(_0x1e6de7,0xc9))['catch'](handleError(_0x1e6de7,null));};exports[_0xb06f('0x1f')]=function(_0x34bb6f,_0x26fb72){if(_0x34bb6f['body']['id']){delete _0x34bb6f[_0xb06f('0x44')]['id'];}return db[_0xb06f('0x28')][_0xb06f('0x41')]({'where':{'id':_0x34bb6f[_0xb06f('0x45')]['id']}})[_0xb06f('0x20')](handleEntityNotFound(_0x26fb72,null))[_0xb06f('0x20')](saveUpdates(_0x34bb6f[_0xb06f('0x44')],null))[_0xb06f('0x20')](respondWithResult(_0x26fb72,null))[_0xb06f('0x42')](handleError(_0x26fb72,null));};exports[_0xb06f('0x21')]=function(_0x4a1403,_0x3805bc){return db[_0xb06f('0x28')]['find']({'where':{'id':_0x4a1403['params']['id']}})[_0xb06f('0x20')](handleEntityNotFound(_0x3805bc,null))[_0xb06f('0x20')](removeEntity(_0x3805bc,null))[_0xb06f('0x42')](handleError(_0x3805bc,null));};exports[_0xb06f('0x46')]=function(_0x32a03e,_0x2762f9){return db[_0xb06f('0x28')][_0xb06f('0x46')]()[_0xb06f('0x20')](respondWithResult(_0x2762f9,null))[_0xb06f('0x42')](handleError(_0x2762f9,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index e513cfa..2a4abd3 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 _0xd5a2=['define','VoiceDialReport','report_dial','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0xd5a2,0x12a));var _0x2d5a=function(_0x2f650a,_0x498dbc){_0x2f650a=_0x2f650a-0x0;var _0x470f81=_0xd5a2[_0x2f650a];return _0x470f81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2d5a('0x0'))(_0x2d5a('0x1'));var moment=require(_0x2d5a('0x2'));var BPromise=require(_0x2d5a('0x3'));var rp=require(_0x2d5a('0x4'));var fs=require('fs');var path=require(_0x2d5a('0x5'));var rimraf=require(_0x2d5a('0x6'));var config=require(_0x2d5a('0x7'));var attributes=require(_0x2d5a('0x8'));module[_0x2d5a('0x9')]=function(_0x3ed8a4,_0x4b23e2){return _0x3ed8a4[_0x2d5a('0xa')](_0x2d5a('0xb'),attributes,{'tableName':_0x2d5a('0xc'),'paranoid':![],'indexes':[{'fields':[_0x2d5a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2cdf=['exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x2cdf,0x19a));var _0xf2cd=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x2cdf[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xf2cd('0x0'));var util=require(_0xf2cd('0x1'));var logger=require(_0xf2cd('0x2'))(_0xf2cd('0x3'));var moment=require(_0xf2cd('0x4'));var BPromise=require(_0xf2cd('0x5'));var rp=require(_0xf2cd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf2cd('0x7'));var config=require(_0xf2cd('0x8'));var attributes=require(_0xf2cd('0x9'));module[_0xf2cd('0xa')]=function(_0xbceeb2,_0x461e49){return _0xbceeb2[_0xf2cd('0xb')](_0xf2cd('0xc'),attributes,{'tableName':_0xf2cd('0xd'),'paranoid':![],'indexes':[{'fields':[_0xf2cd('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 1312e1a..c40a181 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 _0x6597=['info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport','update','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3606e6,_0x2c6856){var _0x41be0d=function(_0x542887){while(--_0x542887){_0x3606e6['push'](_0x3606e6['shift']());}};_0x41be0d(++_0x2c6856);}(_0x6597,0x16e));var _0x7659=function(_0xe61ee6,_0xbc6de2){_0xe61ee6=_0xe61ee6-0x0;var _0x25e82e=_0x6597[_0xe61ee6];return _0x25e82e;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var moment=require(_0x7659('0x2'));var BPromise=require('bluebird');var rs=require(_0x7659('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7659('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7659('0x5'));var jayson=require(_0x7659('0x6'));var client=jayson[_0x7659('0x7')][_0x7659('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11cb28,_0x5c4e7f,_0x5ae101){return new BPromise(function(_0x3cfb33,_0x361918){return client[_0x7659('0x9')](_0x11cb28,_0x5ae101)[_0x7659('0xa')](function(_0x597553){logger[_0x7659('0xb')](_0x7659('0xc'),_0x5c4e7f,'request\x20sent');logger[_0x7659('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x5c4e7f,_0x7659('0xe'),JSON['stringify'](_0x597553));if(_0x597553[_0x7659('0xf')]){if(_0x597553[_0x7659('0xf')]['code']===0x1f4){logger[_0x7659('0xf')](_0x7659('0xc'),_0x5c4e7f,_0x597553['error'][_0x7659('0x10')]);return _0x361918(_0x597553['error']['message']);}logger[_0x7659('0xf')](_0x7659('0xc'),_0x5c4e7f,_0x597553[_0x7659('0xf')][_0x7659('0x10')]);return _0x3cfb33(_0x597553[_0x7659('0xf')]['message']);}else{logger['info'](_0x7659('0xc'),_0x5c4e7f,_0x7659('0xe'));_0x3cfb33(_0x597553[_0x7659('0x11')][_0x7659('0x10')]);}})[_0x7659('0x12')](function(_0x26a0f0){logger['error'](_0x7659('0xc'),_0x5c4e7f,_0x26a0f0);_0x361918(_0x26a0f0);});});}exports[_0x7659('0x13')]=function(_0x471b17){var _0x2f1e6c=this;return new Promise(function(_0x100953,_0x201fee){return db[_0x7659('0x14')][_0x7659('0x15')](_0x471b17[_0x7659('0x16')],{'raw':_0x471b17[_0x7659('0x17')]?_0x471b17[_0x7659('0x17')][_0x7659('0x18')]===undefined?!![]:![]:!![]})[_0x7659('0xa')](function(_0x25704c){logger[_0x7659('0xb')]('CreateVoiceDialReport',_0x471b17);logger[_0x7659('0xd')](_0x7659('0x13'),_0x471b17,JSON[_0x7659('0x19')](_0x25704c));_0x100953(_0x25704c);})[_0x7659('0x12')](function(_0x5a491d){logger['error'](_0x7659('0x13'),_0x5a491d[_0x7659('0x10')],_0x471b17);_0x201fee(_0x2f1e6c[_0x7659('0xf')](0x1f4,_0x5a491d['message']));});});};exports[_0x7659('0x1a')]=function(_0x2362ba){var _0x1824b0=this;return new Promise(function(_0x511636,_0x3cdb78){return db[_0x7659('0x14')][_0x7659('0x1b')](_0x2362ba[_0x7659('0x16')],{'raw':_0x2362ba[_0x7659('0x17')]?_0x2362ba[_0x7659('0x17')][_0x7659('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2362ba[_0x7659('0x17')]?_0x2362ba[_0x7659('0x17')]['where']||null:null,'attributes':_0x2362ba[_0x7659('0x17')]?_0x2362ba[_0x7659('0x17')]['attributes']||null:null,'limit':_0x2362ba[_0x7659('0x17')]?_0x2362ba['options'][_0x7659('0x1c')]||null:null})[_0x7659('0xa')](function(_0x28311e){logger['info'](_0x7659('0x1a'),_0x2362ba);logger[_0x7659('0xd')](_0x7659('0x1a'),_0x2362ba,JSON[_0x7659('0x19')](_0x28311e));_0x511636(_0x28311e);})[_0x7659('0x12')](function(_0x2b9602){logger[_0x7659('0xf')]('UpdateVoiceDialReport',_0x2b9602['message'],_0x2362ba);_0x3cdb78(_0x1824b0[_0x7659('0xf')](0x1f4,_0x2b9602[_0x7659('0x10')]));});});}; \ No newline at end of file +var _0xb2b3=['error','code','message','create','options','CreateVoiceDialReport','stringify','catch','UpdateVoiceDialReport','VoiceDialReport','body','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s'];(function(_0x362ee2,_0x33d2f7){var _0x57b467=function(_0x343e32){while(--_0x343e32){_0x362ee2['push'](_0x362ee2['shift']());}};_0x57b467(++_0x33d2f7);}(_0xb2b3,0x71));var _0x3b2b=function(_0x863267,_0x35d047){_0x863267=_0x863267-0x0;var _0x43ddac=_0xb2b3[_0x863267];return _0x43ddac;};'use strict';var _=require(_0x3b2b('0x0'));var util=require(_0x3b2b('0x1'));var moment=require(_0x3b2b('0x2'));var BPromise=require(_0x3b2b('0x3'));var rs=require(_0x3b2b('0x4'));var fs=require('fs');var Redis=require(_0x3b2b('0x5'));var db=require(_0x3b2b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3b2b('0x7'))(_0x3b2b('0x8'));var config=require(_0x3b2b('0x9'));var jayson=require(_0x3b2b('0xa'));var client=jayson[_0x3b2b('0xb')][_0x3b2b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x83e7ef,_0x24b585,_0x1a9054){return new BPromise(function(_0x3ec416,_0x33b807){return client[_0x3b2b('0xd')](_0x83e7ef,_0x1a9054)['then'](function(_0x430be0){logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));logger[_0x3b2b('0x11')](_0x3b2b('0x12'),_0x24b585,'request\x20sent',JSON['stringify'](_0x430be0));if(_0x430be0[_0x3b2b('0x13')]){if(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x14')]===0x1f4){logger[_0x3b2b('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x24b585,_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);return _0x33b807(_0x430be0[_0x3b2b('0x13')][_0x3b2b('0x15')]);}logger[_0x3b2b('0x13')](_0x3b2b('0xf'),_0x24b585,_0x430be0['error'][_0x3b2b('0x15')]);return _0x3ec416(_0x430be0[_0x3b2b('0x13')]['message']);}else{logger[_0x3b2b('0xe')](_0x3b2b('0xf'),_0x24b585,_0x3b2b('0x10'));_0x3ec416(_0x430be0['result'][_0x3b2b('0x15')]);}})['catch'](function(_0x21743d){logger[_0x3b2b('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x24b585,_0x21743d);_0x33b807(_0x21743d);});});}exports['CreateVoiceDialReport']=function(_0x1a3bfb){var _0x52bba5=this;return new Promise(function(_0x157155,_0x30e4c2){return db['VoiceDialReport'][_0x3b2b('0x16')](_0x1a3bfb['body'],{'raw':_0x1a3bfb[_0x3b2b('0x17')]?_0x1a3bfb[_0x3b2b('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1d786b){logger[_0x3b2b('0xe')](_0x3b2b('0x18'),_0x1a3bfb);logger[_0x3b2b('0x11')](_0x3b2b('0x18'),_0x1a3bfb,JSON[_0x3b2b('0x19')](_0x1d786b));_0x157155(_0x1d786b);})[_0x3b2b('0x1a')](function(_0xc5b0bf){logger[_0x3b2b('0x13')](_0x3b2b('0x18'),_0xc5b0bf[_0x3b2b('0x15')],_0x1a3bfb);_0x30e4c2(_0x52bba5['error'](0x1f4,_0xc5b0bf[_0x3b2b('0x15')]));});});};exports[_0x3b2b('0x1b')]=function(_0x252e36){var _0x50e95c=this;return new Promise(function(_0x306739,_0x5ef8cf){return db[_0x3b2b('0x1c')]['update'](_0x252e36[_0x3b2b('0x1d')],{'raw':_0x252e36['options']?_0x252e36['options'][_0x3b2b('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252e36[_0x3b2b('0x17')]?_0x252e36[_0x3b2b('0x17')][_0x3b2b('0x1f')]||null:null,'attributes':_0x252e36[_0x3b2b('0x17')]?_0x252e36[_0x3b2b('0x17')][_0x3b2b('0x20')]||null:null,'limit':_0x252e36[_0x3b2b('0x17')]?_0x252e36[_0x3b2b('0x17')]['limit']||null:null})['then'](function(_0x4fc420){logger['info'](_0x3b2b('0x1b'),_0x252e36);logger[_0x3b2b('0x11')](_0x3b2b('0x1b'),_0x252e36,JSON[_0x3b2b('0x19')](_0x4fc420));_0x306739(_0x4fc420);})[_0x3b2b('0x1a')](function(_0x34fc22){logger[_0x3b2b('0x13')]('UpdateVoiceDialReport',_0x34fc22[_0x3b2b('0x15')],_0x252e36);_0x5ef8cf(_0x50e95c['error'](0x1f4,_0x34fc22['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a90485b..7ee8b12 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 _0x0b6a=['get','isAuthenticated','index','/:id','show','post','create','/:id/applications','addApplications','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x3ba79c,_0x1547d2){var _0xd2d1a4=function(_0x429fd1){while(--_0x429fd1){_0x3ba79c['push'](_0x3ba79c['shift']());}};_0xd2d1a4(++_0x1547d2);}(_0x0b6a,0x138));var _0xa0b6=function(_0x496fc2,_0x2af414){_0x496fc2=_0x496fc2-0x0;var _0x3c16a1=_0x0b6a[_0x496fc2];return _0x3c16a1;};'use strict';var multer=require(_0xa0b6('0x0'));var util=require(_0xa0b6('0x1'));var path=require(_0xa0b6('0x2'));var timeout=require('connect-timeout');var express=require(_0xa0b6('0x3'));var router=express[_0xa0b6('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa0b6('0x5'));var config=require(_0xa0b6('0x6'));var controller=require(_0xa0b6('0x7'));router[_0xa0b6('0x8')]('/',auth[_0xa0b6('0x9')](),controller[_0xa0b6('0xa')]);router[_0xa0b6('0x8')](_0xa0b6('0xb'),auth[_0xa0b6('0x9')](),controller[_0xa0b6('0xc')]);router[_0xa0b6('0xd')]('/',auth['isAuthenticated'](),controller[_0xa0b6('0xe')]);router[_0xa0b6('0xd')](_0xa0b6('0xf'),auth[_0xa0b6('0x9')](),controller[_0xa0b6('0x10')]);router['put']('/:id',auth[_0xa0b6('0x9')](),controller['update']);router[_0xa0b6('0x11')](_0xa0b6('0xb'),auth[_0xa0b6('0x9')](),controller[_0xa0b6('0x12')]);module[_0xa0b6('0x13')]=router; \ No newline at end of file +var _0x7b50=['isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','index','get','/:id'];(function(_0x245afe,_0x319cde){var _0x4eefde=function(_0x15a1fa){while(--_0x15a1fa){_0x245afe['push'](_0x245afe['shift']());}};_0x4eefde(++_0x319cde);}(_0x7b50,0xdd));var _0x07b5=function(_0x538011,_0x1762b7){_0x538011=_0x538011-0x0;var _0x11f31c=_0x7b50[_0x538011];return _0x11f31c;};'use strict';var multer=require(_0x07b5('0x0'));var util=require(_0x07b5('0x1'));var path=require(_0x07b5('0x2'));var timeout=require('connect-timeout');var express=require(_0x07b5('0x3'));var router=express[_0x07b5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x07b5('0x5'));var config=require(_0x07b5('0x6'));var controller=require('./voiceExtension.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x07b5('0x7')]);router[_0x07b5('0x8')](_0x07b5('0x9'),auth[_0x07b5('0xa')](),controller[_0x07b5('0xb')]);router[_0x07b5('0xc')]('/',auth[_0x07b5('0xa')](),controller[_0x07b5('0xd')]);router['post'](_0x07b5('0xe'),auth[_0x07b5('0xa')](),controller[_0x07b5('0xf')]);router[_0x07b5('0x10')]('/:id',auth[_0x07b5('0xa')](),controller[_0x07b5('0x11')]);router[_0x07b5('0x12')](_0x07b5('0x9'),auth[_0x07b5('0xa')](),controller[_0x07b5('0x13')]);module[_0x07b5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 22c917a..f6dd22b 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(_0x221a48,_0x33c154){var _0xdadcb3=function(_0x5ade41){while(--_0x5ade41){_0x221a48['push'](_0x221a48['shift']());}};_0xdadcb3(++_0x33c154);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x46276d,_0x1aa61b){var _0x4d1068=function(_0x4773f5){while(--_0x4773f5){_0x46276d['push'](_0x46276d['shift']());}};_0x4d1068(++_0x1aa61b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 2c95436..7c88ec4 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 _0x57ca=['then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','sort','pick','merge','where','VoiceExtension','includeAll','include','findAll','rows','catch','show','params','options','create','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','json','apply','reject','save','update'];(function(_0x1ddd1f,_0x1ea7fe){var _0xee54ff=function(_0x391dc1){while(--_0x391dc1){_0x1ddd1f['push'](_0x1ddd1f['shift']());}};_0xee54ff(++_0x1ea7fe);}(_0x57ca,0x108));var _0xa57c=function(_0x5d4b4b,_0xf154cb){_0x5d4b4b=_0x5d4b4b-0x0;var _0x2337b8=_0x57ca[_0x5d4b4b];return _0x2337b8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var db=require(_0xa57c('0x15'))['db'];config[_0xa57c('0x16')]=_[_0xa57c('0x17')](config[_0xa57c('0x16')],{'host':_0xa57c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0x16')]));require('./voiceExtension.socket')[_0xa57c('0x19')](socket);function respondWithStatusCode(_0x3d5995,_0x30940d){_0x30940d=_0x30940d||0xcc;return function(_0x3821d2){if(_0x3821d2){return _0x3d5995[_0xa57c('0x1a')](_0x30940d);}return _0x3d5995[_0xa57c('0x1b')](_0x30940d)[_0xa57c('0x1c')]();};}function respondWithResult(_0x4b4bdb,_0x26607a){_0x26607a=_0x26607a||0xc8;return function(_0xdf7ff6){if(_0xdf7ff6){return _0x4b4bdb[_0xa57c('0x1b')](_0x26607a)['json'](_0xdf7ff6);}};}function respondWithFilteredResult(_0x2746a0,_0x5f33f1){return function(_0x3e7afa){if(_0x3e7afa){var _0x3d781d=_0x3e7afa[_0xa57c('0x1d')],_0x93462c=_0x5f33f1[_0xa57c('0x1e')],_0xe3d505=_0x5f33f1[_0xa57c('0x1e')]+_0x5f33f1['limit'],_0x1fd0d8;if(_0xe3d505>=_0x3d781d){_0xe3d505=_0x3d781d;_0x1fd0d8=0xc8;}else{_0x1fd0d8=0xce;}_0x2746a0[_0xa57c('0x1b')](_0x1fd0d8);return _0x2746a0['set']('Content-Range',_0x93462c+'-'+_0xe3d505+'/'+_0x3d781d)[_0xa57c('0x1f')](_0x3e7afa);}return null;};}function patchUpdates(_0xa5b314){return function(_0x3eee75){try{jsonpatch[_0xa57c('0x20')](_0x3eee75,_0xa5b314,!![]);}catch(_0x49242c){return BPromise[_0xa57c('0x21')](_0x49242c);}return _0x3eee75[_0xa57c('0x22')]();};}function saveUpdates(_0x34d1bc,_0x2213b2){return function(_0x3bb969){if(_0x3bb969){return _0x3bb969[_0xa57c('0x23')](_0x34d1bc)[_0xa57c('0x24')](function(_0x42038e){return _0x42038e;});}return null;};}function removeEntity(_0x2e99ed,_0xdf65dd){return function(_0x382a26){if(_0x382a26){return _0x382a26[_0xa57c('0x25')]()[_0xa57c('0x24')](function(){var _0x10a33d=_0x382a26[_0xa57c('0x26')]({'plain':!![]});var _0x511a26=[{'name':_0xa57c('0x27'),'value':_0xa57c('0x28'),'ignore':![]},{'name':_0xa57c('0x29'),'value':_0xa57c('0x2a'),'ignore':![]},{'name':_0xa57c('0x2b'),'value':_0xa57c('0x2c'),'ignore':![]}];var _0x8ee1c0=_(_0x511a26)[_0xa57c('0x2d')](_0xa57c('0x2e'))[_0xa57c('0x2f')]('value')[_0xa57c('0x30')]();if(_['includes'](_0x8ee1c0,_0x10a33d['type'])){return;}var _0x257661=_[_0xa57c('0x31')](_0x511a26,['value',_0x10a33d[_0xa57c('0x32')]])[_0xa57c('0x33')];return db[_0xa57c('0x34')]['destroy']({'where':{'type':_0x257661,'resourceId':_0x10a33d['id']}})[_0xa57c('0x24')](function(){return _0x382a26;});})['then'](function(){_0x2e99ed[_0xa57c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3bbe,_0x51ad09){return function(_0xd4c5d4){if(!_0xd4c5d4){_0x2a3bbe['sendStatus'](0x194);}return _0xd4c5d4;};}function handleError(_0x9e02bb,_0x1d82d9){_0x1d82d9=_0x1d82d9||0x1f4;return function(_0x43c8f3){logger[_0xa57c('0x35')](_0x43c8f3[_0xa57c('0x36')]);if(_0x43c8f3[_0xa57c('0x33')]){delete _0x43c8f3[_0xa57c('0x33')];}_0x9e02bb['status'](_0x1d82d9)[_0xa57c('0x37')](_0x43c8f3);};}exports['index']=function(_0xbece0a,_0x315787){var _0x27ada0={},_0x587ce1={},_0x289174={'count':0x0,'rows':[]};var _0x4901a8=_[_0xa57c('0x2f')](db['VoiceExtension'][_0xa57c('0x38')],function(_0x494b8a){return{'name':_0x494b8a[_0xa57c('0x39')],'type':_0x494b8a[_0xa57c('0x32')]['key']};});_0x587ce1[_0xa57c('0x3a')]=_['map'](_0x4901a8,_0xa57c('0x33'));_0x587ce1['query']=_[_0xa57c('0x3b')](_0xbece0a[_0xa57c('0x3c')]);_0x587ce1[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x587ce1[_0xa57c('0x3a')],_0x587ce1[_0xa57c('0x3c')]);_0x27ada0['attributes']=_['intersection'](_0x587ce1[_0xa57c('0x3a')],qs[_0xa57c('0x3f')](_0xbece0a[_0xa57c('0x3c')]['fields']));_0x27ada0[_0xa57c('0x40')]=_0x27ada0['attributes'][_0xa57c('0x41')]?_0x27ada0[_0xa57c('0x40')]:_0x587ce1['model'];if(!_0xbece0a['query']['hasOwnProperty'](_0xa57c('0x42'))){_0x27ada0[_0xa57c('0x43')]=qs[_0xa57c('0x43')](_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x43')]);_0x27ada0[_0xa57c('0x1e')]=qs['offset'](_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x1e')]);}_0x27ada0['order']=qs['sort'](_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x44')]);_0x27ada0['where']=qs[_0xa57c('0x3d')](_[_0xa57c('0x45')](_0xbece0a[_0xa57c('0x3c')],_0x587ce1[_0xa57c('0x3d')]),_0x4901a8);if(_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x2d')]){_0x27ada0['where']=_[_0xa57c('0x46')](_0x27ada0['where'],{'$or':_['map'](_0x4901a8,function(_0x5b3300){if(_0x5b3300['type']!=='VIRTUAL'){var _0x39b20f={};_0x39b20f[_0x5b3300[_0xa57c('0x33')]]={'$like':'%'+_0xbece0a[_0xa57c('0x3c')]['filter']+'%'};return _0x39b20f;}})});}_0x27ada0=_['merge']({},_0x27ada0,_0xbece0a['options']);var _0x44f1e8={'where':_0x27ada0[_0xa57c('0x47')]};return db[_0xa57c('0x48')][_0xa57c('0x1d')](_0x44f1e8)[_0xa57c('0x24')](function(_0x17c5dd){_0x289174['count']=_0x17c5dd;if(_0xbece0a[_0xa57c('0x3c')][_0xa57c('0x49')]){_0x27ada0[_0xa57c('0x4a')]=[{'all':!![]}];}return db[_0xa57c('0x48')][_0xa57c('0x4b')](_0x27ada0);})[_0xa57c('0x24')](function(_0x4f2997){_0x289174[_0xa57c('0x4c')]=_0x4f2997;return _0x289174;})[_0xa57c('0x24')](respondWithFilteredResult(_0x315787,_0x27ada0))[_0xa57c('0x4d')](handleError(_0x315787,null));};exports[_0xa57c('0x4e')]=function(_0x269dfd,_0x4eb51e){var _0x209c67={'raw':![],'where':{'id':_0x269dfd[_0xa57c('0x4f')]['id']}},_0x13ede7={};_0x13ede7[_0xa57c('0x3a')]=_[_0xa57c('0x3b')](db[_0xa57c('0x48')]['rawAttributes']);_0x13ede7[_0xa57c('0x3c')]=_[_0xa57c('0x3b')](_0x269dfd[_0xa57c('0x3c')]);_0x13ede7[_0xa57c('0x3d')]=_[_0xa57c('0x3e')](_0x13ede7[_0xa57c('0x3a')],_0x13ede7['query']);_0x209c67['attributes']=_['intersection'](_0x13ede7['model'],qs[_0xa57c('0x3f')](_0x269dfd['query'][_0xa57c('0x3f')]));_0x209c67[_0xa57c('0x40')]=_0x209c67['attributes'][_0xa57c('0x41')]?_0x209c67[_0xa57c('0x40')]:_0x13ede7[_0xa57c('0x3a')];if(_0x269dfd[_0xa57c('0x3c')][_0xa57c('0x49')]){_0x209c67['include']=[{'all':!![]}];}_0x209c67=_[_0xa57c('0x46')]({},_0x209c67,_0x269dfd[_0xa57c('0x50')]);return db[_0xa57c('0x48')][_0xa57c('0x31')](_0x209c67)[_0xa57c('0x24')](handleEntityNotFound(_0x4eb51e,null))['then'](respondWithResult(_0x4eb51e,null))[_0xa57c('0x4d')](handleError(_0x4eb51e,null));};exports['destroy']=function(_0x5be160,_0x464233){return db[_0xa57c('0x48')][_0xa57c('0x31')]({'where':{'id':_0x5be160['params']['id']}})['then'](handleEntityNotFound(_0x464233,null))[_0xa57c('0x24')](removeEntity(_0x464233,null))[_0xa57c('0x4d')](handleError(_0x464233,null));};exports[_0xa57c('0x51')]=function(_0x33d451,_0x4d2899){if(_0x33d451[_0xa57c('0x52')][_0xa57c('0x32')]===_0xa57c('0x2a')&&!_['startsWith'](_0x33d451['body'][_0xa57c('0x53')],'_')){_0x33d451[_0xa57c('0x52')]['exten']='_'[_0xa57c('0x54')](_0x33d451[_0xa57c('0x52')][_0xa57c('0x53')]);}return db[_0xa57c('0x48')][_0xa57c('0x51')](_0x33d451[_0xa57c('0x52')],{'raw':![]})[_0xa57c('0x24')](function(_0x4ee02a){var _0x523a79=_0x33d451[_0xa57c('0x55')][_0xa57c('0x26')]({'plain':!![]});if(!_0x523a79)throw new Error(_0xa57c('0x56'));if(_0x523a79[_0xa57c('0x57')]===_0xa57c('0x55')){var _0x3804a3=_0x4ee02a[_0xa57c('0x26')]({'plain':!![]});var _0x4519a0=[{'name':'InboundRoutes','value':'inbound'},{'name':_0xa57c('0x29'),'value':'outbound'},{'name':_0xa57c('0x2b'),'value':_0xa57c('0x2c')}];var _0x6c56db=_['find'](_0x4519a0,[_0xa57c('0x30'),_0x3804a3['type']])[_0xa57c('0x33')];return db['UserProfileSection'][_0xa57c('0x31')]({'where':{'name':_0x6c56db,'userProfileId':_0x523a79[_0xa57c('0x58')]},'raw':!![]})[_0xa57c('0x24')](function(_0x26a8e1){if(_0x26a8e1&&_0x26a8e1['autoAssociation']===0x0){return db[_0xa57c('0x34')][_0xa57c('0x51')]({'name':_0x3804a3[_0xa57c('0x33')],'resourceId':_0x3804a3['id'],'type':_0x26a8e1[_0xa57c('0x33')],'sectionId':_0x26a8e1['id']},{})[_0xa57c('0x24')](function(){return _0x4ee02a;});}else{return _0x4ee02a;}})['catch'](function(_0x13afd0){logger[_0xa57c('0x35')](_0xa57c('0x59'),_0x13afd0);throw _0x13afd0;});}return _0x4ee02a;})[_0xa57c('0x24')](respondWithResult(_0x4d2899,0xc9))[_0xa57c('0x4d')](handleError(_0x4d2899,null));};exports[_0xa57c('0x23')]=function(_0x143ec3,_0x419527){if(_0x143ec3[_0xa57c('0x52')]['id']){delete _0x143ec3[_0xa57c('0x52')]['id'];}return db['VoiceExtension'][_0xa57c('0x31')]({'where':{'id':_0x143ec3[_0xa57c('0x4f')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x419527,null))[_0xa57c('0x24')](function(_0x2d4fe3){if(_0x2d4fe3){return db[_0xa57c('0x48')]['update'](_[_0xa57c('0x45')](_0x143ec3[_0xa57c('0x52')],['exten',_0xa57c('0x5a'),_0xa57c('0x5b'),_0xa57c('0x5c'),_0xa57c('0x5d'),_0xa57c('0x5e')]),{'where':{'context':_0x2d4fe3[_0xa57c('0x5a')],'exten':_0x2d4fe3[_0xa57c('0x53')]},'individualHooks':!![]})['then'](function(_0xaa82e1){return _0xaa82e1;});}return null;})['then'](respondWithStatusCode(_0x419527,null))[_0xa57c('0x4d')](handleError(_0x419527,null));};exports['addApplications']=function(_0x1a8686,_0x5a0e62,_0x3ef1f1){return db[_0xa57c('0x48')]['findOne']({'where':{'id':_0x1a8686[_0xa57c('0x4f')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x5a0e62,null))[_0xa57c('0x24')](function(_0x144a5d){if(_0x144a5d){return db['sequelize'][_0xa57c('0x5f')](function(_0x13524b){return db[_0xa57c('0x48')][_0xa57c('0x25')]({'where':{'VoiceExtensionId':_0x1a8686[_0xa57c('0x4f')]['id']},'transaction':_0x13524b})[_0xa57c('0x24')](function(_0x308ce5){var _0x2a5983=_[_0xa57c('0x2f')](_0x1a8686[_0xa57c('0x52')],function(_0x1c8b97){_0x1c8b97[_0xa57c('0x60')]=_0x1a8686[_0xa57c('0x4f')]['id'];return _0x1c8b97;});return db[_0xa57c('0x48')][_0xa57c('0x61')](_0x2a5983,{'transaction':_0x13524b});});})[_0xa57c('0x24')](function(){return db['VoiceExtension'][_0xa57c('0x62')]({'where':{'isApp':!![],'VoiceExtensionId':_0x1a8686['params']['id']},'order':_0xa57c('0x63')});});}})[_0xa57c('0x24')](respondWithResult(_0x5a0e62,null))[_0xa57c('0x4d')](handleError(_0x5a0e62,null));}; \ No newline at end of file +var _0xef0f=['hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','catch','params','include','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','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','status','json','count','offset','limit','set','Content-Range','reject','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','send','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0xc7867b,_0x57cd82){var _0xaf5ce3=function(_0x4cdf2c){while(--_0x4cdf2c){_0xc7867b['push'](_0xc7867b['shift']());}};_0xaf5ce3(++_0x57cd82);}(_0xef0f,0x168));var _0xfef0=function(_0x4c9df7,_0x192daf){_0x4c9df7=_0x4c9df7-0x0;var _0x18d7f0=_0xef0f[_0x4c9df7];return _0x18d7f0;};'use strict';var pdf=require(_0xfef0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfef0('0x1'));var zipdir=require(_0xfef0('0x2'));var jsonpatch=require(_0xfef0('0x3'));var rp=require('request-promise');var moment=require(_0xfef0('0x4'));var BPromise=require(_0xfef0('0x5'));var Mustache=require(_0xfef0('0x6'));var util=require('util');var path=require(_0xfef0('0x7'));var sox=require(_0xfef0('0x8'));var csv=require(_0xfef0('0x9'));var ejs=require(_0xfef0('0xa'));var fs=require('fs');var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x9'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var db=require(_0xfef0('0x19'))['db'];config[_0xfef0('0x1a')]=_['defaults'](config[_0xfef0('0x1a')],{'host':_0xfef0('0x1b'),'port':0x18eb});var socket=require(_0xfef0('0x1c'))(new Redis(config[_0xfef0('0x1a')]));require(_0xfef0('0x1d'))[_0xfef0('0x1e')](socket);function respondWithStatusCode(_0xa9f040,_0x573ae7){_0x573ae7=_0x573ae7||0xcc;return function(_0x3d1f02){if(_0x3d1f02){return _0xa9f040['sendStatus'](_0x573ae7);}return _0xa9f040['status'](_0x573ae7)['end']();};}function respondWithResult(_0x118b8d,_0x284b6d){_0x284b6d=_0x284b6d||0xc8;return function(_0x3510a7){if(_0x3510a7){return _0x118b8d[_0xfef0('0x1f')](_0x284b6d)[_0xfef0('0x20')](_0x3510a7);}};}function respondWithFilteredResult(_0x3f9a6c,_0x155833){return function(_0x2887e6){if(_0x2887e6){var _0x581459=_0x2887e6[_0xfef0('0x21')],_0xd60678=_0x155833[_0xfef0('0x22')],_0x1642cd=_0x155833['offset']+_0x155833[_0xfef0('0x23')],_0x1577fa;if(_0x1642cd>=_0x581459){_0x1642cd=_0x581459;_0x1577fa=0xc8;}else{_0x1577fa=0xce;}_0x3f9a6c['status'](_0x1577fa);return _0x3f9a6c[_0xfef0('0x24')](_0xfef0('0x25'),_0xd60678+'-'+_0x1642cd+'/'+_0x581459)[_0xfef0('0x20')](_0x2887e6);}return null;};}function patchUpdates(_0x48408a){return function(_0x2be956){try{jsonpatch['apply'](_0x2be956,_0x48408a,!![]);}catch(_0x4074b7){return BPromise[_0xfef0('0x26')](_0x4074b7);}return _0x2be956['save']();};}function saveUpdates(_0x4897af,_0x4b8b22){return function(_0x19fde8){if(_0x19fde8){return _0x19fde8['update'](_0x4897af)[_0xfef0('0x27')](function(_0x46b34a){return _0x46b34a;});}return null;};}function removeEntity(_0x1a8d66,_0x4483f2){return function(_0x249fe4){if(_0x249fe4){return _0x249fe4[_0xfef0('0x28')]()['then'](function(){var _0x4ac8c5=_0x249fe4[_0xfef0('0x29')]({'plain':!![]});var _0x1ffaa4=[{'name':_0xfef0('0x2a'),'value':_0xfef0('0x2b'),'ignore':![]},{'name':_0xfef0('0x2c'),'value':_0xfef0('0x2d'),'ignore':![]},{'name':_0xfef0('0x2e'),'value':_0xfef0('0x2f'),'ignore':![]}];var _0x391279=_(_0x1ffaa4)['filter'](_0xfef0('0x30'))[_0xfef0('0x31')](_0xfef0('0x32'))[_0xfef0('0x32')]();if(_[_0xfef0('0x33')](_0x391279,_0x4ac8c5[_0xfef0('0x34')])){return;}var _0x3e3c4c=_[_0xfef0('0x35')](_0x1ffaa4,[_0xfef0('0x32'),_0x4ac8c5[_0xfef0('0x34')]])[_0xfef0('0x36')];return db[_0xfef0('0x37')]['destroy']({'where':{'type':_0x3e3c4c,'resourceId':_0x4ac8c5['id']}})[_0xfef0('0x27')](function(){return _0x249fe4;});})['then'](function(){_0x1a8d66['status'](0xcc)[_0xfef0('0x38')]();});}};}function handleEntityNotFound(_0x2ae54a,_0x4a481d){return function(_0x4bbdba){if(!_0x4bbdba){_0x2ae54a['sendStatus'](0x194);}return _0x4bbdba;};}function handleError(_0x4f65cd,_0x4cce8a){_0x4cce8a=_0x4cce8a||0x1f4;return function(_0x417535){logger[_0xfef0('0x39')](_0x417535[_0xfef0('0x3a')]);if(_0x417535['name']){delete _0x417535['name'];}_0x4f65cd['status'](_0x4cce8a)[_0xfef0('0x3b')](_0x417535);};}exports['index']=function(_0x215032,_0x3783f9){var _0x1b9f39={},_0x4a2773={},_0x3cad13={'count':0x0,'rows':[]};var _0x4c3a0f=_[_0xfef0('0x31')](db[_0xfef0('0x3c')][_0xfef0('0x3d')],function(_0xe5188e){return{'name':_0xe5188e[_0xfef0('0x3e')],'type':_0xe5188e[_0xfef0('0x34')][_0xfef0('0x3f')]};});_0x4a2773[_0xfef0('0x40')]=_['map'](_0x4c3a0f,_0xfef0('0x36'));_0x4a2773[_0xfef0('0x41')]=_[_0xfef0('0x42')](_0x215032[_0xfef0('0x41')]);_0x4a2773[_0xfef0('0x43')]=_[_0xfef0('0x44')](_0x4a2773[_0xfef0('0x40')],_0x4a2773[_0xfef0('0x41')]);_0x1b9f39[_0xfef0('0x45')]=_[_0xfef0('0x44')](_0x4a2773[_0xfef0('0x40')],qs[_0xfef0('0x46')](_0x215032[_0xfef0('0x41')]['fields']));_0x1b9f39[_0xfef0('0x45')]=_0x1b9f39['attributes'][_0xfef0('0x47')]?_0x1b9f39[_0xfef0('0x45')]:_0x4a2773[_0xfef0('0x40')];if(!_0x215032['query'][_0xfef0('0x48')](_0xfef0('0x49'))){_0x1b9f39[_0xfef0('0x23')]=qs['limit'](_0x215032[_0xfef0('0x41')][_0xfef0('0x23')]);_0x1b9f39[_0xfef0('0x22')]=qs['offset'](_0x215032[_0xfef0('0x41')]['offset']);}_0x1b9f39['order']=qs[_0xfef0('0x4a')](_0x215032['query']['sort']);_0x1b9f39[_0xfef0('0x4b')]=qs[_0xfef0('0x43')](_[_0xfef0('0x4c')](_0x215032[_0xfef0('0x41')],_0x4a2773[_0xfef0('0x43')]),_0x4c3a0f);if(_0x215032[_0xfef0('0x41')]['filter']){_0x1b9f39[_0xfef0('0x4b')]=_[_0xfef0('0x4d')](_0x1b9f39['where'],{'$or':_['map'](_0x4c3a0f,function(_0x1d554e){if(_0x1d554e['type']!==_0xfef0('0x4e')){var _0x22c940={};_0x22c940[_0x1d554e[_0xfef0('0x36')]]={'$like':'%'+_0x215032[_0xfef0('0x41')][_0xfef0('0x4f')]+'%'};return _0x22c940;}})});}_0x1b9f39=_[_0xfef0('0x4d')]({},_0x1b9f39,_0x215032[_0xfef0('0x50')]);var _0x15b4a6={'where':_0x1b9f39['where']};return db[_0xfef0('0x3c')]['count'](_0x15b4a6)['then'](function(_0x18c656){_0x3cad13[_0xfef0('0x21')]=_0x18c656;if(_0x215032['query'][_0xfef0('0x51')]){_0x1b9f39['include']=[{'all':!![]}];}return db[_0xfef0('0x3c')][_0xfef0('0x52')](_0x1b9f39);})[_0xfef0('0x27')](function(_0x115e64){_0x3cad13['rows']=_0x115e64;return _0x3cad13;})[_0xfef0('0x27')](respondWithFilteredResult(_0x3783f9,_0x1b9f39))[_0xfef0('0x53')](handleError(_0x3783f9,null));};exports['show']=function(_0x4cafd1,_0x392607){var _0x4f3231={'raw':![],'where':{'id':_0x4cafd1[_0xfef0('0x54')]['id']}},_0x32392a={};_0x32392a[_0xfef0('0x40')]=_[_0xfef0('0x42')](db[_0xfef0('0x3c')][_0xfef0('0x3d')]);_0x32392a['query']=_[_0xfef0('0x42')](_0x4cafd1['query']);_0x32392a['filters']=_[_0xfef0('0x44')](_0x32392a[_0xfef0('0x40')],_0x32392a[_0xfef0('0x41')]);_0x4f3231['attributes']=_[_0xfef0('0x44')](_0x32392a['model'],qs['fields'](_0x4cafd1['query'][_0xfef0('0x46')]));_0x4f3231[_0xfef0('0x45')]=_0x4f3231[_0xfef0('0x45')][_0xfef0('0x47')]?_0x4f3231[_0xfef0('0x45')]:_0x32392a[_0xfef0('0x40')];if(_0x4cafd1[_0xfef0('0x41')][_0xfef0('0x51')]){_0x4f3231[_0xfef0('0x55')]=[{'all':!![]}];}_0x4f3231=_['merge']({},_0x4f3231,_0x4cafd1['options']);return db[_0xfef0('0x3c')][_0xfef0('0x35')](_0x4f3231)[_0xfef0('0x27')](handleEntityNotFound(_0x392607,null))[_0xfef0('0x27')](respondWithResult(_0x392607,null))[_0xfef0('0x53')](handleError(_0x392607,null));};exports[_0xfef0('0x28')]=function(_0x1ec15d,_0x20b647){return db['VoiceExtension'][_0xfef0('0x35')]({'where':{'id':_0x1ec15d[_0xfef0('0x54')]['id']}})[_0xfef0('0x27')](handleEntityNotFound(_0x20b647,null))[_0xfef0('0x27')](removeEntity(_0x20b647,null))[_0xfef0('0x53')](handleError(_0x20b647,null));};exports['create']=function(_0x5b3592,_0x523763){if(_0x5b3592[_0xfef0('0x56')][_0xfef0('0x34')]===_0xfef0('0x2d')&&!_[_0xfef0('0x57')](_0x5b3592['body'][_0xfef0('0x58')],'_')){_0x5b3592[_0xfef0('0x56')][_0xfef0('0x58')]='_'[_0xfef0('0x59')](_0x5b3592[_0xfef0('0x56')][_0xfef0('0x58')]);}return db[_0xfef0('0x3c')]['create'](_0x5b3592[_0xfef0('0x56')],{'raw':![]})[_0xfef0('0x27')](function(_0x47f17a){var _0x291f3f=_0x5b3592['user'][_0xfef0('0x29')]({'plain':!![]});if(!_0x291f3f)throw new Error(_0xfef0('0x5a'));if(_0x291f3f['role']===_0xfef0('0x5b')){var _0x49ec3c=_0x47f17a['get']({'plain':!![]});var _0x4812c7=[{'name':_0xfef0('0x2a'),'value':_0xfef0('0x2b')},{'name':_0xfef0('0x2c'),'value':_0xfef0('0x2d')},{'name':_0xfef0('0x2e'),'value':_0xfef0('0x2f')}];var _0x5b5664=_[_0xfef0('0x35')](_0x4812c7,[_0xfef0('0x32'),_0x49ec3c[_0xfef0('0x34')]])[_0xfef0('0x36')];return db[_0xfef0('0x5c')]['find']({'where':{'name':_0x5b5664,'userProfileId':_0x291f3f[_0xfef0('0x5d')]},'raw':!![]})['then'](function(_0x135653){if(_0x135653&&_0x135653['autoAssociation']===0x0){return db[_0xfef0('0x37')][_0xfef0('0x5e')]({'name':_0x49ec3c[_0xfef0('0x36')],'resourceId':_0x49ec3c['id'],'type':_0x135653[_0xfef0('0x36')],'sectionId':_0x135653['id']},{})[_0xfef0('0x27')](function(){return _0x47f17a;});}else{return _0x47f17a;}})['catch'](function(_0x2abdb7){logger['error'](_0xfef0('0x5f'),_0x2abdb7);throw _0x2abdb7;});}return _0x47f17a;})[_0xfef0('0x27')](respondWithResult(_0x523763,0xc9))['catch'](handleError(_0x523763,null));};exports[_0xfef0('0x60')]=function(_0x3c5640,_0xd6de4d){if(_0x3c5640[_0xfef0('0x56')]['id']){delete _0x3c5640[_0xfef0('0x56')]['id'];}return db[_0xfef0('0x3c')][_0xfef0('0x35')]({'where':{'id':_0x3c5640[_0xfef0('0x54')]['id']}})[_0xfef0('0x27')](handleEntityNotFound(_0xd6de4d,null))[_0xfef0('0x27')](function(_0x2acb4e){if(_0x2acb4e){return db[_0xfef0('0x3c')]['update'](_[_0xfef0('0x4c')](_0x3c5640[_0xfef0('0x56')],[_0xfef0('0x58'),_0xfef0('0x61'),_0xfef0('0x62'),'recordingFormat',_0xfef0('0x63'),_0xfef0('0x64')]),{'where':{'context':_0x2acb4e[_0xfef0('0x61')],'exten':_0x2acb4e[_0xfef0('0x58')]},'individualHooks':!![]})[_0xfef0('0x27')](function(_0x1765e2){return _0x1765e2;});}return null;})[_0xfef0('0x27')](respondWithStatusCode(_0xd6de4d,null))[_0xfef0('0x53')](handleError(_0xd6de4d,null));};exports[_0xfef0('0x65')]=function(_0x3f26d9,_0x4f7ad3,_0x100c6a){return db['VoiceExtension'][_0xfef0('0x66')]({'where':{'id':_0x3f26d9[_0xfef0('0x54')]['id']}})['then'](handleEntityNotFound(_0x4f7ad3,null))[_0xfef0('0x27')](function(_0x20c2ec){if(_0x20c2ec){return db[_0xfef0('0x67')][_0xfef0('0x68')](function(_0x1e0ad5){return db['VoiceExtension'][_0xfef0('0x28')]({'where':{'VoiceExtensionId':_0x3f26d9[_0xfef0('0x54')]['id']},'transaction':_0x1e0ad5})[_0xfef0('0x27')](function(_0x4f0737){var _0x117b74=_[_0xfef0('0x31')](_0x3f26d9[_0xfef0('0x56')],function(_0x6f759a){_0x6f759a[_0xfef0('0x69')]=_0x3f26d9[_0xfef0('0x54')]['id'];return _0x6f759a;});return db[_0xfef0('0x3c')]['bulkCreate'](_0x117b74,{'transaction':_0x1e0ad5});});})[_0xfef0('0x27')](function(){return db[_0xfef0('0x3c')][_0xfef0('0x6a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x3f26d9[_0xfef0('0x54')]['id']},'order':_0xfef0('0x6b')});});}})[_0xfef0('0x27')](respondWithResult(_0x4f7ad3,null))['catch'](handleError(_0x4f7ad3,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2c2ec0e..a4fc6e1 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 _0xf401=['hasOwnProperty','events','../../mysqldb','setMaxListeners','remove','emit'];(function(_0x515b91,_0x18cebb){var _0x127d16=function(_0x2f9cdb){while(--_0x2f9cdb){_0x515b91['push'](_0x515b91['shift']());}};_0x127d16(++_0x18cebb);}(_0xf401,0x1b7));var _0x1f40=function(_0x511c1f,_0x4cf980){_0x511c1f=_0x511c1f-0x0;var _0x28a239=_0xf401[_0x511c1f];return _0x28a239;};'use strict';var EventEmitter=require(_0x1f40('0x0'));var VoiceExtension=require(_0x1f40('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x1f40('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1f40('0x3')};function emitEvent(_0x2fd5c0){return function(_0x3a13a5,_0x341871,_0x225332){VoiceExtensionEvents[_0x1f40('0x4')](_0x2fd5c0+':'+_0x3a13a5['id'],_0x3a13a5);VoiceExtensionEvents['emit'](_0x2fd5c0,_0x3a13a5);_0x225332(null);};}for(var e in events){if(events[_0x1f40('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0x99b2=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4dba0d,_0x92bb78){var _0x50cf83=function(_0x3ef9b3){while(--_0x3ef9b3){_0x4dba0d['push'](_0x4dba0d['shift']());}};_0x50cf83(++_0x92bb78);}(_0x99b2,0x12e));var _0x299b=function(_0x1338cf,_0xee783){_0x1338cf=_0x1338cf-0x0;var _0xc956c6=_0x99b2[_0x1338cf];return _0xc956c6;};'use strict';var EventEmitter=require(_0x299b('0x0'));var VoiceExtension=require(_0x299b('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x299b('0x2')](0x0);var events={'afterCreate':_0x299b('0x3'),'afterUpdate':_0x299b('0x4'),'afterDestroy':_0x299b('0x5')};function emitEvent(_0x343cea){return function(_0x213179,_0x32f0a4,_0x3bcc7b){VoiceExtensionEvents['emit'](_0x343cea+':'+_0x213179['id'],_0x213179);VoiceExtensionEvents[_0x299b('0x6')](_0x343cea,_0x213179);_0x3bcc7b(null);};}for(var e in events){if(events[_0x299b('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x299b('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index ef44657..6b192f2 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 _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','define','voice_extensions'];(function(_0x3fc4bb,_0x29af73){var _0x32db27=function(_0xc9d0ae){while(--_0xc9d0ae){_0x3fc4bb['push'](_0x3fc4bb['shift']());}};_0x32db27(++_0x29af73);}(_0x1261,0x144));var _0x1126=function(_0x364cf8,_0x146b9b){_0x364cf8=_0x364cf8-0x0;var _0x6a59ee=_0x1261[_0x364cf8];return _0x6a59ee;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('VoiceExtension',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0e=['path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x1ba127,_0x4a0309){var _0x42f82d=function(_0x375e57){while(--_0x375e57){_0x1ba127['push'](_0x1ba127['shift']());}};_0x42f82d(++_0x4a0309);}(_0x0b0e,0x187));var _0xe0b0=function(_0x269c42,_0xeed101){_0x269c42=_0x269c42-0x0;var _0x4dad76=_0x0b0e[_0x269c42];return _0x4dad76;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 80b1f7e..391d83b 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 _0xa634=['model','attributes','map','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','GetVoiceExtension','VoiceExtension','options','limit','include'];(function(_0x592868,_0x5811a7){var _0x2116e2=function(_0x53ffbe){while(--_0x53ffbe){_0x592868['push'](_0x592868['shift']());}};_0x2116e2(++_0x5811a7);}(_0xa634,0x163));var _0x4a63=function(_0x1d4ab3,_0x48ee4d){_0x1d4ab3=_0x1d4ab3-0x0;var _0x1be200=_0xa634[_0x1d4ab3];return _0x1be200;};'use strict';var _=require(_0x4a63('0x0'));var util=require(_0x4a63('0x1'));var moment=require(_0x4a63('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a63('0x3'));var db=require(_0x4a63('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a63('0x5'));var config=require(_0x4a63('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4a63('0x7')][_0x4a63('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4a63('0x9')],{'host':_0x4a63('0xa'),'port':0x18eb});var socket=require(_0x4a63('0xb'))(new Redis(config[_0x4a63('0x9')]));require('./voiceExtension.socket')[_0x4a63('0xc')](socket);function respondWithRpcPromise(_0xabd6e7,_0xf52982,_0x5177b3){return new BPromise(function(_0x6470bd,_0x27ec15){return client[_0x4a63('0xd')](_0xabd6e7,_0x5177b3)[_0x4a63('0xe')](function(_0x297e4f){logger['info'](_0x4a63('0xf'),_0xf52982,_0x4a63('0x10'));logger[_0x4a63('0x11')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0xf52982,_0x4a63('0x10'),JSON[_0x4a63('0x12')](_0x297e4f));if(_0x297e4f['error']){if(_0x297e4f['error'][_0x4a63('0x13')]===0x1f4){logger[_0x4a63('0x14')](_0x4a63('0xf'),_0xf52982,_0x297e4f[_0x4a63('0x14')][_0x4a63('0x15')]);return _0x27ec15(_0x297e4f[_0x4a63('0x14')]['message']);}logger['error'](_0x4a63('0xf'),_0xf52982,_0x297e4f[_0x4a63('0x14')][_0x4a63('0x15')]);return _0x6470bd(_0x297e4f['error'][_0x4a63('0x15')]);}else{logger[_0x4a63('0x16')]('VoiceExtension,\x20%s,\x20%s',_0xf52982,_0x4a63('0x10'));_0x6470bd(_0x297e4f['result'][_0x4a63('0x15')]);}})[_0x4a63('0x17')](function(_0x1262f7){logger[_0x4a63('0x14')](_0x4a63('0xf'),_0xf52982,_0x1262f7);_0x27ec15(_0x1262f7);});});}exports[_0x4a63('0x18')]=function(_0x3f443f){var _0x44186f=this;return new Promise(function(_0x46dc33,_0x3e021b){return db[_0x4a63('0x19')]['findAll']({'raw':_0x3f443f[_0x4a63('0x1a')]?_0x3f443f['options']['raw']===undefined?!![]:![]:!![],'where':_0x3f443f[_0x4a63('0x1a')]?_0x3f443f[_0x4a63('0x1a')]['where']||null:null,'attributes':_0x3f443f[_0x4a63('0x1a')]?_0x3f443f[_0x4a63('0x1a')]['attributes']||null:null,'limit':_0x3f443f['options']?_0x3f443f[_0x4a63('0x1a')][_0x4a63('0x1b')]||null:null,'include':_0x3f443f[_0x4a63('0x1a')]?_0x3f443f[_0x4a63('0x1a')][_0x4a63('0x1c')]?_['map'](_0x3f443f[_0x4a63('0x1a')][_0x4a63('0x1c')],function(_0x441374){return{'model':db[_0x441374[_0x4a63('0x1d')]],'as':_0x441374['as'],'attributes':_0x441374[_0x4a63('0x1e')],'include':_0x441374['include']?_['map'](_0x441374[_0x4a63('0x1c')],function(_0x4dd9a7){return{'model':db[_0x4dd9a7['model']],'as':_0x4dd9a7['as'],'attributes':_0x4dd9a7[_0x4a63('0x1e')],'include':_0x4dd9a7['include']?_[_0x4a63('0x1f')](_0x4dd9a7['include'],function(_0x527bc9){return{'model':db[_0x527bc9[_0x4a63('0x1d')]],'as':_0x527bc9['as'],'attributes':_0x527bc9[_0x4a63('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a63('0xe')](function(_0x1885e5){logger[_0x4a63('0x16')]('GetVoiceExtension',_0x3f443f);logger[_0x4a63('0x11')](_0x4a63('0x18'),_0x3f443f,JSON[_0x4a63('0x12')](_0x1885e5));_0x46dc33(_0x1885e5);})['catch'](function(_0x3a71cd){logger[_0x4a63('0x14')]('GetVoiceExtension',_0x3a71cd[_0x4a63('0x15')],_0x3f443f);_0x3e021b(_0x44186f[_0x4a63('0x14')](0x1f4,_0x3a71cd[_0x4a63('0x15')]));});});}; \ No newline at end of file +var _0xee72=['moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','attributes','limit','include','model','map','stringify','util'];(function(_0x5dae25,_0xfc60e0){var _0xda27f6=function(_0x327c01){while(--_0x327c01){_0x5dae25['push'](_0x5dae25['shift']());}};_0xda27f6(++_0xfc60e0);}(_0xee72,0x1c6));var _0x2ee7=function(_0x3b5d08,_0x2acfb4){_0x3b5d08=_0x3b5d08-0x0;var _0x2b120f=_0xee72[_0x3b5d08];return _0x2b120f;};'use strict';var _=require('lodash');var util=require(_0x2ee7('0x0'));var moment=require(_0x2ee7('0x1'));var BPromise=require(_0x2ee7('0x2'));var rs=require(_0x2ee7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ee7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x2ee7('0x5'));var jayson=require(_0x2ee7('0x6'));var client=jayson[_0x2ee7('0x7')][_0x2ee7('0x8')]({'port':0x232a});config[_0x2ee7('0x9')]=_['defaults'](config[_0x2ee7('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x2ee7('0xa'))(new Redis(config[_0x2ee7('0x9')]));require(_0x2ee7('0xb'))[_0x2ee7('0xc')](socket);function respondWithRpcPromise(_0x1c652b,_0x23f088,_0x4fe3ad){return new BPromise(function(_0x56cd53,_0x5d1dce){return client[_0x2ee7('0xd')](_0x1c652b,_0x4fe3ad)[_0x2ee7('0xe')](function(_0x4756b0){logger[_0x2ee7('0xf')](_0x2ee7('0x10'),_0x23f088,_0x2ee7('0x11'));logger[_0x2ee7('0x12')](_0x2ee7('0x13'),_0x23f088,_0x2ee7('0x11'),JSON['stringify'](_0x4756b0));if(_0x4756b0[_0x2ee7('0x14')]){if(_0x4756b0[_0x2ee7('0x14')][_0x2ee7('0x15')]===0x1f4){logger[_0x2ee7('0x14')](_0x2ee7('0x10'),_0x23f088,_0x4756b0[_0x2ee7('0x14')][_0x2ee7('0x16')]);return _0x5d1dce(_0x4756b0[_0x2ee7('0x14')][_0x2ee7('0x16')]);}logger[_0x2ee7('0x14')](_0x2ee7('0x10'),_0x23f088,_0x4756b0[_0x2ee7('0x14')]['message']);return _0x56cd53(_0x4756b0['error'][_0x2ee7('0x16')]);}else{logger[_0x2ee7('0xf')](_0x2ee7('0x10'),_0x23f088,_0x2ee7('0x11'));_0x56cd53(_0x4756b0[_0x2ee7('0x17')]['message']);}})[_0x2ee7('0x18')](function(_0x11a6b0){logger[_0x2ee7('0x14')](_0x2ee7('0x10'),_0x23f088,_0x11a6b0);_0x5d1dce(_0x11a6b0);});});}exports[_0x2ee7('0x19')]=function(_0x35d5b7){var _0x48f924=this;return new Promise(function(_0x4beae8,_0x4f9272){return db[_0x2ee7('0x1a')]['findAll']({'raw':_0x35d5b7[_0x2ee7('0x1b')]?_0x35d5b7[_0x2ee7('0x1b')][_0x2ee7('0x1c')]===undefined?!![]:![]:!![],'where':_0x35d5b7[_0x2ee7('0x1b')]?_0x35d5b7[_0x2ee7('0x1b')]['where']||null:null,'attributes':_0x35d5b7[_0x2ee7('0x1b')]?_0x35d5b7[_0x2ee7('0x1b')][_0x2ee7('0x1d')]||null:null,'limit':_0x35d5b7['options']?_0x35d5b7[_0x2ee7('0x1b')][_0x2ee7('0x1e')]||null:null,'include':_0x35d5b7[_0x2ee7('0x1b')]?_0x35d5b7['options']['include']?_['map'](_0x35d5b7[_0x2ee7('0x1b')][_0x2ee7('0x1f')],function(_0x2398f7){return{'model':db[_0x2398f7[_0x2ee7('0x20')]],'as':_0x2398f7['as'],'attributes':_0x2398f7[_0x2ee7('0x1d')],'include':_0x2398f7['include']?_[_0x2ee7('0x21')](_0x2398f7['include'],function(_0x509eda){return{'model':db[_0x509eda[_0x2ee7('0x20')]],'as':_0x509eda['as'],'attributes':_0x509eda[_0x2ee7('0x1d')],'include':_0x509eda[_0x2ee7('0x1f')]?_['map'](_0x509eda['include'],function(_0x5b99b4){return{'model':db[_0x5b99b4['model']],'as':_0x5b99b4['as'],'attributes':_0x5b99b4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c780c){logger['info']('GetVoiceExtension',_0x35d5b7);logger[_0x2ee7('0x12')](_0x2ee7('0x19'),_0x35d5b7,JSON[_0x2ee7('0x22')](_0x1c780c));_0x4beae8(_0x1c780c);})['catch'](function(_0x26ed96){logger[_0x2ee7('0x14')]('GetVoiceExtension',_0x26ed96['message'],_0x35d5b7);_0x4f9272(_0x48f924[_0x2ee7('0x14')](0x1f4,_0x26ed96[_0x2ee7('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 9f33f0b..2eb7bef 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 _0xd981=['register','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x1f9307,_0x3043a6){var _0x16c87c=function(_0x3c7ff2){while(--_0x3c7ff2){_0x1f9307['push'](_0x1f9307['shift']());}};_0x16c87c(++_0x3043a6);}(_0xd981,0xea));var _0x1d98=function(_0x53ab5f,_0x36f5cc){_0x53ab5f=_0x53ab5f-0x0;var _0x5ce3d8=_0xd981[_0x53ab5f];return _0x5ce3d8;};'use strict';var VoiceExtensionEvents=require(_0x1d98('0x0'));var events=[_0x1d98('0x1'),_0x1d98('0x2'),_0x1d98('0x3')];function createListener(_0x53ac70,_0x39d0a1){return function(_0x491adf){_0x39d0a1[_0x1d98('0x4')](_0x53ac70,_0x491adf);};}function removeListener(_0x107155,_0x2fc4dd){return function(){VoiceExtensionEvents[_0x1d98('0x5')](_0x107155,_0x2fc4dd);};}exports[_0x1d98('0x6')]=function(_0x5a443d){for(var _0x1f9c3f=0x0,_0x3a4cb3=events['length'];_0x1f9c3f<_0x3a4cb3;_0x1f9c3f++){var _0x3242a8=events[_0x1f9c3f];var _0x146643=createListener(_0x1d98('0x7')+_0x3242a8,_0x5a443d);VoiceExtensionEvents['on'](_0x3242a8,_0x146643);}}; \ No newline at end of file +var _0xa246=['removeListener','length','voiceExtension:','./voiceExtension.events','save','update','emit'];(function(_0x35260c,_0x631d06){var _0x102e2b=function(_0x5ce2fe){while(--_0x5ce2fe){_0x35260c['push'](_0x35260c['shift']());}};_0x102e2b(++_0x631d06);}(_0xa246,0xc0));var _0x6a24=function(_0x449650,_0x293bac){_0x449650=_0x449650-0x0;var _0xde2bd6=_0xa246[_0x449650];return _0xde2bd6;};'use strict';var VoiceExtensionEvents=require(_0x6a24('0x0'));var events=[_0x6a24('0x1'),'remove',_0x6a24('0x2')];function createListener(_0x506ea0,_0x554360){return function(_0x1245e6){_0x554360[_0x6a24('0x3')](_0x506ea0,_0x1245e6);};}function removeListener(_0x93e505,_0x9300df){return function(){VoiceExtensionEvents[_0x6a24('0x4')](_0x93e505,_0x9300df);};}exports['register']=function(_0x33270f){for(var _0x895a57=0x0,_0x4246de=events[_0x6a24('0x5')];_0x895a57<_0x4246de;_0x895a57++){var _0x29f6b2=events[_0x895a57];var _0x3fe244=createListener(_0x6a24('0x6')+_0x29f6b2,_0x33270f);VoiceExtensionEvents['on'](_0x29f6b2,_0x3fe244);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 2e9aa36..9b6793c 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 _0x3087=['show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../config/environment','./voiceMail.controller','get','isAuthenticated'];(function(_0x194171,_0x3e967b){var _0x4c6248=function(_0x4a409b){while(--_0x4a409b){_0x194171['push'](_0x194171['shift']());}};_0x4c6248(++_0x3e967b);}(_0x3087,0xa1));var _0x7308=function(_0x38bebd,_0x2f24d9){_0x38bebd=_0x38bebd-0x0;var _0x2b60ad=_0x3087[_0x38bebd];return _0x2b60ad;};'use strict';var multer=require(_0x7308('0x0'));var util=require(_0x7308('0x1'));var path=require(_0x7308('0x2'));var timeout=require(_0x7308('0x3'));var express=require('express');var router=express[_0x7308('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7308('0x5'));var controller=require(_0x7308('0x6'));router[_0x7308('0x7')]('/',auth[_0x7308('0x8')](),controller['index']);router['get']('/:id',auth[_0x7308('0x8')](),controller[_0x7308('0x9')]);router[_0x7308('0x7')]('/:id/messages',auth[_0x7308('0x8')](),controller['getMessages']);router[_0x7308('0xa')]('/',auth[_0x7308('0x8')](),controller[_0x7308('0xb')]);router[_0x7308('0xc')](_0x7308('0xd'),auth[_0x7308('0x8')](),controller[_0x7308('0xe')]);router[_0x7308('0xf')](_0x7308('0xd'),auth[_0x7308('0x8')](),controller['destroy']);module[_0x7308('0x10')]=router; \ No newline at end of file +var _0x034f=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id/messages','getMessages','post','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x145da2,_0x2de58f){var _0x32e0aa=function(_0x4edd4a){while(--_0x4edd4a){_0x145da2['push'](_0x145da2['shift']());}};_0x32e0aa(++_0x2de58f);}(_0x034f,0xf3));var _0xf034=function(_0x1f9124,_0x3c3d72){_0x1f9124=_0x1f9124-0x0;var _0x303e66=_0x034f[_0x1f9124];return _0x303e66;};'use strict';var multer=require(_0xf034('0x0'));var util=require('util');var path=require(_0xf034('0x1'));var timeout=require('connect-timeout');var express=require(_0xf034('0x2'));var router=express[_0xf034('0x3')]();var auth=require(_0xf034('0x4'));var interaction=require(_0xf034('0x5'));var config=require(_0xf034('0x6'));var controller=require(_0xf034('0x7'));router[_0xf034('0x8')]('/',auth[_0xf034('0x9')](),controller[_0xf034('0xa')]);router[_0xf034('0x8')]('/:id',auth[_0xf034('0x9')](),controller['show']);router[_0xf034('0x8')](_0xf034('0xb'),auth[_0xf034('0x9')](),controller[_0xf034('0xc')]);router[_0xf034('0xd')]('/',auth[_0xf034('0x9')](),controller['create']);router['put'](_0xf034('0xe'),auth[_0xf034('0x9')](),controller[_0xf034('0xf')]);router[_0xf034('0x10')](_0xf034('0xe'),auth['isAuthenticated'](),controller[_0xf034('0x11')]);module[_0xf034('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 c8bb07f..06209ea 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 _0x2032=['yes','ENUM','INTEGER','VIRTUAL','fullname','getDataValue','mailbox','exports','STRING','contest_mailbox','setDataValue','email','string','trim'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x2032,0xd9));var _0x2203=function(_0x3a18dd,_0x229dad){_0x3a18dd=_0x3a18dd-0x0;var _0x12e97c=_0x2032[_0x3a18dd];return _0x12e97c;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'customer_id':{'type':Sequelize[_0x2203('0x1')]},'context':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'from-voicemail','unique':_0x2203('0x2')},'mailbox':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x2203('0x1')]},'fullname':{'type':Sequelize[_0x2203('0x1')]},'email':{'type':Sequelize[_0x2203('0x1')],'validate':{'isEmail':!![]},'set':function(_0x201796){this[_0x2203('0x3')](_0x2203('0x4'),typeof _0x201796===_0x2203('0x5')&&_0x201796[_0x2203('0x6')]()?_0x201796[_0x2203('0x6')]():null);}},'pager':{'type':Sequelize[_0x2203('0x1')]},'tz':{'type':Sequelize[_0x2203('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':_0x2203('0x7'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x2203('0x1')]},'review':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2203('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':_0x2203('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2203('0x8')](_0x2203('0x7'),'no'),'defaultValue':_0x2203('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x2203('0x1')]},'emailbody':{'type':Sequelize[_0x2203('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2203('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x2203('0xa')],'get':function(){return this['getDataValue'](_0x2203('0xb'))+'\x20-\x20'+this[_0x2203('0xc')](_0x2203('0xd'));}}}; \ No newline at end of file +var _0xd8b0=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','contest_mailbox','STRING','setDataValue','email','string'];(function(_0x2f23c6,_0x8eacbc){var _0x12e26a=function(_0x2b2b4b){while(--_0x2b2b4b){_0x2f23c6['push'](_0x2f23c6['shift']());}};_0x12e26a(++_0x8eacbc);}(_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')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0x0d8b('0x2')},'mailbox':{'type':Sequelize[_0x0d8b('0x3')],'defaultValue':'','allowNull':![],'unique':_0x0d8b('0x2')},'password':{'type':Sequelize[_0x0d8b('0x3')]},'fullname':{'type':Sequelize[_0x0d8b('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x5e15e6){this[_0x0d8b('0x4')](_0x0d8b('0x5'),typeof _0x5e15e6===_0x0d8b('0x6')&&_0x5e15e6['trim']()?_0x5e15e6[_0x0d8b('0x7')]():null);}},'pager':{'type':Sequelize[_0x0d8b('0x3')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x8')},'attach':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':_0x0d8b('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':_0x0d8b('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x0d8b('0x3')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x0d8b('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0d8b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':_0x0d8b('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x0d8b('0x9')](_0x0d8b('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x0d8b('0xc')},'emailsubject':{'type':Sequelize[_0x0d8b('0x3')]},'emailbody':{'type':Sequelize[_0x0d8b('0x3')]},'maxsecs':{'type':Sequelize[_0x0d8b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0d8b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0d8b('0xe')],'get':function(){return this[_0x0d8b('0xf')](_0x0d8b('0x10'))+'\x20-\x20'+this[_0x0d8b('0xf')](_0x0d8b('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 0f066d9..0899c09 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 _0xf0f3=['where','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','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','getMessages','findOne','VoiceMailMessage','hasOwnProperty','nolimit','pick','map','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','moment','bluebird','util','path','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','index','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','filter'];(function(_0x500439,_0x24b02e){var _0x476501=function(_0x1b92ca){while(--_0x1b92ca){_0x500439['push'](_0x500439['shift']());}};_0x476501(++_0x24b02e);}(_0xf0f3,0x11f));var _0x3f0f=function(_0x3b056d,_0x4e1ad1){_0x3b056d=_0x3b056d-0x0;var _0x3693b9=_0xf0f3[_0x3b056d];return _0x3693b9;};'use strict';var pdf=require(_0x3f0f('0x0'));var emlformat=require(_0x3f0f('0x1'));var rimraf=require(_0x3f0f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3f0f('0x3'));var BPromise=require(_0x3f0f('0x4'));var Mustache=require('mustache');var util=require(_0x3f0f('0x5'));var path=require(_0x3f0f('0x6'));var sox=require('sox');var csv=require(_0x3f0f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3f0f('0x8'));var crypto=require('crypto');var jsforce=require(_0x3f0f('0x9'));var deskjs=require(_0x3f0f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3f0f('0xb'));var Papa=require('papaparse');var Redis=require(_0x3f0f('0xc'));var authService=require(_0x3f0f('0xd'));var qs=require(_0x3f0f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f0f('0xf'));var logger=require('../../config/logger')(_0x3f0f('0x10'));var utils=require(_0x3f0f('0x11'));var config=require(_0x3f0f('0x12'));var db=require(_0x3f0f('0x13'))['db'];function respondWithStatusCode(_0x426f62,_0x3084e9){_0x3084e9=_0x3084e9||0xcc;return function(_0x5c1365){if(_0x5c1365){return _0x426f62[_0x3f0f('0x14')](_0x3084e9);}return _0x426f62['status'](_0x3084e9)[_0x3f0f('0x15')]();};}function respondWithResult(_0x2e0276,_0x3b320a){_0x3b320a=_0x3b320a||0xc8;return function(_0x348aa4){if(_0x348aa4){return _0x2e0276[_0x3f0f('0x16')](_0x3b320a)['json'](_0x348aa4);}};}function respondWithFilteredResult(_0x2bc216,_0x201d8b){return function(_0x39ba1f){if(_0x39ba1f){var _0x3b5922=_0x39ba1f[_0x3f0f('0x17')],_0x3d1f85=_0x201d8b[_0x3f0f('0x18')],_0x21b777=_0x201d8b[_0x3f0f('0x18')]+_0x201d8b[_0x3f0f('0x19')],_0x223692;if(_0x21b777>=_0x3b5922){_0x21b777=_0x3b5922;_0x223692=0xc8;}else{_0x223692=0xce;}_0x2bc216['status'](_0x223692);return _0x2bc216[_0x3f0f('0x1a')](_0x3f0f('0x1b'),_0x3d1f85+'-'+_0x21b777+'/'+_0x3b5922)[_0x3f0f('0x1c')](_0x39ba1f);}return null;};}function patchUpdates(_0x121e78){return function(_0x1b8302){try{jsonpatch[_0x3f0f('0x1d')](_0x1b8302,_0x121e78,!![]);}catch(_0x95ec89){return BPromise[_0x3f0f('0x1e')](_0x95ec89);}return _0x1b8302['save']();};}function saveUpdates(_0x5eaff0,_0x4b1718){return function(_0x3ba1b1){if(_0x3ba1b1){return _0x3ba1b1[_0x3f0f('0x1f')](_0x5eaff0)[_0x3f0f('0x20')](function(_0x38fd31){return _0x38fd31;});}return null;};}function removeEntity(_0x5d62db,_0x2b2ac1){return function(_0x3424d0){if(_0x3424d0){return _0x3424d0[_0x3f0f('0x21')]()[_0x3f0f('0x20')](function(){var _0x3bc8d8=_0x3424d0[_0x3f0f('0x22')]({'plain':!![]});var _0xbeeda3=_0x3f0f('0x23');return db[_0x3f0f('0x24')]['destroy']({'where':{'type':_0xbeeda3,'resourceId':_0x3bc8d8['id']}})['then'](function(){return _0x3424d0;});})[_0x3f0f('0x20')](function(){_0x5d62db[_0x3f0f('0x16')](0xcc)[_0x3f0f('0x15')]();});}};}function handleEntityNotFound(_0x27c761,_0xae94fc){return function(_0x5331e4){if(!_0x5331e4){_0x27c761[_0x3f0f('0x14')](0x194);}return _0x5331e4;};}function handleError(_0x1c6487,_0x1a1841){_0x1a1841=_0x1a1841||0x1f4;return function(_0x12c2a3){logger[_0x3f0f('0x25')](_0x12c2a3[_0x3f0f('0x26')]);if(_0x12c2a3[_0x3f0f('0x27')]){delete _0x12c2a3[_0x3f0f('0x27')];}_0x1c6487[_0x3f0f('0x16')](_0x1a1841)['send'](_0x12c2a3);};}exports[_0x3f0f('0x28')]=function(_0x1ebf9c,_0x16731f){var _0x20c050={},_0x436b27={},_0xc98450={'count':0x0,'rows':[]};var _0x4d0d40=_['map'](db[_0x3f0f('0x29')][_0x3f0f('0x2a')],function(_0x33dc65){return{'name':_0x33dc65[_0x3f0f('0x2b')],'type':_0x33dc65[_0x3f0f('0x2c')][_0x3f0f('0x2d')]};});_0x436b27[_0x3f0f('0x2e')]=_['map'](_0x4d0d40,_0x3f0f('0x27'));_0x436b27[_0x3f0f('0x2f')]=_[_0x3f0f('0x30')](_0x1ebf9c[_0x3f0f('0x2f')]);_0x436b27[_0x3f0f('0x31')]=_['intersection'](_0x436b27[_0x3f0f('0x2e')],_0x436b27[_0x3f0f('0x2f')]);_0x20c050[_0x3f0f('0x32')]=_[_0x3f0f('0x33')](_0x436b27[_0x3f0f('0x2e')],qs[_0x3f0f('0x34')](_0x1ebf9c[_0x3f0f('0x2f')][_0x3f0f('0x34')]));_0x20c050[_0x3f0f('0x32')]=_0x20c050[_0x3f0f('0x32')][_0x3f0f('0x35')]?_0x20c050[_0x3f0f('0x32')]:_0x436b27['model'];if(!_0x1ebf9c[_0x3f0f('0x2f')]['hasOwnProperty']('nolimit')){_0x20c050[_0x3f0f('0x19')]=qs['limit'](_0x1ebf9c[_0x3f0f('0x2f')]['limit']);_0x20c050[_0x3f0f('0x18')]=qs['offset'](_0x1ebf9c['query'][_0x3f0f('0x18')]);}_0x20c050[_0x3f0f('0x36')]=qs[_0x3f0f('0x37')](_0x1ebf9c['query'][_0x3f0f('0x37')]);_0x20c050['where']=qs[_0x3f0f('0x31')](_['pick'](_0x1ebf9c[_0x3f0f('0x2f')],_0x436b27[_0x3f0f('0x31')]),_0x4d0d40);if(_0x1ebf9c['query'][_0x3f0f('0x38')]){_0x20c050[_0x3f0f('0x39')]=_[_0x3f0f('0x3a')](_0x20c050[_0x3f0f('0x39')],{'$or':_['map'](_0x4d0d40,function(_0x26a059){if(_0x26a059['type']!==_0x3f0f('0x3b')){var _0x276d9a={};_0x276d9a[_0x26a059[_0x3f0f('0x27')]]={'$like':'%'+_0x1ebf9c[_0x3f0f('0x2f')]['filter']+'%'};return _0x276d9a;}})});}_0x20c050=_['merge']({},_0x20c050,_0x1ebf9c[_0x3f0f('0x3c')]);var _0x15f48e={'where':_0x20c050[_0x3f0f('0x39')]};return db[_0x3f0f('0x29')][_0x3f0f('0x17')](_0x15f48e)[_0x3f0f('0x20')](function(_0x254d3a){_0xc98450[_0x3f0f('0x17')]=_0x254d3a;if(_0x1ebf9c[_0x3f0f('0x2f')]['includeAll']){_0x20c050[_0x3f0f('0x3d')]=[{'all':!![]}];}return db[_0x3f0f('0x29')]['findAll'](_0x20c050);})[_0x3f0f('0x20')](function(_0x10e960){_0xc98450[_0x3f0f('0x3e')]=_0x10e960;return _0xc98450;})[_0x3f0f('0x20')](respondWithFilteredResult(_0x16731f,_0x20c050))[_0x3f0f('0x3f')](handleError(_0x16731f,null));};exports[_0x3f0f('0x40')]=function(_0x1f6ac3,_0xc93ced){var _0xaf8f8={'raw':!![],'where':{'id':_0x1f6ac3[_0x3f0f('0x41')]['id']}},_0x3cb5ad={};_0x3cb5ad[_0x3f0f('0x2e')]=_[_0x3f0f('0x30')](db['VoiceMail'][_0x3f0f('0x2a')]);_0x3cb5ad[_0x3f0f('0x2f')]=_['keys'](_0x1f6ac3[_0x3f0f('0x2f')]);_0x3cb5ad[_0x3f0f('0x31')]=_[_0x3f0f('0x33')](_0x3cb5ad[_0x3f0f('0x2e')],_0x3cb5ad['query']);_0xaf8f8['attributes']=_['intersection'](_0x3cb5ad[_0x3f0f('0x2e')],qs[_0x3f0f('0x34')](_0x1f6ac3['query'][_0x3f0f('0x34')]));_0xaf8f8[_0x3f0f('0x32')]=_0xaf8f8[_0x3f0f('0x32')][_0x3f0f('0x35')]?_0xaf8f8[_0x3f0f('0x32')]:_0x3cb5ad[_0x3f0f('0x2e')];if(_0x1f6ac3[_0x3f0f('0x2f')][_0x3f0f('0x42')]){_0xaf8f8[_0x3f0f('0x3d')]=[{'all':!![]}];}_0xaf8f8=_['merge']({},_0xaf8f8,_0x1f6ac3['options']);return db[_0x3f0f('0x29')][_0x3f0f('0x43')](_0xaf8f8)[_0x3f0f('0x20')](handleEntityNotFound(_0xc93ced,null))[_0x3f0f('0x20')](respondWithResult(_0xc93ced,null))[_0x3f0f('0x3f')](handleError(_0xc93ced,null));};exports[_0x3f0f('0x44')]=function(_0x57c35d,_0x5ec9a3){return db[_0x3f0f('0x29')][_0x3f0f('0x44')](_0x57c35d[_0x3f0f('0x45')],{})[_0x3f0f('0x20')](function(_0xdc3c7d){var _0x4ddb3c=_0x57c35d['user'][_0x3f0f('0x22')]({'plain':!![]});if(!_0x4ddb3c)throw new Error(_0x3f0f('0x46'));if(_0x4ddb3c[_0x3f0f('0x47')]===_0x3f0f('0x48')){var _0x17a292=_0xdc3c7d[_0x3f0f('0x22')]({'plain':!![]});var _0x5834e3=_0x3f0f('0x23');return db[_0x3f0f('0x49')][_0x3f0f('0x43')]({'where':{'name':_0x5834e3,'userProfileId':_0x4ddb3c[_0x3f0f('0x4a')]},'raw':!![]})[_0x3f0f('0x20')](function(_0x51bf96){if(_0x51bf96&&_0x51bf96[_0x3f0f('0x4b')]===0x0){return db['UserProfileResource'][_0x3f0f('0x44')]({'name':_0x17a292[_0x3f0f('0x27')],'resourceId':_0x17a292['id'],'type':_0x51bf96['name'],'sectionId':_0x51bf96['id']},{})[_0x3f0f('0x20')](function(){return _0xdc3c7d;});}else{return _0xdc3c7d;}})[_0x3f0f('0x3f')](function(_0x2c7d3f){logger['error'](_0x3f0f('0x4c'),_0x2c7d3f);throw _0x2c7d3f;});}return _0xdc3c7d;})[_0x3f0f('0x20')](respondWithResult(_0x5ec9a3,0xc9))[_0x3f0f('0x3f')](handleError(_0x5ec9a3,null));};exports[_0x3f0f('0x1f')]=function(_0x287804,_0x1c352d){if(_0x287804[_0x3f0f('0x45')]['id']){delete _0x287804['body']['id'];}return db[_0x3f0f('0x29')][_0x3f0f('0x43')]({'where':{'id':_0x287804[_0x3f0f('0x41')]['id']}})[_0x3f0f('0x20')](handleEntityNotFound(_0x1c352d,null))[_0x3f0f('0x20')](saveUpdates(_0x287804[_0x3f0f('0x45')],null))[_0x3f0f('0x20')](respondWithResult(_0x1c352d,null))[_0x3f0f('0x3f')](handleError(_0x1c352d,null));};exports[_0x3f0f('0x21')]=function(_0x4e4fc6,_0x2cb3f1){return db['VoiceMail']['find']({'where':{'id':_0x4e4fc6[_0x3f0f('0x41')]['id']}})['then'](handleEntityNotFound(_0x2cb3f1,null))[_0x3f0f('0x20')](removeEntity(_0x2cb3f1,null))[_0x3f0f('0x3f')](handleError(_0x2cb3f1,null));};exports[_0x3f0f('0x4d')]=function(_0x2c7718,_0x6b2d4a,_0x4177db){return db[_0x3f0f('0x29')][_0x3f0f('0x4e')]({'where':{'id':_0x2c7718[_0x3f0f('0x41')]['id']}})[_0x3f0f('0x20')](handleEntityNotFound(_0x6b2d4a,null))[_0x3f0f('0x20')](function(_0x449cfb){var _0x2b1a1b;var _0x151148={},_0x2b07cf={};_0x2b07cf[_0x3f0f('0x2e')]=_[_0x3f0f('0x30')](db[_0x3f0f('0x4f')][_0x3f0f('0x2a')]);_0x2b07cf[_0x3f0f('0x2f')]=_[_0x3f0f('0x30')](_0x2c7718[_0x3f0f('0x2f')]);_0x2b07cf[_0x3f0f('0x31')]=_['intersection'](_0x2b07cf['model'],_0x2b07cf[_0x3f0f('0x2f')]);_0x151148['attributes']=_[_0x3f0f('0x33')](_0x2b07cf['model'],qs['fields'](_0x2c7718['query']['fields']));_0x151148[_0x3f0f('0x32')]=_0x151148[_0x3f0f('0x32')][_0x3f0f('0x35')]?_0x151148[_0x3f0f('0x32')]:_0x2b07cf[_0x3f0f('0x2e')];if(!_0x2c7718['query'][_0x3f0f('0x50')](_0x3f0f('0x51'))){_0x151148[_0x3f0f('0x19')]=qs['limit'](_0x2c7718[_0x3f0f('0x2f')]['limit']);_0x151148[_0x3f0f('0x18')]=qs[_0x3f0f('0x18')](_0x2c7718[_0x3f0f('0x2f')]['offset']);}_0x151148[_0x3f0f('0x36')]=qs['sort'](_0x2c7718[_0x3f0f('0x2f')][_0x3f0f('0x37')]);_0x151148[_0x3f0f('0x39')]=qs['filters'](_[_0x3f0f('0x52')](_0x2c7718[_0x3f0f('0x2f')],_0x2b07cf['filters']));if(_0x2c7718['query']['filter']){_0x151148[_0x3f0f('0x39')]=_['merge'](_0x151148[_0x3f0f('0x39')],{'$or':_[_0x3f0f('0x53')](_0x151148[_0x3f0f('0x32')],function(_0x4ad9a1){var _0x5b94dd={};_0x5b94dd[_0x4ad9a1]={'$like':'%'+_0x2c7718[_0x3f0f('0x2f')][_0x3f0f('0x38')]+'%'};return _0x5b94dd;})});}_0x151148[_0x3f0f('0x39')]=_[_0x3f0f('0x3a')](_0x151148['where'],{'mailboxuser':_0x449cfb[_0x3f0f('0x54')]});_0x151148=_[_0x3f0f('0x3a')]({},_0x151148,_0x2c7718['options']);return db[_0x3f0f('0x4f')][_0x3f0f('0x55')](_0x151148)[_0x3f0f('0x20')](respondWithFilteredResult(_0x6b2d4a,_0x151148));})[_0x3f0f('0x3f')](handleError(_0x6b2d4a,null));}; \ No newline at end of file +var _0x2089=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','hasOwnProperty','order','sort','filter','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','limit','set','Content-Range','json','reject','update','then','destroy','get','Voicemails','end','sendStatus','error','name','send','index','map','VoiceMail','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','nolimit','where','pick','merge','VIRTUAL','options','count','includeAll','include','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2421f4,_0x9ac08b){var _0x32ba39=function(_0x10ec80){while(--_0x10ec80){_0x2421f4['push'](_0x2421f4['shift']());}};_0x32ba39(++_0x9ac08b);}(_0x2089,0x164));var _0x9208=function(_0x2245c0,_0x124aa2){_0x2245c0=_0x2245c0-0x0;var _0x78420e=_0x2089[_0x2245c0];return _0x78420e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9208('0x0'));var rimraf=require(_0x9208('0x1'));var zipdir=require(_0x9208('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9208('0x3'));var moment=require(_0x9208('0x4'));var BPromise=require(_0x9208('0x5'));var Mustache=require(_0x9208('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9208('0x7'));var csv=require('to-csv');var ejs=require(_0x9208('0x8'));var fs=require('fs');var _=require(_0x9208('0x9'));var squel=require(_0x9208('0xa'));var crypto=require(_0x9208('0xb'));var jsforce=require(_0x9208('0xc'));var deskjs=require(_0x9208('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9208('0xe'));var Papa=require(_0x9208('0xf'));var Redis=require(_0x9208('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9208('0x11'));var as=require(_0x9208('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9208('0x13'))(_0x9208('0x14'));var utils=require(_0x9208('0x15'));var config=require(_0x9208('0x16'));var db=require(_0x9208('0x17'))['db'];function respondWithStatusCode(_0x5459c1,_0x3e01fe){_0x3e01fe=_0x3e01fe||0xcc;return function(_0x505f54){if(_0x505f54){return _0x5459c1['sendStatus'](_0x3e01fe);}return _0x5459c1[_0x9208('0x18')](_0x3e01fe)['end']();};}function respondWithResult(_0x4cdacb,_0x1d88a1){_0x1d88a1=_0x1d88a1||0xc8;return function(_0x36dd1d){if(_0x36dd1d){return _0x4cdacb[_0x9208('0x18')](_0x1d88a1)['json'](_0x36dd1d);}};}function respondWithFilteredResult(_0x4d8836,_0x103132){return function(_0x33379d){if(_0x33379d){var _0x55cdf4=_0x33379d['count'],_0x2265e2=_0x103132[_0x9208('0x19')],_0x35a8b5=_0x103132[_0x9208('0x19')]+_0x103132[_0x9208('0x1a')],_0x493ff1;if(_0x35a8b5>=_0x55cdf4){_0x35a8b5=_0x55cdf4;_0x493ff1=0xc8;}else{_0x493ff1=0xce;}_0x4d8836[_0x9208('0x18')](_0x493ff1);return _0x4d8836[_0x9208('0x1b')](_0x9208('0x1c'),_0x2265e2+'-'+_0x35a8b5+'/'+_0x55cdf4)[_0x9208('0x1d')](_0x33379d);}return null;};}function patchUpdates(_0x29109b){return function(_0xa1322a){try{jsonpatch['apply'](_0xa1322a,_0x29109b,!![]);}catch(_0x3f5e61){return BPromise[_0x9208('0x1e')](_0x3f5e61);}return _0xa1322a['save']();};}function saveUpdates(_0x1598f0,_0x549388){return function(_0x4cc79f){if(_0x4cc79f){return _0x4cc79f[_0x9208('0x1f')](_0x1598f0)[_0x9208('0x20')](function(_0x13feb7){return _0x13feb7;});}return null;};}function removeEntity(_0x33ca5a,_0x242cda){return function(_0x419b79){if(_0x419b79){return _0x419b79[_0x9208('0x21')]()[_0x9208('0x20')](function(){var _0x53a350=_0x419b79[_0x9208('0x22')]({'plain':!![]});var _0x127d76=_0x9208('0x23');return db['UserProfileResource'][_0x9208('0x21')]({'where':{'type':_0x127d76,'resourceId':_0x53a350['id']}})[_0x9208('0x20')](function(){return _0x419b79;});})[_0x9208('0x20')](function(){_0x33ca5a['status'](0xcc)[_0x9208('0x24')]();});}};}function handleEntityNotFound(_0x1dd16b,_0x2378e2){return function(_0x39251e){if(!_0x39251e){_0x1dd16b[_0x9208('0x25')](0x194);}return _0x39251e;};}function handleError(_0x2250c7,_0x3d15de){_0x3d15de=_0x3d15de||0x1f4;return function(_0x2fe911){logger[_0x9208('0x26')](_0x2fe911['stack']);if(_0x2fe911[_0x9208('0x27')]){delete _0x2fe911['name'];}_0x2250c7[_0x9208('0x18')](_0x3d15de)[_0x9208('0x28')](_0x2fe911);};}exports[_0x9208('0x29')]=function(_0x9d6ad6,_0x58a322){var _0x30bb0a={},_0x1508b5={},_0x24111b={'count':0x0,'rows':[]};var _0x4c95fc=_[_0x9208('0x2a')](db[_0x9208('0x2b')]['rawAttributes'],function(_0x435b){return{'name':_0x435b[_0x9208('0x2c')],'type':_0x435b[_0x9208('0x2d')][_0x9208('0x2e')]};});_0x1508b5['model']=_[_0x9208('0x2a')](_0x4c95fc,_0x9208('0x27'));_0x1508b5['query']=_[_0x9208('0x2f')](_0x9d6ad6['query']);_0x1508b5[_0x9208('0x30')]=_[_0x9208('0x31')](_0x1508b5[_0x9208('0x32')],_0x1508b5[_0x9208('0x33')]);_0x30bb0a[_0x9208('0x34')]=_['intersection'](_0x1508b5[_0x9208('0x32')],qs[_0x9208('0x35')](_0x9d6ad6['query'][_0x9208('0x35')]));_0x30bb0a[_0x9208('0x34')]=_0x30bb0a[_0x9208('0x34')][_0x9208('0x36')]?_0x30bb0a[_0x9208('0x34')]:_0x1508b5[_0x9208('0x32')];if(!_0x9d6ad6[_0x9208('0x33')]['hasOwnProperty'](_0x9208('0x37'))){_0x30bb0a[_0x9208('0x1a')]=qs[_0x9208('0x1a')](_0x9d6ad6['query'][_0x9208('0x1a')]);_0x30bb0a[_0x9208('0x19')]=qs[_0x9208('0x19')](_0x9d6ad6[_0x9208('0x33')][_0x9208('0x19')]);}_0x30bb0a['order']=qs['sort'](_0x9d6ad6[_0x9208('0x33')]['sort']);_0x30bb0a[_0x9208('0x38')]=qs[_0x9208('0x30')](_[_0x9208('0x39')](_0x9d6ad6[_0x9208('0x33')],_0x1508b5[_0x9208('0x30')]),_0x4c95fc);if(_0x9d6ad6['query']['filter']){_0x30bb0a[_0x9208('0x38')]=_[_0x9208('0x3a')](_0x30bb0a[_0x9208('0x38')],{'$or':_[_0x9208('0x2a')](_0x4c95fc,function(_0x45deeb){if(_0x45deeb[_0x9208('0x2d')]!==_0x9208('0x3b')){var _0x196d80={};_0x196d80[_0x45deeb[_0x9208('0x27')]]={'$like':'%'+_0x9d6ad6[_0x9208('0x33')]['filter']+'%'};return _0x196d80;}})});}_0x30bb0a=_[_0x9208('0x3a')]({},_0x30bb0a,_0x9d6ad6[_0x9208('0x3c')]);var _0x4a05c5={'where':_0x30bb0a[_0x9208('0x38')]};return db['VoiceMail'][_0x9208('0x3d')](_0x4a05c5)[_0x9208('0x20')](function(_0xb9a9a8){_0x24111b['count']=_0xb9a9a8;if(_0x9d6ad6[_0x9208('0x33')][_0x9208('0x3e')]){_0x30bb0a[_0x9208('0x3f')]=[{'all':!![]}];}return db[_0x9208('0x2b')]['findAll'](_0x30bb0a);})[_0x9208('0x20')](function(_0x551e23){_0x24111b[_0x9208('0x40')]=_0x551e23;return _0x24111b;})[_0x9208('0x20')](respondWithFilteredResult(_0x58a322,_0x30bb0a))[_0x9208('0x41')](handleError(_0x58a322,null));};exports['show']=function(_0x2e622e,_0x99e991){var _0x402a88={'raw':!![],'where':{'id':_0x2e622e[_0x9208('0x42')]['id']}},_0x41962f={};_0x41962f[_0x9208('0x32')]=_['keys'](db[_0x9208('0x2b')][_0x9208('0x43')]);_0x41962f['query']=_[_0x9208('0x2f')](_0x2e622e[_0x9208('0x33')]);_0x41962f['filters']=_[_0x9208('0x31')](_0x41962f[_0x9208('0x32')],_0x41962f[_0x9208('0x33')]);_0x402a88[_0x9208('0x34')]=_[_0x9208('0x31')](_0x41962f[_0x9208('0x32')],qs[_0x9208('0x35')](_0x2e622e[_0x9208('0x33')][_0x9208('0x35')]));_0x402a88[_0x9208('0x34')]=_0x402a88['attributes']['length']?_0x402a88[_0x9208('0x34')]:_0x41962f[_0x9208('0x32')];if(_0x2e622e[_0x9208('0x33')][_0x9208('0x3e')]){_0x402a88[_0x9208('0x3f')]=[{'all':!![]}];}_0x402a88=_['merge']({},_0x402a88,_0x2e622e['options']);return db[_0x9208('0x2b')][_0x9208('0x44')](_0x402a88)[_0x9208('0x20')](handleEntityNotFound(_0x99e991,null))[_0x9208('0x20')](respondWithResult(_0x99e991,null))[_0x9208('0x41')](handleError(_0x99e991,null));};exports[_0x9208('0x45')]=function(_0x3735ad,_0x135798){return db['VoiceMail'][_0x9208('0x45')](_0x3735ad[_0x9208('0x46')],{})[_0x9208('0x20')](function(_0x30284b){var _0x422fc1=_0x3735ad[_0x9208('0x47')][_0x9208('0x22')]({'plain':!![]});if(!_0x422fc1)throw new Error(_0x9208('0x48'));if(_0x422fc1[_0x9208('0x49')]===_0x9208('0x47')){var _0x2a3d8b=_0x30284b['get']({'plain':!![]});var _0x98618f=_0x9208('0x23');return db[_0x9208('0x4a')][_0x9208('0x44')]({'where':{'name':_0x98618f,'userProfileId':_0x422fc1[_0x9208('0x4b')]},'raw':!![]})[_0x9208('0x20')](function(_0x2c8610){if(_0x2c8610&&_0x2c8610[_0x9208('0x4c')]===0x0){return db[_0x9208('0x4d')][_0x9208('0x45')]({'name':_0x2a3d8b['name'],'resourceId':_0x2a3d8b['id'],'type':_0x2c8610['name'],'sectionId':_0x2c8610['id']},{})['then'](function(){return _0x30284b;});}else{return _0x30284b;}})[_0x9208('0x41')](function(_0x476d23){logger[_0x9208('0x26')](_0x9208('0x4e'),_0x476d23);throw _0x476d23;});}return _0x30284b;})[_0x9208('0x20')](respondWithResult(_0x135798,0xc9))[_0x9208('0x41')](handleError(_0x135798,null));};exports[_0x9208('0x1f')]=function(_0x5c9a6c,_0x394e0b){if(_0x5c9a6c[_0x9208('0x46')]['id']){delete _0x5c9a6c[_0x9208('0x46')]['id'];}return db['VoiceMail'][_0x9208('0x44')]({'where':{'id':_0x5c9a6c['params']['id']}})['then'](handleEntityNotFound(_0x394e0b,null))['then'](saveUpdates(_0x5c9a6c[_0x9208('0x46')],null))[_0x9208('0x20')](respondWithResult(_0x394e0b,null))[_0x9208('0x41')](handleError(_0x394e0b,null));};exports[_0x9208('0x21')]=function(_0x47200b,_0x24d810){return db[_0x9208('0x2b')][_0x9208('0x44')]({'where':{'id':_0x47200b[_0x9208('0x42')]['id']}})[_0x9208('0x20')](handleEntityNotFound(_0x24d810,null))['then'](removeEntity(_0x24d810,null))['catch'](handleError(_0x24d810,null));};exports[_0x9208('0x4f')]=function(_0x33e403,_0x1a5b54,_0x40075a){return db[_0x9208('0x2b')]['findOne']({'where':{'id':_0x33e403[_0x9208('0x42')]['id']}})[_0x9208('0x20')](handleEntityNotFound(_0x1a5b54,null))[_0x9208('0x20')](function(_0x517c4c){var _0x2a6406;var _0x3a0bc8={},_0x357446={};_0x357446[_0x9208('0x32')]=_[_0x9208('0x2f')](db['VoiceMailMessage']['rawAttributes']);_0x357446[_0x9208('0x33')]=_[_0x9208('0x2f')](_0x33e403[_0x9208('0x33')]);_0x357446[_0x9208('0x30')]=_[_0x9208('0x31')](_0x357446[_0x9208('0x32')],_0x357446[_0x9208('0x33')]);_0x3a0bc8[_0x9208('0x34')]=_['intersection'](_0x357446['model'],qs[_0x9208('0x35')](_0x33e403[_0x9208('0x33')]['fields']));_0x3a0bc8[_0x9208('0x34')]=_0x3a0bc8[_0x9208('0x34')][_0x9208('0x36')]?_0x3a0bc8[_0x9208('0x34')]:_0x357446[_0x9208('0x32')];if(!_0x33e403[_0x9208('0x33')][_0x9208('0x50')]('nolimit')){_0x3a0bc8[_0x9208('0x1a')]=qs[_0x9208('0x1a')](_0x33e403[_0x9208('0x33')][_0x9208('0x1a')]);_0x3a0bc8[_0x9208('0x19')]=qs[_0x9208('0x19')](_0x33e403[_0x9208('0x33')]['offset']);}_0x3a0bc8[_0x9208('0x51')]=qs[_0x9208('0x52')](_0x33e403[_0x9208('0x33')][_0x9208('0x52')]);_0x3a0bc8['where']=qs['filters'](_[_0x9208('0x39')](_0x33e403['query'],_0x357446['filters']));if(_0x33e403['query'][_0x9208('0x53')]){_0x3a0bc8[_0x9208('0x38')]=_[_0x9208('0x3a')](_0x3a0bc8[_0x9208('0x38')],{'$or':_[_0x9208('0x2a')](_0x3a0bc8['attributes'],function(_0x23c2fe){var _0x5e9bc2={};_0x5e9bc2[_0x23c2fe]={'$like':'%'+_0x33e403[_0x9208('0x33')][_0x9208('0x53')]+'%'};return _0x5e9bc2;})});}_0x3a0bc8['where']=_[_0x9208('0x3a')](_0x3a0bc8[_0x9208('0x38')],{'mailboxuser':_0x517c4c['mailbox']});_0x3a0bc8=_[_0x9208('0x3a')]({},_0x3a0bc8,_0x33e403[_0x9208('0x3c')]);return db[_0x9208('0x54')][_0x9208('0x55')](_0x3a0bc8)[_0x9208('0x20')](respondWithFilteredResult(_0x1a5b54,_0x3a0bc8));})[_0x9208('0x41')](handleError(_0x1a5b54,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index e9d2627..832944d 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 _0xa0ae=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','mailbox_context','mailbox','context','lodash'];(function(_0x10284e,_0x2b0a3c){var _0x2ddff5=function(_0x4d52b3){while(--_0x4d52b3){_0x10284e['push'](_0x10284e['shift']());}};_0x2ddff5(++_0x2b0a3c);}(_0xa0ae,0x103));var _0xea0a=function(_0x434010,_0x591dd5){_0x434010=_0x434010-0x0;var _0x37cab1=_0xa0ae[_0x434010];return _0x37cab1;};'use strict';var _=require(_0xea0a('0x0'));var util=require(_0xea0a('0x1'));var logger=require(_0xea0a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xea0a('0x3'));var rp=require(_0xea0a('0x4'));var fs=require('fs');var path=require(_0xea0a('0x5'));var rimraf=require(_0xea0a('0x6'));var config=require(_0xea0a('0x7'));var attributes=require(_0xea0a('0x8'));module[_0xea0a('0x9')]=function(_0x1cfedb,_0x554f61){return _0x1cfedb['define']('VoiceMail',attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xea0a('0xa'),'fields':[_0xea0a('0xb'),_0xea0a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6986=['define','VoiceMail','voice_voicemail','mailbox_context','mailbox','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports'];(function(_0x2687d6,_0x358c86){var _0x264c44=function(_0x4ff59d){while(--_0x4ff59d){_0x2687d6['push'](_0x2687d6['shift']());}};_0x264c44(++_0x358c86);}(_0x6986,0x122));var _0x6698=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0x6986[_0x1d426f];return _0x17f71a;};'use strict';var _=require('lodash');var util=require(_0x6698('0x0'));var logger=require(_0x6698('0x1'))(_0x6698('0x2'));var moment=require(_0x6698('0x3'));var BPromise=require(_0x6698('0x4'));var rp=require(_0x6698('0x5'));var fs=require('fs');var path=require(_0x6698('0x6'));var rimraf=require(_0x6698('0x7'));var config=require('../../config/environment');var attributes=require(_0x6698('0x8'));module[_0x6698('0x9')]=function(_0x495780,_0x24d968){return _0x495780[_0x6698('0xa')](_0x6698('0xb'),attributes,{'tableName':_0x6698('0xc'),'paranoid':![],'indexes':[{'name':_0x6698('0xd'),'fields':[_0x6698('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 35eccb1..d47e645 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 _0x96fe=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','randomstring','../../mysqldb'];(function(_0x3d6c55,_0x5337db){var _0x4617b1=function(_0x16e3f){while(--_0x16e3f){_0x3d6c55['push'](_0x3d6c55['shift']());}};_0x4617b1(++_0x5337db);}(_0x96fe,0x151));var _0xe96f=function(_0x31124e,_0x19bca2){_0x31124e=_0x31124e-0x0;var _0x10b72d=_0x96fe[_0x31124e];return _0x10b72d;};'use strict';var _=require(_0xe96f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe96f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe96f('0x2'))['db'];var utils=require(_0xe96f('0x3'));var logger=require(_0xe96f('0x4'))(_0xe96f('0x5'));var config=require('../../config/environment');var jayson=require(_0xe96f('0x6'));var client=jayson[_0xe96f('0x7')][_0xe96f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d84c1,_0x4b3252,_0x36743e){return new BPromise(function(_0xb88e18,_0x1f0799){return client[_0xe96f('0x9')](_0x3d84c1,_0x36743e)[_0xe96f('0xa')](function(_0x17c9f5){logger[_0xe96f('0xb')](_0xe96f('0xc'),_0x4b3252,'request\x20sent');logger[_0xe96f('0xd')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x4b3252,_0xe96f('0xe'),JSON[_0xe96f('0xf')](_0x17c9f5));if(_0x17c9f5['error']){if(_0x17c9f5[_0xe96f('0x10')][_0xe96f('0x11')]===0x1f4){logger['error'](_0xe96f('0xc'),_0x4b3252,_0x17c9f5[_0xe96f('0x10')][_0xe96f('0x12')]);return _0x1f0799(_0x17c9f5['error'][_0xe96f('0x12')]);}logger['error'](_0xe96f('0xc'),_0x4b3252,_0x17c9f5[_0xe96f('0x10')][_0xe96f('0x12')]);return _0xb88e18(_0x17c9f5[_0xe96f('0x10')][_0xe96f('0x12')]);}else{logger[_0xe96f('0xb')](_0xe96f('0xc'),_0x4b3252,'request\x20sent');_0xb88e18(_0x17c9f5[_0xe96f('0x13')][_0xe96f('0x12')]);}})['catch'](function(_0x1cab83){logger[_0xe96f('0x10')](_0xe96f('0xc'),_0x4b3252,_0x1cab83);_0x1f0799(_0x1cab83);});});} \ No newline at end of file +var _0x8060=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0x8060,0x18b));var _0x0806=function(_0x29d4b5,_0x1913e2){_0x29d4b5=_0x29d4b5-0x0;var _0x3fbb01=_0x8060[_0x29d4b5];return _0x3fbb01;};'use strict';var _=require(_0x0806('0x0'));var util=require(_0x0806('0x1'));var moment=require(_0x0806('0x2'));var BPromise=require(_0x0806('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0806('0x4'));var db=require(_0x0806('0x5'))['db'];var utils=require(_0x0806('0x6'));var logger=require('../../config/logger')(_0x0806('0x7'));var config=require(_0x0806('0x8'));var jayson=require(_0x0806('0x9'));var client=jayson[_0x0806('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50200b,_0x2ff852,_0x1287a4){return new BPromise(function(_0x384cb2,_0x12ef7d){return client[_0x0806('0xb')](_0x50200b,_0x1287a4)[_0x0806('0xc')](function(_0x333561){logger[_0x0806('0xd')]('VoiceMail,\x20%s,\x20%s',_0x2ff852,_0x0806('0xe'));logger[_0x0806('0xf')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x2ff852,_0x0806('0xe'),JSON[_0x0806('0x10')](_0x333561));if(_0x333561[_0x0806('0x11')]){if(_0x333561[_0x0806('0x11')]['code']===0x1f4){logger[_0x0806('0x11')](_0x0806('0x12'),_0x2ff852,_0x333561[_0x0806('0x11')][_0x0806('0x13')]);return _0x12ef7d(_0x333561['error']['message']);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x2ff852,_0x333561[_0x0806('0x11')]['message']);return _0x384cb2(_0x333561[_0x0806('0x11')][_0x0806('0x13')]);}else{logger[_0x0806('0xd')]('VoiceMail,\x20%s,\x20%s',_0x2ff852,'request\x20sent');_0x384cb2(_0x333561[_0x0806('0x14')]['message']);}})[_0x0806('0x15')](function(_0x279bc9){logger[_0x0806('0x11')](_0x0806('0x12'),_0x2ff852,_0x279bc9);_0x12ef7d(_0x279bc9);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 94631ad..3c6793e 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 _0x687b=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x687b,0x14a));var _0xb687=function(_0x2e11d3,_0x26a29a){_0x2e11d3=_0x2e11d3-0x0;var _0x3f7f7f=_0x687b[_0x2e11d3];return _0x3f7f7f;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb687('0x4'));var interaction=require(_0xb687('0x5'));var config=require(_0xb687('0x6'));var controller=require(_0xb687('0x7'));router[_0xb687('0x8')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xa')]);router[_0xb687('0x8')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller['show']);router[_0xb687('0x8')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0xe')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xf')]);router[_0xb687('0x10')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller[_0xb687('0x11')]);router[_0xb687('0x12')]('/:id',auth[_0xb687('0x9')](),controller[_0xb687('0x13')]);module[_0xb687('0x14')]=router; \ No newline at end of file +var _0x1261=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','/:id','show','/:id/download','isAuthenticated','download','create','put','destroy'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x1261,0x144));var _0x1126=function(_0x2ed51e,_0x20d606){_0x2ed51e=_0x2ed51e-0x0;var _0x44318c=_0x1261[_0x2ed51e];return _0x44318c;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0xf')]);router[_0x1126('0x10')]('/:id',auth[_0x1126('0xd')](),controller['update']);router['delete'](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0x11')]);module[_0x1126('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 27dfaa4..0fd8166 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 _0xf9dd=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x4e4702,_0x55bc42){var _0x38f8d2=function(_0x169f7e){while(--_0x169f7e){_0x4e4702['push'](_0x4e4702['shift']());}};_0x38f8d2(++_0x55bc42);}(_0xf9dd,0x1f1));var _0xdf9d=function(_0x987238,_0x28b2c3){_0x987238=_0x987238-0x0;var _0x3b7ce3=_0xf9dd[_0x987238];return _0x3b7ce3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xdf9d('0x0')],'get':function(_0x5d1a3f){return this[_0xdf9d('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xdf9d('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xdf9d('0x4')](_0xdf9d('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xdf9d('0x3')],'defaultValue':''},'stamp':{'type':_0xdf9d('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0x7743=['BLOB','TIMESTAMP','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x849e7c,_0x34014e){var _0x11722f=function(_0x1a3fa3){while(--_0x1a3fa3){_0x849e7c['push'](_0x849e7c['shift']());}};_0x11722f(++_0x34014e);}(_0x7743,0x176));var _0x3774=function(_0x1ff486,_0x34042c){_0x1ff486=_0x1ff486-0x0;var _0x48f5f2=_0x7743[_0x1ff486];return _0x48f5f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3774('0x0')],'get':function(_0x317e63){return this[_0x3774('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x3774('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x3774('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3774('0x3')],'defaultValue':''},'stamp':{'type':_0x3774('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index fbf7210..9b8fe46 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 _0x282b=['ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','VoiceMailMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','update','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv'];(function(_0x1382c1,_0x4f35d9){var _0x3fed6e=function(_0x19edfe){while(--_0x19edfe){_0x1382c1['push'](_0x1382c1['shift']());}};_0x3fed6e(++_0x4f35d9);}(_0x282b,0xec));var _0xb282=function(_0x5eea32,_0x13bb1a){_0x5eea32=_0x5eea32-0x0;var _0x40c7e3=_0x282b[_0x5eea32];return _0x40c7e3;};'use strict';var pdf=require(_0xb282('0x0'));var emlformat=require(_0xb282('0x1'));var rimraf=require(_0xb282('0x2'));var zipdir=require(_0xb282('0x3'));var jsonpatch=require(_0xb282('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb282('0x5'));var Mustache=require('mustache');var util=require(_0xb282('0x6'));var path=require(_0xb282('0x7'));var sox=require(_0xb282('0x8'));var csv=require(_0xb282('0x9'));var ejs=require(_0xb282('0xa'));var fs=require('fs');var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d52d2,_0x338bdb){_0x338bdb=_0x338bdb||0xcc;return function(_0xc08746){if(_0xc08746){return _0x5d52d2[_0xb282('0x17')](_0x338bdb);}return _0x5d52d2[_0xb282('0x18')](_0x338bdb)[_0xb282('0x19')]();};}function respondWithResult(_0x55bd85,_0x34c595){_0x34c595=_0x34c595||0xc8;return function(_0x5adf7f){if(_0x5adf7f){return _0x55bd85[_0xb282('0x18')](_0x34c595)[_0xb282('0x1a')](_0x5adf7f);}};}function respondWithFilteredResult(_0x4af892,_0x525cfa){return function(_0x5bc7c3){if(_0x5bc7c3){var _0x13cea1=_0x5bc7c3[_0xb282('0x1b')],_0x350676=_0x525cfa['offset'],_0x7c20df=_0x525cfa[_0xb282('0x1c')]+_0x525cfa[_0xb282('0x1d')],_0xbb182;if(_0x7c20df>=_0x13cea1){_0x7c20df=_0x13cea1;_0xbb182=0xc8;}else{_0xbb182=0xce;}_0x4af892[_0xb282('0x18')](_0xbb182);return _0x4af892[_0xb282('0x1e')](_0xb282('0x1f'),_0x350676+'-'+_0x7c20df+'/'+_0x13cea1)['json'](_0x5bc7c3);}return null;};}function patchUpdates(_0x52e305){return function(_0xcea320){try{jsonpatch[_0xb282('0x20')](_0xcea320,_0x52e305,!![]);}catch(_0x599f9e){return BPromise[_0xb282('0x21')](_0x599f9e);}return _0xcea320[_0xb282('0x22')]();};}function saveUpdates(_0x2e3928,_0x438dbe){return function(_0x1c3084){if(_0x1c3084){return _0x1c3084['update'](_0x2e3928)[_0xb282('0x23')](function(_0x16a656){return _0x16a656;});}return null;};}function removeEntity(_0x1f3e12,_0x4b79d7){return function(_0x437d66){if(_0x437d66){return _0x437d66[_0xb282('0x24')]()[_0xb282('0x23')](function(){_0x1f3e12[_0xb282('0x18')](0xcc)[_0xb282('0x19')]();});}};}function handleEntityNotFound(_0x56645f,_0x4d624f){return function(_0x360f15){if(!_0x360f15){_0x56645f[_0xb282('0x17')](0x194);}return _0x360f15;};}function handleError(_0x4934f0,_0x5e828e){_0x5e828e=_0x5e828e||0x1f4;return function(_0x34774d){logger[_0xb282('0x25')](_0x34774d[_0xb282('0x26')]);if(_0x34774d[_0xb282('0x27')]){delete _0x34774d[_0xb282('0x27')];}_0x4934f0[_0xb282('0x18')](_0x5e828e)['send'](_0x34774d);};}exports[_0xb282('0x28')]=function(_0x42015c,_0x50bd73){var _0x22d895={},_0x38a1f8={},_0x2a4491={'count':0x0,'rows':[]};var _0x280940=_['map'](db[_0xb282('0x29')][_0xb282('0x2a')],function(_0xe337b8){return{'name':_0xe337b8[_0xb282('0x2b')],'type':_0xe337b8[_0xb282('0x2c')][_0xb282('0x2d')]};});_0x38a1f8[_0xb282('0x2e')]=_['differenceBy'](_[_0xb282('0x2f')](_0x280940,_0xb282('0x27')),[_0xb282('0x27')]);_0x38a1f8[_0xb282('0x30')]=_[_0xb282('0x31')](_0x42015c['query']);_0x38a1f8[_0xb282('0x32')]=_['intersection'](_0x38a1f8[_0xb282('0x2e')],_0x38a1f8[_0xb282('0x30')]);_0x22d895[_0xb282('0x33')]=_['intersection'](_0x38a1f8[_0xb282('0x2e')],qs['fields'](_0x42015c[_0xb282('0x30')][_0xb282('0x34')]));_0x22d895[_0xb282('0x33')]=_0x22d895[_0xb282('0x33')][_0xb282('0x35')]?_0x22d895[_0xb282('0x33')]:_0x38a1f8['model'];if(!_0x42015c[_0xb282('0x30')][_0xb282('0x36')]('nolimit')){_0x22d895['limit']=qs[_0xb282('0x1d')](_0x42015c[_0xb282('0x30')][_0xb282('0x1d')]);_0x22d895['offset']=qs['offset'](_0x42015c['query'][_0xb282('0x1c')]);}_0x22d895[_0xb282('0x37')]=qs[_0xb282('0x38')](_0x42015c[_0xb282('0x30')][_0xb282('0x38')]);_0x22d895[_0xb282('0x39')]=qs[_0xb282('0x32')](_['pick'](_0x42015c[_0xb282('0x30')],_0x38a1f8['filters']),_0x280940);if(_0x42015c[_0xb282('0x30')][_0xb282('0x3a')]){_0x22d895[_0xb282('0x39')]=_['merge'](_0x22d895[_0xb282('0x39')],{'$or':_['map'](_0x280940,function(_0x3bd325){if(_0x3bd325[_0xb282('0x2c')]!==_0xb282('0x3b')){var _0x246c85={};_0x246c85[_0x3bd325['name']]={'$like':'%'+_0x42015c['query'][_0xb282('0x3a')]+'%'};return _0x246c85;}})});}_0x22d895=_[_0xb282('0x3c')]({},_0x22d895,_0x42015c[_0xb282('0x3d')]);var _0x20d56c={'where':_0x22d895['where']};return db[_0xb282('0x29')]['count'](_0x20d56c)[_0xb282('0x23')](function(_0x1a1b50){_0x2a4491['count']=_0x1a1b50;if(_0x42015c[_0xb282('0x30')][_0xb282('0x3e')]){_0x22d895[_0xb282('0x3f')]=[{'all':!![]}];}return db[_0xb282('0x29')][_0xb282('0x40')](_0x22d895);})[_0xb282('0x23')](function(_0x43e87e){_0x2a4491[_0xb282('0x41')]=_0x43e87e;return _0x2a4491;})[_0xb282('0x23')](respondWithFilteredResult(_0x50bd73,_0x22d895))[_0xb282('0x42')](handleError(_0x50bd73,null));};exports[_0xb282('0x43')]=function(_0x91fe43,_0x1caff0){var _0x138a72={'raw':!![],'where':{'id':_0x91fe43[_0xb282('0x44')]['id']}},_0x309441={};_0x309441[_0xb282('0x2e')]=_[_0xb282('0x31')](db['VoiceMailMessage'][_0xb282('0x2a')]);_0x309441['query']=_[_0xb282('0x31')](_0x91fe43[_0xb282('0x30')]);_0x309441[_0xb282('0x32')]=_[_0xb282('0x45')](_0x309441[_0xb282('0x2e')],_0x309441[_0xb282('0x30')]);_0x138a72['attributes']=_['intersection'](_0x309441[_0xb282('0x2e')],qs['fields'](_0x91fe43[_0xb282('0x30')][_0xb282('0x34')]));_0x138a72['attributes']=_0x138a72[_0xb282('0x33')][_0xb282('0x35')]?_0x138a72[_0xb282('0x33')]:_0x309441['model'];if(_0x91fe43['query'][_0xb282('0x3e')]){_0x138a72['include']=[{'all':!![]}];}_0x138a72=_[_0xb282('0x3c')]({},_0x138a72,_0x91fe43[_0xb282('0x3d')]);return db[_0xb282('0x29')][_0xb282('0x46')](_0x138a72)[_0xb282('0x23')](handleEntityNotFound(_0x1caff0,null))[_0xb282('0x23')](respondWithResult(_0x1caff0,null))['catch'](handleError(_0x1caff0,null));};exports[_0xb282('0x47')]=function(_0xb0cf81,_0x8e6fb8){return db['VoiceMailMessage'][_0xb282('0x47')](_0xb0cf81['body'],{})[_0xb282('0x23')](respondWithResult(_0x8e6fb8,0xc9))['catch'](handleError(_0x8e6fb8,null));};exports[_0xb282('0x48')]=function(_0x4ac56f,_0x4f92c9){if(_0x4ac56f['body']['id']){delete _0x4ac56f[_0xb282('0x49')]['id'];}return db[_0xb282('0x29')][_0xb282('0x46')]({'where':{'id':_0x4ac56f[_0xb282('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f92c9,null))['then'](saveUpdates(_0x4ac56f['body'],null))[_0xb282('0x23')](respondWithResult(_0x4f92c9,null))[_0xb282('0x42')](handleError(_0x4f92c9,null));};exports[_0xb282('0x24')]=function(_0x1ab323,_0x4e5b3d){return db[_0xb282('0x29')][_0xb282('0x46')]({'where':{'id':_0x1ab323['params']['id']}})[_0xb282('0x23')](handleEntityNotFound(_0x4e5b3d,null))[_0xb282('0x23')](removeEntity(_0x4e5b3d,null))[_0xb282('0x42')](handleError(_0x4e5b3d,null));};exports[_0xb282('0x4a')]=function(_0x1d356e,_0x5522be,_0x6a295c){return db[_0xb282('0x29')][_0xb282('0x46')]({'where':{'id':_0x1d356e[_0xb282('0x44')]['id']},'attributes':['id',_0xb282('0x4b'),_0xb282('0x4c')]})['then'](handleEntityNotFound(_0x5522be,null))[_0xb282('0x23')](function(_0x574653){if(_0x574653){if(!_0x574653[_0xb282('0x4b')]){throw new db[(_0xb282('0x4d'))]['ValidationError'](_0xb282('0x4e'));}var _0x3dd8cb={'Content-Type':_0xb282('0x4f'),'Content-Disposition':'attachment'};if(_0x574653['msg_id']){_0x3dd8cb[_0xb282('0x50')]=_0xb282('0x51')+_0x574653[_0xb282('0x4c')]+'.wav\x22';}_0x5522be[_0xb282('0x1e')](_0x3dd8cb);return _0x5522be['send'](new Buffer(_0x574653[_0xb282('0x4b')]));}})[_0xb282('0x42')](handleError(_0x5522be,null));}; \ No newline at end of file +var _0x39cb=['map','VoiceMailMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','send','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index'];(function(_0x52f412,_0x32b546){var _0x2b5a83=function(_0x26e30b){while(--_0x26e30b){_0x52f412['push'](_0x52f412['shift']());}};_0x2b5a83(++_0x32b546);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb39c('0x0'));var rimraf=require(_0xb39c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb39c('0x2'));var rp=require(_0xb39c('0x3'));var moment=require('moment');var BPromise=require(_0xb39c('0x4'));var Mustache=require(_0xb39c('0x5'));var util=require(_0xb39c('0x6'));var path=require(_0xb39c('0x7'));var sox=require(_0xb39c('0x8'));var csv=require('to-csv');var ejs=require(_0xb39c('0x9'));var fs=require('fs');var _=require(_0xb39c('0xa'));var squel=require(_0xb39c('0xb'));var crypto=require(_0xb39c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb39c('0xd'));var querystring=require(_0xb39c('0xe'));var Papa=require(_0xb39c('0xf'));var Redis=require(_0xb39c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb39c('0x11'));var logger=require(_0xb39c('0x12'))(_0xb39c('0x13'));var utils=require(_0xb39c('0x14'));var config=require(_0xb39c('0x15'));var db=require(_0xb39c('0x16'))['db'];function respondWithStatusCode(_0x2a5c79,_0x18d12e){_0x18d12e=_0x18d12e||0xcc;return function(_0x51ff24){if(_0x51ff24){return _0x2a5c79[_0xb39c('0x17')](_0x18d12e);}return _0x2a5c79[_0xb39c('0x18')](_0x18d12e)[_0xb39c('0x19')]();};}function respondWithResult(_0x5e4caf,_0xf4662a){_0xf4662a=_0xf4662a||0xc8;return function(_0x40a6d3){if(_0x40a6d3){return _0x5e4caf[_0xb39c('0x18')](_0xf4662a)[_0xb39c('0x1a')](_0x40a6d3);}};}function respondWithFilteredResult(_0x469fa9,_0x27c22a){return function(_0x8e9181){if(_0x8e9181){var _0x5277ce=_0x8e9181[_0xb39c('0x1b')],_0x316c9b=_0x27c22a[_0xb39c('0x1c')],_0x3223f6=_0x27c22a[_0xb39c('0x1c')]+_0x27c22a[_0xb39c('0x1d')],_0x10989d;if(_0x3223f6>=_0x5277ce){_0x3223f6=_0x5277ce;_0x10989d=0xc8;}else{_0x10989d=0xce;}_0x469fa9[_0xb39c('0x18')](_0x10989d);return _0x469fa9[_0xb39c('0x1e')](_0xb39c('0x1f'),_0x316c9b+'-'+_0x3223f6+'/'+_0x5277ce)['json'](_0x8e9181);}return null;};}function patchUpdates(_0x1d2f49){return function(_0x1a8e12){try{jsonpatch[_0xb39c('0x20')](_0x1a8e12,_0x1d2f49,!![]);}catch(_0x447352){return BPromise['reject'](_0x447352);}return _0x1a8e12[_0xb39c('0x21')]();};}function saveUpdates(_0x2da46a,_0x5e4a0b){return function(_0x2d8e93){if(_0x2d8e93){return _0x2d8e93[_0xb39c('0x22')](_0x2da46a)[_0xb39c('0x23')](function(_0x4ebfca){return _0x4ebfca;});}return null;};}function removeEntity(_0x539d27,_0x2789fd){return function(_0x1a5b9d){if(_0x1a5b9d){return _0x1a5b9d[_0xb39c('0x24')]()['then'](function(){_0x539d27[_0xb39c('0x18')](0xcc)[_0xb39c('0x19')]();});}};}function handleEntityNotFound(_0x1bb895,_0x16f3b0){return function(_0x3b03ed){if(!_0x3b03ed){_0x1bb895['sendStatus'](0x194);}return _0x3b03ed;};}function handleError(_0x3036f5,_0xbeab7e){_0xbeab7e=_0xbeab7e||0x1f4;return function(_0x583ee5){logger[_0xb39c('0x25')](_0x583ee5[_0xb39c('0x26')]);if(_0x583ee5[_0xb39c('0x27')]){delete _0x583ee5[_0xb39c('0x27')];}_0x3036f5[_0xb39c('0x18')](_0xbeab7e)['send'](_0x583ee5);};}exports[_0xb39c('0x28')]=function(_0x299c27,_0x132769){var _0x4c06fa={},_0x41fff2={},_0x337532={'count':0x0,'rows':[]};var _0x52eb5e=_[_0xb39c('0x29')](db[_0xb39c('0x2a')][_0xb39c('0x2b')],function(_0x4e9672){return{'name':_0x4e9672[_0xb39c('0x2c')],'type':_0x4e9672[_0xb39c('0x2d')]['key']};});_0x41fff2[_0xb39c('0x2e')]=_['differenceBy'](_[_0xb39c('0x29')](_0x52eb5e,_0xb39c('0x27')),[_0xb39c('0x27')]);_0x41fff2[_0xb39c('0x2f')]=_[_0xb39c('0x30')](_0x299c27['query']);_0x41fff2[_0xb39c('0x31')]=_['intersection'](_0x41fff2[_0xb39c('0x2e')],_0x41fff2['query']);_0x4c06fa[_0xb39c('0x32')]=_[_0xb39c('0x33')](_0x41fff2[_0xb39c('0x2e')],qs[_0xb39c('0x34')](_0x299c27['query']['fields']));_0x4c06fa[_0xb39c('0x32')]=_0x4c06fa[_0xb39c('0x32')]['length']?_0x4c06fa[_0xb39c('0x32')]:_0x41fff2[_0xb39c('0x2e')];if(!_0x299c27[_0xb39c('0x2f')][_0xb39c('0x35')](_0xb39c('0x36'))){_0x4c06fa[_0xb39c('0x1d')]=qs[_0xb39c('0x1d')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x1d')]);_0x4c06fa[_0xb39c('0x1c')]=qs[_0xb39c('0x1c')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x1c')]);}_0x4c06fa[_0xb39c('0x37')]=qs[_0xb39c('0x38')](_0x299c27[_0xb39c('0x2f')][_0xb39c('0x38')]);_0x4c06fa[_0xb39c('0x39')]=qs[_0xb39c('0x31')](_['pick'](_0x299c27[_0xb39c('0x2f')],_0x41fff2[_0xb39c('0x31')]),_0x52eb5e);if(_0x299c27['query']['filter']){_0x4c06fa['where']=_[_0xb39c('0x3a')](_0x4c06fa[_0xb39c('0x39')],{'$or':_[_0xb39c('0x29')](_0x52eb5e,function(_0x5522ce){if(_0x5522ce[_0xb39c('0x2d')]!==_0xb39c('0x3b')){var _0x44afba={};_0x44afba[_0x5522ce[_0xb39c('0x27')]]={'$like':'%'+_0x299c27[_0xb39c('0x2f')]['filter']+'%'};return _0x44afba;}})});}_0x4c06fa=_[_0xb39c('0x3a')]({},_0x4c06fa,_0x299c27[_0xb39c('0x3c')]);var _0x51b489={'where':_0x4c06fa[_0xb39c('0x39')]};return db['VoiceMailMessage'][_0xb39c('0x1b')](_0x51b489)[_0xb39c('0x23')](function(_0x3eaf96){_0x337532['count']=_0x3eaf96;if(_0x299c27[_0xb39c('0x2f')][_0xb39c('0x3d')]){_0x4c06fa[_0xb39c('0x3e')]=[{'all':!![]}];}return db[_0xb39c('0x2a')][_0xb39c('0x3f')](_0x4c06fa);})[_0xb39c('0x23')](function(_0x17ed52){_0x337532[_0xb39c('0x40')]=_0x17ed52;return _0x337532;})[_0xb39c('0x23')](respondWithFilteredResult(_0x132769,_0x4c06fa))[_0xb39c('0x41')](handleError(_0x132769,null));};exports[_0xb39c('0x42')]=function(_0xd1136f,_0x53347e){var _0x38e8ba={'raw':!![],'where':{'id':_0xd1136f[_0xb39c('0x43')]['id']}},_0xbeb7b3={};_0xbeb7b3[_0xb39c('0x2e')]=_[_0xb39c('0x30')](db[_0xb39c('0x2a')][_0xb39c('0x2b')]);_0xbeb7b3[_0xb39c('0x2f')]=_[_0xb39c('0x30')](_0xd1136f['query']);_0xbeb7b3['filters']=_[_0xb39c('0x33')](_0xbeb7b3[_0xb39c('0x2e')],_0xbeb7b3['query']);_0x38e8ba['attributes']=_[_0xb39c('0x33')](_0xbeb7b3['model'],qs[_0xb39c('0x34')](_0xd1136f[_0xb39c('0x2f')][_0xb39c('0x34')]));_0x38e8ba[_0xb39c('0x32')]=_0x38e8ba[_0xb39c('0x32')]['length']?_0x38e8ba[_0xb39c('0x32')]:_0xbeb7b3[_0xb39c('0x2e')];if(_0xd1136f['query']['includeAll']){_0x38e8ba[_0xb39c('0x3e')]=[{'all':!![]}];}_0x38e8ba=_['merge']({},_0x38e8ba,_0xd1136f['options']);return db[_0xb39c('0x2a')][_0xb39c('0x44')](_0x38e8ba)[_0xb39c('0x23')](handleEntityNotFound(_0x53347e,null))[_0xb39c('0x23')](respondWithResult(_0x53347e,null))[_0xb39c('0x41')](handleError(_0x53347e,null));};exports[_0xb39c('0x45')]=function(_0x25ca4e,_0x164c82){return db[_0xb39c('0x2a')][_0xb39c('0x45')](_0x25ca4e['body'],{})[_0xb39c('0x23')](respondWithResult(_0x164c82,0xc9))[_0xb39c('0x41')](handleError(_0x164c82,null));};exports[_0xb39c('0x22')]=function(_0x2f790e,_0x40e1dc){if(_0x2f790e[_0xb39c('0x46')]['id']){delete _0x2f790e[_0xb39c('0x46')]['id'];}return db[_0xb39c('0x2a')][_0xb39c('0x44')]({'where':{'id':_0x2f790e[_0xb39c('0x43')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x40e1dc,null))[_0xb39c('0x23')](saveUpdates(_0x2f790e[_0xb39c('0x46')],null))[_0xb39c('0x23')](respondWithResult(_0x40e1dc,null))[_0xb39c('0x41')](handleError(_0x40e1dc,null));};exports[_0xb39c('0x24')]=function(_0x4ee3fc,_0x283acf){return db[_0xb39c('0x2a')][_0xb39c('0x44')]({'where':{'id':_0x4ee3fc[_0xb39c('0x43')]['id']}})[_0xb39c('0x23')](handleEntityNotFound(_0x283acf,null))[_0xb39c('0x23')](removeEntity(_0x283acf,null))[_0xb39c('0x41')](handleError(_0x283acf,null));};exports[_0xb39c('0x47')]=function(_0x4b0917,_0x4886ab,_0x32bba9){return db[_0xb39c('0x2a')]['find']({'where':{'id':_0x4b0917['params']['id']},'attributes':['id',_0xb39c('0x48'),_0xb39c('0x49')]})['then'](handleEntityNotFound(_0x4886ab,null))[_0xb39c('0x23')](function(_0x55b6b1){if(_0x55b6b1){if(!_0x55b6b1['recording']){throw new db[(_0xb39c('0x4a'))]['ValidationError'](_0xb39c('0x4b'));}var _0x3fe9db={'Content-Type':_0xb39c('0x4c'),'Content-Disposition':_0xb39c('0x4d')};if(_0x55b6b1[_0xb39c('0x49')]){_0x3fe9db[_0xb39c('0x4e')]='attachment;\x20filename=\x22'+_0x55b6b1[_0xb39c('0x49')]+_0xb39c('0x4f');}_0x4886ab[_0xb39c('0x1e')](_0x3fe9db);return _0x4886ab[_0xb39c('0x50')](new Buffer(_0x55b6b1[_0xb39c('0x48')]));}})['catch'](handleError(_0x4886ab,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a488bb0..1b8dbf2 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 _0x8ba2=['rimraf','../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x78b0be,_0x5ca66b){var _0x2b631d=function(_0x8ee2d1){while(--_0x8ee2d1){_0x78b0be['push'](_0x78b0be['shift']());}};_0x2b631d(++_0x5ca66b);}(_0x8ba2,0x13f));var _0x28ba=function(_0x110085,_0x2c7a14){_0x110085=_0x110085-0x0;var _0x3f95cd=_0x8ba2[_0x110085];return _0x3f95cd;};'use strict';var _=require(_0x28ba('0x0'));var util=require(_0x28ba('0x1'));var logger=require(_0x28ba('0x2'))('api');var moment=require(_0x28ba('0x3'));var BPromise=require(_0x28ba('0x4'));var rp=require(_0x28ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x28ba('0x6'));var config=require(_0x28ba('0x7'));var attributes=require(_0x28ba('0x8'));module[_0x28ba('0x9')]=function(_0x3d039d,_0x24cbfc){return _0x3d039d['define'](_0x28ba('0xa'),attributes,{'tableName':_0x28ba('0xb'),'paranoid':![],'indexes':[{'name':_0x28ba('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x1c8a=['moment','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c8a,0x140));var _0xa1c8=function(_0x53d903,_0x48a43c){_0x53d903=_0x53d903-0x0;var _0xf33453=_0x1c8a[_0x53d903];return _0xf33453;};'use strict';var _=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var logger=require(_0xa1c8('0x2'))(_0xa1c8('0x3'));var moment=require(_0xa1c8('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1c8('0x6'));var config=require(_0xa1c8('0x7'));var attributes=require(_0xa1c8('0x8'));module['exports']=function(_0x331282,_0x14b85c){return _0x331282[_0xa1c8('0x9')]('VoiceMailMessage',attributes,{'tableName':_0xa1c8('0xa'),'paranoid':![],'indexes':[{'name':_0xa1c8('0xb'),'fields':[_0xa1c8('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 708bbb8..0c0c3a6 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x5354ab,_0x2af0f7){var _0x2ab6db=function(_0x28e714){while(--_0x28e714){_0x5354ab['push'](_0x5354ab['shift']());}};_0x2ab6db(++_0x2af0f7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1333c7,_0x313346){_0x1333c7=_0x1333c7-0x0;var _0x3b1232=_0x5f2f[_0x1333c7];return _0x3b1232;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x0b0e=['VoiceMailMessage,\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','VoiceMailMessage,\x20%s,\x20%s','debug'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x27b7d2,_0x56c091){_0x27b7d2=_0x27b7d2-0x0;var _0x3ef6be=_0x0b0e[_0x27b7d2];return _0x3ef6be;};'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')]('VoiceMailMessage,\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/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 947dc22..7b33558 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 _0x7352=['delete','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id/sounds','getSounds','post','create','addSound','put','/:id','update','destroy'];(function(_0x403484,_0x33b8ba){var _0x55b2bc=function(_0x1f9b3a){while(--_0x1f9b3a){_0x403484['push'](_0x403484['shift']());}};_0x55b2bc(++_0x33b8ba);}(_0x7352,0x64));var _0x2735=function(_0x3a0f77,_0x39f605){_0x3a0f77=_0x3a0f77-0x0;var _0x54fd0c=_0x7352[_0x3a0f77];return _0x54fd0c;};'use strict';var multer=require(_0x2735('0x0'));var util=require(_0x2735('0x1'));var path=require('path');var timeout=require(_0x2735('0x2'));var express=require(_0x2735('0x3'));var router=express['Router']();var auth=require(_0x2735('0x4'));var interaction=require(_0x2735('0x5'));var config=require(_0x2735('0x6'));var controller=require(_0x2735('0x7'));router[_0x2735('0x8')]('/',auth[_0x2735('0x9')](),controller[_0x2735('0xa')]);router[_0x2735('0x8')]('/:id',auth[_0x2735('0x9')](),controller['show']);router['get'](_0x2735('0xb'),auth[_0x2735('0x9')](),controller[_0x2735('0xc')]);router[_0x2735('0xd')]('/',auth['isAuthenticated'](),controller[_0x2735('0xe')]);router['post'](_0x2735('0xb'),auth[_0x2735('0x9')](),controller[_0x2735('0xf')]);router[_0x2735('0x10')](_0x2735('0x11'),auth[_0x2735('0x9')](),controller[_0x2735('0x12')]);router['delete']('/:id',auth[_0x2735('0x9')](),controller[_0x2735('0x13')]);router[_0x2735('0x14')](_0x2735('0x15'),auth[_0x2735('0x9')](),controller[_0x2735('0x16')]);module[_0x2735('0x17')]=router; \ No newline at end of file +var _0xde8b=['addSound','put','delete','/:id','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','show','getSounds','post','/:id/sounds'];(function(_0x2ca6af,_0x74834a){var _0x24fa29=function(_0x5d3f81){while(--_0x5d3f81){_0x2ca6af['push'](_0x2ca6af['shift']());}};_0x24fa29(++_0x74834a);}(_0xde8b,0x80));var _0xbde8=function(_0x1c92a0,_0x1a55b5){_0x1c92a0=_0x1c92a0-0x0;var _0x4ad53f=_0xde8b[_0x1c92a0];return _0x4ad53f;};'use strict';var multer=require(_0xbde8('0x0'));var util=require(_0xbde8('0x1'));var path=require(_0xbde8('0x2'));var timeout=require(_0xbde8('0x3'));var express=require(_0xbde8('0x4'));var router=express[_0xbde8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xbde8('0x6'));var config=require(_0xbde8('0x7'));var controller=require(_0xbde8('0x8'));router['get']('/',auth[_0xbde8('0x9')](),controller[_0xbde8('0xa')]);router[_0xbde8('0xb')]('/:id',auth[_0xbde8('0x9')](),controller[_0xbde8('0xc')]);router[_0xbde8('0xb')]('/:id/sounds',auth[_0xbde8('0x9')](),controller[_0xbde8('0xd')]);router[_0xbde8('0xe')]('/',auth[_0xbde8('0x9')](),controller['create']);router[_0xbde8('0xe')](_0xbde8('0xf'),auth[_0xbde8('0x9')](),controller[_0xbde8('0x10')]);router[_0xbde8('0x11')]('/:id',auth[_0xbde8('0x9')](),controller['update']);router[_0xbde8('0x12')](_0xbde8('0x13'),auth[_0xbde8('0x9')](),controller[_0xbde8('0x14')]);router[_0xbde8('0x12')](_0xbde8('0x15'),auth['isAuthenticated'](),controller[_0xbde8('0x16')]);module[_0xbde8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 7117272..1b89cdc 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 _0x7aa5=['alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','custom','files','quietmp3nb','quietmp3','STRING'];(function(_0x3977dc,_0x18499a){var _0x40e46e=function(_0x3ea4bc){while(--_0x3ea4bc){_0x3977dc['push'](_0x3977dc['shift']());}};_0x40e46e(++_0x18499a);}(_0x7aa5,0x10b));var _0x57aa=function(_0x54b7a6,_0x4f6cb9){_0x54b7a6=_0x54b7a6-0x0;var _0x4ecd83=_0x7aa5[_0x54b7a6];return _0x4ecd83;};'use strict';var Sequelize=require(_0x57aa('0x0'));module[_0x57aa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x57aa('0x2')},'mode':{'type':Sequelize[_0x57aa('0x3')](_0x57aa('0x4'),_0x57aa('0x5'),'mp3nb',_0x57aa('0x6'),_0x57aa('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x57aa('0x5')},'directory':{'type':Sequelize[_0x57aa('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x57aa('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x57aa('0x8')],'allowNull':!![],'defaultValue':_0x57aa('0x9')},'format':{'type':Sequelize[_0x57aa('0x8')],'allowNull':!![]},'stamp':{'type':_0x57aa('0xa')},'defaultEntry':{'type':Sequelize[_0x57aa('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8921=['name','ENUM','custom','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING'];(function(_0x246dae,_0x17ced5){var _0x426065=function(_0x5f447e){while(--_0x5f447e){_0x246dae['push'](_0x246dae['shift']());}};_0x426065(++_0x17ced5);}(_0x8921,0x9a));var _0x1892=function(_0x5f5606,_0x38704c){_0x5f5606=_0x5f5606-0x0;var _0x883c3c=_0x8921[_0x5f5606];return _0x883c3c;};'use strict';var Sequelize=require(_0x1892('0x0'));module['exports']={'name':{'type':Sequelize[_0x1892('0x1')],'allowNull':![],'unique':_0x1892('0x2')},'mode':{'type':Sequelize[_0x1892('0x3')](_0x1892('0x4'),_0x1892('0x5'),_0x1892('0x6'),_0x1892('0x7'),_0x1892('0x8'),_0x1892('0x9')),'allowNull':!![],'defaultValue':_0x1892('0x5')},'directory':{'type':Sequelize[_0x1892('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x1892('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x1892('0x1')],'allowNull':!![],'defaultValue':_0x1892('0xa')},'format':{'type':Sequelize[_0x1892('0x1')],'allowNull':!![]},'stamp':{'type':_0x1892('0xb')},'defaultEntry':{'type':Sequelize[_0x1892('0xc')],'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 a573830..6576770 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 _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','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','get','MusicOnHolds','UserProfileResource','error'];(function(_0x42dbdb,_0x53e6f0){var _0xa1f510=function(_0x34290a){while(--_0x34290a){_0x42dbdb['push'](_0x42dbdb['shift']());}};_0xa1f510(++_0x53e6f0);}(_0xb10b,0x12a));var _0xbb10=function(_0x2598f0,_0x3d61ff){_0x2598f0=_0x2598f0-0x0;var _0x4448c8=_0xb10b[_0x2598f0];return _0x4448c8;};'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(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));}; \ No newline at end of file +var _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','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','get','MusicOnHolds','UserProfileResource','error'];(function(_0x4c897a,_0x166fbb){var _0x39a99c=function(_0x5292ec){while(--_0x5292ec){_0x4c897a['push'](_0x4c897a['shift']());}};_0x39a99c(++_0x166fbb);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e03a6,_0xf0349){_0x1e03a6=_0x1e03a6-0x0;var _0x295b64=_0xb10b[_0x1e03a6];return _0x295b64;};'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(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 0b3b388..61ff0f4 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 _0xccc9=['api','moment','bluebird','path','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x41b89d,_0x5ae8f9){var _0x22a2c5=function(_0x129c8d){while(--_0x129c8d){_0x41b89d['push'](_0x41b89d['shift']());}};_0x22a2c5(++_0x5ae8f9);}(_0xccc9,0x190));var _0x9ccc=function(_0x61d355,_0x3172e1){_0x61d355=_0x61d355-0x0;var _0x31ef71=_0xccc9[_0x61d355];return _0x31ef71;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x9ccc('0x0'));var moment=require(_0x9ccc('0x1'));var BPromise=require(_0x9ccc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ccc('0x3'));var rimraf=require('rimraf');var config=require(_0x9ccc('0x4'));var attributes=require(_0x9ccc('0x5'));module[_0x9ccc('0x6')]=function(_0x6a94ec,_0x42a273){return _0x6a94ec[_0x9ccc('0x7')](_0x9ccc('0x8'),attributes,{'tableName':_0x9ccc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x372a=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','../../config/logger','api','moment','request-promise'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x372a,0x14c));var _0xa372=function(_0x1110d8,_0x10fc0b){_0x1110d8=_0x1110d8-0x0;var _0x4f38a4=_0x372a[_0x1110d8];return _0x4f38a4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa372('0x0'))(_0xa372('0x1'));var moment=require(_0xa372('0x2'));var BPromise=require('bluebird');var rp=require(_0xa372('0x3'));var fs=require('fs');var path=require(_0xa372('0x4'));var rimraf=require(_0xa372('0x5'));var config=require(_0xa372('0x6'));var attributes=require(_0xa372('0x7'));module[_0xa372('0x8')]=function(_0x29707e,_0x45f7e4){return _0x29707e[_0xa372('0x9')](_0xa372('0xa'),attributes,{'tableName':_0xa372('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 9d8e576..477e59c 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 _0x842e=['rpc','jayson/promise','client','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x842e,0xd5));var _0xe842=function(_0x5ee607,_0x5ef350){_0x5ee607=_0x5ee607-0x0;var _0x49a75a=_0x842e[_0x5ee607];return _0x49a75a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe842('0x0'));var BPromise=require(_0xe842('0x1'));var rs=require(_0xe842('0x2'));var fs=require('fs');var Redis=require(_0xe842('0x3'));var db=require(_0xe842('0x4'))['db'];var utils=require(_0xe842('0x5'));var logger=require(_0xe842('0x6'))(_0xe842('0x7'));var config=require('../../config/environment');var jayson=require(_0xe842('0x8'));var client=jayson[_0xe842('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1505db,_0x107bd8,_0x1bc70e){return new BPromise(function(_0x5208ca,_0x2bf14a){return client[_0xe842('0xa')](_0x1505db,_0x1bc70e)[_0xe842('0xb')](function(_0x7f027a){logger[_0xe842('0xc')](_0xe842('0xd'),_0x107bd8,_0xe842('0xe'));logger[_0xe842('0xf')](_0xe842('0x10'),_0x107bd8,_0xe842('0xe'),JSON['stringify'](_0x7f027a));if(_0x7f027a[_0xe842('0x11')]){if(_0x7f027a['error'][_0xe842('0x12')]===0x1f4){logger[_0xe842('0x11')](_0xe842('0xd'),_0x107bd8,_0x7f027a[_0xe842('0x11')][_0xe842('0x13')]);return _0x2bf14a(_0x7f027a[_0xe842('0x11')][_0xe842('0x13')]);}logger[_0xe842('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x107bd8,_0x7f027a[_0xe842('0x11')]['message']);return _0x5208ca(_0x7f027a[_0xe842('0x11')][_0xe842('0x13')]);}else{logger[_0xe842('0xc')](_0xe842('0xd'),_0x107bd8,'request\x20sent');_0x5208ca(_0x7f027a[_0xe842('0x14')][_0xe842('0x13')]);}})[_0xe842('0x15')](function(_0x373d53){logger[_0xe842('0x11')](_0xe842('0xd'),_0x107bd8,_0x373d53);_0x2bf14a(_0x373d53);});});} \ No newline at end of file +var _0xdf4b=['debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info'];(function(_0x3ad27a,_0x1c5bf0){var _0x5cedcc=function(_0x129a08){while(--_0x129a08){_0x3ad27a['push'](_0x3ad27a['shift']());}};_0x5cedcc(++_0x1c5bf0);}(_0xdf4b,0x12f));var _0xbdf4=function(_0x34fca1,_0x4e0342){_0x34fca1=_0x34fca1-0x0;var _0x4991d6=_0xdf4b[_0x34fca1];return _0x4991d6;};'use strict';var _=require(_0xbdf4('0x0'));var util=require(_0xbdf4('0x1'));var moment=require('moment');var BPromise=require(_0xbdf4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdf4('0x3'));var db=require(_0xbdf4('0x4'))['db'];var utils=require(_0xbdf4('0x5'));var logger=require('../../config/logger')(_0xbdf4('0x6'));var config=require('../../config/environment');var jayson=require(_0xbdf4('0x7'));var client=jayson[_0xbdf4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf45b,_0x5f15a5,_0x3b7e23){return new BPromise(function(_0x4415d6,_0x4219b3){return client[_0xbdf4('0x9')](_0x1cf45b,_0x3b7e23)[_0xbdf4('0xa')](function(_0x5f2b9b){logger[_0xbdf4('0xb')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5f15a5,'request\x20sent');logger[_0xbdf4('0xc')](_0xbdf4('0xd'),_0x5f15a5,_0xbdf4('0xe'),JSON[_0xbdf4('0xf')](_0x5f2b9b));if(_0x5f2b9b[_0xbdf4('0x10')]){if(_0x5f2b9b['error']['code']===0x1f4){logger[_0xbdf4('0x10')](_0xbdf4('0x11'),_0x5f15a5,_0x5f2b9b[_0xbdf4('0x10')][_0xbdf4('0x12')]);return _0x4219b3(_0x5f2b9b[_0xbdf4('0x10')][_0xbdf4('0x12')]);}logger[_0xbdf4('0x10')](_0xbdf4('0x11'),_0x5f15a5,_0x5f2b9b[_0xbdf4('0x10')][_0xbdf4('0x12')]);return _0x4415d6(_0x5f2b9b[_0xbdf4('0x10')][_0xbdf4('0x12')]);}else{logger[_0xbdf4('0xb')](_0xbdf4('0x11'),_0x5f15a5,_0xbdf4('0xe'));_0x4415d6(_0x5f2b9b[_0xbdf4('0x13')][_0xbdf4('0x12')]);}})[_0xbdf4('0x14')](function(_0x520e0a){logger[_0xbdf4('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5f15a5,_0x520e0a);_0x4219b3(_0x520e0a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 6175a91..730e8a5 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 _0x2779=['getAgents','create','post','update','destroy','removeAgents','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users'];(function(_0x204190,_0x3f7343){var _0x1f8142=function(_0xbdcffa){while(--_0xbdcffa){_0x204190['push'](_0x204190['shift']());}};_0x1f8142(++_0x3f7343);}(_0x2779,0x1ea));var _0x9277=function(_0x1ce38a,_0x45dc42){_0x1ce38a=_0x1ce38a-0x0;var _0x5cc0e7=_0x2779[_0x1ce38a];return _0x5cc0e7;};'use strict';var multer=require(_0x9277('0x0'));var util=require('util');var path=require(_0x9277('0x1'));var timeout=require(_0x9277('0x2'));var express=require(_0x9277('0x3'));var router=express['Router']();var auth=require(_0x9277('0x4'));var interaction=require(_0x9277('0x5'));var config=require(_0x9277('0x6'));var controller=require(_0x9277('0x7'));router[_0x9277('0x8')]('/',auth[_0x9277('0x9')](),controller[_0x9277('0xa')]);router[_0x9277('0x8')](_0x9277('0xb'),auth[_0x9277('0x9')](),controller[_0x9277('0xc')]);router[_0x9277('0x8')](_0x9277('0xd'),auth[_0x9277('0x9')](),controller[_0x9277('0xe')]);router[_0x9277('0x8')](_0x9277('0xf'),auth[_0x9277('0x9')](),controller[_0x9277('0x10')]);router['post']('/',auth[_0x9277('0x9')](),controller[_0x9277('0x11')]);router[_0x9277('0x12')](_0x9277('0xf'),auth[_0x9277('0x9')](),controller['addAgents']);router['put'](_0x9277('0xd'),auth[_0x9277('0x9')](),controller[_0x9277('0x13')]);router['delete']('/:id',auth[_0x9277('0x9')](),controller[_0x9277('0x14')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x9277('0x15')]);module['exports']=router; \ No newline at end of file +var _0xe2c9=['../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','describe','/:id/users','getAgents','post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x477d4,_0x4a72a7){var _0x5c72f9=function(_0x42f569){while(--_0x42f569){_0x477d4['push'](_0x477d4['shift']());}};_0x5c72f9(++_0x4a72a7);}(_0xe2c9,0x102));var _0x9e2c=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xe2c9[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require(_0x9e2c('0x0'));var path=require(_0x9e2c('0x1'));var timeout=require('connect-timeout');var express=require(_0x9e2c('0x2'));var router=express[_0x9e2c('0x3')]();var auth=require(_0x9e2c('0x4'));var interaction=require(_0x9e2c('0x5'));var config=require(_0x9e2c('0x6'));var controller=require(_0x9e2c('0x7'));router['get']('/',auth[_0x9e2c('0x8')](),controller[_0x9e2c('0x9')]);router[_0x9e2c('0xa')]('/describe',auth[_0x9e2c('0x8')](),controller[_0x9e2c('0xb')]);router[_0x9e2c('0xa')]('/:id',auth[_0x9e2c('0x8')](),controller['show']);router['get'](_0x9e2c('0xc'),auth['isAuthenticated'](),controller[_0x9e2c('0xd')]);router[_0x9e2c('0xe')]('/',auth[_0x9e2c('0x8')](),controller[_0x9e2c('0xf')]);router[_0x9e2c('0xe')]('/:id/users',auth[_0x9e2c('0x8')](),controller['addAgents']);router[_0x9e2c('0x10')](_0x9e2c('0x11'),auth[_0x9e2c('0x8')](),controller[_0x9e2c('0x12')]);router[_0x9e2c('0x13')](_0x9e2c('0x11'),auth['isAuthenticated'](),controller[_0x9e2c('0x14')]);router[_0x9e2c('0x13')](_0x9e2c('0xc'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x9e2c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index f221629..ab8bb13 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 _0xe4f2=['getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL','system-'];(function(_0x2f29c9,_0x58dd8c){var _0x4c68c6=function(_0x308b9a){while(--_0x308b9a){_0x2f29c9['push'](_0x2f29c9['shift']());}};_0x4c68c6(++_0x58dd8c);}(_0xe4f2,0xf0));var _0x2e4f=function(_0x3acb0f,_0x422e6f){_0x3acb0f=_0x3acb0f-0x0;var _0x5bdb4f=_0xe4f2[_0x3acb0f];return _0x5bdb4f;};'use strict';var Sequelize=require(_0x2e4f('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e4f('0x1')],'allowNull':![],'unique':_0x2e4f('0x2')},'prefix':{'type':Sequelize[_0x2e4f('0x3')],'get':function(_0x12fbfa){return _0x2e4f('0x4')+this[_0x2e4f('0x5')](_0x2e4f('0x2'))+'-';}},'description':{'type':Sequelize[_0x2e4f('0x1')]},'callerIdAll':{'type':Sequelize[_0x2e4f('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x2e4f('0x6')]}}; \ No newline at end of file +var _0xb7a9=['exports','STRING','name','getDataValue','INTEGER','sequelize'];(function(_0x3d1463,_0x166e2a){var _0x256cda=function(_0x3383b8){while(--_0x3383b8){_0x3d1463['push'](_0x3d1463['shift']());}};_0x256cda(++_0x166e2a);}(_0xb7a9,0x1a3));var _0x9b7a=function(_0x566b4f,_0x53a57a){_0x566b4f=_0x566b4f-0x0;var _0x569996=_0xb7a9[_0x566b4f];return _0x569996;};'use strict';var Sequelize=require(_0x9b7a('0x0'));module[_0x9b7a('0x1')]={'name':{'type':Sequelize[_0x9b7a('0x2')],'allowNull':![],'unique':_0x9b7a('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2bbb9a){return'system-'+this[_0x9b7a('0x4')](_0x9b7a('0x3'))+'-';}},'description':{'type':Sequelize[_0x9b7a('0x2')]},'callerIdAll':{'type':Sequelize[_0x9b7a('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x9b7a('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index dac024f..cad32bd 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 _0x474d=['No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./voicePrefix.socket','register','end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoicePrefix','includeAll','include','findAll','rows','show','params','keys','length','find','catch','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','context','from-sip','app','description','Voice\x20Prefix\x20Extension','priority','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','callerIdAll','PREFIX-CALLERIDALL=','push','NoOp'];(function(_0x1a171d,_0x190bef){var _0xa4abc9=function(_0x369d73){while(--_0x369d73){_0x1a171d['push'](_0x1a171d['shift']());}};_0xa4abc9(++_0x190bef);}(_0x474d,0x10d));var _0xd474=function(_0x95d47d,_0x501e1c){_0x95d47d=_0x95d47d-0x0;var _0x4dd222=_0x474d[_0x95d47d];return _0x4dd222;};'use strict';var pdf=require(_0xd474('0x0'));var emlformat=require(_0xd474('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd474('0x2'));var jsonpatch=require(_0xd474('0x3'));var rp=require(_0xd474('0x4'));var moment=require(_0xd474('0x5'));var BPromise=require(_0xd474('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd474('0x7'));var sox=require('sox');var csv=require(_0xd474('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd474('0x9'));var crypto=require(_0xd474('0xa'));var jsforce=require(_0xd474('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd474('0x8'));var querystring=require(_0xd474('0xc'));var Papa=require(_0xd474('0xd'));var Redis=require(_0xd474('0xe'));var authService=require(_0xd474('0xf'));var qs=require(_0xd474('0x10'));var as=require(_0xd474('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd474('0x12'))(_0xd474('0x13'));var utils=require(_0xd474('0x14'));var config=require('../../config/environment');var db=require(_0xd474('0x15'))['db'];config['redis']=_[_0xd474('0x16')](config[_0xd474('0x17')],{'host':_0xd474('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd474('0x19'))[_0xd474('0x1a')](socket);function respondWithStatusCode(_0x6c410d,_0x591b33){_0x591b33=_0x591b33||0xcc;return function(_0x495d30){if(_0x495d30){return _0x6c410d['sendStatus'](_0x591b33);}return _0x6c410d['status'](_0x591b33)[_0xd474('0x1b')]();};}function respondWithResult(_0x1d06cc,_0x4a6326){_0x4a6326=_0x4a6326||0xc8;return function(_0x36d5ca){if(_0x36d5ca){return _0x1d06cc[_0xd474('0x1c')](_0x4a6326)[_0xd474('0x1d')](_0x36d5ca);}};}function respondWithFilteredResult(_0x313584,_0x1daee8){return function(_0x5ece9a){if(_0x5ece9a){var _0x4f1954=_0x5ece9a[_0xd474('0x1e')],_0xc4644c=_0x1daee8[_0xd474('0x1f')],_0x438e52=_0x1daee8[_0xd474('0x1f')]+_0x1daee8[_0xd474('0x20')],_0x1534b4;if(_0x438e52>=_0x4f1954){_0x438e52=_0x4f1954;_0x1534b4=0xc8;}else{_0x1534b4=0xce;}_0x313584['status'](_0x1534b4);return _0x313584[_0xd474('0x21')](_0xd474('0x22'),_0xc4644c+'-'+_0x438e52+'/'+_0x4f1954)['json'](_0x5ece9a);}return null;};}function patchUpdates(_0x4cb789){return function(_0x2329ae){try{jsonpatch['apply'](_0x2329ae,_0x4cb789,!![]);}catch(_0x1d9810){return BPromise[_0xd474('0x23')](_0x1d9810);}return _0x2329ae[_0xd474('0x24')]();};}function saveUpdates(_0x2370fa,_0x57ce62){return function(_0x489fe5){if(_0x489fe5){return _0x489fe5[_0xd474('0x25')](_0x2370fa)[_0xd474('0x26')](function(_0x12b46e){return _0x12b46e;});}return null;};}function removeEntity(_0x2fbb9b,_0x844545){return function(_0x387dae){if(_0x387dae){return _0x387dae[_0xd474('0x27')]()[_0xd474('0x26')](function(){var _0x3de5f2=_0x387dae[_0xd474('0x28')]({'plain':!![]});var _0x1ee82f=_0xd474('0x29');return db[_0xd474('0x2a')]['destroy']({'where':{'type':_0x1ee82f,'resourceId':_0x3de5f2['id']}})['then'](function(){return _0x387dae;});})[_0xd474('0x26')](function(){_0x2fbb9b[_0xd474('0x1c')](0xcc)[_0xd474('0x1b')]();});}};}function handleEntityNotFound(_0x4a4425,_0x552d4b){return function(_0x138959){if(!_0x138959){_0x4a4425[_0xd474('0x2b')](0x194);}return _0x138959;};}function handleError(_0x1a867c,_0x6e2fde){_0x6e2fde=_0x6e2fde||0x1f4;return function(_0x4bc157){logger[_0xd474('0x2c')](_0x4bc157[_0xd474('0x2d')]);if(_0x4bc157['name']){delete _0x4bc157[_0xd474('0x2e')];}_0x1a867c[_0xd474('0x1c')](_0x6e2fde)[_0xd474('0x2f')](_0x4bc157);};}exports[_0xd474('0x30')]=function(_0x32ffe9,_0x708b1b){var _0x4fc612={},_0x4ec578={},_0x2c813e={'count':0x0,'rows':[]};var _0x57af4f=_[_0xd474('0x31')](db['VoicePrefix'][_0xd474('0x32')],function(_0x528c99){return{'name':_0x528c99[_0xd474('0x33')],'type':_0x528c99[_0xd474('0x34')]['key']};});_0x4ec578[_0xd474('0x35')]=_[_0xd474('0x31')](_0x57af4f,_0xd474('0x2e'));_0x4ec578[_0xd474('0x36')]=_['keys'](_0x32ffe9[_0xd474('0x36')]);_0x4ec578['filters']=_['intersection'](_0x4ec578[_0xd474('0x35')],_0x4ec578[_0xd474('0x36')]);_0x4fc612['attributes']=_[_0xd474('0x37')](_0x4ec578['model'],qs['fields'](_0x32ffe9[_0xd474('0x36')][_0xd474('0x38')]));_0x4fc612[_0xd474('0x39')]=_0x4fc612[_0xd474('0x39')]['length']?_0x4fc612[_0xd474('0x39')]:_0x4ec578['model'];if(!_0x32ffe9[_0xd474('0x36')][_0xd474('0x3a')]('nolimit')){_0x4fc612['limit']=qs['limit'](_0x32ffe9[_0xd474('0x36')]['limit']);_0x4fc612[_0xd474('0x1f')]=qs['offset'](_0x32ffe9[_0xd474('0x36')][_0xd474('0x1f')]);}_0x4fc612[_0xd474('0x3b')]=qs[_0xd474('0x3c')](_0x32ffe9['query'][_0xd474('0x3c')]);_0x4fc612[_0xd474('0x3d')]=qs[_0xd474('0x3e')](_[_0xd474('0x3f')](_0x32ffe9[_0xd474('0x36')],_0x4ec578[_0xd474('0x3e')]),_0x57af4f);if(_0x32ffe9[_0xd474('0x36')][_0xd474('0x40')]){_0x4fc612['where']=_[_0xd474('0x41')](_0x4fc612['where'],{'$or':_[_0xd474('0x31')](_0x57af4f,function(_0x592a9d){if(_0x592a9d['type']!==_0xd474('0x42')){var _0x51250e={};_0x51250e[_0x592a9d[_0xd474('0x2e')]]={'$like':'%'+_0x32ffe9[_0xd474('0x36')][_0xd474('0x40')]+'%'};return _0x51250e;}})});}_0x4fc612=_[_0xd474('0x41')]({},_0x4fc612,_0x32ffe9[_0xd474('0x43')]);var _0x1936f6={'where':_0x4fc612[_0xd474('0x3d')]};return db[_0xd474('0x44')]['count'](_0x1936f6)[_0xd474('0x26')](function(_0xff3328){_0x2c813e[_0xd474('0x1e')]=_0xff3328;if(_0x32ffe9[_0xd474('0x36')][_0xd474('0x45')]){_0x4fc612[_0xd474('0x46')]=[{'all':!![]}];}return db[_0xd474('0x44')][_0xd474('0x47')](_0x4fc612);})['then'](function(_0x6ee39c){_0x2c813e[_0xd474('0x48')]=_0x6ee39c;return _0x2c813e;})[_0xd474('0x26')](respondWithFilteredResult(_0x708b1b,_0x4fc612))['catch'](handleError(_0x708b1b,null));};exports[_0xd474('0x49')]=function(_0x32e2cb,_0x36ee57){var _0x4e6712={'raw':![],'where':{'id':_0x32e2cb[_0xd474('0x4a')]['id']}},_0x4f5818={};_0x4f5818[_0xd474('0x35')]=_[_0xd474('0x4b')](db[_0xd474('0x44')][_0xd474('0x32')]);_0x4f5818['query']=_[_0xd474('0x4b')](_0x32e2cb[_0xd474('0x36')]);_0x4f5818[_0xd474('0x3e')]=_['intersection'](_0x4f5818[_0xd474('0x35')],_0x4f5818['query']);_0x4e6712['attributes']=_['intersection'](_0x4f5818[_0xd474('0x35')],qs[_0xd474('0x38')](_0x32e2cb[_0xd474('0x36')][_0xd474('0x38')]));_0x4e6712[_0xd474('0x39')]=_0x4e6712[_0xd474('0x39')][_0xd474('0x4c')]?_0x4e6712[_0xd474('0x39')]:_0x4f5818[_0xd474('0x35')];if(_0x32e2cb['query'][_0xd474('0x45')]){_0x4e6712['include']=[{'all':!![]}];}_0x4e6712=_[_0xd474('0x41')]({},_0x4e6712,_0x32e2cb['options']);return db[_0xd474('0x44')][_0xd474('0x4d')](_0x4e6712)[_0xd474('0x26')](handleEntityNotFound(_0x36ee57,null))[_0xd474('0x26')](respondWithResult(_0x36ee57,null))[_0xd474('0x4e')](handleError(_0x36ee57,null));};exports['destroy']=function(_0x3b09c0,_0x3bef16){return db[_0xd474('0x44')][_0xd474('0x4d')]({'where':{'id':_0x3b09c0[_0xd474('0x4a')]['id']}})[_0xd474('0x26')](handleEntityNotFound(_0x3bef16,null))[_0xd474('0x26')](removeEntity(_0x3bef16,null))[_0xd474('0x4e')](handleError(_0x3bef16,null));};exports[_0xd474('0x4f')]=function(_0x57d135,_0x1bcc51){return db['VoicePrefix'][_0xd474('0x4f')]()['then'](respondWithResult(_0x1bcc51,null))['catch'](handleError(_0x1bcc51,null));};exports[_0xd474('0x50')]=function(_0x2c7de1,_0x4b6ed2){var _0x28e9ee;return db[_0xd474('0x51')][_0xd474('0x52')](function(_0x5a8c0a){return db[_0xd474('0x44')][_0xd474('0x50')](_0x2c7de1['body'],{'transaction':_0x5a8c0a})['then'](function(_0xbd3c88){_0x28e9ee=_0xbd3c88[_0xd474('0x28')]({'plain':!![]});return db[_0xd474('0x53')][_0xd474('0x4d')]({'where':{'id':_0x28e9ee[_0xd474('0x54')]},'raw':!![]})[_0xd474('0x26')](function(_0x14cf3f){return createVoicePrefixExtensions(_0x28e9ee,_0x14cf3f,_0x5a8c0a);});});})['then'](function(){var _0x20efaa=_0x2c7de1[_0xd474('0x55')]['get']({'plain':!![]});if(!_0x20efaa)throw new Error(_0xd474('0x56'));if(_0x20efaa[_0xd474('0x57')]===_0xd474('0x55')){var _0x5df60a=_0x28e9ee;return db[_0xd474('0x58')][_0xd474('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0x20efaa[_0xd474('0x59')]},'raw':!![]})[_0xd474('0x26')](function(_0x52106f){if(_0x52106f&&_0x52106f['autoAssociation']===0x0){return db[_0xd474('0x2a')]['create']({'name':_0x5df60a[_0xd474('0x2e')],'resourceId':_0x5df60a['id'],'type':_0x52106f['name'],'sectionId':_0x52106f['id']},{})[_0xd474('0x26')](function(){return _0x28e9ee;});}else{return _0x28e9ee;}})[_0xd474('0x4e')](function(_0x5893db){logger[_0xd474('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5893db);throw _0x5893db;});}return _0x28e9ee;})['then'](respondWithResult(_0x4b6ed2,null))[_0xd474('0x4e')](handleError(_0x4b6ed2,null));};function Extension(_0x7562b0,_0x3860e5,_0x233ea0,_0x54341b){this[_0xd474('0x5a')]=_0xd474('0x5b');this['exten']=_0x7562b0;this[_0xd474('0x5c')]=_0x233ea0;this['type']='system';this[_0xd474('0x5d')]=_0xd474('0x5e');this[_0xd474('0x5f')]=_0x3860e5;this['appdata']=_0x54341b;}function createVoicePrefixExtensions(_0x56e948,_0x247dba,_0x4b9b8b){return new BPromise(function(_0x1fe351,_0x35f00c){var _0xf4b399=new Extension(formatPrefixName(_0x56e948[_0xd474('0x60')]),0x1,'NoOp',_0xd474('0x61'));_0xf4b399[_0xd474('0x62')]=_0x56e948['id'];return db[_0xd474('0x53')][_0xd474('0x50')](_0xf4b399,{'transaction':_0x4b9b8b})['then'](function(_0x22e308){var _0x591046=_0x22e308['get']({'plain':!![]});var _0x3d55a5=_[_0xd474('0x31')](addVoicePrefixExtensions(_0x56e948,_0x247dba),function(_0x671aa2){_0x671aa2['VoiceExtensionId']=_0x591046['id'];_0x671aa2[_0xd474('0x62')]=_0x56e948['id'];return _0x671aa2;});return db['VoiceExtension'][_0xd474('0x63')](_0x3d55a5,{'transaction':_0x4b9b8b})[_0xd474('0x26')](function(_0x137358){if(!_0x137358){return _0x35f00c(_0xd474('0x64'));}else{return _0x1fe351(_0x137358);}})[_0xd474('0x4e')](function(_0x2c878d){return _0x35f00c(_0x2c878d);});});;});};function addVoicePrefixExtensions(_0x43b992,_0x545514){var _0x17dd63=[];var _0x3d4bc5=formatPrefixName(_0x43b992[_0xd474('0x60')]);_0x17dd63['push'](new Extension(_0x3d4bc5,0x2,_0xd474('0x65'),'CDR(prefix)='+_0x43b992['name']));if(_0x43b992[_0xd474('0x66')]){_0x17dd63['push'](new Extension(_0x3d4bc5,0x3,_0xd474('0x65'),_0xd474('0x67')+_0x43b992['callerIdAll']));}else{_0x17dd63[_0xd474('0x68')](new Extension(_0x3d4bc5,0x3,_0xd474('0x69'),_0xd474('0x6a')));}_0x17dd63[_0xd474('0x68')](new Extension(_0x3d4bc5,0x4,_0xd474('0x6b'),_0x545514[_0xd474('0x5a')]+','+_0xd474('0x6c')+(0x8+_0x43b992[_0xd474('0x2e')]['length'])+'}'+','+0x1));return _0x17dd63;}function formatPrefixName(_0x3feb34){var _0x12897d='_';for(var _0x322d3e=0x0;_0x322d3e<_0x3feb34[_0xd474('0x4c')];_0x322d3e++){if(_0x3feb34[_0xd474('0x6d')](_0x322d3e)=='-'){_0x12897d+=_0x3feb34[_0xd474('0x6d')](_0x322d3e);}else{_0x12897d+='['+_0x3feb34[_0xd474('0x6d')](_0x322d3e)+']';}}_0x12897d+='.';return _0x12897d;}exports[_0xd474('0x25')]=function(_0x1c7c52,_0x3dc970,_0x4a8012){var _0xfc4c4c=_0x1c7c52[_0xd474('0x6e')];_0xfc4c4c['prefix']=_0xd474('0x6f')+_0xfc4c4c[_0xd474('0x2e')]+'-';return db[_0xd474('0x51')][_0xd474('0x52')](function(_0x285eea){return db[_0xd474('0x44')]['update'](_0xfc4c4c,{'where':{'id':_0xfc4c4c['id']},'transaction':_0x285eea})[_0xd474('0x26')](function(){return db[_0xd474('0x53')][_0xd474('0x27')]({'where':{'VoicePrefixId':_0xfc4c4c['id']},'transaction':_0x285eea})[_0xd474('0x26')](function(){return db[_0xd474('0x53')][_0xd474('0x4d')]({'where':{'id':_0xfc4c4c['VoiceExtensionId']},'raw':!![]})['then'](function(_0x2eefae){return createVoicePrefixExtensions(_0xfc4c4c,_0x2eefae,_0x285eea);});});});})[_0xd474('0x26')](function(){return db[_0xd474('0x44')][_0xd474('0x70')](_0xfc4c4c['id']);})['then'](respondWithResult(_0x3dc970,null))[_0xd474('0x4e')](handleError(_0x3dc970,null));};exports['addAgents']=function(_0x133714,_0x2c6d2f,_0x38bc83){return db[_0xd474('0x44')][_0xd474('0x4d')]({'where':{'id':_0x133714[_0xd474('0x4a')]['id']}})[_0xd474('0x26')](handleEntityNotFound(_0x2c6d2f,null))[_0xd474('0x26')](function(_0x4ed210){if(_0x4ed210){return _0x4ed210[_0xd474('0x71')](_0x133714[_0xd474('0x6e')][_0xd474('0x72')],_[_0xd474('0x73')](_0x133714['body'],['ids','id'])||{})[_0xd474('0x74')](function(_0x261255){for(var _0x449f7d=0x0;_0x449f7d<_0x133714['body']['ids'][_0xd474('0x4c')];_0x449f7d+=0x1){socket[_0xd474('0x75')](_0xd474('0x76'),{'UserId':_0x133714[_0xd474('0x6e')][_0xd474('0x72')][_0x449f7d],'VoicePrefixId':_0x133714[_0xd474('0x4a')]['id']});}return _0x261255;});}})['then'](respondWithResult(_0x2c6d2f,null))[_0xd474('0x4e')](handleError(_0x2c6d2f,null));};exports[_0xd474('0x77')]=function(_0x5b33f0,_0x3c813e,_0x42bf33){return db['VoicePrefix']['find']({'where':{'id':_0x5b33f0[_0xd474('0x4a')]['id']}})[_0xd474('0x26')](handleEntityNotFound(_0x3c813e,null))['then'](function(_0x5341e7){if(_0x5341e7){return _0x5341e7[_0xd474('0x77')](_0x5b33f0[_0xd474('0x36')]['ids'])[_0xd474('0x26')](function(){if(_['isArray'](_0x5b33f0[_0xd474('0x36')]['ids'])){for(var _0x41474a=0x0;_0x41474a<_0x5b33f0[_0xd474('0x36')][_0xd474('0x72')][_0xd474('0x4c')];_0x41474a+=0x1){socket['emit'](_0xd474('0x78'),{'UserId':Number(_0x5b33f0['query'][_0xd474('0x72')][_0x41474a]),'VoicePrefixId':Number(_0x5b33f0[_0xd474('0x4a')]['id'])});}}else{socket[_0xd474('0x75')](_0xd474('0x78'),{'UserId':Number(_0x5b33f0['query'][_0xd474('0x72')]),'VoicePrefixId':Number(_0x5b33f0[_0xd474('0x4a')]['id'])});}});}})[_0xd474('0x26')](respondWithStatusCode(_0x3c813e,null))['catch'](handleError(_0x3c813e,null));};exports[_0xd474('0x79')]=function(_0x245860,_0xc8e2c5,_0x11284e){var _0x4373ac={};var _0x22f707={};var _0x187700;var _0x101048;return db['VoicePrefix'][_0xd474('0x7a')]({'where':{'id':_0x245860[_0xd474('0x4a')]['id']}})['then'](handleEntityNotFound(_0xc8e2c5,null))[_0xd474('0x26')](function(_0x5278c3){if(_0x5278c3){_0x187700=_0x5278c3;_0x22f707[_0xd474('0x35')]=_[_0xd474('0x4b')](db[_0xd474('0x7b')][_0xd474('0x32')]);_0x22f707['query']=_[_0xd474('0x4b')](_0x245860[_0xd474('0x36')]);_0x22f707['filters']=_[_0xd474('0x37')](_0x22f707[_0xd474('0x35')],_0x22f707[_0xd474('0x36')]);_0x4373ac['attributes']=_['intersection'](_0x22f707[_0xd474('0x35')],qs[_0xd474('0x38')](_0x245860[_0xd474('0x36')][_0xd474('0x38')]));_0x4373ac['attributes']=_0x4373ac[_0xd474('0x39')]['length']?_0x4373ac['attributes']:_0x22f707[_0xd474('0x35')];_0x4373ac[_0xd474('0x3b')]=qs[_0xd474('0x3c')](_0x245860['query'][_0xd474('0x3c')]);_0x4373ac['where']=qs[_0xd474('0x3e')](_[_0xd474('0x3f')](_0x245860['query'],_0x22f707[_0xd474('0x3e')]));if(_0x245860[_0xd474('0x36')][_0xd474('0x40')]){_0x4373ac['where']=_[_0xd474('0x41')](_0x4373ac[_0xd474('0x3d')],{'$or':_[_0xd474('0x31')](_0x4373ac[_0xd474('0x39')],function(_0x402b0e){var _0x55bc30={};_0x55bc30[_0x402b0e]={'$like':'%'+_0x245860[_0xd474('0x36')][_0xd474('0x40')]+'%'};return _0x55bc30;})});}_0x4373ac=_[_0xd474('0x41')]({},_0x4373ac,_0x245860[_0xd474('0x43')]);return _0x187700[_0xd474('0x79')](_0x4373ac);}})[_0xd474('0x26')](function(_0x2754cf){if(_0x2754cf){_0x101048=_0x2754cf[_0xd474('0x4c')];if(!_0x245860[_0xd474('0x36')]['hasOwnProperty'](_0xd474('0x7c'))){_0x4373ac['limit']=qs[_0xd474('0x20')](_0x245860['query'][_0xd474('0x20')]);_0x4373ac[_0xd474('0x1f')]=qs[_0xd474('0x1f')](_0x245860['query'][_0xd474('0x1f')]);}return _0x187700['getAgents'](_0x4373ac);}})[_0xd474('0x26')](function(_0x4d6746){if(_0x4d6746){return _0x4d6746?{'count':_0x101048,'rows':_0x4d6746}:null;}})['then'](respondWithResult(_0xc8e2c5,null))[_0xd474('0x4e')](handleError(_0xc8e2c5,null));}; \ No newline at end of file +var _0xc4d1=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','VoicePrefixes','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','find','catch','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','app','system','description','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','prefix','push','Set','PREFIX-CALLERIDALL=','callerIdAll','goto','charAt','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','nolimit','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x3c09da,_0xc3f6dc){var _0x592b3c=function(_0x528321){while(--_0x528321){_0x3c09da['push'](_0x3c09da['shift']());}};_0x592b3c(++_0xc3f6dc);}(_0xc4d1,0xdf));var _0x1c4d=function(_0x40b66c,_0x578758){_0x40b66c=_0x40b66c-0x0;var _0x2fd22b=_0xc4d1[_0x40b66c];return _0x2fd22b;};'use strict';var pdf=require(_0x1c4d('0x0'));var emlformat=require(_0x1c4d('0x1'));var rimraf=require(_0x1c4d('0x2'));var zipdir=require(_0x1c4d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c4d('0x4'));var moment=require(_0x1c4d('0x5'));var BPromise=require(_0x1c4d('0x6'));var Mustache=require(_0x1c4d('0x7'));var util=require('util');var path=require(_0x1c4d('0x8'));var sox=require(_0x1c4d('0x9'));var csv=require(_0x1c4d('0xa'));var ejs=require(_0x1c4d('0xb'));var fs=require('fs');var _=require(_0x1c4d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1c4d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1c4d('0xa'));var querystring=require(_0x1c4d('0xe'));var Papa=require(_0x1c4d('0xf'));var Redis=require(_0x1c4d('0x10'));var authService=require(_0x1c4d('0x11'));var qs=require(_0x1c4d('0x12'));var as=require(_0x1c4d('0x13'));var hardwareService=require(_0x1c4d('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x1c4d('0x15'));var db=require(_0x1c4d('0x16'))['db'];config[_0x1c4d('0x17')]=_[_0x1c4d('0x18')](config[_0x1c4d('0x17')],{'host':_0x1c4d('0x19'),'port':0x18eb});var socket=require(_0x1c4d('0x1a'))(new Redis(config[_0x1c4d('0x17')]));require('./voicePrefix.socket')[_0x1c4d('0x1b')](socket);function respondWithStatusCode(_0x361888,_0x5af68b){_0x5af68b=_0x5af68b||0xcc;return function(_0x25a31c){if(_0x25a31c){return _0x361888[_0x1c4d('0x1c')](_0x5af68b);}return _0x361888[_0x1c4d('0x1d')](_0x5af68b)[_0x1c4d('0x1e')]();};}function respondWithResult(_0x45e066,_0x10cc7c){_0x10cc7c=_0x10cc7c||0xc8;return function(_0x33d674){if(_0x33d674){return _0x45e066[_0x1c4d('0x1d')](_0x10cc7c)[_0x1c4d('0x1f')](_0x33d674);}};}function respondWithFilteredResult(_0x1f85a1,_0x56620f){return function(_0x4e3686){if(_0x4e3686){var _0x157c14=_0x4e3686[_0x1c4d('0x20')],_0x15a491=_0x56620f[_0x1c4d('0x21')],_0x1244f4=_0x56620f['offset']+_0x56620f[_0x1c4d('0x22')],_0x1608e3;if(_0x1244f4>=_0x157c14){_0x1244f4=_0x157c14;_0x1608e3=0xc8;}else{_0x1608e3=0xce;}_0x1f85a1[_0x1c4d('0x1d')](_0x1608e3);return _0x1f85a1[_0x1c4d('0x23')](_0x1c4d('0x24'),_0x15a491+'-'+_0x1244f4+'/'+_0x157c14)[_0x1c4d('0x1f')](_0x4e3686);}return null;};}function patchUpdates(_0x117d31){return function(_0xd47b94){try{jsonpatch[_0x1c4d('0x25')](_0xd47b94,_0x117d31,!![]);}catch(_0xace787){return BPromise[_0x1c4d('0x26')](_0xace787);}return _0xd47b94[_0x1c4d('0x27')]();};}function saveUpdates(_0x832c9f,_0x1b3702){return function(_0x1c3220){if(_0x1c3220){return _0x1c3220[_0x1c4d('0x28')](_0x832c9f)[_0x1c4d('0x29')](function(_0x587d34){return _0x587d34;});}return null;};}function removeEntity(_0x111d05,_0x38900d){return function(_0x11dc06){if(_0x11dc06){return _0x11dc06[_0x1c4d('0x2a')]()['then'](function(){var _0x546054=_0x11dc06[_0x1c4d('0x2b')]({'plain':!![]});var _0x19af15=_0x1c4d('0x2c');return db['UserProfileResource'][_0x1c4d('0x2a')]({'where':{'type':_0x19af15,'resourceId':_0x546054['id']}})[_0x1c4d('0x29')](function(){return _0x11dc06;});})['then'](function(){_0x111d05[_0x1c4d('0x1d')](0xcc)[_0x1c4d('0x1e')]();});}};}function handleEntityNotFound(_0xe95a5e,_0x521593){return function(_0x1e368b){if(!_0x1e368b){_0xe95a5e['sendStatus'](0x194);}return _0x1e368b;};}function handleError(_0x73bf99,_0x472792){_0x472792=_0x472792||0x1f4;return function(_0x2adba3){logger['error'](_0x2adba3[_0x1c4d('0x2d')]);if(_0x2adba3[_0x1c4d('0x2e')]){delete _0x2adba3[_0x1c4d('0x2e')];}_0x73bf99['status'](_0x472792)[_0x1c4d('0x2f')](_0x2adba3);};}exports['index']=function(_0x1b638d,_0x1ff608){var _0x80bcbb={},_0xa210b9={},_0x399676={'count':0x0,'rows':[]};var _0x17cb9c=_[_0x1c4d('0x30')](db[_0x1c4d('0x31')][_0x1c4d('0x32')],function(_0x2d9c10){return{'name':_0x2d9c10[_0x1c4d('0x33')],'type':_0x2d9c10[_0x1c4d('0x34')][_0x1c4d('0x35')]};});_0xa210b9[_0x1c4d('0x36')]=_[_0x1c4d('0x30')](_0x17cb9c,'name');_0xa210b9[_0x1c4d('0x37')]=_['keys'](_0x1b638d[_0x1c4d('0x37')]);_0xa210b9[_0x1c4d('0x38')]=_[_0x1c4d('0x39')](_0xa210b9[_0x1c4d('0x36')],_0xa210b9[_0x1c4d('0x37')]);_0x80bcbb[_0x1c4d('0x3a')]=_['intersection'](_0xa210b9['model'],qs[_0x1c4d('0x3b')](_0x1b638d['query'][_0x1c4d('0x3b')]));_0x80bcbb[_0x1c4d('0x3a')]=_0x80bcbb['attributes'][_0x1c4d('0x3c')]?_0x80bcbb['attributes']:_0xa210b9[_0x1c4d('0x36')];if(!_0x1b638d['query']['hasOwnProperty']('nolimit')){_0x80bcbb[_0x1c4d('0x22')]=qs[_0x1c4d('0x22')](_0x1b638d[_0x1c4d('0x37')]['limit']);_0x80bcbb[_0x1c4d('0x21')]=qs[_0x1c4d('0x21')](_0x1b638d[_0x1c4d('0x37')][_0x1c4d('0x21')]);}_0x80bcbb[_0x1c4d('0x3d')]=qs[_0x1c4d('0x3e')](_0x1b638d['query']['sort']);_0x80bcbb[_0x1c4d('0x3f')]=qs['filters'](_[_0x1c4d('0x40')](_0x1b638d[_0x1c4d('0x37')],_0xa210b9[_0x1c4d('0x38')]),_0x17cb9c);if(_0x1b638d[_0x1c4d('0x37')][_0x1c4d('0x41')]){_0x80bcbb['where']=_[_0x1c4d('0x42')](_0x80bcbb[_0x1c4d('0x3f')],{'$or':_[_0x1c4d('0x30')](_0x17cb9c,function(_0x4a47e3){if(_0x4a47e3['type']!==_0x1c4d('0x43')){var _0xd522cf={};_0xd522cf[_0x4a47e3[_0x1c4d('0x2e')]]={'$like':'%'+_0x1b638d[_0x1c4d('0x37')][_0x1c4d('0x41')]+'%'};return _0xd522cf;}})});}_0x80bcbb=_[_0x1c4d('0x42')]({},_0x80bcbb,_0x1b638d[_0x1c4d('0x44')]);var _0x5dcab7={'where':_0x80bcbb[_0x1c4d('0x3f')]};return db[_0x1c4d('0x31')][_0x1c4d('0x20')](_0x5dcab7)[_0x1c4d('0x29')](function(_0x3f61be){_0x399676[_0x1c4d('0x20')]=_0x3f61be;if(_0x1b638d[_0x1c4d('0x37')][_0x1c4d('0x45')]){_0x80bcbb[_0x1c4d('0x46')]=[{'all':!![]}];}return db[_0x1c4d('0x31')][_0x1c4d('0x47')](_0x80bcbb);})[_0x1c4d('0x29')](function(_0x23d04e){_0x399676[_0x1c4d('0x48')]=_0x23d04e;return _0x399676;})[_0x1c4d('0x29')](respondWithFilteredResult(_0x1ff608,_0x80bcbb))['catch'](handleError(_0x1ff608,null));};exports['show']=function(_0x329a8d,_0x52ce99){var _0x2fbe8e={'raw':![],'where':{'id':_0x329a8d[_0x1c4d('0x49')]['id']}},_0x33be8e={};_0x33be8e[_0x1c4d('0x36')]=_[_0x1c4d('0x4a')](db[_0x1c4d('0x31')][_0x1c4d('0x32')]);_0x33be8e[_0x1c4d('0x37')]=_[_0x1c4d('0x4a')](_0x329a8d[_0x1c4d('0x37')]);_0x33be8e[_0x1c4d('0x38')]=_[_0x1c4d('0x39')](_0x33be8e[_0x1c4d('0x36')],_0x33be8e['query']);_0x2fbe8e[_0x1c4d('0x3a')]=_[_0x1c4d('0x39')](_0x33be8e[_0x1c4d('0x36')],qs['fields'](_0x329a8d[_0x1c4d('0x37')][_0x1c4d('0x3b')]));_0x2fbe8e[_0x1c4d('0x3a')]=_0x2fbe8e[_0x1c4d('0x3a')]['length']?_0x2fbe8e[_0x1c4d('0x3a')]:_0x33be8e[_0x1c4d('0x36')];if(_0x329a8d[_0x1c4d('0x37')]['includeAll']){_0x2fbe8e['include']=[{'all':!![]}];}_0x2fbe8e=_[_0x1c4d('0x42')]({},_0x2fbe8e,_0x329a8d[_0x1c4d('0x44')]);return db['VoicePrefix'][_0x1c4d('0x4b')](_0x2fbe8e)['then'](handleEntityNotFound(_0x52ce99,null))['then'](respondWithResult(_0x52ce99,null))['catch'](handleError(_0x52ce99,null));};exports[_0x1c4d('0x2a')]=function(_0xb7b6ea,_0x27fb5a){return db[_0x1c4d('0x31')]['find']({'where':{'id':_0xb7b6ea[_0x1c4d('0x49')]['id']}})[_0x1c4d('0x29')](handleEntityNotFound(_0x27fb5a,null))[_0x1c4d('0x29')](removeEntity(_0x27fb5a,null))[_0x1c4d('0x4c')](handleError(_0x27fb5a,null));};exports[_0x1c4d('0x4d')]=function(_0x41cf60,_0x4a2d5f){return db[_0x1c4d('0x31')][_0x1c4d('0x4d')]()[_0x1c4d('0x29')](respondWithResult(_0x4a2d5f,null))[_0x1c4d('0x4c')](handleError(_0x4a2d5f,null));};exports[_0x1c4d('0x4e')]=function(_0x17f12f,_0x126fd5){var _0x886192;return db['sequelize'][_0x1c4d('0x4f')](function(_0x2413c7){return db[_0x1c4d('0x31')][_0x1c4d('0x4e')](_0x17f12f[_0x1c4d('0x50')],{'transaction':_0x2413c7})[_0x1c4d('0x29')](function(_0x1f6ff6){_0x886192=_0x1f6ff6[_0x1c4d('0x2b')]({'plain':!![]});return db[_0x1c4d('0x51')][_0x1c4d('0x4b')]({'where':{'id':_0x886192[_0x1c4d('0x52')]},'raw':!![]})[_0x1c4d('0x29')](function(_0x41fcdd){return createVoicePrefixExtensions(_0x886192,_0x41fcdd,_0x2413c7);});});})[_0x1c4d('0x29')](function(){var _0x50f15f=_0x17f12f['user'][_0x1c4d('0x2b')]({'plain':!![]});if(!_0x50f15f)throw new Error(_0x1c4d('0x53'));if(_0x50f15f[_0x1c4d('0x54')]===_0x1c4d('0x55')){var _0x3c560c=_0x886192;return db[_0x1c4d('0x56')][_0x1c4d('0x4b')]({'where':{'name':_0x1c4d('0x2c'),'userProfileId':_0x50f15f[_0x1c4d('0x57')]},'raw':!![]})[_0x1c4d('0x29')](function(_0x826fcd){if(_0x826fcd&&_0x826fcd[_0x1c4d('0x58')]===0x0){return db['UserProfileResource'][_0x1c4d('0x4e')]({'name':_0x3c560c[_0x1c4d('0x2e')],'resourceId':_0x3c560c['id'],'type':_0x826fcd[_0x1c4d('0x2e')],'sectionId':_0x826fcd['id']},{})[_0x1c4d('0x29')](function(){return _0x886192;});}else{return _0x886192;}})[_0x1c4d('0x4c')](function(_0xa5c080){logger[_0x1c4d('0x59')](_0x1c4d('0x5a'),_0xa5c080);throw _0xa5c080;});}return _0x886192;})[_0x1c4d('0x29')](respondWithResult(_0x126fd5,null))['catch'](handleError(_0x126fd5,null));};function Extension(_0x288c83,_0x4e47c2,_0x1beb06,_0x3479af){this[_0x1c4d('0x5b')]='from-sip';this[_0x1c4d('0x5c')]=_0x288c83;this[_0x1c4d('0x5d')]=_0x1beb06;this[_0x1c4d('0x34')]=_0x1c4d('0x5e');this[_0x1c4d('0x5f')]='Voice\x20Prefix\x20Extension';this['priority']=_0x4e47c2;this[_0x1c4d('0x60')]=_0x3479af;}function createVoicePrefixExtensions(_0x52138c,_0x5086b3,_0x2ae948){return new BPromise(function(_0x187ced,_0x316d2d){var _0x25e3d5=new Extension(formatPrefixName(_0x52138c['prefix']),0x1,_0x1c4d('0x61'),_0x1c4d('0x62'));_0x25e3d5[_0x1c4d('0x63')]=_0x52138c['id'];return db['VoiceExtension'][_0x1c4d('0x4e')](_0x25e3d5,{'transaction':_0x2ae948})[_0x1c4d('0x29')](function(_0x40faf0){var _0x1ace1a=_0x40faf0[_0x1c4d('0x2b')]({'plain':!![]});var _0x23b58f=_[_0x1c4d('0x30')](addVoicePrefixExtensions(_0x52138c,_0x5086b3),function(_0x4d62c0){_0x4d62c0[_0x1c4d('0x52')]=_0x1ace1a['id'];_0x4d62c0['VoicePrefixId']=_0x52138c['id'];return _0x4d62c0;});return db[_0x1c4d('0x51')]['bulkCreate'](_0x23b58f,{'transaction':_0x2ae948})[_0x1c4d('0x29')](function(_0x55b582){if(!_0x55b582){return _0x316d2d(_0x1c4d('0x64'));}else{return _0x187ced(_0x55b582);}})['catch'](function(_0x4085c5){return _0x316d2d(_0x4085c5);});});;});};function addVoicePrefixExtensions(_0x1c75a4,_0x52eaa5){var _0x4743d4=[];var _0x13b0d7=formatPrefixName(_0x1c75a4[_0x1c4d('0x65')]);_0x4743d4['push'](new Extension(_0x13b0d7,0x2,'Set','CDR(prefix)='+_0x1c75a4['name']));if(_0x1c75a4['callerIdAll']){_0x4743d4[_0x1c4d('0x66')](new Extension(_0x13b0d7,0x3,_0x1c4d('0x67'),_0x1c4d('0x68')+_0x1c75a4[_0x1c4d('0x69')]));}else{_0x4743d4[_0x1c4d('0x66')](new Extension(_0x13b0d7,0x3,_0x1c4d('0x61'),'No\x20callerid\x20available'));}_0x4743d4[_0x1c4d('0x66')](new Extension(_0x13b0d7,0x4,_0x1c4d('0x6a'),_0x52eaa5[_0x1c4d('0x5b')]+','+'${EXTEN:'+(0x8+_0x1c75a4[_0x1c4d('0x2e')]['length'])+'}'+','+0x1));return _0x4743d4;}function formatPrefixName(_0xa008ae){var _0xdfb314='_';for(var _0x5960fe=0x0;_0x5960fe<_0xa008ae['length'];_0x5960fe++){if(_0xa008ae[_0x1c4d('0x6b')](_0x5960fe)=='-'){_0xdfb314+=_0xa008ae[_0x1c4d('0x6b')](_0x5960fe);}else{_0xdfb314+='['+_0xa008ae['charAt'](_0x5960fe)+']';}}_0xdfb314+='.';return _0xdfb314;}exports[_0x1c4d('0x28')]=function(_0x19ad08,_0x41cb7a,_0x5290c9){var _0x1dc79f=_0x19ad08[_0x1c4d('0x50')];_0x1dc79f[_0x1c4d('0x65')]='system-'+_0x1dc79f[_0x1c4d('0x2e')]+'-';return db['sequelize'][_0x1c4d('0x4f')](function(_0x1ae055){return db[_0x1c4d('0x31')][_0x1c4d('0x28')](_0x1dc79f,{'where':{'id':_0x1dc79f['id']},'transaction':_0x1ae055})[_0x1c4d('0x29')](function(){return db['VoiceExtension'][_0x1c4d('0x2a')]({'where':{'VoicePrefixId':_0x1dc79f['id']},'transaction':_0x1ae055})[_0x1c4d('0x29')](function(){return db['VoiceExtension'][_0x1c4d('0x4b')]({'where':{'id':_0x1dc79f[_0x1c4d('0x52')]},'raw':!![]})[_0x1c4d('0x29')](function(_0x2cbd54){return createVoicePrefixExtensions(_0x1dc79f,_0x2cbd54,_0x1ae055);});});});})[_0x1c4d('0x29')](function(){return db[_0x1c4d('0x31')][_0x1c4d('0x6c')](_0x1dc79f['id']);})['then'](respondWithResult(_0x41cb7a,null))['catch'](handleError(_0x41cb7a,null));};exports[_0x1c4d('0x6d')]=function(_0x30a204,_0x2bea50,_0x5564ac){return db['VoicePrefix'][_0x1c4d('0x4b')]({'where':{'id':_0x30a204[_0x1c4d('0x49')]['id']}})[_0x1c4d('0x29')](handleEntityNotFound(_0x2bea50,null))[_0x1c4d('0x29')](function(_0x52309c){if(_0x52309c){return _0x52309c[_0x1c4d('0x6d')](_0x30a204[_0x1c4d('0x50')][_0x1c4d('0x6e')],_[_0x1c4d('0x6f')](_0x30a204[_0x1c4d('0x50')],[_0x1c4d('0x6e'),'id'])||{})[_0x1c4d('0x70')](function(_0x210431){for(var _0x199a63=0x0;_0x199a63<_0x30a204[_0x1c4d('0x50')][_0x1c4d('0x6e')][_0x1c4d('0x3c')];_0x199a63+=0x1){socket['emit'](_0x1c4d('0x71'),{'UserId':_0x30a204[_0x1c4d('0x50')][_0x1c4d('0x6e')][_0x199a63],'VoicePrefixId':_0x30a204['params']['id']});}return _0x210431;});}})[_0x1c4d('0x29')](respondWithResult(_0x2bea50,null))[_0x1c4d('0x4c')](handleError(_0x2bea50,null));};exports[_0x1c4d('0x72')]=function(_0x4461b5,_0x4078a7,_0x3d59bf){return db[_0x1c4d('0x31')][_0x1c4d('0x4b')]({'where':{'id':_0x4461b5[_0x1c4d('0x49')]['id']}})[_0x1c4d('0x29')](handleEntityNotFound(_0x4078a7,null))[_0x1c4d('0x29')](function(_0x326d86){if(_0x326d86){return _0x326d86['removeAgents'](_0x4461b5[_0x1c4d('0x37')][_0x1c4d('0x6e')])[_0x1c4d('0x29')](function(){if(_[_0x1c4d('0x73')](_0x4461b5[_0x1c4d('0x37')][_0x1c4d('0x6e')])){for(var _0x6c5926=0x0;_0x6c5926<_0x4461b5['query'][_0x1c4d('0x6e')]['length'];_0x6c5926+=0x1){socket[_0x1c4d('0x74')](_0x1c4d('0x75'),{'UserId':Number(_0x4461b5[_0x1c4d('0x37')][_0x1c4d('0x6e')][_0x6c5926]),'VoicePrefixId':Number(_0x4461b5['params']['id'])});}}else{socket[_0x1c4d('0x74')](_0x1c4d('0x75'),{'UserId':Number(_0x4461b5[_0x1c4d('0x37')][_0x1c4d('0x6e')]),'VoicePrefixId':Number(_0x4461b5[_0x1c4d('0x49')]['id'])});}});}})[_0x1c4d('0x29')](respondWithStatusCode(_0x4078a7,null))[_0x1c4d('0x4c')](handleError(_0x4078a7,null));};exports[_0x1c4d('0x76')]=function(_0x3655ea,_0x3e6539,_0x46934e){var _0x141a94={};var _0x803fa8={};var _0x30b557;var _0x48529c;return db['VoicePrefix'][_0x1c4d('0x77')]({'where':{'id':_0x3655ea['params']['id']}})['then'](handleEntityNotFound(_0x3e6539,null))[_0x1c4d('0x29')](function(_0x7a0753){if(_0x7a0753){_0x30b557=_0x7a0753;_0x803fa8[_0x1c4d('0x36')]=_[_0x1c4d('0x4a')](db[_0x1c4d('0x78')]['rawAttributes']);_0x803fa8[_0x1c4d('0x37')]=_[_0x1c4d('0x4a')](_0x3655ea[_0x1c4d('0x37')]);_0x803fa8['filters']=_[_0x1c4d('0x39')](_0x803fa8[_0x1c4d('0x36')],_0x803fa8[_0x1c4d('0x37')]);_0x141a94[_0x1c4d('0x3a')]=_['intersection'](_0x803fa8['model'],qs['fields'](_0x3655ea[_0x1c4d('0x37')][_0x1c4d('0x3b')]));_0x141a94[_0x1c4d('0x3a')]=_0x141a94[_0x1c4d('0x3a')][_0x1c4d('0x3c')]?_0x141a94[_0x1c4d('0x3a')]:_0x803fa8['model'];_0x141a94[_0x1c4d('0x3d')]=qs[_0x1c4d('0x3e')](_0x3655ea['query']['sort']);_0x141a94[_0x1c4d('0x3f')]=qs['filters'](_[_0x1c4d('0x40')](_0x3655ea[_0x1c4d('0x37')],_0x803fa8[_0x1c4d('0x38')]));if(_0x3655ea[_0x1c4d('0x37')][_0x1c4d('0x41')]){_0x141a94[_0x1c4d('0x3f')]=_[_0x1c4d('0x42')](_0x141a94[_0x1c4d('0x3f')],{'$or':_[_0x1c4d('0x30')](_0x141a94[_0x1c4d('0x3a')],function(_0x5b180d){var _0xcc8b0={};_0xcc8b0[_0x5b180d]={'$like':'%'+_0x3655ea['query'][_0x1c4d('0x41')]+'%'};return _0xcc8b0;})});}_0x141a94=_[_0x1c4d('0x42')]({},_0x141a94,_0x3655ea[_0x1c4d('0x44')]);return _0x30b557[_0x1c4d('0x76')](_0x141a94);}})[_0x1c4d('0x29')](function(_0x444f86){if(_0x444f86){_0x48529c=_0x444f86[_0x1c4d('0x3c')];if(!_0x3655ea[_0x1c4d('0x37')]['hasOwnProperty'](_0x1c4d('0x79'))){_0x141a94[_0x1c4d('0x22')]=qs[_0x1c4d('0x22')](_0x3655ea[_0x1c4d('0x37')][_0x1c4d('0x22')]);_0x141a94['offset']=qs[_0x1c4d('0x21')](_0x3655ea[_0x1c4d('0x37')]['offset']);}return _0x30b557['getAgents'](_0x141a94);}})[_0x1c4d('0x29')](function(_0x1382ea){if(_0x1382ea){return _0x1382ea?{'count':_0x48529c,'rows':_0x1382ea}:null;}})[_0x1c4d('0x29')](respondWithResult(_0x3e6539,null))['catch'](handleError(_0x3e6539,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 4431999..cfc664f 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 _0xedd9=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xedd9,0xfc));var _0x9edd=function(_0x4607b2,_0x3d72e4){_0x4607b2=_0x4607b2-0x0;var _0x179c76=_0xedd9[_0x4607b2];return _0x179c76;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xcb91=['save','update','emit','hasOwnProperty','hook','VoicePrefix','setMaxListeners'];(function(_0x4ac085,_0x15e331){var _0x7bfc6e=function(_0x38f222){while(--_0x38f222){_0x4ac085['push'](_0x4ac085['shift']());}};_0x7bfc6e(++_0x15e331);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0xcb91[_0x421196];return _0x2738af;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x1cb9('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){VoicePrefixEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);VoicePrefixEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];VoicePrefix[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index f6829ad..4eedeb2 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 _0xafac=['../../config/logger','api','moment','bluebird','request-promise','path','./voicePrefix.attributes','exports','define','VoicePrefix','lodash'];(function(_0x11cb5d,_0x4b9521){var _0x3a29f9=function(_0x30a27f){while(--_0x30a27f){_0x11cb5d['push'](_0x11cb5d['shift']());}};_0x3a29f9(++_0x4b9521);}(_0xafac,0x1b7));var _0xcafa=function(_0xfaf455,_0x13c0a9){_0xfaf455=_0xfaf455-0x0;var _0x5aaa60=_0xafac[_0xfaf455];return _0x5aaa60;};'use strict';var _=require(_0xcafa('0x0'));var util=require('util');var logger=require(_0xcafa('0x1'))(_0xcafa('0x2'));var moment=require(_0xcafa('0x3'));var BPromise=require(_0xcafa('0x4'));var rp=require(_0xcafa('0x5'));var fs=require('fs');var path=require(_0xcafa('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcafa('0x7'));module[_0xcafa('0x8')]=function(_0x19a7ca,_0x55debe){return _0x19a7ca[_0xcafa('0x9')](_0xcafa('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde6d=['voice_prefixes','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports'];(function(_0x2ddfa0,_0x185f5a){var _0x24c216=function(_0x1c4157){while(--_0x1c4157){_0x2ddfa0['push'](_0x2ddfa0['shift']());}};_0x24c216(++_0x185f5a);}(_0xde6d,0x6f));var _0xdde6=function(_0x3298e4,_0x32191f){_0x3298e4=_0x3298e4-0x0;var _0x336ec1=_0xde6d[_0x3298e4];return _0x336ec1;};'use strict';var _=require('lodash');var util=require(_0xdde6('0x0'));var logger=require(_0xdde6('0x1'))(_0xdde6('0x2'));var moment=require('moment');var BPromise=require(_0xdde6('0x3'));var rp=require(_0xdde6('0x4'));var fs=require('fs');var path=require(_0xdde6('0x5'));var rimraf=require(_0xdde6('0x6'));var config=require(_0xdde6('0x7'));var attributes=require(_0xdde6('0x8'));module[_0xdde6('0x9')]=function(_0x48d6dd,_0x36b652){return _0x48d6dd['define']('VoicePrefix',attributes,{'tableName':_0xdde6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 127070f..2bdc4c2 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 _0x7360=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x54e573,_0x129035){var _0x14d781=function(_0x1eef2b){while(--_0x1eef2b){_0x54e573['push'](_0x54e573['shift']());}};_0x14d781(++_0x129035);}(_0x7360,0x1ce));var _0x0736=function(_0x153a36,_0x4afb56){_0x153a36=_0x153a36-0x0;var _0x549dcf=_0x7360[_0x153a36];return _0x549dcf;};'use strict';var _=require(_0x0736('0x0'));var util=require(_0x0736('0x1'));var moment=require(_0x0736('0x2'));var BPromise=require(_0x0736('0x3'));var rs=require(_0x0736('0x4'));var fs=require('fs');var Redis=require(_0x0736('0x5'));var db=require(_0x0736('0x6'))['db'];var utils=require(_0x0736('0x7'));var logger=require(_0x0736('0x8'))(_0x0736('0x9'));var config=require('../../config/environment');var jayson=require(_0x0736('0xa'));var client=jayson[_0x0736('0xb')][_0x0736('0xc')]({'port':0x232a});config['redis']=_[_0x0736('0xd')](config[_0x0736('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x0736('0xf'))(new Redis(config[_0x0736('0xe')]));require('./voicePrefix.socket')[_0x0736('0x10')](socket);function respondWithRpcPromise(_0x9ab77a,_0x1802ca,_0x1e9ac5){return new BPromise(function(_0x5d9c7a,_0x533817){return client[_0x0736('0x11')](_0x9ab77a,_0x1e9ac5)[_0x0736('0x12')](function(_0xefce24){logger['info'](_0x0736('0x13'),_0x1802ca,_0x0736('0x14'));logger[_0x0736('0x15')](_0x0736('0x16'),_0x1802ca,_0x0736('0x14'),JSON[_0x0736('0x17')](_0xefce24));if(_0xefce24[_0x0736('0x18')]){if(_0xefce24['error'][_0x0736('0x19')]===0x1f4){logger[_0x0736('0x18')](_0x0736('0x13'),_0x1802ca,_0xefce24['error'][_0x0736('0x1a')]);return _0x533817(_0xefce24[_0x0736('0x18')][_0x0736('0x1a')]);}logger[_0x0736('0x18')](_0x0736('0x13'),_0x1802ca,_0xefce24[_0x0736('0x18')][_0x0736('0x1a')]);return _0x5d9c7a(_0xefce24['error'][_0x0736('0x1a')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x1802ca,_0x0736('0x14'));_0x5d9c7a(_0xefce24[_0x0736('0x1b')][_0x0736('0x1a')]);}})[_0x0736('0x1c')](function(_0x4a3754){logger[_0x0736('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x1802ca,_0x4a3754);_0x533817(_0x4a3754);});});} \ No newline at end of file +var _0x7136=['register','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voicePrefix.socket'];(function(_0x14a79d,_0xcdc4b9){var _0x25eead=function(_0xca7339){while(--_0xca7339){_0x14a79d['push'](_0x14a79d['shift']());}};_0x25eead(++_0xcdc4b9);}(_0x7136,0x1c0));var _0x6713=function(_0xf22003,_0x4daaad){_0xf22003=_0xf22003-0x0;var _0x1af727=_0x7136[_0xf22003];return _0x1af727;};'use strict';var _=require(_0x6713('0x0'));var util=require(_0x6713('0x1'));var moment=require(_0x6713('0x2'));var BPromise=require('bluebird');var rs=require(_0x6713('0x3'));var fs=require('fs');var Redis=require(_0x6713('0x4'));var db=require(_0x6713('0x5'))['db'];var utils=require(_0x6713('0x6'));var logger=require('../../config/logger')(_0x6713('0x7'));var config=require(_0x6713('0x8'));var jayson=require(_0x6713('0x9'));var client=jayson[_0x6713('0xa')][_0x6713('0xb')]({'port':0x232a});config[_0x6713('0xc')]=_[_0x6713('0xd')](config[_0x6713('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6713('0xe'))(new Redis(config[_0x6713('0xc')]));require(_0x6713('0xf'))[_0x6713('0x10')](socket);function respondWithRpcPromise(_0x5d431f,_0x28060c,_0x56351f){return new BPromise(function(_0x4b49bc,_0x4024ec){return client['request'](_0x5d431f,_0x56351f)[_0x6713('0x11')](function(_0x570cb9){logger[_0x6713('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x28060c,_0x6713('0x13'));logger[_0x6713('0x14')](_0x6713('0x15'),_0x28060c,_0x6713('0x13'),JSON[_0x6713('0x16')](_0x570cb9));if(_0x570cb9[_0x6713('0x17')]){if(_0x570cb9[_0x6713('0x17')][_0x6713('0x18')]===0x1f4){logger['error'](_0x6713('0x19'),_0x28060c,_0x570cb9[_0x6713('0x17')]['message']);return _0x4024ec(_0x570cb9[_0x6713('0x17')][_0x6713('0x1a')]);}logger[_0x6713('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x28060c,_0x570cb9[_0x6713('0x17')][_0x6713('0x1a')]);return _0x4b49bc(_0x570cb9[_0x6713('0x17')][_0x6713('0x1a')]);}else{logger[_0x6713('0x12')](_0x6713('0x19'),_0x28060c,_0x6713('0x13'));_0x4b49bc(_0x570cb9[_0x6713('0x1b')][_0x6713('0x1a')]);}})[_0x6713('0x1c')](function(_0x4ae59a){logger[_0x6713('0x17')](_0x6713('0x19'),_0x28060c,_0x4ae59a);_0x4024ec(_0x4ae59a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index c28caf0..b258aa4 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 _0xe41a=['voicePrefix:','save','remove','update','emit','length'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0xe41a,0x1cf));var _0xae41=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xe41a[_0x139a3c];return _0x2b375b;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xae41('0x0'),_0xae41('0x1'),_0xae41('0x2')];function createListener(_0x50fa63,_0x3abf){return function(_0x4b4fb4){_0x3abf[_0xae41('0x3')](_0x50fa63,_0x4b4fb4);};}function removeListener(_0x3a369d,_0x257fd7){return function(){VoicePrefixEvents['removeListener'](_0x3a369d,_0x257fd7);};}exports['register']=function(_0x5453f8){for(var _0x31fa28=0x0,_0x40b1b1=events[_0xae41('0x4')];_0x31fa28<_0x40b1b1;_0x31fa28++){var _0x32b952=events[_0x31fa28];var _0x374b8f=createListener(_0xae41('0x5')+_0x32b952,_0x5453f8);VoicePrefixEvents['on'](_0x32b952,_0x374b8f);}}; \ No newline at end of file +var _0x29f9=['./voicePrefix.events','save','remove','update','emit','removeListener','register','length','voicePrefix:'];(function(_0x1ba9f6,_0x2f88ed){var _0x3de66d=function(_0x222680){while(--_0x222680){_0x1ba9f6['push'](_0x1ba9f6['shift']());}};_0x3de66d(++_0x2f88ed);}(_0x29f9,0x6c));var _0x929f=function(_0x2c6ef0,_0x4fe18e){_0x2c6ef0=_0x2c6ef0-0x0;var _0x3f52e=_0x29f9[_0x2c6ef0];return _0x3f52e;};'use strict';var VoicePrefixEvents=require(_0x929f('0x0'));var events=[_0x929f('0x1'),_0x929f('0x2'),_0x929f('0x3')];function createListener(_0x4ba622,_0xc28df8){return function(_0x5b692a){_0xc28df8[_0x929f('0x4')](_0x4ba622,_0x5b692a);};}function removeListener(_0x524058,_0x35b047){return function(){VoicePrefixEvents[_0x929f('0x5')](_0x524058,_0x35b047);};}exports[_0x929f('0x6')]=function(_0x4dd007){for(var _0x172dbf=0x0,_0x1e6888=events[_0x929f('0x7')];_0x172dbf<_0x1e6888;_0x172dbf++){var _0x30b9c2=events[_0x172dbf];var _0x54769e=createListener(_0x929f('0x8')+_0x30b9c2,_0x4dd007);VoicePrefixEvents['on'](_0x30b9c2,_0x54769e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 21420fe..ee4cec8 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 _0xbd54=['../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/lists','getLists','/:id/blacklists','create','/:id/clone','clone','addTeams','post','addAgents','addLists','addBlackLists','put','update','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2940b3,_0x3a78dc){var _0x56df38=function(_0x5f2ec8){while(--_0x5f2ec8){_0x2940b3['push'](_0x2940b3['shift']());}};_0x56df38(++_0x3a78dc);}(_0xbd54,0x17c));var _0x4bd5=function(_0x5dcae8,_0x14040a){_0x5dcae8=_0x5dcae8-0x0;var _0xa7a0c6=_0xbd54[_0x5dcae8];return _0xa7a0c6;};'use strict';var multer=require(_0x4bd5('0x0'));var util=require(_0x4bd5('0x1'));var path=require(_0x4bd5('0x2'));var timeout=require(_0x4bd5('0x3'));var express=require(_0x4bd5('0x4'));var router=express[_0x4bd5('0x5')]();var auth=require(_0x4bd5('0x6'));var interaction=require(_0x4bd5('0x7'));var config=require(_0x4bd5('0x8'));var controller=require(_0x4bd5('0x9'));router[_0x4bd5('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4bd5('0xa')](_0x4bd5('0xb'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0xd')]);router[_0x4bd5('0xa')](_0x4bd5('0xe'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0xf')]);router[_0x4bd5('0xa')](_0x4bd5('0x10'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x11')]);router[_0x4bd5('0xa')](_0x4bd5('0x12'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x13')]);router[_0x4bd5('0xa')]('/:id/hopper_black',auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x14')]);router[_0x4bd5('0xa')](_0x4bd5('0x15'),auth[_0x4bd5('0xc')](),controller['getTeams']);router[_0x4bd5('0xa')](_0x4bd5('0x16'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x17')]);router[_0x4bd5('0xa')]('/:id/members',auth[_0x4bd5('0xc')](),controller['getMembers']);router['get'](_0x4bd5('0x18'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x19')]);router[_0x4bd5('0xa')](_0x4bd5('0x1a'),auth[_0x4bd5('0xc')](),controller['getBlackLists']);router['post']('/',auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x1b')]);router['post'](_0x4bd5('0x1c'),auth['isAuthenticated'](),controller[_0x4bd5('0x1d')]);router['post'](_0x4bd5('0x15'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x1e')]);router[_0x4bd5('0x1f')](_0x4bd5('0x16'),auth['isAuthenticated'](),controller[_0x4bd5('0x20')]);router[_0x4bd5('0x1f')]('/:id/lists',auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x21')]);router[_0x4bd5('0x1f')](_0x4bd5('0x1a'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x22')]);router[_0x4bd5('0x23')]('/:id',auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x24')]);router['delete'](_0x4bd5('0xb'),auth['isAuthenticated'](),controller[_0x4bd5('0x25')]);router[_0x4bd5('0x26')]('/:id/teams',auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x27')]);router[_0x4bd5('0x26')]('/:id/users',auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x28')]);router['delete'](_0x4bd5('0x18'),auth[_0x4bd5('0xc')](),controller[_0x4bd5('0x29')]);router[_0x4bd5('0x26')](_0x4bd5('0x1a'),auth['isAuthenticated'](),controller[_0x4bd5('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x19ae=['/:id/lists','getLists','post','create','/:id/clone','clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','destroy','delete','removeAgents','removeLists','/:id/blacklists','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers'];(function(_0x30219f,_0x51fe1f){var _0x51c835=function(_0x2ad9f6){while(--_0x2ad9f6){_0x30219f['push'](_0x30219f['shift']());}};_0x51c835(++_0x51fe1f);}(_0x19ae,0xb7));var _0xe19a=function(_0xfa327b,_0x95d92){_0xfa327b=_0xfa327b-0x0;var _0x182dcb=_0x19ae[_0xfa327b];return _0x182dcb;};'use strict';var multer=require('multer');var util=require(_0xe19a('0x0'));var path=require(_0xe19a('0x1'));var timeout=require(_0xe19a('0x2'));var express=require('express');var router=express[_0xe19a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe19a('0x4'));var config=require(_0xe19a('0x5'));var controller=require(_0xe19a('0x6'));router[_0xe19a('0x7')]('/',auth['isAuthenticated'](),controller[_0xe19a('0x8')]);router[_0xe19a('0x7')]('/:id',auth[_0xe19a('0x9')](),controller[_0xe19a('0xa')]);router[_0xe19a('0x7')](_0xe19a('0xb'),auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0xe19a('0xc'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xe19a('0x7')]('/:id/hopper_finals',auth[_0xe19a('0x9')](),controller[_0xe19a('0xd')]);router[_0xe19a('0x7')](_0xe19a('0xe'),auth[_0xe19a('0x9')](),controller[_0xe19a('0xf')]);router[_0xe19a('0x7')](_0xe19a('0x10'),auth['isAuthenticated'](),controller[_0xe19a('0x11')]);router[_0xe19a('0x7')](_0xe19a('0x12'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x13')]);router[_0xe19a('0x7')](_0xe19a('0x14'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x15')]);router['get'](_0xe19a('0x16'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x17')]);router[_0xe19a('0x7')]('/:id/blacklists',auth[_0xe19a('0x9')](),controller['getBlackLists']);router[_0xe19a('0x18')]('/',auth['isAuthenticated'](),controller[_0xe19a('0x19')]);router[_0xe19a('0x18')](_0xe19a('0x1a'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x1b')]);router[_0xe19a('0x18')](_0xe19a('0x10'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x1c')]);router[_0xe19a('0x18')](_0xe19a('0x12'),auth['isAuthenticated'](),controller[_0xe19a('0x1d')]);router[_0xe19a('0x18')](_0xe19a('0x16'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x1e')]);router[_0xe19a('0x18')]('/:id/blacklists',auth[_0xe19a('0x9')](),controller[_0xe19a('0x1f')]);router[_0xe19a('0x20')](_0xe19a('0x21'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x22')]);router['delete'](_0xe19a('0x21'),auth['isAuthenticated'](),controller[_0xe19a('0x23')]);router[_0xe19a('0x24')](_0xe19a('0x10'),auth[_0xe19a('0x9')](),controller['removeTeams']);router[_0xe19a('0x24')](_0xe19a('0x12'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x25')]);router[_0xe19a('0x24')](_0xe19a('0x16'),auth[_0xe19a('0x9')](),controller[_0xe19a('0x26')]);router[_0xe19a('0x24')](_0xe19a('0x27'),auth[_0xe19a('0x9')](),controller['removeBlackLists']);module[_0xe19a('0x28')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index d4bd2b3..c2345f0 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(_0x52d74f,_0x4b101e){var _0x5a59f3=function(_0x1c63b4){while(--_0x1c63b4){_0x52d74f['push'](_0x52d74f['shift']());}};_0x5a59f3(++_0x4b101e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x5e48f8,_0x54ea70){var _0x15f1da=function(_0x2ae67f){while(--_0x2ae67f){_0x5e48f8['push'](_0x5e48f8['shift']());}};_0x15f1da(++_0x54ea70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 379565b..e73ca8b 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 _0xc493=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','length','include','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','body','omit','QueueCampaigns','getHoppers','findOne','CmHopper','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','ContactId','ListId','phone','scheduledAt','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','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','../../config/logger','api','../../config/utils','../../mysqldb','localhost','redis','register','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','destroy','get','inbound','outbound','ignore','map','value','includes','find','type','UserProfileResource','then','error','name','send','VoiceQueue','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc493,0x76));var _0x3c49=function(_0x4f23ba,_0x31a525){_0x4f23ba=_0x4f23ba-0x0;var _0x35d280=_0xc493[_0x4f23ba];return _0x35d280;};'use strict';var pdf=require(_0x3c49('0x0'));var emlformat=require(_0x3c49('0x1'));var rimraf=require(_0x3c49('0x2'));var zipdir=require(_0x3c49('0x3'));var jsonpatch=require(_0x3c49('0x4'));var rp=require(_0x3c49('0x5'));var moment=require('moment');var BPromise=require(_0x3c49('0x6'));var Mustache=require(_0x3c49('0x7'));var util=require(_0x3c49('0x8'));var path=require(_0x3c49('0x9'));var sox=require(_0x3c49('0xa'));var csv=require(_0x3c49('0xb'));var ejs=require(_0x3c49('0xc'));var fs=require('fs');var _=require(_0x3c49('0xd'));var squel=require(_0x3c49('0xe'));var crypto=require(_0x3c49('0xf'));var jsforce=require(_0x3c49('0x10'));var deskjs=require(_0x3c49('0x11'));var toCsv=require('to-csv');var querystring=require(_0x3c49('0x12'));var Papa=require(_0x3c49('0x13'));var Redis=require(_0x3c49('0x14'));var authService=require(_0x3c49('0x15'));var qs=require(_0x3c49('0x16'));var as=require(_0x3c49('0x17'));var hardwareService=require(_0x3c49('0x18'));var logger=require(_0x3c49('0x19'))(_0x3c49('0x1a'));var utils=require(_0x3c49('0x1b'));var config=require('../../config/environment');var db=require(_0x3c49('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x3c49('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c49('0x1e')]));require('./voiceQueue.socket')[_0x3c49('0x1f')](socket);function respondWithStatusCode(_0x5c0de6,_0x525885){_0x525885=_0x525885||0xcc;return function(_0x26470b){if(_0x26470b){return _0x5c0de6[_0x3c49('0x20')](_0x525885);}return _0x5c0de6['status'](_0x525885)[_0x3c49('0x21')]();};}function respondWithResult(_0x621b72,_0xf9df55){_0xf9df55=_0xf9df55||0xc8;return function(_0x19b8e5){if(_0x19b8e5){return _0x621b72[_0x3c49('0x22')](_0xf9df55)[_0x3c49('0x23')](_0x19b8e5);}};}function respondWithFilteredResult(_0x45070e,_0x575ce4){return function(_0x2cf07){if(_0x2cf07){var _0x3d9a28=_0x2cf07[_0x3c49('0x24')],_0x41690c=_0x575ce4[_0x3c49('0x25')],_0xa0d04=_0x575ce4['offset']+_0x575ce4[_0x3c49('0x26')],_0x1b2e9e;if(_0xa0d04>=_0x3d9a28){_0xa0d04=_0x3d9a28;_0x1b2e9e=0xc8;}else{_0x1b2e9e=0xce;}_0x45070e['status'](_0x1b2e9e);return _0x45070e[_0x3c49('0x27')]('Content-Range',_0x41690c+'-'+_0xa0d04+'/'+_0x3d9a28)[_0x3c49('0x23')](_0x2cf07);}return null;};}function patchUpdates(_0x216d9f){return function(_0x20cac5){try{jsonpatch[_0x3c49('0x28')](_0x20cac5,_0x216d9f,!![]);}catch(_0xf6010f){return BPromise['reject'](_0xf6010f);}return _0x20cac5[_0x3c49('0x29')]();};}function saveUpdates(_0x463597,_0x5bb0e1){return function(_0x3b88fe){if(_0x3b88fe){return _0x3b88fe[_0x3c49('0x2a')](_0x463597)['then'](function(_0x1c76f9){return _0x1c76f9;});}return null;};}function removeEntity(_0x5e0028,_0x50edd2){return function(_0x5762b4){if(_0x5762b4){return _0x5762b4[_0x3c49('0x2b')]()['then'](function(){var _0x1f0b13=_0x5762b4[_0x3c49('0x2c')]({'plain':!![]});var _0x3308ad=[{'name':'VoiceQueues','value':_0x3c49('0x2d'),'ignore':![]},{'name':'QueueCampaigns','value':_0x3c49('0x2e'),'ignore':![]}];var _0x2ff431=_(_0x3308ad)['filter'](_0x3c49('0x2f'))[_0x3c49('0x30')]('value')[_0x3c49('0x31')]();if(_[_0x3c49('0x32')](_0x2ff431,_0x1f0b13['type'])){return;}var _0x3c1f1f=_[_0x3c49('0x33')](_0x3308ad,[_0x3c49('0x31'),_0x1f0b13[_0x3c49('0x34')]])['name'];return db[_0x3c49('0x35')][_0x3c49('0x2b')]({'where':{'type':_0x3c1f1f,'resourceId':_0x1f0b13['id']}})[_0x3c49('0x36')](function(){return _0x5762b4;});})[_0x3c49('0x36')](function(){_0x5e0028['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6d8a,_0x2b70b9){return function(_0x46d1bb){if(!_0x46d1bb){_0x4d6d8a['sendStatus'](0x194);}return _0x46d1bb;};}function handleError(_0x2ef64a,_0x3689a7){_0x3689a7=_0x3689a7||0x1f4;return function(_0x4e7028){logger[_0x3c49('0x37')](_0x4e7028['stack']);if(_0x4e7028[_0x3c49('0x38')]){delete _0x4e7028[_0x3c49('0x38')];}_0x2ef64a[_0x3c49('0x22')](_0x3689a7)[_0x3c49('0x39')](_0x4e7028);};}exports['index']=function(_0x1263bd,_0x47e1b0){var _0x5f231e={},_0x4dd097={},_0x445f0b={'count':0x0,'rows':[]};var _0x52cbb5=_['map'](db[_0x3c49('0x3a')][_0x3c49('0x3b')],function(_0x23d059){return{'name':_0x23d059['fieldName'],'type':_0x23d059[_0x3c49('0x34')][_0x3c49('0x3c')]};});_0x4dd097['model']=_[_0x3c49('0x30')](_0x52cbb5,_0x3c49('0x38'));_0x4dd097[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x1263bd[_0x3c49('0x3d')]);_0x4dd097[_0x3c49('0x3f')]=_[_0x3c49('0x40')](_0x4dd097[_0x3c49('0x41')],_0x4dd097[_0x3c49('0x3d')]);_0x5f231e[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x4dd097[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x1263bd[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x5f231e[_0x3c49('0x42')]=_0x5f231e[_0x3c49('0x42')]['length']?_0x5f231e[_0x3c49('0x42')]:_0x4dd097[_0x3c49('0x41')];if(!_0x1263bd['query'][_0x3c49('0x44')](_0x3c49('0x45'))){_0x5f231e[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x1263bd['query'][_0x3c49('0x26')]);_0x5f231e['offset']=qs[_0x3c49('0x25')](_0x1263bd[_0x3c49('0x3d')][_0x3c49('0x25')]);}_0x5f231e[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x1263bd['query'][_0x3c49('0x47')]);_0x5f231e[_0x3c49('0x48')]=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0x1263bd[_0x3c49('0x3d')],_0x4dd097[_0x3c49('0x3f')]),_0x52cbb5);if(_0x1263bd[_0x3c49('0x3d')]['filter']){_0x5f231e[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x5f231e[_0x3c49('0x48')],{'$or':_[_0x3c49('0x30')](_0x52cbb5,function(_0x47cb36){if(_0x47cb36[_0x3c49('0x34')]!==_0x3c49('0x4b')){var _0xaa2558={};_0xaa2558[_0x47cb36[_0x3c49('0x38')]]={'$like':'%'+_0x1263bd['query'][_0x3c49('0x4c')]+'%'};return _0xaa2558;}})});}_0x5f231e=_['merge']({},_0x5f231e,_0x1263bd[_0x3c49('0x4d')]);var _0x3e33e2={'where':_0x5f231e[_0x3c49('0x48')]};return db[_0x3c49('0x3a')][_0x3c49('0x24')](_0x3e33e2)['then'](function(_0x23a1ce){_0x445f0b[_0x3c49('0x24')]=_0x23a1ce;if(_0x1263bd[_0x3c49('0x3d')][_0x3c49('0x4e')]){_0x5f231e['include']=[{'all':!![]}];}return db[_0x3c49('0x3a')][_0x3c49('0x4f')](_0x5f231e);})[_0x3c49('0x36')](function(_0x1b0d95){_0x445f0b[_0x3c49('0x50')]=_0x1b0d95;return _0x445f0b;})[_0x3c49('0x36')](respondWithFilteredResult(_0x47e1b0,_0x5f231e))['catch'](handleError(_0x47e1b0,null));};exports[_0x3c49('0x51')]=function(_0x27e034,_0x9ca4dd){var _0x2f69be={'raw':![],'where':{'id':_0x27e034['params']['id']}},_0x14c63a={};_0x14c63a[_0x3c49('0x41')]=_[_0x3c49('0x3e')](db[_0x3c49('0x3a')][_0x3c49('0x3b')]);_0x14c63a[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x27e034['query']);_0x14c63a[_0x3c49('0x3f')]=_['intersection'](_0x14c63a[_0x3c49('0x41')],_0x14c63a['query']);_0x2f69be[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x14c63a[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x27e034[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x2f69be[_0x3c49('0x42')]=_0x2f69be[_0x3c49('0x42')][_0x3c49('0x52')]?_0x2f69be[_0x3c49('0x42')]:_0x14c63a['model'];if(_0x27e034['query'][_0x3c49('0x4e')]){_0x2f69be[_0x3c49('0x53')]=[{'all':!![]}];}_0x2f69be=_[_0x3c49('0x4a')]({},_0x2f69be,_0x27e034[_0x3c49('0x4d')]);return db['VoiceQueue']['find'](_0x2f69be)[_0x3c49('0x36')](handleEntityNotFound(_0x9ca4dd,null))[_0x3c49('0x36')](respondWithResult(_0x9ca4dd,null))[_0x3c49('0x54')](handleError(_0x9ca4dd,null));};exports[_0x3c49('0x55')]=function(_0x1a7a20,_0x3f89af){return db[_0x3c49('0x3a')]['create'](_0x1a7a20['body'],{})[_0x3c49('0x36')](function(_0x56b69d){var _0x595e17=_0x1a7a20[_0x3c49('0x56')][_0x3c49('0x2c')]({'plain':!![]});if(!_0x595e17)throw new Error(_0x3c49('0x57'));if(_0x595e17[_0x3c49('0x58')]==='user'){var _0x4097a1=_0x56b69d['get']({'plain':!![]});var _0x633d72=[{'name':_0x3c49('0x59'),'value':_0x3c49('0x2d')},{'name':'QueueCampaigns','value':_0x3c49('0x2e')}];var _0x32a7b8=_[_0x3c49('0x33')](_0x633d72,[_0x3c49('0x31'),_0x4097a1[_0x3c49('0x34')]])[_0x3c49('0x38')];return db[_0x3c49('0x5a')][_0x3c49('0x33')]({'where':{'name':_0x32a7b8,'userProfileId':_0x595e17[_0x3c49('0x5b')]},'raw':!![]})[_0x3c49('0x36')](function(_0x47588d){if(_0x47588d&&_0x47588d[_0x3c49('0x5c')]===0x0){return db['UserProfileResource'][_0x3c49('0x55')]({'name':_0x4097a1[_0x3c49('0x38')],'resourceId':_0x4097a1['id'],'type':_0x47588d[_0x3c49('0x38')],'sectionId':_0x47588d['id']},{})['then'](function(){return _0x56b69d;});}else{return _0x56b69d;}})[_0x3c49('0x54')](function(_0x2292cf){logger[_0x3c49('0x37')](_0x3c49('0x5d'),_0x2292cf);throw _0x2292cf;});}return _0x56b69d;})[_0x3c49('0x36')](respondWithResult(_0x3f89af,0xc9))[_0x3c49('0x54')](handleError(_0x3f89af,null));};exports[_0x3c49('0x5e')]=function(_0x1564ea,_0x4f29bd){var _0x53f6a9={'where':{'id':_0x1564ea[_0x3c49('0x5f')]['id']}},_0x1879a8={};_0x1879a8[_0x3c49('0x41')]=_[_0x3c49('0x3e')](db['VoiceQueue'][_0x3c49('0x3b')]);_0x53f6a9[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x1879a8[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x1564ea[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x53f6a9[_0x3c49('0x42')]=_0x53f6a9[_0x3c49('0x42')][_0x3c49('0x52')]?_0x53f6a9[_0x3c49('0x42')]:_0x1879a8['model'];if(_0x1564ea['query']['includeAll']){_0x53f6a9[_0x3c49('0x53')]=[{'all':!![]}];}_0x53f6a9=_[_0x3c49('0x4a')]({},_0x53f6a9,_0x1564ea[_0x3c49('0x4d')]);return db[_0x3c49('0x3a')][_0x3c49('0x33')](_0x53f6a9)[_0x3c49('0x36')](handleEntityNotFound(_0x4f29bd,null))[_0x3c49('0x36')](function(_0x105c91){if(_0x105c91){var _0x281a01=_0x105c91['get']({'plain':!![]});_0x281a01=qs['omit'](_0x281a01,['id',_0x3c49('0x60'),_0x3c49('0x61')]);_0x1564ea[_0x3c49('0x62')]=_[_0x3c49('0x63')](_0x1564ea[_0x3c49('0x62')],['id','createdAt','updatedAt']);return db['VoiceQueue']['create'](_[_0x3c49('0x4a')](_0x281a01,_0x1564ea['body']),{'include':_0x1564ea['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x5423d7){var _0x4b9b4a=_0x1564ea[_0x3c49('0x56')][_0x3c49('0x2c')]({'plain':!![]});if(!_0x4b9b4a)throw new Error(_0x3c49('0x57'));if(_0x4b9b4a[_0x3c49('0x58')]===_0x3c49('0x56')){var _0x9cf75f=_0x5423d7[_0x3c49('0x2c')]({'plain':!![]});var _0x272f52=[{'name':_0x3c49('0x59'),'value':'inbound'},{'name':_0x3c49('0x64'),'value':_0x3c49('0x2e')}];var _0x18b959=_[_0x3c49('0x33')](_0x272f52,[_0x3c49('0x31'),_0x9cf75f['type']])[_0x3c49('0x38')];return db['UserProfileSection']['find']({'where':{'name':_0x18b959,'userProfileId':_0x4b9b4a[_0x3c49('0x5b')]},'raw':!![]})[_0x3c49('0x36')](function(_0x30bcac){if(_0x30bcac&&_0x30bcac['autoAssociation']===0x0){return db['UserProfileResource'][_0x3c49('0x55')]({'name':_0x9cf75f['name'],'resourceId':_0x9cf75f['id'],'type':_0x30bcac['name'],'sectionId':_0x30bcac['id']},{})[_0x3c49('0x36')](function(){return _0x5423d7;});}else{return _0x5423d7;}})[_0x3c49('0x54')](function(_0x529e8f){logger[_0x3c49('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x529e8f);throw _0x529e8f;});}return _0x5423d7;});}})['then'](respondWithResult(_0x4f29bd,0xc9))[_0x3c49('0x54')](handleError(_0x4f29bd,null));};exports[_0x3c49('0x2a')]=function(_0x7dcde6,_0x212c3a){if(_0x7dcde6[_0x3c49('0x62')]['id']){delete _0x7dcde6['body']['id'];}return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x7dcde6[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x212c3a,null))[_0x3c49('0x36')](saveUpdates(_0x7dcde6['body'],null))[_0x3c49('0x36')](respondWithResult(_0x212c3a,null))[_0x3c49('0x54')](handleError(_0x212c3a,null));};exports[_0x3c49('0x2b')]=function(_0x56a53e,_0x2985dc){return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x56a53e['params']['id']}})['then'](handleEntityNotFound(_0x2985dc,null))[_0x3c49('0x36')](removeEntity(_0x2985dc,null))[_0x3c49('0x54')](handleError(_0x2985dc,null));};exports[_0x3c49('0x65')]=function(_0x8c2f86,_0x4c1610,_0x17a5ca){var _0x179ec2={'raw':![],'where':{}};var _0x109663={};var _0x1bed6d={'count':0x0,'rows':[]};return db[_0x3c49('0x3a')][_0x3c49('0x66')]({'where':{'id':_0x8c2f86[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x4c1610,null))[_0x3c49('0x36')](function(_0x1f9d8f){if(_0x1f9d8f){_0x109663[_0x3c49('0x41')]=_['keys'](db['CmHopper'][_0x3c49('0x3b')]);_0x109663['query']=_[_0x3c49('0x3e')](_0x8c2f86['query']);_0x109663[_0x3c49('0x3f')]=_['intersection'](_0x109663[_0x3c49('0x41')],_0x109663[_0x3c49('0x3d')]);_0x179ec2[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x109663[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x8c2f86['query'][_0x3c49('0x43')]));_0x179ec2['attributes']=_0x179ec2[_0x3c49('0x42')][_0x3c49('0x52')]?_0x179ec2[_0x3c49('0x42')]:_0x109663[_0x3c49('0x41')];if(!_0x8c2f86[_0x3c49('0x3d')][_0x3c49('0x44')](_0x3c49('0x45'))){_0x179ec2[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x8c2f86[_0x3c49('0x3d')][_0x3c49('0x26')]);_0x179ec2[_0x3c49('0x25')]=qs['offset'](_0x8c2f86[_0x3c49('0x3d')][_0x3c49('0x25')]);}_0x179ec2[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x8c2f86[_0x3c49('0x3d')]['sort']);_0x179ec2['where']=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0x8c2f86['query'],_0x109663[_0x3c49('0x3f')]));_0x179ec2[_0x3c49('0x48')]['VoiceQueueId']=_0x1f9d8f['id'];if(_0x8c2f86[_0x3c49('0x3d')]['filter']){_0x179ec2[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x179ec2[_0x3c49('0x48')],{'$or':_[_0x3c49('0x30')](_0x179ec2[_0x3c49('0x42')],function(_0x14b539){var _0x3b47ed={};_0x3b47ed[_0x14b539]={'$like':'%'+_0x8c2f86[_0x3c49('0x3d')][_0x3c49('0x4c')]+'%'};return _0x3b47ed;})});}_0x179ec2=_[_0x3c49('0x4a')]({},_0x179ec2,_0x8c2f86[_0x3c49('0x4d')]);return db[_0x3c49('0x67')][_0x3c49('0x24')]({'where':_0x179ec2[_0x3c49('0x48')]})[_0x3c49('0x36')](function(_0xb82a91){_0x1bed6d['count']=_0xb82a91;if(_0x8c2f86[_0x3c49('0x3d')][_0x3c49('0x4e')]){_0x179ec2[_0x3c49('0x53')]=[{'all':!![]}];}return db[_0x3c49('0x67')][_0x3c49('0x4f')](_0x179ec2);})[_0x3c49('0x36')](function(_0x2caf14){_0x1bed6d[_0x3c49('0x50')]=_0x2caf14;return _0x1bed6d;});}})[_0x3c49('0x36')](respondWithFilteredResult(_0x4c1610,_0x179ec2))[_0x3c49('0x54')](handleError(_0x4c1610,null));};exports['getHopperHistories']=function(_0x1fc379,_0x333cca,_0x595e1b){var _0x4c5d9e={'raw':!![],'where':{}};var _0x15377c={};var _0xa715a3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c49('0x66')]({'where':{'id':_0x1fc379[_0x3c49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x333cca,null))['then'](function(_0x5ab9ac){if(_0x5ab9ac){_0x15377c['model']=_['keys'](db[_0x3c49('0x68')][_0x3c49('0x3b')]);_0x15377c[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x1fc379['query']);_0x15377c[_0x3c49('0x3f')]=_[_0x3c49('0x40')](_0x15377c[_0x3c49('0x41')],_0x15377c[_0x3c49('0x3d')]);_0x4c5d9e[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x15377c[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x1fc379['query'][_0x3c49('0x43')]));_0x4c5d9e[_0x3c49('0x42')]=_0x4c5d9e['attributes'][_0x3c49('0x52')]?_0x4c5d9e['attributes']:_0x15377c[_0x3c49('0x41')];if(!_0x1fc379[_0x3c49('0x3d')]['hasOwnProperty'](_0x3c49('0x45'))){_0x4c5d9e[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x1fc379[_0x3c49('0x3d')][_0x3c49('0x26')]);_0x4c5d9e[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0x1fc379['query'][_0x3c49('0x25')]);}_0x4c5d9e[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x1fc379['query'][_0x3c49('0x47')]);_0x4c5d9e[_0x3c49('0x48')]=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0x1fc379[_0x3c49('0x3d')],_0x15377c[_0x3c49('0x3f')]));_0x4c5d9e['where'][_0x3c49('0x69')]=_0x5ab9ac['id'];if(_0x1fc379['query'][_0x3c49('0x4c')]){_0x4c5d9e['where']=_[_0x3c49('0x4a')](_0x4c5d9e['where'],{'$or':_[_0x3c49('0x30')](_0x4c5d9e[_0x3c49('0x42')],function(_0x469713){var _0x56a52a={};_0x56a52a[_0x469713]={'$like':'%'+_0x1fc379['query'][_0x3c49('0x4c')]+'%'};return _0x56a52a;})});}_0x4c5d9e=_[_0x3c49('0x4a')]({},_0x4c5d9e,_0x1fc379['options']);return db[_0x3c49('0x68')][_0x3c49('0x24')]({'where':_0x4c5d9e['where']})[_0x3c49('0x36')](function(_0x25bcdd){_0xa715a3[_0x3c49('0x24')]=_0x25bcdd;if(_0x1fc379['query'][_0x3c49('0x4e')]){_0x4c5d9e['include']=[{'all':!![]}];}return db[_0x3c49('0x68')][_0x3c49('0x4f')](_0x4c5d9e);})[_0x3c49('0x36')](function(_0x13dc5f){_0xa715a3[_0x3c49('0x50')]=_0x13dc5f;return _0xa715a3;});}})[_0x3c49('0x36')](respondWithFilteredResult(_0x333cca,_0x4c5d9e))['catch'](handleError(_0x333cca,null));};exports[_0x3c49('0x6a')]=function(_0x405db9,_0x4a1693,_0xb4c692){var _0x4b6cf1={'raw':!![],'where':{}};var _0x527763={};var _0x586cfb={'count':0x0,'rows':[]};return db[_0x3c49('0x3a')]['findOne']({'where':{'id':_0x405db9['params']['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x4a1693,null))[_0x3c49('0x36')](function(_0x100482){if(_0x100482){_0x527763[_0x3c49('0x41')]=_[_0x3c49('0x3e')](db[_0x3c49('0x6b')][_0x3c49('0x3b')]);_0x527763[_0x3c49('0x3d')]=_['keys'](_0x405db9['query']);_0x527763[_0x3c49('0x3f')]=_['intersection'](_0x527763[_0x3c49('0x41')],_0x527763[_0x3c49('0x3d')]);_0x4b6cf1[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x527763['model'],qs[_0x3c49('0x43')](_0x405db9[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x4b6cf1[_0x3c49('0x42')]=_0x4b6cf1[_0x3c49('0x42')][_0x3c49('0x52')]?_0x4b6cf1['attributes']:_0x527763['model'];if(!_0x405db9[_0x3c49('0x3d')][_0x3c49('0x44')](_0x3c49('0x45'))){_0x4b6cf1[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x405db9[_0x3c49('0x3d')][_0x3c49('0x26')]);_0x4b6cf1[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0x405db9[_0x3c49('0x3d')][_0x3c49('0x25')]);}_0x4b6cf1['order']=qs['sort'](_0x405db9[_0x3c49('0x3d')][_0x3c49('0x47')]);_0x4b6cf1['where']=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0x405db9[_0x3c49('0x3d')],_0x527763[_0x3c49('0x3f')]));_0x4b6cf1[_0x3c49('0x48')][_0x3c49('0x69')]=_0x100482['id'];if(_0x405db9[_0x3c49('0x3d')][_0x3c49('0x4c')]){_0x4b6cf1[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x4b6cf1[_0x3c49('0x48')],{'$or':_[_0x3c49('0x30')](_0x4b6cf1[_0x3c49('0x42')],function(_0x362029){var _0x2de6d5={};_0x2de6d5[_0x362029]={'$like':'%'+_0x405db9[_0x3c49('0x3d')][_0x3c49('0x4c')]+'%'};return _0x2de6d5;})});}_0x4b6cf1=_[_0x3c49('0x4a')]({},_0x4b6cf1,_0x405db9['options']);return db['CmHopperFinal'][_0x3c49('0x24')]({'where':_0x4b6cf1[_0x3c49('0x48')]})[_0x3c49('0x36')](function(_0x1ed6f5){_0x586cfb[_0x3c49('0x24')]=_0x1ed6f5;if(_0x405db9['query'][_0x3c49('0x4e')]){_0x4b6cf1['include']=[{'all':!![]}];}return db[_0x3c49('0x6b')]['findAll'](_0x4b6cf1);})[_0x3c49('0x36')](function(_0x3230a6){_0x586cfb[_0x3c49('0x50')]=_0x3230a6;return _0x586cfb;});}})[_0x3c49('0x36')](respondWithFilteredResult(_0x4a1693,_0x4b6cf1))[_0x3c49('0x54')](handleError(_0x4a1693,null));};exports[_0x3c49('0x6c')]=function(_0x336f06,_0x3a32b4,_0x27b4ab){var _0x2b2c98={'raw':!![],'where':{}};var _0x830e2b={};var _0x42216d={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3c49('0x66')]({'where':{'id':_0x336f06[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x3a32b4,null))[_0x3c49('0x36')](function(_0x335ae6){if(_0x335ae6){_0x830e2b['model']=_[_0x3c49('0x3e')](db[_0x3c49('0x6d')][_0x3c49('0x3b')]);_0x830e2b[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x336f06['query']);_0x830e2b['filters']=_[_0x3c49('0x40')](_0x830e2b[_0x3c49('0x41')],_0x830e2b[_0x3c49('0x3d')]);_0x2b2c98[_0x3c49('0x42')]=_['intersection'](_0x830e2b['model'],qs['fields'](_0x336f06[_0x3c49('0x3d')]['fields']));_0x2b2c98['attributes']=_0x2b2c98[_0x3c49('0x42')][_0x3c49('0x52')]?_0x2b2c98[_0x3c49('0x42')]:_0x830e2b['model'];if(!_0x336f06[_0x3c49('0x3d')][_0x3c49('0x44')](_0x3c49('0x45'))){_0x2b2c98[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x336f06[_0x3c49('0x3d')]['limit']);_0x2b2c98[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0x336f06['query'][_0x3c49('0x25')]);}_0x2b2c98['order']=qs[_0x3c49('0x47')](_0x336f06['query'][_0x3c49('0x47')]);_0x2b2c98['where']=qs[_0x3c49('0x3f')](_['pick'](_0x336f06['query'],_0x830e2b['filters']));_0x2b2c98[_0x3c49('0x48')][_0x3c49('0x69')]=_0x335ae6['id'];if(_0x336f06['query'][_0x3c49('0x4c')]){_0x2b2c98[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x2b2c98['where'],{'$or':_['map'](_0x2b2c98[_0x3c49('0x42')],function(_0x53f228){var _0x429741={};_0x429741[_0x53f228]={'$like':'%'+_0x336f06[_0x3c49('0x3d')]['filter']+'%'};return _0x429741;})});}_0x2b2c98=_[_0x3c49('0x4a')]({},_0x2b2c98,_0x336f06[_0x3c49('0x4d')]);return db[_0x3c49('0x6d')][_0x3c49('0x24')]({'where':_0x2b2c98[_0x3c49('0x48')]})[_0x3c49('0x36')](function(_0x136602){_0x42216d[_0x3c49('0x24')]=_0x136602;if(_0x336f06[_0x3c49('0x3d')][_0x3c49('0x4e')]){_0x2b2c98[_0x3c49('0x53')]=[{'all':!![]}];}return db[_0x3c49('0x6d')][_0x3c49('0x4f')](_0x2b2c98);})[_0x3c49('0x36')](function(_0x18460e){_0x42216d['rows']=_0x18460e;return _0x42216d;});}})[_0x3c49('0x36')](respondWithFilteredResult(_0x3a32b4,_0x2b2c98))[_0x3c49('0x54')](handleError(_0x3a32b4,null));};exports[_0x3c49('0x6e')]=function(_0xe82f24,_0x1749a9,_0x558ae5){var _0x1a6d85={};var _0x356b09={};var _0x4c1353;var _0x534951;return db['VoiceQueue'][_0x3c49('0x66')]({'where':{'id':_0xe82f24[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x1749a9,null))['then'](function(_0x1f53c4){if(_0x1f53c4){_0x4c1353=_0x1f53c4;_0x356b09[_0x3c49('0x41')]=_[_0x3c49('0x3e')](db[_0x3c49('0x6f')]['rawAttributes']);_0x356b09[_0x3c49('0x3d')]=_['keys'](_0xe82f24[_0x3c49('0x3d')]);_0x356b09[_0x3c49('0x3f')]=_[_0x3c49('0x40')](_0x356b09[_0x3c49('0x41')],_0x356b09[_0x3c49('0x3d')]);_0x1a6d85[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x356b09[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0xe82f24['query']['fields']));_0x1a6d85[_0x3c49('0x42')]=_0x1a6d85[_0x3c49('0x42')]['length']?_0x1a6d85[_0x3c49('0x42')]:_0x356b09['model'];_0x1a6d85['order']=qs[_0x3c49('0x47')](_0xe82f24['query']['sort']);_0x1a6d85['where']=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0xe82f24[_0x3c49('0x3d')],_0x356b09['filters']));if(_0xe82f24[_0x3c49('0x3d')]['filter']){_0x1a6d85[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x1a6d85['where'],{'$or':_[_0x3c49('0x30')](_0x1a6d85[_0x3c49('0x42')],function(_0x55c76e){var _0x2d8865={};_0x2d8865[_0x55c76e]={'$like':'%'+_0xe82f24[_0x3c49('0x3d')]['filter']+'%'};return _0x2d8865;})});}_0x1a6d85=_['merge']({},_0x1a6d85,_0xe82f24[_0x3c49('0x4d')]);return _0x4c1353['getTeams'](_0x1a6d85);}})[_0x3c49('0x36')](function(_0x10db47){if(_0x10db47){_0x534951=_0x10db47['length'];if(!_0xe82f24[_0x3c49('0x3d')][_0x3c49('0x44')](_0x3c49('0x45'))){_0x1a6d85['limit']=qs[_0x3c49('0x26')](_0xe82f24[_0x3c49('0x3d')][_0x3c49('0x26')]);_0x1a6d85[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0xe82f24[_0x3c49('0x3d')][_0x3c49('0x25')]);}return _0x4c1353['getTeams'](_0x1a6d85);}})[_0x3c49('0x36')](function(_0x285860){if(_0x285860){return _0x285860?{'count':_0x534951,'rows':_0x285860}:null;}})['then'](respondWithResult(_0x1749a9,null))[_0x3c49('0x54')](handleError(_0x1749a9,null));};exports[_0x3c49('0x70')]=function(_0x4a6b48,_0x2114fc,_0x31cc07){var _0x38f175=_0x4a6b48['body']['teams'];var _0x1a3b62=_[_0x3c49('0x30')](_0x38f175,'id');return db['Team'][_0x3c49('0x4f')]({'where':{'id':_0x1a3b62},'attributes':['id'],'include':[{'model':db[_0x3c49('0x71')],'as':_0x3c49('0x72'),'attributes':['id','name','online',_0x3c49('0x73'),_0x3c49('0x74')],'raw':!![]}]})['then'](function(_0x53547f){if(_0x53547f){var _0xe6d827=_[_0x3c49('0x75')](_0x53547f,function(_0x1317c4){var _0x437307=_0x1317c4[_0x3c49('0x2c')]({'plain':!![]});_0x437307[_0x3c49('0x72')][_0x3c49('0x76')](function(_0x521340){_0x521340[_0x3c49('0x77')]=_[_0x3c49('0x33')](_0x38f175,{'id':_0x437307['id']})[_0x3c49('0x77')];});return _0x437307[_0x3c49('0x72')];});return db['VoiceQueue'][_0x3c49('0x33')]({'where':{'id':_0x4a6b48[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](function(_0x2a8b99){return db[_0x3c49('0x78')][_0x3c49('0x79')](function(_0xccd5c0){return _0x2a8b99[_0x3c49('0x70')](_0x1a3b62,{'transaction':_0xccd5c0})[_0x3c49('0x36')](function(){return BPromise[_0x3c49('0x7a')](_0xe6d827,function(_0x4f11a7){return db[_0x3c49('0x7b')]['findOrCreate']({'where':{'UserId':_0x4f11a7['id'],'VoiceQueueId':_0x4a6b48[_0x3c49('0x5f')]['id']},'defaults':{'penalty':_0x4f11a7[_0x3c49('0x77')]},'transaction':_0xccd5c0});});})[_0x3c49('0x36')](function(){return BPromise[_0x3c49('0x7a')](_['filter'](_0xe6d827,{'online':!![]}),function(_0x339efa){return db[_0x3c49('0x7c')][_0x3c49('0x7d')]({'membername':_0x339efa[_0x3c49('0x38')],'UserId':_0x339efa['id'],'queue_name':_0x2a8b99[_0x3c49('0x38')],'VoiceQueueId':_0x2a8b99['id'],'interface':_[_0x3c49('0x7e')](_0x339efa[_0x3c49('0x74')])?util[_0x3c49('0x7f')](_0x3c49('0x80'),_0x339efa[_0x3c49('0x38')]):_0x339efa[_0x3c49('0x74')],'paused':_0x339efa['voicePause']||![],'penalty':_0x339efa['penalty']},{'transaction':_0xccd5c0});});})['then'](function(){_0xe6d827[_0x3c49('0x76')](function(_0x4bba95){socket[_0x3c49('0x81')](_0x3c49('0x82'),{'UserId':_0x4bba95['id'],'VoiceQueueId':_0x2a8b99['id']});});});});});}})[_0x3c49('0x36')](respondWithStatusCode(_0x2114fc,null))['catch'](handleError(_0x2114fc,null));};exports[_0x3c49('0x83')]=function(_0x242750,_0x1616b9,_0x22c18f){return db['Team']['findAll']({'where':{'id':_0x242750[_0x3c49('0x3d')][_0x3c49('0x84')]},'attributes':['id'],'include':[{'model':db[_0x3c49('0x71')],'as':_0x3c49('0x72'),'attributes':['id'],'raw':!![]}]})[_0x3c49('0x36')](handleEntityNotFound(_0x1616b9,null))[_0x3c49('0x36')](function(_0x8e4c72){var _0x2fee3b=_[_0x3c49('0x30')](_0x8e4c72,'id');var _0x200015=[];var _0x3ec201=[];var _0x2a03ab=squel[_0x3c49('0x85')]();_0x2a03ab[_0x3c49('0x86')](_0x3c49('0x87'))[_0x3c49('0x88')]('team_has_voice_queues','tq')[_0x3c49('0x89')](_0x3c49('0x8a'),'ut',_0x3c49('0x8b'))[_0x3c49('0x48')]('VoiceQueueId\x20=\x20?',_0x242750[_0x3c49('0x5f')]['id']);for(var _0x2fda50=0x0;_0x2fda50<_0x8e4c72['length'];_0x2fda50+=0x1){let _0x1bc5bd=_0x8e4c72[_0x2fda50];for(var _0x25dcb1=0x0;_0x25dcb1<_0x1bc5bd[_0x3c49('0x72')][_0x3c49('0x52')];_0x25dcb1+=0x1){let _0x50fe1e=_0x1bc5bd[_0x3c49('0x72')][_0x25dcb1];var _0x4b3e85=_0x2a03ab[_0x3c49('0x5e')]();_0x4b3e85[_0x3c49('0x48')](_0x3c49('0x8c'),_0x50fe1e['id']);_0x3ec201[_0x3c49('0x8d')](db[_0x3c49('0x78')][_0x3c49('0x3d')](_0x4b3e85['toString'](),{'type':db[_0x3c49('0x78')][_0x3c49('0x8e')]['SELECT']})[_0x3c49('0x36')](function(_0x34567f){if(_0x34567f[_0x3c49('0x52')]===0x1){return _0x50fe1e['id'];}else{var _0x5a6175=_[_0x3c49('0x8f')](_[_0x3c49('0x30')](_0x34567f,_0x3c49('0x90')),function(_0x1b1954){return _[_0x3c49('0x32')](_0x2fee3b,_0x1b1954);});if(_0x5a6175){return _0x50fe1e['id'];}}}));}}return BPromise[_0x3c49('0x91')](_0x3ec201)[_0x3c49('0x36')](function(_0x263117){_0x200015=_(_0x200015)[_0x3c49('0x92')](_0x263117)['compact']()[_0x3c49('0x31')]();return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x242750[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](function(_0x158c19){return db['sequelize'][_0x3c49('0x79')](function(_0x4673cb){return _0x158c19[_0x3c49('0x83')](_0x242750[_0x3c49('0x3d')][_0x3c49('0x84')],{'transaction':_0x4673cb})['then'](function(){if(!_[_0x3c49('0x93')](_0x200015)){return _0x158c19[_0x3c49('0x94')](_0x200015,{'transaction':_0x4673cb})['then'](function(){return db[_0x3c49('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x242750[_0x3c49('0x5f')]['id'],'UserId':_0x200015},'transaction':_0x4673cb});});}})['then'](function(){_0x200015[_0x3c49('0x76')](function(_0x3addb6){socket[_0x3c49('0x81')](_0x3c49('0x95'),{'UserId':_0x3addb6,'VoiceQueueId':_0x158c19['id']});});});});});});})[_0x3c49('0x36')](respondWithStatusCode(_0x1616b9,null))[_0x3c49('0x54')](handleError(_0x1616b9,null));};exports[_0x3c49('0x96')]=function(_0x14ff23,_0x4ae3dc,_0x41976a){var _0x5b3859,_0x3c75cc;return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x14ff23[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x4ae3dc,null))['then'](function(_0x1e7a13){if(_0x1e7a13){_0x3c75cc=_0x1e7a13;return _0x1e7a13['addAgents'](_0x14ff23[_0x3c49('0x62')]['ids'],_[_0x3c49('0x63')](_0x14ff23[_0x3c49('0x62')],[_0x3c49('0x84'),'id'])||{})[_0x3c49('0x97')](function(_0x4c8c6f){for(var _0x5cd8fe=0x0;_0x5cd8fe<_0x14ff23[_0x3c49('0x62')][_0x3c49('0x84')][_0x3c49('0x52')];_0x5cd8fe+=0x1){socket[_0x3c49('0x81')]('userVoiceQueue:save',{'UserId':_0x14ff23[_0x3c49('0x62')]['ids'][_0x5cd8fe],'VoiceQueueId':_0x14ff23[_0x3c49('0x5f')]['id']});}return _0x4c8c6f;});}})[_0x3c49('0x36')](function(_0x3473db){_0x5b3859=_0x3473db||[];if(_0x3c75cc){return db[_0x3c49('0x71')][_0x3c49('0x4f')]({'where':{'id':_0x14ff23[_0x3c49('0x62')]['ids']},'attributes':['id','name',_0x3c49('0x98'),_0x3c49('0x73'),_0x3c49('0x74')],'raw':!![]});}})[_0x3c49('0x36')](function(_0x5d90c2){if(!_[_0x3c49('0x93')](_0x5d90c2)){var _0x4c7ce1=[];for(var _0x393c7c=0x0;_0x393c7c<_0x5d90c2[_0x3c49('0x52')];_0x393c7c++){if(_0x5d90c2[_0x393c7c]['online']){_0x4c7ce1[_0x3c49('0x8d')](db[_0x3c49('0x7c')]['upsert']({'membername':_0x5d90c2[_0x393c7c][_0x3c49('0x38')],'UserId':_0x5d90c2[_0x393c7c]['id'],'queue_name':_0x3c75cc[_0x3c49('0x38')],'VoiceQueueId':_0x3c75cc['id'],'interface':_[_0x3c49('0x7e')](_0x5d90c2[_0x393c7c]['interface'])?util[_0x3c49('0x7f')](_0x3c49('0x80'),_0x5d90c2[_0x393c7c][_0x3c49('0x38')]):_0x5d90c2[_0x393c7c]['interface'],'paused':_0x5d90c2[_0x393c7c][_0x3c49('0x73')]||![],'penalty':_0x14ff23[_0x3c49('0x62')][_0x3c49('0x77')]||0x0}));}}return BPromise[_0x3c49('0x91')](_0x4c7ce1);}})['then'](function(){return _0x5b3859;})[_0x3c49('0x36')](respondWithResult(_0x4ae3dc,null))[_0x3c49('0x54')](handleError(_0x4ae3dc,null));};exports[_0x3c49('0x94')]=function(_0x3d836c,_0xadc525,_0x97efc7){return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x3d836c['params']['id']}})['then'](handleEntityNotFound(_0xadc525,null))[_0x3c49('0x36')](function(_0x1b634b){if(_0x1b634b){return _0x1b634b[_0x3c49('0x94')](_0x3d836c[_0x3c49('0x3d')][_0x3c49('0x84')])[_0x3c49('0x36')](function(){if(_[_0x3c49('0x99')](_0x3d836c[_0x3c49('0x3d')]['ids'])){for(var _0x10719e=0x0;_0x10719e<_0x3d836c[_0x3c49('0x3d')][_0x3c49('0x84')]['length'];_0x10719e+=0x1){socket[_0x3c49('0x81')](_0x3c49('0x95'),{'UserId':Number(_0x3d836c[_0x3c49('0x3d')][_0x3c49('0x84')][_0x10719e]),'VoiceQueueId':Number(_0x3d836c[_0x3c49('0x5f')]['id'])});}}else{socket[_0x3c49('0x81')](_0x3c49('0x95'),{'UserId':Number(_0x3d836c[_0x3c49('0x3d')][_0x3c49('0x84')]),'VoiceQueueId':Number(_0x3d836c['params']['id'])});}});}})[_0x3c49('0x36')](function(_0x4ea71e){return db[_0x3c49('0x7c')][_0x3c49('0x2b')]({'where':{'VoiceQueueId':_0x3d836c[_0x3c49('0x5f')]['id'],'UserId':_0x3d836c['query'][_0x3c49('0x84')]}})[_0x3c49('0x36')](function(){return _0x4ea71e;});})[_0x3c49('0x36')](respondWithStatusCode(_0xadc525,null))[_0x3c49('0x54')](handleError(_0xadc525,null));};exports[_0x3c49('0x9a')]=function(_0x4d13fd,_0x1b1b0d,_0x5a3d4a){var _0x426f04={};var _0x58de54={};var _0x540a7d;var _0xf1a375;return db[_0x3c49('0x3a')]['findOne']({'where':{'id':_0x4d13fd[_0x3c49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1b1b0d,null))['then'](function(_0x900ce0){if(_0x900ce0){_0x540a7d=_0x900ce0;_0x58de54[_0x3c49('0x41')]=_[_0x3c49('0x3e')](db[_0x3c49('0x71')][_0x3c49('0x3b')]);_0x58de54[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x4d13fd[_0x3c49('0x3d')]);_0x58de54['filters']=_[_0x3c49('0x40')](_0x58de54[_0x3c49('0x41')],_0x58de54[_0x3c49('0x3d')]);_0x426f04[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x58de54[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x4d13fd[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x426f04[_0x3c49('0x42')]=_0x426f04[_0x3c49('0x42')][_0x3c49('0x52')]?_0x426f04[_0x3c49('0x42')]:_0x58de54['model'];_0x426f04[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x4d13fd[_0x3c49('0x3d')]['sort']);_0x426f04['where']=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0x4d13fd[_0x3c49('0x3d')],_0x58de54[_0x3c49('0x3f')]));if(_0x4d13fd[_0x3c49('0x3d')][_0x3c49('0x4c')]){_0x426f04['where']=_[_0x3c49('0x4a')](_0x426f04[_0x3c49('0x48')],{'$or':_['map'](_0x426f04[_0x3c49('0x42')],function(_0x405de6){var _0x4c7e66={};_0x4c7e66[_0x405de6]={'$like':'%'+_0x4d13fd[_0x3c49('0x3d')]['filter']+'%'};return _0x4c7e66;})});}_0x426f04=_[_0x3c49('0x4a')]({},_0x426f04,_0x4d13fd['options']);return _0x540a7d[_0x3c49('0x9a')](_0x426f04);}})[_0x3c49('0x36')](function(_0x455e32){if(_0x455e32){_0xf1a375=_0x455e32[_0x3c49('0x52')];if(!_0x4d13fd['query']['hasOwnProperty'](_0x3c49('0x45'))){_0x426f04[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x4d13fd[_0x3c49('0x3d')]['limit']);_0x426f04[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0x4d13fd[_0x3c49('0x3d')][_0x3c49('0x25')]);}return _0x540a7d[_0x3c49('0x9a')](_0x426f04);}})[_0x3c49('0x36')](function(_0x111a81){if(_0x111a81){return _0x111a81?{'count':_0xf1a375,'rows':_0x111a81}:null;}})[_0x3c49('0x36')](respondWithResult(_0x1b1b0d,null))['catch'](handleError(_0x1b1b0d,null));};exports[_0x3c49('0x9b')]=function(_0x6162d2,_0x572d22,_0x4352d1){var _0x1aee64={};var _0x21f9fe={};var _0x361f3d;var _0xafebcf;return db['VoiceQueue'][_0x3c49('0x66')]({'where':{'id':_0x6162d2[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x572d22,null))['then'](function(_0x4342dc){if(_0x4342dc){_0x361f3d=_0x4342dc;_0x21f9fe['model']=_[_0x3c49('0x3e')](db[_0x3c49('0x7c')][_0x3c49('0x3b')]);_0x21f9fe[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x6162d2[_0x3c49('0x3d')]);_0x21f9fe[_0x3c49('0x3f')]=_[_0x3c49('0x40')](_0x21f9fe['model'],_0x21f9fe['query']);_0x1aee64[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x21f9fe[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x6162d2[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x1aee64[_0x3c49('0x42')]=_0x1aee64[_0x3c49('0x42')][_0x3c49('0x52')]?_0x1aee64[_0x3c49('0x42')]:_0x21f9fe[_0x3c49('0x41')];_0x1aee64[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x6162d2[_0x3c49('0x3d')][_0x3c49('0x47')]);_0x1aee64['where']=qs[_0x3c49('0x3f')](_['pick'](_0x6162d2[_0x3c49('0x3d')],_0x21f9fe[_0x3c49('0x3f')]));if(_0x6162d2[_0x3c49('0x3d')]['filter']){_0x1aee64[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x1aee64[_0x3c49('0x48')],{'$or':_[_0x3c49('0x30')](_0x1aee64[_0x3c49('0x42')],function(_0x5b1589){var _0xb2f001={};_0xb2f001[_0x5b1589]={'$like':'%'+_0x6162d2[_0x3c49('0x3d')][_0x3c49('0x4c')]+'%'};return _0xb2f001;})});}_0x1aee64=_[_0x3c49('0x4a')]({},_0x1aee64,_0x6162d2[_0x3c49('0x4d')]);return _0x361f3d['getMembers'](_0x1aee64);}})[_0x3c49('0x36')](function(_0x22893d){if(_0x22893d){_0xafebcf=_0x22893d[_0x3c49('0x52')];if(!_0x6162d2['query'][_0x3c49('0x44')](_0x3c49('0x45'))){_0x1aee64[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x6162d2['query']['limit']);_0x1aee64[_0x3c49('0x25')]=qs['offset'](_0x6162d2[_0x3c49('0x3d')]['offset']);}return _0x361f3d[_0x3c49('0x9b')](_0x1aee64);}})[_0x3c49('0x36')](function(_0x1a1205){return _0x1a1205?{'count':_0xafebcf,'rows':_0x1a1205}:null;})[_0x3c49('0x36')](respondWithResult(_0x572d22,null))[_0x3c49('0x54')](handleError(_0x572d22,null));};exports[_0x3c49('0x9c')]=function(_0x347259,_0x50737f,_0x375b07){var _0x3392ba={};var _0x4e1a8a={};var _0x1e3820;var _0x41de2a;return db['VoiceQueue'][_0x3c49('0x66')]({'where':{'id':_0x347259[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x50737f,null))[_0x3c49('0x36')](function(_0x2de1f6){if(_0x2de1f6){_0x1e3820=_0x2de1f6;_0x4e1a8a[_0x3c49('0x41')]=_[_0x3c49('0x3e')](db[_0x3c49('0x9d')][_0x3c49('0x3b')]);_0x4e1a8a[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x347259['query']);_0x4e1a8a[_0x3c49('0x3f')]=_[_0x3c49('0x40')](_0x4e1a8a[_0x3c49('0x41')],_0x4e1a8a[_0x3c49('0x3d')]);_0x3392ba['attributes']=_[_0x3c49('0x40')](_0x4e1a8a[_0x3c49('0x41')],qs[_0x3c49('0x43')](_0x347259[_0x3c49('0x3d')]['fields']));_0x3392ba[_0x3c49('0x42')]=_0x3392ba['attributes'][_0x3c49('0x52')]?_0x3392ba[_0x3c49('0x42')]:_0x4e1a8a['model'];_0x3392ba[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x347259['query'][_0x3c49('0x47')]);_0x3392ba['where']=qs['filters'](_[_0x3c49('0x49')](_0x347259[_0x3c49('0x3d')],_0x4e1a8a[_0x3c49('0x3f')]));if(_0x347259['query'][_0x3c49('0x4c')]){_0x3392ba[_0x3c49('0x48')]=_[_0x3c49('0x4a')](_0x3392ba[_0x3c49('0x48')],{'$or':_[_0x3c49('0x30')](_0x3392ba[_0x3c49('0x42')],function(_0x4cfedd){var _0x25614d={};_0x25614d[_0x4cfedd]={'$like':'%'+_0x347259[_0x3c49('0x3d')][_0x3c49('0x4c')]+'%'};return _0x25614d;})});}_0x3392ba=_[_0x3c49('0x4a')]({},_0x3392ba,_0x347259[_0x3c49('0x4d')]);return _0x1e3820[_0x3c49('0x9c')](_0x3392ba);}})[_0x3c49('0x36')](function(_0x5cb63b){if(_0x5cb63b){_0x41de2a=_0x5cb63b[_0x3c49('0x52')];if(!_0x347259[_0x3c49('0x3d')][_0x3c49('0x44')](_0x3c49('0x45'))){_0x3392ba[_0x3c49('0x26')]=qs[_0x3c49('0x26')](_0x347259[_0x3c49('0x3d')][_0x3c49('0x26')]);_0x3392ba[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0x347259[_0x3c49('0x3d')][_0x3c49('0x25')]);}return _0x1e3820[_0x3c49('0x9c')](_0x3392ba);}})[_0x3c49('0x36')](function(_0x37927f){if(_0x37927f){return _0x37927f?{'count':_0x41de2a,'rows':_0x37927f}:null;}})[_0x3c49('0x36')](respondWithResult(_0x50737f,null))[_0x3c49('0x54')](handleError(_0x50737f,null));};exports['addLists']=function(_0x5502e3,_0x9b5393,_0x4fca7b){var _0xef976b,_0x26df16;return db['VoiceQueue']['find']({'where':{'id':_0x5502e3[_0x3c49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x9b5393,null))[_0x3c49('0x36')](function(_0x3e7df3){if(_0x3e7df3){_0x26df16=_0x3e7df3;return _0x3e7df3[_0x3c49('0x9e')](_0x5502e3[_0x3c49('0x62')][_0x3c49('0x84')],_[_0x3c49('0x63')](_0x5502e3[_0x3c49('0x62')],[_0x3c49('0x84'),'id'])||{});}return null;})['spread'](function(_0xf65a4a){var _0x1947bb;_0xef976b=_0xf65a4a||[];var _0x5f0b89=[];if(_0xf65a4a){for(var _0x3ec4c4=0x0;_0x3ec4c4<_0xf65a4a[_0x3c49('0x52')];_0x3ec4c4+=0x1){var _0x343589=_0xf65a4a[_0x3ec4c4][_0x3c49('0x2c')]({'plain':!![]});_0x26df16[_0x3c49('0x9f')]=_0x5502e3[_0x3c49('0x62')][_0x3c49('0x9f')]?_0x5502e3[_0x3c49('0x62')]['dialCheckDuplicateType']:_0x26df16[_0x3c49('0x9f')];switch(_0x26df16[_0x3c49('0x9f')]){case _0x3c49('0xa0'):_0x1947bb=squel[_0x3c49('0xa1')]()[_0x3c49('0xa2')]('cm_hopper')[_0x3c49('0xa3')](['phone','scheduledAt',_0x3c49('0xa4'),_0x3c49('0xa5'),_0x3c49('0x69'),'createdAt',_0x3c49('0x61')],squel[_0x3c49('0x85')]()[_0x3c49('0x86')](_0x3c49('0xa6'),_0x3c49('0xa6'))[_0x3c49('0x86')]('NOW()',_0x3c49('0xa7'))[_0x3c49('0x86')]('id',_0x3c49('0xa4'))[_0x3c49('0x86')](_0x343589[_0x3c49('0xa8')][_0x3c49('0xa9')](),_0x3c49('0xa5'))['field'](_0x5502e3['params']['id'][_0x3c49('0xa9')](),_0x3c49('0x69'))[_0x3c49('0x86')]('NOW()',_0x3c49('0x60'))[_0x3c49('0x86')](_0x3c49('0xaa'),_0x3c49('0x61'))['from'](_0x3c49('0xab'))[_0x3c49('0x48')](_0x3c49('0xac'))[_0x3c49('0x48')](_0x3c49('0xad'),_0x343589[_0x3c49('0xa8')]['toString']())[_0x3c49('0x48')]('phone\x20IS\x20NOT\x20NULL')[_0x3c49('0x48')](_0x3c49('0xae'),squel[_0x3c49('0x85')]()[_0x3c49('0x86')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x3c49('0xaf'))[_0x3c49('0x48')](_0x3c49('0xb0'),_0x5502e3[_0x3c49('0x5f')]['id'][_0x3c49('0xa9')]()))['where'](_0x3c49('0xae'),squel['select']()[_0x3c49('0x86')](_0x3c49('0xb1'))[_0x3c49('0x88')](_0x3c49('0xb2'))[_0x3c49('0x48')](_0x3c49('0xb0'),_0x5502e3[_0x3c49('0x5f')]['id']['toString']())))[_0x3c49('0xa9')]();break;case _0x3c49('0xb3'):_0x1947bb=squel[_0x3c49('0xa1')]()[_0x3c49('0xa2')](_0x3c49('0xb2'))[_0x3c49('0xa3')]([_0x3c49('0xa6'),_0x3c49('0xa7'),'ContactId',_0x3c49('0xa5'),'VoiceQueueId','createdAt',_0x3c49('0x61')],squel['select']()['field'](_0x3c49('0xa6'),'phone')[_0x3c49('0x86')](_0x3c49('0xaa'),'scheduledAt')['field']('id','ContactId')[_0x3c49('0x86')](_0x343589[_0x3c49('0xa8')][_0x3c49('0xa9')](),_0x3c49('0xa5'))[_0x3c49('0x86')](_0x5502e3['params']['id']['toString'](),_0x3c49('0x69'))[_0x3c49('0x86')]('NOW()',_0x3c49('0x60'))['field'](_0x3c49('0xaa'),_0x3c49('0x61'))[_0x3c49('0x88')](_0x3c49('0xab'))[_0x3c49('0x48')]('deletedAt\x20IS\x20NULL')[_0x3c49('0x48')](_0x3c49('0xad'),_0x343589[_0x3c49('0xa8')]['toString']())[_0x3c49('0x48')](_0x3c49('0xb4'))[_0x3c49('0x48')](_0x3c49('0xae'),squel['select']()['field'](_0x3c49('0xb1'))[_0x3c49('0x88')](_0x3c49('0xb2'))[_0x3c49('0x48')](_0x3c49('0xb0'),_0x5502e3[_0x3c49('0x5f')]['id'][_0x3c49('0xa9')]())))[_0x3c49('0xa9')]();break;default:_0x1947bb=squel['insert']()[_0x3c49('0xa2')](_0x3c49('0xb2'))[_0x3c49('0xa3')]([_0x3c49('0xa6'),'scheduledAt',_0x3c49('0xa4'),'ListId',_0x3c49('0x69'),_0x3c49('0x60'),'updatedAt'],squel['select']()[_0x3c49('0x86')]('phone',_0x3c49('0xa6'))[_0x3c49('0x86')](_0x3c49('0xaa'),_0x3c49('0xa7'))['field']('id','ContactId')[_0x3c49('0x86')](_0x343589['CmListId'][_0x3c49('0xa9')](),_0x3c49('0xa5'))['field'](_0x5502e3[_0x3c49('0x5f')]['id']['toString'](),_0x3c49('0x69'))[_0x3c49('0x86')](_0x3c49('0xaa'),'createdAt')[_0x3c49('0x86')](_0x3c49('0xaa'),_0x3c49('0x61'))[_0x3c49('0x88')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3c49('0xad'),_0x343589[_0x3c49('0xa8')][_0x3c49('0xa9')]())[_0x3c49('0x48')](_0x3c49('0xb4')))[_0x3c49('0xa9')]();}_0x5f0b89[_0x3c49('0x8d')](db['sequelize']['query'](_0x1947bb));}return BPromise['all'](_0x5f0b89);}})['then'](function(){return _0xef976b;})[_0x3c49('0x36')](respondWithResult(_0x9b5393,null))[_0x3c49('0x54')](handleError(_0x9b5393,null));};exports[_0x3c49('0xb5')]=function(_0x38bf78,_0x570879,_0x2c00e6){return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x38bf78[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x570879,null))[_0x3c49('0x36')](function(_0x3e730d){if(_0x3e730d){return _0x3e730d['removeLists'](_0x38bf78[_0x3c49('0x3d')][_0x3c49('0x84')]);}})[_0x3c49('0x36')](function(_0x3689b5){if(_0x3689b5){return db['CmHopper']['destroy']({'where':{'ListId':_0x38bf78[_0x3c49('0x3d')][_0x3c49('0x84')],'VoiceQueueId':_0x38bf78['params']['id']}})['then'](function(){return _0x3689b5;});}})[_0x3c49('0x36')](respondWithStatusCode(_0x570879,null))[_0x3c49('0x54')](handleError(_0x570879,null));};exports[_0x3c49('0xb6')]=function(_0x17fd1b,_0xe025a2,_0x93a978){var _0x5be384={};var _0x4c7568={};var _0x4ce18a;var _0x258f78;return db[_0x3c49('0x3a')][_0x3c49('0x66')]({'where':{'id':_0x17fd1b['params']['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0xe025a2,null))['then'](function(_0x108055){if(_0x108055){_0x4ce18a=_0x108055;_0x4c7568['model']=_[_0x3c49('0x3e')](db['CmList']['rawAttributes']);_0x4c7568[_0x3c49('0x3d')]=_[_0x3c49('0x3e')](_0x17fd1b[_0x3c49('0x3d')]);_0x4c7568[_0x3c49('0x3f')]=_[_0x3c49('0x40')](_0x4c7568[_0x3c49('0x41')],_0x4c7568[_0x3c49('0x3d')]);_0x5be384[_0x3c49('0x42')]=_[_0x3c49('0x40')](_0x4c7568['model'],qs['fields'](_0x17fd1b[_0x3c49('0x3d')][_0x3c49('0x43')]));_0x5be384[_0x3c49('0x42')]=_0x5be384['attributes'][_0x3c49('0x52')]?_0x5be384[_0x3c49('0x42')]:_0x4c7568[_0x3c49('0x41')];_0x5be384[_0x3c49('0x46')]=qs[_0x3c49('0x47')](_0x17fd1b[_0x3c49('0x3d')][_0x3c49('0x47')]);_0x5be384[_0x3c49('0x48')]=qs[_0x3c49('0x3f')](_[_0x3c49('0x49')](_0x17fd1b['query'],_0x4c7568[_0x3c49('0x3f')]));if(_0x17fd1b[_0x3c49('0x3d')][_0x3c49('0x4c')]){_0x5be384['where']=_[_0x3c49('0x4a')](_0x5be384['where'],{'$or':_[_0x3c49('0x30')](_0x5be384['attributes'],function(_0x23d1fd){var _0xc730c={};_0xc730c[_0x23d1fd]={'$like':'%'+_0x17fd1b[_0x3c49('0x3d')]['filter']+'%'};return _0xc730c;})});}_0x5be384=_['merge']({},_0x5be384,_0x17fd1b['options']);return _0x4ce18a[_0x3c49('0xb6')](_0x5be384);}})[_0x3c49('0x36')](function(_0x49158d){if(_0x49158d){_0x258f78=_0x49158d[_0x3c49('0x52')];if(!_0x17fd1b[_0x3c49('0x3d')][_0x3c49('0x44')](_0x3c49('0x45'))){_0x5be384[_0x3c49('0x26')]=qs['limit'](_0x17fd1b['query'][_0x3c49('0x26')]);_0x5be384[_0x3c49('0x25')]=qs[_0x3c49('0x25')](_0x17fd1b['query'][_0x3c49('0x25')]);}return _0x4ce18a[_0x3c49('0xb6')](_0x5be384);}})[_0x3c49('0x36')](function(_0x5954e5){if(_0x5954e5){return _0x5954e5?{'count':_0x258f78,'rows':_0x5954e5}:null;}})[_0x3c49('0x36')](respondWithResult(_0xe025a2,null))[_0x3c49('0x54')](handleError(_0xe025a2,null));};exports[_0x3c49('0xb7')]=function(_0x4f8173,_0x5e872a,_0x1098dc){var _0x3584f1,_0x3f12c3;return db['VoiceQueue'][_0x3c49('0x33')]({'where':{'id':_0x4f8173[_0x3c49('0x5f')]['id']}})[_0x3c49('0x36')](handleEntityNotFound(_0x5e872a,null))[_0x3c49('0x36')](function(_0x565e64){if(_0x565e64){_0x3f12c3=_0x565e64;return _0x565e64[_0x3c49('0xb7')](_0x4f8173[_0x3c49('0x62')][_0x3c49('0x84')],_[_0x3c49('0x63')](_0x4f8173[_0x3c49('0x62')],['ids','id'])||{});}return null;})[_0x3c49('0x97')](function(_0x1a04d8){var _0x1ff9fd;_0x3584f1=_0x1a04d8||[];var _0xea565=[];if(_0x1a04d8){for(var _0x2cff1a=0x0;_0x2cff1a<_0x1a04d8['length'];_0x2cff1a+=0x1){var _0x2b4f9f=_0x1a04d8[_0x2cff1a][_0x3c49('0x2c')]({'plain':!![]});_0x1ff9fd=squel[_0x3c49('0xa1')]()[_0x3c49('0xa2')](_0x3c49('0xb8'))['fromQuery']([_0x3c49('0xa6'),_0x3c49('0xa4'),'ListId',_0x3c49('0x69'),_0x3c49('0x60'),_0x3c49('0x61')],squel[_0x3c49('0x85')]()[_0x3c49('0x86')](_0x3c49('0xa6'),_0x3c49('0xa6'))['field']('id',_0x3c49('0xa4'))['field'](_0x2b4f9f['CmListId']['toString'](),_0x3c49('0xa5'))['field'](_0x4f8173[_0x3c49('0x5f')]['id'][_0x3c49('0xa9')](),'VoiceQueueId')[_0x3c49('0x86')](_0x3c49('0xaa'),_0x3c49('0x60'))[_0x3c49('0x86')](_0x3c49('0xaa'),_0x3c49('0x61'))[_0x3c49('0x88')]('cm_contacts')[_0x3c49('0x48')](_0x3c49('0xac'))[_0x3c49('0x48')](_0x3c49('0xad'),_0x2b4f9f[_0x3c49('0xa8')][_0x3c49('0xa9')]())[_0x3c49('0x48')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0xea565[_0x3c49('0x8d')](db[_0x3c49('0x78')][_0x3c49('0x3d')](_0x1ff9fd));}return BPromise[_0x3c49('0x91')](_0xea565);}})['then'](function(){return _0x3584f1;})[_0x3c49('0x36')](respondWithResult(_0x5e872a,null))[_0x3c49('0x54')](handleError(_0x5e872a,null));};exports['removeBlackLists']=function(_0x27b340,_0x5abb18,_0x7abc50){return db[_0x3c49('0x3a')][_0x3c49('0x33')]({'where':{'id':_0x27b340[_0x3c49('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5abb18,null))[_0x3c49('0x36')](function(_0x3d0fff){if(_0x3d0fff){return _0x3d0fff[_0x3c49('0xb9')](_0x27b340[_0x3c49('0x3d')]['ids']);}})[_0x3c49('0x36')](function(_0x10b42f){if(_0x10b42f){return db[_0x3c49('0x6d')][_0x3c49('0x2b')]({'where':{'ListId':_0x27b340[_0x3c49('0x3d')][_0x3c49('0x84')],'VoiceQueueId':_0x27b340[_0x3c49('0x5f')]['id']}})['then'](function(){return _0x10b42f;});}})[_0x3c49('0x36')](respondWithStatusCode(_0x5abb18,null))['catch'](handleError(_0x5abb18,null));}; \ No newline at end of file +var _0x0ea7=['save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','ignore','map','value','includes','type','error','stack','name','send','index','VoiceQueue','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','show','params','keys','rawAttributes','length','includeAll','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','body','updatedAt','UserProfileSection','update','getHoppers','findOne','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueueRt','upsert','isNil','SIP/%s','userVoiceQueue:save','select','tq.TeamId','from','team_has_voice_queues','VoiceQueueId\x20=\x20?','push','toString','every','TeamId','compact','ids','isEmpty','removeAgents','emit','addAgents','spread','format','all','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','field','CmListId','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','insert','fromQuery','ContactId','NOW()','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','localhost','redis','./voiceQueue.socket','register','sendStatus','status','json','count','offset','limit','reject'];(function(_0x2e17f0,_0xacc452){var _0x16b4e7=function(_0x4ca85a){while(--_0x4ca85a){_0x2e17f0['push'](_0x2e17f0['shift']());}};_0x16b4e7(++_0xacc452);}(_0x0ea7,0x8b));var _0x70ea=function(_0x58eced,_0x571bf4){_0x58eced=_0x58eced-0x0;var _0x7dcff7=_0x0ea7[_0x58eced];return _0x7dcff7;};'use strict';var pdf=require(_0x70ea('0x0'));var emlformat=require(_0x70ea('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x70ea('0x2'));var jsonpatch=require(_0x70ea('0x3'));var rp=require(_0x70ea('0x4'));var moment=require(_0x70ea('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x70ea('0x6'));var util=require(_0x70ea('0x7'));var path=require(_0x70ea('0x8'));var sox=require(_0x70ea('0x9'));var csv=require(_0x70ea('0xa'));var ejs=require(_0x70ea('0xb'));var fs=require('fs');var _=require(_0x70ea('0xc'));var squel=require(_0x70ea('0xd'));var crypto=require(_0x70ea('0xe'));var jsforce=require(_0x70ea('0xf'));var deskjs=require(_0x70ea('0x10'));var toCsv=require(_0x70ea('0xa'));var querystring=require(_0x70ea('0x11'));var Papa=require(_0x70ea('0x12'));var Redis=require('ioredis');var authService=require(_0x70ea('0x13'));var qs=require(_0x70ea('0x14'));var as=require(_0x70ea('0x15'));var hardwareService=require(_0x70ea('0x16'));var logger=require('../../config/logger')(_0x70ea('0x17'));var utils=require(_0x70ea('0x18'));var config=require(_0x70ea('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x70ea('0x1a')](config['redis'],{'host':_0x70ea('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70ea('0x1c')]));require(_0x70ea('0x1d'))[_0x70ea('0x1e')](socket);function respondWithStatusCode(_0x4dcdee,_0x795ff){_0x795ff=_0x795ff||0xcc;return function(_0xd09321){if(_0xd09321){return _0x4dcdee[_0x70ea('0x1f')](_0x795ff);}return _0x4dcdee[_0x70ea('0x20')](_0x795ff)['end']();};}function respondWithResult(_0x2cfffc,_0x3f0bff){_0x3f0bff=_0x3f0bff||0xc8;return function(_0x3bf119){if(_0x3bf119){return _0x2cfffc['status'](_0x3f0bff)[_0x70ea('0x21')](_0x3bf119);}};}function respondWithFilteredResult(_0x543c5f,_0x1ab946){return function(_0x47d73f){if(_0x47d73f){var _0x61a8f9=_0x47d73f[_0x70ea('0x22')],_0x19f528=_0x1ab946[_0x70ea('0x23')],_0xb2962f=_0x1ab946[_0x70ea('0x23')]+_0x1ab946[_0x70ea('0x24')],_0x123281;if(_0xb2962f>=_0x61a8f9){_0xb2962f=_0x61a8f9;_0x123281=0xc8;}else{_0x123281=0xce;}_0x543c5f[_0x70ea('0x20')](_0x123281);return _0x543c5f['set']('Content-Range',_0x19f528+'-'+_0xb2962f+'/'+_0x61a8f9)['json'](_0x47d73f);}return null;};}function patchUpdates(_0x101893){return function(_0x3847aa){try{jsonpatch['apply'](_0x3847aa,_0x101893,!![]);}catch(_0x328d31){return BPromise[_0x70ea('0x25')](_0x328d31);}return _0x3847aa[_0x70ea('0x26')]();};}function saveUpdates(_0x3baae3,_0x14f0ee){return function(_0x8fa4d){if(_0x8fa4d){return _0x8fa4d['update'](_0x3baae3)[_0x70ea('0x27')](function(_0x4f5643){return _0x4f5643;});}return null;};}function removeEntity(_0x9c9887,_0x5ed8d0){return function(_0x4fc631){if(_0x4fc631){return _0x4fc631[_0x70ea('0x28')]()[_0x70ea('0x27')](function(){var _0x10172f=_0x4fc631[_0x70ea('0x29')]({'plain':!![]});var _0xa8cade=[{'name':_0x70ea('0x2a'),'value':_0x70ea('0x2b'),'ignore':![]},{'name':_0x70ea('0x2c'),'value':_0x70ea('0x2d'),'ignore':![]}];var _0x54c94f=_(_0xa8cade)['filter'](_0x70ea('0x2e'))[_0x70ea('0x2f')](_0x70ea('0x30'))['value']();if(_[_0x70ea('0x31')](_0x54c94f,_0x10172f[_0x70ea('0x32')])){return;}var _0x4802fa=_['find'](_0xa8cade,['value',_0x10172f[_0x70ea('0x32')]])['name'];return db['UserProfileResource'][_0x70ea('0x28')]({'where':{'type':_0x4802fa,'resourceId':_0x10172f['id']}})[_0x70ea('0x27')](function(){return _0x4fc631;});})['then'](function(){_0x9c9887['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x509085,_0x4c8d19){return function(_0x3c8684){if(!_0x3c8684){_0x509085[_0x70ea('0x1f')](0x194);}return _0x3c8684;};}function handleError(_0x49eb22,_0x577cfc){_0x577cfc=_0x577cfc||0x1f4;return function(_0x5a6ecf){logger[_0x70ea('0x33')](_0x5a6ecf[_0x70ea('0x34')]);if(_0x5a6ecf[_0x70ea('0x35')]){delete _0x5a6ecf['name'];}_0x49eb22[_0x70ea('0x20')](_0x577cfc)[_0x70ea('0x36')](_0x5a6ecf);};}exports[_0x70ea('0x37')]=function(_0x54af2e,_0x489872){var _0x143d58={},_0x1e901c={},_0x4c8898={'count':0x0,'rows':[]};var _0x15ae33=_['map'](db[_0x70ea('0x38')]['rawAttributes'],function(_0x2cb960){return{'name':_0x2cb960['fieldName'],'type':_0x2cb960[_0x70ea('0x32')][_0x70ea('0x39')]};});_0x1e901c[_0x70ea('0x3a')]=_['map'](_0x15ae33,_0x70ea('0x35'));_0x1e901c[_0x70ea('0x3b')]=_['keys'](_0x54af2e['query']);_0x1e901c[_0x70ea('0x3c')]=_[_0x70ea('0x3d')](_0x1e901c[_0x70ea('0x3a')],_0x1e901c['query']);_0x143d58[_0x70ea('0x3e')]=_[_0x70ea('0x3d')](_0x1e901c[_0x70ea('0x3a')],qs[_0x70ea('0x3f')](_0x54af2e[_0x70ea('0x3b')][_0x70ea('0x3f')]));_0x143d58['attributes']=_0x143d58['attributes']['length']?_0x143d58[_0x70ea('0x3e')]:_0x1e901c[_0x70ea('0x3a')];if(!_0x54af2e[_0x70ea('0x3b')][_0x70ea('0x40')]('nolimit')){_0x143d58[_0x70ea('0x24')]=qs[_0x70ea('0x24')](_0x54af2e[_0x70ea('0x3b')][_0x70ea('0x24')]);_0x143d58['offset']=qs[_0x70ea('0x23')](_0x54af2e[_0x70ea('0x3b')][_0x70ea('0x23')]);}_0x143d58[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0x54af2e[_0x70ea('0x3b')][_0x70ea('0x42')]);_0x143d58[_0x70ea('0x43')]=qs[_0x70ea('0x3c')](_[_0x70ea('0x44')](_0x54af2e['query'],_0x1e901c['filters']),_0x15ae33);if(_0x54af2e[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x143d58['where']=_['merge'](_0x143d58[_0x70ea('0x43')],{'$or':_['map'](_0x15ae33,function(_0xde20a1){if(_0xde20a1[_0x70ea('0x32')]!==_0x70ea('0x46')){var _0x33e225={};_0x33e225[_0xde20a1[_0x70ea('0x35')]]={'$like':'%'+_0x54af2e[_0x70ea('0x3b')]['filter']+'%'};return _0x33e225;}})});}_0x143d58=_['merge']({},_0x143d58,_0x54af2e[_0x70ea('0x47')]);var _0x2ac4c9={'where':_0x143d58[_0x70ea('0x43')]};return db[_0x70ea('0x38')][_0x70ea('0x22')](_0x2ac4c9)[_0x70ea('0x27')](function(_0x555049){_0x4c8898[_0x70ea('0x22')]=_0x555049;if(_0x54af2e['query']['includeAll']){_0x143d58[_0x70ea('0x48')]=[{'all':!![]}];}return db[_0x70ea('0x38')][_0x70ea('0x49')](_0x143d58);})[_0x70ea('0x27')](function(_0xb7f2fd){_0x4c8898['rows']=_0xb7f2fd;return _0x4c8898;})['then'](respondWithFilteredResult(_0x489872,_0x143d58))[_0x70ea('0x4a')](handleError(_0x489872,null));};exports[_0x70ea('0x4b')]=function(_0x4c14d4,_0x1596d6){var _0x1fa4da={'raw':![],'where':{'id':_0x4c14d4[_0x70ea('0x4c')]['id']}},_0x25081f={};_0x25081f[_0x70ea('0x3a')]=_[_0x70ea('0x4d')](db[_0x70ea('0x38')][_0x70ea('0x4e')]);_0x25081f['query']=_[_0x70ea('0x4d')](_0x4c14d4[_0x70ea('0x3b')]);_0x25081f['filters']=_[_0x70ea('0x3d')](_0x25081f['model'],_0x25081f[_0x70ea('0x3b')]);_0x1fa4da[_0x70ea('0x3e')]=_[_0x70ea('0x3d')](_0x25081f[_0x70ea('0x3a')],qs[_0x70ea('0x3f')](_0x4c14d4[_0x70ea('0x3b')]['fields']));_0x1fa4da[_0x70ea('0x3e')]=_0x1fa4da['attributes'][_0x70ea('0x4f')]?_0x1fa4da[_0x70ea('0x3e')]:_0x25081f['model'];if(_0x4c14d4['query'][_0x70ea('0x50')]){_0x1fa4da[_0x70ea('0x48')]=[{'all':!![]}];}_0x1fa4da=_[_0x70ea('0x51')]({},_0x1fa4da,_0x4c14d4[_0x70ea('0x47')]);return db[_0x70ea('0x38')][_0x70ea('0x52')](_0x1fa4da)[_0x70ea('0x27')](handleEntityNotFound(_0x1596d6,null))[_0x70ea('0x27')](respondWithResult(_0x1596d6,null))[_0x70ea('0x4a')](handleError(_0x1596d6,null));};exports['create']=function(_0x31baf1,_0x556e10){return db[_0x70ea('0x38')][_0x70ea('0x53')](_0x31baf1['body'],{})[_0x70ea('0x27')](function(_0xcddfde){var _0x16be18=_0x31baf1[_0x70ea('0x54')][_0x70ea('0x29')]({'plain':!![]});if(!_0x16be18)throw new Error(_0x70ea('0x55'));if(_0x16be18['role']==='user'){var _0x3fe148=_0xcddfde['get']({'plain':!![]});var _0x1a2407=[{'name':_0x70ea('0x2a'),'value':_0x70ea('0x2b')},{'name':_0x70ea('0x2c'),'value':_0x70ea('0x2d')}];var _0x2298da=_[_0x70ea('0x52')](_0x1a2407,['value',_0x3fe148[_0x70ea('0x32')]])['name'];return db['UserProfileSection'][_0x70ea('0x52')]({'where':{'name':_0x2298da,'userProfileId':_0x16be18[_0x70ea('0x56')]},'raw':!![]})[_0x70ea('0x27')](function(_0x5c842a){if(_0x5c842a&&_0x5c842a[_0x70ea('0x57')]===0x0){return db[_0x70ea('0x58')]['create']({'name':_0x3fe148[_0x70ea('0x35')],'resourceId':_0x3fe148['id'],'type':_0x5c842a[_0x70ea('0x35')],'sectionId':_0x5c842a['id']},{})[_0x70ea('0x27')](function(){return _0xcddfde;});}else{return _0xcddfde;}})['catch'](function(_0x563ee8){logger[_0x70ea('0x33')](_0x70ea('0x59'),_0x563ee8);throw _0x563ee8;});}return _0xcddfde;})[_0x70ea('0x27')](respondWithResult(_0x556e10,0xc9))[_0x70ea('0x4a')](handleError(_0x556e10,null));};exports[_0x70ea('0x5a')]=function(_0x29cf25,_0x1483b5){var _0x4547fb={'where':{'id':_0x29cf25[_0x70ea('0x4c')]['id']}},_0x13d3e0={};_0x13d3e0[_0x70ea('0x3a')]=_[_0x70ea('0x4d')](db['VoiceQueue'][_0x70ea('0x4e')]);_0x4547fb[_0x70ea('0x3e')]=_[_0x70ea('0x3d')](_0x13d3e0['model'],qs[_0x70ea('0x3f')](_0x29cf25['query'][_0x70ea('0x3f')]));_0x4547fb[_0x70ea('0x3e')]=_0x4547fb['attributes'][_0x70ea('0x4f')]?_0x4547fb['attributes']:_0x13d3e0[_0x70ea('0x3a')];if(_0x29cf25[_0x70ea('0x3b')]['includeAll']){_0x4547fb[_0x70ea('0x48')]=[{'all':!![]}];}_0x4547fb=_[_0x70ea('0x51')]({},_0x4547fb,_0x29cf25[_0x70ea('0x47')]);return db[_0x70ea('0x38')][_0x70ea('0x52')](_0x4547fb)[_0x70ea('0x27')](handleEntityNotFound(_0x1483b5,null))[_0x70ea('0x27')](function(_0x3be21a){if(_0x3be21a){var _0x435361=_0x3be21a[_0x70ea('0x29')]({'plain':!![]});_0x435361=qs[_0x70ea('0x5b')](_0x435361,['id',_0x70ea('0x5c'),'updatedAt']);_0x29cf25[_0x70ea('0x5d')]=_['omit'](_0x29cf25[_0x70ea('0x5d')],['id','createdAt',_0x70ea('0x5e')]);return db['VoiceQueue'][_0x70ea('0x53')](_['merge'](_0x435361,_0x29cf25[_0x70ea('0x5d')]),{'include':_0x29cf25[_0x70ea('0x3b')][_0x70ea('0x50')]?[{'all':!![]}]:undefined})[_0x70ea('0x27')](function(_0x2e8c12){var _0x286255=_0x29cf25[_0x70ea('0x54')][_0x70ea('0x29')]({'plain':!![]});if(!_0x286255)throw new Error(_0x70ea('0x55'));if(_0x286255['role']===_0x70ea('0x54')){var _0x43dad7=_0x2e8c12['get']({'plain':!![]});var _0x1ae798=[{'name':_0x70ea('0x2a'),'value':_0x70ea('0x2b')},{'name':_0x70ea('0x2c'),'value':_0x70ea('0x2d')}];var _0x1cc240=_['find'](_0x1ae798,['value',_0x43dad7[_0x70ea('0x32')]])['name'];return db[_0x70ea('0x5f')][_0x70ea('0x52')]({'where':{'name':_0x1cc240,'userProfileId':_0x286255['userProfileId']},'raw':!![]})[_0x70ea('0x27')](function(_0x1206a8){if(_0x1206a8&&_0x1206a8['autoAssociation']===0x0){return db[_0x70ea('0x58')][_0x70ea('0x53')]({'name':_0x43dad7[_0x70ea('0x35')],'resourceId':_0x43dad7['id'],'type':_0x1206a8[_0x70ea('0x35')],'sectionId':_0x1206a8['id']},{})[_0x70ea('0x27')](function(){return _0x2e8c12;});}else{return _0x2e8c12;}})['catch'](function(_0x3910ec){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3910ec);throw _0x3910ec;});}return _0x2e8c12;});}})[_0x70ea('0x27')](respondWithResult(_0x1483b5,0xc9))['catch'](handleError(_0x1483b5,null));};exports[_0x70ea('0x60')]=function(_0xe8aa8a,_0x211626){if(_0xe8aa8a['body']['id']){delete _0xe8aa8a[_0x70ea('0x5d')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0xe8aa8a['params']['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x211626,null))['then'](saveUpdates(_0xe8aa8a['body'],null))[_0x70ea('0x27')](respondWithResult(_0x211626,null))[_0x70ea('0x4a')](handleError(_0x211626,null));};exports[_0x70ea('0x28')]=function(_0x4a62ed,_0x304804){return db['VoiceQueue'][_0x70ea('0x52')]({'where':{'id':_0x4a62ed[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x304804,null))['then'](removeEntity(_0x304804,null))[_0x70ea('0x4a')](handleError(_0x304804,null));};exports[_0x70ea('0x61')]=function(_0x102b9e,_0x3ed9a0,_0x57daf6){var _0x551415={'raw':![],'where':{}};var _0x37f0ed={};var _0x328a90={'count':0x0,'rows':[]};return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x102b9e[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x3ed9a0,null))['then'](function(_0xa5a524){if(_0xa5a524){_0x37f0ed[_0x70ea('0x3a')]=_[_0x70ea('0x4d')](db['CmHopper'][_0x70ea('0x4e')]);_0x37f0ed['query']=_[_0x70ea('0x4d')](_0x102b9e[_0x70ea('0x3b')]);_0x37f0ed[_0x70ea('0x3c')]=_['intersection'](_0x37f0ed[_0x70ea('0x3a')],_0x37f0ed[_0x70ea('0x3b')]);_0x551415[_0x70ea('0x3e')]=_['intersection'](_0x37f0ed['model'],qs[_0x70ea('0x3f')](_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x3f')]));_0x551415[_0x70ea('0x3e')]=_0x551415[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x551415[_0x70ea('0x3e')]:_0x37f0ed[_0x70ea('0x3a')];if(!_0x102b9e[_0x70ea('0x3b')]['hasOwnProperty'](_0x70ea('0x63'))){_0x551415[_0x70ea('0x24')]=qs[_0x70ea('0x24')](_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x24')]);_0x551415[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x23')]);}_0x551415['order']=qs[_0x70ea('0x42')](_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x42')]);_0x551415['where']=qs['filters'](_[_0x70ea('0x44')](_0x102b9e['query'],_0x37f0ed[_0x70ea('0x3c')]));_0x551415[_0x70ea('0x43')][_0x70ea('0x64')]=_0xa5a524['id'];if(_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x551415[_0x70ea('0x43')]=_[_0x70ea('0x51')](_0x551415[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x551415[_0x70ea('0x3e')],function(_0x88f84f){var _0x1d0b56={};_0x1d0b56[_0x88f84f]={'$like':'%'+_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x45')]+'%'};return _0x1d0b56;})});}_0x551415=_[_0x70ea('0x51')]({},_0x551415,_0x102b9e[_0x70ea('0x47')]);return db['CmHopper'][_0x70ea('0x22')]({'where':_0x551415[_0x70ea('0x43')]})['then'](function(_0x2274a0){_0x328a90[_0x70ea('0x22')]=_0x2274a0;if(_0x102b9e[_0x70ea('0x3b')][_0x70ea('0x50')]){_0x551415['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x551415);})[_0x70ea('0x27')](function(_0x51f109){_0x328a90['rows']=_0x51f109;return _0x328a90;});}})[_0x70ea('0x27')](respondWithFilteredResult(_0x3ed9a0,_0x551415))[_0x70ea('0x4a')](handleError(_0x3ed9a0,null));};exports[_0x70ea('0x65')]=function(_0x3da02d,_0x2023c7,_0xa189da){var _0x46f0b6={'raw':!![],'where':{}};var _0x5f4fac={};var _0x54b30e={'count':0x0,'rows':[]};return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x3da02d['params']['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x2023c7,null))[_0x70ea('0x27')](function(_0x989388){if(_0x989388){_0x5f4fac['model']=_['keys'](db[_0x70ea('0x66')]['rawAttributes']);_0x5f4fac[_0x70ea('0x3b')]=_['keys'](_0x3da02d[_0x70ea('0x3b')]);_0x5f4fac['filters']=_['intersection'](_0x5f4fac[_0x70ea('0x3a')],_0x5f4fac[_0x70ea('0x3b')]);_0x46f0b6[_0x70ea('0x3e')]=_[_0x70ea('0x3d')](_0x5f4fac[_0x70ea('0x3a')],qs['fields'](_0x3da02d['query'][_0x70ea('0x3f')]));_0x46f0b6[_0x70ea('0x3e')]=_0x46f0b6[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x46f0b6['attributes']:_0x5f4fac[_0x70ea('0x3a')];if(!_0x3da02d['query']['hasOwnProperty']('nolimit')){_0x46f0b6[_0x70ea('0x24')]=qs[_0x70ea('0x24')](_0x3da02d[_0x70ea('0x3b')]['limit']);_0x46f0b6[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0x3da02d[_0x70ea('0x3b')][_0x70ea('0x23')]);}_0x46f0b6['order']=qs['sort'](_0x3da02d[_0x70ea('0x3b')][_0x70ea('0x42')]);_0x46f0b6[_0x70ea('0x43')]=qs[_0x70ea('0x3c')](_['pick'](_0x3da02d[_0x70ea('0x3b')],_0x5f4fac['filters']));_0x46f0b6[_0x70ea('0x43')][_0x70ea('0x64')]=_0x989388['id'];if(_0x3da02d[_0x70ea('0x3b')]['filter']){_0x46f0b6[_0x70ea('0x43')]=_['merge'](_0x46f0b6[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x46f0b6['attributes'],function(_0x41863a){var _0x5e697c={};_0x5e697c[_0x41863a]={'$like':'%'+_0x3da02d['query'][_0x70ea('0x45')]+'%'};return _0x5e697c;})});}_0x46f0b6=_['merge']({},_0x46f0b6,_0x3da02d[_0x70ea('0x47')]);return db['CmHopperHistory'][_0x70ea('0x22')]({'where':_0x46f0b6[_0x70ea('0x43')]})['then'](function(_0x4e1784){_0x54b30e[_0x70ea('0x22')]=_0x4e1784;if(_0x3da02d['query'][_0x70ea('0x50')]){_0x46f0b6[_0x70ea('0x48')]=[{'all':!![]}];}return db[_0x70ea('0x66')]['findAll'](_0x46f0b6);})['then'](function(_0x53ac2c){_0x54b30e[_0x70ea('0x67')]=_0x53ac2c;return _0x54b30e;});}})[_0x70ea('0x27')](respondWithFilteredResult(_0x2023c7,_0x46f0b6))[_0x70ea('0x4a')](handleError(_0x2023c7,null));};exports[_0x70ea('0x68')]=function(_0x217242,_0x28d483,_0x1a07f8){var _0x56bfba={'raw':!![],'where':{}};var _0x3ce2ce={};var _0x5a1bb2={'count':0x0,'rows':[]};return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x217242[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x28d483,null))[_0x70ea('0x27')](function(_0x722087){if(_0x722087){_0x3ce2ce[_0x70ea('0x3a')]=_['keys'](db[_0x70ea('0x69')][_0x70ea('0x4e')]);_0x3ce2ce[_0x70ea('0x3b')]=_[_0x70ea('0x4d')](_0x217242['query']);_0x3ce2ce['filters']=_[_0x70ea('0x3d')](_0x3ce2ce['model'],_0x3ce2ce[_0x70ea('0x3b')]);_0x56bfba['attributes']=_[_0x70ea('0x3d')](_0x3ce2ce[_0x70ea('0x3a')],qs[_0x70ea('0x3f')](_0x217242[_0x70ea('0x3b')][_0x70ea('0x3f')]));_0x56bfba[_0x70ea('0x3e')]=_0x56bfba[_0x70ea('0x3e')]['length']?_0x56bfba[_0x70ea('0x3e')]:_0x3ce2ce[_0x70ea('0x3a')];if(!_0x217242[_0x70ea('0x3b')]['hasOwnProperty'](_0x70ea('0x63'))){_0x56bfba[_0x70ea('0x24')]=qs['limit'](_0x217242[_0x70ea('0x3b')][_0x70ea('0x24')]);_0x56bfba[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0x217242['query'][_0x70ea('0x23')]);}_0x56bfba[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0x217242[_0x70ea('0x3b')][_0x70ea('0x42')]);_0x56bfba[_0x70ea('0x43')]=qs[_0x70ea('0x3c')](_['pick'](_0x217242[_0x70ea('0x3b')],_0x3ce2ce['filters']));_0x56bfba[_0x70ea('0x43')][_0x70ea('0x64')]=_0x722087['id'];if(_0x217242[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x56bfba[_0x70ea('0x43')]=_[_0x70ea('0x51')](_0x56bfba[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x56bfba[_0x70ea('0x3e')],function(_0x1cbb49){var _0x364dcb={};_0x364dcb[_0x1cbb49]={'$like':'%'+_0x217242['query']['filter']+'%'};return _0x364dcb;})});}_0x56bfba=_[_0x70ea('0x51')]({},_0x56bfba,_0x217242[_0x70ea('0x47')]);return db[_0x70ea('0x69')][_0x70ea('0x22')]({'where':_0x56bfba['where']})[_0x70ea('0x27')](function(_0x251141){_0x5a1bb2[_0x70ea('0x22')]=_0x251141;if(_0x217242['query'][_0x70ea('0x50')]){_0x56bfba[_0x70ea('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x70ea('0x49')](_0x56bfba);})[_0x70ea('0x27')](function(_0x9acacf){_0x5a1bb2[_0x70ea('0x67')]=_0x9acacf;return _0x5a1bb2;});}})[_0x70ea('0x27')](respondWithFilteredResult(_0x28d483,_0x56bfba))[_0x70ea('0x4a')](handleError(_0x28d483,null));};exports[_0x70ea('0x6a')]=function(_0x412740,_0x3ccc0b,_0xc25094){var _0x4c77a5={'raw':!![],'where':{}};var _0x365448={};var _0x2743ad={'count':0x0,'rows':[]};return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x412740[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x3ccc0b,null))[_0x70ea('0x27')](function(_0x27995e){if(_0x27995e){_0x365448[_0x70ea('0x3a')]=_['keys'](db['CmHopperBlack'][_0x70ea('0x4e')]);_0x365448[_0x70ea('0x3b')]=_[_0x70ea('0x4d')](_0x412740['query']);_0x365448[_0x70ea('0x3c')]=_[_0x70ea('0x3d')](_0x365448['model'],_0x365448[_0x70ea('0x3b')]);_0x4c77a5[_0x70ea('0x3e')]=_[_0x70ea('0x3d')](_0x365448[_0x70ea('0x3a')],qs[_0x70ea('0x3f')](_0x412740['query'][_0x70ea('0x3f')]));_0x4c77a5[_0x70ea('0x3e')]=_0x4c77a5[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x4c77a5[_0x70ea('0x3e')]:_0x365448[_0x70ea('0x3a')];if(!_0x412740[_0x70ea('0x3b')]['hasOwnProperty'](_0x70ea('0x63'))){_0x4c77a5['limit']=qs[_0x70ea('0x24')](_0x412740['query'][_0x70ea('0x24')]);_0x4c77a5['offset']=qs[_0x70ea('0x23')](_0x412740[_0x70ea('0x3b')][_0x70ea('0x23')]);}_0x4c77a5[_0x70ea('0x41')]=qs['sort'](_0x412740[_0x70ea('0x3b')][_0x70ea('0x42')]);_0x4c77a5[_0x70ea('0x43')]=qs[_0x70ea('0x3c')](_['pick'](_0x412740[_0x70ea('0x3b')],_0x365448[_0x70ea('0x3c')]));_0x4c77a5[_0x70ea('0x43')][_0x70ea('0x64')]=_0x27995e['id'];if(_0x412740[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x4c77a5[_0x70ea('0x43')]=_[_0x70ea('0x51')](_0x4c77a5[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x4c77a5['attributes'],function(_0x3d0c61){var _0x376b00={};_0x376b00[_0x3d0c61]={'$like':'%'+_0x412740[_0x70ea('0x3b')][_0x70ea('0x45')]+'%'};return _0x376b00;})});}_0x4c77a5=_['merge']({},_0x4c77a5,_0x412740[_0x70ea('0x47')]);return db[_0x70ea('0x6b')][_0x70ea('0x22')]({'where':_0x4c77a5['where']})['then'](function(_0x392a2b){_0x2743ad['count']=_0x392a2b;if(_0x412740['query']['includeAll']){_0x4c77a5[_0x70ea('0x48')]=[{'all':!![]}];}return db[_0x70ea('0x6b')][_0x70ea('0x49')](_0x4c77a5);})[_0x70ea('0x27')](function(_0x37f2aa){_0x2743ad[_0x70ea('0x67')]=_0x37f2aa;return _0x2743ad;});}})[_0x70ea('0x27')](respondWithFilteredResult(_0x3ccc0b,_0x4c77a5))['catch'](handleError(_0x3ccc0b,null));};exports[_0x70ea('0x6c')]=function(_0x2e5f72,_0x34f2a0,_0x1f3a9d){var _0x316001={};var _0x2633c4={};var _0x2466e8;var _0xae7ab3;return db['VoiceQueue'][_0x70ea('0x62')]({'where':{'id':_0x2e5f72[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x34f2a0,null))[_0x70ea('0x27')](function(_0x18db14){if(_0x18db14){_0x2466e8=_0x18db14;_0x2633c4[_0x70ea('0x3a')]=_[_0x70ea('0x4d')](db['Team'][_0x70ea('0x4e')]);_0x2633c4[_0x70ea('0x3b')]=_[_0x70ea('0x4d')](_0x2e5f72[_0x70ea('0x3b')]);_0x2633c4[_0x70ea('0x3c')]=_[_0x70ea('0x3d')](_0x2633c4[_0x70ea('0x3a')],_0x2633c4[_0x70ea('0x3b')]);_0x316001[_0x70ea('0x3e')]=_['intersection'](_0x2633c4[_0x70ea('0x3a')],qs[_0x70ea('0x3f')](_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x3f')]));_0x316001['attributes']=_0x316001[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x316001['attributes']:_0x2633c4[_0x70ea('0x3a')];_0x316001[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x42')]);_0x316001[_0x70ea('0x43')]=qs['filters'](_[_0x70ea('0x44')](_0x2e5f72[_0x70ea('0x3b')],_0x2633c4[_0x70ea('0x3c')]));if(_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x316001['where']=_['merge'](_0x316001[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x316001[_0x70ea('0x3e')],function(_0x2a18fa){var _0x220662={};_0x220662[_0x2a18fa]={'$like':'%'+_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x45')]+'%'};return _0x220662;})});}_0x316001=_[_0x70ea('0x51')]({},_0x316001,_0x2e5f72[_0x70ea('0x47')]);return _0x2466e8[_0x70ea('0x6c')](_0x316001);}})['then'](function(_0x56fa7f){if(_0x56fa7f){_0xae7ab3=_0x56fa7f[_0x70ea('0x4f')];if(!_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x40')](_0x70ea('0x63'))){_0x316001[_0x70ea('0x24')]=qs[_0x70ea('0x24')](_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x24')]);_0x316001[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0x2e5f72[_0x70ea('0x3b')][_0x70ea('0x23')]);}return _0x2466e8[_0x70ea('0x6c')](_0x316001);}})[_0x70ea('0x27')](function(_0x251f04){if(_0x251f04){return _0x251f04?{'count':_0xae7ab3,'rows':_0x251f04}:null;}})[_0x70ea('0x27')](respondWithResult(_0x34f2a0,null))[_0x70ea('0x4a')](handleError(_0x34f2a0,null));};exports[_0x70ea('0x6d')]=function(_0x80a413,_0x21af05,_0x5defa4){var _0x468502=_0x80a413[_0x70ea('0x5d')]['teams'];var _0x4cb14f=_[_0x70ea('0x2f')](_0x468502,'id');return db[_0x70ea('0x6e')][_0x70ea('0x49')]({'where':{'id':_0x4cb14f},'attributes':['id'],'include':[{'model':db[_0x70ea('0x6f')],'as':_0x70ea('0x70'),'attributes':['id',_0x70ea('0x35'),_0x70ea('0x71'),_0x70ea('0x72'),_0x70ea('0x73')],'raw':!![]}]})['then'](function(_0x137d14){if(_0x137d14){var _0x2b489a=_[_0x70ea('0x74')](_0x137d14,function(_0x157c9a){var _0x20949b=_0x157c9a[_0x70ea('0x29')]({'plain':!![]});_0x20949b[_0x70ea('0x70')][_0x70ea('0x75')](function(_0x289b2b){_0x289b2b[_0x70ea('0x76')]=_[_0x70ea('0x52')](_0x468502,{'id':_0x20949b['id']})[_0x70ea('0x76')];});return _0x20949b[_0x70ea('0x70')];});return db['VoiceQueue'][_0x70ea('0x52')]({'where':{'id':_0x80a413[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](function(_0xc99d88){return db[_0x70ea('0x77')][_0x70ea('0x78')](function(_0xe66a08){return _0xc99d88[_0x70ea('0x6d')](_0x4cb14f,{'transaction':_0xe66a08})[_0x70ea('0x27')](function(){return BPromise[_0x70ea('0x79')](_0x2b489a,function(_0x45f412){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x45f412['id'],'VoiceQueueId':_0x80a413[_0x70ea('0x4c')]['id']},'defaults':{'penalty':_0x45f412[_0x70ea('0x76')]},'transaction':_0xe66a08});});})[_0x70ea('0x27')](function(){return BPromise[_0x70ea('0x79')](_[_0x70ea('0x45')](_0x2b489a,{'online':!![]}),function(_0x3c6eb7){return db[_0x70ea('0x7a')][_0x70ea('0x7b')]({'membername':_0x3c6eb7[_0x70ea('0x35')],'UserId':_0x3c6eb7['id'],'queue_name':_0xc99d88[_0x70ea('0x35')],'VoiceQueueId':_0xc99d88['id'],'interface':_[_0x70ea('0x7c')](_0x3c6eb7[_0x70ea('0x73')])?util['format'](_0x70ea('0x7d'),_0x3c6eb7['name']):_0x3c6eb7[_0x70ea('0x73')],'paused':_0x3c6eb7[_0x70ea('0x72')]||![],'penalty':_0x3c6eb7[_0x70ea('0x76')]},{'transaction':_0xe66a08});});})[_0x70ea('0x27')](function(){_0x2b489a[_0x70ea('0x75')](function(_0x17443d){socket['emit'](_0x70ea('0x7e'),{'UserId':_0x17443d['id'],'VoiceQueueId':_0xc99d88['id']});});});});});}})[_0x70ea('0x27')](respondWithStatusCode(_0x21af05,null))[_0x70ea('0x4a')](handleError(_0x21af05,null));};exports['removeTeams']=function(_0x5d84cd,_0x4ba24d,_0x2ea418){return db[_0x70ea('0x6e')][_0x70ea('0x49')]({'where':{'id':_0x5d84cd[_0x70ea('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0x70ea('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x70ea('0x27')](handleEntityNotFound(_0x4ba24d,null))['then'](function(_0xda00b){var _0x3a5d64=_[_0x70ea('0x2f')](_0xda00b,'id');var _0x117cb0=[];var _0x1481d6=[];var _0x166aee=squel[_0x70ea('0x7f')]();_0x166aee['field'](_0x70ea('0x80'))[_0x70ea('0x81')](_0x70ea('0x82'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x70ea('0x43')](_0x70ea('0x83'),_0x5d84cd[_0x70ea('0x4c')]['id']);for(var _0x5e3597=0x0;_0x5e3597<_0xda00b[_0x70ea('0x4f')];_0x5e3597+=0x1){let _0x228804=_0xda00b[_0x5e3597];for(var _0x157d23=0x0;_0x157d23<_0x228804[_0x70ea('0x70')][_0x70ea('0x4f')];_0x157d23+=0x1){let _0x1532f4=_0x228804['Agents'][_0x157d23];var _0x422c7b=_0x166aee['clone']();_0x422c7b[_0x70ea('0x43')]('ut.UserId\x20=\x20?',_0x1532f4['id']);_0x1481d6[_0x70ea('0x84')](db[_0x70ea('0x77')][_0x70ea('0x3b')](_0x422c7b[_0x70ea('0x85')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x70ea('0x27')](function(_0x3324a1){if(_0x3324a1['length']===0x1){return _0x1532f4['id'];}else{var _0x29ff8c=_[_0x70ea('0x86')](_[_0x70ea('0x2f')](_0x3324a1,_0x70ea('0x87')),function(_0x4d4f78){return _[_0x70ea('0x31')](_0x3a5d64,_0x4d4f78);});if(_0x29ff8c){return _0x1532f4['id'];}}}));}}return BPromise['all'](_0x1481d6)[_0x70ea('0x27')](function(_0x2761f0){_0x117cb0=_(_0x117cb0)['union'](_0x2761f0)[_0x70ea('0x88')]()[_0x70ea('0x30')]();return db[_0x70ea('0x38')][_0x70ea('0x52')]({'where':{'id':_0x5d84cd[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](function(_0x518c0a){return db[_0x70ea('0x77')][_0x70ea('0x78')](function(_0x154fb6){return _0x518c0a['removeTeams'](_0x5d84cd['query'][_0x70ea('0x89')],{'transaction':_0x154fb6})['then'](function(){if(!_[_0x70ea('0x8a')](_0x117cb0)){return _0x518c0a[_0x70ea('0x8b')](_0x117cb0,{'transaction':_0x154fb6})[_0x70ea('0x27')](function(){return db['UserVoiceQueueRt'][_0x70ea('0x28')]({'where':{'VoiceQueueId':_0x5d84cd[_0x70ea('0x4c')]['id'],'UserId':_0x117cb0},'transaction':_0x154fb6});});}})[_0x70ea('0x27')](function(){_0x117cb0[_0x70ea('0x75')](function(_0x34fe9c){socket[_0x70ea('0x8c')]('userVoiceQueue:remove',{'UserId':_0x34fe9c,'VoiceQueueId':_0x518c0a['id']});});});});});});})[_0x70ea('0x27')](respondWithStatusCode(_0x4ba24d,null))[_0x70ea('0x4a')](handleError(_0x4ba24d,null));};exports[_0x70ea('0x8d')]=function(_0x4beacf,_0x2af96c,_0x4ee5be){var _0x2097c7,_0x2ed54c;return db[_0x70ea('0x38')]['find']({'where':{'id':_0x4beacf[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x2af96c,null))['then'](function(_0x266f4a){if(_0x266f4a){_0x2ed54c=_0x266f4a;return _0x266f4a[_0x70ea('0x8d')](_0x4beacf[_0x70ea('0x5d')]['ids'],_[_0x70ea('0x5b')](_0x4beacf[_0x70ea('0x5d')],[_0x70ea('0x89'),'id'])||{})[_0x70ea('0x8e')](function(_0x4acb89){for(var _0x5c699f=0x0;_0x5c699f<_0x4beacf[_0x70ea('0x5d')]['ids'][_0x70ea('0x4f')];_0x5c699f+=0x1){socket[_0x70ea('0x8c')](_0x70ea('0x7e'),{'UserId':_0x4beacf[_0x70ea('0x5d')][_0x70ea('0x89')][_0x5c699f],'VoiceQueueId':_0x4beacf[_0x70ea('0x4c')]['id']});}return _0x4acb89;});}})[_0x70ea('0x27')](function(_0x2fa51e){_0x2097c7=_0x2fa51e||[];if(_0x2ed54c){return db[_0x70ea('0x6f')][_0x70ea('0x49')]({'where':{'id':_0x4beacf[_0x70ea('0x5d')][_0x70ea('0x89')]},'attributes':['id',_0x70ea('0x35'),'online',_0x70ea('0x72'),'interface'],'raw':!![]});}})[_0x70ea('0x27')](function(_0x2ad304){if(!_[_0x70ea('0x8a')](_0x2ad304)){var _0x52af95=[];for(var _0x2cbc2f=0x0;_0x2cbc2f<_0x2ad304[_0x70ea('0x4f')];_0x2cbc2f++){if(_0x2ad304[_0x2cbc2f]['online']){_0x52af95[_0x70ea('0x84')](db[_0x70ea('0x7a')][_0x70ea('0x7b')]({'membername':_0x2ad304[_0x2cbc2f][_0x70ea('0x35')],'UserId':_0x2ad304[_0x2cbc2f]['id'],'queue_name':_0x2ed54c[_0x70ea('0x35')],'VoiceQueueId':_0x2ed54c['id'],'interface':_[_0x70ea('0x7c')](_0x2ad304[_0x2cbc2f][_0x70ea('0x73')])?util[_0x70ea('0x8f')](_0x70ea('0x7d'),_0x2ad304[_0x2cbc2f][_0x70ea('0x35')]):_0x2ad304[_0x2cbc2f][_0x70ea('0x73')],'paused':_0x2ad304[_0x2cbc2f][_0x70ea('0x72')]||![],'penalty':_0x4beacf[_0x70ea('0x5d')][_0x70ea('0x76')]||0x0}));}}return BPromise[_0x70ea('0x90')](_0x52af95);}})[_0x70ea('0x27')](function(){return _0x2097c7;})[_0x70ea('0x27')](respondWithResult(_0x2af96c,null))[_0x70ea('0x4a')](handleError(_0x2af96c,null));};exports[_0x70ea('0x8b')]=function(_0xc43895,_0x154a01,_0x55c270){return db[_0x70ea('0x38')][_0x70ea('0x52')]({'where':{'id':_0xc43895[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x154a01,null))[_0x70ea('0x27')](function(_0x2541ff){if(_0x2541ff){return _0x2541ff[_0x70ea('0x8b')](_0xc43895[_0x70ea('0x3b')]['ids'])[_0x70ea('0x27')](function(){if(_['isArray'](_0xc43895['query'][_0x70ea('0x89')])){for(var _0x3836f7=0x0;_0x3836f7<_0xc43895[_0x70ea('0x3b')][_0x70ea('0x89')][_0x70ea('0x4f')];_0x3836f7+=0x1){socket[_0x70ea('0x8c')](_0x70ea('0x91'),{'UserId':Number(_0xc43895['query']['ids'][_0x3836f7]),'VoiceQueueId':Number(_0xc43895['params']['id'])});}}else{socket[_0x70ea('0x8c')](_0x70ea('0x91'),{'UserId':Number(_0xc43895[_0x70ea('0x3b')][_0x70ea('0x89')]),'VoiceQueueId':Number(_0xc43895[_0x70ea('0x4c')]['id'])});}});}})[_0x70ea('0x27')](function(_0x3d3139){return db[_0x70ea('0x7a')][_0x70ea('0x28')]({'where':{'VoiceQueueId':_0xc43895[_0x70ea('0x4c')]['id'],'UserId':_0xc43895['query']['ids']}})[_0x70ea('0x27')](function(){return _0x3d3139;});})['then'](respondWithStatusCode(_0x154a01,null))[_0x70ea('0x4a')](handleError(_0x154a01,null));};exports[_0x70ea('0x92')]=function(_0xede346,_0x2b68aa,_0x3d97eb){var _0x1fb546={};var _0x4e8c31={};var _0x12ad91;var _0x479cec;return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0xede346[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x2b68aa,null))['then'](function(_0x3a4852){if(_0x3a4852){_0x12ad91=_0x3a4852;_0x4e8c31[_0x70ea('0x3a')]=_[_0x70ea('0x4d')](db[_0x70ea('0x6f')][_0x70ea('0x4e')]);_0x4e8c31['query']=_['keys'](_0xede346[_0x70ea('0x3b')]);_0x4e8c31[_0x70ea('0x3c')]=_[_0x70ea('0x3d')](_0x4e8c31['model'],_0x4e8c31[_0x70ea('0x3b')]);_0x1fb546['attributes']=_['intersection'](_0x4e8c31['model'],qs[_0x70ea('0x3f')](_0xede346[_0x70ea('0x3b')][_0x70ea('0x3f')]));_0x1fb546[_0x70ea('0x3e')]=_0x1fb546[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x1fb546[_0x70ea('0x3e')]:_0x4e8c31[_0x70ea('0x3a')];_0x1fb546[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0xede346[_0x70ea('0x3b')]['sort']);_0x1fb546[_0x70ea('0x43')]=qs['filters'](_['pick'](_0xede346['query'],_0x4e8c31['filters']));if(_0xede346['query']['filter']){_0x1fb546[_0x70ea('0x43')]=_[_0x70ea('0x51')](_0x1fb546[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x1fb546['attributes'],function(_0x3e866){var _0x2bb629={};_0x2bb629[_0x3e866]={'$like':'%'+_0xede346[_0x70ea('0x3b')][_0x70ea('0x45')]+'%'};return _0x2bb629;})});}_0x1fb546=_[_0x70ea('0x51')]({},_0x1fb546,_0xede346[_0x70ea('0x47')]);return _0x12ad91[_0x70ea('0x92')](_0x1fb546);}})[_0x70ea('0x27')](function(_0x23e30){if(_0x23e30){_0x479cec=_0x23e30['length'];if(!_0xede346[_0x70ea('0x3b')][_0x70ea('0x40')](_0x70ea('0x63'))){_0x1fb546[_0x70ea('0x24')]=qs['limit'](_0xede346[_0x70ea('0x3b')][_0x70ea('0x24')]);_0x1fb546[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0xede346[_0x70ea('0x3b')][_0x70ea('0x23')]);}return _0x12ad91['getAgents'](_0x1fb546);}})['then'](function(_0x54a40e){if(_0x54a40e){return _0x54a40e?{'count':_0x479cec,'rows':_0x54a40e}:null;}})[_0x70ea('0x27')](respondWithResult(_0x2b68aa,null))['catch'](handleError(_0x2b68aa,null));};exports[_0x70ea('0x93')]=function(_0x5362bf,_0x59a472,_0x35eadf){var _0x5f0d59={};var _0x208958={};var _0x27f26c;var _0x799ec8;return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x5362bf[_0x70ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x59a472,null))['then'](function(_0x59ffb9){if(_0x59ffb9){_0x27f26c=_0x59ffb9;_0x208958[_0x70ea('0x3a')]=_['keys'](db[_0x70ea('0x7a')]['rawAttributes']);_0x208958[_0x70ea('0x3b')]=_['keys'](_0x5362bf['query']);_0x208958[_0x70ea('0x3c')]=_['intersection'](_0x208958['model'],_0x208958['query']);_0x5f0d59['attributes']=_[_0x70ea('0x3d')](_0x208958[_0x70ea('0x3a')],qs[_0x70ea('0x3f')](_0x5362bf['query'][_0x70ea('0x3f')]));_0x5f0d59['attributes']=_0x5f0d59[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x5f0d59[_0x70ea('0x3e')]:_0x208958[_0x70ea('0x3a')];_0x5f0d59[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0x5362bf[_0x70ea('0x3b')]['sort']);_0x5f0d59['where']=qs[_0x70ea('0x3c')](_[_0x70ea('0x44')](_0x5362bf[_0x70ea('0x3b')],_0x208958[_0x70ea('0x3c')]));if(_0x5362bf[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x5f0d59[_0x70ea('0x43')]=_[_0x70ea('0x51')](_0x5f0d59[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0x5f0d59['attributes'],function(_0x13b0f2){var _0x58c4c3={};_0x58c4c3[_0x13b0f2]={'$like':'%'+_0x5362bf[_0x70ea('0x3b')][_0x70ea('0x45')]+'%'};return _0x58c4c3;})});}_0x5f0d59=_[_0x70ea('0x51')]({},_0x5f0d59,_0x5362bf['options']);return _0x27f26c[_0x70ea('0x93')](_0x5f0d59);}})[_0x70ea('0x27')](function(_0x1c4bf){if(_0x1c4bf){_0x799ec8=_0x1c4bf['length'];if(!_0x5362bf[_0x70ea('0x3b')]['hasOwnProperty']('nolimit')){_0x5f0d59[_0x70ea('0x24')]=qs[_0x70ea('0x24')](_0x5362bf[_0x70ea('0x3b')]['limit']);_0x5f0d59[_0x70ea('0x23')]=qs['offset'](_0x5362bf['query'][_0x70ea('0x23')]);}return _0x27f26c[_0x70ea('0x93')](_0x5f0d59);}})[_0x70ea('0x27')](function(_0x24feed){return _0x24feed?{'count':_0x799ec8,'rows':_0x24feed}:null;})[_0x70ea('0x27')](respondWithResult(_0x59a472,null))['catch'](handleError(_0x59a472,null));};exports[_0x70ea('0x94')]=function(_0x5e13d0,_0x46783a,_0x3f576f){var _0x1289a7={};var _0x147d53={};var _0x4ca29d;var _0x676c2a;return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x5e13d0['params']['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x46783a,null))[_0x70ea('0x27')](function(_0x3a9973){if(_0x3a9973){_0x4ca29d=_0x3a9973;_0x147d53['model']=_[_0x70ea('0x4d')](db[_0x70ea('0x95')][_0x70ea('0x4e')]);_0x147d53[_0x70ea('0x3b')]=_[_0x70ea('0x4d')](_0x5e13d0[_0x70ea('0x3b')]);_0x147d53[_0x70ea('0x3c')]=_['intersection'](_0x147d53['model'],_0x147d53['query']);_0x1289a7['attributes']=_[_0x70ea('0x3d')](_0x147d53['model'],qs[_0x70ea('0x3f')](_0x5e13d0[_0x70ea('0x3b')]['fields']));_0x1289a7['attributes']=_0x1289a7[_0x70ea('0x3e')][_0x70ea('0x4f')]?_0x1289a7[_0x70ea('0x3e')]:_0x147d53[_0x70ea('0x3a')];_0x1289a7[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0x5e13d0['query']['sort']);_0x1289a7[_0x70ea('0x43')]=qs[_0x70ea('0x3c')](_[_0x70ea('0x44')](_0x5e13d0[_0x70ea('0x3b')],_0x147d53[_0x70ea('0x3c')]));if(_0x5e13d0[_0x70ea('0x3b')][_0x70ea('0x45')]){_0x1289a7[_0x70ea('0x43')]=_['merge'](_0x1289a7['where'],{'$or':_[_0x70ea('0x2f')](_0x1289a7[_0x70ea('0x3e')],function(_0x50e433){var _0xae9aba={};_0xae9aba[_0x50e433]={'$like':'%'+_0x5e13d0[_0x70ea('0x3b')]['filter']+'%'};return _0xae9aba;})});}_0x1289a7=_[_0x70ea('0x51')]({},_0x1289a7,_0x5e13d0[_0x70ea('0x47')]);return _0x4ca29d['getLists'](_0x1289a7);}})[_0x70ea('0x27')](function(_0x31e137){if(_0x31e137){_0x676c2a=_0x31e137['length'];if(!_0x5e13d0[_0x70ea('0x3b')][_0x70ea('0x40')]('nolimit')){_0x1289a7[_0x70ea('0x24')]=qs[_0x70ea('0x24')](_0x5e13d0[_0x70ea('0x3b')][_0x70ea('0x24')]);_0x1289a7[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0x5e13d0[_0x70ea('0x3b')][_0x70ea('0x23')]);}return _0x4ca29d[_0x70ea('0x94')](_0x1289a7);}})[_0x70ea('0x27')](function(_0x4d1685){if(_0x4d1685){return _0x4d1685?{'count':_0x676c2a,'rows':_0x4d1685}:null;}})['then'](respondWithResult(_0x46783a,null))[_0x70ea('0x4a')](handleError(_0x46783a,null));};exports[_0x70ea('0x96')]=function(_0x5db266,_0x4da8f2,_0x213cd4){var _0x3ea542,_0x5831fe;return db[_0x70ea('0x38')]['find']({'where':{'id':_0x5db266[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x4da8f2,null))['then'](function(_0x5c4dc6){if(_0x5c4dc6){_0x5831fe=_0x5c4dc6;return _0x5c4dc6[_0x70ea('0x96')](_0x5db266[_0x70ea('0x5d')][_0x70ea('0x89')],_['omit'](_0x5db266[_0x70ea('0x5d')],['ids','id'])||{});}return null;})[_0x70ea('0x8e')](function(_0x150775){var _0x100724;_0x3ea542=_0x150775||[];var _0x4db76d=[];if(_0x150775){for(var _0x87a737=0x0;_0x87a737<_0x150775[_0x70ea('0x4f')];_0x87a737+=0x1){var _0x1e1947=_0x150775[_0x87a737][_0x70ea('0x29')]({'plain':!![]});_0x5831fe[_0x70ea('0x97')]=_0x5db266[_0x70ea('0x5d')][_0x70ea('0x97')]?_0x5db266[_0x70ea('0x5d')]['dialCheckDuplicateType']:_0x5831fe[_0x70ea('0x97')];switch(_0x5831fe['dialCheckDuplicateType']){case _0x70ea('0x98'):_0x100724=squel['insert']()[_0x70ea('0x99')](_0x70ea('0x9a'))['fromQuery']([_0x70ea('0x9b'),_0x70ea('0x9c'),'ContactId',_0x70ea('0x9d'),_0x70ea('0x64'),_0x70ea('0x5c'),_0x70ea('0x5e')],squel[_0x70ea('0x7f')]()[_0x70ea('0x9e')](_0x70ea('0x9b'),_0x70ea('0x9b'))[_0x70ea('0x9e')]('NOW()',_0x70ea('0x9c'))['field']('id','ContactId')[_0x70ea('0x9e')](_0x1e1947[_0x70ea('0x9f')][_0x70ea('0x85')](),_0x70ea('0x9d'))[_0x70ea('0x9e')](_0x5db266[_0x70ea('0x4c')]['id']['toString'](),_0x70ea('0x64'))[_0x70ea('0x9e')]('NOW()',_0x70ea('0x5c'))['field']('NOW()',_0x70ea('0x5e'))[_0x70ea('0x81')](_0x70ea('0xa0'))[_0x70ea('0x43')]('deletedAt\x20IS\x20NULL')['where'](_0x70ea('0xa1'),_0x1e1947[_0x70ea('0x9f')][_0x70ea('0x85')]())[_0x70ea('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x70ea('0x43')](_0x70ea('0xa2'),squel[_0x70ea('0x7f')]()[_0x70ea('0x9e')](_0x70ea('0xa3'))[_0x70ea('0x81')](_0x70ea('0xa4'))[_0x70ea('0x43')](_0x70ea('0x83'),_0x5db266['params']['id']['toString']()))[_0x70ea('0x43')](_0x70ea('0xa2'),squel[_0x70ea('0x7f')]()[_0x70ea('0x9e')]('COALESCE(phone,\x27\x27)')[_0x70ea('0x81')](_0x70ea('0x9a'))[_0x70ea('0x43')](_0x70ea('0x83'),_0x5db266[_0x70ea('0x4c')]['id'][_0x70ea('0x85')]())))[_0x70ea('0x85')]();break;case _0x70ea('0xa5'):_0x100724=squel[_0x70ea('0xa6')]()[_0x70ea('0x99')](_0x70ea('0x9a'))[_0x70ea('0xa7')](['phone','scheduledAt',_0x70ea('0xa8'),'ListId',_0x70ea('0x64'),_0x70ea('0x5c'),_0x70ea('0x5e')],squel[_0x70ea('0x7f')]()[_0x70ea('0x9e')](_0x70ea('0x9b'),_0x70ea('0x9b'))[_0x70ea('0x9e')](_0x70ea('0xa9'),_0x70ea('0x9c'))[_0x70ea('0x9e')]('id','ContactId')[_0x70ea('0x9e')](_0x1e1947[_0x70ea('0x9f')][_0x70ea('0x85')](),_0x70ea('0x9d'))['field'](_0x5db266[_0x70ea('0x4c')]['id'][_0x70ea('0x85')](),_0x70ea('0x64'))[_0x70ea('0x9e')](_0x70ea('0xa9'),_0x70ea('0x5c'))[_0x70ea('0x9e')](_0x70ea('0xa9'),_0x70ea('0x5e'))[_0x70ea('0x81')]('cm_contacts')[_0x70ea('0x43')](_0x70ea('0xaa'))['where']('ListId\x20=\x20?',_0x1e1947[_0x70ea('0x9f')][_0x70ea('0x85')]())[_0x70ea('0x43')]('phone\x20IS\x20NOT\x20NULL')[_0x70ea('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0x70ea('0x7f')]()[_0x70ea('0x9e')](_0x70ea('0xab'))[_0x70ea('0x81')](_0x70ea('0x9a'))[_0x70ea('0x43')](_0x70ea('0x83'),_0x5db266[_0x70ea('0x4c')]['id']['toString']())))[_0x70ea('0x85')]();break;default:_0x100724=squel[_0x70ea('0xa6')]()[_0x70ea('0x99')](_0x70ea('0x9a'))[_0x70ea('0xa7')]([_0x70ea('0x9b'),'scheduledAt','ContactId',_0x70ea('0x9d'),_0x70ea('0x64'),_0x70ea('0x5c'),'updatedAt'],squel[_0x70ea('0x7f')]()[_0x70ea('0x9e')](_0x70ea('0x9b'),_0x70ea('0x9b'))[_0x70ea('0x9e')](_0x70ea('0xa9'),_0x70ea('0x9c'))['field']('id',_0x70ea('0xa8'))[_0x70ea('0x9e')](_0x1e1947[_0x70ea('0x9f')][_0x70ea('0x85')](),_0x70ea('0x9d'))[_0x70ea('0x9e')](_0x5db266['params']['id']['toString'](),_0x70ea('0x64'))[_0x70ea('0x9e')]('NOW()',_0x70ea('0x5c'))['field'](_0x70ea('0xa9'),_0x70ea('0x5e'))[_0x70ea('0x81')](_0x70ea('0xa0'))['where'](_0x70ea('0xaa'))['where'](_0x70ea('0xa1'),_0x1e1947[_0x70ea('0x9f')][_0x70ea('0x85')]())[_0x70ea('0x43')](_0x70ea('0xac')))['toString']();}_0x4db76d[_0x70ea('0x84')](db[_0x70ea('0x77')][_0x70ea('0x3b')](_0x100724));}return BPromise[_0x70ea('0x90')](_0x4db76d);}})[_0x70ea('0x27')](function(){return _0x3ea542;})[_0x70ea('0x27')](respondWithResult(_0x4da8f2,null))[_0x70ea('0x4a')](handleError(_0x4da8f2,null));};exports[_0x70ea('0xad')]=function(_0x5b20b5,_0x43b310,_0x144efe){return db[_0x70ea('0x38')][_0x70ea('0x52')]({'where':{'id':_0x5b20b5[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x43b310,null))[_0x70ea('0x27')](function(_0x11aa0e){if(_0x11aa0e){return _0x11aa0e['removeLists'](_0x5b20b5[_0x70ea('0x3b')][_0x70ea('0x89')]);}})[_0x70ea('0x27')](function(_0x6d14b6){if(_0x6d14b6){return db['CmHopper'][_0x70ea('0x28')]({'where':{'ListId':_0x5b20b5[_0x70ea('0x3b')][_0x70ea('0x89')],'VoiceQueueId':_0x5b20b5[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](function(){return _0x6d14b6;});}})['then'](respondWithStatusCode(_0x43b310,null))[_0x70ea('0x4a')](handleError(_0x43b310,null));};exports[_0x70ea('0xae')]=function(_0x561fdd,_0x133a91,_0x5d20b4){var _0xef9a0={};var _0xc971f1={};var _0xc93f16;var _0x46d314;return db[_0x70ea('0x38')][_0x70ea('0x62')]({'where':{'id':_0x561fdd[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x133a91,null))[_0x70ea('0x27')](function(_0x200800){if(_0x200800){_0xc93f16=_0x200800;_0xc971f1[_0x70ea('0x3a')]=_[_0x70ea('0x4d')](db['CmList'][_0x70ea('0x4e')]);_0xc971f1[_0x70ea('0x3b')]=_['keys'](_0x561fdd['query']);_0xc971f1[_0x70ea('0x3c')]=_[_0x70ea('0x3d')](_0xc971f1[_0x70ea('0x3a')],_0xc971f1[_0x70ea('0x3b')]);_0xef9a0['attributes']=_[_0x70ea('0x3d')](_0xc971f1['model'],qs[_0x70ea('0x3f')](_0x561fdd[_0x70ea('0x3b')][_0x70ea('0x3f')]));_0xef9a0[_0x70ea('0x3e')]=_0xef9a0['attributes'][_0x70ea('0x4f')]?_0xef9a0[_0x70ea('0x3e')]:_0xc971f1['model'];_0xef9a0[_0x70ea('0x41')]=qs[_0x70ea('0x42')](_0x561fdd['query'][_0x70ea('0x42')]);_0xef9a0[_0x70ea('0x43')]=qs[_0x70ea('0x3c')](_[_0x70ea('0x44')](_0x561fdd[_0x70ea('0x3b')],_0xc971f1['filters']));if(_0x561fdd[_0x70ea('0x3b')][_0x70ea('0x45')]){_0xef9a0[_0x70ea('0x43')]=_['merge'](_0xef9a0[_0x70ea('0x43')],{'$or':_[_0x70ea('0x2f')](_0xef9a0['attributes'],function(_0x97c8fe){var _0x2673e3={};_0x2673e3[_0x97c8fe]={'$like':'%'+_0x561fdd[_0x70ea('0x3b')][_0x70ea('0x45')]+'%'};return _0x2673e3;})});}_0xef9a0=_[_0x70ea('0x51')]({},_0xef9a0,_0x561fdd[_0x70ea('0x47')]);return _0xc93f16[_0x70ea('0xae')](_0xef9a0);}})[_0x70ea('0x27')](function(_0x19e878){if(_0x19e878){_0x46d314=_0x19e878['length'];if(!_0x561fdd['query'][_0x70ea('0x40')](_0x70ea('0x63'))){_0xef9a0['limit']=qs['limit'](_0x561fdd[_0x70ea('0x3b')][_0x70ea('0x24')]);_0xef9a0[_0x70ea('0x23')]=qs[_0x70ea('0x23')](_0x561fdd[_0x70ea('0x3b')][_0x70ea('0x23')]);}return _0xc93f16['getBlackLists'](_0xef9a0);}})[_0x70ea('0x27')](function(_0x528943){if(_0x528943){return _0x528943?{'count':_0x46d314,'rows':_0x528943}:null;}})[_0x70ea('0x27')](respondWithResult(_0x133a91,null))[_0x70ea('0x4a')](handleError(_0x133a91,null));};exports[_0x70ea('0xaf')]=function(_0x26af77,_0x594595,_0x250d7c){var _0x2c8075,_0x3daf8e;return db[_0x70ea('0x38')][_0x70ea('0x52')]({'where':{'id':_0x26af77[_0x70ea('0x4c')]['id']}})[_0x70ea('0x27')](handleEntityNotFound(_0x594595,null))['then'](function(_0x577a9e){if(_0x577a9e){_0x3daf8e=_0x577a9e;return _0x577a9e['addBlackLists'](_0x26af77[_0x70ea('0x5d')][_0x70ea('0x89')],_[_0x70ea('0x5b')](_0x26af77[_0x70ea('0x5d')],[_0x70ea('0x89'),'id'])||{});}return null;})['spread'](function(_0x22f289){var _0x26f449;_0x2c8075=_0x22f289||[];var _0x2f4667=[];if(_0x22f289){for(var _0x5c2b8e=0x0;_0x5c2b8e<_0x22f289['length'];_0x5c2b8e+=0x1){var _0x1c7f8a=_0x22f289[_0x5c2b8e][_0x70ea('0x29')]({'plain':!![]});_0x26f449=squel[_0x70ea('0xa6')]()['into']('cm_hopper_black')[_0x70ea('0xa7')]([_0x70ea('0x9b'),_0x70ea('0xa8'),_0x70ea('0x9d'),'VoiceQueueId',_0x70ea('0x5c'),_0x70ea('0x5e')],squel[_0x70ea('0x7f')]()['field'](_0x70ea('0x9b'),_0x70ea('0x9b'))[_0x70ea('0x9e')]('id',_0x70ea('0xa8'))[_0x70ea('0x9e')](_0x1c7f8a[_0x70ea('0x9f')][_0x70ea('0x85')](),'ListId')[_0x70ea('0x9e')](_0x26af77[_0x70ea('0x4c')]['id'][_0x70ea('0x85')](),_0x70ea('0x64'))[_0x70ea('0x9e')]('NOW()',_0x70ea('0x5c'))[_0x70ea('0x9e')]('NOW()',_0x70ea('0x5e'))[_0x70ea('0x81')]('cm_contacts')['where'](_0x70ea('0xaa'))[_0x70ea('0x43')](_0x70ea('0xa1'),_0x1c7f8a[_0x70ea('0x9f')][_0x70ea('0x85')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x70ea('0x85')]();_0x2f4667[_0x70ea('0x84')](db[_0x70ea('0x77')]['query'](_0x26f449));}return BPromise[_0x70ea('0x90')](_0x2f4667);}})[_0x70ea('0x27')](function(){return _0x2c8075;})[_0x70ea('0x27')](respondWithResult(_0x594595,null))[_0x70ea('0x4a')](handleError(_0x594595,null));};exports[_0x70ea('0xb0')]=function(_0x319beb,_0x1f9125,_0x511361){return db[_0x70ea('0x38')][_0x70ea('0x52')]({'where':{'id':_0x319beb[_0x70ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1f9125,null))[_0x70ea('0x27')](function(_0x29fdf2){if(_0x29fdf2){return _0x29fdf2[_0x70ea('0xb0')](_0x319beb[_0x70ea('0x3b')][_0x70ea('0x89')]);}})['then'](function(_0x1a3750){if(_0x1a3750){return db['CmHopperBlack'][_0x70ea('0x28')]({'where':{'ListId':_0x319beb[_0x70ea('0x3b')][_0x70ea('0x89')],'VoiceQueueId':_0x319beb[_0x70ea('0x4c')]['id']}})['then'](function(){return _0x1a3750;});}})['then'](respondWithStatusCode(_0x1f9125,null))[_0x70ea('0x4a')](handleError(_0x1f9125,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 9ecc2c7..551c27f 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 _0x11fb=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x11fb,0x131));var _0xb11f=function(_0x37b74c,_0x3cddd7){_0x37b74c=_0x37b74c-0x0;var _0x2103e0=_0x11fb[_0x37b74c];return _0x2103e0;};'use strict';var EventEmitter=require(_0xb11f('0x0'));var VoiceQueue=require(_0xb11f('0x1'))['db'][_0xb11f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xb11f('0x3')](0x0);var events={'afterCreate':_0xb11f('0x4'),'afterUpdate':_0xb11f('0x5'),'afterDestroy':_0xb11f('0x6')};function emitEvent(_0x222a31){return function(_0x50f145,_0x332367,_0x4ef355){VoiceQueueEvents['emit'](_0x222a31+':'+_0x50f145['id'],_0x50f145);VoiceQueueEvents[_0xb11f('0x7')](_0x222a31,_0x50f145);_0x4ef355(null);};}for(var e in events){if(events[_0xb11f('0x8')](e)){var event=events[e];VoiceQueue[_0xb11f('0x9')](e,emitEvent(event));}}module[_0xb11f('0xa')]=VoiceQueueEvents; \ No newline at end of file +var _0xb26e=['setMaxListeners','save','update','emit','exports','../../mysqldb','VoiceQueue'];(function(_0x73fb6d,_0x1f160a){var _0xa96dd6=function(_0x35ac02){while(--_0x35ac02){_0x73fb6d['push'](_0x73fb6d['shift']());}};_0xa96dd6(++_0x1f160a);}(_0xb26e,0xb4));var _0xeb26=function(_0x2eefad,_0x378913){_0x2eefad=_0x2eefad-0x0;var _0x431c35=_0xb26e[_0x2eefad];return _0x431c35;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xeb26('0x0'))['db'][_0xeb26('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xeb26('0x2')](0x0);var events={'afterCreate':_0xeb26('0x3'),'afterUpdate':_0xeb26('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2c1e82){return function(_0x35f2ec,_0x4d9a29,_0x46000b){VoiceQueueEvents[_0xeb26('0x5')](_0x2c1e82+':'+_0x35f2ec['id'],_0x35f2ec);VoiceQueueEvents[_0xeb26('0x5')](_0x2c1e82,_0x35f2ec);_0x46000b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xeb26('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 4bf2613..77f8556 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 _0x06a6=['request-promise','rimraf','../../config/environment','./voiceQueue.attributes','define','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3d2804,_0x54dd91){var _0x162b77=function(_0x39cc7a){while(--_0x39cc7a){_0x3d2804['push'](_0x3d2804['shift']());}};_0x162b77(++_0x54dd91);}(_0x06a6,0x16f));var _0x606a=function(_0x4d4a61,_0x32075f){_0x4d4a61=_0x4d4a61-0x0;var _0x1b0b7d=_0x06a6[_0x4d4a61];return _0x1b0b7d;};'use strict';var _=require(_0x606a('0x0'));var util=require('util');var logger=require(_0x606a('0x1'))(_0x606a('0x2'));var moment=require(_0x606a('0x3'));var BPromise=require(_0x606a('0x4'));var rp=require(_0x606a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x606a('0x6'));var config=require(_0x606a('0x7'));var attributes=require(_0x606a('0x8'));module['exports']=function(_0x4738fc,_0x295bc2){return _0x4738fc[_0x606a('0x9')](_0x606a('0xa'),attributes,{'tableName':_0x606a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b26=['lodash','util','../../config/logger','api','moment','bluebird','path','./voiceQueue.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b26,0x168));var _0x67b2=function(_0x463b56,_0x38026e){_0x463b56=_0x463b56-0x0;var _0x1b47d6=_0x7b26[_0x463b56];return _0x1b47d6;};'use strict';var _=require(_0x67b2('0x0'));var util=require(_0x67b2('0x1'));var logger=require(_0x67b2('0x2'))(_0x67b2('0x3'));var moment=require(_0x67b2('0x4'));var BPromise=require(_0x67b2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67b2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x67b2('0x7'));module[_0x67b2('0x8')]=function(_0x498122,_0xd52dff){return _0x498122[_0x67b2('0x9')]('VoiceQueue',attributes,{'tableName':'voice_queues','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 d095ded..5789ae7 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 _0x4a87=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','limit','include','model','attributes','map','then','GetVoiceQueue','debug','ShowVoiceQueue','VoiceQueue','where','lodash','util','moment','bluebird','randomstring'];(function(_0x2a3c41,_0xbeb6c5){var _0x3e0621=function(_0x2f92b4){while(--_0x2f92b4){_0x2a3c41['push'](_0x2a3c41['shift']());}};_0x3e0621(++_0xbeb6c5);}(_0x4a87,0xe5));var _0x74a8=function(_0x3fe396,_0x5b8f0a){_0x3fe396=_0x3fe396-0x0;var _0x4a87aa=_0x4a87[_0x3fe396];return _0x4a87aa;};'use strict';var _=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var moment=require(_0x74a8('0x2'));var BPromise=require(_0x74a8('0x3'));var rs=require(_0x74a8('0x4'));var fs=require('fs');var Redis=require(_0x74a8('0x5'));var db=require(_0x74a8('0x6'))['db'];var utils=require(_0x74a8('0x7'));var logger=require(_0x74a8('0x8'))(_0x74a8('0x9'));var config=require(_0x74a8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x74a8('0xb')][_0x74a8('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x74a8('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74a8('0xd')]));require('./voiceQueue.socket')[_0x74a8('0xe')](socket);function respondWithRpcPromise(_0x260e2b,_0x15e6d7,_0x4ae9f1){return new BPromise(function(_0x5f34cd,_0x5b7554){return client['request'](_0x260e2b,_0x4ae9f1)['then'](function(_0x5f2553){logger[_0x74a8('0xf')](_0x74a8('0x10'),_0x15e6d7,_0x74a8('0x11'));logger['debug'](_0x74a8('0x12'),_0x15e6d7,_0x74a8('0x11'),JSON[_0x74a8('0x13')](_0x5f2553));if(_0x5f2553['error']){if(_0x5f2553[_0x74a8('0x14')][_0x74a8('0x15')]===0x1f4){logger[_0x74a8('0x14')](_0x74a8('0x10'),_0x15e6d7,_0x5f2553[_0x74a8('0x14')][_0x74a8('0x16')]);return _0x5b7554(_0x5f2553[_0x74a8('0x14')][_0x74a8('0x16')]);}logger[_0x74a8('0x14')](_0x74a8('0x10'),_0x15e6d7,_0x5f2553['error'][_0x74a8('0x16')]);return _0x5f34cd(_0x5f2553['error'][_0x74a8('0x16')]);}else{logger[_0x74a8('0xf')](_0x74a8('0x10'),_0x15e6d7,_0x74a8('0x11'));_0x5f34cd(_0x5f2553[_0x74a8('0x17')][_0x74a8('0x16')]);}})[_0x74a8('0x18')](function(_0x1de08e){logger['error'](_0x74a8('0x10'),_0x15e6d7,_0x1de08e);_0x5b7554(_0x1de08e);});});}exports['GetVoiceQueue']=function(_0x5af9cc){var _0x1046f3=this;return new Promise(function(_0x18992a,_0x494e75){return db['VoiceQueue'][_0x74a8('0x19')]({'raw':_0x5af9cc[_0x74a8('0x1a')]?_0x5af9cc[_0x74a8('0x1a')][_0x74a8('0x1b')]===undefined?!![]:![]:!![],'where':_0x5af9cc['options']?_0x5af9cc[_0x74a8('0x1a')]['where']||null:null,'attributes':_0x5af9cc[_0x74a8('0x1a')]?_0x5af9cc[_0x74a8('0x1a')]['attributes']||null:null,'limit':_0x5af9cc['options']?_0x5af9cc[_0x74a8('0x1a')][_0x74a8('0x1c')]||null:null,'include':_0x5af9cc[_0x74a8('0x1a')]?_0x5af9cc[_0x74a8('0x1a')][_0x74a8('0x1d')]?_['map'](_0x5af9cc[_0x74a8('0x1a')][_0x74a8('0x1d')],function(_0x97518){return{'model':db[_0x97518[_0x74a8('0x1e')]],'as':_0x97518['as'],'attributes':_0x97518[_0x74a8('0x1f')],'include':_0x97518[_0x74a8('0x1d')]?_[_0x74a8('0x20')](_0x97518[_0x74a8('0x1d')],function(_0x4610b5){return{'model':db[_0x4610b5['model']],'as':_0x4610b5['as'],'attributes':_0x4610b5[_0x74a8('0x1f')],'include':_0x4610b5[_0x74a8('0x1d')]?_['map'](_0x4610b5['include'],function(_0x2642df){return{'model':db[_0x2642df[_0x74a8('0x1e')]],'as':_0x2642df['as'],'attributes':_0x2642df[_0x74a8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x74a8('0x21')](function(_0x3063dd){logger[_0x74a8('0xf')](_0x74a8('0x22'),_0x5af9cc);logger[_0x74a8('0x23')]('GetVoiceQueue',_0x5af9cc,JSON[_0x74a8('0x13')](_0x3063dd));_0x18992a(_0x3063dd);})['catch'](function(_0x4873bb){logger[_0x74a8('0x14')]('GetVoiceQueue',_0x4873bb['message'],_0x5af9cc);_0x494e75(_0x1046f3[_0x74a8('0x14')](0x1f4,_0x4873bb['message']));});});};exports[_0x74a8('0x24')]=function(_0x429efc){var _0x2e1188=this;return new Promise(function(_0x58f361,_0xf1ce0b){return db[_0x74a8('0x25')]['find']({'raw':_0x429efc['options']?_0x429efc['options'][_0x74a8('0x1b')]===undefined?!![]:![]:!![],'where':_0x429efc['options']?_0x429efc['options'][_0x74a8('0x26')]||null:null,'attributes':_0x429efc[_0x74a8('0x1a')]?_0x429efc[_0x74a8('0x1a')]['attributes']||null:null,'include':_0x429efc[_0x74a8('0x1a')]?_0x429efc[_0x74a8('0x1a')]['include']?_[_0x74a8('0x20')](_0x429efc['options'][_0x74a8('0x1d')],function(_0x54cc1c){return{'model':db[_0x54cc1c[_0x74a8('0x1e')]],'as':_0x54cc1c['as'],'attributes':_0x54cc1c[_0x74a8('0x1f')],'include':_0x54cc1c[_0x74a8('0x1d')]?_[_0x74a8('0x20')](_0x54cc1c[_0x74a8('0x1d')],function(_0x101702){return{'model':db[_0x101702[_0x74a8('0x1e')]],'as':_0x101702['as'],'attributes':_0x101702[_0x74a8('0x1f')],'include':_0x101702[_0x74a8('0x1d')]?_['map'](_0x101702['include'],function(_0x48d23f){return{'model':db[_0x48d23f[_0x74a8('0x1e')]],'as':_0x48d23f['as'],'attributes':_0x48d23f[_0x74a8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x74a8('0x21')](function(_0x67817d){logger['info'](_0x74a8('0x24'),_0x429efc);logger['debug']('ShowVoiceQueue',_0x429efc,JSON[_0x74a8('0x13')](_0x67817d));_0x58f361(_0x67817d);})[_0x74a8('0x18')](function(_0x126c31){logger[_0x74a8('0x14')](_0x74a8('0x24'),_0x126c31[_0x74a8('0x16')],_0x429efc);_0xf1ce0b(_0x2e1188[_0x74a8('0x14')](0x1f4,_0x126c31[_0x74a8('0x16')]));});});}; \ No newline at end of file +var _0x3a6f=['model','attributes','info','ShowVoiceQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','include','map'];(function(_0x202c99,_0x121caf){var _0x256a0f=function(_0x3a55fa){while(--_0x3a55fa){_0x202c99['push'](_0x202c99['shift']());}};_0x256a0f(++_0x121caf);}(_0x3a6f,0x18a));var _0xf3a6=function(_0x2995bd,_0x58bace){_0x2995bd=_0x2995bd-0x0;var _0x23ed93=_0x3a6f[_0x2995bd];return _0x23ed93;};'use strict';var _=require('lodash');var util=require(_0xf3a6('0x0'));var moment=require(_0xf3a6('0x1'));var BPromise=require('bluebird');var rs=require(_0xf3a6('0x2'));var fs=require('fs');var Redis=require(_0xf3a6('0x3'));var db=require(_0xf3a6('0x4'))['db'];var utils=require(_0xf3a6('0x5'));var logger=require(_0xf3a6('0x6'))('rpc');var config=require(_0xf3a6('0x7'));var jayson=require(_0xf3a6('0x8'));var client=jayson[_0xf3a6('0x9')][_0xf3a6('0xa')]({'port':0x232a});config[_0xf3a6('0xb')]=_['defaults'](config[_0xf3a6('0xb')],{'host':_0xf3a6('0xc'),'port':0x18eb});var socket=require(_0xf3a6('0xd'))(new Redis(config[_0xf3a6('0xb')]));require(_0xf3a6('0xe'))[_0xf3a6('0xf')](socket);function respondWithRpcPromise(_0x967eb5,_0x4c8356,_0x189caa){return new BPromise(function(_0x1fe511,_0x2edd2f){return client[_0xf3a6('0x10')](_0x967eb5,_0x189caa)[_0xf3a6('0x11')](function(_0x33cf21){logger['info'](_0xf3a6('0x12'),_0x4c8356,_0xf3a6('0x13'));logger[_0xf3a6('0x14')](_0xf3a6('0x15'),_0x4c8356,_0xf3a6('0x13'),JSON[_0xf3a6('0x16')](_0x33cf21));if(_0x33cf21['error']){if(_0x33cf21[_0xf3a6('0x17')][_0xf3a6('0x18')]===0x1f4){logger[_0xf3a6('0x17')](_0xf3a6('0x12'),_0x4c8356,_0x33cf21[_0xf3a6('0x17')][_0xf3a6('0x19')]);return _0x2edd2f(_0x33cf21[_0xf3a6('0x17')]['message']);}logger[_0xf3a6('0x17')](_0xf3a6('0x12'),_0x4c8356,_0x33cf21[_0xf3a6('0x17')]['message']);return _0x1fe511(_0x33cf21['error']['message']);}else{logger['info'](_0xf3a6('0x12'),_0x4c8356,_0xf3a6('0x13'));_0x1fe511(_0x33cf21['result'][_0xf3a6('0x19')]);}})[_0xf3a6('0x1a')](function(_0x36be51){logger[_0xf3a6('0x17')](_0xf3a6('0x12'),_0x4c8356,_0x36be51);_0x2edd2f(_0x36be51);});});}exports[_0xf3a6('0x1b')]=function(_0x248e01){var _0x4fe3b3=this;return new Promise(function(_0x4d0ccd,_0x2dd09e){return db[_0xf3a6('0x1c')][_0xf3a6('0x1d')]({'raw':_0x248e01['options']?_0x248e01[_0xf3a6('0x1e')][_0xf3a6('0x1f')]===undefined?!![]:![]:!![],'where':_0x248e01[_0xf3a6('0x1e')]?_0x248e01[_0xf3a6('0x1e')][_0xf3a6('0x20')]||null:null,'attributes':_0x248e01[_0xf3a6('0x1e')]?_0x248e01['options']['attributes']||null:null,'limit':_0x248e01[_0xf3a6('0x1e')]?_0x248e01[_0xf3a6('0x1e')]['limit']||null:null,'include':_0x248e01[_0xf3a6('0x1e')]?_0x248e01[_0xf3a6('0x1e')][_0xf3a6('0x21')]?_[_0xf3a6('0x22')](_0x248e01['options'][_0xf3a6('0x21')],function(_0x4d428d){return{'model':db[_0x4d428d[_0xf3a6('0x23')]],'as':_0x4d428d['as'],'attributes':_0x4d428d[_0xf3a6('0x24')],'include':_0x4d428d[_0xf3a6('0x21')]?_[_0xf3a6('0x22')](_0x4d428d[_0xf3a6('0x21')],function(_0x2a2535){return{'model':db[_0x2a2535['model']],'as':_0x2a2535['as'],'attributes':_0x2a2535[_0xf3a6('0x24')],'include':_0x2a2535['include']?_[_0xf3a6('0x22')](_0x2a2535[_0xf3a6('0x21')],function(_0x55b838){return{'model':db[_0x55b838[_0xf3a6('0x23')]],'as':_0x55b838['as'],'attributes':_0x55b838[_0xf3a6('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf3a6('0x11')](function(_0x2dc755){logger[_0xf3a6('0x25')](_0xf3a6('0x1b'),_0x248e01);logger[_0xf3a6('0x14')](_0xf3a6('0x1b'),_0x248e01,JSON[_0xf3a6('0x16')](_0x2dc755));_0x4d0ccd(_0x2dc755);})[_0xf3a6('0x1a')](function(_0x10c3f0){logger[_0xf3a6('0x17')]('GetVoiceQueue',_0x10c3f0[_0xf3a6('0x19')],_0x248e01);_0x2dd09e(_0x4fe3b3[_0xf3a6('0x17')](0x1f4,_0x10c3f0['message']));});});};exports[_0xf3a6('0x26')]=function(_0xbab23f){var _0x3a63cb=this;return new Promise(function(_0x57647d,_0x445eae){return db[_0xf3a6('0x1c')]['find']({'raw':_0xbab23f[_0xf3a6('0x1e')]?_0xbab23f['options'][_0xf3a6('0x1f')]===undefined?!![]:![]:!![],'where':_0xbab23f['options']?_0xbab23f[_0xf3a6('0x1e')]['where']||null:null,'attributes':_0xbab23f[_0xf3a6('0x1e')]?_0xbab23f[_0xf3a6('0x1e')][_0xf3a6('0x24')]||null:null,'include':_0xbab23f['options']?_0xbab23f['options'][_0xf3a6('0x21')]?_['map'](_0xbab23f[_0xf3a6('0x1e')]['include'],function(_0x37be1c){return{'model':db[_0x37be1c['model']],'as':_0x37be1c['as'],'attributes':_0x37be1c['attributes'],'include':_0x37be1c[_0xf3a6('0x21')]?_[_0xf3a6('0x22')](_0x37be1c[_0xf3a6('0x21')],function(_0x52fa32){return{'model':db[_0x52fa32[_0xf3a6('0x23')]],'as':_0x52fa32['as'],'attributes':_0x52fa32[_0xf3a6('0x24')],'include':_0x52fa32['include']?_['map'](_0x52fa32[_0xf3a6('0x21')],function(_0x447b9a){return{'model':db[_0x447b9a[_0xf3a6('0x23')]],'as':_0x447b9a['as'],'attributes':_0x447b9a[_0xf3a6('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf3a6('0x11')](function(_0x295fc4){logger[_0xf3a6('0x25')](_0xf3a6('0x26'),_0xbab23f);logger['debug'](_0xf3a6('0x26'),_0xbab23f,JSON[_0xf3a6('0x16')](_0x295fc4));_0x57647d(_0x295fc4);})[_0xf3a6('0x1a')](function(_0xf067b2){logger[_0xf3a6('0x17')](_0xf3a6('0x26'),_0xf067b2[_0xf3a6('0x19')],_0xbab23f);_0x445eae(_0x3a63cb[_0xf3a6('0x17')](0x1f4,_0xf067b2[_0xf3a6('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 4eaf536..c9da74d 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 _0x2d41=['emit','removeListener','register','voiceQueue:','./voiceQueue.events','save','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x2d41,0xd6));var _0x12d4=function(_0x18247f,_0x5150cd){_0x18247f=_0x18247f-0x0;var _0x243e69=_0x2d41[_0x18247f];return _0x243e69;};'use strict';var VoiceQueueEvents=require(_0x12d4('0x0'));var events=[_0x12d4('0x1'),'remove',_0x12d4('0x2')];function createListener(_0x138fe8,_0x2ede89){return function(_0xa5d04){_0x2ede89[_0x12d4('0x3')](_0x138fe8,_0xa5d04);};}function removeListener(_0x4c285c,_0x5b31be){return function(){VoiceQueueEvents[_0x12d4('0x4')](_0x4c285c,_0x5b31be);};}exports[_0x12d4('0x5')]=function(_0x2bf2ef){for(var _0x18956f=0x0,_0x4c396c=events['length'];_0x18956f<_0x4c396c;_0x18956f++){var _0x34714c=events[_0x18956f];var _0x4281fa=createListener(_0x12d4('0x6')+_0x34714c,_0x2bf2ef);VoiceQueueEvents['on'](_0x34714c,_0x4281fa);}}; \ No newline at end of file +var _0xad55=['remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x17a0a0,_0x1befaa){var _0x4da752=function(_0x429829){while(--_0x429829){_0x17a0a0['push'](_0x17a0a0['shift']());}};_0x4da752(++_0x1befaa);}(_0xad55,0xe8));var _0x5ad5=function(_0x649a34,_0x131a6e){_0x649a34=_0x649a34-0x0;var _0x954a14=_0xad55[_0x649a34];return _0x954a14;};'use strict';var VoiceQueueEvents=require(_0x5ad5('0x0'));var events=[_0x5ad5('0x1'),_0x5ad5('0x2'),_0x5ad5('0x3')];function createListener(_0x3b1550,_0x445b7c){return function(_0xdbbce){_0x445b7c[_0x5ad5('0x4')](_0x3b1550,_0xdbbce);};}function removeListener(_0x40ee15,_0x3cdf34){return function(){VoiceQueueEvents[_0x5ad5('0x5')](_0x40ee15,_0x3cdf34);};}exports[_0x5ad5('0x6')]=function(_0x4fd75a){for(var _0x418d0d=0x0,_0x564bec=events[_0x5ad5('0x7')];_0x418d0d<_0x564bec;_0x418d0d++){var _0xb2dc4d=events[_0x418d0d];var _0x935202=createListener(_0x5ad5('0x8')+_0xb2dc4d,_0x4fd75a);VoiceQueueEvents['on'](_0xb2dc4d,_0x935202);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 31e1ec3..1b950d7 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 _0xcf98=['describe','/index','getVoiceQueuesReport','post','create','put','/:id','update','util','path','connect-timeout','express','Router','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0xcf98,0x8d));var _0x8cf9=function(_0x163be8,_0x5b1185){_0x163be8=_0x163be8-0x0;var _0x16b90e=_0xcf98[_0x163be8];return _0x16b90e;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8cf9('0x5'));var controller=require(_0x8cf9('0x6'));router[_0x8cf9('0x7')]('/',auth[_0x8cf9('0x8')](),controller[_0x8cf9('0x9')]);router[_0x8cf9('0x7')](_0x8cf9('0xa'),auth[_0x8cf9('0x8')](),controller[_0x8cf9('0xb')]);router[_0x8cf9('0x7')](_0x8cf9('0xc'),auth['isAuthenticated'](),controller[_0x8cf9('0xd')]);router[_0x8cf9('0x7')]('/:id',auth[_0x8cf9('0x8')](),controller['show']);router[_0x8cf9('0xe')]('/',auth[_0x8cf9('0x8')](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x10')](_0x8cf9('0x11'),auth[_0x8cf9('0x8')](),controller[_0x8cf9('0x12')]);router['delete'](_0x8cf9('0x11'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7278=['../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7278,0x161));var _0x8727=function(_0x2c841d,_0x2f60e8){_0x2c841d=_0x2c841d-0x0;var _0xbebfa3=_0x7278[_0x2c841d];return _0xbebfa3;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var auth=require(_0x8727('0x5'));var interaction=require(_0x8727('0x6'));var config=require(_0x8727('0x7'));var controller=require(_0x8727('0x8'));router[_0x8727('0x9')]('/',auth[_0x8727('0xa')](),controller[_0x8727('0xb')]);router['get'](_0x8727('0xc'),auth[_0x8727('0xa')](),controller[_0x8727('0xd')]);router[_0x8727('0x9')](_0x8727('0xe'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router['get'](_0x8727('0xf'),auth[_0x8727('0xa')](),controller[_0x8727('0x10')]);router[_0x8727('0x11')]('/',auth[_0x8727('0xa')](),controller[_0x8727('0x12')]);router[_0x8727('0x13')](_0x8727('0xf'),auth['isAuthenticated'](),controller[_0x8727('0x14')]);router[_0x8727('0x15')](_0x8727('0xf'),auth['isAuthenticated'](),controller[_0x8727('0x16')]);module[_0x8727('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 9277470..a2fb82e 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 _0x255a=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x255a,0x1aa));var _0xa255=function(_0x467dd,_0x24007f){_0x467dd=_0x467dd-0x0;var _0x115d25=_0x255a[_0x467dd];return _0x115d25;};'use strict';var Sequelize=require(_0xa255('0x0'));var moment=require(_0xa255('0x1'));module[_0xa255('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa255('0x3')]},'calleridname':{'type':Sequelize[_0xa255('0x3')]},'queue':{'type':Sequelize[_0xa255('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0xa255('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1f386c){var _0x82706b=moment(_0x1f386c);var _0x58353d=moment(this[_0xa255('0x5')](_0xa255('0x6')))[_0xa255('0x7')](_0xa255('0x8'));var _0x3c6684=_0x82706b[_0xa255('0x9')](_0x58353d,_0xa255('0xa'));this[_0xa255('0xb')](_0xa255('0xc'),_0x1f386c);this[_0xa255('0xb')](_0xa255('0xd'),_0x3c6684||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xa255('0xe')]},'queuecallerabandon':{'type':Sequelize[_0xa255('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xa255('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xa255('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa255('0x4')]},'queuecallerexit':{'type':Sequelize[_0xa255('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xa255('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xa255('0xe')]},'channel':{'type':Sequelize[_0xa255('0x3')]},'connectedlinenum':{'type':Sequelize[_0xa255('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa255('0x3')]},'exten':{'type':Sequelize[_0xa255('0x3')]},'priority':{'type':Sequelize[_0xa255('0x3')]},'holdtime':{'type':Sequelize[_0xa255('0xe')]},'mohtime':{'type':Sequelize[_0xa255('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa255('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa255('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa255('0x3')],'comment':_0xa255('0x10')},'transferexten':{'type':Sequelize[_0xa255('0x3')]},'transferuniqueid':{'type':Sequelize[_0xa255('0x3')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0xa255('0xe')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3869=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue'];(function(_0x10cd9d,_0x3d2036){var _0x4a497b=function(_0x3cbcaa){while(--_0x3cbcaa){_0x10cd9d['push'](_0x10cd9d['shift']());}};_0x4a497b(++_0x3d2036);}(_0x3869,0x115));var _0x9386=function(_0x5a5a80,_0xadd7bf){_0x5a5a80=_0x5a5a80-0x0;var _0x481eb0=_0x3869[_0x5a5a80];return _0x481eb0;};'use strict';var Sequelize=require(_0x9386('0x0'));var moment=require(_0x9386('0x1'));module[_0x9386('0x2')]={'type':{'type':Sequelize[_0x9386('0x3')]},'uniqueid':{'type':Sequelize[_0x9386('0x3')]},'calleridnum':{'type':Sequelize[_0x9386('0x3')]},'calleridname':{'type':Sequelize[_0x9386('0x3')]},'queue':{'type':Sequelize[_0x9386('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x9386('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x9386('0x4')],'set':function(_0x2f739a){var _0x7da0e4=moment(_0x2f739a);var _0x40aa5b=moment(this[_0x9386('0x5')](_0x9386('0x6')))[_0x9386('0x7')](_0x9386('0x8'));var _0x23b736=_0x7da0e4[_0x9386('0x9')](_0x40aa5b,_0x9386('0xa'));this['setDataValue']('queuecallerleaveAt',_0x2f739a);this[_0x9386('0xb')](_0x9386('0xc'),_0x23b736||null);}},'position':{'type':Sequelize[_0x9386('0xd')]},'count':{'type':Sequelize[_0x9386('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x9386('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x9386('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x9386('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x9386('0x4')]},'queuecallerexit':{'type':Sequelize[_0x9386('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x9386('0x3')],'comment':_0x9386('0xf')},'originalposition':{'type':Sequelize[_0x9386('0xd')]},'channel':{'type':Sequelize[_0x9386('0x3')]},'connectedlinenum':{'type':Sequelize[_0x9386('0x3')]},'connectedlinename':{'type':Sequelize[_0x9386('0x3')]},'accountcode':{'type':Sequelize[_0x9386('0x3')]},'context':{'type':Sequelize[_0x9386('0x3')]},'exten':{'type':Sequelize[_0x9386('0x3')]},'priority':{'type':Sequelize[_0x9386('0x3')]},'holdtime':{'type':Sequelize[_0x9386('0xd')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9386('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x9386('0x3')]},'transfer':{'type':Sequelize[_0x9386('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x9386('0x10')},'transferexten':{'type':Sequelize[_0x9386('0x3')]},'transferuniqueid':{'type':Sequelize[_0x9386('0x3')]},'disposition':{'type':Sequelize[_0x9386('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x9386('0xd')],'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 0ea77e6..66869aa 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 _0x9957=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','VoiceQueueReport','count','include','catch','show','params','keys','length','includeAll','find','create','body','describe','getVoiceQueuesReport','fields','limit','rows','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x2b4e94,_0x2233dd){_0x2233dd=_0x2233dd||0xcc;return function(_0x24b5bb){if(_0x24b5bb){return _0x2b4e94[_0x7995('0x1e')](_0x2233dd);}return _0x2b4e94[_0x7995('0x1f')](_0x2233dd)[_0x7995('0x20')]();};}function respondWithResult(_0x2202ce,_0x41cbf0){_0x41cbf0=_0x41cbf0||0xc8;return function(_0x5377e5){if(_0x5377e5){return _0x2202ce[_0x7995('0x1f')](_0x41cbf0)['json'](_0x5377e5);}};}function respondWithFilteredResult(_0x2f832e,_0x37f297){return function(_0x43d4b8){if(_0x43d4b8){var _0x291317=_0x43d4b8['count'],_0x1e1415=_0x37f297[_0x7995('0x21')],_0x37a7d4=_0x37f297['offset']+_0x37f297['limit'],_0x4faa60;if(_0x37a7d4>=_0x291317){_0x37a7d4=_0x291317;_0x4faa60=0xc8;}else{_0x4faa60=0xce;}_0x2f832e[_0x7995('0x1f')](_0x4faa60);return _0x2f832e[_0x7995('0x22')]('Content-Range',_0x1e1415+'-'+_0x37a7d4+'/'+_0x291317)[_0x7995('0x23')](_0x43d4b8);}return null;};}function patchUpdates(_0x51f276){return function(_0x4b1a8e){try{jsonpatch[_0x7995('0x24')](_0x4b1a8e,_0x51f276,!![]);}catch(_0x327b1f){return BPromise[_0x7995('0x25')](_0x327b1f);}return _0x4b1a8e[_0x7995('0x26')]();};}function saveUpdates(_0x460924,_0x1c278a){return function(_0x5d40ae){if(_0x5d40ae){return _0x5d40ae[_0x7995('0x27')](_0x460924)[_0x7995('0x28')](function(_0x204507){return _0x204507;});}return null;};}function removeEntity(_0x285437,_0x563799){return function(_0x13bc35){if(_0x13bc35){return _0x13bc35[_0x7995('0x29')]()[_0x7995('0x28')](function(){_0x285437['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1e')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x2a')]);if(_0x47625f[_0x7995('0x2b')]){delete _0x47625f[_0x7995('0x2b')];}_0x2a307e[_0x7995('0x1f')](_0x56691a)[_0x7995('0x2c')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['VoiceQueueReport'][_0x7995('0x2d')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2e')],'type':_0xe6b0b3[_0x7995('0x2f')][_0x7995('0x30')]};});_0x3250e0[_0x7995('0x31')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x32')]=_['keys'](_0x9b2a15[_0x7995('0x32')]);_0x3250e0[_0x7995('0x33')]=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]);_0x456a28['attributes']=_[_0x7995('0x34')](_0x3250e0[_0x7995('0x31')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x35')]=_0x456a28[_0x7995('0x35')]['length']?_0x456a28[_0x7995('0x35')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x32')][_0x7995('0x36')](_0x7995('0x37'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x32')]['limit']);_0x456a28['offset']=qs[_0x7995('0x21')](_0x9b2a15[_0x7995('0x32')]['offset']);}_0x456a28[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x9b2a15[_0x7995('0x32')][_0x7995('0x39')]);_0x456a28[_0x7995('0x3a')]=qs['filters'](_[_0x7995('0x3b')](_0x9b2a15[_0x7995('0x32')],_0x3250e0[_0x7995('0x33')]),_0x574574);if(_0x9b2a15[_0x7995('0x32')]['filter']){_0x456a28[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x456a28[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2f')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2b')]]={'$like':'%'+_0x9b2a15[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3c')]({},_0x456a28,_0x9b2a15[_0x7995('0x3f')]);var _0x14d638={'where':_0x456a28[_0x7995('0x3a')]};return db[_0x7995('0x40')][_0x7995('0x41')](_0x14d638)[_0x7995('0x28')](function(_0x270d52){_0x4253e5[_0x7995('0x41')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x42')]=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x43')](handleError(_0x514445,null));};exports[_0x7995('0x44')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':![],'where':{'id':_0x35c8ff[_0x7995('0x45')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x40')][_0x7995('0x2d')]);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x46')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x33')]=_[_0x7995('0x34')](_0x5e85b9[_0x7995('0x31')],_0x5e85b9[_0x7995('0x32')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x31')],qs['fields'](_0x35c8ff[_0x7995('0x32')]['fields']));_0x46ac4f[_0x7995('0x35')]=_0x46ac4f['attributes'][_0x7995('0x47')]?_0x46ac4f[_0x7995('0x35')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x32')][_0x7995('0x48')]){_0x46ac4f[_0x7995('0x42')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3c')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x40')][_0x7995('0x49')](_0x46ac4f)[_0x7995('0x28')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x43')](handleError(_0x576b96,null));};exports[_0x7995('0x4a')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x40')]['create'](_0x511567[_0x7995('0x4b')],{})[_0x7995('0x28')](respondWithResult(_0x3d8ae3,0xc9))['catch'](handleError(_0x3d8ae3,null));};exports[_0x7995('0x27')]=function(_0x5843ba,_0x1d87f9){if(_0x5843ba[_0x7995('0x4b')]['id']){delete _0x5843ba[_0x7995('0x4b')]['id'];}return db[_0x7995('0x40')][_0x7995('0x49')]({'where':{'id':_0x5843ba[_0x7995('0x45')]['id']}})[_0x7995('0x28')](handleEntityNotFound(_0x1d87f9,null))['then'](saveUpdates(_0x5843ba[_0x7995('0x4b')],null))[_0x7995('0x28')](respondWithResult(_0x1d87f9,null))[_0x7995('0x43')](handleError(_0x1d87f9,null));};exports['destroy']=function(_0x19da63,_0x1fe77e){return db[_0x7995('0x40')]['find']({'where':{'id':_0x19da63['params']['id']}})['then'](handleEntityNotFound(_0x1fe77e,null))[_0x7995('0x28')](removeEntity(_0x1fe77e,null))[_0x7995('0x43')](handleError(_0x1fe77e,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x28')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x4d')]=function(_0x4ab09f,_0x14fe7f){var _0x33c801={},_0x206d2a={},_0x50c7b5={'count':0x0,'rows':[]};_0x206d2a['model']=_['keys'](db['VoiceQueueReport'][_0x7995('0x2d')]);_0x206d2a[_0x7995('0x32')]=_[_0x7995('0x46')](_0x4ab09f[_0x7995('0x32')]);_0x206d2a[_0x7995('0x33')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],_0x206d2a[_0x7995('0x32')]);_0x33c801[_0x7995('0x35')]=_[_0x7995('0x34')](_0x206d2a[_0x7995('0x31')],qs[_0x7995('0x4e')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x4e')]));_0x33c801[_0x7995('0x35')]=_0x33c801[_0x7995('0x35')][_0x7995('0x47')]?_0x33c801[_0x7995('0x35')]:_0x206d2a[_0x7995('0x31')];if(!_0x4ab09f['query'][_0x7995('0x36')](_0x7995('0x37'))){_0x33c801[_0x7995('0x4f')]=qs[_0x7995('0x4f')](_0x4ab09f['query']['limit']);_0x33c801[_0x7995('0x21')]=qs[_0x7995('0x21')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x21')]);}_0x33c801['order']=qs[_0x7995('0x39')](_0x4ab09f[_0x7995('0x32')][_0x7995('0x39')]);_0x33c801[_0x7995('0x3a')]=qs['filters'](_['pick'](_0x4ab09f[_0x7995('0x32')],_0x206d2a[_0x7995('0x33')]));if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]){_0x33c801[_0x7995('0x3a')]=_[_0x7995('0x3c')](_0x33c801[_0x7995('0x3a')],{'$or':_[_0x7995('0x3d')](_0x33c801[_0x7995('0x35')],function(_0x50caf5){var _0x18f230={};_0x18f230[_0x50caf5]={'$like':'%'+_0x4ab09f[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x18f230;})});}_0x33c801=_[_0x7995('0x3c')]({},_0x33c801,_0x4ab09f['options']);var _0x51bf6a={'where':_0x33c801[_0x7995('0x3a')]};return db[_0x7995('0x40')]['count'](_0x51bf6a)[_0x7995('0x28')](function(_0x375fc9){_0x50c7b5[_0x7995('0x41')]=_0x375fc9;if(_0x4ab09f[_0x7995('0x32')][_0x7995('0x48')]){_0x33c801['include']=[{'all':!![]}];}return db[_0x7995('0x40')]['findAll'](_0x33c801);})[_0x7995('0x28')](function(_0xe31dcb){_0x50c7b5[_0x7995('0x50')]=_0xe31dcb;return _0x50c7b5;})[_0x7995('0x28')](respondWithFilteredResult(_0x14fe7f,_0x33c801,_0x7995('0x4d')))[_0x7995('0x43')](handleError(_0x14fe7f,null,_0x7995('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(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x7a54,0x106));var _0x47a5=function(_0x4ea440,_0x3f645d){_0x4ea440=_0x4ea440-0x0;var _0x42e284=_0x7a54[_0x4ea440];return _0x42e284;};'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 91dedb6..2efd6d9 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 _0x96bf=['update','remove','emit','hook','exports','events','../../mysqldb','save'];(function(_0x433884,_0x54e07a){var _0x2577a0=function(_0x462dde){while(--_0x462dde){_0x433884['push'](_0x433884['shift']());}};_0x2577a0(++_0x54e07a);}(_0x96bf,0x1d5));var _0xf96b=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x96bf[_0x6131cd];return _0x47e916;};'use strict';var EventEmitter=require(_0xf96b('0x0'));var VoiceQueueReport=require(_0xf96b('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf96b('0x2'),'afterUpdate':_0xf96b('0x3'),'afterDestroy':_0xf96b('0x4')};function emitEvent(_0x15c963){return function(_0x28f98a,_0x1b5a62,_0x348c97){VoiceQueueReportEvents['emit'](_0x15c963+':'+_0x28f98a['id'],_0x28f98a);VoiceQueueReportEvents[_0xf96b('0x5')](_0x15c963,_0x28f98a);_0x348c97(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xf96b('0x6')](e,emitEvent(event));}}module[_0xf96b('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x43ff=['../../mysqldb','VoiceQueueReport','save','update','remove','emit','events'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x43ff,0x11e));var _0xf43f=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x43ff[_0x43d16c];return _0x208cce;};'use strict';var EventEmitter=require(_0xf43f('0x0'));var VoiceQueueReport=require(_0xf43f('0x1'))['db'][_0xf43f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf43f('0x3'),'afterUpdate':_0xf43f('0x4'),'afterDestroy':_0xf43f('0x5')};function emitEvent(_0x2719bf){return function(_0x129245,_0x355c7a,_0x270ba7){VoiceQueueReportEvents[_0xf43f('0x6')](_0x2719bf+':'+_0x129245['id'],_0x129245);VoiceQueueReportEvents['emit'](_0x2719bf,_0x129245);_0x270ba7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 55854cc..5e04393 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 _0x41ec=['./voiceQueueReport.attributes','exports','define','report_queue','lodash','api','moment','bluebird','path'];(function(_0x2272b5,_0x362458){var _0x110156=function(_0x5c2e32){while(--_0x5c2e32){_0x2272b5['push'](_0x2272b5['shift']());}};_0x110156(++_0x362458);}(_0x41ec,0x109));var _0xc41e=function(_0x49e673,_0x6079a7){_0x49e673=_0x49e673-0x0;var _0x5abad7=_0x41ec[_0x49e673];return _0x5abad7;};'use strict';var _=require(_0xc41e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc41e('0x1'));var moment=require(_0xc41e('0x2'));var BPromise=require(_0xc41e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc41e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc41e('0x5'));module[_0xc41e('0x6')]=function(_0x54e75c,_0x1dde3c){return _0x54e75c[_0xc41e('0x7')]('VoiceQueueReport',attributes,{'tableName':_0xc41e('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9a23=['exports','report_queue','uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./voiceQueueReport.attributes'];(function(_0x3f0c88,_0x4b45c4){var _0x434d6b=function(_0x12b433){while(--_0x12b433){_0x3f0c88['push'](_0x3f0c88['shift']());}};_0x434d6b(++_0x4b45c4);}(_0x9a23,0xac));var _0x39a2=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x9a23[_0x32f7d7];return _0x133d09;};'use strict';var _=require('lodash');var util=require(_0x39a2('0x0'));var logger=require(_0x39a2('0x1'))(_0x39a2('0x2'));var moment=require(_0x39a2('0x3'));var BPromise=require(_0x39a2('0x4'));var rp=require(_0x39a2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x39a2('0x6'));var attributes=require(_0x39a2('0x7'));module[_0x39a2('0x8')]=function(_0x2d8d54,_0x20da07){return _0x2d8d54['define']('VoiceQueueReport',attributes,{'tableName':_0x39a2('0x9'),'paranoid':![],'indexes':[{'fields':[_0x39a2('0xa')]},{'fields':[_0x39a2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 39e411c..0c053e1 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 _0x672a=['body','UpdateVoiceQueueReport','update','where','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','limit','include','map','model','attributes','debug','CreateVoiceQueueReport','create'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x672a,0x138));var _0xa672=function(_0x28d40f,_0x3c3969){_0x28d40f=_0x28d40f-0x0;var _0x1f19df=_0x672a[_0x28d40f];return _0x1f19df;};'use strict';var _=require('lodash');var util=require(_0xa672('0x0'));var moment=require(_0xa672('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa672('0x2'));var db=require(_0xa672('0x3'))['db'];var utils=require(_0xa672('0x4'));var logger=require(_0xa672('0x5'))(_0xa672('0x6'));var config=require(_0xa672('0x7'));var jayson=require(_0xa672('0x8'));var client=jayson[_0xa672('0x9')][_0xa672('0xa')]({'port':0x232a});config[_0xa672('0xb')]=_[_0xa672('0xc')](config[_0xa672('0xb')],{'host':_0xa672('0xd'),'port':0x18eb});var socket=require(_0xa672('0xe'))(new Redis(config['redis']));require(_0xa672('0xf'))['register'](socket);function respondWithRpcPromise(_0xc1b06,_0x566a64,_0x3379d9){return new BPromise(function(_0x253814,_0x3ea5b4){return client[_0xa672('0x10')](_0xc1b06,_0x3379d9)[_0xa672('0x11')](function(_0x55da15){logger[_0xa672('0x12')](_0xa672('0x13'),_0x566a64,_0xa672('0x14'));logger['debug'](_0xa672('0x15'),_0x566a64,_0xa672('0x14'),JSON[_0xa672('0x16')](_0x55da15));if(_0x55da15[_0xa672('0x17')]){if(_0x55da15[_0xa672('0x17')][_0xa672('0x18')]===0x1f4){logger[_0xa672('0x17')](_0xa672('0x13'),_0x566a64,_0x55da15[_0xa672('0x17')][_0xa672('0x19')]);return _0x3ea5b4(_0x55da15[_0xa672('0x17')][_0xa672('0x19')]);}logger[_0xa672('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x566a64,_0x55da15['error'][_0xa672('0x19')]);return _0x253814(_0x55da15[_0xa672('0x17')]['message']);}else{logger[_0xa672('0x12')](_0xa672('0x13'),_0x566a64,'request\x20sent');_0x253814(_0x55da15['result']['message']);}})[_0xa672('0x1a')](function(_0x31c13f){logger[_0xa672('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x566a64,_0x31c13f);_0x3ea5b4(_0x31c13f);});});}exports[_0xa672('0x1b')]=function(_0x19b09d){var _0x4c22d9=this;return new Promise(function(_0x43985d,_0x44a408){return db[_0xa672('0x1c')][_0xa672('0x1d')]({'raw':_0x19b09d[_0xa672('0x1e')]?_0x19b09d[_0xa672('0x1e')][_0xa672('0x1f')]===undefined?!![]:![]:!![],'where':_0x19b09d[_0xa672('0x1e')]?_0x19b09d[_0xa672('0x1e')]['where']||null:null,'attributes':_0x19b09d[_0xa672('0x1e')]?_0x19b09d[_0xa672('0x1e')]['attributes']||null:null,'limit':_0x19b09d[_0xa672('0x1e')]?_0x19b09d[_0xa672('0x1e')][_0xa672('0x20')]||null:null,'include':_0x19b09d['options']?_0x19b09d[_0xa672('0x1e')][_0xa672('0x21')]?_[_0xa672('0x22')](_0x19b09d['options'][_0xa672('0x21')],function(_0x2d5c5c){return{'model':db[_0x2d5c5c['model']],'as':_0x2d5c5c['as'],'attributes':_0x2d5c5c['attributes'],'include':_0x2d5c5c[_0xa672('0x21')]?_[_0xa672('0x22')](_0x2d5c5c[_0xa672('0x21')],function(_0x3a7811){return{'model':db[_0x3a7811[_0xa672('0x23')]],'as':_0x3a7811['as'],'attributes':_0x3a7811[_0xa672('0x24')],'include':_0x3a7811[_0xa672('0x21')]?_[_0xa672('0x22')](_0x3a7811['include'],function(_0x4345b6){return{'model':db[_0x4345b6[_0xa672('0x23')]],'as':_0x4345b6['as'],'attributes':_0x4345b6[_0xa672('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa672('0x11')](function(_0x252f62){logger['info']('GetVoiceQueueReport',_0x19b09d);logger[_0xa672('0x25')](_0xa672('0x1b'),_0x19b09d,JSON['stringify'](_0x252f62));_0x43985d(_0x252f62);})[_0xa672('0x1a')](function(_0xf0976d){logger[_0xa672('0x17')](_0xa672('0x1b'),_0xf0976d[_0xa672('0x19')],_0x19b09d);_0x44a408(_0x4c22d9[_0xa672('0x17')](0x1f4,_0xf0976d[_0xa672('0x19')]));});});};exports[_0xa672('0x26')]=function(_0x2cff2e){var _0x38b6e1=this;return new Promise(function(_0x56064c,_0x582f30){return db[_0xa672('0x1c')][_0xa672('0x27')](_0x2cff2e[_0xa672('0x28')],{'raw':_0x2cff2e[_0xa672('0x1e')]?_0x2cff2e['options'][_0xa672('0x1f')]===undefined?!![]:![]:!![]})[_0xa672('0x11')](function(_0x4579a6){logger[_0xa672('0x12')](_0xa672('0x26'),_0x2cff2e);logger[_0xa672('0x25')](_0xa672('0x26'),_0x2cff2e,JSON[_0xa672('0x16')](_0x4579a6));_0x56064c(_0x4579a6);})[_0xa672('0x1a')](function(_0x32b44d){logger[_0xa672('0x17')](_0xa672('0x26'),_0x32b44d['message'],_0x2cff2e);_0x582f30(_0x38b6e1[_0xa672('0x17')](0x1f4,_0x32b44d[_0xa672('0x19')]));});});};exports[_0xa672('0x29')]=function(_0x31c3da){var _0x4f7376=this;return new Promise(function(_0x1012fb,_0x2553b5){return db[_0xa672('0x1c')][_0xa672('0x2a')](_0x31c3da['body'],{'raw':_0x31c3da['options']?_0x31c3da[_0xa672('0x1e')][_0xa672('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x31c3da[_0xa672('0x1e')]?_0x31c3da[_0xa672('0x1e')][_0xa672('0x2b')]||null:null,'attributes':_0x31c3da[_0xa672('0x1e')]?_0x31c3da['options'][_0xa672('0x24')]||null:null,'limit':_0x31c3da[_0xa672('0x1e')]?_0x31c3da['options'][_0xa672('0x20')]||null:null})[_0xa672('0x11')](function(_0x509892){logger[_0xa672('0x12')](_0xa672('0x29'),_0x31c3da);logger[_0xa672('0x25')]('UpdateVoiceQueueReport',_0x31c3da,JSON[_0xa672('0x16')](_0x509892));_0x1012fb(_0x509892);})[_0xa672('0x1a')](function(_0x10c9c3){logger[_0xa672('0x17')](_0xa672('0x29'),_0x10c9c3[_0xa672('0x19')],_0x31c3da);_0x2553b5(_0x4f7376['error'](0x1f4,_0x10c9c3[_0xa672('0x19')]));});});}; \ No newline at end of file +var _0x99ef=['request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x99ef,0x13e));var _0xf99e=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x99ef[_0x396466];return _0x5e9ab4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf99e('0x0'));var BPromise=require(_0xf99e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf99e('0x2'));var db=require(_0xf99e('0x3'))['db'];var utils=require(_0xf99e('0x4'));var logger=require('../../config/logger')(_0xf99e('0x5'));var config=require(_0xf99e('0x6'));var jayson=require(_0xf99e('0x7'));var client=jayson[_0xf99e('0x8')][_0xf99e('0x9')]({'port':0x232a});config['redis']=_[_0xf99e('0xa')](config['redis'],{'host':_0xf99e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf99e('0xc')]));require(_0xf99e('0xd'))[_0xf99e('0xe')](socket);function respondWithRpcPromise(_0x4a697f,_0x5a6eb4,_0x3724d0){return new BPromise(function(_0x1a9a94,_0x576e68){return client[_0xf99e('0xf')](_0x4a697f,_0x3724d0)[_0xf99e('0x10')](function(_0xe7536){logger['info'](_0xf99e('0x11'),_0x5a6eb4,_0xf99e('0x12'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x5a6eb4,_0xf99e('0x12'),JSON[_0xf99e('0x13')](_0xe7536));if(_0xe7536[_0xf99e('0x14')]){if(_0xe7536['error'][_0xf99e('0x15')]===0x1f4){logger['error'](_0xf99e('0x11'),_0x5a6eb4,_0xe7536['error'][_0xf99e('0x16')]);return _0x576e68(_0xe7536['error'][_0xf99e('0x16')]);}logger[_0xf99e('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x5a6eb4,_0xe7536['error'][_0xf99e('0x16')]);return _0x1a9a94(_0xe7536[_0xf99e('0x14')][_0xf99e('0x16')]);}else{logger[_0xf99e('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x5a6eb4,_0xf99e('0x12'));_0x1a9a94(_0xe7536[_0xf99e('0x18')][_0xf99e('0x16')]);}})[_0xf99e('0x19')](function(_0x2b6e9b){logger[_0xf99e('0x14')](_0xf99e('0x11'),_0x5a6eb4,_0x2b6e9b);_0x576e68(_0x2b6e9b);});});}exports[_0xf99e('0x1a')]=function(_0x587540){var _0x13de78=this;return new Promise(function(_0x5c2fe1,_0x155353){return db[_0xf99e('0x1b')][_0xf99e('0x1c')]({'raw':_0x587540[_0xf99e('0x1d')]?_0x587540[_0xf99e('0x1d')][_0xf99e('0x1e')]===undefined?!![]:![]:!![],'where':_0x587540[_0xf99e('0x1d')]?_0x587540[_0xf99e('0x1d')][_0xf99e('0x1f')]||null:null,'attributes':_0x587540['options']?_0x587540[_0xf99e('0x1d')][_0xf99e('0x20')]||null:null,'limit':_0x587540[_0xf99e('0x1d')]?_0x587540[_0xf99e('0x1d')][_0xf99e('0x21')]||null:null,'include':_0x587540['options']?_0x587540['options'][_0xf99e('0x22')]?_[_0xf99e('0x23')](_0x587540[_0xf99e('0x1d')][_0xf99e('0x22')],function(_0x53d4db){return{'model':db[_0x53d4db[_0xf99e('0x24')]],'as':_0x53d4db['as'],'attributes':_0x53d4db[_0xf99e('0x20')],'include':_0x53d4db[_0xf99e('0x22')]?_[_0xf99e('0x23')](_0x53d4db[_0xf99e('0x22')],function(_0x25d3a8){return{'model':db[_0x25d3a8['model']],'as':_0x25d3a8['as'],'attributes':_0x25d3a8[_0xf99e('0x20')],'include':_0x25d3a8[_0xf99e('0x22')]?_[_0xf99e('0x23')](_0x25d3a8[_0xf99e('0x22')],function(_0x3beb30){return{'model':db[_0x3beb30[_0xf99e('0x24')]],'as':_0x3beb30['as'],'attributes':_0x3beb30[_0xf99e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf99e('0x10')](function(_0x3dbe7e){logger['info'](_0xf99e('0x1a'),_0x587540);logger[_0xf99e('0x25')](_0xf99e('0x1a'),_0x587540,JSON[_0xf99e('0x13')](_0x3dbe7e));_0x5c2fe1(_0x3dbe7e);})['catch'](function(_0x3240af){logger[_0xf99e('0x14')]('GetVoiceQueueReport',_0x3240af[_0xf99e('0x16')],_0x587540);_0x155353(_0x13de78[_0xf99e('0x14')](0x1f4,_0x3240af['message']));});});};exports[_0xf99e('0x26')]=function(_0x3610be){var _0x458490=this;return new Promise(function(_0x4a559a,_0x259823){return db[_0xf99e('0x1b')][_0xf99e('0x27')](_0x3610be[_0xf99e('0x28')],{'raw':_0x3610be[_0xf99e('0x1d')]?_0x3610be[_0xf99e('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0xf99e('0x10')](function(_0x50c95c){logger['info']('CreateVoiceQueueReport',_0x3610be);logger[_0xf99e('0x25')]('CreateVoiceQueueReport',_0x3610be,JSON[_0xf99e('0x13')](_0x50c95c));_0x4a559a(_0x50c95c);})[_0xf99e('0x19')](function(_0x2b2f93){logger[_0xf99e('0x14')](_0xf99e('0x26'),_0x2b2f93[_0xf99e('0x16')],_0x3610be);_0x259823(_0x458490[_0xf99e('0x14')](0x1f4,_0x2b2f93[_0xf99e('0x16')]));});});};exports['UpdateVoiceQueueReport']=function(_0x1ecafa){var _0x4b37c1=this;return new Promise(function(_0x299b34,_0x3f7da7){return db['VoiceQueueReport']['update'](_0x1ecafa[_0xf99e('0x28')],{'raw':_0x1ecafa[_0xf99e('0x1d')]?_0x1ecafa[_0xf99e('0x1d')][_0xf99e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ecafa[_0xf99e('0x1d')]?_0x1ecafa[_0xf99e('0x1d')]['where']||null:null,'attributes':_0x1ecafa[_0xf99e('0x1d')]?_0x1ecafa[_0xf99e('0x1d')][_0xf99e('0x20')]||null:null,'limit':_0x1ecafa[_0xf99e('0x1d')]?_0x1ecafa[_0xf99e('0x1d')][_0xf99e('0x21')]||null:null})[_0xf99e('0x10')](function(_0x443efb){logger[_0xf99e('0x17')]('UpdateVoiceQueueReport',_0x1ecafa);logger['debug'](_0xf99e('0x29'),_0x1ecafa,JSON[_0xf99e('0x13')](_0x443efb));_0x299b34(_0x443efb);})[_0xf99e('0x19')](function(_0x5d4cda){logger[_0xf99e('0x14')](_0xf99e('0x29'),_0x5d4cda['message'],_0x1ecafa);_0x3f7da7(_0x4b37c1['error'](0x1f4,_0x5d4cda['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 7e6ac78..2b284f7 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 _0x20b5=['save','remove','update','emit','register','length','voiceQueueReport:'];(function(_0x338e5d,_0x1f18a9){var _0x1ba1e2=function(_0x1e5403){while(--_0x1e5403){_0x338e5d['push'](_0x338e5d['shift']());}};_0x1ba1e2(++_0x1f18a9);}(_0x20b5,0x7e));var _0x520b=function(_0x1b2540,_0x197222){_0x1b2540=_0x1b2540-0x0;var _0x35dc3f=_0x20b5[_0x1b2540];return _0x35dc3f;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x520b('0x0'),_0x520b('0x1'),_0x520b('0x2')];function createListener(_0x5b234f,_0x16bb2a){return function(_0x34adb3){_0x16bb2a[_0x520b('0x3')](_0x5b234f,_0x34adb3);};}function removeListener(_0x5e3490,_0x32a461){return function(){VoiceQueueReportEvents['removeListener'](_0x5e3490,_0x32a461);};}exports[_0x520b('0x4')]=function(_0x3e0078){for(var _0x50bb27=0x0,_0x14f830=events[_0x520b('0x5')];_0x50bb27<_0x14f830;_0x50bb27++){var _0x1f881d=events[_0x50bb27];var _0x53cf5f=createListener(_0x520b('0x6')+_0x1f881d,_0x3e0078);VoiceQueueReportEvents['on'](_0x1f881d,_0x53cf5f);}}; \ No newline at end of file +var _0x767d=['emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','remove','update'];(function(_0x11f4e1,_0x8958ca){var _0x47635b=function(_0x3e8e83){while(--_0x3e8e83){_0x11f4e1['push'](_0x11f4e1['shift']());}};_0x47635b(++_0x8958ca);}(_0x767d,0xcf));var _0xd767=function(_0x5f3361,_0x13d2ed){_0x5f3361=_0x5f3361-0x0;var _0x540456=_0x767d[_0x5f3361];return _0x540456;};'use strict';var VoiceQueueReportEvents=require(_0xd767('0x0'));var events=['save',_0xd767('0x1'),_0xd767('0x2')];function createListener(_0x425180,_0x121703){return function(_0x45accc){_0x121703[_0xd767('0x3')](_0x425180,_0x45accc);};}function removeListener(_0x1efed2,_0x144a15){return function(){VoiceQueueReportEvents[_0xd767('0x4')](_0x1efed2,_0x144a15);};}exports[_0xd767('0x5')]=function(_0x51156c){for(var _0x54adf8=0x0,_0x1e3810=events['length'];_0x54adf8<_0x1e3810;_0x54adf8++){var _0x4cb0ee=events[_0x54adf8];var _0x2e1da1=createListener(_0xd767('0x6')+_0x4cb0ee,_0x51156c);VoiceQueueReportEvents['on'](_0x4cb0ee,_0x2e1da1);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 86e6f21..d83cf3b 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 _0x0ac1=['delete','exports','path','connect-timeout','express','Router','../../components/auth/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x4c2cd2,_0x280f2a){var _0x28fc7a=function(_0x4f96c1){while(--_0x4f96c1){_0x4c2cd2['push'](_0x4c2cd2['shift']());}};_0x28fc7a(++_0x280f2a);}(_0x0ac1,0x167));var _0x10ac=function(_0x26c141,_0x519e67){_0x26c141=_0x26c141-0x0;var _0x5601a4=_0x0ac1[_0x26c141];return _0x5601a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x10ac('0x0'));var timeout=require(_0x10ac('0x1'));var express=require(_0x10ac('0x2'));var router=express[_0x10ac('0x3')]();var auth=require(_0x10ac('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x10ac('0x5'));router[_0x10ac('0x6')]('/',auth[_0x10ac('0x7')](),controller[_0x10ac('0x8')]);router['get'](_0x10ac('0x9'),auth[_0x10ac('0x7')](),controller[_0x10ac('0xa')]);router[_0x10ac('0xb')]('/',auth[_0x10ac('0x7')](),controller[_0x10ac('0xc')]);router[_0x10ac('0xd')](_0x10ac('0x9'),auth['isAuthenticated'](),controller[_0x10ac('0xe')]);router[_0x10ac('0xf')](_0x10ac('0x9'),auth[_0x10ac('0x7')](),controller['destroy']);module[_0x10ac('0x10')]=router; \ No newline at end of file +var _0xcb20=['./voiceQueuesLog.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1bf731,_0x52415b){var _0x491585=function(_0x562899){while(--_0x562899){_0x1bf731['push'](_0x1bf731['shift']());}};_0x491585(++_0x52415b);}(_0xcb20,0x129));var _0x0cb2=function(_0x3d6ca6,_0x3075b0){_0x3d6ca6=_0x3d6ca6-0x0;var _0x34065a=_0xcb20[_0x3d6ca6];return _0x34065a;};'use strict';var multer=require('multer');var util=require(_0x0cb2('0x0'));var path=require(_0x0cb2('0x1'));var timeout=require(_0x0cb2('0x2'));var express=require('express');var router=express[_0x0cb2('0x3')]();var auth=require(_0x0cb2('0x4'));var interaction=require(_0x0cb2('0x5'));var config=require(_0x0cb2('0x6'));var controller=require(_0x0cb2('0x7'));router[_0x0cb2('0x8')]('/',auth['isAuthenticated'](),controller[_0x0cb2('0x9')]);router['get'](_0x0cb2('0xa'),auth['isAuthenticated'](),controller[_0x0cb2('0xb')]);router[_0x0cb2('0xc')]('/',auth[_0x0cb2('0xd')](),controller[_0x0cb2('0xe')]);router[_0x0cb2('0xf')](_0x0cb2('0xa'),auth[_0x0cb2('0xd')](),controller[_0x0cb2('0x10')]);router['delete'](_0x0cb2('0xa'),auth[_0x0cb2('0xd')](),controller[_0x0cb2('0x11')]);module[_0x0cb2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 89f45db..f9189d8 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 _0x4ced=['exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x2328a1,_0x4d391d){var _0x11d644=function(_0x2d8682){while(--_0x2d8682){_0x2328a1['push'](_0x2328a1['shift']());}};_0x11d644(++_0x4d391d);}(_0x4ced,0xf5));var _0xd4ce=function(_0x1a9b50,_0x5a3822){_0x1a9b50=_0x1a9b50-0x0;var _0x4bb870=_0x4ced[_0x1a9b50];return _0x4bb870;};'use strict';var Sequelize=require(_0xd4ce('0x0'));var moment=require('moment');module[_0xd4ce('0x1')]={'time':{'type':Sequelize[_0xd4ce('0x2')]},'callid':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd4ce('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd4ce('0x3')],'allowNull':![],'defaultValue':moment()[_0xd4ce('0x4')](_0xd4ce('0x5'))}}; \ No newline at end of file +var _0xbd52=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x51e395,_0x5bfe2c){var _0x12ccef=function(_0x2ed6d1){while(--_0x2ed6d1){_0x51e395['push'](_0x51e395['shift']());}};_0x12ccef(++_0x5bfe2c);}(_0xbd52,0x1ce));var _0x2bd5=function(_0xd29892,_0x2b67b9){_0xd29892=_0xd29892-0x0;var _0x293dfd=_0xbd52[_0xd29892];return _0x293dfd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2bd5('0x0'));module[_0x2bd5('0x1')]={'time':{'type':Sequelize[_0x2bd5('0x2')]},'callid':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x2bd5('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x2bd5('0x3')],'allowNull':![],'defaultValue':moment()[_0x2bd5('0x4')](_0x2bd5('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 1c16cf6..1fa6964 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(_0x4b333,_0x39947f){var _0x222a9a=function(_0x1e6569){while(--_0x1e6569){_0x4b333['push'](_0x4b333['shift']());}};_0x222a9a(++_0x39947f);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b8722,_0x50d540){_0x2b8722=_0x2b8722-0x0;var _0x20c180=_0xb10b[_0x2b8722];return _0x20c180;};'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 _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','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x5e3415,_0x14a028){var _0x39a0b4=function(_0x598657){while(--_0x598657){_0x5e3415['push'](_0x5e3415['shift']());}};_0x39a0b4(++_0x14a028);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'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/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c939e36..c1d6f8b 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 _0xffd6=['bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger'];(function(_0x5915a9,_0x554a64){var _0x5f0681=function(_0x5e47ad){while(--_0x5e47ad){_0x5915a9['push'](_0x5915a9['shift']());}};_0x5f0681(++_0x554a64);}(_0xffd6,0x97));var _0x6ffd=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0xffd6[_0x37ffea];return _0x2e2615;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var logger=require(_0x6ffd('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6ffd('0x3'));var rp=require(_0x6ffd('0x4'));var fs=require('fs');var path=require(_0x6ffd('0x5'));var rimraf=require('rimraf');var config=require(_0x6ffd('0x6'));var attributes=require(_0x6ffd('0x7'));module[_0x6ffd('0x8')]=function(_0x2949a4,_0x561055){return _0x2949a4[_0x6ffd('0x9')](_0x6ffd('0xa'),attributes,{'tableName':_0x6ffd('0xb'),'paranoid':![],'indexes':[{'name':_0x6ffd('0xc'),'fields':[_0x6ffd('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x038b=['util','../../config/logger','api','bluebird','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','dtm'];(function(_0x47b13f,_0x5c9964){var _0x2ef091=function(_0x1a4e48){while(--_0x1a4e48){_0x47b13f['push'](_0x47b13f['shift']());}};_0x2ef091(++_0x5c9964);}(_0x038b,0x114));var _0xb038=function(_0x75a5a9,_0x3734e4){_0x75a5a9=_0x75a5a9-0x0;var _0x51a0f8=_0x038b[_0x75a5a9];return _0x51a0f8;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xb038('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 30800f5..4ebac42 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 _0x7916=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x2a2a87,_0x4f1f97){var _0x5390e5=function(_0x331c47){while(--_0x331c47){_0x2a2a87['push'](_0x2a2a87['shift']());}};_0x5390e5(++_0x4f1f97);}(_0x7916,0x128));var _0x6791=function(_0x5d6180,_0x42e0c0){_0x5d6180=_0x5d6180-0x0;var _0x5a17ad=_0x7916[_0x5d6180];return _0x5a17ad;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ad8c0,_0x8b85ff,_0x5d2118){return new BPromise(function(_0x2b240c,_0x50c563){return client['request'](_0x5ad8c0,_0x5d2118)[_0x6791('0xa')](function(_0x198a64){logger['info'](_0x6791('0xb'),_0x8b85ff,_0x6791('0xc'));logger[_0x6791('0xd')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x8b85ff,_0x6791('0xc'),JSON[_0x6791('0xe')](_0x198a64));if(_0x198a64[_0x6791('0xf')]){if(_0x198a64[_0x6791('0xf')][_0x6791('0x10')]===0x1f4){logger[_0x6791('0xf')](_0x6791('0xb'),_0x8b85ff,_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);return _0x50c563(_0x198a64[_0x6791('0xf')][_0x6791('0x11')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x8b85ff,_0x198a64[_0x6791('0xf')]['message']);return _0x2b240c(_0x198a64[_0x6791('0xf')]['message']);}else{logger[_0x6791('0x12')](_0x6791('0xb'),_0x8b85ff,'request\x20sent');_0x2b240c(_0x198a64[_0x6791('0x13')]['message']);}})[_0x6791('0x14')](function(_0x150d1f){logger['error'](_0x6791('0xb'),_0x8b85ff,_0x150d1f);_0x50c563(_0x150d1f);});});} \ No newline at end of file +var _0x36ee=['jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x261004,_0x482f06){var _0x14b236=function(_0x17125e){while(--_0x17125e){_0x261004['push'](_0x261004['shift']());}};_0x14b236(++_0x482f06);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 7538768..14bb8d6 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(_0xe95af,_0x4b849b){var _0x16effb=function(_0x454cd0){while(--_0x454cd0){_0xe95af['push'](_0xe95af['shift']());}};_0x16effb(++_0x4b849b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x31262c,_0x2cb537){var _0x17ab62=function(_0x4e1e6f){while(--_0x4e1e6f){_0x31262c['push'](_0x31262c['shift']());}};_0x17ab62(++_0x2cb537);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 858a6d3..3052a71 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 _0x41c6=['getDataValue','extname','value','STRING','channel','setDataValue','membername','TEXT','FLOAT','BOOLEAN','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','sequelize','path','exports','VIRTUAL'];(function(_0x5c3460,_0x5b6707){var _0x309d44=function(_0x944f53){while(--_0x944f53){_0x5c3460['push'](_0x5c3460['shift']());}};_0x309d44(++_0x5b6707);}(_0x41c6,0xe0));var _0x641c=function(_0x22dfe1,_0x3d0d19){_0x22dfe1=_0x22dfe1-0x0;var _0x2a7012=_0x41c6[_0x22dfe1];return _0x2a7012;};'use strict';var Sequelize=require(_0x641c('0x0'));var moment=require('moment');var path=require(_0x641c('0x1'));module[_0x641c('0x2')]={'format':{'type':Sequelize[_0x641c('0x3')],'get':function(){return this[_0x641c('0x4')]('value')?path[_0x641c('0x5')](this[_0x641c('0x4')](_0x641c('0x6'))):undefined;}},'uniqueid':{'type':Sequelize[_0x641c('0x7')]},'channel':{'type':Sequelize[_0x641c('0x7')],'set':function(_0x2a5751){if(_0x2a5751){this['setDataValue'](_0x641c('0x8'),_0x2a5751);this[_0x641c('0x9')](_0x641c('0xa'),_0x2a5751['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x641c('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x641c('0x7')]},'connectedlinenum':{'type':Sequelize[_0x641c('0x7')]},'connectedlinename':{'type':Sequelize[_0x641c('0x7')]},'accountcode':{'type':Sequelize[_0x641c('0x7')]},'context':{'type':Sequelize[_0x641c('0x7')]},'exten':{'type':Sequelize[_0x641c('0x7')]},'value':{'type':Sequelize[_0x641c('0x7')]},'type':{'type':Sequelize[_0x641c('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x641c('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'location':{'type':Sequelize['TEXT']},'transcribeName':{'type':Sequelize[_0x641c('0x7')]},'transcribeStatus':{'type':Sequelize[_0x641c('0x7')],'defaultValue':'NEW'},'fileUri':{'type':Sequelize[_0x641c('0xb')]},'fileText':{'type':Sequelize['TEXT']},'failureReason':{'type':Sequelize[_0x641c('0xb')]},'sentiment':{'type':Sequelize[_0x641c('0x7')]},'sPositive':{'type':Sequelize['FLOAT']},'sNegative':{'type':Sequelize[_0x641c('0xc')]},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize[_0x641c('0xc')]},'tempSentiment':{'type':Sequelize[_0x641c('0xd')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x641c('0xe')],'get':function(){return moment(this['getDataValue'](_0x641c('0xf')))[_0x641c('0x10')](_0x641c('0x11'))[_0x641c('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x641c('0x4')]('updatedAt'))[_0x641c('0x10')](_0x641c('0x11'))[_0x641c('0x12')]();}}}; \ No newline at end of file +var _0x23c7=['VIRTUAL','getDataValue','extname','value','STRING','setDataValue','channel','split','TEXT','NEW','FLOAT','BOOLEAN','DATE','createdAt','format','toString','updatedAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','exports'];(function(_0x315216,_0x15d0cc){var _0x4dfb84=function(_0x7e1a19){while(--_0x7e1a19){_0x315216['push'](_0x315216['shift']());}};_0x4dfb84(++_0x15d0cc);}(_0x23c7,0x1e0));var _0x723c=function(_0x19528f,_0x4605d1){_0x19528f=_0x19528f-0x0;var _0x1101ba=_0x23c7[_0x19528f];return _0x1101ba;};'use strict';var Sequelize=require(_0x723c('0x0'));var moment=require(_0x723c('0x1'));var path=require('path');module[_0x723c('0x2')]={'format':{'type':Sequelize[_0x723c('0x3')],'get':function(){return this[_0x723c('0x4')]('value')?path[_0x723c('0x5')](this[_0x723c('0x4')](_0x723c('0x6'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x723c('0x7')],'set':function(_0x18d5eb){if(_0x18d5eb){this[_0x723c('0x8')](_0x723c('0x9'),_0x18d5eb);this[_0x723c('0x8')]('membername',_0x18d5eb[_0x723c('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x723c('0x7')]},'calleridnum':{'type':Sequelize[_0x723c('0x7')]},'calleridname':{'type':Sequelize[_0x723c('0x7')]},'connectedlinenum':{'type':Sequelize[_0x723c('0x7')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x723c('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x723c('0x7')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x723c('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x723c('0x7')]},'location':{'type':Sequelize[_0x723c('0xb')]},'transcribeName':{'type':Sequelize[_0x723c('0x7')]},'transcribeStatus':{'type':Sequelize[_0x723c('0x7')],'defaultValue':_0x723c('0xc')},'fileUri':{'type':Sequelize[_0x723c('0xb')]},'fileText':{'type':Sequelize[_0x723c('0xb')]},'failureReason':{'type':Sequelize[_0x723c('0xb')]},'sentiment':{'type':Sequelize[_0x723c('0x7')]},'sPositive':{'type':Sequelize['FLOAT']},'sNegative':{'type':Sequelize[_0x723c('0xd')]},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x723c('0xe')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0x723c('0xf')],'get':function(){return moment(this['getDataValue'](_0x723c('0x10')))[_0x723c('0x11')]('MM-DD-YYYY\x20HH:mm')[_0x723c('0x12')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x723c('0x4')](_0x723c('0x13')))[_0x723c('0x11')](_0x723c('0x14'))[_0x723c('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 38e62f1..3b0f747 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 _0x01bc=['transcribeName','transcribeStatus','findOne','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentiment','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','aws-sdk','uuid/v4','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','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','key','model','differenceBy','map','format','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','VoiceRecording','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','%s.cypher','ValidationError','filename','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','destroy','listBuckets','createBucket','upload','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName'];(function(_0x14fe3,_0x5f2668){var _0x322bd5=function(_0x15a4ba){while(--_0x15a4ba){_0x14fe3['push'](_0x14fe3['shift']());}};_0x322bd5(++_0x5f2668);}(_0x01bc,0x152));var _0xc01b=function(_0x959da5,_0x3f82c9){_0x959da5=_0x959da5-0x0;var _0x17ac64=_0x01bc[_0x959da5];return _0x17ac64;};'use strict';var pdf=require(_0xc01b('0x0'));var emlformat=require(_0xc01b('0x1'));var rimraf=require(_0xc01b('0x2'));var zipdir=require(_0xc01b('0x3'));var jsonpatch=require(_0xc01b('0x4'));var rp=require(_0xc01b('0x5'));var moment=require('moment');var BPromise=require(_0xc01b('0x6'));var Mustache=require(_0xc01b('0x7'));var util=require(_0xc01b('0x8'));var path=require(_0xc01b('0x9'));var sox=require(_0xc01b('0xa'));var csv=require('to-csv');var ejs=require(_0xc01b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc01b('0xc'));var crypto=require(_0xc01b('0xd'));var jsforce=require(_0xc01b('0xe'));var deskjs=require(_0xc01b('0xf'));var toCsv=require(_0xc01b('0x10'));var querystring=require('querystring');var Papa=require(_0xc01b('0x11'));var AWS=require(_0xc01b('0x12'));var uuidv4=require(_0xc01b('0x13'));var Redis=require(_0xc01b('0x14'));var authService=require(_0xc01b('0x15'));var qs=require(_0xc01b('0x16'));var as=require(_0xc01b('0x17'));var hardwareService=require(_0xc01b('0x18'));var logger=require(_0xc01b('0x19'))('api');var utils=require(_0xc01b('0x1a'));var config=require(_0xc01b('0x1b'));var db=require(_0xc01b('0x1c'))['db'];function respondWithStatusCode(_0x455acd,_0x5b5545){_0x5b5545=_0x5b5545||0xcc;return function(_0x189dbe){if(_0x189dbe){return _0x455acd[_0xc01b('0x1d')](_0x5b5545);}return _0x455acd[_0xc01b('0x1e')](_0x5b5545)[_0xc01b('0x1f')]();};}function respondWithResult(_0x2ff479,_0x5ea7ce){_0x5ea7ce=_0x5ea7ce||0xc8;return function(_0x3940cd){if(_0x3940cd){return _0x2ff479['status'](_0x5ea7ce)[_0xc01b('0x20')](_0x3940cd);}};}function respondWithFilteredResult(_0x3721e4,_0x2459da){return function(_0x571278){if(_0x571278){var _0x5c8815=_0x571278[_0xc01b('0x21')],_0x46dd4f=_0x2459da[_0xc01b('0x22')],_0x28bb64=_0x2459da[_0xc01b('0x22')]+_0x2459da['limit'],_0x2bba57;if(_0x28bb64>=_0x5c8815){_0x28bb64=_0x5c8815;_0x2bba57=0xc8;}else{_0x2bba57=0xce;}_0x3721e4[_0xc01b('0x1e')](_0x2bba57);return _0x3721e4[_0xc01b('0x23')](_0xc01b('0x24'),_0x46dd4f+'-'+_0x28bb64+'/'+_0x5c8815)[_0xc01b('0x20')](_0x571278);}return null;};}function patchUpdates(_0x46008b){return function(_0x548838){try{jsonpatch[_0xc01b('0x25')](_0x548838,_0x46008b,!![]);}catch(_0x121190){return BPromise[_0xc01b('0x26')](_0x121190);}return _0x548838[_0xc01b('0x27')]();};}function saveUpdates(_0x5b6cc6,_0x5bed46){return function(_0x1f9409){if(_0x1f9409){return _0x1f9409[_0xc01b('0x28')](_0x5b6cc6)[_0xc01b('0x29')](function(_0x5151cb){return _0x5151cb;});}return null;};}function removeEntity(_0x85661a,_0x44d86c){return function(_0x3e856a){if(_0x3e856a){return _0x3e856a['destroy']()[_0xc01b('0x29')](function(){_0x85661a[_0xc01b('0x1e')](0xcc)[_0xc01b('0x1f')]();});}};}function handleEntityNotFound(_0x2b9c48,_0x2935e6){return function(_0x19dfbf){if(!_0x19dfbf){_0x2b9c48['sendStatus'](0x194);}return _0x19dfbf;};}function handleError(_0x2fba5a,_0x208078){_0x208078=_0x208078||0x1f4;return function(_0x4323c6){logger['error'](_0x4323c6[_0xc01b('0x2a')]);if(_0x4323c6[_0xc01b('0x2b')]){delete _0x4323c6[_0xc01b('0x2b')];}_0x2fba5a[_0xc01b('0x1e')](_0x208078)[_0xc01b('0x2c')](_0x4323c6);};}exports[_0xc01b('0x2d')]=function(_0x59f1aa,_0x3bfa9b){var _0x4a4b2f={},_0x130886={},_0x4c709d={'count':0x0,'rows':[]};var _0xebaea5=_['map'](db['VoiceRecording'][_0xc01b('0x2e')],function(_0x12c3e6){return{'name':_0x12c3e6[_0xc01b('0x2f')],'type':_0x12c3e6['type'][_0xc01b('0x30')]};});_0x130886[_0xc01b('0x31')]=_[_0xc01b('0x32')](_[_0xc01b('0x33')](_0xebaea5,_0xc01b('0x2b')),[_0xc01b('0x34')]);_0x130886[_0xc01b('0x35')]=_[_0xc01b('0x36')](_0x59f1aa[_0xc01b('0x35')]);_0x130886[_0xc01b('0x37')]=_[_0xc01b('0x38')](_0x130886[_0xc01b('0x31')],_0x130886[_0xc01b('0x35')]);_0x4a4b2f['attributes']=_[_0xc01b('0x38')](_0x130886['model'],qs[_0xc01b('0x39')](_0x59f1aa[_0xc01b('0x35')][_0xc01b('0x39')]));_0x4a4b2f[_0xc01b('0x3a')]=_0x4a4b2f[_0xc01b('0x3a')]['length']?_0x4a4b2f[_0xc01b('0x3a')]:_0x130886[_0xc01b('0x31')];if(!_0x59f1aa[_0xc01b('0x35')][_0xc01b('0x3b')](_0xc01b('0x3c'))){_0x4a4b2f['limit']=qs[_0xc01b('0x3d')](_0x59f1aa['query'][_0xc01b('0x3d')]);_0x4a4b2f[_0xc01b('0x22')]=qs[_0xc01b('0x22')](_0x59f1aa[_0xc01b('0x35')]['offset']);}_0x4a4b2f[_0xc01b('0x3e')]=qs[_0xc01b('0x3f')](_0x59f1aa[_0xc01b('0x35')]['sort']);_0x4a4b2f[_0xc01b('0x40')]=qs[_0xc01b('0x37')](_[_0xc01b('0x41')](_0x59f1aa[_0xc01b('0x35')],_0x130886['filters']),_0xebaea5);if(_0x59f1aa['query']['filter']){_0x4a4b2f['where']=_[_0xc01b('0x42')](_0x4a4b2f[_0xc01b('0x40')],{'$or':_[_0xc01b('0x33')](_0xebaea5,function(_0x427885){if(_0x427885[_0xc01b('0x43')]!==_0xc01b('0x44')){var _0x3012d5={};_0x3012d5[_0x427885[_0xc01b('0x2b')]]={'$like':'%'+_0x59f1aa['query'][_0xc01b('0x45')]+'%'};return _0x3012d5;}})});}_0x4a4b2f=_[_0xc01b('0x42')]({},_0x4a4b2f,_0x59f1aa[_0xc01b('0x46')]);var _0x3efe6f={'where':_0x4a4b2f[_0xc01b('0x40')]};return db[_0xc01b('0x47')][_0xc01b('0x21')](_0x3efe6f)[_0xc01b('0x29')](function(_0x53fa89){_0x4c709d[_0xc01b('0x21')]=_0x53fa89;if(_0x59f1aa[_0xc01b('0x35')][_0xc01b('0x48')]){_0x4a4b2f[_0xc01b('0x49')]=[{'all':!![]}];}return db[_0xc01b('0x47')][_0xc01b('0x4a')](_0x4a4b2f);})[_0xc01b('0x29')](function(_0x45b6e5){_0x4c709d[_0xc01b('0x4b')]=_0x45b6e5;return _0x4c709d;})[_0xc01b('0x29')](respondWithFilteredResult(_0x3bfa9b,_0x4a4b2f))[_0xc01b('0x4c')](handleError(_0x3bfa9b,null));};exports[_0xc01b('0x4d')]=function(_0x3655b7,_0x3c27de){var _0xe24274={'raw':![],'where':{'id':_0x3655b7[_0xc01b('0x4e')]['id']}},_0x214d14={};_0x214d14['model']=_[_0xc01b('0x36')](db[_0xc01b('0x47')][_0xc01b('0x2e')]);_0x214d14['query']=_[_0xc01b('0x36')](_0x3655b7[_0xc01b('0x35')]);_0x214d14['filters']=_[_0xc01b('0x38')](_0x214d14[_0xc01b('0x31')],_0x214d14[_0xc01b('0x35')]);_0xe24274[_0xc01b('0x3a')]=_['intersection'](_0x214d14['model'],qs[_0xc01b('0x39')](_0x3655b7['query'][_0xc01b('0x39')]));_0xe24274[_0xc01b('0x3a')]=_0xe24274['attributes']['length']?_0xe24274[_0xc01b('0x3a')]:_0x214d14[_0xc01b('0x31')];if(_0x3655b7[_0xc01b('0x35')]['includeAll']){_0xe24274[_0xc01b('0x49')]=[{'all':!![]}];}_0xe24274=_[_0xc01b('0x42')]({},_0xe24274,_0x3655b7['options']);return db[_0xc01b('0x47')][_0xc01b('0x4f')](_0xe24274)['then'](handleEntityNotFound(_0x3c27de,null))[_0xc01b('0x29')](respondWithResult(_0x3c27de,null))[_0xc01b('0x4c')](handleError(_0x3c27de,null));};exports[_0xc01b('0x50')]=function(_0x421fac,_0x4f3cac){return db[_0xc01b('0x47')]['create'](_0x421fac[_0xc01b('0x51')],{})['then'](respondWithResult(_0x4f3cac,0xc9))[_0xc01b('0x4c')](handleError(_0x4f3cac,null));};exports[_0xc01b('0x28')]=function(_0xe831fa,_0x11b45e){if(_0xe831fa['body']['id']){delete _0xe831fa[_0xc01b('0x51')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0xe831fa[_0xc01b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x11b45e,null))[_0xc01b('0x29')](saveUpdates(_0xe831fa[_0xc01b('0x51')],null))[_0xc01b('0x29')](respondWithResult(_0x11b45e,null))[_0xc01b('0x4c')](handleError(_0x11b45e,null));};exports[_0xc01b('0x52')]=function(_0xd78043,_0x189d81){return db[_0xc01b('0x47')][_0xc01b('0x52')]()[_0xc01b('0x29')](respondWithResult(_0x189d81,null))[_0xc01b('0x4c')](handleError(_0x189d81,null));};exports[_0xc01b('0x53')]=function(_0x54a948,_0x54870b,_0x256858){var _0x3a92a3=require(_0xc01b('0x54'));var _0x41d513=![];var _0x52ae30={};if(_0x54a948[_0xc01b('0x35')][_0xc01b('0x43')]&&_0x54a948[_0xc01b('0x35')][_0xc01b('0x43')]===_0xc01b('0x55')){_0x52ae30['uniqueid']=_0x54a948['params']['id'];}else{_0x52ae30['id']=_0x54a948[_0xc01b('0x4e')]['id'];}return db['VoiceRecording']['find']({'where':_0x52ae30,'attributes':['id','value'],'raw':!![]})[_0xc01b('0x29')](handleEntityNotFound(_0x54870b,null))[_0xc01b('0x29')](function(_0x327c8a){if(_0x327c8a){var _0x3e5163=_0x327c8a[_0xc01b('0x56')];var _0x57dd28=util['format']('%s.cypher',_0x3e5163);if(fs[_0xc01b('0x57')](_0x57dd28)){_0x41d513=!![];return _0x3a92a3[_0xc01b('0x58')](_0x57dd28,_0x3e5163,config[_0xc01b('0x59')][_0xc01b('0x5a')])[_0xc01b('0x29')](function(){return _0x327c8a;});}return _0x327c8a;}})[_0xc01b('0x29')](function(_0x1efab4){if(_0x1efab4){var _0x13e109=_0x1efab4['value'];if(!fs['existsSync'](_0x13e109)){throw new db[(_0xc01b('0x5b'))]['ValidationError'](_0xc01b('0x5c'));}if(_0x1efab4['filename']){return _0x54870b['download'](_0x13e109,_0x1efab4['filename']+path[_0xc01b('0x5d')](_0x13e109),function(){if(_0x41d513){fs[_0xc01b('0x5e')](_0x13e109);}});}else{return _0x54870b[_0xc01b('0x53')](_0x13e109,function(_0x229f11){if(_0x41d513){fs['unlink'](_0x13e109);}});}}})[_0xc01b('0x4c')](function(_0x3bbd1d){if(_0x3bbd1d[_0xc01b('0x5f')]==='VoiceRecording\x20not\x20found'){_0x54870b[_0xc01b('0x1e')](0x194)[_0xc01b('0x2c')](_0xc01b('0x60'));}else{return handleError(_0x54870b,null);}});};exports[_0xc01b('0x61')]=function(_0x2207fa,_0x5f4572,_0x1b3a37){var _0x52adc1=require(_0xc01b('0x54'));var _0xdc61ce=![];var _0x3c7418={'$and':[db[_0xc01b('0x62')][_0xc01b('0x40')](db[_0xc01b('0x62')]['fn'](_0xc01b('0x63'),db[_0xc01b('0x62')][_0xc01b('0x64')]('uniqueid')),_0x2207fa[_0xc01b('0x35')][_0xc01b('0x65')])]};if(_0x2207fa[_0xc01b('0x35')][_0xc01b('0x43')]&&_0x2207fa[_0xc01b('0x35')][_0xc01b('0x43')]===_0xc01b('0x55')){_0x3c7418[_0xc01b('0x66')][_0xc01b('0x67')]({'uniqueid':_0x2207fa[_0xc01b('0x4e')]['id']});}else{_0x3c7418['$and']['push']({'id':_0x2207fa[_0xc01b('0x4e')]['id']});}return db[_0xc01b('0x47')]['find']({'where':_0x3c7418,'attributes':['id',_0xc01b('0x56')],'raw':!![]})[_0xc01b('0x29')](handleEntityNotFound(_0x5f4572,null))[_0xc01b('0x29')](function(_0x4d285f){if(_0x4d285f){var _0xbeef66=util[_0xc01b('0x34')](_0xc01b('0x68'),_0x4d285f[_0xc01b('0x56')]);if(fs['existsSync'](_0xbeef66)){_0xdc61ce=!![];return _0x52adc1[_0xc01b('0x58')](_0xbeef66,_0x4d285f['value'],config[_0xc01b('0x59')][_0xc01b('0x5a')])[_0xc01b('0x29')](function(){return _0x4d285f;});}return _0x4d285f;}})['then'](function(_0x17c4ed){if(_0x17c4ed){if(!fs[_0xc01b('0x57')](_0x17c4ed[_0xc01b('0x56')])){throw new db[(_0xc01b('0x5b'))][(_0xc01b('0x69'))]('VoiceRecording\x20not\x20found');}if(_0x17c4ed[_0xc01b('0x6a')]){return _0x5f4572['download'](_0x17c4ed[_0xc01b('0x56')],_0x17c4ed[_0xc01b('0x6a')]+path['extname'](_0x17c4ed[_0xc01b('0x56')]),function(){if(_0xdc61ce){fs[_0xc01b('0x5e')](_0x17c4ed[_0xc01b('0x56')]);}});}else{return _0x5f4572[_0xc01b('0x53')](_0x17c4ed[_0xc01b('0x56')],function(_0x43aab6){if(_0xdc61ce){fs[_0xc01b('0x5e')](_0x17c4ed[_0xc01b('0x56')]);}});}}})[_0xc01b('0x4c')](handleError(_0x5f4572,null));};exports['destroy']=function(_0x5cd149,_0x47e107){return db[_0xc01b('0x47')][_0xc01b('0x4f')]({'where':{'id':_0x5cd149[_0xc01b('0x4e')]['id']}})[_0xc01b('0x29')](function(_0x46f712){if(!_0x46f712)throw new ReferenceError('Entity\x20not\x20found');return _0x46f712;})['then'](function(_0x2df84b){var _0x4a3f9c=_0x2df84b[_0xc01b('0x56')];logger[_0xc01b('0x6b')](_0xc01b('0x6c'),_0x4a3f9c);if(!_[_0xc01b('0x6d')](_0x2df84b[_0xc01b('0x56')])&&fs['existsSync'](_0x4a3f9c)){logger[_0xc01b('0x6b')](_0xc01b('0x6e')+_0x4a3f9c+_0xc01b('0x6f'));fs['unlinkSync'](_0x4a3f9c);}_0x4a3f9c=_0x4a3f9c+'.cypher';if(!_[_0xc01b('0x6d')](_0x2df84b['value'])&&fs[_0xc01b('0x57')](_0x4a3f9c)){logger[_0xc01b('0x6b')]('File:\x20\x22'+_0x4a3f9c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc01b('0x70')](_0x4a3f9c);}return _0x2df84b;})[_0xc01b('0x29')](function(_0x45b2e2){if(!_0x45b2e2)throw new InternalError();return _0x45b2e2[_0xc01b('0x71')]();})[_0xc01b('0x29')](function(){_0x47e107[_0xc01b('0x1e')](0xcc)[_0xc01b('0x1f')]();})[_0xc01b('0x4c')](handleError(_0x47e107,null));};function getBucketslist(_0x2f4156,_0x57cdc2,_0x37d75e){return new Promise(function(_0x34c9cb,_0x523547){var _0x37a197=new AWS['S3']({'accessKeyId':_0x57cdc2,'secretAccessKey':_0x2f4156,'region':_0x37d75e});_0x37a197[_0xc01b('0x72')]({},function(_0x177ba2,_0x16f01e){if(_0x177ba2){return _0x523547(_0x177ba2);}else{return _0x34c9cb(_0x16f01e);}});});}function createBucket(_0x3309d4,_0x12985a,_0x2347aa,_0x234813){return new Promise(function(_0x4baf19,_0x2dffe0){var _0x9ed8f4=new AWS['S3']({'accessKeyId':_0x12985a,'secretAccessKey':_0x3309d4,'region':_0x2347aa});_0x9ed8f4[_0xc01b('0x73')]({'Bucket':_0x234813},function(_0x44eeac,_0x2e94da){if(_0x44eeac){return _0x2dffe0(_0x44eeac);}else{return _0x4baf19(_0x2e94da);}});});}function uploadFile(_0x3cc1d0,_0x43f7ec,_0x168391,_0xcfec8d,_0x23cc3b,_0x4a7fff){return new Promise(function(_0x155294,_0x15a769){var _0x1c9f32=new AWS['S3']({'accessKeyId':_0x43f7ec,'secretAccessKey':_0x3cc1d0,'region':_0x168391});_0x1c9f32[_0xc01b('0x74')]({'Bucket':_0xcfec8d,'Key':_0x23cc3b,'Body':_0x4a7fff},function(_0x1c52e5,_0x33bd24){if(_0x1c52e5){return _0x15a769(_0x1c52e5);}else{return _0x155294(_0x33bd24);}});});}function startTranscribe(_0x4e6ee9,_0x2103df,_0x55e9eb,_0x420e7e,_0xaeab82,_0x1d92c6){return new Promise(function(_0xe4be4a,_0x5a2805){var _0x13c567=new AWS['TranscribeService']({'accessKeyId':_0x2103df,'secretAccessKey':_0x4e6ee9,'region':_0x55e9eb});_0x13c567[_0xc01b('0x75')]({'TranscriptionJobName':_0x420e7e,'LanguageCode':_0xaeab82,'Media':{'MediaFileUri':_0x1d92c6}},function(_0x432b35,_0x7d7ca6){if(_0x432b35){return _0x5a2805(_0x432b35);}else{return _0xe4be4a(_0x7d7ca6);}});});}function transcribe(_0x4a6625,_0x2d8298,_0x43a0fa,_0x29117f,_0x8a353b,_0x85ab30,_0x2ded08){return new Promise(function(_0x3dc76a,_0x209a01){var _0x218bfd={};logger['info'](util[_0xc01b('0x34')](_0xc01b('0x76'),_0x4a6625,_0x8a353b));return uploadFile(_0x2d8298,_0x43a0fa,_0x29117f,_0x8a353b,path['basename'](_0x85ab30),fs['readFileSync'](_0x85ab30))[_0xc01b('0x29')](function(_0x113fa2){logger[_0xc01b('0x6b')](util[_0xc01b('0x34')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x4a6625,_0x8a353b,_0x113fa2[_0xc01b('0x77')]));_0x218bfd[_0xc01b('0x78')]=_0x113fa2[_0xc01b('0x79')];_0x218bfd[_0xc01b('0x7a')]=_0x113fa2[_0xc01b('0x77')];logger[_0xc01b('0x6b')](util[_0xc01b('0x34')](_0xc01b('0x7b'),_0x4a6625));return startTranscribe(_0x2d8298,_0x43a0fa,_0x29117f,uuidv4(),_0x2ded08,_0x113fa2['Location']);})[_0xc01b('0x29')](function(_0x530ea3){logger[_0xc01b('0x6b')](util[_0xc01b('0x34')](_0xc01b('0x7c'),_0x4a6625,_0x530ea3[_0xc01b('0x7d')][_0xc01b('0x7e')]));_0x218bfd[_0xc01b('0x7f')]=_0x530ea3[_0xc01b('0x7d')][_0xc01b('0x7e')];_0x218bfd[_0xc01b('0x80')]=_0x530ea3['TranscriptionJob']['TranscriptionJobStatus'];return _0x3dc76a(_0x218bfd);})[_0xc01b('0x4c')](function(_0x1511f3){return _0x209a01(_0x1511f3);});});}exports['runTranscribe']=function(_0x430bfe,_0x1d2698,_0x36bd87){var _0xb81fc8;var _0x2935e1;var _0x181856;var _0x2f42a5=require(_0xc01b('0x54'));return db['VoiceRecording'][_0xc01b('0x81')]({'where':{'id':_0x430bfe['params']['id']}})[_0xc01b('0x29')](function(_0x569f54){if(_0x569f54){var _0x47d8f4=util[_0xc01b('0x34')](_0xc01b('0x68'),_0x569f54[_0xc01b('0x56')]);if(fs[_0xc01b('0x57')](_0x47d8f4)){cypher=!![];return _0x2f42a5[_0xc01b('0x58')](_0x47d8f4,_0x569f54[_0xc01b('0x56')],config[_0xc01b('0x59')][_0xc01b('0x5a')])[_0xc01b('0x29')](function(){return _0x569f54;});}return _0x569f54;}})['then'](function(_0x204caf){if(!_0x204caf){throw new db[(_0xc01b('0x5b'))][(_0xc01b('0x69'))]('Voice\x20Recording\x20not\x20found');}_0x2935e1=_0x204caf;return db[_0xc01b('0x82')]['findOne']({'where':{'id':0x1}});})[_0xc01b('0x29')](handleEntityNotFound(_0x1d2698,null))[_0xc01b('0x29')](function(_0x55c047){if(_0x55c047){_0xb81fc8=_0x55c047;if(!_0xb81fc8['transcribe']||!_0xb81fc8[_0xc01b('0x83')]||!_0xb81fc8[_0xc01b('0x84')]||!_0xb81fc8['language']||!_0xb81fc8[_0xc01b('0x78')]){throw new db[(_0xc01b('0x5b'))][(_0xc01b('0x69'))](_0xc01b('0x85'));}if(_0x430bfe[_0xc01b('0x51')]['runSentiment']&&(!_0xb81fc8[_0xc01b('0x86')]||!_0xb81fc8['sentimentAccountId']||!_0xb81fc8[_0xc01b('0x87')]||!_0xb81fc8[_0xc01b('0x88')]||!_0xb81fc8[_0xc01b('0x78')])){throw new db[(_0xc01b('0x5b'))][(_0xc01b('0x69'))](_0xc01b('0x89'));}return db[_0xc01b('0x8a')]['findOne']({'where':{'id':_0xb81fc8[_0xc01b('0x83')]}});}})['then'](function(_0x4df370){if(!_0x4df370){throw new db['Sequelize'][(_0xc01b('0x69'))](_0xc01b('0x8b'));}if(!_0x4df370[_0xc01b('0x8c')]||!_0x4df370[_0xc01b('0x8d')]){throw new db[(_0xc01b('0x5b'))]['ValidationError'](_0xc01b('0x8e'));}_0x181856=_0x4df370;return getBucketslist(_0x181856[_0xc01b('0x8c')],_0x181856[_0xc01b('0x8d')],_0xb81fc8[_0xc01b('0x84')]);})[_0xc01b('0x29')](function(_0x5bd2c6){if(_0x5bd2c6&&_0x5bd2c6[_0xc01b('0x8f')]){var _0x5dde6d=_[_0xc01b('0x4f')](_0x5bd2c6[_0xc01b('0x8f')],function(_0x552360){return _0x552360[_0xc01b('0x90')]===_0xb81fc8[_0xc01b('0x78')];});if(!_0x5dde6d){logger[_0xc01b('0x6b')](util[_0xc01b('0x34')](_0xc01b('0x91'),_0x430bfe[_0xc01b('0x4e')]['id'],_0xb81fc8[_0xc01b('0x78')]));return createBucket(_0x181856[_0xc01b('0x8c')],_0x181856['data2'],_0xb81fc8[_0xc01b('0x84')],_0xb81fc8[_0xc01b('0x78')]);}logger[_0xc01b('0x6b')](util[_0xc01b('0x34')](_0xc01b('0x92'),_0x430bfe['params']['id'],_0xb81fc8[_0xc01b('0x78')]));return;}})[_0xc01b('0x29')](function(_0x586736){if(_0x2935e1[_0xc01b('0x80')]===_0xc01b('0x93')){return transcribe(_0x430bfe[_0xc01b('0x4e')]['id'],_0x181856['data1'],_0x181856['data2'],_0xb81fc8[_0xc01b('0x84')],_0xb81fc8[_0xc01b('0x78')],_0x2935e1[_0xc01b('0x56')],_0xb81fc8['language']);}else{logger[_0xc01b('0x6b')](util[_0xc01b('0x34')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x430bfe[_0xc01b('0x4e')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xc01b('0x29')](function(_0x37a234){if(_0x37a234){_0x37a234[_0xc01b('0x94')]=_0x430bfe[_0xc01b('0x51')]['runSentiment'];return _0x2935e1[_0xc01b('0x95')](_0x37a234);}})[_0xc01b('0x29')](respondWithResult(_0x1d2698,null))[_0xc01b('0x4c')](handleError(_0x1d2698,null));};function writeFile(_0xa71fdd,_0x14d17e){return new Promise(function(_0x3055eb,_0x5bbbec){fs[_0xc01b('0x96')](_0x14d17e,_0xa71fdd,function(_0x4bbec4,_0x22bcea){if(_0x4bbec4){return _0x5bbbec(_0x4bbec4);}else{return _0x3055eb(_0x22bcea);}});});}exports[_0xc01b('0x97')]=function(_0x40f68f,_0x3c97d4,_0x21e358){return db['VoiceRecording'][_0xc01b('0x81')]({'where':{'id':_0x40f68f[_0xc01b('0x4e')]['id']}})[_0xc01b('0x29')](handleEntityNotFound(_0x3c97d4))[_0xc01b('0x29')](function(_0x1142f4){if(_0x1142f4&&_0x1142f4[_0xc01b('0x98')]){var _0x3e2a60=_0x1142f4[_0xc01b('0x98')];var _0x1a0339=config[_0xc01b('0x99')]+_0xc01b('0x9a')+_0x1142f4['id']+'.txt';if(fs['existsSync'](_0x1a0339)){return _0x1a0339;}return writeFile(_0x3e2a60,_0x1a0339)['then'](function(){return _0x1a0339;});}else{throw new db['Sequelize'][(_0xc01b('0x69'))]('Transcript\x20not\x20available');}})['then'](function(_0xe0d7e1){return _0x3c97d4[_0xc01b('0x53')](_0xe0d7e1);})[_0xc01b('0x4c')](handleError(_0x3c97d4));}; \ No newline at end of file +var _0xe3f1=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','destroy','then','error','stack','name','send','index','VoiceRecording','rawAttributes','fieldName','type','model','differenceBy','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','find','create','update','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','message','downloads','../../components/encryptor','sequelize','col','token','$and','push','format','extname','unlink','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','listBuckets','createBucket','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[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','runTranscribe','Setting','transcribe','transcribeAccountId','transcribeRegion','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','language','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','findOne','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../config/logger'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xe3f1,0x79));var _0x1e3f=function(_0x6fee9b,_0x3341e2){_0x6fee9b=_0x6fee9b-0x0;var _0x4db234=_0xe3f1[_0x6fee9b];return _0x4db234;};'use strict';var pdf=require(_0x1e3f('0x0'));var emlformat=require(_0x1e3f('0x1'));var rimraf=require(_0x1e3f('0x2'));var zipdir=require(_0x1e3f('0x3'));var jsonpatch=require(_0x1e3f('0x4'));var rp=require(_0x1e3f('0x5'));var moment=require('moment');var BPromise=require(_0x1e3f('0x6'));var Mustache=require(_0x1e3f('0x7'));var util=require(_0x1e3f('0x8'));var path=require(_0x1e3f('0x9'));var sox=require(_0x1e3f('0xa'));var csv=require(_0x1e3f('0xb'));var ejs=require(_0x1e3f('0xc'));var fs=require('fs');var _=require(_0x1e3f('0xd'));var squel=require('squel');var crypto=require(_0x1e3f('0xe'));var jsforce=require(_0x1e3f('0xf'));var deskjs=require(_0x1e3f('0x10'));var toCsv=require(_0x1e3f('0xb'));var querystring=require(_0x1e3f('0x11'));var Papa=require(_0x1e3f('0x12'));var AWS=require(_0x1e3f('0x13'));var uuidv4=require(_0x1e3f('0x14'));var Redis=require(_0x1e3f('0x15'));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(_0x1e3f('0x16'))(_0x1e3f('0x17'));var utils=require(_0x1e3f('0x18'));var config=require(_0x1e3f('0x19'));var db=require(_0x1e3f('0x1a'))['db'];function respondWithStatusCode(_0x3e4b5c,_0x4f7b1c){_0x4f7b1c=_0x4f7b1c||0xcc;return function(_0x544eda){if(_0x544eda){return _0x3e4b5c[_0x1e3f('0x1b')](_0x4f7b1c);}return _0x3e4b5c[_0x1e3f('0x1c')](_0x4f7b1c)[_0x1e3f('0x1d')]();};}function respondWithResult(_0x1d7602,_0x2d7f9a){_0x2d7f9a=_0x2d7f9a||0xc8;return function(_0x2ace67){if(_0x2ace67){return _0x1d7602[_0x1e3f('0x1c')](_0x2d7f9a)['json'](_0x2ace67);}};}function respondWithFilteredResult(_0x194675,_0x1dc5cd){return function(_0x519b5b){if(_0x519b5b){var _0x48067b=_0x519b5b[_0x1e3f('0x1e')],_0xce7ff0=_0x1dc5cd[_0x1e3f('0x1f')],_0x1dc72b=_0x1dc5cd[_0x1e3f('0x1f')]+_0x1dc5cd[_0x1e3f('0x20')],_0x41ed7e;if(_0x1dc72b>=_0x48067b){_0x1dc72b=_0x48067b;_0x41ed7e=0xc8;}else{_0x41ed7e=0xce;}_0x194675[_0x1e3f('0x1c')](_0x41ed7e);return _0x194675['set'](_0x1e3f('0x21'),_0xce7ff0+'-'+_0x1dc72b+'/'+_0x48067b)[_0x1e3f('0x22')](_0x519b5b);}return null;};}function patchUpdates(_0x17dd79){return function(_0x30f18d){try{jsonpatch[_0x1e3f('0x23')](_0x30f18d,_0x17dd79,!![]);}catch(_0x6230b6){return BPromise[_0x1e3f('0x24')](_0x6230b6);}return _0x30f18d['save']();};}function saveUpdates(_0x2c40ef,_0x28e341){return function(_0x3aa84c){if(_0x3aa84c){return _0x3aa84c['update'](_0x2c40ef)['then'](function(_0x723622){return _0x723622;});}return null;};}function removeEntity(_0x5b84c8,_0x448b4b){return function(_0xe7d828){if(_0xe7d828){return _0xe7d828[_0x1e3f('0x25')]()[_0x1e3f('0x26')](function(){_0x5b84c8[_0x1e3f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x375ae5,_0x5abf97){return function(_0x166003){if(!_0x166003){_0x375ae5['sendStatus'](0x194);}return _0x166003;};}function handleError(_0x1add09,_0x311497){_0x311497=_0x311497||0x1f4;return function(_0x33b01f){logger[_0x1e3f('0x27')](_0x33b01f[_0x1e3f('0x28')]);if(_0x33b01f[_0x1e3f('0x29')]){delete _0x33b01f[_0x1e3f('0x29')];}_0x1add09[_0x1e3f('0x1c')](_0x311497)[_0x1e3f('0x2a')](_0x33b01f);};}exports[_0x1e3f('0x2b')]=function(_0x33da65,_0x238136){var _0x7d9e39={},_0x208cb3={},_0x5a1f76={'count':0x0,'rows':[]};var _0x4a3b52=_['map'](db[_0x1e3f('0x2c')][_0x1e3f('0x2d')],function(_0xdcf75a){return{'name':_0xdcf75a[_0x1e3f('0x2e')],'type':_0xdcf75a[_0x1e3f('0x2f')]['key']};});_0x208cb3[_0x1e3f('0x30')]=_[_0x1e3f('0x31')](_[_0x1e3f('0x32')](_0x4a3b52,'name'),['format']);_0x208cb3[_0x1e3f('0x33')]=_['keys'](_0x33da65[_0x1e3f('0x33')]);_0x208cb3[_0x1e3f('0x34')]=_[_0x1e3f('0x35')](_0x208cb3[_0x1e3f('0x30')],_0x208cb3[_0x1e3f('0x33')]);_0x7d9e39[_0x1e3f('0x36')]=_['intersection'](_0x208cb3[_0x1e3f('0x30')],qs[_0x1e3f('0x37')](_0x33da65[_0x1e3f('0x33')][_0x1e3f('0x37')]));_0x7d9e39[_0x1e3f('0x36')]=_0x7d9e39[_0x1e3f('0x36')][_0x1e3f('0x38')]?_0x7d9e39[_0x1e3f('0x36')]:_0x208cb3['model'];if(!_0x33da65[_0x1e3f('0x33')]['hasOwnProperty'](_0x1e3f('0x39'))){_0x7d9e39['limit']=qs[_0x1e3f('0x20')](_0x33da65[_0x1e3f('0x33')][_0x1e3f('0x20')]);_0x7d9e39[_0x1e3f('0x1f')]=qs[_0x1e3f('0x1f')](_0x33da65[_0x1e3f('0x33')][_0x1e3f('0x1f')]);}_0x7d9e39[_0x1e3f('0x3a')]=qs[_0x1e3f('0x3b')](_0x33da65[_0x1e3f('0x33')][_0x1e3f('0x3b')]);_0x7d9e39['where']=qs['filters'](_['pick'](_0x33da65['query'],_0x208cb3[_0x1e3f('0x34')]),_0x4a3b52);if(_0x33da65[_0x1e3f('0x33')][_0x1e3f('0x3c')]){_0x7d9e39[_0x1e3f('0x3d')]=_[_0x1e3f('0x3e')](_0x7d9e39[_0x1e3f('0x3d')],{'$or':_[_0x1e3f('0x32')](_0x4a3b52,function(_0x66fcf9){if(_0x66fcf9[_0x1e3f('0x2f')]!==_0x1e3f('0x3f')){var _0x53c117={};_0x53c117[_0x66fcf9['name']]={'$like':'%'+_0x33da65[_0x1e3f('0x33')]['filter']+'%'};return _0x53c117;}})});}_0x7d9e39=_[_0x1e3f('0x3e')]({},_0x7d9e39,_0x33da65[_0x1e3f('0x40')]);var _0xe8566={'where':_0x7d9e39[_0x1e3f('0x3d')]};return db[_0x1e3f('0x2c')]['count'](_0xe8566)[_0x1e3f('0x26')](function(_0x1d273c){_0x5a1f76['count']=_0x1d273c;if(_0x33da65['query'][_0x1e3f('0x41')]){_0x7d9e39[_0x1e3f('0x42')]=[{'all':!![]}];}return db[_0x1e3f('0x2c')]['findAll'](_0x7d9e39);})[_0x1e3f('0x26')](function(_0x5ded88){_0x5a1f76[_0x1e3f('0x43')]=_0x5ded88;return _0x5a1f76;})[_0x1e3f('0x26')](respondWithFilteredResult(_0x238136,_0x7d9e39))[_0x1e3f('0x44')](handleError(_0x238136,null));};exports['show']=function(_0x3a715e,_0x37292b){var _0x175b21={'raw':![],'where':{'id':_0x3a715e[_0x1e3f('0x45')]['id']}},_0x456792={};_0x456792[_0x1e3f('0x30')]=_['keys'](db[_0x1e3f('0x2c')][_0x1e3f('0x2d')]);_0x456792[_0x1e3f('0x33')]=_[_0x1e3f('0x46')](_0x3a715e[_0x1e3f('0x33')]);_0x456792['filters']=_[_0x1e3f('0x35')](_0x456792['model'],_0x456792[_0x1e3f('0x33')]);_0x175b21[_0x1e3f('0x36')]=_[_0x1e3f('0x35')](_0x456792[_0x1e3f('0x30')],qs[_0x1e3f('0x37')](_0x3a715e[_0x1e3f('0x33')][_0x1e3f('0x37')]));_0x175b21[_0x1e3f('0x36')]=_0x175b21[_0x1e3f('0x36')][_0x1e3f('0x38')]?_0x175b21[_0x1e3f('0x36')]:_0x456792[_0x1e3f('0x30')];if(_0x3a715e[_0x1e3f('0x33')][_0x1e3f('0x41')]){_0x175b21[_0x1e3f('0x42')]=[{'all':!![]}];}_0x175b21=_[_0x1e3f('0x3e')]({},_0x175b21,_0x3a715e[_0x1e3f('0x40')]);return db['VoiceRecording'][_0x1e3f('0x47')](_0x175b21)[_0x1e3f('0x26')](handleEntityNotFound(_0x37292b,null))[_0x1e3f('0x26')](respondWithResult(_0x37292b,null))[_0x1e3f('0x44')](handleError(_0x37292b,null));};exports[_0x1e3f('0x48')]=function(_0x2e28d8,_0x7066f2){return db['VoiceRecording'][_0x1e3f('0x48')](_0x2e28d8['body'],{})[_0x1e3f('0x26')](respondWithResult(_0x7066f2,0xc9))[_0x1e3f('0x44')](handleError(_0x7066f2,null));};exports[_0x1e3f('0x49')]=function(_0x49b2ad,_0x19262d){if(_0x49b2ad[_0x1e3f('0x4a')]['id']){delete _0x49b2ad[_0x1e3f('0x4a')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x49b2ad[_0x1e3f('0x45')]['id']}})['then'](handleEntityNotFound(_0x19262d,null))[_0x1e3f('0x26')](saveUpdates(_0x49b2ad[_0x1e3f('0x4a')],null))[_0x1e3f('0x26')](respondWithResult(_0x19262d,null))['catch'](handleError(_0x19262d,null));};exports[_0x1e3f('0x4b')]=function(_0xae837f,_0x68f943){return db[_0x1e3f('0x2c')]['describe']()[_0x1e3f('0x26')](respondWithResult(_0x68f943,null))[_0x1e3f('0x44')](handleError(_0x68f943,null));};exports[_0x1e3f('0x4c')]=function(_0x3316c3,_0x1a1358,_0x30a6b3){var _0x39cb85=require('../../components/encryptor');var _0xf2a5cf=![];var _0x1d1da7={};if(_0x3316c3[_0x1e3f('0x33')][_0x1e3f('0x2f')]&&_0x3316c3[_0x1e3f('0x33')][_0x1e3f('0x2f')]===_0x1e3f('0x4d')){_0x1d1da7[_0x1e3f('0x4d')]=_0x3316c3['params']['id'];}else{_0x1d1da7['id']=_0x3316c3['params']['id'];}return db['VoiceRecording'][_0x1e3f('0x47')]({'where':_0x1d1da7,'attributes':['id',_0x1e3f('0x4e')],'raw':!![]})[_0x1e3f('0x26')](handleEntityNotFound(_0x1a1358,null))['then'](function(_0x77066a){if(_0x77066a){var _0x4aa15e=_0x77066a[_0x1e3f('0x4e')];var _0x1bbb50=util['format'](_0x1e3f('0x4f'),_0x4aa15e);if(fs[_0x1e3f('0x50')](_0x1bbb50)){_0xf2a5cf=!![];return _0x39cb85[_0x1e3f('0x51')](_0x1bbb50,_0x4aa15e,config[_0x1e3f('0x52')]['recording'])[_0x1e3f('0x26')](function(){return _0x77066a;});}return _0x77066a;}})[_0x1e3f('0x26')](function(_0x46e3a6){if(_0x46e3a6){var _0x12459c=_0x46e3a6[_0x1e3f('0x4e')];if(!fs[_0x1e3f('0x50')](_0x12459c)){throw new db[(_0x1e3f('0x53'))][(_0x1e3f('0x54'))](_0x1e3f('0x55'));}if(_0x46e3a6[_0x1e3f('0x56')]){return _0x1a1358[_0x1e3f('0x4c')](_0x12459c,_0x46e3a6['filename']+path['extname'](_0x12459c),function(){if(_0xf2a5cf){fs['unlink'](_0x12459c);}});}else{return _0x1a1358['download'](_0x12459c,function(_0x106c8b){if(_0xf2a5cf){fs['unlink'](_0x12459c);}});}}})[_0x1e3f('0x44')](function(_0x547d62){if(_0x547d62[_0x1e3f('0x57')]===_0x1e3f('0x55')){_0x1a1358[_0x1e3f('0x1c')](0x194)[_0x1e3f('0x2a')]('Not\x20found');}else{return handleError(_0x1a1358,null);}});};exports[_0x1e3f('0x58')]=function(_0x4f5bab,_0x1012b6,_0x2f29c2){var _0x1448bd=require(_0x1e3f('0x59'));var _0x469b0f=![];var _0x36eb70={'$and':[db['sequelize'][_0x1e3f('0x3d')](db[_0x1e3f('0x5a')]['fn']('MD5',db[_0x1e3f('0x5a')][_0x1e3f('0x5b')](_0x1e3f('0x4d'))),_0x4f5bab[_0x1e3f('0x33')][_0x1e3f('0x5c')])]};if(_0x4f5bab[_0x1e3f('0x33')][_0x1e3f('0x2f')]&&_0x4f5bab[_0x1e3f('0x33')][_0x1e3f('0x2f')]===_0x1e3f('0x4d')){_0x36eb70['$and']['push']({'uniqueid':_0x4f5bab[_0x1e3f('0x45')]['id']});}else{_0x36eb70[_0x1e3f('0x5d')][_0x1e3f('0x5e')]({'id':_0x4f5bab['params']['id']});}return db[_0x1e3f('0x2c')][_0x1e3f('0x47')]({'where':_0x36eb70,'attributes':['id','value'],'raw':!![]})[_0x1e3f('0x26')](handleEntityNotFound(_0x1012b6,null))[_0x1e3f('0x26')](function(_0x1935c8){if(_0x1935c8){var _0x56935d=util[_0x1e3f('0x5f')](_0x1e3f('0x4f'),_0x1935c8[_0x1e3f('0x4e')]);if(fs['existsSync'](_0x56935d)){_0x469b0f=!![];return _0x1448bd[_0x1e3f('0x51')](_0x56935d,_0x1935c8[_0x1e3f('0x4e')],config['secrets']['recording'])[_0x1e3f('0x26')](function(){return _0x1935c8;});}return _0x1935c8;}})[_0x1e3f('0x26')](function(_0x446828){if(_0x446828){if(!fs[_0x1e3f('0x50')](_0x446828[_0x1e3f('0x4e')])){throw new db[(_0x1e3f('0x53'))][(_0x1e3f('0x54'))]('VoiceRecording\x20not\x20found');}if(_0x446828[_0x1e3f('0x56')]){return _0x1012b6[_0x1e3f('0x4c')](_0x446828[_0x1e3f('0x4e')],_0x446828[_0x1e3f('0x56')]+path[_0x1e3f('0x60')](_0x446828['value']),function(){if(_0x469b0f){fs[_0x1e3f('0x61')](_0x446828[_0x1e3f('0x4e')]);}});}else{return _0x1012b6[_0x1e3f('0x4c')](_0x446828[_0x1e3f('0x4e')],function(_0x13cca7){if(_0x469b0f){fs['unlink'](_0x446828['value']);}});}}})[_0x1e3f('0x44')](handleError(_0x1012b6,null));};exports['destroy']=function(_0x1355f1,_0x2e8ce4){return db[_0x1e3f('0x2c')][_0x1e3f('0x47')]({'where':{'id':_0x1355f1[_0x1e3f('0x45')]['id']}})[_0x1e3f('0x26')](function(_0x45c017){if(!_0x45c017)throw new ReferenceError('Entity\x20not\x20found');return _0x45c017;})[_0x1e3f('0x26')](function(_0x2d444d){var _0x4a3c6f=_0x2d444d[_0x1e3f('0x4e')];logger[_0x1e3f('0x62')](_0x1e3f('0x63'),_0x4a3c6f);if(!_[_0x1e3f('0x64')](_0x2d444d['value'])&&fs[_0x1e3f('0x50')](_0x4a3c6f)){logger[_0x1e3f('0x62')](_0x1e3f('0x65')+_0x4a3c6f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1e3f('0x66')](_0x4a3c6f);}_0x4a3c6f=_0x4a3c6f+'.cypher';if(!_['isNil'](_0x2d444d[_0x1e3f('0x4e')])&&fs[_0x1e3f('0x50')](_0x4a3c6f)){logger[_0x1e3f('0x62')](_0x1e3f('0x65')+_0x4a3c6f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1e3f('0x66')](_0x4a3c6f);}return _0x2d444d;})[_0x1e3f('0x26')](function(_0x3a4e44){if(!_0x3a4e44)throw new InternalError();return _0x3a4e44[_0x1e3f('0x25')]();})[_0x1e3f('0x26')](function(){_0x2e8ce4[_0x1e3f('0x1c')](0xcc)[_0x1e3f('0x1d')]();})['catch'](handleError(_0x2e8ce4,null));};function getBucketslist(_0x5875a2,_0x1d80b6,_0x30b0fd){return new Promise(function(_0x11f16f,_0x1dc921){var _0x5c3294=new AWS['S3']({'accessKeyId':_0x1d80b6,'secretAccessKey':_0x5875a2,'region':_0x30b0fd});_0x5c3294[_0x1e3f('0x67')]({},function(_0xa5186e,_0x166ab9){if(_0xa5186e){return _0x1dc921(_0xa5186e);}else{return _0x11f16f(_0x166ab9);}});});}function createBucket(_0x182289,_0x2d86c2,_0x40ec63,_0x295a55){return new Promise(function(_0x2ed6cf,_0x318329){var _0x8a4316=new AWS['S3']({'accessKeyId':_0x2d86c2,'secretAccessKey':_0x182289,'region':_0x40ec63});_0x8a4316[_0x1e3f('0x68')]({'Bucket':_0x295a55},function(_0x51330,_0x43a1a8){if(_0x51330){return _0x318329(_0x51330);}else{return _0x2ed6cf(_0x43a1a8);}});});}function uploadFile(_0x28e483,_0x4206d6,_0x37ff42,_0x226d51,_0x4c980b,_0x3215c5){return new Promise(function(_0x175177,_0x4993ff){var _0x22d6ff=new AWS['S3']({'accessKeyId':_0x4206d6,'secretAccessKey':_0x28e483,'region':_0x37ff42});_0x22d6ff['upload']({'Bucket':_0x226d51,'Key':_0x4c980b,'Body':_0x3215c5},function(_0x504f24,_0x5dc687){if(_0x504f24){return _0x4993ff(_0x504f24);}else{return _0x175177(_0x5dc687);}});});}function startTranscribe(_0x22504a,_0x3c0ca3,_0x4cc4f5,_0x602f9e,_0x8f30c9,_0x54a3df){return new Promise(function(_0x51eb4a,_0x20c45e){var _0x51faf8=new AWS['TranscribeService']({'accessKeyId':_0x3c0ca3,'secretAccessKey':_0x22504a,'region':_0x4cc4f5});_0x51faf8[_0x1e3f('0x69')]({'TranscriptionJobName':_0x602f9e,'LanguageCode':_0x8f30c9,'Media':{'MediaFileUri':_0x54a3df}},function(_0x27757f,_0x5de6c4){if(_0x27757f){return _0x20c45e(_0x27757f);}else{return _0x51eb4a(_0x5de6c4);}});});}function transcribe(_0x2d00be,_0x4a6f43,_0x37f7e0,_0x5a6fb8,_0x6b085a,_0x3cc7ad,_0x262004){return new Promise(function(_0x3798c0,_0x4a3457){var _0x2503f2={};logger['info'](util[_0x1e3f('0x5f')](_0x1e3f('0x6a'),_0x2d00be,_0x6b085a));return uploadFile(_0x4a6f43,_0x37f7e0,_0x5a6fb8,_0x6b085a,path['basename'](_0x3cc7ad),fs['readFileSync'](_0x3cc7ad))[_0x1e3f('0x26')](function(_0x4d6684){logger[_0x1e3f('0x62')](util['format'](_0x1e3f('0x6b'),_0x2d00be,_0x6b085a,_0x4d6684[_0x1e3f('0x6c')]));_0x2503f2['bucket']=_0x4d6684[_0x1e3f('0x6d')];_0x2503f2[_0x1e3f('0x6e')]=_0x4d6684[_0x1e3f('0x6c')];logger[_0x1e3f('0x62')](util[_0x1e3f('0x5f')](_0x1e3f('0x6f'),_0x2d00be));return startTranscribe(_0x4a6f43,_0x37f7e0,_0x5a6fb8,uuidv4(),_0x262004,_0x4d6684[_0x1e3f('0x6c')]);})[_0x1e3f('0x26')](function(_0x258e18){logger['info'](util[_0x1e3f('0x5f')](_0x1e3f('0x70'),_0x2d00be,_0x258e18[_0x1e3f('0x71')][_0x1e3f('0x72')]));_0x2503f2['transcribeName']=_0x258e18[_0x1e3f('0x71')][_0x1e3f('0x72')];_0x2503f2['transcribeStatus']=_0x258e18[_0x1e3f('0x71')]['TranscriptionJobStatus'];return _0x3798c0(_0x2503f2);})['catch'](function(_0x222e22){return _0x4a3457(_0x222e22);});});}exports[_0x1e3f('0x73')]=function(_0x3e8824,_0x593bbf,_0x284715){var _0x21e9e8;var _0x28e318;var _0x58e5b2;var _0x4356d1=require(_0x1e3f('0x59'));return db[_0x1e3f('0x2c')]['findOne']({'where':{'id':_0x3e8824['params']['id']}})[_0x1e3f('0x26')](function(_0x290fe0){if(_0x290fe0){var _0x3b2c55=util['format'](_0x1e3f('0x4f'),_0x290fe0[_0x1e3f('0x4e')]);if(fs[_0x1e3f('0x50')](_0x3b2c55)){cypher=!![];return _0x4356d1[_0x1e3f('0x51')](_0x3b2c55,_0x290fe0[_0x1e3f('0x4e')],config['secrets']['recording'])[_0x1e3f('0x26')](function(){return _0x290fe0;});}return _0x290fe0;}})[_0x1e3f('0x26')](function(_0x3b4fa0){if(!_0x3b4fa0){throw new db[(_0x1e3f('0x53'))][(_0x1e3f('0x54'))]('Voice\x20Recording\x20not\x20found');}_0x28e318=_0x3b4fa0;return db[_0x1e3f('0x74')]['findOne']({'where':{'id':0x1}});})[_0x1e3f('0x26')](handleEntityNotFound(_0x593bbf,null))['then'](function(_0x15738f){if(_0x15738f){_0x21e9e8=_0x15738f;if(!_0x21e9e8[_0x1e3f('0x75')]||!_0x21e9e8[_0x1e3f('0x76')]||!_0x21e9e8[_0x1e3f('0x77')]||!_0x21e9e8['language']||!_0x21e9e8[_0x1e3f('0x78')]){throw new db[(_0x1e3f('0x53'))][(_0x1e3f('0x54'))](_0x1e3f('0x79'));}if(_0x3e8824[_0x1e3f('0x4a')][_0x1e3f('0x7a')]&&(!_0x21e9e8[_0x1e3f('0x7b')]||!_0x21e9e8[_0x1e3f('0x7c')]||!_0x21e9e8['sentimentRegion']||!_0x21e9e8['language']||!_0x21e9e8[_0x1e3f('0x78')])){throw new db['Sequelize'][(_0x1e3f('0x54'))](_0x1e3f('0x7d'));}return db['CloudProvider']['findOne']({'where':{'id':_0x21e9e8[_0x1e3f('0x76')]}});}})[_0x1e3f('0x26')](function(_0x48bd75){if(!_0x48bd75){throw new db[(_0x1e3f('0x53'))][(_0x1e3f('0x54'))](_0x1e3f('0x7e'));}if(!_0x48bd75[_0x1e3f('0x7f')]||!_0x48bd75[_0x1e3f('0x80')]){throw new db[(_0x1e3f('0x53'))]['ValidationError'](_0x1e3f('0x81'));}_0x58e5b2=_0x48bd75;return getBucketslist(_0x58e5b2[_0x1e3f('0x7f')],_0x58e5b2[_0x1e3f('0x80')],_0x21e9e8[_0x1e3f('0x77')]);})[_0x1e3f('0x26')](function(_0xd61d32){if(_0xd61d32&&_0xd61d32[_0x1e3f('0x82')]){var _0x456f6b=_[_0x1e3f('0x47')](_0xd61d32[_0x1e3f('0x82')],function(_0x1ba0c2){return _0x1ba0c2['Name']===_0x21e9e8['bucket'];});if(!_0x456f6b){logger['info'](util[_0x1e3f('0x5f')](_0x1e3f('0x83'),_0x3e8824[_0x1e3f('0x45')]['id'],_0x21e9e8['bucket']));return createBucket(_0x58e5b2[_0x1e3f('0x7f')],_0x58e5b2[_0x1e3f('0x80')],_0x21e9e8[_0x1e3f('0x77')],_0x21e9e8[_0x1e3f('0x78')]);}logger[_0x1e3f('0x62')](util[_0x1e3f('0x5f')](_0x1e3f('0x84'),_0x3e8824[_0x1e3f('0x45')]['id'],_0x21e9e8[_0x1e3f('0x78')]));return;}})[_0x1e3f('0x26')](function(_0x3ba4c4){if(_0x28e318['transcribeStatus']===_0x1e3f('0x85')){return transcribe(_0x3e8824[_0x1e3f('0x45')]['id'],_0x58e5b2['data1'],_0x58e5b2[_0x1e3f('0x80')],_0x21e9e8[_0x1e3f('0x77')],_0x21e9e8[_0x1e3f('0x78')],_0x28e318[_0x1e3f('0x4e')],_0x21e9e8[_0x1e3f('0x86')]);}else{logger[_0x1e3f('0x62')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x3e8824[_0x1e3f('0x45')]['id']));return{'transcribeStatus':_0x1e3f('0x87')};}})[_0x1e3f('0x26')](function(_0x960e69){if(_0x960e69){_0x960e69[_0x1e3f('0x88')]=_0x3e8824[_0x1e3f('0x4a')][_0x1e3f('0x7a')];return _0x28e318['updateAttributes'](_0x960e69);}})['then'](respondWithResult(_0x593bbf,null))[_0x1e3f('0x44')](handleError(_0x593bbf,null));};function writeFile(_0x1cccf1,_0x383bee){return new Promise(function(_0x3af194,_0x387151){fs[_0x1e3f('0x89')](_0x383bee,_0x1cccf1,function(_0x579643,_0x4759aa){if(_0x579643){return _0x387151(_0x579643);}else{return _0x3af194(_0x4759aa);}});});}exports[_0x1e3f('0x8a')]=function(_0x254846,_0x2779e1,_0x4b8358){return db[_0x1e3f('0x2c')][_0x1e3f('0x8b')]({'where':{'id':_0x254846['params']['id']}})[_0x1e3f('0x26')](handleEntityNotFound(_0x2779e1))['then'](function(_0xfec8e5){if(_0xfec8e5&&_0xfec8e5[_0x1e3f('0x8c')]){var _0x4994ff=_0xfec8e5[_0x1e3f('0x8c')];var _0x53dfce=config[_0x1e3f('0x8d')]+_0x1e3f('0x8e')+_0xfec8e5['id']+'.txt';if(fs[_0x1e3f('0x50')](_0x53dfce)){return _0x53dfce;}return writeFile(_0x4994ff,_0x53dfce)[_0x1e3f('0x26')](function(){return _0x53dfce;});}else{throw new db[(_0x1e3f('0x53'))][(_0x1e3f('0x54'))](_0x1e3f('0x8f'));}})[_0x1e3f('0x26')](function(_0x255a59){return _0x2779e1['download'](_0x255a59);})[_0x1e3f('0x44')](handleError(_0x2779e1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index bb5c437..7e85d9e 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 _0x3e24=['request-promise','path','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xf2d9f2,_0x29743b){var _0x5ea1ba=function(_0xeb569b){while(--_0xeb569b){_0xf2d9f2['push'](_0xf2d9f2['shift']());}};_0x5ea1ba(++_0x29743b);}(_0x3e24,0x167));var _0x43e2=function(_0x4f9673,_0x4313bd){_0x4f9673=_0x4f9673-0x0;var _0x337e5e=_0x3e24[_0x4f9673];return _0x337e5e;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var logger=require(_0x43e2('0x2'))(_0x43e2('0x3'));var moment=require(_0x43e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43e2('0x5'));var fs=require('fs');var path=require(_0x43e2('0x6'));var rimraf=require('rimraf');var config=require(_0x43e2('0x7'));var attributes=require(_0x43e2('0x8'));module[_0x43e2('0x9')]=function(_0x28b144,_0x43b5a7){return _0x28b144[_0x43e2('0xa')](_0x43e2('0xb'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x43e2('0xc'),'fields':[_0x43e2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x539d=['rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid','lodash','../../config/logger','api','request-promise','path'];(function(_0x4a3f1a,_0x319d23){var _0x3a72f5=function(_0x501308){while(--_0x501308){_0x4a3f1a['push'](_0x4a3f1a['shift']());}};_0x3a72f5(++_0x319d23);}(_0x539d,0x17b));var _0xd539=function(_0x3a7db0,_0xe93c50){_0x3a7db0=_0x3a7db0-0x0;var _0x17cbba=_0x539d[_0x3a7db0];return _0x17cbba;};'use strict';var _=require(_0xd539('0x0'));var util=require('util');var logger=require(_0xd539('0x1'))(_0xd539('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd539('0x3'));var fs=require('fs');var path=require(_0xd539('0x4'));var rimraf=require(_0xd539('0x5'));var config=require(_0xd539('0x6'));var attributes=require(_0xd539('0x7'));module['exports']=function(_0x341dd4,_0x158719){return _0x341dd4[_0xd539('0x8')](_0xd539('0x9'),attributes,{'tableName':_0xd539('0xa'),'paranoid':![],'indexes':[{'name':_0xd539('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7840f2f..c2fc004 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(_0x26da89,_0x264785){var _0xc95b7b=function(_0x230e5b){while(--_0x230e5b){_0x26da89['push'](_0x26da89['shift']());}};_0xc95b7b(++_0x264785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['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(_0x52ca59,_0x279dda){var _0x1ab7e5=function(_0x2b8c74){while(--_0x2b8c74){_0x52ca59['push'](_0x52ca59['shift']());}};_0x1ab7e5(++_0x279dda);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 04f94f0..390b4db 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 _0xc1c6=['show','post','put','/:id','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x4a58b1,_0x54a49f){var _0x1b0599=function(_0x438fcf){while(--_0x438fcf){_0x4a58b1['push'](_0x4a58b1['shift']());}};_0x1b0599(++_0x54a49f);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2204a3,_0x30fac2){_0x2204a3=_0x2204a3-0x0;var _0x1529a3=_0xc1c6[_0x2204a3];return _0x1529a3;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var auth=require(_0x6c1c('0x4'));var interaction=require(_0x6c1c('0x5'));var config=require(_0x6c1c('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x6c1c('0x7')](),controller['index']);router[_0x6c1c('0x8')]('/:id',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x9')]);router[_0x6c1c('0xa')]('/',auth[_0x6c1c('0x7')](),controller['create']);router[_0x6c1c('0xb')](_0x6c1c('0xc'),auth['isAuthenticated'](),controller[_0x6c1c('0xd')]);router[_0x6c1c('0xe')](_0x6c1c('0xc'),auth[_0x6c1c('0x7')](),controller['destroy']);module[_0x6c1c('0xf')]=router; \ No newline at end of file +var _0x7096=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x298f55,_0x7e9f0c){var _0x4dea4b=function(_0x149075){while(--_0x149075){_0x298f55['push'](_0x298f55['shift']());}};_0x4dea4b(++_0x7e9f0c);}(_0x7096,0x10c));var _0x6709=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x7096[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x6709('0x0'));var path=require('path');var timeout=require(_0x6709('0x1'));var express=require('express');var router=express[_0x6709('0x2')]();var auth=require(_0x6709('0x3'));var interaction=require(_0x6709('0x4'));var config=require(_0x6709('0x5'));var controller=require(_0x6709('0x6'));router[_0x6709('0x7')]('/',auth[_0x6709('0x8')](),controller[_0x6709('0x9')]);router[_0x6709('0x7')](_0x6709('0xa'),auth[_0x6709('0x8')](),controller[_0x6709('0xb')]);router[_0x6709('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6709('0xd')](_0x6709('0xa'),auth[_0x6709('0x8')](),controller[_0x6709('0xe')]);router[_0x6709('0xf')](_0x6709('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x6709('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 58f3dac..30ae941 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 _0xcf15=['sequelize','moment','exports','ENUM','blind','attended','STRING'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0xcf15,0x157));var _0x5cf1=function(_0x21b9e1,_0x1bfc06){_0x21b9e1=_0x21b9e1-0x0;var _0x190111=_0xcf15[_0x21b9e1];return _0x190111;};'use strict';var Sequelize=require(_0x5cf1('0x0'));var moment=require(_0x5cf1('0x1'));module[_0x5cf1('0x2')]={'type':{'type':Sequelize[_0x5cf1('0x3')](_0x5cf1('0x4'),_0x5cf1('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x5cf1('0x6')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x5cf1('0x6')]},'transferercontext':{'type':Sequelize[_0x5cf1('0x6')]},'transfererexten':{'type':Sequelize[_0x5cf1('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x5cf1('0x6')]},'transfereechannel':{'type':Sequelize[_0x5cf1('0x6')]},'transfereecalleridnum':{'type':Sequelize[_0x5cf1('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x5cf1('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5cf1('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5cf1('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x5cf1('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x5cf1('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x5cf1('0x6')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x5cf1('0x6')]},'extension':{'type':Sequelize[_0x5cf1('0x6')]}}; \ No newline at end of file +var _0x8957=['exports','ENUM','blind','attended','STRING','Yes','moment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8957,0xed));var _0x7895=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8957[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7895('0x0'));module[_0x7895('0x1')]={'type':{'type':Sequelize[_0x7895('0x2')](_0x7895('0x3'),_0x7895('0x4'))},'result':{'type':Sequelize[_0x7895('0x5')]},'transfererchannel':{'type':Sequelize[_0x7895('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x7895('0x5')]},'transferercalleridname':{'type':Sequelize[_0x7895('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x7895('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x7895('0x5')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x7895('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x7895('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x7895('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x7895('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7895('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x7895('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x7895('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x7895('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x7895('0x2')](_0x7895('0x6'),'No')},'context':{'type':Sequelize[_0x7895('0x5')]},'extension':{'type':Sequelize[_0x7895('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 872b941..d25621b 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 _0xf827=['error','send','index','map','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','filter','where','merge','VIRTUAL','options','VoiceTransferReport','rows','catch','show','includeAll','include','find','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','sendStatus','status','end','json','count','limit','set','Content-Range','reject','update','then'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xf827,0xb6));var _0x7f82=function(_0x440c6a,_0x14b7b2){_0x440c6a=_0x440c6a-0x0;var _0x515a7d=_0xf827[_0x440c6a];return _0x515a7d;};'use strict';var pdf=require(_0x7f82('0x0'));var emlformat=require(_0x7f82('0x1'));var rimraf=require(_0x7f82('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7f82('0x3'));var rp=require(_0x7f82('0x4'));var moment=require(_0x7f82('0x5'));var BPromise=require(_0x7f82('0x6'));var Mustache=require(_0x7f82('0x7'));var util=require(_0x7f82('0x8'));var path=require(_0x7f82('0x9'));var sox=require(_0x7f82('0xa'));var csv=require(_0x7f82('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f82('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7f82('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7f82('0xe'));var Papa=require(_0x7f82('0xf'));var Redis=require(_0x7f82('0x10'));var authService=require(_0x7f82('0x11'));var qs=require(_0x7f82('0x12'));var as=require(_0x7f82('0x13'));var hardwareService=require(_0x7f82('0x14'));var logger=require(_0x7f82('0x15'))(_0x7f82('0x16'));var utils=require(_0x7f82('0x17'));var config=require(_0x7f82('0x18'));var db=require(_0x7f82('0x19'))['db'];function respondWithStatusCode(_0x5aae09,_0x11cd6d){_0x11cd6d=_0x11cd6d||0xcc;return function(_0x3ac8cd){if(_0x3ac8cd){return _0x5aae09[_0x7f82('0x1a')](_0x11cd6d);}return _0x5aae09[_0x7f82('0x1b')](_0x11cd6d)[_0x7f82('0x1c')]();};}function respondWithResult(_0x38a3fb,_0x4089be){_0x4089be=_0x4089be||0xc8;return function(_0x6363d2){if(_0x6363d2){return _0x38a3fb['status'](_0x4089be)[_0x7f82('0x1d')](_0x6363d2);}};}function respondWithFilteredResult(_0x3e8ec,_0x120b12){return function(_0x5f12d3){if(_0x5f12d3){var _0x5140e0=_0x5f12d3[_0x7f82('0x1e')],_0x3e858e=_0x120b12['offset'],_0x5e1579=_0x120b12['offset']+_0x120b12[_0x7f82('0x1f')],_0x3f9f79;if(_0x5e1579>=_0x5140e0){_0x5e1579=_0x5140e0;_0x3f9f79=0xc8;}else{_0x3f9f79=0xce;}_0x3e8ec[_0x7f82('0x1b')](_0x3f9f79);return _0x3e8ec[_0x7f82('0x20')](_0x7f82('0x21'),_0x3e858e+'-'+_0x5e1579+'/'+_0x5140e0)['json'](_0x5f12d3);}return null;};}function patchUpdates(_0x4ce72b){return function(_0x42d2a6){try{jsonpatch['apply'](_0x42d2a6,_0x4ce72b,!![]);}catch(_0x402265){return BPromise[_0x7f82('0x22')](_0x402265);}return _0x42d2a6['save']();};}function saveUpdates(_0x13151f,_0x463113){return function(_0x177742){if(_0x177742){return _0x177742[_0x7f82('0x23')](_0x13151f)['then'](function(_0x178d74){return _0x178d74;});}return null;};}function removeEntity(_0x418d99,_0x1526da){return function(_0x52af6a){if(_0x52af6a){return _0x52af6a['destroy']()[_0x7f82('0x24')](function(){_0x418d99[_0x7f82('0x1b')](0xcc)[_0x7f82('0x1c')]();});}};}function handleEntityNotFound(_0x528cae,_0x324da7){return function(_0x470158){if(!_0x470158){_0x528cae['sendStatus'](0x194);}return _0x470158;};}function handleError(_0x104cb0,_0x2cf028){_0x2cf028=_0x2cf028||0x1f4;return function(_0x6b3f67){logger[_0x7f82('0x25')](_0x6b3f67['stack']);if(_0x6b3f67['name']){delete _0x6b3f67['name'];}_0x104cb0[_0x7f82('0x1b')](_0x2cf028)[_0x7f82('0x26')](_0x6b3f67);};}exports[_0x7f82('0x27')]=function(_0x30d08c,_0x249959){var _0x218f4f={},_0x5da71c={},_0x2caee8={'count':0x0,'rows':[]};var _0x48865a=_[_0x7f82('0x28')](db['VoiceTransferReport'][_0x7f82('0x29')],function(_0x41519d){return{'name':_0x41519d[_0x7f82('0x2a')],'type':_0x41519d[_0x7f82('0x2b')][_0x7f82('0x2c')]};});_0x5da71c[_0x7f82('0x2d')]=_[_0x7f82('0x28')](_0x48865a,_0x7f82('0x2e'));_0x5da71c['query']=_[_0x7f82('0x2f')](_0x30d08c[_0x7f82('0x30')]);_0x5da71c[_0x7f82('0x31')]=_[_0x7f82('0x32')](_0x5da71c[_0x7f82('0x2d')],_0x5da71c['query']);_0x218f4f['attributes']=_['intersection'](_0x5da71c['model'],qs[_0x7f82('0x33')](_0x30d08c['query'][_0x7f82('0x33')]));_0x218f4f[_0x7f82('0x34')]=_0x218f4f[_0x7f82('0x34')][_0x7f82('0x35')]?_0x218f4f[_0x7f82('0x34')]:_0x5da71c[_0x7f82('0x2d')];if(!_0x30d08c[_0x7f82('0x30')][_0x7f82('0x36')](_0x7f82('0x37'))){_0x218f4f[_0x7f82('0x1f')]=qs['limit'](_0x30d08c[_0x7f82('0x30')][_0x7f82('0x1f')]);_0x218f4f['offset']=qs[_0x7f82('0x38')](_0x30d08c[_0x7f82('0x30')][_0x7f82('0x38')]);}_0x218f4f['order']=qs['sort'](_0x30d08c[_0x7f82('0x30')]['sort']);_0x218f4f['where']=qs[_0x7f82('0x31')](_['pick'](_0x30d08c[_0x7f82('0x30')],_0x5da71c[_0x7f82('0x31')]),_0x48865a);if(_0x30d08c[_0x7f82('0x30')][_0x7f82('0x39')]){_0x218f4f[_0x7f82('0x3a')]=_[_0x7f82('0x3b')](_0x218f4f[_0x7f82('0x3a')],{'$or':_['map'](_0x48865a,function(_0x6123da){if(_0x6123da['type']!==_0x7f82('0x3c')){var _0x2c6640={};_0x2c6640[_0x6123da[_0x7f82('0x2e')]]={'$like':'%'+_0x30d08c['query'][_0x7f82('0x39')]+'%'};return _0x2c6640;}})});}_0x218f4f=_[_0x7f82('0x3b')]({},_0x218f4f,_0x30d08c[_0x7f82('0x3d')]);var _0x1f3920={'where':_0x218f4f[_0x7f82('0x3a')]};return db[_0x7f82('0x3e')][_0x7f82('0x1e')](_0x1f3920)[_0x7f82('0x24')](function(_0x45f838){_0x2caee8[_0x7f82('0x1e')]=_0x45f838;if(_0x30d08c[_0x7f82('0x30')]['includeAll']){_0x218f4f['include']=[{'all':!![]}];}return db[_0x7f82('0x3e')]['findAll'](_0x218f4f);})[_0x7f82('0x24')](function(_0x2ba22f){_0x2caee8[_0x7f82('0x3f')]=_0x2ba22f;return _0x2caee8;})[_0x7f82('0x24')](respondWithFilteredResult(_0x249959,_0x218f4f))[_0x7f82('0x40')](handleError(_0x249959,null));};exports[_0x7f82('0x41')]=function(_0x6cd409,_0xe0e265){var _0x27e991={'raw':!![],'where':{'id':_0x6cd409['params']['id']}},_0x55672f={};_0x55672f[_0x7f82('0x2d')]=_['keys'](db[_0x7f82('0x3e')][_0x7f82('0x29')]);_0x55672f[_0x7f82('0x30')]=_[_0x7f82('0x2f')](_0x6cd409[_0x7f82('0x30')]);_0x55672f[_0x7f82('0x31')]=_['intersection'](_0x55672f[_0x7f82('0x2d')],_0x55672f['query']);_0x27e991[_0x7f82('0x34')]=_[_0x7f82('0x32')](_0x55672f['model'],qs[_0x7f82('0x33')](_0x6cd409[_0x7f82('0x30')]['fields']));_0x27e991[_0x7f82('0x34')]=_0x27e991['attributes'][_0x7f82('0x35')]?_0x27e991[_0x7f82('0x34')]:_0x55672f['model'];if(_0x6cd409[_0x7f82('0x30')][_0x7f82('0x42')]){_0x27e991[_0x7f82('0x43')]=[{'all':!![]}];}_0x27e991=_[_0x7f82('0x3b')]({},_0x27e991,_0x6cd409[_0x7f82('0x3d')]);return db['VoiceTransferReport'][_0x7f82('0x44')](_0x27e991)[_0x7f82('0x24')](handleEntityNotFound(_0xe0e265,null))['then'](respondWithResult(_0xe0e265,null))[_0x7f82('0x40')](handleError(_0xe0e265,null));};exports[_0x7f82('0x45')]=function(_0x2c113e,_0x24676c){return db[_0x7f82('0x3e')][_0x7f82('0x45')](_0x2c113e[_0x7f82('0x46')],{})[_0x7f82('0x24')](respondWithResult(_0x24676c,0xc9))[_0x7f82('0x40')](handleError(_0x24676c,null));};exports[_0x7f82('0x23')]=function(_0x161cd9,_0x244d11){if(_0x161cd9[_0x7f82('0x46')]['id']){delete _0x161cd9[_0x7f82('0x46')]['id'];}return db[_0x7f82('0x3e')][_0x7f82('0x44')]({'where':{'id':_0x161cd9[_0x7f82('0x47')]['id']}})['then'](handleEntityNotFound(_0x244d11,null))['then'](saveUpdates(_0x161cd9['body'],null))[_0x7f82('0x24')](respondWithResult(_0x244d11,null))[_0x7f82('0x40')](handleError(_0x244d11,null));};exports[_0x7f82('0x48')]=function(_0x50bd2b,_0x3240bc){return db[_0x7f82('0x3e')][_0x7f82('0x44')]({'where':{'id':_0x50bd2b['params']['id']}})['then'](handleEntityNotFound(_0x3240bc,null))['then'](removeEntity(_0x3240bc,null))[_0x7f82('0x40')](handleError(_0x3240bc,null));}; \ No newline at end of file +var _0xdfe1=['key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','fields','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdfe1,0x1e1));var _0x1dfe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdfe1[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x1dfe('0x0'));var emlformat=require(_0x1dfe('0x1'));var rimraf=require(_0x1dfe('0x2'));var zipdir=require(_0x1dfe('0x3'));var jsonpatch=require(_0x1dfe('0x4'));var rp=require(_0x1dfe('0x5'));var moment=require(_0x1dfe('0x6'));var BPromise=require(_0x1dfe('0x7'));var Mustache=require(_0x1dfe('0x8'));var util=require(_0x1dfe('0x9'));var path=require(_0x1dfe('0xa'));var sox=require(_0x1dfe('0xb'));var csv=require(_0x1dfe('0xc'));var ejs=require(_0x1dfe('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1dfe('0xe'));var deskjs=require(_0x1dfe('0xf'));var toCsv=require(_0x1dfe('0xc'));var querystring=require('querystring');var Papa=require(_0x1dfe('0x10'));var Redis=require(_0x1dfe('0x11'));var authService=require(_0x1dfe('0x12'));var qs=require(_0x1dfe('0x13'));var as=require(_0x1dfe('0x14'));var hardwareService=require(_0x1dfe('0x15'));var logger=require(_0x1dfe('0x16'))(_0x1dfe('0x17'));var utils=require(_0x1dfe('0x18'));var config=require(_0x1dfe('0x19'));var db=require(_0x1dfe('0x1a'))['db'];function respondWithStatusCode(_0x49432b,_0x382441){_0x382441=_0x382441||0xcc;return function(_0x1585c1){if(_0x1585c1){return _0x49432b[_0x1dfe('0x1b')](_0x382441);}return _0x49432b[_0x1dfe('0x1c')](_0x382441)[_0x1dfe('0x1d')]();};}function respondWithResult(_0x24d562,_0x39a90e){_0x39a90e=_0x39a90e||0xc8;return function(_0x1a9932){if(_0x1a9932){return _0x24d562[_0x1dfe('0x1c')](_0x39a90e)[_0x1dfe('0x1e')](_0x1a9932);}};}function respondWithFilteredResult(_0x53e745,_0x160b20){return function(_0x42e195){if(_0x42e195){var _0x4498f0=_0x42e195[_0x1dfe('0x1f')],_0x588f48=_0x160b20[_0x1dfe('0x20')],_0x57d1dc=_0x160b20[_0x1dfe('0x20')]+_0x160b20[_0x1dfe('0x21')],_0x165c2f;if(_0x57d1dc>=_0x4498f0){_0x57d1dc=_0x4498f0;_0x165c2f=0xc8;}else{_0x165c2f=0xce;}_0x53e745[_0x1dfe('0x1c')](_0x165c2f);return _0x53e745[_0x1dfe('0x22')](_0x1dfe('0x23'),_0x588f48+'-'+_0x57d1dc+'/'+_0x4498f0)[_0x1dfe('0x1e')](_0x42e195);}return null;};}function patchUpdates(_0x263830){return function(_0x1a7461){try{jsonpatch[_0x1dfe('0x24')](_0x1a7461,_0x263830,!![]);}catch(_0x460172){return BPromise[_0x1dfe('0x25')](_0x460172);}return _0x1a7461[_0x1dfe('0x26')]();};}function saveUpdates(_0x2774e4,_0xa96e18){return function(_0x1f4b7a){if(_0x1f4b7a){return _0x1f4b7a[_0x1dfe('0x27')](_0x2774e4)[_0x1dfe('0x28')](function(_0x983b6c){return _0x983b6c;});}return null;};}function removeEntity(_0x297647,_0x365b22){return function(_0x416926){if(_0x416926){return _0x416926[_0x1dfe('0x29')]()[_0x1dfe('0x28')](function(){_0x297647[_0x1dfe('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x222869,_0x909520){return function(_0x2016fb){if(!_0x2016fb){_0x222869[_0x1dfe('0x1b')](0x194);}return _0x2016fb;};}function handleError(_0x47cf94,_0x439fd4){_0x439fd4=_0x439fd4||0x1f4;return function(_0x49e21e){logger[_0x1dfe('0x2a')](_0x49e21e[_0x1dfe('0x2b')]);if(_0x49e21e[_0x1dfe('0x2c')]){delete _0x49e21e['name'];}_0x47cf94[_0x1dfe('0x1c')](_0x439fd4)['send'](_0x49e21e);};}exports[_0x1dfe('0x2d')]=function(_0x348aed,_0x26485f){var _0x51d7ec={},_0x5e4dc0={},_0x2bda55={'count':0x0,'rows':[]};var _0x2d45cf=_[_0x1dfe('0x2e')](db[_0x1dfe('0x2f')][_0x1dfe('0x30')],function(_0x5b534b){return{'name':_0x5b534b[_0x1dfe('0x31')],'type':_0x5b534b[_0x1dfe('0x32')][_0x1dfe('0x33')]};});_0x5e4dc0[_0x1dfe('0x34')]=_[_0x1dfe('0x2e')](_0x2d45cf,'name');_0x5e4dc0[_0x1dfe('0x35')]=_[_0x1dfe('0x36')](_0x348aed[_0x1dfe('0x35')]);_0x5e4dc0[_0x1dfe('0x37')]=_[_0x1dfe('0x38')](_0x5e4dc0['model'],_0x5e4dc0[_0x1dfe('0x35')]);_0x51d7ec['attributes']=_[_0x1dfe('0x38')](_0x5e4dc0[_0x1dfe('0x34')],qs['fields'](_0x348aed[_0x1dfe('0x35')]['fields']));_0x51d7ec[_0x1dfe('0x39')]=_0x51d7ec[_0x1dfe('0x39')][_0x1dfe('0x3a')]?_0x51d7ec[_0x1dfe('0x39')]:_0x5e4dc0[_0x1dfe('0x34')];if(!_0x348aed['query'][_0x1dfe('0x3b')](_0x1dfe('0x3c'))){_0x51d7ec['limit']=qs[_0x1dfe('0x21')](_0x348aed[_0x1dfe('0x35')][_0x1dfe('0x21')]);_0x51d7ec[_0x1dfe('0x20')]=qs[_0x1dfe('0x20')](_0x348aed[_0x1dfe('0x35')][_0x1dfe('0x20')]);}_0x51d7ec[_0x1dfe('0x3d')]=qs[_0x1dfe('0x3e')](_0x348aed[_0x1dfe('0x35')][_0x1dfe('0x3e')]);_0x51d7ec[_0x1dfe('0x3f')]=qs[_0x1dfe('0x37')](_[_0x1dfe('0x40')](_0x348aed[_0x1dfe('0x35')],_0x5e4dc0['filters']),_0x2d45cf);if(_0x348aed[_0x1dfe('0x35')]['filter']){_0x51d7ec['where']=_[_0x1dfe('0x41')](_0x51d7ec[_0x1dfe('0x3f')],{'$or':_[_0x1dfe('0x2e')](_0x2d45cf,function(_0x54d3a6){if(_0x54d3a6[_0x1dfe('0x32')]!=='VIRTUAL'){var _0xfd4e8c={};_0xfd4e8c[_0x54d3a6[_0x1dfe('0x2c')]]={'$like':'%'+_0x348aed[_0x1dfe('0x35')][_0x1dfe('0x42')]+'%'};return _0xfd4e8c;}})});}_0x51d7ec=_[_0x1dfe('0x41')]({},_0x51d7ec,_0x348aed[_0x1dfe('0x43')]);var _0x237b92={'where':_0x51d7ec[_0x1dfe('0x3f')]};return db[_0x1dfe('0x2f')][_0x1dfe('0x1f')](_0x237b92)[_0x1dfe('0x28')](function(_0x277d17){_0x2bda55['count']=_0x277d17;if(_0x348aed[_0x1dfe('0x35')]['includeAll']){_0x51d7ec[_0x1dfe('0x44')]=[{'all':!![]}];}return db[_0x1dfe('0x2f')][_0x1dfe('0x45')](_0x51d7ec);})['then'](function(_0x19fb45){_0x2bda55[_0x1dfe('0x46')]=_0x19fb45;return _0x2bda55;})[_0x1dfe('0x28')](respondWithFilteredResult(_0x26485f,_0x51d7ec))['catch'](handleError(_0x26485f,null));};exports['show']=function(_0x48d161,_0x1a815d){var _0x50f39d={'raw':!![],'where':{'id':_0x48d161['params']['id']}},_0x33bc31={};_0x33bc31[_0x1dfe('0x34')]=_['keys'](db['VoiceTransferReport'][_0x1dfe('0x30')]);_0x33bc31[_0x1dfe('0x35')]=_[_0x1dfe('0x36')](_0x48d161[_0x1dfe('0x35')]);_0x33bc31[_0x1dfe('0x37')]=_[_0x1dfe('0x38')](_0x33bc31[_0x1dfe('0x34')],_0x33bc31[_0x1dfe('0x35')]);_0x50f39d[_0x1dfe('0x39')]=_[_0x1dfe('0x38')](_0x33bc31[_0x1dfe('0x34')],qs[_0x1dfe('0x47')](_0x48d161[_0x1dfe('0x35')][_0x1dfe('0x47')]));_0x50f39d[_0x1dfe('0x39')]=_0x50f39d[_0x1dfe('0x39')][_0x1dfe('0x3a')]?_0x50f39d['attributes']:_0x33bc31['model'];if(_0x48d161['query']['includeAll']){_0x50f39d[_0x1dfe('0x44')]=[{'all':!![]}];}_0x50f39d=_['merge']({},_0x50f39d,_0x48d161[_0x1dfe('0x43')]);return db[_0x1dfe('0x2f')][_0x1dfe('0x48')](_0x50f39d)[_0x1dfe('0x28')](handleEntityNotFound(_0x1a815d,null))[_0x1dfe('0x28')](respondWithResult(_0x1a815d,null))[_0x1dfe('0x49')](handleError(_0x1a815d,null));};exports[_0x1dfe('0x4a')]=function(_0x3732c2,_0x30f66d){return db[_0x1dfe('0x2f')]['create'](_0x3732c2[_0x1dfe('0x4b')],{})[_0x1dfe('0x28')](respondWithResult(_0x30f66d,0xc9))['catch'](handleError(_0x30f66d,null));};exports[_0x1dfe('0x27')]=function(_0x35a2ac,_0x2adaf5){if(_0x35a2ac[_0x1dfe('0x4b')]['id']){delete _0x35a2ac[_0x1dfe('0x4b')]['id'];}return db[_0x1dfe('0x2f')][_0x1dfe('0x48')]({'where':{'id':_0x35a2ac['params']['id']}})[_0x1dfe('0x28')](handleEntityNotFound(_0x2adaf5,null))[_0x1dfe('0x28')](saveUpdates(_0x35a2ac[_0x1dfe('0x4b')],null))[_0x1dfe('0x28')](respondWithResult(_0x2adaf5,null))['catch'](handleError(_0x2adaf5,null));};exports[_0x1dfe('0x29')]=function(_0x55c906,_0x15beef){return db[_0x1dfe('0x2f')][_0x1dfe('0x48')]({'where':{'id':_0x55c906['params']['id']}})['then'](handleEntityNotFound(_0x15beef,null))['then'](removeEntity(_0x15beef,null))[_0x1dfe('0x49')](handleError(_0x15beef,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index adeae26..23cf246 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 _0xac97=['rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xac97,0x14a));var _0x7ac9=function(_0x2ac149,_0x59f4c3){_0x2ac149=_0x2ac149-0x0;var _0x6e04ec=_0xac97[_0x2ac149];return _0x6e04ec;};'use strict';var _=require(_0x7ac9('0x0'));var util=require(_0x7ac9('0x1'));var logger=require(_0x7ac9('0x2'))(_0x7ac9('0x3'));var moment=require('moment');var BPromise=require(_0x7ac9('0x4'));var rp=require(_0x7ac9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ac9('0x6'));var config=require(_0x7ac9('0x7'));var attributes=require(_0x7ac9('0x8'));module[_0x7ac9('0x9')]=function(_0x381065,_0x3359a1){return _0x381065[_0x7ac9('0xa')](_0x7ac9('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c2d=['VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x7c2d,0xb6));var _0xd7c2=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x7c2d[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0xd7c2('0x0'));var util=require(_0xd7c2('0x1'));var logger=require(_0xd7c2('0x2'))(_0xd7c2('0x3'));var moment=require(_0xd7c2('0x4'));var BPromise=require('bluebird');var rp=require(_0xd7c2('0x5'));var fs=require('fs');var path=require(_0xd7c2('0x6'));var rimraf=require('rimraf');var config=require(_0xd7c2('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xd7c2('0x8')]=function(_0x5c9b10,_0x588bbb){return _0x5c9b10[_0xd7c2('0x9')](_0xd7c2('0xa'),attributes,{'tableName':_0xd7c2('0xb'),'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 70380ad..de94dc1 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 _0x6b53=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x2287b8,_0x2d7020){var _0x95e898=function(_0x315bc9){while(--_0x315bc9){_0x2287b8['push'](_0x2287b8['shift']());}};_0x95e898(++_0x2d7020);}(_0x6b53,0xc6));var _0x36b5=function(_0x44f131,_0x3dadcc){_0x44f131=_0x44f131-0x0;var _0x49ec24=_0x6b53[_0x44f131];return _0x49ec24;};'use strict';var _=require(_0x36b5('0x0'));var util=require(_0x36b5('0x1'));var moment=require(_0x36b5('0x2'));var BPromise=require(_0x36b5('0x3'));var rs=require(_0x36b5('0x4'));var fs=require('fs');var Redis=require(_0x36b5('0x5'));var db=require(_0x36b5('0x6'))['db'];var utils=require(_0x36b5('0x7'));var logger=require('../../config/logger')(_0x36b5('0x8'));var config=require(_0x36b5('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x36b5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9be8c,_0x20b954,_0x161c16){return new BPromise(function(_0x4bc472,_0x6d3d5b){return client[_0x36b5('0xb')](_0xf9be8c,_0x161c16)[_0x36b5('0xc')](function(_0x5b1efe){logger[_0x36b5('0xd')](_0x36b5('0xe'),_0x20b954,'request\x20sent');logger[_0x36b5('0xf')](_0x36b5('0x10'),_0x20b954,'request\x20sent',JSON['stringify'](_0x5b1efe));if(_0x5b1efe[_0x36b5('0x11')]){if(_0x5b1efe['error'][_0x36b5('0x12')]===0x1f4){logger[_0x36b5('0x11')](_0x36b5('0xe'),_0x20b954,_0x5b1efe[_0x36b5('0x11')][_0x36b5('0x13')]);return _0x6d3d5b(_0x5b1efe[_0x36b5('0x11')]['message']);}logger[_0x36b5('0x11')](_0x36b5('0xe'),_0x20b954,_0x5b1efe[_0x36b5('0x11')]['message']);return _0x4bc472(_0x5b1efe[_0x36b5('0x11')][_0x36b5('0x13')]);}else{logger[_0x36b5('0xd')](_0x36b5('0xe'),_0x20b954,_0x36b5('0x14'));_0x4bc472(_0x5b1efe[_0x36b5('0x15')]['message']);}})[_0x36b5('0x16')](function(_0x47c7ea){logger[_0x36b5('0x11')](_0x36b5('0xe'),_0x20b954,_0x47c7ea);_0x6d3d5b(_0x47c7ea);});});}exports[_0x36b5('0x17')]=function(_0x5a991b){var _0x23d0b7=this;return new Promise(function(_0x136ab6,_0x4fbeae){return db[_0x36b5('0x18')]['create'](_0x5a991b[_0x36b5('0x19')],{'raw':_0x5a991b[_0x36b5('0x1a')]?_0x5a991b['options'][_0x36b5('0x1b')]===undefined?!![]:![]:!![]})[_0x36b5('0xc')](function(_0x39a145){logger[_0x36b5('0xd')](_0x36b5('0x17'),_0x5a991b);logger[_0x36b5('0xf')](_0x36b5('0x17'),_0x5a991b,JSON[_0x36b5('0x1c')](_0x39a145));_0x136ab6(_0x39a145);})[_0x36b5('0x16')](function(_0x2eb61d){logger[_0x36b5('0x11')](_0x36b5('0x17'),_0x2eb61d[_0x36b5('0x13')],_0x5a991b);_0x4fbeae(_0x23d0b7[_0x36b5('0x11')](0x1f4,_0x2eb61d[_0x36b5('0x13')]));});});}; \ No newline at end of file +var _0x5013=['raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5013,0xc6));var _0x3501=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x5013[_0x555b2f];return _0x81c0a6;};'use strict';var _=require(_0x3501('0x0'));var util=require(_0x3501('0x1'));var moment=require(_0x3501('0x2'));var BPromise=require(_0x3501('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3501('0x4'));var db=require(_0x3501('0x5'))['db'];var utils=require(_0x3501('0x6'));var logger=require(_0x3501('0x7'))(_0x3501('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3501('0x9')][_0x3501('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x237d36,_0x5c1f39,_0x23d317){return new BPromise(function(_0x40143f,_0x236226){return client['request'](_0x237d36,_0x23d317)[_0x3501('0xb')](function(_0x22dbfe){logger[_0x3501('0xc')](_0x3501('0xd'),_0x5c1f39,_0x3501('0xe'));logger['debug'](_0x3501('0xf'),_0x5c1f39,_0x3501('0xe'),JSON[_0x3501('0x10')](_0x22dbfe));if(_0x22dbfe[_0x3501('0x11')]){if(_0x22dbfe[_0x3501('0x11')][_0x3501('0x12')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5c1f39,_0x22dbfe[_0x3501('0x11')][_0x3501('0x13')]);return _0x236226(_0x22dbfe[_0x3501('0x11')]['message']);}logger['error'](_0x3501('0xd'),_0x5c1f39,_0x22dbfe['error'][_0x3501('0x13')]);return _0x40143f(_0x22dbfe[_0x3501('0x11')][_0x3501('0x13')]);}else{logger[_0x3501('0xc')](_0x3501('0xd'),_0x5c1f39,'request\x20sent');_0x40143f(_0x22dbfe[_0x3501('0x14')]['message']);}})[_0x3501('0x15')](function(_0x13dcd5){logger['error'](_0x3501('0xd'),_0x5c1f39,_0x13dcd5);_0x236226(_0x13dcd5);});});}exports[_0x3501('0x16')]=function(_0x3191e2){var _0x46853b=this;return new Promise(function(_0x4e21c4,_0x51b897){return db[_0x3501('0x17')][_0x3501('0x18')](_0x3191e2[_0x3501('0x19')],{'raw':_0x3191e2['options']?_0x3191e2['options'][_0x3501('0x1a')]===undefined?!![]:![]:!![]})[_0x3501('0xb')](function(_0x128cb0){logger[_0x3501('0xc')](_0x3501('0x16'),_0x3191e2);logger[_0x3501('0x1b')](_0x3501('0x16'),_0x3191e2,JSON[_0x3501('0x10')](_0x128cb0));_0x4e21c4(_0x128cb0);})[_0x3501('0x15')](function(_0x105cc6){logger[_0x3501('0x11')]('CreateVoiceTransferReport',_0x105cc6[_0x3501('0x13')],_0x3191e2);_0x51b897(_0x46853b[_0x3501('0x11')](0x1f4,_0x105cc6[_0x3501('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 84b5c70..6ec3990 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 _0x16e4=['answer','/hold','/unhold','unhold','/calls','/transfer','exports','express','Router','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','/hangup','hangup','/answer','isAuthenticated'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x16e4,0x97));var _0x416e=function(_0x54640c,_0x26d7b2){_0x54640c=_0x54640c-0x0;var _0x274d95=_0x16e4[_0x54640c];return _0x274d95;};'use strict';var express=require(_0x416e('0x0'));var router=express[_0x416e('0x1')]();var auth=require(_0x416e('0x2'));var controller=require(_0x416e('0x3'));router[_0x416e('0x4')](_0x416e('0x5'),auth['isAuthenticated'](),auth[_0x416e('0x6')](),controller['originate']);router[_0x416e('0x4')](_0x416e('0x7'),auth['isAuthenticated'](),auth[_0x416e('0x6')](),controller[_0x416e('0x8')]);router[_0x416e('0x4')](_0x416e('0x9'),auth[_0x416e('0xa')](),auth[_0x416e('0x6')](),controller[_0x416e('0xb')]);router[_0x416e('0x4')](_0x416e('0xc'),auth['isAuthenticated'](),auth[_0x416e('0x6')](),controller['hold']);router[_0x416e('0x4')](_0x416e('0xd'),auth[_0x416e('0xa')](),auth['canUpdate'](),controller[_0x416e('0xe')]);router[_0x416e('0x4')](_0x416e('0xf'),auth['isAuthenticated'](),auth[_0x416e('0x6')](),controller['calls']);router[_0x416e('0x4')](_0x416e('0x10'),auth[_0x416e('0xa')](),auth[_0x416e('0x6')](),controller['transfer']);module[_0x416e('0x11')]=router; \ No newline at end of file +var _0x7846=['canUpdate','hangup','answer','/hold','hold','/unhold','unhold','/calls','/transfer','exports','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','originate','/hangup'];(function(_0x5126ef,_0x3ef1fa){var _0x124a42=function(_0x40984e){while(--_0x40984e){_0x5126ef['push'](_0x5126ef['shift']());}};_0x124a42(++_0x3ef1fa);}(_0x7846,0xf4));var _0x6784=function(_0x589248,_0x31dea3){_0x589248=_0x589248-0x0;var _0x486750=_0x7846[_0x589248];return _0x486750;};'use strict';var express=require('express');var router=express[_0x6784('0x0')]();var auth=require(_0x6784('0x1'));var controller=require(_0x6784('0x2'));router[_0x6784('0x3')](_0x6784('0x4'),auth[_0x6784('0x5')](),auth['canUpdate'](),controller[_0x6784('0x6')]);router[_0x6784('0x3')](_0x6784('0x7'),auth[_0x6784('0x5')](),auth[_0x6784('0x8')](),controller[_0x6784('0x9')]);router[_0x6784('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6784('0x8')](),controller[_0x6784('0xa')]);router[_0x6784('0x3')](_0x6784('0xb'),auth[_0x6784('0x5')](),auth[_0x6784('0x8')](),controller[_0x6784('0xc')]);router[_0x6784('0x3')](_0x6784('0xd'),auth[_0x6784('0x5')](),auth[_0x6784('0x8')](),controller[_0x6784('0xe')]);router[_0x6784('0x3')](_0x6784('0xf'),auth[_0x6784('0x5')](),auth[_0x6784('0x8')](),controller['calls']);router[_0x6784('0x3')](_0x6784('0x10'),auth[_0x6784('0x5')](),auth[_0x6784('0x8')](),controller['transfer']);module[_0x6784('0x11')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 6e9a30e..514e2b9 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 _0xd2ea=['userId','callNumber','callerId','callbackUrl','format','user:%s','webbar:originate','hangup\x20fired:','entityFound:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','socket.io-emitter','validate','number','string','userId\x20is\x20required','info','stringify','emit','log','handleError:','stack','name','status','send','NotFound','request','then','error','code','message','result','catch','User','findOne','VoiceChannels','all','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','json'];(function(_0x158c51,_0x4a6533){var _0x235732=function(_0xea8be5){while(--_0xea8be5){_0x158c51['push'](_0x158c51['shift']());}};_0x235732(++_0x4a6533);}(_0xd2ea,0x15f));var _0xad2e=function(_0x87c0c1,_0x4b9343){_0x87c0c1=_0x87c0c1-0x0;var _0x457844=_0xd2ea[_0x87c0c1];return _0x457844;};'use strict';var path=require(_0xad2e('0x0'));var fs=require('fs');var _=require(_0xad2e('0x1'));var db=require(_0xad2e('0x2'))['db'];var config=require(_0xad2e('0x3'));var util=require(_0xad2e('0x4'));var BPromise=require('bluebird');var jayson=require(_0xad2e('0x5'));var amiClient=jayson[_0xad2e('0x6')][_0xad2e('0x7')]({'port':0x232a});var logger=require(_0xad2e('0x8'))(_0xad2e('0x9'));var Redis=require(_0xad2e('0xa'));config[_0xad2e('0xb')]=_['defaults'](config[_0xad2e('0xb')],{'host':_0xad2e('0xc'),'port':0x18eb});var io=require(_0xad2e('0xd'))(new Redis(config['redis']));var Schema=require(_0xad2e('0xe'));var originateValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xad2e('0x10'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0xad2e('0x10')},'callbackUrl':{'type':_0xad2e('0x10')}});var hangupValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],_0xad2e('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xad2e('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],_0xad2e('0x11')]},'sessionId':{'type':_0xad2e('0x10'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xad2e('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xad2e('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],_0xad2e('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xad2e('0xf'),'required':[!![],_0xad2e('0x11')]}});function emit(_0x4180aa,_0x2546e2,_0x5941c5){logger[_0xad2e('0x12')](_0x4180aa,_0x2546e2,JSON[_0xad2e('0x13')](_0x5941c5));io['to'](_0x4180aa)[_0xad2e('0x14')](_0x2546e2,_0x5941c5);}function handleError(_0x39c5e4){return function(_0x34f946){console[_0xad2e('0x15')](_0xad2e('0x16'),_0x34f946,_0x34f946 instanceof RangeError);logger['error'](_0x34f946[_0xad2e('0x17')]);if(_0x34f946 instanceof RangeError){if(_0x34f946[_0xad2e('0x18')]){delete _0x34f946['name'];}_0x39c5e4['status'](0x194)['send'](_0x34f946);}else{if(_0x34f946['name']){delete _0x34f946[_0xad2e('0x18')];}_0x39c5e4[_0xad2e('0x19')](0x1f4)[_0xad2e('0x1a')](_0x34f946);}};}function checkError(){return function(_0x208991){if(!_0x208991){throw new RangeError(_0xad2e('0x1b'));}return _0x208991;};}function respondWithRpcPromise(_0x41109a,_0x29dc4f){return new BPromise(function(_0x23c0b6,_0x102169){var _0x154d54=amiClient;return _0x154d54[_0xad2e('0x1c')](_0x41109a,_0x29dc4f)[_0xad2e('0x1d')](function(_0xd907a9){if(_0xd907a9[_0xad2e('0x1e')]){if(_0xd907a9[_0xad2e('0x1e')][_0xad2e('0x1f')]===0x1f4){return _0x102169(_0xd907a9['error'][_0xad2e('0x20')]);}return _0x23c0b6(_0xd907a9[_0xad2e('0x1e')][_0xad2e('0x20')]);}else{_0x23c0b6(_0xd907a9[_0xad2e('0x21')]);}})[_0xad2e('0x22')](function(_0x58acc8){_0x102169(_0x58acc8);});});}function getAgent(_0x1161d5){return db[_0xad2e('0x23')][_0xad2e('0x24')]({'where':{'id':_0x1161d5,'role':'agent'}})[_0xad2e('0x1d')](checkError());}function getAgentCheckSession(_0x5d675f,_0x2b2bc2){return new BPromise(function(_0x28ef72,_0x22bc9b){var _0x11bfa9=respondWithRpcPromise(_0xad2e('0x25'));var _0x1676e5=getAgent(_0x5d675f);Promise[_0xad2e('0x26')]([_0x11bfa9,_0x1676e5])[_0xad2e('0x1d')](function(_0x52fdda){var _0x31857f=_0x52fdda[0x0];var _0x4ffa15=_0x52fdda[0x1];var _0x434934=_[_0xad2e('0x27')](_0x31857f[_0xad2e('0x28')],function(_0x4379f4){return _0x4379f4[_0xad2e('0x29')]==_0x4ffa15['id']&&_0x4379f4[_0xad2e('0x2a')]==_0x2b2bc2;});if(_0x434934[_0xad2e('0x2b')]==0x1){_0x28ef72(_0x4ffa15);}else{_0x22bc9b(new RangeError(_0xad2e('0x2c')+_0x2b2bc2+_0xad2e('0x2d')));}});});}exports[_0xad2e('0x2e')]=function(_0xcc4c66,_0x56330e){logger[_0xad2e('0x12')]('originate\x20fired:',_0xcc4c66[_0xad2e('0x2f')]);var _0x3a6419=originateValidation[_0xad2e('0xe')](_0xcc4c66[_0xad2e('0x2f')]);if(_0x3a6419[_0xad2e('0x2b')]>0x0){return _0x56330e['status'](0x190)[_0xad2e('0x30')](_0x3a6419);}var _0x27fdf0=_0xcc4c66['body'][_0xad2e('0x31')];var _0x100b35=_0xcc4c66['body'][_0xad2e('0x32')];var _0x19fd12=_0xcc4c66[_0xad2e('0x2f')][_0xad2e('0x33')];var _0x2a130a=_0xcc4c66[_0xad2e('0x2f')][_0xad2e('0x34')];return getAgent(_0x27fdf0)['then'](function(_0x41a022){logger[_0xad2e('0x12')]('entityFound:',_0x41a022[_0xad2e('0x18')]);emit(util[_0xad2e('0x35')](_0xad2e('0x36'),_0x41a022[_0xad2e('0x18')]),_0xad2e('0x37'),{'callNumber':_0x100b35,'callerId':_0x19fd12,'callbackUrl':_0x2a130a});return _0x56330e[_0xad2e('0x19')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xad2e('0x22')](handleError(_0x56330e));};exports['hangup']=function(_0x1bf1da,_0x33c2a8){logger[_0xad2e('0x12')](_0xad2e('0x38'),_0x1bf1da[_0xad2e('0x2f')]);var _0x5d55f9=hangupValidation[_0xad2e('0xe')](_0x1bf1da[_0xad2e('0x2f')]);if(_0x5d55f9['length']>0x0){return _0x33c2a8['status'](0x190)['json'](_0x5d55f9);}var _0x274fd8=_0x1bf1da['body']['userId'];var _0x2d0018=_0x1bf1da[_0xad2e('0x2f')][_0xad2e('0x2a')];return getAgent(_0x274fd8)[_0xad2e('0x1d')](function(_0x6f4fbc){logger[_0xad2e('0x12')](_0xad2e('0x39'),_0x6f4fbc['name']);emit(util[_0xad2e('0x35')](_0xad2e('0x36'),_0x6f4fbc[_0xad2e('0x18')]),_0xad2e('0x3a'),{'sessionId':_0x2d0018});return _0x33c2a8[_0xad2e('0x19')](0xc8)['json']({'error':![],'message':_0xad2e('0x3b')});})['catch'](handleError(_0x33c2a8));};exports[_0xad2e('0x3c')]=function(_0x3de1d5,_0x21d202){logger[_0xad2e('0x12')](_0xad2e('0x3d'),_0x3de1d5[_0xad2e('0x2f')]);var _0x1abcea=answerValidation[_0xad2e('0xe')](_0x3de1d5[_0xad2e('0x2f')]);if(_0x1abcea[_0xad2e('0x2b')]>0x0){return _0x21d202[_0xad2e('0x19')](0x190)[_0xad2e('0x30')](_0x1abcea);}var _0x1d18d0=_0x3de1d5[_0xad2e('0x2f')][_0xad2e('0x31')];var _0x2ad9a0=_0x3de1d5[_0xad2e('0x2f')][_0xad2e('0x2a')];return getAgent(_0x1d18d0)[_0xad2e('0x1d')](function(_0x214c59){logger['info'](_0xad2e('0x39'),_0x214c59[_0xad2e('0x18')]);emit(util[_0xad2e('0x35')](_0xad2e('0x36'),_0x214c59[_0xad2e('0x18')]),_0xad2e('0x3e'),{'sessionId':_0x2ad9a0});return _0x21d202[_0xad2e('0x19')](0xc8)['json']({'error':![],'message':_0xad2e('0x3f')});})['catch'](handleError(_0x21d202));};exports[_0xad2e('0x40')]=function(_0x2ad66e,_0x36b103){logger[_0xad2e('0x12')](_0xad2e('0x41'),_0x2ad66e['body']);var _0xf80dd8=holdValidation[_0xad2e('0xe')](_0x2ad66e[_0xad2e('0x2f')]);if(_0xf80dd8[_0xad2e('0x2b')]>0x0){return _0x36b103[_0xad2e('0x19')](0x190)['json'](_0xf80dd8);}var _0x18ef1e=_0x2ad66e[_0xad2e('0x2f')][_0xad2e('0x31')];var _0x248f3d=_0x2ad66e['body']['sessionId'];return getAgent(_0x18ef1e)[_0xad2e('0x1d')](function(_0x343e4f){logger['info']('entityFound:',_0x343e4f[_0xad2e('0x18')]);emit(util['format'](_0xad2e('0x36'),_0x343e4f[_0xad2e('0x18')]),'webbar:hold',{'sessionId':_0x248f3d});return _0x36b103[_0xad2e('0x19')](0xc8)[_0xad2e('0x30')]({'error':![],'message':_0xad2e('0x42')});})[_0xad2e('0x22')](handleError(_0x36b103));};exports['unhold']=function(_0x527c93,_0x42d999){logger[_0xad2e('0x12')](_0xad2e('0x43'),_0x527c93[_0xad2e('0x2f')]);var _0x296b67=unholdValidation[_0xad2e('0xe')](_0x527c93[_0xad2e('0x2f')]);if(_0x296b67[_0xad2e('0x2b')]>0x0){return _0x42d999['status'](0x190)[_0xad2e('0x30')](_0x296b67);}var _0x508812=_0x527c93[_0xad2e('0x2f')][_0xad2e('0x31')];var _0x438c7f=_0x527c93[_0xad2e('0x2f')][_0xad2e('0x2a')];return getAgent(_0x508812)[_0xad2e('0x1d')](function(_0x42e8f0){logger['info'](_0xad2e('0x39'),_0x42e8f0['name']);emit(util[_0xad2e('0x35')](_0xad2e('0x36'),_0x42e8f0[_0xad2e('0x18')]),_0xad2e('0x44'),{'sessionId':_0x438c7f});return _0x42d999['status'](0xc8)[_0xad2e('0x30')]({'error':![],'message':_0xad2e('0x45')});})['catch'](handleError(_0x42d999));};exports[_0xad2e('0x46')]=function(_0x48dc29,_0x9cf57b){logger[_0xad2e('0x12')](_0xad2e('0x47'),_0x9cf57b[_0xad2e('0x2f')]);var _0x243d14=callsValidation[_0xad2e('0xe')](_0x48dc29[_0xad2e('0x2f')]);if(_0x243d14[_0xad2e('0x2b')]>0x0){return _0x9cf57b[_0xad2e('0x19')](0x190)['json'](_0x243d14);}var _0xe2d4ac=_0x48dc29[_0xad2e('0x2f')][_0xad2e('0x31')];var _0x243add=respondWithRpcPromise('VoiceChannels');var _0x5c7318=getAgent(_0xe2d4ac);return Promise[_0xad2e('0x26')]([_0x243add,_0x5c7318])[_0xad2e('0x1d')](function(_0xb03176){var _0xd3b75e=_0xb03176[0x0];var _0x450803=_0xb03176[0x1];var _0x77387e=_['filter'](_0xd3b75e[_0xad2e('0x28')],function(_0x69dcbd){return _0x69dcbd['UserId']==_0x450803['id'];});return _0x9cf57b[_0xad2e('0x19')](0xc8)[_0xad2e('0x30')]({'count':_0x77387e[_0xad2e('0x2b')],'rows':_0x77387e});})[_0xad2e('0x22')](handleError(_0x9cf57b));};exports[_0xad2e('0x48')]=function(_0x270c8d,_0x1ce266){logger[_0xad2e('0x12')](_0xad2e('0x49'),_0x270c8d[_0xad2e('0x2f')]);var _0x598d49=conferenceValidation['validate'](_0x270c8d[_0xad2e('0x2f')]);if(_0x598d49['length']>0x0){return _0x1ce266['status'](0x190)[_0xad2e('0x30')](_0x598d49);}var _0x3c3f96=_0x270c8d[_0xad2e('0x2f')]['userId'];return getAgent(_0x3c3f96)[_0xad2e('0x1d')](function(_0x337d8c){logger[_0xad2e('0x12')](_0xad2e('0x39'),_0x337d8c[_0xad2e('0x18')]);emit(util['format'](_0xad2e('0x36'),_0x337d8c['name']),'webbar:conference');return _0x1ce266['status'](0xc8)['json']({'error':![],'message':_0xad2e('0x4a')});})[_0xad2e('0x22')](handleError(_0x1ce266));};exports[_0xad2e('0x4b')]=function(_0x2bedd8,_0x32643b){logger[_0xad2e('0x12')](_0xad2e('0x4c'),_0x2bedd8[_0xad2e('0x2f')]);var _0x1a7d47=transferValidation[_0xad2e('0xe')](_0x2bedd8[_0xad2e('0x2f')]);if(_0x1a7d47['length']>0x0){return _0x32643b[_0xad2e('0x19')](0x190)[_0xad2e('0x30')](_0x1a7d47);}var _0x5832c9=_0x2bedd8['body'][_0xad2e('0x31')];var _0x49a7d9=_0x2bedd8[_0xad2e('0x2f')][_0xad2e('0x2a')];var _0x3bdd1f=_0x2bedd8[_0xad2e('0x2f')][_0xad2e('0x4d')];return getAgent(_0x5832c9)[_0xad2e('0x1d')](function(_0x10d465){logger[_0xad2e('0x12')]('entityFound:',_0x10d465[_0xad2e('0x18')]);emit(util['format']('user:%s',_0x10d465[_0xad2e('0x18')]),_0xad2e('0x4e'),{'sessionId':_0x49a7d9,'transferNumber':_0x3bdd1f});return _0x32643b['status'](0xc8)[_0xad2e('0x30')]({'error':![],'message':_0xad2e('0x4f')});})[_0xad2e('0x22')](handleError(_0x32643b));}; \ No newline at end of file +var _0xdace=['sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','validate','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','answer\x20executed!','hold','hold\x20executed!','unhold','webbar:unhold','calls','VoiceChannels','all','filter','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','transfer\x20executed!','path','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','error','stack','name','send','status','NotFound','request','code','message','result','catch','User','findOne','agent','then','UserId','sessionId','length'];(function(_0x393d25,_0x375fed){var _0x4ff01c=function(_0x574c71){while(--_0x574c71){_0x393d25['push'](_0x393d25['shift']());}};_0x4ff01c(++_0x375fed);}(_0xdace,0xc5));var _0xedac=function(_0x233cb1,_0x8ca9a2){_0x233cb1=_0x233cb1-0x0;var _0x29ee7e=_0xdace[_0x233cb1];return _0x29ee7e;};'use strict';var path=require(_0xedac('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xedac('0x1'))['db'];var config=require(_0xedac('0x2'));var util=require(_0xedac('0x3'));var BPromise=require('bluebird');var jayson=require(_0xedac('0x4'));var amiClient=jayson[_0xedac('0x5')][_0xedac('0x6')]({'port':0x232a});var logger=require(_0xedac('0x7'))('webbarapi');var Redis=require(_0xedac('0x8'));config[_0xedac('0x9')]=_[_0xedac('0xa')](config['redis'],{'host':_0xedac('0xb'),'port':0x18eb});var io=require(_0xedac('0xc'))(new Redis(config[_0xedac('0x9')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],_0xedac('0xe')]},'callNumber':{'type':_0xedac('0xf'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':'string'},'callbackUrl':{'type':_0xedac('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],_0xedac('0xe')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xedac('0xf'),'required':[!![],_0xedac('0x10')]},'transferNumber':{'type':_0xedac('0xf'),'required':[!![],_0xedac('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],_0xedac('0xe')]},'sessionId':{'type':_0xedac('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xedac('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],_0xedac('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':_0xedac('0xd'),'required':[!![],_0xedac('0xe')]}});function emit(_0x590e9b,_0xed25bb,_0x594b11){logger[_0xedac('0x12')](_0x590e9b,_0xed25bb,JSON[_0xedac('0x13')](_0x594b11));io['to'](_0x590e9b)[_0xedac('0x14')](_0xed25bb,_0x594b11);}function handleError(_0xba0c93){return function(_0x4fb540){console['log'](_0xedac('0x15'),_0x4fb540,_0x4fb540 instanceof RangeError);logger[_0xedac('0x16')](_0x4fb540[_0xedac('0x17')]);if(_0x4fb540 instanceof RangeError){if(_0x4fb540[_0xedac('0x18')]){delete _0x4fb540['name'];}_0xba0c93['status'](0x194)[_0xedac('0x19')](_0x4fb540);}else{if(_0x4fb540[_0xedac('0x18')]){delete _0x4fb540[_0xedac('0x18')];}_0xba0c93[_0xedac('0x1a')](0x1f4)[_0xedac('0x19')](_0x4fb540);}};}function checkError(){return function(_0x4685f1){if(!_0x4685f1){throw new RangeError(_0xedac('0x1b'));}return _0x4685f1;};}function respondWithRpcPromise(_0x928ebe,_0x5353e3){return new BPromise(function(_0x4593e8,_0x510005){var _0x29cd40=amiClient;return _0x29cd40[_0xedac('0x1c')](_0x928ebe,_0x5353e3)['then'](function(_0x46e09d){if(_0x46e09d[_0xedac('0x16')]){if(_0x46e09d[_0xedac('0x16')][_0xedac('0x1d')]===0x1f4){return _0x510005(_0x46e09d[_0xedac('0x16')][_0xedac('0x1e')]);}return _0x4593e8(_0x46e09d['error'][_0xedac('0x1e')]);}else{_0x4593e8(_0x46e09d[_0xedac('0x1f')]);}})[_0xedac('0x20')](function(_0x41ad8d){_0x510005(_0x41ad8d);});});}function getAgent(_0x1ff33e){return db[_0xedac('0x21')][_0xedac('0x22')]({'where':{'id':_0x1ff33e,'role':_0xedac('0x23')}})[_0xedac('0x24')](checkError());}function getAgentCheckSession(_0x4663c0,_0x4c5566){return new BPromise(function(_0x25d7f5,_0xf0a2ce){var _0x19aed3=respondWithRpcPromise('VoiceChannels');var _0x313e06=getAgent(_0x4663c0);Promise['all']([_0x19aed3,_0x313e06])['then'](function(_0x3e28bf){var _0x457d81=_0x3e28bf[0x0];var _0x44ac60=_0x3e28bf[0x1];var _0x14522a=_['filter'](_0x457d81['rows'],function(_0xe813e6){return _0xe813e6[_0xedac('0x25')]==_0x44ac60['id']&&_0xe813e6[_0xedac('0x26')]==_0x4c5566;});if(_0x14522a[_0xedac('0x27')]==0x1){_0x25d7f5(_0x44ac60);}else{_0xf0a2ce(new RangeError(_0xedac('0x28')+_0x4c5566+_0xedac('0x29')));}});});}exports[_0xedac('0x2a')]=function(_0x483233,_0x3bc910){logger[_0xedac('0x12')](_0xedac('0x2b'),_0x483233['body']);var _0x1a8579=originateValidation[_0xedac('0x2c')](_0x483233['body']);if(_0x1a8579[_0xedac('0x27')]>0x0){return _0x3bc910[_0xedac('0x1a')](0x190)['json'](_0x1a8579);}var _0x4255b9=_0x483233[_0xedac('0x2d')][_0xedac('0x2e')];var _0x195f78=_0x483233[_0xedac('0x2d')][_0xedac('0x2f')];var _0x487ad7=_0x483233[_0xedac('0x2d')][_0xedac('0x30')];var _0x34be79=_0x483233['body'][_0xedac('0x31')];return getAgent(_0x4255b9)[_0xedac('0x24')](function(_0x2a87ae){logger[_0xedac('0x12')](_0xedac('0x32'),_0x2a87ae[_0xedac('0x18')]);emit(util[_0xedac('0x33')](_0xedac('0x34'),_0x2a87ae[_0xedac('0x18')]),_0xedac('0x35'),{'callNumber':_0x195f78,'callerId':_0x487ad7,'callbackUrl':_0x34be79});return _0x3bc910[_0xedac('0x1a')](0xc8)[_0xedac('0x36')]({'error':![],'message':_0xedac('0x37')});})[_0xedac('0x20')](handleError(_0x3bc910));};exports[_0xedac('0x38')]=function(_0x527878,_0x1ddcc1){logger[_0xedac('0x12')](_0xedac('0x39'),_0x527878[_0xedac('0x2d')]);var _0x5085ae=hangupValidation[_0xedac('0x2c')](_0x527878[_0xedac('0x2d')]);if(_0x5085ae[_0xedac('0x27')]>0x0){return _0x1ddcc1['status'](0x190)[_0xedac('0x36')](_0x5085ae);}var _0x24ec9c=_0x527878[_0xedac('0x2d')]['userId'];var _0x41c868=_0x527878[_0xedac('0x2d')]['sessionId'];return getAgent(_0x24ec9c)[_0xedac('0x24')](function(_0x2fa832){logger['info'](_0xedac('0x32'),_0x2fa832['name']);emit(util[_0xedac('0x33')](_0xedac('0x34'),_0x2fa832[_0xedac('0x18')]),_0xedac('0x3a'),{'sessionId':_0x41c868});return _0x1ddcc1[_0xedac('0x1a')](0xc8)[_0xedac('0x36')]({'error':![],'message':'hangup\x20executed!'});})[_0xedac('0x20')](handleError(_0x1ddcc1));};exports[_0xedac('0x3b')]=function(_0x9e998c,_0x114ceb){logger[_0xedac('0x12')](_0xedac('0x3c'),_0x9e998c[_0xedac('0x2d')]);var _0x6a17a9=answerValidation[_0xedac('0x2c')](_0x9e998c[_0xedac('0x2d')]);if(_0x6a17a9[_0xedac('0x27')]>0x0){return _0x114ceb[_0xedac('0x1a')](0x190)[_0xedac('0x36')](_0x6a17a9);}var _0x1418ff=_0x9e998c[_0xedac('0x2d')][_0xedac('0x2e')];var _0x4cbae0=_0x9e998c[_0xedac('0x2d')][_0xedac('0x26')];return getAgent(_0x1418ff)[_0xedac('0x24')](function(_0x4d2de3){logger['info']('entityFound:',_0x4d2de3[_0xedac('0x18')]);emit(util[_0xedac('0x33')]('user:%s',_0x4d2de3[_0xedac('0x18')]),'webbar:answer',{'sessionId':_0x4cbae0});return _0x114ceb[_0xedac('0x1a')](0xc8)['json']({'error':![],'message':_0xedac('0x3d')});})[_0xedac('0x20')](handleError(_0x114ceb));};exports[_0xedac('0x3e')]=function(_0x114b2e,_0x1b4cb4){logger['info']('hold\x20fired:',_0x114b2e[_0xedac('0x2d')]);var _0x51dc40=holdValidation[_0xedac('0x2c')](_0x114b2e[_0xedac('0x2d')]);if(_0x51dc40[_0xedac('0x27')]>0x0){return _0x1b4cb4['status'](0x190)[_0xedac('0x36')](_0x51dc40);}var _0x45189f=_0x114b2e[_0xedac('0x2d')]['userId'];var _0x7ea57c=_0x114b2e[_0xedac('0x2d')][_0xedac('0x26')];return getAgent(_0x45189f)['then'](function(_0x5e6079){logger[_0xedac('0x12')](_0xedac('0x32'),_0x5e6079['name']);emit(util['format'](_0xedac('0x34'),_0x5e6079[_0xedac('0x18')]),'webbar:hold',{'sessionId':_0x7ea57c});return _0x1b4cb4[_0xedac('0x1a')](0xc8)['json']({'error':![],'message':_0xedac('0x3f')});})[_0xedac('0x20')](handleError(_0x1b4cb4));};exports[_0xedac('0x40')]=function(_0x104842,_0x126bd3){logger[_0xedac('0x12')]('unhold\x20fired:',_0x104842[_0xedac('0x2d')]);var _0x3fb534=unholdValidation['validate'](_0x104842[_0xedac('0x2d')]);if(_0x3fb534[_0xedac('0x27')]>0x0){return _0x126bd3[_0xedac('0x1a')](0x190)['json'](_0x3fb534);}var _0x59bc68=_0x104842[_0xedac('0x2d')][_0xedac('0x2e')];var _0x543d7d=_0x104842[_0xedac('0x2d')][_0xedac('0x26')];return getAgent(_0x59bc68)[_0xedac('0x24')](function(_0x59d762){logger[_0xedac('0x12')](_0xedac('0x32'),_0x59d762[_0xedac('0x18')]);emit(util[_0xedac('0x33')]('user:%s',_0x59d762['name']),_0xedac('0x41'),{'sessionId':_0x543d7d});return _0x126bd3[_0xedac('0x1a')](0xc8)[_0xedac('0x36')]({'error':![],'message':'unhold\x20executed!'});})[_0xedac('0x20')](handleError(_0x126bd3));};exports[_0xedac('0x42')]=function(_0x5cb635,_0x4f44e){logger[_0xedac('0x12')]('calls\x20fired:',_0x4f44e['body']);var _0x5ad779=callsValidation[_0xedac('0x2c')](_0x5cb635['body']);if(_0x5ad779[_0xedac('0x27')]>0x0){return _0x4f44e['status'](0x190)['json'](_0x5ad779);}var _0x1d8e29=_0x5cb635[_0xedac('0x2d')][_0xedac('0x2e')];var _0x35b046=respondWithRpcPromise(_0xedac('0x43'));var _0x4af22f=getAgent(_0x1d8e29);return Promise[_0xedac('0x44')]([_0x35b046,_0x4af22f])['then'](function(_0x1ece76){var _0x2e33ed=_0x1ece76[0x0];var _0x2f3df5=_0x1ece76[0x1];var _0x862e0f=_[_0xedac('0x45')](_0x2e33ed[_0xedac('0x46')],function(_0x44b563){return _0x44b563['UserId']==_0x2f3df5['id'];});return _0x4f44e[_0xedac('0x1a')](0xc8)[_0xedac('0x36')]({'count':_0x862e0f[_0xedac('0x27')],'rows':_0x862e0f});})[_0xedac('0x20')](handleError(_0x4f44e));};exports[_0xedac('0x47')]=function(_0x3a7199,_0x3f313a){logger[_0xedac('0x12')](_0xedac('0x48'),_0x3a7199[_0xedac('0x2d')]);var _0x54b88e=conferenceValidation['validate'](_0x3a7199[_0xedac('0x2d')]);if(_0x54b88e[_0xedac('0x27')]>0x0){return _0x3f313a[_0xedac('0x1a')](0x190)[_0xedac('0x36')](_0x54b88e);}var _0x864600=_0x3a7199['body'][_0xedac('0x2e')];return getAgent(_0x864600)['then'](function(_0x8d20e7){logger[_0xedac('0x12')]('entityFound:',_0x8d20e7['name']);emit(util['format'](_0xedac('0x34'),_0x8d20e7[_0xedac('0x18')]),_0xedac('0x49'));return _0x3f313a[_0xedac('0x1a')](0xc8)[_0xedac('0x36')]({'error':![],'message':_0xedac('0x4a')});})[_0xedac('0x20')](handleError(_0x3f313a));};exports[_0xedac('0x4b')]=function(_0x396e89,_0x2f1443){logger['info'](_0xedac('0x4c'),_0x396e89[_0xedac('0x2d')]);var _0x4b1299=transferValidation[_0xedac('0x2c')](_0x396e89[_0xedac('0x2d')]);if(_0x4b1299[_0xedac('0x27')]>0x0){return _0x2f1443[_0xedac('0x1a')](0x190)[_0xedac('0x36')](_0x4b1299);}var _0x122850=_0x396e89[_0xedac('0x2d')][_0xedac('0x2e')];var _0x15997a=_0x396e89[_0xedac('0x2d')][_0xedac('0x26')];var _0x207b40=_0x396e89[_0xedac('0x2d')][_0xedac('0x4d')];return getAgent(_0x122850)[_0xedac('0x24')](function(_0x180be4){logger[_0xedac('0x12')](_0xedac('0x32'),_0x180be4['name']);emit(util[_0xedac('0x33')]('user:%s',_0x180be4[_0xedac('0x18')]),'webbar:transfer',{'sessionId':_0x15997a,'transferNumber':_0x207b40});return _0x2f1443[_0xedac('0x1a')](0xc8)[_0xedac('0x36')]({'error':![],'message':_0xedac('0x4e')});})[_0xedac('0x20')](handleError(_0x2f1443));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 40410ae..3e4b87a 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 _0x3413=['post','create','/:id/dispositions','addDisposition','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications'];(function(_0x119ef1,_0x17c4e5){var _0x33fcc5=function(_0x3fada2){while(--_0x3fada2){_0x119ef1['push'](_0x119ef1['shift']());}};_0x33fcc5(++_0x17c4e5);}(_0x3413,0x1d6));var _0x3341=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3413[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3341('0x0'));var util=require(_0x3341('0x1'));var path=require(_0x3341('0x2'));var timeout=require(_0x3341('0x3'));var express=require(_0x3341('0x4'));var router=express[_0x3341('0x5')]();var auth=require(_0x3341('0x6'));var interaction=require(_0x3341('0x7'));var config=require(_0x3341('0x8'));var controller=require(_0x3341('0x9'));router[_0x3341('0xa')]('/',auth[_0x3341('0xb')](),controller['index']);router[_0x3341('0xa')](_0x3341('0xc'),auth[_0x3341('0xb')](),controller[_0x3341('0xd')]);router[_0x3341('0xa')](_0x3341('0xe'),auth['isAuthenticated'](),controller[_0x3341('0xf')]);router[_0x3341('0xa')]('/:id/dispositions',auth[_0x3341('0xb')](),controller[_0x3341('0x10')]);router[_0x3341('0xa')](_0x3341('0x11'),auth[_0x3341('0xb')](),controller[_0x3341('0x12')]);router[_0x3341('0xa')]('/:id/users',auth[_0x3341('0xb')](),controller[_0x3341('0x13')]);router['get'](_0x3341('0x14'),auth[_0x3341('0xb')](),controller[_0x3341('0x15')]);router[_0x3341('0x16')]('/',auth[_0x3341('0xb')](),controller[_0x3341('0x17')]);router['post'](_0x3341('0x18'),auth[_0x3341('0xb')](),controller[_0x3341('0x19')]);router[_0x3341('0x16')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3341('0x1a')]);router[_0x3341('0x16')](_0x3341('0x1b'),auth[_0x3341('0xb')](),controller[_0x3341('0x1c')]);router[_0x3341('0x16')](_0x3341('0x14'),auth['isAuthenticated'](),controller[_0x3341('0x1d')]);router[_0x3341('0x16')](_0x3341('0x1e'),controller['notify']);router[_0x3341('0x16')](_0x3341('0x1f'),auth['isAuthenticated'](),controller[_0x3341('0x20')]);router[_0x3341('0x21')]('/:id',auth[_0x3341('0xb')](),controller[_0x3341('0x22')]);router[_0x3341('0x23')](_0x3341('0xe'),auth[_0x3341('0xb')](),controller[_0x3341('0x24')]);router[_0x3341('0x23')](_0x3341('0x18'),auth['isAuthenticated'](),controller[_0x3341('0x25')]);router[_0x3341('0x23')](_0x3341('0x11'),auth[_0x3341('0xb')](),controller[_0x3341('0x26')]);router['delete'](_0x3341('0x1b'),auth[_0x3341('0xb')](),controller[_0x3341('0x27')]);module[_0x3341('0x28')]=router; \ No newline at end of file +var _0xdf49=['notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','removeAgents','multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','create','/:id/users','addAgents','addApplications','/:id/notify'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0xdf49,0x13c));var _0x9df4=function(_0x51ab83,_0x2721b9){_0x51ab83=_0x51ab83-0x0;var _0x14b6de=_0xdf49[_0x51ab83];return _0x14b6de;};'use strict';var multer=require(_0x9df4('0x0'));var util=require(_0x9df4('0x1'));var path=require(_0x9df4('0x2'));var timeout=require('connect-timeout');var express=require(_0x9df4('0x3'));var router=express[_0x9df4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9df4('0x5'));var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x9df4('0x6')]('/',auth[_0x9df4('0x7')](),controller['index']);router[_0x9df4('0x6')](_0x9df4('0x8'),auth[_0x9df4('0x7')](),controller[_0x9df4('0x9')]);router[_0x9df4('0x6')]('/:id',auth[_0x9df4('0x7')](),controller[_0x9df4('0xa')]);router[_0x9df4('0x6')](_0x9df4('0xb'),auth[_0x9df4('0x7')](),controller[_0x9df4('0xc')]);router['get'](_0x9df4('0xd'),auth[_0x9df4('0x7')](),controller[_0x9df4('0xe')]);router['get']('/:id/users',auth[_0x9df4('0x7')](),controller[_0x9df4('0xf')]);router[_0x9df4('0x6')](_0x9df4('0x10'),auth['isAuthenticated'](),controller[_0x9df4('0x11')]);router[_0x9df4('0x12')]('/',auth[_0x9df4('0x7')](),controller[_0x9df4('0x13')]);router['post'](_0x9df4('0xb'),auth[_0x9df4('0x7')](),controller['addDisposition']);router[_0x9df4('0x12')]('/:id/canned_answers',auth[_0x9df4('0x7')](),controller['addAnswer']);router[_0x9df4('0x12')](_0x9df4('0x14'),auth['isAuthenticated'](),controller[_0x9df4('0x15')]);router[_0x9df4('0x12')](_0x9df4('0x10'),auth['isAuthenticated'](),controller[_0x9df4('0x16')]);router[_0x9df4('0x12')](_0x9df4('0x17'),controller[_0x9df4('0x18')]);router[_0x9df4('0x12')](_0x9df4('0x19'),auth['isAuthenticated'](),controller[_0x9df4('0x1a')]);router[_0x9df4('0x1b')](_0x9df4('0x1c'),auth['isAuthenticated'](),controller[_0x9df4('0x1d')]);router[_0x9df4('0x1e')]('/:id',auth[_0x9df4('0x7')](),controller[_0x9df4('0x1f')]);router[_0x9df4('0x1e')](_0x9df4('0xb'),auth['isAuthenticated'](),controller[_0x9df4('0x20')]);router[_0x9df4('0x1e')](_0x9df4('0xd'),auth[_0x9df4('0x7')](),controller['removeAnswers']);router[_0x9df4('0x1e')]('/:id/users',auth[_0x9df4('0x7')](),controller[_0x9df4('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 32e3502..85fb1bc 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 _0xf40e=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x3e5150,_0x1da22a){var _0xb0f930=function(_0x15738f){while(--_0x15738f){_0x3e5150['push'](_0x3e5150['shift']());}};_0xb0f930(++_0x1da22a);}(_0xf40e,0x1c4));var _0xef40=function(_0x55eab5,_0xf7d082){_0x55eab5=_0x55eab5-0x0;var _0x39d23e=_0xf40e[_0x55eab5];return _0x39d23e;};'use strict';var Sequelize=require(_0xef40('0x0'));var rs=require(_0xef40('0x1'));module[_0xef40('0x2')]={'name':{'type':Sequelize[_0xef40('0x3')],'unique':_0xef40('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xef40('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xef40('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xef40('0x5')](_0xef40('0x6'))},'accountSid':{'type':Sequelize[_0xef40('0x3')]},'authToken':{'type':Sequelize[_0xef40('0x3')]},'notificationTemplate':{'type':Sequelize[_0xef40('0x7')],'defaultValue':function(){return _0xef40('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xef40('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xef40('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xef40('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xef40('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xef40('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xef40('0x9')],'defaultValue':![],'comment':_0xef40('0xb'),'set':function(_0x4ff957){if(!_0x4ff957){this[_0xef40('0xc')](_0xef40('0xd'),null);}this[_0xef40('0xc')](_0xef40('0xe'),_0x4ff957);}},'description':{'type':Sequelize[_0xef40('0x3')]}}; \ No newline at end of file +var _0xea33=['ENUM','twilio','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate'];(function(_0x3d5cfa,_0x768461){var _0x23e598=function(_0x2e0e10){while(--_0x2e0e10){_0x3d5cfa['push'](_0x3d5cfa['shift']());}};_0x23e598(++_0x768461);}(_0xea33,0x19e));var _0x3ea3=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0xea33[_0xd0a847];return _0x2536ec;};'use strict';var Sequelize=require(_0x3ea3('0x0'));var rs=require(_0x3ea3('0x1'));module[_0x3ea3('0x2')]={'name':{'type':Sequelize[_0x3ea3('0x3')],'unique':_0x3ea3('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x3ea3('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x3ea3('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3ea3('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3ea3('0x6')](_0x3ea3('0x7'))},'accountSid':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x3ea3('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3ea3('0x8');}},'notificationSound':{'type':Sequelize[_0x3ea3('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x3ea3('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3ea3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x3ea3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3ea3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3ea3('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x3ea3('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x3ea3('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xd31729){if(!_0xd31729){this[_0x3ea3('0xc')](_0x3ea3('0xd'),null);}this[_0x3ea3('0xc')](_0x3ea3('0xe'),_0xd31729);}},'description':{'type':Sequelize[_0x3ea3('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index d947605..f8fb9ef 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 _0x9354=['then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','result','catch','status','json','count','offset','Content-Range','reject','update','WhatsappAccounts','UserProfileResource','destroy','end','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','body','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','priority','getApplications','whatsapp','Applications','account','applications','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','messageId','MessageSid','isNil','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','DESC','list','Contacts','contact','WhatsappInteraction','interaction','autoclose','push','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','send','List','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.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~!@#$%^&-_=+[{]}.'];(function(_0x1b69e4,_0x2f5ef){var _0x53778c=function(_0x56cb62){while(--_0x56cb62){_0x1b69e4['push'](_0x1b69e4['shift']());}};_0x53778c(++_0x2f5ef);}(_0x9354,0x96));var _0x4935=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x9354[_0x329664];return _0x4e346e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4935('0x0'));var rimraf=require(_0x4935('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4935('0x2'));var rp=require(_0x4935('0x3'));var moment=require(_0x4935('0x4'));var BPromise=require(_0x4935('0x5'));var Mustache=require('mustache');var util=require(_0x4935('0x6'));var path=require(_0x4935('0x7'));var sox=require(_0x4935('0x8'));var csv=require(_0x4935('0x9'));var ejs=require(_0x4935('0xa'));var fs=require('fs');var _=require(_0x4935('0xb'));var squel=require(_0x4935('0xc'));var crypto=require(_0x4935('0xd'));var jsforce=require(_0x4935('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4935('0x9'));var querystring=require('querystring');var Papa=require(_0x4935('0xf'));var Redis=require(_0x4935('0x10'));var authService=require(_0x4935('0x11'));var qs=require(_0x4935('0x12'));var as=require(_0x4935('0x13'));var hardwareService=require(_0x4935('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4935('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4935('0x16')]=_[_0x4935('0x17')](config[_0x4935('0x16')],{'host':_0x4935('0x18'),'port':0x18eb});var socket=require(_0x4935('0x19'))(new Redis(config[_0x4935('0x16')]));require(_0x4935('0x1a'))[_0x4935('0x1b')](socket);var jayson=require(_0x4935('0x1c'));var client=jayson[_0x4935('0x1d')][_0x4935('0x1e')]({'port':0x232c});function checkPasswordPattern(_0x1799e4,_0xa41961,_0x3652c4){if(_0x3652c4){var _0x24cc99=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x24cc99[_0x4935('0x1f')](_0xa41961)){return _0x1799e4;}else{throw new db['Sequelize'][(_0x4935('0x20'))](_0x4935('0x21'));}}else{return _0x1799e4;}}function respondWithRpcPromise(_0x165ed3,_0x123300,_0x1f0e81,_0x429ef3){return new BPromise(function(_0x4ebc63,_0xd70eff){var _0x145277=_0x429ef3||client;return _0x145277['request'](_0x165ed3,_0x1f0e81)[_0x4935('0x22')](function(_0x10407f){logger[_0x4935('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x123300,'request\x20sent');logger[_0x4935('0x24')](_0x4935('0x25'),_0x123300,_0x4935('0x26'),JSON[_0x4935('0x27')](_0x10407f));if(_0x10407f[_0x4935('0x28')]){if(_0x10407f[_0x4935('0x28')][_0x4935('0x29')]===0x1f4){logger[_0x4935('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x123300,_0x10407f[_0x4935('0x28')][_0x4935('0x2a')]);return _0xd70eff(_0x10407f[_0x4935('0x28')][_0x4935('0x2a')]);}logger[_0x4935('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x123300,_0x10407f['error'][_0x4935('0x2a')]);return _0x4ebc63(_0x10407f[_0x4935('0x28')][_0x4935('0x2a')]);}else{logger[_0x4935('0x23')](_0x4935('0x2b'),_0x123300,_0x4935('0x26'));_0x4ebc63(_0x10407f[_0x4935('0x2c')][_0x4935('0x2a')]);}})[_0x4935('0x2d')](function(_0xf4abb2){logger[_0x4935('0x28')](_0x4935('0x2b'),_0x123300,_0xf4abb2);_0xd70eff(_0xf4abb2);});});}function respondWithStatusCode(_0x2c47ab,_0xbb00d6){_0xbb00d6=_0xbb00d6||0xcc;return function(_0x359522){if(_0x359522){return _0x2c47ab['sendStatus'](_0xbb00d6);}return _0x2c47ab['status'](_0xbb00d6)['end']();};}function respondWithResult(_0x1fc218,_0x76ea7d){_0x76ea7d=_0x76ea7d||0xc8;return function(_0x4f1163){if(_0x4f1163){return _0x1fc218[_0x4935('0x2e')](_0x76ea7d)[_0x4935('0x2f')](_0x4f1163);}};}function respondWithFilteredResult(_0x24a3b6,_0x9fe9f6){return function(_0x1198e5){if(_0x1198e5){var _0x24262e=_0x1198e5[_0x4935('0x30')],_0x28afc2=_0x9fe9f6[_0x4935('0x31')],_0x2fe6da=_0x9fe9f6['offset']+_0x9fe9f6['limit'],_0x5b3c8e;if(_0x2fe6da>=_0x24262e){_0x2fe6da=_0x24262e;_0x5b3c8e=0xc8;}else{_0x5b3c8e=0xce;}_0x24a3b6[_0x4935('0x2e')](_0x5b3c8e);return _0x24a3b6['set'](_0x4935('0x32'),_0x28afc2+'-'+_0x2fe6da+'/'+_0x24262e)[_0x4935('0x2f')](_0x1198e5);}return null;};}function patchUpdates(_0x30fbc9){return function(_0x53722a){try{jsonpatch['apply'](_0x53722a,_0x30fbc9,!![]);}catch(_0x415260){return BPromise[_0x4935('0x33')](_0x415260);}return _0x53722a['save']();};}function saveUpdates(_0x47003b,_0x3260d2){return function(_0x9bfd48){if(_0x9bfd48){return _0x9bfd48[_0x4935('0x34')](_0x47003b)[_0x4935('0x22')](function(_0x4a69bc){return _0x4a69bc;});}return null;};}function removeEntity(_0x4b5c01,_0x3d8795){return function(_0x1016cc){if(_0x1016cc){return _0x1016cc['destroy']()['then'](function(){var _0xb3d934=_0x1016cc['get']({'plain':!![]});var _0x7b45d1=_0x4935('0x35');return db[_0x4935('0x36')][_0x4935('0x37')]({'where':{'type':_0x7b45d1,'resourceId':_0xb3d934['id']}})[_0x4935('0x22')](function(){return _0x1016cc;});})[_0x4935('0x22')](function(){_0x4b5c01['status'](0xcc)[_0x4935('0x38')]();});}};}function handleEntityNotFound(_0x51b7ac,_0x365e83){return function(_0x5db44b){if(!_0x5db44b){_0x51b7ac[_0x4935('0x39')](0x194);}return _0x5db44b;};}function handleError(_0x4c5a4e,_0x27ead0){_0x27ead0=_0x27ead0||0x1f4;return function(_0x59b749){logger[_0x4935('0x28')](_0x59b749[_0x4935('0x3a')]);if(_0x59b749[_0x4935('0x3b')]){delete _0x59b749[_0x4935('0x3b')];}_0x4c5a4e[_0x4935('0x2e')](_0x27ead0)['send'](_0x59b749);};}exports['index']=function(_0x2efc45,_0x4e4820){var _0x4e8b2e={'include':[{'model':db[_0x4935('0x3c')],'as':_0x4935('0x3d')}]},_0x1552b2={},_0x5c8012={'count':0x0,'rows':[]};var _0x2d67e3=_[_0x4935('0x3e')](db[_0x4935('0x3f')]['rawAttributes'],function(_0x5d4d7f){return{'name':_0x5d4d7f[_0x4935('0x40')],'type':_0x5d4d7f[_0x4935('0x41')][_0x4935('0x42')]};});_0x1552b2[_0x4935('0x43')]=_[_0x4935('0x3e')](_0x2d67e3,_0x4935('0x3b'));_0x1552b2[_0x4935('0x44')]=_[_0x4935('0x45')](_0x2efc45['query']);_0x1552b2['filters']=_[_0x4935('0x46')](_0x1552b2[_0x4935('0x43')],_0x1552b2['query']);_0x4e8b2e[_0x4935('0x47')]=_[_0x4935('0x46')](_0x1552b2[_0x4935('0x43')],qs[_0x4935('0x48')](_0x2efc45['query']['fields']));_0x4e8b2e[_0x4935('0x47')]=_0x4e8b2e[_0x4935('0x47')]['length']?_0x4e8b2e[_0x4935('0x47')]:_0x1552b2[_0x4935('0x43')];if(!_0x2efc45[_0x4935('0x44')]['hasOwnProperty'](_0x4935('0x49'))){_0x4e8b2e[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x2efc45[_0x4935('0x44')][_0x4935('0x4a')]);_0x4e8b2e[_0x4935('0x31')]=qs[_0x4935('0x31')](_0x2efc45[_0x4935('0x44')][_0x4935('0x31')]);}_0x4e8b2e[_0x4935('0x4b')]=qs[_0x4935('0x4c')](_0x2efc45[_0x4935('0x44')][_0x4935('0x4c')]);_0x4e8b2e[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x2efc45[_0x4935('0x44')],_0x1552b2[_0x4935('0x4e')]),_0x2d67e3);if(_0x2efc45['query'][_0x4935('0x50')]){_0x4e8b2e['where']=_[_0x4935('0x51')](_0x4e8b2e[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0x2d67e3,function(_0x33e94a){if(_0x33e94a['type']!==_0x4935('0x52')){var _0x9c8bad={};_0x9c8bad[_0x33e94a[_0x4935('0x3b')]]={'$like':'%'+_0x2efc45[_0x4935('0x44')][_0x4935('0x50')]+'%'};return _0x9c8bad;}})});}_0x4e8b2e=_[_0x4935('0x51')]({},_0x4e8b2e,_0x2efc45[_0x4935('0x53')]);var _0x31d137={'where':_0x4e8b2e[_0x4935('0x4d')]};return db[_0x4935('0x3f')]['count'](_0x31d137)[_0x4935('0x22')](function(_0x1c3d9c){_0x5c8012['count']=_0x1c3d9c;if(_0x2efc45[_0x4935('0x44')][_0x4935('0x54')]){_0x4e8b2e[_0x4935('0x55')]=[{'all':!![]}];}return db[_0x4935('0x3f')][_0x4935('0x56')](_0x4e8b2e);})[_0x4935('0x22')](function(_0x289c5e){_0x5c8012[_0x4935('0x57')]=_0x289c5e;return _0x5c8012;})['then'](respondWithFilteredResult(_0x4e4820,_0x4e8b2e))[_0x4935('0x2d')](handleError(_0x4e4820,null));};exports['show']=function(_0x561fa3,_0x15ce51){var _0x189071={'raw':![],'where':{'id':_0x561fa3[_0x4935('0x58')]['id']},'include':[{'model':db[_0x4935('0x3c')],'as':'mandatoryDispositionPause'}]},_0x41c6d0={};_0x41c6d0[_0x4935('0x43')]=_[_0x4935('0x45')](db[_0x4935('0x3f')][_0x4935('0x59')]);_0x41c6d0[_0x4935('0x44')]=_[_0x4935('0x45')](_0x561fa3[_0x4935('0x44')]);_0x41c6d0[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x41c6d0[_0x4935('0x43')],_0x41c6d0['query']);_0x189071[_0x4935('0x47')]=_['intersection'](_0x41c6d0[_0x4935('0x43')],qs[_0x4935('0x48')](_0x561fa3['query'][_0x4935('0x48')]));_0x189071['attributes']=_0x189071['attributes']['length']?_0x189071[_0x4935('0x47')]:_0x41c6d0[_0x4935('0x43')];if(_0x561fa3[_0x4935('0x44')][_0x4935('0x54')]){_0x189071[_0x4935('0x55')]=[{'all':!![]}];}_0x189071=_['merge']({},_0x189071,_0x561fa3['options']);return db[_0x4935('0x3f')][_0x4935('0x5a')](_0x189071)[_0x4935('0x22')](handleEntityNotFound(_0x15ce51,null))['then'](respondWithResult(_0x15ce51,null))[_0x4935('0x2d')](handleError(_0x15ce51,null));};exports[_0x4935('0x5b')]=function(_0x24141a,_0xc92288){return db['WhatsappAccount'][_0x4935('0x5b')](_0x24141a['body'],{})['then'](function(_0x513b0e){var _0x24d870=_0x24141a[_0x4935('0x5c')]['get']({'plain':!![]});if(!_0x24d870)throw new Error(_0x4935('0x5d'));if(_0x24d870[_0x4935('0x5e')]==='user'){var _0x114a96=_0x513b0e[_0x4935('0x5f')]({'plain':!![]});var _0x3551b6=_0x4935('0x35');return db[_0x4935('0x60')][_0x4935('0x5a')]({'where':{'name':_0x3551b6,'userProfileId':_0x24d870[_0x4935('0x61')]},'raw':!![]})['then'](function(_0x31b426){if(_0x31b426&&_0x31b426['autoAssociation']===0x0){return db['UserProfileResource'][_0x4935('0x5b')]({'name':_0x114a96[_0x4935('0x3b')],'resourceId':_0x114a96['id'],'type':_0x31b426['name'],'sectionId':_0x31b426['id']},{})['then'](function(){return _0x513b0e;});}else{return _0x513b0e;}})[_0x4935('0x2d')](function(_0x24841d){logger[_0x4935('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24841d);throw _0x24841d;});}return _0x513b0e;})[_0x4935('0x22')](respondWithResult(_0xc92288,0xc9))['catch'](handleError(_0xc92288,null));};exports[_0x4935('0x34')]=function(_0x3d2005,_0x10b18b){if(_0x3d2005[_0x4935('0x62')]['id']){delete _0x3d2005[_0x4935('0x62')]['id'];}return db['WhatsappAccount'][_0x4935('0x5a')]({'where':{'id':_0x3d2005[_0x4935('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x4935('0x3d')}]})[_0x4935('0x22')](handleEntityNotFound(_0x10b18b,null))[_0x4935('0x22')](saveUpdates(_0x3d2005[_0x4935('0x62')],null))[_0x4935('0x22')](respondWithResult(_0x10b18b,null))[_0x4935('0x2d')](handleError(_0x10b18b,null));};exports[_0x4935('0x37')]=function(_0x3e8b18,_0x15ebcc){return db[_0x4935('0x3f')][_0x4935('0x5a')]({'where':{'id':_0x3e8b18['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x15ebcc,null))[_0x4935('0x22')](removeEntity(_0x15ebcc,null))[_0x4935('0x2d')](handleError(_0x15ebcc,null));};exports[_0x4935('0x63')]=function(_0x45c56c,_0x95da52){return db[_0x4935('0x3f')][_0x4935('0x63')]()[_0x4935('0x22')](respondWithResult(_0x95da52,null))[_0x4935('0x2d')](handleError(_0x95da52,null));};exports[_0x4935('0x64')]=function(_0x225a1a,_0x3a427c,_0x4824fd){if(_0x225a1a['body']['id']){delete _0x225a1a[_0x4935('0x62')]['id'];}return db[_0x4935('0x3f')]['find']({'where':{'id':_0x225a1a[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x3a427c,null))['then'](function(_0x4c5cdc){if(_0x4c5cdc){_0x225a1a[_0x4935('0x62')][_0x4935('0x65')]=_0x4c5cdc['id'];return db[_0x4935('0x66')][_0x4935('0x5b')](_0x225a1a[_0x4935('0x62')]);}})['then'](respondWithResult(_0x3a427c,null))[_0x4935('0x2d')](handleError(_0x3a427c,null));};exports[_0x4935('0x67')]=function(_0x26bbe,_0x15232f,_0x583964){var _0xd97c04={'raw':![],'where':{}};var _0x4c235f={};var _0x54be3b={'count':0x0,'rows':[]};return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x26bbe['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x15232f,null))[_0x4935('0x22')](function(_0xfa309e){if(_0xfa309e){_0x4c235f['model']=_[_0x4935('0x45')](db['Disposition']['rawAttributes']);_0x4c235f[_0x4935('0x44')]=_[_0x4935('0x45')](_0x26bbe[_0x4935('0x44')]);_0x4c235f[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x4c235f[_0x4935('0x43')],_0x4c235f[_0x4935('0x44')]);_0xd97c04[_0x4935('0x47')]=_['intersection'](_0x4c235f[_0x4935('0x43')],qs[_0x4935('0x48')](_0x26bbe[_0x4935('0x44')]['fields']));_0xd97c04['attributes']=_0xd97c04[_0x4935('0x47')][_0x4935('0x69')]?_0xd97c04['attributes']:_0x4c235f[_0x4935('0x43')];if(!_0x26bbe['query']['hasOwnProperty'](_0x4935('0x49'))){_0xd97c04[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x26bbe['query']['limit']);_0xd97c04[_0x4935('0x31')]=qs['offset'](_0x26bbe[_0x4935('0x44')]['offset']);}_0xd97c04[_0x4935('0x4b')]=qs[_0x4935('0x4c')](_0x26bbe[_0x4935('0x44')][_0x4935('0x4c')]);_0xd97c04[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x26bbe['query'],_0x4c235f[_0x4935('0x4e')]));_0xd97c04['where'][_0x4935('0x65')]=_0xfa309e['id'];if(_0x26bbe[_0x4935('0x44')]['filter']){_0xd97c04[_0x4935('0x4d')]=_['merge'](_0xd97c04[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0xd97c04['attributes'],function(_0x582a2c){var _0x530e9f={};_0x530e9f[_0x582a2c]={'$like':'%'+_0x26bbe[_0x4935('0x44')]['filter']+'%'};return _0x530e9f;})});}_0xd97c04=_['merge']({},_0xd97c04,_0x26bbe[_0x4935('0x53')]);return db['Disposition'][_0x4935('0x30')]({'where':_0xd97c04['where']})['then'](function(_0x5c5978){_0x54be3b[_0x4935('0x30')]=_0x5c5978;if(_0x26bbe['query'][_0x4935('0x54')]){_0xd97c04[_0x4935('0x55')]=[{'all':!![]}];}return db[_0x4935('0x66')][_0x4935('0x56')](_0xd97c04);})[_0x4935('0x22')](function(_0x4a240b){_0x54be3b[_0x4935('0x57')]=_0x4a240b;return _0x54be3b;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x15232f,_0xd97c04))['catch'](handleError(_0x15232f,null));};exports[_0x4935('0x6a')]=function(_0x9d01a9,_0x50df2a,_0x1ffef1){return db[_0x4935('0x3f')]['find']({'where':{'id':_0x9d01a9[_0x4935('0x58')]['id']}})['then'](handleEntityNotFound(_0x50df2a,null))[_0x4935('0x22')](function(_0x453bb1){if(_0x453bb1){return _0x453bb1['removeDispositions'](_0x9d01a9[_0x4935('0x44')][_0x4935('0x6b')]);}})['then'](respondWithStatusCode(_0x50df2a,null))['catch'](handleError(_0x50df2a,null));};exports[_0x4935('0x6c')]=function(_0x14dbfa,_0x49a767,_0x27ce22){if(_0x14dbfa[_0x4935('0x62')]['id']){delete _0x14dbfa[_0x4935('0x62')]['id'];}return db[_0x4935('0x3f')]['find']({'where':{'id':_0x14dbfa[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x49a767,null))['then'](function(_0x2f7897){if(_0x2f7897){_0x14dbfa[_0x4935('0x62')][_0x4935('0x65')]=_0x2f7897['id'];return db[_0x4935('0x6d')][_0x4935('0x5b')](_0x14dbfa[_0x4935('0x62')]);}})[_0x4935('0x22')](respondWithResult(_0x49a767,null))[_0x4935('0x2d')](handleError(_0x49a767,null));};exports[_0x4935('0x6e')]=function(_0x2978d7,_0x34f3d4,_0x50a14b){var _0x394367={'raw':![],'where':{}};var _0x3e8e54={};var _0x1e6d84={'count':0x0,'rows':[]};return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x2978d7['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x34f3d4,null))[_0x4935('0x22')](function(_0x4b9b39){if(_0x4b9b39){_0x3e8e54[_0x4935('0x43')]=_[_0x4935('0x45')](db['CannedAnswer'][_0x4935('0x59')]);_0x3e8e54[_0x4935('0x44')]=_[_0x4935('0x45')](_0x2978d7['query']);_0x3e8e54[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x3e8e54[_0x4935('0x43')],_0x3e8e54[_0x4935('0x44')]);_0x394367[_0x4935('0x47')]=_['intersection'](_0x3e8e54[_0x4935('0x43')],qs[_0x4935('0x48')](_0x2978d7[_0x4935('0x44')][_0x4935('0x48')]));_0x394367[_0x4935('0x47')]=_0x394367[_0x4935('0x47')]['length']?_0x394367[_0x4935('0x47')]:_0x3e8e54[_0x4935('0x43')];if(!_0x2978d7[_0x4935('0x44')][_0x4935('0x6f')](_0x4935('0x49'))){_0x394367[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x2978d7['query'][_0x4935('0x4a')]);_0x394367[_0x4935('0x31')]=qs[_0x4935('0x31')](_0x2978d7[_0x4935('0x44')][_0x4935('0x31')]);}_0x394367['order']=qs['sort'](_0x2978d7[_0x4935('0x44')][_0x4935('0x4c')]);_0x394367[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x2978d7['query'],_0x3e8e54[_0x4935('0x4e')]));_0x394367[_0x4935('0x4d')][_0x4935('0x65')]=_0x4b9b39['id'];if(_0x2978d7['query'][_0x4935('0x50')]){_0x394367[_0x4935('0x4d')]=_[_0x4935('0x51')](_0x394367[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0x394367[_0x4935('0x47')],function(_0xe60fe){var _0x47e1dd={};_0x47e1dd[_0xe60fe]={'$like':'%'+_0x2978d7[_0x4935('0x44')]['filter']+'%'};return _0x47e1dd;})});}_0x394367=_[_0x4935('0x51')]({},_0x394367,_0x2978d7['options']);return db['CannedAnswer'][_0x4935('0x30')]({'where':_0x394367['where']})['then'](function(_0x213fe3){_0x1e6d84[_0x4935('0x30')]=_0x213fe3;if(_0x2978d7['query'][_0x4935('0x54')]){_0x394367['include']=[{'all':!![]}];}return db[_0x4935('0x6d')][_0x4935('0x56')](_0x394367);})[_0x4935('0x22')](function(_0x22a8b8){_0x1e6d84[_0x4935('0x57')]=_0x22a8b8;return _0x1e6d84;});}})[_0x4935('0x22')](respondWithFilteredResult(_0x34f3d4,_0x394367))['catch'](handleError(_0x34f3d4,null));};exports[_0x4935('0x70')]=function(_0x16b1bb,_0xce134a,_0x5d53e6){return db[_0x4935('0x3f')][_0x4935('0x5a')]({'where':{'id':_0x16b1bb[_0x4935('0x58')]['id']}})['then'](handleEntityNotFound(_0xce134a,null))[_0x4935('0x22')](function(_0x44031e){if(_0x44031e){return _0x44031e[_0x4935('0x70')](_0x16b1bb[_0x4935('0x44')][_0x4935('0x6b')]);}})['then'](respondWithStatusCode(_0xce134a,null))[_0x4935('0x2d')](handleError(_0xce134a,null));};exports['addAgents']=function(_0x19fe30,_0x4bc3e7,_0x17dc59){return db['WhatsappAccount'][_0x4935('0x5a')]({'where':{'id':_0x19fe30[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4bc3e7,null))['then'](function(_0x31d209){if(_0x31d209){return _0x31d209[_0x4935('0x71')](_0x19fe30[_0x4935('0x62')][_0x4935('0x6b')],_[_0x4935('0x72')](_0x19fe30[_0x4935('0x62')],[_0x4935('0x6b'),'id'])||{})[_0x4935('0x73')](function(_0xc4ce1d){for(var _0x575ca2=0x0;_0x575ca2<_0x19fe30[_0x4935('0x62')][_0x4935('0x6b')][_0x4935('0x69')];_0x575ca2+=0x1){socket[_0x4935('0x74')](_0x4935('0x75'),{'UserId':_0x19fe30[_0x4935('0x62')][_0x4935('0x6b')][_0x575ca2],'WhatsappAccountId':_0x19fe30['params']['id']});}return _0xc4ce1d;});}})['then'](respondWithResult(_0x4bc3e7,null))[_0x4935('0x2d')](handleError(_0x4bc3e7,null));};exports['removeAgents']=function(_0x47ee06,_0x451ea8,_0x3a4266){return db[_0x4935('0x3f')][_0x4935('0x5a')]({'where':{'id':_0x47ee06['params']['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x451ea8,null))[_0x4935('0x22')](function(_0x59e6b4){if(_0x59e6b4){return _0x59e6b4['removeAgents'](_0x47ee06['query']['ids'])['then'](function(){if(_[_0x4935('0x76')](_0x47ee06[_0x4935('0x44')]['ids'])){for(var _0x492bfb=0x0;_0x492bfb<_0x47ee06['query'][_0x4935('0x6b')][_0x4935('0x69')];_0x492bfb+=0x1){socket[_0x4935('0x74')]('userWhatsappAccount:remove',{'UserId':Number(_0x47ee06['query']['ids'][_0x492bfb]),'WhatsappAccountId':Number(_0x47ee06[_0x4935('0x58')]['id'])});}}else{socket[_0x4935('0x74')](_0x4935('0x77'),{'UserId':Number(_0x47ee06[_0x4935('0x44')]['ids']),'WhatsappAccountId':Number(_0x47ee06[_0x4935('0x58')]['id'])});}});}})[_0x4935('0x22')](respondWithStatusCode(_0x451ea8,null))[_0x4935('0x2d')](handleError(_0x451ea8,null));};exports['getAgents']=function(_0x4f6984,_0x3568ea,_0x2f4b61){var _0x81f969={};var _0x281db3={};var _0x415fc2;var _0x255a60;return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x4f6984[_0x4935('0x58')]['id']}})['then'](handleEntityNotFound(_0x3568ea,null))[_0x4935('0x22')](function(_0x4120db){if(_0x4120db){_0x415fc2=_0x4120db;_0x281db3['model']=_['keys'](db[_0x4935('0x78')]['rawAttributes']);_0x281db3[_0x4935('0x44')]=_[_0x4935('0x45')](_0x4f6984['query']);_0x281db3[_0x4935('0x4e')]=_['intersection'](_0x281db3[_0x4935('0x43')],_0x281db3[_0x4935('0x44')]);_0x81f969['attributes']=_['intersection'](_0x281db3[_0x4935('0x43')],qs[_0x4935('0x48')](_0x4f6984[_0x4935('0x44')][_0x4935('0x48')]));_0x81f969[_0x4935('0x47')]=_0x81f969[_0x4935('0x47')][_0x4935('0x69')]?_0x81f969[_0x4935('0x47')]:_0x281db3['model'];_0x81f969['order']=qs[_0x4935('0x4c')](_0x4f6984[_0x4935('0x44')][_0x4935('0x4c')]);_0x81f969[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x4f6984[_0x4935('0x44')],_0x281db3[_0x4935('0x4e')]));if(_0x4f6984['query'][_0x4935('0x50')]){_0x81f969['where']=_[_0x4935('0x51')](_0x81f969['where'],{'$or':_[_0x4935('0x3e')](_0x81f969[_0x4935('0x47')],function(_0x31eaee){var _0x409d86={};_0x409d86[_0x31eaee]={'$like':'%'+_0x4f6984[_0x4935('0x44')]['filter']+'%'};return _0x409d86;})});}_0x81f969=_[_0x4935('0x51')]({},_0x81f969,_0x4f6984[_0x4935('0x53')]);return _0x415fc2[_0x4935('0x79')](_0x81f969);}})['then'](function(_0x4d4085){if(_0x4d4085){_0x255a60=_0x4d4085[_0x4935('0x69')];if(!_0x4f6984['query'][_0x4935('0x6f')](_0x4935('0x49'))){_0x81f969[_0x4935('0x4a')]=qs[_0x4935('0x4a')](_0x4f6984[_0x4935('0x44')]['limit']);_0x81f969[_0x4935('0x31')]=qs[_0x4935('0x31')](_0x4f6984[_0x4935('0x44')][_0x4935('0x31')]);}return _0x415fc2[_0x4935('0x79')](_0x81f969);}})['then'](function(_0x1058f2){if(_0x1058f2){return _0x1058f2?{'count':_0x255a60,'rows':_0x1058f2}:null;}})[_0x4935('0x22')](respondWithResult(_0x3568ea,null))[_0x4935('0x2d')](handleError(_0x3568ea,null));};exports[_0x4935('0x7a')]=function(_0x51a95e,_0x4aa286,_0x5b303b){return db['WhatsappAccount'][_0x4935('0x68')]({'where':{'id':_0x51a95e[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4aa286,null))[_0x4935('0x22')](function(_0x13921c){if(_0x13921c){return db[_0x4935('0x7b')][_0x4935('0x7c')](function(_0x9afab9){return db[_0x4935('0x7d')][_0x4935('0x37')]({'where':{'WhatsappAccountId':_0x51a95e['params']['id']},'transaction':_0x9afab9})[_0x4935('0x22')](function(_0x3508ac){var _0x37f88a=_[_0x4935('0x3e')](_0x51a95e[_0x4935('0x62')],function(_0x8ef56f){_0x8ef56f[_0x4935('0x65')]=_0x51a95e[_0x4935('0x58')]['id'];return _0x8ef56f;});return db[_0x4935('0x7d')]['bulkCreate'](_0x37f88a,{'transaction':_0x9afab9});});})['then'](function(){return db[_0x4935('0x7d')][_0x4935('0x7e')]({'where':{'WhatsappAccountId':_0x51a95e[_0x4935('0x58')]['id']},'order':_0x4935('0x7f')});});}})[_0x4935('0x22')](respondWithResult(_0x4aa286,null))[_0x4935('0x2d')](handleError(_0x4aa286,null));};exports[_0x4935('0x80')]=function(_0x15b50e,_0x4c6b62,_0xc2892a){var _0x290e25={};var _0x4f968d={};var _0x46f309;var _0x4bfd8f;return db[_0x4935('0x3f')][_0x4935('0x68')]({'where':{'id':_0x15b50e[_0x4935('0x58')]['id']}})[_0x4935('0x22')](handleEntityNotFound(_0x4c6b62,null))[_0x4935('0x22')](function(_0x37a095){if(_0x37a095){_0x46f309=_0x37a095;_0x4f968d[_0x4935('0x43')]=_[_0x4935('0x45')](db[_0x4935('0x7d')][_0x4935('0x59')]);_0x4f968d['query']=_[_0x4935('0x45')](_0x15b50e['query']);_0x4f968d[_0x4935('0x4e')]=_[_0x4935('0x46')](_0x4f968d[_0x4935('0x43')],_0x4f968d[_0x4935('0x44')]);_0x290e25[_0x4935('0x47')]=_['intersection'](_0x4f968d[_0x4935('0x43')],qs[_0x4935('0x48')](_0x15b50e[_0x4935('0x44')][_0x4935('0x48')]));_0x290e25[_0x4935('0x47')]=_0x290e25[_0x4935('0x47')][_0x4935('0x69')]?_0x290e25[_0x4935('0x47')]:_0x4f968d[_0x4935('0x43')];_0x290e25[_0x4935('0x4b')]=qs[_0x4935('0x4c')](_0x15b50e[_0x4935('0x44')]['sort']);_0x290e25[_0x4935('0x4d')]=qs[_0x4935('0x4e')](_[_0x4935('0x4f')](_0x15b50e['query'],_0x4f968d[_0x4935('0x4e')]));if(_0x15b50e['query'][_0x4935('0x50')]){_0x290e25[_0x4935('0x4d')]=_[_0x4935('0x51')](_0x290e25[_0x4935('0x4d')],{'$or':_[_0x4935('0x3e')](_0x290e25['attributes'],function(_0x3450d2){var _0x380f3d={};_0x380f3d[_0x3450d2]={'$like':'%'+_0x15b50e[_0x4935('0x44')][_0x4935('0x50')]+'%'};return _0x380f3d;})});}_0x290e25=_['merge']({},_0x290e25,_0x15b50e[_0x4935('0x53')]);return _0x46f309[_0x4935('0x80')](_0x290e25);}})[_0x4935('0x22')](function(_0x44de80){if(_0x44de80){_0x4bfd8f=_0x44de80[_0x4935('0x69')];if(!_0x15b50e[_0x4935('0x44')][_0x4935('0x6f')](_0x4935('0x49'))){_0x290e25['limit']=qs[_0x4935('0x4a')](_0x15b50e[_0x4935('0x44')][_0x4935('0x4a')]);_0x290e25['offset']=qs[_0x4935('0x31')](_0x15b50e[_0x4935('0x44')]['offset']);}return _0x46f309['getApplications'](_0x290e25);}})[_0x4935('0x22')](function(_0x30f6cd){if(_0x30f6cd){return _0x30f6cd?{'count':_0x4bfd8f,'rows':_0x30f6cd}:null;}})[_0x4935('0x22')](respondWithResult(_0x4c6b62,null))['catch'](handleError(_0x4c6b62,null));};exports['notify']=function(_0x4d0fc2,_0x1488f3,_0x8ca869){var _0x215de6={'channel':_0x4935('0x81')};var _0x303e9e=[];var _0x4ccbb7=[];var _0x15c87c={};return db['WhatsappAccount']['find']({'where':{'id':_0x4d0fc2['params']['id']},'include':[{'model':db[_0x4935('0x7d')],'as':_0x4935('0x82')}]})[_0x4935('0x22')](handleEntityNotFound(_0x1488f3,null))['then'](function(_0x384144){_0x215de6[_0x4935('0x83')]=_0x384144;_0x215de6[_0x4935('0x84')]=_['orderBy'](_0x384144[_0x4935('0x82')],[_0x4935('0x7f')],['asc']);if(_0x215de6['account'][_0x4935('0x82')]){delete _0x215de6['account'][_0x4935('0x82')];}return db[_0x4935('0x85')]['describe']();})[_0x4935('0x22')](function(_0x47a116){if(!_0x47a116){throw new db['Sequelize'][(_0x4935('0x20'))](_0x4935('0x86'));}_0x303e9e=_[_0x4935('0x87')](_[_0x4935('0x45')](_0x47a116),[_0x4935('0x88'),_0x4935('0x89')]);_0x4ccbb7=_[_0x4935('0x87')](_['keys'](_0x47a116),[_0x4935('0x88'),'updatedAt',_0x4935('0x8a'),_0x4935('0x8b')]);_0x215de6[_0x4935('0x62')]={'mapKey':_0x4935('0x8c')};if(_0x215de6[_0x4935('0x83')][_0x4935('0x41')]&&_0x215de6['account']['type']===_0x4935('0x8d')){_0x215de6[_0x4935('0x62')][_0x4935('0x8e')]=_0x4d0fc2[_0x4935('0x62')][_0x4935('0x8f')][_0x4935('0x90')]('whatsapp:','');_0x215de6[_0x4935('0x62')][_0x4935('0x62')]=_0x4d0fc2[_0x4935('0x62')]['Body'];_0x215de6['body'][_0x4935('0x91')]=_0x4d0fc2[_0x4935('0x62')][_0x4935('0x92')];}if(_0x215de6[_0x4935('0x62')]['id']){delete _0x215de6['body']['id'];}if(_[_0x4935('0x93')](_0x215de6[_0x4935('0x62')][_0x4935('0x8e')])){throw new db['Sequelize']['ValidationError'](_0x4935('0x94'));}if(_[_0x4935('0x93')](_0x215de6['body']['body'])||_0x215de6[_0x4935('0x62')][_0x4935('0x62')]===''){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))](_0x4935('0x96'));}if(_[_0x4935('0x93')](_0x215de6['body'][_0x4935('0x97')])){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))](_0x4935('0x98')+_0x4ccbb7);}if(!_[_0x4935('0x99')](_0x4ccbb7,_0x215de6[_0x4935('0x62')]['mapKey'])){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4ccbb7);}_0x15c87c[_0x215de6[_0x4935('0x62')][_0x4935('0x97')]]=_0x215de6[_0x4935('0x62')]['from'];return db[_0x4935('0x9a')]['find']({'where':{'id':_0x215de6[_0x4935('0x83')]['ListId']},'include':[{'model':db[_0x4935('0x85')],'as':'Contacts','where':_0x15c87c,'limit':0x1,'order':[[_0x4935('0x89'),_0x4935('0x9b')]]}]});})[_0x4935('0x22')](handleEntityNotFound(_0x1488f3,null))[_0x4935('0x22')](function(_0x480708){if(_0x480708){_0x215de6[_0x4935('0x9c')]=_[_0x4935('0x72')](_0x480708,[_0x4935('0x9d')]);if(_0x480708[_0x4935('0x9d')][_0x4935('0x69')]){return _0x480708[_0x4935('0x9d')][0x0];}var _0x512e48=_['defaults'](_0x215de6['body'],{'firstName':_0x215de6['body']['from'],'ListId':_0x480708['id']});_0x512e48[_0x215de6[_0x4935('0x62')][_0x4935('0x97')]]=_0x215de6['body'][_0x4935('0x8e')];return db['CmContact'][_0x4935('0x5b')](_0x512e48,{'fields':_0x303e9e,'raw':!![]});}})[_0x4935('0x22')](handleEntityNotFound(_0x1488f3,null))['then'](function(_0x59154b){if(_0x59154b){_0x215de6[_0x4935('0x9e')]=_0x59154b;var _0x9d154a={'ContactId':_0x59154b['id'],'phone':_0x215de6['body']['from'],'WhatsappAccountId':_0x4d0fc2[_0x4935('0x58')]['id']};var _0x5bc89d={'ContactId':_0x59154b['id'],'WhatsappAccountId':_0x4d0fc2[_0x4935('0x58')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x4935('0x5a')]({'where':_0x5bc89d})[_0x4935('0x22')](function(_0x2b47e8){if(_0x2b47e8){return[_0x2b47e8,![]];}return db[_0x4935('0x9f')][_0x4935('0x5b')](_0x9d154a)[_0x4935('0x22')](function(_0x3c61a9){return[_0x3c61a9,!![]];});});}})[_0x4935('0x73')](function(_0x4e1079,_0x48b8f5){_0x215de6[_0x4935('0xa0')]=_0x4e1079[_0x4935('0x5f')]({'plain':!![]});_0x215de6[_0x4935('0xa0')]['created']=![];if(_0x48b8f5){if(_0x215de6['account'][_0x4935('0xa1')]){_0x215de6['applications'][_0x4935('0xa2')]({'id':0x0,'priority':_0x215de6[_0x4935('0x84')][_0x4935('0x69')]+0x1,'app':'close','appdata':_0x4935('0xa3'),'interval':_0x4935('0xa4')});}_0x215de6[_0x4935('0xa0')][_0x4935('0xa5')]=!![];}return db[_0x4935('0xa6')][_0x4935('0x5b')]({'phone':_0x215de6[_0x4935('0x62')][_0x4935('0x8e')],'messageId':_0x215de6[_0x4935('0x62')][_0x4935('0x91')],'body':_0x215de6[_0x4935('0x62')][_0x4935('0x62')],'WhatsappAccountId':_0x4d0fc2[_0x4935('0x58')]['id'],'WhatsappInteractionId':_0x4e1079['id'],'direction':'in','ContactId':_0x4e1079[_0x4935('0xa7')],'AttachmentId':_0x215de6['body'][_0x4935('0xa8')]});})[_0x4935('0x22')](function(_0x445218){_0x215de6[_0x4935('0x2a')]=_0x445218;if(_0x215de6[_0x4935('0xa0')][_0x4935('0xa9')]){return db[_0x4935('0x78')][_0x4935('0x5a')]({'attributes':['id',_0x4935('0x3b')],'where':{'id':_0x215de6[_0x4935('0xa0')][_0x4935('0xa9')]}})[_0x4935('0x22')](function(_0x3a3f21){if(_0x3a3f21){_0x215de6[_0x4935('0x84')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4935('0xaa'),'appdata':_0x3a3f21[_0x4935('0x3b')]+','+(_0x215de6[_0x4935('0x83')][_0x4935('0xab')]||0xa),'interval':_0x4935('0xa4')});}return respondWithRpcPromise(_0x4935('0xac'),_0x4935('0xad'),_0x215de6);});}return respondWithRpcPromise(_0x4935('0xac'),'startRouting',_0x215de6);})['then'](function(_0x4ec0bb){if(_0x4ec0bb){var _0x1e0387=0xc8;var _0xbdfff=_0x4935('0xae');logger['info'](_0x4935('0x25'),_0xbdfff,_0x1e0387,_0x4935('0xaf'));logger[_0x4935('0x24')](_0x4935('0xb0'),_0xbdfff,_0x1e0387,_0x4935('0xaf'),JSON[_0x4935('0x27')](_0x4ec0bb));if(_0x215de6[_0x4935('0x83')]['type']===_0x4935('0x8d')){return _0x1488f3[_0x4935('0x2e')](_0x1e0387)[_0x4935('0xb1')](_0x4935('0xb2'),'text/xml')[_0x4935('0xb3')]('\x0a');}else{return _0x1488f3[_0x4935('0x2e')](_0x1e0387)['json'](_0x4ec0bb);}}})[_0x4935('0x2d')](handleError(_0x1488f3,null));};exports[_0x4935('0xb3')]=function(_0x4d26cc,_0x21d58e,_0x1603a3){var _0x12b0be,_0x80f86f,_0x594ae5;if(_[_0x4935('0x93')](_0x4d26cc[_0x4935('0x62')][_0x4935('0x62')])||_0x4d26cc[_0x4935('0x62')]['body']===''){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))](_0x4935('0x96'));}if(_[_0x4935('0x93')](_0x4d26cc[_0x4935('0x62')]['to'])){throw new db[(_0x4935('0x95'))][(_0x4935('0x20'))]('to\x20is\x20mandatory');}_0x12b0be=_0x4d26cc[_0x4935('0x62')]['to'];return db[_0x4935('0x3f')]['find']({'where':{'id':_0x4d26cc[_0x4935('0x58')]['id']},'include':[{'model':db[_0x4935('0x9a')],'as':'List','include':[{'model':db[_0x4935('0x85')],'as':_0x4935('0x9d'),'where':{'mobile':_0x12b0be},'limit':0x1,'order':[[_0x4935('0x89'),'DESC']]}]}]})[_0x4935('0x22')](handleEntityNotFound(_0x21d58e,null))[_0x4935('0x22')](function(_0x3414ef){if(_0x3414ef&&_0x3414ef['List']){_0x80f86f=_0x3414ef[_0x4935('0x5f')]({'plain':!![]});if(_0x80f86f[_0x4935('0xb4')]&&_0x80f86f[_0x4935('0xb4')][_0x4935('0x9d')][_0x4935('0x69')]){return _0x80f86f[_0x4935('0xb4')][_0x4935('0x9d')][0x0];}return db[_0x4935('0x85')][_0x4935('0x5b')](_[_0x4935('0x17')](_0x4d26cc[_0x4935('0x62')],{'firstName':_0x12b0be,'mobile':_0x12b0be,'phone':_0x12b0be,'ListId':_0x80f86f['ListId']}));}})[_0x4935('0x22')](handleEntityNotFound(_0x21d58e,null))['then'](function(_0x1f705e){if(_0x1f705e){_0x594ae5=_0x1f705e;return db[_0x4935('0x9f')][_0x4935('0x5a')]({'where':{'ContactId':_0x594ae5['id'],'closed':![],'WhatsappAccountId':_0x80f86f['id']}})[_0x4935('0x22')](function(_0x1ed5c3){if(_0x1ed5c3){return[_0x1ed5c3,![]];}return db['WhatsappInteraction'][_0x4935('0x5b')]({'UserId':_0x4d26cc['user']['id'],'ContactId':_0x594ae5['id'],'WhatsappAccountId':_0x80f86f['id'],'phone':_0x12b0be,'firstMsgDirection':_0x4935('0xb5'),'Messages':[_[_0x4935('0x51')](_0x4d26cc[_0x4935('0x62')],{'read':![],'body':_0x4d26cc[_0x4935('0x62')][_0x4935('0x62')],'phone':_0x12b0be,'WhatsappAccountId':_0x80f86f['id'],'UserId':_0x4d26cc[_0x4935('0x5c')]['id'],'ContactId':_0x594ae5['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x4935('0xb6')}]})[_0x4935('0x22')](function(_0xb8fab5){return[_0xb8fab5,!![]];});});}})[_0x4935('0x73')](function(_0x5a6050,_0x16f8e2){if(_0x16f8e2){return _0x5a6050;}return db['WhatsappMessage']['create'](_[_0x4935('0x51')](_0x4d26cc['body'],{'read':![],'body':_0x4d26cc[_0x4935('0x62')][_0x4935('0x62')],'phone':_0x12b0be,'WhatsappAccountId':_0x80f86f['id'],'WhatsappInteractionId':_0x5a6050['id'],'UserId':_0x4d26cc[_0x4935('0x5c')]['id'],'ContactId':_0x594ae5['id']}))[_0x4935('0x22')](function(_0x37f9b6){_0x5a6050[_0x4935('0xb7')]['Messages']=[];_0x5a6050['dataValues'][_0x4935('0xb6')][_0x4935('0xa2')](_0x37f9b6['dataValues']);return _0x5a6050;});})[_0x4935('0x22')](respondWithResult(_0x21d58e,null))[_0x4935('0x2d')](handleError(_0x21d58e,null));}; \ No newline at end of file +var _0x593e=['created','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','entity\x20found','stringify','text/xml','send','\x0a','to\x20is\x20mandatory','DESC','List','ListId','WhatsappMessage','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.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~!@#$%^&-_=+[{]}.','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','result','status','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','name','Pause','mandatoryDispositionPause','map','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','filter','WhatsappAccount','includeAll','rows','catch','show','params','keys','include','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','find','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','order','pick','findAll','removeDispositions','addAnswer','CannedAnswer','ids','omit','spread','removeAgents','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','findAndCountAll','getApplications','notify','Applications','account','applications','orderBy','priority','asc','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','twilio','from','whatsapp:','Body','messageId','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','CmContact','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*'];(function(_0x1010c1,_0x51c95e){var _0x4283f8=function(_0xc94da2){while(--_0xc94da2){_0x1010c1['push'](_0x1010c1['shift']());}};_0x4283f8(++_0x51c95e);}(_0x593e,0xcb));var _0xe593=function(_0x20cc7a,_0x5b9b0f){_0x20cc7a=_0x20cc7a-0x0;var _0x227a63=_0x593e[_0x20cc7a];return _0x227a63;};'use strict';var pdf=require(_0xe593('0x0'));var emlformat=require(_0xe593('0x1'));var rimraf=require(_0xe593('0x2'));var zipdir=require(_0xe593('0x3'));var jsonpatch=require(_0xe593('0x4'));var rp=require(_0xe593('0x5'));var moment=require(_0xe593('0x6'));var BPromise=require(_0xe593('0x7'));var Mustache=require('mustache');var util=require(_0xe593('0x8'));var path=require(_0xe593('0x9'));var sox=require(_0xe593('0xa'));var csv=require(_0xe593('0xb'));var ejs=require(_0xe593('0xc'));var fs=require('fs');var _=require(_0xe593('0xd'));var squel=require(_0xe593('0xe'));var crypto=require(_0xe593('0xf'));var jsforce=require(_0xe593('0x10'));var deskjs=require(_0xe593('0x11'));var toCsv=require('to-csv');var querystring=require(_0xe593('0x12'));var Papa=require(_0xe593('0x13'));var Redis=require(_0xe593('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe593('0x15'));var hardwareService=require(_0xe593('0x16'));var logger=require(_0xe593('0x17'))('api');var utils=require(_0xe593('0x18'));var config=require(_0xe593('0x19'));var db=require(_0xe593('0x1a'))['db'];config[_0xe593('0x1b')]=_[_0xe593('0x1c')](config[_0xe593('0x1b')],{'host':_0xe593('0x1d'),'port':0x18eb});var socket=require(_0xe593('0x1e'))(new Redis(config[_0xe593('0x1b')]));require(_0xe593('0x1f'))['register'](socket);var jayson=require(_0xe593('0x20'));var client=jayson[_0xe593('0x21')]['http']({'port':0x232c});function checkPasswordPattern(_0x38418c,_0x44837b,_0x5d4c6a){if(_0x5d4c6a){var _0x2ae9b6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ae9b6[_0xe593('0x22')](_0x44837b)){return _0x38418c;}else{throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x25'));}}else{return _0x38418c;}}function respondWithRpcPromise(_0xb427f0,_0x48f3b4,_0xfbc79f,_0x470d07){return new BPromise(function(_0x5f57ce,_0xd1020e){var _0x28b5ed=_0x470d07||client;return _0x28b5ed['request'](_0xb427f0,_0xfbc79f)[_0xe593('0x26')](function(_0x3dba1b){logger[_0xe593('0x27')](_0xe593('0x28'),_0x48f3b4,_0xe593('0x29'));logger[_0xe593('0x2a')](_0xe593('0x2b'),_0x48f3b4,'request\x20sent',JSON['stringify'](_0x3dba1b));if(_0x3dba1b[_0xe593('0x2c')]){if(_0x3dba1b['error']['code']===0x1f4){logger[_0xe593('0x2c')](_0xe593('0x28'),_0x48f3b4,_0x3dba1b['error'][_0xe593('0x2d')]);return _0xd1020e(_0x3dba1b['error'][_0xe593('0x2d')]);}logger[_0xe593('0x2c')](_0xe593('0x28'),_0x48f3b4,_0x3dba1b[_0xe593('0x2c')][_0xe593('0x2d')]);return _0x5f57ce(_0x3dba1b[_0xe593('0x2c')][_0xe593('0x2d')]);}else{logger[_0xe593('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x48f3b4,_0xe593('0x29'));_0x5f57ce(_0x3dba1b[_0xe593('0x2e')]['message']);}})['catch'](function(_0xf8d492){logger[_0xe593('0x2c')](_0xe593('0x28'),_0x48f3b4,_0xf8d492);_0xd1020e(_0xf8d492);});});}function respondWithStatusCode(_0x43699d,_0x3b66bc){_0x3b66bc=_0x3b66bc||0xcc;return function(_0x27a3d2){if(_0x27a3d2){return _0x43699d['sendStatus'](_0x3b66bc);}return _0x43699d[_0xe593('0x2f')](_0x3b66bc)['end']();};}function respondWithResult(_0x1dacf6,_0xda61a7){_0xda61a7=_0xda61a7||0xc8;return function(_0x4a2eaa){if(_0x4a2eaa){return _0x1dacf6[_0xe593('0x2f')](_0xda61a7)['json'](_0x4a2eaa);}};}function respondWithFilteredResult(_0x44a68c,_0x1c147b){return function(_0x1618af){if(_0x1618af){var _0x501e54=_0x1618af[_0xe593('0x30')],_0x1ae8d9=_0x1c147b[_0xe593('0x31')],_0x13f44=_0x1c147b[_0xe593('0x31')]+_0x1c147b[_0xe593('0x32')],_0x3066ed;if(_0x13f44>=_0x501e54){_0x13f44=_0x501e54;_0x3066ed=0xc8;}else{_0x3066ed=0xce;}_0x44a68c['status'](_0x3066ed);return _0x44a68c[_0xe593('0x33')](_0xe593('0x34'),_0x1ae8d9+'-'+_0x13f44+'/'+_0x501e54)['json'](_0x1618af);}return null;};}function patchUpdates(_0xe5e728){return function(_0x571995){try{jsonpatch[_0xe593('0x35')](_0x571995,_0xe5e728,!![]);}catch(_0x32fd89){return BPromise[_0xe593('0x36')](_0x32fd89);}return _0x571995[_0xe593('0x37')]();};}function saveUpdates(_0x38d9f4,_0x24a560){return function(_0x40e1d3){if(_0x40e1d3){return _0x40e1d3[_0xe593('0x38')](_0x38d9f4)[_0xe593('0x26')](function(_0x4305de){return _0x4305de;});}return null;};}function removeEntity(_0x4d3fab,_0x27a563){return function(_0x2c0a30){if(_0x2c0a30){return _0x2c0a30[_0xe593('0x39')]()['then'](function(){var _0x4fefb3=_0x2c0a30[_0xe593('0x3a')]({'plain':!![]});var _0x5813bf=_0xe593('0x3b');return db[_0xe593('0x3c')][_0xe593('0x39')]({'where':{'type':_0x5813bf,'resourceId':_0x4fefb3['id']}})[_0xe593('0x26')](function(){return _0x2c0a30;});})[_0xe593('0x26')](function(){_0x4d3fab[_0xe593('0x2f')](0xcc)[_0xe593('0x3d')]();});}};}function handleEntityNotFound(_0x4889cc,_0x5112c1){return function(_0x8c6ea5){if(!_0x8c6ea5){_0x4889cc['sendStatus'](0x194);}return _0x8c6ea5;};}function handleError(_0x32bc16,_0x4877ad){_0x4877ad=_0x4877ad||0x1f4;return function(_0x206775){logger['error'](_0x206775['stack']);if(_0x206775[_0xe593('0x3e')]){delete _0x206775[_0xe593('0x3e')];}_0x32bc16[_0xe593('0x2f')](_0x4877ad)['send'](_0x206775);};}exports['index']=function(_0x5f11b9,_0x359285){var _0x584945={'include':[{'model':db[_0xe593('0x3f')],'as':_0xe593('0x40')}]},_0x37ba0e={},_0x3945af={'count':0x0,'rows':[]};var _0x50249e=_[_0xe593('0x41')](db['WhatsappAccount'][_0xe593('0x42')],function(_0x508a12){return{'name':_0x508a12['fieldName'],'type':_0x508a12['type'][_0xe593('0x43')]};});_0x37ba0e['model']=_[_0xe593('0x41')](_0x50249e,_0xe593('0x3e'));_0x37ba0e[_0xe593('0x44')]=_['keys'](_0x5f11b9[_0xe593('0x44')]);_0x37ba0e[_0xe593('0x45')]=_[_0xe593('0x46')](_0x37ba0e[_0xe593('0x47')],_0x37ba0e[_0xe593('0x44')]);_0x584945[_0xe593('0x48')]=_[_0xe593('0x46')](_0x37ba0e[_0xe593('0x47')],qs['fields'](_0x5f11b9[_0xe593('0x44')][_0xe593('0x49')]));_0x584945[_0xe593('0x48')]=_0x584945[_0xe593('0x48')][_0xe593('0x4a')]?_0x584945['attributes']:_0x37ba0e['model'];if(!_0x5f11b9[_0xe593('0x44')][_0xe593('0x4b')](_0xe593('0x4c'))){_0x584945['limit']=qs[_0xe593('0x32')](_0x5f11b9[_0xe593('0x44')]['limit']);_0x584945['offset']=qs[_0xe593('0x31')](_0x5f11b9[_0xe593('0x44')][_0xe593('0x31')]);}_0x584945['order']=qs[_0xe593('0x4d')](_0x5f11b9[_0xe593('0x44')][_0xe593('0x4d')]);_0x584945[_0xe593('0x4e')]=qs['filters'](_['pick'](_0x5f11b9['query'],_0x37ba0e['filters']),_0x50249e);if(_0x5f11b9[_0xe593('0x44')]['filter']){_0x584945[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0x584945[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0x50249e,function(_0xe96f5e){if(_0xe96f5e[_0xe593('0x50')]!==_0xe593('0x51')){var _0x297c3e={};_0x297c3e[_0xe96f5e['name']]={'$like':'%'+_0x5f11b9[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x297c3e;}})});}_0x584945=_[_0xe593('0x4f')]({},_0x584945,_0x5f11b9['options']);var _0x2d0113={'where':_0x584945['where']};return db[_0xe593('0x53')][_0xe593('0x30')](_0x2d0113)[_0xe593('0x26')](function(_0x55da3d){_0x3945af['count']=_0x55da3d;if(_0x5f11b9[_0xe593('0x44')][_0xe593('0x54')]){_0x584945['include']=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x584945);})['then'](function(_0x5a7385){_0x3945af[_0xe593('0x55')]=_0x5a7385;return _0x3945af;})[_0xe593('0x26')](respondWithFilteredResult(_0x359285,_0x584945))[_0xe593('0x56')](handleError(_0x359285,null));};exports[_0xe593('0x57')]=function(_0x42ec06,_0x44201e){var _0x973821={'raw':![],'where':{'id':_0x42ec06[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x3f')],'as':_0xe593('0x40')}]},_0x46410d={};_0x46410d[_0xe593('0x47')]=_[_0xe593('0x59')](db[_0xe593('0x53')][_0xe593('0x42')]);_0x46410d[_0xe593('0x44')]=_['keys'](_0x42ec06[_0xe593('0x44')]);_0x46410d[_0xe593('0x45')]=_[_0xe593('0x46')](_0x46410d[_0xe593('0x47')],_0x46410d[_0xe593('0x44')]);_0x973821[_0xe593('0x48')]=_[_0xe593('0x46')](_0x46410d[_0xe593('0x47')],qs[_0xe593('0x49')](_0x42ec06[_0xe593('0x44')][_0xe593('0x49')]));_0x973821[_0xe593('0x48')]=_0x973821[_0xe593('0x48')][_0xe593('0x4a')]?_0x973821[_0xe593('0x48')]:_0x46410d['model'];if(_0x42ec06[_0xe593('0x44')][_0xe593('0x54')]){_0x973821[_0xe593('0x5a')]=[{'all':!![]}];}_0x973821=_[_0xe593('0x4f')]({},_0x973821,_0x42ec06[_0xe593('0x5b')]);return db['WhatsappAccount']['find'](_0x973821)[_0xe593('0x26')](handleEntityNotFound(_0x44201e,null))[_0xe593('0x26')](respondWithResult(_0x44201e,null))[_0xe593('0x56')](handleError(_0x44201e,null));};exports[_0xe593('0x5c')]=function(_0x1b5643,_0x1e49ed){return db[_0xe593('0x53')]['create'](_0x1b5643['body'],{})[_0xe593('0x26')](function(_0x23ee3b){var _0x4ff51d=_0x1b5643[_0xe593('0x5d')][_0xe593('0x3a')]({'plain':!![]});if(!_0x4ff51d)throw new Error(_0xe593('0x5e'));if(_0x4ff51d[_0xe593('0x5f')]===_0xe593('0x5d')){var _0x2a38fc=_0x23ee3b[_0xe593('0x3a')]({'plain':!![]});var _0x3b8b19=_0xe593('0x3b');return db[_0xe593('0x60')]['find']({'where':{'name':_0x3b8b19,'userProfileId':_0x4ff51d[_0xe593('0x61')]},'raw':!![]})[_0xe593('0x26')](function(_0x390b95){if(_0x390b95&&_0x390b95[_0xe593('0x62')]===0x0){return db[_0xe593('0x3c')][_0xe593('0x5c')]({'name':_0x2a38fc[_0xe593('0x3e')],'resourceId':_0x2a38fc['id'],'type':_0x390b95['name'],'sectionId':_0x390b95['id']},{})[_0xe593('0x26')](function(){return _0x23ee3b;});}else{return _0x23ee3b;}})[_0xe593('0x56')](function(_0x434ce2){logger[_0xe593('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x434ce2);throw _0x434ce2;});}return _0x23ee3b;})[_0xe593('0x26')](respondWithResult(_0x1e49ed,0xc9))[_0xe593('0x56')](handleError(_0x1e49ed,null));};exports[_0xe593('0x38')]=function(_0x34c669,_0x377137){if(_0x34c669['body']['id']){delete _0x34c669[_0xe593('0x63')]['id'];}return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x34c669[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x3f')],'as':_0xe593('0x40')}]})[_0xe593('0x26')](handleEntityNotFound(_0x377137,null))[_0xe593('0x26')](saveUpdates(_0x34c669['body'],null))[_0xe593('0x26')](respondWithResult(_0x377137,null))[_0xe593('0x56')](handleError(_0x377137,null));};exports[_0xe593('0x39')]=function(_0x100acd,_0x42edd2){return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x100acd[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x42edd2,null))[_0xe593('0x26')](removeEntity(_0x42edd2,null))['catch'](handleError(_0x42edd2,null));};exports[_0xe593('0x65')]=function(_0x42714a,_0x339a5e){return db['WhatsappAccount'][_0xe593('0x65')]()[_0xe593('0x26')](respondWithResult(_0x339a5e,null))[_0xe593('0x56')](handleError(_0x339a5e,null));};exports[_0xe593('0x66')]=function(_0x27c931,_0x5e263c,_0x17a1bc){if(_0x27c931[_0xe593('0x63')]['id']){delete _0x27c931['body']['id'];}return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x27c931[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x5e263c,null))['then'](function(_0x15f47c){if(_0x15f47c){_0x27c931[_0xe593('0x63')][_0xe593('0x67')]=_0x15f47c['id'];return db['Disposition'][_0xe593('0x5c')](_0x27c931[_0xe593('0x63')]);}})[_0xe593('0x26')](respondWithResult(_0x5e263c,null))['catch'](handleError(_0x5e263c,null));};exports[_0xe593('0x68')]=function(_0x11eae2,_0x346b0f,_0x52766f){var _0xe89d7e={'raw':![],'where':{}};var _0x4d9dba={};var _0x2f81d2={'count':0x0,'rows':[]};return db[_0xe593('0x53')][_0xe593('0x69')]({'where':{'id':_0x11eae2[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x346b0f,null))[_0xe593('0x26')](function(_0x285df9){if(_0x285df9){_0x4d9dba[_0xe593('0x47')]=_[_0xe593('0x59')](db[_0xe593('0x6a')][_0xe593('0x42')]);_0x4d9dba[_0xe593('0x44')]=_[_0xe593('0x59')](_0x11eae2[_0xe593('0x44')]);_0x4d9dba['filters']=_[_0xe593('0x46')](_0x4d9dba[_0xe593('0x47')],_0x4d9dba[_0xe593('0x44')]);_0xe89d7e[_0xe593('0x48')]=_[_0xe593('0x46')](_0x4d9dba[_0xe593('0x47')],qs[_0xe593('0x49')](_0x11eae2[_0xe593('0x44')]['fields']));_0xe89d7e['attributes']=_0xe89d7e['attributes'][_0xe593('0x4a')]?_0xe89d7e[_0xe593('0x48')]:_0x4d9dba[_0xe593('0x47')];if(!_0x11eae2['query']['hasOwnProperty'](_0xe593('0x4c'))){_0xe89d7e['limit']=qs[_0xe593('0x32')](_0x11eae2[_0xe593('0x44')][_0xe593('0x32')]);_0xe89d7e['offset']=qs[_0xe593('0x31')](_0x11eae2[_0xe593('0x44')][_0xe593('0x31')]);}_0xe89d7e[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x11eae2[_0xe593('0x44')][_0xe593('0x4d')]);_0xe89d7e['where']=qs[_0xe593('0x45')](_[_0xe593('0x6c')](_0x11eae2['query'],_0x4d9dba[_0xe593('0x45')]));_0xe89d7e[_0xe593('0x4e')][_0xe593('0x67')]=_0x285df9['id'];if(_0x11eae2['query'][_0xe593('0x52')]){_0xe89d7e[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0xe89d7e[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0xe89d7e[_0xe593('0x48')],function(_0x4c16d0){var _0x56fd23={};_0x56fd23[_0x4c16d0]={'$like':'%'+_0x11eae2[_0xe593('0x44')]['filter']+'%'};return _0x56fd23;})});}_0xe89d7e=_['merge']({},_0xe89d7e,_0x11eae2['options']);return db[_0xe593('0x6a')][_0xe593('0x30')]({'where':_0xe89d7e[_0xe593('0x4e')]})[_0xe593('0x26')](function(_0xa07dbb){_0x2f81d2['count']=_0xa07dbb;if(_0x11eae2['query'][_0xe593('0x54')]){_0xe89d7e[_0xe593('0x5a')]=[{'all':!![]}];}return db[_0xe593('0x6a')][_0xe593('0x6d')](_0xe89d7e);})['then'](function(_0x20574a){_0x2f81d2[_0xe593('0x55')]=_0x20574a;return _0x2f81d2;});}})[_0xe593('0x26')](respondWithFilteredResult(_0x346b0f,_0xe89d7e))['catch'](handleError(_0x346b0f,null));};exports[_0xe593('0x6e')]=function(_0x454479,_0x4dd704,_0xc0904c){return db[_0xe593('0x53')]['find']({'where':{'id':_0x454479['params']['id']}})['then'](handleEntityNotFound(_0x4dd704,null))['then'](function(_0x552869){if(_0x552869){return _0x552869['removeDispositions'](_0x454479[_0xe593('0x44')]['ids']);}})[_0xe593('0x26')](respondWithStatusCode(_0x4dd704,null))[_0xe593('0x56')](handleError(_0x4dd704,null));};exports[_0xe593('0x6f')]=function(_0x57683e,_0x47ac27,_0x2efa5a){if(_0x57683e[_0xe593('0x63')]['id']){delete _0x57683e[_0xe593('0x63')]['id'];}return db[_0xe593('0x53')]['find']({'where':{'id':_0x57683e['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x47ac27,null))[_0xe593('0x26')](function(_0x5127da){if(_0x5127da){_0x57683e[_0xe593('0x63')][_0xe593('0x67')]=_0x5127da['id'];return db[_0xe593('0x70')][_0xe593('0x5c')](_0x57683e[_0xe593('0x63')]);}})['then'](respondWithResult(_0x47ac27,null))[_0xe593('0x56')](handleError(_0x47ac27,null));};exports['getAnswers']=function(_0x27bf6c,_0x5d4e7f,_0x36762a){var _0x509e82={'raw':![],'where':{}};var _0x50ab4d={};var _0x265fee={'count':0x0,'rows':[]};return db[_0xe593('0x53')][_0xe593('0x69')]({'where':{'id':_0x27bf6c['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x5d4e7f,null))[_0xe593('0x26')](function(_0x1462f8){if(_0x1462f8){_0x50ab4d['model']=_[_0xe593('0x59')](db['CannedAnswer'][_0xe593('0x42')]);_0x50ab4d[_0xe593('0x44')]=_['keys'](_0x27bf6c[_0xe593('0x44')]);_0x50ab4d[_0xe593('0x45')]=_[_0xe593('0x46')](_0x50ab4d['model'],_0x50ab4d['query']);_0x509e82[_0xe593('0x48')]=_['intersection'](_0x50ab4d[_0xe593('0x47')],qs[_0xe593('0x49')](_0x27bf6c['query']['fields']));_0x509e82[_0xe593('0x48')]=_0x509e82[_0xe593('0x48')][_0xe593('0x4a')]?_0x509e82['attributes']:_0x50ab4d[_0xe593('0x47')];if(!_0x27bf6c[_0xe593('0x44')][_0xe593('0x4b')](_0xe593('0x4c'))){_0x509e82[_0xe593('0x32')]=qs[_0xe593('0x32')](_0x27bf6c['query'][_0xe593('0x32')]);_0x509e82[_0xe593('0x31')]=qs[_0xe593('0x31')](_0x27bf6c[_0xe593('0x44')][_0xe593('0x31')]);}_0x509e82[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x27bf6c['query'][_0xe593('0x4d')]);_0x509e82[_0xe593('0x4e')]=qs[_0xe593('0x45')](_['pick'](_0x27bf6c['query'],_0x50ab4d['filters']));_0x509e82[_0xe593('0x4e')][_0xe593('0x67')]=_0x1462f8['id'];if(_0x27bf6c['query'][_0xe593('0x52')]){_0x509e82[_0xe593('0x4e')]=_['merge'](_0x509e82[_0xe593('0x4e')],{'$or':_['map'](_0x509e82['attributes'],function(_0x28470c){var _0x427472={};_0x427472[_0x28470c]={'$like':'%'+_0x27bf6c[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x427472;})});}_0x509e82=_[_0xe593('0x4f')]({},_0x509e82,_0x27bf6c['options']);return db[_0xe593('0x70')][_0xe593('0x30')]({'where':_0x509e82['where']})[_0xe593('0x26')](function(_0x477b5b){_0x265fee[_0xe593('0x30')]=_0x477b5b;if(_0x27bf6c[_0xe593('0x44')][_0xe593('0x54')]){_0x509e82[_0xe593('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe593('0x6d')](_0x509e82);})[_0xe593('0x26')](function(_0x10d10a){_0x265fee[_0xe593('0x55')]=_0x10d10a;return _0x265fee;});}})[_0xe593('0x26')](respondWithFilteredResult(_0x5d4e7f,_0x509e82))[_0xe593('0x56')](handleError(_0x5d4e7f,null));};exports['removeAnswers']=function(_0xed392c,_0x28963c,_0x4b31c8){return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0xed392c['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x28963c,null))['then'](function(_0x496e63){if(_0x496e63){return _0x496e63['removeAnswers'](_0xed392c[_0xe593('0x44')]['ids']);}})[_0xe593('0x26')](respondWithStatusCode(_0x28963c,null))[_0xe593('0x56')](handleError(_0x28963c,null));};exports['addAgents']=function(_0x3e7bd4,_0x19fd51,_0x3a2a3a){return db[_0xe593('0x53')]['find']({'where':{'id':_0x3e7bd4['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x19fd51,null))['then'](function(_0x4675f8){if(_0x4675f8){return _0x4675f8['addAgents'](_0x3e7bd4[_0xe593('0x63')][_0xe593('0x71')],_[_0xe593('0x72')](_0x3e7bd4[_0xe593('0x63')],[_0xe593('0x71'),'id'])||{})[_0xe593('0x73')](function(_0x53f8fa){for(var _0xb029b1=0x0;_0xb029b1<_0x3e7bd4[_0xe593('0x63')]['ids'][_0xe593('0x4a')];_0xb029b1+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x3e7bd4[_0xe593('0x63')][_0xe593('0x71')][_0xb029b1],'WhatsappAccountId':_0x3e7bd4[_0xe593('0x58')]['id']});}return _0x53f8fa;});}})[_0xe593('0x26')](respondWithResult(_0x19fd51,null))[_0xe593('0x56')](handleError(_0x19fd51,null));};exports[_0xe593('0x74')]=function(_0x23e40c,_0x14727f,_0x283ae8){return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x23e40c['params']['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x14727f,null))['then'](function(_0x55df1f){if(_0x55df1f){return _0x55df1f[_0xe593('0x74')](_0x23e40c[_0xe593('0x44')][_0xe593('0x71')])['then'](function(){if(_['isArray'](_0x23e40c[_0xe593('0x44')][_0xe593('0x71')])){for(var _0xe0a60a=0x0;_0xe0a60a<_0x23e40c[_0xe593('0x44')]['ids'][_0xe593('0x4a')];_0xe0a60a+=0x1){socket[_0xe593('0x75')](_0xe593('0x76'),{'UserId':Number(_0x23e40c[_0xe593('0x44')][_0xe593('0x71')][_0xe0a60a]),'WhatsappAccountId':Number(_0x23e40c[_0xe593('0x58')]['id'])});}}else{socket[_0xe593('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x23e40c[_0xe593('0x44')][_0xe593('0x71')]),'WhatsappAccountId':Number(_0x23e40c[_0xe593('0x58')]['id'])});}});}})[_0xe593('0x26')](respondWithStatusCode(_0x14727f,null))[_0xe593('0x56')](handleError(_0x14727f,null));};exports[_0xe593('0x77')]=function(_0x38d755,_0x132a51,_0x140e7e){var _0x2a55ea={};var _0x38b776={};var _0x5b74d2;var _0x4a933d;return db[_0xe593('0x53')][_0xe593('0x69')]({'where':{'id':_0x38d755[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x132a51,null))[_0xe593('0x26')](function(_0xce5ca6){if(_0xce5ca6){_0x5b74d2=_0xce5ca6;_0x38b776['model']=_['keys'](db[_0xe593('0x78')][_0xe593('0x42')]);_0x38b776[_0xe593('0x44')]=_[_0xe593('0x59')](_0x38d755['query']);_0x38b776['filters']=_[_0xe593('0x46')](_0x38b776[_0xe593('0x47')],_0x38b776[_0xe593('0x44')]);_0x2a55ea[_0xe593('0x48')]=_['intersection'](_0x38b776[_0xe593('0x47')],qs[_0xe593('0x49')](_0x38d755[_0xe593('0x44')][_0xe593('0x49')]));_0x2a55ea[_0xe593('0x48')]=_0x2a55ea['attributes'][_0xe593('0x4a')]?_0x2a55ea[_0xe593('0x48')]:_0x38b776['model'];_0x2a55ea[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x38d755['query'][_0xe593('0x4d')]);_0x2a55ea[_0xe593('0x4e')]=qs['filters'](_[_0xe593('0x6c')](_0x38d755[_0xe593('0x44')],_0x38b776['filters']));if(_0x38d755[_0xe593('0x44')][_0xe593('0x52')]){_0x2a55ea[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0x2a55ea[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0x2a55ea['attributes'],function(_0x1e499e){var _0x254927={};_0x254927[_0x1e499e]={'$like':'%'+_0x38d755[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x254927;})});}_0x2a55ea=_[_0xe593('0x4f')]({},_0x2a55ea,_0x38d755[_0xe593('0x5b')]);return _0x5b74d2[_0xe593('0x77')](_0x2a55ea);}})[_0xe593('0x26')](function(_0x53aab1){if(_0x53aab1){_0x4a933d=_0x53aab1['length'];if(!_0x38d755['query'][_0xe593('0x4b')]('nolimit')){_0x2a55ea[_0xe593('0x32')]=qs[_0xe593('0x32')](_0x38d755[_0xe593('0x44')][_0xe593('0x32')]);_0x2a55ea[_0xe593('0x31')]=qs[_0xe593('0x31')](_0x38d755[_0xe593('0x44')][_0xe593('0x31')]);}return _0x5b74d2[_0xe593('0x77')](_0x2a55ea);}})[_0xe593('0x26')](function(_0x2a11d0){if(_0x2a11d0){return _0x2a11d0?{'count':_0x4a933d,'rows':_0x2a11d0}:null;}})[_0xe593('0x26')](respondWithResult(_0x132a51,null))['catch'](handleError(_0x132a51,null));};exports[_0xe593('0x79')]=function(_0x539d6e,_0xb14ef0,_0x148e1e){return db[_0xe593('0x53')]['findOne']({'where':{'id':_0x539d6e[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0xb14ef0,null))[_0xe593('0x26')](function(_0x324c26){if(_0x324c26){return db[_0xe593('0x7a')][_0xe593('0x7b')](function(_0x2ca3d6){return db['WhatsappApplication'][_0xe593('0x39')]({'where':{'WhatsappAccountId':_0x539d6e[_0xe593('0x58')]['id']},'transaction':_0x2ca3d6})[_0xe593('0x26')](function(_0x240e1b){var _0x465f83=_[_0xe593('0x41')](_0x539d6e['body'],function(_0xbb34ba){_0xbb34ba[_0xe593('0x67')]=_0x539d6e[_0xe593('0x58')]['id'];return _0xbb34ba;});return db[_0xe593('0x7c')]['bulkCreate'](_0x465f83,{'transaction':_0x2ca3d6});});})[_0xe593('0x26')](function(){return db['WhatsappApplication'][_0xe593('0x7d')]({'where':{'WhatsappAccountId':_0x539d6e['params']['id']},'order':'priority'});});}})[_0xe593('0x26')](respondWithResult(_0xb14ef0,null))[_0xe593('0x56')](handleError(_0xb14ef0,null));};exports[_0xe593('0x7e')]=function(_0x62cd5f,_0x35b210,_0x5e4170){var _0x450e13={};var _0x1a01c5={};var _0x273404;var _0x34b888;return db['WhatsappAccount'][_0xe593('0x69')]({'where':{'id':_0x62cd5f[_0xe593('0x58')]['id']}})[_0xe593('0x26')](handleEntityNotFound(_0x35b210,null))['then'](function(_0x1f5be5){if(_0x1f5be5){_0x273404=_0x1f5be5;_0x1a01c5['model']=_[_0xe593('0x59')](db['WhatsappApplication'][_0xe593('0x42')]);_0x1a01c5[_0xe593('0x44')]=_[_0xe593('0x59')](_0x62cd5f[_0xe593('0x44')]);_0x1a01c5[_0xe593('0x45')]=_[_0xe593('0x46')](_0x1a01c5[_0xe593('0x47')],_0x1a01c5[_0xe593('0x44')]);_0x450e13[_0xe593('0x48')]=_[_0xe593('0x46')](_0x1a01c5[_0xe593('0x47')],qs[_0xe593('0x49')](_0x62cd5f[_0xe593('0x44')][_0xe593('0x49')]));_0x450e13[_0xe593('0x48')]=_0x450e13[_0xe593('0x48')][_0xe593('0x4a')]?_0x450e13['attributes']:_0x1a01c5[_0xe593('0x47')];_0x450e13[_0xe593('0x6b')]=qs[_0xe593('0x4d')](_0x62cd5f[_0xe593('0x44')][_0xe593('0x4d')]);_0x450e13[_0xe593('0x4e')]=qs['filters'](_[_0xe593('0x6c')](_0x62cd5f['query'],_0x1a01c5[_0xe593('0x45')]));if(_0x62cd5f['query']['filter']){_0x450e13[_0xe593('0x4e')]=_[_0xe593('0x4f')](_0x450e13[_0xe593('0x4e')],{'$or':_[_0xe593('0x41')](_0x450e13[_0xe593('0x48')],function(_0x5555e9){var _0x18b2a6={};_0x18b2a6[_0x5555e9]={'$like':'%'+_0x62cd5f[_0xe593('0x44')][_0xe593('0x52')]+'%'};return _0x18b2a6;})});}_0x450e13=_['merge']({},_0x450e13,_0x62cd5f[_0xe593('0x5b')]);return _0x273404[_0xe593('0x7e')](_0x450e13);}})[_0xe593('0x26')](function(_0x419e9a){if(_0x419e9a){_0x34b888=_0x419e9a[_0xe593('0x4a')];if(!_0x62cd5f[_0xe593('0x44')][_0xe593('0x4b')](_0xe593('0x4c'))){_0x450e13[_0xe593('0x32')]=qs[_0xe593('0x32')](_0x62cd5f['query'][_0xe593('0x32')]);_0x450e13[_0xe593('0x31')]=qs[_0xe593('0x31')](_0x62cd5f[_0xe593('0x44')][_0xe593('0x31')]);}return _0x273404[_0xe593('0x7e')](_0x450e13);}})[_0xe593('0x26')](function(_0x2cb744){if(_0x2cb744){return _0x2cb744?{'count':_0x34b888,'rows':_0x2cb744}:null;}})['then'](respondWithResult(_0x35b210,null))[_0xe593('0x56')](handleError(_0x35b210,null));};exports[_0xe593('0x7f')]=function(_0x381cc3,_0x46bef8,_0x1a064a){var _0x269d70={'channel':'whatsapp'};var _0x83f8ff=[];var _0x8ac78c=[];var _0x352ad3={};return db[_0xe593('0x53')]['find']({'where':{'id':_0x381cc3[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x7c')],'as':_0xe593('0x80')}]})['then'](handleEntityNotFound(_0x46bef8,null))[_0xe593('0x26')](function(_0x411b32){_0x269d70[_0xe593('0x81')]=_0x411b32;_0x269d70[_0xe593('0x82')]=_[_0xe593('0x83')](_0x411b32[_0xe593('0x80')],[_0xe593('0x84')],[_0xe593('0x85')]);if(_0x269d70['account'][_0xe593('0x80')]){delete _0x269d70[_0xe593('0x81')]['Applications'];}return db['CmContact'][_0xe593('0x65')]();})[_0xe593('0x26')](function(_0x5b1240){if(!_0x5b1240){throw new db['Sequelize'][(_0xe593('0x24'))](_0xe593('0x86'));}_0x83f8ff=_[_0xe593('0x87')](_[_0xe593('0x59')](_0x5b1240),[_0xe593('0x88'),_0xe593('0x89')]);_0x8ac78c=_[_0xe593('0x87')](_[_0xe593('0x59')](_0x5b1240),[_0xe593('0x88'),_0xe593('0x89'),_0xe593('0x8a'),'ListId']);_0x269d70[_0xe593('0x63')]={'mapKey':'mobile'};if(_0x269d70[_0xe593('0x81')][_0xe593('0x50')]&&_0x269d70[_0xe593('0x81')][_0xe593('0x50')]===_0xe593('0x8b')){_0x269d70[_0xe593('0x63')][_0xe593('0x8c')]=_0x381cc3[_0xe593('0x63')]['From']['replace'](_0xe593('0x8d'),'');_0x269d70[_0xe593('0x63')][_0xe593('0x63')]=_0x381cc3[_0xe593('0x63')][_0xe593('0x8e')];_0x269d70[_0xe593('0x63')][_0xe593('0x8f')]=_0x381cc3[_0xe593('0x63')][_0xe593('0x90')];}if(_0x269d70['body']['id']){delete _0x269d70[_0xe593('0x63')]['id'];}if(_[_0xe593('0x91')](_0x269d70['body'][_0xe593('0x8c')])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x92'));}if(_['isNil'](_0x269d70['body'][_0xe593('0x63')])||_0x269d70['body'][_0xe593('0x63')]===''){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x93'));}if(_[_0xe593('0x91')](_0x269d70[_0xe593('0x63')][_0xe593('0x94')])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x95')+_0x8ac78c);}if(!_['includes'](_0x8ac78c,_0x269d70[_0xe593('0x63')]['mapKey'])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0x96')+_0x8ac78c);}_0x352ad3[_0x269d70[_0xe593('0x63')][_0xe593('0x94')]]=_0x269d70[_0xe593('0x63')][_0xe593('0x8c')];return db[_0xe593('0x97')][_0xe593('0x64')]({'where':{'id':_0x269d70['account']['ListId']},'include':[{'model':db['CmContact'],'as':_0xe593('0x98'),'where':_0x352ad3,'limit':0x1,'order':[[_0xe593('0x89'),'DESC']]}]});})[_0xe593('0x26')](handleEntityNotFound(_0x46bef8,null))[_0xe593('0x26')](function(_0x428b30){if(_0x428b30){_0x269d70[_0xe593('0x99')]=_['omit'](_0x428b30,[_0xe593('0x98')]);if(_0x428b30[_0xe593('0x98')]['length']){return _0x428b30[_0xe593('0x98')][0x0];}var _0x30e775=_[_0xe593('0x1c')](_0x269d70[_0xe593('0x63')],{'firstName':_0x269d70[_0xe593('0x63')][_0xe593('0x8c')],'ListId':_0x428b30['id']});_0x30e775[_0x269d70[_0xe593('0x63')][_0xe593('0x94')]]=_0x269d70[_0xe593('0x63')][_0xe593('0x8c')];return db[_0xe593('0x9a')][_0xe593('0x5c')](_0x30e775,{'fields':_0x83f8ff,'raw':!![]});}})[_0xe593('0x26')](handleEntityNotFound(_0x46bef8,null))[_0xe593('0x26')](function(_0x486178){if(_0x486178){_0x269d70[_0xe593('0x9b')]=_0x486178;var _0x7e0d1f={'ContactId':_0x486178['id'],'phone':_0x269d70[_0xe593('0x63')][_0xe593('0x8c')],'WhatsappAccountId':_0x381cc3[_0xe593('0x58')]['id']};var _0x2c7e0a={'ContactId':_0x486178['id'],'WhatsappAccountId':_0x381cc3[_0xe593('0x58')]['id'],'closed':![]};return db[_0xe593('0x9c')][_0xe593('0x64')]({'where':_0x2c7e0a})[_0xe593('0x26')](function(_0x526fbf){if(_0x526fbf){return[_0x526fbf,![]];}return db[_0xe593('0x9c')][_0xe593('0x5c')](_0x7e0d1f)[_0xe593('0x26')](function(_0xc1e03b){return[_0xc1e03b,!![]];});});}})['spread'](function(_0x3561d6,_0x44b1b1){_0x269d70[_0xe593('0x9d')]=_0x3561d6['get']({'plain':!![]});_0x269d70['interaction']['created']=![];if(_0x44b1b1){if(_0x269d70[_0xe593('0x81')][_0xe593('0x9e')]){_0x269d70[_0xe593('0x82')][_0xe593('0x9f')]({'id':0x0,'priority':_0x269d70[_0xe593('0x82')][_0xe593('0x4a')]+0x1,'app':_0xe593('0xa0'),'appdata':_0xe593('0xa1'),'interval':_0xe593('0xa2')});}_0x269d70['interaction'][_0xe593('0xa3')]=!![];}return db['WhatsappMessage'][_0xe593('0x5c')]({'phone':_0x269d70['body'][_0xe593('0x8c')],'messageId':_0x269d70['body'][_0xe593('0x8f')],'body':_0x269d70[_0xe593('0x63')][_0xe593('0x63')],'WhatsappAccountId':_0x381cc3[_0xe593('0x58')]['id'],'WhatsappInteractionId':_0x3561d6['id'],'direction':'in','ContactId':_0x3561d6[_0xe593('0xa4')],'AttachmentId':_0x269d70[_0xe593('0x63')][_0xe593('0xa5')]});})[_0xe593('0x26')](function(_0x589731){_0x269d70['message']=_0x589731;if(_0x269d70['interaction'][_0xe593('0xa6')]){return db[_0xe593('0x78')][_0xe593('0x64')]({'attributes':['id',_0xe593('0x3e')],'where':{'id':_0x269d70[_0xe593('0x9d')][_0xe593('0xa6')]}})[_0xe593('0x26')](function(_0x43e223){if(_0x43e223){_0x269d70['applications'][_0xe593('0xa7')]({'id':0x0,'priority':0x0,'app':_0xe593('0xa8'),'appdata':_0x43e223[_0xe593('0x3e')]+','+(_0x269d70[_0xe593('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0xe593('0xa2')});}return respondWithRpcPromise(_0xe593('0xa9'),'startRouting',_0x269d70);});}return respondWithRpcPromise(_0xe593('0xa9'),_0xe593('0xaa'),_0x269d70);})[_0xe593('0x26')](function(_0x4a4b53){if(_0x4a4b53){var _0x4f2e0f=0xc8;var _0x350054='receiveMessage';logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x350054,_0x4f2e0f,'entity\x20found');logger[_0xe593('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x350054,_0x4f2e0f,_0xe593('0xab'),JSON[_0xe593('0xac')](_0x4a4b53));if(_0x269d70['account'][_0xe593('0x50')]===_0xe593('0x8b')){return _0x46bef8['status'](_0x4f2e0f)[_0xe593('0x33')]('Content-Type',_0xe593('0xad'))[_0xe593('0xae')](_0xe593('0xaf'));}else{return _0x46bef8[_0xe593('0x2f')](_0x4f2e0f)['json'](_0x4a4b53);}}})[_0xe593('0x56')](handleError(_0x46bef8,null));};exports[_0xe593('0xae')]=function(_0x46cfc6,_0x3afb57,_0x376ad1){var _0xd82998,_0x3e38a1,_0x1780da;if(_[_0xe593('0x91')](_0x46cfc6[_0xe593('0x63')][_0xe593('0x63')])||_0x46cfc6[_0xe593('0x63')][_0xe593('0x63')]===''){throw new db[(_0xe593('0x23'))]['ValidationError'](_0xe593('0x93'));}if(_[_0xe593('0x91')](_0x46cfc6[_0xe593('0x63')]['to'])){throw new db[(_0xe593('0x23'))][(_0xe593('0x24'))](_0xe593('0xb0'));}_0xd82998=_0x46cfc6[_0xe593('0x63')]['to'];return db[_0xe593('0x53')][_0xe593('0x64')]({'where':{'id':_0x46cfc6[_0xe593('0x58')]['id']},'include':[{'model':db[_0xe593('0x97')],'as':'List','include':[{'model':db[_0xe593('0x9a')],'as':_0xe593('0x98'),'where':{'mobile':_0xd82998},'limit':0x1,'order':[[_0xe593('0x89'),_0xe593('0xb1')]]}]}]})[_0xe593('0x26')](handleEntityNotFound(_0x3afb57,null))['then'](function(_0x592468){if(_0x592468&&_0x592468['List']){_0x3e38a1=_0x592468['get']({'plain':!![]});if(_0x3e38a1[_0xe593('0xb2')]&&_0x3e38a1[_0xe593('0xb2')][_0xe593('0x98')][_0xe593('0x4a')]){return _0x3e38a1['List'][_0xe593('0x98')][0x0];}return db[_0xe593('0x9a')][_0xe593('0x5c')](_[_0xe593('0x1c')](_0x46cfc6[_0xe593('0x63')],{'firstName':_0xd82998,'mobile':_0xd82998,'phone':_0xd82998,'ListId':_0x3e38a1[_0xe593('0xb3')]}));}})[_0xe593('0x26')](handleEntityNotFound(_0x3afb57,null))['then'](function(_0x2c8e58){if(_0x2c8e58){_0x1780da=_0x2c8e58;return db[_0xe593('0x9c')][_0xe593('0x64')]({'where':{'ContactId':_0x1780da['id'],'closed':![],'WhatsappAccountId':_0x3e38a1['id']}})['then'](function(_0x4a51f6){if(_0x4a51f6){return[_0x4a51f6,![]];}return db[_0xe593('0x9c')][_0xe593('0x5c')]({'UserId':_0x46cfc6['user']['id'],'ContactId':_0x1780da['id'],'WhatsappAccountId':_0x3e38a1['id'],'phone':_0xd82998,'firstMsgDirection':'out','Messages':[_[_0xe593('0x4f')](_0x46cfc6[_0xe593('0x63')],{'read':![],'body':_0x46cfc6['body'][_0xe593('0x63')],'phone':_0xd82998,'WhatsappAccountId':_0x3e38a1['id'],'UserId':_0x46cfc6[_0xe593('0x5d')]['id'],'ContactId':_0x1780da['id']})]},{'include':[{'model':db[_0xe593('0xb4')],'as':_0xe593('0xb5')}]})['then'](function(_0x1215d1){return[_0x1215d1,!![]];});});}})['spread'](function(_0x5ddcb8,_0x31838b){if(_0x31838b){return _0x5ddcb8;}return db[_0xe593('0xb4')]['create'](_['merge'](_0x46cfc6[_0xe593('0x63')],{'read':![],'body':_0x46cfc6['body'][_0xe593('0x63')],'phone':_0xd82998,'WhatsappAccountId':_0x3e38a1['id'],'WhatsappInteractionId':_0x5ddcb8['id'],'UserId':_0x46cfc6[_0xe593('0x5d')]['id'],'ContactId':_0x1780da['id']}))['then'](function(_0x2c9e3d){_0x5ddcb8[_0xe593('0xb6')]['Messages']=[];_0x5ddcb8['dataValues'][_0xe593('0xb5')][_0xe593('0x9f')](_0x2c9e3d[_0xe593('0xb6')]);return _0x5ddcb8;});})['then'](respondWithResult(_0x3afb57,null))[_0xe593('0x56')](handleError(_0x3afb57,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 6c08f28..2cf6792 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 _0xcde7=['setMaxListeners','save','emit','hasOwnProperty','hook','WhatsappAccount'];(function(_0x5707d2,_0x539996){var _0x42a889=function(_0x54092d){while(--_0x54092d){_0x5707d2['push'](_0x5707d2['shift']());}};_0x42a889(++_0x539996);}(_0xcde7,0x65));var _0x7cde=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xcde7[_0x1cc8fe];return _0x230054;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x7cde('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x7cde('0x1')](0x0);var events={'afterCreate':_0x7cde('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11004a){return function(_0x47962e,_0x23ec50,_0x5824bf){WhatsappAccountEvents[_0x7cde('0x3')](_0x11004a+':'+_0x47962e['id'],_0x47962e);WhatsappAccountEvents[_0x7cde('0x3')](_0x11004a,_0x47962e);_0x5824bf(null);};}for(var e in events){if(events[_0x7cde('0x4')](e)){var event=events[e];WhatsappAccount[_0x7cde('0x5')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xa6b0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x4bfd93,_0x3f3044){_0x4bfd93=_0x4bfd93-0x0;var _0x455133=_0xa6b0[_0x4bfd93];return _0x455133;};'use strict';var EventEmitter=require(_0x0a6b('0x0'));var WhatsappAccount=require(_0x0a6b('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a6b('0x2'),'afterUpdate':_0x0a6b('0x3'),'afterDestroy':_0x0a6b('0x4')};function emitEvent(_0x4c9a84){return function(_0x29ff80,_0x33e8c3,_0x195697){WhatsappAccountEvents[_0x0a6b('0x5')](_0x4c9a84+':'+_0x29ff80['id'],_0x29ff80);WhatsappAccountEvents[_0x0a6b('0x5')](_0x4c9a84,_0x29ff80);_0x195697(null);};}for(var e in events){if(events[_0x0a6b('0x6')](e)){var event=events[e];WhatsappAccount[_0x0a6b('0x7')](e,emitEvent(event));}}module[_0x0a6b('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 7840c07..2f36d24 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 _0xedad=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappAccount','whatsapp_accounts','lodash','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xedad,0x17e));var _0xdeda=function(_0x147e9e,_0x3dfac5){_0x147e9e=_0x147e9e-0x0;var _0x1b42cf=_0xedad[_0x147e9e];return _0x1b42cf;};'use strict';var _=require(_0xdeda('0x0'));var util=require(_0xdeda('0x1'));var logger=require(_0xdeda('0x2'))('api');var moment=require(_0xdeda('0x3'));var BPromise=require(_0xdeda('0x4'));var rp=require(_0xdeda('0x5'));var fs=require('fs');var path=require(_0xdeda('0x6'));var rimraf=require(_0xdeda('0x7'));var config=require(_0xdeda('0x8'));var attributes=require('./whatsappAccount.attributes');module[_0xdeda('0x9')]=function(_0x5da8c7,_0x184fe7){return _0x5da8c7['define'](_0xdeda('0xa'),attributes,{'tableName':_0xdeda('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ab0=['../../config/environment','./whatsappAccount.attributes','WhatsappAccount','whatsapp_accounts','lodash','util','api','bluebird','request-promise','path'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6ab0,0xea));var _0x06ab=function(_0x1584c8,_0x255d61){_0x1584c8=_0x1584c8-0x0;var _0x49b5a7=_0x6ab0[_0x1584c8];return _0x49b5a7;};'use strict';var _=require(_0x06ab('0x0'));var util=require(_0x06ab('0x1'));var logger=require('../../config/logger')(_0x06ab('0x2'));var moment=require('moment');var BPromise=require(_0x06ab('0x3'));var rp=require(_0x06ab('0x4'));var fs=require('fs');var path=require(_0x06ab('0x5'));var rimraf=require('rimraf');var config=require(_0x06ab('0x6'));var attributes=require(_0x06ab('0x7'));module['exports']=function(_0x62b892,_0x335468){return _0x62b892['define'](_0x06ab('0x8'),attributes,{'tableName':_0x06ab('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 15d5f46..a2066da 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 _0x7184=['client','http','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','include','map','attributes','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3e3328,_0x3c9809){var _0x7b980b=function(_0x504a2a){while(--_0x504a2a){_0x3e3328['push'](_0x3e3328['shift']());}};_0x7b980b(++_0x3c9809);}(_0x7184,0xd5));var _0x4718=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x7184[_0x44cb92];return _0x56b9e6;};'use strict';var _=require(_0x4718('0x0'));var util=require(_0x4718('0x1'));var moment=require('moment');var BPromise=require(_0x4718('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4718('0x3'));var db=require(_0x4718('0x4'))['db'];var utils=require(_0x4718('0x5'));var logger=require(_0x4718('0x6'))(_0x4718('0x7'));var config=require('../../config/environment');var jayson=require(_0x4718('0x8'));var client=jayson[_0x4718('0x9')][_0x4718('0xa')]({'port':0x232a});config['redis']=_[_0x4718('0xb')](config['redis'],{'host':_0x4718('0xc'),'port':0x18eb});var socket=require(_0x4718('0xd'))(new Redis(config['redis']));require(_0x4718('0xe'))[_0x4718('0xf')](socket);function respondWithRpcPromise(_0x1632d4,_0x28ac6a,_0xf29e29){return new BPromise(function(_0x329884,_0x11ec99){return client['request'](_0x1632d4,_0xf29e29)[_0x4718('0x10')](function(_0x400d03){logger[_0x4718('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x28ac6a,'request\x20sent');logger[_0x4718('0x12')](_0x4718('0x13'),_0x28ac6a,'request\x20sent',JSON[_0x4718('0x14')](_0x400d03));if(_0x400d03[_0x4718('0x15')]){if(_0x400d03[_0x4718('0x15')]['code']===0x1f4){logger[_0x4718('0x15')](_0x4718('0x16'),_0x28ac6a,_0x400d03['error'][_0x4718('0x17')]);return _0x11ec99(_0x400d03[_0x4718('0x15')]['message']);}logger[_0x4718('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x28ac6a,_0x400d03[_0x4718('0x15')][_0x4718('0x17')]);return _0x329884(_0x400d03[_0x4718('0x15')]['message']);}else{logger[_0x4718('0x11')](_0x4718('0x16'),_0x28ac6a,_0x4718('0x18'));_0x329884(_0x400d03[_0x4718('0x19')][_0x4718('0x17')]);}})[_0x4718('0x1a')](function(_0x5174ce){logger[_0x4718('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x28ac6a,_0x5174ce);_0x11ec99(_0x5174ce);});});}exports[_0x4718('0x1b')]=function(_0x149e7e){var _0x40333b=this;return new Promise(function(_0x3c5bdc,_0x31a83e){return db[_0x4718('0x1c')][_0x4718('0x1d')]({'raw':_0x149e7e[_0x4718('0x1e')]?_0x149e7e[_0x4718('0x1e')][_0x4718('0x1f')]===undefined?!![]:![]:!![],'where':_0x149e7e[_0x4718('0x1e')]?_0x149e7e[_0x4718('0x1e')][_0x4718('0x20')]||null:null,'attributes':_0x149e7e['options']?_0x149e7e[_0x4718('0x1e')]['attributes']||null:null,'include':_0x149e7e[_0x4718('0x1e')]?_0x149e7e[_0x4718('0x1e')][_0x4718('0x21')]?_[_0x4718('0x22')](_0x149e7e[_0x4718('0x1e')][_0x4718('0x21')],function(_0xb0761d){return{'model':db[_0xb0761d['model']],'as':_0xb0761d['as'],'attributes':_0xb0761d[_0x4718('0x23')],'include':_0xb0761d[_0x4718('0x21')]?_[_0x4718('0x22')](_0xb0761d[_0x4718('0x21')],function(_0x503556){return{'model':db[_0x503556[_0x4718('0x24')]],'as':_0x503556['as'],'attributes':_0x503556[_0x4718('0x23')],'include':_0x503556[_0x4718('0x21')]?_['map'](_0x503556[_0x4718('0x21')],function(_0x125512){return{'model':db[_0x125512[_0x4718('0x24')]],'as':_0x125512['as'],'attributes':_0x125512['attributes']};}):[]};}):[]};}):[]:[]})[_0x4718('0x10')](function(_0x5882a4){logger[_0x4718('0x11')]('ShowWhatsappAccount',_0x149e7e);logger[_0x4718('0x12')]('ShowWhatsappAccount',_0x149e7e,JSON['stringify'](_0x5882a4));_0x3c5bdc(_0x5882a4);})['catch'](function(_0x20358b){logger['error'](_0x4718('0x1b'),_0x20358b['message'],_0x149e7e);_0x31a83e(_0x40333b[_0x4718('0x15')](0x1f4,_0x20358b[_0x4718('0x17')]));});});}; \ No newline at end of file +var _0xe3da=['catch','find','options','where','include','map','model','attributes','then','debug','ShowWhatsappAccount','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','register','request','info','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','WhatsappAccount,\x20%s,\x20%s'];(function(_0x1652c2,_0x5682ec){var _0x3ed5df=function(_0x2be014){while(--_0x2be014){_0x1652c2['push'](_0x1652c2['shift']());}};_0x3ed5df(++_0x5682ec);}(_0xe3da,0x1e8));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require('moment');var BPromise=require(_0xae3d('0x2'));var rs=require(_0xae3d('0x3'));var fs=require('fs');var Redis=require(_0xae3d('0x4'));var db=require(_0xae3d('0x5'))['db'];var utils=require(_0xae3d('0x6'));var logger=require(_0xae3d('0x7'))(_0xae3d('0x8'));var config=require('../../config/environment');var jayson=require(_0xae3d('0x9'));var client=jayson['client'][_0xae3d('0xa')]({'port':0x232a});config['redis']=_[_0xae3d('0xb')](config[_0xae3d('0xc')],{'host':_0xae3d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xae3d('0xc')]));require('./whatsappAccount.socket')[_0xae3d('0xe')](socket);function respondWithRpcPromise(_0x441ca1,_0x4bf467,_0x5891a2){return new BPromise(function(_0x30d9c1,_0x4bef2c){return client[_0xae3d('0xf')](_0x441ca1,_0x5891a2)['then'](function(_0xe967ab){logger[_0xae3d('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x4bf467,'request\x20sent');logger['debug'](_0xae3d('0x11'),_0x4bf467,_0xae3d('0x12'),JSON['stringify'](_0xe967ab));if(_0xe967ab[_0xae3d('0x13')]){if(_0xe967ab['error']['code']===0x1f4){logger[_0xae3d('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x4bf467,_0xe967ab[_0xae3d('0x13')][_0xae3d('0x14')]);return _0x4bef2c(_0xe967ab['error']['message']);}logger[_0xae3d('0x13')](_0xae3d('0x15'),_0x4bf467,_0xe967ab['error'][_0xae3d('0x14')]);return _0x30d9c1(_0xe967ab['error']['message']);}else{logger[_0xae3d('0x10')](_0xae3d('0x15'),_0x4bf467,'request\x20sent');_0x30d9c1(_0xe967ab['result']['message']);}})[_0xae3d('0x16')](function(_0x2421e0){logger[_0xae3d('0x13')](_0xae3d('0x15'),_0x4bf467,_0x2421e0);_0x4bef2c(_0x2421e0);});});}exports['ShowWhatsappAccount']=function(_0x1c90e2){var _0x107591=this;return new Promise(function(_0xecba70,_0x5b52b0){return db['WhatsappAccount'][_0xae3d('0x17')]({'raw':_0x1c90e2[_0xae3d('0x18')]?_0x1c90e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c90e2[_0xae3d('0x18')]?_0x1c90e2[_0xae3d('0x18')][_0xae3d('0x19')]||null:null,'attributes':_0x1c90e2[_0xae3d('0x18')]?_0x1c90e2['options']['attributes']||null:null,'include':_0x1c90e2[_0xae3d('0x18')]?_0x1c90e2[_0xae3d('0x18')][_0xae3d('0x1a')]?_[_0xae3d('0x1b')](_0x1c90e2['options'][_0xae3d('0x1a')],function(_0x5504f4){return{'model':db[_0x5504f4[_0xae3d('0x1c')]],'as':_0x5504f4['as'],'attributes':_0x5504f4['attributes'],'include':_0x5504f4[_0xae3d('0x1a')]?_[_0xae3d('0x1b')](_0x5504f4[_0xae3d('0x1a')],function(_0x2ac6d6){return{'model':db[_0x2ac6d6[_0xae3d('0x1c')]],'as':_0x2ac6d6['as'],'attributes':_0x2ac6d6['attributes'],'include':_0x2ac6d6[_0xae3d('0x1a')]?_['map'](_0x2ac6d6[_0xae3d('0x1a')],function(_0x22786d){return{'model':db[_0x22786d['model']],'as':_0x22786d['as'],'attributes':_0x22786d[_0xae3d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x1e')](function(_0x2e96be){logger[_0xae3d('0x10')]('ShowWhatsappAccount',_0x1c90e2);logger[_0xae3d('0x1f')](_0xae3d('0x20'),_0x1c90e2,JSON[_0xae3d('0x21')](_0x2e96be));_0xecba70(_0x2e96be);})[_0xae3d('0x16')](function(_0x183a68){logger['error'](_0xae3d('0x20'),_0x183a68[_0xae3d('0x14')],_0x1c90e2);_0x5b52b0(_0x107591[_0xae3d('0x13')](0x1f4,_0x183a68[_0xae3d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 83cb1e8..688af81 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 _0xfca2=['save','remove','update','emit','removeListener','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x5432ae,_0xf29395){var _0x90c574=function(_0x20527b){while(--_0x20527b){_0x5432ae['push'](_0x5432ae['shift']());}};_0x90c574(++_0xf29395);}(_0xfca2,0x67));var _0x2fca=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xfca2[_0x35d3a8];return _0x182378;};'use strict';var WhatsappAccountEvents=require(_0x2fca('0x0'));var events=[_0x2fca('0x1'),_0x2fca('0x2'),_0x2fca('0x3')];function createListener(_0x21db34,_0x457510){return function(_0x41be92){_0x457510[_0x2fca('0x4')](_0x21db34,_0x41be92);};}function removeListener(_0x302d0e,_0x333d87){return function(){WhatsappAccountEvents[_0x2fca('0x5')](_0x302d0e,_0x333d87);};}exports['register']=function(_0x2c8949){for(var _0x55f53f=0x0,_0x43845d=events[_0x2fca('0x6')];_0x55f53f<_0x43845d;_0x55f53f++){var _0x164f66=events[_0x55f53f];var _0x544a97=createListener(_0x2fca('0x7')+_0x164f66,_0x2c8949);WhatsappAccountEvents['on'](_0x164f66,_0x544a97);}}; \ No newline at end of file +var _0xe9d5=['emit','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','remove','update'];(function(_0x42160c,_0x30e856){var _0xdba9cb=function(_0x3b1f82){while(--_0x3b1f82){_0x42160c['push'](_0x42160c['shift']());}};_0xdba9cb(++_0x30e856);}(_0xe9d5,0xcd));var _0x5e9d=function(_0xed5729,_0x4979b1){_0xed5729=_0xed5729-0x0;var _0x4607e4=_0xe9d5[_0xed5729];return _0x4607e4;};'use strict';var WhatsappAccountEvents=require(_0x5e9d('0x0'));var events=['save',_0x5e9d('0x1'),_0x5e9d('0x2')];function createListener(_0x49c744,_0xac6c23){return function(_0x4b3c7d){_0xac6c23[_0x5e9d('0x3')](_0x49c744,_0x4b3c7d);};}function removeListener(_0x5f22ab,_0x208d73){return function(){WhatsappAccountEvents[_0x5e9d('0x4')](_0x5f22ab,_0x208d73);};}exports[_0x5e9d('0x5')]=function(_0x484887){for(var _0x28655c=0x0,_0x24cc53=events[_0x5e9d('0x6')];_0x28655c<_0x24cc53;_0x28655c++){var _0x16802a=events[_0x28655c];var _0x433315=createListener(_0x5e9d('0x7')+_0x16802a,_0x484887);WhatsappAccountEvents['on'](_0x16802a,_0x433315);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f0ee327..99d6074 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 _0x35bc=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x10d4b2,_0x52fb84){var _0x3fc805=function(_0x720f0){while(--_0x720f0){_0x10d4b2['push'](_0x10d4b2['shift']());}};_0x3fc805(++_0x52fb84);}(_0x35bc,0x1cb));var _0xc35b=function(_0x7c9f16,_0x1a5b08){_0x7c9f16=_0x7c9f16-0x0;var _0x5a9326=_0x35bc[_0x7c9f16];return _0x5a9326;};'use strict';var multer=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var path=require(_0xc35b('0x2'));var timeout=require(_0xc35b('0x3'));var express=require(_0xc35b('0x4'));var router=express[_0xc35b('0x5')]();var auth=require(_0xc35b('0x6'));var interaction=require(_0xc35b('0x7'));var config=require('../../config/environment');var controller=require(_0xc35b('0x8'));router['get']('/',auth[_0xc35b('0x9')](),controller[_0xc35b('0xa')]);router[_0xc35b('0xb')](_0xc35b('0xc'),auth[_0xc35b('0x9')](),controller[_0xc35b('0xd')]);router[_0xc35b('0xe')]('/',auth[_0xc35b('0x9')](),controller[_0xc35b('0xf')]);router[_0xc35b('0x10')](_0xc35b('0xc'),auth[_0xc35b('0x9')](),controller[_0xc35b('0x11')]);router[_0xc35b('0x12')](_0xc35b('0xc'),auth['isAuthenticated'](),controller[_0xc35b('0x13')]);module[_0xc35b('0x14')]=router; \ No newline at end of file +var _0x1489=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','path','connect-timeout'];(function(_0x1b051c,_0x27e62d){var _0x4b7956=function(_0x228f91){while(--_0x228f91){_0x1b051c['push'](_0x1b051c['shift']());}};_0x4b7956(++_0x27e62d);}(_0x1489,0x11f));var _0x9148=function(_0x4f1d29,_0x4f33c6){_0x4f1d29=_0x4f1d29-0x0;var _0x8486f7=_0x1489[_0x4f1d29];return _0x8486f7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9148('0x0'));var timeout=require(_0x9148('0x1'));var express=require(_0x9148('0x2'));var router=express[_0x9148('0x3')]();var auth=require(_0x9148('0x4'));var interaction=require(_0x9148('0x5'));var config=require(_0x9148('0x6'));var controller=require('./whatsappApplication.controller');router[_0x9148('0x7')]('/',auth[_0x9148('0x8')](),controller[_0x9148('0x9')]);router[_0x9148('0x7')](_0x9148('0xa'),auth[_0x9148('0x8')](),controller[_0x9148('0xb')]);router[_0x9148('0xc')]('/',auth[_0x9148('0x8')](),controller[_0x9148('0xd')]);router[_0x9148('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x9148('0xf')](_0x9148('0xa'),auth[_0x9148('0x8')](),controller['destroy']);module[_0x9148('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 0275c0a..fe34aea 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 _0xadf8=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x5ac92d,_0x14061b){var _0x1abd6e=function(_0x241e4e){while(--_0x241e4e){_0x5ac92d['push'](_0x5ac92d['shift']());}};_0x1abd6e(++_0x14061b);}(_0xadf8,0x1c5));var _0x8adf=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xadf8[_0x4d7f3f];return _0x5d67cc;};'use strict';var Sequelize=require(_0x8adf('0x0'));module[_0x8adf('0x1')]={'priority':{'type':Sequelize[_0x8adf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8adf('0x3')],'allowNull':![],'defaultValue':_0x8adf('0x4')},'appdata':{'type':Sequelize[_0x8adf('0x5')]()},'description':{'type':Sequelize[_0x8adf('0x3')]},'interval':{'type':Sequelize[_0x8adf('0x3')],'defaultValue':_0x8adf('0x6')}}; \ No newline at end of file +var _0x37cf=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0xe2794,_0x42caa5){var _0x578b5e=function(_0x3df5dd){while(--_0x3df5dd){_0xe2794['push'](_0xe2794['shift']());}};_0x578b5e(++_0x42caa5);}(_0x37cf,0xcc));var _0xf37c=function(_0x3222ad,_0x2df6b3){_0x3222ad=_0x3222ad-0x0;var _0x69314b=_0x37cf[_0x3222ad];return _0x69314b;};'use strict';var Sequelize=require(_0xf37c('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf37c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf37c('0x2')],'allowNull':![],'defaultValue':_0xf37c('0x3')},'appdata':{'type':Sequelize[_0xf37c('0x4')]()},'description':{'type':Sequelize[_0xf37c('0x2')]},'interval':{'type':Sequelize[_0xf37c('0x2')],'defaultValue':_0xf37c('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 0e8b50f..58bcb65 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 _0x52e7=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','merge','create','body','catch','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','WhatsappApplication','rawAttributes'];(function(_0x461d52,_0x43604b){var _0x25d252=function(_0x3bdc91){while(--_0x3bdc91){_0x461d52['push'](_0x461d52['shift']());}};_0x25d252(++_0x43604b);}(_0x52e7,0x147));var _0x752e=function(_0x1b0597,_0xeffacc){_0x1b0597=_0x1b0597-0x0;var _0x2b6a2a=_0x52e7[_0x1b0597];return _0x2b6a2a;};'use strict';var pdf=require(_0x752e('0x0'));var emlformat=require(_0x752e('0x1'));var rimraf=require(_0x752e('0x2'));var zipdir=require(_0x752e('0x3'));var jsonpatch=require(_0x752e('0x4'));var rp=require(_0x752e('0x5'));var moment=require('moment');var BPromise=require(_0x752e('0x6'));var Mustache=require(_0x752e('0x7'));var util=require(_0x752e('0x8'));var path=require(_0x752e('0x9'));var sox=require(_0x752e('0xa'));var csv=require(_0x752e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x752e('0xc'));var squel=require(_0x752e('0xd'));var crypto=require(_0x752e('0xe'));var jsforce=require(_0x752e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x752e('0xb'));var querystring=require(_0x752e('0x10'));var Papa=require(_0x752e('0x11'));var Redis=require('ioredis');var authService=require(_0x752e('0x12'));var qs=require(_0x752e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x752e('0x14'))(_0x752e('0x15'));var utils=require(_0x752e('0x16'));var config=require(_0x752e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b03f4,_0x13aac5){_0x13aac5=_0x13aac5||0xcc;return function(_0x44a951){if(_0x44a951){return _0x2b03f4[_0x752e('0x18')](_0x13aac5);}return _0x2b03f4[_0x752e('0x19')](_0x13aac5)['end']();};}function respondWithResult(_0x946f35,_0x524bc8){_0x524bc8=_0x524bc8||0xc8;return function(_0x8924fa){if(_0x8924fa){return _0x946f35[_0x752e('0x19')](_0x524bc8)[_0x752e('0x1a')](_0x8924fa);}};}function respondWithFilteredResult(_0x5abd37,_0x3af80e){return function(_0x381529){if(_0x381529){var _0x47157a=_0x381529[_0x752e('0x1b')],_0x483bbd=_0x3af80e[_0x752e('0x1c')],_0x5f3487=_0x3af80e[_0x752e('0x1c')]+_0x3af80e[_0x752e('0x1d')],_0x292b10;if(_0x5f3487>=_0x47157a){_0x5f3487=_0x47157a;_0x292b10=0xc8;}else{_0x292b10=0xce;}_0x5abd37[_0x752e('0x19')](_0x292b10);return _0x5abd37['set'](_0x752e('0x1e'),_0x483bbd+'-'+_0x5f3487+'/'+_0x47157a)[_0x752e('0x1a')](_0x381529);}return null;};}function patchUpdates(_0x338021){return function(_0x31ed00){try{jsonpatch[_0x752e('0x1f')](_0x31ed00,_0x338021,!![]);}catch(_0x2a9308){return BPromise[_0x752e('0x20')](_0x2a9308);}return _0x31ed00[_0x752e('0x21')]();};}function saveUpdates(_0x2184dd,_0x53dbc5){return function(_0x647c63){if(_0x647c63){return _0x647c63[_0x752e('0x22')](_0x2184dd)[_0x752e('0x23')](function(_0x2e0cf5){return _0x2e0cf5;});}return null;};}function removeEntity(_0x3ebe89,_0x26cd55){return function(_0x127204){if(_0x127204){return _0x127204[_0x752e('0x24')]()[_0x752e('0x23')](function(){_0x3ebe89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3429e1,_0xb69d83){return function(_0xd9a51a){if(!_0xd9a51a){_0x3429e1[_0x752e('0x18')](0x194);}return _0xd9a51a;};}function handleError(_0x3f2ff4,_0x14e896){_0x14e896=_0x14e896||0x1f4;return function(_0x13e09f){logger['error'](_0x13e09f[_0x752e('0x25')]);if(_0x13e09f[_0x752e('0x26')]){delete _0x13e09f[_0x752e('0x26')];}_0x3f2ff4[_0x752e('0x19')](_0x14e896)[_0x752e('0x27')](_0x13e09f);};}exports['index']=function(_0x1bf601,_0x5cbc60){var _0xa12258={},_0x4ad7cd={},_0x1badc3={'count':0x0,'rows':[]};var _0x3a96b4=_[_0x752e('0x28')](db[_0x752e('0x29')][_0x752e('0x2a')],function(_0x1d72be){return{'name':_0x1d72be[_0x752e('0x2b')],'type':_0x1d72be[_0x752e('0x2c')][_0x752e('0x2d')]};});_0x4ad7cd[_0x752e('0x2e')]=_[_0x752e('0x28')](_0x3a96b4,'name');_0x4ad7cd[_0x752e('0x2f')]=_['keys'](_0x1bf601[_0x752e('0x2f')]);_0x4ad7cd[_0x752e('0x30')]=_[_0x752e('0x31')](_0x4ad7cd[_0x752e('0x2e')],_0x4ad7cd[_0x752e('0x2f')]);_0xa12258['attributes']=_[_0x752e('0x31')](_0x4ad7cd[_0x752e('0x2e')],qs[_0x752e('0x32')](_0x1bf601['query'][_0x752e('0x32')]));_0xa12258[_0x752e('0x33')]=_0xa12258[_0x752e('0x33')][_0x752e('0x34')]?_0xa12258[_0x752e('0x33')]:_0x4ad7cd[_0x752e('0x2e')];if(!_0x1bf601['query'][_0x752e('0x35')](_0x752e('0x36'))){_0xa12258[_0x752e('0x1d')]=qs['limit'](_0x1bf601[_0x752e('0x2f')][_0x752e('0x1d')]);_0xa12258[_0x752e('0x1c')]=qs[_0x752e('0x1c')](_0x1bf601[_0x752e('0x2f')][_0x752e('0x1c')]);}_0xa12258[_0x752e('0x37')]=qs['sort'](_0x1bf601['query'][_0x752e('0x38')]);_0xa12258[_0x752e('0x39')]=qs[_0x752e('0x30')](_[_0x752e('0x3a')](_0x1bf601[_0x752e('0x2f')],_0x4ad7cd[_0x752e('0x30')]),_0x3a96b4);if(_0x1bf601[_0x752e('0x2f')]['filter']){_0xa12258[_0x752e('0x39')]=_['merge'](_0xa12258['where'],{'$or':_[_0x752e('0x28')](_0x3a96b4,function(_0x26b378){if(_0x26b378[_0x752e('0x2c')]!==_0x752e('0x3b')){var _0x1d960a={};_0x1d960a[_0x26b378[_0x752e('0x26')]]={'$like':'%'+_0x1bf601['query'][_0x752e('0x3c')]+'%'};return _0x1d960a;}})});}_0xa12258=_['merge']({},_0xa12258,_0x1bf601[_0x752e('0x3d')]);var _0x109c36={'where':_0xa12258[_0x752e('0x39')]};return db[_0x752e('0x29')][_0x752e('0x1b')](_0x109c36)[_0x752e('0x23')](function(_0x6cd54){_0x1badc3[_0x752e('0x1b')]=_0x6cd54;if(_0x1bf601[_0x752e('0x2f')][_0x752e('0x3e')]){_0xa12258[_0x752e('0x3f')]=[{'all':!![]}];}return db[_0x752e('0x29')][_0x752e('0x40')](_0xa12258);})[_0x752e('0x23')](function(_0x552862){_0x1badc3[_0x752e('0x41')]=_0x552862;return _0x1badc3;})[_0x752e('0x23')](respondWithFilteredResult(_0x5cbc60,_0xa12258))['catch'](handleError(_0x5cbc60,null));};exports[_0x752e('0x42')]=function(_0x1cf0ae,_0x2108f8){var _0x16b6dd={'raw':!![],'where':{'id':_0x1cf0ae[_0x752e('0x43')]['id']}},_0x32496e={};_0x32496e['model']=_['keys'](db[_0x752e('0x29')][_0x752e('0x2a')]);_0x32496e[_0x752e('0x2f')]=_[_0x752e('0x44')](_0x1cf0ae[_0x752e('0x2f')]);_0x32496e[_0x752e('0x30')]=_[_0x752e('0x31')](_0x32496e[_0x752e('0x2e')],_0x32496e[_0x752e('0x2f')]);_0x16b6dd[_0x752e('0x33')]=_[_0x752e('0x31')](_0x32496e['model'],qs['fields'](_0x1cf0ae['query']['fields']));_0x16b6dd[_0x752e('0x33')]=_0x16b6dd['attributes'][_0x752e('0x34')]?_0x16b6dd[_0x752e('0x33')]:_0x32496e[_0x752e('0x2e')];if(_0x1cf0ae[_0x752e('0x2f')]['includeAll']){_0x16b6dd[_0x752e('0x3f')]=[{'all':!![]}];}_0x16b6dd=_[_0x752e('0x45')]({},_0x16b6dd,_0x1cf0ae['options']);return db[_0x752e('0x29')]['find'](_0x16b6dd)[_0x752e('0x23')](handleEntityNotFound(_0x2108f8,null))[_0x752e('0x23')](respondWithResult(_0x2108f8,null))['catch'](handleError(_0x2108f8,null));};exports[_0x752e('0x46')]=function(_0x357a0b,_0x319b66){return db[_0x752e('0x29')][_0x752e('0x46')](_0x357a0b[_0x752e('0x47')],{})[_0x752e('0x23')](respondWithResult(_0x319b66,0xc9))[_0x752e('0x48')](handleError(_0x319b66,null));};exports[_0x752e('0x22')]=function(_0x23ee81,_0x36e903){if(_0x23ee81[_0x752e('0x47')]['id']){delete _0x23ee81['body']['id'];}return db[_0x752e('0x29')][_0x752e('0x49')]({'where':{'id':_0x23ee81['params']['id']}})[_0x752e('0x23')](handleEntityNotFound(_0x36e903,null))['then'](saveUpdates(_0x23ee81['body'],null))['then'](respondWithResult(_0x36e903,null))[_0x752e('0x48')](handleError(_0x36e903,null));};exports[_0x752e('0x24')]=function(_0x9b5521,_0x2bb1df){return db[_0x752e('0x29')][_0x752e('0x49')]({'where':{'id':_0x9b5521[_0x752e('0x43')]['id']}})[_0x752e('0x23')](handleEntityNotFound(_0x2bb1df,null))[_0x752e('0x23')](removeEntity(_0x2bb1df,null))[_0x752e('0x48')](handleError(_0x2bb1df,null));}; \ No newline at end of file +var _0xbec5=['then','error','name','send','index','WhatsappApplication','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','update','body','catch','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy'];(function(_0x17e5ae,_0x49509f){var _0x2c86af=function(_0x3e6017){while(--_0x3e6017){_0x17e5ae['push'](_0x17e5ae['shift']());}};_0x2c86af(++_0x49509f);}(_0xbec5,0x184));var _0x5bec=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0xbec5[_0x28e2cd];return _0x11fd46;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5bec('0x0'));var zipdir=require(_0x5bec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var Mustache=require(_0x5bec('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5bec('0x6'));var csv=require(_0x5bec('0x7'));var ejs=require(_0x5bec('0x8'));var fs=require('fs');var _=require(_0x5bec('0x9'));var squel=require(_0x5bec('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5bec('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5bec('0xc'));var authService=require(_0x5bec('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5bec('0xe'));var hardwareService=require(_0x5bec('0xf'));var logger=require(_0x5bec('0x10'))(_0x5bec('0x11'));var utils=require(_0x5bec('0x12'));var config=require('../../config/environment');var db=require(_0x5bec('0x13'))['db'];function respondWithStatusCode(_0x538ad2,_0x592956){_0x592956=_0x592956||0xcc;return function(_0x91e920){if(_0x91e920){return _0x538ad2['sendStatus'](_0x592956);}return _0x538ad2[_0x5bec('0x14')](_0x592956)[_0x5bec('0x15')]();};}function respondWithResult(_0x197136,_0x118444){_0x118444=_0x118444||0xc8;return function(_0x1e2c55){if(_0x1e2c55){return _0x197136['status'](_0x118444)[_0x5bec('0x16')](_0x1e2c55);}};}function respondWithFilteredResult(_0x14aa9f,_0x353acb){return function(_0x4653f3){if(_0x4653f3){var _0x13c048=_0x4653f3[_0x5bec('0x17')],_0x554bd6=_0x353acb['offset'],_0x21871a=_0x353acb[_0x5bec('0x18')]+_0x353acb[_0x5bec('0x19')],_0x14334e;if(_0x21871a>=_0x13c048){_0x21871a=_0x13c048;_0x14334e=0xc8;}else{_0x14334e=0xce;}_0x14aa9f[_0x5bec('0x14')](_0x14334e);return _0x14aa9f[_0x5bec('0x1a')](_0x5bec('0x1b'),_0x554bd6+'-'+_0x21871a+'/'+_0x13c048)[_0x5bec('0x16')](_0x4653f3);}return null;};}function patchUpdates(_0x35fa35){return function(_0x22f3ea){try{jsonpatch[_0x5bec('0x1c')](_0x22f3ea,_0x35fa35,!![]);}catch(_0x48310d){return BPromise[_0x5bec('0x1d')](_0x48310d);}return _0x22f3ea[_0x5bec('0x1e')]();};}function saveUpdates(_0x2be56b,_0x351550){return function(_0x16c2b9){if(_0x16c2b9){return _0x16c2b9['update'](_0x2be56b)['then'](function(_0x3dd570){return _0x3dd570;});}return null;};}function removeEntity(_0x55beaa,_0x37bb3c){return function(_0x3a221a){if(_0x3a221a){return _0x3a221a[_0x5bec('0x1f')]()[_0x5bec('0x20')](function(){_0x55beaa[_0x5bec('0x14')](0xcc)[_0x5bec('0x15')]();});}};}function handleEntityNotFound(_0xc05ba3,_0x3e2cff){return function(_0x41662c){if(!_0x41662c){_0xc05ba3['sendStatus'](0x194);}return _0x41662c;};}function handleError(_0x103c1a,_0x4ee844){_0x4ee844=_0x4ee844||0x1f4;return function(_0x4493f8){logger[_0x5bec('0x21')](_0x4493f8['stack']);if(_0x4493f8[_0x5bec('0x22')]){delete _0x4493f8[_0x5bec('0x22')];}_0x103c1a[_0x5bec('0x14')](_0x4ee844)[_0x5bec('0x23')](_0x4493f8);};}exports[_0x5bec('0x24')]=function(_0x396a49,_0x4916d2){var _0x3bcefb={},_0x39ea90={},_0x34f5e5={'count':0x0,'rows':[]};var _0x345d52=_['map'](db[_0x5bec('0x25')][_0x5bec('0x26')],function(_0x2374f5){return{'name':_0x2374f5[_0x5bec('0x27')],'type':_0x2374f5[_0x5bec('0x28')][_0x5bec('0x29')]};});_0x39ea90['model']=_[_0x5bec('0x2a')](_0x345d52,_0x5bec('0x22'));_0x39ea90[_0x5bec('0x2b')]=_[_0x5bec('0x2c')](_0x396a49[_0x5bec('0x2b')]);_0x39ea90[_0x5bec('0x2d')]=_['intersection'](_0x39ea90[_0x5bec('0x2e')],_0x39ea90['query']);_0x3bcefb[_0x5bec('0x2f')]=_[_0x5bec('0x30')](_0x39ea90[_0x5bec('0x2e')],qs[_0x5bec('0x31')](_0x396a49[_0x5bec('0x2b')][_0x5bec('0x31')]));_0x3bcefb[_0x5bec('0x2f')]=_0x3bcefb['attributes'][_0x5bec('0x32')]?_0x3bcefb[_0x5bec('0x2f')]:_0x39ea90[_0x5bec('0x2e')];if(!_0x396a49[_0x5bec('0x2b')][_0x5bec('0x33')](_0x5bec('0x34'))){_0x3bcefb[_0x5bec('0x19')]=qs[_0x5bec('0x19')](_0x396a49['query'][_0x5bec('0x19')]);_0x3bcefb[_0x5bec('0x18')]=qs[_0x5bec('0x18')](_0x396a49[_0x5bec('0x2b')]['offset']);}_0x3bcefb['order']=qs['sort'](_0x396a49['query'][_0x5bec('0x35')]);_0x3bcefb[_0x5bec('0x36')]=qs[_0x5bec('0x2d')](_[_0x5bec('0x37')](_0x396a49[_0x5bec('0x2b')],_0x39ea90['filters']),_0x345d52);if(_0x396a49[_0x5bec('0x2b')][_0x5bec('0x38')]){_0x3bcefb[_0x5bec('0x36')]=_['merge'](_0x3bcefb['where'],{'$or':_[_0x5bec('0x2a')](_0x345d52,function(_0x3a7ba2){if(_0x3a7ba2[_0x5bec('0x28')]!==_0x5bec('0x39')){var _0x537b9e={};_0x537b9e[_0x3a7ba2['name']]={'$like':'%'+_0x396a49[_0x5bec('0x2b')]['filter']+'%'};return _0x537b9e;}})});}_0x3bcefb=_[_0x5bec('0x3a')]({},_0x3bcefb,_0x396a49[_0x5bec('0x3b')]);var _0x15b1a6={'where':_0x3bcefb[_0x5bec('0x36')]};return db[_0x5bec('0x25')][_0x5bec('0x17')](_0x15b1a6)[_0x5bec('0x20')](function(_0x4810cb){_0x34f5e5[_0x5bec('0x17')]=_0x4810cb;if(_0x396a49[_0x5bec('0x2b')][_0x5bec('0x3c')]){_0x3bcefb[_0x5bec('0x3d')]=[{'all':!![]}];}return db[_0x5bec('0x25')][_0x5bec('0x3e')](_0x3bcefb);})['then'](function(_0x5a481d){_0x34f5e5[_0x5bec('0x3f')]=_0x5a481d;return _0x34f5e5;})[_0x5bec('0x20')](respondWithFilteredResult(_0x4916d2,_0x3bcefb))['catch'](handleError(_0x4916d2,null));};exports[_0x5bec('0x40')]=function(_0x4b2577,_0x39165){var _0x469a9d={'raw':!![],'where':{'id':_0x4b2577[_0x5bec('0x41')]['id']}},_0x3c3c14={};_0x3c3c14[_0x5bec('0x2e')]=_[_0x5bec('0x2c')](db[_0x5bec('0x25')]['rawAttributes']);_0x3c3c14[_0x5bec('0x2b')]=_[_0x5bec('0x2c')](_0x4b2577[_0x5bec('0x2b')]);_0x3c3c14['filters']=_['intersection'](_0x3c3c14[_0x5bec('0x2e')],_0x3c3c14[_0x5bec('0x2b')]);_0x469a9d['attributes']=_[_0x5bec('0x30')](_0x3c3c14['model'],qs[_0x5bec('0x31')](_0x4b2577[_0x5bec('0x2b')][_0x5bec('0x31')]));_0x469a9d['attributes']=_0x469a9d[_0x5bec('0x2f')][_0x5bec('0x32')]?_0x469a9d['attributes']:_0x3c3c14['model'];if(_0x4b2577[_0x5bec('0x2b')][_0x5bec('0x3c')]){_0x469a9d[_0x5bec('0x3d')]=[{'all':!![]}];}_0x469a9d=_[_0x5bec('0x3a')]({},_0x469a9d,_0x4b2577[_0x5bec('0x3b')]);return db[_0x5bec('0x25')][_0x5bec('0x42')](_0x469a9d)[_0x5bec('0x20')](handleEntityNotFound(_0x39165,null))[_0x5bec('0x20')](respondWithResult(_0x39165,null))['catch'](handleError(_0x39165,null));};exports['create']=function(_0x3575ba,_0x138197){return db[_0x5bec('0x25')]['create'](_0x3575ba['body'],{})[_0x5bec('0x20')](respondWithResult(_0x138197,0xc9))['catch'](handleError(_0x138197,null));};exports[_0x5bec('0x43')]=function(_0xa845f7,_0x4ef70a){if(_0xa845f7[_0x5bec('0x44')]['id']){delete _0xa845f7[_0x5bec('0x44')]['id'];}return db[_0x5bec('0x25')][_0x5bec('0x42')]({'where':{'id':_0xa845f7[_0x5bec('0x41')]['id']}})[_0x5bec('0x20')](handleEntityNotFound(_0x4ef70a,null))[_0x5bec('0x20')](saveUpdates(_0xa845f7[_0x5bec('0x44')],null))['then'](respondWithResult(_0x4ef70a,null))['catch'](handleError(_0x4ef70a,null));};exports['destroy']=function(_0x2bde61,_0x31d2da){return db[_0x5bec('0x25')][_0x5bec('0x42')]({'where':{'id':_0x2bde61[_0x5bec('0x41')]['id']}})[_0x5bec('0x20')](handleEntityNotFound(_0x31d2da,null))[_0x5bec('0x20')](removeEntity(_0x31d2da,null))[_0x5bec('0x45')](handleError(_0x31d2da,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 19ea06e..f50976f 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 _0x7fce=['WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','define'];(function(_0x3f1842,_0x6d7971){var _0x55cf11=function(_0x2efe58){while(--_0x2efe58){_0x3f1842['push'](_0x3f1842['shift']());}};_0x55cf11(++_0x6d7971);}(_0x7fce,0xdc));var _0xe7fc=function(_0x57e01f,_0x8ef138){_0x57e01f=_0x57e01f-0x0;var _0x3d2f60=_0x7fce[_0x57e01f];return _0x3d2f60;};'use strict';var _=require(_0xe7fc('0x0'));var util=require(_0xe7fc('0x1'));var logger=require(_0xe7fc('0x2'))('api');var moment=require(_0xe7fc('0x3'));var BPromise=require('bluebird');var rp=require(_0xe7fc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe7fc('0x5'));var config=require(_0xe7fc('0x6'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x223d07,_0x51c63b){return _0x223d07[_0xe7fc('0x7')](_0xe7fc('0x8'),attributes,{'tableName':_0xe7fc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe7fc('0xa'),'collate':_0xe7fc('0xb')});}; \ No newline at end of file +var _0x49f8=['./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','api','moment','request-promise','rimraf'];(function(_0x518cc0,_0x4e38ab){var _0x281183=function(_0x2ffafe){while(--_0x2ffafe){_0x518cc0['push'](_0x518cc0['shift']());}};_0x281183(++_0x4e38ab);}(_0x49f8,0xff));var _0x849f=function(_0x2009c8,_0x407d34){_0x2009c8=_0x2009c8-0x0;var _0x2560c4=_0x49f8[_0x2009c8];return _0x2560c4;};'use strict';var _=require(_0x849f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x849f('0x1'));var moment=require(_0x849f('0x2'));var BPromise=require('bluebird');var rp=require(_0x849f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x849f('0x4'));var config=require('../../config/environment');var attributes=require(_0x849f('0x5'));module['exports']=function(_0x1e8405,_0x30ebab){return _0x1e8405[_0x849f('0x6')](_0x849f('0x7'),attributes,{'tableName':_0x849f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x849f('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 a5800ab..10edb18 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 _0xf006=['code','message','result','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1df3d0,_0x422f2e){var _0x32f149=function(_0x936ab3){while(--_0x936ab3){_0x1df3d0['push'](_0x1df3d0['shift']());}};_0x32f149(++_0x422f2e);}(_0xf006,0x146));var _0x6f00=function(_0x359dc9,_0x505a10){_0x359dc9=_0x359dc9-0x0;var _0x1d884f=_0xf006[_0x359dc9];return _0x1d884f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6f00('0x0'));var BPromise=require(_0x6f00('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f00('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f00('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6f00('0x4'));var jayson=require(_0x6f00('0x5'));var client=jayson[_0x6f00('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c29ff,_0x4f918f,_0x3875fb){return new BPromise(function(_0x3001b1,_0x185728){return client[_0x6f00('0x7')](_0x3c29ff,_0x3875fb)[_0x6f00('0x8')](function(_0x3001c6){logger[_0x6f00('0x9')](_0x6f00('0xa'),_0x4f918f,_0x6f00('0xb'));logger[_0x6f00('0xc')](_0x6f00('0xd'),_0x4f918f,_0x6f00('0xb'),JSON[_0x6f00('0xe')](_0x3001c6));if(_0x3001c6['error']){if(_0x3001c6[_0x6f00('0xf')][_0x6f00('0x10')]===0x1f4){logger[_0x6f00('0xf')](_0x6f00('0xa'),_0x4f918f,_0x3001c6[_0x6f00('0xf')]['message']);return _0x185728(_0x3001c6[_0x6f00('0xf')]['message']);}logger[_0x6f00('0xf')]('WhatsappApplication,\x20%s,\x20%s',_0x4f918f,_0x3001c6[_0x6f00('0xf')][_0x6f00('0x11')]);return _0x3001b1(_0x3001c6[_0x6f00('0xf')][_0x6f00('0x11')]);}else{logger[_0x6f00('0x9')](_0x6f00('0xa'),_0x4f918f,_0x6f00('0xb'));_0x3001b1(_0x3001c6[_0x6f00('0x12')][_0x6f00('0x11')]);}})['catch'](function(_0x14b15d){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x4f918f,_0x14b15d);_0x185728(_0x14b15d);});});} \ No newline at end of file +var _0xa751=['rpc','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x16cb23,_0x598d53){var _0x560160=function(_0x3a7c7a){while(--_0x3a7c7a){_0x16cb23['push'](_0x16cb23['shift']());}};_0x560160(++_0x598d53);}(_0xa751,0x175));var _0x1a75=function(_0x43ec4d,_0x486dd5){_0x43ec4d=_0x43ec4d-0x0;var _0xe1b58d=_0xa751[_0x43ec4d];return _0xe1b58d;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var moment=require(_0x1a75('0x2'));var BPromise=require(_0x1a75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a75('0x5'));var logger=require(_0x1a75('0x6'))(_0x1a75('0x7'));var config=require('../../config/environment');var jayson=require(_0x1a75('0x8'));var client=jayson[_0x1a75('0x9')][_0x1a75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2af95b,_0x1ec106,_0x692ac0){return new BPromise(function(_0x4537f6,_0x5d6faa){return client['request'](_0x2af95b,_0x692ac0)['then'](function(_0x41aa8f){logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));logger[_0x1a75('0xe')](_0x1a75('0xf'),_0x1ec106,_0x1a75('0xd'),JSON[_0x1a75('0x10')](_0x41aa8f));if(_0x41aa8f['error']){if(_0x41aa8f['error']['code']===0x1f4){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f[_0x1a75('0x11')][_0x1a75('0x12')]);return _0x5d6faa(_0x41aa8f['error']['message']);}logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x41aa8f['error'][_0x1a75('0x12')]);return _0x4537f6(_0x41aa8f[_0x1a75('0x11')]['message']);}else{logger[_0x1a75('0xb')](_0x1a75('0xc'),_0x1ec106,_0x1a75('0xd'));_0x4537f6(_0x41aa8f['result']['message']);}})['catch'](function(_0x471b90){logger[_0x1a75('0x11')](_0x1a75('0xc'),_0x1ec106,_0x471b90);_0x5d6faa(_0x471b90);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 3cf86e2..156b9f0 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 _0xfb44=['isAuthenticated','download','post','create','addMessage','/:id/tags','tracked','whatsapp','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','Router','../../components/interaction/service','./whatsappInteraction.controller','index','get','/describe','describe','/:id','show','/:id/messages','/:id/download'];(function(_0x2d099b,_0x435a6f){var _0x415093=function(_0x45c940){while(--_0x45c940){_0x2d099b['push'](_0x2d099b['shift']());}};_0x415093(++_0x435a6f);}(_0xfb44,0xd9));var _0x4fb4=function(_0x593c44,_0x1ad943){_0x593c44=_0x593c44-0x0;var _0x28a337=_0xfb44[_0x593c44];return _0x28a337;};'use strict';var multer=require(_0x4fb4('0x0'));var util=require(_0x4fb4('0x1'));var path=require(_0x4fb4('0x2'));var timeout=require(_0x4fb4('0x3'));var express=require('express');var router=express[_0x4fb4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4fb4('0x5'));var config=require('../../config/environment');var controller=require(_0x4fb4('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4fb4('0x7')]);router[_0x4fb4('0x8')](_0x4fb4('0x9'),auth['isAuthenticated'](),controller[_0x4fb4('0xa')]);router[_0x4fb4('0x8')](_0x4fb4('0xb'),auth['isAuthenticated'](),controller[_0x4fb4('0xc')]);router[_0x4fb4('0x8')](_0x4fb4('0xd'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x4fb4('0xe'),auth[_0x4fb4('0xf')](),controller[_0x4fb4('0x10')]);router[_0x4fb4('0x11')]('/',auth[_0x4fb4('0xf')](),controller[_0x4fb4('0x12')]);router['post'](_0x4fb4('0xd'),auth['isAuthenticated'](),controller[_0x4fb4('0x13')]);router[_0x4fb4('0x11')](_0x4fb4('0x14'),auth[_0x4fb4('0xf')](),interaction[_0x4fb4('0x15')](_0x4fb4('0x16'),'whatsappinteraction:addtags'),controller['addTags']);router[_0x4fb4('0x17')](_0x4fb4('0xb'),auth['isAuthenticated'](),interaction[_0x4fb4('0x15')]('whatsapp',_0x4fb4('0x18')),controller['update']);router['delete'](_0x4fb4('0xb'),auth['isAuthenticated'](),interaction[_0x4fb4('0x15')](_0x4fb4('0x16'),_0x4fb4('0x19')),controller[_0x4fb4('0x1a')]);router[_0x4fb4('0x1b')]('/:id/tags',auth[_0x4fb4('0xf')](),controller[_0x4fb4('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xbe60=['../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','describe','/:id','show','getMessages','/:id/download','download','create','/:id/messages','addMessage','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:destroy','destroy','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x43c76e,_0x3be843){var _0x5c7652=function(_0x13c8a5){while(--_0x13c8a5){_0x43c76e['push'](_0x43c76e['shift']());}};_0x5c7652(++_0x3be843);}(_0xbe60,0x1b9));var _0x0be6=function(_0x3cd1b9,_0x375f5d){_0x3cd1b9=_0x3cd1b9-0x0;var _0x54ebe0=_0xbe60[_0x3cd1b9];return _0x54ebe0;};'use strict';var multer=require(_0x0be6('0x0'));var util=require(_0x0be6('0x1'));var path=require(_0x0be6('0x2'));var timeout=require(_0x0be6('0x3'));var express=require(_0x0be6('0x4'));var router=express[_0x0be6('0x5')]();var auth=require(_0x0be6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0be6('0x7'));var controller=require(_0x0be6('0x8'));router[_0x0be6('0x9')]('/',auth[_0x0be6('0xa')](),controller[_0x0be6('0xb')]);router[_0x0be6('0x9')]('/describe',auth[_0x0be6('0xa')](),controller[_0x0be6('0xc')]);router[_0x0be6('0x9')](_0x0be6('0xd'),auth[_0x0be6('0xa')](),controller[_0x0be6('0xe')]);router['get']('/:id/messages',auth[_0x0be6('0xa')](),controller[_0x0be6('0xf')]);router[_0x0be6('0x9')](_0x0be6('0x10'),auth['isAuthenticated'](),controller[_0x0be6('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0be6('0x12')]);router['post'](_0x0be6('0x13'),auth['isAuthenticated'](),controller[_0x0be6('0x14')]);router[_0x0be6('0x15')](_0x0be6('0x16'),auth['isAuthenticated'](),interaction[_0x0be6('0x17')](_0x0be6('0x18'),_0x0be6('0x19')),controller[_0x0be6('0x1a')]);router[_0x0be6('0x1b')](_0x0be6('0xd'),auth['isAuthenticated'](),interaction[_0x0be6('0x17')]('whatsapp','whatsappinteraction:update'),controller['update']);router['delete'](_0x0be6('0xd'),auth[_0x0be6('0xa')](),interaction[_0x0be6('0x17')](_0x0be6('0x18'),_0x0be6('0x1c')),controller[_0x0be6('0x1d')]);router[_0x0be6('0x1e')]('/:id/tags',auth[_0x0be6('0xa')](),controller['removeTags']);module[_0x0be6('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2d8a89c..c4a3cc1 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 _0xcf3b=['DATE','ENUM','out','sequelize','moment','exports','BOOLEAN','STRING'];(function(_0x27bbe4,_0x30e43f){var _0x3a6d46=function(_0x4e8032){while(--_0x4e8032){_0x27bbe4['push'](_0x27bbe4['shift']());}};_0x3a6d46(++_0x30e43f);}(_0xcf3b,0x173));var _0xbcf3=function(_0xc1fe73,_0x4c6821){_0xc1fe73=_0xc1fe73-0x0;var _0xbf785a=_0xcf3b[_0xc1fe73];return _0xbf785a;};'use strict';var Sequelize=require(_0xbcf3('0x0'));var moment=require(_0xbcf3('0x1'));module[_0xbcf3('0x2')]={'closed':{'type':Sequelize[_0xbcf3('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xbcf3('0x4')]},'note':{'type':Sequelize[_0xbcf3('0x4')]},'phone':{'type':Sequelize[_0xbcf3('0x4')]},'read1stAt':{'type':Sequelize[_0xbcf3('0x5')]},'firstMsgDirection':{'type':Sequelize[_0xbcf3('0x6')]('in',_0xbcf3('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xbcf3('0x6')]('in',_0xbcf3('0x7')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xaf7f=['STRING','DATE','ENUM','out','sequelize','moment','BOOLEAN'];(function(_0x350220,_0x5f49f5){var _0x4251b9=function(_0xcaa79f){while(--_0xcaa79f){_0x350220['push'](_0x350220['shift']());}};_0x4251b9(++_0x5f49f5);}(_0xaf7f,0x177));var _0xfaf7=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xaf7f[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0xfaf7('0x0'));var moment=require(_0xfaf7('0x1'));module['exports']={'closed':{'type':Sequelize[_0xfaf7('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xfaf7('0x3')]},'phone':{'type':Sequelize[_0xfaf7('0x3')]},'read1stAt':{'type':Sequelize[_0xfaf7('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xfaf7('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xfaf7('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xfaf7('0x5')]('in',_0xfaf7('0x6')),'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 78a65ae..84d6deb 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 _0xadb5=['field','from','tools_tags','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','find','UserId','buildExpression','start','body','keys','compact','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\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)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','catch','show','params','includeAll','include','merge','options','create','describe','addMessage','ids','getMessages','findOne','WhatsappMessage','hasOwnProperty','nolimit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','findAll','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','Account','Owner','get','mkdirSync','40px','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','N.A.','closed','disposition','basename','createReadStream','createWriteStream','direction','out','System','renderFile','views','downloadInteraction.html','toFile','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','WhatsappInteraction','rawAttributes','type','key','query','intersection','model','attributes','fields','length','limit','order','sort','filters','pick','select'];(function(_0x51575b,_0x7a4b56){var _0x387a65=function(_0x321767){while(--_0x321767){_0x51575b['push'](_0x51575b['shift']());}};_0x387a65(++_0x7a4b56);}(_0xadb5,0xad));var _0x5adb=function(_0x1af834,_0x10ef2f){_0x1af834=_0x1af834-0x0;var _0x14aa8b=_0xadb5[_0x1af834];return _0x14aa8b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];config['redis']=_[_0x5adb('0x18')](config['redis'],{'host':_0x5adb('0x19'),'port':0x18eb});var socket=require(_0x5adb('0x1a'))(new Redis(config[_0x5adb('0x1b')]));require('./whatsappInteraction.socket')[_0x5adb('0x1c')](socket);function respondWithStatusCode(_0x34af2c,_0xf82f72){_0xf82f72=_0xf82f72||0xcc;return function(_0x5263ec){if(_0x5263ec){return _0x34af2c[_0x5adb('0x1d')](_0xf82f72);}return _0x34af2c['status'](_0xf82f72)[_0x5adb('0x1e')]();};}function respondWithResult(_0x42a482,_0x30614e){_0x30614e=_0x30614e||0xc8;return function(_0x304784){if(_0x304784){return _0x42a482[_0x5adb('0x1f')](_0x30614e)[_0x5adb('0x20')](_0x304784);}};}function respondWithFilteredResult(_0xa29dc,_0x42f4c6){return function(_0xb953a6){if(_0xb953a6){var _0x529b65=_0xb953a6['count'],_0x3fff62=_0x42f4c6[_0x5adb('0x21')],_0x5de028=_0x42f4c6['offset']+_0x42f4c6['limit'],_0x1d9e86;if(_0x5de028>=_0x529b65){_0x5de028=_0x529b65;_0x1d9e86=0xc8;}else{_0x1d9e86=0xce;}_0xa29dc[_0x5adb('0x1f')](_0x1d9e86);return _0xa29dc[_0x5adb('0x22')](_0x5adb('0x23'),_0x3fff62+'-'+_0x5de028+'/'+_0x529b65)[_0x5adb('0x20')](_0xb953a6);}return null;};}function patchUpdates(_0x99bc6c){return function(_0x5af69d){try{jsonpatch[_0x5adb('0x24')](_0x5af69d,_0x99bc6c,!![]);}catch(_0x5c296e){return BPromise['reject'](_0x5c296e);}return _0x5af69d[_0x5adb('0x25')]();};}function saveUpdates(_0x379b33,_0x1a38d3){return function(_0x1a8014){if(_0x1a8014){return _0x1a8014[_0x5adb('0x26')](_0x379b33)[_0x5adb('0x27')](function(_0xfd9bb9){return _0xfd9bb9;});}return null;};}function removeEntity(_0x4ca150,_0x4b1957){return function(_0x373cc3){if(_0x373cc3){return _0x373cc3[_0x5adb('0x28')]()[_0x5adb('0x27')](function(){_0x4ca150[_0x5adb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fee18,_0x2e1e63){return function(_0x5aed76){if(!_0x5aed76){_0x2fee18[_0x5adb('0x1d')](0x194);}return _0x5aed76;};}function handleError(_0x1ded9f,_0x1a0acd){_0x1a0acd=_0x1a0acd||0x1f4;return function(_0x55b40a){logger[_0x5adb('0x29')](_0x55b40a[_0x5adb('0x2a')]);if(_0x55b40a[_0x5adb('0x2b')]){delete _0x55b40a[_0x5adb('0x2b')];}_0x1ded9f[_0x5adb('0x1f')](_0x1a0acd)[_0x5adb('0x2c')](_0x55b40a);};}function getInteractionUsers(_0x4a5d46,_0x49992e){return new BPromise(function(_0x5d457e,_0x39bddd){try{if(_0x49992e[_0x4a5d46['id']]){_0x4a5d46[_0x5adb('0x2d')]=_[_0x5adb('0x2e')](_0x49992e[_0x4a5d46['id']],function(_0x512bab){return{'id':_0x512bab['id'],'fullname':_0x512bab[_0x5adb('0x2f')]};});}}catch(_0x4de310){_0x39bddd(_0x4de310);}_0x5d457e(_0x4a5d46);});}function getInteractionTags(_0x11ec2a,_0x34b793){return new BPromise(function(_0x372da1,_0x3b1fed){try{if(_0x11ec2a[_0x5adb('0x30')]){_0x11ec2a[_0x5adb('0x31')]=[];_0x11ec2a[_0x5adb('0x30')][_0x5adb('0x32')](',')[_0x5adb('0x33')](function(_0x260295){_0x11ec2a['Tags'][_0x5adb('0x34')](_0x34b793[_0x260295]);});}delete _0x11ec2a['TagIds'];}catch(_0x12424d){_0x3b1fed(_0x12424d);}_0x372da1(_0x11ec2a);});}function updateWhatsappInteraction(_0x20cde6,_0x5d1441,_0x226390){return new BPromise(function(_0xe389ca,_0x461a39){return getInteractionUsers(_0x20cde6,_0x226390)['then'](function(_0x173789){return getInteractionTags(_0x173789,_0x5d1441);})[_0x5adb('0x27')](function(_0x4b5887){_0xe389ca(_0x4b5887);})['catch'](function(_0x1ed9ea){_0x461a39(_0x1ed9ea);});});}exports['index']=function(_0x663ea0,_0x222568){var _0x3c2b07={},_0x2da912={},_0x9bdece={'count':0x0,'rows':[]};var _0x5ece39=_[_0x5adb('0x2e')](db[_0x5adb('0x35')][_0x5adb('0x36')],function(_0x54851b){return{'name':_0x54851b['fieldName'],'type':_0x54851b[_0x5adb('0x37')][_0x5adb('0x38')]};});_0x2da912['model']=_[_0x5adb('0x2e')](_0x5ece39,'name');_0x2da912[_0x5adb('0x39')]=_['keys'](_0x663ea0[_0x5adb('0x39')]);_0x2da912['filters']=_[_0x5adb('0x3a')](_0x2da912[_0x5adb('0x3b')],_0x2da912['query']);_0x3c2b07[_0x5adb('0x3c')]=_['intersection'](_0x2da912[_0x5adb('0x3b')],qs[_0x5adb('0x3d')](_0x663ea0[_0x5adb('0x39')]['fields']));_0x3c2b07[_0x5adb('0x3c')]=_0x3c2b07[_0x5adb('0x3c')][_0x5adb('0x3e')]?_0x3c2b07[_0x5adb('0x3c')]:_0x2da912[_0x5adb('0x3b')];if(!_0x663ea0['query']['hasOwnProperty']('nolimit')){_0x3c2b07['limit']=qs[_0x5adb('0x3f')](_0x663ea0[_0x5adb('0x39')][_0x5adb('0x3f')]);_0x3c2b07[_0x5adb('0x21')]=qs[_0x5adb('0x21')](_0x663ea0[_0x5adb('0x39')][_0x5adb('0x21')]);}_0x3c2b07[_0x5adb('0x40')]=qs['sort'](_0x663ea0['query'][_0x5adb('0x41')]);_0x3c2b07['where']=qs[_0x5adb('0x42')](_[_0x5adb('0x43')](_0x663ea0[_0x5adb('0x39')],_0x2da912[_0x5adb('0x42')]),_0x5ece39);var _0xdfecfd=[];var _0x522ee5=squel[_0x5adb('0x44')]()[_0x5adb('0x45')]('id')['field'](_0x5adb('0x2b'))[_0x5adb('0x45')]('color')[_0x5adb('0x46')](_0x5adb('0x47'));var _0x1d6bef=squel[_0x5adb('0x44')]()[_0x5adb('0x45')](_0x5adb('0x48'))[_0x5adb('0x45')]('u.fullname')['field'](_0x5adb('0x49'))[_0x5adb('0x46')](_0x5adb('0x4a'),'ui')[_0x5adb('0x4b')]('users','u','u.id\x20=\x20ui.UserId');var _0xaa32e4=squel[_0x5adb('0x44')]()[_0x5adb('0x46')](_0x5adb('0x4c'),'i')[_0x5adb('0x4b')]('cm_contacts','c',_0x5adb('0x4d'))[_0x5adb('0x4b')]('users','o',_0x5adb('0x4e'))[_0x5adb('0x4b')](_0x5adb('0x4f'),'a',_0x5adb('0x50'))[_0x5adb('0x4b')](_0x5adb('0x51'),'me',_0x5adb('0x52'))[_0x5adb('0x4b')]('whatsapp_interaction_has_tags','it',_0x5adb('0x53'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3cd211=squel[_0x5adb('0x54')]();var _0x207a81=[];var _0x4ba0b5=squel[_0x5adb('0x54')]();var _0x5cbab5;if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x55')]){_0x5cbab5=as[_0x5adb('0x56')](_0x663ea0['query'][_0x5adb('0x55')]);var _0x560bac=_0x5cbab5[_0x5adb('0x57')];for(var _0x6dc067=0x0;_0x6dc067<_0x5cbab5['conditions'][_0x5adb('0x3e')];_0x6dc067++){var _0x1ab97b=_0x5cbab5[_0x5adb('0x58')][_0x6dc067];var _0x101008='i';var _0x372734=_['find'](_0x5ece39,[_0x5adb('0x2b'),_0x1ab97b[_0x5adb('0x45')]]);if(!_0x372734){switch(_0x1ab97b[_0x5adb('0x45')]){case _0x5adb('0x59'):if(_0x1ab97b['value']==0x1){_0xaa32e4[_0x5adb('0x5a')]('`'+_0x1ab97b[_0x5adb('0x45')]+_0x5adb('0x5b'));}else{_0xaa32e4['having']('`'+_0x1ab97b[_0x5adb('0x45')]+_0x5adb('0x5c'));}break;case _0x5adb('0x5d'):if(_0x1ab97b[_0x5adb('0x5e')]==='$substring'){if(_0x1ab97b[_0x5adb('0x5f')][_0x5adb('0x32')]('\x20')[_0x5adb('0x3e')]>0x1){_0x3cd211[_0x560bac](_0x5adb('0x60'),qs[_0x5adb('0x61')](_0x1ab97b['value']),null);}else{var _0x378938='%'+_0x1ab97b['value']+'%';_0x3cd211[_0x560bac](_0x5adb('0x62'),_0x378938,_0x378938,_0x378938);}}else{_0x372734=_['find'](_0x5ece39,[_0x5adb('0x2b'),_0x5adb('0x63')]);_0x1ab97b[_0x5adb('0x45')]=_0x5adb('0x63');_0x836b91=as['buildExpression'](_0x101008,_0x372734[_0x5adb('0x37')],_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91[_0x5adb('0x64')],_0x836b91[_0x5adb('0x5f')]['start'],_0x836b91['value']['end']);}break;case _0x5adb('0x65'):var _0x31a1f9=_0x1ab97b[_0x5adb('0x5f')][_0x5adb('0x32')](',')[_0x5adb('0x2e')](function(_0xb06bee){return Number(_0xb06bee);});_0x31a1f9[_0x5adb('0x33')](function(_0x8d7810){_0x4ba0b5['or'](_0x5adb('0x66'),'%,'+_0x8d7810+',%');});_0x207a81=_[_0x5adb('0x67')](_0x207a81,_0x31a1f9);break;case _0x5adb('0x68'):if(_0x1ab97b[_0x5adb('0x5e')]===_0x5adb('0x69')){_0x3cd211[_0x560bac]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1ab97b['value']+'%',null);}else{_0x372734=_[_0x5adb('0x6a')](_0x5ece39,[_0x5adb('0x2b'),_0x5adb('0x6b')]);_0x1ab97b[_0x5adb('0x45')]='UserId';_0x836b91=as[_0x5adb('0x6c')](_0x101008,_0x372734[_0x5adb('0x37')],_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91['text'],_0x836b91[_0x5adb('0x5f')][_0x5adb('0x6d')],_0x836b91[_0x5adb('0x5f')]['end']);}break;case _0x5adb('0x6e'):_0x836b91=as[_0x5adb('0x6c')]('me',null,_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91[_0x5adb('0x64')],_0x836b91[_0x5adb('0x5f')][_0x5adb('0x6d')],_0x836b91[_0x5adb('0x5f')]['end']);break;}}else{var _0x836b91=as[_0x5adb('0x6c')](_0x101008,_0x372734[_0x5adb('0x37')],_0x1ab97b);_0x3cd211[_0x560bac](_0x836b91['text'],_0x836b91[_0x5adb('0x5f')][_0x5adb('0x6d')],_0x836b91[_0x5adb('0x5f')]['end']);}}}else{var _0x7287ac=_(_0x663ea0['query'])[_0x5adb('0x6f')]()[_0x5adb('0x2e')](function(_0x24e1ab){return _['some'](_0x5ece39,[_0x5adb('0x2b'),_0x24e1ab])?_0x24e1ab:undefined;})[_0x5adb('0x70')]()['value']();if(!_[_0x5adb('0x71')](_0x7287ac)){_0x7287ac[_0x5adb('0x33')](function(_0x248739){if(_0x248739===_0x5adb('0x72')){_0xaa32e4['where'](_0x5adb('0x73'),[][_0x5adb('0x74')](_0x663ea0[_0x5adb('0x39')][_0x248739]));}else if(_0x248739===_0x5adb('0x75')){var _0x5b7556=JSON['parse'](_0x663ea0[_0x5adb('0x39')][_0x248739])['$gte'];var _0x4d635f=JSON['parse'](_0x663ea0[_0x5adb('0x39')][_0x248739])[_0x5adb('0x76')];_0xaa32e4['where'](_0x5adb('0x77'),_0x5b7556,_0x4d635f);}else{if(_0x663ea0[_0x5adb('0x39')][_0x248739]===_0x5adb('0x78')){_0xaa32e4[_0x5adb('0x79')]('i.'+_0x248739+_0x5adb('0x7a'));}else{_0xaa32e4[_0x5adb('0x79')]('i.'+_0x248739+_0x5adb('0x7b'),_0x663ea0[_0x5adb('0x39')][_0x248739]);}}});}if(_0x663ea0['query']['read']){if(_0x663ea0['query'][_0x5adb('0x7c')]==0x1){_0xaa32e4[_0x5adb('0x5a')](_0x5adb('0x7d'));}else{_0xaa32e4[_0x5adb('0x5a')](_0x5adb('0x7e'));}}if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x7f')]){_0x207a81=_[_0x5adb('0x80')](_0x663ea0['query']['tag'])?_0x663ea0[_0x5adb('0x39')][_0x5adb('0x7f')]:new Array(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x7f')]);_0x207a81[_0x5adb('0x33')](function(_0x335de5){_0x4ba0b5['or'](_0x5adb('0x66'),'%,'+_0x335de5+',%');});}if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x81')]){var _0x3b5ecf=_0x663ea0['query'][_0x5adb('0x81')][_0x5adb('0x82')]('\x5c','\x5c\x5c')[_0x5adb('0x82')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x5adb('0x83')](_0x3b5ecf)){_0x3cd211['or'](_0x5adb('0x84'),_0x3b5ecf+'%')['or']('i.phone\x20LIKE\x20?',_0x3b5ecf+'%');}else{_0x3cd211['or'](_0x5adb('0x85'),qs['getFullTextValue'](_0x3b5ecf))['or'](_0x5adb('0x86'),_0x3b5ecf+'%');}}}_0xaa32e4[_0x5adb('0x79')](_0x3cd211);_0xaa32e4['group'](_0x5adb('0x87'));var _0x1ceb72={'type':db[_0x5adb('0x88')][_0x5adb('0x89')][_0x5adb('0x8a')],'raw':!![]};var _0x10f54a=_0xaa32e4[_0x5adb('0x8b')]();_0x10f54a[_0x5adb('0x45')]('i.id');_0x10f54a[_0x5adb('0x45')](_0x5adb('0x8c'),_0x5adb('0x59'));if(_0x3c2b07['order']){_0x3c2b07['order'][_0x5adb('0x33')](function(_0x4fd8f7){_0xaa32e4[_0x5adb('0x40')]('i.'+_0x4fd8f7[0x0],_0x4fd8f7[0x1]===_0x5adb('0x8d')?![]:!![]);});}if(!_[_0x5adb('0x71')](_0x207a81)){_0xaa32e4['having'](_0x4ba0b5);_0x10f54a[_0x5adb('0x79')](_0x5adb('0x8e'),_0x207a81);}BPromise[_0x5adb('0x8f')]()[_0x5adb('0x27')](function(){if(!_0x5cbab5){if(_0x663ea0[_0x5adb('0x39')]['WhatsappAccountId']||_0x663ea0[_0x5adb('0x39')][_0x5adb('0x90')])return;_0x10f54a[_0x5adb('0x79')](_0x5adb('0x91'));_0xaa32e4['where'](_0x5adb('0x91'));return;}return _0x663ea0[_0x5adb('0x92')][_0x5adb('0x93')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x27')](function(_0x15d4f1){if(_[_0x5adb('0x71')](_0x15d4f1)){_0x10f54a[_0x5adb('0x79')]('i.WhatsappAccountId\x20IS\x20NULL');_0xaa32e4[_0x5adb('0x79')](_0x5adb('0x94'));}else{_0x10f54a['where'](_0x5adb('0x73'),_[_0x5adb('0x2e')](_0x15d4f1,'id'));_0xaa32e4['where'](_0x5adb('0x73'),_['map'](_0x15d4f1,'id'));}});})[_0x5adb('0x27')](function(){db[_0x5adb('0x95')]['query'](_0x10f54a[_0x5adb('0x96')](),_0x1ceb72)['then'](function(_0x2f6415){_0x9bdece[_0x5adb('0x97')]=_0x2f6415[_0x5adb('0x3e')];if(_0x9bdece[_0x5adb('0x97')]===0x0)return[];return db[_0x5adb('0x95')]['query'](_0x522ee5[_0x5adb('0x96')](),_0x1ceb72)[_0x5adb('0x27')](function(_0x3f33c0){_0xdfecfd=_[_0x5adb('0x98')](_0x3f33c0,'id');_0x1ceb72=_['merge'](_0x1ceb72,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x663ea0[_0x5adb('0x39')][_0x5adb('0x3d')]){_0x3c2b07[_0x5adb('0x3c')][_0x5adb('0x33')](function(_0x277668){_0xaa32e4[_0x5adb('0x45')]('i.'+_0x277668);});}else{_0xaa32e4[_0x5adb('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x5adb('0x59'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0x99'),_0x5adb('0x9a'));_0xaa32e4['field'](_0x5adb('0x9b'),_0x5adb('0x9c'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0x9d'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0x9e'),_0x5adb('0x9f'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa0'),'Contact.lastName');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa1'),'Contact.email');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa2'),_0x5adb('0xa3'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa4'),_0x5adb('0xa5'));_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa6'),'Contact.fax');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa7'),'Owner.fullname');_0xaa32e4[_0x5adb('0x45')](_0x5adb('0xa8'),_0x5adb('0xa9'));_0xaa32e4['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x5adb('0x30'));}if(_0x3c2b07[_0x5adb('0x3f')])_0xaa32e4[_0x5adb('0x3f')](_0x3c2b07['limit']);if(_0x3c2b07[_0x5adb('0x21')])_0xaa32e4[_0x5adb('0x21')](_0x3c2b07[_0x5adb('0x21')]);return db[_0x5adb('0x95')][_0x5adb('0x39')](_0xaa32e4[_0x5adb('0x96')](),_0x1ceb72);})[_0x5adb('0x27')](function(_0x463e84){_0x1d6bef[_0x5adb('0x79')](_0x5adb('0xaa'),_[_0x5adb('0x2e')](_0x463e84,'id'));return db[_0x5adb('0x95')]['query'](_0x1d6bef['toString'](),_0x1ceb72)[_0x5adb('0x27')](function(_0x44756a){var _0x5c4053=_[_0x5adb('0xab')](_0x44756a,_0x5adb('0xac'));var _0x38acde=[];_0x463e84[_0x5adb('0x33')](function(_0x13426e){_0x38acde[_0x5adb('0x34')](updateWhatsappInteraction(_0x13426e,_0xdfecfd,_0x5c4053));});return BPromise[_0x5adb('0xad')](_0x38acde);});});})[_0x5adb('0x27')](function(_0x42dddf){_0x9bdece['rows']=_0x42dddf;return _0x9bdece;})[_0x5adb('0x27')](respondWithFilteredResult(_0x222568,_0x3c2b07));})[_0x5adb('0xae')](handleError(_0x222568,null));};exports[_0x5adb('0xaf')]=function(_0x4f0261,_0x312a90){var _0x284f79={'raw':![],'where':{'id':_0x4f0261[_0x5adb('0xb0')]['id']}},_0x2b6e56={};_0x2b6e56[_0x5adb('0x3b')]=_[_0x5adb('0x6f')](db['WhatsappInteraction'][_0x5adb('0x36')]);_0x2b6e56[_0x5adb('0x39')]=_[_0x5adb('0x6f')](_0x4f0261[_0x5adb('0x39')]);_0x2b6e56[_0x5adb('0x42')]=_[_0x5adb('0x3a')](_0x2b6e56[_0x5adb('0x3b')],_0x2b6e56[_0x5adb('0x39')]);_0x284f79[_0x5adb('0x3c')]=_[_0x5adb('0x3a')](_0x2b6e56['model'],qs[_0x5adb('0x3d')](_0x4f0261['query'][_0x5adb('0x3d')]));_0x284f79[_0x5adb('0x3c')]=_0x284f79[_0x5adb('0x3c')][_0x5adb('0x3e')]?_0x284f79[_0x5adb('0x3c')]:_0x2b6e56['model'];if(_0x4f0261['query'][_0x5adb('0xb1')]){_0x284f79[_0x5adb('0xb2')]=[{'all':!![]}];}_0x284f79=_[_0x5adb('0xb3')]({},_0x284f79,_0x4f0261[_0x5adb('0xb4')]);return db[_0x5adb('0x35')][_0x5adb('0x6a')](_0x284f79)['then'](handleEntityNotFound(_0x312a90,null))['then'](respondWithResult(_0x312a90,null))[_0x5adb('0xae')](handleError(_0x312a90,null));};exports[_0x5adb('0xb5')]=function(_0x9d80fd,_0x4f5721){return db['WhatsappInteraction'][_0x5adb('0xb5')](_0x9d80fd['body'],{})[_0x5adb('0x27')](respondWithResult(_0x4f5721,0xc9))[_0x5adb('0xae')](handleError(_0x4f5721,null));};exports['update']=function(_0x498ecc,_0x43b91c){if(_0x498ecc['body']['id']){delete _0x498ecc['body']['id'];}return db[_0x5adb('0x35')][_0x5adb('0x6a')]({'where':{'id':_0x498ecc[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x43b91c,null))[_0x5adb('0x27')](saveUpdates(_0x498ecc[_0x5adb('0x6e')],null))[_0x5adb('0x27')](respondWithResult(_0x43b91c,null))[_0x5adb('0xae')](handleError(_0x43b91c,null));};exports[_0x5adb('0x28')]=function(_0x31b696,_0x44cf6a){return db[_0x5adb('0x35')][_0x5adb('0x6a')]({'where':{'id':_0x31b696['params']['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x44cf6a,null))['then'](removeEntity(_0x44cf6a,null))[_0x5adb('0xae')](handleError(_0x44cf6a,null));};exports[_0x5adb('0xb6')]=function(_0x280f30,_0xad6905){return db[_0x5adb('0x35')][_0x5adb('0xb6')]()[_0x5adb('0x27')](respondWithResult(_0xad6905,null))[_0x5adb('0xae')](handleError(_0xad6905,null));};exports[_0x5adb('0xb7')]=function(_0x36a8f0,_0x41fa3c,_0x18fc00){return db['WhatsappMessage'][_0x5adb('0x6a')]({'where':{'id':_0x36a8f0[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x41fa3c,null))[_0x5adb('0x27')](function(_0x1da6bc){if(_0x1da6bc){return _0x1da6bc[_0x5adb('0xb7')](_0x36a8f0[_0x5adb('0x6e')][_0x5adb('0xb8')],_['omit'](_0x36a8f0[_0x5adb('0x6e')],[_0x5adb('0xb8'),'id'])||{});}})[_0x5adb('0x27')](respondWithResult(_0x41fa3c,null))['catch'](handleError(_0x41fa3c,null));};exports[_0x5adb('0xb9')]=function(_0x4ae211,_0x74065,_0x50c3a3){var _0x54da7c={'raw':![],'where':{}};var _0x173ead={};var _0x3796b7={'count':0x0,'rows':[]};return db[_0x5adb('0x35')][_0x5adb('0xba')]({'where':{'id':_0x4ae211[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x74065,null))[_0x5adb('0x27')](function(_0xa1911a){if(_0xa1911a){_0x173ead[_0x5adb('0x3b')]=_[_0x5adb('0x6f')](db[_0x5adb('0xbb')][_0x5adb('0x36')]);_0x173ead['query']=_[_0x5adb('0x6f')](_0x4ae211['query']);_0x173ead[_0x5adb('0x42')]=_[_0x5adb('0x3a')](_0x173ead['model'],_0x173ead[_0x5adb('0x39')]);_0x54da7c[_0x5adb('0x3c')]=_['intersection'](_0x173ead['model'],qs[_0x5adb('0x3d')](_0x4ae211[_0x5adb('0x39')][_0x5adb('0x3d')]));_0x54da7c[_0x5adb('0x3c')]=_0x54da7c[_0x5adb('0x3c')][_0x5adb('0x3e')]?_0x54da7c['attributes']:_0x173ead[_0x5adb('0x3b')];if(!_0x4ae211[_0x5adb('0x39')][_0x5adb('0xbc')](_0x5adb('0xbd'))){_0x54da7c[_0x5adb('0x3f')]=qs['limit'](_0x4ae211['query'][_0x5adb('0x3f')]);_0x54da7c[_0x5adb('0x21')]=qs[_0x5adb('0x21')](_0x4ae211[_0x5adb('0x39')][_0x5adb('0x21')]);}_0x54da7c[_0x5adb('0x40')]=qs[_0x5adb('0x41')](_0x4ae211[_0x5adb('0x39')][_0x5adb('0x41')]);_0x54da7c['where']=qs[_0x5adb('0x42')](_[_0x5adb('0x43')](_0x4ae211['query'],_0x173ead['filters']));_0x54da7c['where'][_0x5adb('0xac')]=_0xa1911a['id'];if(_0x4ae211[_0x5adb('0x39')][_0x5adb('0x81')]){_0x54da7c['where']=_['merge'](_0x54da7c[_0x5adb('0x79')],{'$or':_[_0x5adb('0x2e')](_0x54da7c[_0x5adb('0x3c')],function(_0x3d2a5b){var _0x3b367f={};_0x3b367f[_0x3d2a5b]={'$like':'%'+_0x4ae211[_0x5adb('0x39')]['filter']+'%'};return _0x3b367f;})});}if(_0x4ae211['query'][_0x5adb('0xbe')]){var _0x5a9e55=_0x4ae211[_0x5adb('0x39')][_0x5adb('0xbe')]['split'](',');var _0x7151b8={};_0x7151b8[_0x5a9e55[0x0]]={'$gte':moment(_0x5a9e55[0x1])[_0x5adb('0xbf')](_0x5adb('0xc0'))};_0x54da7c[_0x5adb('0x79')]=_['merge'](_0x54da7c[_0x5adb('0x79')],_0x7151b8);}_0x54da7c=_[_0x5adb('0xb3')]({},_0x54da7c,_0x4ae211[_0x5adb('0xb4')]);return db[_0x5adb('0xbb')]['count']({'where':_0x54da7c[_0x5adb('0x79')]})['then'](function(_0x29cc2f){_0x3796b7[_0x5adb('0x97')]=_0x29cc2f;if(_0x4ae211[_0x5adb('0x39')][_0x5adb('0xb1')]){_0x54da7c[_0x5adb('0xb2')]=[{'all':!![]}];}return db[_0x5adb('0xbb')]['findAll'](_0x54da7c);})[_0x5adb('0x27')](function(_0x49e908){_0x3796b7[_0x5adb('0xc1')]=_0x49e908;return _0x3796b7;});}})[_0x5adb('0x27')](respondWithFilteredResult(_0x74065,_0x54da7c))['catch'](handleError(_0x74065,null));};exports[_0x5adb('0xc2')]=function(_0x52e44f,_0x5a517a,_0x4d50f7){return db[_0x5adb('0x35')]['find']({'where':{'id':_0x52e44f['params']['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x5a517a,null))[_0x5adb('0x27')](function(_0x325f86){if(_0x325f86){return _0x325f86[_0x5adb('0xc3')](_0x52e44f[_0x5adb('0x6e')][_0x5adb('0xb8')],_[_0x5adb('0xc4')](_0x52e44f['body'],[_0x5adb('0xb8'),'id'])||{})[_0x5adb('0xc5')](function(){return db['Tag'][_0x5adb('0xc6')]({'attributes':['id',_0x5adb('0x2b'),_0x5adb('0xc7')],'where':{'id':_0x52e44f[_0x5adb('0x6e')][_0x5adb('0xb8')]}});})[_0x5adb('0x27')](function(_0x3a88ab){socket[_0x5adb('0xc8')](_0x5adb('0xc9'),{'id':Number(_0x52e44f[_0x5adb('0xb0')]['id']),'tags':_0x3a88ab||[]});return{'id':Number(_0x52e44f[_0x5adb('0xb0')]['id']),'tags':_0x3a88ab||[]};});}})[_0x5adb('0x27')](respondWithResult(_0x5a517a,null))['catch'](handleError(_0x5a517a,null));};exports['removeTags']=function(_0x2376a6,_0x282c11,_0x35a718){return db[_0x5adb('0x35')]['find']({'where':{'id':_0x2376a6[_0x5adb('0xb0')]['id']}})[_0x5adb('0x27')](handleEntityNotFound(_0x282c11,null))[_0x5adb('0x27')](function(_0xb9ac38){if(_0xb9ac38){return _0xb9ac38[_0x5adb('0xca')](_0x2376a6['query']['ids']);}})[_0x5adb('0x27')](respondWithStatusCode(_0x282c11,null))['catch'](handleError(_0x282c11,null));};exports[_0x5adb('0xcb')]=function(_0x64fae1,_0x3ad256){var _0x2b4228=moment()[_0x5adb('0xcc')]()[_0x5adb('0x96')]();var _0x5e17ea=path[_0x5adb('0xcd')](config[_0x5adb('0xce')],_0x5adb('0xcf'),_0x5adb('0xd0'),_0x5adb('0xd1'));var _0xabc1ee=path[_0x5adb('0xcd')](config['root'],'server','files',_0x5adb('0xd2'));var _0x5ae730=path[_0x5adb('0xcd')](_0x5e17ea,_0x2b4228);var _0x5983ef=util['format'](_0x5adb('0xd3'),_0x64fae1[_0x5adb('0xb0')]['id'],_0x2b4228);var _0x5e74dc=path['join'](_0x5e17ea,_0x5983ef);var _0x3612c=[];_0x3612c[_0x5adb('0x34')]({'model':db[_0x5adb('0x68')],'as':'User','attributes':['id',_0x5adb('0x2f')],'raw':!![]});_0x3612c['push']({'model':db['CmContact'],'as':_0x5adb('0x5d'),'attributes':['id',_0x5adb('0xd4'),_0x5adb('0xd5')],'raw':!![]});if(_0x64fae1['query']['attachments']){_0x3612c[_0x5adb('0x34')]({'model':db[_0x5adb('0xd6')],'as':'Attachment','raw':!![]});}var _0x5366d4=[{'model':db[_0x5adb('0xbb')],'as':_0x5adb('0xd7'),'attributes':['id','body',_0x5adb('0x75'),'direction',_0x5adb('0xd8'),'read'],'include':_0x3612c}];_0x5366d4[_0x5adb('0x34')]({'model':db[_0x5adb('0xd9')],'as':_0x5adb('0xda'),'attributes':['id',_0x5adb('0x2b')]});_0x5366d4[_0x5adb('0x34')]({'model':db['User'],'as':_0x5adb('0xdb'),'attributes':['id',_0x5adb('0x2f')]});return db[_0x5adb('0x35')]['find']({'where':{'id':_0x64fae1[_0x5adb('0xb0')]['id']},'include':_0x5366d4})[_0x5adb('0x27')](handleEntityNotFound(_0x3ad256,null))[_0x5adb('0x27')](function(_0x45526a){if(_0x45526a){var _0x57607e=_0x45526a[_0x5adb('0xdc')]({'plain':!![]});fs[_0x5adb('0xdd')](_0x5ae730);var _0x3bbe7c={'format':'A4','border':'10px','header':{'height':_0x5adb('0xde'),'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':_0x5adb('0xdf'),'contents':{'default':util[_0x5adb('0xbf')](_0x5adb('0xe0'),util[_0x5adb('0xbf')](_0x5adb('0xe1'),'Whatsapp',_0x57607e['id']),moment()['format']('YYYY-MM-DD')[_0x5adb('0x96')]())}}};var _0x4a1b54={'channel':'Whatsapp','account':_0x57607e[_0x5adb('0xda')][_0x5adb('0x2b')],'agent':_0x57607e[_0x5adb('0xdb')]?_0x57607e[_0x5adb('0xdb')][_0x5adb('0x2f')]:_0x5adb('0xe2'),'createdAt':moment(_0x57607e[_0x5adb('0x75')])[_0x5adb('0xbf')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5adb('0x96')](),'closedAt':_0x57607e[_0x5adb('0xe3')]?moment(_0x57607e['closedAt'])[_0x5adb('0xbf')](_0x5adb('0xc0'))['toString']():'','disposition':_0x57607e[_0x5adb('0xe4')],'messages':_(_0x57607e['Messages'])[_0x5adb('0x81')]({'secret':![]})[_0x5adb('0x2e')](function(_0x3d782b){if(_0x3d782b[_0x5adb('0xd6')]){var _0x651279=path[_0x5adb('0xcd')](_0xabc1ee,_0x3d782b[_0x5adb('0xd6')][_0x5adb('0xe5')]);if(fs['existsSync'](_0x651279)){fs[_0x5adb('0xe6')](_0x651279)['pipe'](fs[_0x5adb('0xe7')](path['join'](_0x5ae730,_0x3d782b[_0x5adb('0xd6')]['basename'])));}}return{'date':moment(_0x3d782b[_0x5adb('0x75')])[_0x5adb('0xbf')](_0x5adb('0xc0'))[_0x5adb('0x96')](),'sender':_0x3d782b[_0x5adb('0xe8')]===_0x5adb('0xe9')?_0x3d782b[_0x5adb('0x68')]?_0x3d782b[_0x5adb('0x68')][_0x5adb('0x2f')]:_0x5adb('0xea'):_0x3d782b[_0x5adb('0x5d')][_0x5adb('0xd4')]+(_0x3d782b[_0x5adb('0x5d')]['lastName']?'\x20'+_0x3d782b[_0x5adb('0x5d')]['lastName']:''),'body':_0x3d782b[_0x5adb('0xd6')]?_0x3d782b[_0x5adb('0xd6')][_0x5adb('0xe5')]:_0x3d782b['body'],'direction':_0x3d782b['direction']==='out'?'A':'C','secret':_0x3d782b['secret'],'read':_0x3d782b[_0x5adb('0x7c')],'attachment':_0x3d782b[_0x5adb('0xd6')]};})[_0x5adb('0x5f')]()};return ejs[_0x5adb('0xeb')](path[_0x5adb('0xcd')](config[_0x5adb('0xce')],_0x5adb('0xcf'),_0x5adb('0xec'),_0x5adb('0xed')),{'interaction':_0x4a1b54})['then'](function(_0x39bf82){return new BPromise(function(_0x197b7f,_0x171fb9){pdf[_0x5adb('0xb5')](_0x39bf82,_0x3bbe7c)[_0x5adb('0xee')](path[_0x5adb('0xcd')](_0x5ae730,'transcript-'+_0x57607e['id']+'-'+_0x2b4228+'.pdf'),function(_0x4edb9e,_0x25f1f7){if(_0x4edb9e)return _0x171fb9(_0x4edb9e);_0x197b7f(_0x25f1f7);});});})[_0x5adb('0x27')](function(){return new BPromise(function(_0xb81dd2,_0x2b753d){zipdir(_0x5ae730,{'saveTo':_0x5e74dc},function(_0x27eb1e,_0x5eef55){if(_0x27eb1e)return _0x2b753d(_0x27eb1e);return _0xb81dd2(_0x5eef55);});})[_0x5adb('0x27')](function(){return new BPromise(function(_0x2cb713,_0x2034d7){rimraf(_0x5ae730,function(_0x3dd67b){if(_0x3dd67b)_0x2034d7(_0x3dd67b);return _0x2cb713();});});})[_0x5adb('0x27')](function(){return _0x3ad256[_0x5adb('0xcb')](_0x5e74dc,_0x5983ef,function(_0x38c24d){if(_0x38c24d){console[_0x5adb('0xef')](_0x5adb('0xf0'),_0x38c24d);}else{fs[_0x5adb('0xf1')](_0x5e74dc);}});});});}else{return _0x3ad256[_0x5adb('0x1d')](0xc8);}})[_0x5adb('0xae')](handleError(_0x3ad256,null));}; \ No newline at end of file +var _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','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','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','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','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x70327a,_0x3ca3df){var _0x255206=function(_0x4f4652){while(--_0x4f4652){_0x70327a['push'](_0x70327a['shift']());}};_0x255206(++_0x3ca3df);}(_0x814b,0x1a2));var _0xb814=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0x814b[_0x250f95];return _0x4ada97;};'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'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')]('\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[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index d2ed0f1..239681e 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 _0x143a=['WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','remove','then','setDataValue','findAll','length','emit','catch','hasOwnProperty','hook','exports','events'];(function(_0x1bb58c,_0x2c8a4d){var _0x277586=function(_0x11fd4c){while(--_0x11fd4c){_0x1bb58c['push'](_0x1bb58c['shift']());}};_0x277586(++_0x2c8a4d);}(_0x143a,0x1c1));var _0xa143=function(_0x239ea0,_0x573983){_0x239ea0=_0x239ea0-0x0;var _0x25a3eb=_0x143a[_0x239ea0];return _0x25a3eb;};'use strict';var EventEmitter=require(_0xa143('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xa143('0x1')];var WhatsappMessage=require(_0xa143('0x2'))['db'][_0xa143('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xa143('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa143('0x5')};function emitEvent(_0x12f22a){return function(_0x513195,_0x1fe314,_0x4ea719){_0x513195['getUsers']({'attributes':['id'],'raw':!![]})[_0xa143('0x6')](function(_0xe4ecbb){_0x513195[_0xa143('0x7')]('Users',_0xe4ecbb['map'](function(_0x24ee7b){return{'id':_0x24ee7b['id']};}));return WhatsappMessage[_0xa143('0x8')]({'where':{'WhatsappInteractionId':_0x513195['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa143('0x6')](function(_0x1e4897){_0x513195[_0xa143('0x7')]('unreadMessages',_0x1e4897[_0xa143('0x9')]);WhatsappInteractionEvents[_0xa143('0xa')](_0x12f22a+':'+_0x513195['id'],_0x513195);WhatsappInteractionEvents[_0xa143('0xa')](_0x12f22a,_0x513195);_0x4ea719(null);})[_0xa143('0xb')](_0x4ea719(null));};}for(var e in events){if(events[_0xa143('0xc')](e)){var event=events[e];WhatsappInteraction[_0xa143('0xd')](e,emitEvent(event));}}module[_0xa143('0xe')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xc7c6=['findAll','emit','catch','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x2bcb1e,_0x2afd1d){var _0x53e732=function(_0x38a0d4){while(--_0x38a0d4){_0x2bcb1e['push'](_0x2bcb1e['shift']());}};_0x53e732(++_0x2afd1d);}(_0xc7c6,0x85));var _0x6c7c=function(_0x17c7d4,_0x2e0021){_0x17c7d4=_0x17c7d4-0x0;var _0x5757a7=_0xc7c6[_0x17c7d4];return _0x5757a7;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x6c7c('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x6c7c('0x0'))['db'][_0x6c7c('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6c7c('0x2')](0x0);var events={'afterCreate':_0x6c7c('0x3'),'afterUpdate':_0x6c7c('0x4'),'afterDestroy':_0x6c7c('0x5')};function emitEvent(_0x168a15){return function(_0x66b4,_0x28ed18,_0x1aa8b0){_0x66b4[_0x6c7c('0x6')]({'attributes':['id'],'raw':!![]})[_0x6c7c('0x7')](function(_0x403328){_0x66b4[_0x6c7c('0x8')](_0x6c7c('0x9'),_0x403328[_0x6c7c('0xa')](function(_0x1111b2){return{'id':_0x1111b2['id']};}));return WhatsappMessage[_0x6c7c('0xb')]({'where':{'WhatsappInteractionId':_0x66b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1dee0f){_0x66b4[_0x6c7c('0x8')]('unreadMessages',_0x1dee0f['length']);WhatsappInteractionEvents[_0x6c7c('0xc')](_0x168a15+':'+_0x66b4['id'],_0x66b4);WhatsappInteractionEvents[_0x6c7c('0xc')](_0x168a15,_0x66b4);_0x1aa8b0(null);})[_0x6c7c('0xd')](_0x1aa8b0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x6c7c('0xe')](e,emitEvent(event));}}module[_0x6c7c('0xf')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 9aa69bb..d616e6e 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(_0x1cf96f,_0x22623f){var _0x3606db=function(_0x28af37){while(--_0x28af37){_0x1cf96f['push'](_0x1cf96f['shift']());}};_0x3606db(++_0x22623f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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(_0xc6d77a,_0x4cd6fe){var _0x567b42=function(_0x48a279){while(--_0x48a279){_0xc6d77a['push'](_0xc6d77a['shift']());}};_0x567b42(++_0x4cd6fe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 e77e3dd..e3a54b4 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 _0x0d9d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','redis','./whatsappInteraction.socket','register','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','update','options','raw','attributes','limit','UpdateWhatsappInteraction','WhatsappInteraction','where','addTags','omit','body','ids','spread','AddTags','lodash','util','moment','randomstring'];(function(_0xa5cff3,_0x16fed7){var _0x50319e=function(_0x5dbc99){while(--_0x5dbc99){_0xa5cff3['push'](_0xa5cff3['shift']());}};_0x50319e(++_0x16fed7);}(_0x0d9d,0xd3));var _0xd0d9=function(_0x16ce60,_0x29737e){_0x16ce60=_0x16ce60-0x0;var _0xe0d487=_0x0d9d[_0x16ce60];return _0xe0d487;};'use strict';var _=require(_0xd0d9('0x0'));var util=require(_0xd0d9('0x1'));var moment=require(_0xd0d9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0d9('0x4'))['db'];var utils=require(_0xd0d9('0x5'));var logger=require(_0xd0d9('0x6'))(_0xd0d9('0x7'));var config=require(_0xd0d9('0x8'));var jayson=require(_0xd0d9('0x9'));var client=jayson['client'][_0xd0d9('0xa')]({'port':0x232a});config['redis']=_[_0xd0d9('0xb')](config['redis'],{'host':_0xd0d9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd0d9('0xd')]));require(_0xd0d9('0xe'))[_0xd0d9('0xf')](socket);function respondWithRpcPromise(_0x15ecb2,_0xdc0b87,_0x445b84){return new BPromise(function(_0x1baa11,_0x1c5b42){return client[_0xd0d9('0x10')](_0x15ecb2,_0x445b84)[_0xd0d9('0x11')](function(_0x457963){logger[_0xd0d9('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0xdc0b87,_0xd0d9('0x13'));logger[_0xd0d9('0x14')](_0xd0d9('0x15'),_0xdc0b87,_0xd0d9('0x13'),JSON[_0xd0d9('0x16')](_0x457963));if(_0x457963[_0xd0d9('0x17')]){if(_0x457963['error'][_0xd0d9('0x18')]===0x1f4){logger['error'](_0xd0d9('0x19'),_0xdc0b87,_0x457963[_0xd0d9('0x17')][_0xd0d9('0x1a')]);return _0x1c5b42(_0x457963[_0xd0d9('0x17')][_0xd0d9('0x1a')]);}logger[_0xd0d9('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0xdc0b87,_0x457963[_0xd0d9('0x17')][_0xd0d9('0x1a')]);return _0x1baa11(_0x457963[_0xd0d9('0x17')]['message']);}else{logger['info'](_0xd0d9('0x19'),_0xdc0b87,'request\x20sent');_0x1baa11(_0x457963[_0xd0d9('0x1b')][_0xd0d9('0x1a')]);}})[_0xd0d9('0x1c')](function(_0x37d360){logger['error'](_0xd0d9('0x19'),_0xdc0b87,_0x37d360);_0x1c5b42(_0x37d360);});});}exports['UpdateWhatsappInteraction']=function(_0x8b6ac2){var _0x49f925=this;return new Promise(function(_0x1c04b0,_0x53b5de){return db['WhatsappInteraction'][_0xd0d9('0x1d')](_0x8b6ac2['body'],{'raw':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2['options'][_0xd0d9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2[_0xd0d9('0x1e')]['where']||null:null,'attributes':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2[_0xd0d9('0x1e')][_0xd0d9('0x20')]||null:null,'limit':_0x8b6ac2[_0xd0d9('0x1e')]?_0x8b6ac2[_0xd0d9('0x1e')][_0xd0d9('0x21')]||null:null})['then'](function(_0x5cdd30){logger[_0xd0d9('0x12')](_0xd0d9('0x22'),_0x8b6ac2);logger[_0xd0d9('0x14')](_0xd0d9('0x22'),_0x8b6ac2,JSON[_0xd0d9('0x16')](_0x5cdd30));_0x1c04b0(_0x5cdd30);})['catch'](function(_0x1962b7){logger[_0xd0d9('0x17')](_0xd0d9('0x22'),_0x1962b7[_0xd0d9('0x1a')],_0x8b6ac2);_0x53b5de(_0x49f925[_0xd0d9('0x17')](0x1f4,_0x1962b7[_0xd0d9('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x267653){return new Promise(function(_0x52c2a6,_0x162e76){return db[_0xd0d9('0x23')]['find']({'where':_0x267653['options']?_0x267653['options'][_0xd0d9('0x24')]||null:null})[_0xd0d9('0x11')](function(_0x31a160){if(_0x31a160){return _0x31a160[_0xd0d9('0x25')](_0x267653['body']['ids'],_[_0xd0d9('0x26')](_0x267653[_0xd0d9('0x27')],[_0xd0d9('0x28'),'id'])||{});}})[_0xd0d9('0x29')](function(_0x3d1e70){logger[_0xd0d9('0x12')](_0xd0d9('0x2a'),_0x267653);logger[_0xd0d9('0x14')]('AddTags',_0x267653,JSON['stringify'](_0x3d1e70));_0x52c2a6(_0x3d1e70);})[_0xd0d9('0x1c')](function(_0x5a5eff){logger[_0xd0d9('0x17')](_0xd0d9('0x2a'),_0x5a5eff[_0xd0d9('0x1a')],_0x267653);_0x162e76(_this[_0xd0d9('0x17')](0x1f4,_0x5a5eff[_0xd0d9('0x1a')]));});});}; \ No newline at end of file +var _0x6dc5=['catch','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','addTags','ids','omit','spread','AddTags'];(function(_0x2ce033,_0x43fc42){var _0x5410c1=function(_0x4c4bb9){while(--_0x4c4bb9){_0x2ce033['push'](_0x2ce033['shift']());}};_0x5410c1(++_0x43fc42);}(_0x6dc5,0x1a3));var _0x56dc=function(_0x385e05,_0x5d25ca){_0x385e05=_0x385e05-0x0;var _0x10660d=_0x6dc5[_0x385e05];return _0x10660d;};'use strict';var _=require('lodash');var util=require(_0x56dc('0x0'));var moment=require(_0x56dc('0x1'));var BPromise=require('bluebird');var rs=require(_0x56dc('0x2'));var fs=require('fs');var Redis=require(_0x56dc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x56dc('0x4'))(_0x56dc('0x5'));var config=require(_0x56dc('0x6'));var jayson=require(_0x56dc('0x7'));var client=jayson['client'][_0x56dc('0x8')]({'port':0x232a});config[_0x56dc('0x9')]=_[_0x56dc('0xa')](config[_0x56dc('0x9')],{'host':_0x56dc('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56dc('0x9')]));require(_0x56dc('0xc'))[_0x56dc('0xd')](socket);function respondWithRpcPromise(_0x1a7bd8,_0x1d93e9,_0x56d57d){return new BPromise(function(_0x1e6739,_0x5b802f){return client['request'](_0x1a7bd8,_0x56d57d)[_0x56dc('0xe')](function(_0x7015e8){logger[_0x56dc('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d93e9,_0x56dc('0x10'));logger[_0x56dc('0x11')](_0x56dc('0x12'),_0x1d93e9,_0x56dc('0x10'),JSON[_0x56dc('0x13')](_0x7015e8));if(_0x7015e8[_0x56dc('0x14')]){if(_0x7015e8[_0x56dc('0x14')][_0x56dc('0x15')]===0x1f4){logger[_0x56dc('0x14')](_0x56dc('0x16'),_0x1d93e9,_0x7015e8[_0x56dc('0x14')][_0x56dc('0x17')]);return _0x5b802f(_0x7015e8[_0x56dc('0x14')]['message']);}logger[_0x56dc('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d93e9,_0x7015e8[_0x56dc('0x14')][_0x56dc('0x17')]);return _0x1e6739(_0x7015e8[_0x56dc('0x14')][_0x56dc('0x17')]);}else{logger[_0x56dc('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1d93e9,'request\x20sent');_0x1e6739(_0x7015e8[_0x56dc('0x18')]['message']);}})['catch'](function(_0x2a11cb){logger[_0x56dc('0x14')](_0x56dc('0x16'),_0x1d93e9,_0x2a11cb);_0x5b802f(_0x2a11cb);});});}exports[_0x56dc('0x19')]=function(_0x5ec0ae){var _0x25ee11=this;return new Promise(function(_0x315c25,_0x35fa98){return db[_0x56dc('0x1a')]['update'](_0x5ec0ae[_0x56dc('0x1b')],{'raw':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae[_0x56dc('0x1c')][_0x56dc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae[_0x56dc('0x1c')][_0x56dc('0x1e')]||null:null,'attributes':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae['options']['attributes']||null:null,'limit':_0x5ec0ae[_0x56dc('0x1c')]?_0x5ec0ae[_0x56dc('0x1c')][_0x56dc('0x1f')]||null:null})['then'](function(_0x577d6c){logger[_0x56dc('0xf')](_0x56dc('0x19'),_0x5ec0ae);logger[_0x56dc('0x11')](_0x56dc('0x19'),_0x5ec0ae,JSON[_0x56dc('0x13')](_0x577d6c));_0x315c25(_0x577d6c);})['catch'](function(_0x447e13){logger[_0x56dc('0x14')](_0x56dc('0x19'),_0x447e13['message'],_0x5ec0ae);_0x35fa98(_0x25ee11['error'](0x1f4,_0x447e13[_0x56dc('0x17')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x10465f){return new Promise(function(_0xafa366,_0x299a95){return db[_0x56dc('0x1a')]['find']({'where':_0x10465f[_0x56dc('0x1c')]?_0x10465f['options']['where']||null:null})[_0x56dc('0xe')](function(_0x26a0cd){if(_0x26a0cd){return _0x26a0cd[_0x56dc('0x20')](_0x10465f[_0x56dc('0x1b')][_0x56dc('0x21')],_[_0x56dc('0x22')](_0x10465f[_0x56dc('0x1b')],[_0x56dc('0x21'),'id'])||{});}})[_0x56dc('0x23')](function(_0x43b173){logger[_0x56dc('0xf')](_0x56dc('0x24'),_0x10465f);logger[_0x56dc('0x11')](_0x56dc('0x24'),_0x10465f,JSON[_0x56dc('0x13')](_0x43b173));_0xafa366(_0x43b173);})[_0x56dc('0x25')](function(_0x2b8dfa){logger[_0x56dc('0x14')](_0x56dc('0x24'),_0x2b8dfa[_0x56dc('0x17')],_0x10465f);_0x299a95(_this['error'](0x1f4,_0x2b8dfa['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index d34d7e8..aa617c7 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 _0xa287=['register','whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener'];(function(_0x4eed21,_0x17e95b){var _0x95c302=function(_0x44b2b0){while(--_0x44b2b0){_0x4eed21['push'](_0x4eed21['shift']());}};_0x95c302(++_0x17e95b);}(_0xa287,0x198));var _0x7a28=function(_0x1ca29f,_0x318ac5){_0x1ca29f=_0x1ca29f-0x0;var _0x576c3b=_0xa287[_0x1ca29f];return _0x576c3b;};'use strict';var WhatsappInteractionEvents=require(_0x7a28('0x0'));var events=['save',_0x7a28('0x1'),_0x7a28('0x2')];function createListener(_0x2178d6,_0x35b402){return function(_0x33be4d){_0x35b402[_0x7a28('0x3')](_0x2178d6,_0x33be4d);};}function removeListener(_0x45b0d0,_0x1a6558){return function(){WhatsappInteractionEvents[_0x7a28('0x4')](_0x45b0d0,_0x1a6558);};}exports[_0x7a28('0x5')]=function(_0x2c1e56){for(var _0x40446d=0x0,_0x529eaf=events['length'];_0x40446d<_0x529eaf;_0x40446d++){var _0x5b9f7b=events[_0x40446d];var _0x358720=createListener(_0x7a28('0x6')+_0x5b9f7b,_0x2c1e56);WhatsappInteractionEvents['on'](_0x5b9f7b,_0x358720);}}; \ No newline at end of file +var _0xb44d=['emit','removeListener','register','./whatsappInteraction.events','save','remove','update'];(function(_0x133675,_0x2f3b8c){var _0xc19366=function(_0x491264){while(--_0x491264){_0x133675['push'](_0x133675['shift']());}};_0xc19366(++_0x2f3b8c);}(_0xb44d,0x1d1));var _0xdb44=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xb44d[_0x2f5ac5];return _0x37c9a8;};'use strict';var WhatsappInteractionEvents=require(_0xdb44('0x0'));var events=[_0xdb44('0x1'),_0xdb44('0x2'),_0xdb44('0x3')];function createListener(_0x2e9128,_0x2d929a){return function(_0x5da684){_0x2d929a[_0xdb44('0x4')](_0x2e9128,_0x5da684);};}function removeListener(_0x4a14c7,_0x2d22ea){return function(){WhatsappInteractionEvents[_0xdb44('0x5')](_0x4a14c7,_0x2d22ea);};}exports[_0xdb44('0x6')]=function(_0x27d030){for(var _0x35b6b7=0x0,_0x29cd5e=events['length'];_0x35b6b7<_0x29cd5e;_0x35b6b7++){var _0x5189b9=events[_0x35b6b7];var _0x18ddee=createListener('whatsappInteraction:'+_0x5189b9,_0x27d030);WhatsappInteractionEvents['on'](_0x5189b9,_0x18ddee);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 87b54ef..d5661c9 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 _0x38cd=['show','post','tracked','whatsappmessage:create','create','/:id/status','status','update','put','accept','/:id/reject','reject','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x38cd,0x102));var _0xd38c=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x38cd[_0x2ec461];return _0x28603d;};'use strict';var multer=require(_0xd38c('0x0'));var util=require(_0xd38c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd38c('0x2')]();var auth=require(_0xd38c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd38c('0x4'));var controller=require(_0xd38c('0x5'));router['get']('/',auth[_0xd38c('0x6')](),controller[_0xd38c('0x7')]);router[_0xd38c('0x8')](_0xd38c('0x9'),auth['isAuthenticated'](),controller[_0xd38c('0xa')]);router['get'](_0xd38c('0xb'),auth[_0xd38c('0x6')](),controller[_0xd38c('0xc')]);router[_0xd38c('0xd')]('/',auth[_0xd38c('0x6')](),interaction[_0xd38c('0xe')]('whatsapp',_0xd38c('0xf')),controller[_0xd38c('0x10')]);router['post'](_0xd38c('0x11'),controller[_0xd38c('0x12')]);router['put'](_0xd38c('0xb'),auth['isAuthenticated'](),controller[_0xd38c('0x13')]);router[_0xd38c('0x14')]('/:id/accept',auth[_0xd38c('0x6')](),controller[_0xd38c('0x15')]);router[_0xd38c('0x14')](_0xd38c('0x16'),auth['isAuthenticated'](),controller[_0xd38c('0x17')]);router[_0xd38c('0x18')](_0xd38c('0xb'),auth[_0xd38c('0x6')](),controller[_0xd38c('0x19')]);module[_0xd38c('0x1a')]=router; \ No newline at end of file +var _0x05a8=['isAuthenticated','describe','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id','accept','reject','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./whatsappMessage.controller','get'];(function(_0x5ae549,_0x5858c1){var _0x5ba749=function(_0x14efa6){while(--_0x14efa6){_0x5ae549['push'](_0x5ae549['shift']());}};_0x5ba749(++_0x5858c1);}(_0x05a8,0x1f1));var _0x805a=function(_0x5670af,_0x5a8e09){_0x5670af=_0x5670af-0x0;var _0x41b33a=_0x05a8[_0x5670af];return _0x41b33a;};'use strict';var multer=require(_0x805a('0x0'));var util=require(_0x805a('0x1'));var path=require(_0x805a('0x2'));var timeout=require(_0x805a('0x3'));var express=require(_0x805a('0x4'));var router=express[_0x805a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x805a('0x6'));var controller=require(_0x805a('0x7'));router[_0x805a('0x8')]('/',auth[_0x805a('0x9')](),controller['index']);router[_0x805a('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x805a('0xa')]);router[_0x805a('0x8')]('/:id',auth[_0x805a('0x9')](),controller[_0x805a('0xb')]);router[_0x805a('0xc')]('/',auth[_0x805a('0x9')](),interaction[_0x805a('0xd')](_0x805a('0xe'),_0x805a('0xf')),controller['create']);router[_0x805a('0xc')](_0x805a('0x10'),controller[_0x805a('0x11')]);router[_0x805a('0x12')](_0x805a('0x13'),auth[_0x805a('0x9')](),controller['update']);router[_0x805a('0x12')]('/:id/accept',auth[_0x805a('0x9')](),controller[_0x805a('0x14')]);router[_0x805a('0x12')]('/:id/reject',auth[_0x805a('0x9')](),controller[_0x805a('0x15')]);router['delete']('/:id',auth[_0x805a('0x9')](),controller['destroy']);module[_0x805a('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index b7c430d..c43103b 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 _0xbf83=['STRING','sequelize','exports','TEXT','BOOLEAN','out'];(function(_0x5b71f2,_0x29b721){var _0x56c560=function(_0x2fe66c){while(--_0x2fe66c){_0x5b71f2['push'](_0x5b71f2['shift']());}};_0x56c560(++_0x29b721);}(_0xbf83,0xf7));var _0x3bf8=function(_0x22a597,_0x903246){_0x22a597=_0x22a597-0x0;var _0x6167a0=_0xbf83[_0x22a597];return _0x6167a0;};'use strict';var Sequelize=require(_0x3bf8('0x0'));module[_0x3bf8('0x1')]={'body':{'type':Sequelize[_0x3bf8('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3bf8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3bf8('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x3bf8('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x56dc=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x56dc,0xfd));var _0xc56d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x56dc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc56d('0x0'));module['exports']={'body':{'type':Sequelize[_0xc56d('0x1')](_0xc56d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xc56d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc56d('0x4')]('in',_0xc56d('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xc56d('0x6')](0xbe)},'phone':{'type':Sequelize[_0xc56d('0x6')]},'readAt':{'type':Sequelize[_0xc56d('0x7')]},'secret':{'type':Sequelize[_0xc56d('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 642174d..5706544 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 _0x4b81=['event','EventManager','acceptmessage','agent','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','destroy','stack','name','send','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','includeAll','include','params','options','find','create','update','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','UserId','user','CmContact','Contact','get','isNil','read1stAt','format','interaction','role','null','acceptMessage','manual','interface','SIP/%s','channel'];(function(_0x49ad0d,_0x4152ec){var _0x4d6886=function(_0x3d2dda){while(--_0x3d2dda){_0x49ad0d['push'](_0x49ad0d['shift']());}};_0x4d6886(++_0x4152ec);}(_0x4b81,0x110));var _0x14b8=function(_0x238f83,_0xf1d44e){_0x238f83=_0x238f83-0x0;var _0x1ee02b=_0x4b81[_0x238f83];return _0x1ee02b;};'use strict';var pdf=require(_0x14b8('0x0'));var emlformat=require(_0x14b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14b8('0x2'));var BPromise=require(_0x14b8('0x3'));var Mustache=require(_0x14b8('0x4'));var util=require(_0x14b8('0x5'));var path=require(_0x14b8('0x6'));var sox=require('sox');var csv=require(_0x14b8('0x7'));var ejs=require(_0x14b8('0x8'));var fs=require('fs');var _=require(_0x14b8('0x9'));var squel=require(_0x14b8('0xa'));var crypto=require('crypto');var jsforce=require(_0x14b8('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x14b8('0xc'));var Papa=require(_0x14b8('0xd'));var Redis=require(_0x14b8('0xe'));var authService=require(_0x14b8('0xf'));var qs=require(_0x14b8('0x10'));var as=require(_0x14b8('0x11'));var hardwareService=require(_0x14b8('0x12'));var logger=require(_0x14b8('0x13'))(_0x14b8('0x14'));var utils=require('../../config/utils');var config=require(_0x14b8('0x15'));var db=require(_0x14b8('0x16'))['db'];config['redis']=_[_0x14b8('0x17')](config[_0x14b8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x14b8('0x19'))(new Redis(config[_0x14b8('0x18')]));require(_0x14b8('0x1a'))[_0x14b8('0x1b')](socket);var jayson=require(_0x14b8('0x1c'));var client=jayson[_0x14b8('0x1d')][_0x14b8('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x14b8('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x39acbc,_0x28741d,_0x520c7a){if(_0x520c7a){var _0x25d72f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25d72f[_0x14b8('0x1f')](_0x28741d)){return _0x39acbc;}else{throw new db[(_0x14b8('0x20'))]['ValidationError'](_0x14b8('0x21'));}}else{return _0x39acbc;}}function respondWithRpcPromise(_0x19dbde,_0x70552b,_0x5c1e17,_0x364a93){return new BPromise(function(_0x1e243e,_0x110b1d){var _0xbb9156=_0x364a93||client;return _0xbb9156['request'](_0x19dbde,_0x5c1e17)[_0x14b8('0x22')](function(_0x3fd236){logger['info'](_0x14b8('0x23'),_0x70552b,_0x14b8('0x24'));logger[_0x14b8('0x25')](_0x14b8('0x26'),_0x70552b,_0x14b8('0x24'),JSON[_0x14b8('0x27')](_0x3fd236));if(_0x3fd236[_0x14b8('0x28')]){if(_0x3fd236[_0x14b8('0x28')][_0x14b8('0x29')]===0x1f4){logger[_0x14b8('0x28')](_0x14b8('0x23'),_0x70552b,_0x3fd236['error'][_0x14b8('0x2a')]);return _0x110b1d(_0x3fd236[_0x14b8('0x28')][_0x14b8('0x2a')]);}logger['error'](_0x14b8('0x23'),_0x70552b,_0x3fd236[_0x14b8('0x28')]['message']);return _0x1e243e(_0x3fd236[_0x14b8('0x28')]['message']);}else{logger[_0x14b8('0x2b')](_0x14b8('0x23'),_0x70552b,'request\x20sent');_0x1e243e(_0x3fd236[_0x14b8('0x2c')][_0x14b8('0x2a')]);}})[_0x14b8('0x2d')](function(_0x5b96f7){logger[_0x14b8('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x70552b,_0x5b96f7);_0x110b1d(_0x5b96f7);});});}function respondWithStatusCode(_0x5cd9f9,_0x3c092a){_0x3c092a=_0x3c092a||0xcc;return function(_0x41c9cf){if(_0x41c9cf){return _0x5cd9f9[_0x14b8('0x2e')](_0x3c092a);}return _0x5cd9f9[_0x14b8('0x2f')](_0x3c092a)[_0x14b8('0x30')]();};}function respondWithResult(_0x1c44af,_0x19c5d4){_0x19c5d4=_0x19c5d4||0xc8;return function(_0x222adc){if(_0x222adc){return _0x1c44af['status'](_0x19c5d4)[_0x14b8('0x31')](_0x222adc);}};}function respondWithFilteredResult(_0x58f454,_0x5d8f04){return function(_0x2f416c){if(_0x2f416c){var _0x5358ee=_0x2f416c[_0x14b8('0x32')],_0x551bf1=_0x5d8f04['offset'],_0x3b93d1=_0x5d8f04[_0x14b8('0x33')]+_0x5d8f04[_0x14b8('0x34')],_0x52ba33;if(_0x3b93d1>=_0x5358ee){_0x3b93d1=_0x5358ee;_0x52ba33=0xc8;}else{_0x52ba33=0xce;}_0x58f454[_0x14b8('0x2f')](_0x52ba33);return _0x58f454[_0x14b8('0x35')]('Content-Range',_0x551bf1+'-'+_0x3b93d1+'/'+_0x5358ee)[_0x14b8('0x31')](_0x2f416c);}return null;};}function patchUpdates(_0x63d540){return function(_0x705724){try{jsonpatch[_0x14b8('0x36')](_0x705724,_0x63d540,!![]);}catch(_0x9bb690){return BPromise[_0x14b8('0x37')](_0x9bb690);}return _0x705724['save']();};}function saveUpdates(_0x10870a,_0x3cfc29){return function(_0x96c6b){if(_0x96c6b){return _0x96c6b['update'](_0x10870a)[_0x14b8('0x22')](function(_0xd86fb2){return _0xd86fb2;});}return null;};}function removeEntity(_0x5433ae,_0x49fed1){return function(_0x27a58b){if(_0x27a58b){return _0x27a58b[_0x14b8('0x38')]()[_0x14b8('0x22')](function(){_0x5433ae[_0x14b8('0x2f')](0xcc)[_0x14b8('0x30')]();});}};}function handleEntityNotFound(_0x142d8e,_0x2cdd24){return function(_0x4d7cbc){if(!_0x4d7cbc){_0x142d8e['sendStatus'](0x194);}return _0x4d7cbc;};}function handleError(_0x5cb7a0,_0x2cc744){_0x2cc744=_0x2cc744||0x1f4;return function(_0x355c04){logger[_0x14b8('0x28')](_0x355c04[_0x14b8('0x39')]);if(_0x355c04[_0x14b8('0x3a')]){delete _0x355c04['name'];}_0x5cb7a0[_0x14b8('0x2f')](_0x2cc744)[_0x14b8('0x3b')](_0x355c04);};}exports[_0x14b8('0x3c')]=function(_0x214c4e,_0xf8db52){var _0x47d963={},_0x1e7d9d={},_0x35d96a={'count':0x0,'rows':[]};var _0x5dff41=_[_0x14b8('0x3d')](db[_0x14b8('0x3e')][_0x14b8('0x3f')],function(_0x4213ab){return{'name':_0x4213ab[_0x14b8('0x40')],'type':_0x4213ab[_0x14b8('0x41')][_0x14b8('0x42')]};});_0x1e7d9d[_0x14b8('0x43')]=_['map'](_0x5dff41,_0x14b8('0x3a'));_0x1e7d9d[_0x14b8('0x44')]=_[_0x14b8('0x45')](_0x214c4e['query']);_0x1e7d9d[_0x14b8('0x46')]=_[_0x14b8('0x47')](_0x1e7d9d[_0x14b8('0x43')],_0x1e7d9d[_0x14b8('0x44')]);_0x47d963[_0x14b8('0x48')]=_['intersection'](_0x1e7d9d['model'],qs[_0x14b8('0x49')](_0x214c4e[_0x14b8('0x44')][_0x14b8('0x49')]));_0x47d963[_0x14b8('0x48')]=_0x47d963[_0x14b8('0x48')][_0x14b8('0x4a')]?_0x47d963[_0x14b8('0x48')]:_0x1e7d9d[_0x14b8('0x43')];if(!_0x214c4e[_0x14b8('0x44')][_0x14b8('0x4b')](_0x14b8('0x4c'))){_0x47d963[_0x14b8('0x34')]=qs[_0x14b8('0x34')](_0x214c4e[_0x14b8('0x44')][_0x14b8('0x34')]);_0x47d963[_0x14b8('0x33')]=qs[_0x14b8('0x33')](_0x214c4e[_0x14b8('0x44')][_0x14b8('0x33')]);}_0x47d963[_0x14b8('0x4d')]=qs['sort'](_0x214c4e[_0x14b8('0x44')]['sort']);_0x47d963['where']=qs[_0x14b8('0x46')](_[_0x14b8('0x4e')](_0x214c4e['query'],_0x1e7d9d[_0x14b8('0x46')]),_0x5dff41);if(_0x214c4e['query'][_0x14b8('0x4f')]){_0x47d963['where']=_[_0x14b8('0x50')](_0x47d963[_0x14b8('0x51')],{'$or':_[_0x14b8('0x3d')](_0x5dff41,function(_0x54091c){if(_0x54091c[_0x14b8('0x41')]!=='VIRTUAL'){var _0x25cc70={};_0x25cc70[_0x54091c[_0x14b8('0x3a')]]={'$like':'%'+_0x214c4e[_0x14b8('0x44')][_0x14b8('0x4f')]+'%'};return _0x25cc70;}})});}_0x47d963=_[_0x14b8('0x50')]({},_0x47d963,_0x214c4e['options']);var _0x45af10={'where':_0x47d963['where']};return db[_0x14b8('0x3e')][_0x14b8('0x32')](_0x45af10)[_0x14b8('0x22')](function(_0x2655a9){_0x35d96a[_0x14b8('0x32')]=_0x2655a9;if(_0x214c4e['query'][_0x14b8('0x52')]){_0x47d963[_0x14b8('0x53')]=[{'all':!![]}];}return db[_0x14b8('0x3e')]['findAll'](_0x47d963);})[_0x14b8('0x22')](function(_0x200b44){_0x35d96a['rows']=_0x200b44;return _0x35d96a;})[_0x14b8('0x22')](respondWithFilteredResult(_0xf8db52,_0x47d963))[_0x14b8('0x2d')](handleError(_0xf8db52,null));};exports['show']=function(_0x49735d,_0x36c242){var _0x59f4e9={'raw':!![],'where':{'id':_0x49735d[_0x14b8('0x54')]['id']}},_0x11c8d3={};_0x11c8d3[_0x14b8('0x43')]=_['keys'](db[_0x14b8('0x3e')]['rawAttributes']);_0x11c8d3['query']=_[_0x14b8('0x45')](_0x49735d[_0x14b8('0x44')]);_0x11c8d3[_0x14b8('0x46')]=_[_0x14b8('0x47')](_0x11c8d3[_0x14b8('0x43')],_0x11c8d3[_0x14b8('0x44')]);_0x59f4e9['attributes']=_[_0x14b8('0x47')](_0x11c8d3[_0x14b8('0x43')],qs['fields'](_0x49735d['query']['fields']));_0x59f4e9['attributes']=_0x59f4e9[_0x14b8('0x48')][_0x14b8('0x4a')]?_0x59f4e9[_0x14b8('0x48')]:_0x11c8d3[_0x14b8('0x43')];if(_0x49735d[_0x14b8('0x44')]['includeAll']){_0x59f4e9[_0x14b8('0x53')]=[{'all':!![]}];}_0x59f4e9=_[_0x14b8('0x50')]({},_0x59f4e9,_0x49735d[_0x14b8('0x55')]);return db[_0x14b8('0x3e')][_0x14b8('0x56')](_0x59f4e9)['then'](handleEntityNotFound(_0x36c242,null))[_0x14b8('0x22')](respondWithResult(_0x36c242,null))['catch'](handleError(_0x36c242,null));};exports[_0x14b8('0x57')]=function(_0x18f6f6,_0x43e690){return db['WhatsappMessage'][_0x14b8('0x57')](_0x18f6f6['body'],{})[_0x14b8('0x22')](respondWithResult(_0x43e690,0xc9))[_0x14b8('0x2d')](handleError(_0x43e690,null));};exports[_0x14b8('0x58')]=function(_0x13e429,_0x36bac7){if(_0x13e429['body']['id']){delete _0x13e429[_0x14b8('0x59')]['id'];}return db[_0x14b8('0x3e')][_0x14b8('0x56')]({'where':{'id':_0x13e429[_0x14b8('0x54')]['id']}})[_0x14b8('0x22')](handleEntityNotFound(_0x36bac7,null))[_0x14b8('0x22')](saveUpdates(_0x13e429['body'],null))[_0x14b8('0x22')](respondWithResult(_0x36bac7,null))[_0x14b8('0x2d')](handleError(_0x36bac7,null));};exports[_0x14b8('0x38')]=function(_0x44b1aa,_0x35bbdc){return db[_0x14b8('0x3e')][_0x14b8('0x56')]({'where':{'id':_0x44b1aa[_0x14b8('0x54')]['id']}})[_0x14b8('0x22')](handleEntityNotFound(_0x35bbdc,null))[_0x14b8('0x22')](removeEntity(_0x35bbdc,null))[_0x14b8('0x2d')](handleError(_0x35bbdc,null));};exports[_0x14b8('0x5a')]=function(_0x342459,_0x151684){return db[_0x14b8('0x3e')][_0x14b8('0x5a')]()[_0x14b8('0x22')](respondWithResult(_0x151684,null))[_0x14b8('0x2d')](handleError(_0x151684,null));};var interaction_log=require(_0x14b8('0x13'))(_0x14b8('0x5b'));exports[_0x14b8('0x5c')]=function(_0x447736,_0x2ce028,_0x33098a){var _0x160881={'channel':_0x14b8('0x5d')};if(_0x447736['body']['id']){delete _0x447736[_0x14b8('0x59')]['id'];}_0x447736[_0x14b8('0x59')][_0x14b8('0x5e')]=!![];_0x447736['body'][_0x14b8('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x447736[_0x14b8('0x59')][_0x14b8('0x60')]=_0x447736[_0x14b8('0x59')]['UserId']||_0x447736[_0x14b8('0x61')]['id'];return db[_0x14b8('0x3e')][_0x14b8('0x56')]({'where':{'id':_0x447736[_0x14b8('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x14b8('0x62')],'as':_0x14b8('0x63')}]})[_0x14b8('0x22')](handleEntityNotFound(_0x2ce028,null))[_0x14b8('0x22')](saveUpdates(_0x447736['body'],null))[_0x14b8('0x22')](function(_0x42c782){if(_0x42c782){_0x160881[_0x14b8('0x2a')]=_0x42c782[_0x14b8('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0x14b8('0x56')]({'where':{'id':_0x42c782['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2ce028,null))[_0x14b8('0x22')](function(_0x5a765a){if(_0x5a765a){return _0x5a765a['update']({'UserId':_0x447736[_0x14b8('0x59')][_0x14b8('0x60')],'read1stAt':_[_0x14b8('0x65')](_0x5a765a[_0x14b8('0x66')])?moment()[_0x14b8('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x44777b){if(_0x44777b){_0x160881[_0x14b8('0x68')]=_0x44777b[_0x14b8('0x64')]({'plain':!![]});interaction_log[_0x14b8('0x2b')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x447736[_0x14b8('0x61')]['id'],_0x447736[_0x14b8('0x61')]['name'],_0x447736['user'][_0x14b8('0x69')],_0x160881[_0x14b8('0x68')]['id'],_0x447736['body']?JSON['stringify'](_0x447736['body']):_0x14b8('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x14b8('0x6b'),_0x160881);}return null;})['then'](function(_0x1cc537){if(_0x1cc537){if(_0x447736[_0x14b8('0x59')][_0x14b8('0x6c')]){_0x160881[_0x14b8('0x2a')][_0x14b8('0x6d')]=util[_0x14b8('0x67')](_0x14b8('0x6e'),_0x447736[_0x14b8('0x61')]['name']);_0x160881[_0x14b8('0x2a')][_0x14b8('0x6f')]=_0x160881[_0x14b8('0x6f')];_0x160881['message'][_0x14b8('0x70')]=_0x14b8('0x5c');return respondWithRpcPromise(_0x14b8('0x71'),_0x14b8('0x71'),{'event':_0x14b8('0x72'),'message':_0x160881['message']},client9002)[_0x14b8('0x22')](function(){return _0x160881;});}return _0x160881;}return null;})[_0x14b8('0x22')](respondWithResult(_0x2ce028,null))[_0x14b8('0x2d')](handleError(_0x2ce028,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0x14b8('0x37')]=function(_0x128b8d,_0x569ff2,_0x5f0536){var _0x4249ed={'agent':{},'channel':_0x14b8('0x5d')};if(_0x128b8d[_0x14b8('0x59')]['id']){delete _0x128b8d[_0x14b8('0x59')]['id'];}_0x128b8d[_0x14b8('0x59')][_0x14b8('0x60')]=_0x128b8d['body'][_0x14b8('0x60')]||_0x128b8d[_0x14b8('0x61')]['id'];_0x4249ed[_0x14b8('0x73')]['id']=_0x128b8d['body'][_0x14b8('0x60')];return db[_0x14b8('0x3e')][_0x14b8('0x56')]({'where':{'id':_0x128b8d['params']['id'],'UserId':null}})[_0x14b8('0x22')](handleEntityNotFound(_0x569ff2,null))[_0x14b8('0x22')](function(_0x53c769){if(_0x53c769){_0x4249ed[_0x14b8('0x2a')]=_0x53c769[_0x14b8('0x64')]({'plain':!![]});return db['WhatsappInteraction'][_0x14b8('0x56')]({'where':{'id':_0x53c769['WhatsappInteractionId']}});}return null;})[_0x14b8('0x22')](handleEntityNotFound(_0x569ff2,null))[_0x14b8('0x22')](function(_0x5e0c95){if(_0x5e0c95){_0x4249ed[_0x14b8('0x68')]=_0x5e0c95['get']({'plain':!![]});interaction_log[_0x14b8('0x2b')](_0x14b8('0x74'),_0x128b8d[_0x14b8('0x61')]['id'],_0x128b8d[_0x14b8('0x61')][_0x14b8('0x3a')],_0x128b8d[_0x14b8('0x61')][_0x14b8('0x69')],_0x4249ed[_0x14b8('0x68')]['id'],_0x128b8d[_0x14b8('0x59')]?JSON[_0x14b8('0x27')](_0x128b8d['body']):_0x14b8('0x6a'));return respondWithRpcPromise(_0x14b8('0x75'),'rejectMessage',_0x4249ed);}return null;})[_0x14b8('0x22')](function(_0x4b2153){if(_0x4b2153){_0x4b2153[_0x14b8('0x2a')][_0x14b8('0x6d')]=util[_0x14b8('0x67')](_0x14b8('0x6e'),_0x128b8d[_0x14b8('0x61')]['name']);_0x4b2153[_0x14b8('0x2a')][_0x14b8('0x6f')]=_0x4249ed[_0x14b8('0x6f')];_0x4b2153[_0x14b8('0x2a')][_0x14b8('0x70')]=_0x14b8('0x37');respondWithRpcPromise(_0x14b8('0x71'),'EventManager',{'event':_0x14b8('0x76'),'message':_0x4b2153[_0x14b8('0x2a')]},client9002);return _0x4249ed;}return null;})[_0x14b8('0x22')](respondWithResult(_0x569ff2,null))[_0x14b8('0x2d')](handleError(_0x569ff2,null));};exports[_0x14b8('0x2f')]=function(_0x192553,_0x43ab9b,_0x145913){if(_0x192553[_0x14b8('0x59')]['id']){delete _0x192553[_0x14b8('0x59')]['id'];}var _0x5b8191;return db['WhatsappMessage'][_0x14b8('0x56')]({'where':{'id':_0x192553[_0x14b8('0x54')]['id']}})[_0x14b8('0x22')](handleEntityNotFound(_0x43ab9b,null))[_0x14b8('0x22')](function(_0x48dadb){if(_0x48dadb){_0x5b8191=_0x48dadb;return db[_0x14b8('0x77')][_0x14b8('0x56')]({'where':{'id':_0x48dadb['WhatsappAccountId']}});}})[_0x14b8('0x22')](handleEntityNotFound(_0x43ab9b,null))[_0x14b8('0x22')](function(_0x1454d7){if(_0x1454d7){logger[_0x14b8('0x25')](_0x14b8('0x78'),_0x14b8('0x2f'),_0x14b8('0x79'),_0x1454d7[_0x14b8('0x41')],util[_0x14b8('0x7a')](_0x192553[_0x14b8('0x59')],{'showHidden':![],'depth':null}));switch(_0x1454d7['type']){case _0x14b8('0x7b'):if(_0x192553[_0x14b8('0x59')][_0x14b8('0x7c')]&&_0x192553[_0x14b8('0x59')][_0x14b8('0x7c')]===_0x5b8191[_0x14b8('0x7d')]&&_0x192553[_0x14b8('0x59')]['MessageStatus']&&_0x192553[_0x14b8('0x59')][_0x14b8('0x7e')]==='read'){return _0x5b8191['update']({'read':!![]});}else{logger[_0x14b8('0x28')](_0x14b8('0x7f'),'status',_0x14b8('0x7b'),util[_0x14b8('0x7a')](_0x192553['body'],{'showHidden':![],'depth':null}));}break;}return _0x5b8191;}})['then'](respondWithResult(_0x43ab9b,null))[_0x14b8('0x2d')](handleError(_0x43ab9b,null));}; \ No newline at end of file +var _0x3ff6=['messageId','MessageStatus','inspect','rimraf','zip-dir','bluebird','mustache','util','sox','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','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','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','apply','reject','save','destroy','end','stack','name','send','index','WhatsappMessage','rawAttributes','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','include','create','update','body','find','describe','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp','agent','interaction','info','role','RejectMessage','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid'];(function(_0x2aa2f4,_0xc8626d){var _0xbdee62=function(_0x413ca6){while(--_0x413ca6){_0x2aa2f4['push'](_0x2aa2f4['shift']());}};_0xbdee62(++_0xc8626d);}(_0x3ff6,0x84));var _0x63ff=function(_0x51db73,_0x4e32f8){_0x51db73=_0x51db73-0x0;var _0x6e43d2=_0x3ff6[_0x51db73];return _0x6e43d2;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x63ff('0x0'));var zipdir=require(_0x63ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x63ff('0x2'));var Mustache=require(_0x63ff('0x3'));var util=require(_0x63ff('0x4'));var path=require('path');var sox=require(_0x63ff('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x63ff('0x6'));var crypto=require('crypto');var jsforce=require(_0x63ff('0x7'));var deskjs=require(_0x63ff('0x8'));var toCsv=require(_0x63ff('0x9'));var querystring=require('querystring');var Papa=require(_0x63ff('0xa'));var Redis=require(_0x63ff('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x63ff('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63ff('0xd'));var logger=require(_0x63ff('0xe'))(_0x63ff('0xf'));var utils=require(_0x63ff('0x10'));var config=require(_0x63ff('0x11'));var db=require(_0x63ff('0x12'))['db'];config[_0x63ff('0x13')]=_[_0x63ff('0x14')](config[_0x63ff('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x63ff('0x15'))(new Redis(config[_0x63ff('0x13')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x63ff('0x16'));var client=jayson[_0x63ff('0x17')][_0x63ff('0x18')]({'port':0x232c});var client9002=jayson['client'][_0x63ff('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1e2e65,_0x39f461,_0x28f126){if(_0x28f126){var _0x41f687=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41f687[_0x63ff('0x19')](_0x39f461)){return _0x1e2e65;}else{throw new db[(_0x63ff('0x1a'))][(_0x63ff('0x1b'))](_0x63ff('0x1c'));}}else{return _0x1e2e65;}}function respondWithRpcPromise(_0x8c4e09,_0x5d7c50,_0x2cdec2,_0x462e88){return new BPromise(function(_0x7d6658,_0x1560a5){var _0x2f4c4a=_0x462e88||client;return _0x2f4c4a[_0x63ff('0x1d')](_0x8c4e09,_0x2cdec2)[_0x63ff('0x1e')](function(_0x390197){logger['info'](_0x63ff('0x1f'),_0x5d7c50,_0x63ff('0x20'));logger['debug'](_0x63ff('0x21'),_0x5d7c50,_0x63ff('0x20'),JSON[_0x63ff('0x22')](_0x390197));if(_0x390197[_0x63ff('0x23')]){if(_0x390197[_0x63ff('0x23')][_0x63ff('0x24')]===0x1f4){logger['error'](_0x63ff('0x1f'),_0x5d7c50,_0x390197[_0x63ff('0x23')][_0x63ff('0x25')]);return _0x1560a5(_0x390197[_0x63ff('0x23')][_0x63ff('0x25')]);}logger[_0x63ff('0x23')](_0x63ff('0x1f'),_0x5d7c50,_0x390197['error'][_0x63ff('0x25')]);return _0x7d6658(_0x390197[_0x63ff('0x23')][_0x63ff('0x25')]);}else{logger['info'](_0x63ff('0x1f'),_0x5d7c50,'request\x20sent');_0x7d6658(_0x390197[_0x63ff('0x26')][_0x63ff('0x25')]);}})[_0x63ff('0x27')](function(_0x4dc54a){logger[_0x63ff('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x5d7c50,_0x4dc54a);_0x1560a5(_0x4dc54a);});});}function respondWithStatusCode(_0x33d1ab,_0x555133){_0x555133=_0x555133||0xcc;return function(_0x583058){if(_0x583058){return _0x33d1ab[_0x63ff('0x28')](_0x555133);}return _0x33d1ab[_0x63ff('0x29')](_0x555133)['end']();};}function respondWithResult(_0x403bf1,_0x34a86d){_0x34a86d=_0x34a86d||0xc8;return function(_0x4569b4){if(_0x4569b4){return _0x403bf1['status'](_0x34a86d)[_0x63ff('0x2a')](_0x4569b4);}};}function respondWithFilteredResult(_0x1dd92f,_0x5eb0ce){return function(_0x488734){if(_0x488734){var _0x463def=_0x488734['count'],_0x5ecac7=_0x5eb0ce[_0x63ff('0x2b')],_0x5306f9=_0x5eb0ce[_0x63ff('0x2b')]+_0x5eb0ce[_0x63ff('0x2c')],_0x46c6f5;if(_0x5306f9>=_0x463def){_0x5306f9=_0x463def;_0x46c6f5=0xc8;}else{_0x46c6f5=0xce;}_0x1dd92f[_0x63ff('0x29')](_0x46c6f5);return _0x1dd92f[_0x63ff('0x2d')]('Content-Range',_0x5ecac7+'-'+_0x5306f9+'/'+_0x463def)[_0x63ff('0x2a')](_0x488734);}return null;};}function patchUpdates(_0x5e931e){return function(_0x48ebb0){try{jsonpatch[_0x63ff('0x2e')](_0x48ebb0,_0x5e931e,!![]);}catch(_0x3baa15){return BPromise[_0x63ff('0x2f')](_0x3baa15);}return _0x48ebb0[_0x63ff('0x30')]();};}function saveUpdates(_0x26f097,_0x38aab3){return function(_0x284b9f){if(_0x284b9f){return _0x284b9f['update'](_0x26f097)[_0x63ff('0x1e')](function(_0x489c40){return _0x489c40;});}return null;};}function removeEntity(_0x248917,_0x23c443){return function(_0x393c25){if(_0x393c25){return _0x393c25[_0x63ff('0x31')]()[_0x63ff('0x1e')](function(){_0x248917[_0x63ff('0x29')](0xcc)[_0x63ff('0x32')]();});}};}function handleEntityNotFound(_0x285331,_0x11bff9){return function(_0xa94611){if(!_0xa94611){_0x285331['sendStatus'](0x194);}return _0xa94611;};}function handleError(_0x1fbe0f,_0x54cd73){_0x54cd73=_0x54cd73||0x1f4;return function(_0x2a3f21){logger[_0x63ff('0x23')](_0x2a3f21[_0x63ff('0x33')]);if(_0x2a3f21['name']){delete _0x2a3f21[_0x63ff('0x34')];}_0x1fbe0f['status'](_0x54cd73)[_0x63ff('0x35')](_0x2a3f21);};}exports[_0x63ff('0x36')]=function(_0x2f1c97,_0x5911d2){var _0x40f401={},_0x1eb8d2={},_0x59956d={'count':0x0,'rows':[]};var _0x4cbc52=_['map'](db[_0x63ff('0x37')][_0x63ff('0x38')],function(_0x322841){return{'name':_0x322841['fieldName'],'type':_0x322841[_0x63ff('0x39')][_0x63ff('0x3a')]};});_0x1eb8d2[_0x63ff('0x3b')]=_[_0x63ff('0x3c')](_0x4cbc52,_0x63ff('0x34'));_0x1eb8d2['query']=_[_0x63ff('0x3d')](_0x2f1c97[_0x63ff('0x3e')]);_0x1eb8d2[_0x63ff('0x3f')]=_['intersection'](_0x1eb8d2[_0x63ff('0x3b')],_0x1eb8d2[_0x63ff('0x3e')]);_0x40f401['attributes']=_[_0x63ff('0x40')](_0x1eb8d2[_0x63ff('0x3b')],qs[_0x63ff('0x41')](_0x2f1c97[_0x63ff('0x3e')][_0x63ff('0x41')]));_0x40f401[_0x63ff('0x42')]=_0x40f401[_0x63ff('0x42')][_0x63ff('0x43')]?_0x40f401[_0x63ff('0x42')]:_0x1eb8d2[_0x63ff('0x3b')];if(!_0x2f1c97[_0x63ff('0x3e')][_0x63ff('0x44')](_0x63ff('0x45'))){_0x40f401[_0x63ff('0x2c')]=qs[_0x63ff('0x2c')](_0x2f1c97[_0x63ff('0x3e')]['limit']);_0x40f401[_0x63ff('0x2b')]=qs['offset'](_0x2f1c97['query'][_0x63ff('0x2b')]);}_0x40f401[_0x63ff('0x46')]=qs['sort'](_0x2f1c97[_0x63ff('0x3e')][_0x63ff('0x47')]);_0x40f401[_0x63ff('0x48')]=qs['filters'](_[_0x63ff('0x49')](_0x2f1c97[_0x63ff('0x3e')],_0x1eb8d2[_0x63ff('0x3f')]),_0x4cbc52);if(_0x2f1c97['query'][_0x63ff('0x4a')]){_0x40f401[_0x63ff('0x48')]=_[_0x63ff('0x4b')](_0x40f401['where'],{'$or':_[_0x63ff('0x3c')](_0x4cbc52,function(_0x24c952){if(_0x24c952[_0x63ff('0x39')]!==_0x63ff('0x4c')){var _0x41fab8={};_0x41fab8[_0x24c952[_0x63ff('0x34')]]={'$like':'%'+_0x2f1c97[_0x63ff('0x3e')]['filter']+'%'};return _0x41fab8;}})});}_0x40f401=_[_0x63ff('0x4b')]({},_0x40f401,_0x2f1c97[_0x63ff('0x4d')]);var _0x2c0468={'where':_0x40f401[_0x63ff('0x48')]};return db[_0x63ff('0x37')]['count'](_0x2c0468)[_0x63ff('0x1e')](function(_0x5e98cb){_0x59956d[_0x63ff('0x4e')]=_0x5e98cb;if(_0x2f1c97[_0x63ff('0x3e')][_0x63ff('0x4f')]){_0x40f401['include']=[{'all':!![]}];}return db[_0x63ff('0x37')]['findAll'](_0x40f401);})[_0x63ff('0x1e')](function(_0x54d6ea){_0x59956d[_0x63ff('0x50')]=_0x54d6ea;return _0x59956d;})['then'](respondWithFilteredResult(_0x5911d2,_0x40f401))[_0x63ff('0x27')](handleError(_0x5911d2,null));};exports[_0x63ff('0x51')]=function(_0x63fe68,_0x4fef76){var _0x3f2002={'raw':!![],'where':{'id':_0x63fe68[_0x63ff('0x52')]['id']}},_0x32063d={};_0x32063d[_0x63ff('0x3b')]=_['keys'](db['WhatsappMessage'][_0x63ff('0x38')]);_0x32063d['query']=_['keys'](_0x63fe68['query']);_0x32063d[_0x63ff('0x3f')]=_[_0x63ff('0x40')](_0x32063d[_0x63ff('0x3b')],_0x32063d[_0x63ff('0x3e')]);_0x3f2002[_0x63ff('0x42')]=_[_0x63ff('0x40')](_0x32063d[_0x63ff('0x3b')],qs[_0x63ff('0x41')](_0x63fe68['query']['fields']));_0x3f2002[_0x63ff('0x42')]=_0x3f2002[_0x63ff('0x42')][_0x63ff('0x43')]?_0x3f2002['attributes']:_0x32063d['model'];if(_0x63fe68[_0x63ff('0x3e')][_0x63ff('0x4f')]){_0x3f2002[_0x63ff('0x53')]=[{'all':!![]}];}_0x3f2002=_[_0x63ff('0x4b')]({},_0x3f2002,_0x63fe68['options']);return db['WhatsappMessage']['find'](_0x3f2002)[_0x63ff('0x1e')](handleEntityNotFound(_0x4fef76,null))[_0x63ff('0x1e')](respondWithResult(_0x4fef76,null))[_0x63ff('0x27')](handleError(_0x4fef76,null));};exports['create']=function(_0x479643,_0xdeda45){return db[_0x63ff('0x37')][_0x63ff('0x54')](_0x479643['body'],{})[_0x63ff('0x1e')](respondWithResult(_0xdeda45,0xc9))[_0x63ff('0x27')](handleError(_0xdeda45,null));};exports[_0x63ff('0x55')]=function(_0x12d0f0,_0x76bf81){if(_0x12d0f0[_0x63ff('0x56')]['id']){delete _0x12d0f0[_0x63ff('0x56')]['id'];}return db[_0x63ff('0x37')][_0x63ff('0x57')]({'where':{'id':_0x12d0f0['params']['id']}})[_0x63ff('0x1e')](handleEntityNotFound(_0x76bf81,null))['then'](saveUpdates(_0x12d0f0[_0x63ff('0x56')],null))[_0x63ff('0x1e')](respondWithResult(_0x76bf81,null))[_0x63ff('0x27')](handleError(_0x76bf81,null));};exports[_0x63ff('0x31')]=function(_0x536b17,_0x20c10f){return db[_0x63ff('0x37')][_0x63ff('0x57')]({'where':{'id':_0x536b17['params']['id']}})[_0x63ff('0x1e')](handleEntityNotFound(_0x20c10f,null))[_0x63ff('0x1e')](removeEntity(_0x20c10f,null))[_0x63ff('0x27')](handleError(_0x20c10f,null));};exports[_0x63ff('0x58')]=function(_0x2dec66,_0x3803d5){return db['WhatsappMessage'][_0x63ff('0x58')]()[_0x63ff('0x1e')](respondWithResult(_0x3803d5,null))['catch'](handleError(_0x3803d5,null));};var interaction_log=require(_0x63ff('0xe'))(_0x63ff('0x59'));exports[_0x63ff('0x5a')]=function(_0x164cd3,_0x1de834,_0x1b5691){var _0x569515={'channel':'whatsapp'};if(_0x164cd3[_0x63ff('0x56')]['id']){delete _0x164cd3[_0x63ff('0x56')]['id'];}_0x164cd3[_0x63ff('0x56')][_0x63ff('0x5b')]=!![];_0x164cd3[_0x63ff('0x56')][_0x63ff('0x5c')]=moment()[_0x63ff('0x5d')](_0x63ff('0x5e'));_0x164cd3[_0x63ff('0x56')]['UserId']=_0x164cd3[_0x63ff('0x56')][_0x63ff('0x5f')]||_0x164cd3[_0x63ff('0x60')]['id'];return db[_0x63ff('0x37')][_0x63ff('0x57')]({'where':{'id':_0x164cd3[_0x63ff('0x52')]['id'],'UserId':null},'include':[{'model':db[_0x63ff('0x61')],'as':'Contact'}]})[_0x63ff('0x1e')](handleEntityNotFound(_0x1de834,null))[_0x63ff('0x1e')](saveUpdates(_0x164cd3[_0x63ff('0x56')],null))[_0x63ff('0x1e')](function(_0x5add71){if(_0x5add71){_0x569515[_0x63ff('0x25')]=_0x5add71['get']({'plain':!![]});return db[_0x63ff('0x62')]['find']({'where':{'id':_0x5add71[_0x63ff('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x1de834,null))['then'](function(_0x289f68){if(_0x289f68){return _0x289f68[_0x63ff('0x55')]({'UserId':_0x164cd3[_0x63ff('0x56')][_0x63ff('0x5f')],'read1stAt':_[_0x63ff('0x64')](_0x289f68[_0x63ff('0x65')])?moment()['format'](_0x63ff('0x5e')):undefined});}return null;})['then'](function(_0x48018c){if(_0x48018c){_0x569515['interaction']=_0x48018c[_0x63ff('0x66')]({'plain':!![]});interaction_log['info'](_0x63ff('0x67'),_0x164cd3['user']['id'],_0x164cd3[_0x63ff('0x60')]['name'],_0x164cd3[_0x63ff('0x60')]['role'],_0x569515['interaction']['id'],_0x164cd3['body']?JSON[_0x63ff('0x22')](_0x164cd3[_0x63ff('0x56')]):_0x63ff('0x68'));return respondWithRpcPromise(_0x63ff('0x69'),_0x63ff('0x6a'),_0x569515);}return null;})['then'](function(_0xeba0f3){if(_0xeba0f3){if(_0x164cd3[_0x63ff('0x56')]['manual']){_0x569515[_0x63ff('0x25')][_0x63ff('0x6b')]=util[_0x63ff('0x5d')](_0x63ff('0x6c'),_0x164cd3[_0x63ff('0x60')][_0x63ff('0x34')]);_0x569515[_0x63ff('0x25')]['channel']=_0x569515[_0x63ff('0x6d')];_0x569515[_0x63ff('0x25')][_0x63ff('0x6e')]=_0x63ff('0x5a');return respondWithRpcPromise(_0x63ff('0x6f'),'EventManager',{'event':_0x63ff('0x70'),'message':_0x569515[_0x63ff('0x25')]},client9002)[_0x63ff('0x1e')](function(){return _0x569515;});}return _0x569515;}return null;})[_0x63ff('0x1e')](respondWithResult(_0x1de834,null))[_0x63ff('0x27')](handleError(_0x1de834,null));};var interaction_log=require('../../config/logger')(_0x63ff('0x59'));exports[_0x63ff('0x2f')]=function(_0x494846,_0x3db9a3,_0x483061){var _0x3a7120={'agent':{},'channel':_0x63ff('0x71')};if(_0x494846[_0x63ff('0x56')]['id']){delete _0x494846[_0x63ff('0x56')]['id'];}_0x494846[_0x63ff('0x56')][_0x63ff('0x5f')]=_0x494846['body'][_0x63ff('0x5f')]||_0x494846[_0x63ff('0x60')]['id'];_0x3a7120[_0x63ff('0x72')]['id']=_0x494846['body']['UserId'];return db[_0x63ff('0x37')][_0x63ff('0x57')]({'where':{'id':_0x494846[_0x63ff('0x52')]['id'],'UserId':null}})[_0x63ff('0x1e')](handleEntityNotFound(_0x3db9a3,null))[_0x63ff('0x1e')](function(_0x31d890){if(_0x31d890){_0x3a7120[_0x63ff('0x25')]=_0x31d890[_0x63ff('0x66')]({'plain':!![]});return db[_0x63ff('0x62')][_0x63ff('0x57')]({'where':{'id':_0x31d890[_0x63ff('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x3db9a3,null))['then'](function(_0x54e28f){if(_0x54e28f){_0x3a7120[_0x63ff('0x73')]=_0x54e28f[_0x63ff('0x66')]({'plain':!![]});interaction_log[_0x63ff('0x74')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x494846[_0x63ff('0x60')]['id'],_0x494846['user']['name'],_0x494846[_0x63ff('0x60')][_0x63ff('0x75')],_0x3a7120[_0x63ff('0x73')]['id'],_0x494846[_0x63ff('0x56')]?JSON[_0x63ff('0x22')](_0x494846['body']):'null');return respondWithRpcPromise(_0x63ff('0x76'),'rejectMessage',_0x3a7120);}return null;})['then'](function(_0x98925b){if(_0x98925b){_0x98925b[_0x63ff('0x25')][_0x63ff('0x6b')]=util[_0x63ff('0x5d')](_0x63ff('0x6c'),_0x494846[_0x63ff('0x60')][_0x63ff('0x34')]);_0x98925b[_0x63ff('0x25')][_0x63ff('0x6d')]=_0x3a7120[_0x63ff('0x6d')];_0x98925b[_0x63ff('0x25')]['event']='reject';respondWithRpcPromise('EventManager',_0x63ff('0x6f'),{'event':_0x63ff('0x77'),'message':_0x98925b['message']},client9002);return _0x3a7120;}return null;})[_0x63ff('0x1e')](respondWithResult(_0x3db9a3,null))[_0x63ff('0x27')](handleError(_0x3db9a3,null));};exports[_0x63ff('0x29')]=function(_0x45ac47,_0x4ec6c5,_0x1b265e){if(_0x45ac47[_0x63ff('0x56')]['id']){delete _0x45ac47[_0x63ff('0x56')]['id'];}var _0x54d8cb;return db[_0x63ff('0x37')][_0x63ff('0x57')]({'where':{'id':_0x45ac47[_0x63ff('0x52')]['id']}})['then'](handleEntityNotFound(_0x4ec6c5,null))['then'](function(_0x40acf1){if(_0x40acf1){_0x54d8cb=_0x40acf1;return db[_0x63ff('0x78')][_0x63ff('0x57')]({'where':{'id':_0x40acf1[_0x63ff('0x79')]}});}})['then'](handleEntityNotFound(_0x4ec6c5,null))[_0x63ff('0x1e')](function(_0xa6467e){if(_0xa6467e){logger[_0x63ff('0x7a')](_0x63ff('0x7b'),_0x63ff('0x29'),'received\x20delivery\x20report\x20from',_0xa6467e['type'],util['inspect'](_0x45ac47[_0x63ff('0x56')],{'showHidden':![],'depth':null}));switch(_0xa6467e[_0x63ff('0x39')]){case _0x63ff('0x7c'):if(_0x45ac47[_0x63ff('0x56')][_0x63ff('0x7d')]&&_0x45ac47[_0x63ff('0x56')][_0x63ff('0x7d')]===_0x54d8cb[_0x63ff('0x7e')]&&_0x45ac47[_0x63ff('0x56')]['MessageStatus']&&_0x45ac47['body'][_0x63ff('0x7f')]===_0x63ff('0x5b')){return _0x54d8cb['update']({'read':!![]});}else{logger[_0x63ff('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0x63ff('0x7c'),util[_0x63ff('0x80')](_0x45ac47[_0x63ff('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x54d8cb;}})[_0x63ff('0x1e')](respondWithResult(_0x4ec6c5,null))[_0x63ff('0x27')](handleError(_0x4ec6c5,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 89ddf72..3c66be2 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 _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update'];(function(_0x2ade4f,_0x47a30f){var _0x26fe7e=function(_0x22c761){while(--_0x22c761){_0x2ade4f['push'](_0x2ade4f['shift']());}};_0x26fe7e(++_0x47a30f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54a229,_0x479dd1){_0x54a229=_0x54a229-0x0;var _0x36232e=_0x5f2f[_0x54a229];return _0x36232e;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var WhatsappMessage=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);WhatsappMessageEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];WhatsappMessage[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=WhatsappMessageEvents; \ No newline at end of file +var _0x7a54=['WhatsappMessage','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x11267b,_0x5bbccb){var _0x236da4=function(_0x3afb06){while(--_0x3afb06){_0x11267b['push'](_0x11267b['shift']());}};_0x236da4(++_0x5bbccb);}(_0x7a54,0x106));var _0x47a5=function(_0x18b235,_0x3ca132){_0x18b235=_0x18b235-0x0;var _0x1c4347=_0x7a54[_0x18b235];return _0x1c4347;};'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 diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 11f9087..54975bd 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 _0x2be7=['get','direction','toLowerCase','out','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x2be7,0x1c4));var _0x72be=function(_0x4a30f1,_0x2e75a8){_0x4a30f1=_0x4a30f1-0x0;var _0x1e0a09=_0x2be7[_0x4a30f1];return _0x1e0a09;};'use strict';var _=require(_0x72be('0x0'));var util=require(_0x72be('0x1'));var logger=require(_0x72be('0x2'))(_0x72be('0x3'));var moment=require(_0x72be('0x4'));var BPromise=require(_0x72be('0x5'));var rp=require(_0x72be('0x6'));var fs=require('fs');var path=require(_0x72be('0x7'));var rimraf=require('rimraf');var config=require(_0x72be('0x8'));var attributes=require(_0x72be('0x9'));module[_0x72be('0xa')]=function(_0x5b8737,_0x510e0f){return _0x5b8737['define'](_0x72be('0xb'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x72be('0xc')]},{'name':_0x72be('0xd'),'fields':[_0x72be('0xe')],'type':_0x72be('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x529340,_0x43f453,_0x1b9b4b){var _0x1a2d0e=_0x5b8737['models'];var _0x50c5b6=_0x529340[_0x72be('0x10')]({'plain':!![]});if(_0x50c5b6[_0x72be('0x11')][_0x72be('0x12')]()==='in'||_0x50c5b6[_0x72be('0x11')][_0x72be('0x12')]()===_0x72be('0x13')&&!_0x50c5b6['secret']&&!_[_0x72be('0x14')](_0x50c5b6[_0x72be('0x15')])){_0x1a2d0e[_0x72be('0x16')][_0x72be('0x17')]({'where':{'id':_0x50c5b6[_0x72be('0x18')]}})['then'](function(_0x30cf2f){if(_0x30cf2f){_0x30cf2f[_0x72be('0x19')]({'lastMsgAt':_0x50c5b6[_0x72be('0x1a')],'lastMsgDirection':_0x50c5b6[_0x72be('0x11')][_0x72be('0x12')]()});}})[_0x72be('0x1b')](function(_0x3b799f){console[_0x72be('0x1c')](_0x3b799f);});}if(_0x50c5b6['direction']===_0x72be('0x13')&&!_0x50c5b6[_0x72be('0x1d')]){var _0x45d94a;_0x1a2d0e[_0x72be('0x1e')][_0x72be('0x1f')]({'where':{'id':_0x50c5b6[_0x72be('0x20')]},'raw':!![]})[_0x72be('0x21')](function(_0x523ce2){_0x45d94a=_0x523ce2;if(_0x45d94a&&_0x45d94a[_0x72be('0x22')]){switch(_0x45d94a[_0x72be('0x22')]){case _0x72be('0x23'):var _0x3ce769=require(_0x72be('0x23'));if(_0x45d94a[_0x72be('0x24')]&&_0x45d94a[_0x72be('0x25')]&&_0x45d94a['phone']){var _0x4aa717=new _0x3ce769(_0x45d94a[_0x72be('0x24')],_0x45d94a[_0x72be('0x25')]);_0x4aa717[_0x72be('0x26')][_0x72be('0x27')]({'body':_0x50c5b6[_0x72be('0xe')],'to':_0x72be('0x28')+_0x50c5b6[_0x72be('0x29')],'from':_0x72be('0x28')+_0x45d94a['phone'],'statusCallback':_0x45d94a['remote']+_0x72be('0x2a')+_0x50c5b6['id']+_0x72be('0x2b')+_0x45d94a[_0x72be('0x2c')]})[_0x72be('0x21')](function(_0x37ce54){if(_0x37ce54[_0x72be('0x2d')]){return _0x529340[_0x72be('0x19')]({'messageId':_0x37ce54[_0x72be('0x2d')]});}})['catch'](function(_0x34d749){logger[_0x72be('0x1c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x72be('0x2e'),_0x72be('0x23'),util[_0x72be('0x2f')](_0x34d749,{'showHidden':![],'depth':null}));});}else{logger[_0x72be('0x1c')](_0x72be('0x30'),_0x72be('0x2e'),_0x72be('0x23'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x72be('0x31')](function(){_0x1b9b4b();});}else{_0x1b9b4b();}}},'charset':_0x72be('0x32'),'collate':_0x72be('0x33')});}; \ No newline at end of file +var _0xe6dd=['rimraf','exports','WhatsappMessage','whatsapp_messages','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','findOne','WhatsappInteractionId','update','createdAt','catch','error','WhatsappAccount','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token','sid','afterCreate','WhatsappMessage,\x20%s,\x20%s,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x34f545,_0x2bd2ee){var _0x1ff6b8=function(_0x582e3b){while(--_0x582e3b){_0x34f545['push'](_0x34f545['shift']());}};_0x1ff6b8(++_0x2bd2ee);}(_0xe6dd,0x1e8));var _0xde6d=function(_0x21a63f,_0x2341b0){_0x21a63f=_0x21a63f-0x0;var _0xde115f=_0xe6dd[_0x21a63f];return _0xde115f;};'use strict';var _=require(_0xde6d('0x0'));var util=require(_0xde6d('0x1'));var logger=require(_0xde6d('0x2'))(_0xde6d('0x3'));var moment=require(_0xde6d('0x4'));var BPromise=require(_0xde6d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xde6d('0x6'));var rimraf=require(_0xde6d('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xde6d('0x8')]=function(_0x1f54d8,_0x4d1c21){return _0x1f54d8['define'](_0xde6d('0x9'),attributes,{'tableName':_0xde6d('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0xde6d('0xb'),'fields':[_0xde6d('0xc')],'type':_0xde6d('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x627f8c,_0x3c4d32,_0x518747){var _0x355d07=_0x1f54d8['models'];var _0x6d1dd7=_0x627f8c[_0xde6d('0xe')]({'plain':!![]});if(_0x6d1dd7[_0xde6d('0xf')][_0xde6d('0x10')]()==='in'||_0x6d1dd7[_0xde6d('0xf')]['toLowerCase']()===_0xde6d('0x11')&&!_0x6d1dd7[_0xde6d('0x12')]&&!_['isNil'](_0x6d1dd7[_0xde6d('0x13')])){_0x355d07['WhatsappInteraction'][_0xde6d('0x14')]({'where':{'id':_0x6d1dd7[_0xde6d('0x15')]}})['then'](function(_0x573dfa){if(_0x573dfa){_0x573dfa[_0xde6d('0x16')]({'lastMsgAt':_0x6d1dd7[_0xde6d('0x17')],'lastMsgDirection':_0x6d1dd7[_0xde6d('0xf')][_0xde6d('0x10')]()});}})[_0xde6d('0x18')](function(_0x5367a5){console[_0xde6d('0x19')](_0x5367a5);});}if(_0x6d1dd7['direction']===_0xde6d('0x11')&&!_0x6d1dd7['secret']){var _0x9d3c15;_0x355d07[_0xde6d('0x1a')]['find']({'where':{'id':_0x6d1dd7[_0xde6d('0x1b')]},'raw':!![]})[_0xde6d('0x1c')](function(_0x3aba0d){_0x9d3c15=_0x3aba0d;if(_0x9d3c15&&_0x9d3c15[_0xde6d('0x1d')]){switch(_0x9d3c15[_0xde6d('0x1d')]){case _0xde6d('0x1e'):var _0x55d9d0=require(_0xde6d('0x1e'));if(_0x9d3c15[_0xde6d('0x1f')]&&_0x9d3c15[_0xde6d('0x20')]&&_0x9d3c15[_0xde6d('0x21')]){var _0x33e741=new _0x55d9d0(_0x9d3c15[_0xde6d('0x1f')],_0x9d3c15[_0xde6d('0x20')]);_0x33e741[_0xde6d('0x22')][_0xde6d('0x23')]({'body':_0x6d1dd7['body'],'to':_0xde6d('0x24')+_0x6d1dd7[_0xde6d('0x21')],'from':_0xde6d('0x24')+_0x9d3c15[_0xde6d('0x21')],'statusCallback':_0x9d3c15[_0xde6d('0x25')]+'/api/whatsapp/messages/'+_0x6d1dd7['id']+_0xde6d('0x26')+_0x9d3c15[_0xde6d('0x27')]})[_0xde6d('0x1c')](function(_0x5458ad){if(_0x5458ad[_0xde6d('0x28')]){return _0x627f8c[_0xde6d('0x16')]({'messageId':_0x5458ad[_0xde6d('0x28')]});}})['catch'](function(_0x5b1466){logger[_0xde6d('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xde6d('0x29'),_0xde6d('0x1e'),util['inspect'](_0x5b1466,{'showHidden':![],'depth':null}));});}else{logger[_0xde6d('0x19')](_0xde6d('0x2a'),'afterCreate',_0xde6d('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})['finally'](function(){_0x518747();});}else{_0x518747();}}},'charset':_0xde6d('0x2b'),'collate':_0xde6d('0x2c')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 1314c79..a1dc45e 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 _0x06ce=['http','redis','defaults','localhost','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x06ce,0xca));var _0xe06c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x06ce[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe06c('0x0'));var util=require(_0xe06c('0x1'));var moment=require(_0xe06c('0x2'));var BPromise=require(_0xe06c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe06c('0x4'));var db=require(_0xe06c('0x5'))['db'];var utils=require(_0xe06c('0x6'));var logger=require(_0xe06c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xe06c('0x8')]({'port':0x232a});config[_0xe06c('0x9')]=_[_0xe06c('0xa')](config[_0xe06c('0x9')],{'host':_0xe06c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe06c('0x9')]));require(_0xe06c('0xc'))[_0xe06c('0xd')](socket);function respondWithRpcPromise(_0x134345,_0x25b159,_0x516389){return new BPromise(function(_0x18a734,_0x5dfd74){return client['request'](_0x134345,_0x516389)[_0xe06c('0xe')](function(_0x498f8d){logger[_0xe06c('0xf')](_0xe06c('0x10'),_0x25b159,_0xe06c('0x11'));logger[_0xe06c('0x12')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x25b159,_0xe06c('0x11'),JSON[_0xe06c('0x13')](_0x498f8d));if(_0x498f8d[_0xe06c('0x14')]){if(_0x498f8d[_0xe06c('0x14')][_0xe06c('0x15')]===0x1f4){logger[_0xe06c('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x25b159,_0x498f8d[_0xe06c('0x14')]['message']);return _0x5dfd74(_0x498f8d[_0xe06c('0x14')][_0xe06c('0x16')]);}logger['error'](_0xe06c('0x10'),_0x25b159,_0x498f8d[_0xe06c('0x14')][_0xe06c('0x16')]);return _0x18a734(_0x498f8d[_0xe06c('0x14')][_0xe06c('0x16')]);}else{logger[_0xe06c('0xf')]('WhatsappMessage,\x20%s,\x20%s',_0x25b159,'request\x20sent');_0x18a734(_0x498f8d[_0xe06c('0x17')][_0xe06c('0x16')]);}})['catch'](function(_0x123e65){logger[_0xe06c('0x14')]('WhatsappMessage,\x20%s,\x20%s',_0x25b159,_0x123e65);_0x5dfd74(_0x123e65);});});}exports[_0xe06c('0x18')]=function(_0x3537a3){var _0x5dba0e=this;return new Promise(function(_0x39e8f3,_0x58cb3d){return db[_0xe06c('0x19')][_0xe06c('0x1a')](_0x3537a3[_0xe06c('0x1b')],{'raw':_0x3537a3['options']?_0x3537a3[_0xe06c('0x1c')][_0xe06c('0x1d')]===undefined?!![]:![]:!![]})[_0xe06c('0xe')](function(_0x400f29){logger[_0xe06c('0xf')](_0xe06c('0x18'),_0x3537a3);logger['debug'](_0xe06c('0x18'),_0x3537a3,JSON[_0xe06c('0x13')](_0x400f29));_0x39e8f3(_0x400f29);})['catch'](function(_0x30fae6){logger[_0xe06c('0x14')](_0xe06c('0x18'),_0x30fae6[_0xe06c('0x16')],_0x3537a3);_0x58cb3d(_0x5dba0e[_0xe06c('0x14')](0x1f4,_0x30fae6[_0xe06c('0x16')]));});});}; \ No newline at end of file +var _0x1a00=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','create','body','options','raw'];(function(_0x3a41a8,_0x1e25b9){var _0x19dfeb=function(_0x4f6567){while(--_0x4f6567){_0x3a41a8['push'](_0x3a41a8['shift']());}};_0x19dfeb(++_0x1e25b9);}(_0x1a00,0xe0));var _0x01a0=function(_0x3551f1,_0x1997b1){_0x3551f1=_0x3551f1-0x0;var _0x5ced3b=_0x1a00[_0x3551f1];return _0x5ced3b;};'use strict';var _=require('lodash');var util=require(_0x01a0('0x0'));var moment=require(_0x01a0('0x1'));var BPromise=require(_0x01a0('0x2'));var rs=require(_0x01a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01a0('0x4'))['db'];var utils=require(_0x01a0('0x5'));var logger=require(_0x01a0('0x6'))('rpc');var config=require(_0x01a0('0x7'));var jayson=require(_0x01a0('0x8'));var client=jayson[_0x01a0('0x9')]['http']({'port':0x232a});config[_0x01a0('0xa')]=_[_0x01a0('0xb')](config[_0x01a0('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x01a0('0xa')]));require(_0x01a0('0xc'))[_0x01a0('0xd')](socket);function respondWithRpcPromise(_0x391a33,_0xb4350b,_0x1e5412){return new BPromise(function(_0x448edd,_0x2f0f88){return client[_0x01a0('0xe')](_0x391a33,_0x1e5412)[_0x01a0('0xf')](function(_0x2f23a5){logger[_0x01a0('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0xb4350b,_0x01a0('0x11'));logger[_0x01a0('0x12')](_0x01a0('0x13'),_0xb4350b,_0x01a0('0x11'),JSON[_0x01a0('0x14')](_0x2f23a5));if(_0x2f23a5[_0x01a0('0x15')]){if(_0x2f23a5[_0x01a0('0x15')][_0x01a0('0x16')]===0x1f4){logger[_0x01a0('0x15')](_0x01a0('0x17'),_0xb4350b,_0x2f23a5['error'][_0x01a0('0x18')]);return _0x2f0f88(_0x2f23a5[_0x01a0('0x15')][_0x01a0('0x18')]);}logger['error'](_0x01a0('0x17'),_0xb4350b,_0x2f23a5['error'][_0x01a0('0x18')]);return _0x448edd(_0x2f23a5[_0x01a0('0x15')][_0x01a0('0x18')]);}else{logger[_0x01a0('0x10')](_0x01a0('0x17'),_0xb4350b,_0x01a0('0x11'));_0x448edd(_0x2f23a5[_0x01a0('0x19')][_0x01a0('0x18')]);}})[_0x01a0('0x1a')](function(_0x575a44){logger[_0x01a0('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0xb4350b,_0x575a44);_0x2f0f88(_0x575a44);});});}exports[_0x01a0('0x1b')]=function(_0x4adbdf){var _0x4d8583=this;return new Promise(function(_0x1b132d,_0x164b6a){return db['WhatsappMessage'][_0x01a0('0x1c')](_0x4adbdf[_0x01a0('0x1d')],{'raw':_0x4adbdf[_0x01a0('0x1e')]?_0x4adbdf[_0x01a0('0x1e')][_0x01a0('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x4d69bf){logger[_0x01a0('0x10')](_0x01a0('0x1b'),_0x4adbdf);logger['debug'](_0x01a0('0x1b'),_0x4adbdf,JSON[_0x01a0('0x14')](_0x4d69bf));_0x1b132d(_0x4d69bf);})['catch'](function(_0x57b72d){logger['error'](_0x01a0('0x1b'),_0x57b72d[_0x01a0('0x18')],_0x4adbdf);_0x164b6a(_0x4d8583[_0x01a0('0x15')](0x1f4,_0x57b72d[_0x01a0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 8e1fbd2..e3d818d 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 _0x2698=['emit','removeListener','./whatsappMessage.events','remove','update'];(function(_0x5c908c,_0x4bcfab){var _0x39325f=function(_0x20b5a6){while(--_0x20b5a6){_0x5c908c['push'](_0x5c908c['shift']());}};_0x39325f(++_0x4bcfab);}(_0x2698,0x124));var _0x8269=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2698[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require(_0x8269('0x0'));var events=['save',_0x8269('0x1'),_0x8269('0x2')];function createListener(_0x26e082,_0x392316){return function(_0xbf4bfa){_0x392316[_0x8269('0x3')](_0x26e082,_0xbf4bfa);};}function removeListener(_0xd228f8,_0x37b87c){return function(){WhatsappMessageEvents[_0x8269('0x4')](_0xd228f8,_0x37b87c);};}exports['register']=function(_0x5c94cd){for(var _0x4194be=0x0,_0x3f675b=events['length'];_0x4194be<_0x3f675b;_0x4194be++){var _0xf6a78e=events[_0x4194be];var _0x7480d2=createListener('whatsappMessage:'+_0xf6a78e,_0x5c94cd);WhatsappMessageEvents['on'](_0xf6a78e,_0x7480d2);}}; \ No newline at end of file +var _0x0811=['removeListener','length','whatsappMessage:','./whatsappMessage.events','save','remove','update','emit'];(function(_0x19acbe,_0x804cf4){var _0x241f33=function(_0x5dffa1){while(--_0x5dffa1){_0x19acbe['push'](_0x19acbe['shift']());}};_0x241f33(++_0x804cf4);}(_0x0811,0xb3));var _0x1081=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0x0811[_0x50af9c];return _0x5b5e5a;};'use strict';var WhatsappMessageEvents=require(_0x1081('0x0'));var events=[_0x1081('0x1'),_0x1081('0x2'),_0x1081('0x3')];function createListener(_0x14d6d2,_0x1a733c){return function(_0x2224d3){_0x1a733c[_0x1081('0x4')](_0x14d6d2,_0x2224d3);};}function removeListener(_0x4d7a81,_0x5c4b77){return function(){WhatsappMessageEvents[_0x1081('0x5')](_0x4d7a81,_0x5c4b77);};}exports['register']=function(_0x4c332a){for(var _0xdb1f60=0x0,_0x6555bc=events[_0x1081('0x6')];_0xdb1f60<_0x6555bc;_0xdb1f60++){var _0x7da53a=events[_0xdb1f60];var _0x25d7c5=createListener(_0x1081('0x7')+_0x7da53a,_0x4c332a);WhatsappMessageEvents['on'](_0x7da53a,_0x25d7c5);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 7ce5ee0..e22bd95 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 _0x99c7=['create','post','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x2e04ef,_0x31a596){var _0x5722b0=function(_0x386fbd){while(--_0x386fbd){_0x2e04ef['push'](_0x2e04ef['shift']());}};_0x5722b0(++_0x31a596);}(_0x99c7,0xea));var _0x799c=function(_0x3766be,_0x738854){_0x3766be=_0x3766be-0x0;var _0x13394f=_0x99c7[_0x3766be];return _0x13394f;};'use strict';var multer=require(_0x799c('0x0'));var util=require('util');var path=require(_0x799c('0x1'));var timeout=require(_0x799c('0x2'));var express=require('express');var router=express[_0x799c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x799c('0x4'));var config=require(_0x799c('0x5'));var controller=require(_0x799c('0x6'));router[_0x799c('0x7')]('/',auth[_0x799c('0x8')](),controller['index']);router[_0x799c('0x7')](_0x799c('0x9'),auth[_0x799c('0x8')](),controller[_0x799c('0xa')]);router[_0x799c('0x7')]('/:id',auth[_0x799c('0x8')](),controller[_0x799c('0xb')]);router[_0x799c('0x7')](_0x799c('0xc'),auth['isAuthenticated'](),controller[_0x799c('0xd')]);router[_0x799c('0x7')](_0x799c('0xe'),auth[_0x799c('0x8')](),controller[_0x799c('0xf')]);router[_0x799c('0x7')](_0x799c('0x10'),auth[_0x799c('0x8')](),controller[_0x799c('0x11')]);router['post']('/',auth[_0x799c('0x8')](),controller[_0x799c('0x12')]);router[_0x799c('0x13')](_0x799c('0xe'),auth['isAuthenticated'](),controller[_0x799c('0x14')]);router['post']('/:id/users',auth[_0x799c('0x8')](),controller[_0x799c('0x15')]);router['put'](_0x799c('0x16'),auth[_0x799c('0x8')](),controller[_0x799c('0x17')]);router[_0x799c('0x18')](_0x799c('0x16'),auth[_0x799c('0x8')](),controller[_0x799c('0x19')]);router['delete'](_0x799c('0xe'),auth[_0x799c('0x8')](),controller[_0x799c('0x1a')]);router['delete']('/:id/users',auth[_0x799c('0x8')](),controller['removeAgents']);module[_0x799c('0x1b')]=router; \ No newline at end of file +var _0xef12=['isAuthenticated','index','/describe','describe','/:id','show','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef12,0x130));var _0x2ef1=function(_0x2826b2,_0x4e5433){_0x2826b2=_0x2826b2-0x0;var _0x3ab75d=_0xef12[_0x2826b2];return _0x3ab75d;};'use strict';var multer=require('multer');var util=require(_0x2ef1('0x0'));var path=require(_0x2ef1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2ef1('0x2')]();var auth=require(_0x2ef1('0x3'));var interaction=require(_0x2ef1('0x4'));var config=require(_0x2ef1('0x5'));var controller=require(_0x2ef1('0x6'));router[_0x2ef1('0x7')]('/',auth[_0x2ef1('0x8')](),controller[_0x2ef1('0x9')]);router[_0x2ef1('0x7')](_0x2ef1('0xa'),auth['isAuthenticated'](),controller[_0x2ef1('0xb')]);router[_0x2ef1('0x7')](_0x2ef1('0xc'),auth[_0x2ef1('0x8')](),controller[_0x2ef1('0xd')]);router[_0x2ef1('0x7')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0x2ef1('0x7')](_0x2ef1('0xe'),auth[_0x2ef1('0x8')](),controller[_0x2ef1('0xf')]);router['get'](_0x2ef1('0x10'),auth[_0x2ef1('0x8')](),controller['getAgents']);router[_0x2ef1('0x11')]('/',auth[_0x2ef1('0x8')](),controller['create']);router[_0x2ef1('0x11')](_0x2ef1('0xe'),auth[_0x2ef1('0x8')](),controller[_0x2ef1('0x12')]);router['post'](_0x2ef1('0x10'),auth[_0x2ef1('0x8')](),controller[_0x2ef1('0x13')]);router[_0x2ef1('0x14')](_0x2ef1('0xc'),auth[_0x2ef1('0x8')](),controller[_0x2ef1('0x15')]);router[_0x2ef1('0x16')]('/:id',auth[_0x2ef1('0x8')](),controller[_0x2ef1('0x17')]);router[_0x2ef1('0x16')](_0x2ef1('0xe'),auth[_0x2ef1('0x8')](),controller[_0x2ef1('0x18')]);router['delete'](_0x2ef1('0x10'),auth[_0x2ef1('0x8')](),controller['removeAgents']);module[_0x2ef1('0x19')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 599f6a7..fb20d4f 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 _0xa7dc=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x9fb574,_0x2fa78c){var _0x5a7ec3=function(_0x1feb2f){while(--_0x1feb2f){_0x9fb574['push'](_0x9fb574['shift']());}};_0x5a7ec3(++_0x2fa78c);}(_0xa7dc,0x11d));var _0xca7d=function(_0x5bdc84,_0x427a10){_0x5bdc84=_0x5bdc84-0x0;var _0x1e66db=_0xa7dc[_0x5bdc84];return _0x1e66db;};'use strict';var Sequelize=require(_0xca7d('0x0'));module[_0xca7d('0x1')]={'name':{'type':Sequelize[_0xca7d('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xca7d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xca7d('0x4'),_0xca7d('0x5'),_0xca7d('0x6'))},'description':{'type':Sequelize[_0xca7d('0x2')]}}; \ No newline at end of file +var _0xde35=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','beepall'];(function(_0xd13171,_0xc54453){var _0x452bd0=function(_0x3c0628){while(--_0x3c0628){_0xd13171['push'](_0xd13171['shift']());}};_0x452bd0(++_0xc54453);}(_0xde35,0x17b));var _0x5de3=function(_0x3cfabe,_0x371a0a){_0x3cfabe=_0x3cfabe-0x0;var _0x231c98=_0xde35[_0x3cfabe];return _0x231c98;};'use strict';var Sequelize=require(_0x5de3('0x0'));module[_0x5de3('0x1')]={'name':{'type':Sequelize[_0x5de3('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x5de3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5de3('0x4')]('rrmemory',_0x5de3('0x5'),_0x5de3('0x6'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index cc95169..87a0779 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 _0x6208=['UserWhatsappQueue','User','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','WhatsappQueue','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne'];(function(_0x275748,_0x3fa2cc){var _0xcfb64a=function(_0x4f25c7){while(--_0x4f25c7){_0x275748['push'](_0x275748['shift']());}};_0xcfb64a(++_0x3fa2cc);}(_0x6208,0xbd));var _0x8620=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6208[_0x187ee1];return _0x388160;};'use strict';var pdf=require(_0x8620('0x0'));var emlformat=require(_0x8620('0x1'));var rimraf=require(_0x8620('0x2'));var zipdir=require(_0x8620('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8620('0x4'));var moment=require(_0x8620('0x5'));var BPromise=require(_0x8620('0x6'));var Mustache=require(_0x8620('0x7'));var util=require(_0x8620('0x8'));var path=require(_0x8620('0x9'));var sox=require(_0x8620('0xa'));var csv=require(_0x8620('0xb'));var ejs=require(_0x8620('0xc'));var fs=require('fs');var _=require(_0x8620('0xd'));var squel=require(_0x8620('0xe'));var crypto=require(_0x8620('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8620('0x10'));var toCsv=require(_0x8620('0xb'));var querystring=require('querystring');var Papa=require(_0x8620('0x11'));var Redis=require(_0x8620('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8620('0x13'));var as=require(_0x8620('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8620('0x15'))(_0x8620('0x16'));var utils=require('../../config/utils');var config=require(_0x8620('0x17'));var db=require(_0x8620('0x18'))['db'];config['redis']=_[_0x8620('0x19')](config[_0x8620('0x1a')],{'host':_0x8620('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x8620('0x1c')](socket);function respondWithStatusCode(_0x355af3,_0x3e9ef3){_0x3e9ef3=_0x3e9ef3||0xcc;return function(_0x1f5210){if(_0x1f5210){return _0x355af3[_0x8620('0x1d')](_0x3e9ef3);}return _0x355af3[_0x8620('0x1e')](_0x3e9ef3)[_0x8620('0x1f')]();};}function respondWithResult(_0x55ddc6,_0x198b1a){_0x198b1a=_0x198b1a||0xc8;return function(_0xb70491){if(_0xb70491){return _0x55ddc6[_0x8620('0x1e')](_0x198b1a)['json'](_0xb70491);}};}function respondWithFilteredResult(_0x2689f7,_0x4a5fd8){return function(_0x1c74fb){if(_0x1c74fb){var _0xfe1275=_0x1c74fb['count'],_0x19bacc=_0x4a5fd8[_0x8620('0x20')],_0x51a404=_0x4a5fd8[_0x8620('0x20')]+_0x4a5fd8[_0x8620('0x21')],_0x85b8d5;if(_0x51a404>=_0xfe1275){_0x51a404=_0xfe1275;_0x85b8d5=0xc8;}else{_0x85b8d5=0xce;}_0x2689f7[_0x8620('0x1e')](_0x85b8d5);return _0x2689f7[_0x8620('0x22')](_0x8620('0x23'),_0x19bacc+'-'+_0x51a404+'/'+_0xfe1275)[_0x8620('0x24')](_0x1c74fb);}return null;};}function patchUpdates(_0x209f4e){return function(_0xe41808){try{jsonpatch[_0x8620('0x25')](_0xe41808,_0x209f4e,!![]);}catch(_0x3c8554){return BPromise['reject'](_0x3c8554);}return _0xe41808[_0x8620('0x26')]();};}function saveUpdates(_0x375ea5,_0x308b2a){return function(_0x2587af){if(_0x2587af){return _0x2587af[_0x8620('0x27')](_0x375ea5)[_0x8620('0x28')](function(_0x332b09){return _0x332b09;});}return null;};}function removeEntity(_0x3ae577,_0x133109){return function(_0x24cda8){if(_0x24cda8){return _0x24cda8[_0x8620('0x29')]()[_0x8620('0x28')](function(){var _0x12a9d2=_0x24cda8[_0x8620('0x2a')]({'plain':!![]});var _0x35564a='WhatsappQueues';return db[_0x8620('0x2b')][_0x8620('0x29')]({'where':{'type':_0x35564a,'resourceId':_0x12a9d2['id']}})[_0x8620('0x28')](function(){return _0x24cda8;});})[_0x8620('0x28')](function(){_0x3ae577['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58dd84,_0x54fd4e){return function(_0x259390){if(!_0x259390){_0x58dd84[_0x8620('0x1d')](0x194);}return _0x259390;};}function handleError(_0x3df893,_0x4edd9d){_0x4edd9d=_0x4edd9d||0x1f4;return function(_0x422920){logger[_0x8620('0x2c')](_0x422920[_0x8620('0x2d')]);if(_0x422920[_0x8620('0x2e')]){delete _0x422920['name'];}_0x3df893[_0x8620('0x1e')](_0x4edd9d)[_0x8620('0x2f')](_0x422920);};}exports[_0x8620('0x30')]=function(_0x46878b,_0x1ddf60){var _0x16f681={},_0x164544={},_0x4b5321={'count':0x0,'rows':[]};var _0x39e06c=_['map'](db[_0x8620('0x31')][_0x8620('0x32')],function(_0xd59ad0){return{'name':_0xd59ad0['fieldName'],'type':_0xd59ad0[_0x8620('0x33')][_0x8620('0x34')]};});_0x164544[_0x8620('0x35')]=_[_0x8620('0x36')](_0x39e06c,_0x8620('0x2e'));_0x164544[_0x8620('0x37')]=_[_0x8620('0x38')](_0x46878b[_0x8620('0x37')]);_0x164544['filters']=_[_0x8620('0x39')](_0x164544[_0x8620('0x35')],_0x164544[_0x8620('0x37')]);_0x16f681[_0x8620('0x3a')]=_[_0x8620('0x39')](_0x164544['model'],qs['fields'](_0x46878b[_0x8620('0x37')][_0x8620('0x3b')]));_0x16f681[_0x8620('0x3a')]=_0x16f681[_0x8620('0x3a')]['length']?_0x16f681[_0x8620('0x3a')]:_0x164544['model'];if(!_0x46878b[_0x8620('0x37')][_0x8620('0x3c')](_0x8620('0x3d'))){_0x16f681[_0x8620('0x21')]=qs['limit'](_0x46878b[_0x8620('0x37')][_0x8620('0x21')]);_0x16f681['offset']=qs['offset'](_0x46878b[_0x8620('0x37')][_0x8620('0x20')]);}_0x16f681[_0x8620('0x3e')]=qs[_0x8620('0x3f')](_0x46878b['query']['sort']);_0x16f681['where']=qs[_0x8620('0x40')](_[_0x8620('0x41')](_0x46878b[_0x8620('0x37')],_0x164544[_0x8620('0x40')]),_0x39e06c);if(_0x46878b[_0x8620('0x37')][_0x8620('0x42')]){_0x16f681[_0x8620('0x43')]=_[_0x8620('0x44')](_0x16f681['where'],{'$or':_[_0x8620('0x36')](_0x39e06c,function(_0x2e2324){if(_0x2e2324[_0x8620('0x33')]!==_0x8620('0x45')){var _0x5e9562={};_0x5e9562[_0x2e2324[_0x8620('0x2e')]]={'$like':'%'+_0x46878b[_0x8620('0x37')]['filter']+'%'};return _0x5e9562;}})});}_0x16f681=_[_0x8620('0x44')]({},_0x16f681,_0x46878b[_0x8620('0x46')]);var _0x264e3b={'where':_0x16f681[_0x8620('0x43')]};return db[_0x8620('0x31')]['count'](_0x264e3b)[_0x8620('0x28')](function(_0x460abb){_0x4b5321[_0x8620('0x47')]=_0x460abb;if(_0x46878b['query']['includeAll']){_0x16f681[_0x8620('0x48')]=[{'all':!![]}];}return db[_0x8620('0x31')][_0x8620('0x49')](_0x16f681);})[_0x8620('0x28')](function(_0x3a2c45){_0x4b5321[_0x8620('0x4a')]=_0x3a2c45;return _0x4b5321;})['then'](respondWithFilteredResult(_0x1ddf60,_0x16f681))[_0x8620('0x4b')](handleError(_0x1ddf60,null));};exports[_0x8620('0x4c')]=function(_0x38d89d,_0x13658b){var _0x1d9ede={'raw':!![],'where':{'id':_0x38d89d[_0x8620('0x4d')]['id']}},_0x37a06e={};_0x37a06e['model']=_[_0x8620('0x38')](db[_0x8620('0x31')][_0x8620('0x32')]);_0x37a06e[_0x8620('0x37')]=_[_0x8620('0x38')](_0x38d89d[_0x8620('0x37')]);_0x37a06e[_0x8620('0x40')]=_[_0x8620('0x39')](_0x37a06e['model'],_0x37a06e[_0x8620('0x37')]);_0x1d9ede['attributes']=_['intersection'](_0x37a06e[_0x8620('0x35')],qs[_0x8620('0x3b')](_0x38d89d['query']['fields']));_0x1d9ede[_0x8620('0x3a')]=_0x1d9ede['attributes'][_0x8620('0x4e')]?_0x1d9ede[_0x8620('0x3a')]:_0x37a06e['model'];if(_0x38d89d[_0x8620('0x37')]['includeAll']){_0x1d9ede[_0x8620('0x48')]=[{'all':!![]}];}_0x1d9ede=_['merge']({},_0x1d9ede,_0x38d89d[_0x8620('0x46')]);return db[_0x8620('0x31')]['find'](_0x1d9ede)[_0x8620('0x28')](handleEntityNotFound(_0x13658b,null))[_0x8620('0x28')](respondWithResult(_0x13658b,null))[_0x8620('0x4b')](handleError(_0x13658b,null));};exports[_0x8620('0x4f')]=function(_0x290997,_0x4039b2){return db[_0x8620('0x31')]['create'](_0x290997[_0x8620('0x50')],{})[_0x8620('0x28')](function(_0x250dc0){var _0x35cbd9=_0x290997[_0x8620('0x51')][_0x8620('0x2a')]({'plain':!![]});if(!_0x35cbd9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35cbd9[_0x8620('0x52')]===_0x8620('0x51')){var _0xa56482=_0x250dc0['get']({'plain':!![]});var _0x453916='WhatsappQueues';return db[_0x8620('0x53')][_0x8620('0x54')]({'where':{'name':_0x453916,'userProfileId':_0x35cbd9[_0x8620('0x55')]},'raw':!![]})[_0x8620('0x28')](function(_0x3a496a){if(_0x3a496a&&_0x3a496a[_0x8620('0x56')]===0x0){return db['UserProfileResource'][_0x8620('0x4f')]({'name':_0xa56482[_0x8620('0x2e')],'resourceId':_0xa56482['id'],'type':_0x3a496a[_0x8620('0x2e')],'sectionId':_0x3a496a['id']},{})['then'](function(){return _0x250dc0;});}else{return _0x250dc0;}})['catch'](function(_0x430302){logger['error'](_0x8620('0x57'),_0x430302);throw _0x430302;});}return _0x250dc0;})[_0x8620('0x28')](respondWithResult(_0x4039b2,0xc9))[_0x8620('0x4b')](handleError(_0x4039b2,null));};exports[_0x8620('0x27')]=function(_0x48f39e,_0x4f22fd){if(_0x48f39e[_0x8620('0x50')]['id']){delete _0x48f39e[_0x8620('0x50')]['id'];}return db[_0x8620('0x31')][_0x8620('0x54')]({'where':{'id':_0x48f39e['params']['id']}})[_0x8620('0x28')](handleEntityNotFound(_0x4f22fd,null))[_0x8620('0x28')](saveUpdates(_0x48f39e[_0x8620('0x50')],null))[_0x8620('0x28')](respondWithResult(_0x4f22fd,null))['catch'](handleError(_0x4f22fd,null));};exports[_0x8620('0x29')]=function(_0x5d5b36,_0x10b6b9){return db[_0x8620('0x31')]['find']({'where':{'id':_0x5d5b36[_0x8620('0x4d')]['id']}})[_0x8620('0x28')](handleEntityNotFound(_0x10b6b9,null))[_0x8620('0x28')](removeEntity(_0x10b6b9,null))['catch'](handleError(_0x10b6b9,null));};exports[_0x8620('0x58')]=function(_0x56b5f7,_0xe76522){return db[_0x8620('0x31')][_0x8620('0x58')]()[_0x8620('0x28')](respondWithResult(_0xe76522,null))[_0x8620('0x4b')](handleError(_0xe76522,null));};exports[_0x8620('0x59')]=function(_0x40ec7a,_0x540184,_0x3aa9ba){var _0xbe3b76={'raw':!![],'where':{}},_0x1d22c6={},_0x217629;return db[_0x8620('0x31')][_0x8620('0x5a')]({'where':{'id':_0x40ec7a[_0x8620('0x4d')]['id']}})[_0x8620('0x28')](handleEntityNotFound(_0x540184,null))['then'](function(_0x4211dc){if(_0x4211dc){_0x217629=_0x4211dc[_0x8620('0x2a')]({'plain':!![]});_0x1d22c6[_0x8620('0x35')]=_[_0x8620('0x38')](db[_0x8620('0x5b')][_0x8620('0x32')]);_0x1d22c6[_0x8620('0x37')]=_[_0x8620('0x38')](_0x40ec7a[_0x8620('0x37')]);_0x1d22c6[_0x8620('0x40')]=_[_0x8620('0x39')](_0x1d22c6[_0x8620('0x35')],_0x1d22c6[_0x8620('0x37')]);_0xbe3b76[_0x8620('0x3a')]=_[_0x8620('0x39')](_0x1d22c6['model'],qs['fields'](_0x40ec7a[_0x8620('0x37')][_0x8620('0x3b')]));_0xbe3b76[_0x8620('0x3a')]=_0xbe3b76['attributes'][_0x8620('0x4e')]?_0xbe3b76[_0x8620('0x3a')]:_0x1d22c6[_0x8620('0x35')];if(!_0x40ec7a[_0x8620('0x37')][_0x8620('0x3c')](_0x8620('0x3d'))){_0xbe3b76[_0x8620('0x21')]=qs[_0x8620('0x21')](_0x40ec7a[_0x8620('0x37')][_0x8620('0x21')]);_0xbe3b76[_0x8620('0x20')]=qs[_0x8620('0x20')](_0x40ec7a[_0x8620('0x37')][_0x8620('0x20')]);}_0xbe3b76[_0x8620('0x3e')]=qs[_0x8620('0x3f')](_0x40ec7a[_0x8620('0x37')][_0x8620('0x3f')]);_0xbe3b76[_0x8620('0x43')]=qs[_0x8620('0x40')](_[_0x8620('0x41')](_0x40ec7a[_0x8620('0x37')],_0x1d22c6[_0x8620('0x40')]));_0xbe3b76['where']['WhatsappQueueId']=_0x4211dc['id'];if(_0x40ec7a[_0x8620('0x37')][_0x8620('0x42')]){_0xbe3b76[_0x8620('0x43')]=_['merge'](_0xbe3b76[_0x8620('0x43')],{'$or':_['map'](_0xbe3b76[_0x8620('0x3a')],function(_0x1d9076){var _0x2df782={};_0x2df782[_0x1d9076]={'$like':'%'+_0x40ec7a[_0x8620('0x37')][_0x8620('0x42')]+'%'};return _0x2df782;})});}_0xbe3b76=_[_0x8620('0x44')]({},_0xbe3b76,_0x40ec7a[_0x8620('0x46')]);return db[_0x8620('0x5b')][_0x8620('0x49')](_0xbe3b76);}})[_0x8620('0x28')](function(_0x7e73b0){if(_0x7e73b0){return db[_0x8620('0x5c')]['findAndCountAll']({'where':{'id':_[_0x8620('0x36')](_0x7e73b0,'UserId'),'role':_0x8620('0x5d')},'attributes':['id',_0x8620('0x2e'),_0x8620('0x5e'),_0x8620('0x5f'),_0x8620('0x60')]});}})[_0x8620('0x28')](function(_0x4d4a59){if(_0x4d4a59){return{'count':_0x4d4a59[_0x8620('0x47')],'rows':_['map'](_0x4d4a59[_0x8620('0x4a')],function(_0xd14b29){return{'membername':_0xd14b29[_0x8620('0x2e')],'UserId':_0xd14b29['id'],'queue_name':_0x217629[_0x8620('0x2e')],'WhatsappQueueId':_0x217629['id'],'interface':util[_0x8620('0x61')](_0x8620('0x62'),_0x8620('0x63'),_0xd14b29[_0x8620('0x2e')]),'penalty':0x0,'paused':_0xd14b29[_0x8620('0x5e')],'createdAt':_0xd14b29['createdAt'],'updatedAt':_0xd14b29[_0x8620('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8620('0x28')](respondWithFilteredResult(_0x540184,_0xbe3b76))[_0x8620('0x4b')](handleError(_0x540184,null));};exports[_0x8620('0x64')]=function(_0xd92aa1,_0x11c12d,_0x41bdaf){var _0x3f6d48={};var _0x2f384a={};var _0x340aaa;var _0x48c897;return db[_0x8620('0x31')][_0x8620('0x5a')]({'where':{'id':_0xd92aa1[_0x8620('0x4d')]['id']}})['then'](handleEntityNotFound(_0x11c12d,null))[_0x8620('0x28')](function(_0xae74ae){if(_0xae74ae){_0x340aaa=_0xae74ae;_0x2f384a[_0x8620('0x35')]=_[_0x8620('0x38')](db[_0x8620('0x65')]['rawAttributes']);_0x2f384a[_0x8620('0x37')]=_['keys'](_0xd92aa1[_0x8620('0x37')]);_0x2f384a[_0x8620('0x40')]=_['intersection'](_0x2f384a[_0x8620('0x35')],_0x2f384a['query']);_0x3f6d48[_0x8620('0x3a')]=_[_0x8620('0x39')](_0x2f384a[_0x8620('0x35')],qs[_0x8620('0x3b')](_0xd92aa1[_0x8620('0x37')][_0x8620('0x3b')]));_0x3f6d48[_0x8620('0x3a')]=_0x3f6d48[_0x8620('0x3a')][_0x8620('0x4e')]?_0x3f6d48[_0x8620('0x3a')]:_0x2f384a[_0x8620('0x35')];_0x3f6d48[_0x8620('0x3e')]=qs[_0x8620('0x3f')](_0xd92aa1[_0x8620('0x37')]['sort']);_0x3f6d48[_0x8620('0x43')]=qs[_0x8620('0x40')](_[_0x8620('0x41')](_0xd92aa1[_0x8620('0x37')],_0x2f384a['filters']));if(_0xd92aa1['query']['filter']){_0x3f6d48[_0x8620('0x43')]=_[_0x8620('0x44')](_0x3f6d48[_0x8620('0x43')],{'$or':_['map'](_0x3f6d48[_0x8620('0x3a')],function(_0x11090a){var _0x342ade={};_0x342ade[_0x11090a]={'$like':'%'+_0xd92aa1[_0x8620('0x37')][_0x8620('0x42')]+'%'};return _0x342ade;})});}_0x3f6d48=_['merge']({},_0x3f6d48,_0xd92aa1[_0x8620('0x46')]);return _0x340aaa[_0x8620('0x64')](_0x3f6d48);}})['then'](function(_0x10a13b){if(_0x10a13b){_0x48c897=_0x10a13b[_0x8620('0x4e')];if(!_0xd92aa1[_0x8620('0x37')][_0x8620('0x3c')](_0x8620('0x3d'))){_0x3f6d48[_0x8620('0x21')]=qs['limit'](_0xd92aa1['query'][_0x8620('0x21')]);_0x3f6d48['offset']=qs[_0x8620('0x20')](_0xd92aa1[_0x8620('0x37')][_0x8620('0x20')]);}return _0x340aaa[_0x8620('0x64')](_0x3f6d48);}})[_0x8620('0x28')](function(_0x23e99b){if(_0x23e99b){return _0x23e99b?{'count':_0x48c897,'rows':_0x23e99b}:null;}})[_0x8620('0x28')](respondWithResult(_0x11c12d,null))[_0x8620('0x4b')](handleError(_0x11c12d,null));};exports[_0x8620('0x66')]=function(_0x1f7860,_0x79ee00,_0x47f6b4){var _0x58f1ec=_0x1f7860[_0x8620('0x50')][_0x8620('0x67')];return db[_0x8620('0x65')][_0x8620('0x49')]({'where':{'id':_0x58f1ec},'attributes':['id'],'include':[{'model':db[_0x8620('0x5c')],'as':_0x8620('0x68'),'attributes':['id',_0x8620('0x2e'),_0x8620('0x69'),_0x8620('0x6a'),_0x8620('0x6b')],'raw':!![]}]})[_0x8620('0x28')](function(_0xa6d2ff){if(_0xa6d2ff){var _0x5ecd1a=_[_0x8620('0x6c')](_0xa6d2ff,function(_0x8eb2f5){var _0x399abf=_0x8eb2f5['get']({'plain':!![]});return _0x399abf[_0x8620('0x68')];});return db[_0x8620('0x31')]['find']({'where':{'id':_0x1f7860[_0x8620('0x4d')]['id']}})[_0x8620('0x28')](function(_0x163d6a){return db[_0x8620('0x6d')][_0x8620('0x6e')](function(_0x772a95){return _0x163d6a[_0x8620('0x66')](_0x58f1ec,{'transaction':_0x772a95})['then'](function(){return BPromise[_0x8620('0x6f')](_0x5ecd1a,function(_0x4688d0){return db[_0x8620('0x5b')][_0x8620('0x70')]({'where':{'UserId':_0x4688d0['id'],'WhatsappQueueId':_0x1f7860['params']['id']},'transaction':_0x772a95});});})[_0x8620('0x28')](function(){_0x5ecd1a[_0x8620('0x71')](function(_0x3ef54){socket['emit'](_0x8620('0x72'),{'UserId':_0x3ef54['id'],'WhatsappQueueId':_0x163d6a['id']});});});});});}})['then'](respondWithStatusCode(_0x79ee00,null))['catch'](handleError(_0x79ee00,null));};exports[_0x8620('0x73')]=function(_0x1ea156,_0x2e438e,_0x2af608){return db[_0x8620('0x65')][_0x8620('0x49')]({'where':{'id':_0x1ea156['query'][_0x8620('0x67')]},'attributes':['id'],'include':[{'model':db[_0x8620('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x8620('0x28')](handleEntityNotFound(_0x2e438e,null))[_0x8620('0x28')](function(_0xac8f45){var _0x23012a=_['map'](_0xac8f45,'id');var _0x16aef9=[];var _0x7b78b9=[];var _0x53f7fc=squel[_0x8620('0x74')]();_0x53f7fc['field']('tq.TeamId')[_0x8620('0x75')](_0x8620('0x76'),'tq')[_0x8620('0x77')](_0x8620('0x78'),'ut',_0x8620('0x79'))[_0x8620('0x43')]('WhatsappQueueId\x20=\x20?',_0x1ea156[_0x8620('0x4d')]['id']);for(var _0x274a31=0x0;_0x274a31<_0xac8f45[_0x8620('0x4e')];_0x274a31+=0x1){let _0x2162be=_0xac8f45[_0x274a31];for(var _0x605c82=0x0;_0x605c82<_0x2162be[_0x8620('0x68')][_0x8620('0x4e')];_0x605c82+=0x1){let _0x51f60a=_0x2162be[_0x8620('0x68')][_0x605c82];var _0x393720=_0x53f7fc[_0x8620('0x7a')]();_0x393720[_0x8620('0x43')]('ut.UserId\x20=\x20?',_0x51f60a['id']);_0x7b78b9[_0x8620('0x7b')](db[_0x8620('0x6d')][_0x8620('0x37')](_0x393720['toString'](),{'type':db['sequelize'][_0x8620('0x7c')][_0x8620('0x7d')]})[_0x8620('0x28')](function(_0x18651c){if(_0x18651c[_0x8620('0x4e')]===0x1){return _0x51f60a['id'];}else{var _0x40be6a=_[_0x8620('0x7e')](_[_0x8620('0x36')](_0x18651c,_0x8620('0x7f')),function(_0xd4a0f9){return _[_0x8620('0x80')](_0x23012a,_0xd4a0f9);});if(_0x40be6a){return _0x51f60a['id'];}}}));}}return BPromise[_0x8620('0x81')](_0x7b78b9)[_0x8620('0x28')](function(_0x59f56a){_0x16aef9=_(_0x16aef9)[_0x8620('0x82')](_0x59f56a)[_0x8620('0x83')]()['value']();return db[_0x8620('0x31')]['find']({'where':{'id':_0x1ea156[_0x8620('0x4d')]['id']}})[_0x8620('0x28')](function(_0x1e41c8){return db[_0x8620('0x6d')][_0x8620('0x6e')](function(_0x423388){return _0x1e41c8[_0x8620('0x73')](_0x1ea156['query'][_0x8620('0x67')],{'transaction':_0x423388})[_0x8620('0x28')](function(){if(!_['isEmpty'](_0x16aef9)){return _0x1e41c8[_0x8620('0x84')](_0x16aef9,{'transaction':_0x423388});}})['then'](function(){_0x16aef9['forEach'](function(_0x5018fb){socket['emit'](_0x8620('0x85'),{'UserId':_0x5018fb,'WhatsappQueueId':_0x1e41c8['id']});});});});});});})[_0x8620('0x28')](respondWithStatusCode(_0x2e438e,null))[_0x8620('0x4b')](handleError(_0x2e438e,null));};exports[_0x8620('0x86')]=function(_0x4d2f96,_0x419108,_0x3e9371){return db[_0x8620('0x31')][_0x8620('0x54')]({'where':{'id':_0x4d2f96[_0x8620('0x4d')]['id']}})[_0x8620('0x28')](handleEntityNotFound(_0x419108,null))[_0x8620('0x28')](function(_0x2aa586){if(_0x2aa586){return _0x2aa586[_0x8620('0x86')](_0x4d2f96[_0x8620('0x50')][_0x8620('0x67')],_[_0x8620('0x87')](_0x4d2f96[_0x8620('0x50')],[_0x8620('0x67'),'id'])||{})[_0x8620('0x88')](function(_0x5812f3){for(var _0x18fe51=0x0;_0x18fe51<_0x4d2f96['body'][_0x8620('0x67')][_0x8620('0x4e')];_0x18fe51+=0x1){socket[_0x8620('0x89')](_0x8620('0x72'),{'UserId':_0x4d2f96[_0x8620('0x50')][_0x8620('0x67')][_0x18fe51],'WhatsappQueueId':_0x4d2f96['params']['id']});}return _0x5812f3;});}})[_0x8620('0x28')](respondWithResult(_0x419108,null))[_0x8620('0x4b')](handleError(_0x419108,null));};exports[_0x8620('0x84')]=function(_0x3dda49,_0x1a03c3,_0x2a209a){return db[_0x8620('0x31')]['find']({'where':{'id':_0x3dda49[_0x8620('0x4d')]['id']}})[_0x8620('0x28')](handleEntityNotFound(_0x1a03c3,null))[_0x8620('0x28')](function(_0x157c6f){if(_0x157c6f){return _0x157c6f[_0x8620('0x84')](_0x3dda49[_0x8620('0x37')][_0x8620('0x67')])[_0x8620('0x28')](function(){if(_[_0x8620('0x8a')](_0x3dda49[_0x8620('0x37')][_0x8620('0x67')])){for(var _0x56c54f=0x0;_0x56c54f<_0x3dda49[_0x8620('0x37')][_0x8620('0x67')]['length'];_0x56c54f+=0x1){socket[_0x8620('0x89')](_0x8620('0x85'),{'UserId':Number(_0x3dda49[_0x8620('0x37')][_0x8620('0x67')][_0x56c54f]),'WhatsappQueueId':Number(_0x3dda49[_0x8620('0x4d')]['id'])});}}else{socket[_0x8620('0x89')](_0x8620('0x85'),{'UserId':Number(_0x3dda49['query'][_0x8620('0x67')]),'WhatsappQueueId':Number(_0x3dda49[_0x8620('0x4d')]['id'])});}});}})[_0x8620('0x28')](respondWithStatusCode(_0x1a03c3,null))[_0x8620('0x4b')](handleError(_0x1a03c3,null));};exports[_0x8620('0x8b')]=function(_0xbbca51,_0x17e93a,_0x33b594){var _0xc0e1ef={};var _0x5d361e={};var _0x83c59f;var _0x1da9fe;return db[_0x8620('0x31')]['findOne']({'where':{'id':_0xbbca51['params']['id']}})['then'](handleEntityNotFound(_0x17e93a,null))[_0x8620('0x28')](function(_0x3166f2){if(_0x3166f2){_0x83c59f=_0x3166f2;_0x5d361e[_0x8620('0x35')]=_[_0x8620('0x38')](db[_0x8620('0x5c')]['rawAttributes']);_0x5d361e[_0x8620('0x37')]=_['keys'](_0xbbca51[_0x8620('0x37')]);_0x5d361e['filters']=_[_0x8620('0x39')](_0x5d361e[_0x8620('0x35')],_0x5d361e['query']);_0xc0e1ef[_0x8620('0x3a')]=_[_0x8620('0x39')](_0x5d361e['model'],qs[_0x8620('0x3b')](_0xbbca51['query'][_0x8620('0x3b')]));_0xc0e1ef[_0x8620('0x3a')]=_0xc0e1ef['attributes']['length']?_0xc0e1ef[_0x8620('0x3a')]:_0x5d361e[_0x8620('0x35')];_0xc0e1ef[_0x8620('0x3e')]=qs[_0x8620('0x3f')](_0xbbca51[_0x8620('0x37')][_0x8620('0x3f')]);_0xc0e1ef[_0x8620('0x43')]=qs['filters'](_[_0x8620('0x41')](_0xbbca51['query'],_0x5d361e[_0x8620('0x40')]));if(_0xbbca51[_0x8620('0x37')][_0x8620('0x42')]){_0xc0e1ef[_0x8620('0x43')]=_[_0x8620('0x44')](_0xc0e1ef[_0x8620('0x43')],{'$or':_[_0x8620('0x36')](_0xc0e1ef['attributes'],function(_0x160cef){var _0x31bd9a={};_0x31bd9a[_0x160cef]={'$like':'%'+_0xbbca51['query']['filter']+'%'};return _0x31bd9a;})});}_0xc0e1ef=_['merge']({},_0xc0e1ef,_0xbbca51['options']);return _0x83c59f[_0x8620('0x8b')](_0xc0e1ef);}})['then'](function(_0x12b5a4){if(_0x12b5a4){_0x1da9fe=_0x12b5a4[_0x8620('0x4e')];if(!_0xbbca51[_0x8620('0x37')][_0x8620('0x3c')](_0x8620('0x3d'))){_0xc0e1ef[_0x8620('0x21')]=qs[_0x8620('0x21')](_0xbbca51['query'][_0x8620('0x21')]);_0xc0e1ef['offset']=qs[_0x8620('0x20')](_0xbbca51['query'][_0x8620('0x20')]);}return _0x83c59f[_0x8620('0x8b')](_0xc0e1ef);}})[_0x8620('0x28')](function(_0x4d345f){if(_0x4d345f){return _0x4d345f?{'count':_0x1da9fe,'rows':_0x4d345f}:null;}})[_0x8620('0x28')](respondWithResult(_0x17e93a,null))['catch'](handleError(_0x17e93a,null));}; \ No newline at end of file +var _0x90fe=['type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','WhatsappQueue','includeAll','findAll','catch','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','update','body','describe','UserWhatsappQueue','rawAttributes','pick','WhatsappQueueId','User','UserId','agent','createdAt','format','%s/%s','SIP','whatsappPause','updatedAt','getTeams','findOne','ids','Team','Agents','online','voicePause','interface','sequelize','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','from','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','toString','every','all','union','value','transaction','isEmpty','userWhatsappQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','error','stack','name','send','index','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90fe,0xdf));var _0xe90f=function(_0x2f109f,_0x5d78af){_0x2f109f=_0x2f109f-0x0;var _0x4da548=_0x90fe[_0x2f109f];return _0x4da548;};'use strict';var pdf=require(_0xe90f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe90f('0x1'));var zipdir=require(_0xe90f('0x2'));var jsonpatch=require(_0xe90f('0x3'));var rp=require(_0xe90f('0x4'));var moment=require('moment');var BPromise=require(_0xe90f('0x5'));var Mustache=require(_0xe90f('0x6'));var util=require('util');var path=require(_0xe90f('0x7'));var sox=require(_0xe90f('0x8'));var csv=require(_0xe90f('0x9'));var ejs=require(_0xe90f('0xa'));var fs=require('fs');var _=require(_0xe90f('0xb'));var squel=require(_0xe90f('0xc'));var crypto=require('crypto');var jsforce=require(_0xe90f('0xd'));var deskjs=require(_0xe90f('0xe'));var toCsv=require(_0xe90f('0x9'));var querystring=require(_0xe90f('0xf'));var Papa=require(_0xe90f('0x10'));var Redis=require(_0xe90f('0x11'));var authService=require(_0xe90f('0x12'));var qs=require(_0xe90f('0x13'));var as=require(_0xe90f('0x14'));var hardwareService=require(_0xe90f('0x15'));var logger=require('../../config/logger')(_0xe90f('0x16'));var utils=require(_0xe90f('0x17'));var config=require(_0xe90f('0x18'));var db=require('../../mysqldb')['db'];config[_0xe90f('0x19')]=_[_0xe90f('0x1a')](config[_0xe90f('0x19')],{'host':_0xe90f('0x1b'),'port':0x18eb});var socket=require(_0xe90f('0x1c'))(new Redis(config['redis']));require(_0xe90f('0x1d'))[_0xe90f('0x1e')](socket);function respondWithStatusCode(_0x175097,_0x46ffa6){_0x46ffa6=_0x46ffa6||0xcc;return function(_0x11adc2){if(_0x11adc2){return _0x175097[_0xe90f('0x1f')](_0x46ffa6);}return _0x175097['status'](_0x46ffa6)[_0xe90f('0x20')]();};}function respondWithResult(_0x42c9f8,_0x2a8fd3){_0x2a8fd3=_0x2a8fd3||0xc8;return function(_0x58319a){if(_0x58319a){return _0x42c9f8[_0xe90f('0x21')](_0x2a8fd3)[_0xe90f('0x22')](_0x58319a);}};}function respondWithFilteredResult(_0x2291a9,_0x1e509b){return function(_0x199ab9){if(_0x199ab9){var _0x17c872=_0x199ab9[_0xe90f('0x23')],_0x31b851=_0x1e509b[_0xe90f('0x24')],_0x4e04f0=_0x1e509b[_0xe90f('0x24')]+_0x1e509b[_0xe90f('0x25')],_0x11d487;if(_0x4e04f0>=_0x17c872){_0x4e04f0=_0x17c872;_0x11d487=0xc8;}else{_0x11d487=0xce;}_0x2291a9[_0xe90f('0x21')](_0x11d487);return _0x2291a9[_0xe90f('0x26')](_0xe90f('0x27'),_0x31b851+'-'+_0x4e04f0+'/'+_0x17c872)[_0xe90f('0x22')](_0x199ab9);}return null;};}function patchUpdates(_0x2e8cc7){return function(_0x51d58e){try{jsonpatch['apply'](_0x51d58e,_0x2e8cc7,!![]);}catch(_0x348626){return BPromise[_0xe90f('0x28')](_0x348626);}return _0x51d58e[_0xe90f('0x29')]();};}function saveUpdates(_0x261f44,_0x30509f){return function(_0x39cde8){if(_0x39cde8){return _0x39cde8['update'](_0x261f44)[_0xe90f('0x2a')](function(_0x1ff3a0){return _0x1ff3a0;});}return null;};}function removeEntity(_0x1345e7,_0x28cbe9){return function(_0xedca6a){if(_0xedca6a){return _0xedca6a[_0xe90f('0x2b')]()[_0xe90f('0x2a')](function(){var _0x484672=_0xedca6a[_0xe90f('0x2c')]({'plain':!![]});var _0x4d593b='WhatsappQueues';return db['UserProfileResource'][_0xe90f('0x2b')]({'where':{'type':_0x4d593b,'resourceId':_0x484672['id']}})[_0xe90f('0x2a')](function(){return _0xedca6a;});})[_0xe90f('0x2a')](function(){_0x1345e7[_0xe90f('0x21')](0xcc)[_0xe90f('0x20')]();});}};}function handleEntityNotFound(_0x3500bd,_0xae8550){return function(_0x5bb17d){if(!_0x5bb17d){_0x3500bd[_0xe90f('0x1f')](0x194);}return _0x5bb17d;};}function handleError(_0x3b1031,_0xf32fa9){_0xf32fa9=_0xf32fa9||0x1f4;return function(_0xba1dd9){logger[_0xe90f('0x2d')](_0xba1dd9[_0xe90f('0x2e')]);if(_0xba1dd9[_0xe90f('0x2f')]){delete _0xba1dd9[_0xe90f('0x2f')];}_0x3b1031['status'](_0xf32fa9)[_0xe90f('0x30')](_0xba1dd9);};}exports[_0xe90f('0x31')]=function(_0x22d004,_0x5cb057){var _0x1f72f4={},_0x1b926b={},_0x315c4f={'count':0x0,'rows':[]};var _0x101e12=_[_0xe90f('0x32')](db['WhatsappQueue']['rawAttributes'],function(_0x426d73){return{'name':_0x426d73['fieldName'],'type':_0x426d73[_0xe90f('0x33')]['key']};});_0x1b926b[_0xe90f('0x34')]=_[_0xe90f('0x32')](_0x101e12,'name');_0x1b926b[_0xe90f('0x35')]=_[_0xe90f('0x36')](_0x22d004[_0xe90f('0x35')]);_0x1b926b[_0xe90f('0x37')]=_['intersection'](_0x1b926b[_0xe90f('0x34')],_0x1b926b[_0xe90f('0x35')]);_0x1f72f4['attributes']=_[_0xe90f('0x38')](_0x1b926b[_0xe90f('0x34')],qs[_0xe90f('0x39')](_0x22d004['query'][_0xe90f('0x39')]));_0x1f72f4['attributes']=_0x1f72f4[_0xe90f('0x3a')][_0xe90f('0x3b')]?_0x1f72f4[_0xe90f('0x3a')]:_0x1b926b[_0xe90f('0x34')];if(!_0x22d004[_0xe90f('0x35')][_0xe90f('0x3c')](_0xe90f('0x3d'))){_0x1f72f4[_0xe90f('0x25')]=qs['limit'](_0x22d004[_0xe90f('0x35')]['limit']);_0x1f72f4[_0xe90f('0x24')]=qs[_0xe90f('0x24')](_0x22d004['query'][_0xe90f('0x24')]);}_0x1f72f4[_0xe90f('0x3e')]=qs[_0xe90f('0x3f')](_0x22d004[_0xe90f('0x35')][_0xe90f('0x3f')]);_0x1f72f4['where']=qs[_0xe90f('0x37')](_['pick'](_0x22d004[_0xe90f('0x35')],_0x1b926b[_0xe90f('0x37')]),_0x101e12);if(_0x22d004[_0xe90f('0x35')][_0xe90f('0x40')]){_0x1f72f4[_0xe90f('0x41')]=_['merge'](_0x1f72f4[_0xe90f('0x41')],{'$or':_['map'](_0x101e12,function(_0x237f79){if(_0x237f79['type']!==_0xe90f('0x42')){var _0xbec356={};_0xbec356[_0x237f79[_0xe90f('0x2f')]]={'$like':'%'+_0x22d004[_0xe90f('0x35')][_0xe90f('0x40')]+'%'};return _0xbec356;}})});}_0x1f72f4=_[_0xe90f('0x43')]({},_0x1f72f4,_0x22d004[_0xe90f('0x44')]);var _0x1a582d={'where':_0x1f72f4[_0xe90f('0x41')]};return db[_0xe90f('0x45')][_0xe90f('0x23')](_0x1a582d)[_0xe90f('0x2a')](function(_0x5926f3){_0x315c4f[_0xe90f('0x23')]=_0x5926f3;if(_0x22d004[_0xe90f('0x35')][_0xe90f('0x46')]){_0x1f72f4['include']=[{'all':!![]}];}return db[_0xe90f('0x45')][_0xe90f('0x47')](_0x1f72f4);})[_0xe90f('0x2a')](function(_0x93028e){_0x315c4f['rows']=_0x93028e;return _0x315c4f;})['then'](respondWithFilteredResult(_0x5cb057,_0x1f72f4))[_0xe90f('0x48')](handleError(_0x5cb057,null));};exports[_0xe90f('0x49')]=function(_0x1aba81,_0xb48582){var _0x5ef5ab={'raw':!![],'where':{'id':_0x1aba81[_0xe90f('0x4a')]['id']}},_0x238615={};_0x238615['model']=_[_0xe90f('0x36')](db['WhatsappQueue']['rawAttributes']);_0x238615['query']=_[_0xe90f('0x36')](_0x1aba81[_0xe90f('0x35')]);_0x238615[_0xe90f('0x37')]=_[_0xe90f('0x38')](_0x238615[_0xe90f('0x34')],_0x238615[_0xe90f('0x35')]);_0x5ef5ab[_0xe90f('0x3a')]=_[_0xe90f('0x38')](_0x238615['model'],qs[_0xe90f('0x39')](_0x1aba81[_0xe90f('0x35')][_0xe90f('0x39')]));_0x5ef5ab['attributes']=_0x5ef5ab[_0xe90f('0x3a')][_0xe90f('0x3b')]?_0x5ef5ab[_0xe90f('0x3a')]:_0x238615[_0xe90f('0x34')];if(_0x1aba81[_0xe90f('0x35')][_0xe90f('0x46')]){_0x5ef5ab[_0xe90f('0x4b')]=[{'all':!![]}];}_0x5ef5ab=_['merge']({},_0x5ef5ab,_0x1aba81[_0xe90f('0x44')]);return db[_0xe90f('0x45')][_0xe90f('0x4c')](_0x5ef5ab)[_0xe90f('0x2a')](handleEntityNotFound(_0xb48582,null))[_0xe90f('0x2a')](respondWithResult(_0xb48582,null))['catch'](handleError(_0xb48582,null));};exports['create']=function(_0x22ba02,_0x479cde){return db['WhatsappQueue'][_0xe90f('0x4d')](_0x22ba02['body'],{})[_0xe90f('0x2a')](function(_0x4d24c8){var _0x5361eb=_0x22ba02['user'][_0xe90f('0x2c')]({'plain':!![]});if(!_0x5361eb)throw new Error(_0xe90f('0x4e'));if(_0x5361eb[_0xe90f('0x4f')]===_0xe90f('0x50')){var _0x4bdc7f=_0x4d24c8['get']({'plain':!![]});var _0x5ae6eb=_0xe90f('0x51');return db[_0xe90f('0x52')][_0xe90f('0x4c')]({'where':{'name':_0x5ae6eb,'userProfileId':_0x5361eb[_0xe90f('0x53')]},'raw':!![]})['then'](function(_0x569252){if(_0x569252&&_0x569252[_0xe90f('0x54')]===0x0){return db['UserProfileResource'][_0xe90f('0x4d')]({'name':_0x4bdc7f['name'],'resourceId':_0x4bdc7f['id'],'type':_0x569252[_0xe90f('0x2f')],'sectionId':_0x569252['id']},{})[_0xe90f('0x2a')](function(){return _0x4d24c8;});}else{return _0x4d24c8;}})[_0xe90f('0x48')](function(_0xd0d406){logger[_0xe90f('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd0d406);throw _0xd0d406;});}return _0x4d24c8;})['then'](respondWithResult(_0x479cde,0xc9))[_0xe90f('0x48')](handleError(_0x479cde,null));};exports[_0xe90f('0x55')]=function(_0x46b86d,_0x121c9f){if(_0x46b86d[_0xe90f('0x56')]['id']){delete _0x46b86d['body']['id'];}return db[_0xe90f('0x45')]['find']({'where':{'id':_0x46b86d['params']['id']}})[_0xe90f('0x2a')](handleEntityNotFound(_0x121c9f,null))[_0xe90f('0x2a')](saveUpdates(_0x46b86d[_0xe90f('0x56')],null))[_0xe90f('0x2a')](respondWithResult(_0x121c9f,null))[_0xe90f('0x48')](handleError(_0x121c9f,null));};exports[_0xe90f('0x2b')]=function(_0x399e6a,_0x193ceb){return db[_0xe90f('0x45')][_0xe90f('0x4c')]({'where':{'id':_0x399e6a[_0xe90f('0x4a')]['id']}})[_0xe90f('0x2a')](handleEntityNotFound(_0x193ceb,null))[_0xe90f('0x2a')](removeEntity(_0x193ceb,null))[_0xe90f('0x48')](handleError(_0x193ceb,null));};exports[_0xe90f('0x57')]=function(_0x5ad65d,_0x5d94f8){return db[_0xe90f('0x45')][_0xe90f('0x57')]()['then'](respondWithResult(_0x5d94f8,null))[_0xe90f('0x48')](handleError(_0x5d94f8,null));};exports['getMembers']=function(_0x404d52,_0x5df0ad,_0x44f4ba){var _0x50f25c={'raw':!![],'where':{}},_0x3bb1ba={},_0xf8f3da;return db['WhatsappQueue']['findOne']({'where':{'id':_0x404d52['params']['id']}})['then'](handleEntityNotFound(_0x5df0ad,null))[_0xe90f('0x2a')](function(_0x1b9ad9){if(_0x1b9ad9){_0xf8f3da=_0x1b9ad9[_0xe90f('0x2c')]({'plain':!![]});_0x3bb1ba[_0xe90f('0x34')]=_['keys'](db[_0xe90f('0x58')][_0xe90f('0x59')]);_0x3bb1ba[_0xe90f('0x35')]=_[_0xe90f('0x36')](_0x404d52[_0xe90f('0x35')]);_0x3bb1ba['filters']=_[_0xe90f('0x38')](_0x3bb1ba[_0xe90f('0x34')],_0x3bb1ba[_0xe90f('0x35')]);_0x50f25c[_0xe90f('0x3a')]=_[_0xe90f('0x38')](_0x3bb1ba[_0xe90f('0x34')],qs[_0xe90f('0x39')](_0x404d52[_0xe90f('0x35')]['fields']));_0x50f25c['attributes']=_0x50f25c[_0xe90f('0x3a')]['length']?_0x50f25c[_0xe90f('0x3a')]:_0x3bb1ba[_0xe90f('0x34')];if(!_0x404d52[_0xe90f('0x35')]['hasOwnProperty'](_0xe90f('0x3d'))){_0x50f25c[_0xe90f('0x25')]=qs['limit'](_0x404d52['query']['limit']);_0x50f25c[_0xe90f('0x24')]=qs[_0xe90f('0x24')](_0x404d52[_0xe90f('0x35')][_0xe90f('0x24')]);}_0x50f25c[_0xe90f('0x3e')]=qs[_0xe90f('0x3f')](_0x404d52[_0xe90f('0x35')][_0xe90f('0x3f')]);_0x50f25c[_0xe90f('0x41')]=qs[_0xe90f('0x37')](_[_0xe90f('0x5a')](_0x404d52[_0xe90f('0x35')],_0x3bb1ba[_0xe90f('0x37')]));_0x50f25c[_0xe90f('0x41')][_0xe90f('0x5b')]=_0x1b9ad9['id'];if(_0x404d52[_0xe90f('0x35')][_0xe90f('0x40')]){_0x50f25c[_0xe90f('0x41')]=_['merge'](_0x50f25c['where'],{'$or':_[_0xe90f('0x32')](_0x50f25c[_0xe90f('0x3a')],function(_0xd643e9){var _0x40c4fc={};_0x40c4fc[_0xd643e9]={'$like':'%'+_0x404d52[_0xe90f('0x35')][_0xe90f('0x40')]+'%'};return _0x40c4fc;})});}_0x50f25c=_['merge']({},_0x50f25c,_0x404d52[_0xe90f('0x44')]);return db[_0xe90f('0x58')][_0xe90f('0x47')](_0x50f25c);}})[_0xe90f('0x2a')](function(_0x429167){if(_0x429167){return db[_0xe90f('0x5c')]['findAndCountAll']({'where':{'id':_[_0xe90f('0x32')](_0x429167,_0xe90f('0x5d')),'role':_0xe90f('0x5e')},'attributes':['id',_0xe90f('0x2f'),'whatsappPause','updatedAt',_0xe90f('0x5f')]});}})[_0xe90f('0x2a')](function(_0x5018d2){if(_0x5018d2){return{'count':_0x5018d2[_0xe90f('0x23')],'rows':_['map'](_0x5018d2['rows'],function(_0x360ce4){return{'membername':_0x360ce4['name'],'UserId':_0x360ce4['id'],'queue_name':_0xf8f3da[_0xe90f('0x2f')],'WhatsappQueueId':_0xf8f3da['id'],'interface':util[_0xe90f('0x60')](_0xe90f('0x61'),_0xe90f('0x62'),_0x360ce4['name']),'penalty':0x0,'paused':_0x360ce4[_0xe90f('0x63')],'createdAt':_0x360ce4[_0xe90f('0x5f')],'updatedAt':_0x360ce4[_0xe90f('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe90f('0x2a')](respondWithFilteredResult(_0x5df0ad,_0x50f25c))['catch'](handleError(_0x5df0ad,null));};exports[_0xe90f('0x65')]=function(_0x510299,_0xb2f239,_0xf1f7ad){var _0x598e37={};var _0x169c46={};var _0x325d1d;var _0x56dcf8;return db[_0xe90f('0x45')][_0xe90f('0x66')]({'where':{'id':_0x510299['params']['id']}})['then'](handleEntityNotFound(_0xb2f239,null))[_0xe90f('0x2a')](function(_0x3bdcc7){if(_0x3bdcc7){_0x325d1d=_0x3bdcc7;_0x169c46[_0xe90f('0x34')]=_[_0xe90f('0x36')](db['Team']['rawAttributes']);_0x169c46['query']=_['keys'](_0x510299['query']);_0x169c46[_0xe90f('0x37')]=_[_0xe90f('0x38')](_0x169c46['model'],_0x169c46[_0xe90f('0x35')]);_0x598e37['attributes']=_[_0xe90f('0x38')](_0x169c46[_0xe90f('0x34')],qs[_0xe90f('0x39')](_0x510299[_0xe90f('0x35')][_0xe90f('0x39')]));_0x598e37['attributes']=_0x598e37[_0xe90f('0x3a')][_0xe90f('0x3b')]?_0x598e37['attributes']:_0x169c46[_0xe90f('0x34')];_0x598e37['order']=qs[_0xe90f('0x3f')](_0x510299['query'][_0xe90f('0x3f')]);_0x598e37['where']=qs[_0xe90f('0x37')](_[_0xe90f('0x5a')](_0x510299['query'],_0x169c46['filters']));if(_0x510299[_0xe90f('0x35')]['filter']){_0x598e37[_0xe90f('0x41')]=_[_0xe90f('0x43')](_0x598e37['where'],{'$or':_['map'](_0x598e37[_0xe90f('0x3a')],function(_0x148240){var _0x24bf0f={};_0x24bf0f[_0x148240]={'$like':'%'+_0x510299[_0xe90f('0x35')][_0xe90f('0x40')]+'%'};return _0x24bf0f;})});}_0x598e37=_['merge']({},_0x598e37,_0x510299[_0xe90f('0x44')]);return _0x325d1d[_0xe90f('0x65')](_0x598e37);}})[_0xe90f('0x2a')](function(_0xa831d){if(_0xa831d){_0x56dcf8=_0xa831d[_0xe90f('0x3b')];if(!_0x510299[_0xe90f('0x35')]['hasOwnProperty']('nolimit')){_0x598e37[_0xe90f('0x25')]=qs['limit'](_0x510299['query'][_0xe90f('0x25')]);_0x598e37['offset']=qs[_0xe90f('0x24')](_0x510299[_0xe90f('0x35')][_0xe90f('0x24')]);}return _0x325d1d[_0xe90f('0x65')](_0x598e37);}})[_0xe90f('0x2a')](function(_0x59e9b0){if(_0x59e9b0){return _0x59e9b0?{'count':_0x56dcf8,'rows':_0x59e9b0}:null;}})[_0xe90f('0x2a')](respondWithResult(_0xb2f239,null))[_0xe90f('0x48')](handleError(_0xb2f239,null));};exports['addTeams']=function(_0x563d7c,_0x2258a5,_0x4b9d13){var _0x5a32ea=_0x563d7c[_0xe90f('0x56')][_0xe90f('0x67')];return db[_0xe90f('0x68')][_0xe90f('0x47')]({'where':{'id':_0x5a32ea},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe90f('0x69'),'attributes':['id',_0xe90f('0x2f'),_0xe90f('0x6a'),_0xe90f('0x6b'),_0xe90f('0x6c')],'raw':!![]}]})[_0xe90f('0x2a')](function(_0x2cc8af){if(_0x2cc8af){var _0x1edbf5=_['flatMap'](_0x2cc8af,function(_0xa83c5c){var _0x4036ad=_0xa83c5c[_0xe90f('0x2c')]({'plain':!![]});return _0x4036ad[_0xe90f('0x69')];});return db['WhatsappQueue'][_0xe90f('0x4c')]({'where':{'id':_0x563d7c['params']['id']}})[_0xe90f('0x2a')](function(_0x4ed653){return db[_0xe90f('0x6d')]['transaction'](function(_0x50f954){return _0x4ed653[_0xe90f('0x6e')](_0x5a32ea,{'transaction':_0x50f954})['then'](function(){return BPromise['each'](_0x1edbf5,function(_0x5e46fd){return db['UserWhatsappQueue'][_0xe90f('0x6f')]({'where':{'UserId':_0x5e46fd['id'],'WhatsappQueueId':_0x563d7c[_0xe90f('0x4a')]['id']},'transaction':_0x50f954});});})['then'](function(){_0x1edbf5[_0xe90f('0x70')](function(_0x9ce807){socket[_0xe90f('0x71')](_0xe90f('0x72'),{'UserId':_0x9ce807['id'],'WhatsappQueueId':_0x4ed653['id']});});});});});}})['then'](respondWithStatusCode(_0x2258a5,null))[_0xe90f('0x48')](handleError(_0x2258a5,null));};exports[_0xe90f('0x73')]=function(_0x2cc3d2,_0x35a3bd,_0x375269){return db['Team'][_0xe90f('0x47')]({'where':{'id':_0x2cc3d2[_0xe90f('0x35')][_0xe90f('0x67')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe90f('0x2a')](handleEntityNotFound(_0x35a3bd,null))[_0xe90f('0x2a')](function(_0x4da872){var _0x47903a=_['map'](_0x4da872,'id');var _0x52731a=[];var _0x2d50a7=[];var _0x5849f4=squel[_0xe90f('0x74')]();_0x5849f4[_0xe90f('0x75')]('tq.TeamId')[_0xe90f('0x76')](_0xe90f('0x77'),'tq')[_0xe90f('0x78')]('user_has_teams','ut',_0xe90f('0x79'))['where']('WhatsappQueueId\x20=\x20?',_0x2cc3d2['params']['id']);for(var _0x320555=0x0;_0x320555<_0x4da872[_0xe90f('0x3b')];_0x320555+=0x1){let _0x8c7704=_0x4da872[_0x320555];for(var _0x52b206=0x0;_0x52b206<_0x8c7704[_0xe90f('0x69')][_0xe90f('0x3b')];_0x52b206+=0x1){let _0x482210=_0x8c7704[_0xe90f('0x69')][_0x52b206];var _0x71b157=_0x5849f4[_0xe90f('0x7a')]();_0x71b157[_0xe90f('0x41')]('ut.UserId\x20=\x20?',_0x482210['id']);_0x2d50a7['push'](db[_0xe90f('0x6d')][_0xe90f('0x35')](_0x71b157[_0xe90f('0x7b')](),{'type':db[_0xe90f('0x6d')]['QueryTypes']['SELECT']})[_0xe90f('0x2a')](function(_0x3a33ee){if(_0x3a33ee[_0xe90f('0x3b')]===0x1){return _0x482210['id'];}else{var _0x3d8dac=_[_0xe90f('0x7c')](_[_0xe90f('0x32')](_0x3a33ee,'TeamId'),function(_0x2e7071){return _['includes'](_0x47903a,_0x2e7071);});if(_0x3d8dac){return _0x482210['id'];}}}));}}return BPromise[_0xe90f('0x7d')](_0x2d50a7)[_0xe90f('0x2a')](function(_0x1043b5){_0x52731a=_(_0x52731a)[_0xe90f('0x7e')](_0x1043b5)['compact']()[_0xe90f('0x7f')]();return db[_0xe90f('0x45')][_0xe90f('0x4c')]({'where':{'id':_0x2cc3d2[_0xe90f('0x4a')]['id']}})[_0xe90f('0x2a')](function(_0x42687c){return db[_0xe90f('0x6d')][_0xe90f('0x80')](function(_0x28c795){return _0x42687c[_0xe90f('0x73')](_0x2cc3d2['query']['ids'],{'transaction':_0x28c795})[_0xe90f('0x2a')](function(){if(!_[_0xe90f('0x81')](_0x52731a)){return _0x42687c['removeAgents'](_0x52731a,{'transaction':_0x28c795});}})[_0xe90f('0x2a')](function(){_0x52731a['forEach'](function(_0x1c9ba1){socket[_0xe90f('0x71')](_0xe90f('0x82'),{'UserId':_0x1c9ba1,'WhatsappQueueId':_0x42687c['id']});});});});});});})[_0xe90f('0x2a')](respondWithStatusCode(_0x35a3bd,null))[_0xe90f('0x48')](handleError(_0x35a3bd,null));};exports[_0xe90f('0x83')]=function(_0x3e3df5,_0x10ddc9,_0x336df7){return db[_0xe90f('0x45')][_0xe90f('0x4c')]({'where':{'id':_0x3e3df5[_0xe90f('0x4a')]['id']}})[_0xe90f('0x2a')](handleEntityNotFound(_0x10ddc9,null))[_0xe90f('0x2a')](function(_0x1dabd1){if(_0x1dabd1){return _0x1dabd1[_0xe90f('0x83')](_0x3e3df5['body']['ids'],_[_0xe90f('0x84')](_0x3e3df5['body'],[_0xe90f('0x67'),'id'])||{})[_0xe90f('0x85')](function(_0x2e2c3e){for(var _0x20a27a=0x0;_0x20a27a<_0x3e3df5['body'][_0xe90f('0x67')][_0xe90f('0x3b')];_0x20a27a+=0x1){socket[_0xe90f('0x71')](_0xe90f('0x72'),{'UserId':_0x3e3df5['body']['ids'][_0x20a27a],'WhatsappQueueId':_0x3e3df5[_0xe90f('0x4a')]['id']});}return _0x2e2c3e;});}})[_0xe90f('0x2a')](respondWithResult(_0x10ddc9,null))[_0xe90f('0x48')](handleError(_0x10ddc9,null));};exports[_0xe90f('0x86')]=function(_0x68825c,_0x5968fc,_0x5c69b4){return db[_0xe90f('0x45')]['find']({'where':{'id':_0x68825c[_0xe90f('0x4a')]['id']}})[_0xe90f('0x2a')](handleEntityNotFound(_0x5968fc,null))[_0xe90f('0x2a')](function(_0x4d46d4){if(_0x4d46d4){return _0x4d46d4[_0xe90f('0x86')](_0x68825c['query'][_0xe90f('0x67')])[_0xe90f('0x2a')](function(){if(_[_0xe90f('0x87')](_0x68825c[_0xe90f('0x35')][_0xe90f('0x67')])){for(var _0xf32a8b=0x0;_0xf32a8b<_0x68825c[_0xe90f('0x35')][_0xe90f('0x67')][_0xe90f('0x3b')];_0xf32a8b+=0x1){socket[_0xe90f('0x71')](_0xe90f('0x82'),{'UserId':Number(_0x68825c[_0xe90f('0x35')][_0xe90f('0x67')][_0xf32a8b]),'WhatsappQueueId':Number(_0x68825c[_0xe90f('0x4a')]['id'])});}}else{socket[_0xe90f('0x71')](_0xe90f('0x82'),{'UserId':Number(_0x68825c['query'][_0xe90f('0x67')]),'WhatsappQueueId':Number(_0x68825c[_0xe90f('0x4a')]['id'])});}});}})[_0xe90f('0x2a')](respondWithStatusCode(_0x5968fc,null))[_0xe90f('0x48')](handleError(_0x5968fc,null));};exports[_0xe90f('0x88')]=function(_0x2b77d4,_0x5ecc90,_0x17b4dd){var _0x5bf9cc={};var _0x569519={};var _0xb8bb1e;var _0x38b1ed;return db[_0xe90f('0x45')][_0xe90f('0x66')]({'where':{'id':_0x2b77d4[_0xe90f('0x4a')]['id']}})[_0xe90f('0x2a')](handleEntityNotFound(_0x5ecc90,null))[_0xe90f('0x2a')](function(_0x2fbd47){if(_0x2fbd47){_0xb8bb1e=_0x2fbd47;_0x569519[_0xe90f('0x34')]=_[_0xe90f('0x36')](db[_0xe90f('0x5c')][_0xe90f('0x59')]);_0x569519[_0xe90f('0x35')]=_['keys'](_0x2b77d4[_0xe90f('0x35')]);_0x569519[_0xe90f('0x37')]=_['intersection'](_0x569519['model'],_0x569519[_0xe90f('0x35')]);_0x5bf9cc[_0xe90f('0x3a')]=_[_0xe90f('0x38')](_0x569519[_0xe90f('0x34')],qs[_0xe90f('0x39')](_0x2b77d4['query'][_0xe90f('0x39')]));_0x5bf9cc[_0xe90f('0x3a')]=_0x5bf9cc[_0xe90f('0x3a')][_0xe90f('0x3b')]?_0x5bf9cc[_0xe90f('0x3a')]:_0x569519[_0xe90f('0x34')];_0x5bf9cc['order']=qs[_0xe90f('0x3f')](_0x2b77d4['query'][_0xe90f('0x3f')]);_0x5bf9cc[_0xe90f('0x41')]=qs['filters'](_[_0xe90f('0x5a')](_0x2b77d4[_0xe90f('0x35')],_0x569519['filters']));if(_0x2b77d4['query'][_0xe90f('0x40')]){_0x5bf9cc[_0xe90f('0x41')]=_[_0xe90f('0x43')](_0x5bf9cc[_0xe90f('0x41')],{'$or':_[_0xe90f('0x32')](_0x5bf9cc[_0xe90f('0x3a')],function(_0x3e4721){var _0x31e8d8={};_0x31e8d8[_0x3e4721]={'$like':'%'+_0x2b77d4['query'][_0xe90f('0x40')]+'%'};return _0x31e8d8;})});}_0x5bf9cc=_[_0xe90f('0x43')]({},_0x5bf9cc,_0x2b77d4['options']);return _0xb8bb1e['getAgents'](_0x5bf9cc);}})[_0xe90f('0x2a')](function(_0x2a15c9){if(_0x2a15c9){_0x38b1ed=_0x2a15c9[_0xe90f('0x3b')];if(!_0x2b77d4[_0xe90f('0x35')]['hasOwnProperty']('nolimit')){_0x5bf9cc[_0xe90f('0x25')]=qs[_0xe90f('0x25')](_0x2b77d4[_0xe90f('0x35')][_0xe90f('0x25')]);_0x5bf9cc['offset']=qs[_0xe90f('0x24')](_0x2b77d4['query'][_0xe90f('0x24')]);}return _0xb8bb1e[_0xe90f('0x88')](_0x5bf9cc);}})['then'](function(_0x3329bb){if(_0x3329bb){return _0x3329bb?{'count':_0x38b1ed,'rows':_0x3329bb}:null;}})['then'](respondWithResult(_0x5ecc90,null))[_0xe90f('0x48')](handleError(_0x5ecc90,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 89b4651..dec9e5b 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 _0x7afa=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0x7afa,0x1c5));var _0xa7af=function(_0x1707ae,_0x3f4d6e){_0x1707ae=_0x1707ae-0x0;var _0x5d0bc0=_0x7afa[_0x1707ae];return _0x5d0bc0;};'use strict';var EventEmitter=require(_0xa7af('0x0'));var WhatsappQueue=require(_0xa7af('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xa7af('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa7af('0x3'),'afterDestroy':_0xa7af('0x4')};function emitEvent(_0x37db3b){return function(_0x18d314,_0x1e30d9,_0x2be1b8){WhatsappQueueEvents[_0xa7af('0x5')](_0x37db3b+':'+_0x18d314['id'],_0x18d314);WhatsappQueueEvents[_0xa7af('0x5')](_0x37db3b,_0x18d314);_0x2be1b8(null);};}for(var e in events){if(events[_0xa7af('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xb4c2=['exports','events','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x41e734,_0x5ac32d){var _0x14a935=function(_0x5444e7){while(--_0x5444e7){_0x41e734['push'](_0x41e734['shift']());}};_0x14a935(++_0x5ac32d);}(_0xb4c2,0x64));var _0x2b4c=function(_0xf85c23,_0x433083){_0xf85c23=_0xf85c23-0x0;var _0xc64657=_0xb4c2[_0xf85c23];return _0xc64657;};'use strict';var EventEmitter=require(_0x2b4c('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x2b4c('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x2b4c('0x2')](0x0);var events={'afterCreate':_0x2b4c('0x3'),'afterUpdate':_0x2b4c('0x4'),'afterDestroy':_0x2b4c('0x5')};function emitEvent(_0x50912c){return function(_0x3c78ca,_0x2feef3,_0x2e38ee){WhatsappQueueEvents[_0x2b4c('0x6')](_0x50912c+':'+_0x3c78ca['id'],_0x3c78ca);WhatsappQueueEvents[_0x2b4c('0x6')](_0x50912c,_0x3c78ca);_0x2e38ee(null);};}for(var e in events){if(events[_0x2b4c('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x2b4c('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 3fcf026..210064c 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 _0x6eb1=['WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./whatsappQueue.attributes','define'];(function(_0x3381f4,_0x178384){var _0x116e37=function(_0x2f0032){while(--_0x2f0032){_0x3381f4['push'](_0x3381f4['shift']());}};_0x116e37(++_0x178384);}(_0x6eb1,0x199));var _0x16eb=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x6eb1[_0x3e531a];return _0x3c2574;};'use strict';var _=require('lodash');var util=require(_0x16eb('0x0'));var logger=require(_0x16eb('0x1'))(_0x16eb('0x2'));var moment=require(_0x16eb('0x3'));var BPromise=require(_0x16eb('0x4'));var rp=require(_0x16eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16eb('0x6'));var config=require('../../config/environment');var attributes=require(_0x16eb('0x7'));module['exports']=function(_0x5c321a,_0x4c99c4){return _0x5c321a[_0x16eb('0x8')](_0x16eb('0x9'),attributes,{'tableName':_0x16eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4344=['define','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x2901df,_0x3dff3f){var _0x12119a=function(_0x54e43c){while(--_0x54e43c){_0x2901df['push'](_0x2901df['shift']());}};_0x12119a(++_0x3dff3f);}(_0x4344,0x111));var _0x4434=function(_0x3faf45,_0x8bb345){_0x3faf45=_0x3faf45-0x0;var _0x11dfb6=_0x4344[_0x3faf45];return _0x11dfb6;};'use strict';var _=require(_0x4434('0x0'));var util=require(_0x4434('0x1'));var logger=require(_0x4434('0x2'))(_0x4434('0x3'));var moment=require(_0x4434('0x4'));var BPromise=require(_0x4434('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4434('0x6'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x25acd7,_0x180c5d){return _0x25acd7[_0x4434('0x7')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','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 db60b42..40c09d9 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 _0xe1ff=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','include','map','model','attributes','debug','ShowWhatsappQueue','find'];(function(_0x2109f2,_0x2972be){var _0x34e21e=function(_0x216721){while(--_0x216721){_0x2109f2['push'](_0x2109f2['shift']());}};_0x34e21e(++_0x2972be);}(_0xe1ff,0x151));var _0xfe1f=function(_0x5b9b52,_0x1d8f70){_0x5b9b52=_0x5b9b52-0x0;var _0x10ad63=_0xe1ff[_0x5b9b52];return _0x10ad63;};'use strict';var _=require(_0xfe1f('0x0'));var util=require(_0xfe1f('0x1'));var moment=require(_0xfe1f('0x2'));var BPromise=require(_0xfe1f('0x3'));var rs=require(_0xfe1f('0x4'));var fs=require('fs');var Redis=require(_0xfe1f('0x5'));var db=require(_0xfe1f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe1f('0x7'))('rpc');var config=require(_0xfe1f('0x8'));var jayson=require(_0xfe1f('0x9'));var client=jayson[_0xfe1f('0xa')][_0xfe1f('0xb')]({'port':0x232a});config[_0xfe1f('0xc')]=_[_0xfe1f('0xd')](config[_0xfe1f('0xc')],{'host':_0xfe1f('0xe'),'port':0x18eb});var socket=require(_0xfe1f('0xf'))(new Redis(config[_0xfe1f('0xc')]));require(_0xfe1f('0x10'))[_0xfe1f('0x11')](socket);function respondWithRpcPromise(_0x347a09,_0x4f0c0d,_0x217fca){return new BPromise(function(_0x3c6e82,_0x28829c){return client[_0xfe1f('0x12')](_0x347a09,_0x217fca)[_0xfe1f('0x13')](function(_0x333166){logger[_0xfe1f('0x14')](_0xfe1f('0x15'),_0x4f0c0d,'request\x20sent');logger['debug'](_0xfe1f('0x16'),_0x4f0c0d,_0xfe1f('0x17'),JSON[_0xfe1f('0x18')](_0x333166));if(_0x333166['error']){if(_0x333166[_0xfe1f('0x19')]['code']===0x1f4){logger['error'](_0xfe1f('0x15'),_0x4f0c0d,_0x333166[_0xfe1f('0x19')][_0xfe1f('0x1a')]);return _0x28829c(_0x333166['error'][_0xfe1f('0x1a')]);}logger['error'](_0xfe1f('0x15'),_0x4f0c0d,_0x333166['error'][_0xfe1f('0x1a')]);return _0x3c6e82(_0x333166[_0xfe1f('0x19')][_0xfe1f('0x1a')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x4f0c0d,_0xfe1f('0x17'));_0x3c6e82(_0x333166[_0xfe1f('0x1b')][_0xfe1f('0x1a')]);}})[_0xfe1f('0x1c')](function(_0x22614c){logger[_0xfe1f('0x19')](_0xfe1f('0x15'),_0x4f0c0d,_0x22614c);_0x28829c(_0x22614c);});});}exports[_0xfe1f('0x1d')]=function(_0x5e1edc){var _0x547e66=this;return new Promise(function(_0x4e110f,_0x212eb7){return db[_0xfe1f('0x1e')][_0xfe1f('0x1f')]({'raw':_0x5e1edc[_0xfe1f('0x20')]?_0x5e1edc[_0xfe1f('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x5e1edc[_0xfe1f('0x20')]?_0x5e1edc[_0xfe1f('0x20')][_0xfe1f('0x21')]||null:null,'attributes':_0x5e1edc[_0xfe1f('0x20')]?_0x5e1edc[_0xfe1f('0x20')]['attributes']||null:null,'limit':_0x5e1edc['options']?_0x5e1edc[_0xfe1f('0x20')]['limit']||null:null,'include':_0x5e1edc[_0xfe1f('0x20')]?_0x5e1edc[_0xfe1f('0x20')][_0xfe1f('0x22')]?_[_0xfe1f('0x23')](_0x5e1edc[_0xfe1f('0x20')][_0xfe1f('0x22')],function(_0x4e667f){return{'model':db[_0x4e667f[_0xfe1f('0x24')]],'as':_0x4e667f['as'],'attributes':_0x4e667f[_0xfe1f('0x25')],'include':_0x4e667f['include']?_[_0xfe1f('0x23')](_0x4e667f['include'],function(_0x5da24e){return{'model':db[_0x5da24e[_0xfe1f('0x24')]],'as':_0x5da24e['as'],'attributes':_0x5da24e[_0xfe1f('0x25')],'include':_0x5da24e[_0xfe1f('0x22')]?_[_0xfe1f('0x23')](_0x5da24e[_0xfe1f('0x22')],function(_0xd9d1c5){return{'model':db[_0xd9d1c5[_0xfe1f('0x24')]],'as':_0xd9d1c5['as'],'attributes':_0xd9d1c5[_0xfe1f('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc980b0){logger[_0xfe1f('0x14')](_0xfe1f('0x1d'),_0x5e1edc);logger[_0xfe1f('0x26')](_0xfe1f('0x1d'),_0x5e1edc,JSON['stringify'](_0xc980b0));_0x4e110f(_0xc980b0);})[_0xfe1f('0x1c')](function(_0x403475){logger[_0xfe1f('0x19')]('GetWhatsappQueue',_0x403475['message'],_0x5e1edc);_0x212eb7(_0x547e66[_0xfe1f('0x19')](0x1f4,_0x403475[_0xfe1f('0x1a')]));});});};exports[_0xfe1f('0x27')]=function(_0x44e685){var _0x35e367=this;return new Promise(function(_0x562688,_0x31c543){return db['WhatsappQueue'][_0xfe1f('0x28')]({'raw':_0x44e685['options']?_0x44e685[_0xfe1f('0x20')][_0xfe1f('0x29')]===undefined?!![]:![]:!![],'where':_0x44e685[_0xfe1f('0x20')]?_0x44e685['options'][_0xfe1f('0x21')]||null:null,'attributes':_0x44e685[_0xfe1f('0x20')]?_0x44e685['options'][_0xfe1f('0x25')]||null:null,'include':_0x44e685[_0xfe1f('0x20')]?_0x44e685[_0xfe1f('0x20')][_0xfe1f('0x22')]?_[_0xfe1f('0x23')](_0x44e685[_0xfe1f('0x20')][_0xfe1f('0x22')],function(_0x36b377){return{'model':db[_0x36b377[_0xfe1f('0x24')]],'as':_0x36b377['as'],'attributes':_0x36b377[_0xfe1f('0x25')],'include':_0x36b377['include']?_[_0xfe1f('0x23')](_0x36b377[_0xfe1f('0x22')],function(_0x5449a0){return{'model':db[_0x5449a0[_0xfe1f('0x24')]],'as':_0x5449a0['as'],'attributes':_0x5449a0[_0xfe1f('0x25')],'include':_0x5449a0['include']?_['map'](_0x5449a0[_0xfe1f('0x22')],function(_0xd7e19e){return{'model':db[_0xd7e19e['model']],'as':_0xd7e19e['as'],'attributes':_0xd7e19e[_0xfe1f('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x266a4e){logger['info']('ShowWhatsappQueue',_0x44e685);logger[_0xfe1f('0x26')](_0xfe1f('0x27'),_0x44e685,JSON['stringify'](_0x266a4e));_0x562688(_0x266a4e);})[_0xfe1f('0x1c')](function(_0x68df8b){logger['error'](_0xfe1f('0x27'),_0x68df8b[_0xfe1f('0x1a')],_0x44e685);_0x31c543(_0x35e367['error'](0x1f4,_0x68df8b[_0xfe1f('0x1a')]));});});}; \ No newline at end of file +var _0x4344=['model','map','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','where','attributes','limit','include'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x4344,0x133));var _0x4434=function(_0x9ffe1b,_0x26f6c3){_0x9ffe1b=_0x9ffe1b-0x0;var _0x5d1892=_0x4344[_0x9ffe1b];return _0x5d1892;};'use strict';var _=require(_0x4434('0x0'));var util=require(_0x4434('0x1'));var moment=require(_0x4434('0x2'));var BPromise=require(_0x4434('0x3'));var rs=require(_0x4434('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4434('0x5'))['db'];var utils=require(_0x4434('0x6'));var logger=require('../../config/logger')(_0x4434('0x7'));var config=require(_0x4434('0x8'));var jayson=require(_0x4434('0x9'));var client=jayson['client'][_0x4434('0xa')]({'port':0x232a});config[_0x4434('0xb')]=_[_0x4434('0xc')](config['redis'],{'host':_0x4434('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4434('0xb')]));require(_0x4434('0xe'))[_0x4434('0xf')](socket);function respondWithRpcPromise(_0x2188b6,_0x390a52,_0x4af337){return new BPromise(function(_0xa3e903,_0x2ade07){return client['request'](_0x2188b6,_0x4af337)[_0x4434('0x10')](function(_0x53c57c){logger[_0x4434('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x390a52,_0x4434('0x12'));logger[_0x4434('0x13')](_0x4434('0x14'),_0x390a52,_0x4434('0x12'),JSON[_0x4434('0x15')](_0x53c57c));if(_0x53c57c[_0x4434('0x16')]){if(_0x53c57c[_0x4434('0x16')][_0x4434('0x17')]===0x1f4){logger[_0x4434('0x16')](_0x4434('0x18'),_0x390a52,_0x53c57c[_0x4434('0x16')][_0x4434('0x19')]);return _0x2ade07(_0x53c57c['error'][_0x4434('0x19')]);}logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x390a52,_0x53c57c[_0x4434('0x16')][_0x4434('0x19')]);return _0xa3e903(_0x53c57c[_0x4434('0x16')][_0x4434('0x19')]);}else{logger[_0x4434('0x11')](_0x4434('0x18'),_0x390a52,_0x4434('0x12'));_0xa3e903(_0x53c57c[_0x4434('0x1a')][_0x4434('0x19')]);}})[_0x4434('0x1b')](function(_0x42bd24){logger[_0x4434('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x390a52,_0x42bd24);_0x2ade07(_0x42bd24);});});}exports[_0x4434('0x1c')]=function(_0x5e4ba7){var _0x307dd5=this;return new Promise(function(_0x2358bc,_0x1c23ae){return db[_0x4434('0x1d')]['findAll']({'raw':_0x5e4ba7[_0x4434('0x1e')]?_0x5e4ba7[_0x4434('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x5e4ba7[_0x4434('0x1e')]?_0x5e4ba7[_0x4434('0x1e')][_0x4434('0x1f')]||null:null,'attributes':_0x5e4ba7[_0x4434('0x1e')]?_0x5e4ba7[_0x4434('0x1e')][_0x4434('0x20')]||null:null,'limit':_0x5e4ba7[_0x4434('0x1e')]?_0x5e4ba7['options'][_0x4434('0x21')]||null:null,'include':_0x5e4ba7[_0x4434('0x1e')]?_0x5e4ba7['options'][_0x4434('0x22')]?_['map'](_0x5e4ba7[_0x4434('0x1e')][_0x4434('0x22')],function(_0x2c7948){return{'model':db[_0x2c7948[_0x4434('0x23')]],'as':_0x2c7948['as'],'attributes':_0x2c7948['attributes'],'include':_0x2c7948[_0x4434('0x22')]?_['map'](_0x2c7948[_0x4434('0x22')],function(_0x518ea6){return{'model':db[_0x518ea6['model']],'as':_0x518ea6['as'],'attributes':_0x518ea6[_0x4434('0x20')],'include':_0x518ea6[_0x4434('0x22')]?_[_0x4434('0x24')](_0x518ea6[_0x4434('0x22')],function(_0x48d94b){return{'model':db[_0x48d94b[_0x4434('0x23')]],'as':_0x48d94b['as'],'attributes':_0x48d94b[_0x4434('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4434('0x10')](function(_0x471af0){logger['info'](_0x4434('0x1c'),_0x5e4ba7);logger['debug'](_0x4434('0x1c'),_0x5e4ba7,JSON[_0x4434('0x15')](_0x471af0));_0x2358bc(_0x471af0);})[_0x4434('0x1b')](function(_0xda5b35){logger['error'](_0x4434('0x1c'),_0xda5b35[_0x4434('0x19')],_0x5e4ba7);_0x1c23ae(_0x307dd5['error'](0x1f4,_0xda5b35[_0x4434('0x19')]));});});};exports[_0x4434('0x25')]=function(_0x1fd8f6){var _0x54b574=this;return new Promise(function(_0x42cf82,_0x3d75e1){return db['WhatsappQueue']['find']({'raw':_0x1fd8f6[_0x4434('0x1e')]?_0x1fd8f6[_0x4434('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x1fd8f6[_0x4434('0x1e')]?_0x1fd8f6['options'][_0x4434('0x1f')]||null:null,'attributes':_0x1fd8f6[_0x4434('0x1e')]?_0x1fd8f6['options']['attributes']||null:null,'include':_0x1fd8f6[_0x4434('0x1e')]?_0x1fd8f6[_0x4434('0x1e')][_0x4434('0x22')]?_['map'](_0x1fd8f6[_0x4434('0x1e')][_0x4434('0x22')],function(_0x2814){return{'model':db[_0x2814['model']],'as':_0x2814['as'],'attributes':_0x2814['attributes'],'include':_0x2814[_0x4434('0x22')]?_['map'](_0x2814[_0x4434('0x22')],function(_0x5d20a6){return{'model':db[_0x5d20a6[_0x4434('0x23')]],'as':_0x5d20a6['as'],'attributes':_0x5d20a6[_0x4434('0x20')],'include':_0x5d20a6[_0x4434('0x22')]?_['map'](_0x5d20a6[_0x4434('0x22')],function(_0x507be8){return{'model':db[_0x507be8[_0x4434('0x23')]],'as':_0x507be8['as'],'attributes':_0x507be8[_0x4434('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4434('0x10')](function(_0x57d844){logger[_0x4434('0x11')](_0x4434('0x25'),_0x1fd8f6);logger[_0x4434('0x13')](_0x4434('0x25'),_0x1fd8f6,JSON[_0x4434('0x15')](_0x57d844));_0x42cf82(_0x57d844);})[_0x4434('0x1b')](function(_0x54d12f){logger[_0x4434('0x16')](_0x4434('0x25'),_0x54d12f[_0x4434('0x19')],_0x1fd8f6);_0x3d75e1(_0x54b574['error'](0x1f4,_0x54d12f[_0x4434('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index a83a533..5a10211 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 _0x0c02=['save','remove','emit','removeListener','register','whatsappQueue:'];(function(_0x119e4a,_0x1c87aa){var _0xe18cb0=function(_0x4685f9){while(--_0x4685f9){_0x119e4a['push'](_0x119e4a['shift']());}};_0xe18cb0(++_0x1c87aa);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x20c0('0x0'),_0x20c0('0x1'),'update'];function createListener(_0x1338cf,_0x5c8750){return function(_0x454922){_0x5c8750[_0x20c0('0x2')](_0x1338cf,_0x454922);};}function removeListener(_0x38022e,_0x2e9d65){return function(){WhatsappQueueEvents[_0x20c0('0x3')](_0x38022e,_0x2e9d65);};}exports[_0x20c0('0x4')]=function(_0x13312d){for(var _0xd25ee8=0x0,_0x5d6408=events['length'];_0xd25ee8<_0x5d6408;_0xd25ee8++){var _0x5da127=events[_0xd25ee8];var _0x4db532=createListener(_0x20c0('0x5')+_0x5da127,_0x13312d);WhatsappQueueEvents['on'](_0x5da127,_0x4db532);}}; \ No newline at end of file +var _0x58ea=['remove','update','emit','removeListener','register','whatsappQueue:','save'];(function(_0x23d3fa,_0x2d5783){var _0x299b2c=function(_0x176547){while(--_0x176547){_0x23d3fa['push'](_0x23d3fa['shift']());}};_0x299b2c(++_0x2d5783);}(_0x58ea,0xa7));var _0xa58e=function(_0x157029,_0x3df47a){_0x157029=_0x157029-0x0;var _0x2f384c=_0x58ea[_0x157029];return _0x2f384c;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xa58e('0x0'),_0xa58e('0x1'),_0xa58e('0x2')];function createListener(_0x1a8ac9,_0xfbec1f){return function(_0x230017){_0xfbec1f[_0xa58e('0x3')](_0x1a8ac9,_0x230017);};}function removeListener(_0x46cf21,_0x420d0d){return function(){WhatsappQueueEvents[_0xa58e('0x4')](_0x46cf21,_0x420d0d);};}exports[_0xa58e('0x5')]=function(_0x24249e){for(var _0x1182a3=0x0,_0x2c1e42=events['length'];_0x1182a3<_0x2c1e42;_0x1182a3++){var _0xf9c3e5=events[_0x1182a3];var _0x45426f=createListener(_0xa58e('0x6')+_0xf9c3e5,_0x24249e);WhatsappQueueEvents['on'](_0xf9c3e5,_0x45426f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 8b0aed0..1fb249b 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 _0xb278=['index','describe','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated'];(function(_0x3ec122,_0x55150a){var _0x4ecf41=function(_0x1709cd){while(--_0x1709cd){_0x3ec122['push'](_0x3ec122['shift']());}};_0x4ecf41(++_0x55150a);}(_0xb278,0x15e));var _0x8b27=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb278[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x8b27('0x0'));var util=require(_0x8b27('0x1'));var path=require(_0x8b27('0x2'));var timeout=require(_0x8b27('0x3'));var express=require('express');var router=express[_0x8b27('0x4')]();var auth=require(_0x8b27('0x5'));var interaction=require(_0x8b27('0x6'));var config=require(_0x8b27('0x7'));var controller=require(_0x8b27('0x8'));router[_0x8b27('0x9')]('/',auth[_0x8b27('0xa')](),controller[_0x8b27('0xb')]);router[_0x8b27('0x9')]('/describe',auth[_0x8b27('0xa')](),controller[_0x8b27('0xc')]);router[_0x8b27('0x9')](_0x8b27('0xd'),auth[_0x8b27('0xa')](),controller[_0x8b27('0xe')]);router['post']('/',auth[_0x8b27('0xa')](),controller['create']);router[_0x8b27('0xf')](_0x8b27('0xd'),auth['isAuthenticated'](),controller[_0x8b27('0x10')]);router['delete'](_0x8b27('0xd'),auth[_0x8b27('0xa')](),controller[_0x8b27('0x11')]);module[_0x8b27('0x12')]=router; \ No newline at end of file +var _0xa7b3=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','index','describe','isAuthenticated','show','create','put','/:id','update','destroy','exports'];(function(_0xf130d,_0x3bc2c9){var _0x58c72c=function(_0x3cfa9){while(--_0x3cfa9){_0xf130d['push'](_0xf130d['shift']());}};_0x58c72c(++_0x3bc2c9);}(_0xa7b3,0x1ee));var _0x3a7b=function(_0x2afe8d,_0x36b9df){_0x2afe8d=_0x2afe8d-0x0;var _0x2a7365=_0xa7b3[_0x2afe8d];return _0x2a7365;};'use strict';var multer=require('multer');var util=require(_0x3a7b('0x0'));var path=require(_0x3a7b('0x1'));var timeout=require(_0x3a7b('0x2'));var express=require(_0x3a7b('0x3'));var router=express[_0x3a7b('0x4')]();var auth=require(_0x3a7b('0x5'));var interaction=require(_0x3a7b('0x6'));var config=require('../../config/environment');var controller=require(_0x3a7b('0x7'));router[_0x3a7b('0x8')]('/',auth['isAuthenticated'](),controller[_0x3a7b('0x9')]);router[_0x3a7b('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3a7b('0xa')]);router[_0x3a7b('0x8')]('/:id',auth[_0x3a7b('0xb')](),controller[_0x3a7b('0xc')]);router['post']('/',auth[_0x3a7b('0xb')](),controller[_0x3a7b('0xd')]);router[_0x3a7b('0xe')](_0x3a7b('0xf'),auth[_0x3a7b('0xb')](),controller[_0x3a7b('0x10')]);router['delete'](_0x3a7b('0xf'),auth[_0x3a7b('0xb')](),controller[_0x3a7b('0x11')]);module[_0x3a7b('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index fe6ccc7..a79d57d 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 _0x7217=['sequelize','STRING','DATE'];(function(_0x496f7f,_0x28ac6a){var _0x1b0fdd=function(_0x13098a){while(--_0x13098a){_0x496f7f['push'](_0x496f7f['shift']());}};_0x1b0fdd(++_0x28ac6a);}(_0x7217,0x19e));var _0x7721=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x7217[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7721('0x1')]},'joinAt':{'type':Sequelize[_0x7721('0x2')]},'leaveAt':{'type':Sequelize[_0x7721('0x2')]},'acceptAt':{'type':Sequelize[_0x7721('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7217=['sequelize','STRING','DATE'];(function(_0x4d7c09,_0x50c87b){var _0x303838=function(_0x2e53b2){while(--_0x2e53b2){_0x4d7c09['push'](_0x4d7c09['shift']());}};_0x303838(++_0x50c87b);}(_0x7217,0x19e));var _0x7721=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7217[_0x5447fd];return _0x15b28a;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7721('0x1')]},'joinAt':{'type':Sequelize[_0x7721('0x2')]},'leaveAt':{'type':Sequelize[_0x7721('0x2')]},'acceptAt':{'type':Sequelize[_0x7721('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index ab94964..4929dd7 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 _0xe740=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','filter','where','merge','VIRTUAL','options','WhatsappQueueReport','count','includeAll','include','findAll','catch','params','keys','length','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x279b5f,_0x3ab5e6){var _0x5ad7da=function(_0x19d3f3){while(--_0x19d3f3){_0x279b5f['push'](_0x279b5f['shift']());}};_0x5ad7da(++_0x3ab5e6);}(_0xe740,0x14b));var _0x0e74=function(_0x234ae1,_0x42bdd6){_0x234ae1=_0x234ae1-0x0;var _0x227ba0=_0xe740[_0x234ae1];return _0x227ba0;};'use strict';var pdf=require(_0x0e74('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0e74('0x1'));var zipdir=require(_0x0e74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e74('0x3'));var moment=require('moment');var BPromise=require(_0x0e74('0x4'));var Mustache=require('mustache');var util=require(_0x0e74('0x5'));var path=require(_0x0e74('0x6'));var sox=require('sox');var csv=require(_0x0e74('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e74('0x8'));var squel=require(_0x0e74('0x9'));var crypto=require(_0x0e74('0xa'));var jsforce=require(_0x0e74('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0e74('0x7'));var querystring=require(_0x0e74('0xc'));var Papa=require(_0x0e74('0xd'));var Redis=require(_0x0e74('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0e74('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e74('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x0e74('0x11'));var config=require(_0x0e74('0x12'));var db=require(_0x0e74('0x13'))['db'];function respondWithStatusCode(_0x30b078,_0x4b45f0){_0x4b45f0=_0x4b45f0||0xcc;return function(_0x3dc1b4){if(_0x3dc1b4){return _0x30b078['sendStatus'](_0x4b45f0);}return _0x30b078[_0x0e74('0x14')](_0x4b45f0)[_0x0e74('0x15')]();};}function respondWithResult(_0x209257,_0x3784b3){_0x3784b3=_0x3784b3||0xc8;return function(_0x1b0a50){if(_0x1b0a50){return _0x209257[_0x0e74('0x14')](_0x3784b3)[_0x0e74('0x16')](_0x1b0a50);}};}function respondWithFilteredResult(_0x2ac2ae,_0x3fee34){return function(_0x276f92){if(_0x276f92){var _0x1c9156=_0x276f92['count'],_0x205272=_0x3fee34[_0x0e74('0x17')],_0x2421a9=_0x3fee34[_0x0e74('0x17')]+_0x3fee34[_0x0e74('0x18')],_0x5972a0;if(_0x2421a9>=_0x1c9156){_0x2421a9=_0x1c9156;_0x5972a0=0xc8;}else{_0x5972a0=0xce;}_0x2ac2ae[_0x0e74('0x14')](_0x5972a0);return _0x2ac2ae[_0x0e74('0x19')](_0x0e74('0x1a'),_0x205272+'-'+_0x2421a9+'/'+_0x1c9156)[_0x0e74('0x16')](_0x276f92);}return null;};}function patchUpdates(_0x143fc0){return function(_0x1a0272){try{jsonpatch[_0x0e74('0x1b')](_0x1a0272,_0x143fc0,!![]);}catch(_0x205135){return BPromise['reject'](_0x205135);}return _0x1a0272[_0x0e74('0x1c')]();};}function saveUpdates(_0x46ebe6,_0x3cf369){return function(_0x24df6b){if(_0x24df6b){return _0x24df6b[_0x0e74('0x1d')](_0x46ebe6)[_0x0e74('0x1e')](function(_0x597e6f){return _0x597e6f;});}return null;};}function removeEntity(_0x314939,_0x2497a9){return function(_0x5a676c){if(_0x5a676c){return _0x5a676c[_0x0e74('0x1f')]()['then'](function(){_0x314939[_0x0e74('0x14')](0xcc)[_0x0e74('0x15')]();});}};}function handleEntityNotFound(_0x369cc8,_0x281f75){return function(_0x115ac4){if(!_0x115ac4){_0x369cc8[_0x0e74('0x20')](0x194);}return _0x115ac4;};}function handleError(_0x43dab3,_0x33f89c){_0x33f89c=_0x33f89c||0x1f4;return function(_0x25f712){logger[_0x0e74('0x21')](_0x25f712[_0x0e74('0x22')]);if(_0x25f712[_0x0e74('0x23')]){delete _0x25f712[_0x0e74('0x23')];}_0x43dab3['status'](_0x33f89c)[_0x0e74('0x24')](_0x25f712);};}exports[_0x0e74('0x25')]=function(_0xab233e,_0x50d561){var _0x9d1248={},_0x24db44={},_0x1e35e4={'count':0x0,'rows':[]};var _0x1a4863=_[_0x0e74('0x26')](db['WhatsappQueueReport'][_0x0e74('0x27')],function(_0x172870){return{'name':_0x172870[_0x0e74('0x28')],'type':_0x172870[_0x0e74('0x29')]['key']};});_0x24db44[_0x0e74('0x2a')]=_[_0x0e74('0x26')](_0x1a4863,'name');_0x24db44[_0x0e74('0x2b')]=_['keys'](_0xab233e[_0x0e74('0x2b')]);_0x24db44[_0x0e74('0x2c')]=_['intersection'](_0x24db44[_0x0e74('0x2a')],_0x24db44[_0x0e74('0x2b')]);_0x9d1248[_0x0e74('0x2d')]=_[_0x0e74('0x2e')](_0x24db44[_0x0e74('0x2a')],qs[_0x0e74('0x2f')](_0xab233e['query']['fields']));_0x9d1248[_0x0e74('0x2d')]=_0x9d1248[_0x0e74('0x2d')]['length']?_0x9d1248['attributes']:_0x24db44[_0x0e74('0x2a')];if(!_0xab233e['query'][_0x0e74('0x30')](_0x0e74('0x31'))){_0x9d1248[_0x0e74('0x18')]=qs[_0x0e74('0x18')](_0xab233e[_0x0e74('0x2b')]['limit']);_0x9d1248['offset']=qs[_0x0e74('0x17')](_0xab233e[_0x0e74('0x2b')][_0x0e74('0x17')]);}_0x9d1248[_0x0e74('0x32')]=qs['sort'](_0xab233e[_0x0e74('0x2b')]['sort']);_0x9d1248['where']=qs['filters'](_['pick'](_0xab233e[_0x0e74('0x2b')],_0x24db44[_0x0e74('0x2c')]),_0x1a4863);if(_0xab233e[_0x0e74('0x2b')][_0x0e74('0x33')]){_0x9d1248[_0x0e74('0x34')]=_[_0x0e74('0x35')](_0x9d1248[_0x0e74('0x34')],{'$or':_[_0x0e74('0x26')](_0x1a4863,function(_0x3fc00c){if(_0x3fc00c['type']!==_0x0e74('0x36')){var _0x4c2757={};_0x4c2757[_0x3fc00c[_0x0e74('0x23')]]={'$like':'%'+_0xab233e[_0x0e74('0x2b')][_0x0e74('0x33')]+'%'};return _0x4c2757;}})});}_0x9d1248=_[_0x0e74('0x35')]({},_0x9d1248,_0xab233e[_0x0e74('0x37')]);var _0x1d6c2d={'where':_0x9d1248[_0x0e74('0x34')]};return db[_0x0e74('0x38')][_0x0e74('0x39')](_0x1d6c2d)['then'](function(_0x27a81b){_0x1e35e4[_0x0e74('0x39')]=_0x27a81b;if(_0xab233e[_0x0e74('0x2b')][_0x0e74('0x3a')]){_0x9d1248[_0x0e74('0x3b')]=[{'all':!![]}];}return db[_0x0e74('0x38')][_0x0e74('0x3c')](_0x9d1248);})[_0x0e74('0x1e')](function(_0x19d204){_0x1e35e4['rows']=_0x19d204;return _0x1e35e4;})['then'](respondWithFilteredResult(_0x50d561,_0x9d1248))[_0x0e74('0x3d')](handleError(_0x50d561,null));};exports['show']=function(_0x59bdbf,_0x389783){var _0x30e90b={'raw':!![],'where':{'id':_0x59bdbf[_0x0e74('0x3e')]['id']}},_0x20c748={};_0x20c748[_0x0e74('0x2a')]=_[_0x0e74('0x3f')](db[_0x0e74('0x38')]['rawAttributes']);_0x20c748[_0x0e74('0x2b')]=_['keys'](_0x59bdbf[_0x0e74('0x2b')]);_0x20c748[_0x0e74('0x2c')]=_[_0x0e74('0x2e')](_0x20c748['model'],_0x20c748['query']);_0x30e90b['attributes']=_[_0x0e74('0x2e')](_0x20c748[_0x0e74('0x2a')],qs[_0x0e74('0x2f')](_0x59bdbf[_0x0e74('0x2b')][_0x0e74('0x2f')]));_0x30e90b[_0x0e74('0x2d')]=_0x30e90b[_0x0e74('0x2d')][_0x0e74('0x40')]?_0x30e90b['attributes']:_0x20c748['model'];if(_0x59bdbf['query'][_0x0e74('0x3a')]){_0x30e90b[_0x0e74('0x3b')]=[{'all':!![]}];}_0x30e90b=_[_0x0e74('0x35')]({},_0x30e90b,_0x59bdbf[_0x0e74('0x37')]);return db[_0x0e74('0x38')][_0x0e74('0x41')](_0x30e90b)[_0x0e74('0x1e')](handleEntityNotFound(_0x389783,null))[_0x0e74('0x1e')](respondWithResult(_0x389783,null))[_0x0e74('0x3d')](handleError(_0x389783,null));};exports['create']=function(_0xb5ba29,_0xfd2d1b){return db[_0x0e74('0x38')][_0x0e74('0x42')](_0xb5ba29[_0x0e74('0x43')],{})[_0x0e74('0x1e')](respondWithResult(_0xfd2d1b,0xc9))[_0x0e74('0x3d')](handleError(_0xfd2d1b,null));};exports[_0x0e74('0x1d')]=function(_0x1098fd,_0x29b1ac){if(_0x1098fd['body']['id']){delete _0x1098fd['body']['id'];}return db[_0x0e74('0x38')][_0x0e74('0x41')]({'where':{'id':_0x1098fd[_0x0e74('0x3e')]['id']}})['then'](handleEntityNotFound(_0x29b1ac,null))[_0x0e74('0x1e')](saveUpdates(_0x1098fd[_0x0e74('0x43')],null))[_0x0e74('0x1e')](respondWithResult(_0x29b1ac,null))[_0x0e74('0x3d')](handleError(_0x29b1ac,null));};exports[_0x0e74('0x1f')]=function(_0x9d0660,_0x2a673a){return db[_0x0e74('0x38')][_0x0e74('0x41')]({'where':{'id':_0x9d0660[_0x0e74('0x3e')]['id']}})[_0x0e74('0x1e')](handleEntityNotFound(_0x2a673a,null))['then'](removeEntity(_0x2a673a,null))[_0x0e74('0x3d')](handleError(_0x2a673a,null));};exports[_0x0e74('0x44')]=function(_0x506231,_0x43be05){return db[_0x0e74('0x38')][_0x0e74('0x44')]()[_0x0e74('0x1e')](respondWithResult(_0x43be05,null))[_0x0e74('0x3d')](handleError(_0x43be05,null));}; \ No newline at end of file +var _0xef66=['limit','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','find','catch','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x2de5cf,_0x4668fc){var _0x131b2b=function(_0x552987){while(--_0x552987){_0x2de5cf['push'](_0x2de5cf['shift']());}};_0x131b2b(++_0x4668fc);}(_0xef66,0x1db));var _0x6ef6=function(_0x50ba20,_0xcba0){_0x50ba20=_0x50ba20-0x0;var _0xa95697=_0xef66[_0x50ba20];return _0xa95697;};'use strict';var pdf=require(_0x6ef6('0x0'));var emlformat=require(_0x6ef6('0x1'));var rimraf=require(_0x6ef6('0x2'));var zipdir=require(_0x6ef6('0x3'));var jsonpatch=require(_0x6ef6('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6ef6('0x5'));var Mustache=require(_0x6ef6('0x6'));var util=require(_0x6ef6('0x7'));var path=require(_0x6ef6('0x8'));var sox=require(_0x6ef6('0x9'));var csv=require(_0x6ef6('0xa'));var ejs=require(_0x6ef6('0xb'));var fs=require('fs');var _=require(_0x6ef6('0xc'));var squel=require(_0x6ef6('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ef6('0xe'));var toCsv=require(_0x6ef6('0xa'));var querystring=require(_0x6ef6('0xf'));var Papa=require(_0x6ef6('0x10'));var Redis=require(_0x6ef6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ef6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ef6('0x13'))('api');var utils=require(_0x6ef6('0x14'));var config=require(_0x6ef6('0x15'));var db=require(_0x6ef6('0x16'))['db'];function respondWithStatusCode(_0x331113,_0x596b91){_0x596b91=_0x596b91||0xcc;return function(_0x3aa045){if(_0x3aa045){return _0x331113[_0x6ef6('0x17')](_0x596b91);}return _0x331113[_0x6ef6('0x18')](_0x596b91)[_0x6ef6('0x19')]();};}function respondWithResult(_0x5ba663,_0x265583){_0x265583=_0x265583||0xc8;return function(_0x5845b7){if(_0x5845b7){return _0x5ba663[_0x6ef6('0x18')](_0x265583)[_0x6ef6('0x1a')](_0x5845b7);}};}function respondWithFilteredResult(_0x587806,_0x248ab3){return function(_0x1f4c3d){if(_0x1f4c3d){var _0x453aa3=_0x1f4c3d[_0x6ef6('0x1b')],_0x3f0a84=_0x248ab3[_0x6ef6('0x1c')],_0x3fa688=_0x248ab3[_0x6ef6('0x1c')]+_0x248ab3[_0x6ef6('0x1d')],_0x2e6eb6;if(_0x3fa688>=_0x453aa3){_0x3fa688=_0x453aa3;_0x2e6eb6=0xc8;}else{_0x2e6eb6=0xce;}_0x587806['status'](_0x2e6eb6);return _0x587806[_0x6ef6('0x1e')](_0x6ef6('0x1f'),_0x3f0a84+'-'+_0x3fa688+'/'+_0x453aa3)[_0x6ef6('0x1a')](_0x1f4c3d);}return null;};}function patchUpdates(_0x37d2ef){return function(_0x2a3364){try{jsonpatch[_0x6ef6('0x20')](_0x2a3364,_0x37d2ef,!![]);}catch(_0xb9a5fa){return BPromise['reject'](_0xb9a5fa);}return _0x2a3364[_0x6ef6('0x21')]();};}function saveUpdates(_0x20ef96,_0x2903ea){return function(_0x11ade5){if(_0x11ade5){return _0x11ade5['update'](_0x20ef96)[_0x6ef6('0x22')](function(_0xc0514c){return _0xc0514c;});}return null;};}function removeEntity(_0xed332b,_0x4f6df6){return function(_0x4257d8){if(_0x4257d8){return _0x4257d8[_0x6ef6('0x23')]()['then'](function(){_0xed332b[_0x6ef6('0x18')](0xcc)[_0x6ef6('0x19')]();});}};}function handleEntityNotFound(_0x4d7f90,_0x366f2c){return function(_0xb1c6b0){if(!_0xb1c6b0){_0x4d7f90[_0x6ef6('0x17')](0x194);}return _0xb1c6b0;};}function handleError(_0x414def,_0x43bb8d){_0x43bb8d=_0x43bb8d||0x1f4;return function(_0x3246df){logger[_0x6ef6('0x24')](_0x3246df['stack']);if(_0x3246df[_0x6ef6('0x25')]){delete _0x3246df['name'];}_0x414def[_0x6ef6('0x18')](_0x43bb8d)[_0x6ef6('0x26')](_0x3246df);};}exports[_0x6ef6('0x27')]=function(_0xada7a8,_0x1faa2c){var _0xf69d3d={},_0x23eb77={},_0x3e027d={'count':0x0,'rows':[]};var _0x20c7f4=_[_0x6ef6('0x28')](db[_0x6ef6('0x29')][_0x6ef6('0x2a')],function(_0x483f4d){return{'name':_0x483f4d[_0x6ef6('0x2b')],'type':_0x483f4d[_0x6ef6('0x2c')][_0x6ef6('0x2d')]};});_0x23eb77[_0x6ef6('0x2e')]=_[_0x6ef6('0x28')](_0x20c7f4,_0x6ef6('0x25'));_0x23eb77[_0x6ef6('0x2f')]=_['keys'](_0xada7a8[_0x6ef6('0x2f')]);_0x23eb77['filters']=_[_0x6ef6('0x30')](_0x23eb77[_0x6ef6('0x2e')],_0x23eb77[_0x6ef6('0x2f')]);_0xf69d3d['attributes']=_['intersection'](_0x23eb77[_0x6ef6('0x2e')],qs[_0x6ef6('0x31')](_0xada7a8[_0x6ef6('0x2f')]['fields']));_0xf69d3d[_0x6ef6('0x32')]=_0xf69d3d['attributes'][_0x6ef6('0x33')]?_0xf69d3d[_0x6ef6('0x32')]:_0x23eb77['model'];if(!_0xada7a8['query'][_0x6ef6('0x34')]('nolimit')){_0xf69d3d[_0x6ef6('0x1d')]=qs['limit'](_0xada7a8[_0x6ef6('0x2f')]['limit']);_0xf69d3d['offset']=qs[_0x6ef6('0x1c')](_0xada7a8[_0x6ef6('0x2f')]['offset']);}_0xf69d3d[_0x6ef6('0x35')]=qs['sort'](_0xada7a8[_0x6ef6('0x2f')]['sort']);_0xf69d3d[_0x6ef6('0x36')]=qs['filters'](_[_0x6ef6('0x37')](_0xada7a8[_0x6ef6('0x2f')],_0x23eb77[_0x6ef6('0x38')]),_0x20c7f4);if(_0xada7a8['query']['filter']){_0xf69d3d[_0x6ef6('0x36')]=_[_0x6ef6('0x39')](_0xf69d3d[_0x6ef6('0x36')],{'$or':_[_0x6ef6('0x28')](_0x20c7f4,function(_0x47b474){if(_0x47b474['type']!==_0x6ef6('0x3a')){var _0x55212c={};_0x55212c[_0x47b474['name']]={'$like':'%'+_0xada7a8[_0x6ef6('0x2f')]['filter']+'%'};return _0x55212c;}})});}_0xf69d3d=_[_0x6ef6('0x39')]({},_0xf69d3d,_0xada7a8[_0x6ef6('0x3b')]);var _0x30649c={'where':_0xf69d3d[_0x6ef6('0x36')]};return db[_0x6ef6('0x29')][_0x6ef6('0x1b')](_0x30649c)[_0x6ef6('0x22')](function(_0x5c5e8a){_0x3e027d[_0x6ef6('0x1b')]=_0x5c5e8a;if(_0xada7a8['query']['includeAll']){_0xf69d3d[_0x6ef6('0x3c')]=[{'all':!![]}];}return db[_0x6ef6('0x29')][_0x6ef6('0x3d')](_0xf69d3d);})['then'](function(_0x335afd){_0x3e027d[_0x6ef6('0x3e')]=_0x335afd;return _0x3e027d;})[_0x6ef6('0x22')](respondWithFilteredResult(_0x1faa2c,_0xf69d3d))['catch'](handleError(_0x1faa2c,null));};exports[_0x6ef6('0x3f')]=function(_0x22c1c3,_0x19a0ab){var _0x1bf2af={'raw':!![],'where':{'id':_0x22c1c3[_0x6ef6('0x40')]['id']}},_0xba84ba={};_0xba84ba[_0x6ef6('0x2e')]=_[_0x6ef6('0x41')](db[_0x6ef6('0x29')][_0x6ef6('0x2a')]);_0xba84ba['query']=_[_0x6ef6('0x41')](_0x22c1c3[_0x6ef6('0x2f')]);_0xba84ba[_0x6ef6('0x38')]=_[_0x6ef6('0x30')](_0xba84ba[_0x6ef6('0x2e')],_0xba84ba[_0x6ef6('0x2f')]);_0x1bf2af[_0x6ef6('0x32')]=_[_0x6ef6('0x30')](_0xba84ba[_0x6ef6('0x2e')],qs[_0x6ef6('0x31')](_0x22c1c3[_0x6ef6('0x2f')]['fields']));_0x1bf2af[_0x6ef6('0x32')]=_0x1bf2af['attributes'][_0x6ef6('0x33')]?_0x1bf2af['attributes']:_0xba84ba[_0x6ef6('0x2e')];if(_0x22c1c3[_0x6ef6('0x2f')]['includeAll']){_0x1bf2af[_0x6ef6('0x3c')]=[{'all':!![]}];}_0x1bf2af=_[_0x6ef6('0x39')]({},_0x1bf2af,_0x22c1c3[_0x6ef6('0x3b')]);return db[_0x6ef6('0x29')][_0x6ef6('0x42')](_0x1bf2af)['then'](handleEntityNotFound(_0x19a0ab,null))[_0x6ef6('0x22')](respondWithResult(_0x19a0ab,null))[_0x6ef6('0x43')](handleError(_0x19a0ab,null));};exports[_0x6ef6('0x44')]=function(_0x315d1a,_0x26e869){return db[_0x6ef6('0x29')][_0x6ef6('0x44')](_0x315d1a[_0x6ef6('0x45')],{})['then'](respondWithResult(_0x26e869,0xc9))[_0x6ef6('0x43')](handleError(_0x26e869,null));};exports[_0x6ef6('0x46')]=function(_0x52e93f,_0x5d6b40){if(_0x52e93f[_0x6ef6('0x45')]['id']){delete _0x52e93f['body']['id'];}return db[_0x6ef6('0x29')]['find']({'where':{'id':_0x52e93f[_0x6ef6('0x40')]['id']}})[_0x6ef6('0x22')](handleEntityNotFound(_0x5d6b40,null))[_0x6ef6('0x22')](saveUpdates(_0x52e93f[_0x6ef6('0x45')],null))['then'](respondWithResult(_0x5d6b40,null))['catch'](handleError(_0x5d6b40,null));};exports['destroy']=function(_0x537be2,_0x2fdb50){return db[_0x6ef6('0x29')][_0x6ef6('0x42')]({'where':{'id':_0x537be2['params']['id']}})[_0x6ef6('0x22')](handleEntityNotFound(_0x2fdb50,null))[_0x6ef6('0x22')](removeEntity(_0x2fdb50,null))[_0x6ef6('0x43')](handleError(_0x2fdb50,null));};exports[_0x6ef6('0x47')]=function(_0x1d5be1,_0x2be927){return db[_0x6ef6('0x29')]['describe']()[_0x6ef6('0x22')](respondWithResult(_0x2be927,null))['catch'](handleError(_0x2be927,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 62e7881..64b5114 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 _0x1cbc=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','WhatsappQueueReport','uniqueid','lodash','../../config/logger','api'];(function(_0x517a2e,_0x2ed0a0){var _0x463a70=function(_0x27ce3f){while(--_0x27ce3f){_0x517a2e['push'](_0x517a2e['shift']());}};_0x463a70(++_0x2ed0a0);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x40d728,_0x190ef2){_0x40d728=_0x40d728-0x0;var _0x207740=_0x1cbc[_0x40d728];return _0x207740;};'use strict';var _=require(_0xc1cb('0x0'));var util=require('util');var logger=require(_0xc1cb('0x1'))(_0xc1cb('0x2'));var moment=require(_0xc1cb('0x3'));var BPromise=require(_0xc1cb('0x4'));var rp=require(_0xc1cb('0x5'));var fs=require('fs');var path=require(_0xc1cb('0x6'));var rimraf=require(_0xc1cb('0x7'));var config=require(_0xc1cb('0x8'));var attributes=require(_0xc1cb('0x9'));module[_0xc1cb('0xa')]=function(_0x1dacec,_0x27423b){return _0x1dacec['define'](_0xc1cb('0xb'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xc1cb('0xc'),'fields':[_0xc1cb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x869b=['report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','WhatsappQueueReport'];(function(_0xbb70f5,_0x40bfb3){var _0x30b1a9=function(_0x2a778d){while(--_0x2a778d){_0xbb70f5['push'](_0xbb70f5['shift']());}};_0x30b1a9(++_0x40bfb3);}(_0x869b,0xaa));var _0xb869=function(_0x4c3f4b,_0x440546){_0x4c3f4b=_0x4c3f4b-0x0;var _0x39daae=_0x869b[_0x4c3f4b];return _0x39daae;};'use strict';var _=require(_0xb869('0x0'));var util=require(_0xb869('0x1'));var logger=require(_0xb869('0x2'))(_0xb869('0x3'));var moment=require(_0xb869('0x4'));var BPromise=require(_0xb869('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb869('0x6'));var rimraf=require(_0xb869('0x7'));var config=require(_0xb869('0x8'));var attributes=require(_0xb869('0x9'));module['exports']=function(_0x15b266,_0x4ec375){return _0x15b266[_0xb869('0xa')](_0xb869('0xb'),attributes,{'tableName':_0xb869('0xc'),'paranoid':![],'indexes':[{'name':_0xb869('0xd'),'fields':[_0xb869('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 1ea5825..d273ea2 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 _0x69c1=['body','options','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','WhatsappQueueReport','update','raw','where','limit','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x467c7c,_0x17bd60){var _0x13d8e1=function(_0x4d10c9){while(--_0x4d10c9){_0x467c7c['push'](_0x467c7c['shift']());}};_0x13d8e1(++_0x17bd60);}(_0x69c1,0xf1));var _0x169c=function(_0xdf3db6,_0x2a1952){_0xdf3db6=_0xdf3db6-0x0;var _0x4b7a65=_0x69c1[_0xdf3db6];return _0x4b7a65;};'use strict';var _=require('lodash');var util=require(_0x169c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x169c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x169c('0x2'));var logger=require(_0x169c('0x3'))(_0x169c('0x4'));var config=require(_0x169c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x169c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf38032,_0x4a8b4d,_0x3fd4b3){return new BPromise(function(_0x398f8a,_0x7931af){return client[_0x169c('0x7')](_0xf38032,_0x3fd4b3)[_0x169c('0x8')](function(_0x25f1a5){logger[_0x169c('0x9')](_0x169c('0xa'),_0x4a8b4d,_0x169c('0xb'));logger[_0x169c('0xc')](_0x169c('0xd'),_0x4a8b4d,_0x169c('0xb'),JSON[_0x169c('0xe')](_0x25f1a5));if(_0x25f1a5[_0x169c('0xf')]){if(_0x25f1a5[_0x169c('0xf')][_0x169c('0x10')]===0x1f4){logger[_0x169c('0xf')](_0x169c('0xa'),_0x4a8b4d,_0x25f1a5[_0x169c('0xf')][_0x169c('0x11')]);return _0x7931af(_0x25f1a5[_0x169c('0xf')][_0x169c('0x11')]);}logger[_0x169c('0xf')](_0x169c('0xa'),_0x4a8b4d,_0x25f1a5['error'][_0x169c('0x11')]);return _0x398f8a(_0x25f1a5[_0x169c('0xf')][_0x169c('0x11')]);}else{logger['info'](_0x169c('0xa'),_0x4a8b4d,_0x169c('0xb'));_0x398f8a(_0x25f1a5[_0x169c('0x12')][_0x169c('0x11')]);}})[_0x169c('0x13')](function(_0x2280b3){logger[_0x169c('0xf')](_0x169c('0xa'),_0x4a8b4d,_0x2280b3);_0x7931af(_0x2280b3);});});}exports['CreateWhatsappQueueReport']=function(_0x5a29f9){var _0x2a9258=this;return new Promise(function(_0x46dd7f,_0xc77bd5){return db['WhatsappQueueReport']['create'](_0x5a29f9[_0x169c('0x14')],{'raw':_0x5a29f9['options']?_0x5a29f9[_0x169c('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x291032){logger['info'](_0x169c('0x16'),_0x5a29f9);logger[_0x169c('0xc')](_0x169c('0x16'),_0x5a29f9,JSON['stringify'](_0x291032));_0x46dd7f(_0x291032);})[_0x169c('0x13')](function(_0x4ed19d){logger[_0x169c('0xf')](_0x169c('0x16'),_0x4ed19d[_0x169c('0x11')],_0x5a29f9);_0xc77bd5(_0x2a9258[_0x169c('0xf')](0x1f4,_0x4ed19d[_0x169c('0x11')]));});});};exports[_0x169c('0x17')]=function(_0x3f661b){var _0x5a4623=this;return new Promise(function(_0x83b6de,_0x4dcd4b){return db[_0x169c('0x18')][_0x169c('0x19')](_0x3f661b['body'],{'raw':_0x3f661b[_0x169c('0x15')]?_0x3f661b[_0x169c('0x15')][_0x169c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f661b[_0x169c('0x15')]?_0x3f661b[_0x169c('0x15')][_0x169c('0x1b')]||null:null,'attributes':_0x3f661b[_0x169c('0x15')]?_0x3f661b[_0x169c('0x15')]['attributes']||null:null,'limit':_0x3f661b[_0x169c('0x15')]?_0x3f661b['options'][_0x169c('0x1c')]||null:null})[_0x169c('0x8')](function(_0x37d8d2){logger[_0x169c('0x9')](_0x169c('0x17'),_0x3f661b);logger['debug'](_0x169c('0x17'),_0x3f661b,JSON[_0x169c('0xe')](_0x37d8d2));_0x83b6de(_0x37d8d2);})[_0x169c('0x13')](function(_0x113de8){logger['error'](_0x169c('0x17'),_0x113de8[_0x169c('0x11')],_0x3f661b);_0x4dcd4b(_0x5a4623[_0x169c('0xf')](0x1f4,_0x113de8[_0x169c('0x11')]));});});}; \ No newline at end of file +var _0xa83c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','body','options','raw','then','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x8256f,_0x4caeeb){var _0x49891d=function(_0x3288be){while(--_0x3288be){_0x8256f['push'](_0x8256f['shift']());}};_0x49891d(++_0x4caeeb);}(_0xa83c,0xa9));var _0xca83=function(_0x4063a4,_0x19d730){_0x4063a4=_0x4063a4-0x0;var _0x17908d=_0xa83c[_0x4063a4];return _0x17908d;};'use strict';var _=require(_0xca83('0x0'));var util=require(_0xca83('0x1'));var moment=require(_0xca83('0x2'));var BPromise=require(_0xca83('0x3'));var rs=require(_0xca83('0x4'));var fs=require('fs');var Redis=require(_0xca83('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xca83('0x6'));var logger=require(_0xca83('0x7'))(_0xca83('0x8'));var config=require('../../config/environment');var jayson=require(_0xca83('0x9'));var client=jayson[_0xca83('0xa')][_0xca83('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29a73b,_0x295a88,_0x5f58aa){return new BPromise(function(_0x3914b7,_0x217329){return client[_0xca83('0xc')](_0x29a73b,_0x5f58aa)['then'](function(_0x5e66c3){logger[_0xca83('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x295a88,_0xca83('0xe'));logger[_0xca83('0xf')](_0xca83('0x10'),_0x295a88,_0xca83('0xe'),JSON[_0xca83('0x11')](_0x5e66c3));if(_0x5e66c3[_0xca83('0x12')]){if(_0x5e66c3[_0xca83('0x12')][_0xca83('0x13')]===0x1f4){logger[_0xca83('0x12')](_0xca83('0x14'),_0x295a88,_0x5e66c3[_0xca83('0x12')]['message']);return _0x217329(_0x5e66c3[_0xca83('0x12')][_0xca83('0x15')]);}logger[_0xca83('0x12')](_0xca83('0x14'),_0x295a88,_0x5e66c3[_0xca83('0x12')]['message']);return _0x3914b7(_0x5e66c3['error']['message']);}else{logger['info'](_0xca83('0x14'),_0x295a88,_0xca83('0xe'));_0x3914b7(_0x5e66c3[_0xca83('0x16')]['message']);}})[_0xca83('0x17')](function(_0x1e6e0d){logger[_0xca83('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x295a88,_0x1e6e0d);_0x217329(_0x1e6e0d);});});}exports[_0xca83('0x18')]=function(_0x46dbc8){var _0x3f46b9=this;return new Promise(function(_0x1e6d9b,_0x411727){return db['WhatsappQueueReport']['create'](_0x46dbc8[_0xca83('0x19')],{'raw':_0x46dbc8[_0xca83('0x1a')]?_0x46dbc8[_0xca83('0x1a')][_0xca83('0x1b')]===undefined?!![]:![]:!![]})[_0xca83('0x1c')](function(_0x373766){logger[_0xca83('0xd')]('CreateWhatsappQueueReport',_0x46dbc8);logger[_0xca83('0xf')](_0xca83('0x18'),_0x46dbc8,JSON[_0xca83('0x11')](_0x373766));_0x1e6d9b(_0x373766);})[_0xca83('0x17')](function(_0x5c193a){logger[_0xca83('0x12')](_0xca83('0x18'),_0x5c193a[_0xca83('0x15')],_0x46dbc8);_0x411727(_0x3f46b9[_0xca83('0x12')](0x1f4,_0x5c193a['message']));});});};exports[_0xca83('0x1d')]=function(_0x10037e){var _0x3e4d93=this;return new Promise(function(_0x1a7e4c,_0x377800){return db[_0xca83('0x1e')][_0xca83('0x1f')](_0x10037e[_0xca83('0x19')],{'raw':_0x10037e[_0xca83('0x1a')]?_0x10037e[_0xca83('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10037e[_0xca83('0x1a')]?_0x10037e['options'][_0xca83('0x20')]||null:null,'attributes':_0x10037e[_0xca83('0x1a')]?_0x10037e[_0xca83('0x1a')][_0xca83('0x21')]||null:null,'limit':_0x10037e[_0xca83('0x1a')]?_0x10037e['options'][_0xca83('0x22')]||null:null})[_0xca83('0x1c')](function(_0x41686a){logger[_0xca83('0xd')](_0xca83('0x1d'),_0x10037e);logger[_0xca83('0xf')]('UpdateWhatsappQueueReport',_0x10037e,JSON[_0xca83('0x11')](_0x41686a));_0x1a7e4c(_0x41686a);})[_0xca83('0x17')](function(_0x3939d0){logger[_0xca83('0x12')](_0xca83('0x1d'),_0x3939d0['message'],_0x10037e);_0x377800(_0x3e4d93[_0xca83('0x12')](0x1f4,_0x3939d0[_0xca83('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 044a117..971c077 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 _0x4e30=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x4e30,0x112));var _0x04e3=function(_0x54d79c,_0x20fd35){_0x54d79c=_0x54d79c-0x0;var _0xdb4aa0=_0x4e30[_0x54d79c];return _0xdb4aa0;};'use strict';var multer=require('multer');var util=require(_0x04e3('0x0'));var path=require(_0x04e3('0x1'));var timeout=require(_0x04e3('0x2'));var express=require(_0x04e3('0x3'));var router=express[_0x04e3('0x4')]();var auth=require(_0x04e3('0x5'));var interaction=require(_0x04e3('0x6'));var config=require(_0x04e3('0x7'));var controller=require(_0x04e3('0x8'));router[_0x04e3('0x9')]('/',auth[_0x04e3('0xa')](),controller['index']);router[_0x04e3('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x04e3('0xb')]);router[_0x04e3('0x9')](_0x04e3('0xc'),auth[_0x04e3('0xa')](),controller[_0x04e3('0xd')]);router[_0x04e3('0xe')]('/',auth[_0x04e3('0xa')](),controller[_0x04e3('0xf')]);router[_0x04e3('0x10')](_0x04e3('0xc'),auth[_0x04e3('0xa')](),controller[_0x04e3('0x11')]);router[_0x04e3('0x12')](_0x04e3('0xc'),auth[_0x04e3('0xa')](),controller[_0x04e3('0x13')]);module[_0x04e3('0x14')]=router; \ No newline at end of file +var _0xd38e=['delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','describe','/:id','show','post','isAuthenticated','create','update'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0xd38e,0x17d));var _0xed38=function(_0x40dac3,_0x1332a2){_0x40dac3=_0x40dac3-0x0;var _0x8367fe=_0xd38e[_0x40dac3];return _0x8367fe;};'use strict';var multer=require(_0xed38('0x0'));var util=require('util');var path=require(_0xed38('0x1'));var timeout=require(_0xed38('0x2'));var express=require(_0xed38('0x3'));var router=express[_0xed38('0x4')]();var auth=require(_0xed38('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed38('0x6'));var controller=require(_0xed38('0x7'));router[_0xed38('0x8')]('/',auth['isAuthenticated'](),controller[_0xed38('0x9')]);router[_0xed38('0x8')](_0xed38('0xa'),auth['isAuthenticated'](),controller[_0xed38('0xb')]);router[_0xed38('0x8')](_0xed38('0xc'),auth['isAuthenticated'](),controller[_0xed38('0xd')]);router[_0xed38('0xe')]('/',auth[_0xed38('0xf')](),controller[_0xed38('0x10')]);router['put'](_0xed38('0xc'),auth[_0xed38('0xf')](),controller[_0xed38('0x11')]);router[_0xed38('0x12')](_0xed38('0xc'),auth[_0xed38('0xf')](),controller['destroy']);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 3184517..680fb6e 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 _0x5f66=['queue','DATE','exports','ENUM','account','agent'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x65f6('0x1')](_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x65f6('0x5')]}}; \ No newline at end of file +var _0x757a=['queue','DATE','exports','STRING'];(function(_0x46066f,_0x23105c){var _0x411977=function(_0x5743ff){while(--_0x5743ff){_0x46066f['push'](_0x46066f['shift']());}};_0x411977(++_0x23105c);}(_0x757a,0xde));var _0xa757=function(_0x544ce8,_0xd5ff3a){_0x544ce8=_0x544ce8-0x0;var _0x25e05f=_0x757a[_0x544ce8];return _0x25e05f;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'uniqueid':{'type':Sequelize[_0xa757('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent',_0xa757('0x2')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xa757('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 936b4a6..2c8c47e 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 _0x164f=['params','include','find','create','update','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','Content-Range','reject','save','then','destroy','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show'];(function(_0xd58823,_0x15c483){var _0x249c0a=function(_0x4b8b67){while(--_0x4b8b67){_0xd58823['push'](_0xd58823['shift']());}};_0x249c0a(++_0x15c483);}(_0x164f,0x1c9));var _0xf164=function(_0x4b2f55,_0x12acd4){_0x4b2f55=_0x4b2f55-0x0;var _0x26cd17=_0x164f[_0x4b2f55];return _0x26cd17;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf164('0x0'));var rimraf=require(_0xf164('0x1'));var zipdir=require(_0xf164('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf164('0x3'));var moment=require(_0xf164('0x4'));var BPromise=require(_0xf164('0x5'));var Mustache=require('mustache');var util=require(_0xf164('0x6'));var path=require(_0xf164('0x7'));var sox=require(_0xf164('0x8'));var csv=require(_0xf164('0x9'));var ejs=require(_0xf164('0xa'));var fs=require('fs');var _=require(_0xf164('0xb'));var squel=require(_0xf164('0xc'));var crypto=require(_0xf164('0xd'));var jsforce=require(_0xf164('0xe'));var deskjs=require(_0xf164('0xf'));var toCsv=require(_0xf164('0x9'));var querystring=require(_0xf164('0x10'));var Papa=require(_0xf164('0x11'));var Redis=require(_0xf164('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf164('0x13'));var as=require(_0xf164('0x14'));var hardwareService=require(_0xf164('0x15'));var logger=require('../../config/logger')(_0xf164('0x16'));var utils=require(_0xf164('0x17'));var config=require(_0xf164('0x18'));var db=require(_0xf164('0x19'))['db'];function respondWithStatusCode(_0x208e84,_0xb168eb){_0xb168eb=_0xb168eb||0xcc;return function(_0x206d4f){if(_0x206d4f){return _0x208e84[_0xf164('0x1a')](_0xb168eb);}return _0x208e84['status'](_0xb168eb)[_0xf164('0x1b')]();};}function respondWithResult(_0x509c8b,_0x408796){_0x408796=_0x408796||0xc8;return function(_0x103b43){if(_0x103b43){return _0x509c8b['status'](_0x408796)[_0xf164('0x1c')](_0x103b43);}};}function respondWithFilteredResult(_0x5a40dc,_0xf8bd4a){return function(_0x1c5d97){if(_0x1c5d97){var _0x32599c=_0x1c5d97[_0xf164('0x1d')],_0x26c2f7=_0xf8bd4a[_0xf164('0x1e')],_0x10d088=_0xf8bd4a[_0xf164('0x1e')]+_0xf8bd4a[_0xf164('0x1f')],_0x15f6cf;if(_0x10d088>=_0x32599c){_0x10d088=_0x32599c;_0x15f6cf=0xc8;}else{_0x15f6cf=0xce;}_0x5a40dc[_0xf164('0x20')](_0x15f6cf);return _0x5a40dc['set'](_0xf164('0x21'),_0x26c2f7+'-'+_0x10d088+'/'+_0x32599c)[_0xf164('0x1c')](_0x1c5d97);}return null;};}function patchUpdates(_0x54b072){return function(_0x4aef04){try{jsonpatch['apply'](_0x4aef04,_0x54b072,!![]);}catch(_0x4079c1){return BPromise[_0xf164('0x22')](_0x4079c1);}return _0x4aef04[_0xf164('0x23')]();};}function saveUpdates(_0x40b114,_0x1027dc){return function(_0x22e979){if(_0x22e979){return _0x22e979['update'](_0x40b114)[_0xf164('0x24')](function(_0x56f828){return _0x56f828;});}return null;};}function removeEntity(_0x4e6814,_0x3a5cc5){return function(_0x1c5326){if(_0x1c5326){return _0x1c5326[_0xf164('0x25')]()[_0xf164('0x24')](function(){_0x4e6814[_0xf164('0x20')](0xcc)[_0xf164('0x1b')]();});}};}function handleEntityNotFound(_0x40591c,_0x5db86f){return function(_0x57e1e7){if(!_0x57e1e7){_0x40591c[_0xf164('0x1a')](0x194);}return _0x57e1e7;};}function handleError(_0xa16125,_0x4e70b4){_0x4e70b4=_0x4e70b4||0x1f4;return function(_0x1390d4){logger['error'](_0x1390d4['stack']);if(_0x1390d4[_0xf164('0x26')]){delete _0x1390d4['name'];}_0xa16125[_0xf164('0x20')](_0x4e70b4)[_0xf164('0x27')](_0x1390d4);};}exports[_0xf164('0x28')]=function(_0x55e1be,_0x1b156f){var _0x17b13a={},_0x68f8e2={},_0x2e3236={'count':0x0,'rows':[]};var _0x44d4c1=_[_0xf164('0x29')](db[_0xf164('0x2a')][_0xf164('0x2b')],function(_0x411180){return{'name':_0x411180[_0xf164('0x2c')],'type':_0x411180[_0xf164('0x2d')][_0xf164('0x2e')]};});_0x68f8e2[_0xf164('0x2f')]=_[_0xf164('0x29')](_0x44d4c1,_0xf164('0x26'));_0x68f8e2['query']=_[_0xf164('0x30')](_0x55e1be['query']);_0x68f8e2[_0xf164('0x31')]=_[_0xf164('0x32')](_0x68f8e2[_0xf164('0x2f')],_0x68f8e2['query']);_0x17b13a[_0xf164('0x33')]=_[_0xf164('0x32')](_0x68f8e2[_0xf164('0x2f')],qs['fields'](_0x55e1be[_0xf164('0x34')][_0xf164('0x35')]));_0x17b13a[_0xf164('0x33')]=_0x17b13a[_0xf164('0x33')][_0xf164('0x36')]?_0x17b13a[_0xf164('0x33')]:_0x68f8e2[_0xf164('0x2f')];if(!_0x55e1be[_0xf164('0x34')][_0xf164('0x37')](_0xf164('0x38'))){_0x17b13a[_0xf164('0x1f')]=qs[_0xf164('0x1f')](_0x55e1be['query'][_0xf164('0x1f')]);_0x17b13a[_0xf164('0x1e')]=qs['offset'](_0x55e1be['query'][_0xf164('0x1e')]);}_0x17b13a['order']=qs[_0xf164('0x39')](_0x55e1be['query'][_0xf164('0x39')]);_0x17b13a[_0xf164('0x3a')]=qs[_0xf164('0x31')](_[_0xf164('0x3b')](_0x55e1be[_0xf164('0x34')],_0x68f8e2[_0xf164('0x31')]),_0x44d4c1);if(_0x55e1be[_0xf164('0x34')][_0xf164('0x3c')]){_0x17b13a[_0xf164('0x3a')]=_[_0xf164('0x3d')](_0x17b13a['where'],{'$or':_['map'](_0x44d4c1,function(_0x2f4699){if(_0x2f4699[_0xf164('0x2d')]!==_0xf164('0x3e')){var _0x27d4a9={};_0x27d4a9[_0x2f4699[_0xf164('0x26')]]={'$like':'%'+_0x55e1be[_0xf164('0x34')][_0xf164('0x3c')]+'%'};return _0x27d4a9;}})});}_0x17b13a=_[_0xf164('0x3d')]({},_0x17b13a,_0x55e1be[_0xf164('0x3f')]);var _0x2e75a1={'where':_0x17b13a[_0xf164('0x3a')]};return db[_0xf164('0x2a')][_0xf164('0x1d')](_0x2e75a1)[_0xf164('0x24')](function(_0x56c76e){_0x2e3236[_0xf164('0x1d')]=_0x56c76e;if(_0x55e1be[_0xf164('0x34')][_0xf164('0x40')]){_0x17b13a['include']=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x17b13a);})['then'](function(_0x54459b){_0x2e3236[_0xf164('0x41')]=_0x54459b;return _0x2e3236;})[_0xf164('0x24')](respondWithFilteredResult(_0x1b156f,_0x17b13a))[_0xf164('0x42')](handleError(_0x1b156f,null));};exports[_0xf164('0x43')]=function(_0x221b03,_0x32caec){var _0x341bea={'raw':!![],'where':{'id':_0x221b03[_0xf164('0x44')]['id']}},_0x21a14e={};_0x21a14e[_0xf164('0x2f')]=_[_0xf164('0x30')](db[_0xf164('0x2a')][_0xf164('0x2b')]);_0x21a14e[_0xf164('0x34')]=_[_0xf164('0x30')](_0x221b03[_0xf164('0x34')]);_0x21a14e['filters']=_[_0xf164('0x32')](_0x21a14e[_0xf164('0x2f')],_0x21a14e[_0xf164('0x34')]);_0x341bea['attributes']=_[_0xf164('0x32')](_0x21a14e[_0xf164('0x2f')],qs[_0xf164('0x35')](_0x221b03[_0xf164('0x34')][_0xf164('0x35')]));_0x341bea[_0xf164('0x33')]=_0x341bea[_0xf164('0x33')][_0xf164('0x36')]?_0x341bea[_0xf164('0x33')]:_0x21a14e[_0xf164('0x2f')];if(_0x221b03[_0xf164('0x34')][_0xf164('0x40')]){_0x341bea[_0xf164('0x45')]=[{'all':!![]}];}_0x341bea=_[_0xf164('0x3d')]({},_0x341bea,_0x221b03[_0xf164('0x3f')]);return db[_0xf164('0x2a')][_0xf164('0x46')](_0x341bea)['then'](handleEntityNotFound(_0x32caec,null))[_0xf164('0x24')](respondWithResult(_0x32caec,null))[_0xf164('0x42')](handleError(_0x32caec,null));};exports[_0xf164('0x47')]=function(_0x357fac,_0x595503){return db[_0xf164('0x2a')][_0xf164('0x47')](_0x357fac['body'],{})[_0xf164('0x24')](respondWithResult(_0x595503,0xc9))['catch'](handleError(_0x595503,null));};exports[_0xf164('0x48')]=function(_0x83dca3,_0x41df25){if(_0x83dca3[_0xf164('0x49')]['id']){delete _0x83dca3[_0xf164('0x49')]['id'];}return db[_0xf164('0x2a')][_0xf164('0x46')]({'where':{'id':_0x83dca3[_0xf164('0x44')]['id']}})[_0xf164('0x24')](handleEntityNotFound(_0x41df25,null))['then'](saveUpdates(_0x83dca3[_0xf164('0x49')],null))[_0xf164('0x24')](respondWithResult(_0x41df25,null))[_0xf164('0x42')](handleError(_0x41df25,null));};exports[_0xf164('0x25')]=function(_0x548899,_0x320cea){return db['WhatsappTransferReport'][_0xf164('0x46')]({'where':{'id':_0x548899[_0xf164('0x44')]['id']}})[_0xf164('0x24')](handleEntityNotFound(_0x320cea,null))['then'](removeEntity(_0x320cea,null))[_0xf164('0x42')](handleError(_0x320cea,null));};exports[_0xf164('0x4a')]=function(_0x2ee52b,_0x140029){return db['WhatsappTransferReport'][_0xf164('0x4a')]()[_0xf164('0x24')](respondWithResult(_0x140029,null))[_0xf164('0x42')](handleError(_0x140029,null));}; \ No newline at end of file +var _0x4627=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','fieldName','key','model','keys','attributes','intersection','fields','length','hasOwnProperty','query','where','filters','pick','filter','merge','VIRTUAL','options','count','include','WhatsappTransferReport','findAll','catch','show','rawAttributes','includeAll','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x383e61,_0x5319ec){var _0x2b1a9c=function(_0x4834b5){while(--_0x4834b5){_0x383e61['push'](_0x383e61['shift']());}};_0x2b1a9c(++_0x5319ec);}(_0x4627,0x7d));var _0x7462=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x4627[_0x51fe5f];return _0x4abce9;};'use strict';var pdf=require(_0x7462('0x0'));var emlformat=require(_0x7462('0x1'));var rimraf=require(_0x7462('0x2'));var zipdir=require(_0x7462('0x3'));var jsonpatch=require(_0x7462('0x4'));var rp=require(_0x7462('0x5'));var moment=require(_0x7462('0x6'));var BPromise=require(_0x7462('0x7'));var Mustache=require(_0x7462('0x8'));var util=require(_0x7462('0x9'));var path=require(_0x7462('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7462('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7462('0xc'));var deskjs=require(_0x7462('0xd'));var toCsv=require(_0x7462('0xe'));var querystring=require(_0x7462('0xf'));var Papa=require('papaparse');var Redis=require(_0x7462('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7462('0x11'));var as=require(_0x7462('0x12'));var hardwareService=require(_0x7462('0x13'));var logger=require(_0x7462('0x14'))(_0x7462('0x15'));var utils=require(_0x7462('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18ea29,_0x462c32){_0x462c32=_0x462c32||0xcc;return function(_0x44052f){if(_0x44052f){return _0x18ea29['sendStatus'](_0x462c32);}return _0x18ea29[_0x7462('0x17')](_0x462c32)[_0x7462('0x18')]();};}function respondWithResult(_0x5ceb95,_0x1d423d){_0x1d423d=_0x1d423d||0xc8;return function(_0x353877){if(_0x353877){return _0x5ceb95['status'](_0x1d423d)[_0x7462('0x19')](_0x353877);}};}function respondWithFilteredResult(_0x533ee0,_0x336293){return function(_0x2e6cf0){if(_0x2e6cf0){var _0x351d43=_0x2e6cf0['count'],_0x422d1a=_0x336293['offset'],_0x4b7a52=_0x336293[_0x7462('0x1a')]+_0x336293[_0x7462('0x1b')],_0x63e4d5;if(_0x4b7a52>=_0x351d43){_0x4b7a52=_0x351d43;_0x63e4d5=0xc8;}else{_0x63e4d5=0xce;}_0x533ee0['status'](_0x63e4d5);return _0x533ee0['set'](_0x7462('0x1c'),_0x422d1a+'-'+_0x4b7a52+'/'+_0x351d43)[_0x7462('0x19')](_0x2e6cf0);}return null;};}function patchUpdates(_0x241c8b){return function(_0x5077f2){try{jsonpatch[_0x7462('0x1d')](_0x5077f2,_0x241c8b,!![]);}catch(_0x138ce2){return BPromise[_0x7462('0x1e')](_0x138ce2);}return _0x5077f2[_0x7462('0x1f')]();};}function saveUpdates(_0x265e7c,_0x264ca2){return function(_0x5aaa24){if(_0x5aaa24){return _0x5aaa24[_0x7462('0x20')](_0x265e7c)['then'](function(_0x42ee7d){return _0x42ee7d;});}return null;};}function removeEntity(_0x6ecf31,_0x58520c){return function(_0x3e4528){if(_0x3e4528){return _0x3e4528[_0x7462('0x21')]()[_0x7462('0x22')](function(){_0x6ecf31['status'](0xcc)[_0x7462('0x18')]();});}};}function handleEntityNotFound(_0x165326,_0x13f810){return function(_0xc3fce4){if(!_0xc3fce4){_0x165326[_0x7462('0x23')](0x194);}return _0xc3fce4;};}function handleError(_0x5b87bc,_0x319ebb){_0x319ebb=_0x319ebb||0x1f4;return function(_0x271ddd){logger[_0x7462('0x24')](_0x271ddd[_0x7462('0x25')]);if(_0x271ddd[_0x7462('0x26')]){delete _0x271ddd[_0x7462('0x26')];}_0x5b87bc['status'](_0x319ebb)[_0x7462('0x27')](_0x271ddd);};}exports['index']=function(_0xeed570,_0x177072){var _0x469843={},_0x4f1b20={},_0x45fd0c={'count':0x0,'rows':[]};var _0x88d0e8=_[_0x7462('0x28')](db['WhatsappTransferReport']['rawAttributes'],function(_0x6e833b){return{'name':_0x6e833b[_0x7462('0x29')],'type':_0x6e833b['type'][_0x7462('0x2a')]};});_0x4f1b20[_0x7462('0x2b')]=_['map'](_0x88d0e8,_0x7462('0x26'));_0x4f1b20['query']=_[_0x7462('0x2c')](_0xeed570['query']);_0x4f1b20['filters']=_['intersection'](_0x4f1b20[_0x7462('0x2b')],_0x4f1b20['query']);_0x469843[_0x7462('0x2d')]=_[_0x7462('0x2e')](_0x4f1b20[_0x7462('0x2b')],qs[_0x7462('0x2f')](_0xeed570['query'][_0x7462('0x2f')]));_0x469843[_0x7462('0x2d')]=_0x469843[_0x7462('0x2d')][_0x7462('0x30')]?_0x469843[_0x7462('0x2d')]:_0x4f1b20[_0x7462('0x2b')];if(!_0xeed570['query'][_0x7462('0x31')]('nolimit')){_0x469843[_0x7462('0x1b')]=qs['limit'](_0xeed570[_0x7462('0x32')]['limit']);_0x469843['offset']=qs['offset'](_0xeed570['query'][_0x7462('0x1a')]);}_0x469843['order']=qs['sort'](_0xeed570[_0x7462('0x32')]['sort']);_0x469843[_0x7462('0x33')]=qs[_0x7462('0x34')](_[_0x7462('0x35')](_0xeed570[_0x7462('0x32')],_0x4f1b20[_0x7462('0x34')]),_0x88d0e8);if(_0xeed570[_0x7462('0x32')][_0x7462('0x36')]){_0x469843[_0x7462('0x33')]=_[_0x7462('0x37')](_0x469843['where'],{'$or':_[_0x7462('0x28')](_0x88d0e8,function(_0x1c05f8){if(_0x1c05f8['type']!==_0x7462('0x38')){var _0x580df4={};_0x580df4[_0x1c05f8[_0x7462('0x26')]]={'$like':'%'+_0xeed570[_0x7462('0x32')][_0x7462('0x36')]+'%'};return _0x580df4;}})});}_0x469843=_[_0x7462('0x37')]({},_0x469843,_0xeed570[_0x7462('0x39')]);var _0x4845f3={'where':_0x469843['where']};return db['WhatsappTransferReport'][_0x7462('0x3a')](_0x4845f3)[_0x7462('0x22')](function(_0xde110e){_0x45fd0c[_0x7462('0x3a')]=_0xde110e;if(_0xeed570['query']['includeAll']){_0x469843[_0x7462('0x3b')]=[{'all':!![]}];}return db[_0x7462('0x3c')][_0x7462('0x3d')](_0x469843);})[_0x7462('0x22')](function(_0x241d50){_0x45fd0c['rows']=_0x241d50;return _0x45fd0c;})[_0x7462('0x22')](respondWithFilteredResult(_0x177072,_0x469843))[_0x7462('0x3e')](handleError(_0x177072,null));};exports[_0x7462('0x3f')]=function(_0x1395b1,_0x3a41d5){var _0x407ece={'raw':!![],'where':{'id':_0x1395b1['params']['id']}},_0x389ee8={};_0x389ee8[_0x7462('0x2b')]=_['keys'](db[_0x7462('0x3c')][_0x7462('0x40')]);_0x389ee8['query']=_[_0x7462('0x2c')](_0x1395b1[_0x7462('0x32')]);_0x389ee8[_0x7462('0x34')]=_[_0x7462('0x2e')](_0x389ee8[_0x7462('0x2b')],_0x389ee8[_0x7462('0x32')]);_0x407ece['attributes']=_[_0x7462('0x2e')](_0x389ee8['model'],qs[_0x7462('0x2f')](_0x1395b1['query'][_0x7462('0x2f')]));_0x407ece[_0x7462('0x2d')]=_0x407ece[_0x7462('0x2d')]['length']?_0x407ece[_0x7462('0x2d')]:_0x389ee8[_0x7462('0x2b')];if(_0x1395b1[_0x7462('0x32')][_0x7462('0x41')]){_0x407ece['include']=[{'all':!![]}];}_0x407ece=_[_0x7462('0x37')]({},_0x407ece,_0x1395b1['options']);return db['WhatsappTransferReport'][_0x7462('0x42')](_0x407ece)['then'](handleEntityNotFound(_0x3a41d5,null))['then'](respondWithResult(_0x3a41d5,null))['catch'](handleError(_0x3a41d5,null));};exports[_0x7462('0x43')]=function(_0x5d8e20,_0x383785){return db['WhatsappTransferReport'][_0x7462('0x43')](_0x5d8e20[_0x7462('0x44')],{})[_0x7462('0x22')](respondWithResult(_0x383785,0xc9))[_0x7462('0x3e')](handleError(_0x383785,null));};exports[_0x7462('0x20')]=function(_0x1cdfba,_0x1da450){if(_0x1cdfba['body']['id']){delete _0x1cdfba[_0x7462('0x44')]['id'];}return db[_0x7462('0x3c')][_0x7462('0x42')]({'where':{'id':_0x1cdfba['params']['id']}})['then'](handleEntityNotFound(_0x1da450,null))[_0x7462('0x22')](saveUpdates(_0x1cdfba[_0x7462('0x44')],null))[_0x7462('0x22')](respondWithResult(_0x1da450,null))[_0x7462('0x3e')](handleError(_0x1da450,null));};exports[_0x7462('0x21')]=function(_0x3bc99f,_0xdb7c9f){return db[_0x7462('0x3c')][_0x7462('0x42')]({'where':{'id':_0x3bc99f[_0x7462('0x45')]['id']}})[_0x7462('0x22')](handleEntityNotFound(_0xdb7c9f,null))[_0x7462('0x22')](removeEntity(_0xdb7c9f,null))[_0x7462('0x3e')](handleError(_0xdb7c9f,null));};exports[_0x7462('0x46')]=function(_0x3be028,_0x323bce){return db[_0x7462('0x3c')][_0x7462('0x46')]()[_0x7462('0x22')](respondWithResult(_0x323bce,null))[_0x7462('0x3e')](handleError(_0x323bce,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 7fa88cd..29228ea 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 _0xe686=['../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2bc93d,_0xf134ac){var _0x3a0afc=function(_0x5f210b){while(--_0x5f210b){_0x2bc93d['push'](_0x2bc93d['shift']());}};_0x3a0afc(++_0xf134ac);}(_0xe686,0x19e));var _0x6e68=function(_0x9f890f,_0x121cd8){_0x9f890f=_0x9f890f-0x0;var _0x397e1d=_0xe686[_0x9f890f];return _0x397e1d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6e68('0x0'))('api');var moment=require(_0x6e68('0x1'));var BPromise=require(_0x6e68('0x2'));var rp=require(_0x6e68('0x3'));var fs=require('fs');var path=require(_0x6e68('0x4'));var rimraf=require(_0x6e68('0x5'));var config=require(_0x6e68('0x6'));var attributes=require(_0x6e68('0x7'));module[_0x6e68('0x8')]=function(_0x1e21be,_0x3a0e11){return _0x1e21be[_0x6e68('0x9')]('WhatsappTransferReport',attributes,{'tableName':_0x6e68('0xa'),'paranoid':![],'indexes':[{'name':_0x6e68('0xb'),'fields':[_0x6e68('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x98ae=['../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4fa489,_0x4cba6b){var _0x41d2ce=function(_0x364060){while(--_0x364060){_0x4fa489['push'](_0x4fa489['shift']());}};_0x41d2ce(++_0x4cba6b);}(_0x98ae,0x75));var _0xe98a=function(_0x38895d,_0xfb2fae){_0x38895d=_0x38895d-0x0;var _0x1b8911=_0x98ae[_0x38895d];return _0x1b8911;};'use strict';var _=require(_0xe98a('0x0'));var util=require(_0xe98a('0x1'));var logger=require(_0xe98a('0x2'))(_0xe98a('0x3'));var moment=require(_0xe98a('0x4'));var BPromise=require(_0xe98a('0x5'));var rp=require(_0xe98a('0x6'));var fs=require('fs');var path=require(_0xe98a('0x7'));var rimraf=require(_0xe98a('0x8'));var config=require(_0xe98a('0x9'));var attributes=require(_0xe98a('0xa'));module['exports']=function(_0x3be752,_0x2422cf){return _0x3be752['define'](_0xe98a('0xb'),attributes,{'tableName':_0xe98a('0xc'),'paranoid':![],'indexes':[{'name':_0xe98a('0xd'),'fields':[_0xe98a('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 c4bf873..8b1438d 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(_0x5904f7,_0x2009ef){var _0xa11573=function(_0x12a271){while(--_0x12a271){_0x5904f7['push'](_0x5904f7['shift']());}};_0xa11573(++_0x2009ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x4f4c9e,_0x72aebd){var _0x1324ac=function(_0x191346){while(--_0x191346){_0x4f4c9e['push'](_0x4f4c9e['shift']());}};_0x1324ac(++_0x72aebd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 977dd87..504d4a2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x08dd=['./config/seedDB','default','error','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sync','listen','info','then','start','map','filter','online','name','join','status','None','seedDB'];(function(_0x26a123,_0x3595d3){var _0x5d0d0a=function(_0x5463c5){while(--_0x5463c5){_0x26a123['push'](_0x26a123['shift']());}};_0x5d0d0a(++_0x3595d3);}(_0x08dd,0x80));var _0xd08d=function(_0x5c1356,_0x5a3c77){_0x5c1356=_0x5c1356-0x0;var _0x1fb00e=_0x08dd[_0x5c1356];return _0x1fb00e;};'use strict';var _=require(_0xd08d('0x0'));var mysqldb=require(_0xd08d('0x1'));var rpc=require(_0xd08d('0x2'));var config=require('./config/environment');var logger=require(_0xd08d('0x3'))('app');var pm2=require(_0xd08d('0x4'));var pm2Config=require(_0xd08d('0x5'));var schedule=require(_0xd08d('0x6'));var chat=require(_0xd08d('0x7'));var transcribe=require(_0xd08d('0x8'));function main(){return mysqldb['db']['sequelize'][_0xd08d('0x9')]()['then'](function(){return rpc[_0xd08d('0xa')]();})['then'](function(_0x58bb1c){logger[_0xd08d('0xb')](_0x58bb1c);return chat['start']();})[_0xd08d('0xc')](function(){return schedule[_0xd08d('0xd')]();})['then'](function(){return transcribe['start']();})[_0xd08d('0xc')](function(_0x2d5df4){logger[_0xd08d('0xb')](_0x2d5df4);return pm2[_0xd08d('0xd')](pm2Config);})[_0xd08d('0xc')](function(_0x118067){logger[_0xd08d('0xb')]('Online\x20apps:',_[_0xd08d('0xe')](_[_0xd08d('0xf')](_0x118067,{'status':_0xd08d('0x10')}),_0xd08d('0x11'))[_0xd08d('0x12')]());logger['info']('Offline\x20apps:',_[_0xd08d('0xe')](_[_0xd08d('0xf')](_0x118067,function(_0x553708){return _0x553708[_0xd08d('0x13')]!==_0xd08d('0x10');}),'name')[_0xd08d('0x12')]()||_0xd08d('0x14'));config[_0xd08d('0x15')]&&require(_0xd08d('0x16'))[_0xd08d('0x17')]();require('./config/license')[_0xd08d('0x17')]();})['catch'](function(_0x29a0ea){logger[_0xd08d('0x18')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x29a0ea);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x9da2=['./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','sequelize','sync','then','start','info','filter','online','name','join','map','status','None','./config/seedDB','default','./config/license','error','exit','lodash'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x9da2,0xd7));var _0x29da=function(_0x53174f,_0x986a3b){_0x53174f=_0x53174f-0x0;var _0x1cbd1c=_0x9da2[_0x53174f];return _0x1cbd1c;};'use strict';var _=require(_0x29da('0x0'));var mysqldb=require(_0x29da('0x1'));var rpc=require(_0x29da('0x2'));var config=require(_0x29da('0x3'));var logger=require(_0x29da('0x4'))(_0x29da('0x5'));var pm2=require(_0x29da('0x6'));var pm2Config=require(_0x29da('0x7'));var schedule=require(_0x29da('0x8'));var chat=require('./config/schedule/chat');var transcribe=require(_0x29da('0x9'));function main(){return mysqldb['db'][_0x29da('0xa')][_0x29da('0xb')]()[_0x29da('0xc')](function(){return rpc['listen']();})[_0x29da('0xc')](function(_0x4a4825){logger['info'](_0x4a4825);return chat[_0x29da('0xd')]();})['then'](function(){return schedule[_0x29da('0xd')]();})[_0x29da('0xc')](function(){return transcribe[_0x29da('0xd')]();})[_0x29da('0xc')](function(_0x2c4c47){logger[_0x29da('0xe')](_0x2c4c47);return pm2[_0x29da('0xd')](pm2Config);})[_0x29da('0xc')](function(_0x46546c){logger[_0x29da('0xe')]('Online\x20apps:',_['map'](_[_0x29da('0xf')](_0x46546c,{'status':_0x29da('0x10')}),_0x29da('0x11'))[_0x29da('0x12')]());logger['info']('Offline\x20apps:',_[_0x29da('0x13')](_[_0x29da('0xf')](_0x46546c,function(_0x58b393){return _0x58b393[_0x29da('0x14')]!==_0x29da('0x10');}),_0x29da('0x11'))[_0x29da('0x12')]()||_0x29da('0x15'));config['seedDB']&&require(_0x29da('0x16'))[_0x29da('0x17')]();require(_0x29da('0x18'))[_0x29da('0x17')]();})['catch'](function(_0x149931){logger[_0x29da('0x19')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x149931);process[_0x29da('0x1a')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c3057da..1c15564 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 _0x90f8=['faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','isChatInteractionAuthorized','isAuthenticated','use','findOne','params','closed','disposition','status','json','unmanaged','Forbidden.','catch','authorization','startsWith','headers','Basic','User','pass','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','then','sub','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','find','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','apiKeyNonce','regenerateApiKey','promisify','secret','session','payload','options','randomBytes','toString','hex','floor','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','secrets','role','name','internal','email','permissions','voicePause'];(function(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0x90f8,0x168));var _0x890f=function(_0x473cbb,_0x42203a){_0x473cbb=_0x473cbb-0x0;var _0x4b5d5e=_0x90f8[_0x473cbb];return _0x4b5d5e;};'use strict';var db=require(_0x890f('0x0'))['db'];var config=require(_0x890f('0x1'));var hardwareConf=require(_0x890f('0x2'));var _=require(_0x890f('0x3'));var jwt=require(_0x890f('0x4'));var expressJwt=require(_0x890f('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x890f('0x6'));var crypto=require(_0x890f('0x7'));var BPromise=require(_0x890f('0x8'));var validateJwt=expressJwt({'secret':config[_0x890f('0x9')]['session']});var userAttributes=['id',_0x890f('0xa'),'fullname',_0x890f('0xb'),_0x890f('0xc'),_0x890f('0xd'),'userpic',_0x890f('0xe'),'md5secret',_0x890f('0xf'),'chatPause','mailPause',_0x890f('0x10'),_0x890f('0x11'),_0x890f('0x12'),_0x890f('0x13'),_0x890f('0x14'),_0x890f('0x15'),_0x890f('0x16'),_0x890f('0x17'),_0x890f('0x18'),_0x890f('0x19'),'alias',_0x890f('0x1a'),'phoneBarAutoAnswerDelay',_0x890f('0x1b'),_0x890f('0x1c'),_0x890f('0x1d'),_0x890f('0x1e'),_0x890f('0x1f'),_0x890f('0x20'),_0x890f('0x21'),_0x890f('0x22'),_0x890f('0x23'),'interface','userProfileId'];exports[_0x890f('0x24')]=function(){return this[_0x890f('0x25')](!![])[_0x890f('0x26')](function(_0x2eb5e2,_0x3747fa,_0x434d30){if(_0x2eb5e2['user']){_0x434d30();}else{return db['ChatInteraction'][_0x890f('0x27')]({'where':{'id':_0x2eb5e2[_0x890f('0x28')]['id']},'attributes':['id',_0x890f('0x29'),_0x890f('0x2a')],'raw':!![]})['then'](function(_0x59784f){if(_0x59784f&&_0x59784f[_0x890f('0x29')]){return _0x3747fa[_0x890f('0x2b')](_0x59784f[_0x890f('0x2a')]==='unmanaged'?0x195:0x193)[_0x890f('0x2c')]({'message':_0x59784f[_0x890f('0x2a')]===_0x890f('0x2d')?'Unmanaged.':_0x890f('0x2e')});}else{_0x434d30();}})[_0x890f('0x2f')](function(_0xf74ae2){_0x434d30(_0xf74ae2);});}});};exports[_0x890f('0x25')]=function isAuthenticated(_0x4545c0){return compose()[_0x890f('0x26')](function(_0x42efdd,_0x321c23,_0x5ad852){if(_0x42efdd['headers'][_0x890f('0x30')]){if(_[_0x890f('0x31')](_0x42efdd[_0x890f('0x32')][_0x890f('0x30')],_0x890f('0x33'))){var _0x36d8cf=basicAuth(_0x42efdd);db[_0x890f('0x34')]['find']({'where':{'name':_0x36d8cf[_0x890f('0xb')]}})['then'](function(_0x4829f0){if(!_0x4829f0||!_0x4829f0['authenticate'](_0x36d8cf[_0x890f('0x35')])){return _0x321c23[_0x890f('0x2b')](0x191)[_0x890f('0x2c')]({'message':_0x890f('0x36')});}_0x42efdd[_0x890f('0x37')]={'id':_0x4829f0['id']};_0x5ad852();})[_0x890f('0x2f')](function(_0x417b0a){_0x5ad852(_0x417b0a);});}else if(_[_0x890f('0x31')](_0x42efdd[_0x890f('0x32')][_0x890f('0x30')],_0x890f('0x38'))){validateJwt(_0x42efdd,_0x321c23,_0x5ad852);}else{if(_0x4545c0){_0x5ad852();}else{return _0x321c23['status'](0x193)[_0x890f('0x2c')]({'message':_0x890f('0x39')});}}}else if(_0x42efdd[_0x890f('0x3a')][_0x890f('0x3b')]){try{var _0x514df0={'audience':hardwareConf[_0x890f('0x3c')](),'issuer':hardwareConf[_0x890f('0x3c')]()};verifyJwt(_0x42efdd[_0x890f('0x3a')][_0x890f('0x3b')],_0x514df0)[_0x890f('0x3d')](function(_0x58c4aa){return db[_0x890f('0x34')]['find']({'where':{'id':_0x58c4aa[_0x890f('0x3e')]}})[_0x890f('0x3d')](function(_0x4e80d6){if(!_0x4e80d6||!_[_0x890f('0x3f')](_0x4e80d6['apiKeyNonce'],_0x58c4aa[_0x890f('0x40')])){return _0x321c23[_0x890f('0x2b')](0x191)[_0x890f('0x2c')]({'message':_0x890f('0x41')});}_0x42efdd['user']={'id':_0x4e80d6['id']};_0x5ad852();});})[_0x890f('0x2f')](function(){return _0x321c23[_0x890f('0x2b')](0x191)[_0x890f('0x2c')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x49f146){_0x5ad852(_0x49f146);}}else if(_0x4545c0){_0x5ad852();}else{return _0x321c23[_0x890f('0x2b')](0x193)[_0x890f('0x2c')]({'message':_0x890f('0x39')});}})[_0x890f('0x26')](function(_0x144694,_0x3a6f14,_0x5031b4){if(_0x144694['user']){db[_0x890f('0x34')][_0x890f('0x42')]({'where':{'id':_0x144694[_0x890f('0x37')]['id']},'attributes':userAttributes})[_0x890f('0x3d')](function(_0x56b71c){if(!_0x56b71c){return _0x3a6f14['status'](0x194)['json']({'message':_0x890f('0x43')});}_0x144694[_0x890f('0x37')]=_0x56b71c;_0x5031b4();})[_0x890f('0x2f')](function(_0x774f22){_0x5031b4(_0x774f22);});}else if(_0x4545c0){_0x5031b4();}else{return _0x3a6f14[_0x890f('0x2b')](0x194)[_0x890f('0x2c')]({'message':_0x890f('0x44')});}});};exports[_0x890f('0x45')]=function canUpdate(){return compose()[_0x890f('0x26')](function(_0x280b04,_0x80ab64,_0x4f9ee0){return require(_0x890f('0x46'))[_0x890f('0x47')]()[_0x890f('0x3d')](function(_0x52e00f){if(_0x52e00f[_0x890f('0x48')]){_0x4f9ee0();}else{return _0x80ab64[_0x890f('0x2b')](0x193)[_0x890f('0x2c')]({'message':_0x890f('0x49')});}})['catch'](function(_0x1b60e2){_0x4f9ee0(_0x1b60e2);});});};exports[_0x890f('0x4a')]=function(_0x4ff991,_0x360bf6,_0x1263d7){_0x4ff991[_0x890f('0x4a')]=!![];return _0x1263d7();};exports[_0x890f('0x4b')]=function signToken(_0x589d9f){return signJwt(_0x589d9f);};exports['setTokenCookie']=function(_0x42378c,_0x3d1379){if(!_0x42378c[_0x890f('0x37')]){return _0x3d1379[_0x890f('0x2b')](0x194)[_0x890f('0x2c')]({'message':_0x890f('0x4c')});}var _0x4ffc53={'payload':{'id':_0x42378c[_0x890f('0x37')]['id'],'role':_0x42378c[_0x890f('0x37')][_0x890f('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4ffc53)['then'](function(_0x5ab5bd){_0x3d1379['cookie'](_0x890f('0x4d'),_0x5ab5bd);_0x3d1379['redirect']('/dashboards/general');})[_0x890f('0x2f')](function(_0x4cf797){return _0x3d1379['status'](0x1f4)[_0x890f('0x4e')](_0x4cf797);});};exports[_0x890f('0x4f')]=function(_0x43fb32){if(_[_0x890f('0x50')](_0x43fb32['apiKeyNonce'])||_[_0x890f('0x50')](_0x43fb32[_0x890f('0x51')])){return null;}else{return createJwt(_0x43fb32);}};exports[_0x890f('0x52')]=function(_0x504404){_0x504404[_0x890f('0x53')]=generateNonce();_0x504404[_0x890f('0x51')]=generateIssuedAt();return createJwt(_0x504404);};exports[_0x890f('0x54')]=function(_0x1e4c78,_0x592af8){var _0x48b3cc=_0x1e4c78[_0x890f('0x3a')][_0x890f('0x3b')];if(_0x48b3cc){var _0x437b22={'nonce':_0x592af8['apiKeyNonce'],'iat':_0x592af8['apiKeyIat'],'audience':hardwareConf[_0x890f('0x3c')](),'issuer':hardwareConf[_0x890f('0x3c')]()};return verifyJwt(_0x48b3cc,_0x437b22)[_0x890f('0x3d')](function(){return generateApiKey(_0x592af8);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0xd5fd1f){var _0x21c627=BPromise[_0x890f('0x55')](jwt['sign'],{'context':jwt});var _0xfce507=_0xd5fd1f[_0x890f('0x56')]||config[_0x890f('0x9')][_0x890f('0x57')];return new BPromise(function(_0x35f7c4,_0x55fe48){_0x21c627(_0xd5fd1f[_0x890f('0x58')],_0xfce507,_0xd5fd1f[_0x890f('0x59')])[_0x890f('0x3d')](function(_0x204b88){_0x35f7c4(_0x204b88);})[_0x890f('0x2f')](function(_0x2ba0d6){_0x55fe48(_0x2ba0d6);});});}function verifyJwt(_0x34e8fd,_0x2bb6c4,_0x3fbe21){var _0x23d7f4=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x11e908=_0x3fbe21||config['secrets'][_0x890f('0x57')];return new BPromise(function(_0x21cd6a,_0x1b5fdf){_0x23d7f4(_0x34e8fd,_0x11e908,_0x2bb6c4)[_0x890f('0x3d')](function(_0x246dbe){_0x21cd6a(_0x246dbe);})[_0x890f('0x2f')](function(_0x12d0d5){_0x1b5fdf(_0x12d0d5);});});}function generateNonce(){return crypto[_0x890f('0x5a')](0x10)[_0x890f('0x5b')](_0x890f('0x5c'));}function generateIssuedAt(){return Math[_0x890f('0x5d')](Date['now']()/0x3e8)[_0x890f('0x5b')]();}function createJwt(_0x4cbde5){var _0x3ed6f7={'payload':{'iat':_0x4cbde5[_0x890f('0x51')],'nonce':_0x4cbde5[_0x890f('0x53')]},'options':{'algorithm':'HS512','subject':_0x4cbde5['id'][_0x890f('0x5b')](),'issuer':hardwareConf[_0x890f('0x3c')](),'audience':hardwareConf[_0x890f('0x3c')]()}};return signJwt(_0x3ed6f7)[_0x890f('0x3d')](function(_0x5ba9b0){return{'iat':_0x4cbde5[_0x890f('0x51')],'nonce':_0x4cbde5['apiKeyNonce'],'token':_0x5ba9b0};});} \ No newline at end of file +var _0x225e=['isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','payload','verify','randomBytes','toString','now','HS512','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','secrets','session','role','fullname','name','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','params','closed','disposition','then','status','json','Forbidden.','catch','headers','startsWith','authorization','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','apikey','getUuid','query','sub','isEqual','apiKeyNonce','nonce','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','Forbidden'];(function(_0x46a394,_0x2026fb){var _0x51e7e5=function(_0x1a99eb){while(--_0x1a99eb){_0x46a394['push'](_0x46a394['shift']());}};_0x51e7e5(++_0x2026fb);}(_0x225e,0x19a));var _0xe225=function(_0x1aa38d,_0x14f873){_0x1aa38d=_0x1aa38d-0x0;var _0x43808e=_0x225e[_0x1aa38d];return _0x43808e;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require(_0xe225('0x0'));var _=require(_0xe225('0x1'));var jwt=require(_0xe225('0x2'));var expressJwt=require(_0xe225('0x3'));var compose=require(_0xe225('0x4'));var basicAuth=require('basic-auth');var crypto=require(_0xe225('0x5'));var BPromise=require(_0xe225('0x6'));var validateJwt=expressJwt({'secret':config[_0xe225('0x7')][_0xe225('0x8')]});var userAttributes=['id',_0xe225('0x9'),_0xe225('0xa'),_0xe225('0xb'),_0xe225('0xc'),_0xe225('0xd'),'userpic','permissions',_0xe225('0xe'),_0xe225('0xf'),_0xe225('0x10'),_0xe225('0x11'),_0xe225('0x12'),_0xe225('0x13'),_0xe225('0x14'),'pauseType','showWebBar',_0xe225('0x15'),_0xe225('0x16'),_0xe225('0x17'),_0xe225('0x18'),_0xe225('0x19'),_0xe225('0x1a'),_0xe225('0x1b'),'phoneBarAutoAnswerDelay',_0xe225('0x1c'),_0xe225('0x1d'),_0xe225('0x1e'),_0xe225('0x1f'),_0xe225('0x20'),_0xe225('0x21'),_0xe225('0x22'),_0xe225('0x23'),_0xe225('0x24'),_0xe225('0x25'),'userProfileId'];exports[_0xe225('0x26')]=function(){return this[_0xe225('0x27')](!![])[_0xe225('0x28')](function(_0x238ef2,_0x3eb89e,_0x2000fd){if(_0x238ef2[_0xe225('0x29')]){_0x2000fd();}else{return db[_0xe225('0x2a')]['findOne']({'where':{'id':_0x238ef2[_0xe225('0x2b')]['id']},'attributes':['id',_0xe225('0x2c'),_0xe225('0x2d')],'raw':!![]})[_0xe225('0x2e')](function(_0x5e3916){if(_0x5e3916&&_0x5e3916[_0xe225('0x2c')]){return _0x3eb89e[_0xe225('0x2f')](_0x5e3916[_0xe225('0x2d')]==='unmanaged'?0x195:0x193)[_0xe225('0x30')]({'message':_0x5e3916[_0xe225('0x2d')]==='unmanaged'?'Unmanaged.':_0xe225('0x31')});}else{_0x2000fd();}})[_0xe225('0x32')](function(_0x3a8717){_0x2000fd(_0x3a8717);});}});};exports['isAuthenticated']=function isAuthenticated(_0x26815e){return compose()[_0xe225('0x28')](function(_0x42e385,_0x4e9d05,_0x45d8a9){if(_0x42e385[_0xe225('0x33')]['authorization']){if(_[_0xe225('0x34')](_0x42e385['headers'][_0xe225('0x35')],'Basic')){var _0x4f781f=basicAuth(_0x42e385);db[_0xe225('0x36')][_0xe225('0x37')]({'where':{'name':_0x4f781f['name']}})['then'](function(_0x32a77c){if(!_0x32a77c||!_0x32a77c[_0xe225('0x38')](_0x4f781f[_0xe225('0x39')])){return _0x4e9d05['status'](0x191)[_0xe225('0x30')]({'message':_0xe225('0x3a')});}_0x42e385[_0xe225('0x29')]={'id':_0x32a77c['id']};_0x45d8a9();})['catch'](function(_0x5f28f0){_0x45d8a9(_0x5f28f0);});}else if(_[_0xe225('0x34')](_0x42e385['headers'][_0xe225('0x35')],_0xe225('0x3b'))){validateJwt(_0x42e385,_0x4e9d05,_0x45d8a9);}else{if(_0x26815e){_0x45d8a9();}else{return _0x4e9d05['status'](0x193)[_0xe225('0x30')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x42e385['query'][_0xe225('0x3c')]){try{var _0x37be53={'audience':hardwareConf[_0xe225('0x3d')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x42e385[_0xe225('0x3e')]['apikey'],_0x37be53)['then'](function(_0x1bbcc7){return db[_0xe225('0x36')][_0xe225('0x37')]({'where':{'id':_0x1bbcc7[_0xe225('0x3f')]}})[_0xe225('0x2e')](function(_0x116002){if(!_0x116002||!_[_0xe225('0x40')](_0x116002[_0xe225('0x41')],_0x1bbcc7[_0xe225('0x42')])){return _0x4e9d05['status'](0x191)[_0xe225('0x30')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x42e385['user']={'id':_0x116002['id']};_0x45d8a9();});})[_0xe225('0x32')](function(){return _0x4e9d05['status'](0x191)[_0xe225('0x30')]({'message':_0xe225('0x43')});});}catch(_0x41fbf9){_0x45d8a9(_0x41fbf9);}}else if(_0x26815e){_0x45d8a9();}else{return _0x4e9d05[_0xe225('0x2f')](0x193)[_0xe225('0x30')]({'message':_0xe225('0x44')});}})[_0xe225('0x28')](function(_0x47e75a,_0x4ad630,_0x2f2452){if(_0x47e75a[_0xe225('0x29')]){db['User'][_0xe225('0x37')]({'where':{'id':_0x47e75a[_0xe225('0x29')]['id']},'attributes':userAttributes})['then'](function(_0x265f95){if(!_0x265f95){return _0x4ad630[_0xe225('0x2f')](0x194)[_0xe225('0x30')]({'message':_0xe225('0x45')});}_0x47e75a['user']=_0x265f95;_0x2f2452();})[_0xe225('0x32')](function(_0x167fe2){_0x2f2452(_0x167fe2);});}else if(_0x26815e){_0x2f2452();}else{return _0x4ad630[_0xe225('0x2f')](0x194)[_0xe225('0x30')]({'message':_0xe225('0x46')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x4360a6,_0x261426,_0x4b251f){return require(_0xe225('0x47'))[_0xe225('0x48')]()[_0xe225('0x2e')](function(_0x742307){if(_0x742307[_0xe225('0x49')]){_0x4b251f();}else{return _0x261426[_0xe225('0x2f')](0x193)[_0xe225('0x30')]({'message':_0xe225('0x4a')});}})[_0xe225('0x32')](function(_0x287413){_0x4b251f(_0x287413);});});};exports['isMiddleware']=function(_0x4e69e9,_0x1e59d9,_0x4a4864){_0x4e69e9[_0xe225('0x4b')]=!![];return _0x4a4864();};exports[_0xe225('0x4c')]=function signToken(_0x121a8a){return signJwt(_0x121a8a);};exports['setTokenCookie']=function(_0x2aef4d,_0x2646e5){if(!_0x2aef4d['user']){return _0x2646e5[_0xe225('0x2f')](0x194)['json']({'message':_0xe225('0x4d')});}var _0x3a7b80={'payload':{'id':_0x2aef4d['user']['id'],'role':_0x2aef4d['user'][_0xe225('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3a7b80)[_0xe225('0x2e')](function(_0x9d719f){_0x2646e5[_0xe225('0x4e')](_0xe225('0x4f'),_0x9d719f);_0x2646e5[_0xe225('0x50')](_0xe225('0x51'));})['catch'](function(_0x1aadbd){return _0x2646e5['status'](0x1f4)[_0xe225('0x52')](_0x1aadbd);});};exports[_0xe225('0x53')]=function(_0x1753f4){if(_[_0xe225('0x54')](_0x1753f4[_0xe225('0x41')])||_['isNil'](_0x1753f4['apiKeyIat'])){return null;}else{return createJwt(_0x1753f4);}};exports[_0xe225('0x55')]=function(_0x3c58c1){_0x3c58c1[_0xe225('0x41')]=generateNonce();_0x3c58c1[_0xe225('0x56')]=generateIssuedAt();return createJwt(_0x3c58c1);};exports[_0xe225('0x57')]=function(_0x53c19d,_0x4b704c){var _0x947e76=_0x53c19d['query'][_0xe225('0x3c')];if(_0x947e76){var _0xbf644d={'nonce':_0x4b704c[_0xe225('0x41')],'iat':_0x4b704c[_0xe225('0x56')],'audience':hardwareConf[_0xe225('0x3d')](),'issuer':hardwareConf[_0xe225('0x3d')]()};return verifyJwt(_0x947e76,_0xbf644d)[_0xe225('0x2e')](function(){return generateApiKey(_0x4b704c);});}else{throw{'message':_0xe225('0x58')};}};function signJwt(_0x4738b3){var _0x2ec369=BPromise[_0xe225('0x59')](jwt['sign'],{'context':jwt});var _0x2309cd=_0x4738b3[_0xe225('0x5a')]||config[_0xe225('0x7')][_0xe225('0x8')];return new BPromise(function(_0x2d4320,_0x5759c5){_0x2ec369(_0x4738b3[_0xe225('0x5b')],_0x2309cd,_0x4738b3['options'])[_0xe225('0x2e')](function(_0x4169f1){_0x2d4320(_0x4169f1);})[_0xe225('0x32')](function(_0x4cd25a){_0x5759c5(_0x4cd25a);});});}function verifyJwt(_0x30e349,_0x4e513d,_0x213fc){var _0x45ca8b=BPromise[_0xe225('0x59')](jwt[_0xe225('0x5c')],{'context':jwt});var _0x54c60a=_0x213fc||config[_0xe225('0x7')][_0xe225('0x8')];return new BPromise(function(_0x569879,_0x31f7d0){_0x45ca8b(_0x30e349,_0x54c60a,_0x4e513d)[_0xe225('0x2e')](function(_0x5d3fa2){_0x569879(_0x5d3fa2);})[_0xe225('0x32')](function(_0x456f1b){_0x31f7d0(_0x456f1b);});});}function generateNonce(){return crypto[_0xe225('0x5d')](0x10)[_0xe225('0x5e')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xe225('0x5f')]()/0x3e8)['toString']();}function createJwt(_0x17e289){var _0x181c3a={'payload':{'iat':_0x17e289[_0xe225('0x56')],'nonce':_0x17e289[_0xe225('0x41')]},'options':{'algorithm':_0xe225('0x60'),'subject':_0x17e289['id'][_0xe225('0x5e')](),'issuer':hardwareConf[_0xe225('0x3d')](),'audience':hardwareConf[_0xe225('0x3d')]()}};return signJwt(_0x181c3a)['then'](function(_0x11db11){return{'iat':_0x17e289[_0xe225('0x56')],'nonce':_0x17e289[_0xe225('0x41')],'token':_0x11db11};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 327d7fc..c648c1c 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(_0x49cc18,_0x5260f1){var _0x594f28=function(_0x4eff2f){while(--_0x4eff2f){_0x49cc18['push'](_0x49cc18['shift']());}};_0x594f28(++_0x5260f1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0xcb91[_0x45bf86];return _0x1f02b7;};'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 _0xe706=['unlink','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','update','end','final','binary','write','close','createDecipher'];(function(_0x1f4674,_0x146085){var _0x3e7f42=function(_0x4bd366){while(--_0x4bd366){_0x1f4674['push'](_0x1f4674['shift']());}};_0x3e7f42(++_0x146085);}(_0xe706,0xa3));var _0x6e70=function(_0x4c99d0,_0x1febe1){_0x4c99d0=_0x4c99d0-0x0;var _0x5e541f=_0xe706[_0x4c99d0];return _0x5e541f;};'use strict';var crypto=require(_0x6e70('0x0'));var fs=require('fs');var BPromise=require(_0x6e70('0x1'));var defaultOptions={'algorithm':_0x6e70('0x2')};function combineOptions(_0x5e8446){var _0x2cae77={};for(var _0x315629 in defaultOptions){if(defaultOptions[_0x6e70('0x3')](_0x315629)){_0x2cae77[_0x315629]=defaultOptions[_0x315629];}}if(_0x5e8446){for(var _0x7dfbc3 in _0x5e8446){if(_0x5e8446[_0x6e70('0x3')](_0x7dfbc3)){_0x2cae77[_0x7dfbc3]=_0x5e8446[_0x7dfbc3];}}}return _0x2cae77;}exports[_0x6e70('0x4')]=function(_0x376a8d,_0x506db9,_0x1b0389,_0x4381d1){return new BPromise(function(_0x36357b,_0x293ce7){_0x4381d1=combineOptions(_0x4381d1);var _0x45a2d4=new Buffer(_0x1b0389);var _0x188ed3=fs[_0x6e70('0x5')](_0x376a8d);var _0x449b48=fs[_0x6e70('0x6')](_0x506db9);var _0x25e61c=crypto[_0x6e70('0x7')](_0x4381d1[_0x6e70('0x8')],_0x45a2d4);_0x188ed3['on'](_0x6e70('0x9'),function(_0x3f474a){var _0x37b3e0=new Buffer(_0x25e61c[_0x6e70('0xa')](_0x3f474a),'binary');_0x449b48['write'](_0x37b3e0);});_0x188ed3['on'](_0x6e70('0xb'),function(){try{var _0x15a1a5=new Buffer(_0x25e61c[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x449b48[_0x6e70('0xe')](_0x15a1a5);_0x449b48[_0x6e70('0xb')]();_0x449b48['on'](_0x6e70('0xf'),function(){return _0x36357b(_0x506db9);});}catch(_0x5dfbaa){fs['unlink'](_0x506db9);return _0x293ce7(_0x5dfbaa);}});});};exports['decryptFile']=function(_0x257e81,_0x5a37a6,_0x53aed0,_0x304716){return new BPromise(function(_0x22c50c,_0x5d9263){_0x304716=combineOptions(_0x304716);var _0x24f3ac=new Buffer(_0x53aed0);var _0x5c3fe7=fs[_0x6e70('0x5')](_0x257e81);var _0x161f23=fs['createWriteStream'](_0x5a37a6);var _0x49029f=crypto[_0x6e70('0x10')](_0x304716['algorithm'],_0x24f3ac);_0x5c3fe7['on'](_0x6e70('0x9'),function(_0x173afe){var _0x53acdc=new Buffer(_0x49029f['update'](_0x173afe),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x53acdc);});_0x5c3fe7['on'](_0x6e70('0xb'),function(){try{var _0x3a9978=new Buffer(_0x49029f[_0x6e70('0xc')](_0x6e70('0xd')),_0x6e70('0xd'));_0x161f23[_0x6e70('0xe')](_0x3a9978);_0x161f23[_0x6e70('0xb')]();_0x161f23['on'](_0x6e70('0xf'),function(){return _0x22c50c(_0x5a37a6);});}catch(_0x4a0cfe){fs[_0x6e70('0x11')](_0x5a37a6);return _0x5d9263(_0x4a0cfe);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 9a76efa..5a633bd 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 _0xe14d=['.csv','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename'];(function(_0x59659d,_0xb17019){var _0x2adbb5=function(_0x22ea94){while(--_0x22ea94){_0x59659d['push'](_0x59659d['shift']());}};_0x2adbb5(++_0xb17019);}(_0xe14d,0x1ee));var _0xde14=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe14d[_0x2dafbe];return _0x58a45a;};'use strict';var util=require(_0xde14('0x0'));var path=require(_0xde14('0x1'));var _=require(_0xde14('0x2'));var csv=require(_0xde14('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xde14('0x4'));var rimraf=require(_0xde14('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xde14('0x6'))[_0xde14('0x7')];var logger=require(_0xde14('0x8'))(_0xde14('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xde14('0xa')][0x2]);var QUERY=process[_0xde14('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x5a1344,_0x1bd49d){var _0x115b7d={'status':_0x5a1344};var _0x2b0e7c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1bd49d){_0x115b7d[_0xde14('0xb')]=_0x1bd49d;}return db[_0xde14('0xc')][_0xde14('0xd')](_0x115b7d,_0x2b0e7c);}function main(){var _0xa17e8=0x1388;var _0x1ce0a2;logger['info'](util[_0xde14('0xe')](_0xde14('0xf'),EXTRACTED_REPORT_ID,_0xde14('0x10')));return db[_0xde14('0x11')][_0xde14('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xde14('0x13'),_0xde14('0x14')]})[_0xde14('0x15')](function(_0x34e28f){if(_0x34e28f){_0x1ce0a2=_0x34e28f;_0xa17e8=_0x1ce0a2[_0xde14('0x14')]||0x1388;}})[_0xde14('0x15')](function(){return dbH[_0xde14('0x16')][_0xde14('0x17')](util[_0xde14('0xe')](_0xde14('0x18'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xde14('0x19')]});})[_0xde14('0x15')](function(_0x26c1ec){if(!_0x26c1ec[0x0]['num']){return analyticExtractedReport(_0xde14('0x1a'));}var _0x31adb3=[];var _0x257390=0x0;var _0x31902a=!![];if(_0x26c1ec&&_0x26c1ec[_0xde14('0x1b')]){var _0x1b9d4b=_0x26c1ec[0x0][_0xde14('0x1c')]%(_0x257390+_0xa17e8);if(_0x1ce0a2[_0xde14('0x13')]){for(;_0x31902a;_0x257390+=_0xa17e8,_0x1b9d4b=_0x26c1ec[0x0][_0xde14('0x1c')]%(_0x257390+_0xa17e8)){if(_0x1b9d4b==0x0||_0x1b9d4b==_0x26c1ec[0x0][_0xde14('0x1c')]){_0x31902a=![];}_0x31adb3['push'](dbH[_0xde14('0x16')][_0xde14('0x17')](util[_0xde14('0xe')](_0xde14('0x1d'),QUERY,_0xa17e8,_0x257390),{'type':dbH['sequelize'][_0xde14('0x1e')]['SELECT']}));}}else{_0x31adb3[_0xde14('0x1f')](dbH['sequelize'][_0xde14('0x17')](QUERY,{'type':dbH[_0xde14('0x16')][_0xde14('0x1e')][_0xde14('0x19')]}));}}var _0x39bdc5=path[_0xde14('0x20')](PATH);var _0x40b648=path[_0xde14('0x21')](PATH,_0xde14('0x22'));var _0x163b79=_0x1ce0a2[_0xde14('0x13')]&&_0x31adb3[_0xde14('0x1b')]>0x1;var _0x8f8033=[];if(!fs['existsSync'](path[_0xde14('0x23')](_0x39bdc5,_0x40b648))&&_0x163b79){fs[_0xde14('0x24')](path[_0xde14('0x23')](_0x39bdc5,_0x40b648));}return BPromise[_0xde14('0x25')](_0x31adb3,function(_0x1bb7be){_0x8f8033[_0xde14('0x1f')](_0x1bb7be);})[_0xde14('0x15')](function(){for(var _0x23c735=0x0;_0x23c735<_0x8f8033[_0xde14('0x1b')];_0x23c735+=0x1){var _0x350a78;var _0x4eff65=_0x8f8033[_0x23c735];if(_0x163b79){_0x350a78=path[_0xde14('0x23')](_0x39bdc5,_0x40b648,util[_0xde14('0xe')](_0xde14('0x26'),_0x40b648,_0x23c735,_0xde14('0x27')));}else{_0x350a78=path['join'](_0x39bdc5,util[_0xde14('0xe')](_0xde14('0x28'),_0x40b648,_0xde14('0x27')));}fs['writeFileSync'](_0x350a78,csv(_0x4eff65));}})[_0xde14('0x15')](function(){if(_0x163b79){zipdir(path['join'](_0x39bdc5,_0x40b648),{'saveTo':path[_0xde14('0x23')](_0x39bdc5,util[_0xde14('0xe')](_0xde14('0x28'),_0x40b648,_0xde14('0x29')))},function(_0x2aca96,_0x237d3f){});rimraf(path[_0xde14('0x23')](_0x39bdc5,_0x40b648),function(){});}})[_0xde14('0x15')](function(){logger['info'](util[_0xde14('0xe')](_0xde14('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xde14('0x2b'),_0x163b79?util['format'](_0xde14('0x28'),_0x40b648,_0x163b79?_0xde14('0x29'):_0xde14('0x27')):null);});})[_0xde14('0x2c')](function(_0x13c164){logger['info'](util[_0xde14('0xe')](_0xde14('0x2d'),EXTRACTED_REPORT_ID,'CSV'),util[_0xde14('0x2e')](_0x13c164,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xde14('0x2f'));});}main(); \ No newline at end of file +var _0x6c76=['argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','analytics'];(function(_0x289330,_0x54f85a){var _0x22d2d0=function(_0x4bdcf9){while(--_0x4bdcf9){_0x289330['push'](_0x289330['shift']());}};_0x22d2d0(++_0x54f85a);}(_0x6c76,0x184));var _0x66c7=function(_0x961b28,_0x1fdbaa){_0x961b28=_0x961b28-0x0;var _0x477083=_0x6c76[_0x961b28];return _0x477083;};'use strict';var util=require(_0x66c7('0x0'));var path=require(_0x66c7('0x1'));var _=require(_0x66c7('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x66c7('0x3'));var zipdir=require(_0x66c7('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x66c7('0x5'))[_0x66c7('0x6')];var logger=require('../../config/logger')(_0x66c7('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x66c7('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x66c7('0x8')][0x4];function analyticExtractedReport(_0x4dffcd,_0x4fa6ce){var _0x208d06={'status':_0x4dffcd};var _0x2b0065={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4fa6ce){_0x208d06[_0x66c7('0x9')]=_0x4fa6ce;}return db['AnalyticExtractedReport'][_0x66c7('0xa')](_0x208d06,_0x2b0065);}function main(){var _0xbc35d9=0x1388;var _0xf44e2;logger[_0x66c7('0xb')](util['format'](_0x66c7('0xc'),EXTRACTED_REPORT_ID,_0x66c7('0xd')));return db[_0x66c7('0xe')][_0x66c7('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x66c7('0x10'),_0x66c7('0x11')]})[_0x66c7('0x12')](function(_0x5176a3){if(_0x5176a3){_0xf44e2=_0x5176a3;_0xbc35d9=_0xf44e2[_0x66c7('0x11')]||0x1388;}})[_0x66c7('0x12')](function(){return dbH[_0x66c7('0x13')][_0x66c7('0x14')](util[_0x66c7('0x15')](_0x66c7('0x16'),QUERY),{'type':dbH[_0x66c7('0x13')][_0x66c7('0x17')][_0x66c7('0x18')]});})['then'](function(_0x110f6d){if(!_0x110f6d[0x0]['num']){return analyticExtractedReport(_0x66c7('0x19'));}var _0x39f951=[];var _0x3c81c0=0x0;var _0x42e930=!![];if(_0x110f6d&&_0x110f6d[_0x66c7('0x1a')]){var _0x4e229a=_0x110f6d[0x0]['num']%(_0x3c81c0+_0xbc35d9);if(_0xf44e2['split']){for(;_0x42e930;_0x3c81c0+=_0xbc35d9,_0x4e229a=_0x110f6d[0x0]['num']%(_0x3c81c0+_0xbc35d9)){if(_0x4e229a==0x0||_0x4e229a==_0x110f6d[0x0][_0x66c7('0x1b')]){_0x42e930=![];}_0x39f951[_0x66c7('0x1c')](dbH['sequelize']['query'](util[_0x66c7('0x15')](_0x66c7('0x1d'),QUERY,_0xbc35d9,_0x3c81c0),{'type':dbH[_0x66c7('0x13')][_0x66c7('0x17')]['SELECT']}));}}else{_0x39f951['push'](dbH[_0x66c7('0x13')][_0x66c7('0x14')](QUERY,{'type':dbH[_0x66c7('0x13')][_0x66c7('0x17')][_0x66c7('0x18')]}));}}var _0x75f118=path['dirname'](PATH);var _0x4ddbd2=path[_0x66c7('0x1e')](PATH,'.csv');var _0x7462f1=_0xf44e2[_0x66c7('0x10')]&&_0x39f951[_0x66c7('0x1a')]>0x1;var _0x1fc9d3=[];if(!fs['existsSync'](path[_0x66c7('0x1f')](_0x75f118,_0x4ddbd2))&&_0x7462f1){fs[_0x66c7('0x20')](path['join'](_0x75f118,_0x4ddbd2));}return BPromise[_0x66c7('0x21')](_0x39f951,function(_0x11a6b9){_0x1fc9d3[_0x66c7('0x1c')](_0x11a6b9);})[_0x66c7('0x12')](function(){for(var _0x2af0a3=0x0;_0x2af0a3<_0x1fc9d3['length'];_0x2af0a3+=0x1){var _0x5bc4e6;var _0x4e514a=_0x1fc9d3[_0x2af0a3];if(_0x7462f1){_0x5bc4e6=path[_0x66c7('0x1f')](_0x75f118,_0x4ddbd2,util[_0x66c7('0x15')]('%s%d.%s',_0x4ddbd2,_0x2af0a3,_0x66c7('0x22')));}else{_0x5bc4e6=path[_0x66c7('0x1f')](_0x75f118,util[_0x66c7('0x15')](_0x66c7('0x23'),_0x4ddbd2,_0x66c7('0x22')));}fs[_0x66c7('0x24')](_0x5bc4e6,csv(_0x4e514a));}})['then'](function(){if(_0x7462f1){zipdir(path[_0x66c7('0x1f')](_0x75f118,_0x4ddbd2),{'saveTo':path[_0x66c7('0x1f')](_0x75f118,util[_0x66c7('0x15')](_0x66c7('0x23'),_0x4ddbd2,_0x66c7('0x25')))},function(_0x592f0e,_0x263b48){});rimraf(path['join'](_0x75f118,_0x4ddbd2),function(){});}})[_0x66c7('0x12')](function(){logger['info'](util[_0x66c7('0x15')](_0x66c7('0x26'),EXTRACTED_REPORT_ID,_0x66c7('0xd')));return analyticExtractedReport(_0x66c7('0x27'),_0x7462f1?util[_0x66c7('0x15')](_0x66c7('0x23'),_0x4ddbd2,_0x7462f1?'zip':'csv'):null);});})[_0x66c7('0x28')](function(_0x12e7c6){logger[_0x66c7('0xb')](util[_0x66c7('0x15')](_0x66c7('0x29'),EXTRACTED_REPORT_ID,_0x66c7('0xd')),util[_0x66c7('0x2a')](_0x12e7c6,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x66c7('0x2b'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 6615260..ac6e6ee 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(_0x499e4e,_0x2f44cf){var _0x62de57=function(_0x4e0ee3){while(--_0x4e0ee3){_0x499e4e['push'](_0x499e4e['shift']());}};_0x62de57(++_0x2f44cf);}(_0xb10b,0x12a));var _0xbb10=function(_0x133296,_0xe8ff9a){_0x133296=_0x133296-0x0;var _0x193517=_0xb10b[_0x133296];return _0x193517;};'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 _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(_0x5e547d,_0x5e1e61){var _0x5644f3=function(_0x2406cf){while(--_0x2406cf){_0x5e547d['push'](_0x5e547d['shift']());}};_0x5644f3(++_0x5e1e61);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e87a3,_0x58c1d1){_0x5e87a3=_0x5e87a3-0x0;var _0x69c6ab=_0xb10b[_0x5e87a3];return _0x69c6ab;};'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 diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index c4ff648..82cf53e 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 _0xaa76=['length','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','xlsx','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','Failed','util','path','lodash','zip-dir','../../mysqldb','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','Empty','num','push','dirname','.xlsx'];(function(_0x12ae5a,_0x449bf8){var _0xc1ce11=function(_0x3f1e84){while(--_0x3f1e84){_0x12ae5a['push'](_0x12ae5a['shift']());}};_0xc1ce11(++_0x449bf8);}(_0xaa76,0xbb));var _0x6aa7=function(_0x3b01c2,_0x32dd57){_0x3b01c2=_0x3b01c2-0x0;var _0x4e6966=_0xaa76[_0x3b01c2];return _0x4e6966;};'use strict';var util=require(_0x6aa7('0x0'));var path=require(_0x6aa7('0x1'));var _=require(_0x6aa7('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require('bluebird');var zipdir=require(_0x6aa7('0x3'));var rimraf=require('rimraf');var db=require(_0x6aa7('0x4'))['db'];var dbH=require(_0x6aa7('0x4'))['dbH'];var logger=require(_0x6aa7('0x5'))(_0x6aa7('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x6aa7('0x7')][0x2]);var QUERY=process[_0x6aa7('0x7')][0x3];var PATH=process[_0x6aa7('0x7')][0x4];function analyticExtractedReport(_0x128cb9,_0x3915c6){var _0x5f2f35={'status':_0x128cb9};var _0x5d774c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3915c6){_0x5f2f35[_0x6aa7('0x8')]=_0x3915c6;}return db['AnalyticExtractedReport'][_0x6aa7('0x9')](_0x5f2f35,_0x5d774c);}function main(){var _0x5bde83=0x1388;var _0x2f3e20;logger[_0x6aa7('0xa')](util[_0x6aa7('0xb')](_0x6aa7('0xc'),EXTRACTED_REPORT_ID,_0x6aa7('0xd')));return db[_0x6aa7('0xe')][_0x6aa7('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6aa7('0x10'),_0x6aa7('0x11')]})[_0x6aa7('0x12')](function(_0x4c9566){if(_0x4c9566){_0x2f3e20=_0x4c9566;_0x5bde83=_0x2f3e20['splitSizeXlsx']||0x1388;}})[_0x6aa7('0x12')](function(){return dbH[_0x6aa7('0x13')][_0x6aa7('0x14')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6aa7('0x13')][_0x6aa7('0x15')][_0x6aa7('0x16')]});})[_0x6aa7('0x12')](function(_0x811189){if(!_0x811189[0x0]['num']){return analyticExtractedReport(_0x6aa7('0x17'));}var _0x1a888c=[];var _0xc9ab50=0x0;var _0x5b41d4=!![];if(_0x2f3e20[_0x6aa7('0x10')]){if(_0x811189&&_0x811189['length']){var _0x207495=_0x811189[0x0][_0x6aa7('0x18')]%(_0xc9ab50+_0x5bde83);for(;_0x5b41d4;_0xc9ab50+=_0x5bde83,_0x207495=_0x811189[0x0]['num']%(_0xc9ab50+_0x5bde83)){if(_0x207495==0x0||_0x207495==_0x811189[0x0]['num']){_0x5b41d4=![];}_0x1a888c[_0x6aa7('0x19')](dbH[_0x6aa7('0x13')][_0x6aa7('0x14')](util[_0x6aa7('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5bde83,_0xc9ab50),{'type':dbH[_0x6aa7('0x13')][_0x6aa7('0x15')][_0x6aa7('0x16')]}));}}}else{_0x1a888c[_0x6aa7('0x19')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x6aa7('0x13')][_0x6aa7('0x15')][_0x6aa7('0x16')]}));}var _0x4dcb94=path[_0x6aa7('0x1a')](PATH);var _0x2f4611=path['basename'](PATH,_0x6aa7('0x1b'));var _0x1868c2=_0x2f3e20['split']&&_0x1a888c[_0x6aa7('0x1c')]>0x1;var _0xc27181=[];if(!fs[_0x6aa7('0x1d')](path[_0x6aa7('0x1e')](_0x4dcb94,_0x2f4611))&&_0x1868c2){fs[_0x6aa7('0x1f')](path['join'](_0x4dcb94,_0x2f4611));}return BPromise[_0x6aa7('0x20')](_0x1a888c,function(_0x33d58d){_0xc27181[_0x6aa7('0x19')](_0x33d58d);})['then'](function(){for(var _0xb63c5b=0x0;_0xb63c5b<_0xc27181[_0x6aa7('0x1c')];_0xb63c5b+=0x1){var _0x45b706;var _0x510743=_0xc27181[_0xb63c5b];if(_0x1868c2){_0x45b706=path[_0x6aa7('0x1e')](_0x4dcb94,_0x2f4611,util['format'](_0x6aa7('0x21'),_0x2f4611,_0xb63c5b,'xlsx'));}else{_0x45b706=path[_0x6aa7('0x1e')](_0x4dcb94,util[_0x6aa7('0xb')](_0x6aa7('0x22'),_0x2f4611,_0x6aa7('0x23')));}fs['writeFileSync'](_0x45b706,json2xls(_0x510743),_0x6aa7('0x24'));}})[_0x6aa7('0x12')](function(){if(_0x1868c2){zipdir(path[_0x6aa7('0x1e')](_0x4dcb94,_0x2f4611),{'saveTo':path['join'](_0x4dcb94,util[_0x6aa7('0xb')]('%s.%s',_0x2f4611,'zip'))},function(_0x539726,_0x3672c6){});rimraf(path['join'](_0x4dcb94,_0x2f4611),function(){});}})[_0x6aa7('0x12')](function(){logger['info'](util[_0x6aa7('0xb')](_0x6aa7('0x25'),EXTRACTED_REPORT_ID,_0x6aa7('0xd')));return analyticExtractedReport(_0x6aa7('0x26'),_0x1868c2?util[_0x6aa7('0xb')](_0x6aa7('0x22'),_0x2f4611,_0x1868c2?_0x6aa7('0x27'):_0x6aa7('0x23')):null);});})[_0x6aa7('0x28')](function(_0x343319){logger[_0x6aa7('0xa')](util[_0x6aa7('0xb')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6aa7('0xd')),util[_0x6aa7('0x29')](_0x343319,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x6aa7('0x2a'));});}main(); \ No newline at end of file +var _0x74cd=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','splitSizeXlsx','then','sequelize','SELECT','num','Empty','split','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','query','dirname','basename','.xlsx','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0x74cd,0x162));var _0xd74c=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0x74cd[_0x5e3b04];return _0x1fc44d;};'use strict';var util=require(_0xd74c('0x0'));var path=require(_0xd74c('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xd74c('0x2'));var BPromise=require(_0xd74c('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xd74c('0x4'));var db=require(_0xd74c('0x5'))['db'];var dbH=require(_0xd74c('0x5'))[_0xd74c('0x6')];var logger=require(_0xd74c('0x7'))(_0xd74c('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0xd74c('0x9')][0x2]);var QUERY=process[_0xd74c('0x9')][0x3];var PATH=process[_0xd74c('0x9')][0x4];function analyticExtractedReport(_0x5e70c1,_0x2740b1){var _0x5df310={'status':_0x5e70c1};var _0x5ad58e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2740b1){_0x5df310[_0xd74c('0xa')]=_0x2740b1;}return db[_0xd74c('0xb')][_0xd74c('0xc')](_0x5df310,_0x5ad58e);}function main(){var _0x385396=0x1388;var _0x44857e;logger[_0xd74c('0xd')](util[_0xd74c('0xe')](_0xd74c('0xf'),EXTRACTED_REPORT_ID,_0xd74c('0x10')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd74c('0x11')]})[_0xd74c('0x12')](function(_0x1e93dd){if(_0x1e93dd){_0x44857e=_0x1e93dd;_0x385396=_0x44857e[_0xd74c('0x11')]||0x1388;}})['then'](function(){return dbH[_0xd74c('0x13')]['query'](util[_0xd74c('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xd74c('0x13')]['QueryTypes'][_0xd74c('0x14')]});})[_0xd74c('0x12')](function(_0xf3c41f){if(!_0xf3c41f[0x0][_0xd74c('0x15')]){return analyticExtractedReport(_0xd74c('0x16'));}var _0x1a1305=[];var _0x1babe2=0x0;var _0x155ecd=!![];if(_0x44857e[_0xd74c('0x17')]){if(_0xf3c41f&&_0xf3c41f[_0xd74c('0x18')]){var _0x1f5e00=_0xf3c41f[0x0][_0xd74c('0x15')]%(_0x1babe2+_0x385396);for(;_0x155ecd;_0x1babe2+=_0x385396,_0x1f5e00=_0xf3c41f[0x0][_0xd74c('0x15')]%(_0x1babe2+_0x385396)){if(_0x1f5e00==0x0||_0x1f5e00==_0xf3c41f[0x0][_0xd74c('0x15')]){_0x155ecd=![];}_0x1a1305['push'](dbH[_0xd74c('0x13')]['query'](util[_0xd74c('0xe')](_0xd74c('0x19'),QUERY,_0x385396,_0x1babe2),{'type':dbH['sequelize'][_0xd74c('0x1a')][_0xd74c('0x14')]}));}}}else{_0x1a1305[_0xd74c('0x1b')](dbH[_0xd74c('0x13')][_0xd74c('0x1c')](QUERY,{'type':dbH[_0xd74c('0x13')][_0xd74c('0x1a')][_0xd74c('0x14')]}));}var _0x6a8439=path[_0xd74c('0x1d')](PATH);var _0x49788f=path[_0xd74c('0x1e')](PATH,_0xd74c('0x1f'));var _0x3a5295=_0x44857e['split']&&_0x1a1305[_0xd74c('0x18')]>0x1;var _0x27fc9e=[];if(!fs['existsSync'](path[_0xd74c('0x20')](_0x6a8439,_0x49788f))&&_0x3a5295){fs[_0xd74c('0x21')](path[_0xd74c('0x20')](_0x6a8439,_0x49788f));}return BPromise[_0xd74c('0x22')](_0x1a1305,function(_0x1cd3cc){_0x27fc9e[_0xd74c('0x1b')](_0x1cd3cc);})[_0xd74c('0x12')](function(){for(var _0x5a4ac7=0x0;_0x5a4ac7<_0x27fc9e[_0xd74c('0x18')];_0x5a4ac7+=0x1){var _0x5a0cb;var _0x23e5a2=_0x27fc9e[_0x5a4ac7];if(_0x3a5295){_0x5a0cb=path['join'](_0x6a8439,_0x49788f,util[_0xd74c('0xe')](_0xd74c('0x23'),_0x49788f,_0x5a4ac7,_0xd74c('0x24')));}else{_0x5a0cb=path[_0xd74c('0x20')](_0x6a8439,util[_0xd74c('0xe')](_0xd74c('0x25'),_0x49788f,_0xd74c('0x24')));}fs[_0xd74c('0x26')](_0x5a0cb,json2xls(_0x23e5a2),_0xd74c('0x27'));}})[_0xd74c('0x12')](function(){if(_0x3a5295){zipdir(path['join'](_0x6a8439,_0x49788f),{'saveTo':path[_0xd74c('0x20')](_0x6a8439,util['format']('%s.%s',_0x49788f,_0xd74c('0x28')))},function(_0x1db895,_0x188db6){});rimraf(path['join'](_0x6a8439,_0x49788f),function(){});}})[_0xd74c('0x12')](function(){logger[_0xd74c('0xd')](util[_0xd74c('0xe')](_0xd74c('0x29'),EXTRACTED_REPORT_ID,_0xd74c('0x10')));return analyticExtractedReport(_0xd74c('0x2a'),_0x3a5295?util[_0xd74c('0xe')](_0xd74c('0x25'),_0x49788f,_0x3a5295?_0xd74c('0x28'):_0xd74c('0x24')):null);});})['catch'](function(_0x112a68){logger[_0xd74c('0xd')](util['format'](_0xd74c('0x2b'),EXTRACTED_REPORT_ID,_0xd74c('0x10')),util[_0xd74c('0x2c')](_0x112a68,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd74c('0x2d'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index a6c5eb9..494ecbc 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 _0x5cd8=['XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','sortBy','catch','error','lodash','models','findAll','intervals','VoiceExtension','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','find','push','type','format','VoiceExtensionId','outbound','extension','Set','cutdigits','context','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','app','appType','custom','XCALLY-MOTION-ANSWER=1'];(function(_0x2bcb83,_0x47dec0){var _0x3b43c7=function(_0x26718f){while(--_0x26718f){_0x2bcb83['push'](_0x2bcb83['shift']());}};_0x3b43c7(++_0x47dec0);}(_0x5cd8,0x1d2));var _0x85cd=function(_0x4ebceb,_0xa86c37){_0x4ebceb=_0x4ebceb-0x0;var _0x57b46d=_0x5cd8[_0x4ebceb];return _0x57b46d;};'use strict';var _=require(_0x85cd('0x0'));var util=require('util');function rewrite(_0x24bfe8,_0x32ee64){var _0x2bfe8e=this;return _0x24bfe8[_0x85cd('0x1')]['Interval'][_0x85cd('0x2')]({'raw':!![]})['then'](function(_0x1c9dc8){_0x2bfe8e[_0x85cd('0x3')]=_0x1c9dc8;return _0x24bfe8[_0x85cd('0x1')][_0x85cd('0x4')][_0x85cd('0x2')]({'where':{'IntervalId':_0x32ee64['IntervalId']},'raw':!![]});})[_0x85cd('0x5')](function(_0x1a69c4){return _0x24bfe8['models'][_0x85cd('0x4')][_0x85cd('0x2')]({'where':{'exten':{'$in':_[_0x85cd('0x6')](_[_0x85cd('0x7')](_0x1a69c4,_0x85cd('0x8')))}},'order':[{'raw':_0x85cd('0x9')}],'raw':!![]});})[_0x85cd('0x5')](function(_0x13d545){var _0x3a28bb=_['filter'](_0x13d545,{'priority':'1'});var _0x526093=_[_0x85cd('0xa')](_0x13d545,{'isApp':0x1});var _0x2301b2=_[_0x85cd('0xb')](_0x526093,_0x85cd('0x8'));var _0x4f054b=[_0x85cd('0xc'),_0x85cd('0xd')];var _0x46432e=[];var _0x8d4f02=[];for(var _0xc695a0 in _0x2301b2){if(_0x2301b2[_0x85cd('0xe')](_0xc695a0)){_0x2bfe8e[_0x85cd('0xf')]=0x2;_0x2bfe8e[_0x85cd('0x10')]=[];_0x2bfe8e['extension']=_[_0x85cd('0x11')](_0x3a28bb,{'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')]});_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':'Set','appdata':util[_0x85cd('0x14')]('CDR(type)=%s',_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')]),'context':_0x2301b2[_0xc695a0][0x0]['context'],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e['priority']++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});if(_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')]===_0x85cd('0x16')){if(_0x2bfe8e[_0x85cd('0x17')]){_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':_0x85cd('0x18'),'appdata':'CDR(destination)='+(_0x2bfe8e[_0x85cd('0x17')][_0x85cd('0x19')]?'${EXTEN:'+_0x2bfe8e['extension']['cutdigits']+'}':'${EXTEN}'),'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0]['exten'],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});}_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0]['type'],'app':_0x85cd('0x18'),'appdata':_0x85cd('0x1b')+_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')],'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0]['VoiceExtensionId']});var _0xb3500f=_0x2bfe8e[_0x85cd('0xf')]++;_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0]['type'],'app':_0x85cd('0x1c'),'appdata':_0x85cd('0x1d')+(_0xb3500f+0x2)+_0x85cd('0x1e')+(_0xb3500f+0x1)+')','context':_0x2301b2[_0xc695a0][0x0]['context'],'exten':_0x2301b2[_0xc695a0][0x0]['exten'],'priority':_0xb3500f,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});if(_0x2bfe8e['extension']){_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':_0x85cd('0x18'),'appdata':_0x2bfe8e['extension'][_0x85cd('0x19')]?_0x85cd('0x1f')+_0x2bfe8e[_0x85cd('0x17')][_0x85cd('0x19')]+'}':'CDR(prefix)=noprefix','context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0]['VoiceExtensionId']});}_0x2bfe8e['extensions'][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':_0x85cd('0x18'),'appdata':_0x85cd('0x20')+_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')],'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0]['VoiceExtensionId']});if(_0x2bfe8e[_0x85cd('0x17')]&&_0x2bfe8e[_0x85cd('0x17')][_0x85cd('0xe')](_0x85cd('0x21'))&&_0x2bfe8e['extension'][_0x85cd('0x21')]!==_0x85cd('0x22')){_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':'Set','appdata':_0x85cd('0x23'),'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0]['exten'],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});_0x2bfe8e[_0x85cd('0x10')]['push']({'type':_0x2301b2[_0xc695a0][0x0]['type'],'app':_0x85cd('0x18'),'appdata':_0x85cd('0x24')+_0x2bfe8e['extension']['recordingFormat']||_0x85cd('0x25'),'context':_0x2301b2[_0xc695a0][0x0]['context'],'exten':_0x2301b2[_0xc695a0][0x0]['exten'],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});}}_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':_0x85cd('0x18'),'appdata':_0x85cd('0x26'),'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':_0x85cd('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e[_0x85cd('0xf')]++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':_0x85cd('0x18'),'appdata':_0x85cd('0x27'),'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'priority':_0x2bfe8e['priority']++,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0]['VoiceExtensionId']});for(var _0x467589=0x0,_0x3494fd=0x0;_0x467589<_0x2301b2[_0xc695a0][_0x85cd('0x28')];_0x467589+=0x1,_0x3494fd=0x0){var _0x25b7c7=_0x2301b2[_0xc695a0][_0x467589];if(_0x25b7c7['type']){_0x25b7c7[_0x85cd('0x13')]=_0x25b7c7[_0x85cd('0x13')][_0x85cd('0x29')]();}var _0x4efb8e=[];var _0x1139e0=[];delete _0x25b7c7['id'];delete _0x25b7c7[_0x85cd('0x2a')];delete _0x25b7c7[_0x85cd('0x2b')];var _0xd1c180=_0x25b7c7[_0x85cd('0x2c')]!==_0x85cd('0x2d')?[_0x25b7c7['interval']]:_0x25b7c7['IntervalId']?_[_0x85cd('0x7')](_[_0x85cd('0xa')](_0x2bfe8e[_0x85cd('0x3')],{'IntervalId':_0x25b7c7['IntervalId']}),_0x85cd('0x2c')):[];if(_0x25b7c7[_0x85cd('0xe')](_0x85cd('0x2e'))){if(_0x25b7c7['tag']&&_0x25b7c7[_0x85cd('0x2e')]!=='--'){_0x4efb8e['push']({'type':_0x25b7c7['type'],'app':_0x85cd('0x18'),'appdata':_0x85cd('0x2f')+_0x25b7c7[_0x85cd('0x2e')],'context':_0x25b7c7[_0x85cd('0x1a')],'exten':_0x25b7c7[_0x85cd('0x8')],'priority':_0xd1c180[_0x85cd('0x28')]+_0x2bfe8e['priority']+_0x3494fd++,'VoiceExtensionId':_0x25b7c7[_0x85cd('0x15')]});}}if(_0x25b7c7[_0x85cd('0x13')]===_0x85cd('0x16')&&_0x25b7c7[_0x85cd('0xe')](_0x85cd('0x30'))){if(_0x25b7c7[_0x85cd('0x30')]){_0x4efb8e[_0x85cd('0x12')]({'type':_0x25b7c7[_0x85cd('0x13')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x25b7c7[_0x85cd('0x30')]+')','context':_0x25b7c7[_0x85cd('0x1a')],'exten':_0x25b7c7[_0x85cd('0x8')],'priority':_0xd1c180[_0x85cd('0x28')]+_0x2bfe8e[_0x85cd('0xf')]+_0x3494fd++,'VoiceExtensionId':_0x25b7c7[_0x85cd('0x15')]});}else{_0x4efb8e['push']({'type':_0x25b7c7[_0x85cd('0x13')],'app':_0x85cd('0x1c'),'appdata':_0x85cd('0x31'),'context':_0x25b7c7['context'],'exten':_0x25b7c7['exten'],'priority':_0xd1c180['length']+_0x2bfe8e['priority']+_0x3494fd++,'VoiceExtensionId':_0x25b7c7['VoiceExtensionId']});}}if(_0x25b7c7[_0x85cd('0xe')]('answer')){if(_0x4f054b['indexOf'](_0x25b7c7[_0x85cd('0x32')][_0x85cd('0x29')]())>=0x0&&_0x25b7c7[_0x85cd('0x33')]!==_0x85cd('0x34')){if(_0x25b7c7['answer']){_0x4efb8e[_0x85cd('0x12')]({'type':_0x25b7c7[_0x85cd('0x13')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x25b7c7[_0x85cd('0x1a')],'exten':_0x25b7c7['exten'],'priority':_0xd1c180[_0x85cd('0x28')]+_0x2bfe8e['priority']+_0x3494fd++,'VoiceExtensionId':_0x25b7c7[_0x85cd('0x15')]});_0x4efb8e[_0x85cd('0x12')]({'type':_0x25b7c7[_0x85cd('0x13')],'app':'Set','appdata':_0x85cd('0x35'),'context':_0x25b7c7[_0x85cd('0x1a')],'exten':_0x25b7c7[_0x85cd('0x8')],'priority':_0xd1c180[_0x85cd('0x28')]+_0x2bfe8e['priority']+_0x3494fd++,'VoiceExtensionId':_0x25b7c7[_0x85cd('0x15')]});}else{_0x4efb8e[_0x85cd('0x12')]({'type':_0x25b7c7['type'],'app':_0x85cd('0x1c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x25b7c7[_0x85cd('0x1a')],'exten':_0x25b7c7[_0x85cd('0x8')],'priority':_0xd1c180[_0x85cd('0x28')]+_0x2bfe8e[_0x85cd('0xf')]+_0x3494fd++,'VoiceExtensionId':_0x25b7c7[_0x85cd('0x15')]});_0x4efb8e[_0x85cd('0x12')]({'type':_0x25b7c7['type'],'app':'Set','appdata':_0x85cd('0x36'),'context':_0x25b7c7[_0x85cd('0x1a')],'exten':_0x25b7c7[_0x85cd('0x8')],'priority':_0xd1c180[_0x85cd('0x28')]+_0x2bfe8e['priority']+_0x3494fd++,'VoiceExtensionId':_0x25b7c7[_0x85cd('0x15')]});}}}for(var _0x1afbff=0x0;_0x1afbff<_0xd1c180[_0x85cd('0x28')];_0x1afbff+=0x1){var _0xbabb64=_0x2bfe8e[_0x85cd('0xf')]+_0xd1c180[_0x85cd('0x28')];var _0x3ab6d4=_0x1afbff===_0xd1c180['length']-0x1?_0x2bfe8e['priority']+_0x4efb8e[_0x85cd('0x28')]+_0x1139e0[_0x85cd('0x28')]+0x2:_0x2bfe8e[_0x85cd('0xf')]+_0x1afbff+0x1;_0x4efb8e[_0x85cd('0x37')](_0x1afbff,0x0,{'type':_0x25b7c7['type'],'app':_0x85cd('0x38'),'appdata':_0xd1c180[_0x1afbff]+'?'+_0x25b7c7[_0x85cd('0x1a')]+',${EXTEN},'+_0xbabb64+':'+_0x25b7c7[_0x85cd('0x1a')]+_0x85cd('0x39')+_0x3ab6d4,'exten':_0x25b7c7['exten'],'context':_0x25b7c7[_0x85cd('0x1a')],'priority':_0x2bfe8e['priority']+_0x1afbff,'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});}_0x25b7c7[_0x85cd('0xf')]=_0x4efb8e[_0x85cd('0x28')]?_[_0x85cd('0x3a')](_0x4efb8e)[_0x85cd('0xf')]+0x1:_0x2bfe8e[_0x85cd('0xf')];_0x2bfe8e[_0x85cd('0xf')]=(_0x1139e0['length']?_['last'](_0x1139e0)[_0x85cd('0xf')]:_0x25b7c7[_0x85cd('0xf')])+0x1;_0x2bfe8e['extensions']=_[_0x85cd('0x3b')](_0x2bfe8e[_0x85cd('0x10')],_0x4efb8e,[_0x25b7c7],_0x1139e0);}_0x2bfe8e[_0x85cd('0x10')][_0x85cd('0x12')]({'type':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x13')],'app':'Hangup','exten':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x8')],'context':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x1a')],'priority':_0x2bfe8e[_0x85cd('0xf')],'VoiceExtensionId':_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]});_0x46432e[_0x85cd('0x12')](_0x2301b2[_0xc695a0][0x0][_0x85cd('0x15')]);_0x8d4f02=_[_0x85cd('0x3b')](_0x8d4f02,_0x2bfe8e[_0x85cd('0x10')]);}}return _0x24bfe8[_0x85cd('0x3c')](function(_0x5441b3){return _0x24bfe8['models'][_0x85cd('0x4')][_0x85cd('0x3d')]({'where':{'VoiceExtensionId':{'$in':_0x46432e}},'transaction':_0x5441b3})[_0x85cd('0x5')](function(_0x4525f8){return _0x24bfe8[_0x85cd('0x1')][_0x85cd('0x4')]['bulkCreate'](_[_0x85cd('0x3e')](_0x8d4f02,_0x85cd('0xf')),{'transaction':_0x5441b3});});});})[_0x85cd('0x3f')](function(_0x5eb538){console[_0x85cd('0x40')](_0x5eb538);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x3aa2=['):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','Interval','findAll','models','VoiceExtension','IntervalId','then','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','hasOwnProperty','priority','extensions','extension','exten','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','push','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('];(function(_0x3c5cc8,_0x336027){var _0x44675c=function(_0xf9543e){while(--_0xf9543e){_0x3c5cc8['push'](_0x3c5cc8['shift']());}};_0x44675c(++_0x336027);}(_0x3aa2,0x13b));var _0x23aa=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0x3aa2[_0x257841];return _0x1b87ed;};'use strict';var _=require(_0x23aa('0x0'));var util=require(_0x23aa('0x1'));function rewrite(_0x546b6c,_0x151513){var _0x57325d=this;return _0x546b6c['models'][_0x23aa('0x2')][_0x23aa('0x3')]({'raw':!![]})['then'](function(_0x38c0ab){_0x57325d['intervals']=_0x38c0ab;return _0x546b6c[_0x23aa('0x4')][_0x23aa('0x5')]['findAll']({'where':{'IntervalId':_0x151513[_0x23aa('0x6')]},'raw':!![]});})[_0x23aa('0x7')](function(_0x31e9e4){return _0x546b6c['models'][_0x23aa('0x5')][_0x23aa('0x3')]({'where':{'exten':{'$in':_[_0x23aa('0x8')](_['map'](_0x31e9e4,'exten'))}},'order':[{'raw':_0x23aa('0x9')}],'raw':!![]});})['then'](function(_0x3f9456){var _0x155c20=_[_0x23aa('0xa')](_0x3f9456,{'priority':'1'});var _0x1891c7=_[_0x23aa('0xa')](_0x3f9456,{'isApp':0x1});var _0x459412=_[_0x23aa('0xb')](_0x1891c7,'exten');var _0x4fdd70=['queue',_0x23aa('0xc')];var _0x1c664b=[];var _0x109649=[];for(var _0x1d3725 in _0x459412){if(_0x459412[_0x23aa('0xd')](_0x1d3725)){_0x57325d[_0x23aa('0xe')]=0x2;_0x57325d[_0x23aa('0xf')]=[];_0x57325d[_0x23aa('0x10')]=_['find'](_0x155c20,{'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')]});_0x57325d['extensions']['push']({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':util[_0x23aa('0x14')](_0x23aa('0x15'),_0x459412[_0x1d3725][0x0][_0x23aa('0x12')]),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0]['exten'],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});if(_0x459412[_0x1d3725][0x0]['type']==='outbound'){if(_0x57325d['extension']){_0x57325d['extensions'][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':'CDR(destination)='+(_0x57325d[_0x23aa('0x10')][_0x23aa('0x19')]?'${EXTEN:'+_0x57325d[_0x23aa('0x10')][_0x23aa('0x19')]+'}':_0x23aa('0x1a')),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});}_0x57325d[_0x23aa('0xf')][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0]['type'],'app':_0x23aa('0x13'),'appdata':_0x23aa('0x1b')+_0x459412[_0x1d3725][0x0][_0x23aa('0x17')],'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0]['exten'],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0]['VoiceExtensionId']});var _0x44b337=_0x57325d[_0x23aa('0xe')]++;_0x57325d[_0x23aa('0xf')]['push']({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x1c'),'appdata':_0x23aa('0x1d')+(_0x44b337+0x2)+_0x23aa('0x1e')+(_0x44b337+0x1)+')','context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0]['exten'],'priority':_0x44b337,'VoiceExtensionId':_0x459412[_0x1d3725][0x0]['VoiceExtensionId']});if(_0x57325d[_0x23aa('0x10')]){_0x57325d[_0x23aa('0xf')][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':_0x57325d[_0x23aa('0x10')][_0x23aa('0x19')]?_0x23aa('0x1f')+_0x57325d[_0x23aa('0x10')][_0x23aa('0x19')]+'}':_0x23aa('0x20'),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0]['VoiceExtensionId']});}_0x57325d['extensions'][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':'outboundrouteid='+_0x459412[_0x1d3725][0x0]['VoiceExtensionId'],'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0]['VoiceExtensionId']});if(_0x57325d[_0x23aa('0x10')]&&_0x57325d[_0x23aa('0x10')]['hasOwnProperty'](_0x23aa('0x21'))&&_0x57325d[_0x23aa('0x10')]['recordingFormat']!==_0x23aa('0x22')){_0x57325d[_0x23aa('0xf')]['push']({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':_0x23aa('0x23'),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});_0x57325d['extensions'][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x57325d['extension'][_0x23aa('0x21')]||_0x23aa('0x24'),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0]['exten'],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});}}_0x57325d[_0x23aa('0xf')][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0][_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':_0x23aa('0x25'),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});_0x57325d[_0x23aa('0xf')]['push']({'type':_0x459412[_0x1d3725][0x0]['type'],'app':_0x23aa('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x459412[_0x1d3725][0x0]['context'],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d['priority']++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});_0x57325d[_0x23aa('0xf')][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0]['type'],'app':_0x23aa('0x13'),'appdata':_0x23aa('0x26'),'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'priority':_0x57325d[_0x23aa('0xe')]++,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});for(var _0x20b565=0x0,_0x5c8c42=0x0;_0x20b565<_0x459412[_0x1d3725][_0x23aa('0x27')];_0x20b565+=0x1,_0x5c8c42=0x0){var _0x49f994=_0x459412[_0x1d3725][_0x20b565];if(_0x49f994[_0x23aa('0x12')]){_0x49f994['type']=_0x49f994['type']['toLowerCase']();}var _0x284b94=[];var _0x4e04de=[];delete _0x49f994['id'];delete _0x49f994['createdAt'];delete _0x49f994[_0x23aa('0x28')];var _0x173007=_0x49f994[_0x23aa('0x29')]!==_0x23aa('0x2a')?[_0x49f994[_0x23aa('0x29')]]:_0x49f994['IntervalId']?_['map'](_[_0x23aa('0xa')](_0x57325d[_0x23aa('0x2b')],{'IntervalId':_0x49f994[_0x23aa('0x6')]}),'interval'):[];if(_0x49f994[_0x23aa('0xd')]('tag')){if(_0x49f994[_0x23aa('0x2c')]&&_0x49f994[_0x23aa('0x2c')]!=='--'){_0x284b94[_0x23aa('0x18')]({'type':_0x49f994['type'],'app':_0x23aa('0x13'),'appdata':_0x23aa('0x2d')+_0x49f994['tag'],'context':_0x49f994[_0x23aa('0x16')],'exten':_0x49f994['exten'],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994[_0x23aa('0x17')]});}}if(_0x49f994[_0x23aa('0x12')]===_0x23aa('0x2e')&&_0x49f994['hasOwnProperty'](_0x23aa('0x2f'))){if(_0x49f994[_0x23aa('0x2f')]){_0x284b94['push']({'type':_0x49f994[_0x23aa('0x12')],'app':_0x23aa('0x1c'),'appdata':_0x23aa('0x30')+_0x49f994['callerID']+')','context':_0x49f994[_0x23aa('0x16')],'exten':_0x49f994['exten'],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994[_0x23aa('0x17')]});}else{_0x284b94[_0x23aa('0x18')]({'type':_0x49f994[_0x23aa('0x12')],'app':'ExecIf','appdata':_0x23aa('0x31'),'context':_0x49f994[_0x23aa('0x16')],'exten':_0x49f994['exten'],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994[_0x23aa('0x17')]});}}if(_0x49f994[_0x23aa('0xd')](_0x23aa('0x32'))){if(_0x4fdd70['indexOf'](_0x49f994[_0x23aa('0x33')][_0x23aa('0x34')]())>=0x0&&_0x49f994[_0x23aa('0x35')]!==_0x23aa('0x36')){if(_0x49f994[_0x23aa('0x32')]){_0x284b94[_0x23aa('0x18')]({'type':_0x49f994[_0x23aa('0x12')],'app':_0x23aa('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x49f994[_0x23aa('0x16')],'exten':_0x49f994[_0x23aa('0x11')],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994['VoiceExtensionId']});_0x284b94[_0x23aa('0x18')]({'type':_0x49f994[_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':_0x23aa('0x37'),'context':_0x49f994['context'],'exten':_0x49f994['exten'],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994[_0x23aa('0x17')]});}else{_0x284b94[_0x23aa('0x18')]({'type':_0x49f994[_0x23aa('0x12')],'app':_0x23aa('0x1c'),'appdata':_0x23aa('0x38'),'context':_0x49f994[_0x23aa('0x16')],'exten':_0x49f994[_0x23aa('0x11')],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994[_0x23aa('0x17')]});_0x284b94[_0x23aa('0x18')]({'type':_0x49f994[_0x23aa('0x12')],'app':_0x23aa('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x49f994[_0x23aa('0x16')],'exten':_0x49f994[_0x23aa('0x11')],'priority':_0x173007[_0x23aa('0x27')]+_0x57325d[_0x23aa('0xe')]+_0x5c8c42++,'VoiceExtensionId':_0x49f994[_0x23aa('0x17')]});}}}for(var _0x37aca6=0x0;_0x37aca6<_0x173007[_0x23aa('0x27')];_0x37aca6+=0x1){var _0x47924c=_0x57325d[_0x23aa('0xe')]+_0x173007[_0x23aa('0x27')];var _0x544aa3=_0x37aca6===_0x173007[_0x23aa('0x27')]-0x1?_0x57325d[_0x23aa('0xe')]+_0x284b94[_0x23aa('0x27')]+_0x4e04de[_0x23aa('0x27')]+0x2:_0x57325d[_0x23aa('0xe')]+_0x37aca6+0x1;_0x284b94[_0x23aa('0x39')](_0x37aca6,0x0,{'type':_0x49f994['type'],'app':_0x23aa('0x3a'),'appdata':_0x173007[_0x37aca6]+'?'+_0x49f994[_0x23aa('0x16')]+_0x23aa('0x3b')+_0x47924c+':'+_0x49f994[_0x23aa('0x16')]+',${EXTEN},'+_0x544aa3,'exten':_0x49f994[_0x23aa('0x11')],'context':_0x49f994[_0x23aa('0x16')],'priority':_0x57325d[_0x23aa('0xe')]+_0x37aca6,'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});}_0x49f994[_0x23aa('0xe')]=_0x284b94[_0x23aa('0x27')]?_[_0x23aa('0x3c')](_0x284b94)[_0x23aa('0xe')]+0x1:_0x57325d[_0x23aa('0xe')];_0x57325d[_0x23aa('0xe')]=(_0x4e04de[_0x23aa('0x27')]?_[_0x23aa('0x3c')](_0x4e04de)['priority']:_0x49f994[_0x23aa('0xe')])+0x1;_0x57325d[_0x23aa('0xf')]=_['concat'](_0x57325d[_0x23aa('0xf')],_0x284b94,[_0x49f994],_0x4e04de);}_0x57325d['extensions'][_0x23aa('0x18')]({'type':_0x459412[_0x1d3725][0x0]['type'],'app':_0x23aa('0x3d'),'exten':_0x459412[_0x1d3725][0x0][_0x23aa('0x11')],'context':_0x459412[_0x1d3725][0x0][_0x23aa('0x16')],'priority':_0x57325d[_0x23aa('0xe')],'VoiceExtensionId':_0x459412[_0x1d3725][0x0][_0x23aa('0x17')]});_0x1c664b[_0x23aa('0x18')](_0x459412[_0x1d3725][0x0]['VoiceExtensionId']);_0x109649=_[_0x23aa('0x3e')](_0x109649,_0x57325d['extensions']);}}return _0x546b6c[_0x23aa('0x3f')](function(_0x29ddb9){return _0x546b6c['models'][_0x23aa('0x5')][_0x23aa('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x1c664b}},'transaction':_0x29ddb9})[_0x23aa('0x7')](function(_0x121076){return _0x546b6c['models'][_0x23aa('0x5')][_0x23aa('0x41')](_[_0x23aa('0x42')](_0x109649,_0x23aa('0xe')),{'transaction':_0x29ddb9});});});})[_0x23aa('0x43')](function(_0x4fe580){console[_0x23aa('0x44')](_0x4fe580);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 0808b22..d315ea2 100644 --- a/server/components/import/cm/csv.js +++ b/server/components/import/cm/csv.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x457d26,_0x29ff8c){var _0x5babd5=function(_0x417cfc){while(--_0x417cfc){_0x457d26['push'](_0x457d26['shift']());}};_0x5babd5(++_0x29ff8c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xcb91[_0x210603];return _0x1bcb7d;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file +var _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d77f80d..aca4582 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(_0x2ab5c0,_0x3e00f3){var _0x2afddf=function(_0x352e2c){while(--_0x352e2c){_0x2ab5c0['push'](_0x2ab5c0['shift']());}};_0x2afddf(++_0x3e00f3);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 _0x7a54=['.CmListId\x20=\x20?','toString','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.priority','UserId','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','query','length','all','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header',',utcOffset','writeFileSync','parse','createReadStream','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','contact:import:','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','CREATE\x20TABLE\x20','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','then','format','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','voice_queues_has_cm_lists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','localhost','test','select','field','phone','from','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.updatedAt','insert','into','cm_hopper_black','fields','cm_contacts.ListId\x20=\x20'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x7a54,0x106));var _0x47a5=function(_0x27c6bc,_0xc5cf4e){_0x27c6bc=_0x27c6bc-0x0;var _0x5a10b5=_0x7a54[_0x27c6bc];return _0x5a10b5;};'use strict';var fs=require('fs');var path=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var Papa=require(_0x47a5('0x2'));var util=require('util');var BPromise=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var squel=require('squel');var Redis=require(_0x47a5('0x5'));var db=require(_0x47a5('0x6'))['db'];var config=require(_0x47a5('0x7'));var shared=require(_0x47a5('0x8'));var logger=require(_0x47a5('0x9'))('import');config[_0x47a5('0xa')]=_['defaults'](config[_0x47a5('0xa')],{'host':_0x47a5('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0xa')]));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']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x582352){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))*$/[_0x47a5('0xc')](_0x582352);}function selectNotIn(_0x2baee7,_0x5e31dd,_0x2eb0dd,_0x49e844,_0x5de6d7){return squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0xf'))[_0x47a5('0x10')](_0x49e844)[_0x47a5('0x11')](_0x5e31dd,null,_0x5e31dd+_0x47a5('0x12')+_0x49e844+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x49e844+'.'+_0x2eb0dd+'\x20=\x20'+_0x2baee7+'.'+_0x2eb0dd)[_0x47a5('0x13')](_0x5e31dd+_0x47a5('0x14')+_0x5de6d7[_0x47a5('0x11')]()+')');}function insertCmHopper(_0x711793,_0x139f25,_0x620ee9,_0x3c6c46,_0x190faa){var _0x4e99a8=[_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18'),_0x139f25+'.'+_0x3c6c46,_0x47a5('0x19'),'cm_contacts.updatedAt','cm_contacts.priority',_0x47a5('0x1a'),'\x22'+_0x190faa+'\x22'];return squel['insert']()['into'](_0x47a5('0x1b'))[_0x47a5('0x1c')]([_0x47a5('0xf'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f'),_0x3c6c46,_0x47a5('0x20'),_0x47a5('0x21'),_0x47a5('0x22'),'UserId',_0x47a5('0x23')],squel[_0x47a5('0xd')]()['fields'](_0x4e99a8)[_0x47a5('0x10')](_0x139f25)[_0x47a5('0x11')](_0x47a5('0x24'),null,'cm_contacts.ListId\x20=\x20'+_0x139f25+_0x47a5('0x25'))[_0x47a5('0x11')](_0x620ee9,null,_0x620ee9+_0x47a5('0x12')+_0x139f25+'.'+_0x3c6c46)[_0x47a5('0x13')](_0x139f25+'.CmListId\x20=\x20?',_0x711793)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)['where'](_0x47a5('0x27'),selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))[_0x47a5('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x139f25,_0x620ee9,_0x3c6c46,'cm_hopper',[_0x47a5('0x28')])))['toString']();}function insertCmHopperBlack(_0x1ea9c8,_0x5b6c4e,_0x23cb77,_0x378208){var _0x36ad34=[_0x47a5('0x15'),_0x47a5('0x17'),_0x47a5('0x18'),_0x5b6c4e+'.'+_0x378208,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x47a5('0x2d'))[_0x47a5('0x1c')]([_0x47a5('0xf'),'ContactId',_0x47a5('0x1f'),_0x378208,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x36ad34)['from'](_0x5b6c4e)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x5b6c4e+_0x47a5('0x25'))['join'](_0x23cb77,null,_0x23cb77+'.id\x20=\x20'+_0x5b6c4e+'.'+_0x378208)[_0x47a5('0x13')](_0x5b6c4e+_0x47a5('0x30'),_0x1ea9c8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')]('phone')[_0x47a5('0x10')](_0x47a5('0x2d'))['where']('ListId\x20=\x20?',_0x1ea9c8)[_0x47a5('0x13')](_0x378208+'\x20=\x20?',_0x5b6c4e+'.'+_0x378208)))[_0x47a5('0x31')]();}function insertTzCmHopper(_0x87e4c9,_0xf269a8,_0x52749b,_0x18f7e9,_0x50c086,_0x53c754){var _0x65542e=['cm_contacts.phone',_0x47a5('0x32')+_0x53c754+'.offset-cm_contacts.utcOffset\x20minute)',_0x47a5('0x17'),_0x47a5('0x18'),_0xf269a8+'.'+_0x18f7e9,_0x47a5('0x19'),_0x47a5('0x2a'),_0x47a5('0x33'),_0x47a5('0x1a'),'\x22'+_0x50c086+'\x22'];var _0xee582c=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')]('cm_hopper')[_0x47a5('0x1c')]([_0x47a5('0xf'),'scheduledat',_0x47a5('0x1e'),_0x47a5('0x1f'),_0x18f7e9,_0x47a5('0x20'),'updatedAt',_0x47a5('0x22'),_0x47a5('0x34'),'recallme'],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x65542e)['from'](_0xf269a8)['join']('cm_contacts',null,_0x47a5('0x2f')+_0xf269a8+'.CmListId')[_0x47a5('0x11')](_0x52749b,null,_0x52749b+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x11')](_0x53c754,null,_0x53c754+_0x47a5('0x12')+_0xf269a8+'.'+_0x18f7e9)[_0x47a5('0x13')](_0xf269a8+_0x47a5('0x30'),_0x87e4c9)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28'),_0x47a5('0x29')]))['where'](_0x47a5('0x27'),selectNotIn(_0xf269a8,_0x52749b,_0x18f7e9,_0x47a5('0x1b'),[_0x47a5('0x28')])))[_0x47a5('0x31')]();return _0xee582c;}function insertTzCmHopperBlack(_0x586f4f,_0x7de536,_0x528ef3,_0x47c7a2){var _0x55c43d=['cm_contacts.phone',_0x47a5('0x17'),'cm_contacts.ListId',_0x7de536+'.'+_0x47c7a2,_0x47a5('0x19'),_0x47a5('0x2a')];return squel[_0x47a5('0x2b')]()['into'](_0x47a5('0x2d'))[_0x47a5('0x1c')](['phone','ContactId',_0x47a5('0x1f'),_0x47c7a2,'createdAt',_0x47a5('0x21')],squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x55c43d)[_0x47a5('0x10')](_0x7de536)[_0x47a5('0x11')](_0x47a5('0x24'),null,_0x47a5('0x2f')+_0x7de536+_0x47a5('0x25'))[_0x47a5('0x11')](_0x528ef3,null,_0x528ef3+_0x47a5('0x12')+_0x7de536+'.'+_0x47c7a2)[_0x47a5('0x13')](_0x7de536+_0x47a5('0x30'),_0x586f4f)[_0x47a5('0x13')](_0x47a5('0x26'),NOW)[_0x47a5('0x13')](_0x47a5('0x27'),squel['select']()[_0x47a5('0xe')](_0x47a5('0xf'))['from']('cm_hopper_black')[_0x47a5('0x13')]('ListId\x20=\x20?',_0x586f4f)[_0x47a5('0x13')](_0x47c7a2+_0x47a5('0x35'),_0x7de536+'.'+_0x47c7a2)))['toString']();}function insertCmContact(_0x4f62d3,_0x3d85cc,_0x52d409,_0x2d147c){var _0x1d1039=_[_0x47a5('0x36')](_[_0x47a5('0x37')](_0x2d147c),[_0x47a5('0x1f'),_0x47a5('0x38'),_0x47a5('0x20'),'updatedAt']);return squel['insert']()[_0x47a5('0x2c')](_0x47a5('0x24'))[_0x47a5('0x1c')](_0x1d1039,squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x1d1039)[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x13')]('('+_0x52d409['join'](',')+_0x47a5('0x39'),squel[_0x47a5('0xd')]()[_0x47a5('0x2e')](_0x52d409)['from'](_0x47a5('0x24'))['where'](_0x47a5('0x3a'),_0x4f62d3)[_0x47a5('0x13')](_0x47a5('0x3b')))[_0x47a5('0x13')]('id\x20IN\x20?',squel[_0x47a5('0xd')]()[_0x47a5('0xe')](_0x47a5('0x3c'),_0x47a5('0x3d'))[_0x47a5('0x10')](_0x3d85cc)[_0x47a5('0x3e')](_0x52d409[_0x47a5('0x11')](','))))['toString']();}function handleStop(){logger[_0x47a5('0x3f')](_0x47a5('0x40'));stopped=!![];}function handleUncaughtException(_0x187d7e){logger[_0x47a5('0x41')](_0x187d7e[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}function handleError(_0x572233,_0x1ad6a9){stats[_0x47a5('0x44')][_0x47a5('0x45')]({'name':_0x1ad6a9['code'],'message':_0x1ad6a9[_0x47a5('0x42')],'row':_0x572233});}function handleQuery(_0x3c78b7){logger[_0x47a5('0x3f')](_0x3c78b7);return db['sequelize']['query'](_0x3c78b7)[_0x47a5('0x46')](function(_0x376e1d){results['push'](_0x376e1d);})['catch'](function(_0x6d6b2b){logger['error'](_0x6d6b2b[_0x47a5('0x42')]);});}function updateTzCampaigns(_0x5d383d){return new Promise(function(_0x482de6,_0x389ed9){var _0x46d2d3=squel['select']()[_0x47a5('0x2e')]([_0x47a5('0x47'),'campaigns.dialTimezone'])['from'](_0x47a5('0x48'))[_0x47a5('0x11')](_0x47a5('0x49'),null,_0x47a5('0x4a'))['where'](_0x47a5('0x4b')+_0x5d383d);db[_0x47a5('0x4c')][_0x47a5('0x4d')](_0x46d2d3['toString']())[_0x47a5('0x46')](function(_0x4db625){var _0x485e3c=[];for(var _0x470da6=0x0;_0x470da6<_0x4db625[_0x47a5('0x4e')];_0x470da6++){_0x485e3c[_0x47a5('0x45')](getTimezoneData(_0x4db625[_0x470da6],tmp_campaigns));}BPromise[_0x47a5('0x4f')](_0x485e3c)['then'](function(){_0x482de6({'val':0x1});});})[_0x47a5('0x50')](function(_0x5d1550){logger['error'](_0x5d1550['message']);_0x482de6({'val':0x0});});});}function updateTzVoiceQueues(_0x4f8564){return new Promise(function(_0x212d92,_0x6cd4ea){var _0x1e2bb4=squel['select']()['fields']([_0x47a5('0x51'),_0x47a5('0x52')])[_0x47a5('0x10')](_0x47a5('0x53'))[_0x47a5('0x11')]('voice_queues_has_cm_lists',null,_0x47a5('0x54'))['where'](_0x47a5('0x55')+_0x4f8564);db[_0x47a5('0x4c')]['query'](_0x1e2bb4[_0x47a5('0x31')]())[_0x47a5('0x46')](function(_0x132854){var _0x3e8274=[];for(var _0x2d6494=0x0;_0x2d6494<_0x132854[_0x47a5('0x4e')];_0x2d6494++){_0x3e8274[_0x47a5('0x45')](getTimezoneData(_0x132854[_0x2d6494],tmp_voice_queues));}BPromise[_0x47a5('0x4f')](_0x3e8274)['then'](function(){_0x212d92({'val':0x1});});})[_0x47a5('0x50')](function(_0x2a3a57){logger[_0x47a5('0x41')](_0x2a3a57[_0x47a5('0x42')]);_0x212d92({'val':0x0});});});}function getTimezoneData(_0x396cb0,_0x4bbe14){return new Promise(function(_0xbec033,_0xdfcecc){var _0x1224bc=shared[_0x47a5('0x56')];var _0x4228a3=_0x1224bc[_0x396cb0[_0x47a5('0x57')]];if(_[_0x47a5('0x58')](_0x4228a3)){_0xbec033({'ret':0x1});}else{var _0x149d34=_0x4228a3[_0x47a5('0x59')];var _0x44cb90=squel[_0x47a5('0x2b')]()[_0x47a5('0x2c')](_0x4bbe14)[_0x47a5('0x5a')]('id',_0x396cb0['id'])[_0x47a5('0x5a')](_0x47a5('0x5b'),_0x149d34)['set'](_0x47a5('0x57'),_0x396cb0[_0x47a5('0x57')])[_0x47a5('0x31')]();return db['sequelize'][_0x47a5('0x4d')](_0x44cb90)[_0x47a5('0x46')](function(_0x36c67){_0xbec033({'ret':0x1});})[_0x47a5('0x50')](function(_0x5d9822){logger[_0x47a5('0x41')](_0x5d9822['message']);_0xdfcecc({'ret':0x1});});}});}function handleTZQuery(_0x2d5ee6){logger['info'](_0x2d5ee6);return db[_0x47a5('0x4c')]['query'](_0x2d5ee6)[_0x47a5('0x46')](function(_0x2f27c3){})[_0x47a5('0x50')](function(_0x58473b){logger['error'](_0x58473b['message']);});}function main(_0x4164a3,_0x2b1303,_0xe3c0a7,_0x117510){logger['info'](_0x47a5('0x5c'),_0x4164a3,JSON[_0x47a5('0x5d')](_0x2b1303));process[_0x47a5('0x5e')](_0x47a5('0x5f'));var _0x308c9a=_0x2b1303[_0x47a5('0x60')];var _0x1155f6=_0x2b1303[_0x47a5('0x61')];var _0x4618a0=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),_0x1155f6+'.csv');hasTZ=_[_0x47a5('0x37')](_0x308c9a)['includes'](_0x47a5('0x57'));var _0x2ac30f=_[_0x47a5('0x37')](_0x308c9a)[_0x47a5('0x11')]();logger[_0x47a5('0x3f')](_0x47a5('0x64'),_0x2ac30f);if(hasTZ)_0x2ac30f+=_0x47a5('0x65');fs[_0x47a5('0x66')](_0x4618a0,_0x2ac30f+'\x0a');Papa[_0x47a5('0x67')](fs[_0x47a5('0x68')](_0x4164a3),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1cfb37,_0x1f07ac){try{for(var _0x8f0035=0x0,_0x2d434c=[];_0x8f0035<_0x1cfb37[_0x47a5('0x69')]['length'];_0x8f0035++){stats['rows']+=0x1;if(_0x1cfb37['errors'][_0x8f0035]){handleError(_0x1cfb37['data'][_0x8f0035],_0x1cfb37[_0x47a5('0x44')][_0x8f0035]);}else{var _0x28b8e9=[];for(var _0x5d6916 in _0x308c9a){if(_0x308c9a[_0x47a5('0x6a')](_0x5d6916)){if(_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]]){var _0x1baa5a=_[_0x47a5('0x6b')](_0x1cfb37[_0x47a5('0x69')][_0x8f0035][_0x308c9a[_0x5d6916]][_0x47a5('0x6c')](/"/g,'\x27'));switch(_0x5d6916){case _0x47a5('0x1d'):var _0x1c7302=moment(_0x1baa5a,_0x47a5('0x6d'),!![]);if(_0x1c7302[_0x47a5('0x6e')]()){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x6f'));}break;case _0x47a5('0x22'):var _0x420671=parseInt(_0x1baa5a);_0x1baa5a=_['isNaN'](_0x420671)||_0x420671<0x0||_0x420671>0x4?_0x117510?0x3:0x2:_0x420671;_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');break;case _0x47a5('0x34'):var _0x17b61d=parseInt(_0x1baa5a);if(_['isNumber'](_0x17b61d)&&_[_0x47a5('0x70')](_0xe3c0a7,_0x17b61d)){_0x2d434c['push']('\x22'+_0x17b61d+'\x22');}else{_0x28b8e9['push'](_0x47a5('0x71'));}break;case _0x47a5('0x72'):if(isEmail(_0x1baa5a)){_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x73'));}break;case _0x47a5('0x74'):var _0x479a82=moment(_0x1baa5a,'YYYY-MM-DD',!![]);if(_0x479a82[_0x47a5('0x6e')]()){_0x2d434c['push']('\x22'+_0x1baa5a+'\x22');}else{_0x28b8e9[_0x47a5('0x45')](_0x47a5('0x75'));}break;case _0x47a5('0x57'):var _0xb16bdd=shared['timezones'];var _0x3c66e3=_0xb16bdd[_0x1baa5a];if(!_['isNil'](_0x3c66e3)){var _0x5f3a04=_0x3c66e3[_0x47a5('0x59')];_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');_0x2d434c['push']('\x22'+_0x5f3a04+'\x22');}break;default:_0x2d434c[_0x47a5('0x45')]('\x22'+_0x1baa5a+'\x22');}}else{switch(_0x5d6916){case _0x47a5('0x76'):case _0x47a5('0xf'):_0x28b8e9['push'](_0x5d6916+_0x47a5('0x77'));break;default:_0x2d434c['push']('\x22\x22');}}}}if(_0x28b8e9[_0x47a5('0x4e')]){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x78'),'message':_0x28b8e9['join']()});}else{fs[_0x47a5('0x79')](_0x4618a0,_0x2d434c[_0x47a5('0x11')]()+'\x0a');}_0x2d434c=[];}if(!(stats[_0x47a5('0x7a')]%0xc8)){socket['emit'](_0x47a5('0x7b')+_0x1155f6,stats);stats['errors']=[];}}if(stopped){logger[_0x47a5('0x3f')]('Abort\x20parser');_0x1f07ac[_0x47a5('0x7c')]();}}catch(_0x20d8bd){handleError(_0x1cfb37[_0x47a5('0x69')][_0x8f0035],{'code':_0x47a5('0x7d'),'message':_0x20d8bd['message']});logger[_0x47a5('0x41')](_0x47a5('0x7e'),_0x20d8bd[_0x47a5('0x42')]);}},'complete':function(){try{var _0x1bbfba=[];var _0x22d84a=[];var _0x57ac25='cm_contacts';if(_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates'][_0x47a5('0x4e')]){_0x57ac25=_0x47a5('0x80')+_0x1155f6;_0x1bbfba[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+_0x57ac25+_0x47a5('0x81'));}tmp_campaigns=_0x47a5('0x82')+_0x1155f6;tmp_voice_queues='voice_queues_'+_0x1155f6;_0x22d84a[_0x47a5('0x45')](_0x47a5('0x83')+tmp_campaigns+_0x47a5('0x84'));_0x22d84a[_0x47a5('0x45')]('CREATE\x20TABLE\x20'+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x47a5('0x85')](_0x22d84a,handleTZQuery)[_0x47a5('0x86')](function(_0x48e7f3){updateTzCampaigns(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x5a0901){updateTzVoiceQueues(_0x2b1303[_0x47a5('0x1f')])[_0x47a5('0x86')](function(_0x2930d9){var _0x59f010=util[_0x47a5('0x87')]('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',_0x4618a0,_0x57ac25,_0x2ac30f,_0x2b1303[_0x47a5('0x1f')],_0x2b1303['CompanyId']||null,NOW,NOW);if(_[_0x47a5('0x58')](_0x308c9a[_0x47a5('0x1d')])){_0x59f010+=',\x20scheduledAt\x20=\x20NOW()';}_0x1bbfba[_0x47a5('0x45')](_0x59f010);if(_0x2b1303['duplicates']&&_0x2b1303[_0x47a5('0x7f')][_0x47a5('0x4e')]){_0x1bbfba[_0x47a5('0x45')](insertCmContact(_0x2b1303[_0x47a5('0x1f')],_0x57ac25,_0x2b1303['duplicates'],_0x308c9a));}if(hasTZ){_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303['ListId'],'voice_queues_has_cm_lists',_0x47a5('0x53'),_0x47a5('0x88'),_0x117510,tmp_voice_queues));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertTzCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x49'),'campaigns',_0x47a5('0x8a'),_0x117510,tmp_campaigns));_0x1bbfba['push'](insertTzCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8b'),_0x47a5('0x48'),_0x47a5('0x8a')));}else{_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x8c'),_0x47a5('0x53'),_0x47a5('0x88'),_0x117510));_0x1bbfba['push'](insertCmHopperBlack(_0x2b1303[_0x47a5('0x1f')],_0x47a5('0x89'),'voice_queues',_0x47a5('0x88')));_0x1bbfba[_0x47a5('0x45')](insertCmHopper(_0x2b1303[_0x47a5('0x1f')],'campaigns_has_cm_lists','campaigns',_0x47a5('0x8a'),_0x117510));_0x1bbfba[_0x47a5('0x45')](insertCmHopperBlack(_0x2b1303['ListId'],'campaigns_has_cm_blacklists',_0x47a5('0x48'),_0x47a5('0x8a')));}_0x1bbfba['push'](_0x47a5('0x8d')+tmp_campaigns+';');_0x1bbfba[_0x47a5('0x45')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise[_0x47a5('0x85')](_0x1bbfba,handleQuery)[_0x47a5('0x86')](function(_0x109805){stats[_0x47a5('0x8e')]=!![];stats[_0x47a5('0x8f')]=_0x2b1303[_0x47a5('0x7f')]&&_0x2b1303['duplicates']['length']?results[0x2]['affectedRows']:results[0x0][_0x47a5('0x8f')];socket[_0x47a5('0x90')]('contact:import:'+_0x1155f6,stats);fs[_0x47a5('0x91')](_0x4164a3);fs[_0x47a5('0x91')](_0x4618a0);process[_0x47a5('0x43')](0x0);})[_0x47a5('0x50')](function(_0xcdbfd7){logger['error'](_0xcdbfd7[_0x47a5('0x42')]);process['exit'](0x1);});})['catch'](function(_0x5db0ed){logger[_0x47a5('0x41')](_0x5db0ed['message']);process[_0x47a5('0x43')](0x1);});});});}catch(_0xf3edc8){logger[_0x47a5('0x41')]('complete',_0xf3edc8[_0x47a5('0x42')]);process[_0x47a5('0x43')](0x1);}},'error':function(_0x35bf37,_0x121750,_0x392ad7,_0x581a87){throw new Error(_0x581a87);}});}function validate(){if(process[_0x47a5('0x92')]&&process[_0x47a5('0x92')]['length']<0x4){throw new Error(_0x47a5('0x93'));}var _0x419870=path[_0x47a5('0x11')](config[_0x47a5('0x62')],_0x47a5('0x63'),process[_0x47a5('0x92')][0x2]);if(!fs['existsSync'](_0x419870)){throw new Error(_0x47a5('0x94'));}var _0x2e418d={};try{_0x2e418d=JSON['parse'](process[_0x47a5('0x92')][0x3]);if(!_0x2e418d[_0x47a5('0x60')]){throw new Error(_0x47a5('0x95'));}if(!_0x2e418d[_0x47a5('0x60')]['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x2e418d['binding']['firstName']){throw new Error(_0x47a5('0x96'));}var _0x27793e=0x0;if(_0x2e418d[_0x47a5('0x60')][_0x47a5('0x34')]){_0x27793e=0x1;}if(!_0x2e418d[_0x47a5('0x1f')]){throw new Error(_0x47a5('0x97'));}}catch(_0xac1f9e){throw new Error(_0x47a5('0x98'));}var _0x4bd164=[];try{_0x4bd164=_[_0x47a5('0x99')](JSON[_0x47a5('0x67')](process[_0x47a5('0x92')][0x4]),'id');}catch(_0x399528){logger['info']('No\x20agent\x20available');}main(_0x419870,_0x2e418d,_0x4bd164,_0x27793e);}validate();process['on'](_0x47a5('0x9a'),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 e236563..79f03db 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 _0x67b8=['body','ContactItemType','findAll','name','header','parse','createReadStream','data','rows','find','hasOwnProperty','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','replace','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','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',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','exit','argv','existsSync','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','isNil','AdditionalPhones','push','then','catch','error','message','split','length','all','filter','CmContactHasItem','update','updated','PHONE','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','ListId','createdAt','updatedAt','UserId','recallme','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','into','cm_hopper_black','fromQuery','ContactId','fields','cm_contacts','.CmListId','field','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','Received\x20SIGINT','errors','code','info','sequelize','main','stringify','send','start','binding','clone','socket_timestamp','.csv'];(function(_0x5e1b03,_0x53e0bf){var _0x18ea50=function(_0x3a8823){while(--_0x3a8823){_0x5e1b03['push'](_0x5e1b03['shift']());}};_0x18ea50(++_0x53e0bf);}(_0x67b8,0xca));var _0x867b=function(_0x133277,_0xb1d6b2){_0x133277=_0x133277-0x0;var _0x5b4a22=_0x67b8[_0x133277];return _0x5b4a22;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x867b('0x0'));var Papa=require('papaparse');var util=require(_0x867b('0x1'));var BPromise=require(_0x867b('0x2'));var moment=require(_0x867b('0x3'));var squel=require(_0x867b('0x4'));var Redis=require('ioredis');var db=require(_0x867b('0x5'))['db'];var config=require(_0x867b('0x6'));var logger=require(_0x867b('0x7'))('import');config[_0x867b('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x867b('0x9'))(new Redis(config[_0x867b('0x8')]));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()[_0x867b('0xa')](_0x867b('0xb'));var tempTableName='cm_contacts_temp_'+moment()[_0x867b('0xa')](_0x867b('0xc'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x1e78e0){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))*$/[_0x867b('0xd')](_0x1e78e0);}function selectNotIn(_0x1cdda8,_0x3cf91b,_0x139b9a,_0x42701c,_0x319bae){return squel[_0x867b('0xe')]()['field'](_0x867b('0xf'))[_0x867b('0x10')](_0x42701c)[_0x867b('0x11')](_0x3cf91b,null,_0x3cf91b+_0x867b('0x12')+_0x42701c+'.'+_0x139b9a)[_0x867b('0x13')](_0x42701c+'.'+_0x139b9a+_0x867b('0x14')+_0x1cdda8+'.'+_0x139b9a)['where'](_0x3cf91b+_0x867b('0x15')+_0x319bae['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0xa29735,_0x1113ab){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0x867b('0x16')+tempTableName)[_0x867b('0x17')](function(_0x538a2d){if(_0x538a2d!==null){var _0x53a1ab=[];for(var _0x294c40=0x0;_0x294c40<_0x538a2d['length'];_0x294c40++){var _0x270b64=_0x538a2d[_0x294c40];if(!_[_0x867b('0x18')](_0x270b64[_0x867b('0xf')])){if(!_['isNil'](_0x270b64[_0x867b('0x19')]))_0x53a1ab['push'](insertAdditionalPhones(_0x270b64));promisesContact[_0x867b('0x1a')]({'contact':_0x270b64});}}}Promise['all'](_0x53a1ab)[_0x867b('0x1b')](function(){_0xa29735({'val':0x1});});})[_0x867b('0x1c')](function(_0x4db541){logger[_0x867b('0x1d')](_0x4db541[_0x867b('0x1e')]);});});}function insertAdditionalPhones(_0x47df84){return new Promise(function(_0x33981c,_0x2d90c7){var _0xb02de1=_0x47df84[_0x867b('0x19')];if(_[_0x867b('0x18')](_0xb02de1))_0x2d90c7({'val':0x0});else{var _0x1cf4cd=_0xb02de1[_0x867b('0x1f')](';');var _0x56b620=[];orderBy=0x0;for(var _0x4fedd9=0x0;_0x4fedd9<_0x1cf4cd[_0x867b('0x20')];_0x4fedd9++){_0x56b620[_0x867b('0x1a')](splitAdditionalPhone(_0x47df84['id'],_0x1cf4cd[_0x4fedd9]));}Promise[_0x867b('0x21')](_0x56b620)['then'](function(){_0x33981c({'val':_0x1cf4cd[_0x867b('0x20')]});});}});}function splitAdditionalPhone(_0x539b58,_0x4843b6){return new Promise(function(_0x47ea6a,_0x235b9d){var _0x3070c7=_0x4843b6[_0x867b('0x1f')](':');var _0x224ba1=_0x3070c7[0x0];var _0x149e8c=_0x3070c7[0x1];if(_0x149e8c!==''){var _0x2694f4=_0x149e8c[_0x867b('0x1f')]('|');var _0x43f616=[];for(var _0x202bae=0x0;_0x202bae<_0x2694f4[_0x867b('0x20')];_0x202bae++){if(_0x2694f4[_0x202bae]!==''){var _0x3592c4=_[_0x867b('0x22')](promisesAdditionalPhones,{'contactId':_0x539b58,'phone':_0x2694f4[_0x202bae]});if(_0x3592c4['length']==0x0){orderBy++;promisesAdditionalPhones[_0x867b('0x1a')]({'contactId':_0x539b58,'contactTypeId':_0x224ba1,'phone':_0x2694f4[_0x202bae],'orderBy':orderBy});}}}_0x47ea6a({'ok':0x1});}else _0x47ea6a({'res':0x0});});}function createAdditionalPhone(_0x3996f6,_0x821995,_0x6c7c01,_0x55d182){return new Promise(function(_0x39fcf0,_0x51bc30){return db[_0x867b('0x23')]['findOne']({'where':{'CmContactId':_0x3996f6,'item':_0x6c7c01}})[_0x867b('0x1b')](function(_0x161fd1){if(_0x161fd1){return db[_0x867b('0x23')][_0x867b('0x24')]({'ItemTypeId':_0x821995,'OrderBy':_0x55d182},{'where':{'CmContactId':_0x3996f6,'item':_0x6c7c01}})[_0x867b('0x1b')](function(_0x29ad98){_0x39fcf0({'res':_0x867b('0x25')});});}else{return db[_0x867b('0x23')]['create']({'CmContactId':_0x3996f6,'item':_0x6c7c01,'ItemTypeId':_0x821995,'OrderBy':_0x55d182,'ItemClass':_0x867b('0x26')})['then'](function(_0xf87485){_0x39fcf0({'res':'inserted'});});}});});}function updateContact(_0x39fd31){return new Promise(function(_0x2935d4,_0x5c6a12){var _0x25da09=_0x39fd31['id'];delete _0x39fd31['id'];return db[_0x867b('0x27')][_0x867b('0x24')](_0x39fd31,{'where':{'id':_0x25da09}})['then'](function(_0x1ce849){updatedRows+=0x1;return db[_0x867b('0x28')]['update']({'phone':_0x39fd31[_0x867b('0xf')]},{'where':{'ContactId':_0x25da09}})[_0x867b('0x1b')](function(_0x115545){_0x2935d4({'ret':'OK'});});});});}function insertCmHopper(_0x29c262,_0x1137c4,_0xba04ad,_0x5d397f,_0x67bc67){var _0x4f0ed4=[_0x867b('0x29'),_0x867b('0x2a'),_0x867b('0x2b'),_0x867b('0x2c'),_0x1137c4+'.'+_0x5d397f,_0x867b('0x2d'),_0x867b('0x2e'),_0x867b('0x2f'),_0x867b('0x30'),'\x22'+_0x67bc67+'\x22'];return squel[_0x867b('0x31')]()['into']('cm_hopper')['fromQuery']([_0x867b('0xf'),'scheduledat','ContactId',_0x867b('0x32'),_0x5d397f,_0x867b('0x33'),_0x867b('0x34'),'priority',_0x867b('0x35'),_0x867b('0x36')],squel[_0x867b('0xe')]()['fields'](_0x4f0ed4)[_0x867b('0x10')](_0x1137c4)[_0x867b('0x11')]('cm_contacts',null,_0x867b('0x37')+_0x1137c4+'.CmListId')['join'](_0xba04ad,null,_0xba04ad+_0x867b('0x12')+_0x1137c4+'.'+_0x5d397f)[_0x867b('0x13')](_0x1137c4+_0x867b('0x38'),_0x29c262)['where'](_0x867b('0x39'),NOW)[_0x867b('0x13')](_0x867b('0x3a'),selectNotIn(_0x1137c4,_0xba04ad,_0x5d397f,_0x867b('0x3b'),[_0x867b('0x3c'),_0x867b('0x3d')]))[_0x867b('0x13')](_0x867b('0x3a'),selectNotIn(_0x1137c4,_0xba04ad,_0x5d397f,_0x867b('0x3b'),['\x22always\x22'])))[_0x867b('0x3e')]();}function insertCmHopperBlack(_0x4df831,_0x21a8de,_0x45c9ae,_0x201e7a){var _0x11d35a=[_0x867b('0x29'),_0x867b('0x2b'),_0x867b('0x2c'),_0x21a8de+'.'+_0x201e7a,_0x867b('0x2d'),_0x867b('0x2e')];return squel[_0x867b('0x31')]()[_0x867b('0x3f')](_0x867b('0x40'))[_0x867b('0x41')](['phone',_0x867b('0x42'),'ListId',_0x201e7a,_0x867b('0x33'),_0x867b('0x34')],squel[_0x867b('0xe')]()[_0x867b('0x43')](_0x11d35a)['from'](_0x21a8de)[_0x867b('0x11')](_0x867b('0x44'),null,_0x867b('0x37')+_0x21a8de+_0x867b('0x45'))[_0x867b('0x11')](_0x45c9ae,null,_0x45c9ae+_0x867b('0x12')+_0x21a8de+'.'+_0x201e7a)['where'](_0x21a8de+_0x867b('0x38'),_0x4df831)[_0x867b('0x13')](_0x867b('0x39'),NOW)[_0x867b('0x13')](_0x867b('0x3a'),squel[_0x867b('0xe')]()[_0x867b('0x46')]('phone')[_0x867b('0x10')](_0x867b('0x40'))[_0x867b('0x13')]('ListId\x20=\x20?',_0x4df831)[_0x867b('0x13')](_0x201e7a+'\x20=\x20?',_0x21a8de+'.'+_0x201e7a)))[_0x867b('0x3e')]();}function insertCmHopperAdditionalPhones(_0x3c5cdd){var _0x22947b=['cm_hopper.id',_0x867b('0x47'),'cm_contact_has_items.OrderBy',_0x867b('0x48'),_0x867b('0x49')];return squel[_0x867b('0x31')]()[_0x867b('0x3f')](_0x867b('0x4a'))[_0x867b('0x41')]([_0x867b('0x4b'),_0x867b('0xf'),'OrderBy',_0x867b('0x33'),_0x867b('0x34')],squel[_0x867b('0xe')]()['fields'](_0x22947b)['from'](_0x867b('0x3b'))['join'](_0x867b('0x44'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x867b('0x11')](_0x867b('0x4c'),null,_0x867b('0x4d'))[_0x867b('0x13')](_0x867b('0x4e'),_0x3c5cdd)[_0x867b('0x13')](_0x867b('0x39'),NOW))[_0x867b('0x3e')]();}function insertCmContact(_0x3e0eae,_0x3bd1ef,_0x55229a,_0x1652a1){var _0x596ba4=_['concat'](_[_0x867b('0x4f')](_0x1652a1),[_0x867b('0x32'),_0x867b('0x50'),_0x867b('0x33'),'updatedAt']);return squel[_0x867b('0x31')]()[_0x867b('0x3f')]('cm_contacts')[_0x867b('0x41')](_0x596ba4,squel[_0x867b('0xe')]()[_0x867b('0x43')](_0x596ba4)['from'](_0x3bd1ef)['where']('('+_0x55229a[_0x867b('0x11')](',')+_0x867b('0x51'),squel[_0x867b('0xe')]()['fields'](_0x55229a)[_0x867b('0x10')](_0x867b('0x44'))[_0x867b('0x13')](_0x867b('0x52'),_0x3e0eae))[_0x867b('0x13')](_0x867b('0x53'),squel[_0x867b('0xe')]()[_0x867b('0x46')](_0x867b('0x54'),'min_id')[_0x867b('0x10')](_0x3bd1ef)['group'](_0x55229a[_0x867b('0x11')](','))))[_0x867b('0x3e')]();}function handleStop(){logger['info'](_0x867b('0x55'));stopped=!![];}function handleUncaughtException(_0xe65527){logger['error'](_0xe65527['message']);process['exit'](0x1);}function handleError(_0x501513,_0x568a56){stats[_0x867b('0x56')]['push']({'name':_0x568a56[_0x867b('0x57')],'message':_0x568a56[_0x867b('0x1e')],'row':_0x501513});}function handleQuery(_0x1c90b1){logger[_0x867b('0x58')](_0x1c90b1);return db[_0x867b('0x59')]['query'](_0x1c90b1)[_0x867b('0x17')](function(_0x1d2553){results[_0x867b('0x1a')](_0x1d2553);})[_0x867b('0x1c')](function(_0x1ea714){logger[_0x867b('0x1d')](_0x1ea714['message']);});}function main(_0x5b0630,_0x292dfd,_0xf7d5d2,_0x57f181){logger[_0x867b('0x58')](_0x867b('0x5a'),_0x5b0630,JSON[_0x867b('0x5b')](_0x292dfd));process[_0x867b('0x5c')](_0x867b('0x5d'));var _0x142b0c=_0x292dfd[_0x867b('0x5e')];var _0x324f82=_[_0x867b('0x5f')](_0x142b0c);var _0x5daeae=_0x292dfd[_0x867b('0x60')];var _0x28275e=path[_0x867b('0x11')](config['root'],'server/files/tmp',_0x5daeae+_0x867b('0x61'));logger[_0x867b('0x58')](_0x867b('0x62'),_0x292dfd);db[_0x867b('0x63')][_0x867b('0x64')]({'raw':!![],'attributes':['id',_0x867b('0x65')]})[_0x867b('0x1b')](function(_0x1c8e65){for(var _0xd6ed09=0x0;_0xd6ed09<_0x1c8e65['length'];_0xd6ed09++){if(_0x1c8e65[_0xd6ed09][_0x867b('0x65')]in _0x142b0c){contactItemTypes[_0x867b('0x1a')](_0x1c8e65[_0xd6ed09]);delete _0x324f82[_0x1c8e65[_0xd6ed09][_0x867b('0x65')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x324f82[_0x867b('0x19')]='';var _0x1bf2be=_[_0x867b('0x4f')](_0x324f82)[_0x867b('0x11')]();logger[_0x867b('0x58')](_0x867b('0x66'),_0x1bf2be);fs['writeFileSync'](_0x28275e,_0x1bf2be+'\x0a');Papa[_0x867b('0x67')](fs[_0x867b('0x68')](_0x5b0630),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3f298d,_0x1fbf94){try{for(var _0x5910c2=0x0,_0x1705d4=[];_0x5910c2<_0x3f298d[_0x867b('0x69')][_0x867b('0x20')];_0x5910c2++){stats[_0x867b('0x6a')]+=0x1;if(_0x3f298d[_0x867b('0x56')][_0x5910c2]){handleError(_0x3f298d[_0x867b('0x69')][_0x5910c2],_0x3f298d[_0x867b('0x56')][_0x5910c2]);}else{var _0x3c7381=[];var _0x147049=[];for(var _0x2a5d9c in _0x142b0c){let _0x4530a0=contactItemTypes[_0x867b('0x6b')](_0x4cae28=>_0x4cae28['name']===_0x2a5d9c);if(_[_0x867b('0x18')](_0x4530a0)){if(_0x142b0c[_0x867b('0x6c')](_0x2a5d9c)){if(_0x3f298d['data'][_0x5910c2][_0x142b0c[_0x2a5d9c]]){var _0x25b752=_['trim'](_0x3f298d[_0x867b('0x69')][_0x5910c2][_0x142b0c[_0x2a5d9c]]['replace'](/"/g,'\x27'));switch(_0x2a5d9c){case _0x867b('0x6d'):var _0xad2e03=moment(_0x25b752,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xad2e03[_0x867b('0x6e')]()){_0x1705d4[_0x867b('0x1a')]('\x22'+_0x25b752+'\x22');}else{_0x3c7381['push'](_0x867b('0x6f'));}break;case _0x867b('0x70'):var _0x587cdf=parseInt(_0x25b752);_0x25b752=_['isNaN'](_0x587cdf)||_0x587cdf<0x0||_0x587cdf>0x4?_0x57f181?0x3:0x2:_0x587cdf;_0x1705d4[_0x867b('0x1a')]('\x22'+_0x25b752+'\x22');break;case _0x867b('0x35'):var _0x3b578e=parseInt(_0x25b752);if(_['isNumber'](_0x3b578e)&&_['includes'](_0xf7d5d2,_0x3b578e)){_0x1705d4['push']('\x22'+_0x3b578e+'\x22');}else{_0x3c7381[_0x867b('0x1a')](_0x867b('0x71'));}break;case _0x867b('0x72'):if(isEmail(_0x25b752)){_0x1705d4['push']('\x22'+_0x25b752+'\x22');}else{_0x3c7381[_0x867b('0x1a')](_0x867b('0x73'));}break;case'dateOfBirth':var _0x11ae34=moment(_0x25b752,_0x867b('0x74'),!![]);if(_0x11ae34['isValid']()){_0x1705d4[_0x867b('0x1a')]('\x22'+_0x25b752+'\x22');}else{_0x3c7381['push'](_0x867b('0x75'));}break;default:_0x1705d4['push']('\x22'+_0x25b752+'\x22');}}else{switch(_0x2a5d9c){case _0x867b('0x76'):case'phone':_0x3c7381['push'](_0x2a5d9c+_0x867b('0x77'));break;default:_0x1705d4['push']('\x22\x22');}}}}else{var _0x5c1748='';for(var _0x13889a=0x0;_0x13889a<_0x142b0c[_0x2a5d9c][_0x867b('0x20')];_0x13889a++){var _0x25b752=_['trim'](_0x3f298d[_0x867b('0x69')][_0x5910c2][_0x142b0c[_0x2a5d9c][_0x13889a]][_0x867b('0x78')](/"/g,'\x27'));if(_0x5c1748=='')_0x5c1748=_0x25b752;else _0x5c1748+='|'+_0x25b752;}_0x147049['push'](_0x4530a0['id']+':'+_0x5c1748);}}if(hasAdditionalPhones){_0x1705d4[_0x867b('0x1a')]('\x22'+_0x147049[_0x867b('0x11')](';')+'\x22');}if(_0x3c7381[_0x867b('0x20')]){handleError(_0x3f298d[_0x867b('0x69')][_0x5910c2],{'code':_0x867b('0x79'),'message':_0x3c7381['join']()});}else{fs[_0x867b('0x7a')](_0x28275e,_0x1705d4[_0x867b('0x11')]()+'\x0a');}_0x1705d4=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x867b('0x7b')+_0x5daeae,stats);stats[_0x867b('0x56')]=[];}}if(stopped){logger[_0x867b('0x58')](_0x867b('0x7c'));_0x1fbf94[_0x867b('0x7d')]();}}catch(_0x2af359){handleError(_0x3f298d[_0x867b('0x69')][_0x5910c2],{'code':'SystemError','message':_0x2af359[_0x867b('0x1e')]});logger['error']('step',_0x2af359[_0x867b('0x1e')]);}},'complete':function(){try{var _0x783dd9=[];var _0xad3f07=tempTableName;_0x783dd9['push'](_0x867b('0x7e')+_0xad3f07+_0x867b('0x7f'));logger[_0x867b('0x58')](_0x867b('0x80'),contactItemTypes[_0x867b('0x20')]);var _0x3e65c5=util[_0x867b('0xa')](_0x867b('0x81'),_0x28275e,_0xad3f07,_0x1bf2be,_0x292dfd[_0x867b('0x32')],_0x292dfd[_0x867b('0x50')]||null,NOW,NOW);if(_[_0x867b('0x18')](_0x142b0c[_0x867b('0x6d')])){_0x3e65c5+=_0x867b('0x82');}_0x783dd9[_0x867b('0x1a')](_0x3e65c5);BPromise[_0x867b('0x83')](_0x783dd9,handleQuery)[_0x867b('0x1b')](function(_0xa7c335){BPromise[_0x867b('0x21')]([handleAdditionalPhones()])[_0x867b('0x1b')](function(){_0x783dd9=[];for(var _0x5f9b93=0x0;_0x5f9b93\x20\x20');}var _0xcc0033=path['join'](config['root'],'server/files/tmp',process[_0x867b('0x8d')][0x2]);if(!fs[_0x867b('0x8e')](_0xcc0033)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x42184c={};try{_0x42184c=JSON[_0x867b('0x67')](process['argv'][0x3]);if(!_0x42184c[_0x867b('0x5e')]){throw new Error(_0x867b('0x8f'));}var _0x4015c6=0x0;if(_0x42184c['binding'][_0x867b('0x35')]){_0x4015c6=0x1;}if(!_0x42184c['ListId']){throw new Error(_0x867b('0x90'));}}catch(_0x33cb75){throw new Error(_0x867b('0x91'));}var _0x57fa3f=[];try{_0x57fa3f=_[_0x867b('0x92')](JSON[_0x867b('0x67')](process[_0x867b('0x8d')][0x4]),'id');}catch(_0x35de54){logger[_0x867b('0x58')](_0x867b('0x93'));}main(_0xcc0033,_0x42184c,_0x57fa3f,_0x4015c6);}validate();process['on'](_0x867b('0x94'),handleStop);process['on'](_0x867b('0x95'),handleUncaughtException); \ No newline at end of file +var _0xa2ec=['CmContactHasItem','updated','inserted','CmContact','CmHopper','update','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','ContactId','ListId','createdAt','priority','UserId','recallme','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','into','cm_hopper_black','updatedAt','fields','cm_contacts.createdAt\x20=\x20?','field','\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','ListId\x20=\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','main','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','name','header','writeFileSync','parse','data','rows','find','hasOwnProperty','trim','replace','scheduledat','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','contact:import:','abort','step','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',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactId','DROP\x20TABLE\x20','finish','emit','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','from','where','\x20=\x20','sequelize','query','spread','length','phone','isNil','AdditionalPhones','push','then','catch','all'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa2ec,0x10e));var _0xca2e=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xa2ec[_0x386c3e];return _0x4b8e13;};'use strict';var fs=require('fs');var path=require(_0xca2e('0x0'));var _=require(_0xca2e('0x1'));var Papa=require(_0xca2e('0x2'));var util=require(_0xca2e('0x3'));var BPromise=require(_0xca2e('0x4'));var moment=require('moment');var squel=require(_0xca2e('0x5'));var Redis=require(_0xca2e('0x6'));var db=require(_0xca2e('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0xca2e('0x8'))(_0xca2e('0x9'));config[_0xca2e('0xa')]=_[_0xca2e('0xb')](config[_0xca2e('0xa')],{'host':_0xca2e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca2e('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()[_0xca2e('0xd')](_0xca2e('0xe'));var tempTableName='cm_contacts_temp_'+moment()[_0xca2e('0xd')](_0xca2e('0xf'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x519248){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))*$/[_0xca2e('0x10')](_0x519248);}function selectNotIn(_0x5740fa,_0x1355c9,_0x4bb55d,_0x5d44cf,_0x4cf392){return squel[_0xca2e('0x11')]()['field']('phone')[_0xca2e('0x12')](_0x5d44cf)['join'](_0x1355c9,null,_0x1355c9+'.id\x20=\x20'+_0x5d44cf+'.'+_0x4bb55d)[_0xca2e('0x13')](_0x5d44cf+'.'+_0x4bb55d+_0xca2e('0x14')+_0x5740fa+'.'+_0x4bb55d)[_0xca2e('0x13')](_0x1355c9+'.dialCheckDuplicateType\x20IN\x20('+_0x4cf392['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0xb77d0b,_0x2faf77){promisesAdditionalPhones=[];promisesContact=[];return db[_0xca2e('0x15')][_0xca2e('0x16')]('select\x20*\x20from\x20'+tempTableName)[_0xca2e('0x17')](function(_0x59acba){if(_0x59acba!==null){var _0x245319=[];for(var _0xb19360=0x0;_0xb19360<_0x59acba[_0xca2e('0x18')];_0xb19360++){var _0x19327d=_0x59acba[_0xb19360];if(!_['isNil'](_0x19327d[_0xca2e('0x19')])){if(!_[_0xca2e('0x1a')](_0x19327d[_0xca2e('0x1b')]))_0x245319['push'](insertAdditionalPhones(_0x19327d));promisesContact[_0xca2e('0x1c')]({'contact':_0x19327d});}}}Promise['all'](_0x245319)[_0xca2e('0x1d')](function(){_0xb77d0b({'val':0x1});});})[_0xca2e('0x1e')](function(_0x53a9a6){logger['error'](_0x53a9a6['message']);});});}function insertAdditionalPhones(_0x498054){return new Promise(function(_0x572019,_0x2f33e0){var _0x5195dd=_0x498054['AdditionalPhones'];if(_[_0xca2e('0x1a')](_0x5195dd))_0x2f33e0({'val':0x0});else{var _0x13dbe7=_0x5195dd['split'](';');var _0x1a9a80=[];orderBy=0x0;for(var _0x91e70e=0x0;_0x91e70e<_0x13dbe7['length'];_0x91e70e++){_0x1a9a80[_0xca2e('0x1c')](splitAdditionalPhone(_0x498054['id'],_0x13dbe7[_0x91e70e]));}Promise[_0xca2e('0x1f')](_0x1a9a80)[_0xca2e('0x1d')](function(){_0x572019({'val':_0x13dbe7[_0xca2e('0x18')]});});}});}function splitAdditionalPhone(_0x4f8502,_0x3b9b4b){return new Promise(function(_0x5883da,_0xd3d1f){var _0x325fc9=_0x3b9b4b['split'](':');var _0x5135b6=_0x325fc9[0x0];var _0x1ab242=_0x325fc9[0x1];if(_0x1ab242!==''){var _0x3ce55b=_0x1ab242['split']('|');var _0x37059c=[];for(var _0x4aa25d=0x0;_0x4aa25d<_0x3ce55b['length'];_0x4aa25d++){if(_0x3ce55b[_0x4aa25d]!==''){var _0x481052=_['filter'](promisesAdditionalPhones,{'contactId':_0x4f8502,'phone':_0x3ce55b[_0x4aa25d]});if(_0x481052['length']==0x0){orderBy++;promisesAdditionalPhones[_0xca2e('0x1c')]({'contactId':_0x4f8502,'contactTypeId':_0x5135b6,'phone':_0x3ce55b[_0x4aa25d],'orderBy':orderBy});}}}_0x5883da({'ok':0x1});}else _0x5883da({'res':0x0});});}function createAdditionalPhone(_0xfd7daa,_0x433b9d,_0x1f0061,_0x2d8f15){return new Promise(function(_0x3ba9a1,_0x331814){return db[_0xca2e('0x20')]['findOne']({'where':{'CmContactId':_0xfd7daa,'item':_0x1f0061}})['then'](function(_0x8df0b6){if(_0x8df0b6){return db[_0xca2e('0x20')]['update']({'ItemTypeId':_0x433b9d,'OrderBy':_0x2d8f15},{'where':{'CmContactId':_0xfd7daa,'item':_0x1f0061}})[_0xca2e('0x1d')](function(_0x3dfa7d){_0x3ba9a1({'res':_0xca2e('0x21')});});}else{return db[_0xca2e('0x20')]['create']({'CmContactId':_0xfd7daa,'item':_0x1f0061,'ItemTypeId':_0x433b9d,'OrderBy':_0x2d8f15,'ItemClass':'PHONE'})[_0xca2e('0x1d')](function(_0x611f71){_0x3ba9a1({'res':_0xca2e('0x22')});});}});});}function updateContact(_0x3c11ef){return new Promise(function(_0x5ceaf9,_0x3b5591){var _0x20ac66=_0x3c11ef['id'];delete _0x3c11ef['id'];return db[_0xca2e('0x23')]['update'](_0x3c11ef,{'where':{'id':_0x20ac66}})['then'](function(_0x147318){updatedRows+=0x1;return db[_0xca2e('0x24')][_0xca2e('0x25')]({'phone':_0x3c11ef[_0xca2e('0x19')]},{'where':{'ContactId':_0x20ac66}})['then'](function(_0x1e4ba3){_0x5ceaf9({'ret':'OK'});});});});}function insertCmHopper(_0x1efd2e,_0x4d6947,_0x43a37f,_0x23f6d6,_0x47e7d5){var _0x399773=['cm_contacts.phone','cm_contacts.scheduledat',_0xca2e('0x26'),_0xca2e('0x27'),_0x4d6947+'.'+_0x23f6d6,'cm_contacts.createdAt',_0xca2e('0x28'),_0xca2e('0x29'),_0xca2e('0x2a'),'\x22'+_0x47e7d5+'\x22'];return squel[_0xca2e('0x2b')]()['into'](_0xca2e('0x2c'))[_0xca2e('0x2d')]([_0xca2e('0x19'),'scheduledat',_0xca2e('0x2e'),_0xca2e('0x2f'),_0x23f6d6,_0xca2e('0x30'),'updatedAt',_0xca2e('0x31'),_0xca2e('0x32'),_0xca2e('0x33')],squel['select']()['fields'](_0x399773)[_0xca2e('0x12')](_0x4d6947)[_0xca2e('0x34')](_0xca2e('0x35'),null,_0xca2e('0x36')+_0x4d6947+_0xca2e('0x37'))[_0xca2e('0x34')](_0x43a37f,null,_0x43a37f+_0xca2e('0x38')+_0x4d6947+'.'+_0x23f6d6)[_0xca2e('0x13')](_0x4d6947+_0xca2e('0x39'),_0x1efd2e)[_0xca2e('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0xca2e('0x13')](_0xca2e('0x3a'),selectNotIn(_0x4d6947,_0x43a37f,_0x23f6d6,_0xca2e('0x2c'),[_0xca2e('0x3b'),_0xca2e('0x3c')]))[_0xca2e('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4d6947,_0x43a37f,_0x23f6d6,'cm_hopper',[_0xca2e('0x3b')])))[_0xca2e('0x3d')]();}function insertCmHopperBlack(_0xcc5631,_0x17c864,_0x3526ed,_0x2dd787){var _0x57cc95=[_0xca2e('0x3e'),_0xca2e('0x26'),'cm_contacts.ListId',_0x17c864+'.'+_0x2dd787,'cm_contacts.createdAt',_0xca2e('0x28')];return squel['insert']()[_0xca2e('0x3f')](_0xca2e('0x40'))[_0xca2e('0x2d')]([_0xca2e('0x19'),_0xca2e('0x2e'),_0xca2e('0x2f'),_0x2dd787,'createdAt',_0xca2e('0x41')],squel[_0xca2e('0x11')]()[_0xca2e('0x42')](_0x57cc95)[_0xca2e('0x12')](_0x17c864)['join']('cm_contacts',null,_0xca2e('0x36')+_0x17c864+_0xca2e('0x37'))['join'](_0x3526ed,null,_0x3526ed+_0xca2e('0x38')+_0x17c864+'.'+_0x2dd787)[_0xca2e('0x13')](_0x17c864+_0xca2e('0x39'),_0xcc5631)[_0xca2e('0x13')](_0xca2e('0x43'),NOW)[_0xca2e('0x13')](_0xca2e('0x3a'),squel['select']()[_0xca2e('0x44')](_0xca2e('0x19'))['from'](_0xca2e('0x40'))[_0xca2e('0x13')]('ListId\x20=\x20?',_0xcc5631)[_0xca2e('0x13')](_0x2dd787+_0xca2e('0x45'),_0x17c864+'.'+_0x2dd787)))[_0xca2e('0x3d')]();}function insertCmHopperAdditionalPhones(_0x1cf01f){var _0x457427=[_0xca2e('0x46'),_0xca2e('0x47'),_0xca2e('0x48'),_0xca2e('0x49'),'cm_contact_has_items.updatedAt'];return squel[_0xca2e('0x2b')]()[_0xca2e('0x3f')](_0xca2e('0x4a'))[_0xca2e('0x2d')](['CmHopperId',_0xca2e('0x19'),_0xca2e('0x4b'),'createdAt','updatedAt'],squel[_0xca2e('0x11')]()[_0xca2e('0x42')](_0x457427)[_0xca2e('0x12')](_0xca2e('0x2c'))['join']('cm_contacts',null,_0xca2e('0x4c'))[_0xca2e('0x34')](_0xca2e('0x4d'),null,_0xca2e('0x4e'))[_0xca2e('0x13')](_0xca2e('0x4f'),_0x1cf01f)[_0xca2e('0x13')](_0xca2e('0x43'),NOW))[_0xca2e('0x3d')]();}function insertCmContact(_0x5e8cb7,_0x45c349,_0x200fc6,_0x710b2e){var _0x5cb28f=_['concat'](_[_0xca2e('0x50')](_0x710b2e),[_0xca2e('0x2f'),_0xca2e('0x51'),_0xca2e('0x30'),_0xca2e('0x41')]);return squel[_0xca2e('0x2b')]()[_0xca2e('0x3f')](_0xca2e('0x35'))[_0xca2e('0x2d')](_0x5cb28f,squel[_0xca2e('0x11')]()['fields'](_0x5cb28f)[_0xca2e('0x12')](_0x45c349)[_0xca2e('0x13')]('('+_0x200fc6[_0xca2e('0x34')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xca2e('0x42')](_0x200fc6)[_0xca2e('0x12')]('cm_contacts')['where'](_0xca2e('0x52'),_0x5e8cb7))[_0xca2e('0x13')](_0xca2e('0x53'),squel['select']()[_0xca2e('0x44')](_0xca2e('0x54'),_0xca2e('0x55'))[_0xca2e('0x12')](_0x45c349)[_0xca2e('0x56')](_0x200fc6[_0xca2e('0x34')](','))))[_0xca2e('0x3d')]();}function handleStop(){logger[_0xca2e('0x57')](_0xca2e('0x58'));stopped=!![];}function handleUncaughtException(_0x365e92){logger[_0xca2e('0x59')](_0x365e92[_0xca2e('0x5a')]);process[_0xca2e('0x5b')](0x1);}function handleError(_0x312ab2,_0x433e25){stats[_0xca2e('0x5c')][_0xca2e('0x1c')]({'name':_0x433e25[_0xca2e('0x5d')],'message':_0x433e25['message'],'row':_0x312ab2});}function handleQuery(_0x450985){logger[_0xca2e('0x57')](_0x450985);return db[_0xca2e('0x15')][_0xca2e('0x16')](_0x450985)['spread'](function(_0x1ebede){results[_0xca2e('0x1c')](_0x1ebede);})['catch'](function(_0x2b51de){logger['error'](_0x2b51de[_0xca2e('0x5a')]);});}function main(_0x2979b2,_0x400bf4,_0x47f73e,_0xd354b1){logger[_0xca2e('0x57')](_0xca2e('0x5e'),_0x2979b2,JSON[_0xca2e('0x5f')](_0x400bf4));process[_0xca2e('0x60')](_0xca2e('0x61'));var _0x5e5592=_0x400bf4[_0xca2e('0x62')];var _0xc29a7=_[_0xca2e('0x63')](_0x5e5592);var _0x25c729=_0x400bf4[_0xca2e('0x64')];var _0x384a59=path['join'](config[_0xca2e('0x65')],_0xca2e('0x66'),_0x25c729+_0xca2e('0x67'));logger[_0xca2e('0x57')](_0xca2e('0x68'),_0x400bf4);db[_0xca2e('0x69')]['findAll']({'raw':!![],'attributes':['id',_0xca2e('0x6a')]})['then'](function(_0x3c5ecb){for(var _0xfcc191=0x0;_0xfcc191<_0x3c5ecb[_0xca2e('0x18')];_0xfcc191++){if(_0x3c5ecb[_0xfcc191]['name']in _0x5e5592){contactItemTypes[_0xca2e('0x1c')](_0x3c5ecb[_0xfcc191]);delete _0xc29a7[_0x3c5ecb[_0xfcc191][_0xca2e('0x6a')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0xc29a7['AdditionalPhones']='';var _0x3bda2f=_[_0xca2e('0x50')](_0xc29a7)['join']();logger['info'](_0xca2e('0x6b'),_0x3bda2f);fs[_0xca2e('0x6c')](_0x384a59,_0x3bda2f+'\x0a');Papa[_0xca2e('0x6d')](fs['createReadStream'](_0x2979b2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x34dc8e,_0x13d571){try{for(var _0x388bc7=0x0,_0x40c2ed=[];_0x388bc7<_0x34dc8e[_0xca2e('0x6e')][_0xca2e('0x18')];_0x388bc7++){stats[_0xca2e('0x6f')]+=0x1;if(_0x34dc8e[_0xca2e('0x5c')][_0x388bc7]){handleError(_0x34dc8e['data'][_0x388bc7],_0x34dc8e[_0xca2e('0x5c')][_0x388bc7]);}else{var _0x113375=[];var _0x3ad9c0=[];for(var _0x2e4c4f in _0x5e5592){let _0x418a28=contactItemTypes[_0xca2e('0x70')](_0x1207cc=>_0x1207cc[_0xca2e('0x6a')]===_0x2e4c4f);if(_[_0xca2e('0x1a')](_0x418a28)){if(_0x5e5592[_0xca2e('0x71')](_0x2e4c4f)){if(_0x34dc8e['data'][_0x388bc7][_0x5e5592[_0x2e4c4f]]){var _0x26f917=_[_0xca2e('0x72')](_0x34dc8e[_0xca2e('0x6e')][_0x388bc7][_0x5e5592[_0x2e4c4f]][_0xca2e('0x73')](/"/g,'\x27'));switch(_0x2e4c4f){case _0xca2e('0x74'):var _0x3e1f5b=moment(_0x26f917,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x3e1f5b[_0xca2e('0x75')]()){_0x40c2ed[_0xca2e('0x1c')]('\x22'+_0x26f917+'\x22');}else{_0x113375[_0xca2e('0x1c')](_0xca2e('0x76'));}break;case _0xca2e('0x31'):var _0x253e56=parseInt(_0x26f917);_0x26f917=_[_0xca2e('0x77')](_0x253e56)||_0x253e56<0x0||_0x253e56>0x4?_0xd354b1?0x3:0x2:_0x253e56;_0x40c2ed['push']('\x22'+_0x26f917+'\x22');break;case _0xca2e('0x32'):var _0x134a3b=parseInt(_0x26f917);if(_[_0xca2e('0x78')](_0x134a3b)&&_[_0xca2e('0x79')](_0x47f73e,_0x134a3b)){_0x40c2ed[_0xca2e('0x1c')]('\x22'+_0x134a3b+'\x22');}else{_0x113375[_0xca2e('0x1c')](_0xca2e('0x7a'));}break;case'email':if(isEmail(_0x26f917)){_0x40c2ed[_0xca2e('0x1c')]('\x22'+_0x26f917+'\x22');}else{_0x113375[_0xca2e('0x1c')]('email\x20wrong\x20format');}break;case _0xca2e('0x7b'):var _0x38738d=moment(_0x26f917,_0xca2e('0x7c'),!![]);if(_0x38738d[_0xca2e('0x75')]()){_0x40c2ed[_0xca2e('0x1c')]('\x22'+_0x26f917+'\x22');}else{_0x113375[_0xca2e('0x1c')](_0xca2e('0x7d'));}break;default:_0x40c2ed['push']('\x22'+_0x26f917+'\x22');}}else{switch(_0x2e4c4f){case'firstName':case'phone':_0x113375['push'](_0x2e4c4f+_0xca2e('0x7e'));break;default:_0x40c2ed['push']('\x22\x22');}}}}else{var _0x5a0863='';for(var _0x3ca2c9=0x0;_0x3ca2c9<_0x5e5592[_0x2e4c4f][_0xca2e('0x18')];_0x3ca2c9++){var _0x26f917=_[_0xca2e('0x72')](_0x34dc8e[_0xca2e('0x6e')][_0x388bc7][_0x5e5592[_0x2e4c4f][_0x3ca2c9]][_0xca2e('0x73')](/"/g,'\x27'));if(_0x5a0863=='')_0x5a0863=_0x26f917;else _0x5a0863+='|'+_0x26f917;}_0x3ad9c0[_0xca2e('0x1c')](_0x418a28['id']+':'+_0x5a0863);}}if(hasAdditionalPhones){_0x40c2ed['push']('\x22'+_0x3ad9c0[_0xca2e('0x34')](';')+'\x22');}if(_0x113375[_0xca2e('0x18')]){handleError(_0x34dc8e[_0xca2e('0x6e')][_0x388bc7],{'code':_0xca2e('0x7f'),'message':_0x113375[_0xca2e('0x34')]()});}else{fs['appendFileSync'](_0x384a59,_0x40c2ed['join']()+'\x0a');}_0x40c2ed=[];}if(!(stats[_0xca2e('0x6f')]%0xc8)){socket['emit'](_0xca2e('0x80')+_0x25c729,stats);stats['errors']=[];}}if(stopped){logger[_0xca2e('0x57')]('Abort\x20parser');_0x13d571[_0xca2e('0x81')]();}}catch(_0x1e303c){handleError(_0x34dc8e[_0xca2e('0x6e')][_0x388bc7],{'code':'SystemError','message':_0x1e303c['message']});logger[_0xca2e('0x59')](_0xca2e('0x82'),_0x1e303c[_0xca2e('0x5a')]);}},'complete':function(){try{var _0x1d2a0a=[];var _0x4ede3d=tempTableName;_0x1d2a0a[_0xca2e('0x1c')]('CREATE\x20TABLE\x20'+_0x4ede3d+'\x20LIKE\x20cm_contacts;');logger['info'](_0xca2e('0x83'),contactItemTypes[_0xca2e('0x18')]);var _0x557c3a=util[_0xca2e('0xd')](_0xca2e('0x84'),_0x384a59,_0x4ede3d,_0x3bda2f,_0x400bf4['ListId'],_0x400bf4[_0xca2e('0x51')]||null,NOW,NOW);if(_[_0xca2e('0x1a')](_0x5e5592[_0xca2e('0x74')])){_0x557c3a+=_0xca2e('0x85');}_0x1d2a0a[_0xca2e('0x1c')](_0x557c3a);BPromise[_0xca2e('0x86')](_0x1d2a0a,handleQuery)[_0xca2e('0x1d')](function(_0x12d9f5){BPromise[_0xca2e('0x1f')]([handleAdditionalPhones()])['then'](function(){_0x1d2a0a=[];for(var _0x1490ab=0x0;_0x1490ab=_0x35d661){return _0x2e9822['status'](0x193)['json']({'message':util[_0x5c80('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x59e139)});}_0x342e32();})[_0x5c80('0x13')](function(_0x345a2a){_0x342e32(_0x345a2a);});});}function isUserLimit(){return isLimit(_0x5c80('0x14'),0x1,db[_0x5c80('0x15')],{'where':{'$or':[{'role':_0x5c80('0x16')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x5eb1=['catch','users','User','admin','isUserLimit','util','composable-middleware','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','update','utf8','final','hasOwnProperty','use','License','findOne','then','count','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x14b74f,_0xf24abd){var _0x11f35e=function(_0x2575a0){while(--_0x2575a0){_0x14b74f['push'](_0x14b74f['shift']());}};_0x11f35e(++_0xf24abd);}(_0x5eb1,0x131));var _0x15eb=function(_0x23a299,_0x30e49c){_0x23a299=_0x23a299-0x0;var _0x560bb3=_0x5eb1[_0x23a299];return _0x560bb3;};'use strict';var crypto=require('crypto');var util=require(_0x15eb('0x0'));var compose=require(_0x15eb('0x1'));var db=require(_0x15eb('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0xc4cad4,_0x5e4380){if(_0xc4cad4&&_0x5e4380){if(_0x5e4380[_0x15eb('0x3')]&&_0x5e4380[_0x15eb('0x4')]){var _0x25ecfd=_0x5e4380['data1'];var _0x5f1ce3=_0x5e4380[_0x15eb('0x4')];var _0x27b522=_0x25ecfd[_0x15eb('0x5')]('-')[0x4];var _0x191fbc=_0x25ecfd[_0x15eb('0x5')]('-')[0x0];var _0x1fdc70=crypto[_0x15eb('0x6')](_0x15eb('0x7'),util['format'](_0x15eb('0x8'),_0x27b522,_0x25ecfd,_0x191fbc));var _0xc4abc8=_0x1fdc70[_0x15eb('0x9')](_0x5f1ce3,'base64',_0x15eb('0xa'));_0xc4abc8+=_0x1fdc70[_0x15eb('0xb')](_0x15eb('0xa'));var _0x5db1f1=JSON['parse'](_0xc4abc8);return _0x5db1f1[_0x15eb('0xc')](_0xc4cad4)?_0x5db1f1[_0xc4cad4]:null;}}return null;}function isLimit(_0x1ea52e,_0x2da348,_0x539065,_0x473e65){var _0x45ad02=_0x2da348;return compose()[_0x15eb('0xd')](function(_0x6f4c10,_0x400cbb,_0x1470f7){return db[_0x15eb('0xe')][_0x15eb('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x15eb('0x10')](function(_0x338745){var _0xc5e5cc=getValueFromLicense(_0x1ea52e,_0x338745);return _0xc5e5cc?_0xc5e5cc:_0x45ad02;})[_0x15eb('0x10')](function(_0x3401af){_0x45ad02=_0x3401af;return _0x539065[_0x15eb('0x11')](_0x473e65);})[_0x15eb('0x10')](function(_0x5c0f5e){if(_0x5c0f5e>=_0x45ad02){return _0x400cbb['status'](0x193)['json']({'message':util[_0x15eb('0x12')](_0x15eb('0x13'),_0x1ea52e)});}_0x1470f7();})[_0x15eb('0x14')](function(_0x5c8a1a){_0x1470f7(_0x5c8a1a);});});}function isUserLimit(){return isLimit(_0x15eb('0x15'),0x1,db[_0x15eb('0x16')],{'where':{'$or':[{'role':_0x15eb('0x17')},{'role':'user'}]}});}exports[_0x15eb('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 5f9dfd1..b0601cb 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 _0x4437=['field','\x20AS\x20','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','minutes','seconds','parseSearch','sqlOperator','[$or]','replace','[$and]','split','length','shift','match','filter','map','push','buildExpression','operator','$eq','$between','value','includes','add','days','format','YYYY-MM-DD','castTo','text','CAST('];(function(_0x1390a0,_0x499668){var _0x359f67=function(_0x3daff4){while(--_0x3daff4){_0x1390a0['push'](_0x1390a0['shift']());}};_0x359f67(++_0x499668);}(_0x4437,0x1a0));var _0x7443=function(_0x48dcd1,_0xb994e){_0x48dcd1=_0x48dcd1-0x0;var _0x195984=_0x4437[_0x48dcd1];return _0x195984;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0x7443('0x0')]=function(_0xae3880){var _0x176892={'conditions':[]};_0x176892[_0x7443('0x1')]=_['startsWith'](_0xae3880,_0x7443('0x2'))?'or':'and';var _0x16b5de=_0xae3880[_0x7443('0x3')](_0x7443('0x4'),'')[_0x7443('0x3')]('[$or]','')[_0x7443('0x5')]('||');for(var _0x4de4d4=0x0;_0x4de4d4<_0x16b5de[_0x7443('0x6')];_0x4de4d4++){var _0x51a1b8=_0x16b5de[_0x4de4d4]['split'](':=');var _0x460a46=_0x51a1b8[0x0];var _0xa55a8c=_0x51a1b8['slice'](0x1);_0xa55a8c['forEach'](function(_0x2ac35b){var _0x1df940=_0x2ac35b['split']('[')[_0x7443('0x7')]();var _0x10ce3b=_0x2ac35b[_0x7443('0x8')](/\[(.*?)\]/g);_0x10ce3b['forEach'](function(_0x1a2bd8){var _0x4d29b0=_0x1a2bd8[_0x7443('0x5')]('[')[_0x7443('0x9')](function(_0x59983e){return _0x59983e['indexOf'](']')>-0x1;})[_0x7443('0xa')](function(_0x3159c2){return _0x3159c2[_0x7443('0x5')](']')[0x0];})[0x0];_0x176892['conditions'][_0x7443('0xb')]({'field':_0x460a46,'operator':_0x1df940,'value':_0x4d29b0});});});}return _0x176892;};exports[_0x7443('0xc')]=function(_0x45a79d,_0x48a939,_0x4f33e6){var _0x158f72={};if(_0x48a939==='DATE'){if(_0x4f33e6[_0x7443('0xd')]===_0x7443('0xe')){_0x4f33e6[_0x7443('0xd')]=_0x7443('0xf');_0x4f33e6[_0x7443('0x10')]+=','+_0x4f33e6[_0x7443('0x10')];}else if(_[_0x7443('0x11')](['$gt','$lte'],_0x4f33e6[_0x7443('0xd')])){_0x4f33e6[_0x7443('0x10')]=moment(_0x4f33e6[_0x7443('0x10')])[_0x7443('0x12')](0x1,_0x7443('0x13'))[_0x7443('0x14')](_0x7443('0x15'));}}if(_0x4f33e6[_0x7443('0x16')]){_0x48a939=_0x4f33e6[_0x7443('0x16')];_0x158f72[_0x7443('0x17')]=_0x7443('0x18')+_0x45a79d+'.'+_0x4f33e6[_0x7443('0x19')]+_0x7443('0x1a')+_0x4f33e6['castTo']+')\x20'+parseOperator(_0x4f33e6[_0x7443('0xd')]);}else{_0x158f72['text']=_0x45a79d+'.'+_0x4f33e6[_0x7443('0x19')]+'\x20'+parseOperator(_0x4f33e6[_0x7443('0xd')]);}if(_[_0x7443('0x11')]([_0x7443('0x1b'),_0x7443('0x1c')],_0x4f33e6[_0x7443('0xd')]))_0x158f72['text']='('+_0x158f72[_0x7443('0x17')]+_0x7443('0x1d')+_0x45a79d+'.'+_0x4f33e6['field']+_0x7443('0x1e');_0x158f72['value']=parseValue(_0x48a939,_0x4f33e6['operator'],_0x4f33e6['value']);return _0x158f72;};function parseOperator(_0x4ae9e6){var _0x4621c7;switch(_0x4ae9e6){case _0x7443('0x1f'):_0x4621c7=_0x7443('0x20');break;case _0x7443('0x1c'):_0x4621c7=_0x7443('0x21');break;case _0x7443('0xe'):_0x4621c7=_0x7443('0x22');break;case _0x7443('0x1b'):_0x4621c7=_0x7443('0x23');break;case _0x7443('0x24'):case'$startsWith':case _0x7443('0x25'):_0x4621c7=_0x7443('0x26');break;case'$lt':_0x4621c7='<\x20?';break;case'$gt':_0x4621c7=_0x7443('0x27');break;case _0x7443('0x28'):_0x4621c7=_0x7443('0x29');break;case _0x7443('0x2a'):_0x4621c7=_0x7443('0x2b');break;case _0x7443('0xf'):_0x4621c7=_0x7443('0x2c');break;}return _0x4621c7;}function parseValue(_0x5f30ff,_0x6b0fc9,_0x322c66){var _0x5e5018={'start':undefined,'end':undefined};switch(_0x6b0fc9){case _0x7443('0x1f'):case _0x7443('0x1c'):_0x5e5018[_0x7443('0x2d')]=_0x322c66[_0x7443('0x5')](',');break;case _0x7443('0x24'):_0x5e5018[_0x7443('0x2d')]='%'+_0x322c66+'%';break;case'$startsWith':_0x5e5018[_0x7443('0x2d')]=_0x322c66+'%';break;case _0x7443('0x25'):_0x5e5018[_0x7443('0x2d')]='%'+_0x322c66;break;case _0x7443('0xf'):var _0x43979d=_0x322c66[_0x7443('0x5')](',');var _0x322c66=_0x43979d[_0x7443('0x7')]();var _0x4ee9a2=_0x43979d['pop']();if(_0x5f30ff==='DATE'){_0x322c66=moment(_0x322c66)[_0x7443('0x2e')](0x0,!![])[_0x7443('0x14')]();_0x4ee9a2=moment(_0x4ee9a2)['utcOffset'](0x0,!![])['add'](0x17,'hours')[_0x7443('0x12')](0x3b,_0x7443('0x2f'))[_0x7443('0x12')](0x3b,_0x7443('0x30'))[_0x7443('0x14')]();}_0x5e5018={'start':_0x322c66,'end':_0x4ee9a2};break;default:_0x5e5018[_0x7443('0x2d')]=_0x322c66;break;}return _0x5e5018;} \ No newline at end of file +var _0xb722=['map','push','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','text','CAST(','field','\x20AS\x20','castTo','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','$gte','start','pop','utcOffset','hours','minutes','seconds','lodash','parseSearch','sqlOperator','[$or]','[$and]','replace','split','length','slice','shift','match','forEach'];(function(_0x52b34e,_0x5a7866){var _0x32cd15=function(_0x9f1238){while(--_0x9f1238){_0x52b34e['push'](_0x52b34e['shift']());}};_0x32cd15(++_0x5a7866);}(_0xb722,0x90));var _0x2b72=function(_0x51ce33,_0x65e79){_0x51ce33=_0x51ce33-0x0;var _0x180f00=_0xb722[_0x51ce33];return _0x180f00;};'use strict';var _=require(_0x2b72('0x0'));var moment=require('moment');exports[_0x2b72('0x1')]=function(_0x3bf58a){var _0x32611f={'conditions':[]};_0x32611f[_0x2b72('0x2')]=_['startsWith'](_0x3bf58a,_0x2b72('0x3'))?'or':'and';var _0x5aeac9=_0x3bf58a['replace'](_0x2b72('0x4'),'')[_0x2b72('0x5')](_0x2b72('0x3'),'')[_0x2b72('0x6')]('||');for(var _0x317b6f=0x0;_0x317b6f<_0x5aeac9[_0x2b72('0x7')];_0x317b6f++){var _0x310940=_0x5aeac9[_0x317b6f][_0x2b72('0x6')](':=');var _0x1fb499=_0x310940[0x0];var _0xc85950=_0x310940[_0x2b72('0x8')](0x1);_0xc85950['forEach'](function(_0x1ef222){var _0x4a2c1a=_0x1ef222['split']('[')[_0x2b72('0x9')]();var _0x20d66a=_0x1ef222[_0x2b72('0xa')](/\[(.*?)\]/g);_0x20d66a[_0x2b72('0xb')](function(_0x2dbc3a){var _0x48712c=_0x2dbc3a[_0x2b72('0x6')]('[')['filter'](function(_0x14c5fb){return _0x14c5fb['indexOf'](']')>-0x1;})[_0x2b72('0xc')](function(_0x7f07d8){return _0x7f07d8['split'](']')[0x0];})[0x0];_0x32611f['conditions'][_0x2b72('0xd')]({'field':_0x1fb499,'operator':_0x4a2c1a,'value':_0x48712c});});});}return _0x32611f;};exports[_0x2b72('0xe')]=function(_0x5ca1e3,_0x58b97a,_0x4678fe){var _0x25c10f={};if(_0x58b97a===_0x2b72('0xf')){if(_0x4678fe[_0x2b72('0x10')]==='$eq'){_0x4678fe[_0x2b72('0x10')]=_0x2b72('0x11');_0x4678fe[_0x2b72('0x12')]+=','+_0x4678fe[_0x2b72('0x12')];}else if(_[_0x2b72('0x13')]([_0x2b72('0x14'),_0x2b72('0x15')],_0x4678fe[_0x2b72('0x10')])){_0x4678fe[_0x2b72('0x12')]=moment(_0x4678fe[_0x2b72('0x12')])[_0x2b72('0x16')](0x1,_0x2b72('0x17'))[_0x2b72('0x18')](_0x2b72('0x19'));}}if(_0x4678fe['castTo']){_0x58b97a=_0x4678fe['castTo'];_0x25c10f[_0x2b72('0x1a')]=_0x2b72('0x1b')+_0x5ca1e3+'.'+_0x4678fe[_0x2b72('0x1c')]+_0x2b72('0x1d')+_0x4678fe[_0x2b72('0x1e')]+')\x20'+parseOperator(_0x4678fe['operator']);}else{_0x25c10f[_0x2b72('0x1a')]=_0x5ca1e3+'.'+_0x4678fe[_0x2b72('0x1c')]+'\x20'+parseOperator(_0x4678fe['operator']);}if(_['includes']([_0x2b72('0x1f'),'$notIn'],_0x4678fe[_0x2b72('0x10')]))_0x25c10f[_0x2b72('0x1a')]='('+_0x25c10f[_0x2b72('0x1a')]+_0x2b72('0x20')+_0x5ca1e3+'.'+_0x4678fe[_0x2b72('0x1c')]+_0x2b72('0x21');_0x25c10f[_0x2b72('0x12')]=parseValue(_0x58b97a,_0x4678fe['operator'],_0x4678fe[_0x2b72('0x12')]);return _0x25c10f;};function parseOperator(_0x2f2f2d){var _0x477676;switch(_0x2f2f2d){case _0x2b72('0x22'):_0x477676=_0x2b72('0x23');break;case'$notIn':_0x477676='NOT\x20IN\x20?';break;case _0x2b72('0x24'):_0x477676='=\x20?';break;case'$ne':_0x477676=_0x2b72('0x25');break;case _0x2b72('0x26'):case _0x2b72('0x27'):case'$endsWith':_0x477676=_0x2b72('0x28');break;case _0x2b72('0x29'):_0x477676=_0x2b72('0x2a');break;case _0x2b72('0x14'):_0x477676=_0x2b72('0x2b');break;case _0x2b72('0x15'):_0x477676=_0x2b72('0x2c');break;case _0x2b72('0x2d'):_0x477676='>=\x20?';break;case _0x2b72('0x11'):_0x477676='BETWEEN\x20?\x20AND\x20?';break;}return _0x477676;}function parseValue(_0x480c67,_0x37e77b,_0x554875){var _0x59af08={'start':undefined,'end':undefined};switch(_0x37e77b){case _0x2b72('0x22'):case'$notIn':_0x59af08['start']=_0x554875[_0x2b72('0x6')](',');break;case _0x2b72('0x26'):_0x59af08['start']='%'+_0x554875+'%';break;case _0x2b72('0x27'):_0x59af08[_0x2b72('0x2e')]=_0x554875+'%';break;case'$endsWith':_0x59af08[_0x2b72('0x2e')]='%'+_0x554875;break;case _0x2b72('0x11'):var _0x19fbe2=_0x554875['split'](',');var _0x554875=_0x19fbe2['shift']();var _0x48655f=_0x19fbe2[_0x2b72('0x2f')]();if(_0x480c67===_0x2b72('0xf')){_0x554875=moment(_0x554875)[_0x2b72('0x30')](0x0,!![])['format']();_0x48655f=moment(_0x48655f)['utcOffset'](0x0,!![])['add'](0x17,_0x2b72('0x31'))[_0x2b72('0x16')](0x3b,_0x2b72('0x32'))[_0x2b72('0x16')](0x3b,_0x2b72('0x33'))['format']();}_0x59af08={'start':_0x554875,'end':_0x48655f};break;default:_0x59af08['start']=_0x554875;break;}return _0x59af08;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index f14c922..29dce80 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 _0x5afb=['format','YYYY-MM-DD','utc','$lte','subtract','limit','sort','indexOf','priority','cast','col','unsigned','DESC','ASC','isEmpty','isArray','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','^[0-9]*$','match','push','toString','join','lodash','sequelize','fields','split','filters','find','type','DATE','isPlainObject','parse','$gte'];(function(_0x246e1a,_0x30ee98){var _0x19a13c=function(_0x3c4cd8){while(--_0x3c4cd8){_0x246e1a['push'](_0x246e1a['shift']());}};_0x19a13c(++_0x30ee98);}(_0x5afb,0x1c9));var _0xb5af=function(_0x4fdc46,_0x2a3759){_0x4fdc46=_0x4fdc46-0x0;var _0x2c178a=_0x5afb[_0x4fdc46];return _0x2c178a;};'use strict';var _=require(_0xb5af('0x0'));var sequelize=require(_0xb5af('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;exports[_0xb5af('0x2')]=function(_0x4f14d3){var _0x5661c1=null;if(_0x4f14d3){_0x5661c1=_0x4f14d3[_0xb5af('0x3')](',');}return _0x5661c1;};exports[_0xb5af('0x4')]=function(_0x3dc64c,_0x46ac3d){var _0x34ea77={};if(!_['isEmpty'](_0x3dc64c)){_['forOwn'](_0x3dc64c,function(_0x2a870a,_0x3f882c){try{if(_0x46ac3d){var _0x37eb00=_[_0xb5af('0x5')](_0x46ac3d,{'name':_0x3f882c})||{};if(_0x37eb00[_0xb5af('0x6')]===_0xb5af('0x7')&&_[_0xb5af('0x8')](_0x2a870a)){var _0x186719=JSON[_0xb5af('0x9')](_0x2a870a);var _0x58405f={'$gte':moment(moment(_0x186719[_0xb5af('0xa')])[_0xb5af('0xb')](_0xb5af('0xc')))[_0xb5af('0xd')]()['format'](),'$lte':moment(moment(_0x186719[_0xb5af('0xe')])[_0xb5af('0xb')]('YYYY-MM-DD'))['utc']()[_0xb5af('0xf')](0x1,'s')[_0xb5af('0xb')]()};_0x34ea77[_0x3f882c]=_0x58405f;}else{_0x34ea77[_0x3f882c]=_['isArray'](_0x2a870a)?_0x2a870a:JSON[_0xb5af('0x9')](_0x2a870a);}}else{_0x34ea77[_0x3f882c]=_['isArray'](_0x2a870a)?_0x2a870a:JSON[_0xb5af('0x9')](_0x2a870a);}}catch(_0x3c90da){_0x34ea77[_0x3f882c]=_0x2a870a[_0xb5af('0x3')](',');}});}return _0x34ea77;};exports[_0xb5af('0x10')]=function(_0x4db008){_0x4db008=parseInt(_0x4db008,0xa);if(!_0x4db008||_0x4db008<0x0){_0x4db008=LIMIT_VALUE;}return _0x4db008;};exports['offset']=function(_0x9b57a9){_0x9b57a9=parseInt(_0x9b57a9,0xa);if(!_0x9b57a9||_0x9b57a9<0x0){_0x9b57a9=0x0;}return _0x9b57a9;};exports[_0xb5af('0x11')]=function(_0x1ee6fe){var _0x21a479,_0x214763=null;if(_0x1ee6fe){_0x21a479=_0x1ee6fe[_0xb5af('0x3')](',');_0x214763=_['map'](_0x21a479,function(_0x26a23e){if(_0x26a23e[_0xb5af('0x12')]('-')===0x0){return[_0x26a23e===_0xb5af('0x13')?sequelize[_0xb5af('0x14')](sequelize[_0xb5af('0x15')]('priority'),_0xb5af('0x16')):_0x26a23e['substr'](0x1),_0xb5af('0x17')];}else{return[_0x26a23e===_0xb5af('0x13')?sequelize['cast'](sequelize[_0xb5af('0x15')](_0xb5af('0x13')),_0xb5af('0x16')):_0x26a23e,_0xb5af('0x18')];}});}return _0x214763;};exports['omit']=function(_0x19c1fe,_0xa36dc4){if(_[_0xb5af('0x19')](_0x19c1fe)){return _0x19c1fe;}if(_[_0xb5af('0x1a')](_0x19c1fe)){for(var _0x4bd0e7=0x0;_0x4bd0e7<_0x19c1fe[_0xb5af('0x1b')];_0x4bd0e7+=0x1){_0x19c1fe[_0x4bd0e7]=this[_0xb5af('0x1c')](_0x19c1fe[_0x4bd0e7],_0xa36dc4);}return _0x19c1fe;}if(!_[_0xb5af('0x1d')](_0x19c1fe)){return _0x19c1fe;}if(_[_0xb5af('0x1e')](_0xa36dc4)){_0xa36dc4=[_0xa36dc4];}if(!_['isArray'](_0xa36dc4)){return _0x19c1fe;}for(var _0x224ff6=0x0;_0x224ff6<_0xa36dc4['length'];_0x224ff6+=0x1){_[_0xb5af('0x1f')](_0x19c1fe,_0xa36dc4[_0x224ff6]);}for(var _0x4724a9 in _0x19c1fe){if(_0x19c1fe[_0xb5af('0x20')](_0x4724a9)){_0x19c1fe[_0x4724a9]=this['omit'](_0x19c1fe[_0x4724a9],_0xa36dc4);}}return _0x19c1fe;};exports[_0xb5af('0x21')]=function(_0x21140c){return _0x21140c['match'](RegExp(_0xb5af('0x22')))?!![]:![];};exports['isEmail']=function(_0x228fe8){return _0x228fe8[_0xb5af('0x23')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x25ca26){var _0x27bd48=[];_0x25ca26[_0xb5af('0x3')]('\x20')['forEach'](function(_0x2acc65){_0x27bd48[_0xb5af('0x24')]('+'+_0x2acc65[_0xb5af('0x25')]()+'*');});return _0x27bd48[_0xb5af('0x26')]('\x20');}; \ No newline at end of file +var _0x2c47=['fields','split','filters','isEmpty','type','isPlainObject','parse','$gte','$lte','format','YYYY-MM-DD','utc','subtract','isArray','limit','offset','sort','map','indexOf','priority','cast','DESC','col','unsigned','ASC','length','omit','isObject','isString','hasOwnProperty','match','^[0-9]*$','isEmail','getFullTextValue','forEach','push','toString','lodash','moment'];(function(_0x3d7a9e,_0x1686d7){var _0x28c9b8=function(_0x1c136d){while(--_0x1c136d){_0x3d7a9e['push'](_0x3d7a9e['shift']());}};_0x28c9b8(++_0x1686d7);}(_0x2c47,0xe8));var _0x72c4=function(_0x193943,_0x39550c){_0x193943=_0x193943-0x0;var _0x37ca16=_0x2c47[_0x193943];return _0x37ca16;};'use strict';var _=require(_0x72c4('0x0'));var sequelize=require('sequelize');var moment=require(_0x72c4('0x1'));var LIMIT_VALUE=0xfa;exports[_0x72c4('0x2')]=function(_0x31215d){var _0x428222=null;if(_0x31215d){_0x428222=_0x31215d[_0x72c4('0x3')](',');}return _0x428222;};exports[_0x72c4('0x4')]=function(_0x10bc35,_0x28052e){var _0x37dabc={};if(!_[_0x72c4('0x5')](_0x10bc35)){_['forOwn'](_0x10bc35,function(_0x39bdc9,_0xf22e9c){try{if(_0x28052e){var _0x332f32=_['find'](_0x28052e,{'name':_0xf22e9c})||{};if(_0x332f32[_0x72c4('0x6')]==='DATE'&&_[_0x72c4('0x7')](_0x39bdc9)){var _0x167f79=JSON[_0x72c4('0x8')](_0x39bdc9);var _0x1748e9={'$gte':moment(moment(_0x167f79[_0x72c4('0x9')])['format']('YYYY-MM-DD'))['utc']()['format'](),'$lte':moment(moment(_0x167f79[_0x72c4('0xa')])[_0x72c4('0xb')](_0x72c4('0xc')))[_0x72c4('0xd')]()[_0x72c4('0xe')](0x1,'s')[_0x72c4('0xb')]()};_0x37dabc[_0xf22e9c]=_0x1748e9;}else{_0x37dabc[_0xf22e9c]=_['isArray'](_0x39bdc9)?_0x39bdc9:JSON[_0x72c4('0x8')](_0x39bdc9);}}else{_0x37dabc[_0xf22e9c]=_[_0x72c4('0xf')](_0x39bdc9)?_0x39bdc9:JSON['parse'](_0x39bdc9);}}catch(_0x413df5){_0x37dabc[_0xf22e9c]=_0x39bdc9[_0x72c4('0x3')](',');}});}return _0x37dabc;};exports[_0x72c4('0x10')]=function(_0x34af53){_0x34af53=parseInt(_0x34af53,0xa);if(!_0x34af53||_0x34af53<0x0){_0x34af53=LIMIT_VALUE;}return _0x34af53;};exports[_0x72c4('0x11')]=function(_0x42951a){_0x42951a=parseInt(_0x42951a,0xa);if(!_0x42951a||_0x42951a<0x0){_0x42951a=0x0;}return _0x42951a;};exports[_0x72c4('0x12')]=function(_0x4b4553){var _0x185ff0,_0xfd1876=null;if(_0x4b4553){_0x185ff0=_0x4b4553[_0x72c4('0x3')](',');_0xfd1876=_[_0x72c4('0x13')](_0x185ff0,function(_0x287b61){if(_0x287b61[_0x72c4('0x14')]('-')===0x0){return[_0x287b61===_0x72c4('0x15')?sequelize[_0x72c4('0x16')](sequelize['col'](_0x72c4('0x15')),'unsigned'):_0x287b61['substr'](0x1),_0x72c4('0x17')];}else{return[_0x287b61===_0x72c4('0x15')?sequelize['cast'](sequelize[_0x72c4('0x18')](_0x72c4('0x15')),_0x72c4('0x19')):_0x287b61,_0x72c4('0x1a')];}});}return _0xfd1876;};exports['omit']=function(_0x415619,_0x1c7fce){if(_[_0x72c4('0x5')](_0x415619)){return _0x415619;}if(_[_0x72c4('0xf')](_0x415619)){for(var _0x6475d3=0x0;_0x6475d3<_0x415619[_0x72c4('0x1b')];_0x6475d3+=0x1){_0x415619[_0x6475d3]=this[_0x72c4('0x1c')](_0x415619[_0x6475d3],_0x1c7fce);}return _0x415619;}if(!_[_0x72c4('0x1d')](_0x415619)){return _0x415619;}if(_[_0x72c4('0x1e')](_0x1c7fce)){_0x1c7fce=[_0x1c7fce];}if(!_[_0x72c4('0xf')](_0x1c7fce)){return _0x415619;}for(var _0x3451e=0x0;_0x3451e<_0x1c7fce[_0x72c4('0x1b')];_0x3451e+=0x1){_['unset'](_0x415619,_0x1c7fce[_0x3451e]);}for(var _0x430500 in _0x415619){if(_0x415619[_0x72c4('0x1f')](_0x430500)){_0x415619[_0x430500]=this[_0x72c4('0x1c')](_0x415619[_0x430500],_0x1c7fce);}}return _0x415619;};exports['isNumeric']=function(_0x85d432){return _0x85d432[_0x72c4('0x20')](RegExp(_0x72c4('0x21')))?!![]:![];};exports[_0x72c4('0x22')]=function(_0x1c85bc){return _0x1c85bc[_0x72c4('0x20')](/^\S+@\S+$/)?!![]:![];};exports[_0x72c4('0x23')]=function(_0x44e566){var _0x1dac96=[];_0x44e566[_0x72c4('0x3')]('\x20')[_0x72c4('0x24')](function(_0x47f616){_0x1dac96[_0x72c4('0x25')]('+'+_0x47f616[_0x72c4('0x26')]()+'*');});return _0x1dac96['join']('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 98d0efd..a377b9a 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8562=['get','production','set','appPath','join','root','public','development','test','client','json\x20replacer','toISOString','split','static','engine','html','ejs','view\x20engine','urlencoded','use','50mb','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default'];(function(_0xdbedfa,_0x31fbab){var _0x98145a=function(_0x388ec1){while(--_0x388ec1){_0xdbedfa['push'](_0xdbedfa['shift']());}};_0x98145a(++_0x31fbab);}(_0x8562,0x160));var _0x2856=function(_0x1e007a,_0xc87ffe){_0x1e007a=_0x1e007a-0x0;var _0x3cc6d3=_0x8562[_0x1e007a];return _0x3cc6d3;};'use strict';var express=require(_0x2856('0x0'));var favicon=require(_0x2856('0x1'));var bodyParser=require(_0x2856('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x2856('0x3'));var errorHandler=require(_0x2856('0x4'));var path=require(_0x2856('0x5'));var passport=require('passport');var cors=require(_0x2856('0x6'));var moment=require(_0x2856('0x7'));var config=require(_0x2856('0x8'));var db=require(_0x2856('0x9'))['db'];exports[_0x2856('0xa')]=function(_0x38cc78){var _0x22fa8f=_0x38cc78[_0x2856('0xb')]('env');if(_0x22fa8f===_0x2856('0xc')){_0x38cc78[_0x2856('0xd')](_0x2856('0xe'),path[_0x2856('0xf')](config[_0x2856('0x10')],_0x2856('0x11')));}if(_0x22fa8f===_0x2856('0x12')||_0x22fa8f===_0x2856('0x13')){_0x38cc78[_0x2856('0xd')](_0x2856('0xe'),path['join'](config[_0x2856('0x10')],_0x2856('0x14')));_0x38cc78['use'](errorHandler());}_0x38cc78[_0x2856('0xd')](_0x2856('0x15'),function(_0xd4af03,_0x1ec0ac){if(this[_0xd4af03]instanceof Date){_0x1ec0ac=this[_0xd4af03][_0x2856('0x16')]()[_0x2856('0x17')]('.')[0x0]+'Z';}return _0x1ec0ac;});_0x38cc78['use'](express[_0x2856('0x18')](_0x38cc78[_0x2856('0xb')](_0x2856('0xe'))));_0x38cc78[_0x2856('0xd')]('views',config[_0x2856('0x10')]+'/server/views');_0x38cc78[_0x2856('0x19')](_0x2856('0x1a'),require(_0x2856('0x1b'))['renderFile']);_0x38cc78[_0x2856('0xd')](_0x2856('0x1c'),_0x2856('0x1a'));_0x38cc78['use'](bodyParser[_0x2856('0x1d')]({'limit':'50mb','extended':!![]}));_0x38cc78[_0x2856('0x1e')](bodyParser['json']({'limit':_0x2856('0x1f')}));_0x38cc78[_0x2856('0x1e')](cors());_0x38cc78[_0x2856('0x1e')](methodOverride());_0x38cc78['use'](cookieParser());_0x38cc78[_0x2856('0x1e')](passport[_0x2856('0x20')]());}; \ No newline at end of file +var _0x5fee=['toISOString','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','./environment','../mysqldb','get','set','appPath','join','root','public','development','test','client','use','json\x20replacer'];(function(_0x34a2e0,_0x3a8452){var _0x2d5ac1=function(_0x4aa06a){while(--_0x4aa06a){_0x34a2e0['push'](_0x34a2e0['shift']());}};_0x2d5ac1(++_0x3a8452);}(_0x5fee,0x136));var _0xe5fe=function(_0xbcc69e,_0x2c35ca){_0xbcc69e=_0xbcc69e-0x0;var _0x376392=_0x5fee[_0xbcc69e];return _0x376392;};'use strict';var express=require(_0xe5fe('0x0'));var favicon=require(_0xe5fe('0x1'));var bodyParser=require(_0xe5fe('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0xe5fe('0x3'));var errorHandler=require(_0xe5fe('0x4'));var path=require(_0xe5fe('0x5'));var passport=require(_0xe5fe('0x6'));var cors=require('cors');var moment=require('moment');var config=require(_0xe5fe('0x7'));var db=require(_0xe5fe('0x8'))['db'];exports['default']=function(_0xf4a3e0){var _0x9c77bd=_0xf4a3e0[_0xe5fe('0x9')]('env');if(_0x9c77bd==='production'){_0xf4a3e0[_0xe5fe('0xa')](_0xe5fe('0xb'),path[_0xe5fe('0xc')](config[_0xe5fe('0xd')],_0xe5fe('0xe')));}if(_0x9c77bd===_0xe5fe('0xf')||_0x9c77bd===_0xe5fe('0x10')){_0xf4a3e0[_0xe5fe('0xa')]('appPath',path[_0xe5fe('0xc')](config[_0xe5fe('0xd')],_0xe5fe('0x11')));_0xf4a3e0[_0xe5fe('0x12')](errorHandler());}_0xf4a3e0['set'](_0xe5fe('0x13'),function(_0x257126,_0x258e86){if(this[_0x257126]instanceof Date){_0x258e86=this[_0x257126][_0xe5fe('0x14')]()['split']('.')[0x0]+'Z';}return _0x258e86;});_0xf4a3e0[_0xe5fe('0x12')](express[_0xe5fe('0x15')](_0xf4a3e0[_0xe5fe('0x9')](_0xe5fe('0xb'))));_0xf4a3e0['set'](_0xe5fe('0x16'),config[_0xe5fe('0xd')]+_0xe5fe('0x17'));_0xf4a3e0[_0xe5fe('0x18')](_0xe5fe('0x19'),require(_0xe5fe('0x1a'))[_0xe5fe('0x1b')]);_0xf4a3e0['set'](_0xe5fe('0x1c'),_0xe5fe('0x19'));_0xf4a3e0[_0xe5fe('0x12')](bodyParser[_0xe5fe('0x1d')]({'limit':_0xe5fe('0x1e'),'extended':!![]}));_0xf4a3e0[_0xe5fe('0x12')](bodyParser[_0xe5fe('0x1f')]({'limit':_0xe5fe('0x1e')}));_0xf4a3e0[_0xe5fe('0x12')](cors());_0xf4a3e0['use'](methodOverride());_0xf4a3e0['use'](cookieParser());_0xf4a3e0['use'](passport[_0xe5fe('0x20')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index fdb980a..e0526df 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 _0x85d0=['mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','map','join','createHash','md5','update','hex','getUuid','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','digest','substring','execSync','networkInterfaces','orderBy','filter','IPv4','internal','concat','head'];(function(_0x2ab254,_0x1b2760){var _0x249f7f=function(_0x48b2fe){while(--_0x48b2fe){_0x2ab254['push'](_0x2ab254['shift']());}};_0x249f7f(++_0x1b2760);}(_0x85d0,0x164));var _0x085d=function(_0x59d933,_0x394044){_0x59d933=_0x59d933-0x0;var _0x2308e4=_0x85d0[_0x59d933];return _0x2308e4;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x085d('0x0')];function getInterfaces(){var _0x1716e5=[];var _0xfd8773=os[_0x085d('0x1')]();var _0x231765=_[_0x085d('0x2')](_['keys'](_0xfd8773));for(var _0x2f37ca=0x0;_0x2f37ca<_0x231765['length'];_0x2f37ca++){var _0x364f09=_0xfd8773[_0x231765[_0x2f37ca]][_0x085d('0x3')](function(_0x2a6902){return _0x2a6902['family']===_0x085d('0x4')&&_0x2a6902[_0x085d('0x5')]===![];});_0x1716e5=_0x1716e5[_0x085d('0x6')](_0x364f09);}return _0x1716e5;}function getFirstInterface(){var _0x3129a8=_[_0x085d('0x7')](getInterfaces());return{'macAddress':_0x3129a8&&_0x3129a8[_0x085d('0x8')]?_0x3129a8[_0x085d('0x8')]:_0x085d('0x9'),'ipAddress':_0x3129a8&&_0x3129a8[_0x085d('0xa')]?_0x3129a8['address']:_0x085d('0xb')};}exports[_0x085d('0xc')]=getFirstInterface;function getCPUhash(){var _0x3e6416=_[_0x085d('0x2')](os['cpus']()[_0x085d('0xd')](function(_0x2bd6ae){return _0x2bd6ae['model'];}))[_0x085d('0xe')](':');return crypto[_0x085d('0xf')](_0x085d('0x10'))[_0x085d('0x11')](_0x3e6416)['digest'](_0x085d('0x12'));}exports[_0x085d('0x13')]=function(){switch(os['platform']()){case'win32':return exec(_0x085d('0x14'),{'encoding':_0x085d('0x15')})[_0x085d('0x16')]('\x0d\x0a','');default:var _0x5f8e18=getFirstInterface();var _0x309c15=getCPUhash();var _0x5ed56a=_0x309c15+'|'+os[_0x085d('0x17')]()+'|'+_0x5f8e18[_0x085d('0x18')]+'|'+_0x5f8e18[_0x085d('0x19')];var _0x1b0a6c=crypto[_0x085d('0xf')](_0x085d('0x10'))[_0x085d('0x11')](_0x5ed56a)[_0x085d('0x1a')](_0x085d('0x12'));return _0x1b0a6c['substring'](0x0,0x8)+'-'+_0x1b0a6c[_0x085d('0x1b')](0x8,0xc)+'-'+_0x1b0a6c[_0x085d('0x1b')](0xc,0x10)+'-'+_0x1b0a6c[_0x085d('0x1b')](0x10,0x14)+'-'+_0x1b0a6c[_0x085d('0x1b')](0x14);}}; \ No newline at end of file +var _0x07d7=['model','join','createHash','update','hex','getUuid','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','internal','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07d7,0x85));var _0x707d=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x07d7[_0x534c8f];return _0x5a57f5;};'use strict';var _=require(_0x707d('0x0'));var os=require('os');var crypto=require(_0x707d('0x1'));var machine=require(_0x707d('0x2'));var exec=require(_0x707d('0x3'))[_0x707d('0x4')];function getInterfaces(){var _0x38a92e=[];var _0x100f39=os[_0x707d('0x5')]();var _0x38c520=_[_0x707d('0x6')](_[_0x707d('0x7')](_0x100f39));for(var _0x16cc4a=0x0;_0x16cc4a<_0x38c520[_0x707d('0x8')];_0x16cc4a++){var _0x1456bd=_0x100f39[_0x38c520[_0x16cc4a]][_0x707d('0x9')](function(_0x13df54){return _0x13df54['family']==='IPv4'&&_0x13df54[_0x707d('0xa')]===![];});_0x38a92e=_0x38a92e[_0x707d('0xb')](_0x1456bd);}return _0x38a92e;}function getFirstInterface(){var _0x375e87=_[_0x707d('0xc')](getInterfaces());return{'macAddress':_0x375e87&&_0x375e87[_0x707d('0xd')]?_0x375e87['mac']:_0x707d('0xe'),'ipAddress':_0x375e87&&_0x375e87[_0x707d('0xf')]?_0x375e87[_0x707d('0xf')]:'127.0.0.1'};}exports[_0x707d('0x10')]=getFirstInterface;function getCPUhash(){var _0x355ce4=_[_0x707d('0x6')](os['cpus']()['map'](function(_0x5aabfe){return _0x5aabfe[_0x707d('0x11')];}))[_0x707d('0x12')](':');return crypto[_0x707d('0x13')]('md5')[_0x707d('0x14')](_0x355ce4)['digest'](_0x707d('0x15'));}exports[_0x707d('0x16')]=function(){switch(os['platform']()){case'win32':return exec(_0x707d('0x17'),{'encoding':'utf8'})[_0x707d('0x18')]('\x0d\x0a','');default:var _0x2c63c9=getFirstInterface();var _0xeed67d=getCPUhash();var _0x1f4f0e=_0xeed67d+'|'+os[_0x707d('0x19')]()+'|'+_0x2c63c9[_0x707d('0x1a')]+'|'+_0x2c63c9[_0x707d('0x1b')];var _0x50869d=crypto[_0x707d('0x13')](_0x707d('0x1c'))[_0x707d('0x14')](_0x1f4f0e)['digest'](_0x707d('0x15'));return _0x50869d[_0x707d('0x1d')](0x0,0x8)+'-'+_0x50869d[_0x707d('0x1d')](0x8,0xc)+'-'+_0x50869d[_0x707d('0x1d')](0xc,0x10)+'-'+_0x50869d[_0x707d('0x1d')](0x10,0x14)+'-'+_0x50869d[_0x707d('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 9084011..df80e14 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 _0x8921=['|email|','getFirstInterface','ipAddress','openIssue','Motion\x20License\x20Alert','Alert','get','active','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','data1','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../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','GET','then','catch','createCipher','aes-256-ctr','secrets','update','utf8','base64','createDecipher','session','||FIELD||VALUE||\x0a','findOne','admin','fullname','email','|uuid|','|machineUuid|'];(function(_0x1ae441,_0x5160e2){var _0x47b62c=function(_0x51f1a7){while(--_0x51f1a7){_0x1ae441['push'](_0x1ae441['shift']());}};_0x47b62c(++_0x5160e2);}(_0x8921,0x9a));var _0x1892=function(_0x1a62be,_0x2be462){_0x1a62be=_0x1a62be-0x0;var _0x356dd9=_0x8921[_0x1a62be];return _0x356dd9;};'use strict';var util=require(_0x1892('0x0'));var crypto=require('crypto');var moment=require(_0x1892('0x1'));var rp=require(_0x1892('0x2'));var BPromise=require(_0x1892('0x3'));var pkginfo=require(_0x1892('0x4'))(module,_0x1892('0x5'));var db=require(_0x1892('0x6'))['db'];var config=require(_0x1892('0x7'));var hardware=require(_0x1892('0x8'));var logger=require(_0x1892('0x9'))(_0x1892('0xa'));var jira=require(_0x1892('0xb'));var HOST=_0x1892('0xc');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x504741){return new BPromise(function(_0xfe2155,_0x6a2604){var _0x2db820=util[_0x1892('0xd')](_0x1892('0xe'),HOST,_0x504741,module[_0x1892('0xf')]['version']);if(oldToken){_0x2db820=util[_0x1892('0xd')](_0x1892('0x10'),HOST,_0x504741,module[_0x1892('0xf')][_0x1892('0x5')],oldToken);}var _0x1efeed={'uri':_0x2db820,'method':_0x1892('0x11'),'timeout':0xea60,'json':!![]};return rp(_0x1efeed)[_0x1892('0x12')](function(_0x531383){_0xfe2155(_0x531383);})[_0x1892('0x13')](function(_0x22baab){_0x6a2604(_0x22baab);});});}function encryptDate(_0xe5ef78){var _0x5b8534=crypto[_0x1892('0x14')](_0x1892('0x15'),config[_0x1892('0x16')]['session']);var _0x474d22=_0x5b8534[_0x1892('0x17')](_0xe5ef78,_0x1892('0x18'),_0x1892('0x19'));_0x474d22+=_0x5b8534['final']('base64');return _0x474d22;}function decryptDate(_0x934968){var _0x4b15ec=crypto[_0x1892('0x1a')]('aes-256-ctr',config[_0x1892('0x16')][_0x1892('0x1b')]);var _0x237451=_0x4b15ec[_0x1892('0x17')](_0x934968,_0x1892('0x19'),'utf8');_0x237451+=_0x4b15ec['final'](_0x1892('0x18'));return _0x237451;}function sendJiraAlert(_0x49937d,_0x437502,_0x5f29b5){var _0x11c2e6=_0x1892('0x1c');return db['User'][_0x1892('0x1d')]({'where':{'role':_0x1892('0x1e')},'attributes':[_0x1892('0x1f'),_0x1892('0x20')],'raw':!![]})['then'](function(_0x53f24c){ADMIN=_0x53f24c;_0x11c2e6+='|reason|'+_0x5f29b5+'|\x0a';_0x11c2e6+=_0x1892('0x21')+_0x49937d+'|\x0a';_0x11c2e6+=_0x1892('0x22')+_0x437502+'|\x0a';_0x11c2e6+='|name|'+ADMIN[_0x1892('0x1f')]+'|\x0a';_0x11c2e6+=_0x1892('0x23')+ADMIN[_0x1892('0x20')]+'|\x0a';return _0x11c2e6;})[_0x1892('0x12')](function(_0x53e3bf){var _0xff60d4=hardware[_0x1892('0x24')]()[_0x1892('0x25')];return jira[_0x1892('0x26')]({'key':'MOTLICENSE','summary':_0x1892('0x27'),'description':_0x53e3bf,'issuetype':_0x1892('0x28'),'oldToken':_0x49937d,'newToken':_0x437502,'email':ADMIN[_0x1892('0x20')],'name':ADMIN[_0x1892('0x1f')],'reason':GRAY_PERIOD_REASON,'ip':_0xff60d4});});}function manageLicense(_0x296c45,_0x11275b){var _0x8b09dc=_0x11275b[_0x1892('0x29')]({'plain':!![]});httpRequest(_0x296c45)[_0x1892('0x12')](function(_0x2c3465){if(oldToken){oldToken=undefined;}if(_0x2c3465[_0x1892('0x2a')]){if(!_0x8b09dc['license']&&_0x8b09dc[_0x1892('0xa')]!=_0x2c3465[_0x1892('0xa')]||_0x8b09dc['license']&&_0x8b09dc[_0x1892('0x2b')]){logger['info'](_0x1892('0x2c'));}if(_0x8b09dc[_0x1892('0xa')]&&!_0x8b09dc[_0x1892('0x2b')]&&_0x8b09dc[_0x1892('0xa')]!=_0x2c3465[_0x1892('0xa')]){logger['info'](_0x1892('0x2d'));}if(_0x8b09dc[_0x1892('0xa')]&&!_0x8b09dc[_0x1892('0x2b')]&&_0x8b09dc[_0x1892('0xa')]==_0x2c3465[_0x1892('0xa')]){return _0x11275b;}return _0x11275b[_0x1892('0x17')]({'data1':_0x296c45,'data2':null,'license':_0x2c3465[_0x1892('0xa')]});}else{if(_0x2c3465[_0x1892('0xa')]||_0x8b09dc[_0x1892('0xa')]){if(!_0x8b09dc['data2']){if(_0x8b09dc['data1']==_0x296c45){GRAY_PERIOD_REASON='Disabled';logger[_0x1892('0x2e')](_0x1892('0x2f'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x8b09dc['data1'];logger[_0x1892('0x2e')](_0x1892('0x30'),_0x8b09dc['data1'],_0x296c45);}sendJiraAlert(_0x8b09dc[_0x1892('0x31')],_0x2c3465[_0x1892('0x32')],GRAY_PERIOD_REASON);logger[_0x1892('0x2e')](_0x1892('0x33'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1892('0xd')](_0x1892('0x34')));return _0x11275b['update']({'data2':encryptDate(moment()[_0x1892('0xd')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](decryptDate(_0x8b09dc[_0x1892('0x2b')]),_0x1892('0x35'))>DAYS){logger['info'](_0x1892('0x36'),moment()[_0x1892('0xd')](_0x1892('0x34')));return _0x11275b[_0x1892('0x17')]({'data1':_0x296c45,'data2':null,'license':null});}}}else{if(_0x8b09dc[_0x1892('0x31')]!=_0x296c45){logger[_0x1892('0x2e')](_0x1892('0x30'),_0x8b09dc[_0x1892('0x31')],_0x296c45);return _0x11275b[_0x1892('0x17')]({'data1':_0x296c45,'data2':null,'license':null});}}}return _0x11275b;})[_0x1892('0x12')](function(_0x4974f7){_0x11275b=_0x4974f7;})[_0x1892('0x13')](function(_0x7524c2){logger[_0x1892('0x37')](_0x7524c2['message']);})[_0x1892('0x38')](function(){setTimeout(function(){manageLicense(hardware[_0x1892('0x39')](),_0x11275b);},TIME);});}function defaultLicense(){var _0x36a9f4=hardware[_0x1892('0x39')]();if(_0x36a9f4){return db['License'][_0x1892('0x3a')]({'where':{'id':0x1},'defaults':{'data1':_0x36a9f4}})[_0x1892('0x3b')](function(_0x128faf,_0x2208ba){logger[_0x1892('0x2e')](_0x1892('0x3c'),_0x36a9f4);manageLicense(_0x36a9f4,_0x128faf);})[_0x1892('0x13')](function(_0x89e8d5){logger[_0x1892('0x37')](_0x89e8d5[_0x1892('0x3d')]);});}}exports[_0x1892('0x3e')]=defaultLicense; \ No newline at end of file +var _0x8383=['||FIELD||VALUE||\x0a','findOne','admin','fullname','email','|uuid|','|name|','|email|','getFirstInterface','openIssue','Motion\x20License\x20Alert','Alert','get','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','Disabled','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','format','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','secrets','update','utf8','base64','final','createDecipher','aes-256-ctr'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8383,0x98));var _0x3838=function(_0x598d43,_0x58e247){_0x598d43=_0x598d43-0x0;var _0x489488=_0x8383[_0x598d43];return _0x489488;};'use strict';var util=require(_0x3838('0x0'));var crypto=require('crypto');var moment=require('moment');var rp=require(_0x3838('0x1'));var BPromise=require(_0x3838('0x2'));var pkginfo=require(_0x3838('0x3'))(module,_0x3838('0x4'));var db=require(_0x3838('0x5'))['db'];var config=require(_0x3838('0x6'));var hardware=require(_0x3838('0x7'));var logger=require(_0x3838('0x8'))(_0x3838('0x9'));var jira=require(_0x3838('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x239750){return new BPromise(function(_0x235001,_0x4cf52b){var _0x2abbda=util['format'](_0x3838('0xb'),HOST,_0x239750,module[_0x3838('0xc')][_0x3838('0x4')]);if(oldToken){_0x2abbda=util['format'](_0x3838('0xd'),HOST,_0x239750,module[_0x3838('0xc')][_0x3838('0x4')],oldToken);}var _0x545100={'uri':_0x2abbda,'method':_0x3838('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x545100)[_0x3838('0xf')](function(_0x9161a2){_0x235001(_0x9161a2);})[_0x3838('0x10')](function(_0x5f33d5){_0x4cf52b(_0x5f33d5);});});}function encryptDate(_0x3572d6){var _0x276d98=crypto[_0x3838('0x11')]('aes-256-ctr',config[_0x3838('0x12')]['session']);var _0x38e779=_0x276d98[_0x3838('0x13')](_0x3572d6,_0x3838('0x14'),_0x3838('0x15'));_0x38e779+=_0x276d98[_0x3838('0x16')]('base64');return _0x38e779;}function decryptDate(_0x284ec1){var _0xb4bf82=crypto[_0x3838('0x17')](_0x3838('0x18'),config[_0x3838('0x12')]['session']);var _0x464fd9=_0xb4bf82[_0x3838('0x13')](_0x284ec1,_0x3838('0x15'),'utf8');_0x464fd9+=_0xb4bf82[_0x3838('0x16')](_0x3838('0x14'));return _0x464fd9;}function sendJiraAlert(_0x4a9a7a,_0xf69d52,_0x2fe3c8){var _0x50c9a1=_0x3838('0x19');return db['User'][_0x3838('0x1a')]({'where':{'role':_0x3838('0x1b')},'attributes':[_0x3838('0x1c'),_0x3838('0x1d')],'raw':!![]})[_0x3838('0xf')](function(_0x58175e){ADMIN=_0x58175e;_0x50c9a1+='|reason|'+_0x2fe3c8+'|\x0a';_0x50c9a1+=_0x3838('0x1e')+_0x4a9a7a+'|\x0a';_0x50c9a1+='|machineUuid|'+_0xf69d52+'|\x0a';_0x50c9a1+=_0x3838('0x1f')+ADMIN[_0x3838('0x1c')]+'|\x0a';_0x50c9a1+=_0x3838('0x20')+ADMIN[_0x3838('0x1d')]+'|\x0a';return _0x50c9a1;})[_0x3838('0xf')](function(_0x30e98f){var _0xbd0fd1=hardware[_0x3838('0x21')]()['ipAddress'];return jira[_0x3838('0x22')]({'key':'MOTLICENSE','summary':_0x3838('0x23'),'description':_0x30e98f,'issuetype':_0x3838('0x24'),'oldToken':_0x4a9a7a,'newToken':_0xf69d52,'email':ADMIN['email'],'name':ADMIN[_0x3838('0x1c')],'reason':GRAY_PERIOD_REASON,'ip':_0xbd0fd1});});}function manageLicense(_0x265099,_0x5b181a){var _0x12cf42=_0x5b181a[_0x3838('0x25')]({'plain':!![]});httpRequest(_0x265099)['then'](function(_0x1754b2){if(oldToken){oldToken=undefined;}if(_0x1754b2['active']){if(!_0x12cf42[_0x3838('0x9')]&&_0x12cf42['license']!=_0x1754b2['license']||_0x12cf42[_0x3838('0x9')]&&_0x12cf42[_0x3838('0x26')]){logger[_0x3838('0x27')](_0x3838('0x28'));}if(_0x12cf42[_0x3838('0x9')]&&!_0x12cf42['data2']&&_0x12cf42[_0x3838('0x9')]!=_0x1754b2[_0x3838('0x9')]){logger[_0x3838('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x12cf42[_0x3838('0x9')]&&!_0x12cf42['data2']&&_0x12cf42[_0x3838('0x9')]==_0x1754b2['license']){return _0x5b181a;}return _0x5b181a[_0x3838('0x13')]({'data1':_0x265099,'data2':null,'license':_0x1754b2[_0x3838('0x9')]});}else{if(_0x1754b2['license']||_0x12cf42[_0x3838('0x9')]){if(!_0x12cf42['data2']){if(_0x12cf42['data1']==_0x265099){GRAY_PERIOD_REASON=_0x3838('0x29');logger[_0x3838('0x27')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x12cf42[_0x3838('0x2a')];logger['info'](_0x3838('0x2b'),_0x12cf42[_0x3838('0x2a')],_0x265099);}sendJiraAlert(_0x12cf42[_0x3838('0x2a')],_0x1754b2[_0x3838('0x2c')],GRAY_PERIOD_REASON);logger[_0x3838('0x27')](_0x3838('0x2d'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x3838('0x2e')](_0x3838('0x2f')));return _0x5b181a[_0x3838('0x13')]({'data2':encryptDate(moment()[_0x3838('0x2e')](_0x3838('0x2f')))});}else{if(moment()[_0x3838('0x30')](decryptDate(_0x12cf42[_0x3838('0x26')]),_0x3838('0x31'))>DAYS){logger[_0x3838('0x27')](_0x3838('0x32'),moment()[_0x3838('0x2e')]('YYYY-MM-DD\x20HH:mm'));return _0x5b181a[_0x3838('0x13')]({'data1':_0x265099,'data2':null,'license':null});}}}else{if(_0x12cf42[_0x3838('0x2a')]!=_0x265099){logger[_0x3838('0x27')](_0x3838('0x2b'),_0x12cf42['data1'],_0x265099);return _0x5b181a[_0x3838('0x13')]({'data1':_0x265099,'data2':null,'license':null});}}}return _0x5b181a;})[_0x3838('0xf')](function(_0x23b711){_0x5b181a=_0x23b711;})[_0x3838('0x10')](function(_0x4d727c){logger[_0x3838('0x33')](_0x4d727c[_0x3838('0x34')]);})[_0x3838('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x3838('0x36')](),_0x5b181a);},TIME);});}function defaultLicense(){var _0x5ea658=hardware[_0x3838('0x36')]();if(_0x5ea658){return db[_0x3838('0x37')][_0x3838('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x5ea658}})['spread'](function(_0x5b3383,_0x403078){logger[_0x3838('0x27')](_0x3838('0x39'),_0x5ea658);manageLicense(_0x5ea658,_0x5b3383);})[_0x3838('0x10')](function(_0x341588){logger[_0x3838('0x33')](_0x341588[_0x3838('0x34')]);});}}exports[_0x3838('0x3a')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2e1b75a..406f332 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 _0xb077=['isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','demo','machineUuid','aes-256-ctr','secrets','gray','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','getLicense','License','find','defaults','then','util','moment','./hardware','../environment','license'];(function(_0x4a9eda,_0x525466){var _0x368cc5=function(_0x3a35a2){while(--_0x3a35a2){_0x4a9eda['push'](_0x4a9eda['shift']());}};_0x368cc5(++_0x525466);}(_0xb077,0x7f));var _0x7b07=function(_0x10ad66,_0x41c0e2){_0x10ad66=_0x10ad66-0x0;var _0x2a9450=_0xb077[_0x10ad66];return _0x2a9450;};'use strict';var crypto=require('crypto');var util=require(_0x7b07('0x0'));var _=require('lodash');var moment=require(_0x7b07('0x1'));var hardware=require(_0x7b07('0x2'));var config=require(_0x7b07('0x3'));var db=require('../../mysqldb')['db'];function checkLicense(_0x1ee381,_0x172d7b){if(_0x1ee381){try{var _0x1d3bd5=_0x172d7b||_0x1ee381[_0x7b07('0x4')];if(_[_0x7b07('0x5')](_0x1d3bd5)){throw new Error(_0x7b07('0x6'));}var _0x517d64=_0x1ee381[_0x7b07('0x7')];var _0x2ee183=_0x1ee381[_0x7b07('0x8')];var _0x44ffee=_0x517d64[_0x7b07('0x9')]('-')[0x4];var _0x289d26=_0x517d64[_0x7b07('0x9')]('-')[0x0];var _0x5a6ed8=crypto[_0x7b07('0xa')]('aes-256-ctr',util[_0x7b07('0xb')](_0x7b07('0xc'),_0x44ffee,_0x517d64,_0x289d26));var _0x55cd79=_0x5a6ed8[_0x7b07('0xd')](_0x1d3bd5,_0x7b07('0xe'),_0x7b07('0xf'));_0x55cd79+=_0x5a6ed8[_0x7b07('0x10')](_0x7b07('0xf'));var _0x371b7f=JSON['parse'](_0x55cd79);_0x371b7f[_0x7b07('0x11')]=![];_0x371b7f['uuid']=_0x517d64;_0x371b7f[_0x7b07('0x12')]=hardware['getUuid']();if(_0x2ee183){var _0x2a9c1f=crypto[_0x7b07('0xa')](_0x7b07('0x13'),config[_0x7b07('0x14')]['session']);var _0x57f247=_0x2a9c1f[_0x7b07('0xd')](_0x2ee183,'base64',_0x7b07('0xf'));_0x57f247+=_0x2a9c1f[_0x7b07('0x10')]('utf8');_0x371b7f[_0x7b07('0x15')]=_0x57f247;_0x371b7f['deadline']=moment(_0x57f247)['add'](0x7,'days')['format']();_0x371b7f[_0x7b07('0x16')]=_0x371b7f['uuid']!=_0x371b7f[_0x7b07('0x12')]?_0x7b07('0x17'):_0x7b07('0x18');}return _0x371b7f;}catch(_0xef65fc){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7b07('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7b07('0x1a'),'uuid':_0x1ee381[_0x7b07('0x7')],'machineUuid':hardware[_0x7b07('0x1b')](),'message':_0xef65fc['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7b07('0x19'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x1ee381[_0x7b07('0x7')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x7b07('0x1c')]=function(_0x59dbee){return db[_0x7b07('0x1d')][_0x7b07('0x1e')](_[_0x7b07('0x1f')](_0x59dbee,{'raw':!![],'where':{'id':0x1}}))[_0x7b07('0x20')](function(_0xdbbd95){return checkLicense(_0xdbbd95,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x1ed0=['base64','gray','deadline','days','uuid','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','getLicense','License','find','defaults','then','crypto','util','lodash','./hardware','../environment','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','demo','machineUuid','getUuid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1ed0,0x103));var _0x01ed=function(_0x52d7df,_0x5d5742){_0x52d7df=_0x52d7df-0x0;var _0x6163fc=_0x1ed0[_0x52d7df];return _0x6163fc;};'use strict';var crypto=require(_0x01ed('0x0'));var util=require(_0x01ed('0x1'));var _=require(_0x01ed('0x2'));var moment=require('moment');var hardware=require(_0x01ed('0x3'));var config=require(_0x01ed('0x4'));var db=require(_0x01ed('0x5'))['db'];function checkLicense(_0x2ce2ee,_0x52f4dc){if(_0x2ce2ee){try{var _0xbc3fbe=_0x52f4dc||_0x2ce2ee[_0x01ed('0x6')];if(_[_0x01ed('0x7')](_0xbc3fbe)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xf2ca2c=_0x2ce2ee[_0x01ed('0x8')];var _0x3b5450=_0x2ce2ee[_0x01ed('0x9')];var _0x41f68c=_0xf2ca2c['split']('-')[0x4];var _0x3cd055=_0xf2ca2c[_0x01ed('0xa')]('-')[0x0];var _0x35db8c=crypto[_0x01ed('0xb')](_0x01ed('0xc'),util[_0x01ed('0xd')](_0x01ed('0xe'),_0x41f68c,_0xf2ca2c,_0x3cd055));var _0x56482c=_0x35db8c[_0x01ed('0xf')](_0xbc3fbe,'base64',_0x01ed('0x10'));_0x56482c+=_0x35db8c[_0x01ed('0x11')](_0x01ed('0x10'));var _0x157ad6=JSON['parse'](_0x56482c);_0x157ad6[_0x01ed('0x12')]=![];_0x157ad6['uuid']=_0xf2ca2c;_0x157ad6[_0x01ed('0x13')]=hardware[_0x01ed('0x14')]();if(_0x3b5450){var _0x2762e4=crypto[_0x01ed('0xb')](_0x01ed('0xc'),config['secrets']['session']);var _0xff842f=_0x2762e4['update'](_0x3b5450,_0x01ed('0x15'),_0x01ed('0x10'));_0xff842f+=_0x2762e4[_0x01ed('0x11')]('utf8');_0x157ad6[_0x01ed('0x16')]=_0xff842f;_0x157ad6[_0x01ed('0x17')]=moment(_0xff842f)['add'](0x7,_0x01ed('0x18'))[_0x01ed('0xd')]();_0x157ad6['grayReason']=_0x157ad6[_0x01ed('0x19')]!=_0x157ad6[_0x01ed('0x13')]?'changed':_0x01ed('0x1a');}return _0x157ad6;}catch(_0x174116){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x01ed('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x01ed('0x1c'),'uuid':_0x2ce2ee[_0x01ed('0x8')],'machineUuid':hardware[_0x01ed('0x14')](),'message':_0x174116[_0x01ed('0x1d')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x01ed('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x2ce2ee[_0x01ed('0x8')],'machineUuid':hardware[_0x01ed('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x01ed('0x1e')]=function(_0x2478a9){return db[_0x01ed('0x1f')][_0x01ed('0x20')](_[_0x01ed('0x21')](_0x2478a9,{'raw':!![],'where':{'id':0x1}}))[_0x01ed('0x22')](function(_0x48e5b4){return checkLicense(_0x48e5b4,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index f18d1d6..135c701 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 _0xf223=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x4a874e,_0x5e710a){var _0x52ae67=function(_0x361f94){while(--_0x361f94){_0x4a874e['push'](_0x4a874e['shift']());}};_0x52ae67(++_0x5e710a);}(_0xf223,0xc3));var _0x3f22=function(_0xde4664,_0x20a792){_0xde4664=_0xde4664-0x0;var _0x4758d9=_0xf223[_0xde4664];return _0x4758d9;};'use strict';module[_0x3f22('0x0')]={'DOMAIN':_0x3f22('0x1'),'SESSION_SECRET':_0x3f22('0x2'),'GOOGLE_ID':_0x3f22('0x3'),'GOOGLE_SECRET':_0x3f22('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x7957=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x424144,_0x580e1f){var _0x1841b7=function(_0xd18c39){while(--_0xd18c39){_0x424144['push'](_0x424144['shift']());}};_0x1841b7(++_0x580e1f);}(_0x7957,0x8b));var _0x7795=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x7957[_0x1992f1];return _0x413dfe;};'use strict';module[_0x7795('0x0')]={'DOMAIN':_0x7795('0x1'),'SESSION_SECRET':_0x7795('0x2'),'GOOGLE_ID':_0x7795('0x3'),'GOOGLE_SECRET':_0x7795('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 8bde251..b5812eb 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80bd=['path','INFO','join','/var','log','xcally','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','exports','Logger','error','File','%s-%s','info','Console','env','winston'];(function(_0x4bec13,_0x1e3d64){var _0x2ed4a4=function(_0xc22617){while(--_0xc22617){_0x4bec13['push'](_0x4bec13['shift']());}};_0x2ed4a4(++_0x1e3d64);}(_0x80bd,0x14f));var _0xd80b=function(_0x1af46c,_0x3d28a9){_0x1af46c=_0x1af46c-0x0;var _0x2a8972=_0x80bd[_0x1af46c];return _0x2a8972;};'use strict';var moment=require('moment');var winston=require(_0xd80b('0x0'));var util=require('util');var path=require(_0xd80b('0x1'));var debugLevel=_0xd80b('0x2');function filename(_0x22df08,_0x30addd){return path[_0xd80b('0x3')](_0xd80b('0x4'),_0xd80b('0x5'),_0xd80b('0x6'),util['format'](_0xd80b('0x7'),_0x22df08,_0x30addd));}function formatter(_0xa574be,_0x5eced9){return util['format'](_0xd80b('0x8'),moment()[_0xd80b('0x9')](_0xd80b('0xa')),_0x5eced9[_0xd80b('0xb')][_0xd80b('0xc')](),_0xa574be,_0x5eced9['message']);}module[_0xd80b('0xd')]=function(_0x379af8){return new winston[(_0xd80b('0xe'))]({'transports':[new winston['transports']['File']({'name':util[_0xd80b('0x9')]('%s-%s',_0x379af8,'error'),'filename':filename(_0x379af8,'error'),'level':_0xd80b('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x37aee7){return formatter(_0x379af8,_0x37aee7);}}),new winston['transports'][(_0xd80b('0x10'))]({'name':util['format'](_0xd80b('0x11'),_0x379af8,_0xd80b('0x12')),'filename':filename(_0x379af8,'info'),'level':_0xd80b('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ce593){return formatter(_0x379af8,_0x2ce593);}}),new winston['transports'][(_0xd80b('0x13'))]({'level':process[_0xd80b('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x321424){return formatter(_0x379af8,_0x321424);}})]});}; \ No newline at end of file +var _0x2350=['message','exports','Logger','transports','File','%s-%s','error','info','Console','env','moment','path','INFO','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase'];(function(_0x11efff,_0x16c4c2){var _0x466108=function(_0x41f580){while(--_0x41f580){_0x11efff['push'](_0x11efff['shift']());}};_0x466108(++_0x16c4c2);}(_0x2350,0x106));var _0x0235=function(_0x5d6e30,_0xc21d51){_0x5d6e30=_0x5d6e30-0x0;var _0x3d3f3b=_0x2350[_0x5d6e30];return _0x3d3f3b;};'use strict';var moment=require(_0x0235('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x0235('0x1'));var debugLevel=_0x0235('0x2');function filename(_0x20a716,_0x52568d){return path[_0x0235('0x3')](_0x0235('0x4'),_0x0235('0x5'),_0x0235('0x6'),util[_0x0235('0x7')](_0x0235('0x8'),_0x20a716,_0x52568d));}function formatter(_0x34b2ba,_0x330cb4){return util[_0x0235('0x7')](_0x0235('0x9'),moment()[_0x0235('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x330cb4['level'][_0x0235('0xa')](),_0x34b2ba,_0x330cb4[_0x0235('0xb')]);}module[_0x0235('0xc')]=function(_0x9fc3df){return new winston[(_0x0235('0xd'))]({'transports':[new winston[(_0x0235('0xe'))][(_0x0235('0xf'))]({'name':util['format'](_0x0235('0x10'),_0x9fc3df,_0x0235('0x11')),'filename':filename(_0x9fc3df,_0x0235('0x11')),'level':_0x0235('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x16ce4d){return formatter(_0x9fc3df,_0x16ce4d);}}),new winston['transports'][(_0x0235('0xf'))]({'name':util[_0x0235('0x7')]('%s-%s',_0x9fc3df,_0x0235('0x12')),'filename':filename(_0x9fc3df,_0x0235('0x12')),'level':_0x0235('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ebbf2){return formatter(_0x9fc3df,_0x1ebbf2);}}),new winston[(_0x0235('0xe'))][(_0x0235('0x13'))]({'level':process[_0x0235('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x5181d8){return formatter(_0x9fc3df,_0x5181d8);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index bc996df..a5d359f 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 _0xb70c=['express','join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path'];(function(_0x5f12fd,_0x33c70d){var _0x58bd80=function(_0x515f56){while(--_0x515f56){_0x5f12fd['push'](_0x5f12fd['shift']());}};_0x58bd80(++_0x33c70d);}(_0xb70c,0x1e0));var _0xcb70=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0xb70c[_0x36884e];return _0x1cc367;};'use strict';var path=require(_0xcb70('0x0'));var os=require('os');var config={'apps':[{'name':_0xcb70('0x1'),'script':path[_0xcb70('0x2')](__dirname,_0xcb70('0x3'))},{'name':'ami','script':path[_0xcb70('0x2')](__dirname,_0xcb70('0x4'))},{'name':_0xcb70('0x5'),'script':path[_0xcb70('0x2')](__dirname,_0xcb70('0x6'))},{'name':_0xcb70('0x7'),'script':path[_0xcb70('0x2')](__dirname,_0xcb70('0x8'))},{'name':_0xcb70('0x9'),'script':path[_0xcb70('0x2')](__dirname,_0xcb70('0xa'))},{'name':_0xcb70('0xb'),'script':path[_0xcb70('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xcb70('0xc')]=config; \ No newline at end of file +var _0xbdb0=['ami','../../services/ami/index.js','agi','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x8dd519,_0x2f5484){var _0x267c69=function(_0x181b42){while(--_0x181b42){_0x8dd519['push'](_0x8dd519['shift']());}};_0x267c69(++_0x2f5484);}(_0xbdb0,0x189));var _0x0bdb=function(_0x26efac,_0x21ab8a){_0x26efac=_0x26efac-0x0;var _0x8482e4=_0xbdb0[_0x26efac];return _0x8482e4;};'use strict';var path=require(_0x0bdb('0x0'));var os=require('os');var config={'apps':[{'name':_0x0bdb('0x1'),'script':path[_0x0bdb('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x0bdb('0x3'),'script':path[_0x0bdb('0x2')](__dirname,_0x0bdb('0x4'))},{'name':_0x0bdb('0x5'),'script':path[_0x0bdb('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x0bdb('0x6'),'script':path['join'](__dirname,_0x0bdb('0x7'))},{'name':'routing','script':path[_0x0bdb('0x2')](__dirname,_0x0bdb('0x8'))},{'name':_0x0bdb('0x9'),'script':path[_0x0bdb('0x2')](__dirname,_0x0bdb('0xa'))}]};module[_0x0bdb('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index f2e9be1..8b47e1d 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 _0x9b69=['start','disconnect','stop','then','restart','delete','dump','pm2','bluebird','./config','connect','connected'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9b69,0xa3));var _0x99b6=function(_0x30dacb,_0xaa7f96){_0x30dacb=_0x30dacb-0x0;var _0x5082bd=_0x9b69[_0x30dacb];return _0x5082bd;};'use strict';var pm2=require(_0x99b6('0x0'));var BPromise=require(_0x99b6('0x1'));var config=require(_0x99b6('0x2'));function connect(){return new BPromise(function(_0x47c0a9,_0x4d20c1){return pm2[_0x99b6('0x3')](function(_0x5608e8){if(_0x5608e8){return _0x4d20c1(_0x5608e8);}return _0x47c0a9(_0x99b6('0x4'));});});};exports[_0x99b6('0x5')]=function(_0x293e09){return connect()['then'](function(){return new BPromise(function(_0x45628a,_0x5c4062){return pm2[_0x99b6('0x5')](_0x293e09,function(_0x319215,_0x3d96ae){if(_0x319215){return _0x5c4062(_0x319215);}pm2[_0x99b6('0x6')]();return _0x45628a(_0x3d96ae);});});});};exports[_0x99b6('0x7')]=function(_0x1d188d){return connect()[_0x99b6('0x8')](function(){return new BPromise(function(_0x29cda9,_0x1e8826){return pm2[_0x99b6('0x7')](_0x1d188d,function(_0x3081f5,_0x3f2d8e){if(_0x3081f5){return _0x1e8826(_0x3081f5);}pm2[_0x99b6('0x6')]();return _0x29cda9(_0x3f2d8e);});});});};exports[_0x99b6('0x9')]=function(_0x1bc2d3){return connect()[_0x99b6('0x8')](function(){return new BPromise(function(_0x409539,_0xb5b1da){return pm2[_0x99b6('0x9')](_0x1bc2d3,function(_0x245c3f,_0x48a408){if(_0x245c3f){return _0xb5b1da(_0x245c3f);}pm2['disconnect']();return _0x409539(_0x48a408);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x57033e,_0x565e9e){return pm2['list'](function(_0x172f35,_0x184e90){if(_0x172f35){return _0x565e9e(_0x172f35);}pm2[_0x99b6('0x6')]();return _0x57033e(_0x184e90);});});});};exports['describe']=function(_0xb63749){return connect()[_0x99b6('0x8')](function(){return new BPromise(function(_0x70b3f5,_0x417e9a){return pm2['describe'](_0xb63749,function(_0x433b59,_0x52a4da){if(_0x433b59){return _0x417e9a(_0x433b59);}pm2[_0x99b6('0x6')]();return _0x70b3f5(_0x52a4da);});});});};exports[_0x99b6('0xa')]=function(_0x453735){return connect()[_0x99b6('0x8')](function(){return new BPromise(function(_0x1a6436,_0x4cb2e7){return pm2[_0x99b6('0xa')](_0x453735,function(_0x547488,_0x25dc6a){if(_0x547488){return _0x4cb2e7(_0x547488);}pm2[_0x99b6('0x6')]();return _0x1a6436(_0x25dc6a);});});});};exports[_0x99b6('0xb')]=function(){return connect()[_0x99b6('0x8')](function(){return new BPromise(function(_0x34476d,_0xc65470){return pm2[_0x99b6('0xb')](function(_0x59045f){if(_0x59045f){return _0xc65470(_0x59045f);}return _0x34476d('saved');});});});}; \ No newline at end of file +var _0x3975=['describe','delete','dump','saved','pm2','bluebird','connected','then','start','disconnect','stop','restart','list'];(function(_0x168fd3,_0x11fbbd){var _0x47f2b7=function(_0x5971ed){while(--_0x5971ed){_0x168fd3['push'](_0x168fd3['shift']());}};_0x47f2b7(++_0x11fbbd);}(_0x3975,0x197));var _0x5397=function(_0x5d6986,_0x597309){_0x5d6986=_0x5d6986-0x0;var _0x26f74e=_0x3975[_0x5d6986];return _0x26f74e;};'use strict';var pm2=require(_0x5397('0x0'));var BPromise=require(_0x5397('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x30e982,_0x5d2737){return pm2['connect'](function(_0xee7ee0){if(_0xee7ee0){return _0x5d2737(_0xee7ee0);}return _0x30e982(_0x5397('0x2'));});});};exports['start']=function(_0x428db9){return connect()[_0x5397('0x3')](function(){return new BPromise(function(_0xff755e,_0xda67de){return pm2[_0x5397('0x4')](_0x428db9,function(_0x286060,_0x3a85a0){if(_0x286060){return _0xda67de(_0x286060);}pm2[_0x5397('0x5')]();return _0xff755e(_0x3a85a0);});});});};exports[_0x5397('0x6')]=function(_0x49876f){return connect()['then'](function(){return new BPromise(function(_0xb99845,_0x5ef45b){return pm2[_0x5397('0x6')](_0x49876f,function(_0x49383a,_0x1168b4){if(_0x49383a){return _0x5ef45b(_0x49383a);}pm2[_0x5397('0x5')]();return _0xb99845(_0x1168b4);});});});};exports[_0x5397('0x7')]=function(_0x16af62){return connect()[_0x5397('0x3')](function(){return new BPromise(function(_0x31f1e8,_0x17d74f){return pm2[_0x5397('0x7')](_0x16af62,function(_0x299397,_0x2aaea6){if(_0x299397){return _0x17d74f(_0x299397);}pm2[_0x5397('0x5')]();return _0x31f1e8(_0x2aaea6);});});});};exports['list']=function(){return connect()[_0x5397('0x3')](function(){return new BPromise(function(_0x197490,_0x5dff91){return pm2[_0x5397('0x8')](function(_0x4e8bed,_0x299ea1){if(_0x4e8bed){return _0x5dff91(_0x4e8bed);}pm2[_0x5397('0x5')]();return _0x197490(_0x299ea1);});});});};exports['describe']=function(_0x13d561){return connect()[_0x5397('0x3')](function(){return new BPromise(function(_0x2c9c59,_0x520116){return pm2[_0x5397('0x9')](_0x13d561,function(_0x41ca45,_0x1972bc){if(_0x41ca45){return _0x520116(_0x41ca45);}pm2[_0x5397('0x5')]();return _0x2c9c59(_0x1972bc);});});});};exports[_0x5397('0xa')]=function(_0x3bd11f){return connect()['then'](function(){return new BPromise(function(_0x27d330,_0x954aa9){return pm2[_0x5397('0xa')](_0x3bd11f,function(_0x8a6940,_0x4f975b){if(_0x8a6940){return _0x954aa9(_0x8a6940);}pm2[_0x5397('0x5')]();return _0x27d330(_0x4f975b);});});});};exports[_0x5397('0xb')]=function(){return connect()[_0x5397('0x3')](function(){return new BPromise(function(_0x2ba432,_0x5b79e1){return pm2[_0x5397('0xb')](function(_0x2c5a5f){if(_0x2c5a5f){return _0x5b79e1(_0x2c5a5f);}return _0x2ba432(_0x5397('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index c9c2a13..39d4335 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 _0xc524=['../../mysqldb','../../config/environment','redis','defaults','socket.io-emitter','Setting','chatTimeout','ChatInteraction','findAll','subtract','then','update','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','start','moment'];(function(_0x3301df,_0x586e4d){var _0x265ab0=function(_0x124ae9){while(--_0x124ae9){_0x3301df['push'](_0x3301df['shift']());}};_0x265ab0(++_0x586e4d);}(_0xc524,0x12b));var _0x4c52=function(_0x838bb6,_0x250612){_0x838bb6=_0x838bb6-0x0;var _0xc3daf1=_0xc524[_0x838bb6];return _0xc3daf1;};'use strict';var _=require('lodash');var moment=require(_0x4c52('0x0'));var Redis=require('ioredis');var db=require(_0x4c52('0x1'))['db'];var config=require(_0x4c52('0x2'));config[_0x4c52('0x3')]=_[_0x4c52('0x4')](config[_0x4c52('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x4c52('0x5'))(new Redis(config[_0x4c52('0x3')]));function closeInteractions(){var _0x526db9=0x0;var _0x2d60a6=[];return db[_0x4c52('0x6')]['find']({'raw':!![],'attributes':['id',_0x4c52('0x7')],'where':{'id':0x1}})['then'](function(_0x155c10){_0x526db9=_0x155c10[_0x4c52('0x7')];if(_0x526db9){return db[_0x4c52('0x8')][_0x4c52('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4c52('0xa')](_0x155c10['chatTimeout'],'minutes')}}});}else{return[];}})[_0x4c52('0xb')](function(_0x2fdf27){_0x2d60a6=_0x2fdf27;if(_0x526db9){return db[_0x4c52('0x8')][_0x4c52('0xc')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x4c52('0xd')](_0x4c52('0xe'))},{'where':{'id':_[_0x4c52('0xf')](_0x2d60a6||[],'id')}});}})[_0x4c52('0xb')](function(_0x280cad){for(var _0x425682=0x0;_0x425682<_0x2d60a6[_0x4c52('0x10')];_0x425682++){io[_0x4c52('0x11')]('chatInteraction:update',{'id':_0x2d60a6[_0x425682]['id'],'closed':!![]});}})[_0x4c52('0x12')](function(_0x57538a){console['error'](_0x57538a);});}exports[_0x4c52('0x13')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x180e=['lastMsgAt','subtract','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','emit','catch','start','moment','ioredis','redis','localhost','socket.io-emitter','Setting','find','then','chatTimeout','ChatInteraction','findAll'];(function(_0x44b5ed,_0x2ed256){var _0x26edab=function(_0x5536c3){while(--_0x5536c3){_0x44b5ed['push'](_0x44b5ed['shift']());}};_0x26edab(++_0x2ed256);}(_0x180e,0x121));var _0xe180=function(_0x2e0bed,_0x24b28d){_0x2e0bed=_0x2e0bed-0x0;var _0x45e74e=_0x180e[_0x2e0bed];return _0x45e74e;};'use strict';var _=require('lodash');var moment=require(_0xe180('0x0'));var Redis=require(_0xe180('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');config[_0xe180('0x2')]=_['defaults'](config[_0xe180('0x2')],{'host':_0xe180('0x3'),'port':0x18eb});var io=require(_0xe180('0x4'))(new Redis(config['redis']));function closeInteractions(){var _0x1d6622=0x0;var _0x4e0051=[];return db[_0xe180('0x5')][_0xe180('0x6')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xe180('0x7')](function(_0x2b9a61){_0x1d6622=_0x2b9a61[_0xe180('0x8')];if(_0x1d6622){return db[_0xe180('0x9')][_0xe180('0xa')]({'raw':!![],'attributes':['id',_0xe180('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xe180('0xc')](_0x2b9a61[_0xe180('0x8')],'minutes')}}});}else{return[];}})['then'](function(_0x1f53a7){_0x4e0051=_0x1f53a7;if(_0x1d6622){return db[_0xe180('0x9')]['update']({'closeReason':'system','disposition':_0xe180('0xd'),'closed':!![],'closedAt':moment()[_0xe180('0xe')](_0xe180('0xf'))},{'where':{'id':_[_0xe180('0x10')](_0x4e0051||[],'id')}});}})['then'](function(_0x243f26){for(var _0x3a06e6=0x0;_0x3a06e6<_0x4e0051['length'];_0x3a06e6++){io[_0xe180('0x11')]('chatInteraction:update',{'id':_0x4e0051[_0x3a06e6]['id'],'closed':!![]});}})[_0xe180('0x12')](function(_0x598c69){console['error'](_0x598c69);});}exports[_0xe180('0x13')]=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 2d0ada2..838a563 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 _0x2453=['existsSync','status','Sent','attachments','message','text','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','email\x20sent','catch','error\x20mail','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','run','util','lodash','cron-job-manager','jayson/promise','bluebird','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip'];(function(_0x1bdb13,_0x42b7fd){var _0x383fec=function(_0x2cf823){while(--_0x2cf823){_0x1bdb13['push'](_0x1bdb13['shift']());}};_0x383fec(++_0x42b7fd);}(_0x2453,0x8d));var _0x3245=function(_0x441509,_0x19c4fc){_0x441509=_0x441509-0x0;var _0x48c70b=_0x2453[_0x441509];return _0x48c70b;};'use strict';var fs=require('fs');var util=require(_0x3245('0x0'));var path=require('path');var _=require(_0x3245('0x1'));var moment=require('moment');var CronJobManager=require(_0x3245('0x2'));var jayson=require(_0x3245('0x3'));var BPromise=require(_0x3245('0x4'));var logger=require('../logger')(_0x3245('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x3245('0x6'));var client=jayson[_0x3245('0x7')][_0x3245('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3ee53b,_0x1a9bfd){return function(){logger[_0x3245('0x9')](_0x3245('0xa'),_0x3ee53b[_0x3245('0xb')]);var _0x96d2de=!![];var _0x4968db={'tls':{'rejectUnauthorized':![]}};if(_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')]['service']){_0x4968db['service']=_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')][_0x3245('0xe')];}else{_0x4968db[_0x3245('0xf')]=_0x3ee53b['MailAccount'][_0x3245('0xd')]['host'];_0x4968db[_0x3245('0x10')]=_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')][_0x3245('0x10')];_0x4968db['secure']=_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')][_0x3245('0x11')];}if(_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')][_0x3245('0x12')]){_0x4968db['auth']={'user':_0x3ee53b[_0x3245('0xc')]['Smtp'][_0x3245('0x13')],'pass':_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')][_0x3245('0x14')]};}var _0x2215d9={'account':_0x4968db,'message':{'from':util[_0x3245('0x15')](_0x3245('0x16'),_0x3ee53b[_0x3245('0xc')][_0x3245('0x17')],_0x3ee53b['MailAccount'][_0x3245('0xb')]||_0x3ee53b[_0x3245('0xc')][_0x3245('0xd')][_0x3245('0x13')]),'to':_0x3ee53b[_0x3245('0xb')],'cc':_0x3ee53b['cc'],'bcc':_0x3ee53b[_0x3245('0x18')],'subject':util[_0x3245('0x15')](_0x3245('0x19'),_0x1a9bfd['name'],_0x3ee53b[_0x3245('0x1a')],_0x3ee53b[_0x3245('0x1b')])}};var _0x525292=path[_0x3245('0x1c')](__dirname,_0x3245('0x1d'));var _0x3d79d8=_0x1a9bfd[_0x3245('0x1e')];var _0x3379d1=util[_0x3245('0x15')](_0x3245('0x1f'),path[_0x3245('0x20')](_0x1a9bfd[_0x3245('0x1e')],path[_0x3245('0x21')](_0x1a9bfd[_0x3245('0x1e')])),_0x3245('0x22'));var _0x493991=path[_0x3245('0x1c')](_0x525292,_0x3d79d8);var _0x49b754=path[_0x3245('0x1c')](_0x525292,_0x3379d1);if(fs[_0x3245('0x23')](_0x493991)){_0x1a9bfd[_0x3245('0x24')]=_0x3245('0x25');_0x2215d9['message'][_0x3245('0x26')]=[{'filename':_0x3d79d8,'path':_0x493991}];_0x2215d9[_0x3245('0x27')][_0x3245('0x28')]=util[_0x3245('0x15')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x3245('0x29')](_0x1a9bfd,null,0x2));}else if(fs[_0x3245('0x23')](_0x49b754)){_0x1a9bfd['status']=_0x3245('0x25');_0x2215d9[_0x3245('0x27')][_0x3245('0x26')]=[{'filename':_0x3379d1,'path':_0x49b754}];}else{_0x2215d9['message'][_0x3245('0x28')]=_0x3245('0x2a');if(!_0x3ee53b['sendIfEmpty']){_0x96d2de=![];logger[_0x3245('0x9')](_0x3245('0x2b'));}}if(_0x96d2de){return client['request'](_0x3245('0x2c'),_0x2215d9)[_0x3245('0x2d')](function(_0x18418c){if(_0x18418c[_0x3245('0x2e')]){return logger[_0x3245('0x2e')]('error\x20mail',JSON[_0x3245('0x29')](_0x18418c));}return logger[_0x3245('0x9')](_0x3245('0x2f'));})[_0x3245('0x30')](function(_0x2a8b32){return logger[_0x3245('0x2e')](_0x3245('0x31'),JSON[_0x3245('0x29')](_0x2a8b32));});}};}function handleError(){return function(_0x3dffb6){return logger['error'](JSON[_0x3245('0x29')](_0x3dffb6));};}function handleResult(_0x32a00a){return function(_0x5f22bf){logger[_0x3245('0x9')](_0x3245('0x32'),JSON[_0x3245('0x29')](_0x5f22bf));if(_0x32a00a[_0x3245('0xc')]&&_0x32a00a[_0x3245('0xc')][_0x3245('0xd')]&&!_['isNil'](_0x32a00a['email'])){setTimeout(handleSendEmail(_0x32a00a,_0x5f22bf),0x3c*0x3e8);}};}function handleJob(_0x4f0174){return function(){try{if(_[_0x3245('0x33')](_0x4f0174[_0x3245('0x1a')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x3245('0x33')](_0x4f0174[_0x3245('0x1b')])){return logger[_0x3245('0x9')](_0x3245('0x34'));}var _0x5d9bdf={'startDate':moment()[_0x3245('0x35')](_0x4f0174[_0x3245('0x1a')],_0x4f0174[_0x3245('0x1b')])[_0x3245('0x15')](_0x3245('0x36')),'endDate':moment()[_0x3245('0x15')](_0x3245('0x36')),'type':_0x3245('0x37'),'output':_0x4f0174[_0x3245('0x38')],'name':_0x4f0174[_0x3245('0x17')]};if(!_[_0x3245('0x33')](_0x4f0174[_0x3245('0x39')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x4f0174[_0x3245('0x39')]);return analyticDefaultReportController[_0x3245('0x3a')]({'id':_0x4f0174[_0x3245('0x39')]},_0x5d9bdf)['then'](handleResult(_0x4f0174))[_0x3245('0x30')](handleError());}if(!_[_0x3245('0x33')](_0x4f0174[_0x3245('0x3b')])){logger['info'](_0x3245('0x3c'),_0x4f0174['CustomReportId']);return analyticCustomReportController[_0x3245('0x3a')]({'id':_0x4f0174[_0x3245('0x3b')]},_0x5d9bdf)[_0x3245('0x2d')](handleResult(_0x4f0174))['catch'](handleError());}}catch(_0x40d0bb){logger[_0x3245('0x2e')](JSON[_0x3245('0x29')](_0x40d0bb));}return logger[_0x3245('0x9')](_0x3245('0x3d'));};}function getJobs(_0x335ee4){var _0x5304b6={};if(_0x335ee4){_0x5304b6['id']=_0x335ee4;}return db[_0x3245('0x3e')][_0x3245('0x3f')]({'where':_0x5304b6,'include':[{'model':db[_0x3245('0xc')],'attributes':['id',_0x3245('0x17'),_0x3245('0xb')],'include':[{'model':db['MailServerOut'],'as':_0x3245('0xd')}]}]})[_0x3245('0x2d')](function(_0x3cceeb){var _0x5e1bf9=_[_0x3245('0x40')](manager['jobs']);var _0x39f919=_[_0x3245('0x41')](_0x3cceeb,function(_0xea3cc4){return _0xea3cc4['id']['toString']();});var _0x2c84f0=_['keyBy'](_0x3cceeb,function(_0x3c40fc){return _0x3c40fc['id'][_0x3245('0x42')]();});var _0xb4409e=_0x335ee4?_0x39f919:_[_0x3245('0x43')](_0x39f919,_0x5e1bf9);var _0x50663d=_[_0x3245('0x44')](_0x39f919,_0x5e1bf9);var _0x16cb5f=_['difference'](_0x5e1bf9,_0x39f919);var _0x29d661;var _0x4fac0e;for(_0x29d661=0x0;_0x29d661<_0x16cb5f[_0x3245('0x45')]&&!_0x335ee4;_0x29d661+=0x1){_0x4fac0e=_0x16cb5f[_0x29d661][_0x3245('0x42')]();if(manager[_0x3245('0x46')](_0x4fac0e)){manager[_0x3245('0x47')](_0x4fac0e);manager[_0x3245('0x48')](_0x4fac0e);logger[_0x3245('0x9')](_0x3245('0x49'),_0x4fac0e);}}logger[_0x3245('0x9')](_0x3245('0x4a'),JSON['stringify'](_0xb4409e));for(_0x29d661=0x0;_0x29d661<_0xb4409e[_0x3245('0x45')];_0x29d661+=0x1){_0x4fac0e=_0xb4409e[_0x29d661][_0x3245('0x42')]();logger[_0x3245('0x9')](_0x3245('0x4b'),_0x4fac0e);if(_0x335ee4){logger['info'](_0x3245('0x4c'),_0x335ee4);logger['info'](JSON[_0x3245('0x29')](_0x2c84f0[_0x4fac0e]));BPromise['resolve']()[_0x3245('0x2d')](handleJob(_0x2c84f0[_0x4fac0e]));logger[_0x3245('0x9')](_0x3245('0x4d'),_0x2c84f0[_0x4fac0e][_0x3245('0x17')],_0x2c84f0[_0x4fac0e][_0x3245('0x4e')]);}else if(_0x2c84f0[_0x4fac0e]['cron']&&_0x2c84f0[_0x4fac0e][_0x3245('0x4f')]&&moment()[_0x3245('0x50')](_0x2c84f0[_0x4fac0e][_0x3245('0x51')],_0x2c84f0[_0x4fac0e][_0x3245('0x52')])){manager[_0x3245('0x53')](_0x4fac0e,_0x2c84f0[_0x4fac0e]['cron'],handleJob(_0x2c84f0[_0x4fac0e]));manager[_0x3245('0x54')](_0x4fac0e);logger[_0x3245('0x9')](_0x3245('0x55'),_0x2c84f0[_0x4fac0e][_0x3245('0x17')],_0x2c84f0[_0x4fac0e][_0x3245('0x4e')]);}else if(manager['exists'](_0x4fac0e)){manager[_0x3245('0x47')](_0x4fac0e);manager[_0x3245('0x48')](_0x4fac0e);logger[_0x3245('0x9')]('stop\x20cron',_0x2c84f0[_0x4fac0e][_0x3245('0x17')],_0x2c84f0[_0x4fac0e][_0x3245('0x4e')]);}}for(_0x29d661=0x0,_0x4fac0e;_0x29d661<_0x50663d[_0x3245('0x45')]&&!_0x335ee4;_0x29d661+=0x1){_0x4fac0e=_0x50663d[_0x29d661][_0x3245('0x42')]();if(manager[_0x3245('0x46')](_0x4fac0e)){if(_0x2c84f0[_0x4fac0e][_0x3245('0x4e')]&&_0x2c84f0[_0x4fac0e][_0x3245('0x4f')]&&moment()['isBetween'](_0x2c84f0[_0x4fac0e][_0x3245('0x51')],_0x2c84f0[_0x4fac0e]['endAt'])){manager['update'](_0x4fac0e,_0x2c84f0[_0x4fac0e][_0x3245('0x4e')],handleJob(_0x2c84f0[_0x4fac0e]));logger[_0x3245('0x9')]('update\x20cron',_0x2c84f0[_0x4fac0e][_0x3245('0x17')],_0x2c84f0[_0x4fac0e][_0x3245('0x4e')]);}else{manager[_0x3245('0x47')](_0x4fac0e);manager[_0x3245('0x48')](_0x4fac0e);logger[_0x3245('0x9')](_0x3245('0x56'),_0x2c84f0[_0x4fac0e][_0x3245('0x17')],_0x2c84f0[_0x4fac0e][_0x3245('0x4e')]);}}}})[_0x3245('0x30')](function(_0x104865){logger[_0x3245('0x2e')](JSON[_0x3245('0x29')](_0x104865));});}exports[_0x3245('0x57')]=function(_0x10eef9){return getJobs(_0x10eef9);};exports[_0x3245('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x05cb=['auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Sent','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','catch','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','then','no\x20report\x20id','Schedule','findAll','MailServerOut','toString','keyBy','difference','length','stop','deleteJob','delete\x20cron','toRun','index','resolve','cron','active','startAt','endAt','add','start','add\x20cron','stop\x20cron','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','MailAccount','service','Smtp','host','port','secure','authentication'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x05cb,0x1f2));var _0xb05c=function(_0x11f300,_0xf1fb97){_0x11f300=_0x11f300-0x0;var _0x2ef990=_0x05cb[_0x11f300];return _0x2ef990;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xb05c('0x0'));var _=require('lodash');var moment=require(_0xb05c('0x1'));var CronJobManager=require(_0xb05c('0x2'));var jayson=require(_0xb05c('0x3'));var BPromise=require(_0xb05c('0x4'));var logger=require(_0xb05c('0x5'))('schedule');var db=require(_0xb05c('0x6'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xb05c('0x7'));var client=jayson[_0xb05c('0x8')][_0xb05c('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3dbd44,_0x24e42e){return function(){logger[_0xb05c('0xa')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x3dbd44['email']);var _0x48fef4=!![];var _0xba330e={'tls':{'rejectUnauthorized':![]}};if(_0x3dbd44[_0xb05c('0xb')]['Smtp'][_0xb05c('0xc')]){_0xba330e[_0xb05c('0xc')]=_0x3dbd44[_0xb05c('0xb')][_0xb05c('0xd')]['service'];}else{_0xba330e[_0xb05c('0xe')]=_0x3dbd44['MailAccount'][_0xb05c('0xd')][_0xb05c('0xe')];_0xba330e['port']=_0x3dbd44['MailAccount'][_0xb05c('0xd')][_0xb05c('0xf')];_0xba330e[_0xb05c('0x10')]=_0x3dbd44['MailAccount']['Smtp'][_0xb05c('0x10')];}if(_0x3dbd44[_0xb05c('0xb')][_0xb05c('0xd')][_0xb05c('0x11')]){_0xba330e[_0xb05c('0x12')]={'user':_0x3dbd44[_0xb05c('0xb')][_0xb05c('0xd')][_0xb05c('0x13')],'pass':_0x3dbd44[_0xb05c('0xb')][_0xb05c('0xd')][_0xb05c('0x14')]};}var _0x519905={'account':_0xba330e,'message':{'from':util[_0xb05c('0x15')](_0xb05c('0x16'),_0x3dbd44['MailAccount'][_0xb05c('0x17')],_0x3dbd44[_0xb05c('0xb')][_0xb05c('0x18')]||_0x3dbd44['MailAccount'][_0xb05c('0xd')][_0xb05c('0x13')]),'to':_0x3dbd44[_0xb05c('0x18')],'cc':_0x3dbd44['cc'],'bcc':_0x3dbd44[_0xb05c('0x19')],'subject':util[_0xb05c('0x15')]('Report\x20%s\x20last\x20%s\x20%s',_0x24e42e[_0xb05c('0x17')],_0x3dbd44['subtractNumber'],_0x3dbd44[_0xb05c('0x1a')])}};var _0x3a90b0=path[_0xb05c('0x1b')](__dirname,_0xb05c('0x1c'));var _0x10ceef=_0x24e42e[_0xb05c('0x1d')];var _0x427c68=util[_0xb05c('0x15')](_0xb05c('0x1e'),path[_0xb05c('0x1f')](_0x24e42e[_0xb05c('0x1d')],path[_0xb05c('0x20')](_0x24e42e['savename'])),'zip');var _0x7334fe=path[_0xb05c('0x1b')](_0x3a90b0,_0x10ceef);var _0x22121c=path[_0xb05c('0x1b')](_0x3a90b0,_0x427c68);if(fs[_0xb05c('0x21')](_0x7334fe)){_0x24e42e[_0xb05c('0x22')]='Sent';_0x519905[_0xb05c('0x23')]['attachments']=[{'filename':_0x10ceef,'path':_0x7334fe}];_0x519905[_0xb05c('0x23')][_0xb05c('0x24')]=util['format'](_0xb05c('0x25'),JSON[_0xb05c('0x26')](_0x24e42e,null,0x2));}else if(fs[_0xb05c('0x21')](_0x22121c)){_0x24e42e[_0xb05c('0x22')]=_0xb05c('0x27');_0x519905[_0xb05c('0x23')][_0xb05c('0x28')]=[{'filename':_0x427c68,'path':_0x22121c}];}else{_0x519905['message'][_0xb05c('0x24')]=_0xb05c('0x29');if(!_0x3dbd44[_0xb05c('0x2a')]){_0x48fef4=![];logger[_0xb05c('0xa')](_0xb05c('0x2b'));}}if(_0x48fef4){return client[_0xb05c('0x2c')](_0xb05c('0x2d'),_0x519905)['then'](function(_0x51f090){if(_0x51f090[_0xb05c('0x2e')]){return logger[_0xb05c('0x2e')]('error\x20mail',JSON['stringify'](_0x51f090));}return logger[_0xb05c('0xa')]('email\x20sent');})[_0xb05c('0x2f')](function(_0xc27630){return logger['error'](_0xb05c('0x30'),JSON[_0xb05c('0x26')](_0xc27630));});}};}function handleError(){return function(_0x45c0be){return logger[_0xb05c('0x2e')](JSON[_0xb05c('0x26')](_0x45c0be));};}function handleResult(_0x44600a){return function(_0x49e393){logger['info'](_0xb05c('0x31'),JSON[_0xb05c('0x26')](_0x49e393));if(_0x44600a[_0xb05c('0xb')]&&_0x44600a[_0xb05c('0xb')][_0xb05c('0xd')]&&!_['isNil'](_0x44600a[_0xb05c('0x18')])){setTimeout(handleSendEmail(_0x44600a,_0x49e393),0x3c*0x3e8);}};}function handleJob(_0x921ead){return function(){try{if(_[_0xb05c('0x32')](_0x921ead[_0xb05c('0x33')])){return logger['info'](_0xb05c('0x34'));}if(_[_0xb05c('0x32')](_0x921ead['subtractUnit'])){return logger[_0xb05c('0xa')](_0xb05c('0x35'));}var _0x342721={'startDate':moment()[_0xb05c('0x36')](_0x921ead[_0xb05c('0x33')],_0x921ead['subtractUnit'])['format']('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xb05c('0x15')](_0xb05c('0x37')),'type':_0xb05c('0x38'),'output':_0x921ead[_0xb05c('0x39')],'name':_0x921ead[_0xb05c('0x17')]};if(!_[_0xb05c('0x32')](_0x921ead[_0xb05c('0x3a')])){logger[_0xb05c('0xa')](_0xb05c('0x3b'),_0x921ead['DefaultReportId']);return analyticDefaultReportController[_0xb05c('0x3c')]({'id':_0x921ead[_0xb05c('0x3a')]},_0x342721)['then'](handleResult(_0x921ead))[_0xb05c('0x2f')](handleError());}if(!_[_0xb05c('0x32')](_0x921ead[_0xb05c('0x3d')])){logger[_0xb05c('0xa')](_0xb05c('0x3e'),_0x921ead[_0xb05c('0x3d')]);return analyticCustomReportController[_0xb05c('0x3c')]({'id':_0x921ead['CustomReportId']},_0x342721)[_0xb05c('0x3f')](handleResult(_0x921ead))['catch'](handleError());}}catch(_0x50caff){logger[_0xb05c('0x2e')](JSON[_0xb05c('0x26')](_0x50caff));}return logger[_0xb05c('0xa')](_0xb05c('0x40'));};}function getJobs(_0x2180a1){var _0x2cf0b7={};if(_0x2180a1){_0x2cf0b7['id']=_0x2180a1;}return db[_0xb05c('0x41')][_0xb05c('0x42')]({'where':_0x2cf0b7,'include':[{'model':db[_0xb05c('0xb')],'attributes':['id','name',_0xb05c('0x18')],'include':[{'model':db[_0xb05c('0x43')],'as':_0xb05c('0xd')}]}]})[_0xb05c('0x3f')](function(_0x3f1390){var _0x4d2ce0=_['keys'](manager['jobs']);var _0x4e4dbc=_['map'](_0x3f1390,function(_0x52dae3){return _0x52dae3['id'][_0xb05c('0x44')]();});var _0x27341b=_[_0xb05c('0x45')](_0x3f1390,function(_0x5d7cfe){return _0x5d7cfe['id'][_0xb05c('0x44')]();});var _0x56ad1b=_0x2180a1?_0x4e4dbc:_[_0xb05c('0x46')](_0x4e4dbc,_0x4d2ce0);var _0x64568c=_['intersection'](_0x4e4dbc,_0x4d2ce0);var _0x1d7713=_[_0xb05c('0x46')](_0x4d2ce0,_0x4e4dbc);var _0x39cdde;var _0x1ba508;for(_0x39cdde=0x0;_0x39cdde<_0x1d7713[_0xb05c('0x47')]&&!_0x2180a1;_0x39cdde+=0x1){_0x1ba508=_0x1d7713[_0x39cdde][_0xb05c('0x44')]();if(manager['exists'](_0x1ba508)){manager[_0xb05c('0x48')](_0x1ba508);manager[_0xb05c('0x49')](_0x1ba508);logger[_0xb05c('0xa')](_0xb05c('0x4a'),_0x1ba508);}}logger['info'](_0xb05c('0x4b'),JSON[_0xb05c('0x26')](_0x56ad1b));for(_0x39cdde=0x0;_0x39cdde<_0x56ad1b[_0xb05c('0x47')];_0x39cdde+=0x1){_0x1ba508=_0x56ad1b[_0x39cdde][_0xb05c('0x44')]();logger[_0xb05c('0xa')](_0xb05c('0x4c'),_0x1ba508);if(_0x2180a1){logger[_0xb05c('0xa')]('my\x20id',_0x2180a1);logger[_0xb05c('0xa')](JSON['stringify'](_0x27341b[_0x1ba508]));BPromise[_0xb05c('0x4d')]()[_0xb05c('0x3f')](handleJob(_0x27341b[_0x1ba508]));logger[_0xb05c('0xa')]('run\x20job',_0x27341b[_0x1ba508][_0xb05c('0x17')],_0x27341b[_0x1ba508][_0xb05c('0x4e')]);}else if(_0x27341b[_0x1ba508]['cron']&&_0x27341b[_0x1ba508][_0xb05c('0x4f')]&&moment()['isBetween'](_0x27341b[_0x1ba508][_0xb05c('0x50')],_0x27341b[_0x1ba508][_0xb05c('0x51')])){manager[_0xb05c('0x52')](_0x1ba508,_0x27341b[_0x1ba508][_0xb05c('0x4e')],handleJob(_0x27341b[_0x1ba508]));manager[_0xb05c('0x53')](_0x1ba508);logger[_0xb05c('0xa')](_0xb05c('0x54'),_0x27341b[_0x1ba508][_0xb05c('0x17')],_0x27341b[_0x1ba508][_0xb05c('0x4e')]);}else if(manager['exists'](_0x1ba508)){manager[_0xb05c('0x48')](_0x1ba508);manager['deleteJob'](_0x1ba508);logger['info'](_0xb05c('0x55'),_0x27341b[_0x1ba508][_0xb05c('0x17')],_0x27341b[_0x1ba508]['cron']);}}for(_0x39cdde=0x0,_0x1ba508;_0x39cdde<_0x64568c['length']&&!_0x2180a1;_0x39cdde+=0x1){_0x1ba508=_0x64568c[_0x39cdde][_0xb05c('0x44')]();if(manager['exists'](_0x1ba508)){if(_0x27341b[_0x1ba508][_0xb05c('0x4e')]&&_0x27341b[_0x1ba508][_0xb05c('0x4f')]&&moment()['isBetween'](_0x27341b[_0x1ba508][_0xb05c('0x50')],_0x27341b[_0x1ba508][_0xb05c('0x51')])){manager['update'](_0x1ba508,_0x27341b[_0x1ba508][_0xb05c('0x4e')],handleJob(_0x27341b[_0x1ba508]));logger['info']('update\x20cron',_0x27341b[_0x1ba508][_0xb05c('0x17')],_0x27341b[_0x1ba508]['cron']);}else{manager[_0xb05c('0x48')](_0x1ba508);manager[_0xb05c('0x49')](_0x1ba508);logger[_0xb05c('0xa')]('stop\x20cron',_0x27341b[_0x1ba508][_0xb05c('0x17')],_0x27341b[_0x1ba508][_0xb05c('0x4e')]);}}}})['catch'](function(_0x485330){logger['error'](JSON[_0xb05c('0x26')](_0x485330));});}exports['run']=function(_0x301d89){return getJobs(_0x301d89);};exports[_0xb05c('0x53')]=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 a86156a..8826191 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 _0x611e=['resolve','CloudProvider','Cloud\x20Provider\x20not\x20available','Positive','Negative','catch','name','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','length','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','forEach','push','SequelizeValidationError','start','lodash','util','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Sequelize','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','data2','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','Neutral','update','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed'];(function(_0x290797,_0x19bb04){var _0x5f51e9=function(_0x3d5ce2){while(--_0x3d5ce2){_0x290797['push'](_0x290797['shift']());}};_0x5f51e9(++_0x19bb04);}(_0x611e,0x1d1));var _0xe611=function(_0x9669b6,_0x45c9f7){_0x9669b6=_0x9669b6-0x0;var _0x472f00=_0x611e[_0x9669b6];return _0x472f00;};var _=require(_0xe611('0x0'));var AWS=require('aws-sdk');var rp=require('request-promise');var util=require(_0xe611('0x1'));var BPromise=require(_0xe611('0x2'));var db=require(_0xe611('0x3'))['db'];var logger=require(_0xe611('0x4'))(_0xe611('0x5'));function getTranscriptionJob(_0x4bd203,_0x4fc61a,_0x6f5736,_0x547709){return new Promise(function(_0x129048,_0xa72dc5){var _0x20a78c=new AWS[(_0xe611('0x6'))]({'accessKeyId':_0x4fc61a,'secretAccessKey':_0x4bd203,'region':_0x6f5736});_0x20a78c[_0xe611('0x7')]({'TranscriptionJobName':_0x547709},function(_0x167ad6,_0x52ced2){if(_0x167ad6){return _0xa72dc5(_0x167ad6);}else{return _0x129048(_0x52ced2);}});});}function sentiment(_0x539af6,_0x43a70c,_0xb09fbc,_0x3d82b7,_0x37454b){return new Promise(function(_0x184071,_0x5eecab){var _0x5ae624=new AWS[(_0xe611('0x8'))]({'accessKeyId':_0x43a70c,'secretAccessKey':_0x539af6,'region':_0xb09fbc});_0x5ae624[_0xe611('0x9')]({'Text':_0x3d82b7,'LanguageCode':_0x37454b[_0xe611('0xa')](0x0,0x2)},function(_0x34b9a1,_0xe4e12b){if(_0x34b9a1){return _0x5eecab(_0x34b9a1);}else{return _0x184071(_0xe4e12b);}});});}function checkTranscribeJob(_0x54ef69,_0x50abe9,_0x2819d4){var _0x2b33dd;return new BPromise(function(_0x45a58f,_0x5da821){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0xd'),_0x54ef69['id'],_0x54ef69[_0xe611('0xe')]));return getTranscriptionJob(_0x2819d4['data1'],_0x2819d4['data2'],_0x50abe9['transcribeRegion'],_0x54ef69[_0xe611('0xe')])[_0xe611('0xf')](function(_0x4960dc){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x10'),_0x54ef69['id'],_0x54ef69[_0xe611('0xe')],_0x4960dc[_0xe611('0x11')]['TranscriptionJobStatus']));if(!_0x54ef69[_0xe611('0x12')]){switch(_0x4960dc[_0xe611('0x11')]['TranscriptionJobStatus']){case _0xe611('0x13'):var _0x5d2ba9={'transcribeStatus':_0x4960dc[_0xe611('0x11')]['TranscriptionJobStatus'],'fileUri':_0x4960dc['TranscriptionJob'][_0xe611('0x14')][_0xe611('0x15')]};logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x16'),_0x54ef69['id']));return rp({'uri':_0x4960dc[_0xe611('0x11')]['Transcript'][_0xe611('0x15')],'json':!![]})[_0xe611('0xf')](function(_0x34c9b6){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x17'),_0x54ef69['id']));if(_0x34c9b6&&_0x34c9b6['results']&&_0x34c9b6[_0xe611('0x18')][_0xe611('0x19')]&&_0x34c9b6['results'][_0xe611('0x19')]['length']){_0x5d2ba9[_0xe611('0x12')]='';for(var _0x41ad75=0x0;_0x41ad75<_0x34c9b6[_0xe611('0x18')][_0xe611('0x19')]['length'];_0x41ad75++){_0x5d2ba9[_0xe611('0x12')]+=_0x34c9b6[_0xe611('0x18')][_0xe611('0x19')][_0x41ad75][_0xe611('0x1a')]+'';}}return _0x54ef69['update'](_0x5d2ba9);})[_0xe611('0xf')](function(){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x1b'),_0x54ef69['id']));if(!_0x54ef69[_0xe611('0x1c')]){throw new db['Sequelize']['ValidationError'](_0xe611('0x1d'));}if(!_0x50abe9[_0xe611('0x1e')]||!_0x50abe9[_0xe611('0x1f')]||!_0x50abe9[_0xe611('0x20')]||!_0x50abe9[_0xe611('0x21')]||!_0x50abe9[_0xe611('0x22')]){throw new db['Sequelize']['ValidationError'](_0xe611('0x23'));}if(!_0x5d2ba9[_0xe611('0x12')]){throw new Error(_0xe611('0x24'));}if(_0x50abe9['sentimentAccountId']===_0x2819d4['id']){return _0x2819d4;}else{return db['CloudProvider'][_0xe611('0x25')]({'where':{'id':_settings[_0xe611('0x1f')]}});}})[_0xe611('0xf')](function(_0x25c42e){if(!_0x25c42e){throw new db[(_0xe611('0x26'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x25c42e['data1']||!_0x25c42e['data2']){throw new db[(_0xe611('0x26'))][(_0xe611('0x27'))](_0xe611('0x28'));}_0x2b33dd=_0x25c42e;logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x29'),_0x54ef69['id']));return sentiment(_0x2b33dd[_0xe611('0x2a')],_0x2b33dd[_0xe611('0x2b')],_0x50abe9['sentimentRegion'],_0x5d2ba9[_0xe611('0x12')],_0x50abe9['language']);})[_0xe611('0xf')](function(_0x519c22){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x2c'),_0x54ef69['id']));return _0x54ef69['update']({'sentiment':_0x519c22[_0xe611('0x2d')],'sPositive':_0x519c22['SentimentScore']['Positive'],'sNegative':_0x519c22[_0xe611('0x2e')]['Negative'],'sMixed':_0x519c22[_0xe611('0x2e')][_0xe611('0x2f')],'sNeutral':_0x519c22[_0xe611('0x2e')][_0xe611('0x30')]});})[_0xe611('0xf')](function(){logger['info'](util['format'](_0xe611('0x1b'),_0x54ef69['id']));_0x45a58f();});case'FAILED':return _0x54ef69[_0xe611('0x31')]({'transcribeStatus':_0xe611('0x32'),'failureReason':_0x4960dc[_0xe611('0x11')][_0xe611('0x33')]})[_0xe611('0xf')](function(){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x1b'),_0x54ef69['id']));_0x45a58f();});default:logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x34'),_0x54ef69['id']));break;}}else{return BPromise[_0xe611('0x35')]()[_0xe611('0xf')](function(){if(!_0x54ef69[_0xe611('0x1c')]){throw new db[(_0xe611('0x26'))][(_0xe611('0x27'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x50abe9['sentiment']||!_0x50abe9['sentimentAccountId']||!_0x50abe9['sentimentRegion']||!_0x50abe9['language']||!_0x50abe9[_0xe611('0x22')]){throw new db[(_0xe611('0x26'))]['ValidationError'](_0xe611('0x23'));}if(!_0x54ef69['fileText']){throw new Error(_0xe611('0x24'));}if(_0x50abe9['sentimentAccountId']===_0x2819d4['id']){return _0x2819d4;}else{return db[_0xe611('0x36')]['findOne']({'where':{'id':_settings[_0xe611('0x1f')]}});}})[_0xe611('0xf')](function(_0x514575){if(!_0x514575){throw new db[(_0xe611('0x26'))][(_0xe611('0x27'))](_0xe611('0x37'));}if(!_0x514575[_0xe611('0x2a')]||!_0x514575[_0xe611('0x2b')]){throw new db[(_0xe611('0x26'))][(_0xe611('0x27'))](_0xe611('0x28'));}_0x2b33dd=_0x514575;logger[_0xe611('0xb')](util['format'](_0xe611('0x29'),_0x54ef69['id']));return sentiment(_0x2b33dd[_0xe611('0x2a')],_0x2b33dd['data2'],_0x50abe9[_0xe611('0x20')],_0x54ef69[_0xe611('0x12')],_0x50abe9[_0xe611('0x21')]);})[_0xe611('0xf')](function(_0x5b8652){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x2c'),_0x54ef69['id']));return _0x54ef69[_0xe611('0x31')]({'sentiment':_0x5b8652[_0xe611('0x2d')],'sPositive':_0x5b8652['SentimentScore'][_0xe611('0x38')],'sNegative':_0x5b8652['SentimentScore'][_0xe611('0x39')],'sMixed':_0x5b8652[_0xe611('0x2e')][_0xe611('0x2f')],'sNeutral':_0x5b8652[_0xe611('0x2e')][_0xe611('0x30')],'transcribeStatus':_0xe611('0x13')});})[_0xe611('0xf')](function(){logger[_0xe611('0xb')](util[_0xe611('0xc')](_0xe611('0x1b'),_0x54ef69['id']));_0x45a58f();});}})[_0xe611('0x3a')](function(_0x5549ea){if(_0x5549ea){if(!_0x5549ea[_0xe611('0x3b')]||_0x5549ea['name']!=='SequelizeValidationError'){logger['error'](util[_0xe611('0xc')](_0xe611('0x3c'),_0x54ef69['id']),util[_0xe611('0x3d')](_0x5549ea,{'showHidden':![],'depth':null}));}}_0x45a58f();});});}function checkTranscribe(){var _0xb1f16d;var _0x4acd4d;var _0x162d53;return db['VoiceRecording'][_0xe611('0x3e')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0xe611('0xf')](function(_0x4b4f89){if(!_0x4b4f89||!_0x4b4f89[_0xe611('0x3f')]){throw new db[(_0xe611('0x26'))][(_0xe611('0x27'))](_0xe611('0x40'));}_0xb1f16d=_0x4b4f89;return db[_0xe611('0x41')][_0xe611('0x25')]({'where':{'id':0x1}});})['then'](function(_0x5db063){if(!_0x5db063){throw new db['Sequelize'][(_0xe611('0x27'))](_0xe611('0x42'));}_0x4acd4d=_0x5db063;if(!_0x4acd4d[_0xe611('0x5')]||!_0x4acd4d[_0xe611('0x43')]||!_0x4acd4d[_0xe611('0x44')]||!_0x4acd4d['language']||!_0x4acd4d[_0xe611('0x22')]){throw new db['Sequelize'][(_0xe611('0x27'))](_0xe611('0x45'));}return db[_0xe611('0x36')][_0xe611('0x25')]({'where':{'id':_0x4acd4d[_0xe611('0x43')]}});})[_0xe611('0xf')](function(_0x59b1ff){if(!_0x59b1ff){throw new db[(_0xe611('0x26'))]['ValidationError'](_0xe611('0x37'));}if(!_0x59b1ff[_0xe611('0x2a')]||!_0x59b1ff[_0xe611('0x2b')]){throw new db[(_0xe611('0x26'))][(_0xe611('0x27'))](_0xe611('0x28'));}_0x162d53=_0x59b1ff;var _0x44242a=[];_0xb1f16d[_0xe611('0x46')](function(_0x32b1b1){_0x44242a[_0xe611('0x47')](checkTranscribeJob(_0x32b1b1,_0x4acd4d,_0x162d53));});return BPromise['all'](_0x44242a);})[_0xe611('0x3a')](function(_0x54f9de){if(_0x54f9de){if(!_0x54f9de[_0xe611('0x3b')]||_0x54f9de[_0xe611('0x3b')]!==_0xe611('0x48')){logger['error'](util[_0xe611('0x3d')](_0x54f9de,{'showHidden':![],'depth':null}));}}});}exports[_0xe611('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x0f97=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','resolve','Sentiment\x20Analysis\x20not\x20requested','sentiment','findOne','COMPLETED','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','tempSentiment','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20configured','data1','then','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','FailureReason'];(function(_0x184ab1,_0x54af78){var _0x2896aa=function(_0x1c857b){while(--_0x1c857b){_0x184ab1['push'](_0x184ab1['shift']());}};_0x2896aa(++_0x54af78);}(_0x0f97,0x1c0));var _0x70f9=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0x0f97[_0x79a6e8];return _0xeeb993;};var _=require(_0x70f9('0x0'));var AWS=require(_0x70f9('0x1'));var rp=require(_0x70f9('0x2'));var util=require(_0x70f9('0x3'));var BPromise=require(_0x70f9('0x4'));var db=require(_0x70f9('0x5'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x4b1ae8,_0x2210a2,_0x441e57,_0x392cff){return new Promise(function(_0xacd4d6,_0x2f1f7f){var _0x4be1b5=new AWS[(_0x70f9('0x6'))]({'accessKeyId':_0x2210a2,'secretAccessKey':_0x4b1ae8,'region':_0x441e57});_0x4be1b5[_0x70f9('0x7')]({'TranscriptionJobName':_0x392cff},function(_0x3ef232,_0x1fd6da){if(_0x3ef232){return _0x2f1f7f(_0x3ef232);}else{return _0xacd4d6(_0x1fd6da);}});});}function sentiment(_0x460b0f,_0x135e5b,_0x1586ae,_0x1da3d6,_0x1572b5){return new Promise(function(_0x42cebb,_0x58dba5){var _0xeff4b5=new AWS[(_0x70f9('0x8'))]({'accessKeyId':_0x135e5b,'secretAccessKey':_0x460b0f,'region':_0x1586ae});_0xeff4b5[_0x70f9('0x9')]({'Text':_0x1da3d6,'LanguageCode':_0x1572b5['substring'](0x0,0x2)},function(_0x3a83f7,_0x2173db){if(_0x3a83f7){return _0x58dba5(_0x3a83f7);}else{return _0x42cebb(_0x2173db);}});});}function checkTranscribeJob(_0x3b5ca3,_0x4c10b4,_0x11cf42){var _0x46325c;return new BPromise(function(_0x22215b,_0x4cd3c9){logger[_0x70f9('0xa')](util[_0x70f9('0xb')](_0x70f9('0xc'),_0x3b5ca3['id'],_0x3b5ca3[_0x70f9('0xd')]));return getTranscriptionJob(_0x11cf42['data1'],_0x11cf42[_0x70f9('0xe')],_0x4c10b4[_0x70f9('0xf')],_0x3b5ca3[_0x70f9('0xd')])['then'](function(_0xd65b49){logger[_0x70f9('0xa')](util['format'](_0x70f9('0x10'),_0x3b5ca3['id'],_0x3b5ca3[_0x70f9('0xd')],_0xd65b49[_0x70f9('0x11')][_0x70f9('0x12')]));if(!_0x3b5ca3['fileText']){switch(_0xd65b49[_0x70f9('0x11')]['TranscriptionJobStatus']){case'COMPLETED':var _0x2b90be={'transcribeStatus':_0xd65b49['TranscriptionJob'][_0x70f9('0x12')],'fileUri':_0xd65b49[_0x70f9('0x11')][_0x70f9('0x13')]['TranscriptFileUri']};logger[_0x70f9('0xa')](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Get\x20transcript',_0x3b5ca3['id']));return rp({'uri':_0xd65b49[_0x70f9('0x11')]['Transcript'][_0x70f9('0x14')],'json':!![]})['then'](function(_0x3f71b8){logger[_0x70f9('0xa')](util[_0x70f9('0xb')](_0x70f9('0x15'),_0x3b5ca3['id']));if(_0x3f71b8&&_0x3f71b8['results']&&_0x3f71b8[_0x70f9('0x16')][_0x70f9('0x17')]&&_0x3f71b8[_0x70f9('0x16')][_0x70f9('0x17')][_0x70f9('0x18')]){_0x2b90be['fileText']='';for(var _0x48ad58=0x0;_0x48ad58<_0x3f71b8[_0x70f9('0x16')][_0x70f9('0x17')][_0x70f9('0x18')];_0x48ad58++){_0x2b90be[_0x70f9('0x19')]+=_0x3f71b8[_0x70f9('0x16')][_0x70f9('0x17')][_0x48ad58][_0x70f9('0x1a')]+'';}}return _0x3b5ca3[_0x70f9('0x1b')](_0x2b90be);})['then'](function(){logger['info'](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3b5ca3['id']));if(!_0x3b5ca3[_0x70f9('0x1c')]){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4c10b4['sentiment']||!_0x4c10b4[_0x70f9('0x1f')]||!_0x4c10b4[_0x70f9('0x20')]||!_0x4c10b4[_0x70f9('0x21')]||!_0x4c10b4[_0x70f9('0x22')]){throw new db[(_0x70f9('0x1d'))]['ValidationError'](_0x70f9('0x23'));}if(!_0x2b90be[_0x70f9('0x19')]){throw new Error(_0x70f9('0x24'));}if(_0x4c10b4[_0x70f9('0x1f')]===_0x11cf42['id']){return _0x11cf42;}else{return db[_0x70f9('0x25')]['findOne']({'where':{'id':_settings[_0x70f9('0x1f')]}});}})['then'](function(_0x3d9631){if(!_0x3d9631){throw new db[(_0x70f9('0x1d'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x3d9631['data1']||!_0x3d9631[_0x70f9('0xe')]){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))](_0x70f9('0x26'));}_0x46325c=_0x3d9631;logger[_0x70f9('0xa')](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3b5ca3['id']));return sentiment(_0x46325c[_0x70f9('0x27')],_0x46325c[_0x70f9('0xe')],_0x4c10b4[_0x70f9('0x20')],_0x2b90be[_0x70f9('0x19')],_0x4c10b4[_0x70f9('0x21')]);})[_0x70f9('0x28')](function(_0x110ed2){logger[_0x70f9('0xa')](util[_0x70f9('0xb')](_0x70f9('0x29'),_0x3b5ca3['id']));return _0x3b5ca3[_0x70f9('0x1b')]({'sentiment':_0x110ed2[_0x70f9('0x2a')],'sPositive':_0x110ed2[_0x70f9('0x2b')]['Positive'],'sNegative':_0x110ed2[_0x70f9('0x2b')][_0x70f9('0x2c')],'sMixed':_0x110ed2[_0x70f9('0x2b')][_0x70f9('0x2d')],'sNeutral':_0x110ed2[_0x70f9('0x2b')][_0x70f9('0x2e')]});})['then'](function(){logger[_0x70f9('0xa')](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3b5ca3['id']));_0x22215b();});case _0x70f9('0x2f'):return _0x3b5ca3[_0x70f9('0x1b')]({'transcribeStatus':'FAILED','failureReason':_0xd65b49[_0x70f9('0x11')][_0x70f9('0x30')]})[_0x70f9('0x28')](function(){logger[_0x70f9('0xa')](util[_0x70f9('0xb')](_0x70f9('0x31'),_0x3b5ca3['id']));_0x22215b();});default:logger[_0x70f9('0xa')](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x3b5ca3['id']));break;}}else{return BPromise[_0x70f9('0x32')]()['then'](function(){if(!_0x3b5ca3[_0x70f9('0x1c')]){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))](_0x70f9('0x33'));}if(!_0x4c10b4[_0x70f9('0x34')]||!_0x4c10b4[_0x70f9('0x1f')]||!_0x4c10b4[_0x70f9('0x20')]||!_0x4c10b4['language']||!_0x4c10b4[_0x70f9('0x22')]){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))](_0x70f9('0x23'));}if(!_0x3b5ca3[_0x70f9('0x19')]){throw new Error(_0x70f9('0x24'));}if(_0x4c10b4[_0x70f9('0x1f')]===_0x11cf42['id']){return _0x11cf42;}else{return db[_0x70f9('0x25')][_0x70f9('0x35')]({'where':{'id':_settings[_0x70f9('0x1f')]}});}})[_0x70f9('0x28')](function(_0x4959a9){if(!_0x4959a9){throw new db['Sequelize'][(_0x70f9('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x4959a9[_0x70f9('0x27')]||!_0x4959a9['data2']){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))](_0x70f9('0x26'));}_0x46325c=_0x4959a9;logger[_0x70f9('0xa')](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x3b5ca3['id']));return sentiment(_0x46325c['data1'],_0x46325c[_0x70f9('0xe')],_0x4c10b4[_0x70f9('0x20')],_0x3b5ca3[_0x70f9('0x19')],_0x4c10b4['language']);})[_0x70f9('0x28')](function(_0x5e66d7){logger[_0x70f9('0xa')](util[_0x70f9('0xb')](_0x70f9('0x29'),_0x3b5ca3['id']));return _0x3b5ca3['update']({'sentiment':_0x5e66d7[_0x70f9('0x2a')],'sPositive':_0x5e66d7['SentimentScore']['Positive'],'sNegative':_0x5e66d7['SentimentScore'][_0x70f9('0x2c')],'sMixed':_0x5e66d7[_0x70f9('0x2b')][_0x70f9('0x2d')],'sNeutral':_0x5e66d7[_0x70f9('0x2b')][_0x70f9('0x2e')],'transcribeStatus':_0x70f9('0x36')});})['then'](function(){logger[_0x70f9('0xa')](util[_0x70f9('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x3b5ca3['id']));_0x22215b();});}})['catch'](function(_0x28c6fd){if(_0x28c6fd){if(!_0x28c6fd['name']||_0x28c6fd[_0x70f9('0x37')]!==_0x70f9('0x38')){logger['error'](util[_0x70f9('0xb')](_0x70f9('0x39'),_0x3b5ca3['id']),util[_0x70f9('0x3a')](_0x28c6fd,{'showHidden':![],'depth':null}));}}_0x22215b();});});}function checkTranscribe(){var _0x24ce27;var _0xde9fd0;var _0x247464;return db[_0x70f9('0x3b')][_0x70f9('0x3c')]({'where':{'transcribeStatus':_0x70f9('0x3d')}})['then'](function(_0x2d502e){if(!_0x2d502e||!_0x2d502e[_0x70f9('0x18')]){throw new db['Sequelize'][(_0x70f9('0x1e'))](_0x70f9('0x3e'));}_0x24ce27=_0x2d502e;return db[_0x70f9('0x3f')][_0x70f9('0x35')]({'where':{'id':0x1}});})['then'](function(_0x1a206f){if(!_0x1a206f){throw new db[(_0x70f9('0x1d'))]['ValidationError']('Settings\x20not\x20available');}_0xde9fd0=_0x1a206f;if(!_0xde9fd0['transcribe']||!_0xde9fd0[_0x70f9('0x40')]||!_0xde9fd0[_0x70f9('0xf')]||!_0xde9fd0[_0x70f9('0x21')]||!_0xde9fd0['bucket']){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))](_0x70f9('0x41'));}return db[_0x70f9('0x25')]['findOne']({'where':{'id':_0xde9fd0['transcribeAccountId']}});})['then'](function(_0x5c282f){if(!_0x5c282f){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5c282f[_0x70f9('0x27')]||!_0x5c282f[_0x70f9('0xe')]){throw new db[(_0x70f9('0x1d'))][(_0x70f9('0x1e'))](_0x70f9('0x26'));}_0x247464=_0x5c282f;var _0x25aa2e=[];_0x24ce27[_0x70f9('0x42')](function(_0x1553b6){_0x25aa2e[_0x70f9('0x43')](checkTranscribeJob(_0x1553b6,_0xde9fd0,_0x247464));});return BPromise[_0x70f9('0x44')](_0x25aa2e);})[_0x70f9('0x45')](function(_0xe29f9){if(_0xe29f9){if(!_0xe29f9[_0x70f9('0x37')]||_0xe29f9[_0x70f9('0x37')]!=='SequelizeValidationError'){logger['error'](util[_0x70f9('0x3a')](_0xe29f9,{'showHidden':![],'depth':null}));}}});}exports[_0x70f9('0x46')]=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 5ab4fa2..cddef9c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66a4=['then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','CmContact','destroy'];(function(_0x129102,_0x3ac9c9){var _0x346551=function(_0x4040e5){while(--_0x4040e5){_0x129102['push'](_0x129102['shift']());}};_0x346551(++_0x3ac9c9);}(_0x66a4,0x1be));var _0x466a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x66a4[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0x466a('0x0'));var db=require(_0x466a('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x466a('0x2')]({'id':i,'firstName':_0x466a('0x3')+i,'lastName':_0x466a('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x466a('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x466a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x466a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x466a('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x466a('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x466a('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x466a('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x466a('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x466a('0x6')](),'updatedAt':Date[_0x466a('0x6')]()});}db[_0x466a('0x8')][_0x466a('0x9')]({'where':{}})[_0x466a('0xa')](function(){return db[_0x466a('0x8')][_0x466a('0xb')](contacts);})[_0x466a('0xa')](function(){console['log'](_0x466a('0xc'),_0x466a('0xd'));return db[_0x466a('0xe')][_0x466a('0x9')]({'where':{}});})[_0x466a('0xa')](function(){return db['CmHopper'][_0x466a('0xb')](hopper);})[_0x466a('0xa')](function(){console[_0x466a('0xf')](_0x466a('0xc'),_0x466a('0x10'));return db[_0x466a('0x8')]['bulkCreate'](contacts2);})[_0x466a('0xa')](function(){console['log'](_0x466a('0xc'),_0x466a('0x11'));return db['CmHopper'][_0x466a('0xb')](hopper2);})[_0x466a('0xa')](function(){console[_0x466a('0xf')](_0x466a('0xc'),_0x466a('0x12'));})['catch'](function(_0x1d753a){console[_0x466a('0xf')](_0x1d753a);}); \ No newline at end of file +var _0x5c49=['push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','hopper2','catch','util','../mysqldb'];(function(_0x45ae2a,_0xae28eb){var _0x4da5c1=function(_0x275b8){while(--_0x275b8){_0x45ae2a['push'](_0x45ae2a['shift']());}};_0x4da5c1(++_0xae28eb);}(_0x5c49,0xbc));var _0x95c4=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x5c49[_0x3f0b30];return _0x2748a5;};'use strict';var util=require(_0x95c4('0x0'));var db=require(_0x95c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x95c4('0x2')]({'id':i,'firstName':_0x95c4('0x3')+i,'lastName':_0x95c4('0x4')+i,'phone':0xf879fb460+i,'email':_0x95c4('0x5')+i+_0x95c4('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x95c4('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x95c4('0x2')]({'id':i,'firstName':_0x95c4('0x3')+i,'lastName':_0x95c4('0x4')+i,'phone':0xf879fb460+i,'email':_0x95c4('0x5')+i+_0x95c4('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x95c4('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x95c4('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x95c4('0x7')](),'updatedAt':Date[_0x95c4('0x7')]()});}db[_0x95c4('0x8')][_0x95c4('0x9')]({'where':{}})[_0x95c4('0xa')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x95c4('0xa')](function(){console[_0x95c4('0xb')](_0x95c4('0xc'),_0x95c4('0xd'));return db[_0x95c4('0xe')][_0x95c4('0x9')]({'where':{}});})[_0x95c4('0xa')](function(){return db['CmHopper'][_0x95c4('0xf')](hopper);})[_0x95c4('0xa')](function(){console['log'](_0x95c4('0xc'),_0x95c4('0x10'));return db[_0x95c4('0x8')][_0x95c4('0xf')](contacts2);})[_0x95c4('0xa')](function(){console[_0x95c4('0xb')](_0x95c4('0xc'),'contacts2');return db['CmHopper'][_0x95c4('0xf')](hopper2);})[_0x95c4('0xa')](function(){console[_0x95c4('0xb')](_0x95c4('0xc'),_0x95c4('0x11'));})[_0x95c4('0x12')](function(_0x11b1f2){console['log'](_0x11b1f2);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 6b48132..53d5b38 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7be=['ulaw','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all'];(function(_0x22f35f,_0x108401){var _0x3938c0=function(_0x41cbc6){while(--_0x41cbc6){_0x22f35f['push'](_0x22f35f['shift']());}};_0x3938c0(++_0x108401);}(_0xb7be,0x9d));var _0xeb7b=function(_0x28202e,_0x5d0604){_0x28202e=_0x28202e-0x0;var _0x126f8b=_0xb7be[_0x28202e];return _0x126f8b;};'use strict';var util=require(_0xeb7b('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xeb7b('0x1')]({'name':util[_0xeb7b('0x2')](_0xeb7b('0x3'),_0xeb7b('0x4'),i),'fullname':util['format']('%s%s','agent',i),'email':util['format'](_0xeb7b('0x5'),_0xeb7b('0x4'),i),'role':'agent','password':_0xeb7b('0x6'),'internal':0xfa0+i,'type':_0xeb7b('0x7'),'transport':[_0xeb7b('0x8'),'ws',_0xeb7b('0x9')],'disallow':[_0xeb7b('0xa')],'allow':[_0xeb7b('0xb')],'defaultuser':util[_0xeb7b('0x2')](_0xeb7b('0x3'),'agent',i),'encryption':_0xeb7b('0xc'),'avpf':_0xeb7b('0xc'),'force_avp':_0xeb7b('0xc'),'icesupport':_0xeb7b('0xc'),'dtlsenable':_0xeb7b('0xc'),'dtlsverify':'no','dtlscertfile':_0xeb7b('0xd'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0xeb7b('0x2')](_0xeb7b('0xe'),util[_0xeb7b('0x2')](_0xeb7b('0x3'),_0xeb7b('0x4'),i),0xfa0+i)});}db[_0xeb7b('0xf')][_0xeb7b('0x10')](users)[_0xeb7b('0x11')](function(){console[_0xeb7b('0x12')](_0xeb7b('0x13'));})[_0xeb7b('0x14')](function(_0xcadd85){console['log'](_0xcadd85);}); \ No newline at end of file +var _0xf4bb=['udp','wss','all','ulaw','%s%s','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','bulkCreate','then','add\x20user','log','util','../mysqldb','push','format','agent','%s%s@xcally.com'];(function(_0xb879fa,_0x264b04){var _0x1548b8=function(_0x504845){while(--_0x504845){_0xb879fa['push'](_0xb879fa['shift']());}};_0x1548b8(++_0x264b04);}(_0xf4bb,0x117));var _0xbf4b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf4bb[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xbf4b('0x0'));var db=require(_0xbf4b('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbf4b('0x2')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0xbf4b('0x3')]('%s%s',_0xbf4b('0x4'),i),'email':util[_0xbf4b('0x3')](_0xbf4b('0x5'),_0xbf4b('0x4'),i),'role':_0xbf4b('0x4'),'password':'password','internal':0xfa0+i,'type':'friend','transport':[_0xbf4b('0x6'),'ws',_0xbf4b('0x7')],'disallow':[_0xbf4b('0x8')],'allow':[_0xbf4b('0x9')],'defaultuser':util[_0xbf4b('0x3')](_0xbf4b('0xa'),_0xbf4b('0x4'),i),'encryption':_0xbf4b('0xb'),'avpf':'yes','force_avp':_0xbf4b('0xb'),'icesupport':_0xbf4b('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xbf4b('0xc'),'dtlsprivatekey':_0xbf4b('0xd'),'dtlssetup':'actpass','callerid':util[_0xbf4b('0x3')](_0xbf4b('0xe'),util[_0xbf4b('0x3')](_0xbf4b('0xa'),_0xbf4b('0x4'),i),0xfa0+i)});}db['User'][_0xbf4b('0xf')](users)[_0xbf4b('0x10')](function(){console['log'](_0xbf4b('0x11'));})['catch'](function(_0x59f3c4){console[_0xbf4b('0x12')](_0x59f3c4);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 1621d19..86a2d37 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xce49=['fax','sms','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remotePort','connectedAt','SocketIO\x20','disconnect','CONNECTED','util','name','telephone','agent','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','User','role','Campaign','ivr','format','%s:queue:%s','Agents','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','WhatsappQueue','Trunk','user','VoiceQueues','OpenchannelQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length'];(function(_0x292bb9,_0x39c395){var _0x1d1c7d=function(_0x36f410){while(--_0x36f410){_0x292bb9['push'](_0x292bb9['shift']());}};_0x1d1c7d(++_0x39c395);}(_0xce49,0x132));var _0x9ce4=function(_0x4b7824,_0x2abee8){_0x4b7824=_0x4b7824-0x0;var _0x35351b=_0xce49[_0x4b7824];return _0x35351b;};'use strict';var _=require('lodash');var util=require(_0x9ce4('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x9ce4('0x1'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9ce4('0x1')],'where':{'role':_0x9ce4('0x2')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9ce4('0x1')]};var queryAgents={'raw':!![],'attributes':['id',_0x9ce4('0x1')],'where':{'role':_0x9ce4('0x3')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9ce4('0x1'),_0x9ce4('0x4')],'where':{'type':'ivr'}};function getAssociatedResources(_0x39ac65,_0x2f241e,_0x18e7d6){return db[_0x9ce4('0x5')][_0x9ce4('0x6')]({'where':{'name':_0x39ac65,'userProfileId':_0x2f241e},'raw':!![]})[_0x9ce4('0x7')](function(_0x421e1c){if(_0x421e1c){if(_0x421e1c[_0x9ce4('0x8')]){switch(_0x39ac65){case'VoiceQueues':case _0x9ce4('0x9'):case _0x9ce4('0xa'):case'SmsQueues':case _0x9ce4('0xb'):case _0x9ce4('0xc'):case _0x9ce4('0xd'):return db[_0x18e7d6][_0x9ce4('0xe')](queryQueues);case'Telephones':return db[_0x18e7d6][_0x9ce4('0xe')](queryTelephones);case _0x9ce4('0xf'):return db[_0x18e7d6][_0x9ce4('0xe')](queryTrunks);case _0x9ce4('0x10'):return db[_0x18e7d6][_0x9ce4('0xe')](queryCampaigns);}}else{return db[_0x9ce4('0x11')][_0x9ce4('0xe')]({'attributes':['resourceId'],'where':{'sectionId':_0x421e1c['id']},'raw':!![]})[_0x9ce4('0x7')](function(_0x3e66e6){if(_0x3e66e6){var _0x1a19a3={'where':{'id':_[_0x9ce4('0x12')](_0x3e66e6,_0x9ce4('0x13'))},'raw':!![]};switch(_0x18e7d6){case _0x9ce4('0x14'):_0x1a19a3['where'][_0x9ce4('0x15')]=_0x9ce4('0x2');break;case _0x9ce4('0x16'):_0x1a19a3['where']['type']=_0x9ce4('0x17');break;}return db[_0x18e7d6][_0x9ce4('0xe')](_0x1a19a3);}else{return[];}});}}else{return[];}})[_0x9ce4('0x7')](function(_0x460150){return _0x460150;});}function joinOrLeaveQueues(_0x2f344a,_0x3529ea,_0x32cde1,_0x44aad1){_0x2f344a[_0x3529ea](util[_0x9ce4('0x18')](_0x9ce4('0x19'),_0x32cde1,_0x44aad1[_0x9ce4('0x1')]));if(_0x44aad1[_0x9ce4('0x1a')]){for(var _0x59c9a5=0x0;_0x59c9a5<_0x44aad1[_0x9ce4('0x1a')]['length'];_0x59c9a5+=0x1){_0x2f344a[_0x3529ea](util[_0x9ce4('0x18')](_0x9ce4('0x1b'),_0x44aad1[_0x9ce4('0x1a')][_0x59c9a5][_0x9ce4('0x1')]));}}}function joinOrLeave(_0x598e43,_0x1ae1c9,_0x4ead4f){var _0x2384c2;if(_0x598e43[_0x9ce4('0x1c')][_0x9ce4('0x1d')]['id']){db[_0x9ce4('0x14')][_0x9ce4('0x1e')]({'attributes':['id','name',_0x9ce4('0x15'),_0x9ce4('0x1f')],'where':{'id':_0x598e43[_0x9ce4('0x1c')]['query']['id']},'include':[{'model':db[_0x9ce4('0x20')],'as':_0x9ce4('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x9ce4('0x22')],'as':_0x9ce4('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x9ce4('0x24')],'as':_0x9ce4('0x25'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x9ce4('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x9ce4('0x27')],'as':_0x9ce4('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x9ce4('0x29'),'attributes':['id'],'raw':!![]}]})[_0x9ce4('0x7')](function(_0x59171d){if(_0x59171d){_0x2384c2=_0x59171d;_0x598e43[_0x1ae1c9](util[_0x9ce4('0x18')](_0x9ce4('0x1b'),_0x59171d[_0x9ce4('0x1')]));var _0x1f4911=[];switch(_0x59171d[_0x9ce4('0x15')]){case'admin':_0x598e43[_0x1ae1c9](_0x9ce4('0x2a'));_0x598e43[_0x1ae1c9](_0x9ce4('0x2b'));if(queryQueues[_0x9ce4('0x2c')](_0x9ce4('0x2d'))){delete queryQueues[_0x9ce4('0x2d')];}_0x1f4911['push'](db['VoiceQueue'][_0x9ce4('0xe')](queryQueues));_0x1f4911[_0x9ce4('0x2e')](db[_0x9ce4('0x2f')][_0x9ce4('0xe')](queryQueues));_0x1f4911['push'](db[_0x9ce4('0x30')][_0x9ce4('0xe')](queryQueues));_0x1f4911[_0x9ce4('0x2e')](db[_0x9ce4('0x31')][_0x9ce4('0xe')](queryQueues));_0x1f4911['push'](db[_0x9ce4('0x32')][_0x9ce4('0xe')](queryQueues));_0x1f4911['push'](db['OpenchannelQueue'][_0x9ce4('0xe')](queryQueues));_0x1f4911[_0x9ce4('0x2e')](db[_0x9ce4('0x33')]['findAll'](queryQueues));_0x1f4911[_0x9ce4('0x2e')](db[_0x9ce4('0x14')][_0x9ce4('0xe')](queryTelephones));_0x1f4911[_0x9ce4('0x2e')](db[_0x9ce4('0x34')][_0x9ce4('0xe')](queryTrunks));_0x1f4911['push'](db['Campaign'][_0x9ce4('0xe')](queryCampaigns));_0x1f4911['push'](db['User'][_0x9ce4('0xe')](queryAgents));break;case _0x9ce4('0x35'):_0x598e43[_0x1ae1c9]('voice:inbound');_0x598e43[_0x1ae1c9](_0x9ce4('0x2b'));_0x1f4911['push'](getAssociatedResources(_0x9ce4('0x36'),_0x59171d[_0x9ce4('0x1f')],'VoiceQueue'));_0x1f4911[_0x9ce4('0x2e')](getAssociatedResources(_0x9ce4('0x9'),_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x2f')));_0x1f4911[_0x9ce4('0x2e')](getAssociatedResources(_0x9ce4('0xa'),_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x30')));_0x1f4911['push'](getAssociatedResources('SmsQueues',_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x31')));_0x1f4911[_0x9ce4('0x2e')](getAssociatedResources(_0x9ce4('0xb'),_0x59171d[_0x9ce4('0x1f')],'MailQueue'));_0x1f4911['push'](getAssociatedResources('OpenchannelQueues',_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x37')));_0x1f4911[_0x9ce4('0x2e')](getAssociatedResources(_0x9ce4('0xd'),_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x33')));_0x1f4911[_0x9ce4('0x2e')](getAssociatedResources(_0x9ce4('0x38'),_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x14')));_0x1f4911[_0x9ce4('0x2e')](getAssociatedResources(_0x9ce4('0xf'),_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x34')));_0x1f4911['push'](getAssociatedResources(_0x9ce4('0x10'),_0x59171d[_0x9ce4('0x1f')],_0x9ce4('0x16')));_0x1f4911[_0x9ce4('0x2e')](db[_0x9ce4('0x14')][_0x9ce4('0xe')](queryAgents));break;case _0x9ce4('0x3'):_0x598e43[_0x1ae1c9]('voice:inbound');_0x598e43[_0x1ae1c9]('voice:outbound');_0x1f4911[_0x9ce4('0x2e')](_0x59171d[_0x9ce4('0x39')]({'attributes':['id',_0x9ce4('0x1')]}));_0x1f4911[_0x9ce4('0x2e')](_0x59171d[_0x9ce4('0x3a')]({'attributes':['id','name']}));_0x1f4911[_0x9ce4('0x2e')](_0x59171d[_0x9ce4('0x3b')]({'attributes':['id',_0x9ce4('0x1')]}));_0x1f4911[_0x9ce4('0x2e')](_0x59171d[_0x9ce4('0x3c')]({'attributes':['id',_0x9ce4('0x1')]}));_0x1f4911['push'](_0x59171d[_0x9ce4('0x3d')]({'attributes':['id',_0x9ce4('0x1')]}));_0x1f4911['push'](_0x59171d[_0x9ce4('0x3e')]({'attributes':['id','name']}));_0x1f4911[_0x9ce4('0x2e')](_0x59171d[_0x9ce4('0x3f')]({'attributes':['id',_0x9ce4('0x1')]}));break;}return BPromise[_0x9ce4('0x40')](_0x1f4911);}})[_0x9ce4('0x7')](function(_0x3789e2){if(_0x3789e2&&_0x3789e2[_0x9ce4('0x41')]){for(var _0x1db9fa=0x0;_0x1db9fa<_0x3789e2[_0x9ce4('0x41')];_0x1db9fa+=0x1){for(var _0x2f3b42=0x0;_0x2f3b42<_0x3789e2[_0x1db9fa][_0x9ce4('0x41')];_0x2f3b42+=0x1){switch(_0x1db9fa){case 0x0:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,'voice',_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x1:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,'chat',_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x2:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,_0x9ce4('0x42'),_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x3:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,_0x9ce4('0x43'),_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x4:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,'mail',_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x5:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,_0x9ce4('0x44'),_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x6:joinOrLeaveQueues(_0x598e43,_0x1ae1c9,'whatsapp',_0x3789e2[_0x1db9fa][_0x2f3b42]);break;case 0x7:_0x598e43[_0x1ae1c9](util[_0x9ce4('0x18')](_0x9ce4('0x45'),_0x3789e2[_0x1db9fa][_0x2f3b42][_0x9ce4('0x1')]));break;case 0x8:_0x598e43[_0x1ae1c9](util[_0x9ce4('0x18')](_0x9ce4('0x46'),_0x3789e2[_0x1db9fa][_0x2f3b42][_0x9ce4('0x1')]));break;case 0x9:_0x598e43[_0x1ae1c9](util[_0x9ce4('0x18')](_0x9ce4('0x47'),_0x3789e2[_0x1db9fa][_0x2f3b42][_0x9ce4('0x4')],_0x3789e2[_0x1db9fa][_0x2f3b42]['name']));break;case 0xa:_0x598e43[_0x1ae1c9](util[_0x9ce4('0x18')](_0x9ce4('0x1b'),_0x3789e2[_0x1db9fa][_0x2f3b42][_0x9ce4('0x1')]));break;}}}}})[_0x9ce4('0x7')](function(){if(_0x1ae1c9===_0x9ce4('0x48')){var _0x359d10=_[_0x9ce4('0x12')](_0x2384c2['ChatInteractions'],'id');return _0x2384c2['removeChatInteractions'](_0x359d10)[_0x9ce4('0x7')](function(){for(var _0x10ec8c=0x0;_0x10ec8c<_0x359d10[_0x9ce4('0x41')];_0x10ec8c+=0x1){_0x4ead4f[_0x9ce4('0x49')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x359d10[_0x10ec8c]),'UserId':Number(_0x2384c2['id'])});}});}})[_0x9ce4('0x7')](function(){if(_0x1ae1c9===_0x9ce4('0x48')){var _0x56a3d0=_['map'](_0x2384c2[_0x9ce4('0x23')],'id');return _0x2384c2[_0x9ce4('0x4a')](_0x56a3d0)[_0x9ce4('0x7')](function(){for(var _0xd29d69=0x0;_0xd29d69<_0x56a3d0[_0x9ce4('0x41')];_0xd29d69+=0x1){_0x4ead4f[_0x9ce4('0x49')](_0x9ce4('0x4b'),{'MailInteractionId':Number(_0x56a3d0[_0xd29d69]),'UserId':Number(_0x2384c2['id'])});}});}})[_0x9ce4('0x7')](function(){if(_0x1ae1c9===_0x9ce4('0x48')){var _0xb76993=_[_0x9ce4('0x12')](_0x2384c2[_0x9ce4('0x25')],'id');return _0x2384c2[_0x9ce4('0x4c')](_0xb76993)[_0x9ce4('0x7')](function(){for(var _0x142397=0x0;_0x142397<_0xb76993[_0x9ce4('0x41')];_0x142397+=0x1){_0x4ead4f[_0x9ce4('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xb76993[_0x142397]),'UserId':Number(_0x2384c2['id'])});}});}})['then'](function(){if(_0x1ae1c9==='leave'){var _0x39a5d7=_[_0x9ce4('0x12')](_0x2384c2[_0x9ce4('0x26')],'id');return _0x2384c2['removeSmsInteractions'](_0x39a5d7)[_0x9ce4('0x7')](function(){for(var _0x55f36d=0x0;_0x55f36d<_0x39a5d7['length'];_0x55f36d+=0x1){_0x4ead4f[_0x9ce4('0x49')](_0x9ce4('0x4d'),{'SmsInteractionId':Number(_0x39a5d7[_0x55f36d]),'UserId':Number(_0x2384c2['id'])});}});}})[_0x9ce4('0x7')](function(){if(_0x1ae1c9===_0x9ce4('0x48')){var _0x387dd1=_[_0x9ce4('0x12')](_0x2384c2[_0x9ce4('0x28')],'id');return _0x2384c2['removeOpenchannelInteractions'](_0x387dd1)[_0x9ce4('0x7')](function(){for(var _0x55ce64=0x0;_0x55ce64<_0x387dd1[_0x9ce4('0x41')];_0x55ce64+=0x1){_0x4ead4f['emit'](_0x9ce4('0x4e'),{'OpenchannelInteractionId':Number(_0x387dd1[_0x55ce64]),'UserId':Number(_0x2384c2['id'])});}});}})[_0x9ce4('0x7')](function(){if(_0x1ae1c9===_0x9ce4('0x48')){var _0x2a2c14=_[_0x9ce4('0x12')](_0x2384c2[_0x9ce4('0x29')],'id');return _0x2384c2[_0x9ce4('0x4f')](_0x2a2c14)['then'](function(){for(var _0xa96bcf=0x0;_0xa96bcf<_0x2a2c14[_0x9ce4('0x41')];_0xa96bcf+=0x1){_0x4ead4f[_0x9ce4('0x49')](_0x9ce4('0x50'),{'WhatsappInteractionId':Number(_0x2a2c14[_0xa96bcf]),'UserId':Number(_0x2384c2['id'])});}});}})[_0x9ce4('0x51')](function(_0x7b7ca6){_0x598e43[_0x9ce4('0x52')](_0x7b7ca6);});}}function onDisconnect(_0x1bc711,_0x2b9519){joinOrLeave(_0x1bc711,_0x9ce4('0x48'),_0x2b9519);}function onConnect(_0x32bd5f){joinOrLeave(_0x32bd5f,_0x9ce4('0x53'));}exports[_0x9ce4('0x54')]=function(_0x1d3f71){_0x1d3f71['on'](_0x9ce4('0x55'),function(_0x59c0c0){_0x59c0c0['setMaxListeners'](0x0);_0x59c0c0[_0x9ce4('0x56')]=_0x59c0c0['request'][_0x9ce4('0x55')]['remoteAddress']+':'+_0x59c0c0[_0x9ce4('0x57')][_0x9ce4('0x55')][_0x9ce4('0x58')];_0x59c0c0[_0x9ce4('0x59')]=new Date();_0x59c0c0[_0x9ce4('0x52')]=function(_0x1bd04a){console[_0x9ce4('0x52')](_0x9ce4('0x5a')+_0x59c0c0['nsp'][_0x9ce4('0x1')]+'['+_0x59c0c0[_0x9ce4('0x56')]+']',_0x1bd04a);};_0x59c0c0['on'](_0x9ce4('0x5b'),function(){onDisconnect(_0x59c0c0,_0x1d3f71);_0x59c0c0[_0x9ce4('0x52')]('DISCONNECTED');});onConnect(_0x59c0c0);_0x59c0c0[_0x9ce4('0x52')](_0x9ce4('0x5c'));});}; \ No newline at end of file +var _0x7ada=['FaxInteraction','FaxInteractions','SmsInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','WhatsappQueue','Campaign','FaxQueues','SmsQueue','MailQueue','OpenchannelQueues','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','length','voice','chat','fax','sms','mail','whatsapp','trunk:%s','campaign:%s:%s','user:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','leave','removeFaxInteractions','SmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','catch','default','connection','address','request','remotePort','connectedAt','log','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','../mysqldb','name','Agents','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','role','where','format','%s:queue:%s','handshake','query','User','userProfileId','ChatInteraction','MailInteraction','MailInteractions'];(function(_0x50ed23,_0x47f6f9){var _0x1b6e9d=function(_0x5c1ca9){while(--_0x5c1ca9){_0x50ed23['push'](_0x50ed23['shift']());}};_0x1b6e9d(++_0x47f6f9);}(_0x7ada,0x103));var _0xa7ad=function(_0x1a71ee,_0x335cd9){_0x1a71ee=_0x1a71ee-0x0;var _0xa2e97e=_0x7ada[_0x1a71ee];return _0xa2e97e;};'use strict';var _=require(_0xa7ad('0x0'));var util=require(_0xa7ad('0x1'));var BPromise=require('bluebird');var db=require(_0xa7ad('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xa7ad('0x3')],'include':[{'as':_0xa7ad('0x4'),'model':db['User'],'attributes':['id',_0xa7ad('0x3'),'role'],'raw':!![],'where':{'role':_0xa7ad('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xa7ad('0x3')],'where':{'role':_0xa7ad('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xa7ad('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0xa7ad('0x3')],'where':{'role':_0xa7ad('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xa7ad('0x3'),_0xa7ad('0x7')],'where':{'type':_0xa7ad('0x8')}};function getAssociatedResources(_0x3a90b5,_0x3dc6ec,_0x65cf49){return db[_0xa7ad('0x9')][_0xa7ad('0xa')]({'where':{'name':_0x3a90b5,'userProfileId':_0x3dc6ec},'raw':!![]})[_0xa7ad('0xb')](function(_0x2b7ece){if(_0x2b7ece){if(_0x2b7ece[_0xa7ad('0xc')]){switch(_0x3a90b5){case _0xa7ad('0xd'):case _0xa7ad('0xe'):case'FaxQueues':case _0xa7ad('0xf'):case _0xa7ad('0x10'):case'OpenchannelQueues':case _0xa7ad('0x11'):return db[_0x65cf49][_0xa7ad('0x12')](queryQueues);case _0xa7ad('0x13'):return db[_0x65cf49][_0xa7ad('0x12')](queryTelephones);case _0xa7ad('0x14'):return db[_0x65cf49][_0xa7ad('0x12')](queryTrunks);case _0xa7ad('0x15'):return db[_0x65cf49][_0xa7ad('0x12')](queryCampaigns);}}else{return db[_0xa7ad('0x16')][_0xa7ad('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x2b7ece['id']},'raw':!![]})[_0xa7ad('0xb')](function(_0x38baa5){if(_0x38baa5){var _0x48fd53={'where':{'id':_['map'](_0x38baa5,_0xa7ad('0x17'))},'raw':!![]};switch(_0x65cf49){case'User':_0x48fd53['where'][_0xa7ad('0x18')]=_0xa7ad('0x6');break;case'Campaign':_0x48fd53[_0xa7ad('0x19')][_0xa7ad('0x7')]=_0xa7ad('0x8');break;}return db[_0x65cf49][_0xa7ad('0x12')](_0x48fd53);}else{return[];}});}}else{return[];}})[_0xa7ad('0xb')](function(_0xcc1090){return _0xcc1090;});}function joinOrLeaveQueues(_0x5634e4,_0x2e5c04,_0x36fcb5,_0x196aba){_0x5634e4[_0x2e5c04](util[_0xa7ad('0x1a')](_0xa7ad('0x1b'),_0x36fcb5,_0x196aba[_0xa7ad('0x3')]));if(_0x196aba[_0xa7ad('0x4')]){for(var _0x41a84b=0x0;_0x41a84b<_0x196aba['Agents']['length'];_0x41a84b+=0x1){_0x5634e4[_0x2e5c04](util[_0xa7ad('0x1a')]('user:%s',_0x196aba['Agents'][_0x41a84b][_0xa7ad('0x3')]));}}}function joinOrLeave(_0x268039,_0x5f342d,_0x528fc4){var _0x2b1451;if(_0x268039[_0xa7ad('0x1c')][_0xa7ad('0x1d')]['id']){db[_0xa7ad('0x1e')]['find']({'attributes':['id',_0xa7ad('0x3'),_0xa7ad('0x18'),_0xa7ad('0x1f')],'where':{'id':_0x268039['handshake']['query']['id']},'include':[{'model':db[_0xa7ad('0x20')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xa7ad('0x21')],'as':_0xa7ad('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7ad('0x23')],'as':_0xa7ad('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0xa7ad('0x25')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xa7ad('0x26'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x31ce67){if(_0x31ce67){_0x2b1451=_0x31ce67;_0x268039[_0x5f342d](util[_0xa7ad('0x1a')]('user:%s',_0x31ce67[_0xa7ad('0x3')]));var _0x50c54b=[];switch(_0x31ce67['role']){case _0xa7ad('0x27'):_0x268039[_0x5f342d](_0xa7ad('0x28'));_0x268039[_0x5f342d](_0xa7ad('0x29'));if(queryQueues[_0xa7ad('0x2a')](_0xa7ad('0x2b'))){delete queryQueues['include'];}_0x50c54b[_0xa7ad('0x2c')](db[_0xa7ad('0x2d')][_0xa7ad('0x12')](queryQueues));_0x50c54b['push'](db[_0xa7ad('0x2e')][_0xa7ad('0x12')](queryQueues));_0x50c54b[_0xa7ad('0x2c')](db[_0xa7ad('0x2f')][_0xa7ad('0x12')](queryQueues));_0x50c54b[_0xa7ad('0x2c')](db['SmsQueue']['findAll'](queryQueues));_0x50c54b[_0xa7ad('0x2c')](db['MailQueue'][_0xa7ad('0x12')](queryQueues));_0x50c54b[_0xa7ad('0x2c')](db[_0xa7ad('0x30')]['findAll'](queryQueues));_0x50c54b[_0xa7ad('0x2c')](db[_0xa7ad('0x31')][_0xa7ad('0x12')](queryQueues));_0x50c54b[_0xa7ad('0x2c')](db[_0xa7ad('0x1e')][_0xa7ad('0x12')](queryTelephones));_0x50c54b['push'](db['Trunk'][_0xa7ad('0x12')](queryTrunks));_0x50c54b['push'](db[_0xa7ad('0x32')][_0xa7ad('0x12')](queryCampaigns));_0x50c54b[_0xa7ad('0x2c')](db['User'][_0xa7ad('0x12')](queryAgents));break;case'user':_0x268039[_0x5f342d]('voice:inbound');_0x268039[_0x5f342d](_0xa7ad('0x29'));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources(_0xa7ad('0xd'),_0x31ce67[_0xa7ad('0x1f')],_0xa7ad('0x2d')));_0x50c54b['push'](getAssociatedResources(_0xa7ad('0xe'),_0x31ce67['userProfileId'],_0xa7ad('0x2e')));_0x50c54b['push'](getAssociatedResources(_0xa7ad('0x33'),_0x31ce67[_0xa7ad('0x1f')],'FaxQueue'));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources('SmsQueues',_0x31ce67[_0xa7ad('0x1f')],_0xa7ad('0x34')));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources(_0xa7ad('0x10'),_0x31ce67[_0xa7ad('0x1f')],_0xa7ad('0x35')));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources(_0xa7ad('0x36'),_0x31ce67['userProfileId'],_0xa7ad('0x30')));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources(_0xa7ad('0x11'),_0x31ce67[_0xa7ad('0x1f')],_0xa7ad('0x31')));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources(_0xa7ad('0x13'),_0x31ce67['userProfileId'],'User'));_0x50c54b[_0xa7ad('0x2c')](getAssociatedResources(_0xa7ad('0x14'),_0x31ce67[_0xa7ad('0x1f')],_0xa7ad('0x37')));_0x50c54b['push'](getAssociatedResources(_0xa7ad('0x15'),_0x31ce67[_0xa7ad('0x1f')],_0xa7ad('0x32')));_0x50c54b[_0xa7ad('0x2c')](db[_0xa7ad('0x1e')]['findAll'](queryAgents));break;case _0xa7ad('0x5'):_0x268039[_0x5f342d](_0xa7ad('0x28'));_0x268039[_0x5f342d](_0xa7ad('0x29'));_0x50c54b[_0xa7ad('0x2c')](_0x31ce67[_0xa7ad('0x38')]({'attributes':['id',_0xa7ad('0x3')]}));_0x50c54b['push'](_0x31ce67[_0xa7ad('0x39')]({'attributes':['id','name']}));_0x50c54b['push'](_0x31ce67[_0xa7ad('0x3a')]({'attributes':['id',_0xa7ad('0x3')]}));_0x50c54b[_0xa7ad('0x2c')](_0x31ce67[_0xa7ad('0x3b')]({'attributes':['id',_0xa7ad('0x3')]}));_0x50c54b[_0xa7ad('0x2c')](_0x31ce67[_0xa7ad('0x3c')]({'attributes':['id',_0xa7ad('0x3')]}));_0x50c54b['push'](_0x31ce67[_0xa7ad('0x3d')]({'attributes':['id',_0xa7ad('0x3')]}));_0x50c54b[_0xa7ad('0x2c')](_0x31ce67[_0xa7ad('0x3e')]({'attributes':['id',_0xa7ad('0x3')]}));break;}return BPromise['all'](_0x50c54b);}})[_0xa7ad('0xb')](function(_0x43ed54){if(_0x43ed54&&_0x43ed54[_0xa7ad('0x3f')]){for(var _0x29b9fe=0x0;_0x29b9fe<_0x43ed54[_0xa7ad('0x3f')];_0x29b9fe+=0x1){for(var _0x4ee8c7=0x0;_0x4ee8c7<_0x43ed54[_0x29b9fe][_0xa7ad('0x3f')];_0x4ee8c7+=0x1){switch(_0x29b9fe){case 0x0:joinOrLeaveQueues(_0x268039,_0x5f342d,_0xa7ad('0x40'),_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x1:joinOrLeaveQueues(_0x268039,_0x5f342d,_0xa7ad('0x41'),_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x2:joinOrLeaveQueues(_0x268039,_0x5f342d,_0xa7ad('0x42'),_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x3:joinOrLeaveQueues(_0x268039,_0x5f342d,_0xa7ad('0x43'),_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x4:joinOrLeaveQueues(_0x268039,_0x5f342d,_0xa7ad('0x44'),_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x5:joinOrLeaveQueues(_0x268039,_0x5f342d,'openchannel',_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x6:joinOrLeaveQueues(_0x268039,_0x5f342d,_0xa7ad('0x45'),_0x43ed54[_0x29b9fe][_0x4ee8c7]);break;case 0x7:_0x268039[_0x5f342d](util[_0xa7ad('0x1a')]('telephone:%s',_0x43ed54[_0x29b9fe][_0x4ee8c7][_0xa7ad('0x3')]));break;case 0x8:_0x268039[_0x5f342d](util[_0xa7ad('0x1a')](_0xa7ad('0x46'),_0x43ed54[_0x29b9fe][_0x4ee8c7]['name']));break;case 0x9:_0x268039[_0x5f342d](util[_0xa7ad('0x1a')](_0xa7ad('0x47'),_0x43ed54[_0x29b9fe][_0x4ee8c7][_0xa7ad('0x7')],_0x43ed54[_0x29b9fe][_0x4ee8c7][_0xa7ad('0x3')]));break;case 0xa:_0x268039[_0x5f342d](util[_0xa7ad('0x1a')](_0xa7ad('0x48'),_0x43ed54[_0x29b9fe][_0x4ee8c7][_0xa7ad('0x3')]));break;}}}}})['then'](function(){if(_0x5f342d==='leave'){var _0x4c6e40=_[_0xa7ad('0x49')](_0x2b1451['ChatInteractions'],'id');return _0x2b1451[_0xa7ad('0x4a')](_0x4c6e40)[_0xa7ad('0xb')](function(){for(var _0x1af059=0x0;_0x1af059<_0x4c6e40[_0xa7ad('0x3f')];_0x1af059+=0x1){_0x528fc4[_0xa7ad('0x4b')](_0xa7ad('0x4c'),{'ChatInteractionId':Number(_0x4c6e40[_0x1af059]),'UserId':Number(_0x2b1451['id'])});}});}})['then'](function(){if(_0x5f342d==='leave'){var _0x1d9101=_[_0xa7ad('0x49')](_0x2b1451[_0xa7ad('0x22')],'id');return _0x2b1451[_0xa7ad('0x4d')](_0x1d9101)[_0xa7ad('0xb')](function(){for(var _0x549164=0x0;_0x549164<_0x1d9101[_0xa7ad('0x3f')];_0x549164+=0x1){_0x528fc4[_0xa7ad('0x4b')](_0xa7ad('0x4e'),{'MailInteractionId':Number(_0x1d9101[_0x549164]),'UserId':Number(_0x2b1451['id'])});}});}})['then'](function(){if(_0x5f342d===_0xa7ad('0x4f')){var _0x69353c=_['map'](_0x2b1451[_0xa7ad('0x24')],'id');return _0x2b1451[_0xa7ad('0x50')](_0x69353c)[_0xa7ad('0xb')](function(){for(var _0x3b525a=0x0;_0x3b525a<_0x69353c[_0xa7ad('0x3f')];_0x3b525a+=0x1){_0x528fc4[_0xa7ad('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x69353c[_0x3b525a]),'UserId':Number(_0x2b1451['id'])});}});}})[_0xa7ad('0xb')](function(){if(_0x5f342d===_0xa7ad('0x4f')){var _0x5c33da=_[_0xa7ad('0x49')](_0x2b1451[_0xa7ad('0x51')],'id');return _0x2b1451['removeSmsInteractions'](_0x5c33da)[_0xa7ad('0xb')](function(){for(var _0x3f9448=0x0;_0x3f9448<_0x5c33da[_0xa7ad('0x3f')];_0x3f9448+=0x1){_0x528fc4[_0xa7ad('0x4b')](_0xa7ad('0x52'),{'SmsInteractionId':Number(_0x5c33da[_0x3f9448]),'UserId':Number(_0x2b1451['id'])});}});}})['then'](function(){if(_0x5f342d===_0xa7ad('0x4f')){var _0x10cb72=_['map'](_0x2b1451['OpenchannelInteractions'],'id');return _0x2b1451[_0xa7ad('0x53')](_0x10cb72)[_0xa7ad('0xb')](function(){for(var _0x4fcabf=0x0;_0x4fcabf<_0x10cb72[_0xa7ad('0x3f')];_0x4fcabf+=0x1){_0x528fc4[_0xa7ad('0x4b')](_0xa7ad('0x54'),{'OpenchannelInteractionId':Number(_0x10cb72[_0x4fcabf]),'UserId':Number(_0x2b1451['id'])});}});}})[_0xa7ad('0xb')](function(){if(_0x5f342d===_0xa7ad('0x4f')){var _0x4bce05=_[_0xa7ad('0x49')](_0x2b1451[_0xa7ad('0x26')],'id');return _0x2b1451['removeWhatsappInteractions'](_0x4bce05)[_0xa7ad('0xb')](function(){for(var _0x4763ac=0x0;_0x4763ac<_0x4bce05[_0xa7ad('0x3f')];_0x4763ac+=0x1){_0x528fc4['emit'](_0xa7ad('0x55'),{'WhatsappInteractionId':Number(_0x4bce05[_0x4763ac]),'UserId':Number(_0x2b1451['id'])});}});}})[_0xa7ad('0x56')](function(_0x11a782){_0x268039['log'](_0x11a782);});}}function onDisconnect(_0x332ae5,_0x51dc3a){joinOrLeave(_0x332ae5,_0xa7ad('0x4f'),_0x51dc3a);}function onConnect(_0x3896a3){joinOrLeave(_0x3896a3,'join');}exports[_0xa7ad('0x57')]=function(_0x764671){_0x764671['on'](_0xa7ad('0x58'),function(_0x121ac0){_0x121ac0['setMaxListeners'](0x0);_0x121ac0[_0xa7ad('0x59')]=_0x121ac0['request'][_0xa7ad('0x58')]['remoteAddress']+':'+_0x121ac0[_0xa7ad('0x5a')][_0xa7ad('0x58')][_0xa7ad('0x5b')];_0x121ac0[_0xa7ad('0x5c')]=new Date();_0x121ac0['log']=function(_0x1a7245){console[_0xa7ad('0x5d')]('SocketIO\x20'+_0x121ac0[_0xa7ad('0x5e')][_0xa7ad('0x3')]+'['+_0x121ac0[_0xa7ad('0x59')]+']',_0x1a7245);};_0x121ac0['on'](_0xa7ad('0x5f'),function(){onDisconnect(_0x121ac0,_0x764671);_0x121ac0[_0xa7ad('0x5d')](_0xa7ad('0x60'));});onConnect(_0x121ac0);_0x121ac0[_0xa7ad('0x5d')](_0xa7ad('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 66ad685..9da6e48 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 _0xd2aa=['SIP/%s','incomingmessage','outgoingmessage','opened','closed','format','default','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','http','Chat','newinteraction','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','Sms','SmsInteraction','newmessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','UserId','User','find','name','interface'];(function(_0x45b969,_0x547f78){var _0x2cf9ca=function(_0x47cc55){while(--_0x47cc55){_0x45b969['push'](_0x45b969['shift']());}};_0x2cf9ca(++_0x547f78);}(_0xd2aa,0xb9));var _0xad2a=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0xd2aa[_0x3ec333];return _0x15ccb8;};'use strict';var util=require(_0xad2a('0x0'));var db=require(_0xad2a('0x1'))['db'];var jayson=require(_0xad2a('0x2'));var logger=require(_0xad2a('0x3'))(_0xad2a('0x4'));var client=jayson[_0xad2a('0x5')][_0xad2a('0x6')]({'port':0x232a});var triggers=[{'channel':_0xad2a('0x7'),'model':'ChatInteraction','event':'afterCreate','condition':_0xad2a('0x8'),'callback':afterCreate},{'channel':_0xad2a('0x7'),'model':_0xad2a('0x9'),'event':_0xad2a('0xa'),'condition':_0xad2a('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0xad2a('0xc'),'event':_0xad2a('0xd'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xad2a('0xe'),'model':_0xad2a('0xf'),'event':_0xad2a('0xd'),'condition':_0xad2a('0x8'),'callback':afterCreate},{'channel':_0xad2a('0xe'),'model':'SmsInteraction','event':_0xad2a('0xa'),'condition':_0xad2a('0xb'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0xad2a('0xd'),'condition':_0xad2a('0x10'),'callback':afterCreateMessage},{'channel':_0xad2a('0x11'),'model':_0xad2a('0x12'),'event':_0xad2a('0xd'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xad2a('0x11'),'model':'WhatsappInteraction','event':_0xad2a('0xa'),'condition':_0xad2a('0xb'),'callback':afterUpdate},{'channel':_0xad2a('0x11'),'model':_0xad2a('0x13'),'event':_0xad2a('0xd'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xad2a('0x14'),'model':_0xad2a('0x15'),'event':_0xad2a('0xd'),'condition':_0xad2a('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0xad2a('0x15'),'event':_0xad2a('0xa'),'condition':_0xad2a('0xb'),'callback':afterUpdate},{'channel':_0xad2a('0x14'),'model':_0xad2a('0x16'),'event':_0xad2a('0xd'),'condition':_0xad2a('0x10'),'callback':afterCreateMessage},{'channel':_0xad2a('0x17'),'model':_0xad2a('0x18'),'event':_0xad2a('0xd'),'condition':_0xad2a('0x8'),'callback':afterCreate},{'channel':_0xad2a('0x17'),'model':_0xad2a('0x18'),'event':_0xad2a('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xad2a('0x17'),'model':_0xad2a('0x19'),'event':'afterCreate','condition':_0xad2a('0x10'),'callback':afterCreateMessage},{'channel':_0xad2a('0x1a'),'model':_0xad2a('0x1b'),'event':'afterCreate','condition':_0xad2a('0x8'),'callback':afterCreate},{'channel':_0xad2a('0x1a'),'model':'OpenchannelInteraction','event':_0xad2a('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xad2a('0x1a'),'model':'OpenchannelMessage','event':'afterCreate','condition':_0xad2a('0x10'),'callback':afterCreateMessage}];function request(_0x1c60c9){return client[_0xad2a('0x1c')](_0xad2a('0x1d'),_0x1c60c9)[_0xad2a('0x1e')](function(_0x546182){logger['info'](_0xad2a('0x1f'),_0xad2a('0x1d'),_0x546182);if(_0x546182[_0xad2a('0x20')]){if(_0x546182[_0xad2a('0x20')][_0xad2a('0x21')]===0x1f4){logger[_0xad2a('0x20')](_0xad2a('0x1f'),_0xad2a('0x1d'),_0x546182[_0xad2a('0x20')]);}}})[_0xad2a('0x22')](function(_0x36cec6){logger['error'](_0xad2a('0x1f'),_0xad2a('0x1d'),_0x36cec6);});}function afterCreateMessage(_0x599fdb,_0x4f5d62){return function(_0x5c7946,_0x34b69a){_0x5c7946=_0x5c7946[_0xad2a('0x23')]({'plain':!![]});_0x5c7946[_0xad2a('0x24')]=_0x599fdb;_0x5c7946[_0xad2a('0x25')]=_0x5c7946['direction'];if(_0x5c7946[_0xad2a('0x26')]){return db[_0xad2a('0x27')][_0xad2a('0x28')]({'where':{'id':_0x5c7946['UserId']},'attributes':['id',_0xad2a('0x29')],'raw':!![]})[_0xad2a('0x1e')](function(_0x271551){_0x5c7946[_0xad2a('0x2a')]=util['format'](_0xad2a('0x2b'),_0x271551[_0xad2a('0x29')]);_0x5c7946[_0xad2a('0x24')]=_0x599fdb;return request({'event':_0xad2a('0x2c'),'message':_0x5c7946});})[_0xad2a('0x22')](function(_0x146ff3){console['error'](_0x146ff3);});}else{return request({'event':_0xad2a('0x2d'),'message':_0x5c7946});}};}function afterCreate(_0x4f3f3f,_0x5a7309){return function(_0x169cf2,_0xf6a85d){_0x169cf2=_0x169cf2[_0xad2a('0x23')]({'plain':!![]});_0x169cf2[_0xad2a('0x24')]=_0x4f3f3f;_0x169cf2[_0xad2a('0x25')]=_0xad2a('0x2e');return request({'event':_0x5a7309,'message':_0x169cf2});};}function afterUpdate(_0x5d2a48,_0x5988b9){return function(_0x24524c,_0x2ddd2a){if(_0x24524c['changed'](_0xad2a('0x2f'))&&_0x24524c[_0xad2a('0x2f')]){_0x24524c=_0x24524c[_0xad2a('0x23')]({'plain':!![]});_0x24524c['channel']=_0x5d2a48;_0x24524c[_0xad2a('0x25')]=_0xad2a('0x2f');if(_0x24524c[_0xad2a('0x26')]){return db[_0xad2a('0x27')][_0xad2a('0x28')]({'where':{'id':_0x24524c[_0xad2a('0x26')]},'attributes':['id',_0xad2a('0x29')],'raw':!![]})[_0xad2a('0x1e')](function(_0x11a452){_0x24524c[_0xad2a('0x2a')]=util[_0xad2a('0x30')](_0xad2a('0x2b'),_0x11a452[_0xad2a('0x29')]);return request({'event':_0x5988b9,'message':_0x24524c});})[_0xad2a('0x22')](function(_0x4e96b1){console[_0xad2a('0x20')](_0x4e96b1);});}else{return request({'event':_0x5988b9,'message':_0x24524c});}}};}exports[_0xad2a('0x31')]=function(){for(var _0x2404ed=0x0;_0x2404ed=_0x2e6fec['agents']){throw Error(_0xc0ec('0x16'));}_0x372469(_0x18fed6);})[_0xc0ec('0x17')](function(_0x126308){_0x499a41(_0x126308);});});}; \ No newline at end of file +var _0xc391=['chat','fax','sms','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','mail'];(function(_0x4ce14f,_0x47ac02){var _0x2b4824=function(_0x570f5e){while(--_0x570f5e){_0x4ce14f['push'](_0x4ce14f['shift']());}};_0x2b4824(++_0x47ac02);}(_0xc391,0xee));var _0x1c39=function(_0x26c8d5,_0x1042a8){_0x26c8d5=_0x26c8d5-0x0;var _0x5d970c=_0xc391[_0x26c8d5];return _0x5d970c;};'use strict';var _=require(_0x1c39('0x0'));var BPromise=require(_0x1c39('0x1'));var db=require(_0x1c39('0x2'))['db'];var util=require('./license/util');var channels=['voice',_0x1c39('0x3'),_0x1c39('0x4'),_0x1c39('0x5'),_0x1c39('0x6'),'whatsapp',_0x1c39('0x7')];exports[_0x1c39('0x8')]=function(){return channels;};exports[_0x1c39('0x9')]=function(_0x30ad3){_0x30ad3=_0x30ad3[_0x1c39('0xa')]();return _[_0x1c39('0xb')](channels,_0x30ad3);};exports[_0x1c39('0xc')]=function(_0x34271f,_0x4b161b,_0x1e9766,_0x12e0ef){var _0x24312d={'loginAttempts':_0x4b161b,'blocked':_0x1e9766};if(!_['isUndefined'](_0x12e0ef)){_0x24312d['blockedAt']=_0x12e0ef;}return _0x34271f['updateAttributes'](_0x24312d);};exports[_0x1c39('0xd')]=function(_0x3a959c){return new BPromise(function(_0x3a7e68,_0x828609){var _0x2bb7ef=0x0;if(_0x3a959c[_0x1c39('0xe')]!==_0x1c39('0xf')){_0x3a7e68(_0x3a959c);}db[_0x1c39('0x10')][_0x1c39('0x11')]({'where':{'role':_0x1c39('0xf'),'online':!![],'id':{'$ne':_0x3a959c['id']}}})['then'](function(_0x522212){_0x2bb7ef=_0x522212;return util[_0x1c39('0xd')]();})[_0x1c39('0x12')](function(_0x1423bc){if(_0x1423bc&&_0x1423bc[_0x1c39('0x13')]&&_0x2bb7ef>=_0x1423bc[_0x1c39('0x13')]){throw Error(_0x1c39('0x14'));}_0x3a7e68(_0x3a959c);})[_0x1c39('0x15')](function(_0x4ca0da){_0x828609(_0x4ca0da);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fecf30e..d56b512 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7932=['send','status','render'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7932,0x1d5));var _0x2793=function(_0x449ed8,_0x25ce18){_0x449ed8=_0x449ed8-0x0;var _0x2b6b62=_0x7932[_0x449ed8];return _0x2b6b62;};'use strict';module['exports'][0x194]=function pageNotFound(_0x190578,_0x2bbe93){var _0x3a9d23='404';var _0x247189=0x194;var _0x3f1635={'status':_0x247189};_0x2bbe93[_0x2793('0x0')](_0x3f1635['status']);_0x2bbe93[_0x2793('0x1')](_0x3a9d23,{},function(_0x3aab08,_0x2bb280){if(_0x3aab08){return _0x2bbe93['status'](_0x3f1635[_0x2793('0x0')])['json'](_0x3f1635);}_0x2bbe93[_0x2793('0x2')](_0x2bb280);});}; \ No newline at end of file +var _0x1cf4=['render','json','send','exports','404','status'];(function(_0x4b08be,_0xa3caac){var _0x30b817=function(_0x7624aa){while(--_0x7624aa){_0x4b08be['push'](_0x4b08be['shift']());}};_0x30b817(++_0xa3caac);}(_0x1cf4,0x195));var _0x41cf=function(_0x54f9af,_0x57f4c4){_0x54f9af=_0x54f9af-0x0;var _0x488b5d=_0x1cf4[_0x54f9af];return _0x488b5d;};'use strict';module[_0x41cf('0x0')][0x194]=function pageNotFound(_0x17d26d,_0x29b113){var _0x8f85a4=_0x41cf('0x1');var _0x5b0318=0x194;var _0x104355={'status':_0x5b0318};_0x29b113['status'](_0x104355[_0x41cf('0x2')]);_0x29b113[_0x41cf('0x3')](_0x8f85a4,{},function(_0x5836dd,_0x6f7240){if(_0x5836dd){return _0x29b113[_0x41cf('0x2')](_0x104355[_0x41cf('0x2')])[_0x41cf('0x4')](_0x104355);}_0x29b113[_0x41cf('0x5')](_0x6f7240);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 577b457..dcc2a4a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x207c=['sequelizeHistory','xcall','xC@LL1234','127.0.0.1','username','password','options','database','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/cannedAnswer/cannedAnswer.model','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','Trigger','Variable','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','SmsQueueReport','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../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','../api/userProfile/userProfile.model','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','User','hasOne','cascade','UserId','hasMany','VoiceQueuesRt','VoiceExtension','CmHopperFinal','HopperFinals','HopperHistory','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','OpenchannelInteractions','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','SmsAccount','SmsAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','AgentReports','ContactId','MailAccountId','Imap','Smtp','Disposition','CannedAnswer','MailMessage','Interactions','Applications','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Contact','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','MailApplication','restrict','TagId','Items','Dispositions','Exntensions','Owner','fax_interaction_has_tags','FaxInteractionId','AttachmentId','Account','FaxAccountId','SmsAccountId','Answers','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteraction','OpenchannelMessage','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatProactiveAction','ChatApplication','ChatQueueId','ChatWebsiteId','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','ChatGroupId','Website','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Agent','Queue','CampaignId','All','AutomationAllId','Condition','Any','OneAny','Actions','Intervals','Extensions','MailApplications','ChatApplications','SmsApplications','AnalyticCustomReport','Sound','Mohs','whatsapp_interaction_has_tags','TriggerAllId','AnyConditions','TriggerId','Fields','CustomReportId','AnalyticFieldReport','DefaultReportId','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','Subjects','Description','DeskField','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','VtigerAccount','VtigerField','Dynamics365Configuration','FreshsalesAccount','FromId','ToId','JscriptyQuestionReport','JscriptyProject','ProjectId','team_has_voice_queues','VoiceQueues','team_has_fax_queues','WhatsappQueue','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_blacklists','FromUserId','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappTransferReport','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','mysql','utf8mb4','name','utf8_general_ci'];(function(_0xf0330b,_0x814253){var _0x538518=function(_0x9c7d43){while(--_0x9c7d43){_0xf0330b['push'](_0xf0330b['shift']());}};_0x538518(++_0x814253);}(_0x207c,0x1e8));var _0xc207=function(_0x3598bb,_0x24befa){_0x3598bb=_0x3598bb-0x0;var _0x13c837=_0x207c[_0x3598bb];return _0x13c837;};'use strict';var path=require('path');var config=require(_0xc207('0x0'));var Sequelize=require(_0xc207('0x1'));var _=require(_0xc207('0x2'));var jstz=require(_0xc207('0x3'));var timezone=jstz[_0xc207('0x4')]();config[_0xc207('0x1')]=_[_0xc207('0x5')](config['sequelize'],{'database':_0xc207('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xc207('0x7'),'dialectOptions':{'charset':_0xc207('0x8')},'logging':![],'timezone':timezone[_0xc207('0x9')](),'define':{'charset':'utf8','collate':_0xc207('0xa')}}});config[_0xc207('0xb')]=_[_0xc207('0x5')](config['sequelizeHistory'],{'database':_0xc207('0x6'),'username':_0xc207('0xc'),'password':_0xc207('0xd'),'options':{'host':_0xc207('0xe'),'port':0xcea,'dialect':_0xc207('0x7'),'dialectOptions':{'charset':_0xc207('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc207('0x1')]['database'],config[_0xc207('0x1')][_0xc207('0xf')],config['sequelize'][_0xc207('0x10')],config[_0xc207('0x1')][_0xc207('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xc207('0xb')][_0xc207('0x12')],config['sequelizeHistory'][_0xc207('0xf')],config[_0xc207('0xb')][_0xc207('0x10')],config[_0xc207('0xb')]['options'])};db['User']=db['sequelize'][_0xc207('0x13')](_0xc207('0x14'));db[_0xc207('0x15')]=db[_0xc207('0x1')]['import'](_0xc207('0x16'));db[_0xc207('0x17')]=db[_0xc207('0x1')]['import'](_0xc207('0x18'));db['VoiceExtension']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x19'));db[_0xc207('0x1a')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x1b'));db[_0xc207('0x1c')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x1d'));db[_0xc207('0x1e')]=db[_0xc207('0x1')]['import'](_0xc207('0x1f'));db['ScreenRecording']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x20'));db[_0xc207('0x21')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x22'));db[_0xc207('0x23')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x24'));db[_0xc207('0x25')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x26'));db['VoiceDialReport']=db[_0xc207('0x1')]['import']('../api/voiceDialReport/voiceDialReport.model');db[_0xc207('0x27')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x28'));db[_0xc207('0x29')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x2a'));db[_0xc207('0x2b')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x2c'));db[_0xc207('0x2d')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x2e'));db[_0xc207('0x2f')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xc207('0x30')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x31'));db[_0xc207('0x32')]=db[_0xc207('0x1')]['import'](_0xc207('0x33'));db[_0xc207('0x34')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0xc207('0x35')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x36'));db[_0xc207('0x37')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x38'));db[_0xc207('0x39')]=db['sequelize']['import'](_0xc207('0x3a'));db[_0xc207('0x3b')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xc207('0x3c')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x3d'));db[_0xc207('0x3e')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x3f'));db['MailServerOut']=db[_0xc207('0x1')]['import'](_0xc207('0x40'));db[_0xc207('0x41')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x42'));db[_0xc207('0x43')]=db['sequelize']['import'](_0xc207('0x44'));db[_0xc207('0x45')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0xc207('0x46')]=db['sequelize']['import']('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x47'));db['MailApplication']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x48'));db[_0xc207('0x49')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x4a'));db[_0xc207('0x4b')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/dashboard/dashboard.model');db[_0xc207('0x4c')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x4d'));db[_0xc207('0x4e')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x4f'));db[_0xc207('0x50')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x51'));db['FaxInteraction']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x52'));db[_0xc207('0x53')]=db[_0xc207('0x1')]['import'](_0xc207('0x54'));db[_0xc207('0x55')]=db[_0xc207('0x1')]['import'](_0xc207('0x56'));db[_0xc207('0x57')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x58'));db[_0xc207('0x59')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x5a'));db[_0xc207('0x5b')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x5c'));db[_0xc207('0x5d')]=db['sequelize']['import'](_0xc207('0x5e'));db[_0xc207('0x5f')]=db[_0xc207('0x1')]['import'](_0xc207('0x60'));db[_0xc207('0x61')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0xc207('0x62')]=db['sequelize'][_0xc207('0x13')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0xc207('0x1')][_0xc207('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db['sequelize'][_0xc207('0x13')](_0xc207('0x63'));db[_0xc207('0x64')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x65'));db[_0xc207('0x66')]=db[_0xc207('0x1')]['import'](_0xc207('0x67'));db[_0xc207('0x68')]=db['sequelize']['import'](_0xc207('0x69'));db['ChatApplication']=db['sequelize'][_0xc207('0x13')](_0xc207('0x6a'));db[_0xc207('0x6b')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x6c'));db[_0xc207('0x6d')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x6e'));db[_0xc207('0x6f')]=db['sequelize']['import'](_0xc207('0x70'));db[_0xc207('0x71')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x72'));db[_0xc207('0x73')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x74'));db['ChatProactiveAction']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x75'));db[_0xc207('0x76')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x77'));db[_0xc207('0x78')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x79'));db[_0xc207('0x7a')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x7b'));db[_0xc207('0x7c')]=db[_0xc207('0x1')]['import'](_0xc207('0x7d'));db['CmHopperFinal']=db['sequelize'][_0xc207('0x13')](_0xc207('0x7e'));db[_0xc207('0x7f')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x80'));db[_0xc207('0x81')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x82'));db[_0xc207('0x83')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x84'));db[_0xc207('0x85')]=db['sequelize'][_0xc207('0x13')]('../api/action/action.model');db[_0xc207('0x86')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/automation/automation.model');db['CannedAnswer']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x87'));db['Disposition']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x88'));db['Condition']=db['sequelize'][_0xc207('0x13')]('../api/condition/condition.model');db[_0xc207('0x89')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x8a'));db[_0xc207('0x8b')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x8c'));db['Cdr']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x8d'));db[_0xc207('0x8e')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x8f'));db[_0xc207('0x90')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x91'));db['Sound']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x92'));db[_0xc207('0x93')]=db['sequelize']['import'](_0xc207('0x94'));db[_0xc207('0x95')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/template/template.model');db[_0xc207('0x96')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/trigger/trigger.model');db[_0xc207('0x97')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/variable/variable.model');db[_0xc207('0x98')]=db['sequelize'][_0xc207('0x13')]('../api/integration/integration.model');db[_0xc207('0x99')]=db[_0xc207('0x1')]['import'](_0xc207('0x9a'));db['AnalyticCustomReport']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x9b'));db[_0xc207('0x9c')]=db[_0xc207('0x1')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xc207('0x9d')]=db[_0xc207('0x1')]['import'](_0xc207('0x9e'));db[_0xc207('0x9f')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xa0'));db['AnalyticFieldReport']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xa1'));db[_0xc207('0xa2')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xa3'));db[_0xc207('0xa4')]=db[_0xc207('0x1')]['import'](_0xc207('0xa5'));db['SalesforceField']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xa6'));db[_0xc207('0xa7')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xc207('0xa8')]=db[_0xc207('0x1')]['import'](_0xc207('0xa9'));db[_0xc207('0xaa')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xab'));db[_0xc207('0xac')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xad'));db[_0xc207('0xae')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xaf'));db['DeskField']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xb0'));db[_0xc207('0xb1')]=db['sequelize'][_0xc207('0x13')]('../api/intZohoAccount/intZohoAccount.model');db[_0xc207('0xb2')]=db['sequelize']['import'](_0xc207('0xb3'));db[_0xc207('0xb4')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xb5'));db[_0xc207('0xb6')]=db['sequelize'][_0xc207('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xc207('0xb7')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xb8'));db['ZendeskField']=db[_0xc207('0x1')][_0xc207('0x13')]('../api/intZendeskField/intZendeskField.model');db[_0xc207('0xb9')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xba'));db['FreshdeskConfiguration']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xbb'));db[_0xc207('0xbc')]=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xbd'));db[_0xc207('0xbe')]=db['sequelize']['import'](_0xc207('0xbf'));db['VtigerField']=db['sequelize'][_0xc207('0x13')](_0xc207('0xc0'));db[_0xc207('0xc1')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xc207('0xc2')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xc3'));db[_0xc207('0xc4')]=db['sequelize']['import'](_0xc207('0xc5'));db[_0xc207('0xc6')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0xc207('0x1')]['import'](_0xc207('0xc7'));db[_0xc207('0xc8')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xc9'));db['FreshsalesAccount']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xca'));db[_0xc207('0xcb')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xcc'));db[_0xc207('0xcd')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0xc207('0x98')]=db['sequelize']['import'](_0xc207('0xce'));db[_0xc207('0xcf')]=db['sequelize']['import'](_0xc207('0xd0'));db[_0xc207('0xd1')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0xc207('0xd2')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xd3'));db[_0xc207('0xd4')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xd5'));db['JscriptyQuestionReport']=db[_0xc207('0x1')][_0xc207('0x13')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xc207('0xd6')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/smsQueueReport/smsQueueReport.model');db[_0xc207('0xd7')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xd8'));db[_0xc207('0xd9')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xda'));db['JscriptyProject']=db[_0xc207('0x1')]['import'](_0xc207('0xdb'));db['Setting']=db[_0xc207('0x1')]['import'](_0xc207('0xdc'));db[_0xc207('0xdd')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xde'));db[_0xc207('0xdf')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xe0'));db[_0xc207('0xe1')]=db[_0xc207('0x1')]['import'](_0xc207('0xe2'));db[_0xc207('0xe3')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xe4'));db[_0xc207('0xe5')]=db[_0xc207('0x1')]['import'](_0xc207('0xe6'));db[_0xc207('0xe7')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/license/license.model');db[_0xc207('0xe8')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xe9'));db[_0xc207('0xea')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xeb'));db[_0xc207('0xec')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xed'));db[_0xc207('0xee')]=db[_0xc207('0x1')]['import'](_0xc207('0xef'));db[_0xc207('0xf0')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xf1'));db[_0xc207('0xf2')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xf3'));db[_0xc207('0xf4')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xf5'));db[_0xc207('0xf6')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xf7'));db[_0xc207('0xf8')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xf9'));db[_0xc207('0xfa')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/cmList/cmList.model');db[_0xc207('0xfb')]=db['sequelize']['import'](_0xc207('0xfc'));db[_0xc207('0xfd')]=db['sequelize'][_0xc207('0x13')](_0xc207('0xfe'));db['UserProfileSection']=db[_0xc207('0x1')][_0xc207('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0xff'));db[_0xc207('0x100')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x101'));db[_0xc207('0x102')]=db['sequelize'][_0xc207('0x13')](_0xc207('0x103'));db[_0xc207('0x104')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x105'));db[_0xc207('0x106')]=db[_0xc207('0x1')][_0xc207('0x13')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xc207('0x107')]=db['sequelize']['import'](_0xc207('0x108'));db[_0xc207('0x109')]=db[_0xc207('0x1')][_0xc207('0x13')](_0xc207('0x10a'));db['WhatsappTransferReport']=db[_0xc207('0x1')][_0xc207('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0xc207('0x1')]['import'](_0xc207('0x10b'));db[_0xc207('0x10c')]=db[_0xc207('0x1')]['import'](_0xc207('0x10d'));db[_0xc207('0x10e')][_0xc207('0x10f')](db[_0xc207('0x21')],{'as':'VoiceMail','onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x111')});db['User'][_0xc207('0x112')](db[_0xc207('0x1e')],{'as':'Recordings','foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x30')],{'as':_0xc207('0x113'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x114')],{'as':'Extensions','onDelete':_0xc207('0x110'),'hooks':!![]});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x115')],{'as':_0xc207('0x116'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x7f')],{'as':_0xc207('0x117'),'foreignKey':_0xc207('0x111')});db['User'][_0xc207('0x112')](db['ReportAgentPreview'],{'as':_0xc207('0x81'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x6b')],{'as':_0xc207('0x118'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x5b')],{'as':_0xc207('0x119'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x11a')],{'as':_0xc207('0x11b'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x46')],{'as':_0xc207('0x11c'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x10e')]['hasMany'](db[_0xc207('0x106')],{'as':_0xc207('0x11d'),'foreignKey':'UserId'});db[_0xc207('0x10e')][_0xc207('0x112')](db[_0xc207('0x100')],{'as':'Notifications','foreignKey':_0xc207('0x11e')});db[_0xc207('0x10e')][_0xc207('0x11f')](db[_0xc207('0xfd')],{'as':_0xc207('0xfd'),'foreignKey':_0xc207('0x120')});db[_0xc207('0x10e')][_0xc207('0x121')](db['ChatGroup'],{'as':_0xc207('0x122'),'through':_0xc207('0x123')});db[_0xc207('0x10e')][_0xc207('0x121')](db['CmContact'],{'as':_0xc207('0x124'),'through':'cm_user_has_contacts'});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0xfa')],{'as':'Lists','through':_0xc207('0x125')});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0xe5')],{'through':_0xc207('0x126')});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0x46')],{'as':_0xc207('0x11c'),'through':_0xc207('0x127')});db[_0xc207('0x10e')]['belongsToMany'](db['ChatInteraction'],{'as':_0xc207('0x118'),'through':_0xc207('0x128')});db[_0xc207('0x10e')]['belongsToMany'](db[_0xc207('0x11a')],{'as':_0xc207('0x11b'),'through':_0xc207('0x129')});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0x5b')],{'as':_0xc207('0x119'),'through':'user_has_sms_interactions'});db[_0xc207('0x10e')][_0xc207('0x121')](db['OpenchannelInteraction'],{'as':_0xc207('0x12a'),'through':'user_has_openchannel_interactions'});db[_0xc207('0x10e')]['belongsToMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0x1c')],{'as':'VoiceQueues','through':_0xc207('0x32'),'required':![]});db[_0xc207('0x10e')]['belongsToMany'](db[_0xc207('0x43')],{'as':_0xc207('0x12b'),'through':_0xc207('0x35'),'required':![]});db['User'][_0xc207('0x121')](db['ChatQueue'],{'as':_0xc207('0x12c'),'through':_0xc207('0x34'),'required':![],'hooks':!![]});db['User'][_0xc207('0x121')](db['FaxQueue'],{'as':_0xc207('0x12d'),'through':'UserFaxQueue','required':![]});db['User'][_0xc207('0x121')](db[_0xc207('0x5f')],{'as':_0xc207('0x12e'),'through':_0xc207('0x39'),'required':![]});db['User']['belongsToMany'](db[_0xc207('0x64')],{'as':_0xc207('0x12f'),'through':_0xc207('0x3b'),'required':![]});db[_0xc207('0x10e')][_0xc207('0x121')](db['WhatsappQueue'],{'as':_0xc207('0x130'),'through':'UserWhatsappQueue','required':![]});db['User'][_0xc207('0x121')](db[_0xc207('0xfa')],{'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0xc207('0xfb')],{'as':_0xc207('0x131'),'through':_0xc207('0x132'),'required':![]});db[_0xc207('0x10e')]['belongsToMany'](db[_0xc207('0x66')],{'as':_0xc207('0x133'),'through':'user_has_chat_websites'});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0x4e')],{'as':_0xc207('0x134'),'through':_0xc207('0x135')});db[_0xc207('0x10e')][_0xc207('0x121')](db[_0xc207('0x41')],{'as':_0xc207('0x136'),'through':'user_has_mail_accounts'});db['User'][_0xc207('0x121')](db[_0xc207('0x61')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xc207('0x10e')]['belongsToMany'](db[_0xc207('0x137')],{'as':_0xc207('0x138'),'through':'user_has_sms_accounts'});db[_0xc207('0x10e')][_0xc207('0x121')](db['WhatsappAccount'],{'as':'WhatsappAccounts','through':_0xc207('0x139')});db[_0xc207('0x10e')][_0xc207('0x121')](db['SquareProject'],{'as':_0xc207('0x13a'),'through':_0xc207('0x13b')});db[_0xc207('0x15')][_0xc207('0x112')](db['VoiceExtension'],{'as':_0xc207('0x13c'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x13d')});db[_0xc207('0x17')][_0xc207('0x112')](db[_0xc207('0x114')],{'onDelete':_0xc207('0x110')});db[_0xc207('0x114')]['hasMany'](db[_0xc207('0x114')],{'as':'Applications','onDelete':_0xc207('0x110')});db[_0xc207('0x1a')][_0xc207('0x121')](db['Sound'],{'as':_0xc207('0x13e'),'through':_0xc207('0x13f')});db['VoiceQueue']['hasMany'](db['UserVoiceQueueRt'],{'as':_0xc207('0x140'),'foreignKey':_0xc207('0x141')});db[_0xc207('0x1c')][_0xc207('0x112')](db[_0xc207('0x7a')],{'as':_0xc207('0x142'),'foreignKey':_0xc207('0x141')});db[_0xc207('0x1c')][_0xc207('0x112')](db[_0xc207('0x115')],{'as':_0xc207('0x116'),'foreignKey':_0xc207('0x141')});db[_0xc207('0x1c')][_0xc207('0x112')](db[_0xc207('0x7f')],{'as':_0xc207('0x143'),'foreignKey':_0xc207('0x141')});db[_0xc207('0x1c')][_0xc207('0x112')](db[_0xc207('0x81')],{'as':'ReportAgentPreview','foreignKey':_0xc207('0x141')});db[_0xc207('0x1c')][_0xc207('0x112')](db['CmHopperBlack'],{'as':_0xc207('0x144'),'foreignKey':'VoiceQueueId'});db[_0xc207('0x1c')][_0xc207('0x112')](db[_0xc207('0x145')],{'as':_0xc207('0x146'),'foreignKey':_0xc207('0x141')});db['VoiceQueue'][_0xc207('0x11f')](db[_0xc207('0x2d')],{'as':_0xc207('0x2d'),'foreignKey':_0xc207('0x147')});db['VoiceQueue']['belongsTo'](db[_0xc207('0x2d')],{'as':_0xc207('0x148'),'foreignKey':_0xc207('0x149')});db[_0xc207('0x1c')][_0xc207('0x11f')](db[_0xc207('0x89')],{'as':_0xc207('0x89'),'foreignKey':_0xc207('0x14a')});db[_0xc207('0x1c')][_0xc207('0x11f')](db[_0xc207('0x8b')],{'as':_0xc207('0x14b'),'foreignKey':_0xc207('0x14c')});db[_0xc207('0x1c')]['belongsToMany'](db['CmList'],{'as':_0xc207('0x14d'),'through':_0xc207('0x14e')});db[_0xc207('0x1c')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db['Team'],{'as':_0xc207('0x150'),'through':'team_has_voice_queues'});db[_0xc207('0x1c')][_0xc207('0x121')](db[_0xc207('0xfa')],{'as':_0xc207('0x151'),'through':_0xc207('0x152')});db[_0xc207('0x1e')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'as':_0xc207('0x10e'),'foreignKey':'UserId'});db['ScreenRecording'][_0xc207('0x11f')](db['User'],{'as':_0xc207('0x10e'),'foreignKey':'UserId'});db[_0xc207('0x21')][_0xc207('0x112')](db[_0xc207('0x23')],{'as':_0xc207('0x153'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0xc207('0x154')});db[_0xc207('0x23')]['belongsTo'](db[_0xc207('0x21')],{'foreignKey':_0xc207('0x155'),'targetKey':_0xc207('0x154')});db['VoiceCallReport'][_0xc207('0x112')](db[_0xc207('0x29')],{'as':_0xc207('0x156'),'foreignKey':_0xc207('0x157'),'constraints':![]});db['VoiceCallReport'][_0xc207('0x112')](db[_0xc207('0x27')],{'as':_0xc207('0x158'),'foreignKey':_0xc207('0x157'),'constraints':![]});db[_0xc207('0x25')]['belongsTo'](db[_0xc207('0x10e')],{'as':_0xc207('0x10e'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x25')]['belongsTo'](db[_0xc207('0x78')],{'as':'Contact','foreignKey':_0xc207('0x159')});db[_0xc207('0x3e')]['belongsTo'](db[_0xc207('0x41')],{'as':_0xc207('0x41'),'foreignKey':_0xc207('0x15a')});db['MailServerOut'][_0xc207('0x11f')](db[_0xc207('0x41')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['MailAccount']['hasOne'](db[_0xc207('0x3e')],{'as':_0xc207('0x15b'),'onDelete':_0xc207('0x110')});db['MailAccount']['hasOne'](db['MailServerOut'],{'as':_0xc207('0x15c'),'onDelete':'cascade'});db[_0xc207('0x41')][_0xc207('0x112')](db[_0xc207('0x15d')],{'as':'Dispositions','foreignKey':_0xc207('0x15a')});db[_0xc207('0x41')][_0xc207('0x112')](db[_0xc207('0x15e')],{'as':'Answers','foreignKey':_0xc207('0x15a')});db['MailAccount']['hasMany'](db[_0xc207('0x15f')],{'as':_0xc207('0x153'),'foreignKey':_0xc207('0x15a')});db[_0xc207('0x41')][_0xc207('0x112')](db[_0xc207('0x46')],{'as':_0xc207('0x160')});db[_0xc207('0x41')][_0xc207('0x112')](db['MailApplication'],{'as':_0xc207('0x161')});db['MailAccount'][_0xc207('0x11f')](db['CmList'],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0x41')][_0xc207('0x11f')](db[_0xc207('0x95')],{'as':_0xc207('0x95'),'foreignKey':_0xc207('0x164')});db[_0xc207('0x41')]['belongsTo'](db['Pause'],{'as':_0xc207('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc207('0x41')]['belongsToMany'](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':'user_has_mail_accounts'});db[_0xc207('0x43')][_0xc207('0x121')](db['User'],{'as':_0xc207('0x14f'),'through':_0xc207('0x35')});db['MailQueue'][_0xc207('0x121')](db['Team'],{'through':_0xc207('0x165'),'as':_0xc207('0x150')});db[_0xc207('0x46')]['hasMany'](db[_0xc207('0x15f')],{'as':_0xc207('0x153'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x166')});db[_0xc207('0x46')]['belongsTo'](db[_0xc207('0x41')],{'as':'Account','foreignKey':_0xc207('0x15a')});db['MailInteraction'][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x46')]['belongsTo'](db[_0xc207('0x10e')],{'as':'Owner','foreignKey':'UserId'});db['MailInteraction'][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x168'),'as':_0xc207('0x169')});db[_0xc207('0x46')][_0xc207('0x121')](db['Tag'],{'through':_0xc207('0x168'),'as':_0xc207('0x16a')});db[_0xc207('0x46')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x16b'),'through':_0xc207('0x127'),'foreignKey':'MailInteractionId'});db['MailMessage']['hasMany'](db['Attachment'],{'as':_0xc207('0x16c'),'onDelete':'cascade'});db[_0xc207('0x15f')]['belongsTo'](db['User'],{'as':_0xc207('0x10e')});db['MailMessage'][_0xc207('0x11f')](db[_0xc207('0x78')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x167')});db[_0xc207('0x15f')][_0xc207('0x11f')](db[_0xc207('0x46')],{'as':_0xc207('0x16d'),'foreignKey':'MailInteractionId'});db[_0xc207('0x15f')][_0xc207('0x11f')](db[_0xc207('0x41')],{'as':'Account','foreignKey':_0xc207('0x15a')});db[_0xc207('0x16e')][_0xc207('0x11f')](db['User'],{'onDelete':_0xc207('0x16f')});db[_0xc207('0x16e')][_0xc207('0x11f')](db[_0xc207('0x43')],{'onDelete':'restrict'});db[_0xc207('0x16e')]['belongsTo'](db[_0xc207('0x41')],{'onDelete':_0xc207('0x16f')});db['MailApplication'][_0xc207('0x11f')](db[_0xc207('0x89')],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x14a')});db[_0xc207('0x16e')][_0xc207('0x11f')](db[_0xc207('0x93')],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x170')});db['MailQueueReport'][_0xc207('0x11f')](db['MailAccount'],{});db[_0xc207('0x49')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0x49')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':'ContactId'});db[_0xc207('0x49')][_0xc207('0x11f')](db[_0xc207('0x46')],{});db[_0xc207('0x49')][_0xc207('0x11f')](db[_0xc207('0x15f')],{});db['MailQueueReport'][_0xc207('0x11f')](db[_0xc207('0x10e')],{});db['MailQueueReport'][_0xc207('0x11f')](db[_0xc207('0x43')],{});db[_0xc207('0x4b')][_0xc207('0x112')](db[_0xc207('0x4c')],{'as':_0xc207('0x171'),'onDelete':_0xc207('0x110')});db['FaxAccount'][_0xc207('0x112')](db['Disposition'],{'as':_0xc207('0x172'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0xc207('0x112')](db[_0xc207('0x15e')],{'as':'Answers','foreignKey':'FaxAccountId'});db['FaxAccount']['hasMany'](db['FaxInteraction'],{'as':_0xc207('0x160')});db[_0xc207('0x4e')][_0xc207('0x112')](db[_0xc207('0x50')],{'as':_0xc207('0x161')});db[_0xc207('0x4e')][_0xc207('0x112')](db[_0xc207('0x114')],{'as':_0xc207('0x173'),'onDelete':_0xc207('0x110')});db['FaxAccount'][_0xc207('0x112')](db[_0xc207('0x53')],{'as':_0xc207('0x153')});db[_0xc207('0x4e')]['belongsTo'](db['Trunk'],{'as':_0xc207('0x2d')});db[_0xc207('0x4e')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0x4e')][_0xc207('0x11f')](db[_0xc207('0x8b')],{'as':_0xc207('0x14b'),'foreignKey':_0xc207('0x14c')});db[_0xc207('0x4e')]['belongsToMany'](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x135')});db['FaxApplication'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':'restrict'});db['FaxApplication'][_0xc207('0x11f')](db[_0xc207('0x55')],{'onDelete':_0xc207('0x16f')});db[_0xc207('0x50')][_0xc207('0x11f')](db[_0xc207('0x4e')],{'onDelete':_0xc207('0x16f')});db['FaxApplication'][_0xc207('0x11f')](db['Tag'],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x170')});db[_0xc207('0x11a')][_0xc207('0x112')](db[_0xc207('0x53')],{'as':'Messages','onDelete':_0xc207('0x110'),'foreignKey':'FaxInteractionId'});db[_0xc207('0x11a')][_0xc207('0x11f')](db[_0xc207('0x4e')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xc207('0x11a')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':'ContactId'});db[_0xc207('0x11a')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'as':_0xc207('0x174'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x11a')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x175'),'as':_0xc207('0x169')});db[_0xc207('0x11a')]['belongsToMany'](db[_0xc207('0x93')],{'through':_0xc207('0x175'),'as':_0xc207('0x16a')});db[_0xc207('0x11a')][_0xc207('0x121')](db['User'],{'as':_0xc207('0x16b'),'through':'user_has_fax_interactions','foreignKey':_0xc207('0x176')});db[_0xc207('0x53')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x10e')});db['FaxMessage'][_0xc207('0x11f')](db[_0xc207('0x11a')],{'as':'Interaction','foreignKey':_0xc207('0x176')});db[_0xc207('0x53')][_0xc207('0x11f')](db[_0xc207('0x78')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x167')});db[_0xc207('0x53')][_0xc207('0x11f')](db[_0xc207('0xec')],{'as':_0xc207('0xec'),'foreignKey':_0xc207('0x177')});db[_0xc207('0x53')][_0xc207('0x11f')](db['FaxAccount'],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x179')});db['FaxQueue'][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x37')});db[_0xc207('0x55')]['belongsToMany'](db[_0xc207('0xe5')],{'through':'team_has_fax_queues','as':_0xc207('0x150')});db[_0xc207('0x57')]['belongsTo'](db[_0xc207('0x4e')],{});db['FaxQueueReport'][_0xc207('0x11f')](db['CmList'],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0x57')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x57')]['belongsTo'](db[_0xc207('0x11a')],{});db[_0xc207('0x57')][_0xc207('0x11f')](db[_0xc207('0x53')],{});db[_0xc207('0x57')]['belongsTo'](db[_0xc207('0x10e')],{});db[_0xc207('0x57')]['belongsTo'](db[_0xc207('0x55')],{});db[_0xc207('0x137')][_0xc207('0x112')](db[_0xc207('0x15d')],{'as':_0xc207('0x172'),'foreignKey':_0xc207('0x17a')});db[_0xc207('0x137')][_0xc207('0x112')](db[_0xc207('0x15e')],{'as':_0xc207('0x17b'),'foreignKey':'SmsAccountId'});db[_0xc207('0x137')]['hasMany'](db['SmsMessage'],{'as':_0xc207('0x153'),'foreignKey':_0xc207('0x17a')});db[_0xc207('0x137')][_0xc207('0x112')](db[_0xc207('0x5b')],{'as':_0xc207('0x160')});db[_0xc207('0x137')][_0xc207('0x112')](db[_0xc207('0x59')],{'as':_0xc207('0x161')});db[_0xc207('0x137')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':'ListId'});db['SmsAccount'][_0xc207('0x11f')](db[_0xc207('0x8b')],{'as':'mandatoryDispositionPause','foreignKey':_0xc207('0x14c')});db[_0xc207('0x137')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x17c')});db['SmsApplication'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x16f')});db['SmsApplication'][_0xc207('0x11f')](db[_0xc207('0x5f')],{'onDelete':'restrict'});db[_0xc207('0x59')][_0xc207('0x11f')](db[_0xc207('0x137')],{'onDelete':_0xc207('0x16f')});db[_0xc207('0x59')][_0xc207('0x11f')](db[_0xc207('0x89')],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x14a')});db[_0xc207('0x59')][_0xc207('0x11f')](db[_0xc207('0x93')],{'onDelete':_0xc207('0x16f'),'foreignKey':'TagId'});db[_0xc207('0x5b')]['hasMany'](db[_0xc207('0x5d')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xc207('0x17d')});db[_0xc207('0x5b')]['belongsTo'](db[_0xc207('0x137')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x17a')});db[_0xc207('0x5b')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db['SmsInteraction'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'as':_0xc207('0x174'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x5b')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x17e'),'as':'Tags'});db[_0xc207('0x5b')]['belongsToMany'](db[_0xc207('0x93')],{'through':_0xc207('0x17e'),'as':_0xc207('0x16a')});db['SmsInteraction'][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x16b'),'through':_0xc207('0x17f'),'foreignKey':_0xc207('0x17d')});db['SmsMessage']['belongsTo'](db[_0xc207('0x10e')],{'as':_0xc207('0x10e')});db[_0xc207('0x5d')][_0xc207('0x11f')](db[_0xc207('0x78')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x167')});db[_0xc207('0x5d')][_0xc207('0x11f')](db[_0xc207('0x5b')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x16d'),'foreignKey':_0xc207('0x17d')});db[_0xc207('0x5d')][_0xc207('0x11f')](db['SmsAccount'],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x17a')});db[_0xc207('0x5f')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x39'),'foreignKey':_0xc207('0x180')});db[_0xc207('0x5f')][_0xc207('0x121')](db[_0xc207('0xe5')],{'through':_0xc207('0x181'),'as':_0xc207('0x150')});db[_0xc207('0x61')][_0xc207('0x112')](db[_0xc207('0x15d')],{'as':_0xc207('0x172'),'foreignKey':_0xc207('0x182')});db['OpenchannelAccount']['hasMany'](db[_0xc207('0x15e')],{'as':'Answers','foreignKey':_0xc207('0x182')});db[_0xc207('0x61')][_0xc207('0x112')](db[_0xc207('0x183')],{'as':_0xc207('0x160'),'foreignKey':'OpenchannelAccountId'});db[_0xc207('0x61')]['hasMany'](db[_0xc207('0x184')],{'as':_0xc207('0x153'),'foreignKey':_0xc207('0x182')});db[_0xc207('0x61')][_0xc207('0x112')](db[_0xc207('0x62')],{'as':'Applications','foreignKey':_0xc207('0x182')});db[_0xc207('0x61')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0x61')]['belongsTo'](db['Pause'],{'as':_0xc207('0x14b'),'foreignKey':_0xc207('0x14c')});db[_0xc207('0x61')][_0xc207('0x121')](db['User'],{'as':'Agents','through':_0xc207('0x185')});db['OpenchannelApplication'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x16f')});db[_0xc207('0x62')]['belongsTo'](db[_0xc207('0x64')],{'onDelete':'restrict','foreignKey':_0xc207('0x186')});db[_0xc207('0x62')]['belongsTo'](db[_0xc207('0x61')],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x182')});db[_0xc207('0x62')][_0xc207('0x11f')](db[_0xc207('0x89')],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x14a')});db[_0xc207('0x62')][_0xc207('0x11f')](db[_0xc207('0x93')],{'onDelete':'restrict','foreignKey':_0xc207('0x170')});db[_0xc207('0x183')][_0xc207('0x112')](db[_0xc207('0x184')],{'as':'Messages','onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x187')});db[_0xc207('0x183')]['belongsTo'](db[_0xc207('0x61')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x182')});db[_0xc207('0x183')][_0xc207('0x11f')](db['CmContact'],{'as':_0xc207('0x167'),'foreignKey':'ContactId'});db[_0xc207('0x183')]['belongsTo'](db[_0xc207('0x10e')],{'as':'Owner','foreignKey':_0xc207('0x111')});db[_0xc207('0x183')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x188'),'as':'Tags'});db[_0xc207('0x183')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x188'),'as':_0xc207('0x16a')});db[_0xc207('0x183')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x16b'),'through':_0xc207('0x189'),'foreignKey':_0xc207('0x187')});db['OpenchannelMessage'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x10e')});db['OpenchannelMessage'][_0xc207('0x11f')](db['CmContact'],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x167')});db['OpenchannelMessage'][_0xc207('0x11f')](db[_0xc207('0x183')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x16d'),'foreignKey':_0xc207('0x187')});db[_0xc207('0x184')]['belongsTo'](db['Attachment'],{'as':_0xc207('0xec'),'foreignKey':_0xc207('0x177')});db['OpenchannelMessage'][_0xc207('0x11f')](db[_0xc207('0x61')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x182')});db[_0xc207('0x64')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x3b'),'foreignKey':_0xc207('0x186')});db['OpenchannelQueue'][_0xc207('0x121')](db[_0xc207('0xe5')],{'through':_0xc207('0x18a'),'as':_0xc207('0x150')});db[_0xc207('0x66')]['hasMany'](db[_0xc207('0x15d')],{'as':'Dispositions','foreignKey':'ChatWebsiteId'});db[_0xc207('0x66')][_0xc207('0x112')](db[_0xc207('0x15e')],{'as':_0xc207('0x17b'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0xc207('0x112')](db[_0xc207('0x18b')],{'as':'ProactiveActions'});db[_0xc207('0x66')][_0xc207('0x112')](db['ChatInteraction'],{'as':_0xc207('0x160')});db[_0xc207('0x66')][_0xc207('0x112')](db[_0xc207('0x18c')],{'as':_0xc207('0x161')});db[_0xc207('0x66')]['hasMany'](db['ChatMessage'],{'as':_0xc207('0x153')});db[_0xc207('0x66')]['belongsTo'](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db['ChatWebsite'][_0xc207('0x11f')](db[_0xc207('0x89')],{'as':_0xc207('0x89'),'foreignKey':'IntervalId'});db[_0xc207('0x66')][_0xc207('0x11f')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xc207('0x66')]['belongsToMany'](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xc207('0x11f')](db[_0xc207('0x61')],{});db[_0xc207('0x68')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db['OpenchannelQueueReport'][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':'Contact','foreignKey':_0xc207('0x159')});db['OpenchannelQueueReport'][_0xc207('0x11f')](db['OpenchannelInteraction'],{});db[_0xc207('0x68')][_0xc207('0x11f')](db[_0xc207('0x184')],{});db[_0xc207('0x68')][_0xc207('0x11f')](db[_0xc207('0x10e')],{});db[_0xc207('0x68')]['belongsTo'](db[_0xc207('0x64')],{});db[_0xc207('0x18c')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'as':'Agent','foreignKey':_0xc207('0x111'),'onDelete':'restrict'});db['ChatApplication'][_0xc207('0x11f')](db['ChatQueue'],{'as':'Queue','foreignKey':_0xc207('0x18d'),'onDelete':_0xc207('0x16f')});db[_0xc207('0x18c')][_0xc207('0x11f')](db['ChatWebsite'],{'as':'Website','foreignKey':_0xc207('0x18e'),'onDelete':_0xc207('0x16f')});db[_0xc207('0x18c')]['belongsTo'](db['Tag'],{'onDelete':_0xc207('0x16f'),'foreignKey':'TagId'});db[_0xc207('0x6b')][_0xc207('0x112')](db['ChatMessage'],{'as':_0xc207('0x153'),'onDelete':_0xc207('0x110'),'foreignKey':'ChatInteractionId'});db[_0xc207('0x6b')][_0xc207('0x11f')](db[_0xc207('0x66')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x18e')});db[_0xc207('0x6b')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x6b')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'as':_0xc207('0x174'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x6b')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':'chat_interaction_has_tags','as':_0xc207('0x169')});db[_0xc207('0x6b')]['belongsToMany'](db[_0xc207('0x93')],{'through':_0xc207('0x18f'),'as':_0xc207('0x16a')});db[_0xc207('0x6b')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x16b'),'through':_0xc207('0x128'),'foreignKey':_0xc207('0x190')});db[_0xc207('0x6d')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':'cascade','as':_0xc207('0x10e')});db[_0xc207('0x6d')]['belongsTo'](db[_0xc207('0x78')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x6d')][_0xc207('0x11f')](db[_0xc207('0x6b')],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x16d'),'foreignKey':_0xc207('0x190')});db[_0xc207('0x6d')][_0xc207('0x11f')](db['Attachment'],{'as':'Attachment','foreignKey':_0xc207('0x177')});db['ChatMessage'][_0xc207('0x11f')](db[_0xc207('0x66')],{'as':_0xc207('0x178'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xc207('0x11f')](db['CmContact'],{'onDelete':_0xc207('0x110'),'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x6f')][_0xc207('0x11f')](db[_0xc207('0x66')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x18e')});db[_0xc207('0x71')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':'Agents','through':_0xc207('0x34'),'hooks':!![]});db['ChatQueue'][_0xc207('0x121')](db['Team'],{'through':_0xc207('0x191'),'as':'Teams'});db[_0xc207('0x73')][_0xc207('0x112')](db[_0xc207('0xd2')],{'as':_0xc207('0x153'),'foreignKey':_0xc207('0x192'),'onDelete':_0xc207('0x110')});db[_0xc207('0x73')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':'Members','through':_0xc207('0x123')});db[_0xc207('0x18b')]['belongsTo'](db[_0xc207('0x66')],{'as':_0xc207('0x193'),'foreignKey':_0xc207('0x18e')});db[_0xc207('0x76')][_0xc207('0x112')](db[_0xc207('0x78')],{'as':_0xc207('0x124'),'foreignKey':_0xc207('0x194')});db[_0xc207('0x78')][_0xc207('0x112')](db['CmHopper'],{'as':_0xc207('0x142'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x78')][_0xc207('0x112')](db[_0xc207('0x115')],{'as':'HopperFinals','foreignKey':_0xc207('0x159')});db[_0xc207('0x78')][_0xc207('0x112')](db[_0xc207('0x7f')],{'as':_0xc207('0x143'),'foreignKey':_0xc207('0x159')});db['CmContact'][_0xc207('0x112')](db[_0xc207('0x81')],{'as':_0xc207('0x81'),'foreignKey':'ContactId'});db['CmContact'][_0xc207('0x112')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0xc207('0x159')});db[_0xc207('0x78')][_0xc207('0x112')](db[_0xc207('0x183')],{'as':_0xc207('0x12a'),'foreignKey':'ContactId','onDelete':_0xc207('0x16f')});db[_0xc207('0x78')]['hasMany'](db['ChatInteraction'],{'as':_0xc207('0x118'),'foreignKey':_0xc207('0x159'),'onDelete':'restrict'});db[_0xc207('0x78')][_0xc207('0x112')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0xc207('0x16f')});db[_0xc207('0x78')][_0xc207('0x112')](db[_0xc207('0x11a')],{'as':'FaxInteractions','foreignKey':_0xc207('0x159'),'onDelete':_0xc207('0x16f')});db[_0xc207('0x78')][_0xc207('0x112')](db[_0xc207('0x46')],{'as':_0xc207('0x11c'),'foreignKey':_0xc207('0x159'),'onDelete':_0xc207('0x16f')});db[_0xc207('0x78')][_0xc207('0x11f')](db['CmCompany'],{'as':_0xc207('0x195'),'foreignKey':_0xc207('0x194')});db[_0xc207('0x78')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163'),'onDelete':_0xc207('0x110')});db[_0xc207('0x78')][_0xc207('0x121')](db['User'],{'as':_0xc207('0x16b'),'through':_0xc207('0x196')});db[_0xc207('0x78')][_0xc207('0x121')](db[_0xc207('0x93')],{'as':'Tags','through':_0xc207('0x197')});db[_0xc207('0x78')][_0xc207('0x121')](db['Tag'],{'through':'cm_contact_has_tags','as':_0xc207('0x16a')});db[_0xc207('0x7a')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':'ContactId','onDelete':_0xc207('0x110')});db['CmHopper'][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':'ListId','onDelete':_0xc207('0x110')});db[_0xc207('0x7a')][_0xc207('0x11f')](db['User'],{'as':_0xc207('0x198'),'foreignKey':_0xc207('0x111')});db[_0xc207('0x7a')][_0xc207('0x11f')](db[_0xc207('0x1c')],{'as':_0xc207('0x199'),'foreignKey':_0xc207('0x141'),'onDelete':'cascade'});db[_0xc207('0x7a')][_0xc207('0x11f')](db[_0xc207('0xe8')],{'as':_0xc207('0xe8'),'foreignKey':_0xc207('0x19a'),'onDelete':_0xc207('0x110')});db[_0xc207('0x7a')]['belongsTo'](db[_0xc207('0x10e')],{'as':_0xc207('0x174'),'foreignKey':'OwnerId'});db['CmHopperBlack']['belongsTo'](db['CmContact'],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159'),'onDelete':_0xc207('0x110')});db[_0xc207('0x7c')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':'List','foreignKey':_0xc207('0x163'),'onDelete':_0xc207('0x110')});db['CmHopperBlack'][_0xc207('0x11f')](db[_0xc207('0x1c')],{'as':_0xc207('0x199'),'foreignKey':_0xc207('0x141'),'onDelete':_0xc207('0x110')});db[_0xc207('0x7c')][_0xc207('0x11f')](db[_0xc207('0xe8')],{'as':_0xc207('0xe8'),'foreignKey':'CampaignId','onDelete':_0xc207('0x110')});db[_0xc207('0x86')]['hasMany'](db['Condition'],{'as':{'plural':_0xc207('0x19b'),'singular':'OneAll'},'foreignKey':_0xc207('0x19c'),'onDelete':_0xc207('0x110'),'hooks':!![]});db[_0xc207('0x86')][_0xc207('0x112')](db[_0xc207('0x19d')],{'as':{'plural':_0xc207('0x19e'),'singular':_0xc207('0x19f')},'foreignKey':'AutomationAnyId','onDelete':_0xc207('0x110'),'hooks':!![]});db[_0xc207('0x86')][_0xc207('0x112')](db['Action'],{'as':_0xc207('0x1a0'),'foreignKey':'AutomationId','onDelete':_0xc207('0x110'),'hooks':!![]});db[_0xc207('0x89')]['hasMany'](db[_0xc207('0x89')],{'as':_0xc207('0x1a1'),'foreignKey':'IntervalId','onDelete':_0xc207('0x110'),'hooks':!![],'required':![]});db[_0xc207('0x89')][_0xc207('0x112')](db[_0xc207('0x114')],{'as':_0xc207('0x1a2'),'foreignKey':_0xc207('0x14a'),'onDelete':_0xc207('0x16f')});db['Interval'][_0xc207('0x112')](db[_0xc207('0x16e')],{'as':_0xc207('0x1a3'),'foreignKey':_0xc207('0x14a')});db[_0xc207('0x89')][_0xc207('0x112')](db[_0xc207('0x18c')],{'as':_0xc207('0x1a4'),'foreignKey':_0xc207('0x14a')});db['Interval'][_0xc207('0x112')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0xc207('0x14a')});db[_0xc207('0x89')][_0xc207('0x112')](db[_0xc207('0x59')],{'as':_0xc207('0x1a5'),'foreignKey':_0xc207('0x14a')});db[_0xc207('0x90')]['belongsTo'](db[_0xc207('0x41')],{});db[_0xc207('0x90')][_0xc207('0x11f')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xc207('0x90')][_0xc207('0x11f')](db[_0xc207('0x1a6')],{'foreignKey':'CustomReportId'});db[_0xc207('0x1a7')][_0xc207('0x121')](db[_0xc207('0x1a')],{'as':_0xc207('0x1a8'),'through':_0xc207('0x13f'),'onDelete':_0xc207('0x16f')});db[_0xc207('0x93')][_0xc207('0x121')](db['CmContact'],{'through':_0xc207('0x197')});db[_0xc207('0x93')][_0xc207('0x121')](db[_0xc207('0x6b')],{'through':_0xc207('0x18f')});db['Tag'][_0xc207('0x121')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0xc207('0x93')][_0xc207('0x121')](db[_0xc207('0x5b')],{'through':'sms_interaction_has_tags'});db[_0xc207('0x93')]['belongsToMany'](db[_0xc207('0x11a')],{'through':_0xc207('0x175')});db[_0xc207('0x93')][_0xc207('0x121')](db[_0xc207('0x183')],{'through':_0xc207('0x188')});db[_0xc207('0x93')]['belongsToMany'](db[_0xc207('0x106')],{'through':_0xc207('0x1a9')});db[_0xc207('0x96')][_0xc207('0x112')](db['Condition'],{'as':{'plural':'AllConditions','singular':'AllCondition'},'foreignKey':_0xc207('0x1aa'),'onDelete':_0xc207('0x110'),'hooks':!![]});db['Trigger'][_0xc207('0x112')](db['Condition'],{'as':{'plural':_0xc207('0x1ab'),'singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0xc207('0x110'),'hooks':!![]});db[_0xc207('0x96')]['hasMany'](db[_0xc207('0x85')],{'as':_0xc207('0x1a0'),'foreignKey':_0xc207('0x1ac'),'onDelete':_0xc207('0x110'),'hooks':!![]});db[_0xc207('0x1a6')][_0xc207('0x112')](db['AnalyticFieldReport'],{'as':_0xc207('0x1ad'),'onDelete':'cascade','foreignKey':_0xc207('0x1ae'),'hooks':!![]});db[_0xc207('0x9c')][_0xc207('0x112')](db[_0xc207('0x1af')],{'as':_0xc207('0x1ad'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b0')});db[_0xc207('0x9f')][_0xc207('0x112')](db[_0xc207('0x1af')],{'as':_0xc207('0x1ad'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b1')});db[_0xc207('0x1af')][_0xc207('0x11f')](db[_0xc207('0x9f')],{'foreignKey':_0xc207('0x1b1')});db[_0xc207('0x1b2')][_0xc207('0x112')](db[_0xc207('0xa4')],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xa4')]['hasMany'](db[_0xc207('0x1b5')],{'as':'Subjects','onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0xa4')][_0xc207('0x112')](db[_0xc207('0x1b5')],{'as':_0xc207('0x1b7'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0xa4')][_0xc207('0x112')](db['SalesforceField'],{'as':_0xc207('0x1ad'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xa4')][_0xc207('0x11f')](db['SalesforceAccount'],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db['SalesforceField']['hasMany'](db[_0xc207('0x1b5')],{'as':_0xc207('0x1ba'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0x1b5')][_0xc207('0x112')](db[_0xc207('0x1b5')],{'as':'Description','foreignKey':_0xc207('0x1b8')});db['SalesforceField'][_0xc207('0x112')](db[_0xc207('0x1b5')],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db['SalesforceField'][_0xc207('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0xc207('0x1bc')});db[_0xc207('0xa7')][_0xc207('0x112')](db['SugarcrmConfiguration'],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xa8')][_0xc207('0x112')](db[_0xc207('0xaa')],{'as':_0xc207('0x1bd'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0xa8')]['hasMany'](db['SugarcrmField'],{'as':_0xc207('0x1b7'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xc207('0xa8')][_0xc207('0x112')](db[_0xc207('0xaa')],{'as':'Fields','onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xa8')][_0xc207('0x11f')](db[_0xc207('0xa7')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xaa')]['hasMany'](db[_0xc207('0xaa')],{'as':_0xc207('0x1ba'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0xaa')][_0xc207('0x112')](db[_0xc207('0xaa')],{'as':_0xc207('0x1be'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0xaa')]['hasMany'](db[_0xc207('0xaa')],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xaa')][_0xc207('0x11f')](db[_0xc207('0x97')],{'as':_0xc207('0x97'),'foreignKey':'VariableId'});db['DeskAccount'][_0xc207('0x112')](db['DeskConfiguration'],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xae')]['hasMany'](db[_0xc207('0x1bf')],{'as':_0xc207('0x1bd'),'onDelete':_0xc207('0x110'),'foreignKey':'SubjectId'});db[_0xc207('0xae')][_0xc207('0x112')](db['DeskField'],{'as':_0xc207('0x1b7'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b8')});db['DeskConfiguration'][_0xc207('0x112')](db[_0xc207('0x1bf')],{'as':_0xc207('0x1ad'),'onDelete':'cascade','foreignKey':_0xc207('0x1b9')});db[_0xc207('0xae')][_0xc207('0x11f')](db['DeskAccount'],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db['DeskConfiguration'][_0xc207('0x121')](db[_0xc207('0x93')],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0xc207('0x112')](db[_0xc207('0x1bf')],{'as':_0xc207('0x1ba'),'foreignKey':'SubjectId'});db[_0xc207('0x1bf')]['hasMany'](db['DeskField'],{'as':'Description','foreignKey':'DescriptionId'});db['DeskField']['hasMany'](db[_0xc207('0x1bf')],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0x1bf')][_0xc207('0x11f')](db[_0xc207('0x97')],{'as':_0xc207('0x97'),'foreignKey':_0xc207('0x1bc')});db[_0xc207('0xb1')]['hasMany'](db['ZohoConfiguration'],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xb2')][_0xc207('0x112')](db[_0xc207('0xb4')],{'as':_0xc207('0x1bd'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b6')});db['ZohoConfiguration'][_0xc207('0x112')](db['ZohoField'],{'as':_0xc207('0x1b7'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['ZohoConfiguration'][_0xc207('0x112')](db[_0xc207('0xb4')],{'as':'Fields','onDelete':_0xc207('0x110'),'foreignKey':'FieldId'});db[_0xc207('0xb2')][_0xc207('0x11f')](db[_0xc207('0xb1')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xb4')]['hasMany'](db[_0xc207('0xb4')],{'as':'Subject','foreignKey':_0xc207('0x1b6')});db[_0xc207('0xb4')][_0xc207('0x112')](db[_0xc207('0xb4')],{'as':'Description','foreignKey':_0xc207('0x1b8')});db[_0xc207('0xb4')]['hasMany'](db['ZohoField'],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xb4')]['belongsTo'](db['Variable'],{'as':_0xc207('0x97'),'foreignKey':_0xc207('0x1bc')});db['ZendeskAccount'][_0xc207('0x112')](db[_0xc207('0xb7')],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xb7')][_0xc207('0x112')](db['ZendeskField'],{'as':_0xc207('0x1bd'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0xb7')][_0xc207('0x112')](db[_0xc207('0x1c0')],{'as':_0xc207('0x1b7'),'foreignKey':_0xc207('0x1b8')});db['ZendeskConfiguration'][_0xc207('0x112')](db[_0xc207('0x1c0')],{'as':_0xc207('0x1ad'),'foreignKey':'FieldId'});db[_0xc207('0xb7')]['belongsTo'](db[_0xc207('0xb6')],{'as':_0xc207('0x178'),'foreignKey':'AccountId'});db[_0xc207('0xb7')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x1c1')});db[_0xc207('0x1c0')][_0xc207('0x112')](db[_0xc207('0x1c0')],{'as':_0xc207('0x1ba'),'foreignKey':_0xc207('0x1b6')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0xc207('0x1be'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0x1c0')][_0xc207('0x112')](db['ZendeskField'],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0x1c0')][_0xc207('0x11f')](db[_0xc207('0x97')],{'as':'Variable','foreignKey':_0xc207('0x1bc')});db[_0xc207('0xb9')][_0xc207('0x112')](db[_0xc207('0x1c2')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc207('0x1b4')});db[_0xc207('0x1c2')][_0xc207('0x112')](db[_0xc207('0xbc')],{'as':_0xc207('0x1bd'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b6')});db['FreshdeskConfiguration']['hasMany'](db[_0xc207('0xbc')],{'as':_0xc207('0x1b7'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0x1c2')]['hasMany'](db[_0xc207('0xbc')],{'as':_0xc207('0x1ad'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0x1c2')][_0xc207('0x11f')](db[_0xc207('0xb9')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0x1c2')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xc207('0xbc')][_0xc207('0x112')](db[_0xc207('0xbc')],{'as':_0xc207('0x1ba'),'foreignKey':'SubjectId'});db[_0xc207('0xbc')][_0xc207('0x112')](db[_0xc207('0xbc')],{'as':_0xc207('0x1be'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0xbc')][_0xc207('0x112')](db[_0xc207('0xbc')],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xbc')][_0xc207('0x11f')](db[_0xc207('0x97')],{'as':_0xc207('0x97'),'foreignKey':'VariableId'});db[_0xc207('0x1c3')][_0xc207('0x112')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xc207('0x1b4')});db['VtigerConfiguration'][_0xc207('0x112')](db[_0xc207('0x1c4')],{'as':_0xc207('0x1bd'),'foreignKey':'SubjectId'});db[_0xc207('0xbe')][_0xc207('0x112')](db[_0xc207('0x1c4')],{'as':_0xc207('0x1b7'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0xbe')][_0xc207('0x112')](db[_0xc207('0x1c4')],{'as':_0xc207('0x1ad'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xbe')][_0xc207('0x11f')](db[_0xc207('0x1c3')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db['VtigerField'][_0xc207('0x112')](db[_0xc207('0x1c4')],{'as':'Subject','foreignKey':_0xc207('0x1b6')});db['VtigerField']['hasMany'](db[_0xc207('0x1c4')],{'as':_0xc207('0x1be'),'foreignKey':_0xc207('0x1b8')});db['VtigerField']['hasMany'](db[_0xc207('0x1c4')],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0x1c4')][_0xc207('0x11f')](db[_0xc207('0x97')],{'as':_0xc207('0x97'),'foreignKey':_0xc207('0x1bc')});db[_0xc207('0xc1')][_0xc207('0x112')](db[_0xc207('0xc2')],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xc2')]['hasMany'](db[_0xc207('0xc4')],{'as':_0xc207('0x1bd'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0xc2')][_0xc207('0x112')](db[_0xc207('0xc4')],{'as':_0xc207('0x1b7'),'foreignKey':'DescriptionId'});db[_0xc207('0xc2')][_0xc207('0x112')](db[_0xc207('0xc4')],{'as':'Fields','foreignKey':_0xc207('0x1b9')});db['ServicenowConfiguration'][_0xc207('0x11f')](db['ServicenowAccount'],{'as':_0xc207('0x178'),'foreignKey':'AccountId'});db[_0xc207('0xc4')][_0xc207('0x112')](db[_0xc207('0xc4')],{'as':_0xc207('0x1ba'),'foreignKey':'SubjectId'});db['ServicenowField'][_0xc207('0x112')](db[_0xc207('0xc4')],{'as':_0xc207('0x1be'),'foreignKey':'DescriptionId'});db[_0xc207('0xc4')][_0xc207('0x112')](db[_0xc207('0xc4')],{'as':'Field','foreignKey':'FieldId'});db[_0xc207('0xc4')]['belongsTo'](db[_0xc207('0x97')],{'as':_0xc207('0x97'),'foreignKey':_0xc207('0x1bc')});db[_0xc207('0xc6')][_0xc207('0x112')](db[_0xc207('0x1c5')],{'as':_0xc207('0x1b3'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0x1c5')][_0xc207('0x112')](db[_0xc207('0xc8')],{'as':_0xc207('0x1bd'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0x1c5')][_0xc207('0x112')](db[_0xc207('0xc8')],{'as':_0xc207('0x1b7'),'onDelete':_0xc207('0x110'),'foreignKey':'DescriptionId'});db[_0xc207('0x1c5')][_0xc207('0x112')](db[_0xc207('0xc8')],{'as':_0xc207('0x1ad'),'onDelete':_0xc207('0x110'),'foreignKey':'FieldId'});db[_0xc207('0x1c5')][_0xc207('0x11f')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xc207('0x1b4')});db['Dynamics365Field'][_0xc207('0x112')](db[_0xc207('0xc8')],{'as':_0xc207('0x1ba'),'foreignKey':_0xc207('0x1b6')});db['Dynamics365Field']['hasMany'](db[_0xc207('0xc8')],{'as':_0xc207('0x1be'),'foreignKey':_0xc207('0x1b8')});db[_0xc207('0xc8')]['hasMany'](db[_0xc207('0xc8')],{'as':'Field','foreignKey':'FieldId'});db[_0xc207('0xc8')][_0xc207('0x11f')](db['Variable'],{'as':_0xc207('0x97'),'foreignKey':_0xc207('0x1bc')});db[_0xc207('0x1c6')][_0xc207('0x112')](db[_0xc207('0xcb')],{'as':'Configurations','onDelete':_0xc207('0x110'),'foreignKey':'AccountId'});db[_0xc207('0xcb')][_0xc207('0x112')](db[_0xc207('0xcd')],{'as':_0xc207('0x1bd'),'foreignKey':_0xc207('0x1b6')});db[_0xc207('0xcb')][_0xc207('0x112')](db['FreshsalesField'],{'as':_0xc207('0x1b7'),'foreignKey':'DescriptionId'});db[_0xc207('0xcb')][_0xc207('0x112')](db['FreshsalesField'],{'as':_0xc207('0x1ad'),'foreignKey':'FieldId'});db[_0xc207('0xcb')][_0xc207('0x11f')](db[_0xc207('0x1c6')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1b4')});db[_0xc207('0xcd')][_0xc207('0x112')](db[_0xc207('0xcd')],{'as':'Subject','foreignKey':_0xc207('0x1b6')});db[_0xc207('0xcd')][_0xc207('0x112')](db[_0xc207('0xcd')],{'as':_0xc207('0x1be'),'foreignKey':'DescriptionId'});db[_0xc207('0xcd')]['hasMany'](db['FreshsalesField'],{'as':_0xc207('0x1bb'),'foreignKey':_0xc207('0x1b9')});db[_0xc207('0xcd')][_0xc207('0x11f')](db['Variable'],{'as':'Variable','foreignKey':_0xc207('0x1bc')});db[_0xc207('0xd1')][_0xc207('0x11f')](db['ChatWebsite'],{});db[_0xc207('0xd1')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0xd1')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db['ChatQueueReport'][_0xc207('0x11f')](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db[_0xc207('0xd1')][_0xc207('0x11f')](db[_0xc207('0x10e')],{});db[_0xc207('0xd1')][_0xc207('0x11f')](db[_0xc207('0x71')],{});db[_0xc207('0xd2')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1c7')});db[_0xc207('0xd2')]['belongsTo'](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1c8')});db[_0xc207('0x145')][_0xc207('0x112')](db[_0xc207('0x1c9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xc207('0x145')][_0xc207('0x112')](db[_0xc207('0xd4')],{'foreignKey':'SessionId','onDelete':_0xc207('0x110')});db[_0xc207('0xd6')]['belongsTo'](db['SmsAccount'],{});db['SmsQueueReport'][_0xc207('0x11f')](db['CmList'],{'as':_0xc207('0x162'),'foreignKey':_0xc207('0x163')});db[_0xc207('0xd6')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0xd6')][_0xc207('0x11f')](db[_0xc207('0x5b')],{});db[_0xc207('0xd6')][_0xc207('0x11f')](db[_0xc207('0x5d')],{});db[_0xc207('0xd6')][_0xc207('0x11f')](db[_0xc207('0x10e')],{});db[_0xc207('0xd6')]['belongsTo'](db[_0xc207('0x5f')],{});db[_0xc207('0x1ca')]['hasMany'](db[_0xc207('0x145')],{'foreignKey':_0xc207('0x1cb')});db[_0xc207('0x1ca')][_0xc207('0x112')](db[_0xc207('0x1c9')],{'foreignKey':_0xc207('0x1cb')});db[_0xc207('0x1ca')][_0xc207('0x112')](db['JscriptyAnswerReport'],{'foreignKey':_0xc207('0x1cb')});db[_0xc207('0xdf')][_0xc207('0x121')](db['User'],{'as':_0xc207('0x16b'),'through':_0xc207('0x13b')});db[_0xc207('0xe5')][_0xc207('0x121')](db['User'],{'as':'Agents','through':_0xc207('0x126')});db[_0xc207('0xe5')][_0xc207('0x121')](db[_0xc207('0x1c')],{'through':_0xc207('0x1cc'),'as':_0xc207('0x1cd')});db[_0xc207('0xe5')][_0xc207('0x121')](db['MailQueue'],{'through':_0xc207('0x165'),'as':_0xc207('0x12b')});db[_0xc207('0xe5')]['belongsToMany'](db[_0xc207('0x71')],{'through':_0xc207('0x191'),'as':_0xc207('0x12c')});db[_0xc207('0xe5')][_0xc207('0x121')](db[_0xc207('0x55')],{'through':_0xc207('0x1ce'),'as':_0xc207('0x12d')});db[_0xc207('0xe5')]['belongsToMany'](db[_0xc207('0x5f')],{'through':_0xc207('0x181'),'as':_0xc207('0x12e')});db[_0xc207('0xe5')]['belongsToMany'](db[_0xc207('0x64')],{'through':_0xc207('0x18a'),'as':_0xc207('0x12f')});db[_0xc207('0xe5')][_0xc207('0x121')](db[_0xc207('0x1cf')],{'through':_0xc207('0x1d0'),'as':'WhatsappQueues'});db['Campaign'][_0xc207('0x112')](db[_0xc207('0x7a')],{'as':_0xc207('0x142'),'foreignKey':'CampaignId'});db[_0xc207('0xe8')][_0xc207('0x112')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xc207('0x19a')});db[_0xc207('0xe8')]['hasMany'](db[_0xc207('0x7f')],{'as':'HopperHistories','foreignKey':_0xc207('0x19a')});db[_0xc207('0xe8')][_0xc207('0x112')](db[_0xc207('0x7c')],{'as':'HopperBlacks','foreignKey':_0xc207('0x19a')});db[_0xc207('0xe8')][_0xc207('0x11f')](db[_0xc207('0x2d')],{'as':_0xc207('0x2d'),'foreignKey':_0xc207('0x147')});db[_0xc207('0xe8')][_0xc207('0x11f')](db[_0xc207('0x2d')],{'as':_0xc207('0x148'),'foreignKey':_0xc207('0x149')});db[_0xc207('0xe8')][_0xc207('0x11f')](db[_0xc207('0x89')],{'as':'Interval','foreignKey':_0xc207('0x14a')});db[_0xc207('0xe8')][_0xc207('0x11f')](db[_0xc207('0xdf')],{'as':_0xc207('0xdf'),'foreignKey':_0xc207('0x1d1')});db[_0xc207('0xe8')][_0xc207('0x121')](db[_0xc207('0xfa')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xc207('0xe8')]['belongsToMany'](db[_0xc207('0xfa')],{'as':'BlackLists','through':_0xc207('0x1d2')});db[_0xc207('0xf0')][_0xc207('0x11f')](db['MailMessage'],{});db[_0xc207('0xf0')][_0xc207('0x11f')](db['MailInteraction'],{});db[_0xc207('0xf0')][_0xc207('0x11f')](db[_0xc207('0x41')],{'foreignKey':'FromMailAccountId','as':'FromAccount'});db[_0xc207('0xf0')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d3'),'as':'FromAgent'});db[_0xc207('0xf0')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d4'),'as':_0xc207('0x1d5')});db[_0xc207('0xf0')]['belongsTo'](db['MailQueue'],{'foreignKey':_0xc207('0x1d6'),'as':_0xc207('0x1d7')});db['MailTransferReport']['belongsTo'](db[_0xc207('0x41')],{'foreignKey':_0xc207('0x1d8'),'as':_0xc207('0x1d9')});db['ChatTransferReport'][_0xc207('0x11f')](db[_0xc207('0x6d')],{});db['ChatTransferReport'][_0xc207('0x11f')](db[_0xc207('0x6b')],{});db[_0xc207('0xf2')][_0xc207('0x11f')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':'FromAccount'});db[_0xc207('0xf2')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d3'),'as':_0xc207('0x1da')});db[_0xc207('0xf2')][_0xc207('0x11f')](db['User'],{'foreignKey':'ToUserId','as':_0xc207('0x1d5')});db[_0xc207('0xf2')]['belongsTo'](db[_0xc207('0x71')],{'foreignKey':_0xc207('0x1db'),'as':_0xc207('0x1d7')});db[_0xc207('0xf2')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0xc207('0x1dc'),'as':_0xc207('0x1d9')});db[_0xc207('0xf4')][_0xc207('0x11f')](db['FaxMessage'],{});db[_0xc207('0xf4')][_0xc207('0x11f')](db['FaxInteraction'],{});db['FaxTransferReport'][_0xc207('0x11f')](db['FaxAccount'],{'foreignKey':_0xc207('0x1dd'),'as':_0xc207('0x1de')});db[_0xc207('0xf4')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':'FromUserId','as':_0xc207('0x1da')});db[_0xc207('0xf4')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':'ToUserId','as':_0xc207('0x1d5')});db[_0xc207('0xf4')]['belongsTo'](db['FaxQueue'],{'foreignKey':_0xc207('0x1df'),'as':'ToQueue'});db[_0xc207('0xf4')][_0xc207('0x11f')](db[_0xc207('0x4e')],{'foreignKey':_0xc207('0x1e0'),'as':_0xc207('0x1d9')});db[_0xc207('0xf6')][_0xc207('0x11f')](db[_0xc207('0x184')],{});db[_0xc207('0xf6')][_0xc207('0x11f')](db['OpenchannelInteraction'],{});db[_0xc207('0xf6')][_0xc207('0x11f')](db[_0xc207('0x61')],{'foreignKey':_0xc207('0x1e1'),'as':_0xc207('0x1de')});db['OpenchannelTransferReport'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d3'),'as':'FromAgent'});db[_0xc207('0xf6')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d4'),'as':'ToAgent'});db['OpenchannelTransferReport'][_0xc207('0x11f')](db[_0xc207('0x64')],{'foreignKey':_0xc207('0x1e2'),'as':'ToQueue'});db[_0xc207('0xf6')]['belongsTo'](db[_0xc207('0x61')],{'foreignKey':_0xc207('0x1e3'),'as':_0xc207('0x1d9')});db[_0xc207('0xf8')][_0xc207('0x11f')](db[_0xc207('0x5d')],{});db[_0xc207('0xf8')]['belongsTo'](db[_0xc207('0x5b')],{});db[_0xc207('0xf8')][_0xc207('0x11f')](db[_0xc207('0x137')],{'foreignKey':_0xc207('0x1e4'),'as':_0xc207('0x1de')});db[_0xc207('0xf8')]['belongsTo'](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d3'),'as':_0xc207('0x1da')});db[_0xc207('0xf8')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d4'),'as':_0xc207('0x1d5')});db['SmsTransferReport']['belongsTo'](db[_0xc207('0x5f')],{'foreignKey':_0xc207('0x1e5'),'as':_0xc207('0x1d7')});db[_0xc207('0xf8')][_0xc207('0x11f')](db[_0xc207('0x137')],{'foreignKey':'ToSmsAccountId','as':_0xc207('0x1d9')});db[_0xc207('0xfa')]['hasMany'](db['Disposition'],{'as':_0xc207('0x172'),'foreignKey':_0xc207('0x163')});db['CmList']['hasMany'](db[_0xc207('0x83')],{'as':_0xc207('0x1e6'),'foreignKey':_0xc207('0x163')});db[_0xc207('0xfa')][_0xc207('0x112')](db[_0xc207('0x78')],{'as':'Contacts','onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x163')});db['CmList']['hasMany'](db[_0xc207('0x115')],{'as':'HopperFinals','foreignKey':_0xc207('0x163')});db[_0xc207('0xfa')]['hasMany'](db[_0xc207('0x7f')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0xc207('0xfa')]['hasMany'](db['ReportAgentPreview'],{'as':_0xc207('0x81'),'foreignKey':'ListId'});db['CmList'][_0xc207('0x121')](db[_0xc207('0x1c')],{'as':_0xc207('0x1e7'),'through':_0xc207('0x14e')});db[_0xc207('0xfa')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':'cm_user_has_lists'});db['VoicePrefix'][_0xc207('0x112')](db[_0xc207('0x114')],{'as':_0xc207('0x1a2'),'onDelete':_0xc207('0x110')});db['VoicePrefix'][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x132')});db['UserProfile'][_0xc207('0x112')](db[_0xc207('0x10e')],{'as':'Users','foreignKey':_0xc207('0x120')});db[_0xc207('0xfd')][_0xc207('0x112')](db[_0xc207('0x1e8')],{'as':_0xc207('0x1e9'),'foreignKey':_0xc207('0x120'),'onDelete':_0xc207('0x110')});db[_0xc207('0x1e8')]['hasMany'](db['UserProfileResource'],{'as':_0xc207('0x1ea'),'foreignKey':_0xc207('0x1eb'),'onDelete':_0xc207('0x110')});db[_0xc207('0x102')]['hasMany'](db[_0xc207('0x15d')],{'as':_0xc207('0x172'),'foreignKey':_0xc207('0x1ec')});db[_0xc207('0x102')]['hasMany'](db[_0xc207('0x15e')],{'as':'Answers','foreignKey':_0xc207('0x1ec')});db[_0xc207('0x102')][_0xc207('0x112')](db[_0xc207('0x107')],{'as':_0xc207('0x153'),'foreignKey':_0xc207('0x1ec')});db[_0xc207('0x102')][_0xc207('0x112')](db[_0xc207('0x106')],{'as':_0xc207('0x160')});db[_0xc207('0x102')]['hasMany'](db[_0xc207('0x104')],{'as':_0xc207('0x161')});db[_0xc207('0x102')][_0xc207('0x11f')](db[_0xc207('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0xc207('0x102')]['belongsTo'](db[_0xc207('0x8b')],{'as':_0xc207('0x14b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xc207('0x102')][_0xc207('0x121')](db['User'],{'as':_0xc207('0x14f'),'through':'user_has_whatsapp_accounts'});db[_0xc207('0x104')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'onDelete':_0xc207('0x16f')});db[_0xc207('0x104')]['belongsTo'](db[_0xc207('0x1cf')],{'onDelete':_0xc207('0x16f')});db[_0xc207('0x104')][_0xc207('0x11f')](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0xc207('0x104')][_0xc207('0x11f')](db['Interval'],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x14a')});db['WhatsappApplication'][_0xc207('0x11f')](db[_0xc207('0x93')],{'onDelete':_0xc207('0x16f'),'foreignKey':_0xc207('0x170')});db[_0xc207('0x106')]['hasMany'](db['WhatsappMessage'],{'as':_0xc207('0x153'),'onDelete':_0xc207('0x110'),'foreignKey':_0xc207('0x1ed')});db[_0xc207('0x106')][_0xc207('0x11f')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x106')][_0xc207('0x11f')](db[_0xc207('0x10e')],{'as':'Owner','foreignKey':'UserId'});db[_0xc207('0x106')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x1a9'),'as':'Tags'});db[_0xc207('0x106')][_0xc207('0x121')](db[_0xc207('0x93')],{'through':_0xc207('0x1a9'),'as':_0xc207('0x16a')});db[_0xc207('0x106')][_0xc207('0x121')](db[_0xc207('0x10e')],{'as':_0xc207('0x16b'),'through':'user_has_whatsapp_interactions','foreignKey':_0xc207('0x1ed')});db[_0xc207('0x107')]['belongsTo'](db[_0xc207('0x10e')],{'as':_0xc207('0x10e')});db['WhatsappMessage'][_0xc207('0x11f')](db[_0xc207('0x78')],{'onDelete':_0xc207('0x110'),'as':'Contact'});db[_0xc207('0x107')][_0xc207('0x11f')](db['WhatsappInteraction'],{'onDelete':'cascade','as':_0xc207('0x16d'),'foreignKey':_0xc207('0x1ed')});db[_0xc207('0x107')][_0xc207('0x11f')](db[_0xc207('0x102')],{'as':_0xc207('0x178'),'foreignKey':_0xc207('0x1ec')});db[_0xc207('0x109')][_0xc207('0x11f')](db['WhatsappAccount'],{});db[_0xc207('0x109')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0xc207('0x163')});db[_0xc207('0x109')][_0xc207('0x11f')](db[_0xc207('0x78')],{'as':_0xc207('0x167'),'foreignKey':_0xc207('0x159')});db[_0xc207('0x109')][_0xc207('0x11f')](db[_0xc207('0x106')],{});db['WhatsappQueueReport'][_0xc207('0x11f')](db[_0xc207('0x1cf')],{});db[_0xc207('0x109')][_0xc207('0x11f')](db[_0xc207('0x107')],{});db[_0xc207('0x109')]['belongsTo'](db[_0xc207('0x10e')],{});db[_0xc207('0x1ee')][_0xc207('0x11f')](db[_0xc207('0x107')],{});db[_0xc207('0x1ee')][_0xc207('0x11f')](db['WhatsappInteraction'],{});db[_0xc207('0x1ee')][_0xc207('0x11f')](db['WhatsappAccount'],{'foreignKey':_0xc207('0x1ef'),'as':_0xc207('0x1de')});db[_0xc207('0x1ee')][_0xc207('0x11f')](db[_0xc207('0x102')],{'foreignKey':_0xc207('0x1f0'),'as':_0xc207('0x1d9')});db[_0xc207('0x1ee')]['belongsTo'](db[_0xc207('0x1cf')],{'foreignKey':'ToQueueId','as':_0xc207('0x1d7')});db[_0xc207('0x1ee')]['belongsTo'](db[_0xc207('0x10e')],{'foreignKey':_0xc207('0x1d3'),'as':_0xc207('0x1da')});db['WhatsappTransferReport'][_0xc207('0x11f')](db[_0xc207('0x10e')],{'foreignKey':'ToUserId','as':_0xc207('0x1d5')});db[_0xc207('0x1cf')]['belongsToMany'](db[_0xc207('0x10e')],{'as':_0xc207('0x14f'),'through':_0xc207('0x3c'),'foreignKey':_0xc207('0x1f1')});db[_0xc207('0x1cf')][_0xc207('0x121')](db[_0xc207('0xe5')],{'through':'team_has_whatsapp_queues','as':_0xc207('0x150')});module[_0xc207('0x1f2')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9f02=['ChatWebsiteId','ProactiveActions','ChatMessage','OpenchannelQueueReport','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CompanyId','Hoppers','Company','cm_contact_has_tags','Agent','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','AutomationAnyId','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','openchannel_interaction_has_tags','whatsapp_interaction_has_tags','Trigger','AllConditions','AllCondition','AnyConditions','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','Descriptions','AccountId','Description','DescriptionId','Field','FieldId','VariableId','int_desk_configuration_has_tags','Subject','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskField','int_freshdesk_configuration_has_tags','ServicenowAccount','Dynamics365Account','Dynamics365Configuration','FreshsalesField','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','ProjectId','team_has_voice_queues','team_has_whatsapp_queues','WhatsappQueues','HopperBlacks','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','FromAgent','ToUserId','ToChatQueueId','ToAccount','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','Extensions','userProfileId','UserProfileSection','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccount','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','path','jstz','determine','sequelize','defaultsDeep','xcall','127.0.0.1','mysql','utf8mb4','sequelizeHistory','motion2','password','options','database','User','import','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','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','../api/smsApplication/smsApplication.model','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','ChatApplication','../api/chatApplication/chatApplication.model','ChatGroup','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','Migration','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/notification/notification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','hasOne','cascade','UserId','hasMany','VoiceRecording','Recordings','UserVoiceQueueRt','VoiceQueuesRt','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','Notification','Notifications','SenderId','belongsTo','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_square_projects','SpiedAgents','Applications','Sound','moh_has_sounds','Members','VoiceQueueId','CmHopper','HopperHistories','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','Answers','Interactions','List','ListId','Template','TemplateId','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','restrict','TagId','MailQueueReport','DashboardItem','FaxAccountId','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','user_has_fax_interactions','Interaction','AttachmentId','UserFaxQueue','team_has_fax_queues','SmsAccount','SmsMessage','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId'];(function(_0x118af5,_0x36caec){var _0x1486ae=function(_0x17dd31){while(--_0x17dd31){_0x118af5['push'](_0x118af5['shift']());}};_0x1486ae(++_0x36caec);}(_0x9f02,0x68));var _0x29f0=function(_0x4cad3d,_0x46ebc6){_0x4cad3d=_0x4cad3d-0x0;var _0x571285=_0x9f02[_0x4cad3d];return _0x571285;};'use strict';var path=require(_0x29f0('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0x29f0('0x1'));var timezone=jstz[_0x29f0('0x2')]();config[_0x29f0('0x3')]=_[_0x29f0('0x4')](config[_0x29f0('0x3')],{'database':'motion2','username':_0x29f0('0x5'),'password':'xC@LL1234','options':{'host':_0x29f0('0x6'),'port':0xcea,'dialect':_0x29f0('0x7'),'dialectOptions':{'charset':_0x29f0('0x8')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});config[_0x29f0('0x9')]=_['defaultsDeep'](config[_0x29f0('0x9')],{'database':_0x29f0('0xa'),'username':_0x29f0('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x29f0('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x29f0('0x3')]['database'],config[_0x29f0('0x3')]['username'],config[_0x29f0('0x3')][_0x29f0('0xb')],config[_0x29f0('0x3')][_0x29f0('0xc')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x29f0('0xd')],config[_0x29f0('0x9')]['username'],config[_0x29f0('0x9')]['password'],config[_0x29f0('0x9')]['options'])};db[_0x29f0('0xe')]=db[_0x29f0('0x3')]['import']('../api/user/user.model');db['VoiceChanSpy']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x10'));db['VoiceContext']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x11'));db[_0x29f0('0x12')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x13'));db[_0x29f0('0x14')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x15'));db['VoiceQueue']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x16'));db['VoiceRecording']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x17'));db[_0x29f0('0x18')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x19'));db[_0x29f0('0x1a')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x1b'));db[_0x29f0('0x1c')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x1d'));db[_0x29f0('0x1e')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x1f'));db[_0x29f0('0x20')]=db['sequelize']['import'](_0x29f0('0x21'));db[_0x29f0('0x22')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0x23'));db[_0x29f0('0x24')]=db['sequelize']['import'](_0x29f0('0x25'));db[_0x29f0('0x26')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x27'));db['Trunk']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x28'));db[_0x29f0('0x29')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x2a'));db['UserVoiceQueueRt']=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x29f0('0x2b')]=db[_0x29f0('0x3')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0x29f0('0x2c')]=db['sequelize'][_0x29f0('0xf')]('../api/userChatQueue/userChatQueue.model');db[_0x29f0('0x2d')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x2e'));db['UserFaxQueue']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x2f'));db[_0x29f0('0x30')]=db['sequelize'][_0x29f0('0xf')]('../api/userSmsQueue/userSmsQueue.model');db[_0x29f0('0x31')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x32'));db[_0x29f0('0x33')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x29f0('0x34')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/mailServerIn/mailServerIn.model');db[_0x29f0('0x35')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x36'));db[_0x29f0('0x37')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/mailAccount/mailAccount.model');db[_0x29f0('0x38')]=db[_0x29f0('0x3')]['import']('../api/mailQueue/mailQueue.model');db[_0x29f0('0x39')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x3a'));db[_0x29f0('0x3b')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x3c'));db[_0x29f0('0x3d')]=db[_0x29f0('0x3')]['import']('../api/mailMessage/mailMessage.model');db[_0x29f0('0x3e')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x3f'));db['MailQueueReport']=db[_0x29f0('0x3')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x29f0('0x40')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x41'));db['DashboardItem']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x42'));db[_0x29f0('0x43')]=db['sequelize'][_0x29f0('0xf')]('../api/faxAccount/faxAccount.model');db[_0x29f0('0x44')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/faxApplication/faxApplication.model');db[_0x29f0('0x45')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x46'));db[_0x29f0('0x47')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x48'));db[_0x29f0('0x49')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x4a'));db[_0x29f0('0x4b')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x4c'));db['SmsAccount']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x4d'));db['SmsApplication']=db['sequelize'][_0x29f0('0xf')](_0x29f0('0x4e'));db['SmsInteraction']=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0x29f0('0x3')]['import']('../api/smsMessage/smsMessage.model');db[_0x29f0('0x4f')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/smsQueue/smsQueue.model');db[_0x29f0('0x50')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x51'));db[_0x29f0('0x52')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/openchannelApplication/openchannelApplication.model');db[_0x29f0('0x53')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x54'));db[_0x29f0('0x55')]=db['sequelize']['import'](_0x29f0('0x56'));db[_0x29f0('0x57')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/openchannelQueue/openchannelQueue.model');db[_0x29f0('0x58')]=db['sequelize'][_0x29f0('0xf')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db['sequelize']['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x29f0('0x59')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x5a'));db['ChatInteraction']=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0x29f0('0x3')]['import']('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db['sequelize'][_0x29f0('0xf')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db['sequelize'][_0x29f0('0xf')]('../api/chatQueue/chatQueue.model');db[_0x29f0('0x5b')]=db['sequelize'][_0x29f0('0xf')]('../api/chatGroup/chatGroup.model');db[_0x29f0('0x5c')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x5d'));db[_0x29f0('0x5e')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x5f'));db['CmContact']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x60'));db['CmHopper']=db['sequelize'][_0x29f0('0xf')](_0x29f0('0x61'));db[_0x29f0('0x62')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x63'));db[_0x29f0('0x64')]=db['sequelize']['import']('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db['sequelize'][_0x29f0('0xf')](_0x29f0('0x65'));db[_0x29f0('0x66')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x67'));db[_0x29f0('0x68')]=db[_0x29f0('0x3')]['import']('../api/cmCustomField/cmCustomField.model');db[_0x29f0('0x69')]=db['sequelize']['import']('../api/action/action.model');db[_0x29f0('0x6a')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x6b'));db[_0x29f0('0x6c')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0x6d'));db[_0x29f0('0x6e')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x6f'));db[_0x29f0('0x70')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x71'));db[_0x29f0('0x72')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/interval/interval.model');db['Pause']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x73'));db['Cdr']=db['sequelize']['import'](_0x29f0('0x74'));db[_0x29f0('0x75')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x76'));db[_0x29f0('0x77')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x78'));db['Sound']=db[_0x29f0('0x3')]['import'](_0x29f0('0x79'));db[_0x29f0('0x7a')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/tag/tag.model');db['Template']=db[_0x29f0('0x3')]['import'](_0x29f0('0x7b'));db['Trigger']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x7c'));db[_0x29f0('0x7d')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x7e'));db[_0x29f0('0x7f')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x80'));db['IntegrationReport']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x81'));db[_0x29f0('0x82')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x83'));db[_0x29f0('0x84')]=db[_0x29f0('0x3')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x29f0('0x85')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x86'));db[_0x29f0('0x87')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x88'));db[_0x29f0('0x89')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x8a'));db['AnalyticTreeReport']=db[_0x29f0('0x3')]['import'](_0x29f0('0x8b'));db[_0x29f0('0x8c')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x8d'));db[_0x29f0('0x8e')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x29f0('0x8f')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x90'));db[_0x29f0('0x91')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x92'));db[_0x29f0('0x93')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x94'));db[_0x29f0('0x95')]=db[_0x29f0('0x3')]['import'](_0x29f0('0x96'));db[_0x29f0('0x97')]=db['sequelize']['import'](_0x29f0('0x98'));db[_0x29f0('0x99')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0x9a'));db[_0x29f0('0x9b')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x9c'));db[_0x29f0('0x9d')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0x9e'));db[_0x29f0('0x9f')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x29f0('0xa0')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xa1'));db[_0x29f0('0xa2')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xa3'));db[_0x29f0('0xa4')]=db[_0x29f0('0x3')]['import'](_0x29f0('0xa5'));db[_0x29f0('0xa6')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xa7'));db[_0x29f0('0xa8')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xa9'));db['FreshdeskConfiguration']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xaa'));db['FreshdeskField']=db['sequelize'][_0x29f0('0xf')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x29f0('0xab')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xac'));db[_0x29f0('0xad')]=db['sequelize']['import'](_0x29f0('0xae'));db[_0x29f0('0xaf')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xb0'));db['ServicenowAccount']=db[_0x29f0('0x3')]['import'](_0x29f0('0xb1'));db[_0x29f0('0xb2')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x29f0('0xb3')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xb4'));db['Dynamics365Account']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xb5'));db['Dynamics365Configuration']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xb6'));db[_0x29f0('0xb7')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xb8'));db[_0x29f0('0xb9')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xba'));db[_0x29f0('0xbb')]=db['sequelize'][_0x29f0('0xf')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xbc'));db['Integration']=db[_0x29f0('0x3')]['import'](_0x29f0('0x80'));db['Network']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xbd'));db['ChatQueueReport']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xbe'));db[_0x29f0('0xbf')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xc0'));db[_0x29f0('0xc1')]=db[_0x29f0('0x3')]['import'](_0x29f0('0xc2'));db['JscriptyQuestionReport']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xc3'));db[_0x29f0('0xc4')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xc5'));db[_0x29f0('0xc6')]=db['sequelize']['import'](_0x29f0('0xc7'));db['SquareReport']=db['sequelize']['import'](_0x29f0('0xc8'));db[_0x29f0('0xc9')]=db[_0x29f0('0x3')]['import'](_0x29f0('0xca'));db[_0x29f0('0xcb')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xcc'));db[_0x29f0('0xcd')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xce'));db[_0x29f0('0xcf')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xd0'));db[_0x29f0('0xd1')]=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xd2'));db[_0x29f0('0xd3')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xd4'));db[_0x29f0('0xd5')]=db['sequelize']['import'](_0x29f0('0xd6'));db[_0x29f0('0xd7')]=db['sequelize'][_0x29f0('0xf')]('../api/team/team.model');db['License']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xd8'));db[_0x29f0('0xd9')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/campaign/campaign.model');db[_0x29f0('0xda')]=db['sequelize'][_0x29f0('0xf')]('../api/migration/migration.model');db[_0x29f0('0xdb')]=db[_0x29f0('0x3')]['import'](_0x29f0('0xdc'));db[_0x29f0('0xdd')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/plugin/plugin.model');db[_0x29f0('0xde')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xdf'));db[_0x29f0('0xe0')]=db[_0x29f0('0x3')]['import'](_0x29f0('0xe1'));db[_0x29f0('0xe2')]=db['sequelize'][_0x29f0('0xf')]('../api/faxTransferReport/faxTransferReport.model');db[_0x29f0('0xe3')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x29f0('0xe4')]=db[_0x29f0('0x3')]['import'](_0x29f0('0xe5'));db['CmList']=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xe6'));db[_0x29f0('0xe7')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xe8'));db[_0x29f0('0xe9')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xea'));db['UserProfileSection']=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xeb'));db['UserProfileResource']=db['sequelize'][_0x29f0('0xf')](_0x29f0('0xec'));db['Notification']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xed'));db['WhatsappAccount']=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xee'));db[_0x29f0('0xef')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xf0'));db[_0x29f0('0xf1')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x29f0('0xf2')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xf3'));db['WhatsappQueueReport']=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x29f0('0xf4')]=db[_0x29f0('0x3')][_0x29f0('0xf')](_0x29f0('0xf5'));db['WhatsappQueue']=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/whatsappQueue/whatsappQueue.model');db[_0x29f0('0xf6')]=db[_0x29f0('0x3')][_0x29f0('0xf')]('../api/cloudProvider/cloudProvider.model');db[_0x29f0('0xe')][_0x29f0('0xf7')](db[_0x29f0('0x1a')],{'as':_0x29f0('0x1a'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0xfb')],{'as':_0x29f0('0xfc'),'foreignKey':'UserId'});db['User'][_0x29f0('0xfa')](db[_0x29f0('0xfd')],{'as':_0x29f0('0xfe'),'foreignKey':'UserId'});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x12')],{'as':'Extensions','onDelete':_0x29f0('0xf8'),'hooks':!![]});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x64')],{'as':_0x29f0('0xff'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x100')],{'as':_0x29f0('0x101'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x66')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x53')],{'as':_0x29f0('0x102'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x103')],{'as':_0x29f0('0x104'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')]['hasMany'](db[_0x29f0('0x105')],{'as':_0x29f0('0x106'),'foreignKey':'UserId'});db['User'][_0x29f0('0xfa')](db['FaxInteraction'],{'as':_0x29f0('0x107'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x3b')],{'as':'MailInteractions','foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')]['hasMany'](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':_0x29f0('0xf9')});db[_0x29f0('0xe')][_0x29f0('0xfa')](db[_0x29f0('0x108')],{'as':_0x29f0('0x109'),'foreignKey':_0x29f0('0x10a')});db[_0x29f0('0xe')][_0x29f0('0x10b')](db[_0x29f0('0xe9')],{'as':_0x29f0('0xe9'),'foreignKey':'userProfileId'});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x5b')],{'as':'Groups','through':_0x29f0('0x10d')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x10f'),'through':_0x29f0('0x110')});db[_0x29f0('0xe')]['belongsToMany'](db[_0x29f0('0x111')],{'as':_0x29f0('0x112'),'through':_0x29f0('0x113')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0xd7')],{'through':_0x29f0('0x114')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db['MailInteraction'],{'as':_0x29f0('0x115'),'through':_0x29f0('0x116')});db['User'][_0x29f0('0x10c')](db['ChatInteraction'],{'as':_0x29f0('0x104'),'through':_0x29f0('0x117')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x45')],{'as':_0x29f0('0x107'),'through':'user_has_fax_interactions'});db[_0x29f0('0xe')]['belongsToMany'](db[_0x29f0('0x105')],{'as':_0x29f0('0x106'),'through':_0x29f0('0x118')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x53')],{'as':_0x29f0('0x102'),'through':_0x29f0('0x119')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db['WhatsappInteraction'],{'as':_0x29f0('0x11a'),'through':_0x29f0('0x11b')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x11c')],{'as':_0x29f0('0x11d'),'through':_0x29f0('0x2b'),'required':![]});db[_0x29f0('0xe')][_0x29f0('0x10c')](db['MailQueue'],{'as':_0x29f0('0x11e'),'through':_0x29f0('0x2d'),'required':![]});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x11f')],{'as':_0x29f0('0x120'),'through':_0x29f0('0x2c'),'required':![],'hooks':!![]});db[_0x29f0('0xe')]['belongsToMany'](db[_0x29f0('0x49')],{'as':_0x29f0('0x121'),'through':'UserFaxQueue','required':![]});db[_0x29f0('0xe')]['belongsToMany'](db['SmsQueue'],{'as':_0x29f0('0x122'),'through':_0x29f0('0x30'),'required':![]});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x57')],{'as':_0x29f0('0x123'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0x29f0('0x10c')](db[_0x29f0('0x124')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x111')],{'through':_0x29f0('0x113')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db['VoicePrefix'],{'as':_0x29f0('0x125'),'through':_0x29f0('0x126'),'required':![]});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x58')],{'as':_0x29f0('0x127'),'through':_0x29f0('0x128')});db[_0x29f0('0xe')]['belongsToMany'](db[_0x29f0('0x43')],{'as':_0x29f0('0x129'),'through':_0x29f0('0x12a')});db[_0x29f0('0xe')]['belongsToMany'](db[_0x29f0('0x37')],{'as':'MailAccounts','through':_0x29f0('0x12b')});db[_0x29f0('0xe')][_0x29f0('0x10c')](db[_0x29f0('0x50')],{'as':_0x29f0('0x12c'),'through':_0x29f0('0x12d')});db['User'][_0x29f0('0x10c')](db['SmsAccount'],{'as':_0x29f0('0x12e'),'through':_0x29f0('0x12f')});db['User'][_0x29f0('0x10c')](db['WhatsappAccount'],{'as':_0x29f0('0x130'),'through':'user_has_whatsapp_accounts'});db[_0x29f0('0xe')][_0x29f0('0x10c')](db['SquareProject'],{'as':'SquareProjects','through':_0x29f0('0x131')});db['VoiceChanSpy'][_0x29f0('0xfa')](db[_0x29f0('0x12')],{'as':_0x29f0('0x132'),'onDelete':_0x29f0('0xf8'),'foreignKey':'ChanSpyId'});db['VoiceContext']['hasMany'](db[_0x29f0('0x12')],{'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x12')]['hasMany'](db['VoiceExtension'],{'as':_0x29f0('0x133'),'onDelete':'cascade'});db[_0x29f0('0x14')][_0x29f0('0x10c')](db[_0x29f0('0x134')],{'as':'Sounds','through':_0x29f0('0x135')});db['VoiceQueue']['hasMany'](db['UserVoiceQueueRt'],{'as':_0x29f0('0x136'),'foreignKey':_0x29f0('0x137')});db[_0x29f0('0x11c')]['hasMany'](db[_0x29f0('0x138')],{'as':'Hoppers','foreignKey':_0x29f0('0x137')});db['VoiceQueue']['hasMany'](db[_0x29f0('0x64')],{'as':_0x29f0('0xff'),'foreignKey':_0x29f0('0x137')});db[_0x29f0('0x11c')][_0x29f0('0xfa')](db[_0x29f0('0x100')],{'as':_0x29f0('0x139'),'foreignKey':_0x29f0('0x137')});db[_0x29f0('0x11c')][_0x29f0('0xfa')](db[_0x29f0('0x66')],{'as':'ReportAgentPreview','foreignKey':_0x29f0('0x137')});db[_0x29f0('0x11c')][_0x29f0('0xfa')](db[_0x29f0('0x62')],{'as':'HopperBlacks','foreignKey':_0x29f0('0x137')});db[_0x29f0('0x11c')]['hasMany'](db['JscriptySessionReport'],{'as':_0x29f0('0x13a'),'foreignKey':_0x29f0('0x137')});db[_0x29f0('0x11c')][_0x29f0('0x10b')](db[_0x29f0('0x13b')],{'as':_0x29f0('0x13b'),'foreignKey':_0x29f0('0x13c')});db[_0x29f0('0x11c')][_0x29f0('0x10b')](db[_0x29f0('0x13b')],{'as':_0x29f0('0x13d'),'foreignKey':_0x29f0('0x13e')});db[_0x29f0('0x11c')]['belongsTo'](db[_0x29f0('0x72')],{'as':_0x29f0('0x72'),'foreignKey':_0x29f0('0x13f')});db['VoiceQueue'][_0x29f0('0x10b')](db[_0x29f0('0x140')],{'as':_0x29f0('0x141'),'foreignKey':_0x29f0('0x142')});db[_0x29f0('0x11c')][_0x29f0('0x10c')](db[_0x29f0('0x111')],{'as':_0x29f0('0x112'),'through':_0x29f0('0x143')});db[_0x29f0('0x11c')]['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x2b')});db[_0x29f0('0x11c')][_0x29f0('0x10c')](db['Team'],{'as':_0x29f0('0x145'),'through':'team_has_voice_queues'});db[_0x29f0('0x11c')][_0x29f0('0x10c')](db[_0x29f0('0x111')],{'as':_0x29f0('0x146'),'through':_0x29f0('0x147')});db[_0x29f0('0xfb')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':_0x29f0('0xe'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0x18')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':'User','foreignKey':_0x29f0('0xf9')});db['VoiceMail'][_0x29f0('0xfa')](db[_0x29f0('0x1c')],{'as':_0x29f0('0x148'),'onDelete':_0x29f0('0xf8'),'foreignKey':'mailboxuser','sourceKey':_0x29f0('0x149')});db[_0x29f0('0x1c')][_0x29f0('0x10b')](db[_0x29f0('0x1a')],{'foreignKey':'mailboxuser','targetKey':_0x29f0('0x149')});db[_0x29f0('0x1e')][_0x29f0('0xfa')](db['VoiceQueueReport'],{'as':_0x29f0('0x14a'),'foreignKey':'uniqueid','constraints':![]});db[_0x29f0('0x1e')]['hasMany'](db[_0x29f0('0x22')],{'as':_0x29f0('0x14b'),'foreignKey':_0x29f0('0x14c'),'constraints':![]});db['VoiceCallReport'][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':_0x29f0('0xe'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0x1e')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x34')]['belongsTo'](db[_0x29f0('0x37')],{'as':_0x29f0('0x37'),'foreignKey':'MailAccountId'});db[_0x29f0('0x35')][_0x29f0('0x10b')](db[_0x29f0('0x37')],{'as':_0x29f0('0x37'),'foreignKey':_0x29f0('0x14f')});db[_0x29f0('0x37')][_0x29f0('0xf7')](db[_0x29f0('0x34')],{'as':_0x29f0('0x150'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x37')][_0x29f0('0xf7')](db[_0x29f0('0x35')],{'as':_0x29f0('0x151'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x37')][_0x29f0('0xfa')](db['Disposition'],{'as':_0x29f0('0x152'),'foreignKey':_0x29f0('0x14f')});db[_0x29f0('0x37')][_0x29f0('0xfa')](db['CannedAnswer'],{'as':_0x29f0('0x153'),'foreignKey':'MailAccountId'});db[_0x29f0('0x37')][_0x29f0('0xfa')](db[_0x29f0('0x3d')],{'as':_0x29f0('0x148'),'foreignKey':_0x29f0('0x14f')});db[_0x29f0('0x37')][_0x29f0('0xfa')](db['MailInteraction'],{'as':_0x29f0('0x154')});db[_0x29f0('0x37')][_0x29f0('0xfa')](db[_0x29f0('0x3e')],{'as':_0x29f0('0x133')});db[_0x29f0('0x37')][_0x29f0('0x10b')](db['CmList'],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x37')][_0x29f0('0x10b')](db[_0x29f0('0x157')],{'as':_0x29f0('0x157'),'foreignKey':_0x29f0('0x158')});db['MailAccount'][_0x29f0('0x10b')](db['Pause'],{'as':_0x29f0('0x141'),'foreignKey':_0x29f0('0x142')});db[_0x29f0('0x37')]['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x12b')});db[_0x29f0('0x38')]['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':'UserMailQueue'});db[_0x29f0('0x38')][_0x29f0('0x10c')](db[_0x29f0('0xd7')],{'through':_0x29f0('0x159'),'as':_0x29f0('0x145')});db[_0x29f0('0x3b')][_0x29f0('0xfa')](db[_0x29f0('0x3d')],{'as':_0x29f0('0x148'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x15a')});db[_0x29f0('0x3b')][_0x29f0('0x10b')](db[_0x29f0('0x37')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x14f')});db[_0x29f0('0x3b')]['belongsTo'](db[_0x29f0('0x10e')],{'as':'Contact','foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x3b')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':'Owner','foreignKey':'UserId'});db[_0x29f0('0x3b')][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x15c'),'as':_0x29f0('0x15d')});db[_0x29f0('0x3b')]['belongsToMany'](db[_0x29f0('0x7a')],{'through':_0x29f0('0x15c'),'as':_0x29f0('0x15e')});db['MailInteraction'][_0x29f0('0x10c')](db['User'],{'as':_0x29f0('0x15f'),'through':_0x29f0('0x116'),'foreignKey':_0x29f0('0x15a')});db['MailMessage'][_0x29f0('0xfa')](db[_0x29f0('0xdb')],{'as':_0x29f0('0x160'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x3d')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':'User'});db[_0x29f0('0x3d')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0x14d')});db['MailMessage'][_0x29f0('0x10b')](db[_0x29f0('0x3b')],{'as':'Interaction','foreignKey':_0x29f0('0x15a')});db[_0x29f0('0x3d')]['belongsTo'](db[_0x29f0('0x37')],{'as':_0x29f0('0x15b'),'foreignKey':'MailAccountId'});db[_0x29f0('0x3e')]['belongsTo'](db[_0x29f0('0xe')],{'onDelete':'restrict'});db[_0x29f0('0x3e')]['belongsTo'](db[_0x29f0('0x38')],{'onDelete':_0x29f0('0x161')});db['MailApplication'][_0x29f0('0x10b')](db[_0x29f0('0x37')],{'onDelete':_0x29f0('0x161')});db[_0x29f0('0x3e')]['belongsTo'](db[_0x29f0('0x72')],{'onDelete':_0x29f0('0x161'),'foreignKey':'IntervalId'});db['MailApplication'][_0x29f0('0x10b')](db[_0x29f0('0x7a')],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x162')});db['MailQueueReport']['belongsTo'](db[_0x29f0('0x37')],{});db['MailQueueReport'][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':'List','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x163')][_0x29f0('0x10b')](db['CmContact'],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x163')][_0x29f0('0x10b')](db[_0x29f0('0x3b')],{});db[_0x29f0('0x163')][_0x29f0('0x10b')](db[_0x29f0('0x3d')],{});db[_0x29f0('0x163')][_0x29f0('0x10b')](db['User'],{});db[_0x29f0('0x163')]['belongsTo'](db['MailQueue'],{});db['Dashboard']['hasMany'](db[_0x29f0('0x164')],{'as':'Items','onDelete':'cascade'});db[_0x29f0('0x43')][_0x29f0('0xfa')](db[_0x29f0('0x6e')],{'as':_0x29f0('0x152'),'foreignKey':_0x29f0('0x165')});db[_0x29f0('0x43')][_0x29f0('0xfa')](db[_0x29f0('0x6c')],{'as':'Answers','foreignKey':_0x29f0('0x165')});db[_0x29f0('0x43')]['hasMany'](db['FaxInteraction'],{'as':'Interactions'});db['FaxAccount'][_0x29f0('0xfa')](db[_0x29f0('0x44')],{'as':_0x29f0('0x133')});db['FaxAccount'][_0x29f0('0xfa')](db[_0x29f0('0x12')],{'as':_0x29f0('0x166'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x43')][_0x29f0('0xfa')](db['FaxMessage'],{'as':_0x29f0('0x148')});db[_0x29f0('0x43')]['belongsTo'](db[_0x29f0('0x13b')],{'as':_0x29f0('0x13b')});db['FaxAccount'][_0x29f0('0x10b')](db['CmList'],{'as':'List','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x43')][_0x29f0('0x10b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x29f0('0x142')});db[_0x29f0('0x43')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':'user_has_fax_accounts'});db['FaxApplication'][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'onDelete':_0x29f0('0x161')});db[_0x29f0('0x44')][_0x29f0('0x10b')](db[_0x29f0('0x49')],{'onDelete':'restrict'});db[_0x29f0('0x44')][_0x29f0('0x10b')](db[_0x29f0('0x43')],{'onDelete':_0x29f0('0x161')});db[_0x29f0('0x44')][_0x29f0('0x10b')](db[_0x29f0('0x7a')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x29f0('0x45')][_0x29f0('0xfa')](db['FaxMessage'],{'as':_0x29f0('0x148'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x167')});db[_0x29f0('0x45')][_0x29f0('0x10b')](db[_0x29f0('0x43')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x165')});db[_0x29f0('0x45')]['belongsTo'](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x45')]['belongsTo'](db[_0x29f0('0xe')],{'as':_0x29f0('0x168'),'foreignKey':'UserId'});db['FaxInteraction'][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x169'),'as':_0x29f0('0x15d')});db[_0x29f0('0x45')][_0x29f0('0x10c')](db['Tag'],{'through':_0x29f0('0x169'),'as':_0x29f0('0x15e')});db[_0x29f0('0x45')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':'Users','through':_0x29f0('0x16a'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0xe')});db[_0x29f0('0x47')][_0x29f0('0x10b')](db['FaxInteraction'],{'as':_0x29f0('0x16b'),'foreignKey':_0x29f0('0x167')});db['FaxMessage'][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0x14d')});db[_0x29f0('0x47')]['belongsTo'](db[_0x29f0('0xdb')],{'as':'Attachment','foreignKey':_0x29f0('0x16c')});db['FaxMessage'][_0x29f0('0x10b')](db[_0x29f0('0x43')],{'as':'Account','foreignKey':_0x29f0('0x165')});db[_0x29f0('0x49')]['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x16d')});db[_0x29f0('0x49')][_0x29f0('0x10c')](db[_0x29f0('0xd7')],{'through':_0x29f0('0x16e'),'as':'Teams'});db[_0x29f0('0x4b')][_0x29f0('0x10b')](db[_0x29f0('0x43')],{});db[_0x29f0('0x4b')][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x4b')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db['FaxQueueReport'][_0x29f0('0x10b')](db[_0x29f0('0x45')],{});db[_0x29f0('0x4b')]['belongsTo'](db[_0x29f0('0x47')],{});db[_0x29f0('0x4b')]['belongsTo'](db[_0x29f0('0xe')],{});db[_0x29f0('0x4b')][_0x29f0('0x10b')](db['FaxQueue'],{});db[_0x29f0('0x16f')][_0x29f0('0xfa')](db[_0x29f0('0x6e')],{'as':_0x29f0('0x152'),'foreignKey':'SmsAccountId'});db[_0x29f0('0x16f')][_0x29f0('0xfa')](db[_0x29f0('0x6c')],{'as':_0x29f0('0x153'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x29f0('0xfa')](db[_0x29f0('0x170')],{'as':_0x29f0('0x148'),'foreignKey':_0x29f0('0x171')});db[_0x29f0('0x16f')][_0x29f0('0xfa')](db['SmsInteraction'],{'as':_0x29f0('0x154')});db[_0x29f0('0x16f')][_0x29f0('0xfa')](db['SmsApplication'],{'as':_0x29f0('0x133')});db[_0x29f0('0x16f')][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':'List','foreignKey':_0x29f0('0x156')});db['SmsAccount'][_0x29f0('0x10b')](db[_0x29f0('0x140')],{'as':'mandatoryDispositionPause','foreignKey':_0x29f0('0x142')});db[_0x29f0('0x16f')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':'user_has_sms_accounts'});db[_0x29f0('0x172')]['belongsTo'](db[_0x29f0('0xe')],{'onDelete':'restrict'});db[_0x29f0('0x172')][_0x29f0('0x10b')](db[_0x29f0('0x4f')],{'onDelete':'restrict'});db[_0x29f0('0x172')][_0x29f0('0x10b')](db[_0x29f0('0x16f')],{'onDelete':'restrict'});db[_0x29f0('0x172')][_0x29f0('0x10b')](db['Interval'],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x29f0('0x172')][_0x29f0('0x10b')](db[_0x29f0('0x7a')],{'onDelete':_0x29f0('0x161'),'foreignKey':'TagId'});db['SmsInteraction'][_0x29f0('0xfa')](db['SmsMessage'],{'as':_0x29f0('0x148'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x173')});db[_0x29f0('0x105')][_0x29f0('0x10b')](db[_0x29f0('0x16f')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x171')});db[_0x29f0('0x105')]['belongsTo'](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x105')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':_0x29f0('0x168'),'foreignKey':'UserId'});db[_0x29f0('0x105')][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x174'),'as':'Tags'});db[_0x29f0('0x105')][_0x29f0('0x10c')](db['Tag'],{'through':_0x29f0('0x174'),'as':'ThroughTags'});db['SmsInteraction'][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x15f'),'through':_0x29f0('0x118'),'foreignKey':_0x29f0('0x173')});db[_0x29f0('0x170')]['belongsTo'](db[_0x29f0('0xe')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0x29f0('0x10e')],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0x14d')});db[_0x29f0('0x170')][_0x29f0('0x10b')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x29f0('0x16b'),'foreignKey':_0x29f0('0x173')});db[_0x29f0('0x170')]['belongsTo'](db[_0x29f0('0x16f')],{'as':_0x29f0('0x15b'),'foreignKey':'SmsAccountId'});db['SmsQueue'][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x30'),'foreignKey':_0x29f0('0x175')});db[_0x29f0('0x4f')][_0x29f0('0x10c')](db[_0x29f0('0xd7')],{'through':_0x29f0('0x176'),'as':_0x29f0('0x145')});db[_0x29f0('0x50')]['hasMany'](db[_0x29f0('0x6e')],{'as':_0x29f0('0x152'),'foreignKey':_0x29f0('0x177')});db[_0x29f0('0x50')][_0x29f0('0xfa')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x29f0('0x177')});db[_0x29f0('0x50')][_0x29f0('0xfa')](db[_0x29f0('0x53')],{'as':'Interactions','foreignKey':_0x29f0('0x177')});db[_0x29f0('0x50')][_0x29f0('0xfa')](db['OpenchannelMessage'],{'as':_0x29f0('0x148'),'foreignKey':'OpenchannelAccountId'});db[_0x29f0('0x50')]['hasMany'](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x29f0('0x177')});db['OpenchannelAccount'][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':'List','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x50')]['belongsTo'](db['Pause'],{'as':_0x29f0('0x141'),'foreignKey':_0x29f0('0x142')});db[_0x29f0('0x50')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':'Agents','through':_0x29f0('0x12d')});db[_0x29f0('0x52')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'onDelete':_0x29f0('0x161')});db[_0x29f0('0x52')][_0x29f0('0x10b')](db['OpenchannelQueue'],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x178')});db[_0x29f0('0x52')][_0x29f0('0x10b')](db[_0x29f0('0x50')],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x177')});db['OpenchannelApplication'][_0x29f0('0x10b')](db[_0x29f0('0x72')],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x13f')});db[_0x29f0('0x52')][_0x29f0('0x10b')](db[_0x29f0('0x7a')],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x162')});db[_0x29f0('0x53')][_0x29f0('0xfa')](db['OpenchannelMessage'],{'as':'Messages','onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x179')});db[_0x29f0('0x53')][_0x29f0('0x10b')](db[_0x29f0('0x50')],{'as':_0x29f0('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0x29f0('0x53')][_0x29f0('0x10b')](db['CmContact'],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x53')][_0x29f0('0x10b')](db['User'],{'as':_0x29f0('0x168'),'foreignKey':_0x29f0('0xf9')});db['OpenchannelInteraction'][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':'openchannel_interaction_has_tags','as':_0x29f0('0x15d')});db['OpenchannelInteraction'][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':'openchannel_interaction_has_tags','as':_0x29f0('0x15e')});db[_0x29f0('0x53')]['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x15f'),'through':_0x29f0('0x119'),'foreignKey':'OpenchannelInteractionId'});db[_0x29f0('0x55')][_0x29f0('0x10b')](db['User'],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0xe')});db[_0x29f0('0x55')][_0x29f0('0x10b')](db['CmContact'],{'onDelete':_0x29f0('0xf8'),'as':'Contact'});db[_0x29f0('0x55')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x29f0('0x16b'),'foreignKey':_0x29f0('0x179')});db[_0x29f0('0x55')][_0x29f0('0x10b')](db[_0x29f0('0xdb')],{'as':_0x29f0('0xdb'),'foreignKey':_0x29f0('0x16c')});db[_0x29f0('0x55')][_0x29f0('0x10b')](db[_0x29f0('0x50')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x177')});db['OpenchannelQueue']['belongsToMany'](db[_0x29f0('0xe')],{'as':'Agents','through':_0x29f0('0x31'),'foreignKey':_0x29f0('0x178')});db[_0x29f0('0x57')][_0x29f0('0x10c')](db['Team'],{'through':'team_has_openchannel_queues','as':_0x29f0('0x145')});db[_0x29f0('0x58')][_0x29f0('0xfa')](db['Disposition'],{'as':_0x29f0('0x152'),'foreignKey':_0x29f0('0x17a')});db['ChatWebsite'][_0x29f0('0xfa')](db[_0x29f0('0x6c')],{'as':_0x29f0('0x153'),'foreignKey':_0x29f0('0x17a')});db[_0x29f0('0x58')][_0x29f0('0xfa')](db[_0x29f0('0x5c')],{'as':_0x29f0('0x17b')});db[_0x29f0('0x58')][_0x29f0('0xfa')](db['ChatInteraction'],{'as':_0x29f0('0x154')});db[_0x29f0('0x58')][_0x29f0('0xfa')](db[_0x29f0('0x59')],{'as':_0x29f0('0x133')});db[_0x29f0('0x58')][_0x29f0('0xfa')](db[_0x29f0('0x17c')],{'as':_0x29f0('0x148')});db[_0x29f0('0x58')][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':'List','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x58')][_0x29f0('0x10b')](db[_0x29f0('0x72')],{'as':_0x29f0('0x72'),'foreignKey':_0x29f0('0x13f')});db[_0x29f0('0x58')][_0x29f0('0x10b')](db[_0x29f0('0x140')],{'as':_0x29f0('0x141'),'foreignKey':_0x29f0('0x142')});db['ChatWebsite'][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':'Agents','through':_0x29f0('0x128')});db[_0x29f0('0x17d')][_0x29f0('0x10b')](db[_0x29f0('0x50')],{});db['OpenchannelQueueReport'][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x17d')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelInteraction'],{});db[_0x29f0('0x17d')][_0x29f0('0x10b')](db[_0x29f0('0x55')],{});db[_0x29f0('0x17d')][_0x29f0('0x10b')](db['User'],{});db['OpenchannelQueueReport'][_0x29f0('0x10b')](db[_0x29f0('0x57')],{});db['ChatApplication'][_0x29f0('0x10b')](db['User'],{'as':'Agent','foreignKey':_0x29f0('0xf9'),'onDelete':_0x29f0('0x161')});db['ChatApplication'][_0x29f0('0x10b')](db[_0x29f0('0x11f')],{'as':_0x29f0('0x17e'),'foreignKey':_0x29f0('0x17f'),'onDelete':_0x29f0('0x161')});db['ChatApplication'][_0x29f0('0x10b')](db[_0x29f0('0x58')],{'as':_0x29f0('0x180'),'foreignKey':_0x29f0('0x17a'),'onDelete':_0x29f0('0x161')});db[_0x29f0('0x59')]['belongsTo'](db['Tag'],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x162')});db[_0x29f0('0x103')][_0x29f0('0xfa')](db[_0x29f0('0x17c')],{'as':_0x29f0('0x148'),'onDelete':'cascade','foreignKey':_0x29f0('0x181')});db[_0x29f0('0x103')][_0x29f0('0x10b')](db[_0x29f0('0x58')],{'as':'Account','foreignKey':_0x29f0('0x17a')});db['ChatInteraction'][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x29f0('0x103')]['belongsTo'](db[_0x29f0('0xe')],{'as':_0x29f0('0x168'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0x103')][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x182'),'as':_0x29f0('0x15d')});db[_0x29f0('0x103')][_0x29f0('0x10c')](db['Tag'],{'through':_0x29f0('0x182'),'as':_0x29f0('0x15e')});db[_0x29f0('0x103')][_0x29f0('0x10c')](db['User'],{'as':'Users','through':_0x29f0('0x117'),'foreignKey':'ChatInteractionId'});db[_0x29f0('0x17c')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'onDelete':_0x29f0('0xf8'),'as':'User'});db[_0x29f0('0x17c')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x17c')][_0x29f0('0x10b')](db['ChatInteraction'],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0x16b'),'foreignKey':_0x29f0('0x181')});db['ChatMessage'][_0x29f0('0x10b')](db['Attachment'],{'as':_0x29f0('0xdb'),'foreignKey':_0x29f0('0x16c')});db[_0x29f0('0x17c')][_0x29f0('0x10b')](db[_0x29f0('0x58')],{'as':_0x29f0('0x15b'),'foreignKey':'ChatWebsiteId'});db[_0x29f0('0x183')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x29f0('0x183')][_0x29f0('0x10b')](db[_0x29f0('0x58')],{'as':'Account','foreignKey':_0x29f0('0x17a')});db[_0x29f0('0x11f')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x29f0('0x10c')](db[_0x29f0('0xd7')],{'through':_0x29f0('0x184'),'as':_0x29f0('0x145')});db[_0x29f0('0x5b')][_0x29f0('0xfa')](db[_0x29f0('0xbf')],{'as':_0x29f0('0x148'),'foreignKey':_0x29f0('0x185'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x5b')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':'Members','through':'chat_group_has_users'});db['ChatProactiveAction']['belongsTo'](db[_0x29f0('0x58')],{'as':_0x29f0('0x180'),'foreignKey':'ChatWebsiteId'});db[_0x29f0('0x5e')][_0x29f0('0xfa')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x10f'),'foreignKey':_0x29f0('0x186')});db['CmContact'][_0x29f0('0xfa')](db[_0x29f0('0x138')],{'as':_0x29f0('0x187'),'foreignKey':'ContactId'});db['CmContact'][_0x29f0('0xfa')](db[_0x29f0('0x64')],{'as':_0x29f0('0xff'),'foreignKey':'ContactId'});db[_0x29f0('0x10e')]['hasMany'](db[_0x29f0('0x100')],{'as':'HopperHistories','foreignKey':_0x29f0('0x14e')});db['CmContact'][_0x29f0('0xfa')](db[_0x29f0('0x66')],{'as':'ReportAgentPreview','foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x10e')]['hasMany'](db['JscriptySessionReport'],{'as':_0x29f0('0x13a'),'foreignKey':'ContactId'});db['CmContact'][_0x29f0('0xfa')](db[_0x29f0('0x53')],{'as':_0x29f0('0x102'),'foreignKey':'ContactId','onDelete':_0x29f0('0x161')});db[_0x29f0('0x10e')][_0x29f0('0xfa')](db[_0x29f0('0x103')],{'as':_0x29f0('0x104'),'foreignKey':_0x29f0('0x14e'),'onDelete':'restrict'});db['CmContact'][_0x29f0('0xfa')](db[_0x29f0('0x105')],{'as':_0x29f0('0x106'),'foreignKey':_0x29f0('0x14e'),'onDelete':_0x29f0('0x161')});db[_0x29f0('0x10e')][_0x29f0('0xfa')](db['FaxInteraction'],{'as':_0x29f0('0x107'),'foreignKey':_0x29f0('0x14e'),'onDelete':_0x29f0('0x161')});db[_0x29f0('0x10e')]['hasMany'](db[_0x29f0('0x3b')],{'as':'MailInteractions','foreignKey':_0x29f0('0x14e'),'onDelete':_0x29f0('0x161')});db['CmContact'][_0x29f0('0x10b')](db[_0x29f0('0x5e')],{'as':_0x29f0('0x188'),'foreignKey':'CompanyId'});db[_0x29f0('0x10e')][_0x29f0('0x10b')](db['CmList'],{'as':'List','foreignKey':_0x29f0('0x156'),'onDelete':'cascade'});db[_0x29f0('0x10e')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x15f'),'through':_0x29f0('0x110')});db[_0x29f0('0x10e')][_0x29f0('0x10c')](db['Tag'],{'as':_0x29f0('0x15d'),'through':_0x29f0('0x189')});db[_0x29f0('0x10e')]['belongsToMany'](db[_0x29f0('0x7a')],{'through':'cm_contact_has_tags','as':_0x29f0('0x15e')});db[_0x29f0('0x138')]['belongsTo'](db['CmContact'],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x138')][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x138')]['belongsTo'](db['User'],{'as':_0x29f0('0x18a'),'foreignKey':_0x29f0('0xf9')});db[_0x29f0('0x138')][_0x29f0('0x10b')](db['VoiceQueue'],{'as':_0x29f0('0x17e'),'foreignKey':'VoiceQueueId','onDelete':_0x29f0('0xf8')});db['CmHopper'][_0x29f0('0x10b')](db[_0x29f0('0xd9')],{'as':_0x29f0('0xd9'),'foreignKey':_0x29f0('0x18b'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x138')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':'Owner','foreignKey':_0x29f0('0x18c')});db[_0x29f0('0x62')][_0x29f0('0x10b')](db['CmContact'],{'as':_0x29f0('0x14d'),'foreignKey':'ContactId','onDelete':_0x29f0('0xf8')});db[_0x29f0('0x62')][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x62')][_0x29f0('0x10b')](db[_0x29f0('0x11c')],{'as':_0x29f0('0x17e'),'foreignKey':_0x29f0('0x137'),'onDelete':'cascade'});db[_0x29f0('0x62')]['belongsTo'](db[_0x29f0('0xd9')],{'as':_0x29f0('0xd9'),'foreignKey':_0x29f0('0x18b'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x6a')][_0x29f0('0xfa')](db[_0x29f0('0x70')],{'as':{'plural':_0x29f0('0x18d'),'singular':_0x29f0('0x18e')},'foreignKey':_0x29f0('0x18f'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x29f0('0xfa')](db[_0x29f0('0x70')],{'as':{'plural':_0x29f0('0x190'),'singular':'OneAny'},'foreignKey':_0x29f0('0x191'),'onDelete':'cascade','hooks':!![]});db[_0x29f0('0x6a')]['hasMany'](db[_0x29f0('0x69')],{'as':'Actions','foreignKey':_0x29f0('0x192'),'onDelete':_0x29f0('0xf8'),'hooks':!![]});db[_0x29f0('0x72')][_0x29f0('0xfa')](db['Interval'],{'as':_0x29f0('0x193'),'foreignKey':_0x29f0('0x13f'),'onDelete':_0x29f0('0xf8'),'hooks':!![],'required':![]});db['Interval'][_0x29f0('0xfa')](db[_0x29f0('0x12')],{'as':'Extensions','foreignKey':_0x29f0('0x13f'),'onDelete':_0x29f0('0x161')});db[_0x29f0('0x72')][_0x29f0('0xfa')](db[_0x29f0('0x3e')],{'as':_0x29f0('0x194'),'foreignKey':_0x29f0('0x13f')});db[_0x29f0('0x72')][_0x29f0('0xfa')](db[_0x29f0('0x59')],{'as':_0x29f0('0x195'),'foreignKey':_0x29f0('0x13f')});db[_0x29f0('0x72')][_0x29f0('0xfa')](db[_0x29f0('0x44')],{'as':_0x29f0('0x196'),'foreignKey':_0x29f0('0x13f')});db[_0x29f0('0x72')][_0x29f0('0xfa')](db[_0x29f0('0x172')],{'as':_0x29f0('0x197'),'foreignKey':'IntervalId'});db['Schedule'][_0x29f0('0x10b')](db[_0x29f0('0x37')],{});db[_0x29f0('0x77')][_0x29f0('0x10b')](db[_0x29f0('0x84')],{'foreignKey':_0x29f0('0x198')});db[_0x29f0('0x77')][_0x29f0('0x10b')](db[_0x29f0('0x82')],{'foreignKey':_0x29f0('0x199')});db[_0x29f0('0x134')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x29f0('0x135'),'onDelete':_0x29f0('0x161')});db['Tag'][_0x29f0('0x10c')](db[_0x29f0('0x10e')],{'through':_0x29f0('0x189')});db[_0x29f0('0x7a')][_0x29f0('0x10c')](db[_0x29f0('0x103')],{'through':'chat_interaction_has_tags'});db[_0x29f0('0x7a')]['belongsToMany'](db[_0x29f0('0x3b')],{'through':_0x29f0('0x15c')});db[_0x29f0('0x7a')][_0x29f0('0x10c')](db[_0x29f0('0x105')],{'through':_0x29f0('0x174')});db[_0x29f0('0x7a')]['belongsToMany'](db[_0x29f0('0x45')],{'through':_0x29f0('0x169')});db['Tag']['belongsToMany'](db[_0x29f0('0x53')],{'through':_0x29f0('0x19a')});db[_0x29f0('0x7a')][_0x29f0('0x10c')](db['WhatsappInteraction'],{'through':_0x29f0('0x19b')});db[_0x29f0('0x19c')][_0x29f0('0xfa')](db[_0x29f0('0x70')],{'as':{'plural':_0x29f0('0x19d'),'singular':_0x29f0('0x19e')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x29f0('0x19c')]['hasMany'](db['Condition'],{'as':{'plural':_0x29f0('0x19f'),'singular':'AnyCondition'},'foreignKey':_0x29f0('0x1a0'),'onDelete':_0x29f0('0xf8'),'hooks':!![]});db['Trigger'][_0x29f0('0xfa')](db[_0x29f0('0x69')],{'as':_0x29f0('0x1a1'),'foreignKey':_0x29f0('0x1a2'),'onDelete':_0x29f0('0xf8'),'hooks':!![]});db[_0x29f0('0x82')][_0x29f0('0xfa')](db[_0x29f0('0x89')],{'as':_0x29f0('0x1a3'),'onDelete':'cascade','foreignKey':_0x29f0('0x199'),'hooks':!![]});db[_0x29f0('0x84')][_0x29f0('0xfa')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x29f0('0xf8'),'foreignKey':'DefaultReportId'});db[_0x29f0('0x87')]['hasMany'](db[_0x29f0('0x89')],{'as':_0x29f0('0x1a3'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a4')});db[_0x29f0('0x89')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':_0x29f0('0x1a4')});db['SalesforceAccount']['hasMany'](db[_0x29f0('0x8e')],{'as':_0x29f0('0x1a5'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x29f0('0x8e')][_0x29f0('0xfa')](db['SalesforceField'],{'as':_0x29f0('0x1a6'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x8e')][_0x29f0('0xfa')](db[_0x29f0('0x8f')],{'as':_0x29f0('0x1a8'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x29f0('0x8e')]['hasMany'](db[_0x29f0('0x8f')],{'as':_0x29f0('0x1a3'),'onDelete':_0x29f0('0xf8'),'foreignKey':'FieldId'});db['SalesforceConfiguration']['belongsTo'](db[_0x29f0('0x8c')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0x8f')][_0x29f0('0xfa')](db[_0x29f0('0x8f')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x29f0('0x8f')][_0x29f0('0xfa')](db[_0x29f0('0x8f')],{'as':_0x29f0('0x1aa'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x8f')][_0x29f0('0xfa')](db[_0x29f0('0x8f')],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db['SalesforceField'][_0x29f0('0x10b')](db[_0x29f0('0x7d')],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db[_0x29f0('0x91')][_0x29f0('0xfa')](db[_0x29f0('0x93')],{'as':_0x29f0('0x1a5'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0x93')]['hasMany'](db[_0x29f0('0x95')],{'as':_0x29f0('0x1a6'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x93')][_0x29f0('0xfa')](db[_0x29f0('0x95')],{'as':_0x29f0('0x1a8'),'onDelete':'cascade','foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x93')][_0x29f0('0xfa')](db[_0x29f0('0x95')],{'as':_0x29f0('0x1a3'),'onDelete':'cascade','foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0x93')][_0x29f0('0x10b')](db['SugarcrmAccount'],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0x95')][_0x29f0('0xfa')](db[_0x29f0('0x95')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x29f0('0x95')][_0x29f0('0xfa')](db[_0x29f0('0x95')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x29f0('0x95')][_0x29f0('0xfa')](db['SugarcrmField'],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db['SugarcrmField']['belongsTo'](db['Variable'],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db['DeskAccount'][_0x29f0('0xfa')](db[_0x29f0('0x99')],{'as':_0x29f0('0x1a5'),'onDelete':_0x29f0('0xf8'),'foreignKey':'AccountId'});db[_0x29f0('0x99')]['hasMany'](db[_0x29f0('0x9b')],{'as':_0x29f0('0x1a6'),'onDelete':'cascade','foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x99')]['hasMany'](db[_0x29f0('0x9b')],{'as':_0x29f0('0x1a8'),'onDelete':'cascade','foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x99')][_0x29f0('0xfa')](db[_0x29f0('0x9b')],{'as':'Fields','onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0x99')][_0x29f0('0x10b')](db[_0x29f0('0x97')],{'as':_0x29f0('0x15b'),'foreignKey':'AccountId'});db[_0x29f0('0x99')][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x1af')});db['DeskField'][_0x29f0('0xfa')](db['DeskField'],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x9b')][_0x29f0('0xfa')](db['DeskField'],{'as':_0x29f0('0x1aa'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x9b')]['hasMany'](db['DeskField'],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0x9b')]['belongsTo'](db[_0x29f0('0x7d')],{'as':_0x29f0('0x7d'),'foreignKey':'VariableId'});db[_0x29f0('0x9d')][_0x29f0('0xfa')](db[_0x29f0('0x9f')],{'as':_0x29f0('0x1a5'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0x9f')][_0x29f0('0xfa')](db[_0x29f0('0xa0')],{'as':_0x29f0('0x1a6'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x9f')]['hasMany'](db[_0x29f0('0xa0')],{'as':_0x29f0('0x1a8'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x9f')][_0x29f0('0xfa')](db[_0x29f0('0xa0')],{'as':_0x29f0('0x1a3'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0x9f')][_0x29f0('0x10b')](db[_0x29f0('0x9d')],{'as':'Account','foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xa0')][_0x29f0('0xfa')](db[_0x29f0('0xa0')],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db['ZohoField'][_0x29f0('0xfa')](db[_0x29f0('0xa0')],{'as':_0x29f0('0x1aa'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0xa0')][_0x29f0('0xfa')](db[_0x29f0('0xa0')],{'as':'Field','foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0xa0')][_0x29f0('0x10b')](db['Variable'],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db[_0x29f0('0xa2')][_0x29f0('0xfa')](db[_0x29f0('0xa4')],{'as':_0x29f0('0x1a5'),'onDelete':'cascade','foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xa4')][_0x29f0('0xfa')](db[_0x29f0('0xa6')],{'as':_0x29f0('0x1a6'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xa4')][_0x29f0('0xfa')](db['ZendeskField'],{'as':'Descriptions','foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x29f0('0xfa')](db[_0x29f0('0xa6')],{'as':_0x29f0('0x1a3'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0xa4')][_0x29f0('0x10b')](db[_0x29f0('0xa2')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xa4')][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x1b1')});db['ZendeskField'][_0x29f0('0xfa')](db[_0x29f0('0xa6')],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xa6')][_0x29f0('0xfa')](db[_0x29f0('0xa6')],{'as':_0x29f0('0x1aa'),'foreignKey':'DescriptionId'});db[_0x29f0('0xa6')][_0x29f0('0xfa')](db['ZendeskField'],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db[_0x29f0('0x7d')],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db[_0x29f0('0xa8')][_0x29f0('0xfa')](db[_0x29f0('0x1b2')],{'as':_0x29f0('0x1a5'),'onDelete':'cascade','foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0x1b2')][_0x29f0('0xfa')](db['FreshdeskField'],{'as':_0x29f0('0x1a6'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x1b2')][_0x29f0('0xfa')](db['FreshdeskField'],{'as':_0x29f0('0x1a8'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x1b2')][_0x29f0('0xfa')](db[_0x29f0('0x1b3')],{'as':_0x29f0('0x1a3'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1ad')});db['FreshdeskConfiguration'][_0x29f0('0x10b')](db['FreshdeskAccount'],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db['FreshdeskConfiguration'][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':_0x29f0('0x1b4')});db[_0x29f0('0x1b3')][_0x29f0('0xfa')](db[_0x29f0('0x1b3')],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x1b3')][_0x29f0('0xfa')](db[_0x29f0('0x1b3')],{'as':_0x29f0('0x1aa'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x1b3')]['hasMany'](db[_0x29f0('0x1b3')],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db['FreshdeskField']['belongsTo'](db['Variable'],{'as':_0x29f0('0x7d'),'foreignKey':'VariableId'});db[_0x29f0('0xab')][_0x29f0('0xfa')](db[_0x29f0('0xad')],{'as':_0x29f0('0x1a5'),'onDelete':'cascade','foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xad')][_0x29f0('0xfa')](db[_0x29f0('0xaf')],{'as':_0x29f0('0x1a6'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xad')][_0x29f0('0xfa')](db[_0x29f0('0xaf')],{'as':'Descriptions','foreignKey':_0x29f0('0x1ab')});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0x29f0('0x1a3'),'foreignKey':'FieldId'});db['VtigerConfiguration'][_0x29f0('0x10b')](db[_0x29f0('0xab')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xaf')]['hasMany'](db[_0x29f0('0xaf')],{'as':_0x29f0('0x1b0'),'foreignKey':'SubjectId'});db[_0x29f0('0xaf')][_0x29f0('0xfa')](db[_0x29f0('0xaf')],{'as':_0x29f0('0x1aa'),'foreignKey':'DescriptionId'});db[_0x29f0('0xaf')][_0x29f0('0xfa')](db[_0x29f0('0xaf')],{'as':'Field','foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0xaf')][_0x29f0('0x10b')](db[_0x29f0('0x7d')],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount'][_0x29f0('0xfa')](db[_0x29f0('0xb2')],{'as':'Configurations','onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a9')});db['ServicenowConfiguration']['hasMany'](db[_0x29f0('0xb3')],{'as':_0x29f0('0x1a6'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xb2')][_0x29f0('0xfa')](db[_0x29f0('0xb3')],{'as':'Descriptions','foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0xb2')][_0x29f0('0xfa')](db[_0x29f0('0xb3')],{'as':_0x29f0('0x1a3'),'foreignKey':'FieldId'});db[_0x29f0('0xb2')][_0x29f0('0x10b')](db[_0x29f0('0x1b5')],{'as':'Account','foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xb3')]['hasMany'](db['ServicenowField'],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xb3')][_0x29f0('0xfa')](db[_0x29f0('0xb3')],{'as':_0x29f0('0x1aa'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0xb3')][_0x29f0('0xfa')](db[_0x29f0('0xb3')],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0xb3')][_0x29f0('0x10b')](db[_0x29f0('0x7d')],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db[_0x29f0('0x1b6')]['hasMany'](db[_0x29f0('0x1b7')],{'as':_0x29f0('0x1a5'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0x1b7')]['hasMany'](db[_0x29f0('0xb7')],{'as':_0x29f0('0x1a6'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x1b7')][_0x29f0('0xfa')](db['Dynamics365Field'],{'as':_0x29f0('0x1a8'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x1b7')][_0x29f0('0xfa')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x29f0('0xf8'),'foreignKey':'FieldId'});db[_0x29f0('0x1b7')][_0x29f0('0x10b')](db['Dynamics365Account'],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xb7')][_0x29f0('0xfa')](db[_0x29f0('0xb7')],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xb7')][_0x29f0('0xfa')](db[_0x29f0('0xb7')],{'as':_0x29f0('0x1aa'),'foreignKey':'DescriptionId'});db[_0x29f0('0xb7')][_0x29f0('0xfa')](db['Dynamics365Field'],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0xb7')][_0x29f0('0x10b')](db[_0x29f0('0x7d')],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db[_0x29f0('0xb9')]['hasMany'](db['FreshsalesConfiguration'],{'as':_0x29f0('0x1a5'),'onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x1a9')});db[_0x29f0('0xbb')][_0x29f0('0xfa')](db[_0x29f0('0x1b8')],{'as':_0x29f0('0x1a6'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0xbb')][_0x29f0('0xfa')](db['FreshsalesField'],{'as':_0x29f0('0x1a8'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db[_0x29f0('0x1b8')],{'as':'Fields','foreignKey':'FieldId'});db[_0x29f0('0xbb')][_0x29f0('0x10b')](db['FreshsalesAccount'],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1a9')});db['FreshsalesField'][_0x29f0('0xfa')](db[_0x29f0('0x1b8')],{'as':_0x29f0('0x1b0'),'foreignKey':_0x29f0('0x1a7')});db[_0x29f0('0x1b8')][_0x29f0('0xfa')](db['FreshsalesField'],{'as':_0x29f0('0x1aa'),'foreignKey':_0x29f0('0x1ab')});db[_0x29f0('0x1b8')][_0x29f0('0xfa')](db[_0x29f0('0x1b8')],{'as':_0x29f0('0x1ac'),'foreignKey':_0x29f0('0x1ad')});db[_0x29f0('0x1b8')]['belongsTo'](db[_0x29f0('0x7d')],{'as':_0x29f0('0x7d'),'foreignKey':_0x29f0('0x1ae')});db[_0x29f0('0x1b9')][_0x29f0('0x10b')](db[_0x29f0('0x58')],{});db['ChatQueueReport']['belongsTo'](db[_0x29f0('0x111')],{'as':'List','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x1b9')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':'Contact','foreignKey':'ContactId'});db[_0x29f0('0x1b9')]['belongsTo'](db[_0x29f0('0x103')],{});db[_0x29f0('0x1b9')][_0x29f0('0x10b')](db[_0x29f0('0x17c')],{});db[_0x29f0('0x1b9')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{});db['ChatQueueReport']['belongsTo'](db[_0x29f0('0x11f')],{});db[_0x29f0('0xbf')]['belongsTo'](db[_0x29f0('0xe')],{'onDelete':_0x29f0('0xf8'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'onDelete':'cascade','foreignKey':_0x29f0('0x1ba')});db['JscriptySessionReport']['hasMany'](db[_0x29f0('0x1bb')],{'foreignKey':_0x29f0('0x1bc'),'onDelete':_0x29f0('0xf8')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0x29f0('0xc6')][_0x29f0('0x10b')](db[_0x29f0('0x16f')],{});db['SmsQueueReport']['belongsTo'](db[_0x29f0('0x111')],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0xc6')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':'Contact','foreignKey':_0x29f0('0x14e')});db[_0x29f0('0xc6')][_0x29f0('0x10b')](db['SmsInteraction'],{});db[_0x29f0('0xc6')][_0x29f0('0x10b')](db[_0x29f0('0x170')],{});db[_0x29f0('0xc6')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{});db[_0x29f0('0xc6')][_0x29f0('0x10b')](db[_0x29f0('0x4f')],{});db[_0x29f0('0xcb')]['hasMany'](db[_0x29f0('0xc4')],{'foreignKey':_0x29f0('0x1bd')});db['JscriptyProject'][_0x29f0('0xfa')](db[_0x29f0('0x1bb')],{'foreignKey':_0x29f0('0x1bd')});db[_0x29f0('0xcb')][_0x29f0('0xfa')](db[_0x29f0('0xc1')],{'foreignKey':_0x29f0('0x1bd')});db[_0x29f0('0xd1')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x15f'),'through':_0x29f0('0x131')});db[_0x29f0('0xd7')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x114')});db[_0x29f0('0xd7')][_0x29f0('0x10c')](db['VoiceQueue'],{'through':_0x29f0('0x1be'),'as':_0x29f0('0x11d')});db['Team']['belongsToMany'](db[_0x29f0('0x38')],{'through':'team_has_mail_queues','as':_0x29f0('0x11e')});db[_0x29f0('0xd7')][_0x29f0('0x10c')](db['ChatQueue'],{'through':_0x29f0('0x184'),'as':_0x29f0('0x120')});db[_0x29f0('0xd7')][_0x29f0('0x10c')](db['FaxQueue'],{'through':_0x29f0('0x16e'),'as':'FaxQueues'});db['Team'][_0x29f0('0x10c')](db[_0x29f0('0x4f')],{'through':_0x29f0('0x176'),'as':_0x29f0('0x122')});db[_0x29f0('0xd7')]['belongsToMany'](db['OpenchannelQueue'],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x29f0('0xd7')][_0x29f0('0x10c')](db[_0x29f0('0x124')],{'through':_0x29f0('0x1bf'),'as':_0x29f0('0x1c0')});db['Campaign'][_0x29f0('0xfa')](db['CmHopper'],{'as':_0x29f0('0x187'),'foreignKey':_0x29f0('0x18b')});db[_0x29f0('0xd9')][_0x29f0('0xfa')](db[_0x29f0('0x64')],{'as':_0x29f0('0xff'),'foreignKey':_0x29f0('0x18b')});db[_0x29f0('0xd9')][_0x29f0('0xfa')](db[_0x29f0('0x100')],{'as':_0x29f0('0x139'),'foreignKey':_0x29f0('0x18b')});db[_0x29f0('0xd9')]['hasMany'](db['CmHopperBlack'],{'as':_0x29f0('0x1c1'),'foreignKey':'CampaignId'});db[_0x29f0('0xd9')]['belongsTo'](db[_0x29f0('0x13b')],{'as':'Trunk','foreignKey':_0x29f0('0x13c')});db[_0x29f0('0xd9')][_0x29f0('0x10b')](db[_0x29f0('0x13b')],{'as':_0x29f0('0x13d'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0x29f0('0x10b')](db[_0x29f0('0x72')],{'as':_0x29f0('0x72'),'foreignKey':_0x29f0('0x13f')});db['Campaign'][_0x29f0('0x10b')](db[_0x29f0('0xd1')],{'as':_0x29f0('0xd1'),'foreignKey':'SquareProjectId'});db[_0x29f0('0xd9')][_0x29f0('0x10c')](db[_0x29f0('0x111')],{'as':'Lists','through':_0x29f0('0x1c2')});db[_0x29f0('0xd9')][_0x29f0('0x10c')](db['CmList'],{'as':_0x29f0('0x146'),'through':_0x29f0('0x1c3')});db[_0x29f0('0xde')][_0x29f0('0x10b')](db[_0x29f0('0x3d')],{});db['MailTransferReport'][_0x29f0('0x10b')](db['MailInteraction'],{});db[_0x29f0('0xde')][_0x29f0('0x10b')](db['MailAccount'],{'foreignKey':'FromMailAccountId','as':_0x29f0('0x1c4')});db[_0x29f0('0xde')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':_0x29f0('0x1c5'),'as':'FromAgent'});db['MailTransferReport']['belongsTo'](db[_0x29f0('0xe')],{'foreignKey':'ToUserId','as':_0x29f0('0x1c6')});db['MailTransferReport']['belongsTo'](db[_0x29f0('0x38')],{'foreignKey':_0x29f0('0x1c7'),'as':_0x29f0('0x1c8')});db['MailTransferReport']['belongsTo'](db[_0x29f0('0x37')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0x29f0('0xe0')][_0x29f0('0x10b')](db[_0x29f0('0x103')],{});db['ChatTransferReport'][_0x29f0('0x10b')](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x29f0('0x1c4')});db['ChatTransferReport'][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':_0x29f0('0x1c5'),'as':_0x29f0('0x1c9')});db[_0x29f0('0xe0')]['belongsTo'](db[_0x29f0('0xe')],{'foreignKey':_0x29f0('0x1ca'),'as':_0x29f0('0x1c6')});db[_0x29f0('0xe0')][_0x29f0('0x10b')](db[_0x29f0('0x11f')],{'foreignKey':_0x29f0('0x1cb'),'as':_0x29f0('0x1c8')});db[_0x29f0('0xe0')][_0x29f0('0x10b')](db[_0x29f0('0x58')],{'foreignKey':'ToChatWebsiteId','as':_0x29f0('0x1cc')});db['FaxTransferReport'][_0x29f0('0x10b')](db[_0x29f0('0x47')],{});db[_0x29f0('0xe2')]['belongsTo'](db[_0x29f0('0x45')],{});db[_0x29f0('0xe2')][_0x29f0('0x10b')](db[_0x29f0('0x43')],{'foreignKey':_0x29f0('0x1cd'),'as':_0x29f0('0x1c4')});db[_0x29f0('0xe2')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':_0x29f0('0x1c5'),'as':_0x29f0('0x1c9')});db[_0x29f0('0xe2')]['belongsTo'](db[_0x29f0('0xe')],{'foreignKey':_0x29f0('0x1ca'),'as':_0x29f0('0x1c6')});db['FaxTransferReport'][_0x29f0('0x10b')](db[_0x29f0('0x49')],{'foreignKey':'ToFaxQueueId','as':_0x29f0('0x1c8')});db[_0x29f0('0xe2')]['belongsTo'](db[_0x29f0('0x43')],{'foreignKey':_0x29f0('0x1ce'),'as':_0x29f0('0x1cc')});db[_0x29f0('0xe3')][_0x29f0('0x10b')](db[_0x29f0('0x55')],{});db[_0x29f0('0xe3')][_0x29f0('0x10b')](db[_0x29f0('0x53')],{});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0x29f0('0x1cf'),'as':_0x29f0('0x1c4')});db[_0x29f0('0xe3')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':_0x29f0('0x1c5'),'as':_0x29f0('0x1c9')});db[_0x29f0('0xe3')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport'][_0x29f0('0x10b')](db['OpenchannelQueue'],{'foreignKey':_0x29f0('0x1d0'),'as':_0x29f0('0x1c8')});db[_0x29f0('0xe3')]['belongsTo'](db[_0x29f0('0x50')],{'foreignKey':_0x29f0('0x1d1'),'as':'ToAccount'});db[_0x29f0('0xe4')]['belongsTo'](db[_0x29f0('0x170')],{});db[_0x29f0('0xe4')][_0x29f0('0x10b')](db[_0x29f0('0x105')],{});db[_0x29f0('0xe4')][_0x29f0('0x10b')](db[_0x29f0('0x16f')],{'foreignKey':_0x29f0('0x1d2'),'as':'FromAccount'});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x29f0('0x1c5'),'as':_0x29f0('0x1c9')});db[_0x29f0('0xe4')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':'ToUserId','as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db[_0x29f0('0x4f')],{'foreignKey':_0x29f0('0x1d3'),'as':_0x29f0('0x1c8')});db['SmsTransferReport'][_0x29f0('0x10b')](db[_0x29f0('0x16f')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0x29f0('0x111')][_0x29f0('0xfa')](db['Disposition'],{'as':_0x29f0('0x152'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x111')]['hasMany'](db['CmCustomField'],{'as':'CustomFields','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x111')][_0x29f0('0xfa')](db['CmContact'],{'as':'Contacts','onDelete':_0x29f0('0xf8'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x111')][_0x29f0('0xfa')](db[_0x29f0('0x64')],{'as':_0x29f0('0xff'),'foreignKey':_0x29f0('0x156')});db['CmList'][_0x29f0('0xfa')](db['CmHopperHistory'],{'as':_0x29f0('0x101'),'foreignKey':_0x29f0('0x156')});db['CmList'][_0x29f0('0xfa')](db[_0x29f0('0x66')],{'as':_0x29f0('0x66'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x111')][_0x29f0('0x10c')](db[_0x29f0('0x11c')],{'as':'Queues','through':_0x29f0('0x143')});db[_0x29f0('0x111')][_0x29f0('0x10c')](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x113')});db[_0x29f0('0xe7')][_0x29f0('0xfa')](db[_0x29f0('0x12')],{'as':_0x29f0('0x1d4'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0xe7')][_0x29f0('0x10c')](db['User'],{'as':_0x29f0('0x144'),'through':_0x29f0('0x126')});db[_0x29f0('0xe9')][_0x29f0('0xfa')](db[_0x29f0('0xe')],{'as':_0x29f0('0x15f'),'foreignKey':_0x29f0('0x1d5')});db[_0x29f0('0xe9')][_0x29f0('0xfa')](db[_0x29f0('0x1d6')],{'as':_0x29f0('0x1d7'),'foreignKey':_0x29f0('0x1d5'),'onDelete':_0x29f0('0xf8')});db[_0x29f0('0x1d6')][_0x29f0('0xfa')](db[_0x29f0('0x1d8')],{'as':_0x29f0('0x1d9'),'foreignKey':_0x29f0('0x1da'),'onDelete':'cascade'});db[_0x29f0('0x1db')][_0x29f0('0xfa')](db[_0x29f0('0x6e')],{'as':_0x29f0('0x152'),'foreignKey':'WhatsappAccountId'});db[_0x29f0('0x1db')][_0x29f0('0xfa')](db[_0x29f0('0x6c')],{'as':_0x29f0('0x153'),'foreignKey':_0x29f0('0x1dc')});db[_0x29f0('0x1db')][_0x29f0('0xfa')](db[_0x29f0('0xf2')],{'as':_0x29f0('0x148'),'foreignKey':_0x29f0('0x1dc')});db[_0x29f0('0x1db')][_0x29f0('0xfa')](db[_0x29f0('0xf1')],{'as':_0x29f0('0x154')});db[_0x29f0('0x1db')][_0x29f0('0xfa')](db[_0x29f0('0xef')],{'as':'Applications'});db['WhatsappAccount'][_0x29f0('0x10b')](db[_0x29f0('0x111')],{'as':'List','foreignKey':_0x29f0('0x156')});db[_0x29f0('0x1db')][_0x29f0('0x10b')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x29f0('0x142')});db[_0x29f0('0x1db')]['belongsToMany'](db['User'],{'as':_0x29f0('0x144'),'through':_0x29f0('0x1dd')});db[_0x29f0('0xef')]['belongsTo'](db[_0x29f0('0xe')],{'onDelete':_0x29f0('0x161')});db['WhatsappApplication'][_0x29f0('0x10b')](db[_0x29f0('0x124')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x29f0('0x1db')],{'onDelete':_0x29f0('0x161')});db['WhatsappApplication'][_0x29f0('0x10b')](db[_0x29f0('0x72')],{'onDelete':'restrict','foreignKey':_0x29f0('0x13f')});db[_0x29f0('0xef')]['belongsTo'](db[_0x29f0('0x7a')],{'onDelete':_0x29f0('0x161'),'foreignKey':_0x29f0('0x162')});db[_0x29f0('0xf1')][_0x29f0('0xfa')](db[_0x29f0('0xf2')],{'as':'Messages','onDelete':'cascade','foreignKey':'WhatsappInteractionId'});db[_0x29f0('0xf1')]['belongsTo'](db[_0x29f0('0x1db')],{'as':_0x29f0('0x15b'),'foreignKey':_0x29f0('0x1dc')});db[_0x29f0('0xf1')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0xf1')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':'Owner','foreignKey':'UserId'});db['WhatsappInteraction'][_0x29f0('0x10c')](db[_0x29f0('0x7a')],{'through':'whatsapp_interaction_has_tags','as':'Tags'});db['WhatsappInteraction']['belongsToMany'](db[_0x29f0('0x7a')],{'through':_0x29f0('0x19b'),'as':_0x29f0('0x15e')});db['WhatsappInteraction']['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x15f'),'through':'user_has_whatsapp_interactions','foreignKey':_0x29f0('0x1de')});db[_0x29f0('0xf2')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'as':_0x29f0('0xe')});db[_0x29f0('0xf2')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'onDelete':_0x29f0('0xf8'),'as':_0x29f0('0x14d')});db['WhatsappMessage'][_0x29f0('0x10b')](db[_0x29f0('0xf1')],{'onDelete':_0x29f0('0xf8'),'as':'Interaction','foreignKey':_0x29f0('0x1de')});db[_0x29f0('0xf2')][_0x29f0('0x10b')](db[_0x29f0('0x1db')],{'as':_0x29f0('0x15b'),'foreignKey':'WhatsappAccountId'});db[_0x29f0('0x1df')][_0x29f0('0x10b')](db[_0x29f0('0x1db')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x29f0('0x111')],{'as':_0x29f0('0x155'),'foreignKey':_0x29f0('0x156')});db[_0x29f0('0x1df')][_0x29f0('0x10b')](db[_0x29f0('0x10e')],{'as':_0x29f0('0x14d'),'foreignKey':_0x29f0('0x14e')});db[_0x29f0('0x1df')][_0x29f0('0x10b')](db['WhatsappInteraction'],{});db[_0x29f0('0x1df')][_0x29f0('0x10b')](db[_0x29f0('0x124')],{});db[_0x29f0('0x1df')][_0x29f0('0x10b')](db[_0x29f0('0xf2')],{});db['WhatsappQueueReport'][_0x29f0('0x10b')](db[_0x29f0('0xe')],{});db['WhatsappTransferReport'][_0x29f0('0x10b')](db[_0x29f0('0xf2')],{});db[_0x29f0('0xf4')][_0x29f0('0x10b')](db[_0x29f0('0xf1')],{});db[_0x29f0('0xf4')][_0x29f0('0x10b')](db[_0x29f0('0x1db')],{'foreignKey':_0x29f0('0x1e0'),'as':'FromAccount'});db[_0x29f0('0xf4')][_0x29f0('0x10b')](db[_0x29f0('0x1db')],{'foreignKey':_0x29f0('0x1e1'),'as':_0x29f0('0x1cc')});db[_0x29f0('0xf4')][_0x29f0('0x10b')](db[_0x29f0('0x124')],{'foreignKey':'ToQueueId','as':_0x29f0('0x1c8')});db[_0x29f0('0xf4')]['belongsTo'](db['User'],{'foreignKey':_0x29f0('0x1c5'),'as':_0x29f0('0x1c9')});db[_0x29f0('0xf4')][_0x29f0('0x10b')](db[_0x29f0('0xe')],{'foreignKey':'ToUserId','as':_0x29f0('0x1c6')});db[_0x29f0('0x124')]['belongsToMany'](db[_0x29f0('0xe')],{'as':_0x29f0('0x144'),'through':_0x29f0('0x33'),'foreignKey':'WhatsappQueueId'});db[_0x29f0('0x124')][_0x29f0('0x10c')](db[_0x29f0('0xd7')],{'through':'team_has_whatsapp_queues','as':_0x29f0('0x145')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index e70e157..ac71b41 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ef0=['get','sendFile','resolve','/index.html','path','express','express-winston','util','./errors','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','url','other','agent_id','agent_name','/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/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/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','/api/integrations/reports','./api/integrationReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./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/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfileSection','./api/notification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','static','/demo','/snippet','snippet','1.0.16','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x5ef0,0x119));var _0x05ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5ef0[_0x14add3];return _0x4a174f;};'use strict';var path=require(_0x05ef('0x0'));var express=require(_0x05ef('0x1'));var ewinston=require(_0x05ef('0x2'));var util=require(_0x05ef('0x3'));var errors=require(_0x05ef('0x4'));var config=require('./config/environment');var logger=require(_0x05ef('0x5'))('api');var authLogger=require('./config/logger')(_0x05ef('0x6'));exports[_0x05ef('0x7')]=function(_0x1da17c){_0x1da17c[_0x05ef('0x8')](ewinston[_0x05ef('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x95b99,_0x208b55){return util['format'](_0x05ef('0xa'),_0x95b99[_0x05ef('0xb')],_0x95b99['headers']['x-forwarded-for']?_0x95b99[_0x05ef('0xc')][_0x05ef('0xd')]:_0x95b99[_0x05ef('0xe')][_0x05ef('0xf')]||_0x95b99['ip'],_0x95b99['url'],_0x208b55['statusCode'],_0x208b55[_0x05ef('0x10')],_0x95b99[_0x05ef('0x11')]?_0x95b99['user']['id']:null,_0x95b99['user']?_0x95b99[_0x05ef('0x11')][_0x05ef('0x12')]:null,_0x95b99[_0x05ef('0x11')]?_0x95b99[_0x05ef('0x11')][_0x05ef('0x13')]:null);}}));_0x1da17c[_0x05ef('0x8')](ewinston[_0x05ef('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4365de,_0x2e0e57){var _0x3d616f=_0x05ef('0x14');if(_0x4365de[_0x05ef('0x15')]&&_0x4365de[_0x05ef('0x15')][_0x05ef('0x16')]&&_0x4365de['body']['agent_id']){_0x3d616f=_0x05ef('0x17');}return util[_0x05ef('0x18')](_0x3d616f,_0x4365de['method'],_0x4365de[_0x05ef('0xc')][_0x05ef('0xd')]?_0x4365de[_0x05ef('0xc')][_0x05ef('0xd')]:_0x4365de[_0x05ef('0xe')]['remoteAddress']||_0x4365de['ip'],_0x4365de[_0x05ef('0x19')],_0x2e0e57['statusCode'],_0x2e0e57[_0x05ef('0x10')],_0x4365de[_0x05ef('0x11')]?_0x4365de[_0x05ef('0x11')]['id']:null,_0x4365de[_0x05ef('0x11')]?_0x4365de[_0x05ef('0x11')][_0x05ef('0x12')]:null,_0x4365de[_0x05ef('0x11')]?_0x4365de['user']['role']:null,_0x4365de[_0x05ef('0x15')]&&_0x4365de[_0x05ef('0x15')][_0x05ef('0x16')]?_0x4365de['body'][_0x05ef('0x16')]:_0x05ef('0x1a'),_0x4365de[_0x05ef('0x15')]&&_0x4365de[_0x05ef('0x15')][_0x05ef('0x1b')]?_0x4365de[_0x05ef('0x15')][_0x05ef('0x1b')]:'',_0x4365de[_0x05ef('0x15')]&&_0x4365de[_0x05ef('0x15')][_0x05ef('0x1c')]?_0x4365de[_0x05ef('0x15')][_0x05ef('0x1c')]:'');},'ignoreRoute':function(_0x3bbec4){var _0x4dbbb8=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4dbbb8['test'](_0x3bbec4[_0x05ef('0x19')]);}}));_0x1da17c[_0x05ef('0x8')]('/api/users',require('./api/user'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x1d'),require('./api/voiceChanSpy'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x1e'),require(_0x05ef('0x1f')));_0x1da17c[_0x05ef('0x8')]('/api/voice/extensions',require(_0x05ef('0x20')));_0x1da17c['use'](_0x05ef('0x21'),require(_0x05ef('0x22')));_0x1da17c['use'](_0x05ef('0x23'),require(_0x05ef('0x24')));_0x1da17c['use'](_0x05ef('0x25'),require(_0x05ef('0x26')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x27'),require('./api/screenRecording'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x28'),require(_0x05ef('0x29')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x2a'),require(_0x05ef('0x2b')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x2c'),require('./api/voiceCallReport'));_0x1da17c['use'](_0x05ef('0x2d'),require(_0x05ef('0x2e')));_0x1da17c[_0x05ef('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x2f'),require('./api/voiceQueueReport'));_0x1da17c[_0x05ef('0x8')]('/api/members/reports',require(_0x05ef('0x30')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x31'),require(_0x05ef('0x32')));_0x1da17c['use'](_0x05ef('0x33'),require('./api/voiceTransferReport'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x34'),require(_0x05ef('0x35')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x36'),require(_0x05ef('0x37')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x38'),require(_0x05ef('0x39')));_0x1da17c[_0x05ef('0x8')]('/api/mail/substatuses',require('./api/mailSubstatus'));_0x1da17c['use'](_0x05ef('0x3a'),require(_0x05ef('0x3b')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x3c'),require(_0x05ef('0x3d')));_0x1da17c[_0x05ef('0x8')]('/api/mail/applications',require(_0x05ef('0x3e')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x3f'),require(_0x05ef('0x40')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x41'),require(_0x05ef('0x42')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x43'),require(_0x05ef('0x44')));_0x1da17c['use'](_0x05ef('0x45'),require('./api/faxAccount'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x46'),require(_0x05ef('0x47')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x48'),require(_0x05ef('0x49')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x4a'),require(_0x05ef('0x4b')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x4c'),require('./api/faxQueue'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x4d'),require(_0x05ef('0x4e')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x4f'),require(_0x05ef('0x50')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x51'),require('./api/smsApplication'));_0x1da17c[_0x05ef('0x8')]('/api/sms/interactions',require(_0x05ef('0x52')));_0x1da17c['use'](_0x05ef('0x53'),require(_0x05ef('0x54')));_0x1da17c[_0x05ef('0x8')]('/api/sms/queues',require(_0x05ef('0x55')));_0x1da17c['use']('/api/openchannel/accounts',require(_0x05ef('0x56')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x57'),require('./api/openchannelApplication'));_0x1da17c['use'](_0x05ef('0x58'),require('./api/openchannelInteraction'));_0x1da17c['use'](_0x05ef('0x59'),require(_0x05ef('0x5a')));_0x1da17c['use'](_0x05ef('0x5b'),require(_0x05ef('0x5c')));_0x1da17c['use'](_0x05ef('0x5d'),require('./api/chatWebsite'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x5e'),require(_0x05ef('0x5f')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x60'),require('./api/chatApplication'));_0x1da17c['use']('/api/chat/interactions',require(_0x05ef('0x61')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x62'),require(_0x05ef('0x63')));_0x1da17c[_0x05ef('0x8')]('/api/chat/offline_messages',require(_0x05ef('0x64')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x65'),require(_0x05ef('0x66')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x67'),require(_0x05ef('0x68')));_0x1da17c[_0x05ef('0x8')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x69'),require(_0x05ef('0x6a')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x6b'),require(_0x05ef('0x6c')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x6d'),require(_0x05ef('0x6e')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x6f'),require(_0x05ef('0x70')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x71'),require(_0x05ef('0x72')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x73'),require(_0x05ef('0x74')));_0x1da17c[_0x05ef('0x8')]('/api/cm/custom_fields',require(_0x05ef('0x75')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x76'),require(_0x05ef('0x77')));_0x1da17c['use']('/api/automations',require(_0x05ef('0x78')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x79'),require('./api/cannedAnswer'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x7a'),require(_0x05ef('0x7b')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x7c'),require(_0x05ef('0x7d')));_0x1da17c['use'](_0x05ef('0x7e'),require('./api/interval'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x7f'),require(_0x05ef('0x80')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x81'),require('./api/cdr'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x82'),require(_0x05ef('0x83')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x84'),require('./api/schedule'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x85'),require(_0x05ef('0x86')));_0x1da17c['use'](_0x05ef('0x87'),require(_0x05ef('0x88')));_0x1da17c['use'](_0x05ef('0x89'),require(_0x05ef('0x8a')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x8b'),require(_0x05ef('0x8c')));_0x1da17c['use'](_0x05ef('0x8d'),require('./api/variable'));_0x1da17c[_0x05ef('0x8')]('/api/integrations',require('./api/integration'));_0x1da17c['use'](_0x05ef('0x8e'),require(_0x05ef('0x8f')));_0x1da17c[_0x05ef('0x8')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x1da17c[_0x05ef('0x8')]('/api/analytics/default_reports',require(_0x05ef('0x90')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x91'),require(_0x05ef('0x92')));_0x1da17c['use'](_0x05ef('0x93'),require(_0x05ef('0x94')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x95'),require(_0x05ef('0x96')));_0x1da17c[_0x05ef('0x8')]('/api/analytics/tree_reports',require(_0x05ef('0x97')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/salesforce/accounts',require(_0x05ef('0x98')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x99'),require(_0x05ef('0x9a')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x9b'),require('./api/intSalesforceField'));_0x1da17c['use'](_0x05ef('0x9c'),require(_0x05ef('0x9d')));_0x1da17c['use']('/api/integrations/sugarcrm/configurations',require(_0x05ef('0x9e')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x9f'),require('./api/intSugarcrmField'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xa0'),require(_0x05ef('0xa1')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xa2'),require(_0x05ef('0xa3')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/desk/fields',require(_0x05ef('0xa4')));_0x1da17c['use']('/api/integrations/zoho/accounts',require(_0x05ef('0xa5')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xa6'),require(_0x05ef('0xa7')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/zoho/fields',require(_0x05ef('0xa8')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xa9'),require(_0x05ef('0xaa')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xab'),require('./api/intZendeskConfiguration'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xac'),require('./api/intZendeskField'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xad'),require(_0x05ef('0xae')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xaf'),require(_0x05ef('0xb0')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/vtiger/accounts',require(_0x05ef('0xb1')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/vtiger/configurations',require(_0x05ef('0xb2')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xb3'),require(_0x05ef('0xb4')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xb5'),require('./api/intServicenowAccount'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xb6'),require(_0x05ef('0xb7')));_0x1da17c['use'](_0x05ef('0xb8'),require(_0x05ef('0xb9')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xba'),require(_0x05ef('0xbb')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/dynamics365/configurations',require(_0x05ef('0xbc')));_0x1da17c['use'](_0x05ef('0xbd'),require(_0x05ef('0xbe')));_0x1da17c['use'](_0x05ef('0xbf'),require(_0x05ef('0xc0')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xc1'),require(_0x05ef('0xc2')));_0x1da17c[_0x05ef('0x8')]('/api/integrations/freshsales/fields',require(_0x05ef('0xc3')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xc4'),require(_0x05ef('0xc5')));_0x1da17c['use'](_0x05ef('0xc6'),require(_0x05ef('0xc7')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xc8'),require(_0x05ef('0xc9')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xca'),require('./api/jscriptyAnswerReport'));_0x1da17c[_0x05ef('0x8')]('/api/jscripty/questions/reports',require('./api/jscriptyQuestionReport'));_0x1da17c[_0x05ef('0x8')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x1da17c['use']('/api/sms/reports/queue',require(_0x05ef('0xcb')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xcc'),require(_0x05ef('0xcd')));_0x1da17c['use'](_0x05ef('0xce'),require(_0x05ef('0xcf')));_0x1da17c[_0x05ef('0x8')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xd0'),require(_0x05ef('0xd1')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xd2'),require('./api/squareOdbc'));_0x1da17c[_0x05ef('0x8')]('/api/square/projects',require(_0x05ef('0xd3')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xd4'),require(_0x05ef('0xd5')));_0x1da17c[_0x05ef('0x8')]('/api/square/messages',require('./api/squareMessage'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xd6'),require(_0x05ef('0xd7')));_0x1da17c[_0x05ef('0x8')]('/api/license',require(_0x05ef('0xd8')));_0x1da17c[_0x05ef('0x8')]('/api/campaigns',require(_0x05ef('0xd9')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xda'),require('./api/migration'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xdb'),require(_0x05ef('0xdc')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xdd'),require(_0x05ef('0xde')));_0x1da17c[_0x05ef('0x8')]('/api/mail/reports/transfer',require(_0x05ef('0xdf')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xe0'),require(_0x05ef('0xe1')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xe2'),require(_0x05ef('0xe3')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xe4'),require(_0x05ef('0xe5')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xe6'),require(_0x05ef('0xe7')));_0x1da17c[_0x05ef('0x8')]('/api/cm/lists',require(_0x05ef('0xe8')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xe9'),require(_0x05ef('0xea')));_0x1da17c['use']('/api/userProfiles',require('./api/userProfile'));_0x1da17c[_0x05ef('0x8')]('/api/userProfile/sections',require(_0x05ef('0xeb')));_0x1da17c[_0x05ef('0x8')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x1da17c[_0x05ef('0x8')]('/api/notifications',require(_0x05ef('0xec')));_0x1da17c['use'](_0x05ef('0xed'),require(_0x05ef('0xee')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xef'),require('./api/whatsappApplication'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xf0'),require('./api/whatsappInteraction'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xf1'),require(_0x05ef('0xf2')));_0x1da17c['use']('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xf3'),require(_0x05ef('0xf4')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xf5'),require('./api/whatsappQueue'));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xf6'),require(_0x05ef('0xf7')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xf8'),require(_0x05ef('0xf9')));_0x1da17c[_0x05ef('0x8')]('/api/auth/google',require('./api/authGoogle'));_0x1da17c['use']('/api/jira',require(_0x05ef('0xfa')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xfb'),require(_0x05ef('0xfc')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xfd'),require(_0x05ef('0xfe')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0xff'),require(_0x05ef('0x100')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x101'),require(_0x05ef('0x102')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x103'),require(_0x05ef('0x104')));_0x1da17c['use'](_0x05ef('0x105'),express['static'](path[_0x05ef('0x106')](config[_0x05ef('0x107')],_0x05ef('0x105'))));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x108'),express[_0x05ef('0x109')](path['join'](config[_0x05ef('0x107')],'/www')));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x10a'),express[_0x05ef('0x109')](path['join'](config[_0x05ef('0x107')],_0x05ef('0x10a'))));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x10b'),express[_0x05ef('0x109')](path[_0x05ef('0x106')](config[_0x05ef('0x107')],_0x05ef('0x10c'),_0x05ef('0x10d'))));_0x1da17c[_0x05ef('0x8')](_0x05ef('0x10e'),express[_0x05ef('0x109')](path[_0x05ef('0x106')](config[_0x05ef('0x107')],'/server/files/plugins')));_0x1da17c[_0x05ef('0x10f')](_0x05ef('0x110'))[_0x05ef('0x111')](errors[0x194]);_0x1da17c[_0x05ef('0x10f')]('/*')[_0x05ef('0x111')](function(_0x3d7111,_0x573b4c){_0x573b4c[_0x05ef('0x112')](path[_0x05ef('0x113')](_0x1da17c[_0x05ef('0x111')]('appPath')+_0x05ef('0x114')));});}; \ No newline at end of file +var _0xb6c8=['/api/cm/custom_fields','./api/cmCustomField','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/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/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/notifications','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','./api/cloudProvider','/api/auth/local','/api/jira','./api/jira','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','/www','root','/demo','/snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','path','express-winston','util','./errors','./config/logger','api','auth','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','x-forwarded-for','connection','remoteAddress','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','url','statusCode','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','./api/voiceQueue','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/chatWebsite','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history'];(function(_0x5a3c8e,_0x2c97c2){var _0xddc192=function(_0x461e55){while(--_0x461e55){_0x5a3c8e['push'](_0x5a3c8e['shift']());}};_0xddc192(++_0x2c97c2);}(_0xb6c8,0x1b4));var _0x8b6c=function(_0x22e011,_0xff7e8d){_0x22e011=_0x22e011-0x0;var _0x209e2b=_0xb6c8[_0x22e011];return _0x209e2b;};'use strict';var path=require(_0x8b6c('0x0'));var express=require('express');var ewinston=require(_0x8b6c('0x1'));var util=require(_0x8b6c('0x2'));var errors=require(_0x8b6c('0x3'));var config=require('./config/environment');var logger=require(_0x8b6c('0x4'))(_0x8b6c('0x5'));var authLogger=require('./config/logger')(_0x8b6c('0x6'));exports['default']=function(_0x4b1f58){_0x4b1f58[_0x8b6c('0x7')](ewinston[_0x8b6c('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x143d36,_0x313812){return util[_0x8b6c('0x9')](_0x8b6c('0xa'),_0x143d36['method'],_0x143d36[_0x8b6c('0xb')][_0x8b6c('0xc')]?_0x143d36[_0x8b6c('0xb')]['x-forwarded-for']:_0x143d36[_0x8b6c('0xd')][_0x8b6c('0xe')]||_0x143d36['ip'],_0x143d36['url'],_0x313812['statusCode'],_0x313812[_0x8b6c('0xf')],_0x143d36['user']?_0x143d36['user']['id']:null,_0x143d36[_0x8b6c('0x10')]?_0x143d36[_0x8b6c('0x10')][_0x8b6c('0x11')]:null,_0x143d36[_0x8b6c('0x10')]?_0x143d36['user'][_0x8b6c('0x12')]:null);}}));_0x4b1f58['use'](ewinston[_0x8b6c('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2c56a1,_0x2ec73c){var _0x3fa37f=_0x8b6c('0x13');if(_0x2c56a1['body']&&_0x2c56a1[_0x8b6c('0x14')][_0x8b6c('0x15')]&&_0x2c56a1[_0x8b6c('0x14')][_0x8b6c('0x16')]){_0x3fa37f=_0x8b6c('0x17');}return util['format'](_0x3fa37f,_0x2c56a1[_0x8b6c('0x18')],_0x2c56a1['headers'][_0x8b6c('0xc')]?_0x2c56a1[_0x8b6c('0xb')][_0x8b6c('0xc')]:_0x2c56a1[_0x8b6c('0xd')]['remoteAddress']||_0x2c56a1['ip'],_0x2c56a1[_0x8b6c('0x19')],_0x2ec73c[_0x8b6c('0x1a')],_0x2ec73c[_0x8b6c('0xf')],_0x2c56a1['user']?_0x2c56a1[_0x8b6c('0x10')]['id']:null,_0x2c56a1[_0x8b6c('0x10')]?_0x2c56a1['user'][_0x8b6c('0x11')]:null,_0x2c56a1[_0x8b6c('0x10')]?_0x2c56a1[_0x8b6c('0x10')]['role']:null,_0x2c56a1[_0x8b6c('0x14')]&&_0x2c56a1[_0x8b6c('0x14')][_0x8b6c('0x15')]?_0x2c56a1[_0x8b6c('0x14')][_0x8b6c('0x15')]:_0x8b6c('0x1b'),_0x2c56a1[_0x8b6c('0x14')]&&_0x2c56a1['body'][_0x8b6c('0x16')]?_0x2c56a1[_0x8b6c('0x14')][_0x8b6c('0x16')]:'',_0x2c56a1[_0x8b6c('0x14')]&&_0x2c56a1[_0x8b6c('0x14')]['agent_name']?_0x2c56a1['body'][_0x8b6c('0x1c')]:'');},'ignoreRoute':function(_0x3b37a8){var _0x364956=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x364956[_0x8b6c('0x1d')](_0x3b37a8[_0x8b6c('0x19')]);}}));_0x4b1f58[_0x8b6c('0x7')]('/api/users',require(_0x8b6c('0x1e')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x1f'),require(_0x8b6c('0x20')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x21'),require(_0x8b6c('0x22')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x23'),require(_0x8b6c('0x24')));_0x4b1f58[_0x8b6c('0x7')]('/api/voice/mohs',require(_0x8b6c('0x25')));_0x4b1f58['use']('/api/voice/queues',require(_0x8b6c('0x26')));_0x4b1f58[_0x8b6c('0x7')]('/api/voice/recordings',require(_0x8b6c('0x27')));_0x4b1f58[_0x8b6c('0x7')]('/api/screen/recordings',require(_0x8b6c('0x28')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x29'),require(_0x8b6c('0x2a')));_0x4b1f58['use'](_0x8b6c('0x2b'),require(_0x8b6c('0x2c')));_0x4b1f58[_0x8b6c('0x7')]('/api/voice/calls/reports',require(_0x8b6c('0x2d')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x2e'),require(_0x8b6c('0x2f')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x30'),require(_0x8b6c('0x31')));_0x4b1f58['use'](_0x8b6c('0x32'),require('./api/voiceQueueReport'));_0x4b1f58['use'](_0x8b6c('0x33'),require(_0x8b6c('0x34')));_0x4b1f58[_0x8b6c('0x7')]('/api/trunks',require(_0x8b6c('0x35')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x36'),require(_0x8b6c('0x37')));_0x4b1f58[_0x8b6c('0x7')]('/api/mail/out_servers',require(_0x8b6c('0x38')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x39'),require(_0x8b6c('0x3a')));_0x4b1f58['use'](_0x8b6c('0x3b'),require(_0x8b6c('0x3c')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x3d'),require('./api/mailSubstatus'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x3e'),require(_0x8b6c('0x3f')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x40'),require(_0x8b6c('0x41')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x42'),require('./api/mailApplication'));_0x4b1f58[_0x8b6c('0x7')]('/api/mail/reports/queue',require(_0x8b6c('0x43')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x44'),require('./api/dashboard'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x45'),require(_0x8b6c('0x46')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x47'),require(_0x8b6c('0x48')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x49'),require(_0x8b6c('0x4a')));_0x4b1f58[_0x8b6c('0x7')]('/api/fax/interactions',require(_0x8b6c('0x4b')));_0x4b1f58['use'](_0x8b6c('0x4c'),require(_0x8b6c('0x4d')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x4e'),require(_0x8b6c('0x4f')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x50'),require(_0x8b6c('0x51')));_0x4b1f58['use'](_0x8b6c('0x52'),require('./api/smsAccount'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x53'),require('./api/smsApplication'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x54'),require(_0x8b6c('0x55')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x56'),require('./api/smsMessage'));_0x4b1f58['use'](_0x8b6c('0x57'),require(_0x8b6c('0x58')));_0x4b1f58[_0x8b6c('0x7')]('/api/openchannel/accounts',require(_0x8b6c('0x59')));_0x4b1f58['use'](_0x8b6c('0x5a'),require(_0x8b6c('0x5b')));_0x4b1f58['use'](_0x8b6c('0x5c'),require(_0x8b6c('0x5d')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x5e'),require(_0x8b6c('0x5f')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x60'),require('./api/openchannelQueue'));_0x4b1f58['use']('/api/chat/websites',require(_0x8b6c('0x61')));_0x4b1f58[_0x8b6c('0x7')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x62'),require('./api/chatApplication'));_0x4b1f58['use'](_0x8b6c('0x63'),require(_0x8b6c('0x64')));_0x4b1f58['use'](_0x8b6c('0x65'),require(_0x8b6c('0x66')));_0x4b1f58[_0x8b6c('0x7')]('/api/chat/offline_messages',require(_0x8b6c('0x67')));_0x4b1f58[_0x8b6c('0x7')]('/api/chat/queues',require(_0x8b6c('0x68')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x69'),require(_0x8b6c('0x6a')));_0x4b1f58[_0x8b6c('0x7')]('/api/chat/proactive_actions',require(_0x8b6c('0x6b')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x6c'),require(_0x8b6c('0x6d')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x6e'),require(_0x8b6c('0x6f')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x70'),require(_0x8b6c('0x71')));_0x4b1f58[_0x8b6c('0x7')]('/api/cm/hopper_black',require(_0x8b6c('0x72')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x73'),require(_0x8b6c('0x74')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x75'),require('./api/cmHopperHistory'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x76'),require(_0x8b6c('0x77')));_0x4b1f58['use']('/api/actions',require(_0x8b6c('0x78')));_0x4b1f58['use']('/api/automations',require(_0x8b6c('0x79')));_0x4b1f58['use'](_0x8b6c('0x7a'),require(_0x8b6c('0x7b')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x7c'),require(_0x8b6c('0x7d')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x7e'),require(_0x8b6c('0x7f')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x80'),require('./api/interval'));_0x4b1f58['use']('/api/pauses',require(_0x8b6c('0x81')));_0x4b1f58['use']('/api/cdr',require(_0x8b6c('0x82')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x83'),require(_0x8b6c('0x84')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x85'),require('./api/schedule'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x86'),require('./api/sound'));_0x4b1f58['use'](_0x8b6c('0x87'),require(_0x8b6c('0x88')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x89'),require(_0x8b6c('0x8a')));_0x4b1f58['use'](_0x8b6c('0x8b'),require(_0x8b6c('0x8c')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x8d'),require(_0x8b6c('0x8e')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x8f'),require('./api/integration'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x90'),require('./api/integrationReport'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x91'),require('./api/analyticCustomReport'));_0x4b1f58[_0x8b6c('0x7')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x4b1f58['use'](_0x8b6c('0x92'),require(_0x8b6c('0x93')));_0x4b1f58[_0x8b6c('0x7')]('/api/analytics/metrics',require(_0x8b6c('0x94')));_0x4b1f58[_0x8b6c('0x7')]('/api/analytics/field_reports',require(_0x8b6c('0x95')));_0x4b1f58[_0x8b6c('0x7')]('/api/analytics/tree_reports',require(_0x8b6c('0x96')));_0x4b1f58['use'](_0x8b6c('0x97'),require(_0x8b6c('0x98')));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/salesforce/configurations',require(_0x8b6c('0x99')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x9a'),require('./api/intSalesforceField'));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x8b6c('0x9b')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x9c'),require(_0x8b6c('0x9d')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x9e'),require(_0x8b6c('0x9f')));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xa0'),require(_0x8b6c('0xa1')));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/desk/fields',require(_0x8b6c('0xa2')));_0x4b1f58['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x4b1f58['use'](_0x8b6c('0xa3'),require(_0x8b6c('0xa4')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xa5'),require('./api/intZohoField'));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/zendesk/accounts',require(_0x8b6c('0xa6')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xa7'),require('./api/intZendeskConfiguration'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xa8'),require(_0x8b6c('0xa9')));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/freshdesk/accounts',require(_0x8b6c('0xaa')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xab'),require(_0x8b6c('0xac')));_0x4b1f58['use']('/api/integrations/freshdesk/fields',require(_0x8b6c('0xad')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xae'),require(_0x8b6c('0xaf')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xb0'),require(_0x8b6c('0xb1')));_0x4b1f58['use'](_0x8b6c('0xb2'),require(_0x8b6c('0xb3')));_0x4b1f58['use'](_0x8b6c('0xb4'),require(_0x8b6c('0xb5')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xb6'),require(_0x8b6c('0xb7')));_0x4b1f58[_0x8b6c('0x7')]('/api/integrations/servicenow/fields',require(_0x8b6c('0xb8')));_0x4b1f58['use'](_0x8b6c('0xb9'),require(_0x8b6c('0xba')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xbb'),require(_0x8b6c('0xbc')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xbd'),require(_0x8b6c('0xbe')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xbf'),require('./api/intFreshsalesAccount'));_0x4b1f58['use'](_0x8b6c('0xc0'),require(_0x8b6c('0xc1')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xc2'),require('./api/intFreshsalesField'));_0x4b1f58['use'](_0x8b6c('0xc3'),require(_0x8b6c('0xc4')));_0x4b1f58[_0x8b6c('0x7')]('/api/chat/reports/queue',require(_0x8b6c('0xc5')));_0x4b1f58[_0x8b6c('0x7')]('/api/chat/internal/messages',require(_0x8b6c('0xc6')));_0x4b1f58['use'](_0x8b6c('0xc7'),require(_0x8b6c('0xc8')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xc9'),require('./api/jscriptyQuestionReport'));_0x4b1f58['use']('/api/jscripty/sessions/reports',require(_0x8b6c('0xca')));_0x4b1f58[_0x8b6c('0x7')]('/api/sms/reports/queue',require(_0x8b6c('0xcb')));_0x4b1f58[_0x8b6c('0x7')]('/api/square/reports',require(_0x8b6c('0xcc')));_0x4b1f58['use'](_0x8b6c('0xcd'),require('./api/squareReportDetail'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xce'),require(_0x8b6c('0xcf')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xd0'),require('./api/setting'));_0x4b1f58['use'](_0x8b6c('0xd1'),require(_0x8b6c('0xd2')));_0x4b1f58['use'](_0x8b6c('0xd3'),require(_0x8b6c('0xd4')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xd5'),require(_0x8b6c('0xd6')));_0x4b1f58['use'](_0x8b6c('0xd7'),require(_0x8b6c('0xd8')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xd9'),require(_0x8b6c('0xda')));_0x4b1f58[_0x8b6c('0x7')]('/api/license',require(_0x8b6c('0xdb')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xdc'),require(_0x8b6c('0xdd')));_0x4b1f58[_0x8b6c('0x7')]('/api/migrations',require(_0x8b6c('0xde')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xdf'),require('./api/attachment'));_0x4b1f58['use'](_0x8b6c('0xe0'),require(_0x8b6c('0xe1')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xe2'),require('./api/mailTransferReport'));_0x4b1f58['use'](_0x8b6c('0xe3'),require(_0x8b6c('0xe4')));_0x4b1f58[_0x8b6c('0x7')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x4b1f58[_0x8b6c('0x7')]('/api/openchannel/reports/transfer',require(_0x8b6c('0xe5')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xe6'),require('./api/smsTransferReport'));_0x4b1f58[_0x8b6c('0x7')]('/api/cm/lists',require(_0x8b6c('0xe7')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xe8'),require('./api/voicePrefix'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xe9'),require(_0x8b6c('0xea')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xeb'),require(_0x8b6c('0xec')));_0x4b1f58[_0x8b6c('0x7')]('/api/userProfile/resources',require(_0x8b6c('0xed')));_0x4b1f58['use'](_0x8b6c('0xee'),require('./api/notification'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xef'),require(_0x8b6c('0xf0')));_0x4b1f58['use'](_0x8b6c('0xf1'),require('./api/whatsappApplication'));_0x4b1f58[_0x8b6c('0x7')]('/api/whatsapp/interactions',require(_0x8b6c('0xf2')));_0x4b1f58['use'](_0x8b6c('0xf3'),require(_0x8b6c('0xf4')));_0x4b1f58['use'](_0x8b6c('0xf5'),require(_0x8b6c('0xf6')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xf7'),require(_0x8b6c('0xf8')));_0x4b1f58[_0x8b6c('0x7')]('/api/whatsapp/queues',require(_0x8b6c('0xf9')));_0x4b1f58[_0x8b6c('0x7')]('/api/cloudProviders',require(_0x8b6c('0xfa')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xfb'),require('./api/authLocal'));_0x4b1f58['use']('/api/auth/google',require('./api/authGoogle'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0xfc'),require(_0x8b6c('0xfd')));_0x4b1f58['use']('/api/rpc',require(_0x8b6c('0xfe')));_0x4b1f58['use'](_0x8b6c('0xff'),require(_0x8b6c('0x100')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x101'),require(_0x8b6c('0x102')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x103'),require('./api/pm2'));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x104'),require(_0x8b6c('0x105')));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x106'),express[_0x8b6c('0x107')](path[_0x8b6c('0x108')](config['root'],_0x8b6c('0x106'))));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x109'),express['static'](path[_0x8b6c('0x108')](config[_0x8b6c('0x10a')],'/www')));_0x4b1f58['use']('/demo',express[_0x8b6c('0x107')](path[_0x8b6c('0x108')](config[_0x8b6c('0x10a')],_0x8b6c('0x10b'))));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x10c'),express[_0x8b6c('0x107')](path['join'](config[_0x8b6c('0x10a')],'snippet',_0x8b6c('0x10d'))));_0x4b1f58[_0x8b6c('0x7')](_0x8b6c('0x10e'),express[_0x8b6c('0x107')](path[_0x8b6c('0x108')](config[_0x8b6c('0x10a')],_0x8b6c('0x10f'))));_0x4b1f58[_0x8b6c('0x110')](_0x8b6c('0x111'))[_0x8b6c('0x112')](errors[0x194]);_0x4b1f58[_0x8b6c('0x110')]('/*')[_0x8b6c('0x112')](function(_0x3b01e7,_0x4d54c0){_0x4d54c0[_0x8b6c('0x113')](path['resolve'](_0x4b1f58[_0x8b6c('0x112')]('appPath')+_0x8b6c('0x114')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 60d2b1c..9781851 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1a72=['../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','port','rpc','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc'];(function(_0x403185,_0x3a8eeb){var _0x32d118=function(_0x1dba24){while(--_0x1dba24){_0x403185['push'](_0x403185['shift']());}};_0x32d118(++_0x3a8eeb);}(_0x1a72,0xe0));var _0x21a7=function(_0x18f1df,_0x25f8d0){_0x18f1df=_0x18f1df-0x0;var _0x201d8e=_0x1a72[_0x18f1df];return _0x201d8e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x21a7('0x0'));var _=require(_0x21a7('0x1'));var config=require(_0x21a7('0x2'));exports[_0x21a7('0x3')]=function(){return new BPromise(function(_0x9341a7,_0x2ad5f){var _0x599e05={};_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x5')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x6')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x7')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/voiceRecording/voiceRecording.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x8')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x9')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0xa')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0xb')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/memberReport/memberReport.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/trunk/trunk.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0xc')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0xd')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0xe')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0xf')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x10')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/mailInteraction/mailInteraction.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x11')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x12')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x13')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x14')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x15')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/faxInteraction/faxInteraction.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/faxMessage/faxMessage.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x16')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/smsAccount/smsAccount.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x17')));_0x599e05=_['merge'](_0x599e05,require('../api/smsMessage/smsMessage.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x18')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x19')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x1a')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x1b')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x1c')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/chatInteraction/chatInteraction.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x1d')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x1e')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x1f')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x20')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x21')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x22')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x23')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/interval/interval.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x24')));_0x599e05=_['merge'](_0x599e05,require('../api/sound/sound.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x25')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x26')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x27')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x28')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x599e05=_['merge'](_0x599e05,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x29')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x2a')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x2b')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x2c')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x2d')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x2e')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x2f')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x30')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x31')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x32')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/squareRecording/squareRecording.rpc'));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x33')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x34')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x35')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x36')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x37')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x38')));_0x599e05=_['merge'](_0x599e05,require(_0x21a7('0x39')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require(_0x21a7('0x3a')));_0x599e05=_[_0x21a7('0x4')](_0x599e05,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x3cf4d3=jayson[_0x21a7('0x3b')](_0x599e05)[_0x21a7('0x3c')]();var _0x501634=config['rpc'][_0x21a7('0x3d')]||config[_0x21a7('0x3d')]+0x1;var _0x39055c=config[_0x21a7('0x3e')]['ip']||_0x21a7('0x3f');_0x3cf4d3['on'](_0x21a7('0x40'),function(_0x56cb9e){return _0x2ad5f(_0x56cb9e);});_0x3cf4d3[_0x21a7('0x3')](_0x501634,_0x39055c,function(){console[_0x21a7('0x41')](_0x21a7('0x42'),_0x39055c,_0x501634);require(_0x21a7('0x43'))[_0x21a7('0x44')]();return _0x9341a7(_0x21a7('0x45')+_0x39055c+':'+_0x501634);});});}; \ No newline at end of file +var _0x690e=['../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x690e,0xee));var _0xe690=function(_0x55c8fd,_0x369697){_0x55c8fd=_0x55c8fd-0x0;var _0x12fad7=_0x690e[_0x55c8fd];return _0x12fad7;};'use strict';var jayson=require(_0xe690('0x0'));var BPromise=require(_0xe690('0x1'));var _=require(_0xe690('0x2'));var config=require(_0xe690('0x3'));exports[_0xe690('0x4')]=function(){return new BPromise(function(_0x1d0443,_0x4b98d){var _0x553347={};_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x6')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x7')));_0x553347=_['merge'](_0x553347,require('../api/voiceQueue/voiceQueue.rpc'));_0x553347=_['merge'](_0x553347,require(_0xe690('0x8')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x9')));_0x553347=_['merge'](_0x553347,require(_0xe690('0xa')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0xb')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0xc')));_0x553347=_['merge'](_0x553347,require(_0xe690('0xd')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0xe')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0xf')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x10')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x11')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x12')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x13')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x14')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x15')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/faxAccount/faxAccount.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x16')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x17')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/faxMessage/faxMessage.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x18')));_0x553347=_['merge'](_0x553347,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x553347=_['merge'](_0x553347,require(_0xe690('0x19')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x1a')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x1b')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x1c')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x1d')));_0x553347=_['merge'](_0x553347,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x1e')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x1f')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x20')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x21')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/chatQueue/chatQueue.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/cmContact/cmContact.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/cmHopper/cmHopper.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x22')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x23')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x24')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x25')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x26')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x27')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x28')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/template/template.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x29')));_0x553347=_['merge'](_0x553347,require('../api/variable/variable.rpc'));_0x553347=_['merge'](_0x553347,require(_0xe690('0x2a')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x2b')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x2c')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x2d')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x2e')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x2f')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x30')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x31')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x553347=_['merge'](_0x553347,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x32')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x33')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x34')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/squareOdbc/squareOdbc.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/squareProject/squareProject.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x35')));_0x553347=_['merge'](_0x553347,require(_0xe690('0x36')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x37')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x38')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x39')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x3a')));_0x553347=_[_0xe690('0x5')](_0x553347,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x3b')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x3c')));_0x553347=_[_0xe690('0x5')](_0x553347,require(_0xe690('0x3d')));var _0x5ba42b=jayson[_0xe690('0x3e')](_0x553347)[_0xe690('0x3f')]();var _0x53f2f3=config['rpc'][_0xe690('0x40')]||config['port']+0x1;var _0x39ece1=config[_0xe690('0x41')]['ip']||_0xe690('0x42');_0x5ba42b['on'](_0xe690('0x43'),function(_0x3d803d){return _0x4b98d(_0x3d803d);});_0x5ba42b[_0xe690('0x4')](_0x53f2f3,_0x39ece1,function(){console['log'](_0xe690('0x44'),_0x39ece1,_0x53f2f3);require(_0xe690('0x45'))['default']();return _0x1d0443(_0xe690('0x46')+_0x39ece1+':'+_0x53f2f3);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 56d3d60..18fb7c2 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 _0x129d=['wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','util','events','EventEmitter','./error','call','setEncoding','headers','ready','toLowerCase','emit','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','function','replace','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command=','write','prototype','sendRequest','command','sync','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','GOTO\x20%s\x20%s\x20%s','getVariable','log','getvariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x129d,0x145));var _0xd129=function(_0x5e201b,_0x160501){_0x5e201b=_0x5e201b-0x0;var _0x2bb339=_0x129d[_0x5e201b];return _0x2bb339;};'use strict';var util=require(_0xd129('0x0'));var _=require('lodash');var EventEmitter=require(_0xd129('0x1'))[_0xd129('0x2')];var AGIReply=require('./reply');var AGIError=require(_0xd129('0x3'));function AGIChannel(_0x41fd65){var _0x3f423b=this,_0x30f1eb=new AGIReply(),_0xf8ba50=![],_0x7e2c0c={};EventEmitter[_0xd129('0x4')](_0x3f423b);_0x41fd65[_0xd129('0x5')]('utf8');_0x41fd65['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x30f1eb[_0xd129('0x5')]('utf8');_0x30f1eb['on'](_0xd129('0x6'),function(_0x263030){for(var _0x49fdf5 in _0x263030){_0x3f423b[_0x49fdf5]=_0x263030[_0x49fdf5];}_0x3f423b['emit'](_0xd129('0x7'));});_0x30f1eb['on']('line',function(_0x1aca88){if(_0x1aca88[_0xd129('0x8')]()=='hangup'){_0x3f423b[_0xd129('0x9')](_0xd129('0xa'));return;}if(_0x1aca88[_0xd129('0xb')](0x0,0xb)==_0xd129('0xc')){_0xf8ba50=!![];}if(_0xf8ba50){_0x7e2c0c['rx']+=_0x1aca88+'\x0a';if(_0x1aca88['search'](_0xd129('0xd'))!=-0x1){_0xf8ba50=![];}}else{_0x7e2c0c['rx']=_0x1aca88;}if(_0xf8ba50){return;}if(typeof _0x7e2c0c['cb']==_0xd129('0xe')){var _0xcf5a3f=_0x7e2c0c['rx'][_0xd129('0xb')](0x0,0x3),_0x277b2e=null,_0x3b3c8f=null;_0xcf5a3f=parseInt(_0xcf5a3f);if(isNaN(_0xcf5a3f)){_0x7e2c0c['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xcf5a3f!=0xc8){_0x7e2c0c['cb'](null,{'code':_0xcf5a3f,'result':-0x1,'extra':'KO'});return;}_0x277b2e=_0x7e2c0c['rx']['substring'](0x4)[_0xd129('0xf')]('result=','');if(_0x277b2e[_0xd129('0x10')]('\x20')!=-0x1){_0x277b2e=_0x277b2e[_0xd129('0x11')](0x0,_0x277b2e[_0xd129('0x10')]('\x20'));}if(_[_0xd129('0x12')](_0x277b2e,'-1')){_0x277b2e=parseInt(_0x277b2e);}_0x3b3c8f=_0x7e2c0c['rx']['split']('\x20');if(_0x3b3c8f[_0xd129('0x13')]==0x3){_0x3b3c8f=_0x3b3c8f[0x2][_0xd129('0xb')](0x1,_0x3b3c8f[0x2][_0xd129('0x13')]-0x1);}else if(_0x3b3c8f[_0xd129('0x13')]>0x3){var _0x51a279=/\((.+)\)/;var _0x4b5781=_0x7e2c0c['rx'][_0xd129('0x14')](_0x51a279);if(_0x4b5781){_0x3b3c8f=_0x4b5781[0x1];}else{_0x3b3c8f=null;}}else{_0x3b3c8f=null;}_0x7e2c0c['cb'](null,{'code':_0xcf5a3f,'result':_0x277b2e,'extra':_0x3b3c8f});}});_0x41fd65['on'](_0xd129('0x15'),function(_0x42e446){_0x3f423b['emit']('error',new AGIError(_0xd129('0x16'),_0x42e446[_0xd129('0x17')]));});_0x41fd65['on']('close',function(){_0x3f423b[_0xd129('0x9')](_0xd129('0x18'),new AGIError(_0xd129('0x19')));});_0x41fd65['on']('timeout',function(){_0x3f423b[_0xd129('0x9')]('timeout',new AGIError(_0xd129('0x1a')));_0x41fd65[_0xd129('0x1b')]();});_0x41fd65[_0xd129('0x1c')](_0x30f1eb);this['command']=function(_0x4c9fd7,_0x9d72f4){console['log'](_0xd129('0x1d'),_0x4c9fd7);var _0x4c9fd7=_0x4c9fd7||'',_0x9d72f4=typeof _0x9d72f4=='function'?_0x9d72f4:new Function();_0x7e2c0c={'tx':_0x4c9fd7,'rx':'','cb':_0x9d72f4};_0x41fd65[_0xd129('0x1e')](_0x4c9fd7+'\x0a');},this[_0xd129('0x18')]=function(){_0x41fd65['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xd129('0x1f')][_0xd129('0x20')]=function(_0xee58ea){return this[_0xd129('0x21')][_0xd129('0x22')](this,_0xee58ea);};AGIChannel[_0xd129('0x1f')][_0xd129('0x23')]=function(){return this[_0xd129('0x20')](_0xd129('0x24'));};AGIChannel[_0xd129('0x1f')][_0xd129('0x25')]=function(_0x3f813a,_0x4e19b3,_0x55113d){_0x3f813a=_0x3f813a===undefined?_0xd129('0x26'):_0x3f813a;_0x4e19b3=_0x4e19b3===undefined?'5':_0x4e19b3;_0x55113d=_0x55113d===undefined?'1':_0x55113d;return this['sendRequest'](util[_0xd129('0x27')](_0xd129('0x28'),_0x3f813a,_0x4e19b3*0x3e8,_0x55113d));};AGIChannel['prototype'][_0xd129('0x29')]=function(_0x4d0b6d){_0x4d0b6d=_0x4d0b6d||_0xd129('0x2a');return this[_0xd129('0x20')](util['format'](_0xd129('0x2b'),_0x4d0b6d));};AGIChannel['prototype'][_0xd129('0x2c')]=function(_0x5c7e04,_0x425740){if(_['isArray'](_0x425740)){return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x2d'),_0x5c7e04,_0x425740[_0xd129('0x2e')](',')));}return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x2d'),_0x5c7e04,_0x425740));};AGIChannel[_0xd129('0x1f')][_0xd129('0x2f')]=function(_0x248a06){return this['sendRequest'](util['format'](_0xd129('0x30'),_0x248a06));};AGIChannel[_0xd129('0x1f')]['setExtension']=function(_0x28454f){return this[_0xd129('0x20')](util['format']('SET\x20EXTENSION\x20%s',_0x28454f));};AGIChannel[_0xd129('0x1f')][_0xd129('0x31')]=function(_0x279146){return this[_0xd129('0x20')](util['format'](_0xd129('0x32'),_0x279146));};AGIChannel[_0xd129('0x1f')][_0xd129('0xa')]=function(){return this[_0xd129('0x20')](_0xd129('0x33'));};AGIChannel[_0xd129('0x1f')]['setVariable']=function(_0x542efc,_0x374a91){var _0x2317fd=_[_0xd129('0x34')](_0x374a91)||_[_0xd129('0x35')](_0x374a91)?_0x374a91['toString']():_0x374a91;return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x36'),_0x542efc,_0x2317fd?_0x2317fd[_0xd129('0x37')]()[_0xd129('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xd129('0x1f')][_0xd129('0x38')]=function(_0x1aa304,_0xd5a894){return this['sendRequest'](util[_0xd129('0x27')](_0xd129('0x39'),_0x1aa304,_0xd5a894));};AGIChannel[_0xd129('0x1f')][_0xd129('0x3a')]=function(_0x3d01ba,_0x1aa882){return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x3b'),_0x3d01ba,_0x1aa882));};AGIChannel[_0xd129('0x1f')][_0xd129('0x3c')]=function(_0x1bcfe9,_0x37a25a){return this[_0xd129('0x20')](util['format'](_0xd129('0x3d'),_0x1bcfe9,_0x37a25a));};AGIChannel['prototype']['continueAt']=function(_0x2b6063,_0x5039d8,_0x1cb8ac){_0x5039d8=_0x5039d8||this[_0xd129('0x3e')];_0x1cb8ac=_0x1cb8ac||0x1;this[_0xd129('0x2f')](_0x2b6063);this[_0xd129('0x3f')](_0x5039d8);this[_0xd129('0x31')](_0x1cb8ac);return this[_0xd129('0x29')](util[_0xd129('0x27')](_0xd129('0x40'),_0x2b6063,_0x5039d8,_0x1cb8ac));};AGIChannel[_0xd129('0x1f')][_0xd129('0x41')]=function(_0x249378){console[_0xd129('0x42')](_0xd129('0x43'),_0x249378);return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x44'),_0x249378));};AGIChannel[_0xd129('0x1f')][_0xd129('0x45')]=function(_0x204e87,_0x1b787c,_0x5b7b60,_0x2a8d23,_0x3c6dec,_0x577ac5){_0x1b787c=_0x1b787c||_0xd129('0x46');_0x5b7b60=_0x5b7b60||'';_0x2a8d23=_0x2a8d23===undefined?-0x1:_0x2a8d23==='-1'?-0x1:_0x2a8d23*0x3e8;_0x3c6dec=_0x3c6dec===undefined?'':'s='+_0x3c6dec;_0x577ac5=_0x577ac5?_0xd129('0x47'):'';return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x48'),_0x204e87,_0x1b787c,_0x5b7b60,_0x2a8d23,_0x577ac5,_0x3c6dec));};AGIChannel['prototype'][_0xd129('0x49')]=function(_0x1bd117,_0x3d9ca7){_0x3d9ca7=_0x3d9ca7||'';return this[_0xd129('0x20')](util[_0xd129('0x27')](_0xd129('0x4a'),_0x1bd117,_0x3d9ca7));};AGIChannel[_0xd129('0x1f')][_0xd129('0x4b')]=function(_0xf6d20f){return this[_0xd129('0x2c')](_0xd129('0x4c'),_0xf6d20f);};AGIChannel['prototype'][_0xd129('0x4d')]=function(_0x129833){return this[_0xd129('0x2c')](_0xd129('0x4e'),_0x129833);};AGIChannel['prototype'][_0xd129('0x15')]=function(_0x2d626a,_0x363e29){this[_0xd129('0x29')](util[_0xd129('0x27')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x2d626a['id'],_0x2d626a['label'],_0x363e29));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x2814=['setTimeout','headers','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','result=','indexOf','substr','startsWith','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','command','log','command=','write','destroy','prototype','sync','sendRequest','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','extension','setExtension','noop','GOTO\x20%s\x20%s\x20%s','getVariable','getvariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','EventEmitter','./reply','./error','setEncoding','utf8'];(function(_0x5823f8,_0x48818a){var _0x38b09d=function(_0x352843){while(--_0x352843){_0x5823f8['push'](_0x5823f8['shift']());}};_0x38b09d(++_0x48818a);}(_0x2814,0x12a));var _0x4281=function(_0xbf7cbe,_0xfb3954){_0xbf7cbe=_0xbf7cbe-0x0;var _0x2e026=_0x2814[_0xbf7cbe];return _0x2e026;};'use strict';var util=require('util');var _=require(_0x4281('0x0'));var EventEmitter=require('events')[_0x4281('0x1')];var AGIReply=require(_0x4281('0x2'));var AGIError=require(_0x4281('0x3'));function AGIChannel(_0x3973da){var _0x50c333=this,_0x3b6471=new AGIReply(),_0xf3ba16=![],_0x3b0b1a={};EventEmitter['call'](_0x50c333);_0x3973da[_0x4281('0x4')](_0x4281('0x5'));_0x3973da[_0x4281('0x6')](0x8*0x3c*0x3c*0x3e8);_0x3b6471[_0x4281('0x4')](_0x4281('0x5'));_0x3b6471['on'](_0x4281('0x7'),function(_0x49b384){for(var _0xba09a8 in _0x49b384){_0x50c333[_0xba09a8]=_0x49b384[_0xba09a8];}_0x50c333['emit']('ready');});_0x3b6471['on']('line',function(_0x22b110){if(_0x22b110[_0x4281('0x8')]()=='hangup'){_0x50c333['emit'](_0x4281('0x9'));return;}if(_0x22b110['substring'](0x0,0xb)=='520-Invalid'){_0xf3ba16=!![];}if(_0xf3ba16){_0x3b0b1a['rx']+=_0x22b110+'\x0a';if(_0x22b110[_0x4281('0xa')](_0x4281('0xb'))!=-0x1){_0xf3ba16=![];}}else{_0x3b0b1a['rx']=_0x22b110;}if(_0xf3ba16){return;}if(typeof _0x3b0b1a['cb']==_0x4281('0xc')){var _0x5585b3=_0x3b0b1a['rx'][_0x4281('0xd')](0x0,0x3),_0x1cf0b0=null,_0x262482=null;_0x5585b3=parseInt(_0x5585b3);if(isNaN(_0x5585b3)){_0x3b0b1a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x4281('0xe')});return;}if(_0x5585b3!=0xc8){_0x3b0b1a['cb'](null,{'code':_0x5585b3,'result':-0x1,'extra':'KO'});return;}_0x1cf0b0=_0x3b0b1a['rx'][_0x4281('0xd')](0x4)[_0x4281('0xf')](_0x4281('0x10'),'');if(_0x1cf0b0[_0x4281('0x11')]('\x20')!=-0x1){_0x1cf0b0=_0x1cf0b0[_0x4281('0x12')](0x0,_0x1cf0b0[_0x4281('0x11')]('\x20'));}if(_[_0x4281('0x13')](_0x1cf0b0,'-1')){_0x1cf0b0=parseInt(_0x1cf0b0);}_0x262482=_0x3b0b1a['rx']['split']('\x20');if(_0x262482[_0x4281('0x14')]==0x3){_0x262482=_0x262482[0x2]['substring'](0x1,_0x262482[0x2][_0x4281('0x14')]-0x1);}else if(_0x262482[_0x4281('0x14')]>0x3){var _0x53ab24=/\((.+)\)/;var _0x1510d0=_0x3b0b1a['rx'][_0x4281('0x15')](_0x53ab24);if(_0x1510d0){_0x262482=_0x1510d0[0x1];}else{_0x262482=null;}}else{_0x262482=null;}_0x3b0b1a['cb'](null,{'code':_0x5585b3,'result':_0x1cf0b0,'extra':_0x262482});}});_0x3973da['on'](_0x4281('0x16'),function(_0x23395a){_0x50c333[_0x4281('0x17')](_0x4281('0x16'),new AGIError(_0x4281('0x18'),_0x23395a[_0x4281('0x19')]));});_0x3973da['on'](_0x4281('0x1a'),function(){_0x50c333[_0x4281('0x17')](_0x4281('0x1a'),new AGIError(_0x4281('0x1b')));});_0x3973da['on'](_0x4281('0x1c'),function(){_0x50c333[_0x4281('0x17')](_0x4281('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3973da['destroy']();});_0x3973da['pipe'](_0x3b6471);this[_0x4281('0x1d')]=function(_0x57766a,_0x57c435){console[_0x4281('0x1e')](_0x4281('0x1f'),_0x57766a);var _0x57766a=_0x57766a||'',_0x57c435=typeof _0x57c435==_0x4281('0xc')?_0x57c435:new Function();_0x3b0b1a={'tx':_0x57766a,'rx':'','cb':_0x57c435};_0x3973da[_0x4281('0x20')](_0x57766a+'\x0a');},this[_0x4281('0x1a')]=function(){_0x3973da[_0x4281('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x4281('0x22')]['sendRequest']=function(_0x3d660){return this['command'][_0x4281('0x23')](this,_0x3d660);};AGIChannel[_0x4281('0x22')]['answer']=function(){return this[_0x4281('0x24')](_0x4281('0x25'));};AGIChannel[_0x4281('0x22')][_0x4281('0x26')]=function(_0x1770b5,_0x34dc4f,_0x309a95){_0x1770b5=_0x1770b5===undefined?_0x4281('0x27'):_0x1770b5;_0x34dc4f=_0x34dc4f===undefined?'5':_0x34dc4f;_0x309a95=_0x309a95===undefined?'1':_0x309a95;return this[_0x4281('0x24')](util['format'](_0x4281('0x28'),_0x1770b5,_0x34dc4f*0x3e8,_0x309a95));};AGIChannel[_0x4281('0x22')]['noop']=function(_0x41d604){_0x41d604=_0x41d604||'NO\x20MESSAGE';return this['sendRequest'](util[_0x4281('0x29')](_0x4281('0x2a'),_0x41d604));};AGIChannel['prototype'][_0x4281('0x2b')]=function(_0x351ac0,_0x571847){if(_[_0x4281('0x2c')](_0x571847)){return this[_0x4281('0x24')](util[_0x4281('0x29')](_0x4281('0x2d'),_0x351ac0,_0x571847[_0x4281('0x2e')](',')));}return this['sendRequest'](util[_0x4281('0x29')](_0x4281('0x2d'),_0x351ac0,_0x571847));};AGIChannel['prototype'][_0x4281('0x2f')]=function(_0x38ac1){return this[_0x4281('0x24')](util[_0x4281('0x29')](_0x4281('0x30'),_0x38ac1));};AGIChannel[_0x4281('0x22')]['setExtension']=function(_0x308643){return this['sendRequest'](util[_0x4281('0x29')](_0x4281('0x31'),_0x308643));};AGIChannel[_0x4281('0x22')][_0x4281('0x32')]=function(_0x16bb8d){return this[_0x4281('0x24')](util[_0x4281('0x29')](_0x4281('0x33'),_0x16bb8d));};AGIChannel['prototype'][_0x4281('0x9')]=function(){return this[_0x4281('0x24')](_0x4281('0x34'));};AGIChannel[_0x4281('0x22')][_0x4281('0x35')]=function(_0x19bb19,_0x559533){var _0x58ac15=_['isBoolean'](_0x559533)||_['isNumber'](_0x559533)?_0x559533[_0x4281('0x36')]():_0x559533;return this[_0x4281('0x24')](util['format'](_0x4281('0x37'),_0x19bb19,_0x58ac15?_0x58ac15[_0x4281('0x36')]()[_0x4281('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x4281('0x22')][_0x4281('0x38')]=function(_0x56dcde,_0xd61de1){return this['sendRequest'](util[_0x4281('0x29')](_0x4281('0x39'),_0x56dcde,_0xd61de1));};AGIChannel[_0x4281('0x22')][_0x4281('0x3a')]=function(_0x6662fb,_0x2b3b2a){return this[_0x4281('0x24')](util['format'](_0x4281('0x3b'),_0x6662fb,_0x2b3b2a));};AGIChannel[_0x4281('0x22')][_0x4281('0x3c')]=function(_0x27c81e,_0x3b6085){return this[_0x4281('0x24')](util[_0x4281('0x29')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x27c81e,_0x3b6085));};AGIChannel[_0x4281('0x22')]['continueAt']=function(_0x306d5e,_0x59e898,_0x4e870d){_0x59e898=_0x59e898||this[_0x4281('0x3d')];_0x4e870d=_0x4e870d||0x1;this[_0x4281('0x2f')](_0x306d5e);this[_0x4281('0x3e')](_0x59e898);this[_0x4281('0x32')](_0x4e870d);return this[_0x4281('0x3f')](util['format'](_0x4281('0x40'),_0x306d5e,_0x59e898,_0x4e870d));};AGIChannel[_0x4281('0x22')][_0x4281('0x41')]=function(_0x14dd5b){console[_0x4281('0x1e')](_0x4281('0x42'),_0x14dd5b);return this['sendRequest'](util[_0x4281('0x29')]('GET\x20VARIABLE\x20\x22%s\x22',_0x14dd5b));};AGIChannel['prototype'][_0x4281('0x43')]=function(_0x24552c,_0x224ab2,_0x1fa0c5,_0x382e94,_0xd22d60,_0x4e195c){_0x224ab2=_0x224ab2||_0x4281('0x44');_0x1fa0c5=_0x1fa0c5||'';_0x382e94=_0x382e94===undefined?-0x1:_0x382e94==='-1'?-0x1:_0x382e94*0x3e8;_0xd22d60=_0xd22d60===undefined?'':'s='+_0xd22d60;_0x4e195c=_0x4e195c?'BEEP':'';return this[_0x4281('0x24')](util['format'](_0x4281('0x45'),_0x24552c,_0x224ab2,_0x1fa0c5,_0x382e94,_0x4e195c,_0xd22d60));};AGIChannel[_0x4281('0x22')]['streamFile']=function(_0x47a206,_0x3ea805){_0x3ea805=_0x3ea805||'';return this[_0x4281('0x24')](util[_0x4281('0x29')](_0x4281('0x46'),_0x47a206,_0x3ea805));};AGIChannel[_0x4281('0x22')][_0x4281('0x47')]=function(_0x53eeaf){return this[_0x4281('0x2b')]('AGI',_0x53eeaf);};AGIChannel['prototype'][_0x4281('0x48')]=function(_0x38593e){return this[_0x4281('0x2b')]('WAIT',_0x38593e);};AGIChannel['prototype'][_0x4281('0x16')]=function(_0x5d04bb,_0x36aadc){this[_0x4281('0x3f')](util[_0x4281('0x29')](_0x4281('0x49'),_0x5d04bb['id'],_0x5d04bb[_0x4281('0x4a')],_0x36aadc));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x4281('0x4b')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index dbfcca1..15d3000 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 _0x40b5=['Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x40b5,0x1d7));var _0x540b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x40b5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x540b('0x0'));var error={'E_AGI_UNDEFINED':_0x540b('0x1'),'E_AGI_ARGUMENT_PORT':_0x540b('0x2'),'E_AGI_SERVER_ERROR':_0x540b('0x3'),'E_AGI_SERVER_CLOSE':_0x540b('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x540b('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x540b('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x540b('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x540b('0x8'),'E_AGI_COMMAND_EMPTY':_0x540b('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x540b('0xa'),'E_AGI_IVR_ENTRY':_0x540b('0xb')};function AGIError(_0x4e0a29){var _0x4e0a29=_0x4e0a29||null,_0x448b68=_0x448b68||[],_0x316ab7=0x1,_0x5aeb5f='';if(!error[_0x4e0a29]){_0x4e0a29='E_AGI_UNDEFINED';}_0x448b68[_0x540b('0xc')](error[_0x4e0a29]);while(arguments[_0x316ab7]){_0x448b68['push'](arguments[_0x316ab7]);_0x316ab7++;}_0x5aeb5f=util['format']['apply'](util,_0x448b68);this[_0x540b('0xd')]=_0x5aeb5f;this['name']=_0x4e0a29;}module[_0x540b('0xe')]=AGIError; \ No newline at end of file +var _0xb35a=['Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x2a99e2,_0x1803e4){var _0x23fb5f=function(_0x568ec9){while(--_0x568ec9){_0x2a99e2['push'](_0x2a99e2['shift']());}};_0x23fb5f(++_0x1803e4);}(_0xb35a,0x1d7));var _0xab35=function(_0x3a10b6,_0x3181f0){_0x3a10b6=_0x3a10b6-0x0;var _0x463dc3=_0xb35a[_0x3a10b6];return _0x463dc3;};'use strict';var util=require(_0xab35('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xab35('0x1'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xab35('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xab35('0x3'),'E_AGI_SOCKET_ERROR':_0xab35('0x4'),'E_AGI_SOCKET_CLOSE':_0xab35('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xab35('0x6'),'E_AGI_COMMAND_EMPTY':_0xab35('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xab35('0x8'),'E_AGI_IVR_ENTRY':_0xab35('0x9')};function AGIError(_0x2c3072){var _0x2c3072=_0x2c3072||null,_0x3672d9=_0x3672d9||[],_0x19bbe0=0x1,_0x6780db='';if(!error[_0x2c3072]){_0x2c3072='E_AGI_UNDEFINED';}_0x3672d9['push'](error[_0x2c3072]);while(arguments[_0x19bbe0]){_0x3672d9[_0xab35('0xa')](arguments[_0x19bbe0]);_0x19bbe0++;}_0x6780db=util[_0xab35('0xb')][_0xab35('0xc')](util,_0x3672d9);this[_0xab35('0xd')]=_0x6780db;this[_0xab35('0xe')]=_0x2c3072;}module[_0xab35('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 330ca46..a016c06 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 _0xa902=['getdigits','vertices','prototype','addVertex','edges','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes','exports','lodash','../../../config/logger','agi','menu'];(function(_0x5d7316,_0x1d8a8c){var _0x22463a=function(_0x5d190b){while(--_0x5d190b){_0x5d7316['push'](_0x5d7316['shift']());}};_0x22463a(++_0x1d8a8c);}(_0xa902,0x8d));var _0x2a90=function(_0x10d371,_0x22e727){_0x10d371=_0x10d371-0x0;var _0x268600=_0xa902[_0x10d371];return _0x268600;};'use strict';var _=require(_0x2a90('0x0'));var logger=require(_0x2a90('0x1'))(_0x2a90('0x2'));var verticesWithRetry=[_0x2a90('0x3'),_0x2a90('0x4'),'getsecretdigits'];var Graph=function(){this[_0x2a90('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph[_0x2a90('0x6')][_0x2a90('0x7')]=function(_0x203ecf){this[_0x2a90('0x5')][_0x203ecf['id']]=_0x203ecf;this[_0x2a90('0x8')][_0x203ecf['id']]=[];};Graph[_0x2a90('0x6')]['addEdge']=function(_0x4109e6,_0x570659,_0x5ec2b9){this[_0x2a90('0x8')][_0x4109e6][_0x2a90('0x9')]({'target':_0x570659,'condition':_0x5ec2b9});this[_0x2a90('0xa')]+=0x1;};Graph[_0x2a90('0x6')][_0x2a90('0xb')]=function(){return _['size'](this[_0x2a90('0x5')]);};Graph[_0x2a90('0x6')][_0x2a90('0xc')]=function(){return this[_0x2a90('0xa')];};Graph['prototype'][_0x2a90('0xd')]=function(_0x52391c){return this[_0x2a90('0x5')][_0x52391c];};Graph['prototype'][_0x2a90('0xe')]=function(_0x57aee3,_0x407ce5){if(!this[_0x2a90('0x5')][_0x57aee3]){return logger[_0x2a90('0xf')]('no\x20vertex\x20found');}var _0x56d1b8=_0x407ce5(this['vertices'][_0x57aee3]);if(!_0x56d1b8){return logger[_0x2a90('0xf')](_0x2a90('0x10'));}if(this['edges'][_0x57aee3][_0x2a90('0x11')]===0x0){return logger[_0x2a90('0xf')](_0x2a90('0x12'));}for(var _0x25bd0e=0x0,_0x3200b4=[],_0x37858e=![];_0x25bd0e\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','production','log','SQUAREROOT','start','YYYY-MM-DD\x20HH:mm:ss','mxCell','LOOP\x20through\x20graph','traverseBFS','debug','vertex','VERTEX','context','extension','priority','vresponse','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','xml2json','lodash','util','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','format','[ERROR]\x20%s','info','[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','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0xb847,0x17e));var _0x7b84=function(_0x560d2a,_0x4a9f54){_0x560d2a=_0x560d2a-0x0;var _0x3df62d=_0xb847[_0x560d2a];return _0x3df62d;};'use strict';var parser=require(_0x7b84('0x0'));var _=require(_0x7b84('0x1'));var syncho=require('syncho');var util=require(_0x7b84('0x2'));var moment=require('moment');var config=require(_0x7b84('0x3'));var logger=require(_0x7b84('0x4'))(_0x7b84('0x5'));var utilLicense=require(_0x7b84('0x6'));var rpc=require(_0x7b84('0x7'));var mailRpc=require('./mailRpc');var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x7b84('0x5')]=_[_0x7b84('0x8')](config[_0x7b84('0x5')],{'ip':_0x7b84('0x9'),'port':0x11dd});function connectionHandler(_0x17bf9b){process[_0x7b84('0xa')](function(){syncho(function(){try{setChannelVariables(_0x17bf9b);agiHandler(_0x17bf9b);}catch(_0x2841e4){logger[_0x7b84('0xb')](_0x2841e4[_0x7b84('0xc')]);}});});}function listeningHandler(){console['log'](_0x7b84('0xd'),config[_0x7b84('0x5')][_0x7b84('0xe')]);logger['info'](util['format'](_0x7b84('0xf'),config['agi']['ip'],config[_0x7b84('0x5')][_0x7b84('0xe')]));}function errorHandler(_0x45f3da){if(_0x45f3da&&_0x45f3da[_0x7b84('0x10')]&&_0x45f3da[_0x7b84('0x11')]){logger['error'](util['format']('[%s]\x20%s',_0x45f3da[_0x7b84('0x10')],_0x45f3da[_0x7b84('0x11')]));}else{logger[_0x7b84('0xb')](util[_0x7b84('0x12')](_0x7b84('0x13'),_0x45f3da[_0x7b84('0xc')]));}}function closeHandler(){logger[_0x7b84('0x14')](util[_0x7b84('0x12')](_0x7b84('0x15'),this[_0x7b84('0x16')],this[_0x7b84('0x17')],this[_0x7b84('0x18')],this[_0x7b84('0x19')],this[_0x7b84('0x1a')]));try{createSquareReport(this);}catch(_0xb2569e){logger['error'](_0xb2569e['stack']);}}function timeoutHandler(){logger[_0x7b84('0x14')](util[_0x7b84('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this['calleridname'],this[_0x7b84('0x18')],this[_0x7b84('0x19')],this[_0x7b84('0x1a')]));}function hangupHandler(){logger[_0x7b84('0x14')](util[_0x7b84('0x12')](_0x7b84('0x1b'),this[_0x7b84('0x16')],this[_0x7b84('0x17')],this['callerid'],this[_0x7b84('0x19')],this[_0x7b84('0x1a')]));this[_0x7b84('0x1c')]=!![];}function getRoot(_0x53fb34){return parser[_0x7b84('0x1d')](_0x53fb34,{'object':!![]})[_0x7b84('0x1e')]['root'];}function addVertex(_0x1ac0a8,_0x4fb367,_0x12d084){_0x4fb367[_0x7b84('0x1f')]=_0x12d084;if(_0x4fb367[_0x7b84('0x20')]('retry')){_0x4fb367['maxRetry']=parseInt(_0x4fb367['retry'],0xa);}_0x1ac0a8[_0x7b84('0x21')](_[_0x7b84('0x22')](_0x4fb367,'mxCell'));}function initGraph(_0x1b11cc,_0x344c50){var _0x4d57f5=new Graph();for(var _0x5a2697 in _0x1b11cc){if(_0x1b11cc['hasOwnProperty'](_0x5a2697)){if(_[_0x7b84('0x23')](_0x1b11cc[_0x5a2697])){for(var _0xd0b996=0x0;_0xd0b996<_0x1b11cc[_0x5a2697][_0x7b84('0x24')];_0xd0b996+=0x1){addVertex(_0x4d57f5,_0x1b11cc[_0x5a2697][_0xd0b996],_0x5a2697);}}else{addVertex(_0x4d57f5,_0x1b11cc[_0x5a2697],_0x5a2697);}}}for(var _0x393b13=0x0;_0x393b13<_0x344c50[_0x7b84('0x24')];_0x393b13+=0x1){if(_0x344c50[_0x393b13]['source']&&_0x344c50[_0x393b13]['target']){_0x4d57f5['addEdge'](_0x344c50[_0x393b13]['source'],_0x344c50[_0x393b13][_0x7b84('0x25')],_0x344c50[_0x393b13][_0x7b84('0x26')]);}}return _0x4d57f5;}function getSquareProject(_0x4df1fd,_0x2ee2d5){rpc[_0x7b84('0x27')](_0x4df1fd)[_0x7b84('0x28')](function(_0x495c7d){_0x2ee2d5(null,_0x495c7d);})[_0x7b84('0x29')](function(_0x5c836e){_0x2ee2d5(null,_0x5c836e);});}function createSquareReport(_0x334cc2,_0x59a5bc){rpc['createSquareReport'](_0x334cc2)[_0x7b84('0x28')](function(_0x5c0bea){if(_0x59a5bc){_0x59a5bc(null,_0x5c0bea);}})[_0x7b84('0x29')](function(_0x193095){if(_0x59a5bc){_0x59a5bc(null,_0x193095);}});}function setChannelVariables(_0x20c388){for(var _0x11eb5e in _0x20c388){if(_0x20c388[_0x7b84('0x20')](_0x11eb5e)){if(_0x11eb5e['indexOf'](_0x7b84('0x2a'))===0x0){_0x20c388[_0x11eb5e['substring'](0x4)]=_0x20c388[_0x11eb5e];delete _0x20c388[_0x11eb5e];}}}}function getLogFromObject(_0x34528a){return util[_0x7b84('0x2b')](_0x34528a,{'showHidden':![],'depth':null});}function agiHandler(_0x554955){var _0x17fa40,_0x3029ad,_0x11e385,_0x1c01dd,_0x552b9d;logger['debug'](_0x7b84('0x2c'),JSON[_0x7b84('0x2d')](_0x554955,null,0x2));logger[_0x7b84('0x14')](util['format'](_0x7b84('0x2e'),_0x554955[_0x7b84('0x16')],_0x554955[_0x7b84('0x17')],_0x554955[_0x7b84('0x18')],_0x554955[_0x7b84('0x19')],_0x554955['uniqueid']));_0x554955['on'](_0x7b84('0xb'),errorHandler);_0x554955['on']('close',closeHandler);_0x554955['on'](_0x7b84('0x2f'),timeoutHandler);_0x554955[_0x7b84('0x1c')]=![];_0x554955['on'](_0x7b84('0x30'),hangupHandler);var _0x36c783=getSquareProject['sync'](null,_0x554955[_0x7b84('0x16')]);if(_0x36c783){if(_0x36c783[_0x7b84('0x31')]){_0x17fa40=getRoot(_0x36c783[_0x7b84('0x31')]);console[_0x7b84('0x32')](_0x7b84('0x33'),_0x17fa40);if(_0x17fa40&&_0x17fa40[_0x7b84('0x34')]){logger['debug']('root',JSON[_0x7b84('0x2d')](_0x17fa40,null,0x2));_0x554955['joinAt']=moment()[_0x7b84('0x12')](_0x7b84('0x35'));_0x3029ad=initGraph(_[_0x7b84('0x22')](_0x17fa40,_0x7b84('0x36')),_0x17fa40['mxCell']);_0x11e385=new Vertices(_0x554955,rpc,mailRpc);console[_0x7b84('0x32')]('vertices',_0x11e385);logger['info'](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x554955[_0x7b84('0x16')],_0x554955[_0x7b84('0x17')],_0x554955[_0x7b84('0x18')],_0x554955[_0x7b84('0x19')],_0x554955[_0x7b84('0x1a')]));console[_0x7b84('0x32')](_0x7b84('0x37'));_0x3029ad[_0x7b84('0x38')](_0x17fa40[_0x7b84('0x34')]['id'],function(_0xab01ea){try{_0xab01ea=_0x11e385['clear'](_0xab01ea);logger[_0x7b84('0x39')](_0x7b84('0x3a'),JSON[_0x7b84('0x2d')](_0xab01ea,null,0x2));console[_0x7b84('0x32')](_0x7b84('0x3b'),_0xab01ea);if(_0xab01ea[_0x7b84('0x1f')]==='gotoc'){logger[_0x7b84('0x14')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x554955[_0x7b84('0x3c')]=_0xab01ea[_0x7b84('0x3c')]||_0x554955[_0x7b84('0x3c')];_0x554955[_0x7b84('0x3d')]=_0xab01ea[_0x7b84('0x3d')];_0x554955['priority']=_0xab01ea[_0x7b84('0x3e')]?_0xab01ea[_0x7b84('0x3e')]-0x1:0x1;return null;}else if(_0xab01ea&&_0x11e385[_0xab01ea[_0x7b84('0x1f')]]){_0x552b9d=_0x11e385[_0xab01ea[_0x7b84('0x1f')]](_0xab01ea);console[_0x7b84('0x32')](_0x7b84('0x3f'),_0x552b9d);logger['info'](_0x7b84('0x40'),JSON['stringify'](_0x552b9d,null,0x2));if(_0x552b9d&&_0x552b9d[_0x7b84('0x41')]===AGI_CODE_SUCCESS&&_0x552b9d[_0x7b84('0x42')]!==AGI_RESULT_ERROR&&!_0x554955[_0x7b84('0x1c')]){logger[_0x7b84('0x39')](_0x7b84('0x40'),getLogFromObject(_0x552b9d));return _[_0x7b84('0x43')](_0x552b9d['result'])?null:_0x552b9d['result'][_0x7b84('0x44')]();}else{logger[_0x7b84('0xb')](_0x7b84('0x40'),getLogFromObject(_0x552b9d));return null;}}else{logger[_0x7b84('0xb')](_0x7b84('0x45'));return null;}}catch(_0xcd9373){logger[_0x7b84('0xb')](_0xcd9373[_0x7b84('0xc')]);return null;}});if(_0x17fa40[_0x7b84('0x46')]){logger[_0x7b84('0x14')](util[_0x7b84('0x12')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x554955[_0x7b84('0x16')],_0x554955[_0x7b84('0x17')],_0x554955[_0x7b84('0x18')],_0x554955[_0x7b84('0x19')],_0x554955['uniqueid']));_0x3029ad[_0x7b84('0x38')](_0x17fa40['finally']['id'],function(_0x2f27ee){try{_0x2f27ee=_0x11e385[_0x7b84('0x47')](_0x2f27ee);logger[_0x7b84('0x39')](_0x7b84('0x3a'),JSON['stringify'](_0x2f27ee,null,0x2));if(_0x2f27ee&&_0x11e385[_0x2f27ee[_0x7b84('0x1f')]]){_0x552b9d=_0x11e385[_0x2f27ee[_0x7b84('0x1f')]](_0x2f27ee);if(_0x552b9d){logger['debug'](_0x7b84('0x40'),getLogFromObject(_0x552b9d));return _[_0x7b84('0x43')](_0x552b9d[_0x7b84('0x42')])?null:_0x552b9d[_0x7b84('0x42')][_0x7b84('0x44')]();}else{logger[_0x7b84('0xb')](_0x7b84('0x40'),getLogFromObject(_0x552b9d));return null;}}else{logger[_0x7b84('0xb')](_0x7b84('0x45'));return null;}}catch(_0x4d5979){logger[_0x7b84('0xb')](_0x4d5979['stack']);return null;}});}logger[_0x7b84('0x14')](util[_0x7b84('0x12')](_0x7b84('0x48'),_0x554955[_0x7b84('0x16')],_0x554955[_0x7b84('0x17')],_0x554955['callerid'],_0x554955[_0x7b84('0x19')],_0x554955[_0x7b84('0x1a')]));logger[_0x7b84('0x14')](util[_0x7b84('0x12')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x554955[_0x7b84('0x3c')],_0x554955['extension'],parseInt(_0x554955[_0x7b84('0x3e')],0xa)+0x1));_0x554955['continueAt'](_0x554955[_0x7b84('0x3c')],_0x554955[_0x7b84('0x3d')],parseInt(_0x554955['priority'],0xa)+0x1);_0x554955[_0x7b84('0x49')]();}}else{logger[_0x7b84('0xb')](util[_0x7b84('0x12')]('Project\x20%s\x20not\x20published',_0x554955[_0x7b84('0x16')]));_0x554955[_0x7b84('0x4a')](_0x554955[_0x7b84('0x3c')],_0x554955['extension'],parseInt(_0x554955[_0x7b84('0x3e')],0xa)+0x1);_0x554955[_0x7b84('0x49')]();}}else{logger[_0x7b84('0xb')](util[_0x7b84('0x12')]('Project\x20%s\x20not\x20found',_0x554955[_0x7b84('0x16')]));_0x554955[_0x7b84('0x4a')](_0x554955[_0x7b84('0x3c')],_0x554955[_0x7b84('0x3d')],parseInt(_0x554955[_0x7b84('0x3e')],0xa)+0x1);_0x554955[_0x7b84('0x49')]();}}function main(){var _0xdc36d3;return utilLicense[_0x7b84('0x4b')]()[_0x7b84('0x28')](function(_0x48b585){if(_0x48b585){if(_0x48b585[_0x7b84('0x4c')]){if(_0x48b585[_0x7b84('0x4d')]&&_0x48b585[_0x7b84('0x4d')]>0x0){logger['info'](util['format'](_0x7b84('0x4e'),_0x48b585[_0x7b84('0x4d')]));_0xdc36d3=_0x48b585[_0x7b84('0x4d')];}else{logger['info'](_0x7b84('0x4f'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0xdc36d3=-0x1;}}})['catch'](function(_0x413796){logger[_0x7b84('0xb')](_0x7b84('0x50'),_0x413796[_0x7b84('0xc')]);})[_0x7b84('0x46')](function(){var _0x210f00=require(_0x7b84('0x51'))(config[_0x7b84('0x5')][_0x7b84('0xe')],config[_0x7b84('0x5')]['ip'],_0xdc36d3);_0x210f00['on']('error',errorHandler);_0x210f00['on'](_0x7b84('0x52'),listeningHandler);_0x210f00['on']('connection',connectionHandler);_0x210f00['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xe330=['mxCell','isArray','length','source','target','value','getSquareProject','catch','hasOwnProperty','indexOf','agi_','inspect','debug','variables','[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','start','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','vertices','traverseBFS','vertex','VERTEX','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','vresponse','response','code','result','isUndefined','toString','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','lodash','syncho','util','../../config/logger','agi','./rpc','./mailRpc','./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','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','retry','maxRetry','addVertex','omit'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xe330,0x96));var _0x0e33=function(_0x26a6ef,_0x406343){_0x26a6ef=_0x26a6ef-0x0;var _0x37eba3=_0xe330[_0x26a6ef];return _0x37eba3;};'use strict';var parser=require('xml2json');var _=require(_0x0e33('0x0'));var syncho=require(_0x0e33('0x1'));var util=require(_0x0e33('0x2'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x0e33('0x3'))(_0x0e33('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0x0e33('0x5'));var mailRpc=require(_0x0e33('0x6'));var Graph=require('./graph');var Vertices=require(_0x0e33('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0e33('0x4')]=_[_0x0e33('0x8')](config[_0x0e33('0x4')],{'ip':_0x0e33('0x9'),'port':0x11dd});function connectionHandler(_0x3e4028){process[_0x0e33('0xa')](function(){syncho(function(){try{setChannelVariables(_0x3e4028);agiHandler(_0x3e4028);}catch(_0x1edb09){logger[_0x0e33('0xb')](_0x1edb09[_0x0e33('0xc')]);}});});}function listeningHandler(){console[_0x0e33('0xd')](_0x0e33('0xe'),config['agi'][_0x0e33('0xf')]);logger[_0x0e33('0x10')](util[_0x0e33('0x11')](_0x0e33('0x12'),config['agi']['ip'],config[_0x0e33('0x4')][_0x0e33('0xf')]));}function errorHandler(_0x35526d){if(_0x35526d&&_0x35526d[_0x0e33('0x13')]&&_0x35526d['message']){logger[_0x0e33('0xb')](util[_0x0e33('0x11')]('[%s]\x20%s',_0x35526d[_0x0e33('0x13')],_0x35526d[_0x0e33('0x14')]));}else{logger[_0x0e33('0xb')](util[_0x0e33('0x11')](_0x0e33('0x15'),_0x35526d[_0x0e33('0xc')]));}}function closeHandler(){logger[_0x0e33('0x10')](util[_0x0e33('0x11')](_0x0e33('0x16'),this[_0x0e33('0x17')],this['calleridname'],this['callerid'],this[_0x0e33('0x18')],this[_0x0e33('0x19')]));try{createSquareReport(this);}catch(_0xa73fa5){logger[_0x0e33('0xb')](_0xa73fa5['stack']);}}function timeoutHandler(){logger[_0x0e33('0x10')](util[_0x0e33('0x11')](_0x0e33('0x1a'),this[_0x0e33('0x17')],this[_0x0e33('0x1b')],this[_0x0e33('0x1c')],this[_0x0e33('0x18')],this[_0x0e33('0x19')]));}function hangupHandler(){logger[_0x0e33('0x10')](util[_0x0e33('0x11')](_0x0e33('0x1d'),this['arg_1'],this['calleridname'],this[_0x0e33('0x1c')],this[_0x0e33('0x18')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x17c388){return parser['toJson'](_0x17c388,{'object':!![]})['mxGraphModel']['root'];}function addVertex(_0x113707,_0x3d0853,_0x5497bb){_0x3d0853['agicommand']=_0x5497bb;if(_0x3d0853['hasOwnProperty'](_0x0e33('0x1e'))){_0x3d0853[_0x0e33('0x1f')]=parseInt(_0x3d0853[_0x0e33('0x1e')],0xa);}_0x113707[_0x0e33('0x20')](_[_0x0e33('0x21')](_0x3d0853,_0x0e33('0x22')));}function initGraph(_0xd1ba81,_0x15f179){var _0x5f3a6f=new Graph();for(var _0x3ed8c2 in _0xd1ba81){if(_0xd1ba81['hasOwnProperty'](_0x3ed8c2)){if(_[_0x0e33('0x23')](_0xd1ba81[_0x3ed8c2])){for(var _0x38a78a=0x0;_0x38a78a<_0xd1ba81[_0x3ed8c2][_0x0e33('0x24')];_0x38a78a+=0x1){addVertex(_0x5f3a6f,_0xd1ba81[_0x3ed8c2][_0x38a78a],_0x3ed8c2);}}else{addVertex(_0x5f3a6f,_0xd1ba81[_0x3ed8c2],_0x3ed8c2);}}}for(var _0x1a76e3=0x0;_0x1a76e3<_0x15f179[_0x0e33('0x24')];_0x1a76e3+=0x1){if(_0x15f179[_0x1a76e3][_0x0e33('0x25')]&&_0x15f179[_0x1a76e3][_0x0e33('0x26')]){_0x5f3a6f['addEdge'](_0x15f179[_0x1a76e3]['source'],_0x15f179[_0x1a76e3][_0x0e33('0x26')],_0x15f179[_0x1a76e3][_0x0e33('0x27')]);}}return _0x5f3a6f;}function getSquareProject(_0x5c6a4f,_0x54afc4){rpc[_0x0e33('0x28')](_0x5c6a4f)['then'](function(_0x4458ad){_0x54afc4(null,_0x4458ad);})[_0x0e33('0x29')](function(_0x220107){_0x54afc4(null,_0x220107);});}function createSquareReport(_0x11f181,_0x143241){rpc['createSquareReport'](_0x11f181)['then'](function(_0x5de4ee){if(_0x143241){_0x143241(null,_0x5de4ee);}})[_0x0e33('0x29')](function(_0xd57367){if(_0x143241){_0x143241(null,_0xd57367);}});}function setChannelVariables(_0x3925d7){for(var _0x4d58e0 in _0x3925d7){if(_0x3925d7[_0x0e33('0x2a')](_0x4d58e0)){if(_0x4d58e0[_0x0e33('0x2b')](_0x0e33('0x2c'))===0x0){_0x3925d7[_0x4d58e0['substring'](0x4)]=_0x3925d7[_0x4d58e0];delete _0x3925d7[_0x4d58e0];}}}}function getLogFromObject(_0x1c5596){return util[_0x0e33('0x2d')](_0x1c5596,{'showHidden':![],'depth':null});}function agiHandler(_0x11a9d6){var _0x3cec31,_0x26bb78,_0x1bdd54,_0x4014c8,_0x2e59ef;logger[_0x0e33('0x2e')](_0x0e33('0x2f'),JSON['stringify'](_0x11a9d6,null,0x2));logger['info'](util['format'](_0x0e33('0x30'),_0x11a9d6[_0x0e33('0x17')],_0x11a9d6[_0x0e33('0x1b')],_0x11a9d6[_0x0e33('0x1c')],_0x11a9d6['dnid'],_0x11a9d6[_0x0e33('0x19')]));_0x11a9d6['on'](_0x0e33('0xb'),errorHandler);_0x11a9d6['on']('close',closeHandler);_0x11a9d6['on'](_0x0e33('0x31'),timeoutHandler);_0x11a9d6[_0x0e33('0x32')]=![];_0x11a9d6['on'](_0x0e33('0x33'),hangupHandler);var _0xb57a6d=getSquareProject[_0x0e33('0x34')](null,_0x11a9d6['arg_1']);if(_0xb57a6d){if(_0xb57a6d[_0x0e33('0x35')]){_0x3cec31=getRoot(_0xb57a6d['production']);console[_0x0e33('0xd')](_0x0e33('0x36'),_0x3cec31);if(_0x3cec31&&_0x3cec31[_0x0e33('0x37')]){logger['debug'](_0x0e33('0x38'),JSON[_0x0e33('0x39')](_0x3cec31,null,0x2));_0x11a9d6[_0x0e33('0x3a')]=moment()['format'](_0x0e33('0x3b'));_0x26bb78=initGraph(_[_0x0e33('0x21')](_0x3cec31,_0x0e33('0x22')),_0x3cec31[_0x0e33('0x22')]);_0x1bdd54=new Vertices(_0x11a9d6,rpc,mailRpc);console[_0x0e33('0xd')](_0x0e33('0x3c'),_0x1bdd54);logger['info'](util[_0x0e33('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x11a9d6['arg_1'],_0x11a9d6[_0x0e33('0x1b')],_0x11a9d6['callerid'],_0x11a9d6['dnid'],_0x11a9d6[_0x0e33('0x19')]));console['log']('LOOP\x20through\x20graph');_0x26bb78[_0x0e33('0x3d')](_0x3cec31['start']['id'],function(_0x167f69){try{_0x167f69=_0x1bdd54['clear'](_0x167f69);logger['debug'](_0x0e33('0x3e'),JSON['stringify'](_0x167f69,null,0x2));console[_0x0e33('0xd')](_0x0e33('0x3f'),_0x167f69);if(_0x167f69[_0x0e33('0x40')]===_0x0e33('0x41')){logger['info'](_0x0e33('0x42'));_0x11a9d6['context']=_0x167f69[_0x0e33('0x43')]||_0x11a9d6[_0x0e33('0x43')];_0x11a9d6[_0x0e33('0x44')]=_0x167f69[_0x0e33('0x44')];_0x11a9d6[_0x0e33('0x45')]=_0x167f69[_0x0e33('0x45')]?_0x167f69[_0x0e33('0x45')]-0x1:0x1;return null;}else if(_0x167f69&&_0x1bdd54[_0x167f69[_0x0e33('0x40')]]){_0x2e59ef=_0x1bdd54[_0x167f69[_0x0e33('0x40')]](_0x167f69);console[_0x0e33('0xd')](_0x0e33('0x46'),_0x2e59ef);logger['info'](_0x0e33('0x47'),JSON['stringify'](_0x2e59ef,null,0x2));if(_0x2e59ef&&_0x2e59ef[_0x0e33('0x48')]===AGI_CODE_SUCCESS&&_0x2e59ef[_0x0e33('0x49')]!==AGI_RESULT_ERROR&&!_0x11a9d6[_0x0e33('0x32')]){logger[_0x0e33('0x2e')]('response',getLogFromObject(_0x2e59ef));return _[_0x0e33('0x4a')](_0x2e59ef[_0x0e33('0x49')])?null:_0x2e59ef[_0x0e33('0x49')][_0x0e33('0x4b')]();}else{logger[_0x0e33('0xb')](_0x0e33('0x47'),getLogFromObject(_0x2e59ef));return null;}}else{logger[_0x0e33('0xb')]('agicommand\x20not\x20found');return null;}}catch(_0x283985){logger[_0x0e33('0xb')](_0x283985[_0x0e33('0xc')]);return null;}});if(_0x3cec31['finally']){logger['info'](util[_0x0e33('0x11')](_0x0e33('0x4c'),_0x11a9d6[_0x0e33('0x17')],_0x11a9d6['calleridname'],_0x11a9d6[_0x0e33('0x1c')],_0x11a9d6[_0x0e33('0x18')],_0x11a9d6[_0x0e33('0x19')]));_0x26bb78[_0x0e33('0x3d')](_0x3cec31['finally']['id'],function(_0x3956b7){try{_0x3956b7=_0x1bdd54['clear'](_0x3956b7);logger[_0x0e33('0x2e')]('vertex',JSON['stringify'](_0x3956b7,null,0x2));if(_0x3956b7&&_0x1bdd54[_0x3956b7['agicommand']]){_0x2e59ef=_0x1bdd54[_0x3956b7['agicommand']](_0x3956b7);if(_0x2e59ef){logger[_0x0e33('0x2e')](_0x0e33('0x47'),getLogFromObject(_0x2e59ef));return _[_0x0e33('0x4a')](_0x2e59ef[_0x0e33('0x49')])?null:_0x2e59ef[_0x0e33('0x49')][_0x0e33('0x4b')]();}else{logger[_0x0e33('0xb')](_0x0e33('0x47'),getLogFromObject(_0x2e59ef));return null;}}else{logger['error'](_0x0e33('0x4d'));return null;}}catch(_0x42c80a){logger['error'](_0x42c80a['stack']);return null;}});}logger['info'](util[_0x0e33('0x11')](_0x0e33('0x4e'),_0x11a9d6[_0x0e33('0x17')],_0x11a9d6[_0x0e33('0x1b')],_0x11a9d6['callerid'],_0x11a9d6[_0x0e33('0x18')],_0x11a9d6[_0x0e33('0x19')]));logger[_0x0e33('0x10')](util[_0x0e33('0x11')](_0x0e33('0x4f'),_0x11a9d6['context'],_0x11a9d6['extension'],parseInt(_0x11a9d6[_0x0e33('0x45')],0xa)+0x1));_0x11a9d6[_0x0e33('0x50')](_0x11a9d6[_0x0e33('0x43')],_0x11a9d6[_0x0e33('0x44')],parseInt(_0x11a9d6['priority'],0xa)+0x1);_0x11a9d6[_0x0e33('0x51')]();}}else{logger[_0x0e33('0xb')](util['format'](_0x0e33('0x52'),_0x11a9d6[_0x0e33('0x17')]));_0x11a9d6[_0x0e33('0x50')](_0x11a9d6[_0x0e33('0x43')],_0x11a9d6['extension'],parseInt(_0x11a9d6['priority'],0xa)+0x1);_0x11a9d6[_0x0e33('0x51')]();}}else{logger[_0x0e33('0xb')](util[_0x0e33('0x11')](_0x0e33('0x53'),_0x11a9d6[_0x0e33('0x17')]));_0x11a9d6[_0x0e33('0x50')](_0x11a9d6[_0x0e33('0x43')],_0x11a9d6[_0x0e33('0x44')],parseInt(_0x11a9d6[_0x0e33('0x45')],0xa)+0x1);_0x11a9d6[_0x0e33('0x51')]();}}function main(){var _0x402878;return utilLicense[_0x0e33('0x54')]()[_0x0e33('0x55')](function(_0x1a59c1){if(_0x1a59c1){if(_0x1a59c1[_0x0e33('0x56')]){if(_0x1a59c1[_0x0e33('0x57')]&&_0x1a59c1[_0x0e33('0x57')]>0x0){logger[_0x0e33('0x10')](util[_0x0e33('0x11')]('[LICENSE]\x20CHANNELS:\x20%s',_0x1a59c1['callysquare']));_0x402878=_0x1a59c1['callysquare'];}else{logger[_0x0e33('0x10')](_0x0e33('0x58'));}}else{logger['info'](_0x0e33('0x59'));_0x402878=-0x1;}}})[_0x0e33('0x29')](function(_0x3584a2){logger['error'](_0x0e33('0x5a'),_0x3584a2[_0x0e33('0xc')]);})[_0x0e33('0x5b')](function(){var _0xf321b0=require('./server')(config[_0x0e33('0x4')][_0x0e33('0xf')],config['agi']['ip'],_0x402878);_0xf321b0['on'](_0x0e33('0xb'),errorHandler);_0xf321b0['on']('listening',listeningHandler);_0xf321b0['on']('connection',connectionHandler);_0xf321b0['on'](_0x0e33('0x51'),closeHandler);});}main(); \ No newline at end of file diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 8fecc08..404ae6d 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 _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x584d68,_0x21088d){var _0x374130=function(_0x668787){while(--_0x668787){_0x584d68['push'](_0x584d68['shift']());}};_0x374130(++_0x21088d);}(_0x34e8,0x12c));var _0x834e=function(_0x18eb74,_0x3e9141){_0x18eb74=_0x18eb74-0x0;var _0x295259=_0x34e8[_0x18eb74];return _0x295259;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x2dea81,_0x3651a8){var _0x4534d7=function(_0x525ff0){while(--_0x525ff0){_0x2dea81['push'](_0x2dea81['shift']());}};_0x4534d7(++_0x3651a8);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 6e0455b..8d44cde 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 _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x4bb93d,_0x1cda9a){var _0x106b4f=function(_0x4aa8d1){while(--_0x4aa8d1){_0x4bb93d['push'](_0x4bb93d['shift']());}};_0x106b4f(++_0x1cda9a);}(_0x5f2f,0x73));var _0xf5f2=function(_0xe86b07,_0x28ad1f){_0xe86b07=_0xe86b07-0x0;var _0x128e88=_0x5f2f[_0xe86b07];return _0x128e88;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x528f23,_0x213659){var _0x556acd=function(_0x3770a2){while(--_0x3770a2){_0x528f23['push'](_0x528f23['shift']());}};_0x556acd(++_0x213659);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4d15de,_0x4c9914){_0x4d15de=_0x4d15de-0x0;var _0x5896d6=_0x5f2f[_0x4d15de];return _0x5896d6;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 49e4a90..ba85b7f 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 _0x6b6b=['getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','util','jayson/promise','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','log','rpcreq','GetContactByPhone','ShowTrunk'];(function(_0x325d8a,_0x555c37){var _0x3287e7=function(_0xc64171){while(--_0xc64171){_0x325d8a['push'](_0x325d8a['shift']());}};_0x3287e7(++_0x555c37);}(_0x6b6b,0x1a0));var _0xb6b6=function(_0x5ac77a,_0x10c7c1){_0x5ac77a=_0x5ac77a-0x0;var _0x830047=_0x6b6b[_0x5ac77a];return _0x830047;};'use strict';var BPromise=require(_0xb6b6('0x0'));var moment=require('moment');var _=require('lodash');var util=require(_0xb6b6('0x1'));var jayson=require(_0xb6b6('0x2'));var client=jayson['client'][_0xb6b6('0x3')]({'port':0x2329});function request(_0x3a965d,_0x571e8b){return new BPromise(function(_0x3d7d1b,_0x5063eb){return client[_0xb6b6('0x4')](_0x3a965d,_0x571e8b)[_0xb6b6('0x5')](function(_0x384861){if(_0x384861[_0xb6b6('0x6')]){return _0x5063eb(_0x384861[_0xb6b6('0x6')][_0xb6b6('0x7')]);}else{return _0x3d7d1b(_0x384861[_0xb6b6('0x8')]);}})[_0xb6b6('0x9')](function(_0x2bd1f4){return _0x5063eb(_0x2bd1f4);});});}exports[_0xb6b6('0xa')]=function(_0x2ac73b){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2ac73b},'attributes':[_0xb6b6('0xb')]}});};exports[_0xb6b6('0xc')]=function(_0x2088dc){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2088dc},'include':[{'model':_0xb6b6('0xd'),'as':_0xb6b6('0xe')}],'attributes':['id','name',_0xb6b6('0xf')]}});};exports[_0xb6b6('0x10')]=function(_0x147669){return request(_0xb6b6('0x11'),{'options':{'where':{'id':_0x147669},'attributes':[_0xb6b6('0x12')]}});};exports[_0xb6b6('0x13')]=function(_0x27b0b3){return request(_0xb6b6('0x14'),{'options':{'where':{'id':_0x27b0b3},'attributes':[_0xb6b6('0x12')]}});};exports[_0xb6b6('0x15')]=function(_0x1d432f){return request('ShowVariable',{'options':{'where':{'id':_0x1d432f},'attributes':['name']}});};exports[_0xb6b6('0x16')]=function(_0xeff0a8){return request(_0xb6b6('0x17'),{'options':{'where':{'id':_0xeff0a8},'attributes':[_0xb6b6('0x18')]}});};exports[_0xb6b6('0x19')]=function(_0x1b3f2f){return request(_0xb6b6('0x1a'),{'options':{'where':{'id':_0x1b3f2f},'attributes':[_0xb6b6('0x12')]}});};exports[_0xb6b6('0x1b')]=function(_0xc91d57){console[_0xb6b6('0x1c')](_0xb6b6('0x1d'),_0xc91d57);return request(_0xb6b6('0x1e'),{'options':{'where':{'phone':_0xc91d57['phone']},'attributes':['id']}});};exports['getTrunkById']=function(_0x3d9aa9){return request(_0xb6b6('0x1f'),{'options':{'where':{'id':_0x3d9aa9},'attributes':[_0xb6b6('0x12')]}});};exports[_0xb6b6('0x20')]=function(_0x5e1cd2){return request(_0xb6b6('0x21'),{'options':{'where':{'id':_0x5e1cd2},'attributes':[_0xb6b6('0x22')]}});};exports[_0xb6b6('0x23')]=function(_0x2deeb0){return request(_0xb6b6('0x24'),{'options':{'raw':![],'where':{'id':_0x2deeb0},'include':[{'model':'Interval','as':_0xb6b6('0x25')}]}});};exports[_0xb6b6('0x26')]=function(_0x127f20){return request('ShowSmsAccount',{'options':{'where':{'id':_0x127f20},'attributes':['id',_0xb6b6('0x12')]}});};exports['createSmsMessage']=function(_0x24c73a){return request(_0xb6b6('0x27'),{'body':_0x24c73a});};exports[_0xb6b6('0x28')]=function(_0x526a2a){return request(_0xb6b6('0x29'),{'body':_0x526a2a});};exports[_0xb6b6('0x2a')]=function(_0x427c2d){return request(_0xb6b6('0x2b'),{'body':_[_0xb6b6('0x2c')](_0x427c2d,{'project_name':_0x427c2d[_0xb6b6('0x2d')],'prev_project_name':_0x427c2d[_0xb6b6('0x2e')]||'','is_subproject':_0x427c2d[_0xb6b6('0x2e')]?!![]:![],'leaveAt':moment()[_0xb6b6('0x2f')](_0xb6b6('0x30'))})});};exports[_0xb6b6('0x31')]=function(_0x4b47d1){return request(_0xb6b6('0x32'),{'body':_0x4b47d1});};exports['createSquareMessage']=function(_0x180528){return request('CreateSquareMessage',{'body':_0x180528});};exports['createCmContact']=function(_0x19a947){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x19a947[_0xb6b6('0x33')],'ListId':_0x19a947[_0xb6b6('0x34')]}}})[_0xb6b6('0x5')](function(_0x501e6c){if(_0x501e6c){return _0x501e6c;}return request(_0xb6b6('0x35'),{'body':_0x19a947});});};exports[_0xb6b6('0x36')]=function(_0x4baa7a){return request(_0xb6b6('0x37'),{'options':{'where':{'id':_0x4baa7a},'attributes':['name']}});};exports[_0xb6b6('0x38')]=function(_0x4247f5,_0x36f91b){return request(_0xb6b6('0x39'),{'body':{'interface':_0x36f91b},'options':{'where':_0x4247f5}});};exports[_0xb6b6('0x3a')]=function(_0x118a4b,_0x2fcfd8,_0x1726a8){return request(_0xb6b6('0x3b'),{'body':{'type':_0x2fcfd8,'uniqueid':_0x1726a8},'options':{'where':_0x118a4b}});};exports[_0xb6b6('0x3c')]=function(_0x3700eb){return request(_0xb6b6('0x3d'),{'body':{},'options':{'where':_0x3700eb}});};exports[_0xb6b6('0x3e')]=function(_0x4e8d9b){return request(_0xb6b6('0x3f'),{'body':{},'options':{'where':_0x4e8d9b}});}; \ No newline at end of file +var _0xe0d4=['LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','message','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','dsn','ShowUser','log','rpcreq','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','ShowPause','agentPause','agentUnpause','agentLogout'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xe0d4,0x1a1));var _0x4e0d=function(_0x489c1d,_0x15b612){_0x489c1d=_0x489c1d-0x0;var _0x80ca8f=_0xe0d4[_0x489c1d];return _0x80ca8f;};'use strict';var BPromise=require(_0x4e0d('0x0'));var moment=require(_0x4e0d('0x1'));var _=require(_0x4e0d('0x2'));var util=require(_0x4e0d('0x3'));var jayson=require(_0x4e0d('0x4'));var client=jayson[_0x4e0d('0x5')][_0x4e0d('0x6')]({'port':0x2329});function request(_0x34b72f,_0x4bde41){return new BPromise(function(_0x14c4e5,_0x2aff42){return client['request'](_0x34b72f,_0x4bde41)[_0x4e0d('0x7')](function(_0x1c1b9b){if(_0x1c1b9b[_0x4e0d('0x8')]){return _0x2aff42(_0x1c1b9b['error'][_0x4e0d('0x9')]);}else{return _0x14c4e5(_0x1c1b9b['result']);}})['catch'](function(_0x475e96){return _0x2aff42(_0x475e96);});});}exports['getSquareProject']=function(_0xa7a93e){return request(_0x4e0d('0xa'),{'options':{'raw':![],'where':{'name':_0xa7a93e},'attributes':[_0x4e0d('0xb')]}});};exports[_0x4e0d('0xc')]=function(_0x554841){return request(_0x4e0d('0xd'),{'options':{'raw':![],'where':{'id':_0x554841},'include':[{'model':_0x4e0d('0xe'),'as':_0x4e0d('0xf')}],'attributes':['id',_0x4e0d('0x10'),_0x4e0d('0x11')]}});};exports[_0x4e0d('0x12')]=function(_0x137f43){return request(_0x4e0d('0xa'),{'options':{'where':{'id':_0x137f43},'attributes':[_0x4e0d('0x10')]}});};exports[_0x4e0d('0x13')]=function(_0x4f8f40){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x4f8f40},'attributes':[_0x4e0d('0x10')]}});};exports[_0x4e0d('0x14')]=function(_0x3a75f6){return request('ShowVariable',{'options':{'where':{'id':_0x3a75f6},'attributes':['name']}});};exports['getSquareOdbcById']=function(_0x3876ea){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x3876ea},'attributes':[_0x4e0d('0x15')]}});};exports['getUserById']=function(_0x56ea91){return request(_0x4e0d('0x16'),{'options':{'where':{'id':_0x56ea91},'attributes':[_0x4e0d('0x10')]}});};exports['getContactByPhone']=function(_0x5a4dfd){console[_0x4e0d('0x17')](_0x4e0d('0x18'),_0x5a4dfd);return request(_0x4e0d('0x19'),{'options':{'where':{'phone':_0x5a4dfd[_0x4e0d('0x1a')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x15325b){return request(_0x4e0d('0x1b'),{'options':{'where':{'id':_0x15325b},'attributes':[_0x4e0d('0x10')]}});};exports[_0x4e0d('0x1c')]=function(_0x52c719){return request(_0x4e0d('0x1d'),{'options':{'where':{'id':_0x52c719},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x4bea96){return request(_0x4e0d('0x1e'),{'options':{'raw':![],'where':{'id':_0x4bea96},'include':[{'model':_0x4e0d('0x1f'),'as':'Intervals'}]}});};exports[_0x4e0d('0x20')]=function(_0x577d74){return request('ShowSmsAccount',{'options':{'where':{'id':_0x577d74},'attributes':['id',_0x4e0d('0x10')]}});};exports[_0x4e0d('0x21')]=function(_0x1a72e0){return request(_0x4e0d('0x22'),{'body':_0x1a72e0});};exports[_0x4e0d('0x23')]=function(_0x3822a2){return request(_0x4e0d('0x24'),{'body':_0x3822a2});};exports[_0x4e0d('0x25')]=function(_0x3ed040){return request(_0x4e0d('0x26'),{'body':_['merge'](_0x3ed040,{'project_name':_0x3ed040['arg_1'],'prev_project_name':_0x3ed040[_0x4e0d('0x27')]||'','is_subproject':_0x3ed040[_0x4e0d('0x27')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x4e0d('0x28')]=function(_0x204075){return request(_0x4e0d('0x29'),{'body':_0x204075});};exports[_0x4e0d('0x2a')]=function(_0x4fd90f){return request(_0x4e0d('0x2b'),{'body':_0x4fd90f});};exports[_0x4e0d('0x2c')]=function(_0x1d6cde){return request(_0x4e0d('0x2d'),{'options':{'raw':![],'where':{'phone':_0x1d6cde[_0x4e0d('0x1a')],'ListId':_0x1d6cde[_0x4e0d('0x2e')]}}})[_0x4e0d('0x7')](function(_0x423e5f){if(_0x423e5f){return _0x423e5f;}return request('CreateCmContact',{'body':_0x1d6cde});});};exports['getPauseById']=function(_0x2bf01c){return request(_0x4e0d('0x2f'),{'options':{'where':{'id':_0x2bf01c},'attributes':['name']}});};exports['agentLogin']=function(_0xbfb656,_0x385f85){return request('LoginUser',{'body':{'interface':_0x385f85},'options':{'where':_0xbfb656}});};exports[_0x4e0d('0x30')]=function(_0x260605,_0x2ed4a2,_0x9e7ee3){return request('PauseUser',{'body':{'type':_0x2ed4a2,'uniqueid':_0x9e7ee3},'options':{'where':_0x260605}});};exports[_0x4e0d('0x31')]=function(_0x1efc51){return request('UnpauseUser',{'body':{},'options':{'where':_0x1efc51}});};exports[_0x4e0d('0x32')]=function(_0x40c342){return request(_0x4e0d('0x33'),{'body':{},'options':{'where':_0x40c342}});}; \ 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 8dcbb2e..f2ed56d 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 _0x34e5=['./lex'];(function(_0x580a59,_0x21266c){var _0x19da51=function(_0x772ac8){while(--_0x772ac8){_0x580a59['push'](_0x580a59['shift']());}};_0x19da51(++_0x21266c);}(_0x34e5,0x172));var _0x534e=function(_0x5a0f92,_0x17dc03){_0x5a0f92=_0x5a0f92-0x0;var _0x1e19df=_0x34e5[_0x5a0f92];return _0x1e19df;};var polly=require('./polly');var lex=require(_0x534e('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x70e0=['exports','./polly','./lex'];(function(_0x22896b,_0x721d11){var _0x2ce27b=function(_0x5f3149){while(--_0x5f3149){_0x22896b['push'](_0x22896b['shift']());}};_0x2ce27b(++_0x721d11);}(_0x70e0,0x17b));var _0x070e=function(_0x1c775a,_0x55a744){_0x1c775a=_0x1c775a-0x0;var _0x195dd9=_0x70e0[_0x1c775a];return _0x195dd9;};var polly=require(_0x070e('0x0'));var lex=require(_0x070e('0x1'));module[_0x070e('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 e5f5f86..005fff9 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 _0x5db8=['exports','./lib/api'];(function(_0x27c7b1,_0x37647c){var _0x325fc1=function(_0x324c5e){while(--_0x324c5e){_0x27c7b1['push'](_0x27c7b1['shift']());}};_0x325fc1(++_0x37647c);}(_0x5db8,0xbb));var _0x85db=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x5db8[_0x31cb5f];return _0x586042;};'use strict';var lex=require(_0x85db('0x0'));module[_0x85db('0x1')]=function(_0x2d48b1,_0x4f036f,_0x14ab3d,_0x16c069,_0x42c47f,_0x491c88){return lex(_0x2d48b1,_0x4f036f,_0x14ab3d,_0x16c069,_0x42c47f,_0x491c88);}; \ No newline at end of file +var _0xa588=['exports'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0xa588,0xe1));var _0x8a58=function(_0x2ae587,_0x44744c){_0x2ae587=_0x2ae587-0x0;var _0x121318=_0xa588[_0x2ae587];return _0x121318;};'use strict';var lex=require('./lib/api');module[_0x8a58('0x0')]=function(_0x3c5387,_0xd12c46,_0x11633d,_0x28a4e8,_0x2f8787,_0x40bfe3){return lex(_0x3c5387,_0xd12c46,_0x11633d,_0x28a4e8,_0x2f8787,_0x40bfe3);}; \ 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 cfdb8f8..2d06785 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 _0x9b25=['exports','LexRuntime','$LATEST','postText','slots','hasOwnProperty'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x9b25,0xf9));var _0x59b2=function(_0x203bd0,_0x24f853){_0x203bd0=_0x203bd0-0x0;var _0x2c2015=_0x9b25[_0x203bd0];return _0x2c2015;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x22af43,_0x5196ca){return new BPromise(function(_0x123c52,_0x481019){_0x22af43[_0x59b2('0x0')](_0x5196ca,function(_0x318108,_0x4bc8c1){if(_0x318108){_0x481019(_0x318108);}if(_0x4bc8c1[_0x59b2('0x1')]){for(const _0xf5355b in _0x4bc8c1[_0x59b2('0x1')]){if(_0x4bc8c1[_0x59b2('0x1')][_0x59b2('0x2')](_0xf5355b)){var _0xc38ae5=_0x4bc8c1['slots'][_0xf5355b];_0x4bc8c1['slot_'+_0xf5355b]=_0xc38ae5;}}}_0x123c52(_0x4bc8c1);});});}module[_0x59b2('0x3')]=function(_0x1a27d6,_0x5c4ed8,_0x586c55,_0x2929d2,_0x211c98,_0x98595c){var _0x1d0863=new AWS[(_0x59b2('0x4'))]({'accessKeyId':_0x5c4ed8,'secretAccessKey':_0x586c55,'region':_0x2929d2});var _0x1ea20a={'botAlias':_0x59b2('0x5'),'botName':_0x98595c,'inputText':_0x211c98,'userId':_0x1a27d6};return lexResult(_0x1d0863,_0x1ea20a);}; \ No newline at end of file +var _0x9d3e=['postText','slots','slot_','exports','LexRuntime','$LATEST','aws-sdk'];(function(_0x44127a,_0x2bd9d3){var _0x2f827f=function(_0x4c2ca5){while(--_0x4c2ca5){_0x44127a['push'](_0x44127a['shift']());}};_0x2f827f(++_0x2bd9d3);}(_0x9d3e,0xd1));var _0xe9d3=function(_0x458f94,_0x308fc5){_0x458f94=_0x458f94-0x0;var _0x48dd3b=_0x9d3e[_0x458f94];return _0x48dd3b;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xe9d3('0x0'));function lexResult(_0x2dd806,_0x2b53b4){return new BPromise(function(_0xd0a5f5,_0x352198){_0x2dd806[_0xe9d3('0x1')](_0x2b53b4,function(_0x32d6f8,_0x5848d0){if(_0x32d6f8){_0x352198(_0x32d6f8);}if(_0x5848d0[_0xe9d3('0x2')]){for(const _0x401fdd in _0x5848d0[_0xe9d3('0x2')]){if(_0x5848d0[_0xe9d3('0x2')]['hasOwnProperty'](_0x401fdd)){var _0x4e3cb6=_0x5848d0['slots'][_0x401fdd];_0x5848d0[_0xe9d3('0x3')+_0x401fdd]=_0x4e3cb6;}}}_0xd0a5f5(_0x5848d0);});});}module[_0xe9d3('0x4')]=function(_0x34faac,_0x36bc8e,_0x4f2147,_0xb236b5,_0x22b362,_0x1b2947){var _0x5c93f1=new AWS[(_0xe9d3('0x5'))]({'accessKeyId':_0x36bc8e,'secretAccessKey':_0x4f2147,'region':_0xb236b5});var _0xdfcfb5={'botAlias':_0xe9d3('0x6'),'botName':_0x1b2947,'inputText':_0x22b362,'userId':_0x34faac};return lexResult(_0x5c93f1,_0xdfcfb5);}; \ 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 1a20e64..a7d7a4f 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 _0x5467=['exports','./lib/api'];(function(_0x532c32,_0x35381d){var _0x188179=function(_0x31b4e3){while(--_0x31b4e3){_0x532c32['push'](_0x532c32['shift']());}};_0x188179(++_0x35381d);}(_0x5467,0x1b1));var _0x7546=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5467[_0x14add3];return _0x4a174f;};'use strict';var polly=require(_0x7546('0x0'));module[_0x7546('0x1')]=function(_0x225120,_0x5550b5,_0x589abe,_0x5b94e9,_0x42f933,_0xdd2e62,_0x2103c9){return polly(_0x225120,_0x5550b5,_0x589abe,_0x5b94e9,_0x42f933,_0xdd2e62,_0x2103c9);}; \ No newline at end of file +var _0x4534=['exports','./lib/api'];(function(_0x4fecba,_0x7d6438){var _0x1f0a44=function(_0x5c5e81){while(--_0x5c5e81){_0x4fecba['push'](_0x4fecba['shift']());}};_0x1f0a44(++_0x7d6438);}(_0x4534,0x141));var _0x4453=function(_0x1c4904,_0xbe307f){_0x1c4904=_0x1c4904-0x0;var _0xfbde31=_0x4534[_0x1c4904];return _0xfbde31;};'use strict';var polly=require(_0x4453('0x0'));module[_0x4453('0x1')]=function(_0x3097fc,_0x29f656,_0x516e12,_0x46eaf1,_0x2339f6,_0x3b1045,_0x26bdae){return polly(_0x3097fc,_0x29f656,_0x516e12,_0x46eaf1,_0x2339f6,_0x3b1045,_0x26bdae);}; \ 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 2ccdf4b..ff53057 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 _0x469d=['text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Polly'];(function(_0x2a3c46,_0x33f7c9){var _0x5bd7eb=function(_0x5dac2c){while(--_0x5dac2c){_0x2a3c46['push'](_0x2a3c46['shift']());}};_0x5bd7eb(++_0x33f7c9);}(_0x469d,0x66));var _0xd469=function(_0x4a464d,_0x5c28fc){_0x4a464d=_0x4a464d-0x0;var _0x354040=_0x469d[_0x4a464d];return _0x354040;};'use strict';var fs=require('fs');var path=require(_0xd469('0x0'));var BPromise=require(_0xd469('0x1'));var rs=require(_0xd469('0x2'));var AWS=require(_0xd469('0x3'));function pollyResult(_0x5b3811,_0x43347c,_0x132126){return new BPromise(function(_0xae8e31,_0x354358){_0x5b3811[_0xd469('0x4')](_0x43347c,function(_0x1af73b,_0x3a3e67){if(_0x1af73b){_0x354358(_0x1af73b);}else if(_0x3a3e67){if(_0x3a3e67[_0xd469('0x5')]instanceof Buffer){fs[_0xd469('0x6')](_0x132126,_0x3a3e67[_0xd469('0x5')],function(_0x4fbcff){if(_0x4fbcff){_0x354358(_0x4fbcff);}else{_0xae8e31();}});}else{_0x354358(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x354358(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x609b04,_0x5959dc,_0x2375a4,_0x311ad7,_0x1c9931,_0x5ad741,_0x16e5dd){var _0x109996=new AWS[(_0xd469('0x7'))]({'accessKeyId':_0x609b04,'secretAccessKey':_0x5959dc,'region':_0x2375a4});var _0x5242b0={'Text':_0x1c9931,'TextType':_0x5ad741||_0xd469('0x8'),'OutputFormat':_0xd469('0x9'),'VoiceId':_0x311ad7};return pollyResult(_0x109996,_0x5242b0,_0x16e5dd);}; \ No newline at end of file +var _0x06a6=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile'];(function(_0x73b5d4,_0x529098){var _0x4a079f=function(_0x1abf16){while(--_0x1abf16){_0x73b5d4['push'](_0x73b5d4['shift']());}};_0x4a079f(++_0x529098);}(_0x06a6,0xff));var _0x606a=function(_0x5a685b,_0xa579c2){_0x5a685b=_0x5a685b-0x0;var _0x27178c=_0x06a6[_0x5a685b];return _0x27178c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x606a('0x0'));var rs=require('randomstring');var AWS=require(_0x606a('0x1'));function pollyResult(_0x8e073e,_0x5e9fef,_0x5a36ca){return new BPromise(function(_0x3730cd,_0x5c75a5){_0x8e073e[_0x606a('0x2')](_0x5e9fef,function(_0x5487ad,_0x352dd4){if(_0x5487ad){_0x5c75a5(_0x5487ad);}else if(_0x352dd4){if(_0x352dd4[_0x606a('0x3')]instanceof Buffer){fs[_0x606a('0x4')](_0x5a36ca,_0x352dd4[_0x606a('0x3')],function(_0x4b19ed){if(_0x4b19ed){_0x5c75a5(_0x4b19ed);}else{_0x3730cd();}});}else{_0x5c75a5(new Error(_0x606a('0x5')));}}else{_0x5c75a5(new Error(_0x606a('0x6')));}});});}module['exports']=function(_0x25ec6b,_0x48d8e6,_0x476acf,_0x4fd5f0,_0x4e7903,_0x556ee1,_0x538ef9){var _0x5475fd=new AWS[(_0x606a('0x7'))]({'accessKeyId':_0x25ec6b,'secretAccessKey':_0x48d8e6,'region':_0x476acf});var _0xd46405={'Text':_0x4e7903,'TextType':_0x556ee1||_0x606a('0x8'),'OutputFormat':_0x606a('0x9'),'VoiceId':_0x4fd5f0};return pollyResult(_0x5475fd,_0xd46405,_0x538ef9);}; \ 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 99289e8..cc0adbe 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 _0x5d52=['./lib/api','exports'];(function(_0x1043c0,_0xe385cc){var _0x298b58=function(_0xd858fd){while(--_0xd858fd){_0x1043c0['push'](_0x1043c0['shift']());}};_0x298b58(++_0xe385cc);}(_0x5d52,0xd6));var _0x25d5=function(_0x24c086,_0x58503a){_0x24c086=_0x24c086-0x0;var _0x437816=_0x5d52[_0x24c086];return _0x437816;};'use strict';var asr=require(_0x25d5('0x0'));module[_0x25d5('0x1')]=function(_0x596fc8,_0xf67166,_0x3abbdb,_0x2ac610){return asr(_0x596fc8,_0xf67166,_0x3abbdb);}; \ No newline at end of file +var _0x9f20=['exports'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9f20,0x11a));var _0x09f2=function(_0x3b8050,_0x2ddb67){_0x3b8050=_0x3b8050-0x0;var _0x3c06f=_0x9f20[_0x3b8050];return _0x3c06f;};'use strict';var asr=require('./lib/api');module[_0x09f2('0x0')]=function(_0x38394f,_0x42fdf6,_0x151bf6,_0x5222ce){return asr(_0x38394f,_0x42fdf6,_0x151bf6);}; \ 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 c2b075f..7ebb8cb 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 _0x6b21=['/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','length','filepath\x20should\x20be\x20a\x20string','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x6b21,0x81));var _0x16b2=function(_0x588102,_0x5c5151){_0x588102=_0x588102-0x0;var _0x1ad0c5=_0x6b21[_0x588102];return _0x1ad0c5;};'use strict';var url=require('url');var BPromise=require(_0x16b2('0x0'));var fs=require('fs');var host=_0x16b2('0x1');module['exports']=function(_0x39397d,_0xd03974,_0x39490d){return new BPromise(function(_0x2bf974,_0x588a81){var _0x21edcb;if(typeof _0x39397d!=='string'||_0x39397d[_0x16b2('0x2')]===0x0){return _0x588a81(_0x16b2('0x3'));}if(typeof _0xd03974!==_0x16b2('0x4')||_0xd03974[_0x16b2('0x2')]===0x0){return _0x588a81('key\x20should\x20be\x20a\x20string');}if(typeof _0x39490d!==_0x16b2('0x5')&&(typeof _0x39490d!==_0x16b2('0x4')||_0x39490d[_0x16b2('0x2')]===0x0)){return _0x588a81(_0x16b2('0x6'));}try{_0x21edcb=fs[_0x16b2('0x7')](_0x39397d)[_0x16b2('0x8')](_0x16b2('0x9'));}catch(_0x29ddee){return _0x588a81(_0x29ddee);}return _0x2bf974({'method':_0x16b2('0xa'),'uri':host+_0x16b2('0xb')+_0xd03974,'body':{'config':{'encoding':_0x16b2('0xc'),'sampleRateHertz':_0x16b2('0xd'),'languageCode':_0x39490d},'audio':{'content':_0x21edcb}},'json':!![]});});}; \ No newline at end of file +var _0x7fad=['string','filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports'];(function(_0x511b43,_0x5c2e15){var _0x33498c=function(_0x418498){while(--_0x418498){_0x511b43['push'](_0x511b43['shift']());}};_0x33498c(++_0x5c2e15);}(_0x7fad,0x123));var _0xd7fa=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x7fad[_0x382a62];return _0x490a25;};'use strict';var url=require('url');var BPromise=require(_0xd7fa('0x0'));var fs=require('fs');var host=_0xd7fa('0x1');module[_0xd7fa('0x2')]=function(_0x3d175a,_0x1492c6,_0x4747e5){return new BPromise(function(_0x4df6f0,_0x5eefb4){var _0x276819;if(typeof _0x3d175a!==_0xd7fa('0x3')||_0x3d175a['length']===0x0){return _0x5eefb4(_0xd7fa('0x4'));}if(typeof _0x1492c6!==_0xd7fa('0x3')||_0x1492c6[_0xd7fa('0x5')]===0x0){return _0x5eefb4(_0xd7fa('0x6'));}if(typeof _0x4747e5!=='undefined'&&(typeof _0x4747e5!==_0xd7fa('0x3')||_0x4747e5[_0xd7fa('0x5')]===0x0)){return _0x5eefb4('lang\x20should\x20be\x20a\x20string');}try{_0x276819=fs[_0xd7fa('0x7')](_0x3d175a)[_0xd7fa('0x8')](_0xd7fa('0x9'));}catch(_0x40df92){return _0x5eefb4(_0x40df92);}return _0x4df6f0({'method':_0xd7fa('0xa'),'uri':host+_0xd7fa('0xb')+_0x1492c6,'body':{'config':{'encoding':_0xd7fa('0xc'),'sampleRateHertz':_0xd7fa('0xd'),'languageCode':_0x4747e5},'audio':{'content':_0x276819}},'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 01d7c32..c448fd6 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 _0xced7=['./asr','exports'];(function(_0x2cc31f,_0x8278db){var _0x5a2dd3=function(_0x4c609a){while(--_0x4c609a){_0x2cc31f['push'](_0x2cc31f['shift']());}};_0x5a2dd3(++_0x8278db);}(_0xced7,0xf2));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};var asr=require(_0x7ced('0x0'));module[_0x7ced('0x1')]={'asr':asr}; \ No newline at end of file +var _0xdd34=['./asr'];(function(_0x376d80,_0x2ebcd3){var _0x2a47fe=function(_0x2fbb7c){while(--_0x2fbb7c){_0x376d80['push'](_0x376d80['shift']());}};_0x2a47fe(++_0x2ebcd3);}(_0xdd34,0x1db));var _0x4dd3=function(_0x2f53fc,_0x2a34d7){_0x2f53fc=_0x2f53fc-0x0;var _0xa911c2=_0xdd34[_0x2f53fc];return _0xa911c2;};var asr=require(_0x4dd3('0x0'));module['exports']={'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 86cbc95..f818723 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 _0x4f41=['isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','CustomAction','channelData','CustomActionData','AudioFromTts','audiofile','dirName','http','https','bluebird','randomstring','sox','request-promise','util','querystring','google-tts-api','apiai-promise','md5','./google','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','request\x20to\x20','finish','info','finish\x20download\x20file','close','error','unlink','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','.mp3','audioContent','writeFile','googleTTS','goggleTTS\x20path','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','name','message','googleDialogflow','textRequest','result','source','action','speech','score','status','code','metadata'];(function(_0x28902f,_0x2a8dbf){var _0x4a4f6d=function(_0x21ece8){while(--_0x21ece8){_0x28902f['push'](_0x28902f['shift']());}};_0x4a4f6d(++_0x2a8dbf);}(_0x4f41,0x1b5));var _0x14f4=function(_0x48092d,_0x4e1c8a){_0x48092d=_0x48092d-0x0;var _0x2cb71c=_0x4f41[_0x48092d];return _0x2cb71c;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x14f4('0x0'));var https=require(_0x14f4('0x1'));var urlParse=require('url')['parse'];var BPromise=require(_0x14f4('0x2'));var rs=require(_0x14f4('0x3'));var sox=require(_0x14f4('0x4'));var rp=require(_0x14f4('0x5'));var util=require(_0x14f4('0x6'));var querystring=require(_0x14f4('0x7'));var tts=require(_0x14f4('0x8'));var apiai=require(_0x14f4('0x9'));var md5=require(_0x14f4('0xa'));var google=require(_0x14f4('0xb'));var aws=require('./aws');var tilde=require(_0x14f4('0xc'));var sestek=require(_0x14f4('0xd'));var logger=require(_0x14f4('0xe'))(_0x14f4('0xf'));var ISPEECH_API=_0x14f4('0x10');function downloadFile(_0x43e7dc,_0x368d0d){return new BPromise(function(_0xab2b75,_0x14b50f){var _0x11444e=urlParse(_0x43e7dc);var _0x4e0986=_0x11444e[_0x14f4('0x11')]===_0x14f4('0x12')?https:http;var _0x5513aa={'host':_0x11444e[_0x14f4('0x13')],'path':_0x11444e[_0x14f4('0x14')],'headers':{'user-agent':_0x14f4('0x15')}};_0x4e0986[_0x14f4('0x16')](_0x5513aa,function(_0xfe81c4){if(_0xfe81c4['statusCode']!==0xc8){logger['error']('request\x20to\x20'+_0x43e7dc+_0x14f4('0x17')+_0xfe81c4[_0x14f4('0x18')]+'\x20('+_0xfe81c4[_0x14f4('0x19')]+')');_0x14b50f(new Error(_0x14f4('0x1a')+_0x43e7dc+_0x14f4('0x17')+_0xfe81c4[_0x14f4('0x18')]+'\x20('+_0xfe81c4[_0x14f4('0x19')]+')'));return;}var _0x50216=fs['createWriteStream'](_0x368d0d);_0x50216['on'](_0x14f4('0x1b'),function(){logger[_0x14f4('0x1c')](_0x14f4('0x1d'));_0x50216[_0x14f4('0x1e')](_0xab2b75);});_0x50216['on'](_0x14f4('0x1f'),function(_0x3fa250){fs[_0x14f4('0x20')](_0x368d0d);logger[_0x14f4('0x1f')]('download\x20error',_0x3fa250);_0x14b50f(_0x3fa250);});_0xfe81c4[_0x14f4('0x21')](_0x50216);})['on'](_0x14f4('0x1f'),function(_0x2d4240){logger['error'](_0x2d4240);_0x14b50f(_0x2d4240);})[_0x14f4('0x22')]();});}function uploadFile(_0x490a03){return new BPromise(function(_0x1703ce,_0x5e511f){var _0x4db430=urlParse(_0x490a03);var _0x1f369c=_0x4db430['protocol']===_0x14f4('0x12')?https:http;var _0x234897={'host':_0x4db430[_0x14f4('0x13')],'path':_0x4db430[_0x14f4('0x14')],'headers':{'user-agent':_0x14f4('0x15')}};_0x1f369c[_0x14f4('0x16')](_0x234897,function(_0x542dd1){if(_0x542dd1[_0x14f4('0x18')]!==0xc8){_0x5e511f(new Error(_0x14f4('0x1a')+_0x490a03+'\x20failed,\x20status\x20code\x20=\x20'+_0x542dd1[_0x14f4('0x18')]+'\x20('+_0x542dd1['statusMessage']+')'));return;}var _0x2368ad='';_0x542dd1['on'](_0x14f4('0x23'),function(_0x2c89d1){_0x2368ad+=_0x2c89d1;});_0x542dd1['on'](_0x14f4('0x22'),function(){_0x1703ce(_0x2368ad);});})['on'](_0x14f4('0x1f'),function(_0x57af08){_0x5e511f(_0x57af08);})[_0x14f4('0x22')]();});}function convertFile(_0x4f513f,_0x4ce3e0){return new BPromise(function(_0x5b6b05,_0x5ad22e){var _0x230003=sox[_0x14f4('0x24')](_0x4f513f,_0x4ce3e0,{'sampleRate':0x1f40,'format':_0x14f4('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x230003['on'](_0x14f4('0x1f'),function(_0x3e8318){logger[_0x14f4('0x1f')](_0x14f4('0x26'),_0x3e8318);_0x5ad22e(_0x3e8318);});_0x230003['on'](_0x14f4('0x22'),function(){logger[_0x14f4('0x1c')](_0x14f4('0x27'));_0x5b6b05();});_0x230003[_0x14f4('0x28')]();});}function base64Decode(_0x9bbd03,_0x23abb4){var _0x8c7a6a=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs[_0x14f4('0x2b')](0x4)+_0x14f4('0x2c'));fs['writeFileSync'](_0x8c7a6a,_0x9bbd03,_0x14f4('0x2d'));return convertFile(_0x8c7a6a,_0x23abb4)[_0x14f4('0x2e')](function(){try{fs[_0x14f4('0x20')](_0x8c7a6a);fs[_0x14f4('0x2f')](_0x23abb4,_0x14f4('0x30'));}catch(_0x498c56){logger[_0x14f4('0x1f')](_0x498c56);}return _0x23abb4[_0x14f4('0x31')]('.')[0x0];});}function base64Encode(_0x268bad){var _0x224462=fs[_0x14f4('0x32')](_0x268bad);return new Buffer(_0x224462)[_0x14f4('0x33')]('base64');}exports['googleCloudTTS']=function(_0x31d1b9,_0x5dcb2a,_0x4c0e6f,_0x3fe003,_0x5a8927,_0x3de017){var _0x3dd2cd,_0x4c1853;var _0x49402a=_0x14f4('0x34');var _0x56d95b=_0x14f4('0x35')+_0x31d1b9;var _0x2d6915={};if(_0x5dcb2a==='ssml'){_0x2d6915[_0x14f4('0x36')]={'ssml':_0x4c0e6f};}else{_0x2d6915[_0x14f4('0x36')]={'text':_0x4c0e6f};};_0x2d6915[_0x14f4('0x37')]={'languageCode':_0x3fe003,'ssmlGender':_0x5a8927};_0x2d6915[_0x14f4('0x38')]={'audioEncoding':_0x14f4('0x39'),'sampleRateHertz':0x1f40};var _0xa24d5a={'url':_0x49402a+'text:synthesize'+_0x56d95b,'method':'POST','json':!![],'body':_0x2d6915};return rp(_0xa24d5a)['then'](function(_0x2befcf){return new BPromise(function(_0x2fcd4f,_0x130fd7){_0x3dd2cd=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs['generate'](0x4)+_0x14f4('0x3a'));var _0x5ac297=Buffer['from'](_0x2befcf[_0x14f4('0x3b')],_0x14f4('0x2d'));return fs[_0x14f4('0x3c')](_0x3dd2cd,_0x5ac297,function(_0x70f9e2){_0x130fd7(_0x70f9e2);},function(_0x35b434){fs['chmodSync'](_0x3dd2cd,_0x14f4('0x30'));_0x2fcd4f(_0x35b434);});});})[_0x14f4('0x2e')](function(_0x2519e0){_0x4c1853=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs['generate'](0x4)+_0x14f4('0x2c'));return convertFile(_0x3dd2cd,_0x4c1853);})[_0x14f4('0x2e')](function(){try{fs[_0x14f4('0x20')](_0x3dd2cd);fs['chmodSync'](_0x4c1853,'777');}catch(_0x280546){logger[_0x14f4('0x1f')](_0x280546);}logger[_0x14f4('0x1c')]('googleCloudTTS\x20path',_0x4c1853[_0x14f4('0x31')]('.')[0x0]);return _0x4c1853['split']('.')[0x0];});};exports[_0x14f4('0x3d')]=function(_0x4fce04,_0x583e9f){var _0x2e6d1d,_0x3e53b9;return tts(_0x4fce04,_0x583e9f||'en',0x1)['then'](function(_0x44d356){logger[_0x14f4('0x1c')](_0x44d356);_0x2e6d1d=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs['generate'](0x4)+_0x14f4('0x3a'));return downloadFile(_0x44d356,_0x2e6d1d);})[_0x14f4('0x2e')](function(){_0x3e53b9=path['resolve'](__dirname,'tmp',rs[_0x14f4('0x2b')](0x4)+_0x14f4('0x2c'));return convertFile(_0x2e6d1d,_0x3e53b9);})['then'](function(){try{fs['unlink'](_0x2e6d1d);fs[_0x14f4('0x2f')](_0x3e53b9,_0x14f4('0x30'));}catch(_0x57a5a2){logger[_0x14f4('0x1f')](_0x57a5a2);}logger[_0x14f4('0x1c')](_0x14f4('0x3e'),_0x3e53b9[_0x14f4('0x31')]('.')[0x0]);return _0x3e53b9['split']('.')[0x0];});};exports['googleASR']=function(_0x2f0465,_0x593d9f,_0x316280){return google[_0x14f4('0x3f')](_0x2f0465,_0x593d9f,_0x316280)[_0x14f4('0x2e')](function(_0x3e3e46){logger[_0x14f4('0x1c')](_0x3e3e46['uri']);return rp(_0x3e3e46);})['then'](function(_0x1d9120){var _0x201852='';var _0x923cd4=0x0;try{fs[_0x14f4('0x20')](_0x2f0465);}catch(_0x3570ff){logger[_0x14f4('0x1f')](_0x3570ff);}if(_0x1d9120&&_0x1d9120[_0x14f4('0x40')]){_0x201852=_0x1d9120[_0x14f4('0x40')][_0x14f4('0x41')](function(_0x301c0c){return _0x301c0c&&_0x301c0c[_0x14f4('0x42')][0x0]&&_0x301c0c[_0x14f4('0x42')][0x0][_0x14f4('0x43')]?_0x301c0c[_0x14f4('0x42')][0x0]['transcript']:'';})[_0x14f4('0x44')]('\x0a');_0x923cd4=_0x1d9120[_0x14f4('0x40')][_0x14f4('0x41')](function(_0x3f5b11){return _0x3f5b11&&_0x3f5b11[_0x14f4('0x42')][0x0]&&_0x3f5b11[_0x14f4('0x42')][0x0][_0x14f4('0x45')]?_0x3f5b11['alternatives'][0x0]['confidence']:0x0;})[_0x14f4('0x44')]('\x0a');}logger['info']('googleASR\x20transcription',_0x201852);logger[_0x14f4('0x1c')](_0x14f4('0x46'),_0x923cd4);return{'transcript':_0x201852,'confidence':_0x923cd4};})['catch'](function(_0x26bb7e){logger[_0x14f4('0x1f')]('[%s]\x20%s:%s',_0x26bb7e[_0x14f4('0x18')],_0x26bb7e[_0x14f4('0x47')],_0x26bb7e[_0x14f4('0x48')]);});};exports[_0x14f4('0x49')]=function(_0x5a7a72,_0x337562,_0x4a09e7,_0x152452){var _0x4c8465=apiai(_0x337562,{'language':_0x152452||'en'});return _0x4c8465[_0x14f4('0x4a')](_0x4a09e7,{'sessionId':md5(_0x5a7a72)})[_0x14f4('0x2e')](function(_0x1456cc){logger[_0x14f4('0x1c')](JSON['stringify'](_0x1456cc));return{'source':_0x1456cc[_0x14f4('0x4b')][_0x14f4('0x4c')],'resolvedQuery':_0x1456cc[_0x14f4('0x4b')]['resolvedQuery'],'action':_0x1456cc[_0x14f4('0x4b')][_0x14f4('0x4d')],'actionIncomplete':_0x1456cc[_0x14f4('0x4b')]['actionIncomplete'],'speech':_0x1456cc['result']['fulfillment'][_0x14f4('0x4e')],'score':_0x1456cc[_0x14f4('0x4b')][_0x14f4('0x4f')],'statusCode':_0x1456cc[_0x14f4('0x50')][_0x14f4('0x51')],'endConversation':_0x1456cc['result']['metadata']['endConversation']||![],'isFallbackIntent':_0x1456cc[_0x14f4('0x4b')][_0x14f4('0x52')][_0x14f4('0x53')]};});};exports[_0x14f4('0x54')]=function(_0x11e110,_0x1a304a,_0xf6945a,_0x5acd98){return tilde[_0x14f4('0x3f')](_0x11e110,_0x1a304a,_0xf6945a,_0x5acd98)['then'](function(_0x51f1c6){try{fs[_0x14f4('0x20')](_0x11e110);}catch(_0x2e7655){logger['error'](_0x2e7655);}logger[_0x14f4('0x1c')](_0x14f4('0x55'),_0x51f1c6[_0x14f4('0x43')]);logger['info']('Tilde\x20ASR\x20confidence',_0x51f1c6[_0x14f4('0x45')]);return _0x51f1c6;});};exports[_0x14f4('0x56')]=function(_0x4edade,_0x4f39eb,_0x2637a1,_0x301b2a,_0x39692f,_0x46dc38){var _0x5814c5=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x14f4('0x3a'));var _0x87fce5;return aws[_0x14f4('0x57')](_0x4edade,_0x4f39eb,_0x2637a1,_0x301b2a,_0x39692f,_0x46dc38,_0x5814c5)['then'](function(){_0x87fce5=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs[_0x14f4('0x2b')](0x4)+_0x14f4('0x2c'));return convertFile(_0x5814c5,_0x87fce5);})['then'](function(){try{fs[_0x14f4('0x20')](_0x5814c5);fs['chmodSync'](_0x87fce5,_0x14f4('0x30'));}catch(_0x2b13ba){logger[_0x14f4('0x1f')](_0x2b13ba);}return _0x87fce5[_0x14f4('0x31')]('.')[0x0];});};exports[_0x14f4('0x58')]=function(_0x4e6b9b,_0x368b10,_0x273f10,_0x63b69,_0x3dcb72,_0xce664e){return aws[_0x14f4('0x59')](_0x4e6b9b,_0x368b10,_0x273f10,_0x63b69,_0x3dcb72,_0xce664e)['then'](function(_0x549d2e){logger[_0x14f4('0x1c')](JSON['stringify'](_0x549d2e));return _0x549d2e;});};exports['ispeechTTS']=function(_0x3e725c,_0x3ed662,_0x456e79,_0x100800){var _0x44e4a7=util[_0x14f4('0x5a')](_0x14f4('0x5b'),ISPEECH_API,_0x3e725c,encodeURIComponent(_0x3ed662),_0x456e79,_0x100800);var _0x2e515a=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs[_0x14f4('0x2b')](0x4)+_0x14f4('0x3a'));var _0x17759a;return downloadFile(_0x44e4a7,_0x2e515a)['then'](function(){_0x17759a=path[_0x14f4('0x29')](__dirname,_0x14f4('0x2a'),rs['generate'](0x4)+_0x14f4('0x2c'));return convertFile(_0x2e515a,_0x17759a);})['then'](function(){try{fs[_0x14f4('0x20')](_0x2e515a);fs[_0x14f4('0x2f')](_0x17759a,_0x14f4('0x30'));}catch(_0x517683){logger[_0x14f4('0x1f')](_0x517683);}return _0x17759a['split']('.')[0x0];});};exports['ispeechASR']=function(_0x24f8e8,_0x2c758f,_0x14485d,_0x12c502){var _0x419096=util[_0x14f4('0x5a')](_0x14f4('0x5c'),ISPEECH_API,_0x2c758f,_0x14485d,base64Encode(_0x24f8e8),_0x12c502?util[_0x14f4('0x5a')](_0x14f4('0x5d'),encodeURIComponent(_0x12c502)):_0x14f4('0x5e'));return uploadFile(_0x419096)[_0x14f4('0x2e')](function(_0x3a22f3){return querystring['parse'](_0x3a22f3);});};exports[_0x14f4('0x5f')]=function(_0x2c0a88,_0x25e753){return sestek[_0x14f4('0x60')](_0x2c0a88,_0x25e753)[_0x14f4('0x2e')](function(_0x42ee39){logger[_0x14f4('0x1c')](JSON['stringify'](_0x42ee39));var _0x506671={'speech':_0x42ee39[_0x14f4('0x61')],'action':_0x42ee39['channelData']?_0x42ee39['channelData'][_0x14f4('0x62')]:undefined,'actiondata':_0x42ee39[_0x14f4('0x63')]?_0x42ee39['channelData'][_0x14f4('0x64')]:undefined};if(_0x42ee39[_0x14f4('0x63')]&&_0x42ee39[_0x14f4('0x63')]['AudioFromTts']){return base64Decode(_0x42ee39[_0x14f4('0x63')][_0x14f4('0x65')]['Data'],path['resolve'](__dirname,_0x14f4('0x2a'),rs[_0x14f4('0x2b')](0x4)+_0x14f4('0x2c')))['then'](function(_0x4c05b7){_0x506671[_0x14f4('0x66')]=_0x4c05b7;return _0x506671;});}return _0x506671;});};exports[_0x14f4('0x67')]=function(){return __dirname;}; \ No newline at end of file +var _0x39a6=['path','http','https','url','parse','randomstring','util','querystring','google-tts-api','apiai-promise','./google','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','get','data','transcode','wav','finish\x20to\x20convert','start','resolve','generate','.wav','base64','then','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','POST','tmp','writeFile','chmodSync','googleCloudTTS\x20path','googleTTS','.mp3','goggleTTS\x20path','asr','uri','results','map','alternatives','join','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','transcript','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','ispeechTTS','ispeechASR','format','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x39a6,0xd8));var _0x639a=function(_0x13ea34,_0x3a627e){_0x13ea34=_0x13ea34-0x0;var _0x1c4a8d=_0x39a6[_0x13ea34];return _0x1c4a8d;};'use strict';var fs=require('fs');var path=require(_0x639a('0x0'));var http=require(_0x639a('0x1'));var https=require(_0x639a('0x2'));var urlParse=require(_0x639a('0x3'))[_0x639a('0x4')];var BPromise=require('bluebird');var rs=require(_0x639a('0x5'));var sox=require('sox');var rp=require('request-promise');var util=require(_0x639a('0x6'));var querystring=require(_0x639a('0x7'));var tts=require(_0x639a('0x8'));var apiai=require(_0x639a('0x9'));var md5=require('md5');var google=require(_0x639a('0xa'));var aws=require(_0x639a('0xb'));var tilde=require('./tilde');var sestek=require(_0x639a('0xc'));var logger=require(_0x639a('0xd'))('agi');var ISPEECH_API=_0x639a('0xe');function downloadFile(_0x228889,_0x65deeb){return new BPromise(function(_0x4ee9e8,_0x261fe0){var _0x2e7f97=urlParse(_0x228889);var _0x35b90d=_0x2e7f97[_0x639a('0xf')]==='https:'?https:http;var _0x59d0e3={'host':_0x2e7f97[_0x639a('0x10')],'path':_0x2e7f97['path'],'headers':{'user-agent':_0x639a('0x11')}};_0x35b90d['get'](_0x59d0e3,function(_0x36097e){if(_0x36097e[_0x639a('0x12')]!==0xc8){logger[_0x639a('0x13')]('request\x20to\x20'+_0x228889+_0x639a('0x14')+_0x36097e[_0x639a('0x12')]+'\x20('+_0x36097e['statusMessage']+')');_0x261fe0(new Error(_0x639a('0x15')+_0x228889+_0x639a('0x14')+_0x36097e[_0x639a('0x12')]+'\x20('+_0x36097e[_0x639a('0x16')]+')'));return;}var _0x12fe95=fs[_0x639a('0x17')](_0x65deeb);_0x12fe95['on'](_0x639a('0x18'),function(){logger[_0x639a('0x19')](_0x639a('0x1a'));_0x12fe95[_0x639a('0x1b')](_0x4ee9e8);});_0x12fe95['on'](_0x639a('0x13'),function(_0x34ac6a){fs[_0x639a('0x1c')](_0x65deeb);logger['error'](_0x639a('0x1d'),_0x34ac6a);_0x261fe0(_0x34ac6a);});_0x36097e[_0x639a('0x1e')](_0x12fe95);})['on'](_0x639a('0x13'),function(_0x1c4daa){logger[_0x639a('0x13')](_0x1c4daa);_0x261fe0(_0x1c4daa);})[_0x639a('0x1f')]();});}function uploadFile(_0x1d6b6b){return new BPromise(function(_0x4c1853,_0x360e08){var _0x6ad517=urlParse(_0x1d6b6b);var _0x472ac1=_0x6ad517[_0x639a('0xf')]===_0x639a('0x20')?https:http;var _0x3e2518={'host':_0x6ad517[_0x639a('0x10')],'path':_0x6ad517[_0x639a('0x0')],'headers':{'user-agent':_0x639a('0x11')}};_0x472ac1[_0x639a('0x21')](_0x3e2518,function(_0x1d9469){if(_0x1d9469[_0x639a('0x12')]!==0xc8){_0x360e08(new Error(_0x639a('0x15')+_0x1d6b6b+'\x20failed,\x20status\x20code\x20=\x20'+_0x1d9469['statusCode']+'\x20('+_0x1d9469[_0x639a('0x16')]+')'));return;}var _0x1b6c6d='';_0x1d9469['on'](_0x639a('0x22'),function(_0x3537e6){_0x1b6c6d+=_0x3537e6;});_0x1d9469['on'](_0x639a('0x1f'),function(){_0x4c1853(_0x1b6c6d);});})['on'](_0x639a('0x13'),function(_0x16867b){_0x360e08(_0x16867b);})[_0x639a('0x1f')]();});}function convertFile(_0x532c5e,_0x29ed8c){return new BPromise(function(_0x54c9bb,_0x448bf3){var _0x37a679=sox[_0x639a('0x23')](_0x532c5e,_0x29ed8c,{'sampleRate':0x1f40,'format':_0x639a('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x37a679['on']('error',function(_0x32c885){logger[_0x639a('0x13')]('error\x20convert',_0x32c885);_0x448bf3(_0x32c885);});_0x37a679['on']('end',function(){logger['info'](_0x639a('0x25'));_0x54c9bb();});_0x37a679[_0x639a('0x26')]();});}function base64Decode(_0x3338c1,_0x5b07d4){var _0x11e358=path[_0x639a('0x27')](__dirname,'tmp',rs[_0x639a('0x28')](0x4)+_0x639a('0x29'));fs['writeFileSync'](_0x11e358,_0x3338c1,_0x639a('0x2a'));return convertFile(_0x11e358,_0x5b07d4)[_0x639a('0x2b')](function(){try{fs[_0x639a('0x1c')](_0x11e358);fs['chmodSync'](_0x5b07d4,_0x639a('0x2c'));}catch(_0x5b9c9a){logger[_0x639a('0x13')](_0x5b9c9a);}return _0x5b07d4[_0x639a('0x2d')]('.')[0x0];});}function base64Encode(_0x37e9a8){var _0xaad840=fs[_0x639a('0x2e')](_0x37e9a8);return new Buffer(_0xaad840)[_0x639a('0x2f')](_0x639a('0x2a'));}exports[_0x639a('0x30')]=function(_0x48c0bc,_0x41da8d,_0x1c1964,_0x48a4ac,_0x1d556b,_0x4f01b9){var _0x4dae0e,_0x377383;var _0x1983f5=_0x639a('0x31');var _0x274667=_0x639a('0x32')+_0x48c0bc;var _0x14838e={};if(_0x41da8d==='ssml'){_0x14838e[_0x639a('0x33')]={'ssml':_0x1c1964};}else{_0x14838e['input']={'text':_0x1c1964};};_0x14838e[_0x639a('0x34')]={'languageCode':_0x48a4ac,'ssmlGender':_0x1d556b};_0x14838e[_0x639a('0x35')]={'audioEncoding':_0x639a('0x36'),'sampleRateHertz':0x1f40};var _0x209129={'url':_0x1983f5+_0x639a('0x37')+_0x274667,'method':_0x639a('0x38'),'json':!![],'body':_0x14838e};return rp(_0x209129)[_0x639a('0x2b')](function(_0x3145fd){return new BPromise(function(_0x440ad5,_0x1d64e3){_0x4dae0e=path[_0x639a('0x27')](__dirname,_0x639a('0x39'),rs[_0x639a('0x28')](0x4)+'.mp3');var _0x491f1e=Buffer['from'](_0x3145fd['audioContent'],'base64');return fs[_0x639a('0x3a')](_0x4dae0e,_0x491f1e,function(_0xc806e8){_0x1d64e3(_0xc806e8);},function(_0x1efe80){fs[_0x639a('0x3b')](_0x4dae0e,_0x639a('0x2c'));_0x440ad5(_0x1efe80);});});})['then'](function(_0x4ff35d){_0x377383=path['resolve'](__dirname,_0x639a('0x39'),rs['generate'](0x4)+_0x639a('0x29'));return convertFile(_0x4dae0e,_0x377383);})[_0x639a('0x2b')](function(){try{fs[_0x639a('0x1c')](_0x4dae0e);fs[_0x639a('0x3b')](_0x377383,_0x639a('0x2c'));}catch(_0x3b156c){logger['error'](_0x3b156c);}logger[_0x639a('0x19')](_0x639a('0x3c'),_0x377383[_0x639a('0x2d')]('.')[0x0]);return _0x377383[_0x639a('0x2d')]('.')[0x0];});};exports[_0x639a('0x3d')]=function(_0x3026cd,_0x49c886){var _0x240f81,_0x5d12a1;return tts(_0x3026cd,_0x49c886||'en',0x1)[_0x639a('0x2b')](function(_0x548439){logger[_0x639a('0x19')](_0x548439);_0x240f81=path[_0x639a('0x27')](__dirname,'tmp',rs[_0x639a('0x28')](0x4)+_0x639a('0x3e'));return downloadFile(_0x548439,_0x240f81);})['then'](function(){_0x5d12a1=path[_0x639a('0x27')](__dirname,'tmp',rs[_0x639a('0x28')](0x4)+'.wav');return convertFile(_0x240f81,_0x5d12a1);})[_0x639a('0x2b')](function(){try{fs[_0x639a('0x1c')](_0x240f81);fs[_0x639a('0x3b')](_0x5d12a1,_0x639a('0x2c'));}catch(_0xa0f230){logger[_0x639a('0x13')](_0xa0f230);}logger[_0x639a('0x19')](_0x639a('0x3f'),_0x5d12a1[_0x639a('0x2d')]('.')[0x0]);return _0x5d12a1[_0x639a('0x2d')]('.')[0x0];});};exports['googleASR']=function(_0x43ee70,_0x8358dd,_0x38ab77){return google[_0x639a('0x40')](_0x43ee70,_0x8358dd,_0x38ab77)[_0x639a('0x2b')](function(_0x33af73){logger[_0x639a('0x19')](_0x33af73[_0x639a('0x41')]);return rp(_0x33af73);})['then'](function(_0x495d44){var _0x3c42ca='';var _0xa92d4a=0x0;try{fs['unlink'](_0x43ee70);}catch(_0x52e073){logger['error'](_0x52e073);}if(_0x495d44&&_0x495d44[_0x639a('0x42')]){_0x3c42ca=_0x495d44['results'][_0x639a('0x43')](function(_0x974a79){return _0x974a79&&_0x974a79[_0x639a('0x44')][0x0]&&_0x974a79['alternatives'][0x0]['transcript']?_0x974a79[_0x639a('0x44')][0x0]['transcript']:'';})[_0x639a('0x45')]('\x0a');_0xa92d4a=_0x495d44[_0x639a('0x42')]['map'](function(_0x46cb25){return _0x46cb25&&_0x46cb25[_0x639a('0x44')][0x0]&&_0x46cb25['alternatives'][0x0]['confidence']?_0x46cb25[_0x639a('0x44')][0x0][_0x639a('0x46')]:0x0;})[_0x639a('0x45')]('\x0a');}logger[_0x639a('0x19')](_0x639a('0x47'),_0x3c42ca);logger[_0x639a('0x19')]('googleASR\x20confidence',_0xa92d4a);return{'transcript':_0x3c42ca,'confidence':_0xa92d4a};})[_0x639a('0x48')](function(_0xb8c987){logger['error'](_0x639a('0x49'),_0xb8c987['statusCode'],_0xb8c987['name'],_0xb8c987['message']);});};exports[_0x639a('0x4a')]=function(_0x12c826,_0x5c3b55,_0xff3d7b,_0x7f8b65){var _0x32cf63=apiai(_0x5c3b55,{'language':_0x7f8b65||'en'});return _0x32cf63[_0x639a('0x4b')](_0xff3d7b,{'sessionId':md5(_0x12c826)})[_0x639a('0x2b')](function(_0x3bae6f){logger[_0x639a('0x19')](JSON[_0x639a('0x4c')](_0x3bae6f));return{'source':_0x3bae6f[_0x639a('0x4d')][_0x639a('0x4e')],'resolvedQuery':_0x3bae6f[_0x639a('0x4d')][_0x639a('0x4f')],'action':_0x3bae6f['result']['action'],'actionIncomplete':_0x3bae6f[_0x639a('0x4d')][_0x639a('0x50')],'speech':_0x3bae6f[_0x639a('0x4d')][_0x639a('0x51')][_0x639a('0x52')],'score':_0x3bae6f[_0x639a('0x4d')][_0x639a('0x53')],'statusCode':_0x3bae6f[_0x639a('0x54')]['code'],'endConversation':_0x3bae6f[_0x639a('0x4d')][_0x639a('0x55')]['endConversation']||![],'isFallbackIntent':_0x3bae6f[_0x639a('0x4d')]['metadata'][_0x639a('0x56')]};});};exports[_0x639a('0x57')]=function(_0x5f0193,_0x592dde,_0x1b4b09,_0x46012c){return tilde['asr'](_0x5f0193,_0x592dde,_0x1b4b09,_0x46012c)['then'](function(_0x3085aa){try{fs[_0x639a('0x1c')](_0x5f0193);}catch(_0x20e6bc){logger[_0x639a('0x13')](_0x20e6bc);}logger[_0x639a('0x19')](_0x639a('0x58'),_0x3085aa[_0x639a('0x59')]);logger[_0x639a('0x19')](_0x639a('0x5a'),_0x3085aa[_0x639a('0x46')]);return _0x3085aa;});};exports[_0x639a('0x5b')]=function(_0x138fcf,_0x8652bf,_0x59517d,_0x2a7330,_0x45dd49,_0xe09e27){var _0x1a52c3=path[_0x639a('0x27')](__dirname,_0x639a('0x39'),rs[_0x639a('0x28')](0x4)+_0x639a('0x3e'));var _0x13d86f;return aws[_0x639a('0x5c')](_0x138fcf,_0x8652bf,_0x59517d,_0x2a7330,_0x45dd49,_0xe09e27,_0x1a52c3)[_0x639a('0x2b')](function(){_0x13d86f=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x1a52c3,_0x13d86f);})[_0x639a('0x2b')](function(){try{fs[_0x639a('0x1c')](_0x1a52c3);fs[_0x639a('0x3b')](_0x13d86f,_0x639a('0x2c'));}catch(_0x13b115){logger[_0x639a('0x13')](_0x13b115);}return _0x13d86f[_0x639a('0x2d')]('.')[0x0];});};exports[_0x639a('0x5d')]=function(_0x37cc98,_0x505731,_0x42eec8,_0x2eefa4,_0x2abaa9,_0x375bb6){return aws['lex'](_0x37cc98,_0x505731,_0x42eec8,_0x2eefa4,_0x2abaa9,_0x375bb6)[_0x639a('0x2b')](function(_0x2f5319){logger[_0x639a('0x19')](JSON[_0x639a('0x4c')](_0x2f5319));return _0x2f5319;});};exports[_0x639a('0x5e')]=function(_0x467625,_0x39e3d6,_0x592c4b,_0x695453){var _0x50714e=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x467625,encodeURIComponent(_0x39e3d6),_0x592c4b,_0x695453);var _0x5beda2=path[_0x639a('0x27')](__dirname,'tmp',rs['generate'](0x4)+_0x639a('0x3e'));var _0x44e2ae;return downloadFile(_0x50714e,_0x5beda2)[_0x639a('0x2b')](function(){_0x44e2ae=path[_0x639a('0x27')](__dirname,_0x639a('0x39'),rs[_0x639a('0x28')](0x4)+_0x639a('0x29'));return convertFile(_0x5beda2,_0x44e2ae);})[_0x639a('0x2b')](function(){try{fs[_0x639a('0x1c')](_0x5beda2);fs[_0x639a('0x3b')](_0x44e2ae,_0x639a('0x2c'));}catch(_0x1700d1){logger[_0x639a('0x13')](_0x1700d1);}return _0x44e2ae[_0x639a('0x2d')]('.')[0x0];});};exports[_0x639a('0x5f')]=function(_0x348e3d,_0xa431e0,_0x257328,_0x5c39d9){var _0x5e4620=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0xa431e0,_0x257328,base64Encode(_0x348e3d),_0x5c39d9?util[_0x639a('0x60')]('model=%s',encodeURIComponent(_0x5c39d9)):_0x639a('0x61'));return uploadFile(_0x5e4620)[_0x639a('0x2b')](function(_0x31b02b){return querystring['parse'](_0x31b02b);});};exports[_0x639a('0x62')]=function(_0x27dca8,_0x22dbd0){return sestek[_0x639a('0x63')](_0x27dca8,_0x22dbd0)[_0x639a('0x2b')](function(_0x5e493b){logger[_0x639a('0x19')](JSON[_0x639a('0x4c')](_0x5e493b));var _0x1dce81={'speech':_0x5e493b[_0x639a('0x64')],'action':_0x5e493b[_0x639a('0x65')]?_0x5e493b[_0x639a('0x65')][_0x639a('0x66')]:undefined,'actiondata':_0x5e493b[_0x639a('0x65')]?_0x5e493b[_0x639a('0x65')][_0x639a('0x67')]:undefined};if(_0x5e493b[_0x639a('0x65')]&&_0x5e493b['channelData'][_0x639a('0x68')]){return base64Decode(_0x5e493b[_0x639a('0x65')][_0x639a('0x68')][_0x639a('0x69')],path['resolve'](__dirname,'tmp',rs[_0x639a('0x28')](0x4)+'.wav'))[_0x639a('0x2b')](function(_0x361dbb){_0x1dce81[_0x639a('0x6a')]=_0x361dbb;return _0x1dce81;});}return _0x1dce81;});};exports[_0x639a('0x6b')]=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 913973e..423fa29 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 _0x199e=['./nda'];(function(_0x36f93d,_0x106c9e){var _0x1be721=function(_0x23359d){while(--_0x23359d){_0x36f93d['push'](_0x36f93d['shift']());}};_0x1be721(++_0x106c9e);}(_0x199e,0x1ec));var _0xe199=function(_0x31bab3,_0x44554f){_0x31bab3=_0x31bab3-0x0;var _0x4fd382=_0x199e[_0x31bab3];return _0x4fd382;};var nda=require(_0xe199('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x238e=['./nda','exports'];(function(_0x54a5fe,_0x2f8352){var _0x49a747=function(_0x29d200){while(--_0x29d200){_0x54a5fe['push'](_0x54a5fe['shift']());}};_0x49a747(++_0x2f8352);}(_0x238e,0x16c));var _0xe238=function(_0x12f380,_0x59fdcf){_0x12f380=_0x12f380-0x0;var _0xf1f215=_0x238e[_0x12f380];return _0xf1f215;};var nda=require(_0xe238('0x0'));module[_0xe238('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 d28126c..11d9414 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 _0xbc71=['Nda','uniqueid','callerid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x251b4f,_0x4ffab4){var _0xac541e=function(_0x5994cc){while(--_0x5994cc){_0x251b4f['push'](_0x251b4f['shift']());}};_0xac541e(++_0x4ffab4);}(_0xbc71,0x11b));var _0x1bc7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xbc71[_0x1d1779];return _0x2377e9;};'use strict';var rp=require('request-promise');var url=require(_0x1bc7('0x0'));var logger=require(_0x1bc7('0x1'))(_0x1bc7('0x2'));module[_0x1bc7('0x3')]=function(_0x1875fa,_0x59507c){var _0x1efbe={'method':_0x1bc7('0x4'),'uri':url[_0x1bc7('0x5')](_0x59507c[_0x1bc7('0x6')],_0x1bc7('0x7')),'form':{'grant_type':_0x1bc7('0x8'),'username':_0x59507c['username'],'password':_0x59507c[_0x1bc7('0x8')]},'json':!![]};return rp(_0x1efbe)[_0x1bc7('0x9')](function(_0x4cf367){var _0x327fd8={'method':_0x1bc7('0x4'),'uri':url[_0x1bc7('0x5')](_0x59507c[_0x1bc7('0xa')],_0x1bc7('0xb')),'body':{'type':_0x59507c[_0x1bc7('0xc')]||_0x1bc7('0xd'),'channelId':_0x1bc7('0xe'),'conversation':{'id':_0x1875fa[_0x1bc7('0xf')]},'from':{'id':_0x1875fa[_0x1bc7('0x10')],'name':_0x1875fa['calleridname']},'recipient':{'id':_0x1875fa['dnid'],'name':_0x1875fa[_0x1bc7('0x11')]},'text':_0x59507c[_0x1bc7('0x12')],'channelData':{}},'headers':{'Authorization':_0x1bc7('0x13')+_0x4cf367[_0x1bc7('0x14')]},'json':!![]};if(_0x59507c[_0x1bc7('0x15')]){_0x327fd8[_0x1bc7('0x16')][_0x1bc7('0x17')][_0x1bc7('0x18')]=_0x59507c[_0x1bc7('0x15')];}if(_0x59507c[_0x1bc7('0x19')]=='1'){_0x327fd8['body'][_0x1bc7('0x17')][_0x1bc7('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x1bc7('0x1b')};}if(_0x59507c[_0x1bc7('0x1c')]){_0x327fd8['body'][_0x1bc7('0x17')][_0x1bc7('0x1d')]=_0x59507c['custom_action'];if(_0x59507c[_0x1bc7('0x1e')]){_0x327fd8[_0x1bc7('0x16')][_0x1bc7('0x17')][_0x1bc7('0x1f')]=_0x59507c[_0x1bc7('0x1e')];}}logger['info'](JSON[_0x1bc7('0x20')](_0x327fd8));return rp(_0x327fd8);});}; \ No newline at end of file +var _0x230d=['request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','uniqueid','callerid','calleridname','dnid','text','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','custom_action_data','CustomActionData'];(function(_0x42118e,_0x4dfb3e){var _0x524646=function(_0x279674){while(--_0x279674){_0x42118e['push'](_0x42118e['shift']());}};_0x524646(++_0x4dfb3e);}(_0x230d,0x8c));var _0xd230=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x230d[_0x40a045];return _0x1a687c;};'use strict';var rp=require(_0xd230('0x0'));var url=require(_0xd230('0x1'));var logger=require(_0xd230('0x2'))(_0xd230('0x3'));module[_0xd230('0x4')]=function(_0x24c44d,_0x13863b){var _0x3c805b={'method':_0xd230('0x5'),'uri':url[_0xd230('0x6')](_0x13863b[_0xd230('0x7')],_0xd230('0x8')),'form':{'grant_type':_0xd230('0x9'),'username':_0x13863b[_0xd230('0xa')],'password':_0x13863b['password']},'json':!![]};return rp(_0x3c805b)[_0xd230('0xb')](function(_0x51382f){var _0x33d17f={'method':_0xd230('0x5'),'uri':url[_0xd230('0x6')](_0x13863b['ndassistant_url'],_0xd230('0xc')),'body':{'type':_0x13863b[_0xd230('0xd')]||'message','channelId':'Nda','conversation':{'id':_0x24c44d[_0xd230('0xe')]},'from':{'id':_0x24c44d[_0xd230('0xf')],'name':_0x24c44d[_0xd230('0x10')]},'recipient':{'id':_0x24c44d[_0xd230('0x11')],'name':_0x24c44d['extension']},'text':_0x13863b[_0xd230('0x12')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x51382f[_0xd230('0x13')]},'json':!![]};if(_0x13863b['project']){_0x33d17f[_0xd230('0x14')][_0xd230('0x15')][_0xd230('0x16')]=_0x13863b[_0xd230('0x17')];}if(_0x13863b[_0xd230('0x18')]=='1'){_0x33d17f[_0xd230('0x14')][_0xd230('0x15')][_0xd230('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x13863b['custom_action']){_0x33d17f[_0xd230('0x14')]['channelData']['CustomAction']=_0x13863b['custom_action'];if(_0x13863b[_0xd230('0x1a')]){_0x33d17f['body'][_0xd230('0x15')][_0xd230('0x1b')]=_0x13863b[_0xd230('0x1a')];}}logger['info'](JSON['stringify'](_0x33d17f));return rp(_0x33d17f);});}; \ 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 d10c52a..4e32d06 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 _0x7f14=['exports'];(function(_0x232b67,_0x3dc89e){var _0x39fcc0=function(_0x3e20c6){while(--_0x3e20c6){_0x232b67['push'](_0x232b67['shift']());}};_0x39fcc0(++_0x3dc89e);}(_0x7f14,0x18b));var _0x47f1=function(_0x54784a,_0x3e9ab4){_0x54784a=_0x54784a-0x0;var _0x1044ed=_0x7f14[_0x54784a];return _0x1044ed;};'use strict';var asr=require('./lib/api');module[_0x47f1('0x0')]=function(_0x4e8c3f,_0x177c5a,_0xbbbc53,_0x2ddc38){return asr(_0x4e8c3f,_0x177c5a,_0xbbbc53,_0x2ddc38);}; \ No newline at end of file +var _0x5e8f=['./lib/api'];(function(_0x7b8a87,_0x2f2523){var _0x2131a1=function(_0x856847){while(--_0x856847){_0x7b8a87['push'](_0x7b8a87['shift']());}};_0x2131a1(++_0x2f2523);}(_0x5e8f,0x140));var _0xf5e8=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0x5e8f[_0x28e2cd];return _0x11fd46;};'use strict';var asr=require(_0xf5e8('0x0'));module['exports']=function(_0x25f170,_0x5f102a,_0x52cc83,_0x11bb43){return asr(_0x25f170,_0x5f102a,_0x52cc83,_0x11bb43);}; \ 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 3395d7c..7095b66 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 _0x42af=['Tilde\x20ASR\x20hypoteses','stringify','result','hypotheses','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','open','message','lodash','moment','crypto','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','Tilde\x20ASR\x20send\x20error','terminate','parse','status','final'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0x42af,0xd9));var _0xf42a=function(_0x597bb7,_0x10a9b5){_0x597bb7=_0x597bb7-0x0;var _0x2f49e0=_0x42af[_0x597bb7];return _0x2f49e0;};'use strict';var BPromise=require('bluebird');var _=require(_0xf42a('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf42a('0x1'));var crypto=require(_0xf42a('0x2'));var logger=require('../../../../../../config/logger')(_0xf42a('0x3'));module[_0xf42a('0x4')]=function(_0x471da5,_0x63de40,_0x5e3514,_0x568bbd){return new BPromise(function(_0x185457,_0x4bc0a0){logger[_0xf42a('0x5')]('Tilde\x20URI',_0x568bbd||_0xf42a('0x6'));var _0x3220e2=new WebSocket(_0x568bbd||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x3c24a0='';var _0x1dbde2='0';var _0x2d1f6e='1';var _0xbcea14=_0xf42a('0x7');function _0x1c8297(_0x414471){var _0x241449=crypto[_0xf42a('0x8')](_0xf42a('0x9'));_0x241449[_0xf42a('0xa')](_0x414471);return _0x241449[_0xf42a('0xb')]('hex');}function _0x2a0e1a(){try{logger[_0xf42a('0x5')](_0xf42a('0xc'));var _0x19f854=moment()[_0xf42a('0xd')]();var _0x17abb4=_0x1c8297(_0x19f854+_0x63de40+_0x5e3514);_0x3220e2[_0xf42a('0xe')](JSON['stringify']({'appID':_0x63de40,'timestamp':_0x19f854,'appKey':_0x17abb4}));var _0x337788=fs[_0xf42a('0xf')](_0x471da5);_0x337788['on'](_0xf42a('0x10'),function(_0x2781b1){_0x3220e2[_0xf42a('0xe')](_0x2781b1);});_0x337788['on'](_0xf42a('0x11'),function(){_0x3220e2['send']('EOS');});}catch(_0x1e0778){logger['error'](_0xf42a('0x12'),JSON['stringify'](_0x1e0778));_0x3220e2[_0xf42a('0x13')]();}}function _0x4ffcd6(_0x4daec2){try{if(_0x4daec2){var _0x2b3f2a=JSON[_0xf42a('0x14')](_0x4daec2);switch(_0x2b3f2a[_0xf42a('0x15')]){case 0x0:if(_0x2b3f2a['result']){if(_0x2b3f2a['result'][_0xf42a('0x16')]){logger['info'](_0xf42a('0x17'),JSON[_0xf42a('0x18')](_0x2b3f2a[_0xf42a('0x19')][_0xf42a('0x1a')]));_0x3c24a0=_0x2b3f2a[_0xf42a('0x19')][_0xf42a('0x1a')][0x0]['transcript'];_0x1dbde2=_0x2b3f2a[_0xf42a('0x19')][_0xf42a('0x1a')][0x0][_0xf42a('0x1b')];_0x2d1f6e='0';_0xbcea14=_0xf42a('0x1c');_0x3220e2[_0xf42a('0x13')]();}}break;case 0x1:logger['info'](_0xf42a('0x7'));_0x2d1f6e='1';_0xbcea14=_0xf42a('0x7');break;case 0x2:logger[_0xf42a('0x5')](_0xf42a('0x1d'));_0x2d1f6e='2';_0xbcea14=_0xf42a('0x1d');break;case 0x9:logger['info']('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x2d1f6e='9';_0xbcea14=_0xf42a('0x1e');break;case 0xa:logger[_0xf42a('0x5')]('Authentication\x20failed.');_0x2d1f6e='10';_0xbcea14=_0xf42a('0x1f');break;case 0xb:logger[_0xf42a('0x5')](_0xf42a('0x20'));_0x2d1f6e='11';_0xbcea14=_0xf42a('0x20');}}}catch(_0x3c815a){logger[_0xf42a('0x21')](_0xf42a('0x22'),JSON[_0xf42a('0x18')](_0x3c815a));_0x3220e2['terminate']();}}function _0x37de90(){logger[_0xf42a('0x5')](_0xf42a('0x23'));_0x185457({'transcript':_0x3c24a0,'confidence':_0x1dbde2,'status':_0x2d1f6e,'status_message':_0xbcea14});}function _0x1afdb4(_0x14f5ce){logger[_0xf42a('0x21')](_0xf42a('0x24'));if(!_[_0xf42a('0x25')](_0x14f5ce)){logger[_0xf42a('0x21')](_['isObject'](_0x14f5ce)?JSON['stringify'](_0x14f5ce):_0x14f5ce);}}_0x3220e2['on'](_0xf42a('0x26'),_0x2a0e1a);_0x3220e2['on'](_0xf42a('0x27'),_0x4ffcd6);_0x3220e2['on'](_0xf42a('0x11'),_0x37de90);_0x3220e2['on']('error',_0x1afdb4);});}; \ No newline at end of file +var _0x3d6f=['createHash','sha1','digest','hex','stringify','data','send','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','isNil','message','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x36acb3,_0x204e94){var _0x13976c=function(_0x4371dd){while(--_0x4371dd){_0x36acb3['push'](_0x36acb3['shift']());}};_0x13976c(++_0x204e94);}(_0x3d6f,0x155));var _0xf3d6=function(_0x36d8d9,_0x17b58a){_0x36d8d9=_0x36d8d9-0x0;var _0x1ac3a2=_0x3d6f[_0x36d8d9];return _0x1ac3a2;};'use strict';var BPromise=require('bluebird');var _=require(_0xf3d6('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf3d6('0x1'));var crypto=require(_0xf3d6('0x2'));var logger=require(_0xf3d6('0x3'))('agi');module[_0xf3d6('0x4')]=function(_0x19347b,_0xad2519,_0xab4801,_0x233052){return new BPromise(function(_0x5edb27,_0x2eda4a){logger[_0xf3d6('0x5')](_0xf3d6('0x6'),_0x233052||_0xf3d6('0x7'));var _0x47d839=new WebSocket(_0x233052||_0xf3d6('0x7'),{'perMessageDeflate':![]});var _0x2dc9bd='';var _0x46e0a0='0';var _0x4103d8='1';var _0x34f7d1=_0xf3d6('0x8');function _0x107413(_0x3219d3){var _0x438c63=crypto[_0xf3d6('0x9')](_0xf3d6('0xa'));_0x438c63['update'](_0x3219d3);return _0x438c63[_0xf3d6('0xb')](_0xf3d6('0xc'));}function _0x20d41c(){try{logger[_0xf3d6('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x14fc84=moment()['unix']();var _0x35eb59=_0x107413(_0x14fc84+_0xad2519+_0xab4801);_0x47d839['send'](JSON[_0xf3d6('0xd')]({'appID':_0xad2519,'timestamp':_0x14fc84,'appKey':_0x35eb59}));var _0x18ba27=fs['createReadStream'](_0x19347b);_0x18ba27['on'](_0xf3d6('0xe'),function(_0x10208d){_0x47d839[_0xf3d6('0xf')](_0x10208d);});_0x18ba27['on']('close',function(){_0x47d839['send'](_0xf3d6('0x10'));});}catch(_0x190b88){logger[_0xf3d6('0x11')](_0xf3d6('0x12'),JSON['stringify'](_0x190b88));_0x47d839[_0xf3d6('0x13')]();}}function _0x2b6e68(_0x417a49){try{if(_0x417a49){var _0x127f17=JSON[_0xf3d6('0x14')](_0x417a49);switch(_0x127f17[_0xf3d6('0x15')]){case 0x0:if(_0x127f17['result']){if(_0x127f17[_0xf3d6('0x16')][_0xf3d6('0x17')]){logger[_0xf3d6('0x5')](_0xf3d6('0x18'),JSON['stringify'](_0x127f17[_0xf3d6('0x16')][_0xf3d6('0x19')]));_0x2dc9bd=_0x127f17[_0xf3d6('0x16')][_0xf3d6('0x19')][0x0][_0xf3d6('0x1a')];_0x46e0a0=_0x127f17[_0xf3d6('0x16')][_0xf3d6('0x19')][0x0][_0xf3d6('0x1b')];_0x4103d8='0';_0x34f7d1='Success.';_0x47d839[_0xf3d6('0x13')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x4103d8='1';_0x34f7d1='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xf3d6('0x5')](_0xf3d6('0x1c'));_0x4103d8='2';_0x34f7d1=_0xf3d6('0x1c');break;case 0x9:logger['info'](_0xf3d6('0x1d'));_0x4103d8='9';_0x34f7d1=_0xf3d6('0x1d');break;case 0xa:logger['info']('Authentication\x20failed.');_0x4103d8='10';_0x34f7d1=_0xf3d6('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4103d8='11';_0x34f7d1=_0xf3d6('0x1f');}}}catch(_0xe803f3){logger['error'](_0xf3d6('0x20'),JSON[_0xf3d6('0xd')](_0xe803f3));_0x47d839[_0xf3d6('0x13')]();}}function _0x3985fb(){logger[_0xf3d6('0x5')]('Close\x20Tilde\x20ASR\x20socket');_0x5edb27({'transcript':_0x2dc9bd,'confidence':_0x46e0a0,'status':_0x4103d8,'status_message':_0x34f7d1});}function _0x2814e9(_0x360fd2){logger[_0xf3d6('0x11')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xf3d6('0x21')](_0x360fd2)){logger[_0xf3d6('0x11')](_['isObject'](_0x360fd2)?JSON[_0xf3d6('0xd')](_0x360fd2):_0x360fd2);}}_0x47d839['on']('open',_0x20d41c);_0x47d839['on'](_0xf3d6('0x22'),_0x2b6e68);_0x47d839['on']('close',_0x3985fb);_0x47d839['on'](_0xf3d6('0x11'),_0x2814e9);});}; \ 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 10f73e9..3b835f1 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 _0x7b7f=['./asr','exports'];(function(_0x47218c,_0x4bba6f){var _0x5aee46=function(_0x47bd43){while(--_0x47bd43){_0x47218c['push'](_0x47218c['shift']());}};_0x5aee46(++_0x4bba6f);}(_0x7b7f,0x118));var _0xf7b7=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7b7f[_0x5ddb1c];return _0x354adc;};var asr=require(_0xf7b7('0x0'));module[_0xf7b7('0x1')]={'asr':asr}; \ No newline at end of file +var _0x4c48=['exports','./asr'];(function(_0x5a82a5,_0x5a1dee){var _0x427d33=function(_0x7210aa){while(--_0x7210aa){_0x5a82a5['push'](_0x5a82a5['shift']());}};_0x427d33(++_0x5a1dee);}(_0x4c48,0x129));var _0x84c4=function(_0x5aef17,_0x592cd4){_0x5aef17=_0x5aef17-0x0;var _0x43f9d0=_0x4c48[_0x5aef17];return _0x43f9d0;};var asr=require(_0x84c4('0x0'));module[_0x84c4('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index f3f2c97..d4b170f 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 _0x34e5=['E_AGI_ARGUMENT_PORT','listening','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','error'];(function(_0x3ccd61,_0x414da3){var _0x37def8=function(_0x3d90cd){while(--_0x3d90cd){_0x3ccd61['push'](_0x3ccd61['shift']());}};_0x37def8(++_0x414da3);}(_0x34e5,0x172));var _0x534e=function(_0x2e31c9,_0x53b228){_0x2e31c9=_0x2e31c9-0x0;var _0x517748=_0x34e5[_0x2e31c9];return _0x517748;};'use strict';var util=require('util');var net=require(_0x534e('0x0'));var EventEmitter=require('events')[_0x534e('0x1')];var AGIError=require(_0x534e('0x2'));var AGIChannel=require(_0x534e('0x3'));var AGIServer=function(_0x246650,_0x83eb2d,_0x50b790){var _0x11a158=this,_0x246650=_0x246650||0x11dd,_0x83eb2d=_0x83eb2d||_0x534e('0x4'),_0x117f0c=null,_0x436a92=0x0;EventEmitter[_0x534e('0x5')](_0x11a158);function _0x5620d4(){if(!_0x246650){_0x11a158[_0x534e('0x6')](_0x534e('0x7'),new AGIError(_0x534e('0x8')));return![];}_0x117f0c=net['createServer']();_0x117f0c['listen'](_0x246650,_0x83eb2d);_0x117f0c['on'](_0x534e('0x9'),function(){_0x11a158['emit'](_0x534e('0x9'));});_0x117f0c['on']('connection',function(_0xb30dd6){_0x117f0c[_0x534e('0xa')](function(_0x27561c,_0x529726){if(_0x27561c){_0x11a158[_0x534e('0x6')](_0x534e('0x7'),new AGIError(_0x534e('0xb'),_0x27561c));}else if(_0x50b790&&_0x50b790<0x0){_0x11a158[_0x534e('0x6')](_0x534e('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0xb30dd6[_0x534e('0xc')]();}else if(_0x50b790&&_0x50b790>0x0&&_0x50b790<_0x529726){_0x436a92+=0x1;_0x11a158[_0x534e('0x6')](_0x534e('0x7'),new AGIError(_0x534e('0xd'),_0x436a92));_0xb30dd6[_0x534e('0xc')]();}else{var _0x478027=new AGIChannel(_0xb30dd6);_0x478027['on'](_0x534e('0xe'),function(){_0x11a158[_0x534e('0x6')](_0x534e('0xf'),_0x478027);});}});});_0x117f0c['on']('error',function(_0x4171d6){_0x11a158[_0x534e('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x4171d6[_0x534e('0x10')]));});_0x117f0c['on'](_0x534e('0x11'),function(){_0x11a158[_0x534e('0x6')](_0x534e('0x11'),new AGIError(_0x534e('0x12')));});}process[_0x534e('0x13')](function(){_0x5620d4();});};util[_0x534e('0x14')](AGIServer,EventEmitter);module['exports']=function(_0x1a7790,_0x28145f,_0x466d74){return new AGIServer(_0x1a7790,_0x28145f,_0x466d74);}; \ No newline at end of file +var _0xbe02=['E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./channel','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbe02,0x146));var _0x2be0=function(_0x11065f,_0x5aa1fe){_0x11065f=_0x11065f-0x0;var _0x2503ad=_0xbe02[_0x11065f];return _0x2503ad;};'use strict';var util=require(_0x2be0('0x0'));var net=require(_0x2be0('0x1'));var EventEmitter=require(_0x2be0('0x2'))[_0x2be0('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x2be0('0x4'));var AGIServer=function(_0x2b34c2,_0x9eb980,_0x364c99){var _0x22ed11=this,_0x2b34c2=_0x2b34c2||0x11dd,_0x9eb980=_0x9eb980||'127.0.0.1',_0x474a35=null,_0x39a2ca=0x0;EventEmitter['call'](_0x22ed11);function _0x176f12(){if(!_0x2b34c2){_0x22ed11[_0x2be0('0x5')](_0x2be0('0x6'),new AGIError(_0x2be0('0x7')));return![];}_0x474a35=net[_0x2be0('0x8')]();_0x474a35[_0x2be0('0x9')](_0x2b34c2,_0x9eb980);_0x474a35['on']('listening',function(){_0x22ed11['emit']('listening');});_0x474a35['on']('connection',function(_0x58795e){_0x474a35['getConnections'](function(_0x367444,_0x2a4a44){if(_0x367444){_0x22ed11['emit'](_0x2be0('0x6'),new AGIError(_0x2be0('0xa'),_0x367444));}else if(_0x364c99&&_0x364c99<0x0){_0x22ed11[_0x2be0('0x5')](_0x2be0('0x6'),new AGIError(_0x2be0('0xb')));_0x58795e[_0x2be0('0xc')]();}else if(_0x364c99&&_0x364c99>0x0&&_0x364c99<_0x2a4a44){_0x39a2ca+=0x1;_0x22ed11[_0x2be0('0x5')](_0x2be0('0x6'),new AGIError(_0x2be0('0xd'),_0x39a2ca));_0x58795e[_0x2be0('0xc')]();}else{var _0x54e9f2=new AGIChannel(_0x58795e);_0x54e9f2['on'](_0x2be0('0xe'),function(){_0x22ed11[_0x2be0('0x5')]('connection',_0x54e9f2);});}});});_0x474a35['on'](_0x2be0('0x6'),function(_0x1e0c27){_0x22ed11['emit'](_0x2be0('0x6'),new AGIError(_0x2be0('0xa'),_0x1e0c27[_0x2be0('0xf')]));});_0x474a35['on'](_0x2be0('0x10'),function(){_0x22ed11[_0x2be0('0x5')](_0x2be0('0x10'),new AGIError(_0x2be0('0x11')));});}process[_0x2be0('0x12')](function(){_0x176f12();});};util[_0x2be0('0x13')](AGIServer,EventEmitter);module[_0x2be0('0x14')]=function(_0x1aaeec,_0x1d4b00,_0x361f25){return new AGIServer(_0x1aaeec,_0x1d4b00,_0x361f25);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 8617b41..7970b33 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 _0x3bbd=['Google\x20TTS\x20is\x20unreachable','unpause','mailbox','Executed\x20command\x20%s\x20%s','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','getVariableById','then','catch','prototype','getVoiceQueue','getVoiceQueueById','getSquareProjectById','name','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','interval','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','priority','dnid','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','has','dialTimezone','CALLERID(dialTimezone)','getContactByPhone','RES1','dialtimezone','timezones','utcOffset','minutestoadd','scheduledat','add','minutes','scheduledat\x20after','insertContact','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','exec','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','method','timeout','includes','POST','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','parse','sync','uri','render','url','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','dialogflow_language','sestekNDA','ispeechTTS','key','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','format','%s.%s','setVariable','replaceall\x20init','split','getAndSetVariable','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','before\x20createcmcontact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20is\x20unreachable','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','continueAt','context','extension','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','QUEUE','macro','gosub','position','record','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:','inspect','%s_STATUS_CODE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','Smtp','email','user','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','getSquareProject','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','command','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Google\x20TTS\x20%s\x20file\x20created'];(function(_0x1f7481,_0x1a90d3){var _0x3e4b86=function(_0x3e776c){while(--_0x3e776c){_0x1f7481['push'](_0x1f7481['shift']());}};_0x3e4b86(++_0x1a90d3);}(_0x3bbd,0x1d2));var _0xd3bb=function(_0x18ec0d,_0x1dff28){_0x18ec0d=_0x18ec0d-0x0;var _0x1de836=_0x3bbd[_0x18ec0d];return _0x1de836;};'use strict';var fs=require('fs');var path=require(_0xd3bb('0x0'));var util=require(_0xd3bb('0x1'));var _=require('lodash');var sh=require(_0xd3bb('0x2'));var odbc=require(_0xd3bb('0x3'))();var rs=require(_0xd3bb('0x4'));var moment=require(_0xd3bb('0x5'));var Mustache=require(_0xd3bb('0x6'));var rp=require(_0xd3bb('0x7'));var logger=require('../../config/logger')(_0xd3bb('0x8'));var config=require('../../config/environment');var shared=require(_0xd3bb('0x9'));var scripts=require(_0xd3bb('0xa'));var FILES_PATH=_0xd3bb('0xb');var recursiveMapAttributes=[_0xd3bb('0xc'),_0xd3bb('0xd')];var verticesWithRetry=[_0xd3bb('0xe'),_0xd3bb('0xf'),_0xd3bb('0x10')];var AGIVertices=function(_0xa6410d,_0x39edca,_0x361a5c){this[_0xd3bb('0x11')]=_0xa6410d;this['rpc']=_0x39edca;this[_0xd3bb('0x12')]=_0x361a5c;};AGIVertices['prototype'][_0xd3bb('0x13')]=function(_0x5b15c3,_0x172dd5){this[_0xd3bb('0x14')][_0xd3bb('0x15')](_0x5b15c3)[_0xd3bb('0x16')](function(_0x1ede9d){_0x172dd5(null,_0x1ede9d?_0x1ede9d['name']:![]);})[_0xd3bb('0x17')](function(_0x3382e9){_0x172dd5(_0x3382e9);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x19')]=function(_0x1135c8,_0x240997){this['rpc'][_0xd3bb('0x1a')](_0x1135c8)['then'](function(_0x1b53f5){_0x240997(null,_0x1b53f5?_0x1b53f5['name']:![]);})['catch'](function(_0x3fd3e5){_0x240997(_0x3fd3e5);});};AGIVertices[_0xd3bb('0x18')]['getSquareProject']=function(_0x32d66c,_0x4eaaae){this[_0xd3bb('0x14')][_0xd3bb('0x1b')](_0x32d66c)[_0xd3bb('0x16')](function(_0x241d83){_0x4eaaae(null,_0x241d83?_0x241d83[_0xd3bb('0x1c')]:![]);})['catch'](function(_0x328bab){_0x4eaaae(_0x328bab);});};AGIVertices[_0xd3bb('0x18')]['getSquareOdbc']=function(_0x3265a1,_0x3e9d7b){this[_0xd3bb('0x14')][_0xd3bb('0x1d')](_0x3265a1)[_0xd3bb('0x16')](function(_0x115ba2){_0x3e9d7b(null,_0x115ba2?_0x115ba2[_0xd3bb('0x1e')]:![]);})[_0xd3bb('0x17')](function(_0x251618){_0x3e9d7b(_0x251618);});};AGIVertices['prototype'][_0xd3bb('0x1f')]=function(_0x302856,_0x10b7ab){this[_0xd3bb('0x14')]['getUserById'](_0x302856)[_0xd3bb('0x16')](function(_0x35f340){_0x10b7ab(null,_0x35f340?_0x35f340[_0xd3bb('0x1c')]:![]);})[_0xd3bb('0x17')](function(_0x14a50d){_0x10b7ab(_0x14a50d);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x20')]=function(_0x48e18f,_0x27ae36){this['rpc'][_0xd3bb('0x21')](_0x48e18f)['then'](function(_0x44b1cd){_0x27ae36(null,_0x44b1cd?_0x44b1cd['name']:![]);})[_0xd3bb('0x17')](function(_0x1e9b03){_0x27ae36(_0x1e9b03);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x22')]=function(_0x391b1a,_0x594468){var _0x500bb9=this;this[_0xd3bb('0x14')][_0xd3bb('0x23')](_0x391b1a)[_0xd3bb('0x16')](function(_0x232057){_0x594468(null,_0x232057?_0x500bb9[_0xd3bb('0x24')](_0x232057[_0xd3bb('0x25')]):![]);})[_0xd3bb('0x17')](function(_0x4c5776){_0x594468(_0x4c5776);});};AGIVertices['prototype']['getMailAccount']=function(_0x10816f,_0x33e38d){this['rpc'][_0xd3bb('0x26')](_0x10816f)[_0xd3bb('0x16')](function(_0x321523){_0x33e38d(null,_0x321523?_0x321523:![]);})[_0xd3bb('0x17')](function(_0x44ecef){_0x33e38d(_0x44ecef);});};AGIVertices['prototype'][_0xd3bb('0x27')]=function(_0x1ef5ff,_0x535d06,_0x5d7afa){this['mailRpc']['sendMailMessage'](_0x1ef5ff,_0x535d06)[_0xd3bb('0x16')](function(){_0x5d7afa(null);})[_0xd3bb('0x17')](function(_0x223ae9){_0x5d7afa(_0x223ae9);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x28')]=function(_0x302837,_0x5dcd86){this[_0xd3bb('0x14')][_0xd3bb('0x29')](_0x302837)[_0xd3bb('0x16')](function(_0x1abf70){if(_0x1abf70){if(_0x1abf70[_0xd3bb('0x2a')]){_0x5dcd86(null,[_0x1abf70['interval']]);}else{_0x5dcd86(null,_['map'](_0x1abf70[_0xd3bb('0x2b')],_0xd3bb('0x2c')));}}else{_0x5dcd86(null,![]);}})[_0xd3bb('0x17')](function(_0x8d25b9){_0x5dcd86(_0x8d25b9);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x24')]=function(_0x2f96d9){return util['format'](_0xd3bb('0x2d'),FILES_PATH,_0x2f96d9);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x2e')]=function(_0x19c386,_0x2cca43,_0x560adc){odbc[_0xd3bb('0x2f')](_0x19c386,function(_0x24d8ca){if(_0x24d8ca){logger[_0xd3bb('0x30')](_0xd3bb('0x31'),_0x24d8ca);_0x560adc(_0x24d8ca);}else{logger[_0xd3bb('0x32')](_0xd3bb('0x33'));odbc['query'](_0x2cca43,function(_0x213824,_0x65f41){if(_0x213824){logger[_0xd3bb('0x32')](_0xd3bb('0x34'),_0x2cca43);_0x560adc(_0x213824);}else{logger[_0xd3bb('0x32')](_0xd3bb('0x35'),_0x2cca43);odbc['close'](function(_0x49cb45){if(_0x49cb45){logger[_0xd3bb('0x30')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x49cb45);}_0x560adc(null,_0x65f41);});}});}});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x36')]=function(_0x4943f2,_0x1b39fc){this[_0xd3bb('0x14')][_0xd3bb('0x37')](_0x4943f2)[_0xd3bb('0x16')](function(_0x3556ef){_0x1b39fc(null,_0x3556ef?_0x3556ef:![]);})[_0xd3bb('0x17')](function(_0x3533e5){_0x1b39fc(_0x3533e5);});};AGIVertices['prototype'][_0xd3bb('0x38')]=function(_0x3f3abf,_0x4f526d){this[_0xd3bb('0x14')][_0xd3bb('0x38')](_0x3f3abf)['then'](function(_0x1a6eb0){_0x4f526d(null,_0x1a6eb0);})[_0xd3bb('0x17')](function(_0x5f59da){_0x4f526d(_0x5f59da);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x39')]=function(_0x47e659,_0x4d5642,_0x33bc02){this['rpc']['createSquareDetailsReport']({'uniqueid':this['channel'][_0xd3bb('0x3a')],'node':_0x47e659[_0xd3bb('0x3b')],'application':_0x47e659[_0xd3bb('0x3c')],'data':_0x4d5642||null,'project_name':this[_0xd3bb('0x11')][_0xd3bb('0x3d')],'callerid':this['channel'][_0xd3bb('0x3e')]})['then'](function(_0x1816f4){if(_0x33bc02){_0x33bc02(null,_0x1816f4);}})['catch'](function(_0x1ba828){if(_0x33bc02){_0x33bc02(_0x1ba828);}});};AGIVertices[_0xd3bb('0x18')]['createSquareRecording']=function(_0x5f0860,_0x1689e3,_0x4ecc59,_0x17b1b9){this[_0xd3bb('0x14')][_0xd3bb('0x3f')]({'uniqueid':this[_0xd3bb('0x11')][_0xd3bb('0x3a')],'callerid':this['channel'][_0xd3bb('0x3e')],'calleridname':this['channel'][_0xd3bb('0x40')],'context':this[_0xd3bb('0x11')]['context'],'extension':this[_0xd3bb('0x11')]['extension'],'priority':this[_0xd3bb('0x11')][_0xd3bb('0x41')],'accountcode':this['channel']['accountcode'],'dnid':this[_0xd3bb('0x11')][_0xd3bb('0x42')],'projectName':this[_0xd3bb('0x11')][_0xd3bb('0x3d')],'saveName':_0x1689e3,'filename':_0x5f0860['file']||_0x1689e3,'savePath':_0x4ecc59})[_0xd3bb('0x16')](function(_0x3a287d){_0x17b1b9(null,_0x3a287d);})['catch'](function(_0x5415f6){_0x17b1b9(_0x5415f6);});};AGIVertices['prototype']['createSquareMessage']=function(_0x2a9722,_0x3e0a2f,_0x40e117){this[_0xd3bb('0x14')][_0xd3bb('0x43')]({'uniqueid':this['channel'][_0xd3bb('0x3a')],'body':_0x2a9722,'direction':_0x3e0a2f})[_0xd3bb('0x16')](function(_0x181e9d){if(_0x40e117){_0x40e117(null,_0x181e9d);}})[_0xd3bb('0x17')](function(_0x282bd2){if(_0x40e117){_0x40e117(_0x282bd2);}});};AGIVertices['prototype'][_0xd3bb('0x44')]=function(_0x4d8a89,_0x419f18){console[_0xd3bb('0x45')](_0xd3bb('0x46'),_0x4d8a89);console[_0xd3bb('0x45')](_0xd3bb('0x47'),_0x419f18);var _0xe0cb8c=this;var _0x176411=0x0;var _0xb04b2c={'firstName':_[_0xd3bb('0x48')](_0x4d8a89['name'])||_[_0xd3bb('0x49')](_0x4d8a89[_0xd3bb('0x1c')])?_0xd3bb('0x4a')+Math['random']():_0x4d8a89[_0xd3bb('0x1c')],'lastName':_[_0xd3bb('0x48')](_0x4d8a89['lastName'])||_[_0xd3bb('0x49')](_0x4d8a89[_0xd3bb('0x4b')])?null:_0x4d8a89[_0xd3bb('0x4b')],'phone':_0x4d8a89[_0xd3bb('0x4c')],'ListId':_0x4d8a89[_0xd3bb('0x4d')],'scheduledat':_0x4d8a89[_0xd3bb('0x4e')],'callbackUniqueid':this['channel'][_0xd3bb('0x3a')],'tags':'callback','description':_0xd3bb('0x4f')+_0x4d8a89[_0xd3bb('0x4e')][_0xd3bb('0x50')](),'priority':_0x4d8a89[_0xd3bb('0x51')]};if(_[_0xd3bb('0x52')](_0x4d8a89,_0xd3bb('0x53'))){if(!_['isNil'](_0x4d8a89[_0xd3bb('0x53')])){var _0x50ab67=_0x4d8a89['dialTimezone'];console[_0xd3bb('0x45')]('VALUE\x20TZ',_0x50ab67);if(_0x4d8a89[_0xd3bb('0x53')]==_0xd3bb('0x54')){this['rpc'][_0xd3bb('0x55')]({'phone':_0x4d8a89[_0xd3bb('0x4c')]})[_0xd3bb('0x16')](function(_0x4e1e8f){console[_0xd3bb('0x45')](_0xd3bb('0x56'),_0x4e1e8f);var _0x116551=_0x4e1e8f[_0xd3bb('0x53')];console[_0xd3bb('0x45')](_0xd3bb('0x57'),_0x116551);if(!_[_0xd3bb('0x49')](_0x116551)){var _0x15506e=shared[_0xd3bb('0x58')][_0x116551];console[_0xd3bb('0x45')]('tz',_0x15506e);if(!_[_0xd3bb('0x49')](_0x15506e)){var _0x14e1ab=-0x1*_0x15506e[_0xd3bb('0x59')];console[_0xd3bb('0x45')](_0xd3bb('0x5a'),_0x14e1ab);console[_0xd3bb('0x45')]('scheduledat\x20before',_0xb04b2c['scheduledat']);_0xb04b2c[_0xd3bb('0x5b')]=moment(_0x4d8a89[_0xd3bb('0x5b')])[_0xd3bb('0x5c')](_0x14e1ab,_0xd3bb('0x5d'));console[_0xd3bb('0x45')](_0xd3bb('0x5e'),_0xb04b2c['scheduledat']);_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)[_0xd3bb('0x16')](function(_0x29d179){_0x419f18(null,_0x29d179);})[_0xd3bb('0x17')](function(_0x4cca24){_0x419f18(_0x4cca24);});}else{_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)[_0xd3bb('0x16')](function(_0x58ce64){_0x419f18(null,_0x58ce64);})['catch'](function(_0x4f52b8){_0x419f18(_0x4f52b8);});}}else{_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)['then'](function(_0x429435){_0x419f18(null,_0x429435);})[_0xd3bb('0x17')](function(_0x574b74){_0x419f18(_0x574b74);});}});}else{var _0x176411=shared['timezones'][_0x50ab67];if(!_['isNil'](_0x176411)){var _0x1d6b7b=-0x1*_0x176411[_0xd3bb('0x59')];_0xb04b2c[_0xd3bb('0x5b')]=moment(_0x4d8a89[_0xd3bb('0x5b')])[_0xd3bb('0x5c')](_0x1d6b7b,_0xd3bb('0x5d'));_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)[_0xd3bb('0x16')](function(_0x2cc551){_0x419f18(null,_0x2cc551);})[_0xd3bb('0x17')](function(_0x110ddf){_0x419f18(_0x110ddf);});}else{_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)[_0xd3bb('0x16')](function(_0x1ed7ad){_0x419f18(null,_0x1ed7ad);})[_0xd3bb('0x17')](function(_0x1a9fcd){_0x419f18(_0x1a9fcd);});}}}else{_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)['then'](function(_0x2b7c51){_0x419f18(null,_0x2b7c51);})[_0xd3bb('0x17')](function(_0x366ed3){_0x419f18(_0x366ed3);});}}else{_0xe0cb8c[_0xd3bb('0x5f')](_0xb04b2c,_0x4d8a89,_0x419f18)[_0xd3bb('0x16')](function(_0xb5357c){_0x419f18(null,_0xb5357c);})[_0xd3bb('0x17')](function(_0x37b18a){_0x419f18(_0x37b18a);});}};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x5f')]=function(_0xb5aa68,_0x2defea,_0x1e1042){this[_0xd3bb('0x14')]['createCmContact'](_0xb5aa68)[_0xd3bb('0x16')](function(_0x59ad45){_0x1e1042(null,_0x59ad45);})['catch'](function(_0x2dddbd){_0x1e1042(_0x2dddbd);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x60')]=function(_0x452983,_0x29a375){this[_0xd3bb('0x14')][_0xd3bb('0x61')](_0x452983)[_0xd3bb('0x16')](function(_0x427195){_0x29a375(null,_0x427195?_0x427195[_0xd3bb('0x1c')]:![]);})['catch'](function(_0x54f5c7){_0x29a375(_0x54f5c7);});};AGIVertices['prototype'][_0xd3bb('0x62')]=function(_0xa7ae2e,_0x669bf5,_0x50afdf){var _0x3997a8={'role':_0xd3bb('0x63')};_0x3997a8[_0xa7ae2e]=this[_0xd3bb('0x11')][_0xd3bb('0x3e')];this[_0xd3bb('0x14')]['agentPause'](_0x3997a8,_0x669bf5,this[_0xd3bb('0x11')][_0xd3bb('0x3a')])[_0xd3bb('0x16')](function(_0x184894){_0x50afdf(null,_[_0xd3bb('0x49')](_0x184894)?![]:!![]);})[_0xd3bb('0x17')](function(_0x8b227f){logger['error'](_0x8b227f);_0x50afdf(null,![]);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x64')]=function(_0x30474e,_0xb50d92){var _0xc0647={'role':'agent'};_0xc0647[_0x30474e]=this[_0xd3bb('0x11')][_0xd3bb('0x3e')];this[_0xd3bb('0x14')][_0xd3bb('0x64')](_0xc0647)[_0xd3bb('0x16')](function(_0x477703){_0xb50d92(null,_[_0xd3bb('0x49')](_0x477703)?![]:!![]);})['catch'](function(_0x202f00){logger['error'](_0x202f00);_0xb50d92(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x215d36,_0x4f3195){var _0x53662f={'role':_0xd3bb('0x63')};_0x53662f[_0x215d36]=this[_0xd3bb('0x11')][_0xd3bb('0x3e')];this['rpc'][_0xd3bb('0x65')](_0x53662f)[_0xd3bb('0x16')](function(_0x4ad256){_0x4f3195(null,_[_0xd3bb('0x49')](_0x4ad256)?![]:!![]);})[_0xd3bb('0x17')](function(_0x8b5317){logger[_0xd3bb('0x30')](_0x8b5317);_0x4f3195(null,![]);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x66')]=function(_0x4c0980,_0x4a8b04){var _0x2800cd={'role':'agent'};_0x2800cd[_0x4c0980]=this[_0xd3bb('0x11')][_0xd3bb('0x3e')];var _0x5b3a36=_0x4c0980!=_0xd3bb('0x67')?util['format'](_0xd3bb('0x68'),'LOCAL',this[_0xd3bb('0x11')][_0xd3bb('0x3e')]):undefined;this[_0xd3bb('0x14')][_0xd3bb('0x66')](_0x2800cd,_0x5b3a36)['then'](function(_0x138e48){_0x4a8b04(null,_[_0xd3bb('0x49')](_0x138e48)?![]:!![]);})['catch'](function(_0x40bbf2){logger[_0xd3bb('0x30')](_0x40bbf2);_0x4a8b04(null,![]);});};AGIVertices[_0xd3bb('0x18')]['shellCommand']=function(_0x3cec88,_0x4bf6f9){sh[_0xd3bb('0x69')](_['trim'](_0x3cec88),function(_0xa1c594,_0xb6a93b){var _0x4c7c2c=_0xb6a93b[_0xd3bb('0x6a')](/(\r\n|\n|\r)/gm,'');_0x4bf6f9(null,_0x4c7c2c);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x6b')]=function(_0x287746,_0x56f91d){scripts[_0xd3bb('0x6b')](_0x287746[_0xd3bb('0x6c')],_0x287746['google_cloud_tts_text_type']||'text',_0x287746[_0xd3bb('0x6d')],_0x287746[_0xd3bb('0x6e')]||_0xd3bb('0x6f'),_0x287746[_0xd3bb('0x70')]||'MALE',_0x287746[_0xd3bb('0x71')]||_0xd3bb('0x72'))[_0xd3bb('0x16')](function(_0x177128){_0x56f91d(null,_0x177128);})[_0xd3bb('0x17')](function(_0x4f5d3a){_0x56f91d(_0x4f5d3a);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x73')]=function(_0x151091,_0x2b1d8c){scripts['googleTTS'](_0x151091[_0xd3bb('0x6d')],_0x151091['google_tts_language']||'en',0x1)[_0xd3bb('0x16')](function(_0x3b16ab){_0x2b1d8c(null,_0x3b16ab);})[_0xd3bb('0x17')](function(_0x52867c){_0x2b1d8c(_0x52867c);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x74')]=function(_0x135e02,_0xa16127){var _0x19fecc={'uri':_0x135e02['url'],'method':_0x135e02[_0xd3bb('0x75')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x135e02['timeout'])==='number'&&parseInt(_0x135e02['timeout'])>=0x1?parseInt(_0x135e02[_0xd3bb('0x76')])*0x3e8:0x5*0x3e8};if(_[_0xd3bb('0x77')]([_0xd3bb('0x78'),'PUT'],_0x19fecc[_0xd3bb('0x75')][_0xd3bb('0x79')]())){try{_0x19fecc[_0xd3bb('0x7a')]=_0x135e02[_0xd3bb('0xd')]?JSON['parse'](_0x135e02['rawBody']):{};}catch(_0x3af752){logger[_0xd3bb('0x30')](_0xd3bb('0x7b'),_0x3af752);}}try{_0x19fecc['headers']=_0x135e02['rawHeaders']?JSON[_0xd3bb('0x7c')](_0x135e02['rawHeaders']):{};}catch(_0x31318c){logger[_0xd3bb('0x30')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x31318c);}if(_0x135e02['computedVariables']){try{var _0x587de9=require(_0x135e02['computedVariables'])[_0xd3bb('0x7d')](this,_0x19fecc);_0x19fecc[_0xd3bb('0x7e')]=Mustache[_0xd3bb('0x7f')](_0x135e02[_0xd3bb('0x80')],_0x587de9,{},['$$','$$']);if(_0x19fecc['headers']){_0x19fecc[_0xd3bb('0x81')]=JSON[_0xd3bb('0x7c')](Mustache[_0xd3bb('0x7f')](JSON[_0xd3bb('0x82')](_0x19fecc[_0xd3bb('0x81')]),_0x587de9,{},['$$','$$']));}if(_0x19fecc[_0xd3bb('0x7a')]){_0x19fecc[_0xd3bb('0x7a')]=JSON['parse'](Mustache[_0xd3bb('0x7f')](JSON['stringify'](_0x19fecc[_0xd3bb('0x7a')]),_0x587de9,{},['$$','$$']));}}catch(_0x10f291){logger[_0xd3bb('0x30')](_0xd3bb('0x83'),_0x10f291);}}rp(_0x19fecc)[_0xd3bb('0x16')](function(_0x4f0cdc){var _0x1cbd8f={'statusCode':_0x4f0cdc[_0xd3bb('0x84')]||0xc8,'statusMessage':_0x4f0cdc['statusMessage']||'OK','headers':_0x4f0cdc[_0xd3bb('0x81')]||{},'body':_0x4f0cdc['body']||{}};_0xa16127(null,_0x1cbd8f);})[_0xd3bb('0x17')](function(_0x18fa98){var _0x118c50={'statusCode':_0x18fa98['statusCode']||0x1f4,'statusMessage':_0x18fa98[_0xd3bb('0x85')]||_0xd3bb('0x86'),'headers':_0x18fa98[_0xd3bb('0x87')][_0xd3bb('0x81')]||{},'body':_0x18fa98[_0xd3bb('0x87')]['body']||{}};_0xa16127(null,_0x118c50);});};AGIVertices[_0xd3bb('0x18')]['googleDialogflow']=function(_0x263fea,_0x1b406d){scripts['googleDialogflow'](this[_0xd3bb('0x11')][_0xd3bb('0x3a')],_0x263fea['key'],_0x263fea[_0xd3bb('0x6d')],_0x263fea[_0xd3bb('0x88')]||'en')[_0xd3bb('0x16')](function(_0xce3ef5){_0x1b406d(null,_0xce3ef5);})[_0xd3bb('0x17')](function(_0x360766){_0x1b406d(_0x360766);});};AGIVertices[_0xd3bb('0x18')]['sestekNDA']=function(_0x3aec79,_0x18bcf8){scripts[_0xd3bb('0x89')](this['channel'],_0x3aec79)[_0xd3bb('0x16')](function(_0x2d8379){_0x18bcf8(null,_0x2d8379);})['catch'](function(_0x52e54a){_0x18bcf8(_0x52e54a);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x8a')]=function(_0x5e3e3f,_0x1e524a){scripts[_0xd3bb('0x8a')](_0x5e3e3f[_0xd3bb('0x8b')],_0x5e3e3f['text'],_0x5e3e3f[_0xd3bb('0x8c')]||_0xd3bb('0x6f'),_0x5e3e3f['speed'])['then'](function(_0x1d1433){_0x1e524a(null,_0x1d1433);})[_0xd3bb('0x17')](function(_0x32a735){_0x1e524a(_0x32a735);});};AGIVertices[_0xd3bb('0x18')]['ispeechASR']=function(_0x3dae63,_0x15adfa,_0xd7a5ea){scripts[_0xd3bb('0x8d')](_0x15adfa,_0x3dae63[_0xd3bb('0x8b')],_0x3dae63[_0xd3bb('0x8e')]||_0xd3bb('0x6f'),this[_0xd3bb('0x8f')](_0x3dae63[_0xd3bb('0x90')])?_0x3dae63[_0xd3bb('0x90')]:undefined)[_0xd3bb('0x16')](function(_0x9e94b0){_0xd7a5ea(null,_0x9e94b0);})[_0xd3bb('0x17')](function(_0x215ac6){_0xd7a5ea(_0x215ac6);});};AGIVertices['prototype']['awsPolly']=function(_0x298236,_0x3fb584){scripts[_0xd3bb('0x91')](_0x298236[_0xd3bb('0x92')],_0x298236[_0xd3bb('0x93')],_0x298236[_0xd3bb('0x94')],_0x298236['aws_polly_voice']||_0xd3bb('0x95'),_0x298236[_0xd3bb('0x6d')],_0x298236['aws_text_type']||_0xd3bb('0x6d'))[_0xd3bb('0x16')](function(_0xa305ed){_0x3fb584(null,_0xa305ed);})[_0xd3bb('0x17')](function(_0x5b335a){_0x3fb584(_0x5b335a);});};AGIVertices['prototype'][_0xd3bb('0x96')]=function(_0x19d5ae,_0x26bde2){scripts[_0xd3bb('0x96')](this[_0xd3bb('0x11')][_0xd3bb('0x3a')],_0x19d5ae['aws_access_key_id'],_0x19d5ae['aws_secret_access_key'],_0x19d5ae[_0xd3bb('0x97')],_0x19d5ae[_0xd3bb('0x6d')],_0x19d5ae[_0xd3bb('0x98')])[_0xd3bb('0x16')](function(_0x18fc93){_0x26bde2(null,_0x18fc93);})[_0xd3bb('0x17')](function(_0x252ad0){_0x26bde2(_0x252ad0);});};AGIVertices['prototype'][_0xd3bb('0x99')]=function(_0x3726bc,_0xd306fd,_0x43010b){scripts['googleASR'](_0xd306fd,_0x3726bc['key'],_0x3726bc[_0xd3bb('0x9a')]||'en-US')[_0xd3bb('0x16')](function(_0x1a6167){_0x43010b(null,_0x1a6167);})[_0xd3bb('0x17')](function(_0x2d6411){_0x43010b(_0x2d6411);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x9b')]=function(_0x317c75,_0x48c0ed,_0x544c3f){scripts['tildeASR'](_0x48c0ed,_0x317c75['appid'],_0x317c75[_0xd3bb('0x9c')],_0x317c75[_0xd3bb('0x7e')])[_0xd3bb('0x16')](function(_0x3e52b7){_0x544c3f(null,_0x3e52b7);})['catch'](function(_0x45e49a){_0x544c3f(_0x45e49a);});};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x9d')]=function(_0x33dfa8){var _0x1f6b9c=_[_0xd3bb('0x77')](verticesWithRetry,_0x33dfa8[_0xd3bb('0x3c')])?_0x33dfa8:_[_0xd3bb('0x9e')](_0x33dfa8);for(var _0x168b27 in _0x1f6b9c){if(_0x1f6b9c[_0xd3bb('0x9f')](_0x168b27)){if(_0x1f6b9c[_0x168b27]&&_[_0xd3bb('0xa0')](_0x1f6b9c[_0x168b27])){if(_[_0xd3bb('0x77')](recursiveMapAttributes,_0x168b27)){_0x1f6b9c[_0x168b27]=this[_0xd3bb('0xa1')](_0x1f6b9c[_0x168b27]);}else{_0x1f6b9c[_0x168b27]=this[_0xd3bb('0xa2')](_0x1f6b9c[_0x168b27]);}}}}return _0x1f6b9c;};AGIVertices['prototype'][_0xd3bb('0xa3')]=function(_0x41531b){for(var _0xed59a9 in _0x41531b){if(_0x41531b[_0xd3bb('0x9f')](_0xed59a9)){if(_[_0xd3bb('0xa4')](_0x41531b[_0xed59a9])){this['recursiveNodeIndex'](_0x41531b[_0xed59a9]);}else if(_[_0xd3bb('0xa5')](_0x41531b[_0xed59a9])){for(var _0xf3bd8f=0x0;_0xf3bd8f<_0x41531b[_0xed59a9][_0xd3bb('0xa6')];_0xf3bd8f++){this[_0xd3bb('0xa3')](_0x41531b[_0xed59a9][_0xf3bd8f]);}}else if(_['isString'](_0x41531b[_0xed59a9])){_0x41531b[_0xed59a9]=this[_0xd3bb('0xa2')](_0x41531b[_0xed59a9]);}}}};AGIVertices['prototype'][_0xd3bb('0xa7')]=function(_0x5a5cb9,_0x47c2d1){for(var _0x28213d in _0x5a5cb9){if(_0x5a5cb9[_0xd3bb('0x9f')](_0x28213d)){if(_[_0xd3bb('0xa4')](_0x5a5cb9[_0x28213d])){if(!_[_0xd3bb('0x48')](_0x5a5cb9[_0x28213d])){this[_0xd3bb('0xa7')](_0x5a5cb9[_0x28213d],util[_0xd3bb('0xa8')](_0xd3bb('0xa9'),_0x47c2d1,_0x28213d));}}else if(_[_0xd3bb('0xa5')](_0x5a5cb9[_0x28213d])){for(var _0x2bcd58=0x0;_0x2bcd58<_0x5a5cb9[_0x28213d][_0xd3bb('0xa6')];_0x2bcd58++){this['saveRestApiResult'](_0x5a5cb9[_0x28213d][_0x2bcd58],util[_0xd3bb('0xa8')](_0xd3bb('0xa9'),_0x47c2d1,_0x28213d+'['+_0x2bcd58+']'));}}else{if(!_[_0xd3bb('0x49')](_0x5a5cb9[_0x28213d])){this['channel'][_0xd3bb('0xaa')](util[_0xd3bb('0xa8')](_0xd3bb('0xa9'),_0x47c2d1,_0x28213d),_0x5a5cb9[_0x28213d]);}}}}};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xa1')]=function(_0x9fc9df){try{var _0x21d377=JSON[_0xd3bb('0x7c')](_0x9fc9df);this[_0xd3bb('0xa3')](_0x21d377);return JSON['stringify'](_0x21d377);}catch(_0x4f0fae){return this[_0xd3bb('0xa2')](_0x9fc9df);}};AGIVertices[_0xd3bb('0x18')]['replaceAllVariables']=function(_0x1f84ac){console[_0xd3bb('0x45')](_0xd3bb('0xab'),_0x1f84ac);var _0x1bdc6a=_0x1f84ac['split']('{');for(var _0x182a93=0x1;_0x182a93<_0x1bdc6a[_0xd3bb('0xa6')];_0x182a93+=0x1){var _0x3e99a7=_0x1bdc6a[_0x182a93][_0xd3bb('0xac')]('}');console[_0xd3bb('0x45')]('nextbracket',_0x3e99a7);if(_0x3e99a7['length']>0x1){_0x1f84ac=_0x1f84ac['replaceAll']('{'+_0x3e99a7[0x0]+'}',this['channel'][_0xd3bb('0x13')](_0x3e99a7[0x0])['extra']||_0x3e99a7[0x0]);}}if(_0x1bdc6a['length']===0x1){return _0x1f84ac[_0xd3bb('0x50')]();}console[_0xd3bb('0x45')]('replaceall\x20end',_0x1f84ac);return this['replaceAllVariables'](_0x1f84ac);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xad')]=function(_0x29ba46,_0x4d4c6d){var _0x198bc3=this[_0xd3bb('0x11')][_0xd3bb('0x13')](_0x29ba46);if(_0x198bc3['result']===-0x1){return _0x198bc3;}logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4d4c6d,_0x198bc3[_0xd3bb('0xae')]));return this['channel'][_0xd3bb('0xaa')](_0x4d4c6d,_0x198bc3[_0xd3bb('0xae')]);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x8f')]=function(_0x583138){return _0x583138&&_0x583138!=='0'&&_0x583138!=='-1'&&_0x583138!=='';};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xaf')]=function(_0x259ea4){this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0x259ea4,'-');_0x259ea4[_0xd3bb('0xb0')]=_0x259ea4[_0xd3bb('0xaf')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xd3bb('0xb1')]=function(_0x340079){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0xb2'),_0x340079['label']));if(!this[_0xd3bb('0x8f')](_0x340079[_0xd3bb('0x6d')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('no\x20text\x20configured');}var _0x17195c='\x22'+_0x340079['text']+'\x22';if(this[_0xd3bb('0x8f')](_0x340079['options'])){_0x17195c+=','+_0x340079[_0xd3bb('0x87')];}var _0x382948=this[_0xd3bb('0x11')][_0xd3bb('0x69')](_0xd3bb('0xb4'),_0x17195c);if(_0x382948[_0xd3bb('0xb5')]===-0x1){return _0x382948;}return this['channel']['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0xb6'),_0x17195c));};AGIVertices[_0xd3bb('0x18')]['mrcprecog']=function(_0x5841c3){logger[_0xd3bb('0x32')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x5841c3[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x5841c3[_0xd3bb('0xb7')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xb8'));}var _0x4e89cf=_0x5841c3['grammar'];if(this[_0xd3bb('0x8f')](_0x5841c3[_0xd3bb('0x87')])){_0x4e89cf+=','+_0x5841c3['options'];}var _0x444bbd=this['channel']['exec'](_0xd3bb('0xb9'),_0x4e89cf);if(_0x444bbd[_0xd3bb('0xb5')]===-0x1){return _0x444bbd;}var _0x58c24c=this[_0xd3bb('0xad')](_0xd3bb('0xba'),_0xd3bb('0xbb'));if(_0x58c24c[_0xd3bb('0xb5')]===-0x1){return _0x58c24c;}var _0x52e208=this[_0xd3bb('0xad')](_0xd3bb('0xbc'),_0xd3bb('0xbd'));if(_0x52e208[_0xd3bb('0xb5')]===-0x1){return _0x52e208;}var _0x5184be=this[_0xd3bb('0xad')](_0xd3bb('0xbe'),'MRCP_RECOG_INSTANCE');if(_0x5184be[_0xd3bb('0xb5')]===-0x1){return _0x5184be;}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4e89cf));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x8')]=function(_0x46a542){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0xbf'),_0x46a542[_0xd3bb('0x3b')]));return this['channel'][_0xd3bb('0x8')]([_0x46a542['command'],_0x46a542[_0xd3bb('0xc0')]]);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xc1')]=function(_0x59e067){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x59e067['label']));if(this['isConfigured'](_0x59e067[_0xd3bb('0x76')])){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0xc2'),_0x59e067[_0xd3bb('0x76')]));var _0x212b5e=this['channel'][_0xd3bb('0xc3')](_0x59e067[_0xd3bb('0x76')]);if(_0x212b5e['result']===-0x1){return _0x212b5e;}}return this[_0xd3bb('0x11')][_0xd3bb('0xc1')]();};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xc4')]=function(_0xe3a399){console['log'](_0xd3bb('0xc5'),_0xe3a399);logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0xc6'),_0xe3a399['label']));if(!this[_0xd3bb('0x8f')](_0xe3a399[_0xd3bb('0x4d')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xe3a399,'no\x20list\x20selected');}_0xe3a399[_0xd3bb('0x4e')]=moment();if(this[_0xd3bb('0x8f')](_0xe3a399[_0xd3bb('0xc7')])){_0xe3a399['scheduledAt']=moment()[_0xd3bb('0x5c')](_0xe3a399[_0xd3bb('0xc7')],'minutes');}if(!this[_0xd3bb('0x8f')](_0xe3a399[_0xd3bb('0x51')])){_0xe3a399[_0xd3bb('0x51')]=0x2;}console[_0xd3bb('0x45')](_0xd3bb('0xc8'),_0xe3a399);this[_0xd3bb('0x44')][_0xd3bb('0x7d')](this,_0xe3a399);return this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0xc9'),_0xe3a399[_0xd3bb('0x4c')],_0xe3a399['list_id'],_0xe3a399[_0xd3bb('0x4e')]));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xca')]=function(_0x36399c){logger['info'](util['format'](_0xd3bb('0xcb'),_0x36399c[_0xd3bb('0x3b')]));var _0x31b569=this['channel'][_0xd3bb('0x69')](_0x36399c[_0xd3bb('0xcc')],_0x36399c[_0xd3bb('0x87')]);if(_0x31b569[_0xd3bb('0xb5')]===-0x1){return _0x31b569;}return this[_0xd3bb('0x11')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x36399c[_0xd3bb('0xcc')],_0x36399c[_0xd3bb('0x87')]));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xcd')]=function(_0x286934){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0xce'),_0x286934['label']));if(!this[_0xd3bb('0x8f')](_0x286934[_0xd3bb('0x6d')])){return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0xcf'));}var _0x57cd32='\x22'+_0x286934[_0xd3bb('0x6d')]+'\x22';if(this['isConfigured'](_0x286934['options'])){_0x57cd32+=','+_0x286934['options'];}var _0x3c0f03=this[_0xd3bb('0x11')][_0xd3bb('0x69')](_0xd3bb('0xb4'),_0x57cd32);if(_0x3c0f03[_0xd3bb('0xb5')]===-0x1){return _0x3c0f03;}return this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')]('Executed\x20command\x20MRCPSynth\x20%s',_0x57cd32));};AGIVertices['prototype'][_0xd3bb('0xd0')]=function(_0x4c0d6c){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0xd1'),_0x4c0d6c[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x4c0d6c[_0xd3bb('0x6d')])){return this['channel'][_0xd3bb('0xb3')]('no\x20text\x20configured');}var _0x14c55b='\x22'+_0x4c0d6c[_0xd3bb('0x6d')]+'\x22';if(this[_0xd3bb('0x8f')](_0x4c0d6c['options'])){_0x14c55b+=','+_0x4c0d6c[_0xd3bb('0x87')];}var _0x42776a=this['channel']['exec']('MRCPSynth',_0x14c55b);if(_0x42776a[_0xd3bb('0xb5')]===-0x1){return _0x42776a;}return this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0xb6'),_0x14c55b));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xd2')]=function(_0x3c8c3d){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0xd3'),_0x3c8c3d[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x3c8c3d[_0xd3bb('0xb7')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xb8'));}var _0x1c6bc6=_0x3c8c3d[_0xd3bb('0xb7')];if(this[_0xd3bb('0x8f')](_0x3c8c3d[_0xd3bb('0x87')])){_0x1c6bc6+=','+_0x3c8c3d[_0xd3bb('0x87')];}var _0x447bde=this['channel'][_0xd3bb('0x69')](_0xd3bb('0xb9'),_0x1c6bc6);if(_0x447bde[_0xd3bb('0xb5')]===-0x1){return _0x447bde;}var _0x2ada2d=this[_0xd3bb('0xad')]('RECOG_CONFIDENCE()',_0xd3bb('0xd4'));if(_0x2ada2d[_0xd3bb('0xb5')]===-0x1){return _0x2ada2d;}var _0x2738c6=this[_0xd3bb('0xad')](_0xd3bb('0xbc'),_0xd3bb('0xd5'));if(_0x2738c6[_0xd3bb('0xb5')]===-0x1){return _0x2738c6;}var _0xab5544=this['getAndSetVariable'](_0xd3bb('0xbe'),'LUMENVOX_ASR_INSTANCE');if(_0xab5544[_0xd3bb('0xb5')]===-0x1){return _0xab5544;}return this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0xd6'),_0x1c6bc6));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xd7')]=function(_0x5bd208){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0xd8'),_0x5bd208[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x5bd208[_0xd3bb('0xb7')])){return this['channel'][_0xd3bb('0xb3')]('no\x20grammar\x20configured');}var _0x34ada1=_0x5bd208[_0xd3bb('0xb7')];if(this[_0xd3bb('0x8f')](_0x5bd208['options'])){_0x34ada1+=','+_0x5bd208[_0xd3bb('0x87')];}var _0x2ff110=this[_0xd3bb('0x11')][_0xd3bb('0x69')](_0xd3bb('0xb9'),_0x34ada1);if(_0x2ff110[_0xd3bb('0xb5')]===-0x1){return _0x2ff110;}var _0x33d412=this[_0xd3bb('0xad')](_0xd3bb('0xba'),'SESTEK_ASR_CONFIDENCE');if(_0x33d412[_0xd3bb('0xb5')]===-0x1){return _0x33d412;}var _0x4005c9=this[_0xd3bb('0xad')](_0xd3bb('0xbc'),_0xd3bb('0xd9'));if(_0x4005c9['result']===-0x1){return _0x4005c9;}var _0x3f620b=this['getAndSetVariable'](_0xd3bb('0xbe'),_0xd3bb('0xda'));if(_0x3f620b['result']===-0x1){return _0x3f620b;}return this['channel']['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0xd6'),_0x34ada1));};AGIVertices[_0xd3bb('0x18')]['database']=function(_0xd10644){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0xdb'),_0xd10644[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0xd10644[_0xd3bb('0xdc')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xd10644,'no\x20database\x20selected');}var _0x4d9a88=this['getSquareOdbc'][_0xd3bb('0x7d')](this,_0xd10644[_0xd3bb('0xdc')]);if(!_0x4d9a88){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xd10644,_0xd3bb('0xdd'));}if(!this[_0xd3bb('0x8f')](_0xd10644[_0xd3bb('0xde')])){return this[_0xd3bb('0x11')]['error'](_0xd10644,_0xd3bb('0xdf'));}var _0x1b22e2=_0xd10644[_0xd3bb('0xde')][_0xd3bb('0x6a')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0xe0'),_0x1b22e2));var _0x449e14=this[_0xd3bb('0x2e')][_0xd3bb('0x7d')](this,_0x4d9a88,_0x1b22e2);this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0xd10644,_0x1b22e2);if(!this[_0xd3bb('0x8f')](_0xd10644[_0xd3bb('0xe1')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x468d34=this['getVariable'][_0xd3bb('0x7d')](this,_0xd10644[_0xd3bb('0xe1')]);if(!_0x468d34){return this['channel'][_0xd3bb('0x30')](_0xd10644,_0xd3bb('0xe2'));}var _0x269577=this;_0x449e14[_0xd3bb('0xe3')](function(_0x942d6a,_0xaefdd7){Object[_0xd3bb('0xe4')](_0x942d6a)['forEach'](function(_0x52cc1a){_0x269577['channel'][_0xd3bb('0xaa')](util[_0xd3bb('0xa8')](_0xd3bb('0xe5'),_0x468d34,_0xaefdd7,_0x52cc1a),_0x942d6a[_0x52cc1a]);});});this[_0xd3bb('0x11')][_0xd3bb('0xaa')](util[_0xd3bb('0xa8')](_0xd3bb('0xe6'),_0x468d34),_0x449e14[_0xd3bb('0xa6')]);return this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0xe7'),_0x468d34));};AGIVertices[_0xd3bb('0x18')]['dial']=function(_0x3b9515){logger[_0xd3bb('0xe8')](util['format'](_0xd3bb('0xe9'),_0x3b9515[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x3b9515[_0xd3bb('0xea')])){return this[_0xd3bb('0x11')]['error'](_0x3b9515,_0xd3bb('0xeb'));}var _0x4bc28f=this['getUser']['sync'](this,_0x3b9515['sip_id']);if(!_0x4bc28f){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x3b9515,_0xd3bb('0xec'));}var _0x26768d=this[_0xd3bb('0x11')][_0xd3bb('0x69')]('DIAL',[util[_0xd3bb('0xa8')](_0xd3bb('0xed'),_0x4bc28f),_0x3b9515[_0xd3bb('0x76')],_0x3b9515[_0xd3bb('0xee')],_0x3b9515[_0xd3bb('0x80')]]);if(_0x26768d[_0xd3bb('0xb5')]===-0x1){return _0x26768d;}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0xef'),_0xd3bb('0xf0')));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xf1')]=function(_0x311183){logger['info'](util[_0xd3bb('0xa8')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x311183[_0xd3bb('0x3b')]));if(!this['isConfigured'](_0x311183[_0xd3bb('0x8b')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xf2'));}if(!this[_0xd3bb('0x8f')](_0x311183[_0xd3bb('0x6d')])){return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0xcf'));}this[_0xd3bb('0x11')][_0xd3bb('0xf3')]=!![];this[_0xd3bb('0x39')](_0x311183);this[_0xd3bb('0x43')](_0x311183[_0xd3bb('0x6d')],'in');this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')]('Trying\x20Dialogflow:\x20%s',_0x311183['text']));var _0x4cd309=this['googleDialogflow'][_0xd3bb('0x7d')](this,_0x311183);if(_0x4cd309){for(var _0xeefe48 in _0x4cd309){if(_0x4cd309['hasOwnProperty'](_0xeefe48)){this[_0xd3bb('0x11')][_0xd3bb('0xaa')](util['format'](_0xd3bb('0xf4'),_0xeefe48['toUpperCase']()),_0x4cd309[_0xeefe48]);}}this[_0xd3bb('0x43')](_0x4cd309[_0xd3bb('0xf5')],'out');return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0xf6'),_0x4cd309[_0xd3bb('0xf5')]));}return this[_0xd3bb('0x11')]['error'](_0x311183,_0xd3bb('0xf7'));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xf8')]=function(_0x1c3ad1){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0xf9'),_0x1c3ad1[_0xd3bb('0x3b')]));if(!this['isConfigured'](_0x1c3ad1[_0xd3bb('0xfa')])){return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0xfb'));}if(!this[_0xd3bb('0x8f')](_0x1c3ad1[_0xd3bb('0xfc')])){return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0xfd'));}if(!this[_0xd3bb('0x8f')](_0x1c3ad1[_0xd3bb('0xfe')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xff'));}if(!this['isConfigured'](_0x1c3ad1['ndassistant_url'])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xcf'));}this[_0xd3bb('0x11')][_0xd3bb('0xf3')]=!![];this[_0xd3bb('0x39')](_0x1c3ad1);this[_0xd3bb('0x43')](_0x1c3ad1[_0xd3bb('0x6d')],'in');this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format'](_0xd3bb('0x100'),_0x1c3ad1['text']));var _0x307efe=this[_0xd3bb('0x89')][_0xd3bb('0x7d')](this,_0x1c3ad1);if(_0x307efe){for(var _0x7ab4f7 in _0x307efe){if(_0x307efe[_0xd3bb('0x9f')](_0x7ab4f7)){this[_0xd3bb('0x11')]['setVariable'](util[_0xd3bb('0xa8')](_0xd3bb('0x101'),_0x7ab4f7[_0xd3bb('0x79')]()),_0x307efe[_0x7ab4f7]);}}this[_0xd3bb('0x43')](_0x307efe[_0xd3bb('0xf5')],_0xd3bb('0x102'));if(_0x307efe[_0xd3bb('0x103')]){this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x307efe[_0xd3bb('0x103')]));var _0x3858e3=this[_0xd3bb('0x11')][_0xd3bb('0x104')](_0x307efe[_0xd3bb('0x103')]);try{fs[_0xd3bb('0x105')](_0x307efe['audiofile']+'.wav');}catch(_0x33a51e){logger[_0xd3bb('0x30')](_0x33a51e);}return _0x3858e3;}else{return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format'](_0xd3bb('0x106'),_0x307efe[_0xd3bb('0xf5')]));}}return this['channel'][_0xd3bb('0x30')](_0x1c3ad1,_0xd3bb('0x107'));};AGIVertices['prototype'][_0xd3bb('0x108')]=function(_0x124ad5){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x124ad5[_0xd3bb('0x3b')]));return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('end');};AGIVertices['prototype'][_0xd3bb('0x109')]=function(_0x48b3f9){logger[_0xd3bb('0x32')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x48b3f9[_0xd3bb('0x3b')]));var _0x2b7dc2='';if(_0x48b3f9[_0xd3bb('0x10a')]){if(!this[_0xd3bb('0x8f')](_0x48b3f9[_0xd3bb('0x10a')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x48b3f9,_0xd3bb('0x10b'));}else{var _0x35d99b=parseInt(_0x48b3f9[_0xd3bb('0x10a')],0xa);if(isNaN(_0x35d99b)){_0x2b7dc2=_0x48b3f9[_0xd3bb('0x10a')];}else{_0x2b7dc2=this['getTrunk']['sync'](this,_0x48b3f9[_0xd3bb('0x10a')]);if(!_0x2b7dc2){return this[_0xd3bb('0x11')]['error'](_0x48b3f9,_0xd3bb('0x10c'));}}}}else if(_0x48b3f9['trunk_name']){_0x2b7dc2=_0x48b3f9[_0xd3bb('0x10d')];}else{return this['channel']['error'](_0x48b3f9,_0xd3bb('0x10b'));}var _0x71e06d=this['channel']['exec']('DIAL',[util[_0xd3bb('0xa8')](_0xd3bb('0x10e'),_0x2b7dc2,_0x48b3f9[_0xd3bb('0x4c')]),_0x48b3f9[_0xd3bb('0x76')],_0x48b3f9['opts'],_0x48b3f9[_0xd3bb('0x80')]]);if(_0x71e06d[_0xd3bb('0xb5')]===-0x1){return _0x71e06d;}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format'](_0xd3bb('0xef'),_0xd3bb('0xf0')));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x10f')]=function(_0x1c8994){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x110'),_0x1c8994['label']));return this[_0xd3bb('0x11')]['noop'](_0xd3bb('0x10f'));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xf')]=function(_0xb75bee){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0xb75bee[_0xd3bb('0x3b')]));if(_0xb75bee[_0xd3bb('0xb0')]===0x0){return this[_0xd3bb('0xaf')](_0xb75bee);}_0xb75bee[_0xd3bb('0xb0')]-=0x1;if(!this[_0xd3bb('0x8f')](_0xb75bee[_0xd3bb('0x111')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xb75bee,_0xd3bb('0x112'));}var _0x32387b=this[_0xd3bb('0x22')][_0xd3bb('0x7d')](this,_0xb75bee[_0xd3bb('0x111')]);if(!_0x32387b){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xb75bee,'no\x20file\x20audio\x20found');}if(!this[_0xd3bb('0x8f')](_0xb75bee['variable_id'])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xd3bb('0x113'));}var _0x3bab5=this[_0xd3bb('0x11')][_0xd3bb('0x114')](_0x32387b,_0xb75bee[_0xd3bb('0x115')],_0xb75bee[_0xd3bb('0x116')]);var _0x5fb454=_0x3bab5[_0xd3bb('0xb5')]?_0x3bab5['result'][_0xd3bb('0x50')]():'';logger[_0xd3bb('0x32')]('test',JSON[_0xd3bb('0x82')](_0x3bab5));if(_0x3bab5[_0xd3bb('0xb5')]===-0x1){this['createSquareDetailsReport'][_0xd3bb('0x7d')](this,_0xb75bee,_0x5fb454);return _0x3bab5;}else if(_0x3bab5[_0xd3bb('0xae')]===_0xd3bb('0x76')){_0x3bab5[_0xd3bb('0xb5')]=_0x5fb454[_0xd3bb('0xa6')]>=parseInt(_0xb75bee[_0xd3bb('0x117')])?'x':'i';}else{_0x3bab5[_0xd3bb('0xb5')]=_0x5fb454[_0xd3bb('0xa6')]>=parseInt(_0xb75bee[_0xd3bb('0x117')])&&_0x5fb454['length']<=parseInt(_0xb75bee['maxdigit'])?'x':'i';}var _0xafad23=this[_0xd3bb('0x13')]['sync'](this,_0xb75bee[_0xd3bb('0xe1')]);if(!_0xafad23){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0xb75bee,'no\x20variable\x20found');}this[_0xd3bb('0x11')][_0xd3bb('0xaa')](_0xafad23,_0x5fb454);if(this['isConfigured'](_0xb75bee['hiddendigitsnum'])){var _0xb43ffa=parseInt(_0xb75bee[_0xd3bb('0x118')],0xa);var _0x201772=rs[_0xd3bb('0x119')]({'charset':'*','length':_0xb43ffa});var _0x3213d8=_0x5fb454[_0xd3bb('0xa6')];if(_0x3213d8>0x0){if(_0x3213d8>_0xb43ffa){this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0xb75bee,_0xb75bee['hiddendigitspos']===_0xd3bb('0x11a')?_0x201772+_0x5fb454[_0xd3bb('0x11b')](_0xb43ffa):_0x5fb454[_0xd3bb('0x11b')](0x0,_0x3213d8-_0xb43ffa)+_0x201772);}else{this['createSquareDetailsReport']['sync'](this,_0xb75bee,rs['generate']({'charset':'*','length':_0x3213d8}));}}else{this[_0xd3bb('0x39')]['sync'](this,_0xb75bee,'');}}else{this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0xb75bee,_0x5fb454);}return _0x3bab5;};AGIVertices['prototype'][_0xd3bb('0x10')]=function(_0x34bffb){logger['info'](util['format'](_0xd3bb('0x11c'),_0x34bffb['label']));return this[_0xd3bb('0xf')](_0x34bffb);};AGIVertices[_0xd3bb('0x18')]['goal']=function(_0x2caf33){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x11d'),_0x2caf33[_0xd3bb('0x3b')]));this['createSquareDetailsReport']['sync'](this,_0x2caf33,_0x2caf33[_0xd3bb('0x11e')]);return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format'](_0xd3bb('0x11f'),_0x2caf33[_0xd3bb('0x11e')]));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x120')]=function(_0x5d269e){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0x121'),_0x5d269e[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x5d269e[_0xd3bb('0x92')])||!this[_0xd3bb('0x8f')](_0x5d269e['aws_secret_access_key'])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x122'));}if(!this[_0xd3bb('0x8f')](_0x5d269e[_0xd3bb('0x6d')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xcf'));}this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('Trying\x20aws\x20Polly\x20%s',_0x5d269e[_0xd3bb('0x6d')]));var _0xafe443=this[_0xd3bb('0x91')][_0xd3bb('0x7d')](this,_0x5d269e);if(_0xafe443){this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x123'),_0xafe443));var _0x535e68=this[_0xd3bb('0x11')][_0xd3bb('0x104')](_0xafe443);try{fs['unlink'](_0xafe443+_0xd3bb('0x124'));}catch(_0x30b36c){logger[_0xd3bb('0x30')](_0x30b36c);}return _0x535e68;}return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x5d269e,_0xd3bb('0x125'));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x126')]=function(_0x63c649){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x127'),_0x63c649['label']));if(!this[_0xd3bb('0x8f')](_0x63c649[_0xd3bb('0x92')])||!this['isConfigured'](_0x63c649[_0xd3bb('0x93')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x122'));}if(!this['isConfigured'](_0x63c649['aws_bot_name'])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('no\x20bot\x20name\x20configured');}if(!this[_0xd3bb('0x8f')](_0x63c649[_0xd3bb('0x6d')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xcf'));}this['channel'][_0xd3bb('0xf3')]=!![];this[_0xd3bb('0x39')](_0x63c649);this['createSquareMessage'](_0x63c649[_0xd3bb('0x6d')],'in');this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0x128'),_0x63c649['text']));var _0x3f951b=this[_0xd3bb('0x96')][_0xd3bb('0x7d')](this,_0x63c649);if(_0x3f951b){for(var _0x562d7e in _0x3f951b){if(_0x3f951b['hasOwnProperty'](_0x562d7e)&&_[_0xd3bb('0xa0')](_0x3f951b[_0x562d7e])){this[_0xd3bb('0x11')][_0xd3bb('0xaa')](util['format']('AWS_LEX_%s',_0x562d7e[_0xd3bb('0x79')]()),_0x3f951b[_0x562d7e]);}}if(_[_0xd3bb('0x49')](_0x3f951b[_0xd3bb('0x85')])){return this[_0xd3bb('0x11')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xd3bb('0x43')](_0x3f951b[_0xd3bb('0x85')],_0xd3bb('0x102'));return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('Amazon\x20Lex\x20Result\x20%s',_0x3f951b[_0xd3bb('0x85')]));}}return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x63c649,_0xd3bb('0x129'));};AGIVertices['prototype']['googleasr']=function(_0x49a495){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x49a495[_0xd3bb('0x3b')],_0x49a495[_0xd3bb('0x76')]));if(!this[_0xd3bb('0x8f')](_0x49a495[_0xd3bb('0x8b')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('no\x20key\x20configured');}var _0x14e087=_0xd3bb('0x12a');var _0x3acdb4=util[_0xd3bb('0xa8')]('%s/recordings/%s',FILES_PATH,rs[_0xd3bb('0x119')](0x4));var _0x27fbe4=util[_0xd3bb('0xa8')]('%s.%s',_0x3acdb4,_0x14e087);var _0x1dcbfd=!![];if(_0x49a495[_0xd3bb('0x12b')]===_0xd3bb('0x12c')){_0x1dcbfd=![];}var _0x3577c2=this[_0xd3bb('0x11')]['recordFile'](_0x3acdb4,_0x14e087,_0x49a495[_0xd3bb('0x12d')],_0x49a495[_0xd3bb('0x76')],undefined,_0x1dcbfd);if(_0x3577c2[_0xd3bb('0xb5')]!==-0x1){this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0x12e'),_0x27fbe4));var _0x222f94=this[_0xd3bb('0x99')][_0xd3bb('0x7d')](this,_0x49a495,_0x27fbe4);if(_0x222f94){for(var _0x4bfe81 in _0x222f94){if(_0x222f94[_0xd3bb('0x9f')](_0x4bfe81)){this['channel'][_0xd3bb('0xaa')](util[_0xd3bb('0xa8')](_0xd3bb('0x12f'),_0x4bfe81[_0xd3bb('0x79')]()),_0x222f94[_0x4bfe81]);}}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x130'),JSON[_0xd3bb('0x82')](_0x222f94)));}}return _0x3577c2;};AGIVertices[_0xd3bb('0x18')]['tildeasr']=function(_0x25478a){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x131'),_0x25478a[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x25478a[_0xd3bb('0x132')])){return this['channel']['noop'](_0xd3bb('0x133'));}if(!this[_0xd3bb('0x8f')](_0x25478a[_0xd3bb('0x9c')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x134'));}var _0x449592=_0xd3bb('0x12a');var _0xab0ca7=util['format'](_0xd3bb('0x135'),FILES_PATH,rs[_0xd3bb('0x119')](0x4));var _0x3096fe=util['format']('%s.%s',_0xab0ca7,_0x449592);var _0x4f46bd=!![];if(_0x25478a[_0xd3bb('0x12b')]===_0xd3bb('0x12c')){_0x4f46bd=![];}var _0x3849ee=this[_0xd3bb('0x11')][_0xd3bb('0x136')](_0xab0ca7,_0x449592,_0x25478a['intKey'],_0x25478a[_0xd3bb('0x76')],undefined,_0x4f46bd);if(_0x3849ee['result']!==-0x1){this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x137'),_0x3096fe));var _0x26dc50=this[_0xd3bb('0x9b')][_0xd3bb('0x7d')](this,_0x25478a,_0x3096fe);if(_0x26dc50){for(var _0x783c65 in _0x26dc50){if(_0x26dc50[_0xd3bb('0x9f')](_0x783c65)){this[_0xd3bb('0x11')][_0xd3bb('0xaa')](util[_0xd3bb('0xa8')](_0xd3bb('0x138'),_0x783c65['toUpperCase']()),_0x26dc50[_0x783c65]);}}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format']('TildeASR\x20Result\x20%s',JSON['stringify'](_0x26dc50)));}}return _0x3849ee;};AGIVertices[_0xd3bb('0x18')]['gotoc']=function(_0xe4d882){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0xe4d882[_0xd3bb('0x3b')]));return this[_0xd3bb('0x11')][_0xd3bb('0x139')](_0xe4d882[_0xd3bb('0x13a')],_0xe4d882[_0xd3bb('0x13b')],_0xe4d882[_0xd3bb('0x41')]);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x13c')]=function(_0x57f991){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x13d'),_0x57f991['label']));if(!this[_0xd3bb('0x8f')](_0x57f991['condition'])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x57f991,_0xd3bb('0x13e'));}try{var _0x5561ea=eval(_0x57f991[_0xd3bb('0x13f')])?_0xd3bb('0x140'):'false';this[_0xd3bb('0x11')]['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x57f991[_0xd3bb('0x13f')],_0x5561ea));return{'code':0xc8,'result':_0x5561ea};}catch(_0x3c5398){return{'code':0xc8,'result':_0xd3bb('0x141')};}};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x142')]=function(_0x5a0e5f){logger[_0xd3bb('0x32')](util['format']('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5a0e5f[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x5a0e5f['interval_id'])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x5a0e5f,_0xd3bb('0x143'));}var _0x13b2cf=this[_0xd3bb('0x28')][_0xd3bb('0x7d')](this,_0x5a0e5f[_0xd3bb('0x144')]);if(!_0x13b2cf){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x5a0e5f,_0xd3bb('0x145'));}for(var _0x3a4107=0x0;_0x3a4107<_0x13b2cf[_0xd3bb('0xa6')];_0x3a4107+=0x1){var _0x8ff92c=this[_0xd3bb('0x11')][_0xd3bb('0x13')](util[_0xd3bb('0xa8')](_0xd3bb('0x146'),_0x13b2cf[_0x3a4107]));if(_0x8ff92c[_0xd3bb('0xb5')]===-0x1){return _0x8ff92c;}logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x147'),_0x13b2cf[_0x3a4107],_0x8ff92c['extra']));if(_0x8ff92c[_0xd3bb('0xae')]==='true'){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x147'),_0x13b2cf[_0x3a4107],_0xd3bb('0x140')));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x147'),_0x13b2cf[_0x3a4107],_0xd3bb('0x140')));return{'code':0xc8,'result':_0xd3bb('0x140')};}else{logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('IFTIME\x20%s\x20%s',_0x13b2cf[_0x3a4107],'false'));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x147'),_0x13b2cf[_0x3a4107],_0xd3bb('0x141')));}}return{'code':0xc8,'result':_0xd3bb('0x141')};};AGIVertices['prototype']['hangup']=function(_0xbd7704){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0x148'),_0xbd7704[_0xd3bb('0x3b')]));return this[_0xd3bb('0x11')]['hangup']();};AGIVertices['prototype'][_0xd3bb('0x149')]=function(_0xe1a7be){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x14a'),_0xe1a7be['label']));if(!this[_0xd3bb('0x8f')](_0xe1a7be[_0xd3bb('0x8b')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0xf2'));}var _0x4be2a8='wav';var _0x530031=util['format'](_0xd3bb('0x135'),FILES_PATH,rs[_0xd3bb('0x119')](0x4));var _0x5cd16a=util[_0xd3bb('0xa8')]('%s.%s',_0x530031,_0x4be2a8);var _0x453e18=!![];if(_0xe1a7be['beep']===_0xd3bb('0x12c')){_0x453e18=![];}var _0x2c30b3=this['channel'][_0xd3bb('0x136')](_0x530031,_0x4be2a8,_0xe1a7be[_0xd3bb('0x12d')],_0xe1a7be[_0xd3bb('0x76')],undefined,_0x453e18);if(_0x2c30b3[_0xd3bb('0xb5')]!==-0x1){this[_0xd3bb('0x11')]['noop'](util['format'](_0xd3bb('0x14b'),_0x5cd16a));var _0x48e391=this[_0xd3bb('0x8d')][_0xd3bb('0x7d')](this,_0xe1a7be,_0x5cd16a);if(_0x48e391){for(var _0x277eeb in _0x48e391){if(_0x48e391['hasOwnProperty'](_0x277eeb)){this[_0xd3bb('0x11')]['setVariable'](util['format'](_0xd3bb('0x14c'),_0x277eeb['toUpperCase']()),_0x48e391[_0x277eeb]);}}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x14d'),JSON[_0xd3bb('0x82')](_0x48e391)));}}return _0x2c30b3;};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x14e')]=function(_0x36e078){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x14f'),_0x36e078['label']));if(!this[_0xd3bb('0x8f')](_0x36e078[_0xd3bb('0x8b')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('no\x20key\x20configured');}if(!this[_0xd3bb('0x8f')](_0x36e078[_0xd3bb('0x6d')])){return this[_0xd3bb('0x11')]['noop'](_0xd3bb('0xcf'));}this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0x150'),_0x36e078['text']));var _0x2c9895=this[_0xd3bb('0x8a')]['sync'](this,_0x36e078);if(_0x2c9895){this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x14b'),_0x2c9895));var _0x475e42=this[_0xd3bb('0x11')]['streamFile'](_0x2c9895,_0x36e078[_0xd3bb('0x12d')]);try{fs[_0xd3bb('0x105')](_0x2c9895+'.wav');}catch(_0x4ca80a){logger[_0xd3bb('0x30')](_0x4ca80a);}return _0x475e42;}return this[_0xd3bb('0x11')]['error'](_0x36e078,_0xd3bb('0x151'));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x152')]=function(_0x21510f){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0x153'),_0x21510f[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x21510f[_0xd3bb('0x154')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x21510f,_0xd3bb('0x155'));}logger['info'](util[_0xd3bb('0xa8')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd3bb('0x11')]['callerid'],_0x21510f[_0xd3bb('0x154')]));var _0x50c8ac=this[_0xd3bb('0x66')]['sync'](this,_0x21510f[_0xd3bb('0x154')]);if(_0x50c8ac){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0x156'),this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x21510f[_0xd3bb('0x154')]));this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x156'),this['channel'][_0xd3bb('0x3e')],_0x21510f[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x157')};}else{logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x21510f[_0xd3bb('0x154')]));this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd3bb('0x3e')],_0x21510f[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x158')};}};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x159')]=function(_0x3b754a){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3b754a['label']));if(!this[_0xd3bb('0x8f')](_0x3b754a['findBy'])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x3b754a,_0xd3bb('0x155'));}logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x15a'),this[_0xd3bb('0x11')]['callerid'],_0x3b754a[_0xd3bb('0x154')]));var _0x2c6327=this[_0xd3bb('0x65')][_0xd3bb('0x7d')](this,_0x3b754a[_0xd3bb('0x154')]);if(_0x2c6327){logger[_0xd3bb('0x32')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd3bb('0x3e')],_0x3b754a[_0xd3bb('0x154')]));this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0x156'),this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x3b754a[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x157')};}else{logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x3b754a[_0xd3bb('0x154')]));this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x15b'),this['channel'][_0xd3bb('0x3e')],_0x3b754a[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x158')};}};AGIVertices['prototype'][_0xd3bb('0x15c')]=function(_0x3a3fa9){logger[_0xd3bb('0x32')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3a3fa9['label']));if(!this[_0xd3bb('0x8f')](_0x3a3fa9[_0xd3bb('0x15d')])){return this['channel'][_0xd3bb('0x30')](_0x3a3fa9,_0xd3bb('0x15e'));}this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x15f'),_0x3a3fa9[_0xd3bb('0x15d')]));var _0x4cc5dc=eval(_0x3a3fa9[_0xd3bb('0x15d')]);if(!this[_0xd3bb('0x8f')](_0x3a3fa9[_0xd3bb('0xe1')])){return this[_0xd3bb('0x11')]['noop'](_0xd3bb('0x113'));}var _0xd09b29=this[_0xd3bb('0x13')][_0xd3bb('0x7d')](this,_0x3a3fa9['variable_id']);if(!_0xd09b29){return this['channel'][_0xd3bb('0x30')](_0x3a3fa9,_0xd3bb('0xe2'));}if(_[_0xd3bb('0xa5')](_0x4cc5dc)){var _0x2876ac=this;_0x4cc5dc[_0xd3bb('0xe3')](function(_0x226b2d,_0x1faf10){_0x2876ac[_0xd3bb('0x11')]['setVariable'](util[_0xd3bb('0xa8')](_0xd3bb('0x160'),_0xd09b29,_0x1faf10),_0x226b2d);});return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('variable\x20%s[key]\x20set',_0xd09b29));}else{return this['channel'][_0xd3bb('0xaa')](_0xd09b29,_0x4cc5dc);}};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0xe')]=function(_0x3c5817){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x161'),_0x3c5817[_0xd3bb('0x3b')]));if(_0x3c5817[_0xd3bb('0xb0')]===0x0){return this['maxRetry'](_0x3c5817);}_0x3c5817[_0xd3bb('0xb0')]-=0x1;if(!this[_0xd3bb('0x8f')](_0x3c5817[_0xd3bb('0x111')])){return this['channel'][_0xd3bb('0x30')](_0x3c5817,'no\x20file\x20audio\x20selected');}var _0x4622a3=this[_0xd3bb('0x22')][_0xd3bb('0x7d')](this,_0x3c5817['file_id']);if(!_0x4622a3){return this[_0xd3bb('0x11')]['error'](_0x3c5817,_0xd3bb('0x162'));}var _0x1364d2=this[_0xd3bb('0x11')][_0xd3bb('0x114')](_0x4622a3,_0x3c5817[_0xd3bb('0x115')],_0x3c5817[_0xd3bb('0x163')]);var _0x3a7856=_0x1364d2[_0xd3bb('0xb5')];if(_0x1364d2[_0xd3bb('0xb5')]===-0x1){this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0x3c5817,'-1');return _0x1364d2;}else if(_0x1364d2[_0xd3bb('0xae')]===_0xd3bb('0x76')){_0x1364d2['result']=_0x1364d2[_0xd3bb('0xb5')]['length']>0x0?_0x1364d2[_0xd3bb('0xb5')]:'t';}else if(_[_0xd3bb('0x48')](_0x1364d2[_0xd3bb('0xb5')])){_0x1364d2['result']='#';_0x3a7856='#';}if(!this[_0xd3bb('0x8f')](_0x3c5817['variable_id'])){this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x113'));}else{var _0x5d7450=this[_0xd3bb('0x13')][_0xd3bb('0x7d')](this,_0x3c5817['variable_id']);if(!_0x5d7450){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x3c5817,_0xd3bb('0xe2'));}this[_0xd3bb('0x11')]['setVariable'](_0x5d7450,_0x3a7856);}this['createSquareDetailsReport']['sync'](this,_0x3c5817,_0x3a7856);return _0x1364d2;};AGIVertices['prototype'][_0xd3bb('0xb3')]=function(_0x4b621e){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x164'),_0x4b621e['label']));return this[_0xd3bb('0x11')]['noop'](_0x4b621e[_0xd3bb('0x165')]||_0x4b621e[_0xd3bb('0x3b')]);};AGIVertices['prototype'][_0xd3bb('0x166')]=function(_0x3d9e31){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x167'),_0x3d9e31[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x3d9e31['findBy'])){return this[_0xd3bb('0x11')]['error'](_0x3d9e31,_0xd3bb('0x155'));}logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x3d9e31[_0xd3bb('0x154')]));var _0x59b8b7=this[_0xd3bb('0x60')][_0xd3bb('0x7d')](this,_0x3d9e31['pause_id']);var _0x58e779=this['agentPause'][_0xd3bb('0x7d')](this,_0x3d9e31[_0xd3bb('0x154')],_0x59b8b7);if(_0x58e779){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x156'),this[_0xd3bb('0x11')]['callerid'],_0x3d9e31['findBy']));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x156'),this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x3d9e31[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x157')};}else{logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x3d9e31['findBy']));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x3d9e31[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x158')};}};AGIVertices[_0xd3bb('0x18')]['playback']=function(_0x27a047){logger[_0xd3bb('0x32')](util['format'](_0xd3bb('0x168'),_0x27a047[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x27a047[_0xd3bb('0x111')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x27a047,_0xd3bb('0x112'));}var _0x8faf7d=this[_0xd3bb('0x22')][_0xd3bb('0x7d')](this,_0x27a047[_0xd3bb('0x111')]);if(!_0x8faf7d){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x27a047,_0xd3bb('0x162'));}var _0x217bc8=this[_0xd3bb('0x11')]['exec']('PLAYBACK',[_0x8faf7d,_0x27a047[_0xd3bb('0xee')]]);if(_0x217bc8[_0xd3bb('0xb5')]===-0x1){return _0x217bc8;}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('Executed\x20command\x20%s\x20%s',_0xd3bb('0x169'),_0x8faf7d));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x16a')]=function(_0x13bc9c){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x16b'),_0x13bc9c[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x13bc9c['queue_id'])){return this['channel'][_0xd3bb('0x30')](_0x13bc9c,_0xd3bb('0x16c'));}var _0x50fa52='';var _0x19de4c=parseInt(_0x13bc9c[_0xd3bb('0x16d')],0xa);if(isNaN(_0x19de4c)){_0x50fa52=_0x13bc9c[_0xd3bb('0x16d')];}else{_0x50fa52=this[_0xd3bb('0x19')]['sync'](this,_0x13bc9c[_0xd3bb('0x16d')]);if(!_0x50fa52){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x13bc9c,'no\x20queue\x20found');}}var _0x21b81d='';if(this[_0xd3bb('0x8f')](_0x13bc9c[_0xd3bb('0x111')])){var _0x4acb8b=this[_0xd3bb('0x22')][_0xd3bb('0x7d')](this,_0x13bc9c[_0xd3bb('0x111')]);if(_0x4acb8b){_0x21b81d=_0x4acb8b;}}this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0x13bc9c,_0x50fa52);if(_0x13bc9c[_0xd3bb('0xee')]['indexOf']('x')<0x0){_0x13bc9c[_0xd3bb('0xee')]+='x';}if(_0x13bc9c[_0xd3bb('0xee')][_0xd3bb('0x16e')]('X')<0x0){_0x13bc9c[_0xd3bb('0xee')]+='X';}this[_0xd3bb('0x11')]['setVariable']('XMCS-QUEUE',_0x50fa52?_0x50fa52['toLowerCase']():'');var _0x62a25c=this[_0xd3bb('0x11')][_0xd3bb('0x69')](_0xd3bb('0x16f'),[_0x50fa52,_0x13bc9c['opts'],_0x13bc9c[_0xd3bb('0x80')],_0x21b81d,_0x13bc9c[_0xd3bb('0x76')],_0x13bc9c[_0xd3bb('0x8')],_0x13bc9c[_0xd3bb('0x170')],_0x13bc9c[_0xd3bb('0x171')],'',_0x13bc9c[_0xd3bb('0x172')]]);if(_0x62a25c[_0xd3bb('0xb5')]===-0x1){return _0x62a25c;}return this[_0xd3bb('0x11')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xd3bb('0x16f'),_0x50fa52));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x173')]=function(_0x2e7242){logger[_0xd3bb('0x32')](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x2e7242[_0xd3bb('0x3b')]));var _0x49dce7=_0x2e7242[_0xd3bb('0x174')]||_0xd3bb('0x12a');var _0x97a398=util[_0xd3bb('0xa8')]('%s_%s',this[_0xd3bb('0x11')][_0xd3bb('0x3a')],rs[_0xd3bb('0x119')](0x5));var _0xa19531=util[_0xd3bb('0xa8')](_0xd3bb('0x175'),FILES_PATH,_0x97a398,_0x49dce7);var _0x4a0a07=util['format'](_0xd3bb('0x135'),FILES_PATH,_0x97a398);this['createSquareRecording'][_0xd3bb('0x7d')](this,_0x2e7242,_0x97a398,_0xa19531);this['channel'][_0xd3bb('0xaa')](_0xd3bb('0x176'),_0x97a398);logger[_0xd3bb('0x32')](_0xd3bb('0x177'),_0x4a0a07,_0x49dce7,_0x2e7242[_0xd3bb('0x178')],_0x2e7242[_0xd3bb('0x76')]);return this[_0xd3bb('0x11')][_0xd3bb('0x136')](_0x4a0a07,_0x49dce7,_0x2e7242[_0xd3bb('0x178')],_0x2e7242[_0xd3bb('0x76')],undefined,!![]);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x179')]=function(_0x128f36){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x17a'),_0x128f36[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x128f36[_0xd3bb('0x80')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x17b'));}var _0x23cebf=this[_0xd3bb('0x74')]['sync'](this,_0x128f36);logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x17c'),util[_0xd3bb('0x17d')](_0x23cebf,{'showHidden':![],'depth':null})));if(!this[_0xd3bb('0x8f')](_0x128f36[_0xd3bb('0xe1')])){return this['channel'][_0xd3bb('0xb3')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x13dfde=this[_0xd3bb('0x13')][_0xd3bb('0x7d')](this,_0x128f36[_0xd3bb('0xe1')]);if(!_0x13dfde){return this['channel'][_0xd3bb('0x30')](_0x128f36,'no\x20variable\x20found');}this[_0xd3bb('0x11')][_0xd3bb('0xaa')](util['format'](_0xd3bb('0x17e'),_0x13dfde),_0x23cebf[_0xd3bb('0x84')]?_0x23cebf[_0xd3bb('0x84')]:'200');this[_0xd3bb('0x11')][_0xd3bb('0xaa')](util['format']('%s_STATUS_MESSAGE',_0x13dfde),_0x23cebf[_0xd3bb('0x17f')]?_0x23cebf['statusMessage']:'OK');if(_0x23cebf['body']){try{this['saveRestApiResult'](_0x23cebf[_0xd3bb('0x7a')],_0x13dfde);}catch(_0x1bbf74){logger[_0xd3bb('0x30')](util[_0xd3bb('0xa8')](_0xd3bb('0x180'),_0x13dfde));}}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format'](_0xd3bb('0xe7'),_0x13dfde));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x181')]=function(_0x52726f){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x182'),_0x52726f[_0xd3bb('0x3b')]));return this['channel'][_0xd3bb('0x183')](_0x52726f['digits'][_0xd3bb('0x6a')](/\s+/g,''),_0x52726f['escape_digits']);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x184')]=function(_0x4bae8f){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x185'),_0x4bae8f[_0xd3bb('0x3b')]));return this[_0xd3bb('0x11')][_0xd3bb('0x186')](_0x4bae8f[_0xd3bb('0x187')][_0xd3bb('0x6a')](/\s+/g,''),_0x4bae8f[_0xd3bb('0x178')]);};AGIVertices[_0xd3bb('0x18')]['sayphonetic']=function(_0x391822){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x188'),_0x391822[_0xd3bb('0x3b')]));return this['channel'][_0xd3bb('0x189')](_0x391822['text'],_0x391822['escape_digits']);};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x18a')]=function(_0x242f21){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x18b'),_0x242f21['label']));if(!this[_0xd3bb('0x8f')](_0x242f21['account_id'])){return this[_0xd3bb('0x11')]['noop']('no\x20mail\x20account\x20configured');}var _0x1fe0ab=this['getMailAccount'][_0xd3bb('0x7d')](this,_0x242f21['account_id']);if(!_0x1fe0ab||!_0x1fe0ab[_0xd3bb('0x18c')]){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x242f21,'no\x20mail\x20account\x20found');}var _0x2834a7={'from':util[_0xd3bb('0xa8')]('\x22%s\x22\x20<%s>',_0x1fe0ab[_0xd3bb('0x1c')],_0x1fe0ab[_0xd3bb('0x18d')]||_0x1fe0ab[_0xd3bb('0x18c')][_0xd3bb('0x18e')]),'to':_0x242f21['to']||'','cc':_0x242f21['cc']||'','bcc':_0x242f21['bcc']||'','subject':_0x242f21['subject'],'html':_0x242f21[_0xd3bb('0x6d')],'text':_0x242f21[_0xd3bb('0x6d')]};var _0x52557e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe0ab[_0xd3bb('0x18c')][_0xd3bb('0x18f')]){_0x52557e[_0xd3bb('0x18f')]=_0x1fe0ab['Smtp'][_0xd3bb('0x18f')];}else{_0x52557e[_0xd3bb('0x190')]=_0x1fe0ab[_0xd3bb('0x18c')][_0xd3bb('0x190')];_0x52557e['port']=_0x1fe0ab[_0xd3bb('0x18c')][_0xd3bb('0x191')];_0x52557e[_0xd3bb('0x192')]=_0x1fe0ab[_0xd3bb('0x18c')]['secure'];}if(_0x1fe0ab['Smtp'][_0xd3bb('0x193')]){_0x52557e[_0xd3bb('0x194')]={'user':_0x1fe0ab[_0xd3bb('0x18c')][_0xd3bb('0x18e')],'pass':_0x1fe0ab['Smtp']['pass']};}if(this[_0xd3bb('0x8f')](_0x242f21[_0xd3bb('0x195')])){}logger[_0xd3bb('0xe8')](_0xd3bb('0x196'),JSON['stringify'](_0x2834a7));this[_0xd3bb('0x39')]['sync'](this,_0x242f21,_0x242f21[_0xd3bb('0x197')]);this['channel'][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x198'),_0x1fe0ab[_0xd3bb('0x1c')]));this[_0xd3bb('0x27')]['sync'](this,_0x52557e,_0x2834a7);return this[_0xd3bb('0x11')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x199')]=function(_0x30780d){logger['info'](util['format'](_0xd3bb('0x19a'),_0x30780d['label']));return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0x19b'));};AGIVertices['prototype']['sendSMS']=function(_0x2def66){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2def66[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x2def66['sms_account_id'])){return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0x19c'));}var _0x1acab5=this[_0xd3bb('0x36')][_0xd3bb('0x7d')](this,_0x2def66[_0xd3bb('0x19d')]);if(!_0x1acab5){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x2def66,_0xd3bb('0x19e'));}var _0x12b7c9={'body':_0x2def66[_0xd3bb('0x19f')],'phone':_0x2def66['to']||'','SmsAccountId':_0x1acab5['id']};logger[_0xd3bb('0xe8')](_0xd3bb('0x1a0'),JSON[_0xd3bb('0x82')](_0x12b7c9));this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0x2def66,_0x2def66[_0xd3bb('0x19d')]);this['channel']['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0x1a1'),_0x1acab5[_0xd3bb('0x1c')]));this[_0xd3bb('0x38')][_0xd3bb('0x7d')](this,_0x12b7c9);return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0x1a2'));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x1a3')]=function(_0x4e8ee5){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x4e8ee5[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x4e8ee5[_0xd3bb('0xe1')])){return this['channel'][_0xd3bb('0x30')](_0x4e8ee5,'no\x20variable\x20selected');}var _0x5176e6=this['getVariable'][_0xd3bb('0x7d')](this,_0x4e8ee5['variable_id']);if(!_0x5176e6){return this['channel'][_0xd3bb('0x30')](_0x4e8ee5,'no\x20variable\x20found');}return this[_0xd3bb('0x11')][_0xd3bb('0xaa')](_0x5176e6,_0x4e8ee5['variable_value']);};AGIVertices['prototype'][_0xd3bb('0x1a4')]=function(_0x59be24){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x1a5'),_0x59be24[_0xd3bb('0x3b')]));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x1a6'));if(_0x59be24[_0xd3bb('0xc1')]===_0xd3bb('0x1a7')){this[_0xd3bb('0x11')]['noop'](_0xd3bb('0x1a8'));return this['channel'][_0xd3bb('0xc1')]();}return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0x1a9'));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x1aa')]=function(_0x20a47e){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x20a47e['label']));if(!this['isConfigured'](_0x20a47e['project_id'])){return this['channel']['error'](_0x20a47e,'no\x20subproject\x20selected');}var _0x444311=this[_0xd3bb('0x1ab')]['sync'](this,_0x20a47e[_0xd3bb('0x1ac')]);if(!this[_0xd3bb('0x8f')](_0x444311)){return this[_0xd3bb('0x11')]['error'](_0x20a47e,util[_0xd3bb('0xa8')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x20a47e[_0xd3bb('0x1ac')]));}if(_0x444311===this[_0xd3bb('0x11')][_0xd3bb('0x3d')]){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x20a47e,_0xd3bb('0x1ad'));}this['createSquareDetailsReport']['sync'](this,_0x20a47e,_0x444311);var _0x2cf56c=this['channel']['exec'](_0xd3bb('0x1ae'),util[_0xd3bb('0xa8')](_0xd3bb('0x1af'),config['agi'][_0xd3bb('0x190')]||'127.0.0.1',_0x444311,this[_0xd3bb('0x11')][_0xd3bb('0x3d')]));if(_0x2cf56c[_0xd3bb('0xb5')]===-0x1){return _0x2cf56c;}return this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')]('Executed\x20command\x20%s\x20%s',_0xd3bb('0x1ae'),_0x444311));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x1b0')]=function(_0xb8a0d7){logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x1b1'),_0xb8a0d7[_0xd3bb('0x3b')]));var _0x199a5c=this[_0xd3bb('0x1b2')][_0xd3bb('0x7d')](this,_0xb8a0d7[_0xd3bb('0x1b3')]);this[_0xd3bb('0x39')][_0xd3bb('0x7d')](this,_0xb8a0d7,_0xb8a0d7[_0xd3bb('0x1b3')]);if(this[_0xd3bb('0x8f')](_0xb8a0d7[_0xd3bb('0xe1')])){var _0x5011ce=this[_0xd3bb('0x13')][_0xd3bb('0x7d')](this,_0xb8a0d7[_0xd3bb('0xe1')]);if(_0x5011ce){this[_0xd3bb('0x11')]['setVariable'](_0x5011ce,_0x199a5c);return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0xb8a0d7[_0xd3bb('0x1b3')],_0x5011ce));}}return this[_0xd3bb('0x11')]['noop'](util[_0xd3bb('0xa8')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0xb8a0d7[_0xd3bb('0x1b3')]));};AGIVertices['prototype'][_0xd3bb('0x1b4')]=function(_0x1a7f76){logger['info'](util['format'](_0xd3bb('0x1b5'),_0x1a7f76[_0xd3bb('0x3b')]));_0x1a7f76[_0xd3bb('0x6d')]=_0x1a7f76[_0xd3bb('0x6d')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1a7f76[_0xd3bb('0x6c')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](_0xd3bb('0x1b6'));}if(!this[_0xd3bb('0x8f')](_0x1a7f76[_0xd3bb('0x6d')])){return this['channel'][_0xd3bb('0xb3')](_0xd3bb('0xcf'));}this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x1b7'),_0x1a7f76[_0xd3bb('0x6d')]));var _0x730703=this[_0xd3bb('0x6b')][_0xd3bb('0x7d')](this,_0x1a7f76);if(_0x730703){this['channel']['noop'](util[_0xd3bb('0xa8')](_0xd3bb('0x1b8'),_0x730703));var _0x32f95d=this[_0xd3bb('0x11')][_0xd3bb('0x104')](_0x730703);try{fs['unlink'](_0x730703+_0xd3bb('0x124'));}catch(_0x7e2f68){logger['error'](_0x7e2f68);}return _0x32f95d;}return this[_0xd3bb('0x11')]['error'](_0x1a7f76,_0xd3bb('0x1b9'));};AGIVertices['prototype'][_0xd3bb('0x1ba')]=function(_0x84671b){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x84671b['label']));_0x84671b[_0xd3bb('0x6d')]=_0x84671b[_0xd3bb('0x6d')][_0xd3bb('0x6a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd3bb('0x8f')](_0x84671b[_0xd3bb('0x6d')])){return this[_0xd3bb('0x11')][_0xd3bb('0xb3')]('no\x20text\x20configured');}this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x84671b[_0xd3bb('0x6d')]));var _0x3fc21f=this[_0xd3bb('0x73')][_0xd3bb('0x7d')](this,_0x84671b);if(_0x3fc21f){this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x1bb'),_0x3fc21f));var _0x1a66c9=this[_0xd3bb('0x11')][_0xd3bb('0x104')](_0x3fc21f);try{fs[_0xd3bb('0x105')](_0x3fc21f+_0xd3bb('0x124'));}catch(_0x232c5d){logger[_0xd3bb('0x30')](_0x232c5d);}return _0x1a66c9;}return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x84671b,_0xd3bb('0x1bc'));};AGIVertices['prototype'][_0xd3bb('0x1bd')]=function(_0x5857c5){logger['info'](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x5857c5['label']));if(!this[_0xd3bb('0x8f')](_0x5857c5[_0xd3bb('0x154')])){return this['channel']['error'](_0x5857c5,_0xd3bb('0x155'));}logger['info'](util[_0xd3bb('0xa8')](_0xd3bb('0x15a'),this[_0xd3bb('0x11')]['callerid'],_0x5857c5[_0xd3bb('0x154')]));var _0x2dec6a=this[_0xd3bb('0x64')][_0xd3bb('0x7d')](this,_0x5857c5[_0xd3bb('0x154')]);if(_0x2dec6a){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x156'),this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x5857c5[_0xd3bb('0x154')]));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd3bb('0x11')][_0xd3bb('0x3e')],_0x5857c5[_0xd3bb('0x154')]));return{'code':0xc8,'result':_0xd3bb('0x157')};}else{logger['info'](util['format'](_0xd3bb('0x15b'),this['channel'][_0xd3bb('0x3e')],_0x5857c5[_0xd3bb('0x154')]));this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x15b'),this['channel'][_0xd3bb('0x3e')],_0x5857c5[_0xd3bb('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x3ca458){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x3ca458[_0xd3bb('0x3b')]));var _0x2ceb1f=this[_0xd3bb('0x11')][_0xd3bb('0x69')]('VOICEMAIL',[_0x3ca458[_0xd3bb('0x1be')],_0x3ca458[_0xd3bb('0x87')]]);if(_0x2ceb1f[_0xd3bb('0xb5')]===-0x1){return _0x2ceb1f;}return this[_0xd3bb('0x11')][_0xd3bb('0xb3')](util[_0xd3bb('0xa8')](_0xd3bb('0x1bf'),_0xd3bb('0x1c0'),_0x3ca458[_0xd3bb('0x1be')]));};AGIVertices[_0xd3bb('0x18')][_0xd3bb('0x1c1')]=function(_0x41f6ed){logger[_0xd3bb('0x32')](util[_0xd3bb('0xa8')](_0xd3bb('0x1c2'),_0x41f6ed[_0xd3bb('0x3b')]));if(!this[_0xd3bb('0x8f')](_0x41f6ed[_0xd3bb('0xe1')])){return this[_0xd3bb('0x11')][_0xd3bb('0x30')](_0x41f6ed,_0xd3bb('0x1c3'));}var _0x3af4d0=this[_0xd3bb('0x13')][_0xd3bb('0x7d')](this,_0x41f6ed['variable_id']);if(!_0x3af4d0){return this[_0xd3bb('0x11')]['error'](_0x41f6ed,_0xd3bb('0xe2'));}var _0x446cda=this[_0xd3bb('0x11')][_0xd3bb('0x13')](_0x3af4d0);return{'code':0xc8,'result':_0x446cda[_0xd3bb('0xae')]?_0x446cda['extra']:'-'};};String[_0xd3bb('0x18')][_0xd3bb('0x1c4')]=function(_0x2111f0,_0x3e8c61){return this[_0xd3bb('0xac')](_0x2111f0)[_0xd3bb('0x1c5')](_0x3e8c61);};module[_0xd3bb('0x1c6')]=AGIVertices; \ No newline at end of file +var _0x56bd=['query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','dialogflow','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','toUpperCase','audiofile','unlink','.wav','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','getSound','getData','test','mindigit','maxdigit','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','awsPolly','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','bot','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','no\x20key\x20configured','%s/recordings/%s','beep','intKey','googleASR','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','wav','NOBEEP','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','no\x20operation\x20configured','menu','Enter\x20in\x20MENU\x20(%s)\x20block','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%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:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','sayNumber','sayphonetic','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','secure','auth','pass','template_id','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\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Skipped\x20Answer','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','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','exports','util','lodash','shelljs','randomstring','moment','mustache','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','rpc','mailRpc','getVariable','getVariableById','then','name','catch','prototype','getVoiceQueue','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','Intervals','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','createSquareRecording','callerid','calleridname','extension','priority','accountcode','dnid','createSquareMessage','createCmContact','log','in\x20createcmcontact','in\x20createcmcontact\x20callback','isEmpty','isNil','random','lastName','phone','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','has','dialTimezone','VALUE\x20TZ','CALLERID(dialTimezone)','getContactByPhone','RES1','dialtimezone','timezones','utcOffset','minutestoadd','scheduledat\x20before','scheduledat','minutes','insertContact','add','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','shellCommand','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','number','timeout','includes','POST','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','parse','computedVariables','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_lex_region','aws_bot_name','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','nextbracket','extra','toString','replaceall\x20end','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','exec','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','callback','enter\x20in\x20callbackblock','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','before\x20createcmcontact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured'];(function(_0x10595c,_0x115e16){var _0x29194d=function(_0x2b02f1){while(--_0x2b02f1){_0x10595c['push'](_0x10595c['shift']());}};_0x29194d(++_0x115e16);}(_0x56bd,0xe9));var _0xd56b=function(_0x34e330,_0x43c19e){_0x34e330=_0x34e330-0x0;var _0x2df2b7=_0x56bd[_0x34e330];return _0x2df2b7;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xd56b('0x0'));var _=require(_0xd56b('0x1'));var sh=require(_0xd56b('0x2'));var odbc=require('odbc')();var rs=require(_0xd56b('0x3'));var moment=require(_0xd56b('0x4'));var Mustache=require(_0xd56b('0x5'));var rp=require(_0xd56b('0x6'));var logger=require('../../config/logger')(_0xd56b('0x7'));var config=require(_0xd56b('0x8'));var shared=require(_0xd56b('0x9'));var scripts=require(_0xd56b('0xa'));var FILES_PATH=_0xd56b('0xb');var recursiveMapAttributes=[_0xd56b('0xc'),_0xd56b('0xd')];var verticesWithRetry=['menu',_0xd56b('0xe'),_0xd56b('0xf')];var AGIVertices=function(_0x6fde5d,_0x13447e,_0x53b856){this['channel']=_0x6fde5d;this[_0xd56b('0x10')]=_0x13447e;this[_0xd56b('0x11')]=_0x53b856;};AGIVertices['prototype'][_0xd56b('0x12')]=function(_0x1e6fcd,_0x3bfaf9){this[_0xd56b('0x10')][_0xd56b('0x13')](_0x1e6fcd)[_0xd56b('0x14')](function(_0x3fb7dd){_0x3bfaf9(null,_0x3fb7dd?_0x3fb7dd[_0xd56b('0x15')]:![]);})[_0xd56b('0x16')](function(_0x2bfff6){_0x3bfaf9(_0x2bfff6);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x18')]=function(_0x286e2b,_0x104dab){this[_0xd56b('0x10')]['getVoiceQueueById'](_0x286e2b)[_0xd56b('0x14')](function(_0x5a2886){_0x104dab(null,_0x5a2886?_0x5a2886[_0xd56b('0x15')]:![]);})[_0xd56b('0x16')](function(_0x3f8775){_0x104dab(_0x3f8775);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x19')]=function(_0x472e7e,_0x667877){this[_0xd56b('0x10')][_0xd56b('0x1a')](_0x472e7e)[_0xd56b('0x14')](function(_0x147e48){_0x667877(null,_0x147e48?_0x147e48['name']:![]);})['catch'](function(_0x5ccee5){_0x667877(_0x5ccee5);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x1b')]=function(_0xf32afd,_0x1ac90f){this[_0xd56b('0x10')][_0xd56b('0x1c')](_0xf32afd)[_0xd56b('0x14')](function(_0x547a7a){_0x1ac90f(null,_0x547a7a?_0x547a7a[_0xd56b('0x1d')]:![]);})[_0xd56b('0x16')](function(_0x36f903){_0x1ac90f(_0x36f903);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x1e')]=function(_0x32160b,_0x5498b0){this['rpc'][_0xd56b('0x1f')](_0x32160b)[_0xd56b('0x14')](function(_0x5bdf89){_0x5498b0(null,_0x5bdf89?_0x5bdf89[_0xd56b('0x15')]:![]);})['catch'](function(_0xdaf42a){_0x5498b0(_0xdaf42a);});};AGIVertices['prototype'][_0xd56b('0x20')]=function(_0x30e936,_0x1fa34b){this['rpc'][_0xd56b('0x21')](_0x30e936)[_0xd56b('0x14')](function(_0x1e3d6d){_0x1fa34b(null,_0x1e3d6d?_0x1e3d6d[_0xd56b('0x15')]:![]);})[_0xd56b('0x16')](function(_0x446c8a){_0x1fa34b(_0x446c8a);});};AGIVertices[_0xd56b('0x17')]['getSound']=function(_0x56cbcb,_0xaf08fb){var _0x4393a9=this;this[_0xd56b('0x10')][_0xd56b('0x22')](_0x56cbcb)[_0xd56b('0x14')](function(_0x3c76d6){_0xaf08fb(null,_0x3c76d6?_0x4393a9[_0xd56b('0x23')](_0x3c76d6[_0xd56b('0x24')]):![]);})[_0xd56b('0x16')](function(_0x65fb97){_0xaf08fb(_0x65fb97);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x25')]=function(_0x5f3d6c,_0x59674a){this[_0xd56b('0x10')]['getMailAccountById'](_0x5f3d6c)['then'](function(_0x3d18b6){_0x59674a(null,_0x3d18b6?_0x3d18b6:![]);})[_0xd56b('0x16')](function(_0x193c7f){_0x59674a(_0x193c7f);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x26')]=function(_0x3d9d62,_0x13900e,_0xbae998){this['mailRpc'][_0xd56b('0x26')](_0x3d9d62,_0x13900e)['then'](function(){_0xbae998(null);})[_0xd56b('0x16')](function(_0x333102){_0xbae998(_0x333102);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x27')]=function(_0xdea9ba,_0x4d8815){this[_0xd56b('0x10')][_0xd56b('0x28')](_0xdea9ba)['then'](function(_0xbc387e){if(_0xbc387e){if(_0xbc387e[_0xd56b('0x29')]){_0x4d8815(null,[_0xbc387e['interval']]);}else{_0x4d8815(null,_['map'](_0xbc387e[_0xd56b('0x2a')],'interval'));}}else{_0x4d8815(null,![]);}})[_0xd56b('0x16')](function(_0x2ca2bf){_0x4d8815(_0x2ca2bf);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x23')]=function(_0x2e3e39){return util[_0xd56b('0x2b')]('%s/sounds/converted/%s',FILES_PATH,_0x2e3e39);};AGIVertices[_0xd56b('0x17')][_0xd56b('0x2c')]=function(_0x4d0fa5,_0x150d00,_0x8d3d6b){odbc[_0xd56b('0x2d')](_0x4d0fa5,function(_0x20891c){if(_0x20891c){logger[_0xd56b('0x2e')](_0xd56b('0x2f'),_0x20891c);_0x8d3d6b(_0x20891c);}else{logger[_0xd56b('0x30')]('ODBC\x20connection\x20successfully');odbc[_0xd56b('0x31')](_0x150d00,function(_0x3788bb,_0x332e38){if(_0x3788bb){logger[_0xd56b('0x30')]('Error\x20executing\x20query\x20%s',_0x150d00);_0x8d3d6b(_0x3788bb);}else{logger[_0xd56b('0x30')](_0xd56b('0x32'),_0x150d00);odbc[_0xd56b('0x33')](function(_0x8d9203){if(_0x8d9203){logger[_0xd56b('0x2e')](_0xd56b('0x34'),_0x8d9203);}_0x8d3d6b(null,_0x332e38);});}});}});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x35')]=function(_0x436c9e,_0x373fab){this[_0xd56b('0x10')][_0xd56b('0x36')](_0x436c9e)[_0xd56b('0x14')](function(_0x4581e6){_0x373fab(null,_0x4581e6?_0x4581e6:![]);})[_0xd56b('0x16')](function(_0x11a911){_0x373fab(_0x11a911);});};AGIVertices['prototype']['createSmsMessage']=function(_0xa718ee,_0x230bbc){this[_0xd56b('0x10')]['createSmsMessage'](_0xa718ee)[_0xd56b('0x14')](function(_0x52262e){_0x230bbc(null,_0x52262e);})[_0xd56b('0x16')](function(_0x62ba88){_0x230bbc(_0x62ba88);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x37')]=function(_0x2613e2,_0x5b0edf,_0x110f8f){this['rpc'][_0xd56b('0x37')]({'uniqueid':this[_0xd56b('0x38')][_0xd56b('0x39')],'node':_0x2613e2[_0xd56b('0x3a')],'application':_0x2613e2[_0xd56b('0x3b')],'data':_0x5b0edf||null,'project_name':this['channel'][_0xd56b('0x3c')],'callerid':this[_0xd56b('0x38')]['callerid']})[_0xd56b('0x14')](function(_0x44b1ad){if(_0x110f8f){_0x110f8f(null,_0x44b1ad);}})['catch'](function(_0x25d146){if(_0x110f8f){_0x110f8f(_0x25d146);}});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x3d')]=function(_0x292aea,_0x446790,_0x450e8e,_0x44ab0e){this[_0xd56b('0x10')][_0xd56b('0x3d')]({'uniqueid':this['channel'][_0xd56b('0x39')],'callerid':this[_0xd56b('0x38')][_0xd56b('0x3e')],'calleridname':this['channel'][_0xd56b('0x3f')],'context':this[_0xd56b('0x38')]['context'],'extension':this[_0xd56b('0x38')][_0xd56b('0x40')],'priority':this[_0xd56b('0x38')][_0xd56b('0x41')],'accountcode':this[_0xd56b('0x38')][_0xd56b('0x42')],'dnid':this['channel'][_0xd56b('0x43')],'projectName':this[_0xd56b('0x38')][_0xd56b('0x3c')],'saveName':_0x446790,'filename':_0x292aea['file']||_0x446790,'savePath':_0x450e8e})[_0xd56b('0x14')](function(_0xdd906b){_0x44ab0e(null,_0xdd906b);})[_0xd56b('0x16')](function(_0x40a69b){_0x44ab0e(_0x40a69b);});};AGIVertices[_0xd56b('0x17')]['createSquareMessage']=function(_0x1d4ebd,_0x7675c3,_0xd12bf0){this[_0xd56b('0x10')][_0xd56b('0x44')]({'uniqueid':this[_0xd56b('0x38')]['uniqueid'],'body':_0x1d4ebd,'direction':_0x7675c3})[_0xd56b('0x14')](function(_0x3dd378){if(_0xd12bf0){_0xd12bf0(null,_0x3dd378);}})[_0xd56b('0x16')](function(_0x4b31e6){if(_0xd12bf0){_0xd12bf0(_0x4b31e6);}});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x45')]=function(_0x1fda52,_0xde6424){console[_0xd56b('0x46')](_0xd56b('0x47'),_0x1fda52);console[_0xd56b('0x46')](_0xd56b('0x48'),_0xde6424);var _0xa58859=this;var _0x105aef=0x0;var _0x1900a9={'firstName':_[_0xd56b('0x49')](_0x1fda52['name'])||_[_0xd56b('0x4a')](_0x1fda52[_0xd56b('0x15')])?'callback_'+Math[_0xd56b('0x4b')]():_0x1fda52['name'],'lastName':_[_0xd56b('0x49')](_0x1fda52[_0xd56b('0x4c')])||_['isNil'](_0x1fda52[_0xd56b('0x4c')])?null:_0x1fda52['lastName'],'phone':_0x1fda52[_0xd56b('0x4d')],'ListId':_0x1fda52['list_id'],'scheduledat':_0x1fda52['scheduledAt'],'callbackUniqueid':this[_0xd56b('0x38')][_0xd56b('0x39')],'tags':'callback','description':_0xd56b('0x4e')+_0x1fda52[_0xd56b('0x4f')]['toString'](),'priority':_0x1fda52[_0xd56b('0x50')]};if(_[_0xd56b('0x51')](_0x1fda52,'dialTimezone')){if(!_[_0xd56b('0x4a')](_0x1fda52[_0xd56b('0x52')])){var _0x44a165=_0x1fda52[_0xd56b('0x52')];console['log'](_0xd56b('0x53'),_0x44a165);if(_0x1fda52['dialTimezone']==_0xd56b('0x54')){this[_0xd56b('0x10')][_0xd56b('0x55')]({'phone':_0x1fda52['phone']})[_0xd56b('0x14')](function(_0x286ba9){console['log'](_0xd56b('0x56'),_0x286ba9);var _0x1e5250=_0x286ba9['dialTimezone'];console[_0xd56b('0x46')](_0xd56b('0x57'),_0x1e5250);if(!_[_0xd56b('0x4a')](_0x1e5250)){var _0x21c582=shared[_0xd56b('0x58')][_0x1e5250];console[_0xd56b('0x46')]('tz',_0x21c582);if(!_['isNil'](_0x21c582)){var _0x5a44b9=-0x1*_0x21c582[_0xd56b('0x59')];console[_0xd56b('0x46')](_0xd56b('0x5a'),_0x5a44b9);console[_0xd56b('0x46')](_0xd56b('0x5b'),_0x1900a9[_0xd56b('0x5c')]);_0x1900a9[_0xd56b('0x5c')]=moment(_0x1fda52[_0xd56b('0x5c')])['add'](_0x5a44b9,_0xd56b('0x5d'));console[_0xd56b('0x46')]('scheduledat\x20after',_0x1900a9[_0xd56b('0x5c')]);_0xa58859[_0xd56b('0x5e')](_0x1900a9,_0x1fda52,_0xde6424);}else{_0xa58859[_0xd56b('0x5e')](_0x1900a9,_0x1fda52,_0xde6424);}}else{_0xa58859[_0xd56b('0x5e')](_0x1900a9,_0x1fda52,_0xde6424);}});}else{var _0x105aef=shared['timezones'][_0x44a165];if(!_[_0xd56b('0x4a')](_0x105aef)){var _0x298f16=-0x1*_0x105aef[_0xd56b('0x59')];_0x1900a9['scheduledat']=moment(_0x1fda52['scheduledat'])[_0xd56b('0x5f')](_0x298f16,'minutes');_0xa58859[_0xd56b('0x5e')](_0x1900a9,_0x1fda52,_0xde6424);}else{_0xa58859[_0xd56b('0x5e')](_0x1900a9,_0x1fda52,_0xde6424);}}}else{_0xa58859['insertContact'](_0x1900a9,_0x1fda52,_0xde6424);}}else{_0xa58859[_0xd56b('0x5e')](_0x1900a9,_0x1fda52,_0xde6424);}};AGIVertices['prototype']['insertContact']=function(_0xff2b6e,_0x1d73e4,_0x30fef3){this[_0xd56b('0x10')]['createCmContact'](_0xff2b6e)[_0xd56b('0x14')](function(_0x247a68){_0x30fef3(null,_0x247a68);})[_0xd56b('0x16')](function(_0x500e42){_0x30fef3(_0x500e42);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x60')]=function(_0x10c4d9,_0xbb4694){this['rpc'][_0xd56b('0x61')](_0x10c4d9)['then'](function(_0x1103e6){_0xbb4694(null,_0x1103e6?_0x1103e6[_0xd56b('0x15')]:![]);})[_0xd56b('0x16')](function(_0x4a9b55){_0xbb4694(_0x4a9b55);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x62')]=function(_0x47b4d7,_0x541950,_0x133877){var _0x3bd5fe={'role':_0xd56b('0x63')};_0x3bd5fe[_0x47b4d7]=this[_0xd56b('0x38')][_0xd56b('0x3e')];this['rpc']['agentPause'](_0x3bd5fe,_0x541950,this[_0xd56b('0x38')][_0xd56b('0x39')])[_0xd56b('0x14')](function(_0x36d1b8){_0x133877(null,_['isNil'](_0x36d1b8)?![]:!![]);})['catch'](function(_0x350cf5){logger[_0xd56b('0x2e')](_0x350cf5);_0x133877(null,![]);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x64')]=function(_0xb27028,_0x47a6ee){var _0x2c9d90={'role':_0xd56b('0x63')};_0x2c9d90[_0xb27028]=this[_0xd56b('0x38')]['callerid'];this[_0xd56b('0x10')]['agentUnpause'](_0x2c9d90)['then'](function(_0x458f2e){_0x47a6ee(null,_[_0xd56b('0x4a')](_0x458f2e)?![]:!![]);})[_0xd56b('0x16')](function(_0x32b18f){logger[_0xd56b('0x2e')](_0x32b18f);_0x47a6ee(null,![]);});};AGIVertices[_0xd56b('0x17')]['agentLogout']=function(_0x23b57c,_0x5b2933){var _0x6282dc={'role':'agent'};_0x6282dc[_0x23b57c]=this['channel'][_0xd56b('0x3e')];this[_0xd56b('0x10')][_0xd56b('0x65')](_0x6282dc)[_0xd56b('0x14')](function(_0x3eb7c6){_0x5b2933(null,_['isNil'](_0x3eb7c6)?![]:!![]);})[_0xd56b('0x16')](function(_0x2f755e){logger[_0xd56b('0x2e')](_0x2f755e);_0x5b2933(null,![]);});};AGIVertices['prototype'][_0xd56b('0x66')]=function(_0x50209d,_0x34e269){var _0x1c1765={'role':_0xd56b('0x63')};_0x1c1765[_0x50209d]=this[_0xd56b('0x38')][_0xd56b('0x3e')];var _0x2b4823=_0x50209d!='internal'?util[_0xd56b('0x2b')](_0xd56b('0x67'),'LOCAL',this[_0xd56b('0x38')][_0xd56b('0x3e')]):undefined;this[_0xd56b('0x10')][_0xd56b('0x66')](_0x1c1765,_0x2b4823)[_0xd56b('0x14')](function(_0x8af435){_0x34e269(null,_['isNil'](_0x8af435)?![]:!![]);})['catch'](function(_0x1c35bd){logger[_0xd56b('0x2e')](_0x1c35bd);_0x34e269(null,![]);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x68')]=function(_0x1df58d,_0x186a59){sh['exec'](_['trim'](_0x1df58d),function(_0x22b5ad,_0x4b36c2){var _0x55b55d=_0x4b36c2[_0xd56b('0x69')](/(\r\n|\n|\r)/gm,'');_0x186a59(null,_0x55b55d);});};AGIVertices[_0xd56b('0x17')]['googleCloudTTS']=function(_0x474545,_0x3a85f8){scripts[_0xd56b('0x6a')](_0x474545[_0xd56b('0x6b')],_0x474545['google_cloud_tts_text_type']||_0xd56b('0x6c'),_0x474545[_0xd56b('0x6c')],_0x474545[_0xd56b('0x6d')]||_0xd56b('0x6e'),_0x474545[_0xd56b('0x6f')]||_0xd56b('0x70'),_0x474545[_0xd56b('0x71')]||_0xd56b('0x72'))[_0xd56b('0x14')](function(_0x4233de){_0x3a85f8(null,_0x4233de);})[_0xd56b('0x16')](function(_0x2911d2){_0x3a85f8(_0x2911d2);});};AGIVertices[_0xd56b('0x17')]['googleTTS']=function(_0x13662e,_0x191ca8){scripts[_0xd56b('0x73')](_0x13662e[_0xd56b('0x6c')],_0x13662e[_0xd56b('0x74')]||'en',0x1)[_0xd56b('0x14')](function(_0x5f3e9a){_0x191ca8(null,_0x5f3e9a);})[_0xd56b('0x16')](function(_0x10bc95){_0x191ca8(_0x10bc95);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x75')]=function(_0x8cb5e1,_0x4fe83e){var _0x23f982={'uri':_0x8cb5e1[_0xd56b('0x76')],'method':_0x8cb5e1[_0xd56b('0x77')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x8cb5e1['timeout'])===_0xd56b('0x78')&&parseInt(_0x8cb5e1['timeout'])>=0x1?parseInt(_0x8cb5e1[_0xd56b('0x79')])*0x3e8:0x5*0x3e8};if(_[_0xd56b('0x7a')]([_0xd56b('0x7b'),'PUT'],_0x23f982[_0xd56b('0x77')]['toUpperCase']())){try{_0x23f982[_0xd56b('0x7c')]=_0x8cb5e1[_0xd56b('0xd')]?JSON['parse'](_0x8cb5e1[_0xd56b('0xd')]):{};}catch(_0x416eed){logger['error'](_0xd56b('0x7d'),_0x416eed);}}try{_0x23f982[_0xd56b('0x7e')]=_0x8cb5e1[_0xd56b('0xc')]?JSON[_0xd56b('0x7f')](_0x8cb5e1[_0xd56b('0xc')]):{};}catch(_0x4ce536){logger[_0xd56b('0x2e')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4ce536);}if(_0x8cb5e1[_0xd56b('0x80')]){try{var _0x459237=require(_0x8cb5e1[_0xd56b('0x80')])['sync'](this,_0x23f982);_0x23f982[_0xd56b('0x81')]=Mustache[_0xd56b('0x82')](_0x8cb5e1[_0xd56b('0x76')],_0x459237,{},['$$','$$']);if(_0x23f982[_0xd56b('0x7e')]){_0x23f982['headers']=JSON[_0xd56b('0x7f')](Mustache[_0xd56b('0x82')](JSON[_0xd56b('0x83')](_0x23f982[_0xd56b('0x7e')]),_0x459237,{},['$$','$$']));}if(_0x23f982[_0xd56b('0x7c')]){_0x23f982['body']=JSON[_0xd56b('0x7f')](Mustache[_0xd56b('0x82')](JSON['stringify'](_0x23f982[_0xd56b('0x7c')]),_0x459237,{},['$$','$$']));}}catch(_0x2d37ad){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2d37ad);}}rp(_0x23f982)[_0xd56b('0x14')](function(_0x3cf088){var _0x41bcd9={'statusCode':_0x3cf088[_0xd56b('0x84')]||0xc8,'statusMessage':_0x3cf088[_0xd56b('0x85')]||'OK','headers':_0x3cf088[_0xd56b('0x7e')]||{},'body':_0x3cf088[_0xd56b('0x7c')]||{}};_0x4fe83e(null,_0x41bcd9);})[_0xd56b('0x16')](function(_0x67e973){var _0x4f6979={'statusCode':_0x67e973['statusCode']||0x1f4,'statusMessage':_0x67e973[_0xd56b('0x86')]||_0xd56b('0x87'),'headers':_0x67e973['options'][_0xd56b('0x7e')]||{},'body':_0x67e973[_0xd56b('0x88')][_0xd56b('0x7c')]||{}};_0x4fe83e(null,_0x4f6979);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x89')]=function(_0x351f8d,_0x2325d0){scripts['googleDialogflow'](this[_0xd56b('0x38')][_0xd56b('0x39')],_0x351f8d[_0xd56b('0x8a')],_0x351f8d[_0xd56b('0x6c')],_0x351f8d[_0xd56b('0x8b')]||'en')[_0xd56b('0x14')](function(_0x5c7e0d){_0x2325d0(null,_0x5c7e0d);})[_0xd56b('0x16')](function(_0x286e0f){_0x2325d0(_0x286e0f);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x8c')]=function(_0x1c5c38,_0x1b9861){scripts[_0xd56b('0x8c')](this['channel'],_0x1c5c38)[_0xd56b('0x14')](function(_0x366576){_0x1b9861(null,_0x366576);})[_0xd56b('0x16')](function(_0x226ece){_0x1b9861(_0x226ece);});};AGIVertices['prototype'][_0xd56b('0x8d')]=function(_0xe7edd6,_0x50723d){scripts[_0xd56b('0x8d')](_0xe7edd6['key'],_0xe7edd6[_0xd56b('0x6c')],_0xe7edd6[_0xd56b('0x8e')]||_0xd56b('0x6e'),_0xe7edd6[_0xd56b('0x8f')])['then'](function(_0xd770f2){_0x50723d(null,_0xd770f2);})[_0xd56b('0x16')](function(_0x1fbf15){_0x50723d(_0x1fbf15);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x90')]=function(_0x41d030,_0x23cc29,_0x36cffb){scripts['ispeechASR'](_0x23cc29,_0x41d030[_0xd56b('0x8a')],_0x41d030['ispeech_asr_language']||_0xd56b('0x6e'),this[_0xd56b('0x91')](_0x41d030[_0xd56b('0x92')])?_0x41d030['model']:undefined)['then'](function(_0x5c30de){_0x36cffb(null,_0x5c30de);})['catch'](function(_0x226be1){_0x36cffb(_0x226be1);});};AGIVertices[_0xd56b('0x17')]['awsPolly']=function(_0x3c4986,_0xf332d){scripts['awsPolly'](_0x3c4986[_0xd56b('0x93')],_0x3c4986[_0xd56b('0x94')],_0x3c4986[_0xd56b('0x95')],_0x3c4986[_0xd56b('0x96')]||'Amy',_0x3c4986[_0xd56b('0x6c')],_0x3c4986[_0xd56b('0x97')]||_0xd56b('0x6c'))[_0xd56b('0x14')](function(_0x5b2535){_0xf332d(null,_0x5b2535);})[_0xd56b('0x16')](function(_0x5cf690){_0xf332d(_0x5cf690);});};AGIVertices['prototype']['awsLex']=function(_0x1a8534,_0x1f157c){scripts[_0xd56b('0x98')](this[_0xd56b('0x38')][_0xd56b('0x39')],_0x1a8534[_0xd56b('0x93')],_0x1a8534[_0xd56b('0x94')],_0x1a8534[_0xd56b('0x99')],_0x1a8534[_0xd56b('0x6c')],_0x1a8534[_0xd56b('0x9a')])[_0xd56b('0x14')](function(_0x571523){_0x1f157c(null,_0x571523);})[_0xd56b('0x16')](function(_0x40eaa5){_0x1f157c(_0x40eaa5);});};AGIVertices[_0xd56b('0x17')]['googleASR']=function(_0x286a4b,_0x338e67,_0x23a9f8){scripts['googleASR'](_0x338e67,_0x286a4b[_0xd56b('0x8a')],_0x286a4b['google_asr_language']||_0xd56b('0x6e'))[_0xd56b('0x14')](function(_0x4910d5){_0x23a9f8(null,_0x4910d5);})['catch'](function(_0x3339ec){_0x23a9f8(_0x3339ec);});};AGIVertices[_0xd56b('0x17')]['tildeASR']=function(_0x55f3ef,_0x408103,_0xd49688){scripts[_0xd56b('0x9b')](_0x408103,_0x55f3ef['appid'],_0x55f3ef[_0xd56b('0x9c')],_0x55f3ef[_0xd56b('0x81')])[_0xd56b('0x14')](function(_0x1c6bb0){_0xd49688(null,_0x1c6bb0);})['catch'](function(_0x2f1f7b){_0xd49688(_0x2f1f7b);});};AGIVertices[_0xd56b('0x17')][_0xd56b('0x9d')]=function(_0x2820d7){var _0x3a1447=_[_0xd56b('0x7a')](verticesWithRetry,_0x2820d7[_0xd56b('0x3b')])?_0x2820d7:_[_0xd56b('0x9e')](_0x2820d7);for(var _0x4a731d in _0x3a1447){if(_0x3a1447[_0xd56b('0x9f')](_0x4a731d)){if(_0x3a1447[_0x4a731d]&&_[_0xd56b('0xa0')](_0x3a1447[_0x4a731d])){if(_[_0xd56b('0x7a')](recursiveMapAttributes,_0x4a731d)){_0x3a1447[_0x4a731d]=this[_0xd56b('0xa1')](_0x3a1447[_0x4a731d]);}else{_0x3a1447[_0x4a731d]=this[_0xd56b('0xa2')](_0x3a1447[_0x4a731d]);}}}}return _0x3a1447;};AGIVertices['prototype'][_0xd56b('0xa3')]=function(_0xb1f3a1){for(var _0x3fd88e in _0xb1f3a1){if(_0xb1f3a1[_0xd56b('0x9f')](_0x3fd88e)){if(_[_0xd56b('0xa4')](_0xb1f3a1[_0x3fd88e])){this[_0xd56b('0xa3')](_0xb1f3a1[_0x3fd88e]);}else if(_[_0xd56b('0xa5')](_0xb1f3a1[_0x3fd88e])){for(var _0x4948c0=0x0;_0x4948c0<_0xb1f3a1[_0x3fd88e][_0xd56b('0xa6')];_0x4948c0++){this[_0xd56b('0xa3')](_0xb1f3a1[_0x3fd88e][_0x4948c0]);}}else if(_[_0xd56b('0xa0')](_0xb1f3a1[_0x3fd88e])){_0xb1f3a1[_0x3fd88e]=this[_0xd56b('0xa2')](_0xb1f3a1[_0x3fd88e]);}}}};AGIVertices[_0xd56b('0x17')][_0xd56b('0xa7')]=function(_0x3437c2,_0x520da1){for(var _0x47fee3 in _0x3437c2){if(_0x3437c2[_0xd56b('0x9f')](_0x47fee3)){if(_[_0xd56b('0xa4')](_0x3437c2[_0x47fee3])){if(!_[_0xd56b('0x49')](_0x3437c2[_0x47fee3])){this['saveRestApiResult'](_0x3437c2[_0x47fee3],util[_0xd56b('0x2b')](_0xd56b('0xa8'),_0x520da1,_0x47fee3));}}else if(_['isArray'](_0x3437c2[_0x47fee3])){for(var _0x41b25a=0x0;_0x41b25a<_0x3437c2[_0x47fee3][_0xd56b('0xa6')];_0x41b25a++){this['saveRestApiResult'](_0x3437c2[_0x47fee3][_0x41b25a],util[_0xd56b('0x2b')]('%s.%s',_0x520da1,_0x47fee3+'['+_0x41b25a+']'));}}else{if(!_[_0xd56b('0x4a')](_0x3437c2[_0x47fee3])){this[_0xd56b('0x38')][_0xd56b('0xa9')](util[_0xd56b('0x2b')](_0xd56b('0xa8'),_0x520da1,_0x47fee3),_0x3437c2[_0x47fee3]);}}}}};AGIVertices[_0xd56b('0x17')][_0xd56b('0xa1')]=function(_0x238247){try{var _0x3ab7a9=JSON['parse'](_0x238247);this[_0xd56b('0xa3')](_0x3ab7a9);return JSON[_0xd56b('0x83')](_0x3ab7a9);}catch(_0xd597d6){return this['replaceAllVariables'](_0x238247);}};AGIVertices['prototype'][_0xd56b('0xa2')]=function(_0x4e7fcd){console[_0xd56b('0x46')]('replaceall\x20init',_0x4e7fcd);var _0x925bfa=_0x4e7fcd[_0xd56b('0xaa')]('{');for(var _0xeb3ede=0x1;_0xeb3ede<_0x925bfa[_0xd56b('0xa6')];_0xeb3ede+=0x1){var _0x3f7c1f=_0x925bfa[_0xeb3ede][_0xd56b('0xaa')]('}');console[_0xd56b('0x46')](_0xd56b('0xab'),_0x3f7c1f);if(_0x3f7c1f[_0xd56b('0xa6')]>0x1){_0x4e7fcd=_0x4e7fcd['replaceAll']('{'+_0x3f7c1f[0x0]+'}',this[_0xd56b('0x38')][_0xd56b('0x12')](_0x3f7c1f[0x0])[_0xd56b('0xac')]||_0x3f7c1f[0x0]);}}if(_0x925bfa[_0xd56b('0xa6')]===0x1){return _0x4e7fcd[_0xd56b('0xad')]();}console[_0xd56b('0x46')](_0xd56b('0xae'),_0x4e7fcd);return this[_0xd56b('0xa2')](_0x4e7fcd);};AGIVertices['prototype'][_0xd56b('0xaf')]=function(_0x1daa7a,_0x203ad6){var _0x3dc843=this[_0xd56b('0x38')][_0xd56b('0x12')](_0x1daa7a);if(_0x3dc843[_0xd56b('0xb0')]===-0x1){return _0x3dc843;}logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xb1'),_0x203ad6,_0x3dc843[_0xd56b('0xac')]));return this[_0xd56b('0x38')][_0xd56b('0xa9')](_0x203ad6,_0x3dc843[_0xd56b('0xac')]);};AGIVertices[_0xd56b('0x17')]['isConfigured']=function(_0x1b5771){return _0x1b5771&&_0x1b5771!=='0'&&_0x1b5771!=='-1'&&_0x1b5771!=='';};AGIVertices[_0xd56b('0x17')][_0xd56b('0xb2')]=function(_0x3747a4){this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x3747a4,'-');_0x3747a4['retry']=_0x3747a4[_0xd56b('0xb2')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd56b('0x17')][_0xd56b('0xb4')]=function(_0x12418e){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xb5'),_0x12418e[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x12418e[_0xd56b('0x6c')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20text\x20configured');}var _0x1d2ba1='\x22'+_0x12418e[_0xd56b('0x6c')]+'\x22';if(this[_0xd56b('0x91')](_0x12418e[_0xd56b('0x88')])){_0x1d2ba1+=','+_0x12418e[_0xd56b('0x88')];}var _0x12754e=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0xd56b('0xb8'),_0x1d2ba1);if(_0x12754e[_0xd56b('0xb0')]===-0x1){return _0x12754e;}return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0xb9'),_0x1d2ba1));};AGIVertices['prototype'][_0xd56b('0xba')]=function(_0x433cd9){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xbb'),_0x433cd9[_0xd56b('0x3a')]));if(!this['isConfigured'](_0x433cd9[_0xd56b('0xbc')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xbd'));}var _0x11f288=_0x433cd9[_0xd56b('0xbc')];if(this['isConfigured'](_0x433cd9[_0xd56b('0x88')])){_0x11f288+=','+_0x433cd9[_0xd56b('0x88')];}var _0x19e469=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0xd56b('0xbe'),_0x11f288);if(_0x19e469[_0xd56b('0xb0')]===-0x1){return _0x19e469;}var _0x566ab4=this[_0xd56b('0xaf')](_0xd56b('0xbf'),_0xd56b('0xc0'));if(_0x566ab4[_0xd56b('0xb0')]===-0x1){return _0x566ab4;}var _0x516e84=this[_0xd56b('0xaf')](_0xd56b('0xc1'),_0xd56b('0xc2'));if(_0x516e84[_0xd56b('0xb0')]===-0x1){return _0x516e84;}var _0x4bd1b7=this[_0xd56b('0xaf')](_0xd56b('0xc3'),_0xd56b('0xc4'));if(_0x4bd1b7['result']===-0x1){return _0x4bd1b7;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0xc5'),_0x11f288));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x7')]=function(_0x2d0d30){logger[_0xd56b('0x30')](util['format'](_0xd56b('0xc6'),_0x2d0d30['label']));return this['channel'][_0xd56b('0x7')]([_0x2d0d30['command'],_0x2d0d30['args']]);};AGIVertices['prototype'][_0xd56b('0xc7')]=function(_0x4a63c3){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xc8'),_0x4a63c3[_0xd56b('0x3a')]));if(this['isConfigured'](_0x4a63c3[_0xd56b('0x79')])){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x4a63c3[_0xd56b('0x79')]));var _0x55171c=this['channel'][_0xd56b('0xc9')](_0x4a63c3[_0xd56b('0x79')]);if(_0x55171c[_0xd56b('0xb0')]===-0x1){return _0x55171c;}}return this['channel'][_0xd56b('0xc7')]();};AGIVertices[_0xd56b('0x17')][_0xd56b('0xca')]=function(_0x4b0649){console[_0xd56b('0x46')](_0xd56b('0xcb'),_0x4b0649);logger[_0xd56b('0x30')](util['format'](_0xd56b('0xcc'),_0x4b0649[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x4b0649[_0xd56b('0xcd')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x4b0649,_0xd56b('0xce'));}_0x4b0649[_0xd56b('0x4f')]=moment();if(this['isConfigured'](_0x4b0649[_0xd56b('0xcf')])){_0x4b0649[_0xd56b('0x4f')]=moment()[_0xd56b('0x5f')](_0x4b0649[_0xd56b('0xcf')],_0xd56b('0x5d'));}if(!this[_0xd56b('0x91')](_0x4b0649[_0xd56b('0x50')])){_0x4b0649[_0xd56b('0x50')]=0x2;}console['log'](_0xd56b('0xd0'),_0x4b0649);this[_0xd56b('0x45')][_0xd56b('0xb3')](this,_0x4b0649);return this[_0xd56b('0x38')][_0xd56b('0xb6')](util['format'](_0xd56b('0xd1'),_0x4b0649[_0xd56b('0x4d')],_0x4b0649['list_id'],_0x4b0649[_0xd56b('0x4f')]));};AGIVertices[_0xd56b('0x17')][_0xd56b('0xd2')]=function(_0x32a5c0){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xd3'),_0x32a5c0[_0xd56b('0x3a')]));var _0x19e7d3=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0x32a5c0[_0xd56b('0xd4')],_0x32a5c0[_0xd56b('0x88')]);if(_0x19e7d3['result']===-0x1){return _0x19e7d3;}return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0xd5'),_0x32a5c0[_0xd56b('0xd4')],_0x32a5c0[_0xd56b('0x88')]));};AGIVertices[_0xd56b('0x17')][_0xd56b('0xd6')]=function(_0x5bc97d){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xd7'),_0x5bc97d[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x5bc97d[_0xd56b('0x6c')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xd8'));}var _0x53b816='\x22'+_0x5bc97d[_0xd56b('0x6c')]+'\x22';if(this[_0xd56b('0x91')](_0x5bc97d[_0xd56b('0x88')])){_0x53b816+=','+_0x5bc97d[_0xd56b('0x88')];}var _0x24be27=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0xd56b('0xb8'),_0x53b816);if(_0x24be27[_0xd56b('0xb0')]===-0x1){return _0x24be27;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0xb9'),_0x53b816));};AGIVertices[_0xd56b('0x17')]['sestektts']=function(_0xd0f2d4){logger[_0xd56b('0x30')](util['format'](_0xd56b('0xd9'),_0xd0f2d4[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0xd0f2d4[_0xd56b('0x6c')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xd8'));}var _0x19b8d0='\x22'+_0xd0f2d4[_0xd56b('0x6c')]+'\x22';if(this[_0xd56b('0x91')](_0xd0f2d4['options'])){_0x19b8d0+=','+_0xd0f2d4[_0xd56b('0x88')];}var _0x510347=this[_0xd56b('0x38')]['exec'](_0xd56b('0xb8'),_0x19b8d0);if(_0x510347[_0xd56b('0xb0')]===-0x1){return _0x510347;}return this['channel']['noop'](util[_0xd56b('0x2b')](_0xd56b('0xb9'),_0x19b8d0));};AGIVertices['prototype'][_0xd56b('0xda')]=function(_0x462825){logger[_0xd56b('0x30')](util['format'](_0xd56b('0xdb'),_0x462825[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x462825['grammar'])){return this['channel'][_0xd56b('0xb6')](_0xd56b('0xbd'));}var _0x4ec909=_0x462825[_0xd56b('0xbc')];if(this['isConfigured'](_0x462825[_0xd56b('0x88')])){_0x4ec909+=','+_0x462825['options'];}var _0x36e775=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0xd56b('0xbe'),_0x4ec909);if(_0x36e775[_0xd56b('0xb0')]===-0x1){return _0x36e775;}var _0x530ef6=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xd56b('0xdc'));if(_0x530ef6[_0xd56b('0xb0')]===-0x1){return _0x530ef6;}var _0x3a08de=this[_0xd56b('0xaf')](_0xd56b('0xc1'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3a08de[_0xd56b('0xb0')]===-0x1){return _0x3a08de;}var _0x30770a=this['getAndSetVariable'](_0xd56b('0xc3'),_0xd56b('0xdd'));if(_0x30770a[_0xd56b('0xb0')]===-0x1){return _0x30770a;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util['format'](_0xd56b('0xc5'),_0x4ec909));};AGIVertices[_0xd56b('0x17')][_0xd56b('0xde')]=function(_0x185bb4){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xdf'),_0x185bb4[_0xd56b('0x3a')]));if(!this['isConfigured'](_0x185bb4[_0xd56b('0xbc')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20grammar\x20configured');}var _0x243fef=_0x185bb4[_0xd56b('0xbc')];if(this[_0xd56b('0x91')](_0x185bb4[_0xd56b('0x88')])){_0x243fef+=','+_0x185bb4[_0xd56b('0x88')];}var _0x28294e=this[_0xd56b('0x38')][_0xd56b('0xb7')]('MRCPRecog',_0x243fef);if(_0x28294e[_0xd56b('0xb0')]===-0x1){return _0x28294e;}var _0x4cc1de=this[_0xd56b('0xaf')](_0xd56b('0xbf'),_0xd56b('0xe0'));if(_0x4cc1de['result']===-0x1){return _0x4cc1de;}var _0x53352c=this[_0xd56b('0xaf')](_0xd56b('0xc1'),_0xd56b('0xe1'));if(_0x53352c[_0xd56b('0xb0')]===-0x1){return _0x53352c;}var _0x4f1502=this[_0xd56b('0xaf')](_0xd56b('0xc3'),'SESTEK_ASR_INSTANCE');if(_0x4f1502[_0xd56b('0xb0')]===-0x1){return _0x4f1502;}return this['channel'][_0xd56b('0xb6')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x243fef));};AGIVertices['prototype']['database']=function(_0xdf237c){logger[_0xd56b('0x30')](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0xdf237c[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0xdf237c['odbc_id'])){return this['channel'][_0xd56b('0x2e')](_0xdf237c,_0xd56b('0xe2'));}var _0x5b8d9e=this[_0xd56b('0x1b')]['sync'](this,_0xdf237c[_0xd56b('0xe3')]);if(!_0x5b8d9e){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0xdf237c,_0xd56b('0xe4'));}if(!this[_0xd56b('0x91')](_0xdf237c[_0xd56b('0x31')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0xdf237c,_0xd56b('0xe5'));}var _0x13cb31=_0xdf237c[_0xd56b('0x31')][_0xd56b('0x69')](/(\r\n|\n|\r)/gm,'\x20');this[_0xd56b('0x38')][_0xd56b('0xb6')](util['format'](_0xd56b('0xe6'),_0x13cb31));var _0x558ea9=this[_0xd56b('0x2c')][_0xd56b('0xb3')](this,_0x5b8d9e,_0x13cb31);this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0xdf237c,_0x13cb31);if(!this['isConfigured'](_0xdf237c['variable_id'])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xe7'));}var _0x5c2bec=this[_0xd56b('0x12')][_0xd56b('0xb3')](this,_0xdf237c[_0xd56b('0xe8')]);if(!_0x5c2bec){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0xdf237c,_0xd56b('0xe9'));}var _0x192478=this;_0x558ea9[_0xd56b('0xea')](function(_0x195f4c,_0x164318){Object[_0xd56b('0xeb')](_0x195f4c)['forEach'](function(_0x41d43d){_0x192478['channel']['setVariable'](util[_0xd56b('0x2b')](_0xd56b('0xec'),_0x5c2bec,_0x164318,_0x41d43d),_0x195f4c[_0x41d43d]);});});this['channel']['setVariable'](util[_0xd56b('0x2b')]('%s_ROWS_COUNT',_0x5c2bec),_0x558ea9[_0xd56b('0xa6')]);return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0xed'),_0x5c2bec));};AGIVertices[_0xd56b('0x17')][_0xd56b('0xee')]=function(_0x431534){logger['debug'](util[_0xd56b('0x2b')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x431534[_0xd56b('0x3a')]));if(!this['isConfigured'](_0x431534['sip_id'])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x431534,_0xd56b('0xef'));}var _0x170fe2=this[_0xd56b('0x1e')][_0xd56b('0xb3')](this,_0x431534['sip_id']);if(!_0x170fe2){return this['channel'][_0xd56b('0x2e')](_0x431534,_0xd56b('0xf0'));}var _0x37fbe0=this['channel'][_0xd56b('0xb7')](_0xd56b('0xf1'),[util[_0xd56b('0x2b')]('SIP/%s',_0x170fe2),_0x431534[_0xd56b('0x79')],_0x431534[_0xd56b('0xf2')],_0x431534[_0xd56b('0x76')]]);if(_0x37fbe0[_0xd56b('0xb0')]===-0x1){return _0x37fbe0;}return this['channel'][_0xd56b('0xb6')](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xd56b('0x17')][_0xd56b('0xf3')]=function(_0x2d8177){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x2d8177[_0xd56b('0x3a')]));if(!this['isConfigured'](_0x2d8177[_0xd56b('0x8a')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20key\x20configured');}if(!this[_0xd56b('0x91')](_0x2d8177[_0xd56b('0x6c')])){return this['channel'][_0xd56b('0xb6')](_0xd56b('0xd8'));}this['channel']['bot']=!![];this[_0xd56b('0x37')](_0x2d8177);this['createSquareMessage'](_0x2d8177[_0xd56b('0x6c')],'in');this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0xf4'),_0x2d8177[_0xd56b('0x6c')]));var _0x37b7c7=this[_0xd56b('0x89')][_0xd56b('0xb3')](this,_0x2d8177);if(_0x37b7c7){for(var _0x316b55 in _0x37b7c7){if(_0x37b7c7[_0xd56b('0x9f')](_0x316b55)){this['channel'][_0xd56b('0xa9')](util[_0xd56b('0x2b')](_0xd56b('0xf5'),_0x316b55['toUpperCase']()),_0x37b7c7[_0x316b55]);}}this[_0xd56b('0x44')](_0x37b7c7[_0xd56b('0xf6')],_0xd56b('0xf7'));return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('Dialogflow\x20Result\x20%s',_0x37b7c7['speech']));}return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x2d8177,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0xd56b('0xf8')]=function(_0x40ddf2){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0xf9'),_0x40ddf2[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x40ddf2['ndauth_url'])){return this['channel'][_0xd56b('0xb6')](_0xd56b('0xfa'));}if(!this['isConfigured'](_0x40ddf2['username'])){return this['channel'][_0xd56b('0xb6')](_0xd56b('0xfb'));}if(!this[_0xd56b('0x91')](_0x40ddf2[_0xd56b('0xfc')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xfd'));}if(!this['isConfigured'](_0x40ddf2[_0xd56b('0xfe')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xd8'));}this[_0xd56b('0x38')]['bot']=!![];this[_0xd56b('0x37')](_0x40ddf2);this[_0xd56b('0x44')](_0x40ddf2[_0xd56b('0x6c')],'in');this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('Trying\x20SestekNDA:\x20%s',_0x40ddf2[_0xd56b('0x6c')]));var _0x17de1d=this[_0xd56b('0x8c')][_0xd56b('0xb3')](this,_0x40ddf2);if(_0x17de1d){for(var _0xd2536b in _0x17de1d){if(_0x17de1d[_0xd56b('0x9f')](_0xd2536b)){this[_0xd56b('0x38')][_0xd56b('0xa9')](util[_0xd56b('0x2b')](_0xd56b('0xff'),_0xd2536b[_0xd56b('0x100')]()),_0x17de1d[_0xd2536b]);}}this['createSquareMessage'](_0x17de1d[_0xd56b('0xf6')],_0xd56b('0xf7'));if(_0x17de1d[_0xd56b('0x101')]){this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x17de1d[_0xd56b('0x101')]));var _0x3e6e40=this[_0xd56b('0x38')]['streamFile'](_0x17de1d['audiofile']);try{fs[_0xd56b('0x102')](_0x17de1d['audiofile']+_0xd56b('0x103'));}catch(_0x4e642d){logger[_0xd56b('0x2e')](_0x4e642d);}return _0x3e6e40;}else{return this['channel']['noop'](util[_0xd56b('0x2b')]('SestekNDA\x20Result\x20%s',_0x17de1d[_0xd56b('0xf6')]));}}return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x40ddf2,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xd56b('0x17')][_0xd56b('0x104')]=function(_0x396d08){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x105'),_0x396d08['label']));return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x104'));};AGIVertices['prototype'][_0xd56b('0x106')]=function(_0x3396b6){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x107'),_0x3396b6[_0xd56b('0x3a')]));var _0x546cd4='';if(_0x3396b6['trunk_id']){if(!this[_0xd56b('0x91')](_0x3396b6['trunk_id'])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x3396b6,'no\x20trunk\x20selected');}else{var _0x811504=parseInt(_0x3396b6[_0xd56b('0x108')],0xa);if(isNaN(_0x811504)){_0x546cd4=_0x3396b6[_0xd56b('0x108')];}else{_0x546cd4=this[_0xd56b('0x20')][_0xd56b('0xb3')](this,_0x3396b6['trunk_id']);if(!_0x546cd4){return this['channel'][_0xd56b('0x2e')](_0x3396b6,_0xd56b('0x109'));}}}}else if(_0x3396b6[_0xd56b('0x10a')]){_0x546cd4=_0x3396b6[_0xd56b('0x10a')];}else{return this[_0xd56b('0x38')]['error'](_0x3396b6,_0xd56b('0x10b'));}var _0x3903de=this['channel']['exec']('DIAL',[util[_0xd56b('0x2b')](_0xd56b('0x10c'),_0x546cd4,_0x3396b6['phone']),_0x3396b6[_0xd56b('0x79')],_0x3396b6['opts'],_0x3396b6[_0xd56b('0x76')]]);if(_0x3903de[_0xd56b('0xb0')]===-0x1){return _0x3903de;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x10d'),_0xd56b('0xf1')));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x10e')]=function(_0x343d41){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x10f'),_0x343d41[_0xd56b('0x3a')]));return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x10e'));};AGIVertices['prototype'][_0xd56b('0xe')]=function(_0x5d4d1f){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x110'),_0x5d4d1f[_0xd56b('0x3a')]));if(_0x5d4d1f[_0xd56b('0x111')]===0x0){return this[_0xd56b('0xb2')](_0x5d4d1f);}_0x5d4d1f[_0xd56b('0x111')]-=0x1;if(!this[_0xd56b('0x91')](_0x5d4d1f[_0xd56b('0x112')])){return this['channel'][_0xd56b('0x2e')](_0x5d4d1f,_0xd56b('0x113'));}var _0x4e4a71=this[_0xd56b('0x114')][_0xd56b('0xb3')](this,_0x5d4d1f[_0xd56b('0x112')]);if(!_0x4e4a71){return this[_0xd56b('0x38')]['error'](_0x5d4d1f,'no\x20file\x20audio\x20found');}if(!this[_0xd56b('0x91')](_0x5d4d1f[_0xd56b('0xe8')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0xd56b('0xe7'));}var _0x193a5c=this[_0xd56b('0x38')][_0xd56b('0x115')](_0x4e4a71,_0x5d4d1f['response'],_0x5d4d1f['maxdigit']);var _0x3fb369=_0x193a5c['result']?_0x193a5c[_0xd56b('0xb0')]['toString']():'';logger[_0xd56b('0x30')](_0xd56b('0x116'),JSON[_0xd56b('0x83')](_0x193a5c));if(_0x193a5c[_0xd56b('0xb0')]===-0x1){this['createSquareDetailsReport'][_0xd56b('0xb3')](this,_0x5d4d1f,_0x3fb369);return _0x193a5c;}else if(_0x193a5c['extra']==='timeout'){_0x193a5c[_0xd56b('0xb0')]=_0x3fb369[_0xd56b('0xa6')]>=parseInt(_0x5d4d1f['mindigit'])?'x':'i';}else{_0x193a5c[_0xd56b('0xb0')]=_0x3fb369[_0xd56b('0xa6')]>=parseInt(_0x5d4d1f[_0xd56b('0x117')])&&_0x3fb369['length']<=parseInt(_0x5d4d1f[_0xd56b('0x118')])?'x':'i';}var _0x237a42=this[_0xd56b('0x12')][_0xd56b('0xb3')](this,_0x5d4d1f[_0xd56b('0xe8')]);if(!_0x237a42){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x5d4d1f,_0xd56b('0xe9'));}this[_0xd56b('0x38')]['setVariable'](_0x237a42,_0x3fb369);if(this['isConfigured'](_0x5d4d1f[_0xd56b('0x119')])){var _0x28089c=parseInt(_0x5d4d1f[_0xd56b('0x119')],0xa);var _0x28816a=rs[_0xd56b('0x11a')]({'charset':'*','length':_0x28089c});var _0x226067=_0x3fb369[_0xd56b('0xa6')];if(_0x226067>0x0){if(_0x226067>_0x28089c){this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x5d4d1f,_0x5d4d1f[_0xd56b('0x11b')]===_0xd56b('0x11c')?_0x28816a+_0x3fb369[_0xd56b('0x11d')](_0x28089c):_0x3fb369[_0xd56b('0x11d')](0x0,_0x226067-_0x28089c)+_0x28816a);}else{this['createSquareDetailsReport'][_0xd56b('0xb3')](this,_0x5d4d1f,rs['generate']({'charset':'*','length':_0x226067}));}}else{this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x5d4d1f,'');}}else{this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x5d4d1f,_0x3fb369);}return _0x193a5c;};AGIVertices[_0xd56b('0x17')]['getsecretdigits']=function(_0x5f5ae7){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x11e'),_0x5f5ae7['label']));return this['getdigits'](_0x5f5ae7);};AGIVertices[_0xd56b('0x17')][_0xd56b('0x11f')]=function(_0x5d53e4){logger['info'](util['format'](_0xd56b('0x120'),_0x5d53e4[_0xd56b('0x3a')]));this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x5d53e4,_0x5d53e4[_0xd56b('0x121')]);return this[_0xd56b('0x38')][_0xd56b('0xb6')](util['format'](_0xd56b('0x122'),_0x5d53e4[_0xd56b('0x121')]));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x123')]=function(_0x3e3e2b){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x124'),_0x3e3e2b[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x3e3e2b['aws_access_key_id'])||!this[_0xd56b('0x91')](_0x3e3e2b[_0xd56b('0x94')])){return this['channel'][_0xd56b('0xb6')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xd56b('0x91')](_0x3e3e2b[_0xd56b('0x6c')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20text\x20configured');}this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('Trying\x20aws\x20Polly\x20%s',_0x3e3e2b[_0xd56b('0x6c')]));var _0x3289bf=this[_0xd56b('0x125')][_0xd56b('0xb3')](this,_0x3e3e2b);if(_0x3289bf){this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('aws\x20Polly\x20%s\x20file\x20created',_0x3289bf));var _0x5b57c9=this[_0xd56b('0x38')][_0xd56b('0x126')](_0x3289bf);try{fs[_0xd56b('0x102')](_0x3289bf+_0xd56b('0x103'));}catch(_0xd18800){logger[_0xd56b('0x2e')](_0xd18800);}return _0x5b57c9;}return this[_0xd56b('0x38')]['error'](_0x3e3e2b,_0xd56b('0x127'));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x128')]=function(_0xa588d){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0xa588d[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0xa588d['aws_access_key_id'])||!this[_0xd56b('0x91')](_0xa588d[_0xd56b('0x94')])){return this['channel'][_0xd56b('0xb6')](_0xd56b('0x129'));}if(!this[_0xd56b('0x91')](_0xa588d['aws_bot_name'])){return this[_0xd56b('0x38')]['noop'](_0xd56b('0x12a'));}if(!this[_0xd56b('0x91')](_0xa588d['text'])){return this[_0xd56b('0x38')]['noop']('no\x20text\x20configured');}this[_0xd56b('0x38')][_0xd56b('0x12b')]=!![];this['createSquareDetailsReport'](_0xa588d);this['createSquareMessage'](_0xa588d[_0xd56b('0x6c')],'in');this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x12c'),_0xa588d[_0xd56b('0x6c')]));var _0x151eb9=this[_0xd56b('0x98')][_0xd56b('0xb3')](this,_0xa588d);if(_0x151eb9){for(var _0x60bae2 in _0x151eb9){if(_0x151eb9[_0xd56b('0x9f')](_0x60bae2)&&_[_0xd56b('0xa0')](_0x151eb9[_0x60bae2])){this[_0xd56b('0x38')][_0xd56b('0xa9')](util['format'](_0xd56b('0x12d'),_0x60bae2[_0xd56b('0x100')]()),_0x151eb9[_0x60bae2]);}}if(_[_0xd56b('0x4a')](_0x151eb9[_0xd56b('0x86')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x12e'));}else{this[_0xd56b('0x44')](_0x151eb9[_0xd56b('0x86')],'out');return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')]('Amazon\x20Lex\x20Result\x20%s',_0x151eb9['message']));}}return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0xa588d,_0xd56b('0x12f'));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x130')]=function(_0x417582){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x131'),_0x417582['label'],_0x417582[_0xd56b('0x79')]));if(!this[_0xd56b('0x91')](_0x417582['key'])){return this[_0xd56b('0x38')]['noop'](_0xd56b('0x132'));}var _0x122676='wav';var _0x249814=util[_0xd56b('0x2b')](_0xd56b('0x133'),FILES_PATH,rs[_0xd56b('0x11a')](0x4));var _0x4c2982=util[_0xd56b('0x2b')](_0xd56b('0xa8'),_0x249814,_0x122676);var _0x1b4356=!![];if(_0x417582[_0xd56b('0x134')]==='NOBEEP'){_0x1b4356=![];}var _0x1d0539=this['channel']['recordFile'](_0x249814,_0x122676,_0x417582[_0xd56b('0x135')],_0x417582[_0xd56b('0x79')],undefined,_0x1b4356);if(_0x1d0539[_0xd56b('0xb0')]!==-0x1){this['channel'][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('google\x20%s\x20file\x20created',_0x4c2982));var _0x2cd72f=this[_0xd56b('0x136')]['sync'](this,_0x417582,_0x4c2982);if(_0x2cd72f){for(var _0x4c60db in _0x2cd72f){if(_0x2cd72f[_0xd56b('0x9f')](_0x4c60db)){this[_0xd56b('0x38')][_0xd56b('0xa9')](util[_0xd56b('0x2b')](_0xd56b('0x137'),_0x4c60db[_0xd56b('0x100')]()),_0x2cd72f[_0x4c60db]);}}return this['channel'][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x138'),JSON[_0xd56b('0x83')](_0x2cd72f)));}}return _0x1d0539;};AGIVertices[_0xd56b('0x17')][_0xd56b('0x139')]=function(_0x3ca965){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x13a'),_0x3ca965[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x3ca965[_0xd56b('0x13b')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x13c'));}if(!this['isConfigured'](_0x3ca965[_0xd56b('0x9c')])){return this['channel'][_0xd56b('0xb6')]('no\x20appsecret\x20configured');}var _0x1c47d0=_0xd56b('0x13d');var _0x1c887f=util[_0xd56b('0x2b')]('%s/recordings/%s',FILES_PATH,rs[_0xd56b('0x11a')](0x4));var _0x46d5ce=util[_0xd56b('0x2b')](_0xd56b('0xa8'),_0x1c887f,_0x1c47d0);var _0x1fbc1d=!![];if(_0x3ca965[_0xd56b('0x134')]===_0xd56b('0x13e')){_0x1fbc1d=![];}var _0x58c8d6=this[_0xd56b('0x38')][_0xd56b('0x13f')](_0x1c887f,_0x1c47d0,_0x3ca965[_0xd56b('0x135')],_0x3ca965[_0xd56b('0x79')],undefined,_0x1fbc1d);if(_0x58c8d6[_0xd56b('0xb0')]!==-0x1){this['channel'][_0xd56b('0xb6')](util['format'](_0xd56b('0x140'),_0x46d5ce));var _0x6942ed=this['tildeASR'][_0xd56b('0xb3')](this,_0x3ca965,_0x46d5ce);if(_0x6942ed){for(var _0x1110f5 in _0x6942ed){if(_0x6942ed[_0xd56b('0x9f')](_0x1110f5)){this['channel'][_0xd56b('0xa9')](util['format'](_0xd56b('0x141'),_0x1110f5[_0xd56b('0x100')]()),_0x6942ed[_0x1110f5]);}}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x142'),JSON[_0xd56b('0x83')](_0x6942ed)));}}return _0x58c8d6;};AGIVertices[_0xd56b('0x17')]['gotoc']=function(_0x33f464){logger['info'](util['format'](_0xd56b('0x143'),_0x33f464[_0xd56b('0x3a')]));return this[_0xd56b('0x38')]['continueAt'](_0x33f464[_0xd56b('0x144')],_0x33f464[_0xd56b('0x40')],_0x33f464['priority']);};AGIVertices[_0xd56b('0x17')][_0xd56b('0x145')]=function(_0x2c20c6){logger['info'](util['format'](_0xd56b('0x146'),_0x2c20c6[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x2c20c6[_0xd56b('0x147')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x2c20c6,_0xd56b('0x148'));}try{var _0x431160=eval(_0x2c20c6[_0xd56b('0x147')])?_0xd56b('0x149'):_0xd56b('0x14a');this[_0xd56b('0x38')][_0xd56b('0xb6')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x2c20c6[_0xd56b('0x147')],_0x431160));return{'code':0xc8,'result':_0x431160};}catch(_0x24b895){return{'code':0xc8,'result':_0xd56b('0x14a')};}};AGIVertices[_0xd56b('0x17')]['gotoiftime']=function(_0x4c8aa){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x14b'),_0x4c8aa['label']));if(!this[_0xd56b('0x91')](_0x4c8aa['interval_id'])){return this['channel']['error'](_0x4c8aa,_0xd56b('0x14c'));}var _0x155249=this[_0xd56b('0x27')][_0xd56b('0xb3')](this,_0x4c8aa['interval_id']);if(!_0x155249){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x4c8aa,_0xd56b('0x14d'));}for(var _0x4ff27c=0x0;_0x4ff27c<_0x155249[_0xd56b('0xa6')];_0x4ff27c+=0x1){var _0x37fa27=this['channel'][_0xd56b('0x12')](util[_0xd56b('0x2b')](_0xd56b('0x14e'),_0x155249[_0x4ff27c]));if(_0x37fa27[_0xd56b('0xb0')]===-0x1){return _0x37fa27;}logger['info'](util[_0xd56b('0x2b')]('IFTIME\x20%s\x20%s',_0x155249[_0x4ff27c],_0x37fa27[_0xd56b('0xac')]));if(_0x37fa27[_0xd56b('0xac')]===_0xd56b('0x149')){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x14f'),_0x155249[_0x4ff27c],_0xd56b('0x149')));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x14f'),_0x155249[_0x4ff27c],'true'));return{'code':0xc8,'result':_0xd56b('0x149')};}else{logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x14f'),_0x155249[_0x4ff27c],_0xd56b('0x14a')));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x14f'),_0x155249[_0x4ff27c],_0xd56b('0x14a')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xd56b('0x17')][_0xd56b('0x150')]=function(_0x11bd74){logger[_0xd56b('0x30')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x11bd74[_0xd56b('0x3a')]));return this[_0xd56b('0x38')]['hangup']();};AGIVertices[_0xd56b('0x17')][_0xd56b('0x151')]=function(_0x5b42f5){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x152'),_0x5b42f5[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x5b42f5['key'])){return this['channel']['noop']('no\x20key\x20configured');}var _0x25116b='wav';var _0x4ed53e=util[_0xd56b('0x2b')](_0xd56b('0x133'),FILES_PATH,rs[_0xd56b('0x11a')](0x4));var _0x49ee15=util['format'](_0xd56b('0xa8'),_0x4ed53e,_0x25116b);var _0x1d9585=!![];if(_0x5b42f5['beep']==='NOBEEP'){_0x1d9585=![];}var _0x30c6f7=this[_0xd56b('0x38')]['recordFile'](_0x4ed53e,_0x25116b,_0x5b42f5[_0xd56b('0x135')],_0x5b42f5[_0xd56b('0x79')],undefined,_0x1d9585);if(_0x30c6f7[_0xd56b('0xb0')]!==-0x1){this['channel'][_0xd56b('0xb6')](util['format']('ispeech\x20%s\x20file\x20created',_0x49ee15));var _0x38b505=this['ispeechASR'][_0xd56b('0xb3')](this,_0x5b42f5,_0x49ee15);if(_0x38b505){for(var _0x582b51 in _0x38b505){if(_0x38b505[_0xd56b('0x9f')](_0x582b51)){this[_0xd56b('0x38')][_0xd56b('0xa9')](util[_0xd56b('0x2b')](_0xd56b('0x153'),_0x582b51[_0xd56b('0x100')]()),_0x38b505[_0x582b51]);}}return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x38b505)));}}return _0x30c6f7;};AGIVertices[_0xd56b('0x17')][_0xd56b('0x154')]=function(_0x5159a6){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x155'),_0x5159a6[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x5159a6[_0xd56b('0x8a')])){return this[_0xd56b('0x38')]['noop'](_0xd56b('0x132'));}if(!this[_0xd56b('0x91')](_0x5159a6[_0xd56b('0x6c')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xd8'));}this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x156'),_0x5159a6['text']));var _0x533fef=this['ispeechTTS'][_0xd56b('0xb3')](this,_0x5159a6);if(_0x533fef){this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0x157'),_0x533fef));var _0x358879=this[_0xd56b('0x38')][_0xd56b('0x126')](_0x533fef,_0x5159a6[_0xd56b('0x135')]);try{fs[_0xd56b('0x102')](_0x533fef+_0xd56b('0x103'));}catch(_0x164344){logger[_0xd56b('0x2e')](_0x164344);}return _0x358879;}return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x5159a6,_0xd56b('0x158'));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x159')]=function(_0x1c460a){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x15a'),_0x1c460a[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x1c460a[_0xd56b('0x15b')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x1c460a,_0xd56b('0x15c'));}logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x15d'),this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x1c460a[_0xd56b('0x15b')]));var _0x1a47c2=this['agentLogin'][_0xd56b('0xb3')](this,_0x1c460a[_0xd56b('0x15b')]);if(_0x1a47c2){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x15e'),this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x1c460a[_0xd56b('0x15b')]));this['channel']['noop'](util['format'](_0xd56b('0x15e'),this['channel'][_0xd56b('0x3e')],_0x1c460a[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x15f')};}else{logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x160'),this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x1c460a['findBy']));this['channel'][_0xd56b('0xb6')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x1c460a[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x161')};}};AGIVertices['prototype']['logout']=function(_0x5b86ef){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x162'),_0x5b86ef['label']));if(!this[_0xd56b('0x91')](_0x5b86ef[_0xd56b('0x15b')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x5b86ef,_0xd56b('0x15c'));}logger['info'](util['format'](_0xd56b('0x15d'),this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x5b86ef[_0xd56b('0x15b')]));var _0x31a6b6=this[_0xd56b('0x65')][_0xd56b('0xb3')](this,_0x5b86ef[_0xd56b('0x15b')]);if(_0x31a6b6){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x15e'),this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x5b86ef[_0xd56b('0x15b')]));this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0x15e'),this[_0xd56b('0x38')]['callerid'],_0x5b86ef[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x15f')};}else{logger[_0xd56b('0x30')](util['format'](_0xd56b('0x160'),this[_0xd56b('0x38')]['callerid'],_0x5b86ef['findBy']));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x160'),this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x5b86ef[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x161')};}};AGIVertices['prototype'][_0xd56b('0x163')]=function(_0x22e0fe){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x22e0fe[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x22e0fe[_0xd56b('0x164')])){return this['channel'][_0xd56b('0x2e')](_0x22e0fe,_0xd56b('0x165'));}this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')]('math\x20%s',_0x22e0fe[_0xd56b('0x164')]));var _0x495376=eval(_0x22e0fe[_0xd56b('0x164')]);if(!this[_0xd56b('0x91')](_0x22e0fe[_0xd56b('0xe8')])){return this[_0xd56b('0x38')]['noop'](_0xd56b('0xe7'));}var _0x4196d1=this[_0xd56b('0x12')][_0xd56b('0xb3')](this,_0x22e0fe['variable_id']);if(!_0x4196d1){return this[_0xd56b('0x38')]['error'](_0x22e0fe,_0xd56b('0xe9'));}if(_[_0xd56b('0xa5')](_0x495376)){var _0x3d76c7=this;_0x495376[_0xd56b('0xea')](function(_0xe0dccb,_0x536e2c){_0x3d76c7[_0xd56b('0x38')][_0xd56b('0xa9')](util[_0xd56b('0x2b')]('%s[%s]',_0x4196d1,_0x536e2c),_0xe0dccb);});return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')]('variable\x20%s[key]\x20set',_0x4196d1));}else{return this[_0xd56b('0x38')][_0xd56b('0xa9')](_0x4196d1,_0x495376);}};AGIVertices[_0xd56b('0x17')][_0xd56b('0x166')]=function(_0x540052){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x167'),_0x540052[_0xd56b('0x3a')]));if(_0x540052[_0xd56b('0x111')]===0x0){return this[_0xd56b('0xb2')](_0x540052);}_0x540052[_0xd56b('0x111')]-=0x1;if(!this[_0xd56b('0x91')](_0x540052[_0xd56b('0x112')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x540052,_0xd56b('0x113'));}var _0x480689=this[_0xd56b('0x114')][_0xd56b('0xb3')](this,_0x540052[_0xd56b('0x112')]);if(!_0x480689){return this['channel'][_0xd56b('0x2e')](_0x540052,'no\x20file\x20audio\x20found');}var _0x455f46=this[_0xd56b('0x38')][_0xd56b('0x115')](_0x480689,_0x540052[_0xd56b('0x168')],_0x540052['digit']);var _0x43bc9d=_0x455f46['result'];if(_0x455f46['result']===-0x1){this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x540052,'-1');return _0x455f46;}else if(_0x455f46[_0xd56b('0xac')]==='timeout'){_0x455f46[_0xd56b('0xb0')]=_0x455f46[_0xd56b('0xb0')][_0xd56b('0xa6')]>0x0?_0x455f46['result']:'t';}else if(_[_0xd56b('0x49')](_0x455f46[_0xd56b('0xb0')])){_0x455f46[_0xd56b('0xb0')]='#';_0x43bc9d='#';}if(!this[_0xd56b('0x91')](_0x540052[_0xd56b('0xe8')])){this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x22101a=this['getVariable'][_0xd56b('0xb3')](this,_0x540052[_0xd56b('0xe8')]);if(!_0x22101a){return this['channel']['error'](_0x540052,_0xd56b('0xe9'));}this[_0xd56b('0x38')][_0xd56b('0xa9')](_0x22101a,_0x43bc9d);}this[_0xd56b('0x37')]['sync'](this,_0x540052,_0x43bc9d);return _0x455f46;};AGIVertices[_0xd56b('0x17')][_0xd56b('0xb6')]=function(_0x5d6983){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x169'),_0x5d6983[_0xd56b('0x3a')]));return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0x5d6983[_0xd56b('0x16a')]||_0x5d6983[_0xd56b('0x3a')]);};AGIVertices['prototype']['pause']=function(_0xb7e9c2){logger[_0xd56b('0x30')](util['format'](_0xd56b('0x16b'),_0xb7e9c2['label']));if(!this[_0xd56b('0x91')](_0xb7e9c2[_0xd56b('0x15b')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0xb7e9c2,_0xd56b('0x15c'));}logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x15d'),this[_0xd56b('0x38')]['callerid'],_0xb7e9c2[_0xd56b('0x15b')]));var _0x18276b=this[_0xd56b('0x60')]['sync'](this,_0xb7e9c2[_0xd56b('0x16c')]);var _0x20ac51=this['agentPause'][_0xd56b('0xb3')](this,_0xb7e9c2[_0xd56b('0x15b')],_0x18276b);if(_0x20ac51){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x15e'),this['channel'][_0xd56b('0x3e')],_0xb7e9c2[_0xd56b('0x15b')]));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd56b('0x38')][_0xd56b('0x3e')],_0xb7e9c2[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x15f')};}else{logger[_0xd56b('0x30')](util['format'](_0xd56b('0x160'),this['channel']['callerid'],_0xb7e9c2[_0xd56b('0x15b')]));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd56b('0x38')]['callerid'],_0xb7e9c2['findBy']));return{'code':0xc8,'result':_0xd56b('0x161')};}};AGIVertices[_0xd56b('0x17')][_0xd56b('0x16d')]=function(_0x3aea37){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x16e'),_0x3aea37[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x3aea37['file_id'])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x3aea37,_0xd56b('0x113'));}var _0x2f9adb=this[_0xd56b('0x114')][_0xd56b('0xb3')](this,_0x3aea37[_0xd56b('0x112')]);if(!_0x2f9adb){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x3aea37,_0xd56b('0x16f'));}var _0x58e6c1=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0xd56b('0x170'),[_0x2f9adb,_0x3aea37[_0xd56b('0xf2')]]);if(_0x58e6c1[_0xd56b('0xb0')]===-0x1){return _0x58e6c1;}return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0xd5'),_0xd56b('0x170'),_0x2f9adb));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x171')]=function(_0x49cbc4){logger['info'](util['format'](_0xd56b('0x172'),_0x49cbc4['label']));if(!this[_0xd56b('0x91')](_0x49cbc4[_0xd56b('0x173')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x49cbc4,_0xd56b('0x174'));}var _0x27c2d1='';var _0x31cf82=parseInt(_0x49cbc4[_0xd56b('0x173')],0xa);if(isNaN(_0x31cf82)){_0x27c2d1=_0x49cbc4['queue_id'];}else{_0x27c2d1=this[_0xd56b('0x18')][_0xd56b('0xb3')](this,_0x49cbc4[_0xd56b('0x173')]);if(!_0x27c2d1){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x49cbc4,_0xd56b('0x175'));}}var _0x2e0900='';if(this[_0xd56b('0x91')](_0x49cbc4[_0xd56b('0x112')])){var _0x2d56bf=this[_0xd56b('0x114')]['sync'](this,_0x49cbc4[_0xd56b('0x112')]);if(_0x2d56bf){_0x2e0900=_0x2d56bf;}}this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x49cbc4,_0x27c2d1);if(_0x49cbc4[_0xd56b('0xf2')][_0xd56b('0x176')]('x')<0x0){_0x49cbc4[_0xd56b('0xf2')]+='x';}if(_0x49cbc4[_0xd56b('0xf2')][_0xd56b('0x176')]('X')<0x0){_0x49cbc4['opts']+='X';}this[_0xd56b('0x38')][_0xd56b('0xa9')](_0xd56b('0x177'),_0x27c2d1?_0x27c2d1[_0xd56b('0x178')]():'');var _0x9dbf7=this[_0xd56b('0x38')]['exec']('QUEUE',[_0x27c2d1,_0x49cbc4[_0xd56b('0xf2')],_0x49cbc4[_0xd56b('0x76')],_0x2e0900,_0x49cbc4[_0xd56b('0x79')],_0x49cbc4[_0xd56b('0x7')],_0x49cbc4[_0xd56b('0x179')],_0x49cbc4[_0xd56b('0x17a')],'',_0x49cbc4['position']]);if(_0x9dbf7[_0xd56b('0xb0')]===-0x1){return _0x9dbf7;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0xd5'),'QUEUE',_0x27c2d1));};AGIVertices['prototype'][_0xd56b('0x17b')]=function(_0x21237c){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x17c'),_0x21237c['label']));var _0x476190=_0x21237c['recordingFormat']||_0xd56b('0x13d');var _0x49f4fe=util[_0xd56b('0x2b')](_0xd56b('0x17d'),this[_0xd56b('0x38')][_0xd56b('0x39')],rs[_0xd56b('0x11a')](0x5));var _0x5f1586=util[_0xd56b('0x2b')](_0xd56b('0x17e'),FILES_PATH,_0x49f4fe,_0x476190);var _0x354eca=util['format'](_0xd56b('0x133'),FILES_PATH,_0x49f4fe);this[_0xd56b('0x3d')]['sync'](this,_0x21237c,_0x49f4fe,_0x5f1586);this[_0xd56b('0x38')][_0xd56b('0xa9')](_0xd56b('0x17f'),_0x49f4fe);logger[_0xd56b('0x30')](_0xd56b('0x180'),_0x354eca,_0x476190,_0x21237c[_0xd56b('0x181')],_0x21237c[_0xd56b('0x79')]);return this[_0xd56b('0x38')][_0xd56b('0x13f')](_0x354eca,_0x476190,_0x21237c[_0xd56b('0x181')],_0x21237c[_0xd56b('0x79')],undefined,!![]);};AGIVertices[_0xd56b('0x17')][_0xd56b('0x182')]=function(_0x437015){logger['info'](util['format'](_0xd56b('0x183'),_0x437015[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x437015['url'])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x184'));}var _0x446a82=this[_0xd56b('0x75')][_0xd56b('0xb3')](this,_0x437015);logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x185'),util['inspect'](_0x446a82,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x437015[_0xd56b('0xe8')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x5a3254=this[_0xd56b('0x12')]['sync'](this,_0x437015[_0xd56b('0xe8')]);if(!_0x5a3254){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x437015,_0xd56b('0xe9'));}this[_0xd56b('0x38')]['setVariable'](util['format'](_0xd56b('0x186'),_0x5a3254),_0x446a82[_0xd56b('0x84')]?_0x446a82['statusCode']:_0xd56b('0x187'));this['channel'][_0xd56b('0xa9')](util[_0xd56b('0x2b')](_0xd56b('0x188'),_0x5a3254),_0x446a82[_0xd56b('0x85')]?_0x446a82['statusMessage']:'OK');if(_0x446a82[_0xd56b('0x7c')]){try{this[_0xd56b('0xa7')](_0x446a82[_0xd56b('0x7c')],_0x5a3254);}catch(_0x1676a2){logger[_0xd56b('0x2e')](util[_0xd56b('0x2b')](_0xd56b('0x189'),_0x5a3254));}}return this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0xed'),_0x5a3254));};AGIVertices[_0xd56b('0x17')]['saydigits']=function(_0x334bb6){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x18a'),_0x334bb6[_0xd56b('0x3a')]));return this[_0xd56b('0x38')]['sayDigits'](_0x334bb6[_0xd56b('0x18b')][_0xd56b('0x69')](/\s+/g,''),_0x334bb6[_0xd56b('0x181')]);};AGIVertices[_0xd56b('0x17')][_0xd56b('0x18c')]=function(_0x2691e8){logger['info'](util[_0xd56b('0x2b')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2691e8[_0xd56b('0x3a')]));return this[_0xd56b('0x38')][_0xd56b('0x18d')](_0x2691e8[_0xd56b('0x78')][_0xd56b('0x69')](/\s+/g,''),_0x2691e8[_0xd56b('0x181')]);};AGIVertices['prototype'][_0xd56b('0x18e')]=function(_0x4ea05d){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x4ea05d[_0xd56b('0x3a')]));return this[_0xd56b('0x38')][_0xd56b('0x18f')](_0x4ea05d['text'],_0x4ea05d['escape_digits']);};AGIVertices[_0xd56b('0x17')]['sendMail']=function(_0x128817){logger[_0xd56b('0x30')](util['format'](_0xd56b('0x190'),_0x128817['label']));if(!this[_0xd56b('0x91')](_0x128817['account_id'])){return this[_0xd56b('0x38')]['noop'](_0xd56b('0x191'));}var _0x3861c5=this[_0xd56b('0x25')][_0xd56b('0xb3')](this,_0x128817[_0xd56b('0x192')]);if(!_0x3861c5||!_0x3861c5[_0xd56b('0x193')]){return this[_0xd56b('0x38')]['error'](_0x128817,_0xd56b('0x194'));}var _0x56db29={'from':util[_0xd56b('0x2b')](_0xd56b('0x195'),_0x3861c5[_0xd56b('0x15')],_0x3861c5[_0xd56b('0x196')]||_0x3861c5['Smtp']['user']),'to':_0x128817['to']||'','cc':_0x128817['cc']||'','bcc':_0x128817[_0xd56b('0x197')]||'','subject':_0x128817[_0xd56b('0x198')],'html':_0x128817[_0xd56b('0x6c')],'text':_0x128817[_0xd56b('0x6c')]};var _0x403120={'tls':{'rejectUnauthorized':![]}};if(_0x3861c5[_0xd56b('0x193')][_0xd56b('0x199')]){_0x403120['service']=_0x3861c5[_0xd56b('0x193')]['service'];}else{_0x403120['host']=_0x3861c5[_0xd56b('0x193')][_0xd56b('0x19a')];_0x403120['port']=_0x3861c5['Smtp'][_0xd56b('0x19b')];_0x403120[_0xd56b('0x19c')]=_0x3861c5[_0xd56b('0x193')][_0xd56b('0x19c')];}if(_0x3861c5[_0xd56b('0x193')]['authentication']){_0x403120[_0xd56b('0x19d')]={'user':_0x3861c5['Smtp']['user'],'pass':_0x3861c5[_0xd56b('0x193')][_0xd56b('0x19e')]};}if(this[_0xd56b('0x91')](_0x128817[_0xd56b('0x19f')])){}logger['debug'](_0xd56b('0x1a0'),JSON['stringify'](_0x56db29));this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x128817,_0x128817[_0xd56b('0x192')]);this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3861c5['name']));this[_0xd56b('0x26')][_0xd56b('0xb3')](this,_0x403120,_0x56db29);return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x1a1'));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x1a2')]=function(_0xd41bb5){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x1a3'),_0xd41bb5[_0xd56b('0x3a')]));return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x1a4'));};AGIVertices[_0xd56b('0x17')]['sendSMS']=function(_0x8e407c){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x1a5'),_0x8e407c[_0xd56b('0x3a')]));if(!this['isConfigured'](_0x8e407c[_0xd56b('0x1a6')])){return this['channel'][_0xd56b('0xb6')](_0xd56b('0x1a7'));}var _0x38274a=this[_0xd56b('0x35')][_0xd56b('0xb3')](this,_0x8e407c[_0xd56b('0x1a6')]);if(!_0x38274a){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x8e407c,_0xd56b('0x1a8'));}var _0x3c7144={'body':_0x8e407c[_0xd56b('0x1a9')],'phone':_0x8e407c['to']||'','SmsAccountId':_0x38274a['id']};logger['debug'](_0xd56b('0x1aa'),JSON[_0xd56b('0x83')](_0x3c7144));this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x8e407c,_0x8e407c[_0xd56b('0x1a6')]);this[_0xd56b('0x38')]['noop'](util[_0xd56b('0x2b')](_0xd56b('0x1ab'),_0x38274a[_0xd56b('0x15')]));this[_0xd56b('0x1ac')]['sync'](this,_0x3c7144);return this[_0xd56b('0x38')]['noop'](_0xd56b('0x1ad'));};AGIVertices['prototype'][_0xd56b('0x1ae')]=function(_0x451006){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x1af'),_0x451006[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x451006[_0xd56b('0xe8')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x451006,_0xd56b('0x1b0'));}var _0xa32b95=this[_0xd56b('0x12')]['sync'](this,_0x451006[_0xd56b('0xe8')]);if(!_0xa32b95){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x451006,'no\x20variable\x20found');}return this['channel'][_0xd56b('0xa9')](_0xa32b95,_0x451006['variable_value']);};AGIVertices['prototype']['start']=function(_0x2101b4){logger[_0xd56b('0x30')](util['format'](_0xd56b('0x1b1'),_0x2101b4['label']));this[_0xd56b('0x38')][_0xd56b('0xb6')]('START\x20CALLY\x20SQUARE');if(_0x2101b4[_0xd56b('0xc7')]===_0xd56b('0x1b2')){this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0x1b3'));return this[_0xd56b('0x38')]['answer']();}return this['channel'][_0xd56b('0xb6')](_0xd56b('0x1b4'));};AGIVertices[_0xd56b('0x17')]['subproject']=function(_0x1e3e7b){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x1b5'),_0x1e3e7b[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x1e3e7b[_0xd56b('0x1b6')])){return this['channel']['error'](_0x1e3e7b,_0xd56b('0x1b7'));}var _0x3d86c6=this[_0xd56b('0x19')][_0xd56b('0xb3')](this,_0x1e3e7b[_0xd56b('0x1b6')]);if(!this['isConfigured'](_0x3d86c6)){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x1e3e7b,util[_0xd56b('0x2b')](_0xd56b('0x1b8'),_0x1e3e7b['project_id']));}if(_0x3d86c6===this[_0xd56b('0x38')][_0xd56b('0x3c')]){return this['channel']['error'](_0x1e3e7b,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xd56b('0x37')][_0xd56b('0xb3')](this,_0x1e3e7b,_0x3d86c6);var _0x512b36=this['channel'][_0xd56b('0xb7')](_0xd56b('0x1b9'),util[_0xd56b('0x2b')](_0xd56b('0x1ba'),config[_0xd56b('0x7')][_0xd56b('0x19a')]||_0xd56b('0x1bb'),_0x3d86c6,this[_0xd56b('0x38')][_0xd56b('0x3c')]));if(_0x512b36['result']===-0x1){return _0x512b36;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util['format'](_0xd56b('0xd5'),_0xd56b('0x1b9'),_0x3d86c6));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x1bc')]=function(_0x5bf39a){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x5bf39a[_0xd56b('0x3a')]));var _0x454385=this[_0xd56b('0x68')]['sync'](this,_0x5bf39a[_0xd56b('0x1bd')]);this[_0xd56b('0x37')]['sync'](this,_0x5bf39a,_0x5bf39a[_0xd56b('0x1bd')]);if(this[_0xd56b('0x91')](_0x5bf39a[_0xd56b('0xe8')])){var _0x42ab80=this[_0xd56b('0x12')][_0xd56b('0xb3')](this,_0x5bf39a[_0xd56b('0xe8')]);if(_0x42ab80){this[_0xd56b('0x38')][_0xd56b('0xa9')](_0x42ab80,_0x454385);return this['channel']['noop'](util[_0xd56b('0x2b')](_0xd56b('0x1be'),_0x5bf39a[_0xd56b('0x1bd')],_0x42ab80));}}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x5bf39a['command']));};AGIVertices['prototype'][_0xd56b('0x1bf')]=function(_0x1e2b4d){logger[_0xd56b('0x30')](util['format'](_0xd56b('0x1c0'),_0x1e2b4d[_0xd56b('0x3a')]));_0x1e2b4d['text']=_0x1e2b4d[_0xd56b('0x6c')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd56b('0x91')](_0x1e2b4d[_0xd56b('0x6b')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')]('no\x20apiKey\x20configured');}if(!this[_0xd56b('0x91')](_0x1e2b4d[_0xd56b('0x6c')])){return this['channel']['noop'](_0xd56b('0xd8'));}this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x1c1'),_0x1e2b4d['text']));var _0x2db784=this['googleCloudTTS'][_0xd56b('0xb3')](this,_0x1e2b4d);if(_0x2db784){this['channel']['noop'](util[_0xd56b('0x2b')](_0xd56b('0x1c2'),_0x2db784));var _0x22c1ca=this['channel']['streamFile'](_0x2db784);try{fs[_0xd56b('0x102')](_0x2db784+_0xd56b('0x103'));}catch(_0x195312){logger[_0xd56b('0x2e')](_0x195312);}return _0x22c1ca;}return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x1e2b4d,_0xd56b('0x1c3'));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x1c4')]=function(_0x249aae){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x1c5'),_0x249aae[_0xd56b('0x3a')]));_0x249aae[_0xd56b('0x6c')]=_0x249aae[_0xd56b('0x6c')][_0xd56b('0x69')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd56b('0x91')](_0x249aae[_0xd56b('0x6c')])){return this[_0xd56b('0x38')][_0xd56b('0xb6')](_0xd56b('0xd8'));}this['channel'][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('Trying\x20Google\x20TTS\x20%s',_0x249aae['text']));var _0x36bfdf=this['googleTTS']['sync'](this,_0x249aae);if(_0x36bfdf){this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x1c6'),_0x36bfdf));var _0x1a56e1=this[_0xd56b('0x38')][_0xd56b('0x126')](_0x36bfdf);try{fs[_0xd56b('0x102')](_0x36bfdf+'.wav');}catch(_0x48390f){logger[_0xd56b('0x2e')](_0x48390f);}return _0x1a56e1;}return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x249aae,_0xd56b('0x1c7'));};AGIVertices[_0xd56b('0x17')]['unpause']=function(_0x2aac15){logger[_0xd56b('0x30')](util['format'](_0xd56b('0x1c8'),_0x2aac15[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x2aac15[_0xd56b('0x15b')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x2aac15,_0xd56b('0x15c'));}logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x15d'),this['channel'][_0xd56b('0x3e')],_0x2aac15[_0xd56b('0x15b')]));var _0xbbff75=this[_0xd56b('0x64')][_0xd56b('0xb3')](this,_0x2aac15[_0xd56b('0x15b')]);if(_0xbbff75){logger[_0xd56b('0x30')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd56b('0x38')]['callerid'],_0x2aac15['findBy']));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd56b('0x38')][_0xd56b('0x3e')],_0x2aac15[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x15f')};}else{logger[_0xd56b('0x30')](util[_0xd56b('0x2b')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd56b('0x38')]['callerid'],_0x2aac15[_0xd56b('0x15b')]));this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0x160'),this[_0xd56b('0x38')]['callerid'],_0x2aac15[_0xd56b('0x15b')]));return{'code':0xc8,'result':_0xd56b('0x161')};}};AGIVertices['prototype']['voicemail']=function(_0x4157f1){logger['info'](util[_0xd56b('0x2b')](_0xd56b('0x1c9'),_0x4157f1[_0xd56b('0x3a')]));var _0x5afb79=this[_0xd56b('0x38')][_0xd56b('0xb7')](_0xd56b('0x1ca'),[_0x4157f1['mailbox'],_0x4157f1[_0xd56b('0x88')]]);if(_0x5afb79[_0xd56b('0xb0')]===-0x1){return _0x5afb79;}return this[_0xd56b('0x38')][_0xd56b('0xb6')](util[_0xd56b('0x2b')](_0xd56b('0xd5'),_0xd56b('0x1ca'),_0x4157f1['mailbox']));};AGIVertices[_0xd56b('0x17')][_0xd56b('0x1cb')]=function(_0x46d8c7){logger[_0xd56b('0x30')](util[_0xd56b('0x2b')](_0xd56b('0x1cc'),_0x46d8c7[_0xd56b('0x3a')]));if(!this[_0xd56b('0x91')](_0x46d8c7[_0xd56b('0xe8')])){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x46d8c7,'no\x20variable\x20selected');}var _0x3b928b=this[_0xd56b('0x12')]['sync'](this,_0x46d8c7[_0xd56b('0xe8')]);if(!_0x3b928b){return this[_0xd56b('0x38')][_0xd56b('0x2e')](_0x46d8c7,_0xd56b('0xe9'));}var _0x2be79c=this[_0xd56b('0x38')]['getVariable'](_0x3b928b);return{'code':0xc8,'result':_0x2be79c[_0xd56b('0xac')]?_0x2be79c[_0xd56b('0xac')]:'-'};};String[_0xd56b('0x17')][_0xd56b('0x1cd')]=function(_0x1befcc,_0xdf15d6){return this[_0xd56b('0xaa')](_0x1befcc)['join'](_0xdf15d6);};module[_0xd56b('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index a3b8d2e..18aa63f 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 _0xee14=['diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','lastPauseAt','update','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','startAcw','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds'];(function(_0x459ee0,_0x1e950d){var _0x1b87c8=function(_0x377855){while(--_0x377855){_0x459ee0['push'](_0x459ee0['shift']());}};_0x1b87c8(++_0x1e950d);}(_0xee14,0x13a));var _0x4ee1=function(_0x40a478,_0xf749c8){_0x40a478=_0x40a478-0x0;var _0x20dba6=_0xee14[_0x40a478];return _0x20dba6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x4ee1('0x0'));var ami=require(_0x4ee1('0x1'));var logger=require(_0x4ee1('0x2'))(_0x4ee1('0x3'));var RpcUser=require(_0x4ee1('0x4'));var RpcVoiceAgentReport=require(_0x4ee1('0x5'));function Acw(_0x34a0ae){this[_0x4ee1('0x6')]=_0x34a0ae[_0x4ee1('0x6')];this['agents']=_0x34a0ae[_0x4ee1('0x7')];this['timers']=_0x34a0ae[_0x4ee1('0x8')];this[_0x4ee1('0x9')]={};ami['on'](_0x4ee1('0xa'),this[_0x4ee1('0xb')][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0xd'),this['syncHangupRequest'][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0xe'),this['syncHangup'][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0xf'),this[_0x4ee1('0x10')][_0x4ee1('0xc')](this));ami['on']('attendedtransfer',this[_0x4ee1('0x11')][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0x12'),this[_0x4ee1('0x13')][_0x4ee1('0xc')](this));ami['on'](_0x4ee1('0x14'),this['syncAgentConnectPreview'][_0x4ee1('0xc')](this));}function getDiff(_0x461f99){var _0x1096a5=moment()[_0x4ee1('0x15')](0x0);var _0x46d2c2=moment(_0x461f99)[_0x4ee1('0x15')](0x0);return _0x1096a5[_0x4ee1('0x16')](_0x46d2c2,_0x4ee1('0x17'));}Acw[_0x4ee1('0x18')]['startAcw']=function(_0x2f9194){try{var _0x38008f=this;var _0x34651b=this[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x19')];var _0x38fc33=this[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x1a')];var _0x360056=this[_0x4ee1('0x6')][_0x38fc33];var _0x274de5=![];var _0x5d76de=_0x4ee1('0x1b');if(_0x360056[_0x4ee1('0x1c')]){if(_0x360056[_0x4ee1('0x1d')][_0x4ee1('0x1e')]){_0x274de5=!![];_0x5d76de=_0x360056[_0x4ee1('0x1d')][_0x4ee1('0x1e')];}}ami['Action']({'action':_0x4ee1('0x1f'),'interface':_0x34651b,'paused':!![],'reason':_0x5d76de})[_0x4ee1('0x20')](function(_0x46611a){if(_0x38008f[_0x4ee1('0x7')][_0x34651b]){return RpcUser[_0x4ee1('0x21')](_0x38008f[_0x4ee1('0x7')][_0x34651b]['id'])[_0x4ee1('0x20')](function(_0x40fd98){if(_0x40fd98&&!_0x40fd98[_0x4ee1('0x22')]){logger[_0x4ee1('0x23')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x2f9194,_0x34651b,_0x38fc33);var _0x53d43f=_0x38008f[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x24')]&&_0x38008f[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x25')]?_0x38008f[_0x4ee1('0x9')][_0x2f9194][_0x4ee1('0x25')]:_0x2f9194;return RpcUser['savePause'](_0x38008f['agents'][_0x34651b],_0x5d76de,_0x53d43f)[_0x4ee1('0x20')](function(_0x28b7e1){if(!_0x274de5){_0x38008f['timers'][_0x34651b]={};logger[_0x4ee1('0x23')](_0x4ee1('0x26'),_0x2f9194,_0x38008f[_0x4ee1('0x6')][_0x38fc33][_0x4ee1('0x27')],_0x34651b,_0x38fc33);_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x28')]=setTimeout(_0x38008f[_0x4ee1('0x29')]['bind'](_0x38008f,_0x34651b),_0x38008f[_0x4ee1('0x6')][_0x38fc33]['acwTimeout']*0x3e8);_0x38008f[_0x4ee1('0x8')][_0x34651b]['lastPauseAt']=moment()[_0x4ee1('0x2a')](_0x4ee1('0x2b'));_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x2c')]=_0x2f9194;_0x38008f[_0x4ee1('0x8')][_0x34651b]['queue']=_0x38fc33;_0x38008f[_0x4ee1('0x8')][_0x34651b]['updateAcw']=function(){var _0x121301=getDiff(_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x2d')]);clearTimeout(_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x28')]);_0x38008f['timers'][_0x34651b][_0x4ee1('0x28')]=![];RpcVoiceAgentReport[_0x4ee1('0x2e')]({'acwtime':_0x121301},_0x38008f[_0x4ee1('0x8')][_0x34651b][_0x4ee1('0x2c')],_0x34651b)[_0x4ee1('0x20')](function(_0x393990){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x2f9194,_0x121301,_0x393990);})[_0x4ee1('0x2f')](function(_0x54482b){logger[_0x4ee1('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x2f9194,_0x54482b);});delete _0x38008f[_0x4ee1('0x8')][_0x34651b];};}});}else{logger[_0x4ee1('0x23')](_0x4ee1('0x31'),_0x2f9194,_0x34651b,_0x38fc33);}});}})[_0x4ee1('0x2f')](function(_0x9f882d){logger[_0x4ee1('0x30')](_0x4ee1('0x26'),_0x2f9194,_0x38008f[_0x4ee1('0x6')][_0x38fc33][_0x4ee1('0x27')],_0x34651b,_0x38fc33);})[_0x4ee1('0x32')](function(){delete _0x38008f[_0x4ee1('0x9')][_0x2f9194];});}catch(_0x1f3371){logger[_0x4ee1('0x30')]('[ACW][START]\x20%s',_0x1f3371[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x29')]=function(_0x50539f){try{var _0x4858f9=this;if(_0x4858f9[_0x4ee1('0x8')][_0x50539f]){_0x4858f9[_0x4ee1('0x8')][_0x50539f][_0x4ee1('0x28')]=![];var _0x1f2b4b=_0x4858f9['timers'][_0x50539f][_0x4ee1('0x2c')];var _0x2ed16f=_0x4858f9[_0x4ee1('0x8')][_0x50539f][_0x4ee1('0x1a')];var _0x2653c4=_0x4858f9[_0x4ee1('0x6')][_0x2ed16f][_0x4ee1('0x27')];logger[_0x4ee1('0x23')]('[TIMER][STOP][AGENT:%s]',_0x50539f);RpcUser[_0x4ee1('0x34')](this[_0x4ee1('0x7')][_0x50539f]);RpcVoiceAgentReport[_0x4ee1('0x2e')]({'acwtime':_0x2653c4,'agentacw':!![]},_0x1f2b4b,_0x50539f)[_0x4ee1('0x20')](function(_0x45bb22){logger[_0x4ee1('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x1f2b4b,_0x2653c4,_0x45bb22);})[_0x4ee1('0x2f')](function(_0x37176a){logger[_0x4ee1('0x30')](_0x4ee1('0x35'),_0x1f2b4b,_0x37176a);});}else{logger[_0x4ee1('0x30')](_0x4ee1('0x36'),_0x50539f);if(_0x4858f9[_0x4ee1('0x8')]){logger[_0x4ee1('0x23')](_0x4ee1('0x37'),JSON[_0x4ee1('0x38')](_0x4858f9[_0x4ee1('0x8')]));}}}catch(_0x46bf93){logger[_0x4ee1('0x30')]('[ACW][STOP]\x20%s',_0x46bf93[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')]['syncAgentConnect']=function(_0x3c759f){try{if(this['voiceQueues'][_0x3c759f[_0x4ee1('0x1a')]]&&(this['voiceQueues'][_0x3c759f[_0x4ee1('0x1a')]][_0x4ee1('0x3')]||this['voiceQueues'][_0x3c759f[_0x4ee1('0x1a')]][_0x4ee1('0x1c')])){if(this[_0x4ee1('0x7')][_0x3c759f[_0x4ee1('0x19')]]){this['channels'][_0x3c759f[_0x4ee1('0x2c')]]={'queue':_0x3c759f[_0x4ee1('0x1a')],'interface':_0x3c759f[_0x4ee1('0x19')],'destlinkedid':_0x3c759f['destlinkedid']};}}}catch(_0x4fbe92){logger[_0x4ee1('0x30')](_0x4ee1('0x39'),_0x4fbe92[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x3a')]=function(_0x4ebcca){try{if(this['voiceQueues'][_0x4ebcca[_0x4ee1('0x1a')]]&&(this[_0x4ee1('0x6')][_0x4ebcca[_0x4ee1('0x1a')]][_0x4ee1('0x3')]||this['voiceQueues'][_0x4ebcca[_0x4ee1('0x1a')]][_0x4ee1('0x1c')])){if(this['agents'][_0x4ebcca[_0x4ee1('0x19')]]){this[_0x4ee1('0x9')][_0x4ebcca[_0x4ee1('0x2c')]]={'queue':_0x4ebcca[_0x4ee1('0x1a')],'interface':_0x4ebcca[_0x4ee1('0x19')]};}}}catch(_0x154ec0){logger[_0x4ee1('0x30')](_0x4ee1('0x3b'),_0x154ec0[_0x4ee1('0x33')]);}};Acw['prototype']['syncHangupRequest']=function(_0x1a972b){try{if(this[_0x4ee1('0x9')][_0x1a972b[_0x4ee1('0x2c')]]&&_[_0x4ee1('0x3c')](this['channels'][_0x1a972b[_0x4ee1('0x2c')]][_0x4ee1('0x24')])){logger[_0x4ee1('0x23')](_0x4ee1('0x3d'),_0x1a972b[_0x4ee1('0x2c')]);this['startAcw'](_0x1a972b[_0x4ee1('0x2c')]);}else if(this[_0x4ee1('0x9')][_0x1a972b[_0x4ee1('0x3e')]]&&_['isUndefined'](this[_0x4ee1('0x9')][_0x1a972b['linkedid']][_0x4ee1('0x24')])){logger['info'](_0x4ee1('0x3f'),_0x1a972b['linkedid']);this[_0x4ee1('0x40')](_0x1a972b['linkedid']);}}catch(_0x58919){logger[_0x4ee1('0x30')](_0x4ee1('0x41'),_0x58919['message']);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x42')]=function(_0xcdb873){try{if(this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x2c')]]&&this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x2c')]]['attended']){logger['info'](_0x4ee1('0x43'),_0xcdb873[_0x4ee1('0x2c')]);this[_0x4ee1('0x40')](_0xcdb873[_0x4ee1('0x2c')]);}else if(this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x3e')]]&&this[_0x4ee1('0x9')][_0xcdb873[_0x4ee1('0x3e')]][_0x4ee1('0x24')]){logger[_0x4ee1('0x23')](_0x4ee1('0x44'),_0xcdb873[_0x4ee1('0x3e')]);this[_0x4ee1('0x40')](_0xcdb873['linkedid']);}}catch(_0x1bafa8){logger['error'](_0x4ee1('0x45'),_0x1bafa8[_0x4ee1('0x33')]);}};Acw['prototype'][_0x4ee1('0x11')]=function(_0x184e36){try{if(!_['isNil'](this['channels'][_0x184e36[_0x4ee1('0x46')]])){this['startAcw'](_0x184e36[_0x4ee1('0x46')]);if(this[_0x4ee1('0x9')][_0x184e36['secondtransfereruniqueid']]){this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x47')]][_0x4ee1('0x24')]=!![];this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x48')]]=this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x47')]];delete this['channels'][_0x184e36['secondtransfereruniqueid']];}}else if(!_[_0x4ee1('0x49')](this[_0x4ee1('0x9')][_0x184e36['transfertargetuniqueid']])){this[_0x4ee1('0x40')](_0x184e36[_0x4ee1('0x48')]);if(this[_0x4ee1('0x9')][_0x184e36['origtransfereruniqueid']]){this[_0x4ee1('0x9')][_0x184e36['origtransfereruniqueid']][_0x4ee1('0x24')]=!![];this['channels'][_0x184e36['transfereeuniqueid']]=this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x4a')]];delete this[_0x4ee1('0x9')][_0x184e36[_0x4ee1('0x4a')]];}}}catch(_0x38e889){logger['error'](_0x4ee1('0x4b'),_0x38e889[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')]['syncBlindTransfer']=function(_0x368e82){try{if(this[_0x4ee1('0x9')][_0x368e82[_0x4ee1('0x4c')]]){logger[_0x4ee1('0x23')](_0x4ee1('0x4d'),JSON[_0x4ee1('0x38')](_0x368e82[_0x4ee1('0x4c')]));this[_0x4ee1('0x40')](_0x368e82[_0x4ee1('0x4c')]);}else if(this[_0x4ee1('0x9')][_0x368e82[_0x4ee1('0x4e')]]){logger[_0x4ee1('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x4ee1('0x38')](_0x368e82['transfererlinkedid']));this[_0x4ee1('0x40')](_0x368e82['transfererlinkedid']);}}catch(_0x15834b){logger[_0x4ee1('0x30')](_0x4ee1('0x4f'),_0x15834b[_0x4ee1('0x33')]);}};Acw[_0x4ee1('0x18')][_0x4ee1('0x10')]=function(_0x342aa1){try{if(this[_0x4ee1('0x6')][_0x342aa1[_0x4ee1('0x1a')]]&&this[_0x4ee1('0x6')][_0x342aa1[_0x4ee1('0x1a')]][_0x4ee1('0x50')]==='all'){if(this[_0x4ee1('0x7')][_0x342aa1[_0x4ee1('0x19')]]){logger[_0x4ee1('0x23')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x342aa1['uniqueid'],_0x342aa1[_0x4ee1('0x19')],_0x342aa1[_0x4ee1('0x1a')]);return RpcUser['savePause'](this[_0x4ee1('0x7')][_0x342aa1[_0x4ee1('0x19')]],_0x4ee1('0x51'),_0x342aa1[_0x4ee1('0x2c')]);}}}catch(_0x42240f){logger[_0x4ee1('0x30')](_0x4ee1('0x52'),_0x42240f[_0x4ee1('0x33')]);}};module[_0x4ee1('0x53')]=Acw; \ No newline at end of file +var _0xf3cd=['../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','timer','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','message','stopAcw','[TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami'];(function(_0xdc356f,_0x3003d0){var _0x339eaa=function(_0xc2283e){while(--_0xc2283e){_0xdc356f['push'](_0xdc356f['shift']());}};_0x339eaa(++_0x3003d0);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0xf3cd[_0x24b477];return _0x4041a6;};'use strict';var util=require(_0xdf3c('0x0'));var _=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var ami=require(_0xdf3c('0x3'));var logger=require(_0xdf3c('0x4'))(_0xdf3c('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xdf3c('0x6'));function Acw(_0x71b446){this[_0xdf3c('0x7')]=_0x71b446['voiceQueues'];this[_0xdf3c('0x8')]=_0x71b446[_0xdf3c('0x8')];this[_0xdf3c('0x9')]=_0x71b446[_0xdf3c('0x9')];this[_0xdf3c('0xa')]={};ami['on'](_0xdf3c('0xb'),this['syncAgentConnect'][_0xdf3c('0xc')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xdf3c('0xc')](this));ami['on'](_0xdf3c('0xd'),this['syncHangup'][_0xdf3c('0xc')](this));ami['on'](_0xdf3c('0xe'),this[_0xdf3c('0xf')][_0xdf3c('0xc')](this));ami['on'](_0xdf3c('0x10'),this[_0xdf3c('0x11')][_0xdf3c('0xc')](this));ami['on'](_0xdf3c('0x12'),this['syncBlindTransfer'][_0xdf3c('0xc')](this));ami['on'](_0xdf3c('0x13'),this[_0xdf3c('0x14')][_0xdf3c('0xc')](this));}function getDiff(_0x59e431){var _0x2ae4ad=moment()[_0xdf3c('0x15')](0x0);var _0x13ea5f=moment(_0x59e431)['milliseconds'](0x0);return _0x2ae4ad[_0xdf3c('0x16')](_0x13ea5f,_0xdf3c('0x17'));}Acw[_0xdf3c('0x18')][_0xdf3c('0x19')]=function(_0x21e587){try{var _0x1a7a5a=this;var _0x305ea5=this[_0xdf3c('0xa')][_0x21e587][_0xdf3c('0x1a')];var _0x5d3991=this['channels'][_0x21e587][_0xdf3c('0x1b')];var _0x465e7d=this[_0xdf3c('0x7')][_0x5d3991];var _0x18d4ec=![];var _0x1e2690=_0xdf3c('0x1c');if(_0x465e7d[_0xdf3c('0x1d')]){if(_0x465e7d[_0xdf3c('0x1e')][_0xdf3c('0x1f')]){_0x18d4ec=!![];_0x1e2690=_0x465e7d[_0xdf3c('0x1e')][_0xdf3c('0x1f')];}}ami[_0xdf3c('0x20')]({'action':_0xdf3c('0x21'),'interface':_0x305ea5,'paused':!![],'reason':_0x1e2690})['then'](function(_0x4d620f){if(_0x1a7a5a[_0xdf3c('0x8')][_0x305ea5]){return RpcUser['getAgent'](_0x1a7a5a[_0xdf3c('0x8')][_0x305ea5]['id'])[_0xdf3c('0x22')](function(_0x36552e){if(_0x36552e&&!_0x36552e[_0xdf3c('0x23')]){logger[_0xdf3c('0x24')](_0xdf3c('0x25'),_0x21e587,_0x305ea5,_0x5d3991);var _0x50d8ca=_0x1a7a5a[_0xdf3c('0xa')][_0x21e587][_0xdf3c('0x26')]&&_0x1a7a5a[_0xdf3c('0xa')][_0x21e587][_0xdf3c('0x27')]?_0x1a7a5a[_0xdf3c('0xa')][_0x21e587][_0xdf3c('0x27')]:_0x21e587;return RpcUser[_0xdf3c('0x28')](_0x1a7a5a[_0xdf3c('0x8')][_0x305ea5],_0x1e2690,_0x50d8ca)[_0xdf3c('0x22')](function(_0x1adee4){if(!_0x18d4ec){_0x1a7a5a['timers'][_0x305ea5]={};logger[_0xdf3c('0x24')](_0xdf3c('0x29'),_0x21e587,_0x1a7a5a['voiceQueues'][_0x5d3991][_0xdf3c('0x2a')],_0x305ea5,_0x5d3991);_0x1a7a5a['timers'][_0x305ea5]['timer']=setTimeout(_0x1a7a5a['stopAcw'][_0xdf3c('0xc')](_0x1a7a5a,_0x305ea5),_0x1a7a5a[_0xdf3c('0x7')][_0x5d3991]['acwTimeout']*0x3e8);_0x1a7a5a['timers'][_0x305ea5][_0xdf3c('0x2b')]=moment()[_0xdf3c('0x2c')](_0xdf3c('0x2d'));_0x1a7a5a[_0xdf3c('0x9')][_0x305ea5]['uniqueid']=_0x21e587;_0x1a7a5a[_0xdf3c('0x9')][_0x305ea5][_0xdf3c('0x1b')]=_0x5d3991;_0x1a7a5a['timers'][_0x305ea5]['updateAcw']=function(){var _0x1f1d8a=getDiff(_0x1a7a5a[_0xdf3c('0x9')][_0x305ea5][_0xdf3c('0x2b')]);clearTimeout(_0x1a7a5a['timers'][_0x305ea5][_0xdf3c('0x2e')]);_0x1a7a5a[_0xdf3c('0x9')][_0x305ea5][_0xdf3c('0x2e')]=![];RpcVoiceAgentReport[_0xdf3c('0x2f')]({'acwtime':_0x1f1d8a},_0x1a7a5a['timers'][_0x305ea5][_0xdf3c('0x30')],_0x305ea5)[_0xdf3c('0x22')](function(_0x522e5f){logger[_0xdf3c('0x24')](_0xdf3c('0x31'),_0x21e587,_0x1f1d8a,_0x522e5f);})[_0xdf3c('0x32')](function(_0x2287f){logger['error'](_0xdf3c('0x33'),_0x21e587,_0x2287f);});delete _0x1a7a5a[_0xdf3c('0x9')][_0x305ea5];};}});}else{logger[_0xdf3c('0x24')](_0xdf3c('0x34'),_0x21e587,_0x305ea5,_0x5d3991);}});}})['catch'](function(_0x474564){logger[_0xdf3c('0x35')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x21e587,_0x1a7a5a['voiceQueues'][_0x5d3991][_0xdf3c('0x2a')],_0x305ea5,_0x5d3991);})['finally'](function(){delete _0x1a7a5a[_0xdf3c('0xa')][_0x21e587];});}catch(_0x5e8130){logger['error']('[ACW][START]\x20%s',_0x5e8130[_0xdf3c('0x36')]);}};Acw[_0xdf3c('0x18')][_0xdf3c('0x37')]=function(_0x29b5b7){try{var _0x54c25f=this;if(_0x54c25f['timers'][_0x29b5b7]){_0x54c25f[_0xdf3c('0x9')][_0x29b5b7]['timer']=![];var _0x46e40f=_0x54c25f[_0xdf3c('0x9')][_0x29b5b7][_0xdf3c('0x30')];var _0xcdd731=_0x54c25f[_0xdf3c('0x9')][_0x29b5b7][_0xdf3c('0x1b')];var _0x1c7335=_0x54c25f[_0xdf3c('0x7')][_0xcdd731][_0xdf3c('0x2a')];logger['info'](_0xdf3c('0x38'),_0x29b5b7);RpcUser['saveUnpause'](this['agents'][_0x29b5b7]);RpcVoiceAgentReport[_0xdf3c('0x2f')]({'acwtime':_0x1c7335,'agentacw':!![]},_0x46e40f,_0x29b5b7)['then'](function(_0xccce51){logger['info'](_0xdf3c('0x31'),_0x46e40f,_0x1c7335,_0xccce51);})[_0xdf3c('0x32')](function(_0x1c6dee){logger[_0xdf3c('0x35')](_0xdf3c('0x33'),_0x46e40f,_0x1c6dee);});}else{logger[_0xdf3c('0x35')](_0xdf3c('0x39'),_0x29b5b7);if(_0x54c25f[_0xdf3c('0x9')]){logger[_0xdf3c('0x24')](_0xdf3c('0x3a'),JSON[_0xdf3c('0x3b')](_0x54c25f[_0xdf3c('0x9')]));}}}catch(_0x57e0ab){logger['error'](_0xdf3c('0x3c'),_0x57e0ab['message']);}};Acw[_0xdf3c('0x18')][_0xdf3c('0x3d')]=function(_0x46194d){try{if(this[_0xdf3c('0x7')][_0x46194d['queue']]&&(this['voiceQueues'][_0x46194d[_0xdf3c('0x1b')]][_0xdf3c('0x5')]||this[_0xdf3c('0x7')][_0x46194d['queue']][_0xdf3c('0x1d')])){if(this[_0xdf3c('0x8')][_0x46194d[_0xdf3c('0x1a')]]){this[_0xdf3c('0xa')][_0x46194d['uniqueid']]={'queue':_0x46194d[_0xdf3c('0x1b')],'interface':_0x46194d[_0xdf3c('0x1a')],'destlinkedid':_0x46194d[_0xdf3c('0x27')]};}}}catch(_0x3f4d7f){logger[_0xdf3c('0x35')]('[ACW][syncAgentConnect]\x20%s',_0x3f4d7f[_0xdf3c('0x36')]);}};Acw[_0xdf3c('0x18')][_0xdf3c('0x14')]=function(_0x2456cf){try{if(this[_0xdf3c('0x7')][_0x2456cf[_0xdf3c('0x1b')]]&&(this['voiceQueues'][_0x2456cf['queue']][_0xdf3c('0x5')]||this[_0xdf3c('0x7')][_0x2456cf['queue']]['mandatoryDisposition'])){if(this[_0xdf3c('0x8')][_0x2456cf[_0xdf3c('0x1a')]]){this[_0xdf3c('0xa')][_0x2456cf[_0xdf3c('0x30')]]={'queue':_0x2456cf[_0xdf3c('0x1b')],'interface':_0x2456cf[_0xdf3c('0x1a')]};}}}catch(_0x466ea1){logger[_0xdf3c('0x35')](_0xdf3c('0x3e'),_0x466ea1['message']);}};Acw[_0xdf3c('0x18')][_0xdf3c('0x3f')]=function(_0x1c293d){try{if(this[_0xdf3c('0xa')][_0x1c293d[_0xdf3c('0x30')]]&&_[_0xdf3c('0x40')](this[_0xdf3c('0xa')][_0x1c293d['uniqueid']][_0xdf3c('0x26')])){logger['info'](_0xdf3c('0x41'),_0x1c293d['uniqueid']);this[_0xdf3c('0x19')](_0x1c293d[_0xdf3c('0x30')]);}else if(this[_0xdf3c('0xa')][_0x1c293d[_0xdf3c('0x42')]]&&_['isUndefined'](this['channels'][_0x1c293d['linkedid']][_0xdf3c('0x26')])){logger['info'](_0xdf3c('0x43'),_0x1c293d[_0xdf3c('0x42')]);this[_0xdf3c('0x19')](_0x1c293d[_0xdf3c('0x42')]);}}catch(_0x3b17d9){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x3b17d9[_0xdf3c('0x36')]);}};Acw[_0xdf3c('0x18')]['syncHangup']=function(_0x3b215d){try{if(this[_0xdf3c('0xa')][_0x3b215d[_0xdf3c('0x30')]]&&this[_0xdf3c('0xa')][_0x3b215d[_0xdf3c('0x30')]][_0xdf3c('0x26')]){logger[_0xdf3c('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3b215d['uniqueid']);this[_0xdf3c('0x19')](_0x3b215d[_0xdf3c('0x30')]);}else if(this[_0xdf3c('0xa')][_0x3b215d[_0xdf3c('0x42')]]&&this[_0xdf3c('0xa')][_0x3b215d[_0xdf3c('0x42')]][_0xdf3c('0x26')]){logger[_0xdf3c('0x24')](_0xdf3c('0x44'),_0x3b215d[_0xdf3c('0x42')]);this[_0xdf3c('0x19')](_0x3b215d['linkedid']);}}catch(_0x1eebcf){logger['error']('[ACW][syncHangup]\x20%s',_0x1eebcf['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0x1afc6c){try{if(!_[_0xdf3c('0x45')](this['channels'][_0x1afc6c[_0xdf3c('0x46')]])){this[_0xdf3c('0x19')](_0x1afc6c['transfereeuniqueid']);if(this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x47')]]){this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x47')]][_0xdf3c('0x26')]=!![];this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x48')]]=this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x47')]];delete this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x47')]];}}else if(!_['isNil'](this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x48')]])){this[_0xdf3c('0x19')](_0x1afc6c['transfertargetuniqueid']);if(this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x49')]]){this[_0xdf3c('0xa')][_0x1afc6c['origtransfereruniqueid']][_0xdf3c('0x26')]=!![];this[_0xdf3c('0xa')][_0x1afc6c['transfereeuniqueid']]=this[_0xdf3c('0xa')][_0x1afc6c['origtransfereruniqueid']];delete this[_0xdf3c('0xa')][_0x1afc6c[_0xdf3c('0x49')]];}}}catch(_0x163adc){logger[_0xdf3c('0x35')](_0xdf3c('0x4a'),_0x163adc[_0xdf3c('0x36')]);}};Acw[_0xdf3c('0x18')][_0xdf3c('0x4b')]=function(_0x2922d8){try{if(this[_0xdf3c('0xa')][_0x2922d8[_0xdf3c('0x4c')]]){logger[_0xdf3c('0x24')](_0xdf3c('0x4d'),JSON[_0xdf3c('0x3b')](_0x2922d8[_0xdf3c('0x4c')]));this[_0xdf3c('0x19')](_0x2922d8[_0xdf3c('0x4c')]);}else if(this['channels'][_0x2922d8['transfererlinkedid']]){logger[_0xdf3c('0x24')](_0xdf3c('0x4e'),JSON[_0xdf3c('0x3b')](_0x2922d8['transfererlinkedid']));this[_0xdf3c('0x19')](_0x2922d8['transfererlinkedid']);}}catch(_0x574852){logger[_0xdf3c('0x35')](_0xdf3c('0x4f'),_0x574852[_0xdf3c('0x36')]);}};Acw[_0xdf3c('0x18')][_0xdf3c('0xf')]=function(_0x9b7034){try{if(this[_0xdf3c('0x7')][_0x9b7034[_0xdf3c('0x1b')]]&&this[_0xdf3c('0x7')][_0x9b7034[_0xdf3c('0x1b')]][_0xdf3c('0x50')]===_0xdf3c('0x51')){if(this[_0xdf3c('0x8')][_0x9b7034['interface']]){logger[_0xdf3c('0x24')](_0xdf3c('0x52'),_0x9b7034[_0xdf3c('0x30')],_0x9b7034[_0xdf3c('0x1a')],_0x9b7034[_0xdf3c('0x1b')]);return RpcUser['savePause'](this[_0xdf3c('0x8')][_0x9b7034[_0xdf3c('0x1a')]],_0xdf3c('0x53'),_0x9b7034[_0xdf3c('0x30')]);}}}catch(_0x1efa9c){logger[_0xdf3c('0x35')](_0xdf3c('0x54'),_0x1efa9c[_0xdf3c('0x36')]);}};module[_0xdf3c('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index d09cfac..8859016 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 _0x3790=['../../config/logger','ami','../../config/environment','asterisk','username','keepConnected','Action','promisify','action','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','format','once','error','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','close','exports','asterisk-manager','bluebird','moment','util','lodash'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x3790,0xb9));var _0x0379=function(_0x104312,_0x452bd6){_0x104312=_0x104312-0x0;var _0x56f0ba=_0x3790[_0x104312];return _0x56f0ba;};'use strict';var Manager=require(_0x0379('0x0'));var BPromise=require(_0x0379('0x1'));var moment=require(_0x0379('0x2'));var util=require(_0x0379('0x3'));var _=require(_0x0379('0x4'));var logger=require(_0x0379('0x5'))(_0x0379('0x6'));var config=require(_0x0379('0x7'));var ami=new Manager(config[_0x0379('0x8')]['port'],config[_0x0379('0x8')]['ip'],config[_0x0379('0x8')][_0x0379('0x9')],config[_0x0379('0x8')]['password'],!![]);ami[_0x0379('0xa')]();ami[_0x0379('0xb')]=BPromise[_0x0379('0xc')](ami[_0x0379('0xd')]);function error(_0x79a404){logger['error'](util['format'](_0x0379('0xe'),config[_0x0379('0x8')]['username'],config[_0x0379('0x8')]['ip'],config[_0x0379('0x8')][_0x0379('0xf')],util['inspect'](_0x79a404,![],null)));}function close(){logger['error'](util['format'](_0x0379('0x10'),config[_0x0379('0x8')][_0x0379('0x9')],config['asterisk']['ip'],config['asterisk']['port']));}ami[_0x0379('0x11')]=function(){return function(){return ami['Action']({'action':_0x0379('0x12')});};};ami[_0x0379('0x13')]=function(){return function(){return ami[_0x0379('0xb')]({'action':_0x0379('0x14')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x0379('0xb')]({'action':_0x0379('0x15')});};};ami[_0x0379('0x16')]=function(){return function(){return ami[_0x0379('0xb')]({'action':'queuesummary'});};};ami[_0x0379('0x17')]=function(){return function(){return ami[_0x0379('0xb')]({'action':_0x0379('0x18')});};};function connect(_0x258cf1){logger[_0x0379('0x19')](util[_0x0379('0x1a')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x0379('0x8')][_0x0379('0x9')],config[_0x0379('0x8')]['ip'],config[_0x0379('0x8')][_0x0379('0xf')]));ami[_0x0379('0x1b')](_0x0379('0x1c'),error);ami[_0x0379('0x1b')]('close',close);}ami['on']('connect',connect);ami['on'](_0x0379('0x1d'),function(_0x26d537){logger[_0x0379('0x19')](util['format'](_0x0379('0x1e'),config[_0x0379('0x8')]['username'],config[_0x0379('0x8')]['ip'],config[_0x0379('0x8')][_0x0379('0xf')],util[_0x0379('0x1f')](_0x26d537,![],null)));});ami['on'](_0x0379('0x20'),function(_0x293ad2){logger[_0x0379('0x19')](util[_0x0379('0x1a')](_0x0379('0x21'),config[_0x0379('0x8')][_0x0379('0x9')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x0379('0x22')]()[_0x0379('0x23')](ami[_0x0379('0x11')]())[_0x0379('0x23')](ami[_0x0379('0x13')]())['then'](ami['actionSipPeerStatus']())[_0x0379('0x23')](ami['actionQueueSummary']())[_0x0379('0x23')](ami[_0x0379('0x17')]())['catch'](function(_0x353024){console['log'](_0x353024);});});ami[_0x0379('0x1b')](_0x0379('0x1c'),error);ami[_0x0379('0x1b')](_0x0379('0x24'),close);module[_0x0379('0x25')]=ami; \ No newline at end of file +var _0x08d6=['inspect','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','actionQueueSummary','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','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x366776,_0x48f0bf){var _0x34e2ad=function(_0xb7dfb0){while(--_0xb7dfb0){_0x366776['push'](_0x366776['shift']());}};_0x34e2ad(++_0x48f0bf);}(_0x08d6,0x1a9));var _0x608d=function(_0x1cc711,_0x4e2707){_0x1cc711=_0x1cc711-0x0;var _0x3acc03=_0x08d6[_0x1cc711];return _0x3acc03;};'use strict';var Manager=require(_0x608d('0x0'));var BPromise=require(_0x608d('0x1'));var moment=require(_0x608d('0x2'));var util=require(_0x608d('0x3'));var _=require(_0x608d('0x4'));var logger=require(_0x608d('0x5'))('ami');var config=require(_0x608d('0x6'));var ami=new Manager(config['asterisk'][_0x608d('0x7')],config[_0x608d('0x8')]['ip'],config[_0x608d('0x8')][_0x608d('0x9')],config[_0x608d('0x8')]['password'],!![]);ami[_0x608d('0xa')]();ami[_0x608d('0xb')]=BPromise[_0x608d('0xc')](ami[_0x608d('0xd')]);function error(_0x1fec98){logger[_0x608d('0xe')](util[_0x608d('0xf')](_0x608d('0x10'),config[_0x608d('0x8')][_0x608d('0x9')],config[_0x608d('0x8')]['ip'],config['asterisk'][_0x608d('0x7')],util[_0x608d('0x11')](_0x1fec98,![],null)));}function close(){logger[_0x608d('0xe')](util[_0x608d('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x608d('0x8')]['username'],config[_0x608d('0x8')]['ip'],config[_0x608d('0x8')]['port']));}ami[_0x608d('0x12')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0x608d('0x13')]=function(){return function(){return ami[_0x608d('0xb')]({'action':'devicestatelist'});};};ami[_0x608d('0x14')]=function(){return function(){return ami[_0x608d('0xb')]({'action':'sippeerstatus'});};};ami[_0x608d('0x15')]=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x608d('0x16')});};};function connect(_0x15699a){logger[_0x608d('0x17')](util[_0x608d('0xf')](_0x608d('0x18'),config['asterisk']['username'],config[_0x608d('0x8')]['ip'],config[_0x608d('0x8')][_0x608d('0x7')]));ami[_0x608d('0x19')](_0x608d('0xe'),error);ami[_0x608d('0x19')](_0x608d('0x1a'),close);}ami['on'](_0x608d('0x1b'),connect);ami['on'](_0x608d('0x1c'),function(_0x47d248){logger[_0x608d('0x17')](util[_0x608d('0xf')](_0x608d('0x1d'),config[_0x608d('0x8')][_0x608d('0x9')],config[_0x608d('0x8')]['ip'],config[_0x608d('0x8')]['port'],util[_0x608d('0x11')](_0x47d248,![],null)));});ami['on']('fullybooted',function(_0x126550){logger[_0x608d('0x17')](util[_0x608d('0xf')](_0x608d('0x1e'),config[_0x608d('0x8')][_0x608d('0x9')],config[_0x608d('0x8')]['ip'],config[_0x608d('0x8')][_0x608d('0x7')]));return BPromise[_0x608d('0x1f')]()[_0x608d('0x20')](ami[_0x608d('0x12')]())['then'](ami['actionDeviceStateList']())[_0x608d('0x20')](ami[_0x608d('0x14')]())['then'](ami[_0x608d('0x15')]())['then'](ami['actionCoreShowChannels']())['catch'](function(_0x20433a){console[_0x608d('0x21')](_0x20433a);});});ami['once'](_0x608d('0xe'),error);ami[_0x608d('0x19')](_0x608d('0x1a'),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 ec1a1d1..b30d54e 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 _0x9e42=['error','memberReport','message','result','catch','exports','jayson/promise','../../config/logger','ami','client','http','Request','request','then','debug','rpc'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x9e42,0x136));var _0x29e4=function(_0x5302fb,_0x1a2db3){_0x5302fb=_0x5302fb-0x0;var _0x43e6a4=_0x9e42[_0x5302fb];return _0x43e6a4;};'use strict';var jayson=require(_0x29e4('0x0'));var BPromise=require('bluebird');var logger=require(_0x29e4('0x1'))(_0x29e4('0x2'));var client=jayson[_0x29e4('0x3')][_0x29e4('0x4')]({'port':0x2329});client[_0x29e4('0x5')]=function(_0x4c297d,_0x163195){return new BPromise(function(_0x3bba69,_0x48baa3){return client[_0x29e4('0x6')](_0x4c297d,_0x163195)[_0x29e4('0x7')](function(_0x2b5756){logger[_0x29e4('0x8')](_0x29e4('0x9'),'memberReport',_0x4c297d,_0x163195,_0x2b5756);if(_0x2b5756['error']){logger[_0x29e4('0xa')](_0x29e4('0x9'),_0x29e4('0xb'),_0x4c297d,_0x2b5756['error'][_0x29e4('0xc')],_0x163195);return _0x48baa3(_0x2b5756[_0x29e4('0xa')][_0x29e4('0xc')]);}else{return _0x3bba69(_0x2b5756[_0x29e4('0xd')]);}})[_0x29e4('0xe')](function(_0x49e18e){logger[_0x29e4('0xa')](_0x29e4('0x9'),'memberReport',_0x4c297d,_0x49e18e,_0x163195);return _0x48baa3(_0x49e18e);});});};module[_0x29e4('0xf')]=client; \ No newline at end of file +var _0xd795=['../../config/logger','ami','client','http','Request','debug','memberReport','error','rpc','message','exports','jayson/promise'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd795,0x11f));var _0x5d79=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0xd795[_0x4fde08];return _0x12e725;};'use strict';var jayson=require(_0x5d79('0x0'));var BPromise=require('bluebird');var logger=require(_0x5d79('0x1'))(_0x5d79('0x2'));var client=jayson[_0x5d79('0x3')][_0x5d79('0x4')]({'port':0x2329});client[_0x5d79('0x5')]=function(_0x1e6a01,_0x4673ee){return new BPromise(function(_0x3958b8,_0x46ae64){return client['request'](_0x1e6a01,_0x4673ee)['then'](function(_0x3394c8){logger[_0x5d79('0x6')]('rpc',_0x5d79('0x7'),_0x1e6a01,_0x4673ee,_0x3394c8);if(_0x3394c8[_0x5d79('0x8')]){logger[_0x5d79('0x8')](_0x5d79('0x9'),_0x5d79('0x7'),_0x1e6a01,_0x3394c8[_0x5d79('0x8')][_0x5d79('0xa')],_0x4673ee);return _0x46ae64(_0x3394c8[_0x5d79('0x8')]['message']);}else{return _0x3958b8(_0x3394c8['result']);}})['catch'](function(_0x3a9e2c){logger[_0x5d79('0x8')]('rpc',_0x5d79('0x7'),_0x1e6a01,_0x3a9e2c,_0x4673ee);return _0x46ae64(_0x3a9e2c);});});};module[_0x5d79('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index f227ff1..062be8e 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 _0x41c8=['ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','name','phone','Contact','firstName','lastName','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x41c8,0x98));var _0x841c=function(_0x317738,_0x394239){_0x317738=_0x317738-0x0;var _0x1b3e89=_0x41c8[_0x317738];return _0x1b3e89;};'use strict';var util=require(_0x841c('0x0'));var _=require(_0x841c('0x1'));var moment=require('moment');function checkNameSurname(_0x7ad3de,_0x1d1820,_0x23ca55){var _0x2bca23='';if(!_[_0x841c('0x2')](_0x1d1820)&&_0x841c('0x3')===typeof _0x1d1820){_0x2bca23+=_0x1d1820;}if(!_[_0x841c('0x2')](_0x23ca55)&&_0x841c('0x3')===typeof _0x23ca55){_0x2bca23+='\x20'+_0x23ca55;}if(_0x2bca23!==''){return _0x2bca23;}return _0x7ad3de;}function Action(_0x31e757,_0xff70f,_0x3b7561){this[_0x841c('0x4')]=_0x31e757;this[_0x841c('0x5')]=_0x3b7561||undefined;this[_0x841c('0x6')]=checkNameSurname(_0xff70f['Contact'][_0x841c('0x7')],_0xff70f[_0x841c('0x8')][_0x841c('0x9')],_0xff70f[_0x841c('0x8')][_0x841c('0xa')]);this['number']=_0xff70f['Contact'][_0x841c('0x7')];this[_0x841c('0xb')]=_0x31e757['name'];this[_0x841c('0xc')]=_0xff70f[_0x841c('0xc')]||![];this[_0x841c('0xd')]=_0x31e757['type'];this['dialQueueTimeout']=_0x31e757['dialQueueTimeout']||0x3;this[_0x841c('0xe')]=_0xff70f[_0x841c('0xe')];this[_0x841c('0xf')]=_0xff70f[_0x841c('0xf')];this['countcongestionretry']=_0xff70f[_0x841c('0x10')];this[_0x841c('0x11')]=_0xff70f[_0x841c('0x11')];this[_0x841c('0x12')]=_0xff70f['countnosuchnumberretry'];this[_0x841c('0x13')]=_0xff70f[_0x841c('0x13')];this[_0x841c('0x14')]=_0xff70f[_0x841c('0x14')];this['countmachineretry']=_0xff70f[_0x841c('0x15')];this[_0x841c('0x16')]=_0xff70f[_0x841c('0x16')];this[_0x841c('0x17')]=_0xff70f[_0x841c('0x17')];this['ListId']=_0xff70f[_0x841c('0x18')];this[_0x841c('0x19')]=_0xff70f[_0x841c('0x19')];this['VoiceQueueId']=_0xff70f[_0x841c('0x1a')];this[_0x841c('0x1b')]=_0xff70f[_0x841c('0x1b')];this['idHopper']=_0xff70f['id'];this[_0x841c('0x1c')]=_0xff70f[_0x841c('0x8')][_0x841c('0x9')]||'';this[_0x841c('0x1d')]=moment()[_0x841c('0x1e')](_0x841c('0x1f'));this[_0x841c('0x20')]=_0xff70f[_0x841c('0x20')];this[_0x841c('0x21')]=_0xff70f[_0x841c('0x21')];this[_0x841c('0x22')]=_0xff70f[_0x841c('0x22')];this['recallme']=_0xff70f[_0x841c('0x23')];this[_0x841c('0x24')]='';this[_0x841c('0x25')]='';}Action[_0x841c('0x26')]['getCaller']=function(){return util['format'](_0x841c('0x27'),this[_0x841c('0x6')],this[_0x841c('0x4')][_0x841c('0x28')]>0x0?this[_0x841c('0x29')][_0x841c('0x2a')](this[_0x841c('0x4')]['dialCutDigit']):this[_0x841c('0x29')]);};Action[_0x841c('0x26')][_0x841c('0x2b')]=function(){return this[_0x841c('0xb')];};module[_0x841c('0x2c')]=Action; \ No newline at end of file +var _0xb4f4=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','substring','dialCutDigit','getQueue','queue','util','lodash','string','isNil','voiceQueue','Contact','phone','firstName','number','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0xb4f4,0xda));var _0x4b4f=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xb4f4[_0x2080a3];return _0x8d7d17;};'use strict';var util=require(_0x4b4f('0x0'));var _=require(_0x4b4f('0x1'));var moment=require('moment');function checkNameSurname(_0x42ab58,_0x2da113,_0x9d3e48){var _0x45d082='';if(!_['isNil'](_0x2da113)&&_0x4b4f('0x2')===typeof _0x2da113){_0x45d082+=_0x2da113;}if(!_[_0x4b4f('0x3')](_0x9d3e48)&&_0x4b4f('0x2')===typeof _0x9d3e48){_0x45d082+='\x20'+_0x9d3e48;}if(_0x45d082!==''){return _0x45d082;}return _0x42ab58;}function Action(_0x183a72,_0x1faad4,_0x15e02e){this[_0x4b4f('0x4')]=_0x183a72;this['uniqueid']=_0x15e02e||undefined;this['name']=checkNameSurname(_0x1faad4[_0x4b4f('0x5')][_0x4b4f('0x6')],_0x1faad4[_0x4b4f('0x5')][_0x4b4f('0x7')],_0x1faad4[_0x4b4f('0x5')]['lastName']);this[_0x4b4f('0x8')]=_0x1faad4[_0x4b4f('0x5')][_0x4b4f('0x6')];this['queue']=_0x183a72[_0x4b4f('0x9')];this[_0x4b4f('0xa')]=_0x1faad4['active']||![];this[_0x4b4f('0xb')]=_0x183a72[_0x4b4f('0xb')];this[_0x4b4f('0xc')]=_0x183a72[_0x4b4f('0xc')]||0x3;this[_0x4b4f('0xd')]=_0x1faad4[_0x4b4f('0xd')];this[_0x4b4f('0xe')]=_0x1faad4[_0x4b4f('0xe')];this['countcongestionretry']=_0x1faad4['countcongestionretry'];this[_0x4b4f('0xf')]=_0x1faad4[_0x4b4f('0xf')];this['countnosuchnumberretry']=_0x1faad4[_0x4b4f('0x10')];this[_0x4b4f('0x11')]=_0x1faad4[_0x4b4f('0x11')];this['countabandonedretry']=_0x1faad4[_0x4b4f('0x12')];this[_0x4b4f('0x13')]=_0x1faad4[_0x4b4f('0x13')];this['countagentrejectretry']=_0x1faad4[_0x4b4f('0x14')];this[_0x4b4f('0x15')]=_0x1faad4[_0x4b4f('0x15')];this[_0x4b4f('0x16')]=_0x1faad4[_0x4b4f('0x16')];this[_0x4b4f('0x17')]=_0x1faad4[_0x4b4f('0x17')];this[_0x4b4f('0x18')]=_0x1faad4[_0x4b4f('0x18')];this['CampaignId']=_0x1faad4[_0x4b4f('0x19')];this[_0x4b4f('0x1a')]=_0x1faad4['id'];this[_0x4b4f('0x1b')]=_0x1faad4[_0x4b4f('0x5')][_0x4b4f('0x7')]||'';this[_0x4b4f('0x1c')]=moment()[_0x4b4f('0x1d')](_0x4b4f('0x1e'));this[_0x4b4f('0x1f')]=_0x1faad4[_0x4b4f('0x1f')];this[_0x4b4f('0x20')]=_0x1faad4['callbackuniqueid'];this[_0x4b4f('0x21')]=_0x1faad4[_0x4b4f('0x21')];this[_0x4b4f('0x22')]=_0x1faad4['recallme'];this[_0x4b4f('0x23')]='';this['originatecalleridname']='';}Action[_0x4b4f('0x24')]['getCaller']=function(){return util[_0x4b4f('0x1d')]('\x22%s\x22\x20<%s>',this[_0x4b4f('0x9')],this[_0x4b4f('0x4')]['dialCutDigit']>0x0?this[_0x4b4f('0x8')][_0x4b4f('0x25')](this[_0x4b4f('0x4')][_0x4b4f('0x26')]):this[_0x4b4f('0x8')]);};Action[_0x4b4f('0x24')][_0x4b4f('0x27')]=function(){return this[_0x4b4f('0x28')];};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 b293cea..37eedaa 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 _0x4a05=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','number','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x304bf7,_0x4fcafc){var _0x5036cd=function(_0x39e810){while(--_0x39e810){_0x304bf7['push'](_0x304bf7['shift']());}};_0x5036cd(++_0x4fcafc);}(_0x4a05,0x192));var _0x54a0=function(_0x53f402,_0x326920){_0x53f402=_0x53f402-0x0;var _0x45a76d=_0x4a05[_0x53f402];return _0x45a76d;};'use strict';var util=require('util');var _=require(_0x54a0('0x0'));var moment=require(_0x54a0('0x1'));function getSeconds(_0x188699,_0x33bff5){var _0x4fcc4b=moment(_0x188699)[_0x54a0('0x2')](0x0);var _0xf7f51e=moment(_0x33bff5)['milliseconds'](0x0);return _0x4fcc4b[_0x54a0('0x3')](_0xf7f51e,'seconds');}function AdditionalPhone(_0x390a97){this[_0x54a0('0x4')]=_0x390a97[_0x54a0('0x4')];this['scheduledat']=_0x390a97[_0x54a0('0x5')]||undefined;this[_0x54a0('0x6')]=_0x390a97['type'];this[_0x54a0('0x7')]=_0x390a97['type']===_0x54a0('0x8')?_0x54a0('0x9'):_0x390a97[_0x54a0('0x6')];this[_0x54a0('0xa')]=_0x390a97['countbusyretry'];this[_0x54a0('0xb')]=_0x390a97[_0x54a0('0xb')];this[_0x54a0('0xc')]=_0x390a97[_0x54a0('0xc')];this[_0x54a0('0xd')]=_0x390a97[_0x54a0('0xa')]+_0x390a97['countcongestionretry']+_0x390a97['countnoanswerretry']+_0x390a97[_0x54a0('0xe')]+_0x390a97[_0x54a0('0xf')]+_0x390a97['countabandonedretry']+_0x390a97[_0x54a0('0x10')]+_0x390a97[_0x54a0('0x11')];this[_0x54a0('0xe')]=_0x390a97['countnosuchnumberretry'];this[_0x54a0('0xf')]=_0x390a97['countdropretry'];this[_0x54a0('0x12')]=_0x390a97[_0x54a0('0x12')];this[_0x54a0('0x10')]=_0x390a97[_0x54a0('0x10')];this[_0x54a0('0x11')]=_0x390a97[_0x54a0('0x11')];this['queue']=_0x390a97['queue'];this['calleridname']=_0x390a97['name'];this['calleridnum']=_0x390a97[_0x54a0('0x13')];this[_0x54a0('0x14')]=_0x390a97[_0x54a0('0x14')];this['responsetime']=_0x390a97['responsetime'];this['endtime']=_0x390a97[_0x54a0('0x15')];this['ringtime']=getSeconds(_0x390a97[_0x54a0('0x15')],_0x390a97[_0x54a0('0x14')]);this[_0x54a0('0x16')]=0x0;this[_0x54a0('0x17')]=0x0;this[_0x54a0('0x18')]=_0x390a97[_0x54a0('0x18')];this[_0x54a0('0x19')]=_0x390a97['callbackuniqueid'];this[_0x54a0('0x1a')]=_0x390a97[_0x54a0('0x1a')];this[_0x54a0('0x1b')]=_0x390a97[_0x54a0('0x1b')];this['ContactId']=_0x390a97[_0x54a0('0x1c')];this[_0x54a0('0x1d')]=_0x390a97['ListId'];this[_0x54a0('0x1e')]=_0x390a97['UserId'];this[_0x54a0('0x1f')]=_0x390a97['VoiceQueueId'];this[_0x54a0('0x20')]=_0x390a97['CampaignId'];this[_0x54a0('0x21')]=_0x390a97[_0x54a0('0x21')]||'';this[_0x54a0('0x22')]=_0x390a97[_0x54a0('0x22')]||'';}module[_0x54a0('0x23')]=History; \ No newline at end of file +var _0xd322=['countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x1ac80a,_0x436091){var _0x4e9b0d=function(_0x4ec89a){while(--_0x4ec89a){_0x1ac80a['push'](_0x1ac80a['shift']());}};_0x4e9b0d(++_0x436091);}(_0xd322,0x124));var _0x2d32=function(_0x327cef,_0x8b85a4){_0x327cef=_0x327cef-0x0;var _0x3c39f0=_0xd322[_0x327cef];return _0x3c39f0;};'use strict';var util=require(_0x2d32('0x0'));var _=require(_0x2d32('0x1'));var moment=require(_0x2d32('0x2'));function getSeconds(_0x9768d,_0x14aa7c){var _0xb1a2b2=moment(_0x9768d)[_0x2d32('0x3')](0x0);var _0x5383e3=moment(_0x14aa7c)['milliseconds'](0x0);return _0xb1a2b2['diff'](_0x5383e3,_0x2d32('0x4'));}function AdditionalPhone(_0x448280){this[_0x2d32('0x5')]=_0x448280[_0x2d32('0x5')];this[_0x2d32('0x6')]=_0x448280[_0x2d32('0x6')]||undefined;this['type']=_0x448280[_0x2d32('0x7')];this['campaigntype']=_0x448280[_0x2d32('0x7')]===_0x2d32('0x8')?'queue':_0x448280[_0x2d32('0x7')];this[_0x2d32('0x9')]=_0x448280[_0x2d32('0x9')];this[_0x2d32('0xa')]=_0x448280[_0x2d32('0xa')];this[_0x2d32('0xb')]=_0x448280[_0x2d32('0xb')];this['countglobal']=_0x448280[_0x2d32('0x9')]+_0x448280[_0x2d32('0xa')]+_0x448280[_0x2d32('0xb')]+_0x448280[_0x2d32('0xc')]+_0x448280['countdropretry']+_0x448280[_0x2d32('0xd')]+_0x448280[_0x2d32('0xe')]+_0x448280['countagentrejectretry'];this['countnosuchnumberretry']=_0x448280['countnosuchnumberretry'];this[_0x2d32('0xf')]=_0x448280[_0x2d32('0xf')];this[_0x2d32('0xd')]=_0x448280['countabandonedretry'];this[_0x2d32('0xe')]=_0x448280['countmachineretry'];this[_0x2d32('0x10')]=_0x448280['countagentrejectretry'];this[_0x2d32('0x11')]=_0x448280['queue'];this[_0x2d32('0x12')]=_0x448280[_0x2d32('0x13')];this[_0x2d32('0x14')]=_0x448280[_0x2d32('0x15')];this[_0x2d32('0x16')]=_0x448280[_0x2d32('0x16')];this[_0x2d32('0x17')]=_0x448280['responsetime'];this[_0x2d32('0x18')]=_0x448280[_0x2d32('0x17')];this[_0x2d32('0x19')]=getSeconds(_0x448280[_0x2d32('0x17')],_0x448280[_0x2d32('0x16')]);this['holdtime']=0x0;this['talktime']=0x0;this[_0x2d32('0x1a')]=_0x448280['callback'];this[_0x2d32('0x1b')]=_0x448280['callbackuniqueid'];this['callbackat']=_0x448280[_0x2d32('0x1c')];this[_0x2d32('0x1d')]=_0x448280['recallme'];this['ContactId']=_0x448280[_0x2d32('0x1e')];this[_0x2d32('0x1f')]=_0x448280[_0x2d32('0x1f')];this[_0x2d32('0x20')]=_0x448280[_0x2d32('0x20')];this[_0x2d32('0x21')]=_0x448280[_0x2d32('0x21')];this[_0x2d32('0x22')]=_0x448280[_0x2d32('0x22')];this[_0x2d32('0x23')]=_0x448280[_0x2d32('0x23')]||'';this[_0x2d32('0x24')]=_0x448280[_0x2d32('0x24')]||'';}module[_0x2d32('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 4efa65e..a3e8023 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 _0x3546=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x2ea3a6,_0x473be1){var _0x4fbdcb=function(_0x4a2e2c){while(--_0x4a2e2c){_0x2ea3a6['push'](_0x2ea3a6['shift']());}};_0x4fbdcb(++_0x473be1);}(_0x3546,0x198));var _0x6354=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x3546[_0x57975f];return _0x4793b8;};'use strict';var util=require(_0x6354('0x0'));var _=require(_0x6354('0x1'));var moment=require(_0x6354('0x2'));function getSeconds(_0x139f9a,_0x54e39a){var _0x58a659=moment(_0x139f9a)[_0x6354('0x3')](0x0);var _0x2b51fd=moment(_0x54e39a)[_0x6354('0x3')](0x0);return _0x58a659['diff'](_0x2b51fd,_0x6354('0x4'));}function AgentComplete(_0x4c36ad,_0x49a174){this['state']=0x4;this[_0x6354('0x5')]=_0x6354('0x6');this['scheduledat']=_0x4c36ad[_0x6354('0x7')];this[_0x6354('0x8')]=_0x4c36ad[_0x6354('0x8')];this[_0x6354('0x9')]=_0x4c36ad['type']===_0x6354('0xa')?_0x6354('0xb'):_0x4c36ad[_0x6354('0x8')];this[_0x6354('0xc')]=_0x4c36ad[_0x6354('0xc')];this[_0x6354('0xd')]=_0x4c36ad[_0x6354('0xd')];this[_0x6354('0xe')]=_0x4c36ad[_0x6354('0xe')];this['countglobal']=_0x4c36ad[_0x6354('0xc')]+_0x4c36ad['countcongestionretry']+_0x4c36ad[_0x6354('0xe')]+_0x4c36ad[_0x6354('0xf')]+_0x4c36ad[_0x6354('0x10')]+_0x4c36ad[_0x6354('0x11')]+_0x4c36ad[_0x6354('0x12')]+_0x4c36ad['countagentrejectretry'];this[_0x6354('0xf')]=_0x4c36ad[_0x6354('0xf')];this['countdropretry']=_0x4c36ad[_0x6354('0x10')];this[_0x6354('0x11')]=_0x4c36ad[_0x6354('0x11')];this[_0x6354('0x12')]=_0x4c36ad[_0x6354('0x12')];this[_0x6354('0x13')]=_0x4c36ad[_0x6354('0x13')];this[_0x6354('0x14')]=_0x49a174['uniqueid'];this['calleridname']=_0x4c36ad['name'];this[_0x6354('0x15')]=_0x4c36ad['number'];this[_0x6354('0x16')]=_0x4c36ad[_0x6354('0x16')];this['responsetime']=_0x4c36ad[_0x6354('0x17')];this[_0x6354('0x18')]=_0x4c36ad[_0x6354('0x18')];this['endtime']=moment()[_0x6354('0x19')](_0x6354('0x1a'));this[_0x6354('0x1b')]=getSeconds(_0x4c36ad[_0x6354('0x17')],_0x4c36ad[_0x6354('0x16')]);this[_0x6354('0x1c')]=getSeconds(_0x4c36ad['answertime'],_0x4c36ad['responsetime']);this[_0x6354('0x1d')]=getSeconds(this['endtime'],_0x4c36ad[_0x6354('0x18')]);this[_0x6354('0xb')]=_0x49a174[_0x6354('0xb')];this[_0x6354('0x1e')]=_0x49a174[_0x6354('0x1e')];this[_0x6354('0x1f')]=_0x49a174[_0x6354('0x1f')];this[_0x6354('0x20')]=_0x4c36ad[_0x6354('0x20')];this[_0x6354('0x21')]=_0x4c36ad['callbackuniqueid'];this[_0x6354('0x22')]=_0x4c36ad[_0x6354('0x22')];this[_0x6354('0x23')]=_0x4c36ad['recallme'];this[_0x6354('0x24')]=_0x4c36ad['ContactId'];this[_0x6354('0x25')]=_0x4c36ad['ListId'];this[_0x6354('0x26')]=_0x4c36ad['UserId'];this[_0x6354('0x27')]=_0x4c36ad[_0x6354('0x27')];this[_0x6354('0x28')]=_0x4c36ad[_0x6354('0x28')];this['originatecalleridnum']=_0x4c36ad['originatecalleridnum']||'';this['originatecalleridname']=_0x4c36ad['originatecalleridname']||'';}module[_0x6354('0x29')]=AgentComplete; \ No newline at end of file +var _0x7f50=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry'];(function(_0x4aac5d,_0x52c50a){var _0x1610e1=function(_0x20d2e9){while(--_0x20d2e9){_0x4aac5d['push'](_0x4aac5d['shift']());}};_0x1610e1(++_0x52c50a);}(_0x7f50,0x1c8));var _0x07f5=function(_0x684076,_0x315f4d){_0x684076=_0x684076-0x0;var _0xc8e750=_0x7f50[_0x684076];return _0xc8e750;};'use strict';var util=require(_0x07f5('0x0'));var _=require('lodash');var moment=require(_0x07f5('0x1'));function getSeconds(_0x40ca81,_0x2b48f1){var _0x4192e4=moment(_0x40ca81)[_0x07f5('0x2')](0x0);var _0x27fb45=moment(_0x2b48f1)['milliseconds'](0x0);return _0x4192e4[_0x07f5('0x3')](_0x27fb45,_0x07f5('0x4'));}function AgentComplete(_0x5061e5,_0x5d2dca){this[_0x07f5('0x5')]=0x4;this[_0x07f5('0x6')]=_0x07f5('0x7');this[_0x07f5('0x8')]=_0x5061e5['scheduledat'];this[_0x07f5('0x9')]=_0x5061e5[_0x07f5('0x9')];this[_0x07f5('0xa')]=_0x5061e5[_0x07f5('0x9')]===_0x07f5('0xb')?'queue':_0x5061e5[_0x07f5('0x9')];this[_0x07f5('0xc')]=_0x5061e5[_0x07f5('0xc')];this['countcongestionretry']=_0x5061e5[_0x07f5('0xd')];this[_0x07f5('0xe')]=_0x5061e5['countnoanswerretry'];this['countglobal']=_0x5061e5['countbusyretry']+_0x5061e5[_0x07f5('0xd')]+_0x5061e5[_0x07f5('0xe')]+_0x5061e5[_0x07f5('0xf')]+_0x5061e5[_0x07f5('0x10')]+_0x5061e5[_0x07f5('0x11')]+_0x5061e5[_0x07f5('0x12')]+_0x5061e5['countagentrejectretry'];this[_0x07f5('0xf')]=_0x5061e5[_0x07f5('0xf')];this[_0x07f5('0x10')]=_0x5061e5[_0x07f5('0x10')];this[_0x07f5('0x11')]=_0x5061e5[_0x07f5('0x11')];this[_0x07f5('0x12')]=_0x5061e5['countmachineretry'];this[_0x07f5('0x13')]=_0x5061e5['countagentrejectretry'];this[_0x07f5('0x14')]=_0x5d2dca['uniqueid'];this['calleridname']=_0x5061e5[_0x07f5('0x15')];this[_0x07f5('0x16')]=_0x5061e5[_0x07f5('0x17')];this[_0x07f5('0x18')]=_0x5061e5[_0x07f5('0x18')];this['responsetime']=_0x5061e5[_0x07f5('0x19')];this['answertime']=_0x5061e5[_0x07f5('0x1a')];this[_0x07f5('0x1b')]=moment()[_0x07f5('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x07f5('0x1d')]=getSeconds(_0x5061e5[_0x07f5('0x19')],_0x5061e5[_0x07f5('0x18')]);this[_0x07f5('0x1e')]=getSeconds(_0x5061e5[_0x07f5('0x1a')],_0x5061e5[_0x07f5('0x19')]);this[_0x07f5('0x1f')]=getSeconds(this[_0x07f5('0x1b')],_0x5061e5['answertime']);this[_0x07f5('0x20')]=_0x5d2dca[_0x07f5('0x20')];this[_0x07f5('0x21')]=_0x5d2dca['membername'];this[_0x07f5('0x22')]=_0x5d2dca[_0x07f5('0x22')];this[_0x07f5('0x23')]=_0x5061e5['callback'];this[_0x07f5('0x24')]=_0x5061e5['callbackuniqueid'];this[_0x07f5('0x25')]=_0x5061e5['callbackat'];this[_0x07f5('0x26')]=_0x5061e5[_0x07f5('0x26')];this['ContactId']=_0x5061e5[_0x07f5('0x27')];this[_0x07f5('0x28')]=_0x5061e5[_0x07f5('0x28')];this[_0x07f5('0x29')]=_0x5061e5['UserId'];this[_0x07f5('0x2a')]=_0x5061e5[_0x07f5('0x2a')];this[_0x07f5('0x2b')]=_0x5061e5[_0x07f5('0x2b')];this['originatecalleridnum']=_0x5061e5[_0x07f5('0x2c')]||'';this['originatecalleridname']=_0x5061e5[_0x07f5('0x2d')]||'';}module[_0x07f5('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index de6b83f..a89a292 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 _0x5265=['countglobal','countabandonedretry','countmachineretry','countnosuchnumberretry','countdropretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x204dc6,_0xf19d46){var _0x24a5eb=function(_0x21d525){while(--_0x21d525){_0x204dc6['push'](_0x204dc6['shift']());}};_0x24a5eb(++_0xf19d46);}(_0x5265,0x65));var _0x5526=function(_0x49d825,_0x18649d){_0x49d825=_0x49d825-0x0;var _0x22ed3a=_0x5265[_0x49d825];return _0x22ed3a;};'use strict';var util=require(_0x5526('0x0'));var _=require(_0x5526('0x1'));var moment=require(_0x5526('0x2'));function getSeconds(_0x215d15,_0x29a032){var _0x38fac0=moment(_0x215d15)[_0x5526('0x3')](0x0);var _0x572359=moment(_0x29a032)[_0x5526('0x3')](0x0);return _0x38fac0[_0x5526('0x4')](_0x572359,'seconds');}function Final(_0x552682){this['uniqueid']=_0x552682['uniqueid'];this[_0x5526('0x5')]=_0x552682[_0x5526('0x5')];this['type']=_0x552682[_0x5526('0x6')];this[_0x5526('0x7')]=_0x552682[_0x5526('0x6')]===_0x5526('0x8')?_0x5526('0x9'):_0x552682[_0x5526('0x6')];this[_0x5526('0xa')]=_0x552682[_0x5526('0xa')];this[_0x5526('0xb')]=_0x552682[_0x5526('0xb')];this[_0x5526('0xc')]=_0x552682['countnoanswerretry'];this[_0x5526('0xd')]=_0x552682[_0x5526('0xa')]+_0x552682['countcongestionretry']+_0x552682[_0x5526('0xc')]+_0x552682['countnosuchnumberretry']+_0x552682['countdropretry']+_0x552682[_0x5526('0xe')]+_0x552682[_0x5526('0xf')]+_0x552682['countagentrejectretry'];this[_0x5526('0x10')]=_0x552682[_0x5526('0x10')];this[_0x5526('0x11')]=_0x552682[_0x5526('0x11')];this[_0x5526('0xe')]=_0x552682[_0x5526('0xe')];this[_0x5526('0xf')]=_0x552682[_0x5526('0xf')];this[_0x5526('0x12')]=_0x552682[_0x5526('0x12')];this['queue']=_0x552682['queue'];this[_0x5526('0x13')]=_0x552682[_0x5526('0x13')];this[_0x5526('0x14')]=_0x552682['calleridnum'];this['starttime']=_0x552682[_0x5526('0x15')];this['responsetime']=_0x552682[_0x5526('0x16')];this[_0x5526('0x17')]=_0x552682[_0x5526('0x16')];this[_0x5526('0x18')]=_0x552682[_0x5526('0x18')]||0x0;this['holdtime']=_0x552682[_0x5526('0x19')]||0x0;this[_0x5526('0x1a')]=_0x552682['talktime']||0x0;this[_0x5526('0x1b')]=_0x552682[_0x5526('0x1b')];this[_0x5526('0x1c')]=_0x552682[_0x5526('0x1c')];this[_0x5526('0x1d')]=_0x552682[_0x5526('0x1d')];this[_0x5526('0x1e')]=_0x552682[_0x5526('0x1e')];this[_0x5526('0x1f')]=_0x552682['ContactId'];this[_0x5526('0x20')]=_0x552682[_0x5526('0x20')];this['UserId']=_0x552682[_0x5526('0x21')];this[_0x5526('0x22')]=_0x552682[_0x5526('0x22')];this['CampaignId']=_0x552682['CampaignId'];this['originatecalleridnum']=_0x552682[_0x5526('0x23')]||'';this['originatecalleridname']=_0x552682[_0x5526('0x24')]||'';}module[_0x5526('0x25')]=Final; \ No newline at end of file +var _0x3d83=['countnoanswerretry','countcongestionretry','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','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x49c69c,_0x2e6150){var _0x55cdd2=function(_0x12afe3){while(--_0x12afe3){_0x49c69c['push'](_0x49c69c['shift']());}};_0x55cdd2(++_0x2e6150);}(_0x3d83,0x197));var _0x33d8=function(_0x50cf06,_0x3bb225){_0x50cf06=_0x50cf06-0x0;var _0x49f577=_0x3d83[_0x50cf06];return _0x49f577;};'use strict';var util=require('util');var _=require(_0x33d8('0x0'));var moment=require(_0x33d8('0x1'));function getSeconds(_0x467699,_0x1d47e6){var _0x39b1ce=moment(_0x467699)[_0x33d8('0x2')](0x0);var _0x1f2be2=moment(_0x1d47e6)[_0x33d8('0x2')](0x0);return _0x39b1ce['diff'](_0x1f2be2,_0x33d8('0x3'));}function Final(_0x4711e8){this[_0x33d8('0x4')]=_0x4711e8[_0x33d8('0x4')];this[_0x33d8('0x5')]=_0x4711e8[_0x33d8('0x5')];this[_0x33d8('0x6')]=_0x4711e8[_0x33d8('0x6')];this[_0x33d8('0x7')]=_0x4711e8[_0x33d8('0x6')]===_0x33d8('0x8')?_0x33d8('0x9'):_0x4711e8[_0x33d8('0x6')];this[_0x33d8('0xa')]=_0x4711e8[_0x33d8('0xa')];this['countcongestionretry']=_0x4711e8['countcongestionretry'];this[_0x33d8('0xb')]=_0x4711e8[_0x33d8('0xb')];this['countglobal']=_0x4711e8[_0x33d8('0xa')]+_0x4711e8[_0x33d8('0xc')]+_0x4711e8[_0x33d8('0xb')]+_0x4711e8[_0x33d8('0xd')]+_0x4711e8[_0x33d8('0xe')]+_0x4711e8[_0x33d8('0xf')]+_0x4711e8[_0x33d8('0x10')]+_0x4711e8[_0x33d8('0x11')];this[_0x33d8('0xd')]=_0x4711e8[_0x33d8('0xd')];this[_0x33d8('0xe')]=_0x4711e8[_0x33d8('0xe')];this['countabandonedretry']=_0x4711e8[_0x33d8('0xf')];this[_0x33d8('0x10')]=_0x4711e8['countmachineretry'];this[_0x33d8('0x11')]=_0x4711e8[_0x33d8('0x11')];this['queue']=_0x4711e8[_0x33d8('0x9')];this['calleridname']=_0x4711e8[_0x33d8('0x12')];this[_0x33d8('0x13')]=_0x4711e8[_0x33d8('0x13')];this[_0x33d8('0x14')]=_0x4711e8['starttime'];this[_0x33d8('0x15')]=_0x4711e8['responsetime'];this[_0x33d8('0x16')]=_0x4711e8[_0x33d8('0x15')];this[_0x33d8('0x17')]=_0x4711e8[_0x33d8('0x17')]||0x0;this[_0x33d8('0x18')]=_0x4711e8[_0x33d8('0x18')]||0x0;this[_0x33d8('0x19')]=_0x4711e8[_0x33d8('0x19')]||0x0;this[_0x33d8('0x1a')]=_0x4711e8[_0x33d8('0x1a')];this[_0x33d8('0x1b')]=_0x4711e8[_0x33d8('0x1b')];this[_0x33d8('0x1c')]=_0x4711e8[_0x33d8('0x1c')];this['recallme']=_0x4711e8[_0x33d8('0x1d')];this['ContactId']=_0x4711e8[_0x33d8('0x1e')];this[_0x33d8('0x1f')]=_0x4711e8[_0x33d8('0x1f')];this[_0x33d8('0x20')]=_0x4711e8[_0x33d8('0x20')];this[_0x33d8('0x21')]=_0x4711e8[_0x33d8('0x21')];this['CampaignId']=_0x4711e8[_0x33d8('0x22')];this['originatecalleridnum']=_0x4711e8[_0x33d8('0x23')]||'';this[_0x33d8('0x24')]=_0x4711e8[_0x33d8('0x24')]||'';}module[_0x33d8('0x25')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 16a77f4..6d3aaa6 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 _0x0e60=['countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0xdc7c2b,_0x5e7990){var _0x56de57=function(_0x86d75b){while(--_0x86d75b){_0xdc7c2b['push'](_0xdc7c2b['shift']());}};_0x56de57(++_0x5e7990);}(_0x0e60,0x74));var _0x00e6=function(_0x3a3f7e,_0x54a39e){_0x3a3f7e=_0x3a3f7e-0x0;var _0x27b3a0=_0x0e60[_0x3a3f7e];return _0x27b3a0;};'use strict';var util=require('util');var _=require(_0x00e6('0x0'));var moment=require(_0x00e6('0x1'));function getSeconds(_0x211621,_0xf6dc29){var _0xaf9498=moment(_0x211621)[_0x00e6('0x2')](0x0);var _0x457bd3=moment(_0xf6dc29)['milliseconds'](0x0);return _0xaf9498[_0x00e6('0x3')](_0x457bd3,_0x00e6('0x4'));}function Hangup(_0x2cb72a,_0x5d1e13){this[_0x00e6('0x5')]=0x4;this['statedesc']=_0x00e6('0x6');this[_0x00e6('0x7')]=_0x2cb72a[_0x00e6('0x7')];this[_0x00e6('0x8')]=_0x2cb72a[_0x00e6('0x8')];this[_0x00e6('0x9')]=_0x2cb72a['type']===_0x00e6('0xa')?'queue':_0x2cb72a['type'];this[_0x00e6('0xb')]=_0x2cb72a[_0x00e6('0xb')];this[_0x00e6('0xc')]=_0x2cb72a[_0x00e6('0xc')];this[_0x00e6('0xd')]=_0x2cb72a[_0x00e6('0xd')];this[_0x00e6('0xe')]=_0x2cb72a['countbusyretry']+_0x2cb72a[_0x00e6('0xc')]+_0x2cb72a['countnoanswerretry']+_0x2cb72a[_0x00e6('0xf')]+_0x2cb72a[_0x00e6('0x10')]+_0x2cb72a[_0x00e6('0x11')]+_0x2cb72a[_0x00e6('0x12')]+_0x2cb72a['countagentrejectretry'];this[_0x00e6('0xf')]=_0x2cb72a[_0x00e6('0xf')];this[_0x00e6('0x10')]=_0x2cb72a[_0x00e6('0x10')];this[_0x00e6('0x11')]=_0x2cb72a['countabandonedretry'];this[_0x00e6('0x12')]=_0x2cb72a['countmachineretry'];this[_0x00e6('0x13')]=_0x2cb72a[_0x00e6('0x13')];this[_0x00e6('0x14')]=_0x5d1e13['uniqueid'];this[_0x00e6('0x15')]=_0x2cb72a[_0x00e6('0x16')];this['calleridnum']=_0x2cb72a[_0x00e6('0x17')];this[_0x00e6('0x18')]=_0x2cb72a[_0x00e6('0x18')];this[_0x00e6('0x19')]=_0x2cb72a[_0x00e6('0x19')];this[_0x00e6('0x1a')]=moment()['format'](_0x00e6('0x1b'));this[_0x00e6('0x1c')]=getSeconds(_0x2cb72a['responsetime'],_0x2cb72a[_0x00e6('0x18')]);this[_0x00e6('0x1d')]=0x0;this[_0x00e6('0x1e')]=getSeconds(this[_0x00e6('0x1a')],_0x2cb72a[_0x00e6('0x19')]);this[_0x00e6('0x1f')]=_0x2cb72a['queue'];this[_0x00e6('0x20')]='IVR';this[_0x00e6('0x21')]=_0x5d1e13[_0x00e6('0x22')];this['callback']=_0x2cb72a[_0x00e6('0x23')];this[_0x00e6('0x24')]=_0x2cb72a[_0x00e6('0x24')];this[_0x00e6('0x25')]=_0x2cb72a[_0x00e6('0x25')];this['recallme']=_0x2cb72a[_0x00e6('0x26')];this[_0x00e6('0x27')]=_0x2cb72a['ContactId'];this[_0x00e6('0x28')]=_0x2cb72a['ListId'];this[_0x00e6('0x29')]=_0x2cb72a[_0x00e6('0x29')];this[_0x00e6('0x2a')]=_0x2cb72a[_0x00e6('0x2a')];this['CampaignId']=_0x2cb72a[_0x00e6('0x2b')];}module[_0x00e6('0x2c')]=Hangup; \ No newline at end of file +var _0xf988=['queue','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime'];(function(_0x127f00,_0x58e241){var _0x1b38e7=function(_0x3e8822){while(--_0x3e8822){_0x127f00['push'](_0x127f00['shift']());}};_0x1b38e7(++_0x58e241);}(_0xf988,0x14d));var _0x8f98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf988[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x8f98('0x0'));function getSeconds(_0x184caa,_0x4342fc){var _0x2f6900=moment(_0x184caa)[_0x8f98('0x1')](0x0);var _0x21fd46=moment(_0x4342fc)[_0x8f98('0x1')](0x0);return _0x2f6900[_0x8f98('0x2')](_0x21fd46,_0x8f98('0x3'));}function Hangup(_0x1052c4,_0x1ba9d9){this[_0x8f98('0x4')]=0x4;this[_0x8f98('0x5')]=_0x8f98('0x6');this[_0x8f98('0x7')]=_0x1052c4[_0x8f98('0x7')];this[_0x8f98('0x8')]=_0x1052c4[_0x8f98('0x8')];this['campaigntype']=_0x1052c4['type']==='outbound'?'queue':_0x1052c4['type'];this[_0x8f98('0x9')]=_0x1052c4['countbusyretry'];this['countcongestionretry']=_0x1052c4[_0x8f98('0xa')];this[_0x8f98('0xb')]=_0x1052c4[_0x8f98('0xb')];this[_0x8f98('0xc')]=_0x1052c4[_0x8f98('0x9')]+_0x1052c4[_0x8f98('0xa')]+_0x1052c4['countnoanswerretry']+_0x1052c4['countnosuchnumberretry']+_0x1052c4[_0x8f98('0xd')]+_0x1052c4['countabandonedretry']+_0x1052c4[_0x8f98('0xe')]+_0x1052c4[_0x8f98('0xf')];this['countnosuchnumberretry']=_0x1052c4[_0x8f98('0x10')];this[_0x8f98('0xd')]=_0x1052c4['countdropretry'];this[_0x8f98('0x11')]=_0x1052c4['countabandonedretry'];this[_0x8f98('0xe')]=_0x1052c4[_0x8f98('0xe')];this[_0x8f98('0xf')]=_0x1052c4[_0x8f98('0xf')];this[_0x8f98('0x12')]=_0x1ba9d9['uniqueid'];this[_0x8f98('0x13')]=_0x1052c4[_0x8f98('0x14')];this['calleridnum']=_0x1052c4[_0x8f98('0x15')];this[_0x8f98('0x16')]=_0x1052c4[_0x8f98('0x16')];this['responsetime']=_0x1052c4[_0x8f98('0x17')];this[_0x8f98('0x18')]=moment()['format'](_0x8f98('0x19'));this['ringtime']=getSeconds(_0x1052c4['responsetime'],_0x1052c4[_0x8f98('0x16')]);this[_0x8f98('0x1a')]=0x0;this['talktime']=getSeconds(this[_0x8f98('0x18')],_0x1052c4[_0x8f98('0x17')]);this[_0x8f98('0x1b')]=_0x1052c4[_0x8f98('0x1b')];this['membername']=_0x8f98('0x1c');this[_0x8f98('0x1d')]=_0x1ba9d9['cause-txt'];this['callback']=_0x1052c4[_0x8f98('0x1e')];this[_0x8f98('0x1f')]=_0x1052c4['callbackuniqueid'];this[_0x8f98('0x20')]=_0x1052c4[_0x8f98('0x20')];this[_0x8f98('0x21')]=_0x1052c4[_0x8f98('0x21')];this[_0x8f98('0x22')]=_0x1052c4[_0x8f98('0x22')];this[_0x8f98('0x23')]=_0x1052c4[_0x8f98('0x23')];this[_0x8f98('0x24')]=_0x1052c4['UserId'];this['VoiceQueueId']=_0x1052c4[_0x8f98('0x25')];this[_0x8f98('0x26')]=_0x1052c4[_0x8f98('0x26')];}module[_0x8f98('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 2fb4404..ce63874 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 _0xc69b=['lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0xc69b,0x1d3));var _0xbc69=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0xc69b[_0x56138f];return _0x1acaf7;};'use strict';var util=require(_0xbc69('0x0'));var _=require(_0xbc69('0x1'));var moment=require('moment');function getSeconds(_0x3f1ece,_0x13eb39){var _0x6cb786=moment(_0x3f1ece)[_0xbc69('0x2')](0x0);var _0x1dec2b=moment(_0x13eb39)[_0xbc69('0x2')](0x0);return _0x6cb786[_0xbc69('0x3')](_0x1dec2b,_0xbc69('0x4'));}function History(_0xbe53ea){this[_0xbc69('0x5')]=_0xbe53ea[_0xbc69('0x5')];this['scheduledat']=_0xbe53ea[_0xbc69('0x6')]||undefined;this[_0xbc69('0x7')]=_0xbe53ea[_0xbc69('0x7')];this[_0xbc69('0x8')]=_0xbe53ea['type']===_0xbc69('0x9')?_0xbc69('0xa'):_0xbe53ea[_0xbc69('0x7')];this['countbusyretry']=_0xbe53ea[_0xbc69('0xb')];this['countcongestionretry']=_0xbe53ea['countcongestionretry'];this[_0xbc69('0xc')]=_0xbe53ea['countnoanswerretry'];this[_0xbc69('0xd')]=_0xbe53ea[_0xbc69('0xb')]+_0xbe53ea['countcongestionretry']+_0xbe53ea[_0xbc69('0xc')]+_0xbe53ea[_0xbc69('0xe')]+_0xbe53ea[_0xbc69('0xf')]+_0xbe53ea[_0xbc69('0x10')]+_0xbe53ea[_0xbc69('0x11')]+_0xbe53ea[_0xbc69('0x12')];this[_0xbc69('0xe')]=_0xbe53ea[_0xbc69('0xe')];this[_0xbc69('0xf')]=_0xbe53ea[_0xbc69('0xf')];this['countabandonedretry']=_0xbe53ea[_0xbc69('0x10')];this[_0xbc69('0x11')]=_0xbe53ea[_0xbc69('0x11')];this[_0xbc69('0x12')]=_0xbe53ea[_0xbc69('0x12')];this['queue']=_0xbe53ea['queue'];this[_0xbc69('0x13')]=_0xbe53ea[_0xbc69('0x14')];this[_0xbc69('0x15')]=_0xbe53ea['number'];this['starttime']=_0xbe53ea[_0xbc69('0x16')];this[_0xbc69('0x17')]=_0xbe53ea[_0xbc69('0x17')];this[_0xbc69('0x18')]=_0xbe53ea[_0xbc69('0x17')];this[_0xbc69('0x19')]=getSeconds(_0xbe53ea[_0xbc69('0x17')],_0xbe53ea[_0xbc69('0x16')]);this['holdtime']=0x0;this[_0xbc69('0x1a')]=0x0;this[_0xbc69('0x1b')]=_0xbe53ea[_0xbc69('0x1b')];this[_0xbc69('0x1c')]=_0xbe53ea[_0xbc69('0x1c')];this['callbackat']=_0xbe53ea[_0xbc69('0x1d')];this[_0xbc69('0x1e')]=_0xbe53ea[_0xbc69('0x1e')];this[_0xbc69('0x1f')]=_0xbe53ea[_0xbc69('0x1f')];this['ListId']=_0xbe53ea[_0xbc69('0x20')];this[_0xbc69('0x21')]=_0xbe53ea[_0xbc69('0x21')];this[_0xbc69('0x22')]=_0xbe53ea['VoiceQueueId'];this[_0xbc69('0x23')]=_0xbe53ea[_0xbc69('0x23')];this[_0xbc69('0x24')]=_0xbe53ea[_0xbc69('0x24')]||'';this[_0xbc69('0x25')]=_0xbe53ea[_0xbc69('0x25')]||'';}module[_0xbc69('0x26')]=History; \ No newline at end of file +var _0x4f17=['callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime'];(function(_0x1b49ae,_0x4326a6){var _0x29c4a1=function(_0x1e7598){while(--_0x1e7598){_0x1b49ae['push'](_0x1b49ae['shift']());}};_0x29c4a1(++_0x4326a6);}(_0x4f17,0x9e));var _0x74f1=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x4f17[_0x2e249d];return _0x1faa37;};'use strict';var util=require(_0x74f1('0x0'));var _=require('lodash');var moment=require(_0x74f1('0x1'));function getSeconds(_0xfcf99c,_0x589695){var _0x3c2d69=moment(_0xfcf99c)[_0x74f1('0x2')](0x0);var _0x3f16b2=moment(_0x589695)[_0x74f1('0x2')](0x0);return _0x3c2d69[_0x74f1('0x3')](_0x3f16b2,'seconds');}function History(_0x5e67b0){this[_0x74f1('0x4')]=_0x5e67b0['uniqueid'];this[_0x74f1('0x5')]=_0x5e67b0['scheduledat']||undefined;this[_0x74f1('0x6')]=_0x5e67b0[_0x74f1('0x6')];this[_0x74f1('0x7')]=_0x5e67b0['type']===_0x74f1('0x8')?'queue':_0x5e67b0[_0x74f1('0x6')];this['countbusyretry']=_0x5e67b0[_0x74f1('0x9')];this[_0x74f1('0xa')]=_0x5e67b0['countcongestionretry'];this['countnoanswerretry']=_0x5e67b0[_0x74f1('0xb')];this[_0x74f1('0xc')]=_0x5e67b0[_0x74f1('0x9')]+_0x5e67b0[_0x74f1('0xa')]+_0x5e67b0[_0x74f1('0xb')]+_0x5e67b0[_0x74f1('0xd')]+_0x5e67b0[_0x74f1('0xe')]+_0x5e67b0[_0x74f1('0xf')]+_0x5e67b0[_0x74f1('0x10')]+_0x5e67b0[_0x74f1('0x11')];this['countnosuchnumberretry']=_0x5e67b0[_0x74f1('0xd')];this['countdropretry']=_0x5e67b0[_0x74f1('0xe')];this['countabandonedretry']=_0x5e67b0[_0x74f1('0xf')];this[_0x74f1('0x10')]=_0x5e67b0[_0x74f1('0x10')];this[_0x74f1('0x11')]=_0x5e67b0[_0x74f1('0x11')];this['queue']=_0x5e67b0[_0x74f1('0x12')];this[_0x74f1('0x13')]=_0x5e67b0['name'];this[_0x74f1('0x14')]=_0x5e67b0[_0x74f1('0x15')];this['starttime']=_0x5e67b0[_0x74f1('0x16')];this[_0x74f1('0x17')]=_0x5e67b0[_0x74f1('0x17')];this[_0x74f1('0x18')]=_0x5e67b0[_0x74f1('0x17')];this['ringtime']=getSeconds(_0x5e67b0[_0x74f1('0x17')],_0x5e67b0[_0x74f1('0x16')]);this[_0x74f1('0x19')]=0x0;this[_0x74f1('0x1a')]=0x0;this[_0x74f1('0x1b')]=_0x5e67b0[_0x74f1('0x1b')];this['callbackuniqueid']=_0x5e67b0['callbackuniqueid'];this['callbackat']=_0x5e67b0[_0x74f1('0x1c')];this[_0x74f1('0x1d')]=_0x5e67b0[_0x74f1('0x1d')];this[_0x74f1('0x1e')]=_0x5e67b0[_0x74f1('0x1e')];this[_0x74f1('0x1f')]=_0x5e67b0[_0x74f1('0x1f')];this[_0x74f1('0x20')]=_0x5e67b0[_0x74f1('0x20')];this[_0x74f1('0x21')]=_0x5e67b0[_0x74f1('0x21')];this['CampaignId']=_0x5e67b0['CampaignId'];this[_0x74f1('0x22')]=_0x5e67b0[_0x74f1('0x22')]||'';this[_0x74f1('0x23')]=_0x5e67b0[_0x74f1('0x23')]||'';}module[_0x74f1('0x24')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 464c373..2d0bf16 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 _0xbbad=['outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','diff','clearing\x20variable\x20start\x20progressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','ivr','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','campaigns','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','hasOwnProperty','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','xcally-motion-dialer','dialAMDActive','value','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','agent','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','paused','stateinterface','locked','rrmemory','push','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','pick','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','content','indexOf','true','iftime\x20%s,%s','all','some','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','\x5cw{0,','pow','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','entity\x20is\x20undefine','object','reason','custom:agentnosuchnumber','buildObj','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Abandoned','reason\x2011\x20abandoned','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[callProgressDetecting]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dropRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','predictiveIntervalPauses','[handlePredictive]','fail\x20to\x20scheduled\x20calls','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','Contact\x20updated','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','dialOrderByScheduledAt','RUNNING','[actionOriginate]\x20','checkContactBlack','dialLimitQueue','not_inuse','Contact.phone','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','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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]','exports','util','lodash','uuid','moment','../../../config/environment/','../../../config/logger','booked','predictive','syncQueueSummary','../ami','redis','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./hangup','env','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','[ifTime][Action]','stringify','milliseconds','seconds','emit','strategy','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay'];(function(_0x565135,_0x330bd8){var _0x8af1c7=function(_0x4dd1b7){while(--_0x4dd1b7){_0x565135['push'](_0x565135['shift']());}};_0x8af1c7(++_0x330bd8);}(_0xbbad,0x1c0));var _0xdbba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbad[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xdbba('0x0'));var _=require(_0xdbba('0x1'));var BPromise=require('bluebird');var uuid=require(_0xdbba('0x2'));var moment=require(_0xdbba('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require(_0xdbba('0x4'));var logger=require(_0xdbba('0x5'))('dialer');var loggerBooked=require(_0xdbba('0x5'))(_0xdbba('0x6'));var loggerPredictive=require(_0xdbba('0x5'))(_0xdbba('0x7'));var loggerPredictiveCalls=require(_0xdbba('0x5'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xdbba('0x5'))(_0xdbba('0x8'));var ami=require(_0xdbba('0x9'));config[_0xdbba('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xdbba('0xb'))(new Redis(config[_0xdbba('0xa')]));var cmHopper=require(_0xdbba('0xc'));var cmHopperFinal=require(_0xdbba('0xd'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xdbba('0xe'));var voiceQueueRt=require(_0xdbba('0xf'));var Action=require(_0xdbba('0x10'));var History=require(_0xdbba('0x11'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xdbba('0x12'));var ipAgi=process[_0xdbba('0x13')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0xdbba('0x14')};var Sequence=function(){};Sequence['prototype'][_0xdbba('0x15')]=function(_0xd50284){this[_0xdbba('0x16')]=this[_0xdbba('0x16')]?this[_0xdbba('0x16')][_0xdbba('0x17')](_0xd50284):_0xd50284();};function Dialer(_0x16484b,_0x2bae9d){this[_0xdbba('0x18')]=new Sequence();this[_0xdbba('0x19')]=_0x2bae9d;this['voiceQueues']=_0x16484b[_0xdbba('0x1a')];this['campaigns']=_0x16484b['campaigns'];this[_0xdbba('0x1b')]=_0x16484b[_0xdbba('0x1b')];this[_0xdbba('0x1c')]=_0x16484b[_0xdbba('0x1c')];this[_0xdbba('0x1d')]=config[_0xdbba('0x1d')]||0x2;this[_0xdbba('0x1e')]={};this[_0xdbba('0x1f')]={};this[_0xdbba('0x20')]={};this['uniqueId']={};this[_0xdbba('0x21')]={};this['startPredictive']={};this[_0xdbba('0x22')]={};this['ivrOriginated']={};this[_0xdbba('0x23')]={};this[_0xdbba('0x24')]={};ami['on'](_0xdbba('0x25'),this[_0xdbba('0x26')][_0xdbba('0x27')](this));ami['on']('queuecallerabandon',this[_0xdbba('0x28')][_0xdbba('0x27')](this));ami['on'](_0xdbba('0x29'),this['syncOriginateResponse'][_0xdbba('0x27')](this));ami['on']('agentcomplete',this[_0xdbba('0x2a')][_0xdbba('0x27')](this));ami['on'](_0xdbba('0x2b'),this['syncQueueSummary'][_0xdbba('0x27')](this));ami['on'](_0xdbba('0x2c'),this[_0xdbba('0x2d')][_0xdbba('0x27')](this));ami['on'](_0xdbba('0x2e'),this[_0xdbba('0x2f')][_0xdbba('0x27')](this));ami['on'](_0xdbba('0x30'),this[_0xdbba('0x31')]['bind'](this));ami['on'](_0xdbba('0x32'),this['syncQueueMember'][_0xdbba('0x27')](this));ami['on'](_0xdbba('0x33'),this['syncQueueStatusComplete'][_0xdbba('0x27')](this));this[_0xdbba('0x34')]();this[_0xdbba('0x35')]();}function isNotNull(_0x506110){return _0x506110!==null&&!_[_0xdbba('0x36')](_0x506110);}function checkIsLoggedIn(_0x383185,_0x45dfeb){return function(){if(_0x45dfeb<=0x0){_0x383185[_0xdbba('0x37')]=_0xdbba('0x38');throw _0x383185['name']+_0xdbba('0x39');}};}function isActive(_0x2a43bb){return _0x2a43bb;}function checkIsActive(_0x392e3b,_0x19426f){return function(){if(!isActive(_0x19426f)){_0x392e3b[_0xdbba('0x37')]=_0xdbba('0x3a');throw _0x392e3b[_0xdbba('0x3b')]+_0xdbba('0x3c');}};}function checkInterval(_0x5c4c56){return function(){if(!isNotNull(_0x5c4c56['Interval'])){_0x5c4c56[_0xdbba('0x37')]=_0xdbba('0x3d');throw _0x5c4c56[_0xdbba('0x3b')]+_0xdbba('0x3e');}if(!isNotNull(_0x5c4c56[_0xdbba('0x3f')]['Intervals'])){_0x5c4c56[_0xdbba('0x37')]=_0xdbba('0x3d');throw _0x5c4c56['name']+_0xdbba('0x3e');}if(!isNotNull(_[_0xdbba('0x40')](_0x5c4c56['Interval'][_0xdbba('0x41')]))){_0x5c4c56[_0xdbba('0x37')]='INTERVAL_IS_NULL';throw _0x5c4c56[_0xdbba('0x3b')]+_0xdbba('0x3e');}};}function msgResponse(_0x215fce,_0x1f5e53,_0x458556){return{'action':_0x215fce,'response':_0x1f5e53,'message':_0x458556,'stack':_0x458556};}function myreject(_0x10d376){return function(_0x339fa2){return _0x10d376(msgResponse(_0xdbba('0x42'),'Error',JSON[_0xdbba('0x43')](_0x339fa2)));};}function getSeconds(_0x1f2b41,_0x15dfe4){var _0x24a54e=moment(_0x1f2b41)[_0xdbba('0x44')](0x0);var _0x2e8a71=moment(_0x15dfe4)[_0xdbba('0x44')](0x0);return _0x24a54e['diff'](_0x2e8a71,_0xdbba('0x45'));}function emit(_0x196e7f,_0x3e1268,_0x58737d){io['to'](_0x196e7f)[_0xdbba('0x46')](_0x3e1268,_0x58737d);}function emitVoiceQueueSummary(_0x278731){if(_0x278731['type']==='outbound'){var _0x906347={'id':_0x278731['id'],'name':_0x278731[_0xdbba('0x3b')],'strategy':_0x278731[_0xdbba('0x47')],'answered':_0x278731['answered'],'available':_0x278731[_0xdbba('0x48')],'loggedIn':_0x278731[_0xdbba('0x49')],'pTalking':_0x278731[_0xdbba('0x4a')],'sumBillable':_0x278731[_0xdbba('0x4b')],'sumDuration':_0x278731['sumDuration'],'sumHoldTime':_0x278731[_0xdbba('0x4c')]||0x0,'talking':_0x278731[_0xdbba('0x4d')],'total':_0x278731[_0xdbba('0x4e')],'type':_0x278731[_0xdbba('0x4f')],'unmanaged':_0x278731[_0xdbba('0x50')],'abandoned':_0x278731['abandoned'],'waiting':_0x278731[_0xdbba('0x51')],'loggedInDb':_0x278731[_0xdbba('0x52')],'dialActive':_0x278731[_0xdbba('0x53')],'dialMethod':_0x278731[_0xdbba('0x54')],'dialOriginateCallerIdName':_0x278731[_0xdbba('0x55')],'dialOriginateCallerIdNumber':_0x278731['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x278731['dialOriginateTimeout'],'dialPrefix':_0x278731[_0xdbba('0x56')],'outboundAnswerAgiCallsDay':_0x278731[_0xdbba('0x57')],'outboundAnswerCallsDay':_0x278731[_0xdbba('0x58')],'outboundBlacklistCallsDay':_0x278731[_0xdbba('0x59')],'outboundBusyCallsDay':_0x278731[_0xdbba('0x5a')],'outboundCongestionCallsDay':_0x278731[_0xdbba('0x5b')],'outboundDropCallsDayACS':_0x278731['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x278731[_0xdbba('0x5c')],'outboundDropCallsDayTimeout':_0x278731[_0xdbba('0x5d')],'outboundNoAnswerCallsDay':_0x278731[_0xdbba('0x5e')],'outboundNoSuchCallsDay':_0x278731[_0xdbba('0x5f')],'outboundOriginateFailureCallsDay':_0x278731[_0xdbba('0x60')],'outboundReCallsDay':_0x278731[_0xdbba('0x61')],'outboundRejectCallsDay':_0x278731[_0xdbba('0x62')],'outboundUnknownCallsDay':_0x278731[_0xdbba('0x63')],'predictiveIntervalAnsweredCalls':_0x278731[_0xdbba('0x64')],'predictiveIntervalAvgHoldtime':_0x278731[_0xdbba('0x65')],'predictiveIntervalAvgTalktime':_0x278731[_0xdbba('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x278731['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x278731[_0xdbba('0x67')],'predictiveIntervalErlangCalls':_0x278731[_0xdbba('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0x278731[_0xdbba('0x69')],'predictiveIntervalHitRate':_0x278731['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x278731[_0xdbba('0x6a')],'predictiveIntervalPauses':_0x278731['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x278731[_0xdbba('0x6b')],'predictiveIntervalTotalCalls':_0x278731['predictiveIntervalTotalCalls'],'message':_0x278731['message'],'originated':_0x278731['originated'],'erlangCalls':_0x278731[_0xdbba('0x6c')],'erlangCallToSecond':_0x278731[_0xdbba('0x6d')],'erlangAbandonmentRate':_0x278731[_0xdbba('0x6e')],'erlangBusyFactor':_0x278731[_0xdbba('0x6f')],'startPredictive':_0x278731['startPredictive'],'startProgressive':_0x278731[_0xdbba('0x22')]};if(_0x278731[_0xdbba('0x70')]){_0x906347[_0xdbba('0x70')]={'id':_0x278731[_0xdbba('0x70')]['id'],'name':_0x278731[_0xdbba('0x70')][_0xdbba('0x3b')],'active':_0x278731['Trunk'][_0xdbba('0x71')],'callerid':_0x278731[_0xdbba('0x70')][_0xdbba('0x72')]};}if(_0x278731[_0xdbba('0x3f')]){_0x906347[_0xdbba('0x3f')]={'id':_0x278731[_0xdbba('0x3f')]['id'],'name':_0x278731[_0xdbba('0x3f')][_0xdbba('0x3b')]};}var _0x2d3b67=md5(JSON[_0xdbba('0x43')](_0x906347));if(_0x278731[_0xdbba('0x73')]!==_0x2d3b67){_0x278731[_0xdbba('0x73')]=_0x2d3b67;emit(util[_0xdbba('0x74')](_0xdbba('0x75'),_0x906347[_0xdbba('0x3b')]),_0xdbba('0x76'),_0x906347);}}}function emitCampaignSummary(_0x151025){if(_0x151025[_0xdbba('0x4f')]==='ivr'){emit(util['format']('campaign:ivr:%s',_0x151025[_0xdbba('0x3b')]),_0xdbba('0x77'),_0x151025);}}function checkGetDataPredictive(_0x4c9c12){if(isNotNull(_0x4c9c12)){if(!_[_0xdbba('0x40')](_0x4c9c12)){loggerPredictive[_0xdbba('0x78')](_0xdbba('0x79'));loggerPredictive[_0xdbba('0x78')](_0xdbba('0x7a'),_0x4c9c12[_0xdbba('0x7b')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x7c'),_0x4c9c12[_0xdbba('0x64')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x7d'),_0x4c9c12[_0xdbba('0x67')]);loggerPredictive[_0xdbba('0x78')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c9c12[_0xdbba('0x7e')]);loggerPredictive[_0xdbba('0x78')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4c9c12[_0xdbba('0x65')]);loggerPredictive['info'](_0xdbba('0x7f'),_0x4c9c12[_0xdbba('0x66')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x80'));if(_0x4c9c12[_0xdbba('0x7b')]>0x0){if(!_[_0xdbba('0x36')](_0x4c9c12[_0xdbba('0x66')])&&_0x4c9c12[_0xdbba('0x66')]>0x0){return!![];}else{loggerPredictive['info'](_0xdbba('0x81'));}if(!_[_0xdbba('0x36')](_0x4c9c12[_0xdbba('0x65')])&&_0x4c9c12[_0xdbba('0x65')]>0x0){return!![];}else{loggerPredictive[_0xdbba('0x78')](_0xdbba('0x82'));}}else{loggerPredictive[_0xdbba('0x78')](_0xdbba('0x83'));}}else{loggerPredictive[_0xdbba('0x78')](_0xdbba('0x84'));}}else{loggerPredictive[_0xdbba('0x78')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x2a950c){return function(_0x46c957){loggerPredictive['info'](_0xdbba('0x85'));loggerPredictive['info'](_0xdbba('0x86'),_0x46c957[_0xdbba('0x6c')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x87'),_0x46c957[_0xdbba('0x6d')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x88'),_0x46c957['erlangAbandonmentRate']);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x89'),_0x46c957[_0xdbba('0x6f')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x88'),_0x46c957[_0xdbba('0x6e')]);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x80'));_[_0xdbba('0x8a')](_0x2a950c,_0x46c957);};}function getDiff(_0x25e3c8){var _0x5c083d=moment()[_0xdbba('0x44')](0x0);var _0x24703b=moment(_0x25e3c8)[_0xdbba('0x44')](0x0);return _0x5c083d[_0xdbba('0x8b')](_0x24703b,_0xdbba('0x45'));}function ifInterval(_0x5a50f4,_0x3dd6f1){if(_['isUndefined'](_0x3dd6f1)){return![];}if(getDiff(_0x3dd6f1)<_0x5a50f4*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xcd7254){if(isNotNull(_0xcd7254)){if(!_[_0xdbba('0x36')](_0xcd7254['startProgressive'])){_0xcd7254[_0xdbba('0x22')]=undefined;loggerPredictive[_0xdbba('0x78')](_0xcd7254[_0xdbba('0x3b')],_0xdbba('0x8c'));}if(!_['isUndefined'](_0xcd7254[_0xdbba('0x8d')])){_0xcd7254[_0xdbba('0x8d')]=undefined;loggerPredictive[_0xdbba('0x78')](_0xcd7254[_0xdbba('0x3b')],_0xdbba('0x8e'));}if(!_[_0xdbba('0x36')](_0xcd7254['handlePredictive'])){clearInterval(_0xcd7254[_0xdbba('0x8f')]);_0xcd7254[_0xdbba('0x8f')]=undefined;loggerPredictive['info'](_0xcd7254['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x9b3569,_0x395004){if(_0x395004===0x0){return 0x0;}var _0x163d4f=0x1;for(var _0x2c0b26=0x1;_0x2c0b26<=_0x395004;_0x2c0b26+=0x1){_0x163d4f=0x1+_0x163d4f*_0x2c0b26/_0x9b3569;}return 0x1/_0x163d4f;}function isVoiceQueueOutbound(_0x40b8b8){return _0x40b8b8===_0xdbba('0x90');}function isNotPreview(_0x15cc52){return _0x15cc52!==_0xdbba('0x19');}function isCampaignIvr(_0x188d30){return _0x188d30===_0xdbba('0x91');}function getCallerId(_0x466e25,_0x168459,_0x4f430d){if(!_[_0xdbba('0x36')](_0x4f430d)&&'string'===typeof _0x4f430d&&!_[_0xdbba('0x40')](_0x4f430d)){if(!_[_0xdbba('0x36')](_0x168459)&&'string'===typeof _0x168459&&!_['isEmpty'](_0x168459)){return util[_0xdbba('0x74')](_0xdbba('0x92'),_0x168459,_0x4f430d);}return util['format']('\x22%s\x22\x20<%s>',_0x4f430d,_0x4f430d);}if(!_['isUndefined'](_0x466e25)&&'string'===typeof _0x466e25&&!_['isEmpty'](_0x466e25)){return _0x466e25;}return _0xdbba('0x93');}function loggerCatchQueueSummary(_0xc8f96d,_0x4115ff){return function(_0x51e854){freeVariablesPredictive(_0x4115ff);emitVoiceQueueSummary(_0x4115ff);emitCampaignSummary(_0x4115ff);loggerSyncQueueSummary[_0xdbba('0x94')](_0xc8f96d,util[_0xdbba('0x95')](_0x51e854,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4db79f,_0x4e153c){return function(_0x19e145){loggerPredictive['error'](_0x4e153c['name'],_0x4db79f);loggerPredictive[_0xdbba('0x94')](_0x19e145[_0xdbba('0x96')]);freeVariablesPredictive(_0x4e153c);};}function loggerCatch(_0x182cf9){return function(_0x4a7950){logger[_0xdbba('0x94')](_0x182cf9,util[_0xdbba('0x95')](_0x4a7950,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x6e9707){return _0x6e9707&&!_[_0xdbba('0x36')](_0x6e9707)&&_0x6e9707[_0xdbba('0x97')]>0x0;}function decremetOriginate(_0x21bdea){if(!_[_0xdbba('0x36')](_0x21bdea)&&_0x21bdea!==null){if(_0x21bdea['hasOwnProperty'](_0xdbba('0x98'))){if(_0x21bdea['originated']>0x0){_0x21bdea[_0xdbba('0x98')]-=0x1;}else{logger[_0xdbba('0x94')](_0xdbba('0x99'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2c6ea1,_0x27d183,_0x43310b){if(_0x27d183>_0x43310b){for(var _0x39e030=0x0;_0x39e030<_0x27d183-_0x43310b;_0x39e030+=0x1){decremetOriginate(_0x2c6ea1);}}}function loggerGetContactDialer(_0x961fef,_0x2868bd,_0x35beff){return function(_0x37722a){checkContactLowerLimitOriginate(_0x2868bd,_0x35beff,0x0);logger[_0xdbba('0x94')](_0x961fef,util[_0xdbba('0x95')](_0x37722a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4f7369){return function(_0x497634){if(isNotNull(_0x497634)&&isNotNull(_0x497634[0x0])){if(_0x497634[0x0][_0xdbba('0x9a')]>0x0){_0x4f7369[_0xdbba('0x37')]='RESCHEDULED_CONTACTS';logger[_0xdbba('0x78')](_0xdbba('0x9b')+_0x4f7369[_0xdbba('0x3b')],_0x497634[0x0][_0xdbba('0x9a')],_0xdbba('0x9c'));}else{_0x4f7369[_0xdbba('0x37')]=_0xdbba('0x9d');logger[_0xdbba('0x78')](_0xdbba('0x9e')+_0x4f7369[_0xdbba('0x3b')]);}}};}function notSendMessagesQueue(_0x2334bf){if(_0x2334bf['sendMessageOneNotActive']){freeVariablesPredictive(_0x2334bf);if(_0x2334bf[_0xdbba('0x98')]===0x0&&_0x2334bf[_0xdbba('0x4d')]===0x0&&_0x2334bf['waiting']===0x0&&(_0x2334bf[_0xdbba('0x4a')]||0x0)===0x0){_0x2334bf[_0xdbba('0x9f')]=![];_0x2334bf[_0xdbba('0x48')]=0x0;_0x2334bf[_0xdbba('0x37')]=_0xdbba('0x3a');loggerSyncQueueSummary['error'](_0xdbba('0xa0'),_0x2334bf['name'],'is\x20not\x20active');}else{_0x2334bf[_0xdbba('0x37')]=_0xdbba('0xa1');loggerSyncQueueSummary[_0xdbba('0x94')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2334bf[_0xdbba('0x3b')],'is\x20disactive');}emitVoiceQueueSummary(_0x2334bf);}}function notSendMessagesCampaign(_0x35c183){if(_0x35c183[_0xdbba('0x9f')]){if(_0x35c183[_0xdbba('0x98')]===0x0){_0x35c183['sendMessageOneNotActive']=![];_0x35c183['message']=_0xdbba('0x3a');loggerSyncQueueSummary[_0xdbba('0x94')](_0xdbba('0xa2'),_0x35c183[_0xdbba('0x3b')],'is\x20not\x20active');}else{_0x35c183[_0xdbba('0x37')]=_0xdbba('0xa1');loggerSyncQueueSummary[_0xdbba('0x94')](_0xdbba('0xa2'),_0x35c183[_0xdbba('0x3b')],'is\x20disactive');}emitCampaignSummary(_0x35c183);}}function createObjHistory(_0x15c2ae,_0x496038,_0x4b5562,_0x2dbd62,_0x138ad2){_0x15c2ae[_0xdbba('0x37')]=_0x4b5562;var _0x5a5b06=new Action(_0x15c2ae,_0x496038);var _0x1b53bf=new History(_0x5a5b06);_0x1b53bf[_0xdbba('0xa3')]=_0x2dbd62;_0x1b53bf[_0xdbba('0xa4')]=_0x138ad2;_0x1b53bf[_0xdbba('0xa5')]=_0x5a5b06[_0xdbba('0xa6')];return _0x1b53bf;}Dialer[_0xdbba('0xa7')]['loopClearZombieChannels']=function(){var _0x14e019=this;setInterval(function(){_0x14e019[_0xdbba('0xa8')](_0x14e019[_0xdbba('0xa9')],_0xdbba('0xaa'));_0x14e019[_0xdbba('0xa8')](_0x14e019[_0xdbba('0x1f')],_0xdbba('0xab'));},0x32c8);};Dialer[_0xdbba('0xa7')]['clearZombieChannels']=function(_0x277c62,_0x5e3d99){var _0x29ec10=this;for(var _0x4e2cb7 in _0x277c62){if(_0x277c62['hasOwnProperty'](_0x4e2cb7)){this[_0xdbba('0x18')][_0xdbba('0x15')](function(){if(!_[_0xdbba('0xac')](_0x277c62[_0x4e2cb7])){return ami[_0xdbba('0xad')]({'action':_0xdbba('0xae'),'channel':_0x277c62[_0x4e2cb7][_0xdbba('0xaf')]})[_0xdbba('0xb0')](function(_0xb8e98a){if(_0xb8e98a[_0xdbba('0x37')]===_0xdbba('0xb1')){setTimeout(function(){if(_0x277c62[_0x4e2cb7]&&_0x277c62[_0x4e2cb7][_0xdbba('0x4f')]!=='ivr'){_0x29ec10[_0xdbba('0xb2')](_0x29ec10[_0xdbba('0x1a')][_0x277c62[_0x4e2cb7][_0xdbba('0xb3')]]);logger[_0xdbba('0x94')]('[Dialer][checkChannel]',_0x5e3d99,_0x4e2cb7,_0x277c62[_0x4e2cb7]['queue']);delete _0x277c62[_0x4e2cb7];}if(_0x277c62[_0x4e2cb7]&&_0x277c62[_0x4e2cb7][_0xdbba('0x4f')]===_0xdbba('0x91')){_0x29ec10['updateOriginated'](_0x29ec10[_0xdbba('0xb4')][_0x277c62[_0x4e2cb7]['queue']]);logger[_0xdbba('0x94')](_0xdbba('0xb5'),_0x5e3d99,_0x4e2cb7,_0x277c62[_0x4e2cb7][_0xdbba('0xb3')]);delete _0x277c62[_0x4e2cb7];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0xb8f43b){return BPromise[_0xdbba('0xb6')]()[_0xdbba('0xb7')](cmHopper[_0xdbba('0xb8')](_0xb8f43b))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xb9')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xba')]=function(_0x54f0bb){return BPromise['resolve']()[_0xdbba('0xb7')](cmHopperBlack['checkIsBlackList'](_0x54f0bb))['catch'](loggerCatch(_0xdbba('0xbb')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xbc')]=function(_0x5bc799){return BPromise['resolve']()[_0xdbba('0xb7')](cmHopperBlack['checkIsBlackListIvr'](_0x5bc799))['catch'](loggerCatch(_0xdbba('0xbd')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xbe')]=function(_0x55d0f7){return BPromise[_0xdbba('0xb6')]()[_0xdbba('0xb7')](cmHopperHistory[_0xdbba('0xbf')](_0x55d0f7))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xc0')));};Dialer[_0xdbba('0xa7')]['rescheduleContact']=function(_0x49b8f0){return BPromise[_0xdbba('0xb6')]()['then'](cmHopper[_0xdbba('0xc1')](_0x49b8f0))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xc2')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xc3')]=function(_0x23e85c,_0x13dc65,_0x32fcfc){return BPromise['resolve']()[_0xdbba('0xb7')](cmHopper[_0xdbba('0xc3')](_0x23e85c,_0x13dc65,_0x32fcfc))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xc4')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xc5')]=function(_0x117432,_0x6fb7ae,_0x3ae4f4,_0x50cccb){return BPromise['resolve']()['then'](cmHopper[_0xdbba('0xc5')](_0x117432,_0x6fb7ae,_0x3ae4f4,_0x50cccb))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xc6')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xc7')]=function(_0x328400,_0xf32f0,_0x55ebf3){return BPromise[_0xdbba('0xb6')]()[_0xdbba('0xb7')](cmHopper[_0xdbba('0xc7')](_0x328400,_0xf32f0,_0x55ebf3))['catch'](loggerCatch(_0xdbba('0xc6')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xc8')]=function(_0xebdfa6){return BPromise['resolve']()[_0xdbba('0xb7')](voiceQueueRt[_0xdbba('0xc8')](_0xebdfa6))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xc9')));};Dialer[_0xdbba('0xa7')][_0xdbba('0xca')]=function(_0x1296a7){return BPromise[_0xdbba('0xb6')]()['then'](cmHopper[_0xdbba('0xca')](_0x1296a7))[_0xdbba('0xb0')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0xdbba('0xcb')]=function(_0x3f4b3e){return BPromise['resolve']()[_0xdbba('0xb7')](cmHopperHistory[_0xdbba('0xcb')](_0x3f4b3e))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xcc')));};Dialer['prototype']['updateOriginated']=function(_0x56e8cf){if(!_[_0xdbba('0x36')](_0x56e8cf)&&_0x56e8cf!==null){if(_0x56e8cf[_0xdbba('0xcd')]('originated')){if(_0x56e8cf[_0xdbba('0x98')]>0x0){_0x56e8cf[_0xdbba('0x98')]-=0x1;}else{logger['error'](_0xdbba('0xce'));}}}else{logger['error'](_0xdbba('0xcf'));}};Dialer['prototype'][_0xdbba('0xd0')]=function(_0x11a61e,_0x5df849){var _0x25b72a=this;return function(_0x361e9c){_0x25b72a['updateOriginated'](_0x5df849);logger[_0xdbba('0x94')](_0x11a61e,util[_0xdbba('0x95')](_0x361e9c,{'showHidden':![],'depth':null}));};};Dialer[_0xdbba('0xa7')][_0xdbba('0xd1')]=function(_0x2000ab,_0x187582,_0x5455c7){var _0x4c822a={'state':0x19,'statedesc':_0xdbba('0xd2')};this['updateOriginated'](_0x187582);this[_0xdbba('0xd3')](_[_0xdbba('0x8a')](_0x4c822a,_['pick'](_0x5455c7,[_0xdbba('0xd4'),_0xdbba('0xd5'),'UserId',_0xdbba('0xd6'),'CampaignId'])),_0xdbba('0xd7'),_0xdbba('0xd8'));logger[_0xdbba('0x94')](_0x2000ab);};Dialer[_0xdbba('0xa7')][_0xdbba('0xd9')]=function(_0x5905bd){return _0x5905bd===_0xdbba('0xda');};Dialer[_0xdbba('0xa7')][_0xdbba('0xdb')]=function(_0x536cd1){return!_[_0xdbba('0x36')](_0x536cd1)&&_0x536cd1&&!_[_0xdbba('0x36')](_0x536cd1['name'])&&!_[_0xdbba('0x36')](_0x536cd1[_0xdbba('0x71')])&&_0x536cd1[_0xdbba('0x71')]&&(this[_0xdbba('0x1c')][util[_0xdbba('0x74')](_0xdbba('0xdc'),_0x536cd1['name'])][_0xdbba('0xae')]===_0xdbba('0xdd')||this[_0xdbba('0x1c')][util[_0xdbba('0x74')]('SIP/%s',_0x536cd1['name'])][_0xdbba('0xae')]===_0xdbba('0xde'));};Dialer[_0xdbba('0xa7')]['saveInDb']=function(_0x25011d,_0x1f13a5,_0x5e4035){this[_0xdbba('0xcb')](_0x25011d)[_0xdbba('0xb0')](loggerCatch(_0x1f13a5));this[_0xdbba('0xca')](_0x25011d)[_0xdbba('0xb0')](loggerCatch(_0x5e4035));};Dialer[_0xdbba('0xa7')][_0xdbba('0x31')]=function(_0x43138a){var _0x517120=this[_0xdbba('0xa9')][_0x43138a[_0xdbba('0xdf')]];var _0x6d8c6e;if(!_[_0xdbba('0xac')](_0x43138a)&&!_[_0xdbba('0xac')](_0x43138a['variable'])&&!_[_0xdbba('0xac')](_0x43138a['variable']['amdstatus'])&&_0x43138a['exten']===_0xdbba('0xe0')&&_0x517120){if(_0x517120[_0xdbba('0x4f')]!==_0xdbba('0x91')&&this[_0xdbba('0x1a')][_0x517120['queue']][_0xdbba('0xe1')]&&_0x43138a[_0xdbba('0xe2')]==='HANGUP'){delete this[_0xdbba('0xa9')][_0x43138a[_0xdbba('0xdf')]];this[_0xdbba('0xb2')](this[_0xdbba('0x1a')][_0x517120[_0xdbba('0xb3')]]);this[_0xdbba('0x1a')][_0x517120[_0xdbba('0xb3')]][_0xdbba('0x58')]+=0x1;this[_0xdbba('0x1a')][_0x517120['queue']][_0xdbba('0x57')]+=0x1;_0x6d8c6e=new Hangup(_0x517120,_0x43138a);_0x6d8c6e[_0xdbba('0xa3')]=0x12;_0x6d8c6e[_0xdbba('0xa4')]='HangupInAMD';_0x6d8c6e[_0xdbba('0xe3')]=_0xdbba('0xe4');this['saveInDb'](_0x6d8c6e,_0xdbba('0xe5'),_0xdbba('0xe6'));}if(_0x517120['type']!==_0xdbba('0x91')&&this[_0xdbba('0x1a')][_0x517120['queue']][_0xdbba('0xe1')]&&_0x43138a[_0xdbba('0xe2')]===_0xdbba('0xe7')){var _0x52298a=this;return new BPromise(function(_0x3b7e84,_0x5d3b3a){delete _0x52298a[_0xdbba('0xa9')][_0x43138a[_0xdbba('0xdf')]];_0x52298a[_0xdbba('0xb2')](_0x52298a[_0xdbba('0x1a')][_0x517120['queue']]);_0x52298a['voiceQueues'][_0x517120[_0xdbba('0xb3')]][_0xdbba('0x58')]+=0x1;_0x52298a[_0xdbba('0x1a')][_0x517120['queue']][_0xdbba('0x57')]+=0x1;var _0x5d3fb4=_0x52298a['voiceQueues'][_0x517120[_0xdbba('0xb3')]];var _0x232111=new Hangup(_0x517120,_0x43138a);_0x232111[_0xdbba('0xa3')]=0x13;_0x232111[_0xdbba('0xa4')]=_0xdbba('0xe8');_0x232111[_0xdbba('0xe3')]=_0xdbba('0xe4');_0x232111[_0xdbba('0xe9')]+=0x1;_0x232111[_0xdbba('0xea')]+=0x1;_0x232111[_0xdbba('0xeb')]=!![];_0x52298a[_0xdbba('0xcb')](_0x232111)['catch'](loggerCatch(_0xdbba('0xec')));if(_0x232111[_0xdbba('0xed')]+_0x232111[_0xdbba('0xee')]+_0x232111[_0xdbba('0xef')]+_0x232111[_0xdbba('0xf0')]+_0x232111[_0xdbba('0xf1')]+_0x232111[_0xdbba('0xf2')]+_0x232111[_0xdbba('0xe9')]+_0x232111[_0xdbba('0xf3')]>=_0x5d3fb4[_0xdbba('0xf4')]){_0x52298a[_0xdbba('0xf5')](_0x232111,_0x3b7e84,_0x5d3b3a,_0xdbba('0xf6'));}else{if(_0x232111[_0xdbba('0xe9')]>=_0x5d3fb4[_0xdbba('0xf7')]){_0x52298a[_0xdbba('0xf8')](_0x232111,_0x3b7e84,_0x5d3b3a,_0xdbba('0xf9'));}else{_0x52298a[_0xdbba('0xc1')]({'active':![],'countmachineretry':_0x232111[_0xdbba('0xe9')],'scheduledat':moment()[_0xdbba('0xfa')](_0x5d3fb4[_0xdbba('0xfb')],_0xdbba('0xfc'))[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x232111[_0xdbba('0xd4')],'ListId':_0x232111[_0xdbba('0xd5')],'VoiceQueueId':_0x232111[_0xdbba('0xd6')]||undefined,'CampaignId':_0x232111[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xff')));_0x3b7e84({'reschedule':0x1});}}});}if(_0x517120[_0xdbba('0x4f')]==='ivr'&&this[_0xdbba('0xb4')][_0x517120[_0xdbba('0xb3')]][_0xdbba('0xe1')]&&_0x43138a[_0xdbba('0xe2')]==='HANGUP'){delete this[_0xdbba('0xa9')][_0x43138a[_0xdbba('0xdf')]];this[_0xdbba('0xb2')](this[_0xdbba('0xb4')][_0x517120[_0xdbba('0xb3')]]);_0x6d8c6e=new Hangup(_0x517120,_0x43138a);_0x6d8c6e['state']=0x12;_0x6d8c6e[_0xdbba('0xa4')]=_0xdbba('0x100');_0x6d8c6e[_0xdbba('0xe3')]=_0xdbba('0xe4');this[_0xdbba('0xd3')](_0x6d8c6e,_0xdbba('0x101'),_0xdbba('0x102'));}if(_0x517120[_0xdbba('0x4f')]===_0xdbba('0x91')&&this[_0xdbba('0xb4')][_0x517120[_0xdbba('0xb3')]][_0xdbba('0xe1')]&&_0x43138a[_0xdbba('0xe2')]===_0xdbba('0xe7')){var _0x52298a=this;return new BPromise(function(_0x23fbce,_0x5cc6ee){delete _0x52298a[_0xdbba('0xa9')][_0x43138a[_0xdbba('0xdf')]];_0x52298a[_0xdbba('0xb2')](_0x52298a['campaigns'][_0x517120[_0xdbba('0xb3')]]);_0x52298a[_0xdbba('0xb4')][_0x517120[_0xdbba('0xb3')]][_0xdbba('0x58')]+=0x1;_0x52298a[_0xdbba('0xb4')][_0x517120[_0xdbba('0xb3')]][_0xdbba('0x57')]+=0x1;var _0x423005=_0x52298a['campaigns'][_0x517120['queue']];var _0x310b51=new Hangup(_0x517120,_0x43138a);_0x310b51[_0xdbba('0xa3')]=0x13;_0x310b51[_0xdbba('0xa4')]='Machine';_0x310b51['membername']=_0xdbba('0xe4');_0x310b51[_0xdbba('0xe9')]+=0x1;_0x310b51['countglobal']+=0x1;_0x310b51[_0xdbba('0xeb')]=!![];_0x52298a['createHistory'](_0x310b51)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xec')));if(_0x310b51[_0xdbba('0xed')]+_0x310b51[_0xdbba('0xee')]+_0x310b51['countnoanswerretry']+_0x310b51[_0xdbba('0xf0')]+_0x310b51['countdropretry']+_0x310b51[_0xdbba('0xf2')]+_0x310b51[_0xdbba('0xe9')]+_0x310b51['countagentrejectretry']>=_0x423005[_0xdbba('0xf4')]){_0x52298a[_0xdbba('0xf5')](_0x310b51,_0x23fbce,_0x5cc6ee,'reason19\x20machine....');}else{if(_0x310b51['countmachineretry']>=_0x423005['dialMachineMaxRetry']){_0x52298a['createStateFinal'](_0x310b51,_0x23fbce,_0x5cc6ee,_0xdbba('0xf9'));}else{_0x52298a[_0xdbba('0xc1')]({'active':![],'countmachineretry':_0x310b51[_0xdbba('0xe9')],'scheduledat':moment()['add'](_0x423005['dialMachineRetryFrequency'],'minutes')['format'](_0xdbba('0xfd')),'ContactId':_0x310b51[_0xdbba('0xd4')],'ListId':_0x310b51[_0xdbba('0xd5')],'VoiceQueueId':_0x310b51['VoiceQueueId']||undefined,'CampaignId':_0x310b51[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xff')));_0x23fbce({'reschedule':0x1});}}});}}};Dialer[_0xdbba('0xa7')][_0xdbba('0x2d')]=function(_0x40080d){var _0x2ac46b=this[_0xdbba('0xa9')][_0x40080d['uniqueid']];var _0x36f6c5=this;var _0x3050b3;if(_0x2ac46b&&_0x2ac46b[_0xdbba('0x4f')]===_0xdbba('0x91')){delete this['uniqueId'][_0x40080d[_0xdbba('0xdf')]];this[_0xdbba('0xb2')](this[_0xdbba('0xb4')][_0x2ac46b[_0xdbba('0xb3')]]);this[_0xdbba('0xb4')][_0x2ac46b[_0xdbba('0xb3')]]['ivrAnswerCallsDay']+=0x1;_0x3050b3=new Hangup(_0x2ac46b,_0x40080d);this[_0xdbba('0xcb')](_0x3050b3)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x103')));this[_0xdbba('0xca')](_0x3050b3)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x104')));}if(_0x2ac46b&&_0x2ac46b['type']!==_0xdbba('0x91')&&isNotNull(this[_0xdbba('0x1a')][_0x2ac46b['queue']][_0xdbba('0x105')])){delete this[_0xdbba('0xa9')][_0x40080d[_0xdbba('0xdf')]];this[_0xdbba('0xb2')](this[_0xdbba('0x1a')][_0x2ac46b[_0xdbba('0xb3')]]);this['voiceQueues'][_0x2ac46b[_0xdbba('0xb3')]][_0xdbba('0x58')]+=0x1;this['voiceQueues'][_0x2ac46b[_0xdbba('0xb3')]][_0xdbba('0x57')]+=0x1;_0x3050b3=new Hangup(_0x2ac46b,_0x40080d);_0x3050b3[_0xdbba('0xa3')]=0x10;_0x3050b3['statedesc']='AnswerAGI';_0x3050b3['membername']=_0xdbba('0x106');this[_0xdbba('0xcb')](_0x3050b3)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x103')));this['moveContactManagedDialer'](_0x3050b3)[_0xdbba('0xb0')](loggerCatch('[syncHangupIvr]'));}if(_0x2ac46b&&_0x2ac46b['type']!==_0xdbba('0x91')&&!isNotNull(this[_0xdbba('0x1a')][_0x2ac46b['queue']][_0xdbba('0x105')])){delete this[_0xdbba('0xa9')][_0x40080d[_0xdbba('0xdf')]];this[_0xdbba('0xb2')](this[_0xdbba('0x1a')][_0x2ac46b[_0xdbba('0xb3')]]);this[_0xdbba('0x1a')][_0x2ac46b[_0xdbba('0xb3')]][_0xdbba('0x63')]+=0x1;_0x3050b3=new Hangup(_0x2ac46b,_0x40080d);_0x3050b3['state']=0xc;_0x3050b3[_0xdbba('0xa4')]=_0x40080d[_0xdbba('0x107')];_0x3050b3[_0xdbba('0xe3')]='Unknow';this[_0xdbba('0xcb')](_0x3050b3)['catch'](loggerCatch(_0xdbba('0x103')));this[_0xdbba('0xca')](_0x3050b3)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x104')));}};Dialer[_0xdbba('0xa7')][_0xdbba('0x2a')]=function(_0x43f4c0){var _0x3434e6=this[_0xdbba('0xa9')][_0x43f4c0['uniqueid']];var _0x5aa1dd=this;if(this[_0xdbba('0x1a')][_0x43f4c0['queue']]){if(_0x3434e6&&_0x3434e6[_0xdbba('0x4f')]!==_0xdbba('0x91')){delete this[_0xdbba('0xa9')][_0x43f4c0['uniqueid']];this[_0xdbba('0x1a')][_0x43f4c0[_0xdbba('0xb3')]][_0xdbba('0x58')]+=0x1;var _0x3e5f5b=new AgentComplete(_0x3434e6,_0x43f4c0);if(_0x43f4c0['reason']===_0xdbba('0x108')){_0x3e5f5b['agiafterat']=this['voiceQueues'][_0x43f4c0[_0xdbba('0xb3')]][_0xdbba('0x109')]&&this[_0xdbba('0x1a')][_0x43f4c0[_0xdbba('0xb3')]]['dialAgiAfterHangupAgent']?moment()[_0xdbba('0x74')](_0xdbba('0xfd')):undefined;}this[_0xdbba('0xcb')](_0x3e5f5b)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x10a')));this[_0xdbba('0xca')](_0x3e5f5b)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x10b')));}}};Dialer[_0xdbba('0xa7')][_0xdbba('0x26')]=function(_0x40e37a){if(this['voiceQueues'][_0x40e37a[_0xdbba('0xb3')]]){if(this[_0xdbba('0xa9')][_0x40e37a[_0xdbba('0xdf')]]&&this[_0xdbba('0xa9')][_0x40e37a[_0xdbba('0xdf')]][_0xdbba('0x4f')]!=='ivr'){this[_0xdbba('0xb2')](this[_0xdbba('0x1a')][_0x40e37a['queue']]);this[_0xdbba('0xa9')][_0x40e37a[_0xdbba('0xdf')]][_0xdbba('0x10c')]=moment()[_0xdbba('0x74')](_0xdbba('0xfd'));}}};Dialer[_0xdbba('0xa7')][_0xdbba('0x10d')]=function(_0x47baef){this[_0xdbba('0xcb')](_0x47baef)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x10a')));this[_0xdbba('0xca')](_0x47baef)['catch'](loggerCatch(_0xdbba('0x10e')));};Dialer['prototype'][_0xdbba('0x28')]=function(_0x3d9b5e){var _0x34adf9=this[_0xdbba('0xa9')][_0x3d9b5e[_0xdbba('0xdf')]];var _0x851e50=this;if(this['voiceQueues'][_0x3d9b5e[_0xdbba('0xb3')]]){if(_0x34adf9&&_0x34adf9['type']!==_0xdbba('0x91')){delete this[_0xdbba('0xa9')][_0x3d9b5e[_0xdbba('0xdf')]];this[_0xdbba('0xb2')](this['voiceQueues'][_0x3d9b5e[_0xdbba('0xb3')]]);_0x34adf9[_0xdbba('0x10f')]=moment()[_0xdbba('0x74')](_0xdbba('0xfd'));var _0x384ea6=new QueueCallerAbandon(_0x34adf9,_0x3d9b5e);if(getSeconds(_0x34adf9[_0xdbba('0x10f')],_0x34adf9[_0xdbba('0x110')])>=_0x34adf9[_0xdbba('0x111')]){this['voiceQueues'][_0x3d9b5e[_0xdbba('0xb3')]][_0xdbba('0x67')]+=0x1;this[_0xdbba('0x1a')][_0x3d9b5e[_0xdbba('0xb3')]][_0xdbba('0x5d')]+=0x1;this[_0xdbba('0x1a')][_0x3d9b5e[_0xdbba('0xb3')]][_0xdbba('0x69')]+=0x1;_0x384ea6['state']=0xa;_0x384ea6[_0xdbba('0xa4')]=_0xdbba('0x112');_0x384ea6[_0xdbba('0x113')]=_0xdbba('0x114');_0x384ea6[_0xdbba('0x115')]=this[_0xdbba('0x1a')][_0x3d9b5e['queue']][_0xdbba('0x109')]?moment()[_0xdbba('0x74')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x384ea6[_0xdbba('0xf1')]+=0x1;_0x384ea6[_0xdbba('0xea')]+=0x1;if(_0x384ea6['countdropretry']>=this['voiceQueues'][_0x3d9b5e[_0xdbba('0xb3')]][_0xdbba('0x116')]){this[_0xdbba('0x10d')](_0x384ea6);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x384ea6['countdropretry'],'scheduledat':moment()[_0xdbba('0xfa')](this[_0xdbba('0x1a')][_0x3d9b5e[_0xdbba('0xb3')]][_0xdbba('0x117')],_0xdbba('0xfc'))[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x34adf9[_0xdbba('0xd4')],'ListId':_0x34adf9[_0xdbba('0xd5')],'VoiceQueueId':_0x34adf9[_0xdbba('0xd6')]||undefined,'CampaignId':_0x34adf9['CampaignId']||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x118')));var _0x4b408c=new History(_0x384ea6);_0x4b408c[_0xdbba('0xa3')]=0xa;_0x4b408c[_0xdbba('0xa4')]='Drop';_0x4b408c['starttime']=moment()[_0xdbba('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x4b408c[_0xdbba('0xa5')]=_0x4b408c[_0xdbba('0xa6')];_0x4b408c[_0xdbba('0x119')]=_0x384ea6[_0xdbba('0x119')];_0x4b408c[_0xdbba('0x11a')]=_0x384ea6[_0xdbba('0x11a')];this[_0xdbba('0xcb')](_0x4b408c)[_0xdbba('0xb0')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xdbba('0x1a')][_0x3d9b5e[_0xdbba('0xb3')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xdbba('0x1a')][_0x3d9b5e['queue']][_0xdbba('0x5c')]+=0x1;_0x384ea6[_0xdbba('0xa3')]=0xb;_0x384ea6[_0xdbba('0xa4')]='Abandoned';_0x384ea6[_0xdbba('0x113')]=_0xdbba('0x11b');_0x384ea6[_0xdbba('0xf2')]+=0x1;_0x384ea6[_0xdbba('0xea')]+=0x1;if(_0x384ea6['countabandonedretry']>=this['voiceQueues'][_0x3d9b5e[_0xdbba('0xb3')]][_0xdbba('0x11c')]){this[_0xdbba('0x10d')](_0x384ea6);}else{this[_0xdbba('0xc1')]({'active':![],'countabandonedretry':_0x384ea6[_0xdbba('0xf2')],'scheduledat':moment()[_0xdbba('0xfa')](this[_0xdbba('0x1a')][_0x3d9b5e[_0xdbba('0xb3')]]['dialAbandonedRetryFrequency'],_0xdbba('0xfc'))[_0xdbba('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x34adf9[_0xdbba('0xd4')],'ListId':_0x34adf9['ListId'],'VoiceQueueId':_0x34adf9['VoiceQueueId']||undefined,'CampaignId':_0x34adf9[_0xdbba('0xfe')]||undefined})['catch'](loggerCatch(_0xdbba('0x11d')));var _0x4b408c=new History(_0x384ea6);_0x4b408c[_0xdbba('0xa3')]=0xb;_0x4b408c[_0xdbba('0xa4')]='Abandoned';_0x4b408c[_0xdbba('0xa6')]=moment()[_0xdbba('0x74')](_0xdbba('0xfd'));_0x4b408c[_0xdbba('0xa5')]=_0x4b408c[_0xdbba('0xa6')];_0x4b408c['calleridname']=_0x384ea6[_0xdbba('0x119')];_0x4b408c[_0xdbba('0x11a')]=_0x384ea6[_0xdbba('0x11a')];this[_0xdbba('0xcb')](_0x4b408c)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x11e')));}}}}};Dialer[_0xdbba('0xa7')][_0xdbba('0x2f')]=function(_0x413307){if(this[_0xdbba('0x1f')][_0x413307[_0xdbba('0xdf')]]){this[_0xdbba('0x1f')][_0x413307[_0xdbba('0xdf')]][_0xdbba('0xaf')]=_0x413307['channel'];}if(this['uniqueId'][_0x413307[_0xdbba('0xdf')]]){this[_0xdbba('0xa9')][_0x413307[_0xdbba('0xdf')]][_0xdbba('0xaf')]=_0x413307['channel'];}};Dialer[_0xdbba('0xa7')][_0xdbba('0x11f')]=function(_0x11ba73){if(strategy[this[_0xdbba('0x1a')][this['actions'][_0x11ba73[_0xdbba('0x120')]][_0xdbba('0xb3')]]['strategy']]===_0xdbba('0x14')){if(this[_0xdbba('0x1f')][_0x11ba73[_0xdbba('0x120')]]&&_[_0xdbba('0xac')](this['actions'][_0x11ba73[_0xdbba('0x120')]]['locked'])&&_0x11ba73['status']==='1'&&_0x11ba73[_0xdbba('0x121')]==='0'){if(this[_0xdbba('0x1b')][_0x11ba73['stateinterface']]){if(!this[_0xdbba('0x1b')][_0x11ba73[_0xdbba('0x122')]][_0xdbba('0x123')]){this[_0xdbba('0x1b')][_0x11ba73[_0xdbba('0x122')]][_0xdbba('0x123')]=!![];this[_0xdbba('0x1f')][_0x11ba73[_0xdbba('0x120')]][_0xdbba('0x123')]=!![];this[_0xdbba('0x1f')][_0x11ba73[_0xdbba('0x120')]][_0xdbba('0x122')]=_0x11ba73[_0xdbba('0x122')];}}}}else if((strategy[this[_0xdbba('0x1a')][this[_0xdbba('0x1f')][_0x11ba73['actionid']][_0xdbba('0xb3')]]['strategy']]||'rrmemory')===_0xdbba('0x124')){if(this['actions'][_0x11ba73['actionid']]){if(this[_0xdbba('0x1b')][_0x11ba73[_0xdbba('0x122')]]){this[_0xdbba('0x1f')][_0x11ba73['actionid']][_0xdbba('0x122')]=_0x11ba73[_0xdbba('0x122')];if(_[_0xdbba('0xac')](this['queueBooked'][this[_0xdbba('0x1f')][_0x11ba73[_0xdbba('0x120')]]['queue']])){this[_0xdbba('0x23')][this[_0xdbba('0x1f')][_0x11ba73[_0xdbba('0x120')]]['queue']]=[];}this['queueBooked'][this['actions'][_0x11ba73[_0xdbba('0x120')]][_0xdbba('0xb3')]][_0xdbba('0x125')](_[_0xdbba('0x8a')](_['pick'](this[_0xdbba('0x1f')][_0x11ba73[_0xdbba('0x120')]],[_0xdbba('0x126'),_0xdbba('0x122')]),{'status':_0x11ba73['status'],'paused':_0x11ba73[_0xdbba('0x121')]}));}}}};function unlockQueueStatus(_0x167540,_0x449f36){setTimeout(function(){if(_[_0xdbba('0x36')](_0x167540[_0xdbba('0x127')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x449f36);}_0x167540[_0xdbba('0x127')]=!![];loggerBooked[_0xdbba('0x78')](_0xdbba('0x128'),_0x449f36,JSON['stringify'](_['pick'](_0x167540,[_0xdbba('0x3b'),_0xdbba('0x127')])));},0x1f3);}Dialer[_0xdbba('0xa7')][_0xdbba('0x129')]=function(_0x2d5582){var _0x13c74b=this;var _0x518304=_0x13c74b['voiceQueues'][_0x13c74b['actions'][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]];if(strategy[this[_0xdbba('0x1a')][this[_0xdbba('0x1f')][_0x2d5582['actionid']]['queue']][_0xdbba('0x47')]]===_0xdbba('0x14')){if(this[_0xdbba('0x1f')][_0x2d5582['actionid']]&&this['actions'][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0x122')]){this[_0xdbba('0x19')]['run'](this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0x126')],this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0x122')])[_0xdbba('0xb0')](function(_0xbf84d1){logger[_0xdbba('0x94')](_0xdbba('0x12a'),util[_0xdbba('0x95')](_0xbf84d1,{'showHidden':![],'depth':null}));})['finally'](function(){_0x13c74b['updateOriginated'](_0x13c74b['voiceQueues'][_0x13c74b[_0xdbba('0x1f')][_0x2d5582['actionid']][_0xdbba('0xb3')]]);_0x13c74b[_0xdbba('0x1b')][_0x13c74b[_0xdbba('0x1f')][_0x2d5582['actionid']]['stateinterface']][_0xdbba('0x123')]=![];delete _0x13c74b[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]];unlockQueueStatus(_0x518304);});}else{this[_0xdbba('0xb2')](this[_0xdbba('0x1a')][this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xd4')],'ListId':this['actions'][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xd5')],'VoiceQueueId':this[_0xdbba('0x1f')][_0x2d5582['actionid']][_0xdbba('0xd6')]||undefined,'CampaignId':this['actions'][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xdbba('0x1f')][_0x2d5582['actionid']];unlockQueueStatus(_0x518304);}}else if((strategy[this[_0xdbba('0x1a')][this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]][_0xdbba('0x47')]]||'rrmemory')===_0xdbba('0x124')){var _0x2bf836;if(this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]]&&!_[_0xdbba('0x40')](this[_0xdbba('0x23')][this[_0xdbba('0x1f')][_0x2d5582['actionid']][_0xdbba('0xb3')]])){if(this['queueBookedRR'][_0x13c74b[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]]){this[_0xdbba('0x24')][_0x13c74b[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]]=this['queueBookedRR'][this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]]?this['queueBookedRR'][this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]]:this[_0xdbba('0x23')][this[_0xdbba('0x1f')][_0x2d5582['actionid']][_0xdbba('0xb3')]]?this['queueBooked'][this[_0xdbba('0x1f')][_0x2d5582[_0xdbba('0x120')]][_0xdbba('0xb3')]][_0xdbba('0x12b')]||0x0:0x0;}this[_0xdbba('0x23')][this[_0xdbba('0x1f')][_0x2d5582['actionid']][_0xdbba('0xb3')]][_0xdbba('0x12b')]=this['queueBookedRR'][this['actions'][_0x2d5582[_0xdbba('0x120')]]['queue']];for(var _0x2af561=0x0;_0x2af561=0x0?!![]:![];})['catch'](myreject(_0x137fe6)));}}else{_0x1e6c6a[_0xdbba('0x125')](ami['Action']({'action':_0xdbba('0x147'),'command':util[_0xdbba('0x74')](_0xdbba('0x14c'),_0x3c434d,!_['isUndefined'](config[_0xdbba('0x144')][_0x43afac])?_0x43afac:'')})[_0xdbba('0xb7')](function(_0x3ff637){return _0x3ff637[_0xdbba('0x149')][_0xdbba('0x14a')]('true')>=0x0?!![]:![];})[_0xdbba('0xb0')](myreject(_0x137fe6)));}BPromise[_0xdbba('0x14d')](_0x1e6c6a)[_0xdbba('0xb7')](function(_0x32084d){var _0x185888=_[_0xdbba('0x14e')](_0x32084d);if(_0x185888){return _0x3ea488(_0x185888);}else{_0x164d1a[_0xdbba('0x37')]=_0x2a5a28?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x137fe6(msgResponse(_0xdbba('0x14f'),'Failure','Global:\x20'+_0x2a5a28+'\x20'+_0x2ad505+_0xdbba('0x150')+util['inspect'](_0x3c434d,{'showHidden':![],'depth':null})+_0xdbba('0x151')+_0x43afac));}})[_0xdbba('0xb0')](function(_0x401828){return _0x137fe6(msgResponse('ifTime',_0xdbba('0x141'),JSON['stringify'](_0x401828)));});});};Dialer[_0xdbba('0xa7')][_0xdbba('0x152')]=function(_0x471b04){var _0x2e0b69=this;return function(){switch(_0x471b04[_0xdbba('0x54')]){case _0xdbba('0x153'):freeVariablesPredictive(_0x471b04);_0x2e0b69[_0xdbba('0x154')](_0x471b04,0x1);break;case _0xdbba('0x155'):freeVariablesPredictive(_0x471b04);_0x2e0b69[_0xdbba('0x154')](_0x471b04,_0x471b04[_0xdbba('0x156')]);break;case _0xdbba('0x7'):_0x2e0b69['predictive'](_0x471b04);break;case _0xdbba('0x6'):freeVariablesPredictive(_0x471b04);_0x2e0b69[_0xdbba('0x154')](_0x471b04,0x1);break;default:freeVariablesPredictive(_0x471b04);logger['error'](_0xdbba('0x157'),_0x471b04[_0xdbba('0x3b')],_0xdbba('0x158'));}};};Dialer[_0xdbba('0xa7')][_0xdbba('0x159')]=function(_0x1e606f){var _0x2d8bcf=this;return function(){_0x2d8bcf[_0xdbba('0x15a')](_0x1e606f);};};Dialer[_0xdbba('0xa7')]['syncQueueSummary']=function(_0x1fef43){var _0x515847=this;if(isNotPreview(_0x1fef43[_0xdbba('0x54')])){if(isVoiceQueueOutbound(_0x1fef43[_0xdbba('0x4f')])&&isActive(_0x1fef43[_0xdbba('0x53')])){_0x1fef43['sendMessageOneNotActive']=!![];BPromise[_0xdbba('0xb6')]()['then'](checkIsLoggedIn(_0x1fef43,_0x1fef43['loggedIn']))[_0xdbba('0xb7')](checkIsActive(_0x1fef43,_0x1fef43[_0xdbba('0x53')]))[_0xdbba('0xb7')](checkInterval(_0x1fef43))[_0xdbba('0xb7')](_0x515847[_0xdbba('0x13a')](_0x1fef43))[_0xdbba('0xb7')](_0x515847[_0xdbba('0x13e')](_0x1fef43[_0xdbba('0x15b')],_0x1fef43['dialTimezone'],_0x1fef43[_0xdbba('0x3b')],_0x1fef43))[_0xdbba('0xb7')](_0x515847[_0xdbba('0x13f')](_0x1fef43[_0xdbba('0x3f')],_0x1fef43[_0xdbba('0x15c')],_0x1fef43[_0xdbba('0x3b')],_0x1fef43))['then'](_0x515847[_0xdbba('0x152')](_0x1fef43))['catch'](loggerCatchQueueSummary(_0xdbba('0x15d'),_0x1fef43));}else{notSendMessagesQueue(_0x1fef43);}}else{freeVariablesPredictive(_0x1fef43);}};Dialer[_0xdbba('0xa7')][_0xdbba('0x139')]=function(){var _0x4f9002=this;var _0x5d2d97;for(var _0x3f546e in this['campaigns']){if(this['campaigns']['hasOwnProperty'](_0x3f546e)){_0x5d2d97=this['campaigns'][_0x3f546e];if(isCampaignIvr(_0x5d2d97[_0xdbba('0x4f')])&&isActive(_0x5d2d97[_0xdbba('0x71')])){_0x5d2d97[_0xdbba('0x9f')]=!![];BPromise[_0xdbba('0xb6')]()[_0xdbba('0xb7')](checkIsActive(_0x5d2d97,_0x5d2d97[_0xdbba('0x71')]))['then'](checkInterval(_0x5d2d97))[_0xdbba('0xb7')](_0x4f9002[_0xdbba('0x13a')](_0x5d2d97))[_0xdbba('0xb7')](_0x4f9002['checkIfTime'](_0x5d2d97[_0xdbba('0x15b')],_0x5d2d97['dialTimezone'],_0x5d2d97[_0xdbba('0x3b')],_0x5d2d97))[_0xdbba('0xb7')](_0x4f9002[_0xdbba('0x13f')](_0x5d2d97[_0xdbba('0x3f')],_0x5d2d97[_0xdbba('0x15c')],_0x5d2d97['name'],_0x5d2d97))[_0xdbba('0xb7')](_0x4f9002[_0xdbba('0x159')](_0x5d2d97))[_0xdbba('0xb0')](loggerCatchQueueSummary('[syncCampaigns]',_0x5d2d97));}else{notSendMessagesCampaign(_0x5d2d97);}}}};function getCallerIdRandom(_0x8b378e,_0x53dd99){var _0x1e6372,_0x296b00,_0x17f5fb;if(_0x53dd99<=0x0){_0x53dd99=0x1;}_0x1e6372=new RegExp(_0xdbba('0x15e')+_0x53dd99+'}$');_0x296b00=Math[_0xdbba('0x15f')](0xa,_0x53dd99-0x1);_0x17f5fb=Math[_0xdbba('0x15f')](0xa,_0x53dd99)-0x1;return util[_0xdbba('0x74')]('%s',_['replace'](_0x8b378e,_0x1e6372,_[_0xdbba('0x160')](_0x296b00,_0x17f5fb)));}function extractCalleridName(_0x286a67){var _0x5cfa3b=_0x286a67['match'](/"(.*?)"/);return _0x5cfa3b?_0x5cfa3b[0x1]:_0x286a67;}function extractCalleridNumber(_0x12b14a){var _0x4b4eef=_0x12b14a[_0xdbba('0x161')](/<(.*?)>/);return _0x4b4eef?_0x4b4eef[0x1]:_0x12b14a;}Dialer[_0xdbba('0xa7')][_0xdbba('0x162')]=function(_0x16d84e,_0xe2cd8d){var _0xbeb5cf=this;var _0x3c64f5=uuid['v4']();this[_0xdbba('0x1f')][_0x3c64f5]=new Action(_0x16d84e,_0xe2cd8d,_0x3c64f5);return new BPromise(function(_0x3d04bc,_0x4b98a2){if(_[_0xdbba('0x36')](_0x16d84e)&&'object'!==typeof _0x16d84e){return _0x4b98a2(msgResponse(_0xdbba('0x163'),_0xdbba('0x141'),_0xdbba('0x164')));}if(_[_0xdbba('0x36')](_0xe2cd8d[_0xdbba('0x165')]['phone'])||_0xe2cd8d['Contact'][_0xdbba('0x166')]===null){return _0x4b98a2(msgResponse(_0xdbba('0x163'),'Failure',_0xdbba('0x167')));}var _0x460677={'XMD-CALLERID':_0xbeb5cf['actions'][_0x3c64f5][_0xdbba('0x168')](),'XMD-AGI':_0x16d84e['dialQueueProject']?util[_0xdbba('0x74')]('\x22agi://%s/square,%s\x22',ipAgi,_0x16d84e['dialQueueProject']):_0xdbba('0x169'),'XMD-AGIAFTER':_0x16d84e[_0xdbba('0x109')]?util[_0xdbba('0x74')](_0xdbba('0x16a'),ipAgi,_0x16d84e[_0xdbba('0x109')]):_0xdbba('0x169'),'XMD-QUEUE':_0x16d84e[_0xdbba('0x4f')]===_0xdbba('0x90')?util[_0xdbba('0x74')]('\x22%s,%s%s,,,%s\x22',_0x16d84e[_0xdbba('0x3b')],_0x16d84e[_0xdbba('0x16b')]||'',_0x16d84e['dialAgiAfterHangupAgent']?'c':'',_0x16d84e[_0xdbba('0x111')]||0x3):'NONE','XMD-CONTACTID':_0xe2cd8d['ContactId'],'XMD-CDRTYPE':_0xdbba('0x16c'),'CALLERID(all)':_0xbeb5cf[_0xdbba('0x1f')][_0x3c64f5][_0xdbba('0x168')](),'XMD-AMD':_0x16d84e['dialAMDActive']?_0xdbba('0x16d'):_0xdbba('0x169'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x16d84e[_0xdbba('0xe1')]){_0x460677[_0xdbba('0x16e')]=_0x16d84e[_0xdbba('0x16f')]||0x9c4;_0x460677[_0xdbba('0x170')]=_0x16d84e[_0xdbba('0x171')]||0x5dc;_0x460677['XMD-AMDAFTERGREETINGSILENCE']=_0x16d84e[_0xdbba('0x172')]||0x320;_0x460677[_0xdbba('0x173')]=_0x16d84e[_0xdbba('0x174')]||0x1388;_0x460677[_0xdbba('0x175')]=_0x16d84e[_0xdbba('0x176')]||0x64;_0x460677[_0xdbba('0x177')]=_0x16d84e['dialAMDBetweenWordsSilence']||0x32;_0x460677['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x16d84e[_0xdbba('0x178')]||0x3;_0x460677[_0xdbba('0x179')]=_0x16d84e[_0xdbba('0x17a')]||0x100;_0x460677[_0xdbba('0x17b')]=_0x16d84e[_0xdbba('0x17c')]||0x1388;}if(_0x16d84e[_0xdbba('0x4f')]==='outbound'){_0x460677[_0xdbba('0x17d')]=_0xe2cd8d[_0xdbba('0xd6')];}else{_0x460677[_0xdbba('0x17e')]=_0xe2cd8d[_0xdbba('0xfe')];}for(var _0x21bc89 in _0xe2cd8d[_0xdbba('0x165')]){if(_0xe2cd8d['Contact'][_0xdbba('0xcd')](_0x21bc89)){if(isNotNull(_0xe2cd8d[_0xdbba('0x165')][_0x21bc89])&&_0x21bc89!=='id'&&_0x21bc89!==_0xdbba('0x17f')&&_0x21bc89!==_0xdbba('0x180')&&_0x21bc89!==_0xdbba('0x181')){_0x460677[util[_0xdbba('0x74')]('%s%s',_0xdbba('0x182'),_['toUpper'](_0x21bc89))]=_0xe2cd8d['Contact'][_0x21bc89];}}}var _0x557365=_0xbeb5cf['isTrunkReachable'](_0x16d84e[_0xdbba('0x70')])?getCallerId(_0x16d84e['Trunk']['callerid'],_0x16d84e['dialOriginateCallerIdName'],_0x16d84e[_0xdbba('0x183')]>0x0?getCallerIdRandom(_0x16d84e[_0xdbba('0x184')],_0x16d84e['dialRandomLastDigitCallerIdNumber']):_0x16d84e[_0xdbba('0x184')]):getCallerId(_[_0xdbba('0xac')](_0x16d84e[_0xdbba('0x13b')])?_0x16d84e[_0xdbba('0x70')][_0xdbba('0x72')]:_0x16d84e[_0xdbba('0x13b')][_0xdbba('0x72')],_0x16d84e[_0xdbba('0x55')],_0x16d84e[_0xdbba('0x183')]>0x0?getCallerIdRandom(_0x16d84e['dialOriginateCallerIdNumber'],_0x16d84e[_0xdbba('0x183')]):_0x16d84e[_0xdbba('0x184')]);if(_0x557365){_0x460677[_0xdbba('0x185')]=_0xbeb5cf[_0xdbba('0x1f')][_0x3c64f5][_0xdbba('0x186')]=extractCalleridName(_0x557365);_0x460677[_0xdbba('0x187')]=_0xbeb5cf[_0xdbba('0x1f')][_0x3c64f5][_0xdbba('0x188')]=extractCalleridNumber(_0x557365);}return ami[_0xdbba('0xad')]({'actionid':_0x3c64f5,'action':'originate','channel':_0xbeb5cf[_0xdbba('0xdb')](_0x16d84e['Trunk'])?util[_0xdbba('0x74')](_0xdbba('0x189'),_0x16d84e[_0xdbba('0x70')][_0xdbba('0x3b')],isNotNull(_0x16d84e[_0xdbba('0x56')])?_0x16d84e[_0xdbba('0x56')][_0xdbba('0x18a')]()||'':'',_0x16d84e[_0xdbba('0x18b')]>0x0?_0xe2cd8d[_0xdbba('0x165')]['phone']['substring'](_0x16d84e[_0xdbba('0x18b')]):_0xe2cd8d[_0xdbba('0x165')][_0xdbba('0x166')]):util[_0xdbba('0x74')](_0xdbba('0x189'),_['isNil'](_0x16d84e[_0xdbba('0x13b')])?_0x16d84e[_0xdbba('0x70')][_0xdbba('0x3b')]:_0x16d84e['TrunkBackup'][_0xdbba('0x3b')],isNotNull(_0x16d84e['dialPrefix'])?_0x16d84e[_0xdbba('0x56')][_0xdbba('0x18a')]()||'':'',_0x16d84e[_0xdbba('0x18b')]>0x0?_0xe2cd8d[_0xdbba('0x165')]['phone']['substring'](_0x16d84e[_0xdbba('0x18b')]):_0xe2cd8d['Contact'][_0xdbba('0x166')]),'callerid':_0x557365,'Exten':_0xdbba('0xe0'),'Context':'from-sip','Priority':'1','variable':_0x460677,'timeout':(_0x16d84e[_0xdbba('0x18c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3c64f5})[_0xdbba('0xb7')](function(_0x14b147){return _0x3d04bc(_0x14b147);})[_0xdbba('0xb0')](function(_0x24c93c){_0x16d84e[_0xdbba('0x60')]+=0x1;var _0x1e227a=new History(_0xbeb5cf['actions'][_0x3c64f5]);logger[_0xdbba('0x94')](util['format'](_0xdbba('0x18d'),JSON[_0xdbba('0x43')](_0x24c93c)));_0x1e227a[_0xdbba('0xa3')]=0xe;_0x1e227a['statedesc']=_0xdbba('0x18e');_0x1e227a['starttime']=moment()[_0xdbba('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e227a[_0xdbba('0xa5')]=_0x1e227a[_0xdbba('0xa6')];_0xbeb5cf[_0xdbba('0xcb')](_0x1e227a)['catch'](loggerCatch(_0xdbba('0x18f')));_0xbeb5cf[_0xdbba('0xca')](_0x1e227a)['catch'](loggerCatch('[originate][error]'))[_0xdbba('0x17')](function(){delete _0xbeb5cf['actions'][_0x3c64f5];return _0x4b98a2(msgResponse('originate',_0xdbba('0x190'),_0xdbba('0x191')));});});});};Dialer[_0xdbba('0xa7')]['syncOriginateResponse']=function(_0x51e1ec){var _0x2f94a6=this[_0xdbba('0x1f')][_0x51e1ec[_0xdbba('0x120')]];var _0x2e0f4f=this;if(_0x2f94a6){delete this[_0xdbba('0x1f')][_0x51e1ec[_0xdbba('0x120')]];_0x2f94a6[_0xdbba('0x110')]=moment()['format'](_0xdbba('0xfd'));var _0x2c55dd=_0x2f94a6[_0xdbba('0x4f')]===_0xdbba('0x91')?this[_0xdbba('0xb4')][_0x2f94a6['queue']]:this[_0xdbba('0x1a')][_0x2f94a6[_0xdbba('0x192')]()];if(!this['isSuccess'](_0x51e1ec['response'])){this[_0xdbba('0xb2')](_0x2c55dd);return this[_0xdbba('0x193')](_0x2f94a6,_0x2c55dd,_0x51e1ec)[_0xdbba('0xb7')](function(_0x41b3e5){})[_0xdbba('0xb0')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0x51e1ec[_0xdbba('0xdf')]]=_0x2f94a6;}}};Dialer[_0xdbba('0xa7')][_0xdbba('0x194')]=function(_0x7b4ca0,_0x7b35a3,_0x1748eb){var _0x1973a5=new History(_0x7b35a3);if(_0x1973a5[_0xdbba('0xed')]+_0x1973a5[_0xdbba('0xee')]+_0x1973a5['countnoanswerretry']+_0x1973a5[_0xdbba('0xf0')]+_0x1973a5[_0xdbba('0xf1')]+_0x1973a5[_0xdbba('0xf2')]+_0x1973a5[_0xdbba('0xe9')]+_0x1973a5[_0xdbba('0xf3')]>=_0x1748eb[_0xdbba('0xf4')]-0x1){return!![];}switch(_0x7b4ca0){case 0x3:if(_0x1973a5[_0xdbba('0xef')]>=_0x1748eb[_0xdbba('0x195')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x1973a5['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x1748eb['dialNoAnswerRetryFrequency'],'minutes')[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x1973a5['ContactId'],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x196')));}break;case 0x5:if(_0x1973a5['countbusyretry']>=_0x1748eb[_0xdbba('0x197')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x1973a5[_0xdbba('0xed')]+=0x1,'scheduledat':moment()[_0xdbba('0xfa')](_0x1748eb[_0xdbba('0x198')],_0xdbba('0xfc'))[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x1973a5[_0xdbba('0xd4')],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x199')));}break;case 0x8:if(_0x1973a5[_0xdbba('0xee')]>=_0x1748eb[_0xdbba('0x19a')]-0x1){return!![];}else{this[_0xdbba('0xc1')]({'active':![],'countcongestionretry':_0x1973a5[_0xdbba('0xee')]+=0x1,'scheduledat':moment()['add'](_0x1748eb[_0xdbba('0x19b')],'minutes')[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x1973a5[_0xdbba('0xd4')],'ListId':_0x1973a5['ListId'],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})['catch'](loggerCatch(_0xdbba('0x19c')));}break;case 0x0:if(_0x1973a5[_0xdbba('0xf0')]>=_0x1748eb[_0xdbba('0x19d')]-0x1){return!![];}else{this[_0xdbba('0xc1')]({'active':![],'countnosuchnumberretry':_0x1973a5[_0xdbba('0xf0')]+=0x1,'scheduledat':moment()[_0xdbba('0xfa')](_0x1748eb['dialNoSuchNumberRetryFrequency'],_0xdbba('0xfc'))['format'](_0xdbba('0xfd')),'ContactId':_0x1973a5['ContactId'],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x19e')));}break;case 0xa:if(_0x1973a5[_0xdbba('0xf1')]>=_0x1748eb[_0xdbba('0x116')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1973a5[_0xdbba('0xf1')]+=0x1,'scheduledat':moment()[_0xdbba('0xfa')](_0x1748eb[_0xdbba('0x117')],_0xdbba('0xfc'))[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x1973a5[_0xdbba('0xd4')],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x1973a5[_0xdbba('0xf2')]>=_0x1748eb[_0xdbba('0x11c')]-0x1){return!![];}else{this[_0xdbba('0xc1')]({'active':![],'countabandonedretry':_0x1973a5['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x1748eb[_0xdbba('0x19f')],_0xdbba('0xfc'))[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x1973a5['ContactId'],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})['catch'](loggerCatch(_0xdbba('0x11d')));}break;case 0x13:if(_0x1973a5['countmachineretry']>=_0x1748eb[_0xdbba('0xf7')]-0x1){return!![];}else{this[_0xdbba('0xc1')]({'active':![],'countmachineretry':_0x1973a5[_0xdbba('0xe9')]+=0x1,'scheduledat':moment()[_0xdbba('0xfa')](_0x1748eb[_0xdbba('0xfb')],_0xdbba('0xfc'))['format'](_0xdbba('0xfd')),'ContactId':_0x1973a5['ContactId'],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xff')));}break;case 0x14:if(_0x1973a5[_0xdbba('0xf3')]>=_0x1748eb[_0xdbba('0x1a0')]-0x1){return!![];}else{this[_0xdbba('0xc1')]({'active':![],'countagentrejectretry':_0x1973a5[_0xdbba('0xf3')]+=0x1,'scheduledat':moment()[_0xdbba('0xfa')](_0x1748eb[_0xdbba('0x1a1')],_0xdbba('0xfc'))[_0xdbba('0x74')](_0xdbba('0xfd')),'ContactId':_0x1973a5[_0xdbba('0xd4')],'ListId':_0x1973a5[_0xdbba('0xd5')],'VoiceQueueId':_0x1973a5[_0xdbba('0xd6')]||undefined,'CampaignId':_0x1973a5[_0xdbba('0xfe')]||undefined})[_0xdbba('0xb0')](loggerCatch('[rescheduleContact][AgentReject]'));}break;default:return!![];}};Dialer[_0xdbba('0xa7')][_0xdbba('0x193')]=function(_0x7dd036,_0x5a8b56,_0x3e5c2d){var _0x38af41=this;var _0x1b56b4=new History(_0x7dd036);return new BPromise(function(_0x210113,_0x1bc071){if(_[_0xdbba('0x36')](_0x5a8b56)&&'object'!==typeof _0x5a8b56){return _0x1bc071(msgResponse('[callProgressDetecting]',_0xdbba('0x141'),_0xdbba('0x1a2')));}if(_[_0xdbba('0x36')](_0x3e5c2d)&&_0xdbba('0x1a3')!==typeof _0x3e5c2d){return _0x1bc071(msgResponse('[callProgressDetecting]',_0xdbba('0x141'),'evt\x20is\x20undefine'));}switch(_0x3e5c2d[_0xdbba('0x1a4')]){case'0':_0x5a8b56[_0xdbba('0x5f')]+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0x0;_0x1b56b4[_0xdbba('0xa4')]='NoSuchNumber';_0x1b56b4['countnosuchnumberretry']+=0x1;_0x1b56b4['countglobal']+=0x1;ami[_0xdbba('0x46')](_0xdbba('0x1a5'),ut[_0xdbba('0x1a6')](_0x7dd036,_0xdbba('0x1a7')));_0x38af41[_0xdbba('0xcb')](_0x1b56b4)['catch'](loggerCatch(_0xdbba('0xec')));if(_0x38af41[_0xdbba('0x194')](0x0,_0x7dd036,_0x5a8b56)){if(_0x1b56b4['countnosuchnumberretry']>=_0x5a8b56[_0xdbba('0x19d')]){_0x38af41[_0xdbba('0xf8')](_0x1b56b4,_0x210113,_0x1bc071,'reason\x200\x20no\x20such\x20number....');}else{_0x38af41[_0xdbba('0xf5')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1a8'));}}break;case'3':_0x5a8b56['outboundNoAnswerCallsDay']+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0x3;_0x1b56b4['statedesc']=_0xdbba('0x1a9');_0x1b56b4[_0xdbba('0xef')]+=0x1;_0x1b56b4[_0xdbba('0xea')]+=0x1;ami['emit'](_0xdbba('0x1aa'),ut[_0xdbba('0x1a6')](_0x7dd036,_0xdbba('0x1ab')));_0x38af41[_0xdbba('0xcb')](_0x1b56b4)['catch'](loggerCatch(_0xdbba('0x1ac')));if(_0x38af41[_0xdbba('0x194')](0x3,_0x7dd036,_0x5a8b56)){if(_0x1b56b4['countnoanswerretry']>=_0x5a8b56[_0xdbba('0x195')]){_0x38af41[_0xdbba('0xf8')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1ad'));}else{_0x38af41[_0xdbba('0xf5')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1ad'));}}break;case'5':_0x5a8b56[_0xdbba('0x5a')]+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0x5;_0x1b56b4[_0xdbba('0xa4')]=_0xdbba('0x1ae');_0x1b56b4['countbusyretry']+=0x1;_0x1b56b4['countglobal']+=0x1;ami[_0xdbba('0x46')](_0xdbba('0x1af'),ut[_0xdbba('0x1a6')](_0x7dd036,_0xdbba('0x1b0')));_0x38af41[_0xdbba('0xcb')](_0x1b56b4)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x1b1')));if(_0x38af41[_0xdbba('0x194')](0x5,_0x7dd036,_0x5a8b56)){if(_0x1b56b4[_0xdbba('0xed')]>=_0x5a8b56[_0xdbba('0x197')]){_0x38af41['createStateFinal'](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1b2'));}else{_0x38af41[_0xdbba('0xf5')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1b2'));}}break;case'8':_0x5a8b56['outboundCongestionCallsDay']+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0x8;_0x1b56b4[_0xdbba('0xa4')]=_0xdbba('0x1b3');_0x1b56b4[_0xdbba('0xee')]+=0x1;_0x1b56b4['countglobal']+=0x1;ami[_0xdbba('0x46')](_0xdbba('0x1b4'),ut[_0xdbba('0x1a6')](_0x7dd036,_0xdbba('0x1b5')));_0x38af41[_0xdbba('0xcb')](_0x1b56b4)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x1b6')));if(_0x38af41['checkRetriveMax'](0x8,_0x7dd036,_0x5a8b56)){if(_0x1b56b4[_0xdbba('0xee')]>=_0x5a8b56[_0xdbba('0x19a')]){_0x38af41['createStateFinal'](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1b7'));}else{_0x38af41[_0xdbba('0xf5')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1b7'));}}break;case'11':_0x5a8b56['outboundAbandonedCallsDay']+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0xb;_0x1b56b4[_0xdbba('0xa4')]=_0xdbba('0x1b8');_0x1b56b4[_0xdbba('0xf2')]+=0x1;_0x1b56b4['countglobal']+=0x1;_0x38af41['createHistory'](_0x1b56b4)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x11e')));if(_0x38af41[_0xdbba('0x194')](0xb,_0x7dd036,_0x5a8b56)){if(_0x1b56b4[_0xdbba('0xf2')]>=_0x5a8b56[_0xdbba('0x11c')]){_0x38af41[_0xdbba('0xf8')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1b9'));}else{_0x38af41['stateGlobal'](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1b9'));}}break;case'20':_0x5a8b56[_0xdbba('0x62')]+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0x14;_0x1b56b4['statedesc']=_0xdbba('0x1ba');_0x1b56b4['countagentrejectretry']+=0x1;_0x1b56b4[_0xdbba('0xea')]+=0x1;ami[_0xdbba('0x46')](_0xdbba('0x1bb'),ut[_0xdbba('0x1a6')](_0x7dd036,'agentreject'));_0x38af41['createHistory'](_0x1b56b4)['catch'](loggerCatch(_0xdbba('0x1bc')));if(_0x38af41[_0xdbba('0x194')](0x14,_0x7dd036,_0x5a8b56)){if(_0x1b56b4[_0xdbba('0xf3')]>=_0x5a8b56['dialAgentRejectMaxRetry']){_0x38af41[_0xdbba('0xf8')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1bd'));}else{_0x38af41[_0xdbba('0xf5')](_0x1b56b4,_0x210113,_0x1bc071,_0xdbba('0x1bd'));}}break;default:_0x5a8b56[_0xdbba('0x63')]+=0x1;_0x1b56b4[_0xdbba('0xa3')]=0xc;_0x1b56b4['statedesc']=_0x3e5c2d['reason'];_0x38af41[_0xdbba('0xcb')](_0x1b56b4)[_0xdbba('0xb0')](loggerCatch(_0xdbba('0x1be')));if(_0x38af41[_0xdbba('0x194')](_0x3e5c2d[_0xdbba('0x1a4')],_0x7dd036,_0x5a8b56)){if(_0x1b56b4['countbusyretry']+_0x1b56b4['countcongestionretry']+_0x1b56b4[_0xdbba('0xef')]+_0x1b56b4[_0xdbba('0xf0')]+_0x1b56b4[_0xdbba('0xf1')]+_0x1b56b4['countabandonedretry']+_0x1b56b4[_0xdbba('0xe9')]+_0x1b56b4['countagentrejectretry']>=_0x5a8b56[_0xdbba('0xf4')]){_0x38af41[_0xdbba('0xf5')](_0x1b56b4,_0x210113,_0x1bc071,_0x3e5c2d[_0xdbba('0x1a4')]);}else{_0x38af41[_0xdbba('0xf8')](_0x1b56b4,_0x210113,_0x1bc071,_0x3e5c2d[_0xdbba('0x1a4')]);}}}});};Dialer[_0xdbba('0xa7')]['stateGlobal']=function(_0x4142cf,_0x234537,_0x191e4a,_0x24de51){var _0x39c6d6=new Final(_0x4142cf);_0x39c6d6[_0xdbba('0xa3')]=0xf;_0x39c6d6[_0xdbba('0xa4')]=_0xdbba('0x1bf');this['createStateFinal'](_0x39c6d6,_0x234537,_0x191e4a,_0x24de51);};Dialer[_0xdbba('0xa7')][_0xdbba('0xf8')]=function(_0x51af44,_0x50f0bd,_0x548de6,_0x5b4782){this[_0xdbba('0xca')](_0x51af44)[_0xdbba('0xb7')](function(_0x4b4e9c){return _0x50f0bd(msgResponse(_0xdbba('0x1c0'),_0xdbba('0xda'),_0x5b4782));})[_0xdbba('0xb0')](function(_0xf753e2){return _0x548de6(msgResponse(_0xdbba('0x1c1'),_0xdbba('0x141'),_0xdbba('0x1c2')));});};Dialer[_0xdbba('0xa7')][_0xdbba('0x7')]=function(_0x3f26b3){var _0x595efc=this;var _0x54c34e=_0x3f26b3[_0xdbba('0x1c3')]/0x64;var _0x53ff89=_0x3f26b3['outboundDropCallsDayTimeout']/(_0x3f26b3[_0xdbba('0x5d')]+_0x3f26b3[_0xdbba('0x58')]);var _0x4a7726=Math[_0xdbba('0x1c4')](_0x3f26b3[_0xdbba('0x6b')]*(_0x3f26b3[_0xdbba('0x1c5')]/0x64));var _0x1c623f=Math[_0xdbba('0x1c4')](_0x3f26b3[_0xdbba('0x6b')]*(_0x3f26b3[_0xdbba('0x1c6')]/0x64));var _0x35a484=_0x3f26b3['available']+_0x3f26b3['talking'];var _0x59856b=Math[_0xdbba('0x1c7')](_0x3f26b3[_0xdbba('0x6c')]*_0x3f26b3['erlangAbandonmentRate']*_0x3f26b3[_0xdbba('0x1c8')]*_0x3f26b3['predictiveIntervalMultiplicativeFactor']);if(_[_0xdbba('0x36')](_0x3f26b3['startProgressive'])){if(!_['isUndefined'](_0x3f26b3['startPredictive'])){_0x3f26b3[_0xdbba('0x8d')]=undefined;loggerPredictive['error'](_0xdbba('0x1c9'),_0xdbba('0x1ca'));}if(!_[_0xdbba('0x36')](_0x3f26b3[_0xdbba('0x8f')])){loggerPredictive[_0xdbba('0x94')](_0xdbba('0x1c9'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3f26b3['handlePredictive']);_0x3f26b3[_0xdbba('0x8f')]=undefined;}_0x3f26b3[_0xdbba('0x22')]=moment()[_0xdbba('0x74')](_0xdbba('0xfd'));loggerPredictive['info'](_0x3f26b3[_0xdbba('0x3b')],_0xdbba('0x1cb'),_0x3f26b3[_0xdbba('0x22')]);this[_0xdbba('0x154')](_0x3f26b3,0x1);}else if(ifInterval(_0x3f26b3[_0xdbba('0x1cc')],_0x3f26b3[_0xdbba('0x22')])){this[_0xdbba('0x154')](_0x3f26b3,0x1);loggerPredictiveCalls['info'](_0xdbba('0x1cd'),_0x3f26b3[_0xdbba('0x22')],_0x3f26b3[_0xdbba('0x3b')]);_0x3f26b3[_0xdbba('0x6c')]=0x0;_0x3f26b3[_0xdbba('0x69')]=0x0;}else if(_0x54c34e<_0x53ff89&&_0x3f26b3[_0xdbba('0x1ce')]==='dropRate'){freeVariablesPredictive(_0x3f26b3);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x1cf'),_0xdbba('0x1d0'),_0x53ff89,_0xdbba('0x22'),_0x3f26b3[_0xdbba('0x3b')]);}else if(_0x59856b<_0x3f26b3['predictiveIntervalErlangCallsDroppedCalls']&&_0x3f26b3['dialPredictiveOptimization']==='dropRate'){freeVariablesPredictive(_0x3f26b3);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xdbba('0x1d1'),_0x59856b,_0xdbba('0x1d2'),_0x3f26b3[_0xdbba('0x69')],_0xdbba('0x22'),_0x3f26b3['name']);}else if(!ifInterval(_0x3f26b3[_0xdbba('0x1cc')],_0x3f26b3[_0xdbba('0x22')])&&_[_0xdbba('0x36')](_0x3f26b3['startPredictive'])&&!_[_0xdbba('0x36')](_0x3f26b3['startProgressive'])){_0x3f26b3[_0xdbba('0x8d')]=moment()[_0xdbba('0x74')](_0xdbba('0xfd'));loggerPredictive[_0xdbba('0x78')](_0x3f26b3[_0xdbba('0x3b')],_0xdbba('0x1d3'),_0x3f26b3[_0xdbba('0x8d')]);this[_0xdbba('0xbe')](_0x3f26b3[_0xdbba('0x1cc')])['then'](this[_0xdbba('0x1d4')](_0x3f26b3))['then'](mergeDataErlangB(_0x3f26b3))[_0xdbba('0xb7')](this[_0xdbba('0x1d5')](_0x3f26b3))[_0xdbba('0xb0')](loggerCatchPredictive(_0xdbba('0x1d6'),_0x3f26b3));}else if(!ifInterval(_0x3f26b3[_0xdbba('0x1cc')],_0x3f26b3['startPredictive'])){_0x3f26b3[_0xdbba('0x69')]=0x0;_0x3f26b3['startPredictive']=moment()[_0xdbba('0x74')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xdbba('0x78')](_0x3f26b3[_0xdbba('0x3b')],_0xdbba('0x1d7'),_0x3f26b3[_0xdbba('0x8d')]);clearInterval(_0x3f26b3[_0xdbba('0x8f')]);_0x3f26b3[_0xdbba('0x8f')]=undefined;this[_0xdbba('0xbe')](_0x3f26b3[_0xdbba('0x1cc')])['then'](this[_0xdbba('0x1d4')](_0x3f26b3))[_0xdbba('0xb7')](mergeDataErlangB(_0x3f26b3))['then'](this[_0xdbba('0x1d5')](_0x3f26b3))[_0xdbba('0xb0')](loggerCatchPredictive(_0xdbba('0x1d8'),_0x3f26b3));}else if(_0x3f26b3[_0xdbba('0x6b')]&&_0x35a484<_0x3f26b3[_0xdbba('0x6b')]-_0x1c623f){freeVariablesPredictive(_0x3f26b3);loggerPredictive[_0xdbba('0x78')](_0x3f26b3['name'],_0xdbba('0x1d9'),_0x35a484,_0xdbba('0x1da'),_0x3f26b3['predictiveIntervalAvailable'],'-',_0x1c623f,'=',_0x3f26b3[_0xdbba('0x6b')]-_0x1c623f,')');}else if(_0x3f26b3[_0xdbba('0x6b')]&&_0x35a484>_0x3f26b3['predictiveIntervalAvailable']+_0x4a7726){freeVariablesPredictive(_0x3f26b3);loggerPredictive[_0xdbba('0x78')](_0x3f26b3[_0xdbba('0x3b')],_0xdbba('0x1d9'),_0x35a484,')\x20are\x20more\x20than\x20threshold\x20(',_0x3f26b3['predictiveIntervalAvailable'],'+',_0x4a7726,'=',_0x3f26b3[_0xdbba('0x6b')]+_0x4a7726,')');}};Dialer['prototype'][_0xdbba('0x1d4')]=function(_0x4c4a00){var _0x4580da=this;return function(_0x2d77f8){return new BPromise(function(_0x4ab9a0,_0x648902){_[_0xdbba('0x8a')](_0x4c4a00,_0x2d77f8[0x0]);if(checkGetDataPredictive(_0x2d77f8[0x0])){var _0x10e92f=_0x4c4a00[_0xdbba('0x6b')]=_0x4c4a00[_0xdbba('0x4d')]+_0x4c4a00[_0xdbba('0x48')];var _0x19c1cd=_0x4c4a00[_0xdbba('0x1cc')]*0x3c;var _0x3eab5a=_0x2d77f8[0x0]['predictiveIntervalAvgTalktime']+_0x2d77f8[0x0][_0xdbba('0x65')];var _0x1996d1=(_0x2d77f8[0x0][_0xdbba('0x64')]+_0x2d77f8[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2d77f8[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x2d77f8[0x0]['predictiveIntervalTotalCalls'];_0x4c4a00[_0xdbba('0x1c8')]=_0x1996d1>0x0?_0x1996d1:0x1;switch(_0x4c4a00['dialPredictiveOptimization']){case _0xdbba('0x1db'):var _0x38e036=_0x4c4a00[_0xdbba('0x1c3')]/0x64;return _0x4580da['abandonmentRate'](_0x10e92f,_0x19c1cd,_0x3eab5a,_0x1996d1,_0x38e036)[_0xdbba('0xb7')](function(_0xe2e97d){return _0x4ab9a0(_0xe2e97d);});case _0xdbba('0x1dc'):var _0x3f8130=_0x4c4a00[_0xdbba('0x1c3')]/0x64;return _0x4580da[_0xdbba('0x1dd')](_0x10e92f,_0x19c1cd,_0x3eab5a,_0x1996d1,_0x3f8130)[_0xdbba('0xb7')](function(_0x4b128d){return _0x4ab9a0(_0x4b128d);});default:return _0x648902(msgResponse(_0xdbba('0x1de'),_0xdbba('0x141'),'Unknown\x20Predictive'));}}else{return _0x648902(msgResponse(_0xdbba('0x1de'),'Failure',_0xdbba('0x1df')));}});};};Dialer[_0xdbba('0xa7')][_0xdbba('0x1e0')]=function(_0x9f03f0){var _0x36d88a=this;return function(_0x59d864){return new BPromise(function(_0x526860,_0xe9fabb){_[_0xdbba('0x8a')](_0x9f03f0,_0x59d864[0x0]);if(checkGetDataPredictive(_0x59d864[0x0])){loggerPredictive[_0xdbba('0x78')](JSON[_0xdbba('0x43')](_0x59d864[0x0]));if(_0x9f03f0[_0xdbba('0x1ce')]===_0xdbba('0x1db')){return _0x36d88a['getVoiceQueueRtPauses'](_0x9f03f0['id'])['then'](function(_0x2e946d){var _0x23ac9f=_0x9f03f0[_0xdbba('0x49')]-_0x2e946d[0x0]['outboundQueuePauses'];var _0x424a00=_0x9f03f0['dialPredictiveInterval']*0x3c;var _0x4862e2=_0x59d864[0x0]['predictiveIntervalAvgTalktime']+_0x59d864[0x0][_0xdbba('0x65')];var _0x1613a1=(_0x59d864[0x0][_0xdbba('0x64')]+_0x59d864[0x0][_0xdbba('0x67')]+_0x59d864[0x0][_0xdbba('0x7e')])/_0x59d864[0x0][_0xdbba('0x7b')];var _0x6c1f81=_0x9f03f0['dialPredictiveOptimizationPercentage']/0x64;_0x9f03f0['predictiveIntervalPauses']=_0x2e946d[0x0][_0xdbba('0x1e1')]||0x0;_0x9f03f0[_0xdbba('0x1c8')]=_0x1613a1>0x0?_0x1613a1:0x1;return _0x36d88a[_0xdbba('0x1e2')](_0x23ac9f,_0x424a00,_0x4862e2,_0x1613a1,_0x6c1f81);})['then'](function(_0xea199c){return _0x526860(_0xea199c);})['catch'](function(_0x66002d){return _0xe9fabb(msgResponse(_0xdbba('0x1e3'),_0xdbba('0x141'),JSON[_0xdbba('0x43')](_0x66002d)));});}if(_0x9f03f0[_0xdbba('0x1ce')]==='agentBusyFactor'){return _0x36d88a[_0xdbba('0xc8')](_0x9f03f0['id'])[_0xdbba('0xb7')](function(_0x315f40){var _0x396651=_0x9f03f0[_0xdbba('0x49')]-_0x315f40[0x0][_0xdbba('0x1e1')];var _0x51c928=_0x9f03f0[_0xdbba('0x1cc')]*0x3c;var _0x4a1111=_0x59d864[0x0][_0xdbba('0x66')]+_0x59d864[0x0][_0xdbba('0x65')];var _0x3ca8f0=(_0x59d864[0x0][_0xdbba('0x64')]+_0x59d864[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x59d864[0x0][_0xdbba('0x7e')])/_0x59d864[0x0][_0xdbba('0x7b')];var _0x2ea0ff=_0x9f03f0[_0xdbba('0x1c3')]/0x64;_0x9f03f0[_0xdbba('0x1e4')]=_0x315f40[0x0][_0xdbba('0x1e1')]||0x0;_0x9f03f0['predictiveIntervalHitRate']=_0x3ca8f0>0x0?_0x3ca8f0:0x1;return _0x36d88a[_0xdbba('0x1dd')](_0x396651,_0x51c928,_0x4a1111,_0x3ca8f0,_0x2ea0ff);})['then'](function(_0x599e46){return _0x526860(_0x599e46);})[_0xdbba('0xb0')](function(_0x3db786){return _0xe9fabb(msgResponse(_0xdbba('0x1e3'),_0xdbba('0x141'),JSON[_0xdbba('0x43')](_0x3db786)));});}}else{return _0xe9fabb(msgResponse('[getDataPredictive]',_0xdbba('0x141'),_0xdbba('0x1df')));}});};};Dialer[_0xdbba('0xa7')][_0xdbba('0x1d5')]=function(_0x252ed3){var _0x4ccd56=this;return function(){var _0x5c4bc8=0x0;var _0x28e454=Math['floor'](_0x252ed3[_0xdbba('0x6d')]*0x3e8);if(_0x28e454>0x0){_0x28e454=_0x28e454<0x64?0x64:_0x28e454;loggerPredictive[_0xdbba('0x78')](_0x252ed3[_0xdbba('0x3b')],'one\x20call\x20every:',_0x28e454,_0xdbba('0x44'));_0x252ed3[_0xdbba('0x8f')]=setInterval(function(){_0x4ccd56[_0xdbba('0x8f')](_0x252ed3);loggerPredictiveCalls[_0xdbba('0x78')](_0xdbba('0x1e5'),_0x5c4bc8+=0x1);},_0x28e454);}else{loggerPredictive['info'](_0x252ed3['name'],_0xdbba('0x1e6'));}};};Dialer[_0xdbba('0xa7')]['checkContactBlack']=function(_0x44f800,_0x2edbb6){var _0x2f56c2=this;return function(_0x517da6){if(_['isEmpty'](_0x517da6)){if(_[_0xdbba('0xac')](_0x2edbb6[_0xdbba('0x1e7')])||!_0x2edbb6[_0xdbba('0x1e8')]){if(_0x44f800[_0xdbba('0x54')]==='booked'){_0x44f800[_0xdbba('0x127')]=_['isUndefined'](_0x44f800[_0xdbba('0x127')])?!![]:_0x44f800[_0xdbba('0x127')];var _0x4d8a18=uuid['v4']();_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18]=new Action(_0x44f800,_0x2edbb6,_0x4d8a18);loggerBooked[_0xdbba('0x78')](_0xdbba('0x1e9'),_0x4d8a18,_0xdbba('0x1ea'),JSON['stringify'](_0x44f800['queueStatusComplete']),_0xdbba('0x1eb'),_0x44f800[_0xdbba('0x3b')]);if(_0x44f800[_0xdbba('0x127')]){_0x44f800[_0xdbba('0x127')]=![];_0x2f56c2[_0xdbba('0x23')][_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18][_0xdbba('0xb3')]]=[];ami['Action']({'actionid':_0x4d8a18,'action':_0xdbba('0x1ec'),'queue':_0x44f800[_0xdbba('0x3b')]})[_0xdbba('0xb0')](function(_0x53ad3a){_0x2f56c2['updateOriginated'](_0x44f800);_0x2f56c2[_0xdbba('0xc1')]({'active':![],'ContactId':_0x2f56c2['actions'][_0x4d8a18][_0xdbba('0xd4')],'ListId':_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18]['ListId'],'VoiceQueueId':_0x2f56c2['actions'][_0x4d8a18][_0xdbba('0xd6')]||undefined,'CampaignId':_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18]['CampaignId']||undefined})[_0xdbba('0xb0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f56c2['actions'][_0x4d8a18];});}else{loggerBooked[_0xdbba('0x78')](_0xdbba('0x1ed'),JSON[_0xdbba('0x43')](_0x44f800[_0xdbba('0x127')]),_0xdbba('0x1eb'),_0x44f800[_0xdbba('0x3b')]);_0x2f56c2[_0xdbba('0xb2')](_0x44f800);_0x2f56c2[_0xdbba('0xc1')]({'active':![],'ContactId':_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18][_0xdbba('0xd4')],'ListId':_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18]['ListId'],'VoiceQueueId':_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18][_0xdbba('0xd6')]||undefined,'CampaignId':_0x2f56c2[_0xdbba('0x1f')][_0x4d8a18][_0xdbba('0xfe')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f56c2[_0xdbba('0x1f')][_0x4d8a18];}}else{return _0x2f56c2[_0xdbba('0x162')](_0x44f800,_0x2edbb6);}}else{if(getDiff(_0x2edbb6[_0xdbba('0x1ee')])<_0x44f800[_0xdbba('0x1ef')]*0x3c){if(_0x2edbb6[_0xdbba('0x1f0')]&&!_0x2edbb6['Agent'][_0xdbba('0x1f1')]){_0x2f56c2[_0xdbba('0x19')][_0xdbba('0x131')](_0x2edbb6['id'])['finally'](function(){_0x2f56c2[_0xdbba('0xb2')](_0x44f800);});}else{_0x2f56c2[_0xdbba('0xc3')]({'active':![]},_0x2edbb6['id'],0x1)['finally'](function(){console['log'](_0xdbba('0x1f2'));_0x2f56c2[_0xdbba('0xb2')](_0x44f800);});}}else{_0x44f800[_0xdbba('0x61')]+=0x1;_0x2f56c2[_0xdbba('0xb2')](_0x44f800);if(_0x44f800[_0xdbba('0x1f3')]){_0x2f56c2['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2edbb6['ContactId'],'ListId':_0x2edbb6[_0xdbba('0xd5')],'VoiceQueueId':_0x2edbb6[_0xdbba('0xd6')]||undefined,'CampaignId':_0x2edbb6[_0xdbba('0xfe')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x2f56c2['createHistory'](createObjHistory(_0x44f800,_0x2edbb6,_0xdbba('0x1f4'),0x17,_0xdbba('0x1f5')))['catch'](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x2f56c2[_0xdbba('0xd3')](createObjHistory(_0x44f800,_0x2edbb6,_0xdbba('0x1f6'),0x16,_0xdbba('0x1f7')),_0xdbba('0x1f8'),'[Originate][HistoryRecallClose]');}}}}else{_0x44f800['outboundBlacklistCallsDay']+=0x1;_0x2f56c2['saveInDb'](createObjHistory(_0x44f800,_0x2edbb6,_0xdbba('0x1f9'),0xd,_0xdbba('0x1fa')),_0xdbba('0x1fb'),_0xdbba('0x1fc'));throw'inBlackList';}};};Dialer[_0xdbba('0xa7')]['handleIvr']=function(_0x4de022){var _0x6caebd=this;var _0x5a73d2=[];var _0x475845=_0x4de022[_0xdbba('0x1fd')]-_0x4de022[_0xdbba('0x98')]-_0x4de022[_0xdbba('0x1fe')];emitCampaignSummary(_0x4de022);if(_0x475845>0x0){if(_0x475845>this[_0xdbba('0x1d')]){_0x475845=this[_0xdbba('0x1d')];}_0x4de022[_0xdbba('0x1fe')]+=_0x475845;this[_0xdbba('0xc7')](_0x4de022['id'],_0x475845,_0x4de022[_0xdbba('0x1ff')])[_0xdbba('0xb7')](function(_0x25ed67){_0x4de022[_0xdbba('0x1fe')]-=_0x475845;_0x4de022[_0xdbba('0x1fe')]=_0x4de022['temp']>0x0?_0x4de022['temp']:0x0;if(!checkContactEmpty(_0x25ed67)){_0x4de022[_0xdbba('0x37')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xdbba('0x78')]('[getContactCampaign2][Empty]'+_0x4de022[_0xdbba('0x3b')]);}else{_0x4de022[_0xdbba('0x98')]+=_0x25ed67['length'];_0x4de022[_0xdbba('0x37')]=_0xdbba('0x200');for(var _0x30a9c1=0x0;_0x30a9c1<_0x25ed67[_0xdbba('0x97')];_0x30a9c1+=0x1){_0x4de022['ivrTotalCallsDays']+=0x1;if(_[_0xdbba('0xac')](_0x25ed67[_0x30a9c1])||_['isNil'](_0x25ed67[_0x30a9c1][_0xdbba('0x165')])||_['isNil'](_0x25ed67[_0x30a9c1][_0xdbba('0x165')]['phone'])){_0x6caebd[_0xdbba('0xd1')](_0xdbba('0x201'),_0x4de022,_0x25ed67[_0x30a9c1]);}else{_0x6caebd['checkIsBlackListIvr'](_[_0xdbba('0x12f')](_0x25ed67[_0x30a9c1],['CampaignId','Contact.phone']))[_0xdbba('0xb7')](_0x6caebd[_0xdbba('0x202')](_0x4de022,_0x25ed67[_0x30a9c1]))[_0xdbba('0xb0')](_0x6caebd[_0xdbba('0xd0')]('[actionOriginateIvr]\x20',_0x4de022));}}}})[_0xdbba('0xb0')](loggerGetContactDialer('[getContactCampaign2]',_0x4de022,_0x475845));}};Dialer['prototype'][_0xdbba('0x154')]=function(_0x39c83f,_0x1a704f){var _0x5d601a=this;var _0x20884d=[];var _0x3dc4dc=_0x1a704f>=0x1?_0x1a704f:0x1;var _0x1e0fe2=[];if(_0x39c83f['dialMethod']===_0xdbba('0x6')){_0x3dc4dc=0x1;}var _0x3359df=Math[_0xdbba('0x1c7')](_0x39c83f[_0xdbba('0x48')]*_0x3dc4dc)-_0x39c83f[_0xdbba('0x98')]-_0x39c83f[_0xdbba('0x1fe')];emitVoiceQueueSummary(_0x39c83f);if(_0x39c83f[_0xdbba('0x203')]>0x0){var _0x3f9eee=_0x39c83f[_0xdbba('0x203')]-_0x39c83f[_0xdbba('0x98')]-_0x39c83f[_0xdbba('0x4d')]-_0x39c83f[_0xdbba('0x1fe')]-_0x39c83f[_0xdbba('0x4a')];if(_0x3359df>_0x3f9eee){_0x3359df=_0x3f9eee;}}if(_0x3359df>0x0){if(_0x39c83f[_0xdbba('0x54')]===_0xdbba('0x6')){_0x3359df=0x1;}if(_0x3359df>this[_0xdbba('0x1d')]){_0x3359df=this[_0xdbba('0x1d')];}_0x39c83f[_0xdbba('0x1fe')]+=_0x3359df;for(var _0x450d1b in this[_0xdbba('0x1b')]){if(this[_0xdbba('0x1b')][_0xdbba('0xcd')](_0x450d1b)){if(this['agents'][_0x450d1b][_0xdbba('0xa3')]===_0xdbba('0x204')&&this[_0xdbba('0x1b')][_0x450d1b]['status']===_0xdbba('0xdd')){_0x20884d[_0xdbba('0x125')](this[_0xdbba('0x1b')][_0x450d1b]['id']);}}}this[_0xdbba('0xc5')](_0x39c83f['id'],_0x20884d,_0x3359df,_0x39c83f['dialOrderByScheduledAt'])[_0xdbba('0xb7')](function(_0x1197f2){_0x39c83f['temp']-=_0x3359df;_0x39c83f[_0xdbba('0x1fe')]=_0x39c83f[_0xdbba('0x1fe')]>0x0?_0x39c83f[_0xdbba('0x1fe')]:0x0;if(!checkContactEmpty(_0x1197f2)){_0x5d601a['countReScheduled'](_0x39c83f)['then'](sendMessageReschedule(_0x39c83f))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xb9')));}else{_0x39c83f[_0xdbba('0x98')]+=_0x1197f2[_0xdbba('0x97')];_0x39c83f[_0xdbba('0x37')]=_0x39c83f['dialMethod']===_0xdbba('0x6')?_0xdbba('0x16d'):_0xdbba('0x200');for(var _0x535e45=0x0;_0x535e45<_0x1197f2[_0xdbba('0x97')];_0x535e45+=0x1){if(_['isNil'](_0x1197f2[_0x535e45])||_[_0xdbba('0xac')](_0x1197f2[_0x535e45][_0xdbba('0x165')])||_['isNil'](_0x1197f2[_0x535e45][_0xdbba('0x165')][_0xdbba('0x166')])){_0x5d601a['emptyContact'](_0xdbba('0x201'),_0x39c83f,_0x1197f2[_0x535e45]);}else{_0x5d601a[_0xdbba('0xba')](_[_0xdbba('0x12f')](_0x1197f2[_0x535e45],[_0xdbba('0xd6'),_0xdbba('0x205')]))[_0xdbba('0xb7')](_0x5d601a[_0xdbba('0x202')](_0x39c83f,_0x1197f2[_0x535e45]))[_0xdbba('0xb0')](_0x5d601a[_0xdbba('0xd0')](_0xdbba('0x201'),_0x39c83f));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x39c83f,_0x3359df));}};Dialer[_0xdbba('0xa7')]['handlePredictive']=function(_0xbd394d){var _0x556cec=this;if(_0xbd394d[_0xdbba('0x203')]>0x0){var _0x3e6323=_0xbd394d[_0xdbba('0x203')]-_0xbd394d[_0xdbba('0x98')]-_0xbd394d[_0xdbba('0x4d')];if(_0x3e6323>0x0){this[_0xdbba('0x206')](_0xbd394d);}else{loggerPredictiveCalls[_0xdbba('0x78')](_0xdbba('0x207'));}}else{this[_0xdbba('0x206')](_0xbd394d);}};Dialer[_0xdbba('0xa7')][_0xdbba('0x206')]=function(_0x26a2dd){var _0x171f1e=this;var _0xee71c8=[];_0x26a2dd[_0xdbba('0x98')]+=0x1;for(var _0x564004 in this[_0xdbba('0x1b')]){if(this['agents'][_0xdbba('0xcd')](_0x564004)){if(this[_0xdbba('0x1b')][_0x564004]['state']==='not_inuse'&&this[_0xdbba('0x1b')][_0x564004]['status']===_0xdbba('0xdd')){_0xee71c8['push'](this[_0xdbba('0x1b')][_0x564004]['id']);}}}this[_0xdbba('0xc5')](_0x26a2dd['id'],_0xee71c8,0x1,_0x26a2dd[_0xdbba('0x1ff')])[_0xdbba('0xb7')](function(_0x6e29ff){if(!checkContactEmpty(_0x6e29ff)){checkContactLowerLimitOriginate(_0x26a2dd,0x1,0x0);_0x171f1e[_0xdbba('0xb8')](_0x26a2dd)[_0xdbba('0xb7')](sendMessageReschedule(_0x26a2dd))[_0xdbba('0xb0')](loggerCatch(_0xdbba('0xb9')));}else{_0x26a2dd[_0xdbba('0x37')]=_0xdbba('0x200');if(_[_0xdbba('0xac')](_0x6e29ff[0x0])||_[_0xdbba('0xac')](_0x6e29ff[0x0][_0xdbba('0x165')])||_[_0xdbba('0xac')](_0x6e29ff[0x0][_0xdbba('0x165')][_0xdbba('0x166')])){_0x171f1e[_0xdbba('0xd1')](_0xdbba('0x201'),_0x26a2dd,_0x6e29ff[0x0]);}else{_0x171f1e[_0xdbba('0xba')](_[_0xdbba('0x12f')](_0x6e29ff[0x0],[_0xdbba('0xd6'),_0xdbba('0x205')]))[_0xdbba('0xb7')](_0x171f1e[_0xdbba('0x202')](_0x26a2dd,_0x6e29ff[0x0]))[_0xdbba('0xb0')](_0x171f1e[_0xdbba('0xd0')]('[actionOriginatePredictive]\x20',_0x26a2dd));}}})[_0xdbba('0xb0')](loggerGetContactDialer(_0xdbba('0x208'),_0x26a2dd,0x1));emitVoiceQueueSummary(_0x26a2dd);};Dialer['prototype'][_0xdbba('0x1e2')]=function(_0x7fd9a9,_0x1c43db,_0x50bd6b,_0x173d1,_0x562bf0,_0x317a81){loggerPredictive[_0xdbba('0x78')](_0xdbba('0x209'));loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20a'),_0x7fd9a9);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20b'),_0x1c43db);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20c'),_0x50bd6b);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20d'),_0x173d1);loggerPredictive['info'](_0xdbba('0x20e'),_0x562bf0);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x80'));return new BPromise(function(_0x331575,_0x21593b){if(_0x7fd9a9<=0x0||isNaN(_0x7fd9a9)){return _0x21593b(msgResponse(_0xdbba('0x20f'),_0xdbba('0x190'),_0xdbba('0x210')+_0x7fd9a9));}if(_0x50bd6b<=0x0||isNaN(_0x50bd6b)){return _0x21593b(msgResponse(_0xdbba('0x20f'),_0xdbba('0x190'),_0xdbba('0x211')+_0x50bd6b));}if(_0x173d1<=0x0||isNaN(_0x173d1)){return _0x21593b(msgResponse(_0xdbba('0x20f'),_0xdbba('0x190'),_0xdbba('0x212')+_0x173d1));}if(_0x1c43db<=0x0||isNaN(_0x1c43db)){return _0x21593b(msgResponse(_0xdbba('0x20f'),_0xdbba('0x190'),_0xdbba('0x213')+_0x1c43db));}if(_0x562bf0<=0x0||isNaN(_0x562bf0)){return _0x21593b(msgResponse(_0xdbba('0x20f'),_0xdbba('0x190'),_0xdbba('0x214')+_0x562bf0));}_0x317a81=_0x317a81||0x0;var _0x545918=0x1/_0x50bd6b;var _0x4fd8cc=0x0;var _0x2a0eeb=0x0;var _0x901122=0x0;var _0x357df1=0x0;for(var _0x31b147=0x0;_0x901122<_0x562bf0;_0x31b147+=0x1){_0x2a0eeb=_0x31b147/_0x1c43db;_0x4fd8cc=(_0x173d1*_0x2a0eeb+_0x317a81)/_0x545918;_0x901122=erlangb(_0x4fd8cc,_0x7fd9a9);_0x357df1=_0x4fd8cc/_0x7fd9a9*(0x1-erlangb(_0x4fd8cc,_0x7fd9a9));}return _0x331575({'erlangCalls':_0x31b147,'erlangCallToSecond':_0x1c43db/_0x31b147,'erlangAbandonmentRate':_0x901122,'erlangBusyFactor':_0x357df1});});};Dialer[_0xdbba('0xa7')][_0xdbba('0x1dd')]=function(_0x3ea4a4,_0x3f9d38,_0x28bc7e,_0x2be2ad,_0x4b709b,_0x1afb28){loggerPredictive['info'](_0xdbba('0x215'));loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20a'),_0x3ea4a4);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20b'),_0x3f9d38);loggerPredictive[_0xdbba('0x78')]('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',_0x28bc7e);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x20d'),_0x2be2ad);loggerPredictive[_0xdbba('0x78')](_0xdbba('0x216'),_0x4b709b);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3beb35,_0x166db3){if(_0x3ea4a4<=0x0||isNaN(_0x3ea4a4)){return _0x166db3(msgResponse(_0xdbba('0x217'),'Error',_0xdbba('0x210')+_0x3ea4a4));}if(_0x28bc7e<=0x0||isNaN(_0x28bc7e)){return _0x166db3(msgResponse(_0xdbba('0x217'),_0xdbba('0x190'),_0xdbba('0x211')+_0x28bc7e));}if(_0x2be2ad<=0x0||isNaN(_0x2be2ad)){return _0x166db3(msgResponse(_0xdbba('0x217'),_0xdbba('0x190'),'p\x20=\x20'+_0x2be2ad));}if(_0x3f9d38<=0x0||isNaN(_0x3f9d38)){return _0x166db3(msgResponse(_0xdbba('0x217'),_0xdbba('0x190'),_0xdbba('0x213')+_0x3f9d38));}if(_0x4b709b<=0x0||isNaN(_0x4b709b)){return _0x166db3(msgResponse(_0xdbba('0x217'),_0xdbba('0x190'),'Umin\x20=\x20'+_0x4b709b));}_0x1afb28=_0x1afb28||0x0;var _0x316807=0x1/_0x28bc7e;var _0x231f20=0x0;var _0x388a94=0x0;var _0x4da9a5=0x0;var _0x333357=0x0;for(var _0x3cb9e7=0x0;_0x333357<_0x4b709b;_0x3cb9e7+=0x1){_0x388a94=_0x3cb9e7/_0x3f9d38;_0x231f20=(_0x2be2ad*_0x388a94+_0x1afb28)/_0x316807;_0x4da9a5=erlangb(_0x231f20,_0x3ea4a4);_0x333357=_0x231f20/_0x3ea4a4*(0x1-erlangb(_0x231f20,_0x3ea4a4));}return _0x3beb35({'erlangCalls':_0x3cb9e7,'erlangCallToSecond':_0x3f9d38/_0x3cb9e7,'erlangAbandonmentRate':_0x4da9a5,'erlangBusyFactor':_0x333357});});};module[_0xdbba('0x218')]=Dialer; \ No newline at end of file +var _0xf37d=['minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','countglobal','[syncAgentComplete][createHistory][0]','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','strategy','locked','paused','stateinterface','push','pick','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','command','iftime\x20%s,%s','indexOf','true','content','all','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','power','handlePower','dialPowerLevel','Queue','launchHandleIvr','dialGlobalInterval','checkDialMethod','[syncQueueSummary]','syncCampaigns','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','voiceQueue\x20is\x20undefine','phone','Contact','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originate','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','Error','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','buildObj','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','dialAbandonedMaxRetry','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','getVoiceQueueRtPauses','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','Contact\x20updated','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','getContactDialer','ACTIVE','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','../ami','defaults','redis','localhost','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','startPredictive','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','queuemember','syncQueueMember','queuestatuscomplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','type','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\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','Agent\x20Busy\x20Factor:\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','---------------------------','merge','startProgressive','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','uniqueId','clearZombieChannels','[actions]','sequence','enqueue','isNil','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[getContactDialer]\x20','getContactDialerIvr','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','reachable','SIP/%s','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerCallsDay','state','HangupInAMD','membername','MACHINE','AMD','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency'];(function(_0x2f072d,_0x4edc14){var _0x53a102=function(_0x599b2a){while(--_0x599b2a){_0x2f072d['push'](_0x2f072d['shift']());}};_0x53a102(++_0x4edc14);}(_0xf37d,0x11c));var _0xdf37=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0xf37d[_0x1b25c1];return _0x1e4447;};'use strict';var util=require(_0xdf37('0x0'));var _=require(_0xdf37('0x1'));var BPromise=require(_0xdf37('0x2'));var uuid=require(_0xdf37('0x3'));var moment=require(_0xdf37('0x4'));var rr=require('rr');var md5=require(_0xdf37('0x5'));var Redis=require(_0xdf37('0x6'));var ut=require('../preview/util/util');var config=require(_0xdf37('0x7'));var logger=require(_0xdf37('0x8'))(_0xdf37('0x9'));var loggerBooked=require('../../../config/logger')(_0xdf37('0xa'));var loggerPredictive=require(_0xdf37('0x8'))(_0xdf37('0xb'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0xdf37('0xc'));config['redis']=_[_0xdf37('0xd')](config[_0xdf37('0xe')],{'host':_0xdf37('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xdf37('0xe')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xdf37('0x10'));var cmHopperHistory=require(_0xdf37('0x11'));var cmHopperBlack=require(_0xdf37('0x12'));var voiceQueueRt=require(_0xdf37('0x13'));var Action=require(_0xdf37('0x14'));var History=require(_0xdf37('0x15'));var Final=require('./final');var AgentComplete=require(_0xdf37('0x16'));var QueueCallerAbandon=require(_0xdf37('0x17'));var Hangup=require(_0xdf37('0x18'));var ipAgi=process['env'][_0xdf37('0x19')]||_0xdf37('0x1a');var strategy={'rrmemory':_0xdf37('0x1b'),'roundrobin':_0xdf37('0x1c')};var Sequence=function(){};Sequence[_0xdf37('0x1d')]['enqueue']=function(_0x299b04){this[_0xdf37('0x1e')]=this[_0xdf37('0x1e')]?this[_0xdf37('0x1e')][_0xdf37('0x1f')](_0x299b04):_0x299b04();};function Dialer(_0x5f1dd0,_0x3b6dce){this['sequence']=new Sequence();this[_0xdf37('0x20')]=_0x3b6dce;this[_0xdf37('0x21')]=_0x5f1dd0[_0xdf37('0x21')];this['campaigns']=_0x5f1dd0[_0xdf37('0x22')];this[_0xdf37('0x23')]=_0x5f1dd0[_0xdf37('0x23')];this[_0xdf37('0x24')]=_0x5f1dd0[_0xdf37('0x24')];this[_0xdf37('0x25')]=config[_0xdf37('0x25')]||0x2;this[_0xdf37('0x26')]={};this[_0xdf37('0x27')]={};this[_0xdf37('0x28')]={};this['uniqueId']={};this['optionPredictive']={};this[_0xdf37('0x29')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0xdf37('0x2a')]={};this[_0xdf37('0x2b')]={};ami['on']('agentconnect',this[_0xdf37('0x2c')][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x2e'),this[_0xdf37('0x2f')][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x30'),this[_0xdf37('0x31')][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x32'),this['syncAgentComplete'][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x33'),this[_0xdf37('0x34')][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x35'),this[_0xdf37('0x36')][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x37'),this['syncNewExten'][_0xdf37('0x2d')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0xdf37('0x38'),this[_0xdf37('0x39')][_0xdf37('0x2d')](this));ami['on'](_0xdf37('0x3a'),this['syncQueueStatusComplete'][_0xdf37('0x2d')](this));this['loopCampaigns']();this[_0xdf37('0x3b')]();}function isNotNull(_0x3e238b){return _0x3e238b!==null&&!_[_0xdf37('0x3c')](_0x3e238b);}function checkIsLoggedIn(_0x356d26,_0x4cffee){return function(){if(_0x4cffee<=0x0){_0x356d26[_0xdf37('0x3d')]=_0xdf37('0x3e');throw _0x356d26[_0xdf37('0x3f')]+_0xdf37('0x40');}};}function isActive(_0x143a7f){return _0x143a7f;}function checkIsActive(_0x1a179b,_0x4b0b27){return function(){if(!isActive(_0x4b0b27)){_0x1a179b[_0xdf37('0x3d')]=_0xdf37('0x41');throw _0x1a179b[_0xdf37('0x3f')]+_0xdf37('0x42');}};}function checkInterval(_0x14377b){return function(){if(!isNotNull(_0x14377b[_0xdf37('0x43')])){_0x14377b['message']='INTERVAL_IS_NULL';throw _0x14377b[_0xdf37('0x3f')]+_0xdf37('0x44');}if(!isNotNull(_0x14377b[_0xdf37('0x43')][_0xdf37('0x45')])){_0x14377b[_0xdf37('0x3d')]=_0xdf37('0x46');throw _0x14377b[_0xdf37('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xdf37('0x47')](_0x14377b['Interval'][_0xdf37('0x45')]))){_0x14377b[_0xdf37('0x3d')]=_0xdf37('0x46');throw _0x14377b[_0xdf37('0x3f')]+_0xdf37('0x44');}};}function msgResponse(_0x3f8ea0,_0x2cd5f6,_0x27eac6){return{'action':_0x3f8ea0,'response':_0x2cd5f6,'message':_0x27eac6,'stack':_0x27eac6};}function myreject(_0xf690ce){return function(_0x2dc63e){return _0xf690ce(msgResponse(_0xdf37('0x48'),'Error',JSON[_0xdf37('0x49')](_0x2dc63e)));};}function getSeconds(_0x25ae93,_0x40f663){var _0x5da0df=moment(_0x25ae93)[_0xdf37('0x4a')](0x0);var _0x122d4c=moment(_0x40f663)[_0xdf37('0x4a')](0x0);return _0x5da0df[_0xdf37('0x4b')](_0x122d4c,_0xdf37('0x4c'));}function emit(_0x391f64,_0x79cfbe,_0x1d5534){io['to'](_0x391f64)[_0xdf37('0x4d')](_0x79cfbe,_0x1d5534);}function emitVoiceQueueSummary(_0x34e759){if(_0x34e759[_0xdf37('0x4e')]==='outbound'){var _0x456135={'id':_0x34e759['id'],'name':_0x34e759[_0xdf37('0x3f')],'strategy':_0x34e759['strategy'],'answered':_0x34e759[_0xdf37('0x4f')],'available':_0x34e759[_0xdf37('0x50')],'loggedIn':_0x34e759[_0xdf37('0x51')],'pTalking':_0x34e759[_0xdf37('0x52')],'sumBillable':_0x34e759['sumBillable'],'sumDuration':_0x34e759[_0xdf37('0x53')],'sumHoldTime':_0x34e759[_0xdf37('0x54')]||0x0,'talking':_0x34e759[_0xdf37('0x55')],'total':_0x34e759[_0xdf37('0x56')],'type':_0x34e759[_0xdf37('0x4e')],'unmanaged':_0x34e759[_0xdf37('0x57')],'abandoned':_0x34e759[_0xdf37('0x58')],'waiting':_0x34e759[_0xdf37('0x59')],'loggedInDb':_0x34e759[_0xdf37('0x5a')],'dialActive':_0x34e759[_0xdf37('0x5b')],'dialMethod':_0x34e759[_0xdf37('0x5c')],'dialOriginateCallerIdName':_0x34e759[_0xdf37('0x5d')],'dialOriginateCallerIdNumber':_0x34e759[_0xdf37('0x5e')],'dialOriginateTimeout':_0x34e759[_0xdf37('0x5f')],'dialPrefix':_0x34e759[_0xdf37('0x60')],'outboundAnswerAgiCallsDay':_0x34e759[_0xdf37('0x61')],'outboundAnswerCallsDay':_0x34e759['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x34e759['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x34e759[_0xdf37('0x62')],'outboundCongestionCallsDay':_0x34e759['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x34e759[_0xdf37('0x63')],'outboundDropCallsDayCallersExit':_0x34e759[_0xdf37('0x64')],'outboundDropCallsDayTimeout':_0x34e759[_0xdf37('0x65')],'outboundNoAnswerCallsDay':_0x34e759[_0xdf37('0x66')],'outboundNoSuchCallsDay':_0x34e759[_0xdf37('0x67')],'outboundOriginateFailureCallsDay':_0x34e759[_0xdf37('0x68')],'outboundReCallsDay':_0x34e759[_0xdf37('0x69')],'outboundRejectCallsDay':_0x34e759['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x34e759['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x34e759['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x34e759[_0xdf37('0x6a')],'predictiveIntervalAvgTalktime':_0x34e759[_0xdf37('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x34e759[_0xdf37('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x34e759[_0xdf37('0x6d')],'predictiveIntervalErlangCalls':_0x34e759[_0xdf37('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x34e759[_0xdf37('0x6f')],'predictiveIntervalHitRate':_0x34e759[_0xdf37('0x70')],'predictiveIntervalMultiplicativeFactor':_0x34e759['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x34e759[_0xdf37('0x71')],'predictiveIntervalAvailable':_0x34e759[_0xdf37('0x72')],'predictiveIntervalTotalCalls':_0x34e759[_0xdf37('0x73')],'message':_0x34e759[_0xdf37('0x3d')],'originated':_0x34e759[_0xdf37('0x74')],'erlangCalls':_0x34e759[_0xdf37('0x75')],'erlangCallToSecond':_0x34e759[_0xdf37('0x76')],'erlangAbandonmentRate':_0x34e759[_0xdf37('0x77')],'erlangBusyFactor':_0x34e759[_0xdf37('0x78')],'startPredictive':_0x34e759[_0xdf37('0x29')],'startProgressive':_0x34e759['startProgressive']};if(_0x34e759[_0xdf37('0x79')]){_0x456135[_0xdf37('0x79')]={'id':_0x34e759['Trunk']['id'],'name':_0x34e759[_0xdf37('0x79')][_0xdf37('0x3f')],'active':_0x34e759[_0xdf37('0x79')]['active'],'callerid':_0x34e759[_0xdf37('0x79')]['callerid']};}if(_0x34e759[_0xdf37('0x43')]){_0x456135[_0xdf37('0x43')]={'id':_0x34e759[_0xdf37('0x43')]['id'],'name':_0x34e759[_0xdf37('0x43')][_0xdf37('0x3f')]};}var _0x5ebcbe=md5(JSON[_0xdf37('0x49')](_0x456135));if(_0x34e759[_0xdf37('0x5')]!==_0x5ebcbe){_0x34e759['md5']=_0x5ebcbe;emit(util[_0xdf37('0x7a')](_0xdf37('0x7b'),_0x456135['name']),_0xdf37('0x7c'),_0x456135);}}}function emitCampaignSummary(_0x29b2d3){if(_0x29b2d3['type']===_0xdf37('0x7d')){emit(util['format'](_0xdf37('0x7e'),_0x29b2d3[_0xdf37('0x3f')]),'campaign:save',_0x29b2d3);}}function checkGetDataPredictive(_0x5bb515){if(isNotNull(_0x5bb515)){if(!_[_0xdf37('0x47')](_0x5bb515)){loggerPredictive[_0xdf37('0x7f')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x80'),_0x5bb515['predictiveIntervalTotalCalls']);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x81'),_0x5bb515['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xdf37('0x7f')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bb515[_0xdf37('0x6d')]);loggerPredictive[_0xdf37('0x7f')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bb515['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xdf37('0x7f')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bb515['predictiveIntervalAvgHoldtime']);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bb515[_0xdf37('0x6b')]);loggerPredictive['info']('---------------------------');if(_0x5bb515['predictiveIntervalTotalCalls']>0x0){if(!_[_0xdf37('0x3c')](_0x5bb515[_0xdf37('0x6b')])&&_0x5bb515['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xdf37('0x3c')](_0x5bb515[_0xdf37('0x6a')])&&_0x5bb515[_0xdf37('0x6a')]>0x0){return!![];}else{loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x82'));}}else{loggerPredictive[_0xdf37('0x7f')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x83'));}}else{loggerPredictive['info'](_0xdf37('0x83'));}return![];}function mergeDataErlangB(_0x300db2){return function(_0x11e50a){loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x84'));loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x85'),_0x11e50a[_0xdf37('0x75')]);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x86'),_0x11e50a['erlangCallToSecond']);loggerPredictive[_0xdf37('0x7f')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11e50a[_0xdf37('0x77')]);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x87'),_0x11e50a['erlangBusyFactor']);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x88'),_0x11e50a[_0xdf37('0x77')]);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x89'));_[_0xdf37('0x8a')](_0x300db2,_0x11e50a);};}function getDiff(_0xb688e0){var _0x2cdfd0=moment()[_0xdf37('0x4a')](0x0);var _0xf72f0=moment(_0xb688e0)[_0xdf37('0x4a')](0x0);return _0x2cdfd0[_0xdf37('0x4b')](_0xf72f0,_0xdf37('0x4c'));}function ifInterval(_0x37cc2b,_0x3558f1){if(_[_0xdf37('0x3c')](_0x3558f1)){return![];}if(getDiff(_0x3558f1)<_0x37cc2b*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1a21bc){if(isNotNull(_0x1a21bc)){if(!_['isUndefined'](_0x1a21bc[_0xdf37('0x8b')])){_0x1a21bc['startProgressive']=undefined;loggerPredictive[_0xdf37('0x7f')](_0x1a21bc[_0xdf37('0x3f')],_0xdf37('0x8c'));}if(!_[_0xdf37('0x3c')](_0x1a21bc[_0xdf37('0x29')])){_0x1a21bc[_0xdf37('0x29')]=undefined;loggerPredictive['info'](_0x1a21bc[_0xdf37('0x3f')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xdf37('0x3c')](_0x1a21bc['handlePredictive'])){clearInterval(_0x1a21bc['handlePredictive']);_0x1a21bc[_0xdf37('0x8d')]=undefined;loggerPredictive['info'](_0x1a21bc[_0xdf37('0x3f')],_0xdf37('0x8e'));}}}function erlangb(_0x383bab,_0x549b05){if(_0x549b05===0x0){return 0x0;}var _0x3c0b5c=0x1;for(var _0x28400e=0x1;_0x28400e<=_0x549b05;_0x28400e+=0x1){_0x3c0b5c=0x1+_0x3c0b5c*_0x28400e/_0x383bab;}return 0x1/_0x3c0b5c;}function isVoiceQueueOutbound(_0x2b588f){return _0x2b588f===_0xdf37('0x8f');}function isNotPreview(_0x2deae1){return _0x2deae1!==_0xdf37('0x20');}function isCampaignIvr(_0x37c641){return _0x37c641===_0xdf37('0x7d');}function getCallerId(_0x481fd0,_0x148450,_0x586c8c){if(!_[_0xdf37('0x3c')](_0x586c8c)&&_0xdf37('0x90')===typeof _0x586c8c&&!_[_0xdf37('0x47')](_0x586c8c)){if(!_[_0xdf37('0x3c')](_0x148450)&&_0xdf37('0x90')===typeof _0x148450&&!_[_0xdf37('0x47')](_0x148450)){return util[_0xdf37('0x7a')](_0xdf37('0x91'),_0x148450,_0x586c8c);}return util[_0xdf37('0x7a')]('\x22%s\x22\x20<%s>',_0x586c8c,_0x586c8c);}if(!_[_0xdf37('0x3c')](_0x481fd0)&&_0xdf37('0x90')===typeof _0x481fd0&&!_['isEmpty'](_0x481fd0)){return _0x481fd0;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2f82fa,_0xde59f4){return function(_0x6f51db){freeVariablesPredictive(_0xde59f4);emitVoiceQueueSummary(_0xde59f4);emitCampaignSummary(_0xde59f4);loggerSyncQueueSummary[_0xdf37('0x92')](_0x2f82fa,util[_0xdf37('0x93')](_0x6f51db,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x26a461,_0x34bf6d){return function(_0x1503cb){loggerPredictive[_0xdf37('0x92')](_0x34bf6d['name'],_0x26a461);loggerPredictive[_0xdf37('0x92')](_0x1503cb[_0xdf37('0x94')]);freeVariablesPredictive(_0x34bf6d);};}function loggerCatch(_0xf966fb){return function(_0x35755a){logger[_0xdf37('0x92')](_0xf966fb,util[_0xdf37('0x93')](_0x35755a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x520c8a){return _0x520c8a&&!_['isUndefined'](_0x520c8a)&&_0x520c8a[_0xdf37('0x95')]>0x0;}function decremetOriginate(_0x46b6af){if(!_[_0xdf37('0x3c')](_0x46b6af)&&_0x46b6af!==null){if(_0x46b6af[_0xdf37('0x96')](_0xdf37('0x74'))){if(_0x46b6af[_0xdf37('0x74')]>0x0){_0x46b6af[_0xdf37('0x74')]-=0x1;}else{logger['error'](_0xdf37('0x97'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x5bc921,_0x3837a7,_0x5a6cab){if(_0x3837a7>_0x5a6cab){for(var _0x14c3c1=0x0;_0x14c3c1<_0x3837a7-_0x5a6cab;_0x14c3c1+=0x1){decremetOriginate(_0x5bc921);}}}function loggerGetContactDialer(_0xd03122,_0x124579,_0x2a24b6){return function(_0x704627){checkContactLowerLimitOriginate(_0x124579,_0x2a24b6,0x0);logger[_0xdf37('0x92')](_0xd03122,util[_0xdf37('0x93')](_0x704627,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3204f3){return function(_0x5ded61){if(isNotNull(_0x5ded61)&&isNotNull(_0x5ded61[0x0])){if(_0x5ded61[0x0][_0xdf37('0x98')]>0x0){_0x3204f3[_0xdf37('0x3d')]=_0xdf37('0x99');logger['info'](_0xdf37('0x9a')+_0x3204f3[_0xdf37('0x3f')],_0x5ded61[0x0]['contactsRescheduled'],_0xdf37('0x9b'));}else{_0x3204f3[_0xdf37('0x3d')]=_0xdf37('0x9c');logger[_0xdf37('0x7f')](_0xdf37('0x9d')+_0x3204f3['name']);}}};}function notSendMessagesQueue(_0x4e636d){if(_0x4e636d[_0xdf37('0x9e')]){freeVariablesPredictive(_0x4e636d);if(_0x4e636d[_0xdf37('0x74')]===0x0&&_0x4e636d[_0xdf37('0x55')]===0x0&&_0x4e636d[_0xdf37('0x59')]===0x0&&(_0x4e636d[_0xdf37('0x52')]||0x0)===0x0){_0x4e636d['sendMessageOneNotActive']=![];_0x4e636d['available']=0x0;_0x4e636d['message']='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xdf37('0x9f'),_0x4e636d[_0xdf37('0x3f')],_0xdf37('0xa0'));}else{_0x4e636d[_0xdf37('0x3d')]=_0xdf37('0xa1');loggerSyncQueueSummary['error'](_0xdf37('0x9f'),_0x4e636d[_0xdf37('0x3f')],_0xdf37('0xa2'));}emitVoiceQueueSummary(_0x4e636d);}}function notSendMessagesCampaign(_0x2076c2){if(_0x2076c2[_0xdf37('0x9e')]){if(_0x2076c2['originated']===0x0){_0x2076c2['sendMessageOneNotActive']=![];_0x2076c2[_0xdf37('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xdf37('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2076c2[_0xdf37('0x3f')],_0xdf37('0xa0'));}else{_0x2076c2['message']=_0xdf37('0xa1');loggerSyncQueueSummary[_0xdf37('0x92')](_0xdf37('0xa3'),_0x2076c2['name'],'is\x20disactive');}emitCampaignSummary(_0x2076c2);}}function createObjHistory(_0x4fe1a0,_0x64fdd0,_0x595f6c,_0x97a279,_0x202aa3){_0x4fe1a0[_0xdf37('0x3d')]=_0x595f6c;var _0x1727d3=new Action(_0x4fe1a0,_0x64fdd0);var _0x32274a=new History(_0x1727d3);_0x32274a['state']=_0x97a279;_0x32274a[_0xdf37('0xa4')]=_0x202aa3;_0x32274a[_0xdf37('0xa5')]=_0x1727d3[_0xdf37('0xa6')];return _0x32274a;}Dialer[_0xdf37('0x1d')][_0xdf37('0x3b')]=function(){var _0x441447=this;setInterval(function(){_0x441447['clearZombieChannels'](_0x441447[_0xdf37('0xa7')],'[uniqueid]');_0x441447[_0xdf37('0xa8')](_0x441447[_0xdf37('0x27')],_0xdf37('0xa9'));},0x32c8);};Dialer[_0xdf37('0x1d')][_0xdf37('0xa8')]=function(_0x1d4635,_0x44936f){var _0x4a7f7b=this;for(var _0x4e291a in _0x1d4635){if(_0x1d4635[_0xdf37('0x96')](_0x4e291a)){this[_0xdf37('0xaa')][_0xdf37('0xab')](function(){if(!_[_0xdf37('0xac')](_0x1d4635[_0x4e291a])){return ami['Action']({'action':_0xdf37('0xad'),'channel':_0x1d4635[_0x4e291a][_0xdf37('0xae')]})['catch'](function(_0x1a52fa){if(_0x1a52fa['message']===_0xdf37('0xaf')){setTimeout(function(){if(_0x1d4635[_0x4e291a]&&_0x1d4635[_0x4e291a][_0xdf37('0x4e')]!==_0xdf37('0x7d')){_0x4a7f7b[_0xdf37('0xb0')](_0x4a7f7b['voiceQueues'][_0x1d4635[_0x4e291a][_0xdf37('0xb1')]]);logger['error']('[Dialer][checkChannel]',_0x44936f,_0x4e291a,_0x1d4635[_0x4e291a][_0xdf37('0xb1')]);delete _0x1d4635[_0x4e291a];}if(_0x1d4635[_0x4e291a]&&_0x1d4635[_0x4e291a]['type']===_0xdf37('0x7d')){_0x4a7f7b[_0xdf37('0xb0')](_0x4a7f7b['campaigns'][_0x1d4635[_0x4e291a]['queue']]);logger[_0xdf37('0x92')](_0xdf37('0xb2'),_0x44936f,_0x4e291a,_0x1d4635[_0x4e291a][_0xdf37('0xb1')]);delete _0x1d4635[_0x4e291a];}},0x2328);}});}});}}};Dialer[_0xdf37('0x1d')][_0xdf37('0xb3')]=function(_0x5c5170){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopper['countReScheduled'](_0x5c5170))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xb7')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xb8')]=function(_0x2a5660){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopperBlack[_0xdf37('0xb8')](_0x2a5660))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xb9')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xba')]=function(_0x43202f){return BPromise[_0xdf37('0xb4')]()['then'](cmHopperBlack[_0xdf37('0xba')](_0x43202f))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xbb')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xbc')]=function(_0x510ed6){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopperHistory['avgHandleTime'](_0x510ed6))['catch'](loggerCatch(_0xdf37('0xbd')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xbe')]=function(_0x26c86b){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopper['rescheduleContact'](_0x26c86b))['catch'](loggerCatch(_0xdf37('0xbf')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xc0')]=function(_0x48918f,_0x14e9d5,_0x1df52d){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopper[_0xdf37('0xc0')](_0x48918f,_0x14e9d5,_0x1df52d))[_0xdf37('0xb6')](loggerCatch('[unlockContact]\x20'));};Dialer['prototype']['getContactDialer']=function(_0x4e96fe,_0x210f6e,_0x178adc,_0x1b30a4){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopper['getContactDialer'](_0x4e96fe,_0x210f6e,_0x178adc,_0x1b30a4))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xc1')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xc2')]=function(_0x61925e,_0x431fa4,_0x3696fc){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](cmHopper[_0xdf37('0xc2')](_0x61925e,_0x431fa4,_0x3696fc))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xdf37('0x1d')]['getVoiceQueueRtPauses']=function(_0x34a440){return BPromise[_0xdf37('0xb4')]()[_0xdf37('0xb5')](voiceQueueRt['getVoiceQueueRtPauses'](_0x34a440))[_0xdf37('0xb6')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0xdf37('0xc3')]=function(_0x469084){return BPromise[_0xdf37('0xb4')]()['then'](cmHopper[_0xdf37('0xc3')](_0x469084))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xc4')));};Dialer[_0xdf37('0x1d')][_0xdf37('0xc5')]=function(_0x272678){return BPromise[_0xdf37('0xb4')]()['then'](cmHopperHistory['createHistory'](_0x272678))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xc6')));};Dialer['prototype'][_0xdf37('0xb0')]=function(_0x1be2c8){if(!_[_0xdf37('0x3c')](_0x1be2c8)&&_0x1be2c8!==null){if(_0x1be2c8['hasOwnProperty'](_0xdf37('0x74'))){if(_0x1be2c8['originated']>0x0){_0x1be2c8[_0xdf37('0x74')]-=0x1;}else{logger['error'](_0xdf37('0xc7'));}}}else{logger[_0xdf37('0x92')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xdf37('0xc8')]=function(_0x468bb6,_0x5c8d69){var _0x3df3c2=this;return function(_0x642c3){_0x3df3c2[_0xdf37('0xb0')](_0x5c8d69);logger[_0xdf37('0x92')](_0x468bb6,util['inspect'](_0x642c3,{'showHidden':![],'depth':null}));};};Dialer[_0xdf37('0x1d')][_0xdf37('0xc9')]=function(_0x4c34d0,_0x412b7f,_0x24997b){var _0x4ed704={'state':0x19,'statedesc':'notFound'};this[_0xdf37('0xb0')](_0x412b7f);this[_0xdf37('0xca')](_[_0xdf37('0x8a')](_0x4ed704,_['pick'](_0x24997b,[_0xdf37('0xcb'),_0xdf37('0xcc'),_0xdf37('0xcd'),_0xdf37('0xce'),_0xdf37('0xcf')])),_0xdf37('0xd0'),_0xdf37('0xd1'));logger[_0xdf37('0x92')](_0x4c34d0);};Dialer['prototype'][_0xdf37('0xd2')]=function(_0x715600){return _0x715600===_0xdf37('0xd3');};Dialer[_0xdf37('0x1d')][_0xdf37('0xd4')]=function(_0x465039){return!_['isUndefined'](_0x465039)&&_0x465039&&!_[_0xdf37('0x3c')](_0x465039[_0xdf37('0x3f')])&&!_[_0xdf37('0x3c')](_0x465039[_0xdf37('0xd5')])&&_0x465039['active']&&(this[_0xdf37('0x24')][util['format']('SIP/%s',_0x465039['name'])][_0xdf37('0xad')]===_0xdf37('0xd6')||this[_0xdf37('0x24')][util[_0xdf37('0x7a')](_0xdf37('0xd7'),_0x465039[_0xdf37('0x3f')])][_0xdf37('0xad')]===_0xdf37('0xd8'));};Dialer[_0xdf37('0x1d')]['saveInDb']=function(_0x17072d,_0xb0694a,_0x2a7ef0){this[_0xdf37('0xc5')](_0x17072d)['catch'](loggerCatch(_0xb0694a));this['moveContactManagedDialer'](_0x17072d)[_0xdf37('0xb6')](loggerCatch(_0x2a7ef0));};Dialer['prototype'][_0xdf37('0xd9')]=function(_0x31af59){var _0xb5681d=this[_0xdf37('0xa7')][_0x31af59[_0xdf37('0xda')]];var _0xb4a728;if(!_[_0xdf37('0xac')](_0x31af59)&&!_[_0xdf37('0xac')](_0x31af59['variable'])&&!_[_0xdf37('0xac')](_0x31af59[_0xdf37('0xdb')][_0xdf37('0xdc')])&&_0x31af59[_0xdf37('0xdd')]===_0xdf37('0xde')&&_0xb5681d){if(_0xb5681d['type']!==_0xdf37('0x7d')&&this[_0xdf37('0x21')][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0xdf')]&&_0x31af59[_0xdf37('0xe0')]===_0xdf37('0xe1')){delete this[_0xdf37('0xa7')][_0x31af59[_0xdf37('0xda')]];this[_0xdf37('0xb0')](this[_0xdf37('0x21')][_0xb5681d[_0xdf37('0xb1')]]);this['voiceQueues'][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0xe2')]+=0x1;this[_0xdf37('0x21')][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0x61')]+=0x1;_0xb4a728=new Hangup(_0xb5681d,_0x31af59);_0xb4a728[_0xdf37('0xe3')]=0x12;_0xb4a728[_0xdf37('0xa4')]=_0xdf37('0xe4');_0xb4a728[_0xdf37('0xe5')]='AMD';this[_0xdf37('0xca')](_0xb4a728,'[syncHangupInAMD][createHistory]','[syncHangupInAMD]');}if(_0xb5681d['type']!=='ivr'&&this[_0xdf37('0x21')][_0xb5681d['queue']][_0xdf37('0xdf')]&&_0x31af59[_0xdf37('0xe0')]===_0xdf37('0xe6')){var _0x35fcb3=this;return new BPromise(function(_0x51ad01,_0x598967){delete _0x35fcb3['uniqueId'][_0x31af59[_0xdf37('0xda')]];_0x35fcb3[_0xdf37('0xb0')](_0x35fcb3[_0xdf37('0x21')][_0xb5681d[_0xdf37('0xb1')]]);_0x35fcb3[_0xdf37('0x21')][_0xb5681d[_0xdf37('0xb1')]]['outboundAnswerCallsDay']+=0x1;_0x35fcb3[_0xdf37('0x21')][_0xb5681d['queue']][_0xdf37('0x61')]+=0x1;var _0x23b698=_0x35fcb3[_0xdf37('0x21')][_0xb5681d['queue']];var _0x4933e0=new Hangup(_0xb5681d,_0x31af59);_0x4933e0[_0xdf37('0xe3')]=0x13;_0x4933e0[_0xdf37('0xa4')]='Machine';_0x4933e0[_0xdf37('0xe5')]=_0xdf37('0xe7');_0x4933e0[_0xdf37('0xe8')]+=0x1;_0x4933e0['countglobal']+=0x1;_0x4933e0[_0xdf37('0xe9')]=!![];_0x35fcb3[_0xdf37('0xc5')](_0x4933e0)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4933e0[_0xdf37('0xea')]+_0x4933e0[_0xdf37('0xeb')]+_0x4933e0[_0xdf37('0xec')]+_0x4933e0[_0xdf37('0xed')]+_0x4933e0[_0xdf37('0xee')]+_0x4933e0[_0xdf37('0xef')]+_0x4933e0[_0xdf37('0xe8')]+_0x4933e0[_0xdf37('0xf0')]>=_0x23b698['dialGlobalMaxRetry']){_0x35fcb3['stateGlobal'](_0x4933e0,_0x51ad01,_0x598967,'reason19\x20machine....');}else{if(_0x4933e0['countmachineretry']>=_0x23b698[_0xdf37('0xf1')]){_0x35fcb3[_0xdf37('0xf2')](_0x4933e0,_0x51ad01,_0x598967,_0xdf37('0xf3'));}else{_0x35fcb3['rescheduleContact']({'active':![],'countmachineretry':_0x4933e0[_0xdf37('0xe8')],'scheduledat':moment()[_0xdf37('0xf4')](_0x23b698[_0xdf37('0xf5')],_0xdf37('0xf6'))[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0x4933e0['ContactId'],'ListId':_0x4933e0[_0xdf37('0xcc')],'VoiceQueueId':_0x4933e0[_0xdf37('0xce')]||undefined,'CampaignId':_0x4933e0[_0xdf37('0xcf')]||undefined})['catch'](loggerCatch(_0xdf37('0xf8')));_0x51ad01({'reschedule':0x1});}}});}if(_0xb5681d[_0xdf37('0x4e')]==='ivr'&&this['campaigns'][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0xdf')]&&_0x31af59[_0xdf37('0xe0')]===_0xdf37('0xe1')){delete this[_0xdf37('0xa7')][_0x31af59[_0xdf37('0xda')]];this['updateOriginated'](this['campaigns'][_0xb5681d[_0xdf37('0xb1')]]);_0xb4a728=new Hangup(_0xb5681d,_0x31af59);_0xb4a728['state']=0x12;_0xb4a728[_0xdf37('0xa4')]='HangupInAMD';_0xb4a728[_0xdf37('0xe5')]=_0xdf37('0xe7');this[_0xdf37('0xca')](_0xb4a728,_0xdf37('0xf9'),_0xdf37('0xfa'));}if(_0xb5681d['type']==='ivr'&&this[_0xdf37('0x22')][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0xdf')]&&_0x31af59[_0xdf37('0xe0')]===_0xdf37('0xe6')){var _0x35fcb3=this;return new BPromise(function(_0x48b668,_0xfd866a){delete _0x35fcb3[_0xdf37('0xa7')][_0x31af59[_0xdf37('0xda')]];_0x35fcb3['updateOriginated'](_0x35fcb3[_0xdf37('0x22')][_0xb5681d[_0xdf37('0xb1')]]);_0x35fcb3['campaigns'][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0xe2')]+=0x1;_0x35fcb3['campaigns'][_0xb5681d[_0xdf37('0xb1')]][_0xdf37('0x61')]+=0x1;var _0x1bd0e6=_0x35fcb3[_0xdf37('0x22')][_0xb5681d['queue']];var _0x2851c1=new Hangup(_0xb5681d,_0x31af59);_0x2851c1['state']=0x13;_0x2851c1[_0xdf37('0xa4')]=_0xdf37('0xfb');_0x2851c1[_0xdf37('0xe5')]=_0xdf37('0xe7');_0x2851c1['countmachineretry']+=0x1;_0x2851c1[_0xdf37('0xfc')]+=0x1;_0x2851c1[_0xdf37('0xe9')]=!![];_0x35fcb3[_0xdf37('0xc5')](_0x2851c1)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xfd')));if(_0x2851c1[_0xdf37('0xea')]+_0x2851c1[_0xdf37('0xeb')]+_0x2851c1['countnoanswerretry']+_0x2851c1[_0xdf37('0xed')]+_0x2851c1[_0xdf37('0xee')]+_0x2851c1[_0xdf37('0xef')]+_0x2851c1[_0xdf37('0xe8')]+_0x2851c1['countagentrejectretry']>=_0x1bd0e6['dialGlobalMaxRetry']){_0x35fcb3[_0xdf37('0xfe')](_0x2851c1,_0x48b668,_0xfd866a,'reason19\x20machine....');}else{if(_0x2851c1[_0xdf37('0xe8')]>=_0x1bd0e6[_0xdf37('0xf1')]){_0x35fcb3[_0xdf37('0xf2')](_0x2851c1,_0x48b668,_0xfd866a,'reason\x2019\x20machine....');}else{_0x35fcb3[_0xdf37('0xbe')]({'active':![],'countmachineretry':_0x2851c1[_0xdf37('0xe8')],'scheduledat':moment()[_0xdf37('0xf4')](_0x1bd0e6[_0xdf37('0xf5')],_0xdf37('0xf6'))[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0x2851c1[_0xdf37('0xcb')],'ListId':_0x2851c1[_0xdf37('0xcc')],'VoiceQueueId':_0x2851c1['VoiceQueueId']||undefined,'CampaignId':_0x2851c1['CampaignId']||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xf8')));_0x48b668({'reschedule':0x1});}}});}}};Dialer[_0xdf37('0x1d')]['syncHangup']=function(_0x4557bb){var _0x7995d0=this[_0xdf37('0xa7')][_0x4557bb[_0xdf37('0xda')]];var _0x4109ce=this;var _0x54e462;if(_0x7995d0&&_0x7995d0[_0xdf37('0x4e')]===_0xdf37('0x7d')){delete this[_0xdf37('0xa7')][_0x4557bb['uniqueid']];this['updateOriginated'](this['campaigns'][_0x7995d0[_0xdf37('0xb1')]]);this['campaigns'][_0x7995d0[_0xdf37('0xb1')]][_0xdf37('0xff')]+=0x1;_0x54e462=new Hangup(_0x7995d0,_0x4557bb);this[_0xdf37('0xc5')](_0x54e462)['catch'](loggerCatch(_0xdf37('0x100')));this['moveContactManagedDialer'](_0x54e462)['catch'](loggerCatch(_0xdf37('0x101')));}if(_0x7995d0&&_0x7995d0[_0xdf37('0x4e')]!==_0xdf37('0x7d')&&isNotNull(this[_0xdf37('0x21')][_0x7995d0[_0xdf37('0xb1')]][_0xdf37('0x102')])){delete this[_0xdf37('0xa7')][_0x4557bb[_0xdf37('0xda')]];this['updateOriginated'](this[_0xdf37('0x21')][_0x7995d0[_0xdf37('0xb1')]]);this['voiceQueues'][_0x7995d0[_0xdf37('0xb1')]][_0xdf37('0xe2')]+=0x1;this[_0xdf37('0x21')][_0x7995d0[_0xdf37('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x54e462=new Hangup(_0x7995d0,_0x4557bb);_0x54e462[_0xdf37('0xe3')]=0x10;_0x54e462[_0xdf37('0xa4')]=_0xdf37('0x103');_0x54e462['membername']=_0xdf37('0x104');this[_0xdf37('0xc5')](_0x54e462)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x100')));this['moveContactManagedDialer'](_0x54e462)[_0xdf37('0xb6')](loggerCatch('[syncHangupIvr]'));}if(_0x7995d0&&_0x7995d0[_0xdf37('0x4e')]!==_0xdf37('0x7d')&&!isNotNull(this[_0xdf37('0x21')][_0x7995d0[_0xdf37('0xb1')]][_0xdf37('0x102')])){delete this[_0xdf37('0xa7')][_0x4557bb[_0xdf37('0xda')]];this[_0xdf37('0xb0')](this[_0xdf37('0x21')][_0x7995d0['queue']]);this[_0xdf37('0x21')][_0x7995d0[_0xdf37('0xb1')]][_0xdf37('0x105')]+=0x1;_0x54e462=new Hangup(_0x7995d0,_0x4557bb);_0x54e462[_0xdf37('0xe3')]=0xc;_0x54e462[_0xdf37('0xa4')]=_0x4557bb[_0xdf37('0x106')];_0x54e462[_0xdf37('0xe5')]='Unknow';this[_0xdf37('0xc5')](_0x54e462)['catch'](loggerCatch(_0xdf37('0x100')));this[_0xdf37('0xc3')](_0x54e462)[_0xdf37('0xb6')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0xdf37('0x107')]=function(_0x351d64){var _0x59d1da=this[_0xdf37('0xa7')][_0x351d64[_0xdf37('0xda')]];var _0x463ff3=this;if(this[_0xdf37('0x21')][_0x351d64[_0xdf37('0xb1')]]){if(_0x59d1da&&_0x59d1da[_0xdf37('0x4e')]!==_0xdf37('0x7d')){delete this['uniqueId'][_0x351d64[_0xdf37('0xda')]];this['voiceQueues'][_0x351d64[_0xdf37('0xb1')]][_0xdf37('0xe2')]+=0x1;var _0x53aeca=new AgentComplete(_0x59d1da,_0x351d64);if(_0x351d64[_0xdf37('0x108')]===_0xdf37('0x109')){_0x53aeca['agiafterat']=this['voiceQueues'][_0x351d64[_0xdf37('0xb1')]][_0xdf37('0x10a')]&&this['voiceQueues'][_0x351d64['queue']][_0xdf37('0x10b')]?moment()[_0xdf37('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xdf37('0xc5')](_0x53aeca)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x10c')));this[_0xdf37('0xc3')](_0x53aeca)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x10d')));}}};Dialer[_0xdf37('0x1d')]['syncAgentConnect']=function(_0x2eb374){if(this[_0xdf37('0x21')][_0x2eb374['queue']]){if(this['uniqueId'][_0x2eb374[_0xdf37('0xda')]]&&this[_0xdf37('0xa7')][_0x2eb374[_0xdf37('0xda')]][_0xdf37('0x4e')]!==_0xdf37('0x7d')){this['updateOriginated'](this[_0xdf37('0x21')][_0x2eb374[_0xdf37('0xb1')]]);this[_0xdf37('0xa7')][_0x2eb374['uniqueid']][_0xdf37('0x10e')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));}}};Dialer[_0xdf37('0x1d')][_0xdf37('0x10f')]=function(_0xafdc66){this[_0xdf37('0xc5')](_0xafdc66)[_0xdf37('0xb6')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0xdf37('0xc3')](_0xafdc66)[_0xdf37('0xb6')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0xdf37('0x1d')][_0xdf37('0x2f')]=function(_0x121969){var _0x7a8e=this['uniqueId'][_0x121969['uniqueid']];var _0x47fc8a=this;if(this[_0xdf37('0x21')][_0x121969[_0xdf37('0xb1')]]){if(_0x7a8e&&_0x7a8e[_0xdf37('0x4e')]!=='ivr'){delete this['uniqueId'][_0x121969[_0xdf37('0xda')]];this[_0xdf37('0xb0')](this[_0xdf37('0x21')][_0x121969['queue']]);_0x7a8e[_0xdf37('0x110')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));var _0x5c2c04=new QueueCallerAbandon(_0x7a8e,_0x121969);if(getSeconds(_0x7a8e[_0xdf37('0x110')],_0x7a8e['responsetime'])>=_0x7a8e['dialQueueTimeout']){this[_0xdf37('0x21')][_0x121969['queue']][_0xdf37('0x6d')]+=0x1;this[_0xdf37('0x21')][_0x121969[_0xdf37('0xb1')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xdf37('0x21')][_0x121969['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x5c2c04[_0xdf37('0xe3')]=0xa;_0x5c2c04[_0xdf37('0xa4')]=_0xdf37('0x111');_0x5c2c04[_0xdf37('0x112')]='TIMEOUT';_0x5c2c04['agiafterat']=this[_0xdf37('0x21')][_0x121969[_0xdf37('0xb1')]]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x5c2c04['countdropretry']+=0x1;_0x5c2c04[_0xdf37('0xfc')]+=0x1;if(_0x5c2c04[_0xdf37('0xee')]>=this[_0xdf37('0x21')][_0x121969[_0xdf37('0xb1')]][_0xdf37('0x113')]){this['queueCallerAbandonCreateState'](_0x5c2c04);}else{this[_0xdf37('0xbe')]({'active':![],'countdropretry':_0x5c2c04[_0xdf37('0xee')],'scheduledat':moment()[_0xdf37('0xf4')](this['voiceQueues'][_0x121969[_0xdf37('0xb1')]][_0xdf37('0x114')],'minutes')['format'](_0xdf37('0xf7')),'ContactId':_0x7a8e[_0xdf37('0xcb')],'ListId':_0x7a8e['ListId'],'VoiceQueueId':_0x7a8e[_0xdf37('0xce')]||undefined,'CampaignId':_0x7a8e[_0xdf37('0xcf')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x160f49=new History(_0x5c2c04);_0x160f49[_0xdf37('0xe3')]=0xa;_0x160f49[_0xdf37('0xa4')]=_0xdf37('0x111');_0x160f49[_0xdf37('0xa6')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));_0x160f49['endtime']=_0x160f49[_0xdf37('0xa6')];_0x160f49['calleridname']=_0x5c2c04['calleridname'];_0x160f49[_0xdf37('0x115')]=_0x5c2c04[_0xdf37('0x115')];this['createHistory'](_0x160f49)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x116')));}}else{this[_0xdf37('0x21')][_0x121969['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xdf37('0x21')][_0x121969['queue']][_0xdf37('0x64')]+=0x1;_0x5c2c04[_0xdf37('0xe3')]=0xb;_0x5c2c04[_0xdf37('0xa4')]=_0xdf37('0x117');_0x5c2c04[_0xdf37('0x112')]=_0xdf37('0x118');_0x5c2c04[_0xdf37('0xef')]+=0x1;_0x5c2c04['countglobal']+=0x1;if(_0x5c2c04[_0xdf37('0xef')]>=this[_0xdf37('0x21')][_0x121969[_0xdf37('0xb1')]]['dialAbandonedMaxRetry']){this[_0xdf37('0x10f')](_0x5c2c04);}else{this[_0xdf37('0xbe')]({'active':![],'countabandonedretry':_0x5c2c04[_0xdf37('0xef')],'scheduledat':moment()[_0xdf37('0xf4')](this[_0xdf37('0x21')][_0x121969[_0xdf37('0xb1')]][_0xdf37('0x119')],_0xdf37('0xf6'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x7a8e[_0xdf37('0xcb')],'ListId':_0x7a8e[_0xdf37('0xcc')],'VoiceQueueId':_0x7a8e['VoiceQueueId']||undefined,'CampaignId':_0x7a8e[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x11a')));var _0x160f49=new History(_0x5c2c04);_0x160f49['state']=0xb;_0x160f49[_0xdf37('0xa4')]=_0xdf37('0x117');_0x160f49[_0xdf37('0xa6')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));_0x160f49[_0xdf37('0xa5')]=_0x160f49[_0xdf37('0xa6')];_0x160f49[_0xdf37('0x11b')]=_0x5c2c04[_0xdf37('0x11b')];_0x160f49['calleridnum']=_0x5c2c04[_0xdf37('0x115')];this['createHistory'](_0x160f49)['catch'](loggerCatch(_0xdf37('0x11c')));}}}}};Dialer[_0xdf37('0x1d')][_0xdf37('0x11d')]=function(_0x3fc862){if(this[_0xdf37('0x27')][_0x3fc862[_0xdf37('0xda')]]){this[_0xdf37('0x27')][_0x3fc862[_0xdf37('0xda')]][_0xdf37('0xae')]=_0x3fc862['channel'];}if(this[_0xdf37('0xa7')][_0x3fc862[_0xdf37('0xda')]]){this[_0xdf37('0xa7')][_0x3fc862[_0xdf37('0xda')]][_0xdf37('0xae')]=_0x3fc862['channel'];}};Dialer[_0xdf37('0x1d')][_0xdf37('0x39')]=function(_0x2a8fa1){if(strategy[this[_0xdf37('0x21')][this[_0xdf37('0x27')][_0x2a8fa1[_0xdf37('0x11e')]][_0xdf37('0xb1')]][_0xdf37('0x11f')]]==='roundrobin'){if(this[_0xdf37('0x27')][_0x2a8fa1['actionid']]&&_[_0xdf37('0xac')](this['actions'][_0x2a8fa1['actionid']][_0xdf37('0x120')])&&_0x2a8fa1[_0xdf37('0xad')]==='1'&&_0x2a8fa1[_0xdf37('0x121')]==='0'){if(this['agents'][_0x2a8fa1[_0xdf37('0x122')]]){if(!this['agents'][_0x2a8fa1[_0xdf37('0x122')]]['locked']){this['agents'][_0x2a8fa1['stateinterface']][_0xdf37('0x120')]=!![];this['actions'][_0x2a8fa1[_0xdf37('0x11e')]][_0xdf37('0x120')]=!![];this[_0xdf37('0x27')][_0x2a8fa1[_0xdf37('0x11e')]][_0xdf37('0x122')]=_0x2a8fa1[_0xdf37('0x122')];}}}}else if((strategy[this['voiceQueues'][this[_0xdf37('0x27')][_0x2a8fa1[_0xdf37('0x11e')]][_0xdf37('0xb1')]][_0xdf37('0x11f')]]||_0xdf37('0x1b'))==='rrmemory'){if(this[_0xdf37('0x27')][_0x2a8fa1[_0xdf37('0x11e')]]){if(this[_0xdf37('0x23')][_0x2a8fa1['stateinterface']]){this[_0xdf37('0x27')][_0x2a8fa1['actionid']]['stateinterface']=_0x2a8fa1[_0xdf37('0x122')];if(_['isNil'](this[_0xdf37('0x2a')][this[_0xdf37('0x27')][_0x2a8fa1['actionid']]['queue']])){this[_0xdf37('0x2a')][this['actions'][_0x2a8fa1[_0xdf37('0x11e')]][_0xdf37('0xb1')]]=[];}this[_0xdf37('0x2a')][this['actions'][_0x2a8fa1['actionid']]['queue']][_0xdf37('0x123')](_[_0xdf37('0x8a')](_[_0xdf37('0x124')](this[_0xdf37('0x27')][_0x2a8fa1[_0xdf37('0x11e')]],[_0xdf37('0x125'),_0xdf37('0x122')]),{'status':_0x2a8fa1[_0xdf37('0xad')],'paused':_0x2a8fa1['paused']}));}}}};function unlockQueueStatus(_0x1d8929,_0x3f2166){setTimeout(function(){if(_[_0xdf37('0x3c')](_0x1d8929[_0xdf37('0x126')])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x3f2166);}_0x1d8929[_0xdf37('0x126')]=!![];loggerBooked[_0xdf37('0x7f')](_0xdf37('0x127'),_0x3f2166,JSON[_0xdf37('0x49')](_['pick'](_0x1d8929,[_0xdf37('0x3f'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xdf37('0x1d')][_0xdf37('0x128')]=function(_0x425d39){var _0x31ec53=this;var _0x5d05e5=_0x31ec53[_0xdf37('0x21')][_0x31ec53[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xb1')]];if(strategy[this[_0xdf37('0x21')][this['actions'][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xb1')]][_0xdf37('0x11f')]]===_0xdf37('0x1c')){if(this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]]&&this[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0x122')]){this[_0xdf37('0x20')][_0xdf37('0x129')](this[_0xdf37('0x27')][_0x425d39['actionid']]['idHopper'],this[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0x122')])['catch'](function(_0x537806){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xdf37('0x93')](_0x537806,{'showHidden':![],'depth':null}));})[_0xdf37('0x1f')](function(){_0x31ec53[_0xdf37('0xb0')](_0x31ec53[_0xdf37('0x21')][_0x31ec53[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0xb1')]]);_0x31ec53['agents'][_0x31ec53[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]]['stateinterface']]['locked']=![];delete _0x31ec53['actions'][_0x425d39[_0xdf37('0x11e')]];unlockQueueStatus(_0x5d05e5);});}else{this['updateOriginated'](this[_0xdf37('0x21')][this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xb1')]]);this[_0xdf37('0xbe')]({'active':![],'ContactId':this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xcb')],'ListId':this[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0xcc')],'VoiceQueueId':this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xce')]||undefined,'CampaignId':this[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0xcf')]||undefined})['catch'](loggerCatch(_0xdf37('0x12a')));delete this['actions'][_0x425d39[_0xdf37('0x11e')]];unlockQueueStatus(_0x5d05e5);}}else if((strategy[this[_0xdf37('0x21')][this[_0xdf37('0x27')][_0x425d39['actionid']]['queue']][_0xdf37('0x11f')]]||_0xdf37('0x1b'))===_0xdf37('0x1b')){var _0x684e0e;if(this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]]&&!_[_0xdf37('0x47')](this[_0xdf37('0x2a')][this[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0xb1')]])){if(this[_0xdf37('0x2b')][_0x31ec53[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]]['queue']]){this['queueBookedRR'][_0x31ec53[_0xdf37('0x27')][_0x425d39['actionid']][_0xdf37('0xb1')]]=this[_0xdf37('0x2b')][this[_0xdf37('0x27')][_0x425d39['actionid']]['queue']]?this['queueBookedRR'][this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]]['queue']]:this['queueBooked'][this[_0xdf37('0x27')][_0x425d39['actionid']]['queue']]?this[_0xdf37('0x2a')][this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xb1')]][_0xdf37('0x12b')]||0x0:0x0;}this[_0xdf37('0x2a')][this['actions'][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xb1')]][_0xdf37('0x12b')]=this[_0xdf37('0x2b')][this[_0xdf37('0x27')][_0x425d39[_0xdf37('0x11e')]][_0xdf37('0xb1')]];for(var _0x51eed5=0x0;_0x51eed5=0x0?!![]:![];})[_0xdf37('0xb6')](myreject(_0x29a63a)));}}else{_0x803e82[_0xdf37('0x123')](ami['Action']({'action':_0xdf37('0x146'),'command':util[_0xdf37('0x7a')](_0xdf37('0x147'),_0x967e3c,!_[_0xdf37('0x3c')](config['timezones'][_0x38cb8b])?_0x38cb8b:'')})[_0xdf37('0xb5')](function(_0x25fd92){return _0x25fd92[_0xdf37('0x14a')][_0xdf37('0x148')](_0xdf37('0x149'))>=0x0?!![]:![];})[_0xdf37('0xb6')](myreject(_0x29a63a)));}BPromise[_0xdf37('0x14b')](_0x803e82)[_0xdf37('0xb5')](function(_0x301fc0){var _0x9f3800=_['some'](_0x301fc0);if(_0x9f3800){return _0x126e2f(_0x9f3800);}else{_0x140430['message']=_0x17d7d1?'GLOBAL_INTERVAL_IS_OVERTIME':_0xdf37('0x14c');return _0x29a63a(msgResponse(_0xdf37('0x14d'),'Failure',_0xdf37('0x14e')+_0x17d7d1+'\x20'+_0x181820+'\x20Interval\x20is\x20overtime:\x20'+util[_0xdf37('0x93')](_0x967e3c,{'showHidden':![],'depth':null})+_0xdf37('0x14f')+_0x38cb8b));}})[_0xdf37('0xb6')](function(_0x198b2b){return _0x29a63a(msgResponse(_0xdf37('0x13c'),'Failure',JSON[_0xdf37('0x49')](_0x198b2b)));});});};Dialer[_0xdf37('0x1d')]['checkDialMethod']=function(_0x1ccc60){var _0x25b825=this;return function(){switch(_0x1ccc60['dialMethod']){case'progressive':freeVariablesPredictive(_0x1ccc60);_0x25b825['handlePower'](_0x1ccc60,0x1);break;case _0xdf37('0x150'):freeVariablesPredictive(_0x1ccc60);_0x25b825[_0xdf37('0x151')](_0x1ccc60,_0x1ccc60[_0xdf37('0x152')]);break;case _0xdf37('0xb'):_0x25b825[_0xdf37('0xb')](_0x1ccc60);break;case _0xdf37('0xa'):freeVariablesPredictive(_0x1ccc60);_0x25b825[_0xdf37('0x151')](_0x1ccc60,0x1);break;default:freeVariablesPredictive(_0x1ccc60);logger['error'](_0xdf37('0x153'),_0x1ccc60[_0xdf37('0x3f')],'method\x20not\x20recognized');}};};Dialer[_0xdf37('0x1d')][_0xdf37('0x154')]=function(_0x4059be){var _0x2fe0b5=this;return function(){_0x2fe0b5['handleIvr'](_0x4059be);};};Dialer[_0xdf37('0x1d')]['syncQueueSummary']=function(_0x24ee3a){var _0x7c41b6=this;if(isNotPreview(_0x24ee3a[_0xdf37('0x5c')])){if(isVoiceQueueOutbound(_0x24ee3a[_0xdf37('0x4e')])&&isActive(_0x24ee3a[_0xdf37('0x5b')])){_0x24ee3a[_0xdf37('0x9e')]=!![];BPromise['resolve']()[_0xdf37('0xb5')](checkIsLoggedIn(_0x24ee3a,_0x24ee3a[_0xdf37('0x51')]))[_0xdf37('0xb5')](checkIsActive(_0x24ee3a,_0x24ee3a['dialActive']))['then'](checkInterval(_0x24ee3a))[_0xdf37('0xb5')](_0x7c41b6[_0xdf37('0x137')](_0x24ee3a))['then'](_0x7c41b6[_0xdf37('0x13b')](_0x24ee3a[_0xdf37('0x155')],_0x24ee3a['dialTimezone'],_0x24ee3a[_0xdf37('0x3f')],_0x24ee3a))[_0xdf37('0xb5')](_0x7c41b6['checkIfTimeIntervals'](_0x24ee3a['Interval'],_0x24ee3a['dialTimezone'],_0x24ee3a[_0xdf37('0x3f')],_0x24ee3a))[_0xdf37('0xb5')](_0x7c41b6[_0xdf37('0x156')](_0x24ee3a))['catch'](loggerCatchQueueSummary(_0xdf37('0x157'),_0x24ee3a));}else{notSendMessagesQueue(_0x24ee3a);}}else{freeVariablesPredictive(_0x24ee3a);}};Dialer[_0xdf37('0x1d')][_0xdf37('0x158')]=function(){var _0x43ed83=this;var _0x2d6b7a;for(var _0x1a6226 in this[_0xdf37('0x22')]){if(this[_0xdf37('0x22')][_0xdf37('0x96')](_0x1a6226)){_0x2d6b7a=this['campaigns'][_0x1a6226];if(isCampaignIvr(_0x2d6b7a[_0xdf37('0x4e')])&&isActive(_0x2d6b7a[_0xdf37('0xd5')])){_0x2d6b7a[_0xdf37('0x9e')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x2d6b7a,_0x2d6b7a['active']))[_0xdf37('0xb5')](checkInterval(_0x2d6b7a))[_0xdf37('0xb5')](_0x43ed83[_0xdf37('0x137')](_0x2d6b7a))[_0xdf37('0xb5')](_0x43ed83[_0xdf37('0x13b')](_0x2d6b7a[_0xdf37('0x155')],_0x2d6b7a['dialTimezone'],_0x2d6b7a[_0xdf37('0x3f')],_0x2d6b7a))[_0xdf37('0xb5')](_0x43ed83[_0xdf37('0x13d')](_0x2d6b7a[_0xdf37('0x43')],_0x2d6b7a[_0xdf37('0x159')],_0x2d6b7a[_0xdf37('0x3f')],_0x2d6b7a))['then'](_0x43ed83[_0xdf37('0x154')](_0x2d6b7a))[_0xdf37('0xb6')](loggerCatchQueueSummary(_0xdf37('0x15a'),_0x2d6b7a));}else{notSendMessagesCampaign(_0x2d6b7a);}}}};function getCallerIdRandom(_0x2dd495,_0x13dedf){var _0x220d18,_0x41eb6f,_0x18c63e;if(_0x13dedf<=0x0){_0x13dedf=0x1;}_0x220d18=new RegExp(_0xdf37('0x15b')+_0x13dedf+'}$');_0x41eb6f=Math[_0xdf37('0x15c')](0xa,_0x13dedf-0x1);_0x18c63e=Math[_0xdf37('0x15c')](0xa,_0x13dedf)-0x1;return util['format']('%s',_['replace'](_0x2dd495,_0x220d18,_['random'](_0x41eb6f,_0x18c63e)));}function extractCalleridName(_0x58e76a){var _0x3f5e69=_0x58e76a[_0xdf37('0x15d')](/"(.*?)"/);return _0x3f5e69?_0x3f5e69[0x1]:_0x58e76a;}function extractCalleridNumber(_0x4bf03c){var _0x45d53c=_0x4bf03c[_0xdf37('0x15d')](/<(.*?)>/);return _0x45d53c?_0x45d53c[0x1]:_0x4bf03c;}Dialer[_0xdf37('0x1d')][_0xdf37('0x15e')]=function(_0x95315,_0x5ead1b){var _0x5edd26=this;var _0x515686=uuid['v4']();this['actions'][_0x515686]=new Action(_0x95315,_0x5ead1b,_0x515686);return new BPromise(function(_0x254025,_0x1b2470){if(_[_0xdf37('0x3c')](_0x95315)&&_0xdf37('0x15f')!==typeof _0x95315){return _0x1b2470(msgResponse('originate','Failure',_0xdf37('0x160')));}if(_[_0xdf37('0x3c')](_0x5ead1b['Contact'][_0xdf37('0x161')])||_0x5ead1b[_0xdf37('0x162')][_0xdf37('0x161')]===null){return _0x1b2470(msgResponse('originate',_0xdf37('0x13e'),_0xdf37('0x163')));}var _0x1512ba={'XMD-CALLERID':_0x5edd26[_0xdf37('0x27')][_0x515686]['getCaller'](),'XMD-AGI':_0x95315[_0xdf37('0x102')]?util['format'](_0xdf37('0x164'),ipAgi,_0x95315[_0xdf37('0x102')]):'NONE','XMD-AGIAFTER':_0x95315[_0xdf37('0x10a')]?util[_0xdf37('0x7a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x95315[_0xdf37('0x10a')]):'NONE','XMD-QUEUE':_0x95315['type']===_0xdf37('0x8f')?util[_0xdf37('0x7a')](_0xdf37('0x165'),_0x95315[_0xdf37('0x3f')],_0x95315[_0xdf37('0x166')]||'',_0x95315[_0xdf37('0x10b')]?'c':'',_0x95315['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x5ead1b['ContactId'],'XMD-CDRTYPE':_0xdf37('0x9'),'CALLERID(all)':_0x5edd26[_0xdf37('0x27')][_0x515686][_0xdf37('0x167')](),'XMD-AMD':_0x95315[_0xdf37('0xdf')]?'ACTIVE':'NONE','XMD-DESTINATION':_0xdf37('0xde')};if(_0x95315[_0xdf37('0xdf')]){_0x1512ba['XMD-AMDINITIALSILENCE']=_0x95315[_0xdf37('0x168')]||0x9c4;_0x1512ba[_0xdf37('0x169')]=_0x95315['dialAMDGreeting']||0x5dc;_0x1512ba['XMD-AMDAFTERGREETINGSILENCE']=_0x95315[_0xdf37('0x16a')]||0x320;_0x1512ba[_0xdf37('0x16b')]=_0x95315[_0xdf37('0x16c')]||0x1388;_0x1512ba[_0xdf37('0x16d')]=_0x95315[_0xdf37('0x16e')]||0x64;_0x1512ba[_0xdf37('0x16f')]=_0x95315[_0xdf37('0x170')]||0x32;_0x1512ba[_0xdf37('0x171')]=_0x95315[_0xdf37('0x172')]||0x3;_0x1512ba[_0xdf37('0x173')]=_0x95315[_0xdf37('0x174')]||0x100;_0x1512ba[_0xdf37('0x175')]=_0x95315['dialAMDMaximumWordLength']||0x1388;}if(_0x95315[_0xdf37('0x4e')]===_0xdf37('0x8f')){_0x1512ba[_0xdf37('0x176')]=_0x5ead1b[_0xdf37('0xce')];}else{_0x1512ba['XMD-CAMPAIGNID']=_0x5ead1b[_0xdf37('0xcf')];}for(var _0x30b364 in _0x5ead1b['Contact']){if(_0x5ead1b['Contact'][_0xdf37('0x96')](_0x30b364)){if(isNotNull(_0x5ead1b[_0xdf37('0x162')][_0x30b364])&&_0x30b364!=='id'&&_0x30b364!==_0xdf37('0x177')&&_0x30b364!==_0xdf37('0x178')&&_0x30b364!==_0xdf37('0x179')){_0x1512ba[util[_0xdf37('0x7a')](_0xdf37('0x17a'),_0xdf37('0x17b'),_[_0xdf37('0x17c')](_0x30b364))]=_0x5ead1b[_0xdf37('0x162')][_0x30b364];}}}var _0x222d93=_0x5edd26[_0xdf37('0xd4')](_0x95315[_0xdf37('0x79')])?getCallerId(_0x95315[_0xdf37('0x79')][_0xdf37('0x17d')],_0x95315[_0xdf37('0x5d')],_0x95315[_0xdf37('0x17e')]>0x0?getCallerIdRandom(_0x95315[_0xdf37('0x5e')],_0x95315['dialRandomLastDigitCallerIdNumber']):_0x95315[_0xdf37('0x5e')]):getCallerId(_['isNil'](_0x95315['TrunkBackup'])?_0x95315[_0xdf37('0x79')][_0xdf37('0x17d')]:_0x95315['TrunkBackup']['callerid'],_0x95315[_0xdf37('0x5d')],_0x95315[_0xdf37('0x17e')]>0x0?getCallerIdRandom(_0x95315[_0xdf37('0x5e')],_0x95315[_0xdf37('0x17e')]):_0x95315[_0xdf37('0x5e')]);if(_0x222d93){_0x1512ba[_0xdf37('0x17f')]=_0x5edd26[_0xdf37('0x27')][_0x515686][_0xdf37('0x180')]=extractCalleridName(_0x222d93);_0x1512ba[_0xdf37('0x181')]=_0x5edd26['actions'][_0x515686]['originatecalleridnum']=extractCalleridNumber(_0x222d93);}return ami[_0xdf37('0x145')]({'actionid':_0x515686,'action':_0xdf37('0x182'),'channel':_0x5edd26[_0xdf37('0xd4')](_0x95315[_0xdf37('0x79')])?util[_0xdf37('0x7a')](_0xdf37('0x183'),_0x95315[_0xdf37('0x79')][_0xdf37('0x3f')],isNotNull(_0x95315[_0xdf37('0x60')])?_0x95315[_0xdf37('0x60')][_0xdf37('0x184')]()||'':'',_0x95315[_0xdf37('0x185')]>0x0?_0x5ead1b[_0xdf37('0x162')][_0xdf37('0x161')][_0xdf37('0x186')](_0x95315[_0xdf37('0x185')]):_0x5ead1b['Contact'][_0xdf37('0x161')]):util[_0xdf37('0x7a')](_0xdf37('0x183'),_['isNil'](_0x95315['TrunkBackup'])?_0x95315['Trunk']['name']:_0x95315[_0xdf37('0x138')][_0xdf37('0x3f')],isNotNull(_0x95315[_0xdf37('0x60')])?_0x95315[_0xdf37('0x60')][_0xdf37('0x184')]()||'':'',_0x95315[_0xdf37('0x185')]>0x0?_0x5ead1b['Contact']['phone'][_0xdf37('0x186')](_0x95315[_0xdf37('0x185')]):_0x5ead1b[_0xdf37('0x162')][_0xdf37('0x161')]),'callerid':_0x222d93,'Exten':_0xdf37('0xde'),'Context':_0xdf37('0x187'),'Priority':'1','variable':_0x1512ba,'timeout':(_0x95315[_0xdf37('0x5f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x515686})[_0xdf37('0xb5')](function(_0x585ad5){return _0x254025(_0x585ad5);})[_0xdf37('0xb6')](function(_0x125469){_0x95315[_0xdf37('0x68')]+=0x1;var _0x21160f=new History(_0x5edd26['actions'][_0x515686]);logger[_0xdf37('0x92')](util[_0xdf37('0x7a')]('[originateError]:\x20%s',JSON['stringify'](_0x125469)));_0x21160f[_0xdf37('0xe3')]=0xe;_0x21160f[_0xdf37('0xa4')]=_0xdf37('0x188');_0x21160f[_0xdf37('0xa6')]=moment()['format'](_0xdf37('0xf7'));_0x21160f[_0xdf37('0xa5')]=_0x21160f[_0xdf37('0xa6')];_0x5edd26[_0xdf37('0xc5')](_0x21160f)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x189')));_0x5edd26[_0xdf37('0xc3')](_0x21160f)['catch'](loggerCatch(_0xdf37('0x189')))['finally'](function(){delete _0x5edd26['actions'][_0x515686];return _0x1b2470(msgResponse(_0xdf37('0x182'),_0xdf37('0x18a'),_0xdf37('0x18b')));});});});};Dialer['prototype'][_0xdf37('0x31')]=function(_0x31726b){var _0x4501da=this[_0xdf37('0x27')][_0x31726b['actionid']];var _0xeae72b=this;if(_0x4501da){delete this[_0xdf37('0x27')][_0x31726b[_0xdf37('0x11e')]];_0x4501da[_0xdf37('0x18c')]=moment()['format'](_0xdf37('0xf7'));var _0x31c639=_0x4501da['type']===_0xdf37('0x7d')?this[_0xdf37('0x22')][_0x4501da[_0xdf37('0xb1')]]:this['voiceQueues'][_0x4501da[_0xdf37('0x18d')]()];if(!this[_0xdf37('0xd2')](_0x31726b[_0xdf37('0x18e')])){this['updateOriginated'](_0x31c639);return this[_0xdf37('0x18f')](_0x4501da,_0x31c639,_0x31726b)[_0xdf37('0xb5')](function(_0x2551ca){})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x190')));}else{this['uniqueId'][_0x31726b[_0xdf37('0xda')]]=_0x4501da;}}};Dialer[_0xdf37('0x1d')]['checkRetriveMax']=function(_0x224338,_0x574984,_0x118f58){var _0xf0de1=new History(_0x574984);if(_0xf0de1[_0xdf37('0xea')]+_0xf0de1[_0xdf37('0xeb')]+_0xf0de1[_0xdf37('0xec')]+_0xf0de1[_0xdf37('0xed')]+_0xf0de1[_0xdf37('0xee')]+_0xf0de1[_0xdf37('0xef')]+_0xf0de1['countmachineretry']+_0xf0de1[_0xdf37('0xf0')]>=_0x118f58[_0xdf37('0x191')]-0x1){return!![];}switch(_0x224338){case 0x3:if(_0xf0de1['countnoanswerretry']>=_0x118f58[_0xdf37('0x192')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0xf0de1[_0xdf37('0xec')]+=0x1,'scheduledat':moment()[_0xdf37('0xf4')](_0x118f58['dialNoAnswerRetryFrequency'],_0xdf37('0xf6'))[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1[_0xdf37('0xce')]||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0xf0de1[_0xdf37('0xea')]>=_0x118f58[_0xdf37('0x193')]-0x1){return!![];}else{this[_0xdf37('0xbe')]({'active':![],'countbusyretry':_0xf0de1['countbusyretry']+=0x1,'scheduledat':moment()[_0xdf37('0xf4')](_0x118f58[_0xdf37('0x194')],_0xdf37('0xf6'))[_0xdf37('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1[_0xdf37('0xce')]||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x195')));}break;case 0x8:if(_0xf0de1[_0xdf37('0xeb')]>=_0x118f58[_0xdf37('0x196')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0xf0de1[_0xdf37('0xeb')]+=0x1,'scheduledat':moment()['add'](_0x118f58[_0xdf37('0x197')],'minutes')[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1[_0xdf37('0xce')]||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x198')));}break;case 0x0:if(_0xf0de1[_0xdf37('0xed')]>=_0x118f58[_0xdf37('0x199')]-0x1){return!![];}else{this[_0xdf37('0xbe')]({'active':![],'countnosuchnumberretry':_0xf0de1[_0xdf37('0xed')]+=0x1,'scheduledat':moment()[_0xdf37('0xf4')](_0x118f58[_0xdf37('0x19a')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1['VoiceQueueId']||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x19b')));}break;case 0xa:if(_0xf0de1['countdropretry']>=_0x118f58[_0xdf37('0x113')]-0x1){return!![];}else{this[_0xdf37('0xbe')]({'active':![],'countdropretry':_0xf0de1[_0xdf37('0xee')]+=0x1,'scheduledat':moment()['add'](_0x118f58[_0xdf37('0x114')],_0xdf37('0xf6'))[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1[_0xdf37('0xce')]||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})['catch'](loggerCatch(_0xdf37('0x19c')));}break;case 0xb:if(_0xf0de1[_0xdf37('0xef')]>=_0x118f58['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0xdf37('0xbe')]({'active':![],'countabandonedretry':_0xf0de1[_0xdf37('0xef')]+=0x1,'scheduledat':moment()[_0xdf37('0xf4')](_0x118f58[_0xdf37('0x119')],_0xdf37('0xf6'))['format'](_0xdf37('0xf7')),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1[_0xdf37('0xce')]||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x11a')));}break;case 0x13:if(_0xf0de1[_0xdf37('0xe8')]>=_0x118f58[_0xdf37('0xf1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0xf0de1[_0xdf37('0xe8')]+=0x1,'scheduledat':moment()[_0xdf37('0xf4')](_0x118f58[_0xdf37('0xf5')],_0xdf37('0xf6'))[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1[_0xdf37('0xcc')],'VoiceQueueId':_0xf0de1[_0xdf37('0xce')]||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0xf0de1[_0xdf37('0xf0')]>=_0x118f58[_0xdf37('0x19d')]-0x1){return!![];}else{this[_0xdf37('0xbe')]({'active':![],'countagentrejectretry':_0xf0de1['countagentrejectretry']+=0x1,'scheduledat':moment()['add'](_0x118f58[_0xdf37('0x19e')],'minutes')[_0xdf37('0x7a')](_0xdf37('0xf7')),'ContactId':_0xf0de1[_0xdf37('0xcb')],'ListId':_0xf0de1['ListId'],'VoiceQueueId':_0xf0de1['VoiceQueueId']||undefined,'CampaignId':_0xf0de1[_0xdf37('0xcf')]||undefined})['catch'](loggerCatch(_0xdf37('0x19f')));}break;default:return!![];}};Dialer[_0xdf37('0x1d')][_0xdf37('0x18f')]=function(_0x52a3de,_0x57bd3e,_0x344528){var _0x3b5863=this;var _0x51eab9=new History(_0x52a3de);return new BPromise(function(_0x3c8439,_0x5b7088){if(_[_0xdf37('0x3c')](_0x57bd3e)&&'object'!==typeof _0x57bd3e){return _0x5b7088(msgResponse(_0xdf37('0x1a0'),_0xdf37('0x13e'),_0xdf37('0x1a1')));}if(_['isUndefined'](_0x344528)&&_0xdf37('0x15f')!==typeof _0x344528){return _0x5b7088(msgResponse(_0xdf37('0x1a0'),'Failure',_0xdf37('0x1a2')));}switch(_0x344528[_0xdf37('0x108')]){case'0':_0x57bd3e[_0xdf37('0x67')]+=0x1;_0x51eab9[_0xdf37('0xe3')]=0x0;_0x51eab9[_0xdf37('0xa4')]=_0xdf37('0x1a3');_0x51eab9[_0xdf37('0xed')]+=0x1;_0x51eab9['countglobal']+=0x1;ami[_0xdf37('0x4d')]('custom:agentnosuchnumber',ut[_0xdf37('0x1a4')](_0x52a3de,'nosuchnumber'));_0x3b5863[_0xdf37('0xc5')](_0x51eab9)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xfd')));if(_0x3b5863[_0xdf37('0x1a5')](0x0,_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xed')]>=_0x57bd3e['dialNoSuchNumberMaxRetry']){_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,'reason\x200\x20no\x20such\x20number....');}else{_0x3b5863[_0xdf37('0xfe')](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1a6'));}}break;case'3':_0x57bd3e[_0xdf37('0x66')]+=0x1;_0x51eab9[_0xdf37('0xe3')]=0x3;_0x51eab9[_0xdf37('0xa4')]=_0xdf37('0x1a7');_0x51eab9[_0xdf37('0xec')]+=0x1;_0x51eab9[_0xdf37('0xfc')]+=0x1;ami[_0xdf37('0x4d')](_0xdf37('0x1a8'),ut['buildObj'](_0x52a3de,_0xdf37('0x1a9')));_0x3b5863[_0xdf37('0xc5')](_0x51eab9)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x1aa')));if(_0x3b5863[_0xdf37('0x1a5')](0x3,_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xec')]>=_0x57bd3e['dialNoAnswerMaxRetry']){_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1ab'));}else{_0x3b5863['stateGlobal'](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1ab'));}}break;case'5':_0x57bd3e[_0xdf37('0x62')]+=0x1;_0x51eab9[_0xdf37('0xe3')]=0x5;_0x51eab9[_0xdf37('0xa4')]='Busy';_0x51eab9['countbusyretry']+=0x1;_0x51eab9[_0xdf37('0xfc')]+=0x1;ami[_0xdf37('0x4d')](_0xdf37('0x1ac'),ut[_0xdf37('0x1a4')](_0x52a3de,_0xdf37('0x1ad')));_0x3b5863[_0xdf37('0xc5')](_0x51eab9)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x1ae')));if(_0x3b5863['checkRetriveMax'](0x5,_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xea')]>=_0x57bd3e[_0xdf37('0x193')]){_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,'reason\x205\x20busy');}else{_0x3b5863['stateGlobal'](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1af'));}}break;case'8':_0x57bd3e[_0xdf37('0x1b0')]+=0x1;_0x51eab9['state']=0x8;_0x51eab9['statedesc']='Congestion';_0x51eab9[_0xdf37('0xeb')]+=0x1;_0x51eab9['countglobal']+=0x1;ami[_0xdf37('0x4d')](_0xdf37('0x1b1'),ut[_0xdf37('0x1a4')](_0x52a3de,_0xdf37('0x1b2')));_0x3b5863['createHistory'](_0x51eab9)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x1b3')));if(_0x3b5863[_0xdf37('0x1a5')](0x8,_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xeb')]>=_0x57bd3e[_0xdf37('0x196')]){_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1b4'));}else{_0x3b5863[_0xdf37('0xfe')](_0x51eab9,_0x3c8439,_0x5b7088,'reason\x208\x20congestion');}}break;case'11':_0x57bd3e['outboundAbandonedCallsDay']+=0x1;_0x51eab9[_0xdf37('0xe3')]=0xb;_0x51eab9[_0xdf37('0xa4')]='Abandoned';_0x51eab9['countabandonedretry']+=0x1;_0x51eab9[_0xdf37('0xfc')]+=0x1;_0x3b5863[_0xdf37('0xc5')](_0x51eab9)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x11c')));if(_0x3b5863['checkRetriveMax'](0xb,_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xef')]>=_0x57bd3e[_0xdf37('0x1b5')]){_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1b6'));}else{_0x3b5863[_0xdf37('0xfe')](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1b6'));}}break;case'20':_0x57bd3e[_0xdf37('0x1b7')]+=0x1;_0x51eab9[_0xdf37('0xe3')]=0x14;_0x51eab9['statedesc']='AgentReject';_0x51eab9[_0xdf37('0xf0')]+=0x1;_0x51eab9['countglobal']+=0x1;ami[_0xdf37('0x4d')](_0xdf37('0x1b8'),ut[_0xdf37('0x1a4')](_0x52a3de,_0xdf37('0x1b9')));_0x3b5863[_0xdf37('0xc5')](_0x51eab9)[_0xdf37('0xb6')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x3b5863[_0xdf37('0x1a5')](0x14,_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xf0')]>=_0x57bd3e[_0xdf37('0x19d')]){_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,_0xdf37('0x1ba'));}else{_0x3b5863[_0xdf37('0xfe')](_0x51eab9,_0x3c8439,_0x5b7088,'reason\x2020\x20agentreject');}}break;default:_0x57bd3e[_0xdf37('0x105')]+=0x1;_0x51eab9['state']=0xc;_0x51eab9['statedesc']=_0x344528['reason'];_0x3b5863[_0xdf37('0xc5')](_0x51eab9)[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x1bb')));if(_0x3b5863[_0xdf37('0x1a5')](_0x344528[_0xdf37('0x108')],_0x52a3de,_0x57bd3e)){if(_0x51eab9[_0xdf37('0xea')]+_0x51eab9[_0xdf37('0xeb')]+_0x51eab9[_0xdf37('0xec')]+_0x51eab9[_0xdf37('0xed')]+_0x51eab9[_0xdf37('0xee')]+_0x51eab9[_0xdf37('0xef')]+_0x51eab9[_0xdf37('0xe8')]+_0x51eab9[_0xdf37('0xf0')]>=_0x57bd3e[_0xdf37('0x191')]){_0x3b5863['stateGlobal'](_0x51eab9,_0x3c8439,_0x5b7088,_0x344528[_0xdf37('0x108')]);}else{_0x3b5863[_0xdf37('0xf2')](_0x51eab9,_0x3c8439,_0x5b7088,_0x344528[_0xdf37('0x108')]);}}}});};Dialer[_0xdf37('0x1d')][_0xdf37('0xfe')]=function(_0x5c67fc,_0xe313e8,_0x40c84b,_0x292e5e){var _0x596ce1=new Final(_0x5c67fc);_0x596ce1['state']=0xf;_0x596ce1[_0xdf37('0xa4')]=_0xdf37('0x1bc');this[_0xdf37('0xf2')](_0x596ce1,_0xe313e8,_0x40c84b,_0x292e5e);};Dialer[_0xdf37('0x1d')][_0xdf37('0xf2')]=function(_0x568561,_0x199124,_0x5061be,_0x71325f){this[_0xdf37('0xc3')](_0x568561)[_0xdf37('0xb5')](function(_0x5479ac){return _0x199124(msgResponse(_0xdf37('0x1a0'),_0xdf37('0xd3'),_0x71325f));})['catch'](function(_0x254c7c){return _0x5061be(msgResponse('[moveContactManagedDialer][0]',_0xdf37('0x13e'),'contact\x20not\x20moved'));});};Dialer[_0xdf37('0x1d')][_0xdf37('0xb')]=function(_0x22059e){var _0x2c6cc2=this;var _0x31ddde=_0x22059e[_0xdf37('0x1bd')]/0x64;var _0x2a11ef=_0x22059e[_0xdf37('0x65')]/(_0x22059e[_0xdf37('0x65')]+_0x22059e['outboundAnswerCallsDay']);var _0x1cf3e8=Math[_0xdf37('0x1be')](_0x22059e[_0xdf37('0x72')]*(_0x22059e[_0xdf37('0x1bf')]/0x64));var _0x39cf92=Math[_0xdf37('0x1be')](_0x22059e[_0xdf37('0x72')]*(_0x22059e['predictiveIntervalMinThreshold']/0x64));var _0x5def01=_0x22059e[_0xdf37('0x50')]+_0x22059e[_0xdf37('0x55')];var _0x320a3c=Math[_0xdf37('0x1c0')](_0x22059e[_0xdf37('0x75')]*_0x22059e['erlangAbandonmentRate']*_0x22059e[_0xdf37('0x70')]*_0x22059e[_0xdf37('0x1c1')]);if(_[_0xdf37('0x3c')](_0x22059e['startProgressive'])){if(!_[_0xdf37('0x3c')](_0x22059e[_0xdf37('0x29')])){_0x22059e['startPredictive']=undefined;loggerPredictive[_0xdf37('0x92')](_0xdf37('0x1c2'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xdf37('0x3c')](_0x22059e[_0xdf37('0x8d')])){loggerPredictive[_0xdf37('0x92')](_0xdf37('0x1c2'),_0xdf37('0x1c3'));clearInterval(_0x22059e[_0xdf37('0x8d')]);_0x22059e[_0xdf37('0x8d')]=undefined;}_0x22059e[_0xdf37('0x8b')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));loggerPredictive[_0xdf37('0x7f')](_0x22059e[_0xdf37('0x3f')],_0xdf37('0x1c4'),_0x22059e['startProgressive']);this[_0xdf37('0x151')](_0x22059e,0x1);}else if(ifInterval(_0x22059e[_0xdf37('0x1c5')],_0x22059e[_0xdf37('0x8b')])){this[_0xdf37('0x151')](_0x22059e,0x1);loggerPredictiveCalls[_0xdf37('0x7f')](_0xdf37('0x1c6'),_0x22059e[_0xdf37('0x8b')],_0x22059e['name']);_0x22059e[_0xdf37('0x75')]=0x0;_0x22059e[_0xdf37('0x6f')]=0x0;}else if(_0x31ddde<_0x2a11ef&&_0x22059e[_0xdf37('0x1c7')]==='dropRate'){freeVariablesPredictive(_0x22059e);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x1c8'),_0xdf37('0x1c9'),_0x2a11ef,_0xdf37('0x8b'),_0x22059e[_0xdf37('0x3f')]);}else if(_0x320a3c<_0x22059e[_0xdf37('0x6f')]&&_0x22059e[_0xdf37('0x1c7')]===_0xdf37('0x1ca')){freeVariablesPredictive(_0x22059e);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xdf37('0x1cb'),_0x320a3c,_0xdf37('0x1cc'),_0x22059e[_0xdf37('0x6f')],_0xdf37('0x8b'),_0x22059e[_0xdf37('0x3f')]);}else if(!ifInterval(_0x22059e[_0xdf37('0x1c5')],_0x22059e[_0xdf37('0x8b')])&&_[_0xdf37('0x3c')](_0x22059e['startPredictive'])&&!_['isUndefined'](_0x22059e['startProgressive'])){_0x22059e[_0xdf37('0x29')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));loggerPredictive[_0xdf37('0x7f')](_0x22059e[_0xdf37('0x3f')],_0xdf37('0x1cd'),_0x22059e[_0xdf37('0x29')]);this[_0xdf37('0xbc')](_0x22059e[_0xdf37('0x1c5')])[_0xdf37('0xb5')](this[_0xdf37('0x1ce')](_0x22059e))[_0xdf37('0xb5')](mergeDataErlangB(_0x22059e))[_0xdf37('0xb5')](this[_0xdf37('0x1cf')](_0x22059e))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x22059e));}else if(!ifInterval(_0x22059e[_0xdf37('0x1c5')],_0x22059e[_0xdf37('0x29')])){_0x22059e[_0xdf37('0x6f')]=0x0;_0x22059e[_0xdf37('0x29')]=moment()[_0xdf37('0x7a')](_0xdf37('0xf7'));loggerPredictive['info'](_0x22059e[_0xdf37('0x3f')],_0xdf37('0x1d0'),_0x22059e[_0xdf37('0x29')]);clearInterval(_0x22059e[_0xdf37('0x8d')]);_0x22059e[_0xdf37('0x8d')]=undefined;this[_0xdf37('0xbc')](_0x22059e['dialPredictiveInterval'])[_0xdf37('0xb5')](this[_0xdf37('0x1ce')](_0x22059e))[_0xdf37('0xb5')](mergeDataErlangB(_0x22059e))[_0xdf37('0xb5')](this[_0xdf37('0x1cf')](_0x22059e))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x22059e));}else if(_0x22059e[_0xdf37('0x72')]&&_0x5def01<_0x22059e['predictiveIntervalAvailable']-_0x39cf92){freeVariablesPredictive(_0x22059e);loggerPredictive[_0xdf37('0x7f')](_0x22059e[_0xdf37('0x3f')],_0xdf37('0x1d1'),_0x5def01,_0xdf37('0x1d2'),_0x22059e[_0xdf37('0x72')],'-',_0x39cf92,'=',_0x22059e[_0xdf37('0x72')]-_0x39cf92,')');}else if(_0x22059e[_0xdf37('0x72')]&&_0x5def01>_0x22059e[_0xdf37('0x72')]+_0x1cf3e8){freeVariablesPredictive(_0x22059e);loggerPredictive['info'](_0x22059e['name'],_0xdf37('0x1d1'),_0x5def01,')\x20are\x20more\x20than\x20threshold\x20(',_0x22059e[_0xdf37('0x72')],'+',_0x1cf3e8,'=',_0x22059e['predictiveIntervalAvailable']+_0x1cf3e8,')');}};Dialer[_0xdf37('0x1d')]['getDataPredictive']=function(_0x35da49){var _0x34b438=this;return function(_0x5b9a67){return new BPromise(function(_0x180de2,_0x5164bf){_[_0xdf37('0x8a')](_0x35da49,_0x5b9a67[0x0]);if(checkGetDataPredictive(_0x5b9a67[0x0])){var _0x49fe2d=_0x35da49[_0xdf37('0x72')]=_0x35da49[_0xdf37('0x55')]+_0x35da49[_0xdf37('0x50')];var _0x36df44=_0x35da49[_0xdf37('0x1c5')]*0x3c;var _0x92b6d0=_0x5b9a67[0x0][_0xdf37('0x6b')]+_0x5b9a67[0x0][_0xdf37('0x6a')];var _0x1c37c7=(_0x5b9a67[0x0]['predictiveIntervalAnsweredCalls']+_0x5b9a67[0x0][_0xdf37('0x6d')]+_0x5b9a67[0x0][_0xdf37('0x6c')])/_0x5b9a67[0x0][_0xdf37('0x73')];_0x35da49[_0xdf37('0x70')]=_0x1c37c7>0x0?_0x1c37c7:0x1;switch(_0x35da49[_0xdf37('0x1c7')]){case _0xdf37('0x1ca'):var _0x189c1f=_0x35da49['dialPredictiveOptimizationPercentage']/0x64;return _0x34b438[_0xdf37('0x1d3')](_0x49fe2d,_0x36df44,_0x92b6d0,_0x1c37c7,_0x189c1f)['then'](function(_0x58b6b1){return _0x180de2(_0x58b6b1);});case _0xdf37('0x1d4'):var _0x5b40f6=_0x35da49[_0xdf37('0x1bd')]/0x64;return _0x34b438[_0xdf37('0x1d5')](_0x49fe2d,_0x36df44,_0x92b6d0,_0x1c37c7,_0x5b40f6)[_0xdf37('0xb5')](function(_0x2141a3){return _0x180de2(_0x2141a3);});default:return _0x5164bf(msgResponse(_0xdf37('0x1d6'),'Failure',_0xdf37('0x1d7')));}}else{return _0x5164bf(msgResponse('[getDataPredictive]',_0xdf37('0x13e'),_0xdf37('0x1d8')));}});};};Dialer[_0xdf37('0x1d')][_0xdf37('0x1d9')]=function(_0x3d3354){var _0x27ea6d=this;return function(_0x48ff97){return new BPromise(function(_0x542d3d,_0x21b2d6){_[_0xdf37('0x8a')](_0x3d3354,_0x48ff97[0x0]);if(checkGetDataPredictive(_0x48ff97[0x0])){loggerPredictive['info'](JSON[_0xdf37('0x49')](_0x48ff97[0x0]));if(_0x3d3354[_0xdf37('0x1c7')]===_0xdf37('0x1ca')){return _0x27ea6d[_0xdf37('0x1da')](_0x3d3354['id'])[_0xdf37('0xb5')](function(_0x21048c){var _0x218f37=_0x3d3354['loggedIn']-_0x21048c[0x0][_0xdf37('0x1db')];var _0xa127ae=_0x3d3354[_0xdf37('0x1c5')]*0x3c;var _0x4ec102=_0x48ff97[0x0][_0xdf37('0x6b')]+_0x48ff97[0x0]['predictiveIntervalAvgHoldtime'];var _0x21db00=(_0x48ff97[0x0]['predictiveIntervalAnsweredCalls']+_0x48ff97[0x0][_0xdf37('0x6d')]+_0x48ff97[0x0][_0xdf37('0x6c')])/_0x48ff97[0x0][_0xdf37('0x73')];var _0x41ad17=_0x3d3354['dialPredictiveOptimizationPercentage']/0x64;_0x3d3354['predictiveIntervalPauses']=_0x21048c[0x0]['outboundQueuePauses']||0x0;_0x3d3354[_0xdf37('0x70')]=_0x21db00>0x0?_0x21db00:0x1;return _0x27ea6d['abandonmentRate'](_0x218f37,_0xa127ae,_0x4ec102,_0x21db00,_0x41ad17);})[_0xdf37('0xb5')](function(_0x4b8477){return _0x542d3d(_0x4b8477);})[_0xdf37('0xb6')](function(_0x2be04a){return _0x21b2d6(msgResponse(_0xdf37('0x1dc'),_0xdf37('0x13e'),JSON[_0xdf37('0x49')](_0x2be04a)));});}if(_0x3d3354['dialPredictiveOptimization']===_0xdf37('0x1d4')){return _0x27ea6d[_0xdf37('0x1da')](_0x3d3354['id'])['then'](function(_0x5ce914){var _0x2738c4=_0x3d3354['loggedIn']-_0x5ce914[0x0][_0xdf37('0x1db')];var _0x3c0a33=_0x3d3354[_0xdf37('0x1c5')]*0x3c;var _0x204362=_0x48ff97[0x0][_0xdf37('0x6b')]+_0x48ff97[0x0]['predictiveIntervalAvgHoldtime'];var _0x2f915c=(_0x48ff97[0x0]['predictiveIntervalAnsweredCalls']+_0x48ff97[0x0][_0xdf37('0x6d')]+_0x48ff97[0x0][_0xdf37('0x6c')])/_0x48ff97[0x0][_0xdf37('0x73')];var _0x935dfd=_0x3d3354[_0xdf37('0x1bd')]/0x64;_0x3d3354[_0xdf37('0x71')]=_0x5ce914[0x0][_0xdf37('0x1db')]||0x0;_0x3d3354[_0xdf37('0x70')]=_0x2f915c>0x0?_0x2f915c:0x1;return _0x27ea6d[_0xdf37('0x1d5')](_0x2738c4,_0x3c0a33,_0x204362,_0x2f915c,_0x935dfd);})[_0xdf37('0xb5')](function(_0x19c1c6){return _0x542d3d(_0x19c1c6);})[_0xdf37('0xb6')](function(_0x2d1b9d){return _0x21b2d6(msgResponse('[CatchErlangB]',_0xdf37('0x13e'),JSON['stringify'](_0x2d1b9d)));});}}else{return _0x21b2d6(msgResponse(_0xdf37('0x1d6'),_0xdf37('0x13e'),_0xdf37('0x1d8')));}});};};Dialer[_0xdf37('0x1d')][_0xdf37('0x1cf')]=function(_0x5e7b7c){var _0x516b31=this;return function(){var _0x435e7b=0x0;var _0x3c19f0=Math[_0xdf37('0x1c0')](_0x5e7b7c[_0xdf37('0x76')]*0x3e8);if(_0x3c19f0>0x0){_0x3c19f0=_0x3c19f0<0x64?0x64:_0x3c19f0;loggerPredictive[_0xdf37('0x7f')](_0x5e7b7c[_0xdf37('0x3f')],_0xdf37('0x1dd'),_0x3c19f0,_0xdf37('0x4a'));_0x5e7b7c[_0xdf37('0x8d')]=setInterval(function(){_0x516b31[_0xdf37('0x8d')](_0x5e7b7c);loggerPredictiveCalls[_0xdf37('0x7f')](_0xdf37('0x1de'),_0x435e7b+=0x1);},_0x3c19f0);}else{loggerPredictive[_0xdf37('0x7f')](_0x5e7b7c[_0xdf37('0x3f')],_0xdf37('0x1df'));}};};Dialer['prototype'][_0xdf37('0x1e0')]=function(_0x3919f2,_0x5a40ee){var _0x313fb0=this;return function(_0x37dabe){if(_[_0xdf37('0x47')](_0x37dabe)){if(_['isNil'](_0x5a40ee[_0xdf37('0xcd')])||!_0x5a40ee['recallme']){if(_0x3919f2[_0xdf37('0x5c')]===_0xdf37('0xa')){_0x3919f2[_0xdf37('0x126')]=_[_0xdf37('0x3c')](_0x3919f2[_0xdf37('0x126')])?!![]:_0x3919f2['queueStatusComplete'];var _0x5b5336=uuid['v4']();_0x313fb0[_0xdf37('0x27')][_0x5b5336]=new Action(_0x3919f2,_0x5a40ee,_0x5b5336);loggerBooked[_0xdf37('0x7f')](_0xdf37('0x1e1'),_0x5b5336,'queueStatusComplete:\x20',JSON[_0xdf37('0x49')](_0x3919f2[_0xdf37('0x126')]),_0xdf37('0x1e2'),_0x3919f2[_0xdf37('0x3f')]);if(_0x3919f2[_0xdf37('0x126')]){_0x3919f2[_0xdf37('0x126')]=![];_0x313fb0[_0xdf37('0x2a')][_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xb1')]]=[];ami['Action']({'actionid':_0x5b5336,'action':'queuestatus','queue':_0x3919f2[_0xdf37('0x3f')]})[_0xdf37('0xb6')](function(_0x33462b){_0x313fb0[_0xdf37('0xb0')](_0x3919f2);_0x313fb0[_0xdf37('0xbe')]({'active':![],'ContactId':_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xcb')],'ListId':_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xcc')],'VoiceQueueId':_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xce')]||undefined,'CampaignId':_0x313fb0['actions'][_0x5b5336][_0xdf37('0xcf')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x313fb0[_0xdf37('0x27')][_0x5b5336];});}else{loggerBooked[_0xdf37('0x7f')](_0xdf37('0x1e3'),JSON[_0xdf37('0x49')](_0x3919f2[_0xdf37('0x126')]),_0xdf37('0x1e2'),_0x3919f2[_0xdf37('0x3f')]);_0x313fb0[_0xdf37('0xb0')](_0x3919f2);_0x313fb0['rescheduleContact']({'active':![],'ContactId':_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xcb')],'ListId':_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xcc')],'VoiceQueueId':_0x313fb0['actions'][_0x5b5336]['VoiceQueueId']||undefined,'CampaignId':_0x313fb0[_0xdf37('0x27')][_0x5b5336][_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x1e4')));delete _0x313fb0[_0xdf37('0x27')][_0x5b5336];}}else{return _0x313fb0[_0xdf37('0x15e')](_0x3919f2,_0x5a40ee);}}else{if(getDiff(_0x5a40ee[_0xdf37('0x1e5')])<_0x3919f2[_0xdf37('0x1e6')]*0x3c){if(_0x5a40ee[_0xdf37('0x1e7')]&&!_0x5a40ee[_0xdf37('0x1e7')][_0xdf37('0x1e8')]){_0x313fb0[_0xdf37('0x20')]['run'](_0x5a40ee['id'])[_0xdf37('0x1f')](function(){_0x313fb0[_0xdf37('0xb0')](_0x3919f2);});}else{_0x313fb0[_0xdf37('0xc0')]({'active':![]},_0x5a40ee['id'],0x1)[_0xdf37('0x1f')](function(){console['log'](_0xdf37('0x1e9'));_0x313fb0[_0xdf37('0xb0')](_0x3919f2);});}}else{_0x3919f2['outboundReCallsDay']+=0x1;_0x313fb0[_0xdf37('0xb0')](_0x3919f2);if(_0x3919f2[_0xdf37('0x1ea')]){_0x313fb0['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5a40ee[_0xdf37('0xcb')],'ListId':_0x5a40ee[_0xdf37('0xcc')],'VoiceQueueId':_0x5a40ee['VoiceQueueId']||undefined,'CampaignId':_0x5a40ee[_0xdf37('0xcf')]||undefined})[_0xdf37('0xb6')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x313fb0[_0xdf37('0xc5')](createObjHistory(_0x3919f2,_0x5a40ee,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0x1eb')));}else{_0x313fb0['saveInDb'](createObjHistory(_0x3919f2,_0x5a40ee,_0xdf37('0x1ec'),0x16,_0xdf37('0x1ed')),'[Originate][HistoryRecallClose][historyCatch]',_0xdf37('0x1ee'));}}}}else{_0x3919f2[_0xdf37('0x1ef')]+=0x1;_0x313fb0[_0xdf37('0xca')](createObjHistory(_0x3919f2,_0x5a40ee,_0xdf37('0x1f0'),0xd,'Blacklist'),_0xdf37('0x1f1'),_0xdf37('0x1f2'));throw _0xdf37('0x1f3');}};};Dialer[_0xdf37('0x1d')]['handleIvr']=function(_0xcd6be3){var _0x892e3e=this;var _0x187875=[];var _0x333643=_0xcd6be3[_0xdf37('0x1f4')]-_0xcd6be3[_0xdf37('0x74')]-_0xcd6be3[_0xdf37('0x1f5')];emitCampaignSummary(_0xcd6be3);if(_0x333643>0x0){if(_0x333643>this['maxNumberOriginate']){_0x333643=this[_0xdf37('0x25')];}_0xcd6be3[_0xdf37('0x1f5')]+=_0x333643;this[_0xdf37('0xc2')](_0xcd6be3['id'],_0x333643,_0xcd6be3[_0xdf37('0x1f6')])[_0xdf37('0xb5')](function(_0x5767e7){_0xcd6be3[_0xdf37('0x1f5')]-=_0x333643;_0xcd6be3['temp']=_0xcd6be3[_0xdf37('0x1f5')]>0x0?_0xcd6be3[_0xdf37('0x1f5')]:0x0;if(!checkContactEmpty(_0x5767e7)){_0xcd6be3['message']=_0xdf37('0x9c');logger['info']('[getContactCampaign2][Empty]'+_0xcd6be3['name']);}else{_0xcd6be3[_0xdf37('0x74')]+=_0x5767e7[_0xdf37('0x95')];_0xcd6be3['message']=_0xdf37('0x1f7');for(var _0x942b6=0x0;_0x942b6<_0x5767e7['length'];_0x942b6+=0x1){_0xcd6be3[_0xdf37('0x1f8')]+=0x1;if(_['isNil'](_0x5767e7[_0x942b6])||_[_0xdf37('0xac')](_0x5767e7[_0x942b6]['Contact'])||_[_0xdf37('0xac')](_0x5767e7[_0x942b6][_0xdf37('0x162')][_0xdf37('0x161')])){_0x892e3e[_0xdf37('0xc9')](_0xdf37('0x1f9'),_0xcd6be3,_0x5767e7[_0x942b6]);}else{_0x892e3e[_0xdf37('0xba')](_[_0xdf37('0x124')](_0x5767e7[_0x942b6],[_0xdf37('0xcf'),_0xdf37('0x1fa')]))[_0xdf37('0xb5')](_0x892e3e[_0xdf37('0x1e0')](_0xcd6be3,_0x5767e7[_0x942b6]))[_0xdf37('0xb6')](_0x892e3e[_0xdf37('0xc8')](_0xdf37('0x1fb'),_0xcd6be3));}}}})[_0xdf37('0xb6')](loggerGetContactDialer('[getContactCampaign2]',_0xcd6be3,_0x333643));}};Dialer[_0xdf37('0x1d')]['handlePower']=function(_0x5324e4,_0x288fab){var _0x22164a=this;var _0x32362c=[];var _0x4b17b9=_0x288fab>=0x1?_0x288fab:0x1;var _0x2482eb=[];if(_0x5324e4['dialMethod']===_0xdf37('0xa')){_0x4b17b9=0x1;}var _0x115020=Math[_0xdf37('0x1c0')](_0x5324e4[_0xdf37('0x50')]*_0x4b17b9)-_0x5324e4[_0xdf37('0x74')]-_0x5324e4['temp'];emitVoiceQueueSummary(_0x5324e4);if(_0x5324e4[_0xdf37('0x1fc')]>0x0){var _0x4c06c5=_0x5324e4[_0xdf37('0x1fc')]-_0x5324e4[_0xdf37('0x74')]-_0x5324e4['talking']-_0x5324e4[_0xdf37('0x1f5')]-_0x5324e4['pTalking'];if(_0x115020>_0x4c06c5){_0x115020=_0x4c06c5;}}if(_0x115020>0x0){if(_0x5324e4['dialMethod']===_0xdf37('0xa')){_0x115020=0x1;}if(_0x115020>this['maxNumberOriginate']){_0x115020=this[_0xdf37('0x25')];}_0x5324e4[_0xdf37('0x1f5')]+=_0x115020;for(var _0xc461bf in this[_0xdf37('0x23')]){if(this[_0xdf37('0x23')][_0xdf37('0x96')](_0xc461bf)){if(this[_0xdf37('0x23')][_0xc461bf]['state']===_0xdf37('0x1fd')&&this[_0xdf37('0x23')][_0xc461bf][_0xdf37('0xad')]===_0xdf37('0xd6')){_0x32362c[_0xdf37('0x123')](this[_0xdf37('0x23')][_0xc461bf]['id']);}}}this[_0xdf37('0x1fe')](_0x5324e4['id'],_0x32362c,_0x115020,_0x5324e4[_0xdf37('0x1f6')])[_0xdf37('0xb5')](function(_0x10df0f){_0x5324e4['temp']-=_0x115020;_0x5324e4[_0xdf37('0x1f5')]=_0x5324e4[_0xdf37('0x1f5')]>0x0?_0x5324e4[_0xdf37('0x1f5')]:0x0;if(!checkContactEmpty(_0x10df0f)){_0x22164a[_0xdf37('0xb3')](_0x5324e4)[_0xdf37('0xb5')](sendMessageReschedule(_0x5324e4))[_0xdf37('0xb6')](loggerCatch(_0xdf37('0xb7')));}else{_0x5324e4[_0xdf37('0x74')]+=_0x10df0f[_0xdf37('0x95')];_0x5324e4[_0xdf37('0x3d')]=_0x5324e4[_0xdf37('0x5c')]===_0xdf37('0xa')?_0xdf37('0x1ff'):_0xdf37('0x1f7');for(var _0x4c3f5e=0x0;_0x4c3f5e<_0x10df0f[_0xdf37('0x95')];_0x4c3f5e+=0x1){if(_[_0xdf37('0xac')](_0x10df0f[_0x4c3f5e])||_[_0xdf37('0xac')](_0x10df0f[_0x4c3f5e][_0xdf37('0x162')])||_[_0xdf37('0xac')](_0x10df0f[_0x4c3f5e][_0xdf37('0x162')][_0xdf37('0x161')])){_0x22164a[_0xdf37('0xc9')]('[actionOriginate]\x20',_0x5324e4,_0x10df0f[_0x4c3f5e]);}else{_0x22164a[_0xdf37('0xb8')](_[_0xdf37('0x124')](_0x10df0f[_0x4c3f5e],[_0xdf37('0xce'),_0xdf37('0x1fa')]))[_0xdf37('0xb5')](_0x22164a[_0xdf37('0x1e0')](_0x5324e4,_0x10df0f[_0x4c3f5e]))[_0xdf37('0xb6')](_0x22164a[_0xdf37('0xc8')](_0xdf37('0x1f9'),_0x5324e4));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x5324e4,_0x115020));}};Dialer[_0xdf37('0x1d')][_0xdf37('0x8d')]=function(_0x2eb666){var _0x4ca92d=this;if(_0x2eb666[_0xdf37('0x1fc')]>0x0){var _0x5b4be5=_0x2eb666[_0xdf37('0x1fc')]-_0x2eb666[_0xdf37('0x74')]-_0x2eb666[_0xdf37('0x55')];if(_0x5b4be5>0x0){this[_0xdf37('0x200')](_0x2eb666);}else{loggerPredictiveCalls[_0xdf37('0x7f')]('[handlePredictive][limitChannel]');}}else{this[_0xdf37('0x200')](_0x2eb666);}};Dialer['prototype'][_0xdf37('0x200')]=function(_0x221f88){var _0xfd4035=this;var _0x22afd8=[];_0x221f88[_0xdf37('0x74')]+=0x1;for(var _0x366140 in this[_0xdf37('0x23')]){if(this[_0xdf37('0x23')]['hasOwnProperty'](_0x366140)){if(this[_0xdf37('0x23')][_0x366140][_0xdf37('0xe3')]===_0xdf37('0x1fd')&&this['agents'][_0x366140][_0xdf37('0xad')]===_0xdf37('0xd6')){_0x22afd8[_0xdf37('0x123')](this['agents'][_0x366140]['id']);}}}this[_0xdf37('0x1fe')](_0x221f88['id'],_0x22afd8,0x1,_0x221f88[_0xdf37('0x1f6')])['then'](function(_0x404b10){if(!checkContactEmpty(_0x404b10)){checkContactLowerLimitOriginate(_0x221f88,0x1,0x0);_0xfd4035[_0xdf37('0xb3')](_0x221f88)[_0xdf37('0xb5')](sendMessageReschedule(_0x221f88))[_0xdf37('0xb6')](loggerCatch('[countReScheduled]\x20'));}else{_0x221f88[_0xdf37('0x3d')]=_0xdf37('0x1f7');if(_[_0xdf37('0xac')](_0x404b10[0x0])||_[_0xdf37('0xac')](_0x404b10[0x0][_0xdf37('0x162')])||_['isNil'](_0x404b10[0x0][_0xdf37('0x162')][_0xdf37('0x161')])){_0xfd4035[_0xdf37('0xc9')](_0xdf37('0x1f9'),_0x221f88,_0x404b10[0x0]);}else{_0xfd4035[_0xdf37('0xb8')](_['pick'](_0x404b10[0x0],[_0xdf37('0xce'),_0xdf37('0x1fa')]))[_0xdf37('0xb5')](_0xfd4035[_0xdf37('0x1e0')](_0x221f88,_0x404b10[0x0]))[_0xdf37('0xb6')](_0xfd4035[_0xdf37('0xc8')](_0xdf37('0x201'),_0x221f88));}}})['catch'](loggerGetContactDialer(_0xdf37('0x202'),_0x221f88,0x1));emitVoiceQueueSummary(_0x221f88);};Dialer['prototype'][_0xdf37('0x1d3')]=function(_0x314254,_0x4ddc2b,_0x2f7cf8,_0x4973ec,_0x293bdf,_0x17a823){loggerPredictive[_0xdf37('0x7f')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0xdf37('0x203'),_0x314254);loggerPredictive['info'](_0xdf37('0x204'),_0x4ddc2b);loggerPredictive['info'](_0xdf37('0x205'),_0x2f7cf8);loggerPredictive['info'](_0xdf37('0x206'),_0x4973ec);loggerPredictive[_0xdf37('0x7f')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x293bdf);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x89'));return new BPromise(function(_0x34e1c4,_0x5d4bc4){if(_0x314254<=0x0||isNaN(_0x314254)){return _0x5d4bc4(msgResponse(_0xdf37('0x207'),_0xdf37('0x18a'),_0xdf37('0x208')+_0x314254));}if(_0x2f7cf8<=0x0||isNaN(_0x2f7cf8)){return _0x5d4bc4(msgResponse('[abandonmentRate]',_0xdf37('0x18a'),_0xdf37('0x209')+_0x2f7cf8));}if(_0x4973ec<=0x0||isNaN(_0x4973ec)){return _0x5d4bc4(msgResponse(_0xdf37('0x207'),_0xdf37('0x18a'),_0xdf37('0x20a')+_0x4973ec));}if(_0x4ddc2b<=0x0||isNaN(_0x4ddc2b)){return _0x5d4bc4(msgResponse(_0xdf37('0x207'),'Error',_0xdf37('0x20b')+_0x4ddc2b));}if(_0x293bdf<=0x0||isNaN(_0x293bdf)){return _0x5d4bc4(msgResponse('[abandonmentRate]',_0xdf37('0x18a'),_0xdf37('0x20c')+_0x293bdf));}_0x17a823=_0x17a823||0x0;var _0x4a9bbe=0x1/_0x2f7cf8;var _0x40d8c2=0x0;var _0x190e8f=0x0;var _0x4bd884=0x0;var _0x2eadc3=0x0;for(var _0xe79abd=0x0;_0x4bd884<_0x293bdf;_0xe79abd+=0x1){_0x190e8f=_0xe79abd/_0x4ddc2b;_0x40d8c2=(_0x4973ec*_0x190e8f+_0x17a823)/_0x4a9bbe;_0x4bd884=erlangb(_0x40d8c2,_0x314254);_0x2eadc3=_0x40d8c2/_0x314254*(0x1-erlangb(_0x40d8c2,_0x314254));}return _0x34e1c4({'erlangCalls':_0xe79abd,'erlangCallToSecond':_0x4ddc2b/_0xe79abd,'erlangAbandonmentRate':_0x4bd884,'erlangBusyFactor':_0x2eadc3});});};Dialer[_0xdf37('0x1d')][_0xdf37('0x1d5')]=function(_0x4e264d,_0x339fa2,_0x4da2fb,_0x10e9e2,_0x1a6e9d,_0x567ace){loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x20d'));loggerPredictive[_0xdf37('0x7f')]('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',_0x4e264d);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x204'),_0x339fa2);loggerPredictive['info'](_0xdf37('0x205'),_0x4da2fb);loggerPredictive[_0xdf37('0x7f')]('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',_0x10e9e2);loggerPredictive['info'](_0xdf37('0x20e'),_0x1a6e9d);loggerPredictive[_0xdf37('0x7f')](_0xdf37('0x89'));return new BPromise(function(_0xc55a65,_0x3d0336){if(_0x4e264d<=0x0||isNaN(_0x4e264d)){return _0x3d0336(msgResponse(_0xdf37('0x20f'),_0xdf37('0x18a'),_0xdf37('0x208')+_0x4e264d));}if(_0x4da2fb<=0x0||isNaN(_0x4da2fb)){return _0x3d0336(msgResponse(_0xdf37('0x20f'),_0xdf37('0x18a'),_0xdf37('0x209')+_0x4da2fb));}if(_0x10e9e2<=0x0||isNaN(_0x10e9e2)){return _0x3d0336(msgResponse('[busyFactor]','Error',_0xdf37('0x20a')+_0x10e9e2));}if(_0x339fa2<=0x0||isNaN(_0x339fa2)){return _0x3d0336(msgResponse(_0xdf37('0x20f'),_0xdf37('0x18a'),_0xdf37('0x20b')+_0x339fa2));}if(_0x1a6e9d<=0x0||isNaN(_0x1a6e9d)){return _0x3d0336(msgResponse(_0xdf37('0x20f'),'Error',_0xdf37('0x210')+_0x1a6e9d));}_0x567ace=_0x567ace||0x0;var _0x1afa13=0x1/_0x4da2fb;var _0x303419=0x0;var _0x3309a5=0x0;var _0x4e1e9c=0x0;var _0x1707e7=0x0;for(var _0x18d44e=0x0;_0x1707e7<_0x1a6e9d;_0x18d44e+=0x1){_0x3309a5=_0x18d44e/_0x339fa2;_0x303419=(_0x10e9e2*_0x3309a5+_0x567ace)/_0x1afa13;_0x4e1e9c=erlangb(_0x303419,_0x4e264d);_0x1707e7=_0x303419/_0x4e264d*(0x1-erlangb(_0x303419,_0x4e264d));}return _0xc55a65({'erlangCalls':_0x18d44e,'erlangCallToSecond':_0x339fa2/_0x18d44e,'erlangAbandonmentRate':_0x4e1e9c,'erlangBusyFactor':_0x1707e7});});};module[_0xdf37('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 11ada74..acfd7f4 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 _0x3dd9=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat'];(function(_0x3ed054,_0x4d4f16){var _0x16dd95=function(_0xc0c19c){while(--_0xc0c19c){_0x3ed054['push'](_0x3ed054['shift']());}};_0x16dd95(++_0x4d4f16);}(_0x3dd9,0x12f));var _0x93dd=function(_0x25bc5a,_0x2f8ba6){_0x25bc5a=_0x25bc5a-0x0;var _0x3a3746=_0x3dd9[_0x25bc5a];return _0x3a3746;};'use strict';var util=require('util');var _=require(_0x93dd('0x0'));var moment=require(_0x93dd('0x1'));function getSeconds(_0xb5216,_0x14bca7){var _0x2db55c=moment(_0xb5216)[_0x93dd('0x2')](0x0);var _0x2c6b0d=moment(_0x14bca7)[_0x93dd('0x2')](0x0);return _0x2db55c[_0x93dd('0x3')](_0x2c6b0d,'seconds');}function QueueCallerAbandon(_0x35aacc,_0x3762aa){this[_0x93dd('0x4')]=_0x35aacc[_0x93dd('0x4')];this[_0x93dd('0x5')]=_0x35aacc[_0x93dd('0x5')];this['campaigntype']=_0x35aacc[_0x93dd('0x5')]===_0x93dd('0x6')?_0x93dd('0x7'):_0x35aacc[_0x93dd('0x5')];this[_0x93dd('0x8')]=_0x35aacc[_0x93dd('0x8')];this[_0x93dd('0x9')]=_0x35aacc[_0x93dd('0x9')];this[_0x93dd('0xa')]=_0x35aacc['countnoanswerretry'];this[_0x93dd('0xb')]=_0x35aacc[_0x93dd('0x8')]+_0x35aacc['countcongestionretry']+_0x35aacc[_0x93dd('0xa')]+_0x35aacc[_0x93dd('0xc')]+_0x35aacc[_0x93dd('0xd')]+_0x35aacc[_0x93dd('0xe')]+_0x35aacc[_0x93dd('0xf')]+_0x35aacc['countagentrejectretry'];this[_0x93dd('0xc')]=_0x35aacc['countnosuchnumberretry'];this[_0x93dd('0xd')]=_0x35aacc[_0x93dd('0xd')];this[_0x93dd('0xe')]=_0x35aacc[_0x93dd('0xe')];this['countmachineretry']=_0x35aacc[_0x93dd('0xf')];this[_0x93dd('0x10')]=_0x35aacc[_0x93dd('0x10')];this[_0x93dd('0x11')]=_0x3762aa[_0x93dd('0x11')];this[_0x93dd('0x12')]=_0x35aacc[_0x93dd('0x13')];this[_0x93dd('0x14')]=_0x35aacc[_0x93dd('0x15')];this['starttime']=_0x35aacc[_0x93dd('0x16')];this[_0x93dd('0x17')]=_0x35aacc['responsetime'];this[_0x93dd('0x18')]=_0x35aacc[_0x93dd('0x18')];this[_0x93dd('0x19')]=this[_0x93dd('0x18')];this['ringtime']=getSeconds(_0x35aacc[_0x93dd('0x17')],_0x35aacc[_0x93dd('0x16')]);this[_0x93dd('0x1a')]=getSeconds(this[_0x93dd('0x18')],_0x35aacc[_0x93dd('0x17')]);this[_0x93dd('0x1b')]=0x0;this[_0x93dd('0x7')]=_0x3762aa[_0x93dd('0x7')];this[_0x93dd('0x1c')]=_0x3762aa['connectedlinename'];this[_0x93dd('0x1d')]=_0x3762aa[_0x93dd('0x1d')];this[_0x93dd('0x1e')]=_0x35aacc['callback'];this[_0x93dd('0x1f')]=_0x35aacc[_0x93dd('0x1f')];this[_0x93dd('0x20')]=_0x35aacc['callbackat'];this[_0x93dd('0x21')]=_0x35aacc['recallme'];this[_0x93dd('0x22')]=_0x35aacc[_0x93dd('0x22')];this[_0x93dd('0x23')]=_0x35aacc[_0x93dd('0x23')];this[_0x93dd('0x24')]=_0x35aacc[_0x93dd('0x24')];this[_0x93dd('0x25')]=_0x35aacc['VoiceQueueId'];this[_0x93dd('0x26')]=_0x35aacc[_0x93dd('0x26')];this[_0x93dd('0x27')]=_0x35aacc[_0x93dd('0x27')]||'';this['originatecalleridname']=_0x35aacc[_0x93dd('0x28')]||'';}module[_0x93dd('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x11b8=['countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11b8,0x14e));var _0x811b=function(_0x4cbd35,_0x3fd034){_0x4cbd35=_0x4cbd35-0x0;var _0x41961e=_0x11b8[_0x4cbd35];return _0x41961e;};'use strict';var util=require('util');var _=require(_0x811b('0x0'));var moment=require('moment');function getSeconds(_0x11bf44,_0x254684){var _0x208b30=moment(_0x11bf44)[_0x811b('0x1')](0x0);var _0x248179=moment(_0x254684)[_0x811b('0x1')](0x0);return _0x208b30[_0x811b('0x2')](_0x248179,_0x811b('0x3'));}function QueueCallerAbandon(_0x48360a,_0x4699db){this[_0x811b('0x4')]=_0x48360a[_0x811b('0x4')];this['type']=_0x48360a[_0x811b('0x5')];this[_0x811b('0x6')]=_0x48360a[_0x811b('0x5')]===_0x811b('0x7')?_0x811b('0x8'):_0x48360a[_0x811b('0x5')];this['countbusyretry']=_0x48360a[_0x811b('0x9')];this[_0x811b('0xa')]=_0x48360a[_0x811b('0xa')];this['countnoanswerretry']=_0x48360a[_0x811b('0xb')];this[_0x811b('0xc')]=_0x48360a['countbusyretry']+_0x48360a[_0x811b('0xa')]+_0x48360a[_0x811b('0xb')]+_0x48360a['countnosuchnumberretry']+_0x48360a['countdropretry']+_0x48360a[_0x811b('0xd')]+_0x48360a[_0x811b('0xe')]+_0x48360a['countagentrejectretry'];this[_0x811b('0xf')]=_0x48360a[_0x811b('0xf')];this['countdropretry']=_0x48360a['countdropretry'];this[_0x811b('0xd')]=_0x48360a[_0x811b('0xd')];this['countmachineretry']=_0x48360a['countmachineretry'];this[_0x811b('0x10')]=_0x48360a['countagentrejectretry'];this[_0x811b('0x11')]=_0x4699db['uniqueid'];this[_0x811b('0x12')]=_0x48360a[_0x811b('0x13')];this[_0x811b('0x14')]=_0x48360a[_0x811b('0x15')];this[_0x811b('0x16')]=_0x48360a[_0x811b('0x16')];this[_0x811b('0x17')]=_0x48360a[_0x811b('0x17')];this['droptime']=_0x48360a[_0x811b('0x18')];this[_0x811b('0x19')]=this[_0x811b('0x18')];this[_0x811b('0x1a')]=getSeconds(_0x48360a[_0x811b('0x17')],_0x48360a['starttime']);this[_0x811b('0x1b')]=getSeconds(this[_0x811b('0x18')],_0x48360a[_0x811b('0x17')]);this[_0x811b('0x1c')]=0x0;this[_0x811b('0x8')]=_0x4699db[_0x811b('0x8')];this[_0x811b('0x1d')]=_0x4699db['connectedlinename'];this['reason']=_0x4699db[_0x811b('0x1e')];this[_0x811b('0x1f')]=_0x48360a[_0x811b('0x1f')];this[_0x811b('0x20')]=_0x48360a[_0x811b('0x20')];this[_0x811b('0x21')]=_0x48360a[_0x811b('0x21')];this['recallme']=_0x48360a[_0x811b('0x22')];this[_0x811b('0x23')]=_0x48360a['ContactId'];this[_0x811b('0x24')]=_0x48360a[_0x811b('0x24')];this['UserId']=_0x48360a[_0x811b('0x25')];this['VoiceQueueId']=_0x48360a[_0x811b('0x26')];this[_0x811b('0x27')]=_0x48360a['CampaignId'];this[_0x811b('0x28')]=_0x48360a[_0x811b('0x28')]||'';this[_0x811b('0x29')]=_0x48360a[_0x811b('0x29')]||'';}module[_0x811b('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 27c876a..b12ca87 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 _0x6b6a=['headerinfo','path','AttachmentId','exports','moment','uniqueid','channel','%s/%s/%s','tech','Trunk','name','fax','localstationid'];(function(_0x3fb32e,_0xe528f3){var _0x33dae1=function(_0x59ad20){while(--_0x59ad20){_0x3fb32e['push'](_0x3fb32e['shift']());}};_0x33dae1(++_0xe528f3);}(_0x6b6a,0x115));var _0xa6b6=function(_0x1b58b8,_0x3e1c2a){_0x1b58b8=_0x1b58b8-0x0;var _0x479502=_0x6b6a[_0x1b58b8];return _0x479502;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa6b6('0x0'));function Action(_0x3f52df,_0x5d07b9,_0x5dc51c){this[_0xa6b6('0x1')]=_0x3f52df||undefined;this[_0xa6b6('0x2')]=util['format'](_0xa6b6('0x3'),_0x5d07b9[_0xa6b6('0x4')],_0x5d07b9[_0xa6b6('0x5')][_0xa6b6('0x6')],_0x5dc51c[_0xa6b6('0x7')]);this[_0xa6b6('0x8')]=_0x5d07b9[_0xa6b6('0x8')];this['headerinfo']=_0x5d07b9[_0xa6b6('0x9')];this[_0xa6b6('0xa')]=_0x5dc51c['path'];this[_0xa6b6('0xb')]=_0x5dc51c['AttachmentId'];}module[_0xa6b6('0xc')]=Action; \ No newline at end of file +var _0xb75f=['exports','util','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xb75f,0x1f0));var _0xfb75=function(_0x4ae0f8,_0x481211){_0x4ae0f8=_0x4ae0f8-0x0;var _0xcd39f7=_0xb75f[_0x4ae0f8];return _0xcd39f7;};'use strict';var util=require(_0xfb75('0x0'));var _=require('lodash');var moment=require(_0xfb75('0x1'));function Action(_0x38b7fe,_0x631e23,_0x353fcd){this[_0xfb75('0x2')]=_0x38b7fe||undefined;this[_0xfb75('0x3')]=util[_0xfb75('0x4')](_0xfb75('0x5'),_0x631e23[_0xfb75('0x6')],_0x631e23[_0xfb75('0x7')][_0xfb75('0x8')],_0x353fcd[_0xfb75('0x9')]);this[_0xfb75('0xa')]=_0x631e23[_0xfb75('0xa')];this[_0xfb75('0xb')]=_0x631e23[_0xfb75('0xb')];this['path']=_0x353fcd[_0xfb75('0xc')];this[_0xfb75('0xd')]=_0x353fcd[_0xfb75('0xd')];}module[_0xfb75('0xe')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 805c79d..2e62140 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 _0x0c53=['name','info','\x20syncNewchannel\x20','hasOwnProperty','value','channelstate','channelstatedesc','variable','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','notify','fax','catch','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','trunks','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','actions','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','from-voip-provider','faxAccounts','exten','localstationid','uniqueid','channels','channel'];(function(_0x1a4134,_0x110ba3){var _0xce32ce=function(_0x56edb5){while(--_0x56edb5){_0x1a4134['push'](_0x1a4134['shift']());}};_0xce32ce(++_0x110ba3);}(_0x0c53,0xcc));var _0x30c5=function(_0x1a30e2,_0x3af185){_0x1a30e2=_0x1a30e2-0x0;var _0x5c3dc2=_0x0c53[_0x1a30e2];return _0x5c3dc2;};'use strict';var util=require(_0x30c5('0x0'));var _=require(_0x30c5('0x1'));var BPromise=require(_0x30c5('0x2'));var uuid=require('uuid');var moment=require(_0x30c5('0x3'));var path=require(_0x30c5('0x4'));var tiff2pdf=require(_0x30c5('0x5'));var gs=require(_0x30c5('0x6'));var logger=require(_0x30c5('0x7'))('fax');var ami=require('../ami');var rpcDb=require(_0x30c5('0x8'));var Channel=require('./channel');var ut=require(_0x30c5('0x9'));var Action=require(_0x30c5('0xa'));var faxAccount=require(_0x30c5('0xb'));var attachment=require(_0x30c5('0xc'));var faxMessage=require(_0x30c5('0xd'));function Fax(_0x277159){this['channels']={};this['faxAccounts']=_0x277159['faxAccounts'];this['trunks']=_0x277159['trunks'];this[_0x30c5('0xe')]={};ami['on']('newchannel',this[_0x30c5('0xf')][_0x30c5('0x10')](this));ami['on'](_0x30c5('0x11'),this[_0x30c5('0x12')][_0x30c5('0x10')](this));ami['on']('newstate',this[_0x30c5('0x13')][_0x30c5('0x10')](this));ami['on'](_0x30c5('0x14'),this[_0x30c5('0x15')]['bind'](this));ami['on']('faxstatus',this[_0x30c5('0x16')]['bind'](this));ami['on']('receivefax',this[_0x30c5('0x17')][_0x30c5('0x10')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x30c5('0x18'),this[_0x30c5('0x19')][_0x30c5('0x10')](this));}Fax[_0x30c5('0x1a')][_0x30c5('0xf')]=function(_0x4e8628){if(_0x4e8628['context']===_0x30c5('0x1b')){for(var _0x13559c in this[_0x30c5('0x1c')]){if(this[_0x30c5('0x1c')]['hasOwnProperty'](_0x13559c)){if(_0x4e8628[_0x30c5('0x1d')]===this[_0x30c5('0x1c')][_0x13559c][_0x30c5('0x1e')]){this['channels'][_0x4e8628[_0x30c5('0x1f')]]={};this[_0x30c5('0x20')][_0x4e8628[_0x30c5('0x1f')]][_0x30c5('0x21')]=_0x4e8628['channel'];this['channels'][_0x4e8628[_0x30c5('0x1f')]]['id']=this[_0x30c5('0x1c')][_0x13559c]['id'];this[_0x30c5('0x20')][_0x4e8628[_0x30c5('0x1f')]]['name']=this[_0x30c5('0x1c')][_0x13559c][_0x30c5('0x22')];logger[_0x30c5('0x23')](_0x4e8628[_0x30c5('0x1f')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x4e8628['uniqueid']]){this[_0x30c5('0x20')][_0x4e8628['uniqueid']]={};this[_0x30c5('0x20')][_0x4e8628[_0x30c5('0x1f')]][_0x30c5('0x21')]=_0x4e8628[_0x30c5('0x21')];logger[_0x30c5('0x23')](_0x4e8628[_0x30c5('0x1f')],_0x30c5('0x24'));}};Fax[_0x30c5('0x1a')]['syncVarSet']=function(_0xe8d973){if(this[_0x30c5('0x20')][_0xe8d973[_0x30c5('0x1f')]]){for(var _0x37c9f5 in _0xe8d973['variable']){if(_0xe8d973['variable'][_0x30c5('0x25')](_0x37c9f5)){this[_0x30c5('0x20')][_0xe8d973[_0x30c5('0x1f')]][_0x37c9f5]=_0xe8d973[_0x30c5('0x26')];}}}};Fax['prototype'][_0x30c5('0x13')]=function(_0x3e6bbc){if(this[_0x30c5('0x20')][_0x3e6bbc[_0x30c5('0x1f')]]){this[_0x30c5('0x20')][_0x3e6bbc[_0x30c5('0x1f')]][_0x30c5('0x27')]=_0x3e6bbc['channelstate'];this[_0x30c5('0x20')][_0x3e6bbc[_0x30c5('0x1f')]]['channelstatedesc']=_0x3e6bbc[_0x30c5('0x28')];}};Fax[_0x30c5('0x1a')][_0x30c5('0x15')]=function(_0x51c89e){if(this[_0x30c5('0x20')][_0x51c89e['uniqueid']]){for(var _0x485ad3 in _0x51c89e[_0x30c5('0x29')]){if(_0x51c89e['variable']['hasOwnProperty'](_0x485ad3)){this[_0x30c5('0x20')][_0x51c89e[_0x30c5('0x1f')]][_0x485ad3]=_0x51c89e[_0x30c5('0x26')];}}}};Fax[_0x30c5('0x1a')]['syncFaxStatus']=function(_0x9e9789){if(this['channels'][_0x9e9789[_0x30c5('0x1f')]]){this['channels'][_0x9e9789[_0x30c5('0x1f')]][_0x30c5('0x2a')]=_0x9e9789[_0x30c5('0x2a')];this[_0x30c5('0x20')][_0x9e9789[_0x30c5('0x1f')]]['status']=_0x9e9789[_0x30c5('0x2b')];this[_0x30c5('0x20')][_0x9e9789[_0x30c5('0x1f')]][_0x30c5('0x1e')]=_0x9e9789[_0x30c5('0x1e')];this[_0x30c5('0x20')][_0x9e9789['uniqueid']][_0x30c5('0x2c')]=_0x9e9789['filename'];logger['info'](_0x9e9789['uniqueid'],_0x30c5('0x2d'));}};Fax[_0x30c5('0x1a')][_0x30c5('0x17')]=function(_0x5755ca){var _0x401952=this;if(this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]]){var _0x42706d=this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]]['id'];this[_0x30c5('0x20')][_0x5755ca['uniqueid']][_0x30c5('0x2e')]=_0x5755ca[_0x30c5('0x2e')];this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]][_0x30c5('0x2f')]=_0x5755ca[_0x30c5('0x2f')];this[_0x30c5('0x20')][_0x5755ca['uniqueid']][_0x30c5('0x1e')]=_0x5755ca['localstationid'];this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]][_0x30c5('0x30')]=_0x5755ca[_0x30c5('0x30')];this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]][_0x30c5('0x31')]=_0x5755ca[_0x30c5('0x31')];this['channels'][_0x5755ca['uniqueid']][_0x30c5('0x2c')]=_0x5755ca[_0x30c5('0x2c')];this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]][_0x30c5('0x32')]=_0x5755ca[_0x30c5('0x32')];if(this[_0x30c5('0x20')][_0x5755ca[_0x30c5('0x1f')]][_0x30c5('0x2f')]>0x0){tiff2pdf(_0x5755ca[_0x30c5('0x2c')],_0x30c5('0x33'),function(_0x15739d){logger[_0x30c5('0x23')](_0x5755ca['uniqueid'],_0x30c5('0x34'),_0x15739d[_0x30c5('0x35')]);attachment['create']({'name':path['parse'](_0x5755ca[_0x30c5('0x2c')])['name'],'basename':path[_0x30c5('0x36')](_0x5755ca[_0x30c5('0x2c')])[_0x30c5('0x22')]+_0x30c5('0x37'),'type':_0x30c5('0x38')})['then'](function(_0x53d72e){faxAccount[_0x30c5('0x39')](_0x42706d,{'from':_0x5755ca[_0x30c5('0x32')],'mapKey':_0x30c5('0x3a'),'body':path[_0x30c5('0x36')](_0x5755ca[_0x30c5('0x2c')])[_0x30c5('0x22')]+_0x30c5('0x37'),'AttachmentId':_0x53d72e['id']})[_0x30c5('0x3b')](function(_0x2b3914){logger['error'](_0x5755ca[_0x30c5('0x1f')],_0x30c5('0x3c'),JSON[_0x30c5('0x3d')](_0x2b3914));});})[_0x30c5('0x3b')](function(_0x2a82e4){logger['error'](_0x5755ca[_0x30c5('0x1f')],_0x30c5('0x3e'),JSON[_0x30c5('0x3d')](_0x2a82e4));});});}logger['info'](_0x5755ca[_0x30c5('0x1f')],_0x30c5('0x3e'));}};Fax[_0x30c5('0x1a')][_0x30c5('0x19')]=function(_0xec5c10){if(this[_0x30c5('0xe')][_0xec5c10[_0x30c5('0x1f')]]){_['merge'](this[_0x30c5('0x20')][_0xec5c10[_0x30c5('0x1f')]],_[_0x30c5('0x3f')](_0xec5c10,[_0x30c5('0x40'),_0x30c5('0x41')]));}};function updateStatus(_0x8cf36d){if(_0x8cf36d[_0x30c5('0x42')]){faxMessage['update'](_0x8cf36d[_0x30c5('0x42')],{'failMessage':_0x30c5('0x43')})[_0x30c5('0x44')](function(_0x3be070){ut['logger'](_0x30c5('0x45'),_0x3be070);})[_0x30c5('0x3b')](function(_0x1c1eac){ut[_0x30c5('0x46')](_0x30c5('0x47'),_0x1c1eac);});}else{ut['logger'](_0x30c5('0x48'));}}Fax[_0x30c5('0x1a')][_0x30c5('0x49')]=function(_0x2e6600,_0x71daa8,_0x48cf8c){var _0x20af92=this;var _0x4bc97d={};if(_0x71daa8){_0x4bc97d={'read':_0x71daa8};}else{_0x4bc97d={'failMessage':_0x48cf8c};}if(this[_0x30c5('0xe')][_0x2e6600][_0x30c5('0x42')]){faxMessage[_0x30c5('0x4a')](this[_0x30c5('0xe')][_0x2e6600]['AttachmentId'],_0x4bc97d)[_0x30c5('0x44')](function(_0x26a81e){ut['logger'](_0x30c5('0x4b'),_0x26a81e);})[_0x30c5('0x3b')](function(_0x413170){ut[_0x30c5('0x46')](_0x30c5('0x4c'),_0x413170);})[_0x30c5('0x4d')](function(){delete _0x20af92[_0x30c5('0x20')][_0x2e6600];delete _0x20af92['actions'][_0x2e6600];});}else{ut['logger'](_0x30c5('0x4e'));delete this[_0x30c5('0x20')][_0x2e6600];delete this[_0x30c5('0xe')][_0x2e6600];}};Fax[_0x30c5('0x1a')][_0x30c5('0x4f')]=function(_0x3bfc68){var _0x4a45e6=this;if(this[_0x30c5('0x20')][_0x3bfc68['uniqueid']]){if(this[_0x30c5('0xe')][_0x3bfc68['uniqueid']]){this[_0x30c5('0x20')][_0x3bfc68[_0x30c5('0x1f')]]['id']=this['actions'][_0x3bfc68['uniqueid']]['id'];this['channels'][_0x3bfc68['uniqueid']]['name']=this[_0x30c5('0xe')][_0x3bfc68[_0x30c5('0x1f')]][_0x30c5('0x22')];}logger['info'](_0x3bfc68[_0x30c5('0x1f')],this[_0x30c5('0xe')][_0x3bfc68[_0x30c5('0x1f')]]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x30c5('0x3d')](this[_0x30c5('0x20')][_0x3bfc68[_0x30c5('0x1f')]]));if(this[_0x30c5('0xe')][_0x3bfc68['uniqueid']]){if(this['channels'][_0x3bfc68[_0x30c5('0x1f')]][_0x30c5('0x50')]>0x0&&this[_0x30c5('0x20')][_0x3bfc68[_0x30c5('0x1f')]]['faxstatus']===_0x30c5('0x51')){this['updateStatus'](_0x3bfc68[_0x30c5('0x1f')],!![]);}else{this[_0x30c5('0x49')](_0x3bfc68['uniqueid'],![],this[_0x30c5('0x20')][_0x3bfc68[_0x30c5('0x1f')]][_0x30c5('0x52')]?_0x30c5('0x53')+this[_0x30c5('0x20')][_0x3bfc68[_0x30c5('0x1f')]][_0x30c5('0x52')]:_0x30c5('0x54'));}}}};Fax[_0x30c5('0x1a')][_0x30c5('0x55')]=function(_0x128ae0){var _0x3a3d5a=this;return new BPromise(function(_0x1419ae,_0x3894e6){_0x3a3d5a[_0x30c5('0x56')](_0x128ae0,_0x3a3d5a[_0x30c5('0x1c')][_0x128ae0[_0x30c5('0x57')]])[_0x30c5('0x44')](function(_0x33f5eb){ut['logger']('[Fax][execOriginate][success]',_0x33f5eb);_0x1419ae(ut[_0x30c5('0x35')](_0x30c5('0x58')));})['catch'](function(_0x3c9117){ut['logger'](_0x30c5('0x59'),_0x3c9117);updateStatus(_0x128ae0);_0x3894e6(ut[_0x30c5('0x35')](_0x30c5('0x5a')));});});};Fax[_0x30c5('0x1a')][_0x30c5('0x5b')]=function(_0x294fa7){var _0x316727=this;return new BPromise(function(_0x353966,_0x4b4d99){var _0x277b5f=_0x316727[_0x30c5('0x5c')](_0x316727[_0x30c5('0x1c')][_0x294fa7[_0x30c5('0x57')]][_0x30c5('0x5d')],_0x294fa7);if(_0x277b5f[_0x30c5('0x5e')]){_0x353966(ut[_0x30c5('0x35')](_0x30c5('0x5f')));}else{_0x4b4d99(ut[_0x30c5('0x35')](_0x277b5f[_0x30c5('0x35')]));}});};function originate(_0x58d5f1,_0x2dc9d3,_0x1d4ddd){return new BPromise(function(_0x25ec3b,_0x1039c9){if(_0x1d4ddd){var _0x1c0984=util[_0x30c5('0x60')](_0x30c5('0x61'),path['parse'](_0x58d5f1['path'])[_0x30c5('0x22')],_0x58d5f1[_0x30c5('0x4')]);gs[_0x30c5('0x62')](_0x1c0984)[_0x30c5('0x44')](function(){_0x58d5f1[_0x30c5('0x4')]=util[_0x30c5('0x60')](_0x30c5('0x63'),path['parse'](_0x58d5f1[_0x30c5('0x4')])[_0x30c5('0x64')],path[_0x30c5('0x36')](_0x58d5f1['path'])['name']);_0x2dc9d3[_0x30c5('0x65')]=_0x58d5f1[_0x30c5('0x4')];ut[_0x30c5('0x46')](_0x30c5('0x66'),'');ami[_0x30c5('0x67')](ut[_0x30c5('0x68')](_0x58d5f1,_0x2dc9d3))[_0x30c5('0x44')](function(_0x30cb2d){_0x25ec3b(_0x30cb2d);})['catch'](function(_0x36a4de){_0x1039c9(_0x36a4de);});})['catch'](function(_0x1fdc7a){_0x1039c9(_0x1fdc7a);});}else{ami[_0x30c5('0x67')](ut[_0x30c5('0x68')](_0x58d5f1,_0x2dc9d3))[_0x30c5('0x44')](function(_0x55e75f){_0x25ec3b(_0x55e75f);})[_0x30c5('0x3b')](function(_0x1612e2){_0x1039c9(_0x1612e2);});}});}Fax[_0x30c5('0x1a')][_0x30c5('0x56')]=function(_0xc00e29,_0x293ae7){var _0x142ffd=this;return new BPromise(function(_0x588df7,_0x1f04e5){var _0x8e9b50=uuid['v4']();var _0x1636ab=ut[_0x30c5('0x69')](_0xc00e29,_0x293ae7);_0x142ffd[_0x30c5('0xe')][_0x8e9b50]=new Action(_0x8e9b50,_0x293ae7,_0xc00e29);var _0xd92b92=_0x142ffd[_0x30c5('0xe')][_0x8e9b50];if(path[_0x30c5('0x36')](_0xc00e29['path'])[_0x30c5('0x6a')]===_0x30c5('0x37')){originate(_0xd92b92,_0x1636ab,!![])[_0x30c5('0x44')](function(_0x420ec0){_0x588df7(_0x420ec0);})[_0x30c5('0x3b')](function(_0x467617){_0x1f04e5(_0x467617);});}else{originate(_0xd92b92,_0x1636ab,![])[_0x30c5('0x44')](function(_0x82451f){_0x588df7(_0x82451f);})[_0x30c5('0x3b')](function(_0x188ac8){_0x1f04e5(_0x188ac8);});}});};Fax[_0x30c5('0x1a')][_0x30c5('0x6b')]=function(_0xe2a7f6){return!_['isNil'](_0xe2a7f6)&&!_['isNil'](_0xe2a7f6[_0x30c5('0x22')])&&!_[_0x30c5('0x6c')](_0xe2a7f6[_0x30c5('0x6d')])&&_0xe2a7f6['active']&&!_[_0x30c5('0x6c')](this[_0x30c5('0x6e')][util[_0x30c5('0x60')](_0x30c5('0x6f'),_0xe2a7f6[_0x30c5('0x22')])])&&!_[_0x30c5('0x6c')](this[_0x30c5('0x6e')][util[_0x30c5('0x60')](_0x30c5('0x6f'),_0xe2a7f6[_0x30c5('0x22')])][_0x30c5('0x2b')])&&(this[_0x30c5('0x6e')][util[_0x30c5('0x60')](_0x30c5('0x6f'),_0xe2a7f6['name'])]['status']===_0x30c5('0x70')||this['trunks'][util[_0x30c5('0x60')](_0x30c5('0x6f'),_0xe2a7f6[_0x30c5('0x22')])][_0x30c5('0x2b')]==='unmonitored');};Fax['prototype'][_0x30c5('0x5c')]=function(_0x5a3a09,_0x5946cf){if(!this[_0x30c5('0x6b')](_0x5a3a09)){ut[_0x30c5('0x46')](_0x30c5('0x71'),_['isNil'](_0x5a3a09)?'':_0x5a3a09['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x30c5('0x72')};}if(_[_0x30c5('0x6c')](_0x5946cf[_0x30c5('0x3a')])){ut[_0x30c5('0x46')](_0x30c5('0x73'),JSON['stringify'](_0x5946cf));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x30c5('0x6c')](_0x5946cf[_0x30c5('0x4')])){ut[_0x30c5('0x46')](_0x30c5('0x74'),JSON[_0x30c5('0x3d')](_0x5946cf));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x30c5('0x75')};};module[_0x30c5('0x76')]=Fax; \ No newline at end of file +var _0xa7e6=['fax','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','updateStatus','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','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','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','moment','path','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','varset','syncVarSet','bind','newstate','newexten','faxstatus','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','syncNewState','channelstate','channelstatedesc','syncNewExten','syncFaxStatus','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf'];(function(_0x166ec1,_0x5ea555){var _0x5208e6=function(_0x48659a){while(--_0x48659a){_0x166ec1['push'](_0x166ec1['shift']());}};_0x5208e6(++_0x5ea555);}(_0xa7e6,0xab));var _0x6a7e=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0xa7e6[_0x1034ee];return _0x2922af;};'use strict';var util=require('util');var _=require(_0x6a7e('0x0'));var BPromise=require(_0x6a7e('0x1'));var uuid=require('uuid');var moment=require(_0x6a7e('0x2'));var path=require(_0x6a7e('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x6a7e('0x4'))('fax');var ami=require(_0x6a7e('0x5'));var rpcDb=require(_0x6a7e('0x6'));var Channel=require(_0x6a7e('0x7'));var ut=require(_0x6a7e('0x8'));var Action=require(_0x6a7e('0x9'));var faxAccount=require(_0x6a7e('0xa'));var attachment=require(_0x6a7e('0xb'));var faxMessage=require(_0x6a7e('0xc'));function Fax(_0x21813c){this[_0x6a7e('0xd')]={};this[_0x6a7e('0xe')]=_0x21813c[_0x6a7e('0xe')];this[_0x6a7e('0xf')]=_0x21813c[_0x6a7e('0xf')];this[_0x6a7e('0x10')]={};ami['on'](_0x6a7e('0x11'),this['syncNewchannel']['bind'](this));ami['on'](_0x6a7e('0x12'),this[_0x6a7e('0x13')][_0x6a7e('0x14')](this));ami['on'](_0x6a7e('0x15'),this['syncNewState'][_0x6a7e('0x14')](this));ami['on'](_0x6a7e('0x16'),this['syncNewExten']['bind'](this));ami['on'](_0x6a7e('0x17'),this['syncFaxStatus'][_0x6a7e('0x14')](this));ami['on']('receivefax',this['syncReceiveFax'][_0x6a7e('0x14')](this));ami['on'](_0x6a7e('0x18'),this[_0x6a7e('0x19')][_0x6a7e('0x14')](this));ami['on']('originateresponse',this[_0x6a7e('0x1a')][_0x6a7e('0x14')](this));}Fax[_0x6a7e('0x1b')][_0x6a7e('0x1c')]=function(_0x5e0885){if(_0x5e0885[_0x6a7e('0x1d')]===_0x6a7e('0x1e')){for(var _0x374a12 in this[_0x6a7e('0xe')]){if(this[_0x6a7e('0xe')]['hasOwnProperty'](_0x374a12)){if(_0x5e0885[_0x6a7e('0x1f')]===this[_0x6a7e('0xe')][_0x374a12]['localstationid']){this[_0x6a7e('0xd')][_0x5e0885[_0x6a7e('0x20')]]={};this[_0x6a7e('0xd')][_0x5e0885[_0x6a7e('0x20')]][_0x6a7e('0x21')]=_0x5e0885[_0x6a7e('0x21')];this[_0x6a7e('0xd')][_0x5e0885['uniqueid']]['id']=this[_0x6a7e('0xe')][_0x374a12]['id'];this[_0x6a7e('0xd')][_0x5e0885[_0x6a7e('0x20')]][_0x6a7e('0x22')]=this[_0x6a7e('0xe')][_0x374a12][_0x6a7e('0x22')];logger[_0x6a7e('0x23')](_0x5e0885[_0x6a7e('0x20')],_0x6a7e('0x24'));}}}}if(this[_0x6a7e('0x10')][_0x5e0885[_0x6a7e('0x20')]]){this['channels'][_0x5e0885[_0x6a7e('0x20')]]={};this[_0x6a7e('0xd')][_0x5e0885[_0x6a7e('0x20')]][_0x6a7e('0x21')]=_0x5e0885[_0x6a7e('0x21')];logger[_0x6a7e('0x23')](_0x5e0885[_0x6a7e('0x20')],_0x6a7e('0x24'));}};Fax[_0x6a7e('0x1b')]['syncVarSet']=function(_0x17e34c){if(this['channels'][_0x17e34c['uniqueid']]){for(var _0x584d6b in _0x17e34c[_0x6a7e('0x25')]){if(_0x17e34c['variable'][_0x6a7e('0x26')](_0x584d6b)){this[_0x6a7e('0xd')][_0x17e34c[_0x6a7e('0x20')]][_0x584d6b]=_0x17e34c[_0x6a7e('0x27')];}}}};Fax['prototype'][_0x6a7e('0x28')]=function(_0x5512ec){if(this['channels'][_0x5512ec[_0x6a7e('0x20')]]){this[_0x6a7e('0xd')][_0x5512ec['uniqueid']][_0x6a7e('0x29')]=_0x5512ec[_0x6a7e('0x29')];this[_0x6a7e('0xd')][_0x5512ec['uniqueid']]['channelstatedesc']=_0x5512ec[_0x6a7e('0x2a')];}};Fax['prototype'][_0x6a7e('0x2b')]=function(_0x275c52){if(this['channels'][_0x275c52[_0x6a7e('0x20')]]){for(var _0x4dfee5 in _0x275c52[_0x6a7e('0x25')]){if(_0x275c52[_0x6a7e('0x25')][_0x6a7e('0x26')](_0x4dfee5)){this[_0x6a7e('0xd')][_0x275c52[_0x6a7e('0x20')]][_0x4dfee5]=_0x275c52['value'];}}}};Fax[_0x6a7e('0x1b')][_0x6a7e('0x2c')]=function(_0x370ca8){if(this[_0x6a7e('0xd')][_0x370ca8['uniqueid']]){this[_0x6a7e('0xd')][_0x370ca8[_0x6a7e('0x20')]]['operation']=_0x370ca8[_0x6a7e('0x2d')];this['channels'][_0x370ca8['uniqueid']][_0x6a7e('0x2e')]=_0x370ca8[_0x6a7e('0x2e')];this[_0x6a7e('0xd')][_0x370ca8['uniqueid']][_0x6a7e('0x2f')]=_0x370ca8[_0x6a7e('0x2f')];this[_0x6a7e('0xd')][_0x370ca8[_0x6a7e('0x20')]][_0x6a7e('0x30')]=_0x370ca8[_0x6a7e('0x30')];logger['info'](_0x370ca8[_0x6a7e('0x20')],_0x6a7e('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x34b719){var _0x2dcc61=this;if(this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]]){var _0x3f0990=this[_0x6a7e('0xd')][_0x34b719['uniqueid']]['id'];this['channels'][_0x34b719[_0x6a7e('0x20')]][_0x6a7e('0x32')]=_0x34b719[_0x6a7e('0x32')];this['channels'][_0x34b719[_0x6a7e('0x20')]][_0x6a7e('0x33')]=_0x34b719[_0x6a7e('0x33')];this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]]['localstationid']=_0x34b719[_0x6a7e('0x2f')];this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]]['resolution']=_0x34b719['resolution'];this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]][_0x6a7e('0x34')]=_0x34b719[_0x6a7e('0x34')];this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]][_0x6a7e('0x30')]=_0x34b719[_0x6a7e('0x30')];this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]][_0x6a7e('0x35')]=_0x34b719[_0x6a7e('0x35')];if(this[_0x6a7e('0xd')][_0x34b719[_0x6a7e('0x20')]][_0x6a7e('0x33')]>0x0){tiff2pdf(_0x34b719[_0x6a7e('0x30')],_0x6a7e('0x36'),function(_0x536439){logger[_0x6a7e('0x23')](_0x34b719[_0x6a7e('0x20')],_0x6a7e('0x37'),_0x536439[_0x6a7e('0x38')]);attachment[_0x6a7e('0x39')]({'name':path[_0x6a7e('0x3a')](_0x34b719[_0x6a7e('0x30')])['name'],'basename':path[_0x6a7e('0x3a')](_0x34b719[_0x6a7e('0x30')])[_0x6a7e('0x22')]+_0x6a7e('0x3b'),'type':_0x6a7e('0x3c')})['then'](function(_0x43521c){faxAccount['notify'](_0x3f0990,{'from':_0x34b719[_0x6a7e('0x35')],'mapKey':_0x6a7e('0x3d'),'body':path[_0x6a7e('0x3a')](_0x34b719[_0x6a7e('0x30')])[_0x6a7e('0x22')]+_0x6a7e('0x3b'),'AttachmentId':_0x43521c['id']})[_0x6a7e('0x3e')](function(_0x5f550c){logger[_0x6a7e('0x3f')](_0x34b719['uniqueid'],'\x20notify\x20',JSON[_0x6a7e('0x40')](_0x5f550c));});})[_0x6a7e('0x3e')](function(_0x1df7c0){logger[_0x6a7e('0x3f')](_0x34b719[_0x6a7e('0x20')],_0x6a7e('0x41'),JSON[_0x6a7e('0x40')](_0x1df7c0));});});}logger[_0x6a7e('0x23')](_0x34b719['uniqueid'],_0x6a7e('0x41'));}};Fax[_0x6a7e('0x1b')][_0x6a7e('0x1a')]=function(_0xb39fec){if(this['actions'][_0xb39fec[_0x6a7e('0x20')]]){_[_0x6a7e('0x42')](this[_0x6a7e('0xd')][_0xb39fec['uniqueid']],_[_0x6a7e('0x43')](_0xb39fec,[_0x6a7e('0x44'),_0x6a7e('0x45')]));}};function updateStatus(_0x3ed54d){if(_0x3ed54d['AttachmentId']){faxMessage[_0x6a7e('0x46')](_0x3ed54d[_0x6a7e('0x47')],{'failMessage':_0x6a7e('0x48')})[_0x6a7e('0x49')](function(_0x37e41f){ut[_0x6a7e('0x4a')](_0x6a7e('0x4b'),_0x37e41f);})[_0x6a7e('0x3e')](function(_0x53b53e){ut['logger'](_0x6a7e('0x4c'),_0x53b53e);});}else{ut['logger'](_0x6a7e('0x4d'));}}Fax[_0x6a7e('0x1b')]['updateStatus']=function(_0x22f8b8,_0x1d0a94,_0xbea30e){var _0x5652b5=this;var _0x1eed52={};if(_0x1d0a94){_0x1eed52={'read':_0x1d0a94};}else{_0x1eed52={'failMessage':_0xbea30e};}if(this[_0x6a7e('0x10')][_0x22f8b8][_0x6a7e('0x47')]){faxMessage[_0x6a7e('0x46')](this[_0x6a7e('0x10')][_0x22f8b8][_0x6a7e('0x47')],_0x1eed52)[_0x6a7e('0x49')](function(_0xf52efd){ut[_0x6a7e('0x4a')](_0x6a7e('0x4e'),_0xf52efd);})[_0x6a7e('0x3e')](function(_0x4243a5){ut[_0x6a7e('0x4a')](_0x6a7e('0x4f'),_0x4243a5);})[_0x6a7e('0x50')](function(){delete _0x5652b5[_0x6a7e('0xd')][_0x22f8b8];delete _0x5652b5[_0x6a7e('0x10')][_0x22f8b8];});}else{ut[_0x6a7e('0x4a')](_0x6a7e('0x51'));delete this[_0x6a7e('0xd')][_0x22f8b8];delete this[_0x6a7e('0x10')][_0x22f8b8];}};Fax['prototype'][_0x6a7e('0x19')]=function(_0x273c88){var _0x1e37c0=this;if(this[_0x6a7e('0xd')][_0x273c88[_0x6a7e('0x20')]]){if(this['actions'][_0x273c88['uniqueid']]){this[_0x6a7e('0xd')][_0x273c88[_0x6a7e('0x20')]]['id']=this[_0x6a7e('0x10')][_0x273c88['uniqueid']]['id'];this[_0x6a7e('0xd')][_0x273c88[_0x6a7e('0x20')]]['name']=this[_0x6a7e('0x10')][_0x273c88['uniqueid']]['name'];}logger['info'](_0x273c88[_0x6a7e('0x20')],this[_0x6a7e('0x10')][_0x273c88[_0x6a7e('0x20')]]?_0x6a7e('0x52'):'\x20hangup\x20faxRiceive\x20',JSON[_0x6a7e('0x40')](this[_0x6a7e('0xd')][_0x273c88[_0x6a7e('0x20')]]));if(this[_0x6a7e('0x10')][_0x273c88['uniqueid']]){if(this['channels'][_0x273c88['uniqueid']]['faxpages']>0x0&&this[_0x6a7e('0xd')][_0x273c88[_0x6a7e('0x20')]][_0x6a7e('0x17')]===_0x6a7e('0x53')){this['updateStatus'](_0x273c88[_0x6a7e('0x20')],!![]);}else{this[_0x6a7e('0x54')](_0x273c88[_0x6a7e('0x20')],![],this[_0x6a7e('0xd')][_0x273c88['uniqueid']]['faxstatusstring']?_0x6a7e('0x55')+this[_0x6a7e('0xd')][_0x273c88['uniqueid']][_0x6a7e('0x56')]:_0x6a7e('0x57'));}}}};Fax[_0x6a7e('0x1b')][_0x6a7e('0x58')]=function(_0x2aec4d){var _0x585b1a=this;return new BPromise(function(_0x544a14,_0x21c74d){_0x585b1a['execOriginate'](_0x2aec4d,_0x585b1a[_0x6a7e('0xe')][_0x2aec4d[_0x6a7e('0x59')]])[_0x6a7e('0x49')](function(_0x326ea5){ut[_0x6a7e('0x4a')]('[Fax][execOriginate][success]',_0x326ea5);_0x544a14(ut[_0x6a7e('0x38')]('Fax\x20received'));})['catch'](function(_0x502d10){ut[_0x6a7e('0x4a')](_0x6a7e('0x5a'),_0x502d10);updateStatus(_0x2aec4d);_0x21c74d(ut[_0x6a7e('0x38')](_0x6a7e('0x5b')));});});};Fax[_0x6a7e('0x1b')]['checkAfterSend']=function(_0x132f26){var _0x17b533=this;return new BPromise(function(_0x356729,_0x54f9d4){var _0x3803a9=_0x17b533[_0x6a7e('0x5c')](_0x17b533['faxAccounts'][_0x132f26['FaxAccountId']]['Trunk'],_0x132f26);if(_0x3803a9[_0x6a7e('0x5d')]){_0x356729(ut['message'](_0x6a7e('0x5e')));}else{_0x54f9d4(ut['message'](_0x3803a9['message']));}});};function originate(_0x440352,_0xa4ecc3,_0x402f87){return new BPromise(function(_0x4d688c,_0x1123f3){if(_0x402f87){var _0x420cc0=util[_0x6a7e('0x5f')](_0x6a7e('0x60'),path[_0x6a7e('0x3a')](_0x440352['path'])['name'],_0x440352[_0x6a7e('0x3')]);gs['execute'](_0x420cc0)[_0x6a7e('0x49')](function(){_0x440352[_0x6a7e('0x3')]=util[_0x6a7e('0x5f')](_0x6a7e('0x61'),path[_0x6a7e('0x3a')](_0x440352[_0x6a7e('0x3')])['dir'],path[_0x6a7e('0x3a')](_0x440352[_0x6a7e('0x3')])['name']);_0xa4ecc3['XMF-PATH']=_0x440352[_0x6a7e('0x3')];ut[_0x6a7e('0x4a')](_0x6a7e('0x62'),'');ami[_0x6a7e('0x63')](ut[_0x6a7e('0x64')](_0x440352,_0xa4ecc3))[_0x6a7e('0x49')](function(_0x1ba6d5){_0x4d688c(_0x1ba6d5);})[_0x6a7e('0x3e')](function(_0x94ec32){_0x1123f3(_0x94ec32);});})[_0x6a7e('0x3e')](function(_0x4d7a68){_0x1123f3(_0x4d7a68);});}else{ami['Action'](ut[_0x6a7e('0x64')](_0x440352,_0xa4ecc3))['then'](function(_0x5aceb6){_0x4d688c(_0x5aceb6);})['catch'](function(_0x43bb18){_0x1123f3(_0x43bb18);});}});}Fax['prototype'][_0x6a7e('0x65')]=function(_0x5c58a4,_0x59d931){var _0x44bcfe=this;return new BPromise(function(_0x443788,_0x1dd341){var _0x4a1b26=uuid['v4']();var _0x4d4ac3=ut[_0x6a7e('0x66')](_0x5c58a4,_0x59d931);_0x44bcfe['actions'][_0x4a1b26]=new Action(_0x4a1b26,_0x59d931,_0x5c58a4);var _0x431a92=_0x44bcfe['actions'][_0x4a1b26];if(path['parse'](_0x5c58a4[_0x6a7e('0x3')])['ext']===_0x6a7e('0x3b')){originate(_0x431a92,_0x4d4ac3,!![])[_0x6a7e('0x49')](function(_0x5efb9e){_0x443788(_0x5efb9e);})[_0x6a7e('0x3e')](function(_0x4e2c24){_0x1dd341(_0x4e2c24);});}else{originate(_0x431a92,_0x4d4ac3,![])[_0x6a7e('0x49')](function(_0x1d2432){_0x443788(_0x1d2432);})['catch'](function(_0x26d044){_0x1dd341(_0x26d044);});}});};Fax[_0x6a7e('0x1b')][_0x6a7e('0x67')]=function(_0x1048cb){return!_[_0x6a7e('0x68')](_0x1048cb)&&!_[_0x6a7e('0x68')](_0x1048cb[_0x6a7e('0x22')])&&!_[_0x6a7e('0x68')](_0x1048cb[_0x6a7e('0x69')])&&_0x1048cb['active']&&!_['isNil'](this[_0x6a7e('0xf')][util[_0x6a7e('0x5f')]('SIP/%s',_0x1048cb['name'])])&&!_[_0x6a7e('0x68')](this[_0x6a7e('0xf')][util[_0x6a7e('0x5f')](_0x6a7e('0x6a'),_0x1048cb['name'])]['status'])&&(this['trunks'][util[_0x6a7e('0x5f')](_0x6a7e('0x6a'),_0x1048cb['name'])][_0x6a7e('0x2e')]===_0x6a7e('0x6b')||this[_0x6a7e('0xf')][util['format']('SIP/%s',_0x1048cb[_0x6a7e('0x22')])][_0x6a7e('0x2e')]==='unmonitored');};Fax['prototype'][_0x6a7e('0x5c')]=function(_0x3abafe,_0x11f55f){if(!this['isTrunkReachable'](_0x3abafe)){ut[_0x6a7e('0x4a')](_0x6a7e('0x6c'),_['isNil'](_0x3abafe)?'':_0x3abafe[_0x6a7e('0x22')]+_0x6a7e('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x6a7e('0x68')](_0x11f55f['fax'])){ut['logger'](_0x6a7e('0x6e'),JSON['stringify'](_0x11f55f));return{'isValid':![],'message':_0x6a7e('0x6f')};}if(_[_0x6a7e('0x68')](_0x11f55f['path'])){ut[_0x6a7e('0x4a')](_0x6a7e('0x70'),JSON[_0x6a7e('0x40')](_0x11f55f));return{'isValid':![],'message':_0x6a7e('0x71')};}return{'isValid':!![],'message':_0x6a7e('0x72')};};module[_0x6a7e('0x73')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index dcb2910..9ce4318 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 _0xd16a=['../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','[Notify]\x20','util','bluebird'];(function(_0x197cbf,_0x3274d6){var _0x1f1826=function(_0x2ffa4c){while(--_0x2ffa4c){_0x197cbf['push'](_0x197cbf['shift']());}};_0x1f1826(++_0x3274d6);}(_0xd16a,0x106));var _0xad16=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd16a[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xad16('0x0'));var BPromise=require(_0xad16('0x1'));var logger=require(_0xad16('0x2'))(_0xad16('0x3'));var _=require(_0xad16('0x4'));var faxAccount=require(_0xad16('0x5'));function loggerCatch(_0x460851){return function(_0x589a5f){logger[_0xad16('0x6')](_0x460851,util[_0xad16('0x7')](_0x589a5f,{'showHidden':![],'depth':null}));};}exports[_0xad16('0x8')]=function(_0x3f5239,_0x2f0bb9){return BPromise[_0xad16('0x9')]()[_0xad16('0xa')](faxAccount[_0xad16('0x8')](_0x3f5239,_0x2f0bb9))['catch'](loggerCatch(_0xad16('0xb')));}; \ No newline at end of file +var _0x9588=['inspect','notify','resolve','then','catch','[Notify]\x20','util','preview','../rpc/faxAccount','error'];(function(_0x24b33c,_0x33cb97){var _0x33becf=function(_0x4d8a9c){while(--_0x4d8a9c){_0x24b33c['push'](_0x24b33c['shift']());}};_0x33becf(++_0x33cb97);}(_0x9588,0xc4));var _0x8958=function(_0x3f4a93,_0x202f25){_0x3f4a93=_0x3f4a93-0x0;var _0x182847=_0x9588[_0x3f4a93];return _0x182847;};'use strict';var util=require(_0x8958('0x0'));var BPromise=require('bluebird');var logger=require('../../../config/logger')(_0x8958('0x1'));var _=require('lodash');var faxAccount=require(_0x8958('0x2'));function loggerCatch(_0xfa7199){return function(_0x2bf8c8){logger[_0x8958('0x3')](_0xfa7199,util[_0x8958('0x4')](_0x2bf8c8,{'showHidden':![],'depth':null}));};}exports[_0x8958('0x5')]=function(_0x5bb81d,_0x45e022){return BPromise[_0x8958('0x6')]()[_0x8958('0x7')](faxAccount[_0x8958('0x5')](_0x5bb81d,_0x45e022))[_0x8958('0x8')](loggerCatch(_0x8958('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index d53876b..ba47f4f 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 _0xc568=['inspect','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xc568,0xc9));var _0x8c56=function(_0x2740d9,_0xfcea46){_0x2740d9=_0x2740d9-0x0;var _0x1c5f67=_0xc568[_0x2740d9];return _0x1c5f67;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0x8c56('0x0'));var BPromise=require(_0x8c56('0x1'));var exec=require(_0x8c56('0x2'))['exec'];exports[_0x8c56('0x3')]=function(_0x2b14a4){return new BPromise(function(_0x3cd9a1,_0x16b2ba){exec(_0x2b14a4,function(_0x4f2f6a,_0x901c26,_0x1d2f51){logger[_0x8c56('0x4')](_0x8c56('0x5'),_0x901c26);if(_0x4f2f6a){logger[_0x8c56('0x4')](_0x8c56('0x5'),_0x8c56('0x6'),util[_0x8c56('0x7')](_0x4f2f6a,{'showHidden':![],'depth':null}),_0x901c26,_0x1d2f51);_0x16b2ba(_0x4f2f6a);}_0x3cd9a1(_0x901c26);});});}; \ No newline at end of file +var _0xc23e=['../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x375f52,_0x44deef){var _0x483be6=function(_0x3991e6){while(--_0x3991e6){_0x375f52['push'](_0x375f52['shift']());}};_0x483be6(++_0x44deef);}(_0xc23e,0xbd));var _0xec23=function(_0x4536cd,_0x3064c7){_0x4536cd=_0x4536cd-0x0;var _0x3ab9f8=_0xc23e[_0x4536cd];return _0x3ab9f8;};'use strict';var util=require('util');var logger=require(_0xec23('0x0'))(_0xec23('0x1'));var BPromise=require(_0xec23('0x2'));var exec=require('child_process')[_0xec23('0x3')];exports[_0xec23('0x4')]=function(_0xe25dd7){return new BPromise(function(_0x1accba,_0x4194c3){exec(_0xe25dd7,function(_0x4fcb24,_0x1cf930,_0x513a96){logger['info']('Exec\x20gs',_0x1cf930);if(_0x4fcb24){logger[_0xec23('0x5')](_0xec23('0x6'),_0xec23('0x7'),util[_0xec23('0x8')](_0x4fcb24,{'showHidden':![],'depth':null}),_0x1cf930,_0x513a96);_0x4194c3(_0x4fcb24);}_0x1accba(_0x1cf930);});});}; \ 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 a7ec2a9..d02c8c9 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 _0x2e54=['addVariables','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','uniqueid','util','../../../../config/logger','fax','message','logger','inspect'];(function(_0x2f64d7,_0x2abd4e){var _0x3f94d1=function(_0x4a495d){while(--_0x4a495d){_0x2f64d7['push'](_0x2f64d7['shift']());}};_0x3f94d1(++_0x2abd4e);}(_0x2e54,0x1dd));var _0x42e5=function(_0x147272,_0x28e0ee){_0x147272=_0x147272-0x0;var _0x35fb73=_0x2e54[_0x147272];return _0x35fb73;};'use strict';var util=require(_0x42e5('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x42e5('0x1'))(_0x42e5('0x2'));exports[_0x42e5('0x3')]=function(_0x1c62bb){return{'message':_0x1c62bb};};exports[_0x42e5('0x4')]=function(_0x153440,_0x42736b){logger['info'](_0x153440,util[_0x42e5('0x5')](_0x42736b,{'showHidden':![],'depth':null}));};exports[_0x42e5('0x6')]=function(_0x38cb1b,_0x4bed10){var _0x2af5bb={'XMF-ECM':_0x4bed10['ecm'],'XMF-HEADERINFO':_0x4bed10[_0x42e5('0x7')],'XMF-MINRATE':_0x4bed10['minrate'],'XMF-MAXRATE':_0x4bed10[_0x42e5('0x8')],'XMF-MODEM':util[_0x42e5('0x9')](_0x42e5('0xa'),_0x4bed10[_0x42e5('0xb')]),'XMF-GATEWAY':_0x4bed10[_0x42e5('0xc')],'XMF-FAXDETECT':_0x4bed10[_0x42e5('0xd')],'XMF-T38TIMEOUT':_0x4bed10[_0x42e5('0xe')],'XMF-LOCALSTATIONID':_0x4bed10[_0x42e5('0xf')],'XMF-PATH':_0x38cb1b[_0x42e5('0x10')]};return _0x2af5bb;};exports['variablesAction']=function(_0x456298,_0x28b3b3){return{'actionid':_0x456298['uniqueid'],'action':_0x42e5('0x11'),'channel':_0x456298[_0x42e5('0x12')],'Exten':_0x42e5('0x13'),'Context':_0x42e5('0x14'),'Priority':'1','callerid':util[_0x42e5('0x9')](_0x42e5('0x15'),_0x456298[_0x42e5('0x7')]?_0x456298[_0x42e5('0x7')]:'',_0x456298[_0x42e5('0xf')]),'variable':_0x28b3b3,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x456298[_0x42e5('0x16')]};}; \ No newline at end of file +var _0x04b8=['variablesAction','uniqueid','channel','from-sip','\x22%s\x22\x20<%s>','lodash','../../../../config/logger','fax','logger','info','inspect','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x04b8,0x159));var _0x804b=function(_0x398277,_0x286034){_0x398277=_0x398277-0x0;var _0xd99f9f=_0x04b8[_0x398277];return _0xd99f9f;};'use strict';var util=require('util');var _=require(_0x804b('0x0'));var moment=require('moment');var logger=require(_0x804b('0x1'))(_0x804b('0x2'));exports['message']=function(_0x1a52ec){return{'message':_0x1a52ec};};exports[_0x804b('0x3')]=function(_0x5857dc,_0x3530f6){logger[_0x804b('0x4')](_0x5857dc,util[_0x804b('0x5')](_0x3530f6,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x2c22e3,_0x3c5404){var _0x476262={'XMF-ECM':_0x3c5404['ecm'],'XMF-HEADERINFO':_0x3c5404[_0x804b('0x6')],'XMF-MINRATE':_0x3c5404[_0x804b('0x7')],'XMF-MAXRATE':_0x3c5404['maxrate'],'XMF-MODEM':util[_0x804b('0x8')](_0x804b('0x9'),_0x3c5404[_0x804b('0xa')]),'XMF-GATEWAY':_0x3c5404[_0x804b('0xb')],'XMF-FAXDETECT':_0x3c5404[_0x804b('0xc')],'XMF-T38TIMEOUT':_0x3c5404['t38timeout'],'XMF-LOCALSTATIONID':_0x3c5404[_0x804b('0xd')],'XMF-PATH':_0x2c22e3[_0x804b('0xe')]};return _0x476262;};exports[_0x804b('0xf')]=function(_0x7029e7,_0x2d13ba){return{'actionid':_0x7029e7[_0x804b('0x10')],'action':'originate','channel':_0x7029e7[_0x804b('0x11')],'Exten':'xcally-motion-fax','Context':_0x804b('0x12'),'Priority':'1','callerid':util[_0x804b('0x8')](_0x804b('0x13'),_0x7029e7[_0x804b('0x6')]?_0x7029e7['headerinfo']:'',_0x7029e7[_0x804b('0xd')]),'variable':_0x2d13ba,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x7029e7[_0x804b('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 86f2b90..142555b 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 _0xc7dc=['initDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','log','listen','sync','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts'];(function(_0x1d1786,_0x53116d){var _0x59c5d0=function(_0x404458){while(--_0x404458){_0x1d1786['push'](_0x1d1786['shift']());}};_0x59c5d0(++_0x53116d);}(_0xc7dc,0x1a3));var _0xcc7d=function(_0x45cb89,_0x99520e){_0x45cb89=_0x45cb89-0x0;var _0x5948c1=_0xc7dc[_0x45cb89];return _0x5948c1;};'use strict';var BPromise=require('bluebird');var util=require(_0xcc7d('0x0'));var moment=require(_0xcc7d('0x1'));var server=require(_0xcc7d('0x2'));var Realtime=require(_0xcc7d('0x3'));var Report=require(_0xcc7d('0x4'));var Acw=require(_0xcc7d('0x5'));var Trigger=require(_0xcc7d('0x6'));var Dialer=require('./dialer');var Preview=require(_0xcc7d('0x7'));var Fax=require(_0xcc7d('0x8'));var user=require('./rpc/user');var voiceQueue=require(_0xcc7d('0x9'));var voiceQueueReport=require(_0xcc7d('0xa'));var voiceCallReport=require(_0xcc7d('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0xcc7d('0xc'));var template=require(_0xcc7d('0xd'));var cmHopperHistory=require(_0xcc7d('0xe'));var campaign=require(_0xcc7d('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xcc7d('0x10'));var zendesk=require(_0xcc7d('0x11'));var salesforce=require(_0xcc7d('0x12'));var sugarcrm=require(_0xcc7d('0x13'));var freshdesk=require(_0xcc7d('0x14'));var desk=require(_0xcc7d('0x15'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xcc7d('0x16'));var freshsales=require(_0xcc7d('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xcc7d('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()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xcc7d('0x19')](_0xcc7d('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xcc7d('0x1b')]()[_0xcc7d('0x1c')](user[_0xcc7d('0x1d')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x1e')]())['then'](user[_0xcc7d('0x1f')]())[_0xcc7d('0x1c')](realtime['initTelephones']())[_0xcc7d('0x1c')](trunk[_0xcc7d('0x20')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x21')]())[_0xcc7d('0x1c')](voiceQueue[_0xcc7d('0x22')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x23')]())[_0xcc7d('0x1c')](trigger['getTriggers']())[_0xcc7d('0x1c')](realtime['initTriggers']())[_0xcc7d('0x1c')](template['getTemplates']())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x24')]())['then'](zendesk[_0xcc7d('0x25')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x26')]())[_0xcc7d('0x1c')](salesforce[_0xcc7d('0x27')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x28')]())[_0xcc7d('0x1c')](sugarcrm[_0xcc7d('0x29')]())[_0xcc7d('0x1c')](realtime['initSugarcrmAccounts']())[_0xcc7d('0x1c')](freshdesk['getFreshdeskAccounts']())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x2a')]())[_0xcc7d('0x1c')](desk['getDeskAccounts']())['then'](realtime[_0xcc7d('0x2b')]())[_0xcc7d('0x1c')](zoho[_0xcc7d('0x2c')]())[_0xcc7d('0x1c')](realtime['initZohoAccounts']())[_0xcc7d('0x1c')](vtiger[_0xcc7d('0x2d')]())[_0xcc7d('0x1c')](realtime['initVtigerAccounts']())[_0xcc7d('0x1c')](freshsales[_0xcc7d('0x2e')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x2f')]())[_0xcc7d('0x1c')](servicenow['getServicenowAccounts']())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x30')]())['then'](dynamics365[_0xcc7d('0x31')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x32')]())['then'](campaign[_0xcc7d('0x33')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x34')]())['then'](voiceExtension[_0xcc7d('0x35')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x36')]())[_0xcc7d('0x1c')](faxAccount[_0xcc7d('0x37')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x38')]())[_0xcc7d('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xcc7d('0x1b')]()[_0xcc7d('0x1c')](voiceQueueReport['getVoiceQueueReports']())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x39')]())['then'](cmHopperHistory[_0xcc7d('0x3a')]())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x3b')]())[_0xcc7d('0x1c')](cmHopperHistory[_0xcc7d('0x3c')]())[_0xcc7d('0x1c')](realtime['initCampaignHopperHistory']())[_0xcc7d('0x1c')](voiceCallReport['getVoiceCallReports']())[_0xcc7d('0x1c')](realtime[_0xcc7d('0x3d')]())[_0xcc7d('0x1c')](function(_0x4e4a3c){})[_0xcc7d('0x3e')](function(_0x2da542){console[_0xcc7d('0x3f')](_0x2da542);});}function main(){return server[_0xcc7d('0x40')](realtime,preview,fax)[_0xcc7d('0x1c')](function(_0x43f993){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0xcc7d('0x41')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x3ee3f2){console[_0xcc7d('0x3f')](_0x3ee3f2);});}main(); \ No newline at end of file +var _0x1b94=['initFaxAccounts','resolve','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions'];(function(_0x3860d2,_0x4931fc){var _0x48c1df=function(_0x3fea2c){while(--_0x3fea2c){_0x3860d2['push'](_0x3860d2['shift']());}};_0x48c1df(++_0x4931fc);}(_0x1b94,0x169));var _0x41b9=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x1b94[_0x476bf4];return _0x788ffe;};'use strict';var BPromise=require(_0x41b9('0x0'));var util=require(_0x41b9('0x1'));var moment=require('moment');var server=require(_0x41b9('0x2'));var Realtime=require(_0x41b9('0x3'));var Report=require(_0x41b9('0x4'));var Acw=require(_0x41b9('0x5'));var Trigger=require(_0x41b9('0x6'));var Dialer=require(_0x41b9('0x7'));var Preview=require(_0x41b9('0x8'));var Fax=require('./fax');var user=require(_0x41b9('0x9'));var voiceQueue=require(_0x41b9('0xa'));var voiceQueueReport=require(_0x41b9('0xb'));var voiceCallReport=require(_0x41b9('0xc'));var trunk=require('./rpc/trunk');var trigger=require(_0x41b9('0xd'));var template=require(_0x41b9('0xe'));var cmHopperHistory=require(_0x41b9('0xf'));var campaign=require(_0x41b9('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x41b9('0x11'));var zendesk=require(_0x41b9('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x41b9('0x13'));var freshdesk=require(_0x41b9('0x14'));var desk=require(_0x41b9('0x15'));var zoho=require(_0x41b9('0x16'));var vtiger=require(_0x41b9('0x17'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0x41b9('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x41b9('0x19')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x41b9('0x19')](_0x41b9('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x41b9('0x1b')](user[_0x41b9('0x1c')]())['then'](realtime[_0x41b9('0x1d')]())[_0x41b9('0x1b')](user[_0x41b9('0x1e')]())['then'](realtime[_0x41b9('0x1f')]())[_0x41b9('0x1b')](trunk['getTrunks']())[_0x41b9('0x1b')](realtime[_0x41b9('0x20')]())['then'](voiceQueue[_0x41b9('0x21')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x22')]())['then'](trigger[_0x41b9('0x23')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x24')]())['then'](template[_0x41b9('0x25')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x26')]())[_0x41b9('0x1b')](zendesk[_0x41b9('0x27')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x28')]())[_0x41b9('0x1b')](salesforce[_0x41b9('0x29')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x2a')]())[_0x41b9('0x1b')](sugarcrm[_0x41b9('0x2b')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x2c')]())[_0x41b9('0x1b')](freshdesk[_0x41b9('0x2d')]())[_0x41b9('0x1b')](realtime['initFreshdeskAccounts']())[_0x41b9('0x1b')](desk[_0x41b9('0x2e')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x2f')]())[_0x41b9('0x1b')](zoho['getZohoAccounts']())[_0x41b9('0x1b')](realtime[_0x41b9('0x30')]())[_0x41b9('0x1b')](vtiger[_0x41b9('0x31')]())['then'](realtime[_0x41b9('0x32')]())[_0x41b9('0x1b')](freshsales[_0x41b9('0x33')]())['then'](realtime[_0x41b9('0x34')]())[_0x41b9('0x1b')](servicenow['getServicenowAccounts']())['then'](realtime[_0x41b9('0x35')]())['then'](dynamics365[_0x41b9('0x36')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x37')]())[_0x41b9('0x1b')](campaign['getCampaigns']())[_0x41b9('0x1b')](realtime[_0x41b9('0x38')]())[_0x41b9('0x1b')](voiceExtension[_0x41b9('0x39')]())['then'](realtime[_0x41b9('0x3a')]())['then'](faxAccount['getFaxAccounts']())[_0x41b9('0x1b')](realtime[_0x41b9('0x3b')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x41b9('0x3c')]()[_0x41b9('0x1b')](voiceQueueReport['getVoiceQueueReports']())[_0x41b9('0x1b')](realtime[_0x41b9('0x3d')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x41b9('0x1b')](realtime['initVoiceQueueHopperHistory']())[_0x41b9('0x1b')](cmHopperHistory[_0x41b9('0x3e')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x3f')]())['then'](voiceCallReport[_0x41b9('0x40')]())[_0x41b9('0x1b')](realtime[_0x41b9('0x41')]())[_0x41b9('0x1b')](function(_0x29a9bb){})[_0x41b9('0x42')](function(_0x1b2148){console['log'](_0x1b2148);});}function main(){return server[_0x41b9('0x43')](realtime,preview,fax)[_0x41b9('0x1b')](function(_0x25055b){return initRealtime();})[_0x41b9('0x1b')](function(){return initParams();})[_0x41b9('0x1b')](function(){report[_0x41b9('0x44')]();setInterval(initRealtime,0x1388);})[_0x41b9('0x42')](function(_0x5ca5fa){console[_0x41b9('0x45')](_0x5ca5fa);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 3b50d86..7051f65 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 _0x138a=['accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','state','toLowerCase','not_inuse','inuse','talking','voiceStatus','statePause','voiceStatusTime','format','onhold','stringify','user:%s','emit','user:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email'];(function(_0x2dcab5,_0x7bfa92){var _0x1af7c5=function(_0x1ca98e){while(--_0x1ca98e){_0x2dcab5['push'](_0x2dcab5['shift']());}};_0x1af7c5(++_0x7bfa92);}(_0x138a,0x117));var _0xa138=function(_0x5bfa44,_0x3b17f7){_0x5bfa44=_0x5bfa44-0x0;var _0x1b28ac=_0x138a[_0x5bfa44];return _0x1b28ac;};'use strict';var _=require(_0xa138('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0xa138('0x1'));var Redis=require(_0xa138('0x2'));var config=require(_0xa138('0x3'));config[_0xa138('0x4')]=_[_0xa138('0x5')](config[_0xa138('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xa138('0x6'))(new Redis(config[_0xa138('0x4')]));function Agent(_0x4fa582){this['id']=_0x4fa582['id']||0x0;this[_0xa138('0x7')]=_0x4fa582[_0xa138('0x7')]||'';this['email']=_0x4fa582[_0xa138('0x8')]||'';this[_0xa138('0x9')]=_0x4fa582['accountcode']||'';this['fullname']=_0x4fa582[_0xa138('0xa')]||'';this['state']=_0xa138('0xb');this[_0xa138('0xc')]=0x0;this[_0xa138('0xd')]=_0xa138('0xb');this[_0xa138('0xe')]='';this['phone']='';this[_0xa138('0xf')]='';this[_0xa138('0x10')]='';this[_0xa138('0x11')]=_0x4fa582['online']||![];this['voiceStatus']=_0xa138('0xb');this['voiceStatusTime']=0x0;this[_0xa138('0x12')]='';this[_0xa138('0x13')]='';this['onhold']=![];this[_0xa138('0x14')]=![];this[_0xa138('0x1')]='';}Agent[_0xa138('0x15')]['updateStatusRealtime']=function(_0x3fe549){var _0x18e9f3;if(_0x3fe549&&_0x3fe549[_0xa138('0x16')]){_0x18e9f3=_0x3fe549[_0xa138('0x16')][_0xa138('0x17')]();switch(_0x18e9f3){case _0xa138('0x18'):_0x18e9f3='idle';break;case _0xa138('0x19'):_0x18e9f3=_0xa138('0x1a');break;}}if(_0x18e9f3&&this[_0xa138('0x1b')]!==_0x18e9f3||_0x3fe549[_0xa138('0x1c')]){this[_0xa138('0x1d')]=_['toNumber'](moment()[_0xa138('0x1e')]('x'));}if(_0x18e9f3){this[_0xa138('0x1b')]=_0x18e9f3;}var _0x565929={'id':this['id'],'name':this[_0xa138('0x7')],'email':this[_0xa138('0x8')],'accountcode':this[_0xa138('0x9')],'fullname':this['fullname'],'state':this[_0xa138('0x16')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0xa138('0xe')],'online':this['online'],'voiceStatus':this[_0xa138('0x1b')],'voiceStatusTime':this[_0xa138('0x1d')],'voiceStatusCallerIdNumber':this[_0xa138('0x12')],'voiceStatusQueue':this[_0xa138('0x13')],'interface':this[_0xa138('0x10')],'onhold':this[_0xa138('0x1f')]};var _0x121ba7=md5(JSON[_0xa138('0x20')](_0x565929));if(this[_0xa138('0x1')]!==_0x121ba7){this[_0xa138('0x1')]=_0x121ba7;io['to'](util['format'](_0xa138('0x21'),_0x565929[_0xa138('0x7')]))[_0xa138('0x22')](_0xa138('0x23'),_0x565929);}};module['exports']=Agent; \ No newline at end of file +var _0x2eb9=['stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','prototype','updateStatusRealtime','state','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','address','voiceStatusQueue','stringify','emit','exports','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown'];(function(_0x42b6da,_0x83945d){var _0x4eb021=function(_0x211bec){while(--_0x211bec){_0x42b6da['push'](_0x42b6da['shift']());}};_0x4eb021(++_0x83945d);}(_0x2eb9,0x8f));var _0x92eb=function(_0x5a5ac5,_0x501a95){_0x5a5ac5=_0x5a5ac5-0x0;var _0x534d8c=_0x2eb9[_0x5a5ac5];return _0x534d8c;};'use strict';var _=require('lodash');var util=require(_0x92eb('0x0'));var moment=require(_0x92eb('0x1'));var md5=require(_0x92eb('0x2'));var Redis=require(_0x92eb('0x3'));var config=require(_0x92eb('0x4'));config[_0x92eb('0x5')]=_['defaults'](config[_0x92eb('0x5')],{'host':_0x92eb('0x6'),'port':0x18eb});var io=require(_0x92eb('0x7'))(new Redis(config['redis']));function Agent(_0x1d733c){this['id']=_0x1d733c['id']||0x0;this[_0x92eb('0x8')]=_0x1d733c[_0x92eb('0x8')]||'';this[_0x92eb('0x9')]=_0x1d733c[_0x92eb('0x9')]||'';this[_0x92eb('0xa')]=_0x1d733c[_0x92eb('0xa')]||'';this[_0x92eb('0xb')]=_0x1d733c[_0x92eb('0xb')]||'';this['state']=_0x92eb('0xc');this[_0x92eb('0xd')]=0x0;this[_0x92eb('0xe')]=_0x92eb('0xc');this['address']='';this[_0x92eb('0xf')]='';this[_0x92eb('0x10')]='';this[_0x92eb('0x11')]='';this[_0x92eb('0x12')]=_0x1d733c[_0x92eb('0x12')]||![];this[_0x92eb('0x13')]=_0x92eb('0xc');this[_0x92eb('0x14')]=0x0;this[_0x92eb('0x15')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x92eb('0x16')]=![];this[_0x92eb('0x2')]='';}Agent[_0x92eb('0x17')][_0x92eb('0x18')]=function(_0x4de8c9){var _0x2e64d4;if(_0x4de8c9&&_0x4de8c9[_0x92eb('0x19')]){_0x2e64d4=_0x4de8c9[_0x92eb('0x19')][_0x92eb('0x1a')]();switch(_0x2e64d4){case _0x92eb('0x1b'):_0x2e64d4=_0x92eb('0x1c');break;case _0x92eb('0x1d'):_0x2e64d4=_0x92eb('0x1e');break;}}if(_0x2e64d4&&this[_0x92eb('0x13')]!==_0x2e64d4||_0x4de8c9[_0x92eb('0x1f')]){this[_0x92eb('0x14')]=_[_0x92eb('0x20')](moment()[_0x92eb('0x21')]('x'));}if(_0x2e64d4){this[_0x92eb('0x13')]=_0x2e64d4;}var _0x453c2d={'id':this['id'],'name':this['name'],'email':this['email'],'accountcode':this['accountcode'],'fullname':this[_0x92eb('0xb')],'state':this[_0x92eb('0x19')],'stateTime':this[_0x92eb('0xd')],'status':this[_0x92eb('0xe')],'address':this[_0x92eb('0x22')],'online':this['online'],'voiceStatus':this[_0x92eb('0x13')],'voiceStatusTime':this[_0x92eb('0x14')],'voiceStatusCallerIdNumber':this[_0x92eb('0x15')],'voiceStatusQueue':this[_0x92eb('0x23')],'interface':this['interface'],'onhold':this['onhold']};var _0xda511f=md5(JSON[_0x92eb('0x24')](_0x453c2d));if(this[_0x92eb('0x2')]!==_0xda511f){this[_0x92eb('0x2')]=_0xda511f;io['to'](util[_0x92eb('0x21')]('user:%s',_0x453c2d[_0x92eb('0x8')]))[_0x92eb('0x25')]('user:save',_0x453c2d);}};module[_0x92eb('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 76fe99c..73dfa06 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 _0xf1f5=['dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry'];(function(_0x4dda59,_0x427407){var _0x4b4ba2=function(_0x13e535){while(--_0x13e535){_0x4dda59['push'](_0x4dda59['shift']());}};_0x4b4ba2(++_0x427407);}(_0xf1f5,0x180));var _0x5f1f=function(_0x45a881,_0x45ccbc){_0x45a881=_0x45a881-0x0;var _0x1009df=_0xf1f5[_0x45a881];return _0x1009df;};'use strict';function Campaign(_0x54a134){this['id']=_0x54a134['id']||0x0;this['name']=_0x54a134[_0x5f1f('0x0')]||'';this[_0x5f1f('0x1')]=_0x54a134[_0x5f1f('0x1')]||_0x5f1f('0x2');this[_0x5f1f('0x3')]=0x0;this[_0x5f1f('0x4')]=0x0;this[_0x5f1f('0x5')]=0x0;this[_0x5f1f('0x6')]=0x0;this[_0x5f1f('0x7')]='';this[_0x5f1f('0x8')]=!![];this[_0x5f1f('0x9')]=_0x54a134[_0x5f1f('0x9')];this[_0x5f1f('0xa')]=_0x54a134['limitCalls'];this['dialTimezone']=_0x54a134[_0x5f1f('0xb')]||null;this[_0x5f1f('0xc')]=_0x54a134[_0x5f1f('0xc')]?_0x54a134[_0x5f1f('0xc')]:null;this[_0x5f1f('0xd')]=_0x54a134[_0x5f1f('0xd')];this['dialOriginateCallerIdNumber']=_0x54a134['dialOriginateCallerIdNumber'];this[_0x5f1f('0xe')]=_0x54a134[_0x5f1f('0xe')]||0x1e;this[_0x5f1f('0xf')]=_0x54a134[_0x5f1f('0xf')];this['dialCongestionRetryFrequency']=_0x54a134[_0x5f1f('0x10')];this[_0x5f1f('0x11')]=_0x54a134[_0x5f1f('0x11')];this[_0x5f1f('0x12')]=_0x54a134[_0x5f1f('0x12')];this[_0x5f1f('0x13')]=_0x54a134[_0x5f1f('0x13')];this[_0x5f1f('0x14')]=_0x54a134[_0x5f1f('0x14')];this[_0x5f1f('0x15')]=_0x54a134[_0x5f1f('0x15')];this['dialNoSuchNumberMaxRetry']=_0x54a134['dialNoSuchNumberMaxRetry']||0x3;this[_0x5f1f('0x16')]=_0x54a134[_0x5f1f('0x16')]||0x96;this[_0x5f1f('0x17')]=_0x54a134[_0x5f1f('0x17')]||0x3;this[_0x5f1f('0x18')]=_0x54a134[_0x5f1f('0x18')]||0x96;this[_0x5f1f('0x19')]=_0x54a134['dialAbandonedMaxRetry']||0x3;this[_0x5f1f('0x1a')]=_0x54a134['dialAbandonedRetryFrequency']||0x96;this[_0x5f1f('0x1b')]=_0x54a134[_0x5f1f('0x1b')]||0x3;this[_0x5f1f('0x1c')]=_0x54a134[_0x5f1f('0x1c')]||0x96;this[_0x5f1f('0x1d')]=_0x54a134['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x54a134['dialAgentRejectRetryFrequency']||0x96;this[_0x5f1f('0x1e')]=_0x54a134[_0x5f1f('0x1e')]||_0x5f1f('0x1f');this[_0x5f1f('0x20')]=_0x54a134['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x54a134['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x5f1f('0x21')]=_0x54a134['dialCutDigit']||undefined;this[_0x5f1f('0x22')]=_0x54a134[_0x5f1f('0x22')]?_0x54a134[_0x5f1f('0x22')]:undefined;this[_0x5f1f('0x23')]=_0x54a134[_0x5f1f('0x23')]?_0x54a134[_0x5f1f('0x23')]:undefined;this[_0x5f1f('0x24')]=_0x54a134[_0x5f1f('0x24')]?_0x54a134[_0x5f1f('0x24')]:undefined;this[_0x5f1f('0x25')]=_0x54a134[_0x5f1f('0x25')]?_0x54a134[_0x5f1f('0x25')]:undefined;this[_0x5f1f('0x26')]=_0x54a134[_0x5f1f('0x25')]?_0x54a134['SquareProject'][_0x5f1f('0x0')]:undefined;this[_0x5f1f('0x27')]=_0x54a134[_0x5f1f('0x27')]||![];this['dialAMDInitialSilence']=_0x54a134[_0x5f1f('0x28')];this[_0x5f1f('0x29')]=_0x54a134['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x54a134[_0x5f1f('0x2a')];this[_0x5f1f('0x2b')]=_0x54a134[_0x5f1f('0x2b')];this[_0x5f1f('0x2c')]=_0x54a134[_0x5f1f('0x2c')];this[_0x5f1f('0x2d')]=_0x54a134[_0x5f1f('0x2d')];this[_0x5f1f('0x2e')]=_0x54a134[_0x5f1f('0x2e')];this[_0x5f1f('0x2f')]=_0x54a134[_0x5f1f('0x2f')];this[_0x5f1f('0x30')]=_0x54a134[_0x5f1f('0x30')];}module[_0x5f1f('0x31')]=Campaign; \ No newline at end of file +var _0x2b39=['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','originated','temp','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x5fc04b,_0x4e9503){var _0x3d5e75=function(_0x1daf4a){while(--_0x1daf4a){_0x5fc04b['push'](_0x5fc04b['shift']());}};_0x3d5e75(++_0x4e9503);}(_0x2b39,0x11c));var _0x92b3=function(_0x1b281b,_0x369210){_0x1b281b=_0x1b281b-0x0;var _0x59aa59=_0x2b39[_0x1b281b];return _0x59aa59;};'use strict';function Campaign(_0x316335){this['id']=_0x316335['id']||0x0;this[_0x92b3('0x0')]=_0x316335[_0x92b3('0x0')]||'';this[_0x92b3('0x1')]=_0x316335[_0x92b3('0x1')]||'campaign';this[_0x92b3('0x2')]=0x0;this[_0x92b3('0x3')]=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x92b3('0x4')]=0x0;this[_0x92b3('0x5')]='';this[_0x92b3('0x6')]=!![];this[_0x92b3('0x7')]=_0x316335[_0x92b3('0x7')];this[_0x92b3('0x8')]=_0x316335[_0x92b3('0x8')];this[_0x92b3('0x9')]=_0x316335[_0x92b3('0x9')]||null;this[_0x92b3('0xa')]=_0x316335['dialGlobalInterval']?_0x316335[_0x92b3('0xa')]:null;this[_0x92b3('0xb')]=_0x316335[_0x92b3('0xb')];this[_0x92b3('0xc')]=_0x316335[_0x92b3('0xc')];this[_0x92b3('0xd')]=_0x316335[_0x92b3('0xd')]||0x1e;this[_0x92b3('0xe')]=_0x316335[_0x92b3('0xe')];this[_0x92b3('0xf')]=_0x316335[_0x92b3('0xf')];this[_0x92b3('0x10')]=_0x316335['dialBusyMaxRetry'];this[_0x92b3('0x11')]=_0x316335[_0x92b3('0x11')];this[_0x92b3('0x12')]=_0x316335['dialNoAnswerMaxRetry'];this[_0x92b3('0x13')]=_0x316335[_0x92b3('0x13')];this[_0x92b3('0x14')]=_0x316335[_0x92b3('0x14')];this[_0x92b3('0x15')]=_0x316335[_0x92b3('0x15')]||0x3;this[_0x92b3('0x16')]=_0x316335['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x316335[_0x92b3('0x17')]||0x3;this[_0x92b3('0x18')]=_0x316335['dialDropRetryFrequency']||0x96;this[_0x92b3('0x19')]=_0x316335[_0x92b3('0x19')]||0x3;this[_0x92b3('0x1a')]=_0x316335[_0x92b3('0x1a')]||0x96;this[_0x92b3('0x1b')]=_0x316335[_0x92b3('0x1b')]||0x3;this[_0x92b3('0x1c')]=_0x316335[_0x92b3('0x1c')]||0x96;this['dialAgentRejectMaxRetry']=_0x316335[_0x92b3('0x1d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x316335[_0x92b3('0x1e')]||0x96;this[_0x92b3('0x1f')]=_0x316335[_0x92b3('0x1f')]||_0x92b3('0x20');this[_0x92b3('0x21')]=_0x316335[_0x92b3('0x21')]||undefined;this[_0x92b3('0x22')]=_0x316335[_0x92b3('0x22')]||undefined;this[_0x92b3('0x23')]=_0x316335[_0x92b3('0x23')]||undefined;this['TrunkBackup']=_0x316335[_0x92b3('0x24')]?_0x316335['TrunkBackup']:undefined;this['Trunk']=_0x316335['Trunk']?_0x316335[_0x92b3('0x25')]:undefined;this[_0x92b3('0x26')]=_0x316335[_0x92b3('0x26')]?_0x316335[_0x92b3('0x26')]:undefined;this[_0x92b3('0x27')]=_0x316335[_0x92b3('0x27')]?_0x316335['SquareProject']:undefined;this['dialQueueProject']=_0x316335['SquareProject']?_0x316335[_0x92b3('0x27')][_0x92b3('0x0')]:undefined;this[_0x92b3('0x28')]=_0x316335['dialAMDActive']||![];this[_0x92b3('0x29')]=_0x316335[_0x92b3('0x29')];this[_0x92b3('0x2a')]=_0x316335['dialAMDGreeting'];this[_0x92b3('0x2b')]=_0x316335[_0x92b3('0x2b')];this[_0x92b3('0x2c')]=_0x316335[_0x92b3('0x2c')];this[_0x92b3('0x2d')]=_0x316335[_0x92b3('0x2d')];this[_0x92b3('0x2e')]=_0x316335[_0x92b3('0x2e')];this[_0x92b3('0x2f')]=_0x316335[_0x92b3('0x2f')];this[_0x92b3('0x30')]=_0x316335[_0x92b3('0x30')];this[_0x92b3('0x31')]=_0x316335[_0x92b3('0x31')];}module[_0x92b3('0x32')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 17abfcd..6267b1e 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 _0x01b5=['lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','uniqueid','linkedid','answered','answertime','endtime','abandoned'];(function(_0x228e3d,_0x280db9){var _0x353dc9=function(_0x1da81b){while(--_0x1da81b){_0x228e3d['push'](_0x228e3d['shift']());}};_0x353dc9(++_0x280db9);}(_0x01b5,0xca));var _0x501b=function(_0x3a8c8f,_0x567295){_0x3a8c8f=_0x3a8c8f-0x0;var _0x4d8b4a=_0x01b5[_0x3a8c8f];return _0x4d8b4a;};'use strict';function Channel(){this[_0x501b('0x0')]=null;this[_0x501b('0x1')]='';this[_0x501b('0x2')]='';this[_0x501b('0x3')]=0x0;this[_0x501b('0x4')]='';this[_0x501b('0x5')]=undefined;this['connectedlinename']=undefined;this[_0x501b('0x6')]=0x0;this[_0x501b('0x7')]='';this[_0x501b('0x8')]=0x0;this[_0x501b('0x9')]=0x0;this['exten']=0x0;this[_0x501b('0xa')]=![];this[_0x501b('0xb')]=null;this[_0x501b('0xc')]=null;this['unmanaged']=![];this[_0x501b('0xd')]=![];this[_0x501b('0xe')]='';this[_0x501b('0xf')]='';this['duration']=0x0;this[_0x501b('0x10')]=0x0;this[_0x501b('0x11')]=0x0;this[_0x501b('0x12')]=null;this[_0x501b('0x13')]=null;this[_0x501b('0x14')]=null;this[_0x501b('0x15')]=![];this[_0x501b('0x16')]=null;this[_0x501b('0x17')]=null;this[_0x501b('0x18')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x501b('0x19')]=0x0;}module[_0x501b('0x1a')]=Channel; \ No newline at end of file +var _0x58ea=['lastdata','duration','billableseconds','holdtime','type','tag','disposition','queue','monitors','transfercalleridnum','mohtime','starttime','destinationchannel','connectedlinenum','connectedlinename','context','exten','answertime','endtime','unmanaged','abandoned','lastapplication'];(function(_0x10586b,_0x3fdebd){var _0x20f3d0=function(_0x1847e0){while(--_0x1847e0){_0x10586b['push'](_0x10586b['shift']());}};_0x20f3d0(++_0x3fdebd);}(_0x58ea,0xe7));var _0xa58e=function(_0x7cbc97,_0x233b6f){_0x7cbc97=_0x7cbc97-0x0;var _0x20628d=_0x58ea[_0x7cbc97];return _0x20628d;};'use strict';function Channel(){this[_0xa58e('0x0')]=null;this['channel']='';this[_0xa58e('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0xa58e('0x2')]=undefined;this[_0xa58e('0x3')]=undefined;this['accountcode']=0x0;this[_0xa58e('0x4')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xa58e('0x5')]=0x0;this['answered']=![];this[_0xa58e('0x6')]=null;this[_0xa58e('0x7')]=null;this[_0xa58e('0x8')]=![];this[_0xa58e('0x9')]=![];this[_0xa58e('0xa')]='';this[_0xa58e('0xb')]='';this[_0xa58e('0xc')]=0x0;this[_0xa58e('0xd')]=0x0;this[_0xa58e('0xe')]=0x0;this[_0xa58e('0xf')]=null;this[_0xa58e('0x10')]=null;this[_0xa58e('0x11')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0xa58e('0x12')]=null;this[_0xa58e('0x13')]=[];this[_0xa58e('0x14')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xa58e('0x15')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index f2c9334..067aa4d 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 _0x522b=['consumerKey','consumerSecret','token','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x31f01f,_0x1f1b13){var _0x1d4f34=function(_0x2c88c4){while(--_0x2c88c4){_0x31f01f['push'](_0x31f01f['shift']());}};_0x1d4f34(++_0x1f1b13);}(_0x522b,0x1c3));var _0xb522=function(_0x54c10d,_0x2f2251){_0x54c10d=_0x54c10d-0x0;var _0x1fa703=_0x522b[_0x54c10d];return _0x1fa703;};'use strict';function DeskAccount(_0x5dc096){this['id']=_0x5dc096['id']||0x0;this[_0xb522('0x0')]=_0x5dc096['name']||'';this[_0xb522('0x1')]=_0x5dc096['username']||'';this['remoteUri']=_0x5dc096[_0xb522('0x2')]||'';this[_0xb522('0x3')]=_0x5dc096['authType']||'';this[_0xb522('0x4')]=_0x5dc096[_0xb522('0x4')]||'';this[_0xb522('0x5')]=_0x5dc096[_0xb522('0x5')]||'';this[_0xb522('0x6')]=_0x5dc096['consumerSecret']||'';this[_0xb522('0x7')]=_0x5dc096[_0xb522('0x7')]||'';this['tokenSecret']=_0x5dc096['tokenSecret']||'';this[_0xb522('0x8')]=_0x5dc096['type']||'';this[_0xb522('0x9')]=_0x5dc096[_0xb522('0x9')]||'';this['Configurations']=_0x5dc096[_0xb522('0xa')]||{};}module[_0xb522('0xb')]=DeskAccount; \ No newline at end of file +var _0x7c8e=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x46f7f0,_0x4ef418){_0x46f7f0=_0x46f7f0-0x0;var _0x783786=_0x7c8e[_0x46f7f0];return _0x783786;};'use strict';function DeskAccount(_0x3aa870){this['id']=_0x3aa870['id']||0x0;this[_0xe7c8('0x0')]=_0x3aa870[_0xe7c8('0x0')]||'';this[_0xe7c8('0x1')]=_0x3aa870[_0xe7c8('0x1')]||'';this[_0xe7c8('0x2')]=_0x3aa870[_0xe7c8('0x2')]||'';this[_0xe7c8('0x3')]=_0x3aa870[_0xe7c8('0x3')]||'';this[_0xe7c8('0x4')]=_0x3aa870[_0xe7c8('0x4')]||'';this[_0xe7c8('0x5')]=_0x3aa870[_0xe7c8('0x5')]||'';this[_0xe7c8('0x6')]=_0x3aa870[_0xe7c8('0x6')]||'';this[_0xe7c8('0x7')]=_0x3aa870[_0xe7c8('0x7')]||'';this[_0xe7c8('0x8')]=_0x3aa870[_0xe7c8('0x8')]||'';this['type']=_0x3aa870[_0xe7c8('0x9')]||'';this[_0xe7c8('0xa')]=_0x3aa870[_0xe7c8('0xa')]||'';this['Configurations']=_0x3aa870[_0xe7c8('0xb')]||{};}module[_0xe7c8('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 45fae73..0cf8e41 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 _0x02b9=['remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password'];(function(_0x449b81,_0x4b2a6f){var _0xb9b60c=function(_0x2e9e0a){while(--_0x2e9e0a){_0x449b81['push'](_0x449b81['shift']());}};_0xb9b60c(++_0x4b2a6f);}(_0x02b9,0xc3));var _0x902b=function(_0xb59849,_0x565354){_0xb59849=_0xb59849-0x0;var _0x56c7bb=_0x02b9[_0xb59849];return _0x56c7bb;};'use strict';function Dynamics365Account(_0x23b10f){this['id']=_0x23b10f['id']||0x0;this[_0x902b('0x0')]=_0x23b10f[_0x902b('0x0')]||'';this[_0x902b('0x1')]=_0x23b10f['username']||'';this[_0x902b('0x2')]=_0x23b10f[_0x902b('0x2')]||'';this[_0x902b('0x3')]=_0x23b10f['remoteUri']||'';this[_0x902b('0x4')]=_0x23b10f[_0x902b('0x4')]||'';this[_0x902b('0x5')]=_0x23b10f[_0x902b('0x5')]||'';this[_0x902b('0x6')]=_0x23b10f[_0x902b('0x6')]||{};this[_0x902b('0x7')]=_0x23b10f[_0x902b('0x7')]||'';this[_0x902b('0x8')]=_0x23b10f[_0x902b('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x1fec=['Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0x5d8453,_0x199108){var _0x288c2e=function(_0x396426){while(--_0x396426){_0x5d8453['push'](_0x5d8453['shift']());}};_0x288c2e(++_0x199108);}(_0x1fec,0x66));var _0xc1fe=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1fec[_0x2f5ac5];return _0x37c9a8;};'use strict';function Dynamics365Account(_0x4d0206){this['id']=_0x4d0206['id']||0x0;this[_0xc1fe('0x0')]=_0x4d0206[_0xc1fe('0x0')]||'';this[_0xc1fe('0x1')]=_0x4d0206[_0xc1fe('0x1')]||'';this[_0xc1fe('0x2')]=_0x4d0206[_0xc1fe('0x2')]||'';this['remoteUri']=_0x4d0206[_0xc1fe('0x3')]||'';this['tenantId']=_0x4d0206[_0xc1fe('0x4')]||'';this[_0xc1fe('0x5')]=_0x4d0206[_0xc1fe('0x5')]||'';this[_0xc1fe('0x6')]=_0x4d0206[_0xc1fe('0x6')]||{};this[_0xc1fe('0x7')]=_0x4d0206[_0xc1fe('0x7')]||'';this[_0xc1fe('0x8')]=_0x4d0206[_0xc1fe('0x8')]||{};}module[_0xc1fe('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 61aade0..7d7cb1d 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 _0x0b44=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b44,0xe2));var _0x40b4=function(_0x48d9ca,_0x43f3d5){_0x48d9ca=_0x48d9ca-0x0;var _0xa23180=_0x0b44[_0x48d9ca];return _0xa23180;};'use strict';function FaxAccount(_0x22f0df){this['id']=_0x22f0df['id']||0x0;this[_0x40b4('0x0')]=_0x22f0df['name']||'';this[_0x40b4('0x1')]=_0x22f0df[_0x40b4('0x1')];this[_0x40b4('0x2')]=_0x22f0df['ecm'];this[_0x40b4('0x3')]=_0x22f0df['headerinfo'];this[_0x40b4('0x4')]=_0x22f0df[_0x40b4('0x4')];this[_0x40b4('0x5')]=_0x22f0df[_0x40b4('0x5')]||0x960;this['maxrate']=_0x22f0df['maxrate']||0x3840;this[_0x40b4('0x6')]=_0x22f0df[_0x40b4('0x6')]||_0x40b4('0x7');this[_0x40b4('0x8')]=_0x22f0df[_0x40b4('0x8')]||'no';this[_0x40b4('0x9')]=_0x22f0df[_0x40b4('0x9')]||'no';this['t38timeout']=_0x22f0df[_0x40b4('0xa')]||0x1388;this['tech']=_0x22f0df[_0x40b4('0xb')]||_0x40b4('0xc');this[_0x40b4('0xd')]=_0x22f0df[_0x40b4('0xd')]?_0x22f0df[_0x40b4('0xd')]:undefined;this[_0x40b4('0xe')]=_0x22f0df[_0x40b4('0xe')];this[_0x40b4('0xf')]=_0x22f0df[_0x40b4('0xf')];}module[_0x40b4('0x10')]=FaxAccount; \ No newline at end of file +var _0xba6f=['SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','faxdetect','t38timeout','tech'];(function(_0x36a5b3,_0x5ae569){var _0x2d851c=function(_0x5e9cb2){while(--_0x5e9cb2){_0x36a5b3['push'](_0x36a5b3['shift']());}};_0x2d851c(++_0x5ae569);}(_0xba6f,0x1d0));var _0xfba6=function(_0x185133,_0x29a472){_0x185133=_0x185133-0x0;var _0x862f7f=_0xba6f[_0x185133];return _0x862f7f;};'use strict';function FaxAccount(_0x59c9be){this['id']=_0x59c9be['id']||0x0;this['name']=_0x59c9be[_0xfba6('0x0')]||'';this[_0xfba6('0x1')]=_0x59c9be[_0xfba6('0x1')];this[_0xfba6('0x2')]=_0x59c9be[_0xfba6('0x2')];this[_0xfba6('0x3')]=_0x59c9be[_0xfba6('0x3')];this[_0xfba6('0x4')]=_0x59c9be[_0xfba6('0x4')];this[_0xfba6('0x5')]=_0x59c9be[_0xfba6('0x5')]||0x960;this[_0xfba6('0x6')]=_0x59c9be[_0xfba6('0x6')]||0x3840;this['modem']=_0x59c9be[_0xfba6('0x7')]||_0xfba6('0x8');this['gateway']=_0x59c9be['gateway']||'no';this['faxdetect']=_0x59c9be[_0xfba6('0x9')]||'no';this[_0xfba6('0xa')]=_0x59c9be[_0xfba6('0xa')]||0x1388;this[_0xfba6('0xb')]=_0x59c9be[_0xfba6('0xb')]||_0xfba6('0xc');this[_0xfba6('0xd')]=_0x59c9be[_0xfba6('0xd')]?_0x59c9be[_0xfba6('0xd')]:undefined;this[_0xfba6('0xe')]=_0x59c9be[_0xfba6('0xe')];this['key']=_0x59c9be[_0xfba6('0xf')];}module[_0xfba6('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 ad1f204..8b6191c 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 _0x4de4=['name','username','apiKey','remoteUri','serverUrl'];(function(_0x29fbc1,_0x1aedef){var _0x457181=function(_0xd7520d){while(--_0xd7520d){_0x29fbc1['push'](_0x29fbc1['shift']());}};_0x457181(++_0x1aedef);}(_0x4de4,0x136));var _0x44de=function(_0x42408c,_0x15b22f){_0x42408c=_0x42408c-0x0;var _0x1f18a4=_0x4de4[_0x42408c];return _0x1f18a4;};'use strict';function FreshdeskAccount(_0x34bf8a){this['id']=_0x34bf8a['id']||0x0;this[_0x44de('0x0')]=_0x34bf8a[_0x44de('0x0')]||'';this[_0x44de('0x1')]=_0x34bf8a[_0x44de('0x1')]||'';this[_0x44de('0x2')]=_0x34bf8a['token']||'';this[_0x44de('0x3')]=_0x34bf8a[_0x44de('0x3')]||'';this['serverUrl']=_0x34bf8a[_0x44de('0x4')]||'';this['Configurations']=_0x34bf8a['Configurations']||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xe34d=['Configurations','exports','name','apiKey','token','remoteUri','serverUrl'];(function(_0x3b4515,_0x319930){var _0x22c8e7=function(_0x36091d){while(--_0x36091d){_0x3b4515['push'](_0x3b4515['shift']());}};_0x22c8e7(++_0x319930);}(_0xe34d,0x1bb));var _0xde34=function(_0x3dfbed,_0x41c02b){_0x3dfbed=_0x3dfbed-0x0;var _0x18f5a3=_0xe34d[_0x3dfbed];return _0x18f5a3;};'use strict';function FreshdeskAccount(_0x1af682){this['id']=_0x1af682['id']||0x0;this['name']=_0x1af682[_0xde34('0x0')]||'';this['username']=_0x1af682['username']||'';this[_0xde34('0x1')]=_0x1af682[_0xde34('0x2')]||'';this['remoteUri']=_0x1af682[_0xde34('0x3')]||'';this[_0xde34('0x4')]=_0x1af682[_0xde34('0x4')]||'';this['Configurations']=_0x1af682[_0xde34('0x5')]||{};}module[_0xde34('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 3e3526c..f76a4a3 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 _0xebc0=['Configurations','exports','name','username','remoteUri'];(function(_0xf8cf60,_0x21cbed){var _0x541b89=function(_0x32f4fc){while(--_0x32f4fc){_0xf8cf60['push'](_0xf8cf60['shift']());}};_0x541b89(++_0x21cbed);}(_0xebc0,0xbb));var _0x0ebc=function(_0x115dc5,_0x4c1e6d){_0x115dc5=_0x115dc5-0x0;var _0x42b2b3=_0xebc0[_0x115dc5];return _0x42b2b3;};'use strict';function FreshsalesAccount(_0x5b3bfb){this['id']=_0x5b3bfb['id']||0x0;this[_0x0ebc('0x0')]=_0x5b3bfb[_0x0ebc('0x0')]||'';this[_0x0ebc('0x1')]=_0x5b3bfb[_0x0ebc('0x1')]||'';this['apiKey']=_0x5b3bfb['token']||'';this[_0x0ebc('0x2')]=_0x5b3bfb['remoteUri']||'';this['serverUrl']=_0x5b3bfb['serverUrl']||'';this[_0x0ebc('0x3')]=_0x5b3bfb['Configurations']||{};}module[_0x0ebc('0x4')]=FreshsalesAccount; \ No newline at end of file +var _0xcccb=['name','username','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xcccb,0x70));var _0xbccc=function(_0x468f16,_0x5c8555){_0x468f16=_0x468f16-0x0;var _0x4a0872=_0xcccb[_0x468f16];return _0x4a0872;};'use strict';function FreshsalesAccount(_0x26c2d4){this['id']=_0x26c2d4['id']||0x0;this[_0xbccc('0x0')]=_0x26c2d4[_0xbccc('0x0')]||'';this[_0xbccc('0x1')]=_0x26c2d4[_0xbccc('0x1')]||'';this['apiKey']=_0x26c2d4[_0xbccc('0x2')]||'';this[_0xbccc('0x3')]=_0x26c2d4[_0xbccc('0x3')]||'';this[_0xbccc('0x4')]=_0x26c2d4[_0xbccc('0x4')]||'';this[_0xbccc('0x5')]=_0x26c2d4[_0xbccc('0x5')]||{};}module[_0xbccc('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 9160998..91a1fce 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 _0xb716=['holdtime','assigned','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','priority'];(function(_0x214266,_0x1f6f52){var _0x568f75=function(_0x541904){while(--_0x541904){_0x214266['push'](_0x214266['shift']());}};_0x568f75(++_0x1f6f52);}(_0xb716,0x1c7));var _0x6b71=function(_0x52402e,_0x4e1a93){_0x52402e=_0x52402e-0x0;var _0x262182=_0xb716[_0x52402e];return _0x262182;};'use strict';function QueueReport(){this[_0x6b71('0x0')]=_0x6b71('0x1');this[_0x6b71('0x2')]='';this[_0x6b71('0x3')]='';this[_0x6b71('0x4')]='';this[_0x6b71('0x5')]='';this['queuecallerjoinAt']=null;this[_0x6b71('0x6')]=null;this[_0x6b71('0x7')]=0x1;this[_0x6b71('0x8')]=0x1;this[_0x6b71('0x9')]=![];this[_0x6b71('0xa')]=null;this[_0x6b71('0xb')]=![];this['queuecallercompleteAt']=null;this[_0x6b71('0xc')]=![];this[_0x6b71('0xd')]=null;this[_0x6b71('0xe')]=0x1;this[_0x6b71('0xf')]='';this[_0x6b71('0x10')]='';this['connectedlinename']='';this[_0x6b71('0x11')]='';this[_0x6b71('0x12')]='';this['exten']='';this[_0x6b71('0x13')]='';this[_0x6b71('0x14')]=0x0;this[_0x6b71('0x15')]=![];this['lastAssignedTo']='';this[_0x6b71('0x16')]=0x0;this[_0x6b71('0x17')]={};}module[_0x6b71('0x18')]=QueueReport; \ No newline at end of file +var _0x47a1=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinename','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','inbound','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandon'];(function(_0x1008d5,_0x5e4e5a){var _0x1d1746=function(_0x26f3c4){while(--_0x26f3c4){_0x1008d5['push'](_0x1008d5['shift']());}};_0x1d1746(++_0x5e4e5a);}(_0x47a1,0x179));var _0x147a=function(_0x140075,_0x4bed72){_0x140075=_0x140075-0x0;var _0x20035a=_0x47a1[_0x140075];return _0x20035a;};'use strict';function QueueReport(){this['type']=_0x147a('0x0');this[_0x147a('0x1')]='';this['calleridnum']='';this[_0x147a('0x2')]='';this['queue']='';this[_0x147a('0x3')]=null;this[_0x147a('0x4')]=null;this['position']=0x1;this[_0x147a('0x5')]=0x1;this[_0x147a('0x6')]=![];this[_0x147a('0x7')]=null;this[_0x147a('0x8')]=![];this[_0x147a('0x9')]=null;this['queuecallerexit']=![];this[_0x147a('0xa')]=null;this[_0x147a('0xb')]=0x1;this[_0x147a('0xc')]='';this['connectedlinenum']='';this[_0x147a('0xd')]='';this[_0x147a('0xe')]='';this[_0x147a('0xf')]='';this[_0x147a('0x10')]='';this[_0x147a('0x11')]='';this[_0x147a('0x12')]=0x0;this[_0x147a('0x13')]=![];this[_0x147a('0x14')]='';this[_0x147a('0x15')]=0x0;this[_0x147a('0x16')]={};}module[_0x147a('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 20d2c65..0799166 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 _0x1a8b=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','integrationTab','serverUrl'];(function(_0x564e08,_0x401fb5){var _0x38ffcc=function(_0x240a14){while(--_0x240a14){_0x564e08['push'](_0x564e08['shift']());}};_0x38ffcc(++_0x401fb5);}(_0x1a8b,0xbd));var _0xb1a8=function(_0x3de414,_0x2eb598){_0x3de414=_0x3de414-0x0;var _0x401fb5=_0x1a8b[_0x3de414];return _0x401fb5;};'use strict';function SalesforceAccount(_0x2a9fdf){this['id']=_0x2a9fdf['id']||0x0;this['name']=_0x2a9fdf[_0xb1a8('0x0')]||'';this['username']=_0x2a9fdf[_0xb1a8('0x1')]||'';this[_0xb1a8('0x2')]=_0x2a9fdf[_0xb1a8('0x2')]||'';this[_0xb1a8('0x3')]=_0x2a9fdf[_0xb1a8('0x3')]||'';this[_0xb1a8('0x4')]=_0x2a9fdf[_0xb1a8('0x4')]||'';this['clientSecret']=_0x2a9fdf[_0xb1a8('0x5')]||'';this[_0xb1a8('0x6')]=_0x2a9fdf[_0xb1a8('0x6')]||'';this['type']=_0x2a9fdf['type']||_0xb1a8('0x7');this[_0xb1a8('0x8')]=_0x2a9fdf[_0xb1a8('0x8')]||'';this[_0xb1a8('0x9')]=_0x2a9fdf[_0xb1a8('0x9')]||{};}module[_0xb1a8('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xa772=['securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x439ae5,_0x1ef09d){var _0x339f87=function(_0x24b9e6){while(--_0x24b9e6){_0x439ae5['push'](_0x439ae5['shift']());}};_0x339f87(++_0x1ef09d);}(_0xa772,0x1b2));var _0x2a77=function(_0x6f041d,_0x4029b4){_0x6f041d=_0x6f041d-0x0;var _0x4609b8=_0xa772[_0x6f041d];return _0x4609b8;};'use strict';function SalesforceAccount(_0x3c12f2){this['id']=_0x3c12f2['id']||0x0;this[_0x2a77('0x0')]=_0x3c12f2[_0x2a77('0x0')]||'';this[_0x2a77('0x1')]=_0x3c12f2[_0x2a77('0x1')]||'';this[_0x2a77('0x2')]=_0x3c12f2[_0x2a77('0x2')]||'';this[_0x2a77('0x3')]=_0x3c12f2['password']||'';this[_0x2a77('0x4')]=_0x3c12f2[_0x2a77('0x4')]||'';this[_0x2a77('0x5')]=_0x3c12f2['clientSecret']||'';this[_0x2a77('0x6')]=_0x3c12f2[_0x2a77('0x6')]||'';this[_0x2a77('0x7')]=_0x3c12f2['type']||'integrationTab';this[_0x2a77('0x8')]=_0x3c12f2[_0x2a77('0x8')]||'';this[_0x2a77('0x9')]=_0x3c12f2[_0x2a77('0x9')]||{};}module[_0x2a77('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 fd42133..3e77965 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 _0x1a9d=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xdd55d4,_0x43d097){var _0x281da4=function(_0x5ec373){while(--_0x5ec373){_0xdd55d4['push'](_0xdd55d4['shift']());}};_0x281da4(++_0x43d097);}(_0x1a9d,0x158));var _0xd1a9=function(_0x18c0c9,_0x3eb495){_0x18c0c9=_0x18c0c9-0x0;var _0x1de608=_0x1a9d[_0x18c0c9];return _0x1de608;};'use strict';function ServicenowAccount(_0x172bdc){this['id']=_0x172bdc['id']||0x0;this[_0xd1a9('0x0')]=_0x172bdc[_0xd1a9('0x0')]||'';this[_0xd1a9('0x1')]=_0x172bdc[_0xd1a9('0x1')]||'';this[_0xd1a9('0x2')]=_0x172bdc[_0xd1a9('0x2')]||'';this[_0xd1a9('0x3')]=_0x172bdc[_0xd1a9('0x3')]||'';this[_0xd1a9('0x4')]=_0x172bdc['serverUrl']||'';this[_0xd1a9('0x5')]=_0x172bdc[_0xd1a9('0x5')]||{};}module[_0xd1a9('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x7647=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0x7647,0x95));var _0x7764=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x7647[_0x19950b];return _0x3c6b41;};'use strict';function ServicenowAccount(_0x27d17c){this['id']=_0x27d17c['id']||0x0;this[_0x7764('0x0')]=_0x27d17c[_0x7764('0x0')]||'';this[_0x7764('0x1')]=_0x27d17c[_0x7764('0x1')]||'';this['password']=_0x27d17c[_0x7764('0x2')]||'';this[_0x7764('0x3')]=_0x27d17c[_0x7764('0x3')]||'';this[_0x7764('0x4')]=_0x27d17c[_0x7764('0x4')]||'';this[_0x7764('0x5')]=_0x27d17c[_0x7764('0x5')]||{};}module[_0x7764('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 6e5bcef..5ffc23a 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 _0x630e=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x630e,0x16b));var _0xe630=function(_0x146fab,_0xb5e429){_0x146fab=_0x146fab-0x0;var _0xa4c348=_0x630e[_0x146fab];return _0xa4c348;};'use strict';function SugarcrmAccount(_0x1f66a6){this['id']=_0x1f66a6['id']||0x0;this[_0xe630('0x0')]=_0x1f66a6[_0xe630('0x0')]||'';this[_0xe630('0x1')]=_0x1f66a6[_0xe630('0x1')]||'';this[_0xe630('0x2')]=_0x1f66a6[_0xe630('0x2')]||'';this[_0xe630('0x3')]=_0x1f66a6[_0xe630('0x3')]||'';this[_0xe630('0x4')]=_0x1f66a6[_0xe630('0x4')]||'';this[_0xe630('0x5')]=_0x1f66a6['Configurations']||{};}module[_0xe630('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x8866=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x4346cf,_0x5bee50){var _0x36beac=function(_0x129373){while(--_0x129373){_0x4346cf['push'](_0x4346cf['shift']());}};_0x36beac(++_0x5bee50);}(_0x8866,0x95));var _0x6886=function(_0x5c135e,_0x44f70a){_0x5c135e=_0x5c135e-0x0;var _0x3011d5=_0x8866[_0x5c135e];return _0x3011d5;};'use strict';function SugarcrmAccount(_0xc5f6e3){this['id']=_0xc5f6e3['id']||0x0;this[_0x6886('0x0')]=_0xc5f6e3['name']||'';this[_0x6886('0x1')]=_0xc5f6e3['username']||'';this[_0x6886('0x2')]=_0xc5f6e3[_0x6886('0x2')]||'';this[_0x6886('0x3')]=_0xc5f6e3[_0x6886('0x3')]||'';this[_0x6886('0x4')]=_0xc5f6e3[_0x6886('0x4')]||'';this[_0x6886('0x5')]=_0xc5f6e3['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 073ae71..6978b81 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 _0x6eb6=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x4e98a1,_0x35f726){var _0x1ab040=function(_0x32df55){while(--_0x32df55){_0x4e98a1['push'](_0x4e98a1['shift']());}};_0x1ab040(++_0x35f726);}(_0x6eb6,0x198));var _0x66eb=function(_0x1c0321,_0x4c10bd){_0x1c0321=_0x1c0321-0x0;var _0x285b02=_0x6eb6[_0x1c0321];return _0x285b02;};'use strict';function Telephone(_0x3c9449){this['id']=_0x3c9449['id']||0x0;this[_0x66eb('0x0')]=_0x3c9449['name']||'';this[_0x66eb('0x1')]=_0x3c9449[_0x66eb('0x1')]||'';this[_0x66eb('0x2')]=_0x66eb('0x3');this[_0x66eb('0x4')]=0x0;this[_0x66eb('0x5')]=_0x66eb('0x3');this[_0x66eb('0x6')]='';}module[_0x66eb('0x7')]=Telephone; \ No newline at end of file +var _0x8b58=['status','unknown','address','exports','name','accountcode','state'];(function(_0x4bab5b,_0x3a4a53){var _0x1be846=function(_0x3ef895){while(--_0x3ef895){_0x4bab5b['push'](_0x4bab5b['shift']());}};_0x1be846(++_0x3a4a53);}(_0x8b58,0x100));var _0x88b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b58[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x273f35){this['id']=_0x273f35['id']||0x0;this[_0x88b5('0x0')]=_0x273f35['name']||'';this['accountcode']=_0x273f35[_0x88b5('0x1')]||'';this[_0x88b5('0x2')]='unknown';this['stateTime']=0x0;this[_0x88b5('0x3')]=_0x88b5('0x4');this[_0x88b5('0x5')]='';}module[_0x88b5('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index d7eecbd..8a64342 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 _0x2cc4=['html','name'];(function(_0x392bbe,_0x25f137){var _0xe710af=function(_0x14ce29){while(--_0x14ce29){_0x392bbe['push'](_0x392bbe['shift']());}};_0xe710af(++_0x25f137);}(_0x2cc4,0xdd));var _0x42cc=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0x2cc4[_0x50a004];return _0x5e9992;};'use strict';function template(_0x1e3102){this['id']=_0x1e3102['id']||0x0;this[_0x42cc('0x0')]=_0x1e3102[_0x42cc('0x0')]||'';this[_0x42cc('0x1')]=_0x1e3102[_0x42cc('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xe10c=['name','html'];(function(_0x28705e,_0xb3b9ba){var _0x39064a=function(_0x652f4){while(--_0x652f4){_0x28705e['push'](_0x28705e['shift']());}};_0x39064a(++_0xb3b9ba);}(_0xe10c,0x1f0));var _0xce10=function(_0x4b2ed4,_0x570c3f){_0x4b2ed4=_0x4b2ed4-0x0;var _0x40a714=_0xe10c[_0x4b2ed4];return _0x40a714;};'use strict';function template(_0x562c9b){this['id']=_0x562c9b['id']||0x0;this[_0xce10('0x0')]=_0x562c9b['name']||'';this[_0xce10('0x1')]=_0x562c9b[_0xce10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index bc3d0ba..25745ac 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 _0x3e74=['Actions','name','channel','status','AllConditions','AnyConditions'];(function(_0x383cb7,_0x48d6bc){var _0x3391c6=function(_0xe3883d){while(--_0xe3883d){_0x383cb7['push'](_0x383cb7['shift']());}};_0x3391c6(++_0x48d6bc);}(_0x3e74,0x175));var _0x43e7=function(_0x505819,_0x130728){_0x505819=_0x505819-0x0;var _0xf82cb9=_0x3e74[_0x505819];return _0xf82cb9;};'use strict';function Trigger(_0x284ef8){this['id']=_0x284ef8['id']||0x0;this['name']=_0x284ef8[_0x43e7('0x0')]||'';this[_0x43e7('0x1')]=_0x284ef8[_0x43e7('0x1')]||'voice';this['status']=_0x284ef8[_0x43e7('0x2')]||![];this['AllConditions']=_0x284ef8[_0x43e7('0x3')]||[];this[_0x43e7('0x4')]=_0x284ef8[_0x43e7('0x4')]||[];this[_0x43e7('0x5')]=_0x284ef8[_0x43e7('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9957=['AnyConditions','Actions','exports','name','channel','voice','status','AllConditions'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';function Trigger(_0x202794){this['id']=_0x202794['id']||0x0;this[_0x7995('0x0')]=_0x202794[_0x7995('0x0')]||'';this[_0x7995('0x1')]=_0x202794['channel']||_0x7995('0x2');this[_0x7995('0x3')]=_0x202794[_0x7995('0x3')]||![];this[_0x7995('0x4')]=_0x202794['AllConditions']||[];this[_0x7995('0x5')]=_0x202794[_0x7995('0x5')]||[];this[_0x7995('0x6')]=_0x202794[_0x7995('0x6')]||[];}module[_0x7995('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index d9ebddc..cd636a9 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 _0x4a45=['address','exports','active','name','unknown','stateTime','status','registry','indexOf','port','domain','domainport','refresh','stateRegistry','registrationtime'];(function(_0x18f868,_0x48417c){var _0x330005=function(_0x293832){while(--_0x293832){_0x18f868['push'](_0x18f868['shift']());}};_0x330005(++_0x48417c);}(_0x4a45,0x6b));var _0x54a4=function(_0x51db56,_0x4bdcc6){_0x51db56=_0x51db56-0x0;var _0x1a2692=_0x4a45[_0x51db56];return _0x1a2692;};'use strict';function Trunk(_0x50f529){this['id']=_0x50f529['id']||0x0;this[_0x54a4('0x0')]=_0x50f529[_0x54a4('0x0')]||![];this[_0x54a4('0x1')]=_0x50f529[_0x54a4('0x1')]||'';this['state']=_0x54a4('0x2');this[_0x54a4('0x3')]=0x0;this[_0x54a4('0x4')]=_0x54a4('0x2');this[_0x54a4('0x5')]=_0x50f529['registry']&&_0x50f529[_0x54a4('0x5')][_0x54a4('0x6')](':')?_0x50f529[_0x54a4('0x5')]['split'](':')[0x0]:'';this['host']='';this[_0x54a4('0x7')]='';this[_0x54a4('0x8')]='';this[_0x54a4('0x9')]='';this[_0x54a4('0xa')]='';this[_0x54a4('0xb')]='unknown';this[_0x54a4('0xc')]='';this[_0x54a4('0xd')]='';}module[_0x54a4('0xe')]=Trunk; \ No newline at end of file +var _0xb3bf=['unknown','status','registry','indexOf','split','host','port','domainport','address','active','name','state'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xb3bf,0x135));var _0xfb3b=function(_0x482e4b,_0x30b54d){_0x482e4b=_0x482e4b-0x0;var _0x5a3901=_0xb3bf[_0x482e4b];return _0x5a3901;};'use strict';function Trunk(_0x3fdde1){this['id']=_0x3fdde1['id']||0x0;this[_0xfb3b('0x0')]=_0x3fdde1[_0xfb3b('0x0')]||![];this['name']=_0x3fdde1[_0xfb3b('0x1')]||'';this[_0xfb3b('0x2')]=_0xfb3b('0x3');this['stateTime']=0x0;this[_0xfb3b('0x4')]=_0xfb3b('0x3');this[_0xfb3b('0x5')]=_0x3fdde1[_0xfb3b('0x5')]&&_0x3fdde1[_0xfb3b('0x5')][_0xfb3b('0x6')](':')?_0x3fdde1[_0xfb3b('0x5')][_0xfb3b('0x7')](':')[0x0]:'';this[_0xfb3b('0x8')]='';this[_0xfb3b('0x9')]='';this['domain']='';this[_0xfb3b('0xa')]='';this['refresh']='';this['stateRegistry']='unknown';this['registrationtime']='';this[_0xfb3b('0xb')]='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 651adde..0d619fc 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 _0x8b94=['exten','recordingFormat','mandatoryDisposition'];(function(_0x1ce87a,_0x451e11){var _0x1945bc=function(_0x1306ec){while(--_0x1306ec){_0x1ce87a['push'](_0x1ce87a['shift']());}};_0x1945bc(++_0x451e11);}(_0x8b94,0x1bc));var _0x48b9=function(_0x101bca,_0x482978){_0x101bca=_0x101bca-0x0;var _0x56af92=_0x8b94[_0x101bca];return _0x56af92;};'use strict';function voiceExtension(_0x3c8c3c){this['id']=_0x3c8c3c['id']||0x0;this[_0x48b9('0x0')]=_0x3c8c3c['exten']||'';this[_0x48b9('0x1')]=_0x3c8c3c['recordingFormat']||'none';this[_0x48b9('0x2')]=_0x3c8c3c[_0x48b9('0x2')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x2766=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x2766,0x14d));var _0x6276=function(_0x5ea94c,_0x19937b){_0x5ea94c=_0x5ea94c-0x0;var _0xededd7=_0x2766[_0x5ea94c];return _0xededd7;};'use strict';function voiceExtension(_0x322048){this['id']=_0x322048['id']||0x0;this[_0x6276('0x0')]=_0x322048[_0x6276('0x0')]||'';this['recordingFormat']=_0x322048[_0x6276('0x1')]||_0x6276('0x2');this[_0x6276('0x3')]=_0x322048[_0x6276('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 42ba65d..ebe2af2 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 _0xd98d=['sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','unavailable','ringing','ringinuse','wav','gsm','roundrobin','name','monitor_format','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','abandoned','available','acw','acwTimeout','autopause'];(function(_0x3c6913,_0x3c067d){var _0x15b6a2=function(_0x47e6a8){while(--_0x47e6a8){_0x3c6913['push'](_0x3c6913['shift']());}};_0x15b6a2(++_0x3c067d);}(_0xd98d,0x1a4));var _0xdd98=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd98d[_0x3dd15e];return _0x231fd0;};'use strict';var statusDesc=[_0xdd98('0x0'),_0xdd98('0x1'),_0xdd98('0x2'),_0xdd98('0x3'),'invalid',_0xdd98('0x4'),_0xdd98('0x5'),_0xdd98('0x6'),'onhold'];var monitorFormat={'wav':_0xdd98('0x7'),'wav49':'wav49','gsm':_0xdd98('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xdd98('0x9')};function VoiceQueue(_0x193582){this['id']=_0x193582['id']||0x0;this[_0xdd98('0xa')]=_0x193582['name']||'';this[_0xdd98('0xb')]=_0x193582[_0xdd98('0xb')]||'';this['type']=_0x193582['type']||_0xdd98('0xc');this[_0xdd98('0xd')]=0x0;this[_0xdd98('0xe')]=0x0;this[_0xdd98('0xf')]=0x0;this['answered']=0x0;this[_0xdd98('0x10')]=0x0;this[_0xdd98('0x11')]=0x0;this[_0xdd98('0x12')]=0x0;this['unmanaged']=0x0;this[_0xdd98('0x13')]=0x0;this['loggedIn']=0x0;this[_0xdd98('0x14')]=0x0;this['acw']=_0x193582[_0xdd98('0x15')]||![];this[_0xdd98('0x16')]=_0x193582['acwTimeout']||0xa;this[_0xdd98('0x17')]=_0x193582[_0xdd98('0x17')]||'no';this[_0xdd98('0x18')]=!![];this[_0xdd98('0x19')]='';this['originated']=0x0;this[_0xdd98('0x1a')]=0x0;this[_0xdd98('0x1b')]=_0x193582[_0xdd98('0x1b')]||null;this[_0xdd98('0x1c')]=_0x193582[_0xdd98('0x1c')]?_0x193582[_0xdd98('0x1c')]:null;this[_0xdd98('0x1d')]=_0x193582[_0xdd98('0x1d')];this[_0xdd98('0x1e')]=_0x193582[_0xdd98('0x1e')]||'progressive';this[_0xdd98('0x1f')]=_0x193582[_0xdd98('0x1f')]||0x0;this[_0xdd98('0x20')]=_0x193582[_0xdd98('0x20')]||0x0;this[_0xdd98('0x21')]=_0x193582['dialPowerLevel']||0x1;this[_0xdd98('0x22')]=_0x193582['dialPredictiveOptimization']||_0xdd98('0x23');this['dialPredictiveOptimizationPercentage']=_0x193582[_0xdd98('0x24')]||0.03;this[_0xdd98('0x25')]=_0x193582[_0xdd98('0x25')]||0x258;this[_0xdd98('0x26')]=_0x193582[_0xdd98('0x26')]||_0xdd98('0x27');this[_0xdd98('0x28')]=_0x193582[_0xdd98('0x28')]||'anonymous';this['dialOriginateTimeout']=_0x193582[_0xdd98('0x29')]||0x1e;this[_0xdd98('0x2a')]=_0x193582[_0xdd98('0x2a')]||_0xdd98('0x2b');this[_0xdd98('0x2c')]=_0x193582['dialQueueTimeout']||0x3;this[_0xdd98('0x2d')]=_0x193582[_0xdd98('0x2d')]||undefined;this[_0xdd98('0x2e')]=_0x193582['dialCongestionMaxRetry']||0x3;this[_0xdd98('0x2f')]=_0x193582['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x193582[_0xdd98('0x30')]||0x3;this[_0xdd98('0x31')]=_0x193582[_0xdd98('0x31')]||0x96;this['dialNoAnswerMaxRetry']=_0x193582[_0xdd98('0x32')]||0x3;this[_0xdd98('0x33')]=_0x193582[_0xdd98('0x33')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x193582[_0xdd98('0x34')]||0x3;this[_0xdd98('0x35')]=_0x193582[_0xdd98('0x35')]||0x96;this['dialDropMaxRetry']=_0x193582[_0xdd98('0x36')]||0x3;this[_0xdd98('0x37')]=_0x193582[_0xdd98('0x37')]||0x96;this['dialAbandonedMaxRetry']=_0x193582[_0xdd98('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0x193582['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x193582['dialMachineMaxRetry']||0x3;this[_0xdd98('0x39')]=_0x193582['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x193582[_0xdd98('0x3a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x193582['dialAgentRejectRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x193582[_0xdd98('0x3b')]||0x4;this[_0xdd98('0x3c')]=_0x193582['Trunk']?_0x193582[_0xdd98('0x3c')]:undefined;this[_0xdd98('0x3d')]=_0x193582['TrunkBackup']?_0x193582[_0xdd98('0x3d')]:undefined;this[_0xdd98('0x3e')]=_0x193582['dialPrefix']||undefined;this[_0xdd98('0x3f')]=_0x193582[_0xdd98('0x3f')]?_0x193582[_0xdd98('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x193582[_0xdd98('0x40')]||_0xdd98('0x41');this[_0xdd98('0x42')]=_0x193582[_0xdd98('0x42')]||undefined;this[_0xdd98('0x43')]=_0x193582[_0xdd98('0x43')]||undefined;this[_0xdd98('0x44')]=strategy[_0x193582[_0xdd98('0x44')]]||_0xdd98('0x45');this[_0xdd98('0x46')]=!![];this['dialAMDActive']=_0x193582['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x193582['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x193582['dialAMDGreeting'];this[_0xdd98('0x47')]=_0x193582['dialAMDAfterGreetingSilence'];this[_0xdd98('0x48')]=_0x193582[_0xdd98('0x48')];this[_0xdd98('0x49')]=_0x193582[_0xdd98('0x49')];this[_0xdd98('0x4a')]=_0x193582[_0xdd98('0x4a')];this[_0xdd98('0x4b')]=_0x193582[_0xdd98('0x4b')];this[_0xdd98('0x4c')]=_0x193582['dialAMDSilenceThreshold'];this[_0xdd98('0x4d')]=_0x193582[_0xdd98('0x4d')];this['outboundRejectCallsDay']=0x0;this[_0xdd98('0x4e')]=0x0;this[_0xdd98('0x4f')]=_0x193582[_0xdd98('0x4f')];this['outboundAnswerCallsDay']=0x0;this[_0xdd98('0x50')]=0x0;this[_0xdd98('0x51')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0xdd98('0x52')]=0x0;this[_0xdd98('0x53')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xdd98('0x54')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xdd98('0x55')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xdd98('0x56')]=0x0;this[_0xdd98('0x57')]=0x0;this[_0xdd98('0x58')]=0x0;this[_0xdd98('0x59')]=undefined;this[_0xdd98('0x5a')]=undefined;this['handlePredictive']=undefined;this[_0xdd98('0x5b')]=1.05;this[_0xdd98('0x5c')]=0x0;this[_0xdd98('0x5d')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xdd98('0x5e')]=0x0;this[_0xdd98('0x5f')]=0x0;this[_0xdd98('0x60')]=_0x193582['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xdd98('0x61')]=_0x193582['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xdd98('0x62')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xdd98('0x63')]=0x0;this[_0xdd98('0x64')]=0x0;this[_0xdd98('0x65')]=0x0;this[_0xdd98('0x66')]=0x0;this[_0xdd98('0x67')]=_0x193582[_0xdd98('0x67')]||0x1e;this[_0xdd98('0x68')]=_0x193582[_0xdd98('0x68')]||![];this[_0xdd98('0x69')]=_0x193582['dialQueueProject2']||undefined;this[_0xdd98('0x6a')]=_0x193582['dialAgiAfterHangupClient']||![];this[_0xdd98('0x6b')]=_0x193582[_0xdd98('0x6b')]||![];this[_0xdd98('0xb')]=monitorFormat[_0x193582[_0xdd98('0xb')]]?monitorFormat[_0x193582[_0xdd98('0xb')]]:undefined;this[_0xdd98('0x6c')]=_0x193582['mandatoryDisposition']||![];this[_0xdd98('0x6d')]=_0x193582['mandatoryDispositionPause']?_0x193582[_0xdd98('0x6d')]:undefined;}module[_0xdd98('0x6e')]=VoiceQueue; \ No newline at end of file +var _0x9ec3=['dialPowerLevel','dialPredictiveOptimization','dropRate','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','onhold','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','abandoned','loggedIn','available','acw','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue'];(function(_0x1d486a,_0x249817){var _0x44ca73=function(_0x3a2903){while(--_0x3a2903){_0x1d486a['push'](_0x1d486a['shift']());}};_0x44ca73(++_0x249817);}(_0x9ec3,0xc2));var _0x39ec=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x9ec3[_0x307086];return _0x699043;};'use strict';var statusDesc=[_0x39ec('0x0'),_0x39ec('0x1'),_0x39ec('0x2'),_0x39ec('0x3'),_0x39ec('0x4'),'unavailable','ringing','ringinuse',_0x39ec('0x5')];var monitorFormat={'wav':'wav','wav49':'wav49','gsm':'gsm'};var strategy={'rrmemory':_0x39ec('0x6'),'roundrobin':_0x39ec('0x7')};function VoiceQueue(_0x5f8253){this['id']=_0x5f8253['id']||0x0;this[_0x39ec('0x8')]=_0x5f8253[_0x39ec('0x8')]||'';this['monitor_format']=_0x5f8253[_0x39ec('0x9')]||'';this[_0x39ec('0xa')]=_0x5f8253['type']||_0x39ec('0xb');this[_0x39ec('0xc')]=0x0;this['talking']=0x0;this[_0x39ec('0xd')]=0x0;this[_0x39ec('0xe')]=0x0;this[_0x39ec('0xf')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x39ec('0x10')]=0x0;this[_0x39ec('0x11')]=0x0;this[_0x39ec('0x12')]=0x0;this[_0x39ec('0x13')]=_0x5f8253['acw']||![];this['acwTimeout']=_0x5f8253['acwTimeout']||0xa;this[_0x39ec('0x14')]=_0x5f8253['autopause']||'no';this[_0x39ec('0x15')]=!![];this[_0x39ec('0x16')]='';this[_0x39ec('0x17')]=0x0;this['temp']=0x0;this[_0x39ec('0x18')]=_0x5f8253['dialTimezone']||null;this[_0x39ec('0x19')]=_0x5f8253[_0x39ec('0x19')]?_0x5f8253[_0x39ec('0x19')]:null;this['dialActive']=_0x5f8253[_0x39ec('0x1a')];this['dialMethod']=_0x5f8253['dialMethod']||_0x39ec('0x1b');this[_0x39ec('0x1c')]=_0x5f8253[_0x39ec('0x1c')]||0x0;this[_0x39ec('0x1d')]=_0x5f8253[_0x39ec('0x1d')]||0x0;this[_0x39ec('0x1e')]=_0x5f8253['dialPowerLevel']||0x1;this[_0x39ec('0x1f')]=_0x5f8253[_0x39ec('0x1f')]||_0x39ec('0x20');this['dialPredictiveOptimizationPercentage']=_0x5f8253['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x5f8253['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x5f8253[_0x39ec('0x21')]||_0x39ec('0x22');this[_0x39ec('0x23')]=_0x5f8253[_0x39ec('0x23')]||_0x39ec('0x22');this[_0x39ec('0x24')]=_0x5f8253[_0x39ec('0x24')]||0x1e;this['dialQueueOptions']=_0x5f8253['dialQueueOptions']||_0x39ec('0x25');this[_0x39ec('0x26')]=_0x5f8253[_0x39ec('0x26')]||0x3;this['dialQueueProject']=_0x5f8253[_0x39ec('0x27')]||undefined;this[_0x39ec('0x28')]=_0x5f8253['dialCongestionMaxRetry']||0x3;this[_0x39ec('0x29')]=_0x5f8253[_0x39ec('0x29')]||0x96;this[_0x39ec('0x2a')]=_0x5f8253[_0x39ec('0x2a')]||0x3;this[_0x39ec('0x2b')]=_0x5f8253[_0x39ec('0x2b')]||0x96;this[_0x39ec('0x2c')]=_0x5f8253[_0x39ec('0x2c')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5f8253[_0x39ec('0x2d')]||0x96;this[_0x39ec('0x2e')]=_0x5f8253[_0x39ec('0x2e')]||0x3;this[_0x39ec('0x2f')]=_0x5f8253[_0x39ec('0x2f')]||0x96;this['dialDropMaxRetry']=_0x5f8253[_0x39ec('0x30')]||0x3;this[_0x39ec('0x31')]=_0x5f8253[_0x39ec('0x31')]||0x96;this[_0x39ec('0x32')]=_0x5f8253[_0x39ec('0x32')]||0x3;this['dialAbandonedRetryFrequency']=_0x5f8253['dialAbandonedRetryFrequency']||0x96;this[_0x39ec('0x33')]=_0x5f8253[_0x39ec('0x33')]||0x3;this[_0x39ec('0x34')]=_0x5f8253[_0x39ec('0x34')]||0x96;this[_0x39ec('0x35')]=_0x5f8253[_0x39ec('0x35')]||0x3;this[_0x39ec('0x36')]=_0x5f8253[_0x39ec('0x36')]||0x96;this['dialGlobalMaxRetry']=_0x5f8253[_0x39ec('0x37')]||0x4;this[_0x39ec('0x38')]=_0x5f8253['Trunk']?_0x5f8253[_0x39ec('0x38')]:undefined;this['TrunkBackup']=_0x5f8253['TrunkBackup']?_0x5f8253[_0x39ec('0x39')]:undefined;this[_0x39ec('0x3a')]=_0x5f8253[_0x39ec('0x3a')]||undefined;this[_0x39ec('0x3b')]=_0x5f8253[_0x39ec('0x3b')]?_0x5f8253[_0x39ec('0x3b')]:undefined;this[_0x39ec('0x3c')]=_0x5f8253[_0x39ec('0x3c')]||_0x39ec('0x3d');this[_0x39ec('0x3e')]=_0x5f8253[_0x39ec('0x3e')]||undefined;this[_0x39ec('0x3f')]=_0x5f8253[_0x39ec('0x3f')]||undefined;this[_0x39ec('0x40')]=strategy[_0x5f8253[_0x39ec('0x40')]]||_0x39ec('0x6');this[_0x39ec('0x41')]=!![];this['dialAMDActive']=_0x5f8253['dialAMDActive']||![];this[_0x39ec('0x42')]=_0x5f8253[_0x39ec('0x42')];this[_0x39ec('0x43')]=_0x5f8253[_0x39ec('0x43')];this[_0x39ec('0x44')]=_0x5f8253[_0x39ec('0x44')];this['dialAMDTotalAnalysisTime']=_0x5f8253[_0x39ec('0x45')];this[_0x39ec('0x46')]=_0x5f8253[_0x39ec('0x46')];this[_0x39ec('0x47')]=_0x5f8253[_0x39ec('0x47')];this[_0x39ec('0x48')]=_0x5f8253['dialAMDMaximumNumberOfWords'];this[_0x39ec('0x49')]=_0x5f8253[_0x39ec('0x49')];this[_0x39ec('0x4a')]=_0x5f8253['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x39ec('0x4b')]=0x0;this[_0x39ec('0x4c')]=_0x5f8253['timeout'];this[_0x39ec('0x4d')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x39ec('0x4e')]=0x0;this[_0x39ec('0x4f')]=0x0;this[_0x39ec('0x50')]=0x0;this['outboundNoSuchCallsDay']=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x39ec('0x51')]=0x0;this[_0x39ec('0x52')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x39ec('0x53')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x39ec('0x54')]=0x0;this[_0x39ec('0x55')]=0x0;this[_0x39ec('0x56')]=undefined;this[_0x39ec('0x57')]=undefined;this[_0x39ec('0x58')]=undefined;this[_0x39ec('0x59')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x39ec('0x5a')]=0x0;this[_0x39ec('0x5b')]=0x0;this[_0x39ec('0x5c')]=0x0;this[_0x39ec('0x5d')]=0x0;this[_0x39ec('0x5e')]=0x0;this[_0x39ec('0x5f')]=0x0;this[_0x39ec('0x60')]=0x0;this['predictiveIntervalMaxThreshold']=_0x5f8253[_0x39ec('0x61')]||0x14;this[_0x39ec('0x62')]=_0x5f8253[_0x39ec('0x61')]||0xa;this[_0x39ec('0x63')]=0x0;this[_0x39ec('0x64')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x39ec('0x65')]=0x0;this[_0x39ec('0x66')]=0x0;this[_0x39ec('0x67')]=0x0;this[_0x39ec('0x68')]=0x0;this[_0x39ec('0x69')]=_0x5f8253[_0x39ec('0x69')]||0x1e;this[_0x39ec('0x6a')]=_0x5f8253['dialRecallInQueue']||![];this['dialQueueProject2']=_0x5f8253['dialQueueProject2']||undefined;this[_0x39ec('0x6b')]=_0x5f8253[_0x39ec('0x6b')]||![];this[_0x39ec('0x6c')]=_0x5f8253['dialAgiAfterHangupAgent']||![];this[_0x39ec('0x9')]=monitorFormat[_0x5f8253[_0x39ec('0x9')]]?monitorFormat[_0x5f8253[_0x39ec('0x9')]]:undefined;this[_0x39ec('0x6d')]=_0x5f8253[_0x39ec('0x6d')]||![];this[_0x39ec('0x6e')]=_0x5f8253[_0x39ec('0x6e')]?_0x5f8253[_0x39ec('0x6e')]:undefined;}module[_0x39ec('0x6f')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 097fa75..b9dfc19 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 _0x18d4=['serverUrl','Configurations','exports','name','username','accessKey','remoteUri'];(function(_0x5de13d,_0x193ded){var _0x2e005a=function(_0x407b0a){while(--_0x407b0a){_0x5de13d['push'](_0x5de13d['shift']());}};_0x2e005a(++_0x193ded);}(_0x18d4,0x15a));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x433cd8){this['id']=_0x433cd8['id']||0x0;this[_0x418d('0x0')]=_0x433cd8[_0x418d('0x0')]||'';this['username']=_0x433cd8[_0x418d('0x1')]||'';this[_0x418d('0x2')]=_0x433cd8[_0x418d('0x2')]||'';this[_0x418d('0x3')]=_0x433cd8[_0x418d('0x3')]||'';this[_0x418d('0x4')]=_0x433cd8[_0x418d('0x4')]||'';this[_0x418d('0x5')]=_0x433cd8[_0x418d('0x5')]||{};}module[_0x418d('0x6')]=VtigerAccount; \ No newline at end of file +var _0xab64=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4be3d3,_0x635c8d){var _0x2ff820=function(_0x41012c){while(--_0x41012c){_0x4be3d3['push'](_0x4be3d3['shift']());}};_0x2ff820(++_0x635c8d);}(_0xab64,0x1d5));var _0x4ab6=function(_0x3d3540,_0x100a26){_0x3d3540=_0x3d3540-0x0;var _0x1be13f=_0xab64[_0x3d3540];return _0x1be13f;};'use strict';function VtigerAccount(_0x27ab3c){this['id']=_0x27ab3c['id']||0x0;this[_0x4ab6('0x0')]=_0x27ab3c[_0x4ab6('0x0')]||'';this[_0x4ab6('0x1')]=_0x27ab3c[_0x4ab6('0x1')]||'';this[_0x4ab6('0x2')]=_0x27ab3c[_0x4ab6('0x2')]||'';this['remoteUri']=_0x27ab3c[_0x4ab6('0x3')]||'';this['serverUrl']=_0x27ab3c[_0x4ab6('0x4')]||'';this[_0x4ab6('0x5')]=_0x27ab3c[_0x4ab6('0x5')]||{};}module[_0x4ab6('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 7af9cbd..5a90e83 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 _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x528d54,_0x10eae7){var _0x5e130d=function(_0x59be2a){while(--_0x59be2a){_0x528d54['push'](_0x528d54['shift']());}};_0x5e130d(++_0x10eae7);}(_0x2032,0xd9));var _0x2203=function(_0x23a163,_0x2be6c9){_0x23a163=_0x23a163-0x0;var _0x2ad83b=_0x2032[_0x23a163];return _0x2ad83b;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0xadb5=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0xc94d6f,_0x9d8dcd){_0xc94d6f=_0xc94d6f-0x0;var _0x3370c2=_0xadb5[_0xc94d6f];return _0x3370c2;};'use strict';function ZendeskAccount(_0x1f969c){this['id']=_0x1f969c['id']||0x0;this[_0x5adb('0x0')]=_0x1f969c['name']||'';this[_0x5adb('0x1')]=_0x1f969c[_0x5adb('0x1')]||'';this[_0x5adb('0x2')]=_0x1f969c['password']||'';this[_0x5adb('0x3')]=_0x1f969c[_0x5adb('0x3')]||'';this[_0x5adb('0x4')]=_0x1f969c['remoteUri']||'';this[_0x5adb('0x5')]=_0x1f969c[_0x5adb('0x5')]||'';this[_0x5adb('0x6')]=_0x1f969c[_0x5adb('0x6')]||_0x5adb('0x7');this[_0x5adb('0x8')]=_0x1f969c[_0x5adb('0x8')]||'';this[_0x5adb('0x9')]=_0x1f969c[_0x5adb('0x9')]||{};}module[_0x5adb('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index fdaeb47..82155bd 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 _0x9354=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone'];(function(_0x9c8b4a,_0x2387ff){var _0x198bef=function(_0x2eb4e8){while(--_0x2eb4e8){_0x9c8b4a['push'](_0x9c8b4a['shift']());}};_0x198bef(++_0x2387ff);}(_0x9354,0x96));var _0x4935=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0x9354[_0x5ff517];return _0x19a245;};'use strict';function ZohoAccount(_0x487ab6){this['id']=_0x487ab6['id']||0x0;this[_0x4935('0x0')]=_0x487ab6[_0x4935('0x0')]||'';this['description']=_0x487ab6[_0x4935('0x1')]||'';this[_0x4935('0x2')]=_0x487ab6[_0x4935('0x2')]||'';this[_0x4935('0x3')]=_0x487ab6['zone']||'';this[_0x4935('0x4')]=_0x487ab6[_0x4935('0x4')]||'';this[_0x4935('0x5')]=_0x487ab6[_0x4935('0x5')]||'';this[_0x4935('0x6')]=_0x487ab6[_0x4935('0x6')]||'';this[_0x4935('0x7')]=_0x487ab6[_0x4935('0x7')]||'';this[_0x4935('0x8')]=_0x487ab6['refreshToken']||'';this[_0x4935('0x9')]=_0x487ab6['Configurations']||{};}module[_0x4935('0xa')]=ZohoAccount; \ No newline at end of file +var _0x351d=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientId','clientSecret'];(function(_0x9f4073,_0x35b225){var _0x26441c=function(_0x5e7c9e){while(--_0x5e7c9e){_0x9f4073['push'](_0x9f4073['shift']());}};_0x26441c(++_0x35b225);}(_0x351d,0x90));var _0xd351=function(_0x5d5931,_0x2db35e){_0x5d5931=_0x5d5931-0x0;var _0x59deb5=_0x351d[_0x5d5931];return _0x59deb5;};'use strict';function ZohoAccount(_0x7a0b2c){this['id']=_0x7a0b2c['id']||0x0;this['name']=_0x7a0b2c[_0xd351('0x0')]||'';this[_0xd351('0x1')]=_0x7a0b2c[_0xd351('0x1')]||'';this['host']=_0x7a0b2c[_0xd351('0x2')]||'';this['zone']=_0x7a0b2c[_0xd351('0x3')]||'';this[_0xd351('0x4')]=_0x7a0b2c['clientId']||'';this[_0xd351('0x5')]=_0x7a0b2c[_0xd351('0x5')]||'';this[_0xd351('0x6')]=_0x7a0b2c['serverUrl']||'';this[_0xd351('0x7')]=_0x7a0b2c[_0xd351('0x7')]||'';this['refreshToken']=_0x7a0b2c[_0xd351('0x8')]||'';this[_0xd351('0x9')]=_0x7a0b2c['Configurations']||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 4d3d0a3..d6a80c3 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 _0x46ed=['string','uniqueid','type','queue','dialAnswer','membername','Agent','SIP/%s','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','number','exports','lodash','moment','isNil'];(function(_0x34e4f1,_0x57b35d){var _0x1a7e8e=function(_0x54384f){while(--_0x54384f){_0x34e4f1['push'](_0x34e4f1['shift']());}};_0x1a7e8e(++_0x57b35d);}(_0x46ed,0x197));var _0xd46e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x46ed[_0x4ff09b];return _0x3f5c2e;};'use strict';var util=require('util');var _=require(_0xd46e('0x0'));var moment=require(_0xd46e('0x1'));function checkNameSurname(_0x498832,_0x18fd84,_0x17fd25){var _0x3a0e07='';if(!_[_0xd46e('0x2')](_0x18fd84)&&_0xd46e('0x3')===typeof _0x18fd84){_0x3a0e07+=_0x18fd84;}if(!_[_0xd46e('0x2')](_0x17fd25)&&_0xd46e('0x3')===typeof _0x17fd25){_0x3a0e07+='\x20'+_0x17fd25;}if(_0x3a0e07!==''){return _0x3a0e07;}return _0x498832;}function Action(_0x48c444,_0x49efc1,_0x369bb7,_0x450612,_0x19844d){this[_0xd46e('0x4')]=_0x369bb7||undefined;this['idContact']=_0x48c444['id'];this['queue']=_0x49efc1['name'];this[_0xd46e('0x5')]=_0x49efc1['type'];this['campaigntype']=_0xd46e('0x6');this[_0xd46e('0x7')]=![];this[_0xd46e('0x8')]=_[_0xd46e('0x2')](_0x48c444[_0xd46e('0x9')])?undefined:_0x48c444[_0xd46e('0x9')]['name'];this['channelAgent']=this[_0xd46e('0x8')]?util['format'](_0xd46e('0xa'),this[_0xd46e('0x8')]):_0x450612||undefined;this[_0xd46e('0xb')]=checkNameSurname(_0x48c444[_0xd46e('0xc')][_0xd46e('0xd')],_0x48c444[_0xd46e('0xc')][_0xd46e('0xe')],_0x48c444[_0xd46e('0xc')]['lastName']);this[_0xd46e('0xf')]=_0x48c444[_0xd46e('0xf')]||![];this[_0xd46e('0x10')]=_0x48c444[_0xd46e('0xc')]['phone'];this[_0xd46e('0x11')]=_0x48c444['scheduledat'];this[_0xd46e('0x12')]=_0x48c444[_0xd46e('0x12')]||0x0;this[_0xd46e('0x13')]=_0x48c444[_0xd46e('0x13')]||0x0;this[_0xd46e('0x14')]=_0x48c444[_0xd46e('0x14')]||0x0;this[_0xd46e('0x15')]=(_0x48c444['countbusyretry']||0x0)+(_0x48c444['countcongestionretry']||0x0)+(_0x48c444['countnoanswerretry']||0x0)+(_0x48c444[_0xd46e('0x16')]||0x0)+(_0x48c444[_0xd46e('0x17')]||0x0)+(_0x48c444[_0xd46e('0x18')]||0x0)+(_0x48c444['countmachineretry']||0x0)+(_0x48c444[_0xd46e('0x19')]||0x0);this[_0xd46e('0x16')]=_0x48c444[_0xd46e('0x16')]||0x0;this[_0xd46e('0x17')]=_0x48c444['countdropretry']||0x0;this[_0xd46e('0x18')]=_0x48c444['countabandonedretry']||0x0;this[_0xd46e('0x1a')]=_0x48c444['countmachineretry']||0x0;this[_0xd46e('0x19')]=_0x48c444[_0xd46e('0x19')]||0x0;this[_0xd46e('0x1b')]=_0x48c444[_0xd46e('0x1b')];this[_0xd46e('0x1c')]=_0x48c444['callbackuniqueid'];this[_0xd46e('0x1d')]=_0x48c444[_0xd46e('0x1d')];this['recallme']=_0x48c444[_0xd46e('0x1e')];this['ContactId']=_0x48c444[_0xd46e('0x1f')];this['ListId']=_0x48c444['ListId'];this[_0xd46e('0x20')]=_[_0xd46e('0x2')](_0x48c444[_0xd46e('0x9')])?_0x48c444[_0xd46e('0x20')]:_0x48c444[_0xd46e('0x9')]['id'];this['VoiceQueueId']=_0x48c444[_0xd46e('0x21')];this[_0xd46e('0x22')]='';this[_0xd46e('0x23')]='';}Action['prototype'][_0xd46e('0x24')]=function(){return util[_0xd46e('0x25')](_0xd46e('0x26'),this[_0xd46e('0xb')],this[_0xd46e('0x27')]);};module[_0xd46e('0x28')]=Action; \ No newline at end of file +var _0xa7f0=['calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','number','exports','util','moment','isNil','string','uniqueid','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active'];(function(_0x839516,_0x40b33a){var _0x24c5d6=function(_0xb87803){while(--_0xb87803){_0x839516['push'](_0x839516['shift']());}};_0x24c5d6(++_0x40b33a);}(_0xa7f0,0x1cf));var _0x0a7f=function(_0x3676fb,_0x2adf5f){_0x3676fb=_0x3676fb-0x0;var _0x26e59c=_0xa7f0[_0x3676fb];return _0x26e59c;};'use strict';var util=require(_0x0a7f('0x0'));var _=require('lodash');var moment=require(_0x0a7f('0x1'));function checkNameSurname(_0x24684c,_0x421dc6,_0xa9cf53){var _0x480b56='';if(!_[_0x0a7f('0x2')](_0x421dc6)&&_0x0a7f('0x3')===typeof _0x421dc6){_0x480b56+=_0x421dc6;}if(!_['isNil'](_0xa9cf53)&&'string'===typeof _0xa9cf53){_0x480b56+='\x20'+_0xa9cf53;}if(_0x480b56!==''){return _0x480b56;}return _0x24684c;}function Action(_0x4fa3b6,_0x15465f,_0x164108,_0x205edf,_0x3e27d1){this[_0x0a7f('0x4')]=_0x164108||undefined;this['idContact']=_0x4fa3b6['id'];this['queue']=_0x15465f[_0x0a7f('0x5')];this[_0x0a7f('0x6')]=_0x15465f[_0x0a7f('0x6')];this[_0x0a7f('0x7')]=_0x0a7f('0x8');this[_0x0a7f('0x9')]=![];this[_0x0a7f('0xa')]=_[_0x0a7f('0x2')](_0x4fa3b6[_0x0a7f('0xb')])?undefined:_0x4fa3b6[_0x0a7f('0xb')][_0x0a7f('0x5')];this[_0x0a7f('0xc')]=this[_0x0a7f('0xa')]?util[_0x0a7f('0xd')](_0x0a7f('0xe'),this[_0x0a7f('0xa')]):_0x205edf||undefined;this[_0x0a7f('0xf')]=checkNameSurname(_0x4fa3b6[_0x0a7f('0x10')][_0x0a7f('0x11')],_0x4fa3b6['Contact'][_0x0a7f('0x12')],_0x4fa3b6[_0x0a7f('0x10')][_0x0a7f('0x13')]);this[_0x0a7f('0x14')]=_0x4fa3b6[_0x0a7f('0x14')]||![];this[_0x0a7f('0x15')]=_0x4fa3b6[_0x0a7f('0x10')][_0x0a7f('0x11')];this['scheduledat']=_0x4fa3b6[_0x0a7f('0x16')];this['countbusyretry']=_0x4fa3b6[_0x0a7f('0x17')]||0x0;this['countcongestionretry']=_0x4fa3b6[_0x0a7f('0x18')]||0x0;this[_0x0a7f('0x19')]=_0x4fa3b6[_0x0a7f('0x19')]||0x0;this[_0x0a7f('0x1a')]=(_0x4fa3b6[_0x0a7f('0x17')]||0x0)+(_0x4fa3b6[_0x0a7f('0x18')]||0x0)+(_0x4fa3b6[_0x0a7f('0x19')]||0x0)+(_0x4fa3b6[_0x0a7f('0x1b')]||0x0)+(_0x4fa3b6[_0x0a7f('0x1c')]||0x0)+(_0x4fa3b6['countabandonedretry']||0x0)+(_0x4fa3b6[_0x0a7f('0x1d')]||0x0)+(_0x4fa3b6[_0x0a7f('0x1e')]||0x0);this[_0x0a7f('0x1b')]=_0x4fa3b6['countnosuchnumberretry']||0x0;this['countdropretry']=_0x4fa3b6['countdropretry']||0x0;this[_0x0a7f('0x1f')]=_0x4fa3b6['countabandonedretry']||0x0;this[_0x0a7f('0x1d')]=_0x4fa3b6[_0x0a7f('0x1d')]||0x0;this[_0x0a7f('0x1e')]=_0x4fa3b6[_0x0a7f('0x1e')]||0x0;this['callback']=_0x4fa3b6[_0x0a7f('0x20')];this[_0x0a7f('0x21')]=_0x4fa3b6[_0x0a7f('0x21')];this[_0x0a7f('0x22')]=_0x4fa3b6['callbackat'];this['recallme']=_0x4fa3b6['recallme'];this[_0x0a7f('0x23')]=_0x4fa3b6[_0x0a7f('0x23')];this[_0x0a7f('0x24')]=_0x4fa3b6[_0x0a7f('0x24')];this[_0x0a7f('0x25')]=_[_0x0a7f('0x2')](_0x4fa3b6[_0x0a7f('0xb')])?_0x4fa3b6['UserId']:_0x4fa3b6[_0x0a7f('0xb')]['id'];this[_0x0a7f('0x26')]=_0x4fa3b6['VoiceQueueId'];this['originatecalleridnum']='';this[_0x0a7f('0x27')]='';}Action[_0x0a7f('0x28')][_0x0a7f('0x29')]=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x0a7f('0x2a')]);};module[_0x0a7f('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index d8eebb9..2b0940b 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 _0xc134=['dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','clearZombieChannels','dialActive','recallMe','clearZombieChannel','isNil','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','UserId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','then','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','logger2','[RecallMe]','disableContact','format','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','YYYY-MM-DD\x20HH:mm:ss','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','BUSY','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','VoiceQueueId','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','active','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','Contact','phone','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','starttime','Answer','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest'];(function(_0x403d9a,_0x4fd7ae){var _0xdbdaa2=function(_0x1da24a){while(--_0x1da24a){_0x403d9a['push'](_0x403d9a['shift']());}};_0xdbdaa2(++_0x4fd7ae);}(_0xc134,0x12a));var _0x4c13=function(_0x57204b,_0x5be145){_0x57204b=_0x57204b-0x0;var _0x2fa49c=_0xc134[_0x57204b];return _0x2fa49c;};'use strict';var util=require(_0x4c13('0x0'));var _=require(_0x4c13('0x1'));var BPromise=require(_0x4c13('0x2'));var uuid=require(_0x4c13('0x3'));var moment=require('moment');var md5=require(_0x4c13('0x4'));var Redis=require(_0x4c13('0x5'));var config=require(_0x4c13('0x6'));var logger=require(_0x4c13('0x7'))(_0x4c13('0x8'));var loggerAction=require('../../../config/logger')(_0x4c13('0x9'));var ami=require('../ami');var rpcDb=require(_0x4c13('0xa'));var Action=require(_0x4c13('0xb'));var ut=require(_0x4c13('0xc'));config['redis']=_[_0x4c13('0xd')](config[_0x4c13('0xe')],{'host':_0x4c13('0xf'),'port':0x18eb});var io=require(_0x4c13('0x10'))(new Redis(config[_0x4c13('0xe')]));var Sequence=function(){};Sequence[_0x4c13('0x11')][_0x4c13('0x12')]=function(_0xa20bac){this[_0x4c13('0x13')]=this[_0x4c13('0x13')]?this['tail'][_0x4c13('0x14')](_0xa20bac):_0xa20bac();};function Preview(_0x5b46df){this[_0x4c13('0x15')]=new Sequence();this[_0x4c13('0x16')]=_0x5b46df[_0x4c13('0x17')];this[_0x4c13('0x18')]=_0x5b46df['trunks'];this[_0x4c13('0x19')]={};this[_0x4c13('0x1a')]=_0x5b46df[_0x4c13('0x1a')];this[_0x4c13('0x1b')]=0x0;ami['on'](_0x4c13('0x1c'),this[_0x4c13('0x1d')][_0x4c13('0x1e')](this));ami['on']('hangup',this[_0x4c13('0x1f')][_0x4c13('0x1e')](this));ami['on'](_0x4c13('0x20'),this[_0x4c13('0x21')]['bind'](this));ami['on'](_0x4c13('0x22'),this[_0x4c13('0x23')]['bind'](this));ami['on'](_0x4c13('0x24'),this[_0x4c13('0x25')]['bind'](this));ami['on'](_0x4c13('0x26'),this['syncVarSet'][_0x4c13('0x1e')](this));ami['on'](_0x4c13('0x27'),this[_0x4c13('0x28')][_0x4c13('0x1e')](this));ami['on'](_0x4c13('0x29'),this[_0x4c13('0x2a')][_0x4c13('0x1e')](this));this[_0x4c13('0x2b')](this[_0x4c13('0x16')]);}function emit(_0x4c8119,_0x3a5d40,_0x4bc799){io['to'](_0x4c8119)[_0x4c13('0x2c')](_0x3a5d40,_0x4bc799);}function emitCampaignPreview(_0xae704f){if(_0xae704f[_0x4c13('0x2d')]===_0x4c13('0x2e')){var _0x5d6207={'id':_0xae704f['id'],'name':_0xae704f[_0x4c13('0x2f')],'strategy':_0xae704f[_0x4c13('0x30')],'answered':_0xae704f['answered'],'available':_0xae704f[_0x4c13('0x31')],'loggedIn':_0xae704f[_0x4c13('0x32')],'pTalking':_0xae704f[_0x4c13('0x33')],'sumBillable':_0xae704f[_0x4c13('0x34')],'sumDuration':_0xae704f[_0x4c13('0x35')],'sumHoldTime':_0xae704f[_0x4c13('0x36')]||0x0,'talking':_0xae704f[_0x4c13('0x37')],'total':_0xae704f[_0x4c13('0x38')],'type':_0xae704f['type'],'unmanaged':_0xae704f[_0x4c13('0x39')],'abandoned':_0xae704f['abandoned'],'waiting':_0xae704f[_0x4c13('0x3a')],'loggedInDb':_0xae704f['loggedInDb'],'dialActive':_0xae704f['dialActive'],'dialMethod':_0xae704f['dialMethod'],'dialOriginateCallerIdName':_0xae704f[_0x4c13('0x3b')],'dialOriginateCallerIdNumber':_0xae704f[_0x4c13('0x3c')],'dialOriginateTimeout':_0xae704f['dialOriginateTimeout'],'dialPrefix':_0xae704f['dialPrefix'],'outboundAnswerAgiCallsDay':_0xae704f['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xae704f[_0x4c13('0x3d')],'outboundBlacklistCallsDay':_0xae704f[_0x4c13('0x3e')],'outboundBusyCallsDay':_0xae704f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xae704f[_0x4c13('0x3f')],'outboundDropCallsDayACS':_0xae704f[_0x4c13('0x40')],'outboundDropCallsDayCallersExit':_0xae704f[_0x4c13('0x41')],'outboundDropCallsDayTimeout':_0xae704f[_0x4c13('0x42')],'outboundNoAnswerCallsDay':_0xae704f[_0x4c13('0x43')],'outboundNoSuchCallsDay':_0xae704f[_0x4c13('0x44')],'outboundOriginateFailureCallsDay':_0xae704f[_0x4c13('0x45')],'outboundReCallsDay':_0xae704f[_0x4c13('0x46')],'outboundRejectCallsDay':_0xae704f[_0x4c13('0x47')],'outboundUnknownCallsDay':_0xae704f[_0x4c13('0x48')],'outboundAbandonedCallsDay':_0xae704f[_0x4c13('0x49')],'predictiveIntervalAnsweredCalls':_0xae704f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xae704f[_0x4c13('0x4a')],'predictiveIntervalAvgTalktime':_0xae704f[_0x4c13('0x4b')],'predictiveIntervalDroppedCallsCallersExit':_0xae704f[_0x4c13('0x4c')],'predictiveIntervalDroppedCallsTimeout':_0xae704f[_0x4c13('0x4d')],'predictiveIntervalErlangCalls':_0xae704f[_0x4c13('0x4e')],'predictiveIntervalErlangCallsDroppedCalls':_0xae704f[_0x4c13('0x4f')],'predictiveIntervalHitRate':_0xae704f[_0x4c13('0x50')],'predictiveIntervalMultiplicativeFactor':_0xae704f[_0x4c13('0x51')],'predictiveIntervalPauses':_0xae704f[_0x4c13('0x52')],'predictiveIntervalAvailable':_0xae704f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xae704f['predictiveIntervalTotalCalls'],'message':_0xae704f[_0x4c13('0x53')],'originated':_0xae704f[_0x4c13('0x54')],'erlangCalls':_0xae704f[_0x4c13('0x55')],'erlangCallToSecond':_0xae704f[_0x4c13('0x56')],'erlangAbandonmentRate':_0xae704f[_0x4c13('0x57')],'erlangBusyFactor':_0xae704f[_0x4c13('0x58')],'startPredictive':_0xae704f[_0x4c13('0x59')],'startProgressive':_0xae704f[_0x4c13('0x5a')]};if(_0xae704f[_0x4c13('0x5b')]){_0x5d6207[_0x4c13('0x5b')]={'id':_0xae704f[_0x4c13('0x5b')]['id'],'name':_0xae704f[_0x4c13('0x5b')][_0x4c13('0x2f')],'active':_0xae704f['Trunk']['active'],'callerid':_0xae704f['Trunk'][_0x4c13('0x5c')]};}if(_0xae704f['Interval']){_0x5d6207['Interval']={'id':_0xae704f['Interval']['id'],'name':_0xae704f['Interval'][_0x4c13('0x2f')]};}var _0x25d0b5=md5(JSON['stringify'](_0x5d6207));if(_0xae704f[_0x4c13('0x4')]!==_0x25d0b5){_0xae704f[_0x4c13('0x4')]=_0x25d0b5;emit(util['format']('voice:queue:%s',_0x5d6207[_0x4c13('0x2f')]),_0x4c13('0x5d'),_0x5d6207);}}}function emitVoiceQueueChannelRemove(_0x1c2909){logger[_0x4c13('0x5e')](_0x4c13('0x5f'),JSON[_0x4c13('0x60')](_0x1c2909));emit(util['format']('voice:queue:%s',_0x1c2909[_0x4c13('0x2f')]),_0x4c13('0x61'),_0x1c2909);}function notSendMessagesQueue(_0x2f2743){if(_0x2f2743[_0x4c13('0x62')]){if(_0x2f2743[_0x4c13('0x54')]===0x0&&_0x2f2743[_0x4c13('0x33')]===0x0){_0x2f2743['sendMessageOneNotActive']=![];_0x2f2743['available']=0x0;_0x2f2743['paused']=0x0;_0x2f2743[_0x4c13('0x53')]=_0x4c13('0x63');ut[_0x4c13('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x2f2743[_0x4c13('0x2f')]+_0x4c13('0x65'));}else{_0x2f2743[_0x4c13('0x53')]=_0x4c13('0x66');ut[_0x4c13('0x64')](_0x4c13('0x67'),_0x2f2743['name']+_0x4c13('0x68'));}emitCampaignPreview(_0x2f2743);}}Preview[_0x4c13('0x11')][_0x4c13('0x2b')]=function(){var _0x812671=this;setInterval(function(){_0x812671[_0x4c13('0x69')]();},0x7cf);};Preview[_0x4c13('0x11')][_0x4c13('0x69')]=function(){var _0x53354e=this[_0x4c13('0x16')];this[_0x4c13('0x1b')]+=0x1;for(var _0x1155c9 in _0x53354e){if(_0x53354e[_0x4c13('0x6a')](_0x1155c9)&&(_0x53354e[_0x1155c9][_0x4c13('0x6b')]==='preview'||_0x53354e[_0x1155c9][_0x4c13('0x6b')]==='booked')&&_0x53354e[_0x1155c9][_0x4c13('0x2d')]===_0x4c13('0x2e')){if(this[_0x4c13('0x1b')]>0x7){this[_0x4c13('0x1b')]=0x0;this[_0x4c13('0x6c')]();}}if(_0x53354e[_0x4c13('0x6a')](_0x1155c9)&&_0x53354e[_0x1155c9][_0x4c13('0x6b')]===_0x4c13('0x8')&&_0x53354e[_0x1155c9]['type']==='outbound'){if(_0x53354e[_0x1155c9][_0x4c13('0x6d')]){this['setMessage'](_0x53354e[_0x1155c9]);this[_0x4c13('0x6e')](_0x53354e[_0x1155c9]);}else{notSendMessagesQueue(_0x53354e[_0x1155c9]);}}}};Preview['prototype'][_0x4c13('0x6f')]=function(_0x406611){var _0x86e9a=this;this['sequence'][_0x4c13('0x12')](function(){if(!_[_0x4c13('0x70')](_0x86e9a[_0x4c13('0x19')][_0x406611])){loggerAction[_0x4c13('0x5e')]('[clearZombieChannels][talking]',_0x406611,_0x4c13('0x71'),_0x86e9a[_0x4c13('0x19')][_0x406611]['queue'],_0x4c13('0x72'),JSON['stringify'](_0x86e9a[_0x4c13('0x16')][_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x73')]]['originated']),_0x4c13('0x74'),JSON[_0x4c13('0x60')](_0x86e9a[_0x4c13('0x16')][_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x73')]][_0x4c13('0x33')]),JSON[_0x4c13('0x60')](_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x75')]),JSON[_0x4c13('0x60')](_[_0x4c13('0x76')](_0x86e9a[_0x4c13('0x19')][_0x406611],['contactId',_0x4c13('0x77'),'VoiceQueueId',_0x4c13('0x78')])));return ami[_0x4c13('0x79')]({'action':_0x4c13('0x7a'),'channel':_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x7b')]})[_0x4c13('0x7c')](function(_0x2ad950){if(_0x2ad950[_0x4c13('0x53')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x86e9a[_0x4c13('0x19')][_0x406611]){ut[_0x4c13('0x7d')](_0x86e9a[_0x4c13('0x16')][_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x73')]],_0x4c13('0x7e'));if(_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x75')]===!![]){ut['decrementTalkink'](_0x86e9a[_0x4c13('0x16')][_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x73')]],_0x4c13('0x7e'));ut[_0x4c13('0x7f')](_0x4c13('0x80')+_0x406611,_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x73')]);}ut[_0x4c13('0x7f')](_0x4c13('0x81')+_0x406611,_0x86e9a[_0x4c13('0x19')][_0x406611][_0x4c13('0x73')]);delete _0x86e9a['actions'][_0x406611];}},0x2328);}});}});};Preview[_0x4c13('0x11')][_0x4c13('0x6c')]=function(){var _0x2c667f=this;loggerAction[_0x4c13('0x5e')](_0x4c13('0x82'),_[_0x4c13('0x83')](this['actions']));for(var _0x214f0b in this['actions']){if(_0x2c667f['actions']['hasOwnProperty'](_0x214f0b)){_0x2c667f[_0x4c13('0x6f')](_0x214f0b);}}};Preview[_0x4c13('0x11')][_0x4c13('0x6e')]=function(_0x793eb7){var _0x5eeb1f=this;rpcDb['getContactRecallMe'](_0x793eb7['id'],ut['agentReadyId'](this[_0x4c13('0x1a')]))[_0x4c13('0x84')](function(_0x57249d){if(!_[_0x4c13('0x70')](_0x57249d)){for(var _0x38d26e=0x0;_0x38d26e<_0x57249d[_0x4c13('0x85')];_0x38d26e+=0x1){if(ut[_0x4c13('0x86')](_0x57249d[_0x38d26e][_0x4c13('0x87')])<_0x793eb7[_0x4c13('0x88')]*0x3c){if(_0x57249d[_0x38d26e][_0x4c13('0x89')]&&!_0x57249d[_0x38d26e][_0x4c13('0x89')]['voicePause']){_0x5eeb1f[_0x4c13('0x8a')](_0x57249d[_0x38d26e]['id'])[_0x4c13('0x84')](ut[_0x4c13('0x8b')](_0x4c13('0x8c')))[_0x4c13('0x7c')](ut[_0x4c13('0x8b')](_0x4c13('0x8c')));}else{rpcDb[_0x4c13('0x8d')](_0x57249d[_0x38d26e]['id']);}}else{var _0x48b6d9=new Action(_0x57249d[_0x38d26e],_0x793eb7);_0x48b6d9['starttime']=moment()[_0x4c13('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');_0x793eb7['outboundReCallsDay']+=0x1;ut[_0x4c13('0x8f')](_0x48b6d9,0x17,'RecallInQueue');if(_0x793eb7[_0x4c13('0x90')]){rpcDb[_0x4c13('0x91')](ut[_0x4c13('0x92')](_0x57249d[_0x38d26e]));rpcDb[_0x4c13('0x93')](_0x48b6d9,_0x4c13('0x94'));}else{ut['logCustomer'](_0x48b6d9,0x16,_0x4c13('0x95'));rpcDb[_0x4c13('0x93')](_0x48b6d9,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x48b6d9,_0x4c13('0x96'));}}}}})[_0x4c13('0x7c')](ut[_0x4c13('0x8b')](_0x4c13('0x97')));};Preview['prototype']['setMessage']=function(_0x422147){_0x422147[_0x4c13('0x62')]=!![];if(ut[_0x4c13('0x98')](_0x422147[_0x4c13('0x32')])){_0x422147[_0x4c13('0x53')]=_0x4c13('0x99');}else if(!ut['isActive'](_0x422147[_0x4c13('0x6d')])){_0x422147[_0x4c13('0x53')]='NOT_ACTIVE';}else if(!this[_0x4c13('0x9a')](_0x422147[_0x4c13('0x5b')])){if(!this[_0x4c13('0x9a')](_0x422147[_0x4c13('0x9b')])){_0x422147[_0x4c13('0x53')]=_0x4c13('0x9c');}else{_0x422147['message']=_0x4c13('0x9d');}}else{_0x422147[_0x4c13('0x53')]=_0x4c13('0x9d');}emitCampaignPreview(_0x422147);};Preview[_0x4c13('0x11')][_0x4c13('0x9e')]=function(_0xb5bbae,_0x4637aa,_0x1ed743){var _0x196ee2=this;var _0x2c74a1=this[_0x4c13('0x19')][_0x4637aa];var _0x22a984=this['campaignsPreview'][_0x2c74a1[_0x4c13('0x73')]];var _0x29e007;if(_0x22a984){switch(_0x1ed743){case'1':_0x22a984[_0x4c13('0x44')]+=0x1;_0x2c74a1['countnosuchnumberretry']+=0x1;_0x2c74a1[_0x4c13('0x9f')]=ut[_0x4c13('0xa0')](_0x2c74a1);ut['logCustomer'](_0x2c74a1,0x0,_0x4c13('0xa1'));ami[_0x4c13('0x2c')](_0x4c13('0xa2'),ut[_0x4c13('0xa3')](_0x2c74a1,_0x4c13('0xa4')));rpcDb[_0x4c13('0x93')](_0x2c74a1,_0x4c13('0xa5'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984[_0x4c13('0xa6')]){_0x29e007=ut[_0x4c13('0xa7')](_0x2c74a1,0xf,_0x4c13('0xa8'));rpcDb['createCustomerFinal'](_0x29e007,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2c74a1['countnosuchnumberretry']>=_0x22a984[_0x4c13('0xa9')]){rpcDb[_0x4c13('0xaa')](_0x2c74a1,_0x4c13('0xab'));}else{rpcDb[_0x4c13('0xac')](ut[_0x4c13('0xad')](_0x2c74a1,_0x4c13('0xae'),_0x22a984[_0x4c13('0xaf')]),_0x2c74a1[_0x4c13('0xb0')],_0x2c74a1[_0x4c13('0xb1')]);}}delete this[_0x4c13('0x19')][_0xb5bbae[_0x4c13('0xb2')]];break;case'ANSWER':var _0x259e04=moment()[_0x4c13('0x8e')](_0x4c13('0xb3'));_0x2c74a1[_0x4c13('0xb4')]=_0x259e04;_0x2c74a1['answertime']=_0x259e04;_0x2c74a1[_0x4c13('0x75')]=!![];_0x22a984[_0x4c13('0x33')]+=0x1;logger['info'](_0x4c13('0xb5'),_0x2c74a1[_0x4c13('0xb6')],_0x4c13('0xb7'),_0x22a984[_0x4c13('0x2f')],_0x4c13('0x74'),_0x22a984[_0x4c13('0x33')]);ami[_0x4c13('0x2c')]('custom:agentconnect',ut[_0x4c13('0xa3')](_0x2c74a1,'connect'));if(_0x22a984[_0x4c13('0xb8')]){ami[_0x4c13('0x2c')](_0x4c13('0xb9'),ut[_0x4c13('0xba')](_0x2c74a1));}break;case'16':ami[_0x4c13('0x2c')](_0x4c13('0xbb'),ut[_0x4c13('0xa3')](_0x2c74a1,_0x4c13('0xbc')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x2c74a1,_0x4c13('0xbc')));_0x22a984['outboundAnswerCallsDay']+=0x1;_0x22a984[_0x4c13('0x38')]+=0x1;_0x22a984[_0x4c13('0xbd')]+=0x1;ut[_0x4c13('0xbe')](_0x22a984,_0x4c13('0xbf'));_0x2c74a1[_0x4c13('0x9f')]=ut['totalGlobal'](_0x2c74a1);ut['logCustomer'](_0x2c74a1,0x4,'Answer');rpcDb[_0x4c13('0x93')](_0x2c74a1,_0x4c13('0xc0'));rpcDb[_0x4c13('0xaa')](_0x2c74a1,_0x4c13('0xc1'));rpcDb[_0x4c13('0xc2')](_0x2c74a1);_0x22a984[_0x4c13('0x35')]+=_0x2c74a1[_0x4c13('0xc3')];_0x22a984[_0x4c13('0x34')]+=_0x2c74a1['talktime'];logger[_0x4c13('0x5e')]('[syncHangup][talking][decrement]',_0x2c74a1[_0x4c13('0xb6')],'\x20Queue',_0x22a984['name'],_0x4c13('0x74'),_0x22a984[_0x4c13('0x33')]);delete this['actions'][_0xb5bbae[_0x4c13('0xb2')]];break;case _0x4c13('0xc4'):_0x22a984['outboundBusyCallsDay']+=0x1;_0x2c74a1['countbusyretry']+=0x1;_0x2c74a1[_0x4c13('0x9f')]=ut[_0x4c13('0xa0')](_0x2c74a1);ut[_0x4c13('0x8f')](_0x2c74a1,0x5,_0x4c13('0xc5'));ami[_0x4c13('0x2c')]('custom:agentbusy',ut[_0x4c13('0xa3')](_0x2c74a1,_0x4c13('0xc6')));rpcDb[_0x4c13('0x93')](_0x2c74a1,_0x4c13('0xc7'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984[_0x4c13('0xa6')]){_0x29e007=ut['cloneAction'](_0x2c74a1,0xf,_0x4c13('0xa8'));rpcDb[_0x4c13('0xaa')](_0x29e007,_0x4c13('0xc8'));}else{if(_0x2c74a1[_0x4c13('0xc9')]>=_0x22a984[_0x4c13('0xca')]){rpcDb['createCustomerFinal'](_0x2c74a1,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb['rescheduleContact'](ut[_0x4c13('0xad')](_0x2c74a1,_0x4c13('0xc9'),_0x22a984[_0x4c13('0xcb')]),_0x2c74a1[_0x4c13('0xb0')],_0x2c74a1[_0x4c13('0xb1')]);}}break;case _0x4c13('0xcc'):_0x22a984['outboundNoAnswerCallsDay']+=0x1;_0x2c74a1[_0x4c13('0xcd')]+=0x1;_0x2c74a1['countglobal']=ut[_0x4c13('0xa0')](_0x2c74a1);ut[_0x4c13('0x8f')](_0x2c74a1,0x3,_0x4c13('0xce'));ami[_0x4c13('0x2c')](_0x4c13('0xcf'),ut[_0x4c13('0xa3')](_0x2c74a1,_0x4c13('0xd0')));rpcDb[_0x4c13('0x93')](_0x2c74a1,_0x4c13('0xd1'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984['dialGlobalMaxRetry']){_0x29e007=ut[_0x4c13('0xa7')](_0x2c74a1,0xf,'Global');rpcDb[_0x4c13('0xaa')](_0x29e007,_0x4c13('0xd2'));}else{if(_0x2c74a1[_0x4c13('0xcd')]>=_0x22a984[_0x4c13('0xd3')]){rpcDb[_0x4c13('0xaa')](_0x2c74a1,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x4c13('0xac')](ut[_0x4c13('0xad')](_0x2c74a1,_0x4c13('0xcd'),_0x22a984[_0x4c13('0xd4')]),_0x2c74a1[_0x4c13('0xb0')],_0x2c74a1['activeContact']);}}break;case'CONGESTION':_0x22a984[_0x4c13('0x3f')]+=0x1;_0x2c74a1[_0x4c13('0xd5')]+=0x1;_0x2c74a1[_0x4c13('0x9f')]=ut['totalGlobal'](_0x2c74a1);ut[_0x4c13('0x8f')](_0x2c74a1,0x8,'Congestion');ami[_0x4c13('0x2c')](_0x4c13('0xd6'),ut['buildObj'](_0x2c74a1,_0x4c13('0xd7')));rpcDb[_0x4c13('0x93')](_0x2c74a1,_0x4c13('0xd8'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984[_0x4c13('0xa6')]){_0x29e007=ut['cloneAction'](_0x2c74a1,0xf,_0x4c13('0xa8'));rpcDb[_0x4c13('0xaa')](_0x29e007,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2c74a1[_0x4c13('0xd5')]>=_0x22a984['dialCongestionMaxRetry']){rpcDb[_0x4c13('0xaa')](_0x2c74a1,_0x4c13('0xd8'));}else{rpcDb['rescheduleContact'](ut[_0x4c13('0xad')](_0x2c74a1,_0x4c13('0xd5'),_0x22a984[_0x4c13('0xcb')]),_0x2c74a1[_0x4c13('0xb0')],_0x2c74a1[_0x4c13('0xb1')]);}}break;case _0x4c13('0xd9'):_0x22a984[_0x4c13('0x47')]+=0x1;_0x2c74a1[_0x4c13('0xda')]+=0x1;_0x2c74a1[_0x4c13('0x9f')]=ut[_0x4c13('0xa0')](_0x2c74a1);ut['logCustomer'](_0x2c74a1,0x14,_0x4c13('0xdb'));ami['emit'](_0x4c13('0xdc'),ut['buildObj'](_0x2c74a1,_0x4c13('0xdd')));rpcDb['createCustomerHistory'](_0x2c74a1,_0x4c13('0xde'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984[_0x4c13('0xa6')]){_0x29e007=ut['cloneAction'](_0x2c74a1,0x14,_0x4c13('0xdb'));rpcDb[_0x4c13('0xaa')](_0x29e007,_0x4c13('0xdf'));}else{if(_0x2c74a1[_0x4c13('0xda')]>=_0x22a984[_0x4c13('0xe0')]){rpcDb[_0x4c13('0xaa')](_0x2c74a1,_0x4c13('0xdf'));}else{rpcDb[_0x4c13('0xac')](ut[_0x4c13('0xad')](_0x2c74a1,_0x4c13('0xda'),_0x22a984[_0x4c13('0xe1')]),_0x2c74a1['unlockAgent'],_0x2c74a1['activeContact']);}}break;case'ABANDONED':_0x22a984[_0x4c13('0x49')]+=0x1;_0x2c74a1[_0x4c13('0xe2')]+=0x1;_0x2c74a1[_0x4c13('0x9f')]=ut[_0x4c13('0xa0')](_0x2c74a1);ut[_0x4c13('0x8f')](_0x2c74a1,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x2c74a1,_0x4c13('0xe3'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984[_0x4c13('0xa6')]){_0x29e007=ut['cloneAction'](_0x2c74a1,0xf,_0x4c13('0xa8'));rpcDb[_0x4c13('0xaa')](_0x29e007,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2c74a1['countabandonedetry']>=_0x22a984[_0x4c13('0xe4')]){rpcDb['createCustomerFinal'](_0x2c74a1,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x4c13('0xac')](ut['scheduledAt'](_0x2c74a1,_0x4c13('0xe2'),_0x22a984[_0x4c13('0xe5')]),_0x2c74a1['unlockAgent'],_0x2c74a1[_0x4c13('0xb1')]);}}break;default:if(_0x2c74a1[_0x4c13('0x75')]){ut[_0x4c13('0xbe')](_0x22a984,_0x4c13('0xe6'));ut['loggerError'](_0x4c13('0xe7')+_0x22a984[_0x4c13('0x2f')],_0xb5bbae);}_0x22a984[_0x4c13('0x48')]+=0x1;_0x2c74a1[_0x4c13('0x9f')]=ut['totalGlobal'](_0x2c74a1);ut['logCustomer'](_0x2c74a1,0xc,_0xb5bbae[_0x4c13('0xe8')]||_0xb5bbae[_0x4c13('0xe9')]);rpcDb[_0x4c13('0x93')](_0x2c74a1,_0x4c13('0xea'));if(ut[_0x4c13('0xa0')](_0x2c74a1)>=_0x22a984[_0x4c13('0xa6')]){_0x29e007=ut[_0x4c13('0xa7')](_0x2c74a1,0xf,_0x4c13('0xa8'));rpcDb[_0x4c13('0xaa')](_0x29e007,_0x4c13('0xeb'));}else{rpcDb['createCustomerFinal'](_0x2c74a1,_0x4c13('0xeb'));}delete this[_0x4c13('0x19')][_0xb5bbae[_0x4c13('0xb2')]];}if(!(_0x2c74a1[_0x4c13('0x75')]&&_0x1ed743==='16')){ut[_0x4c13('0x7d')](_0x22a984,_0x4c13('0xec'));logger['info'](_0x4c13('0xed'),_0x2c74a1[_0x4c13('0xb6')],_0x4c13('0xb7'),_0x22a984[_0x4c13('0x2f')],'originated:\x20',_0x22a984[_0x4c13('0x54')]);}if(_0x1ed743!==_0x4c13('0xee')){delete this['actions'][_0xb5bbae[_0x4c13('0xb2')]];delete this['actions'][_0xb5bbae[_0x4c13('0xef')]];}}};Preview['prototype'][_0x4c13('0xf0')]=function(_0x376fdc,_0x22ef84,_0x1a7b12){if(_[_0x4c13('0xf1')](_0x22ef84)&&_0x4c13('0xf2')!==typeof _0x22ef84){return;}if(_[_0x4c13('0xf1')](_0x1a7b12)&&_0x4c13('0xf2')!==typeof _0x1a7b12){return;}switch(_0x1a7b12[_0x4c13('0xf3')]){case'0':ut[_0x4c13('0xf4')](_0x376fdc,0x0,_0x4c13('0xa1'));rpcDb[_0x4c13('0xf5')](_0x376fdc,_0x4c13('0xf6'));break;case'3':ut['logAgent'](_0x376fdc,0x3,_0x4c13('0xce'));rpcDb[_0x4c13('0xf5')](_0x376fdc,_0x4c13('0xf7'));break;case'5':ut[_0x4c13('0xf4')](_0x376fdc,0x5,_0x4c13('0xc5'));rpcDb[_0x4c13('0xf5')](_0x376fdc,_0x4c13('0xf8'));break;case'8':ut['logAgent'](_0x376fdc,0x8,_0x4c13('0xf9'));rpcDb[_0x4c13('0xf5')](_0x376fdc,_0x4c13('0xfa'));break;case'22':ut[_0x4c13('0xf4')](_0x376fdc,0x16,_0x4c13('0xfb'));rpcDb['createAgentHistory'](_0x376fdc,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x4c13('0xf4')](_0x376fdc,0xc,_0x1a7b12[_0x4c13('0xf3')]);rpcDb[_0x4c13('0xf5')](_0x376fdc,_0x4c13('0xfa'));}ut[_0x4c13('0x7d')](_0x22ef84,_0x4c13('0xfc'));logger[_0x4c13('0x5e')]('[originated][decrement][callProgressDetectingAgent]',_0x376fdc[_0x4c13('0xb6')],_0x4c13('0xb7'),_0x22ef84[_0x4c13('0x2f')],'originated:\x20',_0x22ef84['originated']);delete this['actions'][_0x376fdc[_0x4c13('0xb6')]];};Preview[_0x4c13('0x11')][_0x4c13('0xfd')]=function(_0x1c6602,_0x5a48ba,_0x1f0f5f,_0x32d476,_0x3d3909){var _0x174bb3=this;return new BPromise(function(_0x26cba9,_0x24fcb2){if(_[_0x4c13('0x70')](_0x5a48ba)||_[_0x4c13('0x70')](_0x5a48ba['Contact'])||_[_0x4c13('0x70')](_0x5a48ba['Contact']['phone'])||_[_0x4c13('0x70')](_0x5a48ba[_0x4c13('0xfe')])){_0x24fcb2(ut[_0x4c13('0x53')]('Contact\x20is\x20undefined',_0x32d476,_0x3d3909));return;}var _0x69d47a=uuid['v4']();var _0x50e940=_0x174bb3[_0x4c13('0x16')][_0x5a48ba[_0x4c13('0x71')]['name']];var _0x289d84=_0x1f0f5f?_0x174bb3['agents'][_0x1f0f5f]['id']:undefined;_0x174bb3[_0x4c13('0x19')][_0x69d47a]=new Action(_0x5a48ba,_0x50e940,_0x69d47a,_0x1f0f5f,_0x289d84);var _0x363bc7=_0x174bb3[_0x4c13('0x19')][_0x69d47a];_0x363bc7[_0x4c13('0xb0')]=_0x32d476;_0x363bc7[_0x4c13('0xb1')]=_0x3d3909;_0x363bc7[_0x4c13('0xff')]=_0x1f0f5f;if(_[_0x4c13('0x100')](_0x1c6602)){_0x174bb3[_0x4c13('0x101')](_0x363bc7,_0x50e940,_0x5a48ba,_0x1f0f5f)[_0x4c13('0x84')](function(_0x527f4e){logger[_0x4c13('0x5e')]('[Preview][execCall][success]',_0x4c13('0x102')+_0x363bc7[_0x4c13('0x73')]+_0x4c13('0x103')+_0x363bc7[_0x4c13('0x104')],JSON[_0x4c13('0x60')](_0x527f4e));ami[_0x4c13('0x2c')]('custom:agentcalled',ut[_0x4c13('0xa3')](_0x363bc7,'called'));_0x26cba9(ut[_0x4c13('0x53')]('Calling'));})[_0x4c13('0x7c')](function(_0x68aee2){ut['logger'](_0x4c13('0x105'),_0x68aee2);_0x24fcb2(ut[_0x4c13('0x53')](_0x4c13('0x106'),_0x32d476,_0x3d3909));});}else{_0x50e940[_0x4c13('0x3e')]+=0x1;ut[_0x4c13('0x107')](_0x363bc7);rpcDb[_0x4c13('0x108')](_0x363bc7,'[Blacklist][error]');delete _0x174bb3[_0x4c13('0x19')][_0x69d47a];_0x24fcb2(ut[_0x4c13('0x53')]('Contact\x20in\x20black\x20List',_0x32d476,_0x3d3909));}});};Preview[_0x4c13('0x11')]['isTrunkReachable']=function(_0x123d82){return!_[_0x4c13('0x70')](_0x123d82)&&!_['isNil'](_0x123d82['name'])&&!_[_0x4c13('0x70')](_0x123d82[_0x4c13('0x109')])&&_0x123d82[_0x4c13('0x109')]&&!_['isNil'](this[_0x4c13('0x18')][util[_0x4c13('0x8e')](_0x4c13('0x10a'),_0x123d82[_0x4c13('0x2f')])])&&!_[_0x4c13('0x70')](this[_0x4c13('0x18')][util['format'](_0x4c13('0x10a'),_0x123d82[_0x4c13('0x2f')])][_0x4c13('0x7a')])&&(this[_0x4c13('0x18')][util[_0x4c13('0x8e')](_0x4c13('0x10a'),_0x123d82[_0x4c13('0x2f')])][_0x4c13('0x7a')]===_0x4c13('0x10b')||this[_0x4c13('0x18')][util['format'](_0x4c13('0x10a'),_0x123d82[_0x4c13('0x2f')])]['status']==='unmonitored');};Preview['prototype']['run']=function(_0x594a58,_0x44e755){var _0x112a5c=this;return new BPromise(function(_0x5ca24b,_0x15b971){_0x112a5c[_0x4c13('0x10c')](_0x594a58,_0x44e755)['then'](function(_0x45175e){_0x5ca24b(_[_0x4c13('0x76')](_0x45175e,['message']));})['catch'](function(_0x5e28fb){if(_0x5e28fb[_0x4c13('0x10d')]){rpcDb[_0x4c13('0x10e')](_0x594a58);}if(_0x5e28fb[_0x4c13('0x109')]){rpcDb[_0x4c13('0x8d')](_0x594a58);}_0x15b971(_['pick'](_0x5e28fb,[_0x4c13('0x53')]));});});};Preview[_0x4c13('0x11')]['execRun']=function(_0x6c10d9,_0x34699e){var _0x463148=this;return new BPromise(function(_0x308e31,_0x28b152){var _0x5823f9,_0x2912c7;rpcDb[_0x4c13('0x10f')](_0x6c10d9)[_0x4c13('0x84')](function(_0x5c2ea1){if(!_[_0x4c13('0x70')](_0x5c2ea1[0x0])){_0x2912c7=_0x5c2ea1[0x0][_0x4c13('0x110')]?![]:!![];_0x5823f9=_0x5c2ea1[0x0]['recallme']?!![]:![];_0x5823f9=_0x34699e?!![]:_0x5823f9;}var _0x12e324=_0x463148[_0x4c13('0x111')](_0x5c2ea1);if(_0x12e324['isValid']){rpcDb[_0x4c13('0x112')](_[_0x4c13('0x76')](_0x5c2ea1[0x0],[_0x4c13('0xfe'),_0x4c13('0x113')]))[_0x4c13('0x84')](function(_0x191ddc){_0x463148['checkInBlack'](_0x191ddc,_0x5c2ea1[0x0],_0x34699e,_0x2912c7,_0x5823f9)[_0x4c13('0x84')](function(_0x1d0eae){_0x308e31(_0x1d0eae);})[_0x4c13('0x7c')](function(_0x6dab95){_0x28b152(_0x6dab95);});})[_0x4c13('0x7c')](function(_0x4f612a){ut[_0x4c13('0x64')](_0x4c13('0x114'),_0x4f612a);_0x28b152(ut[_0x4c13('0x53')](_0x4c13('0x115'),_0x2912c7,_0x5823f9));});}else{_0x28b152(ut[_0x4c13('0x53')](_0x12e324[_0x4c13('0x53')],_0x2912c7,_0x5823f9));}})[_0x4c13('0x7c')](function(_0x1c54d2){ut[_0x4c13('0x64')](_0x4c13('0x116'),_0x1c54d2);_0x28b152(ut['message'](_0x4c13('0x115'),![],!![]));});});};Preview[_0x4c13('0x11')][_0x4c13('0x111')]=function(_0x40adf5){if(_[_0x4c13('0x70')](_0x40adf5)||_[_0x4c13('0x100')](_0x40adf5)||!_[_0x4c13('0x70')](_0x40adf5[0x0][_0x4c13('0x89')])&&_['isNil'](_0x40adf5[0x0][_0x4c13('0x89')]['name'])){ut[_0x4c13('0x64')]('[Preview][validateContact][Empty\x20Contact]',_0x40adf5);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x1154bb=this['campaignsPreview'][_0x40adf5[0x0][_0x4c13('0x71')][_0x4c13('0x2f')]];_0x1154bb[_0x4c13('0x53')]=_0x4c13('0x9d');if(_[_0x4c13('0x70')](_0x1154bb)){ut['logger'](_0x4c13('0x117'),_0x1154bb);return{'isValid':![],'message':_0x4c13('0x118')};}if(!this[_0x4c13('0x9a')](_0x1154bb[_0x4c13('0x5b')])){ut[_0x4c13('0x64')](_0x4c13('0x119'),_0x4c13('0x11a')+_0x1154bb[_0x4c13('0x2f')]+_0x4c13('0x11b'));if(!this[_0x4c13('0x9a')](_0x1154bb[_0x4c13('0x9b')])){ut[_0x4c13('0x64')](_0x4c13('0x119'),_0x1154bb[_0x4c13('0x2f')]+_0x4c13('0x11c'));return{'isValid':![],'message':_0x4c13('0x11d')};}}if(!ut[_0x4c13('0x11e')](_0x1154bb[_0x4c13('0x6d')])){ut[_0x4c13('0x64')]('[Preview][validateContact][Campaign\x20Active]',_0x1154bb[_0x4c13('0x2f')]+'\x20Not\x20Active');return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x1154bb[_0x4c13('0x2f')]+_0x4c13('0x11f')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x4c13('0x11')][_0x4c13('0x101')]=function(_0x389a04,_0x13b018,_0x2f5c0e,_0x44f6bd){var _0x1804a2=this;return new BPromise(function(_0x16100b,_0x2932b0){var _0x435832=_0x389a04[_0x4c13('0xb6')];var _0x3be90c=_0x1804a2[_0x4c13('0x9a')](_0x13b018[_0x4c13('0x5b')])?util[_0x4c13('0x8e')](_0x4c13('0x120'),_0x13b018[_0x4c13('0x5b')][_0x4c13('0x2f')],_['isNil'](_0x13b018[_0x4c13('0x121')])?'':_0x13b018[_0x4c13('0x121')][_0x4c13('0x122')]()||'',_0x13b018[_0x4c13('0x123')]>0x0?_0x2f5c0e[_0x4c13('0x124')]['phone']['substring'](_0x13b018[_0x4c13('0x123')]):_0x2f5c0e[_0x4c13('0x124')][_0x4c13('0x125')]):util[_0x4c13('0x8e')](_0x4c13('0x120'),_[_0x4c13('0x70')](_0x13b018[_0x4c13('0x9b')])?_0x13b018['Trunk'][_0x4c13('0x2f')]:_0x13b018['TrunkBackup'][_0x4c13('0x2f')],_[_0x4c13('0x70')](_0x13b018[_0x4c13('0x121')])?'':_0x13b018['dialPrefix'][_0x4c13('0x122')]()||'',_0x13b018[_0x4c13('0x123')]>0x0?_0x2f5c0e[_0x4c13('0x124')][_0x4c13('0x125')]['substring'](_0x13b018[_0x4c13('0x123')]):_0x2f5c0e['Contact'][_0x4c13('0x125')]);var _0x3d6fbd=_0x1804a2['isTrunkReachable'](_0x13b018[_0x4c13('0x5b')])?ut['getCallerId'](_0x13b018['Trunk'][_0x4c13('0x5c')],_0x13b018[_0x4c13('0x3b')],_0x13b018[_0x4c13('0x126')]>0x0?ut[_0x4c13('0x127')](_0x13b018['dialOriginateCallerIdNumber'],_0x13b018[_0x4c13('0x126')]):_0x13b018[_0x4c13('0x3c')]):ut['getCallerId'](_[_0x4c13('0x70')](_0x13b018[_0x4c13('0x9b')])?_0x13b018[_0x4c13('0x5b')]['callerid']:_0x13b018['TrunkBackup'][_0x4c13('0x5c')],_0x13b018[_0x4c13('0x3b')],_0x13b018[_0x4c13('0x126')]>0x0?ut[_0x4c13('0x127')](_0x13b018[_0x4c13('0x3c')],_0x13b018[_0x4c13('0x126')]):_0x13b018['dialOriginateCallerIdNumber']);if(_0x3d6fbd){_0x389a04[_0x4c13('0x128')]=ut[_0x4c13('0x129')](_0x3d6fbd);_0x389a04[_0x4c13('0x12a')]=ut[_0x4c13('0x12b')](_0x3d6fbd);}var _0x10d115=ut['addVariables'](_0x13b018,_0x2f5c0e,_0x3be90c,_0x3d6fbd,_0x435832,_0x389a04);_[_0x4c13('0x12c')](_0x389a04,ut[_0x4c13('0x12d')](_0x10d115));_0x389a04['starttime']=moment()[_0x4c13('0x8e')](_0x4c13('0xb3'));ami[_0x4c13('0x79')](ut['variablesAction'](_0x389a04,_0x13b018,_0x10d115,_0x389a04[_0x4c13('0xb1')],_0x44f6bd))[_0x4c13('0x84')](function(_0xbeb25d){_0x13b018[_0x4c13('0x54')]+=0x1;logger[_0x4c13('0x5e')]('[originated][increment]',_0x435832,_0x4c13('0xb7'),_0x13b018[_0x4c13('0x2f')],_0x4c13('0x72'),_0x13b018[_0x4c13('0x54')]);_0x16100b(_0xbeb25d);})[_0x4c13('0x7c')](function(_0x51c5f3){ut[_0x4c13('0xf4')](_0x389a04,0xe,'OriginateError');rpcDb[_0x4c13('0xf5')](_0x389a04,_0x4c13('0x12e'));_0x2932b0(_0x51c5f3);});});};Preview['prototype'][_0x4c13('0x25')]=function(_0x3e71d2){if(this[_0x4c13('0x19')][_0x3e71d2[_0x4c13('0xb2')]]){this[_0x4c13('0x19')][_0x3e71d2[_0x4c13('0xb2')]][_0x4c13('0x7b')]=_0x3e71d2[_0x4c13('0x7b')];}};Preview[_0x4c13('0x11')]['syncOriginateResponse']=function(_0x1fbb61){var _0x5c4c57=this;var _0x52834d=this[_0x4c13('0x19')][_0x1fbb61[_0x4c13('0x12f')]];if(_0x52834d){if(_0x52834d[_0x4c13('0xff')]&&this['agents'][_0x52834d[_0x4c13('0xff')]]){ut[_0x4c13('0x130')](_0x52834d,this['agents'][_0x52834d[_0x4c13('0xff')]]['name'],this[_0x4c13('0x1a')][_0x52834d[_0x4c13('0xff')]]['id']);}var _0x5eabcd=_[_0x4c13('0x131')](_0x52834d);_0x5eabcd[_0x4c13('0xb4')]=moment()[_0x4c13('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3b2682=_0x5c4c57['campaignsPreview'][_0x52834d[_0x4c13('0x73')]];if(ut[_0x4c13('0x132')](_0x1fbb61[_0x4c13('0x133')])){if(_0x52834d['unlockAgent']){rpcDb[_0x4c13('0x10e')](_0x52834d[_0x4c13('0x104')]);}if(_0x52834d['activeContact']){rpcDb['disableContact'](_0x52834d[_0x4c13('0x104')]);}ami[_0x4c13('0x2c')](_0x4c13('0x134'),ut['buildObj'](_0x52834d,_0x4c13('0x135')));this['callProgressDetectingAgent'](_0x5eabcd,_0x3b2682,_0x1fbb61);}else{_0x52834d[_0x4c13('0x136')]=moment()[_0x4c13('0x8e')](_0x4c13('0xb3'));ut[_0x4c13('0xf4')](_0x5eabcd,0x4,_0x4c13('0x137'));rpcDb['createAgentHistory'](_0x5eabcd,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x4c13('0x11')][_0x4c13('0x1f')]=function(_0x2e8998){var _0x50b23a=this;var _0x414b1c=this[_0x4c13('0x19')][_0x2e8998[_0x4c13('0xb2')]];var _0x1d09c4;if(_0x414b1c){_0x1d09c4=this[_0x4c13('0x16')][_0x414b1c[_0x4c13('0x73')]];logger[_0x4c13('0x5e')](_0x4c13('0x138'),_0x2e8998['linkedid'],_0x4c13('0xb7'),_0x1d09c4[_0x4c13('0x2f')],_0x4c13('0x74'),_0x1d09c4[_0x4c13('0x33')]);}if(this[_0x4c13('0x19')][_0x2e8998[_0x4c13('0xb2')]]&&_0x2e8998['linkedid']!==_0x2e8998[_0x4c13('0xb6')]){if(_0x2e8998[_0x4c13('0x139')]==='16'&&this['actions'][_0x2e8998[_0x4c13('0xb2')]]['dialAnswer']){this[_0x4c13('0x9e')](_0x2e8998,_0x2e8998[_0x4c13('0xb2')],_0x2e8998[_0x4c13('0x139')]);}else if(this[_0x4c13('0x19')][_0x2e8998[_0x4c13('0xb2')]][_0x4c13('0x75')]){logger[_0x4c13('0x5e')](_0x4c13('0x13a'),_0x2e8998[_0x4c13('0xb2')],_0x2e8998[_0x4c13('0x139')],_0x4c13('0xb7'),_0x1d09c4[_0x4c13('0x2f')],_0x4c13('0x74'),_0x1d09c4[_0x4c13('0x33')]);this[_0x4c13('0x9e')](_0x2e8998,_0x2e8998[_0x4c13('0xb2')],_0x2e8998['cause']);}}else if(_0x414b1c&&_[_0x4c13('0x70')](_0x414b1c[_0x4c13('0x13b')])&&_0x1d09c4[_0x4c13('0x13c')]&&_0x2e8998['linkedid']===_0x2e8998[_0x4c13('0xb6')]&&_[_0x4c13('0x70')](_0x2e8998['reason'])&&_0x2e8998[_0x4c13('0x139')]==='16'&&_0x2e8998[_0x4c13('0x13d')]==='6'&&_['isUndefined'](_0x414b1c[_0x4c13('0x13e')])){if(_0x414b1c[_0x4c13('0xb0')]){rpcDb[_0x4c13('0x10e')](_0x414b1c['idContact']);}if(_0x414b1c['activeContact']){rpcDb['disableContact'](_0x414b1c['idContact']);}_0x2e8998[_0x4c13('0xf3')]='22';this['callProgressDetectingAgent'](_0x414b1c,_0x1d09c4,_0x2e8998);}else if(_0x414b1c&&_0x414b1c['transfer']){if(_0x2e8998[_0x4c13('0x139')]==='16'&&this[_0x4c13('0x19')][_0x2e8998[_0x4c13('0xb2')]][_0x4c13('0x75')]){logger[_0x4c13('0x5e')](_0x4c13('0x13f'),_0x2e8998[_0x4c13('0xb2')],_0x2e8998[_0x4c13('0x139')],_0x4c13('0xb7'),_0x1d09c4[_0x4c13('0x2f')],'pTalking:\x20',_0x1d09c4[_0x4c13('0x33')]);this['callProgressDetectingCustomer'](_0x2e8998,_0x2e8998[_0x4c13('0xb2')],_0x2e8998[_0x4c13('0x139')]);}else if(this['actions'][_0x2e8998[_0x4c13('0xb2')]]['dialAnswer']){logger['info'](_0x4c13('0x13a'),_0x2e8998[_0x4c13('0xb2')],_0x2e8998[_0x4c13('0x139')],_0x4c13('0xb7'),_0x1d09c4['name'],_0x4c13('0x74'),_0x1d09c4[_0x4c13('0x33')]);this[_0x4c13('0x9e')](_0x2e8998,_0x2e8998[_0x4c13('0xb2')],_0x2e8998[_0x4c13('0x139')]);}}};Preview[_0x4c13('0x11')]['syncDialEnd']=function(_0x1b8e64){if(this[_0x4c13('0x19')][_0x1b8e64[_0x4c13('0xef')]]&&_0x1b8e64['destlinkedid']!==_0x1b8e64['destuniqueid']){this[_0x4c13('0x9e')](_0x1b8e64,_0x1b8e64['destlinkedid'],_0x1b8e64[_0x4c13('0xe9')]);}};Preview[_0x4c13('0x11')]['syncHangupRequest']=function(_0x5b7d4c){if(this[_0x4c13('0x19')][_0x5b7d4c[_0x4c13('0xb2')]]&&_0x5b7d4c[_0x4c13('0xb2')]!==_0x5b7d4c[_0x4c13('0xb6')]&&!this[_0x4c13('0x19')][_0x5b7d4c[_0x4c13('0xb2')]][_0x4c13('0x75')]){if(_0x5b7d4c['cause']==='1'){this[_0x4c13('0x9e')](_0x5b7d4c,_0x5b7d4c[_0x4c13('0xb2')],_0x5b7d4c[_0x4c13('0x139')]);}}};Preview[_0x4c13('0x11')][_0x4c13('0x140')]=function(_0x316ad3,_0x223c79,_0x5c954e){if(this[_0x4c13('0x19')][_0x316ad3]){if(_['isNil'](this[_0x4c13('0x19')][_0x316ad3][_0x4c13('0x141')])){this[_0x4c13('0x19')][_0x316ad3]['variables']={};}this[_0x4c13('0x19')][_0x316ad3][_0x4c13('0x141')][_0x223c79]=_0x5c954e;}};Preview[_0x4c13('0x11')][_0x4c13('0x142')]=function(_0x318309){try{if(!_[_0x4c13('0x70')](_0x318309)){if(ut[_0x4c13('0x143')](_[_0x4c13('0x144')](_0x318309[_0x4c13('0x145')])[0x0])){this['addVariable'](_0x318309[_0x4c13('0xb6')],_[_0x4c13('0x144')](_0x318309[_0x4c13('0x145')])[0x0],_0x318309[_0x4c13('0x146')]);}}}catch(_0x19cbc1){logger[_0x4c13('0x147')](_0x4c13('0x148'),util['inspect'](_0x19cbc1,{'showHidden':![],'depth':null}));}};Preview[_0x4c13('0x11')]['syncAttendedTransfer']=function(_0x2e9d36){if(_0x2e9d36){if(this['actions'][_0x2e9d36['transfertargetlinkedid']]){this[_0x4c13('0x19')][_0x2e9d36[_0x4c13('0x149')]][_0x4c13('0x13e')]=!![];}}};Preview[_0x4c13('0x11')]['syncBlindTransfer']=function(_0x2cb47f){if(_0x2cb47f){if(this['actions'][_0x2cb47f[_0x4c13('0x14a')]]){this[_0x4c13('0x19')][_0x2cb47f[_0x4c13('0x14a')]]['transfer']=!![];}}};module[_0x4c13('0x14b')]=Preview; \ No newline at end of file +var _0x3f68=['[callProgressDetectingAgent]','checkInBlack','isNil','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','then','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','pick','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','phone','substring','dialCutDigit','TrunkBackup','trim','getCallerId','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','originatecalleridname','originatecalleridnum','addVariables','merge','toLowerVariables','YYYY-MM-DD\x20HH:mm:ss','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','rejected','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','unlockContact','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','variable','keys','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','md5','ioredis','../../../config/logger','preview','../ami','./action','./util/util','redis','defaults','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumHoldTime','total','unmanaged','abandoned','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','Interval','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','paused','logger','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','hasOwnProperty','dialMethod','booked','dialActive','setMessage','[clearZombieChannels][talking]','Queue','queue','stringify','pTalking:\x20','dialAnswer','UserId','VoiceQueueId','ListId','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','size','clearZombieChannel','recallMe','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryRecallClose]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','uniqueid','\x20Queue','custom:agentconnect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','BUSY','countbusyretry','Busy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','createCustomerFinal','rescheduleContact','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','countnoanswerretry','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','isUndefined','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3f68,0x1aa));var _0x83f6=function(_0x316a70,_0x4b153b){_0x316a70=_0x316a70-0x0;var _0x47de08=_0x3f68[_0x316a70];return _0x47de08;};'use strict';var util=require(_0x83f6('0x0'));var _=require(_0x83f6('0x1'));var BPromise=require('bluebird');var uuid=require(_0x83f6('0x2'));var moment=require(_0x83f6('0x3'));var md5=require(_0x83f6('0x4'));var Redis=require(_0x83f6('0x5'));var config=require('../../../config/environment');var logger=require(_0x83f6('0x6'))(_0x83f6('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x83f6('0x8'));var rpcDb=require('./rpcDb');var Action=require(_0x83f6('0x9'));var ut=require(_0x83f6('0xa'));config[_0x83f6('0xb')]=_[_0x83f6('0xc')](config[_0x83f6('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x83f6('0xd'))(new Redis(config[_0x83f6('0xb')]));var Sequence=function(){};Sequence[_0x83f6('0xe')][_0x83f6('0xf')]=function(_0x15c394){this[_0x83f6('0x10')]=this[_0x83f6('0x10')]?this[_0x83f6('0x10')]['finally'](_0x15c394):_0x15c394();};function Preview(_0x52a6dd){this[_0x83f6('0x11')]=new Sequence();this[_0x83f6('0x12')]=_0x52a6dd[_0x83f6('0x13')];this[_0x83f6('0x14')]=_0x52a6dd[_0x83f6('0x14')];this[_0x83f6('0x15')]={};this['agents']=_0x52a6dd[_0x83f6('0x16')];this[_0x83f6('0x17')]=0x0;ami['on'](_0x83f6('0x18'),this[_0x83f6('0x19')][_0x83f6('0x1a')](this));ami['on'](_0x83f6('0x1b'),this[_0x83f6('0x1c')][_0x83f6('0x1a')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x83f6('0x1a')](this));ami['on'](_0x83f6('0x1d'),this[_0x83f6('0x1e')][_0x83f6('0x1a')](this));ami['on'](_0x83f6('0x1f'),this[_0x83f6('0x20')][_0x83f6('0x1a')](this));ami['on'](_0x83f6('0x21'),this[_0x83f6('0x22')][_0x83f6('0x1a')](this));ami['on'](_0x83f6('0x23'),this[_0x83f6('0x24')][_0x83f6('0x1a')](this));ami['on'](_0x83f6('0x25'),this[_0x83f6('0x26')][_0x83f6('0x1a')](this));this[_0x83f6('0x27')](this['campaignsPreview']);}function emit(_0x2ab494,_0xfe248,_0x2e489c){io['to'](_0x2ab494)[_0x83f6('0x28')](_0xfe248,_0x2e489c);}function emitCampaignPreview(_0x5ac13c){if(_0x5ac13c[_0x83f6('0x29')]===_0x83f6('0x2a')){var _0x53c727={'id':_0x5ac13c['id'],'name':_0x5ac13c['name'],'strategy':_0x5ac13c[_0x83f6('0x2b')],'answered':_0x5ac13c[_0x83f6('0x2c')],'available':_0x5ac13c[_0x83f6('0x2d')],'loggedIn':_0x5ac13c[_0x83f6('0x2e')],'pTalking':_0x5ac13c[_0x83f6('0x2f')],'sumBillable':_0x5ac13c['sumBillable'],'sumDuration':_0x5ac13c['sumDuration'],'sumHoldTime':_0x5ac13c[_0x83f6('0x30')]||0x0,'talking':_0x5ac13c['talking'],'total':_0x5ac13c[_0x83f6('0x31')],'type':_0x5ac13c[_0x83f6('0x29')],'unmanaged':_0x5ac13c[_0x83f6('0x32')],'abandoned':_0x5ac13c[_0x83f6('0x33')],'waiting':_0x5ac13c['waiting'],'loggedInDb':_0x5ac13c['loggedInDb'],'dialActive':_0x5ac13c['dialActive'],'dialMethod':_0x5ac13c['dialMethod'],'dialOriginateCallerIdName':_0x5ac13c['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5ac13c[_0x83f6('0x34')],'dialOriginateTimeout':_0x5ac13c[_0x83f6('0x35')],'dialPrefix':_0x5ac13c['dialPrefix'],'outboundAnswerAgiCallsDay':_0x5ac13c[_0x83f6('0x36')],'outboundAnswerCallsDay':_0x5ac13c[_0x83f6('0x37')],'outboundBlacklistCallsDay':_0x5ac13c['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5ac13c[_0x83f6('0x38')],'outboundCongestionCallsDay':_0x5ac13c[_0x83f6('0x39')],'outboundDropCallsDayACS':_0x5ac13c[_0x83f6('0x3a')],'outboundDropCallsDayCallersExit':_0x5ac13c[_0x83f6('0x3b')],'outboundDropCallsDayTimeout':_0x5ac13c['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5ac13c[_0x83f6('0x3c')],'outboundNoSuchCallsDay':_0x5ac13c[_0x83f6('0x3d')],'outboundOriginateFailureCallsDay':_0x5ac13c[_0x83f6('0x3e')],'outboundReCallsDay':_0x5ac13c['outboundReCallsDay'],'outboundRejectCallsDay':_0x5ac13c['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x5ac13c[_0x83f6('0x3f')],'outboundAbandonedCallsDay':_0x5ac13c['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x5ac13c[_0x83f6('0x40')],'predictiveIntervalAvgHoldtime':_0x5ac13c[_0x83f6('0x41')],'predictiveIntervalAvgTalktime':_0x5ac13c[_0x83f6('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x5ac13c[_0x83f6('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x5ac13c[_0x83f6('0x44')],'predictiveIntervalErlangCalls':_0x5ac13c[_0x83f6('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x5ac13c[_0x83f6('0x46')],'predictiveIntervalHitRate':_0x5ac13c[_0x83f6('0x47')],'predictiveIntervalMultiplicativeFactor':_0x5ac13c[_0x83f6('0x48')],'predictiveIntervalPauses':_0x5ac13c[_0x83f6('0x49')],'predictiveIntervalAvailable':_0x5ac13c[_0x83f6('0x4a')],'predictiveIntervalTotalCalls':_0x5ac13c['predictiveIntervalTotalCalls'],'message':_0x5ac13c[_0x83f6('0x4b')],'originated':_0x5ac13c[_0x83f6('0x4c')],'erlangCalls':_0x5ac13c[_0x83f6('0x4d')],'erlangCallToSecond':_0x5ac13c[_0x83f6('0x4e')],'erlangAbandonmentRate':_0x5ac13c[_0x83f6('0x4f')],'erlangBusyFactor':_0x5ac13c[_0x83f6('0x50')],'startPredictive':_0x5ac13c[_0x83f6('0x51')],'startProgressive':_0x5ac13c[_0x83f6('0x52')]};if(_0x5ac13c[_0x83f6('0x53')]){_0x53c727[_0x83f6('0x53')]={'id':_0x5ac13c[_0x83f6('0x53')]['id'],'name':_0x5ac13c[_0x83f6('0x53')][_0x83f6('0x54')],'active':_0x5ac13c[_0x83f6('0x53')][_0x83f6('0x55')],'callerid':_0x5ac13c[_0x83f6('0x53')][_0x83f6('0x56')]};}if(_0x5ac13c['Interval']){_0x53c727[_0x83f6('0x57')]={'id':_0x5ac13c[_0x83f6('0x57')]['id'],'name':_0x5ac13c[_0x83f6('0x57')][_0x83f6('0x54')]};}var _0x428a76=md5(JSON['stringify'](_0x53c727));if(_0x5ac13c['md5']!==_0x428a76){_0x5ac13c[_0x83f6('0x4')]=_0x428a76;emit(util[_0x83f6('0x58')]('voice:queue:%s',_0x53c727[_0x83f6('0x54')]),'voice_queue:save',_0x53c727);}}}function emitVoiceQueueChannelRemove(_0x2e085d){logger[_0x83f6('0x59')](_0x83f6('0x5a'),JSON['stringify'](_0x2e085d));emit(util[_0x83f6('0x58')](_0x83f6('0x5b'),_0x2e085d[_0x83f6('0x54')]),_0x83f6('0x5c'),_0x2e085d);}function notSendMessagesQueue(_0x26ea37){if(_0x26ea37['sendMessageOneNotActive']){if(_0x26ea37[_0x83f6('0x4c')]===0x0&&_0x26ea37[_0x83f6('0x2f')]===0x0){_0x26ea37['sendMessageOneNotActive']=![];_0x26ea37[_0x83f6('0x2d')]=0x0;_0x26ea37[_0x83f6('0x5d')]=0x0;_0x26ea37['message']='NOT_ACTIVE';ut[_0x83f6('0x5e')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x26ea37[_0x83f6('0x54')]+'\x20is\x20not\x20active');}else{_0x26ea37[_0x83f6('0x4b')]=_0x83f6('0x5f');ut[_0x83f6('0x5e')](_0x83f6('0x60'),_0x26ea37[_0x83f6('0x54')]+_0x83f6('0x61'));}emitCampaignPreview(_0x26ea37);}}Preview[_0x83f6('0xe')][_0x83f6('0x27')]=function(){var _0x3cfd73=this;setInterval(function(){_0x3cfd73['syncCampaigns']();},0x7cf);};Preview[_0x83f6('0xe')][_0x83f6('0x62')]=function(){var _0x50c8b1=this[_0x83f6('0x12')];this[_0x83f6('0x17')]+=0x1;for(var _0x12c424 in _0x50c8b1){if(_0x50c8b1[_0x83f6('0x63')](_0x12c424)&&(_0x50c8b1[_0x12c424][_0x83f6('0x64')]===_0x83f6('0x7')||_0x50c8b1[_0x12c424][_0x83f6('0x64')]===_0x83f6('0x65'))&&_0x50c8b1[_0x12c424][_0x83f6('0x29')]===_0x83f6('0x2a')){if(this['clockClearZombieChannels']>0x7){this[_0x83f6('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x50c8b1['hasOwnProperty'](_0x12c424)&&_0x50c8b1[_0x12c424]['dialMethod']===_0x83f6('0x7')&&_0x50c8b1[_0x12c424][_0x83f6('0x29')]===_0x83f6('0x2a')){if(_0x50c8b1[_0x12c424][_0x83f6('0x66')]){this[_0x83f6('0x67')](_0x50c8b1[_0x12c424]);this['recallMe'](_0x50c8b1[_0x12c424]);}else{notSendMessagesQueue(_0x50c8b1[_0x12c424]);}}}};Preview[_0x83f6('0xe')]['clearZombieChannel']=function(_0x4ab0e5){var _0x5f124d=this;this[_0x83f6('0x11')][_0x83f6('0xf')](function(){if(!_['isNil'](_0x5f124d[_0x83f6('0x15')][_0x4ab0e5])){loggerAction[_0x83f6('0x59')](_0x83f6('0x68'),_0x4ab0e5,_0x83f6('0x69'),_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x6a')],'originated:\x20',JSON[_0x83f6('0x6b')](_0x5f124d[_0x83f6('0x12')][_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x6a')]][_0x83f6('0x4c')]),_0x83f6('0x6c'),JSON[_0x83f6('0x6b')](_0x5f124d[_0x83f6('0x12')][_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x6a')]][_0x83f6('0x2f')]),JSON['stringify'](_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x6d')]),JSON[_0x83f6('0x6b')](_['pick'](_0x5f124d['actions'][_0x4ab0e5],['contactId',_0x83f6('0x6e'),_0x83f6('0x6f'),_0x83f6('0x70')])));return ami['Action']({'action':_0x83f6('0x71'),'channel':_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x72')]})[_0x83f6('0x73')](function(_0x1ce6de){if(_0x1ce6de[_0x83f6('0x4b')]===_0x83f6('0x74')){setTimeout(function(){if(_0x5f124d[_0x83f6('0x15')][_0x4ab0e5]){ut['updateOriginated'](_0x5f124d['campaignsPreview'][_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x6a')]],_0x83f6('0x75'));if(_0x5f124d[_0x83f6('0x15')][_0x4ab0e5]['dialAnswer']===!![]){ut[_0x83f6('0x76')](_0x5f124d[_0x83f6('0x12')][_0x5f124d[_0x83f6('0x15')][_0x4ab0e5][_0x83f6('0x6a')]],_0x83f6('0x75'));ut[_0x83f6('0x77')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4ab0e5,_0x5f124d['actions'][_0x4ab0e5][_0x83f6('0x6a')]);}ut[_0x83f6('0x77')](_0x83f6('0x78')+_0x4ab0e5,_0x5f124d[_0x83f6('0x15')][_0x4ab0e5]['queue']);delete _0x5f124d['actions'][_0x4ab0e5];}},0x2328);}});}});};Preview['prototype'][_0x83f6('0x79')]=function(){var _0x37740d=this;loggerAction[_0x83f6('0x59')]('[action]',_[_0x83f6('0x7a')](this[_0x83f6('0x15')]));for(var _0x2543d6 in this[_0x83f6('0x15')]){if(_0x37740d[_0x83f6('0x15')][_0x83f6('0x63')](_0x2543d6)){_0x37740d[_0x83f6('0x7b')](_0x2543d6);}}};Preview[_0x83f6('0xe')][_0x83f6('0x7c')]=function(_0x255469){var _0x2716d7=this;rpcDb[_0x83f6('0x7d')](_0x255469['id'],ut[_0x83f6('0x7e')](this[_0x83f6('0x16')]))['then'](function(_0x5b78bc){if(!_['isNil'](_0x5b78bc)){for(var _0x1b6971=0x0;_0x1b6971<_0x5b78bc[_0x83f6('0x7f')];_0x1b6971+=0x1){if(ut[_0x83f6('0x80')](_0x5b78bc[_0x1b6971][_0x83f6('0x81')])<_0x255469[_0x83f6('0x82')]*0x3c){if(_0x5b78bc[_0x1b6971][_0x83f6('0x83')]&&!_0x5b78bc[_0x1b6971][_0x83f6('0x83')][_0x83f6('0x84')]){_0x2716d7[_0x83f6('0x85')](_0x5b78bc[_0x1b6971]['id'])['then'](ut[_0x83f6('0x86')](_0x83f6('0x87')))['catch'](ut[_0x83f6('0x86')](_0x83f6('0x87')));}else{rpcDb[_0x83f6('0x88')](_0x5b78bc[_0x1b6971]['id']);}}else{var _0x30c352=new Action(_0x5b78bc[_0x1b6971],_0x255469);_0x30c352[_0x83f6('0x89')]=moment()[_0x83f6('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x255469['outboundReCallsDay']+=0x1;ut[_0x83f6('0x8a')](_0x30c352,0x17,_0x83f6('0x8b'));if(_0x255469[_0x83f6('0x8c')]){rpcDb['rescheduleContactInQueue'](ut[_0x83f6('0x8d')](_0x5b78bc[_0x1b6971]));rpcDb[_0x83f6('0x8e')](_0x30c352,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x83f6('0x8a')](_0x30c352,0x16,'RecallFailedTimeout');rpcDb['createCustomerHistory'](_0x30c352,_0x83f6('0x8f'));rpcDb['createCustomerFinal'](_0x30c352,_0x83f6('0x8f'));}}}}})[_0x83f6('0x73')](ut[_0x83f6('0x86')]('[getContactRecallMe]'));};Preview['prototype']['setMessage']=function(_0x56c649){_0x56c649['sendMessageOneNotActive']=!![];if(ut[_0x83f6('0x90')](_0x56c649[_0x83f6('0x2e')])){_0x56c649[_0x83f6('0x4b')]=_0x83f6('0x91');}else if(!ut[_0x83f6('0x92')](_0x56c649[_0x83f6('0x66')])){_0x56c649[_0x83f6('0x4b')]=_0x83f6('0x93');}else if(!this[_0x83f6('0x94')](_0x56c649[_0x83f6('0x53')])){if(!this['isTrunkReachable'](_0x56c649['TrunkBackup'])){_0x56c649[_0x83f6('0x4b')]='TRUNK_IS_NOT_REACHABLE';}else{_0x56c649['message']=_0x83f6('0x95');}}else{_0x56c649[_0x83f6('0x4b')]=_0x83f6('0x95');}emitCampaignPreview(_0x56c649);};Preview[_0x83f6('0xe')][_0x83f6('0x96')]=function(_0x9bb2bf,_0x205981,_0x1ba010){var _0x5e0457=this;var _0x2c36ab=this[_0x83f6('0x15')][_0x205981];var _0x35eb71=this[_0x83f6('0x12')][_0x2c36ab[_0x83f6('0x6a')]];var _0x5414eb;if(_0x35eb71){switch(_0x1ba010){case'1':_0x35eb71[_0x83f6('0x3d')]+=0x1;_0x2c36ab[_0x83f6('0x97')]+=0x1;_0x2c36ab[_0x83f6('0x98')]=ut[_0x83f6('0x99')](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0x0,'NoSuchNumber');ami[_0x83f6('0x28')](_0x83f6('0x9a'),ut[_0x83f6('0x9b')](_0x2c36ab,_0x83f6('0x9c')));rpcDb[_0x83f6('0x8e')](_0x2c36ab,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut[_0x83f6('0x9e')](_0x2c36ab,0xf,_0x83f6('0x9f'));rpcDb['createCustomerFinal'](_0x5414eb,_0x83f6('0xa0'));}else{if(_0x2c36ab[_0x83f6('0x97')]>=_0x35eb71[_0x83f6('0xa1')]){rpcDb['createCustomerFinal'](_0x2c36ab,_0x83f6('0xa0'));}else{rpcDb['rescheduleContact'](ut[_0x83f6('0xa2')](_0x2c36ab,_0x83f6('0x97'),_0x35eb71[_0x83f6('0xa3')]),_0x2c36ab[_0x83f6('0xa4')],_0x2c36ab[_0x83f6('0xa5')]);}}delete this['actions'][_0x9bb2bf[_0x83f6('0xa6')]];break;case _0x83f6('0xa7'):var _0x463762=moment()[_0x83f6('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x2c36ab[_0x83f6('0xa8')]=_0x463762;_0x2c36ab['answertime']=_0x463762;_0x2c36ab[_0x83f6('0x6d')]=!![];_0x35eb71[_0x83f6('0x2f')]+=0x1;logger['info']('[syncHangup][talking][increment]',_0x2c36ab[_0x83f6('0xa9')],_0x83f6('0xaa'),_0x35eb71[_0x83f6('0x54')],_0x83f6('0x6c'),_0x35eb71['pTalking']);ami[_0x83f6('0x28')](_0x83f6('0xab'),ut[_0x83f6('0x9b')](_0x2c36ab,'connect'));if(_0x35eb71[_0x83f6('0xac')]){ami['emit']('custom:agentConnectPreview',ut[_0x83f6('0xad')](_0x2c36ab));}break;case'16':ami['emit'](_0x83f6('0xae'),ut[_0x83f6('0x9b')](_0x2c36ab,_0x83f6('0xaf')));emitVoiceQueueChannelRemove(ut[_0x83f6('0x9b')](_0x2c36ab,_0x83f6('0xaf')));_0x35eb71[_0x83f6('0x37')]+=0x1;_0x35eb71[_0x83f6('0x31')]+=0x1;_0x35eb71[_0x83f6('0x2c')]+=0x1;ut['decrementTalkink'](_0x35eb71,_0x83f6('0xb0'));_0x2c36ab[_0x83f6('0x98')]=ut[_0x83f6('0x99')](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0x4,_0x83f6('0xb1'));rpcDb[_0x83f6('0x8e')](_0x2c36ab,_0x83f6('0xb2'));rpcDb['createCustomerFinal'](_0x2c36ab,_0x83f6('0xb3'));rpcDb['crateCustomerReportQueue'](_0x2c36ab);_0x35eb71[_0x83f6('0xb4')]+=_0x2c36ab[_0x83f6('0xb5')];_0x35eb71[_0x83f6('0xb6')]+=_0x2c36ab['talktime'];logger[_0x83f6('0x59')]('[syncHangup][talking][decrement]',_0x2c36ab[_0x83f6('0xa9')],_0x83f6('0xaa'),_0x35eb71[_0x83f6('0x54')],_0x83f6('0x6c'),_0x35eb71[_0x83f6('0x2f')]);delete this[_0x83f6('0x15')][_0x9bb2bf[_0x83f6('0xa6')]];break;case _0x83f6('0xb7'):_0x35eb71[_0x83f6('0x38')]+=0x1;_0x2c36ab[_0x83f6('0xb8')]+=0x1;_0x2c36ab['countglobal']=ut[_0x83f6('0x99')](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0x5,_0x83f6('0xb9'));ami[_0x83f6('0x28')]('custom:agentbusy',ut['buildObj'](_0x2c36ab,_0x83f6('0xba')));rpcDb[_0x83f6('0x8e')](_0x2c36ab,_0x83f6('0xbb'));if(ut[_0x83f6('0x99')](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut['cloneAction'](_0x2c36ab,0xf,_0x83f6('0x9f'));rpcDb['createCustomerFinal'](_0x5414eb,_0x83f6('0xbc'));}else{if(_0x2c36ab[_0x83f6('0xb8')]>=_0x35eb71[_0x83f6('0xbd')]){rpcDb[_0x83f6('0xbe')](_0x2c36ab,_0x83f6('0xbb'));}else{rpcDb[_0x83f6('0xbf')](ut[_0x83f6('0xa2')](_0x2c36ab,_0x83f6('0xb8'),_0x35eb71[_0x83f6('0xc0')]),_0x2c36ab[_0x83f6('0xa4')],_0x2c36ab[_0x83f6('0xa5')]);}}break;case _0x83f6('0xc1'):_0x35eb71[_0x83f6('0x3c')]+=0x1;_0x2c36ab['countnoanswerretry']+=0x1;_0x2c36ab['countglobal']=ut[_0x83f6('0x99')](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0x3,_0x83f6('0xc2'));ami[_0x83f6('0x28')](_0x83f6('0xc3'),ut['buildObj'](_0x2c36ab,_0x83f6('0xc4')));rpcDb[_0x83f6('0x8e')](_0x2c36ab,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x83f6('0x99')](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut[_0x83f6('0x9e')](_0x2c36ab,0xf,'Global');rpcDb[_0x83f6('0xbe')](_0x5414eb,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x2c36ab[_0x83f6('0xc5')]>=_0x35eb71[_0x83f6('0xc6')]){rpcDb[_0x83f6('0xbe')](_0x2c36ab,_0x83f6('0xc7'));}else{rpcDb[_0x83f6('0xbf')](ut[_0x83f6('0xa2')](_0x2c36ab,_0x83f6('0xc5'),_0x35eb71['dialNoAnswerRetryFrequency']),_0x2c36ab['unlockAgent'],_0x2c36ab['activeContact']);}}break;case _0x83f6('0xc8'):_0x35eb71[_0x83f6('0x39')]+=0x1;_0x2c36ab[_0x83f6('0xc9')]+=0x1;_0x2c36ab['countglobal']=ut[_0x83f6('0x99')](_0x2c36ab);ut['logCustomer'](_0x2c36ab,0x8,'Congestion');ami['emit']('custom:agentcongestion',ut['buildObj'](_0x2c36ab,'congestion'));rpcDb[_0x83f6('0x8e')](_0x2c36ab,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x83f6('0x99')](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut['cloneAction'](_0x2c36ab,0xf,_0x83f6('0x9f'));rpcDb[_0x83f6('0xbe')](_0x5414eb,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2c36ab[_0x83f6('0xc9')]>=_0x35eb71['dialCongestionMaxRetry']){rpcDb[_0x83f6('0xbe')](_0x2c36ab,_0x83f6('0xca'));}else{rpcDb[_0x83f6('0xbf')](ut[_0x83f6('0xa2')](_0x2c36ab,_0x83f6('0xc9'),_0x35eb71[_0x83f6('0xc0')]),_0x2c36ab['unlockAgent'],_0x2c36ab['activeContact']);}}break;case _0x83f6('0xcb'):_0x35eb71[_0x83f6('0xcc')]+=0x1;_0x2c36ab[_0x83f6('0xcd')]+=0x1;_0x2c36ab[_0x83f6('0x98')]=ut[_0x83f6('0x99')](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0x14,_0x83f6('0xce'));ami[_0x83f6('0x28')]('custom:agentreject',ut['buildObj'](_0x2c36ab,_0x83f6('0xcf')));rpcDb[_0x83f6('0x8e')](_0x2c36ab,_0x83f6('0xd0'));if(ut['totalGlobal'](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut[_0x83f6('0x9e')](_0x2c36ab,0x14,'AgentReject');rpcDb[_0x83f6('0xbe')](_0x5414eb,_0x83f6('0xd1'));}else{if(_0x2c36ab[_0x83f6('0xcd')]>=_0x35eb71[_0x83f6('0xd2')]){rpcDb[_0x83f6('0xbe')](_0x2c36ab,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x83f6('0xbf')](ut['scheduledAt'](_0x2c36ab,'countagentrejectretry',_0x35eb71[_0x83f6('0xd3')]),_0x2c36ab[_0x83f6('0xa4')],_0x2c36ab['activeContact']);}}break;case _0x83f6('0xd4'):_0x35eb71[_0x83f6('0xd5')]+=0x1;_0x2c36ab[_0x83f6('0xd6')]+=0x1;_0x2c36ab[_0x83f6('0x98')]=ut[_0x83f6('0x99')](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0xb,'Abandoned');rpcDb[_0x83f6('0x8e')](_0x2c36ab,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x83f6('0x99')](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut[_0x83f6('0x9e')](_0x2c36ab,0xf,'Global');rpcDb['createCustomerFinal'](_0x5414eb,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x2c36ab['countabandonedetry']>=_0x35eb71[_0x83f6('0xd7')]){rpcDb[_0x83f6('0xbe')](_0x2c36ab,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x83f6('0xa2')](_0x2c36ab,_0x83f6('0xd6'),_0x35eb71[_0x83f6('0xd8')]),_0x2c36ab[_0x83f6('0xa4')],_0x2c36ab['activeContact']);}}break;default:if(_0x2c36ab[_0x83f6('0x6d')]){ut[_0x83f6('0x76')](_0x35eb71,_0x83f6('0xd9'));ut[_0x83f6('0x77')](_0x83f6('0xda')+_0x35eb71['name'],_0x9bb2bf);}_0x35eb71[_0x83f6('0x3f')]+=0x1;_0x2c36ab[_0x83f6('0x98')]=ut['totalGlobal'](_0x2c36ab);ut[_0x83f6('0x8a')](_0x2c36ab,0xc,_0x9bb2bf[_0x83f6('0xdb')]||_0x9bb2bf[_0x83f6('0xdc')]);rpcDb[_0x83f6('0x8e')](_0x2c36ab,_0x83f6('0xdd'));if(ut[_0x83f6('0x99')](_0x2c36ab)>=_0x35eb71[_0x83f6('0x9d')]){_0x5414eb=ut[_0x83f6('0x9e')](_0x2c36ab,0xf,'Global');rpcDb[_0x83f6('0xbe')](_0x5414eb,_0x83f6('0xde'));}else{rpcDb[_0x83f6('0xbe')](_0x2c36ab,_0x83f6('0xde'));}delete this['actions'][_0x9bb2bf['linkedid']];}if(!(_0x2c36ab[_0x83f6('0x6d')]&&_0x1ba010==='16')){ut[_0x83f6('0xdf')](_0x35eb71,_0x83f6('0xe0'));logger[_0x83f6('0x59')](_0x83f6('0xe1'),_0x2c36ab[_0x83f6('0xa9')],_0x83f6('0xaa'),_0x35eb71[_0x83f6('0x54')],_0x83f6('0xe2'),_0x35eb71[_0x83f6('0x4c')]);}if(_0x1ba010!==_0x83f6('0xa7')){delete this[_0x83f6('0x15')][_0x9bb2bf[_0x83f6('0xa6')]];delete this[_0x83f6('0x15')][_0x9bb2bf[_0x83f6('0xe3')]];}}};Preview[_0x83f6('0xe')]['callProgressDetectingAgent']=function(_0x2757a4,_0x53e898,_0x368c13){if(_[_0x83f6('0xe4')](_0x53e898)&&_0x83f6('0xe5')!==typeof _0x53e898){return;}if(_['isUndefined'](_0x368c13)&&_0x83f6('0xe5')!==typeof _0x368c13){return;}switch(_0x368c13[_0x83f6('0xe6')]){case'0':ut[_0x83f6('0xe7')](_0x2757a4,0x0,_0x83f6('0xe8'));rpcDb[_0x83f6('0xe9')](_0x2757a4,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x83f6('0xe7')](_0x2757a4,0x3,_0x83f6('0xc2'));rpcDb[_0x83f6('0xe9')](_0x2757a4,_0x83f6('0xea'));break;case'5':ut['logAgent'](_0x2757a4,0x5,_0x83f6('0xb9'));rpcDb['createAgentHistory'](_0x2757a4,_0x83f6('0xeb'));break;case'8':ut['logAgent'](_0x2757a4,0x8,_0x83f6('0xec'));rpcDb[_0x83f6('0xe9')](_0x2757a4,_0x83f6('0xed'));break;case'22':ut[_0x83f6('0xe7')](_0x2757a4,0x16,_0x83f6('0xee'));rpcDb[_0x83f6('0xe9')](_0x2757a4,_0x83f6('0xef'));break;default:ut[_0x83f6('0xe7')](_0x2757a4,0xc,_0x368c13[_0x83f6('0xe6')]);rpcDb['createAgentHistory'](_0x2757a4,_0x83f6('0xed'));}ut[_0x83f6('0xdf')](_0x53e898,_0x83f6('0xf0'));logger[_0x83f6('0x59')]('[originated][decrement][callProgressDetectingAgent]',_0x2757a4['uniqueid'],_0x83f6('0xaa'),_0x53e898[_0x83f6('0x54')],_0x83f6('0xe2'),_0x53e898[_0x83f6('0x4c')]);delete this[_0x83f6('0x15')][_0x2757a4[_0x83f6('0xa9')]];};Preview[_0x83f6('0xe')][_0x83f6('0xf1')]=function(_0x468330,_0x27e3e9,_0x590358,_0xb5f356,_0x4a3e8b){var _0x4fd2b0=this;return new BPromise(function(_0x2a46e4,_0x54d02f){if(_[_0x83f6('0xf2')](_0x27e3e9)||_[_0x83f6('0xf2')](_0x27e3e9[_0x83f6('0xf3')])||_['isNil'](_0x27e3e9[_0x83f6('0xf3')]['phone'])||_[_0x83f6('0xf2')](_0x27e3e9[_0x83f6('0x6f')])){_0x54d02f(ut[_0x83f6('0x4b')](_0x83f6('0xf4'),_0xb5f356,_0x4a3e8b));return;}var _0x1a9f1b=uuid['v4']();var _0x557ae9=_0x4fd2b0[_0x83f6('0x12')][_0x27e3e9[_0x83f6('0x69')][_0x83f6('0x54')]];var _0x5dfa84=_0x590358?_0x4fd2b0[_0x83f6('0x16')][_0x590358]['id']:undefined;_0x4fd2b0[_0x83f6('0x15')][_0x1a9f1b]=new Action(_0x27e3e9,_0x557ae9,_0x1a9f1b,_0x590358,_0x5dfa84);var _0x11cd6c=_0x4fd2b0['actions'][_0x1a9f1b];_0x11cd6c[_0x83f6('0xa4')]=_0xb5f356;_0x11cd6c[_0x83f6('0xa5')]=_0x4a3e8b;_0x11cd6c[_0x83f6('0xf5')]=_0x590358;if(_[_0x83f6('0xf6')](_0x468330)){_0x4fd2b0[_0x83f6('0xf7')](_0x11cd6c,_0x557ae9,_0x27e3e9,_0x590358)[_0x83f6('0xf8')](function(_0xef1591){logger['info']('[Preview][execCall][success]','Queue:\x20'+_0x11cd6c['queue']+'\x20IdHopper:\x20'+_0x11cd6c[_0x83f6('0xf9')],JSON[_0x83f6('0x6b')](_0xef1591));ami[_0x83f6('0x28')]('custom:agentcalled',ut[_0x83f6('0x9b')](_0x11cd6c,_0x83f6('0xfa')));_0x2a46e4(ut[_0x83f6('0x4b')](_0x83f6('0xfb')));})[_0x83f6('0x73')](function(_0x5d3b1a){ut[_0x83f6('0x5e')](_0x83f6('0xfc'),_0x5d3b1a);_0x54d02f(ut[_0x83f6('0x4b')](_0x83f6('0xfd'),_0xb5f356,_0x4a3e8b));});}else{_0x557ae9[_0x83f6('0xfe')]+=0x1;ut[_0x83f6('0xff')](_0x11cd6c);rpcDb[_0x83f6('0x100')](_0x11cd6c,'[Blacklist][error]');delete _0x4fd2b0[_0x83f6('0x15')][_0x1a9f1b];_0x54d02f(ut[_0x83f6('0x4b')](_0x83f6('0x101'),_0xb5f356,_0x4a3e8b));}});};Preview[_0x83f6('0xe')][_0x83f6('0x94')]=function(_0x2556d7){return!_['isNil'](_0x2556d7)&&!_['isNil'](_0x2556d7['name'])&&!_['isNil'](_0x2556d7[_0x83f6('0x55')])&&_0x2556d7[_0x83f6('0x55')]&&!_['isNil'](this[_0x83f6('0x14')][util[_0x83f6('0x58')](_0x83f6('0x102'),_0x2556d7[_0x83f6('0x54')])])&&!_[_0x83f6('0xf2')](this[_0x83f6('0x14')][util[_0x83f6('0x58')](_0x83f6('0x102'),_0x2556d7[_0x83f6('0x54')])][_0x83f6('0x71')])&&(this['trunks'][util[_0x83f6('0x58')](_0x83f6('0x102'),_0x2556d7['name'])][_0x83f6('0x71')]===_0x83f6('0x103')||this[_0x83f6('0x14')][util[_0x83f6('0x58')](_0x83f6('0x102'),_0x2556d7['name'])][_0x83f6('0x71')]===_0x83f6('0x104'));};Preview[_0x83f6('0xe')][_0x83f6('0x85')]=function(_0x10ad7f,_0x41c360){var _0x85cf1e=this;return new BPromise(function(_0x23a439,_0x5ca0d4){_0x85cf1e[_0x83f6('0x105')](_0x10ad7f,_0x41c360)[_0x83f6('0xf8')](function(_0x574418){_0x23a439(_['pick'](_0x574418,['message']));})[_0x83f6('0x73')](function(_0x1b1b69){if(_0x1b1b69[_0x83f6('0x106')]){rpcDb['unlockContact'](_0x10ad7f);}if(_0x1b1b69['active']){rpcDb['disableContact'](_0x10ad7f);}_0x5ca0d4(_[_0x83f6('0x107')](_0x1b1b69,['message']));});});};Preview['prototype'][_0x83f6('0x105')]=function(_0x364fa,_0x7395e4){var _0x3f0fac=this;return new BPromise(function(_0x3aa20a,_0x49cb90){var _0x3a72c7,_0x4113df;rpcDb[_0x83f6('0x108')](_0x364fa)[_0x83f6('0xf8')](function(_0x512ed6){if(!_['isNil'](_0x512ed6[0x0])){_0x4113df=_0x512ed6[0x0]['recallme']?![]:!![];_0x3a72c7=_0x512ed6[0x0][_0x83f6('0x109')]?!![]:![];_0x3a72c7=_0x7395e4?!![]:_0x3a72c7;}var _0x2ab545=_0x3f0fac[_0x83f6('0x10a')](_0x512ed6);if(_0x2ab545[_0x83f6('0x10b')]){rpcDb[_0x83f6('0x10c')](_[_0x83f6('0x107')](_0x512ed6[0x0],[_0x83f6('0x6f'),_0x83f6('0x10d')]))[_0x83f6('0xf8')](function(_0x1d7c70){_0x3f0fac[_0x83f6('0xf1')](_0x1d7c70,_0x512ed6[0x0],_0x7395e4,_0x4113df,_0x3a72c7)[_0x83f6('0xf8')](function(_0x4ac82c){_0x3aa20a(_0x4ac82c);})[_0x83f6('0x73')](function(_0x3a3da3){_0x49cb90(_0x3a3da3);});})[_0x83f6('0x73')](function(_0x761253){ut['logger'](_0x83f6('0x10e'),_0x761253);_0x49cb90(ut[_0x83f6('0x4b')]('Call\x20unsuccessful',_0x4113df,_0x3a72c7));});}else{_0x49cb90(ut[_0x83f6('0x4b')](_0x2ab545['message'],_0x4113df,_0x3a72c7));}})['catch'](function(_0x6864e1){ut['logger'](_0x83f6('0x10f'),_0x6864e1);_0x49cb90(ut[_0x83f6('0x4b')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x38f5f7){if(_['isNil'](_0x38f5f7)||_['isEmpty'](_0x38f5f7)||!_[_0x83f6('0xf2')](_0x38f5f7[0x0][_0x83f6('0x83')])&&_[_0x83f6('0xf2')](_0x38f5f7[0x0]['Agent']['name'])){ut[_0x83f6('0x5e')](_0x83f6('0x110'),_0x38f5f7);return{'isValid':![],'message':_0x83f6('0x111')};}var _0x1b1536=this['campaignsPreview'][_0x38f5f7[0x0][_0x83f6('0x69')][_0x83f6('0x54')]];_0x1b1536[_0x83f6('0x4b')]=_0x83f6('0x95');if(_[_0x83f6('0xf2')](_0x1b1536)){ut['logger'](_0x83f6('0x112'),_0x1b1536);return{'isValid':![],'message':_0x83f6('0x113')};}if(!this[_0x83f6('0x94')](_0x1b1536[_0x83f6('0x53')])){ut[_0x83f6('0x5e')](_0x83f6('0x114'),_0x83f6('0x115')+_0x1b1536[_0x83f6('0x54')]+_0x83f6('0x116'));if(!this[_0x83f6('0x94')](_0x1b1536['TrunkBackup'])){ut[_0x83f6('0x5e')](_0x83f6('0x114'),_0x1b1536[_0x83f6('0x54')]+_0x83f6('0x117'));return{'isValid':![],'message':_0x83f6('0x118')};}}if(!ut[_0x83f6('0x92')](_0x1b1536['dialActive'])){ut[_0x83f6('0x5e')](_0x83f6('0x119'),_0x1b1536[_0x83f6('0x54')]+_0x83f6('0x11a'));return{'isValid':![],'message':_0x83f6('0x115')+_0x1b1536[_0x83f6('0x54')]+_0x83f6('0x11a')};}return{'isValid':!![],'message':_0x83f6('0x11b')};};Preview[_0x83f6('0xe')][_0x83f6('0xf7')]=function(_0x507c56,_0x2cd848,_0x53c793,_0x5ca92c){var _0x15725a=this;return new BPromise(function(_0x39ab0e,_0x413975){var _0x2473a9=_0x507c56[_0x83f6('0xa9')];var _0x131525=_0x15725a[_0x83f6('0x94')](_0x2cd848[_0x83f6('0x53')])?util['format'](_0x83f6('0x11c'),_0x2cd848[_0x83f6('0x53')][_0x83f6('0x54')],_[_0x83f6('0xf2')](_0x2cd848[_0x83f6('0x11d')])?'':_0x2cd848[_0x83f6('0x11d')]['trim']()||'',_0x2cd848['dialCutDigit']>0x0?_0x53c793[_0x83f6('0xf3')][_0x83f6('0x11e')][_0x83f6('0x11f')](_0x2cd848[_0x83f6('0x120')]):_0x53c793[_0x83f6('0xf3')][_0x83f6('0x11e')]):util[_0x83f6('0x58')](_0x83f6('0x11c'),_[_0x83f6('0xf2')](_0x2cd848[_0x83f6('0x121')])?_0x2cd848[_0x83f6('0x53')]['name']:_0x2cd848[_0x83f6('0x121')][_0x83f6('0x54')],_[_0x83f6('0xf2')](_0x2cd848[_0x83f6('0x11d')])?'':_0x2cd848[_0x83f6('0x11d')][_0x83f6('0x122')]()||'',_0x2cd848[_0x83f6('0x120')]>0x0?_0x53c793[_0x83f6('0xf3')][_0x83f6('0x11e')][_0x83f6('0x11f')](_0x2cd848[_0x83f6('0x120')]):_0x53c793[_0x83f6('0xf3')]['phone']);var _0x4d091b=_0x15725a[_0x83f6('0x94')](_0x2cd848[_0x83f6('0x53')])?ut[_0x83f6('0x123')](_0x2cd848['Trunk'][_0x83f6('0x56')],_0x2cd848['dialOriginateCallerIdName'],_0x2cd848['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x2cd848[_0x83f6('0x34')],_0x2cd848[_0x83f6('0x124')]):_0x2cd848[_0x83f6('0x34')]):ut[_0x83f6('0x123')](_[_0x83f6('0xf2')](_0x2cd848[_0x83f6('0x121')])?_0x2cd848[_0x83f6('0x53')]['callerid']:_0x2cd848[_0x83f6('0x121')]['callerid'],_0x2cd848[_0x83f6('0x125')],_0x2cd848['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x83f6('0x126')](_0x2cd848[_0x83f6('0x34')],_0x2cd848[_0x83f6('0x124')]):_0x2cd848[_0x83f6('0x34')]);if(_0x4d091b){_0x507c56[_0x83f6('0x127')]=ut['extractCalleridName'](_0x4d091b);_0x507c56[_0x83f6('0x128')]=ut['extractCalleridNumber'](_0x4d091b);}var _0x79402f=ut[_0x83f6('0x129')](_0x2cd848,_0x53c793,_0x131525,_0x4d091b,_0x2473a9,_0x507c56);_[_0x83f6('0x12a')](_0x507c56,ut[_0x83f6('0x12b')](_0x79402f));_0x507c56['starttime']=moment()[_0x83f6('0x58')](_0x83f6('0x12c'));ami['Action'](ut['variablesAction'](_0x507c56,_0x2cd848,_0x79402f,_0x507c56['activeContact'],_0x5ca92c))[_0x83f6('0xf8')](function(_0x53f15c){_0x2cd848[_0x83f6('0x4c')]+=0x1;logger[_0x83f6('0x59')](_0x83f6('0x12d'),_0x2473a9,_0x83f6('0xaa'),_0x2cd848[_0x83f6('0x54')],'originated:\x20',_0x2cd848[_0x83f6('0x4c')]);_0x39ab0e(_0x53f15c);})['catch'](function(_0x3f6a21){ut['logAgent'](_0x507c56,0xe,_0x83f6('0x12e'));rpcDb[_0x83f6('0xe9')](_0x507c56,_0x83f6('0x12f'));_0x413975(_0x3f6a21);});});};Preview[_0x83f6('0xe')][_0x83f6('0x20')]=function(_0x48e4a0){if(this[_0x83f6('0x15')][_0x48e4a0['linkedid']]){this[_0x83f6('0x15')][_0x48e4a0[_0x83f6('0xa6')]][_0x83f6('0x72')]=_0x48e4a0[_0x83f6('0x72')];}};Preview[_0x83f6('0xe')]['syncOriginateResponse']=function(_0x26a5d4){var _0x6f0be2=this;var _0x295777=this[_0x83f6('0x15')][_0x26a5d4[_0x83f6('0x130')]];if(_0x295777){if(_0x295777['lookAgent']&&this[_0x83f6('0x16')][_0x295777['lookAgent']]){ut[_0x83f6('0x131')](_0x295777,this['agents'][_0x295777[_0x83f6('0xf5')]][_0x83f6('0x54')],this[_0x83f6('0x16')][_0x295777[_0x83f6('0xf5')]]['id']);}var _0x244828=_[_0x83f6('0x132')](_0x295777);_0x244828[_0x83f6('0xa8')]=moment()['format'](_0x83f6('0x12c'));var _0x485477=_0x6f0be2[_0x83f6('0x12')][_0x295777[_0x83f6('0x6a')]];if(ut[_0x83f6('0x133')](_0x26a5d4[_0x83f6('0x134')])){if(_0x295777[_0x83f6('0xa4')]){rpcDb['unlockContact'](_0x295777[_0x83f6('0xf9')]);}if(_0x295777['activeContact']){rpcDb[_0x83f6('0x88')](_0x295777[_0x83f6('0xf9')]);}ami['emit']('custom:agentringnoanswer',ut[_0x83f6('0x9b')](_0x295777,_0x83f6('0x135')));this[_0x83f6('0x136')](_0x244828,_0x485477,_0x26a5d4);}else{_0x295777[_0x83f6('0x89')]=moment()[_0x83f6('0x58')](_0x83f6('0x12c'));ut[_0x83f6('0xe7')](_0x244828,0x4,_0x83f6('0xb1'));rpcDb[_0x83f6('0xe9')](_0x244828,_0x83f6('0x137'));}}};Preview[_0x83f6('0xe')][_0x83f6('0x1c')]=function(_0x4c2438){var _0x358af3=this;var _0x3f7df2=this[_0x83f6('0x15')][_0x4c2438['linkedid']];var _0x1d804c;if(_0x3f7df2){_0x1d804c=this[_0x83f6('0x12')][_0x3f7df2[_0x83f6('0x6a')]];logger[_0x83f6('0x59')](_0x83f6('0x138'),_0x4c2438['linkedid'],'\x20Queue',_0x1d804c[_0x83f6('0x54')],_0x83f6('0x6c'),_0x1d804c[_0x83f6('0x2f')]);}if(this[_0x83f6('0x15')][_0x4c2438[_0x83f6('0xa6')]]&&_0x4c2438[_0x83f6('0xa6')]!==_0x4c2438[_0x83f6('0xa9')]){if(_0x4c2438['cause']==='16'&&this[_0x83f6('0x15')][_0x4c2438[_0x83f6('0xa6')]][_0x83f6('0x6d')]){this[_0x83f6('0x96')](_0x4c2438,_0x4c2438['linkedid'],_0x4c2438[_0x83f6('0x139')]);}else if(this[_0x83f6('0x15')][_0x4c2438[_0x83f6('0xa6')]]['dialAnswer']){logger['info'](_0x83f6('0x13a'),_0x4c2438[_0x83f6('0xa6')],_0x4c2438[_0x83f6('0x139')],_0x83f6('0xaa'),_0x1d804c[_0x83f6('0x54')],_0x83f6('0x6c'),_0x1d804c['pTalking']);this[_0x83f6('0x96')](_0x4c2438,_0x4c2438[_0x83f6('0xa6')],_0x4c2438[_0x83f6('0x139')]);}}else if(_0x3f7df2&&_[_0x83f6('0xf2')](_0x3f7df2[_0x83f6('0x13b')])&&_0x1d804c[_0x83f6('0x13c')]&&_0x4c2438['linkedid']===_0x4c2438[_0x83f6('0xa9')]&&_[_0x83f6('0xf2')](_0x4c2438['reason'])&&_0x4c2438[_0x83f6('0x139')]==='16'&&_0x4c2438[_0x83f6('0x13d')]==='6'&&_[_0x83f6('0xe4')](_0x3f7df2[_0x83f6('0x13e')])){if(_0x3f7df2[_0x83f6('0xa4')]){rpcDb[_0x83f6('0x13f')](_0x3f7df2[_0x83f6('0xf9')]);}if(_0x3f7df2[_0x83f6('0xa5')]){rpcDb[_0x83f6('0x88')](_0x3f7df2[_0x83f6('0xf9')]);}_0x4c2438[_0x83f6('0xe6')]='22';this[_0x83f6('0x136')](_0x3f7df2,_0x1d804c,_0x4c2438);}else if(_0x3f7df2&&_0x3f7df2['transfer']){if(_0x4c2438[_0x83f6('0x139')]==='16'&&this[_0x83f6('0x15')][_0x4c2438[_0x83f6('0xa6')]][_0x83f6('0x6d')]){logger[_0x83f6('0x59')](_0x83f6('0x140'),_0x4c2438[_0x83f6('0xa6')],_0x4c2438['cause'],_0x83f6('0xaa'),_0x1d804c[_0x83f6('0x54')],_0x83f6('0x6c'),_0x1d804c[_0x83f6('0x2f')]);this[_0x83f6('0x96')](_0x4c2438,_0x4c2438['linkedid'],_0x4c2438[_0x83f6('0x139')]);}else if(this[_0x83f6('0x15')][_0x4c2438['linkedid']]['dialAnswer']){logger[_0x83f6('0x59')](_0x83f6('0x13a'),_0x4c2438[_0x83f6('0xa6')],_0x4c2438['cause'],'\x20Queue',_0x1d804c[_0x83f6('0x54')],_0x83f6('0x6c'),_0x1d804c[_0x83f6('0x2f')]);this['callProgressDetectingCustomer'](_0x4c2438,_0x4c2438[_0x83f6('0xa6')],_0x4c2438['cause']);}}};Preview[_0x83f6('0xe')][_0x83f6('0x1e')]=function(_0x2a71ba){if(this[_0x83f6('0x15')][_0x2a71ba[_0x83f6('0xe3')]]&&_0x2a71ba[_0x83f6('0xe3')]!==_0x2a71ba[_0x83f6('0x141')]){this[_0x83f6('0x96')](_0x2a71ba,_0x2a71ba['destlinkedid'],_0x2a71ba[_0x83f6('0xdc')]);}};Preview[_0x83f6('0xe')]['syncHangupRequest']=function(_0x42b7aa){if(this[_0x83f6('0x15')][_0x42b7aa[_0x83f6('0xa6')]]&&_0x42b7aa[_0x83f6('0xa6')]!==_0x42b7aa['uniqueid']&&!this['actions'][_0x42b7aa[_0x83f6('0xa6')]][_0x83f6('0x6d')]){if(_0x42b7aa[_0x83f6('0x139')]==='1'){this['callProgressDetectingCustomer'](_0x42b7aa,_0x42b7aa[_0x83f6('0xa6')],_0x42b7aa[_0x83f6('0x139')]);}}};Preview['prototype'][_0x83f6('0x142')]=function(_0x22c1b8,_0x444bb5,_0x232cfa){if(this['actions'][_0x22c1b8]){if(_[_0x83f6('0xf2')](this[_0x83f6('0x15')][_0x22c1b8]['variables'])){this[_0x83f6('0x15')][_0x22c1b8][_0x83f6('0x143')]={};}this[_0x83f6('0x15')][_0x22c1b8]['variables'][_0x444bb5]=_0x232cfa;}};Preview[_0x83f6('0xe')][_0x83f6('0x22')]=function(_0x281e68){try{if(!_[_0x83f6('0xf2')](_0x281e68)){if(ut[_0x83f6('0x144')](_['keys'](_0x281e68[_0x83f6('0x145')])[0x0])){this[_0x83f6('0x142')](_0x281e68[_0x83f6('0xa9')],_[_0x83f6('0x146')](_0x281e68[_0x83f6('0x145')])[0x0],_0x281e68[_0x83f6('0x147')]);}}}catch(_0x147932){logger['error'](_0x83f6('0x148'),util[_0x83f6('0x149')](_0x147932,{'showHidden':![],'depth':null}));}};Preview[_0x83f6('0xe')][_0x83f6('0x24')]=function(_0x101208){if(_0x101208){if(this[_0x83f6('0x15')][_0x101208[_0x83f6('0x14a')]]){this['actions'][_0x101208['transfertargetlinkedid']][_0x83f6('0x13e')]=!![];}}};Preview[_0x83f6('0xe')][_0x83f6('0x26')]=function(_0x41e90e){if(_0x41e90e){if(this[_0x83f6('0x15')][_0x41e90e[_0x83f6('0x14b')]]){this[_0x83f6('0x15')][_0x41e90e[_0x83f6('0x14b')]][_0x83f6('0x13e')]=!![];}}};module[_0x83f6('0x14c')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 432ce18..325a818 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 _0x29d4=['[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','holdtime','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','createHistory','catch','[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact'];(function(_0x5350f5,_0x3aafa3){var _0x2faef5=function(_0x48d945){while(--_0x48d945){_0x5350f5['push'](_0x5350f5['shift']());}};_0x2faef5(++_0x3aafa3);}(_0x29d4,0x1a1));var _0x429d=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x29d4[_0x21aec3];return _0x288bbc;};'use strict';var util=require(_0x429d('0x0'));var BPromise=require('bluebird');var logger=require(_0x429d('0x1'))(_0x429d('0x2'));var _=require(_0x429d('0x3'));var cmHopper=require(_0x429d('0x4'));var cmHopperFinal=require(_0x429d('0x5'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x429d('0x6'));var voiceQueueRt=require(_0x429d('0x7'));var agentReportPreview=require(_0x429d('0x8'));var voiceQueueReport=require(_0x429d('0x9'));function loggerCatch(_0x1c55aa){return function(_0xa71445){logger[_0x429d('0xa')](_0x1c55aa,util[_0x429d('0xb')](_0xa71445,{'showHidden':![],'depth':null}));};}function create(_0x4befb9){return BPromise[_0x429d('0xc')]()['then'](cmHopperHistory[_0x429d('0xd')](_0x4befb9))[_0x429d('0xe')](loggerCatch(_0x429d('0xf')));}function createAgent(_0x5e8430){return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](agentReportPreview['createHistory'](_0x5e8430))[_0x429d('0xe')](loggerCatch(_0x429d('0xf')));}function moveContact(_0x417f77){return BPromise['resolve']()[_0x429d('0x10')](cmHopper[_0x429d('0x11')](_0x417f77,!![]))[_0x429d('0xe')](loggerCatch(_0x429d('0x12')));}exports['checkIsBlackList']=function(_0x1c542c){return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](cmHopperBlack['checkIsBlackList'](_0x1c542c))[_0x429d('0xe')](loggerCatch(_0x429d('0x13')));};exports['getContactPreview']=function(_0x32d6b3){return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](cmHopper[_0x429d('0x14')](_0x32d6b3))[_0x429d('0xe')](loggerCatch(_0x429d('0x15')));};exports['createHistory']=function(_0xbfe8a0,_0x53d19d){create(_0xbfe8a0)[_0x429d('0xe')](loggerCatch(_0x53d19d));moveContact(_0xbfe8a0)[_0x429d('0xe')](loggerCatch(_0x53d19d));};exports[_0x429d('0x16')]=function(_0x2dc57a,_0x51ef88){createAgent(_0x2dc57a)[_0x429d('0xe')](loggerCatch(_0x51ef88));};exports[_0x429d('0x17')]=function(_0x2b9e78,_0x513854){create(_0x2b9e78)[_0x429d('0xe')](loggerCatch(_0x513854));};exports[_0x429d('0x18')]=function(_0x202c4e,_0xcbf00c){moveContact(_0x202c4e)[_0x429d('0xe')](loggerCatch(_0xcbf00c));};exports[_0x429d('0x19')]=function(_0x5a4093,_0x13e309,_0x165e4d){if(_0x13e309){_0x5a4093[_0x429d('0x1a')]=null;}if(_0x165e4d){_0x5a4093['active']=![];}return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](cmHopper[_0x429d('0x19')](_0x5a4093))[_0x429d('0xe')](loggerCatch(_0x429d('0x1b')));};exports[_0x429d('0x1c')]=function(_0x4c6d89){return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](cmHopper['countReScheduled'](_0x4c6d89))[_0x429d('0xe')](loggerCatch(_0x429d('0x1d')));};exports[_0x429d('0x1e')]=function(_0x11c423){return BPromise['resolve']()[_0x429d('0x10')](cmHopper[_0x429d('0x1e')]({'UserId':null},_0x11c423,0x1))[_0x429d('0xe')](loggerCatch(_0x429d('0x1f')));};exports[_0x429d('0x20')]=function(_0x514f1b){return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](cmHopper[_0x429d('0x1e')]({'active':![]},_0x514f1b,0x1))[_0x429d('0xe')](loggerCatch(_0x429d('0x21')));};exports[_0x429d('0x22')]=function(_0x2351c9){var _0xdc7bf9={};_0xdc7bf9[_0x429d('0x23')]=_0x2351c9['type'];_0xdc7bf9[_0x429d('0x24')]=_0x2351c9[_0x429d('0x24')];_0xdc7bf9['calleridnum']=_0x2351c9[_0x429d('0x25')];_0xdc7bf9[_0x429d('0x26')]=_0x2351c9[_0x429d('0x26')];_0xdc7bf9[_0x429d('0x27')]=_0x2351c9[_0x429d('0x27')];_0xdc7bf9['queuecallerjoinAt']=_0x2351c9[_0x429d('0x28')];_0xdc7bf9[_0x429d('0x29')]=_0x2351c9[_0x429d('0x28')];_0xdc7bf9[_0x429d('0x2a')]=0x1;_0xdc7bf9[_0x429d('0x2b')]=_0x2351c9[_0x429d('0x2c')];_0xdc7bf9['connectedlinename']=_0x2351c9['membername'];_0xdc7bf9[_0x429d('0x2d')]=_0x429d('0x2e');_0xdc7bf9['exten']='xcally-motion-preview';_0xdc7bf9[_0x429d('0x2f')]=0x0;_0xdc7bf9['assigned']=0x1;_0xdc7bf9[_0x429d('0x30')]=_0x2351c9[_0x429d('0x31')];_0xdc7bf9[_0x429d('0x32')]=_0x429d('0x33');return BPromise['resolve']()[_0x429d('0x10')](voiceQueueReport[_0x429d('0x34')](_0xdc7bf9))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x5698f5,_0x5bb435){return BPromise[_0x429d('0xc')]()['then'](cmHopper['getContactRecallMe'](_0x5698f5,_0x5bb435))[_0x429d('0xe')](loggerCatch(_0x429d('0x35')));};exports[_0x429d('0x36')]=function(_0x30e645){return BPromise[_0x429d('0xc')]()[_0x429d('0x10')](cmHopper['rescheduleContact'](_0x30e645,!![],!![]))[_0x429d('0xe')](loggerCatch(_0x429d('0x37')));}; \ No newline at end of file +var _0x25fa=['util','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0x25fa,0x109));var _0xa25f=function(_0xf89597,_0x3a8e6b){_0xf89597=_0xf89597-0x0;var _0x46ba86=_0x25fa[_0xf89597];return _0x46ba86;};'use strict';var util=require(_0xa25f('0x0'));var BPromise=require('bluebird');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var _=require('lodash');var cmHopper=require(_0xa25f('0x3'));var cmHopperFinal=require(_0xa25f('0x4'));var cmHopperHistory=require(_0xa25f('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xa25f('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x2ea9ea){return function(_0x3ab530){logger[_0xa25f('0x7')](_0x2ea9ea,util[_0xa25f('0x8')](_0x3ab530,{'showHidden':![],'depth':null}));};}function create(_0x22982b){return BPromise[_0xa25f('0x9')]()[_0xa25f('0xa')](cmHopperHistory[_0xa25f('0xb')](_0x22982b))[_0xa25f('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1bca18){return BPromise[_0xa25f('0x9')]()['then'](agentReportPreview[_0xa25f('0xb')](_0x1bca18))[_0xa25f('0xc')](loggerCatch(_0xa25f('0xd')));}function moveContact(_0x22df56){return BPromise['resolve']()[_0xa25f('0xa')](cmHopper[_0xa25f('0xe')](_0x22df56,!![]))['catch'](loggerCatch(_0xa25f('0xf')));}exports[_0xa25f('0x10')]=function(_0x50bb78){return BPromise[_0xa25f('0x9')]()[_0xa25f('0xa')](cmHopperBlack[_0xa25f('0x10')](_0x50bb78))[_0xa25f('0xc')](loggerCatch(_0xa25f('0x11')));};exports[_0xa25f('0x12')]=function(_0x46cd8c){return BPromise[_0xa25f('0x9')]()[_0xa25f('0xa')](cmHopper[_0xa25f('0x12')](_0x46cd8c))[_0xa25f('0xc')](loggerCatch(_0xa25f('0x13')));};exports['createHistory']=function(_0x2d4f0f,_0x471679){create(_0x2d4f0f)[_0xa25f('0xc')](loggerCatch(_0x471679));moveContact(_0x2d4f0f)[_0xa25f('0xc')](loggerCatch(_0x471679));};exports[_0xa25f('0x14')]=function(_0x427105,_0x4a4805){createAgent(_0x427105)[_0xa25f('0xc')](loggerCatch(_0x4a4805));};exports['createCustomerHistory']=function(_0x32b868,_0x562573){create(_0x32b868)['catch'](loggerCatch(_0x562573));};exports[_0xa25f('0x15')]=function(_0x489c83,_0x46bb31){moveContact(_0x489c83)[_0xa25f('0xc')](loggerCatch(_0x46bb31));};exports[_0xa25f('0x16')]=function(_0x3c2665,_0x21d035,_0x504135){if(_0x21d035){_0x3c2665[_0xa25f('0x17')]=null;}if(_0x504135){_0x3c2665[_0xa25f('0x18')]=![];}return BPromise[_0xa25f('0x9')]()[_0xa25f('0xa')](cmHopper['rescheduleContact'](_0x3c2665))[_0xa25f('0xc')](loggerCatch(_0xa25f('0x19')));};exports[_0xa25f('0x1a')]=function(_0x3675b5){return BPromise['resolve']()[_0xa25f('0xa')](cmHopper[_0xa25f('0x1a')](_0x3675b5))[_0xa25f('0xc')](loggerCatch(_0xa25f('0x1b')));};exports['unlockContact']=function(_0x2812d7){return BPromise[_0xa25f('0x9')]()['then'](cmHopper[_0xa25f('0x1c')]({'UserId':null},_0x2812d7,0x1))['catch'](loggerCatch(_0xa25f('0x1d')));};exports['disableContact']=function(_0x1e1fbd){return BPromise[_0xa25f('0x9')]()['then'](cmHopper[_0xa25f('0x1c')]({'active':![]},_0x1e1fbd,0x1))[_0xa25f('0xc')](loggerCatch('[activeContact]\x20'));};exports[_0xa25f('0x1e')]=function(_0x5d39c7){var _0x1030c4={};_0x1030c4[_0xa25f('0x1f')]=_0x5d39c7[_0xa25f('0x1f')];_0x1030c4[_0xa25f('0x20')]=_0x5d39c7[_0xa25f('0x20')];_0x1030c4['calleridnum']=_0x5d39c7[_0xa25f('0x21')];_0x1030c4[_0xa25f('0x22')]=_0x5d39c7[_0xa25f('0x22')];_0x1030c4[_0xa25f('0x23')]=_0x5d39c7[_0xa25f('0x23')];_0x1030c4['queuecallerjoinAt']=_0x5d39c7[_0xa25f('0x24')];_0x1030c4[_0xa25f('0x25')]=_0x5d39c7[_0xa25f('0x24')];_0x1030c4[_0xa25f('0x26')]=0x1;_0x1030c4[_0xa25f('0x27')]=_0x5d39c7[_0xa25f('0x28')];_0x1030c4[_0xa25f('0x29')]=_0x5d39c7[_0xa25f('0x2a')];_0x1030c4[_0xa25f('0x2b')]='from-sip';_0x1030c4['exten']='xcally-motion-preview';_0x1030c4[_0xa25f('0x2c')]=0x0;_0x1030c4[_0xa25f('0x2d')]=0x1;_0x1030c4[_0xa25f('0x2e')]=_0x5d39c7[_0xa25f('0x2a')];_0x1030c4[_0xa25f('0x2f')]=_0xa25f('0x30');return BPromise[_0xa25f('0x9')]()[_0xa25f('0xa')](voiceQueueReport[_0xa25f('0x31')](_0x1030c4))[_0xa25f('0xc')](loggerCatch(_0xa25f('0x32')));};exports['getContactRecallMe']=function(_0x58ee76,_0xeb44b1){return BPromise[_0xa25f('0x9')]()[_0xa25f('0xa')](cmHopper['getContactRecallMe'](_0x58ee76,_0xeb44b1))['catch'](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xa25f('0x33')]=function(_0x25952d){return BPromise[_0xa25f('0x9')]()['then'](cmHopper['rescheduleContact'](_0x25952d,!![],!![]))[_0xa25f('0xc')](loggerCatch(_0xa25f('0x34')));}; \ 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 14e9d1d..14fc9bb 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 _0xacc6=['timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','queue','agentReadyId','not_inuse','status','reachable','diff','createBody','CampaignId','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','error','inspect','info','loggerError','logger2','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','name','calleridname','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','%s%s','XMD-','toUpper','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','logAgent','YYYY-MM-DD\x20HH:mm:ss','responsetime','logLookAgent','membername','endtime','ringtime','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','calleridnum','from-sip'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xacc6,0x150));var _0x6acc=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xacc6[_0x5a1a51];return _0x47edd7;};'use strict';var util=require(_0x6acc('0x0'));var _=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var logger=require(_0x6acc('0x3'))(_0x6acc('0x4'));var ipAgi=process['env'][_0x6acc('0x5')]||_0x6acc('0x6');function getSeconds(_0x2ff2ff,_0x53dcdb){var _0x148455=moment(_0x2ff2ff)['milliseconds'](0x0);var _0xae1fa2=moment(_0x53dcdb)[_0x6acc('0x7')](0x0);return _0x148455['diff'](_0xae1fa2,_0x6acc('0x8'));}exports['loggerCatch']=function(_0x1f95e8){return function(_0x538730){logger[_0x6acc('0x9')](_0x1f95e8,util[_0x6acc('0xa')](_0x538730,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1343cb,_0x4cf4c7){logger[_0x6acc('0xb')](_0x1343cb,util[_0x6acc('0xa')](_0x4cf4c7,{'showHidden':![],'depth':null}));};exports[_0x6acc('0xc')]=function(_0x112778,_0x23779b){logger[_0x6acc('0x9')](_0x112778,util['inspect'](_0x23779b,{'showHidden':![],'depth':null}));};exports[_0x6acc('0xd')]=function(_0x6dba13){return function(_0x1d951c){logger[_0x6acc('0xb')](_0x6dba13,util[_0x6acc('0xa')](_0x1d951c,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x5c6aed,_0x15674a,_0x497356){return{'message':_0x5c6aed,'unlock':_0x15674a,'active':_0x497356};};exports[_0x6acc('0xe')]=function(_0x230318,_0x3c0afb,_0x2e3e01){if(!_[_0x6acc('0xf')](_0x2e3e01)&&_0x6acc('0x10')===typeof _0x2e3e01&&!_[_0x6acc('0x11')](_0x2e3e01)){if(!_[_0x6acc('0xf')](_0x3c0afb)&&_0x6acc('0x10')===typeof _0x3c0afb&&!_[_0x6acc('0x11')](_0x3c0afb)){return util[_0x6acc('0x12')](_0x6acc('0x13'),_0x3c0afb,_0x2e3e01);}return util[_0x6acc('0x12')](_0x6acc('0x13'),_0x2e3e01,_0x2e3e01);}if(!_[_0x6acc('0xf')](_0x230318)&&_0x6acc('0x10')===typeof _0x230318&&!_['isEmpty'](_0x230318)){return _0x230318;}return _0x6acc('0x14');};exports[_0x6acc('0x15')]=function(_0x37a627){if(_[_0x6acc('0x16')](_0x37a627)){return![];}return _0x37a627;};exports['addVariables']=function(_0x342043,_0x531f7c,_0x51dea7,_0x4af9e,_0x5d5382,_0x4552c7){var _0x3edf4a={'XMD-QUEUE':_0x531f7c[_0x6acc('0x17')]?_0x531f7c[_0x6acc('0x17')][_0x6acc('0x18')]:'','XMD-CALLERID':_0x4af9e,'XMD-CALLERID-PREVIEW':_0x4552c7?util['format'](_0x6acc('0x13'),_0x4552c7[_0x6acc('0x19')],_0x4552c7['calleridnum']):_0x4af9e,'XMD-DIALID':_0x5d5382,'XMD-CONTACTID':_0x531f7c[_0x6acc('0x1a')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4af9e,'XMD-VOICEQUEUEID':_0x531f7c[_0x6acc('0x1b')],'XMD-DIALCHANNEL':_0x51dea7,'XMD-DIALTIMEOUT':_0x342043[_0x6acc('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x6acc('0x12')](_0x6acc('0x1d'),_0x342043['dialQueueProject2']?'g':'',_[_0x6acc('0x11')](_0x342043[_0x6acc('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x342043[_0x6acc('0x1f')]||'','XMD-AGI':_0x342043[_0x6acc('0x20')]?util[_0x6acc('0x12')](_0x6acc('0x21'),ipAgi,_0x342043[_0x6acc('0x20')]):_0x6acc('0x22'),'XMD-AGIAFTER':_0x342043[_0x6acc('0x23')]?util[_0x6acc('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x342043[_0x6acc('0x23')]):_0x6acc('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x4552c7?_0x4552c7[_0x6acc('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x4552c7?_0x4552c7[_0x6acc('0x25')]:'','XMD-DESTINATION':_0x6acc('0x26')};if(!_[_0x6acc('0x11')](_0x342043[_0x6acc('0x1e')])){_0x3edf4a[util[_0x6acc('0x12')]('%s',_0x6acc('0x27'))]=_0x342043[_0x6acc('0x1e')];_0x3edf4a[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x5d5382;}if(_0x531f7c&&_0x531f7c['Contact']){for(var _0x5b6fab in _0x531f7c[_0x6acc('0x28')]){if(_0x531f7c[_0x6acc('0x28')][_0x6acc('0x29')](_0x5b6fab)){if(!_[_0x6acc('0x16')](_0x531f7c[_0x6acc('0x28')][_0x5b6fab])&&_0x5b6fab!=='id'&&_0x5b6fab!==_0x6acc('0x2a')&&_0x5b6fab!=='createdAt'&&_0x5b6fab!=='updatedAt'){_0x3edf4a[util[_0x6acc('0x12')](_0x6acc('0x2b'),_0x6acc('0x2c'),_[_0x6acc('0x2d')](_0x5b6fab))]=_0x531f7c['Contact'][_0x5b6fab];}}}}return _0x3edf4a;};exports[_0x6acc('0x2e')]=function(_0x2c0bf4){var _0x59a327={};for(var _0x46e7f5 in _0x2c0bf4){if(_0x2c0bf4[_0x6acc('0x29')](_0x46e7f5)){_0x59a327[util[_0x6acc('0x12')]('%s',_['toLower'](_0x46e7f5))]=_0x2c0bf4[_0x46e7f5];}}return{'variables':_0x59a327};};exports['updateOriginated']=function(_0xa7bd17,_0x29dc9a){if(!_['isNil'](_0xa7bd17)){if(_0xa7bd17['hasOwnProperty'](_0x6acc('0x2f'))){if(_0xa7bd17[_0x6acc('0x2f')]>0x0){_0xa7bd17[_0x6acc('0x2f')]-=0x1;}else{logger['error'](_0x6acc('0x30'),_0x29dc9a);}}}else{logger[_0x6acc('0x9')](_0x6acc('0x31'),_0x29dc9a);}};exports[_0x6acc('0x32')]=function(_0x37544d){var _0x4e52dd=moment()[_0x6acc('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x37544d[_0x6acc('0x33')]=0xd;_0x37544d[_0x6acc('0x34')]='Blacklist';_0x37544d[_0x6acc('0x35')]=_0x4e52dd;_0x37544d['responsetime']=_0x4e52dd;_0x37544d['endtime']=_0x4e52dd;};exports[_0x6acc('0x36')]=function(_0x2f28cc,_0x11290e,_0x5bf680){var _0x96474d=moment()['format'](_0x6acc('0x37'));_0x2f28cc['state']=_0x11290e;_0x2f28cc[_0x6acc('0x34')]=_0x5bf680;_0x2f28cc[_0x6acc('0x38')]=_0x96474d;_0x2f28cc['ringtime']=getSeconds(_0x2f28cc[_0x6acc('0x38')],_0x2f28cc[_0x6acc('0x35')]);};exports[_0x6acc('0x39')]=function(_0x30d01d,_0x46f7db,_0x327631){_0x30d01d[_0x6acc('0x3a')]=_0x46f7db;_0x30d01d['UserId']=_0x327631;};exports['logCustomer']=function(_0x3481ad,_0x3515dd,_0x11b0b1){var _0x540820=moment()[_0x6acc('0x12')](_0x6acc('0x37'));_0x3481ad[_0x6acc('0x33')]=_0x3515dd;_0x3481ad[_0x6acc('0x34')]=_0x11b0b1;_0x3481ad[_0x6acc('0x38')]=_0x3481ad[_0x6acc('0x38')]?_0x3481ad[_0x6acc('0x38')]:_0x540820;_0x3481ad[_0x6acc('0x3b')]=_0x3481ad[_0x6acc('0x3b')]?_0x3481ad[_0x6acc('0x3b')]:_0x540820;_0x3481ad[_0x6acc('0x3c')]=getSeconds(_0x3481ad[_0x6acc('0x38')]||0x0,_0x3481ad['starttime']||0x0);_0x3481ad['talktime']=_0x3481ad['answertime']?getSeconds(_0x3481ad[_0x6acc('0x3b')],_0x3481ad['answertime']):0x0;};exports['isFailure']=function(_0x20369a){return _0x20369a===_0x6acc('0x3d');};exports[_0x6acc('0x3e')]=function(_0xdfbb9a,_0x258ce9,_0x26c821,_0x4748d3,_0x2c0be8){var _0x1720f7=_0x4748d3?_0x6acc('0x3f'):_0xdfbb9a[_0x6acc('0x19')];_0x1720f7=_0x2c0be8?_0x6acc('0x40'):_0x1720f7;return{'actionid':_0xdfbb9a[_0x6acc('0x41')],'action':'originate','channel':_0xdfbb9a[_0x6acc('0x42')],'callerid':util[_0x6acc('0x12')]('\x22%s\x22\x20<%s>',_0x1720f7,_0xdfbb9a[_0x6acc('0x43')]),'Exten':'xcally-motion-preview','Context':_0x6acc('0x44'),'Priority':'1','variable':_0x26c821,'timeout':(_0x258ce9[_0x6acc('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0xdfbb9a['uniqueid']};};exports[_0x6acc('0x46')]=function(_0x1b5544){return _0x1b5544[_0x6acc('0x47')]+_0x1b5544[_0x6acc('0x48')]+_0x1b5544[_0x6acc('0x49')]+_0x1b5544['countagentrejectretry']+_0x1b5544[_0x6acc('0x4a')];};exports[_0x6acc('0x4b')]=function(_0x45c5e0){var _0x40c879=_[_0x6acc('0x4c')](_0x45c5e0);_0x40c879[_0x6acc('0x33')]=0xf;_0x40c879[_0x6acc('0x34')]=_0x6acc('0x4d');return _0x40c879;};exports[_0x6acc('0x4e')]=function(_0x28e601,_0x1989a6,_0x2344a7){var _0x2b4d94={};_0x2b4d94[_0x1989a6]=_0x28e601[_0x1989a6];_0x2b4d94[_0x6acc('0x4f')]=![];_0x2b4d94[_0x6acc('0x50')]=moment()[_0x6acc('0x51')](_0x2344a7,_0x6acc('0x52'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2b4d94['ContactId']=_0x28e601[_0x6acc('0x1a')];_0x2b4d94[_0x6acc('0x53')]=_0x28e601['ListId'];_0x2b4d94[_0x6acc('0x1b')]=_0x28e601[_0x6acc('0x1b')]||undefined;return _0x2b4d94;};exports[_0x6acc('0x54')]=function(_0x439f3c,_0x514fa1){if(!_[_0x6acc('0x16')](_0x439f3c)){if(_0x439f3c[_0x6acc('0x55')]>0x0){_0x439f3c[_0x6acc('0x55')]-=0x1;}else{logger[_0x6acc('0x9')](_0x514fa1,_0x6acc('0x56'));}}else{logger['error'](_0x514fa1,_0x6acc('0x57'));}};exports[_0x6acc('0x58')]=function(_0x22458f){if(_0x22458f<=0x0){return!![];}return![];};exports['buildObj']=function(_0x13dfc2,_0x258e81){_0x13dfc2[_0x6acc('0x59')]=_0x258e81;_0x13dfc2[_0x6acc('0x18')]=_0x13dfc2['queue'];_0x13dfc2[_0x6acc('0x5a')]=_0x13dfc2[_0x6acc('0x42')];return _0x13dfc2;};exports['buildAcw']=function(_0x362613){var _0x48b8e1={};_0x48b8e1['queue']=_0x362613[_0x6acc('0x5b')];_0x48b8e1[_0x6acc('0x5a')]=_0x362613[_0x6acc('0x42')];_0x48b8e1[_0x6acc('0x41')]=_0x362613['uniqueid'];return _0x48b8e1;};exports[_0x6acc('0x5c')]=function(_0x38be46){var _0x5140c4=[];for(var _0xae3072 in _0x38be46){if(_0x38be46[_0x6acc('0x29')](_0xae3072)){if(!_[_0x6acc('0x16')](_0x38be46[_0xae3072])&&_0x38be46[_0xae3072][_0x6acc('0x33')]===_0x6acc('0x5d')&&_0x38be46[_0xae3072][_0x6acc('0x5e')]===_0x6acc('0x5f')){_0x5140c4['push'](_0x38be46[_0xae3072]['id']);}}}return _0x5140c4;};exports['getDiff']=function(_0x4bd863){var _0x4caf0f=moment()[_0x6acc('0x7')](0x0);var _0x493bb9=moment(_0x4bd863)[_0x6acc('0x7')](0x0);return _0x4caf0f[_0x6acc('0x60')](_0x493bb9,'seconds');};exports[_0x6acc('0x61')]=function(_0x4bcb57){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4bcb57[_0x6acc('0x1a')],'ListId':_0x4bcb57[_0x6acc('0x53')],'VoiceQueueId':_0x4bcb57[_0x6acc('0x1b')]||undefined,'CampaignId':_0x4bcb57[_0x6acc('0x62')]||undefined};};exports['filterKey']=function(_0x4cf817){if(_0x4cf817==='uniqueid'||_0x4cf817==='idContact'||_0x4cf817==='queue'||_0x4cf817===_0x6acc('0x63')||_0x4cf817===_0x6acc('0x64')||_0x4cf817===_0x6acc('0x65')||_0x4cf817===_0x6acc('0x3a')||_0x4cf817==='channelAgent'||_0x4cf817==='calleridname'||_0x4cf817===_0x6acc('0x4f')||_0x4cf817==='calleridnum'||_0x4cf817===_0x6acc('0x50')||_0x4cf817==='countbusyretry'||_0x4cf817===_0x6acc('0x48')||_0x4cf817===_0x6acc('0x49')||_0x4cf817===_0x6acc('0x66')||_0x4cf817===_0x6acc('0x67')||_0x4cf817===_0x6acc('0x68')||_0x4cf817===_0x6acc('0x69')||_0x4cf817===_0x6acc('0x6a')||_0x4cf817===_0x6acc('0x1a')||_0x4cf817===_0x6acc('0x53')||_0x4cf817===_0x6acc('0x6b')||_0x4cf817===_0x6acc('0x1b')||_0x4cf817===_0x6acc('0x6c')||_0x4cf817===_0x6acc('0x6d')||_0x4cf817===_0x6acc('0x6e')||_0x4cf817===_0x6acc('0x6f')||_0x4cf817===_0x6acc('0x70')||_0x4cf817===_0x6acc('0x71')||_0x4cf817===_0x6acc('0x72')||_0x4cf817===_0x6acc('0x73')||_0x4cf817==='xmd-dialid'||_0x4cf817===_0x6acc('0x74')||_0x4cf817==='xmd-contactid'||_0x4cf817===_0x6acc('0x75')||_0x4cf817==='xmd-callerid'||_0x4cf817===_0x6acc('0x76')||_0x4cf817==='xmd-agi'||_0x4cf817===_0x6acc('0x77')||_0x4cf817==='rtpaudioqosbridged'||_0x4cf817==='rtpaudioqosjitter'||_0x4cf817===_0x6acc('0x78')||_0x4cf817===_0x6acc('0x79')||_0x4cf817==='rtpaudioqoslossbridged'||_0x4cf817===_0x6acc('0x7a')||_0x4cf817===_0x6acc('0x7b')||_0x4cf817===_0x6acc('0x77')||_0x4cf817==='rtpaudioqosbridged'||_0x4cf817===_0x6acc('0x7c')||_0x4cf817===_0x6acc('0x78')||_0x4cf817===_0x6acc('0x79')||_0x4cf817===_0x6acc('0x7d')||_0x4cf817==='rtpaudioqosrtt'||_0x4cf817==='rtpaudioqosrttbridged'||_0x4cf817===_0x6acc('0x7e')||_0x4cf817===_0x6acc('0x7f')||_0x4cf817===_0x6acc('0x33')||_0x4cf817==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x3d3547,_0x3aefe2){var _0x211f48,_0x4eb598,_0x51f5c3;if(_0x3aefe2<=0x0){_0x3aefe2=0x1;}_0x211f48=new RegExp(_0x6acc('0x80')+_0x3aefe2+'}$');_0x4eb598=Math[_0x6acc('0x81')](0xa,_0x3aefe2-0x1);_0x51f5c3=Math[_0x6acc('0x81')](0xa,_0x3aefe2)-0x1;return util['format']('%s',_[_0x6acc('0x82')](_0x3d3547,_0x211f48,_[_0x6acc('0x83')](_0x4eb598,_0x51f5c3)));};exports[_0x6acc('0x84')]=function(_0x161b88){var _0xf3f6c4=_0x161b88[_0x6acc('0x85')](/"(.*?)"/);return _0xf3f6c4?_0xf3f6c4[0x1]:_0x161b88;};exports[_0x6acc('0x86')]=function(_0x358824){var _0x1b20dd=_0x358824[_0x6acc('0x85')](/<(.*?)>/);return _0x1b20dd?_0x1b20dd[0x1]:_0x358824;}; \ No newline at end of file +var _0x676c=['logger2','message','getCallerId','string','isEmpty','\x22%s\x22\x20<%s>','format','isUndefined','isActive','addVariables','calleridname','dialer','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','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','logAgent','responsetime','ringtime','starttime','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','BOOKED','uniqueid','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','buildAcw','interface','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','membername','countglobal','callback','callbackuniqueid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','inspect','logger','info','loggerError','error'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x676c,0x198));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xc676('0x0'));var _=require(_0xc676('0x1'));var moment=require(_0xc676('0x2'));var logger=require('../../../../config/logger')(_0xc676('0x3'));var ipAgi=process[_0xc676('0x4')][_0xc676('0x5')]||_0xc676('0x6');function getSeconds(_0x22b173,_0x2802bf){var _0x4e82ea=moment(_0x22b173)[_0xc676('0x7')](0x0);var _0x228e07=moment(_0x2802bf)[_0xc676('0x7')](0x0);return _0x4e82ea[_0xc676('0x8')](_0x228e07,_0xc676('0x9'));}exports['loggerCatch']=function(_0x26ad9c){return function(_0x5e8ad4){logger['error'](_0x26ad9c,util[_0xc676('0xa')](_0x5e8ad4,{'showHidden':![],'depth':null}));};};exports[_0xc676('0xb')]=function(_0x4aa733,_0x5085b6){logger[_0xc676('0xc')](_0x4aa733,util[_0xc676('0xa')](_0x5085b6,{'showHidden':![],'depth':null}));};exports[_0xc676('0xd')]=function(_0x4e72ff,_0x5c9329){logger[_0xc676('0xe')](_0x4e72ff,util[_0xc676('0xa')](_0x5c9329,{'showHidden':![],'depth':null}));};exports[_0xc676('0xf')]=function(_0x1e06ec){return function(_0x5e8565){logger[_0xc676('0xc')](_0x1e06ec,util[_0xc676('0xa')](_0x5e8565,{'showHidden':![],'depth':null}));};};exports[_0xc676('0x10')]=function(_0x23184f,_0x47adff,_0xcee1c5){return{'message':_0x23184f,'unlock':_0x47adff,'active':_0xcee1c5};};exports[_0xc676('0x11')]=function(_0x4f8832,_0x274463,_0x4fbfb7){if(!_['isUndefined'](_0x4fbfb7)&&_0xc676('0x12')===typeof _0x4fbfb7&&!_['isEmpty'](_0x4fbfb7)){if(!_['isUndefined'](_0x274463)&&'string'===typeof _0x274463&&!_[_0xc676('0x13')](_0x274463)){return util['format'](_0xc676('0x14'),_0x274463,_0x4fbfb7);}return util[_0xc676('0x15')](_0xc676('0x14'),_0x4fbfb7,_0x4fbfb7);}if(!_[_0xc676('0x16')](_0x4f8832)&&_0xc676('0x12')===typeof _0x4f8832&&!_[_0xc676('0x13')](_0x4f8832)){return _0x4f8832;}return'\x22\x22\x20<>';};exports[_0xc676('0x17')]=function(_0x289ed9){if(_['isNil'](_0x289ed9)){return![];}return _0x289ed9;};exports[_0xc676('0x18')]=function(_0xfc64cb,_0x1bd9d9,_0x27afd,_0x26a00b,_0x87b27d,_0x474ad2){var _0xc533a9={'XMD-QUEUE':_0x1bd9d9['Queue']?_0x1bd9d9['Queue']['name']:'','XMD-CALLERID':_0x26a00b,'XMD-CALLERID-PREVIEW':_0x474ad2?util[_0xc676('0x15')]('\x22%s\x22\x20<%s>',_0x474ad2[_0xc676('0x19')],_0x474ad2['calleridnum']):_0x26a00b,'XMD-DIALID':_0x87b27d,'XMD-CONTACTID':_0x1bd9d9['ContactId'],'XMD-CDRTYPE':_0xc676('0x1a'),'CALLERID(all)':_0x26a00b,'XMD-VOICEQUEUEID':_0x1bd9d9['VoiceQueueId'],'XMD-DIALCHANNEL':_0x27afd,'XMD-DIALTIMEOUT':_0xfc64cb[_0xc676('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0xc676('0x15')](_0xc676('0x1c'),_0xfc64cb[_0xc676('0x1d')]?'g':'',_[_0xc676('0x13')](_0xfc64cb['monitor_format'])?'':_0xc676('0x1e')),'XMD-DIALURL':_0xfc64cb[_0xc676('0x1f')]||'','XMD-AGI':_0xfc64cb[_0xc676('0x20')]?util['format'](_0xc676('0x21'),ipAgi,_0xfc64cb['dialQueueProject']):_0xc676('0x22'),'XMD-AGIAFTER':_0xfc64cb[_0xc676('0x1d')]?util['format'](_0xc676('0x21'),ipAgi,_0xfc64cb[_0xc676('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x474ad2?_0x474ad2[_0xc676('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x474ad2?_0x474ad2[_0xc676('0x24')]:'','XMD-DESTINATION':_0xc676('0x25')};if(!_['isEmpty'](_0xfc64cb[_0xc676('0x26')])){_0xc533a9[util[_0xc676('0x15')]('%s',_0xc676('0x27'))]=_0xfc64cb[_0xc676('0x26')];_0xc533a9[util[_0xc676('0x15')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x87b27d;}if(_0x1bd9d9&&_0x1bd9d9[_0xc676('0x28')]){for(var _0x19338b in _0x1bd9d9[_0xc676('0x28')]){if(_0x1bd9d9[_0xc676('0x28')][_0xc676('0x29')](_0x19338b)){if(!_['isNil'](_0x1bd9d9[_0xc676('0x28')][_0x19338b])&&_0x19338b!=='id'&&_0x19338b!==_0xc676('0x2a')&&_0x19338b!==_0xc676('0x2b')&&_0x19338b!==_0xc676('0x2c')){_0xc533a9[util['format'](_0xc676('0x2d'),_0xc676('0x2e'),_[_0xc676('0x2f')](_0x19338b))]=_0x1bd9d9[_0xc676('0x28')][_0x19338b];}}}}return _0xc533a9;};exports[_0xc676('0x30')]=function(_0x3a38e0){var _0x1662c5={};for(var _0x30b018 in _0x3a38e0){if(_0x3a38e0[_0xc676('0x29')](_0x30b018)){_0x1662c5[util['format']('%s',_['toLower'](_0x30b018))]=_0x3a38e0[_0x30b018];}}return{'variables':_0x1662c5};};exports['updateOriginated']=function(_0x1c4120,_0x3cd065){if(!_[_0xc676('0x31')](_0x1c4120)){if(_0x1c4120[_0xc676('0x29')]('originated')){if(_0x1c4120[_0xc676('0x32')]>0x0){_0x1c4120[_0xc676('0x32')]-=0x1;}else{logger[_0xc676('0xe')](_0xc676('0x33'),_0x3cd065);}}}else{logger[_0xc676('0xe')](_0xc676('0x34'),_0x3cd065);}};exports['logBlacklist']=function(_0x51d533){var _0x41a3d8=moment()['format'](_0xc676('0x35'));_0x51d533[_0xc676('0x36')]=0xd;_0x51d533[_0xc676('0x37')]=_0xc676('0x38');_0x51d533['starttime']=_0x41a3d8;_0x51d533['responsetime']=_0x41a3d8;_0x51d533['endtime']=_0x41a3d8;};exports[_0xc676('0x39')]=function(_0x25e35f,_0xde0c55,_0x2704b1){var _0x2d40bc=moment()[_0xc676('0x15')](_0xc676('0x35'));_0x25e35f[_0xc676('0x36')]=_0xde0c55;_0x25e35f[_0xc676('0x37')]=_0x2704b1;_0x25e35f[_0xc676('0x3a')]=_0x2d40bc;_0x25e35f[_0xc676('0x3b')]=getSeconds(_0x25e35f[_0xc676('0x3a')],_0x25e35f[_0xc676('0x3c')]);};exports[_0xc676('0x3d')]=function(_0x455c7a,_0x2cba1a,_0x2b23a5){_0x455c7a['membername']=_0x2cba1a;_0x455c7a[_0xc676('0x3e')]=_0x2b23a5;};exports[_0xc676('0x3f')]=function(_0x2020d7,_0x584058,_0x2ce4a2){var _0x1373b6=moment()[_0xc676('0x15')](_0xc676('0x35'));_0x2020d7[_0xc676('0x36')]=_0x584058;_0x2020d7[_0xc676('0x37')]=_0x2ce4a2;_0x2020d7[_0xc676('0x3a')]=_0x2020d7['responsetime']?_0x2020d7[_0xc676('0x3a')]:_0x1373b6;_0x2020d7['endtime']=_0x2020d7[_0xc676('0x40')]?_0x2020d7[_0xc676('0x40')]:_0x1373b6;_0x2020d7['ringtime']=getSeconds(_0x2020d7[_0xc676('0x3a')]||0x0,_0x2020d7[_0xc676('0x3c')]||0x0);_0x2020d7[_0xc676('0x41')]=_0x2020d7[_0xc676('0x42')]?getSeconds(_0x2020d7[_0xc676('0x40')],_0x2020d7['answertime']):0x0;};exports[_0xc676('0x43')]=function(_0x2a5be2){return _0x2a5be2===_0xc676('0x44');};exports['variablesAction']=function(_0x78dbea,_0x3c3b91,_0xf3fbd1,_0x40cbeb,_0x488087){var _0x138f11=_0x40cbeb?'RECALL':_0x78dbea[_0xc676('0x19')];_0x138f11=_0x488087?_0xc676('0x45'):_0x138f11;return{'actionid':_0x78dbea[_0xc676('0x46')],'action':'originate','channel':_0x78dbea[_0xc676('0x47')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x138f11,_0x78dbea[_0xc676('0x48')]),'Exten':'xcally-motion-preview','Context':_0xc676('0x49'),'Priority':'1','variable':_0xf3fbd1,'timeout':(_0x3c3b91['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x78dbea['uniqueid']};};exports[_0xc676('0x4a')]=function(_0x55bbdf){return _0x55bbdf[_0xc676('0x4b')]+_0x55bbdf['countcongestionretry']+_0x55bbdf[_0xc676('0x4c')]+_0x55bbdf[_0xc676('0x4d')]+_0x55bbdf[_0xc676('0x4e')];};exports[_0xc676('0x4f')]=function(_0x4d8d1d){var _0x4e3329=_[_0xc676('0x50')](_0x4d8d1d);_0x4e3329[_0xc676('0x36')]=0xf;_0x4e3329['statedesc']=_0xc676('0x51');return _0x4e3329;};exports[_0xc676('0x52')]=function(_0x59be1a,_0x38d1bc,_0x28d937){var _0xa9b988={};_0xa9b988[_0x38d1bc]=_0x59be1a[_0x38d1bc];_0xa9b988[_0xc676('0x53')]=![];_0xa9b988[_0xc676('0x54')]=moment()['add'](_0x28d937,_0xc676('0x55'))[_0xc676('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0xa9b988[_0xc676('0x56')]=_0x59be1a[_0xc676('0x56')];_0xa9b988[_0xc676('0x57')]=_0x59be1a[_0xc676('0x57')];_0xa9b988['VoiceQueueId']=_0x59be1a[_0xc676('0x58')]||undefined;return _0xa9b988;};exports[_0xc676('0x59')]=function(_0x3e0e1d,_0x42ea7a){if(!_['isNil'](_0x3e0e1d)){if(_0x3e0e1d[_0xc676('0x5a')]>0x0){_0x3e0e1d[_0xc676('0x5a')]-=0x1;}else{logger[_0xc676('0xe')](_0x42ea7a,_0xc676('0x5b'));}}else{logger[_0xc676('0xe')](_0x42ea7a,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xc676('0x5c')]=function(_0x25c3f8){if(_0x25c3f8<=0x0){return!![];}return![];};exports[_0xc676('0x5d')]=function(_0x4b8ede,_0x447311){_0x4b8ede[_0xc676('0x5e')]=_0x447311;_0x4b8ede['name']=_0x4b8ede[_0xc676('0x5f')];_0x4b8ede['interface']=_0x4b8ede[_0xc676('0x47')];return _0x4b8ede;};exports[_0xc676('0x60')]=function(_0x3ac42f){var _0x2c2b1a={};_0x2c2b1a[_0xc676('0x5f')]=_0x3ac42f[_0xc676('0x5f')];_0x2c2b1a[_0xc676('0x61')]=_0x3ac42f[_0xc676('0x47')];_0x2c2b1a[_0xc676('0x46')]=_0x3ac42f['uniqueid'];return _0x2c2b1a;};exports['agentReadyId']=function(_0x365dd3){var _0x1b4a16=[];for(var _0x7e6447 in _0x365dd3){if(_0x365dd3['hasOwnProperty'](_0x7e6447)){if(!_[_0xc676('0x31')](_0x365dd3[_0x7e6447])&&_0x365dd3[_0x7e6447]['state']===_0xc676('0x62')&&_0x365dd3[_0x7e6447][_0xc676('0x63')]===_0xc676('0x64')){_0x1b4a16[_0xc676('0x65')](_0x365dd3[_0x7e6447]['id']);}}}return _0x1b4a16;};exports[_0xc676('0x66')]=function(_0x2f3c5d){var _0xd9eead=moment()[_0xc676('0x7')](0x0);var _0x2a1025=moment(_0x2f3c5d)[_0xc676('0x7')](0x0);return _0xd9eead[_0xc676('0x8')](_0x2a1025,_0xc676('0x9'));};exports[_0xc676('0x67')]=function(_0x4fadac){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4fadac['ContactId'],'ListId':_0x4fadac['ListId'],'VoiceQueueId':_0x4fadac[_0xc676('0x58')]||undefined,'CampaignId':_0x4fadac[_0xc676('0x68')]||undefined};};exports[_0xc676('0x69')]=function(_0x3f4f17){if(_0x3f4f17===_0xc676('0x46')||_0x3f4f17===_0xc676('0x6a')||_0x3f4f17==='queue'||_0x3f4f17==='type'||_0x3f4f17===_0xc676('0x6b')||_0x3f4f17===_0xc676('0x6c')||_0x3f4f17===_0xc676('0x6d')||_0x3f4f17===_0xc676('0x47')||_0x3f4f17===_0xc676('0x19')||_0x3f4f17===_0xc676('0x53')||_0x3f4f17===_0xc676('0x48')||_0x3f4f17===_0xc676('0x54')||_0x3f4f17===_0xc676('0x4b')||_0x3f4f17==='countcongestionretry'||_0x3f4f17===_0xc676('0x4c')||_0x3f4f17===_0xc676('0x6e')||_0x3f4f17===_0xc676('0x6f')||_0x3f4f17===_0xc676('0x70')||_0x3f4f17==='callbackat'||_0x3f4f17==='recallme'||_0x3f4f17===_0xc676('0x56')||_0x3f4f17===_0xc676('0x57')||_0x3f4f17===_0xc676('0x3e')||_0x3f4f17===_0xc676('0x58')||_0x3f4f17==='sipcallid'||_0x3f4f17===_0xc676('0x71')||_0x3f4f17===_0xc676('0x72')||_0x3f4f17===_0xc676('0x73')||_0x3f4f17===_0xc676('0x74')||_0x3f4f17===_0xc676('0x75')||_0x3f4f17===_0xc676('0x76')||_0x3f4f17===_0xc676('0x77')||_0x3f4f17===_0xc676('0x78')||_0x3f4f17==='xmd-dialchannel'||_0x3f4f17===_0xc676('0x79')||_0x3f4f17===_0xc676('0x7a')||_0x3f4f17===_0xc676('0x7b')||_0x3f4f17===_0xc676('0x7c')||_0x3f4f17===_0xc676('0x7d')||_0x3f4f17===_0xc676('0x7e')||_0x3f4f17===_0xc676('0x7f')||_0x3f4f17===_0xc676('0x80')||_0x3f4f17===_0xc676('0x81')||_0x3f4f17===_0xc676('0x82')||_0x3f4f17===_0xc676('0x83')||_0x3f4f17===_0xc676('0x84')||_0x3f4f17===_0xc676('0x85')||_0x3f4f17==='rtpaudioqos'||_0x3f4f17==='rtpaudioqosbridged'||_0x3f4f17===_0xc676('0x80')||_0x3f4f17==='rtpaudioqosjitterbridged'||_0x3f4f17===_0xc676('0x82')||_0x3f4f17===_0xc676('0x83')||_0x3f4f17===_0xc676('0x84')||_0x3f4f17===_0xc676('0x85')||_0x3f4f17===_0xc676('0x86')||_0x3f4f17===_0xc676('0x87')||_0x3f4f17===_0xc676('0x36')||_0x3f4f17===_0xc676('0x37')){return![];}return!![];};exports[_0xc676('0x88')]=function(_0x409a18,_0x18219d){var _0x4ab37a,_0x1c6699,_0x4c3d34;if(_0x18219d<=0x0){_0x18219d=0x1;}_0x4ab37a=new RegExp(_0xc676('0x89')+_0x18219d+'}$');_0x1c6699=Math[_0xc676('0x8a')](0xa,_0x18219d-0x1);_0x4c3d34=Math['pow'](0xa,_0x18219d)-0x1;return util[_0xc676('0x15')]('%s',_['replace'](_0x409a18,_0x4ab37a,_['random'](_0x1c6699,_0x4c3d34)));};exports[_0xc676('0x8b')]=function(_0x38f9ac){var _0x387c57=_0x38f9ac[_0xc676('0x8c')](/"(.*?)"/);return _0x387c57?_0x387c57[0x1]:_0x38f9ac;};exports['extractCalleridNumber']=function(_0x21b860){var _0x51fdec=_0x21b860[_0xc676('0x8c')](/<(.*?)>/);return _0x51fdec?_0x51fdec[0x1]:_0x21b860;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 573ddf1..a8296d5 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 _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x3ec8e2,_0x1a74a9){var _0xbb1dc7=function(_0x5ddeb6){while(--_0x5ddeb6){_0x3ec8e2['push'](_0x3ec8e2['shift']());}};_0xbb1dc7(++_0x1a74a9);}(_0xb10b,0x12a));var _0xbb10=function(_0x34ebf3,_0x5935c5){_0x34ebf3=_0x34ebf3-0x0;var _0x3a634d=_0xb10b[_0x34ebf3];return _0x3a634d;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x4766d2,_0x1c832c){var _0xa8f44b=function(_0x59a101){while(--_0x59a101){_0x4766d2['push'](_0x4766d2['shift']());}};_0xa8f44b(++_0x1c832c);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd6e799,_0x253932){_0xd6e799=_0xd6e799-0x0;var _0x1ce8cf=_0x5f2f[_0xd6e799];return _0x1ce8cf;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index fa14056..1ff59c3 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 _0x1899=['../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','timers','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','SIP/%s','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','length','initTrunks','trunks','initVoiceQueues','initTriggers','triggers','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','merge','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template'];(function(_0x40d339,_0xb726c3){var _0x5cbd0b=function(_0xf239d3){while(--_0xf239d3){_0x40d339['push'](_0x40d339['shift']());}};_0x5cbd0b(++_0xb726c3);}(_0x1899,0x148));var _0x9189=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x1899[_0x11005e];return _0x29338f;};'use strict';var BPromise=require(_0x9189('0x0'));var util=require('util');var _=require(_0x9189('0x1'));var moment=require(_0x9189('0x2'));var Agent=require(_0x9189('0x3'));var Telephone=require(_0x9189('0x4'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0x9189('0x5'));var Trigger=require(_0x9189('0x6'));var Template=require(_0x9189('0x7'));var Campaign=require(_0x9189('0x8'));var VoiceExtension=require(_0x9189('0x9'));var ZendeskAccount=require(_0x9189('0xa'));var SalesforceAccount=require(_0x9189('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x9189('0xc'));var ZohoAccount=require(_0x9189('0xd'));var DeskAccount=require(_0x9189('0xe'));var VtigerAccount=require(_0x9189('0xf'));var ServicenowAccount=require(_0x9189('0x10'));var Dynamics365Account=require(_0x9189('0x11'));var FreshsalesAccount=require(_0x9189('0x12'));var FaxAccount=require(_0x9189('0x13'));var Realtime=function(){this[_0x9189('0x14')]={};this[_0x9189('0x15')]={};this['trunks']={};this[_0x9189('0x16')]={};this['triggers']={};this[_0x9189('0x17')]={};this[_0x9189('0x18')]={};this[_0x9189('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9189('0x1a')]={};this[_0x9189('0x1b')]={};this[_0x9189('0x1c')]={};this['outboundChannels']={};this[_0x9189('0x1d')]={};this['zendeskAccounts']={};this[_0x9189('0x1e')]={};this[_0x9189('0x1f')]={};this['freshdeskAccounts']={};this[_0x9189('0x20')]={};this[_0x9189('0x21')]={};this[_0x9189('0x22')]={};this[_0x9189('0x23')]={};this[_0x9189('0x24')]={};this['freshsalesAccounts']={};this[_0x9189('0x25')]={};};function freeIsNotKey(_0x4d2918,_0x1ff9fe,_0x42d6cc){var _0x3a0981=_[_0x9189('0x26')](_0x4d2918,function(_0xad445f,_0x25e748){return _0xad445f[_0x42d6cc];});for(var _0x4c7c1e in _0x1ff9fe){if(_0x1ff9fe[_0x9189('0x27')](_0x4c7c1e)){if(!_0x3a0981[_0x4c7c1e]){delete _0x1ff9fe[_0x4c7c1e];}}}}function freeIsNotKeySip(_0x298efa,_0x248f84){var _0x37cbe7=_[_0x9189('0x26')](_0x298efa,function(_0x37193a,_0x4c144a){return util[_0x9189('0x28')]('SIP/%s',_0x37193a[_0x9189('0x29')]);});for(var _0x52c075 in _0x248f84){if(_0x248f84[_0x9189('0x27')](_0x52c075)){if(!_0x37cbe7[_0x52c075]){delete _0x248f84[_0x52c075];}}}}function freeIsNotKeyAgent(_0x4f8f15,_0x406e8c){var _0x1d0284=_['mapKeys'](_0x4f8f15,function(_0x444b7d,_0xd2df72){var _0x28312a=_[_0x9189('0x2a')](_0x444b7d['interface'])?util[_0x9189('0x28')](_0x9189('0x2b'),_0x444b7d['name']):_0x444b7d[_0x9189('0x2c')];return _0x28312a;});for(var _0x514977 in _0x406e8c){if(_0x406e8c[_0x9189('0x27')](_0x514977)){if(!_0x1d0284[_0x514977]){delete _0x406e8c[_0x514977];}}}}function clearVoiceCallReports(_0x12bd2c){_0x12bd2c[_0x9189('0x2d')]=0x0;_0x12bd2c['answered']=0x0;_0x12bd2c[_0x9189('0x2e')]=0x0;_0x12bd2c[_0x9189('0x2f')]=0x0;_0x12bd2c[_0x9189('0x30')]=0x0;}function clearCampaigns(_0x33d3ea){if(!_[_0x9189('0x31')](_0x33d3ea)){for(var _0x5f3cc1 in _0x33d3ea){if(_0x33d3ea[_0x9189('0x27')](_0x5f3cc1)){_0x33d3ea[_0x5f3cc1][_0x9189('0x32')]=0x0;_0x33d3ea[_0x5f3cc1][_0x9189('0x33')]=0x0;}}}}function clearVoiceQueues(_0x4dcbea){if(!_[_0x9189('0x31')](_0x4dcbea)){for(var _0x3ed31a in _0x4dcbea){if(_0x4dcbea[_0x9189('0x27')](_0x3ed31a)){_0x4dcbea[_0x3ed31a][_0x9189('0x2d')]=0x0;_0x4dcbea[_0x3ed31a]['answered']=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x34')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x35')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x2e')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x2f')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x30')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x36')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x37')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x38')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x39')]=0x0;_0x4dcbea[_0x3ed31a]['outboundNoSuchCallsDay']=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x3a')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x3b')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x3c')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x3d')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x3e')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x3f')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x40')]=0x0;_0x4dcbea[_0x3ed31a]['outboundAnswerAgiCallsDay']=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x41')]=0x0;_0x4dcbea[_0x3ed31a][_0x9189('0x42')]=!![];}}}}Realtime[_0x9189('0x43')][_0x9189('0x44')]=function(_0x187b90,_0x37637b){for(var _0x48bea9 in _0x37637b){if(_0x187b90[_0x9189('0x27')](_0x48bea9)){_0x187b90[_0x48bea9]=_0x37637b[_0x48bea9];}}};Realtime[_0x9189('0x43')][_0x9189('0x45')]=function(){var _0x1dfa57=this;return function(_0x7ca44e){if(_0x7ca44e){freeIsNotKeyAgent(_0x7ca44e,_0x1dfa57[_0x9189('0x14')]);for(var _0x1fa41d=0x0,_0x4c87f7={},_0xce9db6={};_0x1fa41d<_0x7ca44e['length'];_0x1fa41d+=0x1){_0x4c87f7=_0x7ca44e[_0x1fa41d];var _0x5db4c0=_['isNil'](_0x4c87f7[_0x9189('0x2c')])?util['format'](_0x9189('0x2b'),_0x4c87f7['name']):_0x4c87f7[_0x9189('0x2c')];if(_[_0x9189('0x46')](_0x1dfa57[_0x9189('0x14')][_0x5db4c0])){_0x1dfa57[_0x9189('0x14')][_0x5db4c0]=new Agent(_0x4c87f7);}else{_0x1dfa57[_0x9189('0x44')](_0x1dfa57[_0x9189('0x14')][_0x5db4c0],_0x4c87f7);}}}return _0x1dfa57['agents'];};};Realtime[_0x9189('0x43')][_0x9189('0x47')]=function(){var _0x564756=this;return function(_0x12ce60){if(_0x12ce60){freeIsNotKeySip(_0x12ce60,_0x564756[_0x9189('0x15')]);for(var _0x34a86e=0x0,_0x415271={},_0x46936a={};_0x34a86e<_0x12ce60[_0x9189('0x48')];_0x34a86e+=0x1){_0x415271=_0x12ce60[_0x34a86e];if(_[_0x9189('0x46')](_0x564756[_0x9189('0x15')][util[_0x9189('0x28')](_0x9189('0x2b'),_0x415271[_0x9189('0x29')])])){_0x564756['telephones'][util[_0x9189('0x28')]('SIP/%s',_0x415271[_0x9189('0x29')])]=new Telephone(_0x415271);}else{_0x564756[_0x9189('0x44')](_0x564756[_0x9189('0x15')][util[_0x9189('0x28')](_0x9189('0x2b'),_0x415271['name'])],_0x415271);}}}return _0x564756[_0x9189('0x15')];};};Realtime[_0x9189('0x43')][_0x9189('0x49')]=function(){var _0x1f7631=this;return function(_0x5802e1){if(_0x5802e1){freeIsNotKeySip(_0x5802e1,_0x1f7631[_0x9189('0x4a')]);for(var _0xf7ef95=0x0,_0x248f12={},_0x1f39f0={};_0xf7ef95<_0x5802e1[_0x9189('0x48')];_0xf7ef95+=0x1){_0x248f12=_0x5802e1[_0xf7ef95];if(_[_0x9189('0x46')](_0x1f7631[_0x9189('0x4a')][util[_0x9189('0x28')](_0x9189('0x2b'),_0x248f12['name'])])){_0x1f7631[_0x9189('0x4a')][util[_0x9189('0x28')](_0x9189('0x2b'),_0x248f12[_0x9189('0x29')])]=new Trunk(_0x248f12);}else{_0x1f7631[_0x9189('0x44')](_0x1f7631[_0x9189('0x4a')][util[_0x9189('0x28')]('SIP/%s',_0x248f12[_0x9189('0x29')])],_0x248f12);}}}return _0x1f7631[_0x9189('0x4a')];};};Realtime[_0x9189('0x43')][_0x9189('0x4b')]=function(){var _0x471385=this;return function(_0x5c46c3){if(_0x5c46c3){freeIsNotKey(_0x5c46c3,_0x471385[_0x9189('0x16')],_0x9189('0x29'));for(var _0x3d0df1=0x0,_0x5da0fe={},_0x4b565b={};_0x3d0df1<_0x5c46c3['length'];_0x3d0df1+=0x1){_0x5da0fe=_0x5c46c3[_0x3d0df1];if(_['isUndefined'](_0x471385[_0x9189('0x16')][_0x5da0fe[_0x9189('0x29')]])){_0x471385[_0x9189('0x16')][_0x5da0fe['name']]=new VoiceQueue(_0x5da0fe);}else{_0x471385['mergeFromDatabase'](_0x471385[_0x9189('0x16')][_0x5da0fe[_0x9189('0x29')]],_0x5da0fe);}}}return _0x471385[_0x9189('0x16')];};};Realtime[_0x9189('0x43')][_0x9189('0x4c')]=function(){var _0xbae8a=this;return function(_0x182fc5){if(_0x182fc5){freeIsNotKey(_0x182fc5,_0xbae8a[_0x9189('0x4d')],'id');for(var _0x498603=0x0,_0x3b1f9f={},_0x40ff3f={};_0x498603<_0x182fc5[_0x9189('0x48')];_0x498603+=0x1){_0x3b1f9f=_0x182fc5[_0x498603];if(_[_0x9189('0x46')](_0xbae8a[_0x9189('0x4d')][_0x3b1f9f['id']])){_0xbae8a[_0x9189('0x4d')][_0x3b1f9f['id']]=new Trigger(_0x3b1f9f);}else{_0xbae8a['mergeFromDatabase'](_0xbae8a['triggers'][_0x3b1f9f['id']],_0x3b1f9f);}}}return _0xbae8a[_0x9189('0x4d')];};};Realtime[_0x9189('0x43')]['initTemplates']=function(){var _0x30dd4b=this;return function(_0x223bb9){if(_0x223bb9){freeIsNotKey(_0x223bb9,_0x30dd4b[_0x9189('0x18')],'id');for(var _0x2193e5=0x0,_0x4f812b={},_0x2dec55={};_0x2193e5<_0x223bb9[_0x9189('0x48')];_0x2193e5+=0x1){_0x4f812b=_0x223bb9[_0x2193e5];if(_[_0x9189('0x46')](_0x30dd4b[_0x9189('0x18')][_0x4f812b['id']])){_0x30dd4b[_0x9189('0x18')][_0x4f812b['id']]=new Template(_0x4f812b);}else{_0x30dd4b[_0x9189('0x44')](_0x30dd4b[_0x9189('0x18')][_0x4f812b['id']],_0x4f812b);}}}return _0x30dd4b[_0x9189('0x18')];};};Realtime[_0x9189('0x43')]['initZendeskAccounts']=function(){var _0x5d6fde=this;return function(_0x565e36){if(_0x565e36){freeIsNotKey(_0x565e36,_0x5d6fde['zendeskAccounts'],'id');for(var _0x3d2745=0x0,_0x46ba39={},_0x4f24fa={};_0x3d2745<_0x565e36[_0x9189('0x48')];_0x3d2745+=0x1){_0x46ba39=_0x565e36[_0x3d2745];if(_[_0x9189('0x46')](_0x5d6fde['zendeskAccounts'][_0x46ba39['id']])){_0x5d6fde[_0x9189('0x4e')][_0x46ba39['id']]=new ZendeskAccount(_0x46ba39);}else{_0x5d6fde[_0x9189('0x44')](_0x5d6fde[_0x9189('0x4e')][_0x46ba39['id']],_0x46ba39);}}}return _0x5d6fde[_0x9189('0x4e')];};};Realtime['prototype'][_0x9189('0x4f')]=function(){var _0x37b997=this;return function(_0x4a5d54){if(_0x4a5d54){freeIsNotKey(_0x4a5d54,_0x37b997[_0x9189('0x1e')],'id');for(var _0x2594d4=0x0,_0x4eab3c={},_0x537aa0={};_0x2594d4<_0x4a5d54[_0x9189('0x48')];_0x2594d4+=0x1){_0x4eab3c=_0x4a5d54[_0x2594d4];if(_[_0x9189('0x46')](_0x37b997[_0x9189('0x1e')][_0x4eab3c['id']])){_0x37b997[_0x9189('0x1e')][_0x4eab3c['id']]=new SalesforceAccount(_0x4eab3c);}else{_0x37b997['mergeFromDatabase'](_0x37b997[_0x9189('0x1e')][_0x4eab3c['id']],_0x4eab3c);}}}return _0x37b997[_0x9189('0x1e')];};};Realtime[_0x9189('0x43')][_0x9189('0x50')]=function(){var _0x40be65=this;return function(_0x584c3d){if(_0x584c3d){freeIsNotKey(_0x584c3d,_0x40be65[_0x9189('0x51')],'id');for(var _0x59082f=0x0,_0x1a3db7={},_0x3554c6={};_0x59082f<_0x584c3d[_0x9189('0x48')];_0x59082f+=0x1){_0x1a3db7=_0x584c3d[_0x59082f];if(_[_0x9189('0x46')](_0x40be65['freshdeskAccounts'][_0x1a3db7['id']])){_0x40be65[_0x9189('0x51')][_0x1a3db7['id']]=new FreshdeskAccount(_0x1a3db7);}else{_0x40be65[_0x9189('0x44')](_0x40be65[_0x9189('0x51')][_0x1a3db7['id']],_0x1a3db7);}}}return _0x40be65['freshdeskAccounts'];};};Realtime[_0x9189('0x43')][_0x9189('0x52')]=function(){var _0x5e37e6=this;return function(_0x4fa288){if(_0x4fa288){freeIsNotKey(_0x4fa288,_0x5e37e6[_0x9189('0x20')],'id');for(var _0x2b63ba=0x0,_0x5c61d4={},_0x5ca28c={};_0x2b63ba<_0x4fa288[_0x9189('0x48')];_0x2b63ba+=0x1){_0x5c61d4=_0x4fa288[_0x2b63ba];if(_[_0x9189('0x46')](_0x5e37e6[_0x9189('0x20')][_0x5c61d4['id']])){_0x5e37e6['zohoAccounts'][_0x5c61d4['id']]=new ZohoAccount(_0x5c61d4);}else{_0x5e37e6[_0x9189('0x44')](_0x5e37e6[_0x9189('0x20')][_0x5c61d4['id']],_0x5c61d4);}}}return _0x5e37e6[_0x9189('0x20')];};};Realtime[_0x9189('0x43')]['initDeskAccounts']=function(){var _0x4c9aa1=this;return function(_0x33d873){if(_0x33d873){freeIsNotKey(_0x33d873,_0x4c9aa1[_0x9189('0x21')],'id');for(var _0x225da4=0x0,_0xdd2c05={},_0xeba7a6={};_0x225da4<_0x33d873[_0x9189('0x48')];_0x225da4+=0x1){_0xdd2c05=_0x33d873[_0x225da4];if(_[_0x9189('0x46')](_0x4c9aa1[_0x9189('0x21')][_0xdd2c05['id']])){_0x4c9aa1[_0x9189('0x21')][_0xdd2c05['id']]=new DeskAccount(_0xdd2c05);}else{_0x4c9aa1[_0x9189('0x44')](_0x4c9aa1[_0x9189('0x21')][_0xdd2c05['id']],_0xdd2c05);}}}return _0x4c9aa1[_0x9189('0x21')];};};Realtime[_0x9189('0x43')][_0x9189('0x53')]=function(){var _0xc8feaf=this;return function(_0xd40b0){if(_0xd40b0){freeIsNotKey(_0xd40b0,_0xc8feaf['sugarcrmAccounts'],'id');for(var _0x4342fd=0x0,_0x41fc7f={},_0x167229={};_0x4342fd<_0xd40b0[_0x9189('0x48')];_0x4342fd+=0x1){_0x41fc7f=_0xd40b0[_0x4342fd];if(_[_0x9189('0x46')](_0xc8feaf['sugarcrmAccounts'][_0x41fc7f['id']])){_0xc8feaf['sugarcrmAccounts'][_0x41fc7f['id']]=new SugarcrmAccount(_0x41fc7f);}else{_0xc8feaf[_0x9189('0x44')](_0xc8feaf[_0x9189('0x1f')][_0x41fc7f['id']],_0x41fc7f);}}}return _0xc8feaf[_0x9189('0x1f')];};};Realtime['prototype'][_0x9189('0x54')]=function(){var _0x1bb221=this;return function(_0x5d1d0c){if(_0x5d1d0c){freeIsNotKey(_0x5d1d0c,_0x1bb221[_0x9189('0x22')],'id');for(var _0x40b8c3=0x0,_0x390a6c={},_0x5139fd={};_0x40b8c3<_0x5d1d0c['length'];_0x40b8c3+=0x1){_0x390a6c=_0x5d1d0c[_0x40b8c3];if(_[_0x9189('0x46')](_0x1bb221[_0x9189('0x22')][_0x390a6c['id']])){_0x1bb221[_0x9189('0x22')][_0x390a6c['id']]=new VtigerAccount(_0x390a6c);}else{_0x1bb221[_0x9189('0x44')](_0x1bb221['vtigerAccounts'][_0x390a6c['id']],_0x390a6c);}}}return _0x1bb221[_0x9189('0x22')];};};Realtime[_0x9189('0x43')][_0x9189('0x55')]=function(){var _0x3a9c84=this;return function(_0x2af694){if(_0x2af694){freeIsNotKey(_0x2af694,_0x3a9c84[_0x9189('0x23')],'id');for(var _0x4ceb92=0x0,_0x23881c={},_0x21b088={};_0x4ceb92<_0x2af694['length'];_0x4ceb92+=0x1){_0x23881c=_0x2af694[_0x4ceb92];if(_[_0x9189('0x46')](_0x3a9c84[_0x9189('0x23')][_0x23881c['id']])){_0x3a9c84['servicenowAccounts'][_0x23881c['id']]=new ServicenowAccount(_0x23881c);}else{_0x3a9c84[_0x9189('0x44')](_0x3a9c84['servicenowAccounts'][_0x23881c['id']],_0x23881c);}}}return _0x3a9c84[_0x9189('0x23')];};};Realtime[_0x9189('0x43')]['initDynamics365Accounts']=function(){var _0x1bacaf=this;return function(_0x2b7adc){if(_0x2b7adc){freeIsNotKey(_0x2b7adc,_0x1bacaf[_0x9189('0x24')],'id');for(var _0x1e5204=0x0,_0x221505={},_0x3281d0={};_0x1e5204<_0x2b7adc[_0x9189('0x48')];_0x1e5204+=0x1){_0x221505=_0x2b7adc[_0x1e5204];if(_[_0x9189('0x46')](_0x1bacaf[_0x9189('0x24')][_0x221505['id']])){_0x1bacaf[_0x9189('0x24')][_0x221505['id']]=new Dynamics365Account(_0x221505);}else{_0x1bacaf['mergeFromDatabase'](_0x1bacaf[_0x9189('0x24')][_0x221505['id']],_0x221505);}}}return _0x1bacaf[_0x9189('0x24')];};};Realtime[_0x9189('0x43')][_0x9189('0x56')]=function(){var _0x1019bb=this;return function(_0x51bd86){if(_0x51bd86){freeIsNotKey(_0x51bd86,_0x1019bb[_0x9189('0x57')],'id');for(var _0x3babf1=0x0,_0x131f32={},_0x18bd06={};_0x3babf1<_0x51bd86[_0x9189('0x48')];_0x3babf1+=0x1){_0x131f32=_0x51bd86[_0x3babf1];if(_[_0x9189('0x46')](_0x1019bb[_0x9189('0x57')][_0x131f32['id']])){_0x1019bb[_0x9189('0x57')][_0x131f32['id']]=new FreshsalesAccount(_0x131f32);}else{_0x1019bb['mergeFromDatabase'](_0x1019bb[_0x9189('0x57')][_0x131f32['id']],_0x131f32);}}}return _0x1019bb['freshsalesAccounts'];};};Realtime[_0x9189('0x43')][_0x9189('0x58')]=function(){var _0xbe710a=this;return function(_0x2279d2){for(var _0x2471db=0x0;_0x2471db<_0x2279d2[_0x9189('0x48')];_0x2471db+=0x1){_['merge'](_0xbe710a[_0x9189('0x16')][_0x2279d2[_0x2471db][_0x9189('0x29')]],_0x2279d2[_0x2471db]);}return _0xbe710a[_0x9189('0x16')];};};Realtime[_0x9189('0x43')]['initVoiceQueueReports']=function(){var _0x31f37e=this;return function(_0x5da9b2){clearVoiceQueues(_0x31f37e['voiceQueues']);if(_0x5da9b2){_0x5da9b2=_[_0x9189('0x59')](_0x5da9b2,'uniqueid');for(var _0x49bb57 in _0x5da9b2){if(_0x5da9b2[_0x9189('0x27')](_0x49bb57)){var _0xaf2738={};for(var _0x2c4315=0x0;_0x2c4315<_0x5da9b2[_0x49bb57][_0x9189('0x48')];_0x2c4315+=0x1){var _0x1fe818=_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x5a')];if(_0x31f37e['voiceQueues'][_0x1fe818]){if(_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x5b')]){_0x31f37e['voiceQueues'][_0x1fe818][_0x9189('0x34')]+=0x1;}if(_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x5c')]){_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x35')]+=0x1;}_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x2e')]+=moment(_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x5d')])[_0x9189('0x5e')](moment(_0x5da9b2[_0x49bb57][_0x2c4315]['queuecallerjoinAt']),_0x9189('0x5f'))||0x0;if(_0x2c4315===_0x5da9b2[_0x49bb57][_0x9189('0x48')]-0x1){_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x2f')]+=moment(_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x60')]||_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x61')]||_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x62')])['diff'](moment(_0x5da9b2[_0x49bb57][_0x2c4315]['queuecallerjoinAt']),_0x9189('0x5f'))||0x0;_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x2d')]+=0x1;if(_0x5da9b2[_0x49bb57][_0x2c4315]['queuecallercomplete']){_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x63')]+=0x1;_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x30')]+=moment(_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x60')])[_0x9189('0x5e')](moment(_0x5da9b2[_0x49bb57][_0x2c4315][_0x9189('0x5d')]),_0x9189('0x5f'))||0x0;}}else{_0x31f37e[_0x9189('0x16')][_0x1fe818][_0x9189('0x2f')]+=_0x31f37e[_0x9189('0x16')][_0x1fe818]['sumHoldTime']||0x0;}}}}}}return _0x31f37e['voiceQueues'];};};Realtime['prototype'][_0x9189('0x64')]=function(){var _0x399f68=this;return function(_0x17a759){clearVoiceCallReports(_0x399f68[_0x9189('0x19')]);if(_0x17a759){for(var _0x398bf1=0x0;_0x398bf1<_0x17a759[_0x9189('0x48')];_0x398bf1+=0x1){_0x399f68['outbound'][_0x9189('0x2d')]+=0x1;_0x399f68['outbound']['sumDuration']+=_0x17a759[_0x398bf1][_0x9189('0x65')];if(_0x17a759[_0x398bf1][_0x9189('0x66')]===_0x9189('0x67')){_0x399f68[_0x9189('0x19')][_0x9189('0x63')]+=0x1;_0x399f68[_0x9189('0x19')][_0x9189('0x2e')]+=_0x17a759[_0x398bf1]['duration']-_0x17a759[_0x398bf1][_0x9189('0x68')]||0x0;_0x399f68[_0x9189('0x19')][_0x9189('0x30')]+=_0x17a759[_0x398bf1][_0x9189('0x68')];}}}return _0x399f68[_0x9189('0x19')];};};Realtime[_0x9189('0x43')][_0x9189('0x69')]=function(){var _0x3ee5f2=this;return function(_0x204b42){if(_0x204b42){freeIsNotKey(_0x204b42,_0x3ee5f2[_0x9189('0x17')],_0x9189('0x29'));for(var _0x465718=0x0,_0x1d3195={};_0x465718<_0x204b42[_0x9189('0x48')];_0x465718+=0x1){_0x1d3195=_0x204b42[_0x465718];if(_[_0x9189('0x46')](_0x3ee5f2[_0x9189('0x17')][_0x1d3195['name']])){_0x3ee5f2['campaigns'][_0x1d3195[_0x9189('0x29')]]=new Campaign(_0x1d3195);}else{_0x3ee5f2['mergeFromDatabase'](_0x3ee5f2[_0x9189('0x17')][_0x1d3195[_0x9189('0x29')]],_0x1d3195);_0x3ee5f2['campaigns'][_0x1d3195[_0x9189('0x29')]]['dialQueueProject']=_0x1d3195['SquareProject']?_0x1d3195[_0x9189('0x6a')][_0x9189('0x29')]:undefined;}}}return _0x3ee5f2['campaigns'];};};Realtime[_0x9189('0x43')][_0x9189('0x6b')]=function(){var _0x2e4601=this;return function(_0x1e40f7){if(_0x1e40f7){freeIsNotKey(_0x1e40f7,_0x2e4601['voiceExtensions'],'id');for(var _0xd8014d=0x0,_0x103237={};_0xd8014d<_0x1e40f7['length'];_0xd8014d+=0x1){_0x103237=_0x1e40f7[_0xd8014d];if(_[_0x9189('0x46')](_0x2e4601[_0x9189('0x1a')][_0x103237['id']])){_0x2e4601[_0x9189('0x1a')][_0x103237['id']]=new VoiceExtension(_0x103237);}else{_0x2e4601[_0x9189('0x44')](_0x2e4601[_0x9189('0x1a')][_0x103237['id']],_0x103237);}}}return _0x2e4601[_0x9189('0x1a')];};};Realtime[_0x9189('0x43')][_0x9189('0x6c')]=function(){var _0x281e95=this;return function(_0x6ab231){clearCampaigns(_0x281e95[_0x9189('0x17')]);for(var _0x5ae2ae=0x0;_0x5ae2ae<_0x6ab231[_0x9189('0x48')];_0x5ae2ae+=0x1){_[_0x9189('0x6d')](_0x281e95['campaigns'][_0x6ab231[_0x5ae2ae][_0x9189('0x29')]],_0x6ab231[_0x5ae2ae]);}return _0x281e95[_0x9189('0x17')];};};Realtime[_0x9189('0x43')][_0x9189('0x6e')]=function(){var _0x23c96d=this;return function(_0xd6114){if(_0xd6114){freeIsNotKey(_0xd6114,_0x23c96d[_0x9189('0x25')],'id');for(var _0x344737=0x0,_0x33c128={},_0x1f8c97={};_0x344737<_0xd6114[_0x9189('0x48')];_0x344737+=0x1){_0x33c128=_0xd6114[_0x344737];if(_[_0x9189('0x46')](_0x23c96d[_0x9189('0x25')][_0x33c128['id']])){_0x23c96d[_0x9189('0x25')][_0x33c128['id']]=new FaxAccount(_0x33c128);}else{_0x23c96d[_0x9189('0x44')](_0x23c96d[_0x9189('0x25')][_0x33c128['id']],_0x33c128);}}}return _0x23c96d[_0x9189('0x25')];};};module[_0x9189('0x6f')]=Realtime; \ No newline at end of file +var _0xcad9=['freshsalesAccounts','faxAccounts','hasOwnProperty','mapKeys','format','isNil','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','unmanaged','abandoned','sumDuration','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','mergeFromDatabase','prototype','initAgents','length','isUndefined','SIP/%s','name','initTrunks','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','disposition','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts'];(function(_0x32fc1b,_0x42aba0){var _0x4937b7=function(_0x2f9042){while(--_0x2f9042){_0x32fc1b['push'](_0x32fc1b['shift']());}};_0x4937b7(++_0x42aba0);}(_0xcad9,0x1e1));var _0x9cad=function(_0x5e1535,_0x40409c){_0x5e1535=_0x5e1535-0x0;var _0x3399c9=_0xcad9[_0x5e1535];return _0x3399c9;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x9cad('0x0'));var moment=require(_0x9cad('0x1'));var Agent=require(_0x9cad('0x2'));var Telephone=require(_0x9cad('0x3'));var Trunk=require(_0x9cad('0x4'));var VoiceQueue=require(_0x9cad('0x5'));var Trigger=require(_0x9cad('0x6'));var Template=require('../model/template');var Campaign=require(_0x9cad('0x7'));var VoiceExtension=require(_0x9cad('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x9cad('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x9cad('0xa'));var DeskAccount=require(_0x9cad('0xb'));var VtigerAccount=require(_0x9cad('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x9cad('0xd'));var FreshsalesAccount=require(_0x9cad('0xe'));var FaxAccount=require(_0x9cad('0xf'));var Realtime=function(){this[_0x9cad('0x10')]={};this[_0x9cad('0x11')]={};this[_0x9cad('0x12')]={};this[_0x9cad('0x13')]={};this[_0x9cad('0x14')]={};this['campaigns']={};this[_0x9cad('0x15')]={};this[_0x9cad('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x9cad('0x17')]={};this['channels']={};this['queueChannels']={};this[_0x9cad('0x18')]={};this[_0x9cad('0x19')]={};this[_0x9cad('0x1a')]={};this[_0x9cad('0x1b')]={};this[_0x9cad('0x1c')]={};this[_0x9cad('0x1d')]={};this[_0x9cad('0x1e')]={};this[_0x9cad('0x1f')]={};this[_0x9cad('0x20')]={};this[_0x9cad('0x21')]={};this['dynamics365Accounts']={};this[_0x9cad('0x22')]={};this[_0x9cad('0x23')]={};};function freeIsNotKey(_0x2729e6,_0x5c4f48,_0x534e7a){var _0x270df1=_['mapKeys'](_0x2729e6,function(_0x5dac62,_0x2f5726){return _0x5dac62[_0x534e7a];});for(var _0x4db3f8 in _0x5c4f48){if(_0x5c4f48[_0x9cad('0x24')](_0x4db3f8)){if(!_0x270df1[_0x4db3f8]){delete _0x5c4f48[_0x4db3f8];}}}}function freeIsNotKeySip(_0x29c498,_0x2e6eb6){var _0x551d35=_[_0x9cad('0x25')](_0x29c498,function(_0x242e7e,_0x5441ef){return util[_0x9cad('0x26')]('SIP/%s',_0x242e7e['name']);});for(var _0x9b2b93 in _0x2e6eb6){if(_0x2e6eb6[_0x9cad('0x24')](_0x9b2b93)){if(!_0x551d35[_0x9b2b93]){delete _0x2e6eb6[_0x9b2b93];}}}}function freeIsNotKeyAgent(_0x5c4ba8,_0xce03b6){var _0x525075=_[_0x9cad('0x25')](_0x5c4ba8,function(_0x265e3b,_0x3b8724){var _0x48d91e=_[_0x9cad('0x27')](_0x265e3b[_0x9cad('0x28')])?util[_0x9cad('0x26')]('SIP/%s',_0x265e3b['name']):_0x265e3b[_0x9cad('0x28')];return _0x48d91e;});for(var _0x374dcc in _0xce03b6){if(_0xce03b6[_0x9cad('0x24')](_0x374dcc)){if(!_0x525075[_0x374dcc]){delete _0xce03b6[_0x374dcc];}}}}function clearVoiceCallReports(_0x43f12a){_0x43f12a[_0x9cad('0x29')]=0x0;_0x43f12a[_0x9cad('0x2a')]=0x0;_0x43f12a[_0x9cad('0x2b')]=0x0;_0x43f12a['sumDuration']=0x0;_0x43f12a[_0x9cad('0x2c')]=0x0;}function clearCampaigns(_0x3d4090){if(!_[_0x9cad('0x2d')](_0x3d4090)){for(var _0x11533e in _0x3d4090){if(_0x3d4090[_0x9cad('0x24')](_0x11533e)){_0x3d4090[_0x11533e][_0x9cad('0x2e')]=0x0;_0x3d4090[_0x11533e]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x448950){if(!_[_0x9cad('0x2d')](_0x448950)){for(var _0x15a6a9 in _0x448950){if(_0x448950[_0x9cad('0x24')](_0x15a6a9)){_0x448950[_0x15a6a9][_0x9cad('0x29')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x2a')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x2f')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x30')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x2b')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x31')]=0x0;_0x448950[_0x15a6a9]['sumBillable']=0x0;_0x448950[_0x15a6a9]['outboundAnswerAgiCallsDay']=0x0;_0x448950[_0x15a6a9][_0x9cad('0x32')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x33')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x34')]=0x0;_0x448950[_0x15a6a9]['outboundNoSuchCallsDay']=0x0;_0x448950[_0x15a6a9][_0x9cad('0x35')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x36')]=0x0;_0x448950[_0x15a6a9]['outboundDropCallsDayCallersExit']=0x0;_0x448950[_0x15a6a9]['outboundBlacklistCallsDay']=0x0;_0x448950[_0x15a6a9]['outboundOriginateFailureCallsDay']=0x0;_0x448950[_0x15a6a9][_0x9cad('0x37')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x38')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x39')]=0x0;_0x448950[_0x15a6a9][_0x9cad('0x3a')]=0x0;_0x448950[_0x15a6a9]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x9cad('0x3b')]=function(_0x369546,_0x2e6991){for(var _0x2db643 in _0x2e6991){if(_0x369546[_0x9cad('0x24')](_0x2db643)){_0x369546[_0x2db643]=_0x2e6991[_0x2db643];}}};Realtime[_0x9cad('0x3c')][_0x9cad('0x3d')]=function(){var _0x3783ab=this;return function(_0x5eb298){if(_0x5eb298){freeIsNotKeyAgent(_0x5eb298,_0x3783ab[_0x9cad('0x10')]);for(var _0x49b1c2=0x0,_0x32b9eb={},_0x2702ba={};_0x49b1c2<_0x5eb298[_0x9cad('0x3e')];_0x49b1c2+=0x1){_0x32b9eb=_0x5eb298[_0x49b1c2];var _0x4f17d3=_[_0x9cad('0x27')](_0x32b9eb['interface'])?util[_0x9cad('0x26')]('SIP/%s',_0x32b9eb['name']):_0x32b9eb[_0x9cad('0x28')];if(_[_0x9cad('0x3f')](_0x3783ab['agents'][_0x4f17d3])){_0x3783ab[_0x9cad('0x10')][_0x4f17d3]=new Agent(_0x32b9eb);}else{_0x3783ab['mergeFromDatabase'](_0x3783ab[_0x9cad('0x10')][_0x4f17d3],_0x32b9eb);}}}return _0x3783ab['agents'];};};Realtime[_0x9cad('0x3c')]['initTelephones']=function(){var _0x4b25cb=this;return function(_0xa552be){if(_0xa552be){freeIsNotKeySip(_0xa552be,_0x4b25cb['telephones']);for(var _0x254ff1=0x0,_0x5f3e98={},_0x4dd18c={};_0x254ff1<_0xa552be['length'];_0x254ff1+=0x1){_0x5f3e98=_0xa552be[_0x254ff1];if(_[_0x9cad('0x3f')](_0x4b25cb[_0x9cad('0x11')][util[_0x9cad('0x26')](_0x9cad('0x40'),_0x5f3e98[_0x9cad('0x41')])])){_0x4b25cb[_0x9cad('0x11')][util['format'](_0x9cad('0x40'),_0x5f3e98[_0x9cad('0x41')])]=new Telephone(_0x5f3e98);}else{_0x4b25cb['mergeFromDatabase'](_0x4b25cb[_0x9cad('0x11')][util[_0x9cad('0x26')](_0x9cad('0x40'),_0x5f3e98[_0x9cad('0x41')])],_0x5f3e98);}}}return _0x4b25cb['telephones'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x42')]=function(){var _0x46d3bf=this;return function(_0x1fb380){if(_0x1fb380){freeIsNotKeySip(_0x1fb380,_0x46d3bf[_0x9cad('0x12')]);for(var _0x4670eb=0x0,_0x136686={},_0x5e38e3={};_0x4670eb<_0x1fb380['length'];_0x4670eb+=0x1){_0x136686=_0x1fb380[_0x4670eb];if(_['isUndefined'](_0x46d3bf[_0x9cad('0x12')][util[_0x9cad('0x26')]('SIP/%s',_0x136686[_0x9cad('0x41')])])){_0x46d3bf[_0x9cad('0x12')][util[_0x9cad('0x26')](_0x9cad('0x40'),_0x136686[_0x9cad('0x41')])]=new Trunk(_0x136686);}else{_0x46d3bf[_0x9cad('0x3b')](_0x46d3bf[_0x9cad('0x12')][util[_0x9cad('0x26')]('SIP/%s',_0x136686[_0x9cad('0x41')])],_0x136686);}}}return _0x46d3bf[_0x9cad('0x12')];};};Realtime[_0x9cad('0x3c')]['initVoiceQueues']=function(){var _0x4d4a50=this;return function(_0x1ff71a){if(_0x1ff71a){freeIsNotKey(_0x1ff71a,_0x4d4a50['voiceQueues'],_0x9cad('0x41'));for(var _0x4173b8=0x0,_0x28bc7b={},_0x13a74d={};_0x4173b8<_0x1ff71a['length'];_0x4173b8+=0x1){_0x28bc7b=_0x1ff71a[_0x4173b8];if(_[_0x9cad('0x3f')](_0x4d4a50[_0x9cad('0x13')][_0x28bc7b[_0x9cad('0x41')]])){_0x4d4a50[_0x9cad('0x13')][_0x28bc7b[_0x9cad('0x41')]]=new VoiceQueue(_0x28bc7b);}else{_0x4d4a50['mergeFromDatabase'](_0x4d4a50['voiceQueues'][_0x28bc7b[_0x9cad('0x41')]],_0x28bc7b);}}}return _0x4d4a50[_0x9cad('0x13')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x43')]=function(){var _0x389d2e=this;return function(_0x5a63e0){if(_0x5a63e0){freeIsNotKey(_0x5a63e0,_0x389d2e['triggers'],'id');for(var _0x1fa7d6=0x0,_0xc07e7f={},_0x4c62f5={};_0x1fa7d6<_0x5a63e0['length'];_0x1fa7d6+=0x1){_0xc07e7f=_0x5a63e0[_0x1fa7d6];if(_[_0x9cad('0x3f')](_0x389d2e['triggers'][_0xc07e7f['id']])){_0x389d2e['triggers'][_0xc07e7f['id']]=new Trigger(_0xc07e7f);}else{_0x389d2e[_0x9cad('0x3b')](_0x389d2e[_0x9cad('0x14')][_0xc07e7f['id']],_0xc07e7f);}}}return _0x389d2e['triggers'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x44')]=function(){var _0x4f95a0=this;return function(_0x3de893){if(_0x3de893){freeIsNotKey(_0x3de893,_0x4f95a0['templates'],'id');for(var _0x1afb9f=0x0,_0x3eba2d={},_0x349eea={};_0x1afb9f<_0x3de893['length'];_0x1afb9f+=0x1){_0x3eba2d=_0x3de893[_0x1afb9f];if(_['isUndefined'](_0x4f95a0[_0x9cad('0x15')][_0x3eba2d['id']])){_0x4f95a0[_0x9cad('0x15')][_0x3eba2d['id']]=new Template(_0x3eba2d);}else{_0x4f95a0[_0x9cad('0x3b')](_0x4f95a0['templates'][_0x3eba2d['id']],_0x3eba2d);}}}return _0x4f95a0['templates'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x45')]=function(){var _0x8476e2=this;return function(_0x349b89){if(_0x349b89){freeIsNotKey(_0x349b89,_0x8476e2[_0x9cad('0x1a')],'id');for(var _0x52a5f3=0x0,_0x3d87ab={},_0x24a01c={};_0x52a5f3<_0x349b89[_0x9cad('0x3e')];_0x52a5f3+=0x1){_0x3d87ab=_0x349b89[_0x52a5f3];if(_[_0x9cad('0x3f')](_0x8476e2[_0x9cad('0x1a')][_0x3d87ab['id']])){_0x8476e2[_0x9cad('0x1a')][_0x3d87ab['id']]=new ZendeskAccount(_0x3d87ab);}else{_0x8476e2['mergeFromDatabase'](_0x8476e2[_0x9cad('0x1a')][_0x3d87ab['id']],_0x3d87ab);}}}return _0x8476e2[_0x9cad('0x1a')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x46')]=function(){var _0x44e72c=this;return function(_0x2936bb){if(_0x2936bb){freeIsNotKey(_0x2936bb,_0x44e72c[_0x9cad('0x1b')],'id');for(var _0x5c92fb=0x0,_0xa6aa24={},_0x32afe5={};_0x5c92fb<_0x2936bb['length'];_0x5c92fb+=0x1){_0xa6aa24=_0x2936bb[_0x5c92fb];if(_[_0x9cad('0x3f')](_0x44e72c['salesforceAccounts'][_0xa6aa24['id']])){_0x44e72c[_0x9cad('0x1b')][_0xa6aa24['id']]=new SalesforceAccount(_0xa6aa24);}else{_0x44e72c[_0x9cad('0x3b')](_0x44e72c[_0x9cad('0x1b')][_0xa6aa24['id']],_0xa6aa24);}}}return _0x44e72c[_0x9cad('0x1b')];};};Realtime['prototype'][_0x9cad('0x47')]=function(){var _0x2546bb=this;return function(_0x2e8898){if(_0x2e8898){freeIsNotKey(_0x2e8898,_0x2546bb['freshdeskAccounts'],'id');for(var _0x558e4a=0x0,_0x75c38b={},_0x257d1f={};_0x558e4a<_0x2e8898[_0x9cad('0x3e')];_0x558e4a+=0x1){_0x75c38b=_0x2e8898[_0x558e4a];if(_[_0x9cad('0x3f')](_0x2546bb[_0x9cad('0x1d')][_0x75c38b['id']])){_0x2546bb['freshdeskAccounts'][_0x75c38b['id']]=new FreshdeskAccount(_0x75c38b);}else{_0x2546bb[_0x9cad('0x3b')](_0x2546bb['freshdeskAccounts'][_0x75c38b['id']],_0x75c38b);}}}return _0x2546bb[_0x9cad('0x1d')];};};Realtime['prototype']['initZohoAccounts']=function(){var _0x31dd6a=this;return function(_0x29a119){if(_0x29a119){freeIsNotKey(_0x29a119,_0x31dd6a[_0x9cad('0x1e')],'id');for(var _0x4491e0=0x0,_0x2dd7c1={},_0xc0e2b3={};_0x4491e0<_0x29a119[_0x9cad('0x3e')];_0x4491e0+=0x1){_0x2dd7c1=_0x29a119[_0x4491e0];if(_[_0x9cad('0x3f')](_0x31dd6a['zohoAccounts'][_0x2dd7c1['id']])){_0x31dd6a['zohoAccounts'][_0x2dd7c1['id']]=new ZohoAccount(_0x2dd7c1);}else{_0x31dd6a[_0x9cad('0x3b')](_0x31dd6a[_0x9cad('0x1e')][_0x2dd7c1['id']],_0x2dd7c1);}}}return _0x31dd6a[_0x9cad('0x1e')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x48')]=function(){var _0x12bca2=this;return function(_0x42c062){if(_0x42c062){freeIsNotKey(_0x42c062,_0x12bca2[_0x9cad('0x1f')],'id');for(var _0x514fb3=0x0,_0x4603fb={},_0x353e20={};_0x514fb3<_0x42c062['length'];_0x514fb3+=0x1){_0x4603fb=_0x42c062[_0x514fb3];if(_[_0x9cad('0x3f')](_0x12bca2[_0x9cad('0x1f')][_0x4603fb['id']])){_0x12bca2[_0x9cad('0x1f')][_0x4603fb['id']]=new DeskAccount(_0x4603fb);}else{_0x12bca2['mergeFromDatabase'](_0x12bca2[_0x9cad('0x1f')][_0x4603fb['id']],_0x4603fb);}}}return _0x12bca2['deskAccounts'];};};Realtime['prototype'][_0x9cad('0x49')]=function(){var _0x3dc05e=this;return function(_0x57513d){if(_0x57513d){freeIsNotKey(_0x57513d,_0x3dc05e['sugarcrmAccounts'],'id');for(var _0x49ce3c=0x0,_0x7c74be={},_0x318a5a={};_0x49ce3c<_0x57513d[_0x9cad('0x3e')];_0x49ce3c+=0x1){_0x7c74be=_0x57513d[_0x49ce3c];if(_['isUndefined'](_0x3dc05e['sugarcrmAccounts'][_0x7c74be['id']])){_0x3dc05e['sugarcrmAccounts'][_0x7c74be['id']]=new SugarcrmAccount(_0x7c74be);}else{_0x3dc05e[_0x9cad('0x3b')](_0x3dc05e[_0x9cad('0x1c')][_0x7c74be['id']],_0x7c74be);}}}return _0x3dc05e['sugarcrmAccounts'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x4a')]=function(){var _0x160947=this;return function(_0x577c7d){if(_0x577c7d){freeIsNotKey(_0x577c7d,_0x160947[_0x9cad('0x20')],'id');for(var _0x446743=0x0,_0x21c5f3={},_0x18a6be={};_0x446743<_0x577c7d['length'];_0x446743+=0x1){_0x21c5f3=_0x577c7d[_0x446743];if(_[_0x9cad('0x3f')](_0x160947[_0x9cad('0x20')][_0x21c5f3['id']])){_0x160947[_0x9cad('0x20')][_0x21c5f3['id']]=new VtigerAccount(_0x21c5f3);}else{_0x160947[_0x9cad('0x3b')](_0x160947[_0x9cad('0x20')][_0x21c5f3['id']],_0x21c5f3);}}}return _0x160947[_0x9cad('0x20')];};};Realtime['prototype'][_0x9cad('0x4b')]=function(){var _0x3d4ff5=this;return function(_0x4cdfda){if(_0x4cdfda){freeIsNotKey(_0x4cdfda,_0x3d4ff5[_0x9cad('0x21')],'id');for(var _0x27e0ed=0x0,_0xa7407a={},_0x205c0b={};_0x27e0ed<_0x4cdfda[_0x9cad('0x3e')];_0x27e0ed+=0x1){_0xa7407a=_0x4cdfda[_0x27e0ed];if(_[_0x9cad('0x3f')](_0x3d4ff5[_0x9cad('0x21')][_0xa7407a['id']])){_0x3d4ff5[_0x9cad('0x21')][_0xa7407a['id']]=new ServicenowAccount(_0xa7407a);}else{_0x3d4ff5[_0x9cad('0x3b')](_0x3d4ff5['servicenowAccounts'][_0xa7407a['id']],_0xa7407a);}}}return _0x3d4ff5[_0x9cad('0x21')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x4c')]=function(){var _0x4d9a72=this;return function(_0x2e44b8){if(_0x2e44b8){freeIsNotKey(_0x2e44b8,_0x4d9a72['dynamics365Accounts'],'id');for(var _0x27da2f=0x0,_0x544bd6={},_0x48409b={};_0x27da2f<_0x2e44b8[_0x9cad('0x3e')];_0x27da2f+=0x1){_0x544bd6=_0x2e44b8[_0x27da2f];if(_[_0x9cad('0x3f')](_0x4d9a72[_0x9cad('0x4d')][_0x544bd6['id']])){_0x4d9a72[_0x9cad('0x4d')][_0x544bd6['id']]=new Dynamics365Account(_0x544bd6);}else{_0x4d9a72['mergeFromDatabase'](_0x4d9a72[_0x9cad('0x4d')][_0x544bd6['id']],_0x544bd6);}}}return _0x4d9a72['dynamics365Accounts'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x4e')]=function(){var _0x1db936=this;return function(_0x413db7){if(_0x413db7){freeIsNotKey(_0x413db7,_0x1db936[_0x9cad('0x22')],'id');for(var _0x5b165d=0x0,_0x2fa807={},_0x4875ca={};_0x5b165d<_0x413db7['length'];_0x5b165d+=0x1){_0x2fa807=_0x413db7[_0x5b165d];if(_['isUndefined'](_0x1db936[_0x9cad('0x22')][_0x2fa807['id']])){_0x1db936['freshsalesAccounts'][_0x2fa807['id']]=new FreshsalesAccount(_0x2fa807);}else{_0x1db936['mergeFromDatabase'](_0x1db936['freshsalesAccounts'][_0x2fa807['id']],_0x2fa807);}}}return _0x1db936[_0x9cad('0x22')];};};Realtime[_0x9cad('0x3c')]['initVoiceQueueHopperHistory']=function(){var _0x25e1a5=this;return function(_0x1d5972){for(var _0x3a0b09=0x0;_0x3a0b09<_0x1d5972[_0x9cad('0x3e')];_0x3a0b09+=0x1){_[_0x9cad('0x4f')](_0x25e1a5['voiceQueues'][_0x1d5972[_0x3a0b09]['name']],_0x1d5972[_0x3a0b09]);}return _0x25e1a5[_0x9cad('0x13')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x50')]=function(){var _0x55719c=this;return function(_0x43bdba){clearVoiceQueues(_0x55719c[_0x9cad('0x13')]);if(_0x43bdba){_0x43bdba=_[_0x9cad('0x51')](_0x43bdba,_0x9cad('0x52'));for(var _0x311a5d in _0x43bdba){if(_0x43bdba['hasOwnProperty'](_0x311a5d)){var _0x555587={};for(var _0x1b377a=0x0;_0x1b377a<_0x43bdba[_0x311a5d]['length'];_0x1b377a+=0x1){var _0x6d8c2f=_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x53')];if(_0x55719c['voiceQueues'][_0x6d8c2f]){if(_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x54')]){_0x55719c[_0x9cad('0x13')][_0x6d8c2f][_0x9cad('0x2f')]+=0x1;}if(_0x43bdba[_0x311a5d][_0x1b377a]['queuecallerabandon']){_0x55719c['voiceQueues'][_0x6d8c2f][_0x9cad('0x30')]+=0x1;}_0x55719c[_0x9cad('0x13')][_0x6d8c2f]['sumHoldTime']+=moment(_0x43bdba[_0x311a5d][_0x1b377a]['queuecallerleaveAt'])[_0x9cad('0x55')](moment(_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x56')]),_0x9cad('0x57'))||0x0;if(_0x1b377a===_0x43bdba[_0x311a5d][_0x9cad('0x3e')]-0x1){_0x55719c['voiceQueues'][_0x6d8c2f]['sumDuration']+=moment(_0x43bdba[_0x311a5d][_0x1b377a]['queuecallercompleteAt']||_0x43bdba[_0x311a5d][_0x1b377a]['queuecallerabandonAt']||_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x58')])[_0x9cad('0x55')](moment(_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x56')]),'seconds')||0x0;_0x55719c['voiceQueues'][_0x6d8c2f]['total']+=0x1;if(_0x43bdba[_0x311a5d][_0x1b377a]['queuecallercomplete']){_0x55719c[_0x9cad('0x13')][_0x6d8c2f][_0x9cad('0x2a')]+=0x1;_0x55719c[_0x9cad('0x13')][_0x6d8c2f][_0x9cad('0x2c')]+=moment(_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x59')])['diff'](moment(_0x43bdba[_0x311a5d][_0x1b377a][_0x9cad('0x5a')]),_0x9cad('0x57'))||0x0;}}else{_0x55719c[_0x9cad('0x13')][_0x6d8c2f]['sumDuration']+=_0x55719c[_0x9cad('0x13')][_0x6d8c2f][_0x9cad('0x2b')]||0x0;}}}}}}return _0x55719c['voiceQueues'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x5b')]=function(){var _0x44642b=this;return function(_0x3be576){clearVoiceCallReports(_0x44642b[_0x9cad('0x16')]);if(_0x3be576){for(var _0x55cb82=0x0;_0x55cb82<_0x3be576[_0x9cad('0x3e')];_0x55cb82+=0x1){_0x44642b[_0x9cad('0x16')][_0x9cad('0x29')]+=0x1;_0x44642b[_0x9cad('0x16')][_0x9cad('0x31')]+=_0x3be576[_0x55cb82]['duration'];if(_0x3be576[_0x55cb82][_0x9cad('0x5c')]==='ANSWERED'){_0x44642b[_0x9cad('0x16')]['answered']+=0x1;_0x44642b[_0x9cad('0x16')]['sumHoldTime']+=_0x3be576[_0x55cb82][_0x9cad('0x5d')]-_0x3be576[_0x55cb82]['billableseconds']||0x0;_0x44642b[_0x9cad('0x16')][_0x9cad('0x2c')]+=_0x3be576[_0x55cb82][_0x9cad('0x5e')];}}}return _0x44642b['outbound'];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x5f')]=function(){var _0x584c45=this;return function(_0x5c1590){if(_0x5c1590){freeIsNotKey(_0x5c1590,_0x584c45[_0x9cad('0x60')],'name');for(var _0x238ca7=0x0,_0x516867={};_0x238ca7<_0x5c1590[_0x9cad('0x3e')];_0x238ca7+=0x1){_0x516867=_0x5c1590[_0x238ca7];if(_[_0x9cad('0x3f')](_0x584c45[_0x9cad('0x60')][_0x516867[_0x9cad('0x41')]])){_0x584c45['campaigns'][_0x516867[_0x9cad('0x41')]]=new Campaign(_0x516867);}else{_0x584c45[_0x9cad('0x3b')](_0x584c45['campaigns'][_0x516867[_0x9cad('0x41')]],_0x516867);_0x584c45[_0x9cad('0x60')][_0x516867[_0x9cad('0x41')]][_0x9cad('0x61')]=_0x516867[_0x9cad('0x62')]?_0x516867['SquareProject']['name']:undefined;}}}return _0x584c45[_0x9cad('0x60')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x63')]=function(){var _0x743df4=this;return function(_0x183e55){if(_0x183e55){freeIsNotKey(_0x183e55,_0x743df4[_0x9cad('0x17')],'id');for(var _0x11d0c2=0x0,_0x4f8ffa={};_0x11d0c2<_0x183e55[_0x9cad('0x3e')];_0x11d0c2+=0x1){_0x4f8ffa=_0x183e55[_0x11d0c2];if(_['isUndefined'](_0x743df4['voiceExtensions'][_0x4f8ffa['id']])){_0x743df4['voiceExtensions'][_0x4f8ffa['id']]=new VoiceExtension(_0x4f8ffa);}else{_0x743df4['mergeFromDatabase'](_0x743df4[_0x9cad('0x17')][_0x4f8ffa['id']],_0x4f8ffa);}}}return _0x743df4[_0x9cad('0x17')];};};Realtime[_0x9cad('0x3c')][_0x9cad('0x64')]=function(){var _0x1255ec=this;return function(_0x291693){clearCampaigns(_0x1255ec[_0x9cad('0x60')]);for(var _0x59673e=0x0;_0x59673e<_0x291693['length'];_0x59673e+=0x1){_['merge'](_0x1255ec[_0x9cad('0x60')][_0x291693[_0x59673e]['name']],_0x291693[_0x59673e]);}return _0x1255ec[_0x9cad('0x60')];};};Realtime['prototype'][_0x9cad('0x65')]=function(){var _0x33ad1f=this;return function(_0x1a1dc6){if(_0x1a1dc6){freeIsNotKey(_0x1a1dc6,_0x33ad1f['faxAccounts'],'id');for(var _0x1ee031=0x0,_0x5b8a50={},_0x336c54={};_0x1ee031<_0x1a1dc6[_0x9cad('0x3e')];_0x1ee031+=0x1){_0x5b8a50=_0x1a1dc6[_0x1ee031];if(_[_0x9cad('0x3f')](_0x33ad1f[_0x9cad('0x23')][_0x5b8a50['id']])){_0x33ad1f[_0x9cad('0x23')][_0x5b8a50['id']]=new FaxAccount(_0x5b8a50);}else{_0x33ad1f['mergeFromDatabase'](_0x33ad1f[_0x9cad('0x23')][_0x5b8a50['id']],_0x5b8a50);}}}return _0x33ad1f[_0x9cad('0x23')];};};module[_0x9cad('0x66')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 0ac5d2a..5337737 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 _0xbd99=['destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','lastIndexOf','membername','attendedTransfer','exports','bluebird','../../../config/environment','../../../config/logger','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','prototype','findAgent','accountcode','name','find','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','isNil','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match'];(function(_0x112bb2,_0x167bd7){var _0x1d692e=function(_0x1724b7){while(--_0x1724b7){_0x112bb2['push'](_0x112bb2['shift']());}};_0x1d692e(++_0x167bd7);}(_0xbd99,0x12a));var _0x9bd9=function(_0x31559a,_0x47ccfc){_0x31559a=_0x31559a-0x0;var _0x466501=_0xbd99[_0x31559a];return _0x466501;};'use strict';var BPromise=require(_0x9bd9('0x0'));var _=require('lodash');var moment=require('moment');var util=require('util');var config=require(_0x9bd9('0x1'));var logger=require(_0x9bd9('0x2'))(_0x9bd9('0x3'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x9bd9('0x4'));var RpcVoiceCallReport=require(_0x9bd9('0x5'));var RpcVoiceDialReport=require(_0x9bd9('0x6'));var RpcMemberReport=require(_0x9bd9('0x7'));var RpcVoiceQueueReport=require(_0x9bd9('0x8'));var RpcVoiceRecording=require(_0x9bd9('0x9'));var RpcVoiceTransferReport=require(_0x9bd9('0xa'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x9bd9('0xb'));var VoiceAgentReport=require(_0x9bd9('0xc'));var VoiceDialReport=require(_0x9bd9('0xd'));var UserReport=require(_0x9bd9('0xe'));function Report(_0x22c0ad){this['realtime']=_0x22c0ad;this[_0x9bd9('0xf')]=_0x22c0ad[_0x9bd9('0xf')];this[_0x9bd9('0x10')]=_0x22c0ad[_0x9bd9('0x10')];}Report['prototype']['sync']=function(_0x571aff){var _0x252237=new VoiceQueueReport(this['realtime']);var _0x50dfc2=new VoiceAgentReport(this['realtime']);var _0x2a79ee=new VoiceDialReport(this[_0x9bd9('0x11')]);var _0x557c4c=new VoiceCallReport(this[_0x9bd9('0x11')]);var _0x51fc1f=new UserReport(this[_0x9bd9('0x11')]);if(config[_0x9bd9('0x12')]&&config['xdr'][_0x9bd9('0x13')]){ami['on'](_0x9bd9('0x14'),this[_0x9bd9('0x15')][_0x9bd9('0x16')](this));ami['on']('custom:voiceCallReport',this[_0x9bd9('0x17')][_0x9bd9('0x16')](this));ami['on'](_0x9bd9('0x18'),this[_0x9bd9('0x19')]['bind'](this));ami['on'](_0x9bd9('0x1a'),this[_0x9bd9('0x1b')]['bind'](this));ami['on'](_0x9bd9('0x1c'),this[_0x9bd9('0x1d')][_0x9bd9('0x16')](this));ami['on'](_0x9bd9('0x1e'),this['attendedTransfer']['bind'](this));}};Report[_0x9bd9('0x1f')][_0x9bd9('0x20')]=function(_0x6bcfea){var _0x24eb31=undefined;_0x24eb31=_['find'](this[_0x9bd9('0xf')],function(_0x5810cc){return _0x5810cc[_0x9bd9('0x21')]==_0x6bcfea||_0x5810cc[_0x9bd9('0x22')]==_0x6bcfea;});if(_['isNil'](_0x24eb31)){var _0x4cd22b=_['find'](this['telephones'],function(_0x286744){return _0x286744[_0x9bd9('0x21')]==_0x6bcfea||_0x286744[_0x9bd9('0x22')]==_0x6bcfea;});if(_0x4cd22b){_0x24eb31=_[_0x9bd9('0x23')](this[_0x9bd9('0xf')],function(_0x4fe678){return _0x4fe678['interface']==util['format'](_0x9bd9('0x24'),_0x4cd22b[_0x9bd9('0x22')]);});}}return _0x24eb31;};Report[_0x9bd9('0x1f')][_0x9bd9('0x15')]=function(_0x40db5b){for(var _0x2257a4=0x0;_0x2257a4<_0x40db5b[_0x9bd9('0x25')];_0x2257a4+=0x1){var _0x518921=this[_0x9bd9('0x20')](_0x40db5b[_0x2257a4][_0x9bd9('0x26')]);if(_0x518921){_0x40db5b[_0x2257a4][_0x9bd9('0x21')]=_0x518921[_0x9bd9('0x21')];_0x40db5b[_0x2257a4][_0x9bd9('0x27')]=!![];_0x40db5b[_0x2257a4][_0x9bd9('0x28')]=_0x518921[_0x9bd9('0x22')];_0x40db5b[_0x2257a4][_0x9bd9('0x29')]=_[_0x9bd9('0x2a')](_0x518921[_0x9bd9('0x29')])?util[_0x9bd9('0x2b')](_0x9bd9('0x24'),_0x518921[_0x9bd9('0x22')]):_0x518921[_0x9bd9('0x29')];if(_0x40db5b[_0x2257a4][_0x9bd9('0x2c')]){_0x40db5b[_0x2257a4][_0x9bd9('0x2d')]=moment()[_0x9bd9('0x2b')](_0x9bd9('0x2e'));}if(_0x40db5b[_0x2257a4][_0x9bd9('0x2f')]){_0x40db5b[_0x2257a4]['queuecallerexitAt']=moment()['format'](_0x9bd9('0x2e'));}RpcMemberReport[_0x9bd9('0x15')](_0x40db5b[_0x2257a4]);}RpcVoiceQueueReport[_0x9bd9('0x30')](_0x40db5b[_0x2257a4]);}};function extractCalleridNumber(_0x515aa4){var _0x5865c7=_0x515aa4[_0x9bd9('0x31')](/<(.*?)>/);return _0x5865c7?_0x5865c7[0x1]:_0x515aa4;}Report['prototype'][_0x9bd9('0x17')]=function(_0x1cc320){_0x1cc320[_0x9bd9('0x32')]=_0x1cc320['destination']||_0x1cc320[_0x9bd9('0x33')];if(_0x1cc320[_0x9bd9('0x34')]==_0x9bd9('0x35')){_0x1cc320[_0x9bd9('0x36')]=_0x9bd9('0x37');_0x1cc320[_0x9bd9('0x38')]=_0x1cc320[_0x9bd9('0x37')];if(_0x1cc320[_0x9bd9('0x39')]==_0x9bd9('0x3a')){_0x1cc320['accountcode']='';_0x1cc320[_0x9bd9('0x32')]=extractCalleridNumber(_0x1cc320[_0x9bd9('0x3b')]);}else if(_0x1cc320[_0x9bd9('0x39')]=='from-sip'){if(_0x1cc320['destination']=='xcally-motion-preview'){_0x1cc320[_0x9bd9('0x32')]=extractCalleridNumber(_0x1cc320[_0x9bd9('0x3c')]);_0x1cc320['calleridnum']=_0x1cc320[_0x9bd9('0x3d')];_0x1cc320[_0x9bd9('0x3e')]=[_0x1cc320[_0x9bd9('0x3f')],_0x1cc320[_0x9bd9('0x3f')]=_0x1cc320[_0x9bd9('0x3e')]][0x0];_0x1cc320[_0x9bd9('0x3b')]=_0x1cc320[_0x9bd9('0x3c')];}else{_0x1cc320[_0x9bd9('0x32')]=_0x1cc320[_0x9bd9('0x40')];_0x1cc320[_0x9bd9('0x40')]=_0x1cc320['originatecalleridnum'];if(_0x1cc320[_0x9bd9('0x41')]==_0x9bd9('0x42')){_0x1cc320[_0x9bd9('0x21')]=_0x1cc320[_0x9bd9('0x26')];}else{_0x1cc320[_0x9bd9('0x21')]='';}}}}else{_0x1cc320[_0x9bd9('0x3b')]=util[_0x9bd9('0x2b')](_0x9bd9('0x43'),_0x1cc320['calleridname'],_0x1cc320[_0x9bd9('0x40')]);}RpcVoiceCallReport['create'](_0x1cc320);if(_0x1cc320[_0x9bd9('0x44')]){for(var _0x2fae0c=0x0;_0x2fae0c<_0x1cc320[_0x9bd9('0x45')][_0x9bd9('0x25')];_0x2fae0c+=0x1){_0x1cc320[_0x9bd9('0x46')]=_0x1cc320[_0x9bd9('0x45')][_0x2fae0c][_0x9bd9('0x47')];_0x1cc320['createdAt']=_0x1cc320[_0x9bd9('0x45')][_0x2fae0c][_0x9bd9('0x48')];if(_0x1cc320[_0x9bd9('0x33')]=='xcally-motion-preview'){_0x1cc320[_0x9bd9('0x40')]=_0x1cc320[_0x9bd9('0x26')];_0x1cc320[_0x9bd9('0x49')]=_0x1cc320[_0x9bd9('0x4a')];_0x1cc320[_0x9bd9('0x26')]=_0x1cc320['accountcode'];_0x1cc320['connectedlinename']=_0x1cc320['membername'];_0x1cc320[_0x9bd9('0x33')]=_0x1cc320[_0x9bd9('0x3d')];}else if(_0x1cc320[_0x9bd9('0x33')]==_0x9bd9('0x4b')){_0x1cc320[_0x9bd9('0x40')]=_0x1cc320[_0x9bd9('0x32')];_0x1cc320[_0x9bd9('0x33')]=_0x1cc320[_0x9bd9('0x3d')];}RpcVoiceRecording['create'](_0x1cc320);}}};Report['prototype'][_0x9bd9('0x19')]=function(_0x4a6a59){if(_[_0x9bd9('0x4c')](_0x4a6a59)){_0x4a6a59[_0x9bd9('0x4d')](function(_0x575c5e){RpcVoiceAgentReport[_0x9bd9('0x30')](_0x575c5e);});}else{RpcVoiceAgentReport[_0x9bd9('0x30')](_0x4a6a59);}};Report[_0x9bd9('0x1f')][_0x9bd9('0x1b')]=function(_0x4b0da8){RpcVoiceDialReport[_0x9bd9('0x30')](_0x4b0da8);var _0x40403c=undefined;var _0x1b8dad=_0x4b0da8[_0x9bd9('0x3f')];if(_[_0x9bd9('0x4e')](_0x1b8dad,_0x9bd9('0x4f'))){var _0x1143d7=_0x1b8dad[_0x9bd9('0x50')](_0x1b8dad[_0x9bd9('0x51')]('/')+0x1,_0x1b8dad[_0x9bd9('0x51')]('@'));_0x40403c=_[_0x9bd9('0x23')](this[_0x9bd9('0xf')],function(_0x158d76){return _0x158d76[_0x9bd9('0x52')]==_0x1143d7||_0x158d76['phone']==_0x1143d7||_0x158d76['accountcode']==_0x1143d7;});}else{var _0x1143d7=_0x1b8dad[_0x9bd9('0x50')](_0x1b8dad[_0x9bd9('0x51')]('/')+0x1,_0x1b8dad[_0x9bd9('0x53')]('-'));_0x40403c=this['findAgent'](_0x1143d7);}if(_0x40403c){_0x4b0da8[_0x9bd9('0x29')]=_[_0x9bd9('0x2a')](_0x40403c['interface'])?util['format'](_0x9bd9('0x24'),_0x40403c['name']):_0x40403c[_0x9bd9('0x29')];_0x4b0da8[_0x9bd9('0x54')]=_0x40403c[_0x9bd9('0x22')];_0x4b0da8[_0x9bd9('0x21')]=_0x40403c['accountcode'];RpcMemberReport[_0x9bd9('0x1b')](_0x4b0da8);}};Report[_0x9bd9('0x1f')][_0x9bd9('0x1d')]=function(_0x2b5901){RpcVoiceTransferReport[_0x9bd9('0x1d')](_0x2b5901);};Report[_0x9bd9('0x1f')][_0x9bd9('0x55')]=function(_0x44128e){RpcVoiceTransferReport[_0x9bd9('0x55')](_0x44128e);};module[_0x9bd9('0x56')]=Report; \ No newline at end of file +var _0x79a6=['lastapplication','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','channel','callerid','calleridnum','ANSWERED','calleridname','monitor','monitors','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','substring','indexOf','mobile','phone','membername','attendedTransfer','exports','bluebird','lodash','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','realtime','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','findAgent','accountcode','name','isNil','find','agents','interface','format','length','connectedlinenum','assigned','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','exten','type'];(function(_0x1dfb1c,_0xd25122){var _0x360949=function(_0x14054b){while(--_0x14054b){_0x1dfb1c['push'](_0x1dfb1c['shift']());}};_0x360949(++_0xd25122);}(_0x79a6,0x1a1));var _0x679a=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0x79a6[_0x3bc298];return _0x31bf58;};'use strict';var BPromise=require(_0x679a('0x0'));var _=require(_0x679a('0x1'));var moment=require('moment');var util=require('util');var config=require(_0x679a('0x2'));var logger=require('../../../config/logger')('ami');var ami=require(_0x679a('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x679a('0x4'));var RpcVoiceDialReport=require(_0x679a('0x5'));var RpcMemberReport=require(_0x679a('0x6'));var RpcVoiceQueueReport=require(_0x679a('0x7'));var RpcVoiceRecording=require(_0x679a('0x8'));var RpcVoiceTransferReport=require(_0x679a('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x679a('0xa'));var VoiceAgentReport=require(_0x679a('0xb'));var VoiceDialReport=require(_0x679a('0xc'));var UserReport=require(_0x679a('0xd'));function Report(_0x1aa508){this['realtime']=_0x1aa508;this['agents']=_0x1aa508['agents'];this[_0x679a('0xe')]=_0x1aa508[_0x679a('0xe')];}Report[_0x679a('0xf')]['sync']=function(_0x152992){var _0x2da363=new VoiceQueueReport(this[_0x679a('0x10')]);var _0x42df0d=new VoiceAgentReport(this[_0x679a('0x10')]);var _0xd1ab16=new VoiceDialReport(this[_0x679a('0x10')]);var _0x165edb=new VoiceCallReport(this['realtime']);var _0x48da79=new UserReport(this[_0x679a('0x10')]);if(config[_0x679a('0x11')]&&config[_0x679a('0x11')]['disabled']){ami['on'](_0x679a('0x12'),this[_0x679a('0x13')][_0x679a('0x14')](this));ami['on'](_0x679a('0x15'),this[_0x679a('0x16')][_0x679a('0x14')](this));ami['on'](_0x679a('0x17'),this[_0x679a('0x18')][_0x679a('0x14')](this));ami['on'](_0x679a('0x19'),this[_0x679a('0x1a')][_0x679a('0x14')](this));ami['on'](_0x679a('0x1b'),this[_0x679a('0x1c')][_0x679a('0x14')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x679a('0x14')](this));}};Report['prototype'][_0x679a('0x1d')]=function(_0x1b75a1){var _0x3ab6e8=undefined;_0x3ab6e8=_['find'](this['agents'],function(_0x888ee5){return _0x888ee5[_0x679a('0x1e')]==_0x1b75a1||_0x888ee5[_0x679a('0x1f')]==_0x1b75a1;});if(_[_0x679a('0x20')](_0x3ab6e8)){var _0x5d2807=_[_0x679a('0x21')](this[_0x679a('0xe')],function(_0x8b48dc){return _0x8b48dc[_0x679a('0x1e')]==_0x1b75a1||_0x8b48dc[_0x679a('0x1f')]==_0x1b75a1;});if(_0x5d2807){_0x3ab6e8=_[_0x679a('0x21')](this[_0x679a('0x22')],function(_0x51fb1c){return _0x51fb1c[_0x679a('0x23')]==util[_0x679a('0x24')]('SIP/%s',_0x5d2807[_0x679a('0x1f')]);});}}return _0x3ab6e8;};Report[_0x679a('0xf')][_0x679a('0x13')]=function(_0x4349a5){for(var _0x2d4aa4=0x0;_0x2d4aa4<_0x4349a5[_0x679a('0x25')];_0x2d4aa4+=0x1){var _0x32ba5d=this['findAgent'](_0x4349a5[_0x2d4aa4][_0x679a('0x26')]);if(_0x32ba5d){_0x4349a5[_0x2d4aa4][_0x679a('0x1e')]=_0x32ba5d[_0x679a('0x1e')];_0x4349a5[_0x2d4aa4][_0x679a('0x27')]=!![];_0x4349a5[_0x2d4aa4][_0x679a('0x28')]=_0x32ba5d[_0x679a('0x1f')];_0x4349a5[_0x2d4aa4][_0x679a('0x23')]=_[_0x679a('0x20')](_0x32ba5d[_0x679a('0x23')])?util['format'](_0x679a('0x29'),_0x32ba5d[_0x679a('0x1f')]):_0x32ba5d[_0x679a('0x23')];if(_0x4349a5[_0x2d4aa4][_0x679a('0x2a')]){_0x4349a5[_0x2d4aa4][_0x679a('0x2b')]=moment()[_0x679a('0x24')](_0x679a('0x2c'));}if(_0x4349a5[_0x2d4aa4][_0x679a('0x2d')]){_0x4349a5[_0x2d4aa4][_0x679a('0x2e')]=moment()[_0x679a('0x24')](_0x679a('0x2c'));}RpcMemberReport[_0x679a('0x13')](_0x4349a5[_0x2d4aa4]);}RpcVoiceQueueReport[_0x679a('0x2f')](_0x4349a5[_0x2d4aa4]);}};function extractCalleridNumber(_0x2347ec){var _0x2888cf=_0x2347ec['match'](/<(.*?)>/);return _0x2888cf?_0x2888cf[0x1]:_0x2347ec;}Report[_0x679a('0xf')][_0x679a('0x16')]=function(_0x263fc1){_0x263fc1[_0x679a('0x30')]=_0x263fc1['destination']||_0x263fc1[_0x679a('0x31')];if(_0x263fc1[_0x679a('0x32')]=='dialer'){_0x263fc1[_0x679a('0x33')]='queue';_0x263fc1['lastdata']=_0x263fc1[_0x679a('0x34')];if(_0x263fc1[_0x679a('0x35')]==_0x679a('0x36')){_0x263fc1[_0x679a('0x1e')]='';_0x263fc1[_0x679a('0x30')]=extractCalleridNumber(_0x263fc1['callerid']);}else if(_0x263fc1[_0x679a('0x35')]==_0x679a('0x37')){if(_0x263fc1[_0x679a('0x30')]==_0x679a('0x38')){_0x263fc1[_0x679a('0x30')]=extractCalleridNumber(_0x263fc1[_0x679a('0x39')]);_0x263fc1['calleridnum']=_0x263fc1[_0x679a('0x3a')];_0x263fc1['destinationchannel']=[_0x263fc1[_0x679a('0x3b')],_0x263fc1[_0x679a('0x3b')]=_0x263fc1['destinationchannel']][0x0];_0x263fc1[_0x679a('0x3c')]=_0x263fc1[_0x679a('0x39')];}else{_0x263fc1[_0x679a('0x30')]=_0x263fc1[_0x679a('0x3d')];_0x263fc1['calleridnum']=_0x263fc1['originatecalleridnum'];if(_0x263fc1['disposition']==_0x679a('0x3e')){_0x263fc1[_0x679a('0x1e')]=_0x263fc1[_0x679a('0x26')];}else{_0x263fc1['accountcode']='';}}}}else{_0x263fc1[_0x679a('0x3c')]=util['format']('\x22%s\x22\x20<%s>',_0x263fc1[_0x679a('0x3f')],_0x263fc1[_0x679a('0x3d')]);}RpcVoiceCallReport[_0x679a('0x2f')](_0x263fc1);if(_0x263fc1[_0x679a('0x40')]){for(var _0x32d514=0x0;_0x32d514<_0x263fc1[_0x679a('0x41')][_0x679a('0x25')];_0x32d514+=0x1){_0x263fc1['monitorFilename']=_0x263fc1[_0x679a('0x41')][_0x32d514][_0x679a('0x42')];_0x263fc1[_0x679a('0x43')]=_0x263fc1[_0x679a('0x41')][_0x32d514][_0x679a('0x43')];if(_0x263fc1[_0x679a('0x31')]==_0x679a('0x38')){_0x263fc1['calleridnum']=_0x263fc1[_0x679a('0x26')];_0x263fc1[_0x679a('0x3f')]=_0x263fc1[_0x679a('0x44')];_0x263fc1[_0x679a('0x26')]=_0x263fc1[_0x679a('0x1e')];_0x263fc1[_0x679a('0x44')]=_0x263fc1['membername'];_0x263fc1[_0x679a('0x31')]=_0x263fc1[_0x679a('0x3a')];}else if(_0x263fc1['exten']==_0x679a('0x45')){_0x263fc1['calleridnum']=_0x263fc1[_0x679a('0x30')];_0x263fc1['exten']=_0x263fc1['originatecalleridnum'];}RpcVoiceRecording[_0x679a('0x2f')](_0x263fc1);}}};Report[_0x679a('0xf')][_0x679a('0x18')]=function(_0x234f0e){if(_[_0x679a('0x46')](_0x234f0e)){_0x234f0e['forEach'](function(_0x1629ed){RpcVoiceAgentReport[_0x679a('0x2f')](_0x1629ed);});}else{RpcVoiceAgentReport[_0x679a('0x2f')](_0x234f0e);}};Report['prototype'][_0x679a('0x1a')]=function(_0x4174c5){RpcVoiceDialReport[_0x679a('0x2f')](_0x4174c5);var _0x1170f0=undefined;var _0x4e3e1a=_0x4174c5['channel'];if(_['startsWith'](_0x4e3e1a,'Local')){var _0x4be5d5=_0x4e3e1a[_0x679a('0x47')](_0x4e3e1a[_0x679a('0x48')]('/')+0x1,_0x4e3e1a['indexOf']('@'));_0x1170f0=_[_0x679a('0x21')](this[_0x679a('0x22')],function(_0x212bb4){return _0x212bb4[_0x679a('0x49')]==_0x4be5d5||_0x212bb4[_0x679a('0x4a')]==_0x4be5d5||_0x212bb4[_0x679a('0x1e')]==_0x4be5d5;});}else{var _0x4be5d5=_0x4e3e1a[_0x679a('0x47')](_0x4e3e1a['indexOf']('/')+0x1,_0x4e3e1a['lastIndexOf']('-'));_0x1170f0=this[_0x679a('0x1d')](_0x4be5d5);}if(_0x1170f0){_0x4174c5[_0x679a('0x23')]=_[_0x679a('0x20')](_0x1170f0[_0x679a('0x23')])?util[_0x679a('0x24')](_0x679a('0x29'),_0x1170f0[_0x679a('0x1f')]):_0x1170f0[_0x679a('0x23')];_0x4174c5[_0x679a('0x4b')]=_0x1170f0[_0x679a('0x1f')];_0x4174c5['accountcode']=_0x1170f0['accountcode'];RpcMemberReport[_0x679a('0x1a')](_0x4174c5);}};Report['prototype'][_0x679a('0x1c')]=function(_0x2aef7a){RpcVoiceTransferReport['blindTransfer'](_0x2aef7a);};Report[_0x679a('0xf')]['attendedTransfer']=function(_0x4887d3){RpcVoiceTransferReport[_0x679a('0x4c')](_0x4887d3);};module[_0x679a('0x4d')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 58bd67a..d1d2b52 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 _0x5b1f=['toNumber','updateStatusRealtime','telephone:save','startsWith','substring','indexOf','mobile','phone','[syncDeviceState][UserReport]','peer','status','address','telephone:%s','trunk:save','[syncPeerStatus][UserReport]','lodash','moment','util','../../../config/environment','../../../config/logger','ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[loopSyncRealTimeShow]','error','inspect','prototype','actionSipPeerStatus','isUndefined','emit','isNotNull','find','username','stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','name','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime'];(function(_0x3d64e9,_0x4ec0c1){var _0xe2f289=function(_0x5c3b11){while(--_0x5c3b11){_0x3d64e9['push'](_0x3d64e9['shift']());}};_0xe2f289(++_0x4ec0c1);}(_0x5b1f,0x91));var _0xf5b1=function(_0x55501b,_0x54c277){_0x55501b=_0x55501b-0x0;var _0x506936=_0x5b1f[_0x55501b];return _0x506936;};'use strict';var _=require(_0xf5b1('0x0'));var moment=require(_0xf5b1('0x1'));var BPromise=require('bluebird');var util=require(_0xf5b1('0x2'));var Redis=require('ioredis');var config=require(_0xf5b1('0x3'));var logger=require(_0xf5b1('0x4'))(_0xf5b1('0x5'));var ami=require('../ami');config[_0xf5b1('0x6')]=_[_0xf5b1('0x7')](config[_0xf5b1('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf5b1('0x8'))(new Redis(config[_0xf5b1('0x6')]));function UserReport(_0x436765){this[_0xf5b1('0x9')]=_0x436765[_0xf5b1('0x9')];this[_0xf5b1('0xa')]=_0x436765[_0xf5b1('0xa')];this[_0xf5b1('0xb')]=_0x436765[_0xf5b1('0xb')];ami['on'](_0xf5b1('0xc'),this['syncRegistry']['bind'](this));ami['on']('registry',this[_0xf5b1('0xd')][_0xf5b1('0xe')](this));ami['on'](_0xf5b1('0xf'),this[_0xf5b1('0x10')][_0xf5b1('0xe')](this));ami['on'](_0xf5b1('0x11'),this[_0xf5b1('0x12')][_0xf5b1('0xe')](this));this[_0xf5b1('0x13')]();return BPromise[_0xf5b1('0x14')]()[_0xf5b1('0x15')](ami[_0xf5b1('0x16')]())[_0xf5b1('0x15')](ami[_0xf5b1('0x17')]())[_0xf5b1('0x15')](ami['actionSipPeerStatus']())[_0xf5b1('0x18')](loggerCatch(_0xf5b1('0x19')));}function loggerCatch(_0x59bfc5){return function(_0x516fe4){logger[_0xf5b1('0x1a')](_0x59bfc5,util[_0xf5b1('0x1b')](_0x516fe4,{'showHidden':![],'depth':null}));};}UserReport[_0xf5b1('0x1c')][_0xf5b1('0x13')]=function(){setInterval(function(){BPromise[_0xf5b1('0x14')]()[_0xf5b1('0x15')](ami[_0xf5b1('0x16')]())[_0xf5b1('0x15')](ami[_0xf5b1('0x17')]())['then'](ami[_0xf5b1('0x1d')]())[_0xf5b1('0x18')](loggerCatch(_0xf5b1('0x19')));},0x32c8);};UserReport[_0xf5b1('0x1c')]['isNotNull']=function(_0x145c0a){return _0x145c0a!==null&&!_[_0xf5b1('0x1e')](_0x145c0a);};UserReport['prototype'][_0xf5b1('0x1f')]=function(_0x4a0f6d,_0x5c254f,_0x23d9b0){io['to'](_0x4a0f6d)['emit'](_0x5c254f,_0x23d9b0);};UserReport['prototype'][_0xf5b1('0xd')]=function(_0x67019b){try{if(this[_0xf5b1('0x20')](_0x67019b)){var _0x2a2e9f=_[_0xf5b1('0x21')](this[_0xf5b1('0x9')],{'registry':_0x67019b[_0xf5b1('0x22')]});if(_0x2a2e9f){_0x67019b[_0xf5b1('0x23')]=_0x67019b[_0xf5b1('0x24')];_[_0xf5b1('0x25')](_0x2a2e9f,_[_0xf5b1('0x26')](_0x67019b,[_0xf5b1('0x27'),_0xf5b1('0x28'),_0xf5b1('0x22'),_0xf5b1('0x24')]));this[_0xf5b1('0x1f')](util[_0xf5b1('0x29')](_0xf5b1('0x2a'),_0x2a2e9f[_0xf5b1('0x2b')]),'trunk:save',_0x2a2e9f);}}}catch(_0x3015db){logger[_0xf5b1('0x1a')](_0xf5b1('0x2c'),util[_0xf5b1('0x1b')](_0x3015db,{'showHidden':![],'depth':null}));}};UserReport[_0xf5b1('0x1c')][_0xf5b1('0x10')]=function(_0x3e2a26){try{if(this[_0xf5b1('0x20')](_0x3e2a26)){if(this[_0xf5b1('0xa')][_0x3e2a26['device']]){if(!this[_0xf5b1('0xa')][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x2e')]||_0x3e2a26[_0xf5b1('0x24')][_0xf5b1('0x2f')]()==_0xf5b1('0x30')){this[_0xf5b1('0xa')][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x2e')]=![];if(this[_0xf5b1('0xa')][_0x3e2a26['device']][_0xf5b1('0x24')]!==_0x3e2a26[_0xf5b1('0x24')][_0xf5b1('0x2f')]()){this['agents'][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x31')]=_[_0xf5b1('0x32')](moment()['format']('x'));}this[_0xf5b1('0xa')][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x24')]=_0x3e2a26[_0xf5b1('0x24')]['toLowerCase']();this[_0xf5b1('0xa')][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x33')](_0x3e2a26);}}else if(this[_0xf5b1('0xb')][_0x3e2a26[_0xf5b1('0x2d')]]){if(this[_0xf5b1('0xb')][_0x3e2a26['device']]['state']!==_0x3e2a26[_0xf5b1('0x24')][_0xf5b1('0x2f')]()){this[_0xf5b1('0xb')][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x31')]=_[_0xf5b1('0x32')](moment()['format']('x'));}this[_0xf5b1('0xb')][_0x3e2a26[_0xf5b1('0x2d')]]['state']=_0x3e2a26[_0xf5b1('0x24')]['toLowerCase']();this[_0xf5b1('0x1f')](util[_0xf5b1('0x29')]('telephone:%s',this[_0xf5b1('0xb')][_0x3e2a26['device']][_0xf5b1('0x2b')]),_0xf5b1('0x34'),this[_0xf5b1('0xb')][_0x3e2a26[_0xf5b1('0x2d')]]);}else if(this[_0xf5b1('0x9')][_0x3e2a26[_0xf5b1('0x2d')]]){if(this['trunks'][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x24')]!==_0x3e2a26['state'][_0xf5b1('0x2f')]()){this['trunks'][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x31')]=_[_0xf5b1('0x32')](moment()['format']('x'));}this['trunks'][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x24')]=_0x3e2a26[_0xf5b1('0x24')][_0xf5b1('0x2f')]();this[_0xf5b1('0x1f')](util[_0xf5b1('0x29')](_0xf5b1('0x2a'),this[_0xf5b1('0x9')][_0x3e2a26[_0xf5b1('0x2d')]][_0xf5b1('0x2b')]),'trunk:save',this[_0xf5b1('0x9')][_0x3e2a26['device']]);}else if(_[_0xf5b1('0x35')](_0x3e2a26[_0xf5b1('0x2d')],'Queue')){}else if(_['startsWith'](_0x3e2a26[_0xf5b1('0x2d')],'Local')){var _0x4632e4=_0x3e2a26['device'];var _0x140364=_0x4632e4[_0xf5b1('0x36')](_0x4632e4[_0xf5b1('0x37')]('/')+0x1,_0x4632e4[_0xf5b1('0x37')]('@'));var _0x36b89b=_['find'](this[_0xf5b1('0xa')],function(_0x38bd58){return _0x38bd58[_0xf5b1('0x38')]==_0x140364||_0x38bd58[_0xf5b1('0x39')]==_0x140364||_0x38bd58['accountcode']==_0x140364;});if(_0x36b89b){if(_0x36b89b['state']!==_0x3e2a26[_0xf5b1('0x24')][_0xf5b1('0x2f')]()){_0x36b89b[_0xf5b1('0x31')]=_[_0xf5b1('0x32')](moment()[_0xf5b1('0x29')]('x'));}_0x36b89b[_0xf5b1('0x24')]=_0x3e2a26['state'][_0xf5b1('0x2f')]();_0x36b89b[_0xf5b1('0x2e')]=!![];_0x36b89b[_0xf5b1('0x33')](_0x3e2a26);}}else{}}}catch(_0x48b8b6){logger[_0xf5b1('0x1a')](_0xf5b1('0x3a'),util['inspect'](_0x48b8b6,{'showHidden':![],'depth':null}));}};UserReport[_0xf5b1('0x1c')]['syncPeerStatus']=function(_0x2a0b91){try{if(this['isNotNull'](_0x2a0b91)&&this[_0xf5b1('0x20')](_0x2a0b91[_0xf5b1('0x11')])){if(this[_0xf5b1('0xa')][_0x2a0b91[_0xf5b1('0x3b')]]){if(!this[_0xf5b1('0xa')][_0x2a0b91['peer']][_0xf5b1('0x2e')]||_0x2a0b91[_0xf5b1('0x11')][_0xf5b1('0x2f')]()=='registered'){this[_0xf5b1('0xa')][_0x2a0b91[_0xf5b1('0x3b')]]['local']=![];this[_0xf5b1('0xa')][_0x2a0b91[_0xf5b1('0x3b')]][_0xf5b1('0x3c')]=_0x2a0b91[_0xf5b1('0x11')]['toLowerCase']();this[_0xf5b1('0xa')][_0x2a0b91['peer']][_0xf5b1('0x3d')]=_0x2a0b91[_0xf5b1('0x3d')];this[_0xf5b1('0xa')][_0x2a0b91[_0xf5b1('0x3b')]][_0xf5b1('0x33')](_0x2a0b91);}}else if(this['telephones'][_0x2a0b91[_0xf5b1('0x3b')]]){this['telephones'][_0x2a0b91[_0xf5b1('0x3b')]][_0xf5b1('0x3c')]=_0x2a0b91['peerstatus'][_0xf5b1('0x2f')]();this[_0xf5b1('0xb')][_0x2a0b91[_0xf5b1('0x3b')]][_0xf5b1('0x3d')]=_0x2a0b91['address'];this[_0xf5b1('0x1f')](util[_0xf5b1('0x29')](_0xf5b1('0x3e'),this['telephones'][_0x2a0b91[_0xf5b1('0x3b')]][_0xf5b1('0x2b')]),_0xf5b1('0x34'),this[_0xf5b1('0xb')][_0x2a0b91[_0xf5b1('0x3b')]]);}else if(this[_0xf5b1('0x9')][_0x2a0b91[_0xf5b1('0x3b')]]){this[_0xf5b1('0x9')][_0x2a0b91[_0xf5b1('0x3b')]]['status']=_0x2a0b91['peerstatus'][_0xf5b1('0x2f')]();this[_0xf5b1('0x9')][_0x2a0b91['peer']]['address']=_0x2a0b91[_0xf5b1('0x3d')];this[_0xf5b1('0x1f')](util[_0xf5b1('0x29')](_0xf5b1('0x2a'),this[_0xf5b1('0x9')][_0x2a0b91[_0xf5b1('0x3b')]][_0xf5b1('0x2b')]),_0xf5b1('0x3f'),this['trunks'][_0x2a0b91[_0xf5b1('0x3b')]]);}else{}}}catch(_0x175284){logger[_0xf5b1('0x1a')](_0xf5b1('0x40'),util[_0xf5b1('0x1b')](_0x175284,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x4a51=['catch','[loopSyncRealTimeShow]','error','inspect','prototype','isUndefined','emit','isNotNull','find','username','state','merge','omit','event','format','[syncRegistry][UserReport]','device','local','inuse','toLowerCase','stateTime','updateStatusRealtime','toNumber','telephone:%s','telephone:save','trunk:%s','name','startsWith','Queue','Local','substring','indexOf','phone','[syncDeviceState][UserReport]','peerstatus','peer','address','status','trunk:save','[syncPeerStatus][UserReport]','exports','lodash','moment','ioredis','../../../config/logger','ami','redis','localhost','trunks','agents','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','resolve','actionSipShowRegistry','then','actionDeviceStateList','actionSipPeerStatus'];(function(_0x2b044e,_0x31fe2c){var _0x3b9a84=function(_0x775ea0){while(--_0x775ea0){_0x2b044e['push'](_0x2b044e['shift']());}};_0x3b9a84(++_0x31fe2c);}(_0x4a51,0x19d));var _0x14a5=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x4a51[_0x279d37];return _0x530173;};'use strict';var _=require(_0x14a5('0x0'));var moment=require(_0x14a5('0x1'));var BPromise=require('bluebird');var util=require('util');var Redis=require(_0x14a5('0x2'));var config=require('../../../config/environment');var logger=require(_0x14a5('0x3'))(_0x14a5('0x4'));var ami=require('../ami');config[_0x14a5('0x5')]=_['defaults'](config['redis'],{'host':_0x14a5('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x14a5('0x5')]));function UserReport(_0x303f39){this['trunks']=_0x303f39[_0x14a5('0x7')];this[_0x14a5('0x8')]=_0x303f39[_0x14a5('0x8')];this[_0x14a5('0x9')]=_0x303f39[_0x14a5('0x9')];ami['on']('registryentry',this[_0x14a5('0xa')]['bind'](this));ami['on']('registry',this[_0x14a5('0xa')][_0x14a5('0xb')](this));ami['on'](_0x14a5('0xc'),this[_0x14a5('0xd')][_0x14a5('0xb')](this));ami['on']('peerstatus',this[_0x14a5('0xe')][_0x14a5('0xb')](this));this[_0x14a5('0xf')]();return BPromise[_0x14a5('0x10')]()['then'](ami[_0x14a5('0x11')]())[_0x14a5('0x12')](ami[_0x14a5('0x13')]())[_0x14a5('0x12')](ami[_0x14a5('0x14')]())[_0x14a5('0x15')](loggerCatch(_0x14a5('0x16')));}function loggerCatch(_0x1374c5){return function(_0x4285ee){logger[_0x14a5('0x17')](_0x1374c5,util[_0x14a5('0x18')](_0x4285ee,{'showHidden':![],'depth':null}));};}UserReport[_0x14a5('0x19')][_0x14a5('0xf')]=function(){setInterval(function(){BPromise[_0x14a5('0x10')]()[_0x14a5('0x12')](ami[_0x14a5('0x11')]())[_0x14a5('0x12')](ami[_0x14a5('0x13')]())['then'](ami['actionSipPeerStatus']())[_0x14a5('0x15')](loggerCatch(_0x14a5('0x16')));},0x32c8);};UserReport[_0x14a5('0x19')]['isNotNull']=function(_0x4a6c5f){return _0x4a6c5f!==null&&!_[_0x14a5('0x1a')](_0x4a6c5f);};UserReport['prototype'][_0x14a5('0x1b')]=function(_0x1f03e8,_0x236579,_0x1158ab){io['to'](_0x1f03e8)[_0x14a5('0x1b')](_0x236579,_0x1158ab);};UserReport['prototype'][_0x14a5('0xa')]=function(_0x1518c7){try{if(this[_0x14a5('0x1c')](_0x1518c7)){var _0x463a71=_[_0x14a5('0x1d')](this[_0x14a5('0x7')],{'registry':_0x1518c7[_0x14a5('0x1e')]});if(_0x463a71){_0x1518c7['stateRegistry']=_0x1518c7[_0x14a5('0x1f')];_[_0x14a5('0x20')](_0x463a71,_[_0x14a5('0x21')](_0x1518c7,[_0x14a5('0x22'),'actionid',_0x14a5('0x1e'),'state']));this[_0x14a5('0x1b')](util[_0x14a5('0x23')]('trunk:%s',_0x463a71['name']),'trunk:save',_0x463a71);}}}catch(_0x19a9d4){logger[_0x14a5('0x17')](_0x14a5('0x24'),util[_0x14a5('0x18')](_0x19a9d4,{'showHidden':![],'depth':null}));}};UserReport[_0x14a5('0x19')][_0x14a5('0xd')]=function(_0x7abd3b){try{if(this['isNotNull'](_0x7abd3b)){if(this[_0x14a5('0x8')][_0x7abd3b[_0x14a5('0x25')]]){if(!this[_0x14a5('0x8')][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x26')]||_0x7abd3b[_0x14a5('0x1f')]['toLowerCase']()==_0x14a5('0x27')){this[_0x14a5('0x8')][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x26')]=![];if(this[_0x14a5('0x8')][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x1f')]!==_0x7abd3b[_0x14a5('0x1f')][_0x14a5('0x28')]()){this['agents'][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x29')]=_['toNumber'](moment()[_0x14a5('0x23')]('x'));}this['agents'][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x1f')]=_0x7abd3b['state'][_0x14a5('0x28')]();this[_0x14a5('0x8')][_0x7abd3b['device']][_0x14a5('0x2a')](_0x7abd3b);}}else if(this[_0x14a5('0x9')][_0x7abd3b[_0x14a5('0x25')]]){if(this[_0x14a5('0x9')][_0x7abd3b['device']]['state']!==_0x7abd3b['state'][_0x14a5('0x28')]()){this[_0x14a5('0x9')][_0x7abd3b['device']]['stateTime']=_[_0x14a5('0x2b')](moment()[_0x14a5('0x23')]('x'));}this[_0x14a5('0x9')][_0x7abd3b['device']]['state']=_0x7abd3b[_0x14a5('0x1f')][_0x14a5('0x28')]();this[_0x14a5('0x1b')](util['format'](_0x14a5('0x2c'),this[_0x14a5('0x9')][_0x7abd3b[_0x14a5('0x25')]]['name']),_0x14a5('0x2d'),this[_0x14a5('0x9')][_0x7abd3b[_0x14a5('0x25')]]);}else if(this[_0x14a5('0x7')][_0x7abd3b[_0x14a5('0x25')]]){if(this['trunks'][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x1f')]!==_0x7abd3b['state'][_0x14a5('0x28')]()){this[_0x14a5('0x7')][_0x7abd3b[_0x14a5('0x25')]]['stateTime']=_[_0x14a5('0x2b')](moment()[_0x14a5('0x23')]('x'));}this[_0x14a5('0x7')][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x1f')]=_0x7abd3b[_0x14a5('0x1f')][_0x14a5('0x28')]();this[_0x14a5('0x1b')](util[_0x14a5('0x23')](_0x14a5('0x2e'),this['trunks'][_0x7abd3b[_0x14a5('0x25')]][_0x14a5('0x2f')]),'trunk:save',this[_0x14a5('0x7')][_0x7abd3b['device']]);}else if(_[_0x14a5('0x30')](_0x7abd3b[_0x14a5('0x25')],_0x14a5('0x31'))){}else if(_['startsWith'](_0x7abd3b[_0x14a5('0x25')],_0x14a5('0x32'))){var _0x1eccef=_0x7abd3b[_0x14a5('0x25')];var _0x3153f=_0x1eccef[_0x14a5('0x33')](_0x1eccef[_0x14a5('0x34')]('/')+0x1,_0x1eccef[_0x14a5('0x34')]('@'));var _0x27ff13=_[_0x14a5('0x1d')](this['agents'],function(_0x4a6f6d){return _0x4a6f6d['mobile']==_0x3153f||_0x4a6f6d[_0x14a5('0x35')]==_0x3153f||_0x4a6f6d['accountcode']==_0x3153f;});if(_0x27ff13){if(_0x27ff13['state']!==_0x7abd3b['state'][_0x14a5('0x28')]()){_0x27ff13[_0x14a5('0x29')]=_[_0x14a5('0x2b')](moment()[_0x14a5('0x23')]('x'));}_0x27ff13[_0x14a5('0x1f')]=_0x7abd3b[_0x14a5('0x1f')][_0x14a5('0x28')]();_0x27ff13[_0x14a5('0x26')]=!![];_0x27ff13[_0x14a5('0x2a')](_0x7abd3b);}}else{}}}catch(_0x165346){logger[_0x14a5('0x17')](_0x14a5('0x36'),util[_0x14a5('0x18')](_0x165346,{'showHidden':![],'depth':null}));}};UserReport[_0x14a5('0x19')][_0x14a5('0xe')]=function(_0x49d96e){try{if(this[_0x14a5('0x1c')](_0x49d96e)&&this['isNotNull'](_0x49d96e[_0x14a5('0x37')])){if(this[_0x14a5('0x8')][_0x49d96e[_0x14a5('0x38')]]){if(!this[_0x14a5('0x8')][_0x49d96e[_0x14a5('0x38')]][_0x14a5('0x26')]||_0x49d96e[_0x14a5('0x37')][_0x14a5('0x28')]()=='registered'){this[_0x14a5('0x8')][_0x49d96e[_0x14a5('0x38')]]['local']=![];this[_0x14a5('0x8')][_0x49d96e[_0x14a5('0x38')]]['status']=_0x49d96e['peerstatus'][_0x14a5('0x28')]();this[_0x14a5('0x8')][_0x49d96e['peer']][_0x14a5('0x39')]=_0x49d96e['address'];this[_0x14a5('0x8')][_0x49d96e['peer']][_0x14a5('0x2a')](_0x49d96e);}}else if(this[_0x14a5('0x9')][_0x49d96e[_0x14a5('0x38')]]){this[_0x14a5('0x9')][_0x49d96e[_0x14a5('0x38')]][_0x14a5('0x3a')]=_0x49d96e[_0x14a5('0x37')][_0x14a5('0x28')]();this['telephones'][_0x49d96e[_0x14a5('0x38')]][_0x14a5('0x39')]=_0x49d96e[_0x14a5('0x39')];this[_0x14a5('0x1b')](util[_0x14a5('0x23')](_0x14a5('0x2c'),this[_0x14a5('0x9')][_0x49d96e['peer']][_0x14a5('0x2f')]),'telephone:save',this['telephones'][_0x49d96e[_0x14a5('0x38')]]);}else if(this[_0x14a5('0x7')][_0x49d96e[_0x14a5('0x38')]]){this[_0x14a5('0x7')][_0x49d96e['peer']][_0x14a5('0x3a')]=_0x49d96e[_0x14a5('0x37')]['toLowerCase']();this[_0x14a5('0x7')][_0x49d96e['peer']][_0x14a5('0x39')]=_0x49d96e[_0x14a5('0x39')];this[_0x14a5('0x1b')](util[_0x14a5('0x23')](_0x14a5('0x2e'),this['trunks'][_0x49d96e['peer']][_0x14a5('0x2f')]),_0x14a5('0x3b'),this['trunks'][_0x49d96e[_0x14a5('0x38')]]);}else{}}}catch(_0x402428){logger[_0x14a5('0x17')](_0x14a5('0x3c'),util[_0x14a5('0x18')](_0x402428,{'showHidden':![],'depth':null}));}};module[_0x14a5('0x3d')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 1ae983f..3906706 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 _0xa51c=['merge','omit','event','privilege','emit','custom:agentcalled','format','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','syncAgentConnect','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:%s','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','inspect','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','hasOwnProperty','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','complete','talktime','transfer','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','agentcompleteAt','custom:voiceAgentReport','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','syncMusicOnHoldStart','syncMusicOnHoldStop','blindtransfer','syncBlindTransfer','prototype','isNotNull','uniqueid','isUndefined','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound'];(function(_0x45b429,_0x4e2aa4){var _0x3712b0=function(_0x410755){while(--_0x410755){_0x45b429['push'](_0x45b429['shift']());}};_0x3712b0(++_0x4e2aa4);}(_0xa51c,0x1cc));var _0xca51=function(_0x15904f,_0x253df6){_0x15904f=_0x15904f-0x0;var _0x1f0b10=_0xa51c[_0x15904f];return _0x1f0b10;};'use strict';var _=require(_0xca51('0x0'));var moment=require(_0xca51('0x1'));var util=require('util');var Redis=require(_0xca51('0x2'));var config=require('../../../config/environment');var logger=require(_0xca51('0x3'))(_0xca51('0x4'));var ami=require(_0xca51('0x5'));config[_0xca51('0x6')]=_[_0xca51('0x7')](config[_0xca51('0x6')],{'host':_0xca51('0x8'),'port':0x18eb});var io=require(_0xca51('0x9'))(new Redis(config[_0xca51('0x6')]));function VoiceAgentReport(_0x539155){this[_0xca51('0xa')]={};this[_0xca51('0xb')]=_0x539155[_0xca51('0xb')];this[_0xca51('0xc')]=_0x539155[_0xca51('0xc')];this[_0xca51('0xd')]={};ami['on'](_0xca51('0xe'),this[_0xca51('0xf')][_0xca51('0x10')](this));ami['on'](_0xca51('0x11'),this['syncAgentConnect'][_0xca51('0x10')](this));ami['on'](_0xca51('0x12'),this[_0xca51('0x13')][_0xca51('0x10')](this));ami['on'](_0xca51('0x14'),this[_0xca51('0x15')]['bind'](this));ami['on'](_0xca51('0x16'),this[_0xca51('0x17')][_0xca51('0x10')](this));ami['on'](_0xca51('0x18'),this[_0xca51('0x19')][_0xca51('0x10')](this));ami['on']('hangup',this['syncHangup'][_0xca51('0x10')](this));ami['on']('musiconholdstart',this[_0xca51('0x1a')][_0xca51('0x10')](this));ami['on']('musiconholdstop',this[_0xca51('0x1b')][_0xca51('0x10')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0xca51('0x1c'),this[_0xca51('0x1d')][_0xca51('0x10')](this));}VoiceAgentReport[_0xca51('0x1e')]['emit']=function(_0x1215bd,_0x4ff470,_0x3cda02){io['to'](_0x1215bd)['emit'](_0x4ff470,_0x3cda02);};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x1f')]=function(_0x5b6e99){return _0x5b6e99!==null&&!_['isUndefined'](_0x5b6e99);};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0xf')]=function(_0x53f09e){try{if(this['isNotNull'](_0x53f09e)){if(_['isUndefined'](this['channels'][_0x53f09e[_0xca51('0x20')]])){this[_0xca51('0xa')][_0x53f09e[_0xca51('0x20')]]={};}if(_[_0xca51('0x21')](this['channels'][_0x53f09e[_0xca51('0x20')]][_0x53f09e[_0xca51('0x22')]])){this[_0xca51('0xa')][_0x53f09e[_0xca51('0x20')]][_0x53f09e[_0xca51('0x22')]]={'agentcalledAt':moment()['format'](_0xca51('0x23')),'lastevent':_0xca51('0x24'),'variables':this[_0xca51('0xd')][_0x53f09e[_0xca51('0x20')]],'type':this[_0xca51('0xb')][_0x53f09e[_0xca51('0x25')]]?this[_0xca51('0xb')][_0x53f09e['queue']][_0xca51('0x26')]||_0xca51('0x27'):_0xca51('0x27')};}_[_0xca51('0x28')](this[_0xca51('0xa')][_0x53f09e[_0xca51('0x20')]][_0x53f09e[_0xca51('0x22')]],_[_0xca51('0x29')](_0x53f09e,[_0xca51('0x2a'),_0xca51('0x2b')]));ami[_0xca51('0x2c')](_0xca51('0x2d'),this['channels'][_0x53f09e[_0xca51('0x20')]][_0x53f09e[_0xca51('0x22')]]);this['emit'](util[_0xca51('0x2e')]('user:%s',_0x53f09e[_0xca51('0x2f')]),_0xca51('0x30'),this['channels'][_0x53f09e['uniqueid']][_0x53f09e[_0xca51('0x22')]]);}}catch(_0x787207){logger[_0xca51('0x31')](_0xca51('0x32'),util['inspect'](_0x787207,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xca51('0x33')]=function(_0x4ec926){try{if(this[_0xca51('0x1f')](_0x4ec926)){if(this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]]){for(var _0x1dc0a8 in this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]]){if(this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]]['hasOwnProperty'](_0x1dc0a8)){if(_0x4ec926[_0xca51('0x22')]===_0x1dc0a8){this['channels'][_0x4ec926['uniqueid']][_0x1dc0a8]['agentconnectAt']=moment()[_0xca51('0x2e')](_0xca51('0x23'));this[_0xca51('0xa')][_0x4ec926['uniqueid']][_0x1dc0a8][_0xca51('0x34')]=_0xca51('0x35');this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x36')]=_0x4ec926[_0xca51('0x36')];this['channels'][_0x4ec926['uniqueid']][_0x1dc0a8]['connectedlinenum']=_0x4ec926[_0xca51('0x37')];this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x38')]=_0x4ec926[_0xca51('0x38')];this['channels'][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x39')]=_0x4ec926[_0xca51('0x39')];this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x3a')]=_0x4ec926['destchannelstatedesc'];_[_0xca51('0x28')](this[_0xca51('0xc')][_0x4ec926[_0xca51('0x3b')]],_[_0xca51('0x3c')](_0x4ec926,[_0xca51('0x25'),_0xca51('0x3d')]));this[_0xca51('0x2c')](util[_0xca51('0x2e')](_0xca51('0x3e'),_0x4ec926[_0xca51('0x2f')]),'user:agentconnect',this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x4ec926[_0xca51('0x22')]]);ami[_0xca51('0x2c')](_0xca51('0x3f'),this['channels'][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8]);}else if(!this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x12')]&&!this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x16')]){this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8]['agentringnoanswer']=!![];this[_0xca51('0xa')][_0x4ec926['uniqueid']][_0x1dc0a8][_0xca51('0x40')]=moment()['format'](_0xca51('0x23'));this['channels'][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x41')]='answered_elsewhere';this['channels'][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x34')]=_0xca51('0x42');this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x43')]=_0x4ec926[_0xca51('0x22')];this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8][_0xca51('0x44')]=_0x4ec926[_0xca51('0x2f')];ami[_0xca51('0x2c')](_0xca51('0x45'),this[_0xca51('0xa')][_0x4ec926[_0xca51('0x20')]][_0x1dc0a8]);}}}}}}catch(_0xc0f51f){logger[_0xca51('0x31')]('[syncAgentConnect][VoiceAgentReport]',util[_0xca51('0x46')](_0xc0f51f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x13')]=function(_0x5ea15d){try{if(this[_0xca51('0x1f')](_0x5ea15d)){if(this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]]&&this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]][_0x5ea15d[_0xca51('0x22')]]){this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]][_0x5ea15d[_0xca51('0x22')]]['agentringnoanswer']=!![];this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]][_0x5ea15d[_0xca51('0x22')]][_0xca51('0x40')]=moment()[_0xca51('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]][_0x5ea15d[_0xca51('0x22')]][_0xca51('0x41')]=_0xca51('0x47');this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]][_0x5ea15d['destuniqueid']][_0xca51('0x34')]=_0xca51('0x47');ami['emit']('custom:agentringnoanswer',this[_0xca51('0xa')][_0x5ea15d[_0xca51('0x20')]][_0x5ea15d[_0xca51('0x22')]]);}}}catch(_0x117d75){logger[_0xca51('0x31')](_0xca51('0x48'),util[_0xca51('0x46')](_0x117d75,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x15')]=function(_0xb5175c){try{if(this[_0xca51('0x1f')](_0xb5175c)){if(this['channels'][_0xb5175c[_0xca51('0x20')]]){for(var _0x33d86e in this['channels'][_0xb5175c['uniqueid']]){if(this[_0xca51('0xa')][_0xb5175c[_0xca51('0x20')]][_0xca51('0x49')](_0x33d86e)&&!this[_0xca51('0xa')][_0xb5175c[_0xca51('0x20')]][_0x33d86e][_0xca51('0x12')]&&!this['channels'][_0xb5175c[_0xca51('0x20')]][_0x33d86e][_0xca51('0x16')]){this[_0xca51('0xa')][_0xb5175c[_0xca51('0x20')]][_0x33d86e][_0xca51('0x12')]=!![];this[_0xca51('0xa')][_0xb5175c[_0xca51('0x20')]][_0x33d86e]['agentringnoanswerAt']=moment()[_0xca51('0x2e')](_0xca51('0x23'));this[_0xca51('0xa')][_0xb5175c['uniqueid']][_0x33d86e][_0xca51('0x41')]=_0xca51('0x4a');this[_0xca51('0xa')][_0xb5175c[_0xca51('0x20')]][_0x33d86e][_0xca51('0x34')]='abandoned';ami[_0xca51('0x2c')]('custom:agentqueuecallerabandon',this[_0xca51('0xa')][_0xb5175c[_0xca51('0x20')]][_0x33d86e]);}}}}}catch(_0x3638f4){logger['error'](_0xca51('0x4b'),util['inspect'](_0x3638f4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x17')]=function(_0x58b738){try{if(this[_0xca51('0x1f')](_0x58b738)){if(this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]]){for(var _0x4d523a in this['channels'][_0x58b738[_0xca51('0x20')]]){if(this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0xca51('0x49')](_0x4d523a)){if(this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0x4d523a][_0xca51('0x4c')]&&!this['channels'][_0x58b738[_0xca51('0x20')]][_0x4d523a][_0xca51('0x16')]){this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0x4d523a][_0xca51('0x16')]=!![];this['channels'][_0x58b738[_0xca51('0x20')]][_0x4d523a]['agentcompleteAt']=moment()[_0xca51('0x2e')](_0xca51('0x23'));this[_0xca51('0xa')][_0x58b738['uniqueid']][_0x4d523a][_0xca51('0x34')]=_0xca51('0x4d');this[_0xca51('0xa')][_0x58b738['uniqueid']][_0x4d523a]['talktime']=_0x58b738[_0xca51('0x4e')];this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0x4d523a]['reason']=_0x58b738[_0xca51('0x41')]==_0xca51('0x4f')?'agent':_0x58b738[_0xca51('0x41')];if(this[_0xca51('0xb')][_0x58b738[_0xca51('0x25')]]&&this['voiceQueues'][_0x58b738[_0xca51('0x25')]][_0xca51('0x50')]){this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0x4d523a][_0xca51('0x51')]=!![];this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0x4d523a][_0xca51('0x52')]=this[_0xca51('0xb')][_0x58b738[_0xca51('0x25')]][_0xca51('0x53')];}this[_0xca51('0xc')][_0x58b738['interface']]=_['omit'](this[_0xca51('0xc')][_0x58b738[_0xca51('0x3b')]],[_0xca51('0x25'),_0xca51('0x3d')]);this['emit'](util['format'](_0xca51('0x3e'),_0x58b738[_0xca51('0x2f')]),_0xca51('0x54'),this[_0xca51('0xa')][_0x58b738[_0xca51('0x20')]][_0x4d523a]);ami[_0xca51('0x2c')]('custom:agentcomplete',this[_0xca51('0xa')][_0x58b738['uniqueid']][_0x4d523a]);}}}}}}catch(_0x145ada){logger[_0xca51('0x31')]('[syncAgentComplete][VoiceAgentReport]',util['inspect'](_0x145ada,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xca51('0x19')]=function(_0x200562){try{if(this[_0xca51('0x1f')](_0x200562)){this[_0xca51('0x55')](_0x200562[_0xca51('0x20')],_[_0xca51('0x56')](_0x200562[_0xca51('0x57')])[0x0],_0x200562[_0xca51('0x58')]);if(this['channels'][_0x200562[_0xca51('0x20')]]){for(var _0x469d93 in this[_0xca51('0xa')][_0x200562[_0xca51('0x20')]]){if(this[_0xca51('0xa')][_0x200562[_0xca51('0x20')]][_0xca51('0x49')](_0x469d93)){if(_[_0xca51('0x21')](this[_0xca51('0xa')][_0x200562[_0xca51('0x20')]][_0x469d93]['variables'])){this['channels'][_0x200562[_0xca51('0x20')]][_0x469d93][_0xca51('0xd')]={};}this[_0xca51('0xa')][_0x200562[_0xca51('0x20')]][_0x469d93]['variables']=this['variables'][_0x200562[_0xca51('0x20')]];}}}}}catch(_0x686773){logger[_0xca51('0x31')](_0xca51('0x59'),util[_0xca51('0x46')](_0x686773,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x55')]=function(_0x4c8d7a,_0x37a29a,_0x4cda8e){var _0x55cab0=['rtpaudioqos',_0xca51('0x5a'),_0xca51('0x5b'),_0xca51('0x5c'),_0xca51('0x5d'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xca51('0x5e'),_0xca51('0x5f'),_0xca51('0x60'),_0xca51('0x61'),_0xca51('0x62'),_0xca51('0x63'),_0xca51('0x64'),_0xca51('0x65'),_0xca51('0x66'),_0xca51('0x2f'),_0xca51('0x67'),_0xca51('0x68')];if(!_[_0xca51('0x69')](_0x37a29a)&&!_[_0xca51('0x6a')](_0x55cab0,_0x37a29a)){if(_[_0xca51('0x21')](this[_0xca51('0xd')][_0x4c8d7a])){this[_0xca51('0xd')][_0x4c8d7a]={};}this[_0xca51('0xd')][_0x4c8d7a][_0x37a29a]=_0x4cda8e;}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x6b')]=function(_0x957e2f){try{if(this[_0xca51('0x1f')](_0x957e2f)){if(this[_0xca51('0xa')][_0x957e2f[_0xca51('0x20')]]){for(var _0x470eab in this[_0xca51('0xa')][_0x957e2f['uniqueid']]){if(this[_0xca51('0xa')][_0x957e2f[_0xca51('0x20')]]['hasOwnProperty'](_0x470eab)){if(this[_0xca51('0xa')][_0x957e2f[_0xca51('0x20')]][_0x470eab][_0xca51('0x41')]==_0xca51('0x4f')&&this[_0xca51('0xa')][_0x957e2f['uniqueid']][_0x470eab][_0xca51('0x16')]){this[_0xca51('0xa')][_0x957e2f[_0xca51('0x20')]][_0x470eab][_0xca51('0x6c')]=moment()[_0xca51('0x2e')](_0xca51('0x23'));}}}ami['emit'](_0xca51('0x6d'),_['values'](this['channels'][_0x957e2f[_0xca51('0x20')]]));delete this[_0xca51('0xa')][_0x957e2f[_0xca51('0x20')]];}if(this[_0xca51('0xd')][_0x957e2f[_0xca51('0x20')]]){delete this[_0xca51('0xd')][_0x957e2f[_0xca51('0x20')]];}}}catch(_0x4b3ebc){logger[_0xca51('0x31')]('[syncHangup][VoiceAgentReport]',util[_0xca51('0x46')](_0x4b3ebc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xca51('0x6e')]=function(_0x585c64){try{if(this[_0xca51('0x1f')](_0x585c64)){if(this[_0xca51('0xa')][_0x585c64[_0xca51('0x6f')]]){for(var _0x4147fb in this[_0xca51('0xa')][_0x585c64[_0xca51('0x6f')]]){if(this[_0xca51('0xa')][_0x585c64[_0xca51('0x6f')]][_0xca51('0x49')](_0x4147fb)){if(_0x585c64[_0xca51('0x70')]===_0x4147fb){var _0x3dd660=moment();this['channels'][_0x585c64[_0xca51('0x6f')]][_0x4147fb]['agentcomplete']=!![];this[_0xca51('0xa')][_0x585c64[_0xca51('0x6f')]][_0x4147fb]['agentcompleteAt']=moment()[_0xca51('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x585c64[_0xca51('0x6f')]][_0x4147fb][_0xca51('0x41')]=_0xca51('0x4f');this[_0xca51('0xa')][_0x585c64['transfereeuniqueid']][_0x4147fb]['lastevent']=_0xca51('0x4d');this['channels'][_0x585c64['transfereeuniqueid']][_0x4147fb]['talktime']=_0x3dd660[_0xca51('0x71')](this['channels'][_0x585c64[_0xca51('0x6f')]][_0x4147fb]['agentconnectAt'],_0xca51('0x72'));}}}}if(this['channels'][_0x585c64[_0xca51('0x73')]]){var _0x1e53bd=this[_0xca51('0xa')][_0x585c64['secondtransfereruniqueid']];this[_0xca51('0xa')][_0x585c64[_0xca51('0x73')]]=this[_0xca51('0xa')][_0x585c64[_0xca51('0x6f')]];this[_0xca51('0xa')][_0x585c64[_0xca51('0x6f')]]=_0x1e53bd;}}}catch(_0x5314bb){logger[_0xca51('0x31')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0xca51('0x46')](_0x5314bb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x1d')]=function(_0x5e3e21){try{if(this[_0xca51('0x1f')](_0x5e3e21)){if(this[_0xca51('0xa')][_0x5e3e21[_0xca51('0x6f')]]){for(var _0x1659ee in this[_0xca51('0xa')][_0x5e3e21[_0xca51('0x6f')]]){if(this[_0xca51('0xa')][_0x5e3e21[_0xca51('0x6f')]][_0xca51('0x49')](_0x1659ee)){if(_0x5e3e21[_0xca51('0x74')]===_0x1659ee){var _0x3a2908=moment();this[_0xca51('0xa')][_0x5e3e21['transfereeuniqueid']][_0x1659ee]['agentcomplete']=!![];this['channels'][_0x5e3e21['transfereeuniqueid']][_0x1659ee][_0xca51('0x6c')]=_0x3a2908;this[_0xca51('0xa')][_0x5e3e21[_0xca51('0x6f')]][_0x1659ee]['reason']=_0xca51('0x4f');this['channels'][_0x5e3e21[_0xca51('0x6f')]][_0x1659ee][_0xca51('0x34')]=_0xca51('0x4d');this[_0xca51('0xa')][_0x5e3e21[_0xca51('0x6f')]][_0x1659ee][_0xca51('0x4e')]=_0x3a2908['diff'](this[_0xca51('0xa')][_0x5e3e21[_0xca51('0x6f')]][_0x1659ee]['agentconnectAt'],_0xca51('0x72'));}}}}}}catch(_0xe34d2){logger[_0xca51('0x31')](_0xca51('0x75'),util['inspect'](_0xe34d2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x1a')]=function(_0x5a960d){var _0x868630='';try{if(this[_0xca51('0x1f')](_0x5a960d)){if(_0x5a960d[_0xca51('0x76')]){_0x868630=_0x5a960d[_0xca51('0x76')][_0xca51('0x77')](0x0,_0x5a960d[_0xca51('0x76')]['lastIndexOf']('-'));if(this['agents'][_0x868630]){this['agents'][_0x868630][_0xca51('0x78')]=!![];}}}}catch(_0x3e3757){logger[_0xca51('0x31')](_0xca51('0x79'),util[_0xca51('0x46')](_0x3e3757,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xca51('0x1e')][_0xca51('0x1b')]=function(_0x59c34c){var _0x411196='';try{if(this['isNotNull'](_0x59c34c)){if(_0x59c34c['channel']){_0x411196=_0x59c34c['channel'][_0xca51('0x77')](0x0,_0x59c34c[_0xca51('0x76')][_0xca51('0x7a')]('-'));if(this[_0xca51('0xc')][_0x411196]){this[_0xca51('0xc')][_0x411196][_0xca51('0x78')]=![];}}}}catch(_0x175782){logger[_0xca51('0x31')](_0xca51('0x7b'),util[_0xca51('0x46')](_0x175782,{'showHidden':![],'depth':null}));}};module[_0xca51('0x7c')]=VoiceAgentReport; \ No newline at end of file +var _0xdaf4=['voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','variables','type','inbound','merge','omit','event','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','format','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','queue','destconnectedlinenum','user:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','syncQueueCallerAbandon','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','acw','agentacw','interface','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberrealtime','isNil','transfer','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels'];(function(_0x708606,_0x1c1aa0){var _0x8e52b9=function(_0x4c6eea){while(--_0x4c6eea){_0x708606['push'](_0x708606['shift']());}};_0x8e52b9(++_0x1c1aa0);}(_0xdaf4,0x6f));var _0x4daf=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0xdaf4[_0x3718b7];return _0xf8c91e;};'use strict';var _=require(_0x4daf('0x0'));var moment=require(_0x4daf('0x1'));var util=require(_0x4daf('0x2'));var Redis=require(_0x4daf('0x3'));var config=require(_0x4daf('0x4'));var logger=require(_0x4daf('0x5'))(_0x4daf('0x6'));var ami=require(_0x4daf('0x7'));config[_0x4daf('0x8')]=_[_0x4daf('0x9')](config[_0x4daf('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x4daf('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x5d0cfb){this[_0x4daf('0xb')]={};this[_0x4daf('0xc')]=_0x5d0cfb[_0x4daf('0xc')];this[_0x4daf('0xd')]=_0x5d0cfb['agents'];this['variables']={};ami['on'](_0x4daf('0xe'),this[_0x4daf('0xf')][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x11'),this[_0x4daf('0x12')][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x13'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x4daf('0x14'),this['syncQueueCallerAbandon'][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x15'),this[_0x4daf('0x16')]['bind'](this));ami['on'](_0x4daf('0x17'),this[_0x4daf('0x18')][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x19'),this[_0x4daf('0x1a')][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x1b'),this['syncMusicOnHoldStart'][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x1c'),this['syncMusicOnHoldStop'][_0x4daf('0x10')](this));ami['on'](_0x4daf('0x1d'),this[_0x4daf('0x1e')][_0x4daf('0x10')](this));ami['on']('blindtransfer',this[_0x4daf('0x1f')][_0x4daf('0x10')](this));}VoiceAgentReport['prototype'][_0x4daf('0x20')]=function(_0x1c3a73,_0x17686d,_0x168540){io['to'](_0x1c3a73)[_0x4daf('0x20')](_0x17686d,_0x168540);};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x22')]=function(_0x16c58c){return _0x16c58c!==null&&!_[_0x4daf('0x23')](_0x16c58c);};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0xf')]=function(_0x179d08){try{if(this[_0x4daf('0x22')](_0x179d08)){if(_[_0x4daf('0x23')](this[_0x4daf('0xb')][_0x179d08[_0x4daf('0x24')]])){this['channels'][_0x179d08['uniqueid']]={};}if(_['isUndefined'](this[_0x4daf('0xb')][_0x179d08[_0x4daf('0x24')]][_0x179d08['destuniqueid']])){this[_0x4daf('0xb')][_0x179d08[_0x4daf('0x24')]][_0x179d08[_0x4daf('0x25')]]={'agentcalledAt':moment()['format'](_0x4daf('0x26')),'lastevent':_0x4daf('0x27'),'variables':this[_0x4daf('0x28')][_0x179d08['uniqueid']],'type':this[_0x4daf('0xc')][_0x179d08['queue']]?this[_0x4daf('0xc')][_0x179d08['queue']][_0x4daf('0x29')]||'inbound':_0x4daf('0x2a')};}_[_0x4daf('0x2b')](this[_0x4daf('0xb')][_0x179d08['uniqueid']][_0x179d08['destuniqueid']],_[_0x4daf('0x2c')](_0x179d08,[_0x4daf('0x2d'),'privilege']));ami[_0x4daf('0x20')](_0x4daf('0x2e'),this[_0x4daf('0xb')][_0x179d08[_0x4daf('0x24')]][_0x179d08[_0x4daf('0x25')]]);this['emit'](util['format'](_0x4daf('0x2f'),_0x179d08[_0x4daf('0x30')]),_0x4daf('0x31'),this[_0x4daf('0xb')][_0x179d08['uniqueid']][_0x179d08[_0x4daf('0x25')]]);}}catch(_0x456d32){logger[_0x4daf('0x32')](_0x4daf('0x33'),util[_0x4daf('0x34')](_0x456d32,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x12')]=function(_0x3f7b8e){try{if(this['isNotNull'](_0x3f7b8e)){if(this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]]){for(var _0x5e8bb9 in this['channels'][_0x3f7b8e['uniqueid']]){if(this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x4daf('0x35')](_0x5e8bb9)){if(_0x3f7b8e[_0x4daf('0x25')]===_0x5e8bb9){this[_0x4daf('0xb')][_0x3f7b8e['uniqueid']][_0x5e8bb9]['agentconnectAt']=moment()[_0x4daf('0x36')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x37')]=_0x4daf('0x38');this[_0x4daf('0xb')][_0x3f7b8e['uniqueid']][_0x5e8bb9][_0x4daf('0x39')]=_0x3f7b8e[_0x4daf('0x39')];this[_0x4daf('0xb')][_0x3f7b8e['uniqueid']][_0x5e8bb9][_0x4daf('0x3a')]=_0x3f7b8e[_0x4daf('0x3a')];this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x3b')]=_0x3f7b8e['connectedlinename'];this[_0x4daf('0xb')][_0x3f7b8e['uniqueid']][_0x5e8bb9][_0x4daf('0x3c')]=_0x3f7b8e[_0x4daf('0x3c')];this['channels'][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x3d')]=_0x3f7b8e[_0x4daf('0x3d')];_[_0x4daf('0x2b')](this[_0x4daf('0xd')][_0x3f7b8e['interface']],_['pick'](_0x3f7b8e,[_0x4daf('0x3e'),_0x4daf('0x3f')]));this[_0x4daf('0x20')](util[_0x4daf('0x36')](_0x4daf('0x2f'),_0x3f7b8e['membername']),_0x4daf('0x40'),this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x3f7b8e[_0x4daf('0x25')]]);ami[_0x4daf('0x20')]('custom:agentconnect',this['channels'][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9]);}else if(!this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x13')]&&!this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x15')]){this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9]['agentringnoanswer']=!![];this['channels'][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x41')]=moment()['format'](_0x4daf('0x26'));this['channels'][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9][_0x4daf('0x42')]=_0x4daf('0x43');this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9]['lastevent']='answered_elsewhere';this[_0x4daf('0xb')][_0x3f7b8e['uniqueid']][_0x5e8bb9][_0x4daf('0x44')]=_0x3f7b8e[_0x4daf('0x25')];this[_0x4daf('0xb')][_0x3f7b8e[_0x4daf('0x24')]][_0x5e8bb9]['answeredelsewheremembername']=_0x3f7b8e[_0x4daf('0x30')];ami[_0x4daf('0x20')](_0x4daf('0x45'),this[_0x4daf('0xb')][_0x3f7b8e['uniqueid']][_0x5e8bb9]);}}}}}}catch(_0x4b21ab){logger['error'](_0x4daf('0x46'),util[_0x4daf('0x34')](_0x4b21ab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x47')]=function(_0xffe290){try{if(this['isNotNull'](_0xffe290)){if(this[_0x4daf('0xb')][_0xffe290['uniqueid']]&&this[_0x4daf('0xb')][_0xffe290['uniqueid']][_0xffe290[_0x4daf('0x25')]]){this[_0x4daf('0xb')][_0xffe290[_0x4daf('0x24')]][_0xffe290['destuniqueid']][_0x4daf('0x13')]=!![];this[_0x4daf('0xb')][_0xffe290[_0x4daf('0x24')]][_0xffe290[_0x4daf('0x25')]][_0x4daf('0x41')]=moment()[_0x4daf('0x36')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4daf('0xb')][_0xffe290[_0x4daf('0x24')]][_0xffe290[_0x4daf('0x25')]][_0x4daf('0x42')]=_0x4daf('0x48');this[_0x4daf('0xb')][_0xffe290[_0x4daf('0x24')]][_0xffe290[_0x4daf('0x25')]][_0x4daf('0x37')]=_0x4daf('0x48');ami[_0x4daf('0x20')](_0x4daf('0x49'),this[_0x4daf('0xb')][_0xffe290[_0x4daf('0x24')]][_0xffe290[_0x4daf('0x25')]]);}}}catch(_0x2079a5){logger['error'](_0x4daf('0x4a'),util['inspect'](_0x2079a5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x4b')]=function(_0x23acb8){try{if(this[_0x4daf('0x22')](_0x23acb8)){if(this[_0x4daf('0xb')][_0x23acb8['uniqueid']]){for(var _0x84cb8 in this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]]){if(this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]][_0x4daf('0x35')](_0x84cb8)&&!this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]][_0x84cb8][_0x4daf('0x13')]&&!this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]][_0x84cb8][_0x4daf('0x15')]){this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]][_0x84cb8][_0x4daf('0x13')]=!![];this[_0x4daf('0xb')][_0x23acb8['uniqueid']][_0x84cb8][_0x4daf('0x41')]=moment()[_0x4daf('0x36')](_0x4daf('0x26'));this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]][_0x84cb8][_0x4daf('0x42')]=_0x4daf('0x4c');this[_0x4daf('0xb')][_0x23acb8[_0x4daf('0x24')]][_0x84cb8]['lastevent']=_0x4daf('0x4c');ami[_0x4daf('0x20')](_0x4daf('0x4d'),this['channels'][_0x23acb8[_0x4daf('0x24')]][_0x84cb8]);}}}}}catch(_0x31bb24){logger[_0x4daf('0x32')](_0x4daf('0x4e'),util[_0x4daf('0x34')](_0x31bb24,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x16')]=function(_0x23004a){try{if(this[_0x4daf('0x22')](_0x23004a)){if(this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]]){for(var _0x3981bb in this['channels'][_0x23004a[_0x4daf('0x24')]]){if(this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]][_0x4daf('0x35')](_0x3981bb)){if(this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]][_0x3981bb]['agentconnectAt']&&!this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]][_0x3981bb][_0x4daf('0x15')]){this[_0x4daf('0xb')][_0x23004a['uniqueid']][_0x3981bb][_0x4daf('0x15')]=!![];this[_0x4daf('0xb')][_0x23004a['uniqueid']][_0x3981bb][_0x4daf('0x4f')]=moment()[_0x4daf('0x36')](_0x4daf('0x26'));this['channels'][_0x23004a[_0x4daf('0x24')]][_0x3981bb][_0x4daf('0x37')]=_0x4daf('0x50');this[_0x4daf('0xb')][_0x23004a['uniqueid']][_0x3981bb][_0x4daf('0x51')]=_0x23004a[_0x4daf('0x51')];this['channels'][_0x23004a['uniqueid']][_0x3981bb][_0x4daf('0x42')]=_0x23004a['reason']=='transfer'?'agent':_0x23004a[_0x4daf('0x42')];if(this[_0x4daf('0xc')][_0x23004a['queue']]&&this[_0x4daf('0xc')][_0x23004a['queue']][_0x4daf('0x52')]){this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]][_0x3981bb][_0x4daf('0x53')]=!![];this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]][_0x3981bb]['acwtime']=this['voiceQueues'][_0x23004a[_0x4daf('0x3e')]]['acwTimeout'];}this[_0x4daf('0xd')][_0x23004a[_0x4daf('0x54')]]=_[_0x4daf('0x2c')](this['agents'][_0x23004a[_0x4daf('0x54')]],[_0x4daf('0x3e'),_0x4daf('0x3f')]);this[_0x4daf('0x20')](util[_0x4daf('0x36')]('user:%s',_0x23004a[_0x4daf('0x30')]),_0x4daf('0x55'),this[_0x4daf('0xb')][_0x23004a[_0x4daf('0x24')]][_0x3981bb]);ami[_0x4daf('0x20')](_0x4daf('0x56'),this['channels'][_0x23004a[_0x4daf('0x24')]][_0x3981bb]);}}}}}}catch(_0x41cc7b){logger[_0x4daf('0x32')](_0x4daf('0x57'),util[_0x4daf('0x34')](_0x41cc7b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x4daf('0x18')]=function(_0x1dcea5){try{if(this['isNotNull'](_0x1dcea5)){this[_0x4daf('0x58')](_0x1dcea5[_0x4daf('0x24')],_['keys'](_0x1dcea5[_0x4daf('0x59')])[0x0],_0x1dcea5[_0x4daf('0x5a')]);if(this[_0x4daf('0xb')][_0x1dcea5[_0x4daf('0x24')]]){for(var _0x5312da in this[_0x4daf('0xb')][_0x1dcea5[_0x4daf('0x24')]]){if(this[_0x4daf('0xb')][_0x1dcea5['uniqueid']]['hasOwnProperty'](_0x5312da)){if(_[_0x4daf('0x23')](this[_0x4daf('0xb')][_0x1dcea5['uniqueid']][_0x5312da]['variables'])){this['channels'][_0x1dcea5['uniqueid']][_0x5312da][_0x4daf('0x28')]={};}this['channels'][_0x1dcea5[_0x4daf('0x24')]][_0x5312da][_0x4daf('0x28')]=this[_0x4daf('0x28')][_0x1dcea5[_0x4daf('0x24')]];}}}}}catch(_0x5d1eef){logger[_0x4daf('0x32')](_0x4daf('0x5b'),util[_0x4daf('0x34')](_0x5d1eef,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')]['addVariable']=function(_0x1ff37a,_0x19b446,_0x35f19d){var _0x2615ca=[_0x4daf('0x5c'),'rtpaudioqosbridged',_0x4daf('0x5d'),_0x4daf('0x5e'),_0x4daf('0x5f'),_0x4daf('0x60'),_0x4daf('0x61'),_0x4daf('0x62'),_0x4daf('0x63'),'sipuri',_0x4daf('0x64'),_0x4daf('0x65'),_0x4daf('0x66'),_0x4daf('0x67'),'memberinterface',_0x4daf('0x68'),_0x4daf('0x30'),'memberpenalty',_0x4daf('0x69')];if(!_[_0x4daf('0x6a')](_0x19b446)&&!_['includes'](_0x2615ca,_0x19b446)){if(_[_0x4daf('0x23')](this['variables'][_0x1ff37a])){this[_0x4daf('0x28')][_0x1ff37a]={};}this[_0x4daf('0x28')][_0x1ff37a][_0x19b446]=_0x35f19d;}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x1a')]=function(_0x46f892){try{if(this[_0x4daf('0x22')](_0x46f892)){if(this[_0x4daf('0xb')][_0x46f892[_0x4daf('0x24')]]){for(var _0xa11d9 in this[_0x4daf('0xb')][_0x46f892[_0x4daf('0x24')]]){if(this['channels'][_0x46f892[_0x4daf('0x24')]][_0x4daf('0x35')](_0xa11d9)){if(this['channels'][_0x46f892[_0x4daf('0x24')]][_0xa11d9]['reason']==_0x4daf('0x6b')&&this['channels'][_0x46f892[_0x4daf('0x24')]][_0xa11d9]['agentcomplete']){this[_0x4daf('0xb')][_0x46f892['uniqueid']][_0xa11d9][_0x4daf('0x4f')]=moment()[_0x4daf('0x36')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x4daf('0x20')]('custom:voiceAgentReport',_['values'](this[_0x4daf('0xb')][_0x46f892[_0x4daf('0x24')]]));delete this[_0x4daf('0xb')][_0x46f892['uniqueid']];}if(this[_0x4daf('0x28')][_0x46f892[_0x4daf('0x24')]]){delete this[_0x4daf('0x28')][_0x46f892[_0x4daf('0x24')]];}}}catch(_0x5eed0f){logger[_0x4daf('0x32')](_0x4daf('0x6c'),util[_0x4daf('0x34')](_0x5eed0f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x1e')]=function(_0x2b0451){try{if(this[_0x4daf('0x22')](_0x2b0451)){if(this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]]){for(var _0x17440a in this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]]){if(this[_0x4daf('0xb')][_0x2b0451['transfereeuniqueid']][_0x4daf('0x35')](_0x17440a)){if(_0x2b0451[_0x4daf('0x6e')]===_0x17440a){var _0x1cde07=moment();this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]][_0x17440a]['agentcomplete']=!![];this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]][_0x17440a][_0x4daf('0x4f')]=moment()[_0x4daf('0x36')](_0x4daf('0x26'));this['channels'][_0x2b0451[_0x4daf('0x6d')]][_0x17440a][_0x4daf('0x42')]=_0x4daf('0x6b');this['channels'][_0x2b0451['transfereeuniqueid']][_0x17440a][_0x4daf('0x37')]=_0x4daf('0x50');this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]][_0x17440a][_0x4daf('0x51')]=_0x1cde07[_0x4daf('0x6f')](this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]][_0x17440a]['agentconnectAt'],'seconds');}}}}if(this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x70')]]){var _0x440378=this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x70')]];this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x70')]]=this[_0x4daf('0xb')][_0x2b0451['transfereeuniqueid']];this[_0x4daf('0xb')][_0x2b0451[_0x4daf('0x6d')]]=_0x440378;}}}catch(_0x4b4974){logger[_0x4daf('0x32')](_0x4daf('0x71'),util[_0x4daf('0x34')](_0x4b4974,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')][_0x4daf('0x1f')]=function(_0x16bfbb){try{if(this['isNotNull'](_0x16bfbb)){if(this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]]){for(var _0xa7d00d in this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]]){if(this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]][_0x4daf('0x35')](_0xa7d00d)){if(_0x16bfbb[_0x4daf('0x72')]===_0xa7d00d){var _0x2a9108=moment();this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]][_0xa7d00d][_0x4daf('0x15')]=!![];this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]][_0xa7d00d][_0x4daf('0x4f')]=_0x2a9108;this['channels'][_0x16bfbb[_0x4daf('0x6d')]][_0xa7d00d][_0x4daf('0x42')]=_0x4daf('0x6b');this[_0x4daf('0xb')][_0x16bfbb['transfereeuniqueid']][_0xa7d00d][_0x4daf('0x37')]=_0x4daf('0x50');this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]][_0xa7d00d][_0x4daf('0x51')]=_0x2a9108[_0x4daf('0x6f')](this[_0x4daf('0xb')][_0x16bfbb[_0x4daf('0x6d')]][_0xa7d00d]['agentconnectAt'],'seconds');}}}}}}catch(_0x4f3084){logger['error'](_0x4daf('0x73'),util['inspect'](_0x4f3084,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x4f7d3c){var _0x372dde='';try{if(this[_0x4daf('0x22')](_0x4f7d3c)){if(_0x4f7d3c[_0x4daf('0x74')]){_0x372dde=_0x4f7d3c[_0x4daf('0x74')][_0x4daf('0x75')](0x0,_0x4f7d3c[_0x4daf('0x74')][_0x4daf('0x76')]('-'));if(this[_0x4daf('0xd')][_0x372dde]){this['agents'][_0x372dde][_0x4daf('0x77')]=!![];}}}}catch(_0x25b438){logger['error'](_0x4daf('0x78'),util[_0x4daf('0x34')](_0x25b438,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x4daf('0x21')]['syncMusicOnHoldStop']=function(_0x377424){var _0x47b89c='';try{if(this[_0x4daf('0x22')](_0x377424)){if(_0x377424[_0x4daf('0x74')]){_0x47b89c=_0x377424[_0x4daf('0x74')][_0x4daf('0x75')](0x0,_0x377424[_0x4daf('0x74')][_0x4daf('0x76')]('-'));if(this['agents'][_0x47b89c]){this[_0x4daf('0xd')][_0x47b89c][_0x4daf('0x77')]=![];}}}}catch(_0x346dab){logger[_0x4daf('0x32')](_0x4daf('0x79'),util['inspect'](_0x346dab,{'showHidden':![],'depth':null}));}};module[_0x4daf('0x7a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 059e93e..919dc76 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 _0x906c=['subtract','seconds','disposition','lastdata','match','queue','[syncNewExten][VoiceCallReport]','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','toNumber','UserId','membername','name','syncMixMonitorFilename','monitor','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','rec','syncVarSet','variable','mixmonitor_filename','value','xmd-callerid','callerid','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','endtime','billableseconds','holdtime','omit','[syncHangup][VoiceCallReport]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','origtransfereruniqueid','transferconnectedlinenum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','syncMusicOnHoldStop','mohtime','milliseconds','mohstarttime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','not_inuse','inuse','busy','ringing','ringinuse','onhold','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','actionCoreShowChannels','catch','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','keys','error','[syncNewCallerId][VoiceCallReport]','channel','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','context','from-sip','split','user:%s','accountcode','exten','[syncNewChannel][VoiceCallReport]','inspect','OutgoingSpoolFailed','application','appdata','applicationdata','toLowerCase','duration'];(function(_0x40f9ca,_0x41f6f6){var _0x1c0ac1=function(_0x297512){while(--_0x297512){_0x40f9ca['push'](_0x40f9ca['shift']());}};_0x1c0ac1(++_0x41f6f6);}(_0x906c,0x17d));var _0xc906=function(_0x14e665,_0xaebfb4){_0x14e665=_0x14e665-0x0;var _0x304151=_0x906c[_0x14e665];return _0x304151;};'use strict';var BPromise=require(_0xc906('0x0'));var _=require(_0xc906('0x1'));var moment=require(_0xc906('0x2'));var util=require(_0xc906('0x3'));var path=require(_0xc906('0x4'));var Redis=require(_0xc906('0x5'));var config=require(_0xc906('0x6'));var logger=require(_0xc906('0x7'))(_0xc906('0x8'));var ami=require(_0xc906('0x9'));var Channel=require(_0xc906('0xa'));var statusDesc=[_0xc906('0xb'),_0xc906('0xc'),_0xc906('0xd'),_0xc906('0xe'),'invalid','unavailable',_0xc906('0xf'),_0xc906('0x10'),_0xc906('0x11')];var applications=['set','queue','agi','dial',_0xc906('0x12'),_0xc906('0x13')];var dispositions=[_0xc906('0x14'),_0xc906('0x15'),_0xc906('0x15'),_0xc906('0x14'),'NO\x20ANSWER',_0xc906('0x14'),_0xc906('0x16'),_0xc906('0x17'),_0xc906('0x15'),_0xc906('0x15'),_0xc906('0x15')];var actions={};config[_0xc906('0x18')]=_[_0xc906('0x19')](config[_0xc906('0x18')],{'host':_0xc906('0x1a'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc906('0x18')]));function VoiceCallReport(_0x393a1a){this[_0xc906('0x1b')]=_0x393a1a[_0xc906('0x1b')];this[_0xc906('0x1c')]=_0x393a1a[_0xc906('0x1c')];ami['on'](_0xc906('0x1d'),this[_0xc906('0x1e')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x20'),this[_0xc906('0x1e')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x21'),this[_0xc906('0x22')]['bind'](this));ami['on'](_0xc906('0x23'),this[_0xc906('0x24')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x25'),this['syncVarSet']['bind'](this));ami['on'](_0xc906('0x26'),this[_0xc906('0x27')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x28'),this[_0xc906('0x29')][_0xc906('0x1f')](this));ami['on']('attendedtransfer',this[_0xc906('0x2a')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x2b'),this[_0xc906('0x2c')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x2d'),this[_0xc906('0x2e')][_0xc906('0x1f')](this));ami['on'](_0xc906('0x2f'),this['syncMusicOnHoldStop'][_0xc906('0x1f')](this));return BPromise[_0xc906('0x30')]()['then'](ami[_0xc906('0x31')]())[_0xc906('0x32')](function(_0xe1825e){console['log'](_0xe1825e);});}VoiceCallReport[_0xc906('0x33')][_0xc906('0x34')]=function(_0x3c7085){return _0x3c7085!==null&&!_[_0xc906('0x35')](_0x3c7085);};VoiceCallReport[_0xc906('0x33')][_0xc906('0x36')]=function(_0x254ef7,_0x25edab,_0x164e45){io['to'](_0x254ef7)[_0xc906('0x36')](_0x25edab,_0x164e45);};VoiceCallReport['prototype'][_0xc906('0x29')]=function(_0x54c7de){try{if(this[_0xc906('0x34')](_0x54c7de)){if(_0x54c7de[_0xc906('0x37')]===_0x54c7de[_0xc906('0x38')]){if(!_[_0xc906('0x35')](this['channels'][_0x54c7de['uniqueid']])){_[_0xc906('0x39')](this['channels'][_0x54c7de[_0xc906('0x37')]],_[_0xc906('0x3a')](_0x54c7de,_[_0xc906('0x3b')](this[_0xc906('0x1b')][_0x54c7de[_0xc906('0x37')]])));}}}}catch(_0x21ab15){logger[_0xc906('0x3c')](_0xc906('0x3d'),util['inspect'](_0x21ab15,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')]['syncNewChannel']=function(_0x11abae){try{if(this['isNotNull'](_0x11abae)){if(_0x11abae['uniqueid']===_0x11abae[_0xc906('0x38')]&&_0x11abae[_0xc906('0x3e')]!='OutgoingSpoolFailed'){if(_[_0xc906('0x35')](this['channels'][_0x11abae[_0xc906('0x37')]])){this[_0xc906('0x1b')][_0x11abae[_0xc906('0x37')]]=new Channel();this[_0xc906('0x1b')][_0x11abae[_0xc906('0x37')]][_0xc906('0x3f')]=moment()[_0xc906('0x40')](_0xc906('0x41'));this[_0xc906('0x1b')][_0x11abae[_0xc906('0x37')]]['disposition']=dispositions[_['toNumber'](_0x11abae[_0xc906('0x42')])];_[_0xc906('0x39')](this[_0xc906('0x1b')][_0x11abae[_0xc906('0x37')]],_[_0xc906('0x3a')](_0x11abae,_['keys'](this[_0xc906('0x1b')][_0x11abae['uniqueid']])));if(_0x11abae[_0xc906('0x43')]===_0xc906('0x44')){if(this[_0xc906('0x1c')][_0x11abae[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]]){this[_0xc906('0x1c')][_0x11abae[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]]['destconnectedlinenum']=_0x11abae['exten'];this[_0xc906('0x36')](util['format'](_0xc906('0x46'),this[_0xc906('0x1c')][_0x11abae[_0xc906('0x3e')]['split']('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0xc906('0x1c')][_0x11abae[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]][_0xc906('0x47')],'destconnectedlinenum':_0x11abae[_0xc906('0x48')]});}}}}}}catch(_0x16c150){logger[_0xc906('0x3c')](_0xc906('0x49'),util[_0xc906('0x4a')](_0x16c150,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x39320a){try{if(this[_0xc906('0x34')](_0x39320a)){if(_0x39320a[_0xc906('0x37')]===_0x39320a[_0xc906('0x38')]&&_0x39320a[_0xc906('0x48')]!='h'&&_0x39320a[_0xc906('0x3e')]!=_0xc906('0x4b')){_0x39320a['application']=_0x39320a[_0xc906('0x4c')]['toLowerCase']();_0x39320a['applicationdata']=(_0x39320a[_0xc906('0x4d')]||_0x39320a[_0xc906('0x4e')])[_0xc906('0x4f')]();if(_[_0xc906('0x35')](this[_0xc906('0x1b')][_0x39320a[_0xc906('0x37')]])){this['channels'][_0x39320a[_0xc906('0x37')]]=new Channel();this[_0xc906('0x1b')][_0x39320a[_0xc906('0x37')]]['starttime']=_0x39320a[_0xc906('0x50')]?moment()[_0xc906('0x51')](moment[_0xc906('0x50')](_0x39320a['duration'])[_0xc906('0x52')](),_0xc906('0x52'))[_0xc906('0x40')](_0xc906('0x41')):moment()[_0xc906('0x40')](_0xc906('0x41'));this[_0xc906('0x1b')][_0x39320a['uniqueid']][_0xc906('0x53')]='NO\x20ANSWER';}_['merge'](this[_0xc906('0x1b')][_0x39320a[_0xc906('0x37')]],_['pick'](_0x39320a,_['keys'](this['channels'][_0x39320a[_0xc906('0x37')]])));if(_['includes'](applications,_0x39320a[_0xc906('0x4c')])){this[_0xc906('0x1b')][_0x39320a[_0xc906('0x37')]]['lastapplication']=_0x39320a['application'];this[_0xc906('0x1b')][_0x39320a['uniqueid']][_0xc906('0x54')]=_0x39320a[_0xc906('0x4e')];if(_0x39320a[_0xc906('0x4c')]==='set'&&_['startsWith'](_0x39320a['applicationdata'],'cdr(')){var _0xdd5dd6=_0x39320a[_0xc906('0x4e')][_0xc906('0x45')]('=');var _0xe56138=_0xdd5dd6[0x0][_0xc906('0x55')](/cdr\((.*)\)/);if(_0xe56138){this[_0xc906('0x1b')][_0x39320a[_0xc906('0x37')]][_0xe56138[0x1]]=_0xdd5dd6[0x1];}}else if(_0x39320a[_0xc906('0x4c')]===_0xc906('0x56')){this[_0xc906('0x1b')][_0x39320a[_0xc906('0x37')]][_0xc906('0x56')]=_0x39320a[_0xc906('0x4e')][_0xc906('0x45')](',')[0x0];}}}}}catch(_0x4693e6){logger[_0xc906('0x3c')](_0xc906('0x57'),util[_0xc906('0x4a')](_0x4693e6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')]['syncNewState']=function(_0x3f9f44){try{if(this['isNotNull'](_0x3f9f44)){if(_0x3f9f44['uniqueid']!==_0x3f9f44[_0xc906('0x38')]){if(this[_0xc906('0x1b')][_0x3f9f44['linkedid']]){if(_0x3f9f44[_0xc906('0x42')]==='6'){if(!this[_0xc906('0x1b')][_0x3f9f44['linkedid']][_0xc906('0x58')]){var _0x2bd092=moment();this['channels'][_0x3f9f44['linkedid']][_0xc906('0x58')]=!![];this[_0xc906('0x1b')][_0x3f9f44['linkedid']][_0xc906('0x59')]=_0x2bd092[_0xc906('0x40')](_0xc906('0x41'));if(this['channels'][_0x3f9f44[_0xc906('0x38')]][_0xc906('0x3f')]){this['channels'][_0x3f9f44[_0xc906('0x38')]]['holdtime']=_0x2bd092[_0xc906('0x5a')](this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x38')]][_0xc906('0x3f')],'seconds');}}this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x38')]]['linkedid']=_0x3f9f44[_0xc906('0x37')];if(_0x3f9f44[_0xc906('0x5b')]!==_0xc906('0x5c')){this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x38')]][_0xc906('0x5d')]=_0x3f9f44[_0xc906('0x5b')];}this[_0xc906('0x1b')][_0x3f9f44['linkedid']][_0xc906('0x5e')]=_0x3f9f44[_0xc906('0x5f')];this[_0xc906('0x1b')][_0x3f9f44['linkedid']][_0xc906('0x60')]=_0x3f9f44['channel'];this[_0xc906('0x1b')][_0x3f9f44['linkedid']]['disposition']=dispositions[_[_0xc906('0x61')](_0x3f9f44[_0xc906('0x42')])];if(this[_0xc906('0x1c')][_0x3f9f44[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]]){this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x38')]][_0xc906('0x62')]=this[_0xc906('0x1c')][_0x3f9f44[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]]['id'];this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x38')]][_0xc906('0x63')]=this['agents'][_0x3f9f44['channel'][_0xc906('0x45')]('-')[0x0]][_0xc906('0x64')];}}}}else{if(this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x37')]]){if(_0x3f9f44[_0xc906('0x42')]==='6'){if(this[_0xc906('0x1c')][_0x3f9f44[_0xc906('0x3e')]['split']('-')[0x0]]){this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x37')]][_0xc906('0x62')]=this[_0xc906('0x1c')][_0x3f9f44[_0xc906('0x3e')]['split']('-')[0x0]]['id'];this[_0xc906('0x1b')][_0x3f9f44[_0xc906('0x37')]][_0xc906('0x63')]=this[_0xc906('0x1c')][_0x3f9f44[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]][_0xc906('0x64')];}}}}}}catch(_0xa0b9b3){logger[_0xc906('0x3c')]('[syncNewState][VoiceCallReport]',util['inspect'](_0xa0b9b3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')][_0xc906('0x65')]=function(_0x13e8be,_0x5a9cf1){if(this[_0xc906('0x1b')][_0x13e8be]){this[_0xc906('0x1b')][_0x13e8be][_0xc906('0x66')]=!![];if(_['endsWith'](_0x5a9cf1,_0xc906('0x67'))){_0x5a9cf1=_0x5a9cf1['replace'](_0xc906('0x67'),_0xc906('0x68'));}this['channels'][_0x13e8be][_0xc906('0x69')]=_0x5a9cf1;var _0x5451eb=_[_0xc906('0x6a')](this[_0xc906('0x1b')][_0x13e8be][_0xc906('0x6b')],{'filename':_0x5a9cf1});if(_[_0xc906('0x6c')](_0x5451eb)){this[_0xc906('0x1b')][_0x13e8be][_0xc906('0x6b')][_0xc906('0x6d')]({'filename':_0x5a9cf1,'createdAt':moment()[_0xc906('0x40')](_0xc906('0x41')),'mixmonitorid':'','status':_0xc906('0x6e')});}}};VoiceCallReport[_0xc906('0x33')][_0xc906('0x6f')]=function(_0x43cd28){try{if(this[_0xc906('0x34')](_0x43cd28)){if(this['channels'][_0x43cd28['uniqueid']]&&_0x43cd28[_0xc906('0x3e')]!=_0xc906('0x4b')){if(this[_0xc906('0x34')](_0x43cd28['variable'])){if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')][_0xc906('0x71')])){this['syncMixMonitorFilename'](_0x43cd28[_0xc906('0x37')],_0x43cd28['value']);}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')]['xmd-phone'])){this[_0xc906('0x1b')][_0x43cd28['uniqueid']]['calleridnum']=_0x43cd28[_0xc906('0x72')];}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')][_0xc906('0x73')])){this['channels'][_0x43cd28['uniqueid']][_0xc906('0x74')]=_0x43cd28['value'];}else if(this['isNotNull'](_0x43cd28[_0xc906('0x70')]['xmd-cdrtype'])){this[_0xc906('0x1b')][_0x43cd28[_0xc906('0x37')]][_0xc906('0x75')]=_0x43cd28[_0xc906('0x72')];}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')][_0xc906('0x76')])){this['channels'][_0x43cd28[_0xc906('0x37')]][_0xc906('0x56')]=_0x43cd28['value'][_0xc906('0x45')](',')[0x0];}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')][_0xc906('0x77')])){this[_0xc906('0x1b')][_0x43cd28[_0xc906('0x37')]][_0xc906('0x78')]=_0x43cd28[_0xc906('0x72')];}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')][_0xc906('0x79')])){this[_0xc906('0x1b')][_0x43cd28[_0xc906('0x37')]][_0xc906('0x7a')]=_0x43cd28[_0xc906('0x72')];}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')][_0xc906('0x7b')])){this['channels'][_0x43cd28[_0xc906('0x37')]][_0xc906('0x7c')]=_0x43cd28[_0xc906('0x72')];}else if(this['isNotNull'](_0x43cd28[_0xc906('0x70')][_0xc906('0x7d')])){this[_0xc906('0x1b')][_0x43cd28[_0xc906('0x37')]][_0xc906('0x56')]=_0x43cd28[_0xc906('0x72')];}else if(this[_0xc906('0x34')](_0x43cd28['variable'][_0xc906('0x7e')])){this['channels'][_0x43cd28[_0xc906('0x37')]][_0xc906('0x7f')]=_0x43cd28[_0xc906('0x72')];}}}else if(this[_0xc906('0x34')](_0x43cd28[_0xc906('0x70')]['mixmonitor_filename'])){if(_0x43cd28['value']){var _0x3a5911=path[_0xc906('0x80')](_0x43cd28['value'])['name'];this['syncMixMonitorFilename'](_0x3a5911,_0x43cd28[_0xc906('0x72')]);}}else if(this[_0xc906('0x1b')][_0x43cd28[_0xc906('0x38')]]){if(this[_0xc906('0x34')](_0x43cd28['variable'])){if(this['isNotNull'](_0x43cd28['variable'][_0xc906('0x7e')])){this[_0xc906('0x1b')][_0x43cd28[_0xc906('0x38')]]['sipcalllinkedid']=_0x43cd28[_0xc906('0x72')];}}}}}catch(_0x3906c1){logger['error'](_0xc906('0x81'),util[_0xc906('0x4a')](_0x3906c1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')][_0xc906('0x27')]=function(_0xff6af0){try{if(this[_0xc906('0x34')](_0xff6af0)){if(this['channels'][_0xff6af0[_0xc906('0x37')]]){var _0x49f0ae=moment();this[_0xc906('0x1b')][_0xff6af0[_0xc906('0x37')]][_0xc906('0x82')]=_0x49f0ae[_0xc906('0x40')](_0xc906('0x41'));this[_0xc906('0x1b')][_0xff6af0[_0xc906('0x37')]][_0xc906('0x50')]=_0x49f0ae[_0xc906('0x5a')](this[_0xc906('0x1b')][_0xff6af0[_0xc906('0x37')]][_0xc906('0x3f')],_0xc906('0x52'));if(this[_0xc906('0x1b')][_0xff6af0['uniqueid']][_0xc906('0x58')]){this[_0xc906('0x1b')][_0xff6af0[_0xc906('0x37')]][_0xc906('0x83')]=_0x49f0ae['diff'](this['channels'][_0xff6af0[_0xc906('0x37')]][_0xc906('0x59')],_0xc906('0x52'));this[_0xc906('0x1b')][_0xff6af0[_0xc906('0x37')]][_0xc906('0x84')]=this[_0xc906('0x1b')][_0xff6af0['uniqueid']]['duration']-this[_0xc906('0x1b')][_0xff6af0[_0xc906('0x37')]][_0xc906('0x83')];}if(_0xff6af0[_0xc906('0x43')]===_0xc906('0x44')){if(this[_0xc906('0x1c')][_0xff6af0['channel']['split']('-')[0x0]]){this[_0xc906('0x1c')][_0xff6af0[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]]=_[_0xc906('0x85')](this[_0xc906('0x1c')][_0xff6af0[_0xc906('0x3e')]['split']('-')[0x0]],['destconnectedlinenum']);this[_0xc906('0x36')](util[_0xc906('0x40')]('user:%s',this['agents'][_0xff6af0[_0xc906('0x3e')]['split']('-')[0x0]][_0xc906('0x64')]),'user:agentcomplete',{'destaccountcode':this[_0xc906('0x1c')][_0xff6af0[_0xc906('0x3e')][_0xc906('0x45')]('-')[0x0]][_0xc906('0x47')]});}}ami['emit']('custom:voiceCallReport',this[_0xc906('0x1b')][_0xff6af0['uniqueid']]);delete this[_0xc906('0x1b')][_0xff6af0['uniqueid']];}}}catch(_0x195612){logger[_0xc906('0x3c')](_0xc906('0x86'),util[_0xc906('0x4a')](_0x195612,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')][_0xc906('0x2a')]=function(_0x217c0b){try{if(this['isNotNull'](_0x217c0b)){if(this[_0xc906('0x1b')][_0x217c0b['transfereeuniqueid']]){this['channels'][_0x217c0b[_0xc906('0x87')]]['transfercalleridnum']=_0x217c0b['origtransferercalleridnum'];this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x87')]]['transferconnectedlinenum']=_0x217c0b['transfertargetcalleridnum'];if(this['channels'][_0x217c0b['secondtransfereruniqueid']]){var _0x389f41=this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x88')]];this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x88')]]=this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x87')]];this[_0xc906('0x1b')][_0x217c0b['transfereeuniqueid']]=_0x389f41;}}else if(this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x89')]]){this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x89')]][_0xc906('0x8a')]=_0x217c0b[_0xc906('0x8b')];this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x89')]]['transferconnectedlinenum']=_0x217c0b[_0xc906('0x8c')];if(this[_0xc906('0x1b')][_0x217c0b['origtransfereruniqueid']]){var _0x389f41=this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x8d')]];this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x8d')]]=this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x89')]];this[_0xc906('0x1b')][_0x217c0b[_0xc906('0x89')]]=_0x389f41;}}}}catch(_0xf8e2e1){logger[_0xc906('0x3c')]('[syncAttendedTransfer][VoiceCallReport]',util[_0xc906('0x4a')](_0xf8e2e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')][_0xc906('0x2c')]=function(_0x49077b){try{if(this['isNotNull'](_0x49077b)){if(this[_0xc906('0x1b')][_0x49077b[_0xc906('0x87')]]){this[_0xc906('0x1b')][_0x49077b[_0xc906('0x87')]][_0xc906('0x8a')]=_0x49077b['transfereecalleridnum'];this[_0xc906('0x1b')][_0x49077b[_0xc906('0x87')]][_0xc906('0x8e')]=_0x49077b[_0xc906('0x8f')];this[_0xc906('0x27')]({'event':_0xc906('0x90'),'uniqueid':_0x49077b[_0xc906('0x87')],'context':_0x49077b[_0xc906('0x43')],'channel':_0x49077b[_0xc906('0x91')]});}}}catch(_0x2183b0){logger['error'](_0xc906('0x92'),util[_0xc906('0x4a')](_0x2183b0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')]['syncMusicOnHoldStart']=function(_0x2ae2a3){try{if(this[_0xc906('0x34')](_0x2ae2a3)){if(this[_0xc906('0x1b')][_0x2ae2a3[_0xc906('0x37')]]){if(!_[_0xc906('0x6c')](this['channels'][_0x2ae2a3[_0xc906('0x37')]][_0xc906('0x59')])){this['channels'][_0x2ae2a3[_0xc906('0x37')]]['mohstarttime']=moment()[_0xc906('0x40')](_0xc906('0x41'));}}}}catch(_0x5dc6d8){logger[_0xc906('0x3c')](_0xc906('0x93'),util[_0xc906('0x4a')](_0x5dc6d8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc906('0x33')][_0xc906('0x94')]=function(_0xfd55b6){try{if(this[_0xc906('0x34')](_0xfd55b6)){if(this[_0xc906('0x1b')][_0xfd55b6[_0xc906('0x37')]]){if(!_[_0xc906('0x6c')](this[_0xc906('0x1b')][_0xfd55b6['uniqueid']]['mohstarttime'])){this[_0xc906('0x1b')][_0xfd55b6['uniqueid']][_0xc906('0x95')]+=moment()[_0xc906('0x96')](0x0)[_0xc906('0x5a')](this[_0xc906('0x1b')][_0xfd55b6[_0xc906('0x37')]]['mohstarttime'],_0xc906('0x52'));delete this[_0xc906('0x1b')][_0xfd55b6[_0xc906('0x37')]][_0xc906('0x97')];}}}}catch(_0x325194){logger[_0xc906('0x3c')](_0xc906('0x98'),util[_0xc906('0x4a')](_0x325194,{'showHidden':![],'depth':null}));}};module[_0xc906('0x99')]=VoiceCallReport; \ No newline at end of file +var _0x0c48=['emit','uniqueid','merge','pick','keys','error','inspect','linkedid','channel','OutgoingSpoolFailed','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','format','user:%s','name','user:agentconnect','[syncNewChannel][VoiceCallReport]','application','applicationdata','appdata','toLowerCase','duration','seconds','disposition','cdr(','match','[syncNewExten][VoiceCallReport]','answered','holdtime','diff','starttime','calleridnum','xcally-motion-preview','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','monitors','isNil','push','syncVarSet','variable','mixmonitor_filename','value','callerid','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcalluniqueid','parse','sipcalllinkedid','syncHangup','billableseconds','answertime','omit','user:agentcomplete','accountcode','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','BlindTransfer','[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','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','syncNewChannel','newstate','syncNewState','hangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','then','catch','log','prototype','isNotNull','isUndefined'];(function(_0x38f248,_0x17113e){var _0x5dd9b5=function(_0x48aad7){while(--_0x48aad7){_0x38f248['push'](_0x38f248['shift']());}};_0x5dd9b5(++_0x17113e);}(_0x0c48,0xed));var _0x80c4=function(_0x510f93,_0x5c1bbc){_0x510f93=_0x510f93-0x0;var _0x2536e4=_0x0c48[_0x510f93];return _0x2536e4;};'use strict';var BPromise=require(_0x80c4('0x0'));var _=require(_0x80c4('0x1'));var moment=require(_0x80c4('0x2'));var util=require(_0x80c4('0x3'));var path=require(_0x80c4('0x4'));var Redis=require(_0x80c4('0x5'));var config=require(_0x80c4('0x6'));var logger=require(_0x80c4('0x7'))(_0x80c4('0x8'));var ami=require(_0x80c4('0x9'));var Channel=require(_0x80c4('0xa'));var statusDesc=[_0x80c4('0xb'),_0x80c4('0xc'),_0x80c4('0xd'),_0x80c4('0xe'),_0x80c4('0xf'),'unavailable',_0x80c4('0x10'),_0x80c4('0x11'),_0x80c4('0x12')];var applications=[_0x80c4('0x13'),_0x80c4('0x14'),_0x80c4('0x15'),_0x80c4('0x16'),_0x80c4('0x17'),_0x80c4('0x18')];var dispositions=['NO\x20ANSWER','FAILED',_0x80c4('0x19'),'NO\x20ANSWER',_0x80c4('0x1a'),_0x80c4('0x1a'),_0x80c4('0x1b'),_0x80c4('0x1c'),_0x80c4('0x19'),'FAILED',_0x80c4('0x19')];var actions={};config[_0x80c4('0x1d')]=_[_0x80c4('0x1e')](config[_0x80c4('0x1d')],{'host':'localhost','port':0x18eb});var io=require(_0x80c4('0x1f'))(new Redis(config[_0x80c4('0x1d')]));function VoiceCallReport(_0x47f108){this[_0x80c4('0x20')]=_0x47f108[_0x80c4('0x20')];this['agents']=_0x47f108[_0x80c4('0x21')];ami['on'](_0x80c4('0x22'),this[_0x80c4('0x23')]['bind'](this));ami['on'](_0x80c4('0x24'),this[_0x80c4('0x23')][_0x80c4('0x25')](this));ami['on']('newchannel',this[_0x80c4('0x26')]['bind'](this));ami['on'](_0x80c4('0x27'),this[_0x80c4('0x28')][_0x80c4('0x25')](this));ami['on']('varset',this['syncVarSet'][_0x80c4('0x25')](this));ami['on'](_0x80c4('0x29'),this['syncHangup'][_0x80c4('0x25')](this));ami['on'](_0x80c4('0x2a'),this[_0x80c4('0x2b')][_0x80c4('0x25')](this));ami['on'](_0x80c4('0x2c'),this[_0x80c4('0x2d')][_0x80c4('0x25')](this));ami['on'](_0x80c4('0x2e'),this['syncBlindTransfer'][_0x80c4('0x25')](this));ami['on'](_0x80c4('0x2f'),this[_0x80c4('0x30')][_0x80c4('0x25')](this));ami['on'](_0x80c4('0x31'),this[_0x80c4('0x32')][_0x80c4('0x25')](this));return BPromise['resolve']()[_0x80c4('0x33')](ami['actionCoreShowChannels']())[_0x80c4('0x34')](function(_0x5b9bd){console[_0x80c4('0x35')](_0x5b9bd);});}VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x37')]=function(_0x132aee){return _0x132aee!==null&&!_[_0x80c4('0x38')](_0x132aee);};VoiceCallReport[_0x80c4('0x36')]['emit']=function(_0x76b610,_0x4bc391,_0x306aec){io['to'](_0x76b610)[_0x80c4('0x39')](_0x4bc391,_0x306aec);};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x2b')]=function(_0x3c084b){try{if(this[_0x80c4('0x37')](_0x3c084b)){if(_0x3c084b[_0x80c4('0x3a')]===_0x3c084b['linkedid']){if(!_['isUndefined'](this[_0x80c4('0x20')][_0x3c084b['uniqueid']])){_[_0x80c4('0x3b')](this[_0x80c4('0x20')][_0x3c084b[_0x80c4('0x3a')]],_[_0x80c4('0x3c')](_0x3c084b,_[_0x80c4('0x3d')](this[_0x80c4('0x20')][_0x3c084b['uniqueid']])));}}}}catch(_0x1aedfd){logger[_0x80c4('0x3e')]('[syncNewCallerId][VoiceCallReport]',util[_0x80c4('0x3f')](_0x1aedfd,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x26')]=function(_0x1a4cc){try{if(this[_0x80c4('0x37')](_0x1a4cc)){if(_0x1a4cc[_0x80c4('0x3a')]===_0x1a4cc[_0x80c4('0x40')]&&_0x1a4cc[_0x80c4('0x41')]!=_0x80c4('0x42')){if(_[_0x80c4('0x38')](this['channels'][_0x1a4cc[_0x80c4('0x3a')]])){this['channels'][_0x1a4cc[_0x80c4('0x3a')]]=new Channel();this[_0x80c4('0x20')][_0x1a4cc[_0x80c4('0x3a')]]['starttime']=moment()['format'](_0x80c4('0x43'));this['channels'][_0x1a4cc[_0x80c4('0x3a')]]['disposition']=dispositions[_[_0x80c4('0x44')](_0x1a4cc[_0x80c4('0x45')])];_[_0x80c4('0x3b')](this[_0x80c4('0x20')][_0x1a4cc[_0x80c4('0x3a')]],_[_0x80c4('0x3c')](_0x1a4cc,_[_0x80c4('0x3d')](this[_0x80c4('0x20')][_0x1a4cc['uniqueid']])));if(_0x1a4cc[_0x80c4('0x46')]===_0x80c4('0x47')){if(this[_0x80c4('0x21')][_0x1a4cc[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]]){this[_0x80c4('0x21')][_0x1a4cc[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]][_0x80c4('0x49')]=_0x1a4cc[_0x80c4('0x4a')];this[_0x80c4('0x39')](util[_0x80c4('0x4b')](_0x80c4('0x4c'),this['agents'][_0x1a4cc[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]][_0x80c4('0x4d')]),_0x80c4('0x4e'),{'destaccountcode':this[_0x80c4('0x21')][_0x1a4cc[_0x80c4('0x41')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1a4cc[_0x80c4('0x4a')]});}}}}}}catch(_0x570104){logger['error'](_0x80c4('0x4f'),util[_0x80c4('0x3f')](_0x570104,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x23')]=function(_0x35323f){try{if(this[_0x80c4('0x37')](_0x35323f)){if(_0x35323f[_0x80c4('0x3a')]===_0x35323f[_0x80c4('0x40')]&&_0x35323f[_0x80c4('0x4a')]!='h'&&_0x35323f[_0x80c4('0x41')]!=_0x80c4('0x42')){_0x35323f['application']=_0x35323f[_0x80c4('0x50')]['toLowerCase']();_0x35323f[_0x80c4('0x51')]=(_0x35323f[_0x80c4('0x52')]||_0x35323f[_0x80c4('0x51')])[_0x80c4('0x53')]();if(_[_0x80c4('0x38')](this[_0x80c4('0x20')][_0x35323f[_0x80c4('0x3a')]])){this[_0x80c4('0x20')][_0x35323f['uniqueid']]=new Channel();this[_0x80c4('0x20')][_0x35323f['uniqueid']]['starttime']=_0x35323f[_0x80c4('0x54')]?moment()['subtract'](moment['duration'](_0x35323f[_0x80c4('0x54')])[_0x80c4('0x55')](),'seconds')[_0x80c4('0x4b')](_0x80c4('0x43')):moment()[_0x80c4('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x80c4('0x20')][_0x35323f['uniqueid']][_0x80c4('0x56')]=_0x80c4('0x1a');}_['merge'](this['channels'][_0x35323f[_0x80c4('0x3a')]],_['pick'](_0x35323f,_[_0x80c4('0x3d')](this['channels'][_0x35323f['uniqueid']])));if(_['includes'](applications,_0x35323f['application'])){this[_0x80c4('0x20')][_0x35323f['uniqueid']]['lastapplication']=_0x35323f[_0x80c4('0x50')];this[_0x80c4('0x20')][_0x35323f['uniqueid']]['lastdata']=_0x35323f[_0x80c4('0x51')];if(_0x35323f[_0x80c4('0x50')]===_0x80c4('0x13')&&_['startsWith'](_0x35323f['applicationdata'],_0x80c4('0x57'))){var _0x12bb24=_0x35323f[_0x80c4('0x51')][_0x80c4('0x48')]('=');var _0x37bf30=_0x12bb24[0x0][_0x80c4('0x58')](/cdr\((.*)\)/);if(_0x37bf30){this[_0x80c4('0x20')][_0x35323f[_0x80c4('0x3a')]][_0x37bf30[0x1]]=_0x12bb24[0x1];}}else if(_0x35323f[_0x80c4('0x50')]===_0x80c4('0x14')){this[_0x80c4('0x20')][_0x35323f[_0x80c4('0x3a')]][_0x80c4('0x14')]=_0x35323f['applicationdata'][_0x80c4('0x48')](',')[0x0];}}}}}catch(_0x32af07){logger[_0x80c4('0x3e')](_0x80c4('0x59'),util[_0x80c4('0x3f')](_0x32af07,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x28')]=function(_0x2347cc){try{if(this[_0x80c4('0x37')](_0x2347cc)){if(_0x2347cc[_0x80c4('0x3a')]!==_0x2347cc[_0x80c4('0x40')]){if(this['channels'][_0x2347cc['linkedid']]){if(_0x2347cc[_0x80c4('0x45')]==='6'){if(!this[_0x80c4('0x20')][_0x2347cc['linkedid']]['answered']){var _0x1094d2=moment();this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]][_0x80c4('0x5a')]=!![];this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]]['answertime']=_0x1094d2[_0x80c4('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]]['starttime']){this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]][_0x80c4('0x5b')]=_0x1094d2[_0x80c4('0x5c')](this[_0x80c4('0x20')][_0x2347cc['linkedid']][_0x80c4('0x5d')],_0x80c4('0x55'));}}this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]][_0x80c4('0x40')]=_0x2347cc[_0x80c4('0x3a')];if(_0x2347cc[_0x80c4('0x5e')]!==_0x80c4('0x5f')){this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]]['connectedlinenum']=_0x2347cc['calleridnum'];}this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]]['connectedlinename']=_0x2347cc['calleridname'];this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]][_0x80c4('0x60')]=_0x2347cc[_0x80c4('0x41')];this[_0x80c4('0x20')][_0x2347cc[_0x80c4('0x40')]]['disposition']=dispositions[_['toNumber'](_0x2347cc['channelstate'])];if(this[_0x80c4('0x21')][_0x2347cc[_0x80c4('0x41')]['split']('-')[0x0]]){this['channels'][_0x2347cc[_0x80c4('0x40')]][_0x80c4('0x61')]=this[_0x80c4('0x21')][_0x2347cc['channel'][_0x80c4('0x48')]('-')[0x0]]['id'];this['channels'][_0x2347cc['linkedid']]['membername']=this[_0x80c4('0x21')][_0x2347cc[_0x80c4('0x41')]['split']('-')[0x0]][_0x80c4('0x4d')];}}}}else{if(this['channels'][_0x2347cc['uniqueid']]){if(_0x2347cc[_0x80c4('0x45')]==='6'){if(this[_0x80c4('0x21')][_0x2347cc['channel'][_0x80c4('0x48')]('-')[0x0]]){this['channels'][_0x2347cc[_0x80c4('0x3a')]][_0x80c4('0x61')]=this[_0x80c4('0x21')][_0x2347cc[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]]['id'];this['channels'][_0x2347cc[_0x80c4('0x3a')]][_0x80c4('0x62')]=this[_0x80c4('0x21')][_0x2347cc['channel'][_0x80c4('0x48')]('-')[0x0]][_0x80c4('0x4d')];}}}}}}catch(_0xba662f){logger[_0x80c4('0x3e')](_0x80c4('0x63'),util[_0x80c4('0x3f')](_0xba662f,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x80c4('0x64')]=function(_0x53e9e4,_0x2465c0){if(this['channels'][_0x53e9e4]){this['channels'][_0x53e9e4][_0x80c4('0x65')]=!![];if(_['endsWith'](_0x2465c0,'.wav49')){_0x2465c0=_0x2465c0[_0x80c4('0x66')]('.wav49','.WAV');}this[_0x80c4('0x20')][_0x53e9e4]['monitorFilename']=_0x2465c0;var _0x8a84d3=_['find'](this[_0x80c4('0x20')][_0x53e9e4][_0x80c4('0x67')],{'filename':_0x2465c0});if(_[_0x80c4('0x68')](_0x8a84d3)){this[_0x80c4('0x20')][_0x53e9e4][_0x80c4('0x67')][_0x80c4('0x69')]({'filename':_0x2465c0,'createdAt':moment()[_0x80c4('0x4b')](_0x80c4('0x43')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x6a')]=function(_0xc63293){try{if(this[_0x80c4('0x37')](_0xc63293)){if(this[_0x80c4('0x20')][_0xc63293['uniqueid']]&&_0xc63293[_0x80c4('0x41')]!=_0x80c4('0x42')){if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')])){if(this[_0x80c4('0x37')](_0xc63293['variable'][_0x80c4('0x6c')])){this[_0x80c4('0x64')](_0xc63293['uniqueid'],_0xc63293[_0x80c4('0x6d')]);}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')]['xmd-phone'])){this['channels'][_0xc63293[_0x80c4('0x3a')]][_0x80c4('0x5e')]=_0xc63293['value'];}else if(this['isNotNull'](_0xc63293[_0x80c4('0x6b')]['xmd-callerid'])){this['channels'][_0xc63293[_0x80c4('0x3a')]][_0x80c4('0x6e')]=_0xc63293[_0x80c4('0x6d')];}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')]['xmd-cdrtype'])){this[_0x80c4('0x20')][_0xc63293[_0x80c4('0x3a')]][_0x80c4('0x6f')]=_0xc63293[_0x80c4('0x6d')];}else if(this[_0x80c4('0x37')](_0xc63293['variable'][_0x80c4('0x70')])){this[_0x80c4('0x20')][_0xc63293['uniqueid']][_0x80c4('0x14')]=_0xc63293[_0x80c4('0x6d')][_0x80c4('0x48')](',')[0x0];}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')][_0x80c4('0x71')])){this[_0x80c4('0x20')][_0xc63293[_0x80c4('0x3a')]][_0x80c4('0x72')]=_0xc63293['value'];}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')]['xmd-destination'])){this['channels'][_0xc63293['uniqueid']][_0x80c4('0x73')]=_0xc63293[_0x80c4('0x6d')];}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')][_0x80c4('0x74')])){this['channels'][_0xc63293['uniqueid']][_0x80c4('0x75')]=_0xc63293[_0x80c4('0x6d')];}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')][_0x80c4('0x76')])){this[_0x80c4('0x20')][_0xc63293[_0x80c4('0x3a')]][_0x80c4('0x14')]=_0xc63293[_0x80c4('0x6d')];}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')]['sipcallid'])){this[_0x80c4('0x20')][_0xc63293[_0x80c4('0x3a')]][_0x80c4('0x77')]=_0xc63293['value'];}}}else if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')][_0x80c4('0x6c')])){if(_0xc63293[_0x80c4('0x6d')]){var _0x151622=path[_0x80c4('0x78')](_0xc63293[_0x80c4('0x6d')])[_0x80c4('0x4d')];this[_0x80c4('0x64')](_0x151622,_0xc63293[_0x80c4('0x6d')]);}}else if(this[_0x80c4('0x20')][_0xc63293[_0x80c4('0x40')]]){if(this['isNotNull'](_0xc63293[_0x80c4('0x6b')])){if(this[_0x80c4('0x37')](_0xc63293[_0x80c4('0x6b')]['sipcallid'])){this[_0x80c4('0x20')][_0xc63293['linkedid']][_0x80c4('0x79')]=_0xc63293[_0x80c4('0x6d')];}}}}}catch(_0x5567d2){logger['error']('[syncVarSet][VoiceCallReport]',util[_0x80c4('0x3f')](_0x5567d2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x80c4('0x7a')]=function(_0x9ac6ba){try{if(this['isNotNull'](_0x9ac6ba)){if(this[_0x80c4('0x20')][_0x9ac6ba['uniqueid']]){var _0x572325=moment();this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]]['endtime']=_0x572325[_0x80c4('0x4b')](_0x80c4('0x43'));this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x54')]=_0x572325[_0x80c4('0x5c')](this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x5d')],_0x80c4('0x55'));if(this['channels'][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x5a')]){this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x7b')]=_0x572325[_0x80c4('0x5c')](this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x7c')],_0x80c4('0x55'));this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x5b')]=this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x54')]-this['channels'][_0x9ac6ba[_0x80c4('0x3a')]][_0x80c4('0x7b')];}if(_0x9ac6ba[_0x80c4('0x46')]===_0x80c4('0x47')){if(this[_0x80c4('0x21')][_0x9ac6ba['channel'][_0x80c4('0x48')]('-')[0x0]]){this[_0x80c4('0x21')][_0x9ac6ba[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]]=_[_0x80c4('0x7d')](this[_0x80c4('0x21')][_0x9ac6ba[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]],[_0x80c4('0x49')]);this[_0x80c4('0x39')](util[_0x80c4('0x4b')](_0x80c4('0x4c'),this[_0x80c4('0x21')][_0x9ac6ba[_0x80c4('0x41')][_0x80c4('0x48')]('-')[0x0]][_0x80c4('0x4d')]),_0x80c4('0x7e'),{'destaccountcode':this[_0x80c4('0x21')][_0x9ac6ba[_0x80c4('0x41')]['split']('-')[0x0]][_0x80c4('0x7f')]});}}ami[_0x80c4('0x39')](_0x80c4('0x80'),this['channels'][_0x9ac6ba[_0x80c4('0x3a')]]);delete this[_0x80c4('0x20')][_0x9ac6ba[_0x80c4('0x3a')]];}}}catch(_0x5e5a5e){logger[_0x80c4('0x3e')](_0x80c4('0x81'),util[_0x80c4('0x3f')](_0x5e5a5e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x2d')]=function(_0x157b98){try{if(this[_0x80c4('0x37')](_0x157b98)){if(this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x82')]]){this[_0x80c4('0x20')][_0x157b98['transfereeuniqueid']][_0x80c4('0x83')]=_0x157b98[_0x80c4('0x84')];this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x82')]][_0x80c4('0x85')]=_0x157b98[_0x80c4('0x86')];if(this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x87')]]){var _0x28a074=this[_0x80c4('0x20')][_0x157b98['secondtransfereruniqueid']];this[_0x80c4('0x20')][_0x157b98['secondtransfereruniqueid']]=this[_0x80c4('0x20')][_0x157b98['transfereeuniqueid']];this['channels'][_0x157b98[_0x80c4('0x82')]]=_0x28a074;}}else if(this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x88')]]){this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x88')]][_0x80c4('0x83')]=_0x157b98[_0x80c4('0x84')];this[_0x80c4('0x20')][_0x157b98['transfertargetuniqueid']][_0x80c4('0x85')]=_0x157b98[_0x80c4('0x86')];if(this[_0x80c4('0x20')][_0x157b98['origtransfereruniqueid']]){var _0x28a074=this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x89')]];this[_0x80c4('0x20')][_0x157b98['origtransfereruniqueid']]=this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x88')]];this[_0x80c4('0x20')][_0x157b98[_0x80c4('0x88')]]=_0x28a074;}}}}catch(_0x2c5aa9){logger['error'](_0x80c4('0x8a'),util[_0x80c4('0x3f')](_0x2c5aa9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x8b')]=function(_0x2839d4){try{if(this[_0x80c4('0x37')](_0x2839d4)){if(this[_0x80c4('0x20')][_0x2839d4[_0x80c4('0x82')]]){this[_0x80c4('0x20')][_0x2839d4['transfereeuniqueid']][_0x80c4('0x83')]=_0x2839d4[_0x80c4('0x8c')];this[_0x80c4('0x20')][_0x2839d4[_0x80c4('0x82')]]['transferconnectedlinenum']=_0x2839d4['extension'];this[_0x80c4('0x7a')]({'event':_0x80c4('0x8d'),'uniqueid':_0x2839d4[_0x80c4('0x82')],'context':_0x2839d4[_0x80c4('0x46')],'channel':_0x2839d4['transfererchannel']});}}}catch(_0x3bbfb9){logger[_0x80c4('0x3e')]('[syncBlindTransfer][VoiceCallReport]',util[_0x80c4('0x3f')](_0x3bbfb9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x30')]=function(_0x142b6d){try{if(this['isNotNull'](_0x142b6d)){if(this[_0x80c4('0x20')][_0x142b6d[_0x80c4('0x3a')]]){if(!_[_0x80c4('0x68')](this['channels'][_0x142b6d[_0x80c4('0x3a')]]['answertime'])){this[_0x80c4('0x20')][_0x142b6d[_0x80c4('0x3a')]]['mohstarttime']=moment()[_0x80c4('0x4b')](_0x80c4('0x43'));}}}}catch(_0x1fe627){logger['error'](_0x80c4('0x8e'),util[_0x80c4('0x3f')](_0x1fe627,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x80c4('0x36')][_0x80c4('0x32')]=function(_0xc0a432){try{if(this[_0x80c4('0x37')](_0xc0a432)){if(this['channels'][_0xc0a432[_0x80c4('0x3a')]]){if(!_['isNil'](this[_0x80c4('0x20')][_0xc0a432[_0x80c4('0x3a')]][_0x80c4('0x8f')])){this[_0x80c4('0x20')][_0xc0a432['uniqueid']][_0x80c4('0x90')]+=moment()[_0x80c4('0x91')](0x0)[_0x80c4('0x5c')](this['channels'][_0xc0a432[_0x80c4('0x3a')]]['mohstarttime'],_0x80c4('0x55'));delete this[_0x80c4('0x20')][_0xc0a432[_0x80c4('0x3a')]][_0x80c4('0x8f')];}}}}catch(_0x811a3a){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util['inspect'](_0x811a3a,{'showHidden':![],'depth':null}));}};module[_0x80c4('0x92')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 13a47be..25748ee 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 _0x535f=['util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','hangup','syncHangup','isUndefined','prototype','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','isNotNull','dialstatus','ANSWER','connectedlinenum','answertime','connect','custom:dialconnect','syncVarSet','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','endtime','duration','starttime','lastevent','complete','total','answered','holdtime','diff','seconds','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports'];(function(_0x5c2c72,_0x22cf09){var _0x11c44c=function(_0x37bcca){while(--_0x37bcca){_0x5c2c72['push'](_0x5c2c72['shift']());}};_0x11c44c(++_0x22cf09);}(_0x535f,0x160));var _0xf535=function(_0x5cad29,_0x412fb6){_0x5cad29=_0x5cad29-0x0;var _0x45b1c1=_0x535f[_0x5cad29];return _0x45b1c1;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xf535('0x0'));var Redis=require(_0xf535('0x1'));var config=require(_0xf535('0x2'));var logger=require(_0xf535('0x3'))(_0xf535('0x4'));var ami=require(_0xf535('0x5'));config[_0xf535('0x6')]=_[_0xf535('0x7')](config[_0xf535('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xf535('0x8'))(new Redis(config[_0xf535('0x6')]));function VoiceDialReport(_0x4fe14d){this[_0xf535('0x9')]=_0x4fe14d[_0xf535('0xa')];this[_0xf535('0xb')]=_0x4fe14d[_0xf535('0xb')];this[_0xf535('0xc')]={};ami['on'](_0xf535('0xd'),this[_0xf535('0xe')][_0xf535('0xf')](this));ami['on'](_0xf535('0x10'),this[_0xf535('0x11')][_0xf535('0xf')](this));ami['on'](_0xf535('0x12'),this['syncVarSet'][_0xf535('0xf')](this));ami['on'](_0xf535('0x13'),this[_0xf535('0x14')]['bind'](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x5f1969){return _0x5f1969!==null&&!_[_0xf535('0x15')](_0x5f1969);};VoiceDialReport[_0xf535('0x16')]['emit']=function(_0x11b39f,_0x142bda,_0x3d59aa){io['to'](_0x11b39f)[_0xf535('0x17')](_0x142bda,_0x3d59aa);};VoiceDialReport[_0xf535('0x16')][_0xf535('0xe')]=function(_0x497fb4){try{if(this['isNotNull'](_0x497fb4)){if(this[_0xf535('0x9')][_0x497fb4[_0xf535('0x18')]]){_[_0xf535('0x19')](this[_0xf535('0x9')][_0x497fb4['uniqueid']],{'starttime':moment()[_0xf535('0x1a')](_0xf535('0x1b')),'lastevent':'called','interface':_0x497fb4[_0xf535('0x1c')][_0xf535('0x1d')](0x0,_0x497fb4[_0xf535('0x1c')][_0xf535('0x1e')]('-')),'membername':_0x497fb4[_0xf535('0x1c')][_0xf535('0x1d')](_0x497fb4[_0xf535('0x1c')][_0xf535('0x1e')]('/')+0x1,_0x497fb4[_0xf535('0x1c')]['lastIndexOf']('-'))},_[_0xf535('0x1f')](_0x497fb4,['event',_0xf535('0x20')]));this[_0xf535('0x17')](_0xf535('0x21'),_0xf535('0x22'),this['channels'][_0x497fb4['uniqueid']]);ami['emit'](_0xf535('0x23'),this[_0xf535('0x9')][_0x497fb4[_0xf535('0x18')]]);}}}catch(_0x159a35){logger[_0xf535('0x24')](_0xf535('0x25'),util[_0xf535('0x26')](_0x159a35,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf535('0x16')]['syncDialEnd']=function(_0x126704){try{if(this[_0xf535('0x27')](_0x126704)){if(this[_0xf535('0x9')][_0x126704[_0xf535('0x18')]]){this['channels'][_0x126704[_0xf535('0x18')]][_0xf535('0x28')]=_0x126704['dialstatus'];if(_0x126704[_0xf535('0x28')]===_0xf535('0x29')){this[_0xf535('0x9')][_0x126704[_0xf535('0x18')]][_0xf535('0x2a')]=_0x126704[_0xf535('0x2a')];this[_0xf535('0x9')][_0x126704['uniqueid']]['connectedlinename']=_0x126704['connectedlinename'];this[_0xf535('0x9')][_0x126704['uniqueid']][_0xf535('0x2b')]=moment()[_0xf535('0x1a')](_0xf535('0x1b'));this[_0xf535('0x9')][_0x126704[_0xf535('0x18')]]['lastevent']=_0xf535('0x2c');ami[_0xf535('0x17')](_0xf535('0x2d'),this['channels'][_0x126704[_0xf535('0x18')]]);}this[_0xf535('0x17')](_0xf535('0x21'),'voice_outbound_channel:save',this[_0xf535('0x9')][_0x126704[_0xf535('0x18')]]);}}}catch(_0x165f2e){logger[_0xf535('0x24')]('[syncDialEnd][VoiceDialReport]',util[_0xf535('0x26')](_0x165f2e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf535('0x16')][_0xf535('0x2e')]=function(_0x4973e8){try{if(this[_0xf535('0x27')](_0x4973e8)){this[_0xf535('0x2f')](_0x4973e8[_0xf535('0x18')],_[_0xf535('0x30')](_0x4973e8[_0xf535('0x31')])[0x0],_0x4973e8[_0xf535('0x32')]);if(this[_0xf535('0x27')](_0x4973e8[_0xf535('0x31')])&&this[_0xf535('0x27')](_0x4973e8[_0xf535('0x31')][_0xf535('0x33')])){if(_[_0xf535('0x15')](this[_0xf535('0x9')][_0x4973e8[_0xf535('0x18')]])){this[_0xf535('0x9')][_0x4973e8['uniqueid']]={'routeId':_0x4973e8[_0xf535('0x32')],'variables':this[_0xf535('0xc')][_0x4973e8[_0xf535('0x18')]]};this[_0xf535('0x17')]('voice:outbound',_0xf535('0x22'),this[_0xf535('0x9')][_0x4973e8['uniqueid']]);}}}}catch(_0x16a1fd){logger[_0xf535('0x24')](_0xf535('0x34'),util['inspect'](_0x16a1fd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf535('0x16')]['addVariable']=function(_0x12082f,_0x39c597,_0xd596c3){var _0x2770a3=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xf535('0x35'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xf535('0x36'),_0xf535('0x37'),_0xf535('0x38'),_0xf535('0x39'),'bridgepvtcallid',_0xf535('0x3a'),'memberdynamic',_0xf535('0x3b'),_0xf535('0x3c'),_0xf535('0x3d'),_0xf535('0x3e'),_0xf535('0x3f')];if(!_['isNil'](_0x39c597)&&!_[_0xf535('0x40')](_0x2770a3,_0x39c597)){if(_['isUndefined'](this[_0xf535('0xc')][_0x12082f])){this[_0xf535('0xc')][_0x12082f]={};}this[_0xf535('0xc')][_0x12082f][_0x39c597]=_0xd596c3;}};VoiceDialReport[_0xf535('0x16')]['syncHangup']=function(_0x227eb0){try{if(this[_0xf535('0x27')](_0x227eb0)){if(this[_0xf535('0x9')][_0x227eb0['uniqueid']]){this['channels'][_0x227eb0[_0xf535('0x18')]][_0xf535('0x41')]=moment()['format'](_0xf535('0x1b'));this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]][_0xf535('0x42')]=moment(this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]]['endtime'])['diff'](this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]][_0xf535('0x43')],'seconds');this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]][_0xf535('0x44')]=_0xf535('0x45');this[_0xf535('0xb')][_0xf535('0x46')]+=0x1;if(this[_0xf535('0x9')][_0x227eb0['uniqueid']]['answertime']){this['outbound'][_0xf535('0x47')]+=0x1;this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]][_0xf535('0x48')]=moment(this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]]['answertime'])[_0xf535('0x49')](this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]][_0xf535('0x43')],_0xf535('0x4a'));this[_0xf535('0x9')][_0x227eb0['uniqueid']][_0xf535('0x4b')]=moment(this['channels'][_0x227eb0[_0xf535('0x18')]]['endtime'])[_0xf535('0x49')](this['channels'][_0x227eb0[_0xf535('0x18')]]['answertime'],_0xf535('0x4a'));this[_0xf535('0xb')][_0xf535('0x4c')]+=this[_0xf535('0x9')][_0x227eb0['uniqueid']][_0xf535('0x48')]||0x0;this[_0xf535('0xb')][_0xf535('0x4d')]+=this[_0xf535('0x9')][_0x227eb0['uniqueid']][_0xf535('0x4b')];}this['outbound'][_0xf535('0x4e')]+=this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]][_0xf535('0x42')];ami['emit'](_0xf535('0x4f'),this[_0xf535('0x9')][_0x227eb0['uniqueid']]);ami[_0xf535('0x17')](_0xf535('0x50'),this[_0xf535('0x9')][_0x227eb0['uniqueid']]);this['emit'](_0xf535('0x21'),_0xf535('0x51'),this[_0xf535('0xb')]);logger[_0xf535('0x52')](_0xf535('0x53'),JSON[_0xf535('0x54')](this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]]));this['emit'](_0xf535('0x21'),_0xf535('0x55'),this['channels'][_0x227eb0[_0xf535('0x18')]]);delete this[_0xf535('0x9')][_0x227eb0[_0xf535('0x18')]];}if(this[_0xf535('0xc')][_0x227eb0[_0xf535('0x18')]]){delete this[_0xf535('0xc')][_0x227eb0[_0xf535('0x18')]];}}}catch(_0x236797){logger[_0xf535('0x24')](_0xf535('0x56'),util[_0xf535('0x26')](_0x236797,{'showHidden':![],'depth':null}));}};module[_0xf535('0x57')]=VoiceDialReport; \ No newline at end of file +var _0xc92f=['privilege','voice:outbound','voice_outbound_channel:save','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','connect','custom:dialconnect','error','[syncDialEnd][VoiceDialReport]','inspect','addVariable','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','seconds','complete','total','answertime','holdtime','diff','starttime','billableseconds','sumHoldTime','sumBillable','sumDuration','duration','custom:voiceDialReport','custom:dialend','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','outboundChannels','outbound','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','channels','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','event'];(function(_0x5309f0,_0x381caf){var _0x3c5ff0=function(_0x119250){while(--_0x119250){_0x5309f0['push'](_0x5309f0['shift']());}};_0x3c5ff0(++_0x381caf);}(_0xc92f,0xf3));var _0xfc92=function(_0x3b4b1f,_0x298528){_0x3b4b1f=_0x3b4b1f-0x0;var _0x4c8667=_0xc92f[_0x3b4b1f];return _0x4c8667;};'use strict';var _=require(_0xfc92('0x0'));var moment=require(_0xfc92('0x1'));var util=require('util');var Redis=require(_0xfc92('0x2'));var config=require(_0xfc92('0x3'));var logger=require(_0xfc92('0x4'))('ami');var ami=require(_0xfc92('0x5'));config[_0xfc92('0x6')]=_[_0xfc92('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xfc92('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x394026){this['channels']=_0x394026[_0xfc92('0x9')];this['outbound']=_0x394026[_0xfc92('0xa')];this[_0xfc92('0xb')]={};ami['on'](_0xfc92('0xc'),this['syncDialBegin'][_0xfc92('0xd')](this));ami['on'](_0xfc92('0xe'),this[_0xfc92('0xf')]['bind'](this));ami['on'](_0xfc92('0x10'),this[_0xfc92('0x11')][_0xfc92('0xd')](this));ami['on'](_0xfc92('0x12'),this[_0xfc92('0x13')][_0xfc92('0xd')](this));}VoiceDialReport[_0xfc92('0x14')][_0xfc92('0x15')]=function(_0x115a0f){return _0x115a0f!==null&&!_[_0xfc92('0x16')](_0x115a0f);};VoiceDialReport[_0xfc92('0x14')][_0xfc92('0x17')]=function(_0x53d174,_0x55d532,_0x4bb1ca){io['to'](_0x53d174)[_0xfc92('0x17')](_0x55d532,_0x4bb1ca);};VoiceDialReport[_0xfc92('0x14')]['syncDialBegin']=function(_0x213025){try{if(this[_0xfc92('0x15')](_0x213025)){if(this[_0xfc92('0x18')][_0x213025[_0xfc92('0x19')]]){_[_0xfc92('0x1a')](this[_0xfc92('0x18')][_0x213025['uniqueid']],{'starttime':moment()[_0xfc92('0x1b')](_0xfc92('0x1c')),'lastevent':_0xfc92('0x1d'),'interface':_0x213025[_0xfc92('0x1e')]['substring'](0x0,_0x213025['channel'][_0xfc92('0x1f')]('-')),'membername':_0x213025[_0xfc92('0x1e')]['substring'](_0x213025[_0xfc92('0x1e')][_0xfc92('0x1f')]('/')+0x1,_0x213025['channel'][_0xfc92('0x1f')]('-'))},_['omit'](_0x213025,[_0xfc92('0x20'),_0xfc92('0x21')]));this[_0xfc92('0x17')](_0xfc92('0x22'),_0xfc92('0x23'),this[_0xfc92('0x18')][_0x213025['uniqueid']]);ami[_0xfc92('0x17')]('custom:dialbegin',this[_0xfc92('0x18')][_0x213025[_0xfc92('0x19')]]);}}}catch(_0x3aa7f6){logger['error']('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x3aa7f6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xfc92('0xf')]=function(_0xbc3d98){try{if(this[_0xfc92('0x15')](_0xbc3d98)){if(this[_0xfc92('0x18')][_0xbc3d98[_0xfc92('0x19')]]){this[_0xfc92('0x18')][_0xbc3d98[_0xfc92('0x19')]][_0xfc92('0x24')]=_0xbc3d98['dialstatus'];if(_0xbc3d98[_0xfc92('0x24')]===_0xfc92('0x25')){this[_0xfc92('0x18')][_0xbc3d98['uniqueid']][_0xfc92('0x26')]=_0xbc3d98[_0xfc92('0x26')];this['channels'][_0xbc3d98['uniqueid']][_0xfc92('0x27')]=_0xbc3d98[_0xfc92('0x27')];this['channels'][_0xbc3d98[_0xfc92('0x19')]]['answertime']=moment()[_0xfc92('0x1b')](_0xfc92('0x1c'));this['channels'][_0xbc3d98[_0xfc92('0x19')]][_0xfc92('0x28')]=_0xfc92('0x29');ami[_0xfc92('0x17')](_0xfc92('0x2a'),this[_0xfc92('0x18')][_0xbc3d98[_0xfc92('0x19')]]);}this[_0xfc92('0x17')](_0xfc92('0x22'),'voice_outbound_channel:save',this['channels'][_0xbc3d98[_0xfc92('0x19')]]);}}}catch(_0x4ee477){logger[_0xfc92('0x2b')](_0xfc92('0x2c'),util[_0xfc92('0x2d')](_0x4ee477,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfc92('0x14')]['syncVarSet']=function(_0x47facc){try{if(this[_0xfc92('0x15')](_0x47facc)){this[_0xfc92('0x2e')](_0x47facc[_0xfc92('0x19')],_[_0xfc92('0x2f')](_0x47facc[_0xfc92('0x30')])[0x0],_0x47facc[_0xfc92('0x31')]);if(this[_0xfc92('0x15')](_0x47facc['variable'])&&this[_0xfc92('0x15')](_0x47facc[_0xfc92('0x30')][_0xfc92('0x32')])){if(_[_0xfc92('0x16')](this['channels'][_0x47facc[_0xfc92('0x19')]])){this['channels'][_0x47facc['uniqueid']]={'routeId':_0x47facc[_0xfc92('0x31')],'variables':this[_0xfc92('0xb')][_0x47facc[_0xfc92('0x19')]]};this['emit'](_0xfc92('0x22'),'voice_outbound_channel:save',this[_0xfc92('0x18')][_0x47facc[_0xfc92('0x19')]]);}}}}catch(_0x587124){logger[_0xfc92('0x2b')](_0xfc92('0x33'),util['inspect'](_0x587124,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xfc92('0x14')][_0xfc92('0x2e')]=function(_0x24a3a7,_0xd0493c,_0x5d3a14){var _0x57dfe2=[_0xfc92('0x34'),_0xfc92('0x35'),_0xfc92('0x36'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xfc92('0x37'),_0xfc92('0x38'),_0xfc92('0x39'),_0xfc92('0x3a'),_0xfc92('0x3b'),_0xfc92('0x3c'),_0xfc92('0x3d'),_0xfc92('0x3e'),_0xfc92('0x3f'),'memberinterface',_0xfc92('0x40'),_0xfc92('0x41'),_0xfc92('0x42'),_0xfc92('0x43')];if(!_[_0xfc92('0x44')](_0xd0493c)&&!_[_0xfc92('0x45')](_0x57dfe2,_0xd0493c)){if(_[_0xfc92('0x16')](this[_0xfc92('0xb')][_0x24a3a7])){this[_0xfc92('0xb')][_0x24a3a7]={};}this['variables'][_0x24a3a7][_0xd0493c]=_0x5d3a14;}};VoiceDialReport[_0xfc92('0x14')]['syncHangup']=function(_0x2fbb3c){try{if(this[_0xfc92('0x15')](_0x2fbb3c)){if(this['channels'][_0x2fbb3c['uniqueid']]){this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x46')]=moment()[_0xfc92('0x1b')](_0xfc92('0x1c'));this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]]['duration']=moment(this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x46')])['diff'](this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]]['starttime'],_0xfc92('0x47'));this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]]['lastevent']=_0xfc92('0x48');this[_0xfc92('0xa')][_0xfc92('0x49')]+=0x1;if(this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x4a')]){this['outbound']['answered']+=0x1;this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x4b')]=moment(this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x4a')])[_0xfc92('0x4c')](this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x4d')],_0xfc92('0x47'));this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x4e')]=moment(this[_0xfc92('0x18')][_0x2fbb3c['uniqueid']]['endtime'])['diff'](this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]]['answertime'],_0xfc92('0x47'));this[_0xfc92('0xa')][_0xfc92('0x4f')]+=this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]]['holdtime']||0x0;this['outbound'][_0xfc92('0x50')]+=this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x4e')];}this['outbound'][_0xfc92('0x51')]+=this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]][_0xfc92('0x52')];ami[_0xfc92('0x17')](_0xfc92('0x53'),this[_0xfc92('0x18')][_0x2fbb3c[_0xfc92('0x19')]]);ami[_0xfc92('0x17')](_0xfc92('0x54'),this['channels'][_0x2fbb3c['uniqueid']]);this[_0xfc92('0x17')](_0xfc92('0x22'),_0xfc92('0x55'),this['outbound']);logger[_0xfc92('0x56')](_0xfc92('0x57'),JSON[_0xfc92('0x58')](this['channels'][_0x2fbb3c['uniqueid']]));this[_0xfc92('0x17')](_0xfc92('0x22'),_0xfc92('0x59'),this[_0xfc92('0x18')][_0x2fbb3c['uniqueid']]);delete this['channels'][_0x2fbb3c[_0xfc92('0x19')]];}if(this[_0xfc92('0xb')][_0x2fbb3c['uniqueid']]){delete this[_0xfc92('0xb')][_0x2fbb3c[_0xfc92('0x19')]];}}}catch(_0x47525a){logger[_0xfc92('0x2b')](_0xfc92('0x5a'),util[_0xfc92('0x2d')](_0x47525a,{'showHidden':![],'depth':null}));}};module[_0xfc92('0x5b')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 94e8cab..32d240b 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 _0x1890=['voice_queue_channel:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','type','inbound','available','loggedIn','pTalking','sumDuration','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','md5','voice_queue:save','isNotNull','catch','flagQueueSummary','queuesummary','then','[queuesummary]','syncQueueSummary','queue','countBy','callers','loggedin','toNumber','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','emitVoiceQueueChannelSave','queuecallercomplete','COMPLETEDBYAGENT','[syncAgentConnect][VoiceQueueReport]','queuecallerabandonAt','assigned','membername','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','toUpperCase','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','custom:timeout','queuecallerexit','EXITWITHKEY','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','syncHangup','length','sumHoldTime','diff','milliseconds','total','answered','sumBillable','custom:queuecallerunmanaged','emitVoiceQueueSummary','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','Action','status','channel','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','variables','[voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','voice:queue:%s','name'];(function(_0x40128a,_0x4777e8){var _0x30e13f=function(_0x3b07aa){while(--_0x3b07aa){_0x40128a['push'](_0x40128a['shift']());}};_0x30e13f(++_0x4777e8);}(_0x1890,0x153));var _0x0189=function(_0x583b92,_0x184dc8){_0x583b92=_0x583b92-0x0;var _0x46fbcf=_0x1890[_0x583b92];return _0x46fbcf;};'use strict';var _=require(_0x0189('0x0'));var moment=require(_0x0189('0x1'));var BPromise=require(_0x0189('0x2'));var util=require(_0x0189('0x3'));var md5=require('md5');var Redis=require(_0x0189('0x4'));var config=require(_0x0189('0x5'));var logger=require(_0x0189('0x6'))(_0x0189('0x7'));var ami=require('../ami');var QueueReport=require(_0x0189('0x8'));config[_0x0189('0x9')]=_['defaults'](config[_0x0189('0x9')],{'host':_0x0189('0xa'),'port':0x18eb});var io=require(_0x0189('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x0189('0xc')][_0x0189('0xd')]=function(_0x2fe13e){this['tail']=this[_0x0189('0xe')]?this[_0x0189('0xe')][_0x0189('0xf')](_0x2fe13e):_0x2fe13e();};function VoiceQueueReport(_0x22146f){this[_0x0189('0x10')]=new Sequence();this[_0x0189('0x11')]={};this[_0x0189('0x12')]=_0x22146f[_0x0189('0x12')];this[_0x0189('0x13')]=_0x22146f[_0x0189('0x14')];this[_0x0189('0x15')]=_0x22146f[_0x0189('0x15')];this['flagQueueSummary']=!![];this[_0x0189('0x16')]=_0x22146f[_0x0189('0x16')];this['variables']={};ami['on']('queuesummary',this['syncQueueSummary']['bind'](this));ami['on'](_0x0189('0x17'),this[_0x0189('0x18')][_0x0189('0x19')](this));ami['on'](_0x0189('0x1a'),this[_0x0189('0x1b')][_0x0189('0x19')](this));ami['on'](_0x0189('0x1c'),this[_0x0189('0x1d')][_0x0189('0x19')](this));ami['on'](_0x0189('0x1e'),this[_0x0189('0x1f')][_0x0189('0x19')](this));ami['on'](_0x0189('0x20'),this[_0x0189('0x21')]['bind'](this));ami['on']('agentconnect',this[_0x0189('0x22')]['bind'](this));ami['on'](_0x0189('0x23'),this[_0x0189('0x24')]['bind'](this));ami['on'](_0x0189('0x25'),this['syncHangup'][_0x0189('0x19')](this));ami['on'](_0x0189('0x26'),this[_0x0189('0x27')][_0x0189('0x19')](this));ami['on'](_0x0189('0x28'),this['syncMusicOnHoldStart'][_0x0189('0x19')](this));ami['on'](_0x0189('0x29'),this[_0x0189('0x2a')][_0x0189('0x19')](this));ami['on'](_0x0189('0x2b'),this[_0x0189('0x2c')][_0x0189('0x19')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x0189('0x19')](this));this['loopQueueSummary']();this[_0x0189('0x2d')]();}function isNotNull(_0x1f61f3){return _0x1f61f3!==null&&!_[_0x0189('0x2e')](_0x1f61f3);}function clearChannels(_0x3d68a8){if(!_[_0x0189('0x2f')](_0x3d68a8)){for(var _0x174097 in _0x3d68a8){if(_0x3d68a8[_0x0189('0x30')](_0x174097)){delete _0x3d68a8[_0x174097];}}}}function clearCampaigns(_0x42c729){if(!_['isEmpty'](_0x42c729)){for(var _0xe83264 in _0x42c729){if(_0x42c729[_0x0189('0x30')](_0xe83264)){_0x42c729[_0xe83264][_0x0189('0x31')]=0x0;}}}}function clearVoiceQueues(_0x53a21c){if(!_['isEmpty'](_0x53a21c)){for(var _0x378a5a in _0x53a21c){if(_0x53a21c['hasOwnProperty'](_0x378a5a)){_0x53a21c[_0x378a5a][_0x0189('0x31')]=0x0;_0x53a21c[_0x378a5a][_0x0189('0x32')]=0x0;_0x53a21c[_0x378a5a]['pTalking']=0x0;_0x53a21c[_0x378a5a][_0x0189('0x33')]=0x0;_0x53a21c[_0x378a5a][_0x0189('0x34')]=!![];}}}}function clearAgentBooked(_0x580294){if(!_['isEmpty'](_0x580294)){for(var _0x28010d in _0x580294){if(_0x580294[_0x0189('0x30')](_0x28010d)){_0x580294[_0x28010d][_0x0189('0x35')]=!![];}}}}VoiceQueueReport[_0x0189('0xc')][_0x0189('0x36')]=function(){var _0x3b009e=this;for(var _0x121444 in this['channels']){if(this[_0x0189('0x13')][_0x0189('0x30')](_0x121444)&&!this[_0x0189('0x13')][_0x121444]['switch']){this[_0x0189('0x10')][_0x0189('0xd')](function(){if(!_['isNil'](_0x3b009e[_0x0189('0x13')][_0x121444])){return ami[_0x0189('0x37')]({'action':_0x0189('0x38'),'channel':_0x3b009e[_0x0189('0x13')][_0x121444][_0x0189('0x39')]})['catch'](function(_0x4791ca){if(_0x4791ca[_0x0189('0x3a')]===_0x0189('0x3b')){setTimeout(function(){if(_0x3b009e[_0x0189('0x13')][_0x121444]){delete _0x3b009e[_0x0189('0x13')][_0x121444];logger[_0x0189('0x3c')](_0x0189('0x3d'),_0x121444);}if(_0x3b009e[_0x0189('0x11')][_0x121444]){delete _0x3b009e[_0x0189('0x11')][_0x121444];logger[_0x0189('0x3c')](_0x0189('0x3e'),_0x121444);}if(_0x3b009e[_0x0189('0x3f')][_0x121444]){delete _0x3b009e[_0x0189('0x3f')][_0x121444];logger[_0x0189('0x3c')](_0x0189('0x40'),_0x121444);}},0x1f40);}});}});}}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x27')]=function(){logger[_0x0189('0x3c')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x0189('0x13')]);this['clearQueueReport'](this[_0x0189('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x0189('0x15')]);clearCampaigns(this[_0x0189('0x16')]);};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x41')]=function(_0x209489){var _0x45410f=this;if(!_[_0x0189('0x2f')](_0x209489)){for(var _0x54f7b7 in _0x209489){if(_0x209489[_0x0189('0x30')](_0x54f7b7)){_0x45410f[_0x0189('0x42')](_0x209489[_0x54f7b7]);delete _0x209489[_0x54f7b7];}}}};function loggerCatch(_0x46654a){return function(_0x390108){logger[_0x0189('0x3c')](_0x46654a,util[_0x0189('0x43')](_0x390108,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x0189('0xc')][_0x0189('0x44')]=function(_0x471837,_0x5c8c48,_0x5ad0dc){io['to'](_0x471837)['emit'](_0x5c8c48,_0x5ad0dc);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x3e74a2){this['emit'](util['format'](_0x0189('0x45'),_0x3e74a2[_0x0189('0x46')]),_0x0189('0x47'),_0x3e74a2);};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x42')]=function(_0x560c95){logger[_0x0189('0x48')](_0x0189('0x49'),JSON['stringify'](_0x560c95));this[_0x0189('0x44')](util[_0x0189('0x4a')](_0x0189('0x45'),_0x560c95['name']),'voice_queue_channel:remove',_0x560c95);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x14b0c5){if(_0x14b0c5[_0x0189('0x4b')]===_0x0189('0x4c')){var _0x5706ab={'id':_0x14b0c5['id'],'name':_0x14b0c5[_0x0189('0x46')],'strategy':_0x14b0c5['strategy'],'answered':_0x14b0c5['answered'],'available':_0x14b0c5[_0x0189('0x4d')],'loggedIn':_0x14b0c5[_0x0189('0x4e')],'pTalking':_0x14b0c5[_0x0189('0x4f')],'sumBillable':_0x14b0c5['sumBillable'],'sumDuration':_0x14b0c5[_0x0189('0x50')],'sumHoldTime':_0x14b0c5['sumHoldTime']||0x0,'talking':_0x14b0c5['talking'],'total':_0x14b0c5['total'],'type':_0x14b0c5[_0x0189('0x4b')],'unmanaged':_0x14b0c5[_0x0189('0x51')],'abandoned':_0x14b0c5[_0x0189('0x52')],'waiting':_0x14b0c5[_0x0189('0x33')]};if(_0x14b0c5['Trunk']){_0x5706ab[_0x0189('0x53')]={'id':_0x14b0c5['Trunk']['id'],'name':_0x14b0c5['Trunk'][_0x0189('0x46')],'active':_0x14b0c5['Trunk'][_0x0189('0x54')],'callerid':_0x14b0c5[_0x0189('0x53')][_0x0189('0x55')]};}if(_0x14b0c5[_0x0189('0x56')]){_0x5706ab['Interval']={'id':_0x14b0c5[_0x0189('0x56')]['id'],'name':_0x14b0c5[_0x0189('0x56')][_0x0189('0x46')]};}var _0x1ab44f=md5(JSON[_0x0189('0x57')](_0x5706ab));if(_0x14b0c5[_0x0189('0x58')]!==_0x1ab44f){_0x14b0c5['md5']=_0x1ab44f;this[_0x0189('0x44')](util[_0x0189('0x4a')]('voice:queue:%s',_0x5706ab[_0x0189('0x46')]),_0x0189('0x59'),_0x5706ab);}}};VoiceQueueReport['prototype'][_0x0189('0x5a')]=function(_0x6b826c){return _0x6b826c!==null&&!_[_0x0189('0x2e')](_0x6b826c);};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x2d')]=function(){var _0x19b279=this;setInterval(function(){_0x19b279[_0x0189('0x36')]();ami[_0x0189('0x37')]({'action':'queues'})[_0x0189('0x5b')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x0189('0xc')]['loopQueueSummary']=function(){var _0xd6ae78=this;setInterval(function(){if(_0xd6ae78[_0x0189('0x5c')]){return ami['Action']({'action':_0x0189('0x5d')})[_0x0189('0x5e')](function(_0x581f7d){_0xd6ae78['flagQueueSummary']=![];})[_0x0189('0x5b')](loggerCatch(_0x0189('0x5f')));}},0x3e8);};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x60')]=function(_0x48d447){try{if(this[_0x0189('0x5a')](_0x48d447)&&this['isNotNull'](_0x48d447[_0x0189('0x61')])){if(this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]]){var _0x225238=_[_0x0189('0x62')](this[_0x0189('0x13')],_0x0189('0x61'))[_0x48d447['queue']]||0x0;var _0x17186c=_0x225238-_0x48d447[_0x0189('0x63')];if(this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x33')]!==_['toNumber'](_0x48d447['callers'])||this['voiceQueues'][_0x48d447[_0x0189('0x61')]][_0x0189('0x4e')]!==_['toNumber'](_0x48d447[_0x0189('0x64')])||this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x4d')]!==_[_0x0189('0x65')](_0x48d447['available'])||this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x32')]!==_0x17186c){this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x33')]=_[_0x0189('0x65')](_0x48d447['callers']);this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x4e')]=_[_0x0189('0x65')](_0x48d447[_0x0189('0x64')]);this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]]['available']=_[_0x0189('0x65')](_0x48d447[_0x0189('0x4d')]);this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x32')]=_0x17186c>0x0?_0x17186c:0x0;this[_0x0189('0x15')][_0x48d447['queue']][_0x0189('0x32')]=this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]][_0x0189('0x32')]>_[_0x0189('0x65')](_0x48d447['loggedin'])?_[_0x0189('0x65')](_0x48d447['loggedin']):this[_0x0189('0x15')][_0x48d447[_0x0189('0x61')]]['talking'];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x48d447[_0x0189('0x61')]]);}ami[_0x0189('0x44')](_0x0189('0x66'),this['voiceQueues'][_0x48d447['queue']]);}}}catch(_0x506a08){logger[_0x0189('0x3c')](_0x0189('0x67'),util['inspect'](_0x506a08,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x18')]=function(_0x5ebbc7){this[_0x0189('0x5c')]=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x4f50ba){};VoiceQueueReport['prototype'][_0x0189('0x1b')]=function(_0x55e811){try{if(this['isNotNull'](_0x55e811)){if(_['isUndefined'](this[_0x0189('0x11')][_0x55e811[_0x0189('0x68')]])){this['queueReports'][_0x55e811[_0x0189('0x68')]]=[];this[_0x0189('0x13')][_0x55e811[_0x0189('0x68')]]={};}var _0x5ca4f9=new QueueReport();_0x5ca4f9['name']=_0x55e811[_0x0189('0x61')];_0x5ca4f9[_0x0189('0x4b')]=this[_0x0189('0x15')][_0x5ca4f9[_0x0189('0x46')]]&&this[_0x0189('0x15')][_0x5ca4f9['name']][_0x0189('0x4b')]?this[_0x0189('0x15')][_0x5ca4f9[_0x0189('0x46')]]['type']||_0x0189('0x4c'):_0x0189('0x4c');_0x5ca4f9[_0x0189('0x61')]=_0x55e811[_0x0189('0x61')];_0x5ca4f9[_0x0189('0x69')]=moment()[_0x0189('0x4a')](_0x0189('0x6a'));_0x5ca4f9['position']=_0x55e811['position'];_0x5ca4f9[_0x0189('0x6b')]=_0x55e811[_0x0189('0x6b')];_[_0x0189('0x6c')](_0x5ca4f9,_[_0x0189('0x6d')](_0x55e811,_[_0x0189('0x6e')](_0x5ca4f9)));this['queueReports'][_0x55e811['uniqueid']][_0x0189('0x6f')](_0x5ca4f9);this[_0x0189('0x13')][_0x55e811[_0x0189('0x68')]]=_0x5ca4f9;this['emitVoiceQueueChannelSave'](_0x5ca4f9);}}catch(_0x51d51e){logger[_0x0189('0x3c')](_0x0189('0x70'),util[_0x0189('0x43')](_0x51d51e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x1d')]=function(_0x385515){try{if(this['isNotNull'](_0x385515)){if(this[_0x0189('0x11')][_0x385515['uniqueid']]){var _0x292488=_[_0x0189('0x71')](this[_0x0189('0x11')][_0x385515['uniqueid']]);_0x292488['queuecallercomplete']=![];_0x292488[_0x0189('0x72')]=null;_0x292488[_0x0189('0x73')]=_0x385515['holdtime'];_0x292488['originalposition']=_0x385515[_0x0189('0x74')];_0x292488[_0x0189('0x1c')]=!![];_0x292488['queuecallerabandonAt']=moment()[_0x0189('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x292488[_0x0189('0x75')]=_0x0189('0x76');_0x292488[_0x0189('0x77')]=null;this[_0x0189('0x13')][_0x385515[_0x0189('0x68')]]=_0x292488;this[_0x0189('0x42')](_0x292488);}}}catch(_0x545905){logger[_0x0189('0x3c')](_0x0189('0x78'),util[_0x0189('0x43')](_0x545905,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x1f')]=function(_0x210adb){try{if(this['isNotNull'](_0x210adb)){if(this['queueReports'][_0x210adb[_0x0189('0x68')]]){var _0x21a9a7=_[_0x0189('0x71')](this['queueReports'][_0x210adb['uniqueid']]);_0x21a9a7[_0x0189('0x79')]=moment()[_0x0189('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x21a9a7[_0x0189('0x7a')]=_0x210adb[_0x0189('0x7a')];_0x21a9a7[_0x0189('0x7b')]=_0x210adb[_0x0189('0x7b')];this['channels'][_0x210adb[_0x0189('0x68')]]=_0x21a9a7;this[_0x0189('0x7c')](_0x21a9a7);}}}catch(_0x12fcfc){logger['error']('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x0189('0x43')](_0x12fcfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x22')]=function(_0x42a52b){try{if(this[_0x0189('0x5a')](_0x42a52b)){if(this[_0x0189('0x11')][_0x42a52b[_0x0189('0x68')]]){var _0x5535b8=_[_0x0189('0x71')](this['queueReports'][_0x42a52b['uniqueid']]);_0x5535b8[_0x0189('0x7d')]=!![];_0x5535b8['queuecallerexitreason']=_0x0189('0x7e');}}}catch(_0x23efe1){logger[_0x0189('0x3c')](_0x0189('0x7f'),util[_0x0189('0x43')](_0x23efe1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x22d889){try{if(this[_0x0189('0x5a')](_0x22d889)){if(this[_0x0189('0x11')][_0x22d889[_0x0189('0x68')]]){var _0x4aaa48=_[_0x0189('0x71')](this[_0x0189('0x11')][_0x22d889[_0x0189('0x68')]]);_0x4aaa48[_0x0189('0x1c')]=![];_0x4aaa48[_0x0189('0x80')]=null;_0x4aaa48[_0x0189('0x81')]=!![];_0x4aaa48['lastAssignedTo']=_0x22d889[_0x0189('0x82')];_0x4aaa48['holdtime']=_0x22d889['holdtime'];_0x4aaa48[_0x0189('0x7d')]=!![];_0x4aaa48['queuecallerexit']=![];_0x4aaa48['queuecallerexitAt']=null;if(!_0x4aaa48[_0x0189('0x83')]){if(_0x22d889[_0x0189('0x84')]==_0x0189('0x83')){_0x4aaa48[_0x0189('0x75')]=_0x0189('0x85');}else{if(_[_0x0189('0x86')](_0x22d889[_0x0189('0x39')][_0x0189('0x87')](),_0x0189('0x88'))){if(this[_0x0189('0x11')][_0x22d889[_0x0189('0x89')]]){var _0x344912=_[_0x0189('0x71')](this[_0x0189('0x11')][_0x22d889[_0x0189('0x89')]]);_0x344912[_0x0189('0x7d')]=![];_0x344912['queuecallerexit']=!![];_0x344912[_0x0189('0x8a')]=moment(_0x4aaa48[_0x0189('0x69')])['add'](_0x22d889[_0x0189('0x73')],_0x0189('0x8b'))[_0x0189('0x4a')](_0x0189('0x6a'));_0x344912['queuecallerexitreason']=_0x0189('0x8c');_0x344912[_0x0189('0x83')]=!![];_0x344912[_0x0189('0x8d')]=_0x0189('0x8e');_0x344912[_0x0189('0x8f')]=_0x22d889['destexten'];_0x344912[_0x0189('0x90')]=_0x22d889[_0x0189('0x68')];var _0x499057=this[_0x0189('0x11')][_0x22d889[_0x0189('0x89')]];this[_0x0189('0x11')][_0x22d889[_0x0189('0x89')]]=this['queueReports'][_0x22d889['uniqueid']];this[_0x0189('0x11')][_0x22d889[_0x0189('0x68')]]=_0x499057;}}else{_0x4aaa48[_0x0189('0x75')]=_0x0189('0x91')+_0x22d889['reason'][_0x0189('0x92')]();}}}this[_0x0189('0x13')][_0x22d889['uniqueid']]=_0x4aaa48;this[_0x0189('0x42')](_0x4aaa48);}}}catch(_0x523a18){logger[_0x0189('0x3c')]('[syncAgentComplete][VoiceQueueReport]',util[_0x0189('0x43')](_0x523a18,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0x24')]=function(_0x2c853f){try{if(this[_0x0189('0x5a')](_0x2c853f)){this[_0x0189('0x93')](_0x2c853f[_0x0189('0x68')],_[_0x0189('0x6e')](_0x2c853f[_0x0189('0x94')])[0x0],_0x2c853f[_0x0189('0x95')]);if(this['queueReports'][_0x2c853f[_0x0189('0x68')]]){var _0x42a4e2=_['last'](this[_0x0189('0x11')][_0x2c853f[_0x0189('0x68')]]);if(_0x42a4e2){if(this[_0x0189('0x5a')](_0x2c853f[_0x0189('0x94')])&&this['isNotNull'](_0x2c853f['variable']['queuestatus'])){switch(_0x2c853f[_0x0189('0x95')]){case _0x0189('0x96'):_0x42a4e2['queuecallerexit']=![];_0x42a4e2['queuecallerexitAt']=null;break;case _0x0189('0x97'):_0x42a4e2[_0x0189('0x98')]='timeout';ami[_0x0189('0x44')](_0x0189('0x99'),_0x42a4e2);break;default:_0x42a4e2[_0x0189('0x9a')]=!![];_0x42a4e2[_0x0189('0x8a')]=moment()[_0x0189('0x4a')](_0x0189('0x6a'));_0x42a4e2[_0x0189('0x79')]=moment()[_0x0189('0x4a')](_0x0189('0x6a'));}_0x42a4e2[_0x0189('0x1c')]=![];_0x42a4e2[_0x0189('0x80')]=null;_0x42a4e2[_0x0189('0x75')]=_0x2c853f[_0x0189('0x95')];this['channels'][_0x2c853f[_0x0189('0x68')]]=_0x42a4e2;this['emitVoiceQueueChannelRemove'](_0x42a4e2);}else if(this['isNotNull'](_0x2c853f[_0x0189('0x94')])&&this[_0x0189('0x5a')](_0x2c853f['variable']['queueposition'])){if(!_0x42a4e2[_0x0189('0x1c')]){_0x42a4e2[_0x0189('0x9a')]=!![];_0x42a4e2[_0x0189('0x8a')]=moment()[_0x0189('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x42a4e2[_0x0189('0x75')]=_0x0189('0x9b');_0x42a4e2[_0x0189('0x79')]=moment()[_0x0189('0x4a')](_0x0189('0x6a'));this['channels'][_0x2c853f['uniqueid']]=_0x42a4e2;}}_0x42a4e2['variables']=this[_0x0189('0x3f')][_0x2c853f[_0x0189('0x68')]];}}}}catch(_0x209b90){logger['error']('[syncVarSet][VoiceQueueReport]',util['inspect'](_0x209b90,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0189('0x93')]=function(_0x373bcb,_0x1d8bdb,_0x11571e){var _0x8e81f=[_0x0189('0x9c'),'rtpaudioqosbridged',_0x0189('0x9d'),_0x0189('0x9e'),_0x0189('0x9f'),_0x0189('0xa0'),_0x0189('0xa1'),_0x0189('0xa2'),'sipcallid',_0x0189('0xa3'),'bridgepeer',_0x0189('0xa4'),_0x0189('0xa5'),_0x0189('0xa6'),_0x0189('0xa7'),_0x0189('0xa8'),_0x0189('0x82'),'memberpenalty',_0x0189('0xa9')];if(!_[_0x0189('0xaa')](_0x1d8bdb)&&!_[_0x0189('0xab')](_0x8e81f,_0x1d8bdb)){if(_[_0x0189('0x2e')](this[_0x0189('0x3f')][_0x373bcb])){this[_0x0189('0x3f')][_0x373bcb]={};}this[_0x0189('0x3f')][_0x373bcb][_0x1d8bdb]=_0x11571e;}};VoiceQueueReport[_0x0189('0xc')][_0x0189('0xac')]=function(_0x488d15){try{if(this[_0x0189('0x5a')](_0x488d15)){if(this[_0x0189('0x11')][_0x488d15[_0x0189('0x68')]]){for(var _0x49e303=0x0,_0x1edb3b={};_0x49e3030x0?_0x29069e:0x0;this[_0xe657('0x15')][_0x45aa92[_0xe657('0x64')]]['talking']=this[_0xe657('0x15')][_0x45aa92[_0xe657('0x64')]][_0xe657('0x31')]>_['toNumber'](_0x45aa92[_0xe657('0x67')])?_['toNumber'](_0x45aa92[_0xe657('0x67')]):this['voiceQueues'][_0x45aa92[_0xe657('0x64')]]['talking'];this[_0xe657('0x69')](this['voiceQueues'][_0x45aa92[_0xe657('0x64')]]);}ami[_0xe657('0x47')](_0xe657('0x6a'),this[_0xe657('0x15')][_0x45aa92[_0xe657('0x64')]]);}}}catch(_0x254823){logger[_0xe657('0x3f')](_0xe657('0x6b'),util['inspect'](_0x254823,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe657('0xd')][_0xe657('0x19')]=function(_0x3c9657){this[_0xe657('0x5e')]=!![];};VoiceQueueReport[_0xe657('0xd')][_0xe657('0x6c')]=function(_0x51d4e6){};VoiceQueueReport[_0xe657('0xd')]['syncQueueCallerJoin']=function(_0x3f9577){try{if(this['isNotNull'](_0x3f9577)){if(_[_0xe657('0x2d')](this['queueReports'][_0x3f9577[_0xe657('0x6d')]])){this['queueReports'][_0x3f9577[_0xe657('0x6d')]]=[];this[_0xe657('0x13')][_0x3f9577[_0xe657('0x6d')]]={};}var _0x303f1a=new QueueReport();_0x303f1a[_0xe657('0x4a')]=_0x3f9577[_0xe657('0x64')];_0x303f1a[_0xe657('0x56')]=this['voiceQueues'][_0x303f1a['name']]&&this['voiceQueues'][_0x303f1a[_0xe657('0x4a')]][_0xe657('0x56')]?this[_0xe657('0x15')][_0x303f1a[_0xe657('0x4a')]][_0xe657('0x56')]||'inbound':_0xe657('0x50');_0x303f1a[_0xe657('0x64')]=_0x3f9577[_0xe657('0x64')];_0x303f1a[_0xe657('0x6e')]=moment()[_0xe657('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x303f1a[_0xe657('0x6f')]=_0x3f9577[_0xe657('0x6f')];_0x303f1a[_0xe657('0x70')]=_0x3f9577['count'];_[_0xe657('0x71')](_0x303f1a,_[_0xe657('0x72')](_0x3f9577,_[_0xe657('0x73')](_0x303f1a)));this[_0xe657('0x11')][_0x3f9577[_0xe657('0x6d')]][_0xe657('0x74')](_0x303f1a);this[_0xe657('0x13')][_0x3f9577['uniqueid']]=_0x303f1a;this[_0xe657('0x48')](_0x303f1a);}}catch(_0x275286){logger['error'](_0xe657('0x75'),util['inspect'](_0x275286,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe657('0xd')][_0xe657('0x76')]=function(_0xead820){try{if(this[_0xe657('0x62')](_0xead820)){if(this[_0xe657('0x11')][_0xead820[_0xe657('0x6d')]]){var _0x509dcb=_[_0xe657('0x77')](this[_0xe657('0x11')][_0xead820[_0xe657('0x6d')]]);_0x509dcb[_0xe657('0x78')]=![];_0x509dcb[_0xe657('0x79')]=null;_0x509dcb[_0xe657('0x7a')]=_0xead820[_0xe657('0x7a')];_0x509dcb[_0xe657('0x7b')]=_0xead820[_0xe657('0x7b')];_0x509dcb[_0xe657('0x1d')]=!![];_0x509dcb[_0xe657('0x7c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x509dcb[_0xe657('0x7d')]=_0xe657('0x7e');_0x509dcb['lastAssignedTo']=null;this[_0xe657('0x13')][_0xead820[_0xe657('0x6d')]]=_0x509dcb;this['emitVoiceQueueChannelRemove'](_0x509dcb);}}}catch(_0x39944f){logger[_0xe657('0x3f')](_0xe657('0x7f'),util[_0xe657('0x46')](_0x39944f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe657('0xd')][_0xe657('0x1f')]=function(_0x36697d){try{if(this[_0xe657('0x62')](_0x36697d)){if(this[_0xe657('0x11')][_0x36697d['uniqueid']]){var _0x1cb22f=_[_0xe657('0x77')](this['queueReports'][_0x36697d[_0xe657('0x6d')]]);_0x1cb22f[_0xe657('0x80')]=moment()[_0xe657('0x49')](_0xe657('0x81'));_0x1cb22f[_0xe657('0x82')]=_0x36697d[_0xe657('0x82')];_0x1cb22f[_0xe657('0x83')]=_0x36697d['connectedlinename'];this[_0xe657('0x13')][_0x36697d[_0xe657('0x6d')]]=_0x1cb22f;this[_0xe657('0x48')](_0x1cb22f);}}}catch(_0x27abca){logger[_0xe657('0x3f')](_0xe657('0x84'),util[_0xe657('0x46')](_0x27abca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe657('0xd')]['syncAgentConnect']=function(_0x9604d){try{if(this[_0xe657('0x62')](_0x9604d)){if(this[_0xe657('0x11')][_0x9604d['uniqueid']]){var _0x39d06c=_[_0xe657('0x77')](this[_0xe657('0x11')][_0x9604d['uniqueid']]);_0x39d06c['queuecallercomplete']=!![];_0x39d06c['queuecallerexitreason']=_0xe657('0x85');}}}catch(_0x18734e){logger[_0xe657('0x3f')]('[syncAgentConnect][VoiceQueueReport]',util[_0xe657('0x46')](_0x18734e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe657('0xd')][_0xe657('0x21')]=function(_0x3daea7){try{if(this[_0xe657('0x62')](_0x3daea7)){if(this['queueReports'][_0x3daea7[_0xe657('0x6d')]]){var _0x383a46=_[_0xe657('0x77')](this[_0xe657('0x11')][_0x3daea7[_0xe657('0x6d')]]);_0x383a46['queuecallerabandon']=![];_0x383a46['queuecallerabandonAt']=null;_0x383a46[_0xe657('0x86')]=!![];_0x383a46[_0xe657('0x87')]=_0x3daea7[_0xe657('0x88')];_0x383a46[_0xe657('0x7a')]=_0x3daea7[_0xe657('0x7a')];_0x383a46[_0xe657('0x78')]=!![];_0x383a46[_0xe657('0x89')]=![];_0x383a46[_0xe657('0x8a')]=null;if(!_0x383a46[_0xe657('0x8b')]){if(_0x3daea7[_0xe657('0x8c')]=='transfer'){_0x383a46[_0xe657('0x7d')]='COMPLETED';}else{if(_[_0xe657('0x8d')](_0x3daea7[_0xe657('0x3b')][_0xe657('0x8e')](),_0xe657('0x8f'))){if(this['queueReports'][_0x3daea7[_0xe657('0x90')]]){var _0xd8ca84=_[_0xe657('0x77')](this[_0xe657('0x11')][_0x3daea7[_0xe657('0x90')]]);_0xd8ca84[_0xe657('0x78')]=![];_0xd8ca84[_0xe657('0x89')]=!![];_0xd8ca84[_0xe657('0x8a')]=moment(_0x383a46[_0xe657('0x6e')])[_0xe657('0x91')](_0x3daea7['holdtime'],_0xe657('0x92'))[_0xe657('0x49')](_0xe657('0x81'));_0xd8ca84['queuecallerexitreason']=_0xe657('0x93');_0xd8ca84[_0xe657('0x8b')]=!![];_0xd8ca84[_0xe657('0x94')]='FORWARD';_0xd8ca84['transferexten']=_0x3daea7['destexten'];_0xd8ca84[_0xe657('0x95')]=_0x3daea7[_0xe657('0x6d')];var _0x38fd2c=this[_0xe657('0x11')][_0x3daea7['linkedid']];this[_0xe657('0x11')][_0x3daea7[_0xe657('0x90')]]=this[_0xe657('0x11')][_0x3daea7[_0xe657('0x6d')]];this[_0xe657('0x11')][_0x3daea7[_0xe657('0x6d')]]=_0x38fd2c;}}else{_0x383a46[_0xe657('0x7d')]='COMPLETEDBY'+_0x3daea7[_0xe657('0x8c')]['toUpperCase']();}}}this[_0xe657('0x13')][_0x3daea7[_0xe657('0x6d')]]=_0x383a46;this[_0xe657('0x45')](_0x383a46);}}}catch(_0x404f96){logger[_0xe657('0x3f')](_0xe657('0x96'),util['inspect'](_0x404f96,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x2cd52c){try{if(this[_0xe657('0x62')](_0x2cd52c)){this[_0xe657('0x97')](_0x2cd52c[_0xe657('0x6d')],_['keys'](_0x2cd52c[_0xe657('0x98')])[0x0],_0x2cd52c[_0xe657('0x99')]);if(this[_0xe657('0x11')][_0x2cd52c[_0xe657('0x6d')]]){var _0x7423ed=_[_0xe657('0x77')](this[_0xe657('0x11')][_0x2cd52c['uniqueid']]);if(_0x7423ed){if(this[_0xe657('0x62')](_0x2cd52c[_0xe657('0x98')])&&this[_0xe657('0x62')](_0x2cd52c[_0xe657('0x98')][_0xe657('0x9a')])){switch(_0x2cd52c[_0xe657('0x99')]){case _0xe657('0x9b'):_0x7423ed[_0xe657('0x89')]=![];_0x7423ed[_0xe657('0x8a')]=null;break;case _0xe657('0x9c'):_0x7423ed['lastevent']=_0xe657('0x9d');ami['emit'](_0xe657('0x9e'),_0x7423ed);break;default:_0x7423ed[_0xe657('0x89')]=!![];_0x7423ed['queuecallerexitAt']=moment()[_0xe657('0x49')](_0xe657('0x81'));_0x7423ed[_0xe657('0x80')]=moment()['format'](_0xe657('0x81'));}_0x7423ed[_0xe657('0x1d')]=![];_0x7423ed[_0xe657('0x7c')]=null;_0x7423ed[_0xe657('0x7d')]=_0x2cd52c['value'];this[_0xe657('0x13')][_0x2cd52c[_0xe657('0x6d')]]=_0x7423ed;this[_0xe657('0x45')](_0x7423ed);}else if(this[_0xe657('0x62')](_0x2cd52c['variable'])&&this[_0xe657('0x62')](_0x2cd52c[_0xe657('0x98')]['queueposition'])){if(!_0x7423ed[_0xe657('0x1d')]){_0x7423ed[_0xe657('0x89')]=!![];_0x7423ed[_0xe657('0x8a')]=moment()[_0xe657('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x7423ed['queuecallerexitreason']=_0xe657('0x9f');_0x7423ed['queuecallerleaveAt']=moment()[_0xe657('0x49')](_0xe657('0x81'));this['channels'][_0x2cd52c[_0xe657('0x6d')]]=_0x7423ed;}}_0x7423ed[_0xe657('0x17')]=this['variables'][_0x2cd52c[_0xe657('0x6d')]];}}}}catch(_0x15bdf1){logger[_0xe657('0x3f')](_0xe657('0xa0'),util['inspect'](_0x15bdf1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe657('0xd')]['addVariable']=function(_0x5c0f71,_0x1bd665,_0x2be1c5){var _0x56202d=['rtpaudioqos',_0xe657('0xa1'),_0xe657('0xa2'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xe657('0xa3'),_0xe657('0xa4'),_0xe657('0xa5'),_0xe657('0xa6'),_0xe657('0xa7'),_0xe657('0xa8'),_0xe657('0xa9'),_0xe657('0xaa'),_0xe657('0xab'),_0xe657('0xac'),_0xe657('0xad'),'membername','memberpenalty',_0xe657('0xae')];if(!_['isNil'](_0x1bd665)&&!_[_0xe657('0xaf')](_0x56202d,_0x1bd665)){if(_[_0xe657('0x2d')](this[_0xe657('0x17')][_0x5c0f71])){this[_0xe657('0x17')][_0x5c0f71]={};}this[_0xe657('0x17')][_0x5c0f71][_0x1bd665]=_0x2be1c5;}};VoiceQueueReport[_0xe657('0xd')][_0xe657('0xb0')]=function(_0x5597ae){try{if(this[_0xe657('0x62')](_0x5597ae)){if(this[_0xe657('0x11')][_0x5597ae[_0xe657('0x6d')]]){for(var _0x307d0d=0x0,_0x3bba3b={};_0x307d0d=0x0?moment(_0x46407c[_0x162d('0x17')])[_0x162d('0xc')](_0x46407c[_0x162d('0x18')],_0x162d('0x19')):null,'data1':_0x162d('0x1a'),'data2':_0x46407c[_0x162d('0x11')],'data3':_0x46407c[_0x162d('0xf')],'data4':_0x46407c[_0x162d('0x1b')]||null,'role':_0x162d('0x10'),'internal':_0x46407c[_0x162d('0x11')]?_[_0x162d('0x12')](_0x46407c['accountcode']):undefined,'uniqueid':_0x46407c[_0x162d('0x13')]},'log':_0x162d('0x6')});}; \ No newline at end of file +var _0xb96e=['TALKING','diff','queuecallerleaveAt','calleridnum','queue','agent','accountcode','toNumber','uniqueid','CreateMemberReport','voiceDialReport','starttime','endtime','seconds','outbound','moment','lodash','util','voiceQueueReport','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s'];(function(_0x4f4f19,_0x3488a5){var _0x3f0b1f=function(_0x314f23){while(--_0x314f23){_0x4f4f19['push'](_0x4f4f19['shift']());}};_0x3f0b1f(++_0x3488a5);}(_0xb96e,0xcc));var _0xeb96=function(_0x2fd747,_0x3a16b5){_0x2fd747=_0x2fd747-0x0;var _0x94cf34=_0xb96e[_0x2fd747];return _0x94cf34;};'use strict';var moment=require(_0xeb96('0x0'));var _=require(_0xeb96('0x1'));var util=require(_0xeb96('0x2'));var client=require('../client');exports[_0xeb96('0x3')]=function(_0xe2ca79){var _0xb39b7e=_0xe2ca79['queuecallercompleteAt']||_0xe2ca79[_0xeb96('0x4')];return client[_0xeb96('0x5')]('CreateMemberReport',{'body':{'channel':_0xeb96('0x6'),'membername':_0xe2ca79[_0xeb96('0x7')],'interface':_[_0xeb96('0x8')](_0xe2ca79[_0xeb96('0x9')])?util[_0xeb96('0xa')](_0xeb96('0xb'),_0xe2ca79[_0xeb96('0x7')]):_0xe2ca79[_0xeb96('0x9')],'type':_0xeb96('0xc'),'enterAt':_0xe2ca79['queuecallerleaveAt'],'exitAt':_0xb39b7e,'duration':moment(_0xb39b7e)[_0xeb96('0xd')](_0xe2ca79[_0xeb96('0xe')],'seconds'),'data1':'inbound','data2':_0xe2ca79[_0xeb96('0xf')],'data3':_0xe2ca79['exten'],'data4':null,'data5':_0xe2ca79[_0xeb96('0x10')],'role':_0xeb96('0x11'),'internal':_0xe2ca79[_0xeb96('0x12')]?_[_0xeb96('0x13')](_0xe2ca79[_0xeb96('0x12')]):undefined,'uniqueid':_0xe2ca79[_0xeb96('0x14')]},'log':_0xeb96('0x15')});};exports[_0xeb96('0x16')]=function(_0x1a9712){return client[_0xeb96('0x5')](_0xeb96('0x15'),{'body':{'channel':_0xeb96('0x6'),'membername':_0x1a9712['membername'],'interface':_0x1a9712[_0xeb96('0x9')],'type':_0xeb96('0xc'),'enterAt':_0x1a9712[_0xeb96('0x17')],'exitAt':_0x1a9712['endtime'],'duration':moment(_0x1a9712[_0xeb96('0x18')])[_0xeb96('0xd')](_0x1a9712[_0xeb96('0x17')],_0xeb96('0x19'))>=0x0?moment(_0x1a9712[_0xeb96('0x18')])['diff'](_0x1a9712[_0xeb96('0x17')],_0xeb96('0x19')):null,'data1':_0xeb96('0x1a'),'data2':_0x1a9712[_0xeb96('0x12')],'data3':_0x1a9712['exten'],'data4':_0x1a9712['dialstring']||null,'role':_0xeb96('0x11'),'internal':_0x1a9712['accountcode']?_[_0xeb96('0x13')](_0x1a9712[_0xeb96('0x12')]):undefined,'uniqueid':_0x1a9712[_0xeb96('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 50d54c6..503797a 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 _0xaf80=['getTemplates','html','GetTemplate','../client'];(function(_0x449549,_0xbfeeda){var _0x2eaf77=function(_0x381af8){while(--_0x381af8){_0x449549['push'](_0x449549['shift']());}};_0x2eaf77(++_0xbfeeda);}(_0xaf80,0x1ef));var _0x0af8=function(_0x23f11c,_0x3e4881){_0x23f11c=_0x23f11c-0x0;var _0xf776e=_0xaf80[_0x23f11c];return _0xf776e;};'use strict';var client=require(_0x0af8('0x0'));exports[_0x0af8('0x1')]=function(_0x440a0e){return function(_0x146357){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x0af8('0x2')]},'log':_0x0af8('0x3')});};}; \ No newline at end of file +var _0x593e=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0x593e,0xcb));var _0xe593=function(_0x1b5bc7,_0x5b6007){_0x1b5bc7=_0x1b5bc7-0x0;var _0x4b87ac=_0x593e[_0x1b5bc7];return _0x4b87ac;};'use strict';var client=require(_0xe593('0x0'));exports[_0xe593('0x1')]=function(_0x12f6de){return function(_0x28f28c){return client[_0xe593('0x2')](_0xe593('0x3'),{'options':{'raw':!![],'attributes':['id',_0xe593('0x4'),_0xe593('0x5')]},'log':'GetTemplate'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 97614f4..f172dd0 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 _0x6a22=['action','data2','data3','data4','data5','data6','../client','getTriggers','GetTrigger','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions'];(function(_0x2bcc14,_0x4f860d){var _0x53f1e1=function(_0x548589){while(--_0x548589){_0x2bcc14['push'](_0x2bcc14['shift']());}};_0x53f1e1(++_0x4f860d);}(_0x6a22,0x114));var _0x26a2=function(_0x5b2a15,_0xd200ec){_0x5b2a15=_0x5b2a15-0x0;var _0x33038d=_0x6a22[_0x5b2a15];return _0x33038d;};'use strict';var client=require(_0x26a2('0x0'));exports[_0x26a2('0x1')]=function(_0x51c9b9){return function(_0x672eb4){return client['Request'](_0x26a2('0x2'),{'options':{'raw':![],'attributes':['id','name','channel',_0x26a2('0x3')],'include':[{'model':_0x26a2('0x4'),'as':_0x26a2('0x5'),'attributes':['id',_0x26a2('0x6'),_0x26a2('0x7'),_0x26a2('0x8')]},{'model':_0x26a2('0x4'),'as':_0x26a2('0x9'),'attributes':['id',_0x26a2('0x6'),_0x26a2('0x7'),_0x26a2('0x8')]},{'model':_0x26a2('0xa'),'as':_0x26a2('0xb'),'attributes':['id',_0x26a2('0xc'),'data1',_0x26a2('0xd'),_0x26a2('0xe'),_0x26a2('0xf'),_0x26a2('0x10'),_0x26a2('0x11'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xc7b2=['getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data2','data3','data4','data7'];(function(_0x2cdde8,_0x22e82f){var _0x460210=function(_0x331cf2){while(--_0x331cf2){_0x2cdde8['push'](_0x2cdde8['shift']());}};_0x460210(++_0x22e82f);}(_0xc7b2,0x1ee));var _0x2c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x2c7b('0x0')]=function(_0xc88579){return function(_0x419e3a){return client[_0x2c7b('0x1')](_0x2c7b('0x2'),{'options':{'raw':![],'attributes':['id',_0x2c7b('0x3'),_0x2c7b('0x4'),_0x2c7b('0x5')],'include':[{'model':_0x2c7b('0x6'),'as':_0x2c7b('0x7'),'attributes':['id',_0x2c7b('0x8'),_0x2c7b('0x9'),_0x2c7b('0xa')]},{'model':'Condition','as':_0x2c7b('0xb'),'attributes':['id',_0x2c7b('0x8'),_0x2c7b('0x9'),_0x2c7b('0xa')]},{'model':_0x2c7b('0xc'),'as':'Actions','attributes':['id',_0x2c7b('0xd'),_0x2c7b('0xe'),_0x2c7b('0xf'),_0x2c7b('0x10'),_0x2c7b('0x11'),'data5','data6',_0x2c7b('0x12')]}]},'log':_0x2c7b('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 41d9ae5..5375571 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 _0x2e87=['registry','GetTrunk','../client','getTrunks','Request','name'];(function(_0x204feb,_0x2722d8){var _0x386eae=function(_0x26a1bf){while(--_0x26a1bf){_0x204feb['push'](_0x204feb['shift']());}};_0x386eae(++_0x2722d8);}(_0x2e87,0x74));var _0x72e8=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x2e87[_0x4bfcbe];return _0x5b65e6;};'use strict';var client=require(_0x72e8('0x0'));exports[_0x72e8('0x1')]=function(_0x22c8f1){return function(_0x542272){return client[_0x72e8('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x72e8('0x3'),_0x72e8('0x4')]},'log':_0x72e8('0x5')});};}; \ No newline at end of file +var _0xc439=['../client','registry'];(function(_0x23b70b,_0x827be7){var _0x69d657=function(_0x49decf){while(--_0x49decf){_0x23b70b['push'](_0x23b70b['shift']());}};_0x69d657(++_0x827be7);}(_0xc439,0x1ae));var _0x9c43=function(_0x524207,_0x472f6f){_0x524207=_0x524207-0x0;var _0x2ca475=_0xc439[_0x524207];return _0x2ca475;};'use strict';var client=require(_0x9c43('0x0'));exports['getTrunks']=function(_0x3231f2){return function(_0x1ec87d){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x9c43('0x1')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index fb61ae8..856f961 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 _0xc3a2=['getAgents','Request','GetUser','name','email','accountcode','online','lastPauseAt','voicePause','phone','mobile','interface','telephone','internal','getTelephones','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','pauseType','../client'];(function(_0x5c2c19,_0x23c07b){var _0x23d31d=function(_0x1449a5){while(--_0x1449a5){_0x5c2c19['push'](_0x5c2c19['shift']());}};_0x23d31d(++_0x23c07b);}(_0xc3a2,0xd7));var _0x2c3a=function(_0x220cdb,_0x4e6034){_0x220cdb=_0x220cdb-0x0;var _0xe0aee5=_0xc3a2[_0x220cdb];return _0xe0aee5;};'use strict';var client=require(_0x2c3a('0x0'));exports[_0x2c3a('0x1')]=function(){return function(){return client[_0x2c3a('0x2')](_0x2c3a('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x2c3a('0x4'),_0x2c3a('0x5'),_0x2c3a('0x6'),'fullname',_0x2c3a('0x7'),'lastLoginAt','pauseType',_0x2c3a('0x8'),_0x2c3a('0x9'),_0x2c3a('0xa'),_0x2c3a('0xb'),_0x2c3a('0xc')]},'log':_0x2c3a('0x1')});};};exports['getTelephones']=function(){return function(){return client[_0x2c3a('0x2')](_0x2c3a('0x3'),{'options':{'raw':!![],'where':{'role':_0x2c3a('0xd')},'attributes':['id',_0x2c3a('0x4'),_0x2c3a('0x6'),_0x2c3a('0xe')]},'log':_0x2c3a('0xf')});};};exports[_0x2c3a('0x10')]=function(_0x3c5352,_0x192703,_0x4d62c9){return client['Request'](_0x2c3a('0x11'),{'body':{'type':_0x192703,'uniqueid':_0x4d62c9},'options':{'where':{'id':_0x3c5352['id']}},'log':_0x2c3a('0x10')});};exports[_0x2c3a('0x12')]=function(_0x49be62){return client[_0x2c3a('0x2')](_0x2c3a('0x13'),{'body':{},'options':{'where':{'id':_0x49be62['id']}},'log':_0x2c3a('0x10')});};exports[_0x2c3a('0x14')]=function(_0x522241){return client[_0x2c3a('0x2')](_0x2c3a('0x15'),{'options':{'raw':![],'where':{'role':_0x2c3a('0x16'),'id':_0x522241},'attributes':['id',_0x2c3a('0x4'),_0x2c3a('0x5'),_0x2c3a('0x6'),'fullname',_0x2c3a('0x7'),'lastLoginAt',_0x2c3a('0x17'),_0x2c3a('0x8'),_0x2c3a('0x9'),_0x2c3a('0xc')]},'log':'getAgent'});}; \ No newline at end of file +var _0xd9fb=['voicePause','phone','mobile','GetUser','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','lastPauseAt','../client','getAgents','Request','name','email','accountcode','fullname','online','lastLoginAt','pauseType'];(function(_0x18fa31,_0x484e09){var _0x331c2f=function(_0x4a66c0){while(--_0x4a66c0){_0x18fa31['push'](_0x18fa31['shift']());}};_0x331c2f(++_0x484e09);}(_0xd9fb,0x182));var _0xbd9f=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xd9fb[_0x376b45];return _0x2341b3;};'use strict';var client=require(_0xbd9f('0x0'));exports[_0xbd9f('0x1')]=function(){return function(){return client[_0xbd9f('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0xbd9f('0x3'),_0xbd9f('0x4'),_0xbd9f('0x5'),_0xbd9f('0x6'),_0xbd9f('0x7'),_0xbd9f('0x8'),_0xbd9f('0x9'),'lastPauseAt',_0xbd9f('0xa'),_0xbd9f('0xb'),_0xbd9f('0xc'),'interface']},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client[_0xbd9f('0x2')](_0xbd9f('0xd'),{'options':{'raw':!![],'where':{'role':_0xbd9f('0xe')},'attributes':['id',_0xbd9f('0x3'),_0xbd9f('0x5'),_0xbd9f('0xf')]},'log':'getTelephones'});};};exports[_0xbd9f('0x10')]=function(_0x3bbbc0,_0x19ef67,_0x12b4b8){return client[_0xbd9f('0x2')](_0xbd9f('0x11'),{'body':{'type':_0x19ef67,'uniqueid':_0x12b4b8},'options':{'where':{'id':_0x3bbbc0['id']}},'log':_0xbd9f('0x10')});};exports[_0xbd9f('0x12')]=function(_0x339564){return client[_0xbd9f('0x2')](_0xbd9f('0x13'),{'body':{},'options':{'where':{'id':_0x339564['id']}},'log':'savePause'});};exports[_0xbd9f('0x14')]=function(_0xae5813){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':'agent','id':_0xae5813},'attributes':['id',_0xbd9f('0x3'),_0xbd9f('0x4'),_0xbd9f('0x5'),_0xbd9f('0x6'),_0xbd9f('0x7'),'lastLoginAt','pauseType',_0xbd9f('0x15'),_0xbd9f('0xa'),'interface']},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9b25814..a4d6d3f 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 _0xccea=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xccea,0x198));var _0xacce=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xccea[_0x1b828b];return _0x98da1a;};'use strict';var client=require(_0xacce('0x0'));exports['create']=function(_0x21e566){return client[_0xacce('0x1')](_0xacce('0x2'),{'body':_0x21e566,'log':_0xacce('0x2')});};exports[_0xacce('0x3')]=function(_0x378c24,_0x31172d,_0x15f11b){return client[_0xacce('0x1')](_0xacce('0x4'),{'body':_0x378c24,'options':{'where':{'uniqueid':_0x31172d,'interface':_0x15f11b,'agentcomplete':!![]}},'log':_0xacce('0x4')});}; \ No newline at end of file +var _0x7ea8=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x3f69c2,_0x332698){var _0x52f1be=function(_0x1582c0){while(--_0x1582c0){_0x3f69c2['push'](_0x3f69c2['shift']());}};_0x52f1be(++_0x332698);}(_0x7ea8,0x1d1));var _0x87ea=function(_0x15ab4e,_0x2d2b5c){_0x15ab4e=_0x15ab4e-0x0;var _0x7ca3fa=_0x7ea8[_0x15ab4e];return _0x7ca3fa;};'use strict';var client=require(_0x87ea('0x0'));exports[_0x87ea('0x1')]=function(_0x12f3aa){return client[_0x87ea('0x2')](_0x87ea('0x3'),{'body':_0x12f3aa,'log':'CreateVoiceAgentReport'});};exports[_0x87ea('0x4')]=function(_0x13d857,_0x3580b3,_0x5586af){return client['Request'](_0x87ea('0x5'),{'body':_0x13d857,'options':{'where':{'uniqueid':_0x3580b3,'interface':_0x5586af,'agentcomplete':!![]}},'log':_0x87ea('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 10bcac6..c915d89 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 _0xe7fb=['format','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','moment','util','lodash','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','Request','GetVoiceCallReport','outbound','startOf','day'];(function(_0xd6e28a,_0x34396f){var _0x13a821=function(_0x384793){while(--_0x384793){_0xd6e28a['push'](_0xd6e28a['shift']());}};_0x13a821(++_0x34396f);}(_0xe7fb,0x191));var _0xbe7f=function(_0x36cd1b,_0x486b7f){_0x36cd1b=_0x36cd1b-0x0;var _0x3873d9=_0xe7fb[_0x36cd1b];return _0x3873d9;};'use strict';var moment=require(_0xbe7f('0x0'));var util=require(_0xbe7f('0x1'));var _=require(_0xbe7f('0x2'));var client=require('../client');exports['create']=function(_0x2bb58f){return client['Request'](_0xbe7f('0x3'),{'body':_[_0xbe7f('0x4')](_0x2bb58f,{'source':_0x2bb58f[_0xbe7f('0x5')],'destinationcontext':_0x2bb58f['context'],'callerid':_0x2bb58f[_0xbe7f('0x6')],'amaflags':_0xbe7f('0x7')}),'log':_0xbe7f('0x3')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xbe7f('0x8')](_0xbe7f('0x9'),{'options':{'where':{'type':[_0xbe7f('0xa')],'createdAt':{'$between':[moment()[_0xbe7f('0xb')](_0xbe7f('0xc'))[_0xbe7f('0xd')](_0xbe7f('0xe')),moment()['endOf'](_0xbe7f('0xc'))[_0xbe7f('0xd')](_0xbe7f('0xe'))]}},'attributes':['type',_0xbe7f('0xf'),_0xbe7f('0x10'),_0xbe7f('0x11')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xe113=['merge','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe113,0x1f1));var _0x3e11=function(_0x50a07c,_0x416d7a){_0x50a07c=_0x50a07c-0x0;var _0xdf8e4c=_0xe113[_0x50a07c];return _0xdf8e4c;};'use strict';var moment=require(_0x3e11('0x0'));var util=require(_0x3e11('0x1'));var _=require(_0x3e11('0x2'));var client=require(_0x3e11('0x3'));exports[_0x3e11('0x4')]=function(_0x589590){return client[_0x3e11('0x5')](_0x3e11('0x6'),{'body':_[_0x3e11('0x7')](_0x589590,{'source':_0x589590['calleridnum'],'destinationcontext':_0x589590[_0x3e11('0x8')],'callerid':_0x589590[_0x3e11('0x9')],'amaflags':_0x3e11('0xa')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x3e11('0x5')](_0x3e11('0xb'),{'options':{'where':{'type':[_0x3e11('0xc')],'createdAt':{'$between':[moment()['startOf'](_0x3e11('0xd'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x3e11('0xe')]('day')[_0x3e11('0xf')](_0x3e11('0x10'))]}},'attributes':[_0x3e11('0x11'),_0x3e11('0x12'),'duration',_0x3e11('0x13')]},'log':_0x3e11('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 8fee59f..a57940c 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 _0x16d3=['../client','create','Request','CreateVoiceDialReport'];(function(_0x2e4c95,_0x43513b){var _0x4c595c=function(_0x2c5106){while(--_0x2c5106){_0x2e4c95['push'](_0x2e4c95['shift']());}};_0x4c595c(++_0x43513b);}(_0x16d3,0x128));var _0x316d=function(_0x4d93c9,_0x4775ae){_0x4d93c9=_0x4d93c9-0x0;var _0x48536d=_0x16d3[_0x4d93c9];return _0x48536d;};'use strict';var client=require(_0x316d('0x0'));exports[_0x316d('0x1')]=function(_0x1b956d){return client[_0x316d('0x2')](_0x316d('0x3'),{'body':_0x1b956d,'log':_0x316d('0x3')});}; \ No newline at end of file +var _0xbd64=['Request','CreateVoiceDialReport','../client','create'];(function(_0xe0a974,_0x421f81){var _0xf3deff=function(_0x9578cb){while(--_0x9578cb){_0xe0a974['push'](_0xe0a974['shift']());}};_0xf3deff(++_0x421f81);}(_0xbd64,0xb6));var _0x4bd6=function(_0x40337e,_0x40abfb){_0x40337e=_0x40337e-0x0;var _0x3abe5b=_0xbd64[_0x40337e];return _0x3abe5b;};'use strict';var client=require(_0x4bd6('0x0'));exports[_0x4bd6('0x1')]=function(_0x240a78){return client[_0x4bd6('0x2')](_0x4bd6('0x3'),{'body':_0x240a78,'log':_0x4bd6('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a464253..90c9880 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 _0x132f=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x36c3c7,_0x52f866){var _0x52bc17=function(_0x2bd0f0){while(--_0x2bd0f0){_0x36c3c7['push'](_0x36c3c7['shift']());}};_0x52bc17(++_0x52f866);}(_0x132f,0x182));var _0xf132=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x132f[_0x147497];return _0x35f45;};'use strict';var client=require(_0xf132('0x0'));exports[_0xf132('0x1')]=function(){return function(){return client[_0xf132('0x2')](_0xf132('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf132('0x4'),_0xf132('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x3c66=['exten','recordingFormat','getVoiceExtensions','GetVoiceExtension'];(function(_0xcd4d8e,_0x1fc2fd){var _0x1c3c61=function(_0x293f3c){while(--_0x293f3c){_0xcd4d8e['push'](_0xcd4d8e['shift']());}};_0x1c3c61(++_0x1fc2fd);}(_0x3c66,0x8b));var _0x63c6=function(_0x51a8b4,_0xbf4897){_0x51a8b4=_0x51a8b4-0x0;var _0x587c09=_0x3c66[_0x51a8b4];return _0x587c09;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x63c6('0x0'),{'options':{'raw':!![],'attributes':['id',_0x63c6('0x1'),_0x63c6('0x2')],'where':{'VoiceExtensionId':null}},'log':_0x63c6('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 45536cf..592cf62 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 _0x9b28=['dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','../client','getVoiceQueues','Request','acwTimeout','monitor_format','type','dialActive'];(function(_0x252b3b,_0x5b7751){var _0x44becc=function(_0x1514f6){while(--_0x1514f6){_0x252b3b['push'](_0x252b3b['shift']());}};_0x44becc(++_0x5b7751);}(_0x9b28,0x1b9));var _0x89b2=function(_0x5b6923,_0x54ae85){_0x5b6923=_0x5b6923-0x0;var _0x99c07e=_0x9b28[_0x5b6923];return _0x99c07e;};'use strict';var client=require(_0x89b2('0x0'));exports[_0x89b2('0x1')]=function(){return function(){return client[_0x89b2('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id','name','acw',_0x89b2('0x3'),'autopause',_0x89b2('0x4'),_0x89b2('0x5'),_0x89b2('0x6'),_0x89b2('0x7'),'dialLimitChannel','dialLimitQueue',_0x89b2('0x8'),_0x89b2('0x9'),_0x89b2('0xa'),_0x89b2('0xb'),_0x89b2('0xc'),_0x89b2('0xd'),_0x89b2('0xe'),'dialQueueOptions','dialQueueTimeout',_0x89b2('0xf'),'dialCongestionMaxRetry',_0x89b2('0x10'),_0x89b2('0x11'),'dialBusyRetryFrequency',_0x89b2('0x12'),_0x89b2('0x13'),_0x89b2('0x14'),'dialTimezone',_0x89b2('0x15'),_0x89b2('0x16'),'dialCheckDuplicateType',_0x89b2('0x17'),_0x89b2('0x18'),_0x89b2('0x19'),_0x89b2('0x1a'),_0x89b2('0x1b'),_0x89b2('0x1c'),_0x89b2('0x1d'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0x89b2('0x1e'),_0x89b2('0x1f'),_0x89b2('0x20'),_0x89b2('0x21'),_0x89b2('0x22'),_0x89b2('0x23'),_0x89b2('0x4'),'strategy',_0x89b2('0x24'),_0x89b2('0x25'),_0x89b2('0x26'),_0x89b2('0x27'),_0x89b2('0x28'),_0x89b2('0x29'),'dialAbandonedMaxRetry','dialAbandonedRetryFrequency',_0x89b2('0x2a'),_0x89b2('0x2b'),_0x89b2('0x2c'),_0x89b2('0x2d'),'mandatoryDisposition',_0x89b2('0x2e'),_0x89b2('0x2f')],'include':[{'model':'Trunk','as':_0x89b2('0x30'),'attributes':['id',_0x89b2('0x31'),_0x89b2('0x32'),_0x89b2('0x33')]},{'model':_0x89b2('0x34'),'as':_0x89b2('0x35'),'attributes':['id','name']},{'model':'Trunk','as':_0x89b2('0x36'),'attributes':['id',_0x89b2('0x31'),_0x89b2('0x32'),_0x89b2('0x33')]},{'model':_0x89b2('0x37'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0x89b2('0x37'),'as':'Intervals','attributes':['id',_0x89b2('0x31'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x11ac=['Request','GetVoiceQueue','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','Trunk','name','callerid','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues'];(function(_0x9da4a0,_0xf70b53){var _0x505857=function(_0x516ffc){while(--_0x516ffc){_0x9da4a0['push'](_0x9da4a0['shift']());}};_0x505857(++_0xf70b53);}(_0x11ac,0x1a2));var _0xc11a=function(_0xf4a280,_0xdeedbc){_0xf4a280=_0xf4a280-0x0;var _0x15cbcc=_0x11ac[_0xf4a280];return _0x15cbcc;};'use strict';var client=require(_0xc11a('0x0'));exports[_0xc11a('0x1')]=function(){return function(){return client[_0xc11a('0x2')](_0xc11a('0x3'),{'options':{'raw':![],'attributes':['id','name','acw','acwTimeout',_0xc11a('0x4'),_0xc11a('0x5'),_0xc11a('0x6'),_0xc11a('0x7'),_0xc11a('0x8'),_0xc11a('0x9'),_0xc11a('0xa'),'dialPowerLevel',_0xc11a('0xb'),_0xc11a('0xc'),_0xc11a('0xd'),_0xc11a('0xe'),_0xc11a('0xf'),_0xc11a('0x10'),_0xc11a('0x11'),_0xc11a('0x12'),'dialQueueProject',_0xc11a('0x13'),_0xc11a('0x14'),'dialBusyMaxRetry',_0xc11a('0x15'),_0xc11a('0x16'),_0xc11a('0x17'),_0xc11a('0x18'),'dialTimezone',_0xc11a('0x19'),_0xc11a('0x1a'),_0xc11a('0x1b'),_0xc11a('0x1c'),_0xc11a('0x1d'),_0xc11a('0x1e'),_0xc11a('0x1f'),_0xc11a('0x20'),_0xc11a('0x21'),_0xc11a('0x22'),_0xc11a('0x23'),_0xc11a('0x24'),_0xc11a('0x25'),_0xc11a('0x26'),'dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt',_0xc11a('0x27'),_0xc11a('0x28'),_0xc11a('0x29'),_0xc11a('0x5'),'strategy',_0xc11a('0x2a'),_0xc11a('0x2b'),_0xc11a('0x2c'),_0xc11a('0x2d'),_0xc11a('0x2e'),'dialDropRetryFrequency',_0xc11a('0x2f'),_0xc11a('0x30'),_0xc11a('0x31'),'dialMachineRetryFrequency',_0xc11a('0x32'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0xc11a('0x33'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':'Trunk','as':_0xc11a('0x34'),'attributes':['id',_0xc11a('0x35'),_0xc11a('0x36'),'active']},{'model':'Pause','as':_0xc11a('0x37'),'attributes':['id',_0xc11a('0x35')]},{'model':_0xc11a('0x34'),'as':_0xc11a('0x38'),'attributes':['id',_0xc11a('0x35'),_0xc11a('0x36'),'active']},{'model':'Interval','as':_0xc11a('0x39'),'attributes':['id',_0xc11a('0x35')],'include':[{'model':_0xc11a('0x39'),'as':_0xc11a('0x3a'),'attributes':['id',_0xc11a('0x35'),_0xc11a('0x3b')]}]}]},'log':_0xc11a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4094b2d..1c6637b 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 _0x5d40=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','lodash','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerleaveAt','queuecallercomplete'];(function(_0x42ea05,_0x29050a){var _0x8e3adf=function(_0x3e6679){while(--_0x3e6679){_0x42ea05['push'](_0x42ea05['shift']());}};_0x8e3adf(++_0x29050a);}(_0x5d40,0x145));var _0x05d4=function(_0x49f144,_0x595809){_0x49f144=_0x49f144-0x0;var _0x4c0335=_0x5d40[_0x49f144];return _0x4c0335;};'use strict';var moment=require(_0x05d4('0x0'));var _=require(_0x05d4('0x1'));var client=require(_0x05d4('0x2'));exports[_0x05d4('0x3')]=function(_0x487c32){return client[_0x05d4('0x4')](_0x05d4('0x5'),{'body':_0x487c32,'log':_0x05d4('0x5')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x05d4('0x4')](_0x05d4('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x05d4('0x7')](_0x05d4('0x8'))[_0x05d4('0x9')](_0x05d4('0xa')),moment()['endOf'](_0x05d4('0x8'))[_0x05d4('0x9')](_0x05d4('0xa'))]}},'attributes':[_0x05d4('0xb'),_0x05d4('0xc'),'queuecallerjoinAt',_0x05d4('0xd'),_0x05d4('0xe'),_0x05d4('0xf'),_0x05d4('0x10'),_0x05d4('0x11'),_0x05d4('0x12'),'queuecallerabandonAt']},'log':_0x05d4('0x13')});};}; \ No newline at end of file +var _0x176a=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','moment','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf'];(function(_0x9c5ebe,_0x19884c){var _0x39a068=function(_0x9a0fd6){while(--_0x9a0fd6){_0x9c5ebe['push'](_0x9c5ebe['shift']());}};_0x39a068(++_0x19884c);}(_0x176a,0x8a));var _0xa176=function(_0x2c43e0,_0x1b7d5c){_0x2c43e0=_0x2c43e0-0x0;var _0x30f3e5=_0x176a[_0x2c43e0];return _0x30f3e5;};'use strict';var moment=require(_0xa176('0x0'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x2f4d2d){return client[_0xa176('0x1')]('CreateVoiceQueueReport',{'body':_0x2f4d2d,'log':_0xa176('0x2')});};exports[_0xa176('0x3')]=function(){return function(){return client[_0xa176('0x1')](_0xa176('0x4'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xa176('0x5')](_0xa176('0x6'))[_0xa176('0x7')](_0xa176('0x8')),moment()[_0xa176('0x9')](_0xa176('0x6'))[_0xa176('0x7')](_0xa176('0x8'))]}},'attributes':[_0xa176('0xa'),_0xa176('0xb'),'queuecallerjoinAt',_0xa176('0xc'),_0xa176('0xd'),_0xa176('0xe'),_0xa176('0xf'),'queuecallerexitAt',_0xa176('0x10'),_0xa176('0x11')]},'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 6930567..9aa6d17 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 _0x14f3=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x14f3,0xd9));var _0x314f=function(_0x3ccf48,_0x1a0852){_0x3ccf48=_0x3ccf48-0x0;var _0x7942be=_0x14f3[_0x3ccf48];return _0x7942be;};'use strict';var client=require('../client');exports[_0x314f('0x0')]=function(_0x465556){return function(){return client[_0x314f('0x1')](_0x314f('0x2'),{'options':{'where':{'VoiceQueueId':_0x465556,'paused':!![]},'raw':!![]},'log':_0x314f('0x0')});};}; \ No newline at end of file +var _0x8b06=['Request','../client','getVoiceQueueRtPauses'];(function(_0x54ad5e,_0x5eeeb5){var _0x25af4c=function(_0x48f252){while(--_0x48f252){_0x54ad5e['push'](_0x54ad5e['shift']());}};_0x25af4c(++_0x5eeeb5);}(_0x8b06,0xb2));var _0x68b0=function(_0x145c7c,_0x4bdb5c){_0x145c7c=_0x145c7c-0x0;var _0x4dcdad=_0x8b06[_0x145c7c];return _0x4dcdad;};'use strict';var client=require(_0x68b0('0x0'));exports[_0x68b0('0x1')]=function(_0x2858ea){return function(){return client[_0x68b0('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x2858ea,'paused':!![]},'raw':!![]},'log':_0x68b0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index fae29be..203d966 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 _0x485a=['merge','monitorFilename','lodash','../client','create','Request','CreateVoiceRecording'];(function(_0x54a551,_0x383e81){var _0x1393f0=function(_0x4c2e83){while(--_0x4c2e83){_0x54a551['push'](_0x54a551['shift']());}};_0x1393f0(++_0x383e81);}(_0x485a,0x79));var _0xa485=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x485a[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0xa485('0x0'));var client=require(_0xa485('0x1'));exports[_0xa485('0x2')]=function(_0x2310ac){return client[_0xa485('0x3')](_0xa485('0x4'),{'body':_[_0xa485('0x5')](_0x2310ac,{'value':_0x2310ac[_0xa485('0x6')]}),'log':_0xa485('0x4')});}; \ No newline at end of file +var _0x22dd=['create','Request','CreateVoiceRecording','merge','monitorFilename','lodash','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22dd,0x75));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd22d('0x0'));var client=require(_0xd22d('0x1'));exports[_0xd22d('0x2')]=function(_0x563df5){return client[_0xd22d('0x3')](_0xd22d('0x4'),{'body':_[_0xd22d('0x5')](_0x563df5,{'value':_0x563df5[_0xd22d('0x6')]}),'log':_0xd22d('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 745d7a8..f7c8755 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 _0xc540=['transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum'];(function(_0x46ec48,_0x1203c6){var _0x102783=function(_0x102b61){while(--_0x102b61){_0x46ec48['push'](_0x46ec48['shift']());}};_0x102783(++_0x1203c6);}(_0xc540,0x85));var _0x0c54=function(_0x4d35df,_0x3edb28){_0x4d35df=_0x4d35df-0x0;var _0x42aae0=_0xc540[_0x4d35df];return _0x42aae0;};'use strict';var client=require(_0x0c54('0x0'));exports[_0x0c54('0x1')]=function(_0x52edbd){return client[_0x0c54('0x2')](_0x0c54('0x3'),{'body':{'result':_0x52edbd[_0x0c54('0x4')],'transfererchannel':_0x52edbd[_0x0c54('0x5')],'transferercalleridnum':_0x52edbd[_0x0c54('0x6')],'transferercalleridname':_0x52edbd[_0x0c54('0x7')],'transfererconnectedlinenum':_0x52edbd['transfererconnectedlinenum'],'transfererconnectedlinename':_0x52edbd['transfererconnectedlinename'],'transfereraccountcode':_0x52edbd[_0x0c54('0x8')],'transferercontext':_0x52edbd['transferercontext'],'transfererexten':_0x52edbd[_0x0c54('0x9')],'transfererlinkedid':_0x52edbd[_0x0c54('0xa')],'transfereechannel':_0x52edbd[_0x0c54('0xb')],'transfereecalleridnum':_0x52edbd[_0x0c54('0xc')],'transfereecalleridname':_0x52edbd['transfereecalleridname'],'transfereeconnectedlinenum':_0x52edbd[_0x0c54('0xd')],'transfereeconnectedlinename':_0x52edbd[_0x0c54('0xe')],'transfereeaccountcode':_0x52edbd[_0x0c54('0xf')],'transfereecontext':_0x52edbd[_0x0c54('0x10')],'transfereeexten':_0x52edbd[_0x0c54('0x11')],'transfereelinkedid':_0x52edbd[_0x0c54('0x12')],'isexternal':_0x52edbd[_0x0c54('0x13')],'context':_0x52edbd[_0x0c54('0x14')],'extension':_0x52edbd[_0x0c54('0x15')],'type':_0x0c54('0x16')},'log':_0x0c54('0x3')});};exports[_0x0c54('0x17')]=function(_0x18e3c5){return client[_0x0c54('0x2')](_0x0c54('0x3'),{'body':{'result':_0x18e3c5['result'],'transfererchannel':_0x18e3c5[_0x0c54('0x18')],'transferercalleridnum':_0x18e3c5[_0x0c54('0x19')],'transferercalleridname':_0x18e3c5[_0x0c54('0x1a')],'transfererconnectedlinenum':_0x18e3c5[_0x0c54('0x1b')],'transfererconnectedlinename':_0x18e3c5[_0x0c54('0x1c')],'transfereraccountcode':_0x18e3c5[_0x0c54('0x1d')],'transferercontext':_0x18e3c5[_0x0c54('0x1e')],'transfererexten':_0x18e3c5[_0x0c54('0x1f')],'transfererlinkedid':_0x18e3c5[_0x0c54('0x20')],'transfereechannel':_0x18e3c5[_0x0c54('0x21')],'transfereecalleridnum':_0x18e3c5[_0x0c54('0x22')],'transfereecalleridname':_0x18e3c5[_0x0c54('0x23')],'transfereeconnectedlinenum':_0x18e3c5[_0x0c54('0x24')],'transfereeconnectedlinename':_0x18e3c5[_0x0c54('0x25')],'transfereeaccountcode':_0x18e3c5['transfertargetaccountcode'],'transfereecontext':_0x18e3c5['transfertargetcontext'],'transfereeexten':_0x18e3c5[_0x0c54('0x26')],'transfereelinkedid':_0x18e3c5[_0x0c54('0x27')],'isexternal':_0x18e3c5['isexternal'],'context':_0x18e3c5[_0x0c54('0x28')],'extension':_0x18e3c5['origtransfererexten'],'type':_0x0c54('0x29')},'log':_0x0c54('0x3')});}; \ No newline at end of file +var _0x42c0=['origtransfererlinkedid','transfertargetcalleridnum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext'];(function(_0x54a4b6,_0x2bb326){var _0x32ed67=function(_0x4602f5){while(--_0x4602f5){_0x54a4b6['push'](_0x54a4b6['shift']());}};_0x32ed67(++_0x2bb326);}(_0x42c0,0xa8));var _0x042c=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x42c0[_0x2112d4];return _0x434972;};'use strict';var client=require(_0x042c('0x0'));exports[_0x042c('0x1')]=function(_0x213cdd){return client[_0x042c('0x2')](_0x042c('0x3'),{'body':{'result':_0x213cdd['result'],'transfererchannel':_0x213cdd[_0x042c('0x4')],'transferercalleridnum':_0x213cdd[_0x042c('0x5')],'transferercalleridname':_0x213cdd[_0x042c('0x6')],'transfererconnectedlinenum':_0x213cdd[_0x042c('0x7')],'transfererconnectedlinename':_0x213cdd[_0x042c('0x8')],'transfereraccountcode':_0x213cdd[_0x042c('0x9')],'transferercontext':_0x213cdd[_0x042c('0xa')],'transfererexten':_0x213cdd['transfererexten'],'transfererlinkedid':_0x213cdd[_0x042c('0xb')],'transfereechannel':_0x213cdd[_0x042c('0xc')],'transfereecalleridnum':_0x213cdd[_0x042c('0xd')],'transfereecalleridname':_0x213cdd['transfereecalleridname'],'transfereeconnectedlinenum':_0x213cdd[_0x042c('0xe')],'transfereeconnectedlinename':_0x213cdd[_0x042c('0xf')],'transfereeaccountcode':_0x213cdd[_0x042c('0x10')],'transfereecontext':_0x213cdd[_0x042c('0x11')],'transfereeexten':_0x213cdd[_0x042c('0x12')],'transfereelinkedid':_0x213cdd[_0x042c('0x13')],'isexternal':_0x213cdd[_0x042c('0x14')],'context':_0x213cdd[_0x042c('0x15')],'extension':_0x213cdd[_0x042c('0x16')],'type':_0x042c('0x17')},'log':_0x042c('0x3')});};exports[_0x042c('0x18')]=function(_0x50f6d7){return client[_0x042c('0x2')](_0x042c('0x3'),{'body':{'result':_0x50f6d7['result'],'transfererchannel':_0x50f6d7[_0x042c('0x19')],'transferercalleridnum':_0x50f6d7[_0x042c('0x1a')],'transferercalleridname':_0x50f6d7[_0x042c('0x1b')],'transfererconnectedlinenum':_0x50f6d7[_0x042c('0x1c')],'transfererconnectedlinename':_0x50f6d7[_0x042c('0x1d')],'transfereraccountcode':_0x50f6d7[_0x042c('0x1e')],'transferercontext':_0x50f6d7[_0x042c('0x1f')],'transfererexten':_0x50f6d7['secondtransfererexten'],'transfererlinkedid':_0x50f6d7[_0x042c('0x20')],'transfereechannel':_0x50f6d7['transfertargetchannel'],'transfereecalleridnum':_0x50f6d7[_0x042c('0x21')],'transfereecalleridname':_0x50f6d7['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x50f6d7['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x50f6d7[_0x042c('0x22')],'transfereeaccountcode':_0x50f6d7[_0x042c('0x23')],'transfereecontext':_0x50f6d7[_0x042c('0x24')],'transfereeexten':_0x50f6d7['transfertargetexten'],'transfereelinkedid':_0x50f6d7[_0x042c('0x25')],'isexternal':_0x50f6d7[_0x042c('0x14')],'context':_0x50f6d7[_0x042c('0x26')],'extension':_0x50f6d7[_0x042c('0x27')],'type':'attended'},'log':_0x042c('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 01775d5..a8e006c 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 _0x4b02=['AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','moment','../ami','format','%s/%s','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action','message','catch','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','map','find','uniqueid','channel','filename','ai(mixmonitorid)','then','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','resolve','destinationchannel','StopMixMonitor','monitors','status','%s.%s','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','exten','context','telephones','trunks','outbound','campaigns','run','Event\x20name\x20mandatory','emit','event','faxAccounts','server','listen','127.0.0.1','log'];(function(_0xc60e53,_0x36c0f9){var _0x1a8490=function(_0x325cf2){while(--_0x325cf2){_0xc60e53['push'](_0xc60e53['shift']());}};_0x1a8490(++_0x36c0f9);}(_0x4b02,0x185));var _0x24b0=function(_0xca7d3b,_0x190ec6){_0xca7d3b=_0xca7d3b-0x0;var _0x1fcfce=_0x4b02[_0xca7d3b];return _0x1fcfce;};'use strict';var _=require('lodash');var util=require(_0x24b0('0x0'));var jayson=require(_0x24b0('0x1'));var schema=require(_0x24b0('0x2'));var BPromise=require('bluebird');var moment=require(_0x24b0('0x3'));var config=require('../../../config/environment');var properties=require('../properties');var ami=require(_0x24b0('0x4'));exports['listen']=function(_0x538244,_0x2cf43d,_0x76d874){return new BPromise(function(_0x3da253,_0x3aef40){var _0x2904b2={'QueuePause':function(_0x5e3aab){return new Promise(function(_0xd8a8ec,_0x3ad6f7){var _0x444756=util[_0x24b0('0x5')](_0x24b0('0x6'),'SIP',_0x5e3aab[_0x24b0('0x7')]);if(_0x538244[_0x24b0('0x8')]&&_0x538244[_0x24b0('0x8')][_0x444756]&&_0x538244['timers'][_0x444756]['timer']){_0x538244[_0x24b0('0x8')][_0x444756][_0x24b0('0x9')]();}if(_0x538244[_0x24b0('0xa')][_0x444756]){_0x538244[_0x24b0('0xa')][_0x444756][_0x24b0('0xb')]({'statePause':_0x5e3aab[_0x24b0('0xc')]?!![]:![]});}_0xd8a8ec({'code':0xc8,'message':_0x24b0('0xd')});});},'Reload':function(_0x5b0244){var _0x5b10d5=this;return new Promise(function(_0x9364b,_0x154b2a){if(ami[_0x24b0('0xe')]()==![]){return _0x154b2a(_0x5b10d5[_0x24b0('0xf')](0x1f4,[config[_0x24b0('0x10')]['ip'],config[_0x24b0('0x10')][_0x24b0('0x11')],_0x24b0('0x12')][_0x24b0('0x13')]('\x20')));}_0x5b0244=_[_0x24b0('0x14')](_0x5b0244,_[_0x24b0('0x15')](properties['module']));_0x5b0244[_0x24b0('0x16')]=_0x24b0('0x17');return ami[_0x24b0('0x18')](_0x5b0244)['then'](function(_0x3ced67){_0x9364b({'code':0xc8,'message':_0x3ced67[_0x24b0('0x19')]});})[_0x24b0('0x1a')](function(_0x396679){_0x154b2a(_0x5b10d5[_0x24b0('0xf')](0x1f5,_0x396679['message']));});});},'Command':function(_0x3caf0f){var _0x47370a=this;return new Promise(function(_0x12b620,_0x50eb44){if(ami[_0x24b0('0xe')]()==![]){return _0x50eb44(_0x47370a[_0x24b0('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x24b0('0x11')],_0x24b0('0x12')][_0x24b0('0x13')]('\x20')));}_0x3caf0f=_[_0x24b0('0x14')](_0x3caf0f,_0x24b0('0x1b'));_0x3caf0f['action']=_0x24b0('0x1c');return ami[_0x24b0('0x18')](_0x3caf0f)['then'](function(_0x53e521){_0x12b620({'code':0xc8,'message':_0x53e521[_0x24b0('0x1d')]});})[_0x24b0('0x1a')](function(_0x1c6bcf){_0x50eb44(_0x47370a[_0x24b0('0xf')](0x1f5,_0x1c6bcf[_0x24b0('0x19')]));});});},'VoiceQueues':function(_0x53c14b){return new Promise(function(_0x28752e,_0x3bc6b9){var _0x2b9a69=[];for(var _0x4b6acd in _0x538244['voiceQueues']){if(_0x538244[_0x24b0('0x1e')][_0x24b0('0x1f')](_0x4b6acd)){var _0xa72618=_0x538244[_0x24b0('0x1e')][_0x4b6acd];var _0x2c3908={'id':_0xa72618['id'],'name':_0xa72618[_0x24b0('0x7')],'strategy':_0xa72618[_0x24b0('0x20')],'answered':_0xa72618['answered'],'available':_0xa72618[_0x24b0('0x21')],'loggedIn':_0xa72618['loggedIn'],'pTalking':_0xa72618[_0x24b0('0x22')],'sumBillable':_0xa72618[_0x24b0('0x23')],'sumDuration':_0xa72618['sumDuration'],'sumHoldTime':_0xa72618[_0x24b0('0x24')]||0x0,'talking':_0xa72618[_0x24b0('0x25')],'total':_0xa72618[_0x24b0('0x26')],'type':_0xa72618[_0x24b0('0x27')],'unmanaged':_0xa72618[_0x24b0('0x28')],'abandoned':_0xa72618[_0x24b0('0x29')],'waiting':_0xa72618[_0x24b0('0x2a')],'loggedInDb':_0xa72618[_0x24b0('0x2b')]};if(_0xa72618[_0x24b0('0x27')]==='outbound'){_0x2c3908['dialActive']=_0xa72618['dialActive'];_0x2c3908[_0x24b0('0x2c')]=_0xa72618[_0x24b0('0x2c')];_0x2c3908[_0x24b0('0x2d')]=_0xa72618[_0x24b0('0x2d')];_0x2c3908[_0x24b0('0x2e')]=_0xa72618[_0x24b0('0x2e')];_0x2c3908[_0x24b0('0x2f')]=_0xa72618['dialOriginateTimeout'];_0x2c3908[_0x24b0('0x30')]=_0xa72618[_0x24b0('0x30')];_0x2c3908[_0x24b0('0x31')]=_0xa72618[_0x24b0('0x31')];_0x2c3908['outboundAnswerCallsDay']=_0xa72618[_0x24b0('0x32')];_0x2c3908[_0x24b0('0x33')]=_0xa72618[_0x24b0('0x33')];_0x2c3908[_0x24b0('0x34')]=_0xa72618[_0x24b0('0x34')];_0x2c3908['outboundCongestionCallsDay']=_0xa72618['outboundCongestionCallsDay'];_0x2c3908[_0x24b0('0x35')]=_0xa72618[_0x24b0('0x35')];_0x2c3908[_0x24b0('0x36')]=_0xa72618[_0x24b0('0x36')];_0x2c3908[_0x24b0('0x37')]=_0xa72618['outboundDropCallsDayTimeout'];_0x2c3908['outboundNoAnswerCallsDay']=_0xa72618[_0x24b0('0x38')];_0x2c3908[_0x24b0('0x39')]=_0xa72618[_0x24b0('0x39')];_0x2c3908[_0x24b0('0x3a')]=_0xa72618[_0x24b0('0x3a')];_0x2c3908[_0x24b0('0x3b')]=_0xa72618['outboundReCallsDay'];_0x2c3908[_0x24b0('0x3c')]=_0xa72618[_0x24b0('0x3c')];_0x2c3908['outboundUnknownCallsDay']=_0xa72618['outboundUnknownCallsDay'];_0x2c3908[_0x24b0('0x3d')]=_0xa72618['predictiveIntervalAnsweredCalls'];_0x2c3908['predictiveIntervalAvgHoldtime']=_0xa72618[_0x24b0('0x3e')];_0x2c3908[_0x24b0('0x3f')]=_0xa72618['predictiveIntervalAvgTalktime'];_0x2c3908[_0x24b0('0x40')]=_0xa72618['predictiveIntervalDroppedCallsCallersExit'];_0x2c3908['predictiveIntervalDroppedCallsTimeout']=_0xa72618[_0x24b0('0x41')];_0x2c3908[_0x24b0('0x42')]=_0xa72618[_0x24b0('0x42')];_0x2c3908[_0x24b0('0x43')]=_0xa72618[_0x24b0('0x43')];_0x2c3908[_0x24b0('0x44')]=_0xa72618[_0x24b0('0x44')];_0x2c3908[_0x24b0('0x45')]=_0xa72618[_0x24b0('0x45')];_0x2c3908[_0x24b0('0x46')]=_0xa72618[_0x24b0('0x46')];_0x2c3908[_0x24b0('0x47')]=_0xa72618['predictiveIntervalAvailable'];_0x2c3908['predictiveIntervalTotalCalls']=_0xa72618['predictiveIntervalTotalCalls'];_0x2c3908['message']=_0xa72618[_0x24b0('0x19')];_0x2c3908[_0x24b0('0x48')]=_0xa72618[_0x24b0('0x48')];_0x2c3908[_0x24b0('0x49')]=_0xa72618[_0x24b0('0x49')];_0x2c3908[_0x24b0('0x4a')]=_0xa72618[_0x24b0('0x4a')];_0x2c3908[_0x24b0('0x4b')]=_0xa72618[_0x24b0('0x4b')];_0x2c3908['erlangBusyFactor']=_0xa72618['erlangBusyFactor'];_0x2c3908['startPredictive']=_0xa72618[_0x24b0('0x4c')];_0x2c3908[_0x24b0('0x4d')]=_0xa72618[_0x24b0('0x4d')];}if(_0xa72618[_0x24b0('0x4e')]){_0x2c3908[_0x24b0('0x4e')]={'id':_0xa72618[_0x24b0('0x4e')]['id'],'name':_0xa72618[_0x24b0('0x4e')]['name'],'active':_0xa72618[_0x24b0('0x4e')][_0x24b0('0x4f')],'callerid':_0xa72618[_0x24b0('0x4e')][_0x24b0('0x50')]};}if(_0xa72618[_0x24b0('0x51')]){_0x2c3908[_0x24b0('0x51')]={'id':_0xa72618[_0x24b0('0x51')]['id'],'name':_0xa72618['Interval']['name']};}_0x2b9a69[_0x24b0('0x52')](_0x2c3908);}}_0x28752e({'count':_0x2b9a69[_0x24b0('0x53')],'rows':_0x2b9a69});});},'VoiceChannels':function(_0x547aba){return new Promise(function(_0x578354,_0x8dc744){var _0x3d91cc=_[_0x24b0('0x54')](_0x538244[_0x24b0('0x55')]);_0x578354({'count':_0x3d91cc[_0x24b0('0x53')],'rows':_0x3d91cc});});},'VoiceChannelMixMonitor':function(_0x17c006){var _0x51d124=this;return new Promise(function(_0x27980f,_0x5ac56e){if(ami['isConnected']()==![]){return _0x5ac56e(_0x51d124['error'](0x1f4,[config[_0x24b0('0x10')]['ip'],config['asterisk'][_0x24b0('0x11')],'ami\x20disconnected'][_0x24b0('0x13')]('\x20')));}var _0x162978=schema(properties[_0x24b0('0x56')])[_0x24b0('0x2')](_0x17c006);if(_0x162978[_0x24b0('0x53')]>0x0){return _0x5ac56e(_0x51d124[_0x24b0('0xf')](0x1f4,_[_0x24b0('0x57')](_0x162978,'message')['join'](',\x20')));}var _0x24f17c=_[_0x24b0('0x58')](_0x538244['channels'],{'uniqueid':_0x17c006[_0x24b0('0x59')]});if(_0x24f17c&&_0x24f17c[_0x24b0('0x5a')]){var _0x42c064=util[_0x24b0('0x5')]('%s.%s',_0x17c006[_0x24b0('0x5b')]||_0x17c006[_0x24b0('0x59')],_0x17c006[_0x24b0('0x5')]||'wav');return ami[_0x24b0('0x18')]({'action':'MixMonitor','channel':_0x24f17c[_0x24b0('0x5a')],'file':_0x42c064,'options':_0x24b0('0x5c')})[_0x24b0('0x5d')](function(_0x32f7bb){var _0x2364cf=_[_0x24b0('0x58')](_0x24f17c['monitors'],{'filename':_0x24b0('0x5e')+_0x42c064[_0x24b0('0x5f')]()});if(_[_0x24b0('0x60')](_0x2364cf)){_0x24f17c['monitors'][_0x24b0('0x52')]({'filename':_0x24b0('0x5e')+_0x42c064[_0x24b0('0x5f')](),'createdAt':moment()[_0x24b0('0x5')](_0x24b0('0x61')),'mixmonitorid':_0x32f7bb[_0x24b0('0x62')],'status':'rec'});}else{_0x2364cf[_0x24b0('0x62')]=_0x32f7bb[_0x24b0('0x62')];_0x2364cf['status']=_0x24b0('0x63');}_0x27980f({'code':0xc8,'message':[_0x17c006[_0x24b0('0x59')],'MixMonitor\x20Success',_0x32f7bb[_0x24b0('0x62')]][_0x24b0('0x13')]('\x20'),'mixmonitorid':_0x32f7bb[_0x24b0('0x62')]});})[_0x24b0('0x1a')](function(_0x36762d){_0x5ac56e(_0x51d124['error'](0x1f5,[_0x17c006[_0x24b0('0x59')],_0x36762d[_0x24b0('0x19')][_0x24b0('0x5f')]()][_0x24b0('0x13')]('\x20')));});}else{return _0x5ac56e(_0x51d124[_0x24b0('0xf')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0xd3f8ed){var _0xb93ca=this;return new Promise(function(_0x2133cd,_0x495851){if(ami[_0x24b0('0xe')]()==![]){return _0x495851(_0xb93ca[_0x24b0('0xf')](0x1f4,[config['asterisk']['ip'],config[_0x24b0('0x10')][_0x24b0('0x11')],'ami\x20disconnected'][_0x24b0('0x13')]('\x20')));}var _0x3014c3=schema(properties['voicechannel'])[_0x24b0('0x2')](_0xd3f8ed);if(_0x3014c3['length']>0x0){return _0x495851(_0xb93ca[_0x24b0('0xf')](0x1f4,_[_0x24b0('0x57')](_0x3014c3,'message')[_0x24b0('0x13')](',\x20')));}var _0x3e3eaa=_['find'](_0x538244[_0x24b0('0x55')],{'uniqueid':_0xd3f8ed['uniqueid']});if(_0x3e3eaa){return BPromise[_0x24b0('0x64')]()['then'](function(){if(_0x3e3eaa['channel']){return ami['Action']({'action':'StopMixMonitor','channel':_0x3e3eaa[_0x24b0('0x5a')],'mixmonitorid':_0xd3f8ed[_0x24b0('0x62')]})[_0x24b0('0x1a')](function(_0x4c983b){});}})[_0x24b0('0x5d')](function(){if(_0x3e3eaa[_0x24b0('0x65')]){return ami['Action']({'action':_0x24b0('0x66'),'channel':_0x3e3eaa['destinationchannel'],'mixmonitorid':_0xd3f8ed[_0x24b0('0x62')]})['catch'](function(_0x4665eb){});}})['then'](function(_0x3ef399){var _0x484421=_['find'](_0x3e3eaa[_0x24b0('0x67')],{'mixmonitorid':_0xd3f8ed[_0x24b0('0x62')]});if(_0x484421){_0x484421[_0x24b0('0x68')]='stop';}})[_0x24b0('0x5d')](function(){var _0xd1349=util['format'](_0x24b0('0x69'),_0xd3f8ed[_0x24b0('0x5b')]||_0xd3f8ed[_0x24b0('0x59')],_0xd3f8ed[_0x24b0('0x5')]||'wav');var _0x3a1c27=_['find'](_0x3e3eaa[_0x24b0('0x67')],{'filename':_0x24b0('0x5e')+_0xd1349[_0x24b0('0x5f')]()});if(_0x3a1c27){_0x3a1c27[_0x24b0('0x68')]='stop';}})[_0x24b0('0x5d')](function(){_0x2133cd({'code':0xc8,'message':[_0xd3f8ed[_0x24b0('0x59')],_0x24b0('0x6a')]['join']('\x20')});})['catch'](function(_0x146774){_0x495851(_0xb93ca[_0x24b0('0xf')](0x1f5,[_0xd3f8ed[_0x24b0('0x59')],_0x146774[_0x24b0('0x19')][_0x24b0('0x5f')]()][_0x24b0('0x13')]('\x20')));});}else{return _0x495851(_0xb93ca[_0x24b0('0xf')](0x1f5,_0x24b0('0x6b')));}});},'VoiceQueuesChannels':function(_0x1063a1){return new Promise(function(_0x467615,_0x4faa58){var _0x492192=_[_0x24b0('0x54')](_0x538244[_0x24b0('0x6c')]);_0x467615({'count':_0x492192[_0x24b0('0x53')],'rows':_0x492192});});},'VoiceQueuesChannel':function(_0x23e548){var _0x2da245=this;return new Promise(function(_0x2e8371,_0x3ef4b5){var _0x3988b9=schema(properties[_0x24b0('0x6d')])[_0x24b0('0x2')](_0x23e548);if(_0x3988b9[_0x24b0('0x53')]>0x0){return _0x3ef4b5(_0x2da245[_0x24b0('0xf')](0x1f4,_['map'](_0x3988b9,_0x24b0('0x19'))[_0x24b0('0x13')](',\x20')));}var _0x44016a=_['find'](_0x538244[_0x24b0('0x6c')],{'uniqueid':_0x23e548[_0x24b0('0x59')]});if(_0x44016a){_0x2e8371(_0x44016a);}else{return _0x3ef4b5(_0x2da245['error'](0x1f5,_0x24b0('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x10d2e2){var _0x5fd6c4=this;return new Promise(function(_0xd77d43,_0x1a6011){if(ami[_0x24b0('0xe')]()==![]){return _0x1a6011(_0x5fd6c4[_0x24b0('0xf')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x24b0('0x13')]('\x20')));}var _0x501bee=schema(properties[_0x24b0('0x6e')])['validate'](_0x10d2e2);if(_0x501bee[_0x24b0('0x53')]>0x0){return _0x1a6011(_0x5fd6c4[_0x24b0('0xf')](0x1f4,_[_0x24b0('0x57')](_0x501bee,_0x24b0('0x19'))[_0x24b0('0x13')](',\x20')));}var _0x467645=_['find'](_0x538244[_0x24b0('0x6c')],{'uniqueid':_0x10d2e2['uniqueid']});if(_0x467645&&_0x467645[_0x24b0('0x5a')]){return ami['Action']({'action':'Hangup','channel':_0x467645[_0x24b0('0x5a')]})[_0x24b0('0x5d')](function(_0x5ada68){_0xd77d43({'code':0xc8,'message':[_0x10d2e2[_0x24b0('0x59')],_0x5ada68[_0x24b0('0x19')][_0x24b0('0x5f')]()]['join']('\x20')});})[_0x24b0('0x1a')](function(_0x500398){_0x1a6011(_0x5fd6c4['error'](0x1f5,[_0x10d2e2['uniqueid'],_0x500398[_0x24b0('0x19')][_0x24b0('0x5f')]()][_0x24b0('0x13')]('\x20')));});}else{return _0x1a6011(_0x5fd6c4[_0x24b0('0xf')](0x1f5,_0x24b0('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x350c5e){var _0x26ca7e=this;return new Promise(function(_0x332d31,_0x2a00c8){if(ami['isConnected']()==![]){return _0x2a00c8(_0x26ca7e[_0x24b0('0xf')](0x1f4,[config[_0x24b0('0x10')]['ip'],config[_0x24b0('0x10')][_0x24b0('0x11')],_0x24b0('0x12')]['join']('\x20')));}var _0x3a5f1f=schema(properties[_0x24b0('0x6f')])[_0x24b0('0x2')](_0x350c5e);if(_0x3a5f1f[_0x24b0('0x53')]>0x0){return _0x2a00c8(_0x26ca7e[_0x24b0('0xf')](0x1f4,_[_0x24b0('0x57')](_0x3a5f1f,'message')[_0x24b0('0x13')](',\x20')));}var _0x300226=_[_0x24b0('0x58')](_0x538244['queueChannels'],{'uniqueid':_0x350c5e['uniqueid']});if(_0x300226&&_0x300226['channel']){return ami['Action']({'action':'Redirect','channel':_0x300226[_0x24b0('0x5a')],'exten':_0x350c5e[_0x24b0('0x70')],'context':_0x350c5e[_0x24b0('0x71')]||_0x300226[_0x24b0('0x71')],'priority':0x1})[_0x24b0('0x5d')](function(_0x4b9e1b){_0x332d31({'code':0xc8,'message':[_0x350c5e[_0x24b0('0x59')],_0x4b9e1b[_0x24b0('0x19')]['toLowerCase']()]['join']('\x20')});})[_0x24b0('0x1a')](function(_0x4fb5e3){_0x2a00c8(_0x26ca7e[_0x24b0('0xf')](0x1f5,[_0x350c5e[_0x24b0('0x59')],_0x4fb5e3['message'][_0x24b0('0x5f')]()][_0x24b0('0x13')]('\x20')));});}else{return _0x2a00c8(_0x26ca7e['error'](0x1f5,_0x24b0('0x6b')));}});},'Agents':function(_0x557e9){return new Promise(function(_0x54246e,_0x378586){var _0x97e457=_[_0x24b0('0x54')](_0x538244[_0x24b0('0xa')]);_0x54246e({'count':_0x97e457[_0x24b0('0x53')],'rows':_0x97e457});});},'Telephones':function(_0x4fb8f0){return new Promise(function(_0x59c287,_0x208b8b){var _0x1ac102=_['values'](_0x538244[_0x24b0('0x72')]);_0x59c287({'count':_0x1ac102[_0x24b0('0x53')],'rows':_0x1ac102});});},'Trunks':function(_0x15ab8e){return new Promise(function(_0x1e2b60,_0xf6ec8c){var _0x203f8a=_[_0x24b0('0x54')](_0x538244[_0x24b0('0x73')]);_0x1e2b60({'count':_0x203f8a[_0x24b0('0x53')],'rows':_0x203f8a});});},'OutboundChannels':function(_0xae9c6a){return new Promise(function(_0x3bdf9b,_0x2b6e47){var _0x1eeb63=_['values'](_0x538244['outboundChannels']);_0x3bdf9b({'count':_0x1eeb63[_0x24b0('0x53')],'rows':_0x1eeb63});});},'Outbound':function(_0x292271){return new Promise(function(_0x2dd540,_0x5682a6){_0x2dd540(_0x538244[_0x24b0('0x74')]);});},'Campaigns':function(_0x289637){return new Promise(function(_0x577f28,_0x31bba5){var _0x2427af=_[_0x24b0('0x54')](_0x538244[_0x24b0('0x75')]);_0x577f28({'count':_0x2427af['length'],'rows':_0x2427af});});},'VoiceQueuesPreview':function(_0x3af976){var _0x3b1d27=this;return new Promise(function(_0x18a8fb,_0x5dd757){_0x2cf43d[_0x24b0('0x76')](_0x3af976['id'])[_0x24b0('0x5d')](function(_0x55b994){_0x18a8fb({'code':0xc8,'message':_0x55b994[_0x24b0('0x19')]});})[_0x24b0('0x1a')](function(_0xc00024){_0x5dd757(_0x3b1d27[_0x24b0('0xf')](0x1f4,_0xc00024[_0x24b0('0x19')]));});});},'EventManager':function(_0x484dc7){var _0x1020af=this;return new Promise(function(_0x4da6ff,_0x4a2ee5){if(!_0x484dc7['event']){return _0x4a2ee5(_0x1020af['error'](0x1f4,_0x24b0('0x77')));}ami[_0x24b0('0x78')]('custom:'+_0x484dc7[_0x24b0('0x79')],_0x484dc7[_0x24b0('0x19')]);_0x4da6ff({'code':0xc8,'message':_0x484dc7});});},'FaxAccounts':function(_0x367320){return new Promise(function(_0xe758a5,_0x1b94e3){var _0x5a49a9=_[_0x24b0('0x54')](_0x538244[_0x24b0('0x7a')]);_0xe758a5({'count':_0x5a49a9[_0x24b0('0x53')],'rows':_0x5a49a9});});},'SendFax':function(_0x29b34f){var _0x21652e=this;return new Promise(function(_0x4b1925,_0x378f55){_0x76d874['send'](_0x29b34f)['then'](function(_0x5a9347){_0x4b1925({'code':0xc8,'message':_0x5a9347[_0x24b0('0x19')]});})[_0x24b0('0x1a')](function(_0x3268f9){_0x378f55(_0x21652e[_0x24b0('0xf')](0x1f4,_0x3268f9[_0x24b0('0x19')]));});});},'CheckAfterSend':function(_0x2324fc){var _0x528c96=this;return new Promise(function(_0x5ef097,_0x207118){_0x76d874['checkAfterSend'](_0x2324fc)[_0x24b0('0x5d')](function(_0x25022c){_0x5ef097({'code':0xc8,'message':_0x25022c[_0x24b0('0x19')]});})[_0x24b0('0x1a')](function(_0x2c3ee2){_0x207118(_0x528c96['error'](0x1f4,_0x2c3ee2[_0x24b0('0x19')]));});});}};var _0x3a1275=jayson[_0x24b0('0x7b')](_0x2904b2)['http']();_0x3a1275['on'](_0x24b0('0xf'),function(_0x3fe4ac){return _0x3aef40(_0x3fe4ac);});_0x3a1275[_0x24b0('0x7c')](0x232a,_0x24b0('0x7d'),function(){console[_0x24b0('0x7e')](_0x24b0('0x7f'),0x232a);return _0x3da253(_0x24b0('0x80')+0x232a);});});}; \ No newline at end of file +var _0xc088=['emit','custom:','checkAfterSend','http','127.0.0.1','log','lodash','util','validate','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','isConnected','ami\x20disconnected','pick','keys','module','action','Reload','then','message','error','asterisk','join','command','Command','Action','content','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumDuration','talking','total','type','unmanaged','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','username','voicechannel','map','find','channel','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','filename','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','campaigns','run','event','Event\x20name\x20mandatory'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc088,0x110));var _0x8c08=function(_0x4a6c91,_0xe7dfbd){_0x4a6c91=_0x4a6c91-0x0;var _0xb78a45=_0xc088[_0x4a6c91];return _0xb78a45;};'use strict';var _=require(_0x8c08('0x0'));var util=require(_0x8c08('0x1'));var jayson=require('jayson/promise');var schema=require(_0x8c08('0x2'));var BPromise=require('bluebird');var moment=require(_0x8c08('0x3'));var config=require(_0x8c08('0x4'));var properties=require('../properties');var ami=require(_0x8c08('0x5'));exports[_0x8c08('0x6')]=function(_0x191dcf,_0x5bcaf7,_0x3c8917){return new BPromise(function(_0x4ed587,_0x4a80c6){var _0x5d66ec={'QueuePause':function(_0xd4c61d){return new Promise(function(_0x244498,_0x36c382){var _0x2705a9=util[_0x8c08('0x7')](_0x8c08('0x8'),_0x8c08('0x9'),_0xd4c61d[_0x8c08('0xa')]);if(_0x191dcf[_0x8c08('0xb')]&&_0x191dcf[_0x8c08('0xb')][_0x2705a9]&&_0x191dcf[_0x8c08('0xb')][_0x2705a9][_0x8c08('0xc')]){_0x191dcf[_0x8c08('0xb')][_0x2705a9][_0x8c08('0xd')]();}if(_0x191dcf['agents'][_0x2705a9]){_0x191dcf[_0x8c08('0xe')][_0x2705a9]['updateStatusRealtime']({'statePause':_0xd4c61d[_0x8c08('0xf')]?!![]:![]});}_0x244498({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x1261df){var _0x259407=this;return new Promise(function(_0x10e78a,_0x60b76e){if(ami[_0x8c08('0x10')]()==![]){return _0x60b76e(_0x259407['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x8c08('0x11')]['join']('\x20')));}_0x1261df=_[_0x8c08('0x12')](_0x1261df,_[_0x8c08('0x13')](properties[_0x8c08('0x14')]));_0x1261df[_0x8c08('0x15')]=_0x8c08('0x16');return ami['Action'](_0x1261df)[_0x8c08('0x17')](function(_0x4d2288){_0x10e78a({'code':0xc8,'message':_0x4d2288[_0x8c08('0x18')]});})['catch'](function(_0x40ff32){_0x60b76e(_0x259407[_0x8c08('0x19')](0x1f5,_0x40ff32['message']));});});},'Command':function(_0x12a9db){var _0x2f33ef=this;return new Promise(function(_0x2cdcd2,_0x3510e9){if(ami[_0x8c08('0x10')]()==![]){return _0x3510e9(_0x2f33ef[_0x8c08('0x19')](0x1f4,[config[_0x8c08('0x1a')]['ip'],config[_0x8c08('0x1a')]['username'],_0x8c08('0x11')][_0x8c08('0x1b')]('\x20')));}_0x12a9db=_[_0x8c08('0x12')](_0x12a9db,_0x8c08('0x1c'));_0x12a9db[_0x8c08('0x15')]=_0x8c08('0x1d');return ami[_0x8c08('0x1e')](_0x12a9db)[_0x8c08('0x17')](function(_0x2be1ed){_0x2cdcd2({'code':0xc8,'message':_0x2be1ed[_0x8c08('0x1f')]});})[_0x8c08('0x20')](function(_0x3a6694){_0x3510e9(_0x2f33ef[_0x8c08('0x19')](0x1f5,_0x3a6694['message']));});});},'VoiceQueues':function(_0x507755){return new Promise(function(_0x209d33,_0x4d2c13){var _0x3b1bfc=[];for(var _0x45131a in _0x191dcf['voiceQueues']){if(_0x191dcf[_0x8c08('0x21')][_0x8c08('0x22')](_0x45131a)){var _0x32c0ed=_0x191dcf[_0x8c08('0x21')][_0x45131a];var _0x101931={'id':_0x32c0ed['id'],'name':_0x32c0ed[_0x8c08('0xa')],'strategy':_0x32c0ed[_0x8c08('0x23')],'answered':_0x32c0ed[_0x8c08('0x24')],'available':_0x32c0ed[_0x8c08('0x25')],'loggedIn':_0x32c0ed[_0x8c08('0x26')],'pTalking':_0x32c0ed['pTalking'],'sumBillable':_0x32c0ed['sumBillable'],'sumDuration':_0x32c0ed[_0x8c08('0x27')],'sumHoldTime':_0x32c0ed['sumHoldTime']||0x0,'talking':_0x32c0ed[_0x8c08('0x28')],'total':_0x32c0ed[_0x8c08('0x29')],'type':_0x32c0ed[_0x8c08('0x2a')],'unmanaged':_0x32c0ed[_0x8c08('0x2b')],'abandoned':_0x32c0ed['abandoned'],'waiting':_0x32c0ed['waiting'],'loggedInDb':_0x32c0ed[_0x8c08('0x2c')]};if(_0x32c0ed[_0x8c08('0x2a')]===_0x8c08('0x2d')){_0x101931[_0x8c08('0x2e')]=_0x32c0ed[_0x8c08('0x2e')];_0x101931[_0x8c08('0x2f')]=_0x32c0ed[_0x8c08('0x2f')];_0x101931['dialOriginateCallerIdName']=_0x32c0ed[_0x8c08('0x30')];_0x101931[_0x8c08('0x31')]=_0x32c0ed[_0x8c08('0x31')];_0x101931[_0x8c08('0x32')]=_0x32c0ed[_0x8c08('0x32')];_0x101931[_0x8c08('0x33')]=_0x32c0ed[_0x8c08('0x33')];_0x101931[_0x8c08('0x34')]=_0x32c0ed[_0x8c08('0x34')];_0x101931['outboundAnswerCallsDay']=_0x32c0ed['outboundAnswerCallsDay'];_0x101931['outboundBlacklistCallsDay']=_0x32c0ed[_0x8c08('0x35')];_0x101931[_0x8c08('0x36')]=_0x32c0ed[_0x8c08('0x36')];_0x101931[_0x8c08('0x37')]=_0x32c0ed[_0x8c08('0x37')];_0x101931['outboundDropCallsDayACS']=_0x32c0ed[_0x8c08('0x38')];_0x101931[_0x8c08('0x39')]=_0x32c0ed[_0x8c08('0x39')];_0x101931[_0x8c08('0x3a')]=_0x32c0ed['outboundDropCallsDayTimeout'];_0x101931[_0x8c08('0x3b')]=_0x32c0ed[_0x8c08('0x3b')];_0x101931[_0x8c08('0x3c')]=_0x32c0ed['outboundNoSuchCallsDay'];_0x101931['outboundOriginateFailureCallsDay']=_0x32c0ed['outboundOriginateFailureCallsDay'];_0x101931['outboundReCallsDay']=_0x32c0ed[_0x8c08('0x3d')];_0x101931[_0x8c08('0x3e')]=_0x32c0ed['outboundRejectCallsDay'];_0x101931[_0x8c08('0x3f')]=_0x32c0ed[_0x8c08('0x3f')];_0x101931[_0x8c08('0x40')]=_0x32c0ed['predictiveIntervalAnsweredCalls'];_0x101931[_0x8c08('0x41')]=_0x32c0ed[_0x8c08('0x41')];_0x101931[_0x8c08('0x42')]=_0x32c0ed[_0x8c08('0x42')];_0x101931[_0x8c08('0x43')]=_0x32c0ed[_0x8c08('0x43')];_0x101931[_0x8c08('0x44')]=_0x32c0ed[_0x8c08('0x44')];_0x101931[_0x8c08('0x45')]=_0x32c0ed[_0x8c08('0x45')];_0x101931[_0x8c08('0x46')]=_0x32c0ed[_0x8c08('0x46')];_0x101931[_0x8c08('0x47')]=_0x32c0ed[_0x8c08('0x47')];_0x101931[_0x8c08('0x48')]=_0x32c0ed[_0x8c08('0x48')];_0x101931['predictiveIntervalPauses']=_0x32c0ed['predictiveIntervalPauses'];_0x101931[_0x8c08('0x49')]=_0x32c0ed[_0x8c08('0x49')];_0x101931[_0x8c08('0x4a')]=_0x32c0ed[_0x8c08('0x4a')];_0x101931[_0x8c08('0x18')]=_0x32c0ed['message'];_0x101931[_0x8c08('0x4b')]=_0x32c0ed[_0x8c08('0x4b')];_0x101931[_0x8c08('0x4c')]=_0x32c0ed[_0x8c08('0x4c')];_0x101931[_0x8c08('0x4d')]=_0x32c0ed[_0x8c08('0x4d')];_0x101931[_0x8c08('0x4e')]=_0x32c0ed[_0x8c08('0x4e')];_0x101931[_0x8c08('0x4f')]=_0x32c0ed[_0x8c08('0x4f')];_0x101931[_0x8c08('0x50')]=_0x32c0ed[_0x8c08('0x50')];_0x101931[_0x8c08('0x51')]=_0x32c0ed[_0x8c08('0x51')];}if(_0x32c0ed[_0x8c08('0x52')]){_0x101931['Trunk']={'id':_0x32c0ed[_0x8c08('0x52')]['id'],'name':_0x32c0ed[_0x8c08('0x52')][_0x8c08('0xa')],'active':_0x32c0ed[_0x8c08('0x52')][_0x8c08('0x53')],'callerid':_0x32c0ed['Trunk'][_0x8c08('0x54')]};}if(_0x32c0ed['Interval']){_0x101931[_0x8c08('0x55')]={'id':_0x32c0ed[_0x8c08('0x55')]['id'],'name':_0x32c0ed[_0x8c08('0x55')][_0x8c08('0xa')]};}_0x3b1bfc[_0x8c08('0x56')](_0x101931);}}_0x209d33({'count':_0x3b1bfc[_0x8c08('0x57')],'rows':_0x3b1bfc});});},'VoiceChannels':function(_0x58ae78){return new Promise(function(_0x1cf387,_0x10001a){var _0x3e65e6=_[_0x8c08('0x58')](_0x191dcf[_0x8c08('0x59')]);_0x1cf387({'count':_0x3e65e6[_0x8c08('0x57')],'rows':_0x3e65e6});});},'VoiceChannelMixMonitor':function(_0x3d3d64){var _0x290f3e=this;return new Promise(function(_0x2db60f,_0x4bc1db){if(ami['isConnected']()==![]){return _0x4bc1db(_0x290f3e['error'](0x1f4,[config[_0x8c08('0x1a')]['ip'],config['asterisk'][_0x8c08('0x5a')],_0x8c08('0x11')][_0x8c08('0x1b')]('\x20')));}var _0x33caf9=schema(properties[_0x8c08('0x5b')])[_0x8c08('0x2')](_0x3d3d64);if(_0x33caf9['length']>0x0){return _0x4bc1db(_0x290f3e[_0x8c08('0x19')](0x1f4,_[_0x8c08('0x5c')](_0x33caf9,_0x8c08('0x18'))[_0x8c08('0x1b')](',\x20')));}var _0x509109=_[_0x8c08('0x5d')](_0x191dcf[_0x8c08('0x59')],{'uniqueid':_0x3d3d64['uniqueid']});if(_0x509109&&_0x509109[_0x8c08('0x5e')]){var _0x31ccfc=util[_0x8c08('0x7')]('%s.%s',_0x3d3d64['filename']||_0x3d3d64[_0x8c08('0x5f')],_0x3d3d64[_0x8c08('0x7')]||_0x8c08('0x60'));return ami[_0x8c08('0x1e')]({'action':_0x8c08('0x61'),'channel':_0x509109[_0x8c08('0x5e')],'file':_0x31ccfc,'options':_0x8c08('0x62')})['then'](function(_0x546c7c){var _0x51c073=_[_0x8c08('0x5d')](_0x509109[_0x8c08('0x63')],{'filename':_0x8c08('0x64')+_0x31ccfc[_0x8c08('0x65')]()});if(_['isNil'](_0x51c073)){_0x509109[_0x8c08('0x63')][_0x8c08('0x56')]({'filename':_0x8c08('0x64')+_0x31ccfc[_0x8c08('0x65')](),'createdAt':moment()[_0x8c08('0x7')](_0x8c08('0x66')),'mixmonitorid':_0x546c7c[_0x8c08('0x67')],'status':_0x8c08('0x68')});}else{_0x51c073[_0x8c08('0x67')]=_0x546c7c[_0x8c08('0x67')];_0x51c073[_0x8c08('0x69')]=_0x8c08('0x68');}_0x2db60f({'code':0xc8,'message':[_0x3d3d64[_0x8c08('0x5f')],_0x8c08('0x6a'),_0x546c7c['mixmonitorid']][_0x8c08('0x1b')]('\x20'),'mixmonitorid':_0x546c7c[_0x8c08('0x67')]});})[_0x8c08('0x20')](function(_0x4f9e35){_0x4bc1db(_0x290f3e[_0x8c08('0x19')](0x1f5,[_0x3d3d64[_0x8c08('0x5f')],_0x4f9e35[_0x8c08('0x18')][_0x8c08('0x65')]()]['join']('\x20')));});}else{return _0x4bc1db(_0x290f3e[_0x8c08('0x19')](0x1f5,_0x8c08('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0xe57b1c){var _0x32a7d6=this;return new Promise(function(_0xcdbc2,_0x163b84){if(ami['isConnected']()==![]){return _0x163b84(_0x32a7d6[_0x8c08('0x19')](0x1f4,[config[_0x8c08('0x1a')]['ip'],config[_0x8c08('0x1a')][_0x8c08('0x5a')],_0x8c08('0x11')][_0x8c08('0x1b')]('\x20')));}var _0x301ad6=schema(properties[_0x8c08('0x5b')])[_0x8c08('0x2')](_0xe57b1c);if(_0x301ad6[_0x8c08('0x57')]>0x0){return _0x163b84(_0x32a7d6['error'](0x1f4,_[_0x8c08('0x5c')](_0x301ad6,_0x8c08('0x18'))[_0x8c08('0x1b')](',\x20')));}var _0x3509f1=_[_0x8c08('0x5d')](_0x191dcf[_0x8c08('0x59')],{'uniqueid':_0xe57b1c[_0x8c08('0x5f')]});if(_0x3509f1){return BPromise[_0x8c08('0x6c')]()['then'](function(){if(_0x3509f1[_0x8c08('0x5e')]){return ami[_0x8c08('0x1e')]({'action':_0x8c08('0x6d'),'channel':_0x3509f1[_0x8c08('0x5e')],'mixmonitorid':_0xe57b1c[_0x8c08('0x67')]})[_0x8c08('0x20')](function(_0x5ca4e5){});}})['then'](function(){if(_0x3509f1[_0x8c08('0x6e')]){return ami['Action']({'action':_0x8c08('0x6d'),'channel':_0x3509f1[_0x8c08('0x6e')],'mixmonitorid':_0xe57b1c['mixmonitorid']})[_0x8c08('0x20')](function(_0x4893fe){});}})[_0x8c08('0x17')](function(_0x2c8557){var _0x5df531=_[_0x8c08('0x5d')](_0x3509f1[_0x8c08('0x63')],{'mixmonitorid':_0xe57b1c[_0x8c08('0x67')]});if(_0x5df531){_0x5df531['status']=_0x8c08('0x6f');}})[_0x8c08('0x17')](function(){var _0xc3ba4a=util['format'](_0x8c08('0x70'),_0xe57b1c[_0x8c08('0x71')]||_0xe57b1c[_0x8c08('0x5f')],_0xe57b1c[_0x8c08('0x7')]||_0x8c08('0x60'));var _0x45bf47=_[_0x8c08('0x5d')](_0x3509f1[_0x8c08('0x63')],{'filename':_0x8c08('0x64')+_0xc3ba4a[_0x8c08('0x65')]()});if(_0x45bf47){_0x45bf47['status']='stop';}})[_0x8c08('0x17')](function(){_0xcdbc2({'code':0xc8,'message':[_0xe57b1c[_0x8c08('0x5f')],_0x8c08('0x72')]['join']('\x20')});})[_0x8c08('0x20')](function(_0x29b93f){_0x163b84(_0x32a7d6[_0x8c08('0x19')](0x1f5,[_0xe57b1c[_0x8c08('0x5f')],_0x29b93f[_0x8c08('0x18')][_0x8c08('0x65')]()][_0x8c08('0x1b')]('\x20')));});}else{return _0x163b84(_0x32a7d6[_0x8c08('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x222440){return new Promise(function(_0x1006cf,_0x282d95){var _0x52d3f1=_[_0x8c08('0x58')](_0x191dcf[_0x8c08('0x73')]);_0x1006cf({'count':_0x52d3f1[_0x8c08('0x57')],'rows':_0x52d3f1});});},'VoiceQueuesChannel':function(_0x11b691){var _0x17c8f0=this;return new Promise(function(_0x355fe0,_0x5d7671){var _0x1a3aa4=schema(properties[_0x8c08('0x74')])[_0x8c08('0x2')](_0x11b691);if(_0x1a3aa4[_0x8c08('0x57')]>0x0){return _0x5d7671(_0x17c8f0['error'](0x1f4,_[_0x8c08('0x5c')](_0x1a3aa4,'message')[_0x8c08('0x1b')](',\x20')));}var _0x481a2f=_['find'](_0x191dcf[_0x8c08('0x73')],{'uniqueid':_0x11b691[_0x8c08('0x5f')]});if(_0x481a2f){_0x355fe0(_0x481a2f);}else{return _0x5d7671(_0x17c8f0[_0x8c08('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x218fdd){var _0x5ed2d3=this;return new Promise(function(_0x2bba54,_0x3d1fdb){if(ami[_0x8c08('0x10')]()==![]){return _0x3d1fdb(_0x5ed2d3[_0x8c08('0x19')](0x1f4,[config[_0x8c08('0x1a')]['ip'],config[_0x8c08('0x1a')][_0x8c08('0x5a')],'ami\x20disconnected'][_0x8c08('0x1b')]('\x20')));}var _0x423470=schema(properties[_0x8c08('0x75')])['validate'](_0x218fdd);if(_0x423470['length']>0x0){return _0x3d1fdb(_0x5ed2d3[_0x8c08('0x19')](0x1f4,_[_0x8c08('0x5c')](_0x423470,_0x8c08('0x18'))[_0x8c08('0x1b')](',\x20')));}var _0x2451f9=_['find'](_0x191dcf[_0x8c08('0x73')],{'uniqueid':_0x218fdd[_0x8c08('0x5f')]});if(_0x2451f9&&_0x2451f9[_0x8c08('0x5e')]){return ami[_0x8c08('0x1e')]({'action':_0x8c08('0x76'),'channel':_0x2451f9[_0x8c08('0x5e')]})[_0x8c08('0x17')](function(_0x55effc){_0x2bba54({'code':0xc8,'message':[_0x218fdd['uniqueid'],_0x55effc[_0x8c08('0x18')][_0x8c08('0x65')]()][_0x8c08('0x1b')]('\x20')});})[_0x8c08('0x20')](function(_0x728cd){_0x3d1fdb(_0x5ed2d3[_0x8c08('0x19')](0x1f5,[_0x218fdd['uniqueid'],_0x728cd['message'][_0x8c08('0x65')]()][_0x8c08('0x1b')]('\x20')));});}else{return _0x3d1fdb(_0x5ed2d3[_0x8c08('0x19')](0x1f5,_0x8c08('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x23851c){var _0x2773e0=this;return new Promise(function(_0x1b110b,_0x48cd8d){if(ami['isConnected']()==![]){return _0x48cd8d(_0x2773e0[_0x8c08('0x19')](0x1f4,[config[_0x8c08('0x1a')]['ip'],config[_0x8c08('0x1a')][_0x8c08('0x5a')],_0x8c08('0x11')]['join']('\x20')));}var _0x1b676d=schema(properties[_0x8c08('0x77')])[_0x8c08('0x2')](_0x23851c);if(_0x1b676d[_0x8c08('0x57')]>0x0){return _0x48cd8d(_0x2773e0[_0x8c08('0x19')](0x1f4,_['map'](_0x1b676d,'message')[_0x8c08('0x1b')](',\x20')));}var _0x59e4e6=_[_0x8c08('0x5d')](_0x191dcf[_0x8c08('0x73')],{'uniqueid':_0x23851c['uniqueid']});if(_0x59e4e6&&_0x59e4e6[_0x8c08('0x5e')]){return ami[_0x8c08('0x1e')]({'action':'Redirect','channel':_0x59e4e6[_0x8c08('0x5e')],'exten':_0x23851c[_0x8c08('0x78')],'context':_0x23851c[_0x8c08('0x79')]||_0x59e4e6[_0x8c08('0x79')],'priority':0x1})['then'](function(_0x395662){_0x1b110b({'code':0xc8,'message':[_0x23851c['uniqueid'],_0x395662[_0x8c08('0x18')][_0x8c08('0x65')]()][_0x8c08('0x1b')]('\x20')});})['catch'](function(_0x224624){_0x48cd8d(_0x2773e0[_0x8c08('0x19')](0x1f5,[_0x23851c[_0x8c08('0x5f')],_0x224624[_0x8c08('0x18')][_0x8c08('0x65')]()][_0x8c08('0x1b')]('\x20')));});}else{return _0x48cd8d(_0x2773e0[_0x8c08('0x19')](0x1f5,_0x8c08('0x6b')));}});},'Agents':function(_0x21dc5b){return new Promise(function(_0x932a81,_0x3eba47){var _0x36f47a=_[_0x8c08('0x58')](_0x191dcf[_0x8c08('0xe')]);_0x932a81({'count':_0x36f47a['length'],'rows':_0x36f47a});});},'Telephones':function(_0x1a9679){return new Promise(function(_0x34f734,_0x2921b2){var _0x359f85=_[_0x8c08('0x58')](_0x191dcf[_0x8c08('0x7a')]);_0x34f734({'count':_0x359f85[_0x8c08('0x57')],'rows':_0x359f85});});},'Trunks':function(_0x3cf1fc){return new Promise(function(_0x585ac8,_0x9a79e2){var _0x30b345=_[_0x8c08('0x58')](_0x191dcf['trunks']);_0x585ac8({'count':_0x30b345[_0x8c08('0x57')],'rows':_0x30b345});});},'OutboundChannels':function(_0x32160e){return new Promise(function(_0xbd6e6,_0x1323c8){var _0x485ccc=_[_0x8c08('0x58')](_0x191dcf['outboundChannels']);_0xbd6e6({'count':_0x485ccc['length'],'rows':_0x485ccc});});},'Outbound':function(_0x1fb5e6){return new Promise(function(_0x5020c1,_0x3c081c){_0x5020c1(_0x191dcf[_0x8c08('0x2d')]);});},'Campaigns':function(_0x4775a8){return new Promise(function(_0xe42396,_0x1e8ba7){var _0x401b98=_['values'](_0x191dcf[_0x8c08('0x7b')]);_0xe42396({'count':_0x401b98[_0x8c08('0x57')],'rows':_0x401b98});});},'VoiceQueuesPreview':function(_0x3919c7){var _0x2a12bf=this;return new Promise(function(_0x4cbd59,_0x56dba9){_0x5bcaf7[_0x8c08('0x7c')](_0x3919c7['id'])[_0x8c08('0x17')](function(_0x469ee5){_0x4cbd59({'code':0xc8,'message':_0x469ee5['message']});})['catch'](function(_0x2ef44c){_0x56dba9(_0x2a12bf[_0x8c08('0x19')](0x1f4,_0x2ef44c[_0x8c08('0x18')]));});});},'EventManager':function(_0x32d2e7){var _0x21687f=this;return new Promise(function(_0x3aa714,_0x1c479d){if(!_0x32d2e7[_0x8c08('0x7d')]){return _0x1c479d(_0x21687f[_0x8c08('0x19')](0x1f4,_0x8c08('0x7e')));}ami[_0x8c08('0x7f')](_0x8c08('0x80')+_0x32d2e7[_0x8c08('0x7d')],_0x32d2e7[_0x8c08('0x18')]);_0x3aa714({'code':0xc8,'message':_0x32d2e7});});},'FaxAccounts':function(_0x1c5d98){return new Promise(function(_0x2e550f,_0x441c21){var _0x2e4edd=_[_0x8c08('0x58')](_0x191dcf['faxAccounts']);_0x2e550f({'count':_0x2e4edd[_0x8c08('0x57')],'rows':_0x2e4edd});});},'SendFax':function(_0x172d61){var _0x5aa63d=this;return new Promise(function(_0x259b39,_0x301234){_0x3c8917['send'](_0x172d61)['then'](function(_0x1928c1){_0x259b39({'code':0xc8,'message':_0x1928c1[_0x8c08('0x18')]});})['catch'](function(_0x4e4ea8){_0x301234(_0x5aa63d[_0x8c08('0x19')](0x1f4,_0x4e4ea8['message']));});});},'CheckAfterSend':function(_0x58332d){var _0x3b7455=this;return new Promise(function(_0x1d6dc2,_0x502e14){_0x3c8917[_0x8c08('0x81')](_0x58332d)[_0x8c08('0x17')](function(_0x5126fa){_0x1d6dc2({'code':0xc8,'message':_0x5126fa[_0x8c08('0x18')]});})[_0x8c08('0x20')](function(_0x416e11){_0x502e14(_0x3b7455[_0x8c08('0x19')](0x1f4,_0x416e11['message']));});});}};var _0x46ebe8=jayson['server'](_0x5d66ec)[_0x8c08('0x82')]();_0x46ebe8['on'](_0x8c08('0x19'),function(_0x10e89c){return _0x4a80c6(_0x10e89c);});_0x46ebe8[_0x8c08('0x6')](0x232a,_0x8c08('0x83'),function(){console[_0x8c08('0x84')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4ed587('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 9d331d8..18380f8 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 _0xe2ab=['[%s][%s]\x20Contact\x20created:%s','xmd-contactid2','catch','error','[%s][%s]\x20Error\x20creating\x20contact','stringify','[%s][%s]\x20Autocreate\x20disabled','action','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','emit','exec','autoCreate','data2','isNil','routeId','firstName','calleridname','calleridnum','uniqueid','destcalleridname','','destcalleridnum','phone','resolve','showContact','omit','[%s][%s]\x20Contact\x20found:%s','user:%s','name','format','trigger:%s','toLowerCase','merge','data1','[%s][%s]\x20Contact\x20not\x20found','then','createContact'];(function(_0xcd0918,_0x56bdf9){var _0x250704=function(_0x56788e){while(--_0x56788e){_0xcd0918['push'](_0xcd0918['shift']());}};_0x250704(++_0x56bdf9);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x46a9f2,_0x63d490){_0x46a9f2=_0x46a9f2-0x0;var _0x23117e=_0xe2ab[_0x46a9f2];return _0x23117e;};'use strict';var BPromise=require(_0xbe2a('0x0'));var util=require(_0xbe2a('0x1'));var _=require(_0xbe2a('0x2'));var Redis=require(_0xbe2a('0x3'));var config=require(_0xbe2a('0x4'));var logger=require(_0xbe2a('0x5'))('trigger');var cmContactRpc=require(_0xbe2a('0x6'));config[_0xbe2a('0x7')]=_[_0xbe2a('0x8')](config[_0xbe2a('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xbe2a('0x9'))(new Redis(config['redis']));function emit(_0x2f504b,_0x58b8f1,_0x5a8a5d,_0xfccbff){logger[_0xbe2a('0xa')]('[%s][%s]',_0x2f504b,'',_0x58b8f1,_0x5a8a5d,JSON['stringify'](_0xfccbff));io['to'](_0x58b8f1)[_0xbe2a('0xb')](_0x5a8a5d,_0xfccbff);}exports[_0xbe2a('0xc')]=function(_0x5a3887,_0x21d1d9,_0x5be9f1){_0x5be9f1[_0xbe2a('0xd')]=0x0;if(_0x21d1d9[_0xbe2a('0xe')]&&parseInt(_0x21d1d9[_0xbe2a('0xe')],0xa)){var _0x51fc99={'ListId':parseInt(_0x21d1d9['data1'],0xa),'phone':_0x5be9f1['calleridnum']};if(_[_0xbe2a('0xf')](_0x5be9f1[_0xbe2a('0x10')])){_0x51fc99[_0xbe2a('0x11')]=_0x5be9f1[_0xbe2a('0x12')]&&_0x5be9f1[_0xbe2a('0x12')]!==''?_0x5be9f1[_0xbe2a('0x12')]:_0x5be9f1[_0xbe2a('0x13')]||_0x5be9f1[_0xbe2a('0x14')];}else{_0x51fc99['firstName']=_0x5be9f1[_0xbe2a('0x15')]&&_0x5be9f1[_0xbe2a('0x15')]!==_0xbe2a('0x16')?_0x5be9f1[_0xbe2a('0x15')]:_0x5be9f1[_0xbe2a('0x17')]||_0x5be9f1[_0xbe2a('0x14')];_0x51fc99[_0xbe2a('0x18')]=_0x5be9f1[_0xbe2a('0x15')]&&_0x5be9f1[_0xbe2a('0x15')]!==''?_0x5be9f1[_0xbe2a('0x15')]:_0x5be9f1[_0xbe2a('0x17')]||_0x5be9f1[_0xbe2a('0x14')];}BPromise[_0xbe2a('0x19')]()['then'](cmContactRpc[_0xbe2a('0x1a')]({'where':_[_0xbe2a('0x1b')](_0x51fc99,['firstName'])}))['then'](function(_0x8a6d25){if(_0x8a6d25){logger['info'](_0xbe2a('0x1c'),_0x5be9f1[_0xbe2a('0x14')],'',_0x8a6d25['id']);if(_0x5a3887){_0x5be9f1['xmd-contactid2']=_0x8a6d25['id'];emit(_0x5be9f1[_0xbe2a('0x14')],util['format'](_0xbe2a('0x1d'),_0x5a3887[_0xbe2a('0x1e')]),util[_0xbe2a('0x1f')](_0xbe2a('0x20'),_0x21d1d9['action'][_0xbe2a('0x21')]()),_[_0xbe2a('0x22')](_0x5be9f1,{'ListId':parseInt(_0x21d1d9[_0xbe2a('0x23')],0xa)}));}return;}else{logger['info'](_0xbe2a('0x24'),_0x5be9f1[_0xbe2a('0x14')],'');return BPromise[_0xbe2a('0x19')]()[_0xbe2a('0x25')](cmContactRpc[_0xbe2a('0x26')](_0x51fc99));}})['then'](function(_0x4e61dd){if(_0x4e61dd){logger[_0xbe2a('0xa')](_0xbe2a('0x27'),_0x5be9f1[_0xbe2a('0x14')],'',_0x4e61dd['id']);if(_0x5a3887){_0x5be9f1[_0xbe2a('0x28')]=_0x4e61dd['id'];emit(_0x5be9f1['uniqueid'],util[_0xbe2a('0x1f')]('user:%s',_0x5a3887[_0xbe2a('0x1e')]),util['format'](_0xbe2a('0x20'),_0x21d1d9['action'][_0xbe2a('0x21')]()),_[_0xbe2a('0x22')](_0x5be9f1,{'ListId':parseInt(_0x21d1d9[_0xbe2a('0x23')],0xa)}));}}})[_0xbe2a('0x29')](function(_0x8ea2be){logger[_0xbe2a('0x2a')](_0xbe2a('0x2b'),_0x5be9f1[_0xbe2a('0x14')],'',JSON[_0xbe2a('0x2c')](_0x8ea2be));});}else{if(_0x5a3887){logger['info'](_0xbe2a('0x2d'),_0x5be9f1['uniqueid'],'');emit(_0x5be9f1[_0xbe2a('0x14')],util[_0xbe2a('0x1f')](_0xbe2a('0x1d'),_0x5a3887[_0xbe2a('0x1e')]),util['format'](_0xbe2a('0x20'),_0x21d1d9[_0xbe2a('0x2e')][_0xbe2a('0x21')]()),_[_0xbe2a('0x22')]({'ListId':parseInt(_0x21d1d9[_0xbe2a('0x23')],0xa)},_0x5be9f1));}}}; \ No newline at end of file +var _0x9db7=['data1','calleridnum','calleridname','','uniqueid','firstName','destcalleridname','destcalleridnum','phone','resolve','then','showContact','[%s][%s]\x20Contact\x20found:%s','xmd-contactid2','format','user:%s','name','trigger:%s','action','toLowerCase','merge','[%s][%s]\x20Contact\x20not\x20found','createContact','[%s][%s]\x20Contact\x20created:%s','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','bluebird','util','lodash','ioredis','../../../../config/logger','../../rpc/cmContact','redis','localhost','socket.io-emitter','info','[%s][%s]','stringify','emit','autoCreate','data2'];(function(_0x380cb4,_0x295f49){var _0x3e3a98=function(_0x733f79){while(--_0x733f79){_0x380cb4['push'](_0x380cb4['shift']());}};_0x3e3a98(++_0x295f49);}(_0x9db7,0x1bf));var _0x79db=function(_0x3698db,_0x33b3c5){_0x3698db=_0x3698db-0x0;var _0x65c056=_0x9db7[_0x3698db];return _0x65c056;};'use strict';var BPromise=require(_0x79db('0x0'));var util=require(_0x79db('0x1'));var _=require(_0x79db('0x2'));var Redis=require(_0x79db('0x3'));var config=require('../../../../config/environment');var logger=require(_0x79db('0x4'))('trigger');var cmContactRpc=require(_0x79db('0x5'));config[_0x79db('0x6')]=_['defaults'](config[_0x79db('0x6')],{'host':_0x79db('0x7'),'port':0x18eb});var io=require(_0x79db('0x8'))(new Redis(config[_0x79db('0x6')]));function emit(_0x7980b1,_0x395883,_0x214bf9,_0x792510){logger[_0x79db('0x9')](_0x79db('0xa'),_0x7980b1,'',_0x395883,_0x214bf9,JSON[_0x79db('0xb')](_0x792510));io['to'](_0x395883)[_0x79db('0xc')](_0x214bf9,_0x792510);}exports['exec']=function(_0x37a537,_0x1d277f,_0x5e7ac7){_0x5e7ac7[_0x79db('0xd')]=0x0;if(_0x1d277f[_0x79db('0xe')]&&parseInt(_0x1d277f[_0x79db('0xe')],0xa)){var _0x1030c0={'ListId':parseInt(_0x1d277f[_0x79db('0xf')],0xa),'phone':_0x5e7ac7[_0x79db('0x10')]};if(_['isNil'](_0x5e7ac7['routeId'])){_0x1030c0['firstName']=_0x5e7ac7[_0x79db('0x11')]&&_0x5e7ac7['calleridname']!==_0x79db('0x12')?_0x5e7ac7['calleridname']:_0x5e7ac7[_0x79db('0x10')]||_0x5e7ac7[_0x79db('0x13')];}else{_0x1030c0[_0x79db('0x14')]=_0x5e7ac7[_0x79db('0x15')]&&_0x5e7ac7[_0x79db('0x15')]!==_0x79db('0x12')?_0x5e7ac7[_0x79db('0x15')]:_0x5e7ac7[_0x79db('0x16')]||_0x5e7ac7[_0x79db('0x13')];_0x1030c0[_0x79db('0x17')]=_0x5e7ac7[_0x79db('0x15')]&&_0x5e7ac7[_0x79db('0x15')]!==_0x79db('0x12')?_0x5e7ac7['destcalleridname']:_0x5e7ac7[_0x79db('0x16')]||_0x5e7ac7[_0x79db('0x13')];}BPromise[_0x79db('0x18')]()[_0x79db('0x19')](cmContactRpc[_0x79db('0x1a')]({'where':_['omit'](_0x1030c0,[_0x79db('0x14')])}))[_0x79db('0x19')](function(_0x4cd9f4){if(_0x4cd9f4){logger[_0x79db('0x9')](_0x79db('0x1b'),_0x5e7ac7['uniqueid'],'',_0x4cd9f4['id']);if(_0x37a537){_0x5e7ac7[_0x79db('0x1c')]=_0x4cd9f4['id'];emit(_0x5e7ac7[_0x79db('0x13')],util[_0x79db('0x1d')](_0x79db('0x1e'),_0x37a537[_0x79db('0x1f')]),util[_0x79db('0x1d')](_0x79db('0x20'),_0x1d277f[_0x79db('0x21')][_0x79db('0x22')]()),_[_0x79db('0x23')](_0x5e7ac7,{'ListId':parseInt(_0x1d277f[_0x79db('0xf')],0xa)}));}return;}else{logger[_0x79db('0x9')](_0x79db('0x24'),_0x5e7ac7[_0x79db('0x13')],'');return BPromise[_0x79db('0x18')]()['then'](cmContactRpc[_0x79db('0x25')](_0x1030c0));}})[_0x79db('0x19')](function(_0x592c38){if(_0x592c38){logger['info'](_0x79db('0x26'),_0x5e7ac7[_0x79db('0x13')],'',_0x592c38['id']);if(_0x37a537){_0x5e7ac7[_0x79db('0x1c')]=_0x592c38['id'];emit(_0x5e7ac7[_0x79db('0x13')],util[_0x79db('0x1d')](_0x79db('0x1e'),_0x37a537[_0x79db('0x1f')]),util[_0x79db('0x1d')](_0x79db('0x20'),_0x1d277f[_0x79db('0x21')][_0x79db('0x22')]()),_['merge'](_0x5e7ac7,{'ListId':parseInt(_0x1d277f[_0x79db('0xf')],0xa)}));}}})['catch'](function(_0x5de0b7){logger[_0x79db('0x27')](_0x79db('0x28'),_0x5e7ac7['uniqueid'],'',JSON[_0x79db('0xb')](_0x5de0b7));});}else{if(_0x37a537){logger[_0x79db('0x9')](_0x79db('0x29'),_0x5e7ac7['uniqueid'],'');emit(_0x5e7ac7[_0x79db('0x13')],util[_0x79db('0x1d')]('user:%s',_0x37a537[_0x79db('0x1f')]),util[_0x79db('0x1d')](_0x79db('0x20'),_0x1d277f[_0x79db('0x21')]['toLowerCase']()),_[_0x79db('0x23')]({'ListId':parseInt(_0x1d277f['data1'],0xa)},_0x5e7ac7));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 24a8f3f..ad55fa5 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 _0xd2d5=['html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','winapp','winArguments','format','user:%s','name','trigger:%s:%s','toLowerCase','merge','jscripty','trigger:%s','exec','integration','queue','script','parse','query','search','replace','AllConditions','every','checkConditions','channel','AnyConditions','field','chat','ChatWebsiteId','value','upperFirst','operator','AccountId','message','agent','membername','lastevent','routeId','exports','util','lodash','ioredis','./urlforward','./integration','./script','../rpc/cmContact','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','url','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','hasOwnProperty','checkTrigger','variables','Actions','length','action','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','render'];(function(_0xb2ab19,_0x3970e4){var _0x528664=function(_0x69e39c){while(--_0x69e39c){_0xb2ab19['push'](_0xb2ab19['shift']());}};_0x528664(++_0x3970e4);}(_0xd2d5,0xab));var _0x5d2d=function(_0x23c6f2,_0x4e033c){_0x23c6f2=_0x23c6f2-0x0;var _0x4c270b=_0xd2d5[_0x23c6f2];return _0x4c270b;};'use strict';var util=require(_0x5d2d('0x0'));var _=require(_0x5d2d('0x1'));var url=require('url');var Mustache=require('mustache');var Redis=require(_0x5d2d('0x2'));var urlforward=require(_0x5d2d('0x3'));var integration=require(_0x5d2d('0x4'));var cmContact=require('./cmContact');var script=require(_0x5d2d('0x5'));var cmContactRpc=require(_0x5d2d('0x6'));var config=require('../../../config/environment');var logger=require(_0x5d2d('0x7'))(_0x5d2d('0x8'));var ami=require('../ami');config[_0x5d2d('0x9')]=_[_0x5d2d('0xa')](config[_0x5d2d('0x9')],{'host':_0x5d2d('0xb'),'port':0x18eb});var io=require(_0x5d2d('0xc'))(new Redis(config[_0x5d2d('0x9')]));var operators={'equals':function(_0x489fc6,_0x283ce7){return _0x489fc6==_0x283ce7;},'not_equals':function(_0x420760,_0x1db1ef){return _0x420760!=_0x1db1ef;}};var barAndWebActions=['popup',_0x5d2d('0xd'),'winapp'];function Trigger(_0x3ff46b){this[_0x5d2d('0xe')]=_0x3ff46b[_0x5d2d('0xe')];this['agents']=_0x3ff46b[_0x5d2d('0xf')];this[_0x5d2d('0x10')]=_0x3ff46b[_0x5d2d('0x10')];this['templates']=_0x3ff46b[_0x5d2d('0x11')];this[_0x5d2d('0x12')]=_0x3ff46b['voiceExtensions'];this['zendeskAccounts']=_0x3ff46b[_0x5d2d('0x13')];this[_0x5d2d('0x14')]=_0x3ff46b['freshdeskAccounts'];this[_0x5d2d('0x15')]=_0x3ff46b[_0x5d2d('0x15')];this['sugarcrmAccounts']=_0x3ff46b[_0x5d2d('0x16')];this[_0x5d2d('0x17')]=_0x3ff46b['zohoAccounts'];this[_0x5d2d('0x18')]=_0x3ff46b[_0x5d2d('0x18')];this[_0x5d2d('0x19')]=_0x3ff46b['vtigerAccounts'];this[_0x5d2d('0x1a')]=_0x3ff46b['servicenowAccounts'];this['dynamics365Accounts']=_0x3ff46b[_0x5d2d('0x1b')];this[_0x5d2d('0x1c')]=_0x3ff46b[_0x5d2d('0x1c')];this[_0x5d2d('0x1d')]={'zendesk':this[_0x5d2d('0x13')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x5d2d('0x14')],'sugarcrm':this[_0x5d2d('0x16')],'zoho':this[_0x5d2d('0x17')],'desk':this[_0x5d2d('0x18')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x5d2d('0x1b')],'freshsales':this[_0x5d2d('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0x5d2d('0x1e'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x21'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x22'),this[_0x5d2d('0x1f')]['bind'](this));ami['on'](_0x5d2d('0x23'),this[_0x5d2d('0x1f')]['bind'](this));ami['on'](_0x5d2d('0x24'),this['syncCustomEvent'][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x25'),this[_0x5d2d('0x1f')]['bind'](this));ami['on'](_0x5d2d('0x26'),this[_0x5d2d('0x1f')]['bind'](this));ami['on'](_0x5d2d('0x27'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x28'),this['syncCustomEvent'][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x29'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x2a'),this[_0x5d2d('0x1f')]['bind'](this));ami['on'](_0x5d2d('0x2b'),this[_0x5d2d('0x2c')]['bind'](this));ami['on'](_0x5d2d('0x2d'),this[_0x5d2d('0x2c')]['bind'](this));ami['on'](_0x5d2d('0x2e'),this['syncAgentDial'][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x2f'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x30'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5d2d('0x32'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on'](_0x5d2d('0x33'),this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));ami['on']('custom:rejectmessage',this[_0x5d2d('0x1f')][_0x5d2d('0x20')](this));}Trigger[_0x5d2d('0x34')][_0x5d2d('0x35')]=function(_0x3522b5,_0x27cd0,_0x63f5c1){logger[_0x5d2d('0x36')](_0x3522b5,_0x27cd0,JSON[_0x5d2d('0x37')](_0x63f5c1));io['to'](_0x3522b5)[_0x5d2d('0x35')](_0x27cd0,_0x63f5c1);};Trigger[_0x5d2d('0x34')][_0x5d2d('0x1f')]=function(_0x53393d){var _0x272cab=_[_0x5d2d('0x38')](_0x53393d);this[_0x5d2d('0x39')](_0x272cab);};Trigger[_0x5d2d('0x34')]['syncAgentDial']=function(_0x10393b){if(this['agents'][_0x10393b[_0x5d2d('0x3a')]]){this[_0x5d2d('0x1f')](_0x10393b);}};Trigger['prototype'][_0x5d2d('0x39')]=function(_0x578c52){var _0x264590;for(var _0x13f272 in this[_0x5d2d('0xe')]){if(this['triggers'][_0x5d2d('0x3b')](_0x13f272)){if(this[_0x5d2d('0xe')][_0x13f272]['status']){_0x264590=this[_0x5d2d('0x3c')](this[_0x5d2d('0xe')][_0x13f272],_0x578c52);if(_0x264590){_['merge'](_0x578c52,_0x578c52[_0x5d2d('0x3d')]);for(var _0x5b7281=0x0,_0x46d722,_0x3f64d6,_0x2766e8;_0x5b72810x0){_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(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 52ab59b..1a70ea0 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 _0x8a4b=['internalemailaddress','isdisabled','info','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','userId','message','toLowerCase','destcalleridnum','Bearer\x20','4.0','odata-entityid','substring','lastIndexOf','contacts?$select=telephone1','outbound','calleridnum','enduserId','contactid',']\x20Enduser\x20created!','type','nameField','indexOf','content','ticketType','incident','incidents','assign','getString','/contacts(','/systemusers(','Fields','phonecall','Descriptions','callDirection','queue','headers','ticketId','emit','remoteUri','serverUrl','stripTrailingSlash','unmanaged','format','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\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','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','value','isNil','validateEmail','email','length'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x8a4b,0x1c7));var _0xb8a4=function(_0x384076,_0x491e1c){_0x384076=_0x384076-0x0;var _0x1d8f5d=_0x8a4b[_0x384076];return _0x1d8f5d;};'use strict';var _=require(_0xb8a4('0x0'));var BPromise=require(_0xb8a4('0x1'));var rp=require(_0xb8a4('0x2'));var util=require(_0xb8a4('0x3'));var intUtil=require(_0xb8a4('0x4'));var md5=require(_0xb8a4('0x5'));var Redis=require(_0xb8a4('0x6'));var logger=require(_0xb8a4('0x7'))(_0xb8a4('0x8'));var config=require(_0xb8a4('0x9'));config['redis']=_[_0xb8a4('0xa')](config[_0xb8a4('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xb8a4('0xc'))(new Redis(config[_0xb8a4('0xb')]));function getAuthToken(_0x19019e,_0x2835b8,_0x277ab9){var _0x1ff87c={'method':_0xb8a4('0xd'),'uri':_0x2835b8,'form':{'client_id':_0x19019e[_0xb8a4('0xe')],'resource':_0x19019e['remoteUri'],'username':_0x19019e['username'],'password':_0x19019e[_0xb8a4('0xf')],'grant_type':_0xb8a4('0xf'),'client_secret':_0x19019e[_0xb8a4('0x10')]},'json':!![]};return rp(_0x1ff87c)[_0xb8a4('0x11')](function(_0x759323){return _0x759323[_0xb8a4('0x12')];})[_0xb8a4('0x13')](function(_0x17c66c){logger[_0xb8a4('0x14')]('['+[_0x277ab9[_0xb8a4('0x15')]()]+_0xb8a4('0x16'));return _0x17c66c['message'];});}function getUser(_0x4605ab,_0x29479a,_0x2296ef,_0x21ee9e,_0x469b47,_0x34af56){return new BPromise(function(_0x178395,_0x309c60){return getAuthToken(_0x29479a,_0x21ee9e,_0x34af56)[_0xb8a4('0x11')](function(_0x41b3fd){var _0xaa8d78={'method':_0xb8a4('0x17'),'uri':_0x469b47+_0xb8a4('0x18'),'headers':{'Authorization':'Bearer\x20'+_0x41b3fd,'OData-Version':'4.0'},'json':!![]};return rp(_0xaa8d78);})[_0xb8a4('0x11')](function(_0x2de2e1){var _0x36fd7f=_0x2de2e1[_0xb8a4('0x19')];var _0xe9fbad=![];var _0x161af1=null;if(!_[_0xb8a4('0x1a')](_0x2296ef)){if(intUtil[_0xb8a4('0x1b')](_0x2296ef[_0xb8a4('0x1c')])){_0x4605ab['userEmail']=_0x2296ef['email'];for(_0x161af1=0x0;_0x161af1<_0x36fd7f[_0xb8a4('0x1d')];_0x161af1++){if(_0x36fd7f[_0x161af1][_0xb8a4('0x1e')]===_0x2296ef[_0xb8a4('0x1c')]&&!_0x36fd7f[_0x161af1][_0xb8a4('0x1f')]){_0xe9fbad=!![];logger[_0xb8a4('0x20')]('['+[_0x34af56[_0xb8a4('0x15')]()]+']\x20Agent\x20found\x20'+_0x36fd7f[_0x161af1][_0xb8a4('0x21')]+'!');_0x4605ab['userId']=_0x36fd7f[_0x161af1][_0xb8a4('0x21')];}}}}if(!_0xe9fbad){logger['info']('['+[_0x34af56[_0xb8a4('0x15')]()]+_0xb8a4('0x22'));_0x4605ab[_0xb8a4('0x23')]=_0x29479a[_0xb8a4('0x24')];for(_0x161af1=0x0;_0x161af1<_0x36fd7f['length'];_0x161af1++){if(_0x36fd7f[_0x161af1][_0xb8a4('0x1e')]===_0x29479a['username']){_0x4605ab[_0xb8a4('0x25')]=_0x36fd7f[_0x161af1][_0xb8a4('0x21')];}}}_0x178395(_0x4605ab);})[_0xb8a4('0x13')](function(_0x440ca0){_0x309c60(_0x440ca0[_0xb8a4('0x26')]);});});}function createEndUser(_0x42314e,_0x56dcb7,_0x26a392,_0x3562b1,_0x2c2cd3,_0x12f401){return new BPromise(function(_0x59db34,_0x878186){return getAuthToken(_0x56dcb7,_0x26a392,_0x12f401)[_0xb8a4('0x11')](function(_0x73fd18){var _0x57ea82=_0x12f401[_0xb8a4('0x27')]()==='outbound'?_0x2c2cd3[_0xb8a4('0x28')]:_0x2c2cd3['calleridnum'];var _0x4f1366={'method':'POST','uri':_0x3562b1+'contacts','body':{'telephone1':_0x57ea82,'fullname':_0x57ea82,'firstname':_0x57ea82,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x42314e[_0xb8a4('0x25')]+')'},'headers':{'Authorization':_0xb8a4('0x29')+_0x73fd18,'OData-Version':_0xb8a4('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4f1366);})['then'](function(_0x23d2df){var _0x2cd475=_0x23d2df['headers'][_0xb8a4('0x2b')];var _0x2a1a0b=_0x2cd475[_0xb8a4('0x2c')](_0x2cd475[_0xb8a4('0x2d')]('(')+0x1,_0x2cd475[_0xb8a4('0x2d')](')'));_0x42314e['enduserId']=_0x2a1a0b;_0x59db34(_0x42314e);})[_0xb8a4('0x13')](function(_0x2ae911){_0x878186(_0x2ae911[_0xb8a4('0x26')]);});});}function getEndUser(_0x2196cd,_0x5bb695,_0x47ef36,_0x5b2a5c,_0x59f500,_0x382d91){return new BPromise(function(_0x22eccf,_0x3b588c){return getAuthToken(_0x5bb695,_0x47ef36,_0x382d91)[_0xb8a4('0x11')](function(_0x3bb7af){var _0x46d52e={'method':_0xb8a4('0x17'),'uri':_0x5b2a5c+_0xb8a4('0x2e'),'headers':{'Authorization':_0xb8a4('0x29')+_0x3bb7af,'If-None-Match':null,'OData-Version':_0xb8a4('0x2a')},'json':!![]};return rp(_0x46d52e);})['then'](function(_0x514657){var _0x50d394=null;if(_0x514657){var _0x2757ad=_0x514657[_0xb8a4('0x19')];var _0x57c635=![];for(_0x50d394=0x0;_0x50d394<_0x2757ad[_0xb8a4('0x1d')];_0x50d394++){var _0x14dddc=_0x382d91[_0xb8a4('0x27')]()===_0xb8a4('0x2f')?_0x59f500[_0xb8a4('0x28')]:_0x59f500[_0xb8a4('0x30')];if(_0x2757ad[_0x50d394]['telephone1']===_0x14dddc){_0x57c635=!![];_0x2196cd[_0xb8a4('0x31')]=_0x2757ad[_0x50d394][_0xb8a4('0x32')];}}if(_0x57c635){_0x22eccf(_0x2196cd);}else{return createEndUser(_0x2196cd,_0x5bb695,_0x47ef36,_0x5b2a5c,_0x59f500,_0x382d91)[_0xb8a4('0x11')](function(_0x2fe080){logger[_0xb8a4('0x20')]('['+[_0x382d91[_0xb8a4('0x15')]()]+_0xb8a4('0x33'),_0x2fe080[_0xb8a4('0x31')]);_0x22eccf(_0x2fe080);});}}else{return createEndUser(_0x2196cd,_0x5bb695,_0x47ef36,_0x5b2a5c,_0x59f500,_0x382d91)[_0xb8a4('0x11')](function(_0x450f89){logger[_0xb8a4('0x20')]('['+[_0x382d91['toUpperCase']()]+']\x20Enduser\x20Created!',_0x450f89[_0xb8a4('0x31')]);_0x22eccf(_0x450f89);});}});});}function getCustomFields(_0x4bdc8c,_0x19d703,_0x1ab730){var _0x85600d={};if(_0x4bdc8c['length']>0x0){_['forEach'](_0x4bdc8c,function(_0x2ce00b){if(_0x2ce00b[_0xb8a4('0x34')]==='string'&&_0x2ce00b[_0xb8a4('0x35')]&&!_0x2ce00b['customField']){var _0x36acf8=_0x2ce00b['idField']['toLowerCase']();var _0x4654c2=_0x36acf8['substring'](0x0,_0x36acf8[_0xb8a4('0x36')]('_'));var _0x26f4c8=_0x36acf8[_0xb8a4('0x2c')](_0x36acf8['indexOf']('_')+0x1);if(_0x4654c2===_0x1ab730){_0x85600d[_0x26f4c8]=_0x2ce00b[_0xb8a4('0x37')];}}});}return _0x85600d;}function getTicket(_0xe78bc7,_0x26ed3a,_0x38cfa6,_0x45b470,_0x282a9f,_0x1cc3d1,_0x47db22){return new BPromise(function(_0x19813f,_0x5fd320){var _0xd961a5;return getAuthToken(_0x26ed3a,_0x38cfa6,_0x47db22)[_0xb8a4('0x11')](function(_0x4475cf){if(_0x1cc3d1[_0xb8a4('0x38')]===_0xb8a4('0x39')){_0xd961a5={'method':_0xb8a4('0xd'),'uri':_0x45b470+_0xb8a4('0x3a'),'body':Object[_0xb8a4('0x3b')]({},{'title':intUtil[_0xb8a4('0x3c')](_0x1cc3d1['Subjects'],_0x282a9f,'\x20'),'description':intUtil[_0xb8a4('0x3c')](_0x1cc3d1['Descriptions'],_0x282a9f,'\x0a'),'customerid_contact@odata.bind':_0xb8a4('0x3d')+_0xe78bc7['enduserId']+')','ownerid@odata.bind':_0xb8a4('0x3e')+_0xe78bc7[_0xb8a4('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x1cc3d1[_0xb8a4('0x3f')],_0x282a9f,_0x1cc3d1[_0xb8a4('0x38')])),'headers':{'Authorization':_0xb8a4('0x29')+_0x4475cf,'OData-Version':_0xb8a4('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1cc3d1['ticketType']===_0xb8a4('0x40')){_0xd961a5={'method':_0xb8a4('0xd'),'uri':_0x45b470+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xb8a4('0x3c')](_0x1cc3d1['Subjects'],_0x282a9f,'\x20'),'phonenumber':String(_0x282a9f[_0xb8a4('0x30')]),'description':intUtil[_0xb8a4('0x3c')](_0x1cc3d1[_0xb8a4('0x41')],_0x282a9f,'\x0a'),'regardingobjectid_contact@odata.bind':_0xb8a4('0x3d')+_0xe78bc7[_0xb8a4('0x31')]+')','ownerid@odata.bind':_0xb8a4('0x3e')+_0xe78bc7['userId']+')','directioncode':_0xe78bc7[_0xb8a4('0x42')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xb8a4('0x3e')+_0xe78bc7[_0xb8a4('0x25')]+')','participationtypemask':_0xe78bc7[_0xb8a4('0x42')]===_0xb8a4('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0xb8a4('0x3d')+_0xe78bc7[_0xb8a4('0x31')]+')','participationtypemask':_0xe78bc7['callDirection']===_0xb8a4('0x43')?0x1:0x2}]},getCustomFields(_0x1cc3d1[_0xb8a4('0x3f')],_0x282a9f,_0x1cc3d1['ticketType'])),'headers':{'Authorization':_0xb8a4('0x29')+_0x4475cf,'OData-Version':_0xb8a4('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xd961a5);})[_0xb8a4('0x11')](function(_0x590281){var _0x48888f=_0x590281[_0xb8a4('0x44')][_0xb8a4('0x2b')];var _0x75cd1f=_0x48888f[_0xb8a4('0x2c')](_0x48888f[_0xb8a4('0x2d')]('(')+0x1,_0x48888f['lastIndexOf'](')'));_0xe78bc7[_0xb8a4('0x45')]=_0x75cd1f;_0x19813f(_0xe78bc7);})[_0xb8a4('0x13')](function(_0x443853){_0x5fd320(_0x443853[_0xb8a4('0x26')]);});});}function emit(_0x5c03fc,_0x2046cd,_0x2483ca,_0x2431b0){var _0x569314={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5c03fc,_0x2483ca,_0x2431b0)};io['to'](util['format']('user:%s',_0x2046cd))[_0xb8a4('0x46')]('trigger:browser:url',_0x569314);}exports['cs']=function(_0x1bc3d4,_0x5f87d8,_0x195873,_0x3f4915,_0x52aa42,_0x276847,_0x5ea44e,_0x1aa985){var _0x75976d={};_0x276847[_0xb8a4('0x47')]=intUtil['stripTrailingSlash'](_0x276847[_0xb8a4('0x47')]);_0x276847[_0xb8a4('0x48')]=intUtil[_0xb8a4('0x49')](_0x276847['serverUrl']);_0x75976d[_0xb8a4('0x42')]=_0x1aa985==='queue'||_0x1aa985===_0xb8a4('0x4a')?_0xb8a4('0x43'):_0xb8a4('0x2f');var _0x38bea5=util[_0xb8a4('0x4b')](_0xb8a4('0x4c'),_0x276847[_0xb8a4('0x47')]);var _0x7bc607=util[_0xb8a4('0x4b')](_0xb8a4('0x4d'),_0x276847[_0xb8a4('0x4e')]);var _0x1e9bda=util[_0xb8a4('0x4b')](_0xb8a4('0x4f'),_0x276847[_0xb8a4('0x48')],_0x5f87d8[_0xb8a4('0x50')],md5(_0x5f87d8[_0xb8a4('0x50')]));if(_0x52aa42&&_0x52aa42['monitor_format']){logger['info'](_0xb8a4('0x51'),'Recording\x20is\x20enabled!');_0x5f87d8['recordingURL']=_0x1e9bda;}else if(_0x5ea44e&&_0x5ea44e[_0xb8a4('0x52')]&&_0x5ea44e[_0xb8a4('0x52')]!==_0xb8a4('0x53')){logger['info'](_0xb8a4('0x54'),_0xb8a4('0x55'));_0x5f87d8[_0xb8a4('0x56')]=_0x1e9bda;}else{_0x5f87d8[_0xb8a4('0x56')]='';}return getUser(_0x75976d,_0x276847,_0x3f4915,_0x7bc607,_0x38bea5,_0x1aa985)[_0xb8a4('0x11')](function(_0x418286){logger[_0xb8a4('0x20')]('['+_0x1aa985[_0xb8a4('0x15')]()+_0xb8a4('0x57'),_0x418286[_0xb8a4('0x25')]);logger[_0xb8a4('0x20')]('['+_0x1aa985['toUpperCase']()+_0xb8a4('0x58'),_0x418286[_0xb8a4('0x23')]);return getEndUser(_0x418286,_0x276847,_0x7bc607,_0x38bea5,_0x5f87d8,_0x1aa985);})[_0xb8a4('0x11')](function(_0x261c5b){logger['info']('['+_0x1aa985[_0xb8a4('0x15')]()+_0xb8a4('0x59'),_0x261c5b[_0xb8a4('0x31')]);logger['info']('['+_0x1aa985[_0xb8a4('0x15')]()+_0xb8a4('0x5a'),_0x5f87d8['calleridnum']);return getTicket(_0x261c5b,_0x276847,_0x7bc607,_0x38bea5,_0x5f87d8,_0x195873,_0x1aa985);})['then'](function(_0x36c95b){logger['info'](util[_0xb8a4('0x4b')]('['+_0x1aa985[_0xb8a4('0x15')]()+_0xb8a4('0x5b'),_0x195873['ticketType'],_0x36c95b['ticketId']));logger['info'](util[_0xb8a4('0x4b')]('['+_0x1aa985[_0xb8a4('0x15')]()+_0xb8a4('0x5c'),_0x1aa985));if(_0x1aa985!==_0xb8a4('0x4a')){logger[_0xb8a4('0x20')]('['+_0x1aa985[_0xb8a4('0x15')]()+']',_0xb8a4('0x5d'));emit(_0x276847['remoteUri'],_0x3f4915[_0xb8a4('0x5e')],_0x195873[_0xb8a4('0x38')],_0x36c95b['ticketId']);}})[_0xb8a4('0x13')](function(_0x472c14){logger['error']('['+_0x1aa985[_0xb8a4('0x15')]()+_0xb8a4('0x5f'),util[_0xb8a4('0x60')](_0x472c14,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xdfa5=['content','incident','incidents','assign','getString','Subjects','Descriptions','Fields','ticketType','phonecalls','callDirection','/contacts(','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','remoteUri','stripTrailingSlash','serverUrl','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','GET','outbound','telephone1','contactid',']\x20Enduser\x20created!','forEach','string','customField','idField','indexOf'];(function(_0x48413c,_0x152292){var _0x5c33e1=function(_0x2f09ad){while(--_0x2f09ad){_0x48413c['push'](_0x48413c['shift']());}};_0x5c33e1(++_0x152292);}(_0xdfa5,0x82));var _0x5dfa=function(_0xa477e5,_0x4350b0){_0xa477e5=_0xa477e5-0x0;var _0x69f958=_0xdfa5[_0xa477e5];return _0x69f958;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x5dfa('0x0'));var util=require(_0x5dfa('0x1'));var intUtil=require(_0x5dfa('0x2'));var md5=require(_0x5dfa('0x3'));var Redis=require(_0x5dfa('0x4'));var logger=require(_0x5dfa('0x5'))(_0x5dfa('0x6'));var config=require(_0x5dfa('0x7'));config[_0x5dfa('0x8')]=_[_0x5dfa('0x9')](config[_0x5dfa('0x8')],{'host':_0x5dfa('0xa'),'port':0x18eb});var io=require(_0x5dfa('0xb'))(new Redis(config[_0x5dfa('0x8')]));function getAuthToken(_0x471059,_0x434b93,_0x40f76c){var _0x14f2bd={'method':_0x5dfa('0xc'),'uri':_0x434b93,'form':{'client_id':_0x471059[_0x5dfa('0xd')],'resource':_0x471059['remoteUri'],'username':_0x471059[_0x5dfa('0xe')],'password':_0x471059[_0x5dfa('0xf')],'grant_type':'password','client_secret':_0x471059[_0x5dfa('0x10')]},'json':!![]};return rp(_0x14f2bd)[_0x5dfa('0x11')](function(_0x3f453d){return _0x3f453d[_0x5dfa('0x12')];})[_0x5dfa('0x13')](function(_0x3c5832){logger[_0x5dfa('0x14')]('['+[_0x40f76c[_0x5dfa('0x15')]()]+']\x20Wrong\x20credentials!');return _0x3c5832[_0x5dfa('0x16')];});}function getUser(_0x507891,_0x16518e,_0x3ea914,_0x32790e,_0x58b1b7,_0x34c034){return new BPromise(function(_0x10de34,_0x3ffadd){return getAuthToken(_0x16518e,_0x32790e,_0x34c034)[_0x5dfa('0x11')](function(_0x5afd7f){var _0x1ed87d={'method':'GET','uri':_0x58b1b7+_0x5dfa('0x17'),'headers':{'Authorization':_0x5dfa('0x18')+_0x5afd7f,'OData-Version':_0x5dfa('0x19')},'json':!![]};return rp(_0x1ed87d);})[_0x5dfa('0x11')](function(_0xa3e081){var _0x129a1a=_0xa3e081[_0x5dfa('0x1a')];var _0xce3972=![];var _0x4f04ef=null;if(!_['isNil'](_0x3ea914)){if(intUtil[_0x5dfa('0x1b')](_0x3ea914[_0x5dfa('0x1c')])){_0x507891['userEmail']=_0x3ea914[_0x5dfa('0x1c')];for(_0x4f04ef=0x0;_0x4f04ef<_0x129a1a[_0x5dfa('0x1d')];_0x4f04ef++){if(_0x129a1a[_0x4f04ef][_0x5dfa('0x1e')]===_0x3ea914['email']&&!_0x129a1a[_0x4f04ef][_0x5dfa('0x1f')]){_0xce3972=!![];logger[_0x5dfa('0x20')]('['+[_0x34c034[_0x5dfa('0x15')]()]+_0x5dfa('0x21')+_0x129a1a[_0x4f04ef]['systemuserid']+'!');_0x507891[_0x5dfa('0x22')]=_0x129a1a[_0x4f04ef][_0x5dfa('0x23')];}}}}if(!_0xce3972){logger[_0x5dfa('0x20')]('['+[_0x34c034[_0x5dfa('0x15')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x507891['userEmail']=_0x16518e['username'];for(_0x4f04ef=0x0;_0x4f04ef<_0x129a1a[_0x5dfa('0x1d')];_0x4f04ef++){if(_0x129a1a[_0x4f04ef]['internalemailaddress']===_0x16518e[_0x5dfa('0xe')]){_0x507891[_0x5dfa('0x22')]=_0x129a1a[_0x4f04ef][_0x5dfa('0x23')];}}}_0x10de34(_0x507891);})['catch'](function(_0x7b169){_0x3ffadd(_0x7b169[_0x5dfa('0x16')]);});});}function createEndUser(_0x5a1d06,_0x2ac709,_0x5ec725,_0x532f0d,_0x53334b,_0x46a363){return new BPromise(function(_0x40c156,_0x4ee632){return getAuthToken(_0x2ac709,_0x5ec725,_0x46a363)['then'](function(_0x554415){var _0x5a311c=_0x46a363[_0x5dfa('0x24')]()==='outbound'?_0x53334b[_0x5dfa('0x25')]:_0x53334b[_0x5dfa('0x26')];var _0x27a5e6={'method':'POST','uri':_0x532f0d+_0x5dfa('0x27'),'body':{'telephone1':_0x5a311c,'fullname':_0x5a311c,'firstname':_0x5a311c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x5dfa('0x28')+_0x5a1d06[_0x5dfa('0x22')]+')'},'headers':{'Authorization':_0x5dfa('0x18')+_0x554415,'OData-Version':_0x5dfa('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x27a5e6);})['then'](function(_0x553a95){var _0x3caa47=_0x553a95[_0x5dfa('0x29')][_0x5dfa('0x2a')];var _0xfaac46=_0x3caa47[_0x5dfa('0x2b')](_0x3caa47[_0x5dfa('0x2c')]('(')+0x1,_0x3caa47['lastIndexOf'](')'));_0x5a1d06[_0x5dfa('0x2d')]=_0xfaac46;_0x40c156(_0x5a1d06);})[_0x5dfa('0x13')](function(_0x17142d){_0x4ee632(_0x17142d['message']);});});}function getEndUser(_0x87b9ab,_0x3db761,_0x463fe9,_0x1e4ddf,_0x338fab,_0x2ab8c3){return new BPromise(function(_0x5f207b,_0x869411){return getAuthToken(_0x3db761,_0x463fe9,_0x2ab8c3)[_0x5dfa('0x11')](function(_0x4fc98e){var _0x5d5483={'method':_0x5dfa('0x2e'),'uri':_0x1e4ddf+'contacts?$select=telephone1','headers':{'Authorization':_0x5dfa('0x18')+_0x4fc98e,'If-None-Match':null,'OData-Version':_0x5dfa('0x19')},'json':!![]};return rp(_0x5d5483);})[_0x5dfa('0x11')](function(_0x3e9a18){var _0x292664=null;if(_0x3e9a18){var _0x51c86b=_0x3e9a18['value'];var _0x1d044a=![];for(_0x292664=0x0;_0x292664<_0x51c86b[_0x5dfa('0x1d')];_0x292664++){var _0x28b547=_0x2ab8c3[_0x5dfa('0x24')]()===_0x5dfa('0x2f')?_0x338fab['destcalleridnum']:_0x338fab[_0x5dfa('0x26')];if(_0x51c86b[_0x292664][_0x5dfa('0x30')]===_0x28b547){_0x1d044a=!![];_0x87b9ab[_0x5dfa('0x2d')]=_0x51c86b[_0x292664][_0x5dfa('0x31')];}}if(_0x1d044a){_0x5f207b(_0x87b9ab);}else{return createEndUser(_0x87b9ab,_0x3db761,_0x463fe9,_0x1e4ddf,_0x338fab,_0x2ab8c3)[_0x5dfa('0x11')](function(_0x2d0aa3){logger[_0x5dfa('0x20')]('['+[_0x2ab8c3[_0x5dfa('0x15')]()]+_0x5dfa('0x32'),_0x2d0aa3[_0x5dfa('0x2d')]);_0x5f207b(_0x2d0aa3);});}}else{return createEndUser(_0x87b9ab,_0x3db761,_0x463fe9,_0x1e4ddf,_0x338fab,_0x2ab8c3)[_0x5dfa('0x11')](function(_0x4478c5){logger[_0x5dfa('0x20')]('['+[_0x2ab8c3[_0x5dfa('0x15')]()]+']\x20Enduser\x20Created!',_0x4478c5['enduserId']);_0x5f207b(_0x4478c5);});}});});}function getCustomFields(_0xecaaad,_0x2a822c,_0x3c26c3){var _0x1acde2={};if(_0xecaaad[_0x5dfa('0x1d')]>0x0){_[_0x5dfa('0x33')](_0xecaaad,function(_0x1cb7ba){if(_0x1cb7ba['type']===_0x5dfa('0x34')&&_0x1cb7ba['nameField']&&!_0x1cb7ba[_0x5dfa('0x35')]){var _0x4e73dc=_0x1cb7ba[_0x5dfa('0x36')]['toLowerCase']();var _0x133d25=_0x4e73dc[_0x5dfa('0x2b')](0x0,_0x4e73dc[_0x5dfa('0x37')]('_'));var _0x68d57d=_0x4e73dc[_0x5dfa('0x2b')](_0x4e73dc[_0x5dfa('0x37')]('_')+0x1);if(_0x133d25===_0x3c26c3){_0x1acde2[_0x68d57d]=_0x1cb7ba[_0x5dfa('0x38')];}}});}return _0x1acde2;}function getTicket(_0xe7c7f9,_0x341873,_0x552aaa,_0x3a7629,_0x310d15,_0x371404,_0x9f84f){return new BPromise(function(_0x2debd5,_0x204f49){var _0x4df4f8;return getAuthToken(_0x341873,_0x552aaa,_0x9f84f)['then'](function(_0x12a801){if(_0x371404['ticketType']===_0x5dfa('0x39')){_0x4df4f8={'method':_0x5dfa('0xc'),'uri':_0x3a7629+_0x5dfa('0x3a'),'body':Object[_0x5dfa('0x3b')]({},{'title':intUtil[_0x5dfa('0x3c')](_0x371404[_0x5dfa('0x3d')],_0x310d15,'\x20'),'description':intUtil[_0x5dfa('0x3c')](_0x371404[_0x5dfa('0x3e')],_0x310d15,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0xe7c7f9['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0xe7c7f9[_0x5dfa('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x371404[_0x5dfa('0x3f')],_0x310d15,_0x371404[_0x5dfa('0x40')])),'headers':{'Authorization':_0x5dfa('0x18')+_0x12a801,'OData-Version':_0x5dfa('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x371404[_0x5dfa('0x40')]==='phonecall'){_0x4df4f8={'method':'POST','uri':_0x3a7629+_0x5dfa('0x41'),'body':Object[_0x5dfa('0x3b')]({},{'subject':intUtil[_0x5dfa('0x3c')](_0x371404['Subjects'],_0x310d15,'\x20'),'phonenumber':String(_0x310d15[_0x5dfa('0x26')]),'description':intUtil['getString'](_0x371404[_0x5dfa('0x3e')],_0x310d15,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xe7c7f9[_0x5dfa('0x2d')]+')','ownerid@odata.bind':_0x5dfa('0x28')+_0xe7c7f9['userId']+')','directioncode':_0xe7c7f9[_0x5dfa('0x42')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x5dfa('0x28')+_0xe7c7f9['userId']+')','participationtypemask':_0xe7c7f9[_0x5dfa('0x42')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x5dfa('0x43')+_0xe7c7f9[_0x5dfa('0x2d')]+')','participationtypemask':_0xe7c7f9[_0x5dfa('0x42')]===_0x5dfa('0x44')?0x1:0x2}]},getCustomFields(_0x371404[_0x5dfa('0x3f')],_0x310d15,_0x371404['ticketType'])),'headers':{'Authorization':_0x5dfa('0x18')+_0x12a801,'OData-Version':_0x5dfa('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4df4f8);})[_0x5dfa('0x11')](function(_0x240446){var _0x34003f=_0x240446[_0x5dfa('0x29')][_0x5dfa('0x2a')];var _0x39f6b5=_0x34003f['substring'](_0x34003f['lastIndexOf']('(')+0x1,_0x34003f[_0x5dfa('0x2c')](')'));_0xe7c7f9['ticketId']=_0x39f6b5;_0x2debd5(_0xe7c7f9);})[_0x5dfa('0x13')](function(_0x1b59fb){_0x204f49(_0x1b59fb[_0x5dfa('0x16')]);});});}function emit(_0x4bed9e,_0x4319cd,_0x32f1e7,_0x3fa892){var _0x5d1a2c={'uri':util[_0x5dfa('0x45')](_0x5dfa('0x46'),_0x4bed9e,_0x32f1e7,_0x3fa892)};io['to'](util[_0x5dfa('0x45')]('user:%s',_0x4319cd))[_0x5dfa('0x47')]('trigger:browser:url',_0x5d1a2c);}exports['cs']=function(_0x1195ba,_0x943efb,_0x6745b5,_0x2c65fe,_0x2cce6c,_0x205140,_0x35c547,_0x2181d4){var _0x5b23bb={};_0x205140[_0x5dfa('0x48')]=intUtil[_0x5dfa('0x49')](_0x205140[_0x5dfa('0x48')]);_0x205140[_0x5dfa('0x4a')]=intUtil[_0x5dfa('0x49')](_0x205140['serverUrl']);_0x5b23bb[_0x5dfa('0x42')]=_0x2181d4==='queue'||_0x2181d4==='unmanaged'?'queue':_0x5dfa('0x2f');var _0x5cadfb=util[_0x5dfa('0x45')]('%s/api/data/v9.0/',_0x205140[_0x5dfa('0x48')]);var _0x215082=util[_0x5dfa('0x45')](_0x5dfa('0x4b'),_0x205140[_0x5dfa('0x4c')]);var _0x19a25f=util[_0x5dfa('0x45')](_0x5dfa('0x4d'),_0x205140[_0x5dfa('0x4a')],_0x943efb[_0x5dfa('0x4e')],md5(_0x943efb[_0x5dfa('0x4e')]));if(_0x2cce6c&&_0x2cce6c[_0x5dfa('0x4f')]){logger[_0x5dfa('0x20')](_0x5dfa('0x50'),_0x5dfa('0x51'));_0x943efb[_0x5dfa('0x52')]=_0x19a25f;}else if(_0x35c547&&_0x35c547[_0x5dfa('0x53')]&&_0x35c547[_0x5dfa('0x53')]!==_0x5dfa('0x54')){logger[_0x5dfa('0x20')](_0x5dfa('0x55'),_0x5dfa('0x51'));_0x943efb[_0x5dfa('0x52')]=_0x19a25f;}else{_0x943efb['recordingURL']='';}return getUser(_0x5b23bb,_0x205140,_0x2c65fe,_0x215082,_0x5cadfb,_0x2181d4)[_0x5dfa('0x11')](function(_0x4590b1){logger[_0x5dfa('0x20')]('['+_0x2181d4[_0x5dfa('0x15')]()+_0x5dfa('0x56'),_0x4590b1[_0x5dfa('0x22')]);logger[_0x5dfa('0x20')]('['+_0x2181d4[_0x5dfa('0x15')]()+_0x5dfa('0x57'),_0x4590b1[_0x5dfa('0x58')]);return getEndUser(_0x4590b1,_0x205140,_0x215082,_0x5cadfb,_0x943efb,_0x2181d4);})[_0x5dfa('0x11')](function(_0x376c51){logger[_0x5dfa('0x20')]('['+_0x2181d4['toUpperCase']()+']\x20The\x20Enduser\x20ID\x20is:',_0x376c51[_0x5dfa('0x2d')]);logger[_0x5dfa('0x20')]('['+_0x2181d4['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x943efb[_0x5dfa('0x26')]);return getTicket(_0x376c51,_0x205140,_0x215082,_0x5cadfb,_0x943efb,_0x6745b5,_0x2181d4);})[_0x5dfa('0x11')](function(_0x5397a8){logger[_0x5dfa('0x20')](util[_0x5dfa('0x45')]('['+_0x2181d4['toUpperCase']()+_0x5dfa('0x59'),_0x6745b5[_0x5dfa('0x40')],_0x5397a8['ticketId']));logger[_0x5dfa('0x20')](util['format']('['+_0x2181d4[_0x5dfa('0x15')]()+_0x5dfa('0x5a'),_0x2181d4));if(_0x2181d4!=='unmanaged'){logger[_0x5dfa('0x20')]('['+_0x2181d4[_0x5dfa('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x205140['remoteUri'],_0x2c65fe['name'],_0x6745b5['ticketType'],_0x5397a8['ticketId']);}})[_0x5dfa('0x13')](function(_0x452032){logger[_0x5dfa('0x14')]('['+_0x2181d4[_0x5dfa('0x15')]()+_0x5dfa('0x5b'),util[_0x5dfa('0x5c')](_0x452032,{'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 cae14b3..687ba45 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 _0x3fdf=['Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','[HTTP]','stringify','defaults','GET','map','forEach','type','string','nameField','idField','customField','content','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','%s/helpdesk/tickets/%d','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','md5','util','./util','../../../../config/logger','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','format'];(function(_0x835f74,_0x123452){var _0x46a4d6=function(_0x5b7adc){while(--_0x5b7adc){_0x835f74['push'](_0x835f74['shift']());}};_0x46a4d6(++_0x123452);}(_0x3fdf,0xb1));var _0xf3fd=function(_0x163ae2,_0x144901){_0x163ae2=_0x163ae2-0x0;var _0x593dc8=_0x3fdf[_0x163ae2];return _0x593dc8;};'use strict';var _=require(_0xf3fd('0x0'));var rp=require(_0xf3fd('0x1'));var md5=require(_0xf3fd('0x2'));var util=require(_0xf3fd('0x3'));var Redis=require('ioredis');var intUtil=require(_0xf3fd('0x4'));var config=require('../../../../config/environment');var logger=require(_0xf3fd('0x5'))('freshdesk');config[_0xf3fd('0x6')]=_['defaults'](config[_0xf3fd('0x6')],{'host':_0xf3fd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xf3fd('0x8')};function emit(_0x4fcab0,_0x515e90,_0x547d90){io['to'](_0x4fcab0)[_0xf3fd('0x9')](_0x515e90,_0x547d90);}function getTicket(_0x99bc77,_0x1ade25,_0x330a83,_0x5b1a9b,_0x34b9d1){logger[_0xf3fd('0xa')](_0xf3fd('0xb'));var _0x15ed3e=_['merge']({'responder_id':_0x1ade25['id'],'requester_id':_0x330a83['id'],'name':util[_0xf3fd('0xc')](_0xf3fd('0xd'),_0x34b9d1['calleridname']),'phone':_0x34b9d1[_0xf3fd('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf3fd('0xf')](_0x5b1a9b[_0xf3fd('0x10')],_0x34b9d1,'\x20'),'description':intUtil[_0xf3fd('0xf')](_0x5b1a9b[_0xf3fd('0x11')],_0x34b9d1,_0xf3fd('0x12')),'tags':getTags(_0x5b1a9b['Tags'],_0xf3fd('0x13'))},getCustomFields(_0x5b1a9b[_0xf3fd('0x14')],_0x34b9d1));_0x15ed3e['custom_fields']=_[_0xf3fd('0x15')](_[_0xf3fd('0x16')](_0x15ed3e[_0xf3fd('0x17')],'id'),_0xf3fd('0x18'));return request({'uri':util[_0xf3fd('0xc')](_0xf3fd('0x19'),_0x99bc77[_0xf3fd('0x1a')]),'method':_0xf3fd('0x1b'),'body':_0x15ed3e})[_0xf3fd('0x1c')](function(_0x26571e){logger[_0xf3fd('0xa')](_0xf3fd('0x1d'));return _0x26571e;});}function getUser(_0x177e83,_0x708f51){if(intUtil[_0xf3fd('0x1e')](_0x708f51)){return request({'uri':util['format'](_0xf3fd('0x1f'),_0x177e83[_0xf3fd('0x1a')]),'qs':{'email':_0x708f51}})['then'](function(_0x2b7d3c){if(_0x2b7d3c[_0xf3fd('0x20')]){logger[_0xf3fd('0xa')](_0xf3fd('0x21'));return _['find'](_0x2b7d3c,function(_0x5df610){return _0x5df610[_0xf3fd('0x22')][_0xf3fd('0x23')]===_0x708f51;});}else{logger[_0xf3fd('0xa')](_0xf3fd('0x24'));return request({'uri':util[_0xf3fd('0xc')](_0xf3fd('0x25'),_0x177e83[_0xf3fd('0x1a')])})['then'](function(_0x31bed2){logger[_0xf3fd('0xa')](_0xf3fd('0x26'));return _0x31bed2;});}});}else{logger['info'](_0xf3fd('0x27'));return request({'uri':util[_0xf3fd('0xc')](_0xf3fd('0x25'),_0x177e83[_0xf3fd('0x1a')])})[_0xf3fd('0x1c')](function(_0x5b66ba){logger[_0xf3fd('0xa')]('Admin\x20account\x20selected.');return _0x5b66ba;});}}function getEndUser(_0x3c0c77,_0x4a0e1c,_0x45cb0d){logger[_0xf3fd('0xa')](_0xf3fd('0x28'),_0x45cb0d);return request({'uri':util[_0xf3fd('0xc')](_0xf3fd('0x29'),_0x3c0c77[_0xf3fd('0x1a')]),'qs':{'phone':_0x45cb0d}})[_0xf3fd('0x1c')](function(_0x38da9f){if(_0x38da9f['length']){logger[_0xf3fd('0xa')](_0xf3fd('0x2a'));return _[_0xf3fd('0x2b')](_0x38da9f,{'phone':_0x45cb0d});}else{logger[_0xf3fd('0xa')](_0xf3fd('0x2c'));return request({'uri':util[_0xf3fd('0xc')](_0xf3fd('0x29'),_0x3c0c77['remoteUri']),'method':_0xf3fd('0x1b'),'body':{'name':_0x4a0e1c,'phone':_0x45cb0d}})['then'](function(_0x577061){logger[_0xf3fd('0xa')](_0xf3fd('0x2d'));return _0x577061;});}});}function getAuth(_0x1c2c1e){return util[_0xf3fd('0xc')]('Basic\x20%s',new Buffer(_0x1c2c1e[_0xf3fd('0x2e')]+':X')[_0xf3fd('0x2f')](_0xf3fd('0x30')));}function request(_0x363fb7){logger['debug'](_0xf3fd('0x31'),JSON[_0xf3fd('0x32')](_0x363fb7));return rp(_[_0xf3fd('0x33')](_0x363fb7,{'method':_0xf3fd('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x55d7fd,_0x116f53){var _0x3d4d4d=[];if(_0x55d7fd&&_0x55d7fd[_0xf3fd('0x20')]>0x0){_0x3d4d4d=_[_0xf3fd('0x35')](_0x55d7fd,_0x116f53);}return _0x3d4d4d;}function getCustomFields(_0x4af3db,_0x408b7e){var _0x29ff4d=[];var _0x22bd80={'custom_fields':[]};if(_0x4af3db[_0xf3fd('0x20')]>0x0){_[_0xf3fd('0x36')](_0x4af3db,function(_0x6889a){if(_0x6889a[_0xf3fd('0x37')]===_0xf3fd('0x38')&&_0x6889a['nameField']&&!_0x6889a['customField']){_0x22bd80[_0x6889a[_0xf3fd('0x39')]['toLowerCase']()]=_0x6889a['content']['toString']();}else if(_0x6889a[_0xf3fd('0x37')]===_0xf3fd('0x38')&&_0x6889a[_0xf3fd('0x3a')]&&_0x6889a[_0xf3fd('0x3b')]){_0x22bd80[_0xf3fd('0x17')]['push']({'id':_0x6889a[_0xf3fd('0x3a')],'value':_0x6889a[_0xf3fd('0x3c')][_0xf3fd('0x2f')]()});}else if(_0x6889a['type']===_0xf3fd('0x3d')&&_0x6889a[_0xf3fd('0x3e')]&&_0x6889a[_0xf3fd('0x3a')]&&_0x6889a['customField']){_0x408b7e[_0x6889a[_0xf3fd('0x3e')]]&&_0x22bd80[_0xf3fd('0x17')][_0xf3fd('0x3f')]({'id':_0x6889a[_0xf3fd('0x3a')],'value':_0x408b7e[_0x6889a['variableName']][_0xf3fd('0x2f')]()});}else if(_0x6889a[_0xf3fd('0x37')]===_0xf3fd('0x40')&&_0x6889a['Variable']&&_0x6889a[_0xf3fd('0x41')][_0xf3fd('0x13')]&&_0x6889a['idField']&&_0x6889a[_0xf3fd('0x3b')]){_0x408b7e[_0x6889a[_0xf3fd('0x41')][_0xf3fd('0x13')][_0xf3fd('0x42')]()]&&_0x22bd80['custom_fields'][_0xf3fd('0x3f')]({'id':_0x6889a[_0xf3fd('0x3a')],'value':_0x408b7e[_0x6889a['Variable'][_0xf3fd('0x13')]['toLowerCase']()][_0xf3fd('0x2f')]()});}});}return _0x22bd80;}exports[_0xf3fd('0x43')]=function(_0x3a85d4,_0x3db138,_0x5bf347,_0x34dee8,_0x5899d3,_0x1ffbea){var _0x6f4053,_0x353cd8;_0x1ffbea[_0xf3fd('0x1a')]=intUtil[_0xf3fd('0x44')](_0x1ffbea[_0xf3fd('0x1a')]);_0x1ffbea[_0xf3fd('0x45')]=intUtil[_0xf3fd('0x44')](_0x1ffbea['serverUrl']);if(_0x5899d3&&_0x5899d3[_0xf3fd('0x46')]){logger['info'](_0xf3fd('0x47'),'Recording\x20is\x20enabled!');_0x3db138['recordingURL']=util[_0xf3fd('0xc')](_0xf3fd('0x48'),_0x1ffbea['serverUrl'],_0x3db138['uniqueid'],md5(_0x3db138[_0xf3fd('0x49')]));}else{_0x3db138[_0xf3fd('0x4a')]='';}headers[_0xf3fd('0x4b')]=getAuth(_0x1ffbea);return getUser(_0x1ffbea,_0x34dee8[_0xf3fd('0x23')])[_0xf3fd('0x1c')](function(_0x26a735){_0x6f4053=_0x26a735;logger[_0xf3fd('0xa')](_0xf3fd('0x4c'),_0x6f4053['id']);return getEndUser(_0x1ffbea,_0x3db138['calleridname'],_0x3db138[_0xf3fd('0xe')]);})['then'](function(_0x30ce6d){_0x353cd8=_0x30ce6d;logger[_0xf3fd('0xa')]('The\x20Enduser\x20ID\x20is:',_0x353cd8['id']);return getTicket(_0x1ffbea,_0x6f4053,_0x353cd8,_0x5bf347,_0x3db138);})[_0xf3fd('0x1c')](function(_0x4c8830){if(_0x4c8830&&_0x4c8830['id']){logger['info'](_0xf3fd('0x1d'));logger[_0xf3fd('0xa')]('The\x20Ticket\x20ID\x20is:',_0x4c8830['id']);logger['info'](_0xf3fd('0x47'),_0xf3fd('0x4d'));emit(util[_0xf3fd('0xc')]('user:%s',_0x34dee8[_0xf3fd('0x13')]),_0xf3fd('0x4e'),{'uri':util[_0xf3fd('0xc')]('%s/helpdesk/tickets/%d',_0x1ffbea[_0xf3fd('0x1a')],_0x4c8830['id'])});}})[_0xf3fd('0x4f')](function(_0x49019a){logger[_0xf3fd('0x50')](_0xf3fd('0x47'),JSON[_0xf3fd('0x32')](_0x49019a));});};exports['outbound']=function(_0x14552c,_0x42c83c,_0x2ec9d6,_0x5de42c,_0xe8933f,_0x481020,_0x1ab931){var _0x1573f7,_0x2d2ea6;_0x481020[_0xf3fd('0x1a')]=intUtil[_0xf3fd('0x44')](_0x481020[_0xf3fd('0x1a')]);_0x481020[_0xf3fd('0x45')]=intUtil[_0xf3fd('0x44')](_0x481020[_0xf3fd('0x45')]);if(_0x1ab931&&_0x1ab931[_0xf3fd('0x51')]&&_0x1ab931[_0xf3fd('0x51')]!==_0xf3fd('0x52')){logger[_0xf3fd('0xa')](_0xf3fd('0x53'),_0xf3fd('0x54'));_0x42c83c[_0xf3fd('0x4a')]=util[_0xf3fd('0xc')](_0xf3fd('0x48'),_0x481020[_0xf3fd('0x45')],_0x42c83c[_0xf3fd('0x49')],md5(_0x42c83c[_0xf3fd('0x49')]));}headers[_0xf3fd('0x4b')]=getAuth(_0x481020);return getUser(_0x481020,_0x5de42c[_0xf3fd('0x23')])[_0xf3fd('0x1c')](function(_0x2c97a8){_0x1573f7=_0x2c97a8;logger[_0xf3fd('0xa')](_0xf3fd('0x4c'),_0x1573f7['id']);return getEndUser(_0x481020,_0x42c83c[_0xf3fd('0x55')],_0x42c83c[_0xf3fd('0x56')]);})[_0xf3fd('0x1c')](function(_0x929943){_0x2d2ea6=_0x929943;logger[_0xf3fd('0xa')](_0xf3fd('0x57'),_0x2d2ea6['id']);return getTicket(_0x481020,_0x1573f7,_0x2d2ea6,_0x2ec9d6,_0x42c83c);})[_0xf3fd('0x1c')](function(_0x503669){if(_0x503669&&_0x503669['id']){logger[_0xf3fd('0xa')](_0xf3fd('0x1d'));logger[_0xf3fd('0xa')](_0xf3fd('0x58'),_0x503669['id']);logger[_0xf3fd('0xa')](_0xf3fd('0x53'),_0xf3fd('0x4d'));emit(util['format'](_0xf3fd('0x59'),_0x5de42c[_0xf3fd('0x13')]),_0xf3fd('0x4e'),{'uri':util[_0xf3fd('0xc')](_0xf3fd('0x5a'),_0x481020[_0xf3fd('0x1a')],_0x503669['id'])});}})['catch'](function(_0x5693a4){logger['error']('[OUTBOUND]',JSON['stringify'](_0x5693a4));});};exports[_0xf3fd('0x5b')]=function(_0x5dde15,_0x18fa3c,_0xb97720,_0x5c5f6c,_0x494109,_0x4d6d0e){var _0x3ba435,_0x507a8b;_0x4d6d0e[_0xf3fd('0x1a')]=intUtil['stripTrailingSlash'](_0x4d6d0e['remoteUri']);_0x4d6d0e[_0xf3fd('0x45')]=intUtil[_0xf3fd('0x44')](_0x4d6d0e['serverUrl']);if(_0x494109&&_0x494109[_0xf3fd('0x46')]){logger['info']('['+_0x18fa3c[_0xf3fd('0x5c')][_0xf3fd('0x5d')]()+']','Recording\x20is\x20enabled!');_0x18fa3c['recordingURL']=util[_0xf3fd('0xc')](_0xf3fd('0x48'),_0x4d6d0e['serverUrl'],_0x18fa3c['uniqueid'],md5(_0x18fa3c[_0xf3fd('0x49')]));}else{_0x18fa3c[_0xf3fd('0x4a')]='';}headers[_0xf3fd('0x4b')]=getAuth(_0x4d6d0e);return getUser(_0x4d6d0e,'')['then'](function(_0x5caa8d){_0x3ba435=_0x5caa8d;logger[_0xf3fd('0xa')](_0xf3fd('0x4c'),_0x3ba435['id']);return getEndUser(_0x4d6d0e,_0x18fa3c[_0xf3fd('0x5e')],_0x18fa3c[_0xf3fd('0xe')]);})[_0xf3fd('0x1c')](function(_0x90d513){_0x507a8b=_0x90d513;logger[_0xf3fd('0xa')](_0xf3fd('0x57'),_0x507a8b['id']);return getTicket(_0x4d6d0e,_0x3ba435,_0x507a8b,_0xb97720,_0x18fa3c);})[_0xf3fd('0x1c')](function(_0x39b732){if(_0x39b732){logger['info']('Ticket\x20created!');logger[_0xf3fd('0xa')](_0xf3fd('0x58'),_0x39b732['id']);}})[_0xf3fd('0x4f')](function(_0x436d6a){logger[_0xf3fd('0x50')]('['+_0x18fa3c[_0xf3fd('0x5c')][_0xf3fd('0x5d')]()+']',JSON[_0xf3fd('0x32')](_0x436d6a));});}; \ No newline at end of file +var _0x4ad4=['recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','%s/helpdesk/tickets/%d','catch','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','mapValues','keyBy','value','remoteUri','then','Ticket\x20created!','format','%s/api/v2/agents','length','Agent\x20found!','find','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!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','nameField','customField','toLowerCase','content','string','push','idField','variable','variableName','customVariable','name','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x4fd959,_0x4b9077){var _0x1a474d=function(_0x3683cf){while(--_0x3683cf){_0x4fd959['push'](_0x4fd959['shift']());}};_0x1a474d(++_0x4b9077);}(_0x4ad4,0xd1));var _0x44ad=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4ad4[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var rp=require(_0x44ad('0x0'));var md5=require(_0x44ad('0x1'));var util=require(_0x44ad('0x2'));var Redis=require(_0x44ad('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x44ad('0x4'))('freshdesk');config[_0x44ad('0x5')]=_[_0x44ad('0x6')](config[_0x44ad('0x5')],{'host':_0x44ad('0x7'),'port':0x18eb});var io=require(_0x44ad('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x44ad('0x9'),'Accept':'application/json'};function emit(_0x4f8dec,_0x595403,_0x46848f){io['to'](_0x4f8dec)[_0x44ad('0xa')](_0x595403,_0x46848f);}function getTicket(_0x551845,_0x25a88f,_0x4e6c0b,_0x3a48fd,_0x27e5e4){logger[_0x44ad('0xb')](_0x44ad('0xc'));var _0x5b90b0=_[_0x44ad('0xd')]({'responder_id':_0x25a88f['id'],'requester_id':_0x4e6c0b['id'],'name':util['format'](_0x44ad('0xe'),_0x27e5e4[_0x44ad('0xf')]),'phone':_0x27e5e4[_0x44ad('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x44ad('0x11')](_0x3a48fd[_0x44ad('0x12')],_0x27e5e4,'\x20'),'description':intUtil[_0x44ad('0x11')](_0x3a48fd[_0x44ad('0x13')],_0x27e5e4,_0x44ad('0x14')),'tags':getTags(_0x3a48fd[_0x44ad('0x15')],'name')},getCustomFields(_0x3a48fd[_0x44ad('0x16')],_0x27e5e4));_0x5b90b0[_0x44ad('0x17')]=_[_0x44ad('0x18')](_[_0x44ad('0x19')](_0x5b90b0['custom_fields'],'id'),_0x44ad('0x1a'));return request({'uri':util['format']('%s/api/v2/tickets',_0x551845[_0x44ad('0x1b')]),'method':'POST','body':_0x5b90b0})[_0x44ad('0x1c')](function(_0x24092f){logger['info'](_0x44ad('0x1d'));return _0x24092f;});}function getUser(_0x47e254,_0x4c981d){if(intUtil['validateEmail'](_0x4c981d)){return request({'uri':util[_0x44ad('0x1e')](_0x44ad('0x1f'),_0x47e254[_0x44ad('0x1b')]),'qs':{'email':_0x4c981d}})[_0x44ad('0x1c')](function(_0x499af8){if(_0x499af8[_0x44ad('0x20')]){logger[_0x44ad('0xb')](_0x44ad('0x21'));return _[_0x44ad('0x22')](_0x499af8,function(_0x3c425b){return _0x3c425b['contact']['email']===_0x4c981d;});}else{logger[_0x44ad('0xb')](_0x44ad('0x23'));return request({'uri':util['format'](_0x44ad('0x24'),_0x47e254[_0x44ad('0x1b')])})[_0x44ad('0x1c')](function(_0x415fe9){logger['info'](_0x44ad('0x25'));return _0x415fe9;});}});}else{logger['info'](_0x44ad('0x26'));return request({'uri':util['format'](_0x44ad('0x24'),_0x47e254[_0x44ad('0x1b')])})[_0x44ad('0x1c')](function(_0xafb35a){logger[_0x44ad('0xb')](_0x44ad('0x25'));return _0xafb35a;});}}function getEndUser(_0x369725,_0x3bde6a,_0x127888){logger['info']('Searching\x20enduser\x20with\x20phone',_0x127888);return request({'uri':util[_0x44ad('0x1e')](_0x44ad('0x27'),_0x369725[_0x44ad('0x1b')]),'qs':{'phone':_0x127888}})[_0x44ad('0x1c')](function(_0x406ed9){if(_0x406ed9[_0x44ad('0x20')]){logger[_0x44ad('0xb')](_0x44ad('0x28'));return _['find'](_0x406ed9,{'phone':_0x127888});}else{logger[_0x44ad('0xb')](_0x44ad('0x29'));return request({'uri':util['format']('%s/api/v2/contacts',_0x369725[_0x44ad('0x1b')]),'method':'POST','body':{'name':_0x3bde6a,'phone':_0x127888}})[_0x44ad('0x1c')](function(_0x4e2117){logger[_0x44ad('0xb')](_0x44ad('0x2a'));return _0x4e2117;});}});}function getAuth(_0x33aff6){return util[_0x44ad('0x1e')]('Basic\x20%s',new Buffer(_0x33aff6[_0x44ad('0x2b')]+':X')[_0x44ad('0x2c')](_0x44ad('0x2d')));}function request(_0x4d1930){logger[_0x44ad('0x2e')](_0x44ad('0x2f'),JSON[_0x44ad('0x30')](_0x4d1930));return rp(_[_0x44ad('0x6')](_0x4d1930,{'method':_0x44ad('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1ec97c,_0x11145b){var _0x365329=[];if(_0x1ec97c&&_0x1ec97c[_0x44ad('0x20')]>0x0){_0x365329=_[_0x44ad('0x32')](_0x1ec97c,_0x11145b);}return _0x365329;}function getCustomFields(_0x376a1c,_0x17d87c){var _0x380e5c=[];var _0x1d054b={'custom_fields':[]};if(_0x376a1c['length']>0x0){_[_0x44ad('0x33')](_0x376a1c,function(_0x4e75e9){if(_0x4e75e9[_0x44ad('0x34')]==='string'&&_0x4e75e9[_0x44ad('0x35')]&&!_0x4e75e9[_0x44ad('0x36')]){_0x1d054b[_0x4e75e9[_0x44ad('0x35')][_0x44ad('0x37')]()]=_0x4e75e9[_0x44ad('0x38')][_0x44ad('0x2c')]();}else if(_0x4e75e9[_0x44ad('0x34')]===_0x44ad('0x39')&&_0x4e75e9['idField']&&_0x4e75e9[_0x44ad('0x36')]){_0x1d054b['custom_fields'][_0x44ad('0x3a')]({'id':_0x4e75e9[_0x44ad('0x3b')],'value':_0x4e75e9['content']['toString']()});}else if(_0x4e75e9[_0x44ad('0x34')]===_0x44ad('0x3c')&&_0x4e75e9['variableName']&&_0x4e75e9[_0x44ad('0x3b')]&&_0x4e75e9['customField']){_0x17d87c[_0x4e75e9[_0x44ad('0x3d')]]&&_0x1d054b['custom_fields'][_0x44ad('0x3a')]({'id':_0x4e75e9[_0x44ad('0x3b')],'value':_0x17d87c[_0x4e75e9[_0x44ad('0x3d')]][_0x44ad('0x2c')]()});}else if(_0x4e75e9['type']===_0x44ad('0x3e')&&_0x4e75e9['Variable']&&_0x4e75e9['Variable'][_0x44ad('0x3f')]&&_0x4e75e9[_0x44ad('0x3b')]&&_0x4e75e9[_0x44ad('0x36')]){_0x17d87c[_0x4e75e9[_0x44ad('0x40')][_0x44ad('0x3f')][_0x44ad('0x37')]()]&&_0x1d054b[_0x44ad('0x17')][_0x44ad('0x3a')]({'id':_0x4e75e9['idField'],'value':_0x17d87c[_0x4e75e9['Variable'][_0x44ad('0x3f')][_0x44ad('0x37')]()][_0x44ad('0x2c')]()});}});}return _0x1d054b;}exports[_0x44ad('0x41')]=function(_0x47ca69,_0x8ecda2,_0x26ee9b,_0x6bfd01,_0x469fcc,_0x5dc924){var _0x1016f8,_0x49fe23;_0x5dc924[_0x44ad('0x1b')]=intUtil[_0x44ad('0x42')](_0x5dc924[_0x44ad('0x1b')]);_0x5dc924[_0x44ad('0x43')]=intUtil['stripTrailingSlash'](_0x5dc924[_0x44ad('0x43')]);if(_0x469fcc&&_0x469fcc[_0x44ad('0x44')]){logger[_0x44ad('0xb')](_0x44ad('0x45'),'Recording\x20is\x20enabled!');_0x8ecda2[_0x44ad('0x46')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5dc924[_0x44ad('0x43')],_0x8ecda2[_0x44ad('0x47')],md5(_0x8ecda2['uniqueid']));}else{_0x8ecda2[_0x44ad('0x46')]='';}headers[_0x44ad('0x48')]=getAuth(_0x5dc924);return getUser(_0x5dc924,_0x6bfd01['email'])[_0x44ad('0x1c')](function(_0x10d66a){_0x1016f8=_0x10d66a;logger[_0x44ad('0xb')](_0x44ad('0x49'),_0x1016f8['id']);return getEndUser(_0x5dc924,_0x8ecda2[_0x44ad('0xf')],_0x8ecda2[_0x44ad('0x10')]);})[_0x44ad('0x1c')](function(_0x2f544c){_0x49fe23=_0x2f544c;logger['info'](_0x44ad('0x4a'),_0x49fe23['id']);return getTicket(_0x5dc924,_0x1016f8,_0x49fe23,_0x26ee9b,_0x8ecda2);})[_0x44ad('0x1c')](function(_0x46bc2a){if(_0x46bc2a&&_0x46bc2a['id']){logger[_0x44ad('0xb')]('Ticket\x20created!');logger['info'](_0x44ad('0x4b'),_0x46bc2a['id']);logger[_0x44ad('0xb')](_0x44ad('0x45'),_0x44ad('0x4c'));emit(util[_0x44ad('0x1e')](_0x44ad('0x4d'),_0x6bfd01[_0x44ad('0x3f')]),_0x44ad('0x4e'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x5dc924[_0x44ad('0x1b')],_0x46bc2a['id'])});}})['catch'](function(_0x516e8b){logger[_0x44ad('0x4f')](_0x44ad('0x45'),JSON['stringify'](_0x516e8b));});};exports[_0x44ad('0x50')]=function(_0x3d8b80,_0x3de1db,_0x16ecf2,_0x1130dc,_0x11e742,_0x5b8b66,_0x45889e){var _0x334683,_0x3e2694;_0x5b8b66[_0x44ad('0x1b')]=intUtil[_0x44ad('0x42')](_0x5b8b66[_0x44ad('0x1b')]);_0x5b8b66[_0x44ad('0x43')]=intUtil[_0x44ad('0x42')](_0x5b8b66[_0x44ad('0x43')]);if(_0x45889e&&_0x45889e[_0x44ad('0x51')]&&_0x45889e[_0x44ad('0x51')]!==_0x44ad('0x52')){logger[_0x44ad('0xb')](_0x44ad('0x53'),'Recording\x20is\x20enabled!');_0x3de1db[_0x44ad('0x46')]=util[_0x44ad('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b8b66[_0x44ad('0x43')],_0x3de1db[_0x44ad('0x47')],md5(_0x3de1db[_0x44ad('0x47')]));}headers[_0x44ad('0x48')]=getAuth(_0x5b8b66);return getUser(_0x5b8b66,_0x1130dc[_0x44ad('0x54')])['then'](function(_0x2e649c){_0x334683=_0x2e649c;logger[_0x44ad('0xb')](_0x44ad('0x49'),_0x334683['id']);return getEndUser(_0x5b8b66,_0x3de1db[_0x44ad('0x55')],_0x3de1db['destcalleridnum']);})['then'](function(_0x58199f){_0x3e2694=_0x58199f;logger[_0x44ad('0xb')](_0x44ad('0x4a'),_0x3e2694['id']);return getTicket(_0x5b8b66,_0x334683,_0x3e2694,_0x16ecf2,_0x3de1db);})[_0x44ad('0x1c')](function(_0x26bc8e){if(_0x26bc8e&&_0x26bc8e['id']){logger[_0x44ad('0xb')](_0x44ad('0x1d'));logger[_0x44ad('0xb')]('The\x20Ticket\x20ID\x20is:',_0x26bc8e['id']);logger[_0x44ad('0xb')](_0x44ad('0x53'),_0x44ad('0x4c'));emit(util['format'](_0x44ad('0x4d'),_0x1130dc[_0x44ad('0x3f')]),_0x44ad('0x4e'),{'uri':util[_0x44ad('0x1e')](_0x44ad('0x56'),_0x5b8b66['remoteUri'],_0x26bc8e['id'])});}})[_0x44ad('0x57')](function(_0x32c6a2){logger[_0x44ad('0x4f')](_0x44ad('0x53'),JSON['stringify'](_0x32c6a2));});};exports[_0x44ad('0x58')]=function(_0x303787,_0x538c19,_0x228f24,_0x53ba63,_0xa3a62d,_0x356398){var _0x38a2a5,_0xaa2ed5;_0x356398[_0x44ad('0x1b')]=intUtil[_0x44ad('0x42')](_0x356398[_0x44ad('0x1b')]);_0x356398[_0x44ad('0x43')]=intUtil[_0x44ad('0x42')](_0x356398[_0x44ad('0x43')]);if(_0xa3a62d&&_0xa3a62d['monitor_format']){logger[_0x44ad('0xb')]('['+_0x538c19[_0x44ad('0x59')][_0x44ad('0x5a')]()+']',_0x44ad('0x5b'));_0x538c19[_0x44ad('0x46')]=util[_0x44ad('0x1e')](_0x44ad('0x5c'),_0x356398[_0x44ad('0x43')],_0x538c19[_0x44ad('0x47')],md5(_0x538c19[_0x44ad('0x47')]));}else{_0x538c19[_0x44ad('0x46')]='';}headers[_0x44ad('0x48')]=getAuth(_0x356398);return getUser(_0x356398,'')[_0x44ad('0x1c')](function(_0x4166a3){_0x38a2a5=_0x4166a3;logger[_0x44ad('0xb')](_0x44ad('0x49'),_0x38a2a5['id']);return getEndUser(_0x356398,_0x538c19['calleridname'],_0x538c19[_0x44ad('0x10')]);})[_0x44ad('0x1c')](function(_0x3fcc12){_0xaa2ed5=_0x3fcc12;logger[_0x44ad('0xb')](_0x44ad('0x4a'),_0xaa2ed5['id']);return getTicket(_0x356398,_0x38a2a5,_0xaa2ed5,_0x228f24,_0x538c19);})['then'](function(_0x1b41c5){if(_0x1b41c5){logger[_0x44ad('0xb')](_0x44ad('0x1d'));logger[_0x44ad('0xb')](_0x44ad('0x4b'),_0x1b41c5['id']);}})[_0x44ad('0x57')](function(_0x407b68){logger[_0x44ad('0x4f')]('['+_0x538c19[_0x44ad('0x59')][_0x44ad('0x5a')]()+']',JSON[_0x44ad('0x30')](_0x407b68));});}; \ 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 8b6d67e..6c552a4 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 _0x3a57=['POST','/api/tasks','getString','Subjects','Contact','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','then','length','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','headers','Getting\x20user\x20list','users','agentEmail','userEmail','email','userId','User\x20found:','Admin\x20selected','catch','/api/contacts/filters','Getting\x20contacts\x20filter','filters','name','Searching\x20contact\x20with\x20phone','contactNumber','find','contacts','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task'];(function(_0xbe62f3,_0x4d34e1){var _0x55b795=function(_0x45dc6a){while(--_0x45dc6a){_0xbe62f3['push'](_0xbe62f3['shift']());}};_0x55b795(++_0x4d34e1);}(_0x3a57,0x172));var _0x73a5=function(_0x484a44,_0x55fcc0){_0x484a44=_0x484a44-0x0;var _0x424b3e=_0x3a57[_0x484a44];return _0x424b3e;};'use strict';var _=require('lodash');var rp=require(_0x73a5('0x0'));var md5=require(_0x73a5('0x1'));var util=require(_0x73a5('0x2'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x73a5('0x3'));var intUtil=require('./util');var config=require(_0x73a5('0x4'));var logger=require(_0x73a5('0x5'))('freshsales');config[_0x73a5('0x6')]=_[_0x73a5('0x7')](config[_0x73a5('0x6')],{'host':_0x73a5('0x8'),'port':0x18eb});var io=require(_0x73a5('0x9'))(new Redis(config[_0x73a5('0x6')]));function getAdminId(_0x1abe89,_0x546ce9,_0x55c7a5,_0x4a0a85){return new Promise(function(_0xd527fb,_0x2158c1){var _0x125309=![];var _0x40427b={'method':_0x73a5('0xa'),'uri':_0x4a0a85+_0x73a5('0xb'),'json':!![]};_0x40427b['headers']=_0x55c7a5;logger['info']('Getting\x20admin\x20information');return rp(_0x40427b)[_0x73a5('0xc')](function(_0x1f51f0){if(_0x1f51f0){var _0x27ce0c=_0x1f51f0['users'];var _0x214185=null;for(_0x214185=0x0;_0x214185<_0x27ce0c[_0x73a5('0xd')];_0x214185++){if(_0x27ce0c[_0x214185]['email']===_0x1abe89[_0x73a5('0xe')]){_0x1abe89[_0x73a5('0xf')]=_0x27ce0c[_0x214185]['id'];_0x125309=!![];}}if(_0x125309){logger[_0x73a5('0x10')](_0x73a5('0x11'),_0x1abe89[_0x73a5('0xf')]);_0xd527fb(_0x1abe89);}else{_0x2158c1({'statusCode':0x194,'message':_0x73a5('0x12')});}}else{_0x2158c1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x41d9d1){logger[_0x73a5('0x13')]('['+[_0x546ce9[_0x73a5('0x14')]()]+']',_0x41d9d1[_0x73a5('0x15')]);_0x2158c1(_0x41d9d1);});});}function getUser(_0x458b3e,_0x3a09b0,_0x483e5a){return function(_0x471686){return new Promise(function(_0x55221a,_0x5cb216){var _0x104dfb={'method':_0x73a5('0xa'),'uri':_0x483e5a+_0x73a5('0xb'),'json':!![]};_0x104dfb[_0x73a5('0x16')]=_0x3a09b0;logger[_0x73a5('0x10')](_0x73a5('0x17'));return rp(_0x104dfb)['then'](function(_0x82f7a2){if(_0x82f7a2){var _0x37151f=_0x82f7a2[_0x73a5('0x18')];var _0x2bf6d9=![];var _0x437cad=null;if(_0x471686[_0x73a5('0x19')]!==null){logger[_0x73a5('0x10')]('Getting\x20user\x20with\x20email',_0x471686[_0x73a5('0x19')]);_0x471686[_0x73a5('0x1a')]=_0x471686[_0x73a5('0x19')];for(_0x437cad=0x0;_0x437cad<_0x37151f[_0x73a5('0xd')];_0x437cad++){if(_0x37151f[_0x437cad][_0x73a5('0x1b')]===_0x471686[_0x73a5('0x19')]){_0x2bf6d9=!![];_0x471686[_0x73a5('0x1c')]=_0x37151f[_0x437cad]['id'];logger['info'](_0x73a5('0x1d'),_0x471686['userId']);}}}if(!_0x2bf6d9){logger[_0x73a5('0x10')](_0x73a5('0x1e'));_0x471686[_0x73a5('0x1a')]=_0x471686[_0x73a5('0xe')];_0x471686[_0x73a5('0x1c')]=_0x471686[_0x73a5('0xf')];_0x2bf6d9=!![];}if(_0x2bf6d9){_0x55221a(_0x471686);}else{_0x5cb216({'statusCode':0x194,'message':_0x73a5('0x12')});}}else{_0x5cb216({'statusCode':0x194,'message':_0x73a5('0x12')});}})[_0x73a5('0x1f')](function(_0xe9c65f){logger['error']('['+[_0x458b3e[_0x73a5('0x14')]()]+']',_0xe9c65f['message']);_0x5cb216(_0xe9c65f);});});};}function getEndUser(_0x359fd8,_0x2b0440,_0x1be4de){return function(_0x5a42da){return new Promise(function(_0x1d2050,_0x24431d){var _0x53228c=0x0;var _0x18ff90={'method':_0x73a5('0xa'),'uri':_0x1be4de+_0x73a5('0x20'),'json':!![]};_0x18ff90[_0x73a5('0x16')]=_0x2b0440;logger[_0x73a5('0x10')](_0x73a5('0x21'));return rp(_0x18ff90)[_0x73a5('0xc')](function(_0x4e938c){_0x4e938c[_0x73a5('0x22')]['forEach'](function(_0x2f16fc){if(_0x2f16fc[_0x73a5('0x23')]==='All\x20Contacts'){_0x53228c=_0x2f16fc['id'];}});})[_0x73a5('0xc')](function(){logger[_0x73a5('0x10')]('Getting\x20contact\x20list');var _0x11903d={'method':_0x73a5('0xa'),'uri':_0x1be4de+'/api/contacts/view/'+_0x53228c,'json':!![]};_0x11903d[_0x73a5('0x16')]=_0x2b0440;return rp(_0x11903d);})[_0x73a5('0xc')](function(_0x43093b){logger[_0x73a5('0x10')](_0x73a5('0x24'),_0x5a42da[_0x73a5('0x25')]);if(_0x43093b['contacts'][_0x73a5('0xd')]>0x0){var _0x5bdb42=_[_0x73a5('0x26')](_0x43093b[_0x73a5('0x27')],function(_0x119bd5){if(_0x119bd5['work_number']===_0x5a42da[_0x73a5('0x25')]||_0x119bd5[_0x73a5('0x28')]===_0x5a42da[_0x73a5('0x25')]){return _0x119bd5;}});if(_0x5bdb42){_0x5a42da[_0x73a5('0x29')]=_0x5bdb42['id'];logger[_0x73a5('0x10')](_0x73a5('0x2a'),_0x5a42da['endUserId']);_0x1d2050(_0x5a42da);}else{return createEndUser(_0x5a42da,_0x359fd8,_0x2b0440,_0x1be4de)[_0x73a5('0xc')](function(_0x36c69a){logger[_0x73a5('0x10')](_0x73a5('0x2b'),_0x5a42da[_0x73a5('0x29')]);_0x1d2050(_0x36c69a);});}}else{return createEndUser(_0x5a42da,_0x359fd8,_0x2b0440,_0x1be4de)['then'](function(_0x51b5c8){logger[_0x73a5('0x10')](_0x73a5('0x2b'),_0x5a42da[_0x73a5('0x29')]);_0x1d2050(_0x51b5c8);});}})[_0x73a5('0x1f')](function(_0x337ab9){throw new Error(_0x337ab9[_0x73a5('0x15')]);});});};}function createEndUser(_0x5f4bad,_0x1593f6,_0x4bb6af,_0x4fed29){return new Promise(function(_0x194b01,_0x2bb077){var _0x293e26=moment();var _0x4d650a={'method':'POST','uri':_0x4fed29+_0x73a5('0x2c'),'body':{'contact':{'last_name':_0x5f4bad[_0x73a5('0x25')],'work_number':_0x5f4bad['contactNumber'],'mobile_number':_0x5f4bad[_0x73a5('0x25')],'owner_id':_0x5f4bad[_0x73a5('0x1c')],'created_at':_0x293e26[_0x73a5('0x2d')](_0x73a5('0x2e'))}},'json':!![]};_0x4d650a['headers']=_0x4bb6af;logger['info'](_0x73a5('0x2f'));return rp(_0x4d650a)[_0x73a5('0xc')](function(_0x472500){_0x5f4bad[_0x73a5('0x29')]=_0x472500[_0x73a5('0x30')]['id'];_0x194b01(_0x5f4bad);})[_0x73a5('0x1f')](function(_0x348fa7){logger[_0x73a5('0x13')]('['+[_0x1593f6[_0x73a5('0x14')]()]+']',_0x348fa7['message']);_0x2bb077(_0x348fa7[_0x73a5('0x15')]);});});}function getTicket(_0x5ca293,_0x1b0d47,_0x136ae5,_0x41e6d0,_0x593b12){return function(_0x179c3d){logger[_0x73a5('0x10')](_0x73a5('0x31'));return new Promise(function(_0x257f8b,_0x522cf3){var _0x107cfd=moment();var _0x38f973={'method':_0x73a5('0x32'),'uri':_0x136ae5+_0x73a5('0x33'),'body':{'title':intUtil[_0x73a5('0x34')](_0x41e6d0[_0x73a5('0x35')],_0x593b12,'\x20'),'description':intUtil[_0x73a5('0x34')](_0x41e6d0['Descriptions'],_0x593b12,'\x0a'),'owner_id':_0x179c3d[_0x73a5('0x1c')],'creater_id':_0x179c3d[_0x73a5('0xf')],'targetable_id':_0x179c3d[_0x73a5('0x29')],'targetable_type':_0x73a5('0x36'),'created_at':_0x107cfd['format'](_0x73a5('0x2e')),'due_date':_0x107cfd[_0x73a5('0x37')](0x1e,'m')[_0x73a5('0x2d')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x38f973[_0x73a5('0x16')]=_0x1b0d47;return rp(_0x38f973)[_0x73a5('0xc')](function(_0x51f8c5){_0x179c3d[_0x73a5('0x38')]=_0x51f8c5['task']['id'];logger[_0x73a5('0x10')](_0x73a5('0x39'),_0x179c3d[_0x73a5('0x38')]);_0x257f8b(_0x179c3d);})['catch'](function(_0x4f07ed){logger[_0x73a5('0x13')]('['+[_0x5ca293[_0x73a5('0x14')]()]+']',_0x4f07ed[_0x73a5('0x15')]);_0x522cf3(_0x4f07ed[_0x73a5('0x15')]);});});};}function emit(_0x44c6a1,_0x53e433,_0x51c03e){var _0x1c7e7e={'uri':_0x44c6a1+_0x73a5('0x3a')+_0x51c03e};io['to'](util[_0x73a5('0x2d')](_0x73a5('0x3b'),_0x53e433))[_0x73a5('0x3c')](_0x73a5('0x3d'),_0x1c7e7e);}exports['cs']=function(_0x1f8888,_0xfd704d,_0x42b51c,_0x2ef4f2,_0x5e7bf7,_0x26d955,_0x4e10e5,_0x46ae03){var _0x266f88={};var _0x134f25={'Authorization':_0x73a5('0x3e')+_0x26d955[_0x73a5('0x3f')]};_0x26d955[_0x73a5('0x40')]=intUtil[_0x73a5('0x41')](_0x26d955[_0x73a5('0x40')]);_0x26d955['serverUrl']=intUtil[_0x73a5('0x41')](_0x26d955[_0x73a5('0x42')]);var _0x4f7f0e=_0x26d955[_0x73a5('0x40')];_0x266f88['adminEmail']=_0x26d955['username'];_0x266f88[_0x73a5('0x25')]=_0x46ae03[_0x73a5('0x43')]()===_0x73a5('0x44')?_0xfd704d[_0x73a5('0x45')]:_0xfd704d[_0x73a5('0x46')];_0x266f88[_0x73a5('0x47')]=_0x46ae03===_0x73a5('0x48')||_0x46ae03==='unmanaged'?_0x73a5('0x48'):_0x73a5('0x44');if(_0x2ef4f2){_0x266f88[_0x73a5('0x19')]=_0x2ef4f2[_0x73a5('0x1b')];}var _0x57b439=util[_0x73a5('0x2d')](_0x73a5('0x49'),_0x26d955[_0x73a5('0x42')],_0xfd704d[_0x73a5('0x4a')],md5(_0xfd704d[_0x73a5('0x4a')]));if(_0x5e7bf7&&_0x5e7bf7['monitor_format']){logger[_0x73a5('0x10')](_0x73a5('0x4b'),_0x73a5('0x4c'));_0xfd704d['recordingURL']=_0x57b439;}else if(_0x4e10e5&&_0x4e10e5[_0x73a5('0x4d')]&&_0x4e10e5[_0x73a5('0x4d')]!=='none'){logger[_0x73a5('0x10')](_0x73a5('0x4e'),_0x73a5('0x4c'));_0xfd704d[_0x73a5('0x4f')]=_0x57b439;}else{_0xfd704d['recordingURL']='';}return getAdminId(_0x266f88,_0x46ae03,_0x134f25,_0x4f7f0e)['then'](getUser(_0x46ae03,_0x134f25,_0x4f7f0e))[_0x73a5('0xc')](getEndUser(_0x46ae03,_0x134f25,_0x4f7f0e))[_0x73a5('0xc')](getTicket(_0x46ae03,_0x134f25,_0x4f7f0e,_0x42b51c,_0xfd704d))['then'](function(_0x22fb27){logger['info'](util[_0x73a5('0x2d')](_0x73a5('0x50'),_0x22fb27[_0x73a5('0x38')]));if(_0x46ae03!=='unmanaged'){logger[_0x73a5('0x10')]('['+[_0x46ae03[_0x73a5('0x14')]()]+']',_0x73a5('0x51'));emit(_0x4f7f0e,_0x2ef4f2[_0x73a5('0x23')],_0x22fb27['endUserId']);}})[_0x73a5('0x1f')](function(_0xe5927){logger[_0x73a5('0x13')]('['+[_0x46ae03[_0x73a5('0x14')]()]+_0x73a5('0x52'),util[_0x73a5('0x53')](_0xe5927,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9684=['Subjects','getString','Descriptions','Contact','add','ticketId','task','user:%s','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','toUpperCase',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','info','users','length','email','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','GET','agentEmail','Getting\x20user\x20with\x20email','userId','User\x20found:','adminId','message','/api/contacts/filters','Getting\x20contacts\x20filter','filters','name','All\x20Contacts','then','Getting\x20contact\x20list','headers','contactNumber','contacts','Contact\x20found:','endUserId','Contact\x20created:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks'];(function(_0x9f48e6,_0x8f87aa){var _0x45fc5c=function(_0xab1f4e){while(--_0xab1f4e){_0x9f48e6['push'](_0x9f48e6['shift']());}};_0x45fc5c(++_0x8f87aa);}(_0x9684,0x1bb));var _0x4968=function(_0x3ae4ae,_0x4a0ed0){_0x3ae4ae=_0x3ae4ae-0x0;var _0x4da684=_0x9684[_0x3ae4ae];return _0x4da684;};'use strict';var _=require(_0x4968('0x0'));var rp=require(_0x4968('0x1'));var md5=require(_0x4968('0x2'));var util=require(_0x4968('0x3'));var moment=require(_0x4968('0x4'));var Promise=require(_0x4968('0x5'));var Redis=require(_0x4968('0x6'));var intUtil=require(_0x4968('0x7'));var config=require(_0x4968('0x8'));var logger=require(_0x4968('0x9'))('freshsales');config[_0x4968('0xa')]=_[_0x4968('0xb')](config[_0x4968('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x4968('0xc'))(new Redis(config[_0x4968('0xa')]));function getAdminId(_0x33c006,_0x58dc97,_0x7e7cb4,_0x186b12){return new Promise(function(_0x5ca375,_0x1dc19a){var _0x5e056e=![];var _0x40f66e={'method':'GET','uri':_0x186b12+'/api/selector/owners','json':!![]};_0x40f66e['headers']=_0x7e7cb4;logger[_0x4968('0xd')]('Getting\x20admin\x20information');return rp(_0x40f66e)['then'](function(_0x31e40c){if(_0x31e40c){var _0x237951=_0x31e40c[_0x4968('0xe')];var _0x5711c3=null;for(_0x5711c3=0x0;_0x5711c3<_0x237951[_0x4968('0xf')];_0x5711c3++){if(_0x237951[_0x5711c3][_0x4968('0x10')]===_0x33c006['adminEmail']){_0x33c006['adminId']=_0x237951[_0x5711c3]['id'];_0x5e056e=!![];}}if(_0x5e056e){logger[_0x4968('0xd')](_0x4968('0x11'),_0x33c006['adminId']);_0x5ca375(_0x33c006);}else{_0x1dc19a({'statusCode':0x194,'message':_0x4968('0x12')});}}else{_0x1dc19a({'statusCode':0x194,'message':_0x4968('0x12')});}})[_0x4968('0x13')](function(_0x21a90a){logger[_0x4968('0x14')]('['+[_0x58dc97['toUpperCase']()]+']',_0x21a90a['message']);_0x1dc19a(_0x21a90a);});});}function getUser(_0x1954db,_0x5760e6,_0x4bab20){return function(_0x5c7919){return new Promise(function(_0x316b50,_0x26a9f6){var _0x450e8a={'method':_0x4968('0x15'),'uri':_0x4bab20+'/api/selector/owners','json':!![]};_0x450e8a['headers']=_0x5760e6;logger[_0x4968('0xd')]('Getting\x20user\x20list');return rp(_0x450e8a)['then'](function(_0x228cc6){if(_0x228cc6){var _0x50d692=_0x228cc6[_0x4968('0xe')];var _0x2e5bfd=![];var _0x1b13ad=null;if(_0x5c7919[_0x4968('0x16')]!==null){logger['info'](_0x4968('0x17'),_0x5c7919[_0x4968('0x16')]);_0x5c7919['userEmail']=_0x5c7919[_0x4968('0x16')];for(_0x1b13ad=0x0;_0x1b13ad<_0x50d692[_0x4968('0xf')];_0x1b13ad++){if(_0x50d692[_0x1b13ad][_0x4968('0x10')]===_0x5c7919[_0x4968('0x16')]){_0x2e5bfd=!![];_0x5c7919[_0x4968('0x18')]=_0x50d692[_0x1b13ad]['id'];logger[_0x4968('0xd')](_0x4968('0x19'),_0x5c7919[_0x4968('0x18')]);}}}if(!_0x2e5bfd){logger[_0x4968('0xd')]('Admin\x20selected');_0x5c7919['userEmail']=_0x5c7919['adminEmail'];_0x5c7919[_0x4968('0x18')]=_0x5c7919[_0x4968('0x1a')];_0x2e5bfd=!![];}if(_0x2e5bfd){_0x316b50(_0x5c7919);}else{_0x26a9f6({'statusCode':0x194,'message':_0x4968('0x12')});}}else{_0x26a9f6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x4968('0x13')](function(_0x18e75c){logger[_0x4968('0x14')]('['+[_0x1954db['toUpperCase']()]+']',_0x18e75c[_0x4968('0x1b')]);_0x26a9f6(_0x18e75c);});});};}function getEndUser(_0x1fa665,_0x364fa7,_0x31ecbc){return function(_0x268439){return new Promise(function(_0x395f56,_0x4e089e){var _0x175bc2=0x0;var _0x99f1a={'method':_0x4968('0x15'),'uri':_0x31ecbc+_0x4968('0x1c'),'json':!![]};_0x99f1a['headers']=_0x364fa7;logger['info'](_0x4968('0x1d'));return rp(_0x99f1a)['then'](function(_0x491e1b){_0x491e1b[_0x4968('0x1e')]['forEach'](function(_0x22a44a){if(_0x22a44a[_0x4968('0x1f')]===_0x4968('0x20')){_0x175bc2=_0x22a44a['id'];}});})[_0x4968('0x21')](function(){logger[_0x4968('0xd')](_0x4968('0x22'));var _0x4aa3e6={'method':'GET','uri':_0x31ecbc+'/api/contacts/view/'+_0x175bc2,'json':!![]};_0x4aa3e6[_0x4968('0x23')]=_0x364fa7;return rp(_0x4aa3e6);})[_0x4968('0x21')](function(_0x13857e){logger[_0x4968('0xd')]('Searching\x20contact\x20with\x20phone',_0x268439[_0x4968('0x24')]);if(_0x13857e[_0x4968('0x25')][_0x4968('0xf')]>0x0){var _0x14755f=_['find'](_0x13857e[_0x4968('0x25')],function(_0x34d0a5){if(_0x34d0a5['work_number']===_0x268439[_0x4968('0x24')]||_0x34d0a5['mobile_number']===_0x268439['contactNumber']){return _0x34d0a5;}});if(_0x14755f){_0x268439['endUserId']=_0x14755f['id'];logger[_0x4968('0xd')](_0x4968('0x26'),_0x268439[_0x4968('0x27')]);_0x395f56(_0x268439);}else{return createEndUser(_0x268439,_0x1fa665,_0x364fa7,_0x31ecbc)[_0x4968('0x21')](function(_0x1c1bb6){logger[_0x4968('0xd')](_0x4968('0x28'),_0x268439['endUserId']);_0x395f56(_0x1c1bb6);});}}else{return createEndUser(_0x268439,_0x1fa665,_0x364fa7,_0x31ecbc)[_0x4968('0x21')](function(_0x3bab10){logger['info'](_0x4968('0x28'),_0x268439[_0x4968('0x27')]);_0x395f56(_0x3bab10);});}})[_0x4968('0x13')](function(_0x5c65a9){throw new Error(_0x5c65a9[_0x4968('0x1b')]);});});};}function createEndUser(_0xe1be84,_0x5a2097,_0x28b7d8,_0x54a3c9){return new Promise(function(_0x497fd4,_0x599b5f){var _0xb76546=moment();var _0x33ccc2={'method':_0x4968('0x29'),'uri':_0x54a3c9+_0x4968('0x2a'),'body':{'contact':{'last_name':_0xe1be84[_0x4968('0x24')],'work_number':_0xe1be84[_0x4968('0x24')],'mobile_number':_0xe1be84[_0x4968('0x24')],'owner_id':_0xe1be84[_0x4968('0x18')],'created_at':_0xb76546[_0x4968('0x2b')](_0x4968('0x2c'))}},'json':!![]};_0x33ccc2[_0x4968('0x23')]=_0x28b7d8;logger[_0x4968('0xd')](_0x4968('0x2d'));return rp(_0x33ccc2)[_0x4968('0x21')](function(_0x16653d){_0xe1be84[_0x4968('0x27')]=_0x16653d[_0x4968('0x2e')]['id'];_0x497fd4(_0xe1be84);})[_0x4968('0x13')](function(_0x576997){logger[_0x4968('0x14')]('['+[_0x5a2097['toUpperCase']()]+']',_0x576997[_0x4968('0x1b')]);_0x599b5f(_0x576997[_0x4968('0x1b')]);});});}function getTicket(_0x370abb,_0x35e0ab,_0xc62202,_0x472c97,_0xe6d90b){return function(_0x309317){logger['info'](_0x4968('0x2f'));return new Promise(function(_0x49fea9,_0x4f8f0c){var _0x2be532=moment();var _0x420a89={'method':_0x4968('0x29'),'uri':_0xc62202+_0x4968('0x30'),'body':{'title':intUtil['getString'](_0x472c97[_0x4968('0x31')],_0xe6d90b,'\x20'),'description':intUtil[_0x4968('0x32')](_0x472c97[_0x4968('0x33')],_0xe6d90b,'\x0a'),'owner_id':_0x309317[_0x4968('0x18')],'creater_id':_0x309317[_0x4968('0x1a')],'targetable_id':_0x309317[_0x4968('0x27')],'targetable_type':_0x4968('0x34'),'created_at':_0x2be532[_0x4968('0x2b')](_0x4968('0x2c')),'due_date':_0x2be532[_0x4968('0x35')](0x1e,'m')[_0x4968('0x2b')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x420a89[_0x4968('0x23')]=_0x35e0ab;return rp(_0x420a89)[_0x4968('0x21')](function(_0x13ae91){_0x309317[_0x4968('0x36')]=_0x13ae91[_0x4968('0x37')]['id'];logger[_0x4968('0xd')]('Task\x20created:',_0x309317[_0x4968('0x36')]);_0x49fea9(_0x309317);})[_0x4968('0x13')](function(_0xec4ac3){logger[_0x4968('0x14')]('['+[_0x370abb['toUpperCase']()]+']',_0xec4ac3[_0x4968('0x1b')]);_0x4f8f0c(_0xec4ac3[_0x4968('0x1b')]);});});};}function emit(_0x50568a,_0x3ea3f3,_0x2f3a93){var _0x5e3a6b={'uri':_0x50568a+'/contacts/'+_0x2f3a93};io['to'](util[_0x4968('0x2b')](_0x4968('0x38'),_0x3ea3f3))['emit']('trigger:browser:url',_0x5e3a6b);}exports['cs']=function(_0x253599,_0x1b44d7,_0x287a6e,_0x96d90,_0xdaca16,_0x222cfe,_0xfb238e,_0x57d641){var _0x4b1188={};var _0x202096={'Authorization':_0x4968('0x39')+_0x222cfe[_0x4968('0x3a')]};_0x222cfe[_0x4968('0x3b')]=intUtil[_0x4968('0x3c')](_0x222cfe[_0x4968('0x3b')]);_0x222cfe[_0x4968('0x3d')]=intUtil[_0x4968('0x3c')](_0x222cfe[_0x4968('0x3d')]);var _0x2af366=_0x222cfe[_0x4968('0x3b')];_0x4b1188[_0x4968('0x3e')]=_0x222cfe[_0x4968('0x3f')];_0x4b1188[_0x4968('0x24')]=_0x57d641[_0x4968('0x40')]()==='outbound'?_0x1b44d7[_0x4968('0x41')]:_0x1b44d7[_0x4968('0x42')];_0x4b1188[_0x4968('0x43')]=_0x57d641===_0x4968('0x44')||_0x57d641==='unmanaged'?'queue':'outbound';if(_0x96d90){_0x4b1188[_0x4968('0x16')]=_0x96d90[_0x4968('0x10')];}var _0x24dde6=util['format'](_0x4968('0x45'),_0x222cfe['serverUrl'],_0x1b44d7[_0x4968('0x46')],md5(_0x1b44d7[_0x4968('0x46')]));if(_0xdaca16&&_0xdaca16['monitor_format']){logger[_0x4968('0xd')]('[QUEUE]',_0x4968('0x47'));_0x1b44d7['recordingURL']=_0x24dde6;}else if(_0xfb238e&&_0xfb238e[_0x4968('0x48')]&&_0xfb238e[_0x4968('0x48')]!==_0x4968('0x49')){logger[_0x4968('0xd')](_0x4968('0x4a'),_0x4968('0x47'));_0x1b44d7[_0x4968('0x4b')]=_0x24dde6;}else{_0x1b44d7[_0x4968('0x4b')]='';}return getAdminId(_0x4b1188,_0x57d641,_0x202096,_0x2af366)[_0x4968('0x21')](getUser(_0x57d641,_0x202096,_0x2af366))[_0x4968('0x21')](getEndUser(_0x57d641,_0x202096,_0x2af366))[_0x4968('0x21')](getTicket(_0x57d641,_0x202096,_0x2af366,_0x287a6e,_0x1b44d7))['then'](function(_0x2eab17){logger[_0x4968('0xd')](util[_0x4968('0x2b')](_0x4968('0x4c'),_0x2eab17[_0x4968('0x36')]));if(_0x57d641!==_0x4968('0x4d')){logger[_0x4968('0xd')]('['+[_0x57d641['toUpperCase']()]+']',_0x4968('0x4e'));emit(_0x2af366,_0x96d90[_0x4968('0x1f')],_0x2eab17[_0x4968('0x27')]);}})[_0x4968('0x13')](function(_0x33c994){logger[_0x4968('0x14')]('['+[_0x57d641[_0x4968('0x4f')]()]+_0x4968('0x50'),util[_0x4968('0x51')](_0x33c994,{'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 5cb743f..65689f7 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(_0x3cd451,_0x26e81a){var _0x571ce6=function(_0x27af9e){while(--_0x27af9e){_0x3cd451['push'](_0x3cd451['shift']());}};_0x571ce6(++_0x26e81a);}(_0xefda,0x96));var _0xaefd=function(_0x188ac2,_0x27a61a){_0x188ac2=_0x188ac2-0x0;var _0x135c31=_0xefda[_0x188ac2];return _0x135c31;};'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 _0x80ed=['[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','error','%s\x20configuration\x20#%s\x20not\x20found'];(function(_0x51fce0,_0x36e4f2){var _0xe01f2c=function(_0x13eea0){while(--_0x13eea0){_0x51fce0['push'](_0x51fce0['shift']());}};_0xe01f2c(++_0x36e4f2);}(_0x80ed,0x11c));var _0xd80e=function(_0x448011,_0x161984){_0x448011=_0x448011-0x0;var _0x2579cd=_0x80ed[_0x448011];return _0x2579cd;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var zendesk=require(_0xd80e('0x1'));var salesforce=require(_0xd80e('0x2'));var sugarcrm=require(_0xd80e('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xd80e('0x4'));var desk=require(_0xd80e('0x5'));var vtiger=require(_0xd80e('0x6'));var servicenow=require(_0xd80e('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0xd80e('0x8'));var integrations=[_0xd80e('0x9'),_0xd80e('0xa'),'sugarcrm',_0xd80e('0xb'),_0xd80e('0xc'),_0xd80e('0xd'),_0xd80e('0xe'),_0xd80e('0xf'),_0xd80e('0x10'),_0xd80e('0x11')];exports[_0xd80e('0x12')]=function(_0x68625,_0x7f93b4,_0x4eee08,_0x450b44,_0x16dbb6,_0xa50f0f){if(_0x4eee08){if(_[_0xd80e('0x13')](integrations,_0x68625[_0xd80e('0x14')][_0xd80e('0x15')]())){try{var _0x1a9024=null;var _0x118f53='';var _0x1d3fcf=_0x4eee08[_0x68625['data1']['toLowerCase']()];if(_0x1d3fcf){var _0x5eb3b2=_0x1d3fcf[_0x68625['data2']];if(_0x5eb3b2){var _0x145766=_[_0xd80e('0x16')](_0x5eb3b2[_0xd80e('0x17')],{'id':parseInt(_0x68625[_0xd80e('0x18')],0xa)});if(_0x145766){if(_0x450b44){if(_0x16dbb6&&_0x7f93b4[_0xd80e('0x19')]){_0x118f53='queue';}else if(_0x7f93b4[_0xd80e('0x1a')]){_0x118f53=_0xd80e('0x1b');}else{console[_0xd80e('0x1c')](_0xd80e('0x1d'),_0x7f93b4);}}else{_0x118f53=_0xd80e('0x1e');}switch(_0x68625[_0xd80e('0x14')][_0xd80e('0x15')]()){case _0xd80e('0x9'):zendesk[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case'salesforce':salesforce[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case _0xd80e('0x1f'):sugarcrm[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case _0xd80e('0xb'):freshdesk[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case _0xd80e('0xc'):zoho[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case _0xd80e('0xd'):desk[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case'vtiger':vtiger[_0x118f53](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f);break;case _0xd80e('0x10'):freshsales['cs'](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f,_0x118f53);break;case _0xd80e('0x11'):servicenow['cs'](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f,_0x118f53);break;case _0xd80e('0xf'):dynamics365['cs'](_0x68625,_0x7f93b4,_0x145766,_0x450b44,_0x16dbb6,_0x5eb3b2,_0xa50f0f,_0x118f53);break;default:console['log'](_0xd80e('0x20'));}}else{_0x1a9024=require(_0xd80e('0x21'))(_0x68625[_0xd80e('0x14')][_0xd80e('0x15')]());_0x1a9024[_0xd80e('0x22')]('[EXEC]',util['format'](_0xd80e('0x23'),_0x68625[_0xd80e('0x14')][_0xd80e('0x15')](),_0x68625[_0xd80e('0x18')]));}}else{_0x1a9024=require(_0xd80e('0x21'))(_0x68625[_0xd80e('0x14')][_0xd80e('0x15')]());_0x1a9024['error'](_0xd80e('0x24'),util[_0xd80e('0x25')](_0xd80e('0x26'),_0x68625['data1'][_0xd80e('0x15')](),_0x68625[_0xd80e('0x27')]));}}else{}}catch(_0xe9bb59){console['error'](_0xe9bb59);}}}}; \ 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 f7e761f..be2d77b 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 _0xcc46=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','newTab','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','uniqueid','destcalleridname','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','%s/%s/e','stringify','unmanaged','isNil','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','assign','utc','getString','Subjects','WhoId','Case','Descriptions','ContactId','sobject','create','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','lead','contact','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Task','Company','No\x20Company','upperFirst','forEach','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','recordingURL'];(function(_0x12840e,_0xc5687d){var _0x4e321d=function(_0x169eef){while(--_0x169eef){_0x12840e['push'](_0x12840e['shift']());}};_0x4e321d(++_0xc5687d);}(_0xcc46,0x105));var _0x6cc4=function(_0xbc1840,_0x2db64a){_0xbc1840=_0xbc1840-0x0;var _0x1aef24=_0xcc46[_0xbc1840];return _0x1aef24;};'use strict';var _=require('lodash');var rp=require(_0x6cc4('0x0'));var moment=require(_0x6cc4('0x1'));var BPromise=require(_0x6cc4('0x2'));var md5=require(_0x6cc4('0x3'));var jsforce=require(_0x6cc4('0x4'));var util=require(_0x6cc4('0x5'));var Redis=require(_0x6cc4('0x6'));var intUtil=require(_0x6cc4('0x7'));var config=require(_0x6cc4('0x8'));var logger=require(_0x6cc4('0x9'))(_0x6cc4('0xa'));config[_0x6cc4('0xb')]=_[_0x6cc4('0xc')](config[_0x6cc4('0xb')],{'host':_0x6cc4('0xd'),'port':0x18eb});var io=require(_0x6cc4('0xe'))(new Redis(config['redis']));function emit(_0x1a4ef5,_0x274817,_0x417ecb){io['to'](_0x1a4ef5)[_0x6cc4('0xf')](_0x274817,_0x417ecb);}function getTicket(_0x382726,_0x313f8a,_0x2bc97f,_0x1a2b86,_0x304595,_0x2fc623,_0x40f7d1,_0x51be3b){var _0x407783={};if(_0x1a2b86[_0x6cc4('0x10')]==='Task'){_0x407783=Object[_0x6cc4('0x11')]({},{'OwnerId':_0x313f8a['id'],'ActivityDate':moment[_0x6cc4('0x12')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x6cc4('0x13')](_0x1a2b86[_0x6cc4('0x14')],_0x304595,'\x20'),'Description':intUtil[_0x6cc4('0x13')](_0x1a2b86['Descriptions'],_0x304595,'\x0a')},getCustomFields(_0x2fc623,_0x304595));if(_0x2bc97f){_0x407783[_0x6cc4('0x15')]=_0x2bc97f['id'];}}else if(_0x1a2b86[_0x6cc4('0x10')]===_0x6cc4('0x16')){_0x407783=Object[_0x6cc4('0x11')]({},{'OwnerId':_0x313f8a['id'],'Subject':intUtil[_0x6cc4('0x13')](_0x1a2b86[_0x6cc4('0x14')],_0x304595,'\x20'),'Description':intUtil[_0x6cc4('0x13')](_0x1a2b86[_0x6cc4('0x17')],_0x304595,'\x0a')},getCustomFields(_0x2fc623,_0x304595));if(_0x2bc97f){_0x407783[_0x6cc4('0x18')]=_0x2bc97f['id'];}}return _0x40f7d1[_0x6cc4('0x19')](_0x1a2b86['ticketType'])[_0x6cc4('0x1a')](_0x407783);}function getUser(_0x4f828e,_0x3cf75e,_0x441e65){if(!_['isNil'](_0x3cf75e)&&intUtil['validateEmail'](_0x3cf75e)){var _0x135f72={'Email':_0x3cf75e};var _0x55fb52={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x441e65[_0x6cc4('0x19')](_0x6cc4('0x1b'))[_0x6cc4('0x1c')](_0x135f72,_0x55fb52)['execute']()[_0x6cc4('0x1d')](function(_0x2cbdb3){if(_0x2cbdb3[_0x6cc4('0x1e')]){var _0x1a6b5a=_[_0x6cc4('0x1c')](_0x2cbdb3,function(_0x10f253){return _0x10f253[_0x6cc4('0x1f')]===_0x3cf75e;});if(_0x1a6b5a){logger[_0x6cc4('0x20')](_0x6cc4('0x21'),_0x3cf75e);return BPromise[_0x6cc4('0x22')]({'id':_0x1a6b5a['Id'],'name':_0x1a6b5a[_0x6cc4('0x23')]});}}else{logger[_0x6cc4('0x20')](_0x6cc4('0x24'),_0x3cf75e);return _0x441e65[_0x6cc4('0x25')]()[_0x6cc4('0x1d')](function(_0xb2d21e){return BPromise[_0x6cc4('0x22')]({'id':_0xb2d21e[_0x6cc4('0x26')],'name':_0xb2d21e[_0x6cc4('0x27')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3cf75e);return _0x441e65[_0x6cc4('0x25')]()[_0x6cc4('0x1d')](function(_0x3ebf15){return BPromise[_0x6cc4('0x22')]({'id':_0x3ebf15[_0x6cc4('0x26')],'name':_0x3ebf15[_0x6cc4('0x27')]});});}}function getEndUser(_0x15fdbf,_0x4de5c0,_0x14290c,_0x3f5aaa,_0x5ce847){var _0x3d39f9={'Phone':_0x3f5aaa};var _0x59d617={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6cc4('0x22')]()[_0x6cc4('0x1d')](function(){if(_0x4de5c0[_0x6cc4('0x10')]==='Task'){logger[_0x6cc4('0x20')](_0x6cc4('0x28'),_0x3f5aaa,_0x4de5c0[_0x6cc4('0x29')]);switch(_0x4de5c0[_0x6cc4('0x29')]){case _0x6cc4('0x2a'):return _0x5ce847['sobject'](_0x6cc4('0x2b'))[_0x6cc4('0x1c')](_0x3d39f9,_0x59d617)[_0x6cc4('0x2c')]()[_0x6cc4('0x1d')](function(_0xa88c9b){if(_0xa88c9b&&_0xa88c9b[_0x6cc4('0x1e')]){return _0xa88c9b;}else{return _0x5ce847[_0x6cc4('0x19')](_0x6cc4('0x2d'))['find'](_0x3d39f9,_0x59d617);}});case'contact':return _0x5ce847['sobject'](_0x6cc4('0x2b'))[_0x6cc4('0x1c')](_0x3d39f9,_0x59d617)[_0x6cc4('0x2c')]();case _0x6cc4('0x2e'):return _0x5ce847[_0x6cc4('0x19')](_0x6cc4('0x2d'))[_0x6cc4('0x1c')](_0x3d39f9,_0x59d617);default:return null;}}else if(_0x4de5c0[_0x6cc4('0x10')]==='Case'){logger[_0x6cc4('0x20')](_0x6cc4('0x28'),_0x3f5aaa,_0x6cc4('0x2f'));return _0x5ce847[_0x6cc4('0x19')](_0x6cc4('0x2b'))[_0x6cc4('0x1c')](_0x3d39f9,_0x59d617)[_0x6cc4('0x2c')]();}})[_0x6cc4('0x1d')](function(_0x3e5540){if(_0x3e5540&&_0x3e5540[_0x6cc4('0x1e')]){var _0x3052c5=_[_0x6cc4('0x1c')](_0x3e5540,function(_0x3e551e){return _0x3e551e[_0x6cc4('0x30')]===_0x3f5aaa;});if(_0x3052c5){return BPromise[_0x6cc4('0x22')]({'id':_0x3052c5['Id'],'name':_0x3052c5['Name'],'phone':_0x3052c5['Phone']});}}})['then'](function(_0x40ba83){if(_0x40ba83){logger['info']('Enduser\x20with\x20phone\x20%s\x20found.',_0x3f5aaa);return BPromise[_0x6cc4('0x22')](_0x40ba83);}else{logger[_0x6cc4('0x20')](_0x6cc4('0x31'),_0x3f5aaa);var _0x3daef9={'LastName':_0x14290c!==_0x6cc4('0x32')?_0x14290c:util[_0x6cc4('0x33')](_0x6cc4('0x34'),_0x3f5aaa),'Phone':_0x3f5aaa};if(_0x4de5c0['moduleCreate']){if(_0x4de5c0[_0x6cc4('0x35')]===_0x6cc4('0x2f')){logger[_0x6cc4('0x20')](_0x6cc4('0x36'),_0x3f5aaa,_0x4de5c0[_0x6cc4('0x35')]);}else if(_0x4de5c0[_0x6cc4('0x35')]===_0x6cc4('0x2e')&&_0x4de5c0['ticketType']===_0x6cc4('0x37')){logger[_0x6cc4('0x20')](_0x6cc4('0x36'),_0x3f5aaa,_0x4de5c0[_0x6cc4('0x35')]);_0x3daef9[_0x6cc4('0x38')]=_0x6cc4('0x39');}else{return null;}}return _0x5ce847[_0x6cc4('0x19')](_[_0x6cc4('0x3a')](_0x4de5c0[_0x6cc4('0x35')]))['create'](_0x3daef9);}});}function getCustomFields(_0x1953c2,_0x25bff7){var _0x4293e1={};if(_0x1953c2[_0x6cc4('0x1e')]>0x0){_[_0x6cc4('0x3b')](_0x1953c2,function(_0x38521c){if(_0x38521c[_0x6cc4('0x3c')]==='string'&&_0x38521c[_0x6cc4('0x3d')]){_0x4293e1[_0x38521c[_0x6cc4('0x3d')]]=_0x38521c[_0x6cc4('0x3e')][_0x6cc4('0x3f')]();}else if(_0x38521c[_0x6cc4('0x3c')]===_0x6cc4('0x40')&&_0x38521c[_0x6cc4('0x41')]&&_0x38521c[_0x6cc4('0x3d')]){_0x25bff7[_0x38521c[_0x6cc4('0x41')]]&&(_0x4293e1[_0x38521c[_0x6cc4('0x3d')]]=_0x25bff7[_0x38521c[_0x6cc4('0x41')]][_0x6cc4('0x3f')]());}else if(_0x38521c[_0x6cc4('0x3c')]==='customVariable'&&_0x38521c[_0x6cc4('0x42')]&&_0x38521c[_0x6cc4('0x42')][_0x6cc4('0x43')]&&_0x38521c['idField']){_0x25bff7[_0x38521c[_0x6cc4('0x42')][_0x6cc4('0x43')][_0x6cc4('0x44')]()]&&(_0x4293e1[_0x38521c[_0x6cc4('0x3d')]]=_0x25bff7[_0x38521c[_0x6cc4('0x42')]['name'][_0x6cc4('0x44')]()][_0x6cc4('0x3f')]());}});}return _0x4293e1;}function getConnection(_0x508aa7){var _0x2dba24=_0x508aa7[_0x6cc4('0x45')][_0x6cc4('0x46')](_0x508aa7[_0x6cc4('0x47')]);var _0x137b27=new jsforce['Connection']({'oauth2':{'loginUrl':_0x508aa7['remoteUri']||_0x6cc4('0x48'),'clientId':_0x508aa7['clientId'],'clientSecret':_0x508aa7[_0x6cc4('0x49')]}});return _0x137b27[_0x6cc4('0x4a')](_0x508aa7[_0x6cc4('0x4b')],_0x2dba24)[_0x6cc4('0x1d')](function(){logger[_0x6cc4('0x20')](_0x6cc4('0x4c'));return _0x137b27;});}exports[_0x6cc4('0x4d')]=function(_0x4d1f27,_0x4b4b21,_0x230467,_0x4a5e72,_0x297b9f,_0x1b4ccb){var _0x3565ed,_0x27e7bd,_0xa8ea38,_0x206307;_0x1b4ccb[_0x6cc4('0x4e')]=intUtil[_0x6cc4('0x4f')](_0x1b4ccb[_0x6cc4('0x4e')]);_0x1b4ccb[_0x6cc4('0x50')]=intUtil[_0x6cc4('0x4f')](_0x1b4ccb['remoteUri']);if(_0x297b9f&&_0x297b9f[_0x6cc4('0x51')]){logger[_0x6cc4('0x20')](_0x6cc4('0x52'),'Recording\x20is\x20enabled!');_0x4b4b21[_0x6cc4('0x53')]=util[_0x6cc4('0x33')](_0x6cc4('0x54'),_0x1b4ccb[_0x6cc4('0x4e')],_0x4b4b21['uniqueid'],md5(_0x4b4b21['uniqueid']));}else{_0x4b4b21[_0x6cc4('0x53')]='';}return getConnection(_0x1b4ccb)[_0x6cc4('0x1d')](function(_0x113dbb){_0x206307=_0x113dbb;return getUser(_0x1b4ccb,_0x4a5e72[_0x6cc4('0x55')],_0x206307);})['then'](function(_0x2a0eba){_0x3565ed=_0x2a0eba;return getEndUser(_0x1b4ccb,_0x230467,_0x4b4b21[_0x6cc4('0x56')],_0x4b4b21[_0x6cc4('0x57')],_0x206307);})[_0x6cc4('0x1d')](function(_0x4efd55){_0x27e7bd=_0x4efd55;return getTicket(_0x1b4ccb,_0x3565ed,_0x27e7bd,_0x230467,_0x4b4b21,_0x230467[_0x6cc4('0x58')],_0x206307,_0x6cc4('0x4d'));})['then'](function(_0x412985){_0xa8ea38=_0x412985;logger[_0x6cc4('0x20')](_0x6cc4('0x59'),_0xa8ea38['id']);logger[_0x6cc4('0x20')](_0x6cc4('0x5a'),_0xa8ea38['id'],_0x4a5e72[_0x6cc4('0x43')],_0x1b4ccb[_0x6cc4('0x3c')]);switch(_0x1b4ccb[_0x6cc4('0x3c')]){case'integrationTab':emit(util['format'](_0x6cc4('0x5b'),_0x4a5e72['name']),'trigger:salesforce:display',{'recordId':_0xa8ea38['id']});break;case _0x6cc4('0x5c'):emit(util[_0x6cc4('0x33')](_0x6cc4('0x5b'),_0x4a5e72[_0x6cc4('0x43')]),_0x6cc4('0x5d'),{'uri':util['format']('%s/%s/e',_0x206307[_0x6cc4('0x5e')],_0xa8ea38['id'])});break;default:logger[_0x6cc4('0x5f')](_0x6cc4('0x60'));}})[_0x6cc4('0x61')](function(_0x20b890){logger[_0x6cc4('0x5f')](_0x6cc4('0x52'),JSON['stringify'](_0x20b890));});};exports['outbound']=function(_0x2bcafe,_0x168319,_0x93cdac,_0x399597,_0x56c961,_0x3ab417,_0xdfb2da){var _0x1996dc,_0x4c56f4,_0x162a40,_0x5b5a93;_0x3ab417['serverUrl']=intUtil[_0x6cc4('0x4f')](_0x3ab417[_0x6cc4('0x4e')]);_0x3ab417[_0x6cc4('0x50')]=intUtil['stripTrailingSlash'](_0x3ab417[_0x6cc4('0x50')]);if(_0xdfb2da&&_0xdfb2da[_0x6cc4('0x62')]&&_0xdfb2da[_0x6cc4('0x62')]!==_0x6cc4('0x63')){logger['info'](_0x6cc4('0x64'),_0x6cc4('0x65'));_0x168319['recordingURL']=util[_0x6cc4('0x33')](_0x6cc4('0x54'),_0x3ab417[_0x6cc4('0x4e')],_0x168319[_0x6cc4('0x66')],md5(_0x168319[_0x6cc4('0x66')]));}return getConnection(_0x3ab417)[_0x6cc4('0x1d')](function(_0x372e7e){_0x5b5a93=_0x372e7e;return getUser(_0x3ab417,_0x399597[_0x6cc4('0x55')],_0x5b5a93);})[_0x6cc4('0x1d')](function(_0x53b929){_0x1996dc=_0x53b929;return getEndUser(_0x3ab417,_0x93cdac,_0x168319[_0x6cc4('0x67')],_0x168319['destcalleridnum'],_0x5b5a93);})['then'](function(_0x26711c){_0x4c56f4=_0x26711c;return getTicket(_0x3ab417,_0x1996dc,_0x4c56f4,_0x93cdac,_0x168319,_0x93cdac['Fields'],_0x5b5a93,'outbound');})[_0x6cc4('0x1d')](function(_0x1d714f){_0x162a40=_0x1d714f;logger[_0x6cc4('0x20')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x162a40['id']);logger[_0x6cc4('0x20')](_0x6cc4('0x68'),_0x162a40['id'],_0x399597[_0x6cc4('0x43')],_0x3ab417[_0x6cc4('0x3c')]);switch(_0x3ab417[_0x6cc4('0x3c')]){case _0x6cc4('0x69'):emit(util[_0x6cc4('0x33')](_0x6cc4('0x5b'),_0x399597['name']),_0x6cc4('0x6a'),{'recordId':_0x162a40['id']});break;case _0x6cc4('0x5c'):emit(util['format'](_0x6cc4('0x5b'),_0x399597[_0x6cc4('0x43')]),_0x6cc4('0x5d'),{'uri':util['format'](_0x6cc4('0x6b'),_0x5b5a93[_0x6cc4('0x5e')],_0x162a40['id'])});break;default:logger['error'](_0x6cc4('0x64'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x6cc4('0x61')](function(_0x44cb0d){logger[_0x6cc4('0x5f')](_0x6cc4('0x64'),JSON[_0x6cc4('0x6c')](_0x44cb0d));});};exports[_0x6cc4('0x6d')]=function(_0x36bd15,_0x848be,_0x17a6db,_0x392f6a,_0x3e6b0c,_0x3d2984){var _0x572979,_0x2856a3,_0x95087b,_0x3f45c9;_0x3d2984[_0x6cc4('0x4e')]=intUtil['stripTrailingSlash'](_0x3d2984[_0x6cc4('0x4e')]);_0x3d2984[_0x6cc4('0x50')]=intUtil['stripTrailingSlash'](_0x3d2984[_0x6cc4('0x50')]);if(_0x3e6b0c&&_0x3e6b0c[_0x6cc4('0x51')]){logger['info']('['+_0x848be['lastevent']['toUpperCase']()+']',_0x6cc4('0x65'));_0x848be[_0x6cc4('0x53')]=util[_0x6cc4('0x33')](_0x6cc4('0x54'),_0x3d2984[_0x6cc4('0x4e')],_0x848be[_0x6cc4('0x66')],md5(_0x848be['uniqueid']));}else{_0x848be[_0x6cc4('0x53')]='';}return getConnection(_0x3d2984)[_0x6cc4('0x1d')](function(_0x26e250){_0x3f45c9=_0x26e250;if(!_[_0x6cc4('0x6e')](_0x392f6a)){return getUser(_0x3d2984,_0x392f6a['name'],_0x3f45c9);}else{return getUser(_0x3d2984,null,_0x3f45c9);}})[_0x6cc4('0x1d')](function(_0x4272ab){_0x572979=_0x4272ab;return getEndUser(_0x3d2984,_0x17a6db,_0x848be[_0x6cc4('0x56')],_0x848be[_0x6cc4('0x57')],_0x3f45c9);})[_0x6cc4('0x1d')](function(_0x369b12){_0x2856a3=_0x369b12;return getTicket(_0x3d2984,_0x572979,_0x2856a3,_0x17a6db,_0x848be,_0x17a6db[_0x6cc4('0x58')],_0x3f45c9);})[_0x6cc4('0x1d')](function(_0xf6f1ee){_0x95087b=_0xf6f1ee;logger[_0x6cc4('0x20')]('['+_0x848be[_0x6cc4('0x6f')][_0x6cc4('0x70')]()+_0x6cc4('0x71'),_0x95087b['id']);logger[_0x6cc4('0x20')]('['+_0x848be['lastevent'][_0x6cc4('0x70')]()+_0x6cc4('0x72'),_0x3d2984[_0x6cc4('0x3c')]);})[_0x6cc4('0x61')](function(_0x4a42d9){logger[_0x6cc4('0x5f')]('['+_0x848be[_0x6cc4('0x6f')]['toUpperCase']()+']',JSON[_0x6cc4('0x6c')](_0x4a42d9));});}; \ No newline at end of file +var _0x78ca=['password','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','remoteUri','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Fields','queue','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','stringify','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','user:%s','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase','isNil','calleridname','calleridnum',']\x20Ticket\x20%s\x20created.','lodash','request-promise','md5','jsforce','util','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','emit','ticketType','utc','getString','Subjects','Descriptions','WhoId','Case','assign','sobject','create','validateEmail','User','find','execute','then','length','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Lead','contact','Contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x10509b,_0x2a89fc){var _0x4db814=function(_0x2049e1){while(--_0x2049e1){_0x10509b['push'](_0x10509b['shift']());}};_0x4db814(++_0x2a89fc);}(_0x78ca,0x108));var _0xa78c=function(_0x17709b,_0x86bf58){_0x17709b=_0x17709b-0x0;var _0x2bbf51=_0x78ca[_0x17709b];return _0x2bbf51;};'use strict';var _=require(_0xa78c('0x0'));var rp=require(_0xa78c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0xa78c('0x2'));var jsforce=require(_0xa78c('0x3'));var util=require(_0xa78c('0x4'));var Redis=require(_0xa78c('0x5'));var intUtil=require(_0xa78c('0x6'));var config=require('../../../../config/environment');var logger=require(_0xa78c('0x7'))(_0xa78c('0x8'));config[_0xa78c('0x9')]=_[_0xa78c('0xa')](config[_0xa78c('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa78c('0x9')]));function emit(_0x4f897c,_0x333675,_0x21898f){io['to'](_0x4f897c)[_0xa78c('0xb')](_0x333675,_0x21898f);}function getTicket(_0x44ed0f,_0x427928,_0x1a82b9,_0xc2b01d,_0x3d9243,_0x37c7b8,_0xf23b95,_0x1179c1){var _0x3de5cd={};if(_0xc2b01d[_0xa78c('0xc')]==='Task'){_0x3de5cd=Object['assign']({},{'OwnerId':_0x427928['id'],'ActivityDate':moment[_0xa78c('0xd')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xa78c('0xe')](_0xc2b01d[_0xa78c('0xf')],_0x3d9243,'\x20'),'Description':intUtil[_0xa78c('0xe')](_0xc2b01d[_0xa78c('0x10')],_0x3d9243,'\x0a')},getCustomFields(_0x37c7b8,_0x3d9243));if(_0x1a82b9){_0x3de5cd[_0xa78c('0x11')]=_0x1a82b9['id'];}}else if(_0xc2b01d[_0xa78c('0xc')]===_0xa78c('0x12')){_0x3de5cd=Object[_0xa78c('0x13')]({},{'OwnerId':_0x427928['id'],'Subject':intUtil[_0xa78c('0xe')](_0xc2b01d['Subjects'],_0x3d9243,'\x20'),'Description':intUtil[_0xa78c('0xe')](_0xc2b01d[_0xa78c('0x10')],_0x3d9243,'\x0a')},getCustomFields(_0x37c7b8,_0x3d9243));if(_0x1a82b9){_0x3de5cd['ContactId']=_0x1a82b9['id'];}}return _0xf23b95[_0xa78c('0x14')](_0xc2b01d[_0xa78c('0xc')])[_0xa78c('0x15')](_0x3de5cd);}function getUser(_0x3569b9,_0x49290d,_0xb20a89){if(!_['isNil'](_0x49290d)&&intUtil[_0xa78c('0x16')](_0x49290d)){var _0x370ab6={'Email':_0x49290d};var _0x3ee01c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xb20a89['sobject'](_0xa78c('0x17'))[_0xa78c('0x18')](_0x370ab6,_0x3ee01c)[_0xa78c('0x19')]()[_0xa78c('0x1a')](function(_0x26c8db){if(_0x26c8db[_0xa78c('0x1b')]){var _0x5a19b6=_['find'](_0x26c8db,function(_0x5d9874){return _0x5d9874['Email']===_0x49290d;});if(_0x5a19b6){logger[_0xa78c('0x1c')](_0xa78c('0x1d'),_0x49290d);return BPromise[_0xa78c('0x1e')]({'id':_0x5a19b6['Id'],'name':_0x5a19b6[_0xa78c('0x1f')]});}}else{logger[_0xa78c('0x1c')](_0xa78c('0x20'),_0x49290d);return _0xb20a89[_0xa78c('0x21')]()[_0xa78c('0x1a')](function(_0x15840e){return BPromise[_0xa78c('0x1e')]({'id':_0x15840e[_0xa78c('0x22')],'name':_0x15840e['display_name']});});}});}else{logger[_0xa78c('0x1c')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x49290d);return _0xb20a89[_0xa78c('0x21')]()['then'](function(_0xfa3ee1){return BPromise[_0xa78c('0x1e')]({'id':_0xfa3ee1[_0xa78c('0x22')],'name':_0xfa3ee1[_0xa78c('0x23')]});});}}function getEndUser(_0x120ad7,_0x2e1a2d,_0x1a9929,_0x3324a3,_0x821b94){var _0x11f749={'Phone':_0x3324a3};var _0x1aa2d3={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa78c('0x1e')]()[_0xa78c('0x1a')](function(){if(_0x2e1a2d['ticketType']===_0xa78c('0x24')){logger[_0xa78c('0x1c')](_0xa78c('0x25'),_0x3324a3,_0x2e1a2d[_0xa78c('0x26')]);switch(_0x2e1a2d[_0xa78c('0x26')]){case _0xa78c('0x27'):return _0x821b94[_0xa78c('0x14')]('Contact')[_0xa78c('0x18')](_0x11f749,_0x1aa2d3)[_0xa78c('0x19')]()['then'](function(_0x44f640){if(_0x44f640&&_0x44f640[_0xa78c('0x1b')]){return _0x44f640;}else{return _0x821b94[_0xa78c('0x14')](_0xa78c('0x28'))[_0xa78c('0x18')](_0x11f749,_0x1aa2d3);}});case _0xa78c('0x29'):return _0x821b94['sobject'](_0xa78c('0x2a'))[_0xa78c('0x18')](_0x11f749,_0x1aa2d3)[_0xa78c('0x19')]();case _0xa78c('0x2b'):return _0x821b94[_0xa78c('0x14')](_0xa78c('0x28'))[_0xa78c('0x18')](_0x11f749,_0x1aa2d3);default:return null;}}else if(_0x2e1a2d[_0xa78c('0xc')]===_0xa78c('0x12')){logger[_0xa78c('0x1c')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3324a3,_0xa78c('0x29'));return _0x821b94['sobject'](_0xa78c('0x2a'))[_0xa78c('0x18')](_0x11f749,_0x1aa2d3)[_0xa78c('0x19')]();}})[_0xa78c('0x1a')](function(_0x57c83c){if(_0x57c83c&&_0x57c83c[_0xa78c('0x1b')]){var _0x5141e6=_[_0xa78c('0x18')](_0x57c83c,function(_0x23739e){return _0x23739e[_0xa78c('0x2c')]===_0x3324a3;});if(_0x5141e6){return BPromise[_0xa78c('0x1e')]({'id':_0x5141e6['Id'],'name':_0x5141e6['Name'],'phone':_0x5141e6[_0xa78c('0x2c')]});}}})[_0xa78c('0x1a')](function(_0x5ea5b6){if(_0x5ea5b6){logger[_0xa78c('0x1c')](_0xa78c('0x2d'),_0x3324a3);return BPromise[_0xa78c('0x1e')](_0x5ea5b6);}else{logger[_0xa78c('0x1c')](_0xa78c('0x2e'),_0x3324a3);var _0x1a8376={'LastName':_0x1a9929!==_0xa78c('0x2f')?_0x1a9929:util[_0xa78c('0x30')](_0xa78c('0x31'),_0x3324a3),'Phone':_0x3324a3};if(_0x2e1a2d[_0xa78c('0x32')]){if(_0x2e1a2d[_0xa78c('0x32')]==='contact'){logger['info'](_0xa78c('0x33'),_0x3324a3,_0x2e1a2d[_0xa78c('0x32')]);}else if(_0x2e1a2d['moduleCreate']==='lead'&&_0x2e1a2d[_0xa78c('0xc')]===_0xa78c('0x24')){logger[_0xa78c('0x1c')](_0xa78c('0x33'),_0x3324a3,_0x2e1a2d[_0xa78c('0x32')]);_0x1a8376[_0xa78c('0x34')]=_0xa78c('0x35');}else{return null;}}return _0x821b94[_0xa78c('0x14')](_[_0xa78c('0x36')](_0x2e1a2d['moduleCreate']))[_0xa78c('0x15')](_0x1a8376);}});}function getCustomFields(_0x52dad2,_0x80135a){var _0x15439c={};if(_0x52dad2[_0xa78c('0x1b')]>0x0){_[_0xa78c('0x37')](_0x52dad2,function(_0x11c760){if(_0x11c760[_0xa78c('0x38')]===_0xa78c('0x39')&&_0x11c760[_0xa78c('0x3a')]){_0x15439c[_0x11c760[_0xa78c('0x3a')]]=_0x11c760[_0xa78c('0x3b')][_0xa78c('0x3c')]();}else if(_0x11c760['type']==='variable'&&_0x11c760[_0xa78c('0x3d')]&&_0x11c760[_0xa78c('0x3a')]){_0x80135a[_0x11c760['variableName']]&&(_0x15439c[_0x11c760[_0xa78c('0x3a')]]=_0x80135a[_0x11c760[_0xa78c('0x3d')]][_0xa78c('0x3c')]());}else if(_0x11c760[_0xa78c('0x38')]===_0xa78c('0x3e')&&_0x11c760[_0xa78c('0x3f')]&&_0x11c760[_0xa78c('0x3f')][_0xa78c('0x40')]&&_0x11c760['idField']){_0x80135a[_0x11c760['Variable']['name']['toLowerCase']()]&&(_0x15439c[_0x11c760['idField']]=_0x80135a[_0x11c760[_0xa78c('0x3f')][_0xa78c('0x40')][_0xa78c('0x41')]()]['toString']());}});}return _0x15439c;}function getConnection(_0x13948a){var _0x3bea21=_0x13948a[_0xa78c('0x42')]['concat'](_0x13948a[_0xa78c('0x43')]);var _0x2d8160=new jsforce[(_0xa78c('0x44'))]({'oauth2':{'loginUrl':_0x13948a['remoteUri']||_0xa78c('0x45'),'clientId':_0x13948a[_0xa78c('0x46')],'clientSecret':_0x13948a[_0xa78c('0x47')]}});return _0x2d8160[_0xa78c('0x48')](_0x13948a[_0xa78c('0x49')],_0x3bea21)[_0xa78c('0x1a')](function(){logger[_0xa78c('0x1c')](_0xa78c('0x4a'));return _0x2d8160;});}exports['queue']=function(_0x123ab3,_0x5578fd,_0x5493e5,_0x1c2ce0,_0x384eae,_0x4ec2a8){var _0x28e003,_0x1c1f0e,_0x2e4408,_0x354642;_0x4ec2a8['serverUrl']=intUtil['stripTrailingSlash'](_0x4ec2a8[_0xa78c('0x4b')]);_0x4ec2a8[_0xa78c('0x4c')]=intUtil['stripTrailingSlash'](_0x4ec2a8[_0xa78c('0x4c')]);if(_0x384eae&&_0x384eae[_0xa78c('0x4d')]){logger[_0xa78c('0x1c')]('[QUEUE]','Recording\x20is\x20enabled!');_0x5578fd[_0xa78c('0x4e')]=util['format'](_0xa78c('0x4f'),_0x4ec2a8[_0xa78c('0x4b')],_0x5578fd['uniqueid'],md5(_0x5578fd[_0xa78c('0x50')]));}else{_0x5578fd['recordingURL']='';}return getConnection(_0x4ec2a8)['then'](function(_0x2b17d7){_0x354642=_0x2b17d7;return getUser(_0x4ec2a8,_0x1c2ce0['email'],_0x354642);})[_0xa78c('0x1a')](function(_0x48d2ca){_0x28e003=_0x48d2ca;return getEndUser(_0x4ec2a8,_0x5493e5,_0x5578fd['calleridname'],_0x5578fd['calleridnum'],_0x354642);})['then'](function(_0x40dbf6){_0x1c1f0e=_0x40dbf6;return getTicket(_0x4ec2a8,_0x28e003,_0x1c1f0e,_0x5493e5,_0x5578fd,_0x5493e5[_0xa78c('0x51')],_0x354642,_0xa78c('0x52'));})[_0xa78c('0x1a')](function(_0x108873){_0x2e4408=_0x108873;logger[_0xa78c('0x1c')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x2e4408['id']);logger[_0xa78c('0x1c')](_0xa78c('0x53'),_0x2e4408['id'],_0x1c2ce0[_0xa78c('0x40')],_0x4ec2a8['type']);switch(_0x4ec2a8['type']){case _0xa78c('0x54'):emit(util[_0xa78c('0x30')]('user:%s',_0x1c2ce0[_0xa78c('0x40')]),_0xa78c('0x55'),{'recordId':_0x2e4408['id']});break;case _0xa78c('0x56'):emit(util['format']('user:%s',_0x1c2ce0[_0xa78c('0x40')]),_0xa78c('0x57'),{'uri':util[_0xa78c('0x30')](_0xa78c('0x58'),_0x354642[_0xa78c('0x59')],_0x2e4408['id'])});break;default:logger[_0xa78c('0x5a')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xa78c('0x5b')](function(_0x303455){logger[_0xa78c('0x5a')]('[QUEUE]',JSON[_0xa78c('0x5c')](_0x303455));});};exports[_0xa78c('0x5d')]=function(_0x185e75,_0x3034ca,_0x5c3d3f,_0xa75094,_0x2d17ed,_0x4d931f,_0x38b887){var _0x4c46c2,_0x1dd036,_0x37655e,_0x3331fa;_0x4d931f[_0xa78c('0x4b')]=intUtil[_0xa78c('0x5e')](_0x4d931f[_0xa78c('0x4b')]);_0x4d931f[_0xa78c('0x4c')]=intUtil[_0xa78c('0x5e')](_0x4d931f[_0xa78c('0x4c')]);if(_0x38b887&&_0x38b887[_0xa78c('0x5f')]&&_0x38b887[_0xa78c('0x5f')]!==_0xa78c('0x60')){logger[_0xa78c('0x1c')](_0xa78c('0x61'),_0xa78c('0x62'));_0x3034ca[_0xa78c('0x4e')]=util['format'](_0xa78c('0x4f'),_0x4d931f[_0xa78c('0x4b')],_0x3034ca[_0xa78c('0x50')],md5(_0x3034ca[_0xa78c('0x50')]));}return getConnection(_0x4d931f)[_0xa78c('0x1a')](function(_0x5c208b){_0x3331fa=_0x5c208b;return getUser(_0x4d931f,_0xa75094['email'],_0x3331fa);})[_0xa78c('0x1a')](function(_0x176bea){_0x4c46c2=_0x176bea;return getEndUser(_0x4d931f,_0x5c3d3f,_0x3034ca[_0xa78c('0x63')],_0x3034ca[_0xa78c('0x64')],_0x3331fa);})[_0xa78c('0x1a')](function(_0x511213){_0x1dd036=_0x511213;return getTicket(_0x4d931f,_0x4c46c2,_0x1dd036,_0x5c3d3f,_0x3034ca,_0x5c3d3f[_0xa78c('0x51')],_0x3331fa,_0xa78c('0x5d'));})['then'](function(_0x4db0bf){_0x37655e=_0x4db0bf;logger[_0xa78c('0x1c')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x37655e['id']);logger[_0xa78c('0x1c')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x37655e['id'],_0xa75094['name'],_0x4d931f[_0xa78c('0x38')]);switch(_0x4d931f['type']){case _0xa78c('0x54'):emit(util[_0xa78c('0x30')](_0xa78c('0x65'),_0xa75094[_0xa78c('0x40')]),_0xa78c('0x55'),{'recordId':_0x37655e['id']});break;case _0xa78c('0x56'):emit(util['format']('user:%s',_0xa75094[_0xa78c('0x40')]),_0xa78c('0x57'),{'uri':util[_0xa78c('0x30')](_0xa78c('0x58'),_0x3331fa['instanceUrl'],_0x37655e['id'])});break;default:logger[_0xa78c('0x5a')](_0xa78c('0x61'),_0xa78c('0x66'));}})[_0xa78c('0x5b')](function(_0x191925){logger['error'](_0xa78c('0x61'),JSON['stringify'](_0x191925));});};exports[_0xa78c('0x67')]=function(_0x43c346,_0x53d3da,_0x37445c,_0x5caede,_0x213672,_0x2a2293){var _0x581b6e,_0x2b3773,_0x1206d3,_0x257565;_0x2a2293['serverUrl']=intUtil[_0xa78c('0x5e')](_0x2a2293[_0xa78c('0x4b')]);_0x2a2293[_0xa78c('0x4c')]=intUtil['stripTrailingSlash'](_0x2a2293[_0xa78c('0x4c')]);if(_0x213672&&_0x213672['monitor_format']){logger[_0xa78c('0x1c')]('['+_0x53d3da[_0xa78c('0x68')][_0xa78c('0x69')]()+']',_0xa78c('0x62'));_0x53d3da[_0xa78c('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a2293['serverUrl'],_0x53d3da[_0xa78c('0x50')],md5(_0x53d3da['uniqueid']));}else{_0x53d3da[_0xa78c('0x4e')]='';}return getConnection(_0x2a2293)['then'](function(_0x35d8d2){_0x257565=_0x35d8d2;if(!_[_0xa78c('0x6a')](_0x5caede)){return getUser(_0x2a2293,_0x5caede[_0xa78c('0x40')],_0x257565);}else{return getUser(_0x2a2293,null,_0x257565);}})['then'](function(_0x5c8912){_0x581b6e=_0x5c8912;return getEndUser(_0x2a2293,_0x37445c,_0x53d3da[_0xa78c('0x6b')],_0x53d3da[_0xa78c('0x6c')],_0x257565);})[_0xa78c('0x1a')](function(_0x5a9350){_0x2b3773=_0x5a9350;return getTicket(_0x2a2293,_0x581b6e,_0x2b3773,_0x37445c,_0x53d3da,_0x37445c[_0xa78c('0x51')],_0x257565);})[_0xa78c('0x1a')](function(_0x46e9c6){_0x1206d3=_0x46e9c6;logger[_0xa78c('0x1c')]('['+_0x53d3da[_0xa78c('0x68')]['toUpperCase']()+_0xa78c('0x6d'),_0x1206d3['id']);logger[_0xa78c('0x1c')]('['+_0x53d3da['lastevent'][_0xa78c('0x69')]()+']\x20Integration\x20account\x20type\x20%s.',_0x2a2293[_0xa78c('0x38')]);})[_0xa78c('0x5b')](function(_0x593966){logger['error']('['+_0x53d3da['lastevent'][_0xa78c('0x69')]()+']',JSON['stringify'](_0x593966));});}; \ 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 280b6e5..a8fb7b0 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(_0x9fe5c3,_0x3d2377){var _0x46f68f=function(_0x180695){while(--_0x180695){_0x9fe5c3['push'](_0x9fe5c3['shift']());}};_0x46f68f(++_0x3d2377);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x5fc3[_0x5416db];return _0x243e35;};'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 _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(_0x5cc63c,_0x53dbd2){var _0x333675=function(_0x517bc1){while(--_0x517bc1){_0x5cc63c['push'](_0x5cc63c['shift']());}};_0x333675(++_0x53dbd2);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x5fc3[_0x2fc012];return _0x2891f9;};'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 diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 2f78103..d7765bb 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 _0xaac4=['Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','description','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_type','Contacts','forEach','variableName','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','isNil','info','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','length','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Enduser\x20created.','debug','merge','map','type','string','nameField','customField','toLowerCase','content','toString','variable','custom_fields','push','customVariable','Variable','POST','login','username','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','contacts','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Outbound','The\x20Ticket\x20ID\x20is:','charAt','trigger:browser:url','catch','unmanaged','lastevent','Inbound','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x36dd5d,_0x2010ab){var _0x30c52d=function(_0x584844){while(--_0x584844){_0x36dd5d['push'](_0x36dd5d['shift']());}};_0x30c52d(++_0x2010ab);}(_0xaac4,0x6c));var _0x4aac=function(_0x189e47,_0x4fa398){_0x189e47=_0x189e47-0x0;var _0x5c375b=_0xaac4[_0x189e47];return _0x5c375b;};'use strict';var _=require(_0x4aac('0x0'));var rp=require(_0x4aac('0x1'));var BPromise=require('bluebird');var md5=require(_0x4aac('0x2'));var util=require(_0x4aac('0x3'));var Redis=require(_0x4aac('0x4'));var intUtil=require('./util');var config=require(_0x4aac('0x5'));var logger=require(_0x4aac('0x6'))(_0x4aac('0x7'));config[_0x4aac('0x8')]=_[_0x4aac('0x9')](config['redis'],{'host':_0x4aac('0xa'),'port':0x18eb});var io=require(_0x4aac('0xb'))(new Redis(config[_0x4aac('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x645ec6,_0x59735a,_0x3ba0ea){io['to'](_0x645ec6)[_0x4aac('0xc')](_0x59735a,_0x3ba0ea);}function getTicket(_0x239771,_0x3e3567,_0x33551f,_0x4c151a,_0xabb74,_0x9660af,_0x103818,_0x2b771b){logger['info'](_0x4aac('0xd'));var _0x3fa571=new Date();var _0x2dbd54=[{'name':_0x4aac('0xe'),'value':intUtil[_0x4aac('0xf')](_0x4c151a[_0x4aac('0x10')],_0xabb74,'\x20')},{'name':_0x4aac('0x11'),'value':_0x3e3567['id']},{'name':'created_by','value':_0x3e3567['id']},{'name':_0x4aac('0x12'),'value':intUtil['getString'](_0x4c151a[_0x4aac('0x13')],_0xabb74,'\x0a')},{'name':'date_start','value':_0x3fa571[_0x4aac('0x14')]()['slice'](0x0,0x13)[_0x4aac('0x15')]('T','\x20')},{'name':_0x4aac('0x16'),'value':'0'},{'name':_0x4aac('0x17'),'value':'15'},{'name':'parent_id','value':_0x33551f['id']},{'name':_0x4aac('0x18'),'value':_0x4aac('0x19')},{'name':'parent_name','value':_0x33551f['name']},{'name':'direction','value':_0x2b771b}];if(_0x9660af['length']){_[_0x4aac('0x1a')](_0x9660af,function(_0x20353f){if(_0xabb74[_0x20353f[_0x4aac('0x1b')]]){_0x2dbd54['push']({'name':_0x20353f[_0x4aac('0x1c')],'value':_0xabb74[_0x20353f[_0x4aac('0x1b')]]});}});}return request({'form':{'method':_0x4aac('0x1d'),'input_type':_0x4aac('0x1e'),'response_type':_0x4aac('0x1e'),'rest_data':JSON[_0x4aac('0x1f')]({'session':_0x103818['id'],'module_name':_0x4aac('0x20'),'name_value_list':_0x2dbd54})}});}function getAuth(_0x2c26cc){return util[_0x4aac('0x21')](_0x4aac('0x22'),new Buffer(_0x2c26cc[_0x4aac('0x23')]+':X')['toString'](_0x4aac('0x24')));}function getServerInfo(_0x16eef9){return request({'form':{'method':'get_server_info','input_type':_0x4aac('0x1e'),'response_type':'JSON','rest_data':JSON[_0x4aac('0x1f')]({'session':_0x16eef9['id']})}});}function getUser(_0x23fb33,_0x34a384,_0x3d4836){if(!_[_0x4aac('0x25')](_0x34a384)){logger[_0x4aac('0x26')](_0x4aac('0x27'),_0x34a384);return request({'form':{'method':'get_entry_list','input_type':_0x4aac('0x1e'),'response_type':_0x4aac('0x1e'),'rest_data':JSON[_0x4aac('0x1f')]({'session':_0x3d4836['id'],'module_name':'Employees','query':util[_0x4aac('0x21')](_0x4aac('0x28'),_0x34a384),'order_by':'','offset':'0','select_fields':['id',_0x4aac('0xe'),_0x4aac('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4aac('0x2a')](function(_0x4dede8){if(_0x4dede8[_0x4aac('0x2b')]['length']){var _0x517759=_[_0x4aac('0x2c')](_0x4dede8[_0x4aac('0x2b')],function(_0x459028){return _0x459028[_0x4aac('0x2d')][_0x4aac('0x29')]['value']===_0x34a384;});if(_0x517759){logger[_0x4aac('0x26')](_0x4aac('0x2e'));return BPromise['resolve']({'id':_0x517759[_0x4aac('0x2d')]['id'][_0x4aac('0x2f')],'name':_0x517759['name_value_list'][_0x4aac('0xe')]['value']});}}logger['info'](_0x4aac('0x30'));return BPromise[_0x4aac('0x31')]({'id':_0x3d4836[_0x4aac('0x2d')]['user_id'][_0x4aac('0x2f')],'name':_0x3d4836[_0x4aac('0x2d')][_0x4aac('0x29')][_0x4aac('0x2f')]});});}else{logger[_0x4aac('0x26')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4aac('0x31')]({'id':_0x3d4836[_0x4aac('0x2d')][_0x4aac('0x32')][_0x4aac('0x2f')],'name':_0x3d4836['name_value_list'][_0x4aac('0x29')][_0x4aac('0x2f')]});}}function getEndUser(_0x5f3987,_0x250e1f,_0x172f06,_0x4d491b){logger[_0x4aac('0x26')](_0x4aac('0x33'),_0x172f06);return request({'form':{'method':_0x4aac('0x34'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4aac('0x1f')]({'session':_0x4d491b['id'],'module_name':_0x4aac('0x19'),'query':util['format'](_0x4aac('0x35'),_0x172f06),'order_by':'','offset':'0','select_fields':['id',_0x4aac('0xe'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4aac('0x2a')](function(_0x43aa37){if(_0x43aa37[_0x4aac('0x2b')][_0x4aac('0x36')]){var _0x52032d=_[_0x4aac('0x2c')](_0x43aa37[_0x4aac('0x2b')],function(_0x2b30c5){return _0x2b30c5[_0x4aac('0x2d')]['phone_home'][_0x4aac('0x2f')]===_0x172f06;});if(_0x52032d){logger[_0x4aac('0x26')](_0x4aac('0x37'));return BPromise['resolve']({'id':_0x52032d[_0x4aac('0x2d')]['id'][_0x4aac('0x2f')],'name':_0x52032d[_0x4aac('0x2d')][_0x4aac('0xe')][_0x4aac('0x2f')],'phone':_0x52032d[_0x4aac('0x2d')][_0x4aac('0x38')][_0x4aac('0x2f')]});}}else{logger[_0x4aac('0x26')](_0x4aac('0x39'));return request({'form':{'method':_0x4aac('0x1d'),'input_type':'JSON','response_type':_0x4aac('0x1e'),'rest_data':JSON['stringify']({'session':_0x4d491b['id'],'module_name':_0x4aac('0x19'),'name_value_list':[{'name':_0x4aac('0x3a'),'value':_0x250e1f!==''?_0x250e1f:util[_0x4aac('0x21')]('Caller\x20-\x20%s',_0x172f06)},{'name':'phone_home','value':_0x172f06}]})}})[_0x4aac('0x2a')](function(_0x2c884d){logger[_0x4aac('0x26')](_0x4aac('0x3b'));return BPromise['resolve']({'id':_0x2c884d['id'],'name':_0x2c884d[_0x4aac('0x2b')][_0x4aac('0x3a')][_0x4aac('0x2f')],'phone':_0x2c884d[_0x4aac('0x2b')][_0x4aac('0x38')][_0x4aac('0x2f')]});});}});}function request(_0x5d09f6){logger[_0x4aac('0x3c')]('[HTTP]',JSON[_0x4aac('0x1f')](_0x5d09f6));return rp(_[_0x4aac('0x3d')](def,_0x5d09f6));}function getTags(_0xd7cb9f,_0x4efb08){var _0x2713ba=[];if(_0xd7cb9f&&_0xd7cb9f[_0x4aac('0x36')]>0x0){_0x2713ba=_[_0x4aac('0x3e')](_0xd7cb9f,_0x4efb08);}return _0x2713ba;}function getCustomFields(_0xda48c5,_0x45d37f){var _0x3487c0=[];var _0x5d1def={'custom_fields':[]};if(_0xda48c5['length']>0x0){_[_0x4aac('0x1a')](_0xda48c5,function(_0x4841b7){if(_0x4841b7[_0x4aac('0x3f')]===_0x4aac('0x40')&&_0x4841b7[_0x4aac('0x41')]&&!_0x4841b7[_0x4aac('0x42')]){_0x5d1def[_0x4841b7[_0x4aac('0x41')][_0x4aac('0x43')]()]=_0x4841b7[_0x4aac('0x44')][_0x4aac('0x45')]();}else if(_0x4841b7[_0x4aac('0x3f')]==='string'&&_0x4841b7[_0x4aac('0x1c')]&&_0x4841b7[_0x4aac('0x42')]){_0x5d1def['custom_fields']['push']({'id':_0x4841b7[_0x4aac('0x1c')],'value':_0x4841b7['content']['toString']()});}else if(_0x4841b7['type']===_0x4aac('0x46')&&_0x4841b7['variableName']&&_0x4841b7['idField']&&_0x4841b7[_0x4aac('0x42')]){_0x45d37f[_0x4841b7[_0x4aac('0x1b')]]&&_0x5d1def[_0x4aac('0x47')][_0x4aac('0x48')]({'id':_0x4841b7[_0x4aac('0x1c')],'value':_0x45d37f[_0x4841b7[_0x4aac('0x1b')]][_0x4aac('0x45')]()});}else if(_0x4841b7[_0x4aac('0x3f')]===_0x4aac('0x49')&&_0x4841b7[_0x4aac('0x4a')]&&_0x4841b7['Variable'][_0x4aac('0xe')]&&_0x4841b7[_0x4aac('0x1c')]&&_0x4841b7['customField']){_0x45d37f[_0x4841b7[_0x4aac('0x4a')][_0x4aac('0xe')][_0x4aac('0x43')]()]&&_0x5d1def[_0x4aac('0x47')][_0x4aac('0x48')]({'id':_0x4841b7[_0x4aac('0x1c')],'value':_0x45d37f[_0x4841b7[_0x4aac('0x4a')][_0x4aac('0xe')][_0x4aac('0x43')]()][_0x4aac('0x45')]()});}});}return _0x5d1def;}function getConnection(_0x3fc5ee){return request({'method':_0x4aac('0x4b'),'form':{'method':_0x4aac('0x4c'),'input_type':_0x4aac('0x1e'),'response_type':_0x4aac('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3fc5ee[_0x4aac('0x4d')],'password':_0x3fc5ee['password'],'encryption':_0x4aac('0x4e')},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4aac('0x2a')](function(_0x4f0479){var _0x29c005=_0x4f0479;if(_0x29c005['id']){def[_0x4aac('0x4f')]=_0x29c005['id'];return BPromise[_0x4aac('0x31')](_0x29c005);}else{throw new Error(util[_0x4aac('0x21')](_0x4aac('0x50'),_0x3fc5ee['id']));}});}function setRelationship(_0x5d198d,_0x57442e,_0x3c2813,_0x3a89a3){return request({'form':{'method':_0x4aac('0x51'),'input_type':_0x4aac('0x1e'),'response_type':_0x4aac('0x1e'),'rest_data':JSON[_0x4aac('0x1f')]({'session':_0x5d198d['id'],'module_name':'Calls','module_id':_0x3c2813['id'],'link_field_name':_0x3a89a3,'related_ids':[_0x57442e['id']]})}});}exports['queue']=function(_0x11fd97,_0x10d3b9,_0x5f004a,_0x4865e6,_0x4d7a6c,_0x3cd1e8){var _0x514521,_0x4ca90a,_0xc732b3,_0x2eb11b;_0x3cd1e8[_0x4aac('0x52')]=intUtil[_0x4aac('0x53')](_0x3cd1e8[_0x4aac('0x52')]);_0x3cd1e8[_0x4aac('0x54')]=intUtil[_0x4aac('0x53')](_0x3cd1e8[_0x4aac('0x54')]);def[_0x4aac('0x55')]=util[_0x4aac('0x21')](_0x4aac('0x56'),_0x3cd1e8[_0x4aac('0x52')]);if(_0x4d7a6c&&_0x4d7a6c[_0x4aac('0x57')]){logger[_0x4aac('0x26')](_0x4aac('0x58'),_0x4aac('0x59'));_0x10d3b9[_0x4aac('0x5a')]=util['format'](_0x4aac('0x5b'),_0x3cd1e8[_0x4aac('0x54')],_0x10d3b9[_0x4aac('0x5c')],md5(_0x10d3b9[_0x4aac('0x5c')]));}else{_0x10d3b9[_0x4aac('0x5a')]='';}return getConnection(_0x3cd1e8)[_0x4aac('0x2a')](function(_0x35db46){_0x2eb11b=_0x35db46;return getUser(_0x3cd1e8,_0x4865e6[_0x4aac('0xe')],_0x2eb11b);})[_0x4aac('0x2a')](function(_0x2e0171){_0x514521=_0x2e0171;logger['info'](_0x4aac('0x5d'),_0x514521['id']);return getEndUser(_0x3cd1e8,_0x10d3b9[_0x4aac('0x5e')],_0x10d3b9[_0x4aac('0x5f')],_0x2eb11b);})[_0x4aac('0x2a')](function(_0x165cb3){_0x4ca90a=_0x165cb3;logger[_0x4aac('0x26')](_0x4aac('0x60'),_0x4ca90a['id']);return getTicket(_0x3cd1e8,_0x514521,_0x4ca90a,_0x5f004a,_0x10d3b9,_0x5f004a['Fields'],_0x2eb11b,'Inbound');})[_0x4aac('0x2a')](function(_0xa75f3e){_0xc732b3=_0xa75f3e;logger['info'](_0x4aac('0x61'));logger[_0x4aac('0x26')]('The\x20Ticket\x20ID\x20is:',_0xc732b3['id']);return setRelationship(_0x2eb11b,_0x514521,_0xc732b3,'users');})[_0x4aac('0x2a')](function(){return setRelationship(_0x2eb11b,_0x4ca90a,_0xc732b3,_0x4aac('0x62'));})[_0x4aac('0x2a')](function(){return getServerInfo(_0x2eb11b);})[_0x4aac('0x2a')](function(_0x3568bd){var _0x11e70f=parseInt(_0x3568bd[_0x4aac('0x63')]['charAt'](0x0));var _0x1d8bed=util['format'](_0x4aac('0x64'),_0x3cd1e8[_0x4aac('0x52')],_0xc732b3['id']);if(_0x11e70f>0x6){_0x1d8bed=util['format'](_0x4aac('0x65'),_0x3cd1e8['remoteUri'],_0xc732b3['id']);}logger['info']('[QUEUE]',_0x4aac('0x66'));emit(util[_0x4aac('0x21')](_0x4aac('0x67'),_0x4865e6[_0x4aac('0xe')]),'trigger:browser:url',{'uri':_0x1d8bed});})['catch'](function(_0x2843cd){logger[_0x4aac('0x68')](_0x4aac('0x58'),JSON[_0x4aac('0x1f')](_0x2843cd));});};exports[_0x4aac('0x69')]=function(_0x59fdc5,_0x17b30d,_0x479678,_0x5a407e,_0x261e1a,_0x3886e9,_0x45115a){var _0x30d861,_0x26c2e4,_0x40b9f8,_0x404034;_0x3886e9[_0x4aac('0x52')]=intUtil[_0x4aac('0x53')](_0x3886e9['remoteUri']);_0x3886e9[_0x4aac('0x54')]=intUtil[_0x4aac('0x53')](_0x3886e9[_0x4aac('0x54')]);def[_0x4aac('0x55')]=util[_0x4aac('0x21')](_0x4aac('0x56'),_0x3886e9['remoteUri']);if(_0x45115a&&_0x45115a[_0x4aac('0x6a')]&&_0x45115a['recordingFormat']!==_0x4aac('0x6b')){logger[_0x4aac('0x26')](_0x4aac('0x6c'),_0x4aac('0x59'));_0x17b30d[_0x4aac('0x5a')]=util[_0x4aac('0x21')](_0x4aac('0x5b'),_0x3886e9[_0x4aac('0x54')],_0x17b30d[_0x4aac('0x5c')],md5(_0x17b30d[_0x4aac('0x5c')]));}return getConnection(_0x3886e9)['then'](function(_0x5a9b0a){_0x404034=_0x5a9b0a;return getUser(_0x3886e9,_0x5a407e[_0x4aac('0xe')],_0x404034);})['then'](function(_0x25718c){_0x30d861=_0x25718c;logger['info']('The\x20User\x20ID\x20is:',_0x30d861['id']);return getEndUser(_0x3886e9,_0x17b30d[_0x4aac('0x6d')],_0x17b30d[_0x4aac('0x6e')],_0x404034);})[_0x4aac('0x2a')](function(_0x13b59b){_0x26c2e4=_0x13b59b;logger[_0x4aac('0x26')](_0x4aac('0x60'),_0x26c2e4['id']);return getTicket(_0x3886e9,_0x30d861,_0x26c2e4,_0x479678,_0x17b30d,_0x479678[_0x4aac('0x6f')],_0x404034,_0x4aac('0x70'));})[_0x4aac('0x2a')](function(_0x2b9fce){_0x40b9f8=_0x2b9fce;logger[_0x4aac('0x26')]('Ticket\x20created!');logger[_0x4aac('0x26')](_0x4aac('0x71'),_0x40b9f8['id']);return setRelationship(_0x404034,_0x30d861,_0x40b9f8,'users');})[_0x4aac('0x2a')](function(){return setRelationship(_0x404034,_0x26c2e4,_0x40b9f8,'contacts');})['then'](function(){return getServerInfo(_0x404034);})[_0x4aac('0x2a')](function(_0x42fdae){var _0xe7d913=parseInt(_0x42fdae[_0x4aac('0x63')][_0x4aac('0x72')](0x0));var _0xf044c4=util[_0x4aac('0x21')](_0x4aac('0x64'),_0x3886e9['remoteUri'],_0x40b9f8['id']);if(_0xe7d913>0x6){_0xf044c4=util[_0x4aac('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3886e9[_0x4aac('0x52')],_0x40b9f8['id']);}logger[_0x4aac('0x26')](_0x4aac('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4aac('0x21')](_0x4aac('0x67'),_0x5a407e['name']),_0x4aac('0x73'),{'uri':_0xf044c4});})[_0x4aac('0x74')](function(_0xb4f2d2){logger[_0x4aac('0x68')](_0x4aac('0x6c'),JSON[_0x4aac('0x1f')](_0xb4f2d2));});};exports[_0x4aac('0x75')]=function(_0x1361fa,_0x500a22,_0x2722e8,_0x5b8930,_0x2a3575,_0x9994b0){var _0x3debf8,_0x1d3e05,_0x41f70e,_0x2003a4;_0x9994b0[_0x4aac('0x52')]=intUtil[_0x4aac('0x53')](_0x9994b0['remoteUri']);_0x9994b0[_0x4aac('0x54')]=intUtil['stripTrailingSlash'](_0x9994b0['serverUrl']);def[_0x4aac('0x55')]=util['format'](_0x4aac('0x56'),_0x9994b0[_0x4aac('0x52')]);if(_0x2a3575&&_0x2a3575[_0x4aac('0x57')]){logger[_0x4aac('0x26')]('['+_0x500a22[_0x4aac('0x76')]['toUpperCase']()+']',_0x4aac('0x59'));_0x500a22[_0x4aac('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x9994b0[_0x4aac('0x54')],_0x500a22[_0x4aac('0x5c')],md5(_0x500a22[_0x4aac('0x5c')]));}else{_0x500a22[_0x4aac('0x5a')]='';}return getConnection(_0x9994b0)['then'](function(_0x5af238){_0x2003a4=_0x5af238;if(!_['isNil'](_0x5b8930)){return getUser(_0x9994b0,_0x5b8930[_0x4aac('0xe')],_0x2003a4);}else{return getUser(_0x9994b0,null,_0x2003a4);}})['then'](function(_0x9a4bb4){_0x3debf8=_0x9a4bb4;logger['info'](_0x4aac('0x5d'),_0x3debf8['id']);return getEndUser(_0x9994b0,_0x500a22['calleridname'],_0x500a22['calleridnum'],_0x2003a4);})[_0x4aac('0x2a')](function(_0x4b260e){_0x1d3e05=_0x4b260e;logger['info'](_0x4aac('0x60'),_0x1d3e05['id']);return getTicket(_0x9994b0,_0x3debf8,_0x1d3e05,_0x2722e8,_0x500a22,_0x2722e8[_0x4aac('0x6f')],_0x2003a4,_0x4aac('0x77'));})[_0x4aac('0x2a')](function(_0x5c7049){_0x41f70e=_0x5c7049;logger[_0x4aac('0x26')](_0x4aac('0x61'));logger[_0x4aac('0x26')](_0x4aac('0x71'),_0x41f70e['id']);return setRelationship(_0x2003a4,_0x3debf8,_0x41f70e,'users');})[_0x4aac('0x2a')](function(){return setRelationship(_0x2003a4,_0x1d3e05,_0x41f70e,_0x4aac('0x62'));})[_0x4aac('0x2a')](function(){return getServerInfo(_0x2003a4);})['catch'](function(_0x233448){logger[_0x4aac('0x68')]('['+_0x500a22[_0x4aac('0x76')][_0x4aac('0x78')]()+']',JSON[_0x4aac('0x1f')](_0x233448));});}; \ No newline at end of file +var _0x7eff=['../../../../config/logger','defaults','redis','localhost','socket.io-emitter','POST','emit','assigned_user_id','created_by','description','getString','date_start','slice','replace','duration_minutes','parent_type','Contacts','parent_name','name','direction','length','forEach','idField','set_entry','JSON','stringify','Calls','toString','base64','get_server_info','isNil','info','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','value','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','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!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','type','string','nameField','customField','toLowerCase','content','custom_fields','push','variable','variableName','Variable','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment'];(function(_0x5db657,_0x2f40b3){var _0x2d6e70=function(_0x358ed2){while(--_0x358ed2){_0x5db657['push'](_0x5db657['shift']());}};_0x2d6e70(++_0x2f40b3);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0xf7ef('0x0'));var BPromise=require(_0xf7ef('0x1'));var md5=require(_0xf7ef('0x2'));var util=require('util');var Redis=require(_0xf7ef('0x3'));var intUtil=require(_0xf7ef('0x4'));var config=require(_0xf7ef('0x5'));var logger=require(_0xf7ef('0x6'))('sugarcrm');config['redis']=_[_0xf7ef('0x7')](config[_0xf7ef('0x8')],{'host':_0xf7ef('0x9'),'port':0x18eb});var io=require(_0xf7ef('0xa'))(new Redis(config[_0xf7ef('0x8')]));var def={'method':_0xf7ef('0xb'),'json':!![]};function emit(_0x1022af,_0xd8bc8d,_0x540131){io['to'](_0x1022af)[_0xf7ef('0xc')](_0xd8bc8d,_0x540131);}function getTicket(_0x116448,_0x48c84f,_0x25c6c5,_0x5bbb90,_0x5044c4,_0x598fc5,_0x4d7b14,_0x926f7){logger['info']('Creating\x20new\x20ticket...');var _0x4ed444=new Date();var _0xecbdcb=[{'name':'name','value':intUtil['getString'](_0x5bbb90['Subjects'],_0x5044c4,'\x20')},{'name':_0xf7ef('0xd'),'value':_0x48c84f['id']},{'name':_0xf7ef('0xe'),'value':_0x48c84f['id']},{'name':_0xf7ef('0xf'),'value':intUtil[_0xf7ef('0x10')](_0x5bbb90['Descriptions'],_0x5044c4,'\x0a')},{'name':_0xf7ef('0x11'),'value':_0x4ed444['toISOString']()[_0xf7ef('0x12')](0x0,0x13)[_0xf7ef('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xf7ef('0x14'),'value':'15'},{'name':'parent_id','value':_0x25c6c5['id']},{'name':_0xf7ef('0x15'),'value':_0xf7ef('0x16')},{'name':_0xf7ef('0x17'),'value':_0x25c6c5[_0xf7ef('0x18')]},{'name':_0xf7ef('0x19'),'value':_0x926f7}];if(_0x598fc5[_0xf7ef('0x1a')]){_[_0xf7ef('0x1b')](_0x598fc5,function(_0x514e73){if(_0x5044c4[_0x514e73['variableName']]){_0xecbdcb['push']({'name':_0x514e73[_0xf7ef('0x1c')],'value':_0x5044c4[_0x514e73['variableName']]});}});}return request({'form':{'method':_0xf7ef('0x1d'),'input_type':_0xf7ef('0x1e'),'response_type':_0xf7ef('0x1e'),'rest_data':JSON[_0xf7ef('0x1f')]({'session':_0x4d7b14['id'],'module_name':_0xf7ef('0x20'),'name_value_list':_0xecbdcb})}});}function getAuth(_0x29cbf1){return util['format']('Basic\x20%s',new Buffer(_0x29cbf1['apiKey']+':X')[_0xf7ef('0x21')](_0xf7ef('0x22')));}function getServerInfo(_0x1a95c6){return request({'form':{'method':_0xf7ef('0x23'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xf7ef('0x1f')]({'session':_0x1a95c6['id']})}});}function getUser(_0x36c8c8,_0x5e1c75,_0x168da4){if(!_[_0xf7ef('0x24')](_0x5e1c75)){logger[_0xf7ef('0x25')]('Getting\x20agent\x20with\x20name',_0x5e1c75);return request({'form':{'method':_0xf7ef('0x26'),'input_type':_0xf7ef('0x1e'),'response_type':'JSON','rest_data':JSON[_0xf7ef('0x1f')]({'session':_0x168da4['id'],'module_name':_0xf7ef('0x27'),'query':util[_0xf7ef('0x28')](_0xf7ef('0x29'),_0x5e1c75),'order_by':'','offset':'0','select_fields':['id',_0xf7ef('0x18'),_0xf7ef('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7ef('0x2b')](function(_0x31db15){if(_0x31db15[_0xf7ef('0x2c')]['length']){var _0x13a364=_[_0xf7ef('0x2d')](_0x31db15[_0xf7ef('0x2c')],function(_0x3a9292){return _0x3a9292['name_value_list'][_0xf7ef('0x2a')][_0xf7ef('0x2e')]===_0x5e1c75;});if(_0x13a364){logger[_0xf7ef('0x25')]('Agent\x20found!');return BPromise[_0xf7ef('0x2f')]({'id':_0x13a364['name_value_list']['id'][_0xf7ef('0x2e')],'name':_0x13a364[_0xf7ef('0x30')][_0xf7ef('0x18')][_0xf7ef('0x2e')]});}}logger['info'](_0xf7ef('0x31'));return BPromise[_0xf7ef('0x2f')]({'id':_0x168da4[_0xf7ef('0x30')]['user_id'][_0xf7ef('0x2e')],'name':_0x168da4[_0xf7ef('0x30')][_0xf7ef('0x2a')][_0xf7ef('0x2e')]});});}else{logger[_0xf7ef('0x25')](_0xf7ef('0x32'));return BPromise[_0xf7ef('0x2f')]({'id':_0x168da4[_0xf7ef('0x30')][_0xf7ef('0x33')]['value'],'name':_0x168da4[_0xf7ef('0x30')][_0xf7ef('0x2a')][_0xf7ef('0x2e')]});}}function getEndUser(_0x445964,_0x34fc2c,_0x233ae2,_0x90e4a1){logger[_0xf7ef('0x25')](_0xf7ef('0x34'),_0x233ae2);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xf7ef('0x1e'),'rest_data':JSON[_0xf7ef('0x1f')]({'session':_0x90e4a1['id'],'module_name':_0xf7ef('0x16'),'query':util[_0xf7ef('0x28')](_0xf7ef('0x35'),_0x233ae2),'order_by':'','offset':'0','select_fields':['id',_0xf7ef('0x18'),_0xf7ef('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xf7ef('0x2b')](function(_0x5449c1){if(_0x5449c1[_0xf7ef('0x2c')][_0xf7ef('0x1a')]){var _0x55721c=_['find'](_0x5449c1[_0xf7ef('0x2c')],function(_0x3ea37f){return _0x3ea37f[_0xf7ef('0x30')][_0xf7ef('0x36')][_0xf7ef('0x2e')]===_0x233ae2;});if(_0x55721c){logger[_0xf7ef('0x25')](_0xf7ef('0x37'));return BPromise[_0xf7ef('0x2f')]({'id':_0x55721c['name_value_list']['id']['value'],'name':_0x55721c[_0xf7ef('0x30')]['name'][_0xf7ef('0x2e')],'phone':_0x55721c[_0xf7ef('0x30')][_0xf7ef('0x36')][_0xf7ef('0x2e')]});}}else{logger[_0xf7ef('0x25')](_0xf7ef('0x38'));return request({'form':{'method':_0xf7ef('0x1d'),'input_type':_0xf7ef('0x1e'),'response_type':_0xf7ef('0x1e'),'rest_data':JSON['stringify']({'session':_0x90e4a1['id'],'module_name':_0xf7ef('0x16'),'name_value_list':[{'name':_0xf7ef('0x39'),'value':_0x34fc2c!==''?_0x34fc2c:util[_0xf7ef('0x28')](_0xf7ef('0x3a'),_0x233ae2)},{'name':_0xf7ef('0x36'),'value':_0x233ae2}]})}})[_0xf7ef('0x2b')](function(_0x69d4c7){logger[_0xf7ef('0x25')](_0xf7ef('0x3b'));return BPromise[_0xf7ef('0x2f')]({'id':_0x69d4c7['id'],'name':_0x69d4c7[_0xf7ef('0x2c')][_0xf7ef('0x39')]['value'],'phone':_0x69d4c7['entry_list']['phone_home'][_0xf7ef('0x2e')]});});}});}function request(_0x540783){logger[_0xf7ef('0x3c')](_0xf7ef('0x3d'),JSON[_0xf7ef('0x1f')](_0x540783));return rp(_['merge'](def,_0x540783));}function getTags(_0x123ec4,_0x55eb48){var _0x25141f=[];if(_0x123ec4&&_0x123ec4[_0xf7ef('0x1a')]>0x0){_0x25141f=_[_0xf7ef('0x3e')](_0x123ec4,_0x55eb48);}return _0x25141f;}function getCustomFields(_0x30e539,_0x156e3b){var _0x437f00=[];var _0x1c5974={'custom_fields':[]};if(_0x30e539[_0xf7ef('0x1a')]>0x0){_[_0xf7ef('0x1b')](_0x30e539,function(_0x1f504f){if(_0x1f504f[_0xf7ef('0x3f')]===_0xf7ef('0x40')&&_0x1f504f[_0xf7ef('0x41')]&&!_0x1f504f[_0xf7ef('0x42')]){_0x1c5974[_0x1f504f[_0xf7ef('0x41')][_0xf7ef('0x43')]()]=_0x1f504f[_0xf7ef('0x44')][_0xf7ef('0x21')]();}else if(_0x1f504f[_0xf7ef('0x3f')]===_0xf7ef('0x40')&&_0x1f504f[_0xf7ef('0x1c')]&&_0x1f504f['customField']){_0x1c5974[_0xf7ef('0x45')][_0xf7ef('0x46')]({'id':_0x1f504f[_0xf7ef('0x1c')],'value':_0x1f504f['content'][_0xf7ef('0x21')]()});}else if(_0x1f504f[_0xf7ef('0x3f')]===_0xf7ef('0x47')&&_0x1f504f[_0xf7ef('0x48')]&&_0x1f504f[_0xf7ef('0x1c')]&&_0x1f504f[_0xf7ef('0x42')]){_0x156e3b[_0x1f504f[_0xf7ef('0x48')]]&&_0x1c5974[_0xf7ef('0x45')][_0xf7ef('0x46')]({'id':_0x1f504f[_0xf7ef('0x1c')],'value':_0x156e3b[_0x1f504f[_0xf7ef('0x48')]][_0xf7ef('0x21')]()});}else if(_0x1f504f['type']==='customVariable'&&_0x1f504f[_0xf7ef('0x49')]&&_0x1f504f['Variable'][_0xf7ef('0x18')]&&_0x1f504f[_0xf7ef('0x1c')]&&_0x1f504f[_0xf7ef('0x42')]){_0x156e3b[_0x1f504f[_0xf7ef('0x49')][_0xf7ef('0x18')]['toLowerCase']()]&&_0x1c5974['custom_fields'][_0xf7ef('0x46')]({'id':_0x1f504f[_0xf7ef('0x1c')],'value':_0x156e3b[_0x1f504f[_0xf7ef('0x49')][_0xf7ef('0x18')][_0xf7ef('0x43')]()]['toString']()});}});}return _0x1c5974;}function getConnection(_0xca3d3c){return request({'method':_0xf7ef('0xb'),'form':{'method':'login','input_type':_0xf7ef('0x1e'),'response_type':_0xf7ef('0x1e'),'rest_data':JSON[_0xf7ef('0x1f')]({'user_auth':{'user_name':_0xca3d3c[_0xf7ef('0x4a')],'password':_0xca3d3c[_0xf7ef('0x4b')],'encryption':'PLAIN'},'application':_0xf7ef('0x4c')})}})[_0xf7ef('0x2b')](function(_0x4a0924){var _0x3f71df=_0x4a0924;if(_0x3f71df['id']){def[_0xf7ef('0x4d')]=_0x3f71df['id'];return BPromise['resolve'](_0x3f71df);}else{throw new Error(util[_0xf7ef('0x28')](_0xf7ef('0x4e'),_0xca3d3c['id']));}});}function setRelationship(_0x320a24,_0x2a8c11,_0x3deb9f,_0x4fb7b2){return request({'form':{'method':_0xf7ef('0x4f'),'input_type':_0xf7ef('0x1e'),'response_type':_0xf7ef('0x1e'),'rest_data':JSON[_0xf7ef('0x1f')]({'session':_0x320a24['id'],'module_name':_0xf7ef('0x20'),'module_id':_0x3deb9f['id'],'link_field_name':_0x4fb7b2,'related_ids':[_0x2a8c11['id']]})}});}exports[_0xf7ef('0x50')]=function(_0x30153b,_0x32ae73,_0x32a786,_0x206bfc,_0x80a9fb,_0x30392e){var _0x3beef0,_0xb8faa2,_0x57488b,_0x473463;_0x30392e[_0xf7ef('0x51')]=intUtil[_0xf7ef('0x52')](_0x30392e[_0xf7ef('0x51')]);_0x30392e[_0xf7ef('0x53')]=intUtil['stripTrailingSlash'](_0x30392e[_0xf7ef('0x53')]);def[_0xf7ef('0x54')]=util[_0xf7ef('0x28')](_0xf7ef('0x55'),_0x30392e[_0xf7ef('0x51')]);if(_0x80a9fb&&_0x80a9fb['monitor_format']){logger['info'](_0xf7ef('0x56'),_0xf7ef('0x57'));_0x32ae73[_0xf7ef('0x58')]=util[_0xf7ef('0x28')](_0xf7ef('0x59'),_0x30392e[_0xf7ef('0x53')],_0x32ae73[_0xf7ef('0x5a')],md5(_0x32ae73[_0xf7ef('0x5a')]));}else{_0x32ae73['recordingURL']='';}return getConnection(_0x30392e)[_0xf7ef('0x2b')](function(_0x1ab330){_0x473463=_0x1ab330;return getUser(_0x30392e,_0x206bfc[_0xf7ef('0x18')],_0x473463);})[_0xf7ef('0x2b')](function(_0x26e9f6){_0x3beef0=_0x26e9f6;logger['info'](_0xf7ef('0x5b'),_0x3beef0['id']);return getEndUser(_0x30392e,_0x32ae73[_0xf7ef('0x5c')],_0x32ae73[_0xf7ef('0x5d')],_0x473463);})['then'](function(_0x4e4ba7){_0xb8faa2=_0x4e4ba7;logger[_0xf7ef('0x25')](_0xf7ef('0x5e'),_0xb8faa2['id']);return getTicket(_0x30392e,_0x3beef0,_0xb8faa2,_0x32a786,_0x32ae73,_0x32a786[_0xf7ef('0x5f')],_0x473463,_0xf7ef('0x60'));})['then'](function(_0x6daf30){_0x57488b=_0x6daf30;logger[_0xf7ef('0x25')]('Ticket\x20created!');logger[_0xf7ef('0x25')](_0xf7ef('0x61'),_0x57488b['id']);return setRelationship(_0x473463,_0x3beef0,_0x57488b,_0xf7ef('0x62'));})[_0xf7ef('0x2b')](function(){return setRelationship(_0x473463,_0xb8faa2,_0x57488b,_0xf7ef('0x63'));})['then'](function(){return getServerInfo(_0x473463);})[_0xf7ef('0x2b')](function(_0x4c7f92){var _0x1dfcad=parseInt(_0x4c7f92[_0xf7ef('0x64')][_0xf7ef('0x65')](0x0));var _0x3947a0=util['format'](_0xf7ef('0x66'),_0x30392e[_0xf7ef('0x51')],_0x57488b['id']);if(_0x1dfcad>0x6){_0x3947a0=util[_0xf7ef('0x28')](_0xf7ef('0x67'),_0x30392e[_0xf7ef('0x51')],_0x57488b['id']);}logger[_0xf7ef('0x25')](_0xf7ef('0x56'),_0xf7ef('0x68'));emit(util[_0xf7ef('0x28')](_0xf7ef('0x69'),_0x206bfc[_0xf7ef('0x18')]),_0xf7ef('0x6a'),{'uri':_0x3947a0});})[_0xf7ef('0x6b')](function(_0xe4bffe){logger[_0xf7ef('0x6c')](_0xf7ef('0x56'),JSON['stringify'](_0xe4bffe));});};exports[_0xf7ef('0x6d')]=function(_0xed77fe,_0x3b227e,_0x10b96b,_0x873d4d,_0x19086c,_0x26bf75,_0x4dc9a6){var _0x557b04,_0x47158f,_0x494ba3,_0x54f64f;_0x26bf75[_0xf7ef('0x51')]=intUtil['stripTrailingSlash'](_0x26bf75[_0xf7ef('0x51')]);_0x26bf75[_0xf7ef('0x53')]=intUtil[_0xf7ef('0x52')](_0x26bf75[_0xf7ef('0x53')]);def[_0xf7ef('0x54')]=util['format'](_0xf7ef('0x55'),_0x26bf75[_0xf7ef('0x51')]);if(_0x4dc9a6&&_0x4dc9a6['recordingFormat']&&_0x4dc9a6['recordingFormat']!==_0xf7ef('0x6e')){logger['info'](_0xf7ef('0x6f'),_0xf7ef('0x57'));_0x3b227e[_0xf7ef('0x58')]=util[_0xf7ef('0x28')](_0xf7ef('0x59'),_0x26bf75['serverUrl'],_0x3b227e['uniqueid'],md5(_0x3b227e[_0xf7ef('0x5a')]));}return getConnection(_0x26bf75)['then'](function(_0x53480e){_0x54f64f=_0x53480e;return getUser(_0x26bf75,_0x873d4d['name'],_0x54f64f);})[_0xf7ef('0x2b')](function(_0x54742d){_0x557b04=_0x54742d;logger[_0xf7ef('0x25')](_0xf7ef('0x5b'),_0x557b04['id']);return getEndUser(_0x26bf75,_0x3b227e[_0xf7ef('0x70')],_0x3b227e[_0xf7ef('0x71')],_0x54f64f);})[_0xf7ef('0x2b')](function(_0x1530a3){_0x47158f=_0x1530a3;logger['info'](_0xf7ef('0x5e'),_0x47158f['id']);return getTicket(_0x26bf75,_0x557b04,_0x47158f,_0x10b96b,_0x3b227e,_0x10b96b[_0xf7ef('0x5f')],_0x54f64f,_0xf7ef('0x72'));})['then'](function(_0x5cf8f5){_0x494ba3=_0x5cf8f5;logger[_0xf7ef('0x25')](_0xf7ef('0x73'));logger[_0xf7ef('0x25')](_0xf7ef('0x61'),_0x494ba3['id']);return setRelationship(_0x54f64f,_0x557b04,_0x494ba3,'users');})[_0xf7ef('0x2b')](function(){return setRelationship(_0x54f64f,_0x47158f,_0x494ba3,_0xf7ef('0x63'));})[_0xf7ef('0x2b')](function(){return getServerInfo(_0x54f64f);})[_0xf7ef('0x2b')](function(_0x49b0e3){var _0x170540=parseInt(_0x49b0e3[_0xf7ef('0x64')][_0xf7ef('0x65')](0x0));var _0x2f2a0a=util['format'](_0xf7ef('0x66'),_0x26bf75[_0xf7ef('0x51')],_0x494ba3['id']);if(_0x170540>0x6){_0x2f2a0a=util[_0xf7ef('0x28')](_0xf7ef('0x67'),_0x26bf75[_0xf7ef('0x51')],_0x494ba3['id']);}logger[_0xf7ef('0x25')](_0xf7ef('0x6f'),_0xf7ef('0x68'));emit(util[_0xf7ef('0x28')]('user:%s',_0x873d4d[_0xf7ef('0x18')]),_0xf7ef('0x6a'),{'uri':_0x2f2a0a});})[_0xf7ef('0x6b')](function(_0x5808b8){logger[_0xf7ef('0x6c')](_0xf7ef('0x6f'),JSON['stringify'](_0x5808b8));});};exports[_0xf7ef('0x74')]=function(_0x1c722,_0x259246,_0x2e314b,_0x5ba83a,_0x1acf79,_0x8cacaf){var _0x195840,_0x161d91,_0x4279fb,_0x12b731;_0x8cacaf['remoteUri']=intUtil[_0xf7ef('0x52')](_0x8cacaf[_0xf7ef('0x51')]);_0x8cacaf['serverUrl']=intUtil[_0xf7ef('0x52')](_0x8cacaf[_0xf7ef('0x53')]);def[_0xf7ef('0x54')]=util[_0xf7ef('0x28')](_0xf7ef('0x55'),_0x8cacaf[_0xf7ef('0x51')]);if(_0x1acf79&&_0x1acf79[_0xf7ef('0x75')]){logger['info']('['+_0x259246[_0xf7ef('0x76')][_0xf7ef('0x77')]()+']',_0xf7ef('0x57'));_0x259246[_0xf7ef('0x58')]=util[_0xf7ef('0x28')](_0xf7ef('0x59'),_0x8cacaf[_0xf7ef('0x53')],_0x259246[_0xf7ef('0x5a')],md5(_0x259246['uniqueid']));}else{_0x259246[_0xf7ef('0x58')]='';}return getConnection(_0x8cacaf)[_0xf7ef('0x2b')](function(_0xf2a34c){_0x12b731=_0xf2a34c;if(!_[_0xf7ef('0x24')](_0x5ba83a)){return getUser(_0x8cacaf,_0x5ba83a['name'],_0x12b731);}else{return getUser(_0x8cacaf,null,_0x12b731);}})[_0xf7ef('0x2b')](function(_0x3b2186){_0x195840=_0x3b2186;logger[_0xf7ef('0x25')](_0xf7ef('0x5b'),_0x195840['id']);return getEndUser(_0x8cacaf,_0x259246[_0xf7ef('0x5c')],_0x259246[_0xf7ef('0x5d')],_0x12b731);})[_0xf7ef('0x2b')](function(_0x216d26){_0x161d91=_0x216d26;logger[_0xf7ef('0x25')](_0xf7ef('0x5e'),_0x161d91['id']);return getTicket(_0x8cacaf,_0x195840,_0x161d91,_0x2e314b,_0x259246,_0x2e314b[_0xf7ef('0x5f')],_0x12b731,_0xf7ef('0x60'));})[_0xf7ef('0x2b')](function(_0x109c94){_0x4279fb=_0x109c94;logger[_0xf7ef('0x25')](_0xf7ef('0x73'));logger[_0xf7ef('0x25')](_0xf7ef('0x61'),_0x4279fb['id']);return setRelationship(_0x12b731,_0x195840,_0x4279fb,_0xf7ef('0x62'));})[_0xf7ef('0x2b')](function(){return setRelationship(_0x12b731,_0x161d91,_0x4279fb,_0xf7ef('0x63'));})[_0xf7ef('0x2b')](function(){return getServerInfo(_0x12b731);})[_0xf7ef('0x6b')](function(_0x264c35){logger[_0xf7ef('0x6c')]('['+_0x259246[_0xf7ef('0x76')][_0xf7ef('0x77')]()+']',JSON[_0xf7ef('0x1f')](_0x264c35));});}; \ 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 989269c..a4d76a9 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 _0xcab9=['keyType','key','%s:\x20%s','customVariable','join','stripTrailingSlash','slice','substring','validateEmail','lodash','sortBy','string','push','content','type','variable','variableName','name','Variable','toLowerCase','keyValue'];(function(_0x3fed74,_0x18b0e6){var _0x2c62e3=function(_0x3947a1){while(--_0x3947a1){_0x3fed74['push'](_0x3fed74['shift']());}};_0x2c62e3(++_0x18b0e6);}(_0xcab9,0x72));var _0x9cab=function(_0x4d2c7e,_0x5df3bc){_0x4d2c7e=_0x4d2c7e-0x0;var _0x1f837f=_0xcab9[_0x4d2c7e];return _0x1f837f;};'use strict';var _=require(_0x9cab('0x0'));var util=require('util');exports['getString']=function(_0x32b20c,_0x348050,_0x2704ba){var _0x30ec6e=[];if(_0x32b20c['length']>0x0){var _0x2a530f=_[_0x9cab('0x1')](_0x32b20c,['id']);for(var _0x59a266=0x0;_0x59a266<_0x2a530f['length'];_0x59a266++){var _0x1546b9=_0x2a530f[_0x59a266];if(_0x1546b9['type']===_0x9cab('0x2')){_0x30ec6e[_0x9cab('0x3')](_0x1546b9[_0x9cab('0x4')]);}else if(_0x1546b9[_0x9cab('0x5')]===_0x9cab('0x6')&&_0x1546b9[_0x9cab('0x7')]){_0x348050[_0x1546b9[_0x9cab('0x7')]]&&_0x30ec6e[_0x9cab('0x3')](_0x348050[_0x1546b9['variableName']]['toString']());}else if(_0x1546b9['type']==='customVariable'&&_0x1546b9['Variable']&&_0x1546b9['Variable'][_0x9cab('0x8')]){_0x348050[_0x1546b9[_0x9cab('0x9')][_0x9cab('0x8')]['toLowerCase']()]&&_0x30ec6e[_0x9cab('0x3')](_0x348050[_0x1546b9[_0x9cab('0x9')][_0x9cab('0x8')][_0x9cab('0xa')]()]['toString']());}else if(_0x1546b9['type']===_0x9cab('0xb')){if(_0x1546b9[_0x9cab('0xc')]==='string'&&_0x1546b9[_0x9cab('0xd')]){_0x30ec6e[_0x9cab('0x3')](util['format'](_0x9cab('0xe'),_0x1546b9['key'],_0x1546b9['keyContent']));}else if(_0x1546b9[_0x9cab('0xc')]===_0x9cab('0x6')&&_0x1546b9['variableName']&&_0x1546b9[_0x9cab('0xd')]){_0x348050[_0x1546b9[_0x9cab('0x7')]]&&_0x30ec6e[_0x9cab('0x3')](util['format'](_0x9cab('0xe'),_0x1546b9[_0x9cab('0xd')],_0x348050[_0x1546b9[_0x9cab('0x7')]]));}else if(_0x1546b9[_0x9cab('0xc')]===_0x9cab('0xf')&&_0x1546b9[_0x9cab('0x9')]&&_0x1546b9[_0x9cab('0x9')][_0x9cab('0x8')]&&_0x1546b9['key']){_0x348050[_0x1546b9[_0x9cab('0x9')][_0x9cab('0x8')][_0x9cab('0xa')]()]&&_0x30ec6e[_0x9cab('0x3')](util['format'](_0x9cab('0xe'),_0x1546b9[_0x9cab('0xd')],_0x348050[_0x1546b9[_0x9cab('0x9')][_0x9cab('0x8')][_0x9cab('0xa')]()]));}}}}return _0x30ec6e[_0x9cab('0x10')](_0x2704ba);};exports[_0x9cab('0x11')]=function(_0x4655d4){var _0x4e9ff8=_0x4655d4[_0x9cab('0x12')](-0x1);if(_0x4e9ff8==='/'){_0x4655d4=_0x4655d4[_0x9cab('0x13')](0x0,_0x4655d4['lastIndexOf'](_0x4e9ff8));}return _0x4655d4;};exports[_0x9cab('0x14')]=function(_0x5e777a){if(!_['isNil'](_0x5e777a)&&_0x5e777a!==''){var _0x1eab87=/^(([^<>()\[\]\\.,;:\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 _0x1eab87['test'](String(_0x5e777a)[_0x9cab('0xa')]());}else{return![];}}; \ No newline at end of file +var _0xcf77=['lodash','util','getString','length','type','push','content','variable','variableName','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test'];(function(_0x4bd301,_0x258b94){var _0x3931b3=function(_0x1ed2b0){while(--_0x1ed2b0){_0x4bd301['push'](_0x4bd301['shift']());}};_0x3931b3(++_0x258b94);}(_0xcf77,0xd8));var _0x7cf7=function(_0x380573,_0x5f2c44){_0x380573=_0x380573-0x0;var _0x2c5653=_0xcf77[_0x380573];return _0x2c5653;};'use strict';var _=require(_0x7cf7('0x0'));var util=require(_0x7cf7('0x1'));exports[_0x7cf7('0x2')]=function(_0x4ee8b8,_0xc748a7,_0x58fea1){var _0x7c7c78=[];if(_0x4ee8b8[_0x7cf7('0x3')]>0x0){var _0x4bd725=_['sortBy'](_0x4ee8b8,['id']);for(var _0x1c6282=0x0;_0x1c6282<_0x4bd725[_0x7cf7('0x3')];_0x1c6282++){var _0x28fd04=_0x4bd725[_0x1c6282];if(_0x28fd04[_0x7cf7('0x4')]==='string'){_0x7c7c78[_0x7cf7('0x5')](_0x28fd04[_0x7cf7('0x6')]);}else if(_0x28fd04['type']===_0x7cf7('0x7')&&_0x28fd04[_0x7cf7('0x8')]){_0xc748a7[_0x28fd04[_0x7cf7('0x8')]]&&_0x7c7c78[_0x7cf7('0x5')](_0xc748a7[_0x28fd04[_0x7cf7('0x8')]]['toString']());}else if(_0x28fd04[_0x7cf7('0x4')]===_0x7cf7('0x9')&&_0x28fd04[_0x7cf7('0xa')]&&_0x28fd04['Variable'][_0x7cf7('0xb')]){_0xc748a7[_0x28fd04[_0x7cf7('0xa')]['name']['toLowerCase']()]&&_0x7c7c78['push'](_0xc748a7[_0x28fd04['Variable'][_0x7cf7('0xb')][_0x7cf7('0xc')]()]['toString']());}else if(_0x28fd04[_0x7cf7('0x4')]===_0x7cf7('0xd')){if(_0x28fd04[_0x7cf7('0xe')]===_0x7cf7('0xf')&&_0x28fd04[_0x7cf7('0x10')]){_0x7c7c78[_0x7cf7('0x5')](util[_0x7cf7('0x11')](_0x7cf7('0x12'),_0x28fd04['key'],_0x28fd04[_0x7cf7('0x13')]));}else if(_0x28fd04[_0x7cf7('0xe')]==='variable'&&_0x28fd04[_0x7cf7('0x8')]&&_0x28fd04[_0x7cf7('0x10')]){_0xc748a7[_0x28fd04[_0x7cf7('0x8')]]&&_0x7c7c78[_0x7cf7('0x5')](util[_0x7cf7('0x11')](_0x7cf7('0x12'),_0x28fd04['key'],_0xc748a7[_0x28fd04['variableName']]));}else if(_0x28fd04['keyType']==='customVariable'&&_0x28fd04[_0x7cf7('0xa')]&&_0x28fd04[_0x7cf7('0xa')]['name']&&_0x28fd04[_0x7cf7('0x10')]){_0xc748a7[_0x28fd04['Variable'][_0x7cf7('0xb')][_0x7cf7('0xc')]()]&&_0x7c7c78[_0x7cf7('0x5')](util['format'](_0x7cf7('0x12'),_0x28fd04[_0x7cf7('0x10')],_0xc748a7[_0x28fd04[_0x7cf7('0xa')]['name']['toLowerCase']()]));}}}}return _0x7c7c78[_0x7cf7('0x14')](_0x58fea1);};exports[_0x7cf7('0x15')]=function(_0x2bd7d3){var _0x318c66=_0x2bd7d3[_0x7cf7('0x16')](-0x1);if(_0x318c66==='/'){_0x2bd7d3=_0x2bd7d3[_0x7cf7('0x17')](0x0,_0x2bd7d3[_0x7cf7('0x18')](_0x318c66));}return _0x2bd7d3;};exports['validateEmail']=function(_0x1f608d){if(!_[_0x7cf7('0x19')](_0x1f608d)&&_0x1f608d!==''){var _0x456ee0=/^(([^<>()\[\]\\.,;:\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 _0x456ee0[_0x7cf7('0x1a')](String(_0x1f608d)[_0x7cf7('0xc')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 11f30ee..9b719dc 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 _0x2fa8=['email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','Searching\x20end\x20user\x20with\x20phone','GET','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','create','Contacts','phone','getEndUser','getchallenge','login','Account\x20%d\x20is\x20not\x20valid','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','user:%s','trigger:browser:url','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','lastevent','toUpperCase','lodash','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','emit','length','forEach','type','string','idField','toString','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','getString','Descriptions','POST','format','%s/webservice.php','remoteUri','username','sessionName','HelpDesk','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','stringify','validateEmail','Getting\x20agent\x20with\x20email','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x3b8d79,_0x968003){var _0x87d67e=function(_0x508b6a){while(--_0x508b6a){_0x3b8d79['push'](_0x3b8d79['shift']());}};_0x87d67e(++_0x968003);}(_0x2fa8,0x90));var _0x82fa=function(_0xc2791a,_0x40048b){_0xc2791a=_0xc2791a-0x0;var _0x123db1=_0x2fa8[_0xc2791a];return _0x123db1;};'use strict';var _=require(_0x82fa('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require(_0x82fa('0x1'));var util=require('util');var Redis=require(_0x82fa('0x2'));var intUtil=require(_0x82fa('0x3'));var config=require(_0x82fa('0x4'));var logger=require(_0x82fa('0x5'))(_0x82fa('0x6'));config[_0x82fa('0x7')]=_[_0x82fa('0x8')](config[_0x82fa('0x7')],{'host':_0x82fa('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x82fa('0x7')]));function emit(_0x4551c2,_0x9855b1,_0x1e834e){io['to'](_0x4551c2)[_0x82fa('0xa')](_0x9855b1,_0x1e834e);}function getCustomFields(_0x4b9ab8,_0x4c5980){var _0x3e23c5={};if(_0x4b9ab8[_0x82fa('0xb')]>0x0){_[_0x82fa('0xc')](_0x4b9ab8,function(_0x311ef1){if(_0x311ef1[_0x82fa('0xd')]===_0x82fa('0xe')&&_0x311ef1['idField']){_0x3e23c5[_0x311ef1[_0x82fa('0xf')]]=_0x311ef1['content'][_0x82fa('0x10')]();}else if(_0x311ef1['type']===_0x82fa('0x11')&&_0x311ef1[_0x82fa('0x12')]&&_0x311ef1[_0x82fa('0xf')]&&_0x4c5980[_0x311ef1[_0x82fa('0x12')]]){_0x3e23c5[_0x311ef1[_0x82fa('0xf')]]=_0x4c5980[_0x311ef1[_0x82fa('0x12')]]['toString']();}else if(_0x311ef1[_0x82fa('0xd')]==='customVariable'&&_0x311ef1[_0x82fa('0x13')]&&_0x311ef1['Variable'][_0x82fa('0x14')]&&_0x311ef1[_0x82fa('0xf')]&&_0x4c5980[_0x311ef1['Variable'][_0x82fa('0x14')][_0x82fa('0x15')]()]){_0x3e23c5[_0x311ef1[_0x82fa('0xf')]]=_0x4c5980[_0x311ef1[_0x82fa('0x13')][_0x82fa('0x14')][_0x82fa('0x15')]()][_0x82fa('0x10')]();}});}return _0x3e23c5;}function createTicket(_0x5104fc,_0x3150ba,_0xa8b43d,_0x12e89a,_0x1fb89f,_0x289026,_0x5b9bbe){logger[_0x82fa('0x16')](_0x82fa('0x17'));var _0x208ec4=_['merge']({'parent_id':'','assigned_user_id':_0x3150ba['id'],'ticketpriorities':_0x82fa('0x18'),'ticketstatus':_0x82fa('0x19'),'ticket_title':intUtil[_0x82fa('0x1a')](_0x12e89a['Subjects'],_0x1fb89f,'\x20'),'description':intUtil['getString'](_0x12e89a[_0x82fa('0x1b')],_0x1fb89f,'\x0a'),'contact_id':_0xa8b43d['id']},getCustomFields(_0x289026,_0x1fb89f));var _0x5b630c={'method':_0x82fa('0x1c'),'uri':util[_0x82fa('0x1d')](_0x82fa('0x1e'),_0x5104fc[_0x82fa('0x1f')]),'form':{'operation':'create','username':_0x5104fc[_0x82fa('0x20')],'sessionName':_0x5b9bbe[_0x82fa('0x21')],'elementType':_0x82fa('0x22'),'element':JSON['stringify'](_0x208ec4)},'json':!![]};return request(_0x5b630c)[_0x82fa('0x23')](function(_0x441aca){if(_0x441aca[_0x82fa('0x24')]){return BPromise[_0x82fa('0x25')]({'id':_0x441aca[_0x82fa('0x26')]['id']});}else{throw new Error(util[_0x82fa('0x1d')](_0x82fa('0x27'),JSON['stringify'](_0x441aca[_0x82fa('0x28')])));}})[_0x82fa('0x29')](function(_0x5dbd7a){var _0x1bbe00=_0x5dbd7a[_0x82fa('0x2a')]||0x1f4;logger[_0x82fa('0x28')](_0x82fa('0x2b'),_0x82fa('0x2c'),_0x1bbe00,JSON[_0x82fa('0x2d')](_0x5dbd7a));});}function getUser(_0x4aae32,_0x530e33,_0x986141){if(intUtil[_0x82fa('0x2e')](_0x530e33)){logger['info'](_0x82fa('0x2f'),_0x530e33);return request({'method':'GET','uri':util['format'](_0x82fa('0x1e'),_0x4aae32[_0x82fa('0x1f')]),'qs':{'operation':_0x82fa('0x30'),'username':_0x4aae32[_0x82fa('0x20')],'sessionName':_0x986141['sessionName'],'query':util[_0x82fa('0x1d')](_0x82fa('0x31'),_0x530e33)},'json':!![]})['then'](function(_0x5b53cf){if(_0x5b53cf[_0x82fa('0x24')]&&_0x5b53cf[_0x82fa('0x26')][_0x82fa('0xb')]){logger['info']('Agent\x20found!');return BPromise[_0x82fa('0x25')]({'id':_0x5b53cf[_0x82fa('0x26')][0x0]['id'],'email':_0x5b53cf['result'][0x0][_0x82fa('0x32')],'name':_0x5b53cf[_0x82fa('0x26')][0x0][_0x82fa('0x33')]+'\x20'+_0x5b53cf[_0x82fa('0x26')][_0x82fa('0x34')]});}else{logger[_0x82fa('0x16')](_0x82fa('0x35'));return BPromise[_0x82fa('0x25')]({'id':_0x986141[_0x82fa('0x36')],'email':_0x4aae32[_0x82fa('0x20')],'name':_0x82fa('0x37')});}})[_0x82fa('0x29')](function(_0x5e6af9){var _0x557365=_0x5e6af9[_0x82fa('0x2a')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x82fa('0x38'),_0x557365,JSON[_0x82fa('0x2d')](_0x5e6af9));});}else{logger[_0x82fa('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x986141[_0x82fa('0x36')],'email':_0x4aae32[_0x82fa('0x20')],'name':_0x82fa('0x37')})[_0x82fa('0x29')](function(_0xe3445f){var _0x2de792=_0xe3445f[_0x82fa('0x2a')]||0x1f4;logger[_0x82fa('0x28')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x82fa('0x38'),_0x2de792,JSON[_0x82fa('0x2d')](_0xe3445f));});}}function getEndUser(_0x1abbfe,_0x2cdd12,_0x5df778,_0x170cb8){logger[_0x82fa('0x16')](_0x82fa('0x39'),_0x5df778);return request({'method':_0x82fa('0x3a'),'uri':util[_0x82fa('0x1d')]('%s/webservice.php',_0x1abbfe[_0x82fa('0x1f')]),'qs':{'operation':'query','username':_0x1abbfe['username'],'sessionName':_0x170cb8[_0x82fa('0x21')],'query':util['format'](_0x82fa('0x3b'),_0x5df778,_0x5df778,_0x5df778,_0x5df778,_0x5df778)},'json':!![]})[_0x82fa('0x23')](function(_0x71a05d){if(_0x71a05d[_0x82fa('0x24')]&&_0x71a05d[_0x82fa('0x26')][_0x82fa('0xb')]){logger[_0x82fa('0x16')](_0x82fa('0x3c'));return BPromise[_0x82fa('0x25')]({'id':_0x71a05d[_0x82fa('0x26')][0x0]['id'],'name':_0x71a05d[_0x82fa('0x26')][0x0][_0x82fa('0x3d')]+'\x20'+_0x71a05d[_0x82fa('0x26')][0x0][_0x82fa('0x3e')],'phone':_0x5df778});}else{logger[_0x82fa('0x16')](_0x82fa('0x3f'));return request({'method':'POST','uri':util[_0x82fa('0x1d')](_0x82fa('0x1e'),_0x1abbfe[_0x82fa('0x1f')]),'form':{'operation':_0x82fa('0x40'),'sessionName':_0x170cb8[_0x82fa('0x21')],'elementType':_0x82fa('0x41'),'element':JSON['stringify']({'lastname':_0x2cdd12,'phone':_0x5df778,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x39beaf){logger[_0x82fa('0x16')]('Enduser\x20created.');return BPromise[_0x82fa('0x25')]({'id':_0x39beaf[_0x82fa('0x26')]['id'],'name':_0x39beaf[_0x82fa('0x26')][_0x82fa('0x3e')],'phone':_0x39beaf[_0x82fa('0x26')][_0x82fa('0x42')]});})[_0x82fa('0x29')](function(_0x496837){var _0x4c2aba=_0x496837[_0x82fa('0x2a')]||0x1f4;logger[_0x82fa('0x28')](_0x82fa('0x2b'),_0x82fa('0x43'),_0x4c2aba,JSON[_0x82fa('0x2d')](_0x496837));});}});}function getConnection(_0x24a871){var _0x32de50=_0x24a871[_0x82fa('0x20')];var _0x3387aa=_0x24a871['accessKey'];return request({'method':_0x82fa('0x3a'),'uri':util['format'](_0x82fa('0x1e'),_0x24a871[_0x82fa('0x1f')]),'qs':{'operation':_0x82fa('0x44'),'username':_0x32de50},'json':!![]})['then'](function(_0x564d22){if(_0x564d22[_0x82fa('0x24')]){return request({'method':_0x82fa('0x1c'),'uri':util[_0x82fa('0x1d')]('%s/webservice.php',_0x24a871[_0x82fa('0x1f')]),'form':{'operation':_0x82fa('0x45'),'username':_0x32de50,'accessKey':md5(_0x564d22[_0x82fa('0x26')]['token']+_0x3387aa)},'json':!![]});}})[_0x82fa('0x23')](function(_0x44b058){if(_0x44b058[_0x82fa('0x24')]){return BPromise[_0x82fa('0x25')](_0x44b058['result']);}else{throw new Error(util[_0x82fa('0x1d')](_0x82fa('0x46'),_0x24a871['id']));}})[_0x82fa('0x29')](function(_0x37fd46){var _0x2d4796=_0x37fd46['statusCode']||0x1f4;logger[_0x82fa('0x28')](_0x82fa('0x2b'),'getConnection',_0x2d4796,JSON['stringify'](_0x37fd46));});}function request(_0x3df24d){logger[_0x82fa('0x16')]('[HTTP]',JSON[_0x82fa('0x2d')](_0x3df24d));return rp(_0x3df24d);}exports['queue']=function(_0xe21c38,_0x393a8d,_0x584d48,_0x12fbb2,_0x2f1d55,_0x474061){var _0x26ac50,_0x69c128,_0xb8ad9,_0x350890;_0x474061[_0x82fa('0x1f')]=intUtil[_0x82fa('0x47')](_0x474061['remoteUri']);if(_0x2f1d55&&_0x2f1d55['monitor_format']){logger['info'](_0x82fa('0x48'),_0x82fa('0x49'));_0x393a8d[_0x82fa('0x4a')]=util[_0x82fa('0x1d')](_0x82fa('0x4b'),_0x474061[_0x82fa('0x4c')],_0x393a8d[_0x82fa('0x4d')],md5(_0x393a8d[_0x82fa('0x4d')]));}else{_0x393a8d[_0x82fa('0x4a')]='';}return getConnection(_0x474061)[_0x82fa('0x23')](function(_0x2ce245){_0x350890=_0x2ce245;return getUser(_0x474061,_0x12fbb2[_0x82fa('0x4e')],_0x350890);})[_0x82fa('0x23')](function(_0x1ca1fc){_0x26ac50=_0x1ca1fc;logger['info']('The\x20User\x20ID\x20is:',_0x26ac50['id']);return getEndUser(_0x474061,_0x393a8d[_0x82fa('0x4f')],_0x393a8d[_0x82fa('0x50')],_0x350890);})['then'](function(_0x5d2d7b){_0x69c128=_0x5d2d7b;logger[_0x82fa('0x16')](_0x82fa('0x51'),_0x69c128['id']);return createTicket(_0x474061,_0x26ac50,_0x69c128,_0x584d48,_0x393a8d,_0x584d48['Fields'],_0x350890);})[_0x82fa('0x23')](function(_0x545063){_0xb8ad9=_0x545063;logger[_0x82fa('0x16')](_0x82fa('0x52'));logger[_0x82fa('0x16')](_0x82fa('0x53'),_0xb8ad9['id']);var _0x453268=util[_0x82fa('0x1d')](_0x82fa('0x54'),_0x474061[_0x82fa('0x1f')],_['split'](_0xb8ad9['id'],'x')[0x1]);logger[_0x82fa('0x16')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x82fa('0x1d')](_0x82fa('0x55'),_0x12fbb2[_0x82fa('0x14')]),_0x82fa('0x56'),{'uri':_0x453268});})[_0x82fa('0x29')](function(_0x213619){logger[_0x82fa('0x28')]('[QUEUE]',JSON['stringify'](_0x213619));});};exports['outbound']=function(_0x4c4fcd,_0x1b7000,_0x311f95,_0x2be6fb,_0x26a167,_0x5ed902,_0x253f0e){var _0x52af3a,_0x189c4c,_0x3a3c82,_0x514d87;_0x5ed902[_0x82fa('0x1f')]=intUtil[_0x82fa('0x47')](_0x5ed902[_0x82fa('0x1f')]);_0x5ed902['serverUrl']=intUtil[_0x82fa('0x47')](_0x5ed902[_0x82fa('0x4c')]);if(_0x253f0e&&_0x253f0e['recordingFormat']&&_0x253f0e[_0x82fa('0x57')]!==_0x82fa('0x58')){logger[_0x82fa('0x16')](_0x82fa('0x59'),'Recording\x20is\x20enabled!');_0x1b7000[_0x82fa('0x4a')]=util[_0x82fa('0x1d')](_0x82fa('0x4b'),_0x5ed902[_0x82fa('0x4c')],_0x1b7000[_0x82fa('0x4d')],md5(_0x1b7000[_0x82fa('0x4d')]));}return getConnection(_0x5ed902)[_0x82fa('0x23')](function(_0x234be8){_0x514d87=_0x234be8;return getUser(_0x5ed902,_0x2be6fb['email'],_0x514d87);})[_0x82fa('0x23')](function(_0x538e8a){_0x52af3a=_0x538e8a;logger['info'](_0x82fa('0x5a'),_0x52af3a['id']);return getEndUser(_0x5ed902,_0x1b7000['destcalleridname'],_0x1b7000[_0x82fa('0x5b')],_0x514d87);})['then'](function(_0xad1034){_0x189c4c=_0xad1034;logger[_0x82fa('0x16')](_0x82fa('0x51'),_0x189c4c['id']);return createTicket(_0x5ed902,_0x52af3a,_0x189c4c,_0x311f95,_0x1b7000,_0x311f95['Fields'],_0x514d87);})[_0x82fa('0x23')](function(_0xa0d9d8){_0x3a3c82=_0xa0d9d8;logger[_0x82fa('0x16')](_0x82fa('0x52'));logger[_0x82fa('0x16')](_0x82fa('0x53'),_0x3a3c82['id']);var _0x4cb7da=util[_0x82fa('0x1d')](_0x82fa('0x54'),_0x5ed902[_0x82fa('0x1f')],_[_0x82fa('0x5c')](_0x3a3c82['id'],'x')[0x1]);logger[_0x82fa('0x16')](_0x82fa('0x59'),_0x82fa('0x5d'));emit(util[_0x82fa('0x1d')]('user:%s',_0x2be6fb[_0x82fa('0x14')]),_0x82fa('0x56'),{'uri':_0x4cb7da});})[_0x82fa('0x29')](function(_0x3b42a3){logger[_0x82fa('0x28')]('[OUTBOUND]',JSON[_0x82fa('0x2d')](_0x3b42a3));});};exports[_0x82fa('0x5e')]=function(_0xc5407d,_0x3460b9,_0x5d77b9,_0x3f941a,_0x135eee,_0x499a94){var _0x3faaf0,_0x18c6d3,_0x16e275,_0x77c8c1;_0x499a94['remoteUri']=intUtil[_0x82fa('0x47')](_0x499a94[_0x82fa('0x1f')]);_0x499a94[_0x82fa('0x4c')]=intUtil['stripTrailingSlash'](_0x499a94['serverUrl']);if(_0x135eee&&_0x135eee['monitor_format']){logger[_0x82fa('0x16')]('['+_0x3460b9[_0x82fa('0x5f')][_0x82fa('0x60')]()+']',_0x82fa('0x49'));_0x3460b9[_0x82fa('0x4a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x499a94['serverUrl'],_0x3460b9[_0x82fa('0x4d')],md5(_0x3460b9[_0x82fa('0x4d')]));}else{_0x3460b9[_0x82fa('0x4a')]='';}return getConnection(_0x499a94)[_0x82fa('0x23')](function(_0x46994c){_0x77c8c1=_0x46994c;return getUser(_0x499a94,'',_0x77c8c1);})[_0x82fa('0x23')](function(_0x4db2eb){_0x3faaf0=_0x4db2eb;logger[_0x82fa('0x16')](_0x82fa('0x5a'),_0x3faaf0['id']);return getEndUser(_0x499a94,_0x3460b9['calleridname'],_0x3460b9[_0x82fa('0x50')],_0x77c8c1);})[_0x82fa('0x23')](function(_0x5e7213){_0x18c6d3=_0x5e7213;logger['info']('The\x20Enduser\x20ID\x20is:',_0x18c6d3['id']);return createTicket(_0x499a94,_0x3faaf0,_0x18c6d3,_0x5d77b9,_0x3460b9,_0x5d77b9['Fields'],_0x77c8c1);})[_0x82fa('0x23')](function(_0x55359f){_0x16e275=_0x55359f;logger['info']('Ticket\x20created!');logger[_0x82fa('0x16')]('The\x20Ticket\x20ID\x20is:',_0x16e275['id']);})['catch'](function(_0x24c4a6){logger[_0x82fa('0x28')]('['+_0x3460b9[_0x82fa('0x5f')][_0x82fa('0x60')]()+']',JSON[_0x82fa('0x2d')](_0x24c4a6));});}; \ No newline at end of file +var _0x3999=['query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','error','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;','success','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','GET','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','split','unmanaged','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lodash','request-promise','bluebird','md5','util','ioredis','../../../../config/environment','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','idField','toString','variableName','name','Variable','toLowerCase','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','create','sessionName','HelpDesk','stringify','then','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','info','Getting\x20agent\x20with\x20email'];(function(_0x1aab71,_0x1f6360){var _0x3018e2=function(_0x2003bd){while(--_0x2003bd){_0x1aab71['push'](_0x1aab71['shift']());}};_0x3018e2(++_0x1f6360);}(_0x3999,0x109));var _0x9399=function(_0x2105fc,_0x161754){_0x2105fc=_0x2105fc-0x0;var _0x2e1971=_0x3999[_0x2105fc];return _0x2e1971;};'use strict';var _=require(_0x9399('0x0'));var rp=require(_0x9399('0x1'));var BPromise=require(_0x9399('0x2'));var md5=require(_0x9399('0x3'));var util=require(_0x9399('0x4'));var Redis=require(_0x9399('0x5'));var intUtil=require('./util');var config=require(_0x9399('0x6'));var logger=require('../../../../config/logger')(_0x9399('0x7'));config[_0x9399('0x8')]=_[_0x9399('0x9')](config[_0x9399('0x8')],{'host':_0x9399('0xa'),'port':0x18eb});var io=require(_0x9399('0xb'))(new Redis(config['redis']));function emit(_0x100a3d,_0x30bf92,_0x11f03c){io['to'](_0x100a3d)[_0x9399('0xc')](_0x30bf92,_0x11f03c);}function getCustomFields(_0x3a3c9a,_0x49239e){var _0x594cc6={};if(_0x3a3c9a[_0x9399('0xd')]>0x0){_[_0x9399('0xe')](_0x3a3c9a,function(_0x59b20c){if(_0x59b20c[_0x9399('0xf')]==='string'&&_0x59b20c[_0x9399('0x10')]){_0x594cc6[_0x59b20c[_0x9399('0x10')]]=_0x59b20c['content'][_0x9399('0x11')]();}else if(_0x59b20c[_0x9399('0xf')]==='variable'&&_0x59b20c[_0x9399('0x12')]&&_0x59b20c[_0x9399('0x10')]&&_0x49239e[_0x59b20c[_0x9399('0x12')]]){_0x594cc6[_0x59b20c[_0x9399('0x10')]]=_0x49239e[_0x59b20c['variableName']][_0x9399('0x11')]();}else if(_0x59b20c['type']==='customVariable'&&_0x59b20c['Variable']&&_0x59b20c['Variable'][_0x9399('0x13')]&&_0x59b20c[_0x9399('0x10')]&&_0x49239e[_0x59b20c[_0x9399('0x14')]['name'][_0x9399('0x15')]()]){_0x594cc6[_0x59b20c[_0x9399('0x10')]]=_0x49239e[_0x59b20c['Variable'][_0x9399('0x13')][_0x9399('0x15')]()]['toString']();}});}return _0x594cc6;}function createTicket(_0x4ee48f,_0x488bd0,_0x1187a1,_0x68226d,_0x8d687b,_0x4fb0f9,_0x29a042){logger['info'](_0x9399('0x16'));var _0x46ebcf=_[_0x9399('0x17')]({'parent_id':'','assigned_user_id':_0x488bd0['id'],'ticketpriorities':_0x9399('0x18'),'ticketstatus':_0x9399('0x19'),'ticket_title':intUtil[_0x9399('0x1a')](_0x68226d[_0x9399('0x1b')],_0x8d687b,'\x20'),'description':intUtil[_0x9399('0x1a')](_0x68226d[_0x9399('0x1c')],_0x8d687b,'\x0a'),'contact_id':_0x1187a1['id']},getCustomFields(_0x4fb0f9,_0x8d687b));var _0xf2dd1b={'method':_0x9399('0x1d'),'uri':util[_0x9399('0x1e')](_0x9399('0x1f'),_0x4ee48f[_0x9399('0x20')]),'form':{'operation':_0x9399('0x21'),'username':_0x4ee48f['username'],'sessionName':_0x29a042[_0x9399('0x22')],'elementType':_0x9399('0x23'),'element':JSON[_0x9399('0x24')](_0x46ebcf)},'json':!![]};return request(_0xf2dd1b)[_0x9399('0x25')](function(_0x5cd9fc){if(_0x5cd9fc['success']){return BPromise[_0x9399('0x26')]({'id':_0x5cd9fc[_0x9399('0x27')]['id']});}else{throw new Error(util[_0x9399('0x1e')](_0x9399('0x28'),JSON[_0x9399('0x24')](_0x5cd9fc['error'])));}})[_0x9399('0x29')](function(_0x28406c){var _0x15f2d1=_0x28406c[_0x9399('0x2a')]||0x1f4;logger['error'](_0x9399('0x2b'),'createTicket',_0x15f2d1,JSON['stringify'](_0x28406c));});}function getUser(_0x1290fe,_0x2fcc15,_0x42b468){if(intUtil[_0x9399('0x2c')](_0x2fcc15)){logger[_0x9399('0x2d')](_0x9399('0x2e'),_0x2fcc15);return request({'method':'GET','uri':util['format'](_0x9399('0x1f'),_0x1290fe[_0x9399('0x20')]),'qs':{'operation':_0x9399('0x2f'),'username':_0x1290fe[_0x9399('0x30')],'sessionName':_0x42b468[_0x9399('0x22')],'query':util[_0x9399('0x1e')](_0x9399('0x31'),_0x2fcc15)},'json':!![]})['then'](function(_0x5927dc){if(_0x5927dc['success']&&_0x5927dc[_0x9399('0x27')][_0x9399('0xd')]){logger[_0x9399('0x2d')](_0x9399('0x32'));return BPromise[_0x9399('0x26')]({'id':_0x5927dc[_0x9399('0x27')][0x0]['id'],'email':_0x5927dc[_0x9399('0x27')][0x0]['email1'],'name':_0x5927dc['result'][0x0][_0x9399('0x33')]+'\x20'+_0x5927dc[_0x9399('0x27')][_0x9399('0x34')]});}else{logger[_0x9399('0x2d')](_0x9399('0x35'));return BPromise['resolve']({'id':_0x42b468[_0x9399('0x36')],'email':_0x1290fe[_0x9399('0x30')],'name':_0x9399('0x37')});}})[_0x9399('0x29')](function(_0x3d9dc9){var _0x5f1b91=_0x3d9dc9[_0x9399('0x2a')]||0x1f4;logger['error'](_0x9399('0x2b'),_0x9399('0x38'),_0x5f1b91,JSON['stringify'](_0x3d9dc9));});}else{logger[_0x9399('0x2d')](_0x9399('0x35'));return BPromise[_0x9399('0x26')]({'id':_0x42b468[_0x9399('0x36')],'email':_0x1290fe[_0x9399('0x30')],'name':_0x9399('0x37')})[_0x9399('0x29')](function(_0x5e1861){var _0xce2341=_0x5e1861['statusCode']||0x1f4;logger[_0x9399('0x39')](_0x9399('0x2b'),'getUser',_0xce2341,JSON[_0x9399('0x24')](_0x5e1861));});}}function getEndUser(_0x1b174f,_0x20c312,_0x2d1668,_0x3638ce){logger[_0x9399('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x2d1668);return request({'method':'GET','uri':util[_0x9399('0x1e')]('%s/webservice.php',_0x1b174f[_0x9399('0x20')]),'qs':{'operation':_0x9399('0x2f'),'username':_0x1b174f[_0x9399('0x30')],'sessionName':_0x3638ce[_0x9399('0x22')],'query':util[_0x9399('0x1e')](_0x9399('0x3a'),_0x2d1668,_0x2d1668,_0x2d1668,_0x2d1668,_0x2d1668)},'json':!![]})[_0x9399('0x25')](function(_0x4cd012){if(_0x4cd012[_0x9399('0x3b')]&&_0x4cd012[_0x9399('0x27')][_0x9399('0xd')]){logger[_0x9399('0x2d')]('Enduser\x20found!');return BPromise[_0x9399('0x26')]({'id':_0x4cd012['result'][0x0]['id'],'name':_0x4cd012[_0x9399('0x27')][0x0][_0x9399('0x3c')]+'\x20'+_0x4cd012[_0x9399('0x27')][0x0][_0x9399('0x3d')],'phone':_0x2d1668});}else{logger['info'](_0x9399('0x3e'));return request({'method':'POST','uri':util[_0x9399('0x1e')](_0x9399('0x1f'),_0x1b174f['remoteUri']),'form':{'operation':_0x9399('0x21'),'sessionName':_0x3638ce[_0x9399('0x22')],'elementType':_0x9399('0x3f'),'element':JSON[_0x9399('0x24')]({'lastname':_0x20c312,'phone':_0x2d1668,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x5e2338){logger[_0x9399('0x2d')](_0x9399('0x40'));return BPromise[_0x9399('0x26')]({'id':_0x5e2338[_0x9399('0x27')]['id'],'name':_0x5e2338[_0x9399('0x27')][_0x9399('0x3d')],'phone':_0x5e2338['result'][_0x9399('0x41')]});})[_0x9399('0x29')](function(_0x468e32){var _0x475bf7=_0x468e32[_0x9399('0x2a')]||0x1f4;logger['error'](_0x9399('0x2b'),_0x9399('0x42'),_0x475bf7,JSON[_0x9399('0x24')](_0x468e32));});}});}function getConnection(_0x3a2496){var _0x361b10=_0x3a2496['username'];var _0xb60e73=_0x3a2496[_0x9399('0x43')];return request({'method':_0x9399('0x44'),'uri':util[_0x9399('0x1e')](_0x9399('0x1f'),_0x3a2496[_0x9399('0x20')]),'qs':{'operation':_0x9399('0x45'),'username':_0x361b10},'json':!![]})[_0x9399('0x25')](function(_0x4f14e6){if(_0x4f14e6[_0x9399('0x3b')]){return request({'method':'POST','uri':util['format'](_0x9399('0x1f'),_0x3a2496['remoteUri']),'form':{'operation':_0x9399('0x46'),'username':_0x361b10,'accessKey':md5(_0x4f14e6[_0x9399('0x27')][_0x9399('0x47')]+_0xb60e73)},'json':!![]});}})[_0x9399('0x25')](function(_0x30ad56){if(_0x30ad56['success']){return BPromise['resolve'](_0x30ad56[_0x9399('0x27')]);}else{throw new Error(util[_0x9399('0x1e')](_0x9399('0x48'),_0x3a2496['id']));}})[_0x9399('0x29')](function(_0x4acd77){var _0x5764dd=_0x4acd77[_0x9399('0x2a')]||0x1f4;logger[_0x9399('0x39')](_0x9399('0x2b'),_0x9399('0x49'),_0x5764dd,JSON[_0x9399('0x24')](_0x4acd77));});}function request(_0x6073d0){logger['info']('[HTTP]',JSON[_0x9399('0x24')](_0x6073d0));return rp(_0x6073d0);}exports[_0x9399('0x4a')]=function(_0x55f3d9,_0x141c0e,_0x3c2605,_0x184d15,_0x16e450,_0x2b044c){var _0xe5faae,_0x2eb190,_0x2d12a6,_0x5d352c;_0x2b044c[_0x9399('0x20')]=intUtil['stripTrailingSlash'](_0x2b044c[_0x9399('0x20')]);if(_0x16e450&&_0x16e450['monitor_format']){logger[_0x9399('0x2d')](_0x9399('0x4b'),_0x9399('0x4c'));_0x141c0e[_0x9399('0x4d')]=util[_0x9399('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b044c['serverUrl'],_0x141c0e['uniqueid'],md5(_0x141c0e[_0x9399('0x4e')]));}else{_0x141c0e[_0x9399('0x4d')]='';}return getConnection(_0x2b044c)[_0x9399('0x25')](function(_0x3a4bb0){_0x5d352c=_0x3a4bb0;return getUser(_0x2b044c,_0x184d15[_0x9399('0x4f')],_0x5d352c);})['then'](function(_0x475441){_0xe5faae=_0x475441;logger[_0x9399('0x2d')](_0x9399('0x50'),_0xe5faae['id']);return getEndUser(_0x2b044c,_0x141c0e[_0x9399('0x51')],_0x141c0e['calleridnum'],_0x5d352c);})[_0x9399('0x25')](function(_0x272054){_0x2eb190=_0x272054;logger['info'](_0x9399('0x52'),_0x2eb190['id']);return createTicket(_0x2b044c,_0xe5faae,_0x2eb190,_0x3c2605,_0x141c0e,_0x3c2605[_0x9399('0x53')],_0x5d352c);})[_0x9399('0x25')](function(_0x3ab33c){_0x2d12a6=_0x3ab33c;logger[_0x9399('0x2d')](_0x9399('0x54'));logger[_0x9399('0x2d')](_0x9399('0x55'),_0x2d12a6['id']);var _0x5dda2f=util[_0x9399('0x1e')](_0x9399('0x56'),_0x2b044c[_0x9399('0x20')],_['split'](_0x2d12a6['id'],'x')[0x1]);logger['info'](_0x9399('0x4b'),_0x9399('0x57'));emit(util[_0x9399('0x1e')](_0x9399('0x58'),_0x184d15[_0x9399('0x13')]),_0x9399('0x59'),{'uri':_0x5dda2f});})[_0x9399('0x29')](function(_0x2df132){logger[_0x9399('0x39')](_0x9399('0x4b'),JSON[_0x9399('0x24')](_0x2df132));});};exports['outbound']=function(_0x1b7db8,_0x51564f,_0x3175f6,_0xc30cea,_0x4e7a94,_0xec811e,_0x35676d){var _0x4e8b97,_0x333eeb,_0x497e83,_0x265db7;_0xec811e['remoteUri']=intUtil[_0x9399('0x5a')](_0xec811e[_0x9399('0x20')]);_0xec811e['serverUrl']=intUtil[_0x9399('0x5a')](_0xec811e[_0x9399('0x5b')]);if(_0x35676d&&_0x35676d[_0x9399('0x5c')]&&_0x35676d[_0x9399('0x5c')]!==_0x9399('0x5d')){logger[_0x9399('0x2d')](_0x9399('0x5e'),'Recording\x20is\x20enabled!');_0x51564f[_0x9399('0x4d')]=util[_0x9399('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xec811e[_0x9399('0x5b')],_0x51564f[_0x9399('0x4e')],md5(_0x51564f[_0x9399('0x4e')]));}return getConnection(_0xec811e)[_0x9399('0x25')](function(_0x3dd204){_0x265db7=_0x3dd204;return getUser(_0xec811e,_0xc30cea[_0x9399('0x4f')],_0x265db7);})[_0x9399('0x25')](function(_0x41beb3){_0x4e8b97=_0x41beb3;logger[_0x9399('0x2d')](_0x9399('0x50'),_0x4e8b97['id']);return getEndUser(_0xec811e,_0x51564f[_0x9399('0x5f')],_0x51564f[_0x9399('0x60')],_0x265db7);})['then'](function(_0x2735a2){_0x333eeb=_0x2735a2;logger['info'](_0x9399('0x52'),_0x333eeb['id']);return createTicket(_0xec811e,_0x4e8b97,_0x333eeb,_0x3175f6,_0x51564f,_0x3175f6[_0x9399('0x53')],_0x265db7);})[_0x9399('0x25')](function(_0x531d39){_0x497e83=_0x531d39;logger['info']('Ticket\x20created!');logger[_0x9399('0x2d')](_0x9399('0x55'),_0x497e83['id']);var _0x452e24=util['format'](_0x9399('0x56'),_0xec811e[_0x9399('0x20')],_[_0x9399('0x61')](_0x497e83['id'],'x')[0x1]);logger[_0x9399('0x2d')](_0x9399('0x5e'),_0x9399('0x57'));emit(util[_0x9399('0x1e')]('user:%s',_0xc30cea[_0x9399('0x13')]),_0x9399('0x59'),{'uri':_0x452e24});})[_0x9399('0x29')](function(_0x2a62c2){logger[_0x9399('0x39')](_0x9399('0x5e'),JSON['stringify'](_0x2a62c2));});};exports[_0x9399('0x62')]=function(_0x32b6f8,_0x9ae64c,_0x2ac1a0,_0xa70b93,_0x598c8c,_0x2c1316){var _0x3a2b27,_0x37f455,_0x3e6bcf,_0x463ec7;_0x2c1316[_0x9399('0x20')]=intUtil['stripTrailingSlash'](_0x2c1316[_0x9399('0x20')]);_0x2c1316['serverUrl']=intUtil[_0x9399('0x5a')](_0x2c1316[_0x9399('0x5b')]);if(_0x598c8c&&_0x598c8c[_0x9399('0x63')]){logger[_0x9399('0x2d')]('['+_0x9ae64c[_0x9399('0x64')][_0x9399('0x65')]()+']',_0x9399('0x4c'));_0x9ae64c[_0x9399('0x4d')]=util[_0x9399('0x1e')](_0x9399('0x66'),_0x2c1316[_0x9399('0x5b')],_0x9ae64c['uniqueid'],md5(_0x9ae64c[_0x9399('0x4e')]));}else{_0x9ae64c['recordingURL']='';}return getConnection(_0x2c1316)[_0x9399('0x25')](function(_0xf7caf7){_0x463ec7=_0xf7caf7;return getUser(_0x2c1316,'',_0x463ec7);})['then'](function(_0x56d4ee){_0x3a2b27=_0x56d4ee;logger[_0x9399('0x2d')](_0x9399('0x50'),_0x3a2b27['id']);return getEndUser(_0x2c1316,_0x9ae64c[_0x9399('0x51')],_0x9ae64c[_0x9399('0x67')],_0x463ec7);})['then'](function(_0x26aa35){_0x37f455=_0x26aa35;logger[_0x9399('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x37f455['id']);return createTicket(_0x2c1316,_0x3a2b27,_0x37f455,_0x2ac1a0,_0x9ae64c,_0x2ac1a0[_0x9399('0x53')],_0x463ec7);})['then'](function(_0x5851e0){_0x3e6bcf=_0x5851e0;logger[_0x9399('0x2d')](_0x9399('0x54'));logger['info'](_0x9399('0x55'),_0x3e6bcf['id']);})[_0x9399('0x29')](function(_0x12e504){logger[_0x9399('0x39')]('['+_0x9ae64c[_0x9399('0x64')][_0x9399('0x65')]()+']',JSON[_0x9399('0x24')](_0x12e504));});}; \ 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 933ba65..c81ac04 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 _0x4ded=['%s/token:%s','toString','base64','[HTTP]','stringify','GET','forEach','type','nameField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','customField','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','email','destcalleridname','destcalleridnum','[OUTBOUND]','%s/channels/voice/agents/%d/tickets/%d/display.json','inspect','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token'];(function(_0x571553,_0x492e57){var _0x3198cf=function(_0x415a36){while(--_0x415a36){_0x571553['push'](_0x571553['shift']());}};_0x3198cf(++_0x492e57);}(_0x4ded,0x116));var _0xd4de=function(_0xe29eb,_0x49c9ef){_0xe29eb=_0xe29eb-0x0;var _0x1e211e=_0x4ded[_0xe29eb];return _0x1e211e;};'use strict';var _=require(_0xd4de('0x0'));var rp=require(_0xd4de('0x1'));var md5=require(_0xd4de('0x2'));var util=require(_0xd4de('0x3'));var Redis=require(_0xd4de('0x4'));var intUtil=require(_0xd4de('0x5'));var config=require(_0xd4de('0x6'));var logger=require(_0xd4de('0x7'))(_0xd4de('0x8'));config[_0xd4de('0x9')]=_[_0xd4de('0xa')](config[_0xd4de('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xd4de('0xb'))(new Redis(config[_0xd4de('0x9')]));function emit(_0x15eb91,_0x2c56d5,_0x4453c2){io['to'](_0x15eb91)[_0xd4de('0xc')](_0x2c56d5,_0x4453c2);}var headers={'Content-Type':'application/json','Accept':_0xd4de('0xd')};function getTicket(_0x5ebcf3,_0x4ab822,_0x4b0876,_0x176b31,_0x459a46){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0xd4de('0xe'),_0x5ebcf3['remoteUri']),'method':_0xd4de('0xf'),'body':{'ticket':_[_0xd4de('0x10')]({'requester_id':_0x4b0876['id'],'submitter_id':_0x4ab822?_0x4ab822['id']:undefined,'assignee_id':_0x4ab822?_0x4ab822['id']:undefined,'tags':getTags(_0x176b31[_0xd4de('0x11')],_0xd4de('0x12')),'subject':intUtil[_0xd4de('0x13')](_0x176b31[_0xd4de('0x14')],_0x459a46,'\x20'),'description':intUtil[_0xd4de('0x13')](_0x176b31[_0xd4de('0x15')],_0x459a46,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd4de('0x13')](_0x176b31[_0xd4de('0x15')],_0x459a46,'\x0a')}},getCustomFields(_0x176b31[_0xd4de('0x16')],_0x459a46))}})[_0xd4de('0x17')](function(_0x164ca0){logger[_0xd4de('0x18')](_0xd4de('0x19'));return _0x164ca0[_0xd4de('0x1a')];});}function getUser(_0x325fba,_0x4b0a95){if(intUtil['validateEmail'](_0x4b0a95)){logger[_0xd4de('0x18')](_0xd4de('0x1b'),_0x4b0a95);return request({'uri':util[_0xd4de('0x1c')](_0xd4de('0x1d'),_0x325fba['remoteUri']),'qs':{'query':util['format'](_0xd4de('0x1e'),_0x4b0a95)}})['then'](function(_0xeaaefa){if(_0xeaaefa[_0xd4de('0x1f')]){logger['info'](_0xd4de('0x20'));return _['find'](_0xeaaefa[_0xd4de('0x21')],{'email':_0x4b0a95,'role':_0xd4de('0x22')});}else{logger[_0xd4de('0x18')](_0xd4de('0x23'));return request({'uri':util['format'](_0xd4de('0x24'),_0x325fba[_0xd4de('0x25')])})[_0xd4de('0x17')](function(_0xdb3fc){logger[_0xd4de('0x18')](_0xd4de('0x26'));return _0xdb3fc[_0xd4de('0x27')];});}});}else{logger[_0xd4de('0x18')](_0xd4de('0x23'));return request({'uri':util[_0xd4de('0x1c')]('%s/users/me.json',_0x325fba[_0xd4de('0x25')])})[_0xd4de('0x17')](function(_0x221f26){logger[_0xd4de('0x18')](_0xd4de('0x26'));return _0x221f26[_0xd4de('0x27')];});}}function getEndUser(_0xffe1cc,_0x36308c,_0x2aa82a){logger[_0xd4de('0x18')](_0xd4de('0x28'),_0x2aa82a);return request({'uri':util[_0xd4de('0x1c')]('%s/search.json',_0xffe1cc[_0xd4de('0x25')]),'qs':{'query':util[_0xd4de('0x1c')]('type:user\x20role:end-user\x20phone:%s',_0x2aa82a)}})[_0xd4de('0x17')](function(_0x59b3c5){var _0x44b710;if(_0x59b3c5[_0xd4de('0x21')][_0xd4de('0x29')]){_0x59b3c5['results']=_[_0xd4de('0x2a')](_0x59b3c5[_0xd4de('0x21')],{'suspended':![],'role':_0xd4de('0x2b')});if(_0x59b3c5['results'][_0xd4de('0x29')]){_0x44b710=_[_0xd4de('0x2c')](_0x59b3c5['results']);}}if(_0x44b710){logger['info']('Enduser\x20found!');return _0x44b710;}else{logger[_0xd4de('0x18')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xd4de('0x1c')](_0xd4de('0x2d'),_0xffe1cc[_0xd4de('0x25')]),'method':_0xd4de('0xf'),'body':{'user':{'role':'end-user','name':util[_0xd4de('0x1c')](_0xd4de('0x2e'),_0x36308c||_0x2aa82a),'phone':_0x2aa82a}}})['then'](function(_0x133a43){logger[_0xd4de('0x18')]('Enduser\x20created.');return _0x133a43['user'];});}});}function getAuth(_0x16e7a9){var _0x40114b;if(_0x16e7a9[_0xd4de('0x2f')]===_0xd4de('0x30')){_0x40114b=util['format'](_0xd4de('0x31'),_0x16e7a9[_0xd4de('0x32')],_0x16e7a9['password']);}else if(_0x16e7a9[_0xd4de('0x2f')]===_0xd4de('0x33')){_0x40114b=util[_0xd4de('0x1c')](_0xd4de('0x34'),_0x16e7a9[_0xd4de('0x32')],_0x16e7a9[_0xd4de('0x33')]);}return util['format']('Basic\x20%s',new Buffer(_0x40114b)[_0xd4de('0x35')](_0xd4de('0x36')));}function request(_0x400450){logger['debug'](_0xd4de('0x37'),JSON[_0xd4de('0x38')](_0x400450));return rp(_['defaults'](_0x400450,{'method':_0xd4de('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x4724bd,_0x4626c7){var _0x1f60e8=[];if(_0x4724bd&&_0x4724bd['length']>0x0){_0x1f60e8=_['map'](_0x4724bd,_0x4626c7);}return _0x1f60e8;}function getCustomFields(_0x421efb,_0x541777){var _0x3e5e34=[];var _0x4de12c={'custom_fields':[]};if(_0x421efb[_0xd4de('0x29')]>0x0){_[_0xd4de('0x3a')](_0x421efb,function(_0x21cd77){if(_0x21cd77[_0xd4de('0x3b')]==='string'&&_0x21cd77[_0xd4de('0x3c')]&&!_0x21cd77['customField']){_0x4de12c[_0x21cd77[_0xd4de('0x3c')][_0xd4de('0x3d')]()]=_0x21cd77[_0xd4de('0x3e')][_0xd4de('0x35')]();}else if(_0x21cd77[_0xd4de('0x3b')]===_0xd4de('0x3f')&&_0x21cd77[_0xd4de('0x40')]&&_0x21cd77['customField']){_0x4de12c[_0xd4de('0x41')][_0xd4de('0x42')]({'id':_0x21cd77[_0xd4de('0x40')],'value':_0x21cd77[_0xd4de('0x3e')][_0xd4de('0x35')]()});}else if(_0x21cd77['type']===_0xd4de('0x43')&&_0x21cd77[_0xd4de('0x44')]&&_0x21cd77[_0xd4de('0x40')]&&_0x21cd77['customField']){_0x541777[_0x21cd77[_0xd4de('0x44')]]&&_0x4de12c[_0xd4de('0x41')][_0xd4de('0x42')]({'id':_0x21cd77['idField'],'value':_0x541777[_0x21cd77[_0xd4de('0x44')]][_0xd4de('0x35')]()});}else if(_0x21cd77[_0xd4de('0x3b')]===_0xd4de('0x45')&&_0x21cd77[_0xd4de('0x46')]&&_0x21cd77[_0xd4de('0x46')][_0xd4de('0x12')]&&_0x21cd77['idField']&&_0x21cd77[_0xd4de('0x47')]){_0x541777[_0x21cd77[_0xd4de('0x46')][_0xd4de('0x12')]['toLowerCase']()]&&_0x4de12c[_0xd4de('0x41')][_0xd4de('0x42')]({'id':_0x21cd77[_0xd4de('0x40')],'value':_0x541777[_0x21cd77['Variable']['name'][_0xd4de('0x3d')]()][_0xd4de('0x35')]()});}});}return _0x4de12c;}exports['queue']=function(_0x1ee047,_0x1f477b,_0x3a3c63,_0x13b317,_0x564a96,_0x27afac){var _0x72d025,_0x579700;_0x27afac[_0xd4de('0x25')]=intUtil[_0xd4de('0x48')](_0x27afac[_0xd4de('0x25')]);_0x27afac['serverUrl']=intUtil[_0xd4de('0x48')](_0x27afac[_0xd4de('0x49')]);if(_0x564a96&&_0x564a96[_0xd4de('0x4a')]){logger[_0xd4de('0x18')](_0xd4de('0x4b'),_0xd4de('0x4c'));_0x1f477b[_0xd4de('0x4d')]=util[_0xd4de('0x1c')](_0xd4de('0x4e'),_0x27afac[_0xd4de('0x49')],_0x1f477b['uniqueid'],md5(_0x1f477b[_0xd4de('0x4f')]));}else{_0x1f477b[_0xd4de('0x4d')]='';}headers[_0xd4de('0x50')]=getAuth(_0x27afac);return getUser(_0x27afac,_0x13b317['email'])[_0xd4de('0x17')](function(_0x199204){_0x72d025=_0x199204;logger[_0xd4de('0x18')](_0xd4de('0x51'),_0x72d025['id']);return getEndUser(_0x27afac,_0x1f477b[_0xd4de('0x52')],_0x1f477b[_0xd4de('0x53')]);})[_0xd4de('0x17')](function(_0x29cb16){_0x579700=_0x29cb16;logger[_0xd4de('0x18')](_0xd4de('0x54'),_0x579700['id']);return getTicket(_0x27afac,_0x72d025,_0x579700,_0x3a3c63,_0x1f477b);})['then'](function(_0x3e4c7f){if(_0x3e4c7f){logger[_0xd4de('0x18')](_0xd4de('0x55'),_0x3e4c7f['id']);switch(_0x27afac[_0xd4de('0x3b')]){case _0xd4de('0x56'):logger['info']('[QUEUE]',_0xd4de('0x57'));return request({'uri':util[_0xd4de('0x1c')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x27afac['remoteUri'],_0x72d025['id'],_0x3e4c7f['id']),'method':_0xd4de('0xf')});case _0xd4de('0x58'):logger[_0xd4de('0x18')](_0xd4de('0x4b'),_0xd4de('0x59'));emit(util[_0xd4de('0x1c')](_0xd4de('0x5a'),_0x13b317[_0xd4de('0x12')]),_0xd4de('0x5b'),{'uri':util[_0xd4de('0x1c')](_0xd4de('0x5c'),_0x27afac[_0xd4de('0x25')],_0x3e4c7f['id'])});break;default:logger['error'](_0xd4de('0x4b'),_0xd4de('0x5d'));}}})[_0xd4de('0x5e')](function(_0x1da822){logger[_0xd4de('0x5f')](_0xd4de('0x60'),util['inspect'](_0x1da822,{'showHidden':!![],'depth':null}));});};exports[_0xd4de('0x61')]=function(_0x5896c5,_0x48fe2a,_0xa0242e,_0xd79781,_0x2d1e45,_0x1fe52b,_0x4e533c){var _0xfc79e7,_0x3d62c2;_0x1fe52b[_0xd4de('0x25')]=intUtil[_0xd4de('0x48')](_0x1fe52b[_0xd4de('0x25')]);_0x1fe52b['serverUrl']=intUtil['stripTrailingSlash'](_0x1fe52b['serverUrl']);if(_0x4e533c&&_0x4e533c[_0xd4de('0x62')]&&_0x4e533c[_0xd4de('0x62')]!==_0xd4de('0x63')){logger[_0xd4de('0x18')]('[OUTBOUND]',_0xd4de('0x4c'));_0x48fe2a[_0xd4de('0x4d')]=util[_0xd4de('0x1c')](_0xd4de('0x4e'),_0x1fe52b['serverUrl'],_0x48fe2a[_0xd4de('0x4f')],md5(_0x48fe2a[_0xd4de('0x4f')]));}headers[_0xd4de('0x50')]=getAuth(_0x1fe52b);return getUser(_0x1fe52b,_0xd79781[_0xd4de('0x64')])['then'](function(_0x4fd7c2){_0xfc79e7=_0x4fd7c2;logger['info'](_0xd4de('0x51'),_0xfc79e7['id']);return getEndUser(_0x1fe52b,_0x48fe2a[_0xd4de('0x65')],_0x48fe2a[_0xd4de('0x66')]);})['then'](function(_0x18f2c3){_0x3d62c2=_0x18f2c3;logger[_0xd4de('0x18')](_0xd4de('0x54'),_0x3d62c2['id']);return getTicket(_0x1fe52b,_0xfc79e7,_0x3d62c2,_0xa0242e,_0x48fe2a);})['then'](function(_0x1758b3){if(_0x1758b3){logger['info'](_0xd4de('0x55'),_0x1758b3['id']);switch(_0x1fe52b[_0xd4de('0x3b')]){case _0xd4de('0x56'):logger[_0xd4de('0x18')](_0xd4de('0x67'),_0xd4de('0x57'));return request({'uri':util[_0xd4de('0x1c')](_0xd4de('0x68'),_0x1fe52b['remoteUri'],_0xfc79e7['id'],_0x1758b3['id']),'method':_0xd4de('0xf')});case'newTab':logger[_0xd4de('0x18')](_0xd4de('0x67'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd4de('0x1c')](_0xd4de('0x5a'),_0xd79781[_0xd4de('0x12')]),_0xd4de('0x5b'),{'uri':util[_0xd4de('0x1c')](_0xd4de('0x5c'),_0x1fe52b[_0xd4de('0x25')],_0x1758b3['id'])});break;default:logger[_0xd4de('0x5f')](_0xd4de('0x67'),_0xd4de('0x5d'));}}})[_0xd4de('0x5e')](function(_0x37057c){logger[_0xd4de('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd4de('0x69')](_0x37057c,{'showHidden':!![],'depth':null}));});};exports[_0xd4de('0x6a')]=function(_0x216fd5,_0x331f08,_0x25628e,_0x2c9a38,_0x26bf55,_0x3fdd63){var _0x574939,_0xbe1141;_0x3fdd63['remoteUri']=intUtil['stripTrailingSlash'](_0x3fdd63['remoteUri']);_0x3fdd63[_0xd4de('0x49')]=intUtil[_0xd4de('0x48')](_0x3fdd63['serverUrl']);if(_0x26bf55&&_0x26bf55['monitor_format']){logger['info']('['+_0x331f08['lastevent'][_0xd4de('0x6b')]()+']','Recording\x20is\x20enabled!');_0x331f08[_0xd4de('0x4d')]=util['format'](_0xd4de('0x4e'),_0x3fdd63[_0xd4de('0x49')],_0x331f08['uniqueid'],md5(_0x331f08['uniqueid']));}else{_0x331f08['recordingURL']='';}headers['Authorization']=getAuth(_0x3fdd63);return getUser(_0x3fdd63)[_0xd4de('0x17')](function(_0x214e05){_0x574939=_0x214e05;logger[_0xd4de('0x18')](_0xd4de('0x51'),_0x574939['id']);return getEndUser(_0x3fdd63,_0x331f08[_0xd4de('0x52')],_0x331f08[_0xd4de('0x53')]);})['then'](function(_0x5c651b){_0xbe1141=_0x5c651b;logger['info'](_0xd4de('0x54'),_0xbe1141['id']);return getTicket(_0x3fdd63,_0x574939,_0xbe1141,_0x25628e,_0x331f08);})[_0xd4de('0x17')](function(_0x4c2343){if(_0x4c2343){logger[_0xd4de('0x18')]('The\x20Ticket\x20ID\x20is:',_0x4c2343['id']);}})[_0xd4de('0x5e')](function(_0x574973){logger[_0xd4de('0x5f')]('['+_0x331f08[_0xd4de('0x6c')]['toUpperCase']()+']'+_0xd4de('0x6d'),util['inspect'](_0x574973,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x00b3=['[HTTP]','stringify','GET','map','forEach','type','string','customField','nameField','content','idField','custom_fields','push','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridnum','[OUTBOUND]','newTab','user:%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','calleridname','\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','util','ioredis','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','application/json','info','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Caller\x20-\x20%s','user','authType','password','%s:%s','token','username','Basic\x20%s','toString','base64','debug'];(function(_0xe34971,_0x3b35e3){var _0x58694=function(_0x5c3c78){while(--_0x5c3c78){_0xe34971['push'](_0xe34971['shift']());}};_0x58694(++_0x3b35e3);}(_0x00b3,0x17a));var _0x300b=function(_0x3630bb,_0x131ccb){_0x3630bb=_0x3630bb-0x0;var _0x532530=_0x00b3[_0x3630bb];return _0x532530;};'use strict';var _=require('lodash');var rp=require(_0x300b('0x0'));var md5=require(_0x300b('0x1'));var util=require(_0x300b('0x2'));var Redis=require(_0x300b('0x3'));var intUtil=require('./util');var config=require(_0x300b('0x4'));var logger=require('../../../../config/logger')(_0x300b('0x5'));config['redis']=_[_0x300b('0x6')](config[_0x300b('0x7')],{'host':_0x300b('0x8'),'port':0x18eb});var io=require(_0x300b('0x9'))(new Redis(config['redis']));function emit(_0x5dabb9,_0x30b3fe,_0x590c4d){io['to'](_0x5dabb9)['emit'](_0x30b3fe,_0x590c4d);}var headers={'Content-Type':_0x300b('0xa'),'Accept':_0x300b('0xa')};function getTicket(_0x457aa3,_0x4d8d78,_0x42e5a5,_0x3d907e,_0x243abf){logger[_0x300b('0xb')]('Creating\x20new\x20ticket...');return request({'uri':util[_0x300b('0xc')](_0x300b('0xd'),_0x457aa3[_0x300b('0xe')]),'method':'POST','body':{'ticket':_[_0x300b('0xf')]({'requester_id':_0x42e5a5['id'],'submitter_id':_0x4d8d78?_0x4d8d78['id']:undefined,'assignee_id':_0x4d8d78?_0x4d8d78['id']:undefined,'tags':getTags(_0x3d907e[_0x300b('0x10')],_0x300b('0x11')),'subject':intUtil[_0x300b('0x12')](_0x3d907e[_0x300b('0x13')],_0x243abf,'\x20'),'description':intUtil[_0x300b('0x12')](_0x3d907e[_0x300b('0x14')],_0x243abf,'\x0a'),'comment':{'public':![],'body':intUtil[_0x300b('0x12')](_0x3d907e['Descriptions'],_0x243abf,'\x0a')}},getCustomFields(_0x3d907e['Fields'],_0x243abf))}})['then'](function(_0x4ef5bc){logger[_0x300b('0xb')](_0x300b('0x15'));return _0x4ef5bc[_0x300b('0x16')];});}function getUser(_0xd252fa,_0x51186d){if(intUtil['validateEmail'](_0x51186d)){logger[_0x300b('0xb')](_0x300b('0x17'),_0x51186d);return request({'uri':util[_0x300b('0xc')](_0x300b('0x18'),_0xd252fa['remoteUri']),'qs':{'query':util[_0x300b('0xc')](_0x300b('0x19'),_0x51186d)}})[_0x300b('0x1a')](function(_0x5cba7c){if(_0x5cba7c[_0x300b('0x1b')]){logger[_0x300b('0xb')](_0x300b('0x1c'));return _[_0x300b('0x1d')](_0x5cba7c['results'],{'email':_0x51186d,'role':_0x300b('0x1e')});}else{logger[_0x300b('0xb')](_0x300b('0x1f'));return request({'uri':util['format'](_0x300b('0x20'),_0xd252fa[_0x300b('0xe')])})[_0x300b('0x1a')](function(_0x502c5f){logger[_0x300b('0xb')]('Admin\x20account\x20selected.');return _0x502c5f['user'];});}});}else{logger[_0x300b('0xb')](_0x300b('0x1f'));return request({'uri':util[_0x300b('0xc')](_0x300b('0x20'),_0xd252fa[_0x300b('0xe')])})[_0x300b('0x1a')](function(_0x36b66b){logger[_0x300b('0xb')](_0x300b('0x21'));return _0x36b66b['user'];});}}function getEndUser(_0x3d62b1,_0x152048,_0x260bdc){logger[_0x300b('0xb')]('Searching\x20enduser\x20with\x20phone',_0x260bdc);return request({'uri':util['format']('%s/search.json',_0x3d62b1[_0x300b('0xe')]),'qs':{'query':util['format'](_0x300b('0x22'),_0x260bdc)}})[_0x300b('0x1a')](function(_0x60bb0c){var _0x30b260;if(_0x60bb0c[_0x300b('0x23')][_0x300b('0x24')]){_0x60bb0c[_0x300b('0x23')]=_[_0x300b('0x25')](_0x60bb0c[_0x300b('0x23')],{'suspended':![],'role':_0x300b('0x26')});if(_0x60bb0c['results']['length']){_0x30b260=_[_0x300b('0x27')](_0x60bb0c[_0x300b('0x23')]);}}if(_0x30b260){logger[_0x300b('0xb')](_0x300b('0x28'));return _0x30b260;}else{logger['info'](_0x300b('0x29'));return request({'uri':util['format']('%s/users.json',_0x3d62b1['remoteUri']),'method':_0x300b('0x2a'),'body':{'user':{'role':_0x300b('0x26'),'name':util['format'](_0x300b('0x2b'),_0x152048||_0x260bdc),'phone':_0x260bdc}}})[_0x300b('0x1a')](function(_0x4f3cbf){logger[_0x300b('0xb')]('Enduser\x20created.');return _0x4f3cbf[_0x300b('0x2c')];});}});}function getAuth(_0x2572c7){var _0xdad35f;if(_0x2572c7[_0x300b('0x2d')]===_0x300b('0x2e')){_0xdad35f=util[_0x300b('0xc')](_0x300b('0x2f'),_0x2572c7['username'],_0x2572c7[_0x300b('0x2e')]);}else if(_0x2572c7['authType']===_0x300b('0x30')){_0xdad35f=util[_0x300b('0xc')]('%s/token:%s',_0x2572c7[_0x300b('0x31')],_0x2572c7[_0x300b('0x30')]);}return util['format'](_0x300b('0x32'),new Buffer(_0xdad35f)[_0x300b('0x33')](_0x300b('0x34')));}function request(_0x534874){logger[_0x300b('0x35')](_0x300b('0x36'),JSON[_0x300b('0x37')](_0x534874));return rp(_[_0x300b('0x6')](_0x534874,{'method':_0x300b('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x2c2d06,_0x2004ae){var _0x56ee6b=[];if(_0x2c2d06&&_0x2c2d06[_0x300b('0x24')]>0x0){_0x56ee6b=_[_0x300b('0x39')](_0x2c2d06,_0x2004ae);}return _0x56ee6b;}function getCustomFields(_0x5a4d5a,_0x3364e5){var _0x5dc5e2=[];var _0x5987da={'custom_fields':[]};if(_0x5a4d5a[_0x300b('0x24')]>0x0){_[_0x300b('0x3a')](_0x5a4d5a,function(_0x295789){if(_0x295789[_0x300b('0x3b')]===_0x300b('0x3c')&&_0x295789['nameField']&&!_0x295789[_0x300b('0x3d')]){_0x5987da[_0x295789[_0x300b('0x3e')]['toLowerCase']()]=_0x295789[_0x300b('0x3f')]['toString']();}else if(_0x295789[_0x300b('0x3b')]===_0x300b('0x3c')&&_0x295789[_0x300b('0x40')]&&_0x295789[_0x300b('0x3d')]){_0x5987da[_0x300b('0x41')][_0x300b('0x42')]({'id':_0x295789[_0x300b('0x40')],'value':_0x295789[_0x300b('0x3f')][_0x300b('0x33')]()});}else if(_0x295789[_0x300b('0x3b')]===_0x300b('0x43')&&_0x295789['variableName']&&_0x295789['idField']&&_0x295789[_0x300b('0x3d')]){_0x3364e5[_0x295789['variableName']]&&_0x5987da['custom_fields'][_0x300b('0x42')]({'id':_0x295789[_0x300b('0x40')],'value':_0x3364e5[_0x295789[_0x300b('0x44')]]['toString']()});}else if(_0x295789[_0x300b('0x3b')]==='customVariable'&&_0x295789['Variable']&&_0x295789[_0x300b('0x45')][_0x300b('0x11')]&&_0x295789['idField']&&_0x295789[_0x300b('0x3d')]){_0x3364e5[_0x295789[_0x300b('0x45')]['name'][_0x300b('0x46')]()]&&_0x5987da[_0x300b('0x41')]['push']({'id':_0x295789[_0x300b('0x40')],'value':_0x3364e5[_0x295789[_0x300b('0x45')][_0x300b('0x11')][_0x300b('0x46')]()][_0x300b('0x33')]()});}});}return _0x5987da;}exports[_0x300b('0x47')]=function(_0x219a24,_0x3c6897,_0x4ee62f,_0x5a1fdf,_0x1b38ee,_0x58aa0b){var _0x554130,_0x3379cb;_0x58aa0b[_0x300b('0xe')]=intUtil[_0x300b('0x48')](_0x58aa0b[_0x300b('0xe')]);_0x58aa0b[_0x300b('0x49')]=intUtil[_0x300b('0x48')](_0x58aa0b['serverUrl']);if(_0x1b38ee&&_0x1b38ee[_0x300b('0x4a')]){logger['info']('[QUEUE]',_0x300b('0x4b'));_0x3c6897[_0x300b('0x4c')]=util['format'](_0x300b('0x4d'),_0x58aa0b[_0x300b('0x49')],_0x3c6897[_0x300b('0x4e')],md5(_0x3c6897[_0x300b('0x4e')]));}else{_0x3c6897['recordingURL']='';}headers[_0x300b('0x4f')]=getAuth(_0x58aa0b);return getUser(_0x58aa0b,_0x5a1fdf[_0x300b('0x50')])['then'](function(_0x4279f4){_0x554130=_0x4279f4;logger[_0x300b('0xb')](_0x300b('0x51'),_0x554130['id']);return getEndUser(_0x58aa0b,_0x3c6897['calleridname'],_0x3c6897[_0x300b('0x52')]);})[_0x300b('0x1a')](function(_0x22a1a9){_0x3379cb=_0x22a1a9;logger[_0x300b('0xb')](_0x300b('0x53'),_0x3379cb['id']);return getTicket(_0x58aa0b,_0x554130,_0x3379cb,_0x4ee62f,_0x3c6897);})[_0x300b('0x1a')](function(_0x418ac3){if(_0x418ac3){logger[_0x300b('0xb')](_0x300b('0x54'),_0x418ac3['id']);switch(_0x58aa0b[_0x300b('0x3b')]){case _0x300b('0x55'):logger[_0x300b('0xb')](_0x300b('0x56'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x300b('0x57'),_0x58aa0b[_0x300b('0xe')],_0x554130['id'],_0x418ac3['id']),'method':_0x300b('0x2a')});case'newTab':logger[_0x300b('0xb')]('[QUEUE]',_0x300b('0x58'));emit(util[_0x300b('0xc')]('user:%s',_0x5a1fdf[_0x300b('0x11')]),_0x300b('0x59'),{'uri':util[_0x300b('0xc')](_0x300b('0x5a'),_0x58aa0b['remoteUri'],_0x418ac3['id'])});break;default:logger[_0x300b('0x5b')]('[QUEUE]',_0x300b('0x5c'));}}})[_0x300b('0x5d')](function(_0x1307ef){logger[_0x300b('0x5b')](_0x300b('0x5e'),util[_0x300b('0x5f')](_0x1307ef,{'showHidden':!![],'depth':null}));});};exports[_0x300b('0x60')]=function(_0x178f82,_0x101acb,_0x1927a7,_0x873b9a,_0x1d6672,_0x24822b,_0x26235c){var _0x545255,_0x35c20d;_0x24822b[_0x300b('0xe')]=intUtil['stripTrailingSlash'](_0x24822b['remoteUri']);_0x24822b[_0x300b('0x49')]=intUtil[_0x300b('0x48')](_0x24822b[_0x300b('0x49')]);if(_0x26235c&&_0x26235c[_0x300b('0x61')]&&_0x26235c[_0x300b('0x61')]!==_0x300b('0x62')){logger[_0x300b('0xb')]('[OUTBOUND]',_0x300b('0x4b'));_0x101acb[_0x300b('0x4c')]=util['format'](_0x300b('0x4d'),_0x24822b['serverUrl'],_0x101acb[_0x300b('0x4e')],md5(_0x101acb[_0x300b('0x4e')]));}headers[_0x300b('0x4f')]=getAuth(_0x24822b);return getUser(_0x24822b,_0x873b9a['email'])[_0x300b('0x1a')](function(_0x3abd98){_0x545255=_0x3abd98;logger[_0x300b('0xb')](_0x300b('0x51'),_0x545255['id']);return getEndUser(_0x24822b,_0x101acb['destcalleridname'],_0x101acb[_0x300b('0x63')]);})['then'](function(_0x18b763){_0x35c20d=_0x18b763;logger[_0x300b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x35c20d['id']);return getTicket(_0x24822b,_0x545255,_0x35c20d,_0x1927a7,_0x101acb);})[_0x300b('0x1a')](function(_0x3f8b6b){if(_0x3f8b6b){logger[_0x300b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x3f8b6b['id']);switch(_0x24822b[_0x300b('0x3b')]){case _0x300b('0x55'):logger['info'](_0x300b('0x64'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x300b('0xc')](_0x300b('0x57'),_0x24822b[_0x300b('0xe')],_0x545255['id'],_0x3f8b6b['id']),'method':_0x300b('0x2a')});case _0x300b('0x65'):logger[_0x300b('0xb')](_0x300b('0x64'),_0x300b('0x58'));emit(util[_0x300b('0xc')](_0x300b('0x66'),_0x873b9a[_0x300b('0x11')]),_0x300b('0x59'),{'uri':util[_0x300b('0xc')](_0x300b('0x5a'),_0x24822b[_0x300b('0xe')],_0x3f8b6b['id'])});break;default:logger[_0x300b('0x5b')](_0x300b('0x64'),_0x300b('0x5c'));}}})[_0x300b('0x5d')](function(_0x105e1e){logger[_0x300b('0x5b')](_0x300b('0x67'),util[_0x300b('0x5f')](_0x105e1e,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x260a85,_0x5022d5,_0x1db494,_0x157d8e,_0x2680e0,_0x44d9e2){var _0x3757be,_0x267c39;_0x44d9e2[_0x300b('0xe')]=intUtil[_0x300b('0x48')](_0x44d9e2['remoteUri']);_0x44d9e2[_0x300b('0x49')]=intUtil['stripTrailingSlash'](_0x44d9e2['serverUrl']);if(_0x2680e0&&_0x2680e0[_0x300b('0x4a')]){logger[_0x300b('0xb')]('['+_0x5022d5[_0x300b('0x68')][_0x300b('0x69')]()+']',_0x300b('0x4b'));_0x5022d5['recordingURL']=util[_0x300b('0xc')](_0x300b('0x4d'),_0x44d9e2[_0x300b('0x49')],_0x5022d5[_0x300b('0x4e')],md5(_0x5022d5[_0x300b('0x4e')]));}else{_0x5022d5[_0x300b('0x4c')]='';}headers[_0x300b('0x4f')]=getAuth(_0x44d9e2);return getUser(_0x44d9e2)['then'](function(_0x26b055){_0x3757be=_0x26b055;logger[_0x300b('0xb')](_0x300b('0x51'),_0x3757be['id']);return getEndUser(_0x44d9e2,_0x5022d5[_0x300b('0x6a')],_0x5022d5[_0x300b('0x52')]);})[_0x300b('0x1a')](function(_0x1be4e1){_0x267c39=_0x1be4e1;logger[_0x300b('0xb')]('The\x20Enduser\x20ID\x20is:',_0x267c39['id']);return getTicket(_0x44d9e2,_0x3757be,_0x267c39,_0x1db494,_0x5022d5);})['then'](function(_0xd9b444){if(_0xd9b444){logger[_0x300b('0xb')](_0x300b('0x54'),_0xd9b444['id']);}})[_0x300b('0x5d')](function(_0x132eea){logger[_0x300b('0x5b')]('['+_0x5022d5[_0x300b('0x68')][_0x300b('0x69')]()+']'+_0x300b('0x6b'),util[_0x300b('0x5f')](_0x132eea,{'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 9bf6c3e..6a9e7b7 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 _0xe330=['toUpperCase','request-promise','md5','util','ioredis','bluebird','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','length','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','access_token','isBefore','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isNil','findIndex','email','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','enduserType','startCase','role','first_name','last_name','data','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','talktime','Call_Duration','format','answertime','utc','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','Call_Result','Called','complete','Answered','Rejected','abandoned','timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Inbound','Fields','/crm/v2/Calls','code','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','none','[OUTBOUND]','destcalleridname','Outbound','https://crm.'];(function(_0x2f14d8,_0x349411){var _0x8fce68=function(_0x387047){while(--_0x387047){_0x2f14d8['push'](_0x2f14d8['shift']());}};_0x8fce68(++_0x349411);}(_0xe330,0x96));var _0x0e33=function(_0x5bccf5,_0x3ac98b){_0x5bccf5=_0x5bccf5-0x0;var _0x35a840=_0xe330[_0x5bccf5];return _0x35a840;};'use strict';var _=require('lodash');var rp=require(_0x0e33('0x0'));var md5=require(_0x0e33('0x1'));var util=require(_0x0e33('0x2'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x0e33('0x3'));var BPromise=require(_0x0e33('0x4'));var config=require('../../../../config/environment');var logger=require(_0x0e33('0x5'))(_0x0e33('0x6'));config['redis']=_[_0x0e33('0x7')](config[_0x0e33('0x8')],{'host':_0x0e33('0x9'),'port':0x18eb});var io=require(_0x0e33('0xa'))(new Redis(config[_0x0e33('0x8')]));function emit(_0x3e4028,_0x2350dd,_0x1edb09){io['to'](_0x3e4028)[_0x0e33('0xb')](_0x2350dd,_0x1edb09);}function request(_0x391713){logger[_0x0e33('0xc')](_0x0e33('0xd'),JSON['stringify'](_0x391713));return rp(_0x391713);}function getCustomFields(_0x21eeec,_0x18c287){var _0x31be37={};if(_0x21eeec[_0x0e33('0xe')]>0x0){_['forEach'](_0x21eeec,function(_0x4397c2){if(_0x4397c2[_0x0e33('0xf')]===_0x0e33('0x10')&&_0x4397c2[_0x0e33('0x11')]){_0x31be37[_0x4397c2['idField']]=_0x4397c2[_0x0e33('0x12')][_0x0e33('0x13')]();}else if(_0x4397c2['type']===_0x0e33('0x14')&&_0x4397c2[_0x0e33('0x15')]&&_0x4397c2[_0x0e33('0x11')]&&_0x18c287[_0x4397c2[_0x0e33('0x15')]]){_0x31be37[_0x4397c2[_0x0e33('0x11')]]=_0x18c287[_0x4397c2[_0x0e33('0x15')]][_0x0e33('0x13')]();}else if(_0x4397c2[_0x0e33('0xf')]===_0x0e33('0x16')&&_0x4397c2[_0x0e33('0x17')]&&_0x4397c2['Variable']['name']&&_0x4397c2[_0x0e33('0x11')]&&_0x18c287[_0x4397c2[_0x0e33('0x17')][_0x0e33('0x18')][_0x0e33('0x19')]()]){_0x31be37[_0x4397c2['idField']]=_0x18c287[_0x4397c2[_0x0e33('0x17')][_0x0e33('0x18')][_0x0e33('0x19')]()][_0x0e33('0x13')]();}});}return _0x31be37;}function getName(_0x6b095f){if(_0x6b095f[_0x0e33('0x1a')]('\x20')>0x0){var _0x3caba8=_0x6b095f[_0x0e33('0x1b')](/ (.+)/);if(_0x3caba8[0x1]){return _0x3caba8;}}return[_0x6b095f,_0x6b095f];}var accountsTokens={};function getAccessToken(_0x89181a){return new Promise(function(_0x333473,_0x651a94){if(!_['isNil'](accountsTokens[_0x89181a['id']])&&!_['isNil'](accountsTokens[_0x89181a['id']][_0x0e33('0x1c')])){if(moment()[_0x0e33('0x1d')](accountsTokens[_0x89181a['id']]['expires_in'])){_0x333473(accountsTokens[_0x89181a['id']]['access_token']);}}var _0x17c388;switch(_0x89181a['zone']){case'US':_0x17c388='https://accounts.zoho.com';break;case'AU':_0x17c388='https://accounts.zoho.com.au';break;case'EU':_0x17c388=_0x0e33('0x1e');break;case'IN':_0x17c388=_0x0e33('0x1f');break;case'CN':_0x17c388='https://accounts.zoho.com.cn';break;default:_0x17c388='https://accounts.zoho.eu';break;}var _0x48b55b={'method':_0x0e33('0x20'),'uri':_0x17c388+_0x0e33('0x21'),'qs':{'refresh_token':_0x89181a[_0x0e33('0x22')],'client_id':_0x89181a[_0x0e33('0x23')],'client_secret':_0x89181a[_0x0e33('0x24')],'grant_type':_0x0e33('0x25')},'json':!![]};return rp(_0x48b55b)[_0x0e33('0x26')](function(_0x15f179){accountsTokens[_0x89181a['id']]={'access_token':_0x15f179['access_token'],'expires_in':moment()[_0x0e33('0x27')](_0x15f179['expires_in'],_0x0e33('0x28'))};_0x333473(_0x15f179[_0x0e33('0x1c')]);})[_0x0e33('0x29')](function(_0x1a76e3){logger[_0x0e33('0x2a')](_0x0e33('0x2b'),_0x1a76e3[_0x0e33('0x2c')]);_0x651a94(_0x1a76e3);});});}function getUser(_0x4d2dfa,_0x4e66dd,_0xbceecd,_0x3c543c){logger['info'](_0x0e33('0x2d'));return request({'method':_0x0e33('0x2e'),'uri':util['format'](_0x0e33('0x2f'),_0x4e66dd),'qs':{'type':_0x0e33('0x30')},'headers':{'Authorization':_0x0e33('0x31')+_0x4d2dfa},'json':!![]})[_0x0e33('0x26')](function(_0x143241){if(_0x143241['users']){var _0x5842a4=-0x1;if(_['isArrayLikeObject'](_0x143241[_0x0e33('0x32')])){if(!_[_0x0e33('0x33')](_0x3c543c)){_0x5842a4=_[_0x0e33('0x34')](_0x143241['users'],function(_0x234ddc){return _0x234ddc[_0x0e33('0x35')]===_0x3c543c;});}if(_0x5842a4>=0x0){logger[_0x0e33('0x36')]('Agent\x20found!');}else{logger[_0x0e33('0x36')](_0x0e33('0x37'));_0x5842a4=_[_0x0e33('0x34')](_0x143241[_0x0e33('0x32')],function(_0x26bb78){return _0x26bb78[_0x0e33('0x38')][_0x0e33('0x18')]===_0x0e33('0x39');});}return _0x143241[_0x0e33('0x32')][_0x5842a4];}else{if(_0x143241[_0x0e33('0x3a')]['profile']['name']==='Administrator'){logger[_0x0e33('0x36')](_0x0e33('0x37'));user=_0x143241[_0x0e33('0x3a')];return user;}else{logger[_0x0e33('0x2a')]('The\x20failing\x20result\x20is',JSON[_0x0e33('0x3b')](_0x143241));throw new Error(_0x0e33('0x3c')+JSON['stringify'](_0x143241));}}}else{logger[_0x0e33('0x2a')](_0x0e33('0x3d'),JSON[_0x0e33('0x3b')](_0x143241));throw new Error(_0x0e33('0x3c')+JSON[_0x0e33('0x3b')](_0x143241));}})['catch'](function(_0x2155b8){console['error'](_0x2155b8);});}function getZohoUser(_0x2b1f7d,_0x1bafba){return new BPromise(function(_0x2b82b0,_0x55178d){request(_0x2b1f7d)[_0x0e33('0x26')](function(_0x3310dd){var _0x233b73=null;if(_0x3310dd){_0x233b73=_0x3310dd['data'][0x0];_0x233b73[_0x0e33('0x3e')]=_0x1bafba;}_0x2b82b0(_0x233b73);})[_0x0e33('0x29')](function(_0x3cf16f){_0x55178d(_0x3cf16f);});});}function createEndUser(_0x3137b6,_0xf8d0c7,_0x29347f,_0x52d6ab,_0x142b75,_0x5cc9b2){var _0x29347f=getName(_0x29347f);return request({'method':_0x0e33('0x20'),'uri':'https://www.zohoapis.'+_0xf8d0c7+'/crm/v2/'+_[_0x0e33('0x3f')](_0x5cc9b2['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x29347f[0x1],'First_Name':_0x29347f[0x0],'Phone':_0x52d6ab,'Owner':{'name':!_['isNil'](_0x142b75[_0x0e33('0x40')]['name'])?_0x142b75[_0x0e33('0x40')]['name']:!_['isNil'](_0x142b75[_0x0e33('0x41')])?_0x142b75['first_name']+'\x20'+_0x142b75[_0x0e33('0x42')]:_0x142b75[_0x0e33('0x42')],'id':_0x142b75['id']}}]},'headers':{'Authorization':_0x0e33('0x31')+_0x3137b6},'json':!![]})[_0x0e33('0x26')](function(_0x5c8a04){if(_0x5c8a04&&_0x5c8a04[_0x0e33('0x43')][0x0]['code']===_0x0e33('0x44')){var _0x36d9b7=_0x5c8a04[_0x0e33('0x43')][0x0][_0x0e33('0x45')];_0x36d9b7[_0x0e33('0x3e')]=_[_0x0e33('0x3f')](_0x5cc9b2[_0x0e33('0x46')])+'s';return _0x36d9b7;}logger[_0x0e33('0x2a')](_0x0e33('0x3d'),JSON[_0x0e33('0x3b')](data));throw new Error(_0x0e33('0x47')+JSON['stringify'](data));})[_0x0e33('0x29')](function(_0x49a863){console[_0x0e33('0x48')](_0x0e33('0x49'),_0x49a863);});}function getEndUser(_0x37baac,_0x44b47b,_0x4f8283,_0x309d20,_0x386656,_0x44c54d,_0x4158cc){var _0x2b7062={'method':_0x0e33('0x2e'),'uri':'','headers':{'Authorization':_0x0e33('0x31')+_0x37baac},'json':!![]};switch(_0x4158cc['moduleSearch']){case _0x0e33('0x4a'):_0x2b7062[_0x0e33('0x4b')]=_0x0e33('0x4c')+_0x44b47b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x386656+'))';return getZohoUser(_0x2b7062,'Contacts')[_0x0e33('0x26')](function(_0x226e85){if(_0x226e85)return _0x226e85;_0x2b7062[_0x0e33('0x4b')]='https://www.zohoapis.'+_0x44b47b+_0x0e33('0x4d')+_0x386656+'))';return getZohoUser(_0x2b7062,_0x0e33('0x4e'))[_0x0e33('0x26')](function(_0x194e51){if(_0x194e51)return _0x194e51;if(_0x4158cc['moduleCreate']!=_0x0e33('0x4f')){return createEndUser(_0x37baac,_0x44b47b,_0x309d20,_0x386656,_0x44c54d,_0x4158cc);}else{return{};}});});break;case'contact':_0x2b7062[_0x0e33('0x4b')]='https://www.zohoapis.'+_0x44b47b+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x386656+'))';return getZohoUser(_0x2b7062,'Contacts')['then'](function(_0x3c26b9){if(_0x3c26b9)return _0x3c26b9;if(_0x4158cc[_0x0e33('0x46')]!=_0x0e33('0x4f')){return createEndUser(_0x37baac,_0x44b47b,_0x309d20,_0x386656,_0x44c54d,_0x4158cc);}else{return{};}});break;case _0x0e33('0x50'):_0x2b7062[_0x0e33('0x4b')]=_0x0e33('0x4c')+_0x44b47b+_0x0e33('0x4d')+_0x386656+'))';return getZohoUser(_0x2b7062,_0x0e33('0x4e'))['then'](function(_0x456437){if(_0x456437)return _0x456437;if(_0x4158cc[_0x0e33('0x46')]!='nothing'){return createEndUser(_0x37baac,_0x44b47b,_0x309d20,_0x386656,_0x44c54d,_0x4158cc);}else{return{};}});break;}}function getCall(_0x5669da,_0x54e69e,_0x276be2,_0x1e302b,_0x261752,_0x27bcf8,_0x58b57b,_0x356a64){logger[_0x0e33('0x36')](_0x0e33('0x51'));var _0x47281e={};_0x47281e[_0x0e33('0x52')]={'name':!_['isNil'](_0x1e302b['role'][_0x0e33('0x18')])&&!_[_0x0e33('0x33')](_0x1e302b[_0x0e33('0x38')][_0x0e33('0x18')])&&_0x1e302b['profile'][_0x0e33('0x18')]===_0x0e33('0x53')?_0x1e302b['role'][_0x0e33('0x18')]:!_[_0x0e33('0x33')](_0x1e302b[_0x0e33('0x41')])?_0x1e302b[_0x0e33('0x41')]+'\x20'+_0x1e302b['last_name']:_0x1e302b['last_name'],'id':_0x1e302b['id']};_0x47281e[_0x0e33('0x54')]=intUtil[_0x0e33('0x55')](_0x27bcf8[_0x0e33('0x56')],_0x58b57b,'\x20');_0x47281e[_0x0e33('0x57')]=intUtil[_0x0e33('0x55')](_0x27bcf8[_0x0e33('0x58')],_0x58b57b,'\x0a');if(_0x261752[_0x0e33('0x3e')]===_0x0e33('0x59')){_0x47281e[_0x0e33('0x5a')]={'name':!_[_0x0e33('0x33')](_0x261752[_0x0e33('0x5b')])?_0x261752[_0x0e33('0x5b')]:!_[_0x0e33('0x33')](_0x261752[_0x0e33('0x5c')])?_0x261752[_0x0e33('0x5c')]+'\x20'+_0x261752[_0x0e33('0x5d')]:_0x261752[_0x0e33('0x5d')],'id':_0x261752['id']};}if(_0x261752[_0x0e33('0x3e')]===_0x0e33('0x4e')){_0x47281e['What_Id']={'name':!_['isNil'](_0x261752['Full_Name'])?_0x261752[_0x0e33('0x5b')]:!_[_0x0e33('0x33')](_0x261752['First_Name'])?_0x261752[_0x0e33('0x5c')]+'\x20'+_0x261752[_0x0e33('0x5d')]:_0x261752[_0x0e33('0x5d')],'id':_0x261752['id']};_0x47281e['$se_module']=_[_0x0e33('0x3f')](_0x261752[_0x0e33('0x3e')]);}if(_0x58b57b[_0x0e33('0x5e')]){_0x47281e[_0x0e33('0x5f')]=moment['utc'](parseInt(_0x58b57b[_0x0e33('0x5e')])*0x3e8)[_0x0e33('0x60')]('mm:ss');}else if(_0x58b57b[_0x0e33('0x61')]&&_0x58b57b['endtime']){_0x47281e['Call_Duration']=moment[_0x0e33('0x62')](moment(_0x58b57b[_0x0e33('0x63')],_0x0e33('0x64'))[_0x0e33('0x65')](moment(_0x58b57b['starttime'],_0x0e33('0x64'))))[_0x0e33('0x60')](_0x0e33('0x66'));}switch(_0x58b57b[_0x0e33('0x67')]){case _0x0e33('0x68'):_0x47281e[_0x0e33('0x69')]=_0x0e33('0x6a');break;case _0x0e33('0x6b'):case'connect':_0x47281e[_0x0e33('0x69')]=_0x0e33('0x6c');break;case'rejected':_0x47281e[_0x0e33('0x69')]=_0x0e33('0x6d');break;case _0x0e33('0x6e'):_0x47281e[_0x0e33('0x69')]='Abandoned';break;case _0x0e33('0x6f'):_0x47281e['Call_Result']='Timeout';default:}_0x47281e[_0x0e33('0x70')]=(_0x356a64===_0x0e33('0x71')?moment(_0x58b57b[_0x0e33('0x72')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x58b57b[_0x0e33('0x73')])[_0x0e33('0x60')](_0x0e33('0x64')))||moment()['format'](_0x0e33('0x64'));_0x47281e['Call_Type']=_0x356a64||_0x0e33('0x74');_0x47281e=_['merge'](_0x47281e,getCustomFields(_0x27bcf8[_0x0e33('0x75')],_0x58b57b));return request({'method':_0x0e33('0x20'),'uri':_0x0e33('0x4c')+_0x54e69e+_0x0e33('0x76'),'headers':{'Authorization':_0x0e33('0x31')+_0x5669da},'body':{'data':[_0x47281e]},'json':!![]})[_0x0e33('0x26')](function(_0x3d254f){if(_0x3d254f&&_0x3d254f[_0x0e33('0x43')][0x0][_0x0e33('0x77')]==='SUCCESS'){logger[_0x0e33('0x36')](_0x0e33('0x78'));return{'id':_0x3d254f['data'][0x0][_0x0e33('0x45')]['id']};}})[_0x0e33('0x29')](function(_0x3322e0){logger[_0x0e33('0x36')](_0x0e33('0x79'),_0x3322e0['stack']);console[_0x0e33('0x48')](_0x0e33('0x79'),_0x3322e0);});}exports[_0x0e33('0x7a')]=function(_0x38dabe,_0x3739ae,_0x493a38,_0x292bb3,_0x593e90,_0x5dd448){var _0x364f9f,_0x3ddaf6,_0xa62283;_0x5dd448[_0x0e33('0x7b')]=intUtil[_0x0e33('0x7c')](_0x5dd448['host']);_0x5dd448[_0x0e33('0x7d')]=intUtil[_0x0e33('0x7c')](_0x5dd448[_0x0e33('0x7d')]);if(_0x593e90&&_0x593e90[_0x0e33('0x7e')]){logger[_0x0e33('0x36')](_0x0e33('0x7f'),_0x0e33('0x80'));_0x3739ae[_0x0e33('0x81')]=_0x5dd448[_0x0e33('0x7d')]+_0x0e33('0x82')+_0x3739ae[_0x0e33('0x83')]+_0x0e33('0x84')+md5(_0x3739ae[_0x0e33('0x83')]);}else{_0x3739ae[_0x0e33('0x81')]='';}var _0x4d5150=_0x5dd448['host']===_0x0e33('0x85')?'eu':_0x0e33('0x86');return getAccessToken(_0x5dd448)[_0x0e33('0x26')](function(_0x20134c){_0xa62283=_0x20134c;return getUser(_0xa62283,_0x4d5150,_0x5dd448,_0x292bb3[_0x0e33('0x35')]);})[_0x0e33('0x26')](function(_0x5378d0){_0x364f9f=_0x5378d0;logger['info'](_0x0e33('0x87'),_0x364f9f['id']);return getEndUser(_0xa62283,_0x4d5150,_0x5dd448,_0x3739ae[_0x0e33('0x88')],_0x3739ae[_0x0e33('0x89')],_0x364f9f,_0x493a38);})['then'](function(_0x5c3f74){_0x3ddaf6=_0x5c3f74;return getCall(_0xa62283,_0x4d5150,_0x5dd448,_0x364f9f,_0x3ddaf6,_0x493a38,_0x3739ae,_0x0e33('0x74'));})[_0x0e33('0x26')](function(_0x10e7e6){if(_0x10e7e6){logger[_0x0e33('0x36')](_0x0e33('0x8a'),_0x10e7e6['id']);logger['info'](_0x0e33('0x7f'),_0x0e33('0x8b'));emit(util['format'](_0x0e33('0x8c'),_0x292bb3[_0x0e33('0x18')]),_0x0e33('0x8d'),{'uri':'https://crm.'+_0x5dd448[_0x0e33('0x7b')]+_0x0e33('0x8e')+_0x10e7e6['id']});}})['catch'](function(_0x17e4f5){logger[_0x0e33('0x2a')](_0x0e33('0x7f'),JSON[_0x0e33('0x3b')](_0x17e4f5));});};exports[_0x0e33('0x71')]=function(_0x4c9aff,_0x5cc637,_0x263c2d,_0x5a673e,_0x4de0ba,_0x23c297,_0x158e39){var _0x456bdb,_0xa6478c,_0x2d2d59;_0x23c297[_0x0e33('0x7b')]=intUtil['stripTrailingSlash'](_0x23c297[_0x0e33('0x7b')]);_0x23c297['serverUrl']=intUtil[_0x0e33('0x7c')](_0x23c297[_0x0e33('0x7d')]);if(_0x158e39&&_0x158e39['recordingFormat']&&_0x158e39['recordingFormat']!==_0x0e33('0x8f')){logger['info'](_0x0e33('0x90'),'Recording\x20is\x20enabled!');_0x5cc637[_0x0e33('0x81')]=_0x23c297[_0x0e33('0x7d')]+_0x0e33('0x82')+_0x5cc637[_0x0e33('0x83')]+_0x0e33('0x84')+md5(_0x5cc637[_0x0e33('0x83')]);}var _0x3aa689=_0x23c297[_0x0e33('0x7b')]==='zoho.eu'?'eu':_0x0e33('0x86');return getAccessToken(_0x23c297)[_0x0e33('0x26')](function(_0x240bc2){_0x2d2d59=_0x240bc2;return getUser(_0x2d2d59,_0x3aa689,_0x23c297,_0x5a673e['email']);})[_0x0e33('0x26')](function(_0x1c277a){_0x456bdb=_0x1c277a;logger[_0x0e33('0x36')](_0x0e33('0x87'),_0x456bdb['id']);return getEndUser(_0x2d2d59,_0x3aa689,_0x23c297,_0x5cc637[_0x0e33('0x91')],_0x5cc637['destcalleridnum'],_0x456bdb,_0x263c2d);})[_0x0e33('0x26')](function(_0x37504a){_0xa6478c=_0x37504a;return getCall(_0x2d2d59,_0x3aa689,_0x23c297,_0x456bdb,_0xa6478c,_0x263c2d,_0x5cc637,_0x0e33('0x92'));})[_0x0e33('0x26')](function(_0x1e7c49){if(_0x1e7c49){logger['info'](_0x0e33('0x8a'),_0x1e7c49['id']);logger[_0x0e33('0x36')](_0x0e33('0x90'),_0x0e33('0x8b'));emit(util[_0x0e33('0x60')]('user:%s',_0x5a673e['name']),'trigger:browser:url',{'uri':_0x0e33('0x93')+_0x23c297[_0x0e33('0x7b')]+'/crm/EntityInfo.do?module=Calls&id='+_0x1e7c49['id']});}})[_0x0e33('0x29')](function(_0x40d8e){logger[_0x0e33('0x2a')]('[OUTBOUND]',JSON[_0x0e33('0x3b')](_0x40d8e));});};exports['unmanaged']=function(_0x223df2,_0x1168e4,_0x3da503,_0x4e919a,_0x44030f,_0x4321e6){var _0x4bb259,_0x4f4b01,_0x38e0bf;_0x4321e6[_0x0e33('0x7b')]=intUtil[_0x0e33('0x7c')](_0x4321e6[_0x0e33('0x7b')]);_0x4321e6[_0x0e33('0x7d')]=intUtil['stripTrailingSlash'](_0x4321e6[_0x0e33('0x7d')]);if(_0x44030f&&_0x44030f['monitor_format']){logger[_0x0e33('0x36')]('['+_0x1168e4[_0x0e33('0x67')]['toUpperCase']()+']',_0x0e33('0x80'));_0x1168e4[_0x0e33('0x81')]=_0x4321e6[_0x0e33('0x7d')]+_0x0e33('0x82')+_0x1168e4[_0x0e33('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x1168e4['uniqueid']);}else{_0x1168e4[_0x0e33('0x81')]='';}var _0x4c4e3f=_0x4321e6[_0x0e33('0x7b')]===_0x0e33('0x85')?'eu':_0x0e33('0x86');return getAccessToken(_0x4321e6)[_0x0e33('0x26')](function(_0x1ffc79){_0x38e0bf=_0x1ffc79;return getUser(_0x38e0bf,_0x4c4e3f,_0x4321e6);})['then'](function(_0x10e259){_0x4bb259=_0x10e259;logger[_0x0e33('0x36')]('The\x20User\x20ID\x20is:',_0x4bb259['id']);return getEndUser(_0x38e0bf,_0x4c4e3f,_0x4321e6,_0x1168e4[_0x0e33('0x88')],_0x1168e4[_0x0e33('0x89')],_0x4bb259,_0x3da503);})[_0x0e33('0x26')](function(_0x24d1aa){_0x4f4b01=_0x24d1aa;return getCall(_0x38e0bf,_0x4c4e3f,_0x4321e6,_0x4bb259,_0x4f4b01,_0x3da503,_0x1168e4,_0x0e33('0x74'));})[_0x0e33('0x26')](function(_0x3afc94){if(_0x3afc94){logger[_0x0e33('0x36')](_0x0e33('0x8a'),_0x3afc94['id']);}})['catch'](function(_0x1e7a96){logger['error']('['+_0x1168e4[_0x0e33('0x67')][_0x0e33('0x94')]()+']',JSON[_0x0e33('0x3b')](_0x1e7a96));});}; \ No newline at end of file +var _0x928c=['outbound','agentcalledAt','Call_Type','merge','/crm/v2/Calls','data','SUCCESS','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','calleridname','calleridnum','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','com','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','user:%s','unmanaged','toUpperCase','lastevent','lodash','util','./util','moment','bluebird','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','variableName','toString','name','toLowerCase','Variable','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','GET','format','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','info','Using\x20the\x20admin\x20account!','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','enduserType','POST','https://www.zohoapis.','moduleCreate','role','first_name','last_name','code','startCase','Error:\x20','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','called','Call_Result','connect','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time'];(function(_0x3e18a2,_0x13f7d3){var _0xf40647=function(_0x1e69f3){while(--_0x1e69f3){_0x3e18a2['push'](_0x3e18a2['shift']());}};_0xf40647(++_0x13f7d3);}(_0x928c,0x157));var _0xc928=function(_0xf8f265,_0x55bff6){_0xf8f265=_0xf8f265-0x0;var _0x23065e=_0x928c[_0xf8f265];return _0x23065e;};'use strict';var _=require(_0xc928('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xc928('0x1'));var intUtil=require(_0xc928('0x2'));var moment=require(_0xc928('0x3'));var Redis=require('ioredis');var BPromise=require(_0xc928('0x4'));var config=require('../../../../config/environment');var logger=require(_0xc928('0x5'))('zoho');config[_0xc928('0x6')]=_[_0xc928('0x7')](config[_0xc928('0x6')],{'host':_0xc928('0x8'),'port':0x18eb});var io=require(_0xc928('0x9'))(new Redis(config[_0xc928('0x6')]));function emit(_0x19ec0a,_0x37a526,_0x324647){io['to'](_0x19ec0a)['emit'](_0x37a526,_0x324647);}function request(_0x470b11){logger[_0xc928('0xa')](_0xc928('0xb'),JSON[_0xc928('0xc')](_0x470b11));return rp(_0x470b11);}function getCustomFields(_0x271c64,_0x5f1a87){var _0x36d82a={};if(_0x271c64[_0xc928('0xd')]>0x0){_[_0xc928('0xe')](_0x271c64,function(_0x49d3d1){if(_0x49d3d1[_0xc928('0xf')]===_0xc928('0x10')&&_0x49d3d1[_0xc928('0x11')]){_0x36d82a[_0x49d3d1['idField']]=_0x49d3d1[_0xc928('0x12')]['toString']();}else if(_0x49d3d1[_0xc928('0xf')]==='variable'&&_0x49d3d1[_0xc928('0x13')]&&_0x49d3d1['idField']&&_0x5f1a87[_0x49d3d1[_0xc928('0x13')]]){_0x36d82a[_0x49d3d1[_0xc928('0x11')]]=_0x5f1a87[_0x49d3d1['variableName']][_0xc928('0x14')]();}else if(_0x49d3d1[_0xc928('0xf')]==='customVariable'&&_0x49d3d1['Variable']&&_0x49d3d1['Variable'][_0xc928('0x15')]&&_0x49d3d1[_0xc928('0x11')]&&_0x5f1a87[_0x49d3d1['Variable'][_0xc928('0x15')][_0xc928('0x16')]()]){_0x36d82a[_0x49d3d1[_0xc928('0x11')]]=_0x5f1a87[_0x49d3d1[_0xc928('0x17')][_0xc928('0x15')]['toLowerCase']()][_0xc928('0x14')]();}});}return _0x36d82a;}function getName(_0x25915f){if(_0x25915f[_0xc928('0x18')]('\x20')>0x0){var _0x382260=_0x25915f[_0xc928('0x19')](/ (.+)/);if(_0x382260[0x1]){return _0x382260;}}return[_0x25915f,_0x25915f];}var accountsTokens={};function getAccessToken(_0x45bba7){return new Promise(function(_0x115a2d,_0x5914e7){if(!_[_0xc928('0x1a')](accountsTokens[_0x45bba7['id']])&&!_[_0xc928('0x1a')](accountsTokens[_0x45bba7['id']][_0xc928('0x1b')])){if(moment()[_0xc928('0x1c')](accountsTokens[_0x45bba7['id']]['expires_in'])){_0x115a2d(accountsTokens[_0x45bba7['id']][_0xc928('0x1b')]);}}var _0x71b3c6;switch(_0x45bba7[_0xc928('0x1d')]){case'US':_0x71b3c6=_0xc928('0x1e');break;case'AU':_0x71b3c6=_0xc928('0x1f');break;case'EU':_0x71b3c6=_0xc928('0x20');break;case'IN':_0x71b3c6=_0xc928('0x21');break;case'CN':_0x71b3c6='https://accounts.zoho.com.cn';break;default:_0x71b3c6=_0xc928('0x20');break;}var _0x4c62ca={'method':'POST','uri':_0x71b3c6+_0xc928('0x22'),'qs':{'refresh_token':_0x45bba7['refreshToken'],'client_id':_0x45bba7['clientId'],'client_secret':_0x45bba7['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x4c62ca)[_0xc928('0x23')](function(_0x2fa322){accountsTokens[_0x45bba7['id']]={'access_token':_0x2fa322[_0xc928('0x1b')],'expires_in':moment()['add'](_0x2fa322[_0xc928('0x24')],_0xc928('0x25'))};_0x115a2d(_0x2fa322[_0xc928('0x1b')]);})[_0xc928('0x26')](function(_0x4aefcd){logger[_0xc928('0x27')](_0xc928('0x28'),_0x4aefcd[_0xc928('0x29')]);_0x5914e7(_0x4aefcd);});});}function getUser(_0xe972f8,_0x5e8d90,_0x470fe6,_0x346c0b){logger['info']('Search\x20user');return request({'method':_0xc928('0x2a'),'uri':util[_0xc928('0x2b')]('https://www.zohoapis.%s/crm/v2/users',_0x5e8d90),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xc928('0x2c')+_0xe972f8},'json':!![]})[_0xc928('0x23')](function(_0x1fd467){if(_0x1fd467[_0xc928('0x2d')]){var _0x543407=-0x1;if(_[_0xc928('0x2e')](_0x1fd467[_0xc928('0x2d')])){if(!_[_0xc928('0x1a')](_0x346c0b)){_0x543407=_[_0xc928('0x2f')](_0x1fd467[_0xc928('0x2d')],function(_0x33291f){return _0x33291f[_0xc928('0x30')]===_0x346c0b;});}if(_0x543407>=0x0){logger['info'](_0xc928('0x31'));}else{logger[_0xc928('0x32')](_0xc928('0x33'));_0x543407=_[_0xc928('0x2f')](_0x1fd467[_0xc928('0x2d')],function(_0x2439c0){return _0x2439c0['profile'][_0xc928('0x15')]==='Administrator';});}return _0x1fd467[_0xc928('0x2d')][_0x543407];}else{if(_0x1fd467['user']['profile'][_0xc928('0x15')]===_0xc928('0x34')){logger[_0xc928('0x32')](_0xc928('0x33'));user=_0x1fd467[_0xc928('0x35')];return user;}else{logger[_0xc928('0x27')](_0xc928('0x36'),JSON[_0xc928('0xc')](_0x1fd467));throw new Error(_0xc928('0x37')+JSON[_0xc928('0xc')](_0x1fd467));}}}else{logger['error'](_0xc928('0x36'),JSON[_0xc928('0xc')](_0x1fd467));throw new Error(_0xc928('0x37')+JSON[_0xc928('0xc')](_0x1fd467));}})[_0xc928('0x26')](function(_0x461fb3){console[_0xc928('0x27')](_0x461fb3);});}function getZohoUser(_0x2f3f69,_0x3da9b4){return new BPromise(function(_0x4f9346,_0xe13bba){request(_0x2f3f69)[_0xc928('0x23')](function(_0x7ce9dd){var _0x8fdf73=null;if(_0x7ce9dd){_0x8fdf73=_0x7ce9dd['data'][0x0];_0x8fdf73[_0xc928('0x38')]=_0x3da9b4;}_0x4f9346(_0x8fdf73);})[_0xc928('0x26')](function(_0x3600f5){_0xe13bba(_0x3600f5);});});}function createEndUser(_0x1c104a,_0x26dc40,_0x4f0d6b,_0x5c9a72,_0x1f7d37,_0x5aafcb){var _0x4f0d6b=getName(_0x4f0d6b);return request({'method':_0xc928('0x39'),'uri':_0xc928('0x3a')+_0x26dc40+'/crm/v2/'+_['startCase'](_0x5aafcb[_0xc928('0x3b')])+'s','body':{'data':[{'Last_Name':_0x4f0d6b[0x1],'First_Name':_0x4f0d6b[0x0],'Phone':_0x5c9a72,'Owner':{'name':!_[_0xc928('0x1a')](_0x1f7d37[_0xc928('0x3c')][_0xc928('0x15')])?_0x1f7d37[_0xc928('0x3c')][_0xc928('0x15')]:!_[_0xc928('0x1a')](_0x1f7d37[_0xc928('0x3d')])?_0x1f7d37[_0xc928('0x3d')]+'\x20'+_0x1f7d37['last_name']:_0x1f7d37[_0xc928('0x3e')],'id':_0x1f7d37['id']}}]},'headers':{'Authorization':_0xc928('0x2c')+_0x1c104a},'json':!![]})[_0xc928('0x23')](function(_0x191978){if(_0x191978&&_0x191978['data'][0x0][_0xc928('0x3f')]==='SUCCESS'){var _0x47cf52=_0x191978['data'][0x0]['details'];_0x47cf52['enduserType']=_[_0xc928('0x40')](_0x5aafcb[_0xc928('0x3b')])+'s';return _0x47cf52;}logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](data));throw new Error(_0xc928('0x41')+JSON[_0xc928('0xc')](data));})['catch'](function(_0x4a5e83){console['log']('CREATE\x20ERROR',_0x4a5e83);});}function getEndUser(_0x2fc074,_0x52a13a,_0x4cc620,_0x498bef,_0x31ef73,_0x16fccf,_0x2a5c04){var _0x5b47b7={'method':_0xc928('0x2a'),'uri':'','headers':{'Authorization':_0xc928('0x2c')+_0x2fc074},'json':!![]};switch(_0x2a5c04[_0xc928('0x42')]){case _0xc928('0x43'):_0x5b47b7[_0xc928('0x44')]='https://www.zohoapis.'+_0x52a13a+_0xc928('0x45')+_0x31ef73+'))';return getZohoUser(_0x5b47b7,'Contacts')['then'](function(_0xce28e){if(_0xce28e)return _0xce28e;_0x5b47b7[_0xc928('0x44')]=_0xc928('0x3a')+_0x52a13a+_0xc928('0x46')+_0x31ef73+'))';return getZohoUser(_0x5b47b7,_0xc928('0x47'))[_0xc928('0x23')](function(_0x64c1a){if(_0x64c1a)return _0x64c1a;if(_0x2a5c04[_0xc928('0x3b')]!=_0xc928('0x48')){return createEndUser(_0x2fc074,_0x52a13a,_0x498bef,_0x31ef73,_0x16fccf,_0x2a5c04);}else{return{};}});});break;case _0xc928('0x49'):_0x5b47b7['uri']=_0xc928('0x3a')+_0x52a13a+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x31ef73+'))';return getZohoUser(_0x5b47b7,_0xc928('0x4a'))[_0xc928('0x23')](function(_0x59a9b8){if(_0x59a9b8)return _0x59a9b8;if(_0x2a5c04['moduleCreate']!=_0xc928('0x48')){return createEndUser(_0x2fc074,_0x52a13a,_0x498bef,_0x31ef73,_0x16fccf,_0x2a5c04);}else{return{};}});break;case _0xc928('0x4b'):_0x5b47b7[_0xc928('0x44')]=_0xc928('0x3a')+_0x52a13a+_0xc928('0x46')+_0x31ef73+'))';return getZohoUser(_0x5b47b7,'Leads')[_0xc928('0x23')](function(_0x42d32e){if(_0x42d32e)return _0x42d32e;if(_0x2a5c04[_0xc928('0x3b')]!=_0xc928('0x48')){return createEndUser(_0x2fc074,_0x52a13a,_0x498bef,_0x31ef73,_0x16fccf,_0x2a5c04);}else{return{};}});break;}}function getCall(_0x10a8c2,_0x1590a2,_0x325a82,_0x461b48,_0x5b8c9a,_0x2ca473,_0x17ac77,_0x1fe1c7){logger[_0xc928('0x32')](_0xc928('0x4c'));var _0x21f189={};_0x21f189[_0xc928('0x4d')]={'name':!_[_0xc928('0x1a')](_0x461b48[_0xc928('0x3c')]['name'])&&!_[_0xc928('0x1a')](_0x461b48[_0xc928('0x4e')][_0xc928('0x15')])&&_0x461b48[_0xc928('0x4e')][_0xc928('0x15')]===_0xc928('0x4f')?_0x461b48[_0xc928('0x3c')]['name']:!_[_0xc928('0x1a')](_0x461b48[_0xc928('0x3d')])?_0x461b48[_0xc928('0x3d')]+'\x20'+_0x461b48['last_name']:_0x461b48[_0xc928('0x3e')],'id':_0x461b48['id']};_0x21f189[_0xc928('0x50')]=intUtil[_0xc928('0x51')](_0x2ca473[_0xc928('0x52')],_0x17ac77,'\x20');_0x21f189[_0xc928('0x53')]=intUtil[_0xc928('0x51')](_0x2ca473[_0xc928('0x54')],_0x17ac77,'\x0a');if(_0x5b8c9a[_0xc928('0x38')]===_0xc928('0x4a')){_0x21f189[_0xc928('0x55')]={'name':!_['isNil'](_0x5b8c9a[_0xc928('0x56')])?_0x5b8c9a[_0xc928('0x56')]:!_['isNil'](_0x5b8c9a[_0xc928('0x57')])?_0x5b8c9a[_0xc928('0x57')]+'\x20'+_0x5b8c9a[_0xc928('0x58')]:_0x5b8c9a['Last_Name'],'id':_0x5b8c9a['id']};}if(_0x5b8c9a[_0xc928('0x38')]===_0xc928('0x47')){_0x21f189[_0xc928('0x59')]={'name':!_[_0xc928('0x1a')](_0x5b8c9a[_0xc928('0x56')])?_0x5b8c9a[_0xc928('0x56')]:!_[_0xc928('0x1a')](_0x5b8c9a[_0xc928('0x57')])?_0x5b8c9a[_0xc928('0x57')]+'\x20'+_0x5b8c9a[_0xc928('0x58')]:_0x5b8c9a[_0xc928('0x58')],'id':_0x5b8c9a['id']};_0x21f189[_0xc928('0x5a')]=_[_0xc928('0x40')](_0x5b8c9a[_0xc928('0x38')]);}if(_0x17ac77[_0xc928('0x5b')]){_0x21f189[_0xc928('0x5c')]=moment[_0xc928('0x5d')](parseInt(_0x17ac77['talktime'])*0x3e8)[_0xc928('0x2b')](_0xc928('0x5e'));}else if(_0x17ac77[_0xc928('0x5f')]&&_0x17ac77[_0xc928('0x60')]){_0x21f189[_0xc928('0x5c')]=moment[_0xc928('0x5d')](moment(_0x17ac77['endtime'],_0xc928('0x61'))[_0xc928('0x62')](moment(_0x17ac77[_0xc928('0x63')],_0xc928('0x61'))))[_0xc928('0x2b')]('mm:ss');}switch(_0x17ac77['lastevent']){case _0xc928('0x64'):_0x21f189[_0xc928('0x65')]='Called';break;case'complete':case _0xc928('0x66'):_0x21f189[_0xc928('0x65')]='Answered';break;case _0xc928('0x67'):_0x21f189[_0xc928('0x65')]=_0xc928('0x68');break;case _0xc928('0x69'):_0x21f189[_0xc928('0x65')]=_0xc928('0x6a');break;case _0xc928('0x6b'):_0x21f189[_0xc928('0x65')]=_0xc928('0x6c');default:}_0x21f189[_0xc928('0x6d')]=(_0x1fe1c7===_0xc928('0x6e')?moment(_0x17ac77['starttime'])[_0xc928('0x2b')](_0xc928('0x61')):moment(_0x17ac77[_0xc928('0x6f')])['format'](_0xc928('0x61')))||moment()[_0xc928('0x2b')]('YYYY-MM-DDTHH:mm:ss');_0x21f189[_0xc928('0x70')]=_0x1fe1c7||'Inbound';_0x21f189=_[_0xc928('0x71')](_0x21f189,getCustomFields(_0x2ca473['Fields'],_0x17ac77));return request({'method':'POST','uri':'https://www.zohoapis.'+_0x1590a2+_0xc928('0x72'),'headers':{'Authorization':_0xc928('0x2c')+_0x10a8c2},'body':{'data':[_0x21f189]},'json':!![]})[_0xc928('0x23')](function(_0x3c9902){if(_0x3c9902&&_0x3c9902[_0xc928('0x73')][0x0][_0xc928('0x3f')]===_0xc928('0x74')){logger[_0xc928('0x32')]('Call\x20created!');return{'id':_0x3c9902[_0xc928('0x73')][0x0]['details']['id']};}})['catch'](function(_0xb28164){logger['info'](_0xc928('0x75'),_0xb28164[_0xc928('0x29')]);console[_0xc928('0x76')](_0xc928('0x75'),_0xb28164);});}exports[_0xc928('0x77')]=function(_0x3a028d,_0x4ce645,_0x52294d,_0x5e5dcf,_0x4afb3c,_0x231c70){var _0x56eec4,_0x465951,_0x57d19c;_0x231c70[_0xc928('0x78')]=intUtil[_0xc928('0x79')](_0x231c70[_0xc928('0x78')]);_0x231c70[_0xc928('0x7a')]=intUtil['stripTrailingSlash'](_0x231c70['serverUrl']);if(_0x4afb3c&&_0x4afb3c[_0xc928('0x7b')]){logger[_0xc928('0x32')]('[QUEUE]',_0xc928('0x7c'));_0x4ce645['recordingURL']=_0x231c70['serverUrl']+_0xc928('0x7d')+_0x4ce645[_0xc928('0x7e')]+_0xc928('0x7f')+md5(_0x4ce645[_0xc928('0x7e')]);}else{_0x4ce645[_0xc928('0x80')]='';}var _0x4e3d96=_0x231c70[_0xc928('0x78')]===_0xc928('0x81')?'eu':'com';return getAccessToken(_0x231c70)[_0xc928('0x23')](function(_0x3d0ca6){_0x57d19c=_0x3d0ca6;return getUser(_0x57d19c,_0x4e3d96,_0x231c70,_0x5e5dcf[_0xc928('0x30')]);})[_0xc928('0x23')](function(_0x485f78){_0x56eec4=_0x485f78;logger[_0xc928('0x32')]('The\x20User\x20ID\x20is:',_0x56eec4['id']);return getEndUser(_0x57d19c,_0x4e3d96,_0x231c70,_0x4ce645[_0xc928('0x82')],_0x4ce645[_0xc928('0x83')],_0x56eec4,_0x52294d);})[_0xc928('0x23')](function(_0x4a0c76){_0x465951=_0x4a0c76;return getCall(_0x57d19c,_0x4e3d96,_0x231c70,_0x56eec4,_0x465951,_0x52294d,_0x4ce645,_0xc928('0x84'));})[_0xc928('0x23')](function(_0x2aa3d8){if(_0x2aa3d8){logger[_0xc928('0x32')](_0xc928('0x85'),_0x2aa3d8['id']);logger[_0xc928('0x32')](_0xc928('0x86'),_0xc928('0x87'));emit(util[_0xc928('0x2b')]('user:%s',_0x5e5dcf[_0xc928('0x15')]),_0xc928('0x88'),{'uri':_0xc928('0x89')+_0x231c70['host']+_0xc928('0x8a')+_0x2aa3d8['id']});}})['catch'](function(_0x22aa61){logger[_0xc928('0x27')](_0xc928('0x86'),JSON['stringify'](_0x22aa61));});};exports[_0xc928('0x6e')]=function(_0x585375,_0xd0c81b,_0x3f0d19,_0x1b894c,_0x58440b,_0x56a194,_0x6e21a6){var _0xb72194,_0x4bee9c,_0x2b0589;_0x56a194['host']=intUtil[_0xc928('0x79')](_0x56a194[_0xc928('0x78')]);_0x56a194['serverUrl']=intUtil[_0xc928('0x79')](_0x56a194[_0xc928('0x7a')]);if(_0x6e21a6&&_0x6e21a6['recordingFormat']&&_0x6e21a6[_0xc928('0x8b')]!==_0xc928('0x8c')){logger[_0xc928('0x32')](_0xc928('0x8d'),'Recording\x20is\x20enabled!');_0xd0c81b[_0xc928('0x80')]=_0x56a194['serverUrl']+_0xc928('0x7d')+_0xd0c81b['uniqueid']+_0xc928('0x7f')+md5(_0xd0c81b[_0xc928('0x7e')]);}var _0x3212e4=_0x56a194[_0xc928('0x78')]==='zoho.eu'?'eu':_0xc928('0x8e');return getAccessToken(_0x56a194)[_0xc928('0x23')](function(_0x1e8309){_0x2b0589=_0x1e8309;return getUser(_0x2b0589,_0x3212e4,_0x56a194,_0x1b894c[_0xc928('0x30')]);})[_0xc928('0x23')](function(_0x34b9a1){_0xb72194=_0x34b9a1;logger[_0xc928('0x32')](_0xc928('0x8f'),_0xb72194['id']);return getEndUser(_0x2b0589,_0x3212e4,_0x56a194,_0xd0c81b[_0xc928('0x90')],_0xd0c81b[_0xc928('0x91')],_0xb72194,_0x3f0d19);})[_0xc928('0x23')](function(_0x457920){_0x4bee9c=_0x457920;return getCall(_0x2b0589,_0x3212e4,_0x56a194,_0xb72194,_0x4bee9c,_0x3f0d19,_0xd0c81b,_0xc928('0x92'));})['then'](function(_0x151931){if(_0x151931){logger[_0xc928('0x32')](_0xc928('0x85'),_0x151931['id']);logger[_0xc928('0x32')]('[OUTBOUND]',_0xc928('0x87'));emit(util[_0xc928('0x2b')](_0xc928('0x93'),_0x1b894c[_0xc928('0x15')]),'trigger:browser:url',{'uri':_0xc928('0x89')+_0x56a194['host']+_0xc928('0x8a')+_0x151931['id']});}})['catch'](function(_0x46f0ee){logger[_0xc928('0x27')]('[OUTBOUND]',JSON['stringify'](_0x46f0ee));});};exports[_0xc928('0x94')]=function(_0x1783ed,_0x4f696b,_0xb44c,_0x584699,_0x99c792,_0x359827){var _0x3bcca9,_0x5811fc,_0x51b34d;_0x359827[_0xc928('0x78')]=intUtil[_0xc928('0x79')](_0x359827['host']);_0x359827[_0xc928('0x7a')]=intUtil['stripTrailingSlash'](_0x359827[_0xc928('0x7a')]);if(_0x99c792&&_0x99c792[_0xc928('0x7b')]){logger[_0xc928('0x32')]('['+_0x4f696b['lastevent'][_0xc928('0x95')]()+']',_0xc928('0x7c'));_0x4f696b[_0xc928('0x80')]=_0x359827[_0xc928('0x7a')]+_0xc928('0x7d')+_0x4f696b['uniqueid']+_0xc928('0x7f')+md5(_0x4f696b[_0xc928('0x7e')]);}else{_0x4f696b[_0xc928('0x80')]='';}var _0x1cc64b=_0x359827[_0xc928('0x78')]===_0xc928('0x81')?'eu':_0xc928('0x8e');return getAccessToken(_0x359827)[_0xc928('0x23')](function(_0x5943a1){_0x51b34d=_0x5943a1;return getUser(_0x51b34d,_0x1cc64b,_0x359827);})[_0xc928('0x23')](function(_0x469700){_0x3bcca9=_0x469700;logger[_0xc928('0x32')]('The\x20User\x20ID\x20is:',_0x3bcca9['id']);return getEndUser(_0x51b34d,_0x1cc64b,_0x359827,_0x4f696b[_0xc928('0x82')],_0x4f696b[_0xc928('0x83')],_0x3bcca9,_0xb44c);})['then'](function(_0x2966c5){_0x5811fc=_0x2966c5;return getCall(_0x51b34d,_0x1cc64b,_0x359827,_0x3bcca9,_0x5811fc,_0xb44c,_0x4f696b,_0xc928('0x84'));})[_0xc928('0x23')](function(_0x1af69d){if(_0x1af69d){logger[_0xc928('0x32')](_0xc928('0x85'),_0x1af69d['id']);}})[_0xc928('0x26')](function(_0x851ba5){logger[_0xc928('0x27')]('['+_0x4f696b[_0xc928('0x96')][_0xc928('0x95')]()+']',JSON[_0xc928('0xc')](_0x851ba5));});}; \ 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 8140494..8bce10a 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(_0x1cfec8,_0x1b4e34){var _0x229bf5=function(_0x56f873){while(--_0x56f873){_0x1cfec8['push'](_0x1cfec8['shift']());}};_0x229bf5(++_0x1b4e34);}(_0x7a54,0x106));var _0x47a5=function(_0x487d07,_0x234f4f){_0x487d07=_0x487d07-0x0;var _0x30dbe4=_0x7a54[_0x487d07];return _0x30dbe4;};'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(_0x252c09,_0x59dd39){var _0x2b0bf1=function(_0x43a3b5){while(--_0x43a3b5){_0x252c09['push'](_0x252c09['shift']());}};_0x2b0bf1(++_0x59dd39);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab479,_0x28058d){_0x5ab479=_0x5ab479-0x0;var _0x5af334=_0x7a54[_0x5ab479];return _0x5af334;};'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 34d6a45..daf2ec5 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(_0x427b29,_0x44f1d6){var _0x1823ec=function(_0x4391ff){while(--_0x4391ff){_0x427b29['push'](_0x427b29['shift']());}};_0x1823ec(++_0x44f1d6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x13978d,_0x49d461){_0x13978d=_0x13978d-0x0;var _0x2e4d4c=_0x5f2f[_0x13978d];return _0x2e4d4c;};'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(_0x28b2cd,_0x1e386d){var _0x4046e8=function(_0x49cfd2){while(--_0x49cfd2){_0x28b2cd['push'](_0x28b2cd['shift']());}};_0x4046e8(++_0x1e386d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1df236,_0x2fa2e1){_0x1df236=_0x1df236-0x0;var _0x3f3215=_0x5f2f[_0x1df236];return _0x3f3215;};'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 01f1f69..04e4997 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 _0xf53f=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','debug','error','message','catch','rpc'];(function(_0x4fb3a0,_0x218d58){var _0x1a6ab2=function(_0x5584d5){while(--_0x5584d5){_0x4fb3a0['push'](_0x4fb3a0['shift']());}};_0x1a6ab2(++_0x218d58);}(_0xf53f,0x8d));var _0xff53=function(_0x53e15f,_0x2bc56a){_0x53e15f=_0x53e15f-0x0;var _0xf7d08f=_0xf53f[_0x53e15f];return _0xf7d08f;};'use strict';var jayson=require(_0xff53('0x0'));var BPromise=require(_0xff53('0x1'));var logger=require(_0xff53('0x2'))(_0xff53('0x3'));var client=jayson[_0xff53('0x4')][_0xff53('0x5')]({'port':0x2329});client[_0xff53('0x6')]=function(_0x32529d,_0x18b504){return new BPromise(function(_0x2077b9,_0x28dacf){return client[_0xff53('0x7')](_0x32529d,_0x18b504)['then'](function(_0x54e637){logger[_0xff53('0x8')]('rpc',_0xff53('0x3'),_0x32529d,_0x18b504,_0x54e637);if(_0x54e637[_0xff53('0x9')]){logger[_0xff53('0x9')]('rpc','routing',_0x32529d,_0x54e637[_0xff53('0x9')]['message'],_0x18b504);return _0x28dacf(_0x54e637[_0xff53('0x9')][_0xff53('0xa')]);}else{return _0x2077b9(_0x54e637['result']);}})[_0xff53('0xb')](function(_0x14f3ac){logger['error'](_0xff53('0xc'),_0xff53('0x3'),_0x32529d,_0x14f3ac,_0x18b504);return _0x28dacf(_0x14f3ac);});});};module[_0xff53('0xd')]=client; \ No newline at end of file +var _0x5a52=['catch','jayson/promise','client','http','Request','request','rpc','routing','error','message','result'];(function(_0x4c21e7,_0x4951bb){var _0xed2a31=function(_0x5e38e0){while(--_0x5e38e0){_0x4c21e7['push'](_0x4c21e7['shift']());}};_0xed2a31(++_0x4951bb);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x25a5('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('routing');var client=jayson[_0x25a5('0x1')][_0x25a5('0x2')]({'port':0x2329});client[_0x25a5('0x3')]=function(_0x2f17d9,_0x2fc1db){return new BPromise(function(_0x407636,_0x1d9132){return client[_0x25a5('0x4')](_0x2f17d9,_0x2fc1db)['then'](function(_0x2c210a){logger['debug'](_0x25a5('0x5'),_0x25a5('0x6'),_0x2f17d9,_0x2fc1db,_0x2c210a);if(_0x2c210a[_0x25a5('0x7')]){logger[_0x25a5('0x7')](_0x25a5('0x5'),_0x25a5('0x6'),_0x2f17d9,_0x2c210a['error']['message'],_0x2fc1db);return _0x1d9132(_0x2c210a[_0x25a5('0x7')][_0x25a5('0x8')]);}else{return _0x407636(_0x2c210a[_0x25a5('0x9')]);}})[_0x25a5('0xa')](function(_0x191c46){logger[_0x25a5('0x7')](_0x25a5('0x5'),_0x25a5('0x6'),_0x2f17d9,_0x191c46,_0x2fc1db);return _0x1d9132(_0x191c46);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b1a52fa..378a0ea 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 _0x6363=['refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','getMailAccounts','initMailAccounts'];(function(_0x3bccf3,_0x216a1){var _0xdcfec3=function(_0x5bdc82){while(--_0x5bdc82){_0x3bccf3['push'](_0x3bccf3['shift']());}};_0xdcfec3(++_0x216a1);}(_0x6363,0x13a));var _0x3636=function(_0x1cbd31,_0x4b8178){_0x1cbd31=_0x1cbd31-0x0;var _0x18d42c=_0x6363[_0x1cbd31];return _0x18d42c;};'use strict';var BPromise=require(_0x3636('0x0'));var server=require('./server');var Realtime=require(_0x3636('0x1'));var EmailChannel=require(_0x3636('0x2'));var mailAccount=require(_0x3636('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x3636('0x4'))['db'];function initRealtime(){return BPromise[_0x3636('0x5')]()[_0x3636('0x6')](mailAccount[_0x3636('0x7')]())[_0x3636('0x6')](realtime[_0x3636('0x8')]())[_0x3636('0x6')](function(){email[_0x3636('0x9')](realtime[_0x3636('0xa')]);return realtime;});}function main(){return server[_0x3636('0xb')](realtime,email)[_0x3636('0x6')](function(_0x583dec){return initRealtime();})[_0x3636('0x6')](function(_0x47f84e){return db[_0x3636('0xc')][_0x3636('0xd')]({'attributes':['id',_0x3636('0xe')],'raw':!![]});})[_0x3636('0x6')](function(_0x1a6c8d){return setInterval(initRealtime,_0x1a6c8d[_0x3636('0xe')]*0x3e8);})[_0x3636('0xf')](function(_0x2d9755){console[_0x3636('0x10')](_0x2d9755);});}main(); \ No newline at end of file +var _0x4351=['../../mysqldb','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount'];(function(_0x48e697,_0x3d43d3){var _0x3a6f5f=function(_0x209597){while(--_0x209597){_0x48e697['push'](_0x48e697['shift']());}};_0x3a6f5f(++_0x3d43d3);}(_0x4351,0x1b5));var _0x1435=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x4351[_0x4e9628];return _0x27bc8c;};'use strict';var BPromise=require(_0x1435('0x0'));var server=require(_0x1435('0x1'));var Realtime=require(_0x1435('0x2'));var EmailChannel=require(_0x1435('0x3'));var mailAccount=require(_0x1435('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x1435('0x5'))['db'];function initRealtime(){return BPromise[_0x1435('0x6')]()[_0x1435('0x7')](mailAccount[_0x1435('0x8')]())[_0x1435('0x7')](realtime[_0x1435('0x9')]())[_0x1435('0x7')](function(){email[_0x1435('0xa')](realtime[_0x1435('0xb')]);return realtime;});}function main(){return server[_0x1435('0xc')](realtime,email)['then'](function(_0x10760d){return initRealtime();})['then'](function(_0x4d04c7){return db[_0x1435('0xd')][_0x1435('0xe')]({'attributes':['id',_0x1435('0xf')],'raw':!![]});})[_0x1435('0x7')](function(_0xade491){return setInterval(initRealtime,_0xade491['loginMailFrequency']*0x3e8);})[_0x1435('0x10')](function(_0x3aafce){console['log'](_0x3aafce);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 2192cc6..9b47bde 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 _0x33c8=['socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','emit','name','key','active','Imap','status','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','imapAccounts','email','box','handleImapBox','bind','handleImapEmail','end','error','handleImapError','connected','messageStatus','total','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','info','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','Smtp','verify','verified','moment','bluebird','md5','ioredis','../../../config/logger','defaults','redis','localhost'];(function(_0x4f6d08,_0x1b3dd0){var _0x53a9c6=function(_0x2e0e0f){while(--_0x2e0e0f){_0x4f6d08['push'](_0x4f6d08['shift']());}};_0x53a9c6(++_0x1b3dd0);}(_0x33c8,0xd0));var _0x833c=function(_0x3cce6d,_0x19a3f6){_0x3cce6d=_0x3cce6d-0x0;var _0x44d6e2=_0x33c8[_0x3cce6d];return _0x44d6e2;};'use strict';var _=require('lodash');var moment=require(_0x833c('0x0'));var BPromise=require(_0x833c('0x1'));var md5=require(_0x833c('0x2'));var Redis=require(_0x833c('0x3'));var config=require('../../../config/environment');var logger=require(_0x833c('0x4'))('email');config['redis']=_[_0x833c('0x5')](config[_0x833c('0x6')],{'host':_0x833c('0x7'),'port':0x18eb});var io=require(_0x833c('0x8'))(new Redis(config[_0x833c('0x6')]));var EmailImap=require(_0x833c('0x9'));var EmailSmtp=require(_0x833c('0xa'));var mailAccount=require(_0x833c('0xb'));var md5Accounts={};function EmailChannel(_0x735d47){logger['info'](_0x833c('0xc'));this[_0x833c('0xd')]=_0x735d47[_0x833c('0xd')];this['imapAccounts']={};this[_0x833c('0xe')]=new EmailSmtp();}EmailChannel['prototype'][_0x833c('0xf')]=function(_0x4fd160){var _0x13e827=this[_0x833c('0xd')][_0x4fd160];var _0x509f4d={'id':_0x13e827['id'],'name':_0x13e827[_0x833c('0x10')],'key':_0x13e827[_0x833c('0x11')],'active':_0x13e827[_0x833c('0x12')],'Imap':{'status':_0x13e827[_0x833c('0x13')][_0x833c('0x14')],'messageStatus':_0x13e827['Imap']['messageStatus'],'total':_0x13e827[_0x833c('0x13')]['total']}};if(_[_0x833c('0x15')](md5Accounts[_0x4fd160])){md5Accounts[_0x4fd160]={};}var _0x1410f9=md5(JSON[_0x833c('0x16')](_0x509f4d));if(md5Accounts[_0x4fd160][_0x833c('0x2')]!==_0x1410f9){md5Accounts[_0x4fd160][_0x833c('0x2')]=_0x1410f9;io[_0x833c('0xf')](_0x833c('0x17'),_0x509f4d);}};EmailChannel[_0x833c('0x18')][_0x833c('0x19')]=function(_0x13c6ab){for(var _0x46f18e in _0x13c6ab){if(_0x13c6ab[_0x833c('0x1a')](_0x46f18e)){if(_0x13c6ab[_0x46f18e][_0x833c('0x13')]&&_0x13c6ab[_0x46f18e][_0x833c('0x12')]){var _0x73c240=_0x13c6ab[_0x46f18e][_0x833c('0x13')];if(!this[_0x833c('0x1b')]['hasOwnProperty'](_0x73c240['id'])){this[_0x833c('0x1b')][_0x73c240['id']]=new EmailImap(_0x73c240,_0x13c6ab[_0x46f18e][_0x833c('0x1c')]);this[_0x833c('0x1b')][_0x73c240['id']]['on'](_0x833c('0x1d'),this[_0x833c('0x1e')][_0x833c('0x1f')](this,_0x46f18e));this['imapAccounts'][_0x73c240['id']]['on'](_0x833c('0x1c'),this[_0x833c('0x20')]['bind'](this,_0x46f18e));this['imapAccounts'][_0x73c240['id']]['on'](_0x833c('0x21'),this['handleImapEnd'][_0x833c('0x1f')](this,_0x46f18e));this[_0x833c('0x1b')][_0x73c240['id']]['on'](_0x833c('0x22'),this[_0x833c('0x23')][_0x833c('0x1f')](this,_0x46f18e));}}else{if(_[_0x833c('0x15')](this[_0x833c('0xd')][_0x46f18e][_0x833c('0x13')])){this[_0x833c('0xd')][_0x46f18e]['Imap']={};}this[_0x833c('0xd')][_0x46f18e][_0x833c('0x13')][_0x833c('0x14')]='disabled';this[_0x833c('0xd')][_0x46f18e]['Imap']['messageStatus']='';this['emit'](_0x46f18e);}}}};EmailChannel['prototype'][_0x833c('0x1e')]=function(_0x3958ad,_0x13e1a8){if(this[_0x833c('0xd')][_0x3958ad]){this[_0x833c('0xd')][_0x3958ad][_0x833c('0x13')]['status']=_0x833c('0x24');this[_0x833c('0xd')][_0x3958ad][_0x833c('0x13')][_0x833c('0x25')]=_0x13e1a8[_0x833c('0x10')];if(_0x13e1a8['messages']){this['mailAccounts'][_0x3958ad]['Imap'][_0x833c('0x26')]=_0x13e1a8[_0x833c('0x27')][_0x833c('0x26')];}return this[_0x833c('0xf')](_0x3958ad);}};EmailChannel[_0x833c('0x18')][_0x833c('0x20')]=function(_0x57d949,_0x13401c){logger['info'](_0x833c('0x28'),_0x13401c[_0x833c('0x29')],_0x13401c[_0x833c('0x2a')],_0x13401c[_0x833c('0x2b')],_0x57d949);if(this[_0x833c('0xd')][_0x57d949]){return mailAccount['notify'](_0x57d949,_0x13401c)[_0x833c('0x2c')](function(_0x4cc7ba){if(_0x4cc7ba){logger[_0x833c('0x2d')](_0x833c('0x2e'));}})[_0x833c('0x2f')](function(_0x573009){logger[_0x833c('0x22')](_0x833c('0x30'),JSON[_0x833c('0x16')](_0x573009));});}};EmailChannel[_0x833c('0x18')][_0x833c('0x31')]=function(_0x5ed90e){if(this[_0x833c('0xd')][_0x5ed90e]&&this[_0x833c('0xd')][_0x5ed90e][_0x833c('0x13')]){if(this[_0x833c('0x1b')][this[_0x833c('0xd')][_0x5ed90e][_0x833c('0x13')]['id']]){delete this['imapAccounts'][this['mailAccounts'][_0x5ed90e][_0x833c('0x13')]['id']];}this[_0x833c('0xd')][_0x5ed90e][_0x833c('0x13')][_0x833c('0x32')]=moment();this['emit'](_0x5ed90e);}};EmailChannel[_0x833c('0x18')][_0x833c('0x23')]=function(_0x56e241,_0x5e1fed){if(this['mailAccounts'][_0x56e241]){this[_0x833c('0xd')][_0x56e241]['Imap'][_0x833c('0x14')]=_0x833c('0x22');this[_0x833c('0xd')][_0x56e241][_0x833c('0x13')][_0x833c('0x25')]=_0x5e1fed;return this[_0x833c('0xf')](_0x56e241);}};EmailChannel['prototype']['sendMail']=function(_0x4f9493,_0x27369){return this['smtp']['send'](_0x4f9493,_0x27369);};EmailChannel[_0x833c('0x18')]['verifySmtp']=function(_0xa42359){var _0x39ac0a=this;if(this[_0x833c('0xd')][_0xa42359['id']]){if(_[_0x833c('0x15')](this[_0x833c('0xd')][_0xa42359['id']][_0x833c('0x33')])){this['mailAccounts'][_0xa42359['id']]['Smtp']={};}this['mailAccounts'][_0xa42359['id']][_0x833c('0x33')][_0x833c('0x32')]=moment();return new BPromise(function(_0x1d390a,_0x5ed250){return _0x39ac0a['smtp'][_0x833c('0x34')](_0xa42359)['then'](function(_0x4cb75c){_0x39ac0a[_0x833c('0xd')][_0xa42359['id']][_0x833c('0x33')][_0x833c('0x14')]=_0x833c('0x35');_0x39ac0a[_0x833c('0xd')][_0xa42359['id']]['Smtp'][_0x833c('0x25')]='';_0x39ac0a[_0x833c('0xf')](_0xa42359['id']);_0x1d390a(_0x4cb75c);})[_0x833c('0x2f')](function(_0x50bf2b){_0x39ac0a[_0x833c('0xd')][_0xa42359['id']][_0x833c('0x33')]['status']=_0x833c('0x22');_0x39ac0a[_0x833c('0xd')][_0xa42359['id']][_0x833c('0x33')][_0x833c('0x25')]=_0x50bf2b;_0x39ac0a[_0x833c('0xf')](_0xa42359['id']);_0x5ed250(_0x50bf2b);});});}return this[_0x833c('0xe')][_0x833c('0x34')](_0xa42359);};module['exports']=EmailChannel; \ No newline at end of file +var _0x4c0b=['emit','mailAccount:update','active','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','disabled','total','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','verifySmtp','Smtp','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','key','Imap','status','messageStatus','isNil'];(function(_0x4e5ab4,_0x2a8463){var _0x4f6be8=function(_0x158b42){while(--_0x158b42){_0x4e5ab4['push'](_0x4e5ab4['shift']());}};_0x4f6be8(++_0x2a8463);}(_0x4c0b,0x14e));var _0xb4c0=function(_0x18f129,_0x4db6b1){_0x18f129=_0x18f129-0x0;var _0x5de23d=_0x4c0b[_0x18f129];return _0x5de23d;};'use strict';var _=require(_0xb4c0('0x0'));var moment=require(_0xb4c0('0x1'));var BPromise=require(_0xb4c0('0x2'));var md5=require(_0xb4c0('0x3'));var Redis=require(_0xb4c0('0x4'));var config=require(_0xb4c0('0x5'));var logger=require('../../../config/logger')(_0xb4c0('0x6'));config[_0xb4c0('0x7')]=_[_0xb4c0('0x8')](config[_0xb4c0('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xb4c0('0x9'))(new Redis(config[_0xb4c0('0x7')]));var EmailImap=require(_0xb4c0('0xa'));var EmailSmtp=require(_0xb4c0('0xb'));var mailAccount=require(_0xb4c0('0xc'));var md5Accounts={};function EmailChannel(_0x17fab5){logger[_0xb4c0('0xd')]('start\x20email\x20channel');this[_0xb4c0('0xe')]=_0x17fab5[_0xb4c0('0xe')];this[_0xb4c0('0xf')]={};this[_0xb4c0('0x10')]=new EmailSmtp();}EmailChannel[_0xb4c0('0x11')]['emit']=function(_0x5558d2){var _0x2c0140=this['mailAccounts'][_0x5558d2];var _0x27421b={'id':_0x2c0140['id'],'name':_0x2c0140['name'],'key':_0x2c0140[_0xb4c0('0x12')],'active':_0x2c0140['active'],'Imap':{'status':_0x2c0140[_0xb4c0('0x13')][_0xb4c0('0x14')],'messageStatus':_0x2c0140[_0xb4c0('0x13')][_0xb4c0('0x15')],'total':_0x2c0140['Imap']['total']}};if(_[_0xb4c0('0x16')](md5Accounts[_0x5558d2])){md5Accounts[_0x5558d2]={};}var _0x1aca55=md5(JSON['stringify'](_0x27421b));if(md5Accounts[_0x5558d2][_0xb4c0('0x3')]!==_0x1aca55){md5Accounts[_0x5558d2]['md5']=_0x1aca55;io[_0xb4c0('0x17')](_0xb4c0('0x18'),_0x27421b);}};EmailChannel[_0xb4c0('0x11')]['refresh']=function(_0x499601){for(var _0x46591c in _0x499601){if(_0x499601['hasOwnProperty'](_0x46591c)){if(_0x499601[_0x46591c]['Imap']&&_0x499601[_0x46591c][_0xb4c0('0x19')]){var _0x1bf7bf=_0x499601[_0x46591c][_0xb4c0('0x13')];if(!this[_0xb4c0('0xf')][_0xb4c0('0x1a')](_0x1bf7bf['id'])){this[_0xb4c0('0xf')][_0x1bf7bf['id']]=new EmailImap(_0x1bf7bf,_0x499601[_0x46591c][_0xb4c0('0x6')]);this['imapAccounts'][_0x1bf7bf['id']]['on'](_0xb4c0('0x1b'),this[_0xb4c0('0x1c')][_0xb4c0('0x1d')](this,_0x46591c));this[_0xb4c0('0xf')][_0x1bf7bf['id']]['on'](_0xb4c0('0x6'),this[_0xb4c0('0x1e')][_0xb4c0('0x1d')](this,_0x46591c));this[_0xb4c0('0xf')][_0x1bf7bf['id']]['on'](_0xb4c0('0x1f'),this[_0xb4c0('0x20')][_0xb4c0('0x1d')](this,_0x46591c));this[_0xb4c0('0xf')][_0x1bf7bf['id']]['on'](_0xb4c0('0x21'),this[_0xb4c0('0x22')][_0xb4c0('0x1d')](this,_0x46591c));}}else{if(_[_0xb4c0('0x16')](this[_0xb4c0('0xe')][_0x46591c][_0xb4c0('0x13')])){this[_0xb4c0('0xe')][_0x46591c][_0xb4c0('0x13')]={};}this[_0xb4c0('0xe')][_0x46591c][_0xb4c0('0x13')][_0xb4c0('0x14')]=_0xb4c0('0x23');this[_0xb4c0('0xe')][_0x46591c][_0xb4c0('0x13')][_0xb4c0('0x15')]='';this[_0xb4c0('0x17')](_0x46591c);}}}};EmailChannel[_0xb4c0('0x11')][_0xb4c0('0x1c')]=function(_0x7c01bb,_0x1a4412){if(this[_0xb4c0('0xe')][_0x7c01bb]){this['mailAccounts'][_0x7c01bb][_0xb4c0('0x13')]['status']='connected';this[_0xb4c0('0xe')][_0x7c01bb][_0xb4c0('0x13')][_0xb4c0('0x15')]=_0x1a4412['name'];if(_0x1a4412['messages']){this[_0xb4c0('0xe')][_0x7c01bb][_0xb4c0('0x13')]['total']=_0x1a4412['messages'][_0xb4c0('0x24')];}return this[_0xb4c0('0x17')](_0x7c01bb);}};EmailChannel['prototype'][_0xb4c0('0x1e')]=function(_0x5383bc,_0x42f787){logger[_0xb4c0('0xd')](_0xb4c0('0x25'),_0x42f787[_0xb4c0('0x26')],_0x42f787['lastName'],_0x42f787['from'],_0x5383bc);if(this[_0xb4c0('0xe')][_0x5383bc]){return mailAccount['notify'](_0x5383bc,_0x42f787)[_0xb4c0('0x27')](function(_0x387f6f){if(_0x387f6f){logger['info'](_0xb4c0('0x28'));}})[_0xb4c0('0x29')](function(_0x39a287){logger['error'](_0xb4c0('0x2a'),JSON[_0xb4c0('0x2b')](_0x39a287));});}};EmailChannel[_0xb4c0('0x11')][_0xb4c0('0x20')]=function(_0x1dcfa){if(this[_0xb4c0('0xe')][_0x1dcfa]&&this[_0xb4c0('0xe')][_0x1dcfa][_0xb4c0('0x13')]){if(this[_0xb4c0('0xf')][this[_0xb4c0('0xe')][_0x1dcfa][_0xb4c0('0x13')]['id']]){delete this[_0xb4c0('0xf')][this[_0xb4c0('0xe')][_0x1dcfa][_0xb4c0('0x13')]['id']];}this[_0xb4c0('0xe')][_0x1dcfa][_0xb4c0('0x13')][_0xb4c0('0x2c')]=moment();this[_0xb4c0('0x17')](_0x1dcfa);}};EmailChannel[_0xb4c0('0x11')][_0xb4c0('0x22')]=function(_0x183536,_0x7a004c){if(this['mailAccounts'][_0x183536]){this['mailAccounts'][_0x183536][_0xb4c0('0x13')]['status']='error';this[_0xb4c0('0xe')][_0x183536][_0xb4c0('0x13')][_0xb4c0('0x15')]=_0x7a004c;return this[_0xb4c0('0x17')](_0x183536);}};EmailChannel['prototype'][_0xb4c0('0x2d')]=function(_0x437488,_0x1844fa){return this[_0xb4c0('0x10')]['send'](_0x437488,_0x1844fa);};EmailChannel['prototype'][_0xb4c0('0x2e')]=function(_0x497717){var _0x7c93b8=this;if(this['mailAccounts'][_0x497717['id']]){if(_[_0xb4c0('0x16')](this['mailAccounts'][_0x497717['id']]['Smtp'])){this[_0xb4c0('0xe')][_0x497717['id']]['Smtp']={};}this[_0xb4c0('0xe')][_0x497717['id']]['Smtp'][_0xb4c0('0x2c')]=moment();return new BPromise(function(_0x3cfe3c,_0x594211){return _0x7c93b8[_0xb4c0('0x10')]['verify'](_0x497717)[_0xb4c0('0x27')](function(_0x1e905e){_0x7c93b8[_0xb4c0('0xe')][_0x497717['id']][_0xb4c0('0x2f')][_0xb4c0('0x14')]=_0xb4c0('0x30');_0x7c93b8[_0xb4c0('0xe')][_0x497717['id']][_0xb4c0('0x2f')][_0xb4c0('0x15')]='';_0x7c93b8['emit'](_0x497717['id']);_0x3cfe3c(_0x1e905e);})[_0xb4c0('0x29')](function(_0x32a305){_0x7c93b8[_0xb4c0('0xe')][_0x497717['id']][_0xb4c0('0x2f')][_0xb4c0('0x14')]='error';_0x7c93b8[_0xb4c0('0xe')][_0x497717['id']][_0xb4c0('0x2f')][_0xb4c0('0x15')]=_0x32a305;_0x7c93b8[_0xb4c0('0x17')](_0x497717['id']);_0x594211(_0x32a305);});});}return this[_0xb4c0('0x10')][_0xb4c0('0x31')](_0x497717);};module[_0xb4c0('0x32')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index bb2f86f..6efdadb 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 _0x35b1=['length','fetch','handleFetchError','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','emit','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','imap','once','ready','bind','end','handleEnd','error','connect','connTimeout','authTimeout','isNil','service','authentication','user','host','port','tls','required','password','getHost','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen'];(function(_0xfeb39,_0x1d20b7){var _0x167aa8=function(_0x54b506){while(--_0x54b506){_0xfeb39['push'](_0xfeb39['shift']());}};_0x167aa8(++_0x1d20b7);}(_0x35b1,0x111));var _0x135b=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x35b1[_0x2a67fe];return _0x57e726;};'use strict';var fs=require('fs');var path=require(_0x135b('0x0'));var util=require(_0x135b('0x1'));var Imap=require('imap');var _=require(_0x135b('0x2'));var rs=require(_0x135b('0x3'));var simpleParser=require('mailparser')[_0x135b('0x4')];var Iconv=require(_0x135b('0x5'))[_0x135b('0x6')];var EventEmitter=require(_0x135b('0x7'))[_0x135b('0x8')];var utils=require('./utils');var logger=require(_0x135b('0x9'))(_0x135b('0xa'));function EmailImap(_0x399e90,_0x1ad75d){this[_0x135b('0xb')]=_0x135b('0xc');this[_0x135b('0xd')]=this[_0x135b('0xe')](_0x399e90,_0x1ad75d);this[_0x135b('0xf')]=new Imap(this[_0x135b('0xd')]);this[_0x135b('0xf')][_0x135b('0x10')](_0x135b('0x11'),this['handleReady'][_0x135b('0x12')](this));this[_0x135b('0xf')][_0x135b('0x10')](_0x135b('0x13'),this[_0x135b('0x14')][_0x135b('0x12')](this));this['imap']['on'](_0x135b('0x15'),this['handleError'][_0x135b('0x12')](this));this[_0x135b('0xf')][_0x135b('0x16')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x4e36db,_0x3ae1cb){var _0x5b8bf4={'connTimeout':_0x4e36db[_0x135b('0x17')]?_0x4e36db[_0x135b('0x17')]*0x3e8:0x2710,'authTimeout':_0x4e36db[_0x135b('0x18')]?_0x4e36db['authTimeout']*0x3e8:0x1388};if(_[_0x135b('0x19')](_0x4e36db[_0x135b('0x1a')])){if(_0x4e36db[_0x135b('0x1b')]){_0x5b8bf4[_0x135b('0x1c')]=_0x4e36db[_0x135b('0x1c')];_0x5b8bf4['password']=_0x4e36db['password'];}_0x5b8bf4[_0x135b('0x1d')]=_0x4e36db[_0x135b('0x1d')];_0x5b8bf4[_0x135b('0x1e')]=_0x4e36db[_0x135b('0x1e')]||0x3e1;if(_0x4e36db['tls']){_0x5b8bf4[_0x135b('0x1f')]=!![];}else{_0x5b8bf4[_0x135b('0x1f')]=![];_0x5b8bf4['autotls']=_0x135b('0x20');}}else{_0x5b8bf4[_0x135b('0x1c')]=_0x4e36db['user'];_0x5b8bf4[_0x135b('0x21')]=_0x4e36db['password'];_0x5b8bf4['host']=utils[_0x135b('0x22')](_0x4e36db[_0x135b('0x1a')]);_0x5b8bf4[_0x135b('0x1e')]=0x3e1;_0x5b8bf4[_0x135b('0x1f')]=!![];}_0x5b8bf4[_0x135b('0xa')]=_0x3ae1cb||_0x4e36db[_0x135b('0x1c')]||_0x135b('0x23');return _0x5b8bf4;};EmailImap[_0x135b('0x24')][_0x135b('0x25')]=function(){this[_0x135b('0xf')][_0x135b('0x26')](this[_0x135b('0xb')],![],this[_0x135b('0x27')][_0x135b('0x12')](this));};EmailImap[_0x135b('0x24')][_0x135b('0x27')]=function(_0x58a7aa,_0x2a1464){if(_0x58a7aa){this[_0x135b('0x28')](_0x58a7aa,!![]);}else{this['emit'](_0x135b('0x29'),_0x2a1464);this[_0x135b('0x2a')]();}};EmailImap[_0x135b('0x24')][_0x135b('0x2b')]=function(_0x507c6e){if(_0x507c6e){this[_0x135b('0x28')](_0x507c6e,!![]);}else{this[_0x135b('0xf')][_0x135b('0x13')]();}};EmailImap[_0x135b('0x24')][_0x135b('0x2a')]=function(){this[_0x135b('0xf')][_0x135b('0x2c')]([_0x135b('0x2d')],this[_0x135b('0x2e')][_0x135b('0x12')](this));};EmailImap[_0x135b('0x24')][_0x135b('0x2e')]=function(_0x376433,_0x51cb6b){if(_0x376433){this[_0x135b('0x28')](_0x376433,!![]);}else{if(_0x51cb6b[_0x135b('0x2f')]){try{var _0x19d4c3=this[_0x135b('0xf')][_0x135b('0x30')](_0x51cb6b,{'bodies':'','markSeen':!![]});_0x19d4c3['on']('message',this['handleFetchMessage']['bind'](this));_0x19d4c3[_0x135b('0x10')](_0x135b('0x15'),this[_0x135b('0x31')][_0x135b('0x12')](this));_0x19d4c3[_0x135b('0x10')]('end',this['handleFetchEnd']['bind'](this));}catch(_0x2ce8ed){logger['error'](_0x2ce8ed);}}else{this[_0x135b('0xf')][_0x135b('0x32')](!![],this['handleCloseBox'][_0x135b('0x12')](this));}}};EmailImap['prototype'][_0x135b('0x33')]=function(_0x579b83,_0xbb0d1c){_0x579b83['on']('body',this[_0x135b('0x34')][_0x135b('0x12')](this));_0x579b83[_0x135b('0x10')](_0x135b('0x35'),this[_0x135b('0x36')][_0x135b('0x12')](this));_0x579b83['once'](_0x135b('0x13'),this['handleMessageEnd']['bind'](this));};EmailImap[_0x135b('0x24')][_0x135b('0x34')]=function(_0x1d5c45,_0x576668){simpleParser(_0x1d5c45,{'Iconv':Iconv},this[_0x135b('0x37')][_0x135b('0x12')](this));};EmailImap[_0x135b('0x24')]['handleMessageAttributes']=function(_0x119c1a){};EmailImap[_0x135b('0x24')]['handleMessageEnd']=function(){};EmailImap[_0x135b('0x24')][_0x135b('0x37')]=function(_0x59cdcb,_0x2c189a){if(_0x59cdcb){logger[_0x135b('0x15')](_0x59cdcb);}else{var _0x30cd25=this;utils[_0x135b('0x38')](this[_0x135b('0xd')],_0x2c189a,function(_0x4f18f1){_0x30cd25[_0x135b('0x39')]('email',_0x4f18f1);});}};EmailImap['prototype'][_0x135b('0x3a')]=function(){this['imap']['closeBox'](!![],this[_0x135b('0x2b')]['bind'](this));};EmailImap[_0x135b('0x24')][_0x135b('0x31')]=function(_0x4a0c1b){this[_0x135b('0x28')](_0x4a0c1b);this['imap'][_0x135b('0x32')](!![],this[_0x135b('0x2b')][_0x135b('0x12')](this));};EmailImap[_0x135b('0x24')]['handleEnd']=function(){this['emit'](_0x135b('0x13'));};EmailImap['prototype'][_0x135b('0x28')]=function(_0x411276,_0x5b2bc4){logger[_0x135b('0x15')](_0x135b('0x28'),this[_0x135b('0xd')][_0x135b('0xa')],JSON[_0x135b('0x3b')](_0x411276));var _0x38216f='';if(_0x411276){if(_0x411276[_0x135b('0x3c')]){_0x38216f=_0x411276[_0x135b('0x3c')];}else{for(var _0x575644 in _0x411276){if(_0x411276[_0x135b('0x3d')](_0x575644)){_0x38216f+=_[_0x135b('0x3e')](_0x575644)+':\x20'+_0x411276[_0x575644]+'\x0a';}}}}if(_0x5b2bc4){this[_0x135b('0xf')][_0x135b('0x13')]();}else{this[_0x135b('0x39')](_0x135b('0x15'),_0x38216f);this[_0x135b('0x39')]('end');}};module[_0x135b('0x3f')]=EmailImap; \ No newline at end of file +var _0x4a4f=['util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','bind','once','end','handleEnd','error','handleError','connect','inherits','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleReady','handleOpenBox','emit','box','readUnseen','prototype','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','closeBox','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','handleMessageAttributes','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path'];(function(_0x1bd106,_0x29dcbe){var _0x231dbb=function(_0x3638d7){while(--_0x3638d7){_0x1bd106['push'](_0x1bd106['shift']());}};_0x231dbb(++_0x29dcbe);}(_0x4a4f,0xc2));var _0xf4a4=function(_0x216849,_0x594806){_0x216849=_0x216849-0x0;var _0x4359b6=_0x4a4f[_0x216849];return _0x4359b6;};'use strict';var fs=require('fs');var path=require(_0xf4a4('0x0'));var util=require(_0xf4a4('0x1'));var Imap=require(_0xf4a4('0x2'));var _=require(_0xf4a4('0x3'));var rs=require(_0xf4a4('0x4'));var simpleParser=require(_0xf4a4('0x5'))[_0xf4a4('0x6')];var Iconv=require(_0xf4a4('0x7'))['Iconv'];var EventEmitter=require(_0xf4a4('0x8'))['EventEmitter'];var utils=require(_0xf4a4('0x9'));var logger=require(_0xf4a4('0xa'))(_0xf4a4('0xb'));function EmailImap(_0x2b6d2b,_0x2a4503){this[_0xf4a4('0xc')]=_0xf4a4('0xd');this[_0xf4a4('0xe')]=this[_0xf4a4('0xf')](_0x2b6d2b,_0x2a4503);this[_0xf4a4('0x2')]=new Imap(this[_0xf4a4('0xe')]);this['imap']['once']('ready',this['handleReady'][_0xf4a4('0x10')](this));this[_0xf4a4('0x2')][_0xf4a4('0x11')](_0xf4a4('0x12'),this[_0xf4a4('0x13')][_0xf4a4('0x10')](this));this['imap']['on'](_0xf4a4('0x14'),this[_0xf4a4('0x15')][_0xf4a4('0x10')](this));this[_0xf4a4('0x2')][_0xf4a4('0x16')]();}util[_0xf4a4('0x17')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf4a4('0xf')]=function(_0x185761,_0x52ef02){var _0x1542b5={'connTimeout':_0x185761['connTimeout']?_0x185761[_0xf4a4('0x18')]*0x3e8:0x2710,'authTimeout':_0x185761['authTimeout']?_0x185761[_0xf4a4('0x19')]*0x3e8:0x1388};if(_[_0xf4a4('0x1a')](_0x185761[_0xf4a4('0x1b')])){if(_0x185761[_0xf4a4('0x1c')]){_0x1542b5[_0xf4a4('0x1d')]=_0x185761[_0xf4a4('0x1d')];_0x1542b5[_0xf4a4('0x1e')]=_0x185761[_0xf4a4('0x1e')];}_0x1542b5['host']=_0x185761[_0xf4a4('0x1f')];_0x1542b5[_0xf4a4('0x20')]=_0x185761[_0xf4a4('0x20')]||0x3e1;if(_0x185761[_0xf4a4('0x21')]){_0x1542b5[_0xf4a4('0x21')]=!![];}else{_0x1542b5[_0xf4a4('0x21')]=![];_0x1542b5[_0xf4a4('0x22')]=_0xf4a4('0x23');}}else{_0x1542b5['user']=_0x185761[_0xf4a4('0x1d')];_0x1542b5['password']=_0x185761[_0xf4a4('0x1e')];_0x1542b5['host']=utils[_0xf4a4('0x24')](_0x185761['service']);_0x1542b5[_0xf4a4('0x20')]=0x3e1;_0x1542b5[_0xf4a4('0x21')]=!![];}_0x1542b5[_0xf4a4('0xb')]=_0x52ef02||_0x185761[_0xf4a4('0x1d')]||_0xf4a4('0x25');return _0x1542b5;};EmailImap['prototype'][_0xf4a4('0x26')]=function(){this[_0xf4a4('0x2')]['openBox'](this[_0xf4a4('0xc')],![],this['handleOpenBox'][_0xf4a4('0x10')](this));};EmailImap['prototype'][_0xf4a4('0x27')]=function(_0xff3b32,_0x403d58){if(_0xff3b32){this['handleError'](_0xff3b32,!![]);}else{this[_0xf4a4('0x28')](_0xf4a4('0x29'),_0x403d58);this[_0xf4a4('0x2a')]();}};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x2c')]=function(_0x124e47){if(_0x124e47){this[_0xf4a4('0x15')](_0x124e47,!![]);}else{this[_0xf4a4('0x2')][_0xf4a4('0x12')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0xf4a4('0x2')][_0xf4a4('0x2d')]([_0xf4a4('0x2e')],this[_0xf4a4('0x2f')][_0xf4a4('0x10')](this));};EmailImap[_0xf4a4('0x2b')]['handleReadUnseen']=function(_0x522cbe,_0x3d257b){if(_0x522cbe){this[_0xf4a4('0x15')](_0x522cbe,!![]);}else{if(_0x3d257b[_0xf4a4('0x30')]){try{var _0x2c584d=this[_0xf4a4('0x2')]['fetch'](_0x3d257b,{'bodies':'','markSeen':!![]});_0x2c584d['on'](_0xf4a4('0x31'),this[_0xf4a4('0x32')][_0xf4a4('0x10')](this));_0x2c584d['once'](_0xf4a4('0x14'),this['handleFetchError']['bind'](this));_0x2c584d[_0xf4a4('0x11')]('end',this['handleFetchEnd']['bind'](this));}catch(_0x402c12){logger[_0xf4a4('0x14')](_0x402c12);}}else{this[_0xf4a4('0x2')][_0xf4a4('0x33')](!![],this[_0xf4a4('0x2c')][_0xf4a4('0x10')](this));}}};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x32')]=function(_0x372250,_0x1a74da){_0x372250['on'](_0xf4a4('0x34'),this['handleMessageBody']['bind'](this));_0x372250[_0xf4a4('0x11')](_0xf4a4('0x35'),this['handleMessageAttributes']['bind'](this));_0x372250[_0xf4a4('0x11')](_0xf4a4('0x12'),this[_0xf4a4('0x36')][_0xf4a4('0x10')](this));};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x37')]=function(_0x45987c,_0x5546fd){simpleParser(_0x45987c,{'Iconv':Iconv},this[_0xf4a4('0x38')]['bind'](this));};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x39')]=function(_0x408ba0){};EmailImap['prototype'][_0xf4a4('0x36')]=function(){};EmailImap['prototype'][_0xf4a4('0x38')]=function(_0x541b8c,_0x465b69){if(_0x541b8c){logger[_0xf4a4('0x14')](_0x541b8c);}else{var _0x58fd0a=this;utils[_0xf4a4('0x3a')](this[_0xf4a4('0xe')],_0x465b69,function(_0x22b154){_0x58fd0a['emit']('email',_0x22b154);});}};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x3b')]=function(){this[_0xf4a4('0x2')][_0xf4a4('0x33')](!![],this[_0xf4a4('0x2c')][_0xf4a4('0x10')](this));};EmailImap[_0xf4a4('0x2b')]['handleFetchError']=function(_0x559cf2){this[_0xf4a4('0x15')](_0x559cf2);this['imap'][_0xf4a4('0x33')](!![],this[_0xf4a4('0x2c')]['bind'](this));};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x13')]=function(){this['emit']('end');};EmailImap[_0xf4a4('0x2b')][_0xf4a4('0x15')]=function(_0x18f2fa,_0x4dc023){logger['error'](_0xf4a4('0x15'),this[_0xf4a4('0xe')][_0xf4a4('0xb')],JSON[_0xf4a4('0x3c')](_0x18f2fa));var _0x1d7f85='';if(_0x18f2fa){if(_0x18f2fa[_0xf4a4('0x3d')]){_0x1d7f85=_0x18f2fa[_0xf4a4('0x3d')];}else{for(var _0x540b9a in _0x18f2fa){if(_0x18f2fa[_0xf4a4('0x3e')](_0x540b9a)){_0x1d7f85+=_[_0xf4a4('0x3f')](_0x540b9a)+':\x20'+_0x18f2fa[_0x540b9a]+'\x0a';}}}}if(_0x4dc023){this[_0xf4a4('0x2')][_0xf4a4('0x12')]();}else{this[_0xf4a4('0x28')]('error',_0x1d7f85);this['emit'](_0xf4a4('0x12'));}};module[_0xf4a4('0x40')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 37faf87..4bea161 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 _0x9535=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','toString','Not\x20verifired'];(function(_0x1b32b8,_0x5deccf){var _0x3745ea=function(_0x27f4e3){while(--_0x27f4e3){_0x1b32b8['push'](_0x1b32b8['shift']());}};_0x3745ea(++_0x5deccf);}(_0x9535,0x169));var _0x5953=function(_0x1dec6f,_0x4cd498){_0x1dec6f=_0x1dec6f-0x0;var _0x807139=_0x9535[_0x1dec6f];return _0x807139;};'use strict';var nodemailer=require(_0x5953('0x0'));var BPromise=require(_0x5953('0x1'));var inlineBase64=require(_0x5953('0x2'));function EmailSmtp(){}EmailSmtp[_0x5953('0x3')]['send']=function(_0x365056,_0x499dfa){return new BPromise(function(_0x5a4147,_0x8dcbe1){var _0x4f7ad9=nodemailer[_0x5953('0x4')](_0x365056);_0x4f7ad9[_0x5953('0x5')](_0x5953('0x6'),inlineBase64());_0x4f7ad9['sendMail'](_0x499dfa,function(_0x500bda,_0x3f9c27){if(_0x500bda){_0x8dcbe1(_0x500bda[_0x5953('0x7')]());}else{_0x5a4147(_0x3f9c27);}});});};EmailSmtp[_0x5953('0x3')]['verify']=function(_0x1a2795){return new BPromise(function(_0x323412,_0x1883bb){var _0x198073=nodemailer[_0x5953('0x4')](_0x1a2795);_0x198073['verify'](function(_0x2264c5,_0x64340b){if(_0x2264c5){_0x1883bb(_0x2264c5[_0x5953('0x7')]());}else{if(_0x64340b){_0x323412(_0x64340b);}else{_0x1883bb(_0x5953('0x8'));}}});});};module[_0x5953('0x9')]=EmailSmtp; \ No newline at end of file +var _0xf79b=['createTransport','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird'];(function(_0x34cc65,_0x1afeea){var _0x25674a=function(_0x4e7206){while(--_0x4e7206){_0x34cc65['push'](_0x34cc65['shift']());}};_0x25674a(++_0x1afeea);}(_0xf79b,0x10c));var _0xbf79=function(_0x4be337,_0x1209a5){_0x4be337=_0x4be337-0x0;var _0x2871f8=_0xf79b[_0x4be337];return _0x2871f8;};'use strict';var nodemailer=require(_0xbf79('0x0'));var BPromise=require(_0xbf79('0x1'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x2b70b0,_0x54dada){return new BPromise(function(_0x43fd91,_0x31bcfc){var _0x1e998d=nodemailer[_0xbf79('0x2')](_0x2b70b0);_0x1e998d['use'](_0xbf79('0x3'),inlineBase64());_0x1e998d[_0xbf79('0x4')](_0x54dada,function(_0x40ad4b,_0x5bf228){if(_0x40ad4b){_0x31bcfc(_0x40ad4b[_0xbf79('0x5')]());}else{_0x43fd91(_0x5bf228);}});});};EmailSmtp['prototype'][_0xbf79('0x6')]=function(_0x290e87){return new BPromise(function(_0x40b39c,_0x3c6c39){var _0x2c4b65=nodemailer[_0xbf79('0x2')](_0x290e87);_0x2c4b65[_0xbf79('0x6')](function(_0x379375,_0x5d4158){if(_0x379375){_0x3c6c39(_0x379375['toString']());}else{if(_0x5d4158){_0x40b39c(_0x5d4158);}else{_0x3c6c39(_0xbf79('0x7'));}}});});};module[_0xbf79('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index f889785..25e4a40 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 _0x7447=['imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','path','util','../../../config/environment','head','address','anonymous','generate','@xcally.com','name','split','length','slice','join','Anonymous','value','pop','isEmpty','test','html','body','textAsHtml','message','originTo','email','originCc','includes','attachments','attach','type','attachment','filename','%s-%s','now','root','server/files/attachments/','writeFileSync','content','push','contentType','parser','from','messageId','format','application/ms-tnef','info','parseBuffer','first','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail'];(function(_0x10f7c9,_0x53bbcc){var _0x1fe36f=function(_0x575f90){while(--_0x575f90){_0x10f7c9['push'](_0x10f7c9['shift']());}};_0x1fe36f(++_0x53bbcc);}(_0x7447,0x1b6));var _0x7744=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x7447[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x7744('0x0'));var moment=require(_0x7744('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x7744('0x2'));var util=require(_0x7744('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')('email');var config=require(_0x7744('0x4'));function getAddress(_0x47a110){var _0x79bb74=_[_0x7744('0x5')](_0x47a110['value']);return _0x79bb74&&_0x79bb74[_0x7744('0x6')]?_0x79bb74['address']:_0x7744('0x7')+random[_0x7744('0x8')](0x6)+_0x7744('0x9');}function getFirstName(_0x3b28aa){var _0x4c5d90=_[_0x7744('0x5')](_0x3b28aa['value']);if(_0x4c5d90&&_0x4c5d90['name']){var _0x489673=_0x4c5d90[_0x7744('0xa')][_0x7744('0xb')](/\s+/);return _0x489673[_0x7744('0xc')]?_0x489673[_0x7744('0xd')](0x0,-0x1)[_0x7744('0xe')]('\x20'):_0x4c5d90[_0x7744('0xa')];}return _0x7744('0xf');}function getLastName(_0x2a420f){var _0xec4892=_[_0x7744('0x5')](_0x2a420f[_0x7744('0x10')]);if(_0xec4892&&_0xec4892[_0x7744('0xa')]){var _0x460f43=_0xec4892[_0x7744('0xa')][_0x7744('0xb')](/\s+/);return _0x460f43[_0x7744('0xc')]>0x1?_0x460f43[_0x7744('0x11')]():'';}return'';}function getMails(_0x5b664b,_0x2a51d6){var _0x3b1224='';for(var _0x578ade=0x0;_0x578ade<_0x2a51d6[_0x7744('0x10')]['length'];_0x578ade+=0x1){if(_0x2a51d6[_0x7744('0x10')][_0x578ade][_0x7744('0x6')]!==_0x5b664b){if(!_[_0x7744('0x12')](_0x3b1224)){_0x3b1224+=',';}_0x3b1224+=_0x2a51d6[_0x7744('0x10')][_0x578ade][_0x7744('0xa')]||_0x2a51d6[_0x7744('0x10')][_0x578ade][_0x7744('0x6')]||'';_0x3b1224+='\x20<';_0x3b1224+=_0x2a51d6[_0x7744('0x10')][_0x578ade][_0x7744('0x6')]?_0x2a51d6[_0x7744('0x10')][_0x578ade]['address']:'anonymous'+random[_0x7744('0x8')](0x6)+_0x7744('0x9');_0x3b1224+='>';}}return _0x3b1224;}function parseEmail(_0xda4ff7,_0x320ed0,_0x1281b1){if(_0x320ed0['html']){var _0x1e765c=/)<[^<]*)*<\/script>/gi;while(_0x1e765c[_0x7744('0x13')](_0x320ed0[_0x7744('0x14')])){_0x320ed0[_0x7744('0x14')]=_0x320ed0[_0x7744('0x14')]['replace'](_0x1e765c,'');}_0x1281b1[_0x7744('0x15')]=_0x320ed0[_0x7744('0x14')];}else{_0x1281b1['body']=_0x320ed0[_0x7744('0x16')];}if(_0x1281b1[_0x7744('0x15')]){_0x1281b1[_0x7744('0x15')]=_0x1281b1[_0x7744('0x15')]['replace'](/Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','path','util','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','split','length','slice','join','Anonymous','pop','html','test','replace','body'];(function(_0x296699,_0x1e962f){var _0x160e52=function(_0x571d72){while(--_0x571d72){_0x296699['push'](_0x296699['shift']());}};_0x160e52(++_0x1e962f);}(_0x08d5,0xa8));var _0x508d=function(_0x45e47a,_0x2e0b37){_0x45e47a=_0x45e47a-0x0;var _0x5b0492=_0x08d5[_0x45e47a];return _0x5b0492;};'use strict';var _=require('lodash');var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x508d('0x0'));var util=require(_0x508d('0x1'));var tnef=require('node-tnef');var logger=require(_0x508d('0x2'))(_0x508d('0x3'));var config=require('../../../config/environment');function getAddress(_0x1c7537){var _0x263f86=_[_0x508d('0x4')](_0x1c7537[_0x508d('0x5')]);return _0x263f86&&_0x263f86[_0x508d('0x6')]?_0x263f86['address']:_0x508d('0x7')+random[_0x508d('0x8')](0x6)+_0x508d('0x9');}function getFirstName(_0x542d22){var _0x5331c8=_[_0x508d('0x4')](_0x542d22['value']);if(_0x5331c8&&_0x5331c8[_0x508d('0xa')]){var _0x928838=_0x5331c8['name'][_0x508d('0xb')](/\s+/);return _0x928838[_0x508d('0xc')]?_0x928838[_0x508d('0xd')](0x0,-0x1)[_0x508d('0xe')]('\x20'):_0x5331c8['name'];}return _0x508d('0xf');}function getLastName(_0x19af01){var _0x1fa66d=_['head'](_0x19af01[_0x508d('0x5')]);if(_0x1fa66d&&_0x1fa66d[_0x508d('0xa')]){var _0x3eab93=_0x1fa66d[_0x508d('0xa')][_0x508d('0xb')](/\s+/);return _0x3eab93[_0x508d('0xc')]>0x1?_0x3eab93[_0x508d('0x10')]():'';}return'';}function getMails(_0xdfe234,_0x4f9dc3){var _0x12d24f='';for(var _0x1faa82=0x0;_0x1faa82<_0x4f9dc3['value'][_0x508d('0xc')];_0x1faa82+=0x1){if(_0x4f9dc3[_0x508d('0x5')][_0x1faa82][_0x508d('0x6')]!==_0xdfe234){if(!_['isEmpty'](_0x12d24f)){_0x12d24f+=',';}_0x12d24f+=_0x4f9dc3['value'][_0x1faa82]['name']||_0x4f9dc3[_0x508d('0x5')][_0x1faa82][_0x508d('0x6')]||'';_0x12d24f+='\x20<';_0x12d24f+=_0x4f9dc3[_0x508d('0x5')][_0x1faa82][_0x508d('0x6')]?_0x4f9dc3[_0x508d('0x5')][_0x1faa82][_0x508d('0x6')]:_0x508d('0x7')+random[_0x508d('0x8')](0x6)+_0x508d('0x9');_0x12d24f+='>';}}return _0x12d24f;}function parseEmail(_0x17d477,_0x398235,_0x3beec8){if(_0x398235[_0x508d('0x11')]){var _0x547234=/)<[^<]*)*<\/script>/gi;while(_0x547234[_0x508d('0x12')](_0x398235[_0x508d('0x11')])){_0x398235[_0x508d('0x11')]=_0x398235[_0x508d('0x11')][_0x508d('0x13')](_0x547234,'');}_0x3beec8[_0x508d('0x14')]=_0x398235[_0x508d('0x11')];}else{_0x3beec8['body']=_0x398235[_0x508d('0x15')];}if(_0x3beec8[_0x508d('0x14')]){_0x3beec8[_0x508d('0x14')]=_0x3beec8['body'][_0x508d('0x13')](/0x0){if(this[_0x8f311+_0xa758('0x24')]>0x0&&this[_0x8f311+'CurrentCapacity']>=this[_0x8f311+_0xa758('0x24')]){return'maxcapacity';}else{return _0xa758('0x25');}}else{return'idle';}};Agent[_0xa758('0x26')]['updateRealtime']=function(){var _0x3cf203=['mail',_0xa758('0x27'),'openchannel',_0xa758('0x28'),_0xa758('0x29'),_0xa758('0x2a')];for(var _0xd9dd6d=0x0;_0xd9dd6d<_0x3cf203[_0xa758('0x2b')];_0xd9dd6d+=0x1){var _0xef63d=this[_0xa758('0x2c')](_0x3cf203[_0xd9dd6d]);if(this[_0x3cf203[_0xd9dd6d]+_0xa758('0x2d')]!==_0xef63d){this[_0x3cf203[_0xd9dd6d]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x3cf203[_0xd9dd6d]+'Status']=_0xef63d;}var _0x30b254={'id':this['id'],'name':this[_0xa758('0x7')],'online':this['online'],'voicePause':this[_0xa758('0x8')],'chatPause':this[_0xa758('0x9')],'mailPause':this[_0xa758('0xa')],'smsPause':this[_0xa758('0x2e')],'faxPause':this[_0xa758('0xb')],'openchannelPause':this[_0xa758('0xc')],'chatStatus':this[_0xa758('0x2f')],'chatStatusTime':this[_0xa758('0xe')],'chatCapacity':this[_0xa758('0xf')],'chatCurrentCapacity':this[_0xa758('0x10')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xa758('0x30')],'mailCapacity':this[_0xa758('0x12')],'mailCurrentCapacity':this[_0xa758('0x31')],'faxStatus':this[_0xa758('0x32')],'faxStatusTime':this[_0xa758('0x13')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xa758('0x33')],'smsStatus':this[_0xa758('0x15')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xa758('0x18')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xa758('0x1a')],'whatsappCurrentCapacity':this[_0xa758('0x1b')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xa758('0x1d')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xa758('0x1f')],'busy':this[_0xa758('0x20')],'busyQueue':this[_0xa758('0x21')]};var _0x5ba0ad=md5(JSON[_0xa758('0x34')](_0x30b254));if(this[_0xa758('0x2')]!==_0x5ba0ad){this[_0xa758('0x2')]=_0x5ba0ad;io[_0xa758('0x35')](_0xa758('0x36'),_0x30b254);}};module[_0xa758('0x37')]=Agent; \ No newline at end of file +var _0xb875=['toNumber','openchannelPause','chatStatusTime','faxStatus','faxStatusTime','smsStatus','smsStatusTime','whatsappCurrentCapacity','stringify','user:save','exports','lodash','../../../config/environment','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','md5','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','prototype','updateRealtime','mail','openchannel','fax','sms','whatsapp','length','Status','StatusTime'];(function(_0x4d21ac,_0x1b4602){var _0x3ef532=function(_0x2b64df){while(--_0x2b64df){_0x4d21ac['push'](_0x4d21ac['shift']());}};_0x3ef532(++_0x1b4602);}(_0xb875,0x167));var _0x5b87=function(_0x4100fc,_0x4f1eba){_0x4100fc=_0x4100fc-0x0;var _0x55a801=_0xb875[_0x4100fc];return _0x55a801;};'use strict';var _=require(_0x5b87('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require('ioredis');var config=require(_0x5b87('0x1'));config['redis']=_[_0x5b87('0x2')](config[_0x5b87('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x5b87('0x4'))(new Redis(config[_0x5b87('0x3')]));function Agent(_0xb525e1){this['id']=_0xb525e1['id']||0x0;this[_0x5b87('0x5')]=_0xb525e1[_0x5b87('0x5')]||'';this[_0x5b87('0x6')]=_0xb525e1[_0x5b87('0x6')]||!![];this[_0x5b87('0x7')]=_0xb525e1[_0x5b87('0x7')]||![];this[_0x5b87('0x8')]=_0xb525e1['chatPause']||![];this[_0x5b87('0x9')]=_0xb525e1['mailPause']||![];this[_0x5b87('0xa')]=_0xb525e1[_0x5b87('0xa')]||![];this[_0x5b87('0xb')]=_0xb525e1[_0x5b87('0xb')]||![];this['openchannelPause']=_0xb525e1['openchannelPause']||![];this[_0x5b87('0xc')]=_0x5b87('0xd');this['chatStatusTime']=0x0;this[_0x5b87('0xe')]=_0xb525e1[_0x5b87('0xe')]||0x0;this[_0x5b87('0xf')]=0x0;this[_0x5b87('0x10')]=_0x5b87('0xd');this[_0x5b87('0x11')]=0x0;this[_0x5b87('0x12')]=_0xb525e1[_0x5b87('0x12')]||0x0;this[_0x5b87('0x13')]=0x0;this['faxStatus']=_0x5b87('0xd');this['faxStatusTime']=0x0;this[_0x5b87('0x14')]=_0xb525e1[_0x5b87('0x14')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0x5b87('0xd');this['smsStatusTime']=0x0;this[_0x5b87('0x15')]=_0xb525e1[_0x5b87('0x15')]||0x0;this[_0x5b87('0x16')]=0x0;this[_0x5b87('0x17')]=_0x5b87('0xd');this[_0x5b87('0x18')]=0x0;this[_0x5b87('0x19')]=_0xb525e1['whatsappCapacity']||0x0;this['whatsappCurrentCapacity']=0x0;this['openchannelStatus']='unknown';this[_0x5b87('0x1a')]=0x0;this[_0x5b87('0x1b')]=_0xb525e1[_0x5b87('0x1b')]||0x0;this[_0x5b87('0x1c')]=0x0;this[_0x5b87('0x1d')]=![];this['busyQueue']=undefined;this[_0x5b87('0x1e')]='';this['updateRealtime']();}Agent['prototype'][_0x5b87('0x1f')]=function(_0x10d944){if(this[_0x10d944+'CurrentCapacity']>0x0){if(this[_0x10d944+_0x5b87('0x20')]>0x0&&this[_0x10d944+_0x5b87('0x21')]>=this[_0x10d944+_0x5b87('0x20')]){return _0x5b87('0x22');}else{return _0x5b87('0x23');}}else{return _0x5b87('0x24');}};Agent[_0x5b87('0x25')][_0x5b87('0x26')]=function(){var _0x1dcaf4=[_0x5b87('0x27'),'chat',_0x5b87('0x28'),_0x5b87('0x29'),_0x5b87('0x2a'),_0x5b87('0x2b')];for(var _0x1cfb4b=0x0;_0x1cfb4b<_0x1dcaf4[_0x5b87('0x2c')];_0x1cfb4b+=0x1){var _0x2d8edf=this[_0x5b87('0x1f')](_0x1dcaf4[_0x1cfb4b]);if(this[_0x1dcaf4[_0x1cfb4b]+_0x5b87('0x2d')]!==_0x2d8edf){this[_0x1dcaf4[_0x1cfb4b]+_0x5b87('0x2e')]=_[_0x5b87('0x2f')](moment()['format']('x'));}this[_0x1dcaf4[_0x1cfb4b]+'Status']=_0x2d8edf;}var _0x1ca037={'id':this['id'],'name':this['name'],'online':this[_0x5b87('0x6')],'voicePause':this[_0x5b87('0x7')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x5b87('0xb')],'faxPause':this[_0x5b87('0xa')],'openchannelPause':this[_0x5b87('0x30')],'chatStatus':this[_0x5b87('0xc')],'chatStatusTime':this[_0x5b87('0x31')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x5b87('0xf')],'mailStatus':this[_0x5b87('0x10')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x5b87('0x12')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x5b87('0x32')],'faxStatusTime':this[_0x5b87('0x33')],'faxCapacity':this[_0x5b87('0x14')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x5b87('0x34')],'smsStatusTime':this[_0x5b87('0x35')],'smsCapacity':this[_0x5b87('0x15')],'smsCurrentCapacity':this[_0x5b87('0x16')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x5b87('0x36')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x5b87('0x1a')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x5b87('0x1c')],'busy':this[_0x5b87('0x1d')],'busyQueue':this['busyQueue']};var _0x2b9a2a=md5(JSON[_0x5b87('0x37')](_0x1ca037));if(this[_0x5b87('0x1e')]!==_0x2b9a2a){this[_0x5b87('0x1e')]=_0x2b9a2a;io['emit'](_0x5b87('0x38'),_0x1ca037);}};module[_0x5b87('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 c1dd9b5..3806ff9 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 _0x4182=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','format','emit','chat_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults'];(function(_0x47c5f9,_0x6ce1fc){var _0x172038=function(_0x143b3f){while(--_0x143b3f){_0x47c5f9['push'](_0x47c5f9['shift']());}};_0x172038(++_0x6ce1fc);}(_0x4182,0x190));var _0x2418=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x4182[_0x58547b];return _0x1d3fd2;};'use strict';var _=require(_0x2418('0x0'));var md5=require(_0x2418('0x1'));var util=require('util');var Redis=require(_0x2418('0x2'));var config=require(_0x2418('0x3'));config[_0x2418('0x4')]=_[_0x2418('0x5')](config[_0x2418('0x4')],{'host':_0x2418('0x6'),'port':0x18eb});var io=require(_0x2418('0x7'))(new Redis(config[_0x2418('0x4')]));function ChatQueue(_0x148bc3){this['id']=_0x148bc3['id']||0x0;this['name']=_0x148bc3[_0x2418('0x8')]||'';this[_0x2418('0x9')]=_0x148bc3[_0x2418('0x9')]||0xa;this[_0x2418('0xa')]=_0x148bc3[_0x2418('0xa')]||_0x2418('0xb');this[_0x2418('0xc')]=_0x148bc3['Agents'];this[_0x2418('0xd')]={};this[_0x2418('0xe')]=0x0;this[_0x2418('0x1')]='';this[_0x2418('0xf')]();this[_0x2418('0x10')]();}ChatQueue[_0x2418('0x11')][_0x2418('0xf')]=function(){var _0x45c7b6=this[_0x2418('0xd')][_0x2418('0x12')];this[_0x2418('0xd')]=_[_0x2418('0x13')](this[_0x2418('0xc')],'id');this[_0x2418('0xd')][_0x2418('0x12')]=_0x45c7b6;};ChatQueue[_0x2418('0x11')][_0x2418('0x10')]=function(){this[_0x2418('0x14')]=0x0;this[_0x2418('0x15')]=0x0;for(var _0x247e25=0x0;_0x247e25=0x0?this[_0x2418('0x18')]:0x0;var _0x559982={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2418('0x14')],'name':this[_0x2418('0x8')],'paused':this[_0x2418('0x15')],'waiting':this[_0x2418('0xe')]};var _0x1ad4eb=md5(JSON['stringify'](_0x559982));if(this[_0x2418('0x1')]!==_0x1ad4eb){this[_0x2418('0x1')]=_0x1ad4eb;io['to'](util[_0x2418('0x19')]('chat:queue:%s',_0x559982['name']))[_0x2418('0x1a')](_0x2418('0x1b'),_0x559982);}};module[_0x2418('0x1c')]=ChatQueue; \ No newline at end of file +var _0x8f3b=['waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','chatPause','available','stringify','format','emit','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId'];(function(_0x4c5708,_0x34b1f9){var _0x37fa9b=function(_0x534dc4){while(--_0x534dc4){_0x4c5708['push'](_0x4c5708['shift']());}};_0x37fa9b(++_0x34b1f9);}(_0x8f3b,0x113));var _0xb8f3=function(_0x58a8a9,_0x343311){_0x58a8a9=_0x58a8a9-0x0;var _0x3f4ca1=_0x8f3b[_0x58a8a9];return _0x3f4ca1;};'use strict';var _=require(_0xb8f3('0x0'));var md5=require(_0xb8f3('0x1'));var util=require(_0xb8f3('0x2'));var Redis=require(_0xb8f3('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0xb8f3('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xb8f3('0x5'))(new Redis(config[_0xb8f3('0x4')]));function ChatQueue(_0x4f6a3d){this['id']=_0x4f6a3d['id']||0x0;this[_0xb8f3('0x6')]=_0x4f6a3d['name']||'';this['timeout']=_0x4f6a3d['timeout']||0xa;this[_0xb8f3('0x7')]=_0x4f6a3d['strategy']||_0xb8f3('0x8');this[_0xb8f3('0x9')]=_0x4f6a3d[_0xb8f3('0x9')];this[_0xb8f3('0xa')]={};this[_0xb8f3('0xb')]=0x0;this[_0xb8f3('0x1')]='';this[_0xb8f3('0xc')]();this[_0xb8f3('0xd')]();}ChatQueue[_0xb8f3('0xe')][_0xb8f3('0xc')]=function(){var _0x1949e0=this[_0xb8f3('0xa')][_0xb8f3('0xf')];this[_0xb8f3('0xa')]=_['map'](this[_0xb8f3('0x9')],'id');this[_0xb8f3('0xa')][_0xb8f3('0xf')]=_0x1949e0;};ChatQueue[_0xb8f3('0xe')][_0xb8f3('0xd')]=function(){this[_0xb8f3('0x10')]=0x0;this[_0xb8f3('0x11')]=0x0;for(var _0x4dc5f8=0x0;_0x4dc5f8=0x0?this['available']:0x0;var _0x3c708d={'id':this['id'],'available':this[_0xb8f3('0x15')],'loggedIn':this[_0xb8f3('0x10')],'name':this['name'],'paused':this[_0xb8f3('0x11')],'waiting':this['waiting']};var _0x313853=md5(JSON[_0xb8f3('0x16')](_0x3c708d));if(this['md5']!==_0x313853){this[_0xb8f3('0x1')]=_0x313853;io['to'](util[_0xb8f3('0x17')]('chat:queue:%s',_0x3c708d[_0xb8f3('0x6')]))[_0xb8f3('0x18')]('chat_queue:save',_0x3c708d);}};module[_0xb8f3('0x19')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 51a3927..97ace39 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(_0x4ed229,_0x20a53a){var _0x3bcaf4=function(_0x3c0d6b){while(--_0x3c0d6b){_0x4ed229['push'](_0x4ed229['shift']());}};_0x3bcaf4(++_0x20a53a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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(_0xf57d07,_0x1a966b){var _0x1eabb0=function(_0xe0e574){while(--_0xe0e574){_0xf57d07['push'](_0xf57d07['shift']());}};_0x1eabb0(++_0x1a966b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 bdc4276..a64f86d 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 _0xf4a3=['exports','name','Intervals'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf4a3,0xb8));var _0x3f4a=function(_0x599f37,_0x4f6019){_0x599f37=_0x599f37-0x0;var _0x4f6bf9=_0xf4a3[_0x599f37];return _0x4f6bf9;};'use strict';function Interval(_0x304800){this['id']=_0x304800['id']||0x0;this[_0x3f4a('0x0')]=_0x304800['name']||'';this[_0x3f4a('0x1')]=_0x304800['Intervals']||{};}module[_0x3f4a('0x2')]=Interval; \ No newline at end of file +var _0x2b6c=['exports','name','Intervals'];(function(_0x3a6d5c,_0x3070c2){var _0x32dff9=function(_0x115619){while(--_0x115619){_0x3a6d5c['push'](_0x3a6d5c['shift']());}};_0x32dff9(++_0x3070c2);}(_0x2b6c,0x178));var _0xc2b6=function(_0x2ece52,_0x538ee5){_0x2ece52=_0x2ece52-0x0;var _0x585ea8=_0x2b6c[_0x2ece52];return _0x585ea8;};'use strict';function Interval(_0x2ef900){this['id']=_0x2ef900['id']||0x0;this[_0xc2b6('0x0')]=_0x2ef900[_0xc2b6('0x0')]||'';this[_0xc2b6('0x1')]=_0x2ef900[_0xc2b6('0x1')]||{};}module[_0xc2b6('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 691286b..3951211 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 _0xa208=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','mailPause','available','waiting','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','../../../config/environment'];(function(_0x524277,_0x2b0cad){var _0x2b9d18=function(_0x432ead){while(--_0x432ead){_0x524277['push'](_0x524277['shift']());}};_0x2b9d18(++_0x2b0cad);}(_0xa208,0x18f));var _0x8a20=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0xa208[_0x1e3c16];return _0x47a0c9;};'use strict';var _=require(_0x8a20('0x0'));var md5=require(_0x8a20('0x1'));var util=require(_0x8a20('0x2'));var Redis=require('ioredis');var config=require(_0x8a20('0x3'));config[_0x8a20('0x4')]=_[_0x8a20('0x5')](config['redis'],{'host':_0x8a20('0x6'),'port':0x18eb});var io=require(_0x8a20('0x7'))(new Redis(config[_0x8a20('0x4')]));function MailQueue(_0xa40cfd){this['id']=_0xa40cfd['id']||0x0;this[_0x8a20('0x8')]=_0xa40cfd[_0x8a20('0x8')]||'';this[_0x8a20('0x9')]=_0xa40cfd[_0x8a20('0x9')]||0xa;this['strategy']=_0xa40cfd[_0x8a20('0xa')]||_0x8a20('0xb');this['Agents']=_0xa40cfd[_0x8a20('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x8a20('0x1')]='';this[_0x8a20('0xd')]();this[_0x8a20('0xe')]();}MailQueue[_0x8a20('0xf')][_0x8a20('0xd')]=function(){var _0x2745c8=this[_0x8a20('0x10')][_0x8a20('0x11')];this[_0x8a20('0x10')]=_[_0x8a20('0x12')](this[_0x8a20('0xc')],'id');this[_0x8a20('0x10')]['_rr']=_0x2745c8;};MailQueue[_0x8a20('0xf')]['updateRealtime']=function(){this[_0x8a20('0x13')]=0x0;this[_0x8a20('0x14')]=0x0;for(var _0x52148e=0x0;_0x52148e=0x0?this[_0x8a20('0x17')]:0x0;var _0x551b14={'id':this['id'],'available':this[_0x8a20('0x17')],'loggedIn':this[_0x8a20('0x13')],'name':this['name'],'paused':this[_0x8a20('0x14')],'waiting':this[_0x8a20('0x18')]};var _0x40d8ca=md5(JSON[_0x8a20('0x19')](_0x551b14));if(this['md5']!==_0x40d8ca){this[_0x8a20('0x1')]=_0x40d8ca;io['to'](util[_0x8a20('0x1a')](_0x8a20('0x1b'),_0x551b14[_0x8a20('0x8')]))[_0x8a20('0x1c')](_0x8a20('0x1d'),_0x551b14);}};module[_0x8a20('0x1e')]=MailQueue; \ No newline at end of file +var _0xf604=['loggedIn','paused','online','available','waiting','stringify','format','mail:queue:%s','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x245bd2,_0x1c5a6f){var _0x35c770=function(_0x360818){while(--_0x360818){_0x245bd2['push'](_0x245bd2['shift']());}};_0x35c770(++_0x1c5a6f);}(_0xf604,0x122));var _0x4f60=function(_0x46bec2,_0x36cde0){_0x46bec2=_0x46bec2-0x0;var _0x39b857=_0xf604[_0x46bec2];return _0x39b857;};'use strict';var _=require(_0x4f60('0x0'));var md5=require(_0x4f60('0x1'));var util=require(_0x4f60('0x2'));var Redis=require(_0x4f60('0x3'));var config=require(_0x4f60('0x4'));config['redis']=_[_0x4f60('0x5')](config[_0x4f60('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4f60('0x6')]));function MailQueue(_0x5a37dc){this['id']=_0x5a37dc['id']||0x0;this[_0x4f60('0x7')]=_0x5a37dc[_0x4f60('0x7')]||'';this[_0x4f60('0x8')]=_0x5a37dc[_0x4f60('0x8')]||0xa;this[_0x4f60('0x9')]=_0x5a37dc[_0x4f60('0x9')]||_0x4f60('0xa');this[_0x4f60('0xb')]=_0x5a37dc[_0x4f60('0xb')];this[_0x4f60('0xc')]={};this['waiting']=0x0;this[_0x4f60('0x1')]='';this[_0x4f60('0xd')]();this[_0x4f60('0xe')]();}MailQueue[_0x4f60('0xf')][_0x4f60('0xd')]=function(){var _0x171f37=this['mapAgentsId'][_0x4f60('0x10')];this['mapAgentsId']=_[_0x4f60('0x11')](this[_0x4f60('0xb')],'id');this[_0x4f60('0xc')][_0x4f60('0x10')]=_0x171f37;};MailQueue['prototype'][_0x4f60('0xe')]=function(){this[_0x4f60('0x12')]=0x0;this[_0x4f60('0x13')]=0x0;for(var _0x40332f=0x0;_0x40332f=0x0?this[_0x4f60('0x15')]:0x0;var _0x43c357={'id':this['id'],'available':this[_0x4f60('0x15')],'loggedIn':this[_0x4f60('0x12')],'name':this['name'],'paused':this[_0x4f60('0x13')],'waiting':this[_0x4f60('0x16')]};var _0x4ba26d=md5(JSON[_0x4f60('0x17')](_0x43c357));if(this['md5']!==_0x4ba26d){this[_0x4f60('0x1')]=_0x4ba26d;io['to'](util[_0x4f60('0x18')](_0x4f60('0x19'),_0x43c357[_0x4f60('0x7')]))['emit'](_0x4f60('0x1a'),_0x43c357);}};module[_0x4f60('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 114f541..cb8fa98 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 _0xf397=['prototype','updateRealtime','loggedIn','paused','length','available','stringify','format','openchannel:queue:%s','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','mapAgentsId'];(function(_0x2786d3,_0x31fcc3){var _0x5ccbda=function(_0x39ab92){while(--_0x39ab92){_0x2786d3['push'](_0x2786d3['shift']());}};_0x5ccbda(++_0x31fcc3);}(_0xf397,0x16a));var _0x7f39=function(_0x2d0abe,_0x42cfc9){_0x2d0abe=_0x2d0abe-0x0;var _0x5ee2b8=_0xf397[_0x2d0abe];return _0x5ee2b8;};'use strict';var _=require(_0x7f39('0x0'));var md5=require(_0x7f39('0x1'));var util=require(_0x7f39('0x2'));var Redis=require(_0x7f39('0x3'));var config=require(_0x7f39('0x4'));config[_0x7f39('0x5')]=_[_0x7f39('0x6')](config[_0x7f39('0x5')],{'host':_0x7f39('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7f39('0x5')]));function OpenchannelQueue(_0x2780d4){this['id']=_0x2780d4['id']||0x0;this['name']=_0x2780d4[_0x7f39('0x8')]||'';this[_0x7f39('0x9')]=_0x2780d4['timeout']||0xa;this['strategy']=_0x2780d4[_0x7f39('0xa')]||_0x7f39('0xb');this['Agents']=_0x2780d4[_0x7f39('0xc')];this['mapAgentsId']={};this[_0x7f39('0xd')]=0x0;this[_0x7f39('0x1')]='';this[_0x7f39('0xe')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x7f39('0xe')]=function(){var _0x3c4a6c=this[_0x7f39('0xf')]['_rr'];this[_0x7f39('0xf')]=_['map'](this[_0x7f39('0xc')],'id');this[_0x7f39('0xf')]['_rr']=_0x3c4a6c;};OpenchannelQueue[_0x7f39('0x10')][_0x7f39('0x11')]=function(){this[_0x7f39('0x12')]=0x0;this[_0x7f39('0x13')]=0x0;for(var _0x54a06b=0x0;_0x54a06b=0x0?this[_0x7f39('0x15')]:0x0;var _0x49d729={'id':this['id'],'available':this[_0x7f39('0x15')],'loggedIn':this[_0x7f39('0x12')],'name':this[_0x7f39('0x8')],'paused':this[_0x7f39('0x13')],'waiting':this[_0x7f39('0xd')]};var _0x1da052=md5(JSON[_0x7f39('0x16')](_0x49d729));if(this[_0x7f39('0x1')]!==_0x1da052){this[_0x7f39('0x1')]=_0x1da052;io['to'](util[_0x7f39('0x17')](_0x7f39('0x18'),_0x49d729['name']))['emit'](_0x7f39('0x19'),_0x49d729);}};module[_0x7f39('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0xa60d=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','openchannelPause','available','stringify','format','emit','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x3531b3,_0x5c54ea){var _0x338e11=function(_0x15d999){while(--_0x15d999){_0x3531b3['push'](_0x3531b3['shift']());}};_0x338e11(++_0x5c54ea);}(_0xa60d,0x1d8));var _0xda60=function(_0x122afc,_0x2b77e8){_0x122afc=_0x122afc-0x0;var _0x2041d0=_0xa60d[_0x122afc];return _0x2041d0;};'use strict';var _=require('lodash');var md5=require(_0xda60('0x0'));var util=require(_0xda60('0x1'));var Redis=require(_0xda60('0x2'));var config=require(_0xda60('0x3'));config[_0xda60('0x4')]=_[_0xda60('0x5')](config[_0xda60('0x4')],{'host':_0xda60('0x6'),'port':0x18eb});var io=require(_0xda60('0x7'))(new Redis(config[_0xda60('0x4')]));function OpenchannelQueue(_0x5acb31){this['id']=_0x5acb31['id']||0x0;this[_0xda60('0x8')]=_0x5acb31['name']||'';this['timeout']=_0x5acb31[_0xda60('0x9')]||0xa;this[_0xda60('0xa')]=_0x5acb31[_0xda60('0xa')]||_0xda60('0xb');this[_0xda60('0xc')]=_0x5acb31[_0xda60('0xc')];this[_0xda60('0xd')]={};this[_0xda60('0xe')]=0x0;this[_0xda60('0x0')]='';this['updateRouting']();this[_0xda60('0xf')]();}OpenchannelQueue[_0xda60('0x10')]['updateRouting']=function(){var _0x47d89d=this[_0xda60('0xd')][_0xda60('0x11')];this[_0xda60('0xd')]=_[_0xda60('0x12')](this[_0xda60('0xc')],'id');this[_0xda60('0xd')][_0xda60('0x11')]=_0x47d89d;};OpenchannelQueue[_0xda60('0x10')][_0xda60('0xf')]=function(){this[_0xda60('0x13')]=0x0;this[_0xda60('0x14')]=0x0;for(var _0x59ac4a=0x0;_0x59ac4a=0x0?this[_0xda60('0x18')]:0x0;var _0x240ba6={'id':this['id'],'available':this[_0xda60('0x18')],'loggedIn':this[_0xda60('0x13')],'name':this[_0xda60('0x8')],'paused':this['paused'],'waiting':this[_0xda60('0xe')]};var _0x56bbe0=md5(JSON[_0xda60('0x19')](_0x240ba6));if(this[_0xda60('0x0')]!==_0x56bbe0){this['md5']=_0x56bbe0;io['to'](util[_0xda60('0x1a')]('openchannel:queue:%s',_0x240ba6[_0xda60('0x8')]))[_0xda60('0x1b')](_0xda60('0x1c'),_0x240ba6);}};module[_0xda60('0x1d')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 3944afb..63eeeb9 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 _0x757a=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','length','online','loggedIn','smsPause','paused','available','format','sms:queue:%s','emit','md5','util','defaults'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x757a,0xde));var _0xa757=function(_0x1252b0,_0x3a3d2e){_0x1252b0=_0x1252b0-0x0;var _0x12c2de=_0x757a[_0x1252b0];return _0x12c2de;};'use strict';var _=require('lodash');var md5=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xa757('0x2')](config[_0xa757('0x3')],{'host':_0xa757('0x4'),'port':0x18eb});var io=require(_0xa757('0x5'))(new Redis(config[_0xa757('0x3')]));function SmsQueue(_0x3caeb0){this['id']=_0x3caeb0['id']||0x0;this['name']=_0x3caeb0[_0xa757('0x6')]||'';this[_0xa757('0x7')]=_0x3caeb0['timeout']||0xa;this[_0xa757('0x8')]=_0x3caeb0[_0xa757('0x8')]||_0xa757('0x9');this[_0xa757('0xa')]=_0x3caeb0[_0xa757('0xa')];this['mapAgentsId']={};this[_0xa757('0xb')]=0x0;this[_0xa757('0x0')]='';this[_0xa757('0xc')]();this[_0xa757('0xd')]();}SmsQueue[_0xa757('0xe')][_0xa757('0xc')]=function(){var _0x17408b=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this['Agents'],'id');this[_0xa757('0xf')]['_rr']=_0x17408b;};SmsQueue['prototype'][_0xa757('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x32112b=0x0;_0x32112b=0x0?this['available']:0x0;var _0x54b305={'id':this['id'],'available':this[_0xa757('0x15')],'loggedIn':this[_0xa757('0x12')],'name':this[_0xa757('0x6')],'paused':this[_0xa757('0x14')],'waiting':this[_0xa757('0xb')]};var _0xe2d567=md5(JSON['stringify'](_0x54b305));if(this[_0xa757('0x0')]!==_0xe2d567){this['md5']=_0xe2d567;io['to'](util[_0xa757('0x16')](_0xa757('0x17'),_0x54b305[_0xa757('0x6')]))[_0xa757('0x18')]('sms_queue:save',_0x54b305);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xe706=['prototype','_rr','map','online','loggedIn','smsPause','available','paused','stringify','format','sms:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0xe706,0xa3));var _0x6e70=function(_0x4297af,_0x2882f5){_0x4297af=_0x4297af-0x0;var _0x10ad5d=_0xe706[_0x4297af];return _0x10ad5d;};'use strict';var _=require(_0x6e70('0x0'));var md5=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var Redis=require('ioredis');var config=require(_0x6e70('0x3'));config[_0x6e70('0x4')]=_[_0x6e70('0x5')](config[_0x6e70('0x4')],{'host':_0x6e70('0x6'),'port':0x18eb});var io=require(_0x6e70('0x7'))(new Redis(config[_0x6e70('0x4')]));function SmsQueue(_0x506db9){this['id']=_0x506db9['id']||0x0;this[_0x6e70('0x8')]=_0x506db9[_0x6e70('0x8')]||'';this[_0x6e70('0x9')]=_0x506db9[_0x6e70('0x9')]||0xa;this[_0x6e70('0xa')]=_0x506db9[_0x6e70('0xa')]||_0x6e70('0xb');this[_0x6e70('0xc')]=_0x506db9[_0x6e70('0xc')];this[_0x6e70('0xd')]={};this[_0x6e70('0xe')]=0x0;this[_0x6e70('0x1')]='';this[_0x6e70('0xf')]();this[_0x6e70('0x10')]();}SmsQueue[_0x6e70('0x11')][_0x6e70('0xf')]=function(){var _0x5b3d07=this['mapAgentsId'][_0x6e70('0x12')];this[_0x6e70('0xd')]=_[_0x6e70('0x13')](this[_0x6e70('0xc')],'id');this[_0x6e70('0xd')][_0x6e70('0x12')]=_0x5b3d07;};SmsQueue[_0x6e70('0x11')][_0x6e70('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x48bc72=0x0;_0x48bc72=0x0?this['available']:0x0;var _0x28a21f={'id':this['id'],'available':this[_0x6e70('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x6e70('0x18')],'waiting':this[_0x6e70('0xe')]};var _0x2368eb=md5(JSON[_0x6e70('0x19')](_0x28a21f));if(this[_0x6e70('0x1')]!==_0x2368eb){this[_0x6e70('0x1')]=_0x2368eb;io['to'](util[_0x6e70('0x1a')](_0x6e70('0x1b'),_0x28a21f[_0x6e70('0x8')]))[_0x6e70('0x1c')]('sms_queue:save',_0x28a21f);}};module[_0x6e70('0x1d')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 15eb1a9..fd8d414 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 _0xd35e=['available','paused','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','whatsappPause'];(function(_0x27f7ff,_0x124a0a){var _0x211c7a=function(_0x23c8a4){while(--_0x23c8a4){_0x27f7ff['push'](_0x27f7ff['shift']());}};_0x211c7a(++_0x124a0a);}(_0xd35e,0x19c));var _0xed35=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0xd35e[_0x2803ab];return _0x3d6e8e;};'use strict';var _=require(_0xed35('0x0'));var md5=require(_0xed35('0x1'));var util=require(_0xed35('0x2'));var Redis=require(_0xed35('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xed35('0x4')](config[_0xed35('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x4ff012){this['id']=_0x4ff012['id']||0x0;this[_0xed35('0x6')]=_0x4ff012['name']||'';this[_0xed35('0x7')]=_0x4ff012[_0xed35('0x7')]||0xa;this['strategy']=_0x4ff012[_0xed35('0x8')]||_0xed35('0x9');this[_0xed35('0xa')]=_0x4ff012[_0xed35('0xa')];this[_0xed35('0xb')]={};this[_0xed35('0xc')]=0x0;this[_0xed35('0x1')]='';this[_0xed35('0xd')]();this[_0xed35('0xe')]();}WhatsappQueue[_0xed35('0xf')][_0xed35('0xd')]=function(){var _0x187a21=this[_0xed35('0xb')][_0xed35('0x10')];this[_0xed35('0xb')]=_['map'](this[_0xed35('0xa')],'id');this[_0xed35('0xb')][_0xed35('0x10')]=_0x187a21;};WhatsappQueue['prototype'][_0xed35('0xe')]=function(){this[_0xed35('0x11')]=0x0;this['paused']=0x0;for(var _0x49fa94=0x0;_0x49fa94=0x0?this['available']:0x0;var _0xd6bfd9={'id':this['id'],'available':this[_0xed35('0x14')],'loggedIn':this[_0xed35('0x11')],'name':this[_0xed35('0x6')],'paused':this[_0xed35('0x15')],'waiting':this[_0xed35('0xc')]};var _0x57d092=md5(JSON[_0xed35('0x16')](_0xd6bfd9));if(this[_0xed35('0x1')]!==_0x57d092){this[_0xed35('0x1')]=_0x57d092;io['to'](util[_0xed35('0x17')](_0xed35('0x18'),_0xd6bfd9[_0xed35('0x6')]))['emit'](_0xed35('0x19'),_0xd6bfd9);}};module[_0xed35('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x917a=['prototype','loggedIn','paused','online','whatsappPause','available','stringify','format','emit','lodash','md5','util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','_rr','mapAgentsId','map'];(function(_0x19937c,_0x3f84c4){var _0x1b1f5a=function(_0x2a9e0c){while(--_0x2a9e0c){_0x19937c['push'](_0x19937c['shift']());}};_0x1b1f5a(++_0x3f84c4);}(_0x917a,0x1e5));var _0xa917=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x917a[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xa917('0x0'));var md5=require(_0xa917('0x1'));var util=require(_0xa917('0x2'));var Redis=require(_0xa917('0x3'));var config=require(_0xa917('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0xa917('0x5'),'port':0x18eb});var io=require(_0xa917('0x6'))(new Redis(config[_0xa917('0x7')]));function WhatsappQueue(_0x51fa81){this['id']=_0x51fa81['id']||0x0;this['name']=_0x51fa81[_0xa917('0x8')]||'';this['timeout']=_0x51fa81[_0xa917('0x9')]||0xa;this['strategy']=_0x51fa81[_0xa917('0xa')]||_0xa917('0xb');this[_0xa917('0xc')]=_0x51fa81[_0xa917('0xc')];this['mapAgentsId']={};this[_0xa917('0xd')]=0x0;this['md5']='';this[_0xa917('0xe')]();this[_0xa917('0xf')]();}WhatsappQueue['prototype'][_0xa917('0xe')]=function(){var _0x2bbc94=this['mapAgentsId'][_0xa917('0x10')];this[_0xa917('0x11')]=_[_0xa917('0x12')](this[_0xa917('0xc')],'id');this[_0xa917('0x11')][_0xa917('0x10')]=_0x2bbc94;};WhatsappQueue[_0xa917('0x13')][_0xa917('0xf')]=function(){this[_0xa917('0x14')]=0x0;this[_0xa917('0x15')]=0x0;for(var _0xba2059=0x0;_0xba2059=0x0?this[_0xa917('0x18')]:0x0;var _0x56aaa5={'id':this['id'],'available':this[_0xa917('0x18')],'loggedIn':this[_0xa917('0x14')],'name':this['name'],'paused':this[_0xa917('0x15')],'waiting':this['waiting']};var _0xa8a9da=md5(JSON[_0xa917('0x19')](_0x56aaa5));if(this[_0xa917('0x1')]!==_0xa8a9da){this[_0xa917('0x1')]=_0xa8a9da;io['to'](util[_0xa917('0x1a')]('whatsapp:queue:%s',_0x56aaa5[_0xa917('0x8')]))[_0xa917('0x1b')]('whatsapp_queue:save',_0x56aaa5);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 00d75d2..1ad8a7f 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 _0x008c=['faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','mergeFromDatabase','updateRealtime','chatQueues','updateRouting','initSmsQueues','initMailQueues','mailQueues','initFaxQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','smsQueues'];(function(_0x15c4a1,_0x5b02dc){var _0x375746=function(_0x46d845){while(--_0x46d845){_0x15c4a1['push'](_0x15c4a1['shift']());}};_0x375746(++_0x5b02dc);}(_0x008c,0x188));var _0xc008=function(_0x30a6d6,_0x603c35){_0x30a6d6=_0x30a6d6-0x0;var _0x361ea1=_0x008c[_0x30a6d6];return _0x361ea1;};'use strict';var BPromise=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var _=require(_0xc008('0x2'));var moment=require(_0xc008('0x3'));var Agent=require(_0xc008('0x4'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xc008('0x5'));var ChatQueue=require(_0xc008('0x6'));var SmsQueue=require(_0xc008('0x7'));var MailQueue=require(_0xc008('0x8'));var FaxQueue=require(_0xc008('0x9'));var WhatsappQueue=require(_0xc008('0xa'));var Realtime=function(){this[_0xc008('0xb')]={};this[_0xc008('0xc')]={};this[_0xc008('0xd')]={};this['chatQueues']={};this[_0xc008('0xe')]={};this['mailQueues']={};this[_0xc008('0xf')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0xc008('0x10')]={};this[_0xc008('0x11')]={};this['smsQueuesWaitingInteractions']={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x1eacfa,_0xc881aa,_0x5b2004){var _0xae2dab=_[_0xc008('0x12')](_0x1eacfa,function(_0x2ea200,_0x2a5b4e){return _0x2ea200[_0x5b2004];});for(var _0x9ffa93 in _0xc881aa){if(_0xc881aa[_0xc008('0x13')](_0x9ffa93)){if(!_0xae2dab[_0x9ffa93]){delete _0xc881aa[_0x9ffa93];}}}}Realtime[_0xc008('0x14')]['mergeFromDatabase']=function(_0x560e28,_0x33f44c){for(var _0x50c1ab in _0x33f44c){if(_0x560e28[_0xc008('0x13')](_0x50c1ab)){_0x560e28[_0x50c1ab]=_0x33f44c[_0x50c1ab];}}};Realtime[_0xc008('0x14')][_0xc008('0x15')]=function(){var _0x339ffc=this;return function(_0x3f0ecf){if(_0x3f0ecf){freeIsNotKey(_0x3f0ecf,_0x339ffc['agents'],'id');for(var _0x5e894e=0x0,_0x4bd0f4={},_0x11ef38={};_0x5e894e<_0x3f0ecf[_0xc008('0x16')];_0x5e894e+=0x1){_0x4bd0f4=_0x3f0ecf[_0x5e894e];if(_[_0xc008('0x17')](_0x339ffc[_0xc008('0xb')][_0x4bd0f4['id']])){_0x339ffc['agents'][_0x4bd0f4['id']]=new Agent(_0x4bd0f4);}else{_0x339ffc['mergeFromDatabase'](_0x339ffc['agents'][_0x4bd0f4['id']],_0x4bd0f4);}}}return _0x339ffc['agents'];};};Realtime[_0xc008('0x14')][_0xc008('0x18')]=function(){var _0x501137=this;return function(_0x813397){if(_0x813397){freeIsNotKey(_0x813397,_0x501137['intervals'],'id');for(var _0x4bd611=0x0,_0x543e5d={},_0x50261c={};_0x4bd611<_0x813397[_0xc008('0x16')];_0x4bd611+=0x1){_0x543e5d=_0x813397[_0x4bd611];if(_['isUndefined'](_0x501137['intervals'][_0x543e5d['id']])){_0x501137['intervals'][_0x543e5d['id']]=new Interval(_0x543e5d);}else{_0x501137['mergeFromDatabase'](_0x501137['intervals'][_0x543e5d['id']],_0x543e5d);}}}return _0x501137[_0xc008('0xc')];};};Realtime[_0xc008('0x14')][_0xc008('0x19')]=function(){var _0x415af3=this;return function(_0x11cc75){if(_0x11cc75){freeIsNotKey(_0x11cc75,_0x415af3[_0xc008('0xd')],'id');for(var _0x4f43e2=0x0,_0x459fd9={},_0x5c85f2={};_0x4f43e2<_0x11cc75['length'];_0x4f43e2+=0x1){_0x459fd9=_0x11cc75[_0x4f43e2];if(_[_0xc008('0x17')](_0x415af3[_0xc008('0xd')][_0x459fd9['id']])){_0x415af3[_0xc008('0xd')][_0x459fd9['id']]=new OpenchannelQueue(_0x459fd9);}else{_0x415af3[_0xc008('0x1a')](_0x415af3['openchannelQueues'][_0x459fd9['id']],_0x459fd9);}_0x415af3['openchannelQueues'][_0x459fd9['id']]['updateRouting']();_0x415af3[_0xc008('0xd')][_0x459fd9['id']][_0xc008('0x1b')]();}}return _0x415af3[_0xc008('0xd')];};};Realtime[_0xc008('0x14')]['initChatQueues']=function(){var _0x5e2aca=this;return function(_0x4fce9c){if(_0x4fce9c){freeIsNotKey(_0x4fce9c,_0x5e2aca['chatQueues'],'id');for(var _0x4caaf4=0x0,_0x3865c0={},_0x29ba43={};_0x4caaf4<_0x4fce9c[_0xc008('0x16')];_0x4caaf4+=0x1){_0x3865c0=_0x4fce9c[_0x4caaf4];if(_['isUndefined'](_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']])){_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']]=new ChatQueue(_0x3865c0);}else{_0x5e2aca[_0xc008('0x1a')](_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']],_0x3865c0);}_0x5e2aca['chatQueues'][_0x3865c0['id']][_0xc008('0x1d')]();_0x5e2aca[_0xc008('0x1c')][_0x3865c0['id']]['updateRealtime']();}}return _0x5e2aca['chatQueues'];};};Realtime['prototype'][_0xc008('0x1e')]=function(){var _0x267abd=this;return function(_0xf831f2){if(_0xf831f2){freeIsNotKey(_0xf831f2,_0x267abd[_0xc008('0xe')],'id');for(var _0x1de04b=0x0,_0xceebc3={},_0x294f97={};_0x1de04b<_0xf831f2[_0xc008('0x16')];_0x1de04b+=0x1){_0xceebc3=_0xf831f2[_0x1de04b];if(_[_0xc008('0x17')](_0x267abd[_0xc008('0xe')][_0xceebc3['id']])){_0x267abd[_0xc008('0xe')][_0xceebc3['id']]=new SmsQueue(_0xceebc3);}else{_0x267abd[_0xc008('0x1a')](_0x267abd['smsQueues'][_0xceebc3['id']],_0xceebc3);}_0x267abd[_0xc008('0xe')][_0xceebc3['id']][_0xc008('0x1d')]();_0x267abd['smsQueues'][_0xceebc3['id']][_0xc008('0x1b')]();}}return _0x267abd[_0xc008('0xe')];};};Realtime[_0xc008('0x14')][_0xc008('0x1f')]=function(){var _0xd0e05a=this;return function(_0x3cd878){if(_0x3cd878){freeIsNotKey(_0x3cd878,_0xd0e05a[_0xc008('0x20')],'id');for(var _0x470e79=0x0,_0x29d4b3={},_0x4f14d2={};_0x470e79<_0x3cd878[_0xc008('0x16')];_0x470e79+=0x1){_0x29d4b3=_0x3cd878[_0x470e79];if(_[_0xc008('0x17')](_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']])){_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']]=new MailQueue(_0x29d4b3);}else{_0xd0e05a[_0xc008('0x1a')](_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']],_0x29d4b3);}_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']]['updateRouting']();_0xd0e05a[_0xc008('0x20')][_0x29d4b3['id']][_0xc008('0x1b')]();}}return _0xd0e05a['mailQueues'];};};Realtime[_0xc008('0x14')][_0xc008('0x21')]=function(){var _0x5e38d5=this;return function(_0x263473){if(_0x263473){freeIsNotKey(_0x263473,_0x5e38d5[_0xc008('0xf')],'id');for(var _0x280e9b=0x0,_0x55ff48={},_0x53b353={};_0x280e9b<_0x263473['length'];_0x280e9b+=0x1){_0x55ff48=_0x263473[_0x280e9b];if(_[_0xc008('0x17')](_0x5e38d5['faxQueues'][_0x55ff48['id']])){_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']]=new FaxQueue(_0x55ff48);}else{_0x5e38d5[_0xc008('0x1a')](_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']],_0x55ff48);}_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']][_0xc008('0x1d')]();_0x5e38d5[_0xc008('0xf')][_0x55ff48['id']][_0xc008('0x1b')]();}}return _0x5e38d5[_0xc008('0xf')];};};Realtime[_0xc008('0x14')][_0xc008('0x22')]=function(){var _0x3ebb83=this;return function(_0xdfca2e){if(_0xdfca2e){freeIsNotKey(_0xdfca2e,_0x3ebb83[_0xc008('0x23')],'id');for(var _0x2bf3fd=0x0,_0x4cace5={},_0x3238b4={};_0x2bf3fd<_0xdfca2e[_0xc008('0x16')];_0x2bf3fd+=0x1){_0x4cace5=_0xdfca2e[_0x2bf3fd];if(_[_0xc008('0x17')](_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']])){_0x3ebb83['whatsappQueues'][_0x4cace5['id']]=new WhatsappQueue(_0x4cace5);}else{_0x3ebb83[_0xc008('0x1a')](_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']],_0x4cace5);}_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']][_0xc008('0x1d')]();_0x3ebb83[_0xc008('0x23')][_0x4cace5['id']]['updateRealtime']();}}return _0x3ebb83[_0xc008('0x23')];};};module[_0xc008('0x24')]=Realtime; \ No newline at end of file +var _0x7217=['../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','isUndefined','initIntervals','mergeFromDatabase','initOpenchannelQueues','updateRouting','updateRealtime','initFaxQueues','exports','bluebird','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7217,0x19e));var _0x7721=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x7217[_0x29b609];return _0x54c952;};'use strict';var BPromise=require(_0x7721('0x0'));var util=require('util');var _=require(_0x7721('0x1'));var moment=require(_0x7721('0x2'));var Agent=require(_0x7721('0x3'));var Interval=require(_0x7721('0x4'));var OpenchannelQueue=require(_0x7721('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0x7721('0x6'));var FaxQueue=require(_0x7721('0x7'));var WhatsappQueue=require(_0x7721('0x8'));var Realtime=function(){this[_0x7721('0x9')]={};this[_0x7721('0xa')]={};this[_0x7721('0xb')]={};this[_0x7721('0xc')]={};this[_0x7721('0xd')]={};this[_0x7721('0xe')]={};this[_0x7721('0xf')]={};this[_0x7721('0x10')]={};this[_0x7721('0x11')]={};this[_0x7721('0x12')]={};this[_0x7721('0x13')]={};this[_0x7721('0x14')]={};this['faxQueuesWaitingInteractions']={};this[_0x7721('0x15')]={};};function freeIsNotKey(_0x29bc8f,_0x8729a6,_0xf78099){var _0xa8977c=_[_0x7721('0x16')](_0x29bc8f,function(_0x1e7fd7,_0x27b36b){return _0x1e7fd7[_0xf78099];});for(var _0x55b4ca in _0x8729a6){if(_0x8729a6[_0x7721('0x17')](_0x55b4ca)){if(!_0xa8977c[_0x55b4ca]){delete _0x8729a6[_0x55b4ca];}}}}Realtime[_0x7721('0x18')]['mergeFromDatabase']=function(_0x109900,_0x30da54){for(var _0x3f01c5 in _0x30da54){if(_0x109900[_0x7721('0x17')](_0x3f01c5)){_0x109900[_0x3f01c5]=_0x30da54[_0x3f01c5];}}};Realtime['prototype'][_0x7721('0x19')]=function(){var _0x25b1c0=this;return function(_0x534f1b){if(_0x534f1b){freeIsNotKey(_0x534f1b,_0x25b1c0['agents'],'id');for(var _0x4b183e=0x0,_0x5ed54={},_0x25a628={};_0x4b183e<_0x534f1b[_0x7721('0x1a')];_0x4b183e+=0x1){_0x5ed54=_0x534f1b[_0x4b183e];if(_[_0x7721('0x1b')](_0x25b1c0['agents'][_0x5ed54['id']])){_0x25b1c0[_0x7721('0x9')][_0x5ed54['id']]=new Agent(_0x5ed54);}else{_0x25b1c0['mergeFromDatabase'](_0x25b1c0[_0x7721('0x9')][_0x5ed54['id']],_0x5ed54);}}}return _0x25b1c0['agents'];};};Realtime[_0x7721('0x18')][_0x7721('0x1c')]=function(){var _0x3ab5a5=this;return function(_0x3e140d){if(_0x3e140d){freeIsNotKey(_0x3e140d,_0x3ab5a5[_0x7721('0xa')],'id');for(var _0x40af90=0x0,_0x402820={},_0x413263={};_0x40af90<_0x3e140d[_0x7721('0x1a')];_0x40af90+=0x1){_0x402820=_0x3e140d[_0x40af90];if(_[_0x7721('0x1b')](_0x3ab5a5['intervals'][_0x402820['id']])){_0x3ab5a5[_0x7721('0xa')][_0x402820['id']]=new Interval(_0x402820);}else{_0x3ab5a5[_0x7721('0x1d')](_0x3ab5a5[_0x7721('0xa')][_0x402820['id']],_0x402820);}}}return _0x3ab5a5[_0x7721('0xa')];};};Realtime['prototype'][_0x7721('0x1e')]=function(){var _0x512f31=this;return function(_0xb9e9dd){if(_0xb9e9dd){freeIsNotKey(_0xb9e9dd,_0x512f31[_0x7721('0xb')],'id');for(var _0x3e8a4e=0x0,_0x1caad8={},_0x121cc4={};_0x3e8a4e<_0xb9e9dd[_0x7721('0x1a')];_0x3e8a4e+=0x1){_0x1caad8=_0xb9e9dd[_0x3e8a4e];if(_[_0x7721('0x1b')](_0x512f31['openchannelQueues'][_0x1caad8['id']])){_0x512f31[_0x7721('0xb')][_0x1caad8['id']]=new OpenchannelQueue(_0x1caad8);}else{_0x512f31[_0x7721('0x1d')](_0x512f31[_0x7721('0xb')][_0x1caad8['id']],_0x1caad8);}_0x512f31[_0x7721('0xb')][_0x1caad8['id']][_0x7721('0x1f')]();_0x512f31[_0x7721('0xb')][_0x1caad8['id']][_0x7721('0x20')]();}}return _0x512f31[_0x7721('0xb')];};};Realtime[_0x7721('0x18')]['initChatQueues']=function(){var _0x258ddf=this;return function(_0x5b0551){if(_0x5b0551){freeIsNotKey(_0x5b0551,_0x258ddf['chatQueues'],'id');for(var _0x315202=0x0,_0x343c19={},_0x53c904={};_0x315202<_0x5b0551[_0x7721('0x1a')];_0x315202+=0x1){_0x343c19=_0x5b0551[_0x315202];if(_[_0x7721('0x1b')](_0x258ddf[_0x7721('0xc')][_0x343c19['id']])){_0x258ddf[_0x7721('0xc')][_0x343c19['id']]=new ChatQueue(_0x343c19);}else{_0x258ddf[_0x7721('0x1d')](_0x258ddf['chatQueues'][_0x343c19['id']],_0x343c19);}_0x258ddf[_0x7721('0xc')][_0x343c19['id']][_0x7721('0x1f')]();_0x258ddf['chatQueues'][_0x343c19['id']]['updateRealtime']();}}return _0x258ddf[_0x7721('0xc')];};};Realtime[_0x7721('0x18')]['initSmsQueues']=function(){var _0x46f772=this;return function(_0x4651b5){if(_0x4651b5){freeIsNotKey(_0x4651b5,_0x46f772[_0x7721('0xd')],'id');for(var _0x58d54b=0x0,_0x3d9a32={},_0x1ff31b={};_0x58d54b<_0x4651b5[_0x7721('0x1a')];_0x58d54b+=0x1){_0x3d9a32=_0x4651b5[_0x58d54b];if(_[_0x7721('0x1b')](_0x46f772[_0x7721('0xd')][_0x3d9a32['id']])){_0x46f772['smsQueues'][_0x3d9a32['id']]=new SmsQueue(_0x3d9a32);}else{_0x46f772[_0x7721('0x1d')](_0x46f772[_0x7721('0xd')][_0x3d9a32['id']],_0x3d9a32);}_0x46f772[_0x7721('0xd')][_0x3d9a32['id']]['updateRouting']();_0x46f772[_0x7721('0xd')][_0x3d9a32['id']][_0x7721('0x20')]();}}return _0x46f772['smsQueues'];};};Realtime[_0x7721('0x18')]['initMailQueues']=function(){var _0x2d6ba0=this;return function(_0x326c50){if(_0x326c50){freeIsNotKey(_0x326c50,_0x2d6ba0[_0x7721('0xe')],'id');for(var _0x1d894b=0x0,_0x1c84c0={},_0x13c635={};_0x1d894b<_0x326c50[_0x7721('0x1a')];_0x1d894b+=0x1){_0x1c84c0=_0x326c50[_0x1d894b];if(_[_0x7721('0x1b')](_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']])){_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']]=new MailQueue(_0x1c84c0);}else{_0x2d6ba0[_0x7721('0x1d')](_0x2d6ba0['mailQueues'][_0x1c84c0['id']],_0x1c84c0);}_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']]['updateRouting']();_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']][_0x7721('0x20')]();}}return _0x2d6ba0[_0x7721('0xe')];};};Realtime[_0x7721('0x18')][_0x7721('0x21')]=function(){var _0x378ba5=this;return function(_0x482b70){if(_0x482b70){freeIsNotKey(_0x482b70,_0x378ba5['faxQueues'],'id');for(var _0x4cadef=0x0,_0x539560={},_0x18001c={};_0x4cadef<_0x482b70[_0x7721('0x1a')];_0x4cadef+=0x1){_0x539560=_0x482b70[_0x4cadef];if(_[_0x7721('0x1b')](_0x378ba5[_0x7721('0xf')][_0x539560['id']])){_0x378ba5['faxQueues'][_0x539560['id']]=new FaxQueue(_0x539560);}else{_0x378ba5[_0x7721('0x1d')](_0x378ba5['faxQueues'][_0x539560['id']],_0x539560);}_0x378ba5[_0x7721('0xf')][_0x539560['id']][_0x7721('0x1f')]();_0x378ba5['faxQueues'][_0x539560['id']][_0x7721('0x20')]();}}return _0x378ba5[_0x7721('0xf')];};};Realtime['prototype']['initWhatsappQueues']=function(){var _0x3d84d3=this;return function(_0xfc4dc4){if(_0xfc4dc4){freeIsNotKey(_0xfc4dc4,_0x3d84d3[_0x7721('0x10')],'id');for(var _0x15e34d=0x0,_0x577af9={},_0x2db173={};_0x15e34d<_0xfc4dc4[_0x7721('0x1a')];_0x15e34d+=0x1){_0x577af9=_0xfc4dc4[_0x15e34d];if(_[_0x7721('0x1b')](_0x3d84d3[_0x7721('0x10')][_0x577af9['id']])){_0x3d84d3[_0x7721('0x10')][_0x577af9['id']]=new WhatsappQueue(_0x577af9);}else{_0x3d84d3['mergeFromDatabase'](_0x3d84d3[_0x7721('0x10')][_0x577af9['id']],_0x577af9);}_0x3d84d3['whatsappQueues'][_0x577af9['id']][_0x7721('0x1f')]();_0x3d84d3['whatsappQueues'][_0x577af9['id']][_0x7721('0x20')]();}}return _0x3d84d3[_0x7721('0x10')];};};module[_0x7721('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 7d9bc21..5a2f80f 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 _0xc979=['UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xc979,0xab));var _0x9c97=function(_0x425dd1,_0x5c06ea){_0x425dd1=_0x425dd1-0x0;var _0x5af555=_0xc979[_0x425dd1];return _0x5af555;};'use strict';var client=require(_0x9c97('0x0'));exports[_0x9c97('0x1')]=function(_0x2249a6,_0x375542){return client[_0x9c97('0x2')](_0x9c97('0x3'),{'body':_0x375542,'options':{'where':{'id':_0x2249a6}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x5a24a5,_0x31e964){return client[_0x9c97('0x2')](_0x9c97('0x4'),{'body':_0x31e964,'options':{'where':{'id':_0x5a24a5}},'log':_0x9c97('0x5')});}; \ No newline at end of file +var _0x09ab=['updateChatInteraction','addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0x263659,_0x22be35){var _0xad3b8a=function(_0x3ea15b){while(--_0x3ea15b){_0x263659['push'](_0x263659['shift']());}};_0xad3b8a(++_0x22be35);}(_0x09ab,0x1c5));var _0xb09a=function(_0x51ef40,_0x48a870){_0x51ef40=_0x51ef40-0x0;var _0x3ff060=_0x09ab[_0x51ef40];return _0x3ff060;};'use strict';var client=require(_0xb09a('0x0'));exports[_0xb09a('0x1')]=function(_0x3a7a28,_0xd285b4){return client['Request'](_0xb09a('0x2'),{'body':_0xd285b4,'options':{'where':{'id':_0x3a7a28}},'log':_0xb09a('0x3')});};exports[_0xb09a('0x4')]=function(_0x282374,_0x56adff){return client[_0xb09a('0x5')](_0xb09a('0x6'),{'body':_0x56adff,'options':{'where':{'id':_0x282374}},'log':_0xb09a('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9ae7164..2c3746f 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 _0xe83c=['Request','createChatMessage','../client','create'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe83c,0x76));var _0xce83=function(_0x575057,_0x14baf3){_0x575057=_0x575057-0x0;var _0x49dbc8=_0xe83c[_0x575057];return _0x49dbc8;};'use strict';var client=require(_0xce83('0x0'));exports[_0xce83('0x1')]=function(_0x2b38eb){return client[_0xce83('0x2')]('CreateChatMessage',{'body':_0x2b38eb,'log':_0xce83('0x3')});}; \ No newline at end of file +var _0xd9d3=['createChatMessage','../client','create','Request'];(function(_0x1d740d,_0x2682b6){var _0x34711f=function(_0xe17698){while(--_0xe17698){_0x1d740d['push'](_0x1d740d['shift']());}};_0x34711f(++_0x2682b6);}(_0xd9d3,0xd1));var _0x3d9d=function(_0x1cab1f,_0x17dac7){_0x1cab1f=_0x1cab1f-0x0;var _0x27d1f3=_0xd9d3[_0x1cab1f];return _0x27d1f3;};'use strict';var client=require(_0x3d9d('0x0'));exports[_0x3d9d('0x1')]=function(_0x5a3b6f){return client[_0x3d9d('0x2')]('CreateChatMessage',{'body':_0x5a3b6f,'log':_0x3d9d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index e2d01be..7feccea 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 _0xf7a9=['name','online','../client','getChatQueues','Request','GetChatQueue','timeout','User','Agents'];(function(_0x3c6cdc,_0x4ae3a2){var _0x2214c1=function(_0x40a3b8){while(--_0x40a3b8){_0x3c6cdc['push'](_0x3c6cdc['shift']());}};_0x2214c1(++_0x4ae3a2);}(_0xf7a9,0x12b));var _0x9f7a=function(_0x4ba3ff,_0x1516c5){_0x4ba3ff=_0x4ba3ff-0x0;var _0x8bc3a8=_0xf7a9[_0x4ba3ff];return _0x8bc3a8;};'use strict';var client=require(_0x9f7a('0x0'));exports[_0x9f7a('0x1')]=function(){return function(){return client[_0x9f7a('0x2')](_0x9f7a('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x9f7a('0x4'),'strategy'],'include':[{'model':_0x9f7a('0x5'),'as':_0x9f7a('0x6'),'attributes':['id',_0x9f7a('0x7'),_0x9f7a('0x8'),'chatPause']}]},'log':_0x9f7a('0x1')});};}; \ No newline at end of file +var _0x4ef0=['getChatQueues','GetChatQueue','strategy','name','online','chatPause'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x4ef0,0x1bc));var _0x04ef=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x4ef0[_0x59c301];return _0x3866b9;};'use strict';var client=require('../client');exports[_0x04ef('0x0')]=function(){return function(){return client['Request'](_0x04ef('0x1'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x04ef('0x2')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x04ef('0x3'),_0x04ef('0x4'),_0x04ef('0x5')]}]},'log':_0x04ef('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 029ab1a..3bc76cc 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 _0x61df=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','Request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x61df,0xbd));var _0xf61d=function(_0x221f4f,_0x1060a1){_0x221f4f=_0x221f4f-0x0;var _0x4c4725=_0x61df[_0x221f4f];return _0x4c4725;};'use strict';var client=require('../client');exports['create']=function(_0x559316){return client[_0xf61d('0x0')](_0xf61d('0x1'),{'body':_0x559316,'log':'CreateChatQueueReport'});};exports[_0xf61d('0x2')]=function(_0x380f27,_0x485a55){return client[_0xf61d('0x0')](_0xf61d('0x3'),{'body':_0x485a55,'options':{'where':{'uniqueid':_0x380f27},'order':[['id',_0xf61d('0x4')]],'limit':0x1},'log':_0xf61d('0x3')});}; \ No newline at end of file +var _0x57d4=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x1befc5,_0xcb6328){var _0x20eb2c=function(_0x82d9f7){while(--_0x82d9f7){_0x1befc5['push'](_0x1befc5['shift']());}};_0x20eb2c(++_0xcb6328);}(_0x57d4,0x78));var _0x457d=function(_0x2a73e6,_0x12c318){_0x2a73e6=_0x2a73e6-0x0;var _0x58cea6=_0x57d4[_0x2a73e6];return _0x58cea6;};'use strict';var client=require(_0x457d('0x0'));exports[_0x457d('0x1')]=function(_0x47a573){return client[_0x457d('0x2')](_0x457d('0x3'),{'body':_0x47a573,'log':_0x457d('0x3')});};exports[_0x457d('0x4')]=function(_0x1219e1,_0x3c89b2){return client[_0x457d('0x2')](_0x457d('0x5'),{'body':_0x3c89b2,'options':{'where':{'uniqueid':_0x1219e1},'order':[['id',_0x457d('0x6')]],'limit':0x1},'log':_0x457d('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 091c33b..c39b254 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 _0xeb13=['../client','Request','UpdateFaxInteraction','updateFaxInteraction','addTags','addTagsToFaxInteraction'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0xeb13,0x84));var _0x3eb1=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0xeb13[_0x55d829];return _0x52163b;};'use strict';var client=require(_0x3eb1('0x0'));exports['update']=function(_0x28ac05,_0xe2b073){return client[_0x3eb1('0x1')](_0x3eb1('0x2'),{'body':_0xe2b073,'options':{'where':{'id':_0x28ac05}},'log':_0x3eb1('0x3')});};exports[_0x3eb1('0x4')]=function(_0x1bddbd,_0x374430){return client['Request']('AddTagsToFaxInteraction',{'body':_0x374430,'options':{'where':{'id':_0x1bddbd}},'log':_0x3eb1('0x5')});}; \ No newline at end of file +var _0x46a0=['UpdateFaxInteraction','updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x46a0,0x74));var _0x046a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x46a0[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x046a('0x0'));exports[_0x046a('0x1')]=function(_0x120a5f,_0x118360){return client[_0x046a('0x2')](_0x046a('0x3'),{'body':_0x118360,'options':{'where':{'id':_0x120a5f}},'log':_0x046a('0x4')});};exports['addTags']=function(_0x229714,_0x5922d6){return client[_0x046a('0x2')](_0x046a('0x5'),{'body':_0x5922d6,'options':{'where':{'id':_0x229714}},'log':_0x046a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 1c0813a..2c6e7aa 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 _0xbc06=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x9369b3,_0xdb0875){var _0x13f9bb=function(_0x442447){while(--_0x442447){_0x9369b3['push'](_0x9369b3['shift']());}};_0x13f9bb(++_0xdb0875);}(_0xbc06,0x6b));var _0x6bc0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc06[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6bc0('0x0'));exports[_0x6bc0('0x1')]=function(_0x4ffdd4){return client[_0x6bc0('0x2')](_0x6bc0('0x3'),{'body':_0x4ffdd4,'log':_0x6bc0('0x4')});}; \ No newline at end of file +var _0x33d3=['../client','createFaxMessage'];(function(_0x3244e0,_0x5450b7){var _0xff534c=function(_0x8518b1){while(--_0x8518b1){_0x3244e0['push'](_0x3244e0['shift']());}};_0xff534c(++_0x5450b7);}(_0x33d3,0x196));var _0x333d=function(_0x21481c,_0x1b51ba){_0x21481c=_0x21481c-0x0;var _0x5dd77a=_0x33d3[_0x21481c];return _0x5dd77a;};'use strict';var client=require(_0x333d('0x0'));exports['create']=function(_0x152e4d){return client['Request']('CreateFaxMessage',{'body':_0x152e4d,'log':_0x333d('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 066615e..d5b334b 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 _0x960d=['strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request','GetFaxQueue','name'];(function(_0x2bf35f,_0x49943f){var _0x54381=function(_0x435ae8){while(--_0x435ae8){_0x2bf35f['push'](_0x2bf35f['shift']());}};_0x54381(++_0x49943f);}(_0x960d,0x7d));var _0xd960=function(_0x47cb8c,_0xd2b94){_0x47cb8c=_0x47cb8c-0x0;var _0x1d0207=_0x960d[_0x47cb8c];return _0x1d0207;};'use strict';var client=require(_0xd960('0x0'));exports[_0xd960('0x1')]=function(){return function(){return client[_0xd960('0x2')](_0xd960('0x3'),{'options':{'raw':![],'attributes':['id',_0xd960('0x4'),'timeout',_0xd960('0x5')],'include':[{'model':_0xd960('0x6'),'as':_0xd960('0x7'),'attributes':['id','name',_0xd960('0x8'),_0xd960('0x9')]}]},'log':_0xd960('0x1')});};}; \ No newline at end of file +var _0x992d=['name','timeout','strategy','User','Agents','online','faxPause','../client','Request'];(function(_0x4da4ac,_0x16767f){var _0x2e757d=function(_0x1c8449){while(--_0x1c8449){_0x4da4ac['push'](_0x4da4ac['shift']());}};_0x2e757d(++_0x16767f);}(_0x992d,0xa9));var _0xd992=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x992d[_0x3e5086];return _0xfeb102;};'use strict';var client=require(_0xd992('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xd992('0x1')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xd992('0x2'),_0xd992('0x3'),_0xd992('0x4')],'include':[{'model':_0xd992('0x5'),'as':_0xd992('0x6'),'attributes':['id','name',_0xd992('0x7'),_0xd992('0x8')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6e55c23..fc0d765 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 _0x4f6c=['create','CreateFaxQueueReport','update','UpdateFaxQueueReport','../client'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x4f6c,0x176));var _0xc4f6=function(_0x402f69,_0x5a5652){_0x402f69=_0x402f69-0x0;var _0x1a0973=_0x4f6c[_0x402f69];return _0x1a0973;};'use strict';var client=require(_0xc4f6('0x0'));exports[_0xc4f6('0x1')]=function(_0xb73ad1){return client['Request'](_0xc4f6('0x2'),{'body':_0xb73ad1,'log':_0xc4f6('0x2')});};exports[_0xc4f6('0x3')]=function(_0x86bda5,_0x57d343){return client['Request'](_0xc4f6('0x4'),{'body':_0x57d343,'options':{'where':{'uniqueid':_0x86bda5},'order':[['id','DESC']],'limit':0x1},'log':_0xc4f6('0x4')});}; \ No newline at end of file +var _0x5419=['DESC','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update'];(function(_0xa43518,_0x2a4c6b){var _0x5e9b94=function(_0x3d3c7f){while(--_0x3d3c7f){_0xa43518['push'](_0xa43518['shift']());}};_0x5e9b94(++_0x2a4c6b);}(_0x5419,0x175));var _0x9541=function(_0x124269,_0x161b31){_0x124269=_0x124269-0x0;var _0x231ac3=_0x5419[_0x124269];return _0x231ac3;};'use strict';var client=require(_0x9541('0x0'));exports[_0x9541('0x1')]=function(_0x313f1e){return client[_0x9541('0x2')](_0x9541('0x3'),{'body':_0x313f1e,'log':_0x9541('0x3')});};exports[_0x9541('0x4')]=function(_0x317e1e,_0x307a35){return client[_0x9541('0x2')]('UpdateFaxQueueReport',{'body':_0x307a35,'options':{'where':{'uniqueid':_0x317e1e},'order':[['id',_0x9541('0x5')]],'limit':0x1},'log':_0x9541('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 854741b..0da7ad9 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 _0x236c=['name','Interval','Intervals','interval','getIntervals','../client','Request','GetInterval'];(function(_0x27461b,_0x2c9f29){var _0x4934da=function(_0x2ea2f4){while(--_0x2ea2f4){_0x27461b['push'](_0x27461b['shift']());}};_0x4934da(++_0x2c9f29);}(_0x236c,0x155));var _0xc236=function(_0x21185f,_0x272e12){_0x21185f=_0x21185f-0x0;var _0x12a3fe=_0x236c[_0x21185f];return _0x12a3fe;};'use strict';var client=require(_0xc236('0x0'));exports['getIntervals']=function(){return function(){return client[_0xc236('0x1')](_0xc236('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc236('0x3')],'include':[{'model':_0xc236('0x4'),'as':_0xc236('0x5'),'attributes':['id','name',_0xc236('0x6')]}]},'log':_0xc236('0x7')});};}; \ No newline at end of file +var _0x93e6=['Interval','name','interval','getIntervals','../client','GetInterval'];(function(_0x446836,_0x19becf){var _0x4f0793=function(_0x5cc460){while(--_0x5cc460){_0x446836['push'](_0x446836['shift']());}};_0x4f0793(++_0x19becf);}(_0x93e6,0x11e));var _0x693e=function(_0x54ca4e,_0x3a5fe0){_0x54ca4e=_0x54ca4e-0x0;var _0x2a8924=_0x93e6[_0x54ca4e];return _0x2a8924;};'use strict';var client=require(_0x693e('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x693e('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x693e('0x2'),'as':'Intervals','attributes':['id',_0x693e('0x3'),_0x693e('0x4')]}]},'log':_0x693e('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 2cd74dd..b427fe2 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 _0x1f90=['updateMailInteraction','Request','../client','UpdateMailInteraction'];(function(_0x51ddff,_0x18fb11){var _0xb53063=function(_0x5b2c33){while(--_0x5b2c33){_0x51ddff['push'](_0x51ddff['shift']());}};_0xb53063(++_0x18fb11);}(_0x1f90,0x192));var _0x01f9=function(_0x212fcc,_0x1a8867){_0x212fcc=_0x212fcc-0x0;var _0x4d8190=_0x1f90[_0x212fcc];return _0x4d8190;};'use strict';var client=require(_0x01f9('0x0'));exports['update']=function(_0x5b634d,_0x4b8895){return client['Request'](_0x01f9('0x1'),{'body':_0x4b8895,'options':{'where':{'id':_0x5b634d}},'log':_0x01f9('0x2')});};exports['addTags']=function(_0x4eea59,_0x4e1974){return client[_0x01f9('0x3')]('AddTagsToMailInteraction',{'body':_0x4e1974,'options':{'where':{'id':_0x4eea59}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x9f14=['UpdateMailInteraction','updateMailInteraction','addTags','../client','update','Request'];(function(_0x8f05e5,_0x2eeff3){var _0x681366=function(_0x4b73d2){while(--_0x4b73d2){_0x8f05e5['push'](_0x8f05e5['shift']());}};_0x681366(++_0x2eeff3);}(_0x9f14,0xff));var _0x49f1=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x9f14[_0x1cc8fe];return _0x230054;};'use strict';var client=require(_0x49f1('0x0'));exports[_0x49f1('0x1')]=function(_0x4e7e3f,_0xeabec4){return client[_0x49f1('0x2')](_0x49f1('0x3'),{'body':_0xeabec4,'options':{'where':{'id':_0x4e7e3f}},'log':_0x49f1('0x4')});};exports[_0x49f1('0x5')]=function(_0x41aac3,_0x49b20b){return client[_0x49f1('0x2')]('AddTagsToMailInteraction',{'body':_0x49b20b,'options':{'where':{'id':_0x41aac3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 9f2e385..09f21be 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 _0x7411=['createMailMessage','../client','CreateMailMessage'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x7411,0x9a));var _0x1741=function(_0x254959,_0x43c0a2){_0x254959=_0x254959-0x0;var _0x52d61d=_0x7411[_0x254959];return _0x52d61d;};'use strict';var client=require(_0x1741('0x0'));exports['create']=function(_0x1ab0de){return client['Request'](_0x1741('0x1'),{'body':_0x1ab0de,'log':_0x1741('0x2')});}; \ No newline at end of file +var _0x44b2=['createMailMessage','create','Request'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x44b2,0x1ea));var _0x244b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x44b2[_0x5b644e];return _0x49c6bf;};'use strict';var client=require('../client');exports[_0x244b('0x0')]=function(_0x28e19f){return client[_0x244b('0x1')]('CreateMailMessage',{'body':_0x28e19f,'log':_0x244b('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 275c1de..ae3439d 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 _0x9c3a=['timeout','strategy','User','Agents','online','mailPause','../client','getMailQueues','GetMailQueue','name'];(function(_0x22b6b4,_0x1f8e49){var _0x2ee634=function(_0x5c7f61){while(--_0x5c7f61){_0x22b6b4['push'](_0x22b6b4['shift']());}};_0x2ee634(++_0x1f8e49);}(_0x9c3a,0x178));var _0xa9c3=function(_0x73a72b,_0x4b36d1){_0x73a72b=_0x73a72b-0x0;var _0x24ca83=_0x9c3a[_0x73a72b];return _0x24ca83;};'use strict';var client=require(_0xa9c3('0x0'));exports[_0xa9c3('0x1')]=function(){return function(){return client['Request'](_0xa9c3('0x2'),{'options':{'raw':![],'attributes':['id',_0xa9c3('0x3'),_0xa9c3('0x4'),_0xa9c3('0x5')],'include':[{'model':_0xa9c3('0x6'),'as':_0xa9c3('0x7'),'attributes':['id',_0xa9c3('0x3'),_0xa9c3('0x8'),_0xa9c3('0x9')]}]},'log':_0xa9c3('0x1')});};}; \ No newline at end of file +var _0xbcb6=['getMailQueues','GetMailQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0x2e89d5,_0x59778b){var _0x7c83a9=function(_0x396955){while(--_0x396955){_0x2e89d5['push'](_0x2e89d5['shift']());}};_0x7c83a9(++_0x59778b);}(_0xbcb6,0x1ca));var _0x6bcb=function(_0x28578d,_0xcf5cf0){_0x28578d=_0x28578d-0x0;var _0x524826=_0xbcb6[_0x28578d];return _0x524826;};'use strict';var client=require(_0x6bcb('0x0'));exports[_0x6bcb('0x1')]=function(){return function(){return client['Request'](_0x6bcb('0x2'),{'options':{'raw':![],'attributes':['id',_0x6bcb('0x3'),_0x6bcb('0x4'),_0x6bcb('0x5')],'include':[{'model':_0x6bcb('0x6'),'as':_0x6bcb('0x7'),'attributes':['id',_0x6bcb('0x3'),_0x6bcb('0x8'),'mailPause']}]},'log':_0x6bcb('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index ca8288d..fbcfa8b 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 _0x245b=['Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create'];(function(_0x3ce73e,_0x40bf3c){var _0x446467=function(_0x1d2a74){while(--_0x1d2a74){_0x3ce73e['push'](_0x3ce73e['shift']());}};_0x446467(++_0x40bf3c);}(_0x245b,0x132));var _0xb245=function(_0x2e2389,_0x18c66c){_0x2e2389=_0x2e2389-0x0;var _0x463b52=_0x245b[_0x2e2389];return _0x463b52;};'use strict';var client=require(_0xb245('0x0'));exports[_0xb245('0x1')]=function(_0x1afbe6){return client[_0xb245('0x2')](_0xb245('0x3'),{'body':_0x1afbe6,'log':_0xb245('0x3')});};exports[_0xb245('0x4')]=function(_0x4d63b5,_0x1307c6){return client[_0xb245('0x2')](_0xb245('0x5'),{'body':_0x1307c6,'options':{'where':{'uniqueid':_0x4d63b5},'order':[['id',_0xb245('0x6')]],'limit':0x1},'log':_0xb245('0x5')});}; \ No newline at end of file +var _0xe04a=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x216e72,_0x5cd161){var _0x2ff28d=function(_0x29a533){while(--_0x29a533){_0x216e72['push'](_0x216e72['shift']());}};_0x2ff28d(++_0x5cd161);}(_0xe04a,0x1f2));var _0xae04=function(_0x4833c5,_0x3518e5){_0x4833c5=_0x4833c5-0x0;var _0x3f2ee5=_0xe04a[_0x4833c5];return _0x3f2ee5;};'use strict';var client=require(_0xae04('0x0'));exports[_0xae04('0x1')]=function(_0xd1ab64){return client[_0xae04('0x2')](_0xae04('0x3'),{'body':_0xd1ab64,'log':_0xae04('0x3')});};exports[_0xae04('0x4')]=function(_0x421fc8,_0x295b1c){return client[_0xae04('0x2')](_0xae04('0x5'),{'body':_0x295b1c,'options':{'where':{'uniqueid':_0x421fc8},'order':[['id',_0xae04('0x6')]],'limit':0x1},'log':_0xae04('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 7d7dbca..e58394f 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 _0x6f3e=['update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','Request','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x3c7625,_0xbc82c){var _0x3be780=function(_0x3fa694){while(--_0x3fa694){_0x3c7625['push'](_0x3c7625['shift']());}};_0x3be780(++_0xbc82c);}(_0x6f3e,0xcf));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe6f3('0x0'));exports[_0xe6f3('0x1')]=function(_0x29e0c0,_0x26725a){return client['Request'](_0xe6f3('0x2'),{'body':_0x26725a,'options':{'where':{'id':_0x29e0c0}},'log':_0xe6f3('0x3')});};exports[_0xe6f3('0x4')]=function(_0x5c5447,_0x34e531){return client[_0xe6f3('0x5')](_0xe6f3('0x6'),{'body':_0x34e531,'options':{'where':{'id':_0x5c5447}},'log':_0xe6f3('0x7')});}; \ No newline at end of file +var _0xf360=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x38a49b,_0xb368f3){var _0x3dafdb=function(_0x82f373){while(--_0x82f373){_0x38a49b['push'](_0x38a49b['shift']());}};_0x3dafdb(++_0xb368f3);}(_0xf360,0xce));var _0x0f36=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf360[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0f36('0x0'));exports[_0x0f36('0x1')]=function(_0x3380c9,_0x11538c){return client[_0x0f36('0x2')](_0x0f36('0x3'),{'body':_0x11538c,'options':{'where':{'id':_0x3380c9}},'log':_0x0f36('0x4')});};exports[_0x0f36('0x5')]=function(_0x40dc55,_0x4a97b7){return client[_0x0f36('0x2')](_0x0f36('0x6'),{'body':_0x4a97b7,'options':{'where':{'id':_0x40dc55}},'log':_0x0f36('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index d756511..d865661 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 _0x70e0=['createOpenchannelMessage','../client','create'];(function(_0x1df7b8,_0x2fe5e5){var _0x29d911=function(_0x340121){while(--_0x340121){_0x1df7b8['push'](_0x1df7b8['shift']());}};_0x29d911(++_0x2fe5e5);}(_0x70e0,0x17b));var _0x070e=function(_0x5f520c,_0x5acf1a){_0x5f520c=_0x5f520c-0x0;var _0xe66556=_0x70e0[_0x5f520c];return _0xe66556;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateOpenchannelMessage',{'body':_0x198c2e,'log':_0x070e('0x2')});}; \ No newline at end of file +var _0xb43b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x34ea27,_0x4296e7){_0x34ea27=_0x34ea27-0x0;var _0x47b73e=_0xb43b[_0x34ea27];return _0x47b73e;};'use strict';var client=require(_0xbb43('0x0'));exports[_0xbb43('0x1')]=function(_0x5c45dd){return client[_0xbb43('0x2')](_0xbb43('0x3'),{'body':_0x5c45dd,'log':_0xbb43('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 41ae117..ce9a48c 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 _0xeafb=['User','name','online','openchannelPause','../client','getOpenchannelQueues','GetOpenchannelQueue','timeout'];(function(_0x475239,_0x480944){var _0x47034e=function(_0x1c2c00){while(--_0x1c2c00){_0x475239['push'](_0x475239['shift']());}};_0x47034e(++_0x480944);}(_0xeafb,0x10c));var _0xbeaf=function(_0x158a01,_0x50bcb8){_0x158a01=_0x158a01-0x0;var _0x94b215=_0xeafb[_0x158a01];return _0x94b215;};'use strict';var client=require(_0xbeaf('0x0'));exports[_0xbeaf('0x1')]=function(){return function(){return client['Request'](_0xbeaf('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xbeaf('0x3'),'strategy'],'include':[{'model':_0xbeaf('0x4'),'as':'Agents','attributes':['id',_0xbeaf('0x5'),_0xbeaf('0x6'),_0xbeaf('0x7')]}]},'log':_0xbeaf('0x1')});};}; \ No newline at end of file +var _0xef31=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause','../client'];(function(_0x197f55,_0x329d90){var _0x43830e=function(_0x3efd19){while(--_0x3efd19){_0x197f55['push'](_0x197f55['shift']());}};_0x43830e(++_0x329d90);}(_0xef31,0x8b));var _0x1ef3=function(_0x12f9e6,_0x2e62cd){_0x12f9e6=_0x12f9e6-0x0;var _0x5e52f3=_0xef31[_0x12f9e6];return _0x5e52f3;};'use strict';var client=require(_0x1ef3('0x0'));exports[_0x1ef3('0x1')]=function(){return function(){return client[_0x1ef3('0x2')](_0x1ef3('0x3'),{'options':{'raw':![],'attributes':['id',_0x1ef3('0x4'),_0x1ef3('0x5'),_0x1ef3('0x6')],'include':[{'model':'User','as':_0x1ef3('0x7'),'attributes':['id',_0x1ef3('0x4'),_0x1ef3('0x8'),_0x1ef3('0x9')]}]},'log':_0x1ef3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6c890e1..1d4e210 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 _0xf57f=['DESC','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x55b99d,_0x264e3e){var _0x228c33=function(_0x5190d3){while(--_0x5190d3){_0x55b99d['push'](_0x55b99d['shift']());}};_0x228c33(++_0x264e3e);}(_0xf57f,0x103));var _0xff57=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0xf57f[_0x18a577];return _0x1cb0c7;};'use strict';var client=require('../client');exports[_0xff57('0x0')]=function(_0x2316d9){return client[_0xff57('0x1')](_0xff57('0x2'),{'body':_0x2316d9,'log':_0xff57('0x2')});};exports[_0xff57('0x3')]=function(_0x45a1d5,_0x3ac543){return client[_0xff57('0x1')](_0xff57('0x4'),{'body':_0x3ac543,'options':{'where':{'uniqueid':_0x45a1d5},'order':[['id',_0xff57('0x5')]],'limit':0x1},'log':_0xff57('0x4')});}; \ No newline at end of file +var _0xcd75=['Request','DESC','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','update'];(function(_0x31dc9b,_0x1902a8){var _0x17f235=function(_0x595ca4){while(--_0x595ca4){_0x31dc9b['push'](_0x31dc9b['shift']());}};_0x17f235(++_0x1902a8);}(_0xcd75,0x17d));var _0x5cd7=function(_0x52ed11,_0x22b7d0){_0x52ed11=_0x52ed11-0x0;var _0x10da54=_0xcd75[_0x52ed11];return _0x10da54;};'use strict';var client=require(_0x5cd7('0x0'));exports[_0x5cd7('0x1')]=function(_0x17d76e){return client['Request'](_0x5cd7('0x2'),{'body':_0x17d76e,'log':_0x5cd7('0x2')});};exports[_0x5cd7('0x3')]=function(_0x45f863,_0x448468){return client[_0x5cd7('0x4')]('UpdateOpenchannelQueueReport',{'body':_0x448468,'options':{'where':{'uniqueid':_0x45f863},'order':[['id',_0x5cd7('0x5')]],'limit':0x1},'log':_0x5cd7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 1ebdeb7..11c384f 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 _0xed63=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','UpdateSmsInteraction','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xed63,0x138));var _0x3ed6=function(_0x427ae7,_0x3ceb0e){_0x427ae7=_0x427ae7-0x0;var _0x42349f=_0xed63[_0x427ae7];return _0x42349f;};'use strict';var client=require(_0x3ed6('0x0'));exports['update']=function(_0x4fa32d,_0x7b80c9){return client['Request'](_0x3ed6('0x1'),{'body':_0x7b80c9,'options':{'where':{'id':_0x4fa32d}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x259e71,_0x5db0ee){return client[_0x3ed6('0x2')](_0x3ed6('0x3'),{'body':_0x5db0ee,'options':{'where':{'id':_0x259e71}},'log':_0x3ed6('0x4')});}; \ No newline at end of file +var _0x089c=['updateSmsInteraction','Request','addTagsToSmsInteraction','../client','UpdateSmsInteraction'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x089c,0x7b));var _0xc089=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x089c[_0x4b055c];return _0x4b62bb;};'use strict';var client=require(_0xc089('0x0'));exports['update']=function(_0x2510f2,_0x32e414){return client['Request'](_0xc089('0x1'),{'body':_0x32e414,'options':{'where':{'id':_0x2510f2}},'log':_0xc089('0x2')});};exports['addTags']=function(_0x226363,_0x45d962){return client[_0xc089('0x3')]('AddTagsToSmsInteraction',{'body':_0x45d962,'options':{'where':{'id':_0x226363}},'log':_0xc089('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 2f30d76..3cb9b29 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 _0x2c90=['CreateSmsMessage','../client'];(function(_0x3b19e6,_0x161a43){var _0x4537a2=function(_0x55cdc9){while(--_0x55cdc9){_0x3b19e6['push'](_0x3b19e6['shift']());}};_0x4537a2(++_0x161a43);}(_0x2c90,0xe5));var _0x02c9=function(_0x3b2639,_0x1bb334){_0x3b2639=_0x3b2639-0x0;var _0x82fb3f=_0x2c90[_0x3b2639];return _0x82fb3f;};'use strict';var client=require(_0x02c9('0x0'));exports['create']=function(_0x29cfba){return client['Request'](_0x02c9('0x1'),{'body':_0x29cfba,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xcd89=['CreateSmsMessage','../client','create','Request'];(function(_0xf8222d,_0x1091ab){var _0x35cce5=function(_0x296f29){while(--_0x296f29){_0xf8222d['push'](_0xf8222d['shift']());}};_0x35cce5(++_0x1091ab);}(_0xcd89,0xe1));var _0x9cd8=function(_0x351d8c,_0x544fe4){_0x351d8c=_0x351d8c-0x0;var _0x110c05=_0xcd89[_0x351d8c];return _0x110c05;};'use strict';var client=require(_0x9cd8('0x0'));exports[_0x9cd8('0x1')]=function(_0x76ced1){return client[_0x9cd8('0x2')](_0x9cd8('0x3'),{'body':_0x76ced1,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index a23b2d4..6157b43 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 _0x8ece=['../client','getSmsQueues','Request','name','timeout','strategy','User','Agents','online'];(function(_0x17d703,_0x2266eb){var _0x4fd652=function(_0x4147ad){while(--_0x4147ad){_0x17d703['push'](_0x17d703['shift']());}};_0x4fd652(++_0x2266eb);}(_0x8ece,0xbd));var _0xe8ec=function(_0x88beb7,_0x25c054){_0x88beb7=_0x88beb7-0x0;var _0x2ec8e8=_0x8ece[_0x88beb7];return _0x2ec8e8;};'use strict';var client=require(_0xe8ec('0x0'));exports[_0xe8ec('0x1')]=function(){return function(){return client[_0xe8ec('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0xe8ec('0x3'),_0xe8ec('0x4'),_0xe8ec('0x5')],'include':[{'model':_0xe8ec('0x6'),'as':_0xe8ec('0x7'),'attributes':['id',_0xe8ec('0x3'),_0xe8ec('0x8'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xb33b=['online','smsPause','getSmsQueues','Request','GetSmsQueue','name','timeout','User'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb33b,0x1a2));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xbb33('0x0')]=function(){return function(){return client[_0xbb33('0x1')](_0xbb33('0x2'),{'options':{'raw':![],'attributes':['id',_0xbb33('0x3'),_0xbb33('0x4'),'strategy'],'include':[{'model':_0xbb33('0x5'),'as':'Agents','attributes':['id',_0xbb33('0x3'),_0xbb33('0x6'),_0xbb33('0x7')]}]},'log':_0xbb33('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 85cacc9..04dde25 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 _0xf496=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x1339d9,_0x3f91f2){var _0x154bdb=function(_0x31d495){while(--_0x31d495){_0x1339d9['push'](_0x1339d9['shift']());}};_0x154bdb(++_0x3f91f2);}(_0xf496,0x1c7));var _0x6f49=function(_0x508562,_0x127ed8){_0x508562=_0x508562-0x0;var _0x5a071b=_0xf496[_0x508562];return _0x5a071b;};'use strict';var client=require(_0x6f49('0x0'));exports[_0x6f49('0x1')]=function(_0x29eeda){return client[_0x6f49('0x2')](_0x6f49('0x3'),{'body':_0x29eeda,'log':'CreateSmsQueueReport'});};exports[_0x6f49('0x4')]=function(_0x25a384,_0x4fbce5){return client[_0x6f49('0x2')](_0x6f49('0x5'),{'body':_0x4fbce5,'options':{'where':{'uniqueid':_0x25a384},'order':[['id',_0x6f49('0x6')]],'limit':0x1},'log':_0x6f49('0x5')});}; \ No newline at end of file +var _0x1280=['CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client','Request'];(function(_0x5586ca,_0x4910fc){var _0x4befc2=function(_0x14b4bd){while(--_0x14b4bd){_0x5586ca['push'](_0x5586ca['shift']());}};_0x4befc2(++_0x4910fc);}(_0x1280,0xac));var _0x0128=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x1280[_0x3eb4a9];return _0x48dbad;};'use strict';var client=require(_0x0128('0x0'));exports['create']=function(_0x204c30){return client[_0x0128('0x1')](_0x0128('0x2'),{'body':_0x204c30,'log':_0x0128('0x2')});};exports[_0x0128('0x3')]=function(_0x33b978,_0x4bd1f3){return client[_0x0128('0x1')](_0x0128('0x4'),{'body':_0x4bd1f3,'options':{'where':{'uniqueid':_0x33b978},'order':[['id',_0x0128('0x5')]],'limit':0x1},'log':_0x0128('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 3091e5e..2c9dde4 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 _0xb5bc=['mailPause','faxPause','smsPause','whatsappPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','whatsappCapacity','../client','getAgents','Request','GetUser','agent','pauseType','lastPauseAt','voicePause','chatPause'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xb5bc,0xa2));var _0xcb5b=function(_0x2e7f96,_0x2ffe43){_0x2e7f96=_0x2e7f96-0x0;var _0x315277=_0xb5bc[_0x2e7f96];return _0x315277;};'use strict';var client=require(_0xcb5b('0x0'));exports[_0xcb5b('0x1')]=function(){return function(){return client[_0xcb5b('0x2')](_0xcb5b('0x3'),{'options':{'raw':!![],'where':{'role':_0xcb5b('0x4')},'attributes':['id','name','online',_0xcb5b('0x5'),_0xcb5b('0x6'),_0xcb5b('0x7'),_0xcb5b('0x8'),_0xcb5b('0x9'),_0xcb5b('0xa'),_0xcb5b('0xb'),_0xcb5b('0xc'),_0xcb5b('0xd'),_0xcb5b('0xe'),_0xcb5b('0xf'),_0xcb5b('0x10'),_0xcb5b('0x11'),_0xcb5b('0x12'),'openchannelCapacity']},'log':_0xcb5b('0x1')});};}; \ No newline at end of file +var _0x52c4=['smsCapacity','whatsappCapacity','../client','getAgents','GetUser','agent','name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x52c4,0xb6));var _0x452c=function(_0xa26138,_0x3563c9){_0xa26138=_0xa26138-0x0;var _0x13a8bd=_0x52c4[_0xa26138];return _0x13a8bd;};'use strict';var client=require(_0x452c('0x0'));exports[_0x452c('0x1')]=function(){return function(){return client['Request'](_0x452c('0x2'),{'options':{'raw':!![],'where':{'role':_0x452c('0x3')},'attributes':['id',_0x452c('0x4'),'online',_0x452c('0x5'),_0x452c('0x6'),_0x452c('0x7'),_0x452c('0x8'),_0x452c('0x9'),'faxPause',_0x452c('0xa'),_0x452c('0xb'),_0x452c('0xc'),_0x452c('0xd'),_0x452c('0xe'),_0x452c('0xf'),_0x452c('0x10'),_0x452c('0x11'),'openchannelCapacity']},'log':_0x452c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 8f65065..ed74c1d 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 _0xfa2b=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x4c6e43,_0x5450fd){var _0xda9fe3=function(_0x115df5){while(--_0x115df5){_0x4c6e43['push'](_0x4c6e43['shift']());}};_0xda9fe3(++_0x5450fd);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x2c5fd1,_0x307b67){_0x2c5fd1=_0x2c5fd1-0x0;var _0x4f2274=_0xfa2b[_0x2c5fd1];return _0x4f2274;};'use strict';var client=require(_0xbfa2('0x0'));exports[_0xbfa2('0x1')]=function(_0x29f6cf,_0x9a9b55){return client[_0xbfa2('0x2')](_0xbfa2('0x3'),{'body':_0x9a9b55,'options':{'where':{'id':_0x29f6cf}},'log':_0xbfa2('0x4')});};exports[_0xbfa2('0x5')]=function(_0x116ab4,_0x43f8d9){return client[_0xbfa2('0x2')](_0xbfa2('0x6'),{'body':_0x43f8d9,'options':{'where':{'id':_0x116ab4}},'log':_0xbfa2('0x7')});}; \ No newline at end of file +var _0x59c3=['update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x59c3,0x133));var _0x359c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x59c3[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x359c('0x0'));exports[_0x359c('0x1')]=function(_0x3f470b,_0x26f8f6){return client[_0x359c('0x2')](_0x359c('0x3'),{'body':_0x26f8f6,'options':{'where':{'id':_0x3f470b}},'log':'updateWhatsappInteraction'});};exports[_0x359c('0x4')]=function(_0x225098,_0x61333a){return client[_0x359c('0x2')](_0x359c('0x5'),{'body':_0x61333a,'options':{'where':{'id':_0x225098}},'log':_0x359c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 9b55327..b7d9985 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 _0x80e5=['createWhatsappMessage','../client','create','Request','CreateWhatsappMessage'];(function(_0x15fe66,_0x3622ea){var _0x52003e=function(_0x20257a){while(--_0x20257a){_0x15fe66['push'](_0x15fe66['shift']());}};_0x52003e(++_0x3622ea);}(_0x80e5,0xa1));var _0x580e=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0x80e5[_0x349b5c];return _0x3efcac;};'use strict';var client=require(_0x580e('0x0'));exports[_0x580e('0x1')]=function(_0xee145d){return client[_0x580e('0x2')](_0x580e('0x3'),{'body':_0xee145d,'log':_0x580e('0x4')});}; \ No newline at end of file +var _0x7d9c=['create','Request','createWhatsappMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7d9c,0x1c7));var _0xc7d9=function(_0x1c018e,_0xf39aaa){_0x1c018e=_0x1c018e-0x0;var _0x41c05b=_0x7d9c[_0x1c018e];return _0x41c05b;};'use strict';var client=require(_0xc7d9('0x0'));exports[_0xc7d9('0x1')]=function(_0x475cba){return client[_0xc7d9('0x2')]('CreateWhatsappMessage',{'body':_0x475cba,'log':_0xc7d9('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 85a8e59..511d71a 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 _0x5ba3=['strategy','User','name','online','whatsappPause','../client','Request','GetWhatsappQueue','timeout'];(function(_0x4624b9,_0x19cfad){var _0x53d0fa=function(_0x148dc8){while(--_0x148dc8){_0x4624b9['push'](_0x4624b9['shift']());}};_0x53d0fa(++_0x19cfad);}(_0x5ba3,0x140));var _0x35ba=function(_0x48ecd3,_0x5e11f5){_0x48ecd3=_0x48ecd3-0x0;var _0x4643c9=_0x5ba3[_0x48ecd3];return _0x4643c9;};'use strict';var client=require(_0x35ba('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x35ba('0x1')](_0x35ba('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x35ba('0x3'),_0x35ba('0x4')],'include':[{'model':_0x35ba('0x5'),'as':'Agents','attributes':['id',_0x35ba('0x6'),_0x35ba('0x7'),_0x35ba('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x4b0f=['name','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','Agents'];(function(_0x5cc9bb,_0x5967d0){var _0x12623c=function(_0x2fe03c){while(--_0x2fe03c){_0x5cc9bb['push'](_0x5cc9bb['shift']());}};_0x12623c(++_0x5967d0);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x4d745e,_0x508b76){_0x4d745e=_0x4d745e-0x0;var _0x4b759a=_0x4b0f[_0x4d745e];return _0x4b759a;};'use strict';var client=require('../client');exports[_0xf4b0('0x0')]=function(){return function(){return client[_0xf4b0('0x1')](_0xf4b0('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf4b0('0x3'),_0xf4b0('0x4')],'include':[{'model':_0xf4b0('0x5'),'as':_0xf4b0('0x6'),'attributes':['id',_0xf4b0('0x7'),_0xf4b0('0x8'),_0xf4b0('0x9')]}]},'log':_0xf4b0('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 609dc43..78212ac 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 _0x34ac=['DESC','../client','create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport'];(function(_0x131dfc,_0x513ef2){var _0x4f56ff=function(_0x5d34aa){while(--_0x5d34aa){_0x131dfc['push'](_0x131dfc['shift']());}};_0x4f56ff(++_0x513ef2);}(_0x34ac,0xda));var _0xc34a=function(_0x33244e,_0x3d66cf){_0x33244e=_0x33244e-0x0;var _0x377ca5=_0x34ac[_0x33244e];return _0x377ca5;};'use strict';var client=require(_0xc34a('0x0'));exports[_0xc34a('0x1')]=function(_0x5b22b6){return client[_0xc34a('0x2')]('CreateWhatsappQueueReport',{'body':_0x5b22b6,'log':_0xc34a('0x3')});};exports[_0xc34a('0x4')]=function(_0xb23bd8,_0x2433cd){return client[_0xc34a('0x2')](_0xc34a('0x5'),{'body':_0x2433cd,'options':{'where':{'uniqueid':_0xb23bd8},'order':[['id',_0xc34a('0x6')]],'limit':0x1},'log':_0xc34a('0x5')});}; \ No newline at end of file +var _0xa593=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x48adf4,_0x41ffe1){var _0x503de5=function(_0xf0de6d){while(--_0xf0de6d){_0x48adf4['push'](_0x48adf4['shift']());}};_0x503de5(++_0x41ffe1);}(_0xa593,0x137));var _0x3a59=function(_0x42c29c,_0x53600d){_0x42c29c=_0x42c29c-0x0;var _0x141694=_0xa593[_0x42c29c];return _0x141694;};'use strict';var client=require(_0x3a59('0x0'));exports[_0x3a59('0x1')]=function(_0x2034b0){return client[_0x3a59('0x2')](_0x3a59('0x3'),{'body':_0x2034b0,'log':_0x3a59('0x3')});};exports[_0x3a59('0x4')]=function(_0x36d13a,_0x1d90d8){return client[_0x3a59('0x2')](_0x3a59('0x5'),{'body':_0x1d90d8,'options':{'where':{'uniqueid':_0x36d13a},'order':[['id',_0x3a59('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ 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 d30af09..d95c025 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 _0xd1ce=['channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','./strategy','string','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','createQueue','atimeout'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0xd1ce,0x123));var _0xed1c=function(_0x36f3c1,_0x3e1bd6){_0x36f3c1=_0x36f3c1-0x0;var _0x14f86a=_0xd1ce[_0x36f3c1];return _0x14f86a;};'use strict';var schema=require(_0xed1c('0x0'));var _=require(_0xed1c('0x1'));var util=require(_0xed1c('0x2'));var seqqueue=require(_0xed1c('0x3'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0xed1c('0x4'));var queue=schema({'name':{'type':_0xed1c('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xed1c('0x6')}});function writeLog(_0x378508,_0x254e94,_0x3f85c6){return logger[_0xed1c('0x7')](util[_0xed1c('0x8')](_0xed1c('0x9'),_0x378508,_0x254e94[_0xed1c('0xa')],_0x3f85c6));}function handleFindAgent(_0x399c5c){return function(_0x3283a1){return _0x3283a1[_0xed1c('0xa')][_0xed1c('0xb')]()===_0x399c5c[_0xed1c('0xb')]();};}exports['consequence']=function(_0x131d64,_0x3232ac,_0xd95d6d,_0x4e9d90){return function(_0x13873d){try{var _0x299d3a={'name':_0x3232ac[0x0],'timeout':_0x3232ac[0x1]};var _0x132116=queue[_0xed1c('0x0')](_0x299d3a,{'typecast':!![]});if(_0x132116[_0xed1c('0xc')]){logger[_0xed1c('0xd')](_0xed1c('0xe'),_0x131d64,_[_0xed1c('0xf')](_0x132116,_0xed1c('0x10'))[_0xed1c('0x11')](',\x20'));_0x13873d[_0xed1c('0x12')]();}else{var _0x54c5da=_[_0xed1c('0x13')](_0xd95d6d[_0xed1c('0x14')],handleFindAgent(_0x299d3a[_0xed1c('0xa')]));if(_0x54c5da){var _0x1ff621=(_0x299d3a[_0xed1c('0x15')]||0xa)*0x3e8;var _0x3a793d,_0xeab41a;var _0x11a0dd=seqqueue[_0xed1c('0x16')](_0x1ff621);_0x11a0dd['id']=_0x131d64;_0x11a0dd[_0xed1c('0x17')]=_0x1ff621;_0x11a0dd[_0xed1c('0x18')]=_0x4e9d90[_0xed1c('0x18')];writeLog(_0x131d64,_0x54c5da,util['format'](_0xed1c('0x19'),_0x1ff621));_0xd95d6d[_0xed1c('0x1a')][_0x131d64]['on'](_0xed1c('0x1b'),function(){logger['info'](_0xed1c('0x1c'),_0x131d64);clearTimeout(_0xeab41a);_0xeab41a=undefined;_0x11a0dd[_0xed1c('0x1d')]();if(_0xd95d6d['rules'][_0x131d64]){delete _0xd95d6d[_0xed1c('0x1a')][_0x131d64];}_0x13873d[_0xed1c('0x12')]();});_0xd95d6d['rules'][_0x131d64]['on'](_0xed1c('0x1e'),function(){if(_0xd95d6d[_0xed1c('0x1a')][_0x131d64]){delete _0xd95d6d[_0xed1c('0x1a')][_0x131d64];}});_0xeab41a=setTimeout(function(){logger[_0xed1c('0x7')](_0xed1c('0x1f'),_0x131d64);clearTimeout(_0xeab41a);_0x11a0dd['close']();_0x13873d['next']();},_0x1ff621);strategy['agent'](_0x11a0dd,_0x54c5da,_0xd95d6d,_0x4e9d90);}else{logger[_0xed1c('0xd')](_0xed1c('0x20'),_0x131d64,_0x299d3a[_0xed1c('0xa')]);_0x13873d[_0xed1c('0x12')]();}}}catch(_0x1104f9){console[_0xed1c('0x21')](_0x1104f9);logger[_0xed1c('0xd')](_0xed1c('0x22'),_0x131d64,_0x1104f9['stack']);_0x13873d[_0xed1c('0x12')]();}};}; \ No newline at end of file +var _0x803d=['error','[%s][AGENT]\x20%s','message','join','stop','find','timeout','atimeout','channel','START:%s','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','close','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','lodash','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','length'];(function(_0xf5b44a,_0x4338c8){var _0x22484e=function(_0x59bc72){while(--_0x59bc72){_0xf5b44a['push'](_0xf5b44a['shift']());}};_0x22484e(++_0x4338c8);}(_0x803d,0x185));var _0xd803=function(_0x41a62d,_0x1059a8){_0x41a62d=_0x41a62d-0x0;var _0x2448e2=_0x803d[_0x41a62d];return _0x2448e2;};'use strict';var schema=require(_0xd803('0x0'));var _=require(_0xd803('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xd803('0x2'))(_0xd803('0x3'));var strategy=require(_0xd803('0x4'));var queue=schema({'name':{'type':_0xd803('0x5'),'required':!![],'message':_0xd803('0x6')},'timeout':{'type':_0xd803('0x7'),'message':_0xd803('0x8')}});function writeLog(_0x562219,_0x22c527,_0x483759){return logger['info'](util[_0xd803('0x9')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x562219,_0x22c527[_0xd803('0xa')],_0x483759));}function handleFindAgent(_0xedbe29){return function(_0x3dc801){return _0x3dc801[_0xd803('0xa')][_0xd803('0xb')]()===_0xedbe29['toLowerCase']();};}exports[_0xd803('0xc')]=function(_0x4c2f34,_0x246ef3,_0x460ef6,_0x55eaec){return function(_0x54a949){try{var _0x49af9e={'name':_0x246ef3[0x0],'timeout':_0x246ef3[0x1]};var _0x3b93f2=queue[_0xd803('0x0')](_0x49af9e,{'typecast':!![]});if(_0x3b93f2[_0xd803('0xd')]){logger[_0xd803('0xe')](_0xd803('0xf'),_0x4c2f34,_['map'](_0x3b93f2,_0xd803('0x10'))[_0xd803('0x11')](',\x20'));_0x54a949[_0xd803('0x12')]();}else{var _0x32a873=_[_0xd803('0x13')](_0x460ef6['agents'],handleFindAgent(_0x49af9e[_0xd803('0xa')]));if(_0x32a873){var _0x2c6261=(_0x49af9e[_0xd803('0x14')]||0xa)*0x3e8;var _0x414f26,_0xba716e;var _0x19046a=seqqueue['createQueue'](_0x2c6261);_0x19046a['id']=_0x4c2f34;_0x19046a[_0xd803('0x15')]=_0x2c6261;_0x19046a[_0xd803('0x16')]=_0x55eaec[_0xd803('0x16')];writeLog(_0x4c2f34,_0x32a873,util[_0xd803('0x9')](_0xd803('0x17'),_0x2c6261));_0x460ef6[_0xd803('0x18')][_0x4c2f34]['on']('end',function(){logger[_0xd803('0x19')](_0xd803('0x1a'),_0x4c2f34);clearTimeout(_0xba716e);_0xba716e=undefined;_0x19046a['close']();if(_0x460ef6['rules'][_0x4c2f34]){delete _0x460ef6[_0xd803('0x18')][_0x4c2f34];}_0x54a949[_0xd803('0x12')]();});_0x460ef6[_0xd803('0x18')][_0x4c2f34]['on'](_0xd803('0x1b'),function(){if(_0x460ef6[_0xd803('0x18')][_0x4c2f34]){delete _0x460ef6[_0xd803('0x18')][_0x4c2f34];}});_0xba716e=setTimeout(function(){logger[_0xd803('0x19')]('[%s][AGENT]\x20ROUTING\x20END',_0x4c2f34);clearTimeout(_0xba716e);_0x19046a[_0xd803('0x1c')]();_0x54a949['next']();},_0x2c6261);strategy['agent'](_0x19046a,_0x32a873,_0x460ef6,_0x55eaec);}else{logger[_0xd803('0xe')](_0xd803('0x1d'),_0x4c2f34,_0x49af9e[_0xd803('0xa')]);_0x54a949['stop']();}}}catch(_0x5f37f1){console['log'](_0x5f37f1);logger[_0xd803('0xe')]('[%s][QUEUE]\x20%s',_0x4c2f34,_0x5f37f1[_0xd803('0x1e')]);_0x54a949[_0xd803('0x12')]();}};}; \ 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 8d41941..aad63a0 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 _0xdc97=['lodash','moment','aws-sdk','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','postText','message','amazonlex','dialogState','Failed','next'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdc97,0x13b));var _0x7dc9=function(_0x1c8284,_0x18401d){_0x1c8284=_0x1c8284-0x0;var _0x5764b9=_0xdc97[_0x1c8284];return _0x5764b9;};'use strict';var _=require(_0x7dc9('0x0'));var moment=require(_0x7dc9('0x1'));var AWS=require(_0x7dc9('0x2'));var utils=require('./utils');var logger=require(_0x7dc9('0x3'))('routing');var rpc={'chatMessage':require(_0x7dc9('0x4')),'openchannelMessage':require(_0x7dc9('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x7dc9('0x6')),'faxMessage':require(_0x7dc9('0x7')),'whatsappMessage':require(_0x7dc9('0x8'))};exports[_0x7dc9('0x9')]=function(_0x589f02,_0x2636ef){return function(_0x4f91c7){try{if(!_['isNil'](this[_0x7dc9('0xa')][_0x7dc9('0xb')])){logger[_0x7dc9('0xc')](_0x7dc9('0xd'),_0x589f02,_0x7dc9('0xe'));return _0x4f91c7['next']();}var _0xb2fa2a={'ContactId':this[_0x7dc9('0xf')]['id'],'sentAt':moment()[_0x7dc9('0x10')](_0x7dc9('0x11')),'direction':_0x7dc9('0x12')};var _0x3c2af5=this[_0x7dc9('0x13')];if(_0x3c2af5==='chat'){_0xb2fa2a['ChatWebsiteId']=this['account']['id'];}else{_0xb2fa2a[_['upperFirst'](_0x3c2af5)+_0x7dc9('0x14')]=this[_0x7dc9('0x15')]['id'];}_0xb2fa2a[_['upperFirst'](_0x3c2af5)+_0x7dc9('0x16')]=this[_0x7dc9('0xa')]['id'];if(this[_0x7dc9('0xa')][_0x7dc9('0x17')]){var _0x31d43d=_0x2636ef[0x4];if(!_[_0x7dc9('0x18')](_0x31d43d)){_0xb2fa2a['body']=utils[_0x7dc9('0x19')](_0x31d43d,this);return rpc[_0x3c2af5+_0x7dc9('0x1a')][_0x7dc9('0x1b')](_0xb2fa2a)[_0x7dc9('0x1c')](function(_0x11606f){logger[_0x7dc9('0xc')](_0x7dc9('0xd'),_0x589f02,_0xb2fa2a[_0x7dc9('0x1d')]);})[_0x7dc9('0x1e')](function(_0x5a6e04){logger[_0x7dc9('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x589f02,JSON[_0x7dc9('0x20')](_0x5a6e04));})[_0x7dc9('0x21')](function(){logger['info'](_0x7dc9('0x22'),_0x589f02);_0x4f91c7[_0x7dc9('0x23')]();});}else{logger[_0x7dc9('0xc')](_0x7dc9('0x24'),_0x589f02);_0x4f91c7[_0x7dc9('0x23')]();}}else{var _0x184bfd=this;var _0x2dad65=new AWS[(_0x7dc9('0x25'))]({'accessKeyId':_0x2636ef[0x0],'secretAccessKey':_0x2636ef[0x1],'region':_0x2636ef[0x2]});var _0x155cc4={'botAlias':_0x7dc9('0x26'),'botName':_0x2636ef[0x3],'inputText':this['message']['body'],'userId':this[_0x7dc9('0x13')]+':'+this[_0x7dc9('0xa')]['id']['toString']()};_0x2dad65[_0x7dc9('0x27')](_0x155cc4,function(_0x27f7fa,_0x5e9525){if(_0x27f7fa){logger[_0x7dc9('0x1f')](_0x7dc9('0xd'),_0x589f02,_0x27f7fa[_0x7dc9('0x28')]);_0x4f91c7['next']();}else if(_0x5e9525&&_0x5e9525[_0x7dc9('0x28')]){_0x184bfd[_0x7dc9('0x1d')][_0x7dc9('0x29')]=_0x5e9525;_0xb2fa2a['body']=_0x5e9525['message'];return rpc[_0x3c2af5+'Message'][_0x7dc9('0x1b')](_0xb2fa2a)[_0x7dc9('0x1c')](function(_0x5843bf){logger['info'](_0x7dc9('0xd'),_0x589f02,_0xb2fa2a['body']);if(_0x5e9525[_0x7dc9('0x2a')]==_0x7dc9('0x2b')){_0x4f91c7[_0x7dc9('0x2c')]();}else{_0x4f91c7[_0x7dc9('0x23')]();}})[_0x7dc9('0x1e')](function(_0x450124){logger[_0x7dc9('0x1f')](_0x7dc9('0xd'),_0x589f02,JSON[_0x7dc9('0x20')](_0x450124));_0x4f91c7[_0x7dc9('0x2c')]();});}else{_0x4f91c7[_0x7dc9('0x2c')]();}});}}catch(_0x2a456c){logger['error']('[%s][AMAZONLEX]\x20%s',_0x589f02,JSON['stringify'](_0x2a456c));_0x4f91c7['stop']();}};}; \ No newline at end of file +var _0x5fab=['message','toString','postText','next','amazonlex','Message','Failed','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId','InteractionId','created','isEmpty','body','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x45d4f3,_0x2fa12b){var _0x4deec2=function(_0x405794){while(--_0x405794){_0x45d4f3['push'](_0x45d4f3['shift']());}};_0x4deec2(++_0x2fa12b);}(_0x5fab,0x177));var _0xb5fa=function(_0x1a2d37,_0x19cd85){_0x1a2d37=_0x1a2d37-0x0;var _0x4d5e76=_0x5fab[_0x1a2d37];return _0x4d5e76;};'use strict';var _=require(_0xb5fa('0x0'));var moment=require(_0xb5fa('0x1'));var AWS=require('aws-sdk');var utils=require(_0xb5fa('0x2'));var logger=require(_0xb5fa('0x3'))(_0xb5fa('0x4'));var rpc={'chatMessage':require(_0xb5fa('0x5')),'openchannelMessage':require(_0xb5fa('0x6')),'mailMessage':require(_0xb5fa('0x7')),'smsMessage':require(_0xb5fa('0x8')),'faxMessage':require(_0xb5fa('0x9')),'whatsappMessage':require(_0xb5fa('0xa'))};exports[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return function(_0x2e3804){try{if(!_[_0xb5fa('0xc')](this[_0xb5fa('0xd')]['UserId'])){logger[_0xb5fa('0xe')](_0xb5fa('0xf'),_0x4a0249,_0xb5fa('0x10'));return _0x2e3804['next']();}var _0x5b5ea8={'ContactId':this[_0xb5fa('0x11')]['id'],'sentAt':moment()[_0xb5fa('0x12')](_0xb5fa('0x13')),'direction':_0xb5fa('0x14')};var _0x35ad13=this[_0xb5fa('0x15')];if(_0x35ad13===_0xb5fa('0x16')){_0x5b5ea8[_0xb5fa('0x17')]=this[_0xb5fa('0x18')]['id'];}else{_0x5b5ea8[_['upperFirst'](_0x35ad13)+_0xb5fa('0x19')]=this[_0xb5fa('0x18')]['id'];}_0x5b5ea8[_['upperFirst'](_0x35ad13)+_0xb5fa('0x1a')]=this['interaction']['id'];if(this[_0xb5fa('0xd')][_0xb5fa('0x1b')]){var _0x40c914=_0x5d70f6[0x4];if(!_[_0xb5fa('0x1c')](_0x40c914)){_0x5b5ea8[_0xb5fa('0x1d')]=utils['getMustacheRender'](_0x40c914,this);return rpc[_0x35ad13+'Message'][_0xb5fa('0x1e')](_0x5b5ea8)[_0xb5fa('0x1f')](function(_0x31f252){logger[_0xb5fa('0xe')]('[%s][AMAZONLEX]\x20%s',_0x4a0249,_0x5b5ea8['body']);})[_0xb5fa('0x20')](function(_0x1f7f05){logger[_0xb5fa('0x21')](_0xb5fa('0xf'),_0x4a0249,JSON[_0xb5fa('0x22')](_0x1f7f05));})[_0xb5fa('0x23')](function(){logger[_0xb5fa('0xe')](_0xb5fa('0x24'),_0x4a0249);_0x2e3804[_0xb5fa('0x25')]();});}else{logger[_0xb5fa('0xe')](_0xb5fa('0x26'),_0x4a0249);_0x2e3804[_0xb5fa('0x25')]();}}else{var _0x5cd822=this;var _0x432bfa=new AWS['LexRuntime']({'accessKeyId':_0x5d70f6[0x0],'secretAccessKey':_0x5d70f6[0x1],'region':_0x5d70f6[0x2]});var _0x37ae06={'botAlias':'$LATEST','botName':_0x5d70f6[0x3],'inputText':this[_0xb5fa('0x27')][_0xb5fa('0x1d')],'userId':this['channel']+':'+this[_0xb5fa('0xd')]['id'][_0xb5fa('0x28')]()};_0x432bfa[_0xb5fa('0x29')](_0x37ae06,function(_0x47f71a,_0x32a85c){if(_0x47f71a){logger[_0xb5fa('0x21')](_0xb5fa('0xf'),_0x4a0249,_0x47f71a['message']);_0x2e3804[_0xb5fa('0x2a')]();}else if(_0x32a85c&&_0x32a85c['message']){_0x5cd822[_0xb5fa('0x1d')][_0xb5fa('0x2b')]=_0x32a85c;_0x5b5ea8[_0xb5fa('0x1d')]=_0x32a85c[_0xb5fa('0x27')];return rpc[_0x35ad13+_0xb5fa('0x2c')][_0xb5fa('0x1e')](_0x5b5ea8)[_0xb5fa('0x1f')](function(_0x20d649){logger['info']('[%s][AMAZONLEX]\x20%s',_0x4a0249,_0x5b5ea8['body']);if(_0x32a85c['dialogState']==_0xb5fa('0x2d')){_0x2e3804[_0xb5fa('0x2a')]();}else{_0x2e3804[_0xb5fa('0x25')]();}})[_0xb5fa('0x20')](function(_0x534884){logger[_0xb5fa('0x21')](_0xb5fa('0xf'),_0x4a0249,JSON[_0xb5fa('0x22')](_0x534884));_0x2e3804[_0xb5fa('0x2a')]();});}else{_0x2e3804[_0xb5fa('0x2a')]();}});}}catch(_0x142bfa){logger[_0xb5fa('0x21')](_0xb5fa('0xf'),_0x4a0249,JSON[_0xb5fa('0x22')](_0x142bfa));_0x2e3804[_0xb5fa('0x25')]();}};}; \ 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 a987d04..6676245 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 _0x556c=['read','subject','startsWith','Re:','Re:\x20','chat','account','upperFirst','InteractionId','mail','Smtp','service','host','secure','authentication','auth','pass','inReplyTo','messageId','html','','replace','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','catch','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','create','body','error','[%s][AUTOREPLY]\x20%s','stop','lodash','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','created','info','next','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x556c,0x18d));var _0xc556=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x556c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc556('0x0'));var moment=require(_0xc556('0x1'));var utils=require('./utils');var logger=require(_0xc556('0x2'))('routing');var rpc={'chatMessage':require(_0xc556('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xc556('0x4')),'smsMessage':require(_0xc556('0x5')),'faxMessage':require(_0xc556('0x6')),'whatsappMessage':require(_0xc556('0x7'))};var mailRpc=require('../../mailRpc');exports[_0xc556('0x8')]=function(_0x3b713c,_0x3d6eac){return function(_0x5a9b4b){try{if(_0x3d6eac[0x0]==='1'&&(_[_0xc556('0x9')](this[_0xc556('0xa')][_0xc556('0xb')])||!this[_0xc556('0xa')]['created'])){logger[_0xc556('0xc')]('[%s][AUTOREPLY]\x20%s',_0x3b713c,'Autoreply\x20already\x20sent');return _0x5a9b4b[_0xc556('0xd')]();}var _0x4b72af=this[_0xc556('0xe')];var _0x352479={'body':utils[_0xc556('0xf')](_0x3d6eac[0x1],this),'ContactId':this[_0xc556('0x10')]['id'],'sentAt':moment()[_0xc556('0x11')](_0xc556('0x12')),'direction':_0xc556('0x13')};if(this[_0xc556('0x14')]){_0x352479['to']=this[_0xc556('0x14')]['from']||'';_0x352479['cc']=this[_0xc556('0x14')]['cc']||'';_0x352479[_0xc556('0x15')]=this['message']['to']||'';_0x352479[_0xc556('0x16')]=this[_0xc556('0x14')][_0xc556('0x16')]||'';_0x352479[_0xc556('0x17')]=!![];if(this[_0xc556('0x14')]['subject']){_0x352479[_0xc556('0x18')]='';_0x352479[_0xc556('0x18')]+=_[_0xc556('0x19')](this[_0xc556('0x14')][_0xc556('0x18')],_0xc556('0x1a'))?'':_0xc556('0x1b');_0x352479[_0xc556('0x18')]+=this[_0xc556('0x14')][_0xc556('0x18')];}}if(this[_0xc556('0xe')]===_0xc556('0x1c')){_0x352479['ChatWebsiteId']=this[_0xc556('0x1d')]['id'];}else{_0x352479[_[_0xc556('0x1e')](this['channel'])+'AccountId']=this['account']['id'];}_0x352479[_['upperFirst'](this[_0xc556('0xe')])+_0xc556('0x1f')]=this['interaction']['id'];if(rpc[this['channel']+'Message']){if(this[_0xc556('0xe')]===_0xc556('0x20')){var _0x1f70c={'tls':{'rejectUnauthorized':![]}};if(this[_0xc556('0x1d')][_0xc556('0x21')][_0xc556('0x22')]){_0x1f70c['service']=this[_0xc556('0x1d')]['Smtp'][_0xc556('0x22')];}else{_0x1f70c[_0xc556('0x23')]=this['account'][_0xc556('0x21')][_0xc556('0x23')];_0x1f70c['port']=this[_0xc556('0x1d')][_0xc556('0x21')]['port'];_0x1f70c[_0xc556('0x24')]=this['account'][_0xc556('0x21')][_0xc556('0x24')];}if(this['account'][_0xc556('0x21')][_0xc556('0x25')]){_0x1f70c[_0xc556('0x26')]={'user':this[_0xc556('0x1d')][_0xc556('0x21')]['user'],'pass':this[_0xc556('0x1d')][_0xc556('0x21')][_0xc556('0x27')]};}_0x352479[_0xc556('0x28')]=this['message'][_0xc556('0x29')];_0x352479[_0xc556('0x2a')]=_0xc556('0x2b')+_[_0xc556('0x2c')](_0x352479['body'],'','','sendMailMessage','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','[RPC][%s][AUTOREPLY]\x20%s','finally','catch','error','stringify','stop','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x2805bd,_0x5f4cea){var _0x421381=function(_0x32af17){while(--_0x32af17){_0x2805bd['push'](_0x2805bd['shift']());}};_0x421381(++_0x5f4cea);}(_0xc5b5,0x1b2));var _0x5c5b=function(_0x137e04,_0x3c0799){_0x137e04=_0x137e04-0x0;var _0x4c6762=_0xc5b5[_0x137e04];return _0x4c6762;};'use strict';var _=require('lodash');var moment=require('moment');var utils=require(_0x5c5b('0x0'));var logger=require(_0x5c5b('0x1'))('routing');var rpc={'chatMessage':require(_0x5c5b('0x2')),'openchannelMessage':require(_0x5c5b('0x3')),'mailMessage':require(_0x5c5b('0x4')),'smsMessage':require(_0x5c5b('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x5c5b('0x6'))};var mailRpc=require(_0x5c5b('0x7'));exports[_0x5c5b('0x8')]=function(_0x6cb181,_0x1e4ffd){return function(_0x15bc02){try{if(_0x1e4ffd[0x0]==='1'&&(_['isNil'](this[_0x5c5b('0x9')][_0x5c5b('0xa')])||!this['interaction'][_0x5c5b('0xa')])){logger['info'](_0x5c5b('0xb'),_0x6cb181,_0x5c5b('0xc'));return _0x15bc02[_0x5c5b('0xd')]();}var _0x484f47=this['channel'];var _0xe8a979={'body':utils[_0x5c5b('0xe')](_0x1e4ffd[0x1],this),'ContactId':this[_0x5c5b('0xf')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x5c5b('0x10')]){_0xe8a979['to']=this[_0x5c5b('0x10')][_0x5c5b('0x11')]||'';_0xe8a979['cc']=this[_0x5c5b('0x10')]['cc']||'';_0xe8a979[_0x5c5b('0x11')]=this['message']['to']||'';_0xe8a979[_0x5c5b('0x12')]=this[_0x5c5b('0x10')][_0x5c5b('0x12')]||'';_0xe8a979[_0x5c5b('0x13')]=!![];if(this[_0x5c5b('0x10')][_0x5c5b('0x14')]){_0xe8a979[_0x5c5b('0x14')]='';_0xe8a979[_0x5c5b('0x14')]+=_[_0x5c5b('0x15')](this['message'][_0x5c5b('0x14')],_0x5c5b('0x16'))?'':_0x5c5b('0x17');_0xe8a979[_0x5c5b('0x14')]+=this[_0x5c5b('0x10')][_0x5c5b('0x14')];}}if(this['channel']===_0x5c5b('0x18')){_0xe8a979[_0x5c5b('0x19')]=this[_0x5c5b('0x1a')]['id'];}else{_0xe8a979[_['upperFirst'](this[_0x5c5b('0x1b')])+'AccountId']=this['account']['id'];}_0xe8a979[_['upperFirst'](this['channel'])+_0x5c5b('0x1c')]=this[_0x5c5b('0x9')]['id'];if(rpc[this[_0x5c5b('0x1b')]+_0x5c5b('0x1d')]){if(this[_0x5c5b('0x1b')]==='mail'){var _0x517e5c={'tls':{'rejectUnauthorized':![]}};if(this[_0x5c5b('0x1a')][_0x5c5b('0x1e')][_0x5c5b('0x1f')]){_0x517e5c[_0x5c5b('0x1f')]=this[_0x5c5b('0x1a')][_0x5c5b('0x1e')][_0x5c5b('0x1f')];}else{_0x517e5c[_0x5c5b('0x20')]=this[_0x5c5b('0x1a')]['Smtp']['host'];_0x517e5c[_0x5c5b('0x21')]=this[_0x5c5b('0x1a')][_0x5c5b('0x1e')]['port'];_0x517e5c[_0x5c5b('0x22')]=this[_0x5c5b('0x1a')][_0x5c5b('0x1e')][_0x5c5b('0x22')];}if(this['account'][_0x5c5b('0x1e')][_0x5c5b('0x23')]){_0x517e5c[_0x5c5b('0x24')]={'user':this[_0x5c5b('0x1a')][_0x5c5b('0x1e')][_0x5c5b('0x25')],'pass':this['account'][_0x5c5b('0x1e')][_0x5c5b('0x26')]};}_0xe8a979[_0x5c5b('0x27')]=this[_0x5c5b('0x10')]['messageId'];_0xe8a979[_0x5c5b('0x28')]=_0x5c5b('0x29')+_['replace'](_0xe8a979['body'],']+(>|$)/g,''),'priorityTrue':_0x660669[0x1],'priorityFalse':_0x660669[0x2]};var _0x22267b=gotoif[_0x6123('0x0')](_0x44641e,{'typecast':!![]});if(_0x22267b[_0x6123('0xb')]){logger['error'](_0x6123('0xc'),_0x1fd71b,_['map'](_0x22267b,_0x6123('0xd'))[_0x6123('0xe')](',\x20'));_0x3d4f3a[_0x6123('0xf')]();}else{try{var _0x538237=eval('('+_0x44641e[_0x6123('0x10')]+')');var _0x598c48=_0x538237?_0x44641e['priorityTrue']:_0x44641e['priorityFalse'];logger[_0x6123('0x11')](_0x6123('0x12'),_0x1fd71b,_0x44641e['condition'],_0x538237,_0x598c48||_0x6123('0x13'));if(_0x598c48){var _0x4cc972=_[_0x6123('0x14')](_0x3d4f3a[_0x6123('0x15')](),{'p':_0x598c48});if(_0x4cc972>=0x0){logger[_0x6123('0x11')](_0x6123('0x16'),_0x1fd71b,_0x598c48||_0x6123('0x13'),_0x4cc972);_0x3d4f3a[_0x6123('0x13')](_0x4cc972);}else{logger[_0x6123('0x11')](_0x6123('0x17'),_0x1fd71b,_0x598c48||_0x6123('0x13'));_0x3d4f3a[_0x6123('0xf')]();}}else{_0x3d4f3a[_0x6123('0x13')]();}}catch(_0x30608c){logger[_0x6123('0x18')](_0x6123('0x19'),_0x1fd71b,_0x30608c[_0x6123('0xd')]);_0x3d4f3a['stop']();}}}catch(_0x55190c){logger[_0x6123('0x18')](_0x6123('0xc'),_0x1fd71b,JSON['stringify'](_0x55190c));_0x3d4f3a['stop']();}};}; \ No newline at end of file +var _0x06d5=['fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','stop','condition','priorityTrue','priorityFalse','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence'];(function(_0x27067b,_0x2ff538){var _0x27b611=function(_0x19507c){while(--_0x19507c){_0x27067b['push'](_0x27067b['shift']());}};_0x27b611(++_0x2ff538);}(_0x06d5,0x1e3));var _0x506d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x06d5[_0x59ee6f];return _0x4c0979;};'use strict';var schema=require('validate');var _=require(_0x506d('0x0'));var htmlToText=require(_0x506d('0x1'));var utils=require(_0x506d('0x2'));var logger=require(_0x506d('0x3'))(_0x506d('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x506d('0x5')},'priorityTrue':{'type':_0x506d('0x6'),'message':_0x506d('0x7')},'priorityFalse':{'type':'number','message':_0x506d('0x8')}});exports[_0x506d('0x9')]=function(_0x1cf40c,_0x5d0f9e){return function(_0x4ada47){try{var _0x3c966a={'condition':htmlToText[_0x506d('0xa')](utils[_0x506d('0xb')](_0x5d0f9e[0x0],this),{'wordwrap':![]})[_0x506d('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5d0f9e[0x1],'priorityFalse':_0x5d0f9e[0x2]};var _0x1ad6d6=gotoif['validate'](_0x3c966a,{'typecast':!![]});if(_0x1ad6d6[_0x506d('0xd')]){logger[_0x506d('0xe')](_0x506d('0xf'),_0x1cf40c,_[_0x506d('0x10')](_0x1ad6d6,_0x506d('0x11'))['join'](',\x20'));_0x4ada47[_0x506d('0x12')]();}else{try{var _0x3c8194=eval('('+_0x3c966a[_0x506d('0x13')]+')');var _0x145fe4=_0x3c8194?_0x3c966a[_0x506d('0x14')]:_0x3c966a[_0x506d('0x15')];logger[_0x506d('0x16')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1cf40c,_0x3c966a[_0x506d('0x13')],_0x3c8194,_0x145fe4||_0x506d('0x17'));if(_0x145fe4){var _0x5b0fa7=_[_0x506d('0x18')](_0x4ada47['rules'](),{'p':_0x145fe4});if(_0x5b0fa7>=0x0){logger['info'](_0x506d('0x19'),_0x1cf40c,_0x145fe4||_0x506d('0x17'),_0x5b0fa7);_0x4ada47[_0x506d('0x17')](_0x5b0fa7);}else{logger[_0x506d('0x16')](_0x506d('0x1a'),_0x1cf40c,_0x145fe4||_0x506d('0x17'));_0x4ada47[_0x506d('0x12')]();}}else{_0x4ada47[_0x506d('0x17')]();}}catch(_0x4f17ea){logger[_0x506d('0xe')](_0x506d('0x1b'),_0x1cf40c,_0x4f17ea[_0x506d('0x11')]);_0x4ada47['stop']();}}}catch(_0x4a28ae){logger[_0x506d('0xe')](_0x506d('0xf'),_0x1cf40c,JSON[_0x506d('0x1c')](_0x4a28ae));_0x4ada47[_0x506d('0x12')]();}};}; \ 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 f82425b..c904a28 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 _0x88b3=['findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','validate','lodash','../../../../config/logger','routing','number','length','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x88b3,0x71));var _0x388b=function(_0x29579f,_0x2b98ea){_0x29579f=_0x29579f-0x0;var _0x36cb5a=_0x88b3[_0x29579f];return _0x36cb5a;};'use strict';var schema=require(_0x388b('0x0'));var _=require(_0x388b('0x1'));var logger=require(_0x388b('0x2'))(_0x388b('0x3'));var gotop=schema({'priority':{'type':_0x388b('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x7e48f7,_0x5e0858){return function(_0x3d4315){try{var _0x563573={'priority':_0x5e0858[0x0]};var _0x5305b1=gotop[_0x388b('0x0')](_0x563573,{'typecast':!![]});if(_0x5305b1[_0x388b('0x5')]){logger['error'](_0x388b('0x6'),_0x7e48f7,_['map'](_0x5305b1,_0x388b('0x7'))[_0x388b('0x8')](',\x20'));_0x3d4315[_0x388b('0x9')]();}else{logger[_0x388b('0xa')](_0x388b('0xb'),_0x7e48f7,_0x563573[_0x388b('0xc')]);if(_0x563573[_0x388b('0xc')]){var _0x106d7d=_[_0x388b('0xd')](_0x3d4315[_0x388b('0xe')](),{'p':_0x563573[_0x388b('0xc')]});if(_0x106d7d>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x7e48f7,_0x563573[_0x388b('0xc')]||_0x388b('0xf'),_0x106d7d);_0x3d4315[_0x388b('0xf')](_0x106d7d);}else{logger[_0x388b('0xa')](_0x388b('0x10'),_0x7e48f7,_0x563573[_0x388b('0xc')]||_0x388b('0xf'));_0x3d4315[_0x388b('0x9')]();}}else{_0x3d4315[_0x388b('0xf')]();}}}catch(_0x3880c4){logger[_0x388b('0x11')](_0x388b('0x6'),_0x7e48f7,JSON['stringify'](_0x3880c4));_0x3d4315['stop']();}};}; \ No newline at end of file +var _0x9683=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','error','[%s][GOTOP]\x20%s','map','message','stop','info','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','lodash','../../../../config/logger','routing'];(function(_0x27062d,_0x2e90f9){var _0x166d7d=function(_0x33b9d8){while(--_0x33b9d8){_0x27062d['push'](_0x27062d['shift']());}};_0x166d7d(++_0x2e90f9);}(_0x9683,0xe1));var _0x3968=function(_0x53f04f,_0x141d6c){_0x53f04f=_0x53f04f-0x0;var _0x1c0457=_0x9683[_0x53f04f];return _0x1c0457;};'use strict';var schema=require('validate');var _=require(_0x3968('0x0'));var logger=require(_0x3968('0x1'))(_0x3968('0x2'));var gotop=schema({'priority':{'type':_0x3968('0x3'),'required':!![],'message':_0x3968('0x4')}});exports[_0x3968('0x5')]=function(_0x278e7d,_0x438770){return function(_0x3b042d){try{var _0x49455e={'priority':_0x438770[0x0]};var _0x1d0543=gotop[_0x3968('0x6')](_0x49455e,{'typecast':!![]});if(_0x1d0543['length']){logger[_0x3968('0x7')](_0x3968('0x8'),_0x278e7d,_[_0x3968('0x9')](_0x1d0543,_0x3968('0xa'))['join'](',\x20'));_0x3b042d[_0x3968('0xb')]();}else{logger[_0x3968('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x278e7d,_0x49455e['priority']);if(_0x49455e[_0x3968('0xd')]){var _0x17a145=_['findIndex'](_0x3b042d[_0x3968('0xe')](),{'p':_0x49455e[_0x3968('0xd')]});if(_0x17a145>=0x0){logger[_0x3968('0xc')](_0x3968('0xf'),_0x278e7d,_0x49455e[_0x3968('0xd')]||'next',_0x17a145);_0x3b042d[_0x3968('0x10')](_0x17a145);}else{logger[_0x3968('0xc')](_0x3968('0x11'),_0x278e7d,_0x49455e[_0x3968('0xd')]||_0x3968('0x10'));_0x3b042d['stop']();}}else{_0x3b042d[_0x3968('0x10')]();}}}catch(_0x423a6e){logger[_0x3968('0x7')](_0x3968('0x8'),_0x278e7d,JSON[_0x3968('0x12')](_0x423a6e));_0x3b042d[_0x3968('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 82702f3..8260b15 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 _0x2f79=['create','then','info','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','account','upperFirst','AccountId','channel','InteractionId','Message'];(function(_0x333fe0,_0x249c5d){var _0x99a383=function(_0x767086){while(--_0x767086){_0x333fe0['push'](_0x333fe0['shift']());}};_0x99a383(++_0x249c5d);}(_0x2f79,0x175));var _0x92f7=function(_0x5bc910,_0x1122bd){_0x5bc910=_0x5bc910-0x0;var _0x2b606c=_0x2f79[_0x5bc910];return _0x2b606c;};'use strict';var _=require(_0x92f7('0x0'));var utils=require(_0x92f7('0x1'));var logger=require('../../../../config/logger')(_0x92f7('0x2'));var rpc={'chatMessage':require(_0x92f7('0x3')),'openchannelMessage':require(_0x92f7('0x4')),'mailMessage':require(_0x92f7('0x5')),'smsMessage':require(_0x92f7('0x6')),'faxMessage':require(_0x92f7('0x7')),'whatsappMessage':require(_0x92f7('0x8'))};exports[_0x92f7('0x9')]=function(_0x532405,_0x157d0a){return function(_0x16e5c){try{var _0x2c73ba={'body':utils[_0x92f7('0xa')](_0x157d0a[0x0],this),'ContactId':this[_0x92f7('0xb')]['id']};if(this['channel']===_0x92f7('0xc')){_0x2c73ba['ChatWebsiteId']=this[_0x92f7('0xd')]['id'];}else{_0x2c73ba[_[_0x92f7('0xe')](this['channel'])+_0x92f7('0xf')]=this[_0x92f7('0xd')]['id'];}_0x2c73ba[_[_0x92f7('0xe')](this[_0x92f7('0x10')])+_0x92f7('0x11')]=this['interaction']['id'];if(rpc[this[_0x92f7('0x10')]+_0x92f7('0x12')]){return rpc[this[_0x92f7('0x10')]+_0x92f7('0x12')][_0x92f7('0x13')](_0x2c73ba)[_0x92f7('0x14')](function(_0x20c653){logger[_0x92f7('0x15')](_0x92f7('0x16'),_0x532405,_0x2c73ba[_0x92f7('0x17')]);_0x16e5c[_0x92f7('0x18')]();})[_0x92f7('0x19')](function(_0xdb32f0){logger[_0x92f7('0x1a')](_0x92f7('0x16'),_0x532405,JSON['stringify'](_0xdb32f0));_0x16e5c['stop']();});}}catch(_0x4636ba){logger['error'](_0x92f7('0x16'),_0x532405,JSON[_0x92f7('0x1b')](_0x4636ba));_0x16e5c['stop']();}};}; \ No newline at end of file +var _0xdaf5=['next','catch','error','lodash','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','ChatWebsiteId','upperFirst','AccountId','account','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body'];(function(_0x2e4a1c,_0x4bf96f){var _0x8c2c74=function(_0x28a35f){while(--_0x28a35f){_0x2e4a1c['push'](_0x2e4a1c['shift']());}};_0x8c2c74(++_0x4bf96f);}(_0xdaf5,0xb2));var _0x5daf=function(_0x22b005,_0x2a6515){_0x22b005=_0x22b005-0x0;var _0x58bd11=_0xdaf5[_0x22b005];return _0x58bd11;};'use strict';var _=require(_0x5daf('0x0'));var utils=require(_0x5daf('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x5daf('0x2')),'openchannelMessage':require(_0x5daf('0x3')),'mailMessage':require(_0x5daf('0x4')),'smsMessage':require(_0x5daf('0x5')),'faxMessage':require(_0x5daf('0x6')),'whatsappMessage':require(_0x5daf('0x7'))};exports[_0x5daf('0x8')]=function(_0x3f2622,_0x5c6dba){return function(_0x2e946e){try{var _0x4186fc={'body':utils[_0x5daf('0x9')](_0x5c6dba[0x0],this),'ContactId':this['contact']['id']};if(this[_0x5daf('0xa')]==='chat'){_0x4186fc[_0x5daf('0xb')]=this['account']['id'];}else{_0x4186fc[_[_0x5daf('0xc')](this[_0x5daf('0xa')])+_0x5daf('0xd')]=this[_0x5daf('0xe')]['id'];}_0x4186fc[_[_0x5daf('0xc')](this['channel'])+'InteractionId']=this[_0x5daf('0xf')]['id'];if(rpc[this[_0x5daf('0xa')]+_0x5daf('0x10')]){return rpc[this[_0x5daf('0xa')]+_0x5daf('0x10')][_0x5daf('0x11')](_0x4186fc)[_0x5daf('0x12')](function(_0x4d2e41){logger[_0x5daf('0x13')](_0x5daf('0x14'),_0x3f2622,_0x4186fc[_0x5daf('0x15')]);_0x2e946e[_0x5daf('0x16')]();})[_0x5daf('0x17')](function(_0x51ab78){logger[_0x5daf('0x18')](_0x5daf('0x14'),_0x3f2622,JSON['stringify'](_0x51ab78));_0x2e946e['stop']();});}}catch(_0x5ad1e5){logger[_0x5daf('0x18')](_0x5daf('0x14'),_0x3f2622,JSON['stringify'](_0x5ad1e5));_0x2e946e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 587e39d..e660adb 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 _0xc86f=['error','[%s][NOOP]\x20%s','stop','../../../../config/logger','routing','consequence','info','getMustacheRender'];(function(_0x2d76cb,_0x40bf84){var _0x2c2a32=function(_0x4429f4){while(--_0x4429f4){_0x2d76cb['push'](_0x2d76cb['shift']());}};_0x2c2a32(++_0x40bf84);}(_0xc86f,0xb3));var _0xfc86=function(_0x2c3f35,_0x57221b){_0x2c3f35=_0x2c3f35-0x0;var _0xf9105e=_0xc86f[_0x2c3f35];return _0xf9105e;};'use strict';var utils=require('./utils');var logger=require(_0xfc86('0x0'))(_0xfc86('0x1'));exports[_0xfc86('0x2')]=function(_0x1cb8af,_0x142c2e){return function(_0x5c599b){try{logger[_0xfc86('0x3')]('[%s][NOOP]\x20%s',_0x1cb8af,utils[_0xfc86('0x4')](_0x142c2e[0x0],this));_0x5c599b['next']();}catch(_0x3c00e2){logger[_0xfc86('0x5')](_0xfc86('0x6'),_0x1cb8af,JSON['stringify'](_0x3c00e2));_0x5c599b[_0xfc86('0x7')]();}};}; \ No newline at end of file +var _0x6075=['./utils','../../../../config/logger','consequence','info','next','error','stringify'];(function(_0x2f79a1,_0x490ba0){var _0x425a33=function(_0x2fd979){while(--_0x2fd979){_0x2f79a1['push'](_0x2f79a1['shift']());}};_0x425a33(++_0x490ba0);}(_0x6075,0x142));var _0x5607=function(_0xced35,_0x3221ff){_0xced35=_0xced35-0x0;var _0x2500e6=_0x6075[_0xced35];return _0x2500e6;};'use strict';var utils=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))('routing');exports[_0x5607('0x2')]=function(_0x10b0a4,_0x5ab30d){return function(_0x48cde9){try{logger[_0x5607('0x3')]('[%s][NOOP]\x20%s',_0x10b0a4,utils['getMustacheRender'](_0x5ab30d[0x0],this));_0x48cde9[_0x5607('0x4')]();}catch(_0x48abca){logger[_0x5607('0x5')]('[%s][NOOP]\x20%s',_0x10b0a4,JSON[_0x5607('0x6')](_0x48abca));_0x48cde9['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 94cae26..a2d8773 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 _0x7217=['info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','map','join','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20APPLICATION\x20END','close','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','moment','ioredis','../../../../config/environment','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','pick','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','AccountId'];(function(_0x17cbff,_0x1c3c0b){var _0x50f15b=function(_0x23f20e){while(--_0x23f20e){_0x17cbff['push'](_0x17cbff['shift']());}};_0x50f15b(++_0x1c3c0b);}(_0x7217,0x19e));var _0x7721=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x7217[_0x5447fd];return _0x15b28a;};'use strict';var schema=require(_0x7721('0x0'));var _=require('lodash');var util=require(_0x7721('0x1'));var seqqueue=require(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));var attributes=['id',_0x7721('0xb'),_0x7721('0xc'),_0x7721('0xd'),_0x7721('0xe'),_0x7721('0xf')];function emit(_0xfa8835,_0x138740,_0x2c3986){io['to'](_0xfa8835)['emit'](_0x138740,_0x2c3986);}function emitChannelQueueInteraction(_0x461d1a,_0x29bc8f,_0x8729a6,_0xf78099,_0xa8977c,_0x409b37,_0x1e7fd7,_0x27b36b){var _0x55b4ca=_[_0x7721('0x10')](_0x8729a6);_0x55b4ca[_0x7721('0xb')]=_0x27b36b;_0x55b4ca['queue']=_0x29bc8f;_0x55b4ca[_0x7721('0xc')]=_0xf78099;_0x55b4ca['id']=_0xa8977c;if(_0x409b37){_0x1e7fd7[util[_0x7721('0x11')](_0x7721('0x12'),_0x461d1a)][_0xa8977c]=_[_0x7721('0x13')](_0x55b4ca,attributes);}else{delete _0x1e7fd7[util['format'](_0x7721('0x12'),_0x461d1a)][_0xa8977c];}emit(util[_0x7721('0x11')]('%s:queue:%s',_0x461d1a,_0x29bc8f),util['format']('%s_queue_waiting_interaction:%s',_0x461d1a,_0x409b37?_0x7721('0x14'):_0x7721('0x15')),_[_0x7721('0x13')](_0x55b4ca,attributes));}var rpc={'openchannelQueueReport':require(_0x7721('0x16')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x7721('0x17')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x7721('0x18')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x7721('0x19'),'required':!![],'message':_0x7721('0x1a')},'timeout':{'type':_0x7721('0x1b'),'message':_0x7721('0x1c')}});function startRouting(_0x2286e5,_0x40af90,_0x402820,_0x413263){if(_0x2286e5&&_0x40af90&&_0x402820){_0x40af90[_0x7721('0x1d')]+=0x1;var _0xaeccc4={'uniqueid':_0x2286e5,'from':_0x402820['body']?_0x402820[_0x7721('0x1e')][_0x7721('0xe')]:'','joinAt':moment()[_0x7721('0x11')](_0x7721('0x1f')),'ContactId':_0x402820['contact']?_0x402820[_0x7721('0x20')]['id']:null,'ListId':_0x402820['list']?_0x402820[_0x7721('0x21')]['id']:null};_0xaeccc4[_[_0x7721('0x22')](_0x402820[_0x7721('0x23')])+_0x7721('0x24')]=_0x40af90['id']||null;_0xaeccc4[_[_0x7721('0x22')](_0x402820[_0x7721('0x23')])+_0x7721('0x25')]=_0x402820['interaction']?_0x402820[_0x7721('0x26')]['id']:null;_0xaeccc4[_[_0x7721('0x22')](_0x402820[_0x7721('0x23')])+_0x7721('0x27')]=_0x402820[_0x7721('0x28')]?_0x402820[_0x7721('0x28')]['id']:null;_0xaeccc4[_[_0x7721('0x22')](_0x402820[_0x7721('0x23')])+(_0x402820[_0x7721('0x23')]!=='chat'?_0x7721('0x29'):'WebsiteId')]=_0x402820['account']?_0x402820[_0x7721('0xc')]['id']:null;logger[_0x7721('0x2a')](util[_0x7721('0x11')](_0x7721('0x2b'),_0x2286e5,_0x40af90[_0x7721('0x2c')]));emitChannelQueueInteraction(_0x402820[_0x7721('0x23')],_0x40af90[_0x7721('0x2c')],_0xaeccc4,_0x402820[_0x7721('0xc')]['name'],_0x402820[_0x7721('0x28')]['id'],!![],_0x413263,_0x40af90['id']);if(rpc[_0x402820[_0x7721('0x23')]+'QueueReport']){return rpc[_0x402820['channel']+_0x7721('0x2d')][_0x7721('0x2e')](_0xaeccc4)['catch'](function(_0x46f772){logger[_0x7721('0x2f')](_0x7721('0x30'));});}}}function stopRouting(_0x58d54b,_0x3d9a32,_0x1ff31b,_0x1492d4){if(_0x58d54b&&_0x3d9a32){_0x3d9a32[_0x7721('0x1d')]-=0x1;var _0xc0f3c4={'leaveAt':moment()['format'](_0x7721('0x1f')),'acceptAt':moment()[_0x7721('0x11')](_0x7721('0x1f')),'reason':'accepted'};logger[_0x7721('0x2a')](util[_0x7721('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x58d54b,_0x3d9a32[_0x7721('0x2c')]));emitChannelQueueInteraction(_0x1ff31b['channel'],_0x3d9a32[_0x7721('0x2c')],_0x1ff31b[_0x7721('0x1e')],_0x1ff31b[_0x7721('0xc')][_0x7721('0x2c')],_0x1ff31b[_0x7721('0x28')]['id'],![],_0x1492d4,_0x3d9a32['id']);if(rpc[_0x1ff31b[_0x7721('0x23')]+_0x7721('0x2d')]){return rpc[_0x1ff31b[_0x7721('0x23')]+_0x7721('0x2d')][_0x7721('0x31')](_0x58d54b,_0xc0f3c4)[_0x7721('0x32')](function(_0x5c806d){logger[_0x7721('0x2f')]('update\x20queue\x20report');});}}}function endRouting(_0x212384,_0x35614c,_0x7942f7,_0x1d03de){if(_0x212384&&_0x35614c){_0x35614c[_0x7721('0x1d')]-=0x1;var _0x378ba5={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x7721('0x33')};logger[_0x7721('0x2a')](util[_0x7721('0x11')](_0x7721('0x34'),_0x212384,_0x35614c['name']));emitChannelQueueInteraction(_0x7942f7[_0x7721('0x23')],_0x35614c['name'],_0x7942f7[_0x7721('0x1e')],_0x7942f7[_0x7721('0xc')]['name'],_0x7942f7[_0x7721('0x28')]['id'],![],_0x1d03de);if(rpc[_0x7942f7[_0x7721('0x23')]+'QueueReport']){return rpc[_0x7942f7['channel']+_0x7721('0x2d')][_0x7721('0x31')](_0x212384,_0x378ba5)[_0x7721('0x32')](function(_0x15e34d){logger['error'](_0x7721('0x35'));});}}}function handleFindQueue(_0x120de9){return function(_0x40ce8c){return _0x40ce8c[_0x7721('0x2c')][_0x7721('0x36')]()===_0x120de9['toLowerCase']();};}exports[_0x7721('0x37')]=function(_0x4a2c28,_0xaa3216,_0x4a5b59,_0x2333b8){return function(_0x15fa2c){try{var _0x231dad={'name':_0xaa3216[0x0],'timeout':_0xaa3216[0x1]};var _0x49e0c5=queue[_0x7721('0x0')](_0x231dad,{'typecast':!![]});if(_0x49e0c5[_0x7721('0x38')]){logger[_0x7721('0x2f')]('[%s][QUEUE]\x20%s',_0x4a2c28,_[_0x7721('0x39')](_0x49e0c5,_0x7721('0x28'))[_0x7721('0x3a')](',\x20'));_0x15fa2c[_0x7721('0x3b')]();}else{var _0x135dbc=_[_0x7721('0x3c')](_0x4a5b59[_0x2333b8[_0x7721('0x23')]+'Queues'],handleFindQueue(_0x231dad['name']));if(_0x135dbc){startRouting(_0x4a2c28,_0x135dbc,_0x2333b8,_0x4a5b59);var _0x1ac3af=(_0x135dbc[_0x7721('0x33')]||0xa)*0x3e8;var _0x421aae=(_0x231dad[_0x7721('0x33')]||0x14)*0x3e8;var _0x335145,_0x15181b;if(_0x1ac3af>_0x421aae){_0x421aae=_0x1ac3af;}var _0x1d2ea5=seqqueue[_0x7721('0x3d')](_0x1ac3af);_0x1d2ea5['id']=_0x4a2c28;_0x1d2ea5[_0x7721('0x3e')]=_0x1ac3af;_0x1d2ea5[_0x7721('0x3f')]=_0x421aae;_0x1d2ea5['channel']=_0x2333b8['channel'];_0x4a5b59[_0x7721('0x40')][_0x4a2c28]['on'](_0x7721('0x41'),function(){logger[_0x7721('0x2a')](_0x7721('0x42'),_0x4a2c28);stopRouting(_0x4a2c28,_0x135dbc,_0x2333b8,_0x4a5b59);clearTimeout(_0x335145);_0x335145=undefined;_0x1d2ea5['close'](!![]);if(_0x4a5b59[_0x7721('0x40')][_0x4a2c28]){delete _0x4a5b59[_0x7721('0x40')][_0x4a2c28];}_0x15fa2c['stop']();});_0x4a5b59[_0x7721('0x40')][_0x4a2c28]['on']('complete',function(){if(_0x4a5b59[_0x7721('0x40')][_0x4a2c28]){delete _0x4a5b59['rules'][_0x4a2c28];}});_0x335145=setTimeout(function(){logger[_0x7721('0x2a')](_0x7721('0x43'),_0x4a2c28);endRouting(_0x4a2c28,_0x135dbc,_0x2333b8,_0x4a5b59);clearTimeout(_0x335145);_0x1d2ea5[_0x7721('0x44')](!![]);_0x15fa2c['next']();},_0x421aae);switch(_0x135dbc[_0x7721('0x45')]){case _0x7721('0x46'):strategy['rrmemory'](_0x1d2ea5,_0x135dbc,_0x4a5b59,_0x2333b8);break;default:strategy[_0x7721('0x47')](_0x1d2ea5,_0x135dbc,_0x4a5b59,_0x2333b8);}}else{logger[_0x7721('0x2f')](_0x7721('0x48'),_0x4a2c28,_0x231dad['name']);_0x15fa2c[_0x7721('0x3b')]();}}}catch(_0x5a32b6){console[_0x7721('0x49')](_0x5a32b6);logger[_0x7721('0x2f')](_0x7721('0x4a'),_0x4a2c28,_0x5a32b6[_0x7721('0x4b')]);_0x15fa2c[_0x7721('0x3b')]();}};}; \ No newline at end of file +var _0x3e74=['beepall','log','stack','validate','util','seq-queue','moment','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','account','queue','from','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../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','MessageId','message','channel','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','atimeout','qtimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','next','strategy','rrmemory'];(function(_0x29d6e6,_0x264220){var _0xc75ff0=function(_0x214f6b){while(--_0x214f6b){_0x29d6e6['push'](_0x29d6e6['shift']());}};_0xc75ff0(++_0x264220);}(_0x3e74,0x175));var _0x43e7=function(_0x4c26b0,_0x1d5025){_0x4c26b0=_0x4c26b0-0x0;var _0x35dc17=_0x3e74[_0x4c26b0];return _0x35dc17;};'use strict';var schema=require(_0x43e7('0x0'));var _=require('lodash');var util=require(_0x43e7('0x1'));var seqqueue=require(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('routing');var strategy=require(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));var attributes=['id',_0x43e7('0x9'),_0x43e7('0xa'),_0x43e7('0xb'),_0x43e7('0xc'),'joinAt'];function emit(_0x212c6c,_0x554d44,_0x54948c){io['to'](_0x212c6c)[_0x43e7('0xd')](_0x554d44,_0x54948c);}function emitChannelQueueInteraction(_0x4139c9,_0x5c34f4,_0x2803d9,_0x513707,_0xf7c520,_0x37302c,_0x4ebc8e,_0x3eb206){var _0xc960ea=_[_0x43e7('0xe')](_0x2803d9);_0xc960ea[_0x43e7('0x9')]=_0x3eb206;_0xc960ea['queue']=_0x5c34f4;_0xc960ea['account']=_0x513707;_0xc960ea['id']=_0xf7c520;if(_0x37302c){_0x4ebc8e[util[_0x43e7('0xf')](_0x43e7('0x10'),_0x4139c9)][_0xf7c520]=_[_0x43e7('0x11')](_0xc960ea,attributes);}else{delete _0x4ebc8e[util['format']('%sQueuesWaitingInteractions',_0x4139c9)][_0xf7c520];}emit(util[_0x43e7('0xf')](_0x43e7('0x12'),_0x4139c9,_0x5c34f4),util[_0x43e7('0xf')](_0x43e7('0x13'),_0x4139c9,_0x37302c?'save':'remove'),_[_0x43e7('0x11')](_0xc960ea,attributes));}var rpc={'openchannelQueueReport':require(_0x43e7('0x14')),'mailQueueReport':require(_0x43e7('0x15')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x43e7('0x16')),'whatsappQueueReport':require(_0x43e7('0x17'))};var queue=schema({'name':{'type':_0x43e7('0x18'),'required':!![],'message':_0x43e7('0x19')},'timeout':{'type':_0x43e7('0x1a'),'message':_0x43e7('0x1b')}});function startRouting(_0x619236,_0x1441ef,_0x2377a3,_0xab63cf){if(_0x619236&&_0x1441ef&&_0x2377a3){_0x1441ef[_0x43e7('0x1c')]+=0x1;var _0x177ee1={'uniqueid':_0x619236,'from':_0x2377a3['body']?_0x2377a3[_0x43e7('0x1d')][_0x43e7('0xc')]:'','joinAt':moment()['format'](_0x43e7('0x1e')),'ContactId':_0x2377a3[_0x43e7('0x1f')]?_0x2377a3[_0x43e7('0x1f')]['id']:null,'ListId':_0x2377a3[_0x43e7('0x20')]?_0x2377a3[_0x43e7('0x20')]['id']:null};_0x177ee1[_[_0x43e7('0x21')](_0x2377a3['channel'])+_0x43e7('0x22')]=_0x1441ef['id']||null;_0x177ee1[_['upperFirst'](_0x2377a3['channel'])+_0x43e7('0x23')]=_0x2377a3[_0x43e7('0x24')]?_0x2377a3['interaction']['id']:null;_0x177ee1[_[_0x43e7('0x21')](_0x2377a3['channel'])+_0x43e7('0x25')]=_0x2377a3['message']?_0x2377a3[_0x43e7('0x26')]['id']:null;_0x177ee1[_[_0x43e7('0x21')](_0x2377a3[_0x43e7('0x27')])+(_0x2377a3[_0x43e7('0x27')]!=='chat'?'AccountId':_0x43e7('0x28'))]=_0x2377a3['account']?_0x2377a3[_0x43e7('0xa')]['id']:null;logger[_0x43e7('0x29')](util[_0x43e7('0xf')](_0x43e7('0x2a'),_0x619236,_0x1441ef['name']));emitChannelQueueInteraction(_0x2377a3[_0x43e7('0x27')],_0x1441ef[_0x43e7('0x2b')],_0x177ee1,_0x2377a3[_0x43e7('0xa')][_0x43e7('0x2b')],_0x2377a3[_0x43e7('0x26')]['id'],!![],_0xab63cf,_0x1441ef['id']);if(rpc[_0x2377a3[_0x43e7('0x27')]+_0x43e7('0x2c')]){return rpc[_0x2377a3[_0x43e7('0x27')]+_0x43e7('0x2c')][_0x43e7('0x2d')](_0x177ee1)[_0x43e7('0x2e')](function(_0x19725a){logger[_0x43e7('0x2f')](_0x43e7('0x30'));});}}}function stopRouting(_0x4bdb17,_0x238321,_0x44f6b0,_0x3b8f78){if(_0x4bdb17&&_0x238321){_0x238321[_0x43e7('0x1c')]-=0x1;var _0x4251c8={'leaveAt':moment()['format'](_0x43e7('0x1e')),'acceptAt':moment()[_0x43e7('0xf')](_0x43e7('0x1e')),'reason':_0x43e7('0x31')};logger['info'](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x4bdb17,_0x238321[_0x43e7('0x2b')]));emitChannelQueueInteraction(_0x44f6b0[_0x43e7('0x27')],_0x238321[_0x43e7('0x2b')],_0x44f6b0[_0x43e7('0x1d')],_0x44f6b0[_0x43e7('0xa')][_0x43e7('0x2b')],_0x44f6b0['message']['id'],![],_0x3b8f78,_0x238321['id']);if(rpc[_0x44f6b0['channel']+'QueueReport']){return rpc[_0x44f6b0['channel']+'QueueReport']['update'](_0x4bdb17,_0x4251c8)['catch'](function(_0x14d888){logger['error'](_0x43e7('0x32'));});}}}function endRouting(_0x8e9f40,_0x31bc78,_0x50a2d0,_0x40f72f){if(_0x8e9f40&&_0x31bc78){_0x31bc78[_0x43e7('0x1c')]-=0x1;var _0x101d45={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x43e7('0x1e')),'reason':_0x43e7('0x33')};logger[_0x43e7('0x29')](util[_0x43e7('0xf')](_0x43e7('0x34'),_0x8e9f40,_0x31bc78[_0x43e7('0x2b')]));emitChannelQueueInteraction(_0x50a2d0[_0x43e7('0x27')],_0x31bc78[_0x43e7('0x2b')],_0x50a2d0['body'],_0x50a2d0[_0x43e7('0xa')][_0x43e7('0x2b')],_0x50a2d0['message']['id'],![],_0x40f72f);if(rpc[_0x50a2d0[_0x43e7('0x27')]+'QueueReport']){return rpc[_0x50a2d0[_0x43e7('0x27')]+_0x43e7('0x2c')][_0x43e7('0x35')](_0x8e9f40,_0x101d45)[_0x43e7('0x2e')](function(_0x35ac85){logger[_0x43e7('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x574a93){return function(_0x30dfa9){return _0x30dfa9[_0x43e7('0x2b')][_0x43e7('0x36')]()===_0x574a93[_0x43e7('0x36')]();};}exports[_0x43e7('0x37')]=function(_0x4a4a85,_0x32a451,_0x4227c4,_0x575439){return function(_0x3628e0){try{var _0x51a69c={'name':_0x32a451[0x0],'timeout':_0x32a451[0x1]};var _0x2ad8ef=queue['validate'](_0x51a69c,{'typecast':!![]});if(_0x2ad8ef[_0x43e7('0x38')]){logger[_0x43e7('0x2f')](_0x43e7('0x39'),_0x4a4a85,_[_0x43e7('0x3a')](_0x2ad8ef,'message')['join'](',\x20'));_0x3628e0[_0x43e7('0x3b')]();}else{var _0x40c509=_[_0x43e7('0x3c')](_0x4227c4[_0x575439[_0x43e7('0x27')]+'Queues'],handleFindQueue(_0x51a69c['name']));if(_0x40c509){startRouting(_0x4a4a85,_0x40c509,_0x575439,_0x4227c4);var _0x5dd988=(_0x40c509[_0x43e7('0x33')]||0xa)*0x3e8;var _0x57f5d0=(_0x51a69c[_0x43e7('0x33')]||0x14)*0x3e8;var _0x4b3a59,_0x5b28db;if(_0x5dd988>_0x57f5d0){_0x57f5d0=_0x5dd988;}var _0x46b2e6=seqqueue['createQueue'](_0x5dd988);_0x46b2e6['id']=_0x4a4a85;_0x46b2e6[_0x43e7('0x3d')]=_0x5dd988;_0x46b2e6[_0x43e7('0x3e')]=_0x57f5d0;_0x46b2e6[_0x43e7('0x27')]=_0x575439[_0x43e7('0x27')];_0x4227c4['rules'][_0x4a4a85]['on'](_0x43e7('0x3f'),function(){logger[_0x43e7('0x29')](_0x43e7('0x40'),_0x4a4a85);stopRouting(_0x4a4a85,_0x40c509,_0x575439,_0x4227c4);clearTimeout(_0x4b3a59);_0x4b3a59=undefined;_0x46b2e6[_0x43e7('0x41')](!![]);if(_0x4227c4[_0x43e7('0x42')][_0x4a4a85]){delete _0x4227c4[_0x43e7('0x42')][_0x4a4a85];}_0x3628e0['stop']();});_0x4227c4['rules'][_0x4a4a85]['on'](_0x43e7('0x43'),function(){if(_0x4227c4[_0x43e7('0x42')][_0x4a4a85]){delete _0x4227c4[_0x43e7('0x42')][_0x4a4a85];}});_0x4b3a59=setTimeout(function(){logger['info']('[%s][QUEUE]\x20APPLICATION\x20END',_0x4a4a85);endRouting(_0x4a4a85,_0x40c509,_0x575439,_0x4227c4);clearTimeout(_0x4b3a59);_0x46b2e6['close'](!![]);_0x3628e0[_0x43e7('0x44')]();},_0x57f5d0);switch(_0x40c509[_0x43e7('0x45')]){case'rrmemory':strategy[_0x43e7('0x46')](_0x46b2e6,_0x40c509,_0x4227c4,_0x575439);break;default:strategy[_0x43e7('0x47')](_0x46b2e6,_0x40c509,_0x4227c4,_0x575439);}}else{logger[_0x43e7('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x4a4a85,_0x51a69c['name']);_0x3628e0['stop']();}}}catch(_0x4de644){console[_0x43e7('0x48')](_0x4de644);logger[_0x43e7('0x2f')]('[%s][QUEUE]\x20%s',_0x4a4a85,_0x4de644[_0x43e7('0x49')]);_0x3628e0[_0x43e7('0x3b')]();}};}; \ 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 24c6d2a..24c3665 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 _0xe1c6=['handleDrained','handleRun','prototype','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','agents','showNotification','notificationId','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','push','isNil','hideNotification','busyQueue','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','bind','handleTimeout','timeout','drained'];(function(_0x50601d,_0x2f9ef9){var _0xa4b607=function(_0x3d195d){while(--_0x3d195d){_0x50601d['push'](_0x50601d['shift']());}};_0xa4b607(++_0x2f9ef9);}(_0xe1c6,0x1d4));var _0x6e1c=function(_0x9b24a5,_0x47c37a){_0x9b24a5=_0x9b24a5-0x0;var _0x3f4434=_0xe1c6[_0x9b24a5];return _0x3f4434;};'use strict';var _=require(_0x6e1c('0x0'));var uuid=require(_0x6e1c('0x1'));var util=require(_0x6e1c('0x2'));var logger=require(_0x6e1c('0x3'))(_0x6e1c('0x4'));var Agent=function(_0x443212,_0x2ecb7e,_0x5314cb,_0x546bb6){this['notificationId']=uuid['v4']();this[_0x6e1c('0x5')]=_0x443212;this[_0x6e1c('0x6')]=_0x2ecb7e;this[_0x6e1c('0x7')]=_0x5314cb;this['routing']=_0x546bb6;this[_0x6e1c('0x5')]['push'](this['handleRun'][_0x6e1c('0x8')](this),this[_0x6e1c('0x9')][_0x6e1c('0x8')](this));this[_0x6e1c('0x5')]['on'](_0x6e1c('0xa'),this[_0x6e1c('0x9')]['bind'](this));this[_0x6e1c('0x5')]['on'](_0x6e1c('0xb'),this[_0x6e1c('0xc')][_0x6e1c('0x8')](this));};Agent['prototype']['push']=function(){this[_0x6e1c('0x5')]['push'](this[_0x6e1c('0xd')]['bind'](this),this['handleTimeout'][_0x6e1c('0x8')](this));};Agent[_0x6e1c('0xe')][_0x6e1c('0xc')]=function(){this[_0x6e1c('0x9')](!![]);};Agent[_0x6e1c('0xe')]['handleRun']=function(_0x3a8a4d){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x6e1c('0x5')]['id'],this[_0x6e1c('0x6')]['id']);if(_['isNil'](this[_0x6e1c('0x7')]['agents'][this[_0x6e1c('0x6')]['id']])){logger[_0x6e1c('0xf')](_0x6e1c('0x10'),this['squeue']['id'],this[_0x6e1c('0x6')]['id']);setTimeout(this['push'][_0x6e1c('0x8')](this),0x3e8);}else{if(this['routing'][_0x6e1c('0x11')]||util['isAgentAvailable'](this[_0x6e1c('0x5')]['id'],this['realtime']['agents'][this['agent']['id']],this[_0x6e1c('0x5')][_0x6e1c('0x12')],![])){this[_0x6e1c('0x7')][_0x6e1c('0x13')][this[_0x6e1c('0x6')]['id']]['busy']=!![];this['realtime'][_0x6e1c('0x13')][this[_0x6e1c('0x6')]['id']]['busyQueue']=undefined;util[_0x6e1c('0x14')](this[_0x6e1c('0x15')],this[_0x6e1c('0x5')]['id'],this['realtime'][_0x6e1c('0x13')][this[_0x6e1c('0x6')]['id']],null,this[_0x6e1c('0x4')]);util[_0x6e1c('0x16')](this[_0x6e1c('0x5')]['id'],this[_0x6e1c('0x7')][_0x6e1c('0x13')][this['agent']['id']],_0x6e1c('0x17')+(this[_0x6e1c('0x4')][_0x6e1c('0x11')]?_0x6e1c('0x18'):''));}else{logger[_0x6e1c('0xf')](_0x6e1c('0x19'),this[_0x6e1c('0x5')]['id'],this[_0x6e1c('0x6')]['id']);setTimeout(this[_0x6e1c('0x1a')][_0x6e1c('0x8')](this),0x3e8);}}};Agent[_0x6e1c('0xe')][_0x6e1c('0x9')]=function(_0x4a140e){if(_[_0x6e1c('0x1b')](this[_0x6e1c('0x7')][_0x6e1c('0x13')][this[_0x6e1c('0x6')]['id']])){return logger[_0x6e1c('0xf')](_0x6e1c('0x10'),this[_0x6e1c('0x5')]['id'],this[_0x6e1c('0x6')]['id']);}else{logger['info']('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x6e1c('0x5')]['id'],this[_0x6e1c('0x6')]['id']);util[_0x6e1c('0x1c')](this[_0x6e1c('0x15')],this[_0x6e1c('0x5')]['id'],this['realtime'][_0x6e1c('0x13')][this[_0x6e1c('0x6')]['id']],null,this[_0x6e1c('0x4')]);this[_0x6e1c('0x7')][_0x6e1c('0x13')][this[_0x6e1c('0x6')]['id']]['busy']=![];this[_0x6e1c('0x7')]['agents'][this[_0x6e1c('0x6')]['id']][_0x6e1c('0x1d')]=undefined;util['writeLog'](this[_0x6e1c('0x5')]['id'],this[_0x6e1c('0x7')][_0x6e1c('0x13')][this['agent']['id']],_0x4a140e?_0x6e1c('0x1e'):'TIMEOUT');}if(!_0x4a140e){setTimeout(this[_0x6e1c('0x1a')][_0x6e1c('0x8')](this),0x3e8);}};function agent(_0x128663,_0x203acd,_0x280491,_0x7cf0df){return new Agent(_0x128663,_0x203acd,_0x280491,_0x7cf0df);}module[_0x6e1c('0x1f')]=agent; \ No newline at end of file +var _0x4092=['notificationId','agent','realtime','push','handleRun','bind','handleTimeout','squeue','timeout','drained','prototype','isNil','agents','forcedOwnership','isAgentAvailable','busyQueue','showNotification','writeLog',':FORCED','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','TIMEOUT','exports','uuid','./util','../../../../../config/logger','routing'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x4092,0x1af));var _0x2409=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0x4092[_0x43d0dd];return _0x233879;};'use strict';var _=require('lodash');var uuid=require(_0x2409('0x0'));var util=require(_0x2409('0x1'));var logger=require(_0x2409('0x2'))(_0x2409('0x3'));var Agent=function(_0x3e4609,_0x33f295,_0x312b2f,_0x3e6991){this[_0x2409('0x4')]=uuid['v4']();this['squeue']=_0x3e4609;this[_0x2409('0x5')]=_0x33f295;this[_0x2409('0x6')]=_0x312b2f;this[_0x2409('0x3')]=_0x3e6991;this['squeue'][_0x2409('0x7')](this[_0x2409('0x8')][_0x2409('0x9')](this),this[_0x2409('0xa')][_0x2409('0x9')](this));this[_0x2409('0xb')]['on'](_0x2409('0xc'),this['handleTimeout']['bind'](this));this[_0x2409('0xb')]['on'](_0x2409('0xd'),this['handleDrained']['bind'](this));};Agent[_0x2409('0xe')]['push']=function(){this[_0x2409('0xb')][_0x2409('0x7')](this[_0x2409('0x8')]['bind'](this),this['handleTimeout'][_0x2409('0x9')](this));};Agent[_0x2409('0xe')]['handleDrained']=function(){this['handleTimeout'](!![]);};Agent[_0x2409('0xe')][_0x2409('0x8')]=function(_0x5873d3){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x2409('0xb')]['id'],this[_0x2409('0x5')]['id']);if(_[_0x2409('0xf')](this[_0x2409('0x6')][_0x2409('0x10')][this[_0x2409('0x5')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x2409('0x5')]['id']);setTimeout(this[_0x2409('0x7')][_0x2409('0x9')](this),0x3e8);}else{if(this[_0x2409('0x3')][_0x2409('0x11')]||util[_0x2409('0x12')](this['squeue']['id'],this['realtime'][_0x2409('0x10')][this[_0x2409('0x5')]['id']],this['squeue']['channel'],![])){this[_0x2409('0x6')][_0x2409('0x10')][this['agent']['id']]['busy']=!![];this[_0x2409('0x6')][_0x2409('0x10')][this[_0x2409('0x5')]['id']][_0x2409('0x13')]=undefined;util[_0x2409('0x14')](this[_0x2409('0x4')],this[_0x2409('0xb')]['id'],this['realtime']['agents'][this[_0x2409('0x5')]['id']],null,this['routing']);util[_0x2409('0x15')](this[_0x2409('0xb')]['id'],this['realtime'][_0x2409('0x10')][this[_0x2409('0x5')]['id']],'RINGING'+(this[_0x2409('0x3')][_0x2409('0x11')]?_0x2409('0x16'):''));}else{logger[_0x2409('0x17')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x2409('0xb')]['id'],this[_0x2409('0x5')]['id']);setTimeout(this[_0x2409('0x7')]['bind'](this),0x3e8);}}};Agent[_0x2409('0xe')][_0x2409('0xa')]=function(_0x5b4291){if(_[_0x2409('0xf')](this[_0x2409('0x6')][_0x2409('0x10')][this['agent']['id']])){return logger[_0x2409('0x17')](_0x2409('0x18'),this['squeue']['id'],this[_0x2409('0x5')]['id']);}else{logger[_0x2409('0x17')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x2409('0xb')]['id'],this[_0x2409('0x5')]['id']);util[_0x2409('0x19')](this[_0x2409('0x4')],this['squeue']['id'],this['realtime'][_0x2409('0x10')][this[_0x2409('0x5')]['id']],null,this[_0x2409('0x3')]);this[_0x2409('0x6')][_0x2409('0x10')][this[_0x2409('0x5')]['id']][_0x2409('0x1a')]=![];this['realtime'][_0x2409('0x10')][this[_0x2409('0x5')]['id']][_0x2409('0x13')]=undefined;util[_0x2409('0x15')](this[_0x2409('0xb')]['id'],this['realtime'][_0x2409('0x10')][this[_0x2409('0x5')]['id']],_0x5b4291?'STOP':_0x2409('0x1b'));}if(!_0x5b4291){setTimeout(this[_0x2409('0x7')]['bind'](this),0x3e8);}};function agent(_0x3ef828,_0x46cc87,_0x231849,_0x471ad2){return new Agent(_0x3ef828,_0x46cc87,_0x231849,_0x471ad2);}module[_0x2409('0x1c')]=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 0798a2b..58838dd 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 _0x5a04=['uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','RINGING','busy','busyQueue','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','exports','lodash'];(function(_0x10036a,_0x56ba1e){var _0x2bcca6=function(_0x187afe){while(--_0x187afe){_0x10036a['push'](_0x10036a['shift']());}};_0x2bcca6(++_0x56ba1e);}(_0x5a04,0xd1));var _0x45a0=function(_0x211116,_0x5f07a6){_0x211116=_0x211116-0x0;var _0x1de4d1=_0x5a04[_0x211116];return _0x1de4d1;};'use strict';var _=require(_0x45a0('0x0'));var uuid=require(_0x45a0('0x1'));var util=require(_0x45a0('0x2'));var logger=require(_0x45a0('0x3'))(_0x45a0('0x4'));var Beepall=function(_0x5a88b1,_0x1a7005,_0x52362e,_0x368106){this[_0x45a0('0x5')]=uuid['v4']();this[_0x45a0('0x6')]=_0x5a88b1;this[_0x45a0('0x7')]=_0x1a7005;this[_0x45a0('0x8')]=_0x52362e;this[_0x45a0('0x4')]=_0x368106;this[_0x45a0('0x6')][_0x45a0('0x9')](this[_0x45a0('0xa')][_0x45a0('0xb')](this),this[_0x45a0('0xc')][_0x45a0('0xb')](this));this['squeue']['on'](_0x45a0('0xd'),this['handleTimeout']['bind'](this));this[_0x45a0('0x6')]['on'](_0x45a0('0xe'),this[_0x45a0('0xf')][_0x45a0('0xb')](this));};Beepall[_0x45a0('0x10')][_0x45a0('0x9')]=function(){this[_0x45a0('0x6')]['push'](this[_0x45a0('0xa')]['bind'](this),this[_0x45a0('0xc')][_0x45a0('0xb')](this));};Beepall[_0x45a0('0x10')]['handleDrained']=function(_0x315020){this[_0x45a0('0xc')](!![]);};Beepall['prototype']['handleRun']=function(_0x5cb8bd){var _0x271ebb=!![];if(!_[_0x45a0('0x11')](this['queue'])&&!_[_0x45a0('0x11')](this[_0x45a0('0x7')][_0x45a0('0x12')])&&this[_0x45a0('0x7')]['Agents'][_0x45a0('0x13')]>0x0){for(var _0x18643f=0x0,_0x39e542;_0x18643f0x0){for(var _0x525d07=0x0,_0x4ab7ab;_0x525d070x0&&_0x212281[_0x2681b3+_0x0367('0x20')]>=_0x212281[_0x2681b3+_0x0367('0x1f')]){writeLog(_0x2315d7,_0x212281,_0x2681b3[_0x0367('0x21')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x0367('0x22')]=function(_0x13d20f,_0x33d22e,_0x247793,_0x5933de,_0x2ed10e){return sendNotification(!![],_0x13d20f,_0x33d22e,_0x247793,_0x5933de,_0x2ed10e);};exports[_0x0367('0x23')]=function(_0x156038,_0x4f19a0,_0x46461f,_0x301106,_0x4c0925){return sendNotification(![],_0x156038,_0x4f19a0,_0x46461f,_0x301106,_0x4c0925);};exports[_0x0367('0x24')]=writeLog; \ No newline at end of file +var _0x5eb8=['Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','\x20interaction','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','[%s][QUEUE]\x20%s','message','notification:%s','save','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x5eb8,0xb0));var _0x85eb=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0x5eb8[_0x5d9867];return _0x7d2118;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x85eb('0x0'));var Mustache=require(_0x85eb('0x1'));var Redis=require(_0x85eb('0x2'));var config=require(_0x85eb('0x3'));var logger=require(_0x85eb('0x4'))(_0x85eb('0x5'));config[_0x85eb('0x6')]=_[_0x85eb('0x7')](config[_0x85eb('0x6')],{'host':_0x85eb('0x8'),'port':0x18eb});var io=require(_0x85eb('0x9'))(new Redis(config[_0x85eb('0x6')]));function emit(_0x4a8814,_0x16d7b9,_0x3af658){io['to'](_0x4a8814)[_0x85eb('0xa')](_0x16d7b9,_0x3af658);}function sendNotification(_0x5cd4ec,_0x2da3b0,_0x50ea77,_0x1f0036,_0x40d6b6,_0x673228){io['to'](util[_0x85eb('0xb')](_0x85eb('0xc'),_0x1f0036[_0x85eb('0xd')]))[_0x85eb('0xa')]('user:save',_0x1f0036);var _0x163f32=_0x673228||{};var _0x478710=_0x50ea77['split']('.');var _0x2af376={'uniqueid':_0x2da3b0,'channel':_0x478710[0x0],'id':_0x478710[0x1],'title':_0x478710[0x0]+_0x85eb('0xe'),'interactionId':_0x478710[0x2],'queue':_0x40d6b6?_0x40d6b6[_0x85eb('0xd')]:null,'sound':_0x163f32[_0x85eb('0xf')]['notificationSound'],'shake':_0x163f32['account'][_0x85eb('0x10')]};try{if(!_0x163f32['body']){_0x163f32[_0x85eb('0x11')]={};}if(_0x40d6b6){_0x163f32[_0x85eb('0x11')][_0x85eb('0x12')]=_0x40d6b6;}else if(_0x163f32[_0x85eb('0x11')][_0x85eb('0x12')]){delete _0x163f32['body'][_0x85eb('0x12')];}_0x2af376['msg']=utils[_0x85eb('0x13')](_0x163f32[_0x85eb('0xf')][_0x85eb('0x14')],_0x163f32);}catch(_0x5deab1){_0x2af376['msg']='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x85eb('0xb')](_0x85eb('0x15'),_0x2da3b0,_0x5deab1[_0x85eb('0x16')]));}io['to'](util[_0x85eb('0xb')](_0x85eb('0xc'),_0x1f0036[_0x85eb('0xd')]))['emit'](util[_0x85eb('0xb')](_0x85eb('0x17'),_0x5cd4ec?_0x85eb('0x18'):'remove'),_0x2af376);}function writeLog(_0x4b4b38,_0x48bd86,_0x55b9e4){return logger[_0x85eb('0x19')](util[_0x85eb('0xb')](_0x85eb('0x1a'),_0x4b4b38,_0x48bd86[_0x85eb('0xd')],_0x55b9e4));}exports[_0x85eb('0x1b')]=function(_0x3fc6da,_0x5c9895,_0x5491d5,_0x5b48d9){if(_0x5c9895[_0x85eb('0x1c')]){writeLog(_0x3fc6da,_0x5c9895,_0x85eb('0x1d'));return![];}if(!_0x5c9895[_0x85eb('0x1e')]){writeLog(_0x3fc6da,_0x5c9895,_0x85eb('0x1f'));return![];}if(_0x5c9895[_0x5491d5+_0x85eb('0x20')]){writeLog(_0x3fc6da,_0x5c9895,_0x85eb('0x21'));return![];}if(_0x5b48d9&&_0x5c9895['hasOwnProperty'](_0x5491d5+_0x85eb('0x22'))&&_0x5c9895[_0x85eb('0x23')](_0x5491d5+_0x85eb('0x24'))){if(_0x5c9895[_0x5491d5+_0x85eb('0x22')]>0x0&&_0x5c9895[_0x5491d5+_0x85eb('0x24')]>=_0x5c9895[_0x5491d5+'Capacity']){writeLog(_0x3fc6da,_0x5c9895,_0x5491d5[_0x85eb('0x25')]()+_0x85eb('0x26'));return![];}}return!![];};exports[_0x85eb('0x27')]=function(_0x3e7eb9,_0x40f13e,_0x29d262,_0x50541a,_0x562792){return sendNotification(!![],_0x3e7eb9,_0x40f13e,_0x29d262,_0x50541a,_0x562792);};exports[_0x85eb('0x28')]=function(_0x585f2a,_0xa9b14f,_0x5255eb,_0x4229e9,_0x3570f7){return sendNotification(![],_0x585f2a,_0xa9b14f,_0x5255eb,_0x4229e9,_0x3570f7);};exports[_0x85eb('0x29')]=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index c6a5476..624afff 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 _0x687a=['next','validate','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','stringify'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x687a,0x69));var _0xa687=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x687a[_0x3ab51d];return _0x29a04e;};'use strict';var schema=require(_0xa687('0x0'));var sh=require(_0xa687('0x1'));var _=require(_0xa687('0x2'));var utils=require(_0xa687('0x3'));var logger=require(_0xa687('0x4'))('routing');var system=schema({'command':{'type':_0xa687('0x5'),'required':!![],'message':_0xa687('0x6')}});exports['consequence']=function(_0x260aad,_0xcead06){return function(_0x4623dd){try{var _0x4b6ffc={'command':_0xcead06[0x0]};var _0x404318=system[_0xa687('0x0')](_0x4b6ffc,{'typecast':!![]});if(_0x404318['length']){logger['error'](_0xa687('0x7'),_0x260aad,_[_0xa687('0x8')](_0x404318,_0xa687('0x9'))[_0xa687('0xa')](',\x20'));logger[_0xa687('0xb')](_0xa687('0xc'),_0x260aad);_0x4623dd['next']();}else{var _0x49fb1d=this;var _0x4cf875=utils[_0xa687('0xd')](_0xcead06[0x0],this);logger[_0xa687('0xb')](_0xa687('0xe'),_0x260aad,_0x4cf875);sh[_0xa687('0xf')](_[_0xa687('0x10')](_0x4cf875),function(_0x3f308a,_0xe004a3){logger['info'](_0xa687('0x11'),_0x260aad,_0x3f308a);if(_0x3f308a==0x0){var _0x13a97d=_0xe004a3['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xa687('0x12')](_0xcead06[0x1])||_[_0xa687('0x13')](_0xcead06[0x1])){logger['info'](_0xa687('0x14'),_0x260aad);_0x49fb1d[_0xa687('0x15')][_0xcead06[0x1]]=_0x13a97d;}else{logger[_0xa687('0xb')](_0xa687('0x16'),_0x260aad,_0xcead06[0x1],_0x13a97d);_0x49fb1d[_0xa687('0x15')][_0xcead06[0x1]]=_0x13a97d;}}_0x4623dd['next']();});}}catch(_0x7fadf9){logger[_0xa687('0x17')](_0xa687('0x7'),_0x260aad,_['isObject'](_0x7fadf9)?JSON[_0xa687('0x18')](_0x7fadf9):_0x7fadf9);logger['info'](_0xa687('0xc'),_0x260aad);_0x4623dd[_0xa687('0x19')]();}};}; \ No newline at end of file +var _0x1956=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','next','info','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body'];(function(_0x4d26dc,_0x2777e3){var _0x5d2dd5=function(_0x1ed5c1){while(--_0x1ed5c1){_0x4d26dc['push'](_0x4d26dc['shift']());}};_0x5d2dd5(++_0x2777e3);}(_0x1956,0xec));var _0x6195=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x1956[_0x207d2f];return _0x3c3498;};'use strict';var schema=require(_0x6195('0x0'));var sh=require(_0x6195('0x1'));var _=require(_0x6195('0x2'));var utils=require(_0x6195('0x3'));var logger=require(_0x6195('0x4'))(_0x6195('0x5'));var system=schema({'command':{'type':_0x6195('0x6'),'required':!![],'message':_0x6195('0x7')}});exports[_0x6195('0x8')]=function(_0x9f8acf,_0x4d301f){return function(_0x3f0371){try{var _0x21dc09={'command':_0x4d301f[0x0]};var _0x7bcd26=system[_0x6195('0x0')](_0x21dc09,{'typecast':!![]});if(_0x7bcd26[_0x6195('0x9')]){logger[_0x6195('0xa')](_0x6195('0xb'),_0x9f8acf,_[_0x6195('0xc')](_0x7bcd26,_0x6195('0xd'))[_0x6195('0xe')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x9f8acf);_0x3f0371[_0x6195('0xf')]();}else{var _0x18ef65=this;var _0x3451fc=utils['getMustacheRender'](_0x4d301f[0x0],this);logger[_0x6195('0x10')](_0x6195('0x11'),_0x9f8acf,_0x3451fc);sh['exec'](_[_0x6195('0x12')](_0x3451fc),function(_0x2e5d85,_0x2a7304){logger[_0x6195('0x10')](_0x6195('0x13'),_0x9f8acf,_0x2e5d85);if(_0x2e5d85==0x0){var _0x162047=_0x2a7304[_0x6195('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x6195('0x15')](_0x4d301f[0x1])||_[_0x6195('0x16')](_0x4d301f[0x1])){logger[_0x6195('0x10')](_0x6195('0x17'),_0x9f8acf);_0x18ef65[_0x6195('0x18')][_0x4d301f[0x1]]=_0x162047;}else{logger[_0x6195('0x10')](_0x6195('0x19'),_0x9f8acf,_0x4d301f[0x1],_0x162047);_0x18ef65['body'][_0x4d301f[0x1]]=_0x162047;}}_0x3f0371[_0x6195('0xf')]();});}}catch(_0x5481ac){logger[_0x6195('0xa')](_0x6195('0xb'),_0x9f8acf,_[_0x6195('0x1a')](_0x5481ac)?JSON[_0x6195('0x1b')](_0x5481ac):_0x5481ac);logger[_0x6195('0x10')](_0x6195('0x1c'),_0x9f8acf);_0x3f0371[_0x6195('0xf')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index d5c1e1e..188b081 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 _0xe231=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','info','catch','stringify','error','isObject','validate'];(function(_0x106214,_0x454b8d){var _0x5f5cea=function(_0x247841){while(--_0x247841){_0x106214['push'](_0x106214['shift']());}};_0x5f5cea(++_0x454b8d);}(_0xe231,0x1bf));var _0x1e23=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0xe231[_0x1b2255];return _0x33e57d;};'use strict';var schema=require(_0x1e23('0x0'));var _=require(_0x1e23('0x1'));var rpc={'chatInteraction':require(_0x1e23('0x2')),'openchannelInteraction':require(_0x1e23('0x3')),'smsInteraction':require(_0x1e23('0x4')),'mailInteraction':require(_0x1e23('0x5')),'faxInteraction':require(_0x1e23('0x6')),'whatsappInteraction':require(_0x1e23('0x7'))};var logger=require(_0x1e23('0x8'))(_0x1e23('0x9'));var tag=schema({'tag':{'type':_0x1e23('0xa'),'required':!![],'message':_0x1e23('0xb')}});exports[_0x1e23('0xc')]=function(_0x307390,_0x1237e1,_0x31f53c,_0x551388){return function(_0x392a83){try{var _0x21574a={'tag':_0x1237e1[0x0]};var _0x14a4e6=tag[_0x1e23('0x0')](_0x21574a,{'typecast':!![]});if(_0x14a4e6[_0x1e23('0xd')]){logger['error'](_0x1e23('0xe'),_0x307390,_['map'](_0x14a4e6,_0x1e23('0xf'))[_0x1e23('0x10')](',\x20'));logger['info'](_0x1e23('0x11'),_0x307390);_0x392a83[_0x1e23('0x12')]();}else{var _0x2ef27d={'ids':[_0x1237e1[0x0]]};if(rpc[_0x551388[_0x1e23('0x13')]+_0x1e23('0x14')]){rpc[_0x551388['channel']+_0x1e23('0x14')]['addTags'](_0x551388[_0x1e23('0x15')]['id'],_0x2ef27d)[_0x1e23('0x16')](function(_0xe1c6a){logger[_0x1e23('0x17')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x307390,_0x1237e1[0x1],_0x551388[_0x1e23('0x13')],_0x551388['interaction']['id']);})[_0x1e23('0x18')](function(_0x3fc543){logger['error'](_0x1e23('0xe'),_0x307390,JSON[_0x1e23('0x19')](_0x3fc543));logger[_0x1e23('0x17')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x307390);})['finally'](function(){_0x392a83[_0x1e23('0x12')]();});}}}catch(_0xe88ad4){logger[_0x1e23('0x1a')]('[%s][TAG]\x20%s',_0x307390,_[_0x1e23('0x1b')](_0xe88ad4)?JSON['stringify'](_0xe88ad4):_0xe88ad4);logger[_0x1e23('0x17')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x307390);_0x392a83['next']();}};}; \ No newline at end of file +var _0x0707=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','finally','isObject','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x5da604,_0x58e6d7){var _0x5c6d64=function(_0x33f789){while(--_0x33f789){_0x5da604['push'](_0x5da604['shift']());}};_0x5c6d64(++_0x58e6d7);}(_0x0707,0x87));var _0x7070=function(_0x1827f7,_0x70fe6a){_0x1827f7=_0x1827f7-0x0;var _0x11a927=_0x0707[_0x1827f7];return _0x11a927;};'use strict';var schema=require('validate');var _=require(_0x7070('0x0'));var rpc={'chatInteraction':require(_0x7070('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x7070('0x2')),'mailInteraction':require(_0x7070('0x3')),'faxInteraction':require(_0x7070('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x7070('0x5'));var tag=schema({'tag':{'type':_0x7070('0x6'),'required':!![],'message':_0x7070('0x7')}});exports[_0x7070('0x8')]=function(_0x4ec673,_0x120f6c,_0x11522f,_0x58d3ba){return function(_0x36ed5e){try{var _0x40ab2c={'tag':_0x120f6c[0x0]};var _0x3a2f46=tag[_0x7070('0x9')](_0x40ab2c,{'typecast':!![]});if(_0x3a2f46[_0x7070('0xa')]){logger[_0x7070('0xb')]('[%s][TAG]\x20%s',_0x4ec673,_['map'](_0x3a2f46,_0x7070('0xc'))[_0x7070('0xd')](',\x20'));logger[_0x7070('0xe')](_0x7070('0xf'),_0x4ec673);_0x36ed5e[_0x7070('0x10')]();}else{var _0x3aea5={'ids':[_0x120f6c[0x0]]};if(rpc[_0x58d3ba[_0x7070('0x11')]+_0x7070('0x12')]){rpc[_0x58d3ba[_0x7070('0x11')]+_0x7070('0x12')][_0x7070('0x13')](_0x58d3ba[_0x7070('0x14')]['id'],_0x3aea5)[_0x7070('0x15')](function(_0x2f8e8b){logger[_0x7070('0xe')](_0x7070('0x16'),_0x4ec673,_0x120f6c[0x1],_0x58d3ba[_0x7070('0x11')],_0x58d3ba['interaction']['id']);})[_0x7070('0x17')](function(_0x2a4149){logger['error'](_0x7070('0x18'),_0x4ec673,JSON[_0x7070('0x19')](_0x2a4149));logger[_0x7070('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4ec673);})[_0x7070('0x1a')](function(){_0x36ed5e[_0x7070('0x10')]();});}}}catch(_0x41fb32){logger[_0x7070('0xb')](_0x7070('0x18'),_0x4ec673,_[_0x7070('0x1b')](_0x41fb32)?JSON[_0x7070('0x19')](_0x41fb32):_0x41fb32);logger[_0x7070('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x4ec673);_0x36ed5e[_0x7070('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 715dd52..dfa4218 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 _0xfa68=['message','account','interaction','list','mustache','lodash','exports','render','merge','contact'];(function(_0x1477ea,_0x320b91){var _0x15fcdc=function(_0x3c4155){while(--_0x3c4155){_0x1477ea['push'](_0x1477ea['shift']());}};_0x15fcdc(++_0x320b91);}(_0xfa68,0x86));var _0x8fa6=function(_0x5a99d0,_0x2dc3a6){_0x5a99d0=_0x5a99d0-0x0;var _0x7f073d=_0xfa68[_0x5a99d0];return _0x7f073d;};'use strict';var Mustache=require(_0x8fa6('0x0'));var _=require(_0x8fa6('0x1'));module[_0x8fa6('0x2')]={'getMustacheRender':function(_0x4d2bf8,_0x16029c){return Mustache[_0x8fa6('0x3')](_0x4d2bf8,_[_0x8fa6('0x4')](_0x16029c['body'],{'contact':_0x16029c[_0x8fa6('0x5')],'message':_0x16029c[_0x8fa6('0x6')],'account':_0x16029c[_0x8fa6('0x7')],'interaction':_0x16029c[_0x8fa6('0x8')],'list':_0x16029c[_0x8fa6('0x9')]}))||'';}}; \ No newline at end of file +var _0xf452=['contact','message','account','interaction','list','mustache','lodash','render','merge','body'];(function(_0x493ced,_0x2f3713){var _0x12a5c7=function(_0x3a59b1){while(--_0x3a59b1){_0x493ced['push'](_0x493ced['shift']());}};_0x12a5c7(++_0x2f3713);}(_0xf452,0x13b));var _0x2f45=function(_0x2da14a,_0x9f8c31){_0x2da14a=_0x2da14a-0x0;var _0x3bfa79=_0xf452[_0x2da14a];return _0x3bfa79;};'use strict';var Mustache=require(_0x2f45('0x0'));var _=require(_0x2f45('0x1'));module['exports']={'getMustacheRender':function(_0x3b13d3,_0x17a6c7){return Mustache[_0x2f45('0x2')](_0x3b13d3,_[_0x2f45('0x3')](_0x17a6c7[_0x2f45('0x4')],{'contact':_0x17a6c7[_0x2f45('0x5')],'message':_0x17a6c7[_0x2f45('0x6')],'account':_0x17a6c7[_0x2f45('0x7')],'interaction':_0x17a6c7[_0x2f45('0x8')],'list':_0x17a6c7[_0x2f45('0x9')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 387e049..e6c3049 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 _0xd0b9=['mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','isArray','applications','length','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','TagId','condition','intervals','./applications/','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','agents','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','name','whatsappQueues','chatQueuesWaitingInteractions'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0xd0b9,0x1df));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d0b('0x0'));var util=require(_0x9d0b('0x1'));var path=require(_0x9d0b('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x9d0b('0x3'));var uuid=require(_0x9d0b('0x4'));var config=require(_0x9d0b('0x5'));var logger=require(_0x9d0b('0x6'))(_0x9d0b('0x7'));var rpc={'openchannelQueueReport':require(_0x9d0b('0x8')),'mailQueueReport':require(_0x9d0b('0x9')),'chatQueueReport':require(_0x9d0b('0xa')),'smsQueueReport':require(_0x9d0b('0xb')),'faxQueueReport':require(_0x9d0b('0xc')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x9d0b('0xd'));function getId(_0x5e35d3,_0xa3031b,_0x314d25){return util[_0x9d0b('0xe')]('%s.%s.%s',_0x5e35d3,_0xa3031b||0x0,_0x314d25||0x0);}function getIntervals(_0x5b554f,_0x1b4fb4){var _0x4a0ef3=[];if(!_[_0x9d0b('0xf')](_0x1b4fb4[_0x9d0b('0x10')])&&!_[_0x9d0b('0xf')](_0x5b554f[_0x1b4fb4[_0x9d0b('0x10')]])&&!_[_0x9d0b('0xf')](_0x5b554f[_0x1b4fb4['IntervalId']][_0x9d0b('0x11')])){_0x4a0ef3=_[_0x9d0b('0x12')](_0x5b554f[_0x1b4fb4['IntervalId']][_0x9d0b('0x11')],'interval');}else if(!_[_0x9d0b('0xf')](_0x1b4fb4[_0x9d0b('0x13')])){_0x4a0ef3=[_0x1b4fb4[_0x9d0b('0x13')]];}return _0x4a0ef3;}exports[_0x9d0b('0x14')]=function(_0x2a651f){_0x2a651f['rules']={};return new BPromise(function(_0x3f0feb,_0x3c86bd){var _0x3b7dab={'Start':function(_0x5afa59){var _0x4f4a41=this;return new Promise(function(_0x1f1646,_0x122a93){if(_0x5afa59){try{var _0xe7c84f=[];var _0x9865f6=getId(_0x5afa59[_0x9d0b('0x15')],_0x5afa59[_0x9d0b('0x16')]?_0x5afa59[_0x9d0b('0x16')]['id']:0x0,_0x5afa59[_0x9d0b('0x17')]?_0x5afa59[_0x9d0b('0x17')]['id']:0x0);if(_0x5afa59['applications']&&_[_0x9d0b('0x18')](_0x5afa59[_0x9d0b('0x19')])&&_0x5afa59[_0x9d0b('0x19')][_0x9d0b('0x1a')]){for(var _0x5e2d18=0x0;_0x5e2d18<_0x5afa59[_0x9d0b('0x19')][_0x9d0b('0x1a')];_0x5e2d18+=0x1){var _0x3ffa11=_0x5afa59['applications'][_0x5e2d18];if(fs['existsSync'](path[_0x9d0b('0x1b')](__dirname,_0x9d0b('0x19'),_0x3ffa11[_0x9d0b('0x1c')]+_0x9d0b('0x1d')))){var _0x5cddea=[];switch(_0x3ffa11['app'][_0x9d0b('0x1e')]()){case _0x9d0b('0x1f'):var _0xfc081c=_0x3ffa11[_0x9d0b('0x20')][_0x9d0b('0x21')](',');_0x5cddea[_0x9d0b('0x22')](_0xfc081c[0x0]);_0x5cddea['push'](_0xfc081c[_0x9d0b('0x23')](0x1,_0xfc081c['length'])[_0x9d0b('0x1b')](','));break;case _0x9d0b('0x24'):var _0x2c0976=_0x3ffa11[_0x9d0b('0x20')]['split'](',');_0x5cddea['push'](_0x2c0976[0x0]);_0x5cddea[_0x9d0b('0x22')](_0x2c0976[0x1]);_0x5cddea[_0x9d0b('0x22')](_0x2c0976[_0x9d0b('0x23')](0x2,_0x2c0976[_0x9d0b('0x1a')])[_0x9d0b('0x1b')](','));break;case _0x9d0b('0x25'):var _0xe83591=_0x3ffa11[_0x9d0b('0x20')]['split'](',');_0x5cddea['push'](_0xe83591[0x0]);_0x5cddea[_0x9d0b('0x22')](_0xe83591[0x1]);_0x5cddea[_0x9d0b('0x22')](_0xe83591[0x2]);_0x5cddea[_0x9d0b('0x22')](_0xe83591[0x3]);_0x5cddea['push'](_0xe83591['slice'](0x4,_0xe83591[_0x9d0b('0x1a')])['join'](','));break;case'message':_0x5cddea[_0x9d0b('0x22')](_0x3ffa11[_0x9d0b('0x20')]);break;case'tag':_0x5cddea[_0x9d0b('0x22')](_0x3ffa11[_0x9d0b('0x26')]);_0x5cddea[_0x9d0b('0x22')](_0x3ffa11[_0x9d0b('0x20')]);break;default:_0x5cddea=_[_0x9d0b('0xf')](_0x3ffa11['appdata'])?[]:_0x3ffa11[_0x9d0b('0x20')][_0x9d0b('0x21')](',');}var _0x292c71={'id':util['format']('%s:%s:%s',_0x9865f6,_0x3ffa11['id'],_0x3ffa11[_0x9d0b('0x1c')]),'condition':require('./interval')[_0x9d0b('0x27')](_0x9865f6,getIntervals(_0x2a651f[_0x9d0b('0x28')],_0x3ffa11),_0x2a651f),'consequence':require(_0x9d0b('0x29')+_0x3ffa11['app'])[_0x9d0b('0x2a')](_0x9865f6,_0x5cddea,_0x2a651f,_0x5afa59),'p':_0x3ffa11[_0x9d0b('0x2b')]||0x0};logger[_0x9d0b('0x2c')]('Push\x20new\x20rule',_0x292c71['id'],_0x9d0b('0x2d'),getIntervals(_0x2a651f[_0x9d0b('0x28')],_0x3ffa11)[_0x9d0b('0x1b')]('\x20|\x20'));_0xe7c84f[_0x9d0b('0x22')](_0x292c71);}else{logger[_0x9d0b('0x2e')](_0x9d0b('0x2f'),path[_0x9d0b('0x1b')](__dirname,_0x9d0b('0x19'),_0x3ffa11[_0x9d0b('0x1c')]+'.js'));}}_0x2a651f['rules'][_0x9865f6]=new RuleEngine(_0xe7c84f);_0x2a651f[_0x9d0b('0x30')][_0x9865f6][_0x9d0b('0x31')](_0x5afa59,function(_0x27ca0f){logger['info'](_0x9d0b('0x32'),JSON[_0x9d0b('0x33')](_0x27ca0f[_0x9d0b('0x34')]));if(_0x2a651f[_0x9d0b('0x30')][_0x9865f6]){_0x2a651f[_0x9d0b('0x30')][_0x9865f6][_0x9d0b('0x35')](_0x9d0b('0x36'));}});return _0x1f1646({'code':0xc8,'message':_0x5afa59});}else{logger[_0x9d0b('0x2c')](_0x9d0b('0x37'));return _0x1f1646({'code':0xc8,'message':_0x5afa59});}}catch(_0x2f1c12){logger[_0x9d0b('0x2e')](_0x2f1c12['stack']);return _0x122a93(_0x4f4a41[_0x9d0b('0x2e')](0x1f4,_0x2f1c12));}}return _0x122a93(_0x9d0b('0x38'));});},'AcceptMessage':function(_0x2d4437){var _0x56c4e5=this;return new Promise(function(_0x5d2270,_0xe8eb3c){if(_0x2d4437[_0x9d0b('0x16')]&&_0x2d4437[_0x9d0b('0x16')]['id']){try{var _0x1b3ded=getId(_0x2d4437[_0x9d0b('0x15')],_0x2d4437[_0x9d0b('0x16')]?_0x2d4437[_0x9d0b('0x16')]['id']:0x0,_0x2d4437[_0x9d0b('0x17')]?_0x2d4437[_0x9d0b('0x17')]['id']:0x0);if(_0x2a651f[_0x9d0b('0x30')][_0x1b3ded]){_0x2a651f[_0x9d0b('0x30')][_0x1b3ded][_0x9d0b('0x35')](_0x9d0b('0x39'));if(rpc[_0x2d4437['channel']+_0x9d0b('0x3a')]){rpc[_0x2d4437[_0x9d0b('0x15')]+_0x9d0b('0x3a')]['update'](_0x1b3ded,{'UserId':_0x2d4437['message'][_0x9d0b('0x3b')]})[_0x9d0b('0x3c')](function(_0x22643a){logger[_0x9d0b('0x2e')](_0x9d0b('0x3d'));});}}return _0x5d2270({'code':0xc8,'message':_0x2d4437});}catch(_0x161d72){logger[_0x9d0b('0x2e')](_0x161d72[_0x9d0b('0x3e')]);return _0xe8eb3c(_0x56c4e5[_0x9d0b('0x2e')](0x1f4,_0x161d72));}}logger['error'](_0x9d0b('0x3f'));return _0xe8eb3c(_0x56c4e5[_0x9d0b('0x2e')](0x1f4,_0x9d0b('0x3f')));});},'RejectMessage':function(_0x141af0){var _0x71d22b=this;return new Promise(function(_0x26682c,_0x547cd4){if(_0x141af0[_0x9d0b('0x40')]&&_0x141af0['agent']['id']){try{if(_0x2a651f[_0x9d0b('0x41')][_0x141af0[_0x9d0b('0x40')]['id']]){_0x2a651f[_0x9d0b('0x41')][_0x141af0[_0x9d0b('0x40')]['id']][_0x9d0b('0x42')]=![];_0x2a651f[_0x9d0b('0x41')][_0x141af0[_0x9d0b('0x40')]['id']]['busyQueue']=undefined;}return _0x26682c({'code':0xc8,'message':_0x141af0});}catch(_0x18a1b5){logger['error'](_0x18a1b5[_0x9d0b('0x3e')]);return _0x547cd4(_0x71d22b['error'](0x1f4,_0x18a1b5));}}logger[_0x9d0b('0x2e')](_0x9d0b('0x3f'));return _0x547cd4(_0x71d22b['error'](0x1f4,_0x9d0b('0x3f')));});},'AbandonInteraction':function(_0x19d2ed){var _0x510830=this;return new Promise(function(_0x4e673e,_0x2f214b){if(_0x19d2ed[_0x9d0b('0x15')]&&_0x19d2ed[_0x9d0b('0x17')]&&_0x19d2ed['interaction']['id']){try{var _0x37e318=getId(_0x19d2ed['channel'],_0x19d2ed[_0x9d0b('0x16')]?_0x19d2ed['message']['id']:0x0,_0x19d2ed['interaction']?_0x19d2ed[_0x9d0b('0x17')]['id']:0x0);if(_0x2a651f[_0x9d0b('0x30')][_0x37e318]){_0x2a651f[_0x9d0b('0x30')][_0x37e318][_0x9d0b('0x35')]('end');}return _0x4e673e({'code':0xc8,'message':_0x19d2ed});}catch(_0x197734){logger[_0x9d0b('0x2e')](_0x197734['stack']);return _0x2f214b(_0x510830['error'](0x1f4,_0x197734));}}logger['error'](_0x9d0b('0x3f'));return _0x2f214b(_0x510830[_0x9d0b('0x2e')](0x1f4,_0x9d0b('0x3f')));});},'AgentCapacity':function(_0x5944b4){var _0x5e1a48=this;return new Promise(function(_0x1b8aec,_0x4dd0e2){if(_0x2a651f[_0x9d0b('0x41')][_0x9d0b('0x43')](_0x5944b4['id'])){for(var _0x1bd05f in _0x5944b4[_0x9d0b('0x44')]){if(_0x5944b4[_0x9d0b('0x44')][_0x9d0b('0x43')](_0x1bd05f)){if(_0x2a651f[_0x9d0b('0x41')][_0x5944b4['id']][_0x9d0b('0x43')](_0x1bd05f+'CurrentCapacity')){_0x2a651f[_0x9d0b('0x41')][_0x5944b4['id']][_0x1bd05f+_0x9d0b('0x45')]=parseInt(_0x5944b4['capacity'][_0x1bd05f],0xa);}}}_0x2a651f[_0x9d0b('0x41')][_0x5944b4['id']][_0x9d0b('0x46')]();return _0x1b8aec({'code':0xc8,'message':_0x2a651f[_0x9d0b('0x41')][_0x5944b4['id']]});}else{return _0x4dd0e2(_0x5e1a48[_0x9d0b('0x2e')](0x1f4,_0x9d0b('0x47')));}});},'Agents':function(_0x4534d3){return new Promise(function(_0x210b52,_0x4dc9a4){var _0x44f57f=_[_0x9d0b('0x48')](_0x2a651f[_0x9d0b('0x41')]);_0x210b52({'count':_0x44f57f[_0x9d0b('0x1a')],'rows':_0x44f57f});});},'ChatQueues':function(_0x1c3eb3){return new Promise(function(_0x5b9f15,_0x3b0a14){var _0x1ee298=[];for(var _0x3241d5 in _0x2a651f[_0x9d0b('0x49')]){if(_0x2a651f[_0x9d0b('0x49')][_0x9d0b('0x43')](_0x3241d5)){var _0x27f62d=_0x2a651f['chatQueues'][_0x3241d5];var _0x37db5d={'id':_0x27f62d['id'],'available':_0x27f62d[_0x9d0b('0x4a')],'loggedIn':_0x27f62d[_0x9d0b('0x4b')],'name':_0x27f62d['name'],'paused':_0x27f62d[_0x9d0b('0x4c')],'waiting':_0x27f62d['waiting']};_0x1ee298[_0x9d0b('0x22')](_0x37db5d);}}_0x5b9f15({'count':_0x1ee298[_0x9d0b('0x1a')],'rows':_0x1ee298});});},'MailQueues':function(_0x5ad837){return new Promise(function(_0x19ba68,_0x6ec22b){var _0x3132ea=[];for(var _0x4e4521 in _0x2a651f[_0x9d0b('0x4d')]){if(_0x2a651f['mailQueues'][_0x9d0b('0x43')](_0x4e4521)){var _0x431f49=_0x2a651f[_0x9d0b('0x4d')][_0x4e4521];var _0x5b68a8={'id':_0x431f49['id'],'available':_0x431f49[_0x9d0b('0x4a')],'loggedIn':_0x431f49[_0x9d0b('0x4b')],'name':_0x431f49['name'],'paused':_0x431f49[_0x9d0b('0x4c')],'waiting':_0x431f49[_0x9d0b('0x4e')]};_0x3132ea[_0x9d0b('0x22')](_0x5b68a8);}}_0x19ba68({'count':_0x3132ea['length'],'rows':_0x3132ea});});},'OpenchannelQueues':function(_0x44fb33){return new Promise(function(_0x464a05,_0x21c0c2){var _0x3e4426=[];for(var _0x5e33ca in _0x2a651f['openchannelQueues']){if(_0x2a651f[_0x9d0b('0x4f')]['hasOwnProperty'](_0x5e33ca)){var _0x1b93b6=_0x2a651f['openchannelQueues'][_0x5e33ca];var _0x556fe2={'id':_0x1b93b6['id'],'available':_0x1b93b6['available'],'loggedIn':_0x1b93b6[_0x9d0b('0x4b')],'name':_0x1b93b6['name'],'paused':_0x1b93b6[_0x9d0b('0x4c')],'waiting':_0x1b93b6['waiting']};_0x3e4426[_0x9d0b('0x22')](_0x556fe2);}}_0x464a05({'count':_0x3e4426[_0x9d0b('0x1a')],'rows':_0x3e4426});});},'SmsQueues':function(_0x1843a7){return new Promise(function(_0xfb8062,_0x3ba967){var _0x134f9a=[];for(var _0x2a7a8c in _0x2a651f['smsQueues']){if(_0x2a651f[_0x9d0b('0x50')][_0x9d0b('0x43')](_0x2a7a8c)){var _0x5b5e01=_0x2a651f[_0x9d0b('0x50')][_0x2a7a8c];var _0x4d03ee={'id':_0x5b5e01['id'],'available':_0x5b5e01[_0x9d0b('0x4a')],'loggedIn':_0x5b5e01[_0x9d0b('0x4b')],'name':_0x5b5e01['name'],'paused':_0x5b5e01[_0x9d0b('0x4c')],'waiting':_0x5b5e01[_0x9d0b('0x4e')]};_0x134f9a[_0x9d0b('0x22')](_0x4d03ee);}}_0xfb8062({'count':_0x134f9a[_0x9d0b('0x1a')],'rows':_0x134f9a});});},'FaxQueues':function(_0x52b8fd){return new Promise(function(_0x5f3c1c,_0x993dec){var _0x10dc4e=[];for(var _0x18bef6 in _0x2a651f[_0x9d0b('0x51')]){if(_0x2a651f['faxQueues'][_0x9d0b('0x43')](_0x18bef6)){var _0x565647=_0x2a651f[_0x9d0b('0x51')][_0x18bef6];var _0x3fd07e={'id':_0x565647['id'],'available':_0x565647[_0x9d0b('0x4a')],'loggedIn':_0x565647['loggedIn'],'name':_0x565647[_0x9d0b('0x52')],'paused':_0x565647[_0x9d0b('0x4c')],'waiting':_0x565647[_0x9d0b('0x4e')]};_0x10dc4e[_0x9d0b('0x22')](_0x3fd07e);}}_0x5f3c1c({'count':_0x10dc4e[_0x9d0b('0x1a')],'rows':_0x10dc4e});});},'WhatsappQueues':function(_0xc2b734){return new Promise(function(_0x234db0,_0x1bf189){var _0x1adc5c=[];for(var _0x141962 in _0x2a651f[_0x9d0b('0x53')]){if(_0x2a651f[_0x9d0b('0x53')][_0x9d0b('0x43')](_0x141962)){var _0x5ee2b3=_0x2a651f[_0x9d0b('0x53')][_0x141962];var _0x493cd9={'id':_0x5ee2b3['id'],'available':_0x5ee2b3[_0x9d0b('0x4a')],'loggedIn':_0x5ee2b3[_0x9d0b('0x4b')],'name':_0x5ee2b3[_0x9d0b('0x52')],'paused':_0x5ee2b3[_0x9d0b('0x4c')],'waiting':_0x5ee2b3[_0x9d0b('0x4e')]};_0x1adc5c[_0x9d0b('0x22')](_0x493cd9);}}_0x234db0({'count':_0x1adc5c[_0x9d0b('0x1a')],'rows':_0x1adc5c});});},'ChatQueuesWaitingInteractions':function(_0x44c0cc){return new Promise(function(_0x37af13,_0x105269){var _0x32c89e=_[_0x9d0b('0x48')](_0x2a651f[_0x9d0b('0x54')]);_0x37af13({'count':_0x32c89e['length'],'rows':_0x32c89e});});},'MailQueuesWaitingInteractions':function(_0x5a756b){return new Promise(function(_0x429475,_0x30ea69){var _0x477b74=_[_0x9d0b('0x48')](_0x2a651f[_0x9d0b('0x55')]);_0x429475({'count':_0x477b74['length'],'rows':_0x477b74});});},'OpenchannelQueuesWaitingInteractions':function(_0x30435d){return new Promise(function(_0x3d3972,_0x7b0039){var _0x1fa75f=_['values'](_0x2a651f['openchannelQueuesWaitingInteractions']);_0x3d3972({'count':_0x1fa75f['length'],'rows':_0x1fa75f});});},'SmsQueuesWaitingInteractions':function(_0x6bb981){return new Promise(function(_0x177ecd,_0x191445){var _0x869854=_['values'](_0x2a651f[_0x9d0b('0x56')]);_0x177ecd({'count':_0x869854[_0x9d0b('0x1a')],'rows':_0x869854});});},'FaxQueuesWaitingInteractions':function(_0x5c9153){return new Promise(function(_0x595181,_0x1ab734){var _0xf0a724=_[_0x9d0b('0x48')](_0x2a651f[_0x9d0b('0x57')]);_0x595181({'count':_0xf0a724[_0x9d0b('0x1a')],'rows':_0xf0a724});});},'WhatsappQueuesWaitingInteractions':function(_0xf338fb){return new Promise(function(_0x5a3149,_0x5ee0d4){var _0x5e0b51=_[_0x9d0b('0x48')](_0x2a651f[_0x9d0b('0x58')]);_0x5a3149({'count':_0x5e0b51[_0x9d0b('0x1a')],'rows':_0x5e0b51});});}};var _0x3e42fe=jayson[_0x9d0b('0x59')](_0x3b7dab)[_0x9d0b('0x5a')]();_0x3e42fe['on'](_0x9d0b('0x2e'),function(_0x4901c5){logger['error'](JSON[_0x9d0b('0x33')](_0x4901c5));return _0x3c86bd(_0x4901c5);});_0x3e42fe[_0x9d0b('0x14')](0x232c,_0x9d0b('0x5b'),function(){console[_0x9d0b('0x5c')](_0x9d0b('0x5d'),0x232c);return _0x3f0feb('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xf2c0=['message','interaction','applications','isArray','length','existsSync','app','.js','autoreply','appdata','split','push','slice','join','dialogflow','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','emit','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','channel','end','QueueReport','UserId','catch','agent','agents','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules'];(function(_0x41617e,_0x17da0f){var _0x11c7f3=function(_0x4722f2){while(--_0x4722f2){_0x41617e['push'](_0x41617e['shift']());}};_0x11c7f3(++_0x17da0f);}(_0xf2c0,0x15b));var _0x0f2c=function(_0x34098e,_0xaec523){_0x34098e=_0x34098e-0x0;var _0x3dcfdd=_0xf2c0[_0x34098e];return _0x3dcfdd;};'use strict';var _=require(_0x0f2c('0x0'));var util=require(_0x0f2c('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var uuid=require(_0x0f2c('0x2'));var config=require(_0x0f2c('0x3'));var logger=require(_0x0f2c('0x4'))(_0x0f2c('0x5'));var rpc={'openchannelQueueReport':require(_0x0f2c('0x6')),'mailQueueReport':require(_0x0f2c('0x7')),'chatQueueReport':require(_0x0f2c('0x8')),'smsQueueReport':require(_0x0f2c('0x9')),'faxQueueReport':require(_0x0f2c('0xa')),'whatsappQueueReport':require(_0x0f2c('0xb'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x519732,_0x23da42,_0x2b21c0){return util[_0x0f2c('0xc')](_0x0f2c('0xd'),_0x519732,_0x23da42||0x0,_0x2b21c0||0x0);}function getIntervals(_0x315084,_0x22d42f){var _0x3970ba=[];if(!_['isNil'](_0x22d42f[_0x0f2c('0xe')])&&!_[_0x0f2c('0xf')](_0x315084[_0x22d42f['IntervalId']])&&!_[_0x0f2c('0xf')](_0x315084[_0x22d42f[_0x0f2c('0xe')]][_0x0f2c('0x10')])){_0x3970ba=_[_0x0f2c('0x11')](_0x315084[_0x22d42f[_0x0f2c('0xe')]][_0x0f2c('0x10')],_0x0f2c('0x12'));}else if(!_[_0x0f2c('0xf')](_0x22d42f[_0x0f2c('0x12')])){_0x3970ba=[_0x22d42f['interval']];}return _0x3970ba;}exports[_0x0f2c('0x13')]=function(_0x2602d1){_0x2602d1[_0x0f2c('0x14')]={};return new BPromise(function(_0x19cc70,_0x547e10){var _0x4ffe9d={'Start':function(_0x14e3d3){var _0x23bda9=this;return new Promise(function(_0xee690e,_0x31cee1){if(_0x14e3d3){try{var _0x3bed1c=[];var _0x32e728=getId(_0x14e3d3['channel'],_0x14e3d3[_0x0f2c('0x15')]?_0x14e3d3[_0x0f2c('0x15')]['id']:0x0,_0x14e3d3[_0x0f2c('0x16')]?_0x14e3d3[_0x0f2c('0x16')]['id']:0x0);if(_0x14e3d3[_0x0f2c('0x17')]&&_[_0x0f2c('0x18')](_0x14e3d3[_0x0f2c('0x17')])&&_0x14e3d3[_0x0f2c('0x17')][_0x0f2c('0x19')]){for(var _0x15cb05=0x0;_0x15cb05<_0x14e3d3[_0x0f2c('0x17')]['length'];_0x15cb05+=0x1){var _0x4d223c=_0x14e3d3['applications'][_0x15cb05];if(fs[_0x0f2c('0x1a')](path['join'](__dirname,_0x0f2c('0x17'),_0x4d223c[_0x0f2c('0x1b')]+_0x0f2c('0x1c')))){var _0x5eddd2=[];switch(_0x4d223c[_0x0f2c('0x1b')]['toLowerCase']()){case _0x0f2c('0x1d'):var _0x4f78c4=_0x4d223c[_0x0f2c('0x1e')][_0x0f2c('0x1f')](',');_0x5eddd2['push'](_0x4f78c4[0x0]);_0x5eddd2[_0x0f2c('0x20')](_0x4f78c4[_0x0f2c('0x21')](0x1,_0x4f78c4['length'])[_0x0f2c('0x22')](','));break;case _0x0f2c('0x23'):var _0x3e38f6=_0x4d223c[_0x0f2c('0x1e')][_0x0f2c('0x1f')](',');_0x5eddd2[_0x0f2c('0x20')](_0x3e38f6[0x0]);_0x5eddd2[_0x0f2c('0x20')](_0x3e38f6[0x1]);_0x5eddd2[_0x0f2c('0x20')](_0x3e38f6['slice'](0x2,_0x3e38f6[_0x0f2c('0x19')])[_0x0f2c('0x22')](','));break;case _0x0f2c('0x24'):var _0x16863d=_0x4d223c[_0x0f2c('0x1e')]['split'](',');_0x5eddd2[_0x0f2c('0x20')](_0x16863d[0x0]);_0x5eddd2[_0x0f2c('0x20')](_0x16863d[0x1]);_0x5eddd2['push'](_0x16863d[0x2]);_0x5eddd2['push'](_0x16863d[0x3]);_0x5eddd2['push'](_0x16863d[_0x0f2c('0x21')](0x4,_0x16863d[_0x0f2c('0x19')])['join'](','));break;case'message':_0x5eddd2['push'](_0x4d223c[_0x0f2c('0x1e')]);break;case'tag':_0x5eddd2['push'](_0x4d223c[_0x0f2c('0x25')]);_0x5eddd2[_0x0f2c('0x20')](_0x4d223c[_0x0f2c('0x1e')]);break;default:_0x5eddd2=_[_0x0f2c('0xf')](_0x4d223c['appdata'])?[]:_0x4d223c[_0x0f2c('0x1e')]['split'](',');}var _0xccdbaa={'id':util[_0x0f2c('0xc')](_0x0f2c('0x26'),_0x32e728,_0x4d223c['id'],_0x4d223c[_0x0f2c('0x1b')]),'condition':require(_0x0f2c('0x27'))[_0x0f2c('0x28')](_0x32e728,getIntervals(_0x2602d1[_0x0f2c('0x29')],_0x4d223c),_0x2602d1),'consequence':require(_0x0f2c('0x2a')+_0x4d223c[_0x0f2c('0x1b')])[_0x0f2c('0x2b')](_0x32e728,_0x5eddd2,_0x2602d1,_0x14e3d3),'p':_0x4d223c[_0x0f2c('0x2c')]||0x0};logger['info'](_0x0f2c('0x2d'),_0xccdbaa['id'],_0x0f2c('0x2e'),getIntervals(_0x2602d1['intervals'],_0x4d223c)[_0x0f2c('0x22')](_0x0f2c('0x2f')));_0x3bed1c[_0x0f2c('0x20')](_0xccdbaa);}else{logger['error'](_0x0f2c('0x30'),path['join'](__dirname,_0x0f2c('0x17'),_0x4d223c[_0x0f2c('0x1b')]+_0x0f2c('0x1c')));}}_0x2602d1['rules'][_0x32e728]=new RuleEngine(_0x3bed1c);_0x2602d1['rules'][_0x32e728][_0x0f2c('0x31')](_0x14e3d3,function(_0x5edb7a){logger[_0x0f2c('0x32')]('Applications\x20executed',JSON[_0x0f2c('0x33')](_0x5edb7a[_0x0f2c('0x34')]));if(_0x2602d1[_0x0f2c('0x14')][_0x32e728]){_0x2602d1[_0x0f2c('0x14')][_0x32e728][_0x0f2c('0x35')]('complete');}});return _0xee690e({'code':0xc8,'message':_0x14e3d3});}else{logger['info'](_0x0f2c('0x36'));return _0xee690e({'code':0xc8,'message':_0x14e3d3});}}catch(_0x4d626e){logger[_0x0f2c('0x37')](_0x4d626e[_0x0f2c('0x38')]);return _0x31cee1(_0x23bda9[_0x0f2c('0x37')](0x1f4,_0x4d626e));}}return _0x31cee1(_0x0f2c('0x39'));});},'AcceptMessage':function(_0x39f6f2){var _0x46795e=this;return new Promise(function(_0x14b968,_0xfc3b5b){if(_0x39f6f2[_0x0f2c('0x15')]&&_0x39f6f2[_0x0f2c('0x15')]['id']){try{var _0x3869f7=getId(_0x39f6f2[_0x0f2c('0x3a')],_0x39f6f2[_0x0f2c('0x15')]?_0x39f6f2[_0x0f2c('0x15')]['id']:0x0,_0x39f6f2[_0x0f2c('0x16')]?_0x39f6f2[_0x0f2c('0x16')]['id']:0x0);if(_0x2602d1[_0x0f2c('0x14')][_0x3869f7]){_0x2602d1['rules'][_0x3869f7][_0x0f2c('0x35')](_0x0f2c('0x3b'));if(rpc[_0x39f6f2[_0x0f2c('0x3a')]+_0x0f2c('0x3c')]){rpc[_0x39f6f2['channel']+_0x0f2c('0x3c')]['update'](_0x3869f7,{'UserId':_0x39f6f2[_0x0f2c('0x15')][_0x0f2c('0x3d')]})[_0x0f2c('0x3e')](function(_0x294cf5){logger[_0x0f2c('0x37')]('error\x20update\x20queue\x20report');});}}return _0x14b968({'code':0xc8,'message':_0x39f6f2});}catch(_0x953cf6){logger[_0x0f2c('0x37')](_0x953cf6[_0x0f2c('0x38')]);return _0xfc3b5b(_0x46795e[_0x0f2c('0x37')](0x1f4,_0x953cf6));}}logger[_0x0f2c('0x37')]('message\x20is\x20empty');return _0xfc3b5b(_0x46795e[_0x0f2c('0x37')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x498617){var _0x1db102=this;return new Promise(function(_0x1e8fca,_0x517953){if(_0x498617[_0x0f2c('0x3f')]&&_0x498617[_0x0f2c('0x3f')]['id']){try{if(_0x2602d1[_0x0f2c('0x40')][_0x498617[_0x0f2c('0x3f')]['id']]){_0x2602d1[_0x0f2c('0x40')][_0x498617[_0x0f2c('0x3f')]['id']]['busy']=![];_0x2602d1[_0x0f2c('0x40')][_0x498617[_0x0f2c('0x3f')]['id']]['busyQueue']=undefined;}return _0x1e8fca({'code':0xc8,'message':_0x498617});}catch(_0x4b2dc9){logger['error'](_0x4b2dc9[_0x0f2c('0x38')]);return _0x517953(_0x1db102[_0x0f2c('0x37')](0x1f4,_0x4b2dc9));}}logger[_0x0f2c('0x37')](_0x0f2c('0x41'));return _0x517953(_0x1db102[_0x0f2c('0x37')](0x1f4,_0x0f2c('0x41')));});},'AbandonInteraction':function(_0x30ba9a){var _0x3c0169=this;return new Promise(function(_0x506301,_0x1470a1){if(_0x30ba9a[_0x0f2c('0x3a')]&&_0x30ba9a[_0x0f2c('0x16')]&&_0x30ba9a[_0x0f2c('0x16')]['id']){try{var _0x46ea6d=getId(_0x30ba9a[_0x0f2c('0x3a')],_0x30ba9a['message']?_0x30ba9a['message']['id']:0x0,_0x30ba9a[_0x0f2c('0x16')]?_0x30ba9a['interaction']['id']:0x0);if(_0x2602d1[_0x0f2c('0x14')][_0x46ea6d]){_0x2602d1[_0x0f2c('0x14')][_0x46ea6d][_0x0f2c('0x35')](_0x0f2c('0x3b'));}return _0x506301({'code':0xc8,'message':_0x30ba9a});}catch(_0x39c081){logger[_0x0f2c('0x37')](_0x39c081[_0x0f2c('0x38')]);return _0x1470a1(_0x3c0169['error'](0x1f4,_0x39c081));}}logger[_0x0f2c('0x37')]('message\x20is\x20empty');return _0x1470a1(_0x3c0169['error'](0x1f4,_0x0f2c('0x41')));});},'AgentCapacity':function(_0x14b5d1){var _0x21e7a7=this;return new Promise(function(_0x1abf6c,_0x22a40f){if(_0x2602d1[_0x0f2c('0x40')][_0x0f2c('0x42')](_0x14b5d1['id'])){for(var _0x1f7202 in _0x14b5d1[_0x0f2c('0x43')]){if(_0x14b5d1[_0x0f2c('0x43')][_0x0f2c('0x42')](_0x1f7202)){if(_0x2602d1[_0x0f2c('0x40')][_0x14b5d1['id']][_0x0f2c('0x42')](_0x1f7202+_0x0f2c('0x44'))){_0x2602d1[_0x0f2c('0x40')][_0x14b5d1['id']][_0x1f7202+_0x0f2c('0x44')]=parseInt(_0x14b5d1['capacity'][_0x1f7202],0xa);}}}_0x2602d1[_0x0f2c('0x40')][_0x14b5d1['id']][_0x0f2c('0x45')]();return _0x1abf6c({'code':0xc8,'message':_0x2602d1[_0x0f2c('0x40')][_0x14b5d1['id']]});}else{return _0x22a40f(_0x21e7a7[_0x0f2c('0x37')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2d5e75){return new Promise(function(_0x2cf958,_0x6e12eb){var _0x54fd40=_[_0x0f2c('0x46')](_0x2602d1['agents']);_0x2cf958({'count':_0x54fd40[_0x0f2c('0x19')],'rows':_0x54fd40});});},'ChatQueues':function(_0x1878e8){return new Promise(function(_0x53b11c,_0x289c5a){var _0x5fee83=[];for(var _0x99f83d in _0x2602d1[_0x0f2c('0x47')]){if(_0x2602d1[_0x0f2c('0x47')][_0x0f2c('0x42')](_0x99f83d)){var _0x5a5d53=_0x2602d1[_0x0f2c('0x47')][_0x99f83d];var _0xef127c={'id':_0x5a5d53['id'],'available':_0x5a5d53[_0x0f2c('0x48')],'loggedIn':_0x5a5d53[_0x0f2c('0x49')],'name':_0x5a5d53[_0x0f2c('0x4a')],'paused':_0x5a5d53[_0x0f2c('0x4b')],'waiting':_0x5a5d53[_0x0f2c('0x4c')]};_0x5fee83[_0x0f2c('0x20')](_0xef127c);}}_0x53b11c({'count':_0x5fee83[_0x0f2c('0x19')],'rows':_0x5fee83});});},'MailQueues':function(_0x5ee606){return new Promise(function(_0x54449c,_0xc66a40){var _0x2e6f8c=[];for(var _0x5e09d0 in _0x2602d1[_0x0f2c('0x4d')]){if(_0x2602d1['mailQueues'][_0x0f2c('0x42')](_0x5e09d0)){var _0x46a841=_0x2602d1[_0x0f2c('0x4d')][_0x5e09d0];var _0x4b3a28={'id':_0x46a841['id'],'available':_0x46a841[_0x0f2c('0x48')],'loggedIn':_0x46a841[_0x0f2c('0x49')],'name':_0x46a841[_0x0f2c('0x4a')],'paused':_0x46a841[_0x0f2c('0x4b')],'waiting':_0x46a841[_0x0f2c('0x4c')]};_0x2e6f8c[_0x0f2c('0x20')](_0x4b3a28);}}_0x54449c({'count':_0x2e6f8c[_0x0f2c('0x19')],'rows':_0x2e6f8c});});},'OpenchannelQueues':function(_0xf4a204){return new Promise(function(_0x31a7ab,_0x50b06b){var _0xa1a6d2=[];for(var _0x3cd4be in _0x2602d1[_0x0f2c('0x4e')]){if(_0x2602d1[_0x0f2c('0x4e')][_0x0f2c('0x42')](_0x3cd4be)){var _0x8c5d91=_0x2602d1[_0x0f2c('0x4e')][_0x3cd4be];var _0x55ec2d={'id':_0x8c5d91['id'],'available':_0x8c5d91['available'],'loggedIn':_0x8c5d91[_0x0f2c('0x49')],'name':_0x8c5d91['name'],'paused':_0x8c5d91[_0x0f2c('0x4b')],'waiting':_0x8c5d91[_0x0f2c('0x4c')]};_0xa1a6d2[_0x0f2c('0x20')](_0x55ec2d);}}_0x31a7ab({'count':_0xa1a6d2[_0x0f2c('0x19')],'rows':_0xa1a6d2});});},'SmsQueues':function(_0x32ba87){return new Promise(function(_0xc096cd,_0x3a7ba5){var _0x544aeb=[];for(var _0x160c73 in _0x2602d1[_0x0f2c('0x4f')]){if(_0x2602d1['smsQueues'][_0x0f2c('0x42')](_0x160c73)){var _0x431c59=_0x2602d1[_0x0f2c('0x4f')][_0x160c73];var _0xf41e38={'id':_0x431c59['id'],'available':_0x431c59[_0x0f2c('0x48')],'loggedIn':_0x431c59['loggedIn'],'name':_0x431c59[_0x0f2c('0x4a')],'paused':_0x431c59['paused'],'waiting':_0x431c59[_0x0f2c('0x4c')]};_0x544aeb[_0x0f2c('0x20')](_0xf41e38);}}_0xc096cd({'count':_0x544aeb[_0x0f2c('0x19')],'rows':_0x544aeb});});},'FaxQueues':function(_0x1b85b4){return new Promise(function(_0x40f86d,_0x269782){var _0x231fb=[];for(var _0x2c5d16 in _0x2602d1['faxQueues']){if(_0x2602d1[_0x0f2c('0x50')]['hasOwnProperty'](_0x2c5d16)){var _0x25e5a9=_0x2602d1[_0x0f2c('0x50')][_0x2c5d16];var _0x3a42eb={'id':_0x25e5a9['id'],'available':_0x25e5a9[_0x0f2c('0x48')],'loggedIn':_0x25e5a9['loggedIn'],'name':_0x25e5a9['name'],'paused':_0x25e5a9[_0x0f2c('0x4b')],'waiting':_0x25e5a9[_0x0f2c('0x4c')]};_0x231fb[_0x0f2c('0x20')](_0x3a42eb);}}_0x40f86d({'count':_0x231fb[_0x0f2c('0x19')],'rows':_0x231fb});});},'WhatsappQueues':function(_0x435106){return new Promise(function(_0x5a6d7f,_0xd34ad){var _0x17f954=[];for(var _0x1fa3d1 in _0x2602d1['whatsappQueues']){if(_0x2602d1[_0x0f2c('0x51')][_0x0f2c('0x42')](_0x1fa3d1)){var _0x23cbc5=_0x2602d1[_0x0f2c('0x51')][_0x1fa3d1];var _0x2f54f1={'id':_0x23cbc5['id'],'available':_0x23cbc5['available'],'loggedIn':_0x23cbc5['loggedIn'],'name':_0x23cbc5[_0x0f2c('0x4a')],'paused':_0x23cbc5[_0x0f2c('0x4b')],'waiting':_0x23cbc5[_0x0f2c('0x4c')]};_0x17f954[_0x0f2c('0x20')](_0x2f54f1);}}_0x5a6d7f({'count':_0x17f954[_0x0f2c('0x19')],'rows':_0x17f954});});},'ChatQueuesWaitingInteractions':function(_0x51b5c6){return new Promise(function(_0x297a60,_0x4be65f){var _0x4a4d91=_[_0x0f2c('0x46')](_0x2602d1[_0x0f2c('0x52')]);_0x297a60({'count':_0x4a4d91[_0x0f2c('0x19')],'rows':_0x4a4d91});});},'MailQueuesWaitingInteractions':function(_0x53346c){return new Promise(function(_0xd7e11,_0x106588){var _0x563f87=_[_0x0f2c('0x46')](_0x2602d1[_0x0f2c('0x53')]);_0xd7e11({'count':_0x563f87['length'],'rows':_0x563f87});});},'OpenchannelQueuesWaitingInteractions':function(_0x1c98e9){return new Promise(function(_0x45ea21,_0x27f26a){var _0x279055=_[_0x0f2c('0x46')](_0x2602d1['openchannelQueuesWaitingInteractions']);_0x45ea21({'count':_0x279055[_0x0f2c('0x19')],'rows':_0x279055});});},'SmsQueuesWaitingInteractions':function(_0x164392){return new Promise(function(_0x1d5e40,_0x51ccd0){var _0x1cef8b=_[_0x0f2c('0x46')](_0x2602d1[_0x0f2c('0x54')]);_0x1d5e40({'count':_0x1cef8b[_0x0f2c('0x19')],'rows':_0x1cef8b});});},'FaxQueuesWaitingInteractions':function(_0x4e5a88){return new Promise(function(_0x5a951f,_0x18818e){var _0x26f05d=_['values'](_0x2602d1[_0x0f2c('0x55')]);_0x5a951f({'count':_0x26f05d[_0x0f2c('0x19')],'rows':_0x26f05d});});},'WhatsappQueuesWaitingInteractions':function(_0x5dc1ef){return new Promise(function(_0x2b297e,_0x128dad){var _0x2721cb=_['values'](_0x2602d1[_0x0f2c('0x56')]);_0x2b297e({'count':_0x2721cb[_0x0f2c('0x19')],'rows':_0x2721cb});});}};var _0x4e9163=jayson[_0x0f2c('0x57')](_0x4ffe9d)[_0x0f2c('0x58')]();_0x4e9163['on'](_0x0f2c('0x37'),function(_0x31a89c){logger['error'](JSON[_0x0f2c('0x33')](_0x31a89c));return _0x547e10(_0x31a89c);});_0x4e9163[_0x0f2c('0x13')](0x232c,_0x0f2c('0x59'),function(){console[_0x0f2c('0x5a')](_0x0f2c('0x5b'),0x232c);return _0x19cc70('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 749b4e2..ef8bc7b 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 _0x3715=['catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','http','request','then','error','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','message','true'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3715,0x120));var _0x5371=function(_0x5711ea,_0x14511c){_0x5711ea=_0x5711ea-0x0;var _0xb94449=_0x3715[_0x5711ea];return _0xb94449;};'use strict';var util=require(_0x5371('0x0'));var BPromise=require(_0x5371('0x1'));var jayson=require(_0x5371('0x2'));var _=require(_0x5371('0x3'));var logger=require(_0x5371('0x4'))(_0x5371('0x5'));var client=jayson['client'][_0x5371('0x6')]({'port':0x232a});function request(_0x35a4de,_0x255324){return new BPromise(function(_0x13b266,_0x3f0cbe){return client[_0x5371('0x7')](_0x35a4de,_0x255324)[_0x5371('0x8')](function(_0x29f5a9){if(_0x29f5a9[_0x5371('0x9')]){return _0x3f0cbe(_0x29f5a9[_0x5371('0x9')]['message']);}else{return _0x13b266(_0x29f5a9['result']);}})['catch'](function(_0x28accf){return _0x3f0cbe(_0x28accf);});});}exports['condition']=function(_0x70c864,_0x5647a4,_0x5eadaf){return function(_0x4b0c44){if(_0x5eadaf[_0x5371('0xa')]&&!_0x5eadaf[_0x5371('0xa')][_0x70c864]){logger[_0x5371('0xb')](_0x5371('0xc'),_0x70c864);return _0x4b0c44[_0x5371('0xd')]();}var _0xf13889=[];for(var _0x2f3863=0x0;_0x2f3863<_0x5647a4[_0x5371('0xe')];_0x2f3863+=0x1){_0xf13889[_0x5371('0xf')](request(_0x5371('0x10'),{'command':util[_0x5371('0x11')]('iftime\x20%s',_0x5647a4[_0x2f3863])})[_0x5371('0x8')](function(_0x1105d2){return _0x1105d2&&_0x1105d2[_0x5371('0x12')]&&_0x1105d2[_0x5371('0x12')]['indexOf'](_0x5371('0x13'))>=0x0?!![]:![];})[_0x5371('0x14')](function(_0x292495){logger['error'](_0x5371('0x15'),_0x70c864,_0x5647a4[_0x2f3863]);}));}BPromise[_0x5371('0x16')](_0xf13889)[_0x5371('0x8')](function(_0x4922c8){var _0x421e64=_[_0x5371('0x17')](_0x4922c8);logger[_0x5371('0xb')](_0x5371('0x18'),_0x70c864,_0x5647a4[_0x5371('0x19')](_0x5371('0x1a')),_0x421e64);_0x4b0c44[_0x5371('0x1b')](_0x421e64);})[_0x5371('0x14')](function(_0x4b75fb){console['log'](_0x4b75fb);logger[_0x5371('0x9')](_0x5371('0x18'),_0x70c864,_0x5647a4[_0x5371('0x19')](_0x5371('0x1a')),_0x4b75fb['stack']);_0x4b0c44[_0x5371('0xd')]();});};}; \ No newline at end of file +var _0x9ec4=['catch','condition','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','then','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','util','bluebird','jayson/promise','lodash','routing','client','http','request','error','message','result'];(function(_0x101d46,_0x26bf97){var _0xc38e4e=function(_0x4ef76b){while(--_0x4ef76b){_0x101d46['push'](_0x101d46['shift']());}};_0xc38e4e(++_0x26bf97);}(_0x9ec4,0x17b));var _0x49ec=function(_0x101e8e,_0x3bf76e){_0x101e8e=_0x101e8e-0x0;var _0x26c65d=_0x9ec4[_0x101e8e];return _0x26c65d;};'use strict';var util=require(_0x49ec('0x0'));var BPromise=require(_0x49ec('0x1'));var jayson=require(_0x49ec('0x2'));var _=require(_0x49ec('0x3'));var logger=require('../../../config/logger')(_0x49ec('0x4'));var client=jayson[_0x49ec('0x5')][_0x49ec('0x6')]({'port':0x232a});function request(_0x5f15f0,_0x19ffb9){return new BPromise(function(_0x3b96b8,_0x48ddc2){return client[_0x49ec('0x7')](_0x5f15f0,_0x19ffb9)['then'](function(_0x1d4a3f){if(_0x1d4a3f['error']){return _0x48ddc2(_0x1d4a3f[_0x49ec('0x8')][_0x49ec('0x9')]);}else{return _0x3b96b8(_0x1d4a3f[_0x49ec('0xa')]);}})[_0x49ec('0xb')](function(_0x2bfd52){return _0x48ddc2(_0x2bfd52);});});}exports[_0x49ec('0xc')]=function(_0x2989f6,_0x5275db,_0x5192da){return function(_0x5805ca){if(_0x5192da['rules']&&!_0x5192da['rules'][_0x2989f6]){logger[_0x49ec('0xd')](_0x49ec('0xe'),_0x2989f6);return _0x5805ca[_0x49ec('0xf')]();}var _0x288c4e=[];for(var _0xba10c3=0x0;_0xba10c3<_0x5275db[_0x49ec('0x10')];_0xba10c3+=0x1){_0x288c4e[_0x49ec('0x11')](request('Command',{'command':util[_0x49ec('0x12')](_0x49ec('0x13'),_0x5275db[_0xba10c3])})[_0x49ec('0x14')](function(_0x16d9f5){return _0x16d9f5&&_0x16d9f5[_0x49ec('0x9')]&&_0x16d9f5[_0x49ec('0x9')][_0x49ec('0x15')](_0x49ec('0x16'))>=0x0?!![]:![];})['catch'](function(_0x152be9){logger[_0x49ec('0x8')](_0x49ec('0x17'),_0x2989f6,_0x5275db[_0xba10c3]);}));}BPromise[_0x49ec('0x18')](_0x288c4e)[_0x49ec('0x14')](function(_0x2c56e1){var _0x14dbae=_[_0x49ec('0x19')](_0x2c56e1);logger[_0x49ec('0xd')](_0x49ec('0x1a'),_0x2989f6,_0x5275db[_0x49ec('0x1b')]('\x20|\x20'),_0x14dbae);_0x5805ca[_0x49ec('0x1c')](_0x14dbae);})[_0x49ec('0xb')](function(_0x3e812d){console[_0x49ec('0x1d')](_0x3e812d);logger[_0x49ec('0x8')](_0x49ec('0x1a'),_0x2989f6,_0x5275db[_0x49ec('0x1b')]('\x20|\x20'),_0x3e812d['stack']);_0x5805ca[_0x49ec('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 969d7d9..722787e 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 _0x0689=['calleridnum','calleridname','transfertargetuniqueid','clone','hangup','cause','rejected','indexOf','splice','agent','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','queue','membername','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','uniqueid','agentcalled','agentcalledAt','now','destuniqueid','called','connectedlinename','stack','agentringnoanswer','agentringnoanswerAt','timeout','holdtime','ringtime','push','error','includes','abandoned','reason','talktime','agentconnect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','isNil','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason'];(function(_0x11cb1c,_0x14aa7d){var _0x26bfae=function(_0x1258ba){while(--_0x1258ba){_0x11cb1c['push'](_0x11cb1c['shift']());}};_0x26bfae(++_0x14aa7d);}(_0x0689,0x9a));var _0x9068=function(_0x4b234f,_0x30d262){_0x4b234f=_0x4b234f-0x0;var _0x4d3db1=_0x0689[_0x4b234f];return _0x4d3db1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9068('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x48ce,_0x331bba){utils[_0x9068('0x1')](util[_0x9068('0x2')](_0x9068('0x3'),_0x48ce['uniqueid'],_0x48ce[_0x9068('0x4')],_0x48ce[_0x9068('0x5')],_0x48ce[_0x9068('0x6')],_0x48ce['interface'],_0x48ce['calleridnum'],_0x48ce[_0x9068('0x7')],_0x48ce[_0x9068('0x8')]));if(_0x48ce['queue']){utils['getVoiceQueueByName'](_0x48ce[_0x9068('0x5')])[_0x9068('0x9')](function(_0x1ab5c2){if(_0x1ab5c2){_0x48ce[_0x9068('0xa')]=_0x1ab5c2[_0x9068('0xa')];_0x48ce[_0x9068('0xb')]=_0x48ce[_0x9068('0xc')]?_0x1ab5c2[_0x9068('0xd')]:![];_0x48ce[_0x9068('0xe')]=_0x48ce[_0x9068('0xb')]?_0x1ab5c2[_0x9068('0xf')]:0x0;}utils[_0x9068('0x10')]('CreateVoiceAgentReport',_0x48ce);});}else{utils[_0x9068('0x10')]('CreateVoiceAgentReport',_0x48ce);}if(_0x331bba){delete transfers[_0x48ce[_0x9068('0x11')]];}else{delete agents[_0x48ce['destuniqueid']];}}exports[_0x9068('0x12')]=function(_0x3aacd0){try{agents[_0x3aacd0['destuniqueid']]=_0x3aacd0;agents[_0x3aacd0['destuniqueid']][_0x9068('0x13')]=utils[_0x9068('0x14')]();agents[_0x3aacd0[_0x9068('0x15')]][_0x9068('0x8')]=_0x9068('0x16');agents[_0x3aacd0['destuniqueid']][_0x9068('0x7')]=null;agents[_0x3aacd0[_0x9068('0x15')]][_0x9068('0x17')]=null;}catch(_0x345050){utils['error'](_0x345050[_0x9068('0x18')]);}};exports[_0x9068('0x19')]=function(_0xe6bbc2){try{if(!_['isNil'](agents[_0xe6bbc2[_0x9068('0x15')]])){agents[_0xe6bbc2[_0x9068('0x15')]][_0x9068('0x19')]=!![];agents[_0xe6bbc2['destuniqueid']][_0x9068('0x1a')]=utils['now']();agents[_0xe6bbc2['destuniqueid']]['lastevent']=_0x9068('0x1b');agents[_0xe6bbc2[_0x9068('0x15')]]['reason']=_0x9068('0x1b');agents[_0xe6bbc2['destuniqueid']][_0x9068('0x1c')]=_0xe6bbc2['ringtime']?parseInt(_0xe6bbc2[_0x9068('0x1d')])/0x3e8:0x0;agents[_0xe6bbc2[_0x9068('0x15')]]['talktime']=0x0;unanswered[_0x9068('0x1e')](_0xe6bbc2['destuniqueid']);}}catch(_0x3aa26d){utils[_0x9068('0x1f')](_0x3aa26d[_0x9068('0x18')]);}};exports['queuecallerabandon']=function(_0x1ea26f){try{_['forIn'](agents,function(_0x4b3f25,_0xea7a8b){if(_0x4b3f25[_0x9068('0x11')]==_0x1ea26f[_0x9068('0x11')]&&!_[_0x9068('0x20')](unanswered,_0x4b3f25[_0x9068('0x15')])){_0x4b3f25[_0x9068('0x19')]=!![];_0x4b3f25[_0x9068('0x1a')]=utils[_0x9068('0x14')]();_0x4b3f25[_0x9068('0x8')]=_0x9068('0x21');_0x4b3f25[_0x9068('0x22')]=_0x9068('0x21');_0x4b3f25[_0x9068('0x1c')]=_0x1ea26f[_0x9068('0x1c')];_0x4b3f25[_0x9068('0x23')]=0x0;writeDB(_0x4b3f25);}});}catch(_0x25204f){utils[_0x9068('0x1f')](_0x25204f[_0x9068('0x18')]);}};exports[_0x9068('0x24')]=function(_0xd026f8){try{if(agents[_0xd026f8[_0x9068('0x15')]]){agents[_0xd026f8[_0x9068('0x15')]][_0x9068('0x25')]=utils['now']();agents[_0xd026f8[_0x9068('0x15')]]['connectedlinenum']=_0xd026f8[_0x9068('0x7')];agents[_0xd026f8['destuniqueid']][_0x9068('0x17')]=_0xd026f8[_0x9068('0x17')];agents[_0xd026f8[_0x9068('0x15')]]['holdtime']=_0xd026f8[_0x9068('0x1d')];agents[_0xd026f8['destuniqueid']][_0x9068('0x8')]=_0x9068('0x26');_[_0x9068('0x27')](agents,function(_0x594d2c,_0x522c3f){if(_0x594d2c[_0x9068('0x15')]!=_0xd026f8[_0x9068('0x15')]&&_0x594d2c['uniqueid']==_0xd026f8[_0x9068('0x11')]){_0x594d2c[_0x9068('0x23')]=0x0;_0x594d2c['holdtime']=_0xd026f8[_0x9068('0x1d')];_0x594d2c[_0x9068('0x19')]=!![];_0x594d2c[_0x9068('0x1a')]=utils[_0x9068('0x14')]();_0x594d2c['lastevent']=_0x9068('0x28');_0x594d2c[_0x9068('0x22')]=_0x9068('0x28');_0x594d2c[_0x9068('0x29')]=_0xd026f8['destuniqueid'];_0x594d2c[_0x9068('0x2a')]=_0xd026f8['membername'];writeDB(_0x594d2c);}});}}catch(_0x367fd5){utils[_0x9068('0x1f')](_0x367fd5['stack']);}};exports[_0x9068('0xc')]=function(_0x4889be){try{if(!_[_0x9068('0x2b')](agents[_0x4889be['destuniqueid']])){agents[_0x4889be[_0x9068('0x15')]][_0x9068('0xc')]=!![];agents[_0x4889be[_0x9068('0x15')]][_0x9068('0x2c')]=utils['now']();agents[_0x4889be[_0x9068('0x15')]]['talktime']=utils[_0x9068('0x2d')](agents[_0x4889be['destuniqueid']]['agentcompleteAt'],agents[_0x4889be['destuniqueid']][_0x9068('0x25')]);agents[_0x4889be[_0x9068('0x15')]][_0x9068('0x22')]=_0x4889be[_0x9068('0x22')];agents[_0x4889be[_0x9068('0x15')]][_0x9068('0x8')]=_0x9068('0x2e');writeDB(agents[_0x4889be[_0x9068('0x15')]]);}}catch(_0x32218f){utils[_0x9068('0x1f')](_0x32218f[_0x9068('0x18')]);}};exports[_0x9068('0x2f')]=function(_0x40eaf2){try{if(!_[_0x9068('0x2b')](agents[_0x40eaf2['transfereruniqueid']])){agents[_0x40eaf2[_0x9068('0x30')]][_0x9068('0x31')]=!![];agents[_0x40eaf2[_0x9068('0x30')]]['transfertype']=_0x9068('0x32');agents[_0x40eaf2[_0x9068('0x30')]][_0x9068('0x33')]=_0x40eaf2[_0x9068('0x34')];agents[_0x40eaf2[_0x9068('0x30')]][_0x9068('0x35')]=agents[_0x40eaf2['transfereruniqueid']]['uniqueid'];}}catch(_0x5f00fc){utils[_0x9068('0x1f')](_0x5f00fc['stack']);}};exports['attendedtransfer']=function(_0x322cad){try{if(_0x322cad[_0x9068('0x36')]==_0x322cad[_0x9068('0x37')]){if(!_['isNil'](agents[_0x322cad['secondtransfereruniqueid']])){agents[_0x322cad[_0x9068('0x38')]]['transfer']=!![];agents[_0x322cad[_0x9068('0x38')]][_0x9068('0x39')]=_0x9068('0x3a');agents[_0x322cad['secondtransfereruniqueid']][_0x9068('0x33')]=_0x322cad[_0x9068('0x3b')];agents[_0x322cad[_0x9068('0x38')]][_0x9068('0x35')]=_0x322cad[_0x9068('0x36')];}if(_0x322cad['transfereeuniqueid']&&agents[_0x322cad[_0x9068('0x3c')]]){agents[_0x322cad['transfereeuniqueid']][_0x9068('0x3d')]=0x1;transfers[_0x322cad[_0x9068('0x3c')]]=_['clone'](agents[_0x322cad[_0x9068('0x3c')]]);transfers[_0x322cad[_0x9068('0x3c')]]['calleridnum']=agents[_0x322cad[_0x9068('0x38')]][_0x9068('0x3e')];transfers[_0x322cad[_0x9068('0x3c')]][_0x9068('0x3f')]=agents[_0x322cad[_0x9068('0x38')]][_0x9068('0x3f')];transfers[_0x322cad[_0x9068('0x3c')]]['agentcalledAt']=utils[_0x9068('0x14')]();transfers[_0x322cad[_0x9068('0x3c')]][_0x9068('0x25')]=utils['now']();transfers[_0x322cad[_0x9068('0x3c')]][_0x9068('0x1c')]=0x0;transfers[_0x322cad[_0x9068('0x3c')]][_0x9068('0x3d')]=0x2;}}else if(_0x322cad[_0x9068('0x38')]==_0x322cad['secondtransfererlinkedid']){if(!_[_0x9068('0x2b')](agents[_0x322cad[_0x9068('0x36')]])){agents[_0x322cad[_0x9068('0x36')]][_0x9068('0x31')]=!![];agents[_0x322cad['origtransfereruniqueid']]['transfertype']=_0x9068('0x3a');agents[_0x322cad[_0x9068('0x36')]][_0x9068('0x33')]=_0x322cad['secondtransfererexten'];agents[_0x322cad[_0x9068('0x36')]][_0x9068('0x35')]=_0x322cad[_0x9068('0x38')];}if(_0x322cad[_0x9068('0x40')]&&agents[_0x322cad['transfertargetuniqueid']]){agents[_0x322cad[_0x9068('0x40')]][_0x9068('0x3d')]=0x1;transfers[_0x322cad[_0x9068('0x40')]]=_[_0x9068('0x41')](agents[_0x322cad[_0x9068('0x40')]]);transfers[_0x322cad[_0x9068('0x40')]][_0x9068('0x3e')]=agents[_0x322cad[_0x9068('0x36')]][_0x9068('0x3e')];transfers[_0x322cad[_0x9068('0x40')]]['calleridname']=agents[_0x322cad[_0x9068('0x36')]][_0x9068('0x3f')];transfers[_0x322cad['transfertargetuniqueid']]['agentcalledAt']=utils[_0x9068('0x14')]();transfers[_0x322cad['transfertargetuniqueid']][_0x9068('0x25')]=utils[_0x9068('0x14')]();transfers[_0x322cad[_0x9068('0x40')]][_0x9068('0x1c')]=0x0;transfers[_0x322cad[_0x9068('0x40')]]['agententerreason']=0x2;}}}catch(_0x90e914){utils[_0x9068('0x1f')](_0x90e914['stack']);}};exports[_0x9068('0x42')]=function(_0x21b3cf){try{if(agents[_0x21b3cf[_0x9068('0x11')]]&&agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x22')]===_0x9068('0x1b')){if(_0x21b3cf[_0x9068('0x43')]==='21'){agents[_0x21b3cf['uniqueid']]['reason']='rejected';agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x8')]=_0x9068('0x44');}writeDB(agents[_0x21b3cf[_0x9068('0x11')]]);var _0x2859fa=unanswered[_0x9068('0x45')](_0x21b3cf[_0x9068('0x11')]);if(_0x2859fa>-0x1)unanswered[_0x9068('0x46')](_0x2859fa,0x1);}if(transfers[_0x21b3cf['uniqueid']]){transfers[_0x21b3cf[_0x9068('0x11')]][_0x9068('0xc')]=!![];transfers[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x2c')]=utils[_0x9068('0x14')]();transfers[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x23')]=utils[_0x9068('0x2d')](transfers[_0x21b3cf[_0x9068('0x11')]]['agentcompleteAt'],transfers[_0x21b3cf[_0x9068('0x11')]]['agentconnectAt']);transfers[_0x21b3cf[_0x9068('0x11')]]['reason']=_0x9068('0x47');transfers[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x8')]='complete';writeDB(transfers[_0x21b3cf[_0x9068('0x11')]],!![]);}if(agents[_0x21b3cf[_0x9068('0x11')]]&&agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x25')]){agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0xc')]=!![];agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x2c')]=utils[_0x9068('0x14')]();agents[_0x21b3cf['uniqueid']][_0x9068('0x23')]=utils[_0x9068('0x2d')](agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x2c')],agents[_0x21b3cf[_0x9068('0x11')]]['agentconnectAt']);agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x22')]=agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x31')]?_0x9068('0x31'):_0x9068('0x47');agents[_0x21b3cf[_0x9068('0x11')]][_0x9068('0x8')]=_0x9068('0x2e');writeDB(agents[_0x21b3cf[_0x9068('0x11')]]);}}catch(_0x3ebe45){utils['error'](_0x3ebe45[_0x9068('0x18')]);}}; \ No newline at end of file +var _0x196a=['indexOf','splice','agent','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','push','error','queuecallerabandon','forIn','abandoned','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','origtransfereruniqueid','secondtransfereruniqueid','origtransfererexten','transferuniqueid','transfereeuniqueid','calleridname','agententerreason','ATTENDED','secondtransfererexten','transfertargetuniqueid','clone','rejected'];(function(_0x13966b,_0x455870){var _0x2ac845=function(_0x5452f4){while(--_0x5452f4){_0x13966b['push'](_0x13966b['shift']());}};_0x2ac845(++_0x455870);}(_0x196a,0x1a1));var _0xa196=function(_0x38e736,_0x419810){_0x38e736=_0x38e736-0x0;var _0x475651=_0x196a[_0x38e736];return _0x475651;};'use strict';var _=require('lodash');var util=require(_0xa196('0x0'));var utils=require(_0xa196('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1174c6,_0x179a62){utils[_0xa196('0x2')](util[_0xa196('0x3')](_0xa196('0x4'),_0x1174c6['uniqueid'],_0x1174c6[_0xa196('0x5')],_0x1174c6[_0xa196('0x6')],_0x1174c6['membername'],_0x1174c6[_0xa196('0x7')],_0x1174c6[_0xa196('0x8')],_0x1174c6[_0xa196('0x9')],_0x1174c6[_0xa196('0xa')]));if(_0x1174c6['queue']){utils[_0xa196('0xb')](_0x1174c6['queue'])['then'](function(_0x37e6dd){if(_0x37e6dd){_0x1174c6['type']=_0x37e6dd[_0xa196('0xc')];_0x1174c6['agentacw']=_0x1174c6[_0xa196('0xd')]?_0x37e6dd['acw']:![];_0x1174c6[_0xa196('0xe')]=_0x1174c6[_0xa196('0xf')]?_0x37e6dd[_0xa196('0x10')]:0x0;}utils[_0xa196('0x11')]('CreateVoiceAgentReport',_0x1174c6);});}else{utils[_0xa196('0x11')](_0xa196('0x12'),_0x1174c6);}if(_0x179a62){delete transfers[_0x1174c6[_0xa196('0x13')]];}else{delete agents[_0x1174c6[_0xa196('0x14')]];}}exports[_0xa196('0x15')]=function(_0x244a1b){try{agents[_0x244a1b['destuniqueid']]=_0x244a1b;agents[_0x244a1b['destuniqueid']][_0xa196('0x16')]=utils[_0xa196('0x17')]();agents[_0x244a1b[_0xa196('0x14')]][_0xa196('0xa')]=_0xa196('0x18');agents[_0x244a1b[_0xa196('0x14')]][_0xa196('0x9')]=null;agents[_0x244a1b[_0xa196('0x14')]][_0xa196('0x19')]=null;}catch(_0x208fac){utils['error'](_0x208fac[_0xa196('0x1a')]);}};exports[_0xa196('0x1b')]=function(_0x114b53){try{if(!_[_0xa196('0x1c')](agents[_0x114b53[_0xa196('0x14')]])){agents[_0x114b53[_0xa196('0x14')]][_0xa196('0x1b')]=!![];agents[_0x114b53[_0xa196('0x14')]][_0xa196('0x1d')]=utils[_0xa196('0x17')]();agents[_0x114b53[_0xa196('0x14')]]['lastevent']=_0xa196('0x1e');agents[_0x114b53[_0xa196('0x14')]][_0xa196('0x1f')]=_0xa196('0x1e');agents[_0x114b53[_0xa196('0x14')]][_0xa196('0x20')]=_0x114b53[_0xa196('0x21')]?parseInt(_0x114b53['ringtime'])/0x3e8:0x0;agents[_0x114b53['destuniqueid']]['talktime']=0x0;unanswered[_0xa196('0x22')](_0x114b53['destuniqueid']);}}catch(_0x2263a6){utils[_0xa196('0x23')](_0x2263a6[_0xa196('0x1a')]);}};exports[_0xa196('0x24')]=function(_0x41f72a){try{_[_0xa196('0x25')](agents,function(_0x496f26,_0x6a421d){if(_0x496f26[_0xa196('0x13')]==_0x41f72a[_0xa196('0x13')]&&!_['includes'](unanswered,_0x496f26[_0xa196('0x14')])){_0x496f26[_0xa196('0x1b')]=!![];_0x496f26['agentringnoanswerAt']=utils[_0xa196('0x17')]();_0x496f26['lastevent']=_0xa196('0x26');_0x496f26[_0xa196('0x1f')]=_0xa196('0x26');_0x496f26[_0xa196('0x20')]=_0x41f72a[_0xa196('0x20')];_0x496f26['talktime']=0x0;writeDB(_0x496f26);}});}catch(_0x3bf0ba){utils[_0xa196('0x23')](_0x3bf0ba[_0xa196('0x1a')]);}};exports['agentconnect']=function(_0x372f00){try{if(agents[_0x372f00[_0xa196('0x14')]]){agents[_0x372f00['destuniqueid']]['agentconnectAt']=utils[_0xa196('0x17')]();agents[_0x372f00[_0xa196('0x14')]][_0xa196('0x9')]=_0x372f00['connectedlinenum'];agents[_0x372f00[_0xa196('0x14')]][_0xa196('0x19')]=_0x372f00[_0xa196('0x19')];agents[_0x372f00['destuniqueid']][_0xa196('0x20')]=_0x372f00[_0xa196('0x21')];agents[_0x372f00['destuniqueid']][_0xa196('0xa')]='connect';_[_0xa196('0x25')](agents,function(_0x4135e7,_0x3a1d34){if(_0x4135e7[_0xa196('0x14')]!=_0x372f00['destuniqueid']&&_0x4135e7[_0xa196('0x13')]==_0x372f00[_0xa196('0x13')]){_0x4135e7[_0xa196('0x27')]=0x0;_0x4135e7[_0xa196('0x20')]=_0x372f00['ringtime'];_0x4135e7['agentringnoanswer']=!![];_0x4135e7['agentringnoanswerAt']=utils[_0xa196('0x17')]();_0x4135e7[_0xa196('0xa')]=_0xa196('0x28');_0x4135e7[_0xa196('0x1f')]=_0xa196('0x28');_0x4135e7[_0xa196('0x29')]=_0x372f00[_0xa196('0x14')];_0x4135e7[_0xa196('0x2a')]=_0x372f00[_0xa196('0x2b')];writeDB(_0x4135e7);}});}}catch(_0x16f77d){utils[_0xa196('0x23')](_0x16f77d['stack']);}};exports['agentcomplete']=function(_0x3c0ce){try{if(!_[_0xa196('0x1c')](agents[_0x3c0ce[_0xa196('0x14')]])){agents[_0x3c0ce[_0xa196('0x14')]][_0xa196('0xd')]=!![];agents[_0x3c0ce[_0xa196('0x14')]][_0xa196('0x2c')]=utils['now']();agents[_0x3c0ce['destuniqueid']][_0xa196('0x27')]=utils[_0xa196('0x2d')](agents[_0x3c0ce[_0xa196('0x14')]][_0xa196('0x2c')],agents[_0x3c0ce[_0xa196('0x14')]][_0xa196('0x2e')]);agents[_0x3c0ce['destuniqueid']]['reason']=_0x3c0ce['reason'];agents[_0x3c0ce[_0xa196('0x14')]][_0xa196('0xa')]=_0xa196('0x2f');writeDB(agents[_0x3c0ce[_0xa196('0x14')]]);}}catch(_0x948d6){utils[_0xa196('0x23')](_0x948d6[_0xa196('0x1a')]);}};exports[_0xa196('0x30')]=function(_0x2fcb74){try{if(!_[_0xa196('0x1c')](agents[_0x2fcb74['transfereruniqueid']])){agents[_0x2fcb74[_0xa196('0x31')]][_0xa196('0x32')]=!![];agents[_0x2fcb74[_0xa196('0x31')]][_0xa196('0x33')]=_0xa196('0x34');agents[_0x2fcb74['transfereruniqueid']][_0xa196('0x35')]=_0x2fcb74['extension'];agents[_0x2fcb74[_0xa196('0x31')]]['transferuniqueid']=agents[_0x2fcb74[_0xa196('0x31')]][_0xa196('0x13')];}}catch(_0x32d92a){utils[_0xa196('0x23')](_0x32d92a[_0xa196('0x1a')]);}};exports['attendedtransfer']=function(_0x196bf0){try{if(_0x196bf0[_0xa196('0x36')]==_0x196bf0['origtransfererlinkedid']){if(!_[_0xa196('0x1c')](agents[_0x196bf0[_0xa196('0x37')]])){agents[_0x196bf0['secondtransfereruniqueid']][_0xa196('0x32')]=!![];agents[_0x196bf0[_0xa196('0x37')]][_0xa196('0x33')]='ATTENDED';agents[_0x196bf0[_0xa196('0x37')]][_0xa196('0x35')]=_0x196bf0[_0xa196('0x38')];agents[_0x196bf0['secondtransfereruniqueid']][_0xa196('0x39')]=_0x196bf0['origtransfereruniqueid'];}if(_0x196bf0[_0xa196('0x3a')]&&agents[_0x196bf0['transfereeuniqueid']]){agents[_0x196bf0['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x196bf0['transfereeuniqueid']]=_['clone'](agents[_0x196bf0['transfereeuniqueid']]);transfers[_0x196bf0[_0xa196('0x3a')]]['calleridnum']=agents[_0x196bf0[_0xa196('0x37')]][_0xa196('0x8')];transfers[_0x196bf0[_0xa196('0x3a')]]['calleridname']=agents[_0x196bf0[_0xa196('0x37')]][_0xa196('0x3b')];transfers[_0x196bf0[_0xa196('0x3a')]][_0xa196('0x16')]=utils[_0xa196('0x17')]();transfers[_0x196bf0[_0xa196('0x3a')]]['agentconnectAt']=utils['now']();transfers[_0x196bf0['transfereeuniqueid']][_0xa196('0x20')]=0x0;transfers[_0x196bf0[_0xa196('0x3a')]][_0xa196('0x3c')]=0x2;}}else if(_0x196bf0[_0xa196('0x37')]==_0x196bf0['secondtransfererlinkedid']){if(!_[_0xa196('0x1c')](agents[_0x196bf0[_0xa196('0x36')]])){agents[_0x196bf0[_0xa196('0x36')]][_0xa196('0x32')]=!![];agents[_0x196bf0[_0xa196('0x36')]][_0xa196('0x33')]=_0xa196('0x3d');agents[_0x196bf0['origtransfereruniqueid']][_0xa196('0x35')]=_0x196bf0[_0xa196('0x3e')];agents[_0x196bf0[_0xa196('0x36')]][_0xa196('0x39')]=_0x196bf0['secondtransfereruniqueid'];}if(_0x196bf0[_0xa196('0x3f')]&&agents[_0x196bf0[_0xa196('0x3f')]]){agents[_0x196bf0[_0xa196('0x3f')]]['agententerreason']=0x1;transfers[_0x196bf0['transfertargetuniqueid']]=_[_0xa196('0x40')](agents[_0x196bf0[_0xa196('0x3f')]]);transfers[_0x196bf0[_0xa196('0x3f')]][_0xa196('0x8')]=agents[_0x196bf0[_0xa196('0x36')]][_0xa196('0x8')];transfers[_0x196bf0[_0xa196('0x3f')]][_0xa196('0x3b')]=agents[_0x196bf0['origtransfereruniqueid']]['calleridname'];transfers[_0x196bf0['transfertargetuniqueid']][_0xa196('0x16')]=utils[_0xa196('0x17')]();transfers[_0x196bf0[_0xa196('0x3f')]][_0xa196('0x2e')]=utils[_0xa196('0x17')]();transfers[_0x196bf0[_0xa196('0x3f')]][_0xa196('0x20')]=0x0;transfers[_0x196bf0[_0xa196('0x3f')]][_0xa196('0x3c')]=0x2;}}}catch(_0x1672ae){utils[_0xa196('0x23')](_0x1672ae[_0xa196('0x1a')]);}};exports['hangup']=function(_0x3c528e){try{if(agents[_0x3c528e['uniqueid']]&&agents[_0x3c528e[_0xa196('0x13')]]['reason']===_0xa196('0x1e')){if(_0x3c528e['cause']==='21'){agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0x1f')]=_0xa196('0x41');agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0xa')]=_0xa196('0x41');}writeDB(agents[_0x3c528e['uniqueid']]);var _0x117f18=unanswered[_0xa196('0x42')](_0x3c528e['uniqueid']);if(_0x117f18>-0x1)unanswered[_0xa196('0x43')](_0x117f18,0x1);}if(transfers[_0x3c528e[_0xa196('0x13')]]){transfers[_0x3c528e['uniqueid']][_0xa196('0xd')]=!![];transfers[_0x3c528e[_0xa196('0x13')]]['agentcompleteAt']=utils[_0xa196('0x17')]();transfers[_0x3c528e[_0xa196('0x13')]][_0xa196('0x27')]=utils[_0xa196('0x2d')](transfers[_0x3c528e['uniqueid']][_0xa196('0x2c')],transfers[_0x3c528e['uniqueid']]['agentconnectAt']);transfers[_0x3c528e[_0xa196('0x13')]][_0xa196('0x1f')]=_0xa196('0x44');transfers[_0x3c528e[_0xa196('0x13')]][_0xa196('0xa')]=_0xa196('0x2f');writeDB(transfers[_0x3c528e[_0xa196('0x13')]],!![]);}if(agents[_0x3c528e[_0xa196('0x13')]]&&agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0x2e')]){agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0xd')]=!![];agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0x2c')]=utils[_0xa196('0x17')]();agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0x27')]=utils[_0xa196('0x2d')](agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0x2c')],agents[_0x3c528e['uniqueid']][_0xa196('0x2e')]);agents[_0x3c528e['uniqueid']][_0xa196('0x1f')]=agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0x32')]?_0xa196('0x32'):_0xa196('0x44');agents[_0x3c528e[_0xa196('0x13')]][_0xa196('0xa')]=_0xa196('0x2f');writeDB(agents[_0x3c528e['uniqueid']]);}}catch(_0x5bb38d){utils[_0xa196('0x23')](_0x5bb38d[_0xa196('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3ebf3f6..025926c 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 _0x5b85=['util','NO\x20ANSWER','FAILED','ANSWERED','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','source','destination','callerid','accountcode','then','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','error','stack','newstate','isNil','systemanswertime','channelstate','destinationchannel','answertime','disposition','toNumber','hangup','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','varset','variable','xmd-originatecalleridnum','value','xmd-phone','xmd-callerid-preview','xmd-callerid','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','split','substring','includes','noop','execif','gotoif','lodash'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x5b85,0x1cd));var _0x55b8=function(_0x8a677e,_0xbfbf79){_0x8a677e=_0x8a677e-0x0;var _0x36f77f=_0x5b85[_0x8a677e];return _0x36f77f;};'use strict';var _=require(_0x55b8('0x0'));var util=require(_0x55b8('0x1'));var utils=require('./utils');var dispositions=[_0x55b8('0x2'),_0x55b8('0x3'),_0x55b8('0x3'),_0x55b8('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x55b8('0x4'),'BUSY',_0x55b8('0x3'),_0x55b8('0x3'),'FAILED'];var channels={};function writeDB(_0x503471){utils['info'](util['format'](_0x55b8('0x5'),_0x503471[_0x55b8('0x6')],_0x503471[_0x55b8('0x7')],_0x503471[_0x55b8('0x8')],_0x503471['accountcode'],_0x503471[_0x55b8('0x9')],_0x503471[_0x55b8('0xa')],_0x503471[_0x55b8('0xb')],_0x503471['disposition']));if(_0x503471['accountcode']){utils['getUserByInternal'](_0x503471[_0x55b8('0xc')])[_0x55b8('0xd')](function(_0x5aed4c){if(_0x5aed4c){_0x503471['UserId']=_0x5aed4c['id'];}utils[_0x55b8('0xe')](_0x55b8('0xf'),_0x503471);});}else{utils['request'](_0x55b8('0xf'),_0x503471);}if(channels[_0x503471[_0x55b8('0x6')]]){delete channels[_0x503471['uniqueid']];}}exports[_0x55b8('0x10')]=function(_0x3c944c){try{if(_0x3c944c[_0x55b8('0x6')]==_0x3c944c[_0x55b8('0x11')]&&_0x3c944c[_0x55b8('0x7')]!=_0x55b8('0x12')){channels[_0x3c944c[_0x55b8('0x6')]]={'uniqueid':_0x3c944c[_0x55b8('0x6')],'accountcode':_0x3c944c['accountcode'],'source':_0x3c944c[_0x55b8('0x13')],'destination':_0x3c944c['exten'],'destinationcontext':_0x3c944c[_0x55b8('0x14')],'channel':_0x3c944c[_0x55b8('0x7')],'starttime':utils[_0x55b8('0x15')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x55b8('0x2'),'amaflags':_0x55b8('0x16')};}}catch(_0xc94de5){utils[_0x55b8('0x17')](_0xc94de5[_0x55b8('0x18')]);}};exports[_0x55b8('0x19')]=function(_0x23ba59){try{if(!_['isNil'](channels[_0x23ba59[_0x55b8('0x6')]])&&_0x23ba59['channelstate']==0x6){if(_[_0x55b8('0x1a')](channels[_0x23ba59['uniqueid']][_0x55b8('0x1b')])){channels[_0x23ba59['uniqueid']][_0x55b8('0x1b')]=utils[_0x55b8('0x15')]();}}else if(!_[_0x55b8('0x1a')](channels[_0x23ba59[_0x55b8('0x11')]])&&_0x23ba59[_0x55b8('0x1c')]==0x6&&_0x23ba59['context']!='transfer'){channels[_0x23ba59[_0x55b8('0x11')]][_0x55b8('0xc')]=_0x23ba59[_0x55b8('0xc')];channels[_0x23ba59[_0x55b8('0x11')]][_0x55b8('0x1d')]=_0x23ba59[_0x55b8('0x7')];if(_[_0x55b8('0x1a')](channels[_0x23ba59['linkedid']][_0x55b8('0x1e')])){channels[_0x23ba59[_0x55b8('0x11')]][_0x55b8('0x1e')]=utils[_0x55b8('0x15')]();}channels[_0x23ba59[_0x55b8('0x11')]][_0x55b8('0x1f')]=dispositions[_[_0x55b8('0x20')](_0x23ba59[_0x55b8('0x1c')])]||_0x55b8('0x4');}}catch(_0xfa044a){utils['error'](_0xfa044a[_0x55b8('0x18')]);}};exports[_0x55b8('0x21')]=function(_0x225ca2){try{if(!_[_0x55b8('0x1a')](channels[_0x225ca2['uniqueid']])){if(_[_0x55b8('0x1a')](channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0xb')])){channels[_0x225ca2['uniqueid']][_0x55b8('0xb')]=_0x225ca2['calleridname']+'\x20<'+_0x225ca2[_0x55b8('0x13')]+'>';}channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0x22')]=utils[_0x55b8('0x15')]();channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0x23')]=utils[_0x55b8('0x24')](channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0x22')],channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0x25')]);channels[_0x225ca2[_0x55b8('0x6')]]['billableseconds']=channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0x1e')]?utils[_0x55b8('0x24')](channels[_0x225ca2[_0x55b8('0x6')]][_0x55b8('0x22')],channels[_0x225ca2[_0x55b8('0x6')]]['answertime']):0x0;writeDB(channels[_0x225ca2[_0x55b8('0x6')]]);}}catch(_0x15bc6a){utils[_0x55b8('0x17')](_0x15bc6a[_0x55b8('0x18')]);}};exports[_0x55b8('0x26')]=function(_0x1bf856){try{if(!_['isNil'](channels[_0x1bf856[_0x55b8('0x27')]])){if(channels[_0x1bf856[_0x55b8('0x27')]][_0x55b8('0x7')]==_0x1bf856['transfereechannel']){channels[_0x1bf856[_0x55b8('0x27')]][_0x55b8('0x1d')]=_0x1bf856['secondtransfererchannel'];channels[_0x1bf856['localtwolinkedid']][_0x55b8('0x28')]=_0x55b8('0x29');}else if(channels[_0x1bf856[_0x55b8('0x27')]][_0x55b8('0x7')]=_0x1bf856[_0x55b8('0x2a')]){channels[_0x1bf856[_0x55b8('0x27')]]['destinationchannel']=_0x1bf856[_0x55b8('0x2b')];channels[_0x1bf856[_0x55b8('0x27')]][_0x55b8('0x28')]='_attended';}}}catch(_0xea82f5){utils[_0x55b8('0x17')](_0xea82f5[_0x55b8('0x18')]);}};exports[_0x55b8('0x2c')]=function(_0x133e12){try{if(!_[_0x55b8('0x1a')](channels[_0x133e12['uniqueid']])){channels[_0x133e12[_0x55b8('0x6')]][_0x55b8('0x2d')]=utils['now']();}}catch(_0x28eebf){utils[_0x55b8('0x17')](_0x28eebf[_0x55b8('0x18')]);}};exports[_0x55b8('0x2e')]=function(_0x342aff){try{if(!_[_0x55b8('0x1a')](channels[_0x342aff[_0x55b8('0x6')]])){if(!_[_0x55b8('0x1a')](channels[_0x342aff[_0x55b8('0x6')]][_0x55b8('0x2d')])){channels[_0x342aff['uniqueid']]['mohtime']+=utils[_0x55b8('0x24')](utils[_0x55b8('0x15')](),channels[_0x342aff['uniqueid']][_0x55b8('0x2d')]);delete channels[_0x342aff[_0x55b8('0x6')]][_0x55b8('0x2d')];}}}catch(_0x313f27){utils['error'](_0x313f27[_0x55b8('0x18')]);}};exports[_0x55b8('0x2f')]=function(_0x2684fd){try{if(!_[_0x55b8('0x1a')](channels[_0x2684fd['uniqueid']])){if(!_['isNil'](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x31')])){channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0x9')]=_0x2684fd[_0x55b8('0x32')];}if(!_[_0x55b8('0x1a')](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x33')])){channels[_0x2684fd[_0x55b8('0x6')]]['destination']=_0x2684fd[_0x55b8('0x32')];channels[_0x2684fd[_0x55b8('0x6')]]['callerid']='\x22'+_0x2684fd[_0x55b8('0x32')]+'\x22\x20<'+_0x2684fd[_0x55b8('0x32')]+'>';}if(!_['isNil'](_0x2684fd['variable'][_0x55b8('0x34')])||!_[_0x55b8('0x1a')](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x35')])){channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0xb')]=_0x2684fd['value'];}if(!_[_0x55b8('0x1a')](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x36')])||!_[_0x55b8('0x1a')](_0x2684fd[_0x55b8('0x30')]['xmcs-queue'])){channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0x37')]=_0x55b8('0x38');channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0x39')]=_0x2684fd[_0x55b8('0x32')];channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0x3a')]=!![];}if(!_['isNil'](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x3b')])){channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0x3c')]=_0x2684fd['value'];}if(!_['isNil'](_0x2684fd['variable'][_0x55b8('0x3d')])){channels[_0x2684fd[_0x55b8('0x6')]][_0x55b8('0x8')]=_0x2684fd['value'];}if(!_['isNil'](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x3e')])){channels[_0x2684fd['uniqueid']][_0x55b8('0x3f')]=_0x2684fd[_0x55b8('0x32')];}if(!_['isNil'](_0x2684fd[_0x55b8('0x30')][_0x55b8('0x40')])){channels[_0x2684fd[_0x55b8('0x6')]]['sipcallid']=_0x2684fd[_0x55b8('0x32')];}}}catch(_0x303326){utils['error'](_0x303326[_0x55b8('0x18')]);}};exports[_0x55b8('0x41')]=function(_0x1d4775){try{if(!_['isNil'](channels[_0x1d4775[_0x55b8('0x6')]])){if(_0x1d4775[_0x55b8('0x42')][_0x55b8('0x43')]()==_0x55b8('0x44')&&_[_0x55b8('0x45')](_0x1d4775[_0x55b8('0x46')][_0x55b8('0x43')](),'cdr')){var _0xfd886f=_0x1d4775[_0x55b8('0x46')][_0x55b8('0x47')]('=');var _0x1aa818=_0xfd886f[0x0][_0x55b8('0x48')](_0xfd886f[0x0]['lastIndexOf']('(')+0x1,_0xfd886f[0x0]['lastIndexOf'](')'));var _0x2beb1a=_0xfd886f[0x1];channels[_0x1d4775[_0x55b8('0x6')]][_0x1aa818]=_0x2beb1a;}if(!_[_0x55b8('0x49')](['hangup',_0x55b8('0x4a'),_0x55b8('0x4b'),_0x55b8('0x44'),_0x55b8('0x4c')],_0x1d4775[_0x55b8('0x42')][_0x55b8('0x43')]())){channels[_0x1d4775['uniqueid']][_0x55b8('0x37')]=_0x1d4775['application'];channels[_0x1d4775[_0x55b8('0x6')]][_0x55b8('0x39')]=_0x1d4775[_0x55b8('0x46')];}}}catch(_0x6ae1dc){utils['error'](_0x6ae1dc['stack']);}}; \ No newline at end of file +var _0xad20=['info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','type','accountcode','source','destination','callerid','disposition','then','UserId','CreateVoiceCallReport','request','uniqueid','newchannel','linkedid','channel','calleridnum','exten','now','error','stack','newstate','channelstate','isNil','systemanswertime','transfer','destinationchannel','answertime','ANSWERED','hangup','calleridname','endtime','duration','diffTime','localtwolinkedid','transfereechannel','secondtransfererchannel','origtransfererchannel','userfield','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','xmd-originatecalleridnum','xmd-phone','value','variable','xmd-callerid','xmcs-queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','cdr','appdata','split','substring','lastIndexOf','includes','noop','execif','gotoif','lastapplication','lodash','util','./utils','FAILED','NO\x20ANSWER','BUSY'];(function(_0x474f1e,_0x5f26e5){var _0x483f21=function(_0x3364b4){while(--_0x3364b4){_0x474f1e['push'](_0x474f1e['shift']());}};_0x483f21(++_0x5f26e5);}(_0xad20,0x18a));var _0x0ad2=function(_0x46d750,_0x4beee0){_0x46d750=_0x46d750-0x0;var _0x5345d7=_0xad20[_0x46d750];return _0x5345d7;};'use strict';var _=require(_0x0ad2('0x0'));var util=require(_0x0ad2('0x1'));var utils=require(_0x0ad2('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x0ad2('0x3'),_0x0ad2('0x4'),_0x0ad2('0x4'),_0x0ad2('0x4'),'ANSWERED',_0x0ad2('0x5'),_0x0ad2('0x3'),_0x0ad2('0x3'),'FAILED'];var channels={};function writeDB(_0x143d0d){utils[_0x0ad2('0x6')](util[_0x0ad2('0x7')](_0x0ad2('0x8'),_0x143d0d['uniqueid'],_0x143d0d['channel'],_0x143d0d[_0x0ad2('0x9')],_0x143d0d[_0x0ad2('0xa')],_0x143d0d[_0x0ad2('0xb')],_0x143d0d[_0x0ad2('0xc')],_0x143d0d[_0x0ad2('0xd')],_0x143d0d[_0x0ad2('0xe')]));if(_0x143d0d[_0x0ad2('0xa')]){utils['getUserByInternal'](_0x143d0d[_0x0ad2('0xa')])[_0x0ad2('0xf')](function(_0x120a45){if(_0x120a45){_0x143d0d[_0x0ad2('0x10')]=_0x120a45['id'];}utils['request'](_0x0ad2('0x11'),_0x143d0d);});}else{utils[_0x0ad2('0x12')](_0x0ad2('0x11'),_0x143d0d);}if(channels[_0x143d0d[_0x0ad2('0x13')]]){delete channels[_0x143d0d[_0x0ad2('0x13')]];}}exports[_0x0ad2('0x14')]=function(_0x543151){try{if(_0x543151[_0x0ad2('0x13')]==_0x543151[_0x0ad2('0x15')]&&_0x543151[_0x0ad2('0x16')]!='OutgoingSpoolFailed'){channels[_0x543151[_0x0ad2('0x13')]]={'uniqueid':_0x543151[_0x0ad2('0x13')],'accountcode':_0x543151[_0x0ad2('0xa')],'source':_0x543151[_0x0ad2('0x17')],'destination':_0x543151[_0x0ad2('0x18')],'destinationcontext':_0x543151['context'],'channel':_0x543151[_0x0ad2('0x16')],'starttime':utils[_0x0ad2('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x228933){utils[_0x0ad2('0x1a')](_0x228933[_0x0ad2('0x1b')]);}};exports[_0x0ad2('0x1c')]=function(_0x5bb255){try{if(!_['isNil'](channels[_0x5bb255[_0x0ad2('0x13')]])&&_0x5bb255[_0x0ad2('0x1d')]==0x6){if(_[_0x0ad2('0x1e')](channels[_0x5bb255['uniqueid']]['systemanswertime'])){channels[_0x5bb255[_0x0ad2('0x13')]][_0x0ad2('0x1f')]=utils['now']();}}else if(!_[_0x0ad2('0x1e')](channels[_0x5bb255['linkedid']])&&_0x5bb255[_0x0ad2('0x1d')]==0x6&&_0x5bb255['context']!=_0x0ad2('0x20')){channels[_0x5bb255[_0x0ad2('0x15')]][_0x0ad2('0xa')]=_0x5bb255['accountcode'];channels[_0x5bb255[_0x0ad2('0x15')]][_0x0ad2('0x21')]=_0x5bb255[_0x0ad2('0x16')];if(_[_0x0ad2('0x1e')](channels[_0x5bb255[_0x0ad2('0x15')]][_0x0ad2('0x22')])){channels[_0x5bb255[_0x0ad2('0x15')]][_0x0ad2('0x22')]=utils[_0x0ad2('0x19')]();}channels[_0x5bb255['linkedid']][_0x0ad2('0xe')]=dispositions[_['toNumber'](_0x5bb255['channelstate'])]||_0x0ad2('0x23');}}catch(_0x93eed2){utils[_0x0ad2('0x1a')](_0x93eed2[_0x0ad2('0x1b')]);}};exports[_0x0ad2('0x24')]=function(_0x361e8f){try{if(!_[_0x0ad2('0x1e')](channels[_0x361e8f[_0x0ad2('0x13')]])){if(_[_0x0ad2('0x1e')](channels[_0x361e8f[_0x0ad2('0x13')]][_0x0ad2('0xd')])){channels[_0x361e8f[_0x0ad2('0x13')]][_0x0ad2('0xd')]=_0x361e8f[_0x0ad2('0x25')]+'\x20<'+_0x361e8f[_0x0ad2('0x17')]+'>';}channels[_0x361e8f['uniqueid']][_0x0ad2('0x26')]=utils[_0x0ad2('0x19')]();channels[_0x361e8f[_0x0ad2('0x13')]][_0x0ad2('0x27')]=utils[_0x0ad2('0x28')](channels[_0x361e8f[_0x0ad2('0x13')]][_0x0ad2('0x26')],channels[_0x361e8f[_0x0ad2('0x13')]]['starttime']);channels[_0x361e8f[_0x0ad2('0x13')]]['billableseconds']=channels[_0x361e8f[_0x0ad2('0x13')]]['answertime']?utils[_0x0ad2('0x28')](channels[_0x361e8f['uniqueid']][_0x0ad2('0x26')],channels[_0x361e8f[_0x0ad2('0x13')]][_0x0ad2('0x22')]):0x0;writeDB(channels[_0x361e8f[_0x0ad2('0x13')]]);}}catch(_0x1dc3bb){utils[_0x0ad2('0x1a')](_0x1dc3bb[_0x0ad2('0x1b')]);}};exports['attendedtransfer']=function(_0x3de24f){try{if(!_[_0x0ad2('0x1e')](channels[_0x3de24f[_0x0ad2('0x29')]])){if(channels[_0x3de24f['localtwolinkedid']]['channel']==_0x3de24f[_0x0ad2('0x2a')]){channels[_0x3de24f[_0x0ad2('0x29')]]['destinationchannel']=_0x3de24f[_0x0ad2('0x2b')];channels[_0x3de24f['localtwolinkedid']]['userfield']='_attended';}else if(channels[_0x3de24f['localtwolinkedid']]['channel']=_0x3de24f['transfertargetchannel']){channels[_0x3de24f[_0x0ad2('0x29')]][_0x0ad2('0x21')]=_0x3de24f[_0x0ad2('0x2c')];channels[_0x3de24f[_0x0ad2('0x29')]][_0x0ad2('0x2d')]='_attended';}}}catch(_0x5d8ded){utils[_0x0ad2('0x1a')](_0x5d8ded[_0x0ad2('0x1b')]);}};exports[_0x0ad2('0x2e')]=function(_0x4e06bd){try{if(!_[_0x0ad2('0x1e')](channels[_0x4e06bd[_0x0ad2('0x13')]])){channels[_0x4e06bd[_0x0ad2('0x13')]][_0x0ad2('0x2f')]=utils[_0x0ad2('0x19')]();}}catch(_0x2eba97){utils[_0x0ad2('0x1a')](_0x2eba97['stack']);}};exports[_0x0ad2('0x30')]=function(_0x550284){try{if(!_[_0x0ad2('0x1e')](channels[_0x550284['uniqueid']])){if(!_['isNil'](channels[_0x550284['uniqueid']]['musiconholdstartAt'])){channels[_0x550284['uniqueid']][_0x0ad2('0x31')]+=utils[_0x0ad2('0x28')](utils['now'](),channels[_0x550284['uniqueid']][_0x0ad2('0x2f')]);delete channels[_0x550284[_0x0ad2('0x13')]][_0x0ad2('0x2f')];}}}catch(_0x4156c2){utils['error'](_0x4156c2['stack']);}};exports[_0x0ad2('0x32')]=function(_0x45e281){try{if(!_[_0x0ad2('0x1e')](channels[_0x45e281[_0x0ad2('0x13')]])){if(!_[_0x0ad2('0x1e')](_0x45e281['variable'][_0x0ad2('0x33')])){channels[_0x45e281['uniqueid']][_0x0ad2('0xb')]=_0x45e281['value'];}if(!_[_0x0ad2('0x1e')](_0x45e281['variable'][_0x0ad2('0x34')])){channels[_0x45e281[_0x0ad2('0x13')]]['destination']=_0x45e281[_0x0ad2('0x35')];channels[_0x45e281[_0x0ad2('0x13')]]['callerid']='\x22'+_0x45e281['value']+'\x22\x20<'+_0x45e281[_0x0ad2('0x35')]+'>';}if(!_[_0x0ad2('0x1e')](_0x45e281[_0x0ad2('0x36')]['xmd-callerid-preview'])||!_['isNil'](_0x45e281['variable'][_0x0ad2('0x37')])){channels[_0x45e281['uniqueid']][_0x0ad2('0xd')]=_0x45e281['value'];}if(!_[_0x0ad2('0x1e')](_0x45e281[_0x0ad2('0x36')]['xmd-queue'])||!_[_0x0ad2('0x1e')](_0x45e281[_0x0ad2('0x36')][_0x0ad2('0x38')])){channels[_0x45e281['uniqueid']]['lastapplication']='Queue';channels[_0x45e281[_0x0ad2('0x13')]][_0x0ad2('0x39')]=_0x45e281[_0x0ad2('0x35')];channels[_0x45e281[_0x0ad2('0x13')]][_0x0ad2('0x3a')]=!![];}if(!_['isNil'](_0x45e281[_0x0ad2('0x36')][_0x0ad2('0x3b')])){channels[_0x45e281[_0x0ad2('0x13')]][_0x0ad2('0x3c')]=_0x45e281[_0x0ad2('0x35')];}if(!_[_0x0ad2('0x1e')](_0x45e281[_0x0ad2('0x36')][_0x0ad2('0x3d')])){channels[_0x45e281['uniqueid']][_0x0ad2('0x9')]=_0x45e281[_0x0ad2('0x35')];}if(!_[_0x0ad2('0x1e')](_0x45e281[_0x0ad2('0x36')][_0x0ad2('0x3e')])){channels[_0x45e281[_0x0ad2('0x13')]][_0x0ad2('0x3f')]=_0x45e281[_0x0ad2('0x35')];}if(!_[_0x0ad2('0x1e')](_0x45e281[_0x0ad2('0x36')][_0x0ad2('0x40')])){channels[_0x45e281['uniqueid']][_0x0ad2('0x40')]=_0x45e281[_0x0ad2('0x35')];}}}catch(_0x130115){utils[_0x0ad2('0x1a')](_0x130115[_0x0ad2('0x1b')]);}};exports[_0x0ad2('0x41')]=function(_0x39db42){try{if(!_[_0x0ad2('0x1e')](channels[_0x39db42[_0x0ad2('0x13')]])){if(_0x39db42[_0x0ad2('0x42')][_0x0ad2('0x43')]()==_0x0ad2('0x44')&&_[_0x0ad2('0x45')](_0x39db42['appdata']['toLowerCase'](),_0x0ad2('0x46'))){var _0x2f2571=_0x39db42[_0x0ad2('0x47')][_0x0ad2('0x48')]('=');var _0x40e897=_0x2f2571[0x0][_0x0ad2('0x49')](_0x2f2571[0x0]['lastIndexOf']('(')+0x1,_0x2f2571[0x0][_0x0ad2('0x4a')](')'));var _0xb5fe74=_0x2f2571[0x1];channels[_0x39db42[_0x0ad2('0x13')]][_0x40e897]=_0xb5fe74;}if(!_[_0x0ad2('0x4b')](['hangup',_0x0ad2('0x4c'),_0x0ad2('0x4d'),'set',_0x0ad2('0x4e')],_0x39db42[_0x0ad2('0x42')]['toLowerCase']())){channels[_0x39db42['uniqueid']][_0x0ad2('0x4f')]=_0x39db42[_0x0ad2('0x42')];channels[_0x39db42[_0x0ad2('0x13')]][_0x0ad2('0x39')]=_0x39db42[_0x0ad2('0x47')];}}}catch(_0x15284b){utils['error'](_0x15284b[_0x0ad2('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e8a6901..d8d9093 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 _0x01d9=['./utils','lodash','connect','info','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent'];(function(_0xe35241,_0x41e27b){var _0x9ef434=function(_0xd98456){while(--_0xd98456){_0xe35241['push'](_0xe35241['shift']());}};_0x9ef434(++_0x41e27b);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var utils=require(_0x901d('0x0'));var _=require(_0x901d('0x1'));exports[_0x901d('0x2')]=function(){utils[_0x901d('0x3')]('CONNECTED');};exports[_0x901d('0x4')]=function(){utils[_0x901d('0x3')](_0x901d('0x5'));};exports[_0x901d('0x6')]=function(){utils[_0x901d('0x3')](_0x901d('0x7'));};exports[_0x901d('0x8')]=function(_0x4e7842){utils[_0x901d('0x8')](_0x4e7842);};exports[_0x901d('0x9')]=function(){utils[_0x901d('0x3')](_0x901d('0xa'));};exports[_0x901d('0xb')]=function(_0x39fc94){}; \ No newline at end of file +var _0xb4c7=['connect','info','CONNECTED','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','lodash'];(function(_0x11fbb7,_0x51b3e5){var _0x5d52c7=function(_0x164f1c){while(--_0x164f1c){_0x11fbb7['push'](_0x11fbb7['shift']());}};_0x5d52c7(++_0x51b3e5);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1b5a30,_0x5991a7){_0x1b5a30=_0x1b5a30-0x0;var _0x53936a=_0xb4c7[_0x1b5a30];return _0x53936a;};'use strict';var utils=require(_0x7b4c('0x0'));var _=require(_0x7b4c('0x1'));exports[_0x7b4c('0x2')]=function(){utils[_0x7b4c('0x3')](_0x7b4c('0x4'));};exports['shutdown']=function(){utils[_0x7b4c('0x3')](_0x7b4c('0x5'));};exports[_0x7b4c('0x6')]=function(){utils[_0x7b4c('0x3')](_0x7b4c('0x7'));};exports['error']=function(_0x1b0f57){utils[_0x7b4c('0x8')](_0x1b0f57);};exports[_0x7b4c('0x9')]=function(){utils['info'](_0x7b4c('0xa'));};exports[_0x7b4c('0xb')]=function(_0x570daa){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 3b44d4a..014b069 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 _0x8aac=['CreateVoiceDialReport','uniqueid','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','stack','varset','isNil','outboundrouteid','error','dialbegin','starttime','now','called','dialstatus','ANSWER','assign','answertime','lastevent','connect','hangup','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','./utils','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x8aac,0x6f));var _0xc8aa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aac[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8aa('0x0'));var util=require(_0xc8aa('0x1'));var utils=require(_0xc8aa('0x2'));var dials={};function writeDB(_0x21f8aa){utils['info'](util[_0xc8aa('0x3')](_0xc8aa('0x4'),_0x21f8aa['uniqueid'],_0x21f8aa[_0xc8aa('0x5')],_0x21f8aa[_0xc8aa('0x6')],_0x21f8aa[_0xc8aa('0x7')],_0x21f8aa[_0xc8aa('0x8')],_0x21f8aa['dialstatus']));utils['request'](_0xc8aa('0x9'),_0x21f8aa);delete dials[_0x21f8aa[_0xc8aa('0xa')]];}exports[_0xc8aa('0xb')]=function(_0x33f5df){try{if(_0x33f5df[_0xc8aa('0xc')][_0xc8aa('0xd')]()==_0xc8aa('0xe')&&_[_0xc8aa('0xf')](_0x33f5df[_0xc8aa('0x10')]['toLowerCase'](),_0xc8aa('0x11'))){var _0x3fef6e=_0x33f5df[_0xc8aa('0x10')]['split']('=');dials[_0x33f5df[_0xc8aa('0xa')]]={'routeId':_0x3fef6e[0x1]};}}catch(_0x73f773){utils['error'](_0x73f773[_0xc8aa('0x12')]);}};exports[_0xc8aa('0x13')]=function(_0x21bea4){try{if(!_[_0xc8aa('0x14')](_0x21bea4['variable'][_0xc8aa('0x15')])){dials[_0x21bea4[_0xc8aa('0xa')]]={'routeId':_0x21bea4['value']};}}catch(_0x1affa0){utils[_0xc8aa('0x16')](_0x1affa0[_0xc8aa('0x12')]);}};exports[_0xc8aa('0x17')]=function(_0x598660){try{if(!_['isNil'](dials[_0x598660[_0xc8aa('0xa')]])){dials[_0x598660['uniqueid']]=_['assign'](dials[_0x598660['uniqueid']],_0x598660);dials[_0x598660['uniqueid']][_0xc8aa('0x18')]=utils[_0xc8aa('0x19')]();dials[_0x598660[_0xc8aa('0xa')]]['lastevent']=_0xc8aa('0x1a');}}catch(_0x389115){utils[_0xc8aa('0x16')](_0x389115['stack']);}};exports['dialend']=function(_0x747f04){try{if(!_[_0xc8aa('0x14')](dials[_0x747f04[_0xc8aa('0xa')]])){dials[_0x747f04['uniqueid']][_0xc8aa('0x1b')]=_0x747f04['dialstatus'];if(_0x747f04[_0xc8aa('0x1b')]==_0xc8aa('0x1c')){dials[_0x747f04[_0xc8aa('0xa')]]=_[_0xc8aa('0x1d')](dials[_0x747f04['uniqueid']],_0x747f04);dials[_0x747f04[_0xc8aa('0xa')]][_0xc8aa('0x1e')]=utils[_0xc8aa('0x19')]();dials[_0x747f04[_0xc8aa('0xa')]][_0xc8aa('0x1f')]=_0xc8aa('0x20');}}}catch(_0x5ba81d){utils[_0xc8aa('0x16')](_0x5ba81d[_0xc8aa('0x12')]);}};exports[_0xc8aa('0x21')]=function(_0x35fb05){try{if(!_[_0xc8aa('0x14')](dials[_0x35fb05[_0xc8aa('0xa')]])){dials[_0x35fb05[_0xc8aa('0xa')]]=_[_0xc8aa('0x1d')](dials[_0x35fb05[_0xc8aa('0xa')]],{'endtime':utils['now'](),'lastevent':_0xc8aa('0x22')});dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x23')]=utils['diffTime'](dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x24')],dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x18')]);dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x25')]=utils[_0xc8aa('0x26')](dials[_0x35fb05['uniqueid']][_0xc8aa('0x1e')]||dials[_0x35fb05['uniqueid']][_0xc8aa('0x24')],dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x18')]);dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x27')]=dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x1e')]?utils[_0xc8aa('0x26')](dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x24')],dials[_0x35fb05[_0xc8aa('0xa')]][_0xc8aa('0x1e')]):0x0;writeDB(dials[_0x35fb05[_0xc8aa('0xa')]]);}}catch(_0x594210){utils['error'](_0x594210[_0xc8aa('0x12')]);}}; \ No newline at end of file +var _0x6f88=['variable','outboundrouteid','dialbegin','assign','starttime','now','lastevent','connect','hangup','complete','diffTime','endtime','billableseconds','answertime','util','info','format','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','error','stack','varset','isNil'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x6f88,0x96));var _0x86f8=function(_0x20f322,_0x26c8dc){_0x20f322=_0x20f322-0x0;var _0x5661b4=_0x6f88[_0x20f322];return _0x5661b4;};'use strict';var _=require('lodash');var util=require(_0x86f8('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x381b06){utils[_0x86f8('0x1')](util[_0x86f8('0x2')]('DIAL|%s|%s|%s|%s|%s|%s',_0x381b06[_0x86f8('0x3')],_0x381b06[_0x86f8('0x4')],_0x381b06[_0x86f8('0x5')],_0x381b06['calleridnum'],_0x381b06[_0x86f8('0x6')],_0x381b06[_0x86f8('0x7')]));utils[_0x86f8('0x8')](_0x86f8('0x9'),_0x381b06);delete dials[_0x381b06[_0x86f8('0x3')]];}exports['newexten']=function(_0x3eff95){try{if(_0x3eff95[_0x86f8('0xa')][_0x86f8('0xb')]()==_0x86f8('0xc')&&_[_0x86f8('0xd')](_0x3eff95[_0x86f8('0xe')][_0x86f8('0xb')](),_0x86f8('0xf'))){var _0x2e4c8c=_0x3eff95[_0x86f8('0xe')]['split']('=');dials[_0x3eff95['uniqueid']]={'routeId':_0x2e4c8c[0x1]};}}catch(_0x21baba){utils[_0x86f8('0x10')](_0x21baba[_0x86f8('0x11')]);}};exports[_0x86f8('0x12')]=function(_0x4e5a20){try{if(!_[_0x86f8('0x13')](_0x4e5a20[_0x86f8('0x14')][_0x86f8('0x15')])){dials[_0x4e5a20[_0x86f8('0x3')]]={'routeId':_0x4e5a20['value']};}}catch(_0x2a5da5){utils['error'](_0x2a5da5[_0x86f8('0x11')]);}};exports[_0x86f8('0x16')]=function(_0x2d3d45){try{if(!_[_0x86f8('0x13')](dials[_0x2d3d45[_0x86f8('0x3')]])){dials[_0x2d3d45[_0x86f8('0x3')]]=_[_0x86f8('0x17')](dials[_0x2d3d45[_0x86f8('0x3')]],_0x2d3d45);dials[_0x2d3d45[_0x86f8('0x3')]][_0x86f8('0x18')]=utils[_0x86f8('0x19')]();dials[_0x2d3d45[_0x86f8('0x3')]]['lastevent']='called';}}catch(_0xa8400c){utils[_0x86f8('0x10')](_0xa8400c['stack']);}};exports['dialend']=function(_0x14a741){try{if(!_[_0x86f8('0x13')](dials[_0x14a741[_0x86f8('0x3')]])){dials[_0x14a741[_0x86f8('0x3')]][_0x86f8('0x7')]=_0x14a741[_0x86f8('0x7')];if(_0x14a741[_0x86f8('0x7')]=='ANSWER'){dials[_0x14a741[_0x86f8('0x3')]]=_['assign'](dials[_0x14a741[_0x86f8('0x3')]],_0x14a741);dials[_0x14a741[_0x86f8('0x3')]]['answertime']=utils[_0x86f8('0x19')]();dials[_0x14a741[_0x86f8('0x3')]][_0x86f8('0x1a')]=_0x86f8('0x1b');}}}catch(_0x4a4e36){utils[_0x86f8('0x10')](_0x4a4e36[_0x86f8('0x11')]);}};exports[_0x86f8('0x1c')]=function(_0x592bd2){try{if(!_[_0x86f8('0x13')](dials[_0x592bd2[_0x86f8('0x3')]])){dials[_0x592bd2[_0x86f8('0x3')]]=_[_0x86f8('0x17')](dials[_0x592bd2['uniqueid']],{'endtime':utils[_0x86f8('0x19')](),'lastevent':_0x86f8('0x1d')});dials[_0x592bd2['uniqueid']]['duration']=utils[_0x86f8('0x1e')](dials[_0x592bd2[_0x86f8('0x3')]][_0x86f8('0x1f')],dials[_0x592bd2[_0x86f8('0x3')]][_0x86f8('0x18')]);dials[_0x592bd2[_0x86f8('0x3')]]['holdtime']=utils[_0x86f8('0x1e')](dials[_0x592bd2[_0x86f8('0x3')]]['answertime']||dials[_0x592bd2['uniqueid']][_0x86f8('0x1f')],dials[_0x592bd2[_0x86f8('0x3')]]['starttime']);dials[_0x592bd2[_0x86f8('0x3')]][_0x86f8('0x20')]=dials[_0x592bd2[_0x86f8('0x3')]][_0x86f8('0x21')]?utils[_0x86f8('0x1e')](dials[_0x592bd2[_0x86f8('0x3')]][_0x86f8('0x1f')],dials[_0x592bd2[_0x86f8('0x3')]][_0x86f8('0x21')]):0x0;writeDB(dials[_0x592bd2[_0x86f8('0x3')]]);}}catch(_0x440b47){utils[_0x86f8('0x10')](_0x440b47[_0x86f8('0x11')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 8e48ec6..6ba4943 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 _0x72cd=['agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','info','./calls.controller','./queues.controller','./recordings.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange'];(function(_0x4ec7d5,_0xb7a91d){var _0x21a5a2=function(_0x46f144){while(--_0x46f144){_0x4ec7d5['push'](_0x4ec7d5['shift']());}};_0x21a5a2(++_0xb7a91d);}(_0x72cd,0xd0));var _0xd72c=function(_0xad1c7a,_0x1613d8){_0xad1c7a=_0xad1c7a-0x0;var _0x56c45d=_0x72cd[_0xad1c7a];return _0x56c45d;};var AsteriskManager=require(_0xd72c('0x0'));var config=require('../../config/environment');var utils=require(_0xd72c('0x1'));var ami=new AsteriskManager(config[_0xd72c('0x2')][_0xd72c('0x3')],config[_0xd72c('0x2')]['ip'],config[_0xd72c('0x2')][_0xd72c('0x4')],config['asterisk'][_0xd72c('0x5')],!![]);ami[_0xd72c('0x6')]();if(config[_0xd72c('0x7')]&&config[_0xd72c('0x7')]['disabled']){utils[_0xd72c('0x8')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require(_0xd72c('0x9'));var queues=require(_0xd72c('0xa'));var recordings=require(_0xd72c('0xb'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xd72c('0xc'));ami['on'](_0xd72c('0xd'),core[_0xd72c('0xd')]);ami['on'](_0xd72c('0xe'),core[_0xd72c('0xe')]);ami['on'](_0xd72c('0xf'),core[_0xd72c('0xf')]);ami['on'](_0xd72c('0x10'),core[_0xd72c('0x10')]);ami['on'](_0xd72c('0x11'),core[_0xd72c('0x11')]);ami['on'](_0xd72c('0x12'),core['managerevent']);ami['on'](_0xd72c('0x13'),function(_0x6a6fed){try{members[_0xd72c('0x13')](_0x6a6fed);}catch(_0x2c89fe){utils[_0xd72c('0x10')](_0x2c89fe);}});ami['on'](_0xd72c('0x14'),function(_0x1ef6db){try{agents[_0xd72c('0x14')](_0x1ef6db);}catch(_0x430e98){utils['error'](_0x430e98);}});ami['on'](_0xd72c('0x15'),function(_0x1f227e){try{agents[_0xd72c('0x15')](_0x1f227e);}catch(_0x5a3fd3){utils['error'](_0x5a3fd3);}});ami['on']('agentconnect',function(_0x589c79){try{agents[_0xd72c('0x16')](_0x589c79);queues[_0xd72c('0x16')](_0x589c79);}catch(_0x5732cd){utils[_0xd72c('0x10')](_0x5732cd);}});ami['on'](_0xd72c('0x17'),function(_0x528b63){try{agents[_0xd72c('0x17')](_0x528b63);queues[_0xd72c('0x17')](_0x528b63);members[_0xd72c('0x17')](_0x528b63);}catch(_0x33559c){utils[_0xd72c('0x10')](_0x33559c);}});ami['on'](_0xd72c('0x18'),function(_0xa9d1c0){try{agents[_0xd72c('0x18')](_0xa9d1c0);queues['queuecallerabandon'](_0xa9d1c0);}catch(_0x323479){utils['error'](_0x323479);}});ami['on'](_0xd72c('0x19'),function(_0x41fabc){try{queues['queuecallerjoin'](_0x41fabc);recordings[_0xd72c('0x19')](_0x41fabc);}catch(_0x1cd01a){utils[_0xd72c('0x10')](_0x1cd01a);}});ami['on'](_0xd72c('0x1a'),function(_0x42f02a){try{queues[_0xd72c('0x1a')](_0x42f02a);}catch(_0x187596){utils[_0xd72c('0x10')](_0x187596);}});ami['on']('musiconholdstart',function(_0x46cb86){try{queues[_0xd72c('0x1b')](_0x46cb86);calls['musiconholdstart'](_0x46cb86);}catch(_0xc4f71d){utils[_0xd72c('0x10')](_0xc4f71d);}});ami['on']('musiconholdstop',function(_0x409ec0){try{queues[_0xd72c('0x1c')](_0x409ec0);calls[_0xd72c('0x1c')](_0x409ec0);}catch(_0x185cd6){utils[_0xd72c('0x10')](_0x185cd6);}});ami['on']('newstate',function(_0x150b7d){try{calls['newstate'](_0x150b7d);recordings['newstate'](_0x150b7d);}catch(_0x1740e5){utils[_0xd72c('0x10')](_0x1740e5);}});ami['on']('hangup',function(_0x28d7d1){try{calls['hangup'](_0x28d7d1);recordings[_0xd72c('0x1d')](_0x28d7d1);dials[_0xd72c('0x1d')](_0x28d7d1);agents[_0xd72c('0x1d')](_0x28d7d1);queues['hangup'](_0x28d7d1);}catch(_0x168697){utils[_0xd72c('0x10')](_0x168697);}});ami['on'](_0xd72c('0x1e'),function(_0x1badf7){try{members[_0xd72c('0x1e')](_0x1badf7);}catch(_0x1e9161){utils[_0xd72c('0x10')](_0x1e9161);}});ami['on'](_0xd72c('0x1f'),function(_0x288541){try{queues['blindtransfer'](_0x288541);agents[_0xd72c('0x1f')](_0x288541);transfers[_0xd72c('0x1f')](_0x288541);}catch(_0x5372d6){utils['error'](_0x5372d6);}});ami['on']('attendedtransfer',function(_0x256d7d){try{queues[_0xd72c('0x20')](_0x256d7d);transfers[_0xd72c('0x20')](_0x256d7d);agents[_0xd72c('0x20')](_0x256d7d);calls[_0xd72c('0x20')](_0x256d7d);}catch(_0x5e4042){utils['error'](_0x5e4042);}});ami['on']('varset',function(_0x318fcf){try{queues[_0xd72c('0x21')](_0x318fcf);recordings[_0xd72c('0x21')](_0x318fcf);calls['varset'](_0x318fcf);dials[_0xd72c('0x21')](_0x318fcf);}catch(_0xb06102){utils[_0xd72c('0x10')](_0xb06102);}});ami['on'](_0xd72c('0x22'),function(_0x57ed76){try{calls[_0xd72c('0x22')](_0x57ed76);recordings[_0xd72c('0x22')](_0x57ed76);dials[_0xd72c('0x22')](_0x57ed76);}catch(_0x1cf61c){utils[_0xd72c('0x10')](_0x1cf61c);}});ami['on']('newchannel',function(_0x522989){try{calls['newchannel'](_0x522989);recordings[_0xd72c('0x23')](_0x522989);}catch(_0x4e9925){utils['error'](_0x4e9925);}});ami['on'](_0xd72c('0x24'),function(_0x15409b){try{dials['dialbegin'](_0x15409b);}catch(_0x105f84){utils[_0xd72c('0x10')](_0x105f84);}});ami['on'](_0xd72c('0x25'),function(_0x549686){try{dials[_0xd72c('0x25')](_0x549686);}catch(_0x319aae){utils[_0xd72c('0x10')](_0x319aae);}});} \ No newline at end of file +var _0xe7c8=['agentcomplete','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','asterisk','password','keepConnected','xdr','info','./agents.controller','./calls.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect'];(function(_0x305a95,_0x3b5db7){var _0xdcebf3=function(_0x2296ea){while(--_0x2296ea){_0x305a95['push'](_0x305a95['shift']());}};_0xdcebf3(++_0x3b5db7);}(_0xe7c8,0x153));var _0x8e7c=function(_0x6e44a,_0x59d32e){_0x6e44a=_0x6e44a-0x0;var _0x60a105=_0xe7c8[_0x6e44a];return _0x60a105;};var AsteriskManager=require('asterisk-manager');var config=require(_0x8e7c('0x0'));var utils=require(_0x8e7c('0x1'));var ami=new AsteriskManager(config[_0x8e7c('0x2')]['port'],config[_0x8e7c('0x2')]['ip'],config['asterisk']['username'],config[_0x8e7c('0x2')][_0x8e7c('0x3')],!![]);ami[_0x8e7c('0x4')]();if(config[_0x8e7c('0x5')]&&config[_0x8e7c('0x5')]['disabled']){utils[_0x8e7c('0x6')]('XDR\x20DISABLED');}else{var agents=require(_0x8e7c('0x7'));var calls=require(_0x8e7c('0x8'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require(_0x8e7c('0x9'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0x8e7c('0xa'));ami['on'](_0x8e7c('0xb'),core['connect']);ami['on'](_0x8e7c('0xc'),core['shutdown']);ami['on'](_0x8e7c('0xd'),core['fullybooted']);ami['on']('error',core[_0x8e7c('0xe')]);ami['on'](_0x8e7c('0xf'),core['close']);ami['on']('managerevent',core[_0x8e7c('0x10')]);ami['on'](_0x8e7c('0x11'),function(_0x532414){try{members['devicestatechange'](_0x532414);}catch(_0xdc7083){utils[_0x8e7c('0xe')](_0xdc7083);}});ami['on'](_0x8e7c('0x12'),function(_0x27ae75){try{agents[_0x8e7c('0x12')](_0x27ae75);}catch(_0x5e6cc1){utils['error'](_0x5e6cc1);}});ami['on'](_0x8e7c('0x13'),function(_0x358e17){try{agents[_0x8e7c('0x13')](_0x358e17);}catch(_0x59b032){utils[_0x8e7c('0xe')](_0x59b032);}});ami['on'](_0x8e7c('0x14'),function(_0x4655e4){try{agents[_0x8e7c('0x14')](_0x4655e4);queues['agentconnect'](_0x4655e4);}catch(_0x4e03c8){utils[_0x8e7c('0xe')](_0x4e03c8);}});ami['on']('agentcomplete',function(_0xfde131){try{agents['agentcomplete'](_0xfde131);queues[_0x8e7c('0x15')](_0xfde131);members[_0x8e7c('0x15')](_0xfde131);}catch(_0x84f3df){utils[_0x8e7c('0xe')](_0x84f3df);}});ami['on']('queuecallerabandon',function(_0x3b7f0c){try{agents['queuecallerabandon'](_0x3b7f0c);queues['queuecallerabandon'](_0x3b7f0c);}catch(_0x2a4cd2){utils[_0x8e7c('0xe')](_0x2a4cd2);}});ami['on'](_0x8e7c('0x16'),function(_0x56d340){try{queues[_0x8e7c('0x16')](_0x56d340);recordings[_0x8e7c('0x16')](_0x56d340);}catch(_0x46a39e){utils[_0x8e7c('0xe')](_0x46a39e);}});ami['on'](_0x8e7c('0x17'),function(_0x59243e){try{queues[_0x8e7c('0x17')](_0x59243e);}catch(_0x151902){utils[_0x8e7c('0xe')](_0x151902);}});ami['on'](_0x8e7c('0x18'),function(_0x3800cf){try{queues[_0x8e7c('0x18')](_0x3800cf);calls[_0x8e7c('0x18')](_0x3800cf);}catch(_0x34c4f7){utils[_0x8e7c('0xe')](_0x34c4f7);}});ami['on'](_0x8e7c('0x19'),function(_0x376424){try{queues['musiconholdstop'](_0x376424);calls[_0x8e7c('0x19')](_0x376424);}catch(_0x46a81a){utils[_0x8e7c('0xe')](_0x46a81a);}});ami['on'](_0x8e7c('0x1a'),function(_0x263f2b){try{calls[_0x8e7c('0x1a')](_0x263f2b);recordings[_0x8e7c('0x1a')](_0x263f2b);}catch(_0x1dfce5){utils[_0x8e7c('0xe')](_0x1dfce5);}});ami['on'](_0x8e7c('0x1b'),function(_0x3f2c3e){try{calls[_0x8e7c('0x1b')](_0x3f2c3e);recordings[_0x8e7c('0x1b')](_0x3f2c3e);dials[_0x8e7c('0x1b')](_0x3f2c3e);agents[_0x8e7c('0x1b')](_0x3f2c3e);queues['hangup'](_0x3f2c3e);}catch(_0x221d5f){utils[_0x8e7c('0xe')](_0x221d5f);}});ami['on']('cdr',function(_0xda46f7){try{members[_0x8e7c('0x1c')](_0xda46f7);}catch(_0x59c535){utils[_0x8e7c('0xe')](_0x59c535);}});ami['on'](_0x8e7c('0x1d'),function(_0x67f5c3){try{queues[_0x8e7c('0x1d')](_0x67f5c3);agents[_0x8e7c('0x1d')](_0x67f5c3);transfers['blindtransfer'](_0x67f5c3);}catch(_0x3cd818){utils[_0x8e7c('0xe')](_0x3cd818);}});ami['on'](_0x8e7c('0x1e'),function(_0x39a5a3){try{queues[_0x8e7c('0x1e')](_0x39a5a3);transfers['attendedtransfer'](_0x39a5a3);agents[_0x8e7c('0x1e')](_0x39a5a3);calls[_0x8e7c('0x1e')](_0x39a5a3);}catch(_0x37b567){utils[_0x8e7c('0xe')](_0x37b567);}});ami['on'](_0x8e7c('0x1f'),function(_0x66ee25){try{queues[_0x8e7c('0x1f')](_0x66ee25);recordings[_0x8e7c('0x1f')](_0x66ee25);calls[_0x8e7c('0x1f')](_0x66ee25);dials[_0x8e7c('0x1f')](_0x66ee25);}catch(_0x571831){utils[_0x8e7c('0xe')](_0x571831);}});ami['on'](_0x8e7c('0x20'),function(_0x313fc6){try{calls[_0x8e7c('0x20')](_0x313fc6);recordings[_0x8e7c('0x20')](_0x313fc6);dials[_0x8e7c('0x20')](_0x313fc6);}catch(_0x4c6628){utils['error'](_0x4c6628);}});ami['on']('newchannel',function(_0x51f402){try{calls[_0x8e7c('0x21')](_0x51f402);recordings[_0x8e7c('0x21')](_0x51f402);}catch(_0x22935b){utils[_0x8e7c('0xe')](_0x22935b);}});ami['on'](_0x8e7c('0x22'),function(_0x208c2e){try{dials[_0x8e7c('0x22')](_0x208c2e);}catch(_0x3f61a8){utils[_0x8e7c('0xe')](_0x3f61a8);}});ami['on'](_0x8e7c('0x23'),function(_0x9ad246){try{dials[_0x8e7c('0x23')](_0x9ad246);}catch(_0xb45881){utils['error'](_0xb45881);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index c2a6575..7233582 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 _0x10c7=['CreateMemberReport','getUserByName','split','catch','startsWith','devicestatechange','state','INUSE','BUSY','device','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','queue','cdr','channel','assign','type','source','data3','destination','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','data2','membername','getUserByInterface','then','name','internal','request'];(function(_0x22fb11,_0x7919ef){var _0x126d26=function(_0x3499c8){while(--_0x3499c8){_0x22fb11['push'](_0x22fb11['shift']());}};_0x126d26(++_0x7919ef);}(_0x10c7,0x1c9));var _0x710c=function(_0x3522c8,_0x1e7c82){_0x3522c8=_0x3522c8-0x0;var _0x22f498=_0x10c7[_0x3522c8];return _0x22f498;};'use strict';var _=require(_0x710c('0x0'));var util=require(_0x710c('0x1'));var utils=require(_0x710c('0x2'));var members={};var exclude=[_0x710c('0x3'),_0x710c('0x4')];function writeDB(_0x501fc6){utils[_0x710c('0x5')](util['format'](_0x710c('0x6'),_0x501fc6[_0x710c('0x7')],_0x501fc6[_0x710c('0x8')],_0x501fc6['channel'],_0x501fc6[_0x710c('0x9')],_0x501fc6[_0x710c('0xa')],_0x501fc6['type']));if(_0x501fc6[_0x710c('0x8')]){utils[_0x710c('0xb')](_0x501fc6[_0x710c('0x8')])[_0x710c('0xc')](function(_0x36723e){if(_0x36723e){_0x501fc6[_0x710c('0xa')]=_0x36723e[_0x710c('0xd')];_0x501fc6[_0x710c('0xe')]=_0x36723e[_0x710c('0xe')];utils[_0x710c('0xf')](_0x710c('0x10'),_0x501fc6);}else{utils[_0x710c('0x11')](_0x501fc6['interface'][_0x710c('0x12')]('/')[0x1])[_0x710c('0xc')](function(_0x28432d){if(_0x28432d){_0x501fc6[_0x710c('0xa')]=_0x28432d[_0x710c('0xd')];_0x501fc6['internal']=_0x28432d[_0x710c('0xe')];utils['request']('CreateMemberReport',_0x501fc6);}});}})[_0x710c('0x13')](function(_0x4c8317){utils['error'](_0x4c8317);});}delete members[_0x501fc6[_0x710c('0x8')]];}function startsWith(_0x294af,_0x35fc51){return _['some'](_0x294af,function(_0x3ce4b4){return _[_0x710c('0x14')](_0x35fc51,_0x3ce4b4);});}exports[_0x710c('0x15')]=function(_0x3e7ab9){switch(_0x3e7ab9[_0x710c('0x16')]){case _0x710c('0x17'):case _0x710c('0x18'):if(!startsWith(exclude,_0x3e7ab9['device'])){members[_0x3e7ab9['device']]={'channel':'voice','interface':_0x3e7ab9[_0x710c('0x19')],'type':'TALKING','enterAt':utils[_0x710c('0x1a')](),'role':_0x710c('0x1b')};}break;case _0x710c('0x1c'):if(!_[_0x710c('0x1d')](members[_0x3e7ab9[_0x710c('0x19')]])){members[_0x3e7ab9['device']][_0x710c('0x1e')]=utils[_0x710c('0x1a')]();members[_0x3e7ab9[_0x710c('0x19')]]['duration']=utils[_0x710c('0x1f')](members[_0x3e7ab9['device']][_0x710c('0x1e')],members[_0x3e7ab9[_0x710c('0x19')]][_0x710c('0x20')]);if(members[_0x3e7ab9[_0x710c('0x19')]]['uniqueid']){writeDB(members[_0x3e7ab9['device']]);}}default:break;}};exports[_0x710c('0x21')]=function(_0x18536c){if(!_['isNil'](members[_0x18536c['interface']])){members[_0x18536c[_0x710c('0x8')]]=_['assign'](members[_0x18536c[_0x710c('0x8')]],{'data4':_0x18536c[_0x710c('0x22')],'uniqueid':_0x18536c['uniqueid']});}};exports[_0x710c('0x23')]=function(_0x36d646){if(_0x36d646['channel']){var _0x5303a0=_0x36d646[_0x710c('0x24')][_0x710c('0x12')]('-')[0x0];if(!_['isNil'](members[_0x5303a0])){members[_0x5303a0]=_[_0x710c('0x25')](members[_0x5303a0],{'data1':members[_0x5303a0]['data1']||_0x36d646[_0x710c('0x26')],'data2':members[_0x5303a0][_0x710c('0x9')]||_0x36d646[_0x710c('0x27')],'data3':members[_0x5303a0][_0x710c('0x28')]||_0x36d646[_0x710c('0x29')],'uniqueid':members[_0x5303a0][_0x710c('0x7')]||_0x36d646['uniqueid']});if(members[_0x5303a0]['exitAt']){writeDB(members[_0x5303a0]);}}}if(_0x36d646['destinationchannel']){var _0x1ced4f=_0x36d646[_0x710c('0x2a')][_0x710c('0x12')]('-')[0x0];if(!_[_0x710c('0x1d')](members[_0x1ced4f])){members[_0x1ced4f]=_[_0x710c('0x25')](members[_0x1ced4f],{'data1':members[_0x1ced4f]['data1']||_0x36d646[_0x710c('0x26')],'data2':members[_0x1ced4f][_0x710c('0x9')]||_0x36d646['source'],'data3':members[_0x1ced4f][_0x710c('0x28')]||_0x36d646[_0x710c('0x29')],'uniqueid':members[_0x1ced4f][_0x710c('0x7')]||_0x36d646['uniqueid']});if(members[_0x1ced4f][_0x710c('0x1e')]){writeDB(members[_0x1ced4f]);}}}}; \ No newline at end of file +var _0xdc5f=['Queue:','format','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','some','startsWith','devicestatechange','state','INUSE','BUSY','device','now','agent','NOT_INUSE','isNil','duration','diffTime','exitAt','agentcomplete','assign','cdr','data1','data3','lodash','./utils','Local/_attended@transfer'];(function(_0x240eee,_0x249118){var _0x411632=function(_0x99d99f){while(--_0x99d99f){_0x240eee['push'](_0x240eee['shift']());}};_0x411632(++_0x249118);}(_0xdc5f,0x9d));var _0xfdc5=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xdc5f[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0xfdc5('0x0'));var util=require('util');var utils=require(_0xfdc5('0x1'));var members={};var exclude=[_0xfdc5('0x2'),_0xfdc5('0x3')];function writeDB(_0x489942){utils['info'](util[_0xfdc5('0x4')]('MEMBER|%s|%s|%s|%s|%s|%s',_0x489942[_0xfdc5('0x5')],_0x489942[_0xfdc5('0x6')],_0x489942[_0xfdc5('0x7')],_0x489942[_0xfdc5('0x8')],_0x489942[_0xfdc5('0x9')],_0x489942[_0xfdc5('0xa')]));if(_0x489942[_0xfdc5('0x6')]){utils[_0xfdc5('0xb')](_0x489942['interface'])['then'](function(_0x246077){if(_0x246077){_0x489942[_0xfdc5('0x9')]=_0x246077[_0xfdc5('0xc')];_0x489942[_0xfdc5('0xd')]=_0x246077[_0xfdc5('0xd')];utils[_0xfdc5('0xe')](_0xfdc5('0xf'),_0x489942);}else{utils[_0xfdc5('0x10')](_0x489942[_0xfdc5('0x6')][_0xfdc5('0x11')]('/')[0x1])[_0xfdc5('0x12')](function(_0x2b5180){if(_0x2b5180){_0x489942[_0xfdc5('0x9')]=_0x2b5180[_0xfdc5('0xc')];_0x489942[_0xfdc5('0xd')]=_0x2b5180[_0xfdc5('0xd')];utils[_0xfdc5('0xe')](_0xfdc5('0xf'),_0x489942);}});}})[_0xfdc5('0x13')](function(_0x490bba){utils[_0xfdc5('0x14')](_0x490bba);});}delete members[_0x489942['interface']];}function startsWith(_0x1efb10,_0x3106ea){return _[_0xfdc5('0x15')](_0x1efb10,function(_0x5a931e){return _[_0xfdc5('0x16')](_0x3106ea,_0x5a931e);});}exports[_0xfdc5('0x17')]=function(_0x354197){switch(_0x354197[_0xfdc5('0x18')]){case _0xfdc5('0x19'):case _0xfdc5('0x1a'):if(!startsWith(exclude,_0x354197[_0xfdc5('0x1b')])){members[_0x354197[_0xfdc5('0x1b')]]={'channel':'voice','interface':_0x354197[_0xfdc5('0x1b')],'type':'TALKING','enterAt':utils[_0xfdc5('0x1c')](),'role':_0xfdc5('0x1d')};}break;case _0xfdc5('0x1e'):if(!_[_0xfdc5('0x1f')](members[_0x354197[_0xfdc5('0x1b')]])){members[_0x354197[_0xfdc5('0x1b')]]['exitAt']=utils[_0xfdc5('0x1c')]();members[_0x354197['device']][_0xfdc5('0x20')]=utils[_0xfdc5('0x21')](members[_0x354197[_0xfdc5('0x1b')]][_0xfdc5('0x22')],members[_0x354197[_0xfdc5('0x1b')]]['enterAt']);if(members[_0x354197[_0xfdc5('0x1b')]][_0xfdc5('0x5')]){writeDB(members[_0x354197['device']]);}}default:break;}};exports[_0xfdc5('0x23')]=function(_0x162ac2){if(!_[_0xfdc5('0x1f')](members[_0x162ac2['interface']])){members[_0x162ac2[_0xfdc5('0x6')]]=_[_0xfdc5('0x24')](members[_0x162ac2[_0xfdc5('0x6')]],{'data4':_0x162ac2['queue'],'uniqueid':_0x162ac2['uniqueid']});}};exports[_0xfdc5('0x25')]=function(_0x296079){if(_0x296079[_0xfdc5('0x7')]){var _0x36e589=_0x296079[_0xfdc5('0x7')][_0xfdc5('0x11')]('-')[0x0];if(!_[_0xfdc5('0x1f')](members[_0x36e589])){members[_0x36e589]=_[_0xfdc5('0x24')](members[_0x36e589],{'data1':members[_0x36e589][_0xfdc5('0x26')]||_0x296079[_0xfdc5('0xa')],'data2':members[_0x36e589][_0xfdc5('0x8')]||_0x296079['source'],'data3':members[_0x36e589]['data3']||_0x296079['destination'],'uniqueid':members[_0x36e589][_0xfdc5('0x5')]||_0x296079[_0xfdc5('0x5')]});if(members[_0x36e589][_0xfdc5('0x22')]){writeDB(members[_0x36e589]);}}}if(_0x296079['destinationchannel']){var _0x593c56=_0x296079['destinationchannel']['split']('-')[0x0];if(!_[_0xfdc5('0x1f')](members[_0x593c56])){members[_0x593c56]=_['assign'](members[_0x593c56],{'data1':members[_0x593c56][_0xfdc5('0x26')]||_0x296079[_0xfdc5('0xa')],'data2':members[_0x593c56]['data2']||_0x296079['source'],'data3':members[_0x593c56][_0xfdc5('0x27')]||_0x296079['destination'],'uniqueid':members[_0x593c56][_0xfdc5('0x5')]||_0x296079['uniqueid']});if(members[_0x593c56][_0xfdc5('0x22')]){writeDB(members[_0x593c56]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index db28bd8..d59d37b 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 _0x7a05=['getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','position','now','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','value','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','assigned','membername','agentcomplete','reason','blindtransfer','transfereeuniqueid','transfer','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','origtransfereruniqueid','transfereelinkedid','clone','queuecallerenterreason','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','calleridname','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason'];(function(_0x11f0e3,_0x5170bc){var _0x2892e8=function(_0x3292b2){while(--_0x3292b2){_0x11f0e3['push'](_0x11f0e3['shift']());}};_0x2892e8(++_0x5170bc);}(_0x7a05,0x1cf));var _0x57a0=function(_0x4735fe,_0x227ea4){_0x4735fe=_0x4735fe-0x0;var _0x1c4be4=_0x7a05[_0x4735fe];return _0x1c4be4;};'use strict';var _=require(_0x57a0('0x0'));var util=require('util');var utils=require(_0x57a0('0x1'));var queues={};function writeDB(_0x2f072f){utils[_0x57a0('0x2')](util[_0x57a0('0x3')](_0x57a0('0x4'),_0x2f072f['uniqueid'],_0x2f072f[_0x57a0('0x5')],_0x2f072f[_0x57a0('0x6')],_0x2f072f[_0x57a0('0x7')],_0x2f072f[_0x57a0('0x8')],_0x2f072f[_0x57a0('0x9')],_0x2f072f[_0x57a0('0xa')]));if(_0x2f072f['queue']){utils[_0x57a0('0xb')](_0x2f072f['queue'])[_0x57a0('0xc')](function(_0x597f68){if(_0x597f68){_0x2f072f['type']=_0x597f68[_0x57a0('0xd')];}utils[_0x57a0('0xe')](_0x57a0('0xf'),_0x2f072f);});}else{utils[_0x57a0('0xe')](_0x57a0('0xf'),_0x2f072f);}if(_0x2f072f[_0x57a0('0x10')]){delete queues[_0x2f072f[_0x57a0('0x10')]];}else{delete queues[_0x2f072f[_0x57a0('0x11')]];}}exports[_0x57a0('0x12')]=function(_0x24da43){queues[_0x24da43[_0x57a0('0x11')]]=_['assign'](_0x24da43,{'originalposition':_0x24da43[_0x57a0('0x13')],'queuecallerjoinAt':utils[_0x57a0('0x14')](),'mohtime':0x0});};exports['hangup']=function(_0x11f880){if(!_[_0x57a0('0x15')](queues[_0x11f880['uniqueid']])){if(queues[_0x11f880[_0x57a0('0x11')]]['queuecallerleaveAt']){if(!queues[_0x11f880[_0x57a0('0x11')]][_0x57a0('0x16')]&&!queues[_0x11f880[_0x57a0('0x11')]][_0x57a0('0x17')]){queues[_0x11f880[_0x57a0('0x11')]][_0x57a0('0x18')]=!![];queues[_0x11f880['uniqueid']][_0x57a0('0x19')]=utils['now']();queues[_0x11f880[_0x57a0('0x11')]][_0x57a0('0xa')]=_0x57a0('0x1a');}writeDB(queues[_0x11f880['uniqueid']]);}else{if(queues[_0x11f880[_0x57a0('0x11')]][_0x57a0('0x10')]){queues[queues[_0x11f880[_0x57a0('0x11')]]['transfereduniqueid']]=queues[_0x11f880[_0x57a0('0x11')]];queues[queues[_0x11f880['uniqueid']]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x11f880[_0x57a0('0x11')]];}}}};exports[_0x57a0('0x1b')]=function(_0x2937b2){if(!_[_0x57a0('0x15')](_0x2937b2[_0x57a0('0x1c')][_0x57a0('0x1d')])&&_0x2937b2['value'][_0x57a0('0x1e')]()!==_0x57a0('0x1f')){if(!_[_0x57a0('0x15')](queues[_0x2937b2[_0x57a0('0x11')]])){queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0x16')]=![];queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0x20')]=null;queues[_0x2937b2[_0x57a0('0x11')]]['queuecallerexit']=!![];queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0x21')]=utils[_0x57a0('0x14')]();queues[_0x2937b2[_0x57a0('0x11')]]['queuecallerexitreason']=_0x2937b2[_0x57a0('0x22')][_0x57a0('0x1e')]();writeDB(queues[_0x2937b2[_0x57a0('0x11')]]);}}else if(!_['isNil'](_0x2937b2['variable'][_0x57a0('0x23')])){if(!_[_0x57a0('0x15')](queues[_0x2937b2[_0x57a0('0x11')]])&&!queues[_0x2937b2['uniqueid']][_0x57a0('0x16')]){queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0x16')]=![];queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0x20')]=null;queues[_0x2937b2[_0x57a0('0x11')]]['queuecallerexit']=!![];queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0x21')]=utils[_0x57a0('0x14')]();queues[_0x2937b2[_0x57a0('0x11')]][_0x57a0('0xa')]=_0x57a0('0x24');}}};exports[_0x57a0('0x16')]=function(_0x1cee79){if(!_[_0x57a0('0x15')](queues[_0x1cee79['uniqueid']])){queues[_0x1cee79[_0x57a0('0x11')]][_0x57a0('0x17')]=![];queues[_0x1cee79['uniqueid']]['queuecallerexitAt']=null;queues[_0x1cee79[_0x57a0('0x11')]][_0x57a0('0x16')]=!![];queues[_0x1cee79['uniqueid']][_0x57a0('0x20')]=utils[_0x57a0('0x14')]();queues[_0x1cee79[_0x57a0('0x11')]]['queuecallerexitreason']=_0x57a0('0x25');}};exports[_0x57a0('0x26')]=function(_0x347113){if(!_[_0x57a0('0x15')](queues[_0x347113['uniqueid']])){queues[_0x347113[_0x57a0('0x11')]][_0x57a0('0x26')]=!![];queues[_0x347113[_0x57a0('0x11')]][_0x57a0('0x27')]=utils[_0x57a0('0x14')]();queues[_0x347113[_0x57a0('0x11')]][_0x57a0('0x28')]=utils[_0x57a0('0x29')](queues[_0x347113['uniqueid']]['queuecallerleaveAt'],queues[_0x347113[_0x57a0('0x11')]][_0x57a0('0x2a')]);queues[_0x347113['uniqueid']][_0x57a0('0x13')]=_0x347113[_0x57a0('0x13')];queues[_0x347113[_0x57a0('0x11')]][_0x57a0('0x2b')]=_0x347113[_0x57a0('0x2b')];queues[_0x347113[_0x57a0('0x11')]][_0x57a0('0x2c')]=_0x347113[_0x57a0('0x2c')];queues[_0x347113['uniqueid']][_0x57a0('0x2d')]=_0x347113[_0x57a0('0x2d')];}};exports['agentconnect']=function(_0x5333b0){if(!_[_0x57a0('0x15')](queues[_0x5333b0[_0x57a0('0x11')]])){queues[_0x5333b0['uniqueid']][_0x57a0('0x16')]=![];queues[_0x5333b0['uniqueid']][_0x57a0('0x16')]=![];queues[_0x5333b0[_0x57a0('0x11')]][_0x57a0('0x20')]=null;queues[_0x5333b0[_0x57a0('0x11')]][_0x57a0('0x17')]=![];queues[_0x5333b0[_0x57a0('0x11')]][_0x57a0('0xa')]=null;queues[_0x5333b0[_0x57a0('0x11')]][_0x57a0('0x21')]=null;queues[_0x5333b0['uniqueid']][_0x57a0('0x2e')]=!![];queues[_0x5333b0['uniqueid']][_0x57a0('0x9')]=_0x5333b0['destaccountcode'];queues[_0x5333b0[_0x57a0('0x11')]][_0x57a0('0x7')]=_0x5333b0[_0x57a0('0x2f')];}};exports[_0x57a0('0x30')]=function(_0x2077e2){if(!_[_0x57a0('0x15')](queues[_0x2077e2[_0x57a0('0x11')]])){if(queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x27')]){queues[_0x2077e2['uniqueid']][_0x57a0('0x16')]=![];queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x16')]=![];queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x20')]=null;queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x17')]=![];queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x21')]=null;queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x2e')]=!![];queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x7')]=_0x2077e2['membername'];queues[_0x2077e2[_0x57a0('0x11')]]['queuecallercomplete']=!![];queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0x19')]=utils['now']();if(_0x2077e2[_0x57a0('0x31')]=='transfer'){if(!queues[_0x2077e2['uniqueid']]['transfer']){queues[_0x2077e2[_0x57a0('0x11')]][_0x57a0('0xa')]='TRANSFER';}}else{queues[_0x2077e2['uniqueid']][_0x57a0('0xa')]='COMPLETEDBY'+_0x2077e2[_0x57a0('0x31')]['toUpperCase']();}writeDB(queues[_0x2077e2[_0x57a0('0x11')]]);}}};exports[_0x57a0('0x32')]=function(_0x216bd6){if(!_['isNil'](queues[_0x216bd6['transfereeuniqueid']])){queues[_0x216bd6[_0x57a0('0x33')]][_0x57a0('0x34')]=!![];queues[_0x216bd6['transfereeuniqueid']][_0x57a0('0x35')]=_0x57a0('0x36');queues[_0x216bd6[_0x57a0('0x33')]][_0x57a0('0x37')]=_0x216bd6[_0x57a0('0x38')];queues[_0x216bd6['transfereeuniqueid']]['transferuniqueid']=_0x216bd6[_0x57a0('0x33')];queues[_0x216bd6[_0x57a0('0x33')]][_0x57a0('0xa')]=_0x57a0('0x39');}};exports[_0x57a0('0x3a')]=function(_0x190484){try{if(_0x190484['origtransfereruniqueid']==_0x190484[_0x57a0('0x3b')]){if(!_[_0x57a0('0x15')](queues[_0x190484[_0x57a0('0x3c')]])){queues[_0x190484[_0x57a0('0x3c')]][_0x57a0('0x34')]=!![];queues[_0x190484['secondtransfererlinkedid']][_0x57a0('0x35')]=_0x57a0('0x3d');queues[_0x190484[_0x57a0('0x3c')]]['transferexten']=_0x190484[_0x57a0('0x3e')];queues[_0x190484[_0x57a0('0x3c')]][_0x57a0('0x3f')]=_0x190484[_0x57a0('0x40')];queues[_0x190484[_0x57a0('0x3c')]][_0x57a0('0xa')]='ATTENDEDTRANSFER';}if(!_[_0x57a0('0x15')](queues[_0x190484[_0x57a0('0x3b')]])){if(_0x190484[_0x57a0('0x41')]&&queues[_0x190484[_0x57a0('0x41')]]){queues[_0x190484['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x190484[_0x57a0('0x33')]]=_[_0x57a0('0x42')](queues[_0x190484[_0x57a0('0x41')]]);queues[_0x190484[_0x57a0('0x33')]][_0x57a0('0x10')]=_0x190484['transfertargetuniqueid'];queues[_0x190484[_0x57a0('0x33')]][_0x57a0('0x43')]=0x2;queues[_0x190484[_0x57a0('0x33')]]['calleridnum']=queues[_0x190484[_0x57a0('0x3c')]][_0x57a0('0x8')];queues[_0x190484[_0x57a0('0x33')]]['calleridname']=queues[_0x190484[_0x57a0('0x3c')]]['calleridname'];queues[_0x190484[_0x57a0('0x33')]]['queuecallerjoinAt']=utils[_0x57a0('0x14')]();queues[_0x190484[_0x57a0('0x33')]][_0x57a0('0x27')]=utils[_0x57a0('0x14')]();queues[_0x190484[_0x57a0('0x33')]][_0x57a0('0x28')]=0x0;queues[_0x190484['transfereeuniqueid']][_0x57a0('0x44')]=0x0;}else{queues[_0x190484[_0x57a0('0x3b')]][_0x57a0('0x10')]=_0x190484[_0x57a0('0x3c')];}}}else if(_0x190484[_0x57a0('0x45')]==_0x190484[_0x57a0('0x3c')]){if(!_[_0x57a0('0x15')](queues[_0x190484['origtransfererlinkedid']])){queues[_0x190484[_0x57a0('0x3b')]]['transfer']=!![];queues[_0x190484[_0x57a0('0x3b')]]['transfertype']=_0x57a0('0x3d');queues[_0x190484[_0x57a0('0x3b')]][_0x57a0('0x37')]=_0x190484[_0x57a0('0x46')];queues[_0x190484[_0x57a0('0x3b')]][_0x57a0('0x3f')]=_0x190484[_0x57a0('0x45')];queues[_0x190484[_0x57a0('0x3b')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_[_0x57a0('0x15')](queues[_0x190484[_0x57a0('0x3c')]])){if(_0x190484[_0x57a0('0x47')]&&queues[_0x190484[_0x57a0('0x47')]]){queues[_0x190484[_0x57a0('0x47')]][_0x57a0('0x43')]=0x1;queues[_0x190484[_0x57a0('0x48')]]=_[_0x57a0('0x42')](queues[_0x190484[_0x57a0('0x47')]]);queues[_0x190484['transfertargetuniqueid']][_0x57a0('0x10')]=_0x190484[_0x57a0('0x48')];queues[_0x190484['transfertargetuniqueid']][_0x57a0('0x43')]=0x2;queues[_0x190484[_0x57a0('0x48')]][_0x57a0('0x8')]=queues[_0x190484[_0x57a0('0x3b')]][_0x57a0('0x8')];queues[_0x190484[_0x57a0('0x48')]][_0x57a0('0x49')]=queues[_0x190484[_0x57a0('0x3b')]][_0x57a0('0x49')];queues[_0x190484[_0x57a0('0x48')]][_0x57a0('0x2a')]=utils[_0x57a0('0x14')]();queues[_0x190484[_0x57a0('0x48')]][_0x57a0('0x27')]=utils[_0x57a0('0x14')]();queues[_0x190484[_0x57a0('0x48')]]['holdtime']=0x0;queues[_0x190484[_0x57a0('0x48')]][_0x57a0('0x44')]=0x0;}else{queues[_0x190484[_0x57a0('0x3c')]][_0x57a0('0x10')]=_0x190484[_0x57a0('0x3b')];}}}}catch(_0xd6284a){utils[_0x57a0('0x4a')](_0xd6284a[_0x57a0('0x4b')]);}};exports[_0x57a0('0x4c')]=function(_0xa7e723){if(!_['isNil'](queues[_0xa7e723[_0x57a0('0x11')]])){queues[_0xa7e723[_0x57a0('0x11')]][_0x57a0('0x4d')]=utils[_0x57a0('0x14')]();}};exports[_0x57a0('0x4e')]=function(_0x5f4614){if(!_[_0x57a0('0x15')](queues[_0x5f4614[_0x57a0('0x11')]])){if(!_[_0x57a0('0x15')](queues[_0x5f4614[_0x57a0('0x11')]]['musiconholdstartAt'])){queues[_0x5f4614[_0x57a0('0x11')]][_0x57a0('0x44')]+=utils[_0x57a0('0x29')](utils[_0x57a0('0x14')](),queues[_0x5f4614[_0x57a0('0x11')]]['musiconholdstartAt']);delete queues[_0x5f4614[_0x57a0('0x11')]][_0x57a0('0x4d')];}}}; \ No newline at end of file +var _0xa63c=['connectedlinenum','connectedlinename','agentconnect','assigned','accountcode','destaccountcode','lastAssignedTo','membername','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','mohtime','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','calleridname','queuecallerjoinAt','error','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','util','./utils','uniqueid','channel','queue','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','isNil','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','varset','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','variable','queueposition','EXITWITHKEY','ABANDONED','queuecallerleaveAt','holdtime','diffTime','count'];(function(_0x4b5986,_0x4eba46){var _0x864a63=function(_0x15288a){while(--_0x15288a){_0x4b5986['push'](_0x4b5986['shift']());}};_0x864a63(++_0x4eba46);}(_0xa63c,0xbf));var _0xca63=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xa63c[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xca63('0x0'));var util=require(_0xca63('0x1'));var utils=require(_0xca63('0x2'));var queues={};function writeDB(_0x2b568b){utils['info'](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x2b568b[_0xca63('0x3')],_0x2b568b[_0xca63('0x4')],_0x2b568b[_0xca63('0x5')],_0x2b568b['lastAssignedTo'],_0x2b568b[_0xca63('0x6')],_0x2b568b['accountcode'],_0x2b568b[_0xca63('0x7')]));if(_0x2b568b['queue']){utils[_0xca63('0x8')](_0x2b568b[_0xca63('0x5')])['then'](function(_0x125d42){if(_0x125d42){_0x2b568b[_0xca63('0x9')]=_0x125d42[_0xca63('0x9')];}utils[_0xca63('0xa')](_0xca63('0xb'),_0x2b568b);});}else{utils[_0xca63('0xa')](_0xca63('0xb'),_0x2b568b);}if(_0x2b568b[_0xca63('0xc')]){delete queues[_0x2b568b[_0xca63('0xc')]];}else{delete queues[_0x2b568b['uniqueid']];}}exports[_0xca63('0xd')]=function(_0x8329f4){queues[_0x8329f4[_0xca63('0x3')]]=_[_0xca63('0xe')](_0x8329f4,{'originalposition':_0x8329f4[_0xca63('0xf')],'queuecallerjoinAt':utils[_0xca63('0x10')](),'mohtime':0x0});};exports['hangup']=function(_0x41cf7e){if(!_[_0xca63('0x11')](queues[_0x41cf7e['uniqueid']])){if(queues[_0x41cf7e[_0xca63('0x3')]]['queuecallerleaveAt']){if(!queues[_0x41cf7e[_0xca63('0x3')]][_0xca63('0x12')]&&!queues[_0x41cf7e['uniqueid']]['queuecallerexit']){queues[_0x41cf7e[_0xca63('0x3')]][_0xca63('0x13')]=!![];queues[_0x41cf7e['uniqueid']][_0xca63('0x14')]=utils[_0xca63('0x10')]();queues[_0x41cf7e[_0xca63('0x3')]][_0xca63('0x7')]=_0xca63('0x15');}writeDB(queues[_0x41cf7e[_0xca63('0x3')]]);}else{if(queues[_0x41cf7e[_0xca63('0x3')]][_0xca63('0xc')]){queues[queues[_0x41cf7e[_0xca63('0x3')]][_0xca63('0xc')]]=queues[_0x41cf7e[_0xca63('0x3')]];queues[queues[_0x41cf7e[_0xca63('0x3')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x41cf7e[_0xca63('0x3')]];}}}};exports[_0xca63('0x16')]=function(_0x2e1f9c){if(!_[_0xca63('0x11')](_0x2e1f9c['variable'][_0xca63('0x17')])&&_0x2e1f9c['value'][_0xca63('0x18')]()!==_0xca63('0x19')){if(!_[_0xca63('0x11')](queues[_0x2e1f9c['uniqueid']])){queues[_0x2e1f9c['uniqueid']][_0xca63('0x12')]=![];queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x1a')]=null;queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x1b')]=!![];queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x1c')]=utils['now']();queues[_0x2e1f9c['uniqueid']]['queuecallerexitreason']=_0x2e1f9c['value']['toUpperCase']();writeDB(queues[_0x2e1f9c[_0xca63('0x3')]]);}}else if(!_[_0xca63('0x11')](_0x2e1f9c[_0xca63('0x1d')][_0xca63('0x1e')])){if(!_['isNil'](queues[_0x2e1f9c[_0xca63('0x3')]])&&!queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x12')]){queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x12')]=![];queues[_0x2e1f9c['uniqueid']][_0xca63('0x1a')]=null;queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x1b')]=!![];queues[_0x2e1f9c[_0xca63('0x3')]]['queuecallerexitAt']=utils[_0xca63('0x10')]();queues[_0x2e1f9c[_0xca63('0x3')]][_0xca63('0x7')]=_0xca63('0x1f');}}};exports[_0xca63('0x12')]=function(_0x426e3c){if(!_[_0xca63('0x11')](queues[_0x426e3c[_0xca63('0x3')]])){queues[_0x426e3c['uniqueid']][_0xca63('0x1b')]=![];queues[_0x426e3c[_0xca63('0x3')]][_0xca63('0x1c')]=null;queues[_0x426e3c[_0xca63('0x3')]][_0xca63('0x12')]=!![];queues[_0x426e3c['uniqueid']][_0xca63('0x1a')]=utils[_0xca63('0x10')]();queues[_0x426e3c[_0xca63('0x3')]][_0xca63('0x7')]=_0xca63('0x20');}};exports['queuecallerleave']=function(_0x248c58){if(!_['isNil'](queues[_0x248c58[_0xca63('0x3')]])){queues[_0x248c58[_0xca63('0x3')]]['queuecallerleave']=!![];queues[_0x248c58[_0xca63('0x3')]][_0xca63('0x21')]=utils[_0xca63('0x10')]();queues[_0x248c58[_0xca63('0x3')]][_0xca63('0x22')]=utils[_0xca63('0x23')](queues[_0x248c58[_0xca63('0x3')]][_0xca63('0x21')],queues[_0x248c58['uniqueid']]['queuecallerjoinAt']);queues[_0x248c58[_0xca63('0x3')]]['position']=_0x248c58[_0xca63('0xf')];queues[_0x248c58['uniqueid']][_0xca63('0x24')]=_0x248c58[_0xca63('0x24')];queues[_0x248c58[_0xca63('0x3')]][_0xca63('0x25')]=_0x248c58['connectedlinenum'];queues[_0x248c58[_0xca63('0x3')]]['connectedlinename']=_0x248c58[_0xca63('0x26')];}};exports[_0xca63('0x27')]=function(_0x528ea9){if(!_[_0xca63('0x11')](queues[_0x528ea9[_0xca63('0x3')]])){queues[_0x528ea9[_0xca63('0x3')]]['queuecallerabandon']=![];queues[_0x528ea9['uniqueid']][_0xca63('0x12')]=![];queues[_0x528ea9[_0xca63('0x3')]]['queuecallerabandonAt']=null;queues[_0x528ea9[_0xca63('0x3')]][_0xca63('0x1b')]=![];queues[_0x528ea9[_0xca63('0x3')]][_0xca63('0x7')]=null;queues[_0x528ea9[_0xca63('0x3')]]['queuecallerexitAt']=null;queues[_0x528ea9[_0xca63('0x3')]][_0xca63('0x28')]=!![];queues[_0x528ea9['uniqueid']][_0xca63('0x29')]=_0x528ea9[_0xca63('0x2a')];queues[_0x528ea9['uniqueid']][_0xca63('0x2b')]=_0x528ea9[_0xca63('0x2c')];}};exports['agentcomplete']=function(_0x172805){if(!_[_0xca63('0x11')](queues[_0x172805[_0xca63('0x3')]])){if(queues[_0x172805[_0xca63('0x3')]][_0xca63('0x21')]){queues[_0x172805[_0xca63('0x3')]][_0xca63('0x12')]=![];queues[_0x172805['uniqueid']][_0xca63('0x12')]=![];queues[_0x172805['uniqueid']][_0xca63('0x1a')]=null;queues[_0x172805[_0xca63('0x3')]][_0xca63('0x1b')]=![];queues[_0x172805[_0xca63('0x3')]]['queuecallerexitAt']=null;queues[_0x172805[_0xca63('0x3')]]['assigned']=!![];queues[_0x172805[_0xca63('0x3')]][_0xca63('0x2b')]=_0x172805[_0xca63('0x2c')];queues[_0x172805['uniqueid']][_0xca63('0x13')]=!![];queues[_0x172805[_0xca63('0x3')]][_0xca63('0x14')]=utils[_0xca63('0x10')]();if(_0x172805[_0xca63('0x2d')]==_0xca63('0x2e')){if(!queues[_0x172805[_0xca63('0x3')]][_0xca63('0x2e')]){queues[_0x172805[_0xca63('0x3')]][_0xca63('0x7')]='TRANSFER';}}else{queues[_0x172805['uniqueid']][_0xca63('0x7')]=_0xca63('0x2f')+_0x172805[_0xca63('0x2d')]['toUpperCase']();}writeDB(queues[_0x172805[_0xca63('0x3')]]);}}};exports[_0xca63('0x30')]=function(_0x5431d7){if(!_[_0xca63('0x11')](queues[_0x5431d7[_0xca63('0x31')]])){queues[_0x5431d7[_0xca63('0x31')]][_0xca63('0x2e')]=!![];queues[_0x5431d7[_0xca63('0x31')]][_0xca63('0x32')]=_0xca63('0x33');queues[_0x5431d7[_0xca63('0x31')]][_0xca63('0x34')]=_0x5431d7[_0xca63('0x35')];queues[_0x5431d7[_0xca63('0x31')]]['transferuniqueid']=_0x5431d7['transfereeuniqueid'];queues[_0x5431d7['transfereeuniqueid']][_0xca63('0x7')]=_0xca63('0x36');}};exports['attendedtransfer']=function(_0x20455f){try{if(_0x20455f[_0xca63('0x37')]==_0x20455f[_0xca63('0x38')]){if(!_[_0xca63('0x11')](queues[_0x20455f['secondtransfererlinkedid']])){queues[_0x20455f[_0xca63('0x39')]][_0xca63('0x2e')]=!![];queues[_0x20455f['secondtransfererlinkedid']][_0xca63('0x32')]=_0xca63('0x3a');queues[_0x20455f[_0xca63('0x39')]][_0xca63('0x34')]=_0x20455f[_0xca63('0x3b')];queues[_0x20455f[_0xca63('0x39')]][_0xca63('0x3c')]=_0x20455f[_0xca63('0x37')];queues[_0x20455f[_0xca63('0x39')]]['queuecallerexitreason']=_0xca63('0x3d');}if(!_[_0xca63('0x11')](queues[_0x20455f[_0xca63('0x38')]])){if(_0x20455f[_0xca63('0x3e')]&&queues[_0x20455f[_0xca63('0x3e')]]){queues[_0x20455f[_0xca63('0x3e')]][_0xca63('0x3f')]=0x1;queues[_0x20455f['transfereeuniqueid']]=_[_0xca63('0x40')](queues[_0x20455f['transfereelinkedid']]);queues[_0x20455f[_0xca63('0x31')]][_0xca63('0xc')]=_0x20455f[_0xca63('0x41')];queues[_0x20455f[_0xca63('0x31')]][_0xca63('0x3f')]=0x2;queues[_0x20455f[_0xca63('0x31')]][_0xca63('0x6')]=queues[_0x20455f[_0xca63('0x39')]][_0xca63('0x6')];queues[_0x20455f['transfereeuniqueid']]['calleridname']=queues[_0x20455f['secondtransfererlinkedid']]['calleridname'];queues[_0x20455f[_0xca63('0x31')]]['queuecallerjoinAt']=utils[_0xca63('0x10')]();queues[_0x20455f['transfereeuniqueid']]['queuecallerleaveAt']=utils['now']();queues[_0x20455f[_0xca63('0x31')]][_0xca63('0x22')]=0x0;queues[_0x20455f[_0xca63('0x31')]][_0xca63('0x42')]=0x0;}else{queues[_0x20455f[_0xca63('0x38')]]['transfereduniqueid']=_0x20455f[_0xca63('0x39')];}}}else if(_0x20455f['secondtransfereruniqueid']==_0x20455f[_0xca63('0x39')]){if(!_[_0xca63('0x11')](queues[_0x20455f[_0xca63('0x38')]])){queues[_0x20455f[_0xca63('0x38')]][_0xca63('0x2e')]=!![];queues[_0x20455f[_0xca63('0x38')]][_0xca63('0x32')]='ATTENDED';queues[_0x20455f[_0xca63('0x38')]][_0xca63('0x34')]=_0x20455f[_0xca63('0x43')];queues[_0x20455f[_0xca63('0x38')]]['transferuniqueid']=_0x20455f[_0xca63('0x44')];queues[_0x20455f[_0xca63('0x38')]][_0xca63('0x7')]=_0xca63('0x3d');}if(!_[_0xca63('0x11')](queues[_0x20455f[_0xca63('0x39')]])){if(_0x20455f[_0xca63('0x45')]&&queues[_0x20455f[_0xca63('0x45')]]){queues[_0x20455f['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0x20455f[_0xca63('0x41')]]=_[_0xca63('0x40')](queues[_0x20455f['transfertargetlinkedid']]);queues[_0x20455f[_0xca63('0x41')]]['transfereduniqueid']=_0x20455f[_0xca63('0x41')];queues[_0x20455f['transfertargetuniqueid']][_0xca63('0x3f')]=0x2;queues[_0x20455f[_0xca63('0x41')]][_0xca63('0x6')]=queues[_0x20455f['origtransfererlinkedid']]['calleridnum'];queues[_0x20455f[_0xca63('0x41')]][_0xca63('0x46')]=queues[_0x20455f[_0xca63('0x38')]][_0xca63('0x46')];queues[_0x20455f['transfertargetuniqueid']][_0xca63('0x47')]=utils['now']();queues[_0x20455f[_0xca63('0x41')]][_0xca63('0x21')]=utils[_0xca63('0x10')]();queues[_0x20455f['transfertargetuniqueid']][_0xca63('0x22')]=0x0;queues[_0x20455f[_0xca63('0x41')]]['mohtime']=0x0;}else{queues[_0x20455f['secondtransfererlinkedid']][_0xca63('0xc')]=_0x20455f['origtransfererlinkedid'];}}}}catch(_0x3da874){utils[_0xca63('0x48')](_0x3da874['stack']);}};exports[_0xca63('0x49')]=function(_0x1083d8){if(!_[_0xca63('0x11')](queues[_0x1083d8['uniqueid']])){queues[_0x1083d8[_0xca63('0x3')]][_0xca63('0x4a')]=utils['now']();}};exports[_0xca63('0x4b')]=function(_0x58b8b1){if(!_[_0xca63('0x11')](queues[_0x58b8b1['uniqueid']])){if(!_[_0xca63('0x11')](queues[_0x58b8b1['uniqueid']][_0xca63('0x4a')])){queues[_0x58b8b1[_0xca63('0x3')]]['mohtime']+=utils['diffTime'](utils[_0xca63('0x10')](),queues[_0x58b8b1[_0xca63('0x3')]][_0xca63('0x4a')]);delete queues[_0x58b8b1[_0xca63('0x3')]]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index e02c196..776dbb3 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 _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x49250f,_0x1b7ef7){var _0x11b7a6=function(_0x2e685a){while(--_0x2e685a){_0x49250f['push'](_0x49250f['shift']());}};_0x11b7a6(++_0x1b7ef7);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a10e3,_0x3cdb35){_0x3a10e3=_0x3a10e3-0x0;var _0xf067c8=_0xedd9[_0x3a10e3];return _0xf067c8;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file +var _0xa9e0=['application','set','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','uniqueid','accountcode','exten','context','channel','isNil','channelstate','linkedid','transfer','error','varset','variable','endsWith','.wav49','value','replace','.WAV','find','monitors','stack','hangup','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0x0a9e('0x0'));var utils=require(_0x0a9e('0x1'));var recordings={};function writeDB(_0x29929c){utils['debug'](_0x29929c);if(_0x29929c['accountcode']){utils[_0x0a9e('0x2')](_0x29929c['accountcode'])[_0x0a9e('0x3')](function(_0x432180){if(_0x432180){_0x29929c[_0x0a9e('0x4')]=_0x432180[_0x0a9e('0x5')];_0x29929c[_0x0a9e('0x6')]=_0x432180['id'];}utils['request'](_0x0a9e('0x7'),_0x29929c);});}else{utils[_0x0a9e('0x8')](_0x0a9e('0x7'),_0x29929c);}}exports['newchannel']=function(_0x503809){try{if(_0x503809[_0x0a9e('0x9')]==_0x503809['linkedid']){recordings[_0x503809['uniqueid']]={'uniqueid':_0x503809[_0x0a9e('0x9')],'accountcode':_0x503809[_0x0a9e('0xa')],'exten':_0x503809[_0x0a9e('0xb')],'context':_0x503809[_0x0a9e('0xc')],'channel':_0x503809[_0x0a9e('0xd')],'monitors':[]};}}catch(_0xbd1168){utils['error'](_0xbd1168['stack']);}};exports['newstate']=function(_0x4cfe67){try{if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x9')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6){}else if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x10')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6&&_0x4cfe67['context']!=_0x0a9e('0x11')){recordings[_0x4cfe67[_0x0a9e('0x10')]][_0x0a9e('0xa')]=_0x4cfe67[_0x0a9e('0xa')];}}catch(_0x44dcfd){utils[_0x0a9e('0x12')](_0x44dcfd['stack']);}};exports[_0x0a9e('0x13')]=function(_0x5d0880){try{if(!_[_0x0a9e('0xe')](_0x5d0880['variable'])&&!_[_0x0a9e('0xe')](_0x5d0880[_0x0a9e('0x14')]['mixmonitor_filename'])){if(_[_0x0a9e('0x15')](_0x5d0880['value'],_0x0a9e('0x16'))){_0x5d0880[_0x0a9e('0x17')]=_0x5d0880[_0x0a9e('0x17')][_0x0a9e('0x18')](_0x0a9e('0x16'),_0x0a9e('0x19'));}if(recordings[_0x5d0880[_0x0a9e('0x10')]]){var _0x20559e=_[_0x0a9e('0x1a')](recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')],{'value':_0x5d0880[_0x0a9e('0x17')]});if(_['isNil'](_0x20559e)){recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')]['push']({'value':_0x5d0880[_0x0a9e('0x17')]});}}}}catch(_0x5a09ef){utils['error'](_0x5a09ef[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x1d')]=function(_0x38e7c4){try{if(!_[_0x0a9e('0xe')](recordings[_0x38e7c4['uniqueid']])){recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1e')]=_0x38e7c4[_0x0a9e('0x1e')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1f')]=_0x38e7c4[_0x0a9e('0x1f')];recordings[_0x38e7c4[_0x0a9e('0x9')]]['connectedlinenum']=_0x38e7c4['connectedlinenum'];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]=_0x38e7c4[_0x0a9e('0x20')];if(recordings[_0x38e7c4[_0x0a9e('0x9')]]['type']==_0x0a9e('0x21')&&recordings[_0x38e7c4['uniqueid']][_0x0a9e('0xa')]){recordings[_0x38e7c4['uniqueid']][_0x0a9e('0x22')]=recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0xa')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]='';}recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1b')][_0x0a9e('0x23')](_0x5a101a=>{var _0x3652a7=_[_0x0a9e('0x24')](recordings[_0x38e7c4[_0x0a9e('0x9')]]);_0x3652a7[_0x0a9e('0x17')]=_0x5a101a['value'];writeDB(_0x3652a7);});delete recordings[_0x38e7c4[_0x0a9e('0x9')]];}}catch(_0x40e7a3){utils[_0x0a9e('0x12')](_0x40e7a3[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x25')]=function(_0x563b45){try{if(!_[_0x0a9e('0xe')](recordings[_0x563b45[_0x0a9e('0x9')]])){if(_0x563b45[_0x0a9e('0x26')]['toLowerCase']()==_0x0a9e('0x27')&&_['startsWith'](_0x563b45[_0x0a9e('0x28')][_0x0a9e('0x29')](),_0x0a9e('0x2a'))){var _0x33bdb7=_0x563b45[_0x0a9e('0x28')]['split']('=');var _0x66c1d2=_0x33bdb7[0x0][_0x0a9e('0x2b')](_0x33bdb7[0x0][_0x0a9e('0x2c')]('(')+0x1,_0x33bdb7[0x0][_0x0a9e('0x2c')](')'));var _0x2b45ea=_0x33bdb7[0x1];recordings[_0x563b45[_0x0a9e('0x9')]][_0x66c1d2]=_0x2b45ea;}}}catch(_0x332d35){utils[_0x0a9e('0x12')](_0x332d35['stack']);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(!_[_0x0a9e('0xe')](recordings[_0x5e7238[_0x0a9e('0x9')]])){recordings[_0x5e7238[_0x0a9e('0x9')]][_0x0a9e('0x2e')]=_0x5e7238['queue'];}}catch(_0x191e91){utils[_0x0a9e('0x12')](_0x191e91[_0x0a9e('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 18fd9f9..943646a 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 _0xf43e=['blind','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','lodash','util','./utils','info','format','request','type'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf43e,0x75));var _0xef43=function(_0x585dcd,_0x15f700){_0x585dcd=_0x585dcd-0x0;var _0x10aacb=_0xf43e[_0x585dcd];return _0x10aacb;};'use strict';var _=require(_0xef43('0x0'));var util=require(_0xef43('0x1'));var utils=require(_0xef43('0x2'));function writeDB(_0x25a8bb){utils[_0xef43('0x3')](util[_0xef43('0x4')]('TRANSFER|%s',_0x25a8bb['type']));utils[_0xef43('0x5')]('CreateVoiceTransferReport',_0x25a8bb);}exports['blindtransfer']=function(_0x550153){try{_0x550153[_0xef43('0x6')]=_0xef43('0x7');writeDB(_0x550153);}catch(_0x2e9ed6){utils['error'](_0x2e9ed6[_0xef43('0x8')]);}};exports[_0xef43('0x9')]=function(_0x2a0913){try{_0x2a0913=_[_0xef43('0xa')](_0x2a0913,{'transfererchannel':_0x2a0913[_0xef43('0xb')],'transferercalleridnum':_0x2a0913[_0xef43('0xc')],'transferercalleridname':_0x2a0913[_0xef43('0xd')],'transfererconnectedlinenum':_0x2a0913[_0xef43('0xe')],'transfererconnectedlinename':_0x2a0913[_0xef43('0xf')],'transfereraccountcode':_0x2a0913['origtransfereraccountcode'],'transferercontext':_0x2a0913[_0xef43('0x10')],'transfererexten':_0x2a0913[_0xef43('0x11')],'transfererlinkedid':_0x2a0913[_0xef43('0x12')],'context':_0x2a0913[_0xef43('0x13')],'extension':_0x2a0913['origtransfererexten'],'type':'attended'});if(_[_0xef43('0x14')](_0x2a0913[_0xef43('0x15')])){_0x2a0913=_[_0xef43('0xa')](_0x2a0913,{'transfereechannel':_0x2a0913[_0xef43('0x16')],'transfereecalleridnum':_0x2a0913[_0xef43('0x17')],'transfereecalleridname':_0x2a0913[_0xef43('0x18')],'transfereeconnectedlinenum':_0x2a0913[_0xef43('0x19')],'transfereeconnectedlinename':_0x2a0913['transfertargetconnectedlinename'],'transfereeaccountcode':_0x2a0913[_0xef43('0x1a')],'transfereecontext':_0x2a0913[_0xef43('0x1b')],'transfereeexten':_0x2a0913[_0xef43('0x1c')],'transfereelinkedid':_0x2a0913[_0xef43('0x1d')]});}writeDB(_0x2a0913);}catch(_0x159730){utils[_0xef43('0x1e')](_0x159730[_0xef43('0x8')]);}}; \ No newline at end of file +var _0x01ab=['lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid'];(function(_0x41a3ab,_0x4bb061){var _0x3c9da9=function(_0x37c124){while(--_0x37c124){_0x41a3ab['push'](_0x41a3ab['shift']());}};_0x3c9da9(++_0x4bb061);}(_0x01ab,0xaa));var _0xb01a=function(_0x16dfee,_0x1dba0b){_0x16dfee=_0x16dfee-0x0;var _0x3ced82=_0x01ab[_0x16dfee];return _0x3ced82;};'use strict';var _=require(_0xb01a('0x0'));var util=require(_0xb01a('0x1'));var utils=require(_0xb01a('0x2'));function writeDB(_0x4d7b62){utils[_0xb01a('0x3')](util[_0xb01a('0x4')](_0xb01a('0x5'),_0x4d7b62[_0xb01a('0x6')]));utils[_0xb01a('0x7')](_0xb01a('0x8'),_0x4d7b62);}exports[_0xb01a('0x9')]=function(_0x1fb27a){try{_0x1fb27a[_0xb01a('0x6')]=_0xb01a('0xa');writeDB(_0x1fb27a);}catch(_0x3e4e7d){utils[_0xb01a('0xb')](_0x3e4e7d[_0xb01a('0xc')]);}};exports[_0xb01a('0xd')]=function(_0x3ae6eb){try{_0x3ae6eb=_[_0xb01a('0xe')](_0x3ae6eb,{'transfererchannel':_0x3ae6eb['origtransfererchannel'],'transferercalleridnum':_0x3ae6eb[_0xb01a('0xf')],'transferercalleridname':_0x3ae6eb[_0xb01a('0x10')],'transfererconnectedlinenum':_0x3ae6eb[_0xb01a('0x11')],'transfererconnectedlinename':_0x3ae6eb[_0xb01a('0x12')],'transfereraccountcode':_0x3ae6eb[_0xb01a('0x13')],'transferercontext':_0x3ae6eb[_0xb01a('0x14')],'transfererexten':_0x3ae6eb[_0xb01a('0x15')],'transfererlinkedid':_0x3ae6eb[_0xb01a('0x16')],'context':_0x3ae6eb[_0xb01a('0x17')],'extension':_0x3ae6eb[_0xb01a('0x18')],'type':'attended'});if(_[_0xb01a('0x19')](_0x3ae6eb[_0xb01a('0x1a')])){_0x3ae6eb=_[_0xb01a('0xe')](_0x3ae6eb,{'transfereechannel':_0x3ae6eb[_0xb01a('0x1b')],'transfereecalleridnum':_0x3ae6eb['transfertargetcalleridnum'],'transfereecalleridname':_0x3ae6eb[_0xb01a('0x1c')],'transfereeconnectedlinenum':_0x3ae6eb[_0xb01a('0x1d')],'transfereeconnectedlinename':_0x3ae6eb[_0xb01a('0x1e')],'transfereeaccountcode':_0x3ae6eb[_0xb01a('0x1f')],'transfereecontext':_0x3ae6eb['transfertargetcontext'],'transfereeexten':_0x3ae6eb[_0xb01a('0x20')],'transfereelinkedid':_0x3ae6eb[_0xb01a('0x21')]});}writeDB(_0x3ae6eb);}catch(_0x37e367){utils['error'](_0x37e367['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index a8ccddf..40cd9f7 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 _0x8430=['now','isAfter','isBefore','jayson/promise','bluebird','xdr','info','debug','stringify','request','then','catch','error','stack','GetUser','internal','name','interface','GETUSER|','result','NOTFOUND','getUserByInternal','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','length','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime'];(function(_0x3e6c96,_0x5b780b){var _0x43a176=function(_0x23c4f6){while(--_0x23c4f6){_0x3e6c96['push'](_0x3e6c96['shift']());}};_0x43a176(++_0x5b780b);}(_0x8430,0x97));var _0x0843=function(_0x322522,_0x4db288){_0x322522=_0x322522-0x0;var _0x293bcf=_0x8430[_0x322522];return _0x293bcf;};'use strict';var jayson=require(_0x0843('0x0'));var moment=require('moment');var BPromise=require(_0x0843('0x1'));var client=jayson['client']['http']({'port':0x2329});var logger=require('../../config/logger')(_0x0843('0x2'));exports[_0x0843('0x3')]=function(_0xd94485){logger[_0x0843('0x3')](_0xd94485);};exports[_0x0843('0x4')]=function(_0x2bd131){logger[_0x0843('0x4')](JSON[_0x0843('0x5')](_0x2bd131));};exports['error']=function(_0x55e26a){logger['error'](_0x55e26a['stack']);};exports[_0x0843('0x6')]=function(_0x4ad5a7,_0x5b8bfc){return client[_0x0843('0x6')](_0x4ad5a7,{'body':_0x5b8bfc})[_0x0843('0x7')](function(_0x199bd7){logger[_0x0843('0x4')](JSON[_0x0843('0x5')](_0x199bd7));})[_0x0843('0x8')](function(_0xb27d1){logger[_0x0843('0x9')](_0xb27d1[_0x0843('0xa')]);});};function getUser(_0x31e6c6){return client[_0x0843('0x6')](_0x0843('0xb'),{'options':{'raw':!![],'attributes':['id',_0x0843('0xc'),_0x0843('0xd'),_0x0843('0xe')],'where':_0x31e6c6,'limit':0x1}})[_0x0843('0x7')](function(_0x231ddd){logger[_0x0843('0x3')](_0x0843('0xf')+JSON['stringify'](_0x31e6c6)+'|'+(_0x231ddd[_0x0843('0x10')]['length']?'FOUND':_0x0843('0x11')));return _0x231ddd[_0x0843('0x10')]['length']?_0x231ddd[_0x0843('0x10')][0x0]:null;});}exports[_0x0843('0x12')]=function(_0x392233){return new BPromise(function(_0xc844fe,_0x27dadc){if(_0x392233){return getUser({'internal':_0x392233})[_0x0843('0x7')](function(_0x658004){return _0xc844fe(_0x658004);})[_0x0843('0x8')](function(_0x5ed2c1){logger[_0x0843('0x9')](_0x5ed2c1[_0x0843('0xa')]);return _0xc844fe(null);});}else{return _0xc844fe(null);}});};exports['getUserByInterface']=function(_0x2da8c7){return new BPromise(function(_0x4f7c9b,_0x31329b){if(_0x2da8c7){return getUser({'interface':_0x2da8c7})[_0x0843('0x7')](function(_0x58c654){return _0x4f7c9b(_0x58c654);})[_0x0843('0x8')](function(_0x3db1c7){logger[_0x0843('0x9')](_0x3db1c7['stack']);return _0x4f7c9b(null);});}else{return _0x4f7c9b(null);}});};exports[_0x0843('0x13')]=function(_0x266d17){return new BPromise(function(_0x3beda9,_0x313ca5){if(_0x266d17){return getUser({'name':_0x266d17})['then'](function(_0x188261){return _0x3beda9(_0x188261);})['catch'](function(_0x118614){logger[_0x0843('0x9')](_0x118614['stack']);return _0x3beda9(null);});}else{return _0x3beda9(null);}});};exports[_0x0843('0x14')]=function(_0x5e19c3){return new BPromise(function(_0x12bc24,_0xd0956f){if(_0x5e19c3){return client['request'](_0x0843('0x15'),{'options':{'raw':!![],'attributes':['id',_0x0843('0xd'),_0x0843('0x16'),'acw',_0x0843('0x17')],'where':{'name':_0x5e19c3},'limit':0x1}})['then'](function(_0x2f9e28){logger[_0x0843('0x3')](_0x0843('0x18')+_0x5e19c3+'|'+(_0x2f9e28[_0x0843('0x10')]['length']?_0x0843('0x19'):_0x0843('0x11')));return _0x12bc24(_0x2f9e28[_0x0843('0x10')][_0x0843('0x1a')]?_0x2f9e28[_0x0843('0x10')][0x0]:null);})['catch'](function(_0x4a22be){logger[_0x0843('0x9')](_0x4a22be['stack']);return _0x12bc24(null);});}else{return _0x12bc24(null);}});};exports[_0x0843('0x1b')]=function(_0x124263,_0x5941a5){return moment(_0x124263)[_0x0843('0x1c')](_0x5941a5,'seconds')[_0x0843('0x1d')](_0x0843('0x1e'));};exports['subtractTime']=function(_0x3b0a13,_0x148bfd){return moment(_0x3b0a13)['subtract'](_0x148bfd,'seconds')[_0x0843('0x1d')](_0x0843('0x1e'));};exports[_0x0843('0x1f')]=function(_0x4d7c8b,_0x251c92){return moment(_0x4d7c8b)[_0x0843('0x20')](moment(_0x251c92),'seconds');};exports[_0x0843('0x21')]=function(_0x26dc97,_0x546f9c){return parseInt(_0x26dc97,0xa)+parseInt(_0x546f9c,0xa);};exports[_0x0843('0x22')]=function(){return moment()[_0x0843('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x0843('0x23')]=function(_0x395362,_0x4c4d40){if(_0x4c4d40){return moment(_0x395362)[_0x0843('0x23')](_0x4c4d40);}else{return!![];}};exports[_0x0843('0x24')]=function(_0xad6225,_0x24a529){if(_0x24a529){return moment(_0xad6225)['isBefore'](_0x24a529);}else if(_0xad6225){return!![];}else{return![];}}; \ No newline at end of file +var _0x3824=['isBefore','jayson/promise','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','request','then','catch','stack','GetUser','internal','interface','GETUSER|','FOUND','NOTFOUND','result','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','GETVOICEQUEUEBYNAME|','length','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diff','sumTime','now','isAfter'];(function(_0x21f3f5,_0x1c1c35){var _0x2bfb15=function(_0x48176d){while(--_0x48176d){_0x21f3f5['push'](_0x21f3f5['shift']());}};_0x2bfb15(++_0x1c1c35);}(_0x3824,0xd3));var _0x4382=function(_0x2ff4bd,_0x4780a6){_0x2ff4bd=_0x2ff4bd-0x0;var _0x28edc6=_0x3824[_0x2ff4bd];return _0x28edc6;};'use strict';var jayson=require(_0x4382('0x0'));var moment=require(_0x4382('0x1'));var BPromise=require(_0x4382('0x2'));var client=jayson[_0x4382('0x3')][_0x4382('0x4')]({'port':0x2329});var logger=require(_0x4382('0x5'))(_0x4382('0x6'));exports[_0x4382('0x7')]=function(_0x2c2068){logger[_0x4382('0x7')](_0x2c2068);};exports[_0x4382('0x8')]=function(_0x56fac8){logger['debug'](JSON[_0x4382('0x9')](_0x56fac8));};exports[_0x4382('0xa')]=function(_0x1816c9){logger[_0x4382('0xa')](_0x1816c9['stack']);};exports[_0x4382('0xb')]=function(_0x18b9e6,_0x25b405){return client[_0x4382('0xb')](_0x18b9e6,{'body':_0x25b405})[_0x4382('0xc')](function(_0x4780ea){logger[_0x4382('0x8')](JSON['stringify'](_0x4780ea));})[_0x4382('0xd')](function(_0x51c03e){logger[_0x4382('0xa')](_0x51c03e[_0x4382('0xe')]);});};function getUser(_0x1f6037){return client['request'](_0x4382('0xf'),{'options':{'raw':!![],'attributes':['id',_0x4382('0x10'),'name',_0x4382('0x11')],'where':_0x1f6037,'limit':0x1}})[_0x4382('0xc')](function(_0x318315){logger[_0x4382('0x7')](_0x4382('0x12')+JSON['stringify'](_0x1f6037)+'|'+(_0x318315['result']['length']?_0x4382('0x13'):_0x4382('0x14')));return _0x318315[_0x4382('0x15')]['length']?_0x318315[_0x4382('0x15')][0x0]:null;});}exports[_0x4382('0x16')]=function(_0x1161ab){return new BPromise(function(_0x3533eb,_0x2ef892){if(_0x1161ab){return getUser({'internal':_0x1161ab})[_0x4382('0xc')](function(_0x3b67f0){return _0x3533eb(_0x3b67f0);})[_0x4382('0xd')](function(_0x3d09ba){logger[_0x4382('0xa')](_0x3d09ba[_0x4382('0xe')]);return _0x3533eb(null);});}else{return _0x3533eb(null);}});};exports[_0x4382('0x17')]=function(_0x14fe10){return new BPromise(function(_0x350093,_0x7e058c){if(_0x14fe10){return getUser({'interface':_0x14fe10})[_0x4382('0xc')](function(_0x234ea5){return _0x350093(_0x234ea5);})['catch'](function(_0x4a9fca){logger[_0x4382('0xa')](_0x4a9fca[_0x4382('0xe')]);return _0x350093(null);});}else{return _0x350093(null);}});};exports[_0x4382('0x18')]=function(_0x406c4a){return new BPromise(function(_0x9234c5,_0xe02fae){if(_0x406c4a){return getUser({'name':_0x406c4a})[_0x4382('0xc')](function(_0x149505){return _0x9234c5(_0x149505);})[_0x4382('0xd')](function(_0x3a322b){logger[_0x4382('0xa')](_0x3a322b[_0x4382('0xe')]);return _0x9234c5(null);});}else{return _0x9234c5(null);}});};exports[_0x4382('0x19')]=function(_0x3b1348){return new BPromise(function(_0x1b6e8b,_0x335c09){if(_0x3b1348){return client[_0x4382('0xb')](_0x4382('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x4382('0x1b'),'type',_0x4382('0x1c'),_0x4382('0x1d')],'where':{'name':_0x3b1348},'limit':0x1}})['then'](function(_0x522fd3){logger[_0x4382('0x7')](_0x4382('0x1e')+_0x3b1348+'|'+(_0x522fd3[_0x4382('0x15')][_0x4382('0x1f')]?_0x4382('0x13'):_0x4382('0x14')));return _0x1b6e8b(_0x522fd3[_0x4382('0x15')][_0x4382('0x1f')]?_0x522fd3[_0x4382('0x15')][0x0]:null);})[_0x4382('0xd')](function(_0x3d35e8){logger[_0x4382('0xa')](_0x3d35e8['stack']);return _0x1b6e8b(null);});}else{return _0x1b6e8b(null);}});};exports['addTime']=function(_0x43270b,_0x5a982f){return moment(_0x43270b)[_0x4382('0x20')](_0x5a982f,_0x4382('0x21'))[_0x4382('0x22')](_0x4382('0x23'));};exports['subtractTime']=function(_0x397b4f,_0x4b92ae){return moment(_0x397b4f)[_0x4382('0x24')](_0x4b92ae,'seconds')[_0x4382('0x22')](_0x4382('0x23'));};exports['diffTime']=function(_0x57d184,_0x4d03b2){return moment(_0x57d184)[_0x4382('0x25')](moment(_0x4d03b2),_0x4382('0x21'));};exports[_0x4382('0x26')]=function(_0x14b22b,_0x5349ef){return parseInt(_0x14b22b,0xa)+parseInt(_0x5349ef,0xa);};exports[_0x4382('0x27')]=function(){return moment()[_0x4382('0x22')](_0x4382('0x23'));};exports[_0x4382('0x28')]=function(_0xe0fc8d,_0x4d7904){if(_0x4d7904){return moment(_0xe0fc8d)[_0x4382('0x28')](_0x4d7904);}else{return!![];}};exports[_0x4382('0x29')]=function(_0x2fe183,_0x1deb33){if(_0x1deb33){return moment(_0x2fe183)[_0x4382('0x29')](_0x1deb33);}else if(_0x2fe183){return!![];}else{return![];}}; \ No newline at end of file